@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.
- package/dist/{AddBlocks-gbfzju1d.js → AddBlocks-tMxKPoen.js} +50 -50
- package/dist/{AddBlocks-wuKI1ieB.cjs → AddBlocks-x2LkOHSj.cjs} +1 -1
- package/dist/BrandingOptions-EzT9UYd6.cjs +1 -0
- package/dist/{BrandingOptions-mZXO7thQ.js → BrandingOptions-QJJ1y5ez.js} +55 -50
- package/dist/{CanvasArea-7GpvsKP6.js → CanvasArea-EfZgx-gN.js} +406 -404
- package/dist/CanvasArea-rIDwPHl5.cjs +60 -0
- package/dist/{CurrentPage-tHBommaV.cjs → CurrentPage-QNFPD078.cjs} +1 -1
- package/dist/{CurrentPage-C52wu_r7.js → CurrentPage-ulHTz4MD.js} +7 -7
- package/dist/{Layers-NDtp2-im.js → Layers-rehZkz78.js} +171 -148
- package/dist/Layers-v-7k3W2I.cjs +1 -0
- package/dist/{MarkAsGlobalBlock-SPWd6Flk.js → MarkAsGlobalBlock-BjP-Rqlf.js} +6 -5
- package/dist/MarkAsGlobalBlock-X5dNmZcb.cjs +1 -0
- package/dist/{PagesPanel-qV7yGT-K.js → PagesPanel-acGVGJf-.js} +5 -5
- package/dist/{PagesPanel-qZ_-tybb.cjs → PagesPanel-x5ms_LOD.cjs} +1 -1
- package/dist/{ProjectPanel-vzyFbBNU.cjs → ProjectPanel-5BHQ5ANP.cjs} +1 -1
- package/dist/{ProjectPanel-RJqNz-uq.js → ProjectPanel-aLFJq49M.js} +5 -5
- package/dist/Settings-iOjfw5NQ.cjs +1 -0
- package/dist/{Settings-t0I7LKxe.js → Settings-v-txwlII.js} +172 -171
- package/dist/{SidePanels-rXx-fGjB.js → SidePanels-Vdc-J5wK.js} +96 -93
- package/dist/SidePanels-t0g9ZQFT.cjs +1 -0
- package/dist/Topbar-V8xCetWF.cjs +1 -0
- package/dist/{Topbar-ks1ckGLz.js → Topbar-j4t4AgCq.js} +4 -3
- package/dist/{UnsplashImages-8vJPuqrF.js → UnsplashImages-41Y3q5_Q.js} +7 -6
- package/dist/UnsplashImages-DbHky6cj.cjs +1 -0
- package/dist/UploadImages-DnQ95_NW.cjs +1 -0
- package/dist/{UploadImages-6N6UrjLo.js → UploadImages-xBg-kbKv.js} +13 -12
- package/dist/{add-page-modal-a8r8poMY.cjs → add-page-modal-0YAI9dXr.cjs} +1 -1
- package/dist/{add-page-modal-2VlONTs5.js → add-page-modal-6DlGzdA4.js} +5 -5
- package/dist/{confirm-alert-f3DYO5Hj.cjs → confirm-alert-U7-NcG7G.cjs} +1 -1
- package/dist/{confirm-alert-biqvaLT-.js → confirm-alert-i4pM3mOt.js} +4 -3
- package/dist/core.cjs +1 -1
- package/dist/core.js +19 -19
- package/dist/{delete-page-modal-_8O4RCkG.js → delete-page-modal-T_rlQfNd.js} +4 -4
- package/dist/{delete-page-modal-NmwHGjZP.cjs → delete-page-modal-qXpi_2xR.cjs} +1 -1
- package/dist/email-blocks.cjs +1 -1
- package/dist/email-blocks.js +263 -24
- package/dist/{form-Moz_psOw.js → form-OVmsLOrc.js} +1 -1
- package/dist/{form-lJhy9DEC.cjs → form-VbouZlAW.cjs} +1 -1
- package/dist/html-to-json-2PeOCVey.cjs +1 -0
- package/dist/{html-to-json-yjzEN9OX.js → html-to-json-57841sEK.js} +25 -26
- package/dist/{index-482XFRhB.js → index-EGUphg4R.js} +5402 -5366
- package/dist/index-H6vIwGfD.cjs +1 -0
- package/dist/index-e0c8PmRQ.js +205 -0
- package/dist/index-gi1LIOCw.cjs +1 -0
- package/dist/{index-3OU9zl6c.cjs → index-jw8RxsTv.cjs} +33 -33
- package/dist/{index-_OgCuSUz.js → index-niHREMmR.js} +1051 -1043
- package/dist/lib.cjs +1 -1
- package/dist/lib.js +20 -21
- package/dist/mockServiceWorker.js +1 -1
- package/dist/{page-viewer-ajtG_WZC.js → page-viewer-EoYYnA56.js} +5 -5
- package/dist/{page-viewer-k2VlWE3T.cjs → page-viewer-Ou8vDXGV.cjs} +1 -1
- package/dist/{project-general-setting-tAgCjUtR.cjs → project-general-setting-92q4oEYv.cjs} +1 -1
- package/dist/{project-general-setting-TIHLI4Qg.js → project-general-setting-DC_nADG-.js} +5 -5
- package/dist/{project-seo-setting-9JGBPzcA.cjs → project-seo-setting-Snn2nZgS.cjs} +1 -1
- package/dist/{project-seo-setting-dXclexQW.js → project-seo-setting-wxAGEkd_.js} +8 -7
- package/dist/{single-page-detail-6btKDNjs.cjs → single-page-detail-QmmhR_h2.cjs} +1 -1
- package/dist/{single-page-detail-lST7hWvC.js → single-page-detail-xtNZ9YxX.js} +6 -6
- package/dist/studio.cjs +1 -1
- package/dist/studio.js +4 -4
- package/dist/style.css +1 -1
- package/dist/ui.cjs +1 -1
- package/dist/ui.js +134 -133
- package/dist/{useAddBlockByDrop-uPXvrg4G.js → useAddBlockByDrop-_nwI4W3q.js} +1 -1
- package/dist/{useAddBlockByDrop-_nd8yZBa.cjs → useAddBlockByDrop-inkD7Lck.cjs} +1 -1
- package/dist/web-blocks.cjs +2 -2
- package/dist/web-blocks.js +138 -139
- package/package.json +5 -5
- package/dist/BrandingOptions-arKT1zCy.cjs +0 -1
- package/dist/CanvasArea-jvwkPvtQ.cjs +0 -59
- package/dist/Layers-4G-0aNk9.cjs +0 -1
- package/dist/MarkAsGlobalBlock-S2BhHTsK.cjs +0 -1
- package/dist/Settings-SV08lVcH.cjs +0 -1
- package/dist/SidePanels-TOJotvzn.cjs +0 -1
- package/dist/Topbar-u5XKdWgQ.cjs +0 -1
- package/dist/UnsplashImages-V8oKEHfi.cjs +0 -1
- package/dist/UploadImages-eHYxwWAp.cjs +0 -1
- package/dist/html-to-json-5UoswV2Q.cjs +0 -1
- 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 {
|
|
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
|
-
|
|
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
|
-
},
|
|
10
|
-
if (
|
|
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})/,
|
|
13
|
-
return c && (s.test(c) ||
|
|
14
|
-
},
|
|
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 &&
|
|
48
|
-
const e = {}, a =
|
|
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" }),
|
|
53
|
-
s &&
|
|
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
|
-
|
|
54
|
+
n(e, a[i], h(c));
|
|
56
55
|
} else
|
|
57
|
-
|
|
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
|
-
},
|
|
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
|
|
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
|
-
...
|
|
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" ?
|
|
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
|
|
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" }),
|
|
167
|
-
return r.styles = `${p}, ${k(`w-${v} h-${_}`, T)}`.trim(), a.attributes = C(a.attributes, (w) => !
|
|
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
|
-
}),
|
|
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
|
-
},
|
|
179
|
-
const e = x(
|
|
180
|
-
return
|
|
177
|
+
}, D = (t) => {
|
|
178
|
+
const e = x(P(t));
|
|
179
|
+
return y(t) ? [] : R(d(e));
|
|
181
180
|
};
|
|
182
181
|
export {
|
|
183
|
-
|
|
182
|
+
D as g
|
|
184
183
|
};
|