@flozy/editor 9.8.3 → 9.8.5
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 +14 -7
- package/dist/Editor/CommonEditor.js +27 -12
- 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/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 +6 -5
- 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/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/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 +3 -2
- 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 +7 -6
- package/dist/Editor/Elements/DataView/Layouts/Options/EditProperty.js +15 -12
- 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 +12 -6
- 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/Image.js +14 -9
- 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 +21 -4
- package/dist/Editor/Elements/FreeGrid/FreeGridBox.js +6 -2
- package/dist/Editor/Elements/FreeGrid/FreeGridButton.js +6 -2
- package/dist/Editor/Elements/FreeGrid/FreeGridItem.js +8 -3
- package/dist/Editor/Elements/FreeGrid/Options/AddElement.js +3 -2
- package/dist/Editor/Elements/FreeGrid/Options/More.js +4 -3
- 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 +13 -7
- 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 +8 -5
- 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 +4 -1
- 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/Table/DragButton.js +4 -2
- package/dist/Editor/Elements/Table/Table.js +21 -9
- 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/TopBanner/TopBannerButton.js +4 -1
- package/dist/Editor/MiniEditor.js +9 -3
- package/dist/Editor/Toolbar/Basic/index.js +2 -1
- package/dist/Editor/Toolbar/FormatTools/BlockButton.js +6 -2
- package/dist/Editor/Toolbar/FormatTools/MarkButton.js +6 -2
- package/dist/Editor/Toolbar/Mini/MiniToolbar.js +17 -5
- 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/SelectList.js +58 -51
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectSuperSubscript.js +29 -22
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectTypography.js +87 -73
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/index.js +14 -7
- package/dist/Editor/Toolbar/PopupTool/PopperHeader.js +8 -4
- package/dist/Editor/Toolbar/PopupTool/TemplateCard.js +11 -5
- package/dist/Editor/Toolbar/PopupTool/TextFormat.js +29 -21
- package/dist/Editor/Toolbar/PopupTool/index.js +17 -1
- package/dist/Editor/Toolbar/Toolbar.js +20 -10
- package/dist/Editor/common/CustomDialog/index.js +8 -10
- package/dist/Editor/common/ImageSelector/ImageSelector.js +10 -8
- package/dist/Editor/common/ImageSelector/Options/AddLink.js +6 -4
- 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/index.js +6 -2
- 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 +5 -2
- package/dist/Editor/common/RnD/ElementSettings/Settings/FormSettings.js +3 -2
- package/dist/Editor/common/RnD/ElementSettings/Settings/TextSettings.js +4 -2
- package/dist/Editor/common/RnD/OptionsPopup/index.js +4 -3
- package/dist/Editor/common/RnD/SwitchViewport/SwitchViewport.js +4 -3
- package/dist/Editor/common/RnD/index.js +11 -4
- package/dist/Editor/common/Section/index.js +7 -4
- package/dist/Editor/common/Shorthands/elements.js +18 -3
- 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 +2 -2
- 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 +6 -3
- package/dist/Editor/common/StyleBuilder/fieldTypes/bannerSpacing.js +7 -3
- package/dist/Editor/common/StyleBuilder/fieldTypes/borderRadius.js +7 -3
- package/dist/Editor/common/StyleBuilder/fieldTypes/buttonLink.js +6 -3
- package/dist/Editor/common/StyleBuilder/fieldTypes/card.js +11 -5
- package/dist/Editor/common/StyleBuilder/fieldTypes/color.js +9 -5
- package/dist/Editor/common/StyleBuilder/fieldTypes/elementSize.js +10 -6
- package/dist/Editor/common/StyleBuilder/fieldTypes/fontSize.js +6 -2
- 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 +6 -5
- 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/Uploader.js +8 -5
- package/dist/Editor/helper/index.js +27 -3
- package/dist/Editor/plugins/withLayout.js +3 -2
- package/dist/Editor/plugins/withLinks.js +10 -0
- package/dist/Editor/utils/SlateUtilityFunctions.js +15 -9
- package/dist/Editor/utils/brains.js +1 -2
- package/dist/Editor/utils/freegrid.js +1 -1
- package/dist/Editor/utils/helper.js +2 -2
- package/package.json +1 -1
@@ -11,6 +11,16 @@ const withLinks = editor => {
|
|
11
11
|
// remove empty inline
|
12
12
|
editor.normalizeNode = entry => {
|
13
13
|
const [node, path] = entry;
|
14
|
+
|
15
|
+
// if (!editor.children.length) {
|
16
|
+
// Transforms.insertNodes(editor, {
|
17
|
+
// type: "paragraph",
|
18
|
+
// children: [{ text: "" }],
|
19
|
+
// });
|
20
|
+
|
21
|
+
// return;
|
22
|
+
// }
|
23
|
+
|
14
24
|
if (Element.isElement(node) && node.type === "paragraph") {
|
15
25
|
const children = Array.from(Node.children(editor, path));
|
16
26
|
for (const [child, childPath] of children) {
|
@@ -258,7 +258,9 @@ export const getMarked = (leaf, children, theme) => {
|
|
258
258
|
// lg: sizeMap[leaf.fontSize] || leaf.fontSize,
|
259
259
|
// ...getBreakPointsValue(leaf.fontSize, null, "overrideText"),
|
260
260
|
// },
|
261
|
-
|
261
|
+
'& span[data-slate-string="true"]': {
|
262
|
+
...textStyles
|
263
|
+
},
|
262
264
|
fontFamily: family,
|
263
265
|
fontWeight: leaf.fontWeight,
|
264
266
|
WebkitTextFillColor: "unset !important"
|
@@ -284,17 +286,21 @@ export const getMarked = (leaf, children, theme) => {
|
|
284
286
|
export const getBlock = props => {
|
285
287
|
const {
|
286
288
|
element,
|
287
|
-
children
|
289
|
+
children,
|
290
|
+
customProps
|
288
291
|
} = props;
|
289
292
|
const attributes = props.attributes ?? {};
|
290
293
|
const isEmpty = isEmptyTextNode(element);
|
294
|
+
const {
|
295
|
+
translation
|
296
|
+
} = customProps;
|
291
297
|
switch (element.type) {
|
292
298
|
case "headingOne":
|
293
299
|
return /*#__PURE__*/_jsxs("h1", {
|
294
300
|
...attributes,
|
295
301
|
...element.attr,
|
296
302
|
className: `edt-headings content-editable ${isEmpty ? "empty" : ""}`,
|
297
|
-
placeholder: "Heading 1",
|
303
|
+
placeholder: translation("Heading 1"),
|
298
304
|
children: [children, /*#__PURE__*/_jsx("span", {
|
299
305
|
contentEditable: false
|
300
306
|
})]
|
@@ -304,7 +310,7 @@ export const getBlock = props => {
|
|
304
310
|
...attributes,
|
305
311
|
...element.attr,
|
306
312
|
className: `edt-headings content-editable ${isEmpty ? "empty" : ""}`,
|
307
|
-
placeholder: "Heading 2",
|
313
|
+
placeholder: translation("Heading 2"),
|
308
314
|
children: [children, /*#__PURE__*/_jsx("span", {
|
309
315
|
contentEditable: false
|
310
316
|
})]
|
@@ -314,7 +320,7 @@ export const getBlock = props => {
|
|
314
320
|
...attributes,
|
315
321
|
...element.attr,
|
316
322
|
className: `edt-headings content-editable ${isEmpty ? "empty" : ""}`,
|
317
|
-
placeholder: "Heading 3",
|
323
|
+
placeholder: translation("Heading 3"),
|
318
324
|
children: [children, /*#__PURE__*/_jsx("span", {
|
319
325
|
contentEditable: false
|
320
326
|
})]
|
@@ -324,7 +330,7 @@ export const getBlock = props => {
|
|
324
330
|
...attributes,
|
325
331
|
...element.attr,
|
326
332
|
className: `edt-headings content-editable ${isEmpty ? "empty" : ""}`,
|
327
|
-
placeholder: "Heading 4",
|
333
|
+
placeholder: translation("Heading 4"),
|
328
334
|
children: [children, /*#__PURE__*/_jsx("span", {
|
329
335
|
contentEditable: false
|
330
336
|
})]
|
@@ -334,7 +340,7 @@ export const getBlock = props => {
|
|
334
340
|
...attributes,
|
335
341
|
...element.attr,
|
336
342
|
className: `edt-headings content-editable ${isEmpty ? "empty" : ""}`,
|
337
|
-
placeholder: "Heading 5",
|
343
|
+
placeholder: translation("Heading 5"),
|
338
344
|
children: [children, /*#__PURE__*/_jsx("span", {
|
339
345
|
contentEditable: false
|
340
346
|
})]
|
@@ -344,7 +350,7 @@ export const getBlock = props => {
|
|
344
350
|
...attributes,
|
345
351
|
...element.attr,
|
346
352
|
className: `edt-headings content-editable ${isEmpty ? "empty" : ""}`,
|
347
|
-
placeholder: "Heading 6",
|
353
|
+
placeholder: translation("Heading 6"),
|
348
354
|
children: [children, /*#__PURE__*/_jsx("span", {
|
349
355
|
contentEditable: false
|
350
356
|
})]
|
@@ -414,7 +420,7 @@ export const getBlock = props => {
|
|
414
420
|
...attributes,
|
415
421
|
...element.attr,
|
416
422
|
className: `content-editable ${isEmpty ? "empty" : ""}`,
|
417
|
-
placeholder: "List",
|
423
|
+
placeholder: translation("List"),
|
418
424
|
style: {
|
419
425
|
color: firstChildren?.color
|
420
426
|
},
|
@@ -17,8 +17,7 @@ export const insertBrain = (editor, data, position) => {
|
|
17
17
|
}]
|
18
18
|
};
|
19
19
|
const [currentNode, currentPath] = Editor.node(editor, selection);
|
20
|
-
|
21
|
-
const cleanedText = Node.string(currentNode).replace(/\/(?:b(?:rain|rai|ra|r)?)?/g, "").trim();
|
20
|
+
const cleanedText = Node.string(currentNode).toLowerCase().replace(/\/(?:b(?:rain|rai|ra|r)?)?/g, "").trim();
|
22
21
|
if (cleanedText) {
|
23
22
|
Transforms.delete(editor, {
|
24
23
|
at: Editor.range(editor, currentPath)
|
@@ -168,11 +168,11 @@ export const handleInsertLastElement = (event, editor) => {
|
|
168
168
|
}
|
169
169
|
const hasPath = event.target.dataset.path;
|
170
170
|
const lastElement = editor.children[editor.children?.length - 1];
|
171
|
-
const isFreeGrid = lastElement?.type === "freegrid" || lastElement?.children[0]?.type === "freegrid";
|
171
|
+
const isFreeGrid = lastElement?.type === "freegrid" || lastElement?.children?.[0]?.type === "freegrid";
|
172
172
|
if (isFreeGrid) {
|
173
173
|
return;
|
174
174
|
}
|
175
|
-
const isLastElementEmpty = lastElement.type === "paragraph" && !lastElement.children[0]?.text && !lastElement.children?.some(c => BLOCKS.includes(c.type));
|
175
|
+
const isLastElementEmpty = lastElement && lastElement.type === "paragraph" && !lastElement.children[0]?.text && !lastElement.children?.some(c => BLOCKS.includes(c.type));
|
176
176
|
if (!ReactEditor.isFocused(editor)) {
|
177
177
|
if (isLastElementEmpty) {
|
178
178
|
if (hasPath) {
|