@flozy/editor 5.6.4 → 5.6.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.
@@ -183,7 +183,7 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
183
183
  return {
184
184
  value: JSON.stringify(val),
185
185
  text: text,
186
- title: serializeToText(title?.children) || "Untitled"
186
+ title: serializeToText(title?.children) || ""
187
187
  };
188
188
  };
189
189
  const getPreviewImage = async (needBackground = false, options = {}) => {
@@ -309,13 +309,11 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
309
309
  hideTools: updatedHideTools || []
310
310
  }) : [];
311
311
  const handleEditorChange = newValue => {
312
- if (!readOnly) {
313
- if (JSON.stringify(newValue) !== JSON.stringify(debouncedValue?.current)) {
314
- updateTopBanner(newValue, setTopBanner);
315
- debounced(newValue);
316
- if (!isInteracted) {
317
- setIsInteracted(true);
318
- }
312
+ if (JSON.stringify(newValue) !== JSON.stringify(debouncedValue?.current)) {
313
+ updateTopBanner(newValue, setTopBanner);
314
+ debounced(newValue);
315
+ if (!isInteracted) {
316
+ setIsInteracted(true);
319
317
  }
320
318
  }
321
319
  };
@@ -544,7 +542,8 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
544
542
  transformOrigin: "left top",
545
543
  transition: "all 0.3s",
546
544
  minHeight: "87%",
547
- maxWidth: pageMaxWidth ? `${parseInt(pageMaxWidth)}px !important` : "auto"
545
+ maxWidth: pageMaxWidth ? `${parseInt(pageMaxWidth)}px !important` : "auto",
546
+ paddingTop: hasTopBanner() ? '20px !important' : ''
548
547
  },
549
548
  "data-info": outsideEditorClickLabel,
550
549
  children: [/*#__PURE__*/_jsx(Editable, {
@@ -397,6 +397,12 @@ blockquote {
397
397
  padding: 0px 5px 0px 2px !important
398
398
  }
399
399
 
400
+ .signatureActionBtnContainer {
401
+ display: flex;
402
+ align-items: center;
403
+ gap: 1rem;
404
+ }
405
+
400
406
  .signature-tab {
401
407
  display: flex;
402
408
  align-items: center;
@@ -605,8 +611,8 @@ blockquote {
605
611
  display: block !important;
606
612
  }
607
613
 
608
- .dialog-actions-si .actionBtn {
609
- margin-top: 24px;
614
+ .dialog-actions-si .signatureActionBtnContainer {
615
+ margin-top: 1.4rem;
610
616
  }
611
617
  }
612
618
 
@@ -989,7 +995,7 @@ blockquote {
989
995
 
990
996
  .sliderInput {
991
997
  width: 66px !important;
992
- padding: 2px 10px;
998
+ padding: 2px 0px 2px 4px;
993
999
  margin-left: 18px;
994
1000
  box-shadow: 0px 4px 16px 0px #0000000d;
995
1001
  border: 1px solid #6f6f6f33;
@@ -15,7 +15,7 @@ const DataViewButton = props => {
15
15
  title: "Dynamic Table",
16
16
  onClick: onClick,
17
17
  icon: /*#__PURE__*/_jsx(Icon, {
18
- icon: "dataView"
18
+ icon: "dataTable"
19
19
  }),
20
20
  icoBtnType: icoBtnType
21
21
  });
@@ -44,9 +44,9 @@ const SearchAttachment = props => {
44
44
  maxWidth: '250px',
45
45
  padding: "0px 10px",
46
46
  boxShadow: "none",
47
- border: `1px solid ${theme?.palette?.primary?.slashBrainBorder}`,
47
+ border: `1px solid ${theme?.palette?.primary?.slashBrainBorder} !important`,
48
48
  borderRadius: "7px !important",
49
- background: theme?.palette?.containers?.slashBrainCardBg,
49
+ background: `${theme?.palette?.containers?.slashBrainCardBg} !important`,
50
50
  cursor: 'pointer',
51
51
  margin: '4px 0px',
52
52
  lineHeight: 1.43,
@@ -313,7 +313,9 @@ const SignaturePopup = props => {
313
313
  id: "signedBy",
314
314
  name: "signedBy",
315
315
  placeholder: "Enter Name",
316
- defaultValue: defaultName || "",
316
+ value: signedData.signedBy || ""
317
+ // defaultValue={defaultName || ""}
318
+ ,
317
319
  size: "small",
318
320
  onChange: onChange,
319
321
  sx: classes.signaturePopUpNameField
@@ -442,7 +444,8 @@ const SignaturePopup = props => {
442
444
  size: "small",
443
445
  onChange: onChange,
444
446
  sx: classes.signaturePopUpNameField,
445
- defaultValue: defaultEmail || ""
447
+ value: signedData.signedByEmail || ""
448
+ // defaultValue={defaultEmail || ""}
446
449
  })
447
450
  })]
448
451
  })]
@@ -509,7 +512,9 @@ const SignaturePopup = props => {
509
512
  })
510
513
  })
511
514
  })]
512
- }) : null, /*#__PURE__*/_jsxs(_Fragment, {
515
+ }) : null, /*#__PURE__*/_jsxs(Box, {
516
+ component: "div",
517
+ className: "signatureActionBtnContainer",
513
518
  children: [!readOnly ? /*#__PURE__*/_jsx(Button, {
514
519
  onClick: handleClear,
515
520
  className: `secondaryBtn actionBtn deleteBtn deleteButtonSignature`,
@@ -301,6 +301,9 @@ const editorStyles = ({
301
301
  "& .editor-wrapper": {
302
302
  paddingTop: '20px'
303
303
  },
304
+ "& .MuiDialog-paper, & .MuiPopover-paper": {
305
+ background: `${theme?.palette?.editor?.background} !important`
306
+ },
304
307
  "& .MuiPaper-root": {
305
308
  borderRadius: "0px !important",
306
309
  "& .MuiDialogTitle-root": {
@@ -127,6 +127,11 @@ const usePopupStyle = theme => ({
127
127
  },
128
128
  "@media only screen and (max-width: 599px)": {
129
129
  width: "330px"
130
+ },
131
+ "& .accordionIcon": {
132
+ "& p": {
133
+ textAlign: 'left'
134
+ }
130
135
  }
131
136
  },
132
137
  "& .MuiTypography-root": {
@@ -185,11 +190,6 @@ const usePopupStyle = theme => ({
185
190
  justifyContent: "start",
186
191
  borderRadius: "10px !important",
187
192
  transition: "background-color 0.3s ease",
188
- // "& .colorBoxElementIcon": {
189
- // "& path": {
190
- // fill: theme?.palette?.type === "dark" ? "none" : "",
191
- // },
192
- // },
193
193
  "& .signatureElementIcon": {
194
194
  "& path": {
195
195
  fill: `${theme?.palette?.editor?.closeButtonSvgStroke}`
@@ -7,6 +7,7 @@ const DataTableIcon = () => {
7
7
  viewBox: "0 0 16 16",
8
8
  fill: "none",
9
9
  xmlns: "http://www.w3.org/2000/svg",
10
+ className: "commonSvgStyle",
10
11
  children: [/*#__PURE__*/_jsx("path", {
11
12
  d: "M14.6668 7.33398V6.00065C14.6668 2.66732 13.3335 1.33398 10.0002 1.33398H6.00016C2.66683 1.33398 1.3335 2.66732 1.3335 6.00065V10.0007C1.3335 13.334 2.66683 14.6673 6.00016 14.6673H6.66683",
12
13
  stroke: "#64748B",
@@ -3,7 +3,6 @@ const usePopupStyles = theme => ({
3
3
  position: "absolute",
4
4
  zIndex: 1300,
5
5
  borderRadius: "10px",
6
- // padding: "0px",
7
6
  boxShadow: "0px 4px 10px 0px #00000029",
8
7
  overflow: "hidden",
9
8
  // padding: "8px 0px !important",
@@ -39,7 +39,7 @@ const withLayout = editor => {
39
39
  const title = {
40
40
  type: "title",
41
41
  children: [{
42
- text: "Untitled"
42
+ text: ""
43
43
  }]
44
44
  };
45
45
  Transforms.insertNodes(editor, title, {
@@ -22,10 +22,17 @@ export const insertTopBanner = (editor, embedData) => {
22
22
  } = embedData;
23
23
  if (!url) return;
24
24
  const embed = createTopBannerNode(embedData);
25
- Transforms.insertNodes(editor, embed, {
26
- at: [0]
27
- });
28
- insertNewLine(editor);
25
+ const isTopBanner = editor?.children[0]?.type === "topbanner";
26
+ if (!isTopBanner) {
27
+ Transforms.insertNodes(editor, embed, {
28
+ at: [0]
29
+ });
30
+ insertNewLine(editor);
31
+ } else {
32
+ Transforms.setNodes(editor, embed, {
33
+ at: [0]
34
+ });
35
+ }
29
36
  } catch (err) {
30
37
  console.log(err);
31
38
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flozy/editor",
3
- "version": "5.6.4",
3
+ "version": "5.6.6",
4
4
  "description": "An Editor for flozy app brain",
5
5
  "files": [
6
6
  "dist"