@flozy/editor 9.8.3 → 9.8.4

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 (257) hide show
  1. package/dist/Editor/ChatEditor.js +26 -19
  2. package/dist/Editor/CommonEditor.js +141 -26
  3. package/dist/Editor/DialogWrapper.js +31 -25
  4. package/dist/Editor/Editor.css +11 -7
  5. package/dist/Editor/Elements/AI/AIInput.js +5 -3
  6. package/dist/Editor/Elements/AI/CustomSelect.js +9 -5
  7. package/dist/Editor/Elements/AI/PopoverAIInput.js +15 -5
  8. package/dist/Editor/Elements/Accordion/Accordion.js +4 -3
  9. package/dist/Editor/Elements/Accordion/AccordionBtnPopup.js +4 -1
  10. package/dist/Editor/Elements/Accordion/AccordionButton.js +6 -2
  11. package/dist/Editor/Elements/Accordion/AccordionTitlePopup.js +4 -1
  12. package/dist/Editor/Elements/AppHeader/AppHeader.js +3 -3
  13. package/dist/Editor/Elements/AppHeader/AppHeaderButton.js +6 -2
  14. package/dist/Editor/Elements/AppHeader/AppHeaderPopup.js +4 -1
  15. package/dist/Editor/Elements/Attachments/AttachmentsButton.js +4 -1
  16. package/dist/Editor/Elements/Button/ButtonPopup.js +4 -1
  17. package/dist/Editor/Elements/Button/ButtonToolIcon.js +6 -2
  18. package/dist/Editor/Elements/Button/EditorButton.js +43 -30
  19. package/dist/Editor/Elements/Carousel/Carousel.js +5 -4
  20. package/dist/Editor/Elements/Carousel/CarouselButton.js +6 -2
  21. package/dist/Editor/Elements/Carousel/CarouselItem.js +3 -2
  22. package/dist/Editor/Elements/ChipText/ChipTextPopup.js +4 -1
  23. package/dist/Editor/Elements/CodeToText/CodeToText.js +5 -4
  24. package/dist/Editor/Elements/CodeToText/HtmlContextMenu.js +6 -2
  25. package/dist/Editor/Elements/Color Picker/ColorButtons.js +60 -14
  26. package/dist/Editor/Elements/Color Picker/ColorPicker.css +25 -1
  27. package/dist/Editor/Elements/Color Picker/ColorPicker.js +10 -7
  28. package/dist/Editor/Elements/Color Picker/Styles.js +15 -13
  29. package/dist/Editor/Elements/Colorbox/ColorboxButton.js +6 -2
  30. package/dist/Editor/Elements/DataView/DataView.js +5 -2
  31. package/dist/Editor/Elements/DataView/DataViewButton.js +6 -2
  32. package/dist/Editor/Elements/DataView/Layouts/ColumnView.js +4 -2
  33. package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/MultiSelect.js +448 -0
  34. package/dist/Editor/Elements/DataView/Layouts/DataTypes/MultiSelectType.js +21 -6
  35. package/dist/Editor/Elements/DataView/Layouts/FilterSort/SortOptions/ChooseSort.js +13 -12
  36. package/dist/Editor/Elements/DataView/Layouts/FilterSort/SortOptions/index.js +7 -4
  37. package/dist/Editor/Elements/DataView/Layouts/FilterSort/index.js +7 -5
  38. package/dist/Editor/Elements/DataView/Layouts/FilterView.js +9 -7
  39. package/dist/Editor/Elements/DataView/Layouts/Options/AddOptions.js +8 -3
  40. package/dist/Editor/Elements/DataView/Layouts/Options/AddProperty.js +5 -3
  41. package/dist/Editor/Elements/DataView/Layouts/Options/AllProperties.js +6 -5
  42. package/dist/Editor/Elements/DataView/Layouts/Options/ChangeProperty.js +5 -3
  43. package/dist/Editor/Elements/DataView/Layouts/Options/EditOption.js +9 -7
  44. package/dist/Editor/Elements/DataView/Layouts/Options/EditProperty.js +15 -12
  45. package/dist/Editor/Elements/DataView/Layouts/Options/FilterProperty.js +3 -2
  46. package/dist/Editor/Elements/DataView/Layouts/Options/PropertyList.js +3 -2
  47. package/dist/Editor/Elements/DataView/Layouts/Options/index.js +23 -6
  48. package/dist/Editor/Elements/DataView/Layouts/TableView.js +6 -4
  49. package/dist/Editor/Elements/DataView/Layouts/ViewData.js +8 -4
  50. package/dist/Editor/Elements/DataView/Layouts/index.js +3 -1
  51. package/dist/Editor/Elements/DataView/Providers/DataViewProvider.js +5 -2
  52. package/dist/Editor/Elements/Divider/Divider.js +5 -3
  53. package/dist/Editor/Elements/Divider/DividerButton.js +6 -2
  54. package/dist/Editor/Elements/Divider/DividerPopup.js +3 -2
  55. package/dist/Editor/Elements/Embed/Embed.js +4 -1
  56. package/dist/Editor/Elements/Embed/EmbedPopup.js +4 -1
  57. package/dist/Editor/Elements/Embed/Image.js +16 -11
  58. package/dist/Editor/Elements/Embed/Video.js +10 -7
  59. package/dist/Editor/Elements/EmbedScript/Code.js +7 -4
  60. package/dist/Editor/Elements/EmbedScript/EmbedScript.js +6 -2
  61. package/dist/Editor/Elements/EmbedScript/EmbedScriptPopup.js +8 -5
  62. package/dist/Editor/Elements/Emoji/EmojiButton.js +6 -2
  63. package/dist/Editor/Elements/Form/FieldPopup.js +4 -1
  64. package/dist/Editor/Elements/Form/Form.js +12 -9
  65. package/dist/Editor/Elements/Form/FormButton.js +6 -2
  66. package/dist/Editor/Elements/Form/FormPopup.js +3 -2
  67. package/dist/Editor/Elements/Form/Workflow/FormWorkflow.js +18 -12
  68. package/dist/Editor/Elements/Form/Workflow/ListWorkflow.js +13 -8
  69. package/dist/Editor/Elements/Form/Workflow/MoreOptions.js +3 -2
  70. package/dist/Editor/Elements/Form/Workflow/Styles.js +24 -22
  71. package/dist/Editor/Elements/Form/Workflow/UserInputs.js +4 -2
  72. package/dist/Editor/Elements/Form/Workflow/index.js +15 -9
  73. package/dist/Editor/Elements/FreeGrid/FreeGrid.js +67 -23
  74. package/dist/Editor/Elements/FreeGrid/FreeGridBox.js +31 -6
  75. package/dist/Editor/Elements/FreeGrid/FreeGridButton.js +6 -2
  76. package/dist/Editor/Elements/FreeGrid/FreeGridItem.js +54 -6
  77. package/dist/Editor/Elements/FreeGrid/Options/AddElement.js +3 -2
  78. package/dist/Editor/Elements/FreeGrid/Options/More.js +10 -4
  79. package/dist/Editor/Elements/FreeGrid/styles.js +3 -0
  80. package/dist/Editor/Elements/Grid/Grid.js +13 -10
  81. package/dist/Editor/Elements/Grid/GridButton.js +9 -5
  82. package/dist/Editor/Elements/Grid/GridItem.js +14 -8
  83. package/dist/Editor/Elements/Grid/GridItemPopup.js +4 -1
  84. package/dist/Editor/Elements/Grid/GridPopup.js +4 -1
  85. package/dist/Editor/Elements/Grid/SectionPopup.js +4 -1
  86. package/dist/Editor/Elements/Link/Link.js +8 -5
  87. package/dist/Editor/Elements/Link/LinkButton.js +4 -1
  88. package/dist/Editor/Elements/List/CheckList.js +18 -10
  89. package/dist/Editor/Elements/NewLine/NewLineButton.js +6 -2
  90. package/dist/Editor/Elements/PageSettings/PageSettingsButton.js +4 -1
  91. package/dist/Editor/Elements/PageSettings/PageSettingsPopup.js +4 -1
  92. package/dist/Editor/Elements/Search/SearchButton.js +7 -4
  93. package/dist/Editor/Elements/Search/SearchList.js +10 -5
  94. package/dist/Editor/Elements/Signature/SignatureButton.js +6 -2
  95. package/dist/Editor/Elements/Signature/SignatureOptions/DrawSignature.js +2 -8
  96. package/dist/Editor/Elements/Signature/SignatureOptions/TypeSignature.js +6 -2
  97. package/dist/Editor/Elements/Signature/SignatureOptions/UploadSignature.js +4 -1
  98. package/dist/Editor/Elements/Signature/SignaturePopup.js +17 -16
  99. package/dist/Editor/Elements/SimpleText/index.js +14 -5
  100. package/dist/Editor/Elements/SimpleText/style.js +2 -2
  101. package/dist/Editor/Elements/Table/DragButton.js +4 -2
  102. package/dist/Editor/Elements/Table/Table.js +23 -11
  103. package/dist/Editor/Elements/Table/TablePopup.js +4 -1
  104. package/dist/Editor/Elements/Table/TableSelector.js +10 -6
  105. package/dist/Editor/Elements/Table/TableTool.js +8 -4
  106. package/dist/Editor/Elements/Title/title.js +9 -8
  107. package/dist/Editor/Elements/TopBanner/TopBannerButton.js +4 -1
  108. package/dist/Editor/Elements/Variables/VariableButton.js +10 -1
  109. package/dist/Editor/MiniEditor.js +10 -3
  110. package/dist/Editor/Styles/EditorStyles.js +5 -5
  111. package/dist/Editor/Toolbar/Basic/index.js +2 -1
  112. package/dist/Editor/Toolbar/FormatTools/BlockButton.js +6 -2
  113. package/dist/Editor/Toolbar/FormatTools/Dropdown.js +27 -3
  114. package/dist/Editor/Toolbar/FormatTools/FontFamilyAutocomplete.js +4 -3
  115. package/dist/Editor/Toolbar/FormatTools/MarkButton.js +8 -4
  116. package/dist/Editor/Toolbar/FormatTools/TextSize.js +10 -13
  117. package/dist/Editor/Toolbar/Mini/MiniToolbar.js +17 -5
  118. package/dist/Editor/Toolbar/PopupTool/AddTemplates.js +10 -5
  119. package/dist/Editor/Toolbar/PopupTool/ButtonTemplatesCard.js +10 -4
  120. package/dist/Editor/Toolbar/PopupTool/FullViewCard.js +10 -4
  121. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/MiniColorPicker.js +9 -3
  122. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectAlignment.js +42 -35
  123. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectFontSize.js +6 -13
  124. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectList.js +58 -51
  125. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectSuperSubscript.js +29 -22
  126. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectTypography.js +226 -87
  127. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/index.js +20 -10
  128. package/dist/Editor/Toolbar/PopupTool/PopperHeader.js +10 -5
  129. package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +71 -11
  130. package/dist/Editor/Toolbar/PopupTool/TemplateCard.js +11 -5
  131. package/dist/Editor/Toolbar/PopupTool/TextFormat.js +122 -42
  132. package/dist/Editor/Toolbar/PopupTool/ThemeTextFormat.js +436 -0
  133. package/dist/Editor/Toolbar/PopupTool/index.js +18 -2
  134. package/dist/Editor/Toolbar/Toolbar.js +20 -10
  135. package/dist/Editor/Toolbar/toolbarGroups.js +48 -6
  136. package/dist/Editor/assets/svg/ClearAllRounded.js +31 -0
  137. package/dist/Editor/assets/svg/ResetIconNew.js +23 -0
  138. package/dist/Editor/assets/svg/ThemeIcons.js +291 -0
  139. package/dist/Editor/common/ColorPickerButton.js +39 -14
  140. package/dist/Editor/common/CustomColorPicker/index.js +131 -0
  141. package/dist/Editor/common/CustomColorPicker/style.js +53 -0
  142. package/dist/Editor/common/CustomDialog/index.js +8 -10
  143. package/dist/Editor/common/CustomDialog2/index.js +94 -0
  144. package/dist/Editor/common/CustomDialog2/style.js +67 -0
  145. package/dist/Editor/common/CustomSelect.js +43 -0
  146. package/dist/Editor/common/DnD/DragHandleButton.js +1 -1
  147. package/dist/Editor/common/FontLoader/FontLoader.js +3 -0
  148. package/dist/Editor/common/Icon.js +31 -1
  149. package/dist/Editor/common/ImageSelector/ImageSelector.js +10 -8
  150. package/dist/Editor/common/ImageSelector/Options/AddLink.js +6 -4
  151. package/dist/Editor/common/ImageSelector/Styles.js +3 -9
  152. package/dist/Editor/common/LinkSettings/NavComponents.js +14 -10
  153. package/dist/Editor/common/LinkSettings/index.js +20 -14
  154. package/dist/Editor/common/LinkSettings/navOptions.js +1 -1
  155. package/dist/Editor/common/MUIIcon/index.js +0 -3
  156. package/dist/Editor/common/MentionsPopup/index.js +6 -2
  157. package/dist/Editor/common/RnD/ContextMenu/CMenus.js +46 -22
  158. package/dist/Editor/common/RnD/ContextMenu/index.js +3 -2
  159. package/dist/Editor/common/RnD/ElementOptions/index.js +7 -2
  160. package/dist/Editor/common/RnD/ElementSettings/OtherSettings/SaveAsTemplate.js +8 -3
  161. package/dist/Editor/common/RnD/ElementSettings/OtherSettings/Settings.js +7 -3
  162. package/dist/Editor/common/RnD/ElementSettings/Settings/AppHeaderSettings.js +3 -2
  163. package/dist/Editor/common/RnD/ElementSettings/Settings/BoxSettings.js +3 -2
  164. package/dist/Editor/common/RnD/ElementSettings/Settings/ButtonSettings.js +3 -2
  165. package/dist/Editor/common/RnD/ElementSettings/Settings/CodeSettings.js +3 -2
  166. package/dist/Editor/common/RnD/ElementSettings/Settings/FormSettings.js +7 -4
  167. package/dist/Editor/common/RnD/ElementSettings/Settings/ImageSettings.js +3 -2
  168. package/dist/Editor/common/RnD/ElementSettings/Settings/TableSettings.js +3 -2
  169. package/dist/Editor/common/RnD/ElementSettings/Settings/TextSettings.js +6 -2
  170. package/dist/Editor/common/RnD/ElementSettings/Settings/VideoSettings.js +3 -2
  171. package/dist/Editor/common/RnD/OptionsPopup/index.js +4 -3
  172. package/dist/Editor/common/RnD/ShadowElement.js +2 -1
  173. package/dist/Editor/common/RnD/SwitchViewport/SwitchViewport.js +11 -4
  174. package/dist/Editor/common/RnD/Theme/MainThemeProvider.js +17 -0
  175. package/dist/Editor/common/RnD/Theme/ViewportStimulator.js +6 -3
  176. package/dist/Editor/common/RnD/Utils/gridDropItem.js +73 -9
  177. package/dist/Editor/common/RnD/Utils/index.js +3 -0
  178. package/dist/Editor/common/RnD/VirtualElement/BoxHeaderAutoAlignment.js +43 -0
  179. package/dist/Editor/common/RnD/VirtualElement/ForceAutoAlignment.js +44 -0
  180. package/dist/Editor/common/RnD/VirtualElement/VirtualTextElement.js +134 -0
  181. package/dist/Editor/common/RnD/VirtualElement/helper.js +382 -0
  182. package/dist/Editor/common/RnD/VirtualElement/index.js +187 -103
  183. package/dist/Editor/common/RnD/VirtualElement/styles.js +155 -7
  184. package/dist/Editor/common/RnD/VirtualElement/updateAutoProps.js +5 -3
  185. package/dist/Editor/common/RnD/index.js +69 -13
  186. package/dist/Editor/common/Section/index.js +7 -4
  187. package/dist/Editor/common/Shorthands/elements.js +72 -3
  188. package/dist/Editor/common/SnackBar/index.js +43 -0
  189. package/dist/Editor/common/StyleBuilder/appHeaderStyle.js +4 -4
  190. package/dist/Editor/common/StyleBuilder/boxStyle.js +2 -2
  191. package/dist/Editor/common/StyleBuilder/buttonStyle.js +6 -4
  192. package/dist/Editor/common/StyleBuilder/dividerStyles.js +2 -2
  193. package/dist/Editor/common/StyleBuilder/embedVideoStyle.js +6 -6
  194. package/dist/Editor/common/StyleBuilder/fieldStyle.js +2 -2
  195. package/dist/Editor/common/StyleBuilder/fieldTypes/alignment.js +13 -9
  196. package/dist/Editor/common/StyleBuilder/fieldTypes/backgroundImage.js +11 -3
  197. package/dist/Editor/common/StyleBuilder/fieldTypes/bannerSpacing.js +19 -5
  198. package/dist/Editor/common/StyleBuilder/fieldTypes/borderRadius.js +22 -10
  199. package/dist/Editor/common/StyleBuilder/fieldTypes/buttonLink.js +6 -3
  200. package/dist/Editor/common/StyleBuilder/fieldTypes/card.js +27 -13
  201. package/dist/Editor/common/StyleBuilder/fieldTypes/color.js +43 -14
  202. package/dist/Editor/common/StyleBuilder/fieldTypes/elementSize.js +10 -6
  203. package/dist/Editor/common/StyleBuilder/fieldTypes/fontSize.js +19 -6
  204. package/dist/Editor/common/StyleBuilder/fieldTypes/gridSize.js +6 -2
  205. package/dist/Editor/common/StyleBuilder/fieldTypes/icons.js +5 -2
  206. package/dist/Editor/common/StyleBuilder/fieldTypes/lineSpacing.js +7 -6
  207. package/dist/Editor/common/StyleBuilder/fieldTypes/menusArray.js +9 -6
  208. package/dist/Editor/common/StyleBuilder/fieldTypes/metaDataMapping.js +8 -2
  209. package/dist/Editor/common/StyleBuilder/fieldTypes/saveAsTemplate.js +12 -11
  210. package/dist/Editor/common/StyleBuilder/fieldTypes/selectBox.js +6 -2
  211. package/dist/Editor/common/StyleBuilder/fieldTypes/text.js +8 -4
  212. package/dist/Editor/common/StyleBuilder/fieldTypes/textAlign.js +6 -2
  213. package/dist/Editor/common/StyleBuilder/fieldTypes/textOptions.js +21 -12
  214. package/dist/Editor/common/StyleBuilder/formStyle.js +7 -7
  215. package/dist/Editor/common/StyleBuilder/gridItemStyle.js +6 -6
  216. package/dist/Editor/common/StyleBuilder/gridStyle.js +5 -5
  217. package/dist/Editor/common/StyleBuilder/index.js +8 -5
  218. package/dist/Editor/common/StyleBuilder/pageSettingsStyle.js +5 -7
  219. package/dist/Editor/common/SwipeableDrawer/index.js +1 -1
  220. package/dist/Editor/common/Uploader.js +16 -5
  221. package/dist/Editor/commonStyle.js +68 -57
  222. package/dist/Editor/helper/index.js +27 -3
  223. package/dist/Editor/helper/textIndeces.js +58 -0
  224. package/dist/Editor/helper/theme.js +202 -2
  225. package/dist/Editor/hooks/useAutoScroll.js +38 -0
  226. package/dist/Editor/hooks/useEditorTheme.js +153 -0
  227. package/dist/Editor/hooks/useMouseMove.js +9 -3
  228. package/dist/Editor/hooks/useThemeValues.js +63 -0
  229. package/dist/Editor/plugins/withEmbeds.js +1 -1
  230. package/dist/Editor/plugins/withHTML.js +11 -9
  231. package/dist/Editor/plugins/withLayout.js +3 -2
  232. package/dist/Editor/plugins/withLinks.js +10 -0
  233. package/dist/Editor/plugins/withTable.js +1 -1
  234. package/dist/Editor/theme/ThemeList.js +50 -173
  235. package/dist/Editor/theme/index.js +149 -0
  236. package/dist/Editor/themeSettings/ActiveTheme.js +72 -0
  237. package/dist/Editor/themeSettings/buttons/index.js +290 -0
  238. package/dist/Editor/themeSettings/buttons/style.js +23 -0
  239. package/dist/Editor/themeSettings/colorTheme/index.js +310 -0
  240. package/dist/Editor/themeSettings/colorTheme/style.js +81 -0
  241. package/dist/Editor/themeSettings/fonts/PreviewElement.js +121 -0
  242. package/dist/Editor/themeSettings/fonts/index.js +240 -0
  243. package/dist/Editor/themeSettings/fonts/style.js +61 -0
  244. package/dist/Editor/themeSettings/icons.js +60 -0
  245. package/dist/Editor/themeSettings/index.js +351 -0
  246. package/dist/Editor/themeSettings/style.js +220 -0
  247. package/dist/Editor/themeSettingsAI/icons.js +96 -0
  248. package/dist/Editor/themeSettingsAI/index.js +355 -0
  249. package/dist/Editor/themeSettingsAI/saveTheme.js +205 -0
  250. package/dist/Editor/themeSettingsAI/style.js +259 -0
  251. package/dist/Editor/utils/SlateUtilityFunctions.js +186 -54
  252. package/dist/Editor/utils/brains.js +1 -2
  253. package/dist/Editor/utils/draftToSlate.js +3 -2
  254. package/dist/Editor/utils/font.js +40 -37
  255. package/dist/Editor/utils/freegrid.js +3 -3
  256. package/dist/Editor/utils/helper.js +92 -21
  257. package/package.json +4 -4
@@ -13,34 +13,41 @@ function Label({
13
13
  }), " ", type]
14
14
  });
15
15
  }
16
- const superSubscriptOptions = [{
17
- id: 9,
18
- format: "superscript",
19
- type: "mark",
20
- title: /*#__PURE__*/_jsx(Label, {
16
+ function getSubcriptOptions(translation) {
17
+ return [{
18
+ id: 9,
19
+ format: "superscript",
20
+ type: "mark",
21
+ title: /*#__PURE__*/_jsx(Label, {
22
+ label: "X²",
23
+ type: translation("Superscript")
24
+ }),
21
25
  label: "X²",
22
- type: "Superscript"
23
- }),
24
- label: "X²",
25
- group: "superSubscript",
26
- value: "superscript"
27
- }, {
28
- id: 10,
29
- format: "subscript",
30
- type: "mark",
31
- title: /*#__PURE__*/_jsx(Label, {
26
+ group: "superSubscript",
27
+ value: "superscript"
28
+ }, {
29
+ id: 10,
30
+ format: "subscript",
31
+ type: "mark",
32
+ title: /*#__PURE__*/_jsx(Label, {
33
+ label: "X₂",
34
+ type: translation("Subscript")
35
+ }),
32
36
  label: "X₂",
33
- type: "Subscript"
34
- }),
35
- label: "X₂",
36
- group: "superSubscript",
37
- value: "subscript"
38
- }];
37
+ group: "superSubscript",
38
+ value: "subscript"
39
+ }];
40
+ }
39
41
  function SelectSuperSubscript({
40
42
  editor,
41
43
  classes,
42
- closeMainPopup
44
+ closeMainPopup,
45
+ customProps
43
46
  }) {
47
+ const {
48
+ translation
49
+ } = customProps;
50
+ const superSubscriptOptions = getSubcriptOptions(translation);
44
51
  const selectedMark = useMemo(() => {
45
52
  return superSubscriptOptions.find(option => activeMark(editor, option.format));
46
53
  }, [editor]);
@@ -2,108 +2,222 @@ import { useMemo } from "react";
2
2
  import { activeMark, addMarkData, isBlockActive, toggleBlock } from "../../../utils/SlateUtilityFunctions";
3
3
  import CustomSelectTool from "./CustomSelectTool";
4
4
  import useWindowResize from "../../../hooks/useWindowResize";
5
- import { BREAKPOINTS_DEVICES, getBreakPointsValue } from "../../../helper/theme";
5
+ import { BREAKPOINTS_DEVICES, getBreakPointsValue, isTextCustomized as isCustomized, textThemeFields as themeFields } from "../../../helper/theme";
6
6
  import { sizeMap } from "../../../utils/font";
7
+ import { Editor } from "slate";
8
+ import { useEditorTheme } from "../../../hooks/useEditorTheme";
9
+ import { MenuItem, Select } from "@mui/material";
7
10
  import { jsx as _jsx } from "react/jsx-runtime";
8
11
  import { jsxs as _jsxs } from "react/jsx-runtime";
9
12
  function Label({
10
13
  label,
11
- type
14
+ type,
15
+ translation
12
16
  }) {
13
17
  return /*#__PURE__*/_jsxs("span", {
14
18
  children: [/*#__PURE__*/_jsx("strong", {
15
19
  children: label
16
- }), " ", type]
20
+ }), " ", translation(type)]
17
21
  });
18
22
  }
19
23
  function DisplayHeaderLabel({
20
- type
24
+ type,
25
+ isCustomized,
26
+ isPara = false
21
27
  }) {
22
28
  return /*#__PURE__*/_jsxs("div", {
23
- children: ["H", /*#__PURE__*/_jsx("sub", {
29
+ children: [isCustomized ? "*" : "", isPara ? "P" : "H", /*#__PURE__*/_jsx("sub", {
24
30
  children: type
25
31
  })]
26
32
  });
27
33
  }
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, {
72
- 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, {
83
- 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
- label: "S",
95
- type: "Small"
96
- }),
97
- label: "S",
98
- group: "typography",
99
- value: "small"
100
- }];
34
+ function getTypographyOptions(isCustomized, translation) {
35
+ const typographyOptions = [{
36
+ id: 11,
37
+ format: "headingOne",
38
+ type: "block",
39
+ title: /*#__PURE__*/_jsx(Label, {
40
+ label: "H1",
41
+ type: "Heading",
42
+ translation: translation
43
+ }),
44
+ label: /*#__PURE__*/_jsx(DisplayHeaderLabel, {
45
+ type: 1,
46
+ isCustomized: isCustomized
47
+ }),
48
+ group: "typography",
49
+ value: "headingOne"
50
+ }, {
51
+ id: 12,
52
+ format: "headingTwo",
53
+ type: "block",
54
+ title: /*#__PURE__*/_jsx(Label, {
55
+ label: "H2",
56
+ type: "Heading",
57
+ translation: translation
58
+ }),
59
+ label: /*#__PURE__*/_jsx(DisplayHeaderLabel, {
60
+ type: 2,
61
+ isCustomized: isCustomized
62
+ }),
63
+ group: "typography",
64
+ value: "headingTwo"
65
+ }, {
66
+ id: 13,
67
+ format: "headingThree",
68
+ type: "block",
69
+ title: /*#__PURE__*/_jsx(Label, {
70
+ label: "H3",
71
+ type: "Heading",
72
+ translation: translation
73
+ }),
74
+ label: /*#__PURE__*/_jsx(DisplayHeaderLabel, {
75
+ type: 3,
76
+ isCustomized: isCustomized
77
+ }),
78
+ group: "typography",
79
+ value: "headingThree"
80
+ }, {
81
+ id: 17,
82
+ format: "headingFour",
83
+ type: "block",
84
+ title: /*#__PURE__*/_jsx(Label, {
85
+ label: "H4",
86
+ type: "Heading",
87
+ translation: translation
88
+ }),
89
+ label: /*#__PURE__*/_jsx(DisplayHeaderLabel, {
90
+ type: 4,
91
+ isCustomized: isCustomized
92
+ }),
93
+ group: "typography",
94
+ value: "headingFour"
95
+ }, {
96
+ id: 18,
97
+ format: "headingFive",
98
+ type: "block",
99
+ title: /*#__PURE__*/_jsx(Label, {
100
+ label: "H5",
101
+ type: "Heading",
102
+ translation: translation
103
+ }),
104
+ label: /*#__PURE__*/_jsx(DisplayHeaderLabel, {
105
+ type: 5,
106
+ isCustomized: isCustomized
107
+ }),
108
+ group: "typography",
109
+ value: "headingFive"
110
+ }, {
111
+ id: 19,
112
+ format: "headingSix",
113
+ type: "block",
114
+ title: /*#__PURE__*/_jsx(Label, {
115
+ label: "H6",
116
+ type: "Heading",
117
+ translation: translation
118
+ }),
119
+ label: /*#__PURE__*/_jsx(DisplayHeaderLabel, {
120
+ type: 6,
121
+ isCustomized: isCustomized
122
+ }),
123
+ group: "typography",
124
+ value: "headingSix"
125
+ }, {
126
+ id: 20,
127
+ format: "paragraphOne",
128
+ type: "block",
129
+ title: /*#__PURE__*/_jsx(Label, {
130
+ label: "P1",
131
+ type: "Paragraph",
132
+ translation: translation
133
+ }),
134
+ label: /*#__PURE__*/_jsx(DisplayHeaderLabel, {
135
+ type: 1,
136
+ isCustomized: isCustomized,
137
+ isPara: true
138
+ }),
139
+ group: "typography",
140
+ value: "paragraphOne"
141
+ }, {
142
+ id: 21,
143
+ format: "paragraphTwo",
144
+ type: "block",
145
+ title: /*#__PURE__*/_jsx(Label, {
146
+ label: "P2",
147
+ type: "Paragraph",
148
+ translation: translation
149
+ }),
150
+ label: /*#__PURE__*/_jsx(DisplayHeaderLabel, {
151
+ type: 2,
152
+ isCustomized: isCustomized,
153
+ isPara: true
154
+ }),
155
+ group: "typography",
156
+ value: "paragraphTwo"
157
+ }, {
158
+ id: 22,
159
+ format: "paragraphThree",
160
+ type: "block",
161
+ title: /*#__PURE__*/_jsx(Label, {
162
+ label: "P3",
163
+ type: "Paragraph",
164
+ translation: translation
165
+ }),
166
+ label: /*#__PURE__*/_jsx(DisplayHeaderLabel, {
167
+ type: 3,
168
+ isCustomized: isCustomized,
169
+ isPara: true
170
+ }),
171
+ group: "typography",
172
+ value: "paragraphThree"
173
+ }
174
+ // {
175
+ // id: 14,
176
+ // format: "fontSize",
177
+ // type: "mark",
178
+ // title: <Label label="L" type="Large" />,
179
+ // label: "L",
180
+ // group: "typography",
181
+ // value: "huge",
182
+ // },
183
+ // {
184
+ // id: 15,
185
+ // format: "fontSize",
186
+ // type: "mark",
187
+ // title: <Label label="M" type="Medium" />,
188
+ // label: "M",
189
+ // group: "typography",
190
+ // value: "medium",
191
+ // },
192
+ // {
193
+ // id: 16,
194
+ // format: "fontSize",
195
+ // type: "mark",
196
+ // title: <Label label="S" type="Small" />,
197
+ // label: "S",
198
+ // group: "typography",
199
+ // value: "small",
200
+ // },
201
+ ];
202
+
203
+ return typographyOptions;
204
+ }
101
205
  function SelectTypography({
102
206
  editor,
103
207
  classes,
104
- closeMainPopup
208
+ closeMainPopup,
209
+ type,
210
+ customProps
105
211
  }) {
106
212
  const [size] = useWindowResize();
213
+ const {
214
+ theme
215
+ } = useEditorTheme();
216
+ const {
217
+ translation
218
+ } = customProps;
219
+ const isTextCustomized = theme?.id ? isCustomized(editor) : false;
220
+ const typographyOptions = getTypographyOptions(isTextCustomized, translation);
107
221
  const updateMarkData = newVal => {
108
222
  const val = activeMark(editor, "fontSize");
109
223
  let upData = {
@@ -125,7 +239,10 @@ function SelectTypography({
125
239
  ...upData
126
240
  }
127
241
  });
242
+
243
+ // closeMainPopup();
128
244
  };
245
+
129
246
  const selectedBlock = useMemo(() => {
130
247
  return typographyOptions.find(t => {
131
248
  if (t.type === "block") {
@@ -147,15 +264,13 @@ function SelectTypography({
147
264
  });
148
265
  }, [typographyOptions, activeMark, isBlockActive, editor]);
149
266
  const onChange = (format, option) => {
150
- // add/reset block elements
151
- toggleBlock(editor, format);
152
267
  if (option.type === "block") {
153
- // reset old font size
154
- // let updatedValue = !selectedBlock ? {} : { xs: "16px", sm: "16px", md: "16px", lg: "16px" }
155
- addMarkData(editor, {
156
- format: "fontSize",
157
- value: {}
268
+ themeFields.forEach(field => {
269
+ Editor.removeMark(editor, field);
158
270
  });
271
+
272
+ // add/reset block elements
273
+ toggleBlock(editor, format);
159
274
  } else if (option.type === "mark") {
160
275
  const size = sizeMap[option.value] || "";
161
276
  const [sizeInNumber] = size.split("px");
@@ -163,11 +278,35 @@ function SelectTypography({
163
278
  }
164
279
  closeMainPopup();
165
280
  };
281
+ const typographyValue = selectedBlock?.value || "headingOne";
282
+ if (type === "fullWidth") {
283
+ return /*#__PURE__*/_jsx(Select, {
284
+ value: typographyValue,
285
+ className: "editor-dd",
286
+ onChange: e => {
287
+ const {
288
+ value
289
+ } = e.target;
290
+ const option = typographyOptions?.find(o => o.value === value);
291
+ onChange(value, option);
292
+ },
293
+ style: {
294
+ width: "100%",
295
+ height: "36px",
296
+ borderRadius: "10px",
297
+ fontSize: "14px"
298
+ },
299
+ children: typographyOptions.map((item, index) => /*#__PURE__*/_jsxs(MenuItem, {
300
+ value: item.value,
301
+ children: [item.title, " ", isTextCustomized && item.value === typographyValue ? " *" : ""]
302
+ }, index))
303
+ });
304
+ }
166
305
  return /*#__PURE__*/_jsx(CustomSelectTool, {
167
306
  options: typographyOptions,
168
307
  editor: editor,
169
308
  onChange: onChange,
170
- value: selectedBlock?.value || "headingOne",
309
+ value: typographyValue,
171
310
  classes: classes
172
311
  });
173
312
  }
@@ -1,4 +1,4 @@
1
- import { Fade, Grid, IconButton, Paper, Popper } from "@mui/material";
1
+ import { Fade, Grid, IconButton, Paper, Popper, useTheme } from "@mui/material";
2
2
  import SelectTypography from "./SelectTypography";
3
3
  import SelectList from "./SelectList";
4
4
  import { toolbarGroups } from "../../toolbarGroups";
@@ -14,7 +14,7 @@ import MiniColorPicker from "./MiniColorPicker";
14
14
  import SelectAlignment from "./SelectAlignment";
15
15
  import SelectFontSize from "./SelectFontSize";
16
16
  import InfinityAITool from "./InfinityAITool";
17
- import { viewSlateSelection } from "../../../utils/helper";
17
+ import { getSelectedElementColor, viewSlateSelection } from "../../../utils/helper";
18
18
  import { jsx as _jsx } from "react/jsx-runtime";
19
19
  import { jsxs as _jsxs } from "react/jsx-runtime";
20
20
  const DEFAULT_COLOR = {
@@ -35,11 +35,12 @@ const MiniTextFormat = props => {
35
35
  const open = Boolean(anchorEl);
36
36
  const id = open ? "popup-edit-tool" : "";
37
37
  const [size] = useWindowResize();
38
+ const theme = useTheme();
38
39
  const removeFontStyles = ["superscript", "subscript"];
39
40
  const fontStyle = allTools.filter(f => f.type === "mark" && !removeFontStyles.includes(f.format));
40
41
  const link = allTools.find(f => f.format?.indexOf("link") >= 0);
41
42
  const fontAlign = allTools.filter(f => f.format?.indexOf("align") >= 0);
42
- const activeColor = activeMark(editor, textColorFormat) || DEFAULT_COLOR[textColorFormat];
43
+ const activeColor = getSelectedElementColor(editor, textColorFormat, theme);
43
44
  const activeBg = activeMark(editor, textBgFormat) || DEFAULT_COLOR[textBgFormat];
44
45
  return /*#__PURE__*/_jsx(Grid, {
45
46
  container: true,
@@ -56,20 +57,24 @@ const MiniTextFormat = props => {
56
57
  }), /*#__PURE__*/_jsx(SelectTypography, {
57
58
  classes: classes,
58
59
  editor: editor,
59
- closeMainPopup: closeMainPopup
60
+ closeMainPopup: closeMainPopup,
61
+ type: "miniToolBar",
62
+ customProps: customProps
60
63
  }), /*#__PURE__*/_jsx("div", {
61
64
  className: "verticalLine"
62
65
  }), /*#__PURE__*/_jsx(SelectList, {
63
66
  classes: classes,
64
67
  editor: editor,
65
- closeMainPopup: closeMainPopup
68
+ closeMainPopup: closeMainPopup,
69
+ customProps: customProps
66
70
  }), /*#__PURE__*/_jsx("div", {
67
71
  className: "verticalLine mr-1"
68
72
  }), /*#__PURE__*/_jsx(SelectAlignment, {
69
73
  fontAlign: fontAlign,
70
74
  classes: classes,
71
75
  editor: editor,
72
- closeMainPopup: closeMainPopup
76
+ closeMainPopup: closeMainPopup,
77
+ customProps: customProps
73
78
  }), /*#__PURE__*/_jsx("div", {
74
79
  className: "verticalLine mr-1"
75
80
  }), /*#__PURE__*/_jsx(SelectFontSize, {
@@ -80,20 +85,24 @@ const MiniTextFormat = props => {
80
85
  }), fontStyle?.map((m, i) => {
81
86
  return /*#__PURE__*/_jsx(MarkButton, {
82
87
  editor: editor,
83
- ...m
88
+ ...m,
89
+ customProps: customProps
84
90
  }, `pptool_mark_${i}_${m.id}`);
85
91
  }), /*#__PURE__*/_jsx(MiniColorPicker, {
86
92
  format: textColorFormat,
87
93
  classes: classes,
88
94
  activeColor: activeColor,
89
95
  id: "11_cc",
90
- editor: editor
96
+ editor: editor,
97
+ customProps: customProps,
98
+ type: "textColor"
91
99
  }), /*#__PURE__*/_jsx(MiniColorPicker, {
92
100
  format: textBgFormat,
93
101
  classes: classes,
94
102
  activeColor: activeBg,
95
103
  id: "12_cc",
96
- editor: editor
104
+ editor: editor,
105
+ customProps: customProps
97
106
  }), /*#__PURE__*/_jsx("div", {
98
107
  className: "verticalLine ml-1 mr-1"
99
108
  }), /*#__PURE__*/_jsx(LinkButton, {
@@ -126,7 +135,8 @@ const MiniTextFormat = props => {
126
135
  children: [/*#__PURE__*/_jsx(PopperHeader, {
127
136
  title: "Text Settings",
128
137
  classes: classes,
129
- onClose: () => setAnchorEl(null)
138
+ onClose: () => setAnchorEl(null),
139
+ customProps: customProps
130
140
  }), /*#__PURE__*/_jsx(TextFormat, {
131
141
  editor: editor,
132
142
  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
  };
@@ -46,7 +50,8 @@ const PopperHeader = props => {
46
50
  padding: 2,
47
51
  className: "headerContainer",
48
52
  style: {
49
- paddingTop: "5px"
53
+ paddingTop: "5px",
54
+ paddingBottom: "0px"
50
55
  },
51
56
  children: /*#__PURE__*/_jsxs(Grid, {
52
57
  item: true,
@@ -61,7 +66,7 @@ const PopperHeader = props => {
61
66
  fontWeight: "700",
62
67
  color: "#000"
63
68
  },
64
- children: title
69
+ children: translation(title)
65
70
  }), /*#__PURE__*/_jsxs(Grid, {
66
71
  sx: classes.textFormatLabel,
67
72
  justifyContent: "end",
@@ -82,7 +87,7 @@ const PopperHeader = props => {
82
87
  handleChange: onSearch
83
88
  })]
84
89
  }) : null, needFullscreen ? /*#__PURE__*/_jsx(Tooltip, {
85
- title: "Toggle Fullscreen",
90
+ title: translation("toggleFullScreen"),
86
91
  arrow: true,
87
92
  children: /*#__PURE__*/_jsx(IconButton, {
88
93
  style: {
@@ -94,7 +99,7 @@ const PopperHeader = props => {
94
99
  children: fullScreen ? /*#__PURE__*/_jsx(CloseFullscreenIcon, {}) : /*#__PURE__*/_jsx(ToggleFullScreenIcon, {})
95
100
  })
96
101
  }) : null, /*#__PURE__*/_jsx(Tooltip, {
97
- title: "Close",
102
+ title: translation("Close"),
98
103
  arrow: true,
99
104
  children: /*#__PURE__*/_jsx(IconButton, {
100
105
  sx: classes.closeBtn,