@flozy/editor 9.6.7 → 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 (250) 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 +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 -18
  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 +16 -11
  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 +24 -15
  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 +22 -10
  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 +122 -42
  131. package/dist/Editor/Toolbar/PopupTool/ThemeTextFormat.js +436 -0
  132. package/dist/Editor/Toolbar/PopupTool/index.js +17 -1
  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/Styles.js +3 -9
  150. package/dist/Editor/common/LinkSettings/NavComponents.js +14 -10
  151. package/dist/Editor/common/LinkSettings/index.js +20 -14
  152. package/dist/Editor/common/LinkSettings/navOptions.js +1 -1
  153. package/dist/Editor/common/MentionsPopup/index.js +6 -2
  154. package/dist/Editor/common/RnD/ContextMenu/CMenus.js +22 -22
  155. package/dist/Editor/common/RnD/ContextMenu/index.js +3 -2
  156. package/dist/Editor/common/RnD/ElementOptions/index.js +7 -2
  157. package/dist/Editor/common/RnD/ElementSettings/OtherSettings/SaveAsTemplate.js +8 -3
  158. package/dist/Editor/common/RnD/ElementSettings/OtherSettings/Settings.js +7 -3
  159. package/dist/Editor/common/RnD/ElementSettings/Settings/AppHeaderSettings.js +3 -2
  160. package/dist/Editor/common/RnD/ElementSettings/Settings/BoxSettings.js +3 -2
  161. package/dist/Editor/common/RnD/ElementSettings/Settings/ButtonSettings.js +3 -2
  162. package/dist/Editor/common/RnD/ElementSettings/Settings/CodeSettings.js +3 -2
  163. package/dist/Editor/common/RnD/ElementSettings/Settings/FormSettings.js +7 -4
  164. package/dist/Editor/common/RnD/ElementSettings/Settings/ImageSettings.js +3 -2
  165. package/dist/Editor/common/RnD/ElementSettings/Settings/TableSettings.js +3 -2
  166. package/dist/Editor/common/RnD/ElementSettings/Settings/TextSettings.js +6 -2
  167. package/dist/Editor/common/RnD/ElementSettings/Settings/VideoSettings.js +3 -2
  168. package/dist/Editor/common/RnD/OptionsPopup/index.js +4 -3
  169. package/dist/Editor/common/RnD/ShadowElement.js +2 -1
  170. package/dist/Editor/common/RnD/SwitchViewport/SwitchViewport.js +11 -4
  171. package/dist/Editor/common/RnD/Theme/MainThemeProvider.js +17 -0
  172. package/dist/Editor/common/RnD/Theme/ViewportStimulator.js +6 -3
  173. package/dist/Editor/common/RnD/Utils/gridDropItem.js +55 -8
  174. package/dist/Editor/common/RnD/Utils/index.js +3 -0
  175. package/dist/Editor/common/RnD/VirtualElement/BoxHeaderAutoAlignment.js +43 -0
  176. package/dist/Editor/common/RnD/VirtualElement/ForceAutoAlignment.js +44 -0
  177. package/dist/Editor/common/RnD/VirtualElement/VirtualTextElement.js +134 -0
  178. package/dist/Editor/common/RnD/VirtualElement/helper.js +375 -0
  179. package/dist/Editor/common/RnD/VirtualElement/index.js +187 -103
  180. package/dist/Editor/common/RnD/VirtualElement/styles.js +151 -7
  181. package/dist/Editor/common/RnD/VirtualElement/updateAutoProps.js +5 -3
  182. package/dist/Editor/common/RnD/index.js +64 -13
  183. package/dist/Editor/common/Section/index.js +7 -4
  184. package/dist/Editor/common/Shorthands/elements.js +74 -3
  185. package/dist/Editor/common/SnackBar/index.js +43 -0
  186. package/dist/Editor/common/StyleBuilder/appHeaderStyle.js +4 -4
  187. package/dist/Editor/common/StyleBuilder/boxStyle.js +2 -2
  188. package/dist/Editor/common/StyleBuilder/buttonStyle.js +6 -4
  189. package/dist/Editor/common/StyleBuilder/dividerStyles.js +2 -2
  190. package/dist/Editor/common/StyleBuilder/embedVideoStyle.js +6 -6
  191. package/dist/Editor/common/StyleBuilder/fieldStyle.js +2 -2
  192. package/dist/Editor/common/StyleBuilder/fieldTypes/alignment.js +13 -9
  193. package/dist/Editor/common/StyleBuilder/fieldTypes/backgroundImage.js +11 -3
  194. package/dist/Editor/common/StyleBuilder/fieldTypes/bannerSpacing.js +19 -5
  195. package/dist/Editor/common/StyleBuilder/fieldTypes/borderRadius.js +22 -10
  196. package/dist/Editor/common/StyleBuilder/fieldTypes/buttonLink.js +6 -3
  197. package/dist/Editor/common/StyleBuilder/fieldTypes/card.js +27 -13
  198. package/dist/Editor/common/StyleBuilder/fieldTypes/color.js +43 -14
  199. package/dist/Editor/common/StyleBuilder/fieldTypes/elementSize.js +10 -6
  200. package/dist/Editor/common/StyleBuilder/fieldTypes/fontSize.js +19 -6
  201. package/dist/Editor/common/StyleBuilder/fieldTypes/gridSize.js +6 -2
  202. package/dist/Editor/common/StyleBuilder/fieldTypes/icons.js +5 -2
  203. package/dist/Editor/common/StyleBuilder/fieldTypes/menusArray.js +9 -6
  204. package/dist/Editor/common/StyleBuilder/fieldTypes/metaDataMapping.js +8 -2
  205. package/dist/Editor/common/StyleBuilder/fieldTypes/saveAsTemplate.js +12 -11
  206. package/dist/Editor/common/StyleBuilder/fieldTypes/selectBox.js +6 -2
  207. package/dist/Editor/common/StyleBuilder/fieldTypes/text.js +8 -4
  208. package/dist/Editor/common/StyleBuilder/fieldTypes/textAlign.js +6 -2
  209. package/dist/Editor/common/StyleBuilder/fieldTypes/textOptions.js +21 -12
  210. package/dist/Editor/common/StyleBuilder/formStyle.js +7 -7
  211. package/dist/Editor/common/StyleBuilder/gridItemStyle.js +6 -6
  212. package/dist/Editor/common/StyleBuilder/gridStyle.js +5 -5
  213. package/dist/Editor/common/StyleBuilder/index.js +8 -5
  214. package/dist/Editor/common/StyleBuilder/pageSettingsStyle.js +5 -7
  215. package/dist/Editor/common/Uploader.js +16 -5
  216. package/dist/Editor/commonStyle.js +68 -57
  217. package/dist/Editor/helper/index.js +27 -3
  218. package/dist/Editor/helper/textIndeces.js +58 -0
  219. package/dist/Editor/helper/theme.js +202 -2
  220. package/dist/Editor/hooks/useAutoScroll.js +38 -0
  221. package/dist/Editor/hooks/useEditorTheme.js +153 -0
  222. package/dist/Editor/hooks/useMouseMove.js +9 -3
  223. package/dist/Editor/hooks/useThemeValues.js +63 -0
  224. package/dist/Editor/plugins/withEmbeds.js +1 -1
  225. package/dist/Editor/plugins/withHTML.js +10 -7
  226. package/dist/Editor/plugins/withLayout.js +3 -2
  227. package/dist/Editor/plugins/withTable.js +1 -1
  228. package/dist/Editor/theme/ThemeList.js +50 -173
  229. package/dist/Editor/theme/index.js +149 -0
  230. package/dist/Editor/themeSettings/ActiveTheme.js +72 -0
  231. package/dist/Editor/themeSettings/buttons/index.js +290 -0
  232. package/dist/Editor/themeSettings/buttons/style.js +23 -0
  233. package/dist/Editor/themeSettings/colorTheme/index.js +310 -0
  234. package/dist/Editor/themeSettings/colorTheme/style.js +81 -0
  235. package/dist/Editor/themeSettings/fonts/PreviewElement.js +121 -0
  236. package/dist/Editor/themeSettings/fonts/index.js +240 -0
  237. package/dist/Editor/themeSettings/fonts/style.js +61 -0
  238. package/dist/Editor/themeSettings/icons.js +60 -0
  239. package/dist/Editor/themeSettings/index.js +351 -0
  240. package/dist/Editor/themeSettings/style.js +220 -0
  241. package/dist/Editor/themeSettingsAI/icons.js +96 -0
  242. package/dist/Editor/themeSettingsAI/index.js +355 -0
  243. package/dist/Editor/themeSettingsAI/saveTheme.js +205 -0
  244. package/dist/Editor/themeSettingsAI/style.js +259 -0
  245. package/dist/Editor/utils/SlateUtilityFunctions.js +202 -61
  246. package/dist/Editor/utils/draftToSlate.js +3 -2
  247. package/dist/Editor/utils/font.js +40 -37
  248. package/dist/Editor/utils/freegrid.js +3 -3
  249. package/dist/Editor/utils/helper.js +92 -21
  250. 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;
@@ -1,4 +1,4 @@
1
- import { Editor, Transforms, Element as SlateElement, Range, Text, Element } from "slate";
1
+ import { Editor, Transforms, Element as SlateElement, Range } from "slate";
2
2
  import { Box } from "@mui/material";
3
3
  import { sizeMap } from "./font";
4
4
  import Link from "../Elements/Link/Link";
@@ -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,15 +47,26 @@ 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
+ import { jsxs as _jsxs } from "react/jsx-runtime";
52
53
  const alignment = ["alignLeft", "alignRight", "alignCenter", "alignJustify"];
53
54
  const list_types = ["orderedList", "unorderedList"];
54
55
  const LIST_FORMAT_TYPE = {
55
56
  orderedList: "list-item",
56
57
  unorderedList: "list-item"
57
58
  };
58
- const NEWLINESAFTER = ["headingOne", "headingTwo", "headingThree", "headingFour", "headingFive", "headingSix"];
59
+
60
+ // const NEWLINESAFTER = [
61
+ // "headingOne",
62
+ // "headingTwo",
63
+ // "headingThree",
64
+ // "headingFour",
65
+ // "headingFive",
66
+ // "headingSix",
67
+ // ];
68
+
69
+ const THEME_BLOCK_FIELDS = ["headingOne", "headingTwo", "headingThree", "headingFour", "headingFive", "headingSix", "paragraphOne", "paragraphTwo", "paragraphThree"];
59
70
  export const toggleBlock = (editor, format, selection = true, attr = {}) => {
60
71
  const isActive = isBlockActive(editor, format);
61
72
  const isList = list_types.includes(format);
@@ -88,8 +99,9 @@ export const toggleBlock = (editor, format, selection = true, attr = {}) => {
88
99
  if (!selection) {
89
100
  Transforms.insertText(editor, "");
90
101
  }
102
+ const forActiveType = THEME_BLOCK_FIELDS.some(f => f === format) ? format : "paragraph";
91
103
  Transforms.setNodes(editor, {
92
- type: isActive ? "paragraph" : isList ? LIST_FORMAT_TYPE[format] : format,
104
+ type: isActive ? forActiveType : isList ? LIST_FORMAT_TYPE[format] : format,
93
105
  ...attr
94
106
  });
95
107
  if (isList && !isActive) {
@@ -98,10 +110,12 @@ export const toggleBlock = (editor, format, selection = true, attr = {}) => {
98
110
  children: []
99
111
  });
100
112
  }
101
- if (NEWLINESAFTER.indexOf(format) > -1) {
102
- insertNewLine(editor);
103
- }
113
+
114
+ // if (NEWLINESAFTER.indexOf(format) > -1) {
115
+ // insertNewLine(editor);
116
+ // }
104
117
  };
118
+
105
119
  export const addMarkData = (editor, data) => {
106
120
  try {
107
121
  Editor.addMark(editor, data.format, data.value);
@@ -110,9 +124,14 @@ export const addMarkData = (editor, data) => {
110
124
  }
111
125
  };
112
126
  export const toggleMark = (editor, format) => {
113
- const isActive = isMarkActive(editor, format);
127
+ const isActive = isMarkBtnActive(editor, format);
114
128
  if (isActive) {
115
- Editor.removeMark(editor, format);
129
+ const isThemeSupportedMark = textThemeFields.some(f => f === format);
130
+ if (isThemeSupportedMark) {
131
+ Editor.addMark(editor, format, false);
132
+ } else {
133
+ Editor.removeMark(editor, format);
134
+ }
116
135
  } else {
117
136
  Editor.addMark(editor, format, true);
118
137
  }
@@ -126,6 +145,58 @@ export const isMarkActive = (editor, format) => {
126
145
  return null;
127
146
  }
128
147
  };
148
+ export const isMarkBtnActive = (editor, format) => {
149
+ switch (format) {
150
+ case "bold":
151
+ {
152
+ const style = getSelectedElementStyle("font-weight", editor);
153
+ return style === "700";
154
+ }
155
+ case "italic":
156
+ {
157
+ const style = getSelectedElementStyle("font-style", editor);
158
+ return style === format;
159
+ }
160
+ // case "underline": {
161
+ // const style = getSelectedElementStyle("text-decoration");
162
+
163
+ // return style?.includes(format);
164
+ // }
165
+ // case "strikethrough": {
166
+ // const style = getSelectedElementStyle("text-decoration");
167
+
168
+ // return style?.includes("line-through");
169
+ // }
170
+ default:
171
+ return isMarkActive(editor, format);
172
+ }
173
+ };
174
+ export const getSelectedElementStyle = (styleProperty, editor, format) => {
175
+ try {
176
+ if (!editor.selection) {
177
+ return "";
178
+ }
179
+ if (Range.isCollapsed(editor.selection)) {
180
+ return "";
181
+ }
182
+ if (format) {
183
+ const value = activeMark(editor, format, true);
184
+ if (value) {
185
+ return value;
186
+ }
187
+ }
188
+ const domRange = ReactEditor.toDOMRange(editor, editor.selection);
189
+ const selectedDomNode = domRange.commonAncestorContainer;
190
+
191
+ // If it's a text node, get its parent element
192
+ const selectedElement = selectedDomNode.nodeType === 3 ? selectedDomNode.parentElement : selectedDomNode;
193
+ if (selectedElement) {
194
+ return getElementProperty(selectedElement, styleProperty);
195
+ }
196
+ } catch (err) {
197
+ console.log(err);
198
+ }
199
+ };
129
200
  export const isBlockActive = (editor, format) => {
130
201
  const [match] = Editor.nodes(editor, {
131
202
  match: n => !Editor.isEditor(n) && SlateElement.isElement(n) && n.type === format
@@ -151,7 +222,7 @@ export const upateBlockActive = (editor, format, attr = {}) => {
151
222
  });
152
223
  }
153
224
  };
154
- export const activeMark = (editor, format) => {
225
+ export const activeMark = (editor, format, noDefaultValue) => {
155
226
  const defaultMarkData = {
156
227
  color: "#000000",
157
228
  bgColor: "#FFFFFF",
@@ -161,7 +232,7 @@ export const activeMark = (editor, format) => {
161
232
  };
162
233
  try {
163
234
  const marks = Editor.marks(editor);
164
- let defaultValue = defaultMarkData[format];
235
+ let defaultValue = noDefaultValue ? "" : defaultMarkData[format];
165
236
  const {
166
237
  selection
167
238
  } = editor || {};
@@ -178,6 +249,31 @@ export const activeMark = (editor, format) => {
178
249
  return null;
179
250
  }
180
251
  };
252
+
253
+ // to avoid the styles, that automatically assign from themes
254
+ const getThemeMarkedLeaf = (leaf, children) => {
255
+ const {
256
+ italic,
257
+ bold
258
+ } = leaf || {};
259
+ const style = {};
260
+ if (italic === false) {
261
+ style.fontStyle = "normal";
262
+ }
263
+ if (bold === false) {
264
+ style.fontWeight = "normal";
265
+ }
266
+ if (Object.keys(style).length) {
267
+ children = /*#__PURE__*/_jsx(Box, {
268
+ component: "span",
269
+ sx: {
270
+ "& span": style
271
+ },
272
+ children: children
273
+ });
274
+ }
275
+ return children;
276
+ };
181
277
  export const getMarked = (leaf, children, theme) => {
182
278
  const className = leaf?.doublequote ? "doublequote" : "";
183
279
  if (leaf.highlight) {
@@ -204,6 +300,7 @@ export const getMarked = (leaf, children, theme) => {
204
300
  children: children
205
301
  });
206
302
  }
303
+ children = getThemeMarkedLeaf(leaf, children);
207
304
  if (leaf.strikethrough) {
208
305
  children = /*#__PURE__*/_jsx("span", {
209
306
  style: {
@@ -231,20 +328,27 @@ export const getMarked = (leaf, children, theme) => {
231
328
  if (leaf.color || leaf.bgColor || leaf.fontSize || leaf.fontFamily || leaf.fontWeight || className) {
232
329
  const family = leaf?.fontFamily;
233
330
  const textStyles = getTextColor(leaf?.color);
331
+ const fontSize = {
332
+ lg: sizeMap[leaf.fontSize] || leaf.fontSize,
333
+ ...getBreakPointsValue(leaf.fontSize, null, "overrideText")
334
+ };
335
+ const fontSizesImportant = {};
336
+ Object.entries(fontSize).forEach(([key, value]) => {
337
+ fontSizesImportant[key] = `${value} !important`;
338
+ });
339
+ const fontSizeWithBreakpoints = wrapThemeBreakpoints(fontSizesImportant, "fontSize", theme);
234
340
  children = /*#__PURE__*/_jsx("span", {
235
- style: {
236
- background: leaf.bgColor
237
- },
238
341
  children: /*#__PURE__*/_jsx(Box, {
239
- className: className,
342
+ className: `${className} leaf-item`,
240
343
  component: "span",
241
344
  sx: {
242
- ...groupByBreakpoint({
243
- fontSize: {
244
- lg: sizeMap[leaf.fontSize] || leaf.fontSize,
245
- ...getBreakPointsValue(leaf.fontSize, null, "overrideText")
246
- }
247
- }, theme),
345
+ "& span": {
346
+ // fontSize: fontSizesImportant,
347
+ // ...groupByBreakpoint(fontSizesImportant, theme),
348
+ background: leaf.bgColor,
349
+ ...fontSizeWithBreakpoints
350
+ },
351
+ ...fontSizeWithBreakpoints,
248
352
  // ...wrapThemeBreakpoints(
249
353
  // {
250
354
  // lg: sizeMap[leaf.fontSize] || leaf.fontSize,
@@ -257,11 +361,16 @@ export const getMarked = (leaf, children, theme) => {
257
361
  // lg: sizeMap[leaf.fontSize] || leaf.fontSize,
258
362
  // ...getBreakPointsValue(leaf.fontSize, null, "overrideText"),
259
363
  // },
260
- ...textStyles,
364
+ '& span[data-slate-string="true"]': {
365
+ ...textStyles
366
+ },
261
367
  fontFamily: family,
262
368
  fontWeight: leaf.fontWeight,
263
369
  WebkitTextFillColor: "unset !important"
264
370
  },
371
+ style: {
372
+ "--fontSize_xs": leaf?.fontSize?.xs || "auto"
373
+ },
265
374
  children: children
266
375
  })
267
376
  });
@@ -283,57 +392,89 @@ export const getMarked = (leaf, children, theme) => {
283
392
  export const getBlock = props => {
284
393
  const {
285
394
  element,
286
- children
395
+ children,
396
+ customProps
287
397
  } = props;
288
398
  const attributes = props.attributes ?? {};
289
399
  const isEmpty = isEmptyTextNode(element);
400
+ const {
401
+ translation
402
+ } = customProps;
403
+ const commonHeadingProps = () => ({
404
+ ...attributes,
405
+ ...element.attr,
406
+ className: `edt-headings content-editable ${isEmpty ? "empty" : ""} theme-element`
407
+ });
408
+ const commonParaProps = paraType => ({
409
+ ...attributes,
410
+ ...element.attr,
411
+ className: `edt-paragraphs content-editable ${isEmpty ? "empty" : ""} theme-element ${paraType}`
412
+ });
290
413
  switch (element.type) {
291
414
  case "headingOne":
292
- return /*#__PURE__*/_jsx("h1", {
293
- ...attributes,
294
- ...element.attr,
295
- className: `edt-headings content-editable ${isEmpty ? "empty" : ""}`,
296
- placeholder: "Heading 1",
297
- children: children
415
+ return /*#__PURE__*/_jsxs("h1", {
416
+ ...commonHeadingProps(),
417
+ placeholder: translation("Heading 1"),
418
+ children: [children, /*#__PURE__*/_jsx("span", {
419
+ contentEditable: false
420
+ })]
298
421
  });
299
422
  case "headingTwo":
300
- return /*#__PURE__*/_jsx("h2", {
301
- ...attributes,
302
- ...element.attr,
303
- className: `edt-headings content-editable ${isEmpty ? "empty" : ""}`,
304
- placeholder: "Heading 2",
305
- children: children
423
+ return /*#__PURE__*/_jsxs("h2", {
424
+ ...commonHeadingProps(),
425
+ placeholder: translation("Heading 2"),
426
+ children: [children, /*#__PURE__*/_jsx("span", {
427
+ contentEditable: false
428
+ })]
306
429
  });
307
430
  case "headingThree":
308
- return /*#__PURE__*/_jsx("h3", {
309
- ...attributes,
310
- ...element.attr,
311
- className: `edt-headings content-editable ${isEmpty ? "empty" : ""}`,
312
- placeholder: "Heading 3",
313
- children: children
431
+ return /*#__PURE__*/_jsxs("h3", {
432
+ ...commonHeadingProps(),
433
+ placeholder: translation("Heading 3"),
434
+ children: [children, /*#__PURE__*/_jsx("span", {
435
+ contentEditable: false
436
+ })]
314
437
  });
315
438
  case "headingFour":
316
- return /*#__PURE__*/_jsx("h4", {
317
- ...attributes,
318
- ...element.attr,
319
- className: `edt-headings content-editable ${isEmpty ? "empty" : ""}`,
320
- placeholder: "Heading 4",
321
- children: children
439
+ return /*#__PURE__*/_jsxs("h4", {
440
+ ...commonHeadingProps(),
441
+ placeholder: translation("Heading 4"),
442
+ children: [children, /*#__PURE__*/_jsx("span", {
443
+ contentEditable: false
444
+ })]
322
445
  });
323
446
  case "headingFive":
324
- return /*#__PURE__*/_jsx("h5", {
325
- ...attributes,
326
- ...element.attr,
327
- className: `edt-headings content-editable ${isEmpty ? "empty" : ""}`,
328
- placeholder: "Heading 5",
329
- children: children
447
+ return /*#__PURE__*/_jsxs("h5", {
448
+ ...commonHeadingProps(),
449
+ placeholder: translation("Heading 5"),
450
+ children: [children, /*#__PURE__*/_jsx("span", {
451
+ contentEditable: false
452
+ })]
330
453
  });
331
454
  case "headingSix":
332
- return /*#__PURE__*/_jsx("h6", {
333
- ...attributes,
334
- ...element.attr,
335
- className: `edt-headings content-editable ${isEmpty ? "empty" : ""}`,
336
- placeholder: "Heading 6",
455
+ return /*#__PURE__*/_jsxs("h6", {
456
+ ...commonHeadingProps(),
457
+ placeholder: translation("Heading 6"),
458
+ children: [children, /*#__PURE__*/_jsx("span", {
459
+ contentEditable: false
460
+ })]
461
+ });
462
+ case "paragraphOne":
463
+ return /*#__PURE__*/_jsx("p", {
464
+ ...commonParaProps("para1"),
465
+ placeholder: "Paragraph 1",
466
+ children: children
467
+ });
468
+ case "paragraphTwo":
469
+ return /*#__PURE__*/_jsx("p", {
470
+ ...commonParaProps("para2"),
471
+ placeholder: "Paragraph 2",
472
+ children: children
473
+ });
474
+ case "paragraphThree":
475
+ return /*#__PURE__*/_jsx("p", {
476
+ ...commonParaProps("para3"),
477
+ placeholder: "Paragraph 3",
337
478
  children: children
338
479
  });
339
480
  case "blockquote":
@@ -401,7 +542,7 @@ export const getBlock = props => {
401
542
  ...attributes,
402
543
  ...element.attr,
403
544
  className: `content-editable ${isEmpty ? "empty" : ""}`,
404
- placeholder: "List",
545
+ placeholder: translation("List"),
405
546
  style: {
406
547
  color: firstChildren?.color
407
548
  },
@@ -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
  }]