@contentful/field-editor-markdown 0.17.1 → 1.0.2

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.
@@ -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, { useState, useRef, useEffect } from 'react';
6
+ import React, { useRef, useState, useEffect } from 'react';
7
7
  import { css, cx } from 'emotion';
8
- import tokens from '@contentful/forma-36-tokens';
8
+ import tokens from '@contentful/f36-tokens';
9
9
  import { ConstraintsUtils, CharCounter, CharValidation, FieldConnector, ModalDialogLauncher } from '@contentful/field-editor-shared';
10
- import noop from 'lodash-es/noop';
11
- import { Dropdown, DropdownList, DropdownListItem, Button, Icon, Tooltip, Paragraph, TextLink, Modal, Heading as Heading$1, Form, TextField, DisplayText, RadioButtonField, CheckboxField, HelpText, Typography, EntityList, EntityListItem } from '@contentful/forma-36-react-components';
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';
@@ -22,6 +22,7 @@ import Markdown from 'markdown-to-jsx';
22
22
  import DOMPurify from 'dompurify';
23
23
  import inRange from 'lodash-es/inRange';
24
24
  import isObject from 'lodash-es/isObject';
25
+ import { toExternal } from '@contentful/hostname-transformer';
25
26
  import extend from 'lodash-es/extend';
26
27
  import isString from 'lodash-es/isString';
27
28
  import isFinite from 'lodash-es/isFinite';
@@ -188,16 +189,7 @@ var _excluded = ["label"],
188
189
  _excluded7 = ["label"],
189
190
  _excluded8 = ["label"],
190
191
  _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"];
192
+ _excluded10 = ["label"];
201
193
  var srOnly = /*#__PURE__*/css({
202
194
  position: 'absolute',
203
195
  width: '1px',
@@ -208,49 +200,49 @@ var srOnly = /*#__PURE__*/css({
208
200
  clip: 'rect(0, 0, 0, 0)',
209
201
  border: '0'
210
202
  });
211
- var Bold = function Bold(_ref) {
203
+ var Zen = function Zen(_ref) {
212
204
  var label = _ref.label,
213
205
  rest = _objectWithoutPropertiesLoose(_ref, _excluded);
214
206
 
215
207
  return React.createElement("svg", Object.assign({
216
208
  width: 14,
217
209
  height: 14,
218
- viewBox: "0 0 1782 1792"
210
+ viewBox: "0 0 1792 1792"
219
211
  }, rest), React.createElement("path", {
220
- d: "M747 1521q74 32 140 32 376 0 376-335 0-114-41-180-27-44-61.5-74t-67.5-46.5-80.5-25-84-10.5-94.5-2q-73 0-101 10 0 53-.5 159t-.5 158q0 8-1 67.5t-.5 96.5 4.5 83.5 12 66.5zm-14-746q42 7 109 7 82 0 143-13t110-44.5 74.5-89.5 25.5-142q0-70-29-122.5t-79-82T979 245t-124-14q-50 0-130 13 0 50 4 151t4 152q0 27-.5 80t-.5 79q0 46 1 69zm-541 889l2-94q15-4 85-16t106-27q7-12 12.5-27t8.5-33.5 5.5-32.5 3-37.5.5-34V1297q0-982-22-1025-4-8-22-14.5t-44.5-11-49.5-7-48.5-4.5-30.5-3l-4-83q98-2 340-11.5t373-9.5q23 0 68 .5t68 .5q70 0 136.5 13t128.5 42 108 71 74 104.5 28 137.5q0 52-16.5 95.5t-39 72T1398 722t-73 45-84 40q154 35 256.5 134t102.5 248q0 100-35 179.5t-93.5 130.5-138 85.5T1170 1633t-176 14q-44 0-132-3t-132-3q-106 0-307 11t-231 12z"
212
+ 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
213
  }), React.createElement("span", {
222
214
  className: srOnly
223
215
  }, label));
224
216
  };
225
- var Italic = function Italic(_ref2) {
217
+ var Strikethrough = function Strikethrough(_ref2) {
226
218
  var label = _ref2.label,
227
219
  rest = _objectWithoutPropertiesLoose(_ref2, _excluded2);
228
220
 
229
221
  return React.createElement("svg", Object.assign({
230
222
  width: 14,
231
223
  height: 14,
232
- viewBox: "0 0 1782 1792"
224
+ viewBox: "0 0 1792 1792"
233
225
  }, rest), React.createElement("path", {
234
- d: "M384 1662l17-85q22-7 61.5-16.5t72-19T594 1518q28-35 41-101 1-7 62-289t114-543.5T863 288v-25q-24-13-54.5-18.5t-69.5-8-58-5.5l19-103q33 2 120 6.5t149.5 7T1090 144q48 0 98.5-2.5t121-7 98.5-6.5q-5 39-19 89-30 10-101.5 28.5T1179 279q-8 19-14 42.5t-9 40-7.5 45.5-6.5 42q-27 148-87.5 419.5T977 1224q-2 9-13 58t-20 90-16 83.5-6 57.5l1 18q17 4 185 31-3 44-16 99-11 0-32.5 1.5t-32.5 1.5q-29 0-87-10t-86-10q-138-2-206-2-51 0-143 9t-121 11z"
226
+ 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
227
  }), React.createElement("span", {
236
228
  className: srOnly
237
229
  }, label));
238
230
  };
239
- var Quote = function Quote(_ref3) {
231
+ var Indent = function Indent(_ref3) {
240
232
  var label = _ref3.label,
241
233
  rest = _objectWithoutPropertiesLoose(_ref3, _excluded3);
242
234
 
243
235
  return React.createElement("svg", Object.assign({
244
236
  width: 14,
245
237
  height: 14,
246
- viewBox: "0 0 1782 1792"
238
+ viewBox: "0 0 1792 1792"
247
239
  }, rest), React.createElement("path", {
248
- d: "M832 960v384q0 80-56 136t-136 56H256q-80 0-136-56t-56-136V640q0-104 40.5-198.5T214 278t163.5-109.5T576 128h64q26 0 45 19t19 45v128q0 26-19 45t-45 19h-64q-106 0-181 75t-75 181v32q0 40 28 68t68 28h224q80 0 136 56t56 136zm896 0v384q0 80-56 136t-136 56h-384q-80 0-136-56t-56-136V640q0-104 40.5-198.5T1110 278t163.5-109.5T1472 128h64q26 0 45 19t19 45v128q0 26-19 45t-45 19h-64q-106 0-181 75t-75 181v32q0 40 28 68t68 28h224q80 0 136 56t56 136z"
240
+ 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
241
  }), React.createElement("span", {
250
242
  className: srOnly
251
243
  }, label));
252
244
  };
253
- var List = function List(_ref4) {
245
+ var Dedent = function Dedent(_ref4) {
254
246
  var label = _ref4.label,
255
247
  rest = _objectWithoutPropertiesLoose(_ref4, _excluded4);
256
248
 
@@ -259,26 +251,26 @@ var List = function List(_ref4) {
259
251
  height: 14,
260
252
  viewBox: "0 0 1792 1792"
261
253
  }, rest), React.createElement("path", {
262
- d: "M256 1312v192q0 13-9.5 22.5T224 1536H32q-13 0-22.5-9.5T0 1504v-192q0-13 9.5-22.5T32 1280h192q13 0 22.5 9.5t9.5 22.5zm0-384v192q0 13-9.5 22.5T224 1152H32q-13 0-22.5-9.5T0 1120V928q0-13 9.5-22.5T32 896h192q13 0 22.5 9.5T256 928zm0-384v192q0 13-9.5 22.5T224 768H32q-13 0-22.5-9.5T0 736V544q0-13 9.5-22.5T32 512h192q13 0 22.5 9.5T256 544zm1536 768v192q0 13-9.5 22.5t-22.5 9.5H416q-13 0-22.5-9.5T384 1504v-192q0-13 9.5-22.5t22.5-9.5h1344q13 0 22.5 9.5t9.5 22.5zM256 160v192q0 13-9.5 22.5T224 384H32q-13 0-22.5-9.5T0 352V160q0-13 9.5-22.5T32 128h192q13 0 22.5 9.5T256 160zm1536 768v192q0 13-9.5 22.5t-22.5 9.5H416q-13 0-22.5-9.5T384 1120V928q0-13 9.5-22.5T416 896h1344q13 0 22.5 9.5t9.5 22.5zm0-384v192q0 13-9.5 22.5T1760 768H416q-13 0-22.5-9.5T384 736V544q0-13 9.5-22.5T416 512h1344q13 0 22.5 9.5t9.5 22.5zm0-384v192q0 13-9.5 22.5T1760 384H416q-13 0-22.5-9.5T384 352V160q0-13 9.5-22.5T416 128h1344q13 0 22.5 9.5t9.5 22.5z"
254
+ 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
255
  }), React.createElement("span", {
264
256
  className: srOnly
265
257
  }, label));
266
258
  };
267
- var ListOl = function ListOl(_ref5) {
259
+ var Cubes = function Cubes(_ref5) {
268
260
  var label = _ref5.label,
269
261
  rest = _objectWithoutPropertiesLoose(_ref5, _excluded5);
270
262
 
271
263
  return React.createElement("svg", Object.assign({
272
- width: 14,
264
+ width: 18,
273
265
  height: 14,
274
- viewBox: "0 0 1792 1792"
266
+ viewBox: "0 0 2304 1792"
275
267
  }, rest), React.createElement("path", {
276
- d: "M381 1620q0 80-54.5 126T191 1792q-106 0-172-66l57-88q49 45 106 45 29 0 50.5-14.5T254 1626q0-64-105-56l-26-56q8-10 32.5-43.5t42.5-54 37-38.5v-1q-16 0-48.5 1t-48.5 1v53H32v-152h333v88l-95 115q51 12 81 49t30 88zm2-627v159H21q-6-36-6-54 0-51 23.5-93T95 937t66-47.5 56.5-43.5 23.5-45q0-25-14.5-38.5T187 749q-46 0-81 58l-85-59q24-51 71.5-79.5T198 640q73 0 123 41.5T371 794q0 50-34 91.5T262 950t-75.5 50.5T151 1053h127v-60h105zm1409 319v192q0 13-9.5 22.5t-22.5 9.5H544q-13 0-22.5-9.5T512 1504v-192q0-14 9-23t23-9h1216q13 0 22.5 9.5t9.5 22.5zM384 413v99H49v-99h107q0-41 .5-121.5T157 170v-12h-2q-8 17-50 54l-71-76L170 9h106v404h108zm1408 387v192q0 13-9.5 22.5t-22.5 9.5H544q-13 0-22.5-9.5T512 992V800q0-14 9-23t23-9h1216q13 0 22.5 9.5t9.5 22.5zm0-512v192q0 13-9.5 22.5T1760 512H544q-13 0-22.5-9.5T512 480V288q0-13 9.5-22.5T544 256h1216q13 0 22.5 9.5t9.5 22.5z"
268
+ 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
269
  }), React.createElement("span", {
278
270
  className: srOnly
279
271
  }, label));
280
272
  };
281
- var Link = function Link(_ref6) {
273
+ var Table = function Table(_ref6) {
282
274
  var label = _ref6.label,
283
275
  rest = _objectWithoutPropertiesLoose(_ref6, _excluded6);
284
276
 
@@ -287,12 +279,12 @@ var Link = function Link(_ref6) {
287
279
  height: 14,
288
280
  viewBox: "0 0 1792 1792"
289
281
  }, rest), React.createElement("path", {
290
- d: "M1520 1216q0-40-28-68l-208-208q-28-28-68-28-42 0-72 32 3 3 19 18.5t21.5 21.5 15 19 13 25.5 3.5 27.5q0 40-28 68t-68 28q-15 0-27.5-3.5t-25.5-13-19-15-21.5-21.5-18.5-19q-33 31-33 73 0 40 28 68l206 207q27 27 68 27 40 0 68-26l147-146q28-28 28-67zM817 511q0-40-28-68L583 236q-28-28-68-28-39 0-68 27L300 381q-28 28-28 67 0 40 28 68l208 208q27 27 68 27 42 0 72-31-3-3-19-18.5T607.5 680t-15-19-13-25.5T576 608q0-40 28-68t68-28q15 0 27.5 3.5t25.5 13 19 15 21.5 21.5 18.5 19q33-31 33-73zm895 705q0 120-85 203l-147 146q-83 83-203 83-121 0-204-85l-206-207q-83-83-83-203 0-123 88-209l-88-88q-86 88-208 88-120 0-204-84L164 652q-84-84-84-204t85-203L312 99q83-83 203-83 121 0 204 85l206 207q83 83 83 203 0 123-88 209l88 88q86-88 208-88 120 0 204 84l208 208q84 84 84 204z"
282
+ 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
283
  }), React.createElement("span", {
292
284
  className: srOnly
293
285
  }, label));
294
286
  };
295
- var Heading = function Heading(_ref7) {
287
+ var SpecialChar = function SpecialChar(_ref7) {
296
288
  var label = _ref7.label,
297
289
  rest = _objectWithoutPropertiesLoose(_ref7, _excluded7);
298
290
 
@@ -301,12 +293,12 @@ var Heading = function Heading(_ref7) {
301
293
  height: 14,
302
294
  viewBox: "0 0 1792 1792"
303
295
  }, rest), React.createElement("path", {
304
- d: "M1682 1664q-44 0-132.5-3.5T1416 1657q-44 0-132 3.5t-132 3.5q-24 0-37-20.5t-13-45.5q0-31 17-46t39-17 51-7 45-15q33-21 33-140l-1-391q0-21-1-31-13-4-50-4H560q-38 0-51 4-1 10-1 31l-1 371q0 142 37 164 16 10 48 13t57 3.5 45 15 20 45.5q0 26-12.5 48t-36.5 22q-47 0-139.5-3.5T387 1657q-43 0-128 3.5t-127 3.5q-23 0-35.5-21T84 1598q0-30 15.5-45t36-17.5 47.5-7.5 42-15q33-23 33-143l-1-57V500q0-3 .5-26t0-36.5T256 399t-3.5-42-6.5-36.5-11-31.5-16-18q-15-10-45-12t-53-2-41-14-18-45q0-26 12-48t36-22q46 0 138.5 3.5T387 135q42 0 126.5-3.5T640 128q25 0 37.5 22t12.5 48q0 30-17 43.5T634.5 256t-49.5 4-43 13q-35 21-35 160l1 320q0 21 1 32 13 3 39 3h699q25 0 38-3 1-11 1-32l1-320q0-139-35-160-18-11-58.5-12.5t-66-13T1102 198q0-26 12.5-48t37.5-22q44 0 132 3.5t132 3.5q43 0 129-3.5t129-3.5q25 0 37.5 22t12.5 48q0 30-17.5 44t-40 14.5-51.5 3-44 12.5q-35 23-35 161l1 943q0 119 34 140 16 10 46 13.5t53.5 4.5 41.5 15.5 18 44.5q0 26-12 48t-36 22z"
296
+ 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
297
  }), React.createElement("span", {
306
298
  className: srOnly
307
299
  }, label));
308
300
  };
309
- var Zen = function Zen(_ref8) {
301
+ var OrgLinks = function OrgLinks(_ref8) {
310
302
  var label = _ref8.label,
311
303
  rest = _objectWithoutPropertiesLoose(_ref8, _excluded8);
312
304
 
@@ -315,12 +307,12 @@ var Zen = function Zen(_ref8) {
315
307
  height: 14,
316
308
  viewBox: "0 0 1792 1792"
317
309
  }, rest), React.createElement("path", {
318
- 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"
310
+ 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
311
  }), React.createElement("span", {
320
312
  className: srOnly
321
313
  }, label));
322
314
  };
323
- var Strikethrough = function Strikethrough(_ref9) {
315
+ var Undo = function Undo(_ref9) {
324
316
  var label = _ref9.label,
325
317
  rest = _objectWithoutPropertiesLoose(_ref9, _excluded9);
326
318
 
@@ -329,141 +321,15 @@ var Strikethrough = function Strikethrough(_ref9) {
329
321
  height: 14,
330
322
  viewBox: "0 0 1792 1792"
331
323
  }, rest), React.createElement("path", {
332
- 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"
324
+ 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
325
  }), React.createElement("span", {
334
326
  className: srOnly
335
327
  }, label));
336
328
  };
337
- var Code = function Code(_ref10) {
329
+ var Redo = function Redo(_ref10) {
338
330
  var label = _ref10.label,
339
331
  rest = _objectWithoutPropertiesLoose(_ref10, _excluded10);
340
332
 
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
333
  return React.createElement("svg", Object.assign({
468
334
  width: 14,
469
335
  height: 14,
@@ -476,36 +342,21 @@ var Redo = function Redo(_ref19) {
476
342
  };
477
343
 
478
344
  var HeadingSelector = function HeadingSelector(props) {
479
- var _useState = useState(false),
480
- isOpen = _useState[0],
481
- setOpen = _useState[1];
482
-
483
345
  var handleMenuClick = function handleMenuClick(heading) {
484
346
  props.onSelect(heading);
485
- setOpen(false);
486
347
  };
487
348
 
488
- return React.createElement(Dropdown, {
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, {
349
+ return React.createElement(Menu, null, React.createElement(Menu.Trigger, null, props.children), React.createElement(Menu.List, null, React.createElement(Menu.Item, {
499
350
  testId: "markdown-action-button-heading-h1",
500
351
  onClick: function onClick() {
501
352
  return handleMenuClick('h1');
502
353
  }
503
- }, "Heading 1"), React.createElement(DropdownListItem, {
354
+ }, "Heading 1"), React.createElement(Menu.Item, {
504
355
  testId: "markdown-action-button-heading-h2",
505
356
  onClick: function onClick() {
506
357
  return handleMenuClick('h2');
507
358
  }
508
- }, "Heading 2"), React.createElement(DropdownListItem, {
359
+ }, "Heading 2"), React.createElement(Menu.Item, {
509
360
  testId: "markdown-action-button-heading-h3",
510
361
  onClick: function onClick() {
511
362
  return handleMenuClick('h3');
@@ -518,11 +369,11 @@ var InsertLinkSelector = function InsertLinkSelector(props) {
518
369
  return React.createElement(MultipleMediaContextMenu, Object.assign({}, props));
519
370
  } else {
520
371
  return React.createElement(Button, {
521
- disabled: props.disabled,
522
- icon: "Asset",
372
+ isDisabled: props.disabled,
373
+ startIcon: React.createElement(AssetIcon, null),
523
374
  testId: "markdownEditor.linkExistingAssets",
524
375
  size: "small",
525
- buttonType: "muted",
376
+ variant: "secondary",
526
377
  onClick: function onClick() {
527
378
  props.onSelectExisting();
528
379
  }
@@ -531,45 +382,29 @@ var InsertLinkSelector = function InsertLinkSelector(props) {
531
382
  };
532
383
 
533
384
  var MultipleMediaContextMenu = function MultipleMediaContextMenu(props) {
534
- var _useState = useState(false),
535
- isOpen = _useState[0],
536
- setOpen = _useState[1];
537
-
538
- var handleMenuClick = function handleMenuClick(fn) {
539
- fn();
540
- setOpen(false);
541
- };
542
-
543
- return React.createElement(Dropdown, {
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, {
385
+ return React.createElement(Menu, {
386
+ placement: "bottom-end"
387
+ }, React.createElement(Menu.Trigger, null, React.createElement(Button, {
388
+ endIcon: React.createElement(ChevronDownIcon, null),
389
+ isDisabled: props.disabled,
390
+ startIcon: React.createElement(AssetIcon, null),
391
+ testId: "markdownEditor.insertMediaDropdownTrigger",
392
+ size: "small",
393
+ variant: "secondary"
394
+ }, "Insert media")), React.createElement(Menu.List, null, React.createElement(Menu.Item, {
561
395
  testId: "markdownEditor.uploadAssetsAndLink",
562
396
  onClick: function onClick() {
563
- return handleMenuClick(props.onAddNew);
397
+ return props.onAddNew();
564
398
  }
565
- }, "Add new media and link"), React.createElement(DropdownListItem, {
399
+ }, "Add new media and link"), React.createElement(Menu.Item, {
566
400
  testId: "markdownEditor.linkExistingAssets",
567
401
  onClick: function onClick() {
568
- return handleMenuClick(props.onSelectExisting);
402
+ return props.onSelectExisting();
569
403
  }
570
404
  }, "Link existing media")));
571
405
  };
572
406
 
407
+ var _excluded$1 = ["tooltip", "onClick", "children", "className", "variant", "tooltipPlace", "isDisabled"];
573
408
  var styles$1 = {
574
409
  root: /*#__PURE__*/css({
575
410
  position: 'relative',
@@ -579,18 +414,11 @@ var styles$1 = {
579
414
  padding: tokens.spacingXs,
580
415
  borderTopLeftRadius: tokens.borderRadiusSmall
581
416
  }),
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
417
  button: /*#__PURE__*/css({
593
- minWidth: '46px'
418
+ height: '30px',
419
+ width: '36px',
420
+ marginLeft: tokens.spacing2Xs,
421
+ marginRight: tokens.spacing2Xs
594
422
  }),
595
423
  icon: /*#__PURE__*/css({
596
424
  fill: tokens.gray700,
@@ -606,42 +434,39 @@ var styles$1 = {
606
434
  zIndex: /*#__PURE__*/Number(tokens.zIndexTooltip)
607
435
  })
608
436
  };
609
-
610
- function ToolbarButton(props) {
437
+ var ToolbarButton = /*#__PURE__*/React.forwardRef(function (props, ref) {
611
438
  var tooltip = props.tooltip,
612
- _props$onClick = props.onClick,
613
- _onClick = _props$onClick === void 0 ? noop : _props$onClick,
614
- testId = props.testId,
439
+ onClick = props.onClick,
615
440
  children = props.children,
616
441
  className = props.className,
617
- _props$buttonType = props.buttonType,
618
- buttonType = _props$buttonType === void 0 ? 'naked' : _props$buttonType,
442
+ _props$variant = props.variant,
443
+ variant = _props$variant === void 0 ? 'transparent' : _props$variant,
619
444
  _props$tooltipPlace = props.tooltipPlace,
620
445
  tooltipPlace = _props$tooltipPlace === void 0 ? 'top' : _props$tooltipPlace,
621
- _props$disabled = props.disabled,
622
- disabled = _props$disabled === void 0 ? false : _props$disabled;
446
+ _props$isDisabled = props.isDisabled,
447
+ isDisabled = _props$isDisabled === void 0 ? false : _props$isDisabled,
448
+ otherProps = _objectWithoutPropertiesLoose(props, _excluded$1);
623
449
 
624
- var button = React.createElement(Button, {
450
+ var button = React.createElement(Button, Object.assign({}, otherProps, {
451
+ ref: ref,
625
452
  className: cx(styles$1.button, className),
626
- disabled: disabled,
627
- onClick: function onClick() {
628
- _onClick();
629
- },
630
- testId: testId,
631
- buttonType: buttonType,
453
+ isDisabled: isDisabled,
454
+ onClick: onClick,
455
+ variant: variant,
632
456
  size: "small"
633
- }, children);
457
+ }), children);
634
458
 
635
459
  if (tooltip) {
636
460
  return React.createElement(Tooltip, {
637
461
  className: styles$1.tooltip,
638
- place: tooltipPlace,
462
+ placement: tooltipPlace,
639
463
  content: tooltip
640
464
  }, button);
641
465
  }
642
466
 
643
467
  return button;
644
- }
468
+ });
469
+ ToolbarButton.displayName = 'ToolbarButton';
645
470
 
646
471
  function MainButtons(props) {
647
472
  var tooltipPlace = props.mode === 'zen' ? 'bottom' : 'top';
@@ -652,66 +477,66 @@ function MainButtons(props) {
652
477
  }
653
478
  }
654
479
  }, React.createElement(ToolbarButton, {
655
- disabled: props.disabled,
480
+ isDisabled: props.disabled,
656
481
  testId: "markdown-action-button-heading",
657
482
  tooltip: "Headings",
658
483
  tooltipPlace: tooltipPlace
659
- }, React.createElement(Heading, {
660
- label: "Headings",
484
+ }, React.createElement(HeadingIcon, {
485
+ "aria-label": "Headings",
661
486
  className: styles$1.icon
662
487
  }))), React.createElement(ToolbarButton, {
663
- disabled: props.disabled,
488
+ isDisabled: props.disabled,
664
489
  testId: "markdown-action-button-bold",
665
490
  tooltip: "Bold",
666
491
  tooltipPlace: tooltipPlace,
667
492
  onClick: props.actions.simple.bold
668
- }, React.createElement(Bold, {
669
- label: "Bold",
493
+ }, React.createElement(FormatBoldIcon, {
494
+ "aria-label": "Bold",
670
495
  className: styles$1.icon
671
496
  })), React.createElement(ToolbarButton, {
672
- disabled: props.disabled,
497
+ isDisabled: props.disabled,
673
498
  testId: "markdown-action-button-italic",
674
499
  tooltip: "Italic",
675
500
  tooltipPlace: tooltipPlace,
676
501
  onClick: props.actions.simple.italic
677
- }, React.createElement(Italic, {
678
- label: "Italic",
502
+ }, React.createElement(FormatItalicIcon, {
503
+ "aria-label": "Italic",
679
504
  className: styles$1.icon
680
505
  })), React.createElement(ToolbarButton, {
681
- disabled: props.disabled,
506
+ isDisabled: props.disabled,
682
507
  testId: "markdown-action-button-quote",
683
508
  tooltip: "Quote",
684
509
  tooltipPlace: tooltipPlace,
685
510
  onClick: props.actions.simple.quote
686
- }, React.createElement(Quote, {
687
- label: "Quote",
511
+ }, React.createElement(QuoteIcon, {
512
+ "aria-label": "Quote",
688
513
  className: styles$1.icon
689
514
  })), React.createElement(ToolbarButton, {
690
- disabled: props.disabled,
515
+ isDisabled: props.disabled,
691
516
  testId: "markdown-action-button-ul",
692
517
  tooltip: "Unordered list",
693
518
  tooltipPlace: tooltipPlace,
694
519
  onClick: props.actions.simple.ul
695
- }, React.createElement(List, {
696
- label: "Unordered list",
520
+ }, React.createElement(ListBulletedIcon, {
521
+ "aria-label": "Unordered list",
697
522
  className: styles$1.icon
698
523
  })), React.createElement(ToolbarButton, {
699
- disabled: props.disabled,
524
+ isDisabled: props.disabled,
700
525
  testId: "markdown-action-button-ol",
701
526
  tooltip: "Ordered list",
702
527
  tooltipPlace: tooltipPlace,
703
528
  onClick: props.actions.simple.ol
704
- }, React.createElement(ListOl, {
705
- label: "Ordered list",
529
+ }, React.createElement(ListNumberedIcon, {
530
+ "aria-label": "Ordered list",
706
531
  className: styles$1.icon
707
532
  })), React.createElement(ToolbarButton, {
708
- disabled: props.disabled,
533
+ isDisabled: props.disabled,
709
534
  testId: "markdown-action-button-link",
710
535
  tooltip: "Link",
711
536
  tooltipPlace: tooltipPlace,
712
537
  onClick: props.actions.insertLink
713
- }, React.createElement(Link, {
714
- label: "Link",
538
+ }, React.createElement(LinkIcon, {
539
+ "aria-label": "Link",
715
540
  className: styles$1.icon
716
541
  })));
717
542
  }
@@ -719,7 +544,7 @@ function MainButtons(props) {
719
544
  function AdditionalButtons(props) {
720
545
  var tooltipPlace = props.mode === 'zen' ? 'bottom' : 'top';
721
546
  return React.createElement(React.Fragment, null, React.createElement(ToolbarButton, {
722
- disabled: props.disabled,
547
+ isDisabled: props.disabled,
723
548
  testId: "markdown-action-button-strike",
724
549
  tooltip: "Strike out",
725
550
  tooltipPlace: tooltipPlace,
@@ -728,25 +553,25 @@ function AdditionalButtons(props) {
728
553
  label: "Strike out",
729
554
  className: styles$1.icon
730
555
  })), React.createElement(ToolbarButton, {
731
- disabled: props.disabled,
556
+ isDisabled: props.disabled,
732
557
  testId: "markdown-action-button-code",
733
558
  tooltip: "Code block",
734
559
  tooltipPlace: tooltipPlace,
735
560
  onClick: props.actions.simple.code
736
- }, React.createElement(Code, {
737
- label: "Code block",
561
+ }, React.createElement(CodeIcon, {
562
+ "aria-label": "Code block",
738
563
  className: styles$1.icon
739
564
  })), React.createElement(ToolbarButton, {
740
- disabled: props.disabled,
565
+ isDisabled: props.disabled,
741
566
  testId: "markdown-action-button-hr",
742
567
  tooltip: "Horizontal rule",
743
568
  tooltipPlace: tooltipPlace,
744
569
  onClick: props.actions.simple.hr
745
- }, React.createElement(Hr, {
746
- label: "Horizontal rule",
570
+ }, React.createElement(HorizontalRuleIcon, {
571
+ "aria-label": "Horizontal rule",
747
572
  className: styles$1.icon
748
573
  })), React.createElement(ToolbarButton, {
749
- disabled: props.disabled,
574
+ isDisabled: props.disabled,
750
575
  testId: "markdown-action-button-indent",
751
576
  tooltip: "Increase indentation",
752
577
  tooltipPlace: tooltipPlace,
@@ -755,7 +580,7 @@ function AdditionalButtons(props) {
755
580
  label: "Increase indentation",
756
581
  className: styles$1.icon
757
582
  })), React.createElement(ToolbarButton, {
758
- disabled: props.disabled,
583
+ isDisabled: props.disabled,
759
584
  testId: "markdown-action-button-dedent",
760
585
  tooltip: "Decrease indentation",
761
586
  tooltipPlace: tooltipPlace,
@@ -764,7 +589,7 @@ function AdditionalButtons(props) {
764
589
  label: "Decrease indentation",
765
590
  className: styles$1.icon
766
591
  })), React.createElement(ToolbarButton, {
767
- disabled: props.disabled,
592
+ isDisabled: props.disabled,
768
593
  testId: "markdown-action-button-embed",
769
594
  tooltip: "Embed external content",
770
595
  tooltipPlace: tooltipPlace,
@@ -773,7 +598,7 @@ function AdditionalButtons(props) {
773
598
  label: "Embed external content",
774
599
  className: styles$1.icon
775
600
  })), React.createElement(ToolbarButton, {
776
- disabled: props.disabled,
601
+ isDisabled: props.disabled,
777
602
  testId: "markdown-action-button-table",
778
603
  tooltip: "Insert table",
779
604
  tooltipPlace: tooltipPlace,
@@ -782,7 +607,7 @@ function AdditionalButtons(props) {
782
607
  label: "Insert table",
783
608
  className: styles$1.icon
784
609
  })), React.createElement(ToolbarButton, {
785
- disabled: props.disabled,
610
+ isDisabled: props.disabled,
786
611
  testId: "markdown-action-button-special",
787
612
  tooltip: "Insert special character",
788
613
  tooltipPlace: tooltipPlace,
@@ -791,7 +616,7 @@ function AdditionalButtons(props) {
791
616
  label: "Insert special character",
792
617
  className: styles$1.icon
793
618
  })), React.createElement(ToolbarButton, {
794
- disabled: props.disabled,
619
+ isDisabled: props.disabled,
795
620
  testId: "markdown-action-button-organizeLinks",
796
621
  tooltip: "Organize links",
797
622
  tooltipPlace: tooltipPlace,
@@ -800,7 +625,7 @@ function AdditionalButtons(props) {
800
625
  label: "Organize links",
801
626
  className: styles$1.icon
802
627
  })), React.createElement(ToolbarButton, {
803
- disabled: props.disabled,
628
+ isDisabled: props.disabled,
804
629
  testId: "markdown-action-button-undo",
805
630
  tooltip: "Undo",
806
631
  tooltipPlace: tooltipPlace,
@@ -809,7 +634,7 @@ function AdditionalButtons(props) {
809
634
  label: "Undo",
810
635
  className: styles$1.icon
811
636
  })), React.createElement(ToolbarButton, {
812
- disabled: props.disabled,
637
+ isDisabled: props.disabled,
813
638
  testId: "markdown-action-button-redo",
814
639
  tooltip: "Redo",
815
640
  tooltipPlace: tooltipPlace,
@@ -827,59 +652,49 @@ function DefaultMarkdownToolbar(props) {
827
652
 
828
653
  return React.createElement("div", {
829
654
  className: styles$1.root
830
- }, React.createElement("div", {
831
- className: styles$1.actionsRow
832
- }, React.createElement("div", {
833
- className: styles$1.actionsGroup
834
- }, React.createElement(MainButtons, Object.assign({}, props)), React.createElement(ToolbarButton, {
835
- disabled: props.disabled,
655
+ }, React.createElement(Flex, {
656
+ justifyContent: "space-between"
657
+ }, React.createElement(Flex, null, React.createElement(MainButtons, Object.assign({}, props)), React.createElement(ToolbarButton, {
658
+ isDisabled: props.disabled,
836
659
  testId: "markdown-action-button-toggle-additional",
837
660
  tooltip: showAdditional ? 'Hide additional actions' : 'More actions',
838
661
  onClick: function onClick() {
839
662
  setShowAdditional(!showAdditional);
840
663
  }
841
- }, React.createElement(Icon, {
842
- className: styles$1.icon,
843
- icon: "MoreHorizontal"
844
- }))), React.createElement("div", {
845
- className: styles$1.actionsGroup
846
- }, React.createElement(InsertLinkSelector, {
664
+ }, React.createElement(MoreHorizontalIcon, {
665
+ className: styles$1.icon
666
+ }))), React.createElement(Flex, null, React.createElement(InsertLinkSelector, {
847
667
  disabled: props.disabled,
848
668
  onSelectExisting: props.actions.linkExistingMedia,
849
669
  onAddNew: props.actions.addNewMedia,
850
670
  canAddNew: props.canUploadAssets
851
671
  }), React.createElement(ToolbarButton, {
852
- disabled: props.disabled,
672
+ isDisabled: props.disabled,
853
673
  testId: "markdown-action-button-zen",
854
- buttonType: "muted",
674
+ variant: "secondary",
855
675
  onClick: props.actions.openZenMode,
856
676
  className: styles$1.zenButton
857
677
  }, React.createElement(Zen, {
858
678
  label: "Expand",
859
679
  className: styles$1.icon
860
- })))), showAdditional && React.createElement("div", {
861
- className: cx(styles$1.actionsRow, styles$1.additionalRow)
862
- }, React.createElement("div", {
863
- className: styles$1.actionsGroup
864
- }, React.createElement(AdditionalButtons, Object.assign({}, props)))));
680
+ })))), showAdditional && React.createElement(Flex, {
681
+ justifyContent: "space-between",
682
+ marginTop: "spacingXs"
683
+ }, React.createElement(Flex, null, React.createElement(AdditionalButtons, Object.assign({}, props)))));
865
684
  }
866
685
  function ZenMarkdownToolbar(props) {
867
686
  return React.createElement("div", {
868
687
  className: styles$1.root
869
- }, React.createElement("div", {
870
- className: styles$1.actionsRow
871
- }, React.createElement("div", {
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, {
688
+ }, React.createElement(Flex, {
689
+ justifyContent: "space-between"
690
+ }, React.createElement(Flex, null, React.createElement(MainButtons, Object.assign({}, props)), React.createElement(AdditionalButtons, Object.assign({}, props))), React.createElement(Flex, null, React.createElement(InsertLinkSelector, {
876
691
  disabled: props.disabled,
877
692
  onSelectExisting: props.actions.linkExistingMedia,
878
693
  onAddNew: props.actions.addNewMedia,
879
694
  canAddNew: props.canUploadAssets
880
695
  }), React.createElement(Button, {
881
696
  testId: "markdown-action-button-zen-close",
882
- buttonType: "muted",
697
+ variant: "secondary",
883
698
  size: "small",
884
699
  className: cx(styles$1.zenButton, styles$1.zenButtonPressed),
885
700
  onClick: function onClick() {
@@ -903,6 +718,8 @@ var userAgent = /*#__PURE__*/get(window, 'navigator.userAgent', '');
903
718
  var platform = /*#__PURE__*/get(window, 'navigator.platform', '');
904
719
  var ctrlKey = 'Ctrl';
905
720
  var tests = {
721
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
722
+ // @ts-ignore ignore missing MSStream
906
723
  ios: /*#__PURE__*/ /(iphone os|ipad|iphone|ipod)/i.test(userAgent) && !window.MSStream
907
724
  };
908
725
 
@@ -1861,8 +1678,10 @@ var styles$3 = {
1861
1678
  };
1862
1679
  function MarkdownHelp(props) {
1863
1680
  return React.createElement(Paragraph, {
1681
+ marginBottom: "none",
1864
1682
  className: styles$3.help
1865
1683
  }, "Format your text like a pro with the", ' ', React.createElement(TextLink, {
1684
+ as: "button",
1866
1685
  testId: "open-markdown-cheatsheet-button",
1867
1686
  onClick: function onClick() {
1868
1687
  props.onClick();
@@ -1945,7 +1764,7 @@ var styles$4 = {
1945
1764
  })
1946
1765
  };
1947
1766
  var CheatsheetModalDialog = function CheatsheetModalDialog() {
1948
- return React.createElement(Modal.Content, {
1767
+ return React.createElement(ModalContent, {
1949
1768
  testId: "markdown-cheatsheet-dialog-content"
1950
1769
  }, React.createElement("div", {
1951
1770
  className: styles$4.flexColumnContainer
@@ -1953,22 +1772,25 @@ var CheatsheetModalDialog = function CheatsheetModalDialog() {
1953
1772
  className: cx(styles$4.flexColumn, styles$4.verticalDivider)
1954
1773
  }, React.createElement("div", {
1955
1774
  className: styles$4.helpItem
1956
- }, React.createElement(Heading$1, {
1957
- element: "h1",
1775
+ }, React.createElement(Heading, {
1776
+ marginBottom: "none",
1777
+ as: "h1",
1958
1778
  className: cx(styles$4.preview, styles$4.h1)
1959
1779
  }, "H1"), React.createElement("div", {
1960
1780
  className: styles$4.markup
1961
1781
  }, "# heading")), React.createElement("div", {
1962
1782
  className: styles$4.helpItem
1963
- }, React.createElement(Heading$1, {
1964
- element: "h2",
1783
+ }, React.createElement(Heading, {
1784
+ marginBottom: "none",
1785
+ as: "h2",
1965
1786
  className: cx(styles$4.preview, styles$4.h2)
1966
1787
  }, "H2"), React.createElement("div", {
1967
1788
  className: styles$4.markup
1968
1789
  }, "## heading")), React.createElement("div", {
1969
1790
  className: styles$4.helpItem
1970
- }, React.createElement(Heading$1, {
1971
- element: "h3",
1791
+ }, React.createElement(Heading, {
1792
+ marginBottom: "none",
1793
+ as: "h3",
1972
1794
  className: cx(styles$4.preview, styles$4.h3)
1973
1795
  }, "H3"), React.createElement("div", {
1974
1796
  className: styles$4.markup
@@ -1993,6 +1815,7 @@ var CheatsheetModalDialog = function CheatsheetModalDialog() {
1993
1815
  }, "~~text~~")), React.createElement("div", {
1994
1816
  className: styles$4.helpItem
1995
1817
  }, React.createElement(TextLink, {
1818
+ as: "button",
1996
1819
  className: styles$4.preview
1997
1820
  }, "Link"), React.createElement("div", {
1998
1821
  className: styles$4.markup
@@ -2047,7 +1870,7 @@ var openCheatsheetModal = function openCheatsheetModal(dialogs) {
2047
1870
  return dialogs.openCurrent({
2048
1871
  title: 'Markdown formatting help',
2049
1872
  width: 'large',
2050
- minHeight: '425px',
1873
+ minHeight: '415px',
2051
1874
  shouldCloseOnEscapePress: true,
2052
1875
  shouldCloseOnOverlayClick: true,
2053
1876
  parameters: {
@@ -2056,7 +1879,7 @@ var openCheatsheetModal = function openCheatsheetModal(dialogs) {
2056
1879
  });
2057
1880
  };
2058
1881
 
2059
- var _excluded$1 = ["Embedly", "children"];
1882
+ var _excluded$2 = ["Embedly", "children"];
2060
1883
 
2061
1884
  var _templateObject$1;
2062
1885
  var styles$5 = {
@@ -2079,7 +1902,7 @@ var styles$5 = {
2079
1902
  function MarkdownLink(props) {
2080
1903
  var Embedly = props.Embedly,
2081
1904
  children = props.children,
2082
- rest = _objectWithoutPropertiesLoose(props, _excluded$1);
1905
+ rest = _objectWithoutPropertiesLoose(props, _excluded$2);
2083
1906
 
2084
1907
  if (props.className === 'embedly-card' && Embedly) {
2085
1908
  return React.createElement(Embedly, {
@@ -2878,14 +2701,6 @@ function isValidUrl(value) {
2878
2701
  return urlRegex.test(value);
2879
2702
  }
2880
2703
 
2881
- var styles$7 = {
2882
- controlsContainer: /*#__PURE__*/css({
2883
- display: 'flex',
2884
- button: {
2885
- marginRight: tokens.spacingM
2886
- }
2887
- })
2888
- };
2889
2704
  var InsertLinkModal = function InsertLinkModal(_ref) {
2890
2705
  var selectedText = _ref.selectedText,
2891
2706
  onClose = _ref.onClose;
@@ -2919,7 +2734,7 @@ var InsertLinkModal = function InsertLinkModal(_ref) {
2919
2734
  mainInputRef.current.focus();
2920
2735
  }
2921
2736
  }, [mainInputRef]);
2922
- return React.createElement(Modal.Content, {
2737
+ return React.createElement(React.Fragment, null, React.createElement(ModalContent, {
2923
2738
  testId: "insert-link-modal"
2924
2739
  }, React.createElement(Form, {
2925
2740
  onSubmit: function onSubmit() {
@@ -2929,50 +2744,47 @@ var InsertLinkModal = function InsertLinkModal(_ref) {
2929
2744
  title: title
2930
2745
  });
2931
2746
  }
2932
- }, React.createElement(TextField, {
2933
- value: text,
2934
- name: "link-text",
2747
+ }, React.createElement(FormControl, {
2935
2748
  id: "link-text-field",
2936
- labelText: "Link text",
2749
+ isDisabled: Boolean(selectedText)
2750
+ }, React.createElement(FormControl.Label, null, "Link text"), React.createElement(TextInput, {
2751
+ name: "link-text",
2752
+ value: text,
2937
2753
  onChange: function onChange(e) {
2938
2754
  setText(e.target.value);
2939
2755
  },
2940
- textInputProps: {
2941
- disabled: Boolean(selectedText),
2942
- testId: 'link-text-field'
2943
- }
2944
- }), React.createElement(TextField, {
2945
- value: url,
2946
- name: "target-url",
2756
+ testId: "link-text-field"
2757
+ })), React.createElement(FormControl, {
2947
2758
  id: "target-url-field",
2948
- labelText: "Target URL",
2949
- helpText: "Include protocol (e.g. https://)",
2759
+ isInvalid: touched && !urlIsValid
2760
+ }, React.createElement(FormControl.Label, null, "Target URL"), React.createElement(TextInput, {
2761
+ name: "target-url",
2762
+ value: url,
2950
2763
  onChange: function onChange(e) {
2951
2764
  setUrl(e.target.value);
2952
2765
  setTouched(true);
2953
2766
  },
2954
- validationMessage: touched && !urlIsValid ? 'Invalid URL' : '',
2955
- textInputProps: {
2956
- placeholder: 'https://',
2957
- maxLength: 2100,
2958
- testId: 'target-url-field',
2959
- inputRef: mainInputRef
2960
- }
2961
- }), React.createElement(TextField, {
2962
- value: title,
2767
+ placeholder: "https://",
2768
+ maxLength: 2100,
2769
+ testId: "target-url-field",
2770
+ ref: mainInputRef
2771
+ }), React.createElement(FormControl.HelpText, null, "Include protocol (e.g. https://)"), touched && !urlIsValid && React.createElement(FormControl.ValidationMessage, null, "Invalid URL")), React.createElement(FormControl, {
2772
+ id: "link-title-field"
2773
+ }, React.createElement(FormControl.Label, null, "Link title"), React.createElement(TextInput, {
2963
2774
  name: "link-title",
2964
- id: "link-title-field",
2965
- labelText: "Link title",
2966
- helpText: "Recommended for accessibility",
2775
+ value: title,
2967
2776
  onChange: function onChange(e) {
2968
2777
  setTitle(e.target.value);
2969
2778
  },
2970
- textInputProps: {
2971
- testId: 'link-title-field'
2972
- }
2973
- })), React.createElement("div", {
2974
- className: styles$7.controlsContainer
2975
- }, React.createElement(Button, {
2779
+ testId: "link-title-field"
2780
+ }), React.createElement(FormControl.HelpText, null, "Recommended for accessibility")))), React.createElement(ModalControls, null, React.createElement(Button, {
2781
+ testId: "insert-link-cancel",
2782
+ onClick: function onClick() {
2783
+ return onClose(false);
2784
+ },
2785
+ variant: "secondary",
2786
+ size: "small"
2787
+ }, "Cancel"), React.createElement(Button, {
2976
2788
  testId: "insert-link-confirm",
2977
2789
  onClick: function onClick() {
2978
2790
  onInsert({
@@ -2981,21 +2793,16 @@ var InsertLinkModal = function InsertLinkModal(_ref) {
2981
2793
  title: title
2982
2794
  });
2983
2795
  },
2984
- disabled: !urlIsValid,
2985
- buttonType: "positive"
2986
- }, "Insert"), React.createElement(Button, {
2987
- testId: "insert-link-cancel",
2988
- onClick: function onClick() {
2989
- return onClose(false);
2990
- },
2991
- buttonType: "muted"
2992
- }, "Cancel")));
2796
+ isDisabled: !urlIsValid,
2797
+ variant: "positive",
2798
+ size: "small"
2799
+ }, "Insert")));
2993
2800
  };
2994
2801
  var openInsertLinkDialog = function openInsertLinkDialog(dialogs, params) {
2995
2802
  return dialogs.openCurrent({
2996
2803
  title: 'Insert link',
2997
2804
  width: 'large',
2998
- minHeight: '441px',
2805
+ minHeight: '410px',
2999
2806
  shouldCloseOnEscapePress: true,
3000
2807
  shouldCloseOnOverlayClick: true,
3001
2808
  parameters: _extends({
@@ -3168,7 +2975,7 @@ var specialCharacters = [{
3168
2975
  desc: 'diamond'
3169
2976
  }];
3170
2977
 
3171
- var styles$8 = {
2978
+ var styles$7 = {
3172
2979
  buttonPanel: /*#__PURE__*/css({
3173
2980
  display: 'flex',
3174
2981
  flexWrap: 'wrap'
@@ -3190,20 +2997,6 @@ var styles$8 = {
3190
2997
  button: /*#__PURE__*/css({
3191
2998
  marginTop: tokens.spacingM,
3192
2999
  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
3000
  })
3208
3001
  };
3209
3002
  var SpecialCharacterModalDialog = function SpecialCharacterModalDialog(_ref) {
@@ -3213,54 +3006,59 @@ var SpecialCharacterModalDialog = function SpecialCharacterModalDialog(_ref) {
3213
3006
  selectedCharacter = _useState[0],
3214
3007
  setSelectedCharacter = _useState[1];
3215
3008
 
3216
- return React.createElement(Modal.Content, {
3009
+ return React.createElement(React.Fragment, null, React.createElement(ModalContent, {
3217
3010
  testId: "insert-special-character-modal"
3218
- }, React.createElement("div", {
3219
- className: styles$8.charContainer
3220
- }, React.createElement(DisplayText, {
3221
- element: "p",
3222
- className: styles$8.selectedCharacter
3223
- }, String.fromCharCode(selectedCharacter.code)), React.createElement(DisplayText, {
3224
- element: "p",
3225
- className: styles$8.selectedCharacterDesc
3011
+ }, React.createElement(Flex, {
3012
+ flexDirection: "column",
3013
+ alignItems: "center"
3014
+ }, React.createElement(Text, {
3015
+ as: "div",
3016
+ lineHeight: "lineHeight3Xl",
3017
+ fontSize: "fontSize3Xl",
3018
+ marginBottom: "spacingS"
3019
+ }, String.fromCharCode(selectedCharacter.code)), React.createElement(Text, {
3020
+ as: "div",
3021
+ marginBottom: "spacingS"
3226
3022
  }, selectedCharacter.desc)), React.createElement("div", {
3227
- className: styles$8.buttonPanel
3023
+ className: styles$7.buttonPanel
3228
3024
  }, specialCharacters.map(function (_char) {
3229
3025
  return React.createElement("div", {
3230
3026
  key: _char.code
3231
3027
  }, React.createElement(Tooltip, {
3232
- className: styles$8.tooltip,
3028
+ className: styles$7.tooltip,
3233
3029
  content: _char.desc
3234
3030
  }, React.createElement(Button, {
3235
3031
  testId: "special-character-button",
3236
3032
  isActive: _char.code === selectedCharacter.code,
3237
- className: styles$8.charButton,
3238
- buttonType: "naked",
3033
+ className: styles$7.charButton,
3034
+ variant: "transparent",
3239
3035
  onClick: function onClick() {
3240
3036
  return setSelectedCharacter(_char);
3241
3037
  }
3242
3038
  }, 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, {
3039
+ }))), React.createElement(ModalControls, null, React.createElement(Button, {
3251
3040
  testId: "insert-character-cancel",
3252
- className: styles$8.button,
3041
+ className: styles$7.button,
3253
3042
  onClick: function onClick() {
3254
3043
  return onClose(false);
3255
3044
  },
3256
- buttonType: "muted"
3257
- }, "Cancel"));
3045
+ variant: "secondary",
3046
+ size: "small"
3047
+ }, "Cancel"), React.createElement(Button, {
3048
+ className: styles$7.button,
3049
+ testId: "insert-character-confirm",
3050
+ onClick: function onClick() {
3051
+ return onClose(String.fromCharCode(selectedCharacter.code));
3052
+ },
3053
+ variant: "positive",
3054
+ size: "small"
3055
+ }, "Insert selected")));
3258
3056
  };
3259
3057
  var openInsertSpecialCharacter = function openInsertSpecialCharacter(dialogs) {
3260
3058
  return dialogs.openCurrent({
3261
3059
  title: 'Insert special character',
3262
3060
  width: 'large',
3263
- minHeight: '615px',
3061
+ minHeight: '600px',
3264
3062
  shouldCloseOnEscapePress: true,
3265
3063
  shouldCloseOnOverlayClick: true,
3266
3064
  parameters: {
@@ -3269,13 +3067,6 @@ var openInsertSpecialCharacter = function openInsertSpecialCharacter(dialogs) {
3269
3067
  });
3270
3068
  };
3271
3069
 
3272
- var styles$9 = {
3273
- controlButton: /*#__PURE__*/css({
3274
- button: {
3275
- marginRight: tokens.spacingM
3276
- }
3277
- })
3278
- };
3279
3070
  var InsertTableModal = function InsertTableModal(_ref) {
3280
3071
  var onClose = _ref.onClose;
3281
3072
  var mainInputRef = useRef(null);
@@ -3297,50 +3088,51 @@ var InsertTableModal = function InsertTableModal(_ref) {
3297
3088
  mainInputRef.current.focus();
3298
3089
  }
3299
3090
  }, [mainInputRef]);
3300
- return React.createElement(Modal.Content, {
3091
+ return React.createElement(React.Fragment, null, React.createElement(ModalContent, {
3301
3092
  testId: "insert-table-modal"
3302
- }, React.createElement(Form, null, React.createElement(TextField, {
3303
- labelText: "Number of rows",
3304
- value: rows.toString(),
3093
+ }, React.createElement(Form, null, React.createElement(FormControl, {
3305
3094
  id: "insert-table-rows-number-field",
3095
+ isRequired: true,
3096
+ isInvalid: !rowsAreValid
3097
+ }, React.createElement(FormControl.Label, null, "Number of rows"), React.createElement(TextInput, {
3306
3098
  name: "rows",
3099
+ value: rows.toString(),
3307
3100
  onChange: function onChange(e) {
3308
3101
  return setRows(Number(e.target.value));
3309
3102
  },
3310
- textInputProps: {
3311
- testId: 'insert-table-rows-number-field',
3312
- min: 2,
3313
- max: 100,
3314
- pattern: '[1-9][0-9]*',
3315
- type: 'number',
3316
- width: 'small',
3317
- autoComplete: 'off',
3318
- inputRef: mainInputRef
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(),
3103
+ testId: "insert-table-rows-number-field",
3104
+ min: 2,
3105
+ max: 100,
3106
+ pattern: "[1-9][0-9]*",
3107
+ type: "number",
3108
+ width: "small",
3109
+ autoComplete: "off",
3110
+ ref: mainInputRef
3111
+ }), !rowsAreValid && React.createElement(FormControl.ValidationMessage, null, "Should be between 2 and 100")), React.createElement(FormControl, {
3325
3112
  id: "insert-table-columns-number-field",
3113
+ isRequired: true,
3114
+ isInvalid: !colsAreValid
3115
+ }, React.createElement(FormControl.Label, null, "Number of columns"), React.createElement(TextInput, {
3326
3116
  name: "columns",
3117
+ value: cols.toString(),
3327
3118
  onChange: function onChange(e) {
3328
3119
  return setColumns(Number(e.target.value));
3329
3120
  },
3330
- textInputProps: {
3331
- testId: 'insert-table-columns-number-field',
3332
- min: 1,
3333
- max: 100,
3334
- pattern: '[1-9][0-9]*',
3335
- type: 'number',
3336
- width: 'small',
3337
- autoComplete: 'off'
3121
+ testId: "insert-table-columns-number-field",
3122
+ min: 1,
3123
+ max: 100,
3124
+ pattern: "[1-9][0-9]*",
3125
+ type: "number",
3126
+ width: "small",
3127
+ autoComplete: "off"
3128
+ }), !colsAreValid && React.createElement(FormControl.ValidationMessage, null, "Should be between 1 and 100")))), React.createElement(ModalControls, null, React.createElement(Button, {
3129
+ testId: "insert-table-cancel",
3130
+ onClick: function onClick() {
3131
+ return onClose(false);
3338
3132
  },
3339
- validationMessage: !colsAreValid ? 'Should be between 1 and 100' : '',
3340
- required: true
3341
- })), React.createElement("div", {
3342
- className: styles$9.controlButton
3343
- }, React.createElement(Button, {
3133
+ variant: "secondary",
3134
+ size: "small"
3135
+ }, "Cancel"), React.createElement(Button, {
3344
3136
  testId: "insert-table-confirm",
3345
3137
  onClick: function onClick() {
3346
3138
  return onClose({
@@ -3348,21 +3140,16 @@ var InsertTableModal = function InsertTableModal(_ref) {
3348
3140
  cols: cols
3349
3141
  });
3350
3142
  },
3351
- buttonType: "positive",
3352
- disabled: !rowsAreValid || !colsAreValid
3353
- }, "Insert"), React.createElement(Button, {
3354
- testId: "insert-table-cancel",
3355
- onClick: function onClick() {
3356
- return onClose(false);
3357
- },
3358
- buttonType: "muted"
3359
- }, "Cancel")));
3143
+ variant: "positive",
3144
+ size: "small",
3145
+ isDisabled: !rowsAreValid || !colsAreValid
3146
+ }, "Insert")));
3360
3147
  };
3361
3148
  var openInsertTableDialog = function openInsertTableDialog(dialogs) {
3362
3149
  return dialogs.openCurrent({
3363
3150
  title: 'Insert table',
3364
3151
  width: 'medium',
3365
- minHeight: '290px',
3152
+ minHeight: '260px',
3366
3153
  shouldCloseOnEscapePress: true,
3367
3154
  shouldCloseOnOverlayClick: true,
3368
3155
  parameters: {
@@ -3371,7 +3158,7 @@ var openInsertTableDialog = function openInsertTableDialog(dialogs) {
3371
3158
  });
3372
3159
  };
3373
3160
 
3374
- var styles$a = {
3161
+ var styles$8 = {
3375
3162
  widthFiledGroup: /*#__PURE__*/css({
3376
3163
  display: 'flex',
3377
3164
  flexWrap: 'nowrap',
@@ -3384,12 +3171,6 @@ var styles$a = {
3384
3171
  }),
3385
3172
  radioButton: /*#__PURE__*/css({
3386
3173
  marginLeft: tokens.spacingM
3387
- }),
3388
- controlsContainer: /*#__PURE__*/css({
3389
- display: 'flex',
3390
- button: {
3391
- marginRight: tokens.spacingM
3392
- }
3393
3174
  })
3394
3175
  };
3395
3176
 
@@ -3440,87 +3221,85 @@ var EmbedExternalContentModal = function EmbedExternalContentModal(_ref2) {
3440
3221
  mainInputRef.current.focus();
3441
3222
  }
3442
3223
  }, [mainInputRef]);
3443
- return React.createElement(Modal.Content, {
3224
+ return React.createElement(React.Fragment, null, React.createElement(ModalContent, {
3444
3225
  testId: "embed-external-dialog"
3445
- }, React.createElement(Form, null, React.createElement(TextField, {
3446
- value: url,
3226
+ }, React.createElement(Form, null, React.createElement(FormControl, {
3227
+ id: "external-link-url-field",
3228
+ isRequired: true,
3229
+ isInvalid: !urlIsValid
3230
+ }, React.createElement(FormControl.Label, null, "Content URL"), React.createElement(TextInput, {
3447
3231
  name: "external-link-url",
3232
+ value: url,
3448
3233
  onChange: function onChange(e) {
3449
3234
  var value = e.target.value;
3450
3235
  setUrl(value);
3451
3236
  setUrlValidity(isValidUrl(value));
3452
3237
  },
3453
- labelText: "Content URL",
3454
- id: "external-link-url-field",
3455
- helpText: "Include protocol (e.g. https://)",
3456
- textInputProps: {
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, {
3238
+ testId: "external-link-url-field",
3239
+ placeholder: "https://example.com",
3240
+ ref: mainInputRef
3241
+ }), React.createElement(FormControl.HelpText, null, "Include protocol (e.g. https://)"), !urlIsValid && React.createElement(FormControl.ValidationMessage, null, "URL is invalid")), React.createElement(TextLink, {
3464
3242
  href: "http://embed.ly/providers",
3465
3243
  target: "_blank",
3466
3244
  rel: "noopener noreferrer"
3467
3245
  }, "Supported sources"), React.createElement("div", {
3468
- className: styles$a.widthFiledGroup
3469
- }, React.createElement(TextField, {
3470
- value: width,
3246
+ className: styles$8.widthFiledGroup
3247
+ }, React.createElement(FormControl, {
3471
3248
  id: "embedded-content-width",
3249
+ isRequired: true,
3250
+ isInvalid: !isWidthValid(Number(width), selectedUnit)
3251
+ }, React.createElement(FormControl.Label, null, "Width"), React.createElement(TextInput, {
3252
+ value: width,
3472
3253
  name: "embedded-content-width",
3254
+ testId: "embedded-content-width",
3255
+ type: "number",
3256
+ width: "small",
3473
3257
  onChange: function onChange(e) {
3474
3258
  return setWidth(e.target.value);
3475
- },
3476
- labelText: "Width",
3477
- textInputProps: {
3478
- testId: 'embedded-content-width',
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,
3259
+ }
3260
+ }), !isWidthValid(Number(width), selectedUnit) && React.createElement(FormControl.ValidationMessage, null, "Should be equal or less then 100")), React.createElement("div", {
3261
+ className: styles$8.radioButtonGroup
3262
+ }, React.createElement(Radio, {
3488
3263
  id: "unit-option-percent",
3489
- checked: selectedUnit === 'percent',
3490
- labelText: "percent",
3491
3264
  value: "percent",
3265
+ isChecked: selectedUnit === 'percent',
3492
3266
  onChange: function onChange() {
3493
3267
  return setUnit('percent');
3494
3268
  },
3495
- labelIsLight: true
3496
- }), React.createElement(RadioButtonField, {
3497
- className: styles$a.radioButton,
3269
+ className: styles$8.radioButton
3270
+ }, "percent"), React.createElement(Radio, {
3498
3271
  id: "unit-option-pixels",
3499
- checked: selectedUnit === 'px',
3500
- labelText: "pixels",
3501
3272
  value: "pixels",
3273
+ isChecked: selectedUnit === 'px',
3502
3274
  onChange: function onChange() {
3503
3275
  return setUnit('px');
3504
3276
  },
3505
- labelIsLight: true
3506
- }))), React.createElement(CheckboxField, {
3507
- value: "Yes",
3508
- testId: "attach-social-checkbox",
3277
+ className: styles$8.radioButton
3278
+ }, "pixels"))), React.createElement(Checkbox, {
3509
3279
  id: "attach-social-checkbox",
3510
3280
  name: "attach-social-checkbox",
3511
- checked: attachSocial,
3281
+ value: "Yes",
3282
+ isChecked: attachSocial,
3512
3283
  onChange: function onChange() {
3513
3284
  return setAttachSocial(!attachSocial);
3514
3285
  },
3515
- labelText: "Attach social sharing links to this element",
3516
- labelIsLight: true
3517
- }), React.createElement(HelpText, null, "To enable this embedded content in your application make sure to add the\xA0", React.createElement(TextLink, {
3286
+ testId: "attach-social-checkbox"
3287
+ }, "Attach social sharing links to this element"), React.createElement(Text, {
3288
+ as: "p",
3289
+ fontColor: "gray500",
3290
+ marginTop: "spacingXs"
3291
+ }, "To enable this embedded content in your application make sure to add the\xA0", React.createElement(TextLink, {
3518
3292
  href: "http://embed.ly/docs/products/cards",
3519
3293
  target: "_blank",
3520
3294
  rel: "noopener noreferrer"
3521
- }, "Embedly's platform.js"), "\xA0on your development environment")), React.createElement("div", {
3522
- className: styles$a.controlsContainer
3523
- }, React.createElement(Button, {
3295
+ }, "Embedly's platform.js"), "\xA0on your development environment"))), React.createElement(ModalControls, null, React.createElement(Button, {
3296
+ testId: "emded-external-cancel",
3297
+ onClick: function onClick() {
3298
+ return onClose(false);
3299
+ },
3300
+ variant: "secondary",
3301
+ size: "small"
3302
+ }, "Cancel"), React.createElement(Button, {
3524
3303
  testId: "embed-external-confirm",
3525
3304
  onClick: function onClick() {
3526
3305
  return onClose(makeEmbedlyLink({
@@ -3530,20 +3309,15 @@ var EmbedExternalContentModal = function EmbedExternalContentModal(_ref2) {
3530
3309
  attachSocial: attachSocial
3531
3310
  }));
3532
3311
  },
3533
- buttonType: "positive"
3534
- }, "Insert"), React.createElement(Button, {
3535
- testId: "emded-external-cancel",
3536
- onClick: function onClick() {
3537
- return onClose(false);
3538
- },
3539
- buttonType: "muted"
3540
- }, "Cancel")));
3312
+ variant: "positive",
3313
+ size: "small"
3314
+ }, "Insert")));
3541
3315
  };
3542
3316
  var openEmbedExternalContentDialog = function openEmbedExternalContentDialog(dialogs) {
3543
3317
  return dialogs.openCurrent({
3544
3318
  title: 'Embed external content',
3545
3319
  width: 'large',
3546
- minHeight: '475px',
3320
+ minHeight: '435px',
3547
3321
  shouldCloseOnEscapePress: true,
3548
3322
  shouldCloseOnOverlayClick: true,
3549
3323
  parameters: {
@@ -3552,53 +3326,45 @@ var openEmbedExternalContentDialog = function openEmbedExternalContentDialog(dia
3552
3326
  });
3553
3327
  };
3554
3328
 
3555
- var styles$b = {
3556
- controlButton: /*#__PURE__*/css({
3557
- marginTop: tokens.spacingL,
3558
- button: {
3559
- marginRight: tokens.spacingM
3560
- }
3561
- })
3562
- };
3563
3329
  var ConfirmInsertAssetModalDialog = function ConfirmInsertAssetModalDialog(_ref) {
3564
3330
  var onClose = _ref.onClose,
3565
3331
  assets = _ref.assets,
3566
3332
  locale = _ref.locale;
3567
3333
  var localesNumber = assets.length;
3568
- return React.createElement(Modal.Content, {
3334
+ return React.createElement(React.Fragment, null, React.createElement(ModalContent, {
3569
3335
  testId: "confirm-insert-asset"
3570
- }, React.createElement(Typography, null, 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) {
3336
+ }, 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
3337
  var title = _ref2.title,
3572
3338
  description = _ref2.description,
3573
3339
  thumbnailUrl = _ref2.thumbnailUrl,
3574
3340
  thumbnailAltText = _ref2.thumbnailAltText;
3575
- return React.createElement(EntityListItem, {
3341
+ return React.createElement(EntityList.Item, {
3576
3342
  key: thumbnailUrl,
3577
3343
  title: title,
3578
3344
  thumbnailUrl: thumbnailUrl + "?w=46&h=46&fit=thumb",
3579
3345
  thumbnailAltText: thumbnailAltText,
3580
3346
  description: description
3581
3347
  });
3582
- })), React.createElement("div", {
3583
- className: styles$b.controlButton
3584
- }, React.createElement(Button, {
3585
- testId: "confirm-insert-asset",
3348
+ }))), React.createElement(ModalControls, null, React.createElement(Button, {
3586
3349
  onClick: function onClick() {
3587
- return onClose(true);
3350
+ return onClose(false);
3588
3351
  },
3589
- buttonType: "positive"
3590
- }, "Confirm"), React.createElement(Button, {
3352
+ variant: "secondary",
3353
+ size: "small"
3354
+ }, "Cancel"), React.createElement(Button, {
3355
+ testId: "confirm-insert-asset",
3591
3356
  onClick: function onClick() {
3592
- return onClose(false);
3357
+ return onClose(true);
3593
3358
  },
3594
- buttonType: "muted"
3595
- }, "Cancel")));
3359
+ variant: "positive",
3360
+ size: "small"
3361
+ }, "Confirm")));
3596
3362
  };
3597
3363
  var openConfirmInsertAsset = function openConfirmInsertAsset(dialogs, options) {
3598
3364
  return dialogs.openCurrent({
3599
3365
  title: 'Confirm using fallback assets',
3600
3366
  width: 'medium',
3601
- minHeight: '290px',
3367
+ minHeight: '270px',
3602
3368
  shouldCloseOnEscapePress: true,
3603
3369
  shouldCloseOnOverlayClick: true,
3604
3370
  parameters: _extends({
@@ -3607,7 +3373,7 @@ var openConfirmInsertAsset = function openConfirmInsertAsset(dialogs, options) {
3607
3373
  });
3608
3374
  };
3609
3375
 
3610
- var styles$c = {
3376
+ var styles$9 = {
3611
3377
  root: /*#__PURE__*/css({
3612
3378
  position: 'fixed',
3613
3379
  left: 0,
@@ -3726,17 +3492,17 @@ var ZenModeModalDialog = function ZenModeModalDialog(props) {
3726
3492
 
3727
3493
  var direction = (_props$sdk$locales$di = props.sdk.locales.direction[props.locale]) != null ? _props$sdk$locales$di : 'ltr';
3728
3494
  return React.createElement("div", {
3729
- className: styles$c.root,
3495
+ className: styles$9.root,
3730
3496
  "data-test-id": "zen-mode-markdown-editor"
3731
3497
  }, React.createElement("div", {
3732
- className: styles$c.topSplit
3498
+ className: styles$9.topSplit
3733
3499
  }, React.createElement(MarkdownToolbar, {
3734
3500
  mode: "zen",
3735
3501
  disabled: false,
3736
3502
  canUploadAssets: false,
3737
3503
  actions: actions
3738
3504
  })), React.createElement("div", {
3739
- className: cx(styles$c.editorSplit, (_cx = {}, _cx[styles$c.editorSplitFullscreen] = showPreview === false, _cx))
3505
+ className: cx(styles$9.editorSplit, (_cx = {}, _cx[styles$9.editorSplitFullscreen] = showPreview === false, _cx))
3740
3506
  }, React.createElement(MarkdownTextarea, {
3741
3507
  mode: "zen",
3742
3508
  visible: true,
@@ -3755,38 +3521,36 @@ var ZenModeModalDialog = function ZenModeModalDialog(props) {
3755
3521
  });
3756
3522
  }
3757
3523
  })), showPreview && React.createElement("div", {
3758
- className: styles$c.previewSplit
3524
+ className: styles$9.previewSplit
3759
3525
  }, React.createElement(MarkdownPreview, {
3760
3526
  direction: direction,
3761
3527
  mode: "zen",
3762
3528
  value: currentValue,
3763
3529
  previewComponents: props.previewComponents
3764
3530
  })), showPreview && React.createElement("div", {
3765
- className: styles$c.separator
3531
+ className: styles$9.separator
3766
3532
  }), showPreview && React.createElement("button", {
3767
- className: cx(styles$c.button, styles$c.hideButton),
3533
+ className: cx(styles$9.button, styles$9.hideButton),
3768
3534
  "aria-label": "Hide preview",
3769
3535
  onClick: function onClick() {
3770
3536
  setShowPreview(false);
3771
3537
  }
3772
- }, React.createElement(Icon, {
3773
- icon: "ChevronRight",
3774
- color: "muted",
3538
+ }, React.createElement(ChevronRightIcon, {
3539
+ variant: "muted",
3775
3540
  size: "tiny",
3776
- className: styles$c.icon
3541
+ className: styles$9.icon
3777
3542
  })), !showPreview && React.createElement("button", {
3778
- className: cx(styles$c.button, styles$c.showButton),
3543
+ className: cx(styles$9.button, styles$9.showButton),
3779
3544
  "aria-label": "Show preview",
3780
3545
  onClick: function onClick() {
3781
3546
  setShowPreview(true);
3782
3547
  }
3783
- }, React.createElement(Icon, {
3784
- icon: "ChevronLeft",
3785
- color: "muted",
3548
+ }, React.createElement(ChevronLeftIcon, {
3549
+ variant: "muted",
3786
3550
  size: "tiny",
3787
- className: styles$c.icon
3551
+ className: styles$9.icon
3788
3552
  })), React.createElement("div", {
3789
- className: styles$c.bottomSplit
3553
+ className: styles$9.bottomSplit
3790
3554
  }, React.createElement(MarkdownBottomBar, null, React.createElement(MarkdownHelp, {
3791
3555
  onClick: function onClick() {
3792
3556
  openCheatsheetModal(props.sdk.dialogs);
@@ -3834,10 +3598,17 @@ function makeAssetLink(asset, _ref) {
3834
3598
 
3835
3599
  if (isObject(file) && file.url) {
3836
3600
  var title = get(asset, ['fields', 'title', localeCode]) || get(asset, ['fields', 'title', fallbackCode || '']) || get(asset, ['fields', 'title', defaultLocaleCode]) || fileNameToTitle(file.fileName);
3601
+ var assetDomainMap = {
3602
+ images: 'images.ctfassets.net',
3603
+ assets: 'assets.ctfassets.net',
3604
+ downloads: 'downloads.ctfassets.net',
3605
+ videos: 'videos.ctfassets.net'
3606
+ };
3607
+ var fileUrl = toExternal(file.url, assetDomainMap);
3837
3608
  return {
3838
3609
  title: title,
3839
3610
  asset: asset,
3840
- url: file.url,
3611
+ url: fileUrl,
3841
3612
  // is normally localized and we should not warn about this file
3842
3613
  isLocalized: Boolean(localizedFile),
3843
3614
  // was fallback value used
@@ -3845,7 +3616,7 @@ function makeAssetLink(asset, _ref) {
3845
3616
  // it means we used a default locale - we filter empty values
3846
3617
  isFallback: Boolean(fallbackFile),
3847
3618
  // todo: tranform using fromHostname
3848
- asMarkdown: "![" + title + "](" + file.url + ")"
3619
+ asMarkdown: "![" + title + "](" + fileUrl + ")"
3849
3620
  };
3850
3621
  } else {
3851
3622
  return null;
@@ -4568,7 +4339,7 @@ function createMarkdownActions(props) {
4568
4339
  };
4569
4340
  }
4570
4341
 
4571
- var styles$d = {
4342
+ var styles$a = {
4572
4343
  container: /*#__PURE__*/css({
4573
4344
  display: 'flex',
4574
4345
  flexDirection: 'column',
@@ -4626,7 +4397,7 @@ function MarkdownEditor(props) {
4626
4397
  openCheatsheetModal(props.sdk.dialogs);
4627
4398
  }, []);
4628
4399
  return React.createElement("div", {
4629
- className: styles$d.container,
4400
+ className: styles$a.container,
4630
4401
  "data-test-id": "markdown-editor"
4631
4402
  }, React.createElement(MarkdownTabs, {
4632
4403
  active: selectedTab,