@flozy/editor 10.4.9 → 10.5.1

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 (192) hide show
  1. package/dist/Editor/ChatEditor.js +16 -17
  2. package/dist/Editor/CommonEditor.js +18 -134
  3. package/dist/Editor/DialogWrapper.js +25 -31
  4. package/dist/Editor/Editor.css +8 -46
  5. package/dist/Editor/Elements/AI/PopoverAIInput.js +3 -11
  6. package/dist/Editor/Elements/Accordion/Accordion.js +9 -46
  7. package/dist/Editor/Elements/Accordion/AccordionSummary.js +23 -1
  8. package/dist/Editor/Elements/AppHeader/AppHeader.js +5 -10
  9. package/dist/Editor/Elements/Button/EditorButton.js +10 -26
  10. package/dist/Editor/Elements/Carousel/CarouselItem.js +1 -2
  11. package/dist/Editor/Elements/Color Picker/ColorButtons.js +14 -61
  12. package/dist/Editor/Elements/Color Picker/ColorPicker.css +1 -25
  13. package/dist/Editor/Elements/Color Picker/ColorPicker.js +7 -10
  14. package/dist/Editor/Elements/Color Picker/Styles.js +13 -15
  15. package/dist/Editor/Elements/DataView/Layouts/ColumnView.js +2 -4
  16. package/dist/Editor/Elements/DataView/Layouts/DataTypes/MultiSelectType.js +11 -26
  17. package/dist/Editor/Elements/DataView/Layouts/DataTypes/SelectType.js +9 -28
  18. package/dist/Editor/Elements/DataView/Layouts/Options/AddOptions.js +6 -17
  19. package/dist/Editor/Elements/DataView/Layouts/Options/EditOption.js +16 -43
  20. package/dist/Editor/Elements/DataView/Layouts/Options/index.js +0 -11
  21. package/dist/Editor/Elements/DataView/Layouts/ViewData.js +4 -8
  22. package/dist/Editor/Elements/Embed/Image.js +2 -3
  23. package/dist/Editor/Elements/Embed/Video.js +1 -1
  24. package/dist/Editor/Elements/EmbedScript/Code.js +2 -14
  25. package/dist/Editor/Elements/EmbedScript/EmbedScriptPopup.js +28 -57
  26. package/dist/Editor/Elements/Form/Form.js +171 -184
  27. package/dist/Editor/Elements/Form/FormElements/FormText.js +6 -23
  28. package/dist/Editor/Elements/Form/FormElements/FormTextArea.js +2 -2
  29. package/dist/Editor/Elements/Form/FormField.js +6 -13
  30. package/dist/Editor/Elements/Form/Workflow/Styles.js +22 -24
  31. package/dist/Editor/Elements/FreeGrid/FreeGrid.js +35 -41
  32. package/dist/Editor/Elements/FreeGrid/FreeGridBox.js +4 -7
  33. package/dist/Editor/Elements/FreeGrid/FreeGridItem.js +0 -1
  34. package/dist/Editor/Elements/FreeGrid/Options/More.js +8 -8
  35. package/dist/Editor/Elements/FreeGrid/styles.js +7 -75
  36. package/dist/Editor/Elements/Grid/Grid.js +2 -14
  37. package/dist/Editor/Elements/Grid/GridItem.js +1 -1
  38. package/dist/Editor/Elements/List/CheckList.js +2 -3
  39. package/dist/Editor/Elements/Search/SearchAttachment.js +9 -40
  40. package/dist/Editor/Elements/Search/SearchButton.js +8 -9
  41. package/dist/Editor/Elements/Search/SearchList.js +7 -9
  42. package/dist/Editor/Elements/Signature/Signature.css +1 -2
  43. package/dist/Editor/Elements/Signature/SignatureOptions/DrawSignature.js +5 -18
  44. package/dist/Editor/Elements/Signature/SignatureOptions/UploadSignature.js +3 -16
  45. package/dist/Editor/Elements/SimpleText/index.js +1 -6
  46. package/dist/Editor/Elements/SimpleText/style.js +2 -2
  47. package/dist/Editor/Elements/Table/AddRowCol.js +2 -8
  48. package/dist/Editor/Elements/Table/DragButton.js +1 -0
  49. package/dist/Editor/Elements/Table/Draggable.js +2 -6
  50. package/dist/Editor/Elements/Table/Styles.js +0 -7
  51. package/dist/Editor/Elements/Table/Table.js +3 -3
  52. package/dist/Editor/Elements/Table/TableCell.js +8 -31
  53. package/dist/Editor/Elements/Title/title.js +6 -6
  54. package/dist/Editor/Elements/Variables/VariableButton.js +1 -10
  55. package/dist/Editor/MiniEditor.js +1 -2
  56. package/dist/Editor/Styles/EditorStyles.js +5 -5
  57. package/dist/Editor/Toolbar/FormatTools/Dropdown.js +3 -27
  58. package/dist/Editor/Toolbar/FormatTools/FontFamilyAutocomplete.js +3 -4
  59. package/dist/Editor/Toolbar/FormatTools/MarkButton.js +2 -2
  60. package/dist/Editor/Toolbar/FormatTools/TextSize.js +13 -10
  61. package/dist/Editor/Toolbar/Mini/MiniToolbar.js +1 -2
  62. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/MiniColorPicker.js +2 -4
  63. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectFontSize.js +13 -6
  64. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectTypography.js +42 -167
  65. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/index.js +4 -7
  66. package/dist/Editor/Toolbar/PopupTool/PopperHeader.js +1 -2
  67. package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +12 -72
  68. package/dist/Editor/Toolbar/PopupTool/TextFormat.js +27 -100
  69. package/dist/Editor/Toolbar/PopupTool/index.js +1 -1
  70. package/dist/Editor/Toolbar/toolbarGroups.js +6 -48
  71. package/dist/Editor/assets/svg/SettingsIcon.js +0 -1
  72. package/dist/Editor/common/ColorPickerButton.js +16 -41
  73. package/dist/Editor/common/DnD/DragHandleButton.js +1 -1
  74. package/dist/Editor/common/FontLoader/FontLoader.js +0 -3
  75. package/dist/Editor/common/Icon.js +1 -31
  76. package/dist/Editor/common/ImageSelector/ImageSelector.js +2 -2
  77. package/dist/Editor/common/ImageSelector/Styles.js +9 -3
  78. package/dist/Editor/common/LinkSettings/NavComponents.js +55 -61
  79. package/dist/Editor/common/LinkSettings/index.js +80 -82
  80. package/dist/Editor/common/LinkSettings/navOptions.js +2 -2
  81. package/dist/Editor/common/LinkSettings/style.js +74 -209
  82. package/dist/Editor/common/MentionsPopup/index.js +1 -4
  83. package/dist/Editor/common/RnD/ElementOptions/Actions.js +15 -13
  84. package/dist/Editor/common/RnD/ElementOptions/Icons/LinkIcon.js +0 -1
  85. package/dist/Editor/common/RnD/ElementOptions/index.js +2 -2
  86. package/dist/Editor/common/RnD/ElementOptions/styles.js +1 -28
  87. package/dist/Editor/common/RnD/ElementSettings/OtherSettings/Settings.js +5 -6
  88. package/dist/Editor/common/RnD/ElementSettings/OtherSettings/Signature.js +3 -4
  89. package/dist/Editor/common/RnD/ElementSettings/Settings/AppHeaderSettings.js +2 -3
  90. package/dist/Editor/common/RnD/ElementSettings/Settings/BoxSettings.js +2 -3
  91. package/dist/Editor/common/RnD/ElementSettings/Settings/ButtonSettings.js +2 -3
  92. package/dist/Editor/common/RnD/ElementSettings/Settings/CodeSettings.js +2 -3
  93. package/dist/Editor/common/RnD/ElementSettings/Settings/FormSettings.js +2 -4
  94. package/dist/Editor/common/RnD/ElementSettings/Settings/ImageSettings.js +2 -3
  95. package/dist/Editor/common/RnD/ElementSettings/Settings/TableSettings.js +2 -3
  96. package/dist/Editor/common/RnD/ElementSettings/Settings/TextSettings.js +1 -3
  97. package/dist/Editor/common/RnD/ElementSettings/Settings/VideoSettings.js +2 -3
  98. package/dist/Editor/common/RnD/ElementSettings/styles.js +12 -146
  99. package/dist/Editor/common/RnD/OptionsPopup/index.js +5 -8
  100. package/dist/Editor/common/RnD/OptionsPopup/style.js +19 -120
  101. package/dist/Editor/common/RnD/SwitchViewport/SwitchViewport.js +5 -8
  102. package/dist/Editor/common/RnD/Theme/ViewportStimulator.js +3 -6
  103. package/dist/Editor/common/RnD/Utils/gridDropItem.js +19 -28
  104. package/dist/Editor/common/RnD/Utils/index.js +1 -3
  105. package/dist/Editor/common/RnD/VirtualElement/VirtualTextElement.js +58 -42
  106. package/dist/Editor/common/RnD/VirtualElement/helper.js +132 -323
  107. package/dist/Editor/common/RnD/VirtualElement/styles.js +0 -16
  108. package/dist/Editor/common/RnD/index.js +38 -67
  109. package/dist/Editor/common/Select/index.js +5 -44
  110. package/dist/Editor/common/Select/styles.js +2 -30
  111. package/dist/Editor/common/Shorthands/elements.js +11 -65
  112. package/dist/Editor/common/StyleBuilder/accordionTitleBtnStyle.js +2 -2
  113. package/dist/Editor/common/StyleBuilder/accordionTitleStyle.js +9 -12
  114. package/dist/Editor/common/StyleBuilder/buttonStyle.js +2 -4
  115. package/dist/Editor/common/StyleBuilder/embedVideoStyle.js +0 -4
  116. package/dist/Editor/common/StyleBuilder/fieldTypes/backgroundImage.js +0 -5
  117. package/dist/Editor/common/StyleBuilder/fieldTypes/bannerSpacing.js +2 -12
  118. package/dist/Editor/common/StyleBuilder/fieldTypes/borderRadius.js +7 -15
  119. package/dist/Editor/common/StyleBuilder/fieldTypes/card.js +8 -16
  120. package/dist/Editor/common/StyleBuilder/fieldTypes/color.js +10 -36
  121. package/dist/Editor/common/StyleBuilder/fieldTypes/fontSize.js +7 -16
  122. package/dist/Editor/common/StyleBuilder/fieldTypes/index.js +1 -3
  123. package/dist/Editor/common/StyleBuilder/fieldTypes/lineSpacing.js +6 -7
  124. package/dist/Editor/common/StyleBuilder/fieldTypes/menusArray.js +6 -13
  125. package/dist/Editor/common/StyleBuilder/fieldTypes/textOptions.js +7 -15
  126. package/dist/Editor/common/StyleBuilder/pageSettingsStyle.js +7 -5
  127. package/dist/Editor/common/SwipeableDrawer/style.js +12 -14
  128. package/dist/Editor/common/Uploader.js +0 -16
  129. package/dist/Editor/common/iconListV2.js +6 -177
  130. package/dist/Editor/common/iconslist.js +0 -24
  131. package/dist/Editor/commonStyle.js +62 -186
  132. package/dist/Editor/helper/index.js +1 -5
  133. package/dist/Editor/helper/theme.js +2 -203
  134. package/dist/Editor/hooks/useMouseMove.js +5 -8
  135. package/dist/Editor/hooks/useTable.js +4 -5
  136. package/dist/Editor/plugins/withEmbeds.js +1 -1
  137. package/dist/Editor/plugins/withHTML.js +1 -3
  138. package/dist/Editor/plugins/withTable.js +1 -1
  139. package/dist/Editor/theme/ThemeList.js +173 -50
  140. package/dist/Editor/utils/SlateUtilityFunctions.js +46 -172
  141. package/dist/Editor/utils/accordion.js +4 -14
  142. package/dist/Editor/utils/button.js +17 -1
  143. package/dist/Editor/utils/customHooks/useTableResize.js +9 -49
  144. package/dist/Editor/utils/draftToSlate.js +2 -3
  145. package/dist/Editor/utils/events.js +6 -50
  146. package/dist/Editor/utils/font.js +37 -40
  147. package/dist/Editor/utils/form.js +4 -4
  148. package/dist/Editor/utils/formfield.js +2 -9
  149. package/dist/Editor/utils/helper.js +26 -215
  150. package/dist/Editor/utils/insertAppHeader.js +1 -1
  151. package/dist/Editor/utils/signature.js +9 -2
  152. package/package.json +4 -4
  153. package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/SelectV1.js +0 -510
  154. package/dist/Editor/Elements/EmbedScript/styles.js +0 -89
  155. package/dist/Editor/Elements/FreeGrid/helper.js +0 -115
  156. package/dist/Editor/Toolbar/PopupTool/ThemeTextFormat.js +0 -439
  157. package/dist/Editor/assets/svg/BackIcon.js +0 -18
  158. package/dist/Editor/assets/svg/ClearAllRounded.js +0 -31
  159. package/dist/Editor/assets/svg/ResetIconNew.js +0 -23
  160. package/dist/Editor/assets/svg/ThemeIcons.js +0 -293
  161. package/dist/Editor/common/Checkbox/index.js +0 -46
  162. package/dist/Editor/common/Checkbox/styles.js +0 -45
  163. package/dist/Editor/common/CustomColorPicker/index.js +0 -130
  164. package/dist/Editor/common/CustomColorPicker/style.js +0 -53
  165. package/dist/Editor/common/CustomDialog2/index.js +0 -94
  166. package/dist/Editor/common/CustomDialog2/style.js +0 -67
  167. package/dist/Editor/common/CustomSelect.js +0 -43
  168. package/dist/Editor/common/RadioGroup/index.js +0 -48
  169. package/dist/Editor/common/RadioGroup/styles.js +0 -29
  170. package/dist/Editor/common/RnD/Theme/MainThemeProvider.js +0 -17
  171. package/dist/Editor/common/SnackBar/index.js +0 -43
  172. package/dist/Editor/common/StyleBuilder/fieldTypes/embedUpload.js +0 -115
  173. package/dist/Editor/helper/textIndeces.js +0 -58
  174. package/dist/Editor/hooks/useEditorTheme.js +0 -153
  175. package/dist/Editor/hooks/useThemeValues.js +0 -63
  176. package/dist/Editor/theme/index.js +0 -149
  177. package/dist/Editor/themeSettings/ActiveTheme.js +0 -82
  178. package/dist/Editor/themeSettings/buttons/index.js +0 -300
  179. package/dist/Editor/themeSettings/buttons/style.js +0 -23
  180. package/dist/Editor/themeSettings/colorTheme/index.js +0 -310
  181. package/dist/Editor/themeSettings/colorTheme/style.js +0 -81
  182. package/dist/Editor/themeSettings/fonts/PreviewElement.js +0 -121
  183. package/dist/Editor/themeSettings/fonts/index.js +0 -240
  184. package/dist/Editor/themeSettings/fonts/style.js +0 -62
  185. package/dist/Editor/themeSettings/icons.js +0 -60
  186. package/dist/Editor/themeSettings/index.js +0 -380
  187. package/dist/Editor/themeSettings/style.js +0 -299
  188. package/dist/Editor/themeSettingsAI/icons.js +0 -96
  189. package/dist/Editor/themeSettingsAI/index.js +0 -355
  190. package/dist/Editor/themeSettingsAI/saveTheme.js +0 -202
  191. package/dist/Editor/themeSettingsAI/style.js +0 -332
  192. package/dist/Editor/utils/updateFormName.js +0 -22
@@ -1,115 +0,0 @@
1
- import { ROW_HEIGHT } from "../../common/RnD/Utils/gridDropItem";
2
- import { getElementOffset } from "../../common/RnD/VirtualElement/VirtualTextElement";
3
- import { RND_ITEMS } from "../../helper";
4
- export const ELEMENT_CASE = {
5
- ADD_TEXT: "addText",
6
- ADD_BUTTON: "addButton",
7
- ADD_SIGNATURE: "addSignature",
8
- ADD_IMAGE: "addImage",
9
- ADD_VIDEO: "addVideo",
10
- ADD_TABLE: "addTable",
11
- ADD_CODE: "addCode",
12
- ADD_BOX: "addBox",
13
- ADD_FORM: "addForm",
14
- ADD_APP_HEADER: "addAppHeader",
15
- ADD_DIVIDER: "addDivider"
16
- };
17
- const commonXsValues = {
18
- top_xs: 0,
19
- marginTop_xs: 12,
20
- left_xs: 24,
21
- width_xs: 272,
22
- xs_updatedOn: new Date().getTime()
23
- };
24
- const elementXsValues = {
25
- [ELEMENT_CASE.ADD_TEXT]: {
26
- ...commonXsValues,
27
- height_xs: 50
28
- },
29
- [ELEMENT_CASE.ADD_BUTTON]: {
30
- ...commonXsValues,
31
- height_xs: 50
32
- },
33
- [ELEMENT_CASE.ADD_SIGNATURE]: {
34
- ...commonXsValues,
35
- height_xs: 173
36
- },
37
- [ELEMENT_CASE.ADD_IMAGE]: {
38
- ...commonXsValues,
39
- height_xs: 80
40
- },
41
- [ELEMENT_CASE.ADD_VIDEO]: {
42
- ...commonXsValues,
43
- height_xs: 300
44
- },
45
- [ELEMENT_CASE.ADD_TABLE]: {
46
- ...commonXsValues,
47
- height_xs: 165
48
- },
49
- [ELEMENT_CASE.ADD_CODE]: {
50
- ...commonXsValues,
51
- height: 300
52
- },
53
- [ELEMENT_CASE.ADD_BOX]: {
54
- ...commonXsValues,
55
- height_xs: 300
56
- },
57
- [ELEMENT_CASE.ADD_FORM]: {
58
- ...commonXsValues,
59
- height_xs: 80
60
- },
61
- [ELEMENT_CASE.ADD_APP_HEADER]: {
62
- ...commonXsValues,
63
- height_xs: 80
64
- },
65
- [ELEMENT_CASE.ADD_DIVIDER]: {
66
- ...commonXsValues,
67
- height_xs: 24
68
- }
69
- };
70
- export const findMaxYValue = (sectionItems, breakpoint) => {
71
- let maxY = 0;
72
- sectionItems.forEach(item => {
73
- const isHidden = breakpoint === "xs" && item.children.some(c => c.xsHidden);
74
- if (item?.type && RND_ITEMS.includes(item.type) && !isHidden) {
75
- const {
76
- bottom
77
- } = getElementOffset(item, breakpoint === "lg" ? "lg" : "xs");
78
- maxY = Math.max(maxY, bottom);
79
- }
80
- });
81
- return maxY;
82
- };
83
- export const convertToGridArea = y => {
84
- // Calculate grid position
85
- const row = Math.floor(y / ROW_HEIGHT) + 1;
86
-
87
- // to calculate difference inside the grid
88
- const marginTop = Math.abs((row - 1) * ROW_HEIGHT - y);
89
-
90
- // Update grid area
91
- const gridArea = `${row} / 1 / ${row + 1} / 2`;
92
- return {
93
- gridArea,
94
- marginTop
95
- };
96
- };
97
- export const getNewElementXsValues = (type, sectionItems) => {
98
- const values = elementXsValues[type] || {};
99
- const y = sectionItems?.length ? findMaxYValue(sectionItems) : 0;
100
- const {
101
- gridArea,
102
- marginTop
103
- } = convertToGridArea(y);
104
- const BUFFER_MARGIN_TOP = 12;
105
- const xsVal = {
106
- ...values,
107
- gridArea_xs: gridArea,
108
- marginTop_xs: marginTop + BUFFER_MARGIN_TOP
109
- };
110
- const sectionHeightXs = y + values?.height_xs + BUFFER_MARGIN_TOP + 12;
111
- return {
112
- xsVal,
113
- sectionHeightXs
114
- };
115
- };
@@ -1,439 +0,0 @@
1
- import { Box, Button, Divider, Grid, IconButton, Popover, TextField, Tooltip, Typography } from "@mui/material";
2
- import { useEditorContext } from "../../hooks/useMouseMove";
3
- // import FormatClearIcon from "@mui/icons-material/FormatClear";
4
- import usePopupStyles from "../PopupTool/PopupToolStyle";
5
- import { TextMinusIcon, TextPlusIcon } from "../../common/iconslist";
6
- import { BREAKPOINTS_DEVICES, getBreakPointsValue, getVariableValue } from "../../helper/theme";
7
- import useWindowResize from "../../hooks/useWindowResize";
8
- import { toolbarGroups } from "../toolbarGroups";
9
- import Icon from "../../common/Icon";
10
- import { useMemo, useState } from "react";
11
- import CommonButton from "../../common/Button";
12
- import CustomSelect from "../../common/CustomSelect";
13
- import ColorButtons from "../../Elements/Color Picker/ColorButtons";
14
- // import FormatColorResetIcon from "@mui/icons-material/FormatColorReset";
15
- import ColorPickerStyles from "../../Elements/Color Picker/Styles";
16
- import colorWheel from "../../Elements/Color Picker/colorWheel.png";
17
- import CustomColorPicker from "../../common/CustomColorPicker";
18
- import FontFamilyAutocomplete from "../FormatTools/FontFamilyAutocomplete";
19
- import { googleFontList as defaultFonts } from "../../common/FontLoader/FontList";
20
- import { ColorResetIcon, TextDefaultStyleIcon } from "../../common/iconListV2";
21
- import { fontFamilyMap } from "../../utils/font";
22
- import { jsx as _jsx } from "react/jsx-runtime";
23
- import { jsxs as _jsxs } from "react/jsx-runtime";
24
- import { Fragment as _Fragment } from "react/jsx-runtime";
25
- function getFontStyleProps(settings = {}, format) {
26
- const {
27
- fontWeight,
28
- fontStyle
29
- } = settings;
30
- let isActive;
31
- let onClick;
32
- switch (format) {
33
- case "bold":
34
- isActive = fontWeight === "bold" || fontWeight === "700";
35
- onClick = () => {
36
- return {
37
- fontWeight: isActive ? "normal" : "bold"
38
- };
39
- };
40
- break;
41
- case "italic":
42
- isActive = fontStyle === "italic";
43
- onClick = () => {
44
- return {
45
- fontStyle: isActive ? "unset" : "italic"
46
- };
47
- };
48
- break;
49
-
50
- // case "underline":
51
- // isActive = textDecoration.includes("underline");
52
- // onClick = () => {
53
- // let otherTextDecoration = textDecoration?.includes("line-through")
54
- // ? "line-through"
55
- // : "";
56
-
57
- // otherTextDecoration += isActive ? "" : " underline";
58
-
59
- // return { textDecoration: otherTextDecoration };
60
- // };
61
- // break;
62
- // case "strikethrough":
63
- // isActive = textDecoration.includes("line-through");
64
- // onClick = () => {
65
- // let otherTextDecoration = textDecoration?.includes("underline")
66
- // ? "underline"
67
- // : "";
68
-
69
- // otherTextDecoration += isActive ? "" : " line-through";
70
-
71
- // return { textDecoration: otherTextDecoration };
72
- // };
73
- // break;
74
-
75
- default:
76
- isActive = false;
77
- onClick = () => {};
78
- break;
79
- }
80
- return {
81
- isActive,
82
- onClick
83
- };
84
- }
85
- const allTools = toolbarGroups.flat();
86
- function ThemeTextFormat(props) {
87
- const {
88
- settings,
89
- updateSettings,
90
- onSaveTextSettings,
91
- onClose
92
- } = props;
93
- const {
94
- theme,
95
- fontFamilies
96
- } = useEditorContext();
97
- const classes = usePopupStyles(theme);
98
- const pickerStyles = ColorPickerStyles(theme);
99
- const fontStyle = allTools.filter(f => f.type === "mark" && f.themeEnabled);
100
- const fontWeight = allTools.find(f => f.format === "fontWeight");
101
- const fontFamilyVal = useMemo(() => {
102
- const {
103
- fontFamily = ""
104
- } = settings;
105
- let font = fontFamily.startsWith("var") ? getVariableValue(fontFamily) : fontFamily;
106
- return font;
107
- }, [settings]);
108
- const fontWeightVal = useMemo(() => {
109
- const {
110
- options
111
- } = fontWeight || {};
112
- const selected = options?.find(o => o.value === settings?.fontWeight || o.numVal === settings?.fontWeight);
113
- return selected?.value;
114
- }, [settings?.fontWeight]);
115
- return /*#__PURE__*/_jsxs(Box, {
116
- sx: classes.textFormatContainer,
117
- children: [/*#__PURE__*/_jsxs(Grid, {
118
- container: true,
119
- sx: classes.textFormatWrapper,
120
- children: [/*#__PURE__*/_jsxs(Grid, {
121
- item: true,
122
- xs: 12,
123
- children: [/*#__PURE__*/_jsxs(Grid, {
124
- container: true,
125
- justifyContent: "space-between",
126
- alignItems: "center",
127
- children: [/*#__PURE__*/_jsx(Grid, {
128
- item: true,
129
- children: /*#__PURE__*/_jsx(Typography, {
130
- variant: "body1",
131
- color: "primary",
132
- sx: classes.typoLabel,
133
- children: "Font Family"
134
- })
135
- }), /*#__PURE__*/_jsx(Grid, {
136
- item: true,
137
- children: /*#__PURE__*/_jsx(Button, {
138
- sx: classes.defaultBtn1,
139
- startIcon: /*#__PURE__*/_jsx(TextDefaultStyleIcon, {}),
140
- onClick: () => updateSettings({
141
- fontFamily: Object.values(fontFamilyMap)[0]
142
- }),
143
- className: "npr-0",
144
- children: "Default Text"
145
- })
146
- })]
147
- }), /*#__PURE__*/_jsx(Grid, {
148
- item: true,
149
- xs: 12,
150
- sx: classes.textFormatField,
151
- children: /*#__PURE__*/_jsx(FontFamilyAutocomplete, {
152
- editor: {},
153
- format: "fontFamily",
154
- options: fontFamilies?.options,
155
- width: "100%",
156
- onChange: updateSettings,
157
- val: fontFamilyVal || defaultFonts[0],
158
- webFont: true
159
- })
160
- })]
161
- }), /*#__PURE__*/_jsxs(Grid, {
162
- container: true,
163
- spacing: 2,
164
- children: [/*#__PURE__*/_jsxs(Grid, {
165
- item: true,
166
- xs: 6,
167
- children: [/*#__PURE__*/_jsx(Typography, {
168
- variant: "body1",
169
- color: "primary",
170
- sx: classes.typoLabel,
171
- children: "Font Weight"
172
- }), /*#__PURE__*/_jsx(Grid, {
173
- item: true,
174
- xs: 12,
175
- sx: classes.textFormatField,
176
- children: /*#__PURE__*/_jsx(CustomSelect, {
177
- options: fontWeight?.options || [],
178
- classes: classes,
179
- onChange: e => {
180
- updateSettings({
181
- fontWeight: e.target.value
182
- });
183
- },
184
- value: fontWeightVal
185
- })
186
- })]
187
- }), /*#__PURE__*/_jsxs(Grid, {
188
- item: true,
189
- xs: 6,
190
- children: [/*#__PURE__*/_jsx(Typography, {
191
- variant: "body1",
192
- color: "primary",
193
- sx: classes.typoLabel,
194
- children: "Font Size"
195
- }), /*#__PURE__*/_jsx(Grid, {
196
- item: true,
197
- xs: 12,
198
- sx: classes.textFormatCG,
199
- children: /*#__PURE__*/_jsx(TextSize, {
200
- classes: classes,
201
- value: settings?.fontSize || 16,
202
- onChange: fontSize => updateSettings({
203
- fontSize
204
- }),
205
- fullWidth: true
206
- })
207
- })]
208
- })]
209
- }), /*#__PURE__*/_jsx(Grid, {
210
- item: true,
211
- xs: 12,
212
- sx: classes.dividerGrid,
213
- children: /*#__PURE__*/_jsx(Divider, {})
214
- }), /*#__PURE__*/_jsxs(Grid, {
215
- item: true,
216
- xs: 12,
217
- children: [/*#__PURE__*/_jsxs(Grid, {
218
- container: true,
219
- justifyContent: "space-between",
220
- alignItems: "center",
221
- children: [/*#__PURE__*/_jsx(Grid, {
222
- item: true,
223
- children: /*#__PURE__*/_jsx(Typography, {
224
- variant: "body1",
225
- color: "primary",
226
- sx: classes.typoLabel,
227
- children: "Text Color"
228
- })
229
- }), /*#__PURE__*/_jsx(Grid, {
230
- item: true,
231
- children: /*#__PURE__*/_jsx(Button, {
232
- sx: classes.defaultBtn1,
233
- startIcon: /*#__PURE__*/_jsx(ColorResetIcon, {}),
234
- onClick: () => updateSettings({
235
- color: "#ddd"
236
- }),
237
- children: "Default Color"
238
- })
239
- })]
240
- }), /*#__PURE__*/_jsx(Grid, {
241
- sx: classes.textFormatColorWrpr,
242
- children: /*#__PURE__*/_jsx(ColorPicker, {
243
- classes: classes,
244
- pickerStyles: pickerStyles,
245
- onChange: color => updateSettings({
246
- color
247
- }),
248
- color: settings?.color,
249
- disableEditTheme: true
250
- })
251
- })]
252
- }), /*#__PURE__*/_jsx(Grid, {
253
- item: true,
254
- xs: 12,
255
- sx: classes.dividerGrid,
256
- children: /*#__PURE__*/_jsx(Divider, {})
257
- }), /*#__PURE__*/_jsxs(Grid, {
258
- item: true,
259
- xs: 12,
260
- children: [/*#__PURE__*/_jsx(Typography, {
261
- variant: "body1",
262
- color: "primary",
263
- sx: classes.typoLabel,
264
- children: "Typography"
265
- }), /*#__PURE__*/_jsx(Grid, {
266
- item: true,
267
- xs: 12,
268
- className: "typo-icons",
269
- sx: classes.evenSpace,
270
- children: fontStyle?.map((m, i) => {
271
- const {
272
- isActive,
273
- onClick
274
- } = getFontStyleProps(settings, m.format) || {};
275
- return /*#__PURE__*/_jsx(CommonButton, {
276
- active: isActive,
277
- onClick: () => {
278
- const style = onClick();
279
- updateSettings(style);
280
- },
281
- children: /*#__PURE__*/_jsx(Icon, {
282
- icon: m.format
283
- })
284
- }, i);
285
- })
286
- })]
287
- })]
288
- }), /*#__PURE__*/_jsxs("div", {
289
- className: "saveThemeBtnsWrapper",
290
- children: [/*#__PURE__*/_jsx(Button, {
291
- onClick: onClose,
292
- className: "closeBtn",
293
- style: {
294
- background: "none"
295
- },
296
- children: "Cancel"
297
- }), /*#__PURE__*/_jsx(Button, {
298
- onClick: onSaveTextSettings,
299
- className: "confirmBtn",
300
- children: "Save"
301
- })]
302
- })]
303
- });
304
- }
305
- export default ThemeTextFormat;
306
- function TextSize(props) {
307
- const {
308
- classes,
309
- value: val,
310
- onChange,
311
- fullWidth
312
- } = props;
313
- const [size] = useWindowResize();
314
- const value = getBreakPointsValue(val, size?.device);
315
- const updateMarkData = newVal => {
316
- let upData = {
317
- ...getBreakPointsValue(val),
318
- [size?.device]: `${newVal}px`
319
- };
320
-
321
- // if desktop update to all other devices
322
- // to avoid default normal size
323
- if (size?.device === "lg") {
324
- upData = BREAKPOINTS_DEVICES.reduce((a, b) => {
325
- a[b] = upData[b] || `${newVal}px`;
326
- return a;
327
- }, {});
328
- }
329
- onChange(upData);
330
- };
331
- const onChangeSize = e => {
332
- let inc = parseInt(e.target.value) || 8;
333
- inc = inc > 200 ? 200 : inc;
334
- updateMarkData(inc || 8);
335
- };
336
- const getSizeVal = () => {
337
- try {
338
- return parseInt(value);
339
- } catch (err) {
340
- return "";
341
- }
342
- };
343
- const combinedOldVal = getSizeVal();
344
- const onIncreaseSize = () => {
345
- let inc = (combinedOldVal || 0) + 1;
346
- inc = inc > 200 ? 200 : inc;
347
- updateMarkData(inc);
348
- };
349
- const onDecreaseSize = () => {
350
- const newVal = combinedOldVal - 1 < 0 ? 0 : combinedOldVal - 1;
351
- updateMarkData(newVal);
352
- };
353
- return /*#__PURE__*/_jsx(TextField, {
354
- sx: classes?.textSize,
355
- value: combinedOldVal,
356
- onChange: onChangeSize,
357
- size: "small",
358
- inputProps: {
359
- style: {
360
- width: fullWidth ? "100%" : "30px",
361
- textAlign: "center",
362
- height: "19px",
363
- fontSize: "14px"
364
- }
365
- },
366
- fullWidth: fullWidth,
367
- InputProps: {
368
- style: {
369
- borderRadius: "8px"
370
- },
371
- endAdornment: /*#__PURE__*/_jsxs("div", {
372
- className: "textFontArrows",
373
- children: [/*#__PURE__*/_jsx(IconButton, {
374
- onClick: onIncreaseSize,
375
- size: "small",
376
- children: /*#__PURE__*/_jsx(TextPlusIcon, {})
377
- }), /*#__PURE__*/_jsx(IconButton, {
378
- onClick: onDecreaseSize,
379
- size: "small",
380
- children: /*#__PURE__*/_jsx(TextMinusIcon, {})
381
- })]
382
- })
383
- }
384
- });
385
- }
386
- function ColorPicker(props) {
387
- const {
388
- classes,
389
- pickerStyles,
390
- onChange,
391
- color,
392
- disableEditTheme
393
- } = props;
394
- const [anchorEl, setAnchorEl] = useState(null);
395
- const open = Boolean(anchorEl);
396
- const handleClose = () => {
397
- setAnchorEl(null);
398
- };
399
- return /*#__PURE__*/_jsxs(_Fragment, {
400
- children: [/*#__PURE__*/_jsx(Tooltip, {
401
- title: "",
402
- arrow: true,
403
- children: /*#__PURE__*/_jsx(IconButton, {
404
- sx: pickerStyles.colorPickerIcon,
405
- onClick: e => {
406
- setAnchorEl(e.currentTarget);
407
- },
408
- children: /*#__PURE__*/_jsx("img", {
409
- src: colorWheel,
410
- alt: "color wheel"
411
- })
412
- })
413
- }), /*#__PURE__*/_jsx(ColorButtons, {
414
- classes: pickerStyles,
415
- onSelect: onChange,
416
- activeColor: color,
417
- disableEditTheme: disableEditTheme
418
- }), /*#__PURE__*/_jsx(Popover, {
419
- open: open,
420
- anchorEl: anchorEl,
421
- onClose: handleClose,
422
- anchorOrigin: {
423
- vertical: "top",
424
- horizontal: "center"
425
- },
426
- transformOrigin: {
427
- vertical: "bottom",
428
- horizontal: "top"
429
- },
430
- sx: classes.colorPickerPopup,
431
- children: /*#__PURE__*/_jsx(CustomColorPicker, {
432
- gradient: true,
433
- onChange: onChange,
434
- color: color,
435
- disableEditTheme: disableEditTheme
436
- })
437
- })]
438
- });
439
- }
@@ -1,18 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- function BackIcon() {
3
- return /*#__PURE__*/_jsx("svg", {
4
- width: "8",
5
- height: "12",
6
- viewBox: "0 0 6 10",
7
- fill: "none",
8
- xmlns: "http://www.w3.org/2000/svg",
9
- children: /*#__PURE__*/_jsx("path", {
10
- d: "M4.75 1.5L1.25 5L4.75 8.5",
11
- stroke: "#94A3B8",
12
- strokeWidth: "1.5",
13
- strokeLinecap: "round",
14
- strokeLinejoin: "round"
15
- })
16
- });
17
- }
18
- export default BackIcon;
@@ -1,31 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { jsxs as _jsxs } from "react/jsx-runtime";
3
- const ClearAllIcon = () => /*#__PURE__*/_jsxs("svg", {
4
- xmlns: "http://www.w3.org/2000/svg",
5
- width: "20",
6
- height: "20",
7
- viewBox: "0 0 20 20",
8
- children: [/*#__PURE__*/_jsx("rect", {
9
- x: "4",
10
- y: "5",
11
- width: "12",
12
- height: "2",
13
- rx: "1",
14
- fill: "currentColor"
15
- }), /*#__PURE__*/_jsx("rect", {
16
- x: "4",
17
- y: "9",
18
- width: "10",
19
- height: "2",
20
- rx: "1",
21
- fill: "currentColor"
22
- }), /*#__PURE__*/_jsx("rect", {
23
- x: "4",
24
- y: "13",
25
- width: "12",
26
- height: "2",
27
- rx: "1",
28
- fill: "currentColor"
29
- })]
30
- });
31
- export default ClearAllIcon;
@@ -1,23 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { jsxs as _jsxs } from "react/jsx-runtime";
3
- const ResetIconNew = () => {
4
- return /*#__PURE__*/_jsxs("svg", {
5
- width: "17",
6
- height: "17",
7
- viewBox: "0 0 17 17",
8
- fill: "none",
9
- xmlns: "http://www.w3.org/2000/svg",
10
- children: [/*#__PURE__*/_jsx("circle", {
11
- cx: "8.10105",
12
- cy: "8.10234",
13
- r: "8",
14
- transform: "rotate(-89.2717 8.10105 8.10234)",
15
- fill: "#2563EB",
16
- fillOpacity: "0.16"
17
- }), /*#__PURE__*/_jsx("path", {
18
- d: "M12.7169 8.22222V8.22222C12.7168 8.2323 12.7289 8.23752 12.7361 8.2305L13.3823 7.6035C13.6597 7.33434 14.0843 7.33974 14.3547 7.61586C14.6252 7.89199 14.6198 8.31458 14.3424 8.58375L12.6992 10.1595C12.3035 10.5389 11.6762 10.5291 11.2926 10.1375L9.71318 8.5249C9.57796 8.38683 9.51173 8.20874 9.51381 8.04516C9.51606 7.86794 9.58679 7.69159 9.72531 7.57064C10.0027 7.30148 10.4273 7.30688 10.6977 7.583L11.3182 8.21649C11.3288 8.22729 11.3471 8.21993 11.3473 8.20481V8.20481C11.374 6.10545 9.67017 4.36586 7.56099 4.33905C5.45182 4.31224 3.70429 6.00795 3.6776 8.10731C3.65091 10.2067 5.35477 11.9463 7.46394 11.9731C7.84743 11.9779 8.14493 12.2817 8.14007 12.6634C8.13522 13.0451 7.8301 13.3412 7.44661 13.3363C4.57046 13.2997 2.27161 10.9527 2.30801 8.0899C2.3444 5.22714 4.70217 2.93927 7.57832 2.97583C10.4408 3.01222 12.7533 5.35946 12.7169 8.22222Z",
19
- fill: "#2563EB"
20
- })]
21
- });
22
- };
23
- export default ResetIconNew;