@khanacademy/perseus 1.3.2 → 1.3.4

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.
Files changed (39) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/es/index.css +12 -12
  3. package/dist/es/index.js +32 -26
  4. package/dist/es/index.js.map +1 -1
  5. package/dist/index.css +12 -12
  6. package/dist/index.js +32 -26
  7. package/dist/index.js.map +1 -1
  8. package/package.json +1 -1
  9. package/src/__tests__/__snapshots__/perseus-markdown_test.jsx.snap +111 -111
  10. package/src/__tests__/item-renderer_test.jsx +9 -9
  11. package/src/__tests__/jipt-paragraphs_test.js +3 -3
  12. package/src/__tests__/renderer_test.jsx +22 -22
  13. package/src/__tests__/server-item-renderer_test.jsx +7 -7
  14. package/src/components/__tests__/sortable_test.jsx +7 -7
  15. package/src/multi-items/__tests__/__snapshots__/multi-renderer_test.js.snap +5 -5
  16. package/src/multi-items/__tests__/multi-renderer_test.js +90 -90
  17. package/src/renderer.jsx +2 -2
  18. package/src/styles/articles.less +6 -6
  19. package/src/widgets/__tests__/__snapshots__/grapher_test.jsx.snap +68 -68
  20. package/src/widgets/__tests__/__snapshots__/group_test.jsx.snap +5 -5
  21. package/src/widgets/__tests__/__snapshots__/interaction_test.jsx.snap +5 -5
  22. package/src/widgets/__tests__/__snapshots__/interactive-graph_test.jsx.snap +2 -2
  23. package/src/widgets/__tests__/__snapshots__/passage_test.jsx.snap +2 -2
  24. package/src/widgets/__tests__/__snapshots__/radio_test.jsx.snap +52 -52
  25. package/src/widgets/__tests__/categorizer_test.jsx +5 -5
  26. package/src/widgets/__tests__/explanation_test.js +5 -5
  27. package/src/widgets/__tests__/graded-group-set_test.jsx +2 -2
  28. package/src/widgets/__tests__/group_test.jsx +49 -49
  29. package/src/widgets/__tests__/numeric-input_test.jsx +5 -5
  30. package/src/widgets/__tests__/passage_test.jsx +1 -1
  31. package/src/widgets/__tests__/radio/base-radio_test.jsx +28 -1
  32. package/src/widgets/categorizer.jsx +1 -1
  33. package/src/widgets/expression.jsx +6 -6
  34. package/src/widgets/input-number.jsx +4 -4
  35. package/src/widgets/numeric-input.jsx +5 -5
  36. package/src/widgets/radio/base-radio.jsx +8 -3
  37. package/src/widgets/radio/choice-icon/library-choice-icon.jsx +2 -2
  38. package/src/widgets/radio/choice.jsx +1 -1
  39. package/src/widgets/radio/widget.jsx +2 -2
@@ -170,16 +170,16 @@ describe("renderer", () => {
170
170
 
171
171
  expect(renderer.state.widgetInfo).toStrictEqual(question1.widgets);
172
172
  expect(renderer.state.widgetProps).toMatchInlineSnapshot(`
173
- Object {
174
- "dropdown 1": Object {
175
- "choices": Array [
176
- "greater than or equal to",
177
- "less than or equal to",
178
- ],
179
- "placeholder": "greater/less than or equal to",
180
- },
181
- }
182
- `);
173
+ {
174
+ "dropdown 1": {
175
+ "choices": [
176
+ "greater than or equal to",
177
+ "less than or equal to",
178
+ ],
179
+ "placeholder": "greater/less than or equal to",
180
+ },
181
+ }
182
+ `);
183
183
  });
184
184
 
185
185
  it("should derive type widget ID if type missing", () => {
@@ -1549,25 +1549,25 @@ describe("renderer", () => {
1549
1549
 
1550
1550
  // Assert
1551
1551
  expect(inputPaths).toMatchInlineSnapshot(`
1552
- Array [
1553
- Array [
1552
+ [
1553
+ [
1554
1554
  "mock-widget 1",
1555
1555
  "input 1",
1556
1556
  ],
1557
- Array [
1557
+ [
1558
1558
  "mock-widget 2",
1559
1559
  "input 2",
1560
1560
  ],
1561
- Array [
1561
+ [
1562
1562
  "mock-widget 2",
1563
1563
  "input 3",
1564
1564
  ],
1565
- Array [
1565
+ [
1566
1566
  "mock-widget 3",
1567
1567
  "input 4",
1568
1568
  "sub-input 4.1",
1569
1569
  ],
1570
- Array [
1570
+ [
1571
1571
  "mock-widget 3",
1572
1572
  "input 5",
1573
1573
  ],
@@ -1706,15 +1706,15 @@ describe("renderer", () => {
1706
1706
 
1707
1707
  // Assert
1708
1708
  expect(userInput).toMatchInlineSnapshot(`
1709
- Object {
1710
- "dropdown 1": Object {
1709
+ {
1710
+ "dropdown 1": {
1711
1711
  "value": 1,
1712
1712
  },
1713
1713
  "image 1": null,
1714
- "input-number 1": Object {
1714
+ "input-number 1": {
1715
1715
  "currentValue": "100",
1716
1716
  },
1717
- "input-number 2": Object {
1717
+ "input-number 2": {
1718
1718
  "currentValue": "200",
1719
1719
  },
1720
1720
  }
@@ -1745,12 +1745,12 @@ describe("renderer", () => {
1745
1745
 
1746
1746
  // Assert
1747
1747
  expect(examples).toMatchInlineSnapshot(`
1748
- Array [
1748
+ [
1749
1749
  "**Your answer should be** ",
1750
1750
  "an integer, like $6$",
1751
1751
  "a *proper* fraction, like $1/2$ or $6/10$",
1752
1752
  "an *improper* fraction, like $10/7$ or $14/8$",
1753
- "a mixed number, like $1\\\\ 3/4$",
1753
+ "a mixed number, like $1\\ 3/4$",
1754
1754
  ]
1755
1755
  `);
1756
1756
  });
@@ -466,14 +466,14 @@ describe("server item renderer", () => {
466
466
 
467
467
  // Assert
468
468
  expect(state).toMatchInlineSnapshot(`
469
- Object {
470
- "hints": Array [
471
- Object {},
472
- Object {},
473
- Object {},
469
+ {
470
+ "hints": [
471
+ {},
472
+ {},
473
+ {},
474
474
  ],
475
- "question": Object {
476
- "input-number 1": Object {
475
+ "question": {
476
+ "input-number 1": {
477
477
  "answerType": "number",
478
478
  "currentValue": "-42",
479
479
  "rightAlign": undefined,
@@ -141,25 +141,25 @@ describe("Sortable.itemsFromProps", () => {
141
141
 
142
142
  // Assert
143
143
  expect(items).toMatchInlineSnapshot(`
144
- Array [
145
- Object {
146
- "endPosition": Object {},
144
+ [
145
+ {
146
+ "endPosition": {},
147
147
  "height": 0,
148
148
  "key": 0,
149
149
  "option": "a",
150
150
  "type": "static",
151
151
  "width": 0,
152
152
  },
153
- Object {
154
- "endPosition": Object {},
153
+ {
154
+ "endPosition": {},
155
155
  "height": 0,
156
156
  "key": 1,
157
157
  "option": "b",
158
158
  "type": "static",
159
159
  "width": 0,
160
160
  },
161
- Object {
162
- "endPosition": Object {},
161
+ {
162
+ "endPosition": {},
163
163
  "height": 0,
164
164
  "key": 2,
165
165
  "option": "c",
@@ -215,7 +215,7 @@ exports[`multi-item renderer should snapshot: initial render 1`] = `
215
215
  aria-disabled="false"
216
216
  aria-hidden="true"
217
217
  aria-label=""
218
- class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-inlineStyles_bc4egv"
218
+ class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-inlineStyles_1msdppf"
219
219
  tabindex="0"
220
220
  type="button"
221
221
  >
@@ -392,7 +392,7 @@ exports[`multi-item renderer should snapshot: initial render 1`] = `
392
392
  aria-disabled="false"
393
393
  aria-hidden="true"
394
394
  aria-label=""
395
- class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-inlineStyles_bc4egv"
395
+ class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-inlineStyles_1msdppf"
396
396
  tabindex="0"
397
397
  type="button"
398
398
  >
@@ -569,7 +569,7 @@ exports[`multi-item renderer should snapshot: initial render 1`] = `
569
569
  aria-disabled="false"
570
570
  aria-hidden="true"
571
571
  aria-label=""
572
- class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-inlineStyles_bc4egv"
572
+ class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-inlineStyles_1msdppf"
573
573
  tabindex="0"
574
574
  type="button"
575
575
  >
@@ -746,7 +746,7 @@ exports[`multi-item renderer should snapshot: initial render 1`] = `
746
746
  aria-disabled="false"
747
747
  aria-hidden="true"
748
748
  aria-label=""
749
- class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-inlineStyles_bc4egv"
749
+ class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-inlineStyles_1msdppf"
750
750
  tabindex="0"
751
751
  type="button"
752
752
  >
@@ -923,7 +923,7 @@ exports[`multi-item renderer should snapshot: initial render 1`] = `
923
923
  aria-disabled="false"
924
924
  aria-hidden="true"
925
925
  aria-label=""
926
- class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-inlineStyles_bc4egv"
926
+ class="button_vr44p2-o_O-reset_152ygtm-o_O-link_13xlah4-o_O-inlineStyles_1msdppf"
927
927
  tabindex="0"
928
928
  type="button"
929
929
  >