@flozy/editor 10.1.1 → 10.1.3
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.
- package/dist/Editor/ChatEditor.js +17 -16
- package/dist/Editor/CommonEditor.js +115 -15
- package/dist/Editor/DialogWrapper.js +31 -25
- package/dist/Editor/Editor.css +16 -8
- package/dist/Editor/Elements/AI/PopoverAIInput.js +11 -3
- package/dist/Editor/Elements/AppHeader/AppHeader.js +3 -3
- package/dist/Editor/Elements/Button/EditorButton.js +25 -9
- package/dist/Editor/Elements/Color Picker/ColorButtons.js +61 -14
- package/dist/Editor/Elements/Color Picker/ColorPicker.css +25 -1
- package/dist/Editor/Elements/Color Picker/ColorPicker.js +10 -7
- package/dist/Editor/Elements/Color Picker/Styles.js +15 -13
- package/dist/Editor/Elements/DataView/Layouts/ColumnView.js +4 -2
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/MultiSelect.js +454 -0
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/MultiSelectType.js +21 -6
- package/dist/Editor/Elements/DataView/Layouts/Options/AddOptions.js +5 -1
- package/dist/Editor/Elements/DataView/Layouts/Options/EditOption.js +3 -2
- package/dist/Editor/Elements/DataView/Layouts/Options/index.js +11 -0
- package/dist/Editor/Elements/DataView/Layouts/ViewData.js +8 -4
- package/dist/Editor/Elements/Embed/Image.js +3 -2
- package/dist/Editor/Elements/Embed/Video.js +1 -1
- package/dist/Editor/Elements/EmbedScript/Code.js +14 -2
- package/dist/Editor/Elements/EmbedScript/EmbedScriptPopup.js +57 -28
- package/dist/Editor/Elements/EmbedScript/styles.js +89 -0
- package/dist/Editor/Elements/Form/Form.js +181 -168
- package/dist/Editor/Elements/Form/FormElements/FormText.js +23 -6
- package/dist/Editor/Elements/Form/FormElements/FormTextArea.js +3 -2
- package/dist/Editor/Elements/Form/FormField.js +13 -6
- package/dist/Editor/Elements/Form/Workflow/Styles.js +24 -22
- package/dist/Editor/Elements/FreeGrid/FreeGrid.js +6 -24
- package/dist/Editor/Elements/FreeGrid/FreeGridBox.js +7 -4
- package/dist/Editor/Elements/FreeGrid/Options/More.js +8 -8
- package/dist/Editor/Elements/FreeGrid/styles.js +67 -7
- package/dist/Editor/Elements/Grid/GridItem.js +1 -1
- package/dist/Editor/Elements/List/CheckList.js +4 -1
- package/dist/Editor/Elements/Search/SearchAttachment.js +40 -9
- package/dist/Editor/Elements/Search/SearchButton.js +9 -8
- package/dist/Editor/Elements/Search/SearchList.js +9 -7
- package/dist/Editor/Elements/SimpleText/index.js +6 -1
- package/dist/Editor/Elements/SimpleText/style.js +2 -2
- package/dist/Editor/Elements/Table/Table.js +3 -3
- package/dist/Editor/Elements/Title/title.js +6 -6
- package/dist/Editor/Elements/Variables/VariableButton.js +10 -1
- package/dist/Editor/MiniEditor.js +2 -1
- package/dist/Editor/Styles/EditorStyles.js +5 -5
- package/dist/Editor/Toolbar/FormatTools/Dropdown.js +27 -3
- package/dist/Editor/Toolbar/FormatTools/FontFamilyAutocomplete.js +4 -3
- package/dist/Editor/Toolbar/FormatTools/MarkButton.js +2 -2
- package/dist/Editor/Toolbar/FormatTools/TextSize.js +10 -13
- package/dist/Editor/Toolbar/Mini/MiniToolbar.js +2 -1
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/MiniColorPicker.js +4 -2
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectFontSize.js +6 -13
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectTypography.js +167 -42
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/index.js +7 -4
- package/dist/Editor/Toolbar/PopupTool/PopperHeader.js +2 -1
- package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +72 -12
- package/dist/Editor/Toolbar/PopupTool/TextFormat.js +100 -27
- package/dist/Editor/Toolbar/PopupTool/ThemeTextFormat.js +439 -0
- package/dist/Editor/Toolbar/PopupTool/index.js +1 -1
- package/dist/Editor/Toolbar/toolbarGroups.js +48 -6
- package/dist/Editor/assets/svg/BackIcon.js +18 -0
- package/dist/Editor/assets/svg/ClearAllRounded.js +31 -0
- package/dist/Editor/assets/svg/ResetIconNew.js +23 -0
- package/dist/Editor/assets/svg/SettingsIcon.js +1 -0
- package/dist/Editor/assets/svg/ThemeIcons.js +293 -0
- package/dist/Editor/common/ColorPickerButton.js +38 -16
- package/dist/Editor/common/CustomColorPicker/index.js +130 -0
- package/dist/Editor/common/CustomColorPicker/style.js +53 -0
- package/dist/Editor/common/CustomDialog2/index.js +94 -0
- package/dist/Editor/common/CustomDialog2/style.js +67 -0
- package/dist/Editor/common/CustomSelect.js +43 -0
- package/dist/Editor/common/DnD/DragHandleButton.js +1 -1
- package/dist/Editor/common/FontLoader/FontLoader.js +3 -0
- package/dist/Editor/common/Icon.js +31 -1
- package/dist/Editor/common/ImageSelector/Styles.js +3 -9
- package/dist/Editor/common/LinkSettings/NavComponents.js +34 -8
- package/dist/Editor/common/LinkSettings/index.js +84 -68
- package/dist/Editor/common/LinkSettings/style.js +245 -30
- package/dist/Editor/common/RnD/ElementOptions/Actions.js +13 -14
- package/dist/Editor/common/RnD/ElementOptions/Icons/LinkIcon.js +1 -0
- package/dist/Editor/common/RnD/ElementOptions/index.js +2 -2
- package/dist/Editor/common/RnD/ElementOptions/styles.js +28 -1
- package/dist/Editor/common/RnD/ElementSettings/OtherSettings/Settings.js +6 -5
- package/dist/Editor/common/RnD/ElementSettings/Settings/AppHeaderSettings.js +3 -2
- package/dist/Editor/common/RnD/ElementSettings/Settings/BoxSettings.js +3 -2
- package/dist/Editor/common/RnD/ElementSettings/Settings/ButtonSettings.js +3 -2
- package/dist/Editor/common/RnD/ElementSettings/Settings/CodeSettings.js +3 -2
- package/dist/Editor/common/RnD/ElementSettings/Settings/FormSettings.js +4 -2
- package/dist/Editor/common/RnD/ElementSettings/Settings/ImageSettings.js +3 -2
- package/dist/Editor/common/RnD/ElementSettings/Settings/TableSettings.js +3 -2
- package/dist/Editor/common/RnD/ElementSettings/Settings/TextSettings.js +3 -1
- package/dist/Editor/common/RnD/ElementSettings/Settings/VideoSettings.js +3 -2
- package/dist/Editor/common/RnD/ElementSettings/styles.js +147 -12
- package/dist/Editor/common/RnD/OptionsPopup/index.js +8 -5
- package/dist/Editor/common/RnD/OptionsPopup/style.js +121 -19
- package/dist/Editor/common/RnD/SwitchViewport/SwitchViewport.js +8 -5
- package/dist/Editor/common/RnD/Theme/MainThemeProvider.js +17 -0
- package/dist/Editor/common/RnD/Theme/ViewportStimulator.js +6 -3
- package/dist/Editor/common/RnD/Utils/gridDropItem.js +1 -2
- package/dist/Editor/common/RnD/index.js +6 -7
- package/dist/Editor/common/Select/index.js +2 -0
- package/dist/Editor/common/Shorthands/elements.js +54 -0
- package/dist/Editor/common/SnackBar/index.js +43 -0
- package/dist/Editor/common/StyleBuilder/buttonStyle.js +4 -2
- package/dist/Editor/common/StyleBuilder/fieldTypes/backgroundImage.js +5 -0
- package/dist/Editor/common/StyleBuilder/fieldTypes/bannerSpacing.js +12 -2
- package/dist/Editor/common/StyleBuilder/fieldTypes/borderRadius.js +15 -7
- package/dist/Editor/common/StyleBuilder/fieldTypes/card.js +16 -8
- package/dist/Editor/common/StyleBuilder/fieldTypes/color.js +36 -10
- package/dist/Editor/common/StyleBuilder/fieldTypes/fontSize.js +16 -7
- package/dist/Editor/common/StyleBuilder/fieldTypes/lineSpacing.js +7 -6
- package/dist/Editor/common/StyleBuilder/fieldTypes/menusArray.js +13 -6
- package/dist/Editor/common/StyleBuilder/fieldTypes/textOptions.js +15 -7
- package/dist/Editor/common/StyleBuilder/pageSettingsStyle.js +5 -7
- package/dist/Editor/common/Uploader.js +8 -0
- package/dist/Editor/common/iconListV2.js +101 -6
- package/dist/Editor/common/iconslist.js +24 -0
- package/dist/Editor/commonStyle.js +165 -61
- package/dist/Editor/helper/textIndeces.js +58 -0
- package/dist/Editor/helper/theme.js +203 -2
- package/dist/Editor/hooks/useEditorTheme.js +153 -0
- package/dist/Editor/hooks/useMouseMove.js +8 -5
- package/dist/Editor/hooks/useThemeValues.js +63 -0
- package/dist/Editor/plugins/withEmbeds.js +1 -1
- package/dist/Editor/plugins/withHTML.js +3 -1
- package/dist/Editor/plugins/withTable.js +1 -1
- package/dist/Editor/theme/ThemeList.js +50 -173
- package/dist/Editor/theme/index.js +149 -0
- package/dist/Editor/themeSettings/ActiveTheme.js +72 -0
- package/dist/Editor/themeSettings/buttons/index.js +290 -0
- package/dist/Editor/themeSettings/buttons/style.js +23 -0
- package/dist/Editor/themeSettings/colorTheme/index.js +309 -0
- package/dist/Editor/themeSettings/colorTheme/style.js +81 -0
- package/dist/Editor/themeSettings/fonts/PreviewElement.js +121 -0
- package/dist/Editor/themeSettings/fonts/index.js +240 -0
- package/dist/Editor/themeSettings/fonts/style.js +62 -0
- package/dist/Editor/themeSettings/icons.js +60 -0
- package/dist/Editor/themeSettings/index.js +361 -0
- package/dist/Editor/themeSettings/style.js +292 -0
- package/dist/Editor/themeSettingsAI/icons.js +96 -0
- package/dist/Editor/themeSettingsAI/index.js +355 -0
- package/dist/Editor/themeSettingsAI/saveTheme.js +202 -0
- package/dist/Editor/themeSettingsAI/style.js +324 -0
- package/dist/Editor/utils/SlateUtilityFunctions.js +166 -43
- package/dist/Editor/utils/button.js +1 -17
- package/dist/Editor/utils/draftToSlate.js +3 -2
- package/dist/Editor/utils/font.js +40 -37
- package/dist/Editor/utils/form.js +4 -4
- package/dist/Editor/utils/formfield.js +8 -2
- package/dist/Editor/utils/helper.js +90 -19
- package/package.json +4 -4
@@ -0,0 +1,324 @@
|
|
1
|
+
const style = ({
|
2
|
+
appTheme: theme
|
3
|
+
}) => ({
|
4
|
+
".fs-12": {
|
5
|
+
fontSize: "12px"
|
6
|
+
},
|
7
|
+
".fs-14": {
|
8
|
+
fontSize: "14px"
|
9
|
+
},
|
10
|
+
".fw-500": {
|
11
|
+
fontWeight: "500"
|
12
|
+
},
|
13
|
+
".fw-600": {
|
14
|
+
fontWeight: "600"
|
15
|
+
},
|
16
|
+
".pointer": {
|
17
|
+
cursor: "pointer"
|
18
|
+
},
|
19
|
+
".transformNone": {
|
20
|
+
textTransform: "none"
|
21
|
+
},
|
22
|
+
".settingsContainer": {
|
23
|
+
width: "340px",
|
24
|
+
padding: "16px 16px",
|
25
|
+
background: "#fff",
|
26
|
+
".header": {
|
27
|
+
borderBottom: `1px solid #DCE4EC`,
|
28
|
+
paddingBottom: "8px"
|
29
|
+
// marginBottom: "16px",
|
30
|
+
}
|
31
|
+
},
|
32
|
+
|
33
|
+
".title": {
|
34
|
+
fontWeight: "700",
|
35
|
+
fontSize: "14px"
|
36
|
+
},
|
37
|
+
".closeBtn": {
|
38
|
+
width: "26px",
|
39
|
+
height: "26px",
|
40
|
+
BorderRadius: "4px",
|
41
|
+
flexShrik: "0",
|
42
|
+
padding: "4px",
|
43
|
+
background: " #F8FAFC",
|
44
|
+
borderRadius: "4px"
|
45
|
+
},
|
46
|
+
".MuiTabs-scroller": {
|
47
|
+
borderBottom: `1px solid #DCE4EC`
|
48
|
+
},
|
49
|
+
".themeCardWrapper": {
|
50
|
+
borderRadius: "4px",
|
51
|
+
".active": {
|
52
|
+
background: "#ECF2FF"
|
53
|
+
}
|
54
|
+
},
|
55
|
+
".primaryCard, .secondaryCard": {
|
56
|
+
width: "44px",
|
57
|
+
height: "44px",
|
58
|
+
borderRadius: "5px",
|
59
|
+
border: `1px solid #929292`
|
60
|
+
},
|
61
|
+
".flexAlign": {
|
62
|
+
display: "flex",
|
63
|
+
alignItems: "center"
|
64
|
+
},
|
65
|
+
".activeColorBox, .xsColorBox": {
|
66
|
+
width: "24px",
|
67
|
+
height: "24px",
|
68
|
+
borderRadius: "5px",
|
69
|
+
border: `1px solid #929292`
|
70
|
+
},
|
71
|
+
".themeCard": {
|
72
|
+
borderRadius: "7px",
|
73
|
+
padding: "16px",
|
74
|
+
border: "1px solid #F3F3F3",
|
75
|
+
boxShadow: "1px 2px 5px 0px #00000014",
|
76
|
+
position: "relative",
|
77
|
+
flexWrap: "nowrap",
|
78
|
+
".tickIcon": {
|
79
|
+
visibility: "hidden",
|
80
|
+
opacity: "0",
|
81
|
+
position: "absolute",
|
82
|
+
right: "-8px",
|
83
|
+
top: "-8px"
|
84
|
+
},
|
85
|
+
"&.selected": {
|
86
|
+
".tickIcon": {
|
87
|
+
visibility: "visible",
|
88
|
+
opacity: "1"
|
89
|
+
}
|
90
|
+
}
|
91
|
+
},
|
92
|
+
".otherColors": {
|
93
|
+
display: "flex",
|
94
|
+
flexWrap: "wrap",
|
95
|
+
width: "48px",
|
96
|
+
".smallCard": {
|
97
|
+
width: "20px",
|
98
|
+
height: "20px",
|
99
|
+
borderRadius: "5px",
|
100
|
+
border: `1px solid #929292`
|
101
|
+
}
|
102
|
+
},
|
103
|
+
".imageUpload": {
|
104
|
+
background: "#F3F3F3",
|
105
|
+
borderRadius: "12px",
|
106
|
+
padding: "10px",
|
107
|
+
height: "208px",
|
108
|
+
position: "relative",
|
109
|
+
"& .resetIcon": {
|
110
|
+
position: "absolute",
|
111
|
+
right: "10px",
|
112
|
+
top: "10px"
|
113
|
+
},
|
114
|
+
".changeImgText": {
|
115
|
+
position: "absolute",
|
116
|
+
left: "50%",
|
117
|
+
top: "50%",
|
118
|
+
transform: "translate(-50%, -50%)",
|
119
|
+
zIndex: 1,
|
120
|
+
background: "#0000004D",
|
121
|
+
color: "#fff",
|
122
|
+
padding: "6px",
|
123
|
+
borderRadius: "6px",
|
124
|
+
fontSize: "12px",
|
125
|
+
fontWeight: 600,
|
126
|
+
opacity: "0",
|
127
|
+
visibility: "hidden"
|
128
|
+
},
|
129
|
+
"&:hover": {
|
130
|
+
".changeImgText": {
|
131
|
+
opacity: "1",
|
132
|
+
visibility: "visible"
|
133
|
+
}
|
134
|
+
}
|
135
|
+
},
|
136
|
+
".imgUploadInner": {
|
137
|
+
background: "#fff",
|
138
|
+
borderRadius: "10px",
|
139
|
+
border: "0.79px dashed #8360FD",
|
140
|
+
height: "100%"
|
141
|
+
},
|
142
|
+
".outlineBtn": {
|
143
|
+
color: "#2563EB",
|
144
|
+
borderRadius: "10px",
|
145
|
+
boxShadow: "0px 4px 10px 0px #00000026",
|
146
|
+
border: "1px solid #2563EB",
|
147
|
+
background: "#EBF1F9",
|
148
|
+
height: "34px",
|
149
|
+
textTransform: "unset",
|
150
|
+
fontWeight: "bold",
|
151
|
+
"&:hover": {
|
152
|
+
background: "#EBF1F9"
|
153
|
+
}
|
154
|
+
},
|
155
|
+
".seondaryOutlineBtn": {
|
156
|
+
border: "1px solid #D8DDE1",
|
157
|
+
borderRadius: "8px",
|
158
|
+
// boxShadow: "0px 4px 10px 0px #00000026",
|
159
|
+
height: "34px",
|
160
|
+
textTransform: "unset",
|
161
|
+
background: "#f5f6f9 !important",
|
162
|
+
color: "#64748B !important",
|
163
|
+
"&:hover": {
|
164
|
+
border: "1px solid #D8DDE1",
|
165
|
+
background: "#f5f6f9 !important"
|
166
|
+
}
|
167
|
+
},
|
168
|
+
".blueBtn": {
|
169
|
+
boxShadow: "0px 4px 10px 0px #00000026",
|
170
|
+
background: "#2563EB",
|
171
|
+
borderRadius: "8px",
|
172
|
+
textTransform: "unset",
|
173
|
+
height: "34px",
|
174
|
+
color: "#fff",
|
175
|
+
fontWeight: "bold",
|
176
|
+
"&.disabled": {
|
177
|
+
background: "#D9D9DD !important",
|
178
|
+
color: "#fff !important"
|
179
|
+
}
|
180
|
+
},
|
181
|
+
".generatedItem": {
|
182
|
+
border: "1px solid #E4E6E9",
|
183
|
+
borderRadius: "7px",
|
184
|
+
padding: "14px",
|
185
|
+
display: "flex",
|
186
|
+
gap: "16px",
|
187
|
+
position: "relative",
|
188
|
+
justifyContent: "space-between",
|
189
|
+
marginBottom: "12px",
|
190
|
+
".tickIcon": {
|
191
|
+
visibility: "hidden",
|
192
|
+
opacity: "0",
|
193
|
+
position: "absolute",
|
194
|
+
right: "-8px",
|
195
|
+
top: "-8px"
|
196
|
+
},
|
197
|
+
"&.selected": {
|
198
|
+
border: "1px solid #2563EB",
|
199
|
+
boxShadow: " 3px 3px 8px 0px #2563EB40",
|
200
|
+
".tickIcon": {
|
201
|
+
visibility: "visible",
|
202
|
+
opacity: "1"
|
203
|
+
}
|
204
|
+
},
|
205
|
+
".colorBox": {
|
206
|
+
border: "1px solid #929292",
|
207
|
+
height: "28px",
|
208
|
+
width: "28px",
|
209
|
+
borderRadius: "5px"
|
210
|
+
}
|
211
|
+
},
|
212
|
+
".textArea": {
|
213
|
+
background: "#F3F3F3",
|
214
|
+
borderRadius: "12px",
|
215
|
+
padding: "10px",
|
216
|
+
height: "208px",
|
217
|
+
"& textarea": {
|
218
|
+
width: "100%",
|
219
|
+
height: "100% !important",
|
220
|
+
border: "0.79px solid #8360FD",
|
221
|
+
background: "#FFFFFF",
|
222
|
+
borderRadius: "8px",
|
223
|
+
padding: "10px"
|
224
|
+
}
|
225
|
+
},
|
226
|
+
".imageUrl": {
|
227
|
+
height: "auto !important",
|
228
|
+
".MuiOutlinedInput-root": {
|
229
|
+
border: "0.79px solid #8360FD",
|
230
|
+
background: "#FFFFFF",
|
231
|
+
borderRadius: "8px",
|
232
|
+
".tickIcon": {
|
233
|
+
width: "18px"
|
234
|
+
}
|
235
|
+
},
|
236
|
+
"&.invalidUrl": {
|
237
|
+
".MuiInputAdornment-root": {
|
238
|
+
".tickIcon": {
|
239
|
+
".fillPath": {
|
240
|
+
fill: "#D9D9DD!important"
|
241
|
+
}
|
242
|
+
}
|
243
|
+
}
|
244
|
+
}
|
245
|
+
},
|
246
|
+
".saveThemeContainer": {
|
247
|
+
".MuiOutlinedInput-root": {
|
248
|
+
borderRadius: "8px",
|
249
|
+
boxShadow: "0px 4px 16px 0px #0000000D"
|
250
|
+
}
|
251
|
+
},
|
252
|
+
".uploadedImage": {
|
253
|
+
width: "126px",
|
254
|
+
height: "126px",
|
255
|
+
borderRadius: "126px"
|
256
|
+
},
|
257
|
+
".MuiDialog-paper": {
|
258
|
+
borderRadius: "10px",
|
259
|
+
background: theme?.palette?.editor?.miniToolBarBackground
|
260
|
+
},
|
261
|
+
"& .MuiInputBase-root": {
|
262
|
+
borderRadius: "8px",
|
263
|
+
background: theme?.palette?.editor?.inputFieldBgColor,
|
264
|
+
border: `none`,
|
265
|
+
height: "40px",
|
266
|
+
boxShadow: "0px 4px 16px 0px #0000000D",
|
267
|
+
fontFamily: "Inter, sans-serif",
|
268
|
+
"&:hover .MuiOutlinedInput-notchedOutline": {
|
269
|
+
border: `1px solid ${theme?.palette?.editor?.inputFieldBorder}`
|
270
|
+
},
|
271
|
+
"& input::placeholder": {
|
272
|
+
color: "#94A3B8 !important",
|
273
|
+
opacity: "unset",
|
274
|
+
fontFamily: "Inter, sans-serif"
|
275
|
+
},
|
276
|
+
"& .colorPickerButton": {
|
277
|
+
border: `2px solid ${theme?.palette?.editor?.buttonBorder2} !important`
|
278
|
+
}
|
279
|
+
},
|
280
|
+
"& .MuiInputBase-root:has(.colorPickerButton)": {
|
281
|
+
"& .MuiInputBase-input": {
|
282
|
+
padding: "8.5px 14px 8.5px 0px",
|
283
|
+
fontFamily: "Inter, sans-serif"
|
284
|
+
}
|
285
|
+
},
|
286
|
+
"& .MuiInputBase-input": {
|
287
|
+
color: theme?.palette?.editor?.deletePopUpButtonTextColor,
|
288
|
+
textTransform: "math-auto",
|
289
|
+
fontFamily: "Inter, sans-serif"
|
290
|
+
},
|
291
|
+
"& .MuiOutlinedInput-notchedOutline": {
|
292
|
+
border: `1px solid ${theme?.palette?.editor?.inputFieldBorder}`
|
293
|
+
},
|
294
|
+
"& fieldset": {
|
295
|
+
border: `1px solid transparent`,
|
296
|
+
borderRadius: "8px"
|
297
|
+
},
|
298
|
+
"& .saveThemeActionBtns": {
|
299
|
+
"& button": {
|
300
|
+
fontWeight: 600,
|
301
|
+
fontSize: "14px",
|
302
|
+
opacity: 1,
|
303
|
+
borderRadius: "8px",
|
304
|
+
textTransform: "math-auto",
|
305
|
+
padding: "4px 20px",
|
306
|
+
height: "fit-content",
|
307
|
+
minWidth: "90px",
|
308
|
+
"@media only screen and (max-width: 899px)": {
|
309
|
+
width: "50%"
|
310
|
+
},
|
311
|
+
"&.confirmBtn": {
|
312
|
+
backgroundColor: "#2563EB",
|
313
|
+
color: "#ffffff",
|
314
|
+
border: `1px solid #2563EB`
|
315
|
+
},
|
316
|
+
"&.cancelBtn": {
|
317
|
+
backgroundColor: theme?.palette?.editor?.closeButtonBackground,
|
318
|
+
color: theme?.palette?.editor?.customDialogueCloseBtnColor,
|
319
|
+
border: `1px solid ${theme?.palette?.editor?.customDialogueCloseBtnBorder}`
|
320
|
+
}
|
321
|
+
}
|
322
|
+
}
|
323
|
+
});
|
324
|
+
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,
|
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
|
-
|
50
|
+
import { wrapThemeBreakpoints } from "../Elements/FreeGrid/breakpointConstants";
|
51
51
|
import { jsx as _jsx } from "react/jsx-runtime";
|
52
52
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
53
53
|
const alignment = ["alignLeft", "alignRight", "alignCenter", "alignJustify"];
|
@@ -56,7 +56,17 @@ const LIST_FORMAT_TYPE = {
|
|
56
56
|
orderedList: "list-item",
|
57
57
|
unorderedList: "list-item"
|
58
58
|
};
|
59
|
-
|
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"];
|
60
70
|
export const toggleBlock = (editor, format, selection = true, attr = {}) => {
|
61
71
|
const isActive = isBlockActive(editor, format);
|
62
72
|
const isList = list_types.includes(format);
|
@@ -89,8 +99,9 @@ export const toggleBlock = (editor, format, selection = true, attr = {}) => {
|
|
89
99
|
if (!selection) {
|
90
100
|
Transforms.insertText(editor, "");
|
91
101
|
}
|
102
|
+
const forActiveType = THEME_BLOCK_FIELDS.some(f => f === format) ? format : "paragraph";
|
92
103
|
Transforms.setNodes(editor, {
|
93
|
-
type: isActive ?
|
104
|
+
type: isActive ? forActiveType : isList ? LIST_FORMAT_TYPE[format] : format,
|
94
105
|
...attr
|
95
106
|
});
|
96
107
|
if (isList && !isActive) {
|
@@ -99,10 +110,12 @@ export const toggleBlock = (editor, format, selection = true, attr = {}) => {
|
|
99
110
|
children: []
|
100
111
|
});
|
101
112
|
}
|
102
|
-
|
103
|
-
|
104
|
-
|
113
|
+
|
114
|
+
// if (NEWLINESAFTER.indexOf(format) > -1) {
|
115
|
+
// insertNewLine(editor);
|
116
|
+
// }
|
105
117
|
};
|
118
|
+
|
106
119
|
export const addMarkData = (editor, data) => {
|
107
120
|
try {
|
108
121
|
Editor.addMark(editor, data.format, data.value);
|
@@ -111,9 +124,14 @@ export const addMarkData = (editor, data) => {
|
|
111
124
|
}
|
112
125
|
};
|
113
126
|
export const toggleMark = (editor, format) => {
|
114
|
-
const isActive =
|
127
|
+
const isActive = isMarkBtnActive(editor, format);
|
115
128
|
if (isActive) {
|
116
|
-
|
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
|
+
}
|
117
135
|
} else {
|
118
136
|
Editor.addMark(editor, format, true);
|
119
137
|
}
|
@@ -127,6 +145,58 @@ export const isMarkActive = (editor, format) => {
|
|
127
145
|
return null;
|
128
146
|
}
|
129
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
|
+
};
|
130
200
|
export const isBlockActive = (editor, format) => {
|
131
201
|
const [match] = Editor.nodes(editor, {
|
132
202
|
match: n => !Editor.isEditor(n) && SlateElement.isElement(n) && n.type === format
|
@@ -152,7 +222,7 @@ export const upateBlockActive = (editor, format, attr = {}) => {
|
|
152
222
|
});
|
153
223
|
}
|
154
224
|
};
|
155
|
-
export const activeMark = (editor, format) => {
|
225
|
+
export const activeMark = (editor, format, noDefaultValue) => {
|
156
226
|
const defaultMarkData = {
|
157
227
|
color: "#000000",
|
158
228
|
bgColor: "#FFFFFF",
|
@@ -162,7 +232,7 @@ export const activeMark = (editor, format) => {
|
|
162
232
|
};
|
163
233
|
try {
|
164
234
|
const marks = Editor.marks(editor);
|
165
|
-
let defaultValue = defaultMarkData[format];
|
235
|
+
let defaultValue = noDefaultValue ? "" : defaultMarkData[format];
|
166
236
|
const {
|
167
237
|
selection
|
168
238
|
} = editor || {};
|
@@ -179,6 +249,31 @@ export const activeMark = (editor, format) => {
|
|
179
249
|
return null;
|
180
250
|
}
|
181
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
|
+
};
|
182
277
|
export const getMarked = (leaf, children, theme) => {
|
183
278
|
const className = leaf?.doublequote ? "doublequote" : "";
|
184
279
|
if (leaf.highlight) {
|
@@ -205,6 +300,7 @@ export const getMarked = (leaf, children, theme) => {
|
|
205
300
|
children: children
|
206
301
|
});
|
207
302
|
}
|
303
|
+
children = getThemeMarkedLeaf(leaf, children);
|
208
304
|
if (leaf.strikethrough) {
|
209
305
|
children = /*#__PURE__*/_jsx("span", {
|
210
306
|
style: {
|
@@ -232,20 +328,27 @@ export const getMarked = (leaf, children, theme) => {
|
|
232
328
|
if (leaf.color || leaf.bgColor || leaf.fontSize || leaf.fontFamily || leaf.fontWeight || className) {
|
233
329
|
const family = leaf?.fontFamily;
|
234
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);
|
235
340
|
children = /*#__PURE__*/_jsx("span", {
|
236
|
-
style: {
|
237
|
-
background: leaf.bgColor
|
238
|
-
},
|
239
341
|
children: /*#__PURE__*/_jsx(Box, {
|
240
342
|
className: `${className} leaf-item`,
|
241
343
|
component: "span",
|
242
344
|
sx: {
|
243
|
-
|
244
|
-
fontSize:
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
},
|
345
|
+
"& span": {
|
346
|
+
// fontSize: fontSizesImportant,
|
347
|
+
// ...groupByBreakpoint(fontSizesImportant, theme),
|
348
|
+
background: leaf.bgColor,
|
349
|
+
...fontSizeWithBreakpoints
|
350
|
+
},
|
351
|
+
...fontSizeWithBreakpoints,
|
249
352
|
// ...wrapThemeBreakpoints(
|
250
353
|
// {
|
251
354
|
// lg: sizeMap[leaf.fontSize] || leaf.fontSize,
|
@@ -292,17 +395,28 @@ export const getBlock = props => {
|
|
292
395
|
children,
|
293
396
|
customProps
|
294
397
|
} = props;
|
398
|
+
const {
|
399
|
+
customLineHeight
|
400
|
+
} = customProps || {};
|
295
401
|
const attributes = props.attributes ?? {};
|
296
402
|
const isEmpty = isEmptyTextNode(element);
|
297
403
|
const {
|
298
404
|
translation
|
299
405
|
} = customProps;
|
406
|
+
const commonHeadingProps = () => ({
|
407
|
+
...attributes,
|
408
|
+
...element.attr,
|
409
|
+
className: `edt-headings content-editable ${isEmpty ? "empty" : ""} theme-element`
|
410
|
+
});
|
411
|
+
const commonParaProps = paraType => ({
|
412
|
+
...attributes,
|
413
|
+
...element.attr,
|
414
|
+
className: `edt-paragraphs content-editable ${isEmpty ? "empty" : ""} theme-element ${paraType}`
|
415
|
+
});
|
300
416
|
switch (element.type) {
|
301
417
|
case "headingOne":
|
302
418
|
return /*#__PURE__*/_jsxs("h1", {
|
303
|
-
...
|
304
|
-
...element.attr,
|
305
|
-
className: `edt-headings content-editable ${isEmpty ? "empty" : ""}`,
|
419
|
+
...commonHeadingProps(),
|
306
420
|
placeholder: translation("Heading 1"),
|
307
421
|
children: [children, /*#__PURE__*/_jsx("span", {
|
308
422
|
contentEditable: false
|
@@ -310,9 +424,7 @@ export const getBlock = props => {
|
|
310
424
|
});
|
311
425
|
case "headingTwo":
|
312
426
|
return /*#__PURE__*/_jsxs("h2", {
|
313
|
-
...
|
314
|
-
...element.attr,
|
315
|
-
className: `edt-headings content-editable ${isEmpty ? "empty" : ""}`,
|
427
|
+
...commonHeadingProps(),
|
316
428
|
placeholder: translation("Heading 2"),
|
317
429
|
children: [children, /*#__PURE__*/_jsx("span", {
|
318
430
|
contentEditable: false
|
@@ -320,9 +432,7 @@ export const getBlock = props => {
|
|
320
432
|
});
|
321
433
|
case "headingThree":
|
322
434
|
return /*#__PURE__*/_jsxs("h3", {
|
323
|
-
...
|
324
|
-
...element.attr,
|
325
|
-
className: `edt-headings content-editable ${isEmpty ? "empty" : ""}`,
|
435
|
+
...commonHeadingProps(),
|
326
436
|
placeholder: translation("Heading 3"),
|
327
437
|
children: [children, /*#__PURE__*/_jsx("span", {
|
328
438
|
contentEditable: false
|
@@ -330,9 +440,7 @@ export const getBlock = props => {
|
|
330
440
|
});
|
331
441
|
case "headingFour":
|
332
442
|
return /*#__PURE__*/_jsxs("h4", {
|
333
|
-
...
|
334
|
-
...element.attr,
|
335
|
-
className: `edt-headings content-editable ${isEmpty ? "empty" : ""}`,
|
443
|
+
...commonHeadingProps(),
|
336
444
|
placeholder: translation("Heading 4"),
|
337
445
|
children: [children, /*#__PURE__*/_jsx("span", {
|
338
446
|
contentEditable: false
|
@@ -340,9 +448,7 @@ export const getBlock = props => {
|
|
340
448
|
});
|
341
449
|
case "headingFive":
|
342
450
|
return /*#__PURE__*/_jsxs("h5", {
|
343
|
-
...
|
344
|
-
...element.attr,
|
345
|
-
className: `edt-headings content-editable ${isEmpty ? "empty" : ""}`,
|
451
|
+
...commonHeadingProps(),
|
346
452
|
placeholder: translation("Heading 5"),
|
347
453
|
children: [children, /*#__PURE__*/_jsx("span", {
|
348
454
|
contentEditable: false
|
@@ -350,14 +456,30 @@ export const getBlock = props => {
|
|
350
456
|
});
|
351
457
|
case "headingSix":
|
352
458
|
return /*#__PURE__*/_jsxs("h6", {
|
353
|
-
...
|
354
|
-
...element.attr,
|
355
|
-
className: `edt-headings content-editable ${isEmpty ? "empty" : ""}`,
|
459
|
+
...commonHeadingProps(),
|
356
460
|
placeholder: translation("Heading 6"),
|
357
461
|
children: [children, /*#__PURE__*/_jsx("span", {
|
358
462
|
contentEditable: false
|
359
463
|
})]
|
360
464
|
});
|
465
|
+
case "paragraphOne":
|
466
|
+
return /*#__PURE__*/_jsx("p", {
|
467
|
+
...commonParaProps("para1"),
|
468
|
+
placeholder: "Paragraph 1",
|
469
|
+
children: children
|
470
|
+
});
|
471
|
+
case "paragraphTwo":
|
472
|
+
return /*#__PURE__*/_jsx("p", {
|
473
|
+
...commonParaProps("para2"),
|
474
|
+
placeholder: "Paragraph 2",
|
475
|
+
children: children
|
476
|
+
});
|
477
|
+
case "paragraphThree":
|
478
|
+
return /*#__PURE__*/_jsx("p", {
|
479
|
+
...commonParaProps("para3"),
|
480
|
+
placeholder: "Paragraph 3",
|
481
|
+
children: children
|
482
|
+
});
|
361
483
|
case "blockquote":
|
362
484
|
return /*#__PURE__*/_jsx("blockquote", {
|
363
485
|
...attributes,
|
@@ -371,7 +493,7 @@ export const getBlock = props => {
|
|
371
493
|
margin: `${element?.bgColor ? "16px" : "0px"} 0px`,
|
372
494
|
width: element?.bgColor ? "calc(100% - 16px)" : "100%",
|
373
495
|
borderWidth: element?.color ? "0px 0px 0px 3px" : "0px",
|
374
|
-
lineHeight:
|
496
|
+
lineHeight: `${customLineHeight} !important`
|
375
497
|
},
|
376
498
|
children: children
|
377
499
|
});
|
@@ -425,14 +547,15 @@ export const getBlock = props => {
|
|
425
547
|
className: `content-editable ${isEmpty ? "empty" : ""}`,
|
426
548
|
placeholder: translation("List"),
|
427
549
|
style: {
|
428
|
-
color: firstChildren?.color
|
550
|
+
color: firstChildren?.color,
|
551
|
+
lineHeight: `${customLineHeight} !important`
|
429
552
|
},
|
430
553
|
children: children
|
431
554
|
});
|
432
555
|
case "orderedList":
|
433
556
|
return /*#__PURE__*/_jsx("ol", {
|
434
557
|
style: {
|
435
|
-
lineHeight:
|
558
|
+
lineHeight: `${customLineHeight} !important`
|
436
559
|
},
|
437
560
|
className: "listItemMargin",
|
438
561
|
type: "1",
|
@@ -442,7 +565,7 @@ export const getBlock = props => {
|
|
442
565
|
case "unorderedList":
|
443
566
|
return /*#__PURE__*/_jsx("ul", {
|
444
567
|
style: {
|
445
|
-
lineHeight:
|
568
|
+
lineHeight: `${customLineHeight} !important`
|
446
569
|
},
|
447
570
|
className: "listItemMargin",
|
448
571
|
...attributes,
|