@flozy/editor 1.3.5 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (60) hide show
  1. package/dist/Editor/CommonEditor.js +4 -2
  2. package/dist/Editor/Editor.css +64 -20
  3. package/dist/Editor/Elements/AppHeader/AppHeader.js +41 -13
  4. package/dist/Editor/Elements/Button/ButtonPopup.js +5 -3
  5. package/dist/Editor/Elements/Button/EditorButton.js +29 -6
  6. package/dist/Editor/Elements/Embed/Image.js +5 -21
  7. package/dist/Editor/Elements/Embed/Video.js +2 -2
  8. package/dist/Editor/Elements/Form/FieldPopup.js +20 -0
  9. package/dist/Editor/Elements/Form/Form.js +289 -0
  10. package/dist/Editor/Elements/Form/FormButton.js +21 -0
  11. package/dist/Editor/Elements/Form/FormElements/FormText.js +48 -0
  12. package/dist/Editor/Elements/Form/FormElements/index.js +5 -0
  13. package/dist/Editor/Elements/Form/FormField.js +101 -0
  14. package/dist/Editor/Elements/Form/FormPopup.js +20 -0
  15. package/dist/Editor/Elements/Grid/Grid.js +6 -8
  16. package/dist/Editor/Elements/Grid/GridItem.js +6 -13
  17. package/dist/Editor/Elements/Grid/GridItemPopup.js +4 -2
  18. package/dist/Editor/Elements/Grid/GridPopup.js +3 -1
  19. package/dist/Editor/Toolbar/PopupTool/index.js +3 -0
  20. package/dist/Editor/Toolbar/Toolbar.js +6 -0
  21. package/dist/Editor/Toolbar/toolbarGroups.js +3 -0
  22. package/dist/Editor/assets/fonts/poppins/OFL.txt +93 -0
  23. package/dist/Editor/assets/fonts/poppins/Poppins-Black.ttf +0 -0
  24. package/dist/Editor/assets/fonts/poppins/Poppins-BlackItalic.ttf +0 -0
  25. package/dist/Editor/assets/fonts/poppins/Poppins-Bold.ttf +0 -0
  26. package/dist/Editor/assets/fonts/poppins/Poppins-BoldItalic.ttf +0 -0
  27. package/dist/Editor/assets/fonts/poppins/Poppins-ExtraBold.ttf +0 -0
  28. package/dist/Editor/assets/fonts/poppins/Poppins-ExtraBoldItalic.ttf +0 -0
  29. package/dist/Editor/assets/fonts/poppins/Poppins-ExtraLight.ttf +0 -0
  30. package/dist/Editor/assets/fonts/poppins/Poppins-ExtraLightItalic.ttf +0 -0
  31. package/dist/Editor/assets/fonts/poppins/Poppins-Italic.ttf +0 -0
  32. package/dist/Editor/assets/fonts/poppins/Poppins-Light.ttf +0 -0
  33. package/dist/Editor/assets/fonts/poppins/Poppins-LightItalic.ttf +0 -0
  34. package/dist/Editor/assets/fonts/poppins/Poppins-Medium.ttf +0 -0
  35. package/dist/Editor/assets/fonts/poppins/Poppins-MediumItalic.ttf +0 -0
  36. package/dist/Editor/assets/fonts/poppins/Poppins-Regular.ttf +0 -0
  37. package/dist/Editor/assets/fonts/poppins/Poppins-SemiBold.ttf +0 -0
  38. package/dist/Editor/assets/fonts/poppins/Poppins-SemiBoldItalic.ttf +0 -0
  39. package/dist/Editor/assets/fonts/poppins/Poppins-Thin.ttf +0 -0
  40. package/dist/Editor/assets/fonts/poppins/Poppins-ThinItalic.ttf +0 -0
  41. package/dist/Editor/common/StyleBuilder/appHeaderStyle.js +26 -5
  42. package/dist/Editor/common/StyleBuilder/buttonStyle.js +35 -8
  43. package/dist/Editor/common/StyleBuilder/embedImageStyle.js +12 -12
  44. package/dist/Editor/common/StyleBuilder/fieldStyle.js +71 -0
  45. package/dist/Editor/common/StyleBuilder/fieldTypes/backgroundImage.js +2 -1
  46. package/dist/Editor/common/StyleBuilder/fieldTypes/index.js +5 -1
  47. package/dist/Editor/common/StyleBuilder/fieldTypes/menusArray.js +15 -9
  48. package/dist/Editor/common/StyleBuilder/fieldTypes/selectBox.js +35 -0
  49. package/dist/Editor/common/StyleBuilder/fieldTypes/textOptions.js +44 -0
  50. package/dist/Editor/common/StyleBuilder/formButtonStyle.js +93 -0
  51. package/dist/Editor/common/StyleBuilder/formStyle.js +82 -0
  52. package/dist/Editor/common/StyleBuilder/gridStyle.js +9 -0
  53. package/dist/Editor/font.css +9 -0
  54. package/dist/Editor/service/formSubmit.js +16 -0
  55. package/dist/Editor/utils/SlateUtilityFunctions.js +11 -1
  56. package/dist/Editor/utils/customHooks/useFormat.js +11 -4
  57. package/dist/Editor/utils/font.js +3 -1
  58. package/dist/Editor/utils/form.js +24 -0
  59. package/dist/Editor/utils/formfield.js +20 -0
  60. package/package.json +1 -1
@@ -12,10 +12,11 @@ import { RemoteCursorOverlay } from "./RemoteCursorOverlay/Overlay";
12
12
  import { mentionsEvent, commands } from "./utils/events";
13
13
  import withCommon from "./hooks/withCommon";
14
14
  import DialogWrapper from "./DialogWrapper";
15
- import "./Editor.css";
16
15
  import { serialize } from "./utils/serializer";
17
16
  import { getThumbnailImage } from "./helper";
18
17
  import PopupTool from "./Toolbar/PopupTool";
18
+ import "./font.css";
19
+ import "./Editor.css";
19
20
  import { jsx as _jsx } from "react/jsx-runtime";
20
21
  import { jsxs as _jsxs } from "react/jsx-runtime";
21
22
  const PREVIEW_IMAGE_HIDE_CLASS = ["grid-container-toolbar", "grid-item-toolbar", "element-toolbar"];
@@ -184,7 +185,8 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
184
185
  const isReadOnly = readOnly === "readonly";
185
186
  const customProps = {
186
187
  ...(otherProps || {}),
187
- readOnly: isReadOnly
188
+ readOnly: isReadOnly,
189
+ page_id: id
188
190
  };
189
191
  const renderElement = useCallback(props => {
190
192
  return /*#__PURE__*/_jsx(Element, {
@@ -1,5 +1,10 @@
1
- @import url("https://fonts.googleapis.com/css2?family=Inter:wght@100;200;300;400;500;600;700;800;900&display=swap");
2
-
1
+ .editor-t-wrapper {
2
+ font-family: "PoppinsRegular", "Helvetica", "Arial", sans-serif;
3
+ }
4
+ .editor-t-wrapper strong,
5
+ .editor-t-wrapper strong * {
6
+ font-family: "PoppinsBold", "Helvetica", "Arial", sans-serif;
7
+ }
3
8
  .ml-1 {
4
9
  margin-left: 10px;
5
10
  }
@@ -33,8 +38,9 @@ blockquote {
33
38
  .editor-wrapper .btnActive {
34
39
  opacity: 1;
35
40
  }
41
+
36
42
  .editor-wrapper {
37
- font-family: "Helvetica", "Arial", sans-serif;
43
+
38
44
  background: #ffffff;
39
45
  min-height: 400px;
40
46
  height: fit-content;
@@ -102,11 +108,11 @@ blockquote {
102
108
  }
103
109
 
104
110
  .grid-container-toolbar {
105
- right: -52px;
111
+ right: -32px;
106
112
  }
107
113
 
108
114
  .grid-item-toolbar {
109
- left: -52px;
115
+ left: -32px;
110
116
  }
111
117
 
112
118
  .element-toolbar {
@@ -119,16 +125,22 @@ blockquote {
119
125
  .grid-container-toolbar button,
120
126
  .grid-item-toolbar button,
121
127
  .element-toolbar button {
122
- /* margin-right: 8px;
123
- background-color: rgba(0, 0, 0, 0.8);
124
- color: #FFF; */
125
- /* margin-left: 8px; */
126
- background-color: rgb(255 255 255);
127
- color: #64748b;
128
+ background-color: #2684ff;
129
+ color: #FFFFFF;
130
+ border: 1px solid transparent;
128
131
  font-size: 12px;
129
- border-radius: 4px;
130
- border: 1px solid #64748b;
131
- margin-bottom: 6px;
132
+ border-radius: 0px;
133
+ margin-bottom: 0px;
134
+ width: 24px;
135
+ height: 24px;
136
+ padding: 12px;
137
+ }
138
+ .grid-container-toolbar button:hover,
139
+ .grid-item-toolbar button:hover,
140
+ .element-toolbar button:hover {
141
+ background-color: #FFFFFF;
142
+ color: #2684ff;
143
+ border: 1px solid #2684ff;
132
144
  }
133
145
 
134
146
  .grid-item {
@@ -396,6 +408,15 @@ blockquote {
396
408
  width: auto !important;
397
409
  }
398
410
  @media (max-width: 480px) {
411
+ body {
412
+ padding: 0px !important;
413
+ }
414
+ .app-logo {
415
+ justify-content: end;
416
+ }
417
+ .editor-t-wrapper {
418
+ padding: 0px 0px !important;
419
+ }
399
420
  .toolbar {
400
421
  display: flex;
401
422
  flex-wrap: nowrap;
@@ -405,9 +426,32 @@ blockquote {
405
426
  .toolbar-grp1 > div {
406
427
  display: flex;
407
428
  }
429
+ .grid-container > div {
430
+ flex-direction: column !important;
431
+ }
408
432
  .grid-item {
409
433
  width: 100% !important;
410
434
  }
435
+ .grid-item > div {
436
+ text-align: center;
437
+ }
438
+ .page-builder .editor-wrapper {
439
+ max-width: 100% !important;
440
+ margin-top: 0px !important;
441
+ padding: 0px !important;
442
+ }
443
+ .embed {
444
+ justify-content: center;
445
+ }
446
+ .embed img {
447
+ object-fit: contain;
448
+ }
449
+ form .form-field {
450
+ width: 100% !important;
451
+ }
452
+ .form-btn-wrpr {
453
+ justify-content: center !important;
454
+ }
411
455
  }
412
456
 
413
457
  .editorTabs {
@@ -449,7 +493,7 @@ blockquote {
449
493
  left: 0;
450
494
  right: 0;
451
495
  bottom: 0;
452
- top: auto;
496
+ top: 0;
453
497
  width: fit-content;
454
498
  height: fit-content;
455
499
  margin: auto;
@@ -476,11 +520,11 @@ blockquote {
476
520
  position: absolute;
477
521
  width: calc(100% + 16px);
478
522
  height: calc(100% + 16px);
479
- border: 4px solid #2684ff;
523
+ border: 4px dotted #2684ff;
480
524
  display: none;
481
525
  pointer-events: none;
482
- top: -12px;
483
- left: -12px;
526
+ top: -8px;
527
+ left: -8px;
484
528
  z-index: 100;
485
529
  }
486
530
 
@@ -489,7 +533,7 @@ blockquote {
489
533
  }
490
534
 
491
535
  .element-toolbar button {
492
- margin-right: 6px;
536
+ margin-right: 0px;
493
537
  }
494
538
 
495
539
  .empty-carousel-wrapper .element-selector {
@@ -502,4 +546,4 @@ blockquote {
502
546
 
503
547
  .empty-carousel-wrapper .grid-item-toolbar {
504
548
  left: 0px;
505
- }
549
+ }
@@ -18,6 +18,7 @@ import Button from "@mui/material/Button";
18
18
  import SettingsIcon from "@mui/icons-material/Settings";
19
19
  import DeleteIcon from "@mui/icons-material/Delete";
20
20
  import AppHeaderPopup from "./AppHeaderPopup";
21
+ import { Tooltip } from "@mui/material";
21
22
  import { jsx as _jsx } from "react/jsx-runtime";
22
23
  import { jsxs as _jsxs } from "react/jsx-runtime";
23
24
  const drawerWidth = 240;
@@ -33,8 +34,17 @@ function AppHeader(props) {
33
34
  appLogo,
34
35
  menus,
35
36
  bgColor,
36
- menuStyle
37
+ menuStyle,
38
+ bannerSpacing,
39
+ fontSize,
40
+ fontFamily
37
41
  } = element;
42
+ const {
43
+ left,
44
+ top,
45
+ right,
46
+ bottom
47
+ } = bannerSpacing || {};
38
48
  const {
39
49
  window
40
50
  } = props;
@@ -53,16 +63,24 @@ function AppHeader(props) {
53
63
  className: "element-toolbar",
54
64
  contentEditable: false,
55
65
  style: {
56
- top: "-38px"
66
+ top: "-24px"
57
67
  },
58
- children: [/*#__PURE__*/_jsx(IconButton, {
59
- size: "small",
60
- onClick: onSettings,
61
- children: /*#__PURE__*/_jsx(SettingsIcon, {})
62
- }), /*#__PURE__*/_jsx(IconButton, {
63
- size: "small",
64
- onClick: onDelete,
65
- children: /*#__PURE__*/_jsx(DeleteIcon, {})
68
+ children: [/*#__PURE__*/_jsx(Tooltip, {
69
+ title: "App Header Settings",
70
+ arrow: true,
71
+ children: /*#__PURE__*/_jsx(IconButton, {
72
+ size: "small",
73
+ onClick: onSettings,
74
+ children: /*#__PURE__*/_jsx(SettingsIcon, {})
75
+ })
76
+ }), /*#__PURE__*/_jsx(Tooltip, {
77
+ title: "Delete App Header",
78
+ arrow: true,
79
+ children: /*#__PURE__*/_jsx(IconButton, {
80
+ size: "small",
81
+ onClick: onDelete,
82
+ children: /*#__PURE__*/_jsx(DeleteIcon, {})
83
+ })
66
84
  })]
67
85
  }) : null;
68
86
  };
@@ -107,6 +125,8 @@ function AppHeader(props) {
107
125
  children: menus.map(item => /*#__PURE__*/_jsx(ListItem, {
108
126
  disablePadding: true,
109
127
  children: /*#__PURE__*/_jsx(ListItemButton, {
128
+ component: "a",
129
+ href: item.url,
110
130
  sx: {
111
131
  textAlign: "center"
112
132
  },
@@ -130,7 +150,11 @@ function AppHeader(props) {
130
150
  style: {
131
151
  position: "relative",
132
152
  background: bgColor,
133
- boxShadow: "none"
153
+ boxShadow: "none",
154
+ paddingLeft: `${left}px`,
155
+ paddingRight: `${right}px`,
156
+ paddingTop: `${top}px`,
157
+ paddingBottom: `${bottom}px`
134
158
  },
135
159
  children: /*#__PURE__*/_jsxs(Toolbar, {
136
160
  children: [/*#__PURE__*/_jsx(IconButton, {
@@ -160,6 +184,7 @@ function AppHeader(props) {
160
184
  sm: "block"
161
185
  }
162
186
  },
187
+ className: "app-logo",
163
188
  children: [appLogo && appLogo !== "none" ? /*#__PURE__*/_jsx("img", {
164
189
  alt: `${appTitle} Logo`,
165
190
  style: {
@@ -183,9 +208,12 @@ function AppHeader(props) {
183
208
  children: /*#__PURE__*/_jsx(MenuIcon, {})
184
209
  }) : null, !isDrawer ? menus.map(item => /*#__PURE__*/_jsx(Button, {
185
210
  component: "a",
186
- href: item.href,
211
+ href: item.url,
187
212
  sx: {
188
- color: "#fff"
213
+ color: "#fff",
214
+ fontFamily: fontFamily,
215
+ textTransform: "none",
216
+ fontSize: fontSize || "16px"
189
217
  },
190
218
  children: item.text
191
219
  }, item)) : null]
@@ -7,15 +7,17 @@ const ButtonPopup = props => {
7
7
  element,
8
8
  onSave,
9
9
  customProps,
10
- onClose
10
+ onClose,
11
+ style,
12
+ styleName
11
13
  } = props;
12
14
  return /*#__PURE__*/_jsx(StyleBuilder, {
13
15
  title: "Button",
14
- type: "buttonStyle",
16
+ type: styleName ? "" : "buttonStyle",
15
17
  element: element,
16
18
  onSave: onSave,
17
19
  onClose: onClose,
18
- renderTabs: buttonStyle,
20
+ renderTabs: style ? style : buttonStyle,
19
21
  customProps: customProps
20
22
  });
21
23
  };
@@ -1,7 +1,10 @@
1
1
  import React, { useState } from "react";
2
2
  import { Transforms } from "slate";
3
3
  import { ReactEditor, useSlateStatic } from "slate-react";
4
- import { Menu, MenuItem } from "@mui/material";
4
+ import { IconButton, Menu, MenuItem, Tooltip } from "@mui/material";
5
+ import SettingsIcon from "@mui/icons-material/Settings";
6
+ import OpenInNewIcon from "@mui/icons-material/OpenInNew";
7
+ import DeleteIcon from "@mui/icons-material/Delete";
5
8
  import ButtonPopup from "./ButtonPopup";
6
9
  import { actionButtonRedirect } from "../../service/actionTrigger";
7
10
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -30,7 +33,8 @@ const EditorButton = props => {
30
33
  borderColor,
31
34
  buttonLink,
32
35
  textSize,
33
- textAlign
36
+ textAlign,
37
+ fontFamily
34
38
  } = element;
35
39
  const {
36
40
  linkType,
@@ -136,7 +140,8 @@ const EditorButton = props => {
136
140
  paddingTop: `${top || 8}px`,
137
141
  paddingBottom: `${bottom || 8}px`,
138
142
  color: `${textColor || "#FFFFFF"}`,
139
- fontSize: textSize || "inherit"
143
+ fontSize: textSize || "inherit",
144
+ fontFamily: fontFamily || "PoppinsRegular"
140
145
  },
141
146
  onClick: onClick,
142
147
  children: label || "My Button"
@@ -148,13 +153,31 @@ const EditorButton = props => {
148
153
  onClose: handleClose,
149
154
  children: [!readOnly && /*#__PURE__*/_jsx(MenuItem, {
150
155
  onClick: onMenuClick("edit"),
151
- children: "Edit"
156
+ children: /*#__PURE__*/_jsx(Tooltip, {
157
+ title: "Settings",
158
+ arrow: true,
159
+ children: /*#__PURE__*/_jsx(IconButton, {
160
+ children: /*#__PURE__*/_jsx(SettingsIcon, {})
161
+ })
162
+ })
152
163
  }), /*#__PURE__*/_jsx(MenuItem, {
164
+ title: "Open Link",
165
+ arrow: true,
153
166
  onClick: onMenuClick("open"),
154
- children: "Open"
167
+ children: /*#__PURE__*/_jsx(Tooltip, {
168
+ children: /*#__PURE__*/_jsx(IconButton, {
169
+ children: /*#__PURE__*/_jsx(OpenInNewIcon, {})
170
+ })
171
+ })
155
172
  }), !readOnly && /*#__PURE__*/_jsx(MenuItem, {
173
+ title: "Delete",
174
+ arrow: true,
156
175
  onClick: onMenuClick("delete"),
157
- children: "Delete"
176
+ children: /*#__PURE__*/_jsx(Tooltip, {
177
+ children: /*#__PURE__*/_jsx(IconButton, {
178
+ children: /*#__PURE__*/_jsx(DeleteIcon, {})
179
+ })
180
+ })
158
181
  })]
159
182
  }), edit && /*#__PURE__*/_jsx(ButtonPopup, {
160
183
  element: element,
@@ -6,9 +6,7 @@ import useResize from "../../utils/customHooks/useResize";
6
6
  import { insertImageText } from "../../utils/imageText";
7
7
  import EmbedPopup from "./EmbedPopup";
8
8
  import { IconButton, Tooltip } from "@mui/material";
9
- import DeleteIcon from "@mui/icons-material/Delete";
10
9
  import SettingsIcon from "@mui/icons-material/Settings";
11
- import AddIcon from "@mui/icons-material/Add";
12
10
  import { jsx as _jsx } from "react/jsx-runtime";
13
11
  import { jsxs as _jsxs } from "react/jsx-runtime";
14
12
  const Image = ({
@@ -112,31 +110,17 @@ const Image = ({
112
110
  insertImageText(editor, [...path, 1]);
113
111
  };
114
112
  const ToolBar = () => {
115
- return selected ? /*#__PURE__*/_jsxs("div", {
113
+ return selected ? /*#__PURE__*/_jsx("div", {
116
114
  className: "element-toolbar",
117
115
  contentEditable: false,
118
- children: [/*#__PURE__*/_jsx(Tooltip, {
119
- title: "Add Text",
120
- arrow: true,
121
- children: /*#__PURE__*/_jsx(IconButton, {
122
- onClick: onAddText,
123
- children: /*#__PURE__*/_jsx(AddIcon, {})
124
- })
125
- }), /*#__PURE__*/_jsx(Tooltip, {
126
- title: "Settings",
116
+ children: /*#__PURE__*/_jsx(Tooltip, {
117
+ title: "Image Settings",
127
118
  arrow: true,
128
119
  children: /*#__PURE__*/_jsx(IconButton, {
129
120
  onClick: onSettings,
130
121
  children: /*#__PURE__*/_jsx(SettingsIcon, {})
131
122
  })
132
- }), /*#__PURE__*/_jsx(Tooltip, {
133
- title: "Delete",
134
- arrow: true,
135
- children: /*#__PURE__*/_jsx(IconButton, {
136
- onClick: onDelete,
137
- children: /*#__PURE__*/_jsx(DeleteIcon, {})
138
- })
139
- })]
123
+ })
140
124
  }) : null;
141
125
  };
142
126
  const totalMinus = (parseInt(left) || 0) + (parseInt(right) || 0);
@@ -177,7 +161,7 @@ const Image = ({
177
161
  alt: alt,
178
162
  src: url,
179
163
  onClick: handleImageClick
180
- }), selected && !readOnly && /*#__PURE__*/_jsx(IconButton, {
164
+ }), selected && !readOnly && size.width > 300 && size.height > 300 && /*#__PURE__*/_jsx(IconButton, {
181
165
  onPointerDown: onMouseDown,
182
166
  style: {
183
167
  opacity: 1,
@@ -54,14 +54,14 @@ const Video = ({
54
54
  className: "element-toolbar visible-on-hover",
55
55
  contentEditable: false,
56
56
  children: [/*#__PURE__*/_jsx(Tooltip, {
57
- title: "Settings",
57
+ title: "Video Settings",
58
58
  arrow: true,
59
59
  children: /*#__PURE__*/_jsx(IconButton, {
60
60
  onClick: onSettings,
61
61
  children: /*#__PURE__*/_jsx(SettingsIcon, {})
62
62
  })
63
63
  }), /*#__PURE__*/_jsx(Tooltip, {
64
- title: "Delete",
64
+ title: "Delete Video",
65
65
  arrow: true,
66
66
  children: /*#__PURE__*/_jsx(IconButton, {
67
67
  onClick: onDelete,
@@ -0,0 +1,20 @@
1
+ import React from "react";
2
+ import StyleBuilder from "../../common/StyleBuilder";
3
+ import fieldStyle from "../../common/StyleBuilder/fieldStyle";
4
+ import { jsx as _jsx } from "react/jsx-runtime";
5
+ const FieldPopup = props => {
6
+ const {
7
+ element,
8
+ onSave,
9
+ onClose
10
+ } = props;
11
+ return /*#__PURE__*/_jsx(StyleBuilder, {
12
+ title: "Form Field",
13
+ type: "fieldStyle",
14
+ element: element,
15
+ onSave: onSave,
16
+ onClose: onClose,
17
+ renderTabs: fieldStyle
18
+ });
19
+ };
20
+ export default FieldPopup;