@khanacademy/perseus-editor 4.1.5 → 4.1.7

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 (175) hide show
  1. package/dist/es/index.js +1 -1
  2. package/dist/index.js +1 -1
  3. package/package.json +9 -6
  4. package/.babelrc.js +0 -8
  5. package/.eslintrc.js +0 -12
  6. package/CHANGELOG.md +0 -1155
  7. package/src/README.md +0 -7
  8. package/src/__stories__/editor-page.stories.tsx +0 -65
  9. package/src/__stories__/editor.stories.tsx +0 -134
  10. package/src/__stories__/item-editor.stories.tsx +0 -41
  11. package/src/__stories__/tex-error-view.stories.tsx +0 -26
  12. package/src/__testdata__/input-number.testdata.ts +0 -27
  13. package/src/__tests__/editor.test.tsx +0 -142
  14. package/src/__tests__/hint-editor.test.tsx +0 -83
  15. package/src/__tests__/i18n.test.ts +0 -501
  16. package/src/__tests__/integration.test.ts +0 -5
  17. package/src/__tests__/item-extras-editor.test.tsx +0 -85
  18. package/src/__tests__/traversal.test.ts +0 -377
  19. package/src/all-editors.test.ts +0 -16
  20. package/src/all-editors.ts +0 -83
  21. package/src/all-widgets.ts +0 -7
  22. package/src/article-editor.tsx +0 -438
  23. package/src/components/__stories__/blur-input.stories.tsx +0 -22
  24. package/src/components/__stories__/section-control-button.stories.tsx +0 -26
  25. package/src/components/__tests__/blur-input.test.tsx +0 -67
  26. package/src/components/blur-input.tsx +0 -69
  27. package/src/components/checkbox.tsx +0 -194
  28. package/src/components/device-framer.tsx +0 -90
  29. package/src/components/drag-target.tsx +0 -87
  30. package/src/components/dropdown-option.tsx +0 -311
  31. package/src/components/form-wrapped-text-field.tsx +0 -245
  32. package/src/components/graph-points-count-selector.tsx +0 -31
  33. package/src/components/graph-settings.tsx +0 -627
  34. package/src/components/graph-type-selector.tsx +0 -31
  35. package/src/components/hover-behavior.ts +0 -177
  36. package/src/components/json-editor.tsx +0 -121
  37. package/src/components/link.ts +0 -173
  38. package/src/components/section-control-button.tsx +0 -53
  39. package/src/components/segment-count-selector.tsx +0 -27
  40. package/src/components/simple-button.tsx +0 -85
  41. package/src/components/sortable.tsx +0 -187
  42. package/src/components/util.ts +0 -38
  43. package/src/components/viewport-resizer.tsx +0 -72
  44. package/src/components/widget-editor.tsx +0 -222
  45. package/src/components/widget-select.tsx +0 -48
  46. package/src/diffs/__stories__/perseus-diff-wrapper.tsx +0 -11
  47. package/src/diffs/__stories__/structured-item-diff.stories.tsx +0 -855
  48. package/src/diffs/__stories__/tags-diff.stories.tsx +0 -36
  49. package/src/diffs/__stories__/text-diff.stories.tsx +0 -35
  50. package/src/diffs/__tests__/split-diff.test.ts +0 -33
  51. package/src/diffs/__tests__/string-array-diff.test.ts +0 -73
  52. package/src/diffs/__tests__/structured-item-diff.test.ts +0 -433
  53. package/src/diffs/__tests__/widget-diff-performer.test.ts +0 -43
  54. package/src/diffs/article-diff.tsx +0 -69
  55. package/src/diffs/item-diff.tsx +0 -76
  56. package/src/diffs/renderer-diff.tsx +0 -137
  57. package/src/diffs/split-diff.ts +0 -31
  58. package/src/diffs/string-array-diff.ts +0 -74
  59. package/src/diffs/structured-item-diff.tsx +0 -275
  60. package/src/diffs/tags-diff.tsx +0 -49
  61. package/src/diffs/text-diff.tsx +0 -193
  62. package/src/diffs/widget-diff-performer.ts +0 -69
  63. package/src/diffs/widget-diff.tsx +0 -290
  64. package/src/editor-page.tsx +0 -325
  65. package/src/editor.tsx +0 -1099
  66. package/src/hint-editor.tsx +0 -469
  67. package/src/i18n.ts +0 -140
  68. package/src/iframe-content-renderer.tsx +0 -188
  69. package/src/index.ts +0 -30
  70. package/src/item-editor.tsx +0 -158
  71. package/src/item-extras-editor.tsx +0 -230
  72. package/src/katex-mhchem/index.js +0 -73
  73. package/src/katex-mhchem/parser.js +0 -2659
  74. package/src/multirenderer-editor.tsx +0 -1061
  75. package/src/stateful-article-editor.tsx +0 -173
  76. package/src/stateful-editor-page.tsx +0 -88
  77. package/src/styles/perseus-editor.less +0 -1321
  78. package/src/testing-widgets.ts +0 -11
  79. package/src/tex-error-view.tsx +0 -90
  80. package/src/util/points.test.ts +0 -24
  81. package/src/util/points.ts +0 -13
  82. package/src/util/register-all-widgets-and-editors-for-testing.test.ts +0 -17
  83. package/src/util/register-all-widgets-and-editors-for-testing.ts +0 -17
  84. package/src/version.ts +0 -10
  85. package/src/widgets/__stories__/categorizer-editor.stories.tsx +0 -24
  86. package/src/widgets/__stories__/definition-editor.stories.tsx +0 -18
  87. package/src/widgets/__stories__/dropdown-editor.stories.tsx +0 -18
  88. package/src/widgets/__stories__/explanation-editor.stories.tsx +0 -18
  89. package/src/widgets/__stories__/expression-editor.stories.tsx +0 -122
  90. package/src/widgets/__stories__/image-editor.stories.tsx +0 -72
  91. package/src/widgets/__stories__/input-number-editor.stories.tsx +0 -18
  92. package/src/widgets/__stories__/interaction-editor.stories.tsx +0 -37
  93. package/src/widgets/__stories__/label-image-editor.stories.tsx +0 -99
  94. package/src/widgets/__stories__/matcher-editor.stories.tsx +0 -18
  95. package/src/widgets/__stories__/number-line-editor.stories.tsx +0 -18
  96. package/src/widgets/__stories__/numeric-input-editor.stories.tsx +0 -18
  97. package/src/widgets/__stories__/radio-editor.stories.tsx +0 -116
  98. package/src/widgets/__stories__/sorter-editor.stories.tsx +0 -18
  99. package/src/widgets/__tests__/categorizer-editor.test.tsx +0 -51
  100. package/src/widgets/__tests__/definition-editor.test.tsx +0 -41
  101. package/src/widgets/__tests__/dropdown-editor.test.tsx +0 -57
  102. package/src/widgets/__tests__/explanation-editor.test.tsx +0 -59
  103. package/src/widgets/__tests__/expression-editor.test.tsx +0 -403
  104. package/src/widgets/__tests__/input-number-editor.test.tsx +0 -128
  105. package/src/widgets/__tests__/matcher-editor.test.tsx +0 -47
  106. package/src/widgets/__tests__/number-line-editor.test.tsx +0 -144
  107. package/src/widgets/__tests__/numeric-input-editor.test.tsx +0 -177
  108. package/src/widgets/__tests__/radio-editor.test.tsx +0 -118
  109. package/src/widgets/__tests__/sorter-editor.test.tsx +0 -55
  110. package/src/widgets/categorizer-editor.tsx +0 -104
  111. package/src/widgets/cs-program-editor.tsx +0 -256
  112. package/src/widgets/definition-editor.tsx +0 -77
  113. package/src/widgets/deprecated-standin-editor.tsx +0 -29
  114. package/src/widgets/dropdown-editor.tsx +0 -211
  115. package/src/widgets/example-graphie-widget-editor.tsx +0 -70
  116. package/src/widgets/example-graphie-widget.tsx +0 -172
  117. package/src/widgets/example-widget-editor.tsx +0 -62
  118. package/src/widgets/example-widget.tsx +0 -154
  119. package/src/widgets/explanation-editor.tsx +0 -92
  120. package/src/widgets/expression-editor.tsx +0 -557
  121. package/src/widgets/graded-group-editor.tsx +0 -161
  122. package/src/widgets/graded-group-set-editor.tsx +0 -104
  123. package/src/widgets/grapher-editor.tsx +0 -155
  124. package/src/widgets/group-editor.tsx +0 -83
  125. package/src/widgets/iframe-editor.tsx +0 -202
  126. package/src/widgets/image-editor.tsx +0 -367
  127. package/src/widgets/input-number-editor.tsx +0 -288
  128. package/src/widgets/interaction-editor/constraint-editor.tsx +0 -134
  129. package/src/widgets/interaction-editor/function-editor.tsx +0 -108
  130. package/src/widgets/interaction-editor/index.ts +0 -3
  131. package/src/widgets/interaction-editor/interaction-editor.tsx +0 -749
  132. package/src/widgets/interaction-editor/label-editor.tsx +0 -87
  133. package/src/widgets/interaction-editor/line-editor.tsx +0 -125
  134. package/src/widgets/interaction-editor/mathquill-input.tsx +0 -81
  135. package/src/widgets/interaction-editor/movable-line-editor.tsx +0 -121
  136. package/src/widgets/interaction-editor/movable-point-editor.tsx +0 -89
  137. package/src/widgets/interaction-editor/parametric-editor.tsx +0 -117
  138. package/src/widgets/interaction-editor/point-editor.tsx +0 -72
  139. package/src/widgets/interaction-editor/rectangle-editor.tsx +0 -96
  140. package/src/widgets/interactive-graph-editor.tsx +0 -571
  141. package/src/widgets/label-image/__stories__/answer-choices.stories.tsx +0 -82
  142. package/src/widgets/label-image/__stories__/behavior.stories.tsx +0 -31
  143. package/src/widgets/label-image/__stories__/marker.stories.tsx +0 -75
  144. package/src/widgets/label-image/__stories__/question-markers.stories.tsx +0 -107
  145. package/src/widgets/label-image/__stories__/select-image.stories.tsx +0 -59
  146. package/src/widgets/label-image/answer-choices.tsx +0 -231
  147. package/src/widgets/label-image/behavior.tsx +0 -122
  148. package/src/widgets/label-image/marker.tsx +0 -290
  149. package/src/widgets/label-image/question-markers.tsx +0 -176
  150. package/src/widgets/label-image/select-image.tsx +0 -81
  151. package/src/widgets/label-image-editor.tsx +0 -252
  152. package/src/widgets/lights-puzzle-editor.tsx +0 -278
  153. package/src/widgets/matcher-editor.tsx +0 -149
  154. package/src/widgets/matrix-editor.tsx +0 -156
  155. package/src/widgets/measurer-editor.tsx +0 -253
  156. package/src/widgets/molecule-editor.tsx +0 -64
  157. package/src/widgets/number-line-editor.tsx +0 -512
  158. package/src/widgets/numeric-input-editor.tsx +0 -536
  159. package/src/widgets/orderer-editor.tsx +0 -172
  160. package/src/widgets/passage-editor.tsx +0 -117
  161. package/src/widgets/passage-ref-editor.tsx +0 -80
  162. package/src/widgets/passage-ref-target-editor.tsx +0 -49
  163. package/src/widgets/plotter-editor.tsx +0 -542
  164. package/src/widgets/radio/editor.tsx +0 -398
  165. package/src/widgets/reaction-diagram-editor.tsx +0 -131
  166. package/src/widgets/sequence-editor.tsx +0 -205
  167. package/src/widgets/simple-markdown-tester-editor.tsx +0 -86
  168. package/src/widgets/simple-markdown-tester.tsx +0 -92
  169. package/src/widgets/simulator-editor.tsx +0 -146
  170. package/src/widgets/sorter-editor.tsx +0 -103
  171. package/src/widgets/table-editor.tsx +0 -164
  172. package/src/widgets/unit-editor.tsx +0 -299
  173. package/src/widgets/video-editor.tsx +0 -73
  174. package/tsconfig-build.json +0 -22
  175. package/tsconfig-build.tsbuildinfo +0 -1
@@ -1,855 +0,0 @@
1
- import * as React from "react";
2
-
3
- import StructuredItemDiff from "../structured-item-diff";
4
-
5
- import Wrapper from "./perseus-diff-wrapper";
6
-
7
- import("../../styles/perseus-editor.less");
8
-
9
- type StoryArgs = Record<any, any>;
10
-
11
- type Story = {
12
- title: string;
13
- decorators: ReadonlyArray<
14
- (StoryComponent: typeof React.Component) => React.ReactElement
15
- >;
16
- };
17
-
18
- export default {
19
- title: "Perseus/Editor/Diffs/Structured Item Diff",
20
- decorators: [
21
- (StoryComponent) => (
22
- <Wrapper>
23
- <StoryComponent />
24
- </Wrapper>
25
- ),
26
- ],
27
- } as Story;
28
-
29
- const tags = {
30
- a: "a tag",
31
- b: "b tag",
32
- c: "c tag",
33
- } as const;
34
-
35
- export const ContentAdded = (args: StoryArgs): React.ReactElement => {
36
- const props = {
37
- before: {
38
- _multi: {
39
- directions: {
40
- __type: "content",
41
- content: "",
42
- images: {},
43
- widgets: {},
44
- },
45
- passage: {
46
- type: "content",
47
- content: "",
48
- images: {},
49
- widgets: {},
50
- },
51
- overview: {
52
- type: "content",
53
- content: "",
54
- images: {},
55
- widgets: {},
56
- },
57
- hints: [],
58
- questions: [],
59
- },
60
- },
61
- after: {
62
- _multi: {
63
- directions: {
64
- type: "content",
65
- content: "directions",
66
- images: {},
67
- widgets: {},
68
- },
69
- passage: {
70
- type: "content",
71
- content: "passage",
72
- images: {},
73
- widgets: {},
74
- },
75
- overview: {
76
- type: "content",
77
- content: "overview",
78
- images: {},
79
- widgets: {},
80
- },
81
- hints: [
82
- {
83
- type: "hint",
84
- content: "hint 1",
85
- images: {},
86
- widgets: {},
87
- },
88
- ],
89
- questions: [
90
- {
91
- hints: [
92
- {
93
- type: "hint",
94
- content: "question hint 1",
95
- images: {},
96
- widgets: {},
97
- },
98
- ],
99
- keepInMind: {
100
- type: "content",
101
- content: "keep in mind",
102
- images: {},
103
- widgets: {},
104
- },
105
- overview: {
106
- type: "content",
107
- content: "overview",
108
- images: {},
109
- widgets: {},
110
- },
111
- question: {
112
- type: "content",
113
- content: "question",
114
- images: {},
115
- widgets: {},
116
- },
117
- tags: ["a", "b"],
118
- },
119
- ],
120
- },
121
- },
122
- shape: {
123
- type: "object",
124
- shape: {
125
- directions: {
126
- type: "content",
127
- },
128
- overview: {
129
- type: "content",
130
- },
131
- passage: {
132
- type: "content",
133
- },
134
- hints: {
135
- type: "array",
136
- elementShape: {
137
- type: "hint",
138
- },
139
- },
140
- questions: {
141
- type: "array",
142
- elementShape: {
143
- type: "object",
144
- shape: {
145
- tags: {type: "tags"},
146
- question: {
147
- type: "content",
148
- },
149
- overview: {
150
- type: "content",
151
- },
152
- keepInMind: {
153
- type: "content",
154
- },
155
- hints: {
156
- type: "array",
157
- elementShape: {
158
- type: "hint",
159
- },
160
- },
161
- },
162
- },
163
- },
164
- },
165
- },
166
- tags: {
167
- idToName: (id) => tags[id],
168
- nameToId: (name) => name[0],
169
- names: ["a tag", "b tag", "c tag"],
170
- },
171
- } as const;
172
-
173
- return <StructuredItemDiff {...props} />;
174
- };
175
-
176
- // second instance
177
- export const ContentAddedRemovedAndChanged = (
178
- args: StoryArgs,
179
- ): React.ReactElement => {
180
- const props = {
181
- before: {
182
- _multi: {
183
- directions: {
184
- __type: "content",
185
- content: "directions",
186
- images: {},
187
- widgets: {},
188
- },
189
- passage: {
190
- type: "content",
191
- content: "passage",
192
- images: {},
193
- widgets: {},
194
- },
195
- overview: {
196
- type: "content",
197
- content: "overview",
198
- images: {},
199
- widgets: {},
200
- },
201
- hints: [
202
- {
203
- type: "hint",
204
- content: "hint 1",
205
- images: {},
206
- widgets: {},
207
- },
208
- {
209
- type: "hint",
210
- content: "hint 2",
211
- images: {},
212
- widgets: {},
213
- },
214
- ],
215
- questions: [
216
- {
217
- hints: [
218
- {
219
- type: "hint",
220
- content: "question hint 1",
221
- images: {},
222
- widgets: {},
223
- },
224
- ],
225
- keepInMind: {
226
- type: "content",
227
- content: "keep in mind",
228
- images: {},
229
- widgets: {},
230
- },
231
- overview: {
232
- type: "content",
233
- content: "overview",
234
- images: {},
235
- widgets: {},
236
- },
237
- question: {
238
- type: "content",
239
- content: "question",
240
- images: {},
241
- widgets: {},
242
- },
243
- tags: ["a", "b"],
244
- },
245
- ],
246
- },
247
- },
248
- after: {
249
- _multi: {
250
- directions: {
251
- type: "content",
252
- content: "directions",
253
- images: {},
254
- widgets: {},
255
- },
256
- passage: {
257
- type: "content",
258
- content: "passage",
259
- images: {},
260
- widgets: {},
261
- },
262
- overview: {
263
- type: "content",
264
- content: "overview",
265
- images: {},
266
- widgets: {},
267
- },
268
- hints: [
269
- {
270
- type: "hint",
271
- content: "hint 1",
272
- images: {},
273
- widgets: {},
274
- },
275
- ],
276
- questions: [
277
- {
278
- hints: [],
279
- keepInMind: {
280
- type: "content",
281
- content: "keep in mind",
282
- images: {},
283
- widgets: {},
284
- },
285
- overview: {
286
- type: "content",
287
- content: "overview",
288
- images: {},
289
- widgets: {},
290
- },
291
- question: {
292
- type: "content",
293
- content: "question edited",
294
- images: {},
295
- widgets: {},
296
- },
297
- tags: ["a", "c"],
298
- },
299
- {
300
- hints: [
301
- {
302
- type: "hint",
303
- content: "question hint 1",
304
- images: {},
305
- widgets: {},
306
- },
307
- ],
308
- keepInMind: {
309
- type: "content",
310
- content: "keep in mind",
311
- images: {},
312
- widgets: {},
313
- },
314
- overview: {
315
- type: "content",
316
- content: "overview",
317
- images: {},
318
- widgets: {},
319
- },
320
- question: {
321
- type: "content",
322
- content: "question",
323
- images: {},
324
- widgets: {},
325
- },
326
- tags: ["a", "b"],
327
- },
328
- ],
329
- },
330
- },
331
- shape: {
332
- type: "object",
333
- shape: {
334
- directions: {
335
- type: "content",
336
- },
337
- overview: {
338
- type: "content",
339
- },
340
- passage: {
341
- type: "content",
342
- },
343
- hints: {
344
- type: "array",
345
- elementShape: {
346
- type: "hint",
347
- },
348
- },
349
- questions: {
350
- type: "array",
351
- elementShape: {
352
- type: "object",
353
- shape: {
354
- tags: {type: "tags"},
355
- question: {
356
- type: "content",
357
- },
358
- overview: {
359
- type: "content",
360
- },
361
- keepInMind: {
362
- type: "content",
363
- },
364
- hints: {
365
- type: "array",
366
- elementShape: {
367
- type: "hint",
368
- },
369
- },
370
- },
371
- },
372
- },
373
- },
374
- },
375
- tags: {
376
- idToName: (id) => tags[id],
377
- nameToId: (name) => name[0],
378
- names: ["a tag", "b tag", "c tag"],
379
- },
380
- } as const;
381
- return <StructuredItemDiff {...props} />;
382
- };
383
-
384
- // third instance
385
- export const MiscContentChanges = (args: StoryArgs): React.ReactElement => {
386
- const props = {
387
- before: {
388
- _multi: {
389
- directions: {
390
- __type: "content",
391
- content: "directions",
392
- images: {},
393
- widgets: {},
394
- },
395
- passage: {
396
- type: "content",
397
- content: "passage",
398
- images: {},
399
- widgets: {},
400
- },
401
- overview: {
402
- type: "content",
403
- content: "overview",
404
- images: {},
405
- widgets: {},
406
- },
407
- hints: [
408
- {
409
- type: "hint",
410
- content: "hint 1",
411
- images: {},
412
- widgets: {},
413
- },
414
- {
415
- type: "hint",
416
- content: "hint 2",
417
- images: {},
418
- widgets: {},
419
- },
420
- {
421
- type: "hint",
422
- content: "hint 3",
423
- images: {},
424
- widgets: {},
425
- },
426
- ],
427
- questions: [
428
- {
429
- hints: [
430
- {
431
- type: "hint",
432
- content: "question hint 1",
433
- images: {},
434
- widgets: {},
435
- },
436
- {
437
- type: "hint",
438
- content: "question hint 2",
439
- images: {},
440
- widgets: {},
441
- },
442
- {
443
- type: "hint",
444
- content: "question hint 3",
445
- images: {},
446
- widgets: {},
447
- },
448
- ],
449
- keepInMind: {
450
- type: "content",
451
- content: "keep in mind",
452
- images: {},
453
- widgets: {},
454
- },
455
- overview: {
456
- type: "content",
457
- content: "overview",
458
- images: {},
459
- widgets: {},
460
- },
461
- question: {
462
- type: "content",
463
- content: "question edited",
464
- images: {},
465
- widgets: {},
466
- },
467
- tags: ["a", "c"],
468
- },
469
- {
470
- hints: [
471
- {
472
- type: "hint",
473
- content: "question hint 1",
474
- images: {},
475
- widgets: {},
476
- },
477
- ],
478
- keepInMind: {
479
- type: "content",
480
- content: "keep in mind",
481
- images: {},
482
- widgets: {},
483
- },
484
- overview: {
485
- type: "content",
486
- content: "overview",
487
- images: {},
488
- widgets: {},
489
- },
490
- question: {
491
- type: "content",
492
- content: "question",
493
- images: {},
494
- widgets: {},
495
- },
496
- tags: ["a", "b"],
497
- },
498
- {
499
- hints: [
500
- {
501
- type: "hint",
502
- content: "question hint 1",
503
- images: {},
504
- widgets: {},
505
- },
506
- ],
507
- keepInMind: {
508
- type: "content",
509
- content: "keep in mind",
510
- images: {},
511
- widgets: {},
512
- },
513
- overview: {
514
- type: "content",
515
- content: "overview",
516
- images: {},
517
- widgets: {},
518
- },
519
- question: {
520
- type: "content",
521
- content: "question",
522
- images: {},
523
- widgets: {},
524
- },
525
- tags: ["a", "b"],
526
- },
527
- ],
528
- },
529
- },
530
- after: {
531
- _multi: {
532
- directions: {
533
- __type: "content",
534
- content: "directions",
535
- images: {},
536
- widgets: {},
537
- },
538
- passage: {
539
- type: "content",
540
- content: "passage",
541
- images: {},
542
- widgets: {},
543
- },
544
- overview: {
545
- type: "content",
546
- content: "overview",
547
- images: {},
548
- widgets: {},
549
- },
550
- hints: [
551
- {
552
- type: "hint",
553
- content: "hint 1",
554
- images: {},
555
- widgets: {},
556
- },
557
- {
558
- type: "hint",
559
- content: "hint 2",
560
- images: {},
561
- widgets: {},
562
- },
563
- ],
564
- questions: [
565
- {
566
- hints: [
567
- {
568
- type: "hint",
569
- content: "question hint 1 edited",
570
- images: {},
571
- widgets: {},
572
- },
573
- ],
574
- keepInMind: {
575
- type: "content",
576
- content: "keep in mind",
577
- images: {},
578
- widgets: {},
579
- },
580
- overview: {
581
- type: "content",
582
- content: "overview",
583
- images: {},
584
- widgets: {},
585
- },
586
- question: {
587
- type: "content",
588
- content: "question edited",
589
- images: {},
590
- widgets: {},
591
- },
592
- tags: ["a", "c"],
593
- },
594
- {
595
- hints: [
596
- {
597
- type: "hint",
598
- content: "question hint 1",
599
- images: {},
600
- widgets: {},
601
- },
602
- ],
603
- keepInMind: {
604
- type: "content",
605
- content: "keep in mind",
606
- images: {},
607
- widgets: {},
608
- },
609
- overview: {
610
- type: "content",
611
- content: "overview",
612
- images: {},
613
- widgets: {},
614
- },
615
- question: {
616
- type: "content",
617
- content: "question",
618
- images: {},
619
- widgets: {},
620
- },
621
- tags: ["a", "b"],
622
- },
623
- ],
624
- },
625
- },
626
- shape: {
627
- type: "object",
628
- shape: {
629
- directions: {
630
- type: "content",
631
- },
632
- overview: {
633
- type: "content",
634
- },
635
- passage: {
636
- type: "content",
637
- },
638
- hints: {
639
- type: "array",
640
- elementShape: {
641
- type: "hint",
642
- },
643
- },
644
- questions: {
645
- type: "array",
646
- elementShape: {
647
- type: "object",
648
- shape: {
649
- tags: {type: "tags"},
650
- question: {
651
- type: "content",
652
- },
653
- overview: {
654
- type: "content",
655
- },
656
- keepInMind: {
657
- type: "content",
658
- },
659
- hints: {
660
- type: "array",
661
- elementShape: {
662
- type: "hint",
663
- },
664
- },
665
- },
666
- },
667
- },
668
- },
669
- },
670
- tags: {
671
- idToName: (id) => tags[id],
672
- nameToId: (name) => name[0],
673
- names: ["a tag", "b tag", "c tag"],
674
- },
675
- } as const;
676
-
677
- return <StructuredItemDiff {...props} />;
678
- };
679
-
680
- // fourth
681
- export const ContentRemoved = (args: StoryArgs): React.ReactElement => {
682
- const props = {
683
- before: {
684
- _multi: {
685
- directions: {
686
- __type: "content",
687
- content: "directions",
688
- images: {},
689
- widgets: {},
690
- },
691
- passage: {
692
- type: "content",
693
- content: "passage",
694
- images: {},
695
- widgets: {},
696
- },
697
- overview: {
698
- type: "content",
699
- content: "overview",
700
- images: {},
701
- widgets: {},
702
- },
703
- hints: [
704
- {
705
- type: "hint",
706
- content: "hint 1",
707
- images: {},
708
- widgets: {},
709
- },
710
- {
711
- type: "hint",
712
- content: "hint 2",
713
- images: {},
714
- widgets: {},
715
- },
716
- ],
717
- questions: [
718
- {
719
- hints: [
720
- {
721
- type: "hint",
722
- content: "question hint 1 edited",
723
- images: {},
724
- widgets: {},
725
- },
726
- ],
727
- keepInMind: {
728
- type: "content",
729
- content: "keep in mind",
730
- images: {},
731
- widgets: {},
732
- },
733
- overview: {
734
- type: "content",
735
- content: "overview",
736
- images: {},
737
- widgets: {},
738
- },
739
- question: {
740
- type: "content",
741
- content: "question edited",
742
- images: {},
743
- widgets: {},
744
- },
745
- tags: ["a", "c"],
746
- },
747
- {
748
- hints: [
749
- {
750
- type: "hint",
751
- content: "question hint 1",
752
- images: {},
753
- widgets: {},
754
- },
755
- ],
756
- keepInMind: {
757
- type: "content",
758
- content: "keep in mind",
759
- images: {},
760
- widgets: {},
761
- },
762
- overview: {
763
- type: "content",
764
- content: "overview",
765
- images: {},
766
- widgets: {},
767
- },
768
- question: {
769
- type: "content",
770
- content: "question",
771
- images: {},
772
- widgets: {},
773
- },
774
- tags: ["a", "b"],
775
- },
776
- ],
777
- },
778
- },
779
- after: {
780
- _multi: {
781
- directions: {
782
- __type: "content",
783
- content: "",
784
- images: {},
785
- widgets: {},
786
- },
787
- passage: {
788
- type: "content",
789
- content: "",
790
- images: {},
791
- widgets: {},
792
- },
793
- overview: {
794
- type: "content",
795
- content: "",
796
- images: {},
797
- widgets: {},
798
- },
799
- hints: [],
800
- questions: [],
801
- },
802
- },
803
- shape: {
804
- type: "object",
805
- shape: {
806
- directions: {
807
- type: "content",
808
- },
809
- overview: {
810
- type: "content",
811
- },
812
- passage: {
813
- type: "content",
814
- },
815
- hints: {
816
- type: "array",
817
- elementShape: {
818
- type: "hint",
819
- },
820
- },
821
- questions: {
822
- type: "array",
823
- elementShape: {
824
- type: "object",
825
- shape: {
826
- tags: {type: "tags"},
827
- question: {
828
- type: "content",
829
- },
830
- overview: {
831
- type: "content",
832
- },
833
- keepInMind: {
834
- type: "content",
835
- },
836
- hints: {
837
- type: "array",
838
- elementShape: {
839
- type: "hint",
840
- },
841
- },
842
- },
843
- },
844
- },
845
- },
846
- },
847
- tags: {
848
- idToName: (id) => tags[id],
849
- nameToId: (name) => name[0],
850
- names: ["a tag", "b tag", "c tag"],
851
- },
852
- } as const;
853
-
854
- return <StructuredItemDiff {...props} />;
855
- };