@flozy/editor 10.5.1 → 10.5.3

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 (60) hide show
  1. package/dist/Editor/CommonEditor.js +6 -4
  2. package/dist/Editor/Elements/Button/EditorButton.js +0 -2
  3. package/dist/Editor/Elements/DataView/Layouts/ColumnView.js +4 -2
  4. package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/MultiSelect.js +454 -0
  5. package/dist/Editor/Elements/DataView/Layouts/DataTypes/MultiSelectType.js +23 -8
  6. package/dist/Editor/Elements/DataView/Layouts/Options/AddOptions.js +5 -1
  7. package/dist/Editor/Elements/DataView/Layouts/Options/EditOption.js +3 -2
  8. package/dist/Editor/Elements/DataView/Layouts/Options/index.js +11 -0
  9. package/dist/Editor/Elements/DataView/Layouts/ViewData.js +8 -4
  10. package/dist/Editor/Elements/Embed/Image.js +3 -2
  11. package/dist/Editor/Elements/EmbedScript/Code.js +14 -2
  12. package/dist/Editor/Elements/EmbedScript/EmbedScriptPopup.js +57 -28
  13. package/dist/Editor/Elements/EmbedScript/styles.js +89 -0
  14. package/dist/Editor/Elements/Form/Form.js +181 -168
  15. package/dist/Editor/Elements/Form/FormElements/FormText.js +23 -6
  16. package/dist/Editor/Elements/Form/FormElements/FormTextArea.js +3 -2
  17. package/dist/Editor/Elements/Form/FormField.js +10 -4
  18. package/dist/Editor/Elements/FreeGrid/FreeGrid.js +6 -4
  19. package/dist/Editor/Elements/FreeGrid/Options/More.js +1 -1
  20. package/dist/Editor/Elements/FreeGrid/Options/sectionItemOptions.js +1 -1
  21. package/dist/Editor/Elements/FreeGrid/styles.js +61 -7
  22. package/dist/Editor/Elements/List/CheckList.js +3 -2
  23. package/dist/Editor/Elements/Search/SearchAttachment.js +40 -9
  24. package/dist/Editor/Elements/Search/SearchButton.js +9 -8
  25. package/dist/Editor/Elements/Search/SearchList.js +9 -7
  26. package/dist/Editor/Elements/SimpleText/index.js +6 -1
  27. package/dist/Editor/Elements/Table/TableCell.js +7 -3
  28. package/dist/Editor/Toolbar/PopupTool/TextFormat.js +43 -18
  29. package/dist/Editor/assets/svg/ClearAllRounded.js +31 -0
  30. package/dist/Editor/assets/svg/ResetIconNew.js +23 -0
  31. package/dist/Editor/assets/svg/SettingsIcon.js +1 -0
  32. package/dist/Editor/common/Icon.js +3 -1
  33. package/dist/Editor/common/LinkSettings/NavComponents.js +34 -8
  34. package/dist/Editor/common/LinkSettings/index.js +85 -69
  35. package/dist/Editor/common/LinkSettings/style.js +245 -30
  36. package/dist/Editor/common/MentionsPopup/index.js +4 -1
  37. package/dist/Editor/common/RnD/ElementOptions/Actions.js +13 -14
  38. package/dist/Editor/common/RnD/ElementOptions/Icons/LinkIcon.js +1 -0
  39. package/dist/Editor/common/RnD/ElementOptions/index.js +2 -2
  40. package/dist/Editor/common/RnD/ElementOptions/styles.js +28 -1
  41. package/dist/Editor/common/RnD/ElementSettings/OtherSettings/Settings.js +4 -4
  42. package/dist/Editor/common/RnD/ElementSettings/styles.js +147 -12
  43. package/dist/Editor/common/RnD/OptionsPopup/index.js +8 -5
  44. package/dist/Editor/common/RnD/OptionsPopup/style.js +121 -19
  45. package/dist/Editor/common/RnD/SwitchViewport/SwitchViewport.js +0 -6
  46. package/dist/Editor/common/Select/index.js +2 -0
  47. package/dist/Editor/common/Shorthands/elements.js +11 -11
  48. package/dist/Editor/common/SnackBar/index.js +43 -0
  49. package/dist/Editor/common/StyleBuilder/fieldTypes/lineSpacing.js +7 -6
  50. package/dist/Editor/common/StyleBuilder/fieldTypes/menusArray.js +13 -6
  51. package/dist/Editor/common/StyleBuilder/pageSettingsStyle.js +5 -7
  52. package/dist/Editor/common/iconListV2.js +101 -6
  53. package/dist/Editor/common/iconslist.js +3 -0
  54. package/dist/Editor/commonStyle.js +70 -1
  55. package/dist/Editor/hooks/useMouseMove.js +2 -5
  56. package/dist/Editor/utils/SlateUtilityFunctions.js +12 -10
  57. package/dist/Editor/utils/form.js +4 -4
  58. package/dist/Editor/utils/formfield.js +8 -2
  59. package/dist/Editor/utils/helper.js +76 -0
  60. package/package.json +1 -1
@@ -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%",
@@ -5,6 +5,7 @@ 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";
8
9
 
9
10
  // const sanitize = (input) => {
10
11
  // const doc = new DOMParser().parseFromString(input, "text/html");
@@ -18,6 +19,7 @@ import { Transforms } from "slate";
18
19
  // return doc.body.innerHTML;
19
20
  // };
20
21
  import { jsx as _jsx } from "react/jsx-runtime";
22
+ import { jsxs as _jsxs } from "react/jsx-runtime";
21
23
  import { createElement as _createElement } from "react";
22
24
  const getCode = (embedData, isEncoded) => {
23
25
  if (isEncoded) {
@@ -61,6 +63,7 @@ const Code = props => {
61
63
  } = customProps;
62
64
  const editor = useSlateStatic();
63
65
  const path = ReactEditor.findPath(editor, element);
66
+ const hasCode = embedData && getCode(embedData, isEncoded);
64
67
  const onDelete = () => {
65
68
  Transforms.removeNodes(editor, {
66
69
  at: path
@@ -85,11 +88,20 @@ const Code = props => {
85
88
  }
86
89
  }, [embedData]);
87
90
  return /*#__PURE__*/_createElement("div", {
88
- className: "embed-code has-hover",
91
+ className: `embed-code has-hover ${hasCode ? "has-code" : ""}`,
89
92
  contentEditable: false,
90
93
  ...attributes,
91
94
  key: element?.updatedOn
92
- }, /*#__PURE__*/_jsx("div", {
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", {
93
105
  ref: codeRef
94
106
  }), children, !readOnly && /*#__PURE__*/_jsx(ToolBar, {
95
107
  onDelete: onDelete,
@@ -1,7 +1,10 @@
1
1
  import React, { useEffect, useState } from "react";
2
- import { Box, Button, Dialog, DialogActions, DialogContent, DialogTitle, Tooltip } from "@mui/material";
2
+ import { Box, Button, Dialog, DialogActions, DialogContent, DialogTitle, Divider, IconButton, Tooltip, Typography } 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";
5
8
  import { jsx as _jsx } from "react/jsx-runtime";
6
9
  import { jsxs as _jsxs } from "react/jsx-runtime";
7
10
  import { Fragment as _Fragment } from "react/jsx-runtime";
@@ -20,6 +23,10 @@ const EmbedScriptPopup = props => {
20
23
  error: false
21
24
  });
22
25
  const [allowedDomains, setAllowedDomains] = useState([]);
26
+ const {
27
+ theme
28
+ } = useEditorContext();
29
+ const classes = Styles(theme);
23
30
  const {
24
31
  loading,
25
32
  error
@@ -69,50 +76,70 @@ const EmbedScriptPopup = props => {
69
76
  }
70
77
  onClose();
71
78
  };
79
+ const handleClear = () => {
80
+ setCode("");
81
+ };
72
82
  return /*#__PURE__*/_jsx(_Fragment, {
73
83
  children: /*#__PURE__*/_jsxs(Dialog, {
74
84
  open: open,
75
85
  fullWidth: true,
86
+ sx: classes.root,
76
87
  children: [/*#__PURE__*/_jsx(DialogTitle, {
77
88
  children: /*#__PURE__*/_jsxs(Box, {
78
89
  component: "div",
79
90
  sx: {
80
91
  display: "flex",
81
92
  alignItems: "center",
82
- gap: "6px"
93
+ justifyContent: "space-between",
94
+ width: "100%"
83
95
  },
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"
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"
92
110
  },
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]
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
+ })]
105
131
  })
132
+ }), /*#__PURE__*/_jsx(Divider, {
133
+ className: "divider"
106
134
  }), /*#__PURE__*/_jsxs(DialogContent, {
107
135
  children: [/*#__PURE__*/_jsx("textarea", {
108
136
  value: code,
109
137
  onChange: handleChange,
110
138
  style: {
111
- minHeight: "200px",
139
+ minHeight: "260px",
112
140
  width: "100%",
113
141
  resize: "none",
114
- padding: "4px",
115
- boxSizing: "border-box"
142
+ padding: "4px"
116
143
  }
117
144
  }), /*#__PURE__*/_jsx(Box, {
118
145
  component: "div",
@@ -121,12 +148,14 @@ const EmbedScriptPopup = props => {
121
148
  })]
122
149
  }), /*#__PURE__*/_jsxs(DialogActions, {
123
150
  children: [/*#__PURE__*/_jsx(Button, {
151
+ onClick: handleClear,
152
+ className: "clear-btn",
153
+ children: translation("Clear")
154
+ }), /*#__PURE__*/_jsx(Button, {
124
155
  onClick: onSubmit,
125
156
  disabled: loading,
157
+ className: "save-btn",
126
158
  children: loading ? translation("Validating") : translation("Save")
127
- }), /*#__PURE__*/_jsx(Button, {
128
- onClick: onClose,
129
- children: translation("Cancel")
130
159
  })]
131
160
  })]
132
161
  })
@@ -0,0 +1,89 @@
1
+ const Styles = theme => ({
2
+ root: {
3
+ "& .MuiPaper-root": {
4
+ borderRadius: "12px",
5
+ backgroundColor: theme?.palette?.editor?.miniToolBarBackground,
6
+ border: `1px solid ${theme?.palette?.editor?.miniToolBarBorder}`,
7
+ overflow: "hidden"
8
+ },
9
+ "& textarea": {
10
+ backgroundColor: theme?.palette?.editor?.inputFieldBgColor,
11
+ border: `1px solid ${theme?.palette?.editor?.inputFieldBorder}`,
12
+ borderRadius: "12px",
13
+ padding: "10px !important",
14
+ color: theme?.palette?.editor?.textColor,
15
+ boxShadow: "0px 4px 18px 0px #00000014",
16
+ "&:focus": {
17
+ border: `1px solid #2563EB`,
18
+ boxShadow: "0px 4px 18px 0px #2563EB1F",
19
+ outline: "none"
20
+ },
21
+ "&:focus-visible": {
22
+ border: `1px solid #2563EB`,
23
+ boxShadow: "0px 4px 18px 0px #2563EB1F",
24
+ outline: "none"
25
+ }
26
+ },
27
+ "& .MuiDialogTitle-root": {
28
+ padding: "20px 24px 16px 24px"
29
+ },
30
+ "& .title": {
31
+ color: theme?.palette?.editor?.textColor,
32
+ fontWeight: 600,
33
+ fontSize: "20px",
34
+ fontFamily: "Inter, sans-serif"
35
+ },
36
+ "& .close-popupbtn": {
37
+ background: theme?.palette?.editor?.closeButtonBgColor,
38
+ color: `${theme?.palette?.editor?.closeButtonSvgStroke} !important`,
39
+ "& svg": {
40
+ color: `${theme?.palette?.editor?.closeButtonSvgStroke} !important`
41
+ }
42
+ },
43
+ "& .divider": {
44
+ margin: "0px 24px",
45
+ background: theme?.palette?.editor?.deviderBgColor
46
+ },
47
+ "& .save-btn": {
48
+ backgroundColor: "#2563EB",
49
+ color: "#ffffff",
50
+ fontWeight: 600,
51
+ fontSize: "14px",
52
+ opacity: 1,
53
+ borderRadius: "8px",
54
+ textTransform: "math-auto",
55
+ height: "36px",
56
+ padding: "0px 12px",
57
+ minWidth: "90px",
58
+ "&:hover": {
59
+ backgroundColor: "#2563EB"
60
+ },
61
+ "@media only screen and (max-width: 899px)": {
62
+ width: "50%"
63
+ }
64
+ },
65
+ "& .clear-btn": {
66
+ padding: "8px 12px",
67
+ color: theme?.palette?.editor?.customDialogueCloseBtnColor,
68
+ fontWeight: 600,
69
+ fontSize: "14px",
70
+ opacity: 1,
71
+ borderRadius: "8px",
72
+ textTransform: "math-auto",
73
+ height: "36px",
74
+ minWidth: "90px",
75
+ backgroundColor: theme?.palette?.editor?.closeButtonBackground,
76
+ border: `1px solid ${theme?.palette?.editor?.customDialogueCloseBtnBorder}`,
77
+ "&:hover": {
78
+ backgroundColor: theme?.palette?.editor?.closeButtonBackground
79
+ },
80
+ "@media only screen and (max-width: 899px)": {
81
+ width: "50%"
82
+ }
83
+ },
84
+ "& .MuiDialogActions-root": {
85
+ padding: "0px 22px 16px 0px"
86
+ }
87
+ }
88
+ });
89
+ export default Styles;