@chaibuilder/sdk 3.2.5 → 3.2.7
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/apply-binding-DWIWrG2P.cjs +1 -0
- package/dist/{apply-binding-B11pPFEE.js → apply-binding-IFVE37dG.js} +221 -217
- package/dist/{code-editor-Dnh6rQUv.js → code-editor-Bbeel8oa.js} +1 -1
- package/dist/{code-editor-DZUtFaVp.cjs → code-editor-CWO-tegZ.cjs} +1 -1
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +2 -0
- package/dist/core.js +82 -81
- package/dist/index-BVbLLob7.cjs +160 -0
- package/dist/index-H6m-0wVZ.js +18661 -0
- package/dist/render.cjs +1 -1
- package/dist/render.d.ts +1 -1
- package/dist/render.js +36 -34
- package/dist/{rte-widget-modal-OhTwfpvx.cjs → rte-widget-modal-3yhyrVpY.cjs} +1 -1
- package/dist/{rte-widget-modal-BGHSjMUE.js → rte-widget-modal-DbOJAIEv.js} +1 -1
- package/package.json +15 -14
- package/dist/apply-binding-DOJpwjiG.cjs +0 -1
- package/dist/index-BNkSb0bl.js +0 -12993
- package/dist/index-WOKO7fh-.cjs +0 -154
package/dist/render.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("./plugin-CSgw-f78.cjs"),d=require("./apply-binding-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("./plugin-CSgw-f78.cjs"),d=require("./apply-binding-DWIWrG2P.cjs"),m=require("react/jsx-runtime"),b=require("@chaibuilder/runtime"),t=require("lodash-es"),g=require("react"),A=require("@tailwindcss/aspect-ratio"),F=require("@tailwindcss/forms"),q=require("@tailwindcss/typography");require("tailwindcss-animate");const j=require("./get-chai-builder-theme-B1tr_NJB.cjs"),K=require("@mhsdesign/jit-browser-tailwindcss"),M=require("@tailwindcss/container-queries");async function O(e){const a={pageProps:e.pageProps,block:e.block,lang:e.lang,draft:e.draft,inBuilder:!1},n=await e.dataProvider(a);return t.has(n,"$metadata")&&t.isFunction(e.dataProviderMetadataCallback)&&e.dataProviderMetadataCallback(e.block,n.$metadata),e.children({...t.omit(n,"$metadata")})}const N=()=>m.jsx("div",{}),H=e=>{const{block:a,lang:n,fallbackLang:s,children:i,externalData:l,blocks:o,draft:r,pageProps:c,dataProviderMetadataCallback:k}=e,u=b.getRegisteredChaiBlock(a._type),p=t.get(u,"component",null),P=t.get(e.repeaterData,"index",-1),f=t.get(e.repeaterData,"dataKey",""),I=n===s?"":n,y=d.applyBindingToBlockProps(d.applyLanguage(a,I,u),l,{index:P,key:f}),h=d.getBlockTagAttributes(a,!1),T=L(o,a._id,d.getBlockRuntimeProps(a._type)),S=t.has(u,"dataProvider")&&t.isFunction(u.dataProvider),B={...y,...h,...T},_={blockProps:{},inBuilder:!1,lang:n||s,pageData:l,...B},v=t.get(B,"_show",!0);if(t.isNull(p)||!v)return null;if(S){const $=t.get(u,"suspenseFallback",N);return m.jsx(g.Suspense,{fallback:g.createElement($),children:m.jsx(O,{lang:n,pageProps:c,block:B,dataProvider:u.dataProvider,...k?{dataProviderMetadataCallback:k}:{},draft:r,children:x=>g.createElement(p,{..._,...x,children:i({_id:a._id,_type:a._type,...t.isArray(y.repeaterItems)?{repeaterItems:d.applyLimit(y.repeaterItems,a),$repeaterItemsKey:y.$repeaterItemsKey,repeaterTotalItems:y.repeaterTotalItems??-1}:{}})})})})}return m.jsx(g.Suspense,{children:g.createElement(p,{..._,children:i({_id:a._id,_type:a._type,...t.isArray(y.repeaterItems)?{repeaterItems:d.applyLimit(y.repeaterItems,a),$repeaterItemsKey:y.$repeaterItemsKey,repeaterTotalItems:y.repeaterTotalItems??-1}:{}})})})},E=e=>{const{blocks:a,parent:n,repeaterData:s,type:i}=e;let l=t.uniqBy(t.filter(a,r=>t.has(r,"_id")&&(t.isEmpty(n)?!r._parent:r._parent===n)),"_id");const o=r=>t.filter(a,c=>c._parent===r).length>0;return(i==="Heading"||i==="Paragraph"||i==="Link"||i==="Span")&&(l=d.adjustSpacingInContentBlocks(l)),t.map(l,r=>r?g.createElement(H,{...e,key:r._id,block:r},({_id:c,_type:k,repeaterItems:u,$repeaterItemsKey:p})=>k==="Repeater"?t.isArray(u)&&u.map((P,f)=>g.createElement(E,{...e,parent:r._id,key:`${t.get(r,"_parent","root")}-${r._id}-${f}`,repeaterData:{index:f,dataKey:p}})):o(c)?g.createElement(E,{...e,parent:r._id,key:`${t.get(r,"_parent","root")}-${r._id}`,repeaterData:s,type:r._type}):null):null)},L=(e,a,n)=>t.isEmpty(n)?{}:Object.entries(n).reduce((s,[i,l])=>{const o=[];let r=t.find(e,{_id:a});for(;r;)o.push(r),r=t.find(e,{_id:r._parent});const c=t.find(o,{_type:l.block});return c&&(s[i]=t.get(c,t.get(l,"prop"),null)),s},{});function J(e){if(t.isEmpty(e.lang)&&!t.isEmpty(e.fallbackLang))throw new Error("lang prop is required when fallbackLang is provided");if(t.isEmpty(e.blocks))return null;const a=e.lang??"en",n=e.fallbackLang??a;return m.jsx(E,{...e,lang:a,fallbackLang:n})}async function V(e){const a=await e.dataProvider;return t.has(a,"$metadata")&&t.isFunction(e.dataProviderMetadataCallback)&&e.dataProviderMetadataCallback(e.block,a.$metadata),e.children({...t.omit(a,"$metadata")})}const W=()=>m.jsx("div",{}),U=async e=>{const{block:a,lang:n,fallbackLang:s,children:i,externalData:l,blocks:o,draft:r,pageProps:c,dataProviderMetadataCallback:k,dataProviders:u}=e,p=b.getRegisteredChaiBlock(a._type),P=t.get(p,"component",null),f=t.get(e.repeaterData,"index",-1),I=t.get(e.repeaterData,"dataKey",""),y=n===s?"":n,h=d.applyBindingToBlockProps(d.applyLanguage(a,y,p),l,{index:f,key:I}),T=d.getBlockTagAttributes(a,!1),S=L(o,a._id,d.getBlockRuntimeProps(a._type)),B=t.has(p,"dataProvider")&&t.isFunction(p.dataProvider),_={...h,...T,...S},v={blockProps:{},inBuilder:!1,lang:n||s,pageData:l,..._},$=t.get(_,"_show",!0);if(t.isNull(P)||!$)return null;if(B){const x=t.get(u,a._id,Promise.resolve({})),D=t.get(p,"suspenseFallback",W);return m.jsx(g.Suspense,{fallback:g.createElement(D),children:m.jsx(V,{lang:n,pageProps:c,block:_,dataProvider:x,...k?{dataProviderMetadataCallback:k}:{},draft:r,children:R=>g.createElement(P,{...v,draft:r,...R,children:i({_id:a._id,_type:a._type,...t.isArray(h.repeaterItems)?{repeaterItems:d.applyLimit(h.repeaterItems,a),$repeaterItemsKey:h.$repeaterItemsKey,repeaterTotalItems:h.repeaterTotalItems??-1}:{}})})})})}return g.createElement(P,{...v,draft:r,children:i({_id:a._id,_type:a._type,...t.isArray(h.repeaterItems)?{repeaterItems:d.applyLimit(h.repeaterItems,a),$repeaterItemsKey:h.$repeaterItemsKey,repeaterTotalItems:h.repeaterTotalItems??-1}:{}})})},C=async e=>{const{blocks:a,parent:n,repeaterData:s,type:i}=e;let l=t.uniqBy(t.filter(a,r=>t.has(r,"_id")&&(t.isEmpty(n)?!r._parent:r._parent===n)),"_id");const o=r=>t.filter(a,c=>c._parent===r).length>0;return(i==="Heading"||i==="Paragraph"||i==="Link")&&(l=d.adjustSpacingInContentBlocks(l)),t.map(l,r=>r?g.createElement(U,{dataProviders:e.dataProviders,...e,key:r._id,block:r},({_id:c,_type:k,repeaterItems:u,$repeaterItemsKey:p})=>k==="Repeater"?t.isArray(u)&&u.map((P,f)=>g.createElement(C,{...e,parent:r._id,key:`${t.get(r,"_parent","root")}-${r._id}-${f}`,repeaterData:{index:f,dataKey:p}})):o(c)?g.createElement(C,{...e,parent:r._id,key:`${t.get(r,"_parent","root")}-${r._id}`,repeaterData:s,type:r._type}):null):null)};async function G(e){if(t.isEmpty(e.lang)&&!t.isEmpty(e.fallbackLang))throw new Error("lang prop is required when fallbackLang is provided");if(t.isEmpty(e.blocks))return null;const a=e.lang??"en",n=e.fallbackLang??a;if(e.dataProviders)return m.jsx(C,{...e,lang:a,fallbackLang:n,dataProviders:e.dataProviders});const i=e.blocks.filter(l=>{const o=b.getRegisteredChaiBlock(l._type);return!!(t.has(o,"dataProvider")&&t.isFunction(o.dataProvider))}).reduce((l,o)=>{const r=b.getRegisteredChaiBlock(o._type),c={pageProps:e.pageProps,block:o,lang:e.lang,draft:e.draft,inBuilder:!1};return l[o._id]=r.dataProvider(c),l},{});return m.jsx(C,{...e,lang:a,fallbackLang:n,dataProviders:i})}function z(e,a){const n=e.filter(({_type:s})=>s==="GlobalBlock"||s==="PartialBlock");for(let s=0;s<n.length;s++){const i=n[s],l=t.get(i,"partialBlockId",t.get(i,"globalBlock",""));if(l==="")continue;let o=t.cloneDeep(t.get(a,l,[]));i._parent&&(o==null?void 0:o.length)>0&&(o=o.map(c=>(t.isEmpty(c._parent)&&(c._parent=i._parent),c)));const r=e.indexOf(i);e.splice(r,1,...o)}return e}const Q=e=>{if(!e)return[];try{return JSON.parse(X(e)).filter(n=>!n._type.startsWith("@chai"))}catch{return[{_type:"Paragraph",_id:"error",content:"Invalid JSON. Please check the JSON string."}]}};function X(e){const a=/(asset:\/\/|https:\/\/asset\.localhost\/)(?:localhost\/)?[^"']+/g;return e.replace(a,n=>{const s=decodeURIComponent(n),i=s.indexOf("public");return i!==-1?s.substring(i+6):s})}async function Y(e,a=[],n=!1){return await K.createTailwindcss({tailwindConfig:{darkMode:"class",safelist:a,theme:{extend:{...j.getChaiBuilderTheme(),keyframes:{"accordion-down":{from:{height:"0"},to:{height:"var(--radix-accordion-content-height)"}},"accordion-up":{from:{height:"var(--radix-accordion-content-height)"},to:{height:"0"}}},animation:{"accordion-down":"accordion-down 0.2s ease-out","accordion-up":"accordion-up 0.2s ease-out"}}},plugins:[F,q,A,M,w.chaiBuilderPlugin],corePlugins:{preflight:n}}}).generateStylesFromContent(` ${n?"@tailwind base;":""}
|
|
2
2
|
@tailwind components;
|
|
3
3
|
@tailwind utilities;`,e)}const Z=(e,a)=>{const n=JSON.stringify(e).replace(/#styles:([^"]*)/g,(s,i)=>`#styles:${i.replace(/,/g," ")}`.replace(/#styles:/g,""));return Y([n],[],a)},ee=async(e,a=!1)=>await Z(e,a);exports.getChaiThemeCssVariables=w.getChaiThemeCssVariables;exports.getThemeFontsCSSImport=w.getThemeFontsCSSImport;exports.getThemeFontsLinkMarkup=w.getThemeFontsLinkMarkup;exports.applyChaiDataBinding=d.applyChaiDataBinding;exports.applyDesignTokens=d.applyDesignTokens;exports.convertHTMLToChaiBlocks=d.getBlocksFromHTML;exports.AsyncRenderChaiBlocks=G;exports.RenderChaiBlocks=J;exports.convertToBlocks=Q;exports.getMergedPartialBlocks=z;exports.getStylesForBlocks=ee;
|
package/dist/render.d.ts
CHANGED
|
@@ -104,7 +104,7 @@ declare type RenderChaiBlocksProps = {
|
|
|
104
104
|
declare type RenderChaiBlocksProps_2 = {
|
|
105
105
|
blocks: ChaiBlock[];
|
|
106
106
|
parent?: string;
|
|
107
|
-
externalData?: Record<string,
|
|
107
|
+
externalData?: Record<string, unknown>;
|
|
108
108
|
lang?: string;
|
|
109
109
|
fallbackLang?: string;
|
|
110
110
|
pageProps?: ChaiPageProps;
|
package/dist/render.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { c as Q } from "./plugin-BOcGV_IY.js";
|
|
2
2
|
import { a as Ke, b as Re, e as Ae } from "./plugin-BOcGV_IY.js";
|
|
3
|
-
import { a as O, b as N, g as E, c as J, d as C, e as j } from "./apply-binding-
|
|
4
|
-
import { f as Me, i as Oe, h as Ne } from "./apply-binding-
|
|
3
|
+
import { a as O, b as N, g as E, c as J, d as C, e as j } from "./apply-binding-IFVE37dG.js";
|
|
4
|
+
import { f as Me, i as Oe, h as Ne } from "./apply-binding-IFVE37dG.js";
|
|
5
5
|
import { jsx as m } from "react/jsx-runtime";
|
|
6
6
|
import { getRegisteredChaiBlock as $ } from "@chaibuilder/runtime";
|
|
7
7
|
import { has as P, isFunction as w, omit as q, get as d, isNull as H, isArray as b, uniqBy as W, filter as S, isEmpty as h, map as U, find as R, cloneDeep as X } from "lodash-es";
|
|
@@ -26,11 +26,11 @@ async function ne(e) {
|
|
|
26
26
|
});
|
|
27
27
|
}
|
|
28
28
|
const ie = () => /* @__PURE__ */ m("div", {}), oe = (e) => {
|
|
29
|
-
const { block: t, lang: r, fallbackLang: i, children: n, externalData:
|
|
29
|
+
const { block: t, lang: r, fallbackLang: i, children: n, externalData: o, blocks: s, draft: a, pageProps: l, dataProviderMetadataCallback: k } = e, c = $(t._type), u = d(c, "component", null), _ = d(e.repeaterData, "index", -1), y = d(e.repeaterData, "dataKey", ""), f = O(
|
|
30
30
|
N(t, r === i ? "" : r, c),
|
|
31
|
-
|
|
31
|
+
o,
|
|
32
32
|
{ index: _, key: y }
|
|
33
|
-
), g = E(t, !1), x = V(
|
|
33
|
+
), g = E(t, !1), x = V(s, t._id, J(t._type)), L = P(c, "dataProvider") && w(c.dataProvider), B = {
|
|
34
34
|
...f,
|
|
35
35
|
...g,
|
|
36
36
|
...x
|
|
@@ -38,6 +38,7 @@ const ie = () => /* @__PURE__ */ m("div", {}), oe = (e) => {
|
|
|
38
38
|
blockProps: {},
|
|
39
39
|
inBuilder: !1,
|
|
40
40
|
lang: r || i,
|
|
41
|
+
pageData: o,
|
|
41
42
|
...B
|
|
42
43
|
}, I = d(B, "_show", !0);
|
|
43
44
|
if (H(u) || !I) return null;
|
|
@@ -82,12 +83,12 @@ const ie = () => /* @__PURE__ */ m("div", {}), oe = (e) => {
|
|
|
82
83
|
}) });
|
|
83
84
|
}, F = (e) => {
|
|
84
85
|
const { blocks: t, parent: r, repeaterData: i, type: n } = e;
|
|
85
|
-
let
|
|
86
|
+
let o = W(
|
|
86
87
|
S(t, (a) => P(a, "_id") && (h(r) ? !a._parent : a._parent === r)),
|
|
87
88
|
"_id"
|
|
88
89
|
);
|
|
89
|
-
const
|
|
90
|
-
return (n === "Heading" || n === "Paragraph" || n === "Link" || n === "Span") && (
|
|
90
|
+
const s = (a) => S(t, (l) => l._parent === a).length > 0;
|
|
91
|
+
return (n === "Heading" || n === "Paragraph" || n === "Link" || n === "Span") && (o = j(o)), U(o, (a) => a ? /* @__PURE__ */ p(oe, { ...e, key: a._id, block: a }, ({ _id: l, _type: k, repeaterItems: c, $repeaterItemsKey: u }) => k === "Repeater" ? b(c) && c.map((_, y) => /* @__PURE__ */ p(
|
|
91
92
|
F,
|
|
92
93
|
{
|
|
93
94
|
...e,
|
|
@@ -95,7 +96,7 @@ const ie = () => /* @__PURE__ */ m("div", {}), oe = (e) => {
|
|
|
95
96
|
key: `${d(a, "_parent", "root")}-${a._id}-${y}`,
|
|
96
97
|
repeaterData: { index: y, dataKey: u }
|
|
97
98
|
}
|
|
98
|
-
)) :
|
|
99
|
+
)) : s(l) ? /* @__PURE__ */ p(
|
|
99
100
|
F,
|
|
100
101
|
{
|
|
101
102
|
...e,
|
|
@@ -105,13 +106,13 @@ const ie = () => /* @__PURE__ */ m("div", {}), oe = (e) => {
|
|
|
105
106
|
type: a._type
|
|
106
107
|
}
|
|
107
108
|
) : null) : null);
|
|
108
|
-
}, V = (e, t, r) => h(r) ? {} : Object.entries(r).reduce((i, [n,
|
|
109
|
-
const
|
|
109
|
+
}, V = (e, t, r) => h(r) ? {} : Object.entries(r).reduce((i, [n, o]) => {
|
|
110
|
+
const s = [];
|
|
110
111
|
let a = R(e, { _id: t });
|
|
111
112
|
for (; a; )
|
|
112
|
-
|
|
113
|
-
const l = R(
|
|
114
|
-
return l && (i[n] = d(l, d(
|
|
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;
|
|
115
116
|
}, {});
|
|
116
117
|
function Ce(e) {
|
|
117
118
|
if (h(e.lang) && !h(e.fallbackLang))
|
|
@@ -133,17 +134,17 @@ const le = () => /* @__PURE__ */ m("div", {}), de = async (e) => {
|
|
|
133
134
|
lang: r,
|
|
134
135
|
fallbackLang: i,
|
|
135
136
|
children: n,
|
|
136
|
-
externalData:
|
|
137
|
-
blocks:
|
|
137
|
+
externalData: o,
|
|
138
|
+
blocks: s,
|
|
138
139
|
draft: a,
|
|
139
140
|
pageProps: l,
|
|
140
141
|
dataProviderMetadataCallback: k,
|
|
141
142
|
dataProviders: c
|
|
142
143
|
} = e, u = $(t._type), _ = d(u, "component", null), y = d(e.repeaterData, "index", -1), M = d(e.repeaterData, "dataKey", ""), g = O(
|
|
143
144
|
N(t, r === i ? "" : r, u),
|
|
144
|
-
|
|
145
|
+
o,
|
|
145
146
|
{ index: y, key: M }
|
|
146
|
-
), x = E(t, !1), L = V(
|
|
147
|
+
), x = E(t, !1), L = V(s, t._id, J(t._type)), B = P(u, "dataProvider") && w(u.dataProvider), v = {
|
|
147
148
|
...g,
|
|
148
149
|
...x,
|
|
149
150
|
...L
|
|
@@ -151,6 +152,7 @@ const le = () => /* @__PURE__ */ m("div", {}), de = async (e) => {
|
|
|
151
152
|
blockProps: {},
|
|
152
153
|
inBuilder: !1,
|
|
153
154
|
lang: r || i,
|
|
155
|
+
pageData: o,
|
|
154
156
|
...v
|
|
155
157
|
}, D = d(v, "_show", !0);
|
|
156
158
|
if (H(_) || !D) return null;
|
|
@@ -197,12 +199,12 @@ const le = () => /* @__PURE__ */ m("div", {}), de = async (e) => {
|
|
|
197
199
|
});
|
|
198
200
|
}, T = async (e) => {
|
|
199
201
|
const { blocks: t, parent: r, repeaterData: i, type: n } = e;
|
|
200
|
-
let
|
|
202
|
+
let o = W(
|
|
201
203
|
S(t, (a) => P(a, "_id") && (h(r) ? !a._parent : a._parent === r)),
|
|
202
204
|
"_id"
|
|
203
205
|
);
|
|
204
|
-
const
|
|
205
|
-
return (n === "Heading" || n === "Paragraph" || n === "Link") && (
|
|
206
|
+
const s = (a) => S(t, (l) => l._parent === a).length > 0;
|
|
207
|
+
return (n === "Heading" || n === "Paragraph" || n === "Link") && (o = j(o)), U(o, (a) => a ? /* @__PURE__ */ p(de, { dataProviders: e.dataProviders, ...e, key: a._id, block: a }, ({ _id: l, _type: k, repeaterItems: c, $repeaterItemsKey: u }) => k === "Repeater" ? b(c) && c.map((_, y) => /* @__PURE__ */ p(
|
|
206
208
|
T,
|
|
207
209
|
{
|
|
208
210
|
...e,
|
|
@@ -210,7 +212,7 @@ const le = () => /* @__PURE__ */ m("div", {}), de = async (e) => {
|
|
|
210
212
|
key: `${d(a, "_parent", "root")}-${a._id}-${y}`,
|
|
211
213
|
repeaterData: { index: y, dataKey: u }
|
|
212
214
|
}
|
|
213
|
-
)) :
|
|
215
|
+
)) : s(l) ? /* @__PURE__ */ p(
|
|
214
216
|
T,
|
|
215
217
|
{
|
|
216
218
|
...e,
|
|
@@ -229,19 +231,19 @@ async function $e(e) {
|
|
|
229
231
|
const t = e.lang ?? "en", r = e.fallbackLang ?? t;
|
|
230
232
|
if (e.dataProviders)
|
|
231
233
|
return /* @__PURE__ */ m(T, { ...e, lang: t, fallbackLang: r, dataProviders: e.dataProviders });
|
|
232
|
-
const n = e.blocks.filter((
|
|
233
|
-
const
|
|
234
|
-
return !!(P(
|
|
234
|
+
const n = e.blocks.filter((o) => {
|
|
235
|
+
const s = $(o._type);
|
|
236
|
+
return !!(P(s, "dataProvider") && w(s.dataProvider));
|
|
235
237
|
}).reduce(
|
|
236
|
-
(
|
|
237
|
-
const a = $(
|
|
238
|
+
(o, s) => {
|
|
239
|
+
const a = $(s._type), l = {
|
|
238
240
|
pageProps: e.pageProps,
|
|
239
|
-
block:
|
|
241
|
+
block: s,
|
|
240
242
|
lang: e.lang,
|
|
241
243
|
draft: e.draft,
|
|
242
244
|
inBuilder: !1
|
|
243
245
|
};
|
|
244
|
-
return s
|
|
246
|
+
return o[s._id] = a.dataProvider(l), o;
|
|
245
247
|
},
|
|
246
248
|
{}
|
|
247
249
|
);
|
|
@@ -250,12 +252,12 @@ async function $e(e) {
|
|
|
250
252
|
function Se(e, t) {
|
|
251
253
|
const r = e.filter(({ _type: i }) => i === "GlobalBlock" || i === "PartialBlock");
|
|
252
254
|
for (let i = 0; i < r.length; i++) {
|
|
253
|
-
const n = r[i],
|
|
254
|
-
if (
|
|
255
|
-
let
|
|
256
|
-
n._parent && (
|
|
255
|
+
const n = r[i], o = d(n, "partialBlockId", d(n, "globalBlock", ""));
|
|
256
|
+
if (o === "") continue;
|
|
257
|
+
let s = X(d(t, o, []));
|
|
258
|
+
n._parent && (s == null ? void 0 : s.length) > 0 && (s = s.map((l) => (h(l._parent) && (l._parent = n._parent), l)));
|
|
257
259
|
const a = e.indexOf(n);
|
|
258
|
-
e.splice(a, 1, ...
|
|
260
|
+
e.splice(a, 1, ...s);
|
|
259
261
|
}
|
|
260
262
|
return e;
|
|
261
263
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),u=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),u=require("./index-BVbLLob7.cjs"),n=require("./tooltip-Ba1-8jmj.cjs");require("clsx");require("tailwind-merge");const S=({isOpen:m,onClose:l,editor:t,rteElement:f})=>{const r=u.usePageExternalData(),j=o=>{if(!t)return;const i=`{{${o}}}`;t.commands.focus();const{from:p,to:g}=t.state.selection;if(p!==g)t.chain().deleteSelection().insertContent(i).run();else{const{state:c}=t,s=c.selection.from,x=c.doc.textBetween(Math.max(0,s-1),s),a=c.doc.textBetween(s,Math.min(s+1,c.doc.content.size));let d="";s>0&&x!==" "&&!/[.,!?;:]/.test(x)&&(d=" ");let h="";a&&a!==" "&&!/[.,!?;:]/.test(a)&&(h=" "),t.chain().insertContent(d+i+h).run()}};return e.jsx(n.Dialog,{open:m,onOpenChange:o=>!o&&l(),children:e.jsxs(n.DialogContent,{className:"max-h-[90vh] overflow-y-auto sm:max-w-[800px]",children:[e.jsx(n.DialogHeader,{children:e.jsxs(n.DialogTitle,{className:"flex items-center justify-between pr-8",children:[e.jsx("span",{children:"Rich Text Editor"}),Object.keys(r).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(u.NestedPathSelector,{data:r,onSelect:j})})]})]})}),f,e.jsx("div",{className:"mt-4 flex justify-end",children:e.jsx(n.Button,{onClick:l,children:"Done"})})]})})};exports.default=S;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as e, jsxs as c } from "react/jsx-runtime";
|
|
2
|
-
import { d as N, N as D } from "./index-
|
|
2
|
+
import { d as N, N as D } from "./index-H6m-0wVZ.js";
|
|
3
3
|
import { a1 as v, a3 as S, a6 as j, a9 as w, v as y } from "./tooltip-DUosa-uC.js";
|
|
4
4
|
import "clsx";
|
|
5
5
|
import "tailwind-merge";
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"author": "Suraj Air",
|
|
6
6
|
"license": "BSD-3-Clause",
|
|
7
7
|
"homepage": "https://chaibuilder.com",
|
|
8
|
-
"version": "3.2.
|
|
8
|
+
"version": "3.2.7",
|
|
9
9
|
"type": "module",
|
|
10
10
|
"repository": {
|
|
11
11
|
"type": "git",
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
}
|
|
70
70
|
},
|
|
71
71
|
"dependencies": {
|
|
72
|
-
"@chaibuilder/runtime": "2.
|
|
72
|
+
"@chaibuilder/runtime": "2.3.0",
|
|
73
73
|
"@floating-ui/dom": "1.7.4",
|
|
74
74
|
"@floating-ui/react-dom": "2.1.6",
|
|
75
75
|
"@iconify-json/lucide": "^1.2.71",
|
|
@@ -108,18 +108,19 @@
|
|
|
108
108
|
"@tailwindcss/line-clamp": "^0.4.4",
|
|
109
109
|
"@tailwindcss/typography": "^0.5.16",
|
|
110
110
|
"@tanstack/react-virtual": "^3.13.12",
|
|
111
|
-
"@tiptap/extension-bubble-menu": "^
|
|
112
|
-
"@tiptap/extension-bullet-list": "^2.
|
|
113
|
-
"@tiptap/extension-
|
|
114
|
-
"@tiptap/extension-
|
|
115
|
-
"@tiptap/extension-
|
|
116
|
-
"@tiptap/extension-
|
|
117
|
-
"@tiptap/extension-
|
|
118
|
-
"@tiptap/extension-text-
|
|
119
|
-
"@tiptap/extension-
|
|
120
|
-
"@tiptap/
|
|
121
|
-
"@tiptap/
|
|
122
|
-
"@tiptap/
|
|
111
|
+
"@tiptap/extension-bubble-menu": "^2.27.1",
|
|
112
|
+
"@tiptap/extension-bullet-list": "^2.27.1",
|
|
113
|
+
"@tiptap/extension-color": "^2.27.1",
|
|
114
|
+
"@tiptap/extension-highlight": "^2.27.1",
|
|
115
|
+
"@tiptap/extension-link": "^2.27.1",
|
|
116
|
+
"@tiptap/extension-ordered-list": "^2.27.1",
|
|
117
|
+
"@tiptap/extension-placeholder": "^2.27.1",
|
|
118
|
+
"@tiptap/extension-text-align": "^2.27.1",
|
|
119
|
+
"@tiptap/extension-text-style": "^2.27.1",
|
|
120
|
+
"@tiptap/extension-underline": "^2.27.1",
|
|
121
|
+
"@tiptap/pm": "^2.27.1",
|
|
122
|
+
"@tiptap/react": "^2.27.1",
|
|
123
|
+
"@tiptap/starter-kit": "^2.27.1",
|
|
123
124
|
"class-variance-authority": "0.7.1",
|
|
124
125
|
"clsx": "2.1.1",
|
|
125
126
|
"cmdk": "^1.1.1",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const T=require("./common-functions-B3a4xKt_.cjs"),t=require("lodash-es"),k=require("himalaya"),z=require("@chaibuilder/runtime"),U=require("tailwind-merge"),m="#styles:",Y="__ADD_BLOCK_INTERNAL_ROOT",K="@",V="#",v="dt#",H=e=>{if(e=e.replace(m,""),!e)return{baseClasses:"",classes:""};const l=e.split(/,(?![^\[]*\])/);if(l.length===1)return{baseClasses:"",classes:l[0].trim()};const[s,...n]=l;return{baseClasses:s.trim(),classes:n.join(",").trim().replace(/ +(?= )/g,"")}},X=e=>{const l=/(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/(?:[^\/\n\s]+\/\S+\/|(?:v|e(?:mbed)?)\/|\S*?[?&]v=)|youtu\.be\/)([a-zA-Z0-9_-]{11})/,s=/(?:https?:\/\/)?(?:www\.)?(player)?.vimeo\.com/;return l.test(e)||s.test(e)},G=e=>{if(t.isEmpty(e))return e;const l=/<video[^>]+src=['"]([^'">]+)['"]/,s=/<iframe[^>]+src=['"]([^'">]+)['"]/,n=e.match(l),a=e.match(s),i=n?n[1]:a?a[1]:null,o=/(?: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/;return i&&(o.test(i)||r.test(i))?i:e},M=["chai-name","data-chai-name"],Z={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"},form:{action:"action"}},Q=(e,l)=>e.children.length===1&&t.includes(["Heading","Paragraph","Span","ListItem","Button","Label","TableCell","Link","RichText"],l._type),E=e=>e.map(l=>l.type==="text"?t.get(l,"content",""):t.isEmpty(l.children)?"":E(l.children)).join(""),B=e=>e===null?"":e,O=e=>{const l=t.compact(t.map(e.split(/\s+/),t.trim)),s=t.find(l,r=>/^w-/.test(r)),n=t.find(l,r=>/^h-/.test(r));if(!n||!s)return{height:"",width:""};const a=r=>{if(!r)return;const y=r.match(/^[wh]-(?:\[(.*?)\]|(.+))$/);if(!y)return;if(y[1])return y[1];const c=y[2];return/^\d+(\.\d+)?$/.test(c)?`${Number(c)*4}px`:c==="auto"||t.includes(c,"%")?c:"16px"},i=a(s),o=a(n);return{width:t.includes(i,"px")?i:"16px",height:t.includes(o,"px")?o:"16px"}},q=e=>{if(e.tagName==="svg")return{};const l={},s=Z[e.tagName]||{},n=e.attributes;return t.forEach(n,({key:a,value:i})=>{if(!t.includes(M,a))if(a==="bid"&&(l._bid=B(i)),s[a]){if(e.tagName==="img"&&a==="src"&&!i.startsWith("http")){const o=t.find(e.attributes,{key:"width"}),r=t.find(e.attributes,{key:"height"});o&&r?i=`https://picsum.photos/${o==null?void 0:o.value}x${r==null?void 0:r.value}`:i="https://picsum.photos/150x150"}t.set(l,s[a],B(i))}else t.includes(["style","class","srcset","bid"],a)||(t.has(l,"styles_attrs")||(l.styles_attrs={}),t.startsWith(a,"@")&&(a=a.replace("@","x-on:")),l.styles_attrs[`${a}`]=B(i))}),delete l.class,l},tt=(e,l="styles")=>{if(!e.attributes)return{[l]:`${m},`};const s=t.find(e.attributes,{key:"class"});if(s){const n=s.value;return{[l]:`${m},${n}`}}return{[l]:`${m},`}},et=e=>{const l=t.get(e,"attributes",[]),s=l.find(c=>c.key==="data-chai-richtext"||c.key==="chai-richtext"),n=l.find(c=>c.key==="data-chai-lightbox"||c.key==="chai-lightbox"),a=l.find(c=>c.key==="data-chai-dropdown"||c.key==="chai-dropdown"),i=l.find(c=>c.key==="data-chai-dropdown-button"||c.key==="chai-dropdown-button"),o=l.find(c=>c.key==="data-chai-dropdown-content"||c.key==="chai-dropdown-content"),r=l.find(c=>c.key==="class"),y=r&&r.value.split(/\s+/).includes("rte");if(a)return{_type:"Dropdown"};if(i)return{_type:"DropdownButton"};if(o)return{_type:"DropdownContent"};if(s||y)return{_type:"Paragraph"};if(n)return{_type:"LightBoxLink"};switch(e.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"canvas":return{_type:"Canvas"};case"video":case"iframe":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:e.tagName,_listType:e.tagName==="ol"?"list-decimal":"list-none"};case"li":case"dt":return{_type:"ListItem",tag:e.tagName};case"span":case"figcaption":case"legend":return{_type:"Span",tag:e.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:"Box",_name:"Code"};case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":return{_type:"Heading",tag:e.tagName};case"table":return{_type:"Table"};case"tr":return{_type:"TableRow"};case"td":case"th":return{_type:"TableCell",tag:e.tagName};case"thead":return{_type:"TableHead"};case"tbody":return{_type:"TableBody"};case"tfoot":return{_type:"TableFooter"};default:{const c=t.get(e,"children",[]).length>0?"Box":"EmptyBox";return{_type:c,tag:e.tagName,_name:c=="EmptyBox"||e.tagName==="div"?c:t.capitalize(e.tagName)}}}},w=(e,l=null)=>t.flatMapDeep(e,s=>{var D,I,C,$,N,L,W,A,P,R;if(s.type==="comment")return[];let n={_id:T.generateUUID()};if(l&&(n._parent=l.block._id),s.type==="text")return t.isEmpty(t.get(s,"content",""))?[]:l&&Q(l.node,l.block)?(t.set(l,"block.content",t.get(s,"content","")),[]):{...n,_type:"Text",content:t.get(s,"content","")};if(t.startsWith(s.tagName,"chai-")){const p=s.attributes,u=t.find(p,{key:"chai-type"}),d=(u==null?void 0:u.value)||t.startCase(s.tagName.replace("chai-","")).replace(/\s+/g,"");n._type=d,t.forEach(p,({key:h,value:j})=>{if(h==="about-this-component"||h==="chai-type"||h==="can-move"||h==="can-delete")return;if(h==="id"){n._id=j;return}const J=t.startsWith(h,"_")?h:t.camelCase(h);let f=B(j);typeof f=="string"&&t.startsWith(f,"#styles:")&&(f=f.replace("#styles:","#styles:,")),n[J]=f});const g=w(s.children,{block:n,node:s});return[n,...g]}const a=t.get(s,"attributes",[]),i=s.tagName==="p"||a.find(p=>p.key==="data-chai-richtext"||p.key==="chai-richtext"),o=a.find(p=>p.key==="class"),r=o&&o.value.split(/\s+/).includes("rte"),y=a.find(p=>p.key==="data-chai-lightbox"||p.key==="chai-lightbox"),c=a.find(p=>p.key==="data-chai-dropdown"||p.key==="chai-dropdown"),b=a.find(p=>p.key==="data-chai-dropdown-button"||p.key==="chai-dropdown-button"),_=a.find(p=>p.key==="data-chai-dropdown-content"||p.key==="chai-dropdown-content");if(n={...n,...et(s),...q(s),...tt(s)},s.attributes){const p=s.attributes.find(u=>t.includes(M,u.key));p&&(n._name=p.value)}if(i||r)return n.content=`<p>${k.stringify(s.children||[])}</p>`,t.has(n,"styles_attrs.data-chai-richtext")&&delete n.styles_attrs["data-chai-richtext"],t.has(n,"styles_attrs.chai-richtext")&&delete n.styles_attrs["chai-richtext"],[n];if(y){const p=["data-chai-lightbox","chai-lightbox","data-vbtype","data-autoplay","data-maxwidth","data-overlay","data-gall","href"];n={...n,href:((D=a.find(u=>u.key==="href"))==null?void 0:D.value)||"",hrefType:((I=a.find(u=>u.key==="data-vbtype"))==null?void 0:I.value)||"video",autoplay:((C=a.find(u=>u.key==="data-autoplay"))==null?void 0:C.value)==="true"?"true":"false",maxWidth:((N=($=a.find(u=>u.key==="data-maxwidth"))==null?void 0:$.value)==null?void 0:N.replace("px",""))||"",backdropColor:((L=a.find(u=>u.key==="data-overlay"))==null?void 0:L.value)||"",galleryName:((W=a.find(u=>u.key==="data-gall"))==null?void 0:W.value)||""},t.forEach(p,u=>{t.has(n,`styles_attrs.${u}`)&&delete n.styles_attrs[u]})}if(c&&(delete n.styles_attrs,n.showDropdown=!1),_&&delete n.styles_attrs,b){delete n.styles_attrs;const p=t.filter(s.children||[],d=>(d==null?void 0:d.tagName)!=="span");n.content=E(p);const u=t.find(s.children||[],d=>(d==null?void 0:d.tagName)==="span"&&t.some(d.children||[],g=>(g==null?void 0:g.tagName)==="svg"));if(u){const d=t.find(u.children||[],g=>(g==null?void 0:g.tagName)==="svg");if(d){n.icon=k.stringify([d]);const{height:g,width:h}=st(d,"16px","16px");n.iconHeight=g,n.iconWidth=h}}return[n]}if(n._type==="Input"){const p=n.inputType||"text";p==="checkbox"?t.set(n,"_type","Checkbox"):p==="radio"&&t.set(n,"_type","Radio")}else if(s.tagName==="video"||s.tagName==="iframe"){const p=k.stringify([s]);return X(p)&&(t.set(n,"_type","Video"),t.set(n,"url",G(p)),t.set(n,"styles",`${m},`),t.set(n,"controls",{autoPlay:!1,muted:!0,loop:!1,controls:!1})),n.content=p,[n]}else if(s.tagName==="svg"){const p=t.get(t.find(s.attributes,{key:"class"}),"value",""),{height:u,width:d}=O(p);if(u&&d)n.styles=`${m}, ${T.cn(`w-${d} h-${u}`,p)}`.trim(),n.height=u==null?void 0:u.replace("px",""),n.width=d==null?void 0:d.replace("px","");else{const g=(A=t.find(s.attributes,{key:"height"}))==null?void 0:A.value,h=(P=t.find(s.attributes,{key:"width"}))==null?void 0:P.value;g&&h?(n.styles=`${m}, ${T.cn(`w-[${h}px] h-[${g}px]`,p)}`.trim(),n.height=g,n.width=h):n.styles=`${m}, ${T.cn("w-full h-full",p)}`.trim()}return s.attributes=t.filter(s.attributes,g=>!t.includes(["style","width","height","class"],g.key)),n.icon=k.stringify([s]),[n]}else if(s.tagName=="option"&&l&&((R=l.block)==null?void 0:R._type)==="Select")return l.block.options.push({label:E(s.children),...q(s)}),[];const x=w(s.children,{block:n,node:s});return[n,...x]}),st=(e,l,s)=>{var y,c;const n=t.get(e,"attributes",[]),{height:a,width:i}=O(t.get(t.find(n,{key:"class"}),"value",""));if(a&&i)return{height:`[${a}px]`,width:`[${i}px]`};const o=(y=t.find(n,{key:"height"}))==null?void 0:y.value,r=(c=t.find(n,{key:"width"}))==null?void 0:c.value;return{height:o?`[${o}px]`:s,width:r?`[${r}px]`:l}},nt=e=>{e=e.replace(/(\w+)=\\?"(.*?)\\?"/g,(n,a,i)=>{let o=i.replace(/\\"/g,'"');return o=o.replace(/{([^}]+)}/g,r=>r.replace(/"/g,'\\"')),`${a}="${o.replace(/\\"/g,'"')}"`}),e=e.replace(/\\n/g,"").replace(/\\\\/g,"").replace(/\\([/<>])/g,"$1").replace(/\\./g,"").replace(/[\n\r\t\f\v]/g,""),e=e.replace(/\$name="[^"]*"/g,"");const l=e.match(/<body[^>]*>[\s\S]*?<\/body>/);return(l&&l.length>0?l[0].replace(/<body/,"<div").replace(/<\/body>/,"</div>"):e).replace(/\s+/g," ").replaceAll("> <","><").replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,"").trim()},at=(e,l)=>t.find(e,{_id:l}),lt=(e,l)=>t.isEmpty(l)?e.map(s=>(t.unset(s,"_bid"),s)):t.map(e,s=>{const n=t.isEmpty(s._bid)?void 0:at(l,s._bid);if(n){n._type==="Icon"&&t.get(s,"icon","").match(/chai-default-svg/)&&delete s.icon;const a={...n,...s};return t.unset(a,"_bid"),a}return t.unset(s,"_bid"),s}),ot=e=>{const l=k.parse(nt(e));return t.isEmpty(e)?[]:t.flatten(w(l))};function rt(e,l,s){const n=t.get(s,"i18nProps",[]);if(t.isEmpty(l)||t.isEmpty(n))return e;const a=t.cloneDeep(e);return t.forEach(t.keys(a),i=>{if(t.includes(n,i)&&!t.isEmpty(l)){const o=t.get(a,i),r=t.get(a,`${i}-${l}`,"");t.isString(o)?a[i]=t.isString(r)&&!t.isEmpty(r.trim())&&r.trimStart()||o:a[i]=t.isEmpty(r)?o:r}}),a}const F=(e,l)=>{const{baseClasses:s,classes:n}=H(e),i=n.split(" ").filter(r=>r.startsWith(v)).map(r=>{var y;return(y=l[r])==null?void 0:y.value}),o=n.split(" ").filter(r=>!r.startsWith(v)).join(" ");return U.twMerge.apply(null,[s,...i,o])};function ct(e,l){return t.get(e,`${l}_attrs`,{})}function pt(e,l=!0,s={}){const n={};return Object.keys(e).forEach(a=>{if(t.isString(e[a])&&e[a].startsWith(m)){const i=F(e[a],s),o=ct(e,a);n[a]={...!t.isEmpty(i)&&{className:i},...o,...l?{"data-style-prop":a,"data-block-parent":e._id,"data-style-id":`${a}-${e._id}`}:{}}}}),n}const ut=t.memoize(e=>{const l=z.getRegisteredChaiBlock(e),s=t.get(l,"schema.properties",{});return Object.fromEntries(Object.entries(s).filter(([,n])=>t.get(n,"runtime",!1)))}),dt=(e,l)=>{if(!t.isArray(e))return e;let s=e,n;return typeof l.limit=="number"&&l.limit>0&&(n=l.limit),n!==void 0&&(s=s.slice(0,n)),s},yt=(e,l)=>{const s=t.cloneDeep(e);return t.forEach(t.keys(s),n=>{if(t.isString(s[n])&&!t.startsWith(n,"_")){let a=s[n];n==="repeaterItems"&&(s.repeaterItemsBinding=a);const i=/\{\{(.*?)\}\}/g,o=a.match(i);o&&o.forEach(r=>{let y=r.slice(2,-2);const c=t.get(l,y,r);a=t.isArray(c)?c:a.replace(r,c)}),s[n]=a}}),s},gt=(e,l)=>e.map(s=>{const n=t.keys(s).filter(a=>t.isString(s[a])&&s[a].startsWith(m));return t.each(n,a=>{s[a]=`${m},${F(s[a],l)}`}),s}),ht=e=>{const l=t.last(e);return e.map(s=>{const n=Object.keys(s);for(let a=0;a<n.length;a++)if(t.isString(s[n[a]])&&t.startsWith(n[a],"content")){const i=s===l?"":" ";s[n[a]]=`${s[n[a]].trim()}${i}`}return s})},S=(e,l,{index:s,key:n},a)=>{if(t.isString(e)){let i=e;const o=/\{\{(.*?)\}\}/g,r=e.match(o);if(r){const y=a==="image"||a==="mobileImage";r.forEach(c=>{let b=c.slice(2,-2).trim(),_=n.slice(2,-2).trim();s!==-1&&t.startsWith(b,"$index.")?b=`${_}.${s}.${b.slice(7)}`:s!==-1&&t.startsWith(b,"$index")&&(b=`${_}.${s}`);const x=t.get(l,b);x===void 0?i=i.replace(c,""):y&&!t.isArray(x)?i=x:i=t.isArray(x)?x:i.replace(c,x)})}return i}if(t.isArray(e))return e.map(i=>S(i,l,{index:s,key:n},a));if(e&&typeof e=="object"){const i={};return t.forEach(t.keys(e),o=>{!t.startsWith(o,"_")&&o!=="$repeaterItemsKey"?i[o]=S(e[o],l,{index:s,key:n},o):i[o]=e[o]}),i}return e},mt=(e,l,{index:s,key:n})=>{let a=t.cloneDeep(e);return a.repeaterItems&&(a.$repeaterItemsKey=a.repeaterItems,t.startsWith(a.repeaterItems,`{{${V}`)&&(a.$repeaterItemsKey=a.repeaterItems=`${a.repeaterItems.replace("}}",`/${a._id}}}`)}`),!t.isEmpty(a.repeaterItems)&&a.pagination&&(a.repeaterTotalItems=`${a.repeaterItems.replace("}}",`/${a._id}/totalItems}}`)}`)),S(a,l,{index:s,key:n})};exports.COLLECTION_PREFIX=V;exports.DESIGN_TOKEN_PREFIX=v;exports.REPEATER_PREFIX=K;exports.ROOT_TEMP_KEY=Y;exports.STYLES_KEY=m;exports.adjustSpacingInContentBlocks=ht;exports.applyBindingToBlockProps=mt;exports.applyChaiDataBinding=yt;exports.applyDesignTokens=gt;exports.applyLanguage=rt;exports.applyLimit=dt;exports.getBlockRuntimeProps=ut;exports.getBlockTagAttributes=pt;exports.getBlocksFromHTML=ot;exports.getSplitChaiClasses=H;exports.mergeBlocksWithExisting=lt;
|