@khanacademy/perseus-editor 0.0.1 → 0.1.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/.babelrc.js +1 -1
- package/CHANGELOG.md +12 -0
- package/dist/es/index.js +10 -1
- package/dist/es/index.js.map +1 -1
- package/dist/index.js +10 -1
- package/dist/index.js.map +1 -1
- package/dist/strings.js +6 -1
- package/package.json +16 -4
- package/src/README.md +7 -0
- package/src/__stories__/editor.stories.js +33 -0
- package/src/__stories__/section-control-button.stories.jsx +27 -0
- package/src/__testdata__/input-number_testdata.js +28 -0
- package/src/__tests__/editor_test.jsx +123 -0
- package/src/__tests__/i18n_test.jsx +585 -0
- package/src/__tests__/traversal_test.jsx +378 -0
- package/src/all-editors.js +85 -0
- package/src/all-editors_test.js +17 -0
- package/src/all-widgets.js +10 -0
- package/src/article-editor.jsx +437 -0
- package/src/components/__stories__/blur-input.stories.jsx +24 -0
- package/src/components/blur-input.jsx +62 -0
- package/src/components/checkbox.jsx +194 -0
- package/src/components/device-framer.jsx +91 -0
- package/src/components/drag-target.jsx +88 -0
- package/src/components/dropdown-option.jsx +318 -0
- package/src/components/form-wrapped-text-field.jsx +248 -0
- package/src/components/graph-settings.jsx +631 -0
- package/src/components/hover-behavior.jsx +178 -0
- package/src/components/json-editor.jsx +118 -0
- package/src/components/link.jsx +173 -0
- package/src/components/simple-button.jsx +86 -0
- package/src/components/sortable.jsx +186 -0
- package/src/components/util.js +39 -0
- package/src/components/viewport-resizer.jsx +73 -0
- package/src/diffs/__stories__/perseus-diff-wrapper.jsx +8 -0
- package/src/diffs/__stories__/structured-item-diff.stories.jsx +855 -0
- package/src/diffs/__stories__/tags-diff.stories.jsx +38 -0
- package/src/diffs/__stories__/text-diff.stories.jsx +37 -0
- package/src/diffs/__tests__/split-diff_test.js +34 -0
- package/src/diffs/__tests__/string-array-diff_test.js +74 -0
- package/src/diffs/__tests__/structured-item-diff_test.js +432 -0
- package/src/diffs/__tests__/widget-diff-performer_test.js +44 -0
- package/src/diffs/article-diff.jsx +70 -0
- package/src/diffs/item-diff.jsx +77 -0
- package/src/diffs/renderer-diff.jsx +143 -0
- package/src/diffs/split-diff.jsx +30 -0
- package/src/diffs/string-array-diff.jsx +74 -0
- package/src/diffs/structured-item-diff.jsx +269 -0
- package/src/diffs/tags-diff.jsx +50 -0
- package/src/diffs/text-diff.jsx +193 -0
- package/src/diffs/widget-diff-performer.jsx +74 -0
- package/src/diffs/widget-diff.jsx +291 -0
- package/src/editor-page.jsx +351 -0
- package/src/editor.jsx +1364 -0
- package/src/hint-editor.jsx +447 -0
- package/src/i18n.jsx +139 -0
- package/src/iframe-content-renderer.jsx +201 -0
- package/src/index.js +27 -8
- package/src/item-editor.jsx +159 -0
- package/src/item-extras-editor.jsx +150 -0
- package/src/katex-error-view.jsx +87 -0
- package/src/multirenderer-editor.jsx +1073 -0
- package/src/section-control-button.jsx +53 -0
- package/src/stateful-article-editor.jsx +176 -0
- package/src/stateful-editor-page.jsx +90 -0
- package/src/styles/perseus-editor.less +1339 -0
- package/src/testing-widgets.js +12 -0
- package/src/util/register-all-widgets-and-editors-for-testing.js +15 -0
- package/src/util/register-all-widgets-and-editors-for-testing_test.js +18 -0
- package/src/widgets/__stories__/label-image-editor.stories.jsx +97 -0
- package/src/widgets/categorizer-editor.jsx +103 -0
- package/src/widgets/cs-program-editor.jsx +258 -0
- package/src/widgets/definition-editor.jsx +76 -0
- package/src/widgets/dropdown-editor.jsx +201 -0
- package/src/widgets/example-graphie-widget-editor.jsx +70 -0
- package/src/widgets/example-graphie-widget.jsx +175 -0
- package/src/widgets/example-widget-editor.jsx +60 -0
- package/src/widgets/example-widget.jsx +153 -0
- package/src/widgets/explanation-editor.jsx +89 -0
- package/src/widgets/expression-editor.jsx +559 -0
- package/src/widgets/graded-group-editor.jsx +162 -0
- package/src/widgets/graded-group-set-editor.jsx +101 -0
- package/src/widgets/grapher-editor.jsx +154 -0
- package/src/widgets/group-editor.jsx +83 -0
- package/src/widgets/iframe-editor.jsx +200 -0
- package/src/widgets/image-editor.jsx +326 -0
- package/src/widgets/input-number-editor.jsx +269 -0
- package/src/widgets/interaction/constraint-editor.jsx +147 -0
- package/src/widgets/interaction-editor.jsx +1388 -0
- package/src/widgets/interactive-graph-editor.jsx +320 -0
- package/src/widgets/label-image/__stories__/answer-choices.stories.jsx +81 -0
- package/src/widgets/label-image/__stories__/behavior.stories.jsx +32 -0
- package/src/widgets/label-image/__stories__/marker.stories.jsx +76 -0
- package/src/widgets/label-image/__stories__/question-markers.stories.jsx +106 -0
- package/src/widgets/label-image/__stories__/select-image.stories.jsx +60 -0
- package/src/widgets/label-image/answer-choices.jsx +231 -0
- package/src/widgets/label-image/behavior.jsx +92 -0
- package/src/widgets/label-image/marker.jsx +292 -0
- package/src/widgets/label-image/question-markers.jsx +181 -0
- package/src/widgets/label-image/select-image.jsx +86 -0
- package/src/widgets/label-image-editor.jsx +256 -0
- package/src/widgets/lights-puzzle-editor.jsx +267 -0
- package/src/widgets/matcher-editor.jsx +147 -0
- package/src/widgets/matrix-editor.jsx +155 -0
- package/src/widgets/measurer-editor.jsx +245 -0
- package/src/widgets/molecule-editor.jsx +63 -0
- package/src/widgets/number-line-editor.jsx +498 -0
- package/src/widgets/numeric-input-editor.jsx +554 -0
- package/src/widgets/orderer-editor.jsx +166 -0
- package/src/widgets/passage-editor.jsx +115 -0
- package/src/widgets/passage-ref-editor.jsx +77 -0
- package/src/widgets/passage-ref-target-editor.jsx +47 -0
- package/src/widgets/plotter-editor.jsx +537 -0
- package/src/widgets/radio/editor.jsx +399 -0
- package/src/widgets/reaction-diagram-editor.jsx +126 -0
- package/src/widgets/sequence-editor.jsx +205 -0
- package/src/widgets/simple-markdown-tester-editor.jsx +84 -0
- package/src/widgets/simple-markdown-tester.jsx +91 -0
- package/src/widgets/simulator-editor.jsx +144 -0
- package/src/widgets/sorter-editor.jsx +100 -0
- package/src/widgets/table-editor.jsx +164 -0
- package/src/widgets/transformer-editor.jsx +1006 -0
- package/src/widgets/unit-editor.jsx +293 -0
- package/src/widgets/video-editor.jsx +74 -0
- package/src/__tests__/index.test.js +0 -15
|
@@ -0,0 +1,855 @@
|
|
|
1
|
+
// @flow
|
|
2
|
+
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
|
|
5
|
+
import StructuredItemDiff from "../structured-item-diff.jsx";
|
|
6
|
+
|
|
7
|
+
import Wrapper from "./perseus-diff-wrapper.jsx";
|
|
8
|
+
|
|
9
|
+
import("../../styles/perseus-editor.less");
|
|
10
|
+
|
|
11
|
+
type StoryArgs = {||};
|
|
12
|
+
|
|
13
|
+
type Story = {|
|
|
14
|
+
title: string,
|
|
15
|
+
decorators: $ReadOnlyArray<
|
|
16
|
+
(StoryComponent: typeof React.Component) => React.Node,
|
|
17
|
+
>,
|
|
18
|
+
|};
|
|
19
|
+
|
|
20
|
+
export default ({
|
|
21
|
+
title: "Perseus/Editor/Diffs/Structured Item Diff",
|
|
22
|
+
decorators: [
|
|
23
|
+
(StoryComponent) => (
|
|
24
|
+
<Wrapper>
|
|
25
|
+
<StoryComponent />
|
|
26
|
+
</Wrapper>
|
|
27
|
+
),
|
|
28
|
+
],
|
|
29
|
+
}: Story);
|
|
30
|
+
|
|
31
|
+
const tags = {
|
|
32
|
+
a: "a tag",
|
|
33
|
+
b: "b tag",
|
|
34
|
+
c: "c tag",
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export const ContentAdded = (args: StoryArgs): React.Node => {
|
|
38
|
+
const props = {
|
|
39
|
+
before: {
|
|
40
|
+
_multi: {
|
|
41
|
+
directions: {
|
|
42
|
+
__type: "content",
|
|
43
|
+
content: "",
|
|
44
|
+
images: {},
|
|
45
|
+
widgets: {},
|
|
46
|
+
},
|
|
47
|
+
passage: {
|
|
48
|
+
type: "content",
|
|
49
|
+
content: "",
|
|
50
|
+
images: {},
|
|
51
|
+
widgets: {},
|
|
52
|
+
},
|
|
53
|
+
overview: {
|
|
54
|
+
type: "content",
|
|
55
|
+
content: "",
|
|
56
|
+
images: {},
|
|
57
|
+
widgets: {},
|
|
58
|
+
},
|
|
59
|
+
hints: [],
|
|
60
|
+
questions: [],
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
after: {
|
|
64
|
+
_multi: {
|
|
65
|
+
directions: {
|
|
66
|
+
type: "content",
|
|
67
|
+
content: "directions",
|
|
68
|
+
images: {},
|
|
69
|
+
widgets: {},
|
|
70
|
+
},
|
|
71
|
+
passage: {
|
|
72
|
+
type: "content",
|
|
73
|
+
content: "passage",
|
|
74
|
+
images: {},
|
|
75
|
+
widgets: {},
|
|
76
|
+
},
|
|
77
|
+
overview: {
|
|
78
|
+
type: "content",
|
|
79
|
+
content: "overview",
|
|
80
|
+
images: {},
|
|
81
|
+
widgets: {},
|
|
82
|
+
},
|
|
83
|
+
hints: [
|
|
84
|
+
{
|
|
85
|
+
type: "hint",
|
|
86
|
+
content: "hint 1",
|
|
87
|
+
images: {},
|
|
88
|
+
widgets: {},
|
|
89
|
+
},
|
|
90
|
+
],
|
|
91
|
+
questions: [
|
|
92
|
+
{
|
|
93
|
+
hints: [
|
|
94
|
+
{
|
|
95
|
+
type: "hint",
|
|
96
|
+
content: "question hint 1",
|
|
97
|
+
images: {},
|
|
98
|
+
widgets: {},
|
|
99
|
+
},
|
|
100
|
+
],
|
|
101
|
+
keepInMind: {
|
|
102
|
+
type: "content",
|
|
103
|
+
content: "keep in mind",
|
|
104
|
+
images: {},
|
|
105
|
+
widgets: {},
|
|
106
|
+
},
|
|
107
|
+
overview: {
|
|
108
|
+
type: "content",
|
|
109
|
+
content: "overview",
|
|
110
|
+
images: {},
|
|
111
|
+
widgets: {},
|
|
112
|
+
},
|
|
113
|
+
question: {
|
|
114
|
+
type: "content",
|
|
115
|
+
content: "question",
|
|
116
|
+
images: {},
|
|
117
|
+
widgets: {},
|
|
118
|
+
},
|
|
119
|
+
tags: ["a", "b"],
|
|
120
|
+
},
|
|
121
|
+
],
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
shape: {
|
|
125
|
+
type: "object",
|
|
126
|
+
shape: {
|
|
127
|
+
directions: {
|
|
128
|
+
type: "content",
|
|
129
|
+
},
|
|
130
|
+
overview: {
|
|
131
|
+
type: "content",
|
|
132
|
+
},
|
|
133
|
+
passage: {
|
|
134
|
+
type: "content",
|
|
135
|
+
},
|
|
136
|
+
hints: {
|
|
137
|
+
type: "array",
|
|
138
|
+
elementShape: {
|
|
139
|
+
type: "hint",
|
|
140
|
+
},
|
|
141
|
+
},
|
|
142
|
+
questions: {
|
|
143
|
+
type: "array",
|
|
144
|
+
elementShape: {
|
|
145
|
+
type: "object",
|
|
146
|
+
shape: {
|
|
147
|
+
tags: {type: "tags"},
|
|
148
|
+
question: {
|
|
149
|
+
type: "content",
|
|
150
|
+
},
|
|
151
|
+
overview: {
|
|
152
|
+
type: "content",
|
|
153
|
+
},
|
|
154
|
+
keepInMind: {
|
|
155
|
+
type: "content",
|
|
156
|
+
},
|
|
157
|
+
hints: {
|
|
158
|
+
type: "array",
|
|
159
|
+
elementShape: {
|
|
160
|
+
type: "hint",
|
|
161
|
+
},
|
|
162
|
+
},
|
|
163
|
+
},
|
|
164
|
+
},
|
|
165
|
+
},
|
|
166
|
+
},
|
|
167
|
+
},
|
|
168
|
+
tags: {
|
|
169
|
+
idToName: (id) => tags[id],
|
|
170
|
+
nameToId: (name) => name[0],
|
|
171
|
+
names: ["a tag", "b tag", "c tag"],
|
|
172
|
+
},
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
return <StructuredItemDiff {...props} />;
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
// second instance
|
|
179
|
+
export const ContentAddedRemovedAndChanged = (args: StoryArgs): React.Node => {
|
|
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
|
+
};
|
|
381
|
+
return <StructuredItemDiff {...props} />;
|
|
382
|
+
};
|
|
383
|
+
|
|
384
|
+
// third instance
|
|
385
|
+
export const MiscContentChanges = (args: StoryArgs): React.Node => {
|
|
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
|
+
};
|
|
676
|
+
|
|
677
|
+
return <StructuredItemDiff {...props} />;
|
|
678
|
+
};
|
|
679
|
+
|
|
680
|
+
// fourth
|
|
681
|
+
export const ContentRemoved = (args: StoryArgs): React.Node => {
|
|
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
|
+
};
|
|
853
|
+
|
|
854
|
+
return <StructuredItemDiff {...props} />;
|
|
855
|
+
};
|