@pie-element/hotspot 9.3.4-next.0 → 10.0.0-beta.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.
Files changed (103) hide show
  1. package/configure/lib/DeleteWidget.js +30 -43
  2. package/configure/lib/DeleteWidget.js.map +1 -1
  3. package/configure/lib/button.js +26 -45
  4. package/configure/lib/button.js.map +1 -1
  5. package/configure/lib/buttons/circle.js +20 -27
  6. package/configure/lib/buttons/circle.js.map +1 -1
  7. package/configure/lib/buttons/polygon.js +26 -33
  8. package/configure/lib/buttons/polygon.js.map +1 -1
  9. package/configure/lib/buttons/rectangle.js +26 -33
  10. package/configure/lib/buttons/rectangle.js.map +1 -1
  11. package/configure/lib/defaults.js +2 -3
  12. package/configure/lib/defaults.js.map +1 -1
  13. package/configure/lib/hotspot-circle.js +132 -198
  14. package/configure/lib/hotspot-circle.js.map +1 -1
  15. package/configure/lib/hotspot-container.js +250 -355
  16. package/configure/lib/hotspot-container.js.map +1 -1
  17. package/configure/lib/hotspot-drawable.js +360 -472
  18. package/configure/lib/hotspot-drawable.js.map +1 -1
  19. package/configure/lib/hotspot-palette.js +92 -139
  20. package/configure/lib/hotspot-palette.js.map +1 -1
  21. package/configure/lib/hotspot-polygon.js +212 -317
  22. package/configure/lib/hotspot-polygon.js.map +1 -1
  23. package/configure/lib/hotspot-rectangle.js +128 -192
  24. package/configure/lib/hotspot-rectangle.js.map +1 -1
  25. package/configure/lib/icons.js.map +1 -1
  26. package/configure/lib/image-konva.js +46 -86
  27. package/configure/lib/image-konva.js.map +1 -1
  28. package/configure/lib/index.js +162 -222
  29. package/configure/lib/index.js.map +1 -1
  30. package/configure/lib/root.js +301 -393
  31. package/configure/lib/root.js.map +1 -1
  32. package/configure/lib/shapes/circle.js +69 -101
  33. package/configure/lib/shapes/circle.js.map +1 -1
  34. package/configure/lib/shapes/index.js +4 -12
  35. package/configure/lib/shapes/index.js.map +1 -1
  36. package/configure/lib/shapes/polygon.js +64 -96
  37. package/configure/lib/shapes/polygon.js.map +1 -1
  38. package/configure/lib/shapes/rectagle.js +69 -101
  39. package/configure/lib/shapes/rectagle.js.map +1 -1
  40. package/configure/lib/shapes/utils.js +2 -8
  41. package/configure/lib/shapes/utils.js.map +1 -1
  42. package/configure/lib/upload-control.js +25 -52
  43. package/configure/lib/upload-control.js.map +1 -1
  44. package/configure/lib/utils.js +84 -137
  45. package/configure/lib/utils.js.map +1 -1
  46. package/configure/package.json +11 -10
  47. package/configure/src/__tests__/hotspot-container.test.js +50 -19
  48. package/configure/src/__tests__/hotspot-drawable.test.js +55 -34
  49. package/configure/src/__tests__/index.test.js +167 -5
  50. package/configure/src/__tests__/root.test.js +89 -63
  51. package/configure/src/button.jsx +12 -20
  52. package/configure/src/hotspot-circle.jsx +5 -18
  53. package/configure/src/hotspot-container.jsx +82 -98
  54. package/configure/src/hotspot-drawable.jsx +43 -45
  55. package/configure/src/hotspot-palette.jsx +45 -37
  56. package/configure/src/hotspot-polygon.jsx +4 -20
  57. package/configure/src/hotspot-rectangle.jsx +4 -17
  58. package/configure/src/index.js +12 -2
  59. package/configure/src/root.jsx +85 -79
  60. package/configure/src/upload-control.jsx +6 -16
  61. package/controller/lib/defaults.js +2 -3
  62. package/controller/lib/defaults.js.map +1 -1
  63. package/controller/lib/index.js +151 -205
  64. package/controller/lib/index.js.map +1 -1
  65. package/controller/lib/utils.js +14 -34
  66. package/controller/lib/utils.js.map +1 -1
  67. package/controller/package.json +2 -2
  68. package/lib/hotspot/circle.js +110 -169
  69. package/lib/hotspot/circle.js.map +1 -1
  70. package/lib/hotspot/container.js +174 -260
  71. package/lib/hotspot/container.js.map +1 -1
  72. package/lib/hotspot/icons.js.map +1 -1
  73. package/lib/hotspot/image-konva-tooltip.js +65 -112
  74. package/lib/hotspot/image-konva-tooltip.js.map +1 -1
  75. package/lib/hotspot/index.js +135 -198
  76. package/lib/hotspot/index.js.map +1 -1
  77. package/lib/hotspot/polygon.js +150 -214
  78. package/lib/hotspot/polygon.js.map +1 -1
  79. package/lib/hotspot/rectangle.js +128 -185
  80. package/lib/hotspot/rectangle.js.map +1 -1
  81. package/lib/index.js +187 -256
  82. package/lib/index.js.map +1 -1
  83. package/lib/session-updater.js +12 -18
  84. package/lib/session-updater.js.map +1 -1
  85. package/package.json +14 -11
  86. package/src/__tests__/container.test.jsx +27 -175
  87. package/src/__tests__/index.test.js +70 -30
  88. package/src/hotspot/circle.jsx +2 -13
  89. package/src/hotspot/container.jsx +35 -50
  90. package/src/hotspot/index.jsx +16 -28
  91. package/src/hotspot/polygon.jsx +4 -13
  92. package/src/hotspot/rectangle.jsx +5 -15
  93. package/src/index.js +21 -12
  94. package/configure/src/__tests__/DeleteWidget.test.js +0 -64
  95. package/configure/src/__tests__/__snapshots__/hotspot-container.test.js.snap +0 -192
  96. package/configure/src/__tests__/__snapshots__/hotspot-drawable.test.js.snap +0 -562
  97. package/configure/src/__tests__/__snapshots__/root.test.js.snap +0 -469
  98. package/src/__tests__/__snapshots__/container.test.jsx.snap +0 -264
  99. package/src/__tests__/__snapshots__/index.test.js.snap +0 -81
  100. package/src/__tests__/__snapshots__/polygon.test.jsx.snap +0 -192
  101. package/src/__tests__/__snapshots__/rectangle.test.jsx.snap +0 -127
  102. package/src/__tests__/polygon.test.jsx +0 -230
  103. package/src/__tests__/rectangle.test.jsx +0 -232
@@ -1,469 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`Root render renders 1`] = `
4
- <ConfigLayout
5
- dimensions={Object {}}
6
- hideSettings={false}
7
- settings={
8
- <Panel
9
- configuration={
10
- Object {
11
- "baseInputConfiguration": Object {
12
- "audio": Object {
13
- "disabled": false,
14
- },
15
- "image": Object {
16
- "disabled": false,
17
- },
18
- "separateParagraphs": Object {
19
- "disabled": true,
20
- },
21
- "showParagraphs": Object {
22
- "disabled": false,
23
- },
24
- "textAlign": Object {
25
- "disabled": true,
26
- },
27
- "video": Object {
28
- "disabled": false,
29
- },
30
- },
31
- "language": Object {
32
- "enabled": false,
33
- "label": "Specify Language",
34
- "settings": false,
35
- },
36
- "languageChoices": Object {
37
- "label": "Language Choices",
38
- "options": Array [],
39
- },
40
- "mathMlOptions": Object {
41
- "mmlEditing": false,
42
- "mmlOutput": false,
43
- },
44
- "maxImageHeight": Object {
45
- "prompt": 300,
46
- "rationale": 300,
47
- "teacherInstructions": 300,
48
- },
49
- "maxImageWidth": Object {
50
- "prompt": 300,
51
- "rationale": 300,
52
- "teacherInstructions": 300,
53
- },
54
- "minShapes": 2,
55
- "multipleCorrect": Object {
56
- "label": "Multiple Correct Responses",
57
- "settings": true,
58
- },
59
- "partialScoring": Object {
60
- "label": "Allow Partial Scoring",
61
- "settings": false,
62
- },
63
- "preserveAspectRatio": Object {
64
- "enabled": true,
65
- "label": "Preserve aspect ratio",
66
- "settings": false,
67
- },
68
- "prompt": Object {
69
- "inputConfiguration": Object {
70
- "audio": Object {
71
- "disabled": false,
72
- },
73
- "image": Object {
74
- "disabled": false,
75
- },
76
- "video": Object {
77
- "disabled": false,
78
- },
79
- },
80
- "label": "Prompt",
81
- "required": false,
82
- "settings": true,
83
- },
84
- "rationale": Object {
85
- "inputConfiguration": Object {
86
- "audio": Object {
87
- "disabled": false,
88
- },
89
- "image": Object {
90
- "disabled": false,
91
- },
92
- "video": Object {
93
- "disabled": false,
94
- },
95
- },
96
- "label": "Rationale",
97
- "required": false,
98
- "settings": true,
99
- },
100
- "settingsPanelDisabled": false,
101
- "spellCheck": Object {
102
- "enabled": true,
103
- "label": "Spellcheck",
104
- "settings": false,
105
- },
106
- "teacherInstructions": Object {
107
- "inputConfiguration": Object {
108
- "audio": Object {
109
- "disabled": false,
110
- },
111
- "image": Object {
112
- "disabled": false,
113
- },
114
- "video": Object {
115
- "disabled": false,
116
- },
117
- },
118
- "label": "Teacher Instructions",
119
- "required": false,
120
- "settings": true,
121
- },
122
- "withRubric": Object {
123
- "label": "Add Rubric",
124
- "settings": false,
125
- },
126
- }
127
- }
128
- groups={
129
- Object {
130
- "Properties": Object {
131
- "rationaleEnabled": undefined,
132
- "rubricEnabled": false,
133
- "spellCheckEnabled": false,
134
- "teacherInstructionsEnabled": undefined,
135
- },
136
- "Settings": Object {
137
- "language": false,
138
- "language.enabled": false,
139
- "multipleCorrect": undefined,
140
- "partialScoring": false,
141
- "promptEnabled": undefined,
142
- },
143
- }
144
- }
145
- model={
146
- Object {
147
- "configure": Object {},
148
- "dimensions": Object {
149
- "height": 300,
150
- "width": 400,
151
- },
152
- "hotspotColor": "rgba(137, 183, 244, 0.65)",
153
- "hotspotList": Array [
154
- "rgba(137, 183, 244, 0.65)",
155
- "rgba(217, 30, 24, 0.65)",
156
- "rgba(254, 241, 96, 0.65)",
157
- ],
158
- "imageUrl": "https://cdn.fluence.net/image/0240eb1455ce4c4bb6180232347b6aef_W",
159
- "multipleCorrect": true,
160
- "outlineColor": "blue",
161
- "outlineList": Array [
162
- "blue",
163
- "red",
164
- "yellow",
165
- ],
166
- "partialScoring": false,
167
- "prompt": "This is the question prompt",
168
- "shapes": Object {
169
- "circles": Array [
170
- Object {
171
- "correct": false,
172
- "id": "6",
173
- "radius": 70,
174
- "x": 100,
175
- "y": 100,
176
- },
177
- ],
178
- "polygons": Array [
179
- Object {
180
- "correct": true,
181
- "id": "3",
182
- "points": Array [
183
- Object {
184
- "x": 1,
185
- "y": 148,
186
- },
187
- Object {
188
- "x": 1,
189
- "y": 288,
190
- },
191
- Object {
192
- "x": 129,
193
- "y": 288,
194
- },
195
- Object {
196
- "x": 129,
197
- "y": 148,
198
- },
199
- ],
200
- },
201
- Object {
202
- "correct": false,
203
- "id": "4",
204
- "points": Array [
205
- Object {
206
- "x": 141,
207
- "y": 151,
208
- },
209
- Object {
210
- "x": 141,
211
- "y": 289,
212
- },
213
- Object {
214
- "x": 269,
215
- "y": 289,
216
- },
217
- Object {
218
- "x": 269,
219
- "y": 151,
220
- },
221
- ],
222
- },
223
- Object {
224
- "correct": false,
225
- "id": "5",
226
- "points": Array [
227
- Object {
228
- "x": 279,
229
- "y": 149.99999999999997,
230
- },
231
- Object {
232
- "x": 279,
233
- "y": 289,
234
- },
235
- Object {
236
- "x": 407,
237
- "y": 289,
238
- },
239
- Object {
240
- "x": 407,
241
- "y": 149.99999999999997,
242
- },
243
- ],
244
- },
245
- ],
246
- "rectangles": Array [
247
- Object {
248
- "correct": true,
249
- "height": 140,
250
- "id": "0",
251
- "width": 130,
252
- "x": 1,
253
- "y": 1,
254
- },
255
- Object {
256
- "height": 140,
257
- "id": "1",
258
- "width": 130,
259
- "x": 140,
260
- "y": 1,
261
- },
262
- Object {
263
- "height": 140,
264
- "id": "2",
265
- "width": 130,
266
- "x": 280,
267
- "y": 1,
268
- },
269
- ],
270
- },
271
- }
272
- }
273
- />
274
- }
275
- >
276
- <div>
277
- <WithStyles(Typography)
278
- variant="subheading"
279
- >
280
- Define Hotspot
281
- </WithStyles(Typography)>
282
- <WithStyles(Tooltip)
283
- classes={
284
- Object {
285
- "tooltip": undefined,
286
- }
287
- }
288
- disableFocusListener={true}
289
- disableTouchListener={true}
290
- placement="left"
291
- title="Validation requirements:
292
- There should be at least 2 shapes defined.
293
- There should be at least 1 shape selected."
294
- >
295
- <pure(InfoIcon)
296
- color="primary"
297
- fontSize="small"
298
- style={
299
- Object {
300
- "float": "right",
301
- }
302
- }
303
- />
304
- </WithStyles(Tooltip)>
305
- </div>
306
- <WithStyles(Palette)
307
- hotspotColor="rgba(137, 183, 244, 0.65)"
308
- hotspotList={
309
- Array [
310
- "rgba(137, 183, 244, 0.65)",
311
- "rgba(217, 30, 24, 0.65)",
312
- "rgba(254, 241, 96, 0.65)",
313
- ]
314
- }
315
- onHotspotColorChange={[Function]}
316
- onOutlineColorChange={[Function]}
317
- outlineColor="blue"
318
- outlineList={
319
- Array [
320
- "blue",
321
- "red",
322
- "yellow",
323
- ]
324
- }
325
- />
326
- <WithStyles(Container)
327
- dimensions={
328
- Object {
329
- "height": 300,
330
- "width": 400,
331
- }
332
- }
333
- hasErrors={false}
334
- hotspotColor="rgba(137, 183, 244, 0.65)"
335
- imageUrl="https://cdn.fluence.net/image/0240eb1455ce4c4bb6180232347b6aef_W"
336
- multipleCorrect={true}
337
- outlineColor="blue"
338
- preserveAspectRatioEnabled={true}
339
- shapes={
340
- Object {
341
- "circles": Array [
342
- Object {
343
- "correct": false,
344
- "id": "6",
345
- "radius": 70,
346
- "x": 100,
347
- "y": 100,
348
- },
349
- ],
350
- "polygons": Array [
351
- Object {
352
- "correct": true,
353
- "id": "3",
354
- "points": Array [
355
- Object {
356
- "x": 1,
357
- "y": 148,
358
- },
359
- Object {
360
- "x": 1,
361
- "y": 288,
362
- },
363
- Object {
364
- "x": 129,
365
- "y": 288,
366
- },
367
- Object {
368
- "x": 129,
369
- "y": 148,
370
- },
371
- ],
372
- },
373
- Object {
374
- "correct": false,
375
- "id": "4",
376
- "points": Array [
377
- Object {
378
- "x": 141,
379
- "y": 151,
380
- },
381
- Object {
382
- "x": 141,
383
- "y": 289,
384
- },
385
- Object {
386
- "x": 269,
387
- "y": 289,
388
- },
389
- Object {
390
- "x": 269,
391
- "y": 151,
392
- },
393
- ],
394
- },
395
- Object {
396
- "correct": false,
397
- "id": "5",
398
- "points": Array [
399
- Object {
400
- "x": 279,
401
- "y": 149.99999999999997,
402
- },
403
- Object {
404
- "x": 279,
405
- "y": 289,
406
- },
407
- Object {
408
- "x": 407,
409
- "y": 289,
410
- },
411
- Object {
412
- "x": 407,
413
- "y": 149.99999999999997,
414
- },
415
- ],
416
- },
417
- ],
418
- "rectangles": Array [
419
- Object {
420
- "correct": true,
421
- "height": 140,
422
- "id": "0",
423
- "width": 130,
424
- "x": 1,
425
- "y": 1,
426
- },
427
- Object {
428
- "height": 140,
429
- "id": "1",
430
- "width": 130,
431
- "x": 140,
432
- "y": 1,
433
- },
434
- Object {
435
- "height": 140,
436
- "id": "2",
437
- "width": 130,
438
- "x": 280,
439
- "y": 1,
440
- },
441
- ],
442
- }
443
- }
444
- />
445
- <WithStyles(Typography)
446
- variant="subheading"
447
- >
448
- Image Dimensions
449
- </WithStyles(Typography)>
450
- <div>
451
- <Component
452
- key="hotspot-manual-width"
453
- label="Width"
454
- min={0}
455
- onChange={[Function]}
456
- showErrorWhenOutsideRange={true}
457
- value={400}
458
- />
459
- <Component
460
- key="hotspot-manual-height"
461
- label="Height"
462
- min={0}
463
- onChange={[Function]}
464
- showErrorWhenOutsideRange={true}
465
- value={300}
466
- />
467
- </div>
468
- </ConfigLayout>
469
- `;