@flozy/editor 11.2.2 → 11.2.4
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 +86 -24
- package/dist/Editor/DialogWrapper.js +31 -25
- package/dist/Editor/Editor.css +37 -4
- package/dist/Editor/Elements/AI/PopoverAIInput.js +11 -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 +239 -11
- package/dist/Editor/Elements/Attachments/AttachmentsButton.js +11 -4
- package/dist/Editor/Elements/Button/EditorButton.js +22 -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.js +37 -43
- package/dist/Editor/Elements/Embed/Image.js +307 -26
- package/dist/Editor/Elements/Embed/Video.js +355 -35
- package/dist/Editor/Elements/EmbedScript/EmbedScriptPopup.js +9 -6
- package/dist/Editor/Elements/EmbedScript/styles.js +17 -1
- package/dist/Editor/Elements/Form/FormField.js +1 -1
- package/dist/Editor/Elements/Form/Workflow/Styles.js +25 -22
- package/dist/Editor/Elements/Form/Workflow/constant.js +25 -1
- package/dist/Editor/Elements/FreeGrid/FreeGrid.js +37 -76
- package/dist/Editor/Elements/FreeGrid/FreeGridBox.js +9 -5
- package/dist/Editor/Elements/FreeGrid/FreeGridItem.js +3 -1
- package/dist/Editor/Elements/FreeGrid/helper.js +194 -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/Table/Table.js +2 -1
- package/dist/Editor/Elements/Table/TableCell.js +10 -3
- package/dist/Editor/Elements/Title/title.js +4 -5
- package/dist/Editor/Elements/TopBanner/TopBanner.js +4 -2
- package/dist/Editor/Elements/TopBanner/TopBannerButton.js +5 -3
- package/dist/Editor/Styles/EditorStyles.js +19 -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 +33 -29
- package/dist/Editor/Toolbar/Mini/MiniToolbar.js +2 -1
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/MiniColorPicker.js +3 -1
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectFontSize.js +25 -23
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectTypography.js +167 -42
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/index.js +15 -5
- package/dist/Editor/Toolbar/PopupTool/PopperHeader.js +2 -1
- package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +65 -7
- package/dist/Editor/Toolbar/PopupTool/TextFormat.js +66 -12
- package/dist/Editor/Toolbar/PopupTool/ThemeTextFormat.js +439 -0
- package/dist/Editor/Toolbar/PopupTool/index.js +6 -4
- package/dist/Editor/Toolbar/toolbarGroups.js +48 -6
- 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 -19
- 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 +1 -0
- package/dist/Editor/common/Icon.js +28 -0
- package/dist/Editor/common/ImageSelector/ImageSelector.js +66 -13
- package/dist/Editor/common/ImageSelector/Options/ChooseAssets.js +1 -1
- package/dist/Editor/common/ImageSelector/Options/RecentUploads.js +483 -0
- package/dist/Editor/common/ImageSelector/Options/Upload.js +26 -11
- package/dist/Editor/common/ImageSelector/Styles.js +3 -9
- 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 +3 -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 +2 -0
- 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/Theme/MainThemeProvider.js +17 -0
- package/dist/Editor/common/RnD/Theme/ViewportStimulator.js +6 -3
- package/dist/Editor/common/RnD/Utils/gridDropItem.js +28 -11
- package/dist/Editor/common/RnD/Utils/index.js +3 -1
- package/dist/Editor/common/RnD/VirtualElement/VirtualTextElement.js +52 -63
- package/dist/Editor/common/RnD/VirtualElement/helper.js +248 -68
- package/dist/Editor/common/RnD/VirtualElement/styles.js +22 -0
- package/dist/Editor/common/RnD/index.js +61 -14
- package/dist/Editor/common/Shorthands/elements.js +55 -3
- 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 +13 -3
- 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/color.js +36 -10
- package/dist/Editor/common/StyleBuilder/fieldTypes/fontSize.js +13 -4
- package/dist/Editor/common/StyleBuilder/fieldTypes/menusArray.js +2 -0
- package/dist/Editor/common/StyleBuilder/fieldTypes/text.js +16 -4
- 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 +118 -17
- package/dist/Editor/common/UploaderWithProgress.js +183 -0
- package/dist/Editor/common/iconslist.js +21 -0
- package/dist/Editor/commonStyle.js +111 -53
- package/dist/Editor/helper/index.js +4 -1
- package/dist/Editor/helper/theme.js +203 -2
- package/dist/Editor/hooks/useEditorTheme.js +153 -0
- package/dist/Editor/hooks/useMouseMove.js +12 -3
- package/dist/Editor/hooks/useTable.js +62 -1
- package/dist/Editor/hooks/useThemeValues.js +63 -0
- package/dist/Editor/plugins/withEmbeds.js +1 -1
- package/dist/Editor/plugins/withHTML.js +56 -3
- package/dist/Editor/plugins/withTable.js +1 -1
- package/dist/Editor/service/fileTracking.js +22 -0
- package/dist/Editor/service/fileupload.js +77 -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 +165 -40
- package/dist/Editor/utils/accordion.js +1 -1
- package/dist/Editor/utils/attachments.js +138 -2
- package/dist/Editor/utils/button.js +1 -17
- package/dist/Editor/utils/font.js +40 -37
- package/dist/Editor/utils/formfield.js +2 -2
- package/dist/Editor/utils/helper.js +101 -3
- package/dist/Editor/utils/insertAppHeader.js +8 -4
- package/package.json +1 -1
|
@@ -22,7 +22,9 @@ 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 { getElementValues } from "./helper";
|
|
25
26
|
import updateFormName from "../../utils/updateFormName";
|
|
27
|
+
import { GetsectionBgImage } from "../../utils/helper";
|
|
26
28
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
27
29
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
28
30
|
const MAX_DEVICE_WIDTH = {
|
|
@@ -183,6 +185,11 @@ const FreeGrid = props => {
|
|
|
183
185
|
const handleAddElementClick = type => () => {
|
|
184
186
|
const isEmpty = isEmptySection();
|
|
185
187
|
const insertAt = isEmpty ? [...path, 0] : [...path, childrenCountRef.current];
|
|
188
|
+
const id = crypto?.randomUUID();
|
|
189
|
+
const {
|
|
190
|
+
elValues,
|
|
191
|
+
sectionVal
|
|
192
|
+
} = getElementValues(type, element?.children, breakpoint);
|
|
186
193
|
switch (type) {
|
|
187
194
|
case "addText":
|
|
188
195
|
Transforms.insertNodes(editor, [{
|
|
@@ -194,12 +201,7 @@ const FreeGrid = props => {
|
|
|
194
201
|
text: "Text"
|
|
195
202
|
}]
|
|
196
203
|
}],
|
|
197
|
-
|
|
198
|
-
left: 50,
|
|
199
|
-
marginTop: 0,
|
|
200
|
-
top: 0,
|
|
201
|
-
width: 170,
|
|
202
|
-
height: 30
|
|
204
|
+
...(elValues || {})
|
|
203
205
|
}], {
|
|
204
206
|
at: [...insertAt]
|
|
205
207
|
});
|
|
@@ -217,29 +219,10 @@ const FreeGrid = props => {
|
|
|
217
219
|
linkType: "webAddress"
|
|
218
220
|
},
|
|
219
221
|
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
222
|
textAlign: "center",
|
|
235
223
|
label: "Get Started"
|
|
236
224
|
}],
|
|
237
|
-
|
|
238
|
-
left: 50,
|
|
239
|
-
marginTop: 0,
|
|
240
|
-
top: 0,
|
|
241
|
-
width: 143,
|
|
242
|
-
height: 50
|
|
225
|
+
...(elValues || {})
|
|
243
226
|
}], {
|
|
244
227
|
at: [...insertAt]
|
|
245
228
|
});
|
|
@@ -259,14 +242,7 @@ const FreeGrid = props => {
|
|
|
259
242
|
date: ""
|
|
260
243
|
}
|
|
261
244
|
}],
|
|
262
|
-
|
|
263
|
-
left: 50,
|
|
264
|
-
marginTop: 0,
|
|
265
|
-
top: 0,
|
|
266
|
-
width: 217,
|
|
267
|
-
height: 173,
|
|
268
|
-
width_xs: 217,
|
|
269
|
-
height_xs: 173
|
|
245
|
+
...(elValues || {})
|
|
270
246
|
}], {
|
|
271
247
|
at: [...insertAt]
|
|
272
248
|
});
|
|
@@ -282,14 +258,11 @@ const FreeGrid = props => {
|
|
|
282
258
|
images: [],
|
|
283
259
|
children: [{
|
|
284
260
|
text: ""
|
|
285
|
-
}]
|
|
261
|
+
}],
|
|
262
|
+
fromFreeGrid: true,
|
|
263
|
+
uniqueId: id
|
|
286
264
|
}],
|
|
287
|
-
|
|
288
|
-
left: 50,
|
|
289
|
-
marginTop: 0,
|
|
290
|
-
top: 0,
|
|
291
|
-
width: 170,
|
|
292
|
-
height: 80
|
|
265
|
+
...(elValues || {})
|
|
293
266
|
}], {
|
|
294
267
|
at: [...insertAt]
|
|
295
268
|
});
|
|
@@ -299,10 +272,11 @@ const FreeGrid = props => {
|
|
|
299
272
|
...insertFreeGridItem("video", createEmbedNode("video", {
|
|
300
273
|
url: "",
|
|
301
274
|
alt: "",
|
|
302
|
-
images: []
|
|
275
|
+
images: [],
|
|
276
|
+
fromFreeGrid: true,
|
|
277
|
+
uniqueId: id
|
|
303
278
|
}), {
|
|
304
|
-
|
|
305
|
-
width: 650
|
|
279
|
+
...(elValues || {})
|
|
306
280
|
})
|
|
307
281
|
}], {
|
|
308
282
|
at: [...insertAt]
|
|
@@ -313,8 +287,7 @@ const FreeGrid = props => {
|
|
|
313
287
|
...insertFreeGridItem("table", {
|
|
314
288
|
...DEFAULT_TABLE_NODE()
|
|
315
289
|
}, {
|
|
316
|
-
|
|
317
|
-
width: 400
|
|
290
|
+
...(elValues || {})
|
|
318
291
|
})
|
|
319
292
|
}], {
|
|
320
293
|
at: [...insertAt]
|
|
@@ -333,12 +306,7 @@ const FreeGrid = props => {
|
|
|
333
306
|
isEncoded: true,
|
|
334
307
|
isSanitized: true
|
|
335
308
|
}],
|
|
336
|
-
|
|
337
|
-
left: 50,
|
|
338
|
-
marginTop: 0,
|
|
339
|
-
top: 0,
|
|
340
|
-
width: 400,
|
|
341
|
-
height: 300
|
|
309
|
+
...(elValues || {})
|
|
342
310
|
}], {
|
|
343
311
|
at: [...insertAt]
|
|
344
312
|
});
|
|
@@ -350,7 +318,9 @@ const FreeGrid = props => {
|
|
|
350
318
|
children: [{
|
|
351
319
|
text: ""
|
|
352
320
|
}]
|
|
353
|
-
}, {
|
|
321
|
+
}, {
|
|
322
|
+
...(elValues || {})
|
|
323
|
+
}, "freegridBox")
|
|
354
324
|
}], {
|
|
355
325
|
at: [...insertAt]
|
|
356
326
|
});
|
|
@@ -360,8 +330,7 @@ const FreeGrid = props => {
|
|
|
360
330
|
...insertFreeGridItem("form", {
|
|
361
331
|
...FORM_NODE()
|
|
362
332
|
}, {
|
|
363
|
-
|
|
364
|
-
width: 400
|
|
333
|
+
...(elValues || {})
|
|
365
334
|
})
|
|
366
335
|
}], {
|
|
367
336
|
at: [...insertAt]
|
|
@@ -374,8 +343,7 @@ const FreeGrid = props => {
|
|
|
374
343
|
menus: null
|
|
375
344
|
})
|
|
376
345
|
}, {
|
|
377
|
-
|
|
378
|
-
width: 400
|
|
346
|
+
...(elValues || {})
|
|
379
347
|
})
|
|
380
348
|
}], {
|
|
381
349
|
at: [...insertAt]
|
|
@@ -391,29 +359,21 @@ const FreeGrid = props => {
|
|
|
391
359
|
text: ""
|
|
392
360
|
}]
|
|
393
361
|
}],
|
|
394
|
-
|
|
395
|
-
left: 50,
|
|
396
|
-
marginTop: 0,
|
|
397
|
-
top: 0,
|
|
398
|
-
width: 170,
|
|
399
|
-
height: 30
|
|
362
|
+
...(elValues || {})
|
|
400
363
|
}], {
|
|
401
364
|
at: [...insertAt]
|
|
402
365
|
});
|
|
403
366
|
break;
|
|
404
367
|
default:
|
|
405
368
|
}
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
at: path
|
|
415
|
-
});
|
|
416
|
-
}
|
|
369
|
+
setSelectedElement({});
|
|
370
|
+
// increase the section height if new element is inserted based on auto align
|
|
371
|
+
Transforms.setNodes(editor, {
|
|
372
|
+
...sectionVal,
|
|
373
|
+
updated_at: new Date().getTime()
|
|
374
|
+
}, {
|
|
375
|
+
at: path
|
|
376
|
+
});
|
|
417
377
|
count.current = count.current + 1;
|
|
418
378
|
|
|
419
379
|
// focus on newly added element
|
|
@@ -498,6 +458,7 @@ const FreeGrid = props => {
|
|
|
498
458
|
// return eleId;
|
|
499
459
|
// }, [autoAlign, updated_at, breakpoint, path]);
|
|
500
460
|
|
|
461
|
+
const sectionBgImage = GetsectionBgImage(sectionBackgroundImage);
|
|
501
462
|
return /*#__PURE__*/_jsx(FreeGridContext.Provider, {
|
|
502
463
|
value: {
|
|
503
464
|
isInteracting,
|
|
@@ -519,7 +480,7 @@ const FreeGrid = props => {
|
|
|
519
480
|
style: {
|
|
520
481
|
position: "relative",
|
|
521
482
|
"--height": `${height}px`,
|
|
522
|
-
display:
|
|
483
|
+
display: "block" //for test purpose
|
|
523
484
|
},
|
|
524
485
|
|
|
525
486
|
dataSets: {
|
|
@@ -616,7 +577,7 @@ const FreeGrid = props => {
|
|
|
616
577
|
...classes.root,
|
|
617
578
|
...freegridSX,
|
|
618
579
|
background: sectionBgColor || "rgba(255,255,255,1)",
|
|
619
|
-
|
|
580
|
+
...sectionBgImage,
|
|
620
581
|
backgroundSize: "cover"
|
|
621
582
|
},
|
|
622
583
|
"data-path": path.join("|"),
|
|
@@ -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";
|
|
@@ -157,6 +157,11 @@ const FreeGridBox = props => {
|
|
|
157
157
|
};
|
|
158
158
|
const repeatTimes = Math.floor(height / ROW_HEIGHT);
|
|
159
159
|
const sectionTypeOptions = (itemOptions?.box || []).filter(f => (hideTools || []).indexOf(f) === -1);
|
|
160
|
+
const boxSp = groupByBreakpoint({
|
|
161
|
+
borderRadius: {
|
|
162
|
+
...getBreakPointsValue(sectionBorderRadius || {}, null, "overrideBorderRadius", true)
|
|
163
|
+
}
|
|
164
|
+
}, theme);
|
|
160
165
|
const isBoxHeader = useMemo(() => {
|
|
161
166
|
return element?.children?.some(c => c.childType === "appHeader" && !c.xs_updatedOn);
|
|
162
167
|
}, [element]);
|
|
@@ -192,7 +197,8 @@ const FreeGridBox = props => {
|
|
|
192
197
|
"data-margin-top-xs": marginTop_xs,
|
|
193
198
|
"data-height-xs": height_xs,
|
|
194
199
|
"data-width-xs": width_xs,
|
|
195
|
-
"data-left-xs": left_xs
|
|
200
|
+
"data-left-xs": left_xs,
|
|
201
|
+
"data-width-lg": width
|
|
196
202
|
},
|
|
197
203
|
gridArea: gridArea,
|
|
198
204
|
onChange: onChange,
|
|
@@ -226,9 +232,7 @@ const FreeGridBox = props => {
|
|
|
226
232
|
"--rows": `repeat(${repeatTimes}, ${ROW_HEIGHT}px)`
|
|
227
233
|
},
|
|
228
234
|
sx: {
|
|
229
|
-
|
|
230
|
-
...getBreakPointsValue(sectionBorderRadius || {}, null, "overrideBorderRadius", true)
|
|
231
|
-
},
|
|
235
|
+
...boxSp,
|
|
232
236
|
background: sectionBgColor,
|
|
233
237
|
backgroundImage: sectionBackgroundImage ? `url('${sectionBackgroundImage}')` : "",
|
|
234
238
|
borderColor: borderColor || "transparent",
|
|
@@ -296,7 +296,8 @@ const FreeGridItem = props => {
|
|
|
296
296
|
"data-margin-top-xs": marginTop_xs,
|
|
297
297
|
"data-height-xs": height_xs,
|
|
298
298
|
"data-width-xs": width_xs,
|
|
299
|
-
"data-left-xs": left_xs
|
|
299
|
+
"data-left-xs": left_xs,
|
|
300
|
+
"data-width-lg": width
|
|
300
301
|
},
|
|
301
302
|
defaultStyle: {
|
|
302
303
|
height: `${height}px`,
|
|
@@ -321,6 +322,7 @@ const FreeGridItem = props => {
|
|
|
321
322
|
customProps: customProps,
|
|
322
323
|
translation: translation,
|
|
323
324
|
xsHidden: xsHidden,
|
|
325
|
+
disableClick: element?.children?.[0]?.isUploading && (element?.childType === "image" || element?.childType === "video"),
|
|
324
326
|
children: /*#__PURE__*/_jsxs(Box, {
|
|
325
327
|
component: "div",
|
|
326
328
|
...attributes,
|
|
@@ -0,0 +1,194 @@
|
|
|
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 elementValues = {
|
|
25
|
+
[ELEMENT_CASE.ADD_TEXT]: {
|
|
26
|
+
gridArea: "3 / 1 / 4 / 2",
|
|
27
|
+
left: 50,
|
|
28
|
+
marginTop: 0,
|
|
29
|
+
top: 0,
|
|
30
|
+
width: 170,
|
|
31
|
+
height: 30,
|
|
32
|
+
height_xs: 50,
|
|
33
|
+
...commonXsValues
|
|
34
|
+
},
|
|
35
|
+
[ELEMENT_CASE.ADD_BUTTON]: {
|
|
36
|
+
gridArea: "3 / 1 / 4 / 2",
|
|
37
|
+
left: 50,
|
|
38
|
+
marginTop: 0,
|
|
39
|
+
top: 0,
|
|
40
|
+
width: 143,
|
|
41
|
+
height: 50,
|
|
42
|
+
height_xs: 50,
|
|
43
|
+
...commonXsValues
|
|
44
|
+
},
|
|
45
|
+
[ELEMENT_CASE.ADD_SIGNATURE]: {
|
|
46
|
+
left: 50,
|
|
47
|
+
marginTop: 0,
|
|
48
|
+
top: 0,
|
|
49
|
+
width: 217,
|
|
50
|
+
height: 173,
|
|
51
|
+
height_xs: 173,
|
|
52
|
+
...commonXsValues
|
|
53
|
+
},
|
|
54
|
+
[ELEMENT_CASE.ADD_IMAGE]: {
|
|
55
|
+
gridArea: "3 / 1 / 4 / 2",
|
|
56
|
+
left: 50,
|
|
57
|
+
marginTop: 0,
|
|
58
|
+
top: 0,
|
|
59
|
+
width: 170,
|
|
60
|
+
height: 80,
|
|
61
|
+
height_xs: 80,
|
|
62
|
+
...commonXsValues
|
|
63
|
+
},
|
|
64
|
+
[ELEMENT_CASE.ADD_VIDEO]: {
|
|
65
|
+
height: 370,
|
|
66
|
+
width: 650,
|
|
67
|
+
height_xs: 300,
|
|
68
|
+
...commonXsValues
|
|
69
|
+
},
|
|
70
|
+
[ELEMENT_CASE.ADD_TABLE]: {
|
|
71
|
+
height: 150,
|
|
72
|
+
width: 400,
|
|
73
|
+
height_xs: 165,
|
|
74
|
+
...commonXsValues
|
|
75
|
+
},
|
|
76
|
+
[ELEMENT_CASE.ADD_CODE]: {
|
|
77
|
+
gridArea: "3 / 1 / 4 / 2",
|
|
78
|
+
left: 50,
|
|
79
|
+
marginTop: 0,
|
|
80
|
+
top: 0,
|
|
81
|
+
width: 400,
|
|
82
|
+
height: 300,
|
|
83
|
+
...commonXsValues
|
|
84
|
+
},
|
|
85
|
+
[ELEMENT_CASE.ADD_BOX]: {
|
|
86
|
+
height_xs: 300,
|
|
87
|
+
...commonXsValues
|
|
88
|
+
},
|
|
89
|
+
[ELEMENT_CASE.ADD_FORM]: {
|
|
90
|
+
height: 92,
|
|
91
|
+
width: 400,
|
|
92
|
+
height_xs: 80,
|
|
93
|
+
...commonXsValues
|
|
94
|
+
},
|
|
95
|
+
[ELEMENT_CASE.ADD_APP_HEADER]: {
|
|
96
|
+
height: 60,
|
|
97
|
+
width: 400,
|
|
98
|
+
height_xs: 80,
|
|
99
|
+
...commonXsValues
|
|
100
|
+
},
|
|
101
|
+
[ELEMENT_CASE.ADD_DIVIDER]: {
|
|
102
|
+
gridArea: "3 / 1 / 4 / 2",
|
|
103
|
+
left: 50,
|
|
104
|
+
marginTop: 0,
|
|
105
|
+
top: 0,
|
|
106
|
+
width: 170,
|
|
107
|
+
height: 30,
|
|
108
|
+
height_xs: 24,
|
|
109
|
+
...commonXsValues
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
export const findMaxYValue = (sectionItems, breakpoint) => {
|
|
113
|
+
let maxY = 0;
|
|
114
|
+
sectionItems.forEach(item => {
|
|
115
|
+
if (!item?.type) {
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
const isHidden = breakpoint === "xs" && item.children.some(c => c.xsHidden);
|
|
119
|
+
if (item?.type && RND_ITEMS.includes(item.type) && !isHidden) {
|
|
120
|
+
const {
|
|
121
|
+
bottom
|
|
122
|
+
} = getElementOffset(item, breakpoint === "lg" ? "lg" : "xs");
|
|
123
|
+
maxY = Math.max(maxY, bottom);
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
return maxY;
|
|
127
|
+
};
|
|
128
|
+
export const convertToGridArea = y => {
|
|
129
|
+
// Calculate grid position
|
|
130
|
+
const row = Math.floor(y / ROW_HEIGHT) + 1;
|
|
131
|
+
|
|
132
|
+
// to calculate difference inside the grid
|
|
133
|
+
const marginTop = Math.abs((row - 1) * ROW_HEIGHT - y);
|
|
134
|
+
|
|
135
|
+
// Update grid area
|
|
136
|
+
const gridArea = `${row} / 1 / ${row + 1} / 2`;
|
|
137
|
+
return {
|
|
138
|
+
gridArea,
|
|
139
|
+
marginTop
|
|
140
|
+
};
|
|
141
|
+
};
|
|
142
|
+
const BUFFER_MARGIN_TOP = 12;
|
|
143
|
+
const getInsertValues = (sectionItems, breakpoint, elValues) => {
|
|
144
|
+
const y_xs = sectionItems?.length ? findMaxYValue(sectionItems, breakpoint) : 0;
|
|
145
|
+
const {
|
|
146
|
+
gridArea,
|
|
147
|
+
marginTop
|
|
148
|
+
} = convertToGridArea(y_xs);
|
|
149
|
+
const appendBp = breakpoint === "lg" ? "" : "_xs";
|
|
150
|
+
const insertPos = {
|
|
151
|
+
[`gridArea${appendBp}`]: gridArea,
|
|
152
|
+
[`marginTop${appendBp}`]: marginTop + BUFFER_MARGIN_TOP
|
|
153
|
+
};
|
|
154
|
+
const sectionHeight = y_xs + elValues[`height${appendBp}`] + BUFFER_MARGIN_TOP + 12;
|
|
155
|
+
return {
|
|
156
|
+
insertPos,
|
|
157
|
+
sectionHeight
|
|
158
|
+
};
|
|
159
|
+
};
|
|
160
|
+
export const getElementValues = (type, sectionItems, breakpoint) => {
|
|
161
|
+
const elValues = elementValues[type] || {};
|
|
162
|
+
let elInsertPos = {};
|
|
163
|
+
let sectionVal = {};
|
|
164
|
+
|
|
165
|
+
// insert element on xs
|
|
166
|
+
const {
|
|
167
|
+
insertPos: insertPos_xs,
|
|
168
|
+
sectionHeight: sectionHeight_xs
|
|
169
|
+
} = getInsertValues(sectionItems, "xs", elValues);
|
|
170
|
+
elInsertPos = {
|
|
171
|
+
...insertPos_xs
|
|
172
|
+
};
|
|
173
|
+
sectionVal.height_xs = sectionHeight_xs;
|
|
174
|
+
|
|
175
|
+
// if user in xs, auto-align lg
|
|
176
|
+
if (breakpoint === "xs") {
|
|
177
|
+
const {
|
|
178
|
+
insertPos: insertPos_lg,
|
|
179
|
+
sectionHeight
|
|
180
|
+
} = getInsertValues(sectionItems, "lg", elValues);
|
|
181
|
+
elInsertPos = {
|
|
182
|
+
...elInsertPos,
|
|
183
|
+
...insertPos_lg
|
|
184
|
+
};
|
|
185
|
+
sectionVal.height = sectionHeight;
|
|
186
|
+
}
|
|
187
|
+
return {
|
|
188
|
+
elValues: {
|
|
189
|
+
...elValues,
|
|
190
|
+
...elInsertPos
|
|
191
|
+
},
|
|
192
|
+
sectionVal
|
|
193
|
+
};
|
|
194
|
+
};
|
|
@@ -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",
|
|
@@ -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,7 +1,7 @@
|
|
|
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
6
|
const Title = props => {
|
|
7
7
|
const {
|
|
@@ -31,9 +31,8 @@ const useDetectExitFromTitle = (titleNode, onSaveTitle) => {
|
|
|
31
31
|
if (!editor.selection) return;
|
|
32
32
|
|
|
33
33
|
// Get the current node where the cursor is
|
|
34
|
-
const [nodeEntry] =
|
|
35
|
-
at: editor.selection
|
|
36
|
-
match: n => n.type === "title"
|
|
34
|
+
const [nodeEntry] = getNodeWithType(editor, "title", {
|
|
35
|
+
at: editor.selection
|
|
37
36
|
});
|
|
38
37
|
if (nodeEntry) {
|
|
39
38
|
setWasInsideTitle(true); // User was inside the title
|
|
@@ -28,8 +28,9 @@ export const TopBannerToolbar = props => {
|
|
|
28
28
|
}
|
|
29
29
|
};
|
|
30
30
|
const onSelectImage = img => {
|
|
31
|
+
const embedURL = typeof img === "string" ? img : img?.embedURL ? img?.embedURL : null;
|
|
31
32
|
updateTopBanner(editor, {
|
|
32
|
-
url:
|
|
33
|
+
url: embedURL
|
|
33
34
|
});
|
|
34
35
|
handleClose();
|
|
35
36
|
};
|
|
@@ -56,7 +57,8 @@ export const TopBannerToolbar = props => {
|
|
|
56
57
|
open: open,
|
|
57
58
|
onClose: handleClose,
|
|
58
59
|
customProps: customProps,
|
|
59
|
-
onSelectImage: onSelectImage
|
|
60
|
+
onSelectImage: onSelectImage,
|
|
61
|
+
disableProgress: true
|
|
60
62
|
})]
|
|
61
63
|
});
|
|
62
64
|
};
|
|
@@ -17,9 +17,10 @@ const TopBannerButton = props => {
|
|
|
17
17
|
translation
|
|
18
18
|
} = customProps;
|
|
19
19
|
const onSelectImage = url => {
|
|
20
|
-
|
|
20
|
+
const embedURL = typeof url === "string" ? url : url?.embedURL ? url?.embedURL : null;
|
|
21
|
+
if (embedURL) {
|
|
21
22
|
insertTopBanner(editor, {
|
|
22
|
-
url
|
|
23
|
+
url: embedURL
|
|
23
24
|
});
|
|
24
25
|
}
|
|
25
26
|
setOpen(false);
|
|
@@ -42,7 +43,8 @@ const TopBannerButton = props => {
|
|
|
42
43
|
open: open,
|
|
43
44
|
onClose: handleClose,
|
|
44
45
|
customProps: customProps,
|
|
45
|
-
onSelectImage: onSelectImage
|
|
46
|
+
onSelectImage: onSelectImage,
|
|
47
|
+
disableProgress: true
|
|
46
48
|
})]
|
|
47
49
|
});
|
|
48
50
|
};
|