@khanacademy/perseus 91.1.1 → 92.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { B as ButtonGroup, G as Graphie, H as HUD, I as Icon, a as InlineIcon, M as MathInput, b as MultiButtonGroup, N as NumberInput, R as RangeInput, S as SvgImage, T as TextInput, r as registerWidgets, c as basicWidgets, e as extraWidgets, d as replaceDeprecatedWidgets, P as PerseusI18nContext, A as ApiOptions, C as ClassNames, j as jsxRuntimeExports, U as UserInputManager, f as Renderer, D as DependenciesContext, g as Util, h as getDependencies, J as JiptParagraphs, i as hintPaddingInlineStart, k as hintBorderWidth, m as mediaQueries, s as sharedStyles, l as context$1, n as getWidgetTypeByWidgetId, o as getWidgetExport, p as PerseusMarkdown, t as typeToButton, q as getEquationString, u as defaultPlotProps, v as chooseType, w as DEFAULT_GRAPHER_PROPS } from './chunk-register-all-widgets-for-testing-Q8lpxOOR.js';
2
- export { L as Categorizer, $ as Dependencies, E as Expression, X as GrapherWidget, z as InputNumber, O as InteractiveGraphWidget, a5 as KhanColors, a0 as Log, a1 as MathRenderingContext, Q as MatrixWidget, F as NumericInput, a3 as PerseusI18nContextProvider, W as PlotterWidget, K as Radio, V as TableWidget, x as Widgets, _ as bodyXsmallBold, a8 as containerSizeClass, ac as contentHasWidgetType, at as deriveUserInputFromSerializedState, af as getAbsoluteValueCoords, as as getAngleCoords, ag as getCircleCoords, ah as getExponentialCoords, a9 as getInteractiveBoxFromSizeClass, aj as getLineCoords, ak as getLinearSystemCoords, ai as getLogarithmCoords, al as getPointCoords, am as getPolygonCoords, ar as getQuadraticCoords, an as getSegmentCoords, ao as getSinusoidCoords, ap as getTangentCoords, aq as getVectorCoords, ad as getWidgetFromWidgetMap, ab as getWidgetSubTypeByWidgetId, ae as getWidgetsFromWidgetMap, Y as iconChevronDown, Z as iconTrash, a2 as interactiveSizes, aa as mathOnlyParser, au as parseDataFromJSONP, a6 as preprocessTex, a7 as registerAllWidgetsForTesting, a4 as usePerseusI18n, y as widgets } from './chunk-register-all-widgets-for-testing-Q8lpxOOR.js';
1
+ import { j as jsxRuntimeExports, N as NumberInput, B as ButtonGroup, G as Graphie, H as HUD, I as Icon, a as InlineIcon, M as MathInput, b as MultiButtonGroup, S as SvgImage, T as TextInput, r as registerWidgets, c as basicWidgets, e as extraWidgets, P as PerseusI18nContext, A as ApiOptions, C as ClassNames, U as UserInputManager, R as Renderer, D as DependenciesContext, d as Util, g as getDependencies, J as JiptParagraphs, h as hintPaddingInlineStart, f as hintBorderWidth, m as mediaQueries, s as sharedStyles, i as context$1, k as getWidgetTypeByWidgetId, l as getWidgetExport, n as PerseusMarkdown, t as typeToButton, o as getEquationString, p as defaultPlotProps, q as chooseType, u as DEFAULT_GRAPHER_PROPS } from './chunk-register-all-widgets-for-testing-e-q2XfHc.js';
2
+ export { F as Categorizer, Z as Dependencies, E as Expression, V as GrapherWidget, x as InputNumber, K as InteractiveGraphWidget, a3 as KhanColors, _ as Log, $ as MathRenderingContext, L as MatrixWidget, y as NumericInput, a1 as PerseusI18nContextProvider, Q as PlotterWidget, z as Radio, O as TableWidget, w as Widgets, Y as bodyXsmallBold, a6 as containerSizeClass, aa as contentHasWidgetType, ar as deriveUserInputFromSerializedState, ad as getAbsoluteValueCoords, aq as getAngleCoords, ae as getCircleCoords, af as getExponentialCoords, a7 as getInteractiveBoxFromSizeClass, ah as getLineCoords, ai as getLinearSystemCoords, ag as getLogarithmCoords, aj as getPointCoords, ak as getPolygonCoords, ap as getQuadraticCoords, al as getSegmentCoords, am as getSinusoidCoords, an as getTangentCoords, ao as getVectorCoords, ab as getWidgetFromWidgetMap, a9 as getWidgetSubTypeByWidgetId, ac as getWidgetsFromWidgetMap, W as iconChevronDown, X as iconTrash, a0 as interactiveSizes, a8 as mathOnlyParser, as as parseDataFromJSONP, a4 as preprocessTex, a5 as registerAllWidgetsForTesting, a2 as usePerseusI18n, v as widgets } from './chunk-register-all-widgets-for-testing-e-q2XfHc.js';
3
3
  import { addLibraryVersionToPerseusDebug } from '@khanacademy/perseus-utils';
4
4
  import * as React from 'react';
5
5
  import { createElement } from 'react';
@@ -37,6 +37,7 @@ import '@khanacademy/simple-markdown';
37
37
  import '@khanacademy/pure-markdown';
38
38
  import '@phosphor-icons/core/fill/dot-outline-fill.svg';
39
39
  import '@phosphor-icons/core/fill/warning-circle-fill.svg';
40
+ import '@khanacademy/wonder-blocks-banner';
40
41
  import '@khanacademy/wonder-blocks-announcer';
41
42
  import '@phosphor-icons/core/regular/caret-left.svg';
42
43
  import '@phosphor-icons/core/regular/caret-right.svg';
@@ -44,7 +45,6 @@ import '@khanacademy/wonder-blocks-icon';
44
45
  import '@phosphor-icons/core/bold/check-bold.svg';
45
46
  import '@phosphor-icons/core/bold/minus-circle-bold.svg';
46
47
  import '@dnd-kit/react';
47
- import '@khanacademy/wonder-blocks-banner';
48
48
  import '@khanacademy/wonder-blocks-dropdown';
49
49
  import '@phosphor-icons/core/regular/caret-down.svg';
50
50
  import '@phosphor-icons/core/regular/caret-up.svg';
@@ -68,6 +68,8 @@ import '@phosphor-icons/core/regular/x.svg';
68
68
  import '@khanacademy/wonder-blocks-layout';
69
69
  import '@khanacademy/wonder-blocks-link';
70
70
 
71
+ function RangeInput(props){const{value,placeholder=[null,null],checkValidity=()=>true,allowPiTruncation,...restOfProps}=props;const onChange=i=>newVal=>{const value=props.value;if(i===0){props.onChange([newVal,value[1]]);}else {props.onChange([value[0],newVal]);}};return jsxRuntimeExports.jsxs("div",{className:"range-input",children:[jsxRuntimeExports.jsx(NumberInput,{...restOfProps,value:value[0],checkValidity:val=>checkValidity([val,value[1]]),onChange:onChange(0),placeholder:placeholder[0],allowPiTruncation:allowPiTruncation}),jsxRuntimeExports.jsx(NumberInput,{...restOfProps,value:value[1],checkValidity:val=>checkValidity([value[0],val]),onChange:onChange(1),placeholder:placeholder[1],allowPiTruncation:allowPiTruncation})]})}
72
+
71
73
  var components = /*#__PURE__*/Object.freeze({
72
74
  __proto__: null,
73
75
  ButtonGroup: ButtonGroup,
@@ -83,9 +85,9 @@ var components = /*#__PURE__*/Object.freeze({
83
85
  TextInput: TextInput
84
86
  });
85
87
 
86
- const init=function(){registerWidgets(basicWidgets);registerWidgets(extraWidgets);replaceDeprecatedWidgets();};
88
+ const init=function(){registerWidgets(basicWidgets);registerWidgets(extraWidgets);};
87
89
 
88
- const libName="@khanacademy/perseus";const libVersion="91.1.1";addLibraryVersionToPerseusDebug(libName,libVersion);
90
+ const libName="@khanacademy/perseus";const libVersion="92.0.1";addLibraryVersionToPerseusDebug(libName,libVersion);
89
91
 
90
92
  const apiVersion={major:12,minor:0};
91
93
 
@@ -105,7 +107,7 @@ function getImagesWithoutAltData(perseusRenderer){if(!perseusRenderer.widgets){r
105
107
 
106
108
  function generateTestCategorizerWidget(){return {type:"categorizer",options:{items:[],categories:[],randomizeItems:false,values:[]}}}
107
109
 
108
- const widgetNameToEnum={blank:"BLANK",categorizer:"CATEGORIZER","cs-program":"CS_PROGRAM",definition:"DEFINITION","deprecated-standin":"DEPRECATED_STANDIN",dropdown:"DROPDOWN",explanation:"EXPLANATION",expression:"EXPRESSION","fill-in-the-blank":"FILL_IN_THE_BLANK","free-response":"FREE_RESPONSE","graded-group-set":"GRADED_GROUP_SET","graded-group":"GRADED_GROUP",grapher:"GRAPHER",group:"GROUP",iframe:"IFRAME",image:"IMAGE","input-number":"INPUT_NUMBER",interaction:"INTERACTIVE","interactive-graph":"INTERACTIVE_GRAPH","label-image":"LABEL_IMAGE","lights-puzzle":"LIGHTS_PUZZLE",matcher:"MATCHER",matrix:"MATRIX",measurer:"MEASURER","molecule-renderer":"MOLECULE","number-line":"NUMBER_LINE","numeric-input":"NUMERIC_INPUT",orderer:"ORDERER",passage:"PASSAGE","passage-ref":"PASSAGE_REF","passage-ref-target":"PASSAGE_REF_TARGET","phet-simulation":"PHET_SIMULATION",plotter:"PLOTTER","python-program":"PYTHON_PROGRAM","reaction-diagram":"REACTION_DIAGRAM",radio:"RADIO",sequence:"SEQUENCE",simulator:"SIMULATOR",sorter:"SORTER",table:"TABLE",video:"VIDEO"};function convertWidgetNameToEnum(name){const widgetEnum=widgetNameToEnum[name];if(!widgetEnum){throw new Error(`Unknown widget name: ${name}`)}return widgetEnum}
110
+ const widgetNameToEnum={blank:"BLANK",categorizer:"CATEGORIZER","cs-program":"CS_PROGRAM",definition:"DEFINITION",dropdown:"DROPDOWN",explanation:"EXPLANATION",expression:"EXPRESSION","fill-in-the-blank":"FILL_IN_THE_BLANK","free-response":"FREE_RESPONSE","graded-group-set":"GRADED_GROUP_SET","graded-group":"GRADED_GROUP",grapher:"GRAPHER",group:"GROUP",iframe:"IFRAME",image:"IMAGE","input-number":"INPUT_NUMBER",interaction:"INTERACTIVE","interactive-graph":"INTERACTIVE_GRAPH","label-image":"LABEL_IMAGE","lights-puzzle":"LIGHTS_PUZZLE",matcher:"MATCHER",matrix:"MATRIX",measurer:"MEASURER","molecule-renderer":"MOLECULE","number-line":"NUMBER_LINE","numeric-input":"NUMERIC_INPUT",orderer:"ORDERER",passage:"PASSAGE","passage-ref":"PASSAGE_REF","passage-ref-target":"PASSAGE_REF_TARGET","phet-simulation":"PHET_SIMULATION",plotter:"PLOTTER","python-program":"PYTHON_PROGRAM","reaction-diagram":"REACTION_DIAGRAM",radio:"RADIO",sequence:"SEQUENCE",simulator:"SIMULATOR",sorter:"SORTER",table:"TABLE",video:"VIDEO"};function convertWidgetNameToEnum(name){const widgetEnum=widgetNameToEnum[name];if(!widgetEnum){throw new Error(`Unknown widget name: ${name}`)}return widgetEnum}
109
111
 
110
112
  function extractWidgetIds(perseusRenderer,options){const widgetIds=[];const content=perseusRenderer.content;const inline=options?.inline??false;const parsedMarkdown=inline?PerseusMarkdown.parseInline(content,options):PerseusMarkdown.parse(content,options);PerseusMarkdown.traverseContent(parsedMarkdown,node=>{if(node.type==="widget"){if(!widgetIds.includes(node.id)){widgetIds.push(node.id);}}});return widgetIds}
111
113