@flozy/editor 5.5.9 → 5.6.0

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 (199) hide show
  1. package/dist/Editor/ChatEditor.js +25 -34
  2. package/dist/Editor/CommonEditor.js +26 -13
  3. package/dist/Editor/Editor.css +106 -20
  4. package/dist/Editor/Elements/AI/AIInput.js +0 -1
  5. package/dist/Editor/Elements/AI/CustomSelect.js +17 -10
  6. package/dist/Editor/Elements/AI/PopoverAIInput.js +59 -53
  7. package/dist/Editor/Elements/AI/Styles.js +24 -6
  8. package/dist/Editor/Elements/Accordion/Accordion.js +8 -1
  9. package/dist/Editor/Elements/AppHeader/AppHeader.js +6 -6
  10. package/dist/Editor/Elements/Button/EditorButton.js +6 -1
  11. package/dist/Editor/Elements/Carousel/CarouselItem.js +11 -3
  12. package/dist/Editor/Elements/Color Picker/ColorButtons.js +7 -5
  13. package/dist/Editor/Elements/Color Picker/Styles.js +8 -3
  14. package/dist/Editor/Elements/Color Picker/defaultColors.js +2 -2
  15. package/dist/Editor/Elements/DataView/DataView.js +124 -0
  16. package/dist/Editor/Elements/DataView/DataViewButton.js +23 -0
  17. package/dist/Editor/Elements/DataView/Layouts/ColumnView.js +83 -0
  18. package/dist/Editor/Elements/DataView/Layouts/DataTypes/CheckType.js +33 -0
  19. package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/Select.js +180 -0
  20. package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/SimpleSelect.js +62 -0
  21. package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/styles.js +68 -0
  22. package/dist/Editor/Elements/DataView/Layouts/DataTypes/DateType.js +35 -0
  23. package/dist/Editor/Elements/DataView/Layouts/DataTypes/MultiSelectType.js +39 -0
  24. package/dist/Editor/Elements/DataView/Layouts/DataTypes/NumberType.js +30 -0
  25. package/dist/Editor/Elements/DataView/Layouts/DataTypes/PersonType.js +30 -0
  26. package/dist/Editor/Elements/DataView/Layouts/DataTypes/SelectType.js +35 -0
  27. package/dist/Editor/Elements/DataView/Layouts/DataTypes/TextType.js +36 -0
  28. package/dist/Editor/Elements/DataView/Layouts/DataTypes/index.js +17 -0
  29. package/dist/Editor/Elements/DataView/Layouts/FilterSort/SortOptions/ChooseField.js +29 -0
  30. package/dist/Editor/Elements/DataView/Layouts/FilterSort/SortOptions/ChooseSort.js +38 -0
  31. package/dist/Editor/Elements/DataView/Layouts/FilterSort/SortOptions/index.js +86 -0
  32. package/dist/Editor/Elements/DataView/Layouts/FilterSort/index.js +71 -0
  33. package/dist/Editor/Elements/DataView/Layouts/FilterSort/styles.js +138 -0
  34. package/dist/Editor/Elements/DataView/Layouts/FilterView.js +213 -0
  35. package/dist/Editor/Elements/DataView/Layouts/Formula.js +29 -0
  36. package/dist/Editor/Elements/DataView/Layouts/Options/AddOptions.js +113 -0
  37. package/dist/Editor/Elements/DataView/Layouts/Options/AddProperty.js +44 -0
  38. package/dist/Editor/Elements/DataView/Layouts/Options/AllProperties.js +146 -0
  39. package/dist/Editor/Elements/DataView/Layouts/Options/ChangeProperty.js +79 -0
  40. package/dist/Editor/Elements/DataView/Layouts/Options/ColumnsList.js +57 -0
  41. package/dist/Editor/Elements/DataView/Layouts/Options/Constants.js +101 -0
  42. package/dist/Editor/Elements/DataView/Layouts/Options/EditOption.js +174 -0
  43. package/dist/Editor/Elements/DataView/Layouts/Options/EditProperty.js +241 -0
  44. package/dist/Editor/Elements/DataView/Layouts/Options/FilterProperty.js +45 -0
  45. package/dist/Editor/Elements/DataView/Layouts/Options/PropertyList.js +32 -0
  46. package/dist/Editor/Elements/DataView/Layouts/Options/index.js +110 -0
  47. package/dist/Editor/Elements/DataView/Layouts/Options/styles.js +217 -0
  48. package/dist/Editor/Elements/DataView/Layouts/TableStyles.js +131 -0
  49. package/dist/Editor/Elements/DataView/Layouts/TableView.js +253 -0
  50. package/dist/Editor/Elements/DataView/Layouts/ViewData.js +85 -0
  51. package/dist/Editor/Elements/DataView/Layouts/colStyles.js +10 -0
  52. package/dist/Editor/Elements/DataView/Layouts/index.js +25 -0
  53. package/dist/Editor/Elements/DataView/Providers/DataViewProvider.js +277 -0
  54. package/dist/Editor/Elements/DataView/Utils/globalSearch.js +15 -0
  55. package/dist/Editor/Elements/DataView/Utils/multiSortRows.js +88 -0
  56. package/dist/Editor/Elements/DataView/styles.js +169 -0
  57. package/dist/Editor/Elements/Divider/Divider.js +36 -20
  58. package/dist/Editor/Elements/Embed/Image.js +51 -16
  59. package/dist/Editor/Elements/Embed/Video.js +26 -3
  60. package/dist/Editor/Elements/Form/Form.js +38 -2
  61. package/dist/Editor/Elements/Form/FormElements/FormCheckbox.js +7 -1
  62. package/dist/Editor/Elements/Form/FormElements/FormDate.js +7 -1
  63. package/dist/Editor/Elements/Form/FormElements/FormEmail.js +7 -1
  64. package/dist/Editor/Elements/Form/FormElements/FormNumbers.js +7 -1
  65. package/dist/Editor/Elements/Form/FormElements/FormRadioButton.js +7 -1
  66. package/dist/Editor/Elements/Form/FormElements/FormText.js +7 -1
  67. package/dist/Editor/Elements/Form/FormElements/FormTextArea.js +6 -1
  68. package/dist/Editor/Elements/Form/FormPopup.js +12 -9
  69. package/dist/Editor/Elements/Form/Workflow/Styles.js +2 -0
  70. package/dist/Editor/Elements/FreeGrid/FreeGrid.js +1 -1
  71. package/dist/Editor/Elements/FreeGrid/FreeGridBox.js +4 -2
  72. package/dist/Editor/Elements/FreeGrid/FreeGridItem.js +20 -1
  73. package/dist/Editor/Elements/FreeGrid/breakpointConstants.js +4 -4
  74. package/dist/Editor/Elements/FreeGrid/styles.js +1 -1
  75. package/dist/Editor/Elements/Grid/GridButton.js +2 -2
  76. package/dist/Editor/Elements/Grid/GridItem.js +47 -36
  77. package/dist/Editor/Elements/Grid/Styles.js +50 -0
  78. package/dist/Editor/Elements/Link/LinkButton.js +1 -1
  79. package/dist/Editor/Elements/Search/SearchButton.js +1 -0
  80. package/dist/Editor/Elements/Signature/Signature.css +1 -1
  81. package/dist/Editor/Elements/Signature/SignatureOptions/TypeSignature.js +2 -2
  82. package/dist/Editor/Elements/Signature/SignaturePopup.js +17 -52
  83. package/dist/Editor/Elements/SimpleText/index.js +3 -2
  84. package/dist/Editor/Elements/SimpleText/style.js +15 -0
  85. package/dist/Editor/Elements/Table/AddRowCol.js +77 -0
  86. package/dist/Editor/Elements/Table/DragButton.js +142 -0
  87. package/dist/Editor/Elements/Table/DragStyles.js +70 -0
  88. package/dist/Editor/Elements/Table/Draggable.js +25 -0
  89. package/dist/Editor/Elements/Table/Droppable.js +53 -0
  90. package/dist/Editor/Elements/Table/Styles.js +88 -78
  91. package/dist/Editor/Elements/Table/Table.js +263 -140
  92. package/dist/Editor/Elements/Table/TableCell.js +365 -111
  93. package/dist/Editor/Elements/Table/TablePopup.js +9 -3
  94. package/dist/Editor/Elements/Table/TableRow.js +10 -2
  95. package/dist/Editor/Elements/Table/TableTool.js +101 -0
  96. package/dist/Editor/Elements/Table/tableHelper.js +71 -0
  97. package/dist/Editor/Elements/TopBanner/TopBanner.js +2 -1
  98. package/dist/Editor/MiniEditor.js +21 -2
  99. package/dist/Editor/Styles/EditorStyles.js +13 -4
  100. package/dist/Editor/Toolbar/FormatTools/BlockButton.js +10 -0
  101. package/dist/Editor/Toolbar/FormatTools/Dropdown.js +7 -12
  102. package/dist/Editor/Toolbar/FormatTools/FontFamilyAutocomplete.js +26 -4
  103. package/dist/Editor/Toolbar/FormatTools/MarkButton.js +3 -0
  104. package/dist/Editor/Toolbar/FormatTools/TextSize.js +5 -5
  105. package/dist/Editor/Toolbar/Mini/MiniToolbar.js +8 -8
  106. package/dist/Editor/Toolbar/Mini/Styles.js +9 -1
  107. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/InfinityAITool.js +7 -3
  108. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/index.js +6 -4
  109. package/dist/Editor/Toolbar/PopupTool/PopperHeader.js +19 -15
  110. package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +547 -58
  111. package/dist/Editor/Toolbar/PopupTool/TextFormat.js +28 -16
  112. package/dist/Editor/Toolbar/PopupTool/index.js +3 -5
  113. package/dist/Editor/Toolbar/Toolbar.js +6 -0
  114. package/dist/Editor/Toolbar/toolbarGroups.js +4 -0
  115. package/dist/Editor/assets/svg/ArrowDownIcon.js +25 -0
  116. package/dist/Editor/assets/svg/ArrowUpIcon.js +25 -0
  117. package/dist/Editor/assets/svg/BrainIcon.js +2 -2
  118. package/dist/Editor/assets/svg/CalenderIconTick.js +64 -0
  119. package/dist/Editor/assets/svg/ChervDown.js +18 -0
  120. package/dist/Editor/assets/svg/ChervUp.js +18 -0
  121. package/dist/Editor/assets/svg/DataTableIcon.js +50 -0
  122. package/dist/Editor/assets/svg/DuplicateIcon.js +23 -0
  123. package/dist/Editor/assets/svg/EyeIcon.js +23 -0
  124. package/dist/Editor/assets/svg/EyeSlash.js +43 -0
  125. package/dist/Editor/assets/svg/HashtagIcon.js +33 -0
  126. package/dist/Editor/assets/svg/PlusIcon.js +23 -0
  127. package/dist/Editor/assets/svg/SelectRoundedIcon.js +24 -0
  128. package/dist/Editor/assets/svg/SettingsIcon.js +4 -4
  129. package/dist/Editor/assets/svg/SortByIcon.js +33 -0
  130. package/dist/Editor/assets/svg/TableIcons.js +220 -0
  131. package/dist/Editor/assets/svg/TickOutlined.js +23 -0
  132. package/dist/Editor/assets/svg/TrashCanIcon.js +38 -0
  133. package/dist/Editor/common/ColorPickerButton.js +85 -45
  134. package/dist/Editor/common/DnD/Draggable.js +2 -1
  135. package/dist/Editor/common/FontLoader/FontLoader.js +2 -2
  136. package/dist/Editor/common/Icon.js +54 -21
  137. package/dist/Editor/common/ImageSelector/Options/Upload.js +2 -1
  138. package/dist/Editor/common/ImageSelector/Styles.js +47 -6
  139. package/dist/Editor/common/ImageSelector/UploadStyles.js +18 -6
  140. package/dist/Editor/common/LinkSettings/NavComponents.js +2 -1
  141. package/dist/Editor/common/LinkSettings/index.js +2 -1
  142. package/dist/Editor/common/MentionsPopup/Styles.js +142 -8
  143. package/dist/Editor/common/MentionsPopup/index.js +1 -1
  144. package/dist/Editor/common/RnD/ElementSettings/Settings/FormSettings.js +107 -12
  145. package/dist/Editor/common/RnD/GuideLines/styles.js +3 -3
  146. package/dist/Editor/common/RnD/ShadowElement.js +1 -1
  147. package/dist/Editor/common/RnD/VirtualElement/index.js +5 -1
  148. package/dist/Editor/common/RnD/index.js +4 -3
  149. package/dist/Editor/common/Section/index.js +3 -3
  150. package/dist/Editor/common/Section/styles.js +5 -1
  151. package/dist/Editor/common/Select/index.js +20 -0
  152. package/dist/Editor/common/Select/styles.js +17 -0
  153. package/dist/Editor/common/Shorthands/elements.js +13 -1
  154. package/dist/Editor/common/StyleBuilder/fieldStyle.js +2 -1
  155. package/dist/Editor/common/StyleBuilder/fieldTypes/backgroundImage.js +4 -3
  156. package/dist/Editor/common/StyleBuilder/fieldTypes/bannerSpacing.js +35 -7
  157. package/dist/Editor/common/StyleBuilder/fieldTypes/borderRadius.js +15 -2
  158. package/dist/Editor/common/StyleBuilder/fieldTypes/color.js +2 -1
  159. package/dist/Editor/common/StyleBuilder/fieldTypes/fontSize.js +1 -1
  160. package/dist/Editor/common/StyleBuilder/fieldTypes/icons.js +2 -0
  161. package/dist/Editor/common/StyleBuilder/fieldTypes/radiusStyle.js +11 -11
  162. package/dist/Editor/common/StyleBuilder/fieldTypes/saveAsTemplate.js +22 -6
  163. package/dist/Editor/common/StyleBuilder/fieldTypes/selectBox.js +21 -2
  164. package/dist/Editor/common/StyleBuilder/fieldTypes/text.js +20 -4
  165. package/dist/Editor/common/StyleBuilder/fieldTypes/textOptions.js +12 -2
  166. package/dist/Editor/common/StyleBuilder/formStyle.js +268 -149
  167. package/dist/Editor/common/StyleBuilder/index.js +101 -20
  168. package/dist/Editor/common/StyleBuilder/tableStyle.js +69 -25
  169. package/dist/Editor/common/SwipeableDrawer/style.js +15 -4
  170. package/dist/Editor/common/ToolbarIcon.js +1 -1
  171. package/dist/Editor/common/Uploader.js +39 -37
  172. package/dist/Editor/common/iconListV2.js +598 -74
  173. package/dist/Editor/common/iconslist.js +25 -19
  174. package/dist/Editor/commonStyle.js +421 -15
  175. package/dist/Editor/helper/deserialize/index.js +31 -2
  176. package/dist/Editor/helper/enforceDateFormat.js +41 -0
  177. package/dist/Editor/helper/index.js +15 -2
  178. package/dist/Editor/helper/theme.js +15 -1
  179. package/dist/Editor/hooks/useBreakpoints.js +1 -1
  180. package/dist/Editor/hooks/useTable.js +210 -0
  181. package/dist/Editor/plugins/withCustomDeleteBackward.js +34 -3
  182. package/dist/Editor/plugins/withEmbeds.js +30 -26
  183. package/dist/Editor/plugins/withHTML.js +100 -12
  184. package/dist/Editor/plugins/withLayout.js +1 -0
  185. package/dist/Editor/utils/SlateUtilityFunctions.js +31 -11
  186. package/dist/Editor/utils/brains.js +1 -1
  187. package/dist/Editor/utils/chatEditor/SlateUtilityFunctions.js +75 -6
  188. package/dist/Editor/utils/customHooks/useResize.js +7 -4
  189. package/dist/Editor/utils/customHooks/useTableResize.js +6 -2
  190. package/dist/Editor/utils/dataView.js +43 -0
  191. package/dist/Editor/utils/embed.js +2 -1
  192. package/dist/Editor/utils/events.js +0 -1
  193. package/dist/Editor/utils/font.js +11 -4
  194. package/dist/Editor/utils/formfield.js +8 -4
  195. package/dist/Editor/utils/helper.js +100 -2
  196. package/dist/Editor/utils/insertNewLine.js +19 -1
  197. package/dist/Editor/utils/serializeToText.js +2 -0
  198. package/dist/Editor/utils/table.js +228 -24
  199. package/package.json +2 -2
@@ -14,28 +14,33 @@ import ImageFrame from "./Frames/ImageFrame";
14
14
  import LinkSettings from "../../common/LinkSettings";
15
15
  import { handleLinkType } from "../../utils/helper";
16
16
  import { wrapThemeBreakpoints } from "../FreeGrid/breakpointConstants";
17
+ import useCommonStyle from "../../commonStyle";
18
+ import SettingsIcon from "../../assets/svg/SettingsIcon";
17
19
  import { jsx as _jsx } from "react/jsx-runtime";
18
20
  import { jsxs as _jsxs } from "react/jsx-runtime";
19
21
  const ToolBar = ({
20
22
  isEmpty,
21
23
  onSettings,
22
- setOpenNav
24
+ setOpenNav,
25
+ topM,
26
+ classes
23
27
  }) => {
24
28
  return !isEmpty ? /*#__PURE__*/_jsxs("div", {
25
29
  className: "element-toolbar visible-on-hover",
26
30
  contentEditable: false,
27
31
  style: {
28
- top: "0px",
29
- right: "0px",
30
- left: "auto",
31
- margin: "0px"
32
+ top: "-4px",
33
+ left: topM ? "35px" : "0px",
34
+ margin: "0px",
35
+ gap: '3px'
32
36
  },
33
37
  children: [/*#__PURE__*/_jsx(Tooltip, {
34
38
  title: "Image Settings",
35
39
  arrow: true,
36
40
  children: /*#__PURE__*/_jsx(IconButton, {
37
41
  onClick: onSettings,
38
- children: /*#__PURE__*/_jsx(GridSettingsIcon, {})
42
+ sx: classes.buttonMoreOption,
43
+ children: /*#__PURE__*/_jsx(SettingsIcon, {})
39
44
  })
40
45
  }), /*#__PURE__*/_jsx(Tooltip, {
41
46
  title: "Link Settings",
@@ -43,6 +48,7 @@ const ToolBar = ({
43
48
  children: /*#__PURE__*/_jsx(IconButton, {
44
49
  className: "last-btn",
45
50
  onClick: () => setOpenNav(true),
51
+ sx: classes.buttonMoreOption,
46
52
  children: /*#__PURE__*/_jsx(LinkIcon, {})
47
53
  })
48
54
  })]
@@ -64,18 +70,34 @@ const ImageContent = props => {
64
70
  handleImageClick,
65
71
  onTouchEnd,
66
72
  path,
67
- theme
73
+ theme,
74
+ classes
68
75
  } = props;
69
- return !url && !readOnly ? /*#__PURE__*/_jsxs(Box, {
76
+ return !url ? !readOnly ? /*#__PURE__*/_jsxs(Box, {
70
77
  component: "button",
71
78
  className: "element-empty-btn",
72
79
  contentEditable: false,
73
80
  onClick: () => {
74
81
  setOpenSettings(true);
75
82
  },
83
+ sx: {
84
+ ...classes.emptyThumbBtn
85
+ },
76
86
  children: [/*#__PURE__*/_jsx(Icon, {
77
87
  icon: "image"
78
88
  }), "Add Image"]
89
+ }) : /*#__PURE__*/_jsxs(Box, {
90
+ sx: {
91
+ color: "#64748B !important",
92
+ "& svg": {
93
+ color: "#64748B"
94
+ }
95
+ },
96
+ component: "button",
97
+ className: "element-empty-btn",
98
+ children: [/*#__PURE__*/_jsx(Icon, {
99
+ icon: "shieldNoAccess"
100
+ }), "The Content is no longer available."]
79
101
  }) : /*#__PURE__*/_jsx(Box, {
80
102
  component: "img",
81
103
  className: "emb-img",
@@ -155,7 +177,10 @@ const Image = props => {
155
177
  }, {
156
178
  at: path
157
179
  });
158
- }
180
+ },
181
+ MW: 32,
182
+ MH: 32,
183
+ MP: 2
159
184
  });
160
185
  const arr = Array.from(Node.elements(editor));
161
186
  const ele = arr.find(([elem]) => element === elem);
@@ -168,6 +193,10 @@ const Image = props => {
168
193
  onClick,
169
194
  onTouchEnd
170
195
  } = handleLinkType(webAddress, linkType, readOnly, isNewTab);
196
+ const {
197
+ theme: appTheme
198
+ } = useEditorContext();
199
+ const classes = useCommonStyle(appTheme);
171
200
  const handleImageClick = () => {
172
201
  try {
173
202
  Transforms.select(editor, {
@@ -277,7 +306,9 @@ const Image = props => {
277
306
  children: [!readOnly && /*#__PURE__*/_jsx(ToolBar, {
278
307
  isEmpty: isEmpty,
279
308
  onSettings: onSettings,
280
- setOpenNav: setOpenNav
309
+ setOpenNav: setOpenNav,
310
+ topM: size.width < 100,
311
+ classes: classes
281
312
  }), /*#__PURE__*/_jsx(ImageContent, {
282
313
  ...element,
283
314
  readOnly: readOnly,
@@ -285,7 +316,8 @@ const Image = props => {
285
316
  handleImageClick: handleImageClick,
286
317
  onTouchEnd: onTouchEnd,
287
318
  path: path,
288
- theme: theme
319
+ theme: theme,
320
+ classes: classes
289
321
  }), url && frames[frame] ? /*#__PURE__*/_jsx(Box, {
290
322
  component: "div",
291
323
  className: "image-frame",
@@ -301,11 +333,14 @@ const Image = props => {
301
333
  handleImageClick: handleImageClick
302
334
  })
303
335
  }) : null, selected && !readOnly && url && /*#__PURE__*/_jsx(IconButton, {
304
- onPointerDown: onMouseDown,
305
- style: {
306
- opacity: 1,
307
- background: "#FFF"
308
- },
336
+ onPointerDown: onMouseDown
337
+ // style={{
338
+ // opacity: 1,
339
+ // // background: "#FFF",
340
+ // // ...classes.resizeButton
341
+ // }}
342
+ ,
343
+ sx: classes.resizeButton,
309
344
  className: "resize-br visible-on-hover img-resizer",
310
345
  children: /*#__PURE__*/_jsx(AspectRatioIcon, {})
311
346
  })]
@@ -11,6 +11,8 @@ import { GridSettingsIcon } from "../../common/iconslist";
11
11
  import { gradientBorder } from "../../utils/helper";
12
12
  import { getEmbedURL } from "../../helper";
13
13
  import { getBreakPointsValue, getTRBLBreakPoints, groupByBreakpoint } from "../../helper/theme";
14
+ import { useEditorContext } from "../../hooks/useMouseMove";
15
+ import useCommonStyle from "../../commonStyle";
14
16
  import { jsx as _jsx } from "react/jsx-runtime";
15
17
  import { jsxs as _jsxs } from "react/jsx-runtime";
16
18
  const VideoContent = props => {
@@ -68,15 +70,31 @@ const VideoPlaceholder = props => {
68
70
  const {
69
71
  url,
70
72
  readOnly,
71
- onSettings
73
+ onSettings,
74
+ classes
72
75
  } = props;
73
- return !url && !readOnly ? /*#__PURE__*/_jsxs(Box, {
76
+ return !url ? !readOnly ? /*#__PURE__*/_jsxs(Box, {
74
77
  component: "button",
75
78
  className: "element-empty-btn",
76
79
  onClick: onSettings,
80
+ sx: {
81
+ ...classes.emptyThumbBtn
82
+ },
77
83
  children: [/*#__PURE__*/_jsx(Icon, {
78
84
  icon: "video"
79
85
  }), "Embed Video or Other"]
86
+ }) : /*#__PURE__*/_jsxs(Box, {
87
+ sx: {
88
+ color: "#64748B !important",
89
+ "& svg": {
90
+ color: "#64748B"
91
+ }
92
+ },
93
+ component: "button",
94
+ className: "element-empty-btn",
95
+ children: [/*#__PURE__*/_jsx(Icon, {
96
+ icon: "shieldNoAccess"
97
+ }), "The Content is no longer available."]
80
98
  }) : /*#__PURE__*/_jsx(VideoContent, {
81
99
  ...props
82
100
  });
@@ -109,6 +127,10 @@ const Video = ({
109
127
  } = alignment || {};
110
128
  const path = ReactEditor.findPath(editor, element);
111
129
  const hasAspect = url && aspectRatio !== "custom" && aspectRatio;
130
+ const {
131
+ theme: appTheme
132
+ } = useEditorContext();
133
+ const classes = useCommonStyle(appTheme);
112
134
  const getSize = () => {
113
135
  if (element?.size === undefined) {
114
136
  return {
@@ -255,7 +277,8 @@ const Video = ({
255
277
  videoSX: videoSX,
256
278
  url: url,
257
279
  readOnly: readOnly,
258
- resizing: resizing
280
+ resizing: resizing,
281
+ classes: classes
259
282
  }), !readOnly && url ? /*#__PURE__*/_jsx(IconButton, {
260
283
  onPointerDown: onMouseDown,
261
284
  style: {
@@ -1,5 +1,6 @@
1
1
  import React, { useState, useRef, useEffect } from "react";
2
2
  import { Transforms } from "slate";
3
+ import { Node } from "slate";
3
4
  import { useSlateStatic, ReactEditor } from "slate-react";
4
5
  import { IconButton, Tooltip, Grid, Menu, MenuItem, CircularProgress, Box, Typography, useTheme } from "@mui/material";
5
6
  import DeleteIcon from "@mui/icons-material/Delete";
@@ -48,7 +49,15 @@ const Form = props => {
48
49
  textSize,
49
50
  fontFamily,
50
51
  textAlign,
51
- alignment
52
+ alignment,
53
+ fieldFontFamily,
54
+ fieldFontWeight,
55
+ fieldTextSize,
56
+ fieldTextColor,
57
+ fieldBgColor,
58
+ fieldBorderColor,
59
+ fieldBorderWidth,
60
+ fieldBorderStyle
52
61
  } = element;
53
62
  const btnR = buttonProps?.borderRadius || {};
54
63
  const btnSpacing = buttonProps?.bannerSpacing || {};
@@ -190,6 +199,24 @@ const Form = props => {
190
199
  }, {
191
200
  at: path
192
201
  });
202
+ // adding form field style to the current form node
203
+ const currentNode = Node.get(editor, path);
204
+ if (currentNode) {
205
+ currentNode.children.forEach((item, index) => {
206
+ Transforms.setNodes(editor, {
207
+ bgColor: data?.fieldBgColor ? data?.fieldBgColor : "rgba(255, 255, 255, 1)",
208
+ borderColor: data?.fieldBorderColor ? data?.fieldBorderColor : "#ccc",
209
+ borderStyle: data?.fieldBorderStyle ? data?.fieldBorderStyle : "",
210
+ borderWidth: data?.fieldBorderWidth ? data?.fieldBorderWidth : "",
211
+ textColor: data?.fieldTextColor ? data?.fieldTextColor : "",
212
+ fontFamily: data?.fieldFontFamily ? data?.fieldFontFamily : "",
213
+ textSize: data?.fieldTextSize ? data?.fieldTextSize : "",
214
+ fontWeight: data?.fieldFontWeight ? data?.fieldFontWeight : ""
215
+ }, {
216
+ at: [...path, index]
217
+ });
218
+ });
219
+ }
193
220
  onClose();
194
221
  };
195
222
  const onClose = () => {
@@ -198,7 +225,16 @@ const Form = props => {
198
225
  const onAddFormField = () => {
199
226
  try {
200
227
  Transforms.insertNodes(editor, {
201
- ...formField()
228
+ ...formField({
229
+ fontFamily: fieldFontFamily,
230
+ fontWeight: fieldFontWeight,
231
+ textSize: fieldTextSize,
232
+ textColor: fieldTextColor,
233
+ bgColor: fieldBgColor,
234
+ borderColor: fieldBorderColor,
235
+ borderWidth: fieldBorderWidth,
236
+ borderStyle: fieldBorderStyle
237
+ })
202
238
  }, {
203
239
  at: [...path, children.length]
204
240
  });
@@ -16,6 +16,9 @@ const FormCheckbox = props => {
16
16
  textColor,
17
17
  bgColor,
18
18
  lockSpacing,
19
+ textSize,
20
+ fontFamily,
21
+ fontWeight,
19
22
  ...rest
20
23
  } = fieldProps;
21
24
  const onChange = e => {
@@ -46,7 +49,10 @@ const FormCheckbox = props => {
46
49
  },
47
50
  borderStyle: borderStyle || "solid",
48
51
  color: textColor || "#000",
49
- background: bgColor || "transparent"
52
+ background: bgColor || "transparent",
53
+ fontFamily: fontFamily || "PoppinsRegular",
54
+ fontSize: textSize || "inherit",
55
+ fontWeight: `${fontWeight} !important` || "400 !important"
50
56
  }
51
57
  })
52
58
  });
@@ -16,6 +16,9 @@ const FormDate = props => {
16
16
  textColor,
17
17
  bgColor,
18
18
  lockSpacing,
19
+ textSize,
20
+ fontFamily,
21
+ fontWeight,
19
22
  ...rest
20
23
  } = fieldProps;
21
24
  const onChange = e => {
@@ -47,7 +50,10 @@ const FormDate = props => {
47
50
  borderStyle: borderStyle || "solid",
48
51
  color: textColor || "#000",
49
52
  background: bgColor || "transparent",
50
- paddingRight: '85px !important'
53
+ paddingRight: '85px !important',
54
+ fontFamily: fontFamily || "PoppinsRegular",
55
+ fontSize: textSize || "inherit",
56
+ fontWeight: `${fontWeight} !important` || "400 !important"
51
57
  }
52
58
  })
53
59
  });
@@ -16,6 +16,9 @@ const FormEmail = props => {
16
16
  textColor,
17
17
  bgColor,
18
18
  lockSpacing,
19
+ textSize,
20
+ fontFamily,
21
+ fontWeight,
19
22
  ...rest
20
23
  } = fieldProps;
21
24
  const onChange = e => {
@@ -47,7 +50,10 @@ const FormEmail = props => {
47
50
  },
48
51
  borderStyle: borderStyle || "solid",
49
52
  color: textColor || "#000",
50
- background: bgColor || "transparent"
53
+ background: bgColor || "transparent",
54
+ fontFamily: fontFamily || "PoppinsRegular",
55
+ fontSize: textSize || "inherit",
56
+ fontWeight: `${fontWeight} !important` || "400 !important"
51
57
  }
52
58
  })
53
59
  });
@@ -16,6 +16,9 @@ const FormNumbers = props => {
16
16
  textColor,
17
17
  bgColor,
18
18
  lockSpacing,
19
+ textSize,
20
+ fontFamily,
21
+ fontWeight,
19
22
  ...rest
20
23
  } = fieldProps;
21
24
  const onChange = e => {
@@ -63,7 +66,10 @@ const FormNumbers = props => {
63
66
  },
64
67
  borderStyle: borderStyle || "solid",
65
68
  color: textColor || "#000",
66
- background: bgColor || "transparent"
69
+ background: bgColor || "transparent",
70
+ fontFamily: fontFamily || "PoppinsRegular",
71
+ fontSize: textSize || "inherit",
72
+ fontWeight: `${fontWeight} !important` || "400 !important"
67
73
  }
68
74
  })
69
75
  });
@@ -16,6 +16,9 @@ const FormRadioButton = props => {
16
16
  textColor,
17
17
  bgColor,
18
18
  lockSpacing,
19
+ textSize,
20
+ fontFamily,
21
+ fontWeight,
19
22
  ...rest
20
23
  } = fieldProps;
21
24
  const onChange = e => {
@@ -46,7 +49,10 @@ const FormRadioButton = props => {
46
49
  },
47
50
  borderStyle: borderStyle || "solid",
48
51
  color: textColor || "#000",
49
- background: bgColor || "transparent"
52
+ background: bgColor || "transparent",
53
+ fontFamily: fontFamily || "PoppinsRegular",
54
+ fontSize: textSize || "inherit",
55
+ fontWeight: `${fontWeight} !important` || "400 !important"
50
56
  }
51
57
  })
52
58
  });
@@ -16,6 +16,9 @@ const FormText = props => {
16
16
  textColor,
17
17
  bgColor,
18
18
  lockSpacing,
19
+ textSize,
20
+ fontFamily,
21
+ fontWeight,
19
22
  ...rest
20
23
  } = fieldProps;
21
24
  const onChange = e => {
@@ -45,7 +48,10 @@ const FormText = props => {
45
48
  },
46
49
  borderStyle: borderStyle || "solid",
47
50
  color: textColor || "#000",
48
- background: bgColor || "transparent"
51
+ background: bgColor || "transparent",
52
+ fontSize: textSize || "inherit",
53
+ fontFamily: fontFamily || "PoppinsRegular",
54
+ fontWeight: `${fontWeight} !important` || "400 !important"
49
55
  }
50
56
  })
51
57
  });
@@ -15,6 +15,9 @@ const FormTextArea = props => {
15
15
  borderColor,
16
16
  textColor,
17
17
  bgColor,
18
+ textSize,
19
+ fontFamily,
20
+ fontWeight,
18
21
  ...rest
19
22
  } = fieldProps;
20
23
  const onChange = e => {
@@ -45,7 +48,9 @@ const FormTextArea = props => {
45
48
  borderStyle: borderStyle || "solid",
46
49
  color: `${textColor || "#000"} !important`,
47
50
  background: `${bgColor || "transparent"} !important`,
48
- fontSize: '14px'
51
+ fontSize: textSize || "14px",
52
+ fontFamily: fontFamily || "PoppinsRegular",
53
+ fontWeight: `${fontWeight} !important` || "400 !important"
49
54
  }
50
55
  })
51
56
  });
@@ -1,7 +1,8 @@
1
1
  import React from "react";
2
2
  import StyleBuilder from "../../common/StyleBuilder";
3
- import formStyle from "../../common/StyleBuilder/formStyle";
3
+ import { formStyle } from "../../common/StyleBuilder/formStyle";
4
4
  import { jsx as _jsx } from "react/jsx-runtime";
5
+ import { Fragment as _Fragment } from "react/jsx-runtime";
5
6
  const FormPopup = props => {
6
7
  const {
7
8
  element,
@@ -9,14 +10,16 @@ const FormPopup = props => {
9
10
  onClose,
10
11
  customProps
11
12
  } = props;
12
- return /*#__PURE__*/_jsx(StyleBuilder, {
13
- title: "Form",
14
- type: "formStyle",
15
- element: element,
16
- onSave: onSave,
17
- onClose: onClose,
18
- renderTabs: formStyle,
19
- customProps: customProps
13
+ return /*#__PURE__*/_jsx(_Fragment, {
14
+ children: /*#__PURE__*/_jsx(StyleBuilder, {
15
+ title: "Form",
16
+ type: "formStyle",
17
+ element: element,
18
+ onSave: onSave,
19
+ onClose: onClose,
20
+ renderTabs: formStyle,
21
+ customProps: customProps
22
+ })
20
23
  });
21
24
  };
22
25
  export default FormPopup;
@@ -19,6 +19,7 @@ const FormStyles = theme => ({
19
19
  "& .editorWorkflow": {
20
20
  minHeight: '130px',
21
21
  padding: '12px',
22
+ paddingBottom: 0,
22
23
  '&:focus-visible': {
23
24
  outline: 'none',
24
25
  border: 'none'
@@ -104,6 +105,7 @@ const FormStyles = theme => ({
104
105
  padding: "4px 22px",
105
106
  textTransform: "none",
106
107
  border: "1px solid #D8DDE1",
108
+ minWidth: '126px',
107
109
  "& svg": {
108
110
  "& path": {
109
111
  stroke: "#64748B"
@@ -276,7 +276,7 @@ const FreeGrid = props => {
276
276
  ...insertFreeGridItem("table", {
277
277
  ...DEFAULT_TABLE_NODE()
278
278
  }, {
279
- height: 130,
279
+ height: 150,
280
280
  width: 400
281
281
  })
282
282
  }], {
@@ -25,7 +25,8 @@ const FreeGridBox = props => {
25
25
  const editor = useSlateStatic();
26
26
  const path = ReactEditor.findPath(editor, element);
27
27
  const {
28
- readOnly
28
+ readOnly,
29
+ hideTools
29
30
  } = customProps;
30
31
  const {
31
32
  updated_at,
@@ -147,12 +148,13 @@ const FreeGridBox = props => {
147
148
  }
148
149
  };
149
150
  const repeatTimes = Math.floor(height / ROW_HEIGHT);
151
+ const sectionTypeOptions = (itemOptions?.box || []).filter(f => (hideTools || []).indexOf(f) === -1);
150
152
  return /*#__PURE__*/_jsx(RnD, {
151
153
  id: `freegrid_box_item_${path.join("|")}_${updated_at}_${breakpoint}`,
152
154
  className: `freegrid-item path-${path.length} breakpoint-${breakpoint}`,
153
155
  editor: editor,
154
156
  path: path,
155
- actions: itemOptions?.box,
157
+ actions: sectionTypeOptions,
156
158
  settingsProps: {
157
159
  settings: "freegridBoxItem",
158
160
  onChange: onChangeSettings,
@@ -144,8 +144,27 @@ const FreeGridItem = props => {
144
144
  };
145
145
  const onAddFormField = () => {
146
146
  try {
147
+ const {
148
+ fieldFontFamily,
149
+ fieldFontWeight,
150
+ fieldTextSize,
151
+ fieldTextColor,
152
+ fieldBgColor,
153
+ fieldBorderColor,
154
+ fieldBorderWidth,
155
+ fieldBorderStyle
156
+ } = element?.children[0];
147
157
  Transforms.insertNodes(editor, {
148
- ...formField()
158
+ ...formField({
159
+ fontFamily: fieldFontFamily ? fieldFontFamily : "",
160
+ fontWeight: fieldFontWeight ? fieldFontWeight : "",
161
+ textSize: fieldTextSize ? fieldTextSize : "",
162
+ textColor: fieldTextColor ? fieldTextColor : "",
163
+ bgColor: fieldBgColor ? fieldBgColor : "",
164
+ borderColor: fieldBorderColor ? fieldBorderColor : "",
165
+ borderWidth: fieldBorderWidth ? fieldBorderWidth : "",
166
+ borderStyle: fieldBorderStyle ? fieldBorderStyle : ""
167
+ })
149
168
  }, {
150
169
  at: [...path, 0, 0]
151
170
  });
@@ -47,22 +47,22 @@ export function wrapThemeBreakpoints(sxProp, prop, theme) {
47
47
  const formatedSxProp = Object.keys(sxProp).reduce((a, b) => {
48
48
  switch (b) {
49
49
  case "md":
50
- a[theme.breakpoints.up("lg")] = {
50
+ a[theme?.breakpoints?.up("lg")] = {
51
51
  [prop]: sxProp["md"] || sxProp["lg"]
52
52
  };
53
53
  break;
54
54
  case "sm":
55
- a[theme.breakpoints.up("lg")] = {
55
+ a[theme?.breakpoints?.up("lg")] = {
56
56
  [prop]: sxProp["sm"] || sxProp["lg"]
57
57
  };
58
58
  break;
59
59
  case "xs":
60
- a[theme.breakpoints.between("xs", "md")] = {
60
+ a[theme?.breakpoints?.between("xs", "md")] = {
61
61
  [prop]: sxProp["xs"] || sxProp["lg"]
62
62
  };
63
63
  break;
64
64
  default:
65
- a[theme.breakpoints.up("lg")] = {
65
+ a[theme?.breakpoints?.up("lg")] = {
66
66
  [prop]: sxProp["lg"]
67
67
  };
68
68
  }
@@ -318,7 +318,7 @@ const useFreeGridStyles = ({
318
318
  "& .element-toolbar": {
319
319
  display: "none"
320
320
  },
321
- [theme.breakpoints.between("xs", "md")]: {
321
+ [theme?.breakpoints?.between("xs", "md")]: {
322
322
  marginLeft: `calc((100% - 320px) * 0.5)`
323
323
  }
324
324
  },
@@ -1,9 +1,9 @@
1
1
  import React, { useState } from "react";
2
2
  import { Button, Dialog, DialogContent, DialogTitle, Grid, Tooltip, Box } from "@mui/material";
3
3
  import { insertGrid, insertPlainGrid } from "../../utils/grid";
4
- import { GridIcon } from "../../common/iconslist";
5
4
  import ToolbarIcon from "../../common/ToolbarIcon";
6
5
  import GridStyles from "./Styles";
6
+ import { GridElement } from "../../common/iconListV2";
7
7
  import { jsx as _jsx } from "react/jsx-runtime";
8
8
  import { jsxs as _jsxs } from "react/jsx-runtime";
9
9
  import { Fragment as _Fragment } from "react/jsx-runtime";
@@ -46,7 +46,7 @@ const GridButton = props => {
46
46
  children: [/*#__PURE__*/_jsx(ToolbarIcon, {
47
47
  title: "Column",
48
48
  onClick: onButtonClick,
49
- icon: /*#__PURE__*/_jsx(GridIcon, {}),
49
+ icon: /*#__PURE__*/_jsx(GridElement, {}),
50
50
  icoBtnType: icoBtnType
51
51
  }), /*#__PURE__*/_jsxs(Dialog, {
52
52
  open: open,