@flozy/editor 11.1.1 → 11.1.2
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 +6 -6
- package/dist/Editor/CommonEditor.js +82 -21
- 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 +154 -11
- package/dist/Editor/Elements/Attachments/AttachmentsButton.js +8 -3
- 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.css +5 -0
- package/dist/Editor/Elements/Embed/Embed.js +37 -43
- package/dist/Editor/Elements/Embed/Image.js +242 -22
- package/dist/Editor/Elements/Embed/Video.js +277 -32
- package/dist/Editor/Elements/Form/Form.js +10 -35
- 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 +34 -75
- 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/Signature/SignatureOptions/TypeSignature.js +2 -3
- package/dist/Editor/Elements/Signature/SignaturePopup.js +2 -13
- package/dist/Editor/Elements/SimpleText/index.js +4 -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 +16 -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 +7 -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 +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/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 +54 -0
- 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 +18 -4
- 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 +15 -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 +37 -3
- 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/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 +162 -38
- package/dist/Editor/utils/accordion.js +1 -1
- package/dist/Editor/utils/button.js +1 -17
- package/dist/Editor/utils/font.js +40 -37
- package/dist/Editor/utils/helper.js +76 -3
- package/dist/Editor/utils/insertAppHeader.js +8 -4
- package/package.json +1 -1
@@ -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 id = crypto?.randomUUID();
|
188
|
+
const {
|
189
|
+
elValues,
|
190
|
+
sectionVal
|
191
|
+
} = getElementValues(type, element?.children, breakpoint);
|
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
|
});
|
@@ -299,10 +271,11 @@ const FreeGrid = props => {
|
|
299
271
|
...insertFreeGridItem("video", createEmbedNode("video", {
|
300
272
|
url: "",
|
301
273
|
alt: "",
|
302
|
-
images: []
|
274
|
+
images: [],
|
275
|
+
fromFreeGrid: true,
|
276
|
+
uniqueId: id
|
303
277
|
}), {
|
304
|
-
|
305
|
-
width: 650
|
278
|
+
...(elValues || {})
|
306
279
|
})
|
307
280
|
}], {
|
308
281
|
at: [...insertAt]
|
@@ -313,8 +286,7 @@ const FreeGrid = props => {
|
|
313
286
|
...insertFreeGridItem("table", {
|
314
287
|
...DEFAULT_TABLE_NODE()
|
315
288
|
}, {
|
316
|
-
|
317
|
-
width: 400
|
289
|
+
...(elValues || {})
|
318
290
|
})
|
319
291
|
}], {
|
320
292
|
at: [...insertAt]
|
@@ -333,12 +305,7 @@ const FreeGrid = props => {
|
|
333
305
|
isEncoded: true,
|
334
306
|
isSanitized: true
|
335
307
|
}],
|
336
|
-
|
337
|
-
left: 50,
|
338
|
-
marginTop: 0,
|
339
|
-
top: 0,
|
340
|
-
width: 400,
|
341
|
-
height: 300
|
308
|
+
...(elValues || {})
|
342
309
|
}], {
|
343
310
|
at: [...insertAt]
|
344
311
|
});
|
@@ -350,7 +317,9 @@ const FreeGrid = props => {
|
|
350
317
|
children: [{
|
351
318
|
text: ""
|
352
319
|
}]
|
353
|
-
}, {
|
320
|
+
}, {
|
321
|
+
...(elValues || {})
|
322
|
+
}, "freegridBox")
|
354
323
|
}], {
|
355
324
|
at: [...insertAt]
|
356
325
|
});
|
@@ -360,8 +329,7 @@ const FreeGrid = props => {
|
|
360
329
|
...insertFreeGridItem("form", {
|
361
330
|
...FORM_NODE()
|
362
331
|
}, {
|
363
|
-
|
364
|
-
width: 400
|
332
|
+
...(elValues || {})
|
365
333
|
})
|
366
334
|
}], {
|
367
335
|
at: [...insertAt]
|
@@ -374,8 +342,7 @@ const FreeGrid = props => {
|
|
374
342
|
menus: null
|
375
343
|
})
|
376
344
|
}, {
|
377
|
-
|
378
|
-
width: 400
|
345
|
+
...(elValues || {})
|
379
346
|
})
|
380
347
|
}], {
|
381
348
|
at: [...insertAt]
|
@@ -391,29 +358,21 @@ const FreeGrid = props => {
|
|
391
358
|
text: ""
|
392
359
|
}]
|
393
360
|
}],
|
394
|
-
|
395
|
-
left: 50,
|
396
|
-
marginTop: 0,
|
397
|
-
top: 0,
|
398
|
-
width: 170,
|
399
|
-
height: 30
|
361
|
+
...(elValues || {})
|
400
362
|
}], {
|
401
363
|
at: [...insertAt]
|
402
364
|
});
|
403
365
|
break;
|
404
366
|
default:
|
405
367
|
}
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
at: path
|
415
|
-
});
|
416
|
-
}
|
368
|
+
setSelectedElement({});
|
369
|
+
// increase the section height if new element is inserted based on auto align
|
370
|
+
Transforms.setNodes(editor, {
|
371
|
+
...sectionVal,
|
372
|
+
updated_at: new Date().getTime()
|
373
|
+
}, {
|
374
|
+
at: path
|
375
|
+
});
|
417
376
|
count.current = count.current + 1;
|
418
377
|
|
419
378
|
// focus on newly added element
|
@@ -519,7 +478,7 @@ const FreeGrid = props => {
|
|
519
478
|
style: {
|
520
479
|
position: "relative",
|
521
480
|
"--height": `${height}px`,
|
522
|
-
display:
|
481
|
+
display: "block" //for test purpose
|
523
482
|
},
|
524
483
|
|
525
484
|
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";
|
@@ -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",
|
@@ -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,8 +80,7 @@ const TypeSignature = props => {
|
|
80
80
|
children: /*#__PURE__*/_jsx(ClearRoundedIcon, {})
|
81
81
|
})
|
82
82
|
})
|
83
|
-
}
|
84
|
-
autoComplete: "typeName"
|
83
|
+
}
|
85
84
|
})
|
86
85
|
})
|
87
86
|
})
|
@@ -92,17 +92,9 @@ const SignaturePopup = props => {
|
|
92
92
|
};
|
93
93
|
const onChange = e => {
|
94
94
|
e?.stopPropagation();
|
95
|
-
const {
|
96
|
-
name,
|
97
|
-
value
|
98
|
-
} = e.target;
|
99
|
-
const fieldMap = {
|
100
|
-
name: "signedBy",
|
101
|
-
email: "signedByEmail"
|
102
|
-
};
|
103
95
|
setSignedData({
|
104
96
|
...signedData,
|
105
|
-
[
|
97
|
+
[e.target.name]: e.target.value
|
106
98
|
});
|
107
99
|
};
|
108
100
|
const onBrushSize = val => () => {
|
@@ -327,8 +319,7 @@ const SignaturePopup = props => {
|
|
327
319
|
,
|
328
320
|
size: "small",
|
329
321
|
onChange: onChange,
|
330
|
-
sx: classes.signaturePopUpNameField
|
331
|
-
autoComplete: "signedBy"
|
322
|
+
sx: classes.signaturePopUpNameField
|
332
323
|
})
|
333
324
|
})]
|
334
325
|
}), /*#__PURE__*/_jsxs(Grid, {
|
@@ -456,8 +447,6 @@ const SignaturePopup = props => {
|
|
456
447
|
sx: classes.signaturePopUpNameField,
|
457
448
|
value: signedData.signedByEmail || ""
|
458
449
|
// defaultValue={defaultEmail || ""}
|
459
|
-
,
|
460
|
-
autoComplete: "signedByEmail"
|
461
450
|
})
|
462
451
|
})]
|
463
452
|
})]
|
@@ -49,7 +49,10 @@ const SimpleText = props => {
|
|
49
49
|
className: `simple-text ${nextType}`,
|
50
50
|
sx: classes.root,
|
51
51
|
key: `para_${path.join("|")}`
|
52
|
-
}, children,
|
52
|
+
}, children, /*#__PURE__*/_jsx("span", {
|
53
|
+
contentEditable: false,
|
54
|
+
className: "cursorStabilityElement"
|
55
|
+
}), openAI ? null : /*#__PURE__*/_jsx("span", {
|
53
56
|
contentEditable: false,
|
54
57
|
className: "placeholder-simple-text",
|
55
58
|
children: isEmptyEditor ? editorPlaceholder || translation("writeSomethingPlaceHolder") : showPlaceHolder ? opacity && selected ? /*#__PURE__*/_jsxs(_Fragment, {
|
@@ -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
|
};
|