@flozy/editor 10.2.2 → 10.2.4

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.
@@ -611,7 +611,12 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
611
611
  openTheme: openTheme,
612
612
  setOpenTheme: setOpenTheme,
613
613
  triggerRender: triggerRender,
614
- children: [showThemeButtons ? /*#__PURE__*/_jsxs("div", {
614
+ children: [/*#__PURE__*/_jsx(FontLoader, {
615
+ otherProps: {
616
+ services: otherProps?.services
617
+ },
618
+ readOnly: readOnly
619
+ }), showThemeButtons ? /*#__PURE__*/_jsxs("div", {
615
620
  className: "theme-buttons",
616
621
  children: [/*#__PURE__*/_jsx(IconButton, {
617
622
  onClick: () => setOpenTheme(true),
@@ -630,7 +635,7 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
630
635
  fullScreen: fullScreen,
631
636
  footer: footer || "",
632
637
  selectedTheme: selectedTheme,
633
- children: /*#__PURE__*/_jsxs(Box, {
638
+ children: /*#__PURE__*/_jsx(Box, {
634
639
  component: "div",
635
640
  className: `et-wrpr stimulate-${breakpoint} ${editorClass || ""} ${isIframe ? "iframe-editor" : ""}`,
636
641
  sx: classes.root,
@@ -640,7 +645,7 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
640
645
  "data-breakpoint": breakpoint
641
646
  // onContextMenu={handleContextMenu}
642
647
  ,
643
- children: [/*#__PURE__*/_jsxs(Slate, {
648
+ children: /*#__PURE__*/_jsxs(Slate, {
644
649
  editor: editor,
645
650
  initialValue: getInitialValue(debouncedValue?.current, readOnly),
646
651
  onChange: handleEditorChange,
@@ -765,12 +770,7 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
765
770
  handleCodeToText: handleCodeToText,
766
771
  translation: translationFn
767
772
  })]
768
- }, id), /*#__PURE__*/_jsx(FontLoader, {
769
- otherProps: {
770
- services: otherProps?.services
771
- },
772
- readOnly: readOnly
773
- })]
773
+ }, id)
774
774
  })
775
775
  }), /*#__PURE__*/_jsx(CustomDialogComponent, {
776
776
  ref: dialogRef,
@@ -358,6 +358,14 @@ const useFreeGridStyles = ({
358
358
  margin: "0px"
359
359
  }
360
360
  },
361
+ "& .fgi_type_table": {
362
+ "& .edt-headings": {
363
+ margin: "0px"
364
+ },
365
+ "& .edt-paragraphs": {
366
+ margin: "0px"
367
+ }
368
+ },
361
369
  /** element toolbar hide */
362
370
  "& .element-toolbar": {
363
371
  display: "none"
@@ -1,11 +1,11 @@
1
- import { useEffect, useState } from "react";
1
+ import { useEffect } from "react";
2
2
  import WebFont from "webfontloader";
3
3
  import { useEditorContext } from "../../hooks/useMouseMove";
4
4
  import { googleFontList } from "./FontList";
5
- import CircularProgress from "@mui/material/CircularProgress";
6
- import Box from "@mui/material/Box";
7
- import { jsx as _jsx } from "react/jsx-runtime";
5
+ // import CircularProgress from "@mui/material/CircularProgress";
6
+ // import Box from "@mui/material/Box";
8
7
  import { Fragment as _Fragment } from "react/jsx-runtime";
8
+ import { jsx as _jsx } from "react/jsx-runtime";
9
9
  const FontLoader = props => {
10
10
  const {
11
11
  otherProps,
@@ -14,7 +14,8 @@ const FontLoader = props => {
14
14
  const {
15
15
  setFontFamilies
16
16
  } = useEditorContext();
17
- const [loading, setLoading] = useState(true);
17
+ // const [loading, setLoading] = useState(true);
18
+
18
19
  const loadFontsInBatches = (families, batchSize = 5, maxRetries = 3) => {
19
20
  let currentIndex = 0;
20
21
  let retryCount = 0;
@@ -24,7 +25,7 @@ const FontLoader = props => {
24
25
  try {
25
26
  if (currentIndex >= families?.length) {
26
27
  // console.log("All fonts have been loaded");
27
- setLoading(false);
28
+ // setLoading(false);
28
29
  return;
29
30
  }
30
31
  const batch = families?.slice(currentIndex, currentIndex + batchSize);
@@ -59,7 +60,7 @@ const FontLoader = props => {
59
60
  }
60
61
  });
61
62
  } catch (err) {
62
- setLoading(false);
63
+ // setLoading(false);
63
64
  }
64
65
  };
65
66
  loadNextBatch();
@@ -78,7 +79,7 @@ const FontLoader = props => {
78
79
  loadFontsInBatches(families);
79
80
  }).catch(err => {
80
81
  // console.log(err);
81
- setLoading(false);
82
+ // setLoading(false);
82
83
  });
83
84
  // setLoading(true);
84
85
  } else {
@@ -106,26 +107,12 @@ const FontLoader = props => {
106
107
  }
107
108
 
108
109
  // Set timeout to hide loader after 5 seconds
109
- const timeoutId = setTimeout(() => {
110
- setLoading(false);
111
- }, 5000);
112
- return () => clearTimeout(timeoutId);
110
+ // const timeoutId = setTimeout(() => {
111
+ // setLoading(false);
112
+ // }, 5000);
113
+
114
+ // return () => clearTimeout(timeoutId);
113
115
  }, []);
114
- return /*#__PURE__*/_jsx(_Fragment, {
115
- children: loading ? /*#__PURE__*/_jsx(Box, {
116
- sx: {
117
- position: "absolute",
118
- top: 0,
119
- left: 0,
120
- right: 0,
121
- bottom: 0,
122
- zIndex: 99999,
123
- display: "flex",
124
- justifyContent: "center",
125
- alignItems: "center"
126
- },
127
- children: /*#__PURE__*/_jsx(CircularProgress, {})
128
- }) : null
129
- });
116
+ return /*#__PURE__*/_jsx(_Fragment, {});
130
117
  };
131
118
  export default FontLoader;
@@ -70,6 +70,14 @@ const ThemeSettings = props => {
70
70
  type: themeType,
71
71
  template_tag
72
72
  });
73
+ const currentSelectedTheme = result?.data?.find(d => d.id === id);
74
+ const currThemeName = currentSelectedTheme?.name;
75
+ if (currThemeName && currThemeName !== name) {
76
+ // for theme templates created by design team
77
+ updateTheme({
78
+ name: currThemeName
79
+ });
80
+ }
73
81
  setThemes(result?.data || []);
74
82
  } catch (err) {
75
83
  console.log(err);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flozy/editor",
3
- "version": "10.2.2",
3
+ "version": "10.2.4",
4
4
  "description": "An Editor for flozy app brain",
5
5
  "files": [
6
6
  "dist"