@flozy/editor 9.8.3 → 9.8.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 (166) hide show
  1. package/dist/Editor/ChatEditor.js +14 -7
  2. package/dist/Editor/CommonEditor.js +27 -12
  3. package/dist/Editor/Elements/AI/AIInput.js +5 -3
  4. package/dist/Editor/Elements/AI/CustomSelect.js +9 -5
  5. package/dist/Editor/Elements/AI/PopoverAIInput.js +4 -2
  6. package/dist/Editor/Elements/Accordion/Accordion.js +4 -3
  7. package/dist/Editor/Elements/Accordion/AccordionBtnPopup.js +4 -1
  8. package/dist/Editor/Elements/Accordion/AccordionButton.js +6 -2
  9. package/dist/Editor/Elements/Accordion/AccordionTitlePopup.js +4 -1
  10. package/dist/Editor/Elements/AppHeader/AppHeaderButton.js +6 -2
  11. package/dist/Editor/Elements/AppHeader/AppHeaderPopup.js +4 -1
  12. package/dist/Editor/Elements/Attachments/AttachmentsButton.js +4 -1
  13. package/dist/Editor/Elements/Button/ButtonPopup.js +4 -1
  14. package/dist/Editor/Elements/Button/ButtonToolIcon.js +6 -2
  15. package/dist/Editor/Elements/Button/EditorButton.js +6 -5
  16. package/dist/Editor/Elements/Carousel/Carousel.js +5 -4
  17. package/dist/Editor/Elements/Carousel/CarouselButton.js +6 -2
  18. package/dist/Editor/Elements/Carousel/CarouselItem.js +3 -2
  19. package/dist/Editor/Elements/ChipText/ChipTextPopup.js +4 -1
  20. package/dist/Editor/Elements/CodeToText/CodeToText.js +5 -4
  21. package/dist/Editor/Elements/CodeToText/HtmlContextMenu.js +6 -2
  22. package/dist/Editor/Elements/Colorbox/ColorboxButton.js +6 -2
  23. package/dist/Editor/Elements/DataView/DataView.js +5 -2
  24. package/dist/Editor/Elements/DataView/DataViewButton.js +6 -2
  25. package/dist/Editor/Elements/DataView/Layouts/FilterSort/SortOptions/ChooseSort.js +13 -12
  26. package/dist/Editor/Elements/DataView/Layouts/FilterSort/SortOptions/index.js +7 -4
  27. package/dist/Editor/Elements/DataView/Layouts/FilterSort/index.js +7 -5
  28. package/dist/Editor/Elements/DataView/Layouts/FilterView.js +9 -7
  29. package/dist/Editor/Elements/DataView/Layouts/Options/AddOptions.js +3 -2
  30. package/dist/Editor/Elements/DataView/Layouts/Options/AddProperty.js +5 -3
  31. package/dist/Editor/Elements/DataView/Layouts/Options/AllProperties.js +6 -5
  32. package/dist/Editor/Elements/DataView/Layouts/Options/ChangeProperty.js +5 -3
  33. package/dist/Editor/Elements/DataView/Layouts/Options/EditOption.js +7 -6
  34. package/dist/Editor/Elements/DataView/Layouts/Options/EditProperty.js +15 -12
  35. package/dist/Editor/Elements/DataView/Layouts/Options/FilterProperty.js +3 -2
  36. package/dist/Editor/Elements/DataView/Layouts/Options/PropertyList.js +3 -2
  37. package/dist/Editor/Elements/DataView/Layouts/Options/index.js +12 -6
  38. package/dist/Editor/Elements/DataView/Layouts/TableView.js +6 -4
  39. package/dist/Editor/Elements/DataView/Layouts/index.js +3 -1
  40. package/dist/Editor/Elements/DataView/Providers/DataViewProvider.js +5 -2
  41. package/dist/Editor/Elements/Divider/Divider.js +5 -3
  42. package/dist/Editor/Elements/Divider/DividerButton.js +6 -2
  43. package/dist/Editor/Elements/Divider/DividerPopup.js +3 -2
  44. package/dist/Editor/Elements/Embed/Embed.js +4 -1
  45. package/dist/Editor/Elements/Embed/EmbedPopup.js +4 -1
  46. package/dist/Editor/Elements/Embed/Image.js +14 -9
  47. package/dist/Editor/Elements/Embed/Video.js +10 -7
  48. package/dist/Editor/Elements/EmbedScript/Code.js +7 -4
  49. package/dist/Editor/Elements/EmbedScript/EmbedScript.js +6 -2
  50. package/dist/Editor/Elements/EmbedScript/EmbedScriptPopup.js +8 -5
  51. package/dist/Editor/Elements/Emoji/EmojiButton.js +6 -2
  52. package/dist/Editor/Elements/Form/FieldPopup.js +4 -1
  53. package/dist/Editor/Elements/Form/Form.js +12 -9
  54. package/dist/Editor/Elements/Form/FormButton.js +6 -2
  55. package/dist/Editor/Elements/Form/FormPopup.js +3 -2
  56. package/dist/Editor/Elements/Form/Workflow/FormWorkflow.js +18 -12
  57. package/dist/Editor/Elements/Form/Workflow/ListWorkflow.js +13 -8
  58. package/dist/Editor/Elements/Form/Workflow/MoreOptions.js +3 -2
  59. package/dist/Editor/Elements/Form/Workflow/UserInputs.js +4 -2
  60. package/dist/Editor/Elements/Form/Workflow/index.js +15 -9
  61. package/dist/Editor/Elements/FreeGrid/FreeGrid.js +21 -4
  62. package/dist/Editor/Elements/FreeGrid/FreeGridBox.js +6 -2
  63. package/dist/Editor/Elements/FreeGrid/FreeGridButton.js +6 -2
  64. package/dist/Editor/Elements/FreeGrid/FreeGridItem.js +8 -3
  65. package/dist/Editor/Elements/FreeGrid/Options/AddElement.js +3 -2
  66. package/dist/Editor/Elements/FreeGrid/Options/More.js +4 -3
  67. package/dist/Editor/Elements/Grid/Grid.js +13 -10
  68. package/dist/Editor/Elements/Grid/GridButton.js +9 -5
  69. package/dist/Editor/Elements/Grid/GridItem.js +13 -7
  70. package/dist/Editor/Elements/Grid/GridItemPopup.js +4 -1
  71. package/dist/Editor/Elements/Grid/GridPopup.js +4 -1
  72. package/dist/Editor/Elements/Grid/SectionPopup.js +4 -1
  73. package/dist/Editor/Elements/Link/Link.js +8 -5
  74. package/dist/Editor/Elements/Link/LinkButton.js +4 -1
  75. package/dist/Editor/Elements/List/CheckList.js +14 -9
  76. package/dist/Editor/Elements/NewLine/NewLineButton.js +6 -2
  77. package/dist/Editor/Elements/PageSettings/PageSettingsButton.js +4 -1
  78. package/dist/Editor/Elements/PageSettings/PageSettingsPopup.js +4 -1
  79. package/dist/Editor/Elements/Search/SearchButton.js +6 -3
  80. package/dist/Editor/Elements/Search/SearchList.js +7 -3
  81. package/dist/Editor/Elements/Signature/SignatureButton.js +6 -2
  82. package/dist/Editor/Elements/Signature/SignatureOptions/TypeSignature.js +6 -2
  83. package/dist/Editor/Elements/Signature/SignatureOptions/UploadSignature.js +4 -1
  84. package/dist/Editor/Elements/Signature/SignaturePopup.js +17 -16
  85. package/dist/Editor/Elements/SimpleText/index.js +5 -4
  86. package/dist/Editor/Elements/Table/DragButton.js +4 -2
  87. package/dist/Editor/Elements/Table/Table.js +21 -9
  88. package/dist/Editor/Elements/Table/TablePopup.js +4 -1
  89. package/dist/Editor/Elements/Table/TableSelector.js +10 -6
  90. package/dist/Editor/Elements/Table/TableTool.js +8 -4
  91. package/dist/Editor/Elements/TopBanner/TopBannerButton.js +4 -1
  92. package/dist/Editor/MiniEditor.js +9 -3
  93. package/dist/Editor/Toolbar/Basic/index.js +2 -1
  94. package/dist/Editor/Toolbar/FormatTools/BlockButton.js +6 -2
  95. package/dist/Editor/Toolbar/FormatTools/MarkButton.js +6 -2
  96. package/dist/Editor/Toolbar/Mini/MiniToolbar.js +17 -5
  97. package/dist/Editor/Toolbar/PopupTool/AddTemplates.js +10 -5
  98. package/dist/Editor/Toolbar/PopupTool/ButtonTemplatesCard.js +10 -4
  99. package/dist/Editor/Toolbar/PopupTool/FullViewCard.js +10 -4
  100. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/MiniColorPicker.js +6 -2
  101. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectAlignment.js +42 -35
  102. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectList.js +58 -51
  103. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectSuperSubscript.js +29 -22
  104. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectTypography.js +87 -73
  105. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/index.js +14 -7
  106. package/dist/Editor/Toolbar/PopupTool/PopperHeader.js +8 -4
  107. package/dist/Editor/Toolbar/PopupTool/TemplateCard.js +11 -5
  108. package/dist/Editor/Toolbar/PopupTool/TextFormat.js +29 -21
  109. package/dist/Editor/Toolbar/PopupTool/index.js +17 -1
  110. package/dist/Editor/Toolbar/Toolbar.js +20 -10
  111. package/dist/Editor/common/CustomDialog/index.js +8 -10
  112. package/dist/Editor/common/ImageSelector/ImageSelector.js +10 -8
  113. package/dist/Editor/common/ImageSelector/Options/AddLink.js +6 -4
  114. package/dist/Editor/common/LinkSettings/NavComponents.js +14 -10
  115. package/dist/Editor/common/LinkSettings/index.js +20 -14
  116. package/dist/Editor/common/LinkSettings/navOptions.js +1 -1
  117. package/dist/Editor/common/MentionsPopup/index.js +6 -2
  118. package/dist/Editor/common/RnD/ContextMenu/CMenus.js +22 -22
  119. package/dist/Editor/common/RnD/ContextMenu/index.js +3 -2
  120. package/dist/Editor/common/RnD/ElementOptions/index.js +7 -2
  121. package/dist/Editor/common/RnD/ElementSettings/OtherSettings/SaveAsTemplate.js +8 -3
  122. package/dist/Editor/common/RnD/ElementSettings/OtherSettings/Settings.js +5 -2
  123. package/dist/Editor/common/RnD/ElementSettings/Settings/FormSettings.js +3 -2
  124. package/dist/Editor/common/RnD/ElementSettings/Settings/TextSettings.js +4 -2
  125. package/dist/Editor/common/RnD/OptionsPopup/index.js +4 -3
  126. package/dist/Editor/common/RnD/SwitchViewport/SwitchViewport.js +4 -3
  127. package/dist/Editor/common/RnD/index.js +11 -4
  128. package/dist/Editor/common/Section/index.js +7 -4
  129. package/dist/Editor/common/Shorthands/elements.js +18 -3
  130. package/dist/Editor/common/StyleBuilder/appHeaderStyle.js +4 -4
  131. package/dist/Editor/common/StyleBuilder/boxStyle.js +2 -2
  132. package/dist/Editor/common/StyleBuilder/buttonStyle.js +2 -2
  133. package/dist/Editor/common/StyleBuilder/dividerStyles.js +2 -2
  134. package/dist/Editor/common/StyleBuilder/embedVideoStyle.js +6 -6
  135. package/dist/Editor/common/StyleBuilder/fieldStyle.js +2 -2
  136. package/dist/Editor/common/StyleBuilder/fieldTypes/alignment.js +13 -9
  137. package/dist/Editor/common/StyleBuilder/fieldTypes/backgroundImage.js +6 -3
  138. package/dist/Editor/common/StyleBuilder/fieldTypes/bannerSpacing.js +7 -3
  139. package/dist/Editor/common/StyleBuilder/fieldTypes/borderRadius.js +7 -3
  140. package/dist/Editor/common/StyleBuilder/fieldTypes/buttonLink.js +6 -3
  141. package/dist/Editor/common/StyleBuilder/fieldTypes/card.js +11 -5
  142. package/dist/Editor/common/StyleBuilder/fieldTypes/color.js +9 -5
  143. package/dist/Editor/common/StyleBuilder/fieldTypes/elementSize.js +10 -6
  144. package/dist/Editor/common/StyleBuilder/fieldTypes/fontSize.js +6 -2
  145. package/dist/Editor/common/StyleBuilder/fieldTypes/gridSize.js +6 -2
  146. package/dist/Editor/common/StyleBuilder/fieldTypes/icons.js +5 -2
  147. package/dist/Editor/common/StyleBuilder/fieldTypes/menusArray.js +9 -6
  148. package/dist/Editor/common/StyleBuilder/fieldTypes/metaDataMapping.js +8 -2
  149. package/dist/Editor/common/StyleBuilder/fieldTypes/saveAsTemplate.js +12 -11
  150. package/dist/Editor/common/StyleBuilder/fieldTypes/selectBox.js +6 -2
  151. package/dist/Editor/common/StyleBuilder/fieldTypes/text.js +8 -4
  152. package/dist/Editor/common/StyleBuilder/fieldTypes/textAlign.js +6 -2
  153. package/dist/Editor/common/StyleBuilder/fieldTypes/textOptions.js +6 -5
  154. package/dist/Editor/common/StyleBuilder/formStyle.js +7 -7
  155. package/dist/Editor/common/StyleBuilder/gridItemStyle.js +6 -6
  156. package/dist/Editor/common/StyleBuilder/gridStyle.js +5 -5
  157. package/dist/Editor/common/StyleBuilder/index.js +8 -5
  158. package/dist/Editor/common/Uploader.js +8 -5
  159. package/dist/Editor/helper/index.js +27 -3
  160. package/dist/Editor/plugins/withLayout.js +3 -2
  161. package/dist/Editor/plugins/withLinks.js +10 -0
  162. package/dist/Editor/utils/SlateUtilityFunctions.js +15 -9
  163. package/dist/Editor/utils/brains.js +1 -2
  164. package/dist/Editor/utils/freegrid.js +1 -1
  165. package/dist/Editor/utils/helper.js +2 -2
  166. package/package.json +1 -1
@@ -8,12 +8,13 @@ import { jsx as _jsx } from "react/jsx-runtime";
8
8
  import { jsxs as _jsxs } from "react/jsx-runtime";
9
9
  function Label({
10
10
  label,
11
- type
11
+ type,
12
+ translation
12
13
  }) {
13
14
  return /*#__PURE__*/_jsxs("span", {
14
15
  children: [/*#__PURE__*/_jsx("strong", {
15
16
  children: label
16
- }), " ", type]
17
+ }), " ", translation(type)]
17
18
  });
18
19
  }
19
20
  function DisplayHeaderLabel({
@@ -25,85 +26,98 @@ function DisplayHeaderLabel({
25
26
  })]
26
27
  });
27
28
  }
28
- const typographyOptions = [{
29
- id: 11,
30
- format: "headingOne",
31
- type: "block",
32
- title: /*#__PURE__*/_jsx(Label, {
33
- label: "H1",
34
- type: "Header"
35
- }),
36
- label: /*#__PURE__*/_jsx(DisplayHeaderLabel, {
37
- type: 1
38
- }),
39
- group: "typography",
40
- value: "headingOne"
41
- }, {
42
- id: 12,
43
- format: "headingTwo",
44
- type: "block",
45
- title: /*#__PURE__*/_jsx(Label, {
46
- label: "H2",
47
- type: "Header"
48
- }),
49
- label: /*#__PURE__*/_jsx(DisplayHeaderLabel, {
50
- type: 2
51
- }),
52
- group: "typography",
53
- value: "headingTwo"
54
- }, {
55
- id: 13,
56
- format: "headingThree",
57
- type: "block",
58
- title: /*#__PURE__*/_jsx(Label, {
59
- label: "H3",
60
- type: "Header"
61
- }),
62
- label: /*#__PURE__*/_jsx(DisplayHeaderLabel, {
63
- type: 3
64
- }),
65
- group: "typography",
66
- value: "headingThree"
67
- }, {
68
- id: 14,
69
- format: "fontSize",
70
- type: "mark",
71
- title: /*#__PURE__*/_jsx(Label, {
29
+ function getTypographyOptions(translation) {
30
+ return [{
31
+ id: 11,
32
+ format: "headingOne",
33
+ type: "block",
34
+ title: /*#__PURE__*/_jsx(Label, {
35
+ label: "H1",
36
+ type: "Header",
37
+ translation: translation
38
+ }),
39
+ label: /*#__PURE__*/_jsx(DisplayHeaderLabel, {
40
+ type: 1
41
+ }),
42
+ group: "typography",
43
+ value: "headingOne"
44
+ }, {
45
+ id: 12,
46
+ format: "headingTwo",
47
+ type: "block",
48
+ title: /*#__PURE__*/_jsx(Label, {
49
+ label: "H2",
50
+ type: "Header",
51
+ translation: translation
52
+ }),
53
+ label: /*#__PURE__*/_jsx(DisplayHeaderLabel, {
54
+ type: 2
55
+ }),
56
+ group: "typography",
57
+ value: "headingTwo"
58
+ }, {
59
+ id: 13,
60
+ format: "headingThree",
61
+ type: "block",
62
+ title: /*#__PURE__*/_jsx(Label, {
63
+ label: "H3",
64
+ type: "Header",
65
+ translation: translation
66
+ }),
67
+ label: /*#__PURE__*/_jsx(DisplayHeaderLabel, {
68
+ type: 3
69
+ }),
70
+ group: "typography",
71
+ value: "headingThree"
72
+ }, {
73
+ id: 14,
74
+ format: "fontSize",
75
+ type: "mark",
76
+ title: /*#__PURE__*/_jsx(Label, {
77
+ label: "L",
78
+ type: "Large",
79
+ translation: translation
80
+ }),
72
81
  label: "L",
73
- type: "Large"
74
- }),
75
- label: "L",
76
- group: "typography",
77
- value: "huge"
78
- }, {
79
- id: 15,
80
- format: "fontSize",
81
- type: "mark",
82
- title: /*#__PURE__*/_jsx(Label, {
82
+ group: "typography",
83
+ value: "huge"
84
+ }, {
85
+ id: 15,
86
+ format: "fontSize",
87
+ type: "mark",
88
+ title: /*#__PURE__*/_jsx(Label, {
89
+ label: "M",
90
+ type: "Medium",
91
+ translation: translation
92
+ }),
83
93
  label: "M",
84
- type: "Medium"
85
- }),
86
- label: "M",
87
- group: "typography",
88
- value: "medium"
89
- }, {
90
- id: 16,
91
- format: "fontSize",
92
- type: "mark",
93
- title: /*#__PURE__*/_jsx(Label, {
94
+ group: "typography",
95
+ value: "medium"
96
+ }, {
97
+ id: 16,
98
+ format: "fontSize",
99
+ type: "mark",
100
+ title: /*#__PURE__*/_jsx(Label, {
101
+ label: "S",
102
+ type: "Small",
103
+ translation: translation
104
+ }),
94
105
  label: "S",
95
- type: "Small"
96
- }),
97
- label: "S",
98
- group: "typography",
99
- value: "small"
100
- }];
106
+ group: "typography",
107
+ value: "small"
108
+ }];
109
+ }
101
110
  function SelectTypography({
102
111
  editor,
103
112
  classes,
104
- closeMainPopup
113
+ closeMainPopup,
114
+ customProps
105
115
  }) {
106
116
  const [size] = useWindowResize();
117
+ const {
118
+ translation
119
+ } = customProps;
120
+ const typographyOptions = getTypographyOptions(translation);
107
121
  const updateMarkData = newVal => {
108
122
  const val = activeMark(editor, "fontSize");
109
123
  let upData = {
@@ -56,20 +56,23 @@ const MiniTextFormat = props => {
56
56
  }), /*#__PURE__*/_jsx(SelectTypography, {
57
57
  classes: classes,
58
58
  editor: editor,
59
- closeMainPopup: closeMainPopup
59
+ closeMainPopup: closeMainPopup,
60
+ customProps: customProps
60
61
  }), /*#__PURE__*/_jsx("div", {
61
62
  className: "verticalLine"
62
63
  }), /*#__PURE__*/_jsx(SelectList, {
63
64
  classes: classes,
64
65
  editor: editor,
65
- closeMainPopup: closeMainPopup
66
+ closeMainPopup: closeMainPopup,
67
+ customProps: customProps
66
68
  }), /*#__PURE__*/_jsx("div", {
67
69
  className: "verticalLine mr-1"
68
70
  }), /*#__PURE__*/_jsx(SelectAlignment, {
69
71
  fontAlign: fontAlign,
70
72
  classes: classes,
71
73
  editor: editor,
72
- closeMainPopup: closeMainPopup
74
+ closeMainPopup: closeMainPopup,
75
+ customProps: customProps
73
76
  }), /*#__PURE__*/_jsx("div", {
74
77
  className: "verticalLine mr-1"
75
78
  }), /*#__PURE__*/_jsx(SelectFontSize, {
@@ -80,20 +83,23 @@ const MiniTextFormat = props => {
80
83
  }), fontStyle?.map((m, i) => {
81
84
  return /*#__PURE__*/_jsx(MarkButton, {
82
85
  editor: editor,
83
- ...m
86
+ ...m,
87
+ customProps: customProps
84
88
  }, `pptool_mark_${i}_${m.id}`);
85
89
  }), /*#__PURE__*/_jsx(MiniColorPicker, {
86
90
  format: textColorFormat,
87
91
  classes: classes,
88
92
  activeColor: activeColor,
89
93
  id: "11_cc",
90
- editor: editor
94
+ editor: editor,
95
+ customProps: customProps
91
96
  }), /*#__PURE__*/_jsx(MiniColorPicker, {
92
97
  format: textBgFormat,
93
98
  classes: classes,
94
99
  activeColor: activeBg,
95
100
  id: "12_cc",
96
- editor: editor
101
+ editor: editor,
102
+ customProps: customProps
97
103
  }), /*#__PURE__*/_jsx("div", {
98
104
  className: "verticalLine ml-1 mr-1"
99
105
  }), /*#__PURE__*/_jsx(LinkButton, {
@@ -126,7 +132,8 @@ const MiniTextFormat = props => {
126
132
  children: [/*#__PURE__*/_jsx(PopperHeader, {
127
133
  title: "Text Settings",
128
134
  classes: classes,
129
- onClose: () => setAnchorEl(null)
135
+ onClose: () => setAnchorEl(null),
136
+ customProps: customProps
130
137
  }), /*#__PURE__*/_jsx(TextFormat, {
131
138
  editor: editor,
132
139
  classes: classes,
@@ -35,9 +35,13 @@ const PopperHeader = props => {
35
35
  fullScreen,
36
36
  toggleFullscreen,
37
37
  search,
38
- onSearch
38
+ onSearch,
39
+ customProps
39
40
  } = props;
40
41
  const [openSearch, setOpenSearch] = useState(false);
42
+ const {
43
+ translation
44
+ } = customProps;
41
45
  const handleSearchButton = () => {
42
46
  setOpenSearch(!openSearch);
43
47
  };
@@ -61,7 +65,7 @@ const PopperHeader = props => {
61
65
  fontWeight: "700",
62
66
  color: "#000"
63
67
  },
64
- children: title
68
+ children: translation(title)
65
69
  }), /*#__PURE__*/_jsxs(Grid, {
66
70
  sx: classes.textFormatLabel,
67
71
  justifyContent: "end",
@@ -82,7 +86,7 @@ const PopperHeader = props => {
82
86
  handleChange: onSearch
83
87
  })]
84
88
  }) : null, needFullscreen ? /*#__PURE__*/_jsx(Tooltip, {
85
- title: "Toggle Fullscreen",
89
+ title: translation("toggleFullScreen"),
86
90
  arrow: true,
87
91
  children: /*#__PURE__*/_jsx(IconButton, {
88
92
  style: {
@@ -94,7 +98,7 @@ const PopperHeader = props => {
94
98
  children: fullScreen ? /*#__PURE__*/_jsx(CloseFullscreenIcon, {}) : /*#__PURE__*/_jsx(ToggleFullScreenIcon, {})
95
99
  })
96
100
  }) : null, /*#__PURE__*/_jsx(Tooltip, {
97
- title: "Close",
101
+ title: translation("Close"),
98
102
  arrow: true,
99
103
  children: /*#__PURE__*/_jsx(IconButton, {
100
104
  sx: classes.closeBtn,
@@ -6,7 +6,8 @@ const PreviewAndSelect = props => {
6
6
  const {
7
7
  classes,
8
8
  data,
9
- onSelectTemplate
9
+ onSelectTemplate,
10
+ translation
10
11
  } = props;
11
12
  return /*#__PURE__*/_jsxs(Box, {
12
13
  className: "template-card-action",
@@ -15,12 +16,12 @@ const PreviewAndSelect = props => {
15
16
  children: [/*#__PURE__*/_jsx(Button, {
16
17
  className: "blueBtn",
17
18
  onClick: onSelectTemplate(data),
18
- children: "Select"
19
+ children: translation("Select")
19
20
  }), /*#__PURE__*/_jsx(Button, {
20
21
  href: data?.previewLink,
21
22
  target: "_blank",
22
23
  className: "outlineBtn",
23
- children: "Preview"
24
+ children: translation("Preview")
24
25
  })]
25
26
  });
26
27
  };
@@ -29,8 +30,12 @@ const TemplateCard = props => {
29
30
  classes,
30
31
  m,
31
32
  onSelectTemplate,
32
- fullScreen
33
+ fullScreen,
34
+ customProps
33
35
  } = props;
36
+ const {
37
+ translation
38
+ } = customProps;
34
39
  return /*#__PURE__*/_jsx(Grid, {
35
40
  item: true,
36
41
  xs: 4,
@@ -53,7 +58,8 @@ const TemplateCard = props => {
53
58
  }), /*#__PURE__*/_jsx(PreviewAndSelect, {
54
59
  classes: classes,
55
60
  onSelectTemplate: onSelectTemplate,
56
- data: m
61
+ data: m,
62
+ translation: translation
57
63
  })]
58
64
  }), /*#__PURE__*/_jsx(CardContent, {
59
65
  sx: classes.templateCardTitle,
@@ -33,6 +33,9 @@ const TextFormat = props => {
33
33
  const [anchorEl, setAnchorEl] = useState(null);
34
34
  const [type, setType] = useState(null);
35
35
  const open = Boolean(anchorEl);
36
+ const {
37
+ translation
38
+ } = customProps;
36
39
  const {
37
40
  element: pageSt
38
41
  } = getPageSettings(editor) || {};
@@ -129,7 +132,7 @@ const TextFormat = props => {
129
132
  variant: "body1",
130
133
  color: "primary",
131
134
  sx: classes.typoLabel,
132
- children: "Font Family"
135
+ children: translation("fontFamily")
133
136
  })
134
137
  }), /*#__PURE__*/_jsx(Grid, {
135
138
  item: true,
@@ -141,7 +144,7 @@ const TextFormat = props => {
141
144
  val: Object.values(fontFamilyMap)[0]
142
145
  }),
143
146
  className: "npr-0",
144
- children: "Default Text"
147
+ children: translation("defaultText")
145
148
  })
146
149
  })]
147
150
  }), /*#__PURE__*/_jsx(Grid, {
@@ -166,7 +169,7 @@ const TextFormat = props => {
166
169
  variant: "body1",
167
170
  color: "primary",
168
171
  sx: classes.typoLabel3,
169
- children: "Font Weight"
172
+ children: translation("fontWeight")
170
173
  }), /*#__PURE__*/_jsx(Grid, {
171
174
  item: true,
172
175
  xs: 12,
@@ -187,7 +190,7 @@ const TextFormat = props => {
187
190
  variant: "body1",
188
191
  color: "primary",
189
192
  sx: classes.typoLabel3,
190
- children: "Font Size"
193
+ children: translation("fontSize")
191
194
  }), /*#__PURE__*/_jsx(Grid, {
192
195
  item: true,
193
196
  xs: 12,
@@ -220,7 +223,7 @@ const TextFormat = props => {
220
223
  variant: "body1",
221
224
  color: "primary",
222
225
  sx: classes.typoLabel,
223
- children: "Text Color"
226
+ children: translation("textColor")
224
227
  })
225
228
  }), /*#__PURE__*/_jsx(Grid, {
226
229
  item: true,
@@ -230,7 +233,7 @@ const TextFormat = props => {
230
233
  onClick: handleDefault({
231
234
  format: "color"
232
235
  }),
233
- children: "Default Color"
236
+ children: translation("defaultColor")
234
237
  })
235
238
  })]
236
239
  }), /*#__PURE__*/_jsx(Grid, {
@@ -241,7 +244,7 @@ const TextFormat = props => {
241
244
  editor: editor,
242
245
  showHex: false,
243
246
  rounded: true,
244
- title: "Text Color",
247
+ title: translation("textColor"),
245
248
  id: "11_cc",
246
249
  classes: classes
247
250
  }, "11_cc")
@@ -260,7 +263,7 @@ const TextFormat = props => {
260
263
  variant: "body1",
261
264
  color: "primary",
262
265
  sx: classes.typoLabel,
263
- children: "Background Color"
266
+ children: translation("backgroundColor")
264
267
  })
265
268
  }), /*#__PURE__*/_jsx(Grid, {
266
269
  item: true,
@@ -274,7 +277,7 @@ const TextFormat = props => {
274
277
  onClick: handleDefault({
275
278
  format: "bgColor"
276
279
  }),
277
- children: "Default Color"
280
+ children: translation("defaultColor")
278
281
  })
279
282
  })
280
283
  })]
@@ -288,7 +291,7 @@ const TextFormat = props => {
288
291
  editor: editor,
289
292
  showHex: false,
290
293
  rounded: true,
291
- title: "Text Background Color",
294
+ title: translation("textBgColor"),
292
295
  classes: classes,
293
296
  id: "12_cc"
294
297
  }, "12_cc")
@@ -306,7 +309,7 @@ const TextFormat = props => {
306
309
  variant: "body1",
307
310
  color: "primary",
308
311
  sx: classes.typoLabel2,
309
- children: "Alignment"
312
+ children: translation("Alignment")
310
313
  }), /*#__PURE__*/_jsx(Grid, {
311
314
  item: true,
312
315
  xs: 12,
@@ -314,7 +317,8 @@ const TextFormat = props => {
314
317
  children: fontAlign?.map((m, i) => {
315
318
  return /*#__PURE__*/_jsx(BlockButton, {
316
319
  editor: editor,
317
- ...m
320
+ ...m,
321
+ customProps: customProps
318
322
  }, `pptool_block_${i}_${m.id}`);
319
323
  })
320
324
  })]
@@ -326,7 +330,7 @@ const TextFormat = props => {
326
330
  variant: "body1",
327
331
  color: "primary",
328
332
  sx: classes.typoLabel2,
329
- children: "Lists"
333
+ children: translation("Lists")
330
334
  }), /*#__PURE__*/_jsx(Grid, {
331
335
  item: true,
332
336
  xs: 12,
@@ -335,7 +339,8 @@ const TextFormat = props => {
335
339
  const Comp = ButtonComp[m?.component] || BlockButton;
336
340
  return /*#__PURE__*/_jsx(Comp, {
337
341
  editor: editor,
338
- ...m
342
+ ...m,
343
+ customProps: customProps
339
344
  }, `pptool_block_${i}_${m.id}`);
340
345
  })
341
346
  })]
@@ -351,7 +356,7 @@ const TextFormat = props => {
351
356
  variant: "body1",
352
357
  color: "primary",
353
358
  sx: classes.typoLabel,
354
- children: "Typography"
359
+ children: translation("Typography")
355
360
  }), /*#__PURE__*/_jsxs(Grid, {
356
361
  item: true,
357
362
  xs: 12,
@@ -360,11 +365,13 @@ const TextFormat = props => {
360
365
  children: [/*#__PURE__*/_jsx(SelectTypography, {
361
366
  classes: classes,
362
367
  editor: editor,
363
- closeMainPopup: closeMainPopup || onClose
368
+ closeMainPopup: closeMainPopup || onClose,
369
+ customProps: customProps
364
370
  }), fontStyle?.map((m, i) => {
365
371
  return /*#__PURE__*/_jsx(MarkButton, {
366
372
  editor: editor,
367
- ...m
373
+ ...m,
374
+ customProps: customProps
368
375
  }, `pptool_mark_${i}_${m.id}`);
369
376
  }), /*#__PURE__*/_jsx(LinkButton, {
370
377
  active: isBlockActive(editor, link.format),
@@ -373,7 +380,8 @@ const TextFormat = props => {
373
380
  }, link.id), /*#__PURE__*/_jsx(SelectSuperSubscript, {
374
381
  classes: classes,
375
382
  editor: editor,
376
- closeMainPopup: closeMainPopup || onClose
383
+ closeMainPopup: closeMainPopup || onClose,
384
+ customProps: customProps
377
385
  })]
378
386
  })]
379
387
  }), /*#__PURE__*/_jsx(Grid, {
@@ -392,7 +400,7 @@ const TextFormat = props => {
392
400
  variant: "body1",
393
401
  color: "primary",
394
402
  sx: classes.typoLabel3,
395
- children: "Decorations"
403
+ children: translation("Decorations")
396
404
  })
397
405
  }), /*#__PURE__*/_jsxs(Grid, {
398
406
  item: true,
@@ -412,7 +420,7 @@ const TextFormat = props => {
412
420
  style: {
413
421
  background: bqBgColor
414
422
  },
415
- children: "Colorbox"
423
+ children: translation("Colorbox")
416
424
  }), /*#__PURE__*/_jsx("div", {
417
425
  className: "vl"
418
426
  }), /*#__PURE__*/_jsx(Button, {
@@ -433,7 +441,7 @@ const TextFormat = props => {
433
441
  ...getBorderColor(bqColor || "transparent", 3),
434
442
  borderWidth: bqColor ? "0px 0px 0px 3px" : "0px"
435
443
  },
436
- children: "Quote"
444
+ children: translation("Quote")
437
445
  })
438
446
  }), /*#__PURE__*/_jsx("div", {
439
447
  className: "vl"
@@ -11,6 +11,9 @@ import useEditorScroll from "../../hooks/useEditorScroll";
11
11
  import { isCarouselSelected } from "../../helper";
12
12
  import { hideSlateSelection } from "../../utils/helper";
13
13
  import { jsx as _jsx } from "react/jsx-runtime";
14
+ const isSlateDOM = event => {
15
+ return event.target.getAttribute("data-slate-string") === "true";
16
+ };
14
17
  const PopupTool = props => {
15
18
  const {
16
19
  theme,
@@ -33,6 +36,7 @@ const PopupTool = props => {
33
36
  const [event] = useDrag(anchorEl);
34
37
  const id = open ? "popup-edit-tool" : "";
35
38
  const [size] = useWindowResize();
39
+ const isMobile = window.matchMedia("(max-width: 899px)")?.matches || false;
36
40
  const updateAnchorEl = isScroll => {
37
41
  try {
38
42
  const isHavingSelection = selection && !Range.isCollapsed(selection);
@@ -104,8 +108,20 @@ const PopupTool = props => {
104
108
  return open && !openAI ? /*#__PURE__*/_jsx(ClickAwayListener, {
105
109
  onClickAway: e => {
106
110
  // close the mini toolbar, if user clicks outside the editor (in Flozy app.)
107
- if (e.target !== document.body) {
111
+
112
+ if (isSlateDOM(e)) {
113
+ return;
114
+ }
115
+ const wrapper = document.getElementById("slate-wrapper-scroll-container");
116
+ const isInsideWrapper = wrapper && wrapper.contains(e.target);
117
+ if (isInsideWrapper) {
118
+ return;
119
+ }
120
+ if (e.target === document.body) {
108
121
  // e.target returns body, if the user clicks material ui select popup inside the tool bar, on that time, we don't need to close
122
+ return;
123
+ }
124
+ if (!isMobile) {
109
125
  handleClose();
110
126
  }
111
127
  },
@@ -50,7 +50,8 @@ export const RenderToolbarIcon = props => {
50
50
  case "block":
51
51
  return /*#__PURE__*/_jsx(BlockButton, {
52
52
  ...element,
53
- editor: editor
53
+ editor: editor,
54
+ customProps: customProps
54
55
  }, element.id);
55
56
  case "mark":
56
57
  return /*#__PURE__*/_jsx(MarkButton, {
@@ -105,7 +106,8 @@ export const RenderToolbarIcon = props => {
105
106
  editor: editor,
106
107
  customProps: customProps,
107
108
  icoBtnType: icoBtnType,
108
- lbT: element.lbT
109
+ lbT: element.lbT,
110
+ onClose: () => {}
109
111
  }, element.id);
110
112
  case "color-picker":
111
113
  return /*#__PURE__*/_jsx(ColorPicker, {
@@ -117,12 +119,14 @@ export const RenderToolbarIcon = props => {
117
119
  case "table":
118
120
  return /*#__PURE__*/_jsx(TableSelector, {
119
121
  editor: editor,
120
- icoBtnType: icoBtnType
122
+ icoBtnType: icoBtnType,
123
+ customProps: customProps
121
124
  }, element.id);
122
125
  case "dataView":
123
126
  return /*#__PURE__*/_jsx(DataViewButton, {
124
127
  editor: editor,
125
- icoBtnType: icoBtnType
128
+ icoBtnType: icoBtnType,
129
+ customProps: customProps
126
130
  }, element.id);
127
131
  case "id":
128
132
  return /*#__PURE__*/_jsx(Id, {
@@ -151,21 +155,25 @@ export const RenderToolbarIcon = props => {
151
155
  case "newLine":
152
156
  return /*#__PURE__*/_jsx(NewLineButton, {
153
157
  editor: editor,
154
- icoBtnType: icoBtnType
158
+ icoBtnType: icoBtnType,
159
+ customProps: customProps
155
160
  }, element.id);
156
161
  case "accordion":
157
162
  return /*#__PURE__*/_jsx(AccordionButton, {
158
- editor: editor
163
+ editor: editor,
164
+ customProps: customProps
159
165
  }, element.id);
160
166
  case "signature":
161
167
  return /*#__PURE__*/_jsx(SignatureButton, {
162
168
  editor: editor,
163
- icoBtnType: icoBtnType
169
+ icoBtnType: icoBtnType,
170
+ customProps: customProps
164
171
  }, element.id);
165
172
  case "button":
166
173
  return /*#__PURE__*/_jsx(ButtonToolIcon, {
167
174
  editor: editor,
168
- icoBtnType: icoBtnType
175
+ icoBtnType: icoBtnType,
176
+ customProps: customProps
169
177
  }, element.id);
170
178
  case "page-settings":
171
179
  return /*#__PURE__*/_jsx(PageSettingsButton, {
@@ -176,7 +184,8 @@ export const RenderToolbarIcon = props => {
176
184
  case "carousel":
177
185
  return /*#__PURE__*/_jsx(CarouselButton, {
178
186
  editor: editor,
179
- icoBtnType: icoBtnType
187
+ icoBtnType: icoBtnType,
188
+ customProps: customProps
180
189
  }, element.id);
181
190
  case "chip-text":
182
191
  return /*#__PURE__*/_jsx(ChipTextButton, {
@@ -284,7 +293,8 @@ const Toolbar = props => {
284
293
  })
285
294
  }, index)), /*#__PURE__*/_jsx(HtmlContextMenu, {
286
295
  editor: editor,
287
- handleCodeToText: handleCodeToText
296
+ handleCodeToText: handleCodeToText,
297
+ customProps: customProps
288
298
  })]
289
299
  });
290
300
  };