@flozy/editor 9.3.7 → 9.3.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Editor/ChatEditor.js +52 -16
- package/dist/Editor/CommonEditor.js +133 -23
- package/dist/Editor/DialogWrapper.js +31 -25
- package/dist/Editor/Editor.css +19 -9
- package/dist/Editor/Elements/AI/AIInput.js +5 -3
- package/dist/Editor/Elements/AI/CustomSelect.js +9 -5
- package/dist/Editor/Elements/AI/PopoverAIInput.js +4 -2
- package/dist/Editor/Elements/Accordion/Accordion.js +4 -3
- package/dist/Editor/Elements/Accordion/AccordionBtnPopup.js +4 -1
- package/dist/Editor/Elements/Accordion/AccordionButton.js +6 -2
- package/dist/Editor/Elements/Accordion/AccordionTitlePopup.js +4 -1
- package/dist/Editor/Elements/AppHeader/AppHeader.js +3 -3
- package/dist/Editor/Elements/AppHeader/AppHeaderButton.js +6 -2
- package/dist/Editor/Elements/AppHeader/AppHeaderPopup.js +4 -1
- package/dist/Editor/Elements/Attachments/AttachmentsButton.js +4 -1
- package/dist/Editor/Elements/Button/ButtonPopup.js +4 -1
- package/dist/Editor/Elements/Button/ButtonToolIcon.js +6 -2
- package/dist/Editor/Elements/Button/EditorButton.js +31 -14
- package/dist/Editor/Elements/Carousel/Carousel.js +5 -4
- package/dist/Editor/Elements/Carousel/CarouselButton.js +6 -2
- package/dist/Editor/Elements/Carousel/CarouselItem.js +3 -2
- package/dist/Editor/Elements/ChipText/ChipTextPopup.js +4 -1
- package/dist/Editor/Elements/CodeToText/CodeToText.js +5 -4
- package/dist/Editor/Elements/CodeToText/HtmlContextMenu.js +6 -2
- package/dist/Editor/Elements/Color Picker/ColorButtons.js +60 -14
- package/dist/Editor/Elements/Color Picker/ColorPicker.css +25 -1
- package/dist/Editor/Elements/Color Picker/ColorPicker.js +4 -4
- package/dist/Editor/Elements/Color Picker/Styles.js +3 -3
- package/dist/Editor/Elements/Colorbox/ColorboxButton.js +6 -2
- package/dist/Editor/Elements/DataView/DataView.js +5 -2
- package/dist/Editor/Elements/DataView/DataViewButton.js +6 -2
- package/dist/Editor/Elements/DataView/Layouts/ColumnView.js +4 -1
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/MultiSelect.js +422 -0
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/Select.js +4 -3
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/MultiSelectType.js +23 -5
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/TextType.js +7 -2
- package/dist/Editor/Elements/DataView/Layouts/FilterSort/SortOptions/ChooseSort.js +13 -12
- package/dist/Editor/Elements/DataView/Layouts/FilterSort/SortOptions/index.js +7 -4
- package/dist/Editor/Elements/DataView/Layouts/FilterSort/index.js +7 -5
- package/dist/Editor/Elements/DataView/Layouts/FilterView.js +9 -7
- package/dist/Editor/Elements/DataView/Layouts/Options/AddOptions.js +8 -3
- package/dist/Editor/Elements/DataView/Layouts/Options/AddProperty.js +5 -3
- package/dist/Editor/Elements/DataView/Layouts/Options/AllProperties.js +6 -5
- package/dist/Editor/Elements/DataView/Layouts/Options/ChangeProperty.js +5 -3
- package/dist/Editor/Elements/DataView/Layouts/Options/EditOption.js +9 -7
- package/dist/Editor/Elements/DataView/Layouts/Options/EditProperty.js +64 -38
- package/dist/Editor/Elements/DataView/Layouts/Options/FilterProperty.js +3 -2
- package/dist/Editor/Elements/DataView/Layouts/Options/PropertyList.js +3 -2
- package/dist/Editor/Elements/DataView/Layouts/Options/index.js +23 -6
- package/dist/Editor/Elements/DataView/Layouts/TableStyles.js +4 -1
- package/dist/Editor/Elements/DataView/Layouts/TableView.js +6 -4
- package/dist/Editor/Elements/DataView/Layouts/index.js +3 -1
- package/dist/Editor/Elements/DataView/Providers/DataViewProvider.js +5 -2
- package/dist/Editor/Elements/Divider/Divider.js +5 -3
- package/dist/Editor/Elements/Divider/DividerButton.js +6 -2
- package/dist/Editor/Elements/Divider/DividerPopup.js +3 -2
- package/dist/Editor/Elements/Embed/Embed.js +4 -1
- package/dist/Editor/Elements/Embed/EmbedPopup.js +4 -1
- package/dist/Editor/Elements/Embed/Frames/Slider.js +16 -14
- package/dist/Editor/Elements/Embed/Image.js +18 -12
- package/dist/Editor/Elements/Embed/Video.js +10 -7
- package/dist/Editor/Elements/EmbedScript/Code.js +7 -4
- package/dist/Editor/Elements/EmbedScript/EmbedScript.js +6 -2
- package/dist/Editor/Elements/EmbedScript/EmbedScriptPopup.js +8 -5
- package/dist/Editor/Elements/Emoji/EmojiButton.js +6 -2
- package/dist/Editor/Elements/Form/FieldPopup.js +4 -1
- package/dist/Editor/Elements/Form/Form.js +12 -9
- package/dist/Editor/Elements/Form/FormButton.js +6 -2
- package/dist/Editor/Elements/Form/FormPopup.js +3 -2
- package/dist/Editor/Elements/Form/Workflow/FormWorkflow.js +18 -12
- package/dist/Editor/Elements/Form/Workflow/ListWorkflow.js +13 -8
- package/dist/Editor/Elements/Form/Workflow/MoreOptions.js +3 -2
- package/dist/Editor/Elements/Form/Workflow/UserInputs.js +4 -2
- package/dist/Editor/Elements/Form/Workflow/index.js +15 -9
- package/dist/Editor/Elements/FreeGrid/FreeGrid.js +63 -25
- package/dist/Editor/Elements/FreeGrid/FreeGridBox.js +22 -4
- package/dist/Editor/Elements/FreeGrid/FreeGridButton.js +6 -2
- package/dist/Editor/Elements/FreeGrid/FreeGridItem.js +34 -5
- package/dist/Editor/Elements/FreeGrid/Options/AddElement.js +3 -2
- package/dist/Editor/Elements/FreeGrid/Options/More.js +10 -4
- package/dist/Editor/Elements/FreeGrid/styles.js +3 -0
- package/dist/Editor/Elements/Grid/Grid.js +13 -10
- package/dist/Editor/Elements/Grid/GridButton.js +9 -5
- package/dist/Editor/Elements/Grid/GridItem.js +14 -8
- package/dist/Editor/Elements/Grid/GridItemPopup.js +4 -1
- package/dist/Editor/Elements/Grid/GridPopup.js +4 -1
- package/dist/Editor/Elements/Grid/SectionPopup.js +4 -1
- package/dist/Editor/Elements/Link/Link.js +14 -7
- package/dist/Editor/Elements/Link/LinkButton.js +4 -1
- package/dist/Editor/Elements/List/CheckList.js +14 -9
- package/dist/Editor/Elements/NewLine/NewLineButton.js +6 -2
- package/dist/Editor/Elements/PageSettings/PageSettingsButton.js +16 -5
- package/dist/Editor/Elements/PageSettings/PageSettingsPopup.js +4 -1
- package/dist/Editor/Elements/Search/SearchButton.js +6 -3
- package/dist/Editor/Elements/Search/SearchList.js +7 -3
- package/dist/Editor/Elements/Signature/SignatureButton.js +6 -2
- package/dist/Editor/Elements/Signature/SignatureOptions/TypeSignature.js +6 -2
- package/dist/Editor/Elements/Signature/SignatureOptions/UploadSignature.js +4 -1
- package/dist/Editor/Elements/Signature/SignaturePopup.js +17 -16
- package/dist/Editor/Elements/SimpleText/index.js +5 -4
- package/dist/Editor/Elements/SimpleText/style.js +2 -2
- package/dist/Editor/Elements/Table/DragButton.js +4 -2
- package/dist/Editor/Elements/Table/Table.js +48 -25
- package/dist/Editor/Elements/Table/TableCell.js +10 -27
- package/dist/Editor/Elements/Table/TablePopup.js +4 -1
- package/dist/Editor/Elements/Table/TableSelector.js +10 -6
- package/dist/Editor/Elements/Table/TableTool.js +8 -4
- package/dist/Editor/Elements/Title/title.js +10 -0
- package/dist/Editor/Elements/TopBanner/TopBannerButton.js +4 -1
- package/dist/Editor/Elements/Variables/VariableButton.js +10 -1
- package/dist/Editor/MiniEditor.js +10 -3
- package/dist/Editor/Styles/EditorStyles.js +5 -5
- package/dist/Editor/Toolbar/Basic/index.js +2 -1
- package/dist/Editor/Toolbar/FormatTools/BlockButton.js +6 -2
- 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 +8 -4
- package/dist/Editor/Toolbar/FormatTools/TextSize.js +7 -13
- package/dist/Editor/Toolbar/Mini/MiniToolbar.js +20 -15
- package/dist/Editor/Toolbar/PopupTool/AddTemplates.js +10 -5
- package/dist/Editor/Toolbar/PopupTool/ButtonTemplatesCard.js +10 -4
- package/dist/Editor/Toolbar/PopupTool/FullViewCard.js +10 -4
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/MiniColorPicker.js +6 -2
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectAlignment.js +42 -35
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectFontSize.js +6 -13
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectList.js +58 -51
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectSuperSubscript.js +29 -22
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectTypography.js +226 -87
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/index.js +15 -7
- package/dist/Editor/Toolbar/PopupTool/PopperHeader.js +8 -4
- package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +16 -9
- package/dist/Editor/Toolbar/PopupTool/TemplateCard.js +11 -5
- package/dist/Editor/Toolbar/PopupTool/TextFormat.js +126 -44
- package/dist/Editor/Toolbar/PopupTool/ThemeTextFormat.js +441 -0
- package/dist/Editor/Toolbar/PopupTool/index.js +15 -17
- package/dist/Editor/Toolbar/Toolbar.js +20 -10
- package/dist/Editor/Toolbar/toolbarGroups.js +48 -6
- package/dist/Editor/assets/svg/CalenderIconTick.js +1 -0
- package/dist/Editor/assets/svg/ClearAllRounded.js +31 -0
- package/dist/Editor/assets/svg/ThemeIcons.js +291 -0
- package/dist/Editor/common/ColorPickerButton.js +45 -10
- package/dist/Editor/common/CustomColorPicker/index.js +125 -0
- package/dist/Editor/common/CustomColorPicker/style.js +53 -0
- package/dist/Editor/common/CustomDialog/index.js +8 -10
- package/dist/Editor/common/CustomDialog/styles.js +1 -1
- package/dist/Editor/common/CustomDialog2/index.js +94 -0
- package/dist/Editor/common/CustomDialog2/style.js +67 -0
- package/dist/Editor/common/CustomSelect.js +33 -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 +46 -1
- package/dist/Editor/common/ImageSelector/ImageSelector.js +10 -8
- package/dist/Editor/common/ImageSelector/Options/AddLink.js +6 -4
- package/dist/Editor/common/ImageSelector/Options/Upload.js +1 -1
- package/dist/Editor/common/ImageSelector/Styles.js +3 -9
- package/dist/Editor/common/ImageSelector/UploadStyles.js +9 -9
- package/dist/Editor/common/LinkSettings/NavComponents.js +14 -10
- package/dist/Editor/common/LinkSettings/index.js +20 -14
- package/dist/Editor/common/LinkSettings/navOptions.js +1 -1
- package/dist/Editor/common/MentionsPopup/Styles.js +111 -73
- package/dist/Editor/common/MentionsPopup/index.js +8 -4
- package/dist/Editor/common/RnD/ContextMenu/CMenus.js +22 -22
- package/dist/Editor/common/RnD/ContextMenu/index.js +3 -2
- package/dist/Editor/common/RnD/ElementOptions/index.js +7 -2
- package/dist/Editor/common/RnD/ElementSettings/OtherSettings/SaveAsTemplate.js +8 -3
- package/dist/Editor/common/RnD/ElementSettings/OtherSettings/Settings.js +7 -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 +7 -4
- 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 +6 -2
- package/dist/Editor/common/RnD/ElementSettings/Settings/VideoSettings.js +3 -2
- package/dist/Editor/common/RnD/ElementSettings/styles.js +0 -1
- package/dist/Editor/common/RnD/OptionsPopup/index.js +4 -3
- package/dist/Editor/common/RnD/SwitchViewport/SwitchViewport.js +11 -4
- package/dist/Editor/common/RnD/Theme/MainThemeProvider.js +17 -0
- package/dist/Editor/common/RnD/Theme/ViewportStimulator.js +20 -8
- package/dist/Editor/common/RnD/Utils/gridDropItem.js +58 -7
- package/dist/Editor/common/RnD/Utils/index.js +48 -0
- package/dist/Editor/common/RnD/VirtualElement/ForceAutoAlignment.js +110 -0
- package/dist/Editor/common/RnD/VirtualElement/VirtualTextElement.js +112 -0
- package/dist/Editor/common/RnD/VirtualElement/helper.js +267 -0
- package/dist/Editor/common/RnD/VirtualElement/index.js +186 -104
- package/dist/Editor/common/RnD/VirtualElement/styles.js +95 -8
- package/dist/Editor/common/RnD/VirtualElement/updateAutoProps.js +5 -3
- package/dist/Editor/common/RnD/index.js +82 -10
- package/dist/Editor/common/Section/index.js +7 -4
- package/dist/Editor/common/Shorthands/elements.js +98 -10
- package/dist/Editor/common/SnackBar/index.js +43 -0
- package/dist/Editor/common/StyleBuilder/appHeaderStyle.js +4 -4
- package/dist/Editor/common/StyleBuilder/boxStyle.js +2 -2
- package/dist/Editor/common/StyleBuilder/buttonStyle.js +6 -4
- package/dist/Editor/common/StyleBuilder/dividerStyles.js +2 -2
- package/dist/Editor/common/StyleBuilder/embedVideoStyle.js +6 -6
- package/dist/Editor/common/StyleBuilder/fieldStyle.js +2 -2
- package/dist/Editor/common/StyleBuilder/fieldTypes/alignment.js +13 -9
- package/dist/Editor/common/StyleBuilder/fieldTypes/backgroundImage.js +11 -3
- package/dist/Editor/common/StyleBuilder/fieldTypes/bannerSpacing.js +19 -5
- package/dist/Editor/common/StyleBuilder/fieldTypes/borderRadius.js +22 -10
- package/dist/Editor/common/StyleBuilder/fieldTypes/buttonLink.js +6 -3
- package/dist/Editor/common/StyleBuilder/fieldTypes/card.js +27 -13
- package/dist/Editor/common/StyleBuilder/fieldTypes/color.js +41 -14
- package/dist/Editor/common/StyleBuilder/fieldTypes/elementSize.js +10 -6
- package/dist/Editor/common/StyleBuilder/fieldTypes/fontSize.js +19 -6
- package/dist/Editor/common/StyleBuilder/fieldTypes/gridSize.js +6 -2
- package/dist/Editor/common/StyleBuilder/fieldTypes/icons.js +5 -2
- package/dist/Editor/common/StyleBuilder/fieldTypes/menusArray.js +9 -6
- package/dist/Editor/common/StyleBuilder/fieldTypes/metaDataMapping.js +8 -2
- package/dist/Editor/common/StyleBuilder/fieldTypes/saveAsTemplate.js +12 -11
- package/dist/Editor/common/StyleBuilder/fieldTypes/selectBox.js +6 -2
- package/dist/Editor/common/StyleBuilder/fieldTypes/text.js +8 -4
- package/dist/Editor/common/StyleBuilder/fieldTypes/textAlign.js +6 -2
- package/dist/Editor/common/StyleBuilder/fieldTypes/textOptions.js +21 -12
- package/dist/Editor/common/StyleBuilder/formStyle.js +7 -7
- package/dist/Editor/common/StyleBuilder/gridItemStyle.js +6 -6
- package/dist/Editor/common/StyleBuilder/gridStyle.js +5 -5
- package/dist/Editor/common/StyleBuilder/index.js +8 -5
- package/dist/Editor/common/StyleBuilder/pageSettingsStyle.js +5 -7
- package/dist/Editor/common/Uploader.js +16 -5
- package/dist/Editor/commonStyle.js +13 -23
- package/dist/Editor/helper/index.js +8 -12
- package/dist/Editor/helper/textIndeces.js +58 -0
- package/dist/Editor/helper/theme.js +200 -2
- package/dist/Editor/hooks/useAutoScroll.js +38 -0
- package/dist/Editor/hooks/useDrag.js +17 -11
- package/dist/Editor/hooks/useEditorScroll.js +10 -6
- package/dist/Editor/hooks/useEditorTheme.js +153 -0
- package/dist/Editor/hooks/useMouseMove.js +28 -13
- package/dist/Editor/hooks/useTable.js +5 -2
- package/dist/Editor/plugins/withEmbeds.js +1 -1
- package/dist/Editor/plugins/withHTML.js +19 -15
- package/dist/Editor/plugins/withLayout.js +3 -2
- package/dist/Editor/plugins/withTable.js +1 -1
- package/dist/Editor/theme/ThemeList.js +50 -173
- package/dist/Editor/theme/index.js +144 -0
- package/dist/Editor/themeSettings/ActiveTheme.js +72 -0
- package/dist/Editor/themeSettings/buttons/index.js +285 -0
- package/dist/Editor/themeSettings/buttons/style.js +23 -0
- package/dist/Editor/themeSettings/colorTheme/index.js +297 -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 +222 -0
- package/dist/Editor/themeSettings/fonts/style.js +59 -0
- package/dist/Editor/themeSettings/icons.js +60 -0
- package/dist/Editor/themeSettings/index.js +328 -0
- package/dist/Editor/themeSettings/style.js +193 -0
- package/dist/Editor/themeSettingsAI/icons.js +96 -0
- package/dist/Editor/themeSettingsAI/index.js +355 -0
- package/dist/Editor/themeSettingsAI/saveTheme.js +215 -0
- package/dist/Editor/themeSettingsAI/style.js +250 -0
- package/dist/Editor/utils/SlateUtilityFunctions.js +171 -47
- package/dist/Editor/utils/button.js +7 -2
- package/dist/Editor/utils/chatEditor/SlateUtilityFunctions.js +23 -0
- package/dist/Editor/utils/dataView.js +5 -2
- package/dist/Editor/utils/divider.js +18 -2
- package/dist/Editor/utils/draftToSlate.js +3 -2
- package/dist/Editor/utils/embed.js +9 -4
- package/dist/Editor/utils/font.js +40 -37
- package/dist/Editor/utils/freegrid.js +2 -2
- package/dist/Editor/utils/helper.js +136 -29
- package/dist/Editor/utils/signature.js +5 -2
- package/dist/Editor/utils/table.js +53 -37
- package/package.json +2 -2
@@ -31,7 +31,8 @@ const SignaturePopup = props => {
|
|
31
31
|
const {
|
32
32
|
readOnly,
|
33
33
|
metadata,
|
34
|
-
isSignerDetailsRequired = false
|
34
|
+
isSignerDetailsRequired = false,
|
35
|
+
translation
|
35
36
|
} = customProps;
|
36
37
|
const [open, setOpen] = useState(false);
|
37
38
|
const [tab, setTab] = useState(0);
|
@@ -67,7 +68,7 @@ const SignaturePopup = props => {
|
|
67
68
|
isValidEmail = validationMethods?.isEmail(signedData?.signedByEmail);
|
68
69
|
}
|
69
70
|
if (isValidEmail === "Enter valid email address") {
|
70
|
-
alert(isValidEmail);
|
71
|
+
alert(translation(isValidEmail));
|
71
72
|
} else {
|
72
73
|
onSave(signedData);
|
73
74
|
// manual delay
|
@@ -140,14 +141,14 @@ const SignaturePopup = props => {
|
|
140
141
|
style: {
|
141
142
|
color: "#A2B0B9"
|
142
143
|
},
|
143
|
-
children: "Your sign will be placed here"
|
144
|
+
children: translation("Your sign will be placed here")
|
144
145
|
})]
|
145
146
|
}), /*#__PURE__*/_jsx(Button, {
|
146
147
|
onClick: handleOpen,
|
147
148
|
style: {
|
148
149
|
width: "fit-content"
|
149
150
|
},
|
150
|
-
children: "Sign here"
|
151
|
+
children: translation("Sign here")
|
151
152
|
})]
|
152
153
|
}), /*#__PURE__*/_jsx(Dialog, {
|
153
154
|
className: `${className} dialogComp`,
|
@@ -184,7 +185,7 @@ const SignaturePopup = props => {
|
|
184
185
|
variant: "h6",
|
185
186
|
color: "primary",
|
186
187
|
sx: classes.popupTitle2,
|
187
|
-
children: "Signature"
|
188
|
+
children: translation("Signature")
|
188
189
|
})
|
189
190
|
}), /*#__PURE__*/_jsx(Grid, {
|
190
191
|
item: true,
|
@@ -231,7 +232,7 @@ const SignaturePopup = props => {
|
|
231
232
|
style: {
|
232
233
|
textTransform: "none"
|
233
234
|
},
|
234
|
-
children: "Draw Signature"
|
235
|
+
children: translation("Draw Signature")
|
235
236
|
})]
|
236
237
|
})
|
237
238
|
}), /*#__PURE__*/_jsx(Tab, {
|
@@ -244,7 +245,7 @@ const SignaturePopup = props => {
|
|
244
245
|
style: {
|
245
246
|
textTransform: "none"
|
246
247
|
},
|
247
|
-
children: "Type Signature"
|
248
|
+
children: translation("Type Signature")
|
248
249
|
})]
|
249
250
|
})
|
250
251
|
}), /*#__PURE__*/_jsx(Tab, {
|
@@ -257,7 +258,7 @@ const SignaturePopup = props => {
|
|
257
258
|
style: {
|
258
259
|
textTransform: "none"
|
259
260
|
},
|
260
|
-
children: "Upload Signature"
|
261
|
+
children: translation("Upload Signature")
|
261
262
|
})]
|
262
263
|
})
|
263
264
|
})]
|
@@ -303,7 +304,7 @@ const SignaturePopup = props => {
|
|
303
304
|
fontWeight: 500,
|
304
305
|
fontSize: "14px"
|
305
306
|
},
|
306
|
-
children: "
|
307
|
+
children: translation("nameField")
|
307
308
|
})
|
308
309
|
}), /*#__PURE__*/_jsx(Grid, {
|
309
310
|
item: true,
|
@@ -312,7 +313,7 @@ const SignaturePopup = props => {
|
|
312
313
|
fullWidth: true,
|
313
314
|
id: "signedBy",
|
314
315
|
name: "signedBy",
|
315
|
-
placeholder: "Enter Name",
|
316
|
+
placeholder: translation("Enter Name"),
|
316
317
|
value: signedData.signedBy || ""
|
317
318
|
// defaultValue={defaultName || ""}
|
318
319
|
,
|
@@ -340,7 +341,7 @@ const SignaturePopup = props => {
|
|
340
341
|
fontWeight: 500,
|
341
342
|
fontSize: "14px"
|
342
343
|
},
|
343
|
-
children: "
|
344
|
+
children: translation("dateField")
|
344
345
|
})
|
345
346
|
}), /*#__PURE__*/_jsx(Grid, {
|
346
347
|
item: true,
|
@@ -361,7 +362,7 @@ const SignaturePopup = props => {
|
|
361
362
|
customInput: /*#__PURE__*/_jsx(TextField, {
|
362
363
|
fullWidth: true,
|
363
364
|
name: "signedOn",
|
364
|
-
placeholder: "Select Date",
|
365
|
+
placeholder: translation("Select Date"),
|
365
366
|
size: "small",
|
366
367
|
InputProps: {
|
367
368
|
startAdornment: /*#__PURE__*/_jsx(InputAdornment, {
|
@@ -431,7 +432,7 @@ const SignaturePopup = props => {
|
|
431
432
|
fontWeight: 500,
|
432
433
|
fontSize: "14px"
|
433
434
|
},
|
434
|
-
children: "
|
435
|
+
children: translation("emailField")
|
435
436
|
})
|
436
437
|
}), /*#__PURE__*/_jsx(Grid, {
|
437
438
|
container: true,
|
@@ -440,7 +441,7 @@ const SignaturePopup = props => {
|
|
440
441
|
fullWidth: true,
|
441
442
|
id: "signedByEmail",
|
442
443
|
name: "signedByEmail",
|
443
|
-
placeholder: "Enter Email",
|
444
|
+
placeholder: translation("Enter Email"),
|
444
445
|
size: "small",
|
445
446
|
onChange: onChange,
|
446
447
|
sx: classes.signaturePopUpNameField,
|
@@ -518,12 +519,12 @@ const SignaturePopup = props => {
|
|
518
519
|
children: [!readOnly ? /*#__PURE__*/_jsx(Button, {
|
519
520
|
onClick: handleClear,
|
520
521
|
className: `secondaryBtn actionBtn deleteBtn deleteButtonSignature`,
|
521
|
-
children: "Delete"
|
522
|
+
children: translation("Delete")
|
522
523
|
}) : null, /*#__PURE__*/_jsx(Button, {
|
523
524
|
onClick: handleSave,
|
524
525
|
className: `primaryBtn actionBtn ${isEmpty ? "disabled disabledSaveBtn" : ""}`,
|
525
526
|
disabled: isEmpty,
|
526
|
-
children: "Save"
|
527
|
+
children: translation("Save")
|
527
528
|
})]
|
528
529
|
})]
|
529
530
|
})]
|
@@ -24,7 +24,8 @@ const SimpleText = props => {
|
|
24
24
|
} = props;
|
25
25
|
const {
|
26
26
|
readOnly,
|
27
|
-
editorPlaceholder
|
27
|
+
editorPlaceholder,
|
28
|
+
translation
|
28
29
|
} = customProps;
|
29
30
|
// const { element: pageSt } = getPageSettings(editor) || {};
|
30
31
|
// const { pageColor } = pageSt?.pageProps || {};
|
@@ -46,15 +47,15 @@ const SimpleText = props => {
|
|
46
47
|
}, children, openAI ? null : /*#__PURE__*/_jsx("span", {
|
47
48
|
contentEditable: false,
|
48
49
|
className: "placeholder-simple-text",
|
49
|
-
children: isEmptyEditor ? editorPlaceholder || "
|
50
|
-
children: ["Type", " ", /*#__PURE__*/_jsx("span", {
|
50
|
+
children: isEmptyEditor ? editorPlaceholder || translation("writeSomethingPlaceHolder") : showPlaceHolder ? opacity && selected ? /*#__PURE__*/_jsxs(_Fragment, {
|
51
|
+
children: [translation("Type"), " ", /*#__PURE__*/_jsx("span", {
|
51
52
|
style: {
|
52
53
|
backgroundColor: "#F2F6FA",
|
53
54
|
padding: "0px 2px",
|
54
55
|
borderRadius: "2px"
|
55
56
|
},
|
56
57
|
children: "/"
|
57
|
-
}), " ", "
|
58
|
+
}), " ", translation("browseElementText")]
|
58
59
|
}) : "" : ""
|
59
60
|
}));
|
60
61
|
};
|
@@ -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",
|
@@ -29,7 +29,8 @@ function DragButton({
|
|
29
29
|
const dragElement = useRef(null);
|
30
30
|
const [showTool, setShowTool] = useState(false);
|
31
31
|
const {
|
32
|
-
isMobile
|
32
|
+
isMobile,
|
33
|
+
translation
|
33
34
|
} = customProps || {};
|
34
35
|
const onDragClick = () => {
|
35
36
|
onDrag();
|
@@ -62,7 +63,8 @@ function DragButton({
|
|
62
63
|
hideDelete,
|
63
64
|
handleToolAction: (value, option, dragType) => {
|
64
65
|
handleAction(value, option, dragType);
|
65
|
-
}
|
66
|
+
},
|
67
|
+
translation
|
66
68
|
};
|
67
69
|
return /*#__PURE__*/_jsx(_Fragment, {
|
68
70
|
children: show || showTool ? /*#__PURE__*/_jsxs(_Fragment, {
|
@@ -12,9 +12,11 @@ import useTable, { TableProvider, getDefaultTableSelection } from "../../hooks/u
|
|
12
12
|
import AddRowCol from "./AddRowCol";
|
13
13
|
import TableTool from "./TableTool";
|
14
14
|
import { MoreIcon, SettingsIcon } from "../../assets/svg/TableIcons";
|
15
|
+
import { DeleteIcon } from "../../assets/svg/AIIcons";
|
15
16
|
import { getSelectedCls } from "../../utils/helper";
|
16
17
|
import SwipeableDrawerComponent from "../../common/SwipeableDrawer";
|
17
18
|
import { jsx as _jsx } from "react/jsx-runtime";
|
19
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
18
20
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
19
21
|
const hideRowDragBtns = (hide, dragRowBtnCls) => {
|
20
22
|
const rowDragBtns = document.querySelectorAll(`.${dragRowBtnCls}`);
|
@@ -25,7 +27,8 @@ const hideRowDragBtns = (hide, dragRowBtnCls) => {
|
|
25
27
|
const ToolTableComponent = props => {
|
26
28
|
const {
|
27
29
|
handleAction,
|
28
|
-
editorTheme
|
30
|
+
editorTheme,
|
31
|
+
translation
|
29
32
|
} = props;
|
30
33
|
const {
|
31
34
|
updateTableSelection
|
@@ -37,7 +40,8 @@ const ToolTableComponent = props => {
|
|
37
40
|
if (type === "duplicate") {
|
38
41
|
updateTableSelection(getDefaultTableSelection());
|
39
42
|
}
|
40
|
-
}
|
43
|
+
},
|
44
|
+
translation: translation
|
41
45
|
});
|
42
46
|
};
|
43
47
|
const MoreTableSettings = props => {
|
@@ -46,9 +50,13 @@ const MoreTableSettings = props => {
|
|
46
50
|
handleAction,
|
47
51
|
editorTheme,
|
48
52
|
setExpandTools,
|
49
|
-
classes
|
53
|
+
classes,
|
54
|
+
customProps
|
50
55
|
} = props;
|
51
56
|
const isMobile = window.matchMedia("(max-width: 899px)")?.matches || false;
|
57
|
+
const {
|
58
|
+
translation
|
59
|
+
} = customProps;
|
52
60
|
return isMobile ? /*#__PURE__*/_jsx(SwipeableDrawerComponent, {
|
53
61
|
open: Boolean(exandTools),
|
54
62
|
onClose: () => {
|
@@ -75,7 +83,8 @@ const MoreTableSettings = props => {
|
|
75
83
|
children: /*#__PURE__*/_jsx("div", {
|
76
84
|
children: /*#__PURE__*/_jsx(ToolTableComponent, {
|
77
85
|
handleAction: handleAction,
|
78
|
-
editorTheme: editorTheme
|
86
|
+
editorTheme: editorTheme,
|
87
|
+
translation: translation
|
79
88
|
})
|
80
89
|
})
|
81
90
|
})
|
@@ -89,34 +98,45 @@ const ToolBar = props => {
|
|
89
98
|
handleExpand,
|
90
99
|
handleAction,
|
91
100
|
exandTools,
|
92
|
-
openSetttings
|
101
|
+
openSetttings,
|
102
|
+
hideTools
|
93
103
|
} = props;
|
94
104
|
const {
|
95
105
|
getSelectedCells
|
96
106
|
} = useTable();
|
97
107
|
const viewTool = selected && !showTool && getSelectedCells()?.length <= 1;
|
98
|
-
return viewTool ? /*#__PURE__*/
|
108
|
+
return viewTool ? /*#__PURE__*/_jsx(Box, {
|
99
109
|
component: "div",
|
100
110
|
contentEditable: false,
|
101
111
|
className: `tableToolBar ${exandTools ? "active" : ""}`,
|
102
112
|
sx: classes.tableToolBar,
|
103
|
-
children:
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
+
children: !hideTools.includes("settings") ? /*#__PURE__*/_jsxs(_Fragment, {
|
114
|
+
children: [/*#__PURE__*/_jsx(Tooltip, {
|
115
|
+
title: "Settings",
|
116
|
+
arrow: true,
|
117
|
+
onClick: () => handleAction("settings"),
|
118
|
+
children: /*#__PURE__*/_jsx(IconButton, {
|
119
|
+
className: getSelectedCls("toolbtn toggle", openSetttings),
|
120
|
+
children: /*#__PURE__*/_jsx(SettingsIcon, {})
|
121
|
+
})
|
122
|
+
}), /*#__PURE__*/_jsx(Tooltip, {
|
123
|
+
title: "Show Tools",
|
124
|
+
arrow: true,
|
125
|
+
onClick: handleExpand,
|
126
|
+
children: /*#__PURE__*/_jsx(IconButton, {
|
127
|
+
className: getSelectedCls("toolbtn toggle", exandTools),
|
128
|
+
children: /*#__PURE__*/_jsx(MoreIcon, {})
|
129
|
+
})
|
130
|
+
})]
|
131
|
+
}) : /*#__PURE__*/_jsx(Tooltip, {
|
132
|
+
title: "Delete",
|
113
133
|
arrow: true,
|
114
|
-
onClick:
|
134
|
+
onClick: () => handleAction("delete"),
|
115
135
|
children: /*#__PURE__*/_jsx(IconButton, {
|
116
|
-
className:
|
117
|
-
children: /*#__PURE__*/_jsx(
|
136
|
+
className: "editor-deleteicon",
|
137
|
+
children: /*#__PURE__*/_jsx(DeleteIcon, {})
|
118
138
|
})
|
119
|
-
})
|
139
|
+
})
|
120
140
|
}) : null;
|
121
141
|
};
|
122
142
|
const Table = props => {
|
@@ -133,7 +153,8 @@ const Table = props => {
|
|
133
153
|
const classes = TableStyles(editorTheme);
|
134
154
|
const {
|
135
155
|
readOnly,
|
136
|
-
isMobile
|
156
|
+
isMobile,
|
157
|
+
hideTools = []
|
137
158
|
} = customProps;
|
138
159
|
const [openSetttings, setOpenSettings] = useState(false);
|
139
160
|
const [exandTools, setExpandTools] = useState(null);
|
@@ -304,12 +325,12 @@ const Table = props => {
|
|
304
325
|
...attributes,
|
305
326
|
children: children
|
306
327
|
})
|
307
|
-
}), /*#__PURE__*/_jsx(AddRowCol, {
|
328
|
+
}), !hideTools.includes("add_column") && /*#__PURE__*/_jsx(AddRowCol, {
|
308
329
|
...commonAddBtnProps,
|
309
330
|
addType: "col",
|
310
331
|
onAdd: addCol
|
311
332
|
})]
|
312
|
-
}), /*#__PURE__*/_jsx(AddRowCol, {
|
333
|
+
}), !hideTools.includes("add_column") && /*#__PURE__*/_jsx(AddRowCol, {
|
313
334
|
...commonAddBtnProps,
|
314
335
|
addType: "row",
|
315
336
|
onAdd: addRow
|
@@ -320,13 +341,15 @@ const Table = props => {
|
|
320
341
|
handleExpand: handleExpand,
|
321
342
|
handleAction: handleAction,
|
322
343
|
exandTools: exandTools,
|
323
|
-
openSetttings: openSetttings
|
344
|
+
openSetttings: openSetttings,
|
345
|
+
hideTools: hideTools
|
324
346
|
}), /*#__PURE__*/_jsx(MoreTableSettings, {
|
325
347
|
exandTools: exandTools,
|
326
348
|
handleAction: handleAction,
|
327
349
|
editorTheme: editorTheme,
|
328
350
|
setExpandTools: setExpandTools,
|
329
|
-
classes: classes
|
351
|
+
classes: classes,
|
352
|
+
customProps: customProps
|
330
353
|
}), openSetttings ? /*#__PURE__*/_jsx(TablePopup, {
|
331
354
|
element: tableProps?.styleProps || {},
|
332
355
|
onSave: onSave,
|
@@ -12,30 +12,9 @@ import TablePopup from "./TablePopup";
|
|
12
12
|
import { Droppable } from "./Droppable";
|
13
13
|
import { useDndContext } from "@dnd-kit/core";
|
14
14
|
import { getNodeWithType } from "../../utils/helper";
|
15
|
-
import { isEmptyTextNode } from "../../helper";
|
16
|
-
import SimpleText from "../SimpleText";
|
17
15
|
import { jsx as _jsx } from "react/jsx-runtime";
|
18
16
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
19
17
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
20
|
-
const withOldTableData = WrappedComponent => {
|
21
|
-
// to prevent old table data issues, ("table-cell" node is coming without parent "table" node (FS-9330))
|
22
|
-
return function TableHOC(props) {
|
23
|
-
const tableData = useTable();
|
24
|
-
if (!tableData) {
|
25
|
-
const {
|
26
|
-
element
|
27
|
-
} = props;
|
28
|
-
const isEmpty = isEmptyTextNode(element);
|
29
|
-
return /*#__PURE__*/_jsx(SimpleText, {
|
30
|
-
...props,
|
31
|
-
isEmpty: isEmpty
|
32
|
-
});
|
33
|
-
}
|
34
|
-
return /*#__PURE__*/_jsx(WrappedComponent, {
|
35
|
-
...props
|
36
|
-
});
|
37
|
-
};
|
38
|
-
};
|
39
18
|
const Resizer = ({
|
40
19
|
classes,
|
41
20
|
onMouseDown,
|
@@ -69,7 +48,8 @@ const TableCell = props => {
|
|
69
48
|
customProps
|
70
49
|
} = props;
|
71
50
|
const {
|
72
|
-
readOnly
|
51
|
+
readOnly,
|
52
|
+
hideTools = []
|
73
53
|
} = customProps;
|
74
54
|
const isMobile = window.matchMedia("(max-width: 899px)")?.matches || false;
|
75
55
|
const {
|
@@ -131,8 +111,8 @@ const TableCell = props => {
|
|
131
111
|
const isFirstRow = row === 0;
|
132
112
|
const isFirstColumn = column === 0;
|
133
113
|
const [hoverRow, hoverCol] = hoverPath ? hoverPath.slice(-2) : [];
|
134
|
-
const showColDrag = isFirstRow && hoverCol === column && !resizing && !readOnly;
|
135
|
-
const showRowDrag = isFirstColumn && hoverRow === row && !resizing && !readOnly;
|
114
|
+
const showColDrag = isFirstRow && hoverCol === column && !resizing && !readOnly && !hideTools.includes("drag");
|
115
|
+
const showRowDrag = isFirstColumn && hoverRow === row && !resizing && !readOnly && !hideTools.includes("drag");
|
136
116
|
const [parentProps] = tableNode || [{}];
|
137
117
|
const [rowProps] = rowNode || [{}];
|
138
118
|
const tableDOM = table.getDOMNode(path, true);
|
@@ -180,7 +160,7 @@ const TableCell = props => {
|
|
180
160
|
};
|
181
161
|
useEffect(() => {
|
182
162
|
const currentPath = path?.toString();
|
183
|
-
|
163
|
+
setTimeout(() => {
|
184
164
|
if (tableResizing === currentPath) {
|
185
165
|
setTableResizing(null);
|
186
166
|
|
@@ -196,7 +176,6 @@ const TableCell = props => {
|
|
196
176
|
if (resizing) {
|
197
177
|
setTableResizing(currentPath);
|
198
178
|
}
|
199
|
-
return () => clearTimeout(timeoutId);
|
200
179
|
}, [resizing]);
|
201
180
|
const onMouseEnter = path => {
|
202
181
|
setHoverPath(path);
|
@@ -214,6 +193,7 @@ const TableCell = props => {
|
|
214
193
|
setHoverPath(null);
|
215
194
|
};
|
216
195
|
const onMouseDownInCell = e => {
|
196
|
+
setHoverPath(path);
|
217
197
|
if (
|
218
198
|
// for shift selection
|
219
199
|
e.shiftKey && startCellPath?.length && startCellPath.toString() !== path.toString()) {
|
@@ -397,6 +377,9 @@ const TableCell = props => {
|
|
397
377
|
setOpenSettings(false);
|
398
378
|
};
|
399
379
|
const onSave = data => {
|
380
|
+
const tableProps = table.getTableProps({
|
381
|
+
at: path
|
382
|
+
});
|
400
383
|
const updateData = {
|
401
384
|
...data
|
402
385
|
};
|
@@ -480,4 +463,4 @@ const TableCell = props => {
|
|
480
463
|
}) : null]
|
481
464
|
});
|
482
465
|
};
|
483
|
-
export default
|
466
|
+
export default TableCell;
|
@@ -15,8 +15,11 @@ const TablePopup = props => {
|
|
15
15
|
styleType
|
16
16
|
} = props;
|
17
17
|
const styles = STYLE_TYPES[styleType] || tableStyle;
|
18
|
+
const {
|
19
|
+
translation
|
20
|
+
} = customProps;
|
18
21
|
return /*#__PURE__*/_jsx(StyleBuilder, {
|
19
|
-
title: "Table",
|
22
|
+
title: translation("Table"),
|
20
23
|
type: "gridStyle",
|
21
24
|
element: element,
|
22
25
|
onSave: onSave,
|
@@ -10,7 +10,8 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
10
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
11
11
|
const TableSelector = ({
|
12
12
|
editor,
|
13
|
-
icoBtnType
|
13
|
+
icoBtnType,
|
14
|
+
customProps
|
14
15
|
}) => {
|
15
16
|
const tableOptionsRef = useRef();
|
16
17
|
const [selection, setSelection] = useState();
|
@@ -20,6 +21,9 @@ const TableSelector = ({
|
|
20
21
|
column: 2
|
21
22
|
});
|
22
23
|
const table = new TableUtil(editor);
|
24
|
+
const {
|
25
|
+
translation
|
26
|
+
} = customProps;
|
23
27
|
const handleButtonClick = () => {
|
24
28
|
setSelection(editor.selection);
|
25
29
|
setShowOptions(true);
|
@@ -72,7 +76,7 @@ const TableSelector = ({
|
|
72
76
|
variant: "h6",
|
73
77
|
className: "popupTitle",
|
74
78
|
color: "primary",
|
75
|
-
children: "Table"
|
79
|
+
children: translation("Table")
|
76
80
|
}), /*#__PURE__*/_jsx(Grid, {
|
77
81
|
style: {
|
78
82
|
display: "flex"
|
@@ -110,7 +114,7 @@ const TableSelector = ({
|
|
110
114
|
fontSize: "14px",
|
111
115
|
fontWeight: 500
|
112
116
|
},
|
113
|
-
children: "
|
117
|
+
children: translation("numberOfRow")
|
114
118
|
})
|
115
119
|
}), /*#__PURE__*/_jsx(TextField, {
|
116
120
|
fullWidth: true,
|
@@ -137,7 +141,7 @@ const TableSelector = ({
|
|
137
141
|
fontSize: "14px",
|
138
142
|
fontWeight: 500
|
139
143
|
},
|
140
|
-
children: "
|
144
|
+
children: translation("numberOfCoumns")
|
141
145
|
})
|
142
146
|
}), /*#__PURE__*/_jsx(TextField, {
|
143
147
|
fullWidth: true,
|
@@ -158,11 +162,11 @@ const TableSelector = ({
|
|
158
162
|
children: [/*#__PURE__*/_jsx(Button, {
|
159
163
|
onClick: onCancel,
|
160
164
|
className: "secondaryBtn",
|
161
|
-
children: "Cancel"
|
165
|
+
children: translation("Cancel")
|
162
166
|
}), /*#__PURE__*/_jsx(Button, {
|
163
167
|
onClick: handleInsert,
|
164
168
|
className: "primaryBtn",
|
165
|
-
children: "Save"
|
169
|
+
children: translation("Save")
|
166
170
|
})]
|
167
171
|
})]
|
168
172
|
})
|
@@ -67,7 +67,8 @@ export function TableToolOnDrag({
|
|
67
67
|
theme,
|
68
68
|
dragType,
|
69
69
|
handleToolAction,
|
70
|
-
hideDelete
|
70
|
+
hideDelete,
|
71
|
+
translation
|
71
72
|
}) {
|
72
73
|
const classes = Styles(theme);
|
73
74
|
const tools = getTools(dragType, hideDelete);
|
@@ -81,12 +82,14 @@ export function TableToolOnDrag({
|
|
81
82
|
btnProps: {
|
82
83
|
onMouseDown: e => e.stopPropagation(),
|
83
84
|
onMouseUp: e => e.stopPropagation()
|
84
|
-
}
|
85
|
+
},
|
86
|
+
translation: translation
|
85
87
|
});
|
86
88
|
}
|
87
89
|
function TableTool({
|
88
90
|
theme,
|
89
|
-
handleToolAction
|
91
|
+
handleToolAction,
|
92
|
+
translation
|
90
93
|
}) {
|
91
94
|
const classes = Styles(theme);
|
92
95
|
return /*#__PURE__*/_jsx(CustomSelect, {
|
@@ -95,7 +98,8 @@ function TableTool({
|
|
95
98
|
options: wholeTableTools,
|
96
99
|
onSend: (value, option) => {
|
97
100
|
handleToolAction(value, option);
|
98
|
-
}
|
101
|
+
},
|
102
|
+
translation: translation
|
99
103
|
});
|
100
104
|
}
|
101
105
|
export default TableTool;
|
@@ -2,7 +2,14 @@ import React, { useEffect, useState } from "react";
|
|
2
2
|
import { Editor } from "slate";
|
3
3
|
import { useSlate } from "slate-react";
|
4
4
|
import { getNodeText } from "../../utils/helper";
|
5
|
+
import { Text } from "slate";
|
5
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
7
|
+
const isEmptyTextNode = node => {
|
8
|
+
if (Text.isText(node)) {
|
9
|
+
return !node.text.trim();
|
10
|
+
}
|
11
|
+
return false;
|
12
|
+
};
|
6
13
|
const Title = props => {
|
7
14
|
const {
|
8
15
|
attributes,
|
@@ -11,8 +18,11 @@ const Title = props => {
|
|
11
18
|
customProps
|
12
19
|
} = props;
|
13
20
|
useDetectExitFromTitle(element, customProps?.getTitleSaveData);
|
21
|
+
const isEmpty = !customProps?.readOnly && isEmptyTextNode(element?.children[0]) ? "empty" : "";
|
14
22
|
return /*#__PURE__*/_jsx("div", {
|
15
23
|
...attributes,
|
24
|
+
placeholder: "Title",
|
25
|
+
className: `content-editable ${isEmpty}`,
|
16
26
|
style: {
|
17
27
|
fontWeight: "bold",
|
18
28
|
fontSize: "20px"
|
@@ -13,6 +13,9 @@ const TopBannerButton = props => {
|
|
13
13
|
customProps
|
14
14
|
} = props;
|
15
15
|
const [open, setOpen] = useState(false);
|
16
|
+
const {
|
17
|
+
translation
|
18
|
+
} = customProps;
|
16
19
|
const onSelectImage = url => {
|
17
20
|
if (url) {
|
18
21
|
insertTopBanner(editor, {
|
@@ -29,7 +32,7 @@ const TopBannerButton = props => {
|
|
29
32
|
};
|
30
33
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
31
34
|
children: [/*#__PURE__*/_jsx(ToolbarIcon, {
|
32
|
-
title: "Top Banner",
|
35
|
+
title: translation("Top Banner"),
|
33
36
|
onClick: handleClick,
|
34
37
|
icon: /*#__PURE__*/_jsx(Icon, {
|
35
38
|
icon: "topbanner"
|
@@ -34,7 +34,8 @@ const VariableButton = props => {
|
|
34
34
|
PaperProps: {
|
35
35
|
style: {
|
36
36
|
maxHeight: 300,
|
37
|
-
overflowY: "auto"
|
37
|
+
overflowY: "auto",
|
38
|
+
transformOrigin: 'top left'
|
38
39
|
},
|
39
40
|
sx: {
|
40
41
|
"&::-webkit-scrollbar-track": {
|
@@ -44,6 +45,14 @@ const VariableButton = props => {
|
|
44
45
|
borderRadius: "16px"
|
45
46
|
}
|
46
47
|
}
|
48
|
+
},
|
49
|
+
anchorOrigin: {
|
50
|
+
vertical: 'bottom',
|
51
|
+
horizontal: 'right'
|
52
|
+
},
|
53
|
+
transformOrigin: {
|
54
|
+
vertical: 'top',
|
55
|
+
horizontal: 'right'
|
47
56
|
}
|
48
57
|
},
|
49
58
|
children: [/*#__PURE__*/_jsx(MenuItem, {
|
@@ -26,7 +26,8 @@ const MiniEditor = props => {
|
|
26
26
|
className,
|
27
27
|
otherProps,
|
28
28
|
onSave,
|
29
|
-
theme
|
29
|
+
theme,
|
30
|
+
translation
|
30
31
|
} = props;
|
31
32
|
const {
|
32
33
|
CHARACTERS = []
|
@@ -41,11 +42,16 @@ const MiniEditor = props => {
|
|
41
42
|
const [value, setValue] = useState(ensureWrappedVariables(updatedContent));
|
42
43
|
const [deboundedValue] = useDebounce(value, 500);
|
43
44
|
const isReadOnly = readOnly === "readonly";
|
45
|
+
const {
|
46
|
+
translationMock
|
47
|
+
} = otherProps;
|
48
|
+
const dummyTranslation = () => {};
|
44
49
|
const customProps = {
|
45
50
|
...(otherProps || {}),
|
46
51
|
readOnly: isReadOnly,
|
47
52
|
editorPlaceholder: miniEditorPlaceholder,
|
48
|
-
page_id: id
|
53
|
+
page_id: id,
|
54
|
+
translation: translation || translationMock || dummyTranslation
|
49
55
|
};
|
50
56
|
const [mentions, setMentions] = useMentions({
|
51
57
|
editor,
|
@@ -58,7 +64,8 @@ const MiniEditor = props => {
|
|
58
64
|
} = mentions;
|
59
65
|
const chars = type ? Shorthands[type]({
|
60
66
|
...mentions,
|
61
|
-
CHARACTERS
|
67
|
+
CHARACTERS,
|
68
|
+
translation: translation || translationMock
|
62
69
|
}) : [];
|
63
70
|
useEffect(() => {
|
64
71
|
if (onSave && isInteracted) {
|