@flozy/editor 10.4.5 → 10.4.6
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 +134 -18
- package/dist/Editor/DialogWrapper.js +31 -25
- package/dist/Editor/Editor.css +46 -8
- package/dist/Editor/Elements/AI/PopoverAIInput.js +11 -3
- package/dist/Editor/Elements/Accordion/Accordion.js +46 -9
- package/dist/Editor/Elements/Accordion/AccordionSummary.js +1 -23
- package/dist/Editor/Elements/AppHeader/AppHeader.js +10 -5
- package/dist/Editor/Elements/Button/EditorButton.js +26 -10
- package/dist/Editor/Elements/Carousel/CarouselItem.js +2 -1
- 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 +455 -0
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/MultiSelectType.js +23 -8
- package/dist/Editor/Elements/DataView/Layouts/Options/AddOptions.js +15 -5
- 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 +184 -171
- package/dist/Editor/Elements/Form/FormElements/FormText.js +23 -6
- package/dist/Editor/Elements/Form/FormElements/FormTextArea.js +2 -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 +40 -32
- 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 +8 -8
- package/dist/Editor/Elements/FreeGrid/helper.js +115 -0
- package/dist/Editor/Elements/FreeGrid/styles.js +75 -7
- package/dist/Editor/Elements/Grid/Grid.js +14 -2
- package/dist/Editor/Elements/Grid/GridItem.js +1 -1
- package/dist/Editor/Elements/List/CheckList.js +3 -2
- 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/Signature/Signature.css +2 -1
- package/dist/Editor/Elements/Signature/SignatureOptions/DrawSignature.js +18 -5
- package/dist/Editor/Elements/Signature/SignatureOptions/UploadSignature.js +16 -3
- package/dist/Editor/Elements/SimpleText/index.js +6 -1
- package/dist/Editor/Elements/SimpleText/style.js +2 -2
- package/dist/Editor/Elements/Table/DragButton.js +0 -1
- package/dist/Editor/Elements/Table/Draggable.js +6 -2
- package/dist/Editor/Elements/Table/Styles.js +7 -0
- package/dist/Editor/Elements/Table/Table.js +3 -3
- package/dist/Editor/Elements/Table/TableCell.js +31 -8
- 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/Checkbox/index.js +46 -0
- package/dist/Editor/common/Checkbox/styles.js +45 -0
- package/dist/Editor/common/ColorPickerButton.js +41 -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/ImageSelector.js +2 -2
- package/dist/Editor/common/ImageSelector/Styles.js +3 -9
- package/dist/Editor/common/LinkSettings/NavComponents.js +61 -55
- package/dist/Editor/common/LinkSettings/index.js +82 -80
- package/dist/Editor/common/LinkSettings/navOptions.js +2 -2
- package/dist/Editor/common/LinkSettings/style.js +209 -74
- package/dist/Editor/common/MentionsPopup/index.js +4 -1
- package/dist/Editor/common/RadioGroup/index.js +48 -0
- package/dist/Editor/common/RadioGroup/styles.js +29 -0
- package/dist/Editor/common/RnD/ElementOptions/Actions.js +13 -15
- 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/OtherSettings/Signature.js +4 -3
- 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 +146 -12
- package/dist/Editor/common/RnD/OptionsPopup/index.js +8 -5
- package/dist/Editor/common/RnD/OptionsPopup/style.js +120 -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 +28 -19
- package/dist/Editor/common/RnD/Utils/index.js +3 -1
- package/dist/Editor/common/RnD/VirtualElement/VirtualTextElement.js +42 -58
- package/dist/Editor/common/RnD/VirtualElement/helper.js +323 -132
- package/dist/Editor/common/RnD/VirtualElement/styles.js +16 -0
- package/dist/Editor/common/RnD/index.js +67 -38
- package/dist/Editor/common/Select/index.js +44 -5
- package/dist/Editor/common/Select/styles.js +30 -2
- package/dist/Editor/common/Shorthands/elements.js +65 -11
- package/dist/Editor/common/SnackBar/index.js +43 -0
- package/dist/Editor/common/StyleBuilder/accordionTitleBtnStyle.js +2 -2
- package/dist/Editor/common/StyleBuilder/accordionTitleStyle.js +12 -9
- package/dist/Editor/common/StyleBuilder/buttonStyle.js +4 -2
- package/dist/Editor/common/StyleBuilder/embedVideoStyle.js +4 -0
- 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/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/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/SwipeableDrawer/style.js +14 -12
- package/dist/Editor/common/Uploader.js +16 -0
- package/dist/Editor/common/iconListV2.js +177 -6
- package/dist/Editor/common/iconslist.js +24 -0
- package/dist/Editor/commonStyle.js +186 -62
- package/dist/Editor/helper/index.js +5 -1
- 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/useTable.js +5 -4
- 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 +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 +172 -46
- package/dist/Editor/utils/accordion.js +14 -4
- package/dist/Editor/utils/button.js +1 -17
- package/dist/Editor/utils/customHooks/useTableResize.js +49 -9
- package/dist/Editor/utils/draftToSlate.js +3 -2
- package/dist/Editor/utils/events.js +50 -6
- package/dist/Editor/utils/font.js +40 -37
- package/dist/Editor/utils/form.js +4 -4
- package/dist/Editor/utils/formfield.js +9 -2
- package/dist/Editor/utils/helper.js +210 -26
- package/dist/Editor/utils/insertAppHeader.js +1 -1
- package/dist/Editor/utils/signature.js +2 -9
- package/dist/Editor/utils/updateFormName.js +22 -0
- package/package.json +4 -4
@@ -22,6 +22,8 @@ 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";
|
26
|
+
import updateFormName from "../../utils/updateFormName";
|
25
27
|
import { jsx as _jsx } from "react/jsx-runtime";
|
26
28
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
27
29
|
const MAX_DEVICE_WIDTH = {
|
@@ -35,11 +37,15 @@ export const useFreeGrid = () => {
|
|
35
37
|
return useContext(FreeGridContext);
|
36
38
|
};
|
37
39
|
const FreeGrid = props => {
|
40
|
+
const {
|
41
|
+
theme: appTheme
|
42
|
+
} = useEditorContext();
|
38
43
|
const theme = useTheme();
|
39
44
|
const breakpoint = useBreakpoints(theme);
|
40
45
|
const classes = useFreeGridStyles({
|
41
46
|
theme,
|
42
|
-
MAX_DEVICE_WIDTH: MAX_DEVICE_WIDTH[breakpoint]
|
47
|
+
MAX_DEVICE_WIDTH: MAX_DEVICE_WIDTH[breakpoint],
|
48
|
+
appTheme
|
43
49
|
});
|
44
50
|
const editor = useSlateStatic();
|
45
51
|
const {
|
@@ -136,8 +142,10 @@ const FreeGrid = props => {
|
|
136
142
|
});
|
137
143
|
break;
|
138
144
|
case "duplicateSection":
|
145
|
+
const currentNode = Node.get(editor, cur_root_path);
|
146
|
+
const updatedFormNameNode = updateFormName(currentNode);
|
139
147
|
Transforms.insertNodes(editor, [{
|
140
|
-
...JSON.parse(JSON.stringify(
|
148
|
+
...JSON.parse(JSON.stringify(updatedFormNameNode))
|
141
149
|
}], {
|
142
150
|
at: next_path
|
143
151
|
});
|
@@ -176,6 +184,10 @@ const FreeGrid = props => {
|
|
176
184
|
const handleAddElementClick = type => () => {
|
177
185
|
const isEmpty = isEmptySection();
|
178
186
|
const insertAt = isEmpty ? [...path, 0] : [...path, childrenCountRef.current];
|
187
|
+
const {
|
188
|
+
xsVal,
|
189
|
+
sectionHeightXs
|
190
|
+
} = getNewElementXsValues(type, element?.children);
|
179
191
|
switch (type) {
|
180
192
|
case "addText":
|
181
193
|
Transforms.insertNodes(editor, [{
|
@@ -192,7 +204,8 @@ const FreeGrid = props => {
|
|
192
204
|
marginTop: 0,
|
193
205
|
top: 0,
|
194
206
|
width: 170,
|
195
|
-
height: 30
|
207
|
+
height: 30,
|
208
|
+
...(xsVal || {})
|
196
209
|
}], {
|
197
210
|
at: [...insertAt]
|
198
211
|
});
|
@@ -210,20 +223,6 @@ const FreeGrid = props => {
|
|
210
223
|
linkType: "webAddress"
|
211
224
|
},
|
212
225
|
iconPosition: "start",
|
213
|
-
bgColor: "#2563EB",
|
214
|
-
textColor: "#FFF",
|
215
|
-
borderRadius: {
|
216
|
-
topLeft: 30,
|
217
|
-
topRight: 30,
|
218
|
-
bottomLeft: 30,
|
219
|
-
bottomRight: 30
|
220
|
-
},
|
221
|
-
bannerSpacing: {
|
222
|
-
left: 12,
|
223
|
-
top: 12,
|
224
|
-
right: 12,
|
225
|
-
bottom: 12
|
226
|
-
},
|
227
226
|
textAlign: "center",
|
228
227
|
label: "Get Started"
|
229
228
|
}],
|
@@ -232,7 +231,8 @@ const FreeGrid = props => {
|
|
232
231
|
marginTop: 0,
|
233
232
|
top: 0,
|
234
233
|
width: 143,
|
235
|
-
height: 50
|
234
|
+
height: 50,
|
235
|
+
...(xsVal || {})
|
236
236
|
}], {
|
237
237
|
at: [...insertAt]
|
238
238
|
});
|
@@ -258,8 +258,9 @@ const FreeGrid = props => {
|
|
258
258
|
top: 0,
|
259
259
|
width: 217,
|
260
260
|
height: 173,
|
261
|
-
width_xs: 217,
|
262
|
-
height_xs: 173
|
261
|
+
// width_xs: 217,
|
262
|
+
// height_xs: 173,
|
263
|
+
...(xsVal || {})
|
263
264
|
}], {
|
264
265
|
at: [...insertAt]
|
265
266
|
});
|
@@ -282,7 +283,8 @@ const FreeGrid = props => {
|
|
282
283
|
marginTop: 0,
|
283
284
|
top: 0,
|
284
285
|
width: 170,
|
285
|
-
height: 80
|
286
|
+
height: 80,
|
287
|
+
...(xsVal || {})
|
286
288
|
}], {
|
287
289
|
at: [...insertAt]
|
288
290
|
});
|
@@ -295,7 +297,8 @@ const FreeGrid = props => {
|
|
295
297
|
images: []
|
296
298
|
}), {
|
297
299
|
height: 370,
|
298
|
-
width: 650
|
300
|
+
width: 650,
|
301
|
+
...(xsVal || {})
|
299
302
|
})
|
300
303
|
}], {
|
301
304
|
at: [...insertAt]
|
@@ -307,7 +310,8 @@ const FreeGrid = props => {
|
|
307
310
|
...DEFAULT_TABLE_NODE()
|
308
311
|
}, {
|
309
312
|
height: 150,
|
310
|
-
width: 400
|
313
|
+
width: 400,
|
314
|
+
...(xsVal || {})
|
311
315
|
})
|
312
316
|
}], {
|
313
317
|
at: [...insertAt]
|
@@ -331,7 +335,8 @@ const FreeGrid = props => {
|
|
331
335
|
marginTop: 0,
|
332
336
|
top: 0,
|
333
337
|
width: 400,
|
334
|
-
height: 300
|
338
|
+
height: 300,
|
339
|
+
...(xsVal || {})
|
335
340
|
}], {
|
336
341
|
at: [...insertAt]
|
337
342
|
});
|
@@ -343,7 +348,9 @@ const FreeGrid = props => {
|
|
343
348
|
children: [{
|
344
349
|
text: ""
|
345
350
|
}]
|
346
|
-
}, {
|
351
|
+
}, {
|
352
|
+
...(xsVal || {})
|
353
|
+
}, "freegridBox")
|
347
354
|
}], {
|
348
355
|
at: [...insertAt]
|
349
356
|
});
|
@@ -354,7 +361,8 @@ const FreeGrid = props => {
|
|
354
361
|
...FORM_NODE()
|
355
362
|
}, {
|
356
363
|
height: 92,
|
357
|
-
width: 400
|
364
|
+
width: 400,
|
365
|
+
...(xsVal || {})
|
358
366
|
})
|
359
367
|
}], {
|
360
368
|
at: [...insertAt]
|
@@ -368,7 +376,8 @@ const FreeGrid = props => {
|
|
368
376
|
})
|
369
377
|
}, {
|
370
378
|
height: 60,
|
371
|
-
width: 400
|
379
|
+
width: 400,
|
380
|
+
...(xsVal || {})
|
372
381
|
})
|
373
382
|
}], {
|
374
383
|
at: [...insertAt]
|
@@ -389,19 +398,18 @@ const FreeGrid = props => {
|
|
389
398
|
marginTop: 0,
|
390
399
|
top: 0,
|
391
400
|
width: 170,
|
392
|
-
height: 30
|
401
|
+
height: 30,
|
402
|
+
...(xsVal || {})
|
393
403
|
}], {
|
394
404
|
at: [...insertAt]
|
395
405
|
});
|
396
406
|
break;
|
397
407
|
default:
|
398
408
|
}
|
399
|
-
if (
|
409
|
+
if (xsVal) {
|
400
410
|
setSelectedElement({});
|
401
|
-
|
402
|
-
// auto align in mobile
|
403
411
|
Transforms.setNodes(editor, {
|
404
|
-
|
412
|
+
height_xs: sectionHeightXs,
|
405
413
|
updated_at: new Date().getTime()
|
406
414
|
}, {
|
407
415
|
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,12 +5,12 @@ 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, {
|
13
|
-
className: "item-list-wrpr",
|
13
|
+
className: "item-list-wrpr sectionMoreOption",
|
14
14
|
children: [/*#__PURE__*/_jsx(ListItemButton, {
|
15
15
|
className: "item-wrapper",
|
16
16
|
onClick: handleClick("addSection"),
|
@@ -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
|
+
};
|
@@ -1,6 +1,7 @@
|
|
1
1
|
const useFreeGridStyles = ({
|
2
2
|
theme,
|
3
|
-
MAX_DEVICE_WIDTH
|
3
|
+
MAX_DEVICE_WIDTH,
|
4
|
+
appTheme
|
4
5
|
}) => ({
|
5
6
|
root: {
|
6
7
|
"&.freegrid-container": {
|
@@ -47,6 +48,9 @@ const useFreeGridStyles = ({
|
|
47
48
|
"&.type_text": {
|
48
49
|
// minHeight: "fit-content !important",
|
49
50
|
// wordBreak: "break-all",
|
51
|
+
"& .placeholder-simple-text": {
|
52
|
+
display: "none"
|
53
|
+
}
|
50
54
|
},
|
51
55
|
"&.enable-1, &.enable-2": {
|
52
56
|
"&.type_text": {
|
@@ -243,6 +247,9 @@ const useFreeGridStyles = ({
|
|
243
247
|
},
|
244
248
|
"& > .simple-text": {
|
245
249
|
display: "none"
|
250
|
+
},
|
251
|
+
"& > .edt-paragraphs": {
|
252
|
+
display: "none"
|
246
253
|
}
|
247
254
|
},
|
248
255
|
"& .fgi_type_form": {
|
@@ -313,9 +320,50 @@ const useFreeGridStyles = ({
|
|
313
320
|
backgroundColor: "#FFF",
|
314
321
|
overflow: "hidden"
|
315
322
|
},
|
323
|
+
"& .fgi_type_embedScript:not(:has(.has-code))": {
|
324
|
+
background: appTheme?.palette?.editor?.sectionSettingIconHover,
|
325
|
+
color: appTheme?.palette?.editor?.textColor,
|
326
|
+
fontSize: "14px",
|
327
|
+
borderRadius: "12px",
|
328
|
+
display: "flex",
|
329
|
+
flexDirection: "column",
|
330
|
+
justifyContent: "center",
|
331
|
+
alignItems: "center",
|
332
|
+
height: "100%",
|
333
|
+
textAlign: "center",
|
334
|
+
"& svg": {
|
335
|
+
width: "20px",
|
336
|
+
height: "20px",
|
337
|
+
"& path": {
|
338
|
+
stroke: appTheme?.palette?.editor?.closeButtonSvgStroke
|
339
|
+
}
|
340
|
+
},
|
341
|
+
"& .code-icon": {
|
342
|
+
display: "flex",
|
343
|
+
marginRight: "5px"
|
344
|
+
},
|
345
|
+
"& .empty-code": {
|
346
|
+
display: "flex"
|
347
|
+
},
|
348
|
+
"& .code-name": {
|
349
|
+
display: "flex",
|
350
|
+
alignItems: "anchor-center"
|
351
|
+
}
|
352
|
+
},
|
316
353
|
"& .fgi_type_text": {
|
317
354
|
"& .edt-headings": {
|
318
355
|
margin: "0px"
|
356
|
+
},
|
357
|
+
"& .edt-paragraphs": {
|
358
|
+
margin: "0px"
|
359
|
+
}
|
360
|
+
},
|
361
|
+
"& .fgi_type_table": {
|
362
|
+
"& .edt-headings": {
|
363
|
+
margin: "0px"
|
364
|
+
},
|
365
|
+
"& .edt-paragraphs": {
|
366
|
+
margin: "0px"
|
319
367
|
}
|
320
368
|
},
|
321
369
|
/** element toolbar hide */
|
@@ -356,21 +404,41 @@ const useFreeGridStyles = ({
|
|
356
404
|
sectionPopper: {
|
357
405
|
zIndex: 1200,
|
358
406
|
width: "40px",
|
359
|
-
left: "-
|
407
|
+
left: "-63px !important",
|
360
408
|
borderRadius: "8px",
|
409
|
+
marginRight: "5px !important",
|
361
410
|
"& .papper-root": {
|
362
411
|
fontFamily: "sans-serif",
|
363
412
|
boxShadow: "-4px -3px 12px 4px rgba(0, 0, 0, 0.12)",
|
364
|
-
background:
|
413
|
+
background: `${appTheme?.palette?.editor?.miniToolBarBackground} !important`,
|
414
|
+
border: `1px solid ${appTheme?.palette?.editor?.miniToolBarBorder}`,
|
415
|
+
borderRadius: "10px",
|
365
416
|
"& .MuiIconButton-root": {
|
366
|
-
padding: "
|
417
|
+
padding: "9px",
|
367
418
|
color: "#000",
|
368
|
-
background:
|
419
|
+
background: `${appTheme?.palette?.editor?.miniToolBarBackground} !important`,
|
369
420
|
"& svg": {
|
370
421
|
width: "20px",
|
371
|
-
height: "20px"
|
422
|
+
height: "20px",
|
423
|
+
color: appTheme?.palette?.editor?.closeButtonSvgStroke
|
424
|
+
},
|
425
|
+
"& .settingsIcon": {
|
426
|
+
"& path": {
|
427
|
+
stroke: appTheme?.palette?.editor?.closeButtonSvgStroke
|
428
|
+
}
|
372
429
|
},
|
373
|
-
"&.active
|
430
|
+
"&.active": {
|
431
|
+
"& svg": {
|
432
|
+
width: "20px",
|
433
|
+
height: "20px",
|
434
|
+
color: "#2563EB"
|
435
|
+
},
|
436
|
+
"& .settingsIcon": {
|
437
|
+
"& path": {
|
438
|
+
stroke: "#2563EB"
|
439
|
+
}
|
440
|
+
}
|
441
|
+
}
|
374
442
|
}
|
375
443
|
}
|
376
444
|
},
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/* eslint-disable no-unused-vars */
|
2
2
|
import React, { useState } from "react";
|
3
|
-
import { Transforms, Path, Node } from "slate";
|
3
|
+
import { Transforms, Path, Node, Editor, Element } from "slate";
|
4
4
|
import { useSlateStatic, ReactEditor } from "slate-react";
|
5
5
|
import { IconButton, Tooltip, Grid as GridContainer, useTheme } from "@mui/material";
|
6
6
|
import ArrowUpwardIcon from "@mui/icons-material/ArrowUpward";
|
@@ -206,7 +206,19 @@ const Grid = props => {
|
|
206
206
|
};
|
207
207
|
const onAddSection = () => () => {
|
208
208
|
try {
|
209
|
-
|
209
|
+
let duplicateGrid = JSON.parse(JSON.stringify(element));
|
210
|
+
const carousel = Editor.above(editor, {
|
211
|
+
at: path,
|
212
|
+
match: n => !Editor.isEditor(n) && Element.isElement(n) && n.type === "carousel-item"
|
213
|
+
});
|
214
|
+
if (carousel) {
|
215
|
+
const [carouselNode, carouselItemPath] = carousel || [];
|
216
|
+
const duplicatecCarousel = JSON.parse(JSON.stringify(carouselNode));
|
217
|
+
Transforms.insertNodes(editor, duplicatecCarousel, {
|
218
|
+
at: Path.next(carouselItemPath)
|
219
|
+
});
|
220
|
+
return;
|
221
|
+
}
|
210
222
|
insertGrid(editor, duplicateGrid, [path[0] + 1, 0]);
|
211
223
|
} catch (err) {
|
212
224
|
console.log(err);
|
@@ -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",
|
@@ -15,7 +15,8 @@ const CheckList = props => {
|
|
15
15
|
isEmpty,
|
16
16
|
className,
|
17
17
|
style,
|
18
|
-
customProps
|
18
|
+
customProps,
|
19
|
+
selectedLineHeight
|
19
20
|
} = props;
|
20
21
|
const {
|
21
22
|
translation
|
@@ -45,7 +46,7 @@ const CheckList = props => {
|
|
45
46
|
justifyContent: "center",
|
46
47
|
alignItems: "center",
|
47
48
|
...(style || {}),
|
48
|
-
lineHeight:
|
49
|
+
lineHeight: `${selectedLineHeight}`
|
49
50
|
},
|
50
51
|
children: [/*#__PURE__*/_jsxs("div", {
|
51
52
|
contentEditable: false,
|
@@ -1,5 +1,10 @@
|
|
1
|
-
import React from "react";
|
2
|
-
import
|
1
|
+
import React, { useEffect, useState } from "react";
|
2
|
+
import Box from "@mui/material/Box";
|
3
|
+
import Card from "@mui/material/Card";
|
4
|
+
import CardMedia from "@mui/material/CardMedia";
|
5
|
+
import CardContent from "@mui/material/CardContent";
|
6
|
+
import Typography from "@mui/material/Typography";
|
7
|
+
import Skeleton from "@mui/material/Skeleton";
|
3
8
|
import Icon from "../../common/Icon";
|
4
9
|
import { useEditorContext } from "../../hooks/useMouseMove";
|
5
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
@@ -15,13 +20,26 @@ const SearchAttachment = props => {
|
|
15
20
|
metadata
|
16
21
|
} = customProps;
|
17
22
|
const {
|
18
|
-
|
19
|
-
|
23
|
+
type,
|
24
|
+
id
|
20
25
|
} = element;
|
21
26
|
const {
|
22
27
|
theme
|
23
28
|
} = useEditorContext();
|
29
|
+
const [title, setTitle] = useState("");
|
30
|
+
const [showSkeleton, setShowSkeleton] = useState(false);
|
24
31
|
const label = Boolean(title?.trim()) ? title : 'Untitled';
|
32
|
+
useEffect(() => {
|
33
|
+
const fetchTitle = async id => {
|
34
|
+
setShowSkeleton(true);
|
35
|
+
const title = await customProps?.services('getDocTitle', id);
|
36
|
+
setTitle(title?.data);
|
37
|
+
setShowSkeleton(false);
|
38
|
+
};
|
39
|
+
if (id) {
|
40
|
+
fetchTitle(id);
|
41
|
+
}
|
42
|
+
}, []);
|
25
43
|
const handleClick = () => {
|
26
44
|
if (metadata && metadata?.actionHandler) {
|
27
45
|
metadata?.actionHandler(type, element);
|
@@ -38,15 +56,15 @@ const SearchAttachment = props => {
|
|
38
56
|
children: /*#__PURE__*/_jsxs(Card, {
|
39
57
|
sx: {
|
40
58
|
display: "flex",
|
41
|
-
justifyContent: "flex-start",
|
42
|
-
alignItems: "flex-end",
|
59
|
+
justifyContent: showSkeleton ? "center" : "flex-start",
|
60
|
+
alignItems: showSkeleton ? "center" : "flex-end",
|
43
61
|
width: "fit-content",
|
44
62
|
maxWidth: '250px',
|
45
63
|
padding: "0px 10px",
|
46
64
|
boxShadow: "none",
|
47
65
|
border: `1px solid ${theme?.palette?.primary?.slashBrainBorder} !important`,
|
48
66
|
borderRadius: "7px !important",
|
49
|
-
background: `${theme?.palette?.containers?.slashBrainCardBg} !important`,
|
67
|
+
background: showSkeleton ? `${theme?.palette?.editor?.menuOptionHoverBackground} !important` : `${theme?.palette?.containers?.slashBrainCardBg} !important`,
|
50
68
|
cursor: 'pointer',
|
51
69
|
margin: '4px 0px',
|
52
70
|
lineHeight: 1.43,
|
@@ -76,7 +94,12 @@ const SearchAttachment = props => {
|
|
76
94
|
width: "unset !important"
|
77
95
|
}
|
78
96
|
},
|
79
|
-
children: /*#__PURE__*/_jsx(
|
97
|
+
children: showSkeleton ? /*#__PURE__*/_jsx(Skeleton, {
|
98
|
+
variant: "circular",
|
99
|
+
width: 14,
|
100
|
+
height: 14,
|
101
|
+
animation: "wave"
|
102
|
+
}) : /*#__PURE__*/_jsx(Icon, {
|
80
103
|
icon: "docsIcon"
|
81
104
|
})
|
82
105
|
}), /*#__PURE__*/_jsx(CardContent, {
|
@@ -94,7 +117,15 @@ const SearchAttachment = props => {
|
|
94
117
|
width: "unset !important"
|
95
118
|
}
|
96
119
|
},
|
97
|
-
children: /*#__PURE__*/
|
120
|
+
children: showSkeleton ? /*#__PURE__*/_jsx(Skeleton, {
|
121
|
+
variant: "text",
|
122
|
+
width: 140,
|
123
|
+
height: 20,
|
124
|
+
animation: "wave",
|
125
|
+
sx: {
|
126
|
+
borderRadius: "4px"
|
127
|
+
}
|
128
|
+
}) : /*#__PURE__*/_jsxs(Typography, {
|
98
129
|
sx: {
|
99
130
|
fontWeight: "500",
|
100
131
|
background: theme?.palette?.text?.slashBrainText,
|