@pie-lib/editable-html 7.17.4-next.50 → 7.17.4-next.526

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 (98) hide show
  1. package/CHANGELOG.json +165 -0
  2. package/CHANGELOG.md +421 -0
  3. package/lib/editor.js +391 -174
  4. package/lib/editor.js.map +1 -1
  5. package/lib/index.js +66 -53
  6. package/lib/index.js.map +1 -1
  7. package/lib/parse-html.js.map +1 -1
  8. package/lib/plugins/characters/custom-popper.js +73 -0
  9. package/lib/plugins/characters/custom-popper.js.map +1 -0
  10. package/lib/plugins/characters/index.js +285 -0
  11. package/lib/plugins/characters/index.js.map +1 -0
  12. package/lib/plugins/characters/utils.js +381 -0
  13. package/lib/plugins/characters/utils.js.map +1 -0
  14. package/lib/plugins/image/alt-dialog.js +119 -0
  15. package/lib/plugins/image/alt-dialog.js.map +1 -0
  16. package/lib/plugins/image/component.js +253 -77
  17. package/lib/plugins/image/component.js.map +1 -1
  18. package/lib/plugins/image/image-toolbar.js +95 -61
  19. package/lib/plugins/image/image-toolbar.js.map +1 -1
  20. package/lib/plugins/image/index.js +62 -20
  21. package/lib/plugins/image/index.js.map +1 -1
  22. package/lib/plugins/image/insert-image-handler.js +9 -15
  23. package/lib/plugins/image/insert-image-handler.js.map +1 -1
  24. package/lib/plugins/index.js +20 -12
  25. package/lib/plugins/index.js.map +1 -1
  26. package/lib/plugins/list/index.js +82 -14
  27. package/lib/plugins/list/index.js.map +1 -1
  28. package/lib/plugins/math/index.js +50 -55
  29. package/lib/plugins/math/index.js.map +1 -1
  30. package/lib/plugins/media/index.js +26 -25
  31. package/lib/plugins/media/index.js.map +1 -1
  32. package/lib/plugins/media/media-dialog.js +45 -56
  33. package/lib/plugins/media/media-dialog.js.map +1 -1
  34. package/lib/plugins/media/media-toolbar.js +24 -30
  35. package/lib/plugins/media/media-toolbar.js.map +1 -1
  36. package/lib/plugins/media/media-wrapper.js +28 -35
  37. package/lib/plugins/media/media-wrapper.js.map +1 -1
  38. package/lib/plugins/respArea/drag-in-the-blank/choice.js +68 -46
  39. package/lib/plugins/respArea/drag-in-the-blank/choice.js.map +1 -1
  40. package/lib/plugins/respArea/drag-in-the-blank/index.js +12 -12
  41. package/lib/plugins/respArea/drag-in-the-blank/index.js.map +1 -1
  42. package/lib/plugins/respArea/explicit-constructed-response/index.js +10 -9
  43. package/lib/plugins/respArea/explicit-constructed-response/index.js.map +1 -1
  44. package/lib/plugins/respArea/icons/index.js +11 -11
  45. package/lib/plugins/respArea/icons/index.js.map +1 -1
  46. package/lib/plugins/respArea/index.js +58 -42
  47. package/lib/plugins/respArea/index.js.map +1 -1
  48. package/lib/plugins/respArea/inline-dropdown/index.js +8 -8
  49. package/lib/plugins/respArea/inline-dropdown/index.js.map +1 -1
  50. package/lib/plugins/respArea/utils.js +5 -5
  51. package/lib/plugins/respArea/utils.js.map +1 -1
  52. package/lib/plugins/table/icons/index.js +12 -12
  53. package/lib/plugins/table/icons/index.js.map +1 -1
  54. package/lib/plugins/table/index.js +83 -27
  55. package/lib/plugins/table/index.js.map +1 -1
  56. package/lib/plugins/table/table-toolbar.js +41 -50
  57. package/lib/plugins/table/table-toolbar.js.map +1 -1
  58. package/lib/plugins/toolbar/default-toolbar.js +19 -13
  59. package/lib/plugins/toolbar/default-toolbar.js.map +1 -1
  60. package/lib/plugins/toolbar/done-button.js +5 -5
  61. package/lib/plugins/toolbar/done-button.js.map +1 -1
  62. package/lib/plugins/toolbar/editor-and-toolbar.js +55 -45
  63. package/lib/plugins/toolbar/editor-and-toolbar.js.map +1 -1
  64. package/lib/plugins/toolbar/index.js +5 -5
  65. package/lib/plugins/toolbar/index.js.map +1 -1
  66. package/lib/plugins/toolbar/toolbar-buttons.js +49 -52
  67. package/lib/plugins/toolbar/toolbar-buttons.js.map +1 -1
  68. package/lib/plugins/toolbar/toolbar.js +69 -63
  69. package/lib/plugins/toolbar/toolbar.js.map +1 -1
  70. package/lib/plugins/utils.js +1 -1
  71. package/lib/plugins/utils.js.map +1 -1
  72. package/lib/serialization.js +32 -9
  73. package/lib/serialization.js.map +1 -1
  74. package/lib/theme.js.map +1 -1
  75. package/package.json +7 -6
  76. package/src/editor.jsx +225 -26
  77. package/src/index.jsx +22 -5
  78. package/src/plugins/characters/custom-popper.js +48 -0
  79. package/src/plugins/characters/index.jsx +268 -0
  80. package/src/plugins/characters/utils.js +447 -0
  81. package/src/plugins/image/alt-dialog.jsx +69 -0
  82. package/src/plugins/image/component.jsx +204 -21
  83. package/src/plugins/image/image-toolbar.jsx +68 -22
  84. package/src/plugins/image/index.jsx +47 -9
  85. package/src/plugins/index.jsx +4 -1
  86. package/src/plugins/list/index.jsx +67 -5
  87. package/src/plugins/math/index.jsx +31 -37
  88. package/src/plugins/media/index.jsx +3 -0
  89. package/src/plugins/media/media-dialog.js +1 -1
  90. package/src/plugins/respArea/drag-in-the-blank/choice.jsx +28 -1
  91. package/src/plugins/respArea/explicit-constructed-response/index.jsx +3 -3
  92. package/src/plugins/respArea/index.jsx +50 -31
  93. package/src/plugins/table/index.jsx +63 -14
  94. package/src/plugins/toolbar/default-toolbar.jsx +20 -2
  95. package/src/plugins/toolbar/editor-and-toolbar.jsx +39 -5
  96. package/src/plugins/toolbar/toolbar-buttons.jsx +13 -2
  97. package/src/plugins/toolbar/toolbar.jsx +22 -4
  98. package/src/serialization.jsx +19 -3
@@ -0,0 +1,447 @@
1
+ export const spanishConfig = {
2
+ characters: [
3
+ ['á', 'é', 'í', 'ó', 'ú'],
4
+ ['Á', 'É', 'Í', 'Ó', 'Ú'],
5
+ ['—', '«', '»', 'ñ', 'ü'],
6
+ ['-', '¿', '¡', 'Ñ', 'Ü']
7
+ ]
8
+ };
9
+
10
+ export const specialConfig = {
11
+ hasPreview: true,
12
+ characters: [
13
+ [
14
+ {
15
+ unicode: 'U+00A2',
16
+ description: 'CENT SIGN',
17
+ write: '¢',
18
+ label: '¢'
19
+ },
20
+ {
21
+ unicode: 'U+00BF',
22
+ description: 'INVERTED QUESTION MARK',
23
+ write: '¿',
24
+ label: '¿'
25
+ },
26
+ {
27
+ unicode: 'U+00B4',
28
+ description: 'ACUTE ACCENT',
29
+ write: '´',
30
+ label: '´',
31
+ extraProps: { style: { gridRow: 'span 2' } }
32
+ },
33
+ {
34
+ unicode: 'U+00E1',
35
+ description: 'LATIN SMALL LETTER A WITH ACUTE',
36
+ write: 'á',
37
+ label: 'á'
38
+ },
39
+ {
40
+ unicode: 'U+00E9',
41
+ description: 'LATIN SMALL LETTER E WITH ACUTE',
42
+ write: 'é',
43
+ label: 'é'
44
+ },
45
+ {
46
+ unicode: 'U+00ED',
47
+ description: 'LATIN SMALL LETTER I WITH ACUTE',
48
+ write: 'í',
49
+ label: 'í'
50
+ },
51
+ {
52
+ unicode: 'U+00F3',
53
+ description: 'LATIN SMALL LETTER O WITH ACUTE',
54
+ write: 'ó',
55
+ label: 'ó'
56
+ },
57
+ {
58
+ unicode: 'U+00FA',
59
+ description: 'LATIN SMALL LETTER U WITH ACUTE',
60
+ write: 'ú',
61
+ label: 'ú'
62
+ },
63
+ {
64
+ unicode: 'U+00F1',
65
+ description: 'LATIN SMALL LETTER N WITH TILDE',
66
+ write: 'ñ',
67
+ label: 'ñ'
68
+ }
69
+ ],
70
+ [
71
+ {
72
+ unicode: 'U+20AC',
73
+ description: 'EURO SIGN',
74
+ write: '€',
75
+ label: '€'
76
+ },
77
+ {
78
+ unicode: 'U+00A1',
79
+ description: 'INVERTED EXCLAMATION MARK',
80
+ write: '¡',
81
+ label: '¡'
82
+ },
83
+ {
84
+ unicode: 'U+00C1',
85
+ description: 'LATIN CAPITAL LETTER A WITH ACUTE',
86
+ write: 'Á',
87
+ label: 'Á'
88
+ },
89
+ {
90
+ unicode: 'U+00C9',
91
+ description: 'LATIN CAPITAL LETTER E WITH ACUTE',
92
+ write: 'É',
93
+ label: 'É'
94
+ },
95
+ {
96
+ unicode: 'U+00CD',
97
+ description: 'LATIN CAPITAL LETTER I WITH ACUTE',
98
+ write: 'Í',
99
+ label: 'Í'
100
+ },
101
+ {
102
+ unicode: 'U+00D3',
103
+ description: 'LATIN CAPITAL LETTER O WITH ACUTE',
104
+ write: 'Ó',
105
+ label: 'Ó'
106
+ },
107
+ {
108
+ unicode: 'U+00DA',
109
+ description: 'LATIN CAPITAL LETTER U WITH ACUTE',
110
+ write: 'Ú',
111
+ label: 'Ú'
112
+ },
113
+ {
114
+ unicode: 'U+00D1',
115
+ description: 'LATIN CAPITAL LETTER N WITH TILDE',
116
+ write: 'Ñ',
117
+ label: 'Ñ'
118
+ }
119
+ ],
120
+ [
121
+ {
122
+ unicode: 'U+00A3',
123
+ description: 'POUND SIGN',
124
+ write: '£',
125
+ label: '£'
126
+ },
127
+ {
128
+ unicode: 'U+00AB',
129
+ description: 'LEFT-POINTING DOUBLE ANGLE QUOTATION MARK',
130
+ write: '«',
131
+ label: '«'
132
+ },
133
+ {
134
+ unicode: 'U+005E',
135
+ description: 'CIRCUMFLEX ACCENT',
136
+ write: '^',
137
+ label: '^',
138
+ extraProps: { style: { gridRow: 'span 2' } }
139
+ },
140
+ {
141
+ unicode: 'U+00E2',
142
+ description: 'LATIN SMALL LETTER A WITH CIRCUMFLEX',
143
+ write: 'â',
144
+ label: 'â'
145
+ },
146
+ {
147
+ unicode: 'U+00EA',
148
+ description: 'LATIN SMALL LETTER E WITH CIRCUMFLEX',
149
+ write: 'ê',
150
+ label: 'ê'
151
+ },
152
+ {
153
+ unicode: 'U+00EE',
154
+ description: 'LATIN SMALL LETTER I WITH CIRCUMFLEX',
155
+ write: 'î',
156
+ label: 'î'
157
+ },
158
+ {
159
+ unicode: 'U+00F4',
160
+ description: 'LATIN SMALL LETTER O WITH CIRCUMFLEX',
161
+ write: 'ô',
162
+ label: 'ô'
163
+ },
164
+ {
165
+ unicode: 'U+00FB',
166
+ description: 'LATIN SMALL LETTER U WITH CIRCUMFLEX',
167
+ write: 'û',
168
+ label: 'û'
169
+ },
170
+ {
171
+ unicode: 'U+00E7',
172
+ description: 'LATIN SMALL LETTER C WITH CEDILLA',
173
+ write: 'ç',
174
+ label: 'ç'
175
+ }
176
+ ],
177
+ [
178
+ {
179
+ unicode: 'U+00A5',
180
+ description: 'YEN SIGN',
181
+ write: '¥',
182
+ label: '¥'
183
+ },
184
+ {
185
+ unicode: 'U+00BB',
186
+ description: 'RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK',
187
+ write: '»',
188
+ label: '»'
189
+ },
190
+ {
191
+ unicode: 'U+00C2',
192
+ description: 'LATIN CAPITAL LETTER A WITH CIRCUMFLEX',
193
+ write: 'Â',
194
+ label: 'Â'
195
+ },
196
+ {
197
+ unicode: 'U+00CA',
198
+ description: 'LATIN CAPITAL LETTER E WITH CIRCUMFLEX',
199
+ write: 'Ê',
200
+ label: 'Ê'
201
+ },
202
+ {
203
+ unicode: 'U+00CE',
204
+ description: 'LATIN CAPITAL LETTER I WITH CIRCUMFLEX',
205
+ write: 'Î',
206
+ label: 'Î'
207
+ },
208
+ {
209
+ unicode: 'U+00D4',
210
+ description: 'LATIN CAPITAL LETTER O WITH CIRCUMFLEX',
211
+ write: 'Ô',
212
+ label: 'Ô'
213
+ },
214
+ {
215
+ unicode: 'U+00DB',
216
+ description: 'LATIN CAPITAL LETTER U WITH CIRCUMFLEX',
217
+ write: 'Û',
218
+ label: 'Û'
219
+ },
220
+ {
221
+ unicode: 'U+00C7',
222
+ description: 'LATIN CAPITAL LETTER C WITH CEDILLA',
223
+ write: 'Ç',
224
+ label: 'Ç'
225
+ }
226
+ ],
227
+ [
228
+ {
229
+ unicode: 'U+00A0',
230
+ description: 'NO-BREAK SPACE',
231
+ write: String.fromCodePoint('0x00A0'),
232
+ label: ' '
233
+ },
234
+ {
235
+ unicode: 'U+00A7',
236
+ description: 'SECTION SIGN',
237
+ write: '§',
238
+ label: '§'
239
+ },
240
+ {
241
+ unicode: 'U+00A8',
242
+ description: 'DIAERESIS',
243
+ write: '¨',
244
+ label: '¨',
245
+ extraProps: { style: { gridRow: 'span 2' } }
246
+ },
247
+ {
248
+ unicode: 'U+00E4',
249
+ description: 'LATIN SMALL LETTER A WITH DIAERESIS',
250
+ write: 'ä',
251
+ label: 'ä'
252
+ },
253
+ {
254
+ unicode: 'U+00EB',
255
+ description: 'LATIN SMALL LETTER E WITH DIAERESIS',
256
+ write: 'ë',
257
+ label: 'ë'
258
+ },
259
+ {
260
+ unicode: 'U+00EF',
261
+ description: 'LATIN SMALL LETTER I WITH DIAERESIS',
262
+ write: 'ï',
263
+ label: 'ï'
264
+ },
265
+ {
266
+ unicode: 'U+00F6',
267
+ description: 'LATIN SMALL LETTER O WITH DIAERESIS',
268
+ write: 'ö',
269
+ label: 'ö'
270
+ },
271
+ {
272
+ unicode: 'U+00FC',
273
+ description: 'LATIN SMALL LETTER U WITH DIAERESIS',
274
+ write: 'ü',
275
+ label: 'ü'
276
+ },
277
+ {
278
+ unicode: 'U+00DF',
279
+ description: 'LATIN SMALL LETTER SHARP S',
280
+ write: 'ß',
281
+ label: 'ß'
282
+ }
283
+ ],
284
+ [
285
+ {
286
+ unicode: 'U+2009',
287
+ description: 'THIN SPACE',
288
+ write: String.fromCodePoint('0x2009'),
289
+ label: ' '
290
+ },
291
+ {
292
+ unicode: 'U+2026',
293
+ description: 'HORIZONTAL ELLIPSIS',
294
+ write: '…',
295
+ label: '…'
296
+ },
297
+ {
298
+ unicode: 'U+00C4',
299
+ description: 'LATIN CAPITAL LETTER A WITH DIAERESIS',
300
+ write: 'Ä',
301
+ label: 'Ä'
302
+ },
303
+ {
304
+ unicode: 'U+00CB',
305
+ description: 'LATIN CAPITAL LETTER E WITH DIAERESIS',
306
+ write: 'Ë',
307
+ label: 'Ë'
308
+ },
309
+ {
310
+ unicode: 'U+00CF',
311
+ description: 'LATIN CAPITAL LETTER I WITH DIAERESIS',
312
+ write: 'Ï',
313
+ label: 'Ï'
314
+ },
315
+ {
316
+ unicode: 'U+00D6',
317
+ description: 'LATIN CAPITAL LETTER O WITH DIAERESIS',
318
+ write: 'Ö',
319
+ label: 'Ö'
320
+ },
321
+ {
322
+ unicode: 'U+00DC',
323
+ description: 'LATIN CAPITAL LETTER U WITH DIAERESIS',
324
+ write: 'Ü',
325
+ label: 'Ü'
326
+ },
327
+ {
328
+ unicode: 'U+2212',
329
+ description: 'MINUS SIGN',
330
+ write: '−',
331
+ label: '−'
332
+ }
333
+ ],
334
+ [
335
+ {
336
+ unicode: 'U+200A',
337
+ description: 'HAIR SPACE',
338
+ write: String.fromCodePoint('0x200A'),
339
+ label: ' '
340
+ },
341
+ {
342
+ unicode: 'U+2022',
343
+ description: 'BULLET',
344
+ write: '•',
345
+ label: '•'
346
+ },
347
+ {
348
+ unicode: 'U+0060',
349
+ description: 'GRAVE ACCENT',
350
+ write: '`',
351
+ label: '`',
352
+ extraProps: { style: { gridRow: 'span 2' } }
353
+ },
354
+ {
355
+ unicode: 'U+00E0',
356
+ description: 'LATIN SMALL LETTER A WITH GRAVE',
357
+ write: 'à',
358
+ label: 'à'
359
+ },
360
+ {
361
+ unicode: 'U+00E8',
362
+ description: 'LATIN SMALL LETTER E WITH GRAVE',
363
+ write: 'è',
364
+ label: 'è'
365
+ },
366
+ {
367
+ unicode: 'U+00EC',
368
+ description: 'LATIN SMALL LETTER I WITH GRAVE',
369
+ write: 'ì',
370
+ label: 'ì'
371
+ },
372
+ {
373
+ unicode: 'U+00F2',
374
+ description: 'LATIN SMALL LETTER O WITH GRAVE',
375
+ write: 'ò',
376
+ label: 'ò'
377
+ },
378
+ {
379
+ unicode: 'U+00F9',
380
+ description: 'LATIN SMALL LETTER U WITH GRAVE',
381
+ write: 'ù',
382
+ label: 'ù'
383
+ },
384
+ {
385
+ unicode: 'U+2013',
386
+ description: 'EN DASH',
387
+ write: '–',
388
+ label: '–'
389
+ }
390
+ ],
391
+ [
392
+ {
393
+ unicode: 'U+0009',
394
+ description: 'TAB',
395
+ write: String.fromCodePoint('0x0009'),
396
+ label: 'TAB'
397
+ },
398
+ {
399
+ unicode: 'U+25E6',
400
+ description: 'WHITE BULLET',
401
+ write: '◦',
402
+ label: '◦'
403
+ },
404
+ {
405
+ unicode: 'U+00C0',
406
+ description: 'LATIN CAPITAL LETTER A WITH GRAVE',
407
+ write: 'À',
408
+ label: 'À'
409
+ },
410
+ {
411
+ unicode: 'U+00C8',
412
+ description: 'LATIN CAPITAL LETTER E WITH GRAVE',
413
+ write: 'È',
414
+ label: 'È'
415
+ },
416
+ {
417
+ unicode: 'U+00CC',
418
+ description: 'LATIN CAPITAL LETTER I WITH GRAVE',
419
+ write: 'Ì',
420
+ label: 'Ì'
421
+ },
422
+ {
423
+ unicode: 'U+00D2',
424
+ description: 'LATIN CAPITAL LETTER O WITH GRAVE',
425
+ write: 'Ò',
426
+ label: 'Ò'
427
+ },
428
+ {
429
+ unicode: 'U+00D9',
430
+ description: 'LATIN CAPITAL LETTER U WITH GRAVE',
431
+ write: 'Ù',
432
+ label: 'Ù'
433
+ },
434
+ {
435
+ unicode: 'U+2014',
436
+ description: 'EM DASH',
437
+ write: '—',
438
+ label: '—'
439
+ }
440
+ ]
441
+ ]
442
+ };
443
+
444
+ export const characterIcons = {
445
+ spanish: 'ñ',
446
+ special: '€'
447
+ };
@@ -0,0 +1,69 @@
1
+ import React from 'react';
2
+ import DialogContent from '@material-ui/core/DialogContent';
3
+ import ArrowBackIos from '@material-ui/icons/ArrowBackIos';
4
+ import TextField from '@material-ui/core/TextField';
5
+ import DialogActions from '@material-ui/core/DialogActions';
6
+ import Button from '@material-ui/core/Button';
7
+ import Dialog from '@material-ui/core/Dialog';
8
+ import PropTypes from "prop-types";
9
+
10
+ export class AltDialog extends React.Component {
11
+ static propTypes = {
12
+ onDone: PropTypes.func.isRequired,
13
+ alt: PropTypes.string
14
+ };
15
+
16
+ constructor(props) {
17
+ super(props);
18
+
19
+ const { alt } = props;
20
+
21
+ this.state = {
22
+ value: alt
23
+ };
24
+ }
25
+
26
+ closeDialog = () => {
27
+ const allDialogs = document.querySelectorAll('#text-dialog');
28
+
29
+ allDialogs.forEach(function(s) {
30
+ return s.remove();
31
+ });
32
+ };
33
+
34
+ onDone = () => {
35
+ const { onDone } = this.props;
36
+ const { value } = this.state;
37
+
38
+ onDone(value);
39
+ this.closeDialog();
40
+ };
41
+
42
+ render() {
43
+ const { value } = this.state;
44
+
45
+ return (
46
+ <Dialog open disablePortal onClose={this.closeDialog} id="text-dialog" hideBackdrop>
47
+ <DialogContent>
48
+ <div style={{ display: 'flex' }}>
49
+ <ArrowBackIos style={{ paddingTop: '6px' }} />
50
+ <TextField
51
+ multiline
52
+ placeholder={'Enter an Alt Text description of this image'}
53
+ helperText={
54
+ 'Users with visual limitations rely on Alt Text, since screen readers cannot otherwise describe the contents of an image.'
55
+ }
56
+ value={value}
57
+ onChange={event => this.setState({ value: event.target.value })}
58
+ />
59
+ </div>
60
+ </DialogContent>
61
+ <DialogActions>
62
+ <Button onClick={this.onDone}>Done</Button>
63
+ </DialogActions>
64
+ </Dialog>
65
+ );
66
+ }
67
+ }
68
+
69
+ export default AltDialog;