@flozy/editor 1.5.9 → 1.6.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (131) hide show
  1. package/dist/Editor/CommonEditor.js +195 -94
  2. package/dist/Editor/DialogWrapper.js +3 -0
  3. package/dist/Editor/Editor.css +211 -50
  4. package/dist/Editor/Elements/Accordion/Accordion.js +0 -1
  5. package/dist/Editor/Elements/Accordion/AccordionButton.js +13 -12
  6. package/dist/Editor/Elements/Accordion/AccordionSummary.js +0 -1
  7. package/dist/Editor/Elements/AppHeader/AppHeader.js +136 -133
  8. package/dist/Editor/Elements/AppHeader/AppHeaderPopup.js +4 -2
  9. package/dist/Editor/Elements/Button/ButtonToolIcon.js +10 -9
  10. package/dist/Editor/Elements/Button/EditorButton.js +8 -24
  11. package/dist/Editor/Elements/Carousel/Carousel.js +47 -28
  12. package/dist/Editor/Elements/Carousel/CarouselButton.js +7 -8
  13. package/dist/Editor/Elements/Color Picker/ColorButtons.js +133 -0
  14. package/dist/Editor/Elements/Color Picker/ColorPicker.js +49 -58
  15. package/dist/Editor/Elements/Color Picker/Styles.js +51 -0
  16. package/dist/Editor/Elements/Color Picker/defaultColors.js +1 -1
  17. package/dist/Editor/Elements/Embed/Embed.js +35 -126
  18. package/dist/Editor/Elements/Embed/Image.js +24 -7
  19. package/dist/Editor/Elements/Embed/Video.js +21 -6
  20. package/dist/Editor/Elements/Emoji/EmojiButton.js +73 -0
  21. package/dist/Editor/Elements/Emoji/EmojiPicker.js +0 -0
  22. package/dist/Editor/Elements/Form/Form.js +24 -13
  23. package/dist/Editor/Elements/Form/FormButton.js +11 -9
  24. package/dist/Editor/Elements/Form/FormElements/FormText.js +4 -2
  25. package/dist/Editor/Elements/Form/FormElements/FormTextArea.js +3 -2
  26. package/dist/Editor/Elements/Form/FormField.js +7 -1
  27. package/dist/Editor/Elements/Grid/Grid.js +143 -47
  28. package/dist/Editor/Elements/Grid/GridButton.js +52 -29
  29. package/dist/Editor/Elements/Grid/GridItem.js +32 -21
  30. package/dist/Editor/Elements/Grid/Styles.js +11 -0
  31. package/dist/Editor/Elements/InlineIcon/InlineIcon.js +0 -1
  32. package/dist/Editor/Elements/List/CheckList.js +57 -0
  33. package/dist/Editor/Elements/List/CheckListButton.js +24 -0
  34. package/dist/Editor/Elements/NewLine/NewLineButton.js +14 -14
  35. package/dist/Editor/Elements/PageSettings/PageSettings.js +4 -2
  36. package/dist/Editor/Elements/PageSettings/PageSettingsButton.js +17 -62
  37. package/dist/Editor/Elements/PageSettings/PageSettingsPopup.js +1 -1
  38. package/dist/Editor/Elements/Signature/Signature.js +9 -3
  39. package/dist/Editor/Elements/Signature/SignatureButton.js +10 -9
  40. package/dist/Editor/Elements/Signature/SignaturePopup.js +42 -6
  41. package/dist/Editor/Elements/SimpleText.js +62 -0
  42. package/dist/Editor/Elements/Table/Styles.js +66 -0
  43. package/dist/Editor/Elements/Table/Table.js +33 -16
  44. package/dist/Editor/Elements/Table/TableCell.js +54 -24
  45. package/dist/Editor/Elements/Table/TableSelector.js +13 -15
  46. package/dist/Editor/Elements/Table/table.css +0 -10
  47. package/dist/Editor/Elements/TopBanner/Styles.js +33 -0
  48. package/dist/Editor/Elements/TopBanner/TopBanner.js +106 -0
  49. package/dist/Editor/Elements/TopBanner/TopBannerButton.js +47 -0
  50. package/dist/Editor/Styles/EditorStyles.js +50 -0
  51. package/dist/Editor/Toolbar/FormatTools/Autocomplete.js +0 -2
  52. package/dist/Editor/Toolbar/FormatTools/Dropdown.js +8 -3
  53. package/dist/Editor/Toolbar/FormatTools/FontFamilyDropdown.js +63 -0
  54. package/dist/Editor/Toolbar/FormatTools/FontSize.js +112 -0
  55. package/dist/Editor/Toolbar/FormatTools/TextSize.js +13 -3
  56. package/dist/Editor/Toolbar/FormatTools/index.js +4 -1
  57. package/dist/Editor/Toolbar/Mini/MiniToolbar.js +101 -0
  58. package/dist/Editor/Toolbar/Mini/Options/Options.js +17 -0
  59. package/dist/Editor/Toolbar/Mini/Styles.js +30 -0
  60. package/dist/Editor/Toolbar/PopupTool/AddElements.js +32 -0
  61. package/dist/Editor/Toolbar/PopupTool/AddTemplates.js +115 -0
  62. package/dist/Editor/Toolbar/PopupTool/PopperHeader.js +65 -0
  63. package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +160 -6
  64. package/dist/Editor/Toolbar/PopupTool/TextFormat.js +263 -80
  65. package/dist/Editor/Toolbar/PopupTool/index.js +50 -85
  66. package/dist/Editor/Toolbar/Toolbar.js +189 -129
  67. package/dist/Editor/Toolbar/styles.css +136 -18
  68. package/dist/Editor/Toolbar/toolbarGroups.js +94 -34
  69. package/dist/Editor/assets/svg/AddElementIcon.js +29 -0
  70. package/dist/Editor/assets/svg/AddTemplateIcon.js +29 -0
  71. package/dist/Editor/assets/svg/TextIcon.js +29 -0
  72. package/dist/Editor/common/Icon.js +54 -5
  73. package/dist/Editor/common/ImageList.js +75 -0
  74. package/dist/Editor/common/ImageSelector/ImageSelector.js +117 -0
  75. package/dist/Editor/common/ImageSelector/Options/AddLink.js +44 -0
  76. package/dist/Editor/common/ImageSelector/Options/ChooseAssets.js +39 -0
  77. package/dist/Editor/common/ImageSelector/Options/Upload.js +30 -0
  78. package/dist/Editor/common/ImageSelector/Styles.js +41 -0
  79. package/dist/Editor/common/ImageUploader.js +94 -0
  80. package/dist/Editor/common/MentionsPopup/ElementsListCard.js +66 -0
  81. package/dist/Editor/common/MentionsPopup/MentionsListCard.js +70 -0
  82. package/dist/Editor/common/MentionsPopup/Styles.js +68 -0
  83. package/dist/Editor/common/MentionsPopup/index.js +129 -0
  84. package/dist/Editor/common/Shorthands/elements.js +191 -0
  85. package/dist/Editor/common/Shorthands/index.js +7 -0
  86. package/dist/Editor/common/Shorthands/mentions.js +8 -0
  87. package/dist/Editor/common/StyleBuilder/appHeaderStyle.js +5 -5
  88. package/dist/Editor/common/StyleBuilder/buttonStyle.js +1 -1
  89. package/dist/Editor/common/StyleBuilder/embedImageStyle.js +15 -2
  90. package/dist/Editor/common/StyleBuilder/embedVideoStyle.js +8 -0
  91. package/dist/Editor/common/StyleBuilder/fieldTypes/alignment.js +2 -3
  92. package/dist/Editor/common/StyleBuilder/fieldTypes/backgroundImage.js +23 -35
  93. package/dist/Editor/common/StyleBuilder/fieldTypes/buttonLink.js +3 -20
  94. package/dist/Editor/common/StyleBuilder/fieldTypes/fontSize.js +95 -0
  95. package/dist/Editor/common/StyleBuilder/fieldTypes/icons.js +14 -2
  96. package/dist/Editor/common/StyleBuilder/fieldTypes/index.js +3 -1
  97. package/dist/Editor/common/StyleBuilder/fieldTypes/menusArray.js +0 -1
  98. package/dist/Editor/common/StyleBuilder/fieldTypes/textOptions.js +3 -2
  99. package/dist/Editor/common/StyleBuilder/index.js +0 -1
  100. package/dist/Editor/common/StyleBuilder/tableStyle.js +9 -5
  101. package/dist/Editor/common/ToolbarIcon.js +43 -0
  102. package/dist/Editor/common/Uploader.js +35 -61
  103. package/dist/Editor/common/iconslist.js +46 -1
  104. package/dist/Editor/helper/index.js +0 -1
  105. package/dist/Editor/hooks/useDrag.js +2 -2
  106. package/dist/Editor/hooks/useMentions.js +104 -17
  107. package/dist/Editor/hooks/useMouseMove.js +53 -0
  108. package/dist/Editor/hooks/useScroll.js +26 -0
  109. package/dist/Editor/plugins/withEmbeds.js +12 -0
  110. package/dist/Editor/service/fileupload.js +2 -2
  111. package/dist/Editor/utils/SlateUtilityFunctions.js +61 -9
  112. package/dist/Editor/utils/button.js +2 -1
  113. package/dist/Editor/utils/carousel.js +5 -2
  114. package/dist/Editor/utils/carouselItem.js +2 -2
  115. package/dist/Editor/utils/customHooks/useResize.js +2 -3
  116. package/dist/Editor/utils/customHooks/useTableResize.js +2 -1
  117. package/dist/Editor/utils/embed.js +25 -8
  118. package/dist/Editor/utils/emoji.js +8 -0
  119. package/dist/Editor/utils/events.js +49 -12
  120. package/dist/Editor/utils/form.js +3 -9
  121. package/dist/Editor/utils/formfield.js +2 -1
  122. package/dist/Editor/utils/grid.js +44 -8
  123. package/dist/Editor/utils/gridItem.js +4 -3
  124. package/dist/Editor/utils/insertNewLine.js +12 -0
  125. package/dist/Editor/utils/mentions.js +14 -10
  126. package/dist/Editor/utils/pageSettings.js +67 -0
  127. package/dist/Editor/utils/signature.js +6 -8
  128. package/dist/Editor/utils/table.js +79 -18
  129. package/dist/Editor/utils/topBanner.js +58 -0
  130. package/package.json +6 -2
  131. package/dist/Editor/common/MentionsPopup.js +0 -56
@@ -1,25 +1,32 @@
1
+ /* eslint-disable no-unused-vars */
1
2
  import React, { useRef, useCallback, useEffect, useMemo, useState, forwardRef, useImperativeHandle } from "react";
2
3
  import { createEditor, Transforms } from "slate";
3
4
  import { Slate, Editable, ReactEditor } from "slate-react";
4
5
  import { DndContext, DragOverlay } from "@dnd-kit/core";
5
6
  import { useDebounce } from "use-debounce";
6
- // import { onKeyDown as linkifyOnKeyDown } from '@mercuriya/slate-linkify';
7
-
8
- import Toolbar from "./Toolbar/Toolbar";
7
+ // import Toolbar from "./Toolbar/Toolbar";
9
8
  import { getMarked, getBlock } from "./utils/SlateUtilityFunctions";
10
9
  import CodeToText from "./Elements/CodeToText/CodeToText";
11
10
  import { draftToSlate } from "./utils/draftToSlate";
12
11
  import useMentions from "./hooks/useMentions";
13
12
  import MentionsPopup from "./common/MentionsPopup";
14
13
  import { RemoteCursorOverlay } from "./RemoteCursorOverlay/Overlay";
15
- import { mentionsEvent, commands } from "./utils/events";
14
+ import { mentionsEvent, commands, indentation, escapeEvent } from "./utils/events";
16
15
  import withCommon from "./hooks/withCommon";
17
16
  import DialogWrapper from "./DialogWrapper";
18
17
  import { serialize } from "./utils/serializer";
18
+ import { getPageSettings } from "./utils/pageSettings";
19
19
  import { customCollisionDetectionAlgorithm, getThumbnailImage } from "./helper";
20
20
  import PopupTool from "./Toolbar/PopupTool";
21
21
  import "./font.css";
22
22
  import "./Editor.css";
23
+ import { Box } from "@mui/material";
24
+ import { KeyboardDoubleArrowDown, KeyboardDoubleArrowLeft, KeyboardDoubleArrowRight, KeyboardDoubleArrowUp } from "@mui/icons-material";
25
+ import Shorthands from "./common/Shorthands";
26
+ import MiniToolbar from "./Toolbar/Mini/MiniToolbar";
27
+ import { EditorProvider } from "./hooks/useMouseMove";
28
+ import TopBanner from "./Elements/TopBanner/TopBanner";
29
+ import editorStyles from "./Styles/EditorStyles";
23
30
  import { jsx as _jsx } from "react/jsx-runtime";
24
31
  import { jsxs as _jsxs } from "react/jsx-runtime";
25
32
  const PREVIEW_IMAGE_HIDE_CLASS = ["grid-container-toolbar", "grid-item-toolbar", "element-toolbar"];
@@ -59,9 +66,11 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
59
66
  onSave,
60
67
  editor: collaborativeEditor,
61
68
  readOnly,
69
+ toolbarOptions,
62
70
  otherProps
63
71
  } = props;
64
72
  const editorWrapper = useRef();
73
+ const mentionsRef = useRef();
65
74
  const convertedContent = draftToSlate({
66
75
  data: content
67
76
  });
@@ -70,14 +79,13 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
70
79
  const [isInteracted, setIsInteracted] = useState(false);
71
80
  const [deboundedValue] = useDebounce(value, 500);
72
81
  const [fullScreen, setFullScreen] = useState(false);
82
+ const [toolbarShow, setToolbarShow] = useState(true);
73
83
  const [isDrawerOpen, setIsDrawerOpen] = useState(false);
74
- console.log(isDrawerOpen);
75
84
  const [viewport, setViewport] = useState({
76
85
  w: null,
77
86
  h: null
78
87
  });
79
88
  const {
80
- defaultBG,
81
89
  needDotsBG,
82
90
  footer,
83
91
  needLayout = true,
@@ -85,21 +93,24 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
85
93
  editorClass
86
94
  } = otherProps || {};
87
95
  const [drag, setDrag] = useState(null);
96
+ const classes = editorStyles({
97
+ padHeight: !fullScreen ? otherProps?.padHeight : 120
98
+ });
88
99
  const editor = useMemo(() => {
89
100
  if (collaborativeEditor) return collaborativeEditor;
90
101
  return withCommon(createEditor(), {
91
102
  needLayout
92
103
  });
93
104
  }, [collaborativeEditor]);
94
- const pageSettings = editor?.children?.find(f => f.type === "page-settings");
95
105
  const {
96
- pageProps
97
- } = pageSettings || {};
106
+ element: pageSt
107
+ } = getPageSettings(editor) || {};
98
108
  const {
99
109
  bannerSpacing,
100
110
  pageBgImage,
101
- pageColor
102
- } = pageProps || {
111
+ pageColor,
112
+ pageWidth
113
+ } = pageSt?.pageProps || {
103
114
  bannerSpacing: {
104
115
  left: 0,
105
116
  right: 0,
@@ -172,7 +183,7 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
172
183
  editor.insertNode(fragments);
173
184
  } else {
174
185
  // loop delete all
175
- editor.children.map(item => {
186
+ editor.children.forEach(() => {
176
187
  Transforms.delete(editor, {
177
188
  at: [0]
178
189
  });
@@ -185,6 +196,9 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
185
196
  toggleFullscreen() {
186
197
  setFullScreen(!fullScreen);
187
198
  },
199
+ toggleToolbarShow() {
200
+ setToolbarShow(!toolbarShow);
201
+ },
188
202
  changeViewport({
189
203
  w,
190
204
  h
@@ -193,6 +207,9 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
193
207
  w,
194
208
  h
195
209
  });
210
+ },
211
+ getPageSettings: {
212
+ background: pageBgImage && pageBgImage !== "none" ? `url(${pageBgImage})` : pageColor || "#fff"
196
213
  }
197
214
  }));
198
215
  const [htmlAction, setHtmlAction] = useState({
@@ -208,9 +225,13 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
208
225
  const {
209
226
  search,
210
227
  target,
211
- index
228
+ index,
229
+ type
212
230
  } = mentions;
213
- const chars = CHARACTERS.filter(c => c.name.toLowerCase().startsWith(search?.toLowerCase())).slice(0, 10);
231
+ const chars = type ? Shorthands[type]({
232
+ ...mentions,
233
+ CHARACTERS
234
+ }) : [];
214
235
  const handleEditorChange = newValue => {
215
236
  setValue(newValue);
216
237
  if (!isInteracted) {
@@ -255,17 +276,27 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
255
276
  setMentions,
256
277
  chars,
257
278
  target,
258
- editor
279
+ editor,
280
+ type,
281
+ mentionsRef
259
282
  });
260
283
  } else if (isCtrlKey) {
261
284
  commands({
262
285
  event,
263
286
  editor
264
287
  });
265
- } else {
266
- // linkifyOnKeyDown(event, editor);
288
+ } else if (event.key === "Tab") {
289
+ event.preventDefault();
290
+ indentation({
291
+ editor
292
+ });
293
+ } else if (event.key === "Escape") {
294
+ event.preventDefault();
295
+ escapeEvent({
296
+ editor
297
+ });
267
298
  }
268
- }, [chars, editor, target, mentions, setMentions]);
299
+ }, [chars, editor, target, mentions, setMentions, search, type, mentionsRef]);
269
300
  const handleDragStart = e => {
270
301
  try {
271
302
  const {
@@ -318,7 +349,6 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
318
349
  }, 100);
319
350
  setDrag(null);
320
351
  } catch (err) {
321
- console.log(e);
322
352
  console.log(err);
323
353
  }
324
354
  };
@@ -329,85 +359,156 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
329
359
  backgroundSize: "40px 40px",
330
360
  backgroundPosition: "-19px -19px"
331
361
  } : {};
332
- return /*#__PURE__*/_jsx(DialogWrapper, {
333
- ...props,
334
- fullScreen: fullScreen,
335
- footer: footer || "",
336
- children: /*#__PURE__*/_jsx("div", {
337
- className: `editor-t-wrapper ${editorClass || ""}`,
338
- style: {
339
- display: "flex",
340
- flexDirection: "column",
341
- padding: "0 8px",
342
- ...dotBg
343
- },
344
- children: /*#__PURE__*/_jsxs(Slate, {
345
- editor: editor,
346
- initialValue: value,
347
- onChange: handleEditorChange,
348
- children: [/*#__PURE__*/_jsxs(DndContext, {
349
- collisionDetection: customCollisionDetectionAlgorithm,
350
- onDragStart: handleDragStart,
351
- onDragEnd: handleDragEnd,
352
- children: [/*#__PURE__*/_jsxs(Overlay, {
353
- children: [!isReadOnly ? /*#__PURE__*/_jsx(Toolbar, {
354
- handleCodeToText: handleCodeToText,
355
- customProps: customProps
356
- }) : null, /*#__PURE__*/_jsxs("div", {
357
- ref: editorWrapper,
358
- className: "editor-wrapper",
362
+ const handleToolbarSwitch = () => {
363
+ if (ref) {
364
+ ref?.current?.toggleToolbarShow();
365
+ } else {
366
+ setToolbarShow(!toolbarShow);
367
+ }
368
+ };
369
+ const getToolbarShowOpenIcon = type => {
370
+ switch (toolbarOptions?.toolbarPosition) {
371
+ case "top-left":
372
+ if (type === "open") {
373
+ return /*#__PURE__*/_jsx(KeyboardDoubleArrowRight, {});
374
+ }
375
+ return /*#__PURE__*/_jsx(KeyboardDoubleArrowLeft, {});
376
+ case "top-right":
377
+ if (type === "open") {
378
+ return /*#__PURE__*/_jsx(KeyboardDoubleArrowLeft, {});
379
+ }
380
+ return /*#__PURE__*/_jsx(KeyboardDoubleArrowRight, {});
381
+ case "left-top":
382
+ if (type === "open") {
383
+ return /*#__PURE__*/_jsx(KeyboardDoubleArrowDown, {});
384
+ }
385
+ return /*#__PURE__*/_jsx(KeyboardDoubleArrowUp, {});
386
+ case "left-bottom":
387
+ if (type === "open") {
388
+ return /*#__PURE__*/_jsx(KeyboardDoubleArrowUp, {});
389
+ }
390
+ return /*#__PURE__*/_jsx(KeyboardDoubleArrowDown, {});
391
+ case "right-top":
392
+ if (type === "open") {
393
+ return /*#__PURE__*/_jsx(KeyboardDoubleArrowDown, {});
394
+ }
395
+ return /*#__PURE__*/_jsx(KeyboardDoubleArrowUp, {});
396
+ case "right-bottom":
397
+ if (type === "open") {
398
+ return /*#__PURE__*/_jsx(KeyboardDoubleArrowUp, {});
399
+ }
400
+ return /*#__PURE__*/_jsx(KeyboardDoubleArrowDown, {});
401
+ case "bottom-left":
402
+ if (type === "open") {
403
+ return /*#__PURE__*/_jsx(KeyboardDoubleArrowRight, {});
404
+ }
405
+ return /*#__PURE__*/_jsx(KeyboardDoubleArrowLeft, {});
406
+ case "bottom-right":
407
+ if (type === "open") {
408
+ return /*#__PURE__*/_jsx(KeyboardDoubleArrowLeft, {});
409
+ }
410
+ return /*#__PURE__*/_jsx(KeyboardDoubleArrowRight, {});
411
+ default:
412
+ if (type === "open") {
413
+ return /*#__PURE__*/_jsx(KeyboardDoubleArrowRight, {});
414
+ }
415
+ return /*#__PURE__*/_jsx(KeyboardDoubleArrowLeft, {});
416
+ }
417
+ };
418
+ const renderTopBanner = () => {
419
+ const tb = editor.children[0];
420
+ return tb?.type === "topbanner" ? /*#__PURE__*/_jsx(TopBanner, {
421
+ element: tb,
422
+ editor: editor,
423
+ customProps: customProps
424
+ }) : null;
425
+ };
426
+ return /*#__PURE__*/_jsx(EditorProvider, {
427
+ children: /*#__PURE__*/_jsx(DialogWrapper, {
428
+ ...props,
429
+ fullScreen: fullScreen,
430
+ footer: footer || "",
431
+ children: /*#__PURE__*/_jsx(Box, {
432
+ component: "div",
433
+ className: `${editorClass || ""}`,
434
+ sx: classes.root,
435
+ style: {
436
+ ...dotBg
437
+ },
438
+ children: /*#__PURE__*/_jsxs(Slate, {
439
+ editor: editor,
440
+ initialValue: value,
441
+ onChange: handleEditorChange,
442
+ children: [/*#__PURE__*/_jsxs(DndContext, {
443
+ collisionDetection: customCollisionDetectionAlgorithm,
444
+ onDragStart: handleDragStart,
445
+ onDragEnd: handleDragEnd,
446
+ children: [/*#__PURE__*/_jsx(Overlay, {
447
+ children: /*#__PURE__*/_jsxs(Box, {
448
+ sx: classes.slateWrapper,
449
+ id: "slate-wrapper-scroll-container",
450
+ children: [renderTopBanner(), /*#__PURE__*/_jsx("div", {
451
+ className: "scroll-area",
452
+ children: /*#__PURE__*/_jsxs("div", {
453
+ ref: editorWrapper,
454
+ className: `editor-wrapper`,
455
+ style: {
456
+ backgroundColor: pageColor || "#FFF",
457
+ paddingLeft: `${bannerSpacing?.left || 12}px`,
458
+ paddingRight: `${bannerSpacing?.right || 12}px`,
459
+ paddingTop: `${bannerSpacing?.top}px`,
460
+ paddingBottom: `${bannerSpacing?.bottom}px`,
461
+ width: !pageWidth || pageWidth === "fixed" ? "60%" : "80%",
462
+ // width: viewport.w ? `${viewport.w}px` : "100%",
463
+ height: viewport.h ? `${viewport.h}px` : `100%`,
464
+ alignSelf: "center",
465
+ transformOrigin: "left top",
466
+ transition: "all 0.3s",
467
+ minHeight: "87%"
468
+ },
469
+ children: [/*#__PURE__*/_jsx(PopupTool, {
470
+ onDrawerOpen: onDrawerOpen
471
+ }), /*#__PURE__*/_jsx(Editable, {
472
+ className: "innert-editor-textbox",
473
+ readOnly: isReadOnly,
474
+ renderElement: renderElement,
475
+ renderLeaf: renderLeaf,
476
+ onKeyDown: onKeyDown
477
+ }), /*#__PURE__*/_jsx(MentionsPopup, {
478
+ ref: mentionsRef,
479
+ mentions: mentions,
480
+ setMentions: setMentions,
481
+ editor: editor,
482
+ target: target,
483
+ index: index,
484
+ chars: chars,
485
+ type: type
486
+ })]
487
+ })
488
+ }), /*#__PURE__*/_jsx(MiniToolbar, {
489
+ customProps: customProps,
490
+ toolbarOptions: toolbarOptions
491
+ })]
492
+ })
493
+ }), /*#__PURE__*/_jsx(DragOverlay, {
494
+ className: "drag-overlay",
359
495
  style: {
360
- border: "1px solid #f3f3f3",
361
- backgroundImage: pageBgImage ? `url(${pageBgImage})` : "none",
362
- backgroundColor: pageColor || defaultBG || "#FFF",
363
- color: pageProps?.color || "#000",
364
- paddingLeft: `${bannerSpacing?.left}px`,
365
- paddingRight: `${bannerSpacing?.right}px`,
366
- paddingTop: `${bannerSpacing?.top}px`,
367
- paddingBottom: `${bannerSpacing?.bottom}px`,
368
- width: viewport.w ? `${viewport.w}px` : "100%",
369
- height: viewport.h ? `${viewport.h}px` : "auto",
370
- alignSelf: "center",
371
- // scale: isDrawerOpen ? "0.75" : "1",
372
- transformOrigin: "left top",
373
- transition: "all 0.3s"
496
+ ...(drag?.style || {})
374
497
  },
375
- children: [/*#__PURE__*/_jsx(PopupTool, {
376
- onDrawerOpen: onDrawerOpen
377
- }), /*#__PURE__*/_jsx(Editable, {
378
- className: "innert-editor-textbox",
379
- readOnly: isReadOnly,
380
- placeholder: "Write something",
381
- renderElement: renderElement,
382
- renderLeaf: renderLeaf,
383
- onKeyDown: onKeyDown
384
- }), /*#__PURE__*/_jsx(MentionsPopup, {
385
- mentions: mentions,
386
- setMentions: setMentions,
387
- editor: editor,
388
- target: target,
389
- index: index,
390
- chars: chars
391
- })]
498
+ children: drag ? /*#__PURE__*/_jsx(Item, {
499
+ children: /*#__PURE__*/_jsx("div", {
500
+ dangerouslySetInnerHTML: {
501
+ __html: drag?.dom
502
+ }
503
+ })
504
+ }) : null
392
505
  })]
393
- }), /*#__PURE__*/_jsx(DragOverlay, {
394
- className: "drag-overlay",
395
- style: {
396
- ...(drag?.style || {})
397
- },
398
- children: drag ? /*#__PURE__*/_jsx(Item, {
399
- children: /*#__PURE__*/_jsx("div", {
400
- dangerouslySetInnerHTML: {
401
- __html: drag?.dom
402
- }
403
- })
404
- }) : null
506
+ }), htmlAction.showInput && /*#__PURE__*/_jsx(CodeToText, {
507
+ ...htmlAction,
508
+ handleCodeToText: handleCodeToText
405
509
  })]
406
- }), htmlAction.showInput && /*#__PURE__*/_jsx(CodeToText, {
407
- ...htmlAction,
408
- handleCodeToText: handleCodeToText
409
- })]
410
- }, id)
510
+ }, id)
511
+ })
411
512
  })
412
513
  });
413
514
  });
@@ -17,6 +17,9 @@ const DialogWrapper = props => {
17
17
  open: fullScreen,
18
18
  fullScreen: fullScreen,
19
19
  onClose: onClose,
20
+ style: {
21
+ zIndex: 1000
22
+ },
20
23
  children: [/*#__PURE__*/_jsx(DialogTitle, {
21
24
  children: /*#__PURE__*/_jsx(Grid, {
22
25
  children: /*#__PURE__*/_jsx(Grid, {