@flozy/editor 1.6.1 → 1.6.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -90,7 +90,9 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
90
90
  footer,
91
91
  needLayout = true,
92
92
  CHARACTERS = [],
93
- editorClass
93
+ editorClass,
94
+ fixedWidth = "60%",
95
+ fullWidth = "80%"
94
96
  } = otherProps || {};
95
97
  const [drag, setDrag] = useState(null);
96
98
  const classes = editorStyles({
@@ -451,14 +453,14 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
451
453
  className: "scroll-area",
452
454
  children: /*#__PURE__*/_jsxs("div", {
453
455
  ref: editorWrapper,
454
- className: `editor-wrapper`,
456
+ className: `editor-wrapper ${pageWidth === "fixed" ? "fixed" : "full"}`,
455
457
  style: {
456
458
  backgroundColor: pageColor || "#FFF",
457
459
  paddingLeft: `${bannerSpacing?.left || 12}px`,
458
460
  paddingRight: `${bannerSpacing?.right || 12}px`,
459
461
  paddingTop: `${bannerSpacing?.top}px`,
460
462
  paddingBottom: `${bannerSpacing?.bottom}px`,
461
- width: !pageWidth || pageWidth === "fixed" ? "60%" : "80%",
463
+ width: !pageWidth || pageWidth === "fixed" ? fixedWidth : fullWidth,
462
464
  // width: viewport.w ? `${viewport.w}px` : "100%",
463
465
  height: viewport.h ? `${viewport.h}px` : `100%`,
464
466
  alignSelf: "center",
@@ -20,7 +20,8 @@ const SignaturePopup = props => {
20
20
  className
21
21
  } = props;
22
22
  const {
23
- readOnly
23
+ readOnly,
24
+ metadata
24
25
  } = customProps;
25
26
  const [open, setOpen] = useState(false);
26
27
  const [tab, setTab] = useState(0);
@@ -41,7 +42,13 @@ const SignaturePopup = props => {
41
42
  resource_id: customProps?.page_id
42
43
  });
43
44
  onSave(signedData);
44
- handleClose();
45
+ // manual delay
46
+ setTimeout(() => {
47
+ if (metadata && metadata?.actionHandler) {
48
+ metadata?.actionHandler("signed", signedData);
49
+ }
50
+ handleClose();
51
+ }, 0);
45
52
  };
46
53
  const handleClear = () => {
47
54
  onClear();
@@ -15,6 +15,9 @@ const AddElements = props => {
15
15
  container: true,
16
16
  sx: classes.textFormatWrapper,
17
17
  spacing: 2,
18
+ style: {
19
+ margin: 0
20
+ },
18
21
  children: elements.map(m => {
19
22
  return /*#__PURE__*/_jsx(Grid, {
20
23
  item: true,
@@ -17,6 +17,10 @@ const PopperHeader = props => {
17
17
  return /*#__PURE__*/_jsx(Grid, {
18
18
  container: true,
19
19
  padding: 2,
20
+ className: "headerContainer",
21
+ style: {
22
+ paddingTop: "2px"
23
+ },
20
24
  children: /*#__PURE__*/_jsxs(Grid, {
21
25
  item: true,
22
26
  xs: 12,
@@ -24,6 +24,7 @@ const usePopupStyle = () => ({
24
24
  width: "100%"
25
25
  }
26
26
  },
27
+ "& .headerContainer": {},
27
28
  "& .textSettingHeader": {
28
29
  borderBottom: "1px solid #DCE4EC",
29
30
  padding: "8px 0px 5px",
@@ -135,7 +135,8 @@ const iconList = {
135
135
  size: 20
136
136
  }),
137
137
  emoji: /*#__PURE__*/_jsx(MdEmojiEmotions, {
138
- size: 20
138
+ size: 20,
139
+ fill: "#64748B"
139
140
  }),
140
141
  grid: /*#__PURE__*/_jsx(GridIcon, {}),
141
142
  accordion: /*#__PURE__*/_jsx(AccordionIcon, {}),
@@ -166,7 +167,8 @@ const iconList = {
166
167
  }),
167
168
  embed: /*#__PURE__*/_jsx(LinkIcon, {}),
168
169
  topbanner: /*#__PURE__*/_jsx(IoIosImage, {
169
- size: 20
170
+ size: 20,
171
+ fill: "#64748B"
170
172
  }),
171
173
  fileUpload: /*#__PURE__*/_jsx(MdOutlineFileUpload, {
172
174
  size: 20
@@ -21,7 +21,8 @@ const ElementListCard = props => {
21
21
  children: /*#__PURE__*/_jsxs(Card, {
22
22
  sx: {
23
23
  display: "flex",
24
- width: "324px",
24
+ width: "100%",
25
+ maxWidth: "324px",
25
26
  justifyContent: "start",
26
27
  alignItems: "center",
27
28
  background: "transparent",
@@ -18,7 +18,8 @@ const MentionsListCard = props => {
18
18
  return /*#__PURE__*/_jsxs(Card, {
19
19
  sx: {
20
20
  display: "flex",
21
- width: "324px",
21
+ width: "100%",
22
+ maxWidth: "324px",
22
23
  justifyContent: "start",
23
24
  alignItems: "center",
24
25
  background: "transparent",
@@ -28,6 +28,7 @@ const withLayout = editor => {
28
28
  at: path.concat(1)
29
29
  });
30
30
  }
31
+ let prevType = "";
31
32
  for (const [child, childPath] of Node.children(editor, path)) {
32
33
  let type = "";
33
34
  const slateIndex = childPath[0];
@@ -43,11 +44,12 @@ const withLayout = editor => {
43
44
  };
44
45
  switch (slateIndex) {
45
46
  case 0:
46
- type = "title";
47
+ type = child.type === "topbanner" ? "topbanner" : "title";
48
+ prevType = type;
47
49
  enforceType(type);
48
50
  break;
49
51
  case 1:
50
- type = "paragraph";
52
+ type = prevType === "topbanner" ? "title" : "paragraph";
51
53
  enforceType(type);
52
54
  break;
53
55
  default:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flozy/editor",
3
- "version": "1.6.1",
3
+ "version": "1.6.3",
4
4
  "description": "An Editor for flozy app brain",
5
5
  "files": [
6
6
  "dist"