@chaibuilder/sdk 1.2.6 → 1.2.8

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 (78) hide show
  1. package/dist/{AddBlocks-gbfzju1d.js → AddBlocks-tMxKPoen.js} +50 -50
  2. package/dist/{AddBlocks-wuKI1ieB.cjs → AddBlocks-x2LkOHSj.cjs} +1 -1
  3. package/dist/BrandingOptions-EzT9UYd6.cjs +1 -0
  4. package/dist/{BrandingOptions-mZXO7thQ.js → BrandingOptions-QJJ1y5ez.js} +55 -50
  5. package/dist/{CanvasArea-7GpvsKP6.js → CanvasArea-EfZgx-gN.js} +406 -404
  6. package/dist/CanvasArea-rIDwPHl5.cjs +60 -0
  7. package/dist/{CurrentPage-tHBommaV.cjs → CurrentPage-QNFPD078.cjs} +1 -1
  8. package/dist/{CurrentPage-C52wu_r7.js → CurrentPage-ulHTz4MD.js} +7 -7
  9. package/dist/{Layers-NDtp2-im.js → Layers-rehZkz78.js} +171 -148
  10. package/dist/Layers-v-7k3W2I.cjs +1 -0
  11. package/dist/{MarkAsGlobalBlock-SPWd6Flk.js → MarkAsGlobalBlock-BjP-Rqlf.js} +6 -5
  12. package/dist/MarkAsGlobalBlock-X5dNmZcb.cjs +1 -0
  13. package/dist/{PagesPanel-qV7yGT-K.js → PagesPanel-acGVGJf-.js} +5 -5
  14. package/dist/{PagesPanel-qZ_-tybb.cjs → PagesPanel-x5ms_LOD.cjs} +1 -1
  15. package/dist/{ProjectPanel-vzyFbBNU.cjs → ProjectPanel-5BHQ5ANP.cjs} +1 -1
  16. package/dist/{ProjectPanel-RJqNz-uq.js → ProjectPanel-aLFJq49M.js} +5 -5
  17. package/dist/Settings-iOjfw5NQ.cjs +1 -0
  18. package/dist/{Settings-t0I7LKxe.js → Settings-v-txwlII.js} +172 -171
  19. package/dist/{SidePanels-rXx-fGjB.js → SidePanels-Vdc-J5wK.js} +96 -93
  20. package/dist/SidePanels-t0g9ZQFT.cjs +1 -0
  21. package/dist/Topbar-V8xCetWF.cjs +1 -0
  22. package/dist/{Topbar-ks1ckGLz.js → Topbar-j4t4AgCq.js} +4 -3
  23. package/dist/{UnsplashImages-8vJPuqrF.js → UnsplashImages-41Y3q5_Q.js} +7 -6
  24. package/dist/UnsplashImages-DbHky6cj.cjs +1 -0
  25. package/dist/UploadImages-DnQ95_NW.cjs +1 -0
  26. package/dist/{UploadImages-6N6UrjLo.js → UploadImages-xBg-kbKv.js} +13 -12
  27. package/dist/{add-page-modal-a8r8poMY.cjs → add-page-modal-0YAI9dXr.cjs} +1 -1
  28. package/dist/{add-page-modal-2VlONTs5.js → add-page-modal-6DlGzdA4.js} +5 -5
  29. package/dist/{confirm-alert-f3DYO5Hj.cjs → confirm-alert-U7-NcG7G.cjs} +1 -1
  30. package/dist/{confirm-alert-biqvaLT-.js → confirm-alert-i4pM3mOt.js} +4 -3
  31. package/dist/core.cjs +1 -1
  32. package/dist/core.js +19 -19
  33. package/dist/{delete-page-modal-_8O4RCkG.js → delete-page-modal-T_rlQfNd.js} +4 -4
  34. package/dist/{delete-page-modal-NmwHGjZP.cjs → delete-page-modal-qXpi_2xR.cjs} +1 -1
  35. package/dist/email-blocks.cjs +1 -1
  36. package/dist/email-blocks.js +263 -24
  37. package/dist/{form-Moz_psOw.js → form-OVmsLOrc.js} +1 -1
  38. package/dist/{form-lJhy9DEC.cjs → form-VbouZlAW.cjs} +1 -1
  39. package/dist/html-to-json-2PeOCVey.cjs +1 -0
  40. package/dist/{html-to-json-yjzEN9OX.js → html-to-json-57841sEK.js} +25 -26
  41. package/dist/{index-482XFRhB.js → index-EGUphg4R.js} +5402 -5366
  42. package/dist/index-H6vIwGfD.cjs +1 -0
  43. package/dist/index-e0c8PmRQ.js +205 -0
  44. package/dist/index-gi1LIOCw.cjs +1 -0
  45. package/dist/{index-3OU9zl6c.cjs → index-jw8RxsTv.cjs} +33 -33
  46. package/dist/{index-_OgCuSUz.js → index-niHREMmR.js} +1051 -1043
  47. package/dist/lib.cjs +1 -1
  48. package/dist/lib.js +20 -21
  49. package/dist/mockServiceWorker.js +1 -1
  50. package/dist/{page-viewer-ajtG_WZC.js → page-viewer-EoYYnA56.js} +5 -5
  51. package/dist/{page-viewer-k2VlWE3T.cjs → page-viewer-Ou8vDXGV.cjs} +1 -1
  52. package/dist/{project-general-setting-tAgCjUtR.cjs → project-general-setting-92q4oEYv.cjs} +1 -1
  53. package/dist/{project-general-setting-TIHLI4Qg.js → project-general-setting-DC_nADG-.js} +5 -5
  54. package/dist/{project-seo-setting-9JGBPzcA.cjs → project-seo-setting-Snn2nZgS.cjs} +1 -1
  55. package/dist/{project-seo-setting-dXclexQW.js → project-seo-setting-wxAGEkd_.js} +8 -7
  56. package/dist/{single-page-detail-6btKDNjs.cjs → single-page-detail-QmmhR_h2.cjs} +1 -1
  57. package/dist/{single-page-detail-lST7hWvC.js → single-page-detail-xtNZ9YxX.js} +6 -6
  58. package/dist/studio.cjs +1 -1
  59. package/dist/studio.js +4 -4
  60. package/dist/style.css +1 -1
  61. package/dist/ui.cjs +1 -1
  62. package/dist/ui.js +134 -133
  63. package/dist/{useAddBlockByDrop-uPXvrg4G.js → useAddBlockByDrop-_nwI4W3q.js} +1 -1
  64. package/dist/{useAddBlockByDrop-_nd8yZBa.cjs → useAddBlockByDrop-inkD7Lck.cjs} +1 -1
  65. package/dist/web-blocks.cjs +2 -2
  66. package/dist/web-blocks.js +138 -139
  67. package/package.json +5 -5
  68. package/dist/BrandingOptions-arKT1zCy.cjs +0 -1
  69. package/dist/CanvasArea-jvwkPvtQ.cjs +0 -59
  70. package/dist/Layers-4G-0aNk9.cjs +0 -1
  71. package/dist/MarkAsGlobalBlock-S2BhHTsK.cjs +0 -1
  72. package/dist/Settings-SV08lVcH.cjs +0 -1
  73. package/dist/SidePanels-TOJotvzn.cjs +0 -1
  74. package/dist/Topbar-u5XKdWgQ.cjs +0 -1
  75. package/dist/UnsplashImages-V8oKEHfi.cjs +0 -1
  76. package/dist/UploadImages-eHYxwWAp.cjs +0 -1
  77. package/dist/html-to-json-5UoswV2Q.cjs +0 -1
  78. package/dist/index-IIJ_o44s.cjs +0 -1
@@ -1,17 +1,16 @@
1
1
  import { stringify as m, parse as x } from "himalaya";
2
2
  import { g as N, c as k } from "./Functions-7jnEwJyw.js";
3
- import { includes as y, get as l, isEmpty as g, forEach as L, find as u, set as o, capitalize as S, flatMapDeep as $, filter as C, flatten as A } from "lodash-es";
3
+ import { isEmpty as y, includes as g, get as l, forEach as L, find as u, set as n, capitalize as S, flatMapDeep as $, filter as C, omit as A, flatten as R } from "lodash-es";
4
4
  import { a as p } from "./MODIFIERS-RiXS5Mn1.js";
5
- import { isEmpty as R, omit as B } from "lodash";
6
- const H = (t) => {
5
+ const B = (t) => {
7
6
  const e = /(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/(?:[^\/\n\s]+\/\S+\/|(?:v|e(?:mbed)?)\/|\S*?[?&]v=)|youtu\.be\/)([a-zA-Z0-9_-]{11})/, a = /(?:https?:\/\/)?(?:www\.)?(player)?.vimeo\.com/;
8
7
  return e.test(t) || a.test(t);
9
- }, M = (t) => {
10
- if (R(t))
8
+ }, H = (t) => {
9
+ if (y(t))
11
10
  return t;
12
- const e = /<video[^>]+src=['"]([^'">]+)['"]/, a = /<iframe[^>]+src=['"]([^'">]+)['"]/, r = t.match(e), i = t.match(a), c = r ? r[1] : i ? i[1] : null, s = /(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/(?:[^\/\n\s]+\/\S+\/|(?:v|e(?:mbed)?)\/|\S*?[?&]v=)|youtu\.be\/)([a-zA-Z0-9_-]{11})/, n = /(?:https?:\/\/)?(?:www\.)?player.vimeo\.com/;
13
- return c && (s.test(c) || n.test(c)) ? c : t;
14
- }, E = {
11
+ const e = /<video[^>]+src=['"]([^'">]+)['"]/, a = /<iframe[^>]+src=['"]([^'">]+)['"]/, r = t.match(e), i = t.match(a), c = r ? r[1] : i ? i[1] : null, s = /(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/(?:[^\/\n\s]+\/\S+\/|(?:v|e(?:mbed)?)\/|\S*?[?&]v=)|youtu\.be\/)([a-zA-Z0-9_-]{11})/, o = /(?:https?:\/\/)?(?:www\.)?player.vimeo\.com/;
12
+ return c && (s.test(c) || o.test(c)) ? c : t;
13
+ }, M = {
15
14
  img: { alt: "alt", width: "width", height: "height", src: "image" },
16
15
  video: {
17
16
  src: "url",
@@ -44,17 +43,17 @@ const H = (t) => {
44
43
  multiple: "multiple",
45
44
  name: "fieldName"
46
45
  }
47
- }, I = (t, e) => t.children.length === 1 && y(["Heading", "Paragraph", "Span", "ListItem", "Button", "Label", "TableCell", "Link"], e._type), b = (t) => t.map((e) => e.type === "text" ? l(e, "content", "") : g(e.children) ? "" : b(e.children)).join(""), h = (t) => t === null ? !0 : t, f = (t) => {
48
- const e = {}, a = E[t.tagName] || {}, r = t.attributes;
46
+ }, I = (t, e) => t.children.length === 1 && g(["Heading", "Paragraph", "Span", "ListItem", "Button", "Label", "TableCell", "Link"], e._type), b = (t) => t.map((e) => e.type === "text" ? l(e, "content", "") : y(e.children) ? "" : b(e.children)).join(""), h = (t) => t === null ? !0 : t, f = (t) => {
47
+ const e = {}, a = M[t.tagName] || {}, r = t.attributes;
49
48
  return L(r, ({ key: i, value: c }) => {
50
49
  if (a[i]) {
51
50
  if (t.tagName === "img" && i === "src" && !c.startsWith("http")) {
52
- const s = u(t.attributes, { key: "width" }), n = u(t.attributes, { key: "height" });
53
- s && n ? c = `https://via.placeholder.com/${s == null ? void 0 : s.value}x${n == null ? void 0 : n.value}` : c = "https://via.placeholder.com/150x150";
51
+ const s = u(t.attributes, { key: "width" }), o = u(t.attributes, { key: "height" });
52
+ s && o ? c = `https://via.placeholder.com/${s == null ? void 0 : s.value}x${o == null ? void 0 : o.value}` : c = "https://via.placeholder.com/150x150";
54
53
  }
55
- o(e, a[i], h(c));
54
+ n(e, a[i], h(c));
56
55
  } else
57
- y(["style", "class", "srcset"], i) || o(e, `styles_attrs.${i}`, h(c));
56
+ g(["style", "class", "srcset"], i) || n(e, `styles_attrs.${i}`, h(c));
58
57
  }), delete e.class, e;
59
58
  }, q = (t, e = "styles") => {
60
59
  if (!t.attributes)
@@ -65,7 +64,7 @@ const H = (t) => {
65
64
  return { [e]: `${p},${r}` };
66
65
  }
67
66
  return { [e]: `${p},` };
68
- }, P = (t) => {
67
+ }, E = (t) => {
69
68
  switch (t.tagName) {
70
69
  case "img":
71
70
  return { _type: "Image" };
@@ -150,21 +149,21 @@ const H = (t) => {
150
149
  return [];
151
150
  let r = { _id: N() };
152
151
  if (e && (r._parent = e.block._id), a.type === "text")
153
- return g(l(a, "content", "")) ? [] : e && I(e.node, e.block) ? (o(e, "block.content", l(a, "content", "")), []) : { ...r, _type: "Text", content: l(a, "content", "") };
152
+ return y(l(a, "content", "")) ? [] : e && I(e.node, e.block) ? (n(e, "block.content", l(a, "content", "")), []) : { ...r, _type: "Text", content: l(a, "content", "") };
154
153
  if (r = {
155
154
  ...r,
156
- ...P(a),
155
+ ...E(a),
157
156
  ...f(a),
158
157
  ...q(a)
159
158
  }, r._type === "Input") {
160
159
  const s = r.inputType || "text";
161
- s === "checkbox" ? o(r, "_type", "Checkbox") : s === "radio" && o(r, "_type", "Radio");
160
+ s === "checkbox" ? n(r, "_type", "Checkbox") : s === "radio" && n(r, "_type", "Radio");
162
161
  } else if (a.tagName === "video" || a.tagName === "iframe") {
163
162
  const s = m([a]);
164
- return H(s) && (o(r, "_type", "Video"), o(r, "url", M(s)), o(r, "styles", `${p},absolute top-0 left-0 w-full h-full`), o(r, "controls", { autoPlay: !1, muted: !0, loop: !1, controls: !1 })), r.content = s, [r];
163
+ return B(s) && (n(r, "_type", "Video"), n(r, "url", H(s)), n(r, "styles", `${p},absolute top-0 left-0 w-full h-full`), n(r, "controls", { autoPlay: !1, muted: !0, loop: !1, controls: !1 })), r.content = s, [r];
165
164
  } else if (a.tagName === "svg") {
166
- const s = u(a.attributes, { key: "height" }), n = u(a.attributes, { key: "width" }), _ = l(s, "value") ? `[${l(s, "value")}px]` : "24px", v = l(n, "value") ? `[${l(n, "value")}px]` : "24px", T = l(u(a.attributes, { key: "class" }), "value", "w-full h-full");
167
- return r.styles = `${p}, ${k(`w-${v} h-${_}`, T)}`.trim(), a.attributes = C(a.attributes, (w) => !y(["style", "width", "height", "class"], w.key)), r.icon = m([a]), o(r, "styles_attrs", B(l(r, "styles_attrs") || {}, ["height", "width", "style", "class"])), [r];
165
+ const s = u(a.attributes, { key: "height" }), o = u(a.attributes, { key: "width" }), _ = l(s, "value") ? `[${l(s, "value")}px]` : "24px", v = l(o, "value") ? `[${l(o, "value")}px]` : "24px", T = l(u(a.attributes, { key: "class" }), "value", "w-full h-full");
166
+ return r.styles = `${p}, ${k(`w-${v} h-${_}`, T)}`.trim(), a.attributes = C(a.attributes, (w) => !g(["style", "width", "height", "class"], w.key)), r.icon = m([a]), n(r, "styles_attrs", A(l(r, "styles_attrs") || {}, ["height", "width", "style", "class"])), [r];
168
167
  } else if (a.tagName == "option" && e && ((c = e.block) == null ? void 0 : c._type) === "Select")
169
168
  return e.block.options.push({
170
169
  label: b(a.children),
@@ -172,13 +171,13 @@ const H = (t) => {
172
171
  }), [];
173
172
  const i = d(a.children, { block: r, node: a });
174
173
  return [r, ...i];
175
- }), z = (t) => {
174
+ }), P = (t) => {
176
175
  const e = t.match(/<body[^>]*>[\s\S]*?<\/body>/);
177
176
  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();
178
- }, Y = (t) => {
179
- const e = x(z(t));
180
- return g(t) ? [] : A(d(e));
177
+ }, D = (t) => {
178
+ const e = x(P(t));
179
+ return y(t) ? [] : R(d(e));
181
180
  };
182
181
  export {
183
- Y as g
182
+ D as g
184
183
  };