@pie-element/drawing-response 10.3.4-next.0 → 11.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 (76) hide show
  1. package/configure/lib/button.js +23 -47
  2. package/configure/lib/button.js.map +1 -1
  3. package/configure/lib/defaults.js +2 -3
  4. package/configure/lib/defaults.js.map +1 -1
  5. package/configure/lib/image-container.js +238 -327
  6. package/configure/lib/image-container.js.map +1 -1
  7. package/configure/lib/index.js +115 -182
  8. package/configure/lib/index.js.map +1 -1
  9. package/configure/lib/root.js +194 -260
  10. package/configure/lib/root.js.map +1 -1
  11. package/configure/package.json +9 -7
  12. package/configure/src/__tests__/image-container.test.jsx +101 -37
  13. package/configure/src/__tests__/index.test.js +27 -5
  14. package/configure/src/__tests__/root.test.jsx +37 -21
  15. package/configure/src/button.jsx +14 -24
  16. package/configure/src/image-container.jsx +73 -77
  17. package/configure/src/index.js +12 -2
  18. package/configure/src/root.jsx +24 -25
  19. package/controller/lib/defaults.js +2 -3
  20. package/controller/lib/defaults.js.map +1 -1
  21. package/controller/lib/index.js +39 -65
  22. package/controller/lib/index.js.map +1 -1
  23. package/controller/package.json +1 -1
  24. package/lib/drawing-response/button.js +35 -60
  25. package/lib/drawing-response/button.js.map +1 -1
  26. package/lib/drawing-response/constants.js +2 -3
  27. package/lib/drawing-response/constants.js.map +1 -1
  28. package/lib/drawing-response/container.js +270 -351
  29. package/lib/drawing-response/container.js.map +1 -1
  30. package/lib/drawing-response/drawable-circle.js +65 -104
  31. package/lib/drawing-response/drawable-circle.js.map +1 -1
  32. package/lib/drawing-response/drawable-eraser.js +50 -86
  33. package/lib/drawing-response/drawable-eraser.js.map +1 -1
  34. package/lib/drawing-response/drawable-free-path.js +56 -97
  35. package/lib/drawing-response/drawable-free-path.js.map +1 -1
  36. package/lib/drawing-response/drawable-helper.js +16 -28
  37. package/lib/drawing-response/drawable-helper.js.map +1 -1
  38. package/lib/drawing-response/drawable-image.js +30 -49
  39. package/lib/drawing-response/drawable-image.js.map +1 -1
  40. package/lib/drawing-response/drawable-line.js +60 -99
  41. package/lib/drawing-response/drawable-line.js.map +1 -1
  42. package/lib/drawing-response/drawable-main.js +273 -345
  43. package/lib/drawing-response/drawable-main.js.map +1 -1
  44. package/lib/drawing-response/drawable-palette.js +123 -166
  45. package/lib/drawing-response/drawable-palette.js.map +1 -1
  46. package/lib/drawing-response/drawable-rectangle.js +65 -104
  47. package/lib/drawing-response/drawable-rectangle.js.map +1 -1
  48. package/lib/drawing-response/drawable-text.js +201 -313
  49. package/lib/drawing-response/drawable-text.js.map +1 -1
  50. package/lib/drawing-response/drawable-transformer.js +36 -79
  51. package/lib/drawing-response/drawable-transformer.js.map +1 -1
  52. package/lib/drawing-response/factory.js +6 -19
  53. package/lib/drawing-response/factory.js.map +1 -1
  54. package/lib/drawing-response/icon.js +8 -24
  55. package/lib/drawing-response/icon.js.map +1 -1
  56. package/lib/drawing-response/index.js +74 -116
  57. package/lib/drawing-response/index.js.map +1 -1
  58. package/lib/index.js +51 -102
  59. package/lib/index.js.map +1 -1
  60. package/package.json +13 -12
  61. package/src/__tests__/drawing-index-test.jsx +90 -27
  62. package/src/drawing-response/__tests__/container.test.jsx +56 -36
  63. package/src/drawing-response/__tests__/drawing-main.test.jsx +158 -139
  64. package/src/drawing-response/button.jsx +23 -34
  65. package/src/drawing-response/container.jsx +39 -40
  66. package/src/drawing-response/drawable-image.jsx +17 -20
  67. package/src/drawing-response/drawable-main.jsx +67 -60
  68. package/src/drawing-response/drawable-palette.jsx +48 -54
  69. package/src/drawing-response/drawable-text.jsx +26 -38
  70. package/src/drawing-response/index.jsx +21 -20
  71. package/src/index.js +17 -2
  72. package/configure/src/__tests__/__snapshots__/image-container.test.jsx.snap +0 -45
  73. package/configure/src/__tests__/__snapshots__/root.test.jsx.snap +0 -185
  74. package/src/__tests__/__snapshots__/drawing-index-test.jsx.snap +0 -23
  75. package/src/drawing-response/__tests__/__snapshots__/container.test.jsx.snap +0 -396
  76. package/src/drawing-response/__tests__/__snapshots__/drawing-main.test.jsx.snap +0 -247
@@ -1,396 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`Container snapshot renders 1`] = `
4
- <div>
5
- <WithStyles(Palette)
6
- fillColor="white"
7
- fillList={
8
- Array [
9
- Object {
10
- "label": "No fill",
11
- "value": "transparent",
12
- },
13
- Object {
14
- "label": "Light blue",
15
- "value": "lightblue",
16
- },
17
- Object {
18
- "label": "Light yellow",
19
- "value": "lightyellow",
20
- },
21
- Object {
22
- "label": "Red",
23
- "value": "red",
24
- },
25
- Object {
26
- "label": "Orange",
27
- "value": "orange",
28
- },
29
- Object {
30
- "label": "Yellow",
31
- "value": "yellow",
32
- },
33
- Object {
34
- "label": "Violet",
35
- "value": "violet",
36
- },
37
- Object {
38
- "label": "Blue",
39
- "value": "blue",
40
- },
41
- Object {
42
- "label": "Green",
43
- "value": "green",
44
- },
45
- Object {
46
- "label": "White",
47
- "value": "white",
48
- },
49
- Object {
50
- "label": "Black",
51
- "value": "black",
52
- },
53
- ]
54
- }
55
- onFillColorChange={[Function]}
56
- onOutlineColorChange={[Function]}
57
- onPaintColorChange={[Function]}
58
- outlineColor="black"
59
- outlineList={
60
- Array [
61
- Object {
62
- "label": "Red",
63
- "value": "red",
64
- },
65
- Object {
66
- "label": "Orange",
67
- "value": "orange",
68
- },
69
- Object {
70
- "label": "Yellow",
71
- "value": "yellow",
72
- },
73
- Object {
74
- "label": "Violet",
75
- "value": "violet",
76
- },
77
- Object {
78
- "label": "Blue",
79
- "value": "blue",
80
- },
81
- Object {
82
- "label": "Green",
83
- "value": "green",
84
- },
85
- Object {
86
- "label": "White",
87
- "value": "white",
88
- },
89
- Object {
90
- "label": "Black",
91
- "value": "black",
92
- },
93
- ]
94
- }
95
- paintColor="Red"
96
- paintList={
97
- Array [
98
- Object {
99
- "label": "Red",
100
- "value": "red",
101
- },
102
- Object {
103
- "label": "Orange",
104
- "value": "orange",
105
- },
106
- Object {
107
- "label": "Yellow",
108
- "value": "yellow",
109
- },
110
- Object {
111
- "label": "Violet",
112
- "value": "violet",
113
- },
114
- Object {
115
- "label": "Blue",
116
- "value": "blue",
117
- },
118
- Object {
119
- "label": "Green",
120
- "value": "green",
121
- },
122
- Object {
123
- "label": "White",
124
- "value": "white",
125
- },
126
- Object {
127
- "label": "Black",
128
- "value": "black",
129
- },
130
- ]
131
- }
132
- />
133
- <div>
134
- <div>
135
- <WithStyles(RawButton)
136
- disabled={true}
137
- key="Select"
138
- label={
139
- <IconWrapper
140
- path="mdiCursorDefault"
141
- />
142
- }
143
- onClick={[Function]}
144
- title="Select"
145
- />
146
- <WithStyles(RawButton)
147
- disabled={false}
148
- key="FreePathDrawable"
149
- label={
150
- <IconWrapper
151
- path="mdiPencil"
152
- />
153
- }
154
- onClick={[Function]}
155
- title="Free Draw"
156
- />
157
- <WithStyles(RawButton)
158
- disabled={false}
159
- key="LineDrawable"
160
- label={
161
- <IconWrapper
162
- path="mdiMinus"
163
- />
164
- }
165
- onClick={[Function]}
166
- title="Line"
167
- />
168
- <WithStyles(RawButton)
169
- disabled={false}
170
- key="RectangleDrawable"
171
- label={
172
- <IconWrapper
173
- path="mdiRectangle"
174
- />
175
- }
176
- onClick={[Function]}
177
- title="Rectangle"
178
- />
179
- <WithStyles(RawButton)
180
- disabled={false}
181
- key="CircleDrawable"
182
- label={
183
- <IconWrapper
184
- path="mdiCircle"
185
- />
186
- }
187
- onClick={[Function]}
188
- title="Circle"
189
- />
190
- <WithStyles(RawButton)
191
- disabled={false}
192
- key="Text"
193
- label={
194
- <IconWrapper
195
- path="mdiFormatColorText"
196
- />
197
- }
198
- onClick={[Function]}
199
- title="Text Entry"
200
- />
201
- <WithStyles(RawButton)
202
- disabled={false}
203
- key="EraserDrawable"
204
- label={
205
- <IconWrapper
206
- path="mdiEraser"
207
- />
208
- }
209
- onClick={[Function]}
210
- title="Eraser"
211
- />
212
- </div>
213
- <div
214
- style={
215
- Object {
216
- "height": 0,
217
- "maxHeight": 0,
218
- "overflow": "scroll",
219
- }
220
- }
221
- >
222
- <WithStyles(DrawableMain)
223
- TextEntry={
224
- TextDrawable {
225
- "addNewTextEntry": [Function],
226
- "all": Array [],
227
- "eventListenersDetachArray": Array [],
228
- "handleClick": [Function],
229
- "handleDblClick": [Function],
230
- "handleMouseDown": [Function],
231
- "handleMouseUp": [Function],
232
- "handleTransform": [Function],
233
- "removeEventListeners": [Function],
234
- "setAll": [Function],
235
- }
236
- }
237
- drawableDimensions={
238
- Object {
239
- "height": 0,
240
- "width": 0,
241
- }
242
- }
243
- fillColor="white"
244
- imageDimensions={Object {}}
245
- imageUrl="url"
246
- onSessionChange={[MockFunction]}
247
- outlineColor="black"
248
- paintColor="Red"
249
- scale={1}
250
- session={Object {}}
251
- toolActive={
252
- Object {
253
- "icon": "mdiCursorDefault",
254
- "label": "Select",
255
- "type": "Select",
256
- }
257
- }
258
- />
259
- </div>
260
- </div>
261
- </div>
262
- `;
263
-
264
- exports[`Container snapshot renders disabled 1`] = `
265
- <div>
266
- <div>
267
- <div>
268
- <WithStyles(RawButton)
269
- disabled={true}
270
- key="Select"
271
- label={
272
- <IconWrapper
273
- path="mdiCursorDefault"
274
- />
275
- }
276
- onClick={[Function]}
277
- title="Select"
278
- />
279
- <WithStyles(RawButton)
280
- disabled={true}
281
- key="FreePathDrawable"
282
- label={
283
- <IconWrapper
284
- path="mdiPencil"
285
- />
286
- }
287
- onClick={[Function]}
288
- title="Free Draw"
289
- />
290
- <WithStyles(RawButton)
291
- disabled={true}
292
- key="LineDrawable"
293
- label={
294
- <IconWrapper
295
- path="mdiMinus"
296
- />
297
- }
298
- onClick={[Function]}
299
- title="Line"
300
- />
301
- <WithStyles(RawButton)
302
- disabled={true}
303
- key="RectangleDrawable"
304
- label={
305
- <IconWrapper
306
- path="mdiRectangle"
307
- />
308
- }
309
- onClick={[Function]}
310
- title="Rectangle"
311
- />
312
- <WithStyles(RawButton)
313
- disabled={true}
314
- key="CircleDrawable"
315
- label={
316
- <IconWrapper
317
- path="mdiCircle"
318
- />
319
- }
320
- onClick={[Function]}
321
- title="Circle"
322
- />
323
- <WithStyles(RawButton)
324
- disabled={true}
325
- key="Text"
326
- label={
327
- <IconWrapper
328
- path="mdiFormatColorText"
329
- />
330
- }
331
- onClick={[Function]}
332
- title="Text Entry"
333
- />
334
- <WithStyles(RawButton)
335
- disabled={true}
336
- key="EraserDrawable"
337
- label={
338
- <IconWrapper
339
- path="mdiEraser"
340
- />
341
- }
342
- onClick={[Function]}
343
- title="Eraser"
344
- />
345
- </div>
346
- <div
347
- style={
348
- Object {
349
- "height": 0,
350
- "maxHeight": 0,
351
- "overflow": "scroll",
352
- }
353
- }
354
- >
355
- <WithStyles(DrawableMain)
356
- TextEntry={
357
- TextDrawable {
358
- "addNewTextEntry": [Function],
359
- "all": Array [],
360
- "eventListenersDetachArray": Array [],
361
- "handleClick": [Function],
362
- "handleDblClick": [Function],
363
- "handleMouseDown": [Function],
364
- "handleMouseUp": [Function],
365
- "handleTransform": [Function],
366
- "removeEventListeners": [Function],
367
- "setAll": [Function],
368
- }
369
- }
370
- disabled={true}
371
- drawableDimensions={
372
- Object {
373
- "height": 0,
374
- "width": 0,
375
- }
376
- }
377
- fillColor="white"
378
- imageDimensions={Object {}}
379
- imageUrl="url"
380
- onSessionChange={[MockFunction]}
381
- outlineColor="black"
382
- paintColor="Red"
383
- scale={1}
384
- session={Object {}}
385
- toolActive={
386
- Object {
387
- "icon": "mdiCursorDefault",
388
- "label": "Select",
389
- "type": "Select",
390
- }
391
- }
392
- />
393
- </div>
394
- </div>
395
- </div>
396
- `;
@@ -1,247 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`DrawingResponse CircleDrawable snapshot renders 1`] = `
4
- <Circle
5
- onClick={[Function]}
6
- onDragEnd={[Function]}
7
- radius={100}
8
- x={200}
9
- y={200}
10
- />
11
- `;
12
-
13
- exports[`DrawingResponse DrawableMain snapshot renders 1`] = `
14
- <div>
15
- <div>
16
- <WithStyles(RawButton)
17
- disabled={false}
18
- label="Undo"
19
- onClick={[Function]}
20
- />
21
- <WithStyles(RawButton)
22
- disabled={false}
23
- label="Clear all"
24
- onClick={[Function]}
25
- />
26
- </div>
27
- <div>
28
- <WithStyles(DrawableImage)
29
- dimensions={
30
- Object {
31
- "height": NaN,
32
- "width": NaN,
33
- }
34
- }
35
- url="url"
36
- />
37
- <ForwardRef
38
- className=""
39
- height={350}
40
- onMouseMove={[Function]}
41
- onMouseUp={[Function]}
42
- onTouchEnd={[Function]}
43
- onTouchMove={[Function]}
44
- width={353}
45
- >
46
- <Layer />
47
- </ForwardRef>
48
- </div>
49
- </div>
50
- `;
51
-
52
- exports[`DrawingResponse DrawableMain snapshot renders disabled 1`] = `
53
- <div>
54
- <div>
55
- <WithStyles(RawButton)
56
- disabled={true}
57
- label="Undo"
58
- onClick={[Function]}
59
- />
60
- <WithStyles(RawButton)
61
- disabled={true}
62
- label="Clear all"
63
- onClick={[Function]}
64
- />
65
- </div>
66
- <div>
67
- <WithStyles(DrawableImage)
68
- dimensions={
69
- Object {
70
- "height": NaN,
71
- "width": NaN,
72
- }
73
- }
74
- url="url"
75
- />
76
- <ForwardRef
77
- className=""
78
- height={350}
79
- width={353}
80
- >
81
- <Layer />
82
- </ForwardRef>
83
- </div>
84
- </div>
85
- `;
86
-
87
- exports[`DrawingResponse DrawableText snapshot renders 1`] = `
88
- <div>
89
- <Text
90
- bubbles={true}
91
- draggable={true}
92
- fontSize={16}
93
- id="gcifqhhimf8k2d6g8hs"
94
- key="gcifqhhimf8k2d6g8hs"
95
- name="text_gcifqhhimf8k2d6g8hs"
96
- onClick={[Function]}
97
- onDblClick={[Function]}
98
- onDblTap={[Function]}
99
- onDragEnd={[MockFunction]}
100
- onMouseDown={[Function]}
101
- onMouseUp={[Function]}
102
- onTap={[Function]}
103
- onTouchEnd={[Function]}
104
- onTouchStart={[Function]}
105
- onTransform={[Function]}
106
- onTransformEnd={[MockFunction]}
107
- text="Double click to edit this text. Press Enter to submit."
108
- visible={true}
109
- width={200}
110
- x={60}
111
- y={60}
112
- />
113
- <TransformerComponent
114
- key="transformer_gcifqhhimf8k2d6g8hs"
115
- onMouseDown={[Function]}
116
- onMouseUp={[Function]}
117
- onTouchEnd={[Function]}
118
- onTouchStart={[Function]}
119
- selectedShapeName="text_gcifqhhimf8k2d6g8hs"
120
- />
121
- </div>
122
- `;
123
-
124
- exports[`DrawingResponse DrawableText snapshot renders textAreas 1`] = `
125
- <div>
126
- <textarea
127
- key="textarea_gcifqhhimf8k2d6g8hs"
128
- style={
129
- Object {
130
- "display": "none",
131
- }
132
- }
133
- />
134
- </div>
135
- `;
136
-
137
- exports[`DrawingResponse DrawableText snapshot when there is no value renders 1`] = `
138
- <div>
139
- <Text
140
- bubbles={true}
141
- draggable={true}
142
- fontSize={16}
143
- id="gcifqhhimf8k2d6g8hs"
144
- key="gcifqhhimf8k2d6g8hs"
145
- name="text_gcifqhhimf8k2d6g8hs"
146
- onClick={[Function]}
147
- onDblClick={[Function]}
148
- onDblTap={[Function]}
149
- onDragEnd={[MockFunction]}
150
- onMouseDown={[Function]}
151
- onMouseUp={[Function]}
152
- onTap={[Function]}
153
- onTouchEnd={[Function]}
154
- onTouchStart={[Function]}
155
- onTransform={[Function]}
156
- onTransformEnd={[MockFunction]}
157
- text="Double click to edit this text. Press Enter to submit."
158
- visible={true}
159
- width={200}
160
- x={60}
161
- y={60}
162
- />
163
- <TransformerComponent
164
- key="transformer_gcifqhhimf8k2d6g8hs"
165
- onMouseDown={[Function]}
166
- onMouseUp={[Function]}
167
- onTouchEnd={[Function]}
168
- onTouchStart={[Function]}
169
- selectedShapeName="text_gcifqhhimf8k2d6g8hs"
170
- />
171
- </div>
172
- `;
173
-
174
- exports[`DrawingResponse EraserDrawable snapshot renders 1`] = `
175
- <Line
176
- bezier={true}
177
- fill="white"
178
- globalCompositeOperation="destination-out"
179
- lineJoin="round"
180
- lineWidth="5"
181
- onDragEnd={[Function]}
182
- points={
183
- Array [
184
- 200,
185
- 200,
186
- 300,
187
- 300,
188
- ]
189
- }
190
- stroke="white"
191
- strokeStyle="#df4b26"
192
- strokeWidth={5}
193
- tension={0}
194
- x={200}
195
- y={200}
196
- />
197
- `;
198
-
199
- exports[`DrawingResponse FreePathDrawable snapshot renders 1`] = `
200
- <Line
201
- bezier={true}
202
- onClick={[Function]}
203
- onDragEnd={[Function]}
204
- points={
205
- Array [
206
- 200,
207
- 200,
208
- 300,
209
- 300,
210
- ]
211
- }
212
- tension={0}
213
- x={200}
214
- y={200}
215
- />
216
- `;
217
-
218
- exports[`DrawingResponse LineDrawable snapshot renders 1`] = `
219
- <Arrow
220
- onClick={[Function]}
221
- onDragEnd={[Function]}
222
- pointerLength={0}
223
- pointerWidth={0}
224
- points={
225
- Array [
226
- 200,
227
- 200,
228
- 300,
229
- 200,
230
- ]
231
- }
232
- x={200}
233
- y={200}
234
- />
235
- `;
236
-
237
- exports[`DrawingResponse RectangleDrawable snapshot renders 1`] = `
238
- <Rect
239
- height={100}
240
- onClick={[Function]}
241
- onDragEnd={[Function]}
242
- strokeWidth={2}
243
- width={100}
244
- x={200}
245
- y={200}
246
- />
247
- `;