diff --git a/packages/components/package.json b/packages/components/package.json index e5023e10..60326eed 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -5,14 +5,14 @@ "dependencies": { "@headlessui/react": "^1.6.4", "@heroicons/react": "^1.0.6", - "@hookform/resolvers": "^2.9.0", + "@hookform/resolvers": "^2.9.1", "@quri/squiggle-lang": "^0.2.8", "@react-hook/size": "^2.1.2", "lodash": "^4.17.21", "react": "^18.1.0", "react-ace": "^10.1.0", "react-dom": "^18.1.0", - "react-hook-form": "^7.31.3", + "react-hook-form": "^7.32.0", "react-use": "^17.4.0", "react-vega": "^7.5.1", "vega": "^5.22.1", @@ -22,11 +22,11 @@ }, "devDependencies": { "@babel/plugin-proposal-private-property-in-object": "^7.17.12", - "@storybook/addon-actions": "^6.5.7", + "@storybook/addon-actions": "^6.5.8", "@storybook/addon-essentials": "^6.5.7", - "@storybook/addon-links": "^6.5.7", + "@storybook/addon-links": "^6.5.8", "@storybook/builder-webpack5": "^6.5.7", - "@storybook/manager-webpack5": "^6.5.7", + "@storybook/manager-webpack5": "^6.5.8", "@storybook/node-logger": "^6.5.6", "@storybook/preset-create-react-app": "^4.1.2", "@storybook/react": "^6.5.7", @@ -48,13 +48,13 @@ "postcss-loader": "^7.0.0", "react-scripts": "^5.0.1", "style-loader": "^3.3.1", - "tailwindcss": "^3.0.24", + "tailwindcss": "^3.1.2", "ts-loader": "^9.3.0", "tsconfig-paths-webpack-plugin": "^3.5.2", "typescript": "^4.7.3", "web-vitals": "^2.1.4", "webpack": "^5.73.0", - "webpack-cli": "^4.9.2", + "webpack-cli": "^4.10.0", "webpack-dev-server": "^4.9.0" }, "scripts": { diff --git a/packages/squiggle-lang/__tests__/Reducer/Reducer_Dispatch/Reducer_Dispatch_BuiltIn_test.res b/packages/squiggle-lang/__tests__/Reducer/Reducer_Dispatch/Reducer_Dispatch_BuiltIn_test.res index 682e1737..fb891bb3 100644 --- a/packages/squiggle-lang/__tests__/Reducer/Reducer_Dispatch/Reducer_Dispatch_BuiltIn_test.res +++ b/packages/squiggle-lang/__tests__/Reducer/Reducer_Dispatch/Reducer_Dispatch_BuiltIn_test.res @@ -18,7 +18,7 @@ describe("builtin", () => { testEval("2>1", "Ok(true)") testEval("concat('a','b')", "Ok('ab')") testEval( - "addOne(t)=t+1; toInternalSampleArray(mapSamples(fromSamples([1,2,3,4,5,6]), addOne))", + "addOne(t)=t+1; toList(mapSamples(fromSamples([1,2,3,4,5,6]), addOne))", "Ok([2,3,4,5,6,7])", ) }) diff --git a/packages/squiggle-lang/__tests__/Reducer/Reducer_Peggy/Reducer_Peggy_ToExpression_type_test.res b/packages/squiggle-lang/__tests__/Reducer/Reducer_Peggy/Reducer_Peggy_ToExpression_type_test.res index 05ec5722..e5609aea 100644 --- a/packages/squiggle-lang/__tests__/Reducer/Reducer_Peggy/Reducer_Peggy_ToExpression_type_test.res +++ b/packages/squiggle-lang/__tests__/Reducer/Reducer_Peggy/Reducer_Peggy_ToExpression_type_test.res @@ -88,8 +88,8 @@ describe("Peggy Types to Expression", () => { }) describe("squiggle expressions in type modifiers", () => { testToExpression( - "odds1 = [1,3,5]; odds2 = [7, 9]; type odds = number<-memberOf(odds1 + odds2)", - "{(:$_let_$ :odds1 {(:$_constructArray_$ (1 3 5))}); (:$_let_$ :odds2 {(:$_constructArray_$ (7 9))}); (:$_typeAlias_$ #odds (:$_typeModifier_memberOf_$ #number (:add :odds1 :odds2)))}", + "odds1 = [1,3,5]; odds2 = [7, 9]; type odds = number<-memberOf(concat(odds1, odds2))", + "{(:$_let_$ :odds1 {(:$_constructArray_$ (1 3 5))}); (:$_let_$ :odds2 {(:$_constructArray_$ (7 9))}); (:$_typeAlias_$ #odds (:$_typeModifier_memberOf_$ #number (:concat :odds1 :odds2)))}", ~v="{_typeAliases_: {odds: {typeTag: 'typeIdentifier',typeIdentifier: #number,memberOf: [1,3,5,7,9]}},odds1: [1,3,5],odds2: [7,9]}", (), ) diff --git a/packages/squiggle-lang/__tests__/Reducer/Reducer_mapReduce_test.res b/packages/squiggle-lang/__tests__/Reducer/Reducer_mapReduce_test.res index 5414f827..f3df0962 100644 --- a/packages/squiggle-lang/__tests__/Reducer/Reducer_mapReduce_test.res +++ b/packages/squiggle-lang/__tests__/Reducer/Reducer_mapReduce_test.res @@ -7,7 +7,7 @@ describe("map reduce", () => { testEvalToBe("change(acc,x)=acc*x+x; arr=[1,2,3]; reduce(arr, 0, change)", "Ok(15)") testEvalToBe("change(acc,x)=acc*x+x; arr=[1,2,3]; reduceReverse(arr, 0, change)", "Ok(9)") testEvalToBe("arr=[1,2,3]; reverse(arr)", "Ok([3,2,1])") - testEvalToBe("check(x)=(x==2);arr=[1,2,3]; keep(arr,check)", "Ok([2])") + testEvalToBe("check(x)=(x==2);arr=[1,2,3]; filter(arr,check)", "Ok([2])") }) Skip.describe("map reduce (sam)", () => { diff --git a/packages/squiggle-lang/package.json b/packages/squiggle-lang/package.json index 7c519cb0..abc9f239 100644 --- a/packages/squiggle-lang/package.json +++ b/packages/squiggle-lang/package.json @@ -57,14 +57,14 @@ "moduleserve": "^0.9.1", "nyc": "^15.1.0", "peggy": "^2.0.1", - "reanalyze": "^2.22.0", + "reanalyze": "^2.23.0", "rescript-fast-check": "^1.1.1", "ts-jest": "^27.1.4", "ts-loader": "^9.3.0", "ts-node": "^10.8.1", "typescript": "^4.7.3", "webpack": "^5.73.0", - "webpack-cli": "^4.9.2" + "webpack-cli": "^4.10.0" }, "source": "./src/js/index.ts", "main": "./dist/src/js/index.js", diff --git a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res index 845d2ffc..22323e80 100644 --- a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res @@ -47,6 +47,9 @@ type fnDefinition = { type function = { name: string, definitions: array, + examples: option, + description: option, + isExperimental: bool, } type registry = array @@ -57,10 +60,10 @@ module FRType = { switch t { | FRTypeNumber => "number" | FRTypeNumeric => "numeric" - | FRTypeDistOrNumber => "frValueDistOrNumber" + | FRTypeDistOrNumber => "distribution|number" | FRTypeRecord(r) => { let input = ((name, frType): frTypeRecordParam) => `${name}: ${toString(frType)}` - `record({${r->E.A2.fmap(input)->E.A2.joinWith(", ")}})` + `{${r->E.A2.fmap(input)->E.A2.joinWith(", ")}}` } | FRTypeArray(r) => `list(${toString(r)})` | FRTypeLambda => `lambda` @@ -331,13 +334,34 @@ module FnDefinition = { module Function = { type t = function - let make = (~name, ~definitions): t => { + type functionJson = { + name: string, + definitions: array, + examples: option, + description: option, + isExperimental: bool, + } + + let make = (~name, ~definitions, ~examples=?, ~description=?, ~isExperimental=false, ()): t => { name: name, definitions: definitions, + examples: examples, + isExperimental: isExperimental, + description: description, + } + + let toJson = (t: t): functionJson => { + name: t.name, + definitions: t.definitions->E.A2.fmap(FnDefinition.toString), + examples: t.examples, + description: t.description, + isExperimental: t.isExperimental, } } module Registry = { + let toJson = (r: registry) => r->E.A2.fmap(Function.toJson) + /* There's a (potential+minor) bug here: If a function definition is called outside of the calls to the registry, then it's possible that there could be a match after the registry is @@ -350,6 +374,7 @@ module Registry = { ~env: DistributionOperation.env, ) => { let matchToDef = m => Matcher.Registry.matchToDef(registry, m) + //Js.log(toSimple(registry)) let showNameMatchDefinitions = matches => { let defs = matches diff --git a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Library.res b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Library.res index 13c49991..74929c0b 100644 --- a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Library.res +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Library.res @@ -57,6 +57,7 @@ let registry = [ ~run=(inputs, _) => inputsTodist(inputs, r => Continuous(Continuous.make(r))), ), ], + (), ), Function.make( ~name="toDiscretePointSet", @@ -67,6 +68,7 @@ let registry = [ ~run=(inputs, _) => inputsTodist(inputs, r => Discrete(Discrete.make(r))), ), ], + (), ), Function.make( ~name="Declaration", @@ -75,9 +77,13 @@ let registry = [ inputs->getOrError(0)->E.R.bind(Declaration.fromExpressionValue) }), ], + (), ), Function.make( ~name="Normal", + ~examples=`normal(5,1) +normal({p5: 4, p95: 10}) +normal({mean: 5, stdev: 2})`, ~definitions=[ TwoArgDist.make("normal", twoArgs(SymbolicDist.Normal.make)), TwoArgDist.makeRecordP5P95("normal", r => @@ -85,9 +91,13 @@ let registry = [ ), TwoArgDist.makeRecordMeanStdev("normal", twoArgs(SymbolicDist.Normal.make)), ], + (), ), Function.make( ~name="Lognormal", + ~examples=`lognormal(0.5, 0.8) +lognormal({p5: 4, p95: 10}) +lognormal({mean: 5, stdev: 2})`, ~definitions=[ TwoArgDist.make("lognormal", twoArgs(SymbolicDist.Lognormal.make)), TwoArgDist.makeRecordP5P95("lognormal", r => @@ -95,29 +105,43 @@ let registry = [ ), TwoArgDist.makeRecordMeanStdev("lognormal", twoArgs(SymbolicDist.Lognormal.fromMeanAndStdev)), ], + (), ), Function.make( ~name="Uniform", + ~examples=`uniform(10, 12)`, ~definitions=[TwoArgDist.make("uniform", twoArgs(SymbolicDist.Uniform.make))], + (), ), Function.make( ~name="Beta", + ~examples=`beta(20, 25)`, ~definitions=[TwoArgDist.make("beta", twoArgs(SymbolicDist.Beta.make))], + (), ), Function.make( ~name="Cauchy", + ~examples=`cauchy(5, 1)`, ~definitions=[TwoArgDist.make("cauchy", twoArgs(SymbolicDist.Cauchy.make))], + (), ), Function.make( ~name="Gamma", + ~examples=`gamma(5, 1)`, ~definitions=[TwoArgDist.make("gamma", twoArgs(SymbolicDist.Gamma.make))], + (), ), Function.make( ~name="Logistic", + ~examples=`gamma(5, 1)`, ~definitions=[TwoArgDist.make("logistic", twoArgs(SymbolicDist.Logistic.make))], + (), ), Function.make( - ~name="To", + ~name="To (Distribution)", + ~examples=`5 to 10 +to(5,10) +-5 to 5`, ~definitions=[ TwoArgDist.make("to", twoArgs(SymbolicDist.From90thPercentile.make)), TwoArgDist.make( @@ -125,63 +149,149 @@ let registry = [ twoArgs(SymbolicDist.From90thPercentile.make), ), ], + (), ), Function.make( ~name="Exponential", + ~examples=`exponential(2)`, ~definitions=[OneArgDist.make("exponential", SymbolicDist.Exponential.make)], + (), ), Function.make( ~name="Bernoulli", + ~examples=`bernoulli(0.5)`, ~definitions=[OneArgDist.make("bernoulli", SymbolicDist.Bernoulli.make)], + (), + ), + Function.make( + ~name="PointMass", + ~examples=`pointMass(0.5)`, + ~definitions=[OneArgDist.make("pointMass", SymbolicDist.Float.makeSafe)], + (), + ), + Function.make( + ~name="toContinuousPointSet", + ~description="Converts a set of points to a continuous distribution", + ~examples=`toContinuousPointSet([ + {x: 0, y: 0.1}, + {x: 1, y: 0.2}, + {x: 2, y: 0.15}, + {x: 3, y: 0.1} +])`, + ~definitions=[ + FnDefinition.make( + ~name="toContinuousPointSet", + ~inputs=[FRTypeArray(FRTypeRecord([("x", FRTypeNumeric), ("y", FRTypeNumeric)]))], + ~run=(inputs, _) => inputsTodist(inputs, r => Continuous(Continuous.make(r))), + ), + ], + (), + ), + Function.make( + ~name="toDiscretePointSet", + ~description="Converts a set of points to a discrete distribution", + ~examples=`toDiscretePointSet([ + {x: 0, y: 0.1}, + {x: 1, y: 0.2}, + {x: 2, y: 0.15}, + {x: 3, y: 0.1} +])`, + ~definitions=[ + FnDefinition.make( + ~name="toDiscretePointSet", + ~inputs=[FRTypeArray(FRTypeRecord([("x", FRTypeNumeric), ("y", FRTypeNumeric)]))], + ~run=(inputs, _) => inputsTodist(inputs, r => Discrete(Discrete.make(r))), + ), + ], + (), + ), + Function.make( + ~name="Declaration (Continuous Function)", + ~description="Adds metadata to a function of the input ranges. Works now for numeric and date inputs. This is useful when making predictions. It allows you to limit the domain that your prediction will be used and scored within.", + ~examples=`declareFn({ + fn: {|a,b| a }, + inputs: [ + {min: 0, max: 100}, + {min: 30, max: 50} + ] +})`, + ~definitions=[ + FnDefinition.make(~name="declareFn", ~inputs=[Declaration.frType], ~run=(inputs, _) => { + inputs->E.A.unsafe_get(0)->Declaration.fromExpressionValue + }), + ], + ~isExperimental=true, + (), + ), + Function.make( + ~name="Floor", + ~definitions=[NumberToNumber.make("floor", Js.Math.floor_float)], + (), + ), + Function.make( + ~name="Ceiling", + ~definitions=[NumberToNumber.make("ceil", Js.Math.ceil_float)], + (), ), - Function.make(~name="Floor", ~definitions=[NumberToNumber.make("floor", Js.Math.floor_float)]), - Function.make(~name="Ceiling", ~definitions=[NumberToNumber.make("ceil", Js.Math.ceil_float)]), Function.make( ~name="Absolute Value", ~definitions=[NumberToNumber.make("abs", Js.Math.abs_float)], + (), ), - Function.make(~name="Exponent", ~definitions=[NumberToNumber.make("exp", Js.Math.exp)]), - Function.make(~name="Log", ~definitions=[NumberToNumber.make("log", Js.Math.log)]), - Function.make(~name="Log Base 10", ~definitions=[NumberToNumber.make("log10", Js.Math.log10)]), - Function.make(~name="Log Base 2", ~definitions=[NumberToNumber.make("log2", Js.Math.log2)]), - Function.make(~name="Round", ~definitions=[NumberToNumber.make("round", Js.Math.round)]), + Function.make(~name="Exponent", ~definitions=[NumberToNumber.make("exp", Js.Math.exp)], ()), + Function.make(~name="Log", ~definitions=[NumberToNumber.make("log", Js.Math.log)], ()), + Function.make( + ~name="Log Base 10", + ~definitions=[NumberToNumber.make("log10", Js.Math.log10)], + (), + ), + Function.make(~name="Log Base 2", ~definitions=[NumberToNumber.make("log2", Js.Math.log2)], ()), + Function.make(~name="Round", ~definitions=[NumberToNumber.make("round", Js.Math.round)], ()), Function.make( ~name="Sum", ~definitions=[ArrayNumberDist.make("sum", r => r->E.A.Floats.sum->Wrappers.evNumber->Ok)], + (), ), Function.make( ~name="Product", ~definitions=[ ArrayNumberDist.make("product", r => r->E.A.Floats.product->Wrappers.evNumber->Ok), ], + (), ), Function.make( ~name="Min", ~definitions=[ArrayNumberDist.make("min", r => r->E.A.Floats.min->Wrappers.evNumber->Ok)], + (), ), Function.make( ~name="Max", ~definitions=[ArrayNumberDist.make("max", r => r->E.A.Floats.max->Wrappers.evNumber->Ok)], + (), ), Function.make( ~name="Mean", ~definitions=[ArrayNumberDist.make("mean", r => r->E.A.Floats.mean->Wrappers.evNumber->Ok)], + (), ), Function.make( ~name="Geometric Mean", ~definitions=[ ArrayNumberDist.make("geomean", r => r->E.A.Floats.geomean->Wrappers.evNumber->Ok), ], + (), ), Function.make( ~name="Standard Deviation", ~definitions=[ArrayNumberDist.make("stdev", r => r->E.A.Floats.stdev->Wrappers.evNumber->Ok)], + (), ), Function.make( ~name="Variance", ~definitions=[ ArrayNumberDist.make("variance", r => r->E.A.Floats.stdev->Wrappers.evNumber->Ok), ], + (), ), Function.make( ~name="First", @@ -190,6 +300,7 @@ let registry = [ r->E.A.first |> E.O.toResult(impossibleError) |> E.R.fmap(Wrappers.evNumber) ), ], + (), ), Function.make( ~name="Last", @@ -198,6 +309,7 @@ let registry = [ r->E.A.last |> E.O.toResult(impossibleError) |> E.R.fmap(Wrappers.evNumber) ), ], + (), ), Function.make( ~name="Sort", @@ -206,6 +318,7 @@ let registry = [ r->E.A.Floats.sort->E.A2.fmap(Wrappers.evNumber)->Wrappers.evArray->Ok ), ], + (), ), Function.make( ~name="Reverse", @@ -214,6 +327,7 @@ let registry = [ r->Belt_Array.reverse->E.A2.fmap(Wrappers.evNumber)->Wrappers.evArray->Ok ), ], + (), ), Function.make( ~name="Cumulative Sum", @@ -222,6 +336,7 @@ let registry = [ r->E.A.Floats.cumsum->E.A2.fmap(Wrappers.evNumber)->Wrappers.evArray->Ok ), ], + (), ), Function.make( ~name="Cumulative Prod", @@ -230,6 +345,7 @@ let registry = [ r->E.A.Floats.cumsum->E.A2.fmap(Wrappers.evNumber)->Wrappers.evArray->Ok ), ], + (), ), Function.make( ~name="Diff", @@ -238,6 +354,7 @@ let registry = [ r->E.A.Floats.diff->E.A2.fmap(Wrappers.evNumber)->Wrappers.evArray->Ok ), ], + (), ), Function.make( ~name="Dict.merge", @@ -259,6 +376,7 @@ let registry = [ }, ), ], + (), ), //TODO: Make sure that two functions can't have the same name. This causes chaos elsewhere. Function.make( @@ -275,6 +393,7 @@ let registry = [ ->E.R2.fmap(Wrappers.evRecord) ), ], + (), ), Function.make( ~name="Dict.keys", @@ -286,6 +405,7 @@ let registry = [ } ), ], + (), ), Function.make( ~name="Dict.values", @@ -301,6 +421,7 @@ let registry = [ } ), ], + (), ), Function.make( ~name="Dict.toList", @@ -322,6 +443,7 @@ let registry = [ } ), ], + (), ), Function.make( ~name="Dict.fromList", @@ -346,6 +468,7 @@ let registry = [ |> E.R2.bind(convertInternalItems) }), ], + (), ), Function.make( ~name="List.make", @@ -362,6 +485,7 @@ let registry = [ } }), ], + (), ), Function.make( ~name="upTo", @@ -376,5 +500,6 @@ let registry = [ ) ), ], + (), ), ] diff --git a/packages/squiggle-lang/src/rescript/Reducer/Reducer_Dispatch/Reducer_Dispatch_BuiltIn.res b/packages/squiggle-lang/src/rescript/Reducer/Reducer_Dispatch/Reducer_Dispatch_BuiltIn.res index 33e63496..5d1ee5f3 100644 --- a/packages/squiggle-lang/src/rescript/Reducer/Reducer_Dispatch/Reducer_Dispatch_BuiltIn.res +++ b/packages/squiggle-lang/src/rescript/Reducer/Reducer_Dispatch/Reducer_Dispatch_BuiltIn.res @@ -282,12 +282,12 @@ let callInternal = (call: functionCall, environment, reducer: ExpressionT.reduce | ("$_typeModifier_opaque_$", [EvRecord(typeRecord)]) => typeModifier_opaque_update(typeRecord) | ("$_typeOr_$", [EvArray(arr)]) => typeOr(EvArray(arr)) | ("$_typeFunction_$", [EvArray(arr)]) => typeFunction(arr) - | ("add", [EvArray(aValueArray), EvArray(bValueArray)]) => doAddArray(aValueArray, bValueArray) - | ("add", [EvString(aValueString), EvString(bValueString)]) => + | ("concat", [EvArray(aValueArray), EvArray(bValueArray)]) => doAddArray(aValueArray, bValueArray) + | ("concat", [EvString(aValueString), EvString(bValueString)]) => doAddString(aValueString, bValueString) | ("inspect", [value, EvString(label)]) => inspectLabel(value, label) | ("inspect", [value]) => inspect(value) - | ("keep", [EvArray(aValueArray), EvLambda(aLambdaValue)]) => + | ("filter", [EvArray(aValueArray), EvLambda(aLambdaValue)]) => doKeepArray(aValueArray, aLambdaValue) | ("map", [EvArray(aValueArray), EvLambda(aLambdaValue)]) => doMapArray(aValueArray, aLambdaValue) | ("mapSamples", [EvDistribution(SampleSet(dist)), EvLambda(aLambdaValue)]) => diff --git a/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_Duration.res b/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_Duration.res index 4e10dfa0..b11eda89 100644 --- a/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_Duration.res +++ b/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_Duration.res @@ -27,6 +27,7 @@ let dispatch = (call: EV.functionCall, _: DistributionOperation.env): option< EV.EvTimeDuration(DateTime.Duration.multiply(d1, d2))->Ok->Some | ("divide", [EvTimeDuration(d1), EvNumber(d2)]) => EV.EvTimeDuration(DateTime.Duration.divide(d1, d2))->Ok->Some + | ("divide", [EvTimeDuration(d1), EvTimeDuration(d2)]) => EV.EvNumber(d1 /. d2)->Ok->Some | _ => None } } diff --git a/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_GenericDistribution.res b/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_GenericDistribution.res index 20b8498a..6ef3f7a6 100644 --- a/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_GenericDistribution.res +++ b/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_GenericDistribution.res @@ -200,8 +200,6 @@ let dispatchToGenericOutput = ( ): option => { let (fnName, args) = call switch (fnName, args) { - | ("delta", [EvNumber(f)]) => - SymbolicDist.Float.makeSafe(f)->SymbolicConstructors.symbolicResultToOutput | ("triangular" as fnName, [EvNumber(f1), EvNumber(f2), EvNumber(f3)]) => SymbolicConstructors.threeFloat(fnName) ->E.R.bind(r => r(f1, f2, f3)) @@ -279,8 +277,7 @@ let dispatchToGenericOutput = ( Helpers.toDistFn(ToSampleSet(Belt.Int.fromFloat(float)), dist, ~env) | ("toSampleSet", [EvDistribution(dist)]) => Helpers.toDistFn(ToSampleSet(env.sampleCount), dist, ~env) - | ("toInternalSampleArray", [EvDistribution(SampleSet(dist))]) => - Some(FloatArray(SampleSetDist.T.get(dist))) + | ("toList", [EvDistribution(SampleSet(dist))]) => Some(FloatArray(SampleSetDist.T.get(dist))) | ("fromSamples", [EvArray(inputArray)]) => { let _wrapInputErrors = x => SampleSetDist.NonNumericInput(x) let parsedArray = Helpers.parseNumberArray(inputArray)->E.R2.errMap(_wrapInputErrors) diff --git a/packages/website/docs/Api/Date.md b/packages/website/docs/Api/Date.md new file mode 100644 index 00000000..4c50f582 --- /dev/null +++ b/packages/website/docs/Api/Date.md @@ -0,0 +1,42 @@ +--- +sidebar_position: 1 +title: Date +--- + +### makeFromYear + +``` +Date.makeFromYear: (number) => date +``` + +```js +makeFromYear(2022.32); +``` + +### toString + +``` +toString: (date) => string +``` + +### subtract + +``` +subtract: (date, date) => duration +subtract: (date, duration) => date +``` + +```js +makeFromYear(2040) - makeFromYear(2020); // 20 years +makeFromYear(2040) - years(20); // 2020 +``` + +### add + +``` +add: (date, duration) => date +``` + +```js +makeFromYear(2022.32) + years(5); +``` diff --git a/packages/website/docs/Api/Dictionary.md b/packages/website/docs/Api/Dictionary.md new file mode 100644 index 00000000..136342d2 --- /dev/null +++ b/packages/website/docs/Api/Dictionary.md @@ -0,0 +1,71 @@ +--- +sidebar_position: 2 +title: Dictionary +--- + +### toList + +``` +Dict.toList: (dict<'a>) => list> +``` + +```js +Dict.toList({ foo: 3, bar: 20 }); // [["foo", 3], ["bar", 20]] +``` + +### fromList + +``` +Dict.fromList: (list>) => dict<'a> +``` + +```js +Dict.fromList([ + ["foo", 3], + ["bar", 20], +]); // {foo: 3, bar: 20} +``` + +### keys + +``` +Dict.keys: (dict<'a>) => list +``` + +```js +Dict.keys({ foo: 3, bar: 20 }); // ["foo", "bar"] +``` + +### values + +``` +Dict.values: (dict<'a>) => list<'a> +``` + +```js +Dict.values({ foo: 3, bar: 20 }); // [3, 20] +``` + +### merge + +``` +Dict.merge: (dict<'a>, dict<'b>) => dict<'a|b> +``` + +```js +first = { a: 1, b: 2 }; +snd = { b: 3, c: 5 }; +Dict.merge(first, snd); // {a: 1, b: 3, c: 5} +``` + +### mergeMany + +``` +Dict.mergeMany: (list>) => dict<'a> +``` + +```js +first = { a: 1, b: 2 }; +snd = { b: 3, c: 5 }; +Dict.mergeMany([first, snd]); // {a: 1, b: 3, c: 5} +``` diff --git a/packages/website/docs/Api/DistGeneric.mdx b/packages/website/docs/Api/DistGeneric.mdx new file mode 100644 index 00000000..d70476e5 --- /dev/null +++ b/packages/website/docs/Api/DistGeneric.mdx @@ -0,0 +1,647 @@ +--- +sidebar_position: 3 +title: Distribution +--- + +import TOCInline from "@theme/TOCInline"; + + + +## Distribution Creation + +### Normal Distribution + +**Definitions** + +```javascript +normal: (frValueDistOrNumber, frValueDistOrNumber) => distribution; +``` + +```javascript +normal: (dict<{p5: frValueDistOrNumber, p95: frValueDistOrNumber}>) => distribution +``` + +```javascript +normal: (dict<{mean: frValueDistOrNumber, stdev: frValueDistOrNumber}>) => distribution +``` + +**Examples** + +```js +normal(5, 1); +normal({ p5: 4, p95: 10 }); +normal({ mean: 5, stdev: 2 }); +``` + +### Lognormal Distribution + +**Definitions** + +```javascript +lognormal: (frValueDistOrNumber, frValueDistOrNumber) => distribution; +``` + +```javascript +lognormal: (dict<{p5: frValueDistOrNumber, p95: frValueDistOrNumber}>) => distribution +``` + +```javascript +lognormal: (dict<{mean: frValueDistOrNumber, stdev: frValueDistOrNumber}>) => distribution +``` + +**Examples** + +```javascript +lognormal(0.5, 0.8); +lognormal({ p5: 4, p95: 10 }); +lognormal({ mean: 5, stdev: 2 }); +``` + +### Uniform Distribution + +**Definitions** + +```javascript +uniform: (frValueDistOrNumber, frValueDistOrNumber) => distribution; +``` + +**Examples** + +```javascript +uniform(10, 12); +``` + +### Beta Distribution + +**Definitions** + +```javascript +beta: (frValueDistOrNumber, frValueDistOrNumber) => distribution; +``` + +**Examples** + +```javascript +beta(20, 25); +``` + +### Cauchy Distribution + +**Definitions** + +```javascript +cauchy: (frValueDistOrNumber, frValueDistOrNumber) => distribution; +``` + +**Examples** + +```javascript +cauchy(5, 1); +``` + +### Gamma Distribution + +**Definitions** + +```javascript +gamma: (frValueDistOrNumber, frValueDistOrNumber) => distribution; +``` + +**Examples** + +```javascript +gamma(5, 1); +``` + +### Logistic Distribution + +**Definitions** + +```javascript +logistic: (frValueDistOrNumber, frValueDistOrNumber) => distribution; +``` + +**Examples** + +```javascript +gamma(5, 1); +``` + +### To (Distribution) + +**Definitions** + +```javascript +to: (frValueDistOrNumber, frValueDistOrNumber) => distribution; +``` + +```javascript +credibleIntervalToDistribution(frValueDistOrNumber, frValueDistOrNumber) => distribution; +``` + +**Examples** + +```javascript +5 to 10 +to(5,10) +-5 to 5 +``` + +### Exponential + +**Definitions** + +```javascript +exponential: (frValueDistOrNumber) => distribution; +``` + +**Examples** + +```javascript +exponential(2); +``` + +### Bernoulli + +**Definitions** + +```javascript +bernoulli: (frValueDistOrNumber) => distribution; +``` + +**Examples** + +```javascript +bernoulli(0.5); +``` + +### toContinuousPointSet + +Converts a set of points to a continuous distribution + +**Definitions** + +```javascript +toContinuousPointSet: (array>) => distribution +``` + +**Examples** + +```javascript +toContinuousPointSet([ + { x: 0, y: 0.1 }, + { x: 1, y: 0.2 }, + { x: 2, y: 0.15 }, + { x: 3, y: 0.1 }, +]); +``` + +### toDiscretePointSet + +Converts a set of points to a discrete distribution + +**Definitions** + +```javascript +toDiscretePointSet: (array>) => distribution +``` + +**Examples** + +```javascript +toDiscretePointSet([ + { x: 0, y: 0.1 }, + { x: 1, y: 0.2 }, + { x: 2, y: 0.15 }, + { x: 3, y: 0.1 }, +]); +``` + +## Functions + +### mixture + +```javascript +mixture: (...distributionLike, weights:list) => distribution +``` + +**Examples** + +```javascript +mixture(normal(5, 1), normal(10, 1)); +mx(normal(5, 1), normal(10, 1), [0.3, 0.7]); +``` + +### sample + +Get one random sample from the distribution + +```javascript +sample(distribution) => number +``` + +**Examples** + +```javascript +sample(normal(5, 2)); +``` + +### sampleN + +Get n random samples from the distribution + +```javascript +sampleN: (distribution, number) => list +``` + +**Examples** + +```javascript +sample: normal(5, 2), 100; +``` + +### mean + +Get the distribution mean + +```javascript +mean: (distribution) => number; +``` + +**Examples** + +```javascript +mean: normal(5, 2); +``` + +### stdev + +```javascript +stdev: (distribution) => number; +``` + +### variance + +```javascript +variance: (distribution) => number; +``` + +### mode + +```javascript +mode: (distribution) => number; +``` + +### cdf + +```javascript +cdf: (distribution, number) => number; +``` + +**Examples** + +```javascript +cdf: normal(5, 2), 3; +``` + +### pdf + +```javascript +pdf: (distribution, number) => number; +``` + +**Examples** + +```javascript +pdf(normal(5, 2), 3); +``` + +### inv + +```javascript +inv: (distribution, number) => number; +``` + +**Examples** + +```javascript +inv(normal(5, 2), 0.5); +``` + +### toPointSet + +Converts a distribution to the pointSet format + +```javascript +toPointSet: (distribution) => pointSetDistribution; +``` + +**Examples** + +```javascript +toPointSet(normal(5, 2)); +``` + +### toSampleSet + +Converts a distribution to the sampleSet format, with n samples + +```javascript +toSampleSet: (distribution, number) => sampleSetDistribution; +``` + +**Examples** + +```javascript +toSampleSet(normal(5, 2), 1000); +``` + +### truncateLeft + +Truncates the left side of a distribution. Returns either a pointSet distribution or a symbolic distribution. + +```javascript +truncateLeft: (distribution, l => number) => distribution +``` + +**Examples** + +```javascript +truncateLeft(normal(5, 2), 3); +``` + +### truncateRight + +Truncates the right side of a distribution. Returns either a pointSet distribution or a symbolic distribution. + +```javascript +truncateRight: (distribution, r => number) => distribution +``` + +**Examples** + +```javascript +truncateLeft(normal(5, 2), 6); +``` + +## Scoring + +### klDivergence + +Kullback–Leibler divergence between two distributions + +```javascript +klDivergence: (distribution, distribution) => number; +``` + +**Examples** + +```javascript +klDivergence(normal(5, 2), normal(5, 4)); // returns 0.57 +``` + +## Display + +### toString + +```javascript +toString: (distribution) => string; +``` + +**Examples** + +```javascript +toString(normal(5, 2)); +``` + +### toSparkline + +Produce a sparkline of length n + +```javascript +toSparkline: (distribution, n = 20) => string; +``` + +**Examples** + +```javascript +toSparkline(normal(5, 2), 10); +``` + +### inspect + +Prints the value of the distribution to the Javascript console, then returns the distribution. + +```javascript +inspect: (distribution) => distribution; +``` + +**Examples** + +```javascript +inspect(normal(5, 2)); +``` + +## Normalization + +### normalize + +Normalize a distribution. This means scaling it appropriately so that it's cumulative sum is equal to 1. + +```javascript +normalize: (distribution) => distribution; +``` + +**Examples** + +```javascript +normalize(normal(5, 2)); +``` + +### isNormalized + +Check of a distribution is normalized. Most distributions are typically normalized, but there are some commands that could produce non-normalized distributions. + +```javascript +isNormalized: (distribution) => bool; +``` + +**Examples** + +```javascript +isNormalized(normal(5, 2)); // returns true +``` + +### integralSum + +Get the sum of the integral of a distribution. If the distribution is normalized, this will be 1. + +```javascript +integralSum: (distribution) => number; +``` + +**Examples** + +```javascript +integralSum(normal(5, 2)); +``` + +## Algebraic Operations + +### add + +```javascript +add: (distributionLike, distributionLike) => distribution; +``` + +### sum + +```javascript +sum: (list) => distribution +``` + +### multiply + +```javascript +multiply: (distributionLike, distributionLike) => distribution; +``` + +### product + +```javascript +product: (list) => distribution +``` + +### subtract + +```javascript +subtract: (distributionLike, distributionLike) => distribution; +``` + +### divide + +```javascript +divide: (distributionLike, distributionLike) => distribution; +``` + +### pow + +```javascript +pow: (distributionLike, distributionLike) => distribution; +``` + +### exp + +```javascript +exp: (distributionLike, distributionLike) => distribution; +``` + +### log + +```javascript +log: (distributionLike, distributionLike) => distribution; +``` + +### log10 + +```javascript +log10: (distributionLike, distributionLike) => distribution; +``` + +### unaryMinus + +```javascript +unaryMinus: (distribution) => distribution; +``` + +## Pointwise Operations + +### dotAdd + +```javascript +dotAdd: (distributionLike, distributionLike) => distribution; +``` + +### dotMultiply + +```javascript +dotMultiply: (distributionLike, distributionLike) => distribution; +``` + +### dotSubtract + +```javascript +dotSubtract: (distributionLike, distributionLike) => distribution; +``` + +### dotDivide + +```javascript +dotDivide: (distributionLike, distributionLike) => distribution; +``` + +### dotPow + +```javascript +dotPow: (distributionLike, distributionLike) => distribution; +``` + +### dotExp + +```javascript +dotExp: (distributionLike, distributionLike) => distribution; +``` + +## Scale Operations + +### scaleMultiply + +```javascript +scaleMultiply: (distributionLike, number) => distribution; +``` + +### scalePow + +```javascript +scalePow: (distributionLike, number) => distribution; +``` + +### scaleExp + +```javascript +scaleExp: (distributionLike, number) => distribution; +``` + +### scaleLog + +```javascript +scaleLog: (distributionLike, number) => distribution; +``` + +### scaleLog10 + +```javascript +scaleLog10: (distributionLike, number) => distribution; +``` + +## Special + +### Declaration (Continuous Function) + +Adds metadata to a function of the input ranges. Works now for numeric and date inputs. This is useful when making predictions. It allows you to limit the domain that your prediction will be used and scored within. + +```javascript +declareFn: (dict<{fn: lambda, inputs: array>}>) => declaration +``` + +**Examples** + +```javascript +declareFn({ + fn: {|a,b| a }, + inputs: [ + {min: 0, max: 100}, + {min: 30, max: 50} + ] +}) +``` diff --git a/packages/website/docs/Api/DistPointSet.md b/packages/website/docs/Api/DistPointSet.md new file mode 100644 index 00000000..bf65ad68 --- /dev/null +++ b/packages/website/docs/Api/DistPointSet.md @@ -0,0 +1,22 @@ +--- +sidebar_position: 4 +title: Point Set Distribution +--- + +### make + +``` +PointSet.make: (distribution) => pointSetDist +``` + +### makeContinuous + +``` +PointSet.makeContinuous: (list<{x: number, y: number}>) => pointSetDist +``` + +### makeDiscrete + +``` +PointSet.makeDiscrete: (list<{x: number, y: number}>) => pointSetDist +``` diff --git a/packages/website/docs/Api/DistSampleSet.md b/packages/website/docs/Api/DistSampleSet.md new file mode 100644 index 00000000..9d0f5ed9 --- /dev/null +++ b/packages/website/docs/Api/DistSampleSet.md @@ -0,0 +1,44 @@ +--- +sidebar_position: 5 +title: Sample Set Distribution +--- + +### make + +``` +SampleSet.make: (distribution) => sampleSet +SampleSet.make: (() => number) => sampleSet +SampleSet.make: (list) => sampleSet +``` + +### map + +``` +SampleSet.map: (sampleSet, (number => number)) => sampleSet +``` + +### map2 + +``` +SampleSet.map2: (sampleSet, sampleSet, ((number, number) => number)) => sampleSet +``` + +### map3 + +``` +SampleSet.map3: (sampleSet, sampleSet, sampleSet, ((number, number, number) => number)) => sampleSet +``` + +### toList + +``` +SampleSet.toList: (sampleSet) => list +``` + +Gets the internal samples of a sampleSet distribution. This is separate from the sampleN() function, which would shuffle the samples. toList() maintains order and length. Gets the internal samples of a sampleSet distribution. This is separate from the sampleN() function, which would shuffle the samples. toList() maintains order and length. + +**Examples** + +``` +toList(toSampleSet(normal(5,2))) +``` diff --git a/packages/website/docs/Api/Duration.mdx b/packages/website/docs/Api/Duration.mdx new file mode 100644 index 00000000..6f81a352 --- /dev/null +++ b/packages/website/docs/Api/Duration.mdx @@ -0,0 +1,90 @@ +--- +sidebar_position: 6 +title: Duration +--- + +import TOCInline from "@theme/TOCInline"; + + + +### toString + +``` +toString: (duration) => string +``` + +## Units + +### minutes + +``` +minutes: (number) => duration +``` + +### hours + +``` +hours: (number) => duration +``` + +### days + +``` +days: (number) => duration +``` + +### years + +``` +years: (number) => duration +``` + +### toHours + +``` +toHours: (duration) => number +``` + +### toMinutes + +``` +toMinutes: (duration) => number +``` + +### toDays + +``` +toDays: (duration) => number +``` + +### toYears + +``` +toYears: (duration) => number +``` + +## Algebra + +### add + +``` +add: (duration, duration) => duration +``` + +### subtract + +``` +subtract: (duration, duration) => duration +``` + +### multiply + +``` +multiply: (duration, number) => duration +``` + +### divide + +``` +divide: (duration, number) => duration +``` diff --git a/packages/website/docs/Api/List.md b/packages/website/docs/Api/List.md new file mode 100644 index 00000000..c6d89e7d --- /dev/null +++ b/packages/website/docs/Api/List.md @@ -0,0 +1,94 @@ +--- +sidebar_position: 7 +title: List +--- + +### make + +``` +List.make: (number, 'a) => list<'a> +``` + +Returns an array of size `n` filled with value `e`. + +```js +List.make(4, 1); // creates the list [1, 1, 1, 1] +``` + +See [Rescript implementation](https://rescript-lang.org/docs/manual/latest/api/belt/array#make) + +### toString + +``` +toString: (list<'a>) => string +``` + +### length + +``` +length: (list<'a>) => number +``` + +### up to + +``` +List.upTo: (low:number, high:number) => list +``` + +```js +List.upTo(0, 5); // creates the list [0, 1, 2, 3, 4, 5] +``` + +Syntax taken from [Ruby](https://apidock.com/ruby/v2_5_5/Integer/upto). + +### first + +``` +first: (list<'a>) => 'a +``` + +### last + +``` +last: (list<'a>) => 'a +``` + +### reverse + +``` +reverse: (list<'a>) => list<'a> +``` + +### map + +``` +map: (list<'a>, a => b) => list<'b> +``` + +See [Rescript implementation](https://rescript-lang.org/docs/manual/latest/api/belt/array#map). + +### reduce + +``` +reduce: (list<'b>, 'a, ('a, 'b) => 'a) => 'a +``` + +`reduce(arr, init, f)` + +Applies `f` to each element of `arr`. The function `f` has two paramaters, an accumulator and the next value from the array. + +```js +reduce([2, 3, 4], 1, {|acc, value| acc + value}) == 10 +``` + +See [Rescript implementation](https://rescript-lang.org/docs/manual/latest/api/belt/array#reduce). + +### reduce reverse + +``` +reduceReverse: (list<'b>, 'a, ('a, 'b) => 'a) => 'a +``` + +Works like `reduce`, but the function is applied to each item from the last back to the first. + +See [Rescript implementation](https://rescript-lang.org/docs/manual/latest/api/belt/array#reducereverse). diff --git a/packages/website/docs/Api/Math.md b/packages/website/docs/Api/Math.md new file mode 100644 index 00000000..37f3fe1d --- /dev/null +++ b/packages/website/docs/Api/Math.md @@ -0,0 +1,84 @@ +--- +sidebar_position: 8 +title: Math +--- + +### E + +``` +Math.E: +``` + +Euler's number; ≈ 2.718281828459045 + +### LN2 + +``` +Math.LN2: +``` + +Natural logarithm of 2; ≈ 0.6931471805599453 + +### LN10 + +``` +Math.LN10: +``` + +Natural logarithm of 10; ≈ 2.302585092994046 + +### LOG2E + +``` +Math.LOG2E: +``` + +Base 2 logarithm of E; ≈ 1.4426950408889634Base 2 logarithm of E; ≈ 1.4426950408889634 + +### LOG10E + +``` +Math.LOG10E: +``` + +Base 10 logarithm of E; ≈ 0.4342944819032518 + +### PI + +``` +Math.PI: +``` + +Pi - ratio of the circumference to the diameter of a circle; ≈ 3.141592653589793 + +### SQRT1_2 + +``` +Math.SQRT1_2: +``` + +Square root of 1/2; ≈ 0.7071067811865476 + +### SQRT2 + +``` +Math.SQRT2: +``` + +Square root of 2; ≈ 1.4142135623730951 + +### PHI + +``` +Math.PHI: +``` + +Phi is the golden ratio. 1.618033988749895 + +### TAU + +``` +Math.TAU: +``` + +Tau is the ratio constant of a circle's circumference to radius, equal to 2 \* pi. 6.283185307179586 diff --git a/packages/website/docs/Api/Number.mdx b/packages/website/docs/Api/Number.mdx new file mode 100644 index 00000000..6e4015c2 --- /dev/null +++ b/packages/website/docs/Api/Number.mdx @@ -0,0 +1,144 @@ +--- +sidebar_position: 9 +title: Number +--- + +import TOCInline from "@theme/TOCInline"; + + + +### ceil + +```javascript +ceil: (number) => number; +``` + +### floor + +```javascript +floor: (number) => number; +``` + +### abs + +```javascript +abs: (number) => number; +``` + +### round + +```javascript +round: (number) => number; +``` + +## Statistics + +### max + +```javascript +max: (list) => number +``` + +### min + +```javascript +min: (list) => number +``` + +### mean + +```javascript +mean: (list) => number +``` + +### stdev + +```javascript +stdev: (list) => number +``` + +### variance + +```javascript +variance: (list) => number +``` + +## Algebra + +### unaryMinus + +```javascript +unaryMinus: (number) => number; +``` + +### equal + +```javascript +equal: (number, number) => boolean; +``` + +### add + +```javascript +add: (number, number) => number; +``` + +### sum + +```javascript +sum: (list) => number +``` + +### cumulative sum + +``` +cumsum: (list) => list +``` + +### multiply + +```javascript +multiply: (number, number) => number; +``` + +### product + +```javascript +product: (list) => number +``` + +### cumulative product + +``` +cumprod: (list) => list +``` + +### subtract + +```javascript +subtract: (number, number) => number; +``` + +### divide + +```javascript +divide: (number, number) => number; +``` + +### pow + +```javascript +pow: (number, number) => number; +``` + +### exp + +```javascript +exp: (number) => number; +``` + +### log + +```javascript +log: (number) => number; +``` diff --git a/packages/website/docs/Features/Distributions.mdx b/packages/website/docs/Guides/Distributions.mdx similarity index 99% rename from packages/website/docs/Features/Distributions.mdx rename to packages/website/docs/Guides/Distributions.mdx index 6cc5967d..2688f398 100644 --- a/packages/website/docs/Features/Distributions.mdx +++ b/packages/website/docs/Guides/Distributions.mdx @@ -1,16 +1,13 @@ --- title: "Distribution Creation" -sidebar_position: 2 +sidebar_position: 20 --- -import TOCInline from "@theme/TOCInline"; import { SquiggleEditor } from "../../src/components/SquiggleEditor"; import Admonition from "@theme/Admonition"; import Tabs from "@theme/Tabs"; import TabItem from "@theme/TabItem"; - - ## To `(5thPercentile: number) to (95thPercentile: number)` diff --git a/packages/website/docs/Features/Functions.mdx b/packages/website/docs/Guides/Functions.mdx similarity index 100% rename from packages/website/docs/Features/Functions.mdx rename to packages/website/docs/Guides/Functions.mdx diff --git a/packages/website/docs/Features/Language.mdx b/packages/website/docs/Guides/Language.mdx similarity index 100% rename from packages/website/docs/Features/Language.mdx rename to packages/website/docs/Guides/Language.mdx diff --git a/packages/website/docs/Features/Node-Packages.md b/packages/website/docs/Guides/Node-Packages.md similarity index 100% rename from packages/website/docs/Features/Node-Packages.md rename to packages/website/docs/Guides/Node-Packages.md diff --git a/packages/website/docs/Introduction.md b/packages/website/docs/Introduction.md index e81b0782..35ff63b6 100644 --- a/packages/website/docs/Introduction.md +++ b/packages/website/docs/Introduction.md @@ -9,8 +9,8 @@ Squiggle is an _estimation language_, and a syntax for _calculating and expressi - [Gallery](./Discussions/Gallery) - [Squiggle playground](/playground) -- [Language basics](./Features/Language) -- [Squiggle functions source of truth](./docs/Features/Functions) +- [Language basics](./Guides/Language) +- [Squiggle functions source of truth](./docs/Guides/Functions) - [Known bugs](./Discussions/Bugs) - [Original lesswrong sequence](https://www.lesswrong.com/s/rDe8QE5NvXcZYzgZ3) - [Author your squiggle models as Observable notebooks](https://observablehq.com/@hazelfire/squiggle) diff --git a/packages/website/docusaurus.config.js b/packages/website/docusaurus.config.js index 330002ef..4152ae6e 100644 --- a/packages/website/docusaurus.config.js +++ b/packages/website/docusaurus.config.js @@ -18,9 +18,7 @@ const config = { favicon: "img/favicon.ico", organizationName: "quantified-uncertainty", // Usually your GitHub org/user name. projectName: "squiggle", // Usually your repo name. - plugins: [], - presets: [ [ "classic", @@ -66,6 +64,12 @@ const config = { position: "left", label: "Documentation", }, + { + type: "doc", + docId: "Api/Dictionary", + position: "left", + label: "API", + }, { to: "/blog", label: "Blog", position: "left" }, { to: "/playground", label: "Playground", position: "left" }, { diff --git a/packages/website/sidebars.js b/packages/website/sidebars.js index 78ad249f..5c63ccb9 100644 --- a/packages/website/sidebars.js +++ b/packages/website/sidebars.js @@ -14,6 +14,12 @@ /** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */ const sidebars = { // By default, Docusaurus generates a sidebar from the docs folder structure + apiSidebar: [ + { + type: "autogenerated", + dirName: "Api", + }, + ], tutorialSidebar: [ { type: "doc", @@ -22,11 +28,11 @@ const sidebars = { }, { type: "category", - label: "Features", + label: "Guides", items: [ { type: "autogenerated", - dirName: "Features", + dirName: "Guides", }, ], }, diff --git a/yarn.lock b/yarn.lock index 3b52c384..c32d4098 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1852,10 +1852,10 @@ resolved "https://registry.yarnpkg.com/@heroicons/react/-/react-1.0.6.tgz#35dd26987228b39ef2316db3b1245c42eb19e324" integrity sha512-JJCXydOFWMDpCP4q13iEplA503MQO3xLoZiKum+955ZCtHINWnx26CUxVxxFQu/uLb4LW3ge15ZpzIkXKkJ8oQ== -"@hookform/resolvers@^2.9.0": - version "2.9.0" - resolved "https://registry.yarnpkg.com/@hookform/resolvers/-/resolvers-2.9.0.tgz#0e8c5188fb030f1c21764892db0d04058d5413f0" - integrity sha512-fW/buf863gDiU60RxCTKooJRf1YRvcMy0MTXGsyv7y0sutx0iYeZwoFNQRLBtS+hi+lo60ZV3Kf8AdqGY+sZVw== +"@hookform/resolvers@^2.9.1": + version "2.9.1" + resolved "https://registry.yarnpkg.com/@hookform/resolvers/-/resolvers-2.9.1.tgz#59121e38d8fc95d2fd1f41c9631393cd21e10b65" + integrity sha512-80lyFFcExEB7A09PFnl8k7A3obQyDF6MyO/FThtwetk+MTedYMs08Aqf7mgWnOawFGyz5QF+TZXJSYiIZW2tEg== "@humanwhocodes/config-array@^0.9.2": version "0.9.5" @@ -2763,7 +2763,7 @@ "@stdlib/types" "^0.0.x" debug "^2.6.9" -"@storybook/addon-actions@6.5.7", "@storybook/addon-actions@^6.5.7": +"@storybook/addon-actions@6.5.7": version "6.5.7" resolved "https://registry.yarnpkg.com/@storybook/addon-actions/-/addon-actions-6.5.7.tgz#0280a994f42e80ae7e8b71ccf04cd0279cbce01d" integrity sha512-gTkPr2FYX+vySZKEg5Wq7uHPkVUq3hJ7ZKvGls+/xjgaTwfu3iIly53FEFUl8A6kMQ+4gtTC+YRr3cSJgXMbAg== @@ -2788,6 +2788,31 @@ util-deprecate "^1.0.2" uuid-browser "^3.1.0" +"@storybook/addon-actions@^6.5.8": + version "6.5.8" + resolved "https://registry.yarnpkg.com/@storybook/addon-actions/-/addon-actions-6.5.8.tgz#c1f544acc016a4a0d5dcb373535dc991b5737c5f" + integrity sha512-9ciR1iWBTzQNBDlq0iQs9+TV7gng+FbQxW5mHNxNvT9SxY1dt02wCPHZeVE/5la61wBXZs/zpEepZA93VzVBDw== + dependencies: + "@storybook/addons" "6.5.8" + "@storybook/api" "6.5.8" + "@storybook/client-logger" "6.5.8" + "@storybook/components" "6.5.8" + "@storybook/core-events" "6.5.8" + "@storybook/csf" "0.0.2--canary.4566f4d.1" + "@storybook/theming" "6.5.8" + core-js "^3.8.2" + fast-deep-equal "^3.1.3" + global "^4.4.0" + lodash "^4.17.21" + polished "^4.2.2" + prop-types "^15.7.2" + react-inspector "^5.1.0" + regenerator-runtime "^0.13.7" + telejson "^6.0.8" + ts-dedent "^2.0.0" + util-deprecate "^1.0.2" + uuid-browser "^3.1.0" + "@storybook/addon-backgrounds@6.5.7": version "6.5.7" resolved "https://registry.yarnpkg.com/@storybook/addon-backgrounds/-/addon-backgrounds-6.5.7.tgz#2bd823a94db05bf2b836121adb7e7b49c33b99b2" @@ -2880,16 +2905,16 @@ regenerator-runtime "^0.13.7" ts-dedent "^2.0.0" -"@storybook/addon-links@^6.5.7": - version "6.5.7" - resolved "https://registry.yarnpkg.com/@storybook/addon-links/-/addon-links-6.5.7.tgz#b3a794b19c5c0277c3f20f86915c851f577dc45b" - integrity sha512-kiCzGLlCyhfBjwYfM/xACe5l6s2+8exQNOGoLzNeAhprgD7dzpsZ0ZaEgpF4ay9bG9H9gOeX4jc/TAvVW/v6nw== +"@storybook/addon-links@^6.5.8": + version "6.5.8" + resolved "https://registry.yarnpkg.com/@storybook/addon-links/-/addon-links-6.5.8.tgz#ec4b640bf89dbb653592e6f05968ba771bb10b4a" + integrity sha512-UxzEPnT1PLPsuy3tt+o3UJTbI4Kihec+/yzpzzGKreUnCC8EWTsOhtMQAVVit2t4BMl4vNrxKO0mKSc8saT3Gw== dependencies: - "@storybook/addons" "6.5.7" - "@storybook/client-logger" "6.5.7" - "@storybook/core-events" "6.5.7" + "@storybook/addons" "6.5.8" + "@storybook/client-logger" "6.5.8" + "@storybook/core-events" "6.5.8" "@storybook/csf" "0.0.2--canary.4566f4d.1" - "@storybook/router" "6.5.7" + "@storybook/router" "6.5.8" "@types/qs" "^6.9.5" core-js "^3.8.2" global "^4.4.0" @@ -2975,6 +3000,23 @@ global "^4.4.0" regenerator-runtime "^0.13.7" +"@storybook/addons@6.5.8": + version "6.5.8" + resolved "https://registry.yarnpkg.com/@storybook/addons/-/addons-6.5.8.tgz#c529a2989830a09d26308277a3e356228479053d" + integrity sha512-L3LmbsYP9tDHHvpr/yv8YuEkzym7SXp/jZ0km31tpG3EuZmgGu7MXPrZ2ymEw4PkAhQzztgRr23VTfKobGUojA== + dependencies: + "@storybook/api" "6.5.8" + "@storybook/channels" "6.5.8" + "@storybook/client-logger" "6.5.8" + "@storybook/core-events" "6.5.8" + "@storybook/csf" "0.0.2--canary.4566f4d.1" + "@storybook/router" "6.5.8" + "@storybook/theming" "6.5.8" + "@types/webpack-env" "^1.16.0" + core-js "^3.8.2" + global "^4.4.0" + regenerator-runtime "^0.13.7" + "@storybook/api@6.5.7": version "6.5.7" resolved "https://registry.yarnpkg.com/@storybook/api/-/api-6.5.7.tgz#1a5fc381fd417fd1c8ab6e246af09fdcd20f9df0" @@ -2998,6 +3040,29 @@ ts-dedent "^2.0.0" util-deprecate "^1.0.2" +"@storybook/api@6.5.8": + version "6.5.8" + resolved "https://registry.yarnpkg.com/@storybook/api/-/api-6.5.8.tgz#8bd400b8a5b18ec6bff5d35a898593d9c1c630f9" + integrity sha512-/MueV+wLCvy9gFA3ih4g7QYjDmn14i+D2ydonfaEC7R+agFGXxXwJGPKkz3yBNrRpNkBwcbY9mAmv8lE2AqgqQ== + dependencies: + "@storybook/channels" "6.5.8" + "@storybook/client-logger" "6.5.8" + "@storybook/core-events" "6.5.8" + "@storybook/csf" "0.0.2--canary.4566f4d.1" + "@storybook/router" "6.5.8" + "@storybook/semver" "^7.3.2" + "@storybook/theming" "6.5.8" + core-js "^3.8.2" + fast-deep-equal "^3.1.3" + global "^4.4.0" + lodash "^4.17.21" + memoizerific "^1.11.3" + regenerator-runtime "^0.13.7" + store2 "^2.12.0" + telejson "^6.0.8" + ts-dedent "^2.0.0" + util-deprecate "^1.0.2" + "@storybook/builder-webpack4@6.5.7": version "6.5.7" resolved "https://registry.yarnpkg.com/@storybook/builder-webpack4/-/builder-webpack4-6.5.7.tgz#043ad0625eedb39fcd07035cdb252973d3eb6ef9" @@ -3108,6 +3173,19 @@ qs "^6.10.0" telejson "^6.0.8" +"@storybook/channel-postmessage@6.5.8": + version "6.5.8" + resolved "https://registry.yarnpkg.com/@storybook/channel-postmessage/-/channel-postmessage-6.5.8.tgz#989af9a55eba391b64487640f6b5b0cfd1fde2f9" + integrity sha512-6IkIKk+UMYKk05vN8gWHvvOV/EZNXpQG/5gesGDALjkCyvRmcktHak1a9tHpoihZ3L7/gDwXOZraCZmuy8vBcQ== + dependencies: + "@storybook/channels" "6.5.8" + "@storybook/client-logger" "6.5.8" + "@storybook/core-events" "6.5.8" + core-js "^3.8.2" + global "^4.4.0" + qs "^6.10.0" + telejson "^6.0.8" + "@storybook/channel-websocket@6.5.7": version "6.5.7" resolved "https://registry.yarnpkg.com/@storybook/channel-websocket/-/channel-websocket-6.5.7.tgz#69e274319a995d1bd01b3783586cdefcb56277dc" @@ -3119,6 +3197,17 @@ global "^4.4.0" telejson "^6.0.8" +"@storybook/channel-websocket@6.5.8": + version "6.5.8" + resolved "https://registry.yarnpkg.com/@storybook/channel-websocket/-/channel-websocket-6.5.8.tgz#722743619f86ebc9325bbff026acf6eba13b21ca" + integrity sha512-lAtvgO0FWsyS3u7uFbsGIYp2aSWJfWU/LOtc3x1K5c84JJAd9fncYkyZMwP1gMbdNgYxJoxe8HXtVtfeNegPuQ== + dependencies: + "@storybook/channels" "6.5.8" + "@storybook/client-logger" "6.5.8" + core-js "^3.8.2" + global "^4.4.0" + telejson "^6.0.8" + "@storybook/channels@6.5.7": version "6.5.7" resolved "https://registry.yarnpkg.com/@storybook/channels/-/channels-6.5.7.tgz#765b02e949f58c4181998c676b155f5c1914bec1" @@ -3128,6 +3217,15 @@ ts-dedent "^2.0.0" util-deprecate "^1.0.2" +"@storybook/channels@6.5.8": + version "6.5.8" + resolved "https://registry.yarnpkg.com/@storybook/channels/-/channels-6.5.8.tgz#e85ffd2076813b67336b1b9b274c37aa5f1b80e0" + integrity sha512-fNql1lEIvWlI1NiRtwFMWOOvfW6qxgeSP6xoqiAJ0b+QYegEFG9UxJDuEvVHq++S81FulgQ5U+p+5R9XSV19tQ== + dependencies: + core-js "^3.8.2" + ts-dedent "^2.0.0" + util-deprecate "^1.0.2" + "@storybook/client-api@6.5.7": version "6.5.7" resolved "https://registry.yarnpkg.com/@storybook/client-api/-/client-api-6.5.7.tgz#e5d7a5ca698138f4eba36e14d49138850163f252" @@ -3154,6 +3252,32 @@ ts-dedent "^2.0.0" util-deprecate "^1.0.2" +"@storybook/client-api@6.5.8": + version "6.5.8" + resolved "https://registry.yarnpkg.com/@storybook/client-api/-/client-api-6.5.8.tgz#cf1b3d4a71a3a156636a9b6b51acc4239b259d86" + integrity sha512-mdU+qQ4+T2OUbEnl+3MWRKxEPju/EOIUg66hMgmif8c5u7YFYBFulUMUYLICMjll8Jlu+37+g+qO3K2eEz6CEw== + dependencies: + "@storybook/addons" "6.5.8" + "@storybook/channel-postmessage" "6.5.8" + "@storybook/channels" "6.5.8" + "@storybook/client-logger" "6.5.8" + "@storybook/core-events" "6.5.8" + "@storybook/csf" "0.0.2--canary.4566f4d.1" + "@storybook/store" "6.5.8" + "@types/qs" "^6.9.5" + "@types/webpack-env" "^1.16.0" + core-js "^3.8.2" + fast-deep-equal "^3.1.3" + global "^4.4.0" + lodash "^4.17.21" + memoizerific "^1.11.3" + qs "^6.10.0" + regenerator-runtime "^0.13.7" + store2 "^2.12.0" + synchronous-promise "^2.0.15" + ts-dedent "^2.0.0" + util-deprecate "^1.0.2" + "@storybook/client-logger@6.5.7": version "6.5.7" resolved "https://registry.yarnpkg.com/@storybook/client-logger/-/client-logger-6.5.7.tgz#97a607b1d09d32a31091fe286510cf5d3995d2bf" @@ -3162,6 +3286,14 @@ core-js "^3.8.2" global "^4.4.0" +"@storybook/client-logger@6.5.8": + version "6.5.8" + resolved "https://registry.yarnpkg.com/@storybook/client-logger/-/client-logger-6.5.8.tgz#551f818c4448ef6e6adf9c3ad256e1ae61e2d75c" + integrity sha512-dH6HSaVuOIMHy1+rpsqcD3SJxVZEEbuEtsNpdUGwLJaIuduhUJJpM2xQfUW0siZDyrgwoa+znll+G0YNUbv7sg== + dependencies: + core-js "^3.8.2" + global "^4.4.0" + "@storybook/components@6.5.7": version "6.5.7" resolved "https://registry.yarnpkg.com/@storybook/components/-/components-6.5.7.tgz#28a509c0556f8df919c8c7f7076ca6785b22cb8d" @@ -3177,6 +3309,21 @@ regenerator-runtime "^0.13.7" util-deprecate "^1.0.2" +"@storybook/components@6.5.8": + version "6.5.8" + resolved "https://registry.yarnpkg.com/@storybook/components/-/components-6.5.8.tgz#eb18cfcc4e88b7f4081b20b8a81b92d7ae9eaeac" + integrity sha512-YE+LZ1/GXoqertxodsf+L9ehcohbICRAxgE/iNqc7MZfk95SD3XRSUbxhCpGe8QTIZJpzs1tK4LFZ3Fg5w/+Lg== + dependencies: + "@storybook/client-logger" "6.5.8" + "@storybook/csf" "0.0.2--canary.4566f4d.1" + "@storybook/theming" "6.5.8" + "@types/react-syntax-highlighter" "11.0.5" + core-js "^3.8.2" + qs "^6.10.0" + react-syntax-highlighter "^15.4.5" + regenerator-runtime "^0.13.7" + util-deprecate "^1.0.2" + "@storybook/core-client@6.5.7": version "6.5.7" resolved "https://registry.yarnpkg.com/@storybook/core-client/-/core-client-6.5.7.tgz#556a38330c89adfacf5151cda0b5c32e24499737" @@ -3203,6 +3350,32 @@ unfetch "^4.2.0" util-deprecate "^1.0.2" +"@storybook/core-client@6.5.8": + version "6.5.8" + resolved "https://registry.yarnpkg.com/@storybook/core-client/-/core-client-6.5.8.tgz#4be4ce024a74b51c0650d346f1f3a11a0f921952" + integrity sha512-8x8qKQ2clvpfDcoWrNBmQ8Xt9z/i32TFIBp4PEZMcbB7eqo517nzfllLiXDipiJgO7BGxKtY5CRHQ9pAU9G27A== + dependencies: + "@storybook/addons" "6.5.8" + "@storybook/channel-postmessage" "6.5.8" + "@storybook/channel-websocket" "6.5.8" + "@storybook/client-api" "6.5.8" + "@storybook/client-logger" "6.5.8" + "@storybook/core-events" "6.5.8" + "@storybook/csf" "0.0.2--canary.4566f4d.1" + "@storybook/preview-web" "6.5.8" + "@storybook/store" "6.5.8" + "@storybook/ui" "6.5.8" + airbnb-js-shims "^2.2.1" + ansi-to-html "^0.6.11" + core-js "^3.8.2" + global "^4.4.0" + lodash "^4.17.21" + qs "^6.10.0" + regenerator-runtime "^0.13.7" + ts-dedent "^2.0.0" + unfetch "^4.2.0" + util-deprecate "^1.0.2" + "@storybook/core-common@6.5.7": version "6.5.7" resolved "https://registry.yarnpkg.com/@storybook/core-common/-/core-common-6.5.7.tgz#69519d02b48c719fba734b38bb6a4419abc77a4b" @@ -3259,6 +3432,62 @@ util-deprecate "^1.0.2" webpack "4" +"@storybook/core-common@6.5.8": + version "6.5.8" + resolved "https://registry.yarnpkg.com/@storybook/core-common/-/core-common-6.5.8.tgz#6972c7109477914f9ed72bedbe3769cec0eb8c56" + integrity sha512-ELGKLMx1d0oEA2LT+fsmo85X2RNE1EO+It7B1bw//g7jyf1hmZ7t3lXMZUCqt7eml1qy1N72LDkfmmU+H9H6ww== + dependencies: + "@babel/core" "^7.12.10" + "@babel/plugin-proposal-class-properties" "^7.12.1" + "@babel/plugin-proposal-decorators" "^7.12.12" + "@babel/plugin-proposal-export-default-from" "^7.12.1" + "@babel/plugin-proposal-nullish-coalescing-operator" "^7.12.1" + "@babel/plugin-proposal-object-rest-spread" "^7.12.1" + "@babel/plugin-proposal-optional-chaining" "^7.12.7" + "@babel/plugin-proposal-private-methods" "^7.12.1" + "@babel/plugin-proposal-private-property-in-object" "^7.12.1" + "@babel/plugin-syntax-dynamic-import" "^7.8.3" + "@babel/plugin-transform-arrow-functions" "^7.12.1" + "@babel/plugin-transform-block-scoping" "^7.12.12" + "@babel/plugin-transform-classes" "^7.12.1" + "@babel/plugin-transform-destructuring" "^7.12.1" + "@babel/plugin-transform-for-of" "^7.12.1" + "@babel/plugin-transform-parameters" "^7.12.1" + "@babel/plugin-transform-shorthand-properties" "^7.12.1" + "@babel/plugin-transform-spread" "^7.12.1" + "@babel/preset-env" "^7.12.11" + "@babel/preset-react" "^7.12.10" + "@babel/preset-typescript" "^7.12.7" + "@babel/register" "^7.12.1" + "@storybook/node-logger" "6.5.8" + "@storybook/semver" "^7.3.2" + "@types/node" "^14.0.10 || ^16.0.0" + "@types/pretty-hrtime" "^1.0.0" + babel-loader "^8.0.0" + babel-plugin-macros "^3.0.1" + babel-plugin-polyfill-corejs3 "^0.1.0" + chalk "^4.1.0" + core-js "^3.8.2" + express "^4.17.1" + file-system-cache "^1.0.5" + find-up "^5.0.0" + fork-ts-checker-webpack-plugin "^6.0.4" + fs-extra "^9.0.1" + glob "^7.1.6" + handlebars "^4.7.7" + interpret "^2.2.0" + json5 "^2.1.3" + lazy-universal-dotenv "^3.0.1" + picomatch "^2.3.0" + pkg-dir "^5.0.0" + pretty-hrtime "^1.0.3" + resolve-from "^5.0.0" + slash "^3.0.0" + telejson "^6.0.8" + ts-dedent "^2.0.0" + util-deprecate "^1.0.2" + webpack "4" + "@storybook/core-events@6.5.7": version "6.5.7" resolved "https://registry.yarnpkg.com/@storybook/core-events/-/core-events-6.5.7.tgz#a533f3a57e495a1660c82c5d6164ca464bf4a2b2" @@ -3266,6 +3495,13 @@ dependencies: core-js "^3.8.2" +"@storybook/core-events@6.5.8": + version "6.5.8" + resolved "https://registry.yarnpkg.com/@storybook/core-events/-/core-events-6.5.8.tgz#bc405d37d0ed1a6eafa2682fc085b2a7a992233c" + integrity sha512-lzG4Lg65WFYvjs2k/E3CP4+eyPexEGrDyRMO9Pbj9H9x+eosYptauEbT/wXF83bmUWZKLWWVUAZX7hDcxBO8cw== + dependencies: + core-js "^3.8.2" + "@storybook/core-server@6.5.7": version "6.5.7" resolved "https://registry.yarnpkg.com/@storybook/core-server/-/core-server-6.5.7.tgz#3e849045617a3bc0cfa0091fc3952c150114428e" @@ -3406,20 +3642,20 @@ webpack-dev-middleware "^3.7.3" webpack-virtual-modules "^0.2.2" -"@storybook/manager-webpack5@^6.5.7": - version "6.5.7" - resolved "https://registry.yarnpkg.com/@storybook/manager-webpack5/-/manager-webpack5-6.5.7.tgz#a7446c86d96bb4b91e5dc554d21da8102795a11f" - integrity sha512-4TZKe71noCRui8sUxSuSqO6zMnCxCLn7dE1dOlCr/UvyZbCaGWACO5olUDQrT+n1glZL8i9L998JGQroksucNw== +"@storybook/manager-webpack5@^6.5.8": + version "6.5.8" + resolved "https://registry.yarnpkg.com/@storybook/manager-webpack5/-/manager-webpack5-6.5.8.tgz#36e97096506073c837716897495fffe4a616fe83" + integrity sha512-foW/ZvTqGZAl4TfcfGKdS3RlaBDDAgEjUCbCaVShlZRshZ8tzWBVu3JQFqbPVGslH89T5qp9DUYoN/SJqTUpcg== dependencies: "@babel/core" "^7.12.10" "@babel/plugin-transform-template-literals" "^7.12.1" "@babel/preset-react" "^7.12.10" - "@storybook/addons" "6.5.7" - "@storybook/core-client" "6.5.7" - "@storybook/core-common" "6.5.7" - "@storybook/node-logger" "6.5.7" - "@storybook/theming" "6.5.7" - "@storybook/ui" "6.5.7" + "@storybook/addons" "6.5.8" + "@storybook/core-client" "6.5.8" + "@storybook/core-common" "6.5.8" + "@storybook/node-logger" "6.5.8" + "@storybook/theming" "6.5.8" + "@storybook/ui" "6.5.8" "@types/node" "^14.0.10 || ^16.0.0" babel-loader "^8.0.0" case-sensitive-paths-webpack-plugin "^2.3.0" @@ -3461,7 +3697,7 @@ prettier ">=2.2.1 <=2.3.0" ts-dedent "^2.0.0" -"@storybook/node-logger@6.5.7", "@storybook/node-logger@^6.5.6": +"@storybook/node-logger@6.5.7": version "6.5.7" resolved "https://registry.yarnpkg.com/@storybook/node-logger/-/node-logger-6.5.7.tgz#a31d91be3cd9d9f033d340b1dc2b8e1c0de61cb6" integrity sha512-OrHu5p2E5i7P2v2hQAOtZw6Od1e2nrP6L7w5SxUPgccUnKUD9dRX5Y8qbAcPZO3XCkMLjpjAbC1xBXG0eFkn9g== @@ -3472,6 +3708,17 @@ npmlog "^5.0.1" pretty-hrtime "^1.0.3" +"@storybook/node-logger@6.5.8", "@storybook/node-logger@^6.5.6": + version "6.5.8" + resolved "https://registry.yarnpkg.com/@storybook/node-logger/-/node-logger-6.5.8.tgz#d1244c846da5a296a7432444f8682f77853fb81e" + integrity sha512-BHdkSipgjnfsh4FRYbV2R0npM5gVx9JLRsDQ0KiTolRpN4SU98kT/6885zb9jZg6I0EY+UG9Qdr3fvL9VLpY1g== + dependencies: + "@types/npmlog" "^4.1.2" + chalk "^4.1.0" + core-js "^3.8.2" + npmlog "^5.0.1" + pretty-hrtime "^1.0.3" + "@storybook/postinstall@6.5.7": version "6.5.7" resolved "https://registry.yarnpkg.com/@storybook/postinstall/-/postinstall-6.5.7.tgz#5bca298bfdfe37dff9d42fa7588d3bdce3e1aa85" @@ -3513,6 +3760,28 @@ unfetch "^4.2.0" util-deprecate "^1.0.2" +"@storybook/preview-web@6.5.8": + version "6.5.8" + resolved "https://registry.yarnpkg.com/@storybook/preview-web/-/preview-web-6.5.8.tgz#b1c86d56e99032c02ba47bab628c36d76a0385b6" + integrity sha512-jEEAgvTVZfFA0B20mRJfLW6dPA5mG5PxUJtjMx6wH4Yw4+i3Sld/U63hTRt7ktpKdrcu4lX9E+PuaRLPq7S2kg== + dependencies: + "@storybook/addons" "6.5.8" + "@storybook/channel-postmessage" "6.5.8" + "@storybook/client-logger" "6.5.8" + "@storybook/core-events" "6.5.8" + "@storybook/csf" "0.0.2--canary.4566f4d.1" + "@storybook/store" "6.5.8" + ansi-to-html "^0.6.11" + core-js "^3.8.2" + global "^4.4.0" + lodash "^4.17.21" + qs "^6.10.0" + regenerator-runtime "^0.13.7" + synchronous-promise "^2.0.15" + ts-dedent "^2.0.0" + unfetch "^4.2.0" + util-deprecate "^1.0.2" + "@storybook/react-docgen-typescript-plugin@1.0.2-canary.6.9d540b91e815f8fc2f8829189deb00553559ff63.0", "@storybook/react-docgen-typescript-plugin@canary": version "1.0.2-canary.6.9d540b91e815f8fc2f8829189deb00553559ff63.0" resolved "https://registry.yarnpkg.com/@storybook/react-docgen-typescript-plugin/-/react-docgen-typescript-plugin-1.0.2-canary.6.9d540b91e815f8fc2f8829189deb00553559ff63.0.tgz#3103532ff494fb7dc3cf835f10740ecf6a26c0f9" @@ -3576,6 +3845,15 @@ core-js "^3.8.2" regenerator-runtime "^0.13.7" +"@storybook/router@6.5.8": + version "6.5.8" + resolved "https://registry.yarnpkg.com/@storybook/router/-/router-6.5.8.tgz#241e3842bdd174e0eeeb9d1de6adb2975615884d" + integrity sha512-tseNJpZ2ZzVYowjekUMpGJVVRMrwOkttieD9mRbHrhh+2n7b+SoMKnuLi3ow0xeOyPL8ZDng2FgRjQzQHXA5Sw== + dependencies: + "@storybook/client-logger" "6.5.8" + core-js "^3.8.2" + regenerator-runtime "^0.13.7" + "@storybook/semver@^7.3.2": version "7.3.2" resolved "https://registry.yarnpkg.com/@storybook/semver/-/semver-7.3.2.tgz#f3b9c44a1c9a0b933c04e66d0048fcf2fa10dac0" @@ -3621,6 +3899,27 @@ ts-dedent "^2.0.0" util-deprecate "^1.0.2" +"@storybook/store@6.5.8": + version "6.5.8" + resolved "https://registry.yarnpkg.com/@storybook/store/-/store-6.5.8.tgz#528bf9a2decf5121045fb0a19b8caf795b4a5647" + integrity sha512-5rhGjN/O0oLebRv947B0vgapq48qBBBYYOgq4krRUYU2ecS6LUgtAHR/kTa324o9aBO8cnIXHH78jZcSvMiJlQ== + dependencies: + "@storybook/addons" "6.5.8" + "@storybook/client-logger" "6.5.8" + "@storybook/core-events" "6.5.8" + "@storybook/csf" "0.0.2--canary.4566f4d.1" + core-js "^3.8.2" + fast-deep-equal "^3.1.3" + global "^4.4.0" + lodash "^4.17.21" + memoizerific "^1.11.3" + regenerator-runtime "^0.13.7" + slash "^3.0.0" + stable "^0.1.8" + synchronous-promise "^2.0.15" + ts-dedent "^2.0.0" + util-deprecate "^1.0.2" + "@storybook/telemetry@6.5.7": version "6.5.7" resolved "https://registry.yarnpkg.com/@storybook/telemetry/-/telemetry-6.5.7.tgz#744050ec84b8d8effeab448b9b2e190951a2e070" @@ -3648,6 +3947,15 @@ core-js "^3.8.2" regenerator-runtime "^0.13.7" +"@storybook/theming@6.5.8": + version "6.5.8" + resolved "https://registry.yarnpkg.com/@storybook/theming/-/theming-6.5.8.tgz#240a3c83ea53a9c7b1f3a2c47d6324f38ecb8771" + integrity sha512-1VaKHqj38Ls1bJwDpg3+aEOlvVib/DCFkP6WYrP/AQtNAzxiyw5WkaoRlTVJZvCdu5TxjpG4O6/Ai5TI9QftIg== + dependencies: + "@storybook/client-logger" "6.5.8" + core-js "^3.8.2" + regenerator-runtime "^0.13.7" + "@storybook/ui@6.5.7": version "6.5.7" resolved "https://registry.yarnpkg.com/@storybook/ui/-/ui-6.5.7.tgz#d4814c88bd1ca4781891611c2c1fbb23e221d95a" @@ -3666,6 +3974,24 @@ regenerator-runtime "^0.13.7" resolve-from "^5.0.0" +"@storybook/ui@6.5.8": + version "6.5.8" + resolved "https://registry.yarnpkg.com/@storybook/ui/-/ui-6.5.8.tgz#acd8dadd221c68f65c4963c4ab86b4a757860591" + integrity sha512-rL09kxgY9pCVbxr/VUK4b5FL5VbALfciZR+50sNT1EcTDb9k0OPeqx7a4Ptc+KNkgyPdSTxUGvhzVqH5PYrhZQ== + dependencies: + "@storybook/addons" "6.5.8" + "@storybook/api" "6.5.8" + "@storybook/channels" "6.5.8" + "@storybook/client-logger" "6.5.8" + "@storybook/components" "6.5.8" + "@storybook/core-events" "6.5.8" + "@storybook/router" "6.5.8" + "@storybook/semver" "^7.3.2" + "@storybook/theming" "6.5.8" + core-js "^3.8.2" + regenerator-runtime "^0.13.7" + resolve-from "^5.0.0" + "@surma/rollup-plugin-off-main-thread@^2.2.3": version "2.2.3" resolved "https://registry.yarnpkg.com/@surma/rollup-plugin-off-main-thread/-/rollup-plugin-off-main-thread-2.2.3.tgz#ee34985952ca21558ab0d952f00298ad2190c053" @@ -4864,22 +5190,22 @@ "@webassemblyjs/wast-parser" "1.9.0" "@xtuc/long" "4.2.2" -"@webpack-cli/configtest@^1.1.1": - version "1.1.1" - resolved "https://registry.yarnpkg.com/@webpack-cli/configtest/-/configtest-1.1.1.tgz#9f53b1b7946a6efc2a749095a4f450e2932e8356" - integrity sha512-1FBc1f9G4P/AxMqIgfZgeOTuRnwZMten8E7zap5zgpPInnCrP8D4Q81+4CWIch8i/Nf7nXjP0v6CjjbHOrXhKg== +"@webpack-cli/configtest@^1.2.0": + version "1.2.0" + resolved "https://registry.yarnpkg.com/@webpack-cli/configtest/-/configtest-1.2.0.tgz#7b20ce1c12533912c3b217ea68262365fa29a6f5" + integrity sha512-4FB8Tj6xyVkyqjj1OaTqCjXYULB9FMkqQ8yGrZjRDrYh0nOE+7Lhs45WioWQQMV+ceFlE368Ukhe6xdvJM9Egg== -"@webpack-cli/info@^1.4.1": - version "1.4.1" - resolved "https://registry.yarnpkg.com/@webpack-cli/info/-/info-1.4.1.tgz#2360ea1710cbbb97ff156a3f0f24556e0fc1ebea" - integrity sha512-PKVGmazEq3oAo46Q63tpMr4HipI3OPfP7LiNOEJg963RMgT0rqheag28NCML0o3GIzA3DmxP1ZIAv9oTX1CUIA== +"@webpack-cli/info@^1.5.0": + version "1.5.0" + resolved "https://registry.yarnpkg.com/@webpack-cli/info/-/info-1.5.0.tgz#6c78c13c5874852d6e2dd17f08a41f3fe4c261b1" + integrity sha512-e8tSXZpw2hPl2uMJY6fsMswaok5FdlGNRTktvFk2sD8RjH0hE2+XistawJx1vmKteh4NmGmNUrp+Tb2w+udPcQ== dependencies: envinfo "^7.7.3" -"@webpack-cli/serve@^1.6.1": - version "1.6.1" - resolved "https://registry.yarnpkg.com/@webpack-cli/serve/-/serve-1.6.1.tgz#0de2875ac31b46b6c5bb1ae0a7d7f0ba5678dffe" - integrity sha512-gNGTiTrjEVQ0OcVnzsRSqTxaBSr+dmTfm+qJsCDluky8uhdLWep7Gcr62QsAKHTMxjCS/8nEITsmFAhfIx+QSw== +"@webpack-cli/serve@^1.7.0": + version "1.7.0" + resolved "https://registry.yarnpkg.com/@webpack-cli/serve/-/serve-1.7.0.tgz#e1993689ac42d2b16e9194376cfb6753f6254db1" + integrity sha512-oxnCNGj88fL+xzV+dacXs44HcDwf1ovs3AuEzvP7mqXw7fQntqIhQ1BRmynh4qEKQSSSRSWVyXRjmTbZIX9V2Q== "@xobotyi/scrollbar-width@^1.9.5": version "1.9.5" @@ -7742,7 +8068,7 @@ detect-port@^1.3.0: address "^1.0.1" debug "^2.6.0" -detective@^5.2.0: +detective@^5.2.1: version "5.2.1" resolved "https://registry.yarnpkg.com/detective/-/detective-5.2.1.tgz#6af01eeda11015acb0e73f933242b70f24f91034" integrity sha512-v9XE1zRnz1wRtgurGu0Bs8uHKFSTdteYZNbIPFVhUZ39L/S79ppMpdmVOZAnoz1jfEFodc48n6MX483Xo3t1yw== @@ -13976,7 +14302,7 @@ postcss@^7.0.14, postcss@^7.0.26, postcss@^7.0.32, postcss@^7.0.35, postcss@^7.0 picocolors "^0.2.1" source-map "^0.6.1" -postcss@^8.2.15, postcss@^8.3.11, postcss@^8.3.5, postcss@^8.4.12, postcss@^8.4.13, postcss@^8.4.14, postcss@^8.4.4, postcss@^8.4.7: +postcss@^8.2.15, postcss@^8.3.11, postcss@^8.3.5, postcss@^8.4.13, postcss@^8.4.14, postcss@^8.4.4, postcss@^8.4.7: version "8.4.14" resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.14.tgz#ee9274d5622b4858c1007a74d76e42e56fd21caf" integrity sha512-E398TUmfAYFPBSdzgeieK2Y1+1cpdxJx8yXbK/m57nRhKSmk1GB2tO4lbLBtlkfPQTDKfe4Xqv1ASWPpayPEig== @@ -14484,10 +14810,10 @@ react-helmet-async@*, react-helmet-async@^1.3.0: react-fast-compare "^3.2.0" shallowequal "^1.1.0" -react-hook-form@^7.31.3: - version "7.31.3" - resolved "https://registry.yarnpkg.com/react-hook-form/-/react-hook-form-7.31.3.tgz#b61bafb9a7435f91695351a7a9f714d8c4df0121" - integrity sha512-NVZdCWViIWXXXlQ3jxVQH0NuNfwPf8A/0KvuCxrM9qxtP1qYosfR2ZudarziFrVOC7eTUbWbm1T4OyYCwv9oSQ== +react-hook-form@^7.32.0: + version "7.32.0" + resolved "https://registry.yarnpkg.com/react-hook-form/-/react-hook-form-7.32.0.tgz#bfe36000e3a9fa605a4e3e9a029282feb094ef6a" + integrity sha512-AFUwl9MwVVnZZsFZW7Egc8PVyWem6c6/9FBq29Acsikm+8ecJCkqOn2Tl48GApFnXBgoBBEHC3zosjYvPfsGNg== react-inspector@^5.1.0: version "5.1.1" @@ -14779,10 +15105,10 @@ reading-time@^1.5.0: resolved "https://registry.yarnpkg.com/reading-time/-/reading-time-1.5.0.tgz#d2a7f1b6057cb2e169beaf87113cc3411b5bc5bb" integrity sha512-onYyVhBNr4CmAxFsKS7bz+uTLRakypIe4R+5A824vBSkQy/hB3fZepoVEf8OVAxzLvK+H/jm9TzpI3ETSm64Kg== -reanalyze@^2.22.0: - version "2.22.0" - resolved "https://registry.yarnpkg.com/reanalyze/-/reanalyze-2.22.0.tgz#068cfb354b6e9aa95ceb8dbb04329a67b4a90494" - integrity sha512-VNwTXBsyuUbCkmcb2GkYYjQxv3NQW4CombkNd+n5E+YWNqF5LLFi1N5bETR09C2hbuOE1fM6RTJKgbijZX7jyA== +reanalyze@^2.23.0: + version "2.23.0" + resolved "https://registry.yarnpkg.com/reanalyze/-/reanalyze-2.23.0.tgz#0e2a3109518ccad0ba04366ec1811db17fa07b7e" + integrity sha512-5pkH13pX1PrZFkIfmZUjKtYCqzFY2jTaEjBsqyR9SM3HLexAtkHTa4vLHTwuYk167KuO1uwWyEppo8NJIjfkOw== rechoir@^0.6.2: version "0.6.2" @@ -16426,15 +16752,15 @@ synchronous-promise@^2.0.15: resolved "https://registry.yarnpkg.com/synchronous-promise/-/synchronous-promise-2.0.15.tgz#07ca1822b9de0001f5ff73595f3d08c4f720eb8e" integrity sha512-k8uzYIkIVwmT+TcglpdN50pS2y1BDcUnBPK9iJeGu0Pl1lOI8pD6wtzgw91Pjpe+RxtTncw32tLxs/R0yNL2Mg== -tailwindcss@^3.0.2, tailwindcss@^3.0.24: - version "3.0.24" - resolved "https://registry.yarnpkg.com/tailwindcss/-/tailwindcss-3.0.24.tgz#22e31e801a44a78a1d9a81ecc52e13b69d85704d" - integrity sha512-H3uMmZNWzG6aqmg9q07ZIRNIawoiEcNFKDfL+YzOPuPsXuDXxJxB9icqzLgdzKNwjG3SAro2h9SYav8ewXNgig== +tailwindcss@^3.0.2, tailwindcss@^3.1.2: + version "3.1.2" + resolved "https://registry.yarnpkg.com/tailwindcss/-/tailwindcss-3.1.2.tgz#b5607d17adb6cbb11a13738cc5fdf3e5527dcd7a" + integrity sha512-yJ6L5s1U5AeS5g7HHy212zdQfjwD426FBfm59pet/JsyneuZuD4C2W7PpJEg4ppisiB21uLqtNagv8KXury3+Q== dependencies: arg "^5.0.1" chokidar "^3.5.3" color-name "^1.1.4" - detective "^5.2.0" + detective "^5.2.1" didyoumean "^1.2.2" dlv "^1.1.3" fast-glob "^3.2.11" @@ -16444,7 +16770,8 @@ tailwindcss@^3.0.2, tailwindcss@^3.0.24: normalize-path "^3.0.0" object-hash "^3.0.0" picocolors "^1.0.0" - postcss "^8.4.12" + postcss "^8.4.14" + postcss-import "^14.1.0" postcss-js "^4.0.0" postcss-load-config "^3.1.4" postcss-nested "5.0.6" @@ -17897,18 +18224,18 @@ webpack-bundle-analyzer@^4.5.0: sirv "^1.0.7" ws "^7.3.1" -webpack-cli@^4.9.2: - version "4.9.2" - resolved "https://registry.yarnpkg.com/webpack-cli/-/webpack-cli-4.9.2.tgz#77c1adaea020c3f9e2db8aad8ea78d235c83659d" - integrity sha512-m3/AACnBBzK/kMTcxWHcZFPrw/eQuY4Df1TxvIWfWM2x7mRqBQCqKEd96oCUa9jkapLBaFfRce33eGDb4Pr7YQ== +webpack-cli@^4.10.0: + version "4.10.0" + resolved "https://registry.yarnpkg.com/webpack-cli/-/webpack-cli-4.10.0.tgz#37c1d69c8d85214c5a65e589378f53aec64dab31" + integrity sha512-NLhDfH/h4O6UOy+0LSso42xvYypClINuMNBVVzX4vX98TmTaTUxwRbXdhucbFMd2qLaCTcLq/PdYrvi8onw90w== dependencies: "@discoveryjs/json-ext" "^0.5.0" - "@webpack-cli/configtest" "^1.1.1" - "@webpack-cli/info" "^1.4.1" - "@webpack-cli/serve" "^1.6.1" + "@webpack-cli/configtest" "^1.2.0" + "@webpack-cli/info" "^1.5.0" + "@webpack-cli/serve" "^1.7.0" colorette "^2.0.14" commander "^7.0.0" - execa "^5.0.0" + cross-spawn "^7.0.3" fastest-levenshtein "^1.0.12" import-local "^3.0.2" interpret "^2.2.0"