@flozy/editor 10.2.4 → 10.2.6

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 (32) hide show
  1. package/dist/Editor/CommonEditor.js +11 -0
  2. package/dist/Editor/Elements/Accordion/Accordion.js +27 -8
  3. package/dist/Editor/Elements/Accordion/AccordionSummary.js +1 -23
  4. package/dist/Editor/Elements/AppHeader/AppHeader.js +7 -2
  5. package/dist/Editor/Elements/Button/EditorButton.js +6 -4
  6. package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/MultiSelect.js +26 -26
  7. package/dist/Editor/Elements/DataView/Layouts/DataTypes/MultiSelectType.js +8 -8
  8. package/dist/Editor/Elements/Form/Form.js +1 -3
  9. package/dist/Editor/Elements/Form/FormElements/FormTextArea.js +0 -1
  10. package/dist/Editor/Elements/Table/TableCell.js +7 -3
  11. package/dist/Editor/common/Checkbox/index.js +46 -0
  12. package/dist/Editor/common/Checkbox/styles.js +45 -0
  13. package/dist/Editor/common/ColorPickerButton.js +3 -0
  14. package/dist/Editor/common/LinkSettings/NavComponents.js +45 -65
  15. package/dist/Editor/common/LinkSettings/index.js +13 -26
  16. package/dist/Editor/common/LinkSettings/navOptions.js +2 -2
  17. package/dist/Editor/common/LinkSettings/style.js +164 -244
  18. package/dist/Editor/common/RadioGroup/index.js +48 -0
  19. package/dist/Editor/common/RadioGroup/styles.js +29 -0
  20. package/dist/Editor/common/RnD/ElementOptions/Actions.js +4 -5
  21. package/dist/Editor/common/RnD/ElementSettings/styles.js +0 -1
  22. package/dist/Editor/common/RnD/OptionsPopup/style.js +0 -1
  23. package/dist/Editor/common/Select/index.js +44 -7
  24. package/dist/Editor/common/Select/styles.js +30 -2
  25. package/dist/Editor/common/StyleBuilder/accordionTitleBtnStyle.js +2 -2
  26. package/dist/Editor/common/StyleBuilder/accordionTitleStyle.js +12 -9
  27. package/dist/Editor/common/SwipeableDrawer/style.js +14 -12
  28. package/dist/Editor/common/iconListV2.js +21 -0
  29. package/dist/Editor/commonStyle.js +18 -0
  30. package/dist/Editor/utils/helper.js +25 -7
  31. package/dist/Editor/utils/insertAppHeader.js +1 -1
  32. package/package.json +1 -1
@@ -1,8 +1,8 @@
1
- import { Autocomplete, Checkbox, FormControlLabel, IconButton, MenuItem, TextField, Typography, createFilterOptions } from "@mui/material";
1
+ import { Autocomplete, TextField, Typography, createFilterOptions } from "@mui/material";
2
2
  import { useEffect, useMemo, useState } from "react";
3
3
  import { useSlate } from "slate-react";
4
4
  import Select from "../Select";
5
- import { CheckedBoxCheckIcon } from "../iconListV2";
5
+ import Checkbox from "../Checkbox";
6
6
  import { jsx as _jsx } from "react/jsx-runtime";
7
7
  import { Fragment as _Fragment } from "react/jsx-runtime";
8
8
  import { jsxs as _jsxs } from "react/jsx-runtime";
@@ -28,24 +28,10 @@ const OpenInNewTab = props => {
28
28
  onNewTabChange,
29
29
  translation
30
30
  } = props;
31
- return nav?.showOpenInNewTab ? /*#__PURE__*/_jsx(FormControlLabel, {
32
- className: "ccheckbox-primary",
33
- control: /*#__PURE__*/_jsx(Checkbox, {
34
- checked: openInNewTab,
35
- onChange: onNewTabChange,
36
- className: "checkBox",
37
- checkedIcon: /*#__PURE__*/_jsx(IconButton, {
38
- className: "checkedIcon",
39
- children: /*#__PURE__*/_jsx(CheckedBoxCheckIcon, {})
40
- }),
41
- icon: /*#__PURE__*/_jsx(IconButton, {
42
- className: "unCheckedIcon"
43
- })
44
- }),
45
- label: /*#__PURE__*/_jsx(Typography, {
46
- variant: "body2",
47
- children: "Open in new tab"
48
- })
31
+ return nav?.showOpenInNewTab ? /*#__PURE__*/_jsx(Checkbox, {
32
+ checked: openInNewTab,
33
+ onChange: onNewTabChange,
34
+ label: translation("Open in new tab")
49
35
  }) : null;
50
36
  };
51
37
  export const TextInput = props => {
@@ -72,8 +58,7 @@ export const SelectPage = props => {
72
58
  value,
73
59
  onChange,
74
60
  services,
75
- translation,
76
- classes
61
+ translation
77
62
  } = props;
78
63
  const [pages, setPages] = useState([]);
79
64
  const editor = useSlate();
@@ -126,28 +111,42 @@ export const SelectPage = props => {
126
111
  }, [value, pages]);
127
112
  const isCurrentPage = page?.value === "_currentPage";
128
113
  return /*#__PURE__*/_jsxs("div", {
129
- children: [/*#__PURE__*/_jsx(FreeSoloCreateOption, {
130
- label: page?.label,
131
- setValue: val => onChange(val?.value || ""),
132
- placeholder: translation("Select Page"),
114
+ children: [/*#__PURE__*/_jsx(Select, {
133
115
  options: pages,
116
+ value: page?.value,
117
+ onChange: e => onChange(e.target.value || ""),
134
118
  disabled: isCurrentPage,
135
- classes: classes
136
- }), /*#__PURE__*/_jsx(FreeSoloCreateOption, {
137
- label: section?.label,
138
- setValue: val => {
139
- let url = page?.value;
140
- if (val?.value) {
141
- url += `#${val?.value}`;
142
- }
143
- onChange(url);
144
- },
145
- placeholder: translation("Select Section or anchor"),
119
+ label: translation("Select Page"),
120
+ showDefault: true,
121
+ translation: translation
122
+ }), /*#__PURE__*/_jsx(Select, {
146
123
  options: page?.sections?.map(p => ({
147
124
  label: p,
148
125
  value: p
149
126
  })),
150
- classes: classes
127
+ value: section?.value,
128
+ onChange: e => {
129
+ const {
130
+ value = ""
131
+ } = e.target;
132
+ let url = page?.value;
133
+ if (value) {
134
+ url += `#${value}`;
135
+ } else {
136
+ const [page] = url.split("#");
137
+ url = page;
138
+ }
139
+ onChange(url);
140
+ },
141
+ disabled: isCurrentPage,
142
+ label: translation("Select Section or anchor"),
143
+ labelProps: {
144
+ sx: {
145
+ padding: "10px 0px 4px 0px"
146
+ }
147
+ },
148
+ showDefault: true,
149
+ translation: translation
151
150
  }), isCurrentPage ? null : /*#__PURE__*/_jsx(OpenInNewTab, {
152
151
  ...props
153
152
  })]
@@ -176,34 +175,15 @@ export const ScrollTopBottom = props => {
176
175
  const {
177
176
  value,
178
177
  onChange,
179
- translation,
180
- classes
178
+ translation
181
179
  } = props;
182
- return /*#__PURE__*/_jsxs(_Fragment, {
183
- children: [/*#__PURE__*/_jsx(Typography, {
184
- variant: "body2",
185
- sx: {
186
- paddingBottom: "4px"
187
- },
188
- children: translation("Choose Top/Bottom of page")
189
- }), /*#__PURE__*/_jsx(Select, {
190
- size: "small",
191
- fullWidth: true,
192
- value: value,
193
- onChange: e => onChange(e.target.value),
194
- MenuProps: {
195
- sx: classes.customSelect
196
- },
197
- children: scrollToOptions.map((option, i) => {
198
- return /*#__PURE__*/_jsx(MenuItem, {
199
- value: option.value,
200
- children: /*#__PURE__*/_jsx(Typography, {
201
- variant: "body2",
202
- children: translation(option.label)
203
- })
204
- }, i);
205
- })
206
- })]
180
+ return /*#__PURE__*/_jsx(Select, {
181
+ options: scrollToOptions,
182
+ value: value,
183
+ onChange: e => onChange(e.target.value),
184
+ label: translation("Choose Top/Bottom of page"),
185
+ showDefault: true,
186
+ translation: translation
207
187
  });
208
188
  };
209
189
  const filter = createFilterOptions();
@@ -5,7 +5,7 @@ import DialogContent from "@mui/material/DialogContent";
5
5
  import DialogActions from "@mui/material/DialogActions";
6
6
  import IconButton from "@mui/material/IconButton";
7
7
  import CloseRoundedIcon from "@mui/icons-material/CloseRounded";
8
- import { Box, FormControl, FormControlLabel, Grid, MenuItem, Radio, RadioGroup, Typography, useMediaQuery } from "@mui/material";
8
+ import { Box, FormControl, Grid, Typography, useMediaQuery } from "@mui/material";
9
9
  import { useState } from "react";
10
10
  import LinkSettingsStyles from "./style";
11
11
  import { getNavOptions } from "./navOptions";
@@ -13,6 +13,7 @@ import { ScrollTopBottom, SelectPage, TextInput, Trigger } from "./NavComponents
13
13
  import SwipeableDrawer from "../SwipeableDrawer";
14
14
  import { useEditorContext } from "../../hooks/useMouseMove";
15
15
  import Select from "../Select";
16
+ import RadioGroup from "../RadioGroup";
16
17
  import { jsx as _jsx } from "react/jsx-runtime";
17
18
  import { jsxs as _jsxs } from "react/jsx-runtime";
18
19
  import { Fragment as _Fragment } from "react/jsx-runtime";
@@ -46,7 +47,7 @@ export default function LinkSettings(props) {
46
47
  tagName,
47
48
  translation
48
49
  } = customProps;
49
- const isMobile = useMediaQuery('(max-width: 899px)');
50
+ const isMobile = useMediaQuery("(max-width: 899px)");
50
51
  const navOptions = getNavOptions(customProps.hideTools, tagName, allowTrigger);
51
52
  const classes = LinkSettingsStyles(theme);
52
53
  const [nav, setNav] = useState(getNav(navType, navOptions));
@@ -68,7 +69,7 @@ export default function LinkSettings(props) {
68
69
  open: true,
69
70
  onClose: handleClose,
70
71
  children: /*#__PURE__*/_jsxs(Grid, {
71
- sx: classes.drawerContainer,
72
+ sx: classes.swipeableDrawerContainer,
72
73
  children: [/*#__PURE__*/_jsx(Typography, {
73
74
  variant: "subtitle1",
74
75
  gutterBottom: true,
@@ -78,8 +79,7 @@ export default function LinkSettings(props) {
78
79
  className: "link-settings-title",
79
80
  children: translation("dialogueTitle")
80
81
  }), /*#__PURE__*/_jsx(Select, {
81
- size: "small",
82
- fullWidth: true,
82
+ options: navOptions,
83
83
  value: nav?.value,
84
84
  onChange: e => {
85
85
  const {
@@ -90,18 +90,10 @@ export default function LinkSettings(props) {
90
90
  setNavValue("");
91
91
  },
92
92
  displayEmpty: true,
93
+ translation: translation,
93
94
  MenuProps: {
94
95
  sx: classes.customSelect
95
- },
96
- children: navOptions.map((navOption, i) => {
97
- return /*#__PURE__*/_jsx(MenuItem, {
98
- value: navOption.value,
99
- children: /*#__PURE__*/_jsx(Typography, {
100
- variant: "body2",
101
- children: translation(navOption.label)
102
- })
103
- }, i);
104
- })
96
+ }
105
97
  }), /*#__PURE__*/_jsx(Box, {
106
98
  sx: {
107
99
  paddingTop: "14px"
@@ -166,18 +158,13 @@ export default function LinkSettings(props) {
166
158
  children: /*#__PURE__*/_jsx(FormControl, {
167
159
  sx: classes.customRadioBtn,
168
160
  children: /*#__PURE__*/_jsx(RadioGroup, {
161
+ options: navOptions,
169
162
  value: nav?.value,
170
- children: navOptions?.map((navOption, i) => {
171
- return /*#__PURE__*/_jsx(FormControlLabel, {
172
- value: navOption.value,
173
- control: /*#__PURE__*/_jsx(Radio, {}),
174
- label: translation(navOption.label),
175
- onChange: () => {
176
- setNav(navOption);
177
- setNavValue("");
178
- }
179
- }, i);
180
- })
163
+ onChange: navOption => {
164
+ setNav(navOption);
165
+ setNavValue("");
166
+ },
167
+ translation: translation
181
168
  })
182
169
  })
183
170
  }), /*#__PURE__*/_jsx(Grid, {
@@ -26,11 +26,11 @@ export const getNavOptions = (hideTools = [], tagName = "", allowTrigger) => {
26
26
  }, {
27
27
  label: "Email",
28
28
  value: "email",
29
- placeholder: "email"
29
+ placeholder: "mail@example.com"
30
30
  }, {
31
31
  label: "Phone number",
32
32
  value: "phone",
33
- placeholder: "phone"
33
+ placeholder: "+1 (702) 123-4567"
34
34
  }];
35
35
  navOptions = navOptions.filter(n => !hideTools.includes(n.value));
36
36
  if (!allowTrigger) {