@flozy/editor 10.9.6 → 10.9.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Editor/ChatEditor.js +17 -16
- package/dist/Editor/CommonEditor.js +138 -27
- package/dist/Editor/DialogWrapper.js +31 -25
- package/dist/Editor/Editor.css +39 -11
- package/dist/Editor/Elements/AI/PopoverAIInput.js +11 -3
- package/dist/Editor/Elements/AI/Styles.js +1 -0
- package/dist/Editor/Elements/Accordion/Accordion.js +28 -22
- package/dist/Editor/Elements/Accordion/AccordionButton.js +12 -3
- package/dist/Editor/Elements/AppHeader/AppHeader.js +3 -3
- package/dist/Editor/Elements/Attachments/AttachmentStyles.js +16 -0
- package/dist/Editor/Elements/Attachments/Attachments.js +153 -11
- package/dist/Editor/Elements/Attachments/AttachmentsButton.js +8 -3
- package/dist/Editor/Elements/Button/EditorButton.js +23 -7
- 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/DataTypes/Components/Select.js +134 -55
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/SelectV1.js +7 -8
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/PersonType.js +8 -3
- package/dist/Editor/Elements/DataView/Layouts/Options/EditProperty.js +1 -1
- package/dist/Editor/Elements/DataView/Layouts/TableStyles.js +1 -1
- package/dist/Editor/Elements/Embed/Embed.css +5 -0
- package/dist/Editor/Elements/Embed/Embed.js +36 -43
- package/dist/Editor/Elements/Embed/Image.js +236 -23
- package/dist/Editor/Elements/Embed/Video.js +246 -15
- package/dist/Editor/Elements/Form/FormField.js +1 -1
- package/dist/Editor/Elements/Form/Workflow/Styles.js +24 -22
- package/dist/Editor/Elements/Form/Workflow/constant.js +25 -1
- package/dist/Editor/Elements/FreeGrid/FreeGrid.js +39 -33
- package/dist/Editor/Elements/FreeGrid/FreeGridBox.js +7 -4
- package/dist/Editor/Elements/FreeGrid/FreeGridItem.js +1 -0
- package/dist/Editor/Elements/FreeGrid/Options/More.js +7 -7
- package/dist/Editor/Elements/FreeGrid/helper.js +115 -0
- package/dist/Editor/Elements/FreeGrid/styles.js +15 -0
- package/dist/Editor/Elements/Grid/GridItem.js +1 -1
- package/dist/Editor/Elements/PageSettings/PageSettingsButton.js +2 -1
- package/dist/Editor/Elements/SimpleText/index.js +4 -1
- package/dist/Editor/Elements/SimpleText/style.js +2 -2
- package/dist/Editor/Elements/Table/Table.js +5 -4
- package/dist/Editor/Elements/Table/TableCell.js +10 -3
- package/dist/Editor/Elements/Title/title.js +10 -11
- package/dist/Editor/Elements/TopBanner/TopBanner.js +4 -2
- package/dist/Editor/Elements/TopBanner/TopBannerButton.js +5 -3
- package/dist/Editor/Elements/Variables/VariableButton.js +10 -1
- package/dist/Editor/MiniEditor.js +2 -1
- package/dist/Editor/Styles/EditorStyles.js +20 -8
- 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 +33 -29
- 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 +25 -23
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectList.js +25 -7
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectTypography.js +167 -42
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/index.js +24 -8
- package/dist/Editor/Toolbar/PopupTool/PopperHeader.js +2 -1
- package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +70 -10
- package/dist/Editor/Toolbar/PopupTool/TextFormat.js +73 -14
- package/dist/Editor/Toolbar/PopupTool/ThemeTextFormat.js +439 -0
- package/dist/Editor/Toolbar/PopupTool/index.js +7 -4
- package/dist/Editor/Toolbar/toolbarGroups.js +56 -10
- package/dist/Editor/assets/svg/BackIcon.js +18 -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 +4 -0
- package/dist/Editor/common/Icon.js +28 -0
- package/dist/Editor/common/ImageSelector/ImageSelector.js +45 -7
- package/dist/Editor/common/ImageSelector/Options/Upload.js +26 -11
- package/dist/Editor/common/ImageSelector/Styles.js +3 -9
- package/dist/Editor/common/LinkSettings/NavComponents.js +6 -2
- package/dist/Editor/common/MentionsPopup/index.js +9 -1
- 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 +20 -7
- package/dist/Editor/common/RnD/ElementSettings/Settings/TableSettings.js +3 -2
- package/dist/Editor/common/RnD/ElementSettings/Settings/TextSettings.js +9 -1
- package/dist/Editor/common/RnD/ElementSettings/Settings/VideoSettings.js +20 -7
- package/dist/Editor/common/RnD/GuideLines/styles.js +1 -1
- package/dist/Editor/common/RnD/SwitchViewport/SwitchViewport.js +11 -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 +28 -18
- package/dist/Editor/common/RnD/Utils/index.js +3 -1
- package/dist/Editor/common/RnD/VirtualElement/VirtualTextElement.js +45 -58
- package/dist/Editor/common/RnD/VirtualElement/helper.js +320 -130
- package/dist/Editor/common/RnD/VirtualElement/styles.js +22 -0
- package/dist/Editor/common/RnD/index.js +48 -13
- package/dist/Editor/common/Shorthands/elements.js +62 -4
- package/dist/Editor/common/StyleBuilder/buttonStyle.js +4 -2
- package/dist/Editor/common/StyleBuilder/embedVideoStyle.js +4 -0
- package/dist/Editor/common/StyleBuilder/fieldStyle.js +1 -0
- package/dist/Editor/common/StyleBuilder/fieldTypes/backgroundImage.js +15 -2
- 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/embedUpload.js +115 -0
- package/dist/Editor/common/StyleBuilder/fieldTypes/fontSize.js +16 -7
- package/dist/Editor/common/StyleBuilder/fieldTypes/index.js +3 -1
- package/dist/Editor/common/StyleBuilder/fieldTypes/menusArray.js +2 -0
- package/dist/Editor/common/StyleBuilder/fieldTypes/text.js +0 -1
- package/dist/Editor/common/StyleBuilder/fieldTypes/textOptions.js +15 -7
- package/dist/Editor/common/StyleBuilder/formStyle.js +19 -13
- package/dist/Editor/common/StyleBuilder/index.js +8 -4
- package/dist/Editor/common/Uploader.js +125 -17
- package/dist/Editor/common/UploaderWithProgress.js +183 -0
- package/dist/Editor/common/iconslist.js +21 -0
- package/dist/Editor/commonStyle.js +64 -45
- package/dist/Editor/helper/index.js +10 -2
- 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 +9 -3
- package/dist/Editor/hooks/useTable.js +62 -1
- package/dist/Editor/hooks/useThemeValues.js +63 -0
- package/dist/Editor/plugins/withEmbeds.js +12 -1
- package/dist/Editor/plugins/withHTML.js +58 -3
- package/dist/Editor/plugins/withTable.js +1 -1
- package/dist/Editor/service/fileupload.js +70 -0
- package/dist/Editor/theme/ThemeList.js +50 -173
- package/dist/Editor/theme/index.js +149 -0
- package/dist/Editor/themeSettings/ActiveTheme.js +82 -0
- package/dist/Editor/themeSettings/buttons/index.js +300 -0
- package/dist/Editor/themeSettings/buttons/style.js +23 -0
- package/dist/Editor/themeSettings/colorTheme/index.js +310 -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 +380 -0
- package/dist/Editor/themeSettings/style.js +299 -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 +332 -0
- package/dist/Editor/utils/SlateUtilityFunctions.js +189 -40
- package/dist/Editor/utils/accordion.js +68 -40
- package/dist/Editor/utils/button.js +1 -17
- package/dist/Editor/utils/draftToSlate.js +3 -2
- package/dist/Editor/utils/events.js +94 -89
- package/dist/Editor/utils/font.js +40 -37
- package/dist/Editor/utils/formfield.js +2 -2
- package/dist/Editor/utils/helper.js +98 -22
- package/dist/Editor/utils/insertAppHeader.js +8 -4
- package/package.json +4 -4
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/MultiSelect.js +0 -454
@@ -9,20 +9,20 @@ const FormStyles = theme => ({
|
|
9
9
|
color: "#94A3B8"
|
10
10
|
},
|
11
11
|
bodyTextArea: {
|
12
|
-
|
13
|
-
padding:
|
14
|
-
|
15
|
-
outline:
|
16
|
-
border:
|
12
|
+
"& .mini-editor-cls": {
|
13
|
+
padding: "12px",
|
14
|
+
"&:focus-visible": {
|
15
|
+
outline: "none",
|
16
|
+
border: "none"
|
17
17
|
}
|
18
18
|
},
|
19
19
|
"& .editorWorkflow": {
|
20
|
-
minHeight:
|
21
|
-
padding:
|
20
|
+
minHeight: "130px",
|
21
|
+
padding: "12px",
|
22
22
|
paddingBottom: 0,
|
23
|
-
|
24
|
-
outline:
|
25
|
-
border:
|
23
|
+
"&:focus-visible": {
|
24
|
+
outline: "none",
|
25
|
+
border: "none"
|
26
26
|
}
|
27
27
|
}
|
28
28
|
},
|
@@ -105,7 +105,7 @@ const FormStyles = theme => ({
|
|
105
105
|
padding: "4px 22px",
|
106
106
|
textTransform: "none",
|
107
107
|
border: "1px solid #D8DDE1",
|
108
|
-
minWidth:
|
108
|
+
minWidth: "126px",
|
109
109
|
"& svg": {
|
110
110
|
"& path": {
|
111
111
|
stroke: "#64748B"
|
@@ -169,17 +169,19 @@ const FormStyles = theme => ({
|
|
169
169
|
}
|
170
170
|
},
|
171
171
|
colorButtonSingle: {
|
172
|
+
border: "1.5px solid #DCE4EC !important",
|
172
173
|
"&.active": {
|
173
|
-
"&:before": {
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
}
|
174
|
+
// "&:before": {
|
175
|
+
// content: '" "',
|
176
|
+
// position: "absolute",
|
177
|
+
// top: "-5px",
|
178
|
+
// left: "-5px",
|
179
|
+
// width: "calc(100% + 4px)",
|
180
|
+
// height: "calc(100% + 4px)",
|
181
|
+
// border: "3px solid blue",
|
182
|
+
// borderRadius: "50%",
|
183
|
+
// },
|
184
|
+
outline: "2px solid #2563EB"
|
183
185
|
}
|
184
186
|
},
|
185
187
|
colorButtonsInner: {
|
@@ -249,7 +251,7 @@ const FormStyles = theme => ({
|
|
249
251
|
}
|
250
252
|
},
|
251
253
|
root: {
|
252
|
-
padding:
|
254
|
+
padding: "10px"
|
253
255
|
}
|
254
256
|
});
|
255
257
|
export default FormStyles;
|
@@ -1,3 +1,27 @@
|
|
1
1
|
export const minutes = [30, 35, 40, 45, 50, 55];
|
2
2
|
export const hours = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23];
|
3
|
-
export const days = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31];
|
3
|
+
export const days = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31];
|
4
|
+
export const allowedFormat = {
|
5
|
+
Document: ".pdf,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.txt,.rtf",
|
6
|
+
Image: "image/*",
|
7
|
+
Video: ".mp4,.webm,.ogg,.mov,.avi,.mkv",
|
8
|
+
Embed: "*"
|
9
|
+
};
|
10
|
+
export const maxSizeMap = {
|
11
|
+
Image: 25 * 1024 * 1024,
|
12
|
+
// Test -> 5 * 1024 * 1024 -> 5MB
|
13
|
+
Video: 1024 * 1024 * 1024,
|
14
|
+
Document: 25 * 1024 * 1024,
|
15
|
+
Embed: Infinity
|
16
|
+
};
|
17
|
+
export const allowedTypes = {
|
18
|
+
Document: ["application/pdf", "application/msword", "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "application/vnd.ms-excel", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "application/vnd.ms-powerpoint", "application/vnd.openxmlformats-officedocument.presentationml.presentation", "text/plain", "application/rtf"],
|
19
|
+
Image: ["image/jpeg", "image/png", "image/gif", "image/webp", "image/svg+xml"],
|
20
|
+
Video: ["video/mp4", "video/webm", "video/ogg", "video/quicktime", "video/x-msvideo", "video/x-matroska"],
|
21
|
+
Embed: ["*"]
|
22
|
+
};
|
23
|
+
export const extensionMap = {
|
24
|
+
Video: ["mp4", "webm", "ogg", "mov", "avi", "mkv"],
|
25
|
+
Image: ["jpg", "jpeg", "png", "gif", "webp", "svg"],
|
26
|
+
Document: ["pdf", "doc", "docx", "xls", "xlsx", "ppt", "pptx", "txt", "rtf"]
|
27
|
+
};
|
@@ -22,6 +22,7 @@ import { DEFAULT_TABLE_NODE } from "../../utils/table";
|
|
22
22
|
import itemOptions from "./Options/sectionItemOptions";
|
23
23
|
import { getBreakPointsValue, groupByBreakpoint } from "../../helper/theme";
|
24
24
|
import { useDebouncedCallback } from "use-debounce";
|
25
|
+
import { getNewElementXsValues } from "./helper";
|
25
26
|
import updateFormName from "../../utils/updateFormName";
|
26
27
|
import { jsx as _jsx } from "react/jsx-runtime";
|
27
28
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
@@ -183,6 +184,11 @@ const FreeGrid = props => {
|
|
183
184
|
const handleAddElementClick = type => () => {
|
184
185
|
const isEmpty = isEmptySection();
|
185
186
|
const insertAt = isEmpty ? [...path, 0] : [...path, childrenCountRef.current];
|
187
|
+
const {
|
188
|
+
xsVal,
|
189
|
+
sectionHeightXs
|
190
|
+
} = getNewElementXsValues(type, element?.children);
|
191
|
+
const id = crypto?.randomUUID();
|
186
192
|
switch (type) {
|
187
193
|
case "addText":
|
188
194
|
Transforms.insertNodes(editor, [{
|
@@ -199,7 +205,8 @@ const FreeGrid = props => {
|
|
199
205
|
marginTop: 0,
|
200
206
|
top: 0,
|
201
207
|
width: 170,
|
202
|
-
height: 30
|
208
|
+
height: 30,
|
209
|
+
...(xsVal || {})
|
203
210
|
}], {
|
204
211
|
at: [...insertAt]
|
205
212
|
});
|
@@ -217,20 +224,6 @@ const FreeGrid = props => {
|
|
217
224
|
linkType: "webAddress"
|
218
225
|
},
|
219
226
|
iconPosition: "start",
|
220
|
-
bgColor: "#2563EB",
|
221
|
-
textColor: "#FFF",
|
222
|
-
borderRadius: {
|
223
|
-
topLeft: 30,
|
224
|
-
topRight: 30,
|
225
|
-
bottomLeft: 30,
|
226
|
-
bottomRight: 30
|
227
|
-
},
|
228
|
-
bannerSpacing: {
|
229
|
-
left: 12,
|
230
|
-
top: 12,
|
231
|
-
right: 12,
|
232
|
-
bottom: 12
|
233
|
-
},
|
234
227
|
textAlign: "center",
|
235
228
|
label: "Get Started"
|
236
229
|
}],
|
@@ -239,7 +232,8 @@ const FreeGrid = props => {
|
|
239
232
|
marginTop: 0,
|
240
233
|
top: 0,
|
241
234
|
width: 143,
|
242
|
-
height: 50
|
235
|
+
height: 50,
|
236
|
+
...(xsVal || {})
|
243
237
|
}], {
|
244
238
|
at: [...insertAt]
|
245
239
|
});
|
@@ -265,8 +259,9 @@ const FreeGrid = props => {
|
|
265
259
|
top: 0,
|
266
260
|
width: 217,
|
267
261
|
height: 173,
|
268
|
-
width_xs: 217,
|
269
|
-
height_xs: 173
|
262
|
+
// width_xs: 217,
|
263
|
+
// height_xs: 173,
|
264
|
+
...(xsVal || {})
|
270
265
|
}], {
|
271
266
|
at: [...insertAt]
|
272
267
|
});
|
@@ -282,14 +277,17 @@ const FreeGrid = props => {
|
|
282
277
|
images: [],
|
283
278
|
children: [{
|
284
279
|
text: ""
|
285
|
-
}]
|
280
|
+
}],
|
281
|
+
fromFreeGrid: true,
|
282
|
+
uniqueId: id
|
286
283
|
}],
|
287
284
|
gridArea: "3 / 1 / 4 / 2",
|
288
285
|
left: 50,
|
289
286
|
marginTop: 0,
|
290
287
|
top: 0,
|
291
|
-
width:
|
292
|
-
height: 80
|
288
|
+
width: 650,
|
289
|
+
height: 80,
|
290
|
+
...(xsVal || {})
|
293
291
|
}], {
|
294
292
|
at: [...insertAt]
|
295
293
|
});
|
@@ -299,10 +297,13 @@ const FreeGrid = props => {
|
|
299
297
|
...insertFreeGridItem("video", createEmbedNode("video", {
|
300
298
|
url: "",
|
301
299
|
alt: "",
|
302
|
-
images: []
|
300
|
+
images: [],
|
301
|
+
fromFreeGrid: true,
|
302
|
+
uniqueId: id
|
303
303
|
}), {
|
304
304
|
height: 370,
|
305
|
-
width: 650
|
305
|
+
width: 650,
|
306
|
+
...(xsVal || {})
|
306
307
|
})
|
307
308
|
}], {
|
308
309
|
at: [...insertAt]
|
@@ -314,7 +315,8 @@ const FreeGrid = props => {
|
|
314
315
|
...DEFAULT_TABLE_NODE()
|
315
316
|
}, {
|
316
317
|
height: 150,
|
317
|
-
width: 400
|
318
|
+
width: 400,
|
319
|
+
...(xsVal || {})
|
318
320
|
})
|
319
321
|
}], {
|
320
322
|
at: [...insertAt]
|
@@ -338,7 +340,8 @@ const FreeGrid = props => {
|
|
338
340
|
marginTop: 0,
|
339
341
|
top: 0,
|
340
342
|
width: 400,
|
341
|
-
height: 300
|
343
|
+
height: 300,
|
344
|
+
...(xsVal || {})
|
342
345
|
}], {
|
343
346
|
at: [...insertAt]
|
344
347
|
});
|
@@ -350,7 +353,9 @@ const FreeGrid = props => {
|
|
350
353
|
children: [{
|
351
354
|
text: ""
|
352
355
|
}]
|
353
|
-
}, {
|
356
|
+
}, {
|
357
|
+
...(xsVal || {})
|
358
|
+
}, "freegridBox")
|
354
359
|
}], {
|
355
360
|
at: [...insertAt]
|
356
361
|
});
|
@@ -361,7 +366,8 @@ const FreeGrid = props => {
|
|
361
366
|
...FORM_NODE()
|
362
367
|
}, {
|
363
368
|
height: 92,
|
364
|
-
width: 400
|
369
|
+
width: 400,
|
370
|
+
...(xsVal || {})
|
365
371
|
})
|
366
372
|
}], {
|
367
373
|
at: [...insertAt]
|
@@ -375,7 +381,8 @@ const FreeGrid = props => {
|
|
375
381
|
})
|
376
382
|
}, {
|
377
383
|
height: 60,
|
378
|
-
width: 400
|
384
|
+
width: 400,
|
385
|
+
...(xsVal || {})
|
379
386
|
})
|
380
387
|
}], {
|
381
388
|
at: [...insertAt]
|
@@ -396,19 +403,18 @@ const FreeGrid = props => {
|
|
396
403
|
marginTop: 0,
|
397
404
|
top: 0,
|
398
405
|
width: 170,
|
399
|
-
height: 30
|
406
|
+
height: 30,
|
407
|
+
...(xsVal || {})
|
400
408
|
}], {
|
401
409
|
at: [...insertAt]
|
402
410
|
});
|
403
411
|
break;
|
404
412
|
default:
|
405
413
|
}
|
406
|
-
if (
|
414
|
+
if (xsVal) {
|
407
415
|
setSelectedElement({});
|
408
|
-
|
409
|
-
// auto align in mobile
|
410
416
|
Transforms.setNodes(editor, {
|
411
|
-
|
417
|
+
height_xs: sectionHeightXs,
|
412
418
|
updated_at: new Date().getTime()
|
413
419
|
}, {
|
414
420
|
at: path
|
@@ -8,7 +8,7 @@ import { onDropItem, ROW_HEIGHT } from "../../common/RnD/Utils/gridDropItem";
|
|
8
8
|
import useBreakpoints from "../../hooks/useBreakpoints";
|
9
9
|
import { breakpointValues, formatBreakpointValues } from "./breakpointConstants";
|
10
10
|
import { useEditorContext } from "../../hooks/useMouseMove";
|
11
|
-
import { getBreakPointsValue } from "../../helper/theme";
|
11
|
+
import { getBreakPointsValue, groupByBreakpoint } from "../../helper/theme";
|
12
12
|
import focusOnNewItem from "../../helper/RnD/focusOnNewItem";
|
13
13
|
import { bringItemToFB } from "../../helper";
|
14
14
|
import itemOptions from "./Options/sectionItemOptions";
|
@@ -160,6 +160,11 @@ const FreeGridBox = props => {
|
|
160
160
|
const isBoxHeader = useMemo(() => {
|
161
161
|
return element?.children?.some(c => c.childType === "appHeader" && !c.xs_updatedOn);
|
162
162
|
}, [element]);
|
163
|
+
const boxSp = groupByBreakpoint({
|
164
|
+
borderRadius: {
|
165
|
+
...getBreakPointsValue(sectionBorderRadius || {}, null, "overrideBorderRadius", true)
|
166
|
+
}
|
167
|
+
}, theme);
|
163
168
|
return /*#__PURE__*/_jsx(RnD, {
|
164
169
|
id: `freegrid_box_item_${path.join("|")}_${updated_at}_${breakpoint}`,
|
165
170
|
className: `freegrid-item path-${path.length} breakpoint-${breakpoint} freegrid-box_${path.join("_")}`,
|
@@ -226,9 +231,7 @@ const FreeGridBox = props => {
|
|
226
231
|
"--rows": `repeat(${repeatTimes}, ${ROW_HEIGHT}px)`
|
227
232
|
},
|
228
233
|
sx: {
|
229
|
-
|
230
|
-
...getBreakPointsValue(sectionBorderRadius || {}, null, "overrideBorderRadius", true)
|
231
|
-
},
|
234
|
+
...boxSp,
|
232
235
|
background: sectionBgColor,
|
233
236
|
backgroundImage: sectionBackgroundImage ? `url('${sectionBackgroundImage}')` : "",
|
234
237
|
borderColor: borderColor || "transparent",
|
@@ -5,8 +5,8 @@ import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
5
5
|
const More = props => {
|
6
6
|
const {
|
7
7
|
handleClick,
|
8
|
-
|
9
|
-
|
8
|
+
translation,
|
9
|
+
breakpoint
|
10
10
|
} = props;
|
11
11
|
return /*#__PURE__*/_jsx(Box, {
|
12
12
|
children: /*#__PURE__*/_jsxs(List, {
|
@@ -19,15 +19,15 @@ const More = props => {
|
|
19
19
|
className: "item-wrapper",
|
20
20
|
onClick: handleClick("duplicateSection"),
|
21
21
|
children: translation?.translation("Duplicate Section")
|
22
|
-
}), /*#__PURE__*/_jsx(ListItemButton, {
|
23
|
-
className: "item-wrapper",
|
24
|
-
onClick: handleClick("deleteSection"),
|
25
|
-
children: "Delete Section"
|
26
22
|
}), breakpoint === "xs" ? /*#__PURE__*/_jsx(ListItemButton, {
|
27
23
|
className: "item-wrapper",
|
28
24
|
onClick: handleClick("forceAutoAlignment"),
|
29
25
|
children: "Force Auto Alignment"
|
30
|
-
}) : null
|
26
|
+
}) : null, /*#__PURE__*/_jsx(ListItemButton, {
|
27
|
+
className: "item-wrapper",
|
28
|
+
onClick: handleClick("deleteSection"),
|
29
|
+
children: "Delete Section"
|
30
|
+
})]
|
31
31
|
})
|
32
32
|
});
|
33
33
|
};
|
@@ -0,0 +1,115 @@
|
|
1
|
+
import { ROW_HEIGHT } from "../../common/RnD/Utils/gridDropItem";
|
2
|
+
import { getElementOffset } from "../../common/RnD/VirtualElement/VirtualTextElement";
|
3
|
+
import { RND_ITEMS } from "../../helper";
|
4
|
+
export const ELEMENT_CASE = {
|
5
|
+
ADD_TEXT: "addText",
|
6
|
+
ADD_BUTTON: "addButton",
|
7
|
+
ADD_SIGNATURE: "addSignature",
|
8
|
+
ADD_IMAGE: "addImage",
|
9
|
+
ADD_VIDEO: "addVideo",
|
10
|
+
ADD_TABLE: "addTable",
|
11
|
+
ADD_CODE: "addCode",
|
12
|
+
ADD_BOX: "addBox",
|
13
|
+
ADD_FORM: "addForm",
|
14
|
+
ADD_APP_HEADER: "addAppHeader",
|
15
|
+
ADD_DIVIDER: "addDivider"
|
16
|
+
};
|
17
|
+
const commonXsValues = {
|
18
|
+
top_xs: 0,
|
19
|
+
marginTop_xs: 12,
|
20
|
+
left_xs: 24,
|
21
|
+
width_xs: 272,
|
22
|
+
xs_updatedOn: new Date().getTime()
|
23
|
+
};
|
24
|
+
const elementXsValues = {
|
25
|
+
[ELEMENT_CASE.ADD_TEXT]: {
|
26
|
+
...commonXsValues,
|
27
|
+
height_xs: 50
|
28
|
+
},
|
29
|
+
[ELEMENT_CASE.ADD_BUTTON]: {
|
30
|
+
...commonXsValues,
|
31
|
+
height_xs: 50
|
32
|
+
},
|
33
|
+
[ELEMENT_CASE.ADD_SIGNATURE]: {
|
34
|
+
...commonXsValues,
|
35
|
+
height_xs: 173
|
36
|
+
},
|
37
|
+
[ELEMENT_CASE.ADD_IMAGE]: {
|
38
|
+
...commonXsValues,
|
39
|
+
height_xs: 80
|
40
|
+
},
|
41
|
+
[ELEMENT_CASE.ADD_VIDEO]: {
|
42
|
+
...commonXsValues,
|
43
|
+
height_xs: 300
|
44
|
+
},
|
45
|
+
[ELEMENT_CASE.ADD_TABLE]: {
|
46
|
+
...commonXsValues,
|
47
|
+
height_xs: 165
|
48
|
+
},
|
49
|
+
[ELEMENT_CASE.ADD_CODE]: {
|
50
|
+
...commonXsValues,
|
51
|
+
height: 300
|
52
|
+
},
|
53
|
+
[ELEMENT_CASE.ADD_BOX]: {
|
54
|
+
...commonXsValues,
|
55
|
+
height_xs: 300
|
56
|
+
},
|
57
|
+
[ELEMENT_CASE.ADD_FORM]: {
|
58
|
+
...commonXsValues,
|
59
|
+
height_xs: 80
|
60
|
+
},
|
61
|
+
[ELEMENT_CASE.ADD_APP_HEADER]: {
|
62
|
+
...commonXsValues,
|
63
|
+
height_xs: 80
|
64
|
+
},
|
65
|
+
[ELEMENT_CASE.ADD_DIVIDER]: {
|
66
|
+
...commonXsValues,
|
67
|
+
height_xs: 24
|
68
|
+
}
|
69
|
+
};
|
70
|
+
export const findMaxYValue = (sectionItems, breakpoint) => {
|
71
|
+
let maxY = 0;
|
72
|
+
sectionItems.forEach(item => {
|
73
|
+
const isHidden = breakpoint === "xs" && item.children.some(c => c.xsHidden);
|
74
|
+
if (item?.type && RND_ITEMS.includes(item.type) && !isHidden) {
|
75
|
+
const {
|
76
|
+
bottom
|
77
|
+
} = getElementOffset(item, breakpoint === "lg" ? "lg" : "xs");
|
78
|
+
maxY = Math.max(maxY, bottom);
|
79
|
+
}
|
80
|
+
});
|
81
|
+
return maxY;
|
82
|
+
};
|
83
|
+
export const convertToGridArea = y => {
|
84
|
+
// Calculate grid position
|
85
|
+
const row = Math.floor(y / ROW_HEIGHT) + 1;
|
86
|
+
|
87
|
+
// to calculate difference inside the grid
|
88
|
+
const marginTop = Math.abs((row - 1) * ROW_HEIGHT - y);
|
89
|
+
|
90
|
+
// Update grid area
|
91
|
+
const gridArea = `${row} / 1 / ${row + 1} / 2`;
|
92
|
+
return {
|
93
|
+
gridArea,
|
94
|
+
marginTop
|
95
|
+
};
|
96
|
+
};
|
97
|
+
export const getNewElementXsValues = (type, sectionItems) => {
|
98
|
+
const values = elementXsValues[type] || {};
|
99
|
+
const y = sectionItems?.length ? findMaxYValue(sectionItems) : 0;
|
100
|
+
const {
|
101
|
+
gridArea,
|
102
|
+
marginTop
|
103
|
+
} = convertToGridArea(y);
|
104
|
+
const BUFFER_MARGIN_TOP = 12;
|
105
|
+
const xsVal = {
|
106
|
+
...values,
|
107
|
+
gridArea_xs: gridArea,
|
108
|
+
marginTop_xs: marginTop + BUFFER_MARGIN_TOP
|
109
|
+
};
|
110
|
+
const sectionHeightXs = y + values?.height_xs + BUFFER_MARGIN_TOP + 12;
|
111
|
+
return {
|
112
|
+
xsVal,
|
113
|
+
sectionHeightXs
|
114
|
+
};
|
115
|
+
};
|
@@ -247,6 +247,9 @@ const useFreeGridStyles = ({
|
|
247
247
|
},
|
248
248
|
"& > .simple-text": {
|
249
249
|
display: "none"
|
250
|
+
},
|
251
|
+
"& > .edt-paragraphs": {
|
252
|
+
display: "none"
|
250
253
|
}
|
251
254
|
},
|
252
255
|
"& .fgi_type_form": {
|
@@ -309,6 +312,12 @@ const useFreeGridStyles = ({
|
|
309
312
|
"& .toolbtn.remove": {
|
310
313
|
display: "none"
|
311
314
|
}
|
315
|
+
},
|
316
|
+
"& .edt-headings": {
|
317
|
+
margin: "0px"
|
318
|
+
},
|
319
|
+
"& .edt-paragraphs": {
|
320
|
+
margin: "0px"
|
312
321
|
}
|
313
322
|
},
|
314
323
|
"& .fgi_type_embedScript": {
|
@@ -350,6 +359,12 @@ const useFreeGridStyles = ({
|
|
350
359
|
"& .fgi_type_text": {
|
351
360
|
"& .edt-headings": {
|
352
361
|
margin: "0px"
|
362
|
+
},
|
363
|
+
"& .edt-paragraphs": {
|
364
|
+
margin: "0px"
|
365
|
+
},
|
366
|
+
"& blockquote": {
|
367
|
+
margin: "0px !important"
|
353
368
|
}
|
354
369
|
},
|
355
370
|
/** element toolbar hide */
|
@@ -292,7 +292,7 @@ const GridItem = props => {
|
|
292
292
|
...getBRProps,
|
293
293
|
display: "flex",
|
294
294
|
flexDirection: flexDirection || "column",
|
295
|
-
background: bgColor
|
295
|
+
background: bgColor,
|
296
296
|
borderColor: getBorderColor(),
|
297
297
|
borderWidth: borderWidth || "1px",
|
298
298
|
borderStyle: borderStyle || "solid",
|
@@ -49,7 +49,10 @@ const SimpleText = props => {
|
|
49
49
|
className: `simple-text ${nextType}`,
|
50
50
|
sx: classes.root,
|
51
51
|
key: `para_${path.join("|")}`
|
52
|
-
}, children,
|
52
|
+
}, children, /*#__PURE__*/_jsx("span", {
|
53
|
+
contentEditable: false,
|
54
|
+
className: "cursorStabilityElement"
|
55
|
+
}), openAI ? null : /*#__PURE__*/_jsx("span", {
|
53
56
|
contentEditable: false,
|
54
57
|
className: "placeholder-simple-text",
|
55
58
|
children: isEmptyEditor ? editorPlaceholder || translation("writeSomethingPlaceHolder") : showPlaceHolder ? opacity && selected ? /*#__PURE__*/_jsxs(_Fragment, {
|
@@ -35,8 +35,8 @@ const SimpleTextStyle = ({
|
|
35
35
|
height: "24px",
|
36
36
|
overflow: "hidden",
|
37
37
|
fontSize: "14px",
|
38
|
-
display:
|
39
|
-
alignItems:
|
38
|
+
display: "inline-flex",
|
39
|
+
alignItems: "center",
|
40
40
|
"& .bg-pad-sl": {
|
41
41
|
padding: "2px 4px 2px 4px",
|
42
42
|
background: "transparent",
|
@@ -291,7 +291,8 @@ const Table = props => {
|
|
291
291
|
dragRowBtnCls,
|
292
292
|
tablePath: path,
|
293
293
|
openSetttings,
|
294
|
-
exandTools
|
294
|
+
exandTools,
|
295
|
+
tableNode: element
|
295
296
|
},
|
296
297
|
children: [/*#__PURE__*/_jsxs("div", {
|
297
298
|
style: {
|
@@ -307,7 +308,7 @@ const Table = props => {
|
|
307
308
|
onScroll: handleScroll,
|
308
309
|
onMouseOver: onMouseOver,
|
309
310
|
onMouseLeave: onMouseLeave,
|
310
|
-
className:
|
311
|
+
className: "custom-scroll",
|
311
312
|
children: [/*#__PURE__*/_jsx(TableComp, {
|
312
313
|
className: readOnly ? "readOnly" : "",
|
313
314
|
sx: {
|
@@ -345,8 +346,8 @@ const Table = props => {
|
|
345
346
|
handleAction: handleAction,
|
346
347
|
exandTools: exandTools,
|
347
348
|
openSetttings: openSetttings,
|
348
|
-
|
349
|
-
|
349
|
+
hideTools: hideTools,
|
350
|
+
translation: translation
|
350
351
|
}), /*#__PURE__*/_jsx(MoreTableSettings, {
|
351
352
|
exandTools: exandTools,
|
352
353
|
handleAction: handleAction,
|
@@ -13,7 +13,7 @@ import { Droppable } from "./Droppable";
|
|
13
13
|
import { useDndContext } from "@dnd-kit/core";
|
14
14
|
import { getNodeWithType } from "../../utils/helper";
|
15
15
|
import { ResizeIcon } from "../../common/iconListV2";
|
16
|
-
import { isEmptyTextNode } from "../../helper";
|
16
|
+
import { getTextColor, isEmptyTextNode } from "../../helper";
|
17
17
|
import SimpleText from "../SimpleText";
|
18
18
|
import { jsx as _jsx } from "react/jsx-runtime";
|
19
19
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
@@ -443,8 +443,10 @@ const TableCell = props => {
|
|
443
443
|
};
|
444
444
|
const showRowDragBtn = (showRowDrag || isRowDragging) && containerEle?.scrollLeft <= 0;
|
445
445
|
const TableResizer = isMobile && hoverCol === column ? MobileResizer : Resizer;
|
446
|
+
const cellTextColor = entireTextColor || rowProps?.textColor || parentProps?.textColor;
|
447
|
+
const textStyles = cellTextColor ? getTextColor(cellTextColor) : "inherit";
|
446
448
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
447
|
-
children: [/*#__PURE__*/_jsxs(
|
449
|
+
children: [/*#__PURE__*/_jsxs(Box, {
|
448
450
|
...element.attr,
|
449
451
|
...attributes,
|
450
452
|
className: `editor-table-cell ${hasSelected ? "selection" : ""}`,
|
@@ -455,14 +457,19 @@ const TableCell = props => {
|
|
455
457
|
fontFamily: entireFontFamily || "inherit",
|
456
458
|
fontWeight: entireFontWeight || "inherit",
|
457
459
|
fontSize: entireTextSize || "inherit",
|
458
|
-
color: entireTextColor || "inherit",
|
459
460
|
cursor: "text",
|
460
461
|
verticalAlign: "top",
|
461
462
|
padding: "0px",
|
462
463
|
...(sizeProps || {})
|
463
464
|
},
|
465
|
+
sx: {
|
466
|
+
'& span[data-slate-string="true"]': {
|
467
|
+
...textStyles
|
468
|
+
}
|
469
|
+
},
|
464
470
|
...tbProps,
|
465
471
|
"data-cell": path.toString(),
|
472
|
+
component: "td",
|
466
473
|
children: [isFirstRow && currentDraggingType === "col" ? /*#__PURE__*/_jsx(Droppable, {
|
467
474
|
...dndProps,
|
468
475
|
dragType: currentDraggingType,
|
@@ -1,8 +1,14 @@
|
|
1
1
|
import React, { useEffect, useState } from "react";
|
2
|
-
import {
|
2
|
+
import { Text } from "slate";
|
3
3
|
import { useSlate } from "slate-react";
|
4
|
-
import { getNodeText } from "../../utils/helper";
|
4
|
+
import { getNodeText, getNodeWithType } from "../../utils/helper";
|
5
5
|
import { jsx as _jsx } from "react/jsx-runtime";
|
6
|
+
const isEmptyTextNode = node => {
|
7
|
+
if (Text.isText(node)) {
|
8
|
+
return !node.text.trim();
|
9
|
+
}
|
10
|
+
return false;
|
11
|
+
};
|
6
12
|
const Title = props => {
|
7
13
|
const {
|
8
14
|
attributes,
|
@@ -31,9 +37,8 @@ const useDetectExitFromTitle = (titleNode, onSaveTitle) => {
|
|
31
37
|
if (!editor.selection) return;
|
32
38
|
|
33
39
|
// Get the current node where the cursor is
|
34
|
-
const [nodeEntry] =
|
35
|
-
at: editor.selection
|
36
|
-
match: n => n.type === "title"
|
40
|
+
const [nodeEntry] = getNodeWithType(editor, "title", {
|
41
|
+
at: editor.selection
|
37
42
|
});
|
38
43
|
if (nodeEntry) {
|
39
44
|
setWasInsideTitle(true); // User was inside the title
|
@@ -47,10 +52,4 @@ const useDetectExitFromTitle = (titleNode, onSaveTitle) => {
|
|
47
52
|
}
|
48
53
|
}, [editor.selection]);
|
49
54
|
return null;
|
50
|
-
};
|
51
|
-
const isEmptyTextNode = node => {
|
52
|
-
if (Text.isText(node)) {
|
53
|
-
return !node.text.trim();
|
54
|
-
}
|
55
|
-
return false;
|
56
55
|
};
|