@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.
- package/dist/AddBlocks-AG_J7s2Z.cjs +1 -0
- package/dist/{AddBlocks-A7WofxHV.js → AddBlocks-FsdsASNp.js} +51 -51
- package/dist/{BrandingOptions-wkFrLFI_.js → BrandingOptions-4qzTYdj5.js} +6 -5
- package/dist/BrandingOptions-xBuqDpj0.cjs +1 -0
- package/dist/{CanvasArea-kF46NWZK.cjs → CanvasArea-4m1-c1yq.cjs} +7 -7
- package/dist/{CanvasArea-chEYQhH8.js → CanvasArea-U3egqewu.js} +7 -7
- package/dist/{CurrentPage-Wd7F9Egg.js → CurrentPage-spjJpQSM.js} +10 -10
- package/dist/CurrentPage-zxrdTVsG.cjs +1 -0
- package/dist/{Layers-qMOMP2Mi.js → Layers-QNAlCI4j.js} +81 -81
- package/dist/Layers-YyBChBtg.cjs +1 -0
- package/dist/MarkAsGlobalBlock-LXDkmFUr.cjs +1 -0
- package/dist/{MarkAsGlobalBlock-Czq45Amf.js → MarkAsGlobalBlock-xOHhiMDl.js} +3 -3
- package/dist/{PagesPanel-ay4uk4mg.js → PagesPanel--LI-BoSj.js} +6 -6
- package/dist/PagesPanel-BeJrveus.cjs +1 -0
- package/dist/ProjectPanel-MjcAymKT.cjs +1 -0
- package/dist/{ProjectPanel-eLlbfAtj.js → ProjectPanel-VNj0jXca.js} +10 -10
- package/dist/Settings-BrYkhn3H.cjs +1 -0
- package/dist/{Settings-lpoxaMDu.js → Settings-LZJwbkO6.js} +433 -432
- package/dist/{SidePanels-iRXV69vh.js → SidePanels-4lvmnnlw.js} +36 -36
- package/dist/SidePanels-_5oUp-eI.cjs +1 -0
- package/dist/{Topbar-dQYhW4iv.js → Topbar-_-1HX-EE.js} +3 -3
- package/dist/Topbar-gQxbcPtG.cjs +1 -0
- package/dist/UnsplashImages-PNp5fYCc.cjs +1 -0
- package/dist/{UnsplashImages-AL1ASAoD.js → UnsplashImages-mqK09h8E.js} +6 -6
- package/dist/UploadImages-BoSSsLtD.cjs +1 -0
- package/dist/{UploadImages-09wuhk2O.js → UploadImages-IDkkRuhx.js} +3 -3
- package/dist/{add-page-modal-TXREEFPZ.js → add-page-modal-fZnKopNf.js} +14 -13
- package/dist/add-page-modal-rWhPuGd9.cjs +1 -0
- package/dist/confirm-alert-dHRDZrA1.cjs +1 -0
- package/dist/{confirm-alert-GkfW9chS.js → confirm-alert-ea5xpncD.js} +3 -3
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +5 -15
- package/dist/core.js +5 -5
- package/dist/delete-page-modal-P_KKu12n.cjs +1 -0
- package/dist/{delete-page-modal-LNME2FwD.js → delete-page-modal-fRoXPfhG.js} +5 -5
- package/dist/form-6qGAOYI3.cjs +1 -0
- package/dist/{form-Fk4CaX1A.js → form-irY39wvJ.js} +29 -29
- package/dist/functions-86L6n983.js +23 -0
- package/dist/functions-Jr7gX_RX.cjs +1 -0
- package/dist/{html-to-json-kGgp07Hv.js → html-to-json-Y5M0N8PH.js} +33 -33
- package/dist/html-to-json-aAZkA0f5.cjs +1 -0
- package/dist/{index-89A3jPHh.js → index-0OqmBgqo.js} +3 -3
- package/dist/{index-61c5wSJn.cjs → index-1Dr-VtaT.cjs} +2 -2
- package/dist/{index-Q5q5Y_8a.js → index-CQz6j3ex.js} +6 -6
- package/dist/index-d55M5MRz.cjs +1 -0
- package/dist/lib.cjs +1 -1
- package/dist/lib.js +27 -27
- package/dist/lodash-2us0VT8I.cjs +36 -0
- package/dist/lodash-3gkdNK5u.js +4538 -0
- package/dist/{page-viewer-LPx-OTCC.js → page-viewer-39ZtxLzx.js} +6 -6
- package/dist/page-viewer-_lc8vqU4.cjs +1 -0
- package/dist/{project-general-setting-sSpFUD_Y.js → project-general-setting-CCVuGyHh.js} +9 -8
- package/dist/project-general-setting-LEzDhwoq.cjs +1 -0
- package/dist/{project-seo-setting-CGVegBtM.js → project-seo-setting-Wo7E46w7.js} +6 -5
- package/dist/project-seo-setting-orwH-Ufg.cjs +1 -0
- package/dist/render.cjs +1 -1
- package/dist/render.js +46 -46
- package/dist/server.cjs +1 -1
- package/dist/server.js +11 -11
- package/dist/single-page-detail-jkDYF7lW.cjs +1 -0
- package/dist/{single-page-detail-32H1_IG4.js → single-page-detail-r1GJF00l.js} +29 -28
- package/dist/studio.cjs +1 -1
- package/dist/studio.js +5 -5
- package/dist/ui.cjs +1 -1
- package/dist/ui.js +3 -3
- package/dist/useAddBlockByDrop-5QW86HjG.js +20 -0
- package/dist/useAddBlockByDrop-Ckzuvu-s.cjs +1 -0
- package/dist/utils-37UXq2O5.cjs +1 -0
- package/dist/{utils-zWMk4dB2.js → utils-XsPKXMVo.js} +5 -5
- package/package.json +2 -2
- package/dist/AddBlocks-Yuc4t0Z_.cjs +0 -1
- package/dist/BrandingOptions-KkPF1OGn.cjs +0 -1
- package/dist/CurrentPage-p9MaXTOB.cjs +0 -1
- package/dist/Layers-wQ0Fv9Xc.cjs +0 -1
- package/dist/MarkAsGlobalBlock-sb3hMXLq.cjs +0 -1
- package/dist/PagesPanel--maZxwX5.cjs +0 -1
- package/dist/ProjectPanel-KhIpO7m3.cjs +0 -1
- package/dist/Settings-n2DpS5Ta.cjs +0 -1
- package/dist/SidePanels-Dud5Xh9L.cjs +0 -1
- package/dist/Topbar-vqzjB75a.cjs +0 -1
- package/dist/UnsplashImages-3Sh4UZ-7.cjs +0 -1
- package/dist/UploadImages-mPzLhMiH.cjs +0 -1
- package/dist/add-page-modal-FPnIWwqA.cjs +0 -1
- package/dist/confirm-alert-YNyc3WEo.cjs +0 -1
- package/dist/delete-page-modal-sTbqZPvk.cjs +0 -1
- package/dist/form-OhgCJlVA.cjs +0 -1
- package/dist/functions-ZWGlwlQY.cjs +0 -1
- package/dist/functions-slns6ONz.js +0 -23
- package/dist/html-to-json-po8on2ju.cjs +0 -1
- package/dist/index-GNmGzavZ.cjs +0 -1
- package/dist/page-viewer-wQO9oV9h.cjs +0 -1
- package/dist/project-general-setting-8EwuN5lN.cjs +0 -1
- package/dist/project-seo-setting-R77SKM1I.cjs +0 -1
- package/dist/single-page-detail-nyBEHLtT.cjs +0 -1
- package/dist/useAddBlockByDrop-4VH-SMj7.cjs +0 -1
- package/dist/useAddBlockByDrop-_kyR0iI4.js +0 -20
- 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 {
|
|
5
|
-
import { bd as P, be as E, bf as O, bg as S } from "./index-
|
|
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:
|
|
12
|
-
return Object.keys(
|
|
13
|
-
const e =
|
|
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 =
|
|
17
|
-
|
|
18
|
-
}),
|
|
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,
|
|
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 =
|
|
28
|
-
|
|
29
|
-
}),
|
|
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:
|
|
39
|
-
title:
|
|
38
|
+
const { properties: p, title: a } = i, n = {
|
|
39
|
+
title: a,
|
|
40
40
|
type: "object",
|
|
41
41
|
properties: {}
|
|
42
42
|
};
|
|
43
|
-
return Object.keys(
|
|
44
|
-
const t =
|
|
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 =
|
|
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:
|
|
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(
|
|
60
|
-
const t =
|
|
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 =
|
|
64
|
-
e.items.properties[s] = y(t, l), $(e.items, "title",
|
|
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:
|
|
73
|
-
onChange:
|
|
72
|
+
formData: p,
|
|
73
|
+
onChange: a,
|
|
74
74
|
disabled: n = !1,
|
|
75
|
-
activeLang:
|
|
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 =
|
|
86
|
-
r.properties[f] = y(s,
|
|
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 &&
|
|
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:
|
|
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-
|
|
3
|
-
import {
|
|
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 = {},
|
|
40
|
-
return $(
|
|
41
|
-
if (
|
|
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,
|
|
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
|
|
54
|
-
if (
|
|
55
|
-
const
|
|
56
|
-
return { [e]: `${p},${
|
|
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, (
|
|
139
|
+
}, b = (t, e = null) => C(t, (a) => {
|
|
140
140
|
var l;
|
|
141
|
-
if (
|
|
141
|
+
if (a.type === "comment")
|
|
142
142
|
return [];
|
|
143
|
-
let
|
|
144
|
-
if (e && (
|
|
145
|
-
return g(c(
|
|
146
|
-
if (
|
|
147
|
-
...
|
|
148
|
-
...E(
|
|
149
|
-
...f(
|
|
150
|
-
...q(
|
|
151
|
-
},
|
|
152
|
-
const s =
|
|
153
|
-
s === "checkbox" ? u(
|
|
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 (
|
|
156
|
-
return
|
|
157
|
-
if (
|
|
158
|
-
const s = o(
|
|
159
|
-
return
|
|
160
|
-
} else if (
|
|
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: _(
|
|
163
|
-
...f(
|
|
162
|
+
label: _(a.children),
|
|
163
|
+
...f(a)
|
|
164
164
|
}), [];
|
|
165
165
|
}
|
|
166
|
-
const i = b(
|
|
167
|
-
return [
|
|
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-
|
|
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 {
|
|
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-
|
|
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
|
}
|