@chaibuilder/sdk 1.2.25 → 1.2.27
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-S-4jzdWv.cjs +1 -0
- package/dist/AddBlocks-ksZjjn0k.js +205 -0
- package/dist/BrandingOptions-EMCT0Wa3.cjs +1 -0
- package/dist/{BrandingOptions-iTyWpwTs.js → BrandingOptions-T_kbQFQv.js} +53 -40
- package/dist/CanvasArea-SDzbubar.cjs +55 -0
- package/dist/{CanvasArea-dZjng782.js → CanvasArea-rhOeubmu.js} +323 -340
- package/dist/{Class-ahc3NIbq.js → Class-3k8xjeiM.js} +29 -26
- package/dist/Class-MmCxz2Ay.cjs +1 -0
- package/dist/{CurrentPage-Kmfp-kFk.js → CurrentPage-0eeU1V_c.js} +53 -40
- package/dist/CurrentPage-aTjWjc3o.cjs +1 -0
- package/dist/Functions-7jnEwJyw.js +15 -0
- package/dist/Functions-N3yhPYKY.cjs +1 -0
- package/dist/{ListTree-N3jeD790.js → ListTree-Muu4rAtp.js} +96 -87
- package/dist/ListTree-SWsqdfcG.cjs +1 -0
- package/dist/MODIFIERS-9EwxLM8V.cjs +1 -0
- package/dist/{MODIFIERS-CNqNUapY.js → MODIFIERS-WQdaNvb8.js} +8 -10
- package/dist/PagesPanel-n3x-0ozR.cjs +1 -0
- package/dist/{PagesPanel-u1IB-nRr.js → PagesPanel-rYN28QpN.js} +44 -29
- package/dist/ProjectPanel-ivFOhdcz.js +84 -0
- package/dist/ProjectPanel-pBePMOta.cjs +1 -0
- package/dist/Settings-JRyJayf5.cjs +1 -0
- package/dist/{Settings-jCcd-VE6.js → Settings-XWmKzRl9.js} +400 -407
- package/dist/SidePanels-BtUeo6M9.cjs +1 -0
- package/dist/{SidePanels-pHMYprpW.js → SidePanels-ODktnGbC.js} +117 -108
- package/dist/Topbar-QMeD3hvq.cjs +1 -0
- package/dist/Topbar-Yunooh00.js +131 -0
- package/dist/UnsplashImages-05JR8oIu.cjs +1 -0
- package/dist/{UnsplashImages-L7x_3RQf.js → UnsplashImages-QMl0bxix.js} +59 -47
- package/dist/UploadImages-OgSN1HVt.cjs +1 -0
- package/dist/{UploadImages-zdEJRLD8.js → UploadImages-Si-A26bc.js} +58 -36
- package/dist/_commonjsHelpers-UyOWmZb0.js +8 -0
- package/dist/_commonjsHelpers-wDK0ZLPo.cjs +1 -0
- package/dist/add-page-modal-9pTKItY-.cjs +1 -0
- package/dist/add-page-modal-U7AUUrI1.js +103 -0
- package/dist/confirm-alert-DhRc-Zcd.cjs +1 -0
- package/dist/confirm-alert-kV5-c70T.js +59 -0
- package/dist/controls-KK2oLIa8.cjs +1 -0
- package/dist/{controls-IS5qnRce.js → controls-OfJWSEqC.js} +85 -20
- package/dist/core.cjs +1 -1
- package/dist/core.js +74 -150
- package/dist/defaultTheme-7Lk2zq60.cjs +1 -0
- package/dist/{defaultTheme-4kA60XdB.js → defaultTheme-gunU_Fe5.js} +8 -6
- package/dist/delete-page-modal-4s-6AIy4.cjs +1 -0
- package/dist/delete-page-modal-UCBpdjLe.js +82 -0
- package/dist/email-blocks.cjs +1 -1
- package/dist/email-blocks.js +292 -3
- package/dist/email.cjs +1 -1
- package/dist/email.js +36 -18
- package/dist/empty-slot-ZBlsQi6m.js +15 -0
- package/dist/empty-slot-nzYOgZuS.cjs +1 -0
- package/dist/form-Ap63cNec.cjs +1 -0
- package/dist/{form-0_RLz2TB.js → form-zmlTjM9j.js} +12 -12
- package/dist/html-to-json-C_Eobs_d.cjs +1 -0
- package/dist/{html-to-json-2xtb7520.js → html-to-json-p__Fgqdg.js} +65 -40
- package/dist/index-CFUoB97-.js +3079 -0
- package/dist/index-F4AQQ6qq.cjs +1 -0
- package/dist/index-Qk028f-N.cjs +1 -0
- package/dist/index-YpnaudSM.js +63 -0
- package/dist/index-e0c8PmRQ.js +205 -0
- package/dist/index-ecnGWzh9.cjs +1 -0
- package/dist/index-f0AbmoYY.js +2201 -0
- package/dist/index-gi1LIOCw.cjs +1 -0
- package/dist/index-l19JVVXI.cjs +206 -0
- package/dist/index-lOJfSheQ.js +39503 -0
- package/dist/{jsx-runtime-Sp0orL4X.js → jsx-runtime-WbnYoNE9.js} +109 -106
- package/dist/jsx-runtime-Z_BpKhVy.cjs +27 -0
- package/dist/lib.cjs +3 -3
- package/dist/lib.js +59 -56
- package/dist/page-viewer-YFrIG3L7.cjs +1 -0
- package/dist/{page-viewer-NnOwmAmu.js → page-viewer-jOwy--9A.js} +56 -43
- package/dist/{project-general-setting-9ju3TDju.js → project-general-setting-3N8HZ2fe.js} +42 -35
- package/dist/project-general-setting-hK7I7FuN.cjs +1 -0
- package/dist/{project-seo-setting-36CdUszM.js → project-seo-setting-bSiNgO_1.js} +39 -23
- package/dist/project-seo-setting-x-FK0pez.cjs +1 -0
- package/dist/render.cjs +1 -1
- package/dist/render.js +16 -16
- package/dist/{single-page-detail-hD1jKZ8k.js → single-page-detail--AZlZ-pC.js} +73 -66
- package/dist/single-page-detail-9abF2g2R.cjs +1 -0
- package/dist/studio.cjs +1 -1
- package/dist/studio.js +39 -24
- package/dist/ui.cjs +1 -1
- package/dist/ui.js +158 -364
- package/dist/web-blocks.cjs +1 -1
- package/dist/web-blocks.js +1052 -3
- package/package.json +1 -1
- package/dist/AddBlocks-Ol3iIVKa.js +0 -207
- package/dist/AddBlocks-a1c-7Ewz.cjs +0 -1
- package/dist/BrandingOptions-6rnt0UaA.cjs +0 -1
- package/dist/CanvasArea-R4ogF9AT.cjs +0 -55
- package/dist/ChaiBuilderEditor-m30yoOgJ.cjs +0 -163
- package/dist/ChaiBuilderEditor-vP4at00I.js +0 -27974
- package/dist/Class-eieto7e-.cjs +0 -1
- package/dist/Controls-3Cc1XYXg.js +0 -105
- package/dist/Controls-ky25Ebo3.cjs +0 -1
- package/dist/CurrentPage-3gQTH0Zt.cjs +0 -1
- package/dist/Functions-Hvon6AMZ.cjs +0 -1
- package/dist/Functions-NzT2Six_.js +0 -15
- package/dist/ImagesPanel-J1RlG7xG.cjs +0 -1
- package/dist/ImagesPanel-Wb0GF_NA.js +0 -29
- package/dist/ListTree-CZ-mtjZ9.cjs +0 -1
- package/dist/MODIFIERS-o1p3VnpS.cjs +0 -1
- package/dist/PagesPanel-Gi0z6gaf.cjs +0 -1
- package/dist/ProjectPanel-EydGZmMW.js +0 -71
- package/dist/ProjectPanel-kiiljG4H.cjs +0 -1
- package/dist/STRINGS-b432aBJJ.js +0 -7
- package/dist/STRINGS-gPz7CUOk.cjs +0 -1
- package/dist/Settings-8ilCSH8b.cjs +0 -1
- package/dist/SidePanels-T36C6Lhc.cjs +0 -1
- package/dist/Topbar-CvWQuspR.cjs +0 -1
- package/dist/Topbar-pbIDUE_B.js +0 -122
- package/dist/UnsplashImages-KBZPd9dv.cjs +0 -1
- package/dist/UploadImages-GkkJVAgG.cjs +0 -1
- package/dist/accordion-oPUeqPCZ.js +0 -42
- package/dist/accordion-ynvFtV_p.cjs +0 -1
- package/dist/add-page-modal-9SGv2hgc.cjs +0 -1
- package/dist/add-page-modal-JCDXZIPW.js +0 -95
- package/dist/alert-dialog-P9xMMB6C.cjs +0 -1
- package/dist/alert-dialog-rypfO5ly.js +0 -64
- package/dist/badge-E-S7CqUt.cjs +0 -1
- package/dist/badge-tEwO7C51.js +0 -23
- package/dist/block-helpers-OKHmRRol.cjs +0 -1
- package/dist/block-helpers-oSFpSsGz.js +0 -23
- package/dist/command-BxR6jaCI.cjs +0 -1
- package/dist/command-Pn3HKDuV.js +0 -97
- package/dist/confirm-alert-uNm0lZ0y.cjs +0 -1
- package/dist/confirm-alert-wR5_VJ1l.js +0 -36
- package/dist/context-menu-8dC9uGXj.js +0 -122
- package/dist/context-menu-IgLbIuth.cjs +0 -1
- package/dist/controls-L7DPvB0m.cjs +0 -1
- package/dist/defaultTheme-mrkeGFGI.cjs +0 -1
- package/dist/delete-page-modal-7KmP1elv.js +0 -67
- package/dist/delete-page-modal-SgfwvfNu.cjs +0 -1
- package/dist/dropdown-menu-El86_9Uo.js +0 -124
- package/dist/dropdown-menu-SiHzqWwZ.cjs +0 -1
- package/dist/form-W58AVUdf.cjs +0 -1
- package/dist/hover-card-KUwpDkW8.cjs +0 -1
- package/dist/hover-card-q138xxXR.js +0 -45
- package/dist/html-to-json-uSnxl72F.cjs +0 -1
- package/dist/iconBase-gbUAAO2L.cjs +0 -1
- package/dist/iconBase-h4DuR_XT.js +0 -63
- package/dist/index-9MmykVSc.cjs +0 -1
- package/dist/index-hElOGcFr.js +0 -2200
- package/dist/index-lDTsQp7h.js +0 -188
- package/dist/index-rq5Y9ZDy.cjs +0 -1
- package/dist/jsx-runtime-JYMCiFoE.cjs +0 -27
- package/dist/label-KaP7MRrs.js +0 -10
- package/dist/label-tFm8HZdb.cjs +0 -1
- package/dist/link-WbcKdQ9k.cjs +0 -1
- package/dist/link-xuhP-4dN.js +0 -196
- package/dist/page-viewer-Hx5hxHKm.cjs +0 -1
- package/dist/popover-a84pbVhQ.js +0 -23
- package/dist/popover-fKjgcRUx.cjs +0 -1
- package/dist/project-general-setting-FxkwjvJz.cjs +0 -1
- package/dist/project-seo-setting-RU7qiXxb.cjs +0 -1
- package/dist/scroll-area-FiHvy-TZ.cjs +0 -1
- package/dist/scroll-area-ewXbxc3n.js +0 -30
- package/dist/select-7bjg-rr9.cjs +0 -1
- package/dist/select-POGdEDHT.js +0 -75
- package/dist/separator-3Civ-6hb.cjs +0 -1
- package/dist/separator-SctTn0Qi.js +0 -18
- package/dist/single-page-detail-beY0MT1b.cjs +0 -1
- package/dist/skeleton-STeL9VrJ.cjs +0 -1
- package/dist/skeleton-lu8e7q2y.js +0 -239
- package/dist/tabs-_4WbA1cc.cjs +0 -1
- package/dist/tabs-yQ3oGziM.js +0 -106
- package/dist/textarea-1kZEh7ki.cjs +0 -1
- package/dist/textarea-b2QvVhrK.js +0 -73
- package/dist/useAddBlock-8pxOEYIl.cjs +0 -1
- package/dist/useAddBlock-FEKFJNwQ.js +0 -69
- package/dist/useChaiExternalData-fkFgoS80.js +0 -6
- package/dist/useChaiExternalData-rwoAZ6uU.cjs +0 -1
- package/dist/useDarkMode-7i57segK.cjs +0 -1
- package/dist/useDarkMode-8VHJlYyE.js +0 -23
- package/dist/useSelectedBreakpoints-6NK5qd7T.js +0 -10
- package/dist/useSelectedBreakpoints-7ONXb-vN.cjs +0 -1
- package/dist/useStylingState-Iuj84yvc.js +0 -186
- package/dist/useStylingState-OIvJMV6p.cjs +0 -1
- package/dist/useUiLibraries-nCdauJ4N.cjs +0 -1
- package/dist/useUiLibraries-psyWFbNc.js +0 -12
- package/dist/useUpdateBlocksProps-Unn8lUyj.cjs +0 -1
- package/dist/useUpdateBlocksProps-vWcDp-P9.js +0 -23
- package/dist/utils-dze1SGvB.js +0 -6
- package/dist/utils-qK_SjzzV.cjs +0 -1
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { g as N, c as k } from "./Functions-
|
|
3
|
-
import { isEmpty as g,
|
|
4
|
-
import {
|
|
5
|
-
const
|
|
1
|
+
import { stringify as y, parse as x } from "himalaya";
|
|
2
|
+
import { g as N, c as k } from "./Functions-7jnEwJyw.js";
|
|
3
|
+
import { isEmpty as g, includes as h, get as i, forEach as L, find as u, set as n, capitalize as C, flatMapDeep as A, filter as S, flatten as $ } from "lodash-es";
|
|
4
|
+
import { a as p } from "./MODIFIERS-WQdaNvb8.js";
|
|
5
|
+
const B = (t) => {
|
|
6
6
|
const e = /(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/(?:[^\/\n\s]+\/\S+\/|(?:v|e(?:mbed)?)\/|\S*?[?&]v=)|youtu\.be\/)([a-zA-Z0-9_-]{11})/, r = /(?:https?:\/\/)?(?:www\.)?(player)?.vimeo\.com/;
|
|
7
7
|
return e.test(t) || r.test(t);
|
|
8
|
-
},
|
|
8
|
+
}, M = (t) => {
|
|
9
9
|
if (g(t))
|
|
10
10
|
return t;
|
|
11
|
-
const e = /<video[^>]+src=['"]([^'">]+)['"]/, r = /<iframe[^>]+src=['"]([^'">]+)['"]/,
|
|
12
|
-
return c && (
|
|
13
|
-
},
|
|
11
|
+
const e = /<video[^>]+src=['"]([^'">]+)['"]/, r = /<iframe[^>]+src=['"]([^'">]+)['"]/, s = t.match(e), o = t.match(r), c = s ? s[1] : o ? o[1] : null, a = /(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/(?:[^\/\n\s]+\/\S+\/|(?:v|e(?:mbed)?)\/|\S*?[?&]v=)|youtu\.be\/)([a-zA-Z0-9_-]{11})/, l = /(?:https?:\/\/)?(?:www\.)?player.vimeo\.com/;
|
|
12
|
+
return c && (a.test(c) || l.test(c)) ? c : t;
|
|
13
|
+
}, R = {
|
|
14
14
|
img: { alt: "alt", width: "width", height: "height", src: "image" },
|
|
15
15
|
video: {
|
|
16
16
|
src: "url",
|
|
@@ -43,30 +43,55 @@ const R = (t) => {
|
|
|
43
43
|
multiple: "multiple",
|
|
44
44
|
name: "fieldName"
|
|
45
45
|
}
|
|
46
|
-
},
|
|
46
|
+
}, H = (t, e) => t.children.length === 1 && h(["Heading", "Paragraph", "Span", "ListItem", "Button", "Label", "TableCell", "Link"], e._type), d = (t) => t.map((e) => e.type === "text" ? i(e, "content", "") : g(e.children) ? "" : d(e.children)).join(""), m = (t) => t === null ? !0 : t, f = (t) => {
|
|
47
47
|
if (t.tagName === "svg")
|
|
48
48
|
return {};
|
|
49
|
-
const e = {}, r =
|
|
50
|
-
return
|
|
51
|
-
if (r[
|
|
52
|
-
if (t.tagName === "img" &&
|
|
53
|
-
const
|
|
54
|
-
|
|
49
|
+
const e = {}, r = R[t.tagName] || {}, s = t.attributes;
|
|
50
|
+
return L(s, ({ key: o, value: c }) => {
|
|
51
|
+
if (r[o]) {
|
|
52
|
+
if (t.tagName === "img" && o === "src" && !c.startsWith("http")) {
|
|
53
|
+
const a = u(t.attributes, { key: "width" }), l = u(t.attributes, { key: "height" });
|
|
54
|
+
a && l ? c = `https://via.placeholder.com/${a == null ? void 0 : a.value}x${l == null ? void 0 : l.value}` : c = "https://via.placeholder.com/150x150";
|
|
55
55
|
}
|
|
56
|
-
|
|
56
|
+
n(e, r[o], m(c));
|
|
57
57
|
} else
|
|
58
|
-
|
|
58
|
+
h(["style", "class", "srcset"], o) || n(e, `styles_attrs.${o}`, m(c));
|
|
59
59
|
}), delete e.class, e;
|
|
60
60
|
}, I = (t, e = "styles") => {
|
|
61
61
|
if (!t.attributes)
|
|
62
62
|
return { [e]: `${p},` };
|
|
63
63
|
const r = u(t.attributes, { key: "class" });
|
|
64
64
|
if (r) {
|
|
65
|
-
const
|
|
66
|
-
return { [e]: `${p},${
|
|
65
|
+
const s = r.value;
|
|
66
|
+
return { [e]: `${p},${s}` };
|
|
67
67
|
}
|
|
68
68
|
return { [e]: `${p},` };
|
|
69
69
|
}, q = (t) => {
|
|
70
|
+
const e = {
|
|
71
|
+
"hs-collapse-toggle": "CollapseToggle",
|
|
72
|
+
"hs-collapse": "Collapse",
|
|
73
|
+
"hs-accordion-group": "AccordionGroup",
|
|
74
|
+
"hs-accordion": "Accordion",
|
|
75
|
+
"hs-accordion-toggle": "AccordionToggle",
|
|
76
|
+
"hs-accordion-content": "AccordionContent",
|
|
77
|
+
"hs-dropdown": "Dropdown",
|
|
78
|
+
"hs-dropdown-toggle": "DropdownToggle",
|
|
79
|
+
"hs-dropdown-menu": "DropdownMenu",
|
|
80
|
+
"hs-overlay": "Overlay",
|
|
81
|
+
"hs-tooltip": "Tooltip",
|
|
82
|
+
"hs-tooltip-toggle": "TooltipToggle",
|
|
83
|
+
"hs-tooltip-content": "TooltipContent"
|
|
84
|
+
}, r = u(t.attributes, { key: "class" });
|
|
85
|
+
if (r) {
|
|
86
|
+
const s = r.value.split(" ");
|
|
87
|
+
for (const o of s)
|
|
88
|
+
if (e[o])
|
|
89
|
+
return e[o];
|
|
90
|
+
}
|
|
91
|
+
}, D = (t) => {
|
|
92
|
+
const e = q(t);
|
|
93
|
+
if (e)
|
|
94
|
+
return { _type: e };
|
|
70
95
|
switch (t.tagName) {
|
|
71
96
|
case "img":
|
|
72
97
|
return { _type: "Image" };
|
|
@@ -142,43 +167,43 @@ const R = (t) => {
|
|
|
142
167
|
return {
|
|
143
168
|
_type: "Box",
|
|
144
169
|
tag: t.tagName,
|
|
145
|
-
_name: t.tagName === "div" ? "Box" :
|
|
170
|
+
_name: t.tagName === "div" ? "Box" : C(t.tagName)
|
|
146
171
|
};
|
|
147
172
|
}
|
|
148
|
-
},
|
|
173
|
+
}, b = (t, e = null) => A(t, (r) => {
|
|
149
174
|
var c;
|
|
150
175
|
if (r.type === "comment")
|
|
151
176
|
return [];
|
|
152
|
-
let
|
|
153
|
-
if (e && (
|
|
154
|
-
return g(
|
|
155
|
-
if (
|
|
156
|
-
...
|
|
157
|
-
...
|
|
177
|
+
let s = { _id: N() };
|
|
178
|
+
if (e && (s._parent = e.block._id), r.type === "text")
|
|
179
|
+
return g(i(r, "content", "")) ? [] : e && H(e.node, e.block) ? (n(e, "block.content", i(r, "content", "")), []) : { ...s, _type: "Text", content: i(r, "content", "") };
|
|
180
|
+
if (s = {
|
|
181
|
+
...s,
|
|
182
|
+
...D(r),
|
|
158
183
|
...f(r),
|
|
159
184
|
...I(r)
|
|
160
|
-
},
|
|
161
|
-
const
|
|
162
|
-
|
|
185
|
+
}, s._type === "Input") {
|
|
186
|
+
const a = s.inputType || "text";
|
|
187
|
+
a === "checkbox" ? n(s, "_type", "Checkbox") : a === "radio" && n(s, "_type", "Radio");
|
|
163
188
|
} else if (r.tagName === "video" || r.tagName === "iframe") {
|
|
164
|
-
const
|
|
165
|
-
return
|
|
189
|
+
const a = y([r]);
|
|
190
|
+
return B(a) && (n(s, "_type", "Video"), n(s, "url", M(a)), n(s, "styles", `${p},absolute top-0 left-0 w-full h-full`), n(s, "controls", { autoPlay: !1, muted: !0, loop: !1, controls: !1 })), s.content = a, [s];
|
|
166
191
|
} else if (r.tagName === "svg") {
|
|
167
|
-
const
|
|
168
|
-
return
|
|
192
|
+
const a = u(r.attributes, { key: "height" }), l = u(r.attributes, { key: "width" }), _ = i(a, "value") ? `[${i(a, "value")}px]` : "24px", v = i(l, "value") ? `[${i(l, "value")}px]` : "24px", T = i(u(r.attributes, { key: "class" }), "value", "w-full h-full");
|
|
193
|
+
return s.styles = `${p}, ${k(`w-${v} h-${_}`, T)}`.trim(), r.attributes = S(r.attributes, (w) => !h(["style", "width", "height", "class"], w.key)), s.icon = y([r]), [s];
|
|
169
194
|
} else if (r.tagName == "option" && e && ((c = e.block) == null ? void 0 : c._type) === "Select")
|
|
170
195
|
return e.block.options.push({
|
|
171
|
-
label:
|
|
196
|
+
label: d(r.children),
|
|
172
197
|
...f(r)
|
|
173
198
|
}), [];
|
|
174
|
-
const
|
|
175
|
-
return [
|
|
199
|
+
const o = b(r.children, { block: s, node: r });
|
|
200
|
+
return [s, ...o];
|
|
176
201
|
}), E = (t) => {
|
|
177
202
|
const e = t.match(/<body[^>]*>[\s\S]*?<\/body>/);
|
|
178
203
|
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();
|
|
179
204
|
}, V = (t) => {
|
|
180
|
-
const e =
|
|
181
|
-
return g(t) ? [] :
|
|
205
|
+
const e = x(E(t));
|
|
206
|
+
return g(t) ? [] : $(b(e));
|
|
182
207
|
};
|
|
183
208
|
export {
|
|
184
209
|
V as g
|