@contentful/field-editor-markdown 0.17.0 → 1.0.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.
- package/CHANGELOG.md +32 -162
- package/README.md +0 -1
- package/dist/components/HeadingSelector.d.ts +1 -0
- package/dist/components/icons.d.ts +0 -9
- package/dist/field-editor-markdown.cjs.development.js +334 -571
- package/dist/field-editor-markdown.cjs.development.js.map +1 -1
- package/dist/field-editor-markdown.cjs.production.min.js +1 -1
- package/dist/field-editor-markdown.cjs.production.min.js.map +1 -1
- package/dist/field-editor-markdown.esm.js +325 -562
- package/dist/field-editor-markdown.esm.js.map +1 -1
- package/package.json +7 -6
|
@@ -3,12 +3,12 @@ import 'codemirror/mode/xml/xml';
|
|
|
3
3
|
import 'codemirror/addon/edit/continuelist';
|
|
4
4
|
import 'codemirror/addon/mode/overlay';
|
|
5
5
|
import 'codemirror/addon/display/autorefresh';
|
|
6
|
-
import React, {
|
|
6
|
+
import React, { useRef, useState, useEffect } from 'react';
|
|
7
7
|
import { css, cx } from 'emotion';
|
|
8
|
-
import tokens from '@contentful/
|
|
8
|
+
import tokens from '@contentful/f36-tokens';
|
|
9
9
|
import { ConstraintsUtils, CharCounter, CharValidation, FieldConnector, ModalDialogLauncher } from '@contentful/field-editor-shared';
|
|
10
|
-
import
|
|
11
|
-
import {
|
|
10
|
+
import { Menu, Button, Tooltip, Flex, Paragraph, TextLink, ModalContent, Heading, Form, FormControl, TextInput, ModalControls, Text, Radio, Checkbox, EntityList } from '@contentful/f36-components';
|
|
11
|
+
import { AssetIcon, ChevronDownIcon, MoreHorizontalIcon, HeadingIcon, FormatBoldIcon, FormatItalicIcon, QuoteIcon, ListBulletedIcon, ListNumberedIcon, LinkIcon, CodeIcon, HorizontalRuleIcon, ChevronRightIcon, ChevronLeftIcon } from '@contentful/f36-icons';
|
|
12
12
|
import transform from 'lodash-es/transform';
|
|
13
13
|
import throttle from 'lodash-es/throttle';
|
|
14
14
|
import CodeMirror from 'codemirror';
|
|
@@ -188,16 +188,7 @@ var _excluded = ["label"],
|
|
|
188
188
|
_excluded7 = ["label"],
|
|
189
189
|
_excluded8 = ["label"],
|
|
190
190
|
_excluded9 = ["label"],
|
|
191
|
-
_excluded10 = ["label"]
|
|
192
|
-
_excluded11 = ["label"],
|
|
193
|
-
_excluded12 = ["label"],
|
|
194
|
-
_excluded13 = ["label"],
|
|
195
|
-
_excluded14 = ["label"],
|
|
196
|
-
_excluded15 = ["label"],
|
|
197
|
-
_excluded16 = ["label"],
|
|
198
|
-
_excluded17 = ["label"],
|
|
199
|
-
_excluded18 = ["label"],
|
|
200
|
-
_excluded19 = ["label"];
|
|
191
|
+
_excluded10 = ["label"];
|
|
201
192
|
var srOnly = /*#__PURE__*/css({
|
|
202
193
|
position: 'absolute',
|
|
203
194
|
width: '1px',
|
|
@@ -208,49 +199,49 @@ var srOnly = /*#__PURE__*/css({
|
|
|
208
199
|
clip: 'rect(0, 0, 0, 0)',
|
|
209
200
|
border: '0'
|
|
210
201
|
});
|
|
211
|
-
var
|
|
202
|
+
var Zen = function Zen(_ref) {
|
|
212
203
|
var label = _ref.label,
|
|
213
204
|
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
214
205
|
|
|
215
206
|
return React.createElement("svg", Object.assign({
|
|
216
207
|
width: 14,
|
|
217
208
|
height: 14,
|
|
218
|
-
viewBox: "0 0
|
|
209
|
+
viewBox: "0 0 1792 1792"
|
|
219
210
|
}, rest), React.createElement("path", {
|
|
220
|
-
d: "
|
|
211
|
+
d: "M1411 541l-355 355 355 355 144-144q29-31 70-14 39 17 39 59v448q0 26-19 45t-45 19h-448q-42 0-59-40-17-39 14-69l144-144-355-355-355 355 144 144q31 30 14 69-17 40-59 40H192q-26 0-45-19t-19-45v-448q0-42 40-59 39-17 69 14l144 144 355-355-355-355-144 144q-19 19-45 19-12 0-24-5-40-17-40-59V192q0-26 19-45t45-19h448q42 0 59 40 17 39-14 69L541 381l355 355 355-355-144-144q-31-30-14-69 17-40 59-40h448q26 0 45 19t19 45v448q0 42-39 59-13 5-25 5-26 0-45-19z"
|
|
221
212
|
}), React.createElement("span", {
|
|
222
213
|
className: srOnly
|
|
223
214
|
}, label));
|
|
224
215
|
};
|
|
225
|
-
var
|
|
216
|
+
var Strikethrough = function Strikethrough(_ref2) {
|
|
226
217
|
var label = _ref2.label,
|
|
227
218
|
rest = _objectWithoutPropertiesLoose(_ref2, _excluded2);
|
|
228
219
|
|
|
229
220
|
return React.createElement("svg", Object.assign({
|
|
230
221
|
width: 14,
|
|
231
222
|
height: 14,
|
|
232
|
-
viewBox: "0 0
|
|
223
|
+
viewBox: "0 0 1792 1792"
|
|
233
224
|
}, rest), React.createElement("path", {
|
|
234
|
-
d: "
|
|
225
|
+
d: "M1760 896q14 0 23 9t9 23v64q0 14-9 23t-23 9H32q-14 0-23-9t-9-23v-64q0-14 9-23t23-9h1728zM483 832q-28-35-51-80-48-98-48-188 0-181 134-309 133-127 393-127 50 0 167 19 66 12 177 48 10 38 21 118 14 123 14 183 0 18-5 45l-12 3-84-6-14-2q-50-149-103-205-88-91-210-91-114 0-182 59-67 58-67 146 0 73 66 140t279 129q69 20 173 66 58 28 95 52H483zm507 256h411q7 39 7 92 0 111-41 212-23 56-71 104-37 35-109 81-80 48-153 66-80 21-203 21-114 0-195-23l-140-40q-57-16-72-28-8-8-8-22v-13q0-108-2-156-1-30 0-68l2-37v-44l102-2q15 34 30 71t22.5 56 12.5 27q35 57 80 94 43 36 105 57 59 22 132 22 64 0 139-27 77-26 122-86 47-61 47-129 0-84-81-157-34-29-137-71z"
|
|
235
226
|
}), React.createElement("span", {
|
|
236
227
|
className: srOnly
|
|
237
228
|
}, label));
|
|
238
229
|
};
|
|
239
|
-
var
|
|
230
|
+
var Indent = function Indent(_ref3) {
|
|
240
231
|
var label = _ref3.label,
|
|
241
232
|
rest = _objectWithoutPropertiesLoose(_ref3, _excluded3);
|
|
242
233
|
|
|
243
234
|
return React.createElement("svg", Object.assign({
|
|
244
235
|
width: 14,
|
|
245
236
|
height: 14,
|
|
246
|
-
viewBox: "0 0
|
|
237
|
+
viewBox: "0 0 1792 1792"
|
|
247
238
|
}, rest), React.createElement("path", {
|
|
248
|
-
d: "
|
|
239
|
+
d: "M352 832q0 14-9 23L55 1143q-9 9-23 9-13 0-22.5-9.5T0 1120V544q0-13 9.5-22.5T32 512q14 0 23 9l288 288q9 9 9 23zm1440 480v192q0 13-9.5 22.5t-22.5 9.5H32q-13 0-22.5-9.5T0 1504v-192q0-13 9.5-22.5T32 1280h1728q13 0 22.5 9.5t9.5 22.5zm0-384v192q0 13-9.5 22.5t-22.5 9.5H672q-13 0-22.5-9.5T640 1120V928q0-13 9.5-22.5T672 896h1088q13 0 22.5 9.5t9.5 22.5zm0-384v192q0 13-9.5 22.5T1760 768H672q-13 0-22.5-9.5T640 736V544q0-13 9.5-22.5T672 512h1088q13 0 22.5 9.5t9.5 22.5zm0-384v192q0 13-9.5 22.5T1760 384H32q-13 0-22.5-9.5T0 352V160q0-13 9.5-22.5T32 128h1728q13 0 22.5 9.5t9.5 22.5z"
|
|
249
240
|
}), React.createElement("span", {
|
|
250
241
|
className: srOnly
|
|
251
242
|
}, label));
|
|
252
243
|
};
|
|
253
|
-
var
|
|
244
|
+
var Dedent = function Dedent(_ref4) {
|
|
254
245
|
var label = _ref4.label,
|
|
255
246
|
rest = _objectWithoutPropertiesLoose(_ref4, _excluded4);
|
|
256
247
|
|
|
@@ -259,26 +250,26 @@ var List = function List(_ref4) {
|
|
|
259
250
|
height: 14,
|
|
260
251
|
viewBox: "0 0 1792 1792"
|
|
261
252
|
}, rest), React.createElement("path", {
|
|
262
|
-
d: "
|
|
253
|
+
d: "M384 544v576q0 13-9.5 22.5T352 1152q-14 0-23-9L41 855q-9-9-9-23t9-23l288-288q9-9 23-9 13 0 22.5 9.5T384 544zm1408 768v192q0 13-9.5 22.5t-22.5 9.5H32q-13 0-22.5-9.5T0 1504v-192q0-13 9.5-22.5T32 1280h1728q13 0 22.5 9.5t9.5 22.5zm0-384v192q0 13-9.5 22.5t-22.5 9.5H672q-13 0-22.5-9.5T640 1120V928q0-13 9.5-22.5T672 896h1088q13 0 22.5 9.5t9.5 22.5zm0-384v192q0 13-9.5 22.5T1760 768H672q-13 0-22.5-9.5T640 736V544q0-13 9.5-22.5T672 512h1088q13 0 22.5 9.5t9.5 22.5zm0-384v192q0 13-9.5 22.5T1760 384H32q-13 0-22.5-9.5T0 352V160q0-13 9.5-22.5T32 128h1728q13 0 22.5 9.5t9.5 22.5z"
|
|
263
254
|
}), React.createElement("span", {
|
|
264
255
|
className: srOnly
|
|
265
256
|
}, label));
|
|
266
257
|
};
|
|
267
|
-
var
|
|
258
|
+
var Cubes = function Cubes(_ref5) {
|
|
268
259
|
var label = _ref5.label,
|
|
269
260
|
rest = _objectWithoutPropertiesLoose(_ref5, _excluded5);
|
|
270
261
|
|
|
271
262
|
return React.createElement("svg", Object.assign({
|
|
272
|
-
width:
|
|
263
|
+
width: 18,
|
|
273
264
|
height: 14,
|
|
274
|
-
viewBox: "0 0
|
|
265
|
+
viewBox: "0 0 2304 1792"
|
|
275
266
|
}, rest), React.createElement("path", {
|
|
276
|
-
d: "
|
|
267
|
+
d: "M640 1632l384-192v-314l-384 164v342zm-64-454l404-173-404-173-404 173zm1088 454l384-192v-314l-384 164v342zm-64-454l404-173-404-173-404 173zm-448-293l384-165V454l-384 164v267zm-64-379l441-189-441-189-441 189zm1088 518v416q0 36-19 67t-52 47l-448 224q-25 14-57 14t-57-14l-448-224q-4-2-7-4-2 2-7 4l-448 224q-25 14-57 14t-57-14L71 1554q-33-16-52-47t-19-67v-416q0-38 21.5-70T78 906l434-186V320q0-38 21.5-70t56.5-48l448-192q23-10 50-10t50 10l448 192q35 16 56.5 48t21.5 70v400l434 186q36 16 57 48t21 70z"
|
|
277
268
|
}), React.createElement("span", {
|
|
278
269
|
className: srOnly
|
|
279
270
|
}, label));
|
|
280
271
|
};
|
|
281
|
-
var
|
|
272
|
+
var Table = function Table(_ref6) {
|
|
282
273
|
var label = _ref6.label,
|
|
283
274
|
rest = _objectWithoutPropertiesLoose(_ref6, _excluded6);
|
|
284
275
|
|
|
@@ -287,12 +278,12 @@ var Link = function Link(_ref6) {
|
|
|
287
278
|
height: 14,
|
|
288
279
|
viewBox: "0 0 1792 1792"
|
|
289
280
|
}, rest), React.createElement("path", {
|
|
290
|
-
d: "
|
|
281
|
+
d: "M576 1376v-192q0-14-9-23t-23-9H224q-14 0-23 9t-9 23v192q0 14 9 23t23 9h320q14 0 23-9t9-23zm0-384V800q0-14-9-23t-23-9H224q-14 0-23 9t-9 23v192q0 14 9 23t23 9h320q14 0 23-9t9-23zm512 384v-192q0-14-9-23t-23-9H736q-14 0-23 9t-9 23v192q0 14 9 23t23 9h320q14 0 23-9t9-23zM576 608V416q0-14-9-23t-23-9H224q-14 0-23 9t-9 23v192q0 14 9 23t23 9h320q14 0 23-9t9-23zm512 384V800q0-14-9-23t-23-9H736q-14 0-23 9t-9 23v192q0 14 9 23t23 9h320q14 0 23-9t9-23zm512 384v-192q0-14-9-23t-23-9h-320q-14 0-23 9t-9 23v192q0 14 9 23t23 9h320q14 0 23-9t9-23zm-512-768V416q0-14-9-23t-23-9H736q-14 0-23 9t-9 23v192q0 14 9 23t23 9h320q14 0 23-9t9-23zm512 384V800q0-14-9-23t-23-9h-320q-14 0-23 9t-9 23v192q0 14 9 23t23 9h320q14 0 23-9t9-23zm0-384V416q0-14-9-23t-23-9h-320q-14 0-23 9t-9 23v192q0 14 9 23t23 9h320q14 0 23-9t9-23zm128-320v1088q0 66-47 113t-113 47H224q-66 0-113-47t-47-113V288q0-66 47-113t113-47h1344q66 0 113 47t47 113z"
|
|
291
282
|
}), React.createElement("span", {
|
|
292
283
|
className: srOnly
|
|
293
284
|
}, label));
|
|
294
285
|
};
|
|
295
|
-
var
|
|
286
|
+
var SpecialChar = function SpecialChar(_ref7) {
|
|
296
287
|
var label = _ref7.label,
|
|
297
288
|
rest = _objectWithoutPropertiesLoose(_ref7, _excluded7);
|
|
298
289
|
|
|
@@ -301,12 +292,12 @@ var Heading = function Heading(_ref7) {
|
|
|
301
292
|
height: 14,
|
|
302
293
|
viewBox: "0 0 1792 1792"
|
|
303
294
|
}, rest), React.createElement("path", {
|
|
304
|
-
d: "
|
|
295
|
+
d: "M1360 1307l35 159q3 12-3 22.5t-17 14.5l-5 1q-4 2-10.5 3.5t-16 4.5-21.5 5.5-25.5 5-30 5-33.5 4.5-36.5 3-38.5 1q-234 0-409-130.5T511 1054h-95q-13 0-22.5-9.5T384 1022V909q0-13 9.5-22.5T416 877h66q-2-57 1-105h-67q-14 0-23-9t-9-23V626q0-14 9-23t23-9h98q67-210 243.5-338T1158 128q102 0 194 23 11 3 20 15 6 11 3 24l-43 159q-3 13-14 19.5t-24 2.5l-4-1q-4-1-11.5-2.5L1261 364l-22.5-3.5-26-3-29-2.5-29.5-1q-126 0-226 64T778 594h468q16 0 25 12 10 12 7 26l-24 114q-5 26-32 26H734q-3 37 0 105h459q15 0 25 12 9 12 6 27l-24 112q-2 11-11 18.5t-20 7.5H782q48 117 149.5 185.5T1160 1308q18 0 36-1.5t33.5-3.5 29.5-4.5 24.5-5 18.5-4.5l12-3 5-2q13-5 26 2 12 7 15 21z"
|
|
305
296
|
}), React.createElement("span", {
|
|
306
297
|
className: srOnly
|
|
307
298
|
}, label));
|
|
308
299
|
};
|
|
309
|
-
var
|
|
300
|
+
var OrgLinks = function OrgLinks(_ref8) {
|
|
310
301
|
var label = _ref8.label,
|
|
311
302
|
rest = _objectWithoutPropertiesLoose(_ref8, _excluded8);
|
|
312
303
|
|
|
@@ -315,12 +306,12 @@ var Zen = function Zen(_ref8) {
|
|
|
315
306
|
height: 14,
|
|
316
307
|
viewBox: "0 0 1792 1792"
|
|
317
308
|
}, rest), React.createElement("path", {
|
|
318
|
-
d: "
|
|
309
|
+
d: "M1792 1248v320q0 40-28 68t-68 28h-320q-40 0-68-28t-28-68v-320q0-40 28-68t68-28h96V960H960v192h96q40 0 68 28t28 68v320q0 40-28 68t-68 28H736q-40 0-68-28t-28-68v-320q0-40 28-68t68-28h96V960H320v192h96q40 0 68 28t28 68v320q0 40-28 68t-68 28H96q-40 0-68-28t-28-68v-320q0-40 28-68t68-28h96V960q0-52 38-90t90-38h512V640h-96q-40 0-68-28t-28-68V224q0-40 28-68t68-28h320q40 0 68 28t28 68v320q0 40-28 68t-68 28h-96v192h512q52 0 90 38t38 90v192h96q40 0 68 28t28 68z"
|
|
319
310
|
}), React.createElement("span", {
|
|
320
311
|
className: srOnly
|
|
321
312
|
}, label));
|
|
322
313
|
};
|
|
323
|
-
var
|
|
314
|
+
var Undo = function Undo(_ref9) {
|
|
324
315
|
var label = _ref9.label,
|
|
325
316
|
rest = _objectWithoutPropertiesLoose(_ref9, _excluded9);
|
|
326
317
|
|
|
@@ -329,141 +320,15 @@ var Strikethrough = function Strikethrough(_ref9) {
|
|
|
329
320
|
height: 14,
|
|
330
321
|
viewBox: "0 0 1792 1792"
|
|
331
322
|
}, rest), React.createElement("path", {
|
|
332
|
-
d: "
|
|
323
|
+
d: "M1664 896q0 156-61 298t-164 245-245 164-298 61q-172 0-327-72.5T305 1387q-7-10-6.5-22.5t8.5-20.5l137-138q10-9 25-9 16 2 23 12 73 95 179 147t225 52q104 0 198.5-40.5T1258 1258t109.5-163.5T1408 896t-40.5-198.5T1258 534t-163.5-109.5T896 384q-98 0-188 35.5T548 521l137 138q31 30 14 69-17 40-59 40H192q-26 0-45-19t-19-45V256q0-42 40-59 39-17 69 14l130 129q107-101 244.5-156.5T896 128q156 0 298 61t245 164 164 245 61 298z"
|
|
333
324
|
}), React.createElement("span", {
|
|
334
325
|
className: srOnly
|
|
335
326
|
}, label));
|
|
336
327
|
};
|
|
337
|
-
var
|
|
328
|
+
var Redo = function Redo(_ref10) {
|
|
338
329
|
var label = _ref10.label,
|
|
339
330
|
rest = _objectWithoutPropertiesLoose(_ref10, _excluded10);
|
|
340
331
|
|
|
341
|
-
return React.createElement("svg", Object.assign({
|
|
342
|
-
width: 18,
|
|
343
|
-
height: 14,
|
|
344
|
-
viewBox: "0 0 2048 1792"
|
|
345
|
-
}, rest), React.createElement("path", {
|
|
346
|
-
d: "M681 1399l-50 50q-10 10-23 10t-23-10L119 983q-10-10-10-23t10-23l466-466q10-10 23-10t23 10l50 50q10 10 10 23t-10 23L288 960l393 393q10 10 10 23t-10 23zm591-1067L899 1623q-4 13-15.5 19.5T860 1645l-62-17q-13-4-19.5-15.5T776 1588l373-1291q4-13 15.5-19.5t23.5-2.5l62 17q13 4 19.5 15.5t2.5 24.5zm657 651l-466 466q-10 10-23 10t-23-10l-50-50q-10-10-10-23t10-23l393-393-393-393q-10-10-10-23t10-23l50-50q10-10 23-10t23 10l466 466q10 10 10 23t-10 23z"
|
|
347
|
-
}), React.createElement("span", {
|
|
348
|
-
className: srOnly
|
|
349
|
-
}, label));
|
|
350
|
-
};
|
|
351
|
-
var Hr = function Hr(_ref11) {
|
|
352
|
-
var label = _ref11.label,
|
|
353
|
-
rest = _objectWithoutPropertiesLoose(_ref11, _excluded11);
|
|
354
|
-
|
|
355
|
-
return React.createElement("svg", Object.assign({
|
|
356
|
-
width: 14,
|
|
357
|
-
height: 14,
|
|
358
|
-
viewBox: "0 0 1792 1792"
|
|
359
|
-
}, rest), React.createElement("path", {
|
|
360
|
-
d: "M1792 896q0 26-19 45l-256 256q-19 19-45 19t-45-19-19-45v-128H384v128q0 26-19 45t-45 19-45-19L19 941Q0 922 0 896t19-45l256-256q19-19 45-19t45 19 19 45v128h1024V640q0-26 19-45t45-19 45 19l256 256q19 19 19 45z"
|
|
361
|
-
}), React.createElement("span", {
|
|
362
|
-
className: srOnly
|
|
363
|
-
}, label));
|
|
364
|
-
};
|
|
365
|
-
var Indent = function Indent(_ref12) {
|
|
366
|
-
var label = _ref12.label,
|
|
367
|
-
rest = _objectWithoutPropertiesLoose(_ref12, _excluded12);
|
|
368
|
-
|
|
369
|
-
return React.createElement("svg", Object.assign({
|
|
370
|
-
width: 14,
|
|
371
|
-
height: 14,
|
|
372
|
-
viewBox: "0 0 1792 1792"
|
|
373
|
-
}, rest), React.createElement("path", {
|
|
374
|
-
d: "M352 832q0 14-9 23L55 1143q-9 9-23 9-13 0-22.5-9.5T0 1120V544q0-13 9.5-22.5T32 512q14 0 23 9l288 288q9 9 9 23zm1440 480v192q0 13-9.5 22.5t-22.5 9.5H32q-13 0-22.5-9.5T0 1504v-192q0-13 9.5-22.5T32 1280h1728q13 0 22.5 9.5t9.5 22.5zm0-384v192q0 13-9.5 22.5t-22.5 9.5H672q-13 0-22.5-9.5T640 1120V928q0-13 9.5-22.5T672 896h1088q13 0 22.5 9.5t9.5 22.5zm0-384v192q0 13-9.5 22.5T1760 768H672q-13 0-22.5-9.5T640 736V544q0-13 9.5-22.5T672 512h1088q13 0 22.5 9.5t9.5 22.5zm0-384v192q0 13-9.5 22.5T1760 384H32q-13 0-22.5-9.5T0 352V160q0-13 9.5-22.5T32 128h1728q13 0 22.5 9.5t9.5 22.5z"
|
|
375
|
-
}), React.createElement("span", {
|
|
376
|
-
className: srOnly
|
|
377
|
-
}, label));
|
|
378
|
-
};
|
|
379
|
-
var Dedent = function Dedent(_ref13) {
|
|
380
|
-
var label = _ref13.label,
|
|
381
|
-
rest = _objectWithoutPropertiesLoose(_ref13, _excluded13);
|
|
382
|
-
|
|
383
|
-
return React.createElement("svg", Object.assign({
|
|
384
|
-
width: 14,
|
|
385
|
-
height: 14,
|
|
386
|
-
viewBox: "0 0 1792 1792"
|
|
387
|
-
}, rest), React.createElement("path", {
|
|
388
|
-
d: "M384 544v576q0 13-9.5 22.5T352 1152q-14 0-23-9L41 855q-9-9-9-23t9-23l288-288q9-9 23-9 13 0 22.5 9.5T384 544zm1408 768v192q0 13-9.5 22.5t-22.5 9.5H32q-13 0-22.5-9.5T0 1504v-192q0-13 9.5-22.5T32 1280h1728q13 0 22.5 9.5t9.5 22.5zm0-384v192q0 13-9.5 22.5t-22.5 9.5H672q-13 0-22.5-9.5T640 1120V928q0-13 9.5-22.5T672 896h1088q13 0 22.5 9.5t9.5 22.5zm0-384v192q0 13-9.5 22.5T1760 768H672q-13 0-22.5-9.5T640 736V544q0-13 9.5-22.5T672 512h1088q13 0 22.5 9.5t9.5 22.5zm0-384v192q0 13-9.5 22.5T1760 384H32q-13 0-22.5-9.5T0 352V160q0-13 9.5-22.5T32 128h1728q13 0 22.5 9.5t9.5 22.5z"
|
|
389
|
-
}), React.createElement("span", {
|
|
390
|
-
className: srOnly
|
|
391
|
-
}, label));
|
|
392
|
-
};
|
|
393
|
-
var Cubes = function Cubes(_ref14) {
|
|
394
|
-
var label = _ref14.label,
|
|
395
|
-
rest = _objectWithoutPropertiesLoose(_ref14, _excluded14);
|
|
396
|
-
|
|
397
|
-
return React.createElement("svg", Object.assign({
|
|
398
|
-
width: 18,
|
|
399
|
-
height: 14,
|
|
400
|
-
viewBox: "0 0 2304 1792"
|
|
401
|
-
}, rest), React.createElement("path", {
|
|
402
|
-
d: "M640 1632l384-192v-314l-384 164v342zm-64-454l404-173-404-173-404 173zm1088 454l384-192v-314l-384 164v342zm-64-454l404-173-404-173-404 173zm-448-293l384-165V454l-384 164v267zm-64-379l441-189-441-189-441 189zm1088 518v416q0 36-19 67t-52 47l-448 224q-25 14-57 14t-57-14l-448-224q-4-2-7-4-2 2-7 4l-448 224q-25 14-57 14t-57-14L71 1554q-33-16-52-47t-19-67v-416q0-38 21.5-70T78 906l434-186V320q0-38 21.5-70t56.5-48l448-192q23-10 50-10t50 10l448 192q35 16 56.5 48t21.5 70v400l434 186q36 16 57 48t21 70z"
|
|
403
|
-
}), React.createElement("span", {
|
|
404
|
-
className: srOnly
|
|
405
|
-
}, label));
|
|
406
|
-
};
|
|
407
|
-
var Table = function Table(_ref15) {
|
|
408
|
-
var label = _ref15.label,
|
|
409
|
-
rest = _objectWithoutPropertiesLoose(_ref15, _excluded15);
|
|
410
|
-
|
|
411
|
-
return React.createElement("svg", Object.assign({
|
|
412
|
-
width: 14,
|
|
413
|
-
height: 14,
|
|
414
|
-
viewBox: "0 0 1792 1792"
|
|
415
|
-
}, rest), React.createElement("path", {
|
|
416
|
-
d: "M576 1376v-192q0-14-9-23t-23-9H224q-14 0-23 9t-9 23v192q0 14 9 23t23 9h320q14 0 23-9t9-23zm0-384V800q0-14-9-23t-23-9H224q-14 0-23 9t-9 23v192q0 14 9 23t23 9h320q14 0 23-9t9-23zm512 384v-192q0-14-9-23t-23-9H736q-14 0-23 9t-9 23v192q0 14 9 23t23 9h320q14 0 23-9t9-23zM576 608V416q0-14-9-23t-23-9H224q-14 0-23 9t-9 23v192q0 14 9 23t23 9h320q14 0 23-9t9-23zm512 384V800q0-14-9-23t-23-9H736q-14 0-23 9t-9 23v192q0 14 9 23t23 9h320q14 0 23-9t9-23zm512 384v-192q0-14-9-23t-23-9h-320q-14 0-23 9t-9 23v192q0 14 9 23t23 9h320q14 0 23-9t9-23zm-512-768V416q0-14-9-23t-23-9H736q-14 0-23 9t-9 23v192q0 14 9 23t23 9h320q14 0 23-9t9-23zm512 384V800q0-14-9-23t-23-9h-320q-14 0-23 9t-9 23v192q0 14 9 23t23 9h320q14 0 23-9t9-23zm0-384V416q0-14-9-23t-23-9h-320q-14 0-23 9t-9 23v192q0 14 9 23t23 9h320q14 0 23-9t9-23zm128-320v1088q0 66-47 113t-113 47H224q-66 0-113-47t-47-113V288q0-66 47-113t113-47h1344q66 0 113 47t47 113z"
|
|
417
|
-
}), React.createElement("span", {
|
|
418
|
-
className: srOnly
|
|
419
|
-
}, label));
|
|
420
|
-
};
|
|
421
|
-
var SpecialChar = function SpecialChar(_ref16) {
|
|
422
|
-
var label = _ref16.label,
|
|
423
|
-
rest = _objectWithoutPropertiesLoose(_ref16, _excluded16);
|
|
424
|
-
|
|
425
|
-
return React.createElement("svg", Object.assign({
|
|
426
|
-
width: 14,
|
|
427
|
-
height: 14,
|
|
428
|
-
viewBox: "0 0 1792 1792"
|
|
429
|
-
}, rest), React.createElement("path", {
|
|
430
|
-
d: "M1360 1307l35 159q3 12-3 22.5t-17 14.5l-5 1q-4 2-10.5 3.5t-16 4.5-21.5 5.5-25.5 5-30 5-33.5 4.5-36.5 3-38.5 1q-234 0-409-130.5T511 1054h-95q-13 0-22.5-9.5T384 1022V909q0-13 9.5-22.5T416 877h66q-2-57 1-105h-67q-14 0-23-9t-9-23V626q0-14 9-23t23-9h98q67-210 243.5-338T1158 128q102 0 194 23 11 3 20 15 6 11 3 24l-43 159q-3 13-14 19.5t-24 2.5l-4-1q-4-1-11.5-2.5L1261 364l-22.5-3.5-26-3-29-2.5-29.5-1q-126 0-226 64T778 594h468q16 0 25 12 10 12 7 26l-24 114q-5 26-32 26H734q-3 37 0 105h459q15 0 25 12 9 12 6 27l-24 112q-2 11-11 18.5t-20 7.5H782q48 117 149.5 185.5T1160 1308q18 0 36-1.5t33.5-3.5 29.5-4.5 24.5-5 18.5-4.5l12-3 5-2q13-5 26 2 12 7 15 21z"
|
|
431
|
-
}), React.createElement("span", {
|
|
432
|
-
className: srOnly
|
|
433
|
-
}, label));
|
|
434
|
-
};
|
|
435
|
-
var OrgLinks = function OrgLinks(_ref17) {
|
|
436
|
-
var label = _ref17.label,
|
|
437
|
-
rest = _objectWithoutPropertiesLoose(_ref17, _excluded17);
|
|
438
|
-
|
|
439
|
-
return React.createElement("svg", Object.assign({
|
|
440
|
-
width: 14,
|
|
441
|
-
height: 14,
|
|
442
|
-
viewBox: "0 0 1792 1792"
|
|
443
|
-
}, rest), React.createElement("path", {
|
|
444
|
-
d: "M1792 1248v320q0 40-28 68t-68 28h-320q-40 0-68-28t-28-68v-320q0-40 28-68t68-28h96V960H960v192h96q40 0 68 28t28 68v320q0 40-28 68t-68 28H736q-40 0-68-28t-28-68v-320q0-40 28-68t68-28h96V960H320v192h96q40 0 68 28t28 68v320q0 40-28 68t-68 28H96q-40 0-68-28t-28-68v-320q0-40 28-68t68-28h96V960q0-52 38-90t90-38h512V640h-96q-40 0-68-28t-28-68V224q0-40 28-68t68-28h320q40 0 68 28t28 68v320q0 40-28 68t-68 28h-96v192h512q52 0 90 38t38 90v192h96q40 0 68 28t28 68z"
|
|
445
|
-
}), React.createElement("span", {
|
|
446
|
-
className: srOnly
|
|
447
|
-
}, label));
|
|
448
|
-
};
|
|
449
|
-
var Undo = function Undo(_ref18) {
|
|
450
|
-
var label = _ref18.label,
|
|
451
|
-
rest = _objectWithoutPropertiesLoose(_ref18, _excluded18);
|
|
452
|
-
|
|
453
|
-
return React.createElement("svg", Object.assign({
|
|
454
|
-
width: 14,
|
|
455
|
-
height: 14,
|
|
456
|
-
viewBox: "0 0 1792 1792"
|
|
457
|
-
}, rest), React.createElement("path", {
|
|
458
|
-
d: "M1664 896q0 156-61 298t-164 245-245 164-298 61q-172 0-327-72.5T305 1387q-7-10-6.5-22.5t8.5-20.5l137-138q10-9 25-9 16 2 23 12 73 95 179 147t225 52q104 0 198.5-40.5T1258 1258t109.5-163.5T1408 896t-40.5-198.5T1258 534t-163.5-109.5T896 384q-98 0-188 35.5T548 521l137 138q31 30 14 69-17 40-59 40H192q-26 0-45-19t-19-45V256q0-42 40-59 39-17 69 14l130 129q107-101 244.5-156.5T896 128q156 0 298 61t245 164 164 245 61 298z"
|
|
459
|
-
}), React.createElement("span", {
|
|
460
|
-
className: srOnly
|
|
461
|
-
}, label));
|
|
462
|
-
};
|
|
463
|
-
var Redo = function Redo(_ref19) {
|
|
464
|
-
var label = _ref19.label,
|
|
465
|
-
rest = _objectWithoutPropertiesLoose(_ref19, _excluded19);
|
|
466
|
-
|
|
467
332
|
return React.createElement("svg", Object.assign({
|
|
468
333
|
width: 14,
|
|
469
334
|
height: 14,
|
|
@@ -476,36 +341,21 @@ var Redo = function Redo(_ref19) {
|
|
|
476
341
|
};
|
|
477
342
|
|
|
478
343
|
var HeadingSelector = function HeadingSelector(props) {
|
|
479
|
-
var _useState = useState(false),
|
|
480
|
-
isOpen = _useState[0],
|
|
481
|
-
setOpen = _useState[1];
|
|
482
|
-
|
|
483
344
|
var handleMenuClick = function handleMenuClick(heading) {
|
|
484
345
|
props.onSelect(heading);
|
|
485
|
-
setOpen(false);
|
|
486
346
|
};
|
|
487
347
|
|
|
488
|
-
return React.createElement(
|
|
489
|
-
isOpen: isOpen,
|
|
490
|
-
onClose: function onClose() {
|
|
491
|
-
return setOpen(false);
|
|
492
|
-
},
|
|
493
|
-
toggleElement: React.cloneElement(props.children, {
|
|
494
|
-
onClick: function onClick() {
|
|
495
|
-
return setOpen(!isOpen);
|
|
496
|
-
}
|
|
497
|
-
})
|
|
498
|
-
}, React.createElement(DropdownList, null, React.createElement(DropdownListItem, {
|
|
348
|
+
return React.createElement(Menu, null, React.createElement(Menu.Trigger, null, props.children), React.createElement(Menu.List, null, React.createElement(Menu.Item, {
|
|
499
349
|
testId: "markdown-action-button-heading-h1",
|
|
500
350
|
onClick: function onClick() {
|
|
501
351
|
return handleMenuClick('h1');
|
|
502
352
|
}
|
|
503
|
-
}, "Heading 1"), React.createElement(
|
|
353
|
+
}, "Heading 1"), React.createElement(Menu.Item, {
|
|
504
354
|
testId: "markdown-action-button-heading-h2",
|
|
505
355
|
onClick: function onClick() {
|
|
506
356
|
return handleMenuClick('h2');
|
|
507
357
|
}
|
|
508
|
-
}, "Heading 2"), React.createElement(
|
|
358
|
+
}, "Heading 2"), React.createElement(Menu.Item, {
|
|
509
359
|
testId: "markdown-action-button-heading-h3",
|
|
510
360
|
onClick: function onClick() {
|
|
511
361
|
return handleMenuClick('h3');
|
|
@@ -518,11 +368,11 @@ var InsertLinkSelector = function InsertLinkSelector(props) {
|
|
|
518
368
|
return React.createElement(MultipleMediaContextMenu, Object.assign({}, props));
|
|
519
369
|
} else {
|
|
520
370
|
return React.createElement(Button, {
|
|
521
|
-
|
|
522
|
-
|
|
371
|
+
isDisabled: props.disabled,
|
|
372
|
+
startIcon: React.createElement(AssetIcon, null),
|
|
523
373
|
testId: "markdownEditor.linkExistingAssets",
|
|
524
374
|
size: "small",
|
|
525
|
-
|
|
375
|
+
variant: "secondary",
|
|
526
376
|
onClick: function onClick() {
|
|
527
377
|
props.onSelectExisting();
|
|
528
378
|
}
|
|
@@ -531,45 +381,29 @@ var InsertLinkSelector = function InsertLinkSelector(props) {
|
|
|
531
381
|
};
|
|
532
382
|
|
|
533
383
|
var MultipleMediaContextMenu = function MultipleMediaContextMenu(props) {
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
isOpen: isOpen,
|
|
545
|
-
position: "bottom-right",
|
|
546
|
-
onClose: function onClose() {
|
|
547
|
-
return setOpen(false);
|
|
548
|
-
},
|
|
549
|
-
toggleElement: React.createElement(Button, {
|
|
550
|
-
disabled: props.disabled,
|
|
551
|
-
icon: "Asset",
|
|
552
|
-
testId: "markdownEditor.insertMediaDropdownTrigger",
|
|
553
|
-
size: "small",
|
|
554
|
-
buttonType: "muted",
|
|
555
|
-
indicateDropdown: true,
|
|
556
|
-
onClick: function onClick() {
|
|
557
|
-
return setOpen(!isOpen);
|
|
558
|
-
}
|
|
559
|
-
}, "Insert media")
|
|
560
|
-
}, React.createElement(DropdownList, null, React.createElement(DropdownListItem, {
|
|
384
|
+
return React.createElement(Menu, {
|
|
385
|
+
placement: "bottom-end"
|
|
386
|
+
}, React.createElement(Menu.Trigger, null, React.createElement(Button, {
|
|
387
|
+
endIcon: React.createElement(ChevronDownIcon, null),
|
|
388
|
+
isDisabled: props.disabled,
|
|
389
|
+
startIcon: React.createElement(AssetIcon, null),
|
|
390
|
+
testId: "markdownEditor.insertMediaDropdownTrigger",
|
|
391
|
+
size: "small",
|
|
392
|
+
variant: "secondary"
|
|
393
|
+
}, "Insert media")), React.createElement(Menu.List, null, React.createElement(Menu.Item, {
|
|
561
394
|
testId: "markdownEditor.uploadAssetsAndLink",
|
|
562
395
|
onClick: function onClick() {
|
|
563
|
-
return
|
|
396
|
+
return props.onAddNew();
|
|
564
397
|
}
|
|
565
|
-
}, "Add new media and link"), React.createElement(
|
|
398
|
+
}, "Add new media and link"), React.createElement(Menu.Item, {
|
|
566
399
|
testId: "markdownEditor.linkExistingAssets",
|
|
567
400
|
onClick: function onClick() {
|
|
568
|
-
return
|
|
401
|
+
return props.onSelectExisting();
|
|
569
402
|
}
|
|
570
403
|
}, "Link existing media")));
|
|
571
404
|
};
|
|
572
405
|
|
|
406
|
+
var _excluded$1 = ["tooltip", "onClick", "children", "className", "variant", "tooltipPlace", "isDisabled"];
|
|
573
407
|
var styles$1 = {
|
|
574
408
|
root: /*#__PURE__*/css({
|
|
575
409
|
position: 'relative',
|
|
@@ -579,18 +413,11 @@ var styles$1 = {
|
|
|
579
413
|
padding: tokens.spacingXs,
|
|
580
414
|
borderTopLeftRadius: tokens.borderRadiusSmall
|
|
581
415
|
}),
|
|
582
|
-
actionsRow: /*#__PURE__*/css({
|
|
583
|
-
display: 'flex',
|
|
584
|
-
justifyContent: 'space-between'
|
|
585
|
-
}),
|
|
586
|
-
additionalRow: /*#__PURE__*/css({
|
|
587
|
-
marginTop: tokens.spacingXs
|
|
588
|
-
}),
|
|
589
|
-
actionsGroup: /*#__PURE__*/css({
|
|
590
|
-
display: 'flex'
|
|
591
|
-
}),
|
|
592
416
|
button: /*#__PURE__*/css({
|
|
593
|
-
|
|
417
|
+
height: '30px',
|
|
418
|
+
width: '36px',
|
|
419
|
+
marginLeft: tokens.spacing2Xs,
|
|
420
|
+
marginRight: tokens.spacing2Xs
|
|
594
421
|
}),
|
|
595
422
|
icon: /*#__PURE__*/css({
|
|
596
423
|
fill: tokens.gray700,
|
|
@@ -606,42 +433,39 @@ var styles$1 = {
|
|
|
606
433
|
zIndex: /*#__PURE__*/Number(tokens.zIndexTooltip)
|
|
607
434
|
})
|
|
608
435
|
};
|
|
609
|
-
|
|
610
|
-
function ToolbarButton(props) {
|
|
436
|
+
var ToolbarButton = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
611
437
|
var tooltip = props.tooltip,
|
|
612
|
-
|
|
613
|
-
_onClick = _props$onClick === void 0 ? noop : _props$onClick,
|
|
614
|
-
testId = props.testId,
|
|
438
|
+
onClick = props.onClick,
|
|
615
439
|
children = props.children,
|
|
616
440
|
className = props.className,
|
|
617
|
-
_props$
|
|
618
|
-
|
|
441
|
+
_props$variant = props.variant,
|
|
442
|
+
variant = _props$variant === void 0 ? 'transparent' : _props$variant,
|
|
619
443
|
_props$tooltipPlace = props.tooltipPlace,
|
|
620
444
|
tooltipPlace = _props$tooltipPlace === void 0 ? 'top' : _props$tooltipPlace,
|
|
621
|
-
_props$
|
|
622
|
-
|
|
445
|
+
_props$isDisabled = props.isDisabled,
|
|
446
|
+
isDisabled = _props$isDisabled === void 0 ? false : _props$isDisabled,
|
|
447
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$1);
|
|
623
448
|
|
|
624
|
-
var button = React.createElement(Button, {
|
|
449
|
+
var button = React.createElement(Button, Object.assign({}, otherProps, {
|
|
450
|
+
ref: ref,
|
|
625
451
|
className: cx(styles$1.button, className),
|
|
626
|
-
|
|
627
|
-
onClick:
|
|
628
|
-
|
|
629
|
-
},
|
|
630
|
-
testId: testId,
|
|
631
|
-
buttonType: buttonType,
|
|
452
|
+
isDisabled: isDisabled,
|
|
453
|
+
onClick: onClick,
|
|
454
|
+
variant: variant,
|
|
632
455
|
size: "small"
|
|
633
|
-
}, children);
|
|
456
|
+
}), children);
|
|
634
457
|
|
|
635
458
|
if (tooltip) {
|
|
636
459
|
return React.createElement(Tooltip, {
|
|
637
460
|
className: styles$1.tooltip,
|
|
638
|
-
|
|
461
|
+
placement: tooltipPlace,
|
|
639
462
|
content: tooltip
|
|
640
463
|
}, button);
|
|
641
464
|
}
|
|
642
465
|
|
|
643
466
|
return button;
|
|
644
|
-
}
|
|
467
|
+
});
|
|
468
|
+
ToolbarButton.displayName = 'ToolbarButton';
|
|
645
469
|
|
|
646
470
|
function MainButtons(props) {
|
|
647
471
|
var tooltipPlace = props.mode === 'zen' ? 'bottom' : 'top';
|
|
@@ -652,66 +476,66 @@ function MainButtons(props) {
|
|
|
652
476
|
}
|
|
653
477
|
}
|
|
654
478
|
}, React.createElement(ToolbarButton, {
|
|
655
|
-
|
|
479
|
+
isDisabled: props.disabled,
|
|
656
480
|
testId: "markdown-action-button-heading",
|
|
657
481
|
tooltip: "Headings",
|
|
658
482
|
tooltipPlace: tooltipPlace
|
|
659
|
-
}, React.createElement(
|
|
660
|
-
label: "Headings",
|
|
483
|
+
}, React.createElement(HeadingIcon, {
|
|
484
|
+
"aria-label": "Headings",
|
|
661
485
|
className: styles$1.icon
|
|
662
486
|
}))), React.createElement(ToolbarButton, {
|
|
663
|
-
|
|
487
|
+
isDisabled: props.disabled,
|
|
664
488
|
testId: "markdown-action-button-bold",
|
|
665
489
|
tooltip: "Bold",
|
|
666
490
|
tooltipPlace: tooltipPlace,
|
|
667
491
|
onClick: props.actions.simple.bold
|
|
668
|
-
}, React.createElement(
|
|
669
|
-
label: "Bold",
|
|
492
|
+
}, React.createElement(FormatBoldIcon, {
|
|
493
|
+
"aria-label": "Bold",
|
|
670
494
|
className: styles$1.icon
|
|
671
495
|
})), React.createElement(ToolbarButton, {
|
|
672
|
-
|
|
496
|
+
isDisabled: props.disabled,
|
|
673
497
|
testId: "markdown-action-button-italic",
|
|
674
498
|
tooltip: "Italic",
|
|
675
499
|
tooltipPlace: tooltipPlace,
|
|
676
500
|
onClick: props.actions.simple.italic
|
|
677
|
-
}, React.createElement(
|
|
678
|
-
label: "Italic",
|
|
501
|
+
}, React.createElement(FormatItalicIcon, {
|
|
502
|
+
"aria-label": "Italic",
|
|
679
503
|
className: styles$1.icon
|
|
680
504
|
})), React.createElement(ToolbarButton, {
|
|
681
|
-
|
|
505
|
+
isDisabled: props.disabled,
|
|
682
506
|
testId: "markdown-action-button-quote",
|
|
683
507
|
tooltip: "Quote",
|
|
684
508
|
tooltipPlace: tooltipPlace,
|
|
685
509
|
onClick: props.actions.simple.quote
|
|
686
|
-
}, React.createElement(
|
|
687
|
-
label: "Quote",
|
|
510
|
+
}, React.createElement(QuoteIcon, {
|
|
511
|
+
"aria-label": "Quote",
|
|
688
512
|
className: styles$1.icon
|
|
689
513
|
})), React.createElement(ToolbarButton, {
|
|
690
|
-
|
|
514
|
+
isDisabled: props.disabled,
|
|
691
515
|
testId: "markdown-action-button-ul",
|
|
692
516
|
tooltip: "Unordered list",
|
|
693
517
|
tooltipPlace: tooltipPlace,
|
|
694
518
|
onClick: props.actions.simple.ul
|
|
695
|
-
}, React.createElement(
|
|
696
|
-
label: "Unordered list",
|
|
519
|
+
}, React.createElement(ListBulletedIcon, {
|
|
520
|
+
"aria-label": "Unordered list",
|
|
697
521
|
className: styles$1.icon
|
|
698
522
|
})), React.createElement(ToolbarButton, {
|
|
699
|
-
|
|
523
|
+
isDisabled: props.disabled,
|
|
700
524
|
testId: "markdown-action-button-ol",
|
|
701
525
|
tooltip: "Ordered list",
|
|
702
526
|
tooltipPlace: tooltipPlace,
|
|
703
527
|
onClick: props.actions.simple.ol
|
|
704
|
-
}, React.createElement(
|
|
705
|
-
label: "Ordered list",
|
|
528
|
+
}, React.createElement(ListNumberedIcon, {
|
|
529
|
+
"aria-label": "Ordered list",
|
|
706
530
|
className: styles$1.icon
|
|
707
531
|
})), React.createElement(ToolbarButton, {
|
|
708
|
-
|
|
532
|
+
isDisabled: props.disabled,
|
|
709
533
|
testId: "markdown-action-button-link",
|
|
710
534
|
tooltip: "Link",
|
|
711
535
|
tooltipPlace: tooltipPlace,
|
|
712
536
|
onClick: props.actions.insertLink
|
|
713
|
-
}, React.createElement(
|
|
714
|
-
label: "Link",
|
|
537
|
+
}, React.createElement(LinkIcon, {
|
|
538
|
+
"aria-label": "Link",
|
|
715
539
|
className: styles$1.icon
|
|
716
540
|
})));
|
|
717
541
|
}
|
|
@@ -719,7 +543,7 @@ function MainButtons(props) {
|
|
|
719
543
|
function AdditionalButtons(props) {
|
|
720
544
|
var tooltipPlace = props.mode === 'zen' ? 'bottom' : 'top';
|
|
721
545
|
return React.createElement(React.Fragment, null, React.createElement(ToolbarButton, {
|
|
722
|
-
|
|
546
|
+
isDisabled: props.disabled,
|
|
723
547
|
testId: "markdown-action-button-strike",
|
|
724
548
|
tooltip: "Strike out",
|
|
725
549
|
tooltipPlace: tooltipPlace,
|
|
@@ -728,25 +552,25 @@ function AdditionalButtons(props) {
|
|
|
728
552
|
label: "Strike out",
|
|
729
553
|
className: styles$1.icon
|
|
730
554
|
})), React.createElement(ToolbarButton, {
|
|
731
|
-
|
|
555
|
+
isDisabled: props.disabled,
|
|
732
556
|
testId: "markdown-action-button-code",
|
|
733
557
|
tooltip: "Code block",
|
|
734
558
|
tooltipPlace: tooltipPlace,
|
|
735
559
|
onClick: props.actions.simple.code
|
|
736
|
-
}, React.createElement(
|
|
737
|
-
label: "Code block",
|
|
560
|
+
}, React.createElement(CodeIcon, {
|
|
561
|
+
"aria-label": "Code block",
|
|
738
562
|
className: styles$1.icon
|
|
739
563
|
})), React.createElement(ToolbarButton, {
|
|
740
|
-
|
|
564
|
+
isDisabled: props.disabled,
|
|
741
565
|
testId: "markdown-action-button-hr",
|
|
742
566
|
tooltip: "Horizontal rule",
|
|
743
567
|
tooltipPlace: tooltipPlace,
|
|
744
568
|
onClick: props.actions.simple.hr
|
|
745
|
-
}, React.createElement(
|
|
746
|
-
label: "Horizontal rule",
|
|
569
|
+
}, React.createElement(HorizontalRuleIcon, {
|
|
570
|
+
"aria-label": "Horizontal rule",
|
|
747
571
|
className: styles$1.icon
|
|
748
572
|
})), React.createElement(ToolbarButton, {
|
|
749
|
-
|
|
573
|
+
isDisabled: props.disabled,
|
|
750
574
|
testId: "markdown-action-button-indent",
|
|
751
575
|
tooltip: "Increase indentation",
|
|
752
576
|
tooltipPlace: tooltipPlace,
|
|
@@ -755,7 +579,7 @@ function AdditionalButtons(props) {
|
|
|
755
579
|
label: "Increase indentation",
|
|
756
580
|
className: styles$1.icon
|
|
757
581
|
})), React.createElement(ToolbarButton, {
|
|
758
|
-
|
|
582
|
+
isDisabled: props.disabled,
|
|
759
583
|
testId: "markdown-action-button-dedent",
|
|
760
584
|
tooltip: "Decrease indentation",
|
|
761
585
|
tooltipPlace: tooltipPlace,
|
|
@@ -764,7 +588,7 @@ function AdditionalButtons(props) {
|
|
|
764
588
|
label: "Decrease indentation",
|
|
765
589
|
className: styles$1.icon
|
|
766
590
|
})), React.createElement(ToolbarButton, {
|
|
767
|
-
|
|
591
|
+
isDisabled: props.disabled,
|
|
768
592
|
testId: "markdown-action-button-embed",
|
|
769
593
|
tooltip: "Embed external content",
|
|
770
594
|
tooltipPlace: tooltipPlace,
|
|
@@ -773,7 +597,7 @@ function AdditionalButtons(props) {
|
|
|
773
597
|
label: "Embed external content",
|
|
774
598
|
className: styles$1.icon
|
|
775
599
|
})), React.createElement(ToolbarButton, {
|
|
776
|
-
|
|
600
|
+
isDisabled: props.disabled,
|
|
777
601
|
testId: "markdown-action-button-table",
|
|
778
602
|
tooltip: "Insert table",
|
|
779
603
|
tooltipPlace: tooltipPlace,
|
|
@@ -782,7 +606,7 @@ function AdditionalButtons(props) {
|
|
|
782
606
|
label: "Insert table",
|
|
783
607
|
className: styles$1.icon
|
|
784
608
|
})), React.createElement(ToolbarButton, {
|
|
785
|
-
|
|
609
|
+
isDisabled: props.disabled,
|
|
786
610
|
testId: "markdown-action-button-special",
|
|
787
611
|
tooltip: "Insert special character",
|
|
788
612
|
tooltipPlace: tooltipPlace,
|
|
@@ -791,7 +615,7 @@ function AdditionalButtons(props) {
|
|
|
791
615
|
label: "Insert special character",
|
|
792
616
|
className: styles$1.icon
|
|
793
617
|
})), React.createElement(ToolbarButton, {
|
|
794
|
-
|
|
618
|
+
isDisabled: props.disabled,
|
|
795
619
|
testId: "markdown-action-button-organizeLinks",
|
|
796
620
|
tooltip: "Organize links",
|
|
797
621
|
tooltipPlace: tooltipPlace,
|
|
@@ -800,7 +624,7 @@ function AdditionalButtons(props) {
|
|
|
800
624
|
label: "Organize links",
|
|
801
625
|
className: styles$1.icon
|
|
802
626
|
})), React.createElement(ToolbarButton, {
|
|
803
|
-
|
|
627
|
+
isDisabled: props.disabled,
|
|
804
628
|
testId: "markdown-action-button-undo",
|
|
805
629
|
tooltip: "Undo",
|
|
806
630
|
tooltipPlace: tooltipPlace,
|
|
@@ -809,7 +633,7 @@ function AdditionalButtons(props) {
|
|
|
809
633
|
label: "Undo",
|
|
810
634
|
className: styles$1.icon
|
|
811
635
|
})), React.createElement(ToolbarButton, {
|
|
812
|
-
|
|
636
|
+
isDisabled: props.disabled,
|
|
813
637
|
testId: "markdown-action-button-redo",
|
|
814
638
|
tooltip: "Redo",
|
|
815
639
|
tooltipPlace: tooltipPlace,
|
|
@@ -827,59 +651,49 @@ function DefaultMarkdownToolbar(props) {
|
|
|
827
651
|
|
|
828
652
|
return React.createElement("div", {
|
|
829
653
|
className: styles$1.root
|
|
830
|
-
}, React.createElement(
|
|
831
|
-
|
|
832
|
-
}, React.createElement(
|
|
833
|
-
|
|
834
|
-
}, React.createElement(MainButtons, Object.assign({}, props)), React.createElement(ToolbarButton, {
|
|
835
|
-
disabled: props.disabled,
|
|
654
|
+
}, React.createElement(Flex, {
|
|
655
|
+
justifyContent: "space-between"
|
|
656
|
+
}, React.createElement(Flex, null, React.createElement(MainButtons, Object.assign({}, props)), React.createElement(ToolbarButton, {
|
|
657
|
+
isDisabled: props.disabled,
|
|
836
658
|
testId: "markdown-action-button-toggle-additional",
|
|
837
659
|
tooltip: showAdditional ? 'Hide additional actions' : 'More actions',
|
|
838
660
|
onClick: function onClick() {
|
|
839
661
|
setShowAdditional(!showAdditional);
|
|
840
662
|
}
|
|
841
|
-
}, React.createElement(
|
|
842
|
-
className: styles$1.icon
|
|
843
|
-
|
|
844
|
-
}))), React.createElement("div", {
|
|
845
|
-
className: styles$1.actionsGroup
|
|
846
|
-
}, React.createElement(InsertLinkSelector, {
|
|
663
|
+
}, React.createElement(MoreHorizontalIcon, {
|
|
664
|
+
className: styles$1.icon
|
|
665
|
+
}))), React.createElement(Flex, null, React.createElement(InsertLinkSelector, {
|
|
847
666
|
disabled: props.disabled,
|
|
848
667
|
onSelectExisting: props.actions.linkExistingMedia,
|
|
849
668
|
onAddNew: props.actions.addNewMedia,
|
|
850
669
|
canAddNew: props.canUploadAssets
|
|
851
670
|
}), React.createElement(ToolbarButton, {
|
|
852
|
-
|
|
671
|
+
isDisabled: props.disabled,
|
|
853
672
|
testId: "markdown-action-button-zen",
|
|
854
|
-
|
|
673
|
+
variant: "secondary",
|
|
855
674
|
onClick: props.actions.openZenMode,
|
|
856
675
|
className: styles$1.zenButton
|
|
857
676
|
}, React.createElement(Zen, {
|
|
858
677
|
label: "Expand",
|
|
859
678
|
className: styles$1.icon
|
|
860
|
-
})))), showAdditional && React.createElement(
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
}, React.createElement(AdditionalButtons, Object.assign({}, props)))));
|
|
679
|
+
})))), showAdditional && React.createElement(Flex, {
|
|
680
|
+
justifyContent: "space-between",
|
|
681
|
+
marginTop: "spacingXs"
|
|
682
|
+
}, React.createElement(Flex, null, React.createElement(AdditionalButtons, Object.assign({}, props)))));
|
|
865
683
|
}
|
|
866
684
|
function ZenMarkdownToolbar(props) {
|
|
867
685
|
return React.createElement("div", {
|
|
868
686
|
className: styles$1.root
|
|
869
|
-
}, React.createElement(
|
|
870
|
-
|
|
871
|
-
}, React.createElement(
|
|
872
|
-
className: styles$1.actionsGroup
|
|
873
|
-
}, React.createElement(MainButtons, Object.assign({}, props)), React.createElement(AdditionalButtons, Object.assign({}, props))), React.createElement("div", {
|
|
874
|
-
className: styles$1.actionsGroup
|
|
875
|
-
}, React.createElement(InsertLinkSelector, {
|
|
687
|
+
}, React.createElement(Flex, {
|
|
688
|
+
justifyContent: "space-between"
|
|
689
|
+
}, React.createElement(Flex, null, React.createElement(MainButtons, Object.assign({}, props)), React.createElement(AdditionalButtons, Object.assign({}, props))), React.createElement(Flex, null, React.createElement(InsertLinkSelector, {
|
|
876
690
|
disabled: props.disabled,
|
|
877
691
|
onSelectExisting: props.actions.linkExistingMedia,
|
|
878
692
|
onAddNew: props.actions.addNewMedia,
|
|
879
693
|
canAddNew: props.canUploadAssets
|
|
880
694
|
}), React.createElement(Button, {
|
|
881
695
|
testId: "markdown-action-button-zen-close",
|
|
882
|
-
|
|
696
|
+
variant: "secondary",
|
|
883
697
|
size: "small",
|
|
884
698
|
className: cx(styles$1.zenButton, styles$1.zenButtonPressed),
|
|
885
699
|
onClick: function onClick() {
|
|
@@ -903,6 +717,8 @@ var userAgent = /*#__PURE__*/get(window, 'navigator.userAgent', '');
|
|
|
903
717
|
var platform = /*#__PURE__*/get(window, 'navigator.platform', '');
|
|
904
718
|
var ctrlKey = 'Ctrl';
|
|
905
719
|
var tests = {
|
|
720
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
721
|
+
// @ts-ignore ignore missing MSStream
|
|
906
722
|
ios: /*#__PURE__*/ /(iphone os|ipad|iphone|ipod)/i.test(userAgent) && !window.MSStream
|
|
907
723
|
};
|
|
908
724
|
|
|
@@ -1861,8 +1677,10 @@ var styles$3 = {
|
|
|
1861
1677
|
};
|
|
1862
1678
|
function MarkdownHelp(props) {
|
|
1863
1679
|
return React.createElement(Paragraph, {
|
|
1680
|
+
marginBottom: "none",
|
|
1864
1681
|
className: styles$3.help
|
|
1865
1682
|
}, "Format your text like a pro with the", ' ', React.createElement(TextLink, {
|
|
1683
|
+
as: "button",
|
|
1866
1684
|
testId: "open-markdown-cheatsheet-button",
|
|
1867
1685
|
onClick: function onClick() {
|
|
1868
1686
|
props.onClick();
|
|
@@ -1945,7 +1763,7 @@ var styles$4 = {
|
|
|
1945
1763
|
})
|
|
1946
1764
|
};
|
|
1947
1765
|
var CheatsheetModalDialog = function CheatsheetModalDialog() {
|
|
1948
|
-
return React.createElement(
|
|
1766
|
+
return React.createElement(ModalContent, {
|
|
1949
1767
|
testId: "markdown-cheatsheet-dialog-content"
|
|
1950
1768
|
}, React.createElement("div", {
|
|
1951
1769
|
className: styles$4.flexColumnContainer
|
|
@@ -1953,22 +1771,25 @@ var CheatsheetModalDialog = function CheatsheetModalDialog() {
|
|
|
1953
1771
|
className: cx(styles$4.flexColumn, styles$4.verticalDivider)
|
|
1954
1772
|
}, React.createElement("div", {
|
|
1955
1773
|
className: styles$4.helpItem
|
|
1956
|
-
}, React.createElement(Heading
|
|
1957
|
-
|
|
1774
|
+
}, React.createElement(Heading, {
|
|
1775
|
+
marginBottom: "none",
|
|
1776
|
+
as: "h1",
|
|
1958
1777
|
className: cx(styles$4.preview, styles$4.h1)
|
|
1959
1778
|
}, "H1"), React.createElement("div", {
|
|
1960
1779
|
className: styles$4.markup
|
|
1961
1780
|
}, "# heading")), React.createElement("div", {
|
|
1962
1781
|
className: styles$4.helpItem
|
|
1963
|
-
}, React.createElement(Heading
|
|
1964
|
-
|
|
1782
|
+
}, React.createElement(Heading, {
|
|
1783
|
+
marginBottom: "none",
|
|
1784
|
+
as: "h2",
|
|
1965
1785
|
className: cx(styles$4.preview, styles$4.h2)
|
|
1966
1786
|
}, "H2"), React.createElement("div", {
|
|
1967
1787
|
className: styles$4.markup
|
|
1968
1788
|
}, "## heading")), React.createElement("div", {
|
|
1969
1789
|
className: styles$4.helpItem
|
|
1970
|
-
}, React.createElement(Heading
|
|
1971
|
-
|
|
1790
|
+
}, React.createElement(Heading, {
|
|
1791
|
+
marginBottom: "none",
|
|
1792
|
+
as: "h3",
|
|
1972
1793
|
className: cx(styles$4.preview, styles$4.h3)
|
|
1973
1794
|
}, "H3"), React.createElement("div", {
|
|
1974
1795
|
className: styles$4.markup
|
|
@@ -1993,6 +1814,7 @@ var CheatsheetModalDialog = function CheatsheetModalDialog() {
|
|
|
1993
1814
|
}, "~~text~~")), React.createElement("div", {
|
|
1994
1815
|
className: styles$4.helpItem
|
|
1995
1816
|
}, React.createElement(TextLink, {
|
|
1817
|
+
as: "button",
|
|
1996
1818
|
className: styles$4.preview
|
|
1997
1819
|
}, "Link"), React.createElement("div", {
|
|
1998
1820
|
className: styles$4.markup
|
|
@@ -2047,7 +1869,7 @@ var openCheatsheetModal = function openCheatsheetModal(dialogs) {
|
|
|
2047
1869
|
return dialogs.openCurrent({
|
|
2048
1870
|
title: 'Markdown formatting help',
|
|
2049
1871
|
width: 'large',
|
|
2050
|
-
minHeight: '
|
|
1872
|
+
minHeight: '415px',
|
|
2051
1873
|
shouldCloseOnEscapePress: true,
|
|
2052
1874
|
shouldCloseOnOverlayClick: true,
|
|
2053
1875
|
parameters: {
|
|
@@ -2056,7 +1878,7 @@ var openCheatsheetModal = function openCheatsheetModal(dialogs) {
|
|
|
2056
1878
|
});
|
|
2057
1879
|
};
|
|
2058
1880
|
|
|
2059
|
-
var _excluded$
|
|
1881
|
+
var _excluded$2 = ["Embedly", "children"];
|
|
2060
1882
|
|
|
2061
1883
|
var _templateObject$1;
|
|
2062
1884
|
var styles$5 = {
|
|
@@ -2079,7 +1901,7 @@ var styles$5 = {
|
|
|
2079
1901
|
function MarkdownLink(props) {
|
|
2080
1902
|
var Embedly = props.Embedly,
|
|
2081
1903
|
children = props.children,
|
|
2082
|
-
rest = _objectWithoutPropertiesLoose(props, _excluded$
|
|
1904
|
+
rest = _objectWithoutPropertiesLoose(props, _excluded$2);
|
|
2083
1905
|
|
|
2084
1906
|
if (props.className === 'embedly-card' && Embedly) {
|
|
2085
1907
|
return React.createElement(Embedly, {
|
|
@@ -2878,14 +2700,6 @@ function isValidUrl(value) {
|
|
|
2878
2700
|
return urlRegex.test(value);
|
|
2879
2701
|
}
|
|
2880
2702
|
|
|
2881
|
-
var styles$7 = {
|
|
2882
|
-
controlsContainer: /*#__PURE__*/css({
|
|
2883
|
-
display: 'flex',
|
|
2884
|
-
button: {
|
|
2885
|
-
marginRight: tokens.spacingM
|
|
2886
|
-
}
|
|
2887
|
-
})
|
|
2888
|
-
};
|
|
2889
2703
|
var InsertLinkModal = function InsertLinkModal(_ref) {
|
|
2890
2704
|
var selectedText = _ref.selectedText,
|
|
2891
2705
|
onClose = _ref.onClose;
|
|
@@ -2919,7 +2733,7 @@ var InsertLinkModal = function InsertLinkModal(_ref) {
|
|
|
2919
2733
|
mainInputRef.current.focus();
|
|
2920
2734
|
}
|
|
2921
2735
|
}, [mainInputRef]);
|
|
2922
|
-
return React.createElement(
|
|
2736
|
+
return React.createElement(React.Fragment, null, React.createElement(ModalContent, {
|
|
2923
2737
|
testId: "insert-link-modal"
|
|
2924
2738
|
}, React.createElement(Form, {
|
|
2925
2739
|
onSubmit: function onSubmit() {
|
|
@@ -2929,50 +2743,47 @@ var InsertLinkModal = function InsertLinkModal(_ref) {
|
|
|
2929
2743
|
title: title
|
|
2930
2744
|
});
|
|
2931
2745
|
}
|
|
2932
|
-
}, React.createElement(
|
|
2933
|
-
value: text,
|
|
2934
|
-
name: "link-text",
|
|
2746
|
+
}, React.createElement(FormControl, {
|
|
2935
2747
|
id: "link-text-field",
|
|
2936
|
-
|
|
2748
|
+
isDisabled: Boolean(selectedText)
|
|
2749
|
+
}, React.createElement(FormControl.Label, null, "Link text"), React.createElement(TextInput, {
|
|
2750
|
+
name: "link-text",
|
|
2751
|
+
value: text,
|
|
2937
2752
|
onChange: function onChange(e) {
|
|
2938
2753
|
setText(e.target.value);
|
|
2939
2754
|
},
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
testId: 'link-text-field'
|
|
2943
|
-
}
|
|
2944
|
-
}), React.createElement(TextField, {
|
|
2945
|
-
value: url,
|
|
2946
|
-
name: "target-url",
|
|
2755
|
+
testId: "link-text-field"
|
|
2756
|
+
})), React.createElement(FormControl, {
|
|
2947
2757
|
id: "target-url-field",
|
|
2948
|
-
|
|
2949
|
-
|
|
2758
|
+
isInvalid: touched && !urlIsValid
|
|
2759
|
+
}, React.createElement(FormControl.Label, null, "Target URL"), React.createElement(TextInput, {
|
|
2760
|
+
name: "target-url",
|
|
2761
|
+
value: url,
|
|
2950
2762
|
onChange: function onChange(e) {
|
|
2951
2763
|
setUrl(e.target.value);
|
|
2952
2764
|
setTouched(true);
|
|
2953
2765
|
},
|
|
2954
|
-
|
|
2955
|
-
|
|
2956
|
-
|
|
2957
|
-
|
|
2958
|
-
|
|
2959
|
-
|
|
2960
|
-
|
|
2961
|
-
}), React.createElement(TextField, {
|
|
2962
|
-
value: title,
|
|
2766
|
+
placeholder: "https://",
|
|
2767
|
+
maxLength: 2100,
|
|
2768
|
+
testId: "target-url-field",
|
|
2769
|
+
ref: mainInputRef
|
|
2770
|
+
}), React.createElement(FormControl.HelpText, null, "Include protocol (e.g. https://)"), touched && !urlIsValid && React.createElement(FormControl.ValidationMessage, null, "Invalid URL")), React.createElement(FormControl, {
|
|
2771
|
+
id: "link-title-field"
|
|
2772
|
+
}, React.createElement(FormControl.Label, null, "Link title"), React.createElement(TextInput, {
|
|
2963
2773
|
name: "link-title",
|
|
2964
|
-
|
|
2965
|
-
labelText: "Link title",
|
|
2966
|
-
helpText: "Recommended for accessibility",
|
|
2774
|
+
value: title,
|
|
2967
2775
|
onChange: function onChange(e) {
|
|
2968
2776
|
setTitle(e.target.value);
|
|
2969
2777
|
},
|
|
2970
|
-
|
|
2971
|
-
|
|
2972
|
-
|
|
2973
|
-
|
|
2974
|
-
|
|
2975
|
-
|
|
2778
|
+
testId: "link-title-field"
|
|
2779
|
+
}), React.createElement(FormControl.HelpText, null, "Recommended for accessibility")))), React.createElement(ModalControls, null, React.createElement(Button, {
|
|
2780
|
+
testId: "insert-link-cancel",
|
|
2781
|
+
onClick: function onClick() {
|
|
2782
|
+
return onClose(false);
|
|
2783
|
+
},
|
|
2784
|
+
variant: "secondary",
|
|
2785
|
+
size: "small"
|
|
2786
|
+
}, "Cancel"), React.createElement(Button, {
|
|
2976
2787
|
testId: "insert-link-confirm",
|
|
2977
2788
|
onClick: function onClick() {
|
|
2978
2789
|
onInsert({
|
|
@@ -2981,21 +2792,16 @@ var InsertLinkModal = function InsertLinkModal(_ref) {
|
|
|
2981
2792
|
title: title
|
|
2982
2793
|
});
|
|
2983
2794
|
},
|
|
2984
|
-
|
|
2985
|
-
|
|
2986
|
-
|
|
2987
|
-
|
|
2988
|
-
onClick: function onClick() {
|
|
2989
|
-
return onClose(false);
|
|
2990
|
-
},
|
|
2991
|
-
buttonType: "muted"
|
|
2992
|
-
}, "Cancel")));
|
|
2795
|
+
isDisabled: !urlIsValid,
|
|
2796
|
+
variant: "positive",
|
|
2797
|
+
size: "small"
|
|
2798
|
+
}, "Insert")));
|
|
2993
2799
|
};
|
|
2994
2800
|
var openInsertLinkDialog = function openInsertLinkDialog(dialogs, params) {
|
|
2995
2801
|
return dialogs.openCurrent({
|
|
2996
2802
|
title: 'Insert link',
|
|
2997
2803
|
width: 'large',
|
|
2998
|
-
minHeight: '
|
|
2804
|
+
minHeight: '410px',
|
|
2999
2805
|
shouldCloseOnEscapePress: true,
|
|
3000
2806
|
shouldCloseOnOverlayClick: true,
|
|
3001
2807
|
parameters: _extends({
|
|
@@ -3168,7 +2974,7 @@ var specialCharacters = [{
|
|
|
3168
2974
|
desc: 'diamond'
|
|
3169
2975
|
}];
|
|
3170
2976
|
|
|
3171
|
-
var styles$
|
|
2977
|
+
var styles$7 = {
|
|
3172
2978
|
buttonPanel: /*#__PURE__*/css({
|
|
3173
2979
|
display: 'flex',
|
|
3174
2980
|
flexWrap: 'wrap'
|
|
@@ -3190,20 +2996,6 @@ var styles$8 = {
|
|
|
3190
2996
|
button: /*#__PURE__*/css({
|
|
3191
2997
|
marginTop: tokens.spacingM,
|
|
3192
2998
|
marginRight: tokens.spacingS
|
|
3193
|
-
}),
|
|
3194
|
-
charContainer: /*#__PURE__*/css({
|
|
3195
|
-
display: 'flex',
|
|
3196
|
-
flexDirection: 'column',
|
|
3197
|
-
justifyContent: 'center',
|
|
3198
|
-
marginBottom: tokens.spacingM
|
|
3199
|
-
}),
|
|
3200
|
-
selectedCharacter: /*#__PURE__*/css({
|
|
3201
|
-
fontSize: tokens.fontSize3Xl,
|
|
3202
|
-
margin: 'auto'
|
|
3203
|
-
}),
|
|
3204
|
-
selectedCharacterDesc: /*#__PURE__*/css({
|
|
3205
|
-
fontSize: tokens.fontSizeM,
|
|
3206
|
-
margin: 'auto'
|
|
3207
2999
|
})
|
|
3208
3000
|
};
|
|
3209
3001
|
var SpecialCharacterModalDialog = function SpecialCharacterModalDialog(_ref) {
|
|
@@ -3213,54 +3005,59 @@ var SpecialCharacterModalDialog = function SpecialCharacterModalDialog(_ref) {
|
|
|
3213
3005
|
selectedCharacter = _useState[0],
|
|
3214
3006
|
setSelectedCharacter = _useState[1];
|
|
3215
3007
|
|
|
3216
|
-
return React.createElement(
|
|
3008
|
+
return React.createElement(React.Fragment, null, React.createElement(ModalContent, {
|
|
3217
3009
|
testId: "insert-special-character-modal"
|
|
3218
|
-
}, React.createElement(
|
|
3219
|
-
|
|
3220
|
-
|
|
3221
|
-
|
|
3222
|
-
|
|
3223
|
-
|
|
3224
|
-
|
|
3225
|
-
|
|
3010
|
+
}, React.createElement(Flex, {
|
|
3011
|
+
flexDirection: "column",
|
|
3012
|
+
alignItems: "center"
|
|
3013
|
+
}, React.createElement(Text, {
|
|
3014
|
+
as: "div",
|
|
3015
|
+
lineHeight: "lineHeight3Xl",
|
|
3016
|
+
fontSize: "fontSize3Xl",
|
|
3017
|
+
marginBottom: "spacingS"
|
|
3018
|
+
}, String.fromCharCode(selectedCharacter.code)), React.createElement(Text, {
|
|
3019
|
+
as: "div",
|
|
3020
|
+
marginBottom: "spacingS"
|
|
3226
3021
|
}, selectedCharacter.desc)), React.createElement("div", {
|
|
3227
|
-
className: styles$
|
|
3022
|
+
className: styles$7.buttonPanel
|
|
3228
3023
|
}, specialCharacters.map(function (_char) {
|
|
3229
3024
|
return React.createElement("div", {
|
|
3230
3025
|
key: _char.code
|
|
3231
3026
|
}, React.createElement(Tooltip, {
|
|
3232
|
-
className: styles$
|
|
3027
|
+
className: styles$7.tooltip,
|
|
3233
3028
|
content: _char.desc
|
|
3234
3029
|
}, React.createElement(Button, {
|
|
3235
3030
|
testId: "special-character-button",
|
|
3236
3031
|
isActive: _char.code === selectedCharacter.code,
|
|
3237
|
-
className: styles$
|
|
3238
|
-
|
|
3032
|
+
className: styles$7.charButton,
|
|
3033
|
+
variant: "transparent",
|
|
3239
3034
|
onClick: function onClick() {
|
|
3240
3035
|
return setSelectedCharacter(_char);
|
|
3241
3036
|
}
|
|
3242
3037
|
}, String.fromCharCode(_char.code))));
|
|
3243
|
-
})), React.createElement(Button, {
|
|
3244
|
-
className: styles$8.button,
|
|
3245
|
-
testId: "insert-character-confirm",
|
|
3246
|
-
onClick: function onClick() {
|
|
3247
|
-
return onClose(String.fromCharCode(selectedCharacter.code));
|
|
3248
|
-
},
|
|
3249
|
-
buttonType: "positive"
|
|
3250
|
-
}, "Insert selected"), React.createElement(Button, {
|
|
3038
|
+
}))), React.createElement(ModalControls, null, React.createElement(Button, {
|
|
3251
3039
|
testId: "insert-character-cancel",
|
|
3252
|
-
className: styles$
|
|
3040
|
+
className: styles$7.button,
|
|
3253
3041
|
onClick: function onClick() {
|
|
3254
3042
|
return onClose(false);
|
|
3255
3043
|
},
|
|
3256
|
-
|
|
3257
|
-
|
|
3044
|
+
variant: "secondary",
|
|
3045
|
+
size: "small"
|
|
3046
|
+
}, "Cancel"), React.createElement(Button, {
|
|
3047
|
+
className: styles$7.button,
|
|
3048
|
+
testId: "insert-character-confirm",
|
|
3049
|
+
onClick: function onClick() {
|
|
3050
|
+
return onClose(String.fromCharCode(selectedCharacter.code));
|
|
3051
|
+
},
|
|
3052
|
+
variant: "positive",
|
|
3053
|
+
size: "small"
|
|
3054
|
+
}, "Insert selected")));
|
|
3258
3055
|
};
|
|
3259
3056
|
var openInsertSpecialCharacter = function openInsertSpecialCharacter(dialogs) {
|
|
3260
3057
|
return dialogs.openCurrent({
|
|
3261
3058
|
title: 'Insert special character',
|
|
3262
3059
|
width: 'large',
|
|
3263
|
-
minHeight: '
|
|
3060
|
+
minHeight: '600px',
|
|
3264
3061
|
shouldCloseOnEscapePress: true,
|
|
3265
3062
|
shouldCloseOnOverlayClick: true,
|
|
3266
3063
|
parameters: {
|
|
@@ -3269,13 +3066,6 @@ var openInsertSpecialCharacter = function openInsertSpecialCharacter(dialogs) {
|
|
|
3269
3066
|
});
|
|
3270
3067
|
};
|
|
3271
3068
|
|
|
3272
|
-
var styles$9 = {
|
|
3273
|
-
controlButton: /*#__PURE__*/css({
|
|
3274
|
-
button: {
|
|
3275
|
-
marginRight: tokens.spacingM
|
|
3276
|
-
}
|
|
3277
|
-
})
|
|
3278
|
-
};
|
|
3279
3069
|
var InsertTableModal = function InsertTableModal(_ref) {
|
|
3280
3070
|
var onClose = _ref.onClose;
|
|
3281
3071
|
var mainInputRef = useRef(null);
|
|
@@ -3297,50 +3087,51 @@ var InsertTableModal = function InsertTableModal(_ref) {
|
|
|
3297
3087
|
mainInputRef.current.focus();
|
|
3298
3088
|
}
|
|
3299
3089
|
}, [mainInputRef]);
|
|
3300
|
-
return React.createElement(
|
|
3090
|
+
return React.createElement(React.Fragment, null, React.createElement(ModalContent, {
|
|
3301
3091
|
testId: "insert-table-modal"
|
|
3302
|
-
}, React.createElement(Form, null, React.createElement(
|
|
3303
|
-
labelText: "Number of rows",
|
|
3304
|
-
value: rows.toString(),
|
|
3092
|
+
}, React.createElement(Form, null, React.createElement(FormControl, {
|
|
3305
3093
|
id: "insert-table-rows-number-field",
|
|
3094
|
+
isRequired: true,
|
|
3095
|
+
isInvalid: !rowsAreValid
|
|
3096
|
+
}, React.createElement(FormControl.Label, null, "Number of rows"), React.createElement(TextInput, {
|
|
3306
3097
|
name: "rows",
|
|
3098
|
+
value: rows.toString(),
|
|
3307
3099
|
onChange: function onChange(e) {
|
|
3308
3100
|
return setRows(Number(e.target.value));
|
|
3309
3101
|
},
|
|
3310
|
-
|
|
3311
|
-
|
|
3312
|
-
|
|
3313
|
-
|
|
3314
|
-
|
|
3315
|
-
|
|
3316
|
-
|
|
3317
|
-
|
|
3318
|
-
|
|
3319
|
-
},
|
|
3320
|
-
validationMessage: !rowsAreValid ? 'Should be between 2 and 100' : '',
|
|
3321
|
-
required: true
|
|
3322
|
-
}), React.createElement(TextField, {
|
|
3323
|
-
labelText: "Number of columns",
|
|
3324
|
-
value: cols.toString(),
|
|
3102
|
+
testId: "insert-table-rows-number-field",
|
|
3103
|
+
min: 2,
|
|
3104
|
+
max: 100,
|
|
3105
|
+
pattern: "[1-9][0-9]*",
|
|
3106
|
+
type: "number",
|
|
3107
|
+
width: "small",
|
|
3108
|
+
autoComplete: "off",
|
|
3109
|
+
ref: mainInputRef
|
|
3110
|
+
}), !rowsAreValid && React.createElement(FormControl.ValidationMessage, null, "Should be between 2 and 100")), React.createElement(FormControl, {
|
|
3325
3111
|
id: "insert-table-columns-number-field",
|
|
3112
|
+
isRequired: true,
|
|
3113
|
+
isInvalid: !colsAreValid
|
|
3114
|
+
}, React.createElement(FormControl.Label, null, "Number of columns"), React.createElement(TextInput, {
|
|
3326
3115
|
name: "columns",
|
|
3116
|
+
value: cols.toString(),
|
|
3327
3117
|
onChange: function onChange(e) {
|
|
3328
3118
|
return setColumns(Number(e.target.value));
|
|
3329
3119
|
},
|
|
3330
|
-
|
|
3331
|
-
|
|
3332
|
-
|
|
3333
|
-
|
|
3334
|
-
|
|
3335
|
-
|
|
3336
|
-
|
|
3337
|
-
|
|
3120
|
+
testId: "insert-table-columns-number-field",
|
|
3121
|
+
min: 1,
|
|
3122
|
+
max: 100,
|
|
3123
|
+
pattern: "[1-9][0-9]*",
|
|
3124
|
+
type: "number",
|
|
3125
|
+
width: "small",
|
|
3126
|
+
autoComplete: "off"
|
|
3127
|
+
}), !colsAreValid && React.createElement(FormControl.ValidationMessage, null, "Should be between 1 and 100")))), React.createElement(ModalControls, null, React.createElement(Button, {
|
|
3128
|
+
testId: "insert-table-cancel",
|
|
3129
|
+
onClick: function onClick() {
|
|
3130
|
+
return onClose(false);
|
|
3338
3131
|
},
|
|
3339
|
-
|
|
3340
|
-
|
|
3341
|
-
})
|
|
3342
|
-
className: styles$9.controlButton
|
|
3343
|
-
}, React.createElement(Button, {
|
|
3132
|
+
variant: "secondary",
|
|
3133
|
+
size: "small"
|
|
3134
|
+
}, "Cancel"), React.createElement(Button, {
|
|
3344
3135
|
testId: "insert-table-confirm",
|
|
3345
3136
|
onClick: function onClick() {
|
|
3346
3137
|
return onClose({
|
|
@@ -3348,21 +3139,16 @@ var InsertTableModal = function InsertTableModal(_ref) {
|
|
|
3348
3139
|
cols: cols
|
|
3349
3140
|
});
|
|
3350
3141
|
},
|
|
3351
|
-
|
|
3352
|
-
|
|
3353
|
-
|
|
3354
|
-
|
|
3355
|
-
onClick: function onClick() {
|
|
3356
|
-
return onClose(false);
|
|
3357
|
-
},
|
|
3358
|
-
buttonType: "muted"
|
|
3359
|
-
}, "Cancel")));
|
|
3142
|
+
variant: "positive",
|
|
3143
|
+
size: "small",
|
|
3144
|
+
isDisabled: !rowsAreValid || !colsAreValid
|
|
3145
|
+
}, "Insert")));
|
|
3360
3146
|
};
|
|
3361
3147
|
var openInsertTableDialog = function openInsertTableDialog(dialogs) {
|
|
3362
3148
|
return dialogs.openCurrent({
|
|
3363
3149
|
title: 'Insert table',
|
|
3364
3150
|
width: 'medium',
|
|
3365
|
-
minHeight: '
|
|
3151
|
+
minHeight: '260px',
|
|
3366
3152
|
shouldCloseOnEscapePress: true,
|
|
3367
3153
|
shouldCloseOnOverlayClick: true,
|
|
3368
3154
|
parameters: {
|
|
@@ -3371,7 +3157,7 @@ var openInsertTableDialog = function openInsertTableDialog(dialogs) {
|
|
|
3371
3157
|
});
|
|
3372
3158
|
};
|
|
3373
3159
|
|
|
3374
|
-
var styles$
|
|
3160
|
+
var styles$8 = {
|
|
3375
3161
|
widthFiledGroup: /*#__PURE__*/css({
|
|
3376
3162
|
display: 'flex',
|
|
3377
3163
|
flexWrap: 'nowrap',
|
|
@@ -3384,12 +3170,6 @@ var styles$a = {
|
|
|
3384
3170
|
}),
|
|
3385
3171
|
radioButton: /*#__PURE__*/css({
|
|
3386
3172
|
marginLeft: tokens.spacingM
|
|
3387
|
-
}),
|
|
3388
|
-
controlsContainer: /*#__PURE__*/css({
|
|
3389
|
-
display: 'flex',
|
|
3390
|
-
button: {
|
|
3391
|
-
marginRight: tokens.spacingM
|
|
3392
|
-
}
|
|
3393
3173
|
})
|
|
3394
3174
|
};
|
|
3395
3175
|
|
|
@@ -3440,87 +3220,85 @@ var EmbedExternalContentModal = function EmbedExternalContentModal(_ref2) {
|
|
|
3440
3220
|
mainInputRef.current.focus();
|
|
3441
3221
|
}
|
|
3442
3222
|
}, [mainInputRef]);
|
|
3443
|
-
return React.createElement(
|
|
3223
|
+
return React.createElement(React.Fragment, null, React.createElement(ModalContent, {
|
|
3444
3224
|
testId: "embed-external-dialog"
|
|
3445
|
-
}, React.createElement(Form, null, React.createElement(
|
|
3446
|
-
|
|
3225
|
+
}, React.createElement(Form, null, React.createElement(FormControl, {
|
|
3226
|
+
id: "external-link-url-field",
|
|
3227
|
+
isRequired: true,
|
|
3228
|
+
isInvalid: !urlIsValid
|
|
3229
|
+
}, React.createElement(FormControl.Label, null, "Content URL"), React.createElement(TextInput, {
|
|
3447
3230
|
name: "external-link-url",
|
|
3231
|
+
value: url,
|
|
3448
3232
|
onChange: function onChange(e) {
|
|
3449
3233
|
var value = e.target.value;
|
|
3450
3234
|
setUrl(value);
|
|
3451
3235
|
setUrlValidity(isValidUrl(value));
|
|
3452
3236
|
},
|
|
3453
|
-
|
|
3454
|
-
|
|
3455
|
-
|
|
3456
|
-
|
|
3457
|
-
testId: 'external-link-url-field',
|
|
3458
|
-
placeholder: 'https://example.com',
|
|
3459
|
-
inputRef: mainInputRef
|
|
3460
|
-
},
|
|
3461
|
-
required: true,
|
|
3462
|
-
validationMessage: urlIsValid ? '' : 'URL is invalid'
|
|
3463
|
-
}), React.createElement(TextLink, {
|
|
3237
|
+
testId: "external-link-url-field",
|
|
3238
|
+
placeholder: "https://example.com",
|
|
3239
|
+
ref: mainInputRef
|
|
3240
|
+
}), React.createElement(FormControl.HelpText, null, "Include protocol (e.g. https://)"), !urlIsValid && React.createElement(FormControl.ValidationMessage, null, "URL is invalid")), React.createElement(TextLink, {
|
|
3464
3241
|
href: "http://embed.ly/providers",
|
|
3465
3242
|
target: "_blank",
|
|
3466
3243
|
rel: "noopener noreferrer"
|
|
3467
3244
|
}, "Supported sources"), React.createElement("div", {
|
|
3468
|
-
className: styles$
|
|
3469
|
-
}, React.createElement(
|
|
3470
|
-
value: width,
|
|
3245
|
+
className: styles$8.widthFiledGroup
|
|
3246
|
+
}, React.createElement(FormControl, {
|
|
3471
3247
|
id: "embedded-content-width",
|
|
3248
|
+
isRequired: true,
|
|
3249
|
+
isInvalid: !isWidthValid(Number(width), selectedUnit)
|
|
3250
|
+
}, React.createElement(FormControl.Label, null, "Width"), React.createElement(TextInput, {
|
|
3251
|
+
value: width,
|
|
3472
3252
|
name: "embedded-content-width",
|
|
3253
|
+
testId: "embedded-content-width",
|
|
3254
|
+
type: "number",
|
|
3255
|
+
width: "small",
|
|
3473
3256
|
onChange: function onChange(e) {
|
|
3474
3257
|
return setWidth(e.target.value);
|
|
3475
|
-
}
|
|
3476
|
-
|
|
3477
|
-
|
|
3478
|
-
|
|
3479
|
-
type: 'number',
|
|
3480
|
-
width: 'small'
|
|
3481
|
-
},
|
|
3482
|
-
required: true,
|
|
3483
|
-
validationMessage: isWidthValid(Number(width), selectedUnit) ? '' : 'Should be equal or less then 100'
|
|
3484
|
-
}), React.createElement("div", {
|
|
3485
|
-
className: styles$a.radioButtonGroup
|
|
3486
|
-
}, React.createElement(RadioButtonField, {
|
|
3487
|
-
className: styles$a.radioButton,
|
|
3258
|
+
}
|
|
3259
|
+
}), !isWidthValid(Number(width), selectedUnit) && React.createElement(FormControl.ValidationMessage, null, "Should be equal or less then 100")), React.createElement("div", {
|
|
3260
|
+
className: styles$8.radioButtonGroup
|
|
3261
|
+
}, React.createElement(Radio, {
|
|
3488
3262
|
id: "unit-option-percent",
|
|
3489
|
-
checked: selectedUnit === 'percent',
|
|
3490
|
-
labelText: "percent",
|
|
3491
3263
|
value: "percent",
|
|
3264
|
+
isChecked: selectedUnit === 'percent',
|
|
3492
3265
|
onChange: function onChange() {
|
|
3493
3266
|
return setUnit('percent');
|
|
3494
3267
|
},
|
|
3495
|
-
|
|
3496
|
-
}), React.createElement(
|
|
3497
|
-
className: styles$a.radioButton,
|
|
3268
|
+
className: styles$8.radioButton
|
|
3269
|
+
}, "percent"), React.createElement(Radio, {
|
|
3498
3270
|
id: "unit-option-pixels",
|
|
3499
|
-
checked: selectedUnit === 'px',
|
|
3500
|
-
labelText: "pixels",
|
|
3501
3271
|
value: "pixels",
|
|
3272
|
+
isChecked: selectedUnit === 'px',
|
|
3502
3273
|
onChange: function onChange() {
|
|
3503
3274
|
return setUnit('px');
|
|
3504
3275
|
},
|
|
3505
|
-
|
|
3506
|
-
}))), React.createElement(
|
|
3507
|
-
value: "Yes",
|
|
3508
|
-
testId: "attach-social-checkbox",
|
|
3276
|
+
className: styles$8.radioButton
|
|
3277
|
+
}, "pixels"))), React.createElement(Checkbox, {
|
|
3509
3278
|
id: "attach-social-checkbox",
|
|
3510
3279
|
name: "attach-social-checkbox",
|
|
3511
|
-
|
|
3280
|
+
value: "Yes",
|
|
3281
|
+
isChecked: attachSocial,
|
|
3512
3282
|
onChange: function onChange() {
|
|
3513
3283
|
return setAttachSocial(!attachSocial);
|
|
3514
3284
|
},
|
|
3515
|
-
|
|
3516
|
-
|
|
3517
|
-
|
|
3285
|
+
testId: "attach-social-checkbox"
|
|
3286
|
+
}, "Attach social sharing links to this element"), React.createElement(Text, {
|
|
3287
|
+
as: "p",
|
|
3288
|
+
fontColor: "gray500",
|
|
3289
|
+
marginTop: "spacingXs"
|
|
3290
|
+
}, "To enable this embedded content in your application make sure to add the\xA0", React.createElement(TextLink, {
|
|
3518
3291
|
href: "http://embed.ly/docs/products/cards",
|
|
3519
3292
|
target: "_blank",
|
|
3520
3293
|
rel: "noopener noreferrer"
|
|
3521
|
-
}, "Embedly's platform.js"), "\xA0on your development environment")), React.createElement(
|
|
3522
|
-
|
|
3523
|
-
|
|
3294
|
+
}, "Embedly's platform.js"), "\xA0on your development environment"))), React.createElement(ModalControls, null, React.createElement(Button, {
|
|
3295
|
+
testId: "emded-external-cancel",
|
|
3296
|
+
onClick: function onClick() {
|
|
3297
|
+
return onClose(false);
|
|
3298
|
+
},
|
|
3299
|
+
variant: "secondary",
|
|
3300
|
+
size: "small"
|
|
3301
|
+
}, "Cancel"), React.createElement(Button, {
|
|
3524
3302
|
testId: "embed-external-confirm",
|
|
3525
3303
|
onClick: function onClick() {
|
|
3526
3304
|
return onClose(makeEmbedlyLink({
|
|
@@ -3530,20 +3308,15 @@ var EmbedExternalContentModal = function EmbedExternalContentModal(_ref2) {
|
|
|
3530
3308
|
attachSocial: attachSocial
|
|
3531
3309
|
}));
|
|
3532
3310
|
},
|
|
3533
|
-
|
|
3534
|
-
|
|
3535
|
-
|
|
3536
|
-
onClick: function onClick() {
|
|
3537
|
-
return onClose(false);
|
|
3538
|
-
},
|
|
3539
|
-
buttonType: "muted"
|
|
3540
|
-
}, "Cancel")));
|
|
3311
|
+
variant: "positive",
|
|
3312
|
+
size: "small"
|
|
3313
|
+
}, "Insert")));
|
|
3541
3314
|
};
|
|
3542
3315
|
var openEmbedExternalContentDialog = function openEmbedExternalContentDialog(dialogs) {
|
|
3543
3316
|
return dialogs.openCurrent({
|
|
3544
3317
|
title: 'Embed external content',
|
|
3545
3318
|
width: 'large',
|
|
3546
|
-
minHeight: '
|
|
3319
|
+
minHeight: '435px',
|
|
3547
3320
|
shouldCloseOnEscapePress: true,
|
|
3548
3321
|
shouldCloseOnOverlayClick: true,
|
|
3549
3322
|
parameters: {
|
|
@@ -3552,53 +3325,45 @@ var openEmbedExternalContentDialog = function openEmbedExternalContentDialog(dia
|
|
|
3552
3325
|
});
|
|
3553
3326
|
};
|
|
3554
3327
|
|
|
3555
|
-
var styles$b = {
|
|
3556
|
-
controlButton: /*#__PURE__*/css({
|
|
3557
|
-
marginTop: tokens.spacingL,
|
|
3558
|
-
button: {
|
|
3559
|
-
marginRight: tokens.spacingM
|
|
3560
|
-
}
|
|
3561
|
-
})
|
|
3562
|
-
};
|
|
3563
3328
|
var ConfirmInsertAssetModalDialog = function ConfirmInsertAssetModalDialog(_ref) {
|
|
3564
3329
|
var onClose = _ref.onClose,
|
|
3565
3330
|
assets = _ref.assets,
|
|
3566
3331
|
locale = _ref.locale;
|
|
3567
3332
|
var localesNumber = assets.length;
|
|
3568
|
-
return React.createElement(
|
|
3333
|
+
return React.createElement(React.Fragment, null, React.createElement(ModalContent, {
|
|
3569
3334
|
testId: "confirm-insert-asset"
|
|
3570
|
-
}, React.createElement(
|
|
3335
|
+
}, React.createElement(Paragraph, null, localesNumber === 1 ? "Link asset with missing file for locale " + locale : "Link assets with missing files for locale " + locale), React.createElement(Paragraph, null, localesNumber === 1 ? 'Do you want to link to the file in its fallback locale?' : 'Do you want to link to the files in their fallback locales?'), React.createElement(EntityList, null, assets.map(function (_ref2) {
|
|
3571
3336
|
var title = _ref2.title,
|
|
3572
3337
|
description = _ref2.description,
|
|
3573
3338
|
thumbnailUrl = _ref2.thumbnailUrl,
|
|
3574
3339
|
thumbnailAltText = _ref2.thumbnailAltText;
|
|
3575
|
-
return React.createElement(
|
|
3340
|
+
return React.createElement(EntityList.Item, {
|
|
3576
3341
|
key: thumbnailUrl,
|
|
3577
3342
|
title: title,
|
|
3578
3343
|
thumbnailUrl: thumbnailUrl + "?w=46&h=46&fit=thumb",
|
|
3579
3344
|
thumbnailAltText: thumbnailAltText,
|
|
3580
3345
|
description: description
|
|
3581
3346
|
});
|
|
3582
|
-
})), React.createElement(
|
|
3583
|
-
className: styles$b.controlButton
|
|
3584
|
-
}, React.createElement(Button, {
|
|
3585
|
-
testId: "confirm-insert-asset",
|
|
3347
|
+
}))), React.createElement(ModalControls, null, React.createElement(Button, {
|
|
3586
3348
|
onClick: function onClick() {
|
|
3587
|
-
return onClose(
|
|
3349
|
+
return onClose(false);
|
|
3588
3350
|
},
|
|
3589
|
-
|
|
3590
|
-
|
|
3351
|
+
variant: "secondary",
|
|
3352
|
+
size: "small"
|
|
3353
|
+
}, "Cancel"), React.createElement(Button, {
|
|
3354
|
+
testId: "confirm-insert-asset",
|
|
3591
3355
|
onClick: function onClick() {
|
|
3592
|
-
return onClose(
|
|
3356
|
+
return onClose(true);
|
|
3593
3357
|
},
|
|
3594
|
-
|
|
3595
|
-
|
|
3358
|
+
variant: "positive",
|
|
3359
|
+
size: "small"
|
|
3360
|
+
}, "Confirm")));
|
|
3596
3361
|
};
|
|
3597
3362
|
var openConfirmInsertAsset = function openConfirmInsertAsset(dialogs, options) {
|
|
3598
3363
|
return dialogs.openCurrent({
|
|
3599
3364
|
title: 'Confirm using fallback assets',
|
|
3600
3365
|
width: 'medium',
|
|
3601
|
-
minHeight: '
|
|
3366
|
+
minHeight: '270px',
|
|
3602
3367
|
shouldCloseOnEscapePress: true,
|
|
3603
3368
|
shouldCloseOnOverlayClick: true,
|
|
3604
3369
|
parameters: _extends({
|
|
@@ -3607,7 +3372,7 @@ var openConfirmInsertAsset = function openConfirmInsertAsset(dialogs, options) {
|
|
|
3607
3372
|
});
|
|
3608
3373
|
};
|
|
3609
3374
|
|
|
3610
|
-
var styles$
|
|
3375
|
+
var styles$9 = {
|
|
3611
3376
|
root: /*#__PURE__*/css({
|
|
3612
3377
|
position: 'fixed',
|
|
3613
3378
|
left: 0,
|
|
@@ -3726,17 +3491,17 @@ var ZenModeModalDialog = function ZenModeModalDialog(props) {
|
|
|
3726
3491
|
|
|
3727
3492
|
var direction = (_props$sdk$locales$di = props.sdk.locales.direction[props.locale]) != null ? _props$sdk$locales$di : 'ltr';
|
|
3728
3493
|
return React.createElement("div", {
|
|
3729
|
-
className: styles$
|
|
3494
|
+
className: styles$9.root,
|
|
3730
3495
|
"data-test-id": "zen-mode-markdown-editor"
|
|
3731
3496
|
}, React.createElement("div", {
|
|
3732
|
-
className: styles$
|
|
3497
|
+
className: styles$9.topSplit
|
|
3733
3498
|
}, React.createElement(MarkdownToolbar, {
|
|
3734
3499
|
mode: "zen",
|
|
3735
3500
|
disabled: false,
|
|
3736
3501
|
canUploadAssets: false,
|
|
3737
3502
|
actions: actions
|
|
3738
3503
|
})), React.createElement("div", {
|
|
3739
|
-
className: cx(styles$
|
|
3504
|
+
className: cx(styles$9.editorSplit, (_cx = {}, _cx[styles$9.editorSplitFullscreen] = showPreview === false, _cx))
|
|
3740
3505
|
}, React.createElement(MarkdownTextarea, {
|
|
3741
3506
|
mode: "zen",
|
|
3742
3507
|
visible: true,
|
|
@@ -3755,38 +3520,36 @@ var ZenModeModalDialog = function ZenModeModalDialog(props) {
|
|
|
3755
3520
|
});
|
|
3756
3521
|
}
|
|
3757
3522
|
})), showPreview && React.createElement("div", {
|
|
3758
|
-
className: styles$
|
|
3523
|
+
className: styles$9.previewSplit
|
|
3759
3524
|
}, React.createElement(MarkdownPreview, {
|
|
3760
3525
|
direction: direction,
|
|
3761
3526
|
mode: "zen",
|
|
3762
3527
|
value: currentValue,
|
|
3763
3528
|
previewComponents: props.previewComponents
|
|
3764
3529
|
})), showPreview && React.createElement("div", {
|
|
3765
|
-
className: styles$
|
|
3530
|
+
className: styles$9.separator
|
|
3766
3531
|
}), showPreview && React.createElement("button", {
|
|
3767
|
-
className: cx(styles$
|
|
3532
|
+
className: cx(styles$9.button, styles$9.hideButton),
|
|
3768
3533
|
"aria-label": "Hide preview",
|
|
3769
3534
|
onClick: function onClick() {
|
|
3770
3535
|
setShowPreview(false);
|
|
3771
3536
|
}
|
|
3772
|
-
}, React.createElement(
|
|
3773
|
-
|
|
3774
|
-
color: "muted",
|
|
3537
|
+
}, React.createElement(ChevronRightIcon, {
|
|
3538
|
+
variant: "muted",
|
|
3775
3539
|
size: "tiny",
|
|
3776
|
-
className: styles$
|
|
3540
|
+
className: styles$9.icon
|
|
3777
3541
|
})), !showPreview && React.createElement("button", {
|
|
3778
|
-
className: cx(styles$
|
|
3542
|
+
className: cx(styles$9.button, styles$9.showButton),
|
|
3779
3543
|
"aria-label": "Show preview",
|
|
3780
3544
|
onClick: function onClick() {
|
|
3781
3545
|
setShowPreview(true);
|
|
3782
3546
|
}
|
|
3783
|
-
}, React.createElement(
|
|
3784
|
-
|
|
3785
|
-
color: "muted",
|
|
3547
|
+
}, React.createElement(ChevronLeftIcon, {
|
|
3548
|
+
variant: "muted",
|
|
3786
3549
|
size: "tiny",
|
|
3787
|
-
className: styles$
|
|
3550
|
+
className: styles$9.icon
|
|
3788
3551
|
})), React.createElement("div", {
|
|
3789
|
-
className: styles$
|
|
3552
|
+
className: styles$9.bottomSplit
|
|
3790
3553
|
}, React.createElement(MarkdownBottomBar, null, React.createElement(MarkdownHelp, {
|
|
3791
3554
|
onClick: function onClick() {
|
|
3792
3555
|
openCheatsheetModal(props.sdk.dialogs);
|
|
@@ -4568,7 +4331,7 @@ function createMarkdownActions(props) {
|
|
|
4568
4331
|
};
|
|
4569
4332
|
}
|
|
4570
4333
|
|
|
4571
|
-
var styles$
|
|
4334
|
+
var styles$a = {
|
|
4572
4335
|
container: /*#__PURE__*/css({
|
|
4573
4336
|
display: 'flex',
|
|
4574
4337
|
flexDirection: 'column',
|
|
@@ -4626,7 +4389,7 @@ function MarkdownEditor(props) {
|
|
|
4626
4389
|
openCheatsheetModal(props.sdk.dialogs);
|
|
4627
4390
|
}, []);
|
|
4628
4391
|
return React.createElement("div", {
|
|
4629
|
-
className: styles$
|
|
4392
|
+
className: styles$a.container,
|
|
4630
4393
|
"data-test-id": "markdown-editor"
|
|
4631
4394
|
}, React.createElement(MarkdownTabs, {
|
|
4632
4395
|
active: selectedTab,
|