@flozy/editor 6.0.3 → 6.0.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 (129) hide show
  1. package/dist/Editor/ChatEditor.js +7 -7
  2. package/dist/Editor/CommonEditor.js +25 -81
  3. package/dist/Editor/DialogWrapper.js +25 -31
  4. package/dist/Editor/Editor.css +16 -22
  5. package/dist/Editor/Elements/AI/PopoverAIInput.js +12 -2
  6. package/dist/Editor/Elements/AppHeader/AppHeader.js +3 -3
  7. package/dist/Editor/Elements/Button/EditorButton.js +9 -26
  8. package/dist/Editor/Elements/Color Picker/ColorButtons.js +12 -57
  9. package/dist/Editor/Elements/Color Picker/ColorPicker.css +1 -25
  10. package/dist/Editor/Elements/Color Picker/ColorPicker.js +4 -4
  11. package/dist/Editor/Elements/Color Picker/Styles.js +1 -1
  12. package/dist/Editor/Elements/DataView/DataView.js +3 -4
  13. package/dist/Editor/Elements/DataView/Layouts/DataTypes/NumberType.js +1 -5
  14. package/dist/Editor/Elements/DataView/Layouts/DataTypes/TextType.js +1 -5
  15. package/dist/Editor/Elements/DataView/Layouts/FilterView.js +19 -23
  16. package/dist/Editor/Elements/DataView/Providers/DataViewProvider.js +1 -1
  17. package/dist/Editor/Elements/Embed/Image.js +2 -2
  18. package/dist/Editor/Elements/Form/Form.js +0 -1
  19. package/dist/Editor/Elements/FreeGrid/FreeGrid.js +14 -0
  20. package/dist/Editor/Elements/FreeGrid/styles.js +0 -4
  21. package/dist/Editor/Elements/Grid/GridItem.js +3 -2
  22. package/dist/Editor/Elements/Link/Link.js +43 -70
  23. package/dist/Editor/Elements/List/CheckList.js +1 -2
  24. package/dist/Editor/Elements/Search/SearchAttachment.js +0 -1
  25. package/dist/Editor/Elements/Search/SearchList.js +1 -8
  26. package/dist/Editor/Elements/SimpleText/index.js +1 -8
  27. package/dist/Editor/Elements/SimpleText/style.js +1 -5
  28. package/dist/Editor/Elements/Table/Table.js +3 -3
  29. package/dist/Editor/Elements/Table/TableCell.js +9 -14
  30. package/dist/Editor/Elements/Title/title.js +1 -13
  31. package/dist/Editor/Elements/Variables/Style.js +2 -28
  32. package/dist/Editor/Elements/Variables/VariableButton.js +4 -17
  33. package/dist/Editor/MiniEditor.js +2 -4
  34. package/dist/Editor/Toolbar/FormatTools/Dropdown.js +3 -27
  35. package/dist/Editor/Toolbar/FormatTools/FontFamilyAutocomplete.js +3 -4
  36. package/dist/Editor/Toolbar/FormatTools/MarkButton.js +2 -2
  37. package/dist/Editor/Toolbar/FormatTools/TextSize.js +15 -7
  38. package/dist/Editor/Toolbar/PopupTool/AddTemplates.js +36 -46
  39. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectAlignment.js +1 -3
  40. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectFontSize.js +13 -6
  41. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectList.js +1 -3
  42. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectTypography.js +91 -211
  43. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/index.js +4 -11
  44. package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +12 -16
  45. package/dist/Editor/Toolbar/PopupTool/TemplateCard.js +1 -1
  46. package/dist/Editor/Toolbar/PopupTool/TextFormat.js +7 -99
  47. package/dist/Editor/Toolbar/PopupTool/index.js +0 -2
  48. package/dist/Editor/Toolbar/toolbarGroups.js +6 -48
  49. package/dist/Editor/common/ColorPickerButton.js +9 -32
  50. package/dist/Editor/common/DnD/DragHandleButton.js +1 -1
  51. package/dist/Editor/common/DnD/Draggable.js +1 -0
  52. package/dist/Editor/common/FontLoader/FontList.js +9 -1
  53. package/dist/Editor/common/FontLoader/FontLoader.js +4 -6
  54. package/dist/Editor/common/Icon.js +0 -28
  55. package/dist/Editor/common/ImageSelector/Styles.js +9 -3
  56. package/dist/Editor/common/MentionsPopup/Styles.js +9 -3
  57. package/dist/Editor/common/RnD/ElementSettings/OtherSettings/Settings.js +1 -2
  58. package/dist/Editor/common/RnD/ElementSettings/Settings/AppHeaderSettings.js +2 -3
  59. package/dist/Editor/common/RnD/ElementSettings/Settings/BoxSettings.js +2 -3
  60. package/dist/Editor/common/RnD/ElementSettings/Settings/ButtonSettings.js +2 -3
  61. package/dist/Editor/common/RnD/ElementSettings/Settings/CodeSettings.js +2 -3
  62. package/dist/Editor/common/RnD/ElementSettings/Settings/FormSettings.js +2 -4
  63. package/dist/Editor/common/RnD/ElementSettings/Settings/ImageSettings.js +2 -3
  64. package/dist/Editor/common/RnD/ElementSettings/Settings/TableSettings.js +2 -3
  65. package/dist/Editor/common/RnD/ElementSettings/Settings/VideoSettings.js +2 -3
  66. package/dist/Editor/common/RnD/SwitchViewport/SwitchViewport.js +2 -14
  67. package/dist/Editor/common/RnD/Theme/ViewportStimulator.js +3 -6
  68. package/dist/Editor/common/RnD/Utils/gridDropItem.js +4 -5
  69. package/dist/Editor/common/RnD/Utils/index.js +0 -40
  70. package/dist/Editor/common/RnD/index.js +3 -23
  71. package/dist/Editor/common/Shorthands/elements.js +0 -54
  72. package/dist/Editor/common/StyleBuilder/buttonStyle.js +2 -4
  73. package/dist/Editor/common/StyleBuilder/fieldTypes/backgroundImage.js +0 -5
  74. package/dist/Editor/common/StyleBuilder/fieldTypes/bannerSpacing.js +2 -12
  75. package/dist/Editor/common/StyleBuilder/fieldTypes/borderRadius.js +7 -15
  76. package/dist/Editor/common/StyleBuilder/fieldTypes/card.js +2 -10
  77. package/dist/Editor/common/StyleBuilder/fieldTypes/color.js +11 -35
  78. package/dist/Editor/common/StyleBuilder/fieldTypes/fontSize.js +4 -13
  79. package/dist/Editor/common/StyleBuilder/fieldTypes/index.js +1 -3
  80. package/dist/Editor/common/StyleBuilder/fieldTypes/textOptions.js +7 -15
  81. package/dist/Editor/common/StyleBuilder/pageSettingsStyle.js +0 -4
  82. package/dist/Editor/common/Uploader.js +0 -8
  83. package/dist/Editor/commonStyle.js +63 -58
  84. package/dist/Editor/helper/deserialize/index.js +1 -1
  85. package/dist/Editor/helper/index.js +2 -2
  86. package/dist/Editor/helper/theme.js +3 -224
  87. package/dist/Editor/hooks/useMouseMove.js +5 -13
  88. package/dist/Editor/plugins/withEmbeds.js +1 -1
  89. package/dist/Editor/plugins/withHTML.js +2 -2
  90. package/dist/Editor/plugins/withLayout.js +1 -1
  91. package/dist/Editor/plugins/withTable.js +1 -1
  92. package/dist/Editor/theme/ThemeList.js +173 -50
  93. package/dist/Editor/utils/SlateUtilityFunctions.js +42 -161
  94. package/dist/Editor/utils/button.js +14 -0
  95. package/dist/Editor/utils/customHooks/useTableResize.js +1 -2
  96. package/dist/Editor/utils/draftToSlate.js +2 -3
  97. package/dist/Editor/utils/font.js +37 -40
  98. package/dist/Editor/utils/helper.js +19 -88
  99. package/dist/Editor/utils/link.js +1 -1
  100. package/dist/Editor/utils/pageSettings.js +2 -14
  101. package/dist/Editor/utils/table.js +0 -21
  102. package/package.json +2 -5
  103. package/dist/Editor/Toolbar/PopupTool/ThemeTextFormat.js +0 -438
  104. package/dist/Editor/assets/svg/ThemeIcons.js +0 -291
  105. package/dist/Editor/common/CustomColorPicker/index.js +0 -106
  106. package/dist/Editor/common/CustomColorPicker/style.js +0 -53
  107. package/dist/Editor/common/CustomDialog/index.js +0 -94
  108. package/dist/Editor/common/CustomDialog/style.js +0 -67
  109. package/dist/Editor/common/CustomSelect.js +0 -33
  110. package/dist/Editor/common/RnD/Theme/MainThemeProvider.js +0 -17
  111. package/dist/Editor/common/StyleBuilder/fieldTypes/lineSpacing.js +0 -79
  112. package/dist/Editor/helper/ensureWrappedVariables.js +0 -28
  113. package/dist/Editor/hooks/useEditorTheme.js +0 -153
  114. package/dist/Editor/theme/index.js +0 -144
  115. package/dist/Editor/themeSettings/ActiveTheme.js +0 -72
  116. package/dist/Editor/themeSettings/buttons/index.js +0 -283
  117. package/dist/Editor/themeSettings/buttons/style.js +0 -21
  118. package/dist/Editor/themeSettings/colorTheme/index.js +0 -292
  119. package/dist/Editor/themeSettings/colorTheme/style.js +0 -77
  120. package/dist/Editor/themeSettings/fonts/PreviewElement.js +0 -121
  121. package/dist/Editor/themeSettings/fonts/index.js +0 -220
  122. package/dist/Editor/themeSettings/fonts/style.js +0 -44
  123. package/dist/Editor/themeSettings/icons.js +0 -60
  124. package/dist/Editor/themeSettings/index.js +0 -320
  125. package/dist/Editor/themeSettings/style.js +0 -152
  126. package/dist/Editor/themeSettingsAI/icons.js +0 -96
  127. package/dist/Editor/themeSettingsAI/index.js +0 -356
  128. package/dist/Editor/themeSettingsAI/saveTheme.js +0 -197
  129. package/dist/Editor/themeSettingsAI/style.js +0 -250
@@ -1,6 +1,6 @@
1
- import React, { useCallback, useMemo, useRef, useState, useImperativeHandle, forwardRef } from "react";
2
- import { Editable, Slate, ReactEditor } from "slate-react";
3
- import { createEditor, Transforms, Editor } from "slate";
1
+ import React, { useCallback, useMemo, useRef, useState, useEffect, useImperativeHandle, forwardRef } from "react";
2
+ import { Editable, Slate, ReactEditor } from 'slate-react';
3
+ import { createEditor, Transforms, Editor } from 'slate';
4
4
  import withCommon from "./hooks/withCommon";
5
5
  import { getBlock, getMarked, serializeMentions } from "./utils/chatEditor/SlateUtilityFunctions";
6
6
  import MiniTextFormat from "./Toolbar/PopupTool/MiniTextFormat";
@@ -35,13 +35,13 @@ const ChatEditor = /*#__PURE__*/forwardRef((props, ref) => {
35
35
  const classes = usePopupStyle(theme);
36
36
  const convertedContent = draftToSlate({
37
37
  data: content && content?.length > 0 ? content : [{
38
- type: "paragraph",
38
+ type: 'paragraph',
39
39
  children: [{
40
- text: ""
40
+ text: ''
41
41
  }]
42
42
  }]
43
43
  });
44
- const [value] = useState(convertedContent);
44
+ const [value, setValue] = useState(convertedContent);
45
45
  const debouncedValue = useRef(value);
46
46
  const debounced = useDebouncedCallback(
47
47
  // function
@@ -216,7 +216,7 @@ const ChatEditor = /*#__PURE__*/forwardRef((props, ref) => {
216
216
  editor
217
217
  });
218
218
  } else if (event.key === "Enter" && !isMobile) {
219
- const isEmpty = debouncedValue?.current.length === 1 && debouncedValue?.current[0].type === "paragraph" && debouncedValue?.current[0].children.length === 1 && debouncedValue?.current[0].children[0].text === "";
219
+ const isEmpty = debouncedValue?.current.length === 1 && debouncedValue?.current[0].type === 'paragraph' && debouncedValue?.current[0].children.length === 1 && debouncedValue?.current[0].children[0].text === '';
220
220
  if (isEmpty) {
221
221
  event.preventDefault();
222
222
  return;
@@ -1,5 +1,5 @@
1
1
  /* eslint-disable no-unused-vars */
2
- import React, { useRef, useCallback, useEffect, useMemo, useState, forwardRef, useImperativeHandle, createContext } from "react";
2
+ import React, { useRef, useCallback, useEffect, useMemo, useState, forwardRef, useImperativeHandle } from "react";
3
3
  import PropTypes from "prop-types";
4
4
  import { createEditor, Range, Transforms } from "slate";
5
5
  import { Slate, Editable, ReactEditor } from "slate-react";
@@ -17,7 +17,7 @@ import { serializeToText } from "./utils/serializeToText";
17
17
  import { getPageSettings } from "./utils/pageSettings";
18
18
  import { getThumbnailImage, invertColor } from "./helper";
19
19
  import PopupTool from "./Toolbar/PopupTool";
20
- import { Box, Typography, useTheme, IconButton } from "@mui/material";
20
+ import { Box, Typography, useTheme } from "@mui/material";
21
21
  import Shorthands from "./common/Shorthands";
22
22
  import MiniToolbar from "./Toolbar/Mini/MiniToolbar";
23
23
  import { EditorProvider } from "./hooks/useMouseMove";
@@ -26,12 +26,9 @@ import editorStyles from "./Styles/EditorStyles";
26
26
  import DragAndDrop from "./common/DnD";
27
27
  import Section from "./common/Section";
28
28
  import decorators from "./utils/Decorators";
29
- import { getTRBLBreakPoints, getVariableValue, getBreakpointLineSpacing } from "./helper/theme";
29
+ import { getTRBLBreakPoints } from "./helper/theme";
30
30
  import { getInitialValue, handleInsertLastElement, isFreeGrid, isFreeGridFragment, isRestrictedNode, outsideEditorClickLabel } from "./utils/helper";
31
31
  import useWindowResize from "./hooks/useWindowResize";
32
- import { getTheme } from "./theme";
33
- import ThemeSettings from "./themeSettings";
34
- import ThemeSettingsAI from "./themeSettingsAI";
35
32
  import PopoverAIInput from "./Elements/AI/PopoverAIInput";
36
33
  import RnDCopy from "./common/RnD/RnDCopy";
37
34
  import SwitchViewport from "./common/RnD/SwitchViewport/SwitchViewport";
@@ -40,10 +37,8 @@ import "./font.css";
40
37
  import "./Editor.css";
41
38
  import "animate.css";
42
39
  import FontLoader from "./common/FontLoader/FontLoader";
43
- import { ThemeAIIcon, ThemePaintIcon } from "./assets/svg/ThemeIcons";
44
40
  import { jsx as _jsx } from "react/jsx-runtime";
45
41
  import { jsxs as _jsxs } from "react/jsx-runtime";
46
- export const ThemeContext = /*#__PURE__*/createContext(null);
47
42
  const Item = /*#__PURE__*/forwardRef(({
48
43
  children,
49
44
  ...props
@@ -80,10 +75,10 @@ const Leaf = /*#__PURE__*/React.memo(({
80
75
  });
81
76
  Leaf.displayName = "Leaf";
82
77
  const updateTopBanner = (content = [], setTopBanner) => {
83
- // setTopBanner(() => {
84
- // const firstNode = content ? content[0] : {};
85
- // return firstNode?.type === "topbanner" ? firstNode : null;
86
- // });
78
+ setTopBanner(() => {
79
+ const firstNode = content ? content[0] : {};
80
+ return firstNode?.type === "topbanner" ? firstNode : null;
81
+ });
87
82
  };
88
83
  const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
89
84
  const {
@@ -98,14 +93,12 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
98
93
  otherProps,
99
94
  isIframe,
100
95
  theme,
101
- showThemeButtons,
102
96
  showViewport = false
103
97
  } = props;
104
98
  const editorWrapper = useRef();
105
99
  const mentionsRef = useRef();
106
100
  const convertedContent = draftToSlate({
107
- data: content,
108
- needLayout: otherProps?.needLayout
101
+ data: content
109
102
  });
110
103
  const [value, setValue] = useState(convertedContent);
111
104
  const [isInteracted, setIsInteracted] = useState(false);
@@ -145,12 +138,10 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
145
138
  const {
146
139
  bannerSpacing,
147
140
  pageBgImage,
148
- pageColor = "",
141
+ pageColor,
149
142
  color: pageTextColor,
150
143
  pageWidth,
151
- maxWidth: pageMaxWidth,
152
- theme: selectedTheme,
153
- lineHeight
144
+ maxWidth: pageMaxWidth
154
145
  } = pageSt?.pageProps || {
155
146
  bannerSpacing: {
156
147
  left: 0,
@@ -161,16 +152,9 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
161
152
  };
162
153
  const classes = editorStyles({
163
154
  padHeight: !fullScreen ? otherProps?.padHeight : 20,
164
- placeHolderColor: invertColor(pageColor.startsWith("var") ? getVariableValue(pageColor) : pageColor || "#FFF"),
155
+ placeHolderColor: invertColor(pageColor || "#FFF"),
165
156
  theme
166
157
  });
167
- const [openTheme, setOpenTheme] = useState(false);
168
- const [openAITheme, setOpenAITheme] = useState(false);
169
- const [, setThemeUpdated] = useState(0);
170
- const triggerRender = () => {
171
- setThemeUpdated(prev => prev + 1); // Incrementing forces a re-render while updating theme
172
- };
173
-
174
158
  const isMobile = window.matchMedia("(max-width: 899px)")?.matches || false;
175
159
  useEffect(() => {
176
160
  setValue(draftToSlate({
@@ -184,11 +168,11 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
184
168
  const debounced = useDebouncedCallback(
185
169
  // function
186
170
  value => {
187
- debouncedValue.current = value;
188
171
  const {
189
172
  value: strVal,
190
173
  ...restVal
191
174
  } = getOnSaveData(value);
175
+ debouncedValue.current = value;
192
176
  onSave(strVal, restVal);
193
177
  },
194
178
  // delay in ms
@@ -199,7 +183,7 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
199
183
  return {
200
184
  value: JSON.stringify(val),
201
185
  text: text,
202
- title: serializeToText(title?.children) || ""
186
+ title: serializeToText(title?.children) || "Untitled"
203
187
  };
204
188
  };
205
189
  const getPreviewImage = async (needBackground = false, options = {}) => {
@@ -298,12 +282,6 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
298
282
  redo() {
299
283
  editor?.redo();
300
284
  },
301
- toggleTheme() {
302
- setOpenTheme(!openTheme);
303
- },
304
- toggleAITheme() {
305
- setOpenAITheme(!openAITheme);
306
- },
307
285
  getPageSettings: {
308
286
  background: pageBgImage && pageBgImage !== "none" ? `url(${pageBgImage})` : pageColor || ""
309
287
  }
@@ -354,7 +332,6 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
354
332
  onDrawerOpen: onDrawerOpen,
355
333
  ICON_API: "https://assets.agenciflow.com"
356
334
  };
357
- const lineH = getBreakpointLineSpacing(lineHeight, breakpoint);
358
335
  const renderElement = useCallback(props => {
359
336
  return /*#__PURE__*/_jsx(Element, {
360
337
  ...props,
@@ -479,7 +456,6 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
479
456
  }
480
457
  return style;
481
458
  }, [pageBgImage, pageColor]);
482
- const themeProps = getTheme(selectedTheme);
483
459
 
484
460
  // const handleContextMenu = (e) => {
485
461
  // if (!readOnly) {
@@ -509,38 +485,15 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
509
485
  console.log("handleCursorScroll", err);
510
486
  }
511
487
  };
512
- return /*#__PURE__*/_jsxs(EditorProvider, {
488
+ return /*#__PURE__*/_jsx(EditorProvider, {
513
489
  theme: theme,
514
490
  editor: editor,
515
- openTheme: openTheme,
516
- setOpenTheme: setOpenTheme,
517
- triggerRender: triggerRender,
518
- children: [showThemeButtons ? /*#__PURE__*/_jsxs("div", {
519
- style: {
520
- display: "flex",
521
- justifyContent: "end",
522
- alignItems: "center",
523
- gap: "8px",
524
- width: "70vw",
525
- margin: "auto"
526
- },
527
- children: [/*#__PURE__*/_jsx(IconButton, {
528
- onClick: () => setOpenTheme(true),
529
- children: /*#__PURE__*/_jsx(ThemePaintIcon, {})
530
- }), /*#__PURE__*/_jsx(IconButton, {
531
- onClick: () => setOpenAITheme(true),
532
- style: {
533
- marginTop: "4px"
534
- },
535
- children: /*#__PURE__*/_jsx(ThemeAIIcon, {})
536
- })]
537
- }) : null, /*#__PURE__*/_jsx(DialogWrapper, {
491
+ children: /*#__PURE__*/_jsx(DialogWrapper, {
538
492
  classes: classes,
539
493
  ...props,
540
494
  fullScreen: fullScreen,
541
495
  footer: footer || "",
542
- selectedTheme: selectedTheme,
543
- children: /*#__PURE__*/_jsx(Box, {
496
+ children: /*#__PURE__*/_jsxs(Box, {
544
497
  component: "div",
545
498
  className: `et-wrpr stimulate-${breakpoint} ${editorClass || ""} ${isIframe ? "iframe-editor" : ""}`,
546
499
  sx: classes.root,
@@ -550,7 +503,7 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
550
503
  "data-breakpoint": breakpoint
551
504
  // onContextMenu={handleContextMenu}
552
505
  ,
553
- children: /*#__PURE__*/_jsxs(Slate, {
506
+ children: [/*#__PURE__*/_jsxs(Slate, {
554
507
  editor: editor,
555
508
  initialValue: getInitialValue(debouncedValue?.current, readOnly),
556
509
  onChange: handleEditorChange,
@@ -569,7 +522,6 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
569
522
  children: /*#__PURE__*/_jsxs(Box, {
570
523
  component: "div",
571
524
  className: "max-content",
572
- sx: themeProps?.sxProps || {},
573
525
  "data-info": outsideEditorClickLabel,
574
526
  children: [renderTopBanner(), /*#__PURE__*/_jsx("div", {
575
527
  className: "scroll-area",
@@ -582,7 +534,6 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
582
534
  padding: {
583
535
  ...getTRBLBreakPoints(bannerSpacing)
584
536
  },
585
- lineHeight: lineH,
586
537
  width: !pageWidth || pageWidth === "fixed" ? fixedWidth : fullWidth,
587
538
  height: viewport.h ? `${viewport.h}px` : `100%`,
588
539
  alignSelf: "center",
@@ -636,15 +587,6 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
636
587
  "data-info": outsideEditorClickLabel,
637
588
  onClick: handleFooterClick,
638
589
  children: footer
639
- }), openTheme ? /*#__PURE__*/_jsx(ThemeSettings, {
640
- open: openTheme,
641
- setOpen: setOpenTheme,
642
- editor: editor,
643
- services: otherProps?.services
644
- }) : null, /*#__PURE__*/_jsx(ThemeSettingsAI, {
645
- openAITheme: openAITheme,
646
- setOpenAITheme: setOpenAITheme,
647
- onSaveTheme: otherProps?.onSaveTheme
648
590
  })]
649
591
  })
650
592
  }), !readOnly ? /*#__PURE__*/_jsx(PopupTool, {
@@ -653,21 +595,23 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
653
595
  setIsTextSelected: setIsTextSelected,
654
596
  customProps: customProps,
655
597
  editorWrapper: editorWrapper
656
- }) : null, !readOnly ? /*#__PURE__*/_jsx(SwitchViewport, {
598
+ }) : null, !readOnly && showViewport ? /*#__PURE__*/_jsx(SwitchViewport, {
657
599
  breakpoint: breakpoint,
658
- show: showViewport,
659
600
  onChange: b => onSwitchBreakpoint(b)
660
601
  }) : null]
661
602
  })
662
603
  }), htmlAction.showInput && /*#__PURE__*/_jsx(CodeToText, {
663
604
  ...htmlAction,
664
605
  handleCodeToText: handleCodeToText
665
- }), /*#__PURE__*/_jsx(FontLoader, {
666
- ...props
667
606
  })]
668
- }, id)
607
+ }, id), /*#__PURE__*/_jsx(FontLoader, {
608
+ otherProps: {
609
+ services: otherProps?.services
610
+ },
611
+ readOnly: readOnly
612
+ })]
669
613
  })
670
- })]
614
+ })
671
615
  });
672
616
  });
673
617
  CommonEditor.displayName = "CommonEditor";
@@ -2,7 +2,6 @@ import React from "react";
2
2
  import { Dialog, DialogTitle, DialogContent, IconButton, Grid } from "@mui/material";
3
3
  import CloseIcon from "@mui/icons-material/Close";
4
4
  import ViewportStimulator from "./common/RnD/Theme/ViewportStimulator";
5
- import MainThemeProvider from "./common/RnD/Theme/MainThemeProvider";
6
5
  import { jsx as _jsx } from "react/jsx-runtime";
7
6
  import { jsxs as _jsxs } from "react/jsx-runtime";
8
7
  const DialogWrapper = props => {
@@ -10,45 +9,40 @@ const DialogWrapper = props => {
10
9
  fullScreen,
11
10
  onClose,
12
11
  children,
13
- classes,
14
- selectedTheme
12
+ classes
15
13
  } = props;
16
- return fullScreen ? /*#__PURE__*/_jsx(MainThemeProvider, {
17
- userSelectedTheme: selectedTheme,
18
- children: /*#__PURE__*/_jsxs(Dialog, {
19
- className: `dialogComp`,
20
- open: fullScreen,
21
- fullScreen: fullScreen,
22
- onClose: onClose,
14
+ return fullScreen ? /*#__PURE__*/_jsxs(Dialog, {
15
+ className: `dialogComp`,
16
+ open: fullScreen,
17
+ fullScreen: fullScreen,
18
+ onClose: onClose,
19
+ style: {
20
+ zIndex: 1000
21
+ },
22
+ sx: classes.fullScreenWrapper,
23
+ children: [/*#__PURE__*/_jsx(DialogTitle, {
23
24
  style: {
24
- zIndex: 1000
25
+ padding: "6px 8px"
25
26
  },
26
- sx: classes.fullScreenWrapper,
27
- children: [/*#__PURE__*/_jsx(DialogTitle, {
28
- style: {
29
- padding: "6px 8px"
30
- },
27
+ children: /*#__PURE__*/_jsx(Grid, {
31
28
  children: /*#__PURE__*/_jsx(Grid, {
32
- children: /*#__PURE__*/_jsx(Grid, {
29
+ style: {
30
+ display: "flex",
31
+ justifyContent: "end"
32
+ },
33
+ children: /*#__PURE__*/_jsx(IconButton, {
34
+ onClick: onClose,
33
35
  style: {
34
- display: "flex",
35
- justifyContent: "end"
36
+ background: "rgba(255,255,255,0.5)"
36
37
  },
37
- children: /*#__PURE__*/_jsx(IconButton, {
38
- onClick: onClose,
39
- style: {
40
- background: "rgba(255,255,255,0.5)"
41
- },
42
- children: /*#__PURE__*/_jsx(CloseIcon, {})
43
- })
38
+ children: /*#__PURE__*/_jsx(CloseIcon, {})
44
39
  })
45
40
  })
46
- }), /*#__PURE__*/_jsx(DialogContent, {
47
- children: children
48
- })]
49
- })
41
+ })
42
+ }), /*#__PURE__*/_jsx(DialogContent, {
43
+ children: children
44
+ })]
50
45
  }) : /*#__PURE__*/_jsx(ViewportStimulator, {
51
- selectedTheme: selectedTheme,
52
46
  children: children
53
47
  });
54
48
  };
@@ -995,7 +995,7 @@ blockquote {
995
995
 
996
996
  .sliderInput {
997
997
  width: 66px !important;
998
- padding: 2px 0px 2px 4px;
998
+ padding: 2px 10px;
999
999
  margin-left: 18px;
1000
1000
  box-shadow: 0px 4px 16px 0px #0000000d;
1001
1001
  border: 1px solid #6f6f6f33;
@@ -1263,19 +1263,6 @@ blockquote {
1263
1263
  pointer-events: auto;
1264
1264
  }
1265
1265
 
1266
- @media (max-width: 899px) {
1267
- .MuiPopover-root {
1268
- z-index: 1302 !important;
1269
- }
1270
- canvas {
1271
- max-width: 100% !important;
1272
- }
1273
- }
1274
-
1275
- .settingsHeader {
1276
- font-size: 14px !important;
1277
- font-weight: 500 !important;
1278
- }
1279
1266
  .hideScroll {
1280
1267
  overflow-anchor: none;
1281
1268
  }
@@ -1291,6 +1278,20 @@ blockquote {
1291
1278
  .hideScroll::-webkit-scrollbar-thumb:hover {
1292
1279
  background: none !important;
1293
1280
  }
1281
+ @media (max-width: 899px) {
1282
+ .MuiPopover-root {
1283
+ z-index: 1302 !important;
1284
+ }
1285
+
1286
+ canvas {
1287
+ max-width: 100% !important;
1288
+ }
1289
+ }
1290
+
1291
+ .settingsHeader {
1292
+ font-size: 14px !important;
1293
+ font-weight: 500 !important;
1294
+ }
1294
1295
 
1295
1296
  .custom-scroll::-webkit-scrollbar {
1296
1297
  height: .6rem;
@@ -1337,11 +1338,4 @@ code.markcode {
1337
1338
  display: block;
1338
1339
  background-color: #f3f3f3;
1339
1340
  font-family: 'Source Code Pro' !important;
1340
- }
1341
-
1342
- /* Hide the popper when the reference is hidden */
1343
- .hide-popper-on-overlap[data-popper-escaped],
1344
- .hide-popper-on-overlap[data-popper-reference-hidden] {
1345
- visibility: hidden;
1346
- pointer-events: none;
1347
- }
1341
+ }
@@ -6,7 +6,7 @@ import AIInput from "./AIInput";
6
6
  import { ReactEditor, useSlate } from "slate-react";
7
7
  import { Node, Range, Transforms } from "slate";
8
8
  import { MODES } from "./helper";
9
- import { getSelectedText, getSlateDom, viewSlateSelection } from "../../utils/helper";
9
+ import { getSelectedText, getSlateDom } from "../../utils/helper";
10
10
  import { VoiceToText } from "./VoiceToText";
11
11
  import deserialize from "../../helper/deserialize";
12
12
  import useEditorScroll from "../../hooks/useEditorScroll";
@@ -286,7 +286,17 @@ function PopoverAIInput({
286
286
  };
287
287
  useEffect(() => {
288
288
  if (openAI && getSelectedText(editor).trim()) {
289
- viewSlateSelection();
289
+ const customSelection = document.querySelectorAll(".slate-highlight");
290
+ const selectionBg = "rgba(35, 131, 226, 0.35)";
291
+ if (customSelection?.length) {
292
+ customSelection?.forEach(el => el.style.background = selectionBg);
293
+
294
+ // if ai is opened, remove the window selection class and open then slate selection, To resolve: focussing on the ai input removes window selection automatically
295
+ const selection = window.getSelection();
296
+ if (selection) {
297
+ selection.removeAllRanges(); // Clears the selection
298
+ }
299
+ }
290
300
  }
291
301
  }, [editor.selection, openAI]);
292
302
  return /*#__PURE__*/_jsxs("div", {
@@ -265,7 +265,7 @@ function AppHeader(props) {
265
265
  style: {
266
266
  display: "inline-flex",
267
267
  alignItems: "center",
268
- color: textColor || "#000000",
268
+ color: textColor,
269
269
  fontSize: logoFontSize,
270
270
  fontFamily: titleFontFamily,
271
271
  justifyContent: isLogoRight ? "end" : "start"
@@ -320,7 +320,7 @@ function AppHeader(props) {
320
320
  fontFamily: fontFamily,
321
321
  textTransform: "none",
322
322
  fontSize: fontSize || "16px",
323
- color: textColor || "#000",
323
+ color: textColor || "#FFF",
324
324
  background: bgColor || "none",
325
325
  "& .m-settings": {
326
326
  display: "none",
@@ -335,7 +335,7 @@ function AppHeader(props) {
335
335
  background: "#FFF"
336
336
  },
337
337
  "&:hover": {
338
- color: textColorHover || textColor || "#000",
338
+ color: textColorHover || textColor || "#FFF",
339
339
  background: bgColorHover || bgColor || "none",
340
340
  "& .m-settings": {
341
341
  display: "block"
@@ -9,8 +9,6 @@ import { WorkflowIcon } from "../../common/iconslist";
9
9
  import { getTRBLBreakPoints, getBreakPointsValue, groupByBreakpoint } from "../../helper/theme";
10
10
  import { handleLinkType, windowVar } from "../../utils/helper";
11
11
  import LinkSettings from "../../common/LinkSettings";
12
- import { useEditorTheme } from "../../hooks/useEditorTheme";
13
- import { getTheme } from "../../theme";
14
12
  import Icon from "../../common/Icon";
15
13
  import { useEditorContext } from "../../hooks/useMouseMove";
16
14
  import useCommonStyle from "../../commonStyle";
@@ -40,12 +38,6 @@ const EditorButton = props => {
40
38
  const [openNav, setOpenNav] = useState(false);
41
39
  const [openMoreOptions, setOpenMoreOptions] = useState(false);
42
40
  const classes = useCommonStyle(appTheme);
43
- const {
44
- theme: selectedTheme
45
- } = useEditorTheme();
46
- const {
47
- buttonTheme
48
- } = getTheme(selectedTheme);
49
41
  const {
50
42
  label,
51
43
  bgColor,
@@ -59,7 +51,7 @@ const EditorButton = props => {
59
51
  fontFamily,
60
52
  textColorHover,
61
53
  bgColorHover,
62
- // buttonIcon,
54
+ buttonIcon,
63
55
  iconPosition = "start",
64
56
  borderStyle,
65
57
  borderWidth,
@@ -80,7 +72,6 @@ const EditorButton = props => {
80
72
  };
81
73
  const isTrigger = linkType === "nextTrigger" || linkType === "prevTrigger";
82
74
  const refURl = isTrigger ? buttonLink?.url : url;
83
- const buttonIcon = element?.buttonIcon || buttonTheme?.buttonIcon;
84
75
  const BtnIcon = buttonIcon ? buttonIcon : null;
85
76
  windowVar.lastButtonProps = element;
86
77
  const handleTrigger = async () => {
@@ -171,7 +162,6 @@ const EditorButton = props => {
171
162
  display: "inline-flex",
172
163
  color: "rgba(0, 0, 0, 0.54)",
173
164
  marginBottom: "0px !important",
174
- ...classes.buttonMoreOption,
175
165
  ...classes.buttonMoreOption3
176
166
  },
177
167
  ...btnProps,
@@ -263,38 +253,31 @@ const EditorButton = props => {
263
253
  display: "inline-block"
264
254
  },
265
255
  children: [/*#__PURE__*/_jsxs(Box, {
266
- className: `btn textAlign-${tAlign} button theme-element`,
267
256
  ref: buttonRef,
257
+ className: `btn textAlign-${tAlign}`,
268
258
  sx: {
269
259
  textDecoration: "none",
260
+ background: bgColor || "rgb(30, 75, 122)",
270
261
  borderBlockStyle: "solid",
262
+ borderColor: borderColor || "transparent",
271
263
  borderWidth: borderWidth !== undefined ? borderWidth : borderColor ? "1px" : "0px",
272
264
  ...btnSp,
273
265
  borderStyle: borderStyle || "solid",
266
+ color: `${textColor || "#FFFFFF"}`,
267
+ fontSize: textSize || "inherit",
268
+ fontFamily: fontFamily || "PoppinsRegular",
274
269
  display: "inline-flex",
275
270
  alignItems: "center",
276
271
  position: "relative",
277
- lineHeight: 1.43,
278
272
  "& .element-toolbar": {
279
273
  display: "none"
280
274
  },
281
275
  "&:hover": {
282
- color: `${textColorHover || textColor}`,
283
- background: bgColorHover || bgColor,
276
+ color: `${textColorHover || textColor || "#FFFFFF"}`,
277
+ background: bgColorHover || bgColor || "rgb(30, 75, 122)",
284
278
  "& .element-toolbar": {
285
279
  display: "flex"
286
280
  }
287
- },
288
- color: textColor ? `${textColor} !important` : "#FFFFFF",
289
- fontSize: textSize ? `${textSize}px !important` : "inherit",
290
- fontFamily: fontFamily ? `${fontFamily} !important` : "PoppinsRegular",
291
- background: `${bgColor} !important`,
292
- borderColor: `${borderColor} !important`,
293
- borderRadius: {
294
- ...getBreakPointsValue(borderRadius || buttonTheme?.borderRadius || {}, null, "overrideBorderRadius", true)
295
- },
296
- padding: {
297
- ...getTRBLBreakPoints(bannerSpacing || buttonTheme?.bannerSpacing || {})
298
281
  }
299
282
  },
300
283
  ...buttonProps,