@khanacademy/perseus-core 42.2.0 → 42.4.0
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/data-schema.d.ts +25 -0
- package/dist/index.js +405 -396
- package/dist/index.js.map +1 -1
- package/dist/parse-perseus-json/general-purpose-parsers/object.d.ts +1 -16
- package/dist/parse-perseus-json/perseus-parsers/blank-user-input.d.ts +3 -0
- package/dist/parse-perseus-json/perseus-parsers/fill-in-the-blank-user-input.d.ts +3 -0
- package/dist/parse-perseus-json/perseus-parsers/sorter-widget.d.ts +9 -0
- package/dist/parse-perseus-json/regression-tests/item-data/sorter-with-legend-and-variant.d.ts +42 -0
- package/dist/parse-perseus-json/regression-tests/item-data/sorter-without-legend-and-variant.d.ts +33 -0
- package/dist/validation.types.d.ts +7 -0
- package/dist/widgets/sorter/sorter-util.d.ts +2 -0
- package/package.json +2 -2
package/dist/data-schema.d.ts
CHANGED
|
@@ -1608,6 +1608,19 @@ export type PerseusRadioChoice = {
|
|
|
1608
1608
|
/** If this is none of the above, override the content with "None of the above" */
|
|
1609
1609
|
isNoneOfTheAbove?: boolean;
|
|
1610
1610
|
};
|
|
1611
|
+
export type SorterVariant = "scale" | "timeline";
|
|
1612
|
+
export type SorterLegendCap = "arrow" | "bar" | "none";
|
|
1613
|
+
export type SorterLegend = {
|
|
1614
|
+
startCap: SorterLegendCap;
|
|
1615
|
+
endCap: SorterLegendCap;
|
|
1616
|
+
/** Translatable text - accepts plain text and TeX but not markdown */
|
|
1617
|
+
startLabel: string;
|
|
1618
|
+
/** Translatable text - accepts plain text and TeX but not markdown */
|
|
1619
|
+
endLabel: string;
|
|
1620
|
+
/** Translatable text */
|
|
1621
|
+
ariaLabel: string;
|
|
1622
|
+
position: "above" | "below";
|
|
1623
|
+
};
|
|
1611
1624
|
/** Options for the sorter widget. Cards to arrange into the correct order. */
|
|
1612
1625
|
export type PerseusSorterWidgetOptions = {
|
|
1613
1626
|
/**
|
|
@@ -1620,6 +1633,18 @@ export type PerseusSorterWidgetOptions = {
|
|
|
1620
1633
|
* "vertical" layout is best for longer text and larger images.
|
|
1621
1634
|
*/
|
|
1622
1635
|
layout: "horizontal" | "vertical";
|
|
1636
|
+
/**
|
|
1637
|
+
* Which kind of Sorter this is. Content saved without one is parsed as
|
|
1638
|
+
* "scale".
|
|
1639
|
+
* Sets the allowed number of blanks, the layout ("timeline" adds connector
|
|
1640
|
+
* lines and staggers blanks around the legend), and the default legend caps.
|
|
1641
|
+
*/
|
|
1642
|
+
variant: SorterVariant;
|
|
1643
|
+
/**
|
|
1644
|
+
* The labeled line along the blanks that shows learners which order
|
|
1645
|
+
* to place the tiles in, with optional end caps.
|
|
1646
|
+
*/
|
|
1647
|
+
legend?: SorterLegend;
|
|
1623
1648
|
/**
|
|
1624
1649
|
* Adds padding to the options. Padding is good for text but not needed
|
|
1625
1650
|
* for images
|