@flozy/editor 5.4.8 → 5.5.0

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 (46) hide show
  1. package/dist/Editor/CommonEditor.js +3 -7
  2. package/dist/Editor/Editor.css +16 -18
  3. package/dist/Editor/Elements/Button/EditorButton.js +1 -3
  4. package/dist/Editor/Elements/Color Picker/Styles.js +1 -0
  5. package/dist/Editor/Elements/DataView/Layouts/FilterSort/styles.js +1 -1
  6. package/dist/Editor/Elements/DataView/Layouts/Options/EditOption.js +5 -1
  7. package/dist/Editor/Elements/DataView/Layouts/Options/FilterProperty.js +1 -0
  8. package/dist/Editor/Elements/DataView/Layouts/Options/index.js +1 -1
  9. package/dist/Editor/Elements/DataView/Layouts/TableStyles.js +3 -3
  10. package/dist/Editor/Elements/DataView/Utils/multiSortRows.js +19 -5
  11. package/dist/Editor/Elements/Form/Form.js +0 -1
  12. package/dist/Editor/Elements/Form/Workflow/Styles.js +2 -0
  13. package/dist/Editor/Elements/FreeGrid/FreeGridBox.js +4 -2
  14. package/dist/Editor/Elements/FreeGrid/styles.js +0 -1
  15. package/dist/Editor/Elements/List/CheckList.js +1 -2
  16. package/dist/Editor/Elements/Search/SearchAttachment.js +0 -1
  17. package/dist/Editor/Elements/SimpleText/index.js +3 -11
  18. package/dist/Editor/Elements/SimpleText/style.js +1 -5
  19. package/dist/Editor/MiniEditor.js +6 -1
  20. package/dist/Editor/Toolbar/Mini/MiniToolbar.js +2 -5
  21. package/dist/Editor/Toolbar/Mini/Styles.js +0 -5
  22. package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +1 -10
  23. package/dist/Editor/Toolbar/PopupTool/TextFormat.js +0 -45
  24. package/dist/Editor/common/FontLoader/FontLoader.js +4 -4
  25. package/dist/Editor/common/MentionsPopup/Styles.js +0 -1
  26. package/dist/Editor/common/RnD/ElementSettings/Settings/FormSettings.js +0 -1
  27. package/dist/Editor/common/RnD/SwitchViewport/SwitchViewport.js +2 -14
  28. package/dist/Editor/common/RnD/Utils/gridDropItem.js +6 -9
  29. package/dist/Editor/common/StyleBuilder/fieldTypes/backgroundImage.js +0 -5
  30. package/dist/Editor/common/StyleBuilder/fieldTypes/card.js +2 -10
  31. package/dist/Editor/common/StyleBuilder/fieldTypes/index.js +1 -3
  32. package/dist/Editor/common/StyleBuilder/pageSettingsStyle.js +0 -4
  33. package/dist/Editor/common/Uploader.js +0 -8
  34. package/dist/Editor/commonStyle.js +8 -8
  35. package/dist/Editor/helper/deserialize/index.js +24 -66
  36. package/dist/Editor/helper/index.js +2 -2
  37. package/dist/Editor/helper/theme.js +1 -24
  38. package/dist/Editor/hooks/useMouseMove.js +2 -5
  39. package/dist/Editor/plugins/withHTML.js +5 -42
  40. package/dist/Editor/utils/SlateUtilityFunctions.js +1 -8
  41. package/dist/Editor/utils/button.js +4 -4
  42. package/dist/Editor/utils/chatEditor/SlateUtilityFunctions.js +7 -51
  43. package/dist/Editor/utils/helper.js +16 -19
  44. package/dist/Editor/utils/pageSettings.js +2 -14
  45. package/package.json +1 -1
  46. package/dist/Editor/common/StyleBuilder/fieldTypes/lineSpacing.js +0 -79
@@ -624,10 +624,6 @@ export const isPageSettings = (event, editor) => {
624
624
  return isPageSettingsNode;
625
625
  }
626
626
  };
627
- export function capitalizeFirstLetter(str) {
628
- if (!str) return str;
629
- return str.charAt(0).toUpperCase() + str.slice(1);
630
- }
631
627
  export const insertLineBreakAtEndOfPath = (editor, path) => {
632
628
  try {
633
629
  const [node, nodePath] = Editor.node(editor, path); // Get the node at the specified path
@@ -646,13 +642,6 @@ export const insertLineBreakAtEndOfPath = (editor, path) => {
646
642
  console.log(err);
647
643
  }
648
644
  };
649
- export function isHavingSelection(editor) {
650
- try {
651
- return editor?.selection && !Range.isCollapsed(editor.selection);
652
- } catch (err) {
653
- console.log(err);
654
- }
655
- }
656
645
  const omitNodes = ["site-settings", "page-settings"];
657
646
  export function getInitialValue(value = [], readOnly) {
658
647
  if (readOnly === "readonly" && value?.length) {
@@ -681,17 +670,20 @@ export function getInitialValue(value = [], readOnly) {
681
670
  }
682
671
  return value;
683
672
  }
673
+ export function capitalizeFirstLetter(str) {
674
+ if (!str) return str;
675
+ return str.charAt(0).toUpperCase() + str.slice(1);
676
+ }
677
+ export function isHavingSelection(editor) {
678
+ try {
679
+ return editor?.selection && !Range.isCollapsed(editor.selection);
680
+ } catch (err) {
681
+ console.log(err);
682
+ }
683
+ }
684
684
  export function getSelectedCls(defaultCls = "", selected, selectedClsName = "selected") {
685
685
  return `${defaultCls} ${selected ? selectedClsName : ""}`;
686
686
  }
687
- export function handleNegativeInteger(val) {
688
- return val < 0 ? 0 : val;
689
- }
690
- export const containsSurrogatePair = text => {
691
- // Match surrogate pairs (high and low surrogate)
692
- const surrogatePairRegex = /[\uD800-\uDBFF][\uDC00-\uDFFF]/;
693
- return surrogatePairRegex.test(text);
694
- };
695
687
  export const getNodeWithType = (editor, nodeType = "", otherOptions) => {
696
688
  try {
697
689
  const options = {
@@ -705,6 +697,11 @@ export const getNodeWithType = (editor, nodeType = "", otherOptions) => {
705
697
  return [];
706
698
  }
707
699
  };
700
+ export const containsSurrogatePair = text => {
701
+ // Match surrogate pairs (high and low surrogate)
702
+ const surrogatePairRegex = /[\uD800-\uDBFF][\uDC00-\uDFFF]/;
703
+ return surrogatePairRegex.test(text);
704
+ };
708
705
  export const getSlateDom = (editor, range) => {
709
706
  try {
710
707
  const slateDom = ReactEditor.toDOMRange(editor, range);
@@ -9,13 +9,7 @@ export const findPageSettings = editor => {
9
9
  path: null,
10
10
  element: {
11
11
  pageProps: {
12
- pageWidth: "fixed",
13
- "lineHeight": {
14
- "xs": 1.43,
15
- "sm": 1.43,
16
- "md": 1.43,
17
- "lg": 1.43
18
- }
12
+ pageWidth: "fixed"
19
13
  }
20
14
  }
21
15
  };
@@ -40,13 +34,7 @@ export const getPageSettings = editor => {
40
34
  path: null,
41
35
  element: {
42
36
  pageProps: {
43
- pageWidth: "fixed",
44
- "lineHeight": {
45
- "xs": 1.43,
46
- "sm": 1.43,
47
- "md": 1.43,
48
- "lg": 1.43
49
- }
37
+ pageWidth: "fixed"
50
38
  }
51
39
  }
52
40
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flozy/editor",
3
- "version": "5.4.8",
3
+ "version": "5.5.0",
4
4
  "description": "An Editor for flozy app brain",
5
5
  "files": [
6
6
  "dist"
@@ -1,79 +0,0 @@
1
- import React, { useState } from "react";
2
- import { Grid, Slider, Typography, Box } from "@mui/material";
3
- import { getBreakPointsValue } from "../../../helper/theme";
4
- import useWindowResize from "../../../hooks/useWindowResize";
5
- import { useEditorContext } from "../../../hooks/useMouseMove";
6
- import { jsx as _jsx } from "react/jsx-runtime";
7
- import { jsxs as _jsxs } from "react/jsx-runtime";
8
- const LineSpacing = props => {
9
- const {
10
- value: val,
11
- data,
12
- onChange
13
- } = props;
14
- const {
15
- theme
16
- } = useEditorContext();
17
- const {
18
- key
19
- } = data;
20
- const [size] = useWindowResize();
21
- const pro_value = getBreakPointsValue(val, size?.device);
22
- const [value, setValue] = useState(pro_value);
23
- let breakpointValue = getBreakPointsValue(val, null);
24
- breakpointValue = typeof breakpointValue['lg'] === 'object' ? breakpointValue['lg'] : breakpointValue;
25
- useState(() => {
26
- setValue(pro_value);
27
- }, [pro_value]);
28
- const handleChange = e => {
29
- onChange({
30
- [key]: {
31
- ...breakpointValue,
32
- [size?.device]: e.target.value
33
- }
34
- });
35
- };
36
- return /*#__PURE__*/_jsxs(Grid, {
37
- item: true,
38
- xs: 12,
39
- children: [/*#__PURE__*/_jsx(Typography, {
40
- variant: "body1",
41
- color: "primary",
42
- style: {
43
- fontSize: "14px",
44
- fontWeight: 500
45
- },
46
- children: data?.label
47
- }), /*#__PURE__*/_jsxs(Grid, {
48
- container: true,
49
- wrap: "nowrap",
50
- className: "sld-wrpr",
51
- children: [/*#__PURE__*/_jsx(Slider, {
52
- className: "spacingSlider",
53
- defaultValue: value || 1.43,
54
- "aria-label": "Default",
55
- valueLabelDisplay: "auto",
56
- min: 0.5,
57
- max: 3.0,
58
- step: 0.1,
59
- name: "lineHeight",
60
- onChange: handleChange
61
- }), /*#__PURE__*/_jsx(Box, {
62
- component: "input",
63
- sx: {
64
- background: theme?.palette?.editor?.background,
65
- color: theme?.palette?.editor?.textColor
66
- },
67
- name: "lineHeight",
68
- value: pro_value,
69
- className: "sliderInput",
70
- onChange: handleChange,
71
- type: "number",
72
- placeholder: "0",
73
- disabled: true,
74
- defaultValue: pro_value || 1.43
75
- })]
76
- })]
77
- });
78
- };
79
- export default LineSpacing;