@flozy/editor 11.0.3 → 11.0.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 +17 -16
- package/dist/Editor/CommonEditor.js +129 -16
- package/dist/Editor/DialogWrapper.js +31 -25
- package/dist/Editor/Editor.css +36 -8
- 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/Embed/Embed.js +36 -43
- package/dist/Editor/Elements/Embed/Image.js +236 -23
- package/dist/Editor/Elements/Embed/Video.js +245 -15
- package/dist/Editor/Elements/Form/Form.js +16 -10
- 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 +31 -74
- package/dist/Editor/Elements/FreeGrid/FreeGridBox.js +9 -5
- package/dist/Editor/Elements/FreeGrid/FreeGridItem.js +3 -1
- package/dist/Editor/Elements/FreeGrid/Options/More.js +7 -7
- 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/Signature/SignatureOptions/TypeSignature.js +3 -2
- package/dist/Editor/Elements/Signature/SignaturePopup.js +15 -5
- package/dist/Editor/Elements/SimpleText/style.js +2 -2
- package/dist/Editor/Elements/Table/Table.js +3 -3
- package/dist/Editor/Elements/Title/title.js +6 -6
- package/dist/Editor/Elements/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 +19 -4
- 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 +4 -3
- 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/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 -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 +320 -130
- 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 +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/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/textOptions.js +15 -7
- 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 +67 -18
- 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/useThemeValues.js +63 -0
- package/dist/Editor/plugins/withEmbeds.js +12 -1
- package/dist/Editor/plugins/withHTML.js +3 -1
- 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 +191 -40
- package/dist/Editor/utils/accordion.js +67 -39
- 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/helper.js +98 -22
- package/package.json +4 -4
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/MultiSelect.js +0 -454
@@ -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 { getElementValues } 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
|
+
elValues,
|
189
|
+
sectionVal
|
190
|
+
} = getElementValues(type, element?.children, breakpoint);
|
191
|
+
const id = crypto?.randomUUID();
|
186
192
|
switch (type) {
|
187
193
|
case "addText":
|
188
194
|
Transforms.insertNodes(editor, [{
|
@@ -194,12 +200,7 @@ const FreeGrid = props => {
|
|
194
200
|
text: "Text"
|
195
201
|
}]
|
196
202
|
}],
|
197
|
-
|
198
|
-
left: 50,
|
199
|
-
marginTop: 0,
|
200
|
-
top: 0,
|
201
|
-
width: 170,
|
202
|
-
height: 30
|
203
|
+
...(elValues || {})
|
203
204
|
}], {
|
204
205
|
at: [...insertAt]
|
205
206
|
});
|
@@ -217,29 +218,10 @@ const FreeGrid = props => {
|
|
217
218
|
linkType: "webAddress"
|
218
219
|
},
|
219
220
|
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
221
|
textAlign: "center",
|
235
222
|
label: "Get Started"
|
236
223
|
}],
|
237
|
-
|
238
|
-
left: 50,
|
239
|
-
marginTop: 0,
|
240
|
-
top: 0,
|
241
|
-
width: 143,
|
242
|
-
height: 50
|
224
|
+
...(elValues || {})
|
243
225
|
}], {
|
244
226
|
at: [...insertAt]
|
245
227
|
});
|
@@ -259,14 +241,7 @@ const FreeGrid = props => {
|
|
259
241
|
date: ""
|
260
242
|
}
|
261
243
|
}],
|
262
|
-
|
263
|
-
left: 50,
|
264
|
-
marginTop: 0,
|
265
|
-
top: 0,
|
266
|
-
width: 217,
|
267
|
-
height: 173,
|
268
|
-
width_xs: 217,
|
269
|
-
height_xs: 173
|
244
|
+
...(elValues || {})
|
270
245
|
}], {
|
271
246
|
at: [...insertAt]
|
272
247
|
});
|
@@ -282,14 +257,11 @@ const FreeGrid = props => {
|
|
282
257
|
images: [],
|
283
258
|
children: [{
|
284
259
|
text: ""
|
285
|
-
}]
|
260
|
+
}],
|
261
|
+
fromFreeGrid: true,
|
262
|
+
uniqueId: id
|
286
263
|
}],
|
287
|
-
|
288
|
-
left: 50,
|
289
|
-
marginTop: 0,
|
290
|
-
top: 0,
|
291
|
-
width: 170,
|
292
|
-
height: 80
|
264
|
+
...(elValues || {})
|
293
265
|
}], {
|
294
266
|
at: [...insertAt]
|
295
267
|
});
|
@@ -301,8 +273,7 @@ const FreeGrid = props => {
|
|
301
273
|
alt: "",
|
302
274
|
images: []
|
303
275
|
}), {
|
304
|
-
|
305
|
-
width: 650
|
276
|
+
...(elValues || {})
|
306
277
|
})
|
307
278
|
}], {
|
308
279
|
at: [...insertAt]
|
@@ -313,8 +284,7 @@ const FreeGrid = props => {
|
|
313
284
|
...insertFreeGridItem("table", {
|
314
285
|
...DEFAULT_TABLE_NODE()
|
315
286
|
}, {
|
316
|
-
|
317
|
-
width: 400
|
287
|
+
...(elValues || {})
|
318
288
|
})
|
319
289
|
}], {
|
320
290
|
at: [...insertAt]
|
@@ -333,12 +303,7 @@ const FreeGrid = props => {
|
|
333
303
|
isEncoded: true,
|
334
304
|
isSanitized: true
|
335
305
|
}],
|
336
|
-
|
337
|
-
left: 50,
|
338
|
-
marginTop: 0,
|
339
|
-
top: 0,
|
340
|
-
width: 400,
|
341
|
-
height: 300
|
306
|
+
...(elValues || {})
|
342
307
|
}], {
|
343
308
|
at: [...insertAt]
|
344
309
|
});
|
@@ -350,7 +315,9 @@ const FreeGrid = props => {
|
|
350
315
|
children: [{
|
351
316
|
text: ""
|
352
317
|
}]
|
353
|
-
}, {
|
318
|
+
}, {
|
319
|
+
...(elValues || {})
|
320
|
+
}, "freegridBox")
|
354
321
|
}], {
|
355
322
|
at: [...insertAt]
|
356
323
|
});
|
@@ -360,8 +327,7 @@ const FreeGrid = props => {
|
|
360
327
|
...insertFreeGridItem("form", {
|
361
328
|
...FORM_NODE()
|
362
329
|
}, {
|
363
|
-
|
364
|
-
width: 400
|
330
|
+
...(elValues || {})
|
365
331
|
})
|
366
332
|
}], {
|
367
333
|
at: [...insertAt]
|
@@ -374,8 +340,7 @@ const FreeGrid = props => {
|
|
374
340
|
menus: null
|
375
341
|
})
|
376
342
|
}, {
|
377
|
-
|
378
|
-
width: 400
|
343
|
+
...(elValues || {})
|
379
344
|
})
|
380
345
|
}], {
|
381
346
|
at: [...insertAt]
|
@@ -391,29 +356,21 @@ const FreeGrid = props => {
|
|
391
356
|
text: ""
|
392
357
|
}]
|
393
358
|
}],
|
394
|
-
|
395
|
-
left: 50,
|
396
|
-
marginTop: 0,
|
397
|
-
top: 0,
|
398
|
-
width: 170,
|
399
|
-
height: 30
|
359
|
+
...(elValues || {})
|
400
360
|
}], {
|
401
361
|
at: [...insertAt]
|
402
362
|
});
|
403
363
|
break;
|
404
364
|
default:
|
405
365
|
}
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
at: path
|
415
|
-
});
|
416
|
-
}
|
366
|
+
setSelectedElement({});
|
367
|
+
// increase the section height if new element is inserted based on auto align
|
368
|
+
Transforms.setNodes(editor, {
|
369
|
+
...sectionVal,
|
370
|
+
updated_at: new Date().getTime()
|
371
|
+
}, {
|
372
|
+
at: path
|
373
|
+
});
|
417
374
|
count.current = count.current + 1;
|
418
375
|
|
419
376
|
// focus on newly added element
|
@@ -519,7 +476,7 @@ const FreeGrid = props => {
|
|
519
476
|
style: {
|
520
477
|
position: "relative",
|
521
478
|
"--height": `${height}px`,
|
522
|
-
display:
|
479
|
+
display: "block" //for test purpose
|
523
480
|
},
|
524
481
|
|
525
482
|
dataSets: {
|
@@ -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("_")}`,
|
@@ -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,
|
@@ -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,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",
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import React, { useState } from "react";
|
2
2
|
import { signedTextFonts } from "../../../utils/font";
|
3
3
|
import { Grid, Button, TextField, InputAdornment, IconButton, Typography } from "@mui/material";
|
4
|
-
import ClearRoundedIcon from
|
4
|
+
import ClearRoundedIcon from "@mui/icons-material/ClearRounded";
|
5
5
|
import { jsx as _jsx } from "react/jsx-runtime";
|
6
6
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
7
7
|
const TypeSignature = props => {
|
@@ -80,7 +80,8 @@ const TypeSignature = props => {
|
|
80
80
|
children: /*#__PURE__*/_jsx(ClearRoundedIcon, {})
|
81
81
|
})
|
82
82
|
})
|
83
|
-
}
|
83
|
+
},
|
84
|
+
autoComplete: "typeName"
|
84
85
|
})
|
85
86
|
})
|
86
87
|
})
|
@@ -311,15 +311,19 @@ const SignaturePopup = props => {
|
|
311
311
|
xs: 12,
|
312
312
|
children: /*#__PURE__*/_jsx(TextField, {
|
313
313
|
fullWidth: true,
|
314
|
-
id: "
|
315
|
-
name: "
|
314
|
+
id: "name",
|
315
|
+
name: "name",
|
316
316
|
placeholder: translation("Enter Name"),
|
317
317
|
value: signedData.signedBy || ""
|
318
318
|
// defaultValue={defaultName || ""}
|
319
319
|
,
|
320
320
|
size: "small",
|
321
321
|
onChange: onChange,
|
322
|
-
sx: classes.signaturePopUpNameField
|
322
|
+
sx: classes.signaturePopUpNameField,
|
323
|
+
autoComplete: "name",
|
324
|
+
inputProps: {
|
325
|
+
autoComplete: "name"
|
326
|
+
}
|
323
327
|
})
|
324
328
|
})]
|
325
329
|
}), /*#__PURE__*/_jsxs(Grid, {
|
@@ -439,14 +443,20 @@ const SignaturePopup = props => {
|
|
439
443
|
item: true,
|
440
444
|
children: /*#__PURE__*/_jsx(TextField, {
|
441
445
|
fullWidth: true,
|
442
|
-
id: "
|
443
|
-
name: "
|
446
|
+
id: "email",
|
447
|
+
name: "email",
|
448
|
+
type: "email",
|
444
449
|
placeholder: translation("Enter Email"),
|
445
450
|
size: "small",
|
446
451
|
onChange: onChange,
|
447
452
|
sx: classes.signaturePopUpNameField,
|
448
453
|
value: signedData.signedByEmail || ""
|
449
454
|
// defaultValue={defaultEmail || ""}
|
455
|
+
,
|
456
|
+
autoComplete: "email",
|
457
|
+
inputProps: {
|
458
|
+
autoComplete: "email"
|
459
|
+
}
|
450
460
|
})
|
451
461
|
})]
|
452
462
|
})]
|
@@ -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",
|
@@ -308,7 +308,7 @@ const Table = props => {
|
|
308
308
|
onScroll: handleScroll,
|
309
309
|
onMouseOver: onMouseOver,
|
310
310
|
onMouseLeave: onMouseLeave,
|
311
|
-
className:
|
311
|
+
className: "custom-scroll",
|
312
312
|
children: [/*#__PURE__*/_jsx(TableComp, {
|
313
313
|
className: readOnly ? "readOnly" : "",
|
314
314
|
sx: {
|
@@ -346,8 +346,8 @@ const Table = props => {
|
|
346
346
|
handleAction: handleAction,
|
347
347
|
exandTools: exandTools,
|
348
348
|
openSetttings: openSetttings,
|
349
|
-
|
350
|
-
|
349
|
+
hideTools: hideTools,
|
350
|
+
translation: translation
|
351
351
|
}), /*#__PURE__*/_jsx(MoreTableSettings, {
|
352
352
|
exandTools: exandTools,
|
353
353
|
handleAction: handleAction,
|
@@ -3,6 +3,12 @@ import { Text } from "slate";
|
|
3
3
|
import { useSlate } from "slate-react";
|
4
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,
|
@@ -46,10 +52,4 @@ const useDetectExitFromTitle = (titleNode, onSaveTitle) => {
|
|
46
52
|
}
|
47
53
|
}, [editor.selection]);
|
48
54
|
return null;
|
49
|
-
};
|
50
|
-
const isEmptyTextNode = node => {
|
51
|
-
if (Text.isText(node)) {
|
52
|
-
return !node.text.trim();
|
53
|
-
}
|
54
|
-
return false;
|
55
55
|
};
|