@flozy/editor 11.0.6 → 11.0.8

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 (160) hide show
  1. package/dist/Editor/ChatEditor.js +17 -16
  2. package/dist/Editor/CommonEditor.js +141 -28
  3. package/dist/Editor/DialogWrapper.js +31 -25
  4. package/dist/Editor/Editor.css +39 -11
  5. package/dist/Editor/Elements/AI/PopoverAIInput.js +11 -3
  6. package/dist/Editor/Elements/AI/Styles.js +1 -0
  7. package/dist/Editor/Elements/Accordion/Accordion.js +28 -22
  8. package/dist/Editor/Elements/Accordion/AccordionButton.js +12 -3
  9. package/dist/Editor/Elements/AppHeader/AppHeader.js +3 -3
  10. package/dist/Editor/Elements/Attachments/AttachmentStyles.js +16 -0
  11. package/dist/Editor/Elements/Attachments/Attachments.js +153 -11
  12. package/dist/Editor/Elements/Attachments/AttachmentsButton.js +8 -3
  13. package/dist/Editor/Elements/Button/EditorButton.js +23 -7
  14. package/dist/Editor/Elements/Color Picker/ColorButtons.js +61 -14
  15. package/dist/Editor/Elements/Color Picker/ColorPicker.css +25 -1
  16. package/dist/Editor/Elements/Color Picker/ColorPicker.js +10 -7
  17. package/dist/Editor/Elements/Color Picker/Styles.js +15 -13
  18. package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/Select.js +134 -55
  19. package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/SelectV1.js +7 -8
  20. package/dist/Editor/Elements/DataView/Layouts/DataTypes/PersonType.js +8 -3
  21. package/dist/Editor/Elements/DataView/Layouts/Options/EditProperty.js +1 -1
  22. package/dist/Editor/Elements/DataView/Layouts/TableStyles.js +1 -1
  23. package/dist/Editor/Elements/Embed/Embed.js +36 -43
  24. package/dist/Editor/Elements/Embed/Image.js +236 -23
  25. package/dist/Editor/Elements/Embed/Video.js +245 -15
  26. package/dist/Editor/Elements/Form/Form.js +35 -10
  27. package/dist/Editor/Elements/Form/FormField.js +1 -1
  28. package/dist/Editor/Elements/Form/Workflow/Styles.js +24 -22
  29. package/dist/Editor/Elements/Form/Workflow/constant.js +25 -1
  30. package/dist/Editor/Elements/FreeGrid/FreeGrid.js +31 -74
  31. package/dist/Editor/Elements/FreeGrid/FreeGridBox.js +9 -5
  32. package/dist/Editor/Elements/FreeGrid/FreeGridItem.js +3 -1
  33. package/dist/Editor/Elements/FreeGrid/Options/More.js +7 -7
  34. package/dist/Editor/Elements/FreeGrid/helper.js +194 -0
  35. package/dist/Editor/Elements/FreeGrid/styles.js +15 -0
  36. package/dist/Editor/Elements/Grid/GridItem.js +1 -1
  37. package/dist/Editor/Elements/PageSettings/PageSettingsButton.js +2 -1
  38. package/dist/Editor/Elements/Signature/SignatureOptions/TypeSignature.js +3 -2
  39. package/dist/Editor/Elements/Signature/SignaturePopup.js +24 -6
  40. package/dist/Editor/Elements/SimpleText/style.js +2 -2
  41. package/dist/Editor/Elements/Table/Table.js +5 -4
  42. package/dist/Editor/Elements/Table/TableCell.js +10 -3
  43. package/dist/Editor/Elements/Title/title.js +10 -11
  44. package/dist/Editor/Elements/TopBanner/TopBanner.js +4 -2
  45. package/dist/Editor/Elements/TopBanner/TopBannerButton.js +5 -3
  46. package/dist/Editor/Elements/Variables/VariableButton.js +10 -1
  47. package/dist/Editor/MiniEditor.js +2 -1
  48. package/dist/Editor/Styles/EditorStyles.js +23 -5
  49. package/dist/Editor/Toolbar/FormatTools/Dropdown.js +27 -3
  50. package/dist/Editor/Toolbar/FormatTools/FontFamilyAutocomplete.js +4 -3
  51. package/dist/Editor/Toolbar/FormatTools/MarkButton.js +2 -2
  52. package/dist/Editor/Toolbar/FormatTools/TextSize.js +33 -29
  53. package/dist/Editor/Toolbar/Mini/MiniToolbar.js +2 -1
  54. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/MiniColorPicker.js +4 -2
  55. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectFontSize.js +25 -23
  56. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectList.js +25 -7
  57. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectTypography.js +167 -42
  58. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/index.js +24 -8
  59. package/dist/Editor/Toolbar/PopupTool/PopperHeader.js +2 -1
  60. package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +70 -10
  61. package/dist/Editor/Toolbar/PopupTool/TextFormat.js +73 -14
  62. package/dist/Editor/Toolbar/PopupTool/ThemeTextFormat.js +439 -0
  63. package/dist/Editor/Toolbar/PopupTool/index.js +7 -4
  64. package/dist/Editor/Toolbar/toolbarGroups.js +56 -10
  65. package/dist/Editor/assets/svg/BackIcon.js +18 -0
  66. package/dist/Editor/assets/svg/ThemeIcons.js +293 -0
  67. package/dist/Editor/common/ColorPickerButton.js +38 -16
  68. package/dist/Editor/common/CustomColorPicker/index.js +130 -0
  69. package/dist/Editor/common/CustomColorPicker/style.js +53 -0
  70. package/dist/Editor/common/CustomDialog2/index.js +94 -0
  71. package/dist/Editor/common/CustomDialog2/style.js +67 -0
  72. package/dist/Editor/common/CustomSelect.js +43 -0
  73. package/dist/Editor/common/DnD/DragHandleButton.js +1 -1
  74. package/dist/Editor/common/FontLoader/FontLoader.js +4 -0
  75. package/dist/Editor/common/Icon.js +28 -0
  76. package/dist/Editor/common/ImageSelector/ImageSelector.js +45 -7
  77. package/dist/Editor/common/ImageSelector/Options/Upload.js +26 -11
  78. package/dist/Editor/common/ImageSelector/Styles.js +3 -9
  79. package/dist/Editor/common/LinkSettings/NavComponents.js +6 -2
  80. package/dist/Editor/common/MentionsPopup/index.js +9 -1
  81. package/dist/Editor/common/RnD/ElementSettings/OtherSettings/Settings.js +2 -1
  82. package/dist/Editor/common/RnD/ElementSettings/Settings/AppHeaderSettings.js +3 -2
  83. package/dist/Editor/common/RnD/ElementSettings/Settings/BoxSettings.js +3 -2
  84. package/dist/Editor/common/RnD/ElementSettings/Settings/ButtonSettings.js +3 -2
  85. package/dist/Editor/common/RnD/ElementSettings/Settings/CodeSettings.js +3 -2
  86. package/dist/Editor/common/RnD/ElementSettings/Settings/FormSettings.js +4 -2
  87. package/dist/Editor/common/RnD/ElementSettings/Settings/ImageSettings.js +20 -7
  88. package/dist/Editor/common/RnD/ElementSettings/Settings/TableSettings.js +3 -2
  89. package/dist/Editor/common/RnD/ElementSettings/Settings/TextSettings.js +9 -1
  90. package/dist/Editor/common/RnD/ElementSettings/Settings/VideoSettings.js +20 -7
  91. package/dist/Editor/common/RnD/GuideLines/styles.js +1 -1
  92. package/dist/Editor/common/RnD/SwitchViewport/SwitchViewport.js +11 -2
  93. package/dist/Editor/common/RnD/Theme/MainThemeProvider.js +17 -0
  94. package/dist/Editor/common/RnD/Theme/ViewportStimulator.js +6 -3
  95. package/dist/Editor/common/RnD/Utils/gridDropItem.js +28 -11
  96. package/dist/Editor/common/RnD/Utils/index.js +3 -1
  97. package/dist/Editor/common/RnD/VirtualElement/VirtualTextElement.js +52 -63
  98. package/dist/Editor/common/RnD/VirtualElement/helper.js +320 -130
  99. package/dist/Editor/common/RnD/VirtualElement/styles.js +22 -0
  100. package/dist/Editor/common/RnD/index.js +61 -14
  101. package/dist/Editor/common/Shorthands/elements.js +62 -4
  102. package/dist/Editor/common/StyleBuilder/buttonStyle.js +4 -2
  103. package/dist/Editor/common/StyleBuilder/embedVideoStyle.js +4 -0
  104. package/dist/Editor/common/StyleBuilder/fieldStyle.js +1 -0
  105. package/dist/Editor/common/StyleBuilder/fieldTypes/backgroundImage.js +15 -2
  106. package/dist/Editor/common/StyleBuilder/fieldTypes/bannerSpacing.js +12 -2
  107. package/dist/Editor/common/StyleBuilder/fieldTypes/borderRadius.js +15 -7
  108. package/dist/Editor/common/StyleBuilder/fieldTypes/card.js +16 -8
  109. package/dist/Editor/common/StyleBuilder/fieldTypes/color.js +36 -10
  110. package/dist/Editor/common/StyleBuilder/fieldTypes/embedUpload.js +115 -0
  111. package/dist/Editor/common/StyleBuilder/fieldTypes/fontSize.js +16 -7
  112. package/dist/Editor/common/StyleBuilder/fieldTypes/index.js +3 -1
  113. package/dist/Editor/common/StyleBuilder/fieldTypes/menusArray.js +2 -0
  114. package/dist/Editor/common/StyleBuilder/fieldTypes/text.js +1 -0
  115. package/dist/Editor/common/StyleBuilder/fieldTypes/textOptions.js +15 -7
  116. package/dist/Editor/common/StyleBuilder/formStyle.js +19 -13
  117. package/dist/Editor/common/StyleBuilder/index.js +8 -4
  118. package/dist/Editor/common/Uploader.js +125 -17
  119. package/dist/Editor/common/UploaderWithProgress.js +183 -0
  120. package/dist/Editor/common/iconslist.js +21 -0
  121. package/dist/Editor/commonStyle.js +136 -63
  122. package/dist/Editor/helper/index.js +10 -2
  123. package/dist/Editor/helper/textIndeces.js +58 -0
  124. package/dist/Editor/helper/theme.js +203 -2
  125. package/dist/Editor/hooks/useEditorTheme.js +153 -0
  126. package/dist/Editor/hooks/useMouseMove.js +9 -3
  127. package/dist/Editor/hooks/useTable.js +62 -1
  128. package/dist/Editor/hooks/useThemeValues.js +63 -0
  129. package/dist/Editor/plugins/withEmbeds.js +12 -1
  130. package/dist/Editor/plugins/withHTML.js +58 -3
  131. package/dist/Editor/plugins/withTable.js +1 -1
  132. package/dist/Editor/service/fileupload.js +70 -0
  133. package/dist/Editor/theme/ThemeList.js +50 -173
  134. package/dist/Editor/theme/index.js +149 -0
  135. package/dist/Editor/themeSettings/ActiveTheme.js +82 -0
  136. package/dist/Editor/themeSettings/buttons/index.js +300 -0
  137. package/dist/Editor/themeSettings/buttons/style.js +23 -0
  138. package/dist/Editor/themeSettings/colorTheme/index.js +310 -0
  139. package/dist/Editor/themeSettings/colorTheme/style.js +81 -0
  140. package/dist/Editor/themeSettings/fonts/PreviewElement.js +121 -0
  141. package/dist/Editor/themeSettings/fonts/index.js +240 -0
  142. package/dist/Editor/themeSettings/fonts/style.js +62 -0
  143. package/dist/Editor/themeSettings/icons.js +60 -0
  144. package/dist/Editor/themeSettings/index.js +380 -0
  145. package/dist/Editor/themeSettings/style.js +299 -0
  146. package/dist/Editor/themeSettingsAI/icons.js +96 -0
  147. package/dist/Editor/themeSettingsAI/index.js +355 -0
  148. package/dist/Editor/themeSettingsAI/saveTheme.js +202 -0
  149. package/dist/Editor/themeSettingsAI/style.js +332 -0
  150. package/dist/Editor/utils/SlateUtilityFunctions.js +192 -40
  151. package/dist/Editor/utils/accordion.js +67 -39
  152. package/dist/Editor/utils/button.js +1 -17
  153. package/dist/Editor/utils/draftToSlate.js +3 -2
  154. package/dist/Editor/utils/events.js +94 -89
  155. package/dist/Editor/utils/font.js +40 -37
  156. package/dist/Editor/utils/formfield.js +2 -2
  157. package/dist/Editor/utils/helper.js +100 -23
  158. package/dist/Editor/utils/insertAppHeader.js +8 -4
  159. package/package.json +4 -4
  160. package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/MultiSelect.js +0 -454
@@ -1,25 +1,30 @@
1
1
  import { useEffect, useRef, useState } from "react";
2
- import { activeMark, addMarkData, isBlockActive } from "../../../utils/SlateUtilityFunctions";
2
+ import { activeMark, addMarkData } from "../../../utils/SlateUtilityFunctions";
3
3
  import { Button, IconButton, Popover, TextField } from "@mui/material";
4
4
  import DownArrowIcon from "../../../assets/svg/DownArrowIcon";
5
5
  import useWindowResize from "../../../hooks/useWindowResize";
6
- import { BREAKPOINTS_DEVICES, getBreakPointsValue } from "../../../helper/theme";
7
- import { headingMap, sizeMap } from "../../../utils/font";
6
+ import { BREAKPOINTS_DEVICES, getBreakPointsValue, getTextSizeVal } from "../../../helper/theme";
8
7
  import { jsx as _jsx } from "react/jsx-runtime";
9
8
  import { jsxs as _jsxs } from "react/jsx-runtime";
10
9
  const fontSizeOptions = [8, 9, 10, 11, 12, 14, 16, 18, 20, 22, 26, 32, 36, 40, 48, 64, 96, 128];
11
- function SelectFontSize({
12
- editor,
13
- classes
14
- }) {
10
+ function SelectFontSize(props) {
11
+ const {
12
+ editor,
13
+ classes,
14
+ fromMiniTextFormat,
15
+ setResizedSize,
16
+ resizedSize
17
+ } = props;
15
18
  const format = "fontSize";
16
19
  const [fontSize, setFontSize] = useState();
20
+ const sizeValue = fromMiniTextFormat ? resizedSize : fontSize;
21
+ const setSizeValue = fromMiniTextFormat ? setResizedSize : setFontSize;
17
22
  const [anchorEl, setAnchorEl] = useState(null);
18
23
  const open = Boolean(anchorEl);
19
24
  const containerRef = useRef();
20
25
  const [size] = useWindowResize();
21
26
  const val = activeMark(editor, format);
22
- const value = getBreakPointsValue(val, size?.device);
27
+ const value = getTextSizeVal(editor);
23
28
  const timerRef = useRef();
24
29
  const updateMarkData = newVal => {
25
30
  let upData = {
@@ -46,31 +51,28 @@ function SelectFontSize({
46
51
  if (value) {
47
52
  let inc = parseInt(value);
48
53
  inc = inc > 200 ? 200 : inc;
54
+ setSizeValue(inc);
49
55
  updateMarkData(inc);
50
56
  } else {
51
- setFontSize(null);
57
+ setSizeValue(null);
52
58
  }
53
59
  };
54
60
  const getSizeVal = () => {
55
61
  try {
56
- let size = `${value}`?.indexOf("px") >= 0 ? value : sizeMap[value] || value;
57
- Object.entries(headingMap).forEach(([format, value]) => {
58
- if (isBlockActive(editor, format) && isNaN(parseInt(size))) {
59
- size = value;
60
- }
61
- });
62
- return isNaN(parseInt(size)) ? 14 : parseInt(size);
62
+ return parseInt(value);
63
63
  } catch (err) {
64
64
  return "";
65
65
  }
66
66
  };
67
67
  useEffect(() => {
68
- setFontSize(getSizeVal());
68
+ if (value) {
69
+ setSizeValue(getSizeVal());
70
+ }
69
71
  }, [value]);
70
72
  const onChange = e => {
71
73
  clearTimeout(timerRef.current);
72
74
  const value = e.target.value;
73
- setFontSize(value);
75
+ setSizeValue(value);
74
76
  timerRef.current = setTimeout(() => {
75
77
  onChangeSize(value);
76
78
  }, 500);
@@ -83,7 +85,7 @@ function SelectFontSize({
83
85
  },
84
86
  children: [/*#__PURE__*/_jsx(TextField, {
85
87
  sx: classes?.miniFontSizeInput,
86
- value: fontSize,
88
+ value: sizeValue,
87
89
  onChange: onChange,
88
90
  size: "small"
89
91
  }), /*#__PURE__*/_jsx(IconButton, {
@@ -97,16 +99,16 @@ function SelectFontSize({
97
99
  anchorEl: anchorEl,
98
100
  onClose: () => setAnchorEl(null),
99
101
  anchorOrigin: {
100
- vertical: 'bottom',
101
- horizontal: 'left'
102
+ vertical: "bottom",
103
+ horizontal: "left"
102
104
  },
103
105
  sx: classes.customSelectPopoverWrapper,
104
106
  children: fontSizeOptions.map((s, i) => {
105
107
  return /*#__PURE__*/_jsx("div", {
106
108
  children: /*#__PURE__*/_jsx(Button, {
107
- className: `customSelectOptionLabel ${fontSize === s ? "selected" : ""}`,
109
+ className: `customSelectOptionLabel ${sizeValue === s ? "selected" : ""}`,
108
110
  onClick: () => {
109
- setFontSize(s);
111
+ setSizeValue(s);
110
112
  onChangeSize(s);
111
113
  },
112
114
  children: s
@@ -2,7 +2,7 @@ import { useMemo } from "react";
2
2
  import { isBlockActive, toggleBlock } from "../../../utils/SlateUtilityFunctions";
3
3
  import CustomSelectTool from "./CustomSelectTool";
4
4
  import Icon from "../../../common/Icon";
5
- import { insertAccordion } from "../../../utils/accordion";
5
+ import { insertAccordion, toggleAccordion } from "../../../utils/accordion";
6
6
  import { jsx as _jsx } from "react/jsx-runtime";
7
7
  import { jsxs as _jsxs } from "react/jsx-runtime";
8
8
  function Label({
@@ -16,8 +16,8 @@ function Label({
16
16
  }), " ", label]
17
17
  });
18
18
  }
19
- function getListOptions(translation) {
20
- return [{
19
+ function getListOptions(translation, listType) {
20
+ const list = [{
21
21
  id: 15,
22
22
  value: "orderedList",
23
23
  type: "block",
@@ -53,7 +53,8 @@ function getListOptions(translation) {
53
53
  icon: "check-list-item"
54
54
  }),
55
55
  group: "list"
56
- }, {
56
+ }];
57
+ const accordion = [{
57
58
  id: 30,
58
59
  value: "accordion",
59
60
  type: "accordion",
@@ -67,17 +68,30 @@ function getListOptions(translation) {
67
68
  icon: "accordion"
68
69
  })
69
70
  }];
71
+ let options = [];
72
+ if (listType === "accordion-summary") {
73
+ options = [...accordion];
74
+ } else if (listType === "list-item") {
75
+ options = [...list];
76
+ } else {
77
+ options = [...list, ...accordion];
78
+ }
79
+ return options;
70
80
  }
71
81
  function SelectList({
72
82
  editor,
73
83
  classes,
74
84
  closeMainPopup,
75
- customProps
85
+ customProps,
86
+ commonProps
76
87
  }) {
77
88
  const {
78
89
  translation
79
90
  } = customProps;
80
- const listOptions = getListOptions(translation);
91
+ const {
92
+ listType
93
+ } = commonProps || {};
94
+ const listOptions = getListOptions(translation, listType);
81
95
  const selectedList = useMemo(() => {
82
96
  return listOptions.find(t => isBlockActive(editor, t.value));
83
97
  }, [listOptions, isBlockActive, editor]);
@@ -85,7 +99,11 @@ function SelectList({
85
99
  if (option.type === "block") {
86
100
  toggleBlock(editor, format);
87
101
  } else if (option.type === "accordion") {
88
- insertAccordion(editor);
102
+ if (listType === "accordion-summary") {
103
+ toggleAccordion(editor);
104
+ } else {
105
+ insertAccordion(editor);
106
+ }
89
107
  }
90
108
  closeMainPopup();
91
109
  };
@@ -2,8 +2,11 @@ import { useMemo } from "react";
2
2
  import { activeMark, addMarkData, isBlockActive, toggleBlock } from "../../../utils/SlateUtilityFunctions";
3
3
  import CustomSelectTool from "./CustomSelectTool";
4
4
  import useWindowResize from "../../../hooks/useWindowResize";
5
- import { BREAKPOINTS_DEVICES, getBreakPointsValue } from "../../../helper/theme";
5
+ import { BREAKPOINTS_DEVICES, getBreakPointsValue, isTextCustomized as isCustomized, textThemeFields as themeFields } from "../../../helper/theme";
6
6
  import { sizeMap } from "../../../utils/font";
7
+ import { Editor } from "slate";
8
+ import { useEditorTheme } from "../../../hooks/useEditorTheme";
9
+ import { MenuItem, Select } from "@mui/material";
7
10
  import { jsx as _jsx } from "react/jsx-runtime";
8
11
  import { jsxs as _jsxs } from "react/jsx-runtime";
9
12
  function Label({
@@ -18,26 +21,29 @@ function Label({
18
21
  });
19
22
  }
20
23
  function DisplayHeaderLabel({
21
- type
24
+ type,
25
+ isCustomized,
26
+ isPara = false
22
27
  }) {
23
28
  return /*#__PURE__*/_jsxs("div", {
24
- children: ["H", /*#__PURE__*/_jsx("sub", {
29
+ children: [isCustomized ? "*" : "", isPara ? "P" : "H", /*#__PURE__*/_jsx("sub", {
25
30
  children: type
26
31
  })]
27
32
  });
28
33
  }
29
- function getTypographyOptions(translation) {
30
- return [{
34
+ function getTypographyOptions(isCustomized, translation) {
35
+ const typographyOptions = [{
31
36
  id: 11,
32
37
  format: "headingOne",
33
38
  type: "block",
34
39
  title: /*#__PURE__*/_jsx(Label, {
35
40
  label: "H1",
36
- type: "Header",
41
+ type: "Heading",
37
42
  translation: translation
38
43
  }),
39
44
  label: /*#__PURE__*/_jsx(DisplayHeaderLabel, {
40
- type: 1
45
+ type: 1,
46
+ isCustomized: isCustomized
41
47
  }),
42
48
  group: "typography",
43
49
  value: "headingOne"
@@ -47,11 +53,12 @@ function getTypographyOptions(translation) {
47
53
  type: "block",
48
54
  title: /*#__PURE__*/_jsx(Label, {
49
55
  label: "H2",
50
- type: "Header",
56
+ type: "Heading",
51
57
  translation: translation
52
58
  }),
53
59
  label: /*#__PURE__*/_jsx(DisplayHeaderLabel, {
54
- type: 2
60
+ type: 2,
61
+ isCustomized: isCustomized
55
62
  }),
56
63
  group: "typography",
57
64
  value: "headingTwo"
@@ -61,63 +68,156 @@ function getTypographyOptions(translation) {
61
68
  type: "block",
62
69
  title: /*#__PURE__*/_jsx(Label, {
63
70
  label: "H3",
64
- type: "Header",
71
+ type: "Heading",
65
72
  translation: translation
66
73
  }),
67
74
  label: /*#__PURE__*/_jsx(DisplayHeaderLabel, {
68
- type: 3
75
+ type: 3,
76
+ isCustomized: isCustomized
69
77
  }),
70
78
  group: "typography",
71
79
  value: "headingThree"
72
80
  }, {
73
- id: 14,
74
- format: "fontSize",
75
- type: "mark",
81
+ id: 17,
82
+ format: "headingFour",
83
+ type: "block",
76
84
  title: /*#__PURE__*/_jsx(Label, {
77
- label: "L",
78
- type: "Large",
85
+ label: "H4",
86
+ type: "Heading",
79
87
  translation: translation
80
88
  }),
81
- label: "L",
89
+ label: /*#__PURE__*/_jsx(DisplayHeaderLabel, {
90
+ type: 4,
91
+ isCustomized: isCustomized
92
+ }),
82
93
  group: "typography",
83
- value: "huge"
94
+ value: "headingFour"
84
95
  }, {
85
- id: 15,
86
- format: "fontSize",
87
- type: "mark",
96
+ id: 18,
97
+ format: "headingFive",
98
+ type: "block",
88
99
  title: /*#__PURE__*/_jsx(Label, {
89
- label: "M",
90
- type: "Medium",
100
+ label: "H5",
101
+ type: "Heading",
91
102
  translation: translation
92
103
  }),
93
- label: "M",
104
+ label: /*#__PURE__*/_jsx(DisplayHeaderLabel, {
105
+ type: 5,
106
+ isCustomized: isCustomized
107
+ }),
94
108
  group: "typography",
95
- value: "medium"
109
+ value: "headingFive"
96
110
  }, {
97
- id: 16,
98
- format: "fontSize",
99
- type: "mark",
111
+ id: 19,
112
+ format: "headingSix",
113
+ type: "block",
100
114
  title: /*#__PURE__*/_jsx(Label, {
101
- label: "S",
102
- type: "Small",
115
+ label: "H6",
116
+ type: "Heading",
103
117
  translation: translation
104
118
  }),
105
- label: "S",
119
+ label: /*#__PURE__*/_jsx(DisplayHeaderLabel, {
120
+ type: 6,
121
+ isCustomized: isCustomized
122
+ }),
106
123
  group: "typography",
107
- value: "small"
108
- }];
124
+ value: "headingSix"
125
+ }, {
126
+ id: 20,
127
+ format: "paragraphOne",
128
+ type: "block",
129
+ title: /*#__PURE__*/_jsx(Label, {
130
+ label: "P1",
131
+ type: "Paragraph",
132
+ translation: translation
133
+ }),
134
+ label: /*#__PURE__*/_jsx(DisplayHeaderLabel, {
135
+ type: 1,
136
+ isCustomized: isCustomized,
137
+ isPara: true
138
+ }),
139
+ group: "typography",
140
+ value: "paragraphOne"
141
+ }, {
142
+ id: 21,
143
+ format: "paragraphTwo",
144
+ type: "block",
145
+ title: /*#__PURE__*/_jsx(Label, {
146
+ label: "P2",
147
+ type: "Paragraph",
148
+ translation: translation
149
+ }),
150
+ label: /*#__PURE__*/_jsx(DisplayHeaderLabel, {
151
+ type: 2,
152
+ isCustomized: isCustomized,
153
+ isPara: true
154
+ }),
155
+ group: "typography",
156
+ value: "paragraphTwo"
157
+ }, {
158
+ id: 22,
159
+ format: "paragraphThree",
160
+ type: "block",
161
+ title: /*#__PURE__*/_jsx(Label, {
162
+ label: "P3",
163
+ type: "Paragraph",
164
+ translation: translation
165
+ }),
166
+ label: /*#__PURE__*/_jsx(DisplayHeaderLabel, {
167
+ type: 3,
168
+ isCustomized: isCustomized,
169
+ isPara: true
170
+ }),
171
+ group: "typography",
172
+ value: "paragraphThree"
173
+ }
174
+ // {
175
+ // id: 14,
176
+ // format: "fontSize",
177
+ // type: "mark",
178
+ // title: <Label label="L" type="Large" />,
179
+ // label: "L",
180
+ // group: "typography",
181
+ // value: "huge",
182
+ // },
183
+ // {
184
+ // id: 15,
185
+ // format: "fontSize",
186
+ // type: "mark",
187
+ // title: <Label label="M" type="Medium" />,
188
+ // label: "M",
189
+ // group: "typography",
190
+ // value: "medium",
191
+ // },
192
+ // {
193
+ // id: 16,
194
+ // format: "fontSize",
195
+ // type: "mark",
196
+ // title: <Label label="S" type="Small" />,
197
+ // label: "S",
198
+ // group: "typography",
199
+ // value: "small",
200
+ // },
201
+ ];
202
+
203
+ return typographyOptions;
109
204
  }
110
205
  function SelectTypography({
111
206
  editor,
112
207
  classes,
113
208
  closeMainPopup,
209
+ type,
114
210
  customProps
115
211
  }) {
116
212
  const [size] = useWindowResize();
213
+ const {
214
+ theme
215
+ } = useEditorTheme();
117
216
  const {
118
217
  translation
119
218
  } = customProps;
120
- const typographyOptions = getTypographyOptions(translation);
219
+ const isTextCustomized = theme?.id ? isCustomized(editor) : false;
220
+ const typographyOptions = getTypographyOptions(isTextCustomized, translation);
121
221
  const updateMarkData = newVal => {
122
222
  const val = activeMark(editor, "fontSize");
123
223
  let upData = {
@@ -139,7 +239,10 @@ function SelectTypography({
139
239
  ...upData
140
240
  }
141
241
  });
242
+
243
+ // closeMainPopup();
142
244
  };
245
+
143
246
  const selectedBlock = useMemo(() => {
144
247
  return typographyOptions.find(t => {
145
248
  if (t.type === "block") {
@@ -161,15 +264,13 @@ function SelectTypography({
161
264
  });
162
265
  }, [typographyOptions, activeMark, isBlockActive, editor]);
163
266
  const onChange = (format, option) => {
164
- // add/reset block elements
165
- toggleBlock(editor, format);
166
267
  if (option.type === "block") {
167
- // reset old font size
168
- // let updatedValue = !selectedBlock ? {} : { xs: "16px", sm: "16px", md: "16px", lg: "16px" }
169
- addMarkData(editor, {
170
- format: "fontSize",
171
- value: {}
268
+ themeFields.forEach(field => {
269
+ Editor.removeMark(editor, field);
172
270
  });
271
+
272
+ // add/reset block elements
273
+ toggleBlock(editor, format);
173
274
  } else if (option.type === "mark") {
174
275
  const size = sizeMap[option.value] || "";
175
276
  const [sizeInNumber] = size.split("px");
@@ -177,11 +278,35 @@ function SelectTypography({
177
278
  }
178
279
  closeMainPopup();
179
280
  };
281
+ const typographyValue = selectedBlock?.value || "headingOne";
282
+ if (type === "fullWidth") {
283
+ return /*#__PURE__*/_jsx(Select, {
284
+ value: typographyValue,
285
+ className: "editor-dd",
286
+ onChange: e => {
287
+ const {
288
+ value
289
+ } = e.target;
290
+ const option = typographyOptions?.find(o => o.value === value);
291
+ onChange(value, option);
292
+ },
293
+ style: {
294
+ width: "100%",
295
+ height: "36px",
296
+ borderRadius: "10px",
297
+ fontSize: "14px"
298
+ },
299
+ children: typographyOptions.map((item, index) => /*#__PURE__*/_jsxs(MenuItem, {
300
+ value: item.value,
301
+ children: [item.title, " ", isTextCustomized && item.value === typographyValue ? " *" : ""]
302
+ }, index))
303
+ });
304
+ }
180
305
  return /*#__PURE__*/_jsx(CustomSelectTool, {
181
306
  options: typographyOptions,
182
307
  editor: editor,
183
308
  onChange: onChange,
184
- value: selectedBlock?.value || "headingOne",
309
+ value: typographyValue,
185
310
  classes: classes
186
311
  });
187
312
  }
@@ -1,9 +1,9 @@
1
- import { Fade, Grid, IconButton, Paper, Popper } from "@mui/material";
1
+ import { Fade, Grid, IconButton, Paper, Popper, useTheme } from "@mui/material";
2
2
  import SelectTypography from "./SelectTypography";
3
3
  import SelectList from "./SelectList";
4
4
  import { toolbarGroups } from "../../toolbarGroups";
5
5
  import { MarkButton } from "../../FormatTools";
6
- import { activeMark, isBlockActive } from "../../../utils/SlateUtilityFunctions";
6
+ import { activeMark, getListType, isBlockActive } from "../../../utils/SlateUtilityFunctions";
7
7
  import LinkButton from "../../../Elements/Link/LinkButton";
8
8
  import TextToolIcon from "../../../assets/svg/TextToolIcon";
9
9
  import TextFormat from "../TextFormat";
@@ -14,7 +14,7 @@ import MiniColorPicker from "./MiniColorPicker";
14
14
  import SelectAlignment from "./SelectAlignment";
15
15
  import SelectFontSize from "./SelectFontSize";
16
16
  import InfinityAITool from "./InfinityAITool";
17
- import { viewSlateSelection } from "../../../utils/helper";
17
+ import { getSelectedElementColor, viewSlateSelection } from "../../../utils/helper";
18
18
  import { jsx as _jsx } from "react/jsx-runtime";
19
19
  import { jsxs as _jsxs } from "react/jsx-runtime";
20
20
  const DEFAULT_COLOR = {
@@ -34,12 +34,18 @@ const MiniTextFormat = props => {
34
34
  const [anchorEl, setAnchorEl] = useState(null);
35
35
  const open = Boolean(anchorEl);
36
36
  const id = open ? "popup-edit-tool" : "";
37
+ const [resizedSize, setResizedSize] = useState();
37
38
  const [size] = useWindowResize();
39
+ const theme = useTheme();
40
+ const listType = getListType(editor);
41
+ const commonProps = {
42
+ listType
43
+ };
38
44
  const removeFontStyles = ["superscript", "subscript"];
39
45
  const fontStyle = allTools.filter(f => f.type === "mark" && !removeFontStyles.includes(f.format));
40
46
  const link = allTools.find(f => f.format?.indexOf("link") >= 0);
41
47
  const fontAlign = allTools.filter(f => f.format?.indexOf("align") >= 0);
42
- const activeColor = activeMark(editor, textColorFormat) || DEFAULT_COLOR[textColorFormat];
48
+ const activeColor = getSelectedElementColor(editor, textColorFormat, theme);
43
49
  const activeBg = activeMark(editor, textBgFormat) || DEFAULT_COLOR[textBgFormat];
44
50
  return /*#__PURE__*/_jsx(Grid, {
45
51
  container: true,
@@ -57,6 +63,7 @@ const MiniTextFormat = props => {
57
63
  classes: classes,
58
64
  editor: editor,
59
65
  closeMainPopup: closeMainPopup,
66
+ type: "miniToolBar",
60
67
  customProps: customProps
61
68
  }), /*#__PURE__*/_jsx("div", {
62
69
  className: "verticalLine"
@@ -64,7 +71,8 @@ const MiniTextFormat = props => {
64
71
  classes: classes,
65
72
  editor: editor,
66
73
  closeMainPopup: closeMainPopup,
67
- customProps: customProps
74
+ customProps: customProps,
75
+ commonProps: commonProps
68
76
  }), /*#__PURE__*/_jsx("div", {
69
77
  className: "verticalLine mr-1"
70
78
  }), /*#__PURE__*/_jsx(SelectAlignment, {
@@ -77,7 +85,10 @@ const MiniTextFormat = props => {
77
85
  className: "verticalLine mr-1"
78
86
  }), /*#__PURE__*/_jsx(SelectFontSize, {
79
87
  classes: classes,
80
- editor: editor
88
+ editor: editor,
89
+ fromMiniTextFormat: true,
90
+ setResizedSize: setResizedSize,
91
+ resizedSize: resizedSize
81
92
  }), /*#__PURE__*/_jsx("div", {
82
93
  className: "verticalLine mr-1"
83
94
  }), fontStyle?.map((m, i) => {
@@ -92,7 +103,8 @@ const MiniTextFormat = props => {
92
103
  activeColor: activeColor,
93
104
  id: "11_cc",
94
105
  editor: editor,
95
- customProps: customProps
106
+ customProps: customProps,
107
+ type: "textColor"
96
108
  }), /*#__PURE__*/_jsx(MiniColorPicker, {
97
109
  format: textBgFormat,
98
110
  classes: classes,
@@ -138,7 +150,11 @@ const MiniTextFormat = props => {
138
150
  editor: editor,
139
151
  classes: classes,
140
152
  closeMainPopup: closeMainPopup,
141
- customProps: customProps
153
+ customProps: customProps,
154
+ commonProps: commonProps,
155
+ fromMiniTextFormat: true,
156
+ setResizedSize: setResizedSize,
157
+ resizedSize: resizedSize
142
158
  })]
143
159
  })
144
160
  })
@@ -50,7 +50,8 @@ const PopperHeader = props => {
50
50
  padding: 2,
51
51
  className: "headerContainer",
52
52
  style: {
53
- paddingTop: "5px"
53
+ paddingTop: "5px",
54
+ paddingBottom: "0px"
54
55
  },
55
56
  children: /*#__PURE__*/_jsxs(Grid, {
56
57
  item: true,