@chaibuilder/sdk 1.1.13 → 1.1.14

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 (97) hide show
  1. package/dist/AddBlocks-AG_J7s2Z.cjs +1 -0
  2. package/dist/{AddBlocks-A7WofxHV.js → AddBlocks-FsdsASNp.js} +51 -51
  3. package/dist/{BrandingOptions-wkFrLFI_.js → BrandingOptions-4qzTYdj5.js} +6 -5
  4. package/dist/BrandingOptions-xBuqDpj0.cjs +1 -0
  5. package/dist/{CanvasArea-kF46NWZK.cjs → CanvasArea-4m1-c1yq.cjs} +7 -7
  6. package/dist/{CanvasArea-chEYQhH8.js → CanvasArea-U3egqewu.js} +7 -7
  7. package/dist/{CurrentPage-Wd7F9Egg.js → CurrentPage-spjJpQSM.js} +10 -10
  8. package/dist/CurrentPage-zxrdTVsG.cjs +1 -0
  9. package/dist/{Layers-qMOMP2Mi.js → Layers-QNAlCI4j.js} +81 -81
  10. package/dist/Layers-YyBChBtg.cjs +1 -0
  11. package/dist/MarkAsGlobalBlock-LXDkmFUr.cjs +1 -0
  12. package/dist/{MarkAsGlobalBlock-Czq45Amf.js → MarkAsGlobalBlock-xOHhiMDl.js} +3 -3
  13. package/dist/{PagesPanel-ay4uk4mg.js → PagesPanel--LI-BoSj.js} +6 -6
  14. package/dist/PagesPanel-BeJrveus.cjs +1 -0
  15. package/dist/ProjectPanel-MjcAymKT.cjs +1 -0
  16. package/dist/{ProjectPanel-eLlbfAtj.js → ProjectPanel-VNj0jXca.js} +10 -10
  17. package/dist/Settings-BrYkhn3H.cjs +1 -0
  18. package/dist/{Settings-lpoxaMDu.js → Settings-LZJwbkO6.js} +433 -432
  19. package/dist/{SidePanels-iRXV69vh.js → SidePanels-4lvmnnlw.js} +36 -36
  20. package/dist/SidePanels-_5oUp-eI.cjs +1 -0
  21. package/dist/{Topbar-dQYhW4iv.js → Topbar-_-1HX-EE.js} +3 -3
  22. package/dist/Topbar-gQxbcPtG.cjs +1 -0
  23. package/dist/UnsplashImages-PNp5fYCc.cjs +1 -0
  24. package/dist/{UnsplashImages-AL1ASAoD.js → UnsplashImages-mqK09h8E.js} +6 -6
  25. package/dist/UploadImages-BoSSsLtD.cjs +1 -0
  26. package/dist/{UploadImages-09wuhk2O.js → UploadImages-IDkkRuhx.js} +3 -3
  27. package/dist/{add-page-modal-TXREEFPZ.js → add-page-modal-fZnKopNf.js} +14 -13
  28. package/dist/add-page-modal-rWhPuGd9.cjs +1 -0
  29. package/dist/confirm-alert-dHRDZrA1.cjs +1 -0
  30. package/dist/{confirm-alert-GkfW9chS.js → confirm-alert-ea5xpncD.js} +3 -3
  31. package/dist/core.cjs +1 -1
  32. package/dist/core.d.ts +5 -15
  33. package/dist/core.js +5 -5
  34. package/dist/delete-page-modal-P_KKu12n.cjs +1 -0
  35. package/dist/{delete-page-modal-LNME2FwD.js → delete-page-modal-fRoXPfhG.js} +5 -5
  36. package/dist/form-6qGAOYI3.cjs +1 -0
  37. package/dist/{form-Fk4CaX1A.js → form-irY39wvJ.js} +29 -29
  38. package/dist/functions-86L6n983.js +23 -0
  39. package/dist/functions-Jr7gX_RX.cjs +1 -0
  40. package/dist/{html-to-json-kGgp07Hv.js → html-to-json-Y5M0N8PH.js} +33 -33
  41. package/dist/html-to-json-aAZkA0f5.cjs +1 -0
  42. package/dist/{index-89A3jPHh.js → index-0OqmBgqo.js} +3 -3
  43. package/dist/{index-61c5wSJn.cjs → index-1Dr-VtaT.cjs} +2 -2
  44. package/dist/{index-Q5q5Y_8a.js → index-CQz6j3ex.js} +6 -6
  45. package/dist/index-d55M5MRz.cjs +1 -0
  46. package/dist/lib.cjs +1 -1
  47. package/dist/lib.js +27 -27
  48. package/dist/lodash-2us0VT8I.cjs +36 -0
  49. package/dist/lodash-3gkdNK5u.js +4538 -0
  50. package/dist/{page-viewer-LPx-OTCC.js → page-viewer-39ZtxLzx.js} +6 -6
  51. package/dist/page-viewer-_lc8vqU4.cjs +1 -0
  52. package/dist/{project-general-setting-sSpFUD_Y.js → project-general-setting-CCVuGyHh.js} +9 -8
  53. package/dist/project-general-setting-LEzDhwoq.cjs +1 -0
  54. package/dist/{project-seo-setting-CGVegBtM.js → project-seo-setting-Wo7E46w7.js} +6 -5
  55. package/dist/project-seo-setting-orwH-Ufg.cjs +1 -0
  56. package/dist/render.cjs +1 -1
  57. package/dist/render.js +46 -46
  58. package/dist/server.cjs +1 -1
  59. package/dist/server.js +11 -11
  60. package/dist/single-page-detail-jkDYF7lW.cjs +1 -0
  61. package/dist/{single-page-detail-32H1_IG4.js → single-page-detail-r1GJF00l.js} +29 -28
  62. package/dist/studio.cjs +1 -1
  63. package/dist/studio.js +5 -5
  64. package/dist/ui.cjs +1 -1
  65. package/dist/ui.js +3 -3
  66. package/dist/useAddBlockByDrop-5QW86HjG.js +20 -0
  67. package/dist/useAddBlockByDrop-Ckzuvu-s.cjs +1 -0
  68. package/dist/utils-37UXq2O5.cjs +1 -0
  69. package/dist/{utils-zWMk4dB2.js → utils-XsPKXMVo.js} +5 -5
  70. package/package.json +2 -2
  71. package/dist/AddBlocks-Yuc4t0Z_.cjs +0 -1
  72. package/dist/BrandingOptions-KkPF1OGn.cjs +0 -1
  73. package/dist/CurrentPage-p9MaXTOB.cjs +0 -1
  74. package/dist/Layers-wQ0Fv9Xc.cjs +0 -1
  75. package/dist/MarkAsGlobalBlock-sb3hMXLq.cjs +0 -1
  76. package/dist/PagesPanel--maZxwX5.cjs +0 -1
  77. package/dist/ProjectPanel-KhIpO7m3.cjs +0 -1
  78. package/dist/Settings-n2DpS5Ta.cjs +0 -1
  79. package/dist/SidePanels-Dud5Xh9L.cjs +0 -1
  80. package/dist/Topbar-vqzjB75a.cjs +0 -1
  81. package/dist/UnsplashImages-3Sh4UZ-7.cjs +0 -1
  82. package/dist/UploadImages-mPzLhMiH.cjs +0 -1
  83. package/dist/add-page-modal-FPnIWwqA.cjs +0 -1
  84. package/dist/confirm-alert-YNyc3WEo.cjs +0 -1
  85. package/dist/delete-page-modal-sTbqZPvk.cjs +0 -1
  86. package/dist/form-OhgCJlVA.cjs +0 -1
  87. package/dist/functions-ZWGlwlQY.cjs +0 -1
  88. package/dist/functions-slns6ONz.js +0 -23
  89. package/dist/html-to-json-po8on2ju.cjs +0 -1
  90. package/dist/index-GNmGzavZ.cjs +0 -1
  91. package/dist/page-viewer-wQO9oV9h.cjs +0 -1
  92. package/dist/project-general-setting-8EwuN5lN.cjs +0 -1
  93. package/dist/project-seo-setting-R77SKM1I.cjs +0 -1
  94. package/dist/single-page-detail-nyBEHLtT.cjs +0 -1
  95. package/dist/useAddBlockByDrop-4VH-SMj7.cjs +0 -1
  96. package/dist/useAddBlockByDrop-_kyR0iI4.js +0 -20
  97. package/dist/utils-tx6hqsHY.cjs +0 -1
@@ -1,32 +1,32 @@
1
1
  import { j as u } from "./jsx-runtime-NV737rRe.js";
2
2
  import b from "@rjsf/core";
3
3
  import x from "@rjsf/validator-ajv8";
4
- import { includes as h, get as a, set as $, first as F } from "lodash";
5
- import { bd as P, be as E, bf as O, bg as S } from "./index-89A3jPHh.js";
4
+ import { c as h, g as m, s as $, h as F } from "./lodash-3gkdNK5u.js";
5
+ import { bd as P, be as E, bf as O, bg as S } from "./index-0OqmBgqo.js";
6
6
  const d = (i, l = "") => {
7
7
  switch (i.type) {
8
8
  case "singular":
9
9
  return i.uiSchema;
10
10
  case "model":
11
- const { properties: c } = i, m = {};
12
- return Object.keys(c).forEach((r) => {
13
- const e = c[r];
11
+ const { properties: p } = i, a = {};
12
+ return Object.keys(p).forEach((r) => {
13
+ const e = p[r];
14
14
  if (h(["slot", "styles"], e.type))
15
15
  return;
16
- const o = a(e, "i18n", !1) ? `${r}-${l}` : r;
17
- m[o] = d(e, l);
18
- }), m;
16
+ const o = m(e, "i18n", !1) ? `${r}-${l}` : r;
17
+ a[o] = d(e, l);
18
+ }), a;
19
19
  case "list":
20
- const { itemProperties: n } = i, p = {
20
+ const { itemProperties: n } = i, c = {
21
21
  items: {}
22
22
  };
23
23
  return Object.keys(n).forEach((r) => {
24
24
  const e = n[r];
25
25
  if (h(["slot", "styles"], e.type))
26
26
  return;
27
- const o = a(e, "i18n", !1) ? `${r}-${l}` : r;
28
- p.items[o] = d(e, l);
29
- }), p;
27
+ const o = m(e, "i18n", !1) ? `${r}-${l}` : r;
28
+ c.items[o] = d(e, l);
29
+ }), c;
30
30
  default:
31
31
  return {};
32
32
  }
@@ -35,20 +35,20 @@ const d = (i, l = "") => {
35
35
  case "singular":
36
36
  return i.schema;
37
37
  case "model":
38
- const { properties: c, title: m } = i, n = {
39
- title: m,
38
+ const { properties: p, title: a } = i, n = {
39
+ title: a,
40
40
  type: "object",
41
41
  properties: {}
42
42
  };
43
- return Object.keys(c).forEach((o) => {
44
- const t = c[o];
43
+ return Object.keys(p).forEach((o) => {
44
+ const t = p[o];
45
45
  if (h(["slot", "styles"], t.type))
46
46
  return;
47
- const s = a(t, "i18n", !1) ? `${o}-${l}` : o;
47
+ const s = m(t, "i18n", !1) ? `${o}-${l}` : o;
48
48
  n.properties[s] = y(t, l);
49
49
  }), n;
50
50
  case "list":
51
- const { itemProperties: p, title: r } = i, e = {
51
+ const { itemProperties: c, title: r } = i, e = {
52
52
  title: r,
53
53
  type: "array",
54
54
  items: {
@@ -56,12 +56,12 @@ const d = (i, l = "") => {
56
56
  properties: {}
57
57
  }
58
58
  };
59
- return Object.keys(p).forEach((o) => {
60
- const t = p[o];
59
+ return Object.keys(c).forEach((o) => {
60
+ const t = c[o];
61
61
  if (h(["slot", "styles"], t.type))
62
62
  return;
63
- const s = a(t, "i18n", !1) ? `${o}-${l}` : o;
64
- e.items.properties[s] = y(t, l), $(e.items, "title", a(t, "itemTitle", `${r} item`));
63
+ const s = m(t, "i18n", !1) ? `${o}-${l}` : o;
64
+ e.items.properties[s] = y(t, l), $(e.items, "title", m(t, "itemTitle", `${r} item`));
65
65
  }), e;
66
66
  default:
67
67
  return {};
@@ -69,10 +69,10 @@ const d = (i, l = "") => {
69
69
  }, C = ({
70
70
  title: i,
71
71
  properties: l = {},
72
- formData: c,
73
- onChange: m,
72
+ formData: p,
73
+ onChange: a,
74
74
  disabled: n = !1,
75
- activeLang: p = ""
75
+ activeLang: c = ""
76
76
  }) => {
77
77
  const r = {
78
78
  type: "object",
@@ -82,15 +82,15 @@ const d = (i, l = "") => {
82
82
  const s = l[t];
83
83
  if (h(["slot", "styles"], s.type))
84
84
  return;
85
- const f = a(s, "i18n", !1) ? `${t}-${p}` : t;
86
- r.properties[f] = y(s, p), e[f] = d(s, p);
85
+ const f = m(s, "i18n", !1) ? `${t}-${c}` : t;
86
+ r.properties[f] = y(s, c), e[f] = d(s, c);
87
87
  });
88
88
  const o = ({ ...t }, s) => {
89
89
  const f = s == null ? void 0 : s.replace("root.", "").split("/").pop();
90
90
  if (!s || !f)
91
91
  return;
92
92
  const j = F(f.split("."));
93
- s && j && m({ ...t }, j);
93
+ s && j && a({ ...t }, j);
94
94
  };
95
95
  return /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
96
96
  i && /* @__PURE__ */ u.jsx("h1", { className: "px-1 text-sm font-semibold underline", children: i }),
@@ -112,7 +112,7 @@ const d = (i, l = "") => {
112
112
  liveValidate: !0,
113
113
  uiSchema: e,
114
114
  schema: r,
115
- formData: c,
115
+ formData: p,
116
116
  validator: x,
117
117
  onChange: o,
118
118
  disabled: n
@@ -0,0 +1,23 @@
1
+ import { g as r, c, l as d } from "./lodash-3gkdNK5u.js";
2
+ import { a as g } from "./MODIFIERS-MLfpKQY1.js";
3
+ const C = (t, s = "c-") => {
4
+ const n = r(t, "bodyTextLightColor", "#64748b"), l = r(t, "bodyTextDarkColor", "#94a3b8"), e = r(t, "bodyBgLightColor", "#FFFFFF"), $ = r(t, "bodyBgDarkColor", "#0f172a");
5
+ return `${s}font-body ${s}antialiased ${s}text-[${n}] ${s}bg-[${e}] dark:${s}text-[${l}] dark:${s}bg-[${$}]`;
6
+ }, h = (t, s = "c-") => {
7
+ const l = t.replace(g, "").split(",").map((e) => e.split(" ").map((a) => {
8
+ if (a === "")
9
+ return "";
10
+ if (c(a, "hs-") || c(a, "[--") || c(a, "paddle"))
11
+ return a;
12
+ if (a.includes(":")) {
13
+ const o = a.split(":");
14
+ return o[o.length - 1] = s + d(o), o.join(":");
15
+ }
16
+ return `${s}${a}`;
17
+ }).join(" "));
18
+ return `${g}${l.join(" , ")}`;
19
+ };
20
+ export {
21
+ h as a,
22
+ C as g
23
+ };
@@ -0,0 +1 @@
1
+ "use strict";const e=require("./lodash-2us0VT8I.cjs"),d=require("./MODIFIERS-WFzDQfiT.cjs"),g=(a,s="c-")=>{const n=e.get(a,"bodyTextLightColor","#64748b"),o=e.get(a,"bodyTextDarkColor","#94a3b8"),l=e.get(a,"bodyBgLightColor","#FFFFFF"),c=e.get(a,"bodyBgDarkColor","#0f172a");return`${s}font-body ${s}antialiased ${s}text-[${n}] ${s}bg-[${l}] dark:${s}text-[${o}] dark:${s}bg-[${c}]`},u=(a,s="c-")=>{const o=a.replace(d.STYLES_KEY,"").split(",").map(l=>l.split(" ").map(t=>{if(t==="")return"";if(e.includes(t,"hs-")||e.includes(t,"[--")||e.includes(t,"paddle"))return t;if(t.includes(":")){const r=t.split(":");return r[r.length-1]=s+e.last(r),r.join(":")}return`${s}${t}`}).join(" "));return`${d.STYLES_KEY}${o.join(" , ")}`};exports.addPrefixToClasses=u;exports.getBrandingClasses=g;
@@ -1,6 +1,6 @@
1
1
  import { stringify as h, parse as k } from "himalaya";
2
- import { g as x, d as L } from "./utils-zWMk4dB2.js";
3
- import { includes as y, get as c, isEmpty as g, forEach as $, find as o, set as u, capitalize as w, flatMapDeep as C, filter as S, omit as B, flatten as I } from "lodash";
2
+ import { g as x, d as L } from "./utils-XsPKXMVo.js";
3
+ import { c as y, g as c, a as g, f as $, j as o, s as u, u as w, D as C, b as S, o as B, n as I } from "./lodash-3gkdNK5u.js";
4
4
  import { a as p } from "./MODIFIERS-MLfpKQY1.js";
5
5
  const A = {
6
6
  img: { alt: "alt", width: "width", height: "height", src: "image" },
@@ -36,24 +36,24 @@ const A = {
36
36
  name: "fieldName"
37
37
  }
38
38
  }, H = (t, e) => t.children.length === 1 && y(["Heading", "Paragraph", "Span", "ListItem", "Button", "Label", "TableCell", "Link"], e._type), _ = (t) => t.map((e) => e.type === "text" ? c(e, "content", "") : g(e.children) ? "" : _(e.children)).join(""), m = (t) => t === null ? !0 : t, f = (t) => {
39
- const e = {}, r = A[t.tagName] || {}, a = t.attributes;
40
- return $(a, ({ key: i, value: l }) => {
41
- if (r[i]) {
39
+ const e = {}, a = A[t.tagName] || {}, r = t.attributes;
40
+ return $(r, ({ key: i, value: l }) => {
41
+ if (a[i]) {
42
42
  if (t.tagName === "img" && i === "src" && !l.startsWith("http")) {
43
43
  const s = o(t.attributes, { key: "width" }), n = o(t.attributes, { key: "height" });
44
44
  s && n ? l = `https://via.placeholder.com/${s == null ? void 0 : s.value}x${n == null ? void 0 : n.value}` : l = "https://via.placeholder.com/150x150";
45
45
  }
46
- u(e, r[i], m(l));
46
+ u(e, a[i], m(l));
47
47
  } else
48
48
  y(["style", "class", "srcset"], i) || u(e, `styles_attrs.${i}`, m(l));
49
49
  }), delete e.class, e;
50
50
  }, q = (t, e = "styles") => {
51
51
  if (!t.attributes)
52
52
  return { [e]: `${p},` };
53
- const r = o(t.attributes, { key: "class" });
54
- if (r) {
55
- const a = r.value;
56
- return { [e]: `${p},${a}` };
53
+ const a = o(t.attributes, { key: "class" });
54
+ if (a) {
55
+ const r = a.value;
56
+ return { [e]: `${p},${r}` };
57
57
  }
58
58
  return { [e]: `${p},` };
59
59
  }, E = (t) => {
@@ -136,35 +136,35 @@ const A = {
136
136
  name: t.tagName === "div" ? "Box" : w(t.tagName)
137
137
  };
138
138
  }
139
- }, b = (t, e = null) => C(t, (r) => {
139
+ }, b = (t, e = null) => C(t, (a) => {
140
140
  var l;
141
- if (r.type === "comment")
141
+ if (a.type === "comment")
142
142
  return [];
143
- let a = { _id: x() };
144
- if (e && (a._parent = e.block._id), r.type === "text")
145
- return g(c(r, "content", "")) ? [] : e && H(e.node, e.block) ? (u(e, "block.content", c(r, "content", "")), []) : { ...a, _type: "Text", content: c(r, "content", "") };
146
- if (a = {
147
- ...a,
148
- ...E(r),
149
- ...f(r),
150
- ...q(r)
151
- }, a._type === "Input") {
152
- const s = a.inputType || "text";
153
- s === "checkbox" ? u(a, "_type", "Checkbox") : s === "radio" && u(a, "_type", "Radio");
143
+ let r = { _id: x() };
144
+ if (e && (r._parent = e.block._id), a.type === "text")
145
+ return g(c(a, "content", "")) ? [] : e && H(e.node, e.block) ? (u(e, "block.content", c(a, "content", "")), []) : { ...r, _type: "Text", content: c(a, "content", "") };
146
+ if (r = {
147
+ ...r,
148
+ ...E(a),
149
+ ...f(a),
150
+ ...q(a)
151
+ }, r._type === "Input") {
152
+ const s = r.inputType || "text";
153
+ s === "checkbox" ? u(r, "_type", "Checkbox") : s === "radio" && u(r, "_type", "Radio");
154
154
  } else {
155
- if (r.tagName === "video")
156
- return a.content = h([r]), [a];
157
- if (r.tagName === "svg") {
158
- const s = o(r.attributes, { key: "height" }), n = o(r.attributes, { key: "width" }), d = c(s, "value") ? `[${c(s, "value")}px]` : "full", T = c(n, "value") ? `[${c(n, "value")}px]` : "full", v = c(o(r.attributes, { key: "class" }), "value");
159
- return a.styles = `${p}, ${L(`w-${T} h-${d}`, v)}`.trim(), r.attributes = S(r.attributes, (N) => !y(["style", "width", "height", "class"], N.key)), a.icon = h([r]), u(a, "styles_attrs", B(c(a, "styles_attrs") || {}, ["height", "width", "style", "class"])), [a];
160
- } else if (r.tagName == "option" && e && ((l = e.block) == null ? void 0 : l._type) === "Select")
155
+ if (a.tagName === "video")
156
+ return r.content = h([a]), [r];
157
+ if (a.tagName === "svg") {
158
+ const s = o(a.attributes, { key: "height" }), n = o(a.attributes, { key: "width" }), d = c(s, "value") ? `[${c(s, "value")}px]` : "full", T = c(n, "value") ? `[${c(n, "value")}px]` : "full", v = c(o(a.attributes, { key: "class" }), "value");
159
+ return r.styles = `${p}, ${L(`w-${T} h-${d}`, v)}`.trim(), a.attributes = S(a.attributes, (N) => !y(["style", "width", "height", "class"], N.key)), r.icon = h([a]), u(r, "styles_attrs", B(c(r, "styles_attrs") || {}, ["height", "width", "style", "class"])), [r];
160
+ } else if (a.tagName == "option" && e && ((l = e.block) == null ? void 0 : l._type) === "Select")
161
161
  return e.block.options.push({
162
- label: _(r.children),
163
- ...f(r)
162
+ label: _(a.children),
163
+ ...f(a)
164
164
  }), [];
165
165
  }
166
- const i = b(r.children, { block: a, node: r });
167
- return [a, ...i];
166
+ const i = b(a.children, { block: r, node: a });
167
+ return [r, ...i];
168
168
  }), M = (t) => {
169
169
  const e = t.match(/<body[^>]*>[\s\S]*?<\/body>/);
170
170
  return (e && e.length > 0 ? e[0].replace(/<body/, "<div").replace(/<\/body>/, "</div>") : t).replace(/\s+/g, " ").replaceAll("> <", "><").replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, "").trim();
@@ -0,0 +1 @@
1
+ "use strict";const o=require("himalaya"),p=require("./utils-37UXq2O5.cjs"),e=require("./lodash-2us0VT8I.cjs"),u=require("./MODIFIERS-WFzDQfiT.cjs"),T={img:{alt:"alt",width:"width",height:"height",src:"image"},video:{src:"url",autoplay:"controls.autoPlay",muted:"controls.muted",loop:"controls.loop",controls:"controls.widgets"},a:{href:"link.href",target:"link.target",type:""},input:{placeholder:"placeholder",required:"required",type:"inputType",name:"fieldName"},textarea:{placeholder:"placeholder",required:"required",type:"inputType",name:"fieldName"},select:{placeholder:"placeholder",required:"required",multiple:"multiple",name:"fieldName"}},v=(t,r)=>t.children.length===1&&e.includes(["Heading","Paragraph","Span","ListItem","Button","Label","TableCell","Link"],r._type),h=t=>t.map(r=>r.type==="text"?e.get(r,"content",""):e.isEmpty(r.children)?"":h(r.children)).join(""),g=t=>t===null?!0:t,y=t=>{const r={},s=T[t.tagName]||{},a=t.attributes;return e.forEach(a,({key:l,value:c})=>{if(s[l]){if(t.tagName==="img"&&l==="src"&&!c.startsWith("http")){const i=e.find(t.attributes,{key:"width"}),n=e.find(t.attributes,{key:"height"});i&&n?c=`https://via.placeholder.com/${i==null?void 0:i.value}x${n==null?void 0:n.value}`:c="https://via.placeholder.com/150x150"}e.set(r,s[l],g(c))}else e.includes(["style","class","srcset"],l)||e.set(r,`styles_attrs.${l}`,g(c))}),delete r.class,r},k=(t,r="styles")=>{if(!t.attributes)return{[r]:`${u.STYLES_KEY},`};const s=e.find(t.attributes,{key:"class"});if(s){const a=s.value;return{[r]:`${u.STYLES_KEY},${a}`}}return{[r]:`${u.STYLES_KEY},`}},N=t=>{switch(t.tagName){case"img":return{_type:"Image"};case"input":return{_type:"Input",showLabel:!1};case"hr":return{_type:"Divider"};case"br":return{_type:"LineBreak"};case"textarea":return{_type:"TextArea",showLabel:!1};case"audio":return{_type:"Audio"};case"iframe":return{_type:"Iframe"};case"canvas":return{_type:"Canvas"};case"video":return{_type:"CustomHTML"};case"svg":return{_type:"Icon"};case"select":return{_type:"Select",options:[]};case"option":return{_type:"Option"};case"ul":case"ol":case"dl":return{_type:"List",tag:t.tagName,_listType:t.tagName==="ol"?"list-decimal":"list-none"};case"li":case"dt":return{_type:"ListItem",tag:t.tagName};case"span":case"figcaption":case"legend":return{_type:"Span",tag:t.tagName};case"p":return{_type:"Paragraph",content:""};case"a":return{_type:"Link"};case"form":return{_type:"Form"};case"label":return{_type:"Label"};case"button":return{_type:"Button"};case"code":return{_type:"Code"};case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":return{_type:"Heading",tag:t.tagName};case"table":return{_type:"Table"};case"tr":return{_type:"TableRow"};case"td":case"th":return{_type:"TableCell",tag:t.tagName};case"thead":return{_type:"TableHead"};case"tbody":return{_type:"TableBody"};case"tfoot":return{_type:"TableFooter"};default:return{_type:"Box",tag:t.tagName,name:t.tagName==="div"?"Box":e.capitalize(t.tagName)}}},m=(t,r=null)=>e.flatMapDeep(t,s=>{var c;if(s.type==="comment")return[];let a={_id:p.generateUUID()};if(r&&(a._parent=r.block._id),s.type==="text")return e.isEmpty(e.get(s,"content",""))?[]:r&&v(r.node,r.block)?(e.set(r,"block.content",e.get(s,"content","")),[]):{...a,_type:"Text",content:e.get(s,"content","")};if(a={...a,...N(s),...y(s),...k(s)},a._type==="Input"){const i=a.inputType||"text";i==="checkbox"?e.set(a,"_type","Checkbox"):i==="radio"&&e.set(a,"_type","Radio")}else{if(s.tagName==="video")return a.content=o.stringify([s]),[a];if(s.tagName==="svg"){const i=e.find(s.attributes,{key:"height"}),n=e.find(s.attributes,{key:"width"}),f=e.get(i,"value")?`[${e.get(i,"value")}px]`:"full",_=e.get(n,"value")?`[${e.get(n,"value")}px]`:"full",d=e.get(e.find(s.attributes,{key:"class"}),"value");return a.styles=`${u.STYLES_KEY}, ${p.cn$1(`w-${_} h-${f}`,d)}`.trim(),s.attributes=e.filter(s.attributes,b=>!e.includes(["style","width","height","class"],b.key)),a.icon=o.stringify([s]),e.set(a,"styles_attrs",e.omit(e.get(a,"styles_attrs")||{},["height","width","style","class"])),[a]}else if(s.tagName=="option"&&r&&((c=r.block)==null?void 0:c._type)==="Select")return r.block.options.push({label:h(s.children),...y(s)}),[]}const l=m(s.children,{block:a,node:s});return[a,...l]}),L=t=>{const r=t.match(/<body[^>]*>[\s\S]*?<\/body>/);return(r&&r.length>0?r[0].replace(/<body/,"<div").replace(/<\/body>/,"</div>"):t).replace(/\s+/g," ").replaceAll("> <","><").replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,"").trim()},S=t=>{const r=o.parse(L(t));return e.isEmpty(t)?[]:e.flatten(m(r))};exports.getBlocksFromHTML=S;
@@ -3,7 +3,7 @@ import * as m from "react";
3
3
  import et, { createContext as Os, useContext as zs, useRef as Br, createElement as Rr, useReducer as Vs, useEffect as je, useDebugValue as $s, useCallback as A, useMemo as Fs, useState as De, Suspense as vt } from "react";
4
4
  import * as zt from "@radix-ui/react-toggle";
5
5
  import { cva as be } from "class-variance-authority";
6
- import { g as le, c as Pe, a as Gs, b as c } from "./utils-zWMk4dB2.js";
6
+ import { g as le, c as Pe, a as Gs, b as c } from "./utils-XsPKXMVo.js";
7
7
  import * as He from "@radix-ui/react-switch";
8
8
  import { Slot as Ws } from "@radix-ui/react-slot";
9
9
  import * as pe from "@radix-ui/react-accordion";
@@ -25,7 +25,7 @@ import { Command as U } from "cmdk";
25
25
  import * as T from "@radix-ui/react-context-menu";
26
26
  import Ks, { IconPickerItem as Js } from "react-icons-picker";
27
27
  import Ys from "react-dom";
28
- import { flatten as Y, filter as I, omit as at, isEmpty as oe, isString as Qs, find as se, map as V, each as ce, get as E, set as fe, has as nt, includes as $, isUndefined as zr, without as Ft, forIn as Gt, findIndex as Be, last as Xs, first as ee, startsWith as Wt, isNull as qe, pick as wt, sortBy as Nt, isObject as Zs } from "lodash";
28
+ import { n as Y, b as I, o as at, a as oe, i as Qs, j as se, d as V, f as ce, g as E, s as fe, t as nt, c as $, w as zr, x as Ft, y as Gt, z as Be, l as Xs, h as ee, e as Wt, A as qe, B as wt, q as Nt, C as Zs } from "./lodash-3gkdNK5u.js";
29
29
  import eo from "react-quill";
30
30
  import { atom as y, useAtom as R, useAtomValue as L, useSetAtom as de } from "jotai";
31
31
  import Ut from "flat-to-nested";
@@ -2580,7 +2580,7 @@ const Sr = (e) => {
2580
2580
  }
2581
2581
  )
2582
2582
  ] });
2583
- }, jr = et.lazy(() => import("./UnsplashImages-AL1ASAoD.js")), Ar = et.lazy(() => import("./UploadImages-09wuhk2O.js")), Es = ({
2583
+ }, jr = et.lazy(() => import("./UnsplashImages-mqK09h8E.js")), Ar = et.lazy(() => import("./UploadImages-IDkkRuhx.js")), Es = ({
2584
2584
  isModalView: e = !1,
2585
2585
  onSelect: t = () => {
2586
2586
  }