@chaibuilder/sdk 4.0.0-beta.2 → 4.0.0-beta.4
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/{2SSKDMRQ-C4VFVd-q.cjs → 2SSKDMRQ-CopJgtZb.cjs} +1 -1
- package/dist/{2SSKDMRQ-DSnzF_1o.js → 2SSKDMRQ-Difo_1pg.js} +2 -2
- package/dist/{AP7HFJJL-Cxwj01Aq.js → AP7HFJJL-BPuPBqj4.js} +1 -1
- package/dist/{AP7HFJJL-B7YYCY9q.cjs → AP7HFJJL-DYxDgaOs.cjs} +1 -1
- package/dist/{IconPicker-RqVvq6G2.js → IconPicker-B2-oriq2.js} +8 -7
- package/dist/IconPicker-C0oycHbs.cjs +1 -0
- package/dist/{WDYDFRGG-b3T2SQbz.cjs → WDYDFRGG-DbejaRPK.cjs} +1 -1
- package/dist/{WDYDFRGG-C7aSUcjs.js → WDYDFRGG-KK8pkcW1.js} +2 -2
- package/dist/{actions-registery-YnFmU21O.cjs → actions-registery-JdxhXhT6.cjs} +1 -1
- package/dist/{actions-registery-CZ1w0NKa.js → actions-registery-y_ENc8zj.js} +2 -2
- package/dist/actions.cjs +1 -1
- package/dist/actions.js +2 -2
- package/dist/active-in-another-tab-Cu_ASKtx.cjs +1 -0
- package/dist/active-in-another-tab-DkR2HWI4.js +35 -0
- package/dist/add-new-language-page-BXuwluuU.cjs +1 -0
- package/dist/{add-new-language-page-D7NDABl1.js → add-new-language-page-CBY0RR6q.js} +54 -53
- package/dist/{add-new-page-BNfwKjRd.cjs → add-new-page-C_PzKby8.cjs} +1 -1
- package/dist/{add-new-page-B4hc0B-g.js → add-new-page-DJLJFLAd.js} +2 -2
- package/dist/{ai-panel-content-BnbURb7j.js → ai-panel-content--YM01Aly.js} +12 -11
- package/dist/ai-panel-content-rRmJdH7L.cjs +1 -0
- package/dist/{ai-panel-default-lang-oVk4TDeb.js → ai-panel-default-lang-BZl0tPYo.js} +40 -40
- package/dist/{ai-panel-default-lang-3tCHzab5.cjs → ai-panel-default-lang-D2zhXvKP.cjs} +2 -2
- package/dist/{ai-panel-other-lang-DmQ3QMDD.js → ai-panel-other-lang-Bfjk2CYZ.js} +8 -8
- package/dist/{ai-panel-other-lang-BBHCCSen.cjs → ai-panel-other-lang-Y4bEKHoG.cjs} +1 -1
- package/dist/{ai-prompt-input-DaTyfib-.js → ai-prompt-input-DueQYNf-.js} +68 -67
- package/dist/ai-prompt-input-N9PcYCFa.cjs +1 -0
- package/dist/{ai-translation-prompt-DJPe2O-n.js → ai-translation-prompt-B36F3d7K.js} +2 -2
- package/dist/ai-translation-prompt-IAdWMNZb.cjs +1 -0
- package/dist/{apply-binding-6iwlED02.js → apply-binding-BvWfJCSZ.js} +204 -196
- package/dist/apply-binding-IsUf6UWJ.cjs +1 -0
- package/dist/{code-display-BzBq5xSn.js → code-display-Ck81Id9K.js} +1 -1
- package/dist/code-display-DloSPyPr.cjs +1 -0
- package/dist/{code-editor-DWWnphW9.js → code-editor-Bb7JumZy.js} +11 -10
- package/dist/code-editor-DQB8lAOk.cjs +1 -0
- package/dist/{continue-editing-in-this-client-BllU94XG.js → continue-editing-in-this-client-Dm9cCj7K.js} +10 -9
- package/dist/continue-editing-in-this-client-DmGFLHXw.cjs +1 -0
- package/dist/core-Dr7QYemB.js +56 -0
- package/dist/core-Y0lXLwkq.cjs +1 -0
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +3 -3
- package/dist/core.js +41 -39
- package/dist/{css-import-modal-D72a-16X.js → css-import-modal-9P_0uNa4.js} +4 -3
- package/dist/css-import-modal-Rh1QAVxo.cjs +13 -0
- package/dist/{delete-design-token-D_TLlO3I.cjs → delete-design-token-BG8yHcS5.cjs} +1 -1
- package/dist/{delete-design-token-Cd1ZDtqT.js → delete-design-token-COvR4G1S.js} +1 -1
- package/dist/{delete-page-DC8pzvWW.js → delete-page-CNucxe4P.js} +11 -10
- package/dist/delete-page-DAvEjHwF.cjs +1 -0
- package/dist/design-token-usage-CXglXgcJ.cjs +1 -0
- package/dist/{design-token-usage-DE4XCDdn.js → design-token-usage-MNYsFlPG.js} +14 -13
- package/dist/digital-asset-manager-CB5MRBcW.cjs +1 -0
- package/dist/{digital-asset-manager-C_gL_0YY.js → digital-asset-manager-CqCWBO0s.js} +6 -5
- package/dist/{duplicate-page-BoVhko2q.js → duplicate-page-BknLfqr0.js} +19 -18
- package/dist/duplicate-page-DzZByALW.cjs +1 -0
- package/dist/{dynamic-page-selector-CSndg2-y.js → dynamic-page-selector-DoW7OyUB.js} +15 -14
- package/dist/dynamic-page-selector-WA007Sni.cjs +1 -0
- package/dist/get-chai-builder-tailwind-config-BFePCEIS.cjs +1 -0
- package/dist/{get-chai-builder-tailwind-config-DjoVOuAf.js → get-chai-builder-tailwind-config-BXf_xLHk.js} +5 -5
- package/dist/{get-chai-builder-theme-Dl72X7cz.cjs → get-chai-builder-theme-BApShjRz.cjs} +1 -1
- package/dist/{get-chai-builder-theme-BYtp20KD.js → get-chai-builder-theme-DDVRJQ6Z.js} +1 -1
- package/dist/{image-editor-oypq8asR.js → image-editor-CQnNtak2.js} +1 -1
- package/dist/{image-editor-DTspjj_c.cjs → image-editor-CqwaVxO2.cjs} +1 -1
- package/dist/index-C0-pgg_p.cjs +5 -0
- package/dist/index-C99FhuF1.cjs +160 -0
- package/dist/{index-BDnwJqMw.js → index-Dno42B0a.js} +716 -714
- package/dist/{index-S8ibZk9Q.js → index-rAcNbjk_.js} +3744 -3920
- package/dist/{json-diff-viewer-XX1pgabt.cjs → json-diff-viewer-CLuUHiPU.cjs} +3 -3
- package/dist/{json-diff-viewer-B5dr-Y_L.js → json-diff-viewer-CMvGUvJ2.js} +5 -4
- package/dist/{lang-panel-Cn83SRzd.js → lang-panel-CnwTb05j.js} +15 -14
- package/dist/lang-panel-fDCYm5Jm.cjs +1 -0
- package/dist/{manage-design-tokens-lP4HLS0P.js → manage-design-tokens-BsSZE9Vs.js} +12 -11
- package/dist/manage-design-tokens-BvH5KTJX.cjs +1 -0
- package/dist/mark-as-template-CpWEBJGd.cjs +1 -0
- package/dist/{mark-as-template-jncsjfHm.js → mark-as-template-DBLshWb5.js} +17 -16
- package/dist/{nested-path-selector-content-B-8LqhXI.js → nested-path-selector-content-6OBJ8LG8.js} +24 -23
- package/dist/nested-path-selector-content-C2sD9dkq.cjs +1 -0
- package/dist/no-language-page-content-BvPDdccK.cjs +1 -0
- package/dist/{no-language-page-content-D_zd9Rb0.js → no-language-page-content-CzENgtnu.js} +10 -9
- package/dist/{no-language-page-dialog-C5Ps6YYL.js → no-language-page-dialog-CbYI2cVg.js} +2 -2
- package/dist/{no-language-page-dialog-fXmbQO7L.cjs → no-language-page-dialog-CgW4yJBC.cjs} +1 -1
- package/dist/{page-creator-wCMtlE6Z.js → page-creator-Cc83uQqw.js} +113 -112
- package/dist/page-creator-g8GqgcKH.cjs +1 -0
- package/dist/{page-lock-BPCxfv9J.js → page-lock-BJUkyxdh.js} +2 -2
- package/dist/{page-lock-DweiYy1w.cjs → page-lock-CT7SmQqp.cjs} +1 -1
- package/dist/page-locked-dialog-Co5b9XIZ.cjs +1 -0
- package/dist/{page-locked-dialog-ByGl18_m.js → page-locked-dialog-DsEbWRed.js} +18 -15
- package/dist/{page-manager-new-BWFE-S-O.js → page-manager-new-5rFP5DyQ.js} +30 -29
- package/dist/page-manager-new-BOkJImo2.cjs +1 -0
- package/dist/page-manager-search-and-filter-Bfm0j1gg.cjs +1 -0
- package/dist/{page-manager-search-and-filter-kNJFWJ86.js → page-manager-search-and-filter-zq-LfhQ1.js} +13 -12
- package/dist/{page-revisions-content-Ulr8slUN.js → page-revisions-content-D38G2tJM.js} +34 -31
- package/dist/page-revisions-content-ag-MHBGr.cjs +1 -0
- package/dist/pages.cjs +1 -1
- package/dist/pages.d.ts +22 -23
- package/dist/pages.js +12 -12
- package/dist/{plugin-C6rgJDNQ.cjs → plugin-BGlQf0iy.cjs} +1 -1
- package/dist/{plugin-3ZKK6RXm.js → plugin-C-ht41UZ.js} +1 -1
- package/dist/publish-pages-content-BiX-GMLw.cjs +1 -0
- package/dist/{publish-pages-content-BTPzt_m4.js → publish-pages-content-CS7f41Ac.js} +66 -65
- package/dist/register-chai-top-bar-BqwKw4uy.cjs +1 -0
- package/dist/register-chai-top-bar-ESJHs5s-.js +237 -0
- package/dist/render.cjs +2 -2
- package/dist/render.d.ts +2 -2
- package/dist/render.js +87 -80
- package/dist/rte-widget-modal-BKNx2wln.cjs +1 -0
- package/dist/{rte-widget-modal-Rk_NW3KU.js → rte-widget-modal-D6Zik0Ta.js} +15 -14
- package/dist/runtime.cjs +1 -1
- package/dist/runtime.d.ts +168 -4
- package/dist/runtime.js +68 -38
- package/dist/{save-to-lib-BK3uTFss.js → save-to-lib-WwOzbgiF.js} +39 -38
- package/dist/save-to-lib-ffjCZYJ5.cjs +1 -0
- package/dist/sdk.css +1 -1
- package/dist/{selected-block-display-CU3TwIMA.js → selected-block-display-B1SG_UXw.js} +37 -36
- package/dist/selected-block-display-BOgnQRLF.cjs +16 -0
- package/dist/{seo-panel-jbzxFioc.js → seo-panel-BkOgRoWd.js} +12 -11
- package/dist/seo-panel-FjS1UF_y.cjs +2 -0
- package/dist/{shared-json-ld-BL_dv3_q.js → shared-json-ld-uka9TOgA.js} +68 -67
- package/dist/shared-json-ld-yJkXjENy.cjs +1 -0
- package/dist/slug-input-Cyd6NR6J.cjs +1 -0
- package/dist/{slug-input-1qwKkXhA.js → slug-input-DHLmUNrH.js} +9 -8
- package/dist/supabase-actions.cjs +1 -1
- package/dist/supabase-actions.d.ts +1 -1
- package/dist/supabase-actions.js +1 -1
- package/dist/{take-over-request-DKvKi3mM.js → take-over-request-Ca0X-qyf.js} +17 -16
- package/dist/take-over-request-CmpJVe9T.cjs +1 -0
- package/dist/{theme-panel-footer-DbMDLYGI.js → theme-panel-footer-BUXIu252.js} +11 -10
- package/dist/theme-panel-footer-CKO9YYwZ.cjs +1 -0
- package/dist/{translation-warning-modal-9wTwIy_9.js → translation-warning-modal-DrpFeI83.js} +9 -8
- package/dist/translation-warning-modal-pSZVKcNW.cjs +1 -0
- package/dist/{unmark-as-template-Dulvf7Zw.js → unmark-as-template-BMqgelv-.js} +11 -10
- package/dist/unmark-as-template-DF1Ms4VN.cjs +1 -0
- package/dist/unpublish-page-BJ0Bsvt2.js +28 -0
- package/dist/unpublish-page-Bsq2yEqQ.cjs +1 -0
- package/dist/utils.cjs +1 -1
- package/dist/utils.d.ts +4 -1
- package/dist/utils.js +2 -2
- package/dist/web-blocks.cjs +1 -1
- package/dist/web-blocks.js +5 -5
- package/dist/{web-preview-DXE4Jnf5.js → web-preview-D6h1L2nV.js} +2 -2
- package/dist/web-preview-kres0aG7.cjs +1 -0
- package/package.json +4 -2
- package/dist/IconPicker-C9-ieDWm.cjs +0 -1
- package/dist/active-in-another-tab-Clng6zpY.cjs +0 -1
- package/dist/active-in-another-tab-wb8qolB8.js +0 -34
- package/dist/add-new-language-page-C4BuMTaN.cjs +0 -1
- package/dist/ai-panel-content-DPy2jgKw.cjs +0 -1
- package/dist/ai-prompt-input-b5ty81RB.cjs +0 -1
- package/dist/ai-translation-prompt-c0Q3zkT2.cjs +0 -1
- package/dist/apply-binding-KKp5PnpZ.cjs +0 -1
- package/dist/code-display-Q3_sK_Ta.cjs +0 -1
- package/dist/code-editor-BQZi6-FB.cjs +0 -1
- package/dist/continue-editing-in-this-client-D9HyD4GP.cjs +0 -1
- package/dist/core-BoRDjj4h.cjs +0 -1
- package/dist/core-yvI6kCyw.js +0 -56
- package/dist/css-import-modal-BSMGKA2T.cjs +0 -13
- package/dist/delete-page-ByQwBupJ.cjs +0 -1
- package/dist/design-token-usage-BqZeR1sT.cjs +0 -1
- package/dist/digital-asset-manager-BYLKFEYi.cjs +0 -1
- package/dist/duplicate-page-vdvwLQLo.cjs +0 -1
- package/dist/dynamic-page-selector-DdnbCuQZ.cjs +0 -1
- package/dist/get-chai-builder-tailwind-config-B9rCyiQo.cjs +0 -1
- package/dist/index-CbwxUFy_.cjs +0 -5
- package/dist/index-CnSjWE1P.cjs +0 -160
- package/dist/lang-panel-BPxex-M2.cjs +0 -1
- package/dist/manage-design-tokens-ConiyuPr.cjs +0 -1
- package/dist/mark-as-template-DYRxre1f.cjs +0 -1
- package/dist/nested-path-selector-content-BYtLi7mC.cjs +0 -1
- package/dist/no-language-page-content-DAbLq0gX.cjs +0 -1
- package/dist/page-creator-VWIB2VAs.cjs +0 -1
- package/dist/page-locked-dialog-BlbgvaG2.cjs +0 -1
- package/dist/page-manager-new-D0lGfNnS.cjs +0 -1
- package/dist/page-manager-search-and-filter-DpGMoOII.cjs +0 -1
- package/dist/page-revisions-content-DYxXZqmh.cjs +0 -1
- package/dist/publish-pages-content-D6g8GAsd.cjs +0 -1
- package/dist/rte-widget-modal-DrMzWWjw.cjs +0 -1
- package/dist/save-to-lib-DHHUO12i.cjs +0 -1
- package/dist/selected-block-display-DSFhddPj.cjs +0 -16
- package/dist/seo-panel-Dl0IDV09.cjs +0 -2
- package/dist/shared-json-ld-DPNkqDC1.cjs +0 -1
- package/dist/slug-input-YVLjtTI3.cjs +0 -1
- package/dist/take-over-request-DvMIg_cZ.cjs +0 -1
- package/dist/theme-panel-footer-BMOaPLWc.cjs +0 -1
- package/dist/translation-warning-modal-DjTwz75c.cjs +0 -1
- package/dist/unmark-as-template-CdqIJJER.cjs +0 -1
- package/dist/unpublish-page-BwSVBf0_.cjs +0 -1
- package/dist/unpublish-page-Degu5Cy9.js +0 -27
- package/dist/web-preview-YzKxyXft.cjs +0 -1
package/dist/render.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { a as Le, b as De, c as Ke } from "./plugin-
|
|
2
|
-
import { a as O, b as N, c as E, d as J, e as C, f as j } from "./apply-binding-
|
|
3
|
-
import { h as Ae, i as Fe, g as Me } from "./apply-binding-
|
|
1
|
+
import { a as Le, b as De, c as Ke } from "./plugin-C-ht41UZ.js";
|
|
2
|
+
import { a as O, b as N, c as E, d as J, e as C, f as j } from "./apply-binding-BvWfJCSZ.js";
|
|
3
|
+
import { h as Ae, i as Fe, g as Me } from "./apply-binding-BvWfJCSZ.js";
|
|
4
4
|
import { jsx as m } from "react/jsx-runtime";
|
|
5
|
-
import { has as P, isFunction as w, omit as q, get as d, isNull as H, isArray as B, uniqBy as W, filter as $, isEmpty as h, map as U, find as R, cloneDeep as
|
|
6
|
-
import { Suspense as A, createElement as
|
|
7
|
-
import { e as S } from "./core-
|
|
5
|
+
import { has as P, isFunction as w, omit as q, get as d, isNull as H, isArray as B, uniqBy as W, filter as $, isEmpty as h, map as U, find as R, cloneDeep as z } from "lodash-es";
|
|
6
|
+
import { Suspense as A, createElement as g } from "react";
|
|
7
|
+
import { e as S } from "./core-Dr7QYemB.js";
|
|
8
8
|
import { createTailwindcss as X } from "@mhsdesign/jit-browser-tailwindcss";
|
|
9
9
|
import Y from "@tailwindcss/aspect-ratio";
|
|
10
10
|
import Z from "@tailwindcss/container-queries";
|
|
11
11
|
import ee from "@tailwindcss/forms";
|
|
12
12
|
import te from "@tailwindcss/typography";
|
|
13
|
-
import { c as ae, g as re } from "./get-chai-builder-theme-
|
|
13
|
+
import { c as ae, g as re } from "./get-chai-builder-theme-DDVRJQ6Z.js";
|
|
14
14
|
async function ne(e) {
|
|
15
15
|
const t = {
|
|
16
16
|
pageProps: e.pageProps,
|
|
@@ -24,34 +24,35 @@ async function ne(e) {
|
|
|
24
24
|
});
|
|
25
25
|
}
|
|
26
26
|
const ie = () => /* @__PURE__ */ m("div", {}), oe = (e) => {
|
|
27
|
-
const { block: t, lang: r, fallbackLang: i, children: n, externalData:
|
|
28
|
-
N(t, r === i ? "" : r, c),
|
|
29
|
-
|
|
27
|
+
const { block: t, lang: r, fallbackLang: i, children: n, externalData: o, blocks: s, draft: a, pageProps: l, dataProviderMetadataCallback: y } = e, c = S(t._type), u = d(c, "component", null), _ = d(e.repeaterData, "index", -1), k = d(e.repeaterData, "dataKey", ""), f = O(
|
|
28
|
+
N(t, r === i ? "" : r ?? "", c),
|
|
29
|
+
o ?? {},
|
|
30
30
|
{ index: _, key: k }
|
|
31
|
-
),
|
|
31
|
+
), p = E(t, !1), x = V(s, t._id, J(t._type)), L = P(c, "dataProvider") && w(c.dataProvider), b = {
|
|
32
32
|
...f,
|
|
33
|
-
...
|
|
33
|
+
...p,
|
|
34
34
|
...x
|
|
35
35
|
}, v = {
|
|
36
36
|
blockProps: {},
|
|
37
37
|
inBuilder: !1,
|
|
38
|
-
lang: r || i,
|
|
39
|
-
|
|
38
|
+
lang: r || i || "en",
|
|
39
|
+
draft: a ?? !1,
|
|
40
|
+
pageData: o ?? {},
|
|
40
41
|
...b
|
|
41
42
|
}, I = d(b, "_show", !0);
|
|
42
|
-
if (H(
|
|
43
|
+
if (H(u) || !I) return null;
|
|
43
44
|
if (L) {
|
|
44
45
|
const D = d(c, "suspenseFallback", ie);
|
|
45
|
-
return /* @__PURE__ */ m(A, { fallback:
|
|
46
|
+
return /* @__PURE__ */ m(A, { fallback: g(D), children: /* @__PURE__ */ m(
|
|
46
47
|
ne,
|
|
47
48
|
{
|
|
48
|
-
lang: r,
|
|
49
|
+
lang: r ?? "",
|
|
49
50
|
pageProps: l,
|
|
50
51
|
block: b,
|
|
51
52
|
dataProvider: c.dataProvider,
|
|
52
53
|
...y ? { dataProviderMetadataCallback: y } : {},
|
|
53
|
-
draft: a,
|
|
54
|
-
children: (K) => u
|
|
54
|
+
draft: a ?? !1,
|
|
55
|
+
children: (K) => g(u, {
|
|
55
56
|
...v,
|
|
56
57
|
...K,
|
|
57
58
|
children: n({
|
|
@@ -67,7 +68,7 @@ const ie = () => /* @__PURE__ */ m("div", {}), oe = (e) => {
|
|
|
67
68
|
}
|
|
68
69
|
) });
|
|
69
70
|
}
|
|
70
|
-
return /* @__PURE__ */ m(A, { children: u
|
|
71
|
+
return /* @__PURE__ */ m(A, { children: g(u, {
|
|
71
72
|
...v,
|
|
72
73
|
children: n({
|
|
73
74
|
_id: t._id,
|
|
@@ -81,20 +82,20 @@ const ie = () => /* @__PURE__ */ m("div", {}), oe = (e) => {
|
|
|
81
82
|
}) });
|
|
82
83
|
}, F = (e) => {
|
|
83
84
|
const { blocks: t, parent: r, repeaterData: i, type: n } = e;
|
|
84
|
-
let
|
|
85
|
+
let o = W(
|
|
85
86
|
$(t, (a) => P(a, "_id") && (h(r) ? !a._parent : a._parent === r)),
|
|
86
87
|
"_id"
|
|
87
88
|
);
|
|
88
|
-
const
|
|
89
|
-
return (n === "Heading" || n === "Paragraph" || n === "Link" || n === "Span") && (
|
|
89
|
+
const s = (a) => $(t, (l) => l._parent === a).length > 0;
|
|
90
|
+
return (n === "Heading" || n === "Paragraph" || n === "Link" || n === "Span") && (o = j(o)), U(o, (a) => a ? /* @__PURE__ */ g(oe, { ...e, key: a._id, block: a }, ({ _id: l, _type: y, repeaterItems: c, $repeaterItemsKey: u }) => y === "Repeater" ? B(c) && c.map((_, k) => /* @__PURE__ */ g(
|
|
90
91
|
F,
|
|
91
92
|
{
|
|
92
93
|
...e,
|
|
93
94
|
parent: a._id,
|
|
94
95
|
key: `${d(a, "_parent", "root")}-${a._id}-${k}`,
|
|
95
|
-
repeaterData: { index: k, dataKey:
|
|
96
|
+
repeaterData: { index: k, dataKey: u }
|
|
96
97
|
}
|
|
97
|
-
)) :
|
|
98
|
+
)) : s(l) ? /* @__PURE__ */ g(
|
|
98
99
|
F,
|
|
99
100
|
{
|
|
100
101
|
...e,
|
|
@@ -104,14 +105,17 @@ const ie = () => /* @__PURE__ */ m("div", {}), oe = (e) => {
|
|
|
104
105
|
type: a._type
|
|
105
106
|
}
|
|
106
107
|
) : null) : null);
|
|
107
|
-
}, V = (e, t, r) => h(r) ? {} : Object.entries(r).reduce(
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
108
|
+
}, V = (e, t, r) => h(r) ? {} : Object.entries(r).reduce(
|
|
109
|
+
(i, [n, o]) => {
|
|
110
|
+
const s = [];
|
|
111
|
+
let a = R(e, { _id: t });
|
|
112
|
+
for (; a; )
|
|
113
|
+
s.push(a), a = R(e, { _id: a._parent });
|
|
114
|
+
const l = R(s, { _type: o.block });
|
|
115
|
+
return l && (i[n] = d(l, d(o, "prop"), null)), i;
|
|
116
|
+
},
|
|
117
|
+
{}
|
|
118
|
+
);
|
|
115
119
|
function we(e) {
|
|
116
120
|
if (h(e.lang) && !h(e.fallbackLang))
|
|
117
121
|
throw new Error("lang prop is required when fallbackLang is provided");
|
|
@@ -132,85 +136,84 @@ const le = () => /* @__PURE__ */ m("div", {}), de = async (e) => {
|
|
|
132
136
|
lang: r,
|
|
133
137
|
fallbackLang: i,
|
|
134
138
|
children: n,
|
|
135
|
-
externalData:
|
|
136
|
-
blocks:
|
|
139
|
+
externalData: o,
|
|
140
|
+
blocks: s,
|
|
137
141
|
draft: a,
|
|
138
142
|
pageProps: l,
|
|
139
143
|
dataProviderMetadataCallback: y,
|
|
140
144
|
dataProviders: c
|
|
141
|
-
} = e,
|
|
142
|
-
N(t, r === i ? "" : r,
|
|
143
|
-
|
|
145
|
+
} = e, u = S(t._type), _ = d(u, "component", null), k = d(e.repeaterData, "index", -1), M = d(e.repeaterData, "dataKey", ""), p = O(
|
|
146
|
+
N(t, r === i ? "" : r ?? "en", u),
|
|
147
|
+
o ?? {},
|
|
144
148
|
{ index: k, key: M }
|
|
145
|
-
), x = E(t, !1), L = V(
|
|
146
|
-
...
|
|
149
|
+
), x = E(t, !1), L = V(s, t._id, J(t._type)), b = P(u, "dataProvider") && w(u.dataProvider), v = {
|
|
150
|
+
...p,
|
|
147
151
|
...x,
|
|
148
152
|
...L
|
|
149
153
|
}, I = {
|
|
150
154
|
blockProps: {},
|
|
151
155
|
inBuilder: !1,
|
|
152
|
-
lang: r || i,
|
|
153
|
-
|
|
156
|
+
lang: r || i || "en",
|
|
157
|
+
draft: a ?? !1,
|
|
158
|
+
pageData: o ?? {},
|
|
154
159
|
...v
|
|
155
160
|
}, D = d(v, "_show", !0);
|
|
156
161
|
if (H(_) || !D) return null;
|
|
157
162
|
if (b) {
|
|
158
|
-
const K = d(c, t._id, Promise.resolve({})), G = d(
|
|
159
|
-
return /* @__PURE__ */ m(A, { fallback:
|
|
163
|
+
const K = d(c, t._id, Promise.resolve({})), G = d(u, "suspenseFallback", le);
|
|
164
|
+
return /* @__PURE__ */ m(A, { fallback: g(G), children: /* @__PURE__ */ m(
|
|
160
165
|
se,
|
|
161
166
|
{
|
|
162
|
-
lang: r,
|
|
167
|
+
lang: r ?? "",
|
|
163
168
|
pageProps: l,
|
|
164
169
|
block: v,
|
|
165
170
|
dataProvider: K,
|
|
166
171
|
...y ? { dataProviderMetadataCallback: y } : {},
|
|
167
|
-
draft: a,
|
|
168
|
-
children: (
|
|
172
|
+
draft: a ?? !1,
|
|
173
|
+
children: (Q) => g(_, {
|
|
169
174
|
...I,
|
|
170
|
-
|
|
171
|
-
...z,
|
|
175
|
+
...Q,
|
|
172
176
|
children: n({
|
|
173
177
|
_id: t._id,
|
|
174
178
|
_type: t._type,
|
|
175
|
-
...B(
|
|
176
|
-
repeaterItems: C(
|
|
177
|
-
$repeaterItemsKey:
|
|
178
|
-
repeaterTotalItems:
|
|
179
|
+
...B(p.repeaterItems) ? {
|
|
180
|
+
repeaterItems: C(p.repeaterItems, t),
|
|
181
|
+
$repeaterItemsKey: p.$repeaterItemsKey,
|
|
182
|
+
repeaterTotalItems: p.repeaterTotalItems ?? -1
|
|
179
183
|
} : {}
|
|
180
184
|
})
|
|
181
185
|
})
|
|
182
186
|
}
|
|
183
187
|
) });
|
|
184
188
|
}
|
|
185
|
-
return
|
|
189
|
+
return g(_, {
|
|
186
190
|
...I,
|
|
187
|
-
draft: a,
|
|
188
191
|
children: n({
|
|
189
192
|
_id: t._id,
|
|
190
193
|
_type: t._type,
|
|
191
|
-
...B(
|
|
192
|
-
repeaterItems: C(
|
|
193
|
-
$repeaterItemsKey:
|
|
194
|
-
repeaterTotalItems:
|
|
194
|
+
...B(p.repeaterItems) ? {
|
|
195
|
+
repeaterItems: C(p.repeaterItems, t),
|
|
196
|
+
$repeaterItemsKey: p.$repeaterItemsKey,
|
|
197
|
+
repeaterTotalItems: p.repeaterTotalItems ?? -1
|
|
195
198
|
} : {}
|
|
196
199
|
})
|
|
197
200
|
});
|
|
198
201
|
}, T = async (e) => {
|
|
199
202
|
const { blocks: t, parent: r, repeaterData: i, type: n } = e;
|
|
200
|
-
let
|
|
203
|
+
let o = W(
|
|
201
204
|
$(t, (a) => P(a, "_id") && (h(r) ? !a._parent : a._parent === r)),
|
|
202
205
|
"_id"
|
|
203
206
|
);
|
|
204
|
-
const
|
|
205
|
-
return
|
|
207
|
+
const s = (a) => $(t, (l) => l._parent === a).length > 0;
|
|
208
|
+
return (n === "Heading" || n === "Paragraph" || n === "Link") && (o = j(o)), U(o, (a) => a ? /* @__PURE__ */ g(de, { ...e, dataProviders: e.dataProviders, key: a._id, block: a }, ({ _id: l, _type: y, repeaterItems: c, $repeaterItemsKey: u }) => y === "Repeater" ? B(c) && c.map((_, k) => /* @__PURE__ */ g(
|
|
206
209
|
T,
|
|
207
210
|
{
|
|
208
211
|
...e,
|
|
209
212
|
parent: a._id,
|
|
210
213
|
key: `${d(a, "_parent", "root")}-${a._id}-${k}`,
|
|
211
|
-
repeaterData: { index: k, dataKey:
|
|
214
|
+
repeaterData: { index: k, dataKey: u }
|
|
212
215
|
}
|
|
213
|
-
)) :
|
|
216
|
+
)) : s(l) ? /* @__PURE__ */ g(
|
|
214
217
|
T,
|
|
215
218
|
{
|
|
216
219
|
...e,
|
|
@@ -229,19 +232,22 @@ async function Ie(e) {
|
|
|
229
232
|
const t = e.lang ?? "en", r = e.fallbackLang ?? t;
|
|
230
233
|
if (e.dataProviders)
|
|
231
234
|
return /* @__PURE__ */ m(T, { ...e, lang: t, fallbackLang: r, dataProviders: e.dataProviders });
|
|
232
|
-
const n = e.blocks.filter((
|
|
233
|
-
const
|
|
234
|
-
return !!(P(
|
|
235
|
+
const n = e.blocks.filter((o) => {
|
|
236
|
+
const s = S(o._type);
|
|
237
|
+
return !!(P(s, "dataProvider") && w(s.dataProvider));
|
|
235
238
|
}).reduce(
|
|
236
|
-
(
|
|
237
|
-
const a = S(
|
|
239
|
+
(o, s) => {
|
|
240
|
+
const a = S(s._type);
|
|
241
|
+
if (!a || !a.dataProvider)
|
|
242
|
+
return o;
|
|
243
|
+
const l = {
|
|
238
244
|
pageProps: e.pageProps,
|
|
239
|
-
block:
|
|
245
|
+
block: s,
|
|
240
246
|
lang: e.lang,
|
|
241
247
|
draft: e.draft,
|
|
242
248
|
inBuilder: !1
|
|
243
249
|
};
|
|
244
|
-
return s
|
|
250
|
+
return o[s._id] = a.dataProvider(l), o;
|
|
245
251
|
},
|
|
246
252
|
{}
|
|
247
253
|
);
|
|
@@ -250,12 +256,12 @@ async function Ie(e) {
|
|
|
250
256
|
function Ce(e, t) {
|
|
251
257
|
const r = e.filter((i) => i._type === "GlobalBlock" || i._type === "PartialBlock");
|
|
252
258
|
for (let i = 0; i < r.length; i++) {
|
|
253
|
-
const n = r[i],
|
|
254
|
-
if (
|
|
255
|
-
let
|
|
256
|
-
n._parent && (
|
|
259
|
+
const n = r[i], o = d(n, "partialBlockId", d(n, "globalBlock", ""));
|
|
260
|
+
if (o === "") continue;
|
|
261
|
+
let s = z(d(t, o, []));
|
|
262
|
+
n._parent && (s == null ? void 0 : s.length) > 0 && (s = s.map((l) => (h(l._parent) && (l._parent = n._parent), l)));
|
|
257
263
|
const a = e.indexOf(n);
|
|
258
|
-
e.splice(a, 1, ...
|
|
264
|
+
e.splice(a, 1, ...s);
|
|
259
265
|
}
|
|
260
266
|
return e;
|
|
261
267
|
}
|
|
@@ -274,12 +280,13 @@ function ce(e) {
|
|
|
274
280
|
return n !== -1 ? i.substring(n + 6) : i;
|
|
275
281
|
});
|
|
276
282
|
}
|
|
277
|
-
async function
|
|
283
|
+
async function ue(e, t = [], r = !1) {
|
|
278
284
|
return await X({
|
|
279
285
|
tailwindConfig: {
|
|
280
286
|
darkMode: "class",
|
|
281
287
|
safelist: t,
|
|
282
288
|
theme: {
|
|
289
|
+
// @ts-ignore
|
|
283
290
|
extend: {
|
|
284
291
|
...re(),
|
|
285
292
|
keyframes: {
|
|
@@ -316,10 +323,10 @@ async function pe(e, t = [], r = !1) {
|
|
|
316
323
|
e
|
|
317
324
|
);
|
|
318
325
|
}
|
|
319
|
-
const
|
|
326
|
+
const ge = (e, t) => {
|
|
320
327
|
const r = JSON.stringify(e).replace(/#styles:([^"]*)/g, (i, n) => `#styles:${n.replace(/,/g, " ")}`.replace(/#styles:/g, ""));
|
|
321
|
-
return
|
|
322
|
-
}, Se = async (e, t = !1) => await
|
|
328
|
+
return ue([r], [], t);
|
|
329
|
+
}, Se = async (e, t = !1) => await ge(e, t);
|
|
323
330
|
export {
|
|
324
331
|
Ie as AsyncRenderChaiBlocks,
|
|
325
332
|
we as RenderChaiBlocks,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),p=require("./register-chai-top-bar-BqwKw4uy.cjs"),s=require("./index-C99FhuF1.cjs"),S=({isOpen:m,onClose:r,editor:t,rteElement:f})=>{const a=s.usePageExternalData(),u=o=>{if(!t)return;const i=`{{${o}}}`;t.commands.focus();const{from:j,to:g}=t.state.selection;if(j!==g)t.chain().deleteSelection().insertContent(i).run();else{const{state:c}=t,n=c.selection.from,x=c.doc.textBetween(Math.max(0,n-1),n),l=c.doc.textBetween(n,Math.min(n+1,c.doc.content.size));let d="";n>0&&x!==" "&&!/[.,!?;:]/.test(x)&&(d=" ");let h="";l&&l!==" "&&!/[.,!?;:]/.test(l)&&(h=" "),t.chain().insertContent(d+i+h).run()}};return e.jsx(s.Dialog,{open:m,onOpenChange:o=>!o&&r(),children:e.jsxs(s.DialogContent,{className:"max-h-[90vh] overflow-y-auto sm:max-w-[800px]",children:[e.jsx(s.DialogHeader,{children:e.jsxs(s.DialogTitle,{className:"flex items-center justify-between pr-8",children:[e.jsx("span",{children:"Rich Text Editor"}),a&&Object.keys(a).length>0&&e.jsxs("div",{className:"flex items-center",children:[e.jsx("span",{className:"mr-2 text-sm text-muted-foreground",children:"Add field:"}),e.jsx("div",{className:"rte-path-selector",children:e.jsx(s.NestedPathSelector,{data:a,onSelect:u})})]})]})}),f,e.jsx("div",{className:"mt-4 flex justify-end",children:e.jsx(p.Button,{onClick:r,children:"Done"})})]})})};exports.default=S;
|
|
@@ -1,38 +1,39 @@
|
|
|
1
1
|
import { jsx as e, jsxs as l } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import { B as D } from "./register-chai-top-bar-ESJHs5s-.js";
|
|
3
|
+
import { g as N, D as S, d as j, e as v, f as w, N as B } from "./index-rAcNbjk_.js";
|
|
4
|
+
const M = ({
|
|
4
5
|
isOpen: f,
|
|
5
|
-
onClose:
|
|
6
|
+
onClose: r,
|
|
6
7
|
editor: t,
|
|
7
8
|
rteElement: x
|
|
8
9
|
}) => {
|
|
9
|
-
const a =
|
|
10
|
+
const a = N(), u = (c) => {
|
|
10
11
|
if (!t) return;
|
|
11
|
-
const
|
|
12
|
+
const i = `{{${c}}}`;
|
|
12
13
|
t.commands.focus();
|
|
13
14
|
const { from: p, to: g } = t.state.selection;
|
|
14
15
|
if (p !== g)
|
|
15
|
-
t.chain().deleteSelection().insertContent(
|
|
16
|
+
t.chain().deleteSelection().insertContent(i).run();
|
|
16
17
|
else {
|
|
17
18
|
const { state: s } = t, n = s.selection.from, d = s.doc.textBetween(Math.max(0, n - 1), n), o = s.doc.textBetween(n, Math.min(n + 1, s.doc.content.size));
|
|
18
|
-
let h = "";
|
|
19
|
-
n > 0 && d !== " " && !/[.,!?;:]/.test(d) && (h = " ");
|
|
20
19
|
let m = "";
|
|
21
|
-
|
|
20
|
+
n > 0 && d !== " " && !/[.,!?;:]/.test(d) && (m = " ");
|
|
21
|
+
let h = "";
|
|
22
|
+
o && o !== " " && !/[.,!?;:]/.test(o) && (h = " "), t.chain().insertContent(m + i + h).run();
|
|
22
23
|
}
|
|
23
24
|
};
|
|
24
|
-
return /* @__PURE__ */ e(
|
|
25
|
-
/* @__PURE__ */ e(
|
|
25
|
+
return /* @__PURE__ */ e(S, { open: f, onOpenChange: (c) => !c && r(), children: /* @__PURE__ */ l(j, { className: "max-h-[90vh] overflow-y-auto sm:max-w-[800px]", children: [
|
|
26
|
+
/* @__PURE__ */ e(v, { children: /* @__PURE__ */ l(w, { className: "flex items-center justify-between pr-8", children: [
|
|
26
27
|
/* @__PURE__ */ e("span", { children: "Rich Text Editor" }),
|
|
27
28
|
a && Object.keys(a).length > 0 && /* @__PURE__ */ l("div", { className: "flex items-center", children: [
|
|
28
29
|
/* @__PURE__ */ e("span", { className: "mr-2 text-sm text-muted-foreground", children: "Add field:" }),
|
|
29
|
-
/* @__PURE__ */ e("div", { className: "rte-path-selector", children: /* @__PURE__ */ e(
|
|
30
|
+
/* @__PURE__ */ e("div", { className: "rte-path-selector", children: /* @__PURE__ */ e(B, { data: a, onSelect: u }) })
|
|
30
31
|
] })
|
|
31
32
|
] }) }),
|
|
32
33
|
x,
|
|
33
|
-
/* @__PURE__ */ e("div", { className: "mt-4 flex justify-end", children: /* @__PURE__ */ e(
|
|
34
|
+
/* @__PURE__ */ e("div", { className: "mt-4 flex justify-end", children: /* @__PURE__ */ e(D, { onClick: r, children: "Done" }) })
|
|
34
35
|
] }) });
|
|
35
36
|
};
|
|
36
37
|
export {
|
|
37
|
-
|
|
38
|
+
M as default
|
|
38
39
|
};
|
package/dist/runtime.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index-B-rSiAp_.cjs"),e=require("./register-chai-top-bar-BqwKw4uy.cjs"),t=require("./register-partial-type-ig9fUWIJ.cjs"),i=require("./fonts-B-Xt29pe.cjs"),r=require("./core-Y0lXLwkq.cjs"),o=r.setChaiServerBlockDataProvider;exports.StylesProp=a.StylesProp;exports.builderProp=a.builderProp;exports.defaultChaiStyles=a.defaultChaiStyles;exports.registerChaiBlockSchema=a.registerChaiBlockSchema;exports.runtimeProp=a.runtimeProp;exports.stylesProp=a.stylesProp;exports.ADD_BLOCK_TABS=e.ADD_BLOCK_TABS;exports.CHAI_BUILDER_PANELS=e.CHAI_BUILDER_PANELS;exports.IfChaiFeatureFlag=e.IfChaiFeatureFlag;exports.RJSF_EXTENSIONS=e.RJSF_EXTENSIONS;exports.getChaiLibrary=e.getChaiLibrary;exports.getPreImportHTML=e.getPreImportHTML;exports.registerBlockSettingField=e.registerBlockSettingField;exports.registerBlockSettingTemplate=e.registerBlockSettingTemplate;exports.registerBlockSettingWidget=e.registerBlockSettingWidget;exports.registerChaiAddBlockTab=e.registerChaiAddBlockTab;exports.registerChaiFeatureFlag=e.registerChaiFeatureFlag;exports.registerChaiFeatureFlags=e.registerChaiFeatureFlags;exports.registerChaiLibrary=e.registerChaiLibrary;exports.registerChaiMediaManager=e.registerChaiMediaManager;exports.registerChaiPreImportHTMLHook=e.registerChaiPreImportHTMLHook;exports.registerChaiSaveToLibrary=e.registerChaiSaveToLibrary;exports.registerChaiSidebarPanel=e.registerChaiSidebarPanel;exports.registerChaiTopBar=e.registerChaiTopBar;exports.resetSaveToLibrary=e.resetSaveToLibrary;exports.useBlockSettingComponents=e.useBlockSettingComponents;exports.useChaiAddBlockTabs=e.useChaiAddBlockTabs;exports.useChaiFeatureFlag=e.useChaiFeatureFlag;exports.useChaiFeatureFlags=e.useChaiFeatureFlags;exports.useChaiLibraries=e.useChaiLibraries;exports.useChaiSidebarPanels=e.useChaiSidebarPanels;exports.useMediaManagerComponent=e.useMediaManagerComponent;exports.useSaveToLibraryComponent=e.useSaveToLibraryComponent;exports.useToggleChaiFeatureFlag=e.useToggleChaiFeatureFlag;exports.useTopBarComponent=e.useTopBarComponent;Object.defineProperty(exports,"CHAI_GLOBAL_DATA_PROVIDER",{enumerable:!0,get:()=>t.CHAI_GLOBAL_DATA_PROVIDER});exports.COLLECTIONS=t.COLLECTIONS;exports.PAGE_TYPES=t.PAGE_TYPES;exports.getChaiCollection=t.getChaiCollection;exports.getChaiCollections=t.getChaiCollections;exports.getChaiGlobalData=t.getChaiGlobalData;exports.getChaiPageType=t.getChaiPageType;exports.getChaiPageTypes=t.getChaiPageTypes;exports.registerChaiCollection=t.registerChaiCollection;exports.registerChaiGlobalDataProvider=t.registerChaiGlobalDataProvider;exports.registerChaiPageType=t.registerChaiPageType;exports.registerChaiPartialType=t.registerChaiPartialType;exports.getAllRegisteredFonts=i.getAllRegisteredFonts;exports.getRegisteredFont=i.getRegisteredFont;exports.registerChaiFont=i.registerChaiFont;exports.useRegisteredFonts=i.useRegisteredFonts;exports.closestBlockProp=r.closestBlockProp;exports.getAIBlockProps=r.getAIBlockProps;exports.getBlockFormSchemas=r.getBlockFormSchemas;exports.getDefaultBlockProps=r.getDefaultBlockProps;exports.getI18nBlockProps=r.getI18nBlockProps;exports.getRegisteredChaiBlock=r.getRegisteredChaiBlock;exports.registerChaiBlock=r.registerChaiBlock;exports.registerChaiServerBlock=r.registerChaiServerBlock;exports.setChaiBlockComponent=r.setChaiBlockComponent;exports.setChaiServerBlockDataProvider=r.setChaiServerBlockDataProvider;exports.syncBlocksWithDefaults=r.syncBlocksWithDefaults;exports.useRegisteredChaiBlock=r.useRegisteredChaiBlock;exports.useRegisteredChaiBlocks=r.useRegisteredChaiBlocks;exports.setChaiBlockDataProvider=o;
|