@flozy/editor 5.4.5 → 5.4.7

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 (48) hide show
  1. package/dist/Editor/Elements/AI/PopoverAIInput.js +3 -3
  2. package/dist/Editor/Elements/DataView/Layouts/ColumnView.js +22 -6
  3. package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/Select.js +24 -6
  4. package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/SimpleSelect.js +16 -1
  5. package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/styles.js +2 -1
  6. package/dist/Editor/Elements/DataView/Layouts/FilterSort/SortOptions/index.js +17 -5
  7. package/dist/Editor/Elements/DataView/Layouts/FilterSort/styles.js +38 -11
  8. package/dist/Editor/Elements/DataView/Layouts/FilterView.js +55 -15
  9. package/dist/Editor/Elements/DataView/Layouts/Options/AddOptions.js +7 -7
  10. package/dist/Editor/Elements/DataView/Layouts/Options/AllProperties.js +11 -2
  11. package/dist/Editor/Elements/DataView/Layouts/Options/ChangeProperty.js +4 -2
  12. package/dist/Editor/Elements/DataView/Layouts/Options/ColumnsList.js +5 -2
  13. package/dist/Editor/Elements/DataView/Layouts/Options/Constants.js +21 -21
  14. package/dist/Editor/Elements/DataView/Layouts/Options/EditOption.js +7 -4
  15. package/dist/Editor/Elements/DataView/Layouts/Options/EditProperty.js +49 -21
  16. package/dist/Editor/Elements/DataView/Layouts/Options/FilterProperty.js +4 -2
  17. package/dist/Editor/Elements/DataView/Layouts/Options/PropertyList.js +4 -2
  18. package/dist/Editor/Elements/DataView/Layouts/Options/styles.js +51 -16
  19. package/dist/Editor/Elements/DataView/Layouts/TableStyles.js +22 -3
  20. package/dist/Editor/Elements/DataView/Layouts/TableView.js +39 -13
  21. package/dist/Editor/Elements/DataView/Layouts/ViewData.js +5 -0
  22. package/dist/Editor/Elements/DataView/styles.js +20 -5
  23. package/dist/Editor/Toolbar/Mini/MiniToolbar.js +5 -2
  24. package/dist/Editor/Toolbar/Mini/Styles.js +5 -0
  25. package/dist/Editor/assets/svg/ArrowDownIcon.js +25 -0
  26. package/dist/Editor/assets/svg/ArrowUpIcon.js +25 -0
  27. package/dist/Editor/assets/svg/CalenderIconTick.js +64 -0
  28. package/dist/Editor/assets/svg/ChervDown.js +18 -0
  29. package/dist/Editor/assets/svg/ChervUp.js +18 -0
  30. package/dist/Editor/assets/svg/DataTableIcon.js +50 -0
  31. package/dist/Editor/assets/svg/DuplicateIcon.js +23 -0
  32. package/dist/Editor/assets/svg/EyeIcon.js +23 -0
  33. package/dist/Editor/assets/svg/EyeSlash.js +43 -0
  34. package/dist/Editor/assets/svg/HashtagIcon.js +33 -0
  35. package/dist/Editor/assets/svg/PlusIcon.js +23 -0
  36. package/dist/Editor/assets/svg/SelectRoundedIcon.js +24 -0
  37. package/dist/Editor/assets/svg/SortByIcon.js +33 -0
  38. package/dist/Editor/assets/svg/TickOutlined.js +23 -0
  39. package/dist/Editor/assets/svg/TrashCanIcon.js +38 -0
  40. package/dist/Editor/common/Icon.js +34 -4
  41. package/dist/Editor/common/RnD/index.js +2 -2
  42. package/dist/Editor/common/Shorthands/elements.js +1 -1
  43. package/dist/Editor/common/iconListV2.js +47 -79
  44. package/dist/Editor/common/iconslist.js +2 -2
  45. package/dist/Editor/helper/deserialize/index.js +27 -1
  46. package/dist/Editor/hooks/useBreakpoints.js +1 -1
  47. package/dist/Editor/plugins/withHTML.js +38 -11
  48. package/package.json +1 -1
@@ -909,35 +909,56 @@ export function H3() {
909
909
  })
910
910
  });
911
911
  }
912
- export function CalendlyIcon() {
912
+ export function DragIcon() {
913
913
  return /*#__PURE__*/_jsxs("svg", {
914
- width: "12",
915
- height: "14",
916
- viewBox: "0 0 12 14",
914
+ width: "16",
915
+ height: "12",
916
+ viewBox: "0 0 10 6",
917
917
  fill: "none",
918
918
  xmlns: "http://www.w3.org/2000/svg",
919
- className: "calederIconSvg",
920
- children: [/*#__PURE__*/_jsx("rect", {
921
- x: "0.5",
922
- y: "2.5",
923
- width: "11",
924
- height: "11",
925
- rx: "1.5",
926
- stroke: "#64748B"
927
- }), /*#__PURE__*/_jsx("path", {
928
- d: "M3 1L3 4",
929
- stroke: "#64748B",
930
- strokeLinecap: "round",
931
- className: "strokePath"
932
- }), /*#__PURE__*/_jsx("path", {
933
- d: "M9 1L9 4",
934
- stroke: "#64748B",
935
- strokeLinecap: "round",
936
- className: "strokePath"
937
- }), /*#__PURE__*/_jsx("path", {
938
- d: "M8.10369 7.0554H7.43892C7.41335 6.91335 7.36577 6.78835 7.29616 6.6804C7.22656 6.57244 7.14134 6.48082 7.04048 6.40554C6.93963 6.33026 6.8267 6.27344 6.7017 6.23509C6.57813 6.19673 6.44673 6.17756 6.30753 6.17756C6.05611 6.17756 5.83097 6.24077 5.6321 6.36719C5.43466 6.49361 5.27841 6.67898 5.16335 6.9233C5.04972 7.16761 4.9929 7.46591 4.9929 7.81818C4.9929 8.1733 5.04972 8.47301 5.16335 8.71733C5.27841 8.96165 5.43537 9.14631 5.63423 9.27131C5.8331 9.39631 6.05682 9.45881 6.3054 9.45881C6.44318 9.45881 6.57386 9.44034 6.69744 9.40341C6.82244 9.36506 6.93537 9.30895 7.03622 9.23509C7.13707 9.16122 7.2223 9.07102 7.2919 8.96449C7.36293 8.85653 7.41193 8.73295 7.43892 8.59375L8.10369 8.59588C8.06818 8.81037 7.99929 9.00781 7.89702 9.18821C7.79616 9.36719 7.66619 9.52202 7.5071 9.6527C7.34943 9.78196 7.16903 9.8821 6.96591 9.95312C6.76278 10.0241 6.54119 10.0597 6.30114 10.0597C5.9233 10.0597 5.58665 9.97017 5.29119 9.79119C4.99574 9.6108 4.76278 9.35298 4.59233 9.01776C4.4233 8.68253 4.33878 8.28267 4.33878 7.81818C4.33878 7.35227 4.42401 6.95241 4.59446 6.61861C4.76491 6.28338 4.99787 6.02628 5.29332 5.8473C5.58878 5.6669 5.92472 5.5767 6.30114 5.5767C6.53267 5.5767 6.74858 5.61009 6.94886 5.67685C7.15057 5.74219 7.33168 5.83878 7.49219 5.96662C7.6527 6.09304 7.78551 6.24787 7.89062 6.43111C7.99574 6.61293 8.06676 6.82102 8.10369 7.0554Z",
939
- fill: "#64748B",
940
- className: "fillPath"
919
+ className: "dragIcon",
920
+ children: [/*#__PURE__*/_jsx("ellipse", {
921
+ cx: "1.49462",
922
+ cy: "4.42384",
923
+ rx: "0.779289",
924
+ ry: "0.779289",
925
+ transform: "rotate(-90 1.49462 4.42384)",
926
+ fill: "#94A3B8"
927
+ }), /*#__PURE__*/_jsx("ellipse", {
928
+ cx: "4.99999",
929
+ cy: "4.42384",
930
+ rx: "0.779289",
931
+ ry: "0.779289",
932
+ transform: "rotate(-90 4.99999 4.42384)",
933
+ fill: "#94A3B8"
934
+ }), /*#__PURE__*/_jsx("ellipse", {
935
+ cx: "8.50732",
936
+ cy: "4.42384",
937
+ rx: "0.779289",
938
+ ry: "0.779289",
939
+ transform: "rotate(-90 8.50732 4.42384)",
940
+ fill: "#94A3B8"
941
+ }), /*#__PURE__*/_jsx("ellipse", {
942
+ cx: "1.49462",
943
+ cy: "0.91993",
944
+ rx: "0.779289",
945
+ ry: "0.779289",
946
+ transform: "rotate(-90 1.49462 0.91993)",
947
+ fill: "#94A3B8"
948
+ }), /*#__PURE__*/_jsx("ellipse", {
949
+ cx: "4.99999",
950
+ cy: "0.91993",
951
+ rx: "0.779289",
952
+ ry: "0.779289",
953
+ transform: "rotate(-90 4.99999 0.91993)",
954
+ fill: "#94A3B8"
955
+ }), /*#__PURE__*/_jsx("ellipse", {
956
+ cx: "8.50732",
957
+ cy: "0.91993",
958
+ rx: "0.779289",
959
+ ry: "0.779289",
960
+ transform: "rotate(-90 8.50732 0.91993)",
961
+ fill: "#94A3B8"
941
962
  })]
942
963
  });
943
964
  }
@@ -1242,59 +1263,6 @@ export function CodeElementIcon() {
1242
1263
  })]
1243
1264
  });
1244
1265
  }
1245
- export function DragIcon() {
1246
- return /*#__PURE__*/_jsxs("svg", {
1247
- width: "16",
1248
- height: "12",
1249
- viewBox: "0 0 10 6",
1250
- fill: "none",
1251
- xmlns: "http://www.w3.org/2000/svg",
1252
- className: "dragIcon",
1253
- children: [/*#__PURE__*/_jsx("ellipse", {
1254
- cx: "1.49462",
1255
- cy: "4.42384",
1256
- rx: "0.779289",
1257
- ry: "0.779289",
1258
- transform: "rotate(-90 1.49462 4.42384)",
1259
- fill: "#94A3B8"
1260
- }), /*#__PURE__*/_jsx("ellipse", {
1261
- cx: "4.99999",
1262
- cy: "4.42384",
1263
- rx: "0.779289",
1264
- ry: "0.779289",
1265
- transform: "rotate(-90 4.99999 4.42384)",
1266
- fill: "#94A3B8"
1267
- }), /*#__PURE__*/_jsx("ellipse", {
1268
- cx: "8.50732",
1269
- cy: "4.42384",
1270
- rx: "0.779289",
1271
- ry: "0.779289",
1272
- transform: "rotate(-90 8.50732 4.42384)",
1273
- fill: "#94A3B8"
1274
- }), /*#__PURE__*/_jsx("ellipse", {
1275
- cx: "1.49462",
1276
- cy: "0.91993",
1277
- rx: "0.779289",
1278
- ry: "0.779289",
1279
- transform: "rotate(-90 1.49462 0.91993)",
1280
- fill: "#94A3B8"
1281
- }), /*#__PURE__*/_jsx("ellipse", {
1282
- cx: "4.99999",
1283
- cy: "0.91993",
1284
- rx: "0.779289",
1285
- ry: "0.779289",
1286
- transform: "rotate(-90 4.99999 0.91993)",
1287
- fill: "#94A3B8"
1288
- }), /*#__PURE__*/_jsx("ellipse", {
1289
- cx: "8.50732",
1290
- cy: "0.91993",
1291
- rx: "0.779289",
1292
- ry: "0.779289",
1293
- transform: "rotate(-90 8.50732 0.91993)",
1294
- fill: "#94A3B8"
1295
- })]
1296
- });
1297
- }
1298
1266
  export function TextSizeUpArrow() {
1299
1267
  return /*#__PURE__*/_jsx("svg", {
1300
1268
  width: "9",
@@ -1581,10 +1581,10 @@ export const CheckListButtonActive = () => /*#__PURE__*/_jsxs("svg", {
1581
1581
  id: "Gradient1",
1582
1582
  children: [/*#__PURE__*/_jsx("stop", {
1583
1583
  offset: "0%",
1584
- stopColor: "#5351FC"
1584
+ stopColor: "#8361FD"
1585
1585
  }), /*#__PURE__*/_jsx("stop", {
1586
1586
  offset: "50%",
1587
- stopColor: "#19A9FC"
1587
+ stopColor: "#2F63ED"
1588
1588
  })]
1589
1589
  })
1590
1590
  }), /*#__PURE__*/_jsx("rect", {
@@ -1,4 +1,26 @@
1
1
  import { jsx } from "slate-hyperscript";
2
+ const inlineStyles = [{
3
+ key: "bold",
4
+ getStyle: styles => styles.fontWeight === "bold" || parseInt(styles.fontWeight, 10) >= 700
5
+ }, {
6
+ key: "italic",
7
+ getStyle: styles => styles.fontStyle === "italic"
8
+ }, {
9
+ key: "underline",
10
+ getStyle: styles => styles.textDecoration.includes("underline")
11
+ }];
12
+ function getInlineTextStyles(element) {
13
+ if (!element || !element.style) return {};
14
+ const styles = element.style;
15
+ const elementStyles = inlineStyles.reduce((total, currVal) => {
16
+ const style = currVal.getStyle(styles);
17
+ if (style) {
18
+ total[currVal.key] = style;
19
+ }
20
+ return total;
21
+ }, {});
22
+ return elementStyles;
23
+ }
2
24
  const handleTableCell = (el, children) => {
3
25
  const wrapChild = children?.map(c => {
4
26
  if (typeof c === "string") {
@@ -138,9 +160,13 @@ const TEXT_TAGS = {
138
160
 
139
161
  const deserialize = el => {
140
162
  if (el.nodeType === 3) {
163
+ // if there is any line-breaks
141
164
  const match = /\r|\n/.exec(el.textContent);
142
165
  const text = el.textContent.replace(/\r|\n/g, "").trim();
143
- return match && !text ? null : el.textContent;
166
+ return match && !text ? null : {
167
+ text,
168
+ ...getInlineTextStyles(el.parentNode)
169
+ };
144
170
  } else if (el.nodeType !== 1) {
145
171
  return null;
146
172
  } else if (el.nodeName === "BR") {
@@ -1,6 +1,6 @@
1
1
  import { useMediaQuery } from "@mui/material";
2
2
  export const STIMULATOR_MOCK = {
3
- xs: "@media (min-width: 1200px) and (max-width: 1980px)"
3
+ xs: "@media (min-width: 1200px) and (max-width: 10000px)"
4
4
  };
5
5
  export const isStimulator = () => {
6
6
  try {
@@ -4,6 +4,43 @@ import { decodeAndParseBase64 } from "../utils/helper";
4
4
  const avoidDefaultInsert = ["table", "grid"];
5
5
  const NON_TEXT_TAGS = ["ol", "ul", "img", "table", "video", "a", "button", "GOOGLE-SHEETS-HTML-ORIGIN"];
6
6
  const ALLOWED_TEXT_NODES = ["paragraph", "title", "headingOne", "headingTwo", "headingThree"];
7
+ const parseCopiedHTML = html => {
8
+ const parsed = new DOMParser().parseFromString(html, "text/html");
9
+
10
+ // if ol, ul are inside li, remove and push ol,ul after that li to maintain format between our slate list and external source list's json
11
+ parsed.querySelectorAll("li > ul, li > ol").forEach(list => {
12
+ // Find the parent li
13
+ const parentLi = list.parentElement;
14
+
15
+ // Move the list after the parent li
16
+ parentLi.after(list);
17
+ });
18
+
19
+ // to handle google docs list
20
+ parsed.querySelectorAll("li p, li div").forEach(element => {
21
+ const parent = element.parentNode;
22
+ // Move all child nodes of <p> or <div> to its parent <li>
23
+ while (element.firstChild) {
24
+ parent.insertBefore(element.firstChild, element);
25
+ }
26
+ // Remove the <p> or <div> element
27
+ parent.removeChild(element);
28
+ });
29
+
30
+ // claude.ai, copy list inbetween, some li tags are not wrapped with ul or ol
31
+ parsed.querySelectorAll("li").forEach(li => {
32
+ // Check if the parent of <li> is not a <ul> or <ol>
33
+ if (!li.parentElement || li.parentElement.tagName !== "UL" && li.parentElement.tagName !== "OL") {
34
+ // Create a <ul> element
35
+ const ul = document.createElement("ul");
36
+ // Append the <li> to the <ul>
37
+ ul.appendChild(li.cloneNode(true)); // Clone the <li>
38
+ // Replace the original <li> in the DOM with the <ul>
39
+ li.replaceWith(ul);
40
+ }
41
+ });
42
+ return parsed;
43
+ };
7
44
  const loopChildren = (children = [], defaultInsert) => {
8
45
  if (!children?.length) {
9
46
  return defaultInsert;
@@ -193,18 +230,8 @@ const withHtml = editor => {
193
230
  insertData(data);
194
231
  }
195
232
  } else if (html) {
196
- const parsed = new DOMParser().parseFromString(html, "text/html");
197
-
198
- // if ol, ul are inside li, remove and push ol,ul after that li to maintain format between our slate list and external source list's json
199
- parsed.querySelectorAll("li > ul, li > ol").forEach(list => {
200
- // Find the parent li
201
- const parentLi = list.parentElement;
202
-
203
- // Move the list after the parent li
204
- parentLi.after(list);
205
- });
233
+ const parsed = parseCopiedHTML(html);
206
234
  const rootElement = parsed.body;
207
- console.log("rootElement", rootElement);
208
235
  const isNonText = rootElement ? rootElement?.querySelector(NON_TEXT_TAGS.toString()) : false;
209
236
  const isGoogleSheet = parsed.body.querySelector("google-sheets-html-origin");
210
237
  if (isGoogleSheet) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flozy/editor",
3
- "version": "5.4.5",
3
+ "version": "5.4.7",
4
4
  "description": "An Editor for flozy app brain",
5
5
  "files": [
6
6
  "dist"