@flozy/editor 7.0.9 → 8.0.0
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 +7 -7
- package/dist/Editor/CommonEditor.js +74 -25
- package/dist/Editor/DialogWrapper.js +31 -25
- package/dist/Editor/Editor.css +32 -16
- 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 +57 -12
- package/dist/Editor/Elements/Color Picker/ColorPicker.css +25 -1
- package/dist/Editor/Elements/Color Picker/ColorPicker.js +4 -4
- package/dist/Editor/Elements/Color Picker/Styles.js +1 -1
- package/dist/Editor/Elements/DataView/Providers/DataViewProvider.js +1 -1
- package/dist/Editor/Elements/Embed/Image.js +2 -2
- package/dist/Editor/Elements/FreeGrid/FreeGrid.js +0 -14
- package/dist/Editor/Elements/FreeGrid/styles.js +3 -0
- package/dist/Editor/Elements/Grid/GridItem.js +2 -3
- package/dist/Editor/Elements/Link/Link.js +70 -43
- package/dist/Editor/Elements/SimpleText/index.js +7 -12
- package/dist/Editor/Elements/SimpleText/style.js +2 -2
- package/dist/Editor/Elements/Table/Table.js +12 -12
- package/dist/Editor/Elements/Title/title.js +13 -1
- package/dist/Editor/Elements/Variables/Style.js +28 -2
- package/dist/Editor/Elements/Variables/VariableButton.js +17 -4
- package/dist/Editor/Styles/EditorStyles.js +287 -291
- 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 +7 -15
- package/dist/Editor/Toolbar/PopupTool/AddTemplates.js +9 -8
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectFontSize.js +6 -13
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectTypography.js +210 -85
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/index.js +2 -1
- package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +16 -12
- package/dist/Editor/Toolbar/PopupTool/TextFormat.js +56 -9
- package/dist/Editor/Toolbar/PopupTool/ThemeTextFormat.js +438 -0
- package/dist/Editor/Toolbar/PopupTool/index.js +29 -37
- package/dist/Editor/Toolbar/toolbarGroups.js +48 -6
- package/dist/Editor/assets/svg/ThemeIcons.js +291 -0
- package/dist/Editor/common/ColorPickerButton.js +35 -9
- package/dist/Editor/common/CustomColorPicker/index.js +106 -0
- package/dist/Editor/common/CustomColorPicker/style.js +53 -0
- package/dist/Editor/common/CustomDialog/index.js +94 -0
- package/dist/Editor/common/CustomDialog/style.js +67 -0
- package/dist/Editor/common/CustomSelect.js +33 -0
- package/dist/Editor/common/DnD/DragHandleButton.js +1 -1
- package/dist/Editor/common/DnD/Draggable.js +0 -1
- package/dist/Editor/common/FontLoader/FontList.js +3 -11
- package/dist/Editor/common/FontLoader/FontLoader.js +74 -42
- package/dist/Editor/common/Icon.js +28 -0
- package/dist/Editor/common/ImageSelector/Options/Upload.js +1 -1
- package/dist/Editor/common/ImageSelector/Styles.js +3 -9
- package/dist/Editor/common/ImageSelector/UploadStyles.js +1 -2
- package/dist/Editor/common/MentionsPopup/Styles.js +6 -12
- package/dist/Editor/common/RnD/ElementSettings/OtherSettings/Settings.js +2 -1
- 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/VideoSettings.js +3 -2
- package/dist/Editor/common/RnD/ElementSettings/styles.js +0 -1
- package/dist/Editor/common/RnD/SwitchViewport/SwitchViewport.js +8 -2
- 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 +5 -4
- package/dist/Editor/common/RnD/Utils/index.js +42 -0
- package/dist/Editor/common/RnD/index.js +23 -3
- package/dist/Editor/common/Section/index.js +60 -89
- package/dist/Editor/common/Shorthands/elements.js +54 -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 +10 -2
- package/dist/Editor/common/StyleBuilder/fieldTypes/color.js +35 -11
- package/dist/Editor/common/StyleBuilder/fieldTypes/fontSize.js +13 -4
- package/dist/Editor/common/StyleBuilder/fieldTypes/textOptions.js +15 -7
- package/dist/Editor/common/Uploader.js +8 -0
- package/dist/Editor/commonStyle.js +55 -65
- package/dist/Editor/helper/deserialize/index.js +1 -1
- package/dist/Editor/helper/index.js +2 -2
- package/dist/Editor/helper/theme.js +200 -2
- package/dist/Editor/hooks/useEditorScroll.js +1 -1
- package/dist/Editor/hooks/useEditorTheme.js +153 -0
- package/dist/Editor/hooks/useMouseMove.js +9 -3
- package/dist/Editor/plugins/withEmbeds.js +1 -1
- package/dist/Editor/plugins/withHTML.js +5 -9
- package/dist/Editor/plugins/withLayout.js +1 -1
- package/dist/Editor/plugins/withTable.js +1 -1
- package/dist/Editor/theme/ThemeList.js +50 -173
- package/dist/Editor/theme/index.js +144 -0
- package/dist/Editor/themeSettings/ActiveTheme.js +72 -0
- package/dist/Editor/themeSettings/buttons/index.js +283 -0
- package/dist/Editor/themeSettings/buttons/style.js +21 -0
- package/dist/Editor/themeSettings/colorTheme/index.js +292 -0
- package/dist/Editor/themeSettings/colorTheme/style.js +77 -0
- package/dist/Editor/themeSettings/fonts/PreviewElement.js +121 -0
- package/dist/Editor/themeSettings/fonts/index.js +220 -0
- package/dist/Editor/themeSettings/fonts/style.js +44 -0
- package/dist/Editor/themeSettings/icons.js +60 -0
- package/dist/Editor/themeSettings/index.js +320 -0
- package/dist/Editor/themeSettings/style.js +152 -0
- package/dist/Editor/themeSettingsAI/icons.js +96 -0
- package/dist/Editor/themeSettingsAI/index.js +356 -0
- package/dist/Editor/themeSettingsAI/saveTheme.js +197 -0
- package/dist/Editor/themeSettingsAI/style.js +250 -0
- package/dist/Editor/utils/SlateUtilityFunctions.js +157 -49
- package/dist/Editor/utils/button.js +0 -14
- package/dist/Editor/utils/draftToSlate.js +3 -2
- package/dist/Editor/utils/font.js +40 -37
- package/dist/Editor/utils/helper.js +48 -20
- package/dist/Editor/utils/link.js +1 -1
- package/package.json +5 -2
@@ -1,329 +1,325 @@
|
|
1
1
|
const editorStyles = ({
|
2
2
|
padHeight,
|
3
3
|
placeHolderColor,
|
4
|
-
theme
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
4
|
+
theme
|
5
|
+
}) => ({
|
6
|
+
root: {
|
7
|
+
display: "flex",
|
8
|
+
position: "relative",
|
9
|
+
padding: "0px",
|
10
|
+
alignItems: "center",
|
11
|
+
justifyContent: "center",
|
12
|
+
"*": {
|
13
|
+
boxSizing: "border-box"
|
14
|
+
},
|
15
|
+
"&.iframe-editor": {
|
16
|
+
"& .mini-tool-wrpr-ei": {
|
17
|
+
display: "none"
|
18
|
+
}
|
19
|
+
},
|
20
|
+
"& .mobileMiniTextWrapper": {
|
21
|
+
boxShadow: "0px 0px 10px 0px rgba(0, 0, 0, 0.16)",
|
22
|
+
position: "fixed",
|
23
|
+
bottom: "env(safe-area-inset-bottom)",
|
24
|
+
left: 0,
|
25
|
+
width: "100%",
|
26
|
+
zIndex: 99999,
|
27
|
+
backgroundColor: theme?.palette?.editor?.background || "#fff",
|
28
|
+
color: theme?.palette?.editor?.textColor || "black",
|
29
|
+
"& .MuiOutlinedInput-input": {
|
30
|
+
color: theme?.palette?.editor?.textColor || "black"
|
31
|
+
}
|
32
|
+
},
|
33
|
+
"&.stimulate-xs": {
|
34
|
+
"& .scrollable-content": {
|
35
|
+
width: "320px"
|
21
36
|
},
|
22
|
-
"
|
23
|
-
|
24
|
-
position: "
|
25
|
-
|
37
|
+
":before": {
|
38
|
+
content: '" "',
|
39
|
+
position: "absolute",
|
40
|
+
top: 0,
|
26
41
|
left: 0,
|
27
|
-
width: "
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
color: theme?.palette?.editor?.textColor || "black"
|
33
|
-
}
|
42
|
+
width: "calc(50% - 162px)",
|
43
|
+
height: "100%",
|
44
|
+
pointerEvents: "none",
|
45
|
+
backgroundColor: "#FFF",
|
46
|
+
zIndex: 10
|
34
47
|
},
|
35
|
-
"
|
36
|
-
"
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
48
|
+
":after": {
|
49
|
+
content: '" "',
|
50
|
+
position: "absolute",
|
51
|
+
top: 0,
|
52
|
+
right: 0,
|
53
|
+
width: "calc(50% - 160px)",
|
54
|
+
height: "100%",
|
55
|
+
pointerEvents: "none",
|
56
|
+
backgroundColor: "#FFF",
|
57
|
+
zIndex: 10
|
58
|
+
}
|
59
|
+
}
|
60
|
+
},
|
61
|
+
slateWrapper: {
|
62
|
+
paddingTop: "0px",
|
63
|
+
height: `${window.innerHeight - padHeight}px`,
|
64
|
+
width: "100%",
|
65
|
+
overflowY: "auto",
|
66
|
+
overflowX: "hidden",
|
67
|
+
display: "flex",
|
68
|
+
flexDirection: "column",
|
69
|
+
alignItems: "center",
|
70
|
+
color: "#0f172a",
|
71
|
+
"& .has-topbanner": {
|
72
|
+
"& .doc-title-ele-wrpr": {
|
73
|
+
marginTop: "12px"
|
74
|
+
}
|
75
|
+
},
|
76
|
+
"&.no-color": {
|
77
|
+
backgroundColor: theme?.palette?.editor?.background,
|
78
|
+
color: theme?.palette?.editor?.textColor,
|
79
|
+
"&.pc-page-builder": {
|
80
|
+
backgroundColor: "#FFF",
|
81
|
+
color: "#000"
|
61
82
|
},
|
62
|
-
|
83
|
+
"& .signed-btn": {
|
84
|
+
"& img": {
|
85
|
+
backgroundColor: "#FFF"
|
86
|
+
}
|
87
|
+
}
|
63
88
|
},
|
64
|
-
|
65
|
-
paddingTop: "0px",
|
66
|
-
height: `${window.innerHeight - padHeight}px`,
|
89
|
+
"& .max-content": {
|
67
90
|
width: "100%",
|
68
|
-
overflowY: "auto",
|
69
|
-
overflowX: "hidden",
|
70
91
|
display: "flex",
|
92
|
+
flex: 1,
|
71
93
|
flexDirection: "column",
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
94
|
+
paddingBottom: "25px !important"
|
95
|
+
},
|
96
|
+
"& .scroll-area": {
|
97
|
+
display: "flex",
|
98
|
+
justifyContent: "center",
|
99
|
+
flex: 1
|
100
|
+
},
|
101
|
+
"& .editor-wrapper": {
|
102
|
+
maxWidth: "100%",
|
103
|
+
height: "100%",
|
104
|
+
overflow: "visible",
|
105
|
+
"& .section-wrapper-fluid": {
|
106
|
+
"& .grid-container": {
|
107
|
+
maxWidth: "1440px"
|
77
108
|
}
|
78
|
-
}
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
109
|
+
}
|
110
|
+
},
|
111
|
+
"& .el-toolbar": {
|
112
|
+
position: "absolute",
|
113
|
+
left: 0,
|
114
|
+
top: 0,
|
115
|
+
width: "fit-content",
|
116
|
+
"& button": {
|
117
|
+
border: "1px solid rgba(37, 99, 235, 0.32)",
|
118
|
+
borderRadius: "10px",
|
119
|
+
boxShadow: "0px 0px 10px 0px rgba(0, 0, 0, 0.16)",
|
120
|
+
background: "#fff",
|
121
|
+
width: "36px",
|
122
|
+
height: "36px",
|
123
|
+
"&.mr": {
|
124
|
+
marginRight: "2px"
|
85
125
|
},
|
86
|
-
"&
|
87
|
-
"
|
88
|
-
|
126
|
+
"& svg": {
|
127
|
+
stroke: "rgb(100, 116, 139);"
|
128
|
+
}
|
129
|
+
}
|
130
|
+
},
|
131
|
+
"& .accordion-summary-collapse-btn": {
|
132
|
+
padding: "4px",
|
133
|
+
width: '5px'
|
134
|
+
},
|
135
|
+
"& .workflow-icon-btn": {
|
136
|
+
pointerEvents: "none",
|
137
|
+
position: "absolute",
|
138
|
+
right: "-9px",
|
139
|
+
top: "-9px",
|
140
|
+
border: "2px solid #f3b814",
|
141
|
+
padding: "0px",
|
142
|
+
background: "#FFF",
|
143
|
+
"& svg": {
|
144
|
+
width: "18px",
|
145
|
+
height: "18px"
|
146
|
+
}
|
147
|
+
},
|
148
|
+
"& .svg-big-btn": {
|
149
|
+
padding: "2px !important",
|
150
|
+
"& svg": {
|
151
|
+
width: "24px !important",
|
152
|
+
height: "24px !important"
|
153
|
+
}
|
154
|
+
},
|
155
|
+
"& .ed-section-wrapper": {
|
156
|
+
display: "flex",
|
157
|
+
width: "100%",
|
158
|
+
justifyContent: "center",
|
159
|
+
alignItems: "center",
|
160
|
+
position: "relative",
|
161
|
+
"&:hover": {
|
162
|
+
"& .ed-section-inner": {
|
163
|
+
"& .element-toolbar.ss": {
|
164
|
+
display: "block",
|
165
|
+
left: "8px",
|
166
|
+
top: "8px",
|
167
|
+
width: "fit-content",
|
168
|
+
"& button": {
|
169
|
+
boxShadow: "none",
|
170
|
+
color: "#D7D7D6",
|
171
|
+
background: "rgb(221, 221, 221, 0.1)",
|
172
|
+
"&:hover": {
|
173
|
+
background: "rgb(221, 221, 221, 0.8)"
|
174
|
+
}
|
175
|
+
}
|
89
176
|
}
|
177
|
+
},
|
178
|
+
"&.hselect:before": {
|
179
|
+
display: "block"
|
90
180
|
}
|
91
181
|
},
|
92
|
-
"& .
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
flexDirection: "column",
|
97
|
-
paddingBottom: "25px !important"
|
98
|
-
},
|
99
|
-
"& .scroll-area": {
|
100
|
-
display: "flex",
|
101
|
-
justifyContent: "center",
|
102
|
-
flex: 1
|
103
|
-
},
|
104
|
-
"& .editor-wrapper": {
|
105
|
-
maxWidth: "100%",
|
106
|
-
height: "100%",
|
107
|
-
overflow: "visible",
|
108
|
-
"& .section-wrapper-fluid": {
|
109
|
-
"& .grid-container": {
|
110
|
-
maxWidth: "1440px"
|
111
|
-
}
|
182
|
+
"& .ed-section-inner": {
|
183
|
+
maxWidth: "1440px",
|
184
|
+
"& .element-toolbar.ss": {
|
185
|
+
display: "none"
|
112
186
|
}
|
113
187
|
},
|
114
|
-
"
|
188
|
+
"&.needHover:before": {
|
189
|
+
content: '" "',
|
115
190
|
position: "absolute",
|
191
|
+
width: "calc(100% - 2px)",
|
192
|
+
height: "calc(100% - 2px)",
|
116
193
|
left: 0,
|
117
194
|
top: 0,
|
118
|
-
|
119
|
-
|
120
|
-
border: "1px solid rgba(37, 99, 235, 0.32)",
|
121
|
-
borderRadius: "10px",
|
122
|
-
boxShadow: "0px 0px 10px 0px rgba(0, 0, 0, 0.16)",
|
123
|
-
background: "#fff",
|
124
|
-
width: "36px",
|
125
|
-
height: "36px",
|
126
|
-
"&.mr": {
|
127
|
-
marginRight: "2px"
|
128
|
-
},
|
129
|
-
"& svg": {
|
130
|
-
stroke: "rgb(100, 116, 139);"
|
131
|
-
}
|
132
|
-
}
|
133
|
-
},
|
134
|
-
"& .accordion-summary-collapse-btn": {
|
135
|
-
padding: "4px",
|
136
|
-
width: '5px'
|
137
|
-
},
|
138
|
-
"& .workflow-icon-btn": {
|
195
|
+
border: "1px solid transparent",
|
196
|
+
background: "rgba(0,0,0,0.05)",
|
139
197
|
pointerEvents: "none",
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
198
|
+
display: "none"
|
199
|
+
}
|
200
|
+
},
|
201
|
+
"& .element-empty-btn": {
|
202
|
+
backgroundColor: "rgb(242, 241, 238)",
|
203
|
+
color: "rgba(55, 53, 47, 0.65)",
|
204
|
+
outline: 0,
|
205
|
+
border: 0,
|
206
|
+
padding: "16px 12px",
|
207
|
+
width: "100%",
|
208
|
+
cursor: "pointer",
|
209
|
+
display: "flex",
|
210
|
+
alignItems: "center",
|
211
|
+
justifyContent: "center",
|
212
|
+
borderRadius: "12px",
|
213
|
+
"& svg": {
|
214
|
+
marginRight: "8px"
|
215
|
+
}
|
216
|
+
},
|
217
|
+
"& .content-editable.empty": {
|
218
|
+
"&:after": {
|
219
|
+
color: theme?.palette?.type === "dark" ? "#99A5B6" : placeHolderColor
|
220
|
+
}
|
221
|
+
},
|
222
|
+
"& .checkbox-edit": {
|
223
|
+
alignSelf: "flex-start",
|
224
|
+
"& .MuiFormControlLabel-root": {
|
225
|
+
marginRight: "0px"
|
150
226
|
},
|
151
|
-
"& .
|
152
|
-
padding: "
|
227
|
+
"& .MuiCheckbox-root": {
|
228
|
+
padding: "5px",
|
153
229
|
"& svg": {
|
154
|
-
width: "
|
155
|
-
height: "
|
156
|
-
}
|
157
|
-
},
|
158
|
-
"& .ed-section-wrapper": {
|
159
|
-
display: "flex",
|
160
|
-
width: "100%",
|
161
|
-
justifyContent: "center",
|
162
|
-
alignItems: "center",
|
163
|
-
position: "relative",
|
164
|
-
"&:hover": {
|
165
|
-
"& .ed-section-inner": {
|
166
|
-
"& .element-toolbar.ss": {
|
167
|
-
display: "block",
|
168
|
-
left: "8px",
|
169
|
-
top: "8px",
|
170
|
-
width: "fit-content",
|
171
|
-
"& button": {
|
172
|
-
boxShadow: "none",
|
173
|
-
color: "#D7D7D6",
|
174
|
-
background: "rgb(221, 221, 221, 0.1)",
|
175
|
-
"&:hover": {
|
176
|
-
background: "rgb(221, 221, 221, 0.8)"
|
177
|
-
}
|
178
|
-
}
|
179
|
-
}
|
180
|
-
},
|
181
|
-
"&.hselect:before": {
|
182
|
-
display: "block"
|
183
|
-
}
|
184
|
-
},
|
185
|
-
"& .ed-section-inner": {
|
186
|
-
maxWidth: "1440px",
|
187
|
-
"& .element-toolbar.ss": {
|
188
|
-
display: "none"
|
189
|
-
}
|
190
|
-
},
|
191
|
-
"&.needHover:before": {
|
192
|
-
content: '" "',
|
193
|
-
position: "absolute",
|
194
|
-
width: "calc(100% - 2px)",
|
195
|
-
height: "calc(100% - 2px)",
|
196
|
-
left: 0,
|
197
|
-
top: 0,
|
198
|
-
border: "1px solid transparent",
|
199
|
-
background: "rgba(0,0,0,0.05)",
|
200
|
-
pointerEvents: "none",
|
201
|
-
display: "none"
|
230
|
+
width: "20px",
|
231
|
+
height: "20px"
|
202
232
|
}
|
203
|
-
}
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
borderRadius: "
|
233
|
+
}
|
234
|
+
},
|
235
|
+
"& .tools-drawer": {
|
236
|
+
zIndex: 1300,
|
237
|
+
"& .MuiDrawer-paper": {
|
238
|
+
backgroundColor: theme?.palette?.editor?.background
|
239
|
+
}
|
240
|
+
},
|
241
|
+
"& .section-tw": {
|
242
|
+
background: 'transparent !important',
|
243
|
+
"& button": {
|
244
|
+
padding: "2px",
|
245
|
+
borderRadius: "0px",
|
216
246
|
"& svg": {
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
"& .content-editable.empty": {
|
221
|
-
"&:after": {
|
222
|
-
color: theme?.palette?.type === "dark" ? "#99A5B6" : placeHolderColor
|
223
|
-
}
|
224
|
-
},
|
225
|
-
"& .checkbox-edit": {
|
226
|
-
alignSelf: "flex-start",
|
227
|
-
"& .MuiFormControlLabel-root": {
|
228
|
-
marginRight: "0px"
|
229
|
-
},
|
230
|
-
"& .MuiCheckbox-root": {
|
231
|
-
padding: "5px",
|
232
|
-
"& svg": {
|
233
|
-
width: "20px",
|
234
|
-
height: "20px"
|
235
|
-
}
|
236
|
-
}
|
237
|
-
},
|
238
|
-
"& .tools-drawer": {
|
239
|
-
zIndex: 1300,
|
240
|
-
"& .MuiDrawer-paper": {
|
241
|
-
backgroundColor: theme?.palette?.editor?.background
|
247
|
+
width: "17px",
|
248
|
+
height: "18px",
|
249
|
+
marginTop: "-1px"
|
242
250
|
}
|
243
|
-
}
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
border: "1px solid #CFD8F5"
|
264
|
-
},
|
265
|
-
"& .embed-image-wrpr .image-frame": {
|
266
|
-
position: "absolute",
|
267
|
-
top: 0,
|
268
|
-
left: 0,
|
251
|
+
}
|
252
|
+
},
|
253
|
+
"& .carousel-item": {
|
254
|
+
padding: "12px 32px"
|
255
|
+
},
|
256
|
+
"& .slick-arrow": {
|
257
|
+
borderRadius: "50%",
|
258
|
+
backgroundColor: "#F8FAFF",
|
259
|
+
textAlign: "center",
|
260
|
+
border: "1px solid #CFD8F5"
|
261
|
+
},
|
262
|
+
"& .embed-image-wrpr .image-frame": {
|
263
|
+
position: "absolute",
|
264
|
+
top: 0,
|
265
|
+
left: 0,
|
266
|
+
width: "100%",
|
267
|
+
height: "100%",
|
268
|
+
padding: "0px",
|
269
|
+
// pointerEvents: "none",
|
270
|
+
"& svg": {
|
269
271
|
width: "100%",
|
270
272
|
height: "100%",
|
271
|
-
|
272
|
-
|
273
|
-
"& svg": {
|
274
|
-
width: "100%",
|
275
|
-
height: "100%",
|
276
|
-
"& .op-zero": {
|
277
|
-
fillOpacity: 0
|
278
|
-
}
|
279
|
-
}
|
280
|
-
},
|
281
|
-
"&.hideScroll": {
|
282
|
-
overflowAnchor: "none",
|
283
|
-
"&::-webkit-scrollbar-track": {
|
284
|
-
background: "none !important"
|
285
|
-
},
|
286
|
-
"&::-webkit-scrollbar-thumb": {
|
287
|
-
background: "none !important"
|
288
|
-
},
|
289
|
-
"&::-webkit-scrollbar-thumb:hover": {
|
290
|
-
background: "none !important"
|
291
|
-
}
|
292
|
-
},
|
293
|
-
"& ::selection": {
|
294
|
-
background: 'rgba(35, 131, 226, 0.35)!important',
|
295
|
-
color: 'inherit'
|
296
|
-
},
|
297
|
-
"&.readOnlyContainer": {
|
298
|
-
"& .max-content": {
|
299
|
-
paddingBottom: "0px !important"
|
273
|
+
"& .op-zero": {
|
274
|
+
fillOpacity: 0
|
300
275
|
}
|
301
276
|
}
|
302
277
|
},
|
303
|
-
|
304
|
-
|
305
|
-
|
278
|
+
"&.hideScroll": {
|
279
|
+
overflowAnchor: "none",
|
280
|
+
"&::-webkit-scrollbar-track": {
|
281
|
+
background: "none !important"
|
306
282
|
},
|
307
|
-
"
|
308
|
-
background:
|
283
|
+
"&::-webkit-scrollbar-thumb": {
|
284
|
+
background: "none !important"
|
309
285
|
},
|
310
|
-
"
|
311
|
-
|
312
|
-
"& .MuiDialogTitle-root": {
|
313
|
-
position: "absolute",
|
314
|
-
top: 0,
|
315
|
-
right: "0px",
|
316
|
-
zIndex: 100
|
317
|
-
},
|
318
|
-
"& .MuiDialogContent-root": {
|
319
|
-
padding: "0px"
|
320
|
-
}
|
286
|
+
"&::-webkit-scrollbar-thumb:hover": {
|
287
|
+
background: "none !important"
|
321
288
|
}
|
322
289
|
},
|
323
|
-
|
324
|
-
|
325
|
-
|
290
|
+
"& ::selection": {
|
291
|
+
background: 'rgba(35, 131, 226, 0.35)!important',
|
292
|
+
color: 'inherit'
|
293
|
+
},
|
294
|
+
"&.readOnlyContainer": {
|
295
|
+
"& .max-content": {
|
296
|
+
paddingBottom: "0px !important"
|
297
|
+
}
|
298
|
+
}
|
299
|
+
},
|
300
|
+
fullScreenWrapper: {
|
301
|
+
"& .editor-wrapper": {
|
302
|
+
paddingTop: '20px'
|
303
|
+
},
|
304
|
+
"& .MuiDialog-paper, & .MuiPopover-paper": {
|
305
|
+
background: `${theme?.palette?.editor?.background} !important`
|
306
|
+
},
|
307
|
+
"& .MuiPaper-root": {
|
308
|
+
borderRadius: "0px !important",
|
309
|
+
"& .MuiDialogTitle-root": {
|
310
|
+
position: "absolute",
|
311
|
+
top: 0,
|
312
|
+
right: "0px",
|
313
|
+
zIndex: 100
|
314
|
+
},
|
315
|
+
"& .MuiDialogContent-root": {
|
316
|
+
padding: "0px"
|
317
|
+
}
|
326
318
|
}
|
327
|
-
}
|
328
|
-
|
319
|
+
},
|
320
|
+
cardsTypo: {
|
321
|
+
color: theme?.palette?.editor?.textColor,
|
322
|
+
fontSize: "14px !important"
|
323
|
+
}
|
324
|
+
});
|
329
325
|
export default editorStyles;
|
@@ -1,8 +1,32 @@
|
|
1
1
|
import React from "react";
|
2
2
|
import { Select, MenuItem } from "@mui/material";
|
3
|
-
import { addMarkData, activeMark } from "../../utils/SlateUtilityFunctions.js";
|
3
|
+
import { addMarkData, activeMark, getSelectedElementStyle } from "../../utils/SlateUtilityFunctions.js";
|
4
|
+
import { toolbarGroups } from "../toolbarGroups.js";
|
4
5
|
import KeyboardArrowDownRoundedIcon from "@mui/icons-material/KeyboardArrowDownRounded";
|
6
|
+
import { googleFontList as defaultFonts } from "../../common/FontLoader/FontList.js";
|
5
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
8
|
+
const allTools = toolbarGroups.flat();
|
9
|
+
const fontWeight = allTools.find(f => f.format === "fontWeight");
|
10
|
+
export const getValue = (editor, format) => {
|
11
|
+
switch (format) {
|
12
|
+
case "fontFamily":
|
13
|
+
{
|
14
|
+
const style = getSelectedElementStyle("font-family", editor);
|
15
|
+
return style || defaultFonts[0];
|
16
|
+
}
|
17
|
+
case "fontWeight":
|
18
|
+
{
|
19
|
+
const {
|
20
|
+
options
|
21
|
+
} = fontWeight || {};
|
22
|
+
const fontWeightStyle = getSelectedElementStyle("font-weight", editor);
|
23
|
+
const selected = options?.find(o => o.value === fontWeightStyle || o.numVal === fontWeightStyle);
|
24
|
+
return selected?.value;
|
25
|
+
}
|
26
|
+
default:
|
27
|
+
return activeMark(editor, format);
|
28
|
+
}
|
29
|
+
};
|
6
30
|
const Dropdown = ({
|
7
31
|
classes,
|
8
32
|
editor,
|
@@ -10,7 +34,7 @@ const Dropdown = ({
|
|
10
34
|
options,
|
11
35
|
width
|
12
36
|
}) => {
|
13
|
-
const value =
|
37
|
+
const value = getValue(editor, format);
|
14
38
|
const changeMarkData = (event, format) => {
|
15
39
|
event.preventDefault();
|
16
40
|
const value = event.target.value;
|
@@ -20,7 +44,7 @@ const Dropdown = ({
|
|
20
44
|
});
|
21
45
|
};
|
22
46
|
return /*#__PURE__*/_jsx(Select, {
|
23
|
-
value: value,
|
47
|
+
value: value || options?.[0]?.value,
|
24
48
|
className: "editor-dd",
|
25
49
|
onChange: e => changeMarkData(e, format),
|
26
50
|
MenuProps: {
|