@flozy/editor 10.4.0 → 10.4.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 (190) hide show
  1. package/dist/Editor/ChatEditor.js +17 -16
  2. package/dist/Editor/CommonEditor.js +134 -18
  3. package/dist/Editor/DialogWrapper.js +31 -25
  4. package/dist/Editor/Editor.css +46 -8
  5. package/dist/Editor/Elements/AI/PopoverAIInput.js +11 -3
  6. package/dist/Editor/Elements/Accordion/Accordion.js +46 -9
  7. package/dist/Editor/Elements/Accordion/AccordionSummary.js +1 -23
  8. package/dist/Editor/Elements/AppHeader/AppHeader.js +10 -5
  9. package/dist/Editor/Elements/Button/EditorButton.js +27 -9
  10. package/dist/Editor/Elements/Carousel/CarouselItem.js +2 -1
  11. package/dist/Editor/Elements/Color Picker/ColorButtons.js +61 -14
  12. package/dist/Editor/Elements/Color Picker/ColorPicker.css +25 -1
  13. package/dist/Editor/Elements/Color Picker/ColorPicker.js +10 -7
  14. package/dist/Editor/Elements/Color Picker/Styles.js +15 -13
  15. package/dist/Editor/Elements/DataView/Layouts/ColumnView.js +4 -2
  16. package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/MultiSelect.js +454 -0
  17. package/dist/Editor/Elements/DataView/Layouts/DataTypes/MultiSelectType.js +23 -8
  18. package/dist/Editor/Elements/DataView/Layouts/Options/AddOptions.js +5 -2
  19. package/dist/Editor/Elements/DataView/Layouts/Options/EditOption.js +3 -2
  20. package/dist/Editor/Elements/DataView/Layouts/Options/index.js +11 -0
  21. package/dist/Editor/Elements/DataView/Layouts/ViewData.js +8 -4
  22. package/dist/Editor/Elements/Embed/Image.js +3 -2
  23. package/dist/Editor/Elements/Embed/Video.js +1 -1
  24. package/dist/Editor/Elements/EmbedScript/Code.js +14 -2
  25. package/dist/Editor/Elements/EmbedScript/EmbedScriptPopup.js +57 -28
  26. package/dist/Editor/Elements/EmbedScript/styles.js +89 -0
  27. package/dist/Editor/Elements/Form/Form.js +184 -171
  28. package/dist/Editor/Elements/Form/FormElements/FormText.js +23 -6
  29. package/dist/Editor/Elements/Form/FormElements/FormTextArea.js +2 -2
  30. package/dist/Editor/Elements/Form/FormField.js +13 -6
  31. package/dist/Editor/Elements/Form/Workflow/Styles.js +24 -22
  32. package/dist/Editor/Elements/FreeGrid/FreeGrid.js +40 -32
  33. package/dist/Editor/Elements/FreeGrid/FreeGridBox.js +7 -4
  34. package/dist/Editor/Elements/FreeGrid/FreeGridItem.js +1 -0
  35. package/dist/Editor/Elements/FreeGrid/Options/More.js +8 -8
  36. package/dist/Editor/Elements/FreeGrid/helper.js +115 -0
  37. package/dist/Editor/Elements/FreeGrid/styles.js +75 -7
  38. package/dist/Editor/Elements/Grid/Grid.js +14 -2
  39. package/dist/Editor/Elements/Grid/GridItem.js +1 -1
  40. package/dist/Editor/Elements/List/CheckList.js +3 -2
  41. package/dist/Editor/Elements/Search/SearchAttachment.js +40 -9
  42. package/dist/Editor/Elements/Search/SearchButton.js +9 -8
  43. package/dist/Editor/Elements/Search/SearchList.js +9 -7
  44. package/dist/Editor/Elements/Signature/Signature.css +2 -1
  45. package/dist/Editor/Elements/Signature/SignatureOptions/DrawSignature.js +18 -5
  46. package/dist/Editor/Elements/Signature/SignatureOptions/UploadSignature.js +16 -3
  47. package/dist/Editor/Elements/SimpleText/index.js +6 -1
  48. package/dist/Editor/Elements/SimpleText/style.js +2 -2
  49. package/dist/Editor/Elements/Table/DragButton.js +0 -1
  50. package/dist/Editor/Elements/Table/Draggable.js +6 -2
  51. package/dist/Editor/Elements/Table/Styles.js +7 -0
  52. package/dist/Editor/Elements/Table/Table.js +3 -3
  53. package/dist/Editor/Elements/Table/TableCell.js +31 -8
  54. package/dist/Editor/Elements/Title/title.js +6 -6
  55. package/dist/Editor/Elements/Variables/VariableButton.js +10 -1
  56. package/dist/Editor/MiniEditor.js +2 -1
  57. package/dist/Editor/Styles/EditorStyles.js +5 -5
  58. package/dist/Editor/Toolbar/FormatTools/Dropdown.js +27 -3
  59. package/dist/Editor/Toolbar/FormatTools/FontFamilyAutocomplete.js +4 -3
  60. package/dist/Editor/Toolbar/FormatTools/MarkButton.js +2 -2
  61. package/dist/Editor/Toolbar/FormatTools/TextSize.js +10 -13
  62. package/dist/Editor/Toolbar/Mini/MiniToolbar.js +2 -1
  63. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/MiniColorPicker.js +4 -2
  64. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectFontSize.js +6 -13
  65. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectTypography.js +167 -42
  66. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/index.js +7 -4
  67. package/dist/Editor/Toolbar/PopupTool/PopperHeader.js +2 -1
  68. package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +72 -12
  69. package/dist/Editor/Toolbar/PopupTool/TextFormat.js +100 -27
  70. package/dist/Editor/Toolbar/PopupTool/ThemeTextFormat.js +439 -0
  71. package/dist/Editor/Toolbar/PopupTool/index.js +1 -1
  72. package/dist/Editor/Toolbar/toolbarGroups.js +48 -6
  73. package/dist/Editor/assets/svg/BackIcon.js +18 -0
  74. package/dist/Editor/assets/svg/ClearAllRounded.js +31 -0
  75. package/dist/Editor/assets/svg/ResetIconNew.js +23 -0
  76. package/dist/Editor/assets/svg/SettingsIcon.js +1 -0
  77. package/dist/Editor/assets/svg/ThemeIcons.js +293 -0
  78. package/dist/Editor/common/Checkbox/index.js +46 -0
  79. package/dist/Editor/common/Checkbox/styles.js +45 -0
  80. package/dist/Editor/common/ColorPickerButton.js +41 -16
  81. package/dist/Editor/common/CustomColorPicker/index.js +130 -0
  82. package/dist/Editor/common/CustomColorPicker/style.js +53 -0
  83. package/dist/Editor/common/CustomDialog2/index.js +94 -0
  84. package/dist/Editor/common/CustomDialog2/style.js +67 -0
  85. package/dist/Editor/common/CustomSelect.js +43 -0
  86. package/dist/Editor/common/DnD/DragHandleButton.js +1 -1
  87. package/dist/Editor/common/FontLoader/FontLoader.js +3 -0
  88. package/dist/Editor/common/Icon.js +31 -1
  89. package/dist/Editor/common/ImageSelector/ImageSelector.js +2 -2
  90. package/dist/Editor/common/ImageSelector/Styles.js +3 -9
  91. package/dist/Editor/common/LinkSettings/NavComponents.js +61 -56
  92. package/dist/Editor/common/LinkSettings/index.js +82 -80
  93. package/dist/Editor/common/LinkSettings/navOptions.js +2 -2
  94. package/dist/Editor/common/LinkSettings/style.js +209 -74
  95. package/dist/Editor/common/MentionsPopup/index.js +4 -1
  96. package/dist/Editor/common/RadioGroup/index.js +48 -0
  97. package/dist/Editor/common/RadioGroup/styles.js +29 -0
  98. package/dist/Editor/common/RnD/ElementOptions/Actions.js +13 -15
  99. package/dist/Editor/common/RnD/ElementOptions/Icons/LinkIcon.js +1 -0
  100. package/dist/Editor/common/RnD/ElementOptions/index.js +2 -2
  101. package/dist/Editor/common/RnD/ElementOptions/styles.js +28 -1
  102. package/dist/Editor/common/RnD/ElementSettings/OtherSettings/Settings.js +6 -5
  103. package/dist/Editor/common/RnD/ElementSettings/OtherSettings/Signature.js +4 -3
  104. package/dist/Editor/common/RnD/ElementSettings/Settings/AppHeaderSettings.js +3 -2
  105. package/dist/Editor/common/RnD/ElementSettings/Settings/BoxSettings.js +3 -2
  106. package/dist/Editor/common/RnD/ElementSettings/Settings/ButtonSettings.js +3 -2
  107. package/dist/Editor/common/RnD/ElementSettings/Settings/CodeSettings.js +3 -2
  108. package/dist/Editor/common/RnD/ElementSettings/Settings/FormSettings.js +4 -2
  109. package/dist/Editor/common/RnD/ElementSettings/Settings/ImageSettings.js +3 -2
  110. package/dist/Editor/common/RnD/ElementSettings/Settings/TableSettings.js +3 -2
  111. package/dist/Editor/common/RnD/ElementSettings/Settings/TextSettings.js +3 -1
  112. package/dist/Editor/common/RnD/ElementSettings/Settings/VideoSettings.js +3 -2
  113. package/dist/Editor/common/RnD/ElementSettings/styles.js +146 -12
  114. package/dist/Editor/common/RnD/OptionsPopup/index.js +8 -5
  115. package/dist/Editor/common/RnD/OptionsPopup/style.js +120 -19
  116. package/dist/Editor/common/RnD/SwitchViewport/SwitchViewport.js +8 -5
  117. package/dist/Editor/common/RnD/Theme/MainThemeProvider.js +17 -0
  118. package/dist/Editor/common/RnD/Theme/ViewportStimulator.js +6 -3
  119. package/dist/Editor/common/RnD/Utils/gridDropItem.js +28 -19
  120. package/dist/Editor/common/RnD/Utils/index.js +3 -1
  121. package/dist/Editor/common/RnD/VirtualElement/VirtualTextElement.js +42 -58
  122. package/dist/Editor/common/RnD/VirtualElement/helper.js +323 -132
  123. package/dist/Editor/common/RnD/VirtualElement/styles.js +16 -0
  124. package/dist/Editor/common/RnD/index.js +68 -39
  125. package/dist/Editor/common/Select/index.js +44 -5
  126. package/dist/Editor/common/Select/styles.js +31 -2
  127. package/dist/Editor/common/Shorthands/elements.js +65 -11
  128. package/dist/Editor/common/SnackBar/index.js +43 -0
  129. package/dist/Editor/common/StyleBuilder/accordionTitleBtnStyle.js +2 -2
  130. package/dist/Editor/common/StyleBuilder/accordionTitleStyle.js +12 -9
  131. package/dist/Editor/common/StyleBuilder/buttonStyle.js +4 -2
  132. package/dist/Editor/common/StyleBuilder/embedVideoStyle.js +4 -0
  133. package/dist/Editor/common/StyleBuilder/fieldTypes/backgroundImage.js +5 -0
  134. package/dist/Editor/common/StyleBuilder/fieldTypes/bannerSpacing.js +12 -2
  135. package/dist/Editor/common/StyleBuilder/fieldTypes/borderRadius.js +15 -7
  136. package/dist/Editor/common/StyleBuilder/fieldTypes/card.js +16 -8
  137. package/dist/Editor/common/StyleBuilder/fieldTypes/color.js +36 -10
  138. package/dist/Editor/common/StyleBuilder/fieldTypes/embedUpload.js +115 -0
  139. package/dist/Editor/common/StyleBuilder/fieldTypes/fontSize.js +16 -7
  140. package/dist/Editor/common/StyleBuilder/fieldTypes/index.js +3 -1
  141. package/dist/Editor/common/StyleBuilder/fieldTypes/lineSpacing.js +7 -6
  142. package/dist/Editor/common/StyleBuilder/fieldTypes/menusArray.js +13 -6
  143. package/dist/Editor/common/StyleBuilder/fieldTypes/textOptions.js +15 -7
  144. package/dist/Editor/common/StyleBuilder/pageSettingsStyle.js +5 -7
  145. package/dist/Editor/common/SwipeableDrawer/style.js +14 -12
  146. package/dist/Editor/common/Uploader.js +16 -0
  147. package/dist/Editor/common/iconListV2.js +177 -6
  148. package/dist/Editor/common/iconslist.js +24 -0
  149. package/dist/Editor/commonStyle.js +186 -62
  150. package/dist/Editor/helper/index.js +5 -1
  151. package/dist/Editor/helper/textIndeces.js +58 -0
  152. package/dist/Editor/helper/theme.js +203 -2
  153. package/dist/Editor/hooks/useEditorTheme.js +153 -0
  154. package/dist/Editor/hooks/useMouseMove.js +8 -5
  155. package/dist/Editor/hooks/useTable.js +5 -4
  156. package/dist/Editor/hooks/useThemeValues.js +63 -0
  157. package/dist/Editor/plugins/withEmbeds.js +1 -1
  158. package/dist/Editor/plugins/withHTML.js +3 -1
  159. package/dist/Editor/plugins/withTable.js +1 -1
  160. package/dist/Editor/theme/ThemeList.js +50 -173
  161. package/dist/Editor/theme/index.js +149 -0
  162. package/dist/Editor/themeSettings/ActiveTheme.js +82 -0
  163. package/dist/Editor/themeSettings/buttons/index.js +300 -0
  164. package/dist/Editor/themeSettings/buttons/style.js +23 -0
  165. package/dist/Editor/themeSettings/colorTheme/index.js +310 -0
  166. package/dist/Editor/themeSettings/colorTheme/style.js +81 -0
  167. package/dist/Editor/themeSettings/fonts/PreviewElement.js +121 -0
  168. package/dist/Editor/themeSettings/fonts/index.js +240 -0
  169. package/dist/Editor/themeSettings/fonts/style.js +62 -0
  170. package/dist/Editor/themeSettings/icons.js +60 -0
  171. package/dist/Editor/themeSettings/index.js +380 -0
  172. package/dist/Editor/themeSettings/style.js +299 -0
  173. package/dist/Editor/themeSettingsAI/icons.js +96 -0
  174. package/dist/Editor/themeSettingsAI/index.js +355 -0
  175. package/dist/Editor/themeSettingsAI/saveTheme.js +202 -0
  176. package/dist/Editor/themeSettingsAI/style.js +332 -0
  177. package/dist/Editor/utils/SlateUtilityFunctions.js +172 -46
  178. package/dist/Editor/utils/accordion.js +14 -4
  179. package/dist/Editor/utils/button.js +1 -17
  180. package/dist/Editor/utils/customHooks/useTableResize.js +49 -9
  181. package/dist/Editor/utils/draftToSlate.js +3 -2
  182. package/dist/Editor/utils/events.js +50 -6
  183. package/dist/Editor/utils/font.js +40 -37
  184. package/dist/Editor/utils/form.js +4 -4
  185. package/dist/Editor/utils/formfield.js +9 -2
  186. package/dist/Editor/utils/helper.js +210 -26
  187. package/dist/Editor/utils/insertAppHeader.js +1 -1
  188. package/dist/Editor/utils/signature.js +2 -9
  189. package/dist/Editor/utils/updateFormName.js +22 -0
  190. package/package.json +4 -4
@@ -0,0 +1,454 @@
1
+ import React, { useCallback, useEffect, useMemo, useState } from "react";
2
+ import Autocomplete from "@mui/material/Autocomplete";
3
+ import Box from "@mui/material/Box";
4
+ import Chip from "@mui/material/Chip";
5
+ import Divider from "@mui/material/Divider";
6
+ import Popover from "@mui/material/Popover";
7
+ import TextField from "@mui/material/TextField";
8
+ import Typography from "@mui/material/Typography";
9
+ import List from "@mui/material/List";
10
+ import ListItem from "@mui/material/ListItem";
11
+ import ListItemButton from "@mui/material/ListItemButton";
12
+ import IconButton from "@mui/material/IconButton";
13
+ import SwipeableDrawer from "@mui/material/SwipeableDrawer";
14
+ import Tooltip from "@mui/material/Tooltip";
15
+ import { CloseIcon } from "../../../../../common/iconslist";
16
+ import { useEditorContext } from "../../../../../hooks/useMouseMove";
17
+ import Icon from "../../../../../common/Icon";
18
+ import { colors } from "../../../../Color Picker/defaultColors";
19
+ import PropertySettings from "../../Options";
20
+ import SnackbarAlert from "../../../../../common/SnackBar";
21
+ import { jsx as _jsx } from "react/jsx-runtime";
22
+ import { jsxs as _jsxs } from "react/jsx-runtime";
23
+ const EXCLUDED_COLORS = new Set(["#000000", "#0F172A", "#2563EB", "#FFFFFF", "#64748B"]);
24
+ const DEFAULT_COLORS = colors?.filter(f => !f?.includes("linear") && !EXCLUDED_COLORS?.has(f));
25
+ const generateRandomColor = () => {
26
+ const randomIndex = Math.floor(Math.random() * DEFAULT_COLORS?.length);
27
+ return DEFAULT_COLORS[randomIndex];
28
+ };
29
+ const MultiSelectWithPopover = props => {
30
+ const {
31
+ options = [],
32
+ value,
33
+ onChange,
34
+ onUpdate,
35
+ property,
36
+ wrapColumn = false,
37
+ translation
38
+ } = props;
39
+ const [anchorEl, setAnchorEl] = useState(null);
40
+ const [anchorElOption, setAnchorElOption] = useState(null);
41
+ const [currentIndex, setCurrentIndex] = useState(null);
42
+ const [selectedOptions, setSelectedOptions] = useState(value);
43
+ const [availableOptions, setAvailableOptions] = useState(options);
44
+ const [showSnackBar, setShowSnackBar] = useState(false);
45
+ const [chipColor, setChipColor] = useState(generateRandomColor());
46
+ const [inputValue, setInputValue] = useState("");
47
+ const {
48
+ theme
49
+ } = useEditorContext();
50
+ const isMobile = window.matchMedia("(max-width: 899px)")?.matches || false;
51
+ const PopoverComponent = isMobile ? SwipeableDrawer : Popover;
52
+ const mode = useMemo(() => ({
53
+ type: "editOptionMulti",
54
+ edit: {
55
+ label: "Multi Select",
56
+ visible: true,
57
+ key: property,
58
+ type: "multi-select",
59
+ options: options || [],
60
+ optionIndex: currentIndex,
61
+ hideBackButton: true
62
+ }
63
+ }), [options, property, currentIndex]);
64
+ const customScrollStyles = {
65
+ scrollbarWidth: "thin",
66
+ scrollbarColor: `${theme?.palette?.editor?.brainPopupScroll} transparent`,
67
+ "&::-webkit-scrollbar": {
68
+ width: "6px"
69
+ },
70
+ "&::-webkit-scrollbar-thumb": {
71
+ backgroundColor: theme?.palette?.editor?.brainPopupScroll,
72
+ borderRadius: "3px"
73
+ },
74
+ "&::-webkit-scrollbar-track": {
75
+ display: "none"
76
+ }
77
+ };
78
+ useEffect(() => {
79
+ if (inputValue?.trim() && !chipColor) {
80
+ setChipColor(generateRandomColor());
81
+ }
82
+ }, [inputValue, chipColor]);
83
+ useEffect(() => {
84
+ if (JSON.stringify(options) !== JSON.stringify(availableOptions)) {
85
+ setAvailableOptions(options);
86
+ }
87
+ }, [options, availableOptions]);
88
+ const handleOpenPopover = useCallback(event => {
89
+ setAnchorEl(event.currentTarget);
90
+ }, []);
91
+ const handleClosePopover = useCallback(e => {
92
+ e?.stopPropagation();
93
+ setAnchorEl(null);
94
+ }, []);
95
+ const handleAddOption = newValue => {
96
+ const trimmedValue = newValue?.trim();
97
+ if (!trimmedValue) return;
98
+ const newOption = {
99
+ value: trimmedValue,
100
+ color: chipColor
101
+ };
102
+ if (!availableOptions?.some(opt => opt?.value === trimmedValue)) {
103
+ setAvailableOptions(prev => [...prev, newOption]);
104
+ setSelectedOptions(prev => [...prev, newOption]);
105
+ onUpdate([newOption, ...availableOptions]);
106
+ }
107
+ setInputValue("");
108
+ setChipColor("");
109
+ };
110
+ const onClose = () => {
111
+ setAnchorEl(anchorElOption);
112
+ setAnchorElOption(null);
113
+ };
114
+ const onEditOption = (type, data) => {
115
+ const updateData = data?.edit ? data?.edit?.options : data?.options;
116
+ onUpdate(updateData);
117
+ if (data?.edit?.options) {
118
+ const updatedSelectedOptions = selectedOptions?.filter(selOption => updateData?.some(availOption => availOption?.value === selOption?.value && availOption?.color === selOption?.color));
119
+ setSelectedOptions(updatedSelectedOptions);
120
+ onClose();
121
+ }
122
+ };
123
+ const handleEditOption = (e, index) => {
124
+ e.stopPropagation();
125
+ setCurrentIndex(index);
126
+ setAnchorElOption(anchorEl);
127
+ setAnchorEl(null);
128
+ };
129
+ const handleSelectOption = option => {
130
+ if (!selectedOptions?.some(opt => opt?.value === option?.value)) {
131
+ const updatedOptions = [...selectedOptions, option];
132
+ setSelectedOptions(updatedOptions);
133
+ onChange(updatedOptions);
134
+ } else {
135
+ setShowSnackBar(true);
136
+ }
137
+ };
138
+ const handleClearSelection = () => {
139
+ setSelectedOptions([]);
140
+ };
141
+ const handleDeleteChip = (event, option) => {
142
+ event.stopPropagation();
143
+ setSelectedOptions(prev => {
144
+ const updatedOptions = prev.filter(selected => selected?.value !== option?.value);
145
+ onChange(updatedOptions);
146
+ return updatedOptions;
147
+ });
148
+ };
149
+ const filteredOptions = availableOptions?.filter(option => option?.value?.toLowerCase()?.includes(inputValue?.toLowerCase()));
150
+ const isExactMatch = availableOptions?.some(opt => opt?.value?.toLowerCase() === inputValue?.toLowerCase());
151
+ const open = Boolean(anchorEl);
152
+ const openEditOption = Boolean(anchorElOption);
153
+ const id = open ? "autocomplete-popover" : undefined;
154
+ return /*#__PURE__*/_jsxs("div", {
155
+ children: [/*#__PURE__*/_jsx(Box, {
156
+ sx: {
157
+ display: "flex",
158
+ flexWrap: wrapColumn ? "wrap" : "nowrap",
159
+ overflowX: wrapColumn ? "hidden" : "auto",
160
+ gap: 0.5,
161
+ padding: "8px",
162
+ cursor: "pointer"
163
+ },
164
+ onClick: handleOpenPopover,
165
+ children: selectedOptions?.map((option, index) => /*#__PURE__*/_jsx(Chip, {
166
+ label: option?.value,
167
+ onDelete: event => {
168
+ handleDeleteChip(event, option);
169
+ },
170
+ deleteIcon: /*#__PURE__*/_jsx(CloseIcon, {}),
171
+ variant: "filled",
172
+ sx: {
173
+ backgroundColor: option?.color,
174
+ color: "#0F172A",
175
+ "& .MuiChip-deleteIcon": {
176
+ flexShrink: 0,
177
+ "& path": {
178
+ stroke: "#0F172A !important"
179
+ }
180
+ },
181
+ "&:hover": {
182
+ opacity: 0.8
183
+ }
184
+ }
185
+ }, index))
186
+ }), /*#__PURE__*/_jsx(PopoverComponent, {
187
+ id: id,
188
+ open: open,
189
+ anchorEl: anchorEl,
190
+ anchor: "bottom",
191
+ onClose: e => handleClosePopover(e),
192
+ anchorOrigin: {
193
+ vertical: "top",
194
+ horizontal: "left"
195
+ },
196
+ transformOrigin: {
197
+ vertical: "top",
198
+ horizontal: "left"
199
+ },
200
+ sx: {
201
+ "& .MuiPaper-root": {
202
+ borderRadius: "20px",
203
+ background: theme?.palette?.editor?.textFormatBgColor,
204
+ border: `1px solid ${theme?.palette?.editor?.popUpBorderColor}`,
205
+ boxShadow: "0px 4px 10px 0px #00000029"
206
+ }
207
+ },
208
+ disableAutoFocus: true,
209
+ disableEnforceFocus: true,
210
+ disableRestoreFocus: true,
211
+ children: /*#__PURE__*/_jsxs(Box, {
212
+ sx: {
213
+ width: isMobile ? "100%" : 300
214
+ },
215
+ children: [/*#__PURE__*/_jsx(Autocomplete, {
216
+ multiple: true,
217
+ freeSolo: true,
218
+ disablePortal: true,
219
+ PopperComponent: () => null,
220
+ sx: {
221
+ "& .MuiFormControl-root": {
222
+ maxHeight: "250px",
223
+ overflowY: "auto",
224
+ overflowX: "hidden",
225
+ pr: "12px",
226
+ pl: "12px",
227
+ marginTop: "12px",
228
+ ...customScrollStyles
229
+ }
230
+ },
231
+ disableClearable: true,
232
+ options: [],
233
+ getOptionLabel: option => options?.value || "",
234
+ value: selectedOptions,
235
+ onChange: (event, newValues) => {
236
+ const addedOptions = newValues?.filter(value => typeof value === "object" || typeof value === "string" && value?.trim() !== "")?.map(value => typeof value === "string" ? {
237
+ value,
238
+ color: chipColor
239
+ } : value);
240
+ const isDuplicate = addedOptions?.some(newOpt => (selectedOptions || [])?.some(opt => opt.value === newOpt.value));
241
+ if (!isDuplicate) {
242
+ setSelectedOptions([...selectedOptions, ...addedOptions]);
243
+ }
244
+ },
245
+ inputValue: inputValue,
246
+ onInputChange: (event, newInputValue) => setInputValue(newInputValue),
247
+ onKeyDown: event => {
248
+ if (event.key === "Enter" && inputValue.trim()) {
249
+ event.preventDefault();
250
+ handleAddOption(inputValue);
251
+ }
252
+ },
253
+ filterOptions: (options, params) => options?.filter(option => option?.value?.toLowerCase()?.includes(params?.inputValue?.toLowerCase())),
254
+ renderInput: params => /*#__PURE__*/_jsx(TextField, {
255
+ ...params,
256
+ variant: "standard",
257
+ InputProps: {
258
+ ...params.InputProps,
259
+ disableUnderline: true,
260
+ sx: {
261
+ display: "flex",
262
+ flexWrap: "wrap",
263
+ fontFamily: "Inter",
264
+ fontWeight: 400,
265
+ fontSize: "12px",
266
+ color: theme?.palette?.editor?.secondaryTextColor,
267
+ "&::placeholder": {
268
+ color: theme?.palette?.editor?.secondaryTextColor
269
+ },
270
+ "& .MuiAutocomplete-input": {
271
+ minWidth: "100px !important"
272
+ }
273
+ },
274
+ endAdornment: /*#__PURE__*/_jsx(Tooltip, {
275
+ arrow: true,
276
+ title: "Clear Selected",
277
+ children: /*#__PURE__*/_jsx(IconButton, {
278
+ onClick: handleClearSelection,
279
+ sx: {
280
+ padding: 0,
281
+ minWidth: "unset",
282
+ "& .MuiSvgIcon-root": {
283
+ fontSize: 20
284
+ },
285
+ "& rect": {
286
+ fill: theme?.palette?.editor?.closeButtonSvgStroke
287
+ },
288
+ "&:hover": {
289
+ backgroundColor: "transparent"
290
+ }
291
+ },
292
+ children: /*#__PURE__*/_jsx(Icon, {
293
+ icon: "resetIconNew"
294
+ })
295
+ })
296
+ })
297
+ },
298
+ sx: {
299
+ backgroundColor: "transparent",
300
+ fontFamily: "Inter",
301
+ fontWeight: 400,
302
+ fontSize: "12px"
303
+ },
304
+ placeholder: "Create new one..."
305
+ }),
306
+ renderTags: (tagValues, getTagProps) => tagValues.map((option, index) => /*#__PURE__*/_jsx(Chip, {
307
+ variant: "filled",
308
+ label: option?.value,
309
+ ...getTagProps({
310
+ index
311
+ }),
312
+ onDelete: event => {
313
+ handleDeleteChip(event, option);
314
+ },
315
+ deleteIcon: /*#__PURE__*/_jsx(CloseIcon, {}),
316
+ sx: {
317
+ backgroundColor: option?.color,
318
+ color: "#0F172A",
319
+ "& .MuiChip-deleteIcon": {
320
+ flexShrink: 0,
321
+ "& path": {
322
+ stroke: "#0F172A !important"
323
+ }
324
+ },
325
+ "&:hover": {
326
+ opacity: 0.8
327
+ }
328
+ }
329
+ }, index))
330
+ }), /*#__PURE__*/_jsx(Divider, {
331
+ sx: {
332
+ mt: "12px",
333
+ borderBottom: `1px solid ${theme?.palette?.editor?.popUpBorderColor}`,
334
+ boxShadow: theme?.palette?.editor?.dividerDropShadow
335
+ }
336
+ }), /*#__PURE__*/_jsx(Box, {
337
+ sx: {
338
+ pl: "4px"
339
+ },
340
+ children: /*#__PURE__*/_jsxs(List, {
341
+ sx: {
342
+ maxHeight: "250px",
343
+ overflowY: "auto",
344
+ ...customScrollStyles
345
+ },
346
+ children: [/*#__PURE__*/_jsx(Typography, {
347
+ sx: {
348
+ mb: 1,
349
+ pl: "8px",
350
+ color: theme?.palette?.editor?.secondaryTextColor,
351
+ fontFamily: "Inter",
352
+ fontWeight: 400,
353
+ fontSize: "12px"
354
+ },
355
+ children: "Choose an option or create one"
356
+ }), filteredOptions?.map((option, index) => /*#__PURE__*/_jsx(ListItem, {
357
+ sx: {
358
+ padding: 0
359
+ },
360
+ disablePadding: true,
361
+ children: /*#__PURE__*/_jsxs(ListItemButton, {
362
+ onClick: () => handleSelectOption(option),
363
+ sx: {
364
+ paddingTop: "4px",
365
+ paddingBottom: "4px",
366
+ justifyContent: "space-between",
367
+ "&:hover": {
368
+ "& path": {
369
+ stroke: theme?.palette?.editor?.activeColor
370
+ },
371
+ borderRadius: "12px"
372
+ }
373
+ },
374
+ children: [/*#__PURE__*/_jsx(Chip, {
375
+ label: option?.value,
376
+ sx: {
377
+ backgroundColor: option?.color,
378
+ color: "#0F172A",
379
+ fontWeight: 500,
380
+ fontSize: "12px",
381
+ fontFamily: "Inter",
382
+ padding: "4px 12px",
383
+ borderRadius: "16px",
384
+ maxWidth: "180px",
385
+ whiteSpace: "nowrap",
386
+ overflow: "hidden",
387
+ textOverflow: "ellipsis"
388
+ }
389
+ }), /*#__PURE__*/_jsx(IconButton, {
390
+ size: "small",
391
+ sx: {
392
+ "& path": {
393
+ stroke: theme?.palette?.editor?.closeButtonSvgStroke
394
+ },
395
+ "&:hover": {
396
+ backgroundColor: "transparent"
397
+ }
398
+ },
399
+ onClick: e => handleEditOption(e, index),
400
+ children: /*#__PURE__*/_jsx(Icon, {
401
+ icon: "rightArrow"
402
+ })
403
+ })]
404
+ })
405
+ }, index)), inputValue?.trim() && !isExactMatch && /*#__PURE__*/_jsx(ListItem, {
406
+ disablePadding: true,
407
+ children: /*#__PURE__*/_jsxs(ListItemButton, {
408
+ onClick: () => handleAddOption(inputValue),
409
+ sx: {
410
+ display: "flex",
411
+ alignItems: "center"
412
+ },
413
+ children: [/*#__PURE__*/_jsx(Typography, {
414
+ sx: {
415
+ color: theme?.palette?.editor?.secondaryTextColor,
416
+ marginRight: "6px",
417
+ fontSize: "14px",
418
+ fontFamily: "Inter"
419
+ },
420
+ children: "Create"
421
+ }), /*#__PURE__*/_jsx(Chip, {
422
+ label: `${inputValue}`,
423
+ sx: {
424
+ backgroundColor: chipColor,
425
+ color: "#0F172A",
426
+ fontWeight: 500,
427
+ fontSize: "12px",
428
+ fontFamily: "Inter",
429
+ borderRadius: "16px",
430
+ maxWidth: "180px",
431
+ whiteSpace: "nowrap",
432
+ overflow: "hidden",
433
+ textOverflow: "ellipsis"
434
+ }
435
+ })]
436
+ })
437
+ })]
438
+ })
439
+ })]
440
+ })
441
+ }), openEditOption ? /*#__PURE__*/_jsx(PropertySettings, {
442
+ open: openEditOption,
443
+ anchorEl: anchorElOption,
444
+ mode: mode,
445
+ onClose: onClose,
446
+ onEvent: onEditOption,
447
+ translation: translation
448
+ }) : null, showSnackBar ? /*#__PURE__*/_jsx(SnackbarAlert, {
449
+ message: "Option already selected!",
450
+ setShowSnackBar: setShowSnackBar
451
+ }) : null]
452
+ });
453
+ };
454
+ export default MultiSelectWithPopover;
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
2
  import { useDataView } from "../../Providers/DataViewProvider";
3
- import Select from "./Components/Select";
3
+ import MultiSelectWithPopover from "./Components/MultiSelect";
4
4
  import { jsx as _jsx } from "react/jsx-runtime";
5
5
  const MultiSelectType = props => {
6
6
  const {
@@ -10,14 +10,16 @@ const MultiSelectType = props => {
10
10
  options,
11
11
  label = "",
12
12
  readOnly,
13
- settings
13
+ settings,
14
+ translation
14
15
  } = props;
16
+ const {
17
+ onChange,
18
+ onUpdateProperty
19
+ } = useDataView();
15
20
  const {
16
21
  wrapColumn
17
22
  } = settings;
18
- const {
19
- onChange
20
- } = useDataView();
21
23
  const value = Array.isArray(pValue) ? pValue : [];
22
24
  const coloredValues = [...(value || [])]?.map(m => {
23
25
  return {
@@ -30,15 +32,28 @@ const MultiSelectType = props => {
30
32
  [property]: data?.filter(f => f?.value)
31
33
  });
32
34
  };
33
- return /*#__PURE__*/_jsx(Select, {
34
- className: `wrap-${wrapColumn}`,
35
+ const handleUpdate = data => {
36
+ const updateData = {
37
+ label: "Multi Select",
38
+ visible: true,
39
+ key: property,
40
+ type: "multi-select",
41
+ options: data
42
+ };
43
+ onUpdateProperty(updateData);
44
+ };
45
+ return /*#__PURE__*/_jsx(MultiSelectWithPopover, {
35
46
  value: coloredValues,
36
47
  onChange: handleChange,
48
+ onUpdate: handleUpdate,
37
49
  options: options,
38
50
  multiple: true,
39
51
  limitTags: 2,
40
52
  placeholder: label,
41
- disabled: readOnly
53
+ disabled: readOnly,
54
+ property: property,
55
+ wrapColumn: wrapColumn,
56
+ translation: translation
42
57
  });
43
58
  };
44
59
  export default MultiSelectType;
@@ -4,7 +4,11 @@ import { colors } from "../../../Color Picker/defaultColors";
4
4
  import Icon from "../../../../common/Icon";
5
5
  import { jsx as _jsx } from "react/jsx-runtime";
6
6
  import { jsxs as _jsxs } from "react/jsx-runtime";
7
- const DEFAULT_COLORS = colors?.filter(f => !(f.includes("linear") || f === "#000000"));
7
+ const EXCLUDED_COLORS = new Set(["#000000", "#0F172A", "#2563EB", "#FFFFFF", "#64748B"]);
8
+ const DEFAULT_COLORS = colors?.filter(f => !f?.includes("linear") && !EXCLUDED_COLORS?.has(f));
9
+
10
+ // const DEFAULT_COLORS = colors?.filter((f) => !(f.includes("linear") || f === "#000000"));
11
+
8
12
  const AddOptions = props => {
9
13
  const {
10
14
  edit,
@@ -56,7 +60,6 @@ const AddOptions = props => {
56
60
  };
57
61
  const onBlur = () => {
58
62
  setValue("");
59
- setAddBox(false);
60
63
  setError("");
61
64
  };
62
65
  return edit?.type === "select" || edit?.type === "multi-select" ? /*#__PURE__*/_jsxs(Box, {
@@ -30,6 +30,7 @@ const EditOption = props => {
30
30
  } = edit;
31
31
  const selectedOption = edit?.options[optionIndex] || {};
32
32
  const pickerStyles = ColorPickerStyles(theme);
33
+ const hideBackButton = edit?.hideBackButton || false;
33
34
  useEffect(() => {
34
35
  return () => {
35
36
  // on un-mount update the option change
@@ -104,14 +105,14 @@ const EditOption = props => {
104
105
  children: [/*#__PURE__*/_jsxs(Box, {
105
106
  className: "fe-dv-ap-title",
106
107
  children: [/*#__PURE__*/_jsxs("span", {
107
- children: [/*#__PURE__*/_jsx(IconButton, {
108
+ children: [!hideBackButton ? /*#__PURE__*/_jsx(IconButton, {
108
109
  className: "tv-act-ico",
109
110
  size: "small",
110
111
  onClick: onBack,
111
112
  children: /*#__PURE__*/_jsx(Icon, {
112
113
  icon: 'leftArrow'
113
114
  })
114
- }), translation("Edit Option")]
115
+ }) : null, translation("Edit Option")]
115
116
  }), /*#__PURE__*/_jsx(IconButton, {
116
117
  className: "tv-act-ico bg br1",
117
118
  size: "small",
@@ -29,6 +29,16 @@ const POSITIONS = {
29
29
  vertical: "top",
30
30
  horizontal: "right"
31
31
  }
32
+ },
33
+ editOptionMulti: {
34
+ anchorOrigin: {
35
+ vertical: "top",
36
+ horizontal: "left"
37
+ },
38
+ transformOrigin: {
39
+ vertical: "top",
40
+ horizontal: "left"
41
+ }
32
42
  }
33
43
  };
34
44
  const PropertySettings = props => {
@@ -82,6 +92,7 @@ const PropertySettings = props => {
82
92
  translation: translation
83
93
  });
84
94
  case "editOption":
95
+ case "editOptionMulti":
85
96
  return /*#__PURE__*/_jsx(EditOption, {
86
97
  classes: classes,
87
98
  onClose: onClose,
@@ -11,7 +11,8 @@ const RenderRow = props => {
11
11
  properties,
12
12
  onSelect,
13
13
  selected,
14
- readOnly
14
+ readOnly,
15
+ translation
15
16
  } = props;
16
17
  const showProperties = properties?.filter(f => f.visible);
17
18
  return showProperties?.map((property, i) => {
@@ -22,7 +23,8 @@ const RenderRow = props => {
22
23
  property: property,
23
24
  onSelect: onSelect,
24
25
  selected: selected,
25
- readOnly: readOnly
26
+ readOnly: readOnly,
27
+ translation: translation
26
28
  }, `${property.key}_${i}`);
27
29
  });
28
30
  };
@@ -33,7 +35,8 @@ const ViewData = props => {
33
35
  customProps
34
36
  } = props;
35
37
  const {
36
- readOnly
38
+ readOnly,
39
+ translation
37
40
  } = customProps || {};
38
41
  const {
39
42
  properties,
@@ -67,7 +70,8 @@ const ViewData = props => {
67
70
  properties: properties,
68
71
  onSelect: onSelect,
69
72
  selected: selectedRows?.includes(row?.id),
70
- readOnly: readOnly
73
+ readOnly: readOnly,
74
+ translation: translation
71
75
  }), /*#__PURE__*/_jsx("td", {}), /*#__PURE__*/_jsx("td", {})]
72
76
  }, i);
73
77
  }), /*#__PURE__*/_jsx("tr", {
@@ -4,7 +4,7 @@ import { Node, Transforms, Editor } from "slate";
4
4
  import AspectRatioIcon from "@mui/icons-material/AspectRatio";
5
5
  import useResize from "../../utils/customHooks/useResize";
6
6
  import EmbedPopup from "./EmbedPopup";
7
- import { IconButton, Tooltip, Box, useTheme } from "@mui/material";
7
+ import { IconButton, Tooltip, Box, useTheme, useMediaQuery } from "@mui/material";
8
8
  import { LinkIcon } from "../../common/iconslist";
9
9
  import { useEditorContext } from "../../hooks/useMouseMove";
10
10
  import { getTRBLBreakPoints, getBreakPointsValue, groupByBreakpoint } from "../../helper/theme";
@@ -200,6 +200,7 @@ const Image = props => {
200
200
  theme: appTheme
201
201
  } = useEditorContext();
202
202
  const classes = useCommonStyle(appTheme);
203
+ const isMobile = useMediaQuery("(max-width:599px)");
203
204
  const handleImageClick = () => {
204
205
  try {
205
206
  Transforms.select(editor, {
@@ -280,7 +281,7 @@ const Image = props => {
280
281
  sx: {
281
282
  display: {
282
283
  lg: "flex",
283
- xs: xsHidden ? "none" : "flex"
284
+ xs: xsHidden && isMobile ? "none" : "flex"
284
285
  },
285
286
  width: `100%`,
286
287
  maxWidth: "100%",
@@ -89,7 +89,7 @@ const VideoPlaceholder = props => {
89
89
  },
90
90
  children: [/*#__PURE__*/_jsx(Icon, {
91
91
  icon: "video"
92
- }), TYPE_LABELS[type] || translation("Embed Video or Other")]
92
+ }), translation(TYPE_LABELS[type] || "Embed Video or Other")]
93
93
  }) : /*#__PURE__*/_jsxs(Box, {
94
94
  sx: {
95
95
  color: "#64748B !important",