@flozy/editor 10.4.3 → 10.4.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/dist/Editor/CommonEditor.js +2 -3
  2. package/dist/Editor/Elements/Button/EditorButton.js +2 -0
  3. package/dist/Editor/Elements/DataView/Layouts/DataTypes/MultiSelectType.js +7 -20
  4. package/dist/Editor/Elements/DataView/Layouts/Options/AddOptions.js +1 -5
  5. package/dist/Editor/Elements/DataView/Layouts/Options/EditOption.js +2 -3
  6. package/dist/Editor/Elements/DataView/Layouts/Options/index.js +0 -11
  7. package/dist/Editor/Elements/Embed/Image.js +2 -3
  8. package/dist/Editor/Elements/EmbedScript/Code.js +2 -14
  9. package/dist/Editor/Elements/EmbedScript/EmbedScriptPopup.js +28 -57
  10. package/dist/Editor/Elements/Form/Form.js +168 -181
  11. package/dist/Editor/Elements/Form/FormElements/FormText.js +6 -23
  12. package/dist/Editor/Elements/Form/FormElements/FormTextArea.js +2 -3
  13. package/dist/Editor/Elements/Form/FormField.js +4 -10
  14. package/dist/Editor/Elements/FreeGrid/FreeGrid.js +1 -5
  15. package/dist/Editor/Elements/FreeGrid/Options/More.js +1 -1
  16. package/dist/Editor/Elements/FreeGrid/Options/sectionItemOptions.js +1 -1
  17. package/dist/Editor/Elements/FreeGrid/styles.js +7 -61
  18. package/dist/Editor/Elements/List/CheckList.js +2 -3
  19. package/dist/Editor/Elements/Search/SearchAttachment.js +9 -40
  20. package/dist/Editor/Elements/Search/SearchButton.js +8 -9
  21. package/dist/Editor/Elements/Search/SearchList.js +7 -9
  22. package/dist/Editor/Elements/SimpleText/index.js +1 -6
  23. package/dist/Editor/Elements/Table/TableCell.js +3 -7
  24. package/dist/Editor/Toolbar/PopupTool/TextFormat.js +18 -43
  25. package/dist/Editor/assets/svg/SettingsIcon.js +0 -1
  26. package/dist/Editor/common/Icon.js +1 -3
  27. package/dist/Editor/common/LinkSettings/NavComponents.js +9 -36
  28. package/dist/Editor/common/LinkSettings/index.js +69 -86
  29. package/dist/Editor/common/LinkSettings/style.js +30 -245
  30. package/dist/Editor/common/RnD/ElementOptions/Actions.js +14 -13
  31. package/dist/Editor/common/RnD/ElementOptions/Icons/LinkIcon.js +0 -1
  32. package/dist/Editor/common/RnD/ElementOptions/index.js +2 -2
  33. package/dist/Editor/common/RnD/ElementOptions/styles.js +1 -28
  34. package/dist/Editor/common/RnD/ElementSettings/OtherSettings/Settings.js +4 -4
  35. package/dist/Editor/common/RnD/ElementSettings/styles.js +12 -147
  36. package/dist/Editor/common/RnD/OptionsPopup/index.js +5 -8
  37. package/dist/Editor/common/RnD/OptionsPopup/style.js +19 -121
  38. package/dist/Editor/common/RnD/SwitchViewport/SwitchViewport.js +6 -0
  39. package/dist/Editor/common/Select/index.js +0 -2
  40. package/dist/Editor/common/Shorthands/elements.js +11 -11
  41. package/dist/Editor/common/StyleBuilder/fieldTypes/lineSpacing.js +6 -7
  42. package/dist/Editor/common/StyleBuilder/fieldTypes/menusArray.js +6 -13
  43. package/dist/Editor/common/StyleBuilder/pageSettingsStyle.js +7 -5
  44. package/dist/Editor/common/iconListV2.js +6 -101
  45. package/dist/Editor/common/iconslist.js +0 -3
  46. package/dist/Editor/commonStyle.js +1 -70
  47. package/dist/Editor/hooks/useMouseMove.js +5 -2
  48. package/dist/Editor/utils/SlateUtilityFunctions.js +10 -12
  49. package/dist/Editor/utils/form.js +4 -4
  50. package/dist/Editor/utils/formfield.js +2 -8
  51. package/package.json +1 -1
  52. package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/MultiSelect.js +0 -452
  53. package/dist/Editor/Elements/EmbedScript/styles.js +0 -89
  54. package/dist/Editor/assets/svg/ClearAllRounded.js +0 -31
  55. package/dist/Editor/assets/svg/ResetIconNew.js +0 -23
  56. package/dist/Editor/common/SnackBar/index.js +0 -43
@@ -345,7 +345,6 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
345
345
  const onDrawerOpen = status => {
346
346
  setIsDrawerOpen(status);
347
347
  };
348
- const lineH = getBreakpointLineSpacing(lineHeight, breakpoint || (isMobile ? "xs" : ""));
349
348
  const isReadOnly = readOnly === "readonly";
350
349
  const customProps = {
351
350
  ...(otherProps || {}),
@@ -358,9 +357,9 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
358
357
  onDrawerOpen: onDrawerOpen,
359
358
  ICON_API: "https://assets.agenciflow.com",
360
359
  translation: translationFn,
361
- getTitleSaveData,
362
- customLineHeight: lineH
360
+ getTitleSaveData
363
361
  };
362
+ const lineH = getBreakpointLineSpacing(lineHeight, breakpoint);
364
363
  const renderElement = useCallback(props => {
365
364
  return /*#__PURE__*/_jsx(Element, {
366
365
  ...props,
@@ -53,6 +53,7 @@ const EditorButton = props => {
53
53
  fontFamily,
54
54
  textColorHover,
55
55
  bgColorHover,
56
+ borderColorHover,
56
57
  buttonIcon,
57
58
  iconPosition = "start",
58
59
  borderStyle,
@@ -287,6 +288,7 @@ const EditorButton = props => {
287
288
  "&:hover": {
288
289
  color: `${textColorHover || textColor || "#FFFFFF"}`,
289
290
  background: bgColorHover || bgColor || "rgb(30, 75, 122)",
291
+ borderColor: borderColorHover || borderColor || "transparent",
290
292
  "& .element-toolbar": {
291
293
  display: "flex"
292
294
  }
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
2
  import { useDataView } from "../../Providers/DataViewProvider";
3
- import MultiSelectWithPopover from "./Components/MultiSelect";
3
+ import Select from "./Components/Select";
4
4
  import { jsx as _jsx } from "react/jsx-runtime";
5
5
  const MultiSelectType = props => {
6
6
  const {
@@ -12,13 +12,12 @@ const MultiSelectType = props => {
12
12
  readOnly,
13
13
  settings
14
14
  } = props;
15
- const {
16
- onChange,
17
- onUpdateProperty
18
- } = useDataView();
19
15
  const {
20
16
  wrapColumn
21
17
  } = settings;
18
+ const {
19
+ onChange
20
+ } = useDataView();
22
21
  const value = Array.isArray(pValue) ? pValue : [];
23
22
  const coloredValues = [...(value || [])]?.map(m => {
24
23
  return {
@@ -31,27 +30,15 @@ const MultiSelectType = props => {
31
30
  [property]: data?.filter(f => f?.value)
32
31
  });
33
32
  };
34
- const handleUpdate = data => {
35
- const updateData = {
36
- "label": "Multi Select",
37
- "visible": true,
38
- "key": property,
39
- "type": "multi-select",
40
- "options": data
41
- };
42
- onUpdateProperty(updateData);
43
- };
44
- return /*#__PURE__*/_jsx(MultiSelectWithPopover, {
33
+ return /*#__PURE__*/_jsx(Select, {
34
+ className: `wrap-${wrapColumn}`,
45
35
  value: coloredValues,
46
36
  onChange: handleChange,
47
- onUpdate: handleUpdate,
48
37
  options: options,
49
38
  multiple: true,
50
39
  limitTags: 2,
51
40
  placeholder: label,
52
- disabled: readOnly,
53
- property: property,
54
- wrapColumn: wrapColumn
41
+ disabled: readOnly
55
42
  });
56
43
  };
57
44
  export default MultiSelectType;
@@ -4,11 +4,7 @@ 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 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
-
7
+ const DEFAULT_COLORS = colors?.filter(f => !(f.includes("linear") || f === "#000000"));
12
8
  const AddOptions = props => {
13
9
  const {
14
10
  edit,
@@ -30,7 +30,6 @@ 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;
34
33
  useEffect(() => {
35
34
  return () => {
36
35
  // on un-mount update the option change
@@ -105,14 +104,14 @@ const EditOption = props => {
105
104
  children: [/*#__PURE__*/_jsxs(Box, {
106
105
  className: "fe-dv-ap-title",
107
106
  children: [/*#__PURE__*/_jsxs("span", {
108
- children: [!hideBackButton ? /*#__PURE__*/_jsx(IconButton, {
107
+ children: [/*#__PURE__*/_jsx(IconButton, {
109
108
  className: "tv-act-ico",
110
109
  size: "small",
111
110
  onClick: onBack,
112
111
  children: /*#__PURE__*/_jsx(Icon, {
113
112
  icon: 'leftArrow'
114
113
  })
115
- }) : null, translation("Edit Option")]
114
+ }), translation("Edit Option")]
116
115
  }), /*#__PURE__*/_jsx(IconButton, {
117
116
  className: "tv-act-ico bg br1",
118
117
  size: "small",
@@ -29,16 +29,6 @@ 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
- }
42
32
  }
43
33
  };
44
34
  const PropertySettings = props => {
@@ -92,7 +82,6 @@ const PropertySettings = props => {
92
82
  translation: translation
93
83
  });
94
84
  case "editOption":
95
- case "editOptionMulti":
96
85
  return /*#__PURE__*/_jsx(EditOption, {
97
86
  classes: classes,
98
87
  onClose: onClose,
@@ -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, useMediaQuery } from "@mui/material";
7
+ import { IconButton, Tooltip, Box, useTheme } 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,7 +200,6 @@ const Image = props => {
200
200
  theme: appTheme
201
201
  } = useEditorContext();
202
202
  const classes = useCommonStyle(appTheme);
203
- const isMobile = useMediaQuery("(max-width:599px)");
204
203
  const handleImageClick = () => {
205
204
  try {
206
205
  Transforms.select(editor, {
@@ -281,7 +280,7 @@ const Image = props => {
281
280
  sx: {
282
281
  display: {
283
282
  lg: "flex",
284
- xs: xsHidden && isMobile ? "none" : "flex"
283
+ xs: xsHidden ? "none" : "flex"
285
284
  },
286
285
  width: `100%`,
287
286
  maxWidth: "100%",
@@ -5,7 +5,6 @@ import { IconButton, Tooltip } from "@mui/material";
5
5
  import { DeleteIcon } from "../../assets/svg/AIIcons";
6
6
  import { ReactEditor, useSlateStatic } from "slate-react";
7
7
  import { Transforms } from "slate";
8
- import { CodeElementIcon } from "../../common/iconListV2";
9
8
 
10
9
  // const sanitize = (input) => {
11
10
  // const doc = new DOMParser().parseFromString(input, "text/html");
@@ -19,7 +18,6 @@ import { CodeElementIcon } from "../../common/iconListV2";
19
18
  // return doc.body.innerHTML;
20
19
  // };
21
20
  import { jsx as _jsx } from "react/jsx-runtime";
22
- import { jsxs as _jsxs } from "react/jsx-runtime";
23
21
  import { createElement as _createElement } from "react";
24
22
  const getCode = (embedData, isEncoded) => {
25
23
  if (isEncoded) {
@@ -63,7 +61,6 @@ const Code = props => {
63
61
  } = customProps;
64
62
  const editor = useSlateStatic();
65
63
  const path = ReactEditor.findPath(editor, element);
66
- const hasCode = embedData && getCode(embedData, isEncoded);
67
64
  const onDelete = () => {
68
65
  Transforms.removeNodes(editor, {
69
66
  at: path
@@ -88,20 +85,11 @@ const Code = props => {
88
85
  }
89
86
  }, [embedData]);
90
87
  return /*#__PURE__*/_createElement("div", {
91
- className: `embed-code has-hover ${hasCode ? "has-code" : ""}`,
88
+ className: "embed-code has-hover",
92
89
  contentEditable: false,
93
90
  ...attributes,
94
91
  key: element?.updatedOn
95
- }, !hasCode && /*#__PURE__*/_jsxs("div", {
96
- className: "empty-code",
97
- children: [/*#__PURE__*/_jsx("span", {
98
- className: "code-icon",
99
- children: /*#__PURE__*/_jsx(CodeElementIcon, {})
100
- }), /*#__PURE__*/_jsx("span", {
101
- className: "code-name",
102
- children: translation("Embed Code")
103
- })]
104
- }), /*#__PURE__*/_jsx("div", {
92
+ }, /*#__PURE__*/_jsx("div", {
105
93
  ref: codeRef
106
94
  }), children, !readOnly && /*#__PURE__*/_jsx(ToolBar, {
107
95
  onDelete: onDelete,
@@ -1,10 +1,7 @@
1
1
  import React, { useEffect, useState } from "react";
2
- import { Box, Button, Dialog, DialogActions, DialogContent, DialogTitle, Divider, IconButton, Tooltip, Typography } from "@mui/material";
2
+ import { Box, Button, Dialog, DialogActions, DialogContent, DialogTitle, Tooltip } from "@mui/material";
3
3
  import { insertEmbedScript, updateEmbedScript } from "../../utils/embedScript";
4
4
  import InfoOutlinedIcon from "@mui/icons-material/InfoOutlined";
5
- import { useEditorContext } from "../../hooks/useMouseMove";
6
- import Styles from "./styles";
7
- import CloseRoundedIcon from "@mui/icons-material/CloseRounded";
8
5
  import { jsx as _jsx } from "react/jsx-runtime";
9
6
  import { jsxs as _jsxs } from "react/jsx-runtime";
10
7
  import { Fragment as _Fragment } from "react/jsx-runtime";
@@ -23,10 +20,6 @@ const EmbedScriptPopup = props => {
23
20
  error: false
24
21
  });
25
22
  const [allowedDomains, setAllowedDomains] = useState([]);
26
- const {
27
- theme
28
- } = useEditorContext();
29
- const classes = Styles(theme);
30
23
  const {
31
24
  loading,
32
25
  error
@@ -76,70 +69,50 @@ const EmbedScriptPopup = props => {
76
69
  }
77
70
  onClose();
78
71
  };
79
- const handleClear = () => {
80
- setCode("");
81
- };
82
72
  return /*#__PURE__*/_jsx(_Fragment, {
83
73
  children: /*#__PURE__*/_jsxs(Dialog, {
84
74
  open: open,
85
75
  fullWidth: true,
86
- sx: classes.root,
87
76
  children: [/*#__PURE__*/_jsx(DialogTitle, {
88
77
  children: /*#__PURE__*/_jsxs(Box, {
89
78
  component: "div",
90
79
  sx: {
91
80
  display: "flex",
92
81
  alignItems: "center",
93
- justifyContent: "space-between",
94
- width: "100%"
82
+ gap: "6px"
95
83
  },
96
- children: [/*#__PURE__*/_jsxs(Box, {
97
- sx: {
98
- display: "flex",
99
- alignItems: "center",
100
- gap: "6px"
101
- },
102
- children: [/*#__PURE__*/_jsx(Typography, {
103
- className: "title",
104
- variant: "h6",
105
- children: translation("Embed Code")
106
- }), allowedDomains?.length ? /*#__PURE__*/_jsx(Tooltip, {
107
- title: /*#__PURE__*/_jsxs(Box, {
108
- sx: {
109
- textTransform: "none"
84
+ children: [translation("Embed Code"), allowedDomains?.length ? /*#__PURE__*/_jsx(Tooltip, {
85
+ title: /*#__PURE__*/_jsxs(Box, {
86
+ sx: {
87
+ textTransform: "none"
88
+ },
89
+ children: [/*#__PURE__*/_jsx("span", {
90
+ style: {
91
+ fontWeight: "bold"
110
92
  },
111
- children: [/*#__PURE__*/_jsx("span", {
112
- style: {
113
- fontWeight: "bold"
114
- },
115
- children: translation("Allowed Domains")
116
- }), /*#__PURE__*/_jsx("br", {}), allowedDomains.join(", ")]
117
- }),
118
- children: /*#__PURE__*/_jsx(InfoOutlinedIcon, {
119
- sx: {
120
- fill: "#94A3B8",
121
- cursor: "pointer",
122
- fontSize: "18px"
123
- }
124
- })
125
- }) : null]
126
- }), /*#__PURE__*/_jsx(IconButton, {
127
- className: "close-popupbtn",
128
- onClick: onClose,
129
- children: /*#__PURE__*/_jsx(CloseRoundedIcon, {})
130
- })]
93
+ children: translation("Allowed Domains")
94
+ }), /*#__PURE__*/_jsx("br", {}), allowedDomains.join(", ")]
95
+ }),
96
+ children: /*#__PURE__*/_jsx(InfoOutlinedIcon, {
97
+ color: "gray",
98
+ fontSize: "14px",
99
+ style: {
100
+ fill: "#94A3B8",
101
+ cursor: "pointer"
102
+ }
103
+ })
104
+ }) : null]
131
105
  })
132
- }), /*#__PURE__*/_jsx(Divider, {
133
- className: "divider"
134
106
  }), /*#__PURE__*/_jsxs(DialogContent, {
135
107
  children: [/*#__PURE__*/_jsx("textarea", {
136
108
  value: code,
137
109
  onChange: handleChange,
138
110
  style: {
139
- minHeight: "260px",
111
+ minHeight: "200px",
140
112
  width: "100%",
141
113
  resize: "none",
142
- padding: "4px"
114
+ padding: "4px",
115
+ boxSizing: "border-box"
143
116
  }
144
117
  }), /*#__PURE__*/_jsx(Box, {
145
118
  component: "div",
@@ -148,14 +121,12 @@ const EmbedScriptPopup = props => {
148
121
  })]
149
122
  }), /*#__PURE__*/_jsxs(DialogActions, {
150
123
  children: [/*#__PURE__*/_jsx(Button, {
151
- onClick: handleClear,
152
- className: "clear-btn",
153
- children: translation("Clear")
154
- }), /*#__PURE__*/_jsx(Button, {
155
124
  onClick: onSubmit,
156
125
  disabled: loading,
157
- className: "save-btn",
158
126
  children: loading ? translation("Validating") : translation("Save")
127
+ }), /*#__PURE__*/_jsx(Button, {
128
+ onClick: onClose,
129
+ children: translation("Cancel")
159
130
  })]
160
131
  })]
161
132
  })