@flozy/editor 9.3.0 → 9.3.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.
@@ -57,7 +57,10 @@ const ColumnView = props => {
57
57
  value: row[property?.key] || "",
58
58
  rowIndex: rowIndex,
59
59
  label: property?.label,
60
- readOnly: readOnly
60
+ readOnly: readOnly,
61
+ settings: {
62
+ wrapColumn: property?.wrapColumn
63
+ }
61
64
  }), needAnchor && !readOnly ? /*#__PURE__*/_jsx(Popper, {
62
65
  sx: classes.root,
63
66
  open: open,
@@ -40,13 +40,14 @@ export default function Select(props) {
40
40
  limitTags = 2,
41
41
  placeholder = "",
42
42
  disabled = false,
43
- optionAvatar = false
43
+ optionAvatar = false,
44
+ className = ""
44
45
  } = props;
45
46
  const value = Array.isArray(pValue) ? pValue : [];
46
47
  const options = selectOptions?.length ? selectOptions.filter(s => s.value) : [];
47
48
  return /*#__PURE__*/_jsx(Autocomplete, {
48
49
  disabled: disabled,
49
- className: "tv-ac-field",
50
+ className: `tv-ac-field ${className}`,
50
51
  multiple: true,
51
52
  limitTags: limitTags,
52
53
  placeholder: placeholder,
@@ -102,7 +103,7 @@ export default function Select(props) {
102
103
  },
103
104
  renderTags: (value, getTagProps) => {
104
105
  return /*#__PURE__*/_jsx(Box, {
105
- className: "tv-ms-tag-wrpr",
106
+ className: `tv-ms-tag-wrpr ${className}`,
106
107
  sx: {
107
108
  "& svg": {
108
109
  marginRight: "5px",
@@ -9,8 +9,12 @@ const MultiSelectType = props => {
9
9
  value: pValue,
10
10
  options,
11
11
  label = "",
12
- readOnly
12
+ readOnly,
13
+ settings
13
14
  } = props;
15
+ const {
16
+ wrapColumn
17
+ } = settings;
14
18
  const {
15
19
  onChange
16
20
  } = useDataView();
@@ -27,6 +31,7 @@ const MultiSelectType = props => {
27
31
  });
28
32
  };
29
33
  return /*#__PURE__*/_jsx(Select, {
34
+ className: `wrap-${wrapColumn}`,
30
35
  value: coloredValues,
31
36
  onChange: handleChange,
32
37
  options: options,
@@ -8,8 +8,12 @@ const TextType = props => {
8
8
  rowIndex,
9
9
  property,
10
10
  value,
11
- readOnly
11
+ readOnly,
12
+ settings
12
13
  } = props;
14
+ const {
15
+ wrapColumn
16
+ } = settings;
13
17
  const {
14
18
  onChange
15
19
  } = useDataView();
@@ -34,7 +38,8 @@ const TextType = props => {
34
38
  onChange: handleChange,
35
39
  disabled: readOnly,
36
40
  id: `tv-text-input-${rowIndex}-${property}` // * should be unique
41
+ ,
42
+ multiline: wrapColumn
37
43
  });
38
44
  };
39
-
40
45
  export default TextType;
@@ -7,6 +7,7 @@ import Icon from "../../../../common/Icon";
7
7
  import CloseIcon from "@mui/icons-material/Close";
8
8
  import { jsx as _jsx } from "react/jsx-runtime";
9
9
  import { jsxs as _jsxs } from "react/jsx-runtime";
10
+ const NEED_WRAPS = ["text", "multi-select"];
10
11
  const EditProperty = props => {
11
12
  const {
12
13
  classes,
@@ -21,6 +22,8 @@ const EditProperty = props => {
21
22
  const editData = useRef({
22
23
  ...edit
23
24
  });
25
+ const type = mode?.edit?.type || "";
26
+ const needWrap = NEED_WRAPS?.indexOf(type) >= 0;
24
27
  useEffect(() => {
25
28
  return () => {
26
29
  // on un-mount update the label
@@ -89,6 +92,12 @@ const EditProperty = props => {
89
92
  }, false);
90
93
  onEvent("close");
91
94
  break;
95
+ case "wrapColumn":
96
+ onUpdate({
97
+ wrapColumn: !edit?.wrapColumn
98
+ });
99
+ // onEvent("close");
100
+ break;
92
101
  case "Delete":
93
102
  onEvent("deleteProperty", {
94
103
  ...editData?.current
@@ -109,17 +118,17 @@ const EditProperty = props => {
109
118
  size: "small",
110
119
  onClick: onBack,
111
120
  sx: {
112
- paddingLeft: '0px',
113
- '&:hover': {
114
- background: 'transparent !important'
121
+ paddingLeft: "0px",
122
+ "&:hover": {
123
+ background: "transparent !important"
115
124
  },
116
- '& svg': {
117
- width: '14px !important',
118
- height: '14px !important'
125
+ "& svg": {
126
+ width: "14px !important",
127
+ height: "14px !important"
119
128
  }
120
129
  },
121
130
  children: /*#__PURE__*/_jsx(Icon, {
122
- icon: 'leftArrow'
131
+ icon: "leftArrow"
123
132
  })
124
133
  }), translation("Edit Property")]
125
134
  }), /*#__PURE__*/_jsx(IconButton, {
@@ -127,8 +136,8 @@ const EditProperty = props => {
127
136
  size: "small",
128
137
  onClick: onClose,
129
138
  sx: {
130
- '& svg': {
131
- '& path': {
139
+ "& svg": {
140
+ "& path": {
132
141
  strokeWidth: 0
133
142
  }
134
143
  }
@@ -141,8 +150,8 @@ const EditProperty = props => {
141
150
  label: translation("Field Name"),
142
151
  labelPlacement: "top",
143
152
  sx: {
144
- '& .MuiFormControl-root': {
145
- marginBottom: '4px'
153
+ "& .MuiFormControl-root": {
154
+ marginBottom: "4px"
146
155
  }
147
156
  },
148
157
  control: /*#__PURE__*/_jsx(TextField, {
@@ -152,31 +161,45 @@ const EditProperty = props => {
152
161
  fullWidth: true,
153
162
  placeholder: translation("Field Name")
154
163
  })
155
- }), /*#__PURE__*/_jsx(List, {
164
+ }), needWrap ? /*#__PURE__*/_jsx(List, {
165
+ className: "fe-dv-opt-list",
166
+ children: /*#__PURE__*/_jsxs(ListItemButton, {
167
+ onClick: onAction("wrapColumn"),
168
+ children: [/*#__PURE__*/_jsx(ListItemText, {
169
+ children: "Wrap Column"
170
+ }), /*#__PURE__*/_jsx(ListItemIcon, {
171
+ children: edit?.wrapColumn ? /*#__PURE__*/_jsx(Icon, {
172
+ icon: "toggleOn"
173
+ }) : /*#__PURE__*/_jsx(Icon, {
174
+ icon: "toggleOff"
175
+ })
176
+ })]
177
+ })
178
+ }) : null, /*#__PURE__*/_jsx(List, {
156
179
  className: "fe-dv-opt-list st",
157
180
  children: /*#__PURE__*/_jsxs(ListItemButton, {
158
181
  sx: {
159
- paddingBottom: '12px'
182
+ paddingBottom: "12px"
160
183
  },
161
184
  onClick: onChangeProperty,
162
185
  children: [/*#__PURE__*/_jsx(ListItemText, {
163
186
  children: translation("Type")
164
187
  }), /*#__PURE__*/_jsxs(ListItemIcon, {
165
188
  sx: {
166
- display: 'flex',
189
+ display: "flex",
167
190
  alignItems: "center",
168
191
  gap: 1
169
192
  },
170
193
  children: [/*#__PURE__*/_jsx(Box, {
171
194
  sx: {
172
195
  background: "#64748B1F",
173
- borderRadius: '4px',
174
- display: 'flex',
175
- alignItems: 'center',
176
- padding: '2px',
177
- '& svg': {
178
- width: '16px',
179
- height: '16px'
196
+ borderRadius: "4px",
197
+ display: "flex",
198
+ alignItems: "center",
199
+ padding: "2px",
200
+ "& svg": {
201
+ width: "16px",
202
+ height: "16px"
180
203
  }
181
204
  },
182
205
  children: /*#__PURE__*/_jsx(Icon, {
@@ -186,7 +209,7 @@ const EditProperty = props => {
186
209
  className: "label-tp",
187
210
  children: translation(TYPE_LABELS[edit?.type])
188
211
  }), /*#__PURE__*/_jsx(Icon, {
189
- icon: 'rightArrow'
212
+ icon: "rightArrow"
190
213
  })]
191
214
  })]
192
215
  })
@@ -208,9 +231,9 @@ const EditProperty = props => {
208
231
  onClick: onAction("Visibilty"),
209
232
  children: [/*#__PURE__*/_jsx(ListItemIcon, {
210
233
  children: edit?.visible ? /*#__PURE__*/_jsx(Icon, {
211
- icon: 'eyeSlash'
234
+ icon: "eyeSlash"
212
235
  }) : /*#__PURE__*/_jsx(Icon, {
213
- icon: 'eyeIcon'
236
+ icon: "eyeIcon"
214
237
  })
215
238
  }), /*#__PURE__*/_jsx(ListItemText, {
216
239
  children: `${edit?.visible ? translation("Hide") : translation("Show")} ${translation("in View")}`
@@ -219,7 +242,7 @@ const EditProperty = props => {
219
242
  onClick: onAction("Duplicate"),
220
243
  children: [/*#__PURE__*/_jsx(ListItemIcon, {
221
244
  children: /*#__PURE__*/_jsx(Icon, {
222
- icon: 'duplicateIcon'
245
+ icon: "duplicateIcon"
223
246
  })
224
247
  }), /*#__PURE__*/_jsx(ListItemText, {
225
248
  children: translation("Duplicate Property")
@@ -228,7 +251,7 @@ const EditProperty = props => {
228
251
  onClick: onAction("Delete"),
229
252
  children: [/*#__PURE__*/_jsx(ListItemIcon, {
230
253
  children: /*#__PURE__*/_jsx(Icon, {
231
- icon: 'trashIcon'
254
+ icon: "trashIcon"
232
255
  })
233
256
  }), /*#__PURE__*/_jsx(ListItemText, {
234
257
  children: translation("Delete Property")
@@ -33,7 +33,7 @@ const useTableStyles = (theme, appTheme) => ({
33
33
  height: "40px",
34
34
  maxWidth: "0px !important",
35
35
  minWidth: "0px !important",
36
- "& input": {
36
+ "& input, & textarea": {
37
37
  color: appTheme?.palette?.editor?.tv_text_primary,
38
38
  background: "transparent",
39
39
  fontSize: "14px"
@@ -107,6 +107,9 @@ const useTableStyles = (theme, appTheme) => ({
107
107
  "& .MuiChip-deleteIcon": {
108
108
  minWidth: "22px",
109
109
  minHeight: "22px"
110
+ },
111
+ "&.wrap-true": {
112
+ flexWrap: "wrap"
110
113
  }
111
114
  },
112
115
  "&.Mui-disabled": {
@@ -13,6 +13,9 @@ import EmailRoundedIcon from "@mui/icons-material/EmailRounded";
13
13
  import InfoOutlinedIcon from "@mui/icons-material/InfoOutlined";
14
14
  import GridOnIcon from "@mui/icons-material/GridOn";
15
15
  import GppBadOutlinedIcon from "@mui/icons-material/GppBadOutlined";
16
+ import WrapTextIcon from "@mui/icons-material/WrapText";
17
+ import ToggleOn from "@mui/icons-material/ToggleOn";
18
+ import ToggleOff from "@mui/icons-material/ToggleOff";
16
19
  import { AccordionTextFormatIcon, BoldTextFormatIcon, BulletedListTextFormatIcon, ButtonElementIcon, CarouselElementIcon, CheckListTextFormatIcon, ColorBoxElementIcon, DividerElementIcon, DocUploadElementIcon, EmbedElementIcon, EmojiElementIcon, FormElementIcon, GridElementIcon, H1, H2, H3, ImageElementIcon, ItalicTextFormatIcon, LinkIconV2, OrderedListTextFormatIcon, SignatureElementIcon, TableElementIcon, TopBannerElementIcon, UnderlineTextFormatIcon, VideoElementIcon, LeftAlignTextFormat, CenterAlignTextFormat, RightAlignTextFormat, JustifyTextFormat, FreeGridElement, AppHeaderElement, CodeElementIcon } from "./iconListV2";
17
20
  import MoreVertRoundedIcon from "@mui/icons-material/MoreVertRounded";
18
21
  import SettingsIcon from "../assets/svg/SettingsIcon";
@@ -340,7 +343,21 @@ const iconList = {
340
343
  trashIcon: /*#__PURE__*/_jsx(TrashIcon, {}),
341
344
  dataTable: /*#__PURE__*/_jsx(DataTableIcon, {}),
342
345
  chervUp: /*#__PURE__*/_jsx(ChervUp, {}),
343
- chervDown: /*#__PURE__*/_jsx(ChervDown, {})
346
+ chervDown: /*#__PURE__*/_jsx(ChervDown, {}),
347
+ wrapColumn: /*#__PURE__*/_jsx(WrapTextIcon, {}),
348
+ toggleOn: /*#__PURE__*/_jsx(ToggleOn, {
349
+ sx: {
350
+ fill: "rgb(37, 99, 235)",
351
+ stroke: "rgb(37, 99, 235)"
352
+ }
353
+ }),
354
+ toggleOff: /*#__PURE__*/_jsx(ToggleOff, {
355
+ sx: {
356
+ fill: "#64748B",
357
+ stroke: "#64748B",
358
+ color: "#64748B"
359
+ }
360
+ })
344
361
  };
345
362
  export const icons = {
346
363
  ...iconList
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flozy/editor",
3
- "version": "9.3.0",
3
+ "version": "9.3.1",
4
4
  "description": "An Editor for flozy app brain",
5
5
  "files": [
6
6
  "dist"