@flozy/editor 10.0.3 → 10.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (179) hide show
  1. package/dist/Editor/ChatEditor.js +14 -7
  2. package/dist/Editor/CommonEditor.js +30 -13
  3. package/dist/Editor/Editor.css +1 -1
  4. package/dist/Editor/Elements/AI/AIInput.js +5 -3
  5. package/dist/Editor/Elements/AI/CustomSelect.js +9 -5
  6. package/dist/Editor/Elements/AI/PopoverAIInput.js +4 -2
  7. package/dist/Editor/Elements/Accordion/Accordion.js +4 -3
  8. package/dist/Editor/Elements/Accordion/AccordionBtnPopup.js +4 -1
  9. package/dist/Editor/Elements/Accordion/AccordionButton.js +6 -2
  10. package/dist/Editor/Elements/Accordion/AccordionTitlePopup.js +4 -1
  11. package/dist/Editor/Elements/AppHeader/AppHeaderButton.js +6 -2
  12. package/dist/Editor/Elements/AppHeader/AppHeaderPopup.js +4 -1
  13. package/dist/Editor/Elements/Attachments/AttachmentsButton.js +4 -1
  14. package/dist/Editor/Elements/Button/ButtonPopup.js +4 -1
  15. package/dist/Editor/Elements/Button/ButtonToolIcon.js +6 -2
  16. package/dist/Editor/Elements/Button/EditorButton.js +6 -5
  17. package/dist/Editor/Elements/Carousel/Carousel.js +5 -4
  18. package/dist/Editor/Elements/Carousel/CarouselButton.js +6 -2
  19. package/dist/Editor/Elements/Carousel/CarouselItem.js +3 -2
  20. package/dist/Editor/Elements/ChipText/ChipTextPopup.js +4 -1
  21. package/dist/Editor/Elements/CodeToText/CodeToText.js +5 -4
  22. package/dist/Editor/Elements/CodeToText/HtmlContextMenu.js +6 -2
  23. package/dist/Editor/Elements/Colorbox/ColorboxButton.js +6 -2
  24. package/dist/Editor/Elements/DataView/DataView.js +5 -2
  25. package/dist/Editor/Elements/DataView/DataViewButton.js +6 -2
  26. package/dist/Editor/Elements/DataView/Layouts/FilterSort/SortOptions/ChooseSort.js +13 -12
  27. package/dist/Editor/Elements/DataView/Layouts/FilterSort/SortOptions/index.js +7 -4
  28. package/dist/Editor/Elements/DataView/Layouts/FilterSort/index.js +7 -5
  29. package/dist/Editor/Elements/DataView/Layouts/FilterView.js +9 -7
  30. package/dist/Editor/Elements/DataView/Layouts/Options/AddOptions.js +3 -2
  31. package/dist/Editor/Elements/DataView/Layouts/Options/AddProperty.js +5 -3
  32. package/dist/Editor/Elements/DataView/Layouts/Options/AllProperties.js +6 -5
  33. package/dist/Editor/Elements/DataView/Layouts/Options/ChangeProperty.js +5 -3
  34. package/dist/Editor/Elements/DataView/Layouts/Options/EditOption.js +7 -6
  35. package/dist/Editor/Elements/DataView/Layouts/Options/EditProperty.js +15 -12
  36. package/dist/Editor/Elements/DataView/Layouts/Options/FilterProperty.js +3 -2
  37. package/dist/Editor/Elements/DataView/Layouts/Options/PropertyList.js +3 -2
  38. package/dist/Editor/Elements/DataView/Layouts/Options/index.js +12 -6
  39. package/dist/Editor/Elements/DataView/Layouts/TableView.js +6 -4
  40. package/dist/Editor/Elements/DataView/Layouts/index.js +3 -1
  41. package/dist/Editor/Elements/DataView/Providers/DataViewProvider.js +5 -2
  42. package/dist/Editor/Elements/Divider/Divider.js +5 -3
  43. package/dist/Editor/Elements/Divider/DividerButton.js +6 -2
  44. package/dist/Editor/Elements/Divider/DividerPopup.js +3 -2
  45. package/dist/Editor/Elements/Embed/Embed.js +4 -1
  46. package/dist/Editor/Elements/Embed/EmbedPopup.js +4 -1
  47. package/dist/Editor/Elements/Embed/Image.js +16 -11
  48. package/dist/Editor/Elements/Embed/Video.js +10 -7
  49. package/dist/Editor/Elements/EmbedScript/Code.js +7 -4
  50. package/dist/Editor/Elements/EmbedScript/EmbedScript.js +6 -2
  51. package/dist/Editor/Elements/EmbedScript/EmbedScriptPopup.js +8 -5
  52. package/dist/Editor/Elements/Emoji/EmojiButton.js +6 -2
  53. package/dist/Editor/Elements/Form/FieldPopup.js +4 -1
  54. package/dist/Editor/Elements/Form/Form.js +12 -9
  55. package/dist/Editor/Elements/Form/FormButton.js +6 -2
  56. package/dist/Editor/Elements/Form/FormPopup.js +3 -2
  57. package/dist/Editor/Elements/Form/Workflow/FormWorkflow.js +18 -12
  58. package/dist/Editor/Elements/Form/Workflow/ListWorkflow.js +13 -8
  59. package/dist/Editor/Elements/Form/Workflow/MoreOptions.js +3 -2
  60. package/dist/Editor/Elements/Form/Workflow/UserInputs.js +4 -2
  61. package/dist/Editor/Elements/Form/Workflow/index.js +15 -9
  62. package/dist/Editor/Elements/FreeGrid/FreeGrid.js +168 -97
  63. package/dist/Editor/Elements/FreeGrid/FreeGridBox.js +31 -6
  64. package/dist/Editor/Elements/FreeGrid/FreeGridButton.js +6 -2
  65. package/dist/Editor/Elements/FreeGrid/FreeGridItem.js +54 -6
  66. package/dist/Editor/Elements/FreeGrid/Options/AddElement.js +3 -2
  67. package/dist/Editor/Elements/FreeGrid/Options/More.js +10 -4
  68. package/dist/Editor/Elements/Grid/Grid.js +13 -10
  69. package/dist/Editor/Elements/Grid/GridButton.js +9 -5
  70. package/dist/Editor/Elements/Grid/GridItem.js +13 -7
  71. package/dist/Editor/Elements/Grid/GridItemPopup.js +4 -1
  72. package/dist/Editor/Elements/Grid/GridPopup.js +4 -1
  73. package/dist/Editor/Elements/Grid/SectionPopup.js +4 -1
  74. package/dist/Editor/Elements/Link/Link.js +8 -5
  75. package/dist/Editor/Elements/Link/LinkButton.js +4 -1
  76. package/dist/Editor/Elements/List/CheckList.js +14 -9
  77. package/dist/Editor/Elements/NewLine/NewLineButton.js +6 -2
  78. package/dist/Editor/Elements/PageSettings/PageSettingsButton.js +4 -1
  79. package/dist/Editor/Elements/PageSettings/PageSettingsPopup.js +4 -1
  80. package/dist/Editor/Elements/Search/SearchButton.js +6 -3
  81. package/dist/Editor/Elements/Search/SearchList.js +7 -3
  82. package/dist/Editor/Elements/Signature/SignatureButton.js +6 -2
  83. package/dist/Editor/Elements/Signature/SignatureOptions/TypeSignature.js +6 -2
  84. package/dist/Editor/Elements/Signature/SignatureOptions/UploadSignature.js +4 -1
  85. package/dist/Editor/Elements/Signature/SignaturePopup.js +17 -16
  86. package/dist/Editor/Elements/SimpleText/index.js +5 -4
  87. package/dist/Editor/Elements/Table/DragButton.js +4 -2
  88. package/dist/Editor/Elements/Table/Table.js +21 -9
  89. package/dist/Editor/Elements/Table/TablePopup.js +4 -1
  90. package/dist/Editor/Elements/Table/TableSelector.js +10 -6
  91. package/dist/Editor/Elements/Table/TableTool.js +8 -4
  92. package/dist/Editor/Elements/TopBanner/TopBannerButton.js +4 -1
  93. package/dist/Editor/MiniEditor.js +9 -3
  94. package/dist/Editor/Toolbar/Basic/index.js +2 -1
  95. package/dist/Editor/Toolbar/FormatTools/BlockButton.js +6 -2
  96. package/dist/Editor/Toolbar/FormatTools/MarkButton.js +6 -2
  97. package/dist/Editor/Toolbar/Mini/MiniToolbar.js +17 -5
  98. package/dist/Editor/Toolbar/PopupTool/AddTemplates.js +10 -5
  99. package/dist/Editor/Toolbar/PopupTool/ButtonTemplatesCard.js +10 -4
  100. package/dist/Editor/Toolbar/PopupTool/FullViewCard.js +10 -4
  101. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/MiniColorPicker.js +6 -2
  102. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectAlignment.js +42 -35
  103. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectList.js +58 -51
  104. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectSuperSubscript.js +29 -22
  105. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectTypography.js +87 -73
  106. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/index.js +14 -7
  107. package/dist/Editor/Toolbar/PopupTool/PopperHeader.js +8 -4
  108. package/dist/Editor/Toolbar/PopupTool/TemplateCard.js +11 -5
  109. package/dist/Editor/Toolbar/PopupTool/TextFormat.js +32 -27
  110. package/dist/Editor/Toolbar/PopupTool/index.js +17 -1
  111. package/dist/Editor/Toolbar/Toolbar.js +20 -10
  112. package/dist/Editor/common/CustomDialog/index.js +8 -10
  113. package/dist/Editor/common/ImageSelector/ImageSelector.js +10 -8
  114. package/dist/Editor/common/ImageSelector/Options/AddLink.js +6 -4
  115. package/dist/Editor/common/LinkSettings/NavComponents.js +14 -10
  116. package/dist/Editor/common/LinkSettings/index.js +20 -14
  117. package/dist/Editor/common/LinkSettings/navOptions.js +1 -1
  118. package/dist/Editor/common/MentionsPopup/index.js +6 -2
  119. package/dist/Editor/common/RnD/ContextMenu/CMenus.js +46 -22
  120. package/dist/Editor/common/RnD/ContextMenu/index.js +3 -2
  121. package/dist/Editor/common/RnD/ElementOptions/index.js +7 -2
  122. package/dist/Editor/common/RnD/ElementSettings/OtherSettings/SaveAsTemplate.js +8 -3
  123. package/dist/Editor/common/RnD/ElementSettings/OtherSettings/Settings.js +5 -2
  124. package/dist/Editor/common/RnD/ElementSettings/Settings/FormSettings.js +3 -2
  125. package/dist/Editor/common/RnD/ElementSettings/Settings/TextSettings.js +4 -2
  126. package/dist/Editor/common/RnD/OptionsPopup/index.js +4 -3
  127. package/dist/Editor/common/RnD/ShadowElement.js +2 -1
  128. package/dist/Editor/common/RnD/SwitchViewport/SwitchViewport.js +4 -3
  129. package/dist/Editor/common/RnD/Utils/gridDropItem.js +74 -9
  130. package/dist/Editor/common/RnD/Utils/index.js +3 -0
  131. package/dist/Editor/common/RnD/VirtualElement/BoxHeaderAutoAlignment.js +43 -0
  132. package/dist/Editor/common/RnD/VirtualElement/ForceAutoAlignment.js +44 -0
  133. package/dist/Editor/common/RnD/VirtualElement/VirtualTextElement.js +134 -0
  134. package/dist/Editor/common/RnD/VirtualElement/helper.js +382 -0
  135. package/dist/Editor/common/RnD/VirtualElement/index.js +187 -103
  136. package/dist/Editor/common/RnD/VirtualElement/styles.js +157 -7
  137. package/dist/Editor/common/RnD/VirtualElement/updateAutoProps.js +5 -3
  138. package/dist/Editor/common/RnD/index.js +76 -8
  139. package/dist/Editor/common/Section/index.js +7 -4
  140. package/dist/Editor/common/Shorthands/elements.js +18 -3
  141. package/dist/Editor/common/StyleBuilder/appHeaderStyle.js +4 -4
  142. package/dist/Editor/common/StyleBuilder/boxStyle.js +2 -2
  143. package/dist/Editor/common/StyleBuilder/buttonStyle.js +2 -2
  144. package/dist/Editor/common/StyleBuilder/dividerStyles.js +2 -2
  145. package/dist/Editor/common/StyleBuilder/embedVideoStyle.js +6 -6
  146. package/dist/Editor/common/StyleBuilder/fieldStyle.js +2 -2
  147. package/dist/Editor/common/StyleBuilder/fieldTypes/alignment.js +13 -9
  148. package/dist/Editor/common/StyleBuilder/fieldTypes/backgroundImage.js +6 -3
  149. package/dist/Editor/common/StyleBuilder/fieldTypes/bannerSpacing.js +7 -3
  150. package/dist/Editor/common/StyleBuilder/fieldTypes/borderRadius.js +7 -3
  151. package/dist/Editor/common/StyleBuilder/fieldTypes/buttonLink.js +6 -3
  152. package/dist/Editor/common/StyleBuilder/fieldTypes/card.js +11 -5
  153. package/dist/Editor/common/StyleBuilder/fieldTypes/color.js +9 -5
  154. package/dist/Editor/common/StyleBuilder/fieldTypes/elementSize.js +10 -6
  155. package/dist/Editor/common/StyleBuilder/fieldTypes/fontSize.js +6 -2
  156. package/dist/Editor/common/StyleBuilder/fieldTypes/gridSize.js +6 -2
  157. package/dist/Editor/common/StyleBuilder/fieldTypes/icons.js +5 -2
  158. package/dist/Editor/common/StyleBuilder/fieldTypes/menusArray.js +9 -6
  159. package/dist/Editor/common/StyleBuilder/fieldTypes/metaDataMapping.js +8 -2
  160. package/dist/Editor/common/StyleBuilder/fieldTypes/saveAsTemplate.js +12 -11
  161. package/dist/Editor/common/StyleBuilder/fieldTypes/selectBox.js +6 -2
  162. package/dist/Editor/common/StyleBuilder/fieldTypes/text.js +8 -4
  163. package/dist/Editor/common/StyleBuilder/fieldTypes/textAlign.js +6 -2
  164. package/dist/Editor/common/StyleBuilder/fieldTypes/textOptions.js +6 -5
  165. package/dist/Editor/common/StyleBuilder/formStyle.js +7 -7
  166. package/dist/Editor/common/StyleBuilder/gridItemStyle.js +6 -6
  167. package/dist/Editor/common/StyleBuilder/gridStyle.js +5 -5
  168. package/dist/Editor/common/StyleBuilder/index.js +8 -5
  169. package/dist/Editor/common/Uploader.js +8 -5
  170. package/dist/Editor/helper/index.js +27 -3
  171. package/dist/Editor/hooks/useAutoScroll.js +38 -0
  172. package/dist/Editor/plugins/withHTML.js +7 -6
  173. package/dist/Editor/plugins/withLayout.js +3 -2
  174. package/dist/Editor/plugins/withLinks.js +9 -0
  175. package/dist/Editor/utils/SlateUtilityFunctions.js +20 -11
  176. package/dist/Editor/utils/brains.js +1 -2
  177. package/dist/Editor/utils/freegrid.js +3 -4
  178. package/dist/Editor/utils/helper.js +2 -2
  179. package/package.json +1 -1
@@ -19,6 +19,13 @@ import { removeSign } from "./ElementSettings/OtherSettings";
19
19
  import useDragging from "../../hooks/useDragging";
20
20
  import { dragOverOn } from "../../helper/RnD/focusNode";
21
21
  import { focusSelection, clearSelection, clearSelectionOnly } from "../../helper";
22
+ // import { reRenderChildNodes } from "./Utils/gridDropItem";
23
+ import VirtualTextElement from "./VirtualElement/VirtualTextElement";
24
+ import useAutoScroll from "../../hooks/useAutoScroll";
25
+ import ForceAutoAlignment from "./VirtualElement/ForceAutoAlignment";
26
+ import BoxHeaderAutoAlignment from "./VirtualElement/BoxHeaderAutoAlignment";
27
+ import { reRenderChildNodes } from "./Utils/gridDropItem";
28
+ import { useFreeGrid } from "../../Elements/FreeGrid/FreeGrid";
22
29
  import { jsx as _jsx } from "react/jsx-runtime";
23
30
  import { jsxs as _jsxs } from "react/jsx-runtime";
24
31
  import { Fragment as _Fragment } from "react/jsx-runtime";
@@ -64,7 +71,13 @@ const RnD = props => {
64
71
  editor,
65
72
  breakpoint = "",
66
73
  handleContextMenuClick = () => {},
67
- itemData = {}
74
+ itemData = {},
75
+ sectionElement,
76
+ dataSets,
77
+ autoAlign,
78
+ setAutoAlign,
79
+ isBoxHeader,
80
+ customProps
68
81
  } = props;
69
82
  const {
70
83
  isSelectedElement,
@@ -106,6 +119,17 @@ const RnD = props => {
106
119
  y: 0
107
120
  });
108
121
  const parentSectionPath = str_path?.split("|").slice(0, 2).join("_");
122
+ const {
123
+ startAutoScroll,
124
+ stopAutoScroll
125
+ } = useAutoScroll(10, "slate-wrapper-scroll-container");
126
+ const {
127
+ isInteracting,
128
+ setIsInteracting
129
+ } = useFreeGrid();
130
+ const {
131
+ translation
132
+ } = customProps;
109
133
  useEffect(() => {
110
134
  if (ITEM_TYPES.includes(type)) {
111
135
  if (enable === 1) {
@@ -280,7 +304,7 @@ const RnD = props => {
280
304
  const {
281
305
  updated_at
282
306
  } = updated_data || {};
283
- setSelectedElement({});
307
+ // setSelectedElement({});
284
308
  // to maitain absolute
285
309
  rndRef.current.posUpdated = false;
286
310
  // need to retain drag option if section changes
@@ -299,6 +323,7 @@ const RnD = props => {
299
323
  };
300
324
  const onDragStart = e => {
301
325
  e.preventDefault();
326
+ setIsInteracting(true);
302
327
  if (e?.target?.dataset?.path?.split(",").join("|") === sp) {
303
328
  const {
304
329
  left,
@@ -347,6 +372,16 @@ const RnD = props => {
347
372
  };
348
373
  const onDrag = e => {
349
374
  e.preventDefault();
375
+ const {
376
+ clientY
377
+ } = e;
378
+ if (clientY < 50) {
379
+ startAutoScroll("up");
380
+ } else if (window.innerHeight - clientY < 50) {
381
+ startAutoScroll("down");
382
+ } else {
383
+ stopAutoScroll();
384
+ }
350
385
  const lines = getClosestDraggable(e.clientX, e.clientY, `.freegrid-section_${parentSectionPath} .freegrid-container .freegrid-item.inactive-drag`.replace(/\|/g, "\\|"), ".freegrid-item.active-drag:not(.exclude-virtual)");
351
386
  setAbsPosition({
352
387
  ...absPosition,
@@ -389,6 +424,8 @@ const RnD = props => {
389
424
  const onDragStop = (e, d) => {
390
425
  e.preventDefault();
391
426
  e.stopPropagation();
427
+ stopAutoScroll();
428
+ setIsInteracting(false);
392
429
  if (dragging?.isDragging === 2 && dragging?.position?.strXY && dragging?.dragOver) {
393
430
  d.x = e.x;
394
431
  d.y = e.y;
@@ -431,6 +468,7 @@ const RnD = props => {
431
468
  };
432
469
  const onResizeStop = (e, direction, ref, d, position) => {
433
470
  e.preventDefault();
471
+ setIsInteracting(false);
434
472
  let updatedPosition = {};
435
473
  if (type !== "parent") {
436
474
  // update element position while resizing, (for free grid box and item)
@@ -449,13 +487,18 @@ const RnD = props => {
449
487
  }
450
488
  const updatedSize = {
451
489
  width: delta?.width + d.width,
452
- height: delta?.height + d.height,
490
+ height: ref.offsetHeight,
453
491
  ...updatedPosition
454
492
  };
455
493
  onChange({
456
494
  ...updatedSize
457
495
  });
458
496
  handleResizeEvent("stop");
497
+ const parentPath = getParentSectionPath({
498
+ ref
499
+ }, ".freegrid-container-parent");
500
+ const formatParentPath = parentPath?.split("|")?.map(m => parseInt(m));
501
+ reRenderChildNodes(editor, formatParentPath);
459
502
  };
460
503
  const onCloseSettings = () => {
461
504
  setSelectedElement({
@@ -514,6 +557,7 @@ const RnD = props => {
514
557
  return {
515
558
  onResizeStart: e => {
516
559
  e.preventDefault();
560
+ setIsInteracting(true);
517
561
  },
518
562
  onDragStart: onDragStart,
519
563
  onDrag: onDrag,
@@ -530,7 +574,7 @@ const RnD = props => {
530
574
  return /*#__PURE__*/_jsxs(_Fragment, {
531
575
  children: [/*#__PURE__*/_jsxs(Box, {
532
576
  component: Rnd,
533
- placeholder: ItemTypes[childType] || "Item",
577
+ placeholder: translation(ItemTypes[childType]) || translation("Item"),
534
578
  id: eId || "",
535
579
  ref: c => {
536
580
  positionRef.current = c;
@@ -564,6 +608,7 @@ const RnD = props => {
564
608
  ...DISABLE_RESIZING
565
609
  },
566
610
  ...getEventProps(),
611
+ ...(dataSets || {}),
567
612
  children: [/*#__PURE__*/_jsx("div", {
568
613
  id: `opt_ref_${str_path}`,
569
614
  style: {
@@ -586,7 +631,7 @@ const RnD = props => {
586
631
  "data-dragoverid": str_path,
587
632
  "data-dragovertype": type
588
633
  }) : null]
589
- }, eId), !active && rndRef?.current && open ? /*#__PURE__*/_jsx(ElementOptions, {
634
+ }, eId), !active && rndRef?.current && open && !isInteracting ? /*#__PURE__*/_jsx(ElementOptions, {
590
635
  id: `opt_ref_${str_path}`,
591
636
  open: open,
592
637
  anchorEl: rndRef?.current,
@@ -597,7 +642,9 @@ const RnD = props => {
597
642
  optionsProps: optionsProps,
598
643
  selectedAction: currentAction,
599
644
  path: str_path,
600
- theme: theme
645
+ theme: theme,
646
+ translation: translation,
647
+ customProps: customProps
601
648
  }) : null, /*#__PURE__*/_jsx(ElementSettings, {
602
649
  open: Boolean(currentAction),
603
650
  currentAction: currentAction,
@@ -631,11 +678,32 @@ const RnD = props => {
631
678
  open: openContextMenu,
632
679
  contextMenu: contextMenu,
633
680
  handleClose: handleClose,
634
- theme: theme
681
+ theme: theme,
682
+ translation: translation
635
683
  }), type === "parent" && breakpoint === "lg" && !readOnly ? /*#__PURE__*/_jsx(VirtualElement, {
636
- parentEle: positionRef?.current?.resizableElement?.current,
637
684
  updated_at: updated_at,
638
685
  path: str_path,
686
+ editor: editor,
687
+ sectionElement: sectionElement,
688
+ sectionCls: `.freegrid-section_${path.join("_")}`,
689
+ dataSets: dataSets
690
+ }) : null, childType === "text" && breakpoint === "lg" && !readOnly && enable ? /*#__PURE__*/_jsx(VirtualTextElement, {
691
+ editor: editor,
692
+ dataSets: dataSets,
693
+ getCurrentEle: getCurrentEle,
694
+ path: path
695
+ }) : null, type === "parent" && breakpoint === "xs" && !readOnly && autoAlign ? /*#__PURE__*/_jsx(ForceAutoAlignment, {
696
+ updated_at: updated_at,
697
+ path: str_path,
698
+ editor: editor,
699
+ sectionElement: sectionElement,
700
+ sectionCls: `.freegrid-section_${path.join("_")}`,
701
+ dataSets: dataSets,
702
+ autoAlign: autoAlign,
703
+ setAutoAlign: setAutoAlign
704
+ }) : null, isBoxHeader && breakpoint === "lg" ? /*#__PURE__*/_jsx(BoxHeaderAutoAlignment, {
705
+ boxCls: `.freegrid-box_${path.join("_")}`,
706
+ path: str_path,
639
707
  editor: editor
640
708
  }) : null]
641
709
  });
@@ -19,7 +19,8 @@ const Toolbar = ({
19
19
  readOnly,
20
20
  showTool,
21
21
  onSettings,
22
- isSectionFullWidth
22
+ isSectionFullWidth,
23
+ translation
23
24
  }) => {
24
25
  return !readOnly && !showTool ? /*#__PURE__*/_jsx(Box, {
25
26
  component: "div",
@@ -33,7 +34,7 @@ const Toolbar = ({
33
34
  }
34
35
  },
35
36
  children: /*#__PURE__*/_jsx(Tooltip, {
36
- title: "Section Settings",
37
+ title: translation("Section Settings"),
37
38
  children: /*#__PURE__*/_jsx(IconButton, {
38
39
  onClick: onSettings,
39
40
  children: /*#__PURE__*/_jsx(SectionSettingIcon, {})
@@ -51,7 +52,8 @@ const Section = props => {
51
52
  customProps
52
53
  } = props;
53
54
  const {
54
- readOnly
55
+ readOnly,
56
+ translation
55
57
  } = customProps;
56
58
  const editor = useSlateStatic();
57
59
  // const [isHovering, setIsHovering] = useState(false);
@@ -176,7 +178,8 @@ const Section = props => {
176
178
  isSectionFullWidth: isSectionFullWidth,
177
179
  readOnly: readOnly,
178
180
  showTool: false,
179
- onSettings: onSettings
181
+ onSettings: onSettings,
182
+ translation: translation
180
183
  }), children]
181
184
  }), openSetttings ? /*#__PURE__*/_jsx(SectionPopup, {
182
185
  element: {
@@ -164,7 +164,10 @@ const ELEMENTS_LIST = [{
164
164
  type: "emoji",
165
165
  renderComponent: rest => /*#__PURE__*/_jsx(EmojiButton, {
166
166
  ...rest,
167
- icoBtnType: "cmd"
167
+ icoBtnType: "cmd",
168
+ customProps: {
169
+ ...rest
170
+ }
168
171
  })
169
172
  }, {
170
173
  name: "Brain",
@@ -176,7 +179,10 @@ const ELEMENTS_LIST = [{
176
179
  element: {
177
180
  name: "Brain"
178
181
  },
179
- icoBtnType: "cmd"
182
+ icoBtnType: "cmd",
183
+ customProps: {
184
+ ...rest
185
+ }
180
186
  })
181
187
  }, {
182
188
  name: "Divider",
@@ -299,10 +305,19 @@ const elements = props => {
299
305
  const {
300
306
  search,
301
307
  hideTools,
308
+ translation,
302
309
  editor
303
310
  } = props;
304
311
  const nodeType = canOpen(editor);
305
- const filteredElements = ELEMENTS_LIST.filter(f => (hideTools || []).indexOf(f.type) === -1 && (!f?.hideFor || f?.hideFor?.indexOf(nodeType) === -1));
312
+ const translatedElements = ELEMENTS_LIST.map(element => ({
313
+ ...element,
314
+ name: translation ? translation(element.name) : element.name,
315
+ renderComponent: element.renderComponent ? rest => element.renderComponent({
316
+ ...rest,
317
+ translation
318
+ }) : undefined
319
+ }));
320
+ const filteredElements = translatedElements.filter(f => (hideTools || []).indexOf(f.type) === -1 && (!f?.hideFor || f?.hideFor?.indexOf(nodeType) === -1));
306
321
  return filteredElements.filter(c => c.name.toLowerCase().includes(search?.toLowerCase()));
307
322
  };
308
323
  export default elements;
@@ -15,12 +15,12 @@ const appHeaderStyle = [{
15
15
  options: fontOptions,
16
16
  webFont: true,
17
17
  width: 7,
18
- renderOption: option => {
18
+ renderOption: (option, elementProps, translation) => {
19
19
  return /*#__PURE__*/_jsx("span", {
20
20
  style: {
21
21
  fontFamily: option.value
22
22
  },
23
- children: "LOGO"
23
+ children: translation("LOGO")
24
24
  });
25
25
  }
26
26
  }, {
@@ -58,12 +58,12 @@ const appHeaderStyle = [{
58
58
  webFont: true,
59
59
  width: 7,
60
60
  options: fontOptions,
61
- renderOption: option => {
61
+ renderOption: (option, elementProps, translation) => {
62
62
  return /*#__PURE__*/_jsx("span", {
63
63
  style: {
64
64
  fontFamily: option.value
65
65
  },
66
- children: "Home"
66
+ children: translation("Home")
67
67
  });
68
68
  }
69
69
  }, {
@@ -51,9 +51,9 @@ const boxStyle = [{
51
51
  text: "Dashed",
52
52
  value: "dashed"
53
53
  }],
54
- renderOption: option => {
54
+ renderOption: (option, elementProps, translation) => {
55
55
  return /*#__PURE__*/_jsx("span", {
56
- children: option.text
56
+ children: translation(option.text)
57
57
  });
58
58
  }
59
59
  }]
@@ -104,9 +104,9 @@ const buttonStyle = [{
104
104
  text: "Dashed",
105
105
  value: "dashed"
106
106
  }],
107
- renderOption: option => {
107
+ renderOption: (option, elementProps, translation) => {
108
108
  return /*#__PURE__*/_jsx("span", {
109
- children: option.text
109
+ children: translation(option.text)
110
110
  });
111
111
  }
112
112
  }]
@@ -46,9 +46,9 @@ const dividerStyle = [{
46
46
  text: "Outset",
47
47
  value: "outset"
48
48
  }],
49
- renderOption: option => {
49
+ renderOption: (option, lementProps, translation) => {
50
50
  return /*#__PURE__*/_jsx("span", {
51
- children: option.text
51
+ children: translation(option.text)
52
52
  });
53
53
  }
54
54
  }]
@@ -16,18 +16,18 @@ const embedVideoStyle = [{
16
16
  key: "aspectRatio",
17
17
  type: "textOptions",
18
18
  options: [{
19
- text: "16:9 (Default)",
19
+ text: "deafultRatio",
20
20
  value: "16 / 9"
21
21
  }, {
22
- text: "9:16",
22
+ text: "nineSixteen",
23
23
  value: "9 / 16"
24
24
  }, {
25
25
  text: "Custom",
26
26
  value: "custom"
27
27
  }],
28
- renderOption: option => {
28
+ renderOption: (option, elementProps, translation) => {
29
29
  return /*#__PURE__*/_jsx("span", {
30
- children: option.text
30
+ children: translation(option.text)
31
31
  });
32
32
  }
33
33
  }]
@@ -78,9 +78,9 @@ const embedVideoStyle = [{
78
78
  text: "Dashed",
79
79
  value: "dashed"
80
80
  }],
81
- renderOption: option => {
81
+ renderOption: (option, elementProps, translation) => {
82
82
  return /*#__PURE__*/_jsx("span", {
83
- children: option.text
83
+ children: translation(option.text)
84
84
  });
85
85
  }
86
86
  }]
@@ -57,9 +57,9 @@ const fieldStyle = [{
57
57
  text: "Dashed",
58
58
  value: "dashed"
59
59
  }],
60
- renderOption: option => {
60
+ renderOption: (option, elementProps, translation) => {
61
61
  return /*#__PURE__*/_jsx("span", {
62
- children: option.text
62
+ children: translation(option.text)
63
63
  });
64
64
  }
65
65
  }]
@@ -8,8 +8,12 @@ const Alignment = props => {
8
8
  const {
9
9
  value,
10
10
  data,
11
- onChange
11
+ onChange,
12
+ customProps
12
13
  } = props;
14
+ const {
15
+ translation
16
+ } = customProps;
13
17
  const {
14
18
  key
15
19
  } = data;
@@ -36,7 +40,7 @@ const Alignment = props => {
36
40
  fontSize: "14px",
37
41
  fontWeight: 500
38
42
  },
39
- children: "Alignment"
43
+ children: translation("Alignment")
40
44
  })
41
45
  }), /*#__PURE__*/_jsxs("div", {
42
46
  style: {
@@ -53,21 +57,21 @@ const Alignment = props => {
53
57
  display: "flex"
54
58
  },
55
59
  children: [/*#__PURE__*/_jsx(Tooltip, {
56
- title: "Align Left",
60
+ title: translation("Align Left"),
57
61
  children: /*#__PURE__*/_jsx(FormControlLabel, {
58
62
  value: "start",
59
63
  control: /*#__PURE__*/_jsx(Radio, {}),
60
64
  label: /*#__PURE__*/_jsx(JustifyStartIcon, {})
61
65
  })
62
66
  }), /*#__PURE__*/_jsx(Tooltip, {
63
- title: "Align Center",
67
+ title: translation("Align Center"),
64
68
  children: /*#__PURE__*/_jsx(FormControlLabel, {
65
69
  value: "center",
66
70
  control: /*#__PURE__*/_jsx(Radio, {}),
67
71
  label: /*#__PURE__*/_jsx(JustifyCenterIcon, {})
68
72
  })
69
73
  }), /*#__PURE__*/_jsx(Tooltip, {
70
- title: "Align Right",
74
+ title: translation("Align Right"),
71
75
  children: /*#__PURE__*/_jsx(FormControlLabel, {
72
76
  value: "end",
73
77
  control: /*#__PURE__*/_jsx(Radio, {}),
@@ -85,21 +89,21 @@ const Alignment = props => {
85
89
  display: "flex"
86
90
  },
87
91
  children: [/*#__PURE__*/_jsx(Tooltip, {
88
- title: "Align Top",
92
+ title: translation("Align Top"),
89
93
  children: /*#__PURE__*/_jsx(FormControlLabel, {
90
94
  value: "start",
91
95
  control: /*#__PURE__*/_jsx(Radio, {}),
92
96
  label: /*#__PURE__*/_jsx(AlignStartIcon, {})
93
97
  })
94
98
  }), /*#__PURE__*/_jsx(Tooltip, {
95
- title: "Align Middle",
99
+ title: translation("Align Middle"),
96
100
  children: /*#__PURE__*/_jsx(FormControlLabel, {
97
101
  value: "center",
98
102
  control: /*#__PURE__*/_jsx(Radio, {}),
99
103
  label: /*#__PURE__*/_jsx(AlignCenterIcon, {})
100
104
  })
101
105
  }), /*#__PURE__*/_jsx(Tooltip, {
102
- title: "Align Bottom",
106
+ title: translation("Align Bottom"),
103
107
  children: /*#__PURE__*/_jsx(FormControlLabel, {
104
108
  value: "end",
105
109
  control: /*#__PURE__*/_jsx(Radio, {}),
@@ -122,7 +126,7 @@ const Alignment = props => {
122
126
  fontSize: "14px",
123
127
  fontWeight: 500
124
128
  },
125
- children: "Direction"
129
+ children: translation("Direction")
126
130
  })
127
131
  }), /*#__PURE__*/_jsxs(RadioGroup, {
128
132
  row: true,
@@ -13,6 +13,9 @@ const BackgroundImage = props => {
13
13
  customProps,
14
14
  onChange
15
15
  } = props;
16
+ const {
17
+ translation
18
+ } = customProps;
16
19
  const {
17
20
  key
18
21
  } = data;
@@ -52,7 +55,7 @@ const BackgroundImage = props => {
52
55
  fontWeight: "500",
53
56
  marginBottom: "8px"
54
57
  },
55
- children: "Upload Image"
58
+ children: translation("Upload Image")
56
59
  }), /*#__PURE__*/_jsx(Grid, {
57
60
  container: true,
58
61
  sx: classes.uploadContainer,
@@ -70,7 +73,7 @@ const BackgroundImage = props => {
70
73
  children: base64 ? /*#__PURE__*/_jsx(Grid, {
71
74
  className: "removeImageText",
72
75
  onClick: onRemoveBG,
73
- children: "REMOVE"
76
+ children: translation("REMOVE")
74
77
  }) : /*#__PURE__*/_jsx(Grid, {
75
78
  className: "uploadImageText",
76
79
  children: /*#__PURE__*/_jsxs(Button, {
@@ -87,7 +90,7 @@ const BackgroundImage = props => {
87
90
  style: {
88
91
  paddingLeft: "8px"
89
92
  },
90
- children: "Upload a image"
93
+ children: translation("Upload a image")
91
94
  })]
92
95
  })
93
96
  })
@@ -13,8 +13,12 @@ const BannerSpacing = props => {
13
13
  data,
14
14
  onChange,
15
15
  elementProps,
16
- classes
16
+ classes,
17
+ customProps
17
18
  } = props;
19
+ const {
20
+ translation
21
+ } = customProps;
18
22
  const {
19
23
  key
20
24
  } = data;
@@ -63,7 +67,7 @@ const BannerSpacing = props => {
63
67
  fontSize: "14px",
64
68
  fontWeight: 500
65
69
  },
66
- children: data?.label
70
+ children: translation(data?.label)
67
71
  }), /*#__PURE__*/_jsxs(Grid, {
68
72
  container: true,
69
73
  wrap: "nowrap",
@@ -126,7 +130,7 @@ const BannerSpacing = props => {
126
130
  sx: {
127
131
  fontSize: "14px"
128
132
  },
129
- children: "Customize"
133
+ children: translation("Customize")
130
134
  })
131
135
  }), !lockSpacing ? /*#__PURE__*/_jsx(Grid, {
132
136
  container: true,
@@ -13,8 +13,12 @@ const BorderRadius = props => {
13
13
  data,
14
14
  onChange,
15
15
  elementProps,
16
- classes
16
+ classes,
17
+ customProps
17
18
  } = props;
19
+ const {
20
+ translation
21
+ } = customProps;
18
22
  let {
19
23
  lockRadius
20
24
  } = elementProps;
@@ -60,7 +64,7 @@ const BorderRadius = props => {
60
64
  fontSize: "14px",
61
65
  fontWeight: 500
62
66
  },
63
- children: data?.label
67
+ children: translation(data?.label)
64
68
  }), /*#__PURE__*/_jsxs(Grid, {
65
69
  container: true,
66
70
  wrap: "nowrap",
@@ -113,7 +117,7 @@ const BorderRadius = props => {
113
117
  sx: {
114
118
  fontSize: "14px"
115
119
  },
116
- children: "Customize"
120
+ children: translation("Customize")
117
121
  })
118
122
  }), !lockRadius ? /*#__PURE__*/_jsx(Grid, {
119
123
  container: true,
@@ -14,6 +14,9 @@ const ButtonLink = props => {
14
14
  const {
15
15
  key
16
16
  } = data;
17
+ const {
18
+ translation
19
+ } = customProps;
17
20
  const {
18
21
  metadata
19
22
  } = customProps || {
@@ -76,7 +79,7 @@ const ButtonLink = props => {
76
79
  fontWeight: 500
77
80
  },
78
81
  id: "demo-radio-buttons-group-label",
79
- children: "Where do you want to Link?"
82
+ children: translation("whereToLinkText")
80
83
  }), /*#__PURE__*/_jsxs(RadioGroup, {
81
84
  row: true,
82
85
  "aria-labelledby": "demo-radio-buttons-group-label",
@@ -93,7 +96,7 @@ const ButtonLink = props => {
93
96
  style: {
94
97
  fontSize: "14px"
95
98
  },
96
- children: "Next Step"
99
+ children: translation("nextStep")
97
100
  })
98
101
  }), /*#__PURE__*/_jsx(FormControlLabel, {
99
102
  value: "webAddress",
@@ -104,7 +107,7 @@ const ButtonLink = props => {
104
107
  style: {
105
108
  fontSize: "14px"
106
109
  },
107
- children: "Web Address"
110
+ children: translation("webAddress")
108
111
  })
109
112
  })]
110
113
  })]
@@ -10,7 +10,8 @@ const RenderCard = ({
10
10
  title,
11
11
  content,
12
12
  infoIcon,
13
- classes
13
+ classes,
14
+ translation
14
15
  }) => {
15
16
  return /*#__PURE__*/_jsx(Card, {
16
17
  sx: {
@@ -47,9 +48,9 @@ const RenderCard = ({
47
48
  style: {
48
49
  fontWeight: `500 !important`
49
50
  },
50
- children: title
51
+ children: translation(title)
51
52
  }), /*#__PURE__*/_jsx(Tooltip, {
52
- title: content,
53
+ title: translation(content),
53
54
  children: infoIcon && content && /*#__PURE__*/_jsx("span", {
54
55
  children: infoIcon
55
56
  })
@@ -72,7 +73,8 @@ const CardsMapping = props => {
72
73
  value,
73
74
  data,
74
75
  onChange,
75
- classes
76
+ classes,
77
+ customProps
76
78
  } = props;
77
79
  const {
78
80
  key,
@@ -81,6 +83,9 @@ const CardsMapping = props => {
81
83
  selectedCard,
82
84
  infoIcon
83
85
  } = data;
86
+ const {
87
+ translation
88
+ } = customProps;
84
89
  const activeCard = value === selectedCard;
85
90
  const handleChange = e => {
86
91
  if (selectedCard === data?.value) {
@@ -110,7 +115,8 @@ const CardsMapping = props => {
110
115
  title: label,
111
116
  content: content,
112
117
  infoIcon: infoIcon,
113
- classes: classes
118
+ classes: classes,
119
+ translation: translation
114
120
  })
115
121
  });
116
122
  };