@pie-element/drawing-response 3.6.0 → 3.6.1-beta.587

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 (87) hide show
  1. package/CHANGELOG.md +507 -0
  2. package/configure/CHANGELOG.md +446 -0
  3. package/configure/lib/button.js.map +1 -1
  4. package/configure/lib/defaults.js +22 -7
  5. package/configure/lib/defaults.js.map +1 -1
  6. package/configure/lib/image-container.js +44 -24
  7. package/configure/lib/image-container.js.map +1 -1
  8. package/configure/lib/index.js +65 -12
  9. package/configure/lib/index.js.map +1 -1
  10. package/configure/lib/root.js +78 -48
  11. package/configure/lib/root.js.map +1 -1
  12. package/configure/package.json +4 -4
  13. package/configure/src/__tests__/__snapshots__/image-container.test.jsx.snap +3 -2
  14. package/configure/src/__tests__/__snapshots__/root.test.jsx.snap +38 -18
  15. package/configure/src/__tests__/image-container.test.jsx +42 -35
  16. package/configure/src/__tests__/index.test.js +7 -7
  17. package/configure/src/__tests__/root.test.jsx +18 -25
  18. package/configure/src/button.jsx +4 -4
  19. package/configure/src/defaults.js +25 -10
  20. package/configure/src/image-container.jsx +80 -59
  21. package/configure/src/index.js +46 -14
  22. package/configure/src/root.jsx +72 -76
  23. package/controller/CHANGELOG.md +58 -0
  24. package/controller/lib/defaults.js.map +1 -1
  25. package/controller/lib/index.js +13 -12
  26. package/controller/lib/index.js.map +1 -1
  27. package/controller/package.json +1 -1
  28. package/controller/src/__tests__/index.test.js +35 -34
  29. package/controller/src/defaults.js +2 -2
  30. package/controller/src/index.js +13 -17
  31. package/docs/config-schema.json +111 -1
  32. package/docs/config-schema.json.md +87 -3
  33. package/docs/demo/config.js +2 -2
  34. package/docs/demo/generate.js +5 -2
  35. package/docs/demo/session.js +4 -4
  36. package/docs/pie-schema.json +70 -6
  37. package/docs/pie-schema.json.md +55 -4
  38. package/lib/drawing-response/button.js.map +1 -1
  39. package/lib/drawing-response/constants.js.map +1 -1
  40. package/lib/drawing-response/container.js +80 -25
  41. package/lib/drawing-response/container.js.map +1 -1
  42. package/lib/drawing-response/drawable-circle.js +1 -1
  43. package/lib/drawing-response/drawable-circle.js.map +1 -1
  44. package/lib/drawing-response/drawable-eraser.js +1 -1
  45. package/lib/drawing-response/drawable-eraser.js.map +1 -1
  46. package/lib/drawing-response/drawable-free-path.js +1 -1
  47. package/lib/drawing-response/drawable-free-path.js.map +1 -1
  48. package/lib/drawing-response/drawable-helper.js.map +1 -1
  49. package/lib/drawing-response/drawable-image.js +1 -0
  50. package/lib/drawing-response/drawable-image.js.map +1 -1
  51. package/lib/drawing-response/drawable-line.js +1 -1
  52. package/lib/drawing-response/drawable-line.js.map +1 -1
  53. package/lib/drawing-response/drawable-main.js +46 -16
  54. package/lib/drawing-response/drawable-main.js.map +1 -1
  55. package/lib/drawing-response/drawable-palette.js +7 -2
  56. package/lib/drawing-response/drawable-palette.js.map +1 -1
  57. package/lib/drawing-response/drawable-rectangle.js +1 -1
  58. package/lib/drawing-response/drawable-rectangle.js.map +1 -1
  59. package/lib/drawing-response/drawable-text.js +15 -5
  60. package/lib/drawing-response/drawable-text.js.map +1 -1
  61. package/lib/drawing-response/drawable-transformer.js +1 -1
  62. package/lib/drawing-response/drawable-transformer.js.map +1 -1
  63. package/lib/drawing-response/factory.js.map +1 -1
  64. package/lib/drawing-response/icon.js.map +1 -1
  65. package/lib/drawing-response/index.js +11 -15
  66. package/lib/drawing-response/index.js.map +1 -1
  67. package/lib/index.js +4 -1
  68. package/lib/index.js.map +1 -1
  69. package/package.json +5 -4
  70. package/src/__tests__/drawing-index-test.jsx +4 -4
  71. package/src/drawing-response/__tests__/__snapshots__/container.test.jsx.snap +174 -290
  72. package/src/drawing-response/__tests__/__snapshots__/drawing-main.test.jsx.snap +26 -2
  73. package/src/drawing-response/__tests__/container.test.jsx +9 -2
  74. package/src/drawing-response/__tests__/drawable-helper.test.jsx +1 -1
  75. package/src/drawing-response/__tests__/drawing-main.test.jsx +74 -86
  76. package/src/drawing-response/button.jsx +5 -8
  77. package/src/drawing-response/constants.js +42 -34
  78. package/src/drawing-response/container.jsx +93 -70
  79. package/src/drawing-response/drawable-image.jsx +5 -4
  80. package/src/drawing-response/drawable-main.jsx +46 -17
  81. package/src/drawing-response/drawable-palette.jsx +18 -35
  82. package/src/drawing-response/drawable-text.jsx +34 -48
  83. package/src/drawing-response/drawable-transformer.jsx +3 -1
  84. package/src/drawing-response/factory.js +3 -11
  85. package/src/drawing-response/icon.jsx +19 -20
  86. package/src/drawing-response/index.jsx +14 -20
  87. package/src/index.js +8 -11
@@ -3,6 +3,452 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [4.5.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/drawing-response-configure@4.4.0...@pie-element/drawing-response-configure@4.5.0) (2023-01-17)
7
+
8
+
9
+ ### Features
10
+
11
+ * update pie-libs ([6423903](https://github.com/pie-framework/pie-elements/commit/6423903898b041f56db2111de2e4aac4ee9f1fd3))
12
+
13
+
14
+
15
+
16
+
17
+ # [4.4.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/drawing-response-configure@4.3.6...@pie-element/drawing-response-configure@4.4.0) (2023-01-05)
18
+
19
+
20
+ ### Features
21
+
22
+ * update pie-libs ([b174476](https://github.com/pie-framework/pie-elements/commit/b174476729119a0689f1f8adfc8c235246676cab))
23
+ * update pie-libs ([f72c3c8](https://github.com/pie-framework/pie-elements/commit/f72c3c8d8bc9bbf061bb81502317157a63c22972))
24
+ * update pie-libs ([8490729](https://github.com/pie-framework/pie-elements/commit/8490729a2389d36fd3968f0806119fde96577842))
25
+ * **drawing-response:** added configuration prop to hide the settings panel PD-1999 ([57ddf9e](https://github.com/pie-framework/pie-elements/commit/57ddf9e56540f77ab3286495d660821bc70deb59))
26
+
27
+
28
+
29
+
30
+
31
+ ## [4.3.6](https://github.com/pie-framework/pie-elements/compare/@pie-element/drawing-response-configure@4.3.5...@pie-element/drawing-response-configure@4.3.6) (2022-12-21)
32
+
33
+
34
+ ### Bug Fixes
35
+
36
+ * updated pie-libs ([8cb5b90](https://github.com/pie-framework/pie-elements/commit/8cb5b90d501ccbdf5ffd764e6555faa48b8f54d6))
37
+
38
+
39
+
40
+
41
+
42
+ ## [4.3.5](https://github.com/pie-framework/pie-elements/compare/@pie-element/drawing-response-configure@4.3.4...@pie-element/drawing-response-configure@4.3.5) (2022-12-20)
43
+
44
+
45
+ ### Bug Fixes
46
+
47
+ * updated pie-libs ([6549302](https://github.com/pie-framework/pie-elements/commit/65493026fbf356c5ab752ae6a14d961d4b256368))
48
+
49
+
50
+
51
+
52
+
53
+ ## [4.3.4](https://github.com/pie-framework/pie-elements/compare/@pie-element/drawing-response-configure@4.3.3...@pie-element/drawing-response-configure@4.3.4) (2022-12-07)
54
+
55
+
56
+ ### Bug Fixes
57
+
58
+ * update libs ([441f403](https://github.com/pie-framework/pie-elements/commit/441f403870b7bec0d61fab58b8d93dbe0ead4c32))
59
+ * update libs for PD-2030 PD-2031 ([3174022](https://github.com/pie-framework/pie-elements/commit/3174022d45603ed217bbe8804a142b07084636a5))
60
+ * updated lib PD-1715 ([42e788d](https://github.com/pie-framework/pie-elements/commit/42e788db0c792838994e55001952da7701251a8e))
61
+ * updated libs ([c20de3a](https://github.com/pie-framework/pie-elements/commit/c20de3a6ba4499a090c809e18e52588d2a585fa0))
62
+ * updated libs ([0eed79a](https://github.com/pie-framework/pie-elements/commit/0eed79a32c3b777c16c8cabf201513fc1d2726a0))
63
+ * updated libs ([343c9ec](https://github.com/pie-framework/pie-elements/commit/343c9ec3dccba7f781e90ae2bd195cac6f78f467))
64
+
65
+
66
+
67
+
68
+
69
+ ## [4.3.3](https://github.com/pie-framework/pie-elements/compare/@pie-element/drawing-response-configure@4.3.2...@pie-element/drawing-response-configure@4.3.3) (2022-11-15)
70
+
71
+ **Note:** Version bump only for package @pie-element/drawing-response-configure
72
+
73
+
74
+
75
+
76
+
77
+ ## [4.3.2](https://github.com/pie-framework/pie-elements/compare/@pie-element/drawing-response-configure@4.3.1...@pie-element/drawing-response-configure@4.3.2) (2022-11-11)
78
+
79
+
80
+ ### Bug Fixes
81
+
82
+ * add sanity checks ([1cfd187](https://github.com/pie-framework/pie-elements/commit/1cfd187d2c2bab2d589aa2d7b7563b1c69e3295e))
83
+
84
+
85
+
86
+
87
+
88
+ ## [4.3.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/drawing-response-configure@4.3.0...@pie-element/drawing-response-configure@4.3.1) (2022-11-11)
89
+
90
+
91
+ ### Bug Fixes
92
+
93
+ * **drawing-response:** add sanity checks for withRubric ([d22ea78](https://github.com/pie-framework/pie-elements/commit/d22ea78fc5b0a9dd73d3614fbd2a39b28183a991))
94
+
95
+
96
+
97
+
98
+
99
+ # [4.3.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/drawing-response-configure@4.2.2...@pie-element/drawing-response-configure@4.3.0) (2022-11-01)
100
+
101
+
102
+ ### Features
103
+
104
+ * add a different property in the config, forceEnabled, to force a value ([300c664](https://github.com/pie-framework/pie-elements/commit/300c664618f46177137deef3bced2d096cdb8126))
105
+
106
+
107
+
108
+
109
+
110
+ ## [4.2.2](https://github.com/pie-framework/pie-elements/compare/@pie-element/drawing-response-configure@4.2.1...@pie-element/drawing-response-configure@4.2.2) (2022-11-01)
111
+
112
+
113
+ ### Bug Fixes
114
+
115
+ * trigger updating model depending on configuration.withRubric ([6b42963](https://github.com/pie-framework/pie-elements/commit/6b429639dade1f72e77e972530ab784c5417384c))
116
+ * trigger updating model depending on configuration.withRubric (added additional check) ([02ae9c0](https://github.com/pie-framework/pie-elements/commit/02ae9c0664aa140d6624643b6efbdef33cea2acb))
117
+
118
+
119
+
120
+
121
+
122
+ ## [4.2.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/drawing-response-configure@4.2.0...@pie-element/drawing-response-configure@4.2.1) (2022-10-31)
123
+
124
+ **Note:** Version bump only for package @pie-element/drawing-response-configure
125
+
126
+
127
+
128
+
129
+
130
+ # [4.2.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/drawing-response-configure@4.1.9...@pie-element/drawing-response-configure@4.2.0) (2022-10-17)
131
+
132
+
133
+ ### Bug Fixes
134
+
135
+ * update snapshots ([9781596](https://github.com/pie-framework/pie-elements/commit/978159686bbbd6b727dff4b88ce4ab9606504586))
136
+
137
+
138
+ ### Features
139
+
140
+ * set withRubric to false in item default configurations. Set rubricEnabled to true if it's enabled for drawing-response and extended-text-entry ([a209057](https://github.com/pie-framework/pie-elements/commit/a209057f5a3fa5438efc8595453c89c11959a8f5))
141
+ * update libs ([7e174fb](https://github.com/pie-framework/pie-elements/commit/7e174fba75e7ea668900ad5c103751cefe33e2af))
142
+ * **drawing-response:** add pie-api config PD-23 ([d98fc22](https://github.com/pie-framework/pie-elements/commit/d98fc225c16f6bc89631f72ea488ff67feab3872))
143
+ * **drawing-response:** add settings to enable rubric. Add withRubric prop to configuration and rubricEnabled prop to model PD-2096 ([142429a](https://github.com/pie-framework/pie-elements/commit/142429a1a92af9e41f670d4f611e9bb62039a1f3))
144
+ * **drawing-response:** updated snapshot PD-2096 ([4e1a63c](https://github.com/pie-framework/pie-elements/commit/4e1a63cf0840c2ac93de0b314d56b9bb6c3835ac))
145
+ * enable spanish and special characters in author PD-2120 ([85fd3dd](https://github.com/pie-framework/pie-elements/commit/85fd3dd0fc10da1a2dfd5a842809c625790f8ba9))
146
+ * **drawing-response:** add uploadSoundSupport property PD-23-updated ([9a0f0b4](https://github.com/pie-framework/pie-elements/commit/9a0f0b4adb5d3956240fdebc62485c27572be495))
147
+
148
+
149
+
150
+
151
+
152
+ ## [4.1.9](https://github.com/pie-framework/pie-elements/compare/@pie-element/drawing-response-configure@4.1.8...@pie-element/drawing-response-configure@4.1.9) (2022-09-29)
153
+
154
+ **Note:** Version bump only for package @pie-element/drawing-response-configure
155
+
156
+
157
+
158
+
159
+
160
+ ## [4.1.8](https://github.com/pie-framework/pie-elements/compare/@pie-element/drawing-response-configure@4.1.7...@pie-element/drawing-response-configure@4.1.8) (2022-09-14)
161
+
162
+ **Note:** Version bump only for package @pie-element/drawing-response-configure
163
+
164
+
165
+
166
+
167
+
168
+ ## [4.1.7](https://github.com/pie-framework/pie-elements/compare/@pie-element/drawing-response-configure@4.1.6...@pie-element/drawing-response-configure@4.1.7) (2022-08-31)
169
+
170
+ **Note:** Version bump only for package @pie-element/drawing-response-configure
171
+
172
+
173
+
174
+
175
+
176
+ ## [4.1.6](https://github.com/pie-framework/pie-elements/compare/@pie-element/drawing-response-configure@4.1.5...@pie-element/drawing-response-configure@4.1.6) (2022-08-16)
177
+
178
+
179
+ ### Bug Fixes
180
+
181
+ * tests ([ae31244](https://github.com/pie-framework/pie-elements/commit/ae312449fcf05ec6787163259b3c75e15d42b261))
182
+ * **drawing-respone:** make sure image dimensions are not reset in IBX in authoring and preview PD-1932 ([47fc982](https://github.com/pie-framework/pie-elements/commit/47fc982d21f992fecf61af96bc15744055787f78))
183
+ * **drawing-response:** fix image aspect ratio PD-1934 ([0a094b8](https://github.com/pie-framework/pie-elements/commit/0a094b874abc81a6f642bf0bdece83ee2ce815a4))
184
+ * **drawing-response:** fix svg not loading PD-1933 ([f65540e](https://github.com/pie-framework/pie-elements/commit/f65540e1627184d47f29ec3aeea0ad439ca07844))
185
+
186
+
187
+
188
+
189
+
190
+ ## [4.1.5](https://github.com/pie-framework/pie-elements/compare/@pie-element/drawing-response-configure@4.1.4...@pie-element/drawing-response-configure@4.1.5) (2022-08-08)
191
+
192
+ **Note:** Version bump only for package @pie-element/drawing-response-configure
193
+
194
+
195
+
196
+
197
+
198
+ ## [4.1.4](https://github.com/pie-framework/pie-elements/compare/@pie-element/drawing-response-configure@4.1.3...@pie-element/drawing-response-configure@4.1.4) (2022-08-02)
199
+
200
+ **Note:** Version bump only for package @pie-element/drawing-response-configure
201
+
202
+
203
+
204
+
205
+
206
+ ## [4.1.3](https://github.com/pie-framework/pie-elements/compare/@pie-element/drawing-response-configure@4.1.2...@pie-element/drawing-response-configure@4.1.3) (2022-07-22)
207
+
208
+ **Note:** Version bump only for package @pie-element/drawing-response-configure
209
+
210
+
211
+
212
+
213
+
214
+ ## [4.1.2](https://github.com/pie-framework/pie-elements/compare/@pie-element/drawing-response-configure@4.1.1...@pie-element/drawing-response-configure@4.1.2) (2022-07-20)
215
+
216
+ **Note:** Version bump only for package @pie-element/drawing-response-configure
217
+
218
+
219
+
220
+
221
+
222
+ ## [4.1.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/drawing-response-configure@4.1.0...@pie-element/drawing-response-configure@4.1.1) (2022-07-19)
223
+
224
+ **Note:** Version bump only for package @pie-element/drawing-response-configure
225
+
226
+
227
+
228
+
229
+
230
+ # [4.1.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/drawing-response-configure@4.0.0...@pie-element/drawing-response-configure@4.1.0) (2022-06-28)
231
+
232
+
233
+ ### Bug Fixes
234
+
235
+ * **drawing-response:** PD-1839 do not set image width if it's 0 ([ba4e321](https://github.com/pie-framework/pie-elements/commit/ba4e321f4fe3252e93ed125efbf93d684a2740f0))
236
+ * add missing prop ([fd4220c](https://github.com/pie-framework/pie-elements/commit/fd4220c60d519dccd9a37ab3639d4feaa90a58a4))
237
+ * **drawing-response:** fix width of image not being rendered correctly PD-1839 ([5599ff5](https://github.com/pie-framework/pie-elements/commit/5599ff5c4d03a1d0d86c687f2b781b92903e5a63))
238
+
239
+
240
+ ### Features
241
+
242
+ * **drawing-response:** add maxImageWidth and maxImageHeight props PD-1801 ([4f1fb5d](https://github.com/pie-framework/pie-elements/commit/4f1fb5dfa4616c194eefd1702854a5aaa413ce1f))
243
+
244
+
245
+
246
+
247
+
248
+ # [4.0.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/drawing-response-configure@3.2.25...@pie-element/drawing-response-configure@4.0.0) (2022-06-28)
249
+
250
+
251
+ ### chore
252
+
253
+ * Merge master with develop. ([cdca48a](https://github.com/pie-framework/pie-elements/commit/cdca48abaa1d4179e4a961e13d171e14b7ed2444))
254
+
255
+
256
+ ### BREAKING CHANGES
257
+
258
+ * Image percent buttons were removed from toolbar.
259
+ New properties maxImageWidth and maxImageHeight were added.
260
+
261
+
262
+
263
+
264
+
265
+ ## [3.2.25](https://github.com/pie-framework/pie-elements/compare/@pie-element/drawing-response-configure@3.2.24...@pie-element/drawing-response-configure@3.2.25) (2022-06-13)
266
+
267
+ **Note:** Version bump only for package @pie-element/drawing-response-configure
268
+
269
+
270
+
271
+
272
+
273
+ ## [3.2.24](https://github.com/pie-framework/pie-elements/compare/@pie-element/drawing-response-configure@3.2.23...@pie-element/drawing-response-configure@3.2.24) (2022-05-30)
274
+
275
+ **Note:** Version bump only for package @pie-element/drawing-response-configure
276
+
277
+
278
+
279
+
280
+
281
+ ## [3.2.23](https://github.com/pie-framework/pie-elements/compare/@pie-element/drawing-response-configure@3.2.22...@pie-element/drawing-response-configure@3.2.23) (2022-05-16)
282
+
283
+ **Note:** Version bump only for package @pie-element/drawing-response-configure
284
+
285
+
286
+
287
+
288
+
289
+ ## [3.2.22](https://github.com/pie-framework/pie-elements/compare/@pie-element/drawing-response-configure@3.2.21...@pie-element/drawing-response-configure@3.2.22) (2022-05-09)
290
+
291
+ **Note:** Version bump only for package @pie-element/drawing-response-configure
292
+
293
+
294
+
295
+
296
+
297
+ ## [3.2.21](https://github.com/pie-framework/pie-elements/compare/@pie-element/drawing-response-configure@3.2.20...@pie-element/drawing-response-configure@3.2.21) (2022-05-03)
298
+
299
+ **Note:** Version bump only for package @pie-element/drawing-response-configure
300
+
301
+
302
+
303
+
304
+
305
+ ## [3.2.20](https://github.com/pie-framework/pie-elements/compare/@pie-element/drawing-response-configure@3.2.19...@pie-element/drawing-response-configure@3.2.20) (2022-04-12)
306
+
307
+ **Note:** Version bump only for package @pie-element/drawing-response-configure
308
+
309
+
310
+
311
+
312
+
313
+ ## [3.2.19](https://github.com/pie-framework/pie-elements/compare/@pie-element/drawing-response-configure@3.2.18...@pie-element/drawing-response-configure@3.2.19) (2022-03-28)
314
+
315
+ **Note:** Version bump only for package @pie-element/drawing-response-configure
316
+
317
+
318
+
319
+
320
+
321
+ ## [3.2.18](https://github.com/pie-framework/pie-elements/compare/@pie-element/drawing-response-configure@3.2.17...@pie-element/drawing-response-configure@3.2.18) (2022-03-22)
322
+
323
+ **Note:** Version bump only for package @pie-element/drawing-response-configure
324
+
325
+
326
+
327
+
328
+
329
+ ## [3.2.17](https://github.com/pie-framework/pie-elements/compare/@pie-element/drawing-response-configure@3.2.16...@pie-element/drawing-response-configure@3.2.17) (2022-03-08)
330
+
331
+ **Note:** Version bump only for package @pie-element/drawing-response-configure
332
+
333
+
334
+
335
+
336
+
337
+ ## [3.2.16](https://github.com/pie-framework/pie-elements/compare/@pie-element/drawing-response-configure@3.2.15...@pie-element/drawing-response-configure@3.2.16) (2022-03-08)
338
+
339
+ **Note:** Version bump only for package @pie-element/drawing-response-configure
340
+
341
+
342
+
343
+
344
+
345
+ ## [3.2.15](https://github.com/pie-framework/pie-elements/compare/@pie-element/drawing-response-configure@3.2.14...@pie-element/drawing-response-configure@3.2.15) (2022-02-21)
346
+
347
+ **Note:** Version bump only for package @pie-element/drawing-response-configure
348
+
349
+
350
+
351
+
352
+
353
+ ## [3.2.14](https://github.com/pie-framework/pie-elements/compare/@pie-element/drawing-response-configure@3.2.13...@pie-element/drawing-response-configure@3.2.14) (2022-02-04)
354
+
355
+ **Note:** Version bump only for package @pie-element/drawing-response-configure
356
+
357
+
358
+
359
+
360
+
361
+ ## [3.2.13](https://github.com/pie-framework/pie-elements/compare/@pie-element/drawing-response-configure@3.2.12...@pie-element/drawing-response-configure@3.2.13) (2022-01-24)
362
+
363
+ **Note:** Version bump only for package @pie-element/drawing-response-configure
364
+
365
+
366
+
367
+
368
+
369
+ ## [3.2.12](https://github.com/pie-framework/pie-elements/compare/@pie-element/drawing-response-configure@3.2.11...@pie-element/drawing-response-configure@3.2.12) (2022-01-10)
370
+
371
+ **Note:** Version bump only for package @pie-element/drawing-response-configure
372
+
373
+
374
+
375
+
376
+
377
+ ## [3.2.11](https://github.com/pie-framework/pie-elements/compare/@pie-element/drawing-response-configure@3.2.10...@pie-element/drawing-response-configure@3.2.11) (2021-12-23)
378
+
379
+ **Note:** Version bump only for package @pie-element/drawing-response-configure
380
+
381
+
382
+
383
+
384
+
385
+ ## [3.2.9](https://github.com/pie-framework/pie-elements/compare/@pie-element/drawing-response-configure@3.2.8...@pie-element/drawing-response-configure@3.2.9) (2021-12-13)
386
+
387
+ **Note:** Version bump only for package @pie-element/drawing-response-configure
388
+
389
+
390
+
391
+
392
+
393
+ ## [3.2.6](https://github.com/pie-framework/pie-elements/compare/@pie-element/drawing-response-configure@3.2.5...@pie-element/drawing-response-configure@3.2.6) (2021-11-29)
394
+
395
+ **Note:** Version bump only for package @pie-element/drawing-response-configure
396
+
397
+
398
+
399
+
400
+
401
+ ## [3.2.5](https://github.com/pie-framework/pie-elements/compare/@pie-element/drawing-response-configure@3.2.4...@pie-element/drawing-response-configure@3.2.5) (2021-10-04)
402
+
403
+ **Note:** Version bump only for package @pie-element/drawing-response-configure
404
+
405
+
406
+
407
+
408
+
409
+ ## [3.2.4](https://github.com/pie-framework/pie-elements/compare/@pie-element/drawing-response-configure@3.2.3...@pie-element/drawing-response-configure@3.2.4) (2021-09-20)
410
+
411
+
412
+ ### Bug Fixes
413
+
414
+ * pie-lib updates ([e521c2f](https://github.com/pie-framework/pie-elements/commit/e521c2f1a44aa7f3e14f82a1cee05ceb484ed0a6))
415
+ * Updated pie-lib versions ([2fe4c5d](https://github.com/pie-framework/pie-elements/commit/2fe4c5d0be2d40f5fdb34815855695a7f1087f56))
416
+ * Updated pie-lib versions ([1c23830](https://github.com/pie-framework/pie-elements/commit/1c23830fc75d1de5f7bb3bb16de3c665ae5fa350))
417
+
418
+
419
+
420
+
421
+
422
+ ## [3.2.3](https://github.com/pie-framework/pie-elements/compare/@pie-element/drawing-response-configure@3.2.2...@pie-element/drawing-response-configure@3.2.3) (2021-08-05)
423
+
424
+ **Note:** Version bump only for package @pie-element/drawing-response-configure
425
+
426
+
427
+
428
+
429
+
430
+ ## [3.2.2](https://github.com/pie-framework/pie-elements/compare/@pie-element/drawing-response-configure@3.2.0...@pie-element/drawing-response-configure@3.2.2) (2021-08-05)
431
+
432
+
433
+ ### Bug Fixes
434
+
435
+ * force bump ([5ea7295](https://github.com/pie-framework/pie-elements/commit/5ea7295e4755fbc492a76e7ec69e5fc35b196919))
436
+
437
+
438
+
439
+
440
+
441
+ # [3.2.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/drawing-response-configure@3.1.23...@pie-element/drawing-response-configure@3.2.0) (2021-06-29)
442
+
443
+
444
+ ### Features
445
+
446
+ * **drawing-response:** remove rationale PD-191 ([#597](https://github.com/pie-framework/pie-elements/issues/597)) ([3b52331](https://github.com/pie-framework/pie-elements/commit/3b52331ac843084e6d402daad3536627ab0ddf28))
447
+
448
+
449
+
450
+
451
+
6
452
  ## [3.1.23](https://github.com/pie-framework/pie-elements/compare/@pie-element/drawing-response-configure@3.1.22...@pie-element/drawing-response-configure@3.1.23) (2021-04-07)
7
453
 
8
454
  **Note:** Version bump only for package @pie-element/drawing-response-configure
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/button.jsx"],"names":["RawButton","classes","className","label","onClick","disabled","addButton","propTypes","PropTypes","object","isRequired","string","bool","func","defaultProps","styles","marginLeft","ButtonStyled"],"mappings":";;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AAEA,IAAMA,SAAS,GAAG,SAAZA,SAAY;AAAA,MAAGC,OAAH,QAAGA,OAAH;AAAA,MAAYC,SAAZ,QAAYA,SAAZ;AAAA,MAAuBC,KAAvB,QAAuBA,KAAvB;AAAA,MAA8BC,OAA9B,QAA8BA,OAA9B;AAAA,MAAuCC,QAAvC,QAAuCA,QAAvC;AAAA,sBAChB,gCAAC,kBAAD;AACE,IAAA,OAAO,EAAED,OADX;AAEE,IAAA,QAAQ,EAAEC,QAFZ;AAGE,IAAA,SAAS,EAAE,4BAAWJ,OAAO,CAACK,SAAnB,EAA8BJ,SAA9B,CAHb;AAIE,IAAA,IAAI,EAAC,OAJP;AAKE,IAAA,OAAO,EAAC,WALV;AAME,IAAA,KAAK,EAAC;AANR,KAQGC,KARH,CADgB;AAAA,CAAlB;;AAaAH,SAAS,CAACO,SAAV,GAAsB;AACpBN,EAAAA,OAAO,EAAEO,sBAAUC,MAAV,CAAiBC,UADN;AAEpBR,EAAAA,SAAS,EAAEM,sBAAUG,MAFD;AAGpBN,EAAAA,QAAQ,EAAEG,sBAAUI,IAHA;AAIpBT,EAAAA,KAAK,EAAEK,sBAAUG,MAJG;AAKpBP,EAAAA,OAAO,EAAEI,sBAAUK;AALC,CAAtB;AAQAb,SAAS,CAACc,YAAV,GAAyB;AACvBZ,EAAAA,SAAS,EAAE,EADY;AAEvBG,EAAAA,QAAQ,EAAE,KAFa;AAGvBF,EAAAA,KAAK,EAAE,KAHgB;AAIvBC,EAAAA,OAAO,EAAE,mBAAM,CAAE;AAJM,CAAzB;;AAOA,IAAMW,MAAM,GAAG,SAATA,MAAS;AAAA,SAAO;AACpBT,IAAAA,SAAS,EAAE;AACTU,MAAAA,UAAU,EAAE;AADH;AADS,GAAP;AAAA,CAAf;;AAMA,IAAMC,YAAY,GAAG,wBAAWF,MAAX,EAAmBf,SAAnB,CAArB;eAEeiB,Y","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { withStyles } from '@material-ui/core/styles';\nimport classNames from 'classnames';\nimport Button from '@material-ui/core/Button';\n\nconst RawButton = ({ classes, className, label, onClick, disabled }) => (\n <Button\n onClick={onClick}\n disabled={disabled}\n className={classNames(classes.addButton, className)}\n size=\"small\"\n variant=\"contained\"\n color=\"default\"\n >\n {label}\n </Button>\n);\n\nRawButton.propTypes = {\n classes: PropTypes.object.isRequired,\n className: PropTypes.string,\n disabled: PropTypes.bool,\n label: PropTypes.string,\n onClick: PropTypes.func\n};\n\nRawButton.defaultProps = {\n className: '',\n disabled: false,\n label: 'Add',\n onClick: () => {}\n};\n\nconst styles = () => ({\n addButton: {\n marginLeft: 8\n }\n});\n\nconst ButtonStyled = withStyles(styles)(RawButton);\n\nexport default ButtonStyled;\n"],"file":"button.js"}
1
+ {"version":3,"sources":["../src/button.jsx"],"names":["RawButton","classes","className","label","onClick","disabled","addButton","propTypes","PropTypes","object","isRequired","string","bool","func","defaultProps","styles","marginLeft","ButtonStyled"],"mappings":";;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AAEA,IAAMA,SAAS,GAAG,SAAZA,SAAY;AAAA,MAAGC,OAAH,QAAGA,OAAH;AAAA,MAAYC,SAAZ,QAAYA,SAAZ;AAAA,MAAuBC,KAAvB,QAAuBA,KAAvB;AAAA,MAA8BC,OAA9B,QAA8BA,OAA9B;AAAA,MAAuCC,QAAvC,QAAuCA,QAAvC;AAAA,sBAChB,gCAAC,kBAAD;AACE,IAAA,OAAO,EAAED,OADX;AAEE,IAAA,QAAQ,EAAEC,QAFZ;AAGE,IAAA,SAAS,EAAE,4BAAWJ,OAAO,CAACK,SAAnB,EAA8BJ,SAA9B,CAHb;AAIE,IAAA,IAAI,EAAC,OAJP;AAKE,IAAA,OAAO,EAAC,WALV;AAME,IAAA,KAAK,EAAC;AANR,KAQGC,KARH,CADgB;AAAA,CAAlB;;AAaAH,SAAS,CAACO,SAAV,GAAsB;AACpBN,EAAAA,OAAO,EAAEO,sBAAUC,MAAV,CAAiBC,UADN;AAEpBR,EAAAA,SAAS,EAAEM,sBAAUG,MAFD;AAGpBN,EAAAA,QAAQ,EAAEG,sBAAUI,IAHA;AAIpBT,EAAAA,KAAK,EAAEK,sBAAUG,MAJG;AAKpBP,EAAAA,OAAO,EAAEI,sBAAUK;AALC,CAAtB;AAQAb,SAAS,CAACc,YAAV,GAAyB;AACvBZ,EAAAA,SAAS,EAAE,EADY;AAEvBG,EAAAA,QAAQ,EAAE,KAFa;AAGvBF,EAAAA,KAAK,EAAE,KAHgB;AAIvBC,EAAAA,OAAO,EAAE,mBAAM,CAAE;AAJM,CAAzB;;AAOA,IAAMW,MAAM,GAAG,SAATA,MAAS;AAAA,SAAO;AACpBT,IAAAA,SAAS,EAAE;AACTU,MAAAA,UAAU,EAAE;AADH;AADS,GAAP;AAAA,CAAf;;AAMA,IAAMC,YAAY,GAAG,wBAAWF,MAAX,EAAmBf,SAAnB,CAArB;eAEeiB,Y","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { withStyles } from '@material-ui/core/styles';\nimport classNames from 'classnames';\nimport Button from '@material-ui/core/Button';\n\nconst RawButton = ({ classes, className, label, onClick, disabled }) => (\n <Button\n onClick={onClick}\n disabled={disabled}\n className={classNames(classes.addButton, className)}\n size=\"small\"\n variant=\"contained\"\n color=\"default\"\n >\n {label}\n </Button>\n);\n\nRawButton.propTypes = {\n classes: PropTypes.object.isRequired,\n className: PropTypes.string,\n disabled: PropTypes.bool,\n label: PropTypes.string,\n onClick: PropTypes.func,\n};\n\nRawButton.defaultProps = {\n className: '',\n disabled: false,\n label: 'Add',\n onClick: () => {},\n};\n\nconst styles = () => ({\n addButton: {\n marginLeft: 8,\n },\n});\n\nconst ButtonStyled = withStyles(styles)(RawButton);\n\nexport default ButtonStyled;\n"],"file":"button.js"}
@@ -12,28 +12,43 @@ var _default = {
12
12
  height: 0,
13
13
  width: 0
14
14
  },
15
- rationaleEnabled: true,
16
15
  promptEnabled: true,
17
16
  teacherInstructionsEnabled: true,
18
- studentInstructionsEnabled: true
17
+ studentInstructionsEnabled: true,
18
+ backgroundImageEnabled: true,
19
+ spellCheckEnabled: true,
20
+ toolbarEditorPosition: 'bottom'
19
21
  },
20
22
  configuration: {
21
- backgroundImage: {
22
- settings: true,
23
- label: 'Background Image',
23
+ spellCheck: {
24
+ label: 'Spellcheck',
25
+ settings: false,
24
26
  enabled: true
25
27
  },
26
- rationale: {
28
+ backgroundImage: {
27
29
  settings: true,
28
- label: 'Rationale'
30
+ label: 'Background Image'
29
31
  },
30
32
  prompt: {
31
33
  settings: true,
32
34
  label: 'Prompt'
33
35
  },
36
+ settingsPanelDisabled: false,
34
37
  teacherInstructions: {
35
38
  settings: true,
36
39
  label: 'Teacher Instructions'
40
+ },
41
+ maxImageWidth: {
42
+ teacherInstructions: 300,
43
+ prompt: 300
44
+ },
45
+ maxImageHeight: {
46
+ teacherInstructions: 300,
47
+ prompt: 300
48
+ },
49
+ withRubric: {
50
+ settings: false,
51
+ label: 'Add Rubric'
37
52
  }
38
53
  }
39
54
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/defaults.js"],"names":["model","prompt","imageUrl","imageDimensions","height","width","rationaleEnabled","promptEnabled","teacherInstructionsEnabled","studentInstructionsEnabled","configuration","backgroundImage","settings","label","enabled","rationale","teacherInstructions"],"mappings":";;;;;;eAAe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,MAAM,EAAE,6BADH;AAELC,IAAAA,QAAQ,EAAE,EAFL;AAGLC,IAAAA,eAAe,EAAE;AACfC,MAAAA,MAAM,EAAE,CADO;AAEfC,MAAAA,KAAK,EAAE;AAFQ,KAHZ;AAOLC,IAAAA,gBAAgB,EAAE,IAPb;AAQLC,IAAAA,aAAa,EAAE,IARV;AASLC,IAAAA,0BAA0B,EAAE,IATvB;AAULC,IAAAA,0BAA0B,EAAE;AAVvB,GADM;AAabC,EAAAA,aAAa,EAAE;AACbC,IAAAA,eAAe,EAAE;AACfC,MAAAA,QAAQ,EAAE,IADK;AAEfC,MAAAA,KAAK,EAAE,kBAFQ;AAGfC,MAAAA,OAAO,EAAE;AAHM,KADJ;AAMbC,IAAAA,SAAS,EAAE;AACTH,MAAAA,QAAQ,EAAE,IADD;AAETC,MAAAA,KAAK,EAAE;AAFE,KANE;AAUbZ,IAAAA,MAAM,EAAE;AACNW,MAAAA,QAAQ,EAAE,IADJ;AAENC,MAAAA,KAAK,EAAE;AAFD,KAVK;AAcbG,IAAAA,mBAAmB,EAAE;AACnBJ,MAAAA,QAAQ,EAAE,IADS;AAEnBC,MAAAA,KAAK,EAAE;AAFY;AAdR;AAbF,C","sourcesContent":["export default {\n model: {\n prompt: 'This is the question prompt',\n imageUrl: '',\n imageDimensions: {\n height: 0,\n width: 0\n },\n rationaleEnabled: true,\n promptEnabled: true,\n teacherInstructionsEnabled: true,\n studentInstructionsEnabled: true,\n },\n configuration: {\n backgroundImage: {\n settings: true,\n label: 'Background Image',\n enabled: true\n },\n rationale: {\n settings: true,\n label: 'Rationale'\n },\n prompt: {\n settings: true,\n label: 'Prompt'\n },\n teacherInstructions: {\n settings: true,\n label: 'Teacher Instructions',\n }\n }\n};\n"],"file":"defaults.js"}
1
+ {"version":3,"sources":["../src/defaults.js"],"names":["model","prompt","imageUrl","imageDimensions","height","width","promptEnabled","teacherInstructionsEnabled","studentInstructionsEnabled","backgroundImageEnabled","spellCheckEnabled","toolbarEditorPosition","configuration","spellCheck","label","settings","enabled","backgroundImage","settingsPanelDisabled","teacherInstructions","maxImageWidth","maxImageHeight","withRubric"],"mappings":";;;;;;eAAe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,MAAM,EAAE,6BADH;AAELC,IAAAA,QAAQ,EAAE,EAFL;AAGLC,IAAAA,eAAe,EAAE;AACfC,MAAAA,MAAM,EAAE,CADO;AAEfC,MAAAA,KAAK,EAAE;AAFQ,KAHZ;AAOLC,IAAAA,aAAa,EAAE,IAPV;AAQLC,IAAAA,0BAA0B,EAAE,IARvB;AASLC,IAAAA,0BAA0B,EAAE,IATvB;AAULC,IAAAA,sBAAsB,EAAE,IAVnB;AAWLC,IAAAA,iBAAiB,EAAE,IAXd;AAYLC,IAAAA,qBAAqB,EAAE;AAZlB,GADM;AAebC,EAAAA,aAAa,EAAE;AACbC,IAAAA,UAAU,EAAE;AACVC,MAAAA,KAAK,EAAE,YADG;AAEVC,MAAAA,QAAQ,EAAE,KAFA;AAGVC,MAAAA,OAAO,EAAE;AAHC,KADC;AAMbC,IAAAA,eAAe,EAAE;AACfF,MAAAA,QAAQ,EAAE,IADK;AAEfD,MAAAA,KAAK,EAAE;AAFQ,KANJ;AAUbb,IAAAA,MAAM,EAAE;AACNc,MAAAA,QAAQ,EAAE,IADJ;AAEND,MAAAA,KAAK,EAAE;AAFD,KAVK;AAcbI,IAAAA,qBAAqB,EAAE,KAdV;AAebC,IAAAA,mBAAmB,EAAE;AACnBJ,MAAAA,QAAQ,EAAE,IADS;AAEnBD,MAAAA,KAAK,EAAE;AAFY,KAfR;AAmBbM,IAAAA,aAAa,EAAE;AACbD,MAAAA,mBAAmB,EAAE,GADR;AAEblB,MAAAA,MAAM,EAAE;AAFK,KAnBF;AAuBboB,IAAAA,cAAc,EAAE;AACdF,MAAAA,mBAAmB,EAAE,GADP;AAEdlB,MAAAA,MAAM,EAAE;AAFM,KAvBH;AA2BbqB,IAAAA,UAAU,EAAE;AACVP,MAAAA,QAAQ,EAAE,KADA;AAEVD,MAAAA,KAAK,EAAE;AAFG;AA3BC;AAfF,C","sourcesContent":["export default {\n model: {\n prompt: 'This is the question prompt',\n imageUrl: '',\n imageDimensions: {\n height: 0,\n width: 0,\n },\n promptEnabled: true,\n teacherInstructionsEnabled: true,\n studentInstructionsEnabled: true,\n backgroundImageEnabled: true,\n spellCheckEnabled: true,\n toolbarEditorPosition: 'bottom',\n },\n configuration: {\n spellCheck: {\n label: 'Spellcheck',\n settings: false,\n enabled: true,\n },\n backgroundImage: {\n settings: true,\n label: 'Background Image',\n },\n prompt: {\n settings: true,\n label: 'Prompt',\n },\n settingsPanelDisabled: false,\n teacherInstructions: {\n settings: true,\n label: 'Teacher Instructions',\n },\n maxImageWidth: {\n teacherInstructions: 300,\n prompt: 300,\n },\n maxImageHeight: {\n teacherInstructions: 300,\n prompt: 300,\n },\n withRubric: {\n settings: false,\n label: 'Add Rubric',\n },\n },\n};\n"],"file":"defaults.js"}
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
4
-
5
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
6
4
 
5
+ var _typeof = require("@babel/runtime/helpers/typeof");
6
+
7
7
  Object.defineProperty(exports, "__esModule", {
8
8
  value: true
9
9
  });
@@ -33,9 +33,13 @@ var _styles = require("@material-ui/core/styles");
33
33
 
34
34
  var _button = _interopRequireDefault(require("./button"));
35
35
 
36
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
37
+
38
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
39
+
36
40
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
37
41
 
38
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
42
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
39
43
 
40
44
  var isImage = function isImage(file) {
41
45
  var imageType = /image.*/;
@@ -125,13 +129,23 @@ var ImageContainer = /*#__PURE__*/function (_Component) {
125
129
  (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handleOnImageLoad", function (_ref) {
126
130
  var _ref$target = _ref.target,
127
131
  offsetHeight = _ref$target.offsetHeight,
128
- offsetWidth = _ref$target.offsetWidth;
129
- var onUpdateImageDimension = _this.props.onUpdateImageDimension;
132
+ offsetWidth = _ref$target.offsetWidth,
133
+ naturalHeight = _ref$target.naturalHeight,
134
+ naturalWidth = _ref$target.naturalWidth;
135
+ var _this$props = _this.props,
136
+ onUpdateImageDimension = _this$props.onUpdateImageDimension,
137
+ imageDimensions = _this$props.imageDimensions;
130
138
  var resizeHandle = _this.resize;
131
139
  var dimensions = {
132
- height: offsetHeight,
133
- width: offsetWidth
134
- };
140
+ height: imageDimensions && imageDimensions.height || offsetHeight || naturalHeight,
141
+ width: imageDimensions && imageDimensions.width || offsetWidth || naturalWidth
142
+ }; // check if aspect ratio is not respected on replacing image
143
+
144
+ var imageAspectRatio = naturalWidth / naturalHeight;
145
+
146
+ if (dimensions.width !== dimensions.height * imageAspectRatio) {
147
+ dimensions.width = dimensions.height * imageAspectRatio;
148
+ }
135
149
 
136
150
  _this.setState({
137
151
  dimensions: dimensions
@@ -156,21 +170,25 @@ var ImageContainer = /*#__PURE__*/function (_Component) {
156
170
  });
157
171
  (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "startResizing", function (e) {
158
172
  var box = _this.image;
159
- var maxImageWidth = _this.state.maxImageWidth;
173
+ var _this$state = _this.state,
174
+ maxImageWidth = _this$state.maxImageWidth,
175
+ maxImageHeight = _this$state.maxImageHeight,
176
+ dimensions = _this$state.dimensions;
160
177
  var bounds = e.target.getBoundingClientRect();
161
178
  var x = e.clientX - bounds.left;
162
179
  var y = e.clientY - bounds.top;
163
- var fitsContainer = x <= maxImageWidth + 5;
180
+ var imageAspectRatio = dimensions.width / dimensions.height;
181
+ var fitsContainer = x <= maxImageWidth + 5 && x / imageAspectRatio <= maxImageHeight + 5;
164
182
  var hasMinimumWidth = x > 150 && y > 150;
165
183
 
166
- if (fitsContainer && hasMinimumWidth) {
184
+ if (fitsContainer && hasMinimumWidth && box) {
167
185
  box.style.width = "".concat(x, "px");
168
- box.style.height = "".concat(y, "px");
186
+ box.style.height = "".concat(x / imageAspectRatio, "px");
169
187
 
170
188
  _this.setState({
171
189
  dimensions: {
172
- height: y,
173
- width: x
190
+ width: x,
191
+ height: x / imageAspectRatio
174
192
  }
175
193
  });
176
194
  }
@@ -178,8 +196,8 @@ var ImageContainer = /*#__PURE__*/function (_Component) {
178
196
  _this.handleDisableDrag();
179
197
  });
180
198
  _this.state = {
181
- maxImageWidth: 0,
182
- maxImageHeight: 0,
199
+ maxImageWidth: '100%',
200
+ maxImageHeight: 'auto',
183
201
  dragEnabled: true,
184
202
  dropzoneActive: false
185
203
  };
@@ -223,14 +241,15 @@ var ImageContainer = /*#__PURE__*/function (_Component) {
223
241
  value: function render() {
224
242
  var _this3 = this;
225
243
 
226
- var _this$props = this.props,
227
- classes = _this$props.classes,
228
- imageUrl = _this$props.imageUrl;
229
- var _this$state = this.state,
230
- dropzoneActive = _this$state.dropzoneActive,
231
- dragEnabled = _this$state.dragEnabled,
232
- maxImageHeight = _this$state.maxImageHeight,
233
- maxImageWidth = _this$state.maxImageWidth;
244
+ var _this$props2 = this.props,
245
+ classes = _this$props2.classes,
246
+ imageUrl = _this$props2.imageUrl,
247
+ imageDimensions = _this$props2.imageDimensions;
248
+ var _this$state2 = this.state,
249
+ dropzoneActive = _this$state2.dropzoneActive,
250
+ dragEnabled = _this$state2.dragEnabled,
251
+ maxImageHeight = _this$state2.maxImageHeight,
252
+ maxImageWidth = _this$state2.maxImageWidth;
234
253
  return /*#__PURE__*/_react["default"].createElement("div", {
235
254
  className: classes.base
236
255
  }, /*#__PURE__*/_react["default"].createElement("div", (0, _extends2["default"])({
@@ -258,6 +277,7 @@ var ImageContainer = /*#__PURE__*/function (_Component) {
258
277
  },
259
278
  src: imageUrl,
260
279
  style: {
280
+ width: imageDimensions && imageDimensions.width ? imageDimensions.width : undefined,
261
281
  maxWidth: maxImageWidth,
262
282
  maxHeight: maxImageHeight
263
283
  },