@flozy/editor 9.5.6 → 9.5.8

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 -22
  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 +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 +31 -14
  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 +7 -2
  33. package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/MultiSelect.js +425 -0
  34. package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/Select.js +4 -3
  35. package/dist/Editor/Elements/DataView/Layouts/DataTypes/MultiSelectType.js +25 -5
  36. package/dist/Editor/Elements/DataView/Layouts/DataTypes/TextType.js +7 -2
  37. package/dist/Editor/Elements/DataView/Layouts/FilterSort/SortOptions/ChooseSort.js +13 -12
  38. package/dist/Editor/Elements/DataView/Layouts/FilterSort/SortOptions/index.js +7 -4
  39. package/dist/Editor/Elements/DataView/Layouts/FilterSort/index.js +7 -5
  40. package/dist/Editor/Elements/DataView/Layouts/FilterView.js +9 -7
  41. package/dist/Editor/Elements/DataView/Layouts/Options/AddOptions.js +8 -3
  42. package/dist/Editor/Elements/DataView/Layouts/Options/AddProperty.js +5 -3
  43. package/dist/Editor/Elements/DataView/Layouts/Options/AllProperties.js +6 -5
  44. package/dist/Editor/Elements/DataView/Layouts/Options/ChangeProperty.js +5 -3
  45. package/dist/Editor/Elements/DataView/Layouts/Options/EditOption.js +9 -7
  46. package/dist/Editor/Elements/DataView/Layouts/Options/EditProperty.js +64 -38
  47. package/dist/Editor/Elements/DataView/Layouts/Options/FilterProperty.js +3 -2
  48. package/dist/Editor/Elements/DataView/Layouts/Options/PropertyList.js +3 -2
  49. package/dist/Editor/Elements/DataView/Layouts/Options/index.js +23 -6
  50. package/dist/Editor/Elements/DataView/Layouts/TableStyles.js +4 -1
  51. package/dist/Editor/Elements/DataView/Layouts/TableView.js +6 -4
  52. package/dist/Editor/Elements/DataView/Layouts/ViewData.js +8 -4
  53. package/dist/Editor/Elements/DataView/Layouts/index.js +3 -1
  54. package/dist/Editor/Elements/DataView/Providers/DataViewProvider.js +5 -2
  55. package/dist/Editor/Elements/DataView/styles.js +13 -0
  56. package/dist/Editor/Elements/Divider/Divider.js +5 -3
  57. package/dist/Editor/Elements/Divider/DividerButton.js +6 -2
  58. package/dist/Editor/Elements/Divider/DividerPopup.js +3 -2
  59. package/dist/Editor/Elements/Embed/Embed.js +4 -1
  60. package/dist/Editor/Elements/Embed/EmbedPopup.js +4 -1
  61. package/dist/Editor/Elements/Embed/Image.js +16 -11
  62. package/dist/Editor/Elements/Embed/Video.js +9 -6
  63. package/dist/Editor/Elements/EmbedScript/Code.js +7 -4
  64. package/dist/Editor/Elements/EmbedScript/EmbedScript.js +6 -2
  65. package/dist/Editor/Elements/EmbedScript/EmbedScriptPopup.js +8 -5
  66. package/dist/Editor/Elements/Emoji/EmojiButton.js +6 -2
  67. package/dist/Editor/Elements/Form/FieldPopup.js +4 -1
  68. package/dist/Editor/Elements/Form/Form.js +12 -9
  69. package/dist/Editor/Elements/Form/FormButton.js +6 -2
  70. package/dist/Editor/Elements/Form/FormPopup.js +3 -2
  71. package/dist/Editor/Elements/Form/Workflow/FormWorkflow.js +18 -12
  72. package/dist/Editor/Elements/Form/Workflow/ListWorkflow.js +13 -8
  73. package/dist/Editor/Elements/Form/Workflow/MoreOptions.js +3 -2
  74. package/dist/Editor/Elements/Form/Workflow/Styles.js +24 -22
  75. package/dist/Editor/Elements/Form/Workflow/UserInputs.js +4 -2
  76. package/dist/Editor/Elements/Form/Workflow/index.js +15 -9
  77. package/dist/Editor/Elements/FreeGrid/FreeGrid.js +67 -23
  78. package/dist/Editor/Elements/FreeGrid/FreeGridBox.js +23 -4
  79. package/dist/Editor/Elements/FreeGrid/FreeGridButton.js +6 -2
  80. package/dist/Editor/Elements/FreeGrid/FreeGridItem.js +36 -5
  81. package/dist/Editor/Elements/FreeGrid/Options/AddElement.js +3 -2
  82. package/dist/Editor/Elements/FreeGrid/Options/More.js +10 -4
  83. package/dist/Editor/Elements/FreeGrid/styles.js +3 -0
  84. package/dist/Editor/Elements/Grid/Grid.js +13 -10
  85. package/dist/Editor/Elements/Grid/GridButton.js +9 -5
  86. package/dist/Editor/Elements/Grid/GridItem.js +14 -8
  87. package/dist/Editor/Elements/Grid/GridItemPopup.js +4 -1
  88. package/dist/Editor/Elements/Grid/GridPopup.js +4 -1
  89. package/dist/Editor/Elements/Grid/SectionPopup.js +4 -1
  90. package/dist/Editor/Elements/Link/Link.js +8 -5
  91. package/dist/Editor/Elements/Link/LinkButton.js +4 -1
  92. package/dist/Editor/Elements/List/CheckList.js +14 -9
  93. package/dist/Editor/Elements/NewLine/NewLineButton.js +6 -2
  94. package/dist/Editor/Elements/PageSettings/PageSettingsButton.js +4 -1
  95. package/dist/Editor/Elements/PageSettings/PageSettingsPopup.js +4 -1
  96. package/dist/Editor/Elements/Search/SearchButton.js +6 -3
  97. package/dist/Editor/Elements/Search/SearchList.js +7 -3
  98. package/dist/Editor/Elements/Signature/SignatureButton.js +6 -2
  99. package/dist/Editor/Elements/Signature/SignatureOptions/TypeSignature.js +6 -2
  100. package/dist/Editor/Elements/Signature/SignatureOptions/UploadSignature.js +4 -1
  101. package/dist/Editor/Elements/Signature/SignaturePopup.js +17 -16
  102. package/dist/Editor/Elements/SimpleText/index.js +5 -4
  103. package/dist/Editor/Elements/SimpleText/style.js +2 -2
  104. package/dist/Editor/Elements/Table/DragButton.js +4 -2
  105. package/dist/Editor/Elements/Table/Table.js +23 -11
  106. package/dist/Editor/Elements/Table/TableCell.js +2 -24
  107. package/dist/Editor/Elements/Table/TablePopup.js +4 -1
  108. package/dist/Editor/Elements/Table/TableSelector.js +10 -6
  109. package/dist/Editor/Elements/Table/TableTool.js +8 -4
  110. package/dist/Editor/Elements/Title/title.js +10 -0
  111. package/dist/Editor/Elements/TopBanner/TopBannerButton.js +4 -1
  112. package/dist/Editor/Elements/Variables/VariableButton.js +10 -1
  113. package/dist/Editor/MiniEditor.js +10 -3
  114. package/dist/Editor/Styles/EditorStyles.js +5 -5
  115. package/dist/Editor/Toolbar/Basic/index.js +2 -1
  116. package/dist/Editor/Toolbar/FormatTools/BlockButton.js +6 -2
  117. package/dist/Editor/Toolbar/FormatTools/Dropdown.js +27 -3
  118. package/dist/Editor/Toolbar/FormatTools/FontFamilyAutocomplete.js +4 -3
  119. package/dist/Editor/Toolbar/FormatTools/MarkButton.js +8 -4
  120. package/dist/Editor/Toolbar/FormatTools/TextSize.js +10 -13
  121. package/dist/Editor/Toolbar/Mini/MiniToolbar.js +5 -3
  122. package/dist/Editor/Toolbar/PopupTool/AddTemplates.js +10 -5
  123. package/dist/Editor/Toolbar/PopupTool/ButtonTemplatesCard.js +10 -4
  124. package/dist/Editor/Toolbar/PopupTool/FullViewCard.js +10 -4
  125. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/MiniColorPicker.js +9 -3
  126. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectAlignment.js +42 -35
  127. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectFontSize.js +6 -13
  128. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectList.js +58 -51
  129. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectSuperSubscript.js +29 -22
  130. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectTypography.js +226 -87
  131. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/index.js +20 -10
  132. package/dist/Editor/Toolbar/PopupTool/PopperHeader.js +10 -5
  133. package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +71 -11
  134. package/dist/Editor/Toolbar/PopupTool/TemplateCard.js +11 -5
  135. package/dist/Editor/Toolbar/PopupTool/TextFormat.js +122 -42
  136. package/dist/Editor/Toolbar/PopupTool/ThemeTextFormat.js +436 -0
  137. package/dist/Editor/Toolbar/PopupTool/index.js +18 -8
  138. package/dist/Editor/Toolbar/Toolbar.js +20 -10
  139. package/dist/Editor/Toolbar/toolbarGroups.js +48 -6
  140. package/dist/Editor/assets/svg/ClearAllRounded.js +31 -0
  141. package/dist/Editor/assets/svg/ThemeIcons.js +291 -0
  142. package/dist/Editor/common/ColorPickerButton.js +39 -14
  143. package/dist/Editor/common/CustomColorPicker/index.js +131 -0
  144. package/dist/Editor/common/CustomColorPicker/style.js +53 -0
  145. package/dist/Editor/common/CustomDialog/index.js +8 -10
  146. package/dist/Editor/common/CustomDialog2/index.js +94 -0
  147. package/dist/Editor/common/CustomDialog2/style.js +67 -0
  148. package/dist/Editor/common/CustomSelect.js +43 -0
  149. package/dist/Editor/common/DnD/DragHandleButton.js +1 -1
  150. package/dist/Editor/common/FontLoader/FontLoader.js +3 -0
  151. package/dist/Editor/common/Icon.js +46 -1
  152. package/dist/Editor/common/ImageSelector/ImageSelector.js +10 -8
  153. package/dist/Editor/common/ImageSelector/Options/AddLink.js +6 -4
  154. package/dist/Editor/common/ImageSelector/Styles.js +3 -9
  155. package/dist/Editor/common/LinkSettings/NavComponents.js +14 -10
  156. package/dist/Editor/common/LinkSettings/index.js +20 -14
  157. package/dist/Editor/common/LinkSettings/navOptions.js +1 -1
  158. package/dist/Editor/common/MentionsPopup/index.js +6 -2
  159. package/dist/Editor/common/RnD/ContextMenu/CMenus.js +22 -22
  160. package/dist/Editor/common/RnD/ContextMenu/index.js +3 -2
  161. package/dist/Editor/common/RnD/ElementOptions/index.js +7 -2
  162. package/dist/Editor/common/RnD/ElementSettings/OtherSettings/SaveAsTemplate.js +8 -3
  163. package/dist/Editor/common/RnD/ElementSettings/OtherSettings/Settings.js +7 -3
  164. package/dist/Editor/common/RnD/ElementSettings/Settings/AppHeaderSettings.js +3 -2
  165. package/dist/Editor/common/RnD/ElementSettings/Settings/BoxSettings.js +3 -2
  166. package/dist/Editor/common/RnD/ElementSettings/Settings/ButtonSettings.js +3 -2
  167. package/dist/Editor/common/RnD/ElementSettings/Settings/CodeSettings.js +3 -2
  168. package/dist/Editor/common/RnD/ElementSettings/Settings/FormSettings.js +7 -4
  169. package/dist/Editor/common/RnD/ElementSettings/Settings/ImageSettings.js +3 -2
  170. package/dist/Editor/common/RnD/ElementSettings/Settings/TableSettings.js +3 -2
  171. package/dist/Editor/common/RnD/ElementSettings/Settings/TextSettings.js +6 -2
  172. package/dist/Editor/common/RnD/ElementSettings/Settings/VideoSettings.js +3 -2
  173. package/dist/Editor/common/RnD/OptionsPopup/index.js +4 -3
  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 +20 -8
  177. package/dist/Editor/common/RnD/Utils/gridDropItem.js +56 -7
  178. package/dist/Editor/common/RnD/Utils/index.js +3 -0
  179. package/dist/Editor/common/RnD/VirtualElement/ForceAutoAlignment.js +117 -0
  180. package/dist/Editor/common/RnD/VirtualElement/VirtualTextElement.js +134 -0
  181. package/dist/Editor/common/RnD/VirtualElement/helper.js +281 -0
  182. package/dist/Editor/common/RnD/VirtualElement/index.js +188 -105
  183. package/dist/Editor/common/RnD/VirtualElement/styles.js +123 -7
  184. package/dist/Editor/common/RnD/VirtualElement/updateAutoProps.js +5 -3
  185. package/dist/Editor/common/RnD/index.js +59 -7
  186. package/dist/Editor/common/Section/index.js +7 -4
  187. package/dist/Editor/common/Shorthands/elements.js +74 -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/menusArray.js +9 -6
  207. package/dist/Editor/common/StyleBuilder/fieldTypes/metaDataMapping.js +8 -2
  208. package/dist/Editor/common/StyleBuilder/fieldTypes/saveAsTemplate.js +12 -11
  209. package/dist/Editor/common/StyleBuilder/fieldTypes/selectBox.js +6 -2
  210. package/dist/Editor/common/StyleBuilder/fieldTypes/text.js +8 -4
  211. package/dist/Editor/common/StyleBuilder/fieldTypes/textAlign.js +6 -2
  212. package/dist/Editor/common/StyleBuilder/fieldTypes/textOptions.js +21 -12
  213. package/dist/Editor/common/StyleBuilder/formStyle.js +7 -7
  214. package/dist/Editor/common/StyleBuilder/gridItemStyle.js +6 -6
  215. package/dist/Editor/common/StyleBuilder/gridStyle.js +5 -5
  216. package/dist/Editor/common/StyleBuilder/index.js +8 -5
  217. package/dist/Editor/common/StyleBuilder/pageSettingsStyle.js +5 -7
  218. package/dist/Editor/common/Uploader.js +16 -5
  219. package/dist/Editor/commonStyle.js +68 -57
  220. package/dist/Editor/helper/index.js +35 -15
  221. package/dist/Editor/helper/textIndeces.js +58 -0
  222. package/dist/Editor/helper/theme.js +202 -2
  223. package/dist/Editor/hooks/useAutoScroll.js +38 -0
  224. package/dist/Editor/hooks/useDrag.js +16 -10
  225. package/dist/Editor/hooks/useEditorScroll.js +10 -5
  226. package/dist/Editor/hooks/useEditorTheme.js +153 -0
  227. package/dist/Editor/hooks/useMouseMove.js +25 -13
  228. package/dist/Editor/hooks/useTable.js +1 -1
  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 +10 -7
  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 +147 -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 +167 -48
  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 +2 -2
  255. package/dist/Editor/utils/helper.js +90 -19
  256. package/package.json +2 -2
@@ -0,0 +1,259 @@
1
+ const style = () => ({
2
+ ".fs-12": {
3
+ fontSize: "12px"
4
+ },
5
+ ".fs-14": {
6
+ fontSize: "14px"
7
+ },
8
+ ".fw-500": {
9
+ fontWeight: "500"
10
+ },
11
+ ".fw-600": {
12
+ fontWeight: "600"
13
+ },
14
+ ".pointer": {
15
+ cursor: "pointer"
16
+ },
17
+ ".transformNone": {
18
+ textTransform: "none"
19
+ },
20
+ ".settingsContainer": {
21
+ width: "340px",
22
+ padding: "16px 16px",
23
+ background: "#fff",
24
+ ".header": {
25
+ borderBottom: `1px solid #DCE4EC`,
26
+ paddingBottom: "8px"
27
+ // marginBottom: "16px",
28
+ }
29
+ },
30
+
31
+ ".title": {
32
+ fontWeight: "700",
33
+ fontSize: "14px"
34
+ },
35
+ ".closeBtn": {
36
+ width: "26px",
37
+ height: "26px",
38
+ BorderRadius: "4px",
39
+ flexShrik: "0",
40
+ padding: "4px",
41
+ background: " #F8FAFC",
42
+ borderRadius: "4px"
43
+ },
44
+ ".MuiTabs-scroller": {
45
+ borderBottom: `1px solid #DCE4EC`
46
+ },
47
+ ".themeCardWrapper": {
48
+ borderRadius: "4px",
49
+ ".active": {
50
+ background: "#ECF2FF"
51
+ }
52
+ },
53
+ ".primaryCard, .secondaryCard": {
54
+ width: "44px",
55
+ height: "44px",
56
+ borderRadius: "5px",
57
+ border: `1px solid #929292`
58
+ },
59
+ ".flexAlign": {
60
+ display: "flex",
61
+ alignItems: "center"
62
+ },
63
+ ".activeColorBox, .xsColorBox": {
64
+ width: "24px",
65
+ height: "24px",
66
+ borderRadius: "5px",
67
+ border: `1px solid #929292`
68
+ },
69
+ ".themeCard": {
70
+ borderRadius: "7px",
71
+ padding: "16px",
72
+ border: "1px solid #F3F3F3",
73
+ boxShadow: "1px 2px 5px 0px #00000014",
74
+ position: "relative",
75
+ flexWrap: "nowrap",
76
+ ".tickIcon": {
77
+ visibility: "hidden",
78
+ opacity: "0",
79
+ position: "absolute",
80
+ right: "-8px",
81
+ top: "-8px"
82
+ },
83
+ "&.selected": {
84
+ ".tickIcon": {
85
+ visibility: "visible",
86
+ opacity: "1"
87
+ }
88
+ }
89
+ },
90
+ ".otherColors": {
91
+ display: "flex",
92
+ flexWrap: "wrap",
93
+ width: "48px",
94
+ ".smallCard": {
95
+ width: "20px",
96
+ height: "20px",
97
+ borderRadius: "5px",
98
+ border: `1px solid #929292`
99
+ }
100
+ },
101
+ ".imageUpload": {
102
+ background: "#F3F3F3",
103
+ borderRadius: "12px",
104
+ padding: "10px",
105
+ height: "208px",
106
+ position: "relative",
107
+ "& .resetIcon": {
108
+ position: "absolute",
109
+ right: "10px",
110
+ top: "10px"
111
+ },
112
+ ".changeImgText": {
113
+ position: "absolute",
114
+ left: "50%",
115
+ top: "50%",
116
+ transform: "translate(-50%, -50%)",
117
+ zIndex: 1,
118
+ background: "#0000004D",
119
+ color: "#fff",
120
+ padding: "6px",
121
+ borderRadius: "6px",
122
+ fontSize: "12px",
123
+ fontWeight: 600,
124
+ opacity: "0",
125
+ visibility: "hidden"
126
+ },
127
+ "&:hover": {
128
+ ".changeImgText": {
129
+ opacity: "1",
130
+ visibility: "visible"
131
+ }
132
+ }
133
+ },
134
+ ".imgUploadInner": {
135
+ background: "#fff",
136
+ borderRadius: "10px",
137
+ border: "0.79px dashed #8360FD",
138
+ height: "100%"
139
+ },
140
+ ".outlineBtn": {
141
+ color: "#2563EB",
142
+ borderRadius: "8px",
143
+ boxShadow: "0px 4px 10px 0px #00000026",
144
+ border: "1px solid #2563EB",
145
+ background: "#EBF1F9",
146
+ height: "34px",
147
+ textTransform: "unset",
148
+ fontWeight: "bold",
149
+ "&:hover": {
150
+ background: "#EBF1F9"
151
+ }
152
+ },
153
+ ".seondaryOutlineBtn": {
154
+ border: "1px solid #D8DDE1",
155
+ borderRadius: "8px",
156
+ // boxShadow: "0px 4px 10px 0px #00000026",
157
+ height: "34px",
158
+ textTransform: "unset",
159
+ background: "#f5f6f9 !important",
160
+ color: "#64748B !important",
161
+ "&:hover": {
162
+ border: "1px solid #D8DDE1",
163
+ background: "#f5f6f9 !important"
164
+ }
165
+ },
166
+ ".blueBtn": {
167
+ boxShadow: "0px 4px 10px 0px #00000026",
168
+ background: "#2563EB",
169
+ borderRadius: "8px",
170
+ textTransform: "unset",
171
+ height: "34px",
172
+ color: "#fff",
173
+ fontWeight: "bold",
174
+ "&.disabled": {
175
+ background: "#D9D9DD !important",
176
+ color: "#fff !important"
177
+ }
178
+ },
179
+ ".generatedItem": {
180
+ border: "1px solid #E4E6E9",
181
+ borderRadius: "7px",
182
+ padding: "14px",
183
+ display: "flex",
184
+ gap: "16px",
185
+ position: "relative",
186
+ justifyContent: "space-between",
187
+ marginBottom: "12px",
188
+ ".tickIcon": {
189
+ visibility: "hidden",
190
+ opacity: "0",
191
+ position: "absolute",
192
+ right: "-8px",
193
+ top: "-8px"
194
+ },
195
+ "&.selected": {
196
+ border: "1px solid #2563EB",
197
+ boxShadow: " 3px 3px 8px 0px #2563EB40",
198
+ ".tickIcon": {
199
+ visibility: "visible",
200
+ opacity: "1"
201
+ }
202
+ },
203
+ ".colorBox": {
204
+ border: "1px solid #929292",
205
+ height: "28px",
206
+ width: "28px",
207
+ borderRadius: "5px"
208
+ }
209
+ },
210
+ ".textArea": {
211
+ background: "#F3F3F3",
212
+ borderRadius: "12px",
213
+ padding: "10px",
214
+ height: "208px",
215
+ "& textarea": {
216
+ width: "100%",
217
+ height: "100% !important",
218
+ border: "0.79px solid #8360FD",
219
+ background: "#FFFFFF",
220
+ borderRadius: "8px",
221
+ padding: "10px"
222
+ }
223
+ },
224
+ ".imageUrl": {
225
+ height: "auto !important",
226
+ ".MuiOutlinedInput-root": {
227
+ border: "0.79px solid #8360FD",
228
+ background: "#FFFFFF",
229
+ borderRadius: "8px",
230
+ ".tickIcon": {
231
+ width: "18px"
232
+ }
233
+ },
234
+ "&.invalidUrl": {
235
+ ".MuiInputAdornment-root": {
236
+ ".tickIcon": {
237
+ ".fillPath": {
238
+ fill: "#D9D9DD!important"
239
+ }
240
+ }
241
+ }
242
+ }
243
+ },
244
+ ".saveThemeContainer": {
245
+ ".MuiOutlinedInput-root": {
246
+ borderRadius: "8px",
247
+ boxShadow: "0px 4px 16px 0px #0000000D"
248
+ }
249
+ },
250
+ ".uploadedImage": {
251
+ width: "126px",
252
+ height: "126px",
253
+ borderRadius: "126px"
254
+ },
255
+ ".MuiDialog-paper": {
256
+ borderRadius: "10px"
257
+ }
258
+ });
259
+ export default style;
@@ -34,12 +34,12 @@ import SimpleText from "../Elements/SimpleText";
34
34
  import CheckList from "../Elements/List/CheckList";
35
35
  import { getTextColor, isEmptyTextNode } from "../helper";
36
36
  import Attachments from "../Elements/Attachments/Attachments";
37
- import { getBreakPointsValue, groupByBreakpoint } from "../helper/theme";
37
+ import { getBreakPointsValue, textThemeFields, getElementProperty } from "../helper/theme";
38
38
  import Variables from "../Elements/Variables/Variable";
39
- import insertNewLine from "./insertNewLine";
40
39
  import Divider from "../Elements/Divider/Divider";
41
40
  import { getBorderColor, getSlateDom } from "./helper";
42
41
  import Code from "../Elements/EmbedScript/Code";
42
+ import { ReactEditor } from "slate-react";
43
43
  import FreeGrid from "../Elements/FreeGrid/FreeGrid";
44
44
  import FreeGridItem from "../Elements/FreeGrid/FreeGridItem";
45
45
  import FreeGridBox from "../Elements/FreeGrid/FreeGridBox";
@@ -47,7 +47,7 @@ import DataView from "../Elements/DataView/DataView";
47
47
  import ViewData from "../Elements/DataView/Layouts/ViewData";
48
48
  import ColumnView from "../Elements/DataView/Layouts/ColumnView";
49
49
  import SearchAttachment from "../Elements/Search/SearchAttachment";
50
- // import { wrapThemeBreakpoints } from "../Elements/FreeGrid/breakpointConstants";
50
+ import { wrapThemeBreakpoints } from "../Elements/FreeGrid/breakpointConstants";
51
51
  import { jsx as _jsx } from "react/jsx-runtime";
52
52
  const alignment = ["alignLeft", "alignRight", "alignCenter", "alignJustify"];
53
53
  const list_types = ["orderedList", "unorderedList"];
@@ -56,6 +56,7 @@ const LIST_FORMAT_TYPE = {
56
56
  unorderedList: "list-item"
57
57
  };
58
58
  const NEWLINESAFTER = ["headingOne", "headingTwo", "headingThree", "headingFour", "headingFive", "headingSix"];
59
+ const THEME_BLOCK_FIELDS = ["headingOne", "headingTwo", "headingThree", "headingFour", "headingFive", "headingSix", "paragraphOne", "paragraphTwo", "paragraphThree"];
59
60
  export const toggleBlock = (editor, format, selection = true, attr = {}) => {
60
61
  const isActive = isBlockActive(editor, format);
61
62
  const isList = list_types.includes(format);
@@ -88,8 +89,9 @@ export const toggleBlock = (editor, format, selection = true, attr = {}) => {
88
89
  if (!selection) {
89
90
  Transforms.insertText(editor, "");
90
91
  }
92
+ const forActiveType = THEME_BLOCK_FIELDS.some(f => f === format) ? format : "paragraph";
91
93
  Transforms.setNodes(editor, {
92
- type: isActive ? "paragraph" : isList ? LIST_FORMAT_TYPE[format] : format,
94
+ type: isActive ? forActiveType : isList ? LIST_FORMAT_TYPE[format] : format,
93
95
  ...attr
94
96
  });
95
97
  if (isList && !isActive) {
@@ -98,10 +100,12 @@ export const toggleBlock = (editor, format, selection = true, attr = {}) => {
98
100
  children: []
99
101
  });
100
102
  }
101
- if (NEWLINESAFTER.indexOf(format) > -1) {
102
- insertNewLine(editor);
103
- }
103
+
104
+ // if (NEWLINESAFTER.indexOf(format) > -1) {
105
+ // insertNewLine(editor);
106
+ // }
104
107
  };
108
+
105
109
  export const addMarkData = (editor, data) => {
106
110
  try {
107
111
  Editor.addMark(editor, data.format, data.value);
@@ -110,9 +114,14 @@ export const addMarkData = (editor, data) => {
110
114
  }
111
115
  };
112
116
  export const toggleMark = (editor, format) => {
113
- const isActive = isMarkActive(editor, format);
117
+ const isActive = isMarkBtnActive(editor, format);
114
118
  if (isActive) {
115
- Editor.removeMark(editor, format);
119
+ const isThemeSupportedMark = textThemeFields.some(f => f === format);
120
+ if (isThemeSupportedMark) {
121
+ Editor.addMark(editor, format, false);
122
+ } else {
123
+ Editor.removeMark(editor, format);
124
+ }
116
125
  } else {
117
126
  Editor.addMark(editor, format, true);
118
127
  }
@@ -126,6 +135,58 @@ export const isMarkActive = (editor, format) => {
126
135
  return null;
127
136
  }
128
137
  };
138
+ export const isMarkBtnActive = (editor, format) => {
139
+ switch (format) {
140
+ case "bold":
141
+ {
142
+ const style = getSelectedElementStyle("font-weight", editor);
143
+ return style === "700";
144
+ }
145
+ case "italic":
146
+ {
147
+ const style = getSelectedElementStyle("font-style", editor);
148
+ return style === format;
149
+ }
150
+ // case "underline": {
151
+ // const style = getSelectedElementStyle("text-decoration");
152
+
153
+ // return style?.includes(format);
154
+ // }
155
+ // case "strikethrough": {
156
+ // const style = getSelectedElementStyle("text-decoration");
157
+
158
+ // return style?.includes("line-through");
159
+ // }
160
+ default:
161
+ return isMarkActive(editor, format);
162
+ }
163
+ };
164
+ export const getSelectedElementStyle = (styleProperty, editor, format) => {
165
+ try {
166
+ if (!editor.selection) {
167
+ return "";
168
+ }
169
+ if (Range.isCollapsed(editor.selection)) {
170
+ return "";
171
+ }
172
+ if (format) {
173
+ const value = activeMark(editor, format, true);
174
+ if (value) {
175
+ return value;
176
+ }
177
+ }
178
+ const domRange = ReactEditor.toDOMRange(editor, editor.selection);
179
+ const selectedDomNode = domRange.commonAncestorContainer;
180
+
181
+ // If it's a text node, get its parent element
182
+ const selectedElement = selectedDomNode.nodeType === 3 ? selectedDomNode.parentElement : selectedDomNode;
183
+ if (selectedElement) {
184
+ return getElementProperty(selectedElement, styleProperty);
185
+ }
186
+ } catch (err) {
187
+ console.log(err);
188
+ }
189
+ };
129
190
  export const isBlockActive = (editor, format) => {
130
191
  const [match] = Editor.nodes(editor, {
131
192
  match: n => !Editor.isEditor(n) && SlateElement.isElement(n) && n.type === format
@@ -151,7 +212,7 @@ export const upateBlockActive = (editor, format, attr = {}) => {
151
212
  });
152
213
  }
153
214
  };
154
- export const activeMark = (editor, format) => {
215
+ export const activeMark = (editor, format, noDefaultValue) => {
155
216
  const defaultMarkData = {
156
217
  color: "#000000",
157
218
  bgColor: "#FFFFFF",
@@ -161,7 +222,7 @@ export const activeMark = (editor, format) => {
161
222
  };
162
223
  try {
163
224
  const marks = Editor.marks(editor);
164
- let defaultValue = defaultMarkData[format];
225
+ let defaultValue = noDefaultValue ? "" : defaultMarkData[format];
165
226
  const {
166
227
  selection
167
228
  } = editor || {};
@@ -178,6 +239,31 @@ export const activeMark = (editor, format) => {
178
239
  return null;
179
240
  }
180
241
  };
242
+
243
+ // to avoid the styles, that automatically assign from themes
244
+ const getThemeMarkedLeaf = (leaf, children) => {
245
+ const {
246
+ italic,
247
+ bold
248
+ } = leaf || {};
249
+ const style = {};
250
+ if (italic === false) {
251
+ style.fontStyle = "normal";
252
+ }
253
+ if (bold === false) {
254
+ style.fontWeight = "normal";
255
+ }
256
+ if (Object.keys(style).length) {
257
+ children = /*#__PURE__*/_jsx(Box, {
258
+ component: "span",
259
+ sx: {
260
+ "& span": style
261
+ },
262
+ children: children
263
+ });
264
+ }
265
+ return children;
266
+ };
181
267
  export const getMarked = (leaf, children, theme) => {
182
268
  const className = leaf?.doublequote ? "doublequote" : "";
183
269
  if (leaf.highlight) {
@@ -204,6 +290,7 @@ export const getMarked = (leaf, children, theme) => {
204
290
  children: children
205
291
  });
206
292
  }
293
+ children = getThemeMarkedLeaf(leaf, children);
207
294
  if (leaf.strikethrough) {
208
295
  children = /*#__PURE__*/_jsx("span", {
209
296
  style: {
@@ -231,20 +318,27 @@ export const getMarked = (leaf, children, theme) => {
231
318
  if (leaf.color || leaf.bgColor || leaf.fontSize || leaf.fontFamily || leaf.fontWeight || className) {
232
319
  const family = leaf?.fontFamily;
233
320
  const textStyles = getTextColor(leaf?.color);
321
+ const fontSize = {
322
+ lg: sizeMap[leaf.fontSize] || leaf.fontSize,
323
+ ...getBreakPointsValue(leaf.fontSize, null, "overrideText")
324
+ };
325
+ const fontSizesImportant = {};
326
+ Object.entries(fontSize).forEach(([key, value]) => {
327
+ fontSizesImportant[key] = `${value} !important`;
328
+ });
329
+ const fontSizeWithBreakpoints = wrapThemeBreakpoints(fontSizesImportant, "fontSize", theme);
234
330
  children = /*#__PURE__*/_jsx("span", {
235
- style: {
236
- background: leaf.bgColor
237
- },
238
331
  children: /*#__PURE__*/_jsx(Box, {
239
- className: className,
332
+ className: `${className} leaf-item`,
240
333
  component: "span",
241
334
  sx: {
242
- ...groupByBreakpoint({
243
- fontSize: {
244
- lg: sizeMap[leaf.fontSize] || leaf.fontSize,
245
- ...getBreakPointsValue(leaf.fontSize, null, "overrideText")
246
- }
247
- }, theme),
335
+ "& span": {
336
+ // fontSize: fontSizesImportant,
337
+ // ...groupByBreakpoint(fontSizesImportant, theme),
338
+ background: leaf.bgColor,
339
+ ...fontSizeWithBreakpoints
340
+ },
341
+ ...fontSizeWithBreakpoints,
248
342
  // ...wrapThemeBreakpoints(
249
343
  // {
250
344
  // lg: sizeMap[leaf.fontSize] || leaf.fontSize,
@@ -257,11 +351,16 @@ export const getMarked = (leaf, children, theme) => {
257
351
  // lg: sizeMap[leaf.fontSize] || leaf.fontSize,
258
352
  // ...getBreakPointsValue(leaf.fontSize, null, "overrideText"),
259
353
  // },
260
- ...textStyles,
354
+ '& span[data-slate-string="true"]': {
355
+ ...textStyles
356
+ },
261
357
  fontFamily: family,
262
358
  fontWeight: leaf.fontWeight,
263
359
  WebkitTextFillColor: "unset !important"
264
360
  },
361
+ style: {
362
+ "--fontSize_xs": leaf?.fontSize?.xs || "auto"
363
+ },
265
364
  children: children
266
365
  })
267
366
  });
@@ -283,57 +382,77 @@ export const getMarked = (leaf, children, theme) => {
283
382
  export const getBlock = props => {
284
383
  const {
285
384
  element,
286
- children
385
+ children,
386
+ customProps
287
387
  } = props;
288
388
  const attributes = props.attributes ?? {};
289
389
  const isEmpty = isEmptyTextNode(element);
390
+ const {
391
+ translation
392
+ } = customProps;
393
+ const commonHeadingProps = () => ({
394
+ ...attributes,
395
+ ...element.attr,
396
+ className: `edt-headings content-editable ${isEmpty ? "empty" : ""} theme-element`
397
+ });
398
+ const commonParaProps = paraType => ({
399
+ ...attributes,
400
+ ...element.attr,
401
+ className: `edt-paragraphs content-editable ${isEmpty ? "empty" : ""} theme-element ${paraType}`
402
+ });
290
403
  switch (element.type) {
291
404
  case "headingOne":
292
405
  return /*#__PURE__*/_jsx("h1", {
293
- ...attributes,
294
- ...element.attr,
295
- className: `edt-headings content-editable ${isEmpty ? "empty" : ""}`,
296
- placeholder: "Heading 1",
406
+ ...commonHeadingProps(),
407
+ placeholder: translation("Heading 1"),
297
408
  children: children
298
409
  });
299
410
  case "headingTwo":
300
411
  return /*#__PURE__*/_jsx("h2", {
301
- ...attributes,
302
- ...element.attr,
303
- className: `edt-headings content-editable ${isEmpty ? "empty" : ""}`,
304
- placeholder: "Heading 2",
412
+ ...commonHeadingProps(),
413
+ placeholder: translation("Heading 2"),
305
414
  children: children
306
415
  });
307
416
  case "headingThree":
308
417
  return /*#__PURE__*/_jsx("h3", {
309
- ...attributes,
310
- ...element.attr,
311
- className: `edt-headings content-editable ${isEmpty ? "empty" : ""}`,
312
- placeholder: "Heading 3",
418
+ ...commonHeadingProps(),
419
+ placeholder: translation("Heading 3"),
313
420
  children: children
314
421
  });
315
422
  case "headingFour":
316
423
  return /*#__PURE__*/_jsx("h4", {
317
- ...attributes,
318
- ...element.attr,
319
- className: `edt-headings content-editable ${isEmpty ? "empty" : ""}`,
320
- placeholder: "Heading 4",
424
+ ...commonHeadingProps(),
425
+ placeholder: translation("Heading 4"),
321
426
  children: children
322
427
  });
323
428
  case "headingFive":
324
429
  return /*#__PURE__*/_jsx("h5", {
325
- ...attributes,
326
- ...element.attr,
327
- className: `edt-headings content-editable ${isEmpty ? "empty" : ""}`,
328
- placeholder: "Heading 5",
430
+ ...commonHeadingProps(),
431
+ placeholder: translation("Heading 5"),
329
432
  children: children
330
433
  });
331
434
  case "headingSix":
332
435
  return /*#__PURE__*/_jsx("h6", {
333
- ...attributes,
334
- ...element.attr,
335
- className: `edt-headings content-editable ${isEmpty ? "empty" : ""}`,
336
- placeholder: "Heading 6",
436
+ ...commonHeadingProps(),
437
+ placeholder: translation("Heading 6"),
438
+ children: children
439
+ });
440
+ case "paragraphOne":
441
+ return /*#__PURE__*/_jsx("p", {
442
+ ...commonParaProps("para1"),
443
+ placeholder: "Paragraph 1",
444
+ children: children
445
+ });
446
+ case "paragraphTwo":
447
+ return /*#__PURE__*/_jsx("p", {
448
+ ...commonParaProps("para2"),
449
+ placeholder: "Paragraph 2",
450
+ children: children
451
+ });
452
+ case "paragraphThree":
453
+ return /*#__PURE__*/_jsx("p", {
454
+ ...commonParaProps("para3"),
455
+ placeholder: "Paragraph 3",
337
456
  children: children
338
457
  });
339
458
  case "blockquote":
@@ -401,7 +520,7 @@ export const getBlock = props => {
401
520
  ...attributes,
402
521
  ...element.attr,
403
522
  className: `content-editable ${isEmpty ? "empty" : ""}`,
404
- placeholder: "List",
523
+ placeholder: translation("List"),
405
524
  style: {
406
525
  color: firstChildren?.color
407
526
  },
@@ -82,7 +82,8 @@ const splitInlineStyleRanges = (text, inlineStyleRanges, data) => {
82
82
  };
83
83
  export const draftToSlate = props => {
84
84
  const {
85
- data
85
+ data,
86
+ needLayout
86
87
  } = props;
87
88
  if (data?.blocks && data?.blocks?.length > 0) {
88
89
  const converted = data?.blocks?.reduce((a, b) => {
@@ -104,7 +105,7 @@ export const draftToSlate = props => {
104
105
  return data;
105
106
  } else {
106
107
  return [{
107
- type: "paragraph",
108
+ type: needLayout ? "title" : "paragraph",
108
109
  children: [{
109
110
  text: ""
110
111
  }]