@flozy/editor 9.6.8 → 9.6.9

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 (256) hide show
  1. package/dist/Editor/ChatEditor.js +26 -19
  2. package/dist/Editor/CommonEditor.js +139 -25
  3. package/dist/Editor/DialogWrapper.js +31 -25
  4. package/dist/Editor/Editor.css +13 -9
  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 +4 -2
  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 +425 -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 +14 -9
  58. package/dist/Editor/Elements/Embed/Video.js +9 -6
  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 +38 -5
  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 +14 -9
  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 +7 -3
  94. package/dist/Editor/Elements/Signature/SignatureButton.js +6 -2
  95. package/dist/Editor/Elements/Signature/SignatureOptions/TypeSignature.js +6 -2
  96. package/dist/Editor/Elements/Signature/SignatureOptions/UploadSignature.js +4 -1
  97. package/dist/Editor/Elements/Signature/SignaturePopup.js +17 -16
  98. package/dist/Editor/Elements/SimpleText/index.js +5 -4
  99. package/dist/Editor/Elements/SimpleText/style.js +2 -2
  100. package/dist/Editor/Elements/Table/DragButton.js +4 -2
  101. package/dist/Editor/Elements/Table/Table.js +24 -12
  102. package/dist/Editor/Elements/Table/TablePopup.js +4 -1
  103. package/dist/Editor/Elements/Table/TableSelector.js +10 -6
  104. package/dist/Editor/Elements/Table/TableTool.js +8 -4
  105. package/dist/Editor/Elements/Title/title.js +15 -2
  106. package/dist/Editor/Elements/TopBanner/TopBannerButton.js +4 -1
  107. package/dist/Editor/Elements/Variables/VariableButton.js +10 -1
  108. package/dist/Editor/MiniEditor.js +10 -3
  109. package/dist/Editor/Styles/EditorStyles.js +5 -5
  110. package/dist/Editor/Toolbar/Basic/index.js +2 -1
  111. package/dist/Editor/Toolbar/FormatTools/BlockButton.js +6 -2
  112. package/dist/Editor/Toolbar/FormatTools/Dropdown.js +27 -3
  113. package/dist/Editor/Toolbar/FormatTools/FontFamilyAutocomplete.js +4 -3
  114. package/dist/Editor/Toolbar/FormatTools/MarkButton.js +8 -4
  115. package/dist/Editor/Toolbar/FormatTools/TextSize.js +10 -13
  116. package/dist/Editor/Toolbar/Mini/MiniToolbar.js +17 -5
  117. package/dist/Editor/Toolbar/PopupTool/AddTemplates.js +10 -5
  118. package/dist/Editor/Toolbar/PopupTool/ButtonTemplatesCard.js +10 -4
  119. package/dist/Editor/Toolbar/PopupTool/FullViewCard.js +10 -4
  120. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/MiniColorPicker.js +9 -3
  121. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectAlignment.js +42 -35
  122. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectFontSize.js +6 -13
  123. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectList.js +58 -51
  124. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectSuperSubscript.js +29 -22
  125. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectTypography.js +226 -87
  126. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/index.js +20 -10
  127. package/dist/Editor/Toolbar/PopupTool/PopperHeader.js +10 -5
  128. package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +71 -11
  129. package/dist/Editor/Toolbar/PopupTool/TemplateCard.js +11 -5
  130. package/dist/Editor/Toolbar/PopupTool/TextFormat.js +128 -45
  131. package/dist/Editor/Toolbar/PopupTool/ThemeTextFormat.js +436 -0
  132. package/dist/Editor/Toolbar/PopupTool/index.js +20 -10
  133. package/dist/Editor/Toolbar/Toolbar.js +20 -10
  134. package/dist/Editor/Toolbar/toolbarGroups.js +48 -6
  135. package/dist/Editor/assets/svg/ClearAllRounded.js +31 -0
  136. package/dist/Editor/assets/svg/ThemeIcons.js +291 -0
  137. package/dist/Editor/common/ColorPickerButton.js +39 -14
  138. package/dist/Editor/common/CustomColorPicker/index.js +131 -0
  139. package/dist/Editor/common/CustomColorPicker/style.js +53 -0
  140. package/dist/Editor/common/CustomDialog/index.js +8 -10
  141. package/dist/Editor/common/CustomDialog2/index.js +94 -0
  142. package/dist/Editor/common/CustomDialog2/style.js +67 -0
  143. package/dist/Editor/common/CustomSelect.js +43 -0
  144. package/dist/Editor/common/DnD/DragHandleButton.js +1 -1
  145. package/dist/Editor/common/FontLoader/FontLoader.js +3 -0
  146. package/dist/Editor/common/Icon.js +28 -0
  147. package/dist/Editor/common/ImageSelector/ImageSelector.js +10 -8
  148. package/dist/Editor/common/ImageSelector/Options/AddLink.js +6 -4
  149. package/dist/Editor/common/ImageSelector/Options/Upload.js +1 -1
  150. package/dist/Editor/common/ImageSelector/Styles.js +3 -9
  151. package/dist/Editor/common/ImageSelector/UploadStyles.js +9 -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 +22 -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/ElementSettings/styles.js +0 -1
  172. package/dist/Editor/common/RnD/OptionsPopup/index.js +4 -3
  173. package/dist/Editor/common/RnD/ShadowElement.js +2 -1
  174. package/dist/Editor/common/RnD/SwitchViewport/SwitchViewport.js +11 -4
  175. package/dist/Editor/common/RnD/Theme/MainThemeProvider.js +17 -0
  176. package/dist/Editor/common/RnD/Theme/ViewportStimulator.js +6 -3
  177. package/dist/Editor/common/RnD/Utils/gridDropItem.js +55 -8
  178. package/dist/Editor/common/RnD/Utils/index.js +3 -0
  179. package/dist/Editor/common/RnD/VirtualElement/BoxHeaderAutoAlignment.js +43 -0
  180. package/dist/Editor/common/RnD/VirtualElement/ForceAutoAlignment.js +44 -0
  181. package/dist/Editor/common/RnD/VirtualElement/VirtualTextElement.js +134 -0
  182. package/dist/Editor/common/RnD/VirtualElement/helper.js +375 -0
  183. package/dist/Editor/common/RnD/VirtualElement/index.js +187 -103
  184. package/dist/Editor/common/RnD/VirtualElement/styles.js +151 -7
  185. package/dist/Editor/common/RnD/VirtualElement/updateAutoProps.js +5 -3
  186. package/dist/Editor/common/RnD/index.js +64 -13
  187. package/dist/Editor/common/Section/index.js +7 -4
  188. package/dist/Editor/common/Shorthands/elements.js +74 -3
  189. package/dist/Editor/common/SnackBar/index.js +43 -0
  190. package/dist/Editor/common/StyleBuilder/appHeaderStyle.js +4 -4
  191. package/dist/Editor/common/StyleBuilder/boxStyle.js +2 -2
  192. package/dist/Editor/common/StyleBuilder/buttonStyle.js +6 -4
  193. package/dist/Editor/common/StyleBuilder/dividerStyles.js +2 -2
  194. package/dist/Editor/common/StyleBuilder/embedVideoStyle.js +6 -6
  195. package/dist/Editor/common/StyleBuilder/fieldStyle.js +2 -2
  196. package/dist/Editor/common/StyleBuilder/fieldTypes/alignment.js +13 -9
  197. package/dist/Editor/common/StyleBuilder/fieldTypes/backgroundImage.js +11 -3
  198. package/dist/Editor/common/StyleBuilder/fieldTypes/bannerSpacing.js +19 -5
  199. package/dist/Editor/common/StyleBuilder/fieldTypes/borderRadius.js +22 -10
  200. package/dist/Editor/common/StyleBuilder/fieldTypes/buttonLink.js +6 -3
  201. package/dist/Editor/common/StyleBuilder/fieldTypes/card.js +27 -13
  202. package/dist/Editor/common/StyleBuilder/fieldTypes/color.js +43 -14
  203. package/dist/Editor/common/StyleBuilder/fieldTypes/elementSize.js +10 -6
  204. package/dist/Editor/common/StyleBuilder/fieldTypes/fontSize.js +19 -6
  205. package/dist/Editor/common/StyleBuilder/fieldTypes/gridSize.js +6 -2
  206. package/dist/Editor/common/StyleBuilder/fieldTypes/icons.js +5 -2
  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/Uploader.js +16 -5
  220. package/dist/Editor/commonStyle.js +23 -12
  221. package/dist/Editor/helper/index.js +27 -3
  222. package/dist/Editor/helper/textIndeces.js +58 -0
  223. package/dist/Editor/helper/theme.js +202 -2
  224. package/dist/Editor/hooks/useAutoScroll.js +38 -0
  225. package/dist/Editor/hooks/useDrag.js +1 -1
  226. package/dist/Editor/hooks/useEditorScroll.js +0 -1
  227. package/dist/Editor/hooks/useEditorTheme.js +153 -0
  228. package/dist/Editor/hooks/useMouseMove.js +9 -3
  229. package/dist/Editor/hooks/useThemeValues.js +63 -0
  230. package/dist/Editor/plugins/withEmbeds.js +1 -1
  231. package/dist/Editor/plugins/withHTML.js +11 -9
  232. package/dist/Editor/plugins/withLayout.js +3 -2
  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 +201 -60
  252. package/dist/Editor/utils/draftToSlate.js +3 -2
  253. package/dist/Editor/utils/font.js +40 -37
  254. package/dist/Editor/utils/freegrid.js +3 -3
  255. package/dist/Editor/utils/helper.js +92 -21
  256. package/package.json +3 -3
@@ -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,
@@ -111,6 +111,7 @@ const usePopupStyle = theme => ({
111
111
  width: "323px",
112
112
  maxWidth: "100%",
113
113
  overflowX: "hidden !important",
114
+ marginTop: "6px",
114
115
  // 30% of window height
115
116
  maxHeight: `${window.innerHeight * 0.45}px`,
116
117
  overflow: "auto",
@@ -130,7 +131,7 @@ const usePopupStyle = theme => ({
130
131
  },
131
132
  "& .accordionIcon": {
132
133
  "& p": {
133
- textAlign: 'left'
134
+ textAlign: "left"
134
135
  }
135
136
  }
136
137
  },
@@ -304,6 +305,21 @@ const usePopupStyle = theme => ({
304
305
  paddingRight: "0px !important"
305
306
  }
306
307
  },
308
+ textFormatContainer: {
309
+ ".saveThemeBtnsWrapper": {
310
+ position: "sticky",
311
+ bottom: "0px",
312
+ right: "0px",
313
+ boxShadow: "0px -3px 12px 0px #00000017",
314
+ padding: "10px",
315
+ borderRadius: "8px 8px 19px 19px",
316
+ display: "flex",
317
+ justifyContent: "end",
318
+ alignItems: "center",
319
+ gap: "8px",
320
+ background: theme?.palette?.editor?.background
321
+ }
322
+ },
307
323
  textFormatLabel: {
308
324
  display: "flex",
309
325
  alignItems: "center",
@@ -335,9 +351,10 @@ const usePopupStyle = theme => ({
335
351
  borderBottom: `1px solid ${theme?.palette?.editor?.deviderBgColor} !important`
336
352
  },
337
353
  textFormatField: {
338
- marginBottom: "8px",
339
- marginTop: "8px"
354
+ marginBottom: "8px"
355
+ // marginTop: "8px",
340
356
  },
357
+
341
358
  textFormatField1: {
342
359
  marginBottom: "16px",
343
360
  marginTop: "10px"
@@ -416,6 +433,11 @@ const usePopupStyle = theme => ({
416
433
  "& .MuiOutlinedInput-notchedOutline": {
417
434
  border: `1px solid ${theme?.palette?.editor?.inputFieldBorder} !important`
418
435
  },
436
+ "& .MuiInputBase-root": {
437
+ "& input": {
438
+ border: "none !important"
439
+ }
440
+ },
419
441
  "& svg": {
420
442
  width: "20px",
421
443
  height: "24px"
@@ -424,9 +446,6 @@ const usePopupStyle = theme => ({
424
446
  fontFamilyListOptions: {
425
447
  "& .MuiAutocomplete-listbox": {
426
448
  padding: "0px",
427
- // "&::-webkit-scrollbar-thumb": {
428
- // background: `none !important`,
429
- // },
430
449
  "&::-webkit-scrollbar-thumb": {
431
450
  background: `${theme?.palette?.editor?.brainPopupScroll} !important`
432
451
  },
@@ -437,8 +456,8 @@ const usePopupStyle = theme => ({
437
456
  margin: "5px",
438
457
  borderRadius: "8px",
439
458
  color: theme?.palette?.editor?.menuOptionTextColor,
440
- fontSize: '14px',
441
- padding: '8px 12px',
459
+ fontSize: "14px",
460
+ padding: "8px 12px",
442
461
  '&[aria-selected="true"]': {
443
462
  backgroundColor: `${theme?.palette?.editor?.menuOptionSelectedOption} !important`
444
463
  }
@@ -537,7 +556,7 @@ const usePopupStyle = theme => ({
537
556
  }
538
557
  },
539
558
  alignItems: "flexStart",
540
- justifyContent: "center",
559
+ // justifyContent: "center",
541
560
  flexDirection: "row",
542
561
  "&:hover": {
543
562
  background: "unset"
@@ -786,8 +805,13 @@ const usePopupStyle = theme => ({
786
805
  padding: "0px"
787
806
  },
788
807
  defaultBtn: {
789
- color: "#0F172A",
790
- textTransform: "none"
808
+ color: "#2563EB !important",
809
+ textTransform: "none",
810
+ textDecoration: "underline",
811
+ "&.Mui-disabled": {
812
+ color: "#A0AEC0 !important",
813
+ textDecoration: "none"
814
+ }
791
815
  },
792
816
  templateCardBtnGrp: {
793
817
  display: "none",
@@ -1138,6 +1162,42 @@ const usePopupStyle = theme => ({
1138
1162
  "& fieldset": {
1139
1163
  border: "none !important"
1140
1164
  }
1165
+ },
1166
+ customCheckBox: {
1167
+ marginTop: "4px",
1168
+ padding: "0px",
1169
+ "& .MuiCheckbox-root": {
1170
+ padding: "8px 8px 8px 10px",
1171
+ "&:hover": {
1172
+ background: "unset !important"
1173
+ }
1174
+ },
1175
+ "& button": {
1176
+ width: "14px !important",
1177
+ height: "14px !important",
1178
+ borderRadius: "3px",
1179
+ border: `1px solid ${theme?.palette?.editor?.buttonBorder3}`,
1180
+ padding: "0px",
1181
+ "& svg": {
1182
+ width: "10px",
1183
+ height: "10px"
1184
+ }
1185
+ },
1186
+ "& .checkedIcon": {
1187
+ background: "#2563EB",
1188
+ borderColor: "#2563EB"
1189
+ },
1190
+ "& .unCheckedIcon": {
1191
+ background: theme?.palette?.editor?.checkedIconBg
1192
+ },
1193
+ "& p": {
1194
+ margin: "0px !important",
1195
+ color: theme?.palette?.editor?.tv_text,
1196
+ fontSize: "13px"
1197
+ }
1198
+ },
1199
+ dividerGrid: {
1200
+ margin: "5px 0px 10px 0px"
1141
1201
  }
1142
1202
  });
1143
1203
  export default usePopupStyle;