@pie-element/hotspot 9.3.4-next.3 → 10.0.0-beta.1

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 (106) hide show
  1. package/CHANGELOG.md +0 -11
  2. package/configure/CHANGELOG.md +0 -11
  3. package/configure/lib/DeleteWidget.js +30 -43
  4. package/configure/lib/DeleteWidget.js.map +1 -1
  5. package/configure/lib/button.js +26 -45
  6. package/configure/lib/button.js.map +1 -1
  7. package/configure/lib/buttons/circle.js +20 -27
  8. package/configure/lib/buttons/circle.js.map +1 -1
  9. package/configure/lib/buttons/polygon.js +26 -33
  10. package/configure/lib/buttons/polygon.js.map +1 -1
  11. package/configure/lib/buttons/rectangle.js +26 -33
  12. package/configure/lib/buttons/rectangle.js.map +1 -1
  13. package/configure/lib/defaults.js +2 -3
  14. package/configure/lib/defaults.js.map +1 -1
  15. package/configure/lib/hotspot-circle.js +132 -198
  16. package/configure/lib/hotspot-circle.js.map +1 -1
  17. package/configure/lib/hotspot-container.js +250 -355
  18. package/configure/lib/hotspot-container.js.map +1 -1
  19. package/configure/lib/hotspot-drawable.js +360 -472
  20. package/configure/lib/hotspot-drawable.js.map +1 -1
  21. package/configure/lib/hotspot-palette.js +92 -139
  22. package/configure/lib/hotspot-palette.js.map +1 -1
  23. package/configure/lib/hotspot-polygon.js +212 -317
  24. package/configure/lib/hotspot-polygon.js.map +1 -1
  25. package/configure/lib/hotspot-rectangle.js +128 -192
  26. package/configure/lib/hotspot-rectangle.js.map +1 -1
  27. package/configure/lib/icons.js.map +1 -1
  28. package/configure/lib/image-konva.js +46 -86
  29. package/configure/lib/image-konva.js.map +1 -1
  30. package/configure/lib/index.js +162 -222
  31. package/configure/lib/index.js.map +1 -1
  32. package/configure/lib/root.js +302 -394
  33. package/configure/lib/root.js.map +1 -1
  34. package/configure/lib/shapes/circle.js +69 -101
  35. package/configure/lib/shapes/circle.js.map +1 -1
  36. package/configure/lib/shapes/index.js +4 -12
  37. package/configure/lib/shapes/index.js.map +1 -1
  38. package/configure/lib/shapes/polygon.js +64 -96
  39. package/configure/lib/shapes/polygon.js.map +1 -1
  40. package/configure/lib/shapes/rectagle.js +69 -101
  41. package/configure/lib/shapes/rectagle.js.map +1 -1
  42. package/configure/lib/shapes/utils.js +2 -8
  43. package/configure/lib/shapes/utils.js.map +1 -1
  44. package/configure/lib/upload-control.js +25 -52
  45. package/configure/lib/upload-control.js.map +1 -1
  46. package/configure/lib/utils.js +84 -137
  47. package/configure/lib/utils.js.map +1 -1
  48. package/configure/package.json +11 -10
  49. package/configure/src/__tests__/hotspot-container.test.js +50 -19
  50. package/configure/src/__tests__/hotspot-drawable.test.js +55 -34
  51. package/configure/src/__tests__/index.test.js +167 -5
  52. package/configure/src/__tests__/root.test.js +89 -63
  53. package/configure/src/button.jsx +12 -20
  54. package/configure/src/hotspot-circle.jsx +5 -18
  55. package/configure/src/hotspot-container.jsx +82 -98
  56. package/configure/src/hotspot-drawable.jsx +43 -45
  57. package/configure/src/hotspot-palette.jsx +45 -37
  58. package/configure/src/hotspot-polygon.jsx +4 -20
  59. package/configure/src/hotspot-rectangle.jsx +4 -17
  60. package/configure/src/index.js +12 -2
  61. package/configure/src/root.jsx +86 -80
  62. package/configure/src/upload-control.jsx +6 -16
  63. package/controller/CHANGELOG.md +0 -11
  64. package/controller/lib/defaults.js +2 -3
  65. package/controller/lib/defaults.js.map +1 -1
  66. package/controller/lib/index.js +151 -205
  67. package/controller/lib/index.js.map +1 -1
  68. package/controller/lib/utils.js +14 -34
  69. package/controller/lib/utils.js.map +1 -1
  70. package/controller/package.json +2 -2
  71. package/lib/hotspot/circle.js +110 -169
  72. package/lib/hotspot/circle.js.map +1 -1
  73. package/lib/hotspot/container.js +174 -260
  74. package/lib/hotspot/container.js.map +1 -1
  75. package/lib/hotspot/icons.js.map +1 -1
  76. package/lib/hotspot/image-konva-tooltip.js +65 -112
  77. package/lib/hotspot/image-konva-tooltip.js.map +1 -1
  78. package/lib/hotspot/index.js +135 -198
  79. package/lib/hotspot/index.js.map +1 -1
  80. package/lib/hotspot/polygon.js +150 -214
  81. package/lib/hotspot/polygon.js.map +1 -1
  82. package/lib/hotspot/rectangle.js +128 -185
  83. package/lib/hotspot/rectangle.js.map +1 -1
  84. package/lib/index.js +187 -256
  85. package/lib/index.js.map +1 -1
  86. package/lib/session-updater.js +12 -18
  87. package/lib/session-updater.js.map +1 -1
  88. package/package.json +14 -11
  89. package/src/__tests__/container.test.jsx +27 -175
  90. package/src/__tests__/index.test.js +70 -30
  91. package/src/hotspot/circle.jsx +2 -13
  92. package/src/hotspot/container.jsx +35 -50
  93. package/src/hotspot/index.jsx +16 -28
  94. package/src/hotspot/polygon.jsx +4 -13
  95. package/src/hotspot/rectangle.jsx +5 -15
  96. package/src/index.js +21 -12
  97. package/configure/src/__tests__/DeleteWidget.test.js +0 -64
  98. package/configure/src/__tests__/__snapshots__/hotspot-container.test.js.snap +0 -192
  99. package/configure/src/__tests__/__snapshots__/hotspot-drawable.test.js.snap +0 -562
  100. package/configure/src/__tests__/__snapshots__/root.test.js.snap +0 -469
  101. package/src/__tests__/__snapshots__/container.test.jsx.snap +0 -264
  102. package/src/__tests__/__snapshots__/index.test.js.snap +0 -81
  103. package/src/__tests__/__snapshots__/polygon.test.jsx.snap +0 -192
  104. package/src/__tests__/__snapshots__/rectangle.test.jsx.snap +0 -127
  105. package/src/__tests__/polygon.test.jsx +0 -230
  106. package/src/__tests__/rectangle.test.jsx +0 -232
@@ -1,562 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`HotspotDrawable render renders 1`] = `
4
- <div>
5
- <div>
6
- <img
7
- onLoad={[Function]}
8
- src="https://cdn.fluence.net/image/0240eb1455ce4c4bb6180232347b6aef_W"
9
- style={
10
- Object {
11
- "height": 291,
12
- "width": 410,
13
- }
14
- }
15
- />
16
- <div />
17
- </div>
18
- <ForwardRef
19
- height={291}
20
- onContentMouseLeave={[Function]}
21
- onContentMouseOut={[Function]}
22
- onMouseDown={[Function]}
23
- onMouseMove={[Function]}
24
- onMouseUp={[Function]}
25
- width={410}
26
- >
27
- <Layer>
28
- <WithStyles(RectComponent)
29
- correct={true}
30
- height={140}
31
- hotspotColor="rgba(137, 183, 244, 0.65)"
32
- id="0"
33
- imageHeight={291}
34
- imageWidth={410}
35
- isDrawing={false}
36
- key="0"
37
- onClick={[Function]}
38
- onDeleteShape={[Function]}
39
- onDragEnd={[Function]}
40
- outlineColor="blue"
41
- strokeWidth={5}
42
- width={130}
43
- x={1}
44
- y={1}
45
- />
46
- <WithStyles(RectComponent)
47
- height={140}
48
- hotspotColor="rgba(137, 183, 244, 0.65)"
49
- id="1"
50
- imageHeight={291}
51
- imageWidth={410}
52
- isDrawing={false}
53
- key="1"
54
- onClick={[Function]}
55
- onDeleteShape={[Function]}
56
- onDragEnd={[Function]}
57
- outlineColor="blue"
58
- strokeWidth={5}
59
- width={130}
60
- x={140}
61
- y={1}
62
- />
63
- <WithStyles(RectComponent)
64
- height={140}
65
- hotspotColor="rgba(137, 183, 244, 0.65)"
66
- id="2"
67
- imageHeight={291}
68
- imageWidth={410}
69
- isDrawing={false}
70
- key="2"
71
- onClick={[Function]}
72
- onDeleteShape={[Function]}
73
- onDragEnd={[Function]}
74
- outlineColor="blue"
75
- strokeWidth={5}
76
- width={130}
77
- x={280}
78
- y={1}
79
- />
80
- <WithStyles(PolComponent)
81
- addPolygonPoint={[Function]}
82
- correct={true}
83
- hotspotColor="rgba(137, 183, 244, 0.65)"
84
- id="3"
85
- imageHeight={291}
86
- imageWidth={410}
87
- isDrawing={false}
88
- key="3"
89
- onClick={[Function]}
90
- onDeleteShape={[Function]}
91
- onDragEnd={[Function]}
92
- outlineColor="blue"
93
- points={
94
- Array [
95
- Object {
96
- "x": 1,
97
- "y": 148,
98
- },
99
- Object {
100
- "x": 1,
101
- "y": 288,
102
- },
103
- Object {
104
- "x": 129,
105
- "y": 288,
106
- },
107
- Object {
108
- "x": 129,
109
- "y": 148,
110
- },
111
- ]
112
- }
113
- strokeWidth={5}
114
- />
115
- <WithStyles(PolComponent)
116
- addPolygonPoint={[Function]}
117
- correct={false}
118
- hotspotColor="rgba(137, 183, 244, 0.65)"
119
- id="4"
120
- imageHeight={291}
121
- imageWidth={410}
122
- isDrawing={false}
123
- key="4"
124
- onClick={[Function]}
125
- onDeleteShape={[Function]}
126
- onDragEnd={[Function]}
127
- outlineColor="blue"
128
- points={
129
- Array [
130
- Object {
131
- "x": 141,
132
- "y": 151,
133
- },
134
- Object {
135
- "x": 141,
136
- "y": 289,
137
- },
138
- Object {
139
- "x": 269,
140
- "y": 289,
141
- },
142
- Object {
143
- "x": 269,
144
- "y": 151,
145
- },
146
- ]
147
- }
148
- strokeWidth={5}
149
- />
150
- <WithStyles(PolComponent)
151
- addPolygonPoint={[Function]}
152
- correct={false}
153
- hotspotColor="rgba(137, 183, 244, 0.65)"
154
- id="5"
155
- imageHeight={291}
156
- imageWidth={410}
157
- isDrawing={false}
158
- key="5"
159
- onClick={[Function]}
160
- onDeleteShape={[Function]}
161
- onDragEnd={[Function]}
162
- outlineColor="blue"
163
- points={
164
- Array [
165
- Object {
166
- "x": 279,
167
- "y": 150,
168
- },
169
- Object {
170
- "x": 279,
171
- "y": 289,
172
- },
173
- Object {
174
- "x": 407,
175
- "y": 289,
176
- },
177
- Object {
178
- "x": 407,
179
- "y": 150,
180
- },
181
- ]
182
- }
183
- strokeWidth={5}
184
- />
185
- </Layer>
186
- </ForwardRef>
187
- </div>
188
- `;
189
-
190
- exports[`HotspotDrawable render renders with default strokeWidth 1`] = `
191
- <div>
192
- <div>
193
- <img
194
- onLoad={[Function]}
195
- src="https://cdn.fluence.net/image/0240eb1455ce4c4bb6180232347b6aef_W"
196
- style={
197
- Object {
198
- "height": 291,
199
- "width": 410,
200
- }
201
- }
202
- />
203
- <div />
204
- </div>
205
- <ForwardRef
206
- height={291}
207
- onContentMouseLeave={[Function]}
208
- onContentMouseOut={[Function]}
209
- onMouseDown={[Function]}
210
- onMouseMove={[Function]}
211
- onMouseUp={[Function]}
212
- width={410}
213
- >
214
- <Layer>
215
- <WithStyles(RectComponent)
216
- correct={true}
217
- height={140}
218
- hotspotColor="rgba(137, 183, 244, 0.65)"
219
- id="0"
220
- imageHeight={291}
221
- imageWidth={410}
222
- isDrawing={false}
223
- key="0"
224
- onClick={[Function]}
225
- onDeleteShape={[Function]}
226
- onDragEnd={[Function]}
227
- outlineColor="blue"
228
- strokeWidth={5}
229
- width={130}
230
- x={1}
231
- y={1}
232
- />
233
- <WithStyles(RectComponent)
234
- height={140}
235
- hotspotColor="rgba(137, 183, 244, 0.65)"
236
- id="1"
237
- imageHeight={291}
238
- imageWidth={410}
239
- isDrawing={false}
240
- key="1"
241
- onClick={[Function]}
242
- onDeleteShape={[Function]}
243
- onDragEnd={[Function]}
244
- outlineColor="blue"
245
- strokeWidth={5}
246
- width={130}
247
- x={140}
248
- y={1}
249
- />
250
- <WithStyles(RectComponent)
251
- height={140}
252
- hotspotColor="rgba(137, 183, 244, 0.65)"
253
- id="2"
254
- imageHeight={291}
255
- imageWidth={410}
256
- isDrawing={false}
257
- key="2"
258
- onClick={[Function]}
259
- onDeleteShape={[Function]}
260
- onDragEnd={[Function]}
261
- outlineColor="blue"
262
- strokeWidth={5}
263
- width={130}
264
- x={280}
265
- y={1}
266
- />
267
- <WithStyles(PolComponent)
268
- addPolygonPoint={[Function]}
269
- correct={true}
270
- hotspotColor="rgba(137, 183, 244, 0.65)"
271
- id="3"
272
- imageHeight={291}
273
- imageWidth={410}
274
- isDrawing={false}
275
- key="3"
276
- onClick={[Function]}
277
- onDeleteShape={[Function]}
278
- onDragEnd={[Function]}
279
- outlineColor="blue"
280
- points={
281
- Array [
282
- Object {
283
- "x": 1,
284
- "y": 148,
285
- },
286
- Object {
287
- "x": 1,
288
- "y": 288,
289
- },
290
- Object {
291
- "x": 129,
292
- "y": 288,
293
- },
294
- Object {
295
- "x": 129,
296
- "y": 148,
297
- },
298
- ]
299
- }
300
- strokeWidth={5}
301
- />
302
- <WithStyles(PolComponent)
303
- addPolygonPoint={[Function]}
304
- correct={false}
305
- hotspotColor="rgba(137, 183, 244, 0.65)"
306
- id="4"
307
- imageHeight={291}
308
- imageWidth={410}
309
- isDrawing={false}
310
- key="4"
311
- onClick={[Function]}
312
- onDeleteShape={[Function]}
313
- onDragEnd={[Function]}
314
- outlineColor="blue"
315
- points={
316
- Array [
317
- Object {
318
- "x": 141,
319
- "y": 151,
320
- },
321
- Object {
322
- "x": 141,
323
- "y": 289,
324
- },
325
- Object {
326
- "x": 269,
327
- "y": 289,
328
- },
329
- Object {
330
- "x": 269,
331
- "y": 151,
332
- },
333
- ]
334
- }
335
- strokeWidth={5}
336
- />
337
- <WithStyles(PolComponent)
338
- addPolygonPoint={[Function]}
339
- correct={false}
340
- hotspotColor="rgba(137, 183, 244, 0.65)"
341
- id="5"
342
- imageHeight={291}
343
- imageWidth={410}
344
- isDrawing={false}
345
- key="5"
346
- onClick={[Function]}
347
- onDeleteShape={[Function]}
348
- onDragEnd={[Function]}
349
- outlineColor="blue"
350
- points={
351
- Array [
352
- Object {
353
- "x": 279,
354
- "y": 150,
355
- },
356
- Object {
357
- "x": 279,
358
- "y": 289,
359
- },
360
- Object {
361
- "x": 407,
362
- "y": 289,
363
- },
364
- Object {
365
- "x": 407,
366
- "y": 150,
367
- },
368
- ]
369
- }
370
- strokeWidth={5}
371
- />
372
- </Layer>
373
- </ForwardRef>
374
- </div>
375
- `;
376
-
377
- exports[`HotspotDrawable render renders with given strokeWidth 1`] = `
378
- <div>
379
- <div>
380
- <img
381
- onLoad={[Function]}
382
- src="https://cdn.fluence.net/image/0240eb1455ce4c4bb6180232347b6aef_W"
383
- style={
384
- Object {
385
- "height": 291,
386
- "width": 410,
387
- }
388
- }
389
- />
390
- <div />
391
- </div>
392
- <ForwardRef
393
- height={291}
394
- onContentMouseLeave={[Function]}
395
- onContentMouseOut={[Function]}
396
- onMouseDown={[Function]}
397
- onMouseMove={[Function]}
398
- onMouseUp={[Function]}
399
- width={410}
400
- >
401
- <Layer>
402
- <WithStyles(RectComponent)
403
- correct={true}
404
- height={140}
405
- hotspotColor="rgba(137, 183, 244, 0.65)"
406
- id="0"
407
- imageHeight={291}
408
- imageWidth={410}
409
- isDrawing={false}
410
- key="0"
411
- onClick={[Function]}
412
- onDeleteShape={[Function]}
413
- onDragEnd={[Function]}
414
- outlineColor="blue"
415
- strokeWidth={10}
416
- width={130}
417
- x={1}
418
- y={1}
419
- />
420
- <WithStyles(RectComponent)
421
- height={140}
422
- hotspotColor="rgba(137, 183, 244, 0.65)"
423
- id="1"
424
- imageHeight={291}
425
- imageWidth={410}
426
- isDrawing={false}
427
- key="1"
428
- onClick={[Function]}
429
- onDeleteShape={[Function]}
430
- onDragEnd={[Function]}
431
- outlineColor="blue"
432
- strokeWidth={10}
433
- width={130}
434
- x={140}
435
- y={1}
436
- />
437
- <WithStyles(RectComponent)
438
- height={140}
439
- hotspotColor="rgba(137, 183, 244, 0.65)"
440
- id="2"
441
- imageHeight={291}
442
- imageWidth={410}
443
- isDrawing={false}
444
- key="2"
445
- onClick={[Function]}
446
- onDeleteShape={[Function]}
447
- onDragEnd={[Function]}
448
- outlineColor="blue"
449
- strokeWidth={10}
450
- width={130}
451
- x={280}
452
- y={1}
453
- />
454
- <WithStyles(PolComponent)
455
- addPolygonPoint={[Function]}
456
- correct={true}
457
- hotspotColor="rgba(137, 183, 244, 0.65)"
458
- id="3"
459
- imageHeight={291}
460
- imageWidth={410}
461
- isDrawing={false}
462
- key="3"
463
- onClick={[Function]}
464
- onDeleteShape={[Function]}
465
- onDragEnd={[Function]}
466
- outlineColor="blue"
467
- points={
468
- Array [
469
- Object {
470
- "x": 1,
471
- "y": 148,
472
- },
473
- Object {
474
- "x": 1,
475
- "y": 288,
476
- },
477
- Object {
478
- "x": 129,
479
- "y": 288,
480
- },
481
- Object {
482
- "x": 129,
483
- "y": 148,
484
- },
485
- ]
486
- }
487
- strokeWidth={10}
488
- />
489
- <WithStyles(PolComponent)
490
- addPolygonPoint={[Function]}
491
- correct={false}
492
- hotspotColor="rgba(137, 183, 244, 0.65)"
493
- id="4"
494
- imageHeight={291}
495
- imageWidth={410}
496
- isDrawing={false}
497
- key="4"
498
- onClick={[Function]}
499
- onDeleteShape={[Function]}
500
- onDragEnd={[Function]}
501
- outlineColor="blue"
502
- points={
503
- Array [
504
- Object {
505
- "x": 141,
506
- "y": 151,
507
- },
508
- Object {
509
- "x": 141,
510
- "y": 289,
511
- },
512
- Object {
513
- "x": 269,
514
- "y": 289,
515
- },
516
- Object {
517
- "x": 269,
518
- "y": 151,
519
- },
520
- ]
521
- }
522
- strokeWidth={10}
523
- />
524
- <WithStyles(PolComponent)
525
- addPolygonPoint={[Function]}
526
- correct={false}
527
- hotspotColor="rgba(137, 183, 244, 0.65)"
528
- id="5"
529
- imageHeight={291}
530
- imageWidth={410}
531
- isDrawing={false}
532
- key="5"
533
- onClick={[Function]}
534
- onDeleteShape={[Function]}
535
- onDragEnd={[Function]}
536
- outlineColor="blue"
537
- points={
538
- Array [
539
- Object {
540
- "x": 279,
541
- "y": 150,
542
- },
543
- Object {
544
- "x": 279,
545
- "y": 289,
546
- },
547
- Object {
548
- "x": 407,
549
- "y": 289,
550
- },
551
- Object {
552
- "x": 407,
553
- "y": 150,
554
- },
555
- ]
556
- }
557
- strokeWidth={10}
558
- />
559
- </Layer>
560
- </ForwardRef>
561
- </div>
562
- `;