@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.
Files changed (166) hide show
  1. package/dist/Editor/ChatEditor.js +14 -7
  2. package/dist/Editor/CommonEditor.js +27 -12
  3. package/dist/Editor/Elements/AI/AIInput.js +5 -3
  4. package/dist/Editor/Elements/AI/CustomSelect.js +9 -5
  5. package/dist/Editor/Elements/AI/PopoverAIInput.js +4 -2
  6. package/dist/Editor/Elements/Accordion/Accordion.js +4 -3
  7. package/dist/Editor/Elements/Accordion/AccordionBtnPopup.js +4 -1
  8. package/dist/Editor/Elements/Accordion/AccordionButton.js +6 -2
  9. package/dist/Editor/Elements/Accordion/AccordionTitlePopup.js +4 -1
  10. package/dist/Editor/Elements/AppHeader/AppHeaderButton.js +6 -2
  11. package/dist/Editor/Elements/AppHeader/AppHeaderPopup.js +4 -1
  12. package/dist/Editor/Elements/Attachments/AttachmentsButton.js +4 -1
  13. package/dist/Editor/Elements/Button/ButtonPopup.js +4 -1
  14. package/dist/Editor/Elements/Button/ButtonToolIcon.js +6 -2
  15. package/dist/Editor/Elements/Button/EditorButton.js +6 -5
  16. package/dist/Editor/Elements/Carousel/Carousel.js +5 -4
  17. package/dist/Editor/Elements/Carousel/CarouselButton.js +6 -2
  18. package/dist/Editor/Elements/Carousel/CarouselItem.js +3 -2
  19. package/dist/Editor/Elements/ChipText/ChipTextPopup.js +4 -1
  20. package/dist/Editor/Elements/CodeToText/CodeToText.js +5 -4
  21. package/dist/Editor/Elements/CodeToText/HtmlContextMenu.js +6 -2
  22. package/dist/Editor/Elements/Colorbox/ColorboxButton.js +6 -2
  23. package/dist/Editor/Elements/DataView/DataView.js +5 -2
  24. package/dist/Editor/Elements/DataView/DataViewButton.js +6 -2
  25. package/dist/Editor/Elements/DataView/Layouts/FilterSort/SortOptions/ChooseSort.js +13 -12
  26. package/dist/Editor/Elements/DataView/Layouts/FilterSort/SortOptions/index.js +7 -4
  27. package/dist/Editor/Elements/DataView/Layouts/FilterSort/index.js +7 -5
  28. package/dist/Editor/Elements/DataView/Layouts/FilterView.js +9 -7
  29. package/dist/Editor/Elements/DataView/Layouts/Options/AddOptions.js +3 -2
  30. package/dist/Editor/Elements/DataView/Layouts/Options/AddProperty.js +5 -3
  31. package/dist/Editor/Elements/DataView/Layouts/Options/AllProperties.js +6 -5
  32. package/dist/Editor/Elements/DataView/Layouts/Options/ChangeProperty.js +5 -3
  33. package/dist/Editor/Elements/DataView/Layouts/Options/EditOption.js +7 -6
  34. package/dist/Editor/Elements/DataView/Layouts/Options/EditProperty.js +15 -12
  35. package/dist/Editor/Elements/DataView/Layouts/Options/FilterProperty.js +3 -2
  36. package/dist/Editor/Elements/DataView/Layouts/Options/PropertyList.js +3 -2
  37. package/dist/Editor/Elements/DataView/Layouts/Options/index.js +12 -6
  38. package/dist/Editor/Elements/DataView/Layouts/TableView.js +6 -4
  39. package/dist/Editor/Elements/DataView/Layouts/index.js +3 -1
  40. package/dist/Editor/Elements/DataView/Providers/DataViewProvider.js +5 -2
  41. package/dist/Editor/Elements/Divider/Divider.js +5 -3
  42. package/dist/Editor/Elements/Divider/DividerButton.js +6 -2
  43. package/dist/Editor/Elements/Divider/DividerPopup.js +3 -2
  44. package/dist/Editor/Elements/Embed/Embed.js +4 -1
  45. package/dist/Editor/Elements/Embed/EmbedPopup.js +4 -1
  46. package/dist/Editor/Elements/Embed/Image.js +14 -9
  47. package/dist/Editor/Elements/Embed/Video.js +10 -7
  48. package/dist/Editor/Elements/EmbedScript/Code.js +7 -4
  49. package/dist/Editor/Elements/EmbedScript/EmbedScript.js +6 -2
  50. package/dist/Editor/Elements/EmbedScript/EmbedScriptPopup.js +8 -5
  51. package/dist/Editor/Elements/Emoji/EmojiButton.js +6 -2
  52. package/dist/Editor/Elements/Form/FieldPopup.js +4 -1
  53. package/dist/Editor/Elements/Form/Form.js +12 -9
  54. package/dist/Editor/Elements/Form/FormButton.js +6 -2
  55. package/dist/Editor/Elements/Form/FormPopup.js +3 -2
  56. package/dist/Editor/Elements/Form/Workflow/FormWorkflow.js +18 -12
  57. package/dist/Editor/Elements/Form/Workflow/ListWorkflow.js +13 -8
  58. package/dist/Editor/Elements/Form/Workflow/MoreOptions.js +3 -2
  59. package/dist/Editor/Elements/Form/Workflow/UserInputs.js +4 -2
  60. package/dist/Editor/Elements/Form/Workflow/index.js +15 -9
  61. package/dist/Editor/Elements/FreeGrid/FreeGrid.js +21 -4
  62. package/dist/Editor/Elements/FreeGrid/FreeGridBox.js +6 -2
  63. package/dist/Editor/Elements/FreeGrid/FreeGridButton.js +6 -2
  64. package/dist/Editor/Elements/FreeGrid/FreeGridItem.js +8 -3
  65. package/dist/Editor/Elements/FreeGrid/Options/AddElement.js +3 -2
  66. package/dist/Editor/Elements/FreeGrid/Options/More.js +4 -3
  67. package/dist/Editor/Elements/Grid/Grid.js +13 -10
  68. package/dist/Editor/Elements/Grid/GridButton.js +9 -5
  69. package/dist/Editor/Elements/Grid/GridItem.js +13 -7
  70. package/dist/Editor/Elements/Grid/GridItemPopup.js +4 -1
  71. package/dist/Editor/Elements/Grid/GridPopup.js +4 -1
  72. package/dist/Editor/Elements/Grid/SectionPopup.js +4 -1
  73. package/dist/Editor/Elements/Link/Link.js +8 -5
  74. package/dist/Editor/Elements/Link/LinkButton.js +4 -1
  75. package/dist/Editor/Elements/List/CheckList.js +14 -9
  76. package/dist/Editor/Elements/NewLine/NewLineButton.js +6 -2
  77. package/dist/Editor/Elements/PageSettings/PageSettingsButton.js +4 -1
  78. package/dist/Editor/Elements/PageSettings/PageSettingsPopup.js +4 -1
  79. package/dist/Editor/Elements/Search/SearchButton.js +6 -3
  80. package/dist/Editor/Elements/Search/SearchList.js +7 -3
  81. package/dist/Editor/Elements/Signature/SignatureButton.js +6 -2
  82. package/dist/Editor/Elements/Signature/SignatureOptions/TypeSignature.js +6 -2
  83. package/dist/Editor/Elements/Signature/SignatureOptions/UploadSignature.js +4 -1
  84. package/dist/Editor/Elements/Signature/SignaturePopup.js +17 -16
  85. package/dist/Editor/Elements/SimpleText/index.js +5 -4
  86. package/dist/Editor/Elements/Table/DragButton.js +4 -2
  87. package/dist/Editor/Elements/Table/Table.js +21 -9
  88. package/dist/Editor/Elements/Table/TablePopup.js +4 -1
  89. package/dist/Editor/Elements/Table/TableSelector.js +10 -6
  90. package/dist/Editor/Elements/Table/TableTool.js +8 -4
  91. package/dist/Editor/Elements/TopBanner/TopBannerButton.js +4 -1
  92. package/dist/Editor/MiniEditor.js +9 -3
  93. package/dist/Editor/Toolbar/Basic/index.js +2 -1
  94. package/dist/Editor/Toolbar/FormatTools/BlockButton.js +6 -2
  95. package/dist/Editor/Toolbar/FormatTools/MarkButton.js +6 -2
  96. package/dist/Editor/Toolbar/Mini/MiniToolbar.js +17 -5
  97. package/dist/Editor/Toolbar/PopupTool/AddTemplates.js +10 -5
  98. package/dist/Editor/Toolbar/PopupTool/ButtonTemplatesCard.js +10 -4
  99. package/dist/Editor/Toolbar/PopupTool/FullViewCard.js +10 -4
  100. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/MiniColorPicker.js +6 -2
  101. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectAlignment.js +42 -35
  102. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectList.js +58 -51
  103. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectSuperSubscript.js +29 -22
  104. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectTypography.js +87 -73
  105. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/index.js +14 -7
  106. package/dist/Editor/Toolbar/PopupTool/PopperHeader.js +8 -4
  107. package/dist/Editor/Toolbar/PopupTool/TemplateCard.js +11 -5
  108. package/dist/Editor/Toolbar/PopupTool/TextFormat.js +29 -21
  109. package/dist/Editor/Toolbar/PopupTool/index.js +17 -1
  110. package/dist/Editor/Toolbar/Toolbar.js +20 -10
  111. package/dist/Editor/common/CustomDialog/index.js +8 -10
  112. package/dist/Editor/common/ImageSelector/ImageSelector.js +10 -8
  113. package/dist/Editor/common/ImageSelector/Options/AddLink.js +6 -4
  114. package/dist/Editor/common/LinkSettings/NavComponents.js +14 -10
  115. package/dist/Editor/common/LinkSettings/index.js +20 -14
  116. package/dist/Editor/common/LinkSettings/navOptions.js +1 -1
  117. package/dist/Editor/common/MentionsPopup/index.js +6 -2
  118. package/dist/Editor/common/RnD/ContextMenu/CMenus.js +22 -22
  119. package/dist/Editor/common/RnD/ContextMenu/index.js +3 -2
  120. package/dist/Editor/common/RnD/ElementOptions/index.js +7 -2
  121. package/dist/Editor/common/RnD/ElementSettings/OtherSettings/SaveAsTemplate.js +8 -3
  122. package/dist/Editor/common/RnD/ElementSettings/OtherSettings/Settings.js +5 -2
  123. package/dist/Editor/common/RnD/ElementSettings/Settings/FormSettings.js +3 -2
  124. package/dist/Editor/common/RnD/ElementSettings/Settings/TextSettings.js +4 -2
  125. package/dist/Editor/common/RnD/OptionsPopup/index.js +4 -3
  126. package/dist/Editor/common/RnD/SwitchViewport/SwitchViewport.js +4 -3
  127. package/dist/Editor/common/RnD/index.js +11 -4
  128. package/dist/Editor/common/Section/index.js +7 -4
  129. package/dist/Editor/common/Shorthands/elements.js +18 -3
  130. package/dist/Editor/common/StyleBuilder/appHeaderStyle.js +4 -4
  131. package/dist/Editor/common/StyleBuilder/boxStyle.js +2 -2
  132. package/dist/Editor/common/StyleBuilder/buttonStyle.js +2 -2
  133. package/dist/Editor/common/StyleBuilder/dividerStyles.js +2 -2
  134. package/dist/Editor/common/StyleBuilder/embedVideoStyle.js +6 -6
  135. package/dist/Editor/common/StyleBuilder/fieldStyle.js +2 -2
  136. package/dist/Editor/common/StyleBuilder/fieldTypes/alignment.js +13 -9
  137. package/dist/Editor/common/StyleBuilder/fieldTypes/backgroundImage.js +6 -3
  138. package/dist/Editor/common/StyleBuilder/fieldTypes/bannerSpacing.js +7 -3
  139. package/dist/Editor/common/StyleBuilder/fieldTypes/borderRadius.js +7 -3
  140. package/dist/Editor/common/StyleBuilder/fieldTypes/buttonLink.js +6 -3
  141. package/dist/Editor/common/StyleBuilder/fieldTypes/card.js +11 -5
  142. package/dist/Editor/common/StyleBuilder/fieldTypes/color.js +9 -5
  143. package/dist/Editor/common/StyleBuilder/fieldTypes/elementSize.js +10 -6
  144. package/dist/Editor/common/StyleBuilder/fieldTypes/fontSize.js +6 -2
  145. package/dist/Editor/common/StyleBuilder/fieldTypes/gridSize.js +6 -2
  146. package/dist/Editor/common/StyleBuilder/fieldTypes/icons.js +5 -2
  147. package/dist/Editor/common/StyleBuilder/fieldTypes/menusArray.js +9 -6
  148. package/dist/Editor/common/StyleBuilder/fieldTypes/metaDataMapping.js +8 -2
  149. package/dist/Editor/common/StyleBuilder/fieldTypes/saveAsTemplate.js +12 -11
  150. package/dist/Editor/common/StyleBuilder/fieldTypes/selectBox.js +6 -2
  151. package/dist/Editor/common/StyleBuilder/fieldTypes/text.js +8 -4
  152. package/dist/Editor/common/StyleBuilder/fieldTypes/textAlign.js +6 -2
  153. package/dist/Editor/common/StyleBuilder/fieldTypes/textOptions.js +6 -5
  154. package/dist/Editor/common/StyleBuilder/formStyle.js +7 -7
  155. package/dist/Editor/common/StyleBuilder/gridItemStyle.js +6 -6
  156. package/dist/Editor/common/StyleBuilder/gridStyle.js +5 -5
  157. package/dist/Editor/common/StyleBuilder/index.js +8 -5
  158. package/dist/Editor/common/Uploader.js +8 -5
  159. package/dist/Editor/helper/index.js +27 -3
  160. package/dist/Editor/plugins/withLayout.js +3 -2
  161. package/dist/Editor/plugins/withLinks.js +10 -0
  162. package/dist/Editor/utils/SlateUtilityFunctions.js +15 -9
  163. package/dist/Editor/utils/brains.js +1 -2
  164. package/dist/Editor/utils/freegrid.js +1 -1
  165. package/dist/Editor/utils/helper.js +2 -2
  166. 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
- ...textStyles,
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
- console.log('W1', Node.string(currentNode));
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)
@@ -166,5 +166,5 @@ export const insertFreeGrid = (editor, path, extProps) => {
166
166
  at: newPath
167
167
  });
168
168
  scrollToNewSection(editor, newPath, extProps);
169
- insertNewLine(editor);
169
+ // insertNewLine(editor);
170
170
  };
@@ -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) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flozy/editor",
3
- "version": "9.8.3",
3
+ "version": "9.8.5",
4
4
  "description": "An Editor for flozy app brain",
5
5
  "files": [
6
6
  "dist"