@chaibuilder/sdk 3.2.12 → 3.2.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/code-editor-Be8OB-e6.js +64 -0
- package/dist/code-editor-CgSpHwXD.cjs +1 -0
- package/dist/core.cjs +1 -1
- package/dist/core.js +9 -9
- package/dist/{design-token-usage-DyQcFypc.cjs → design-token-usage--LZcMRuv.cjs} +1 -1
- package/dist/{design-token-usage-_FBnvL92.js → design-token-usage-CMsZJzKT.js} +1 -1
- package/dist/{index-CIez6R-d.js → index-DTZkrGK-.js} +106 -98
- package/dist/{index-zLw6cVaV.cjs → index-DhKXDngP.cjs} +2 -2
- package/dist/{manage-design-tokens-BHCCrWFS.js → manage-design-tokens-DJzTXWE_.js} +2 -2
- package/dist/{manage-design-tokens-Cfjg_at9.cjs → manage-design-tokens-KFEEXJ0S.cjs} +1 -1
- package/dist/{rte-widget-modal-CsBCpJSY.js → rte-widget-modal-DO06_gcz.js} +1 -1
- package/dist/{rte-widget-modal-Dif3ZoFQ.cjs → rte-widget-modal-Dte2RR1d.cjs} +1 -1
- package/package.json +3 -3
- package/dist/code-editor-CEsA4Nlq.cjs +0 -1
- package/dist/code-editor-DPr4HDOV.js +0 -59
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { jsx as t, jsxs as i } from "react/jsx-runtime";
|
|
2
|
+
import { u as k, a as v, b as T, L, c as N, d as y } from "./index-DTZkrGK-.js";
|
|
3
|
+
import "clsx";
|
|
4
|
+
import { get as w } from "lodash-es";
|
|
5
|
+
import "nanoid";
|
|
6
|
+
import "tailwind-merge";
|
|
7
|
+
import "tree-model";
|
|
8
|
+
import { useState as u, useMemo as E, useCallback as D, useEffect as H } from "react";
|
|
9
|
+
import "jotai";
|
|
10
|
+
import "@chaibuilder/runtime";
|
|
11
|
+
import "sonner";
|
|
12
|
+
import { useTranslation as M } from "react-i18next";
|
|
13
|
+
import { a1 as P, a3 as B, a6 as I, a9 as S, b1 as j } from "./tooltip-DUosa-uC.js";
|
|
14
|
+
import { useThrottledCallback as R } from "@react-hookz/web";
|
|
15
|
+
const x = (o) => {
|
|
16
|
+
const s = document.createElement("div");
|
|
17
|
+
return s.innerHTML = o, s.innerHTML;
|
|
18
|
+
};
|
|
19
|
+
function _() {
|
|
20
|
+
const { t: o } = M(), [s, f] = u(!1), [n, h] = u(""), [e, c] = k(), [d] = v(), { selectedLang: r } = T(), m = E(() => w(L, r, r), [r]), C = N(), b = y(), g = R(
|
|
21
|
+
(a) => {
|
|
22
|
+
const l = x(a);
|
|
23
|
+
b([e.blockId], { [e.blockProp]: l });
|
|
24
|
+
},
|
|
25
|
+
[],
|
|
26
|
+
300
|
|
27
|
+
), p = D(() => {
|
|
28
|
+
if (s) {
|
|
29
|
+
const a = x(n);
|
|
30
|
+
C([e.blockId], { [e.blockProp]: a });
|
|
31
|
+
}
|
|
32
|
+
}, [s, n]);
|
|
33
|
+
return H(() => {
|
|
34
|
+
d.includes(e == null ? void 0 : e.blockId) || (p(), c(null));
|
|
35
|
+
}, [d]), /* @__PURE__ */ t(P, { open: !0, onOpenChange: () => {
|
|
36
|
+
p(), c(null);
|
|
37
|
+
}, children: /* @__PURE__ */ i(B, { className: "flex max-h-[400px] min-h-[200px] max-w-4xl flex-col border-gray-700 text-black", children: [
|
|
38
|
+
/* @__PURE__ */ t(I, { className: "shrink-0 pb-3", children: /* @__PURE__ */ t(S, { className: "flex items-center justify-between text-black", children: /* @__PURE__ */ i("div", { className: "space-x-3 text-sm font-semibold", children: [
|
|
39
|
+
/* @__PURE__ */ t("span", { children: o("HTML Code Editor") }),
|
|
40
|
+
m && /* @__PURE__ */ i("span", { className: "text-xs text-gray-400", children: [
|
|
41
|
+
"(",
|
|
42
|
+
m,
|
|
43
|
+
")"
|
|
44
|
+
] }),
|
|
45
|
+
/* @__PURE__ */ t("span", { className: "text-xs text-gray-400", children: o("Scripts will be only executed in preview and live mode.") })
|
|
46
|
+
] }) }) }),
|
|
47
|
+
/* @__PURE__ */ t("div", { className: "min-h-0 flex-1 overflow-hidden", children: /* @__PURE__ */ t(
|
|
48
|
+
j,
|
|
49
|
+
{
|
|
50
|
+
className: "h-full w-full resize-none font-mono text-xs md:text-xs",
|
|
51
|
+
value: n || e.initialCode,
|
|
52
|
+
onChange: (a) => {
|
|
53
|
+
const l = a.target.value;
|
|
54
|
+
f(!0), h(l), g(l);
|
|
55
|
+
},
|
|
56
|
+
rows: 10,
|
|
57
|
+
placeholder: o("Enter your code here...")
|
|
58
|
+
}
|
|
59
|
+
) })
|
|
60
|
+
] }) });
|
|
61
|
+
}
|
|
62
|
+
export {
|
|
63
|
+
_ as default
|
|
64
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),s=require("./index-DhKXDngP.cjs");require("clsx");const j=require("lodash-es");require("nanoid");require("tailwind-merge");require("tree-model");const l=require("react");require("jotai");require("@chaibuilder/runtime");require("sonner");const v=require("react-i18next"),a=require("./tooltip-Ba1-8jmj.cjs"),T=require("@react-hookz/web"),p=o=>{const n=document.createElement("div");return n.innerHTML=o,n.innerHTML};function y(){const{t:o}=v.useTranslation(),[n,f]=l.useState(!1),[i,g]=l.useState(""),[t,u]=s.useCodeEditor(),[x]=s.useSelectedBlockIds(),{selectedLang:d}=s.useLanguages(),m=l.useMemo(()=>j.get(s.LANGUAGES,d,d),[d]),b=s.useUpdateBlocksProps(),C=s.useUpdateBlocksPropsRealtime(),k=T.useThrottledCallback(r=>{const c=p(r);C([t.blockId],{[t.blockProp]:c})},[],300),h=l.useCallback(()=>{if(n){const r=p(i);b([t.blockId],{[t.blockProp]:r})}},[n,i]);l.useEffect(()=>{x.includes(t==null?void 0:t.blockId)||(h(),u(null))},[x]);const q=()=>{h(),u(null)};return e.jsx(a.Dialog,{open:!0,onOpenChange:q,children:e.jsxs(a.DialogContent,{className:"flex max-h-[400px] min-h-[200px] max-w-4xl flex-col border-gray-700 text-black",children:[e.jsx(a.DialogHeader,{className:"shrink-0 pb-3",children:e.jsx(a.DialogTitle,{className:"flex items-center justify-between text-black",children:e.jsxs("div",{className:"space-x-3 text-sm font-semibold",children:[e.jsx("span",{children:o("HTML Code Editor")}),m&&e.jsxs("span",{className:"text-xs text-gray-400",children:["(",m,")"]}),e.jsx("span",{className:"text-xs text-gray-400",children:o("Scripts will be only executed in preview and live mode.")})]})})}),e.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:e.jsx(a.Textarea,{className:"h-full w-full resize-none font-mono text-xs md:text-xs",value:i||t.initialCode,onChange:r=>{const c=r.target.value;f(!0),g(c),k(c)},rows:10,placeholder:o("Enter your code here...")})})]})})}exports.default=y;
|
package/dist/core.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-DhKXDngP.cjs"),s=require("./common-functions-B3a4xKt_.cjs"),a=require("./apply-binding-Bn1KC8uC.cjs"),i=require("react-i18next"),l=require("i18next");exports.ChaiAddBlocksDialog=e.AddBlocksDialog;exports.ChaiAddBlocksPanel=e.AddBlocksPanel;exports.ChaiAskAiUserPrompt=e.AIUserPrompt;exports.ChaiBlockAttributesEditor=e.BlockAttributesEditor;exports.ChaiBlockPropsEditor=e.BlockSettings;exports.ChaiBlockStyleEditor=e.BlockStyling;exports.ChaiBuilderCanvas=e.CanvasArea;exports.ChaiBuilderEditor=e.ChaiBuilderEditor;exports.ChaiDarkModeSwitcher=e.DarkMode;exports.ChaiDefaultBlocks=e.DefaultChaiBlocks;exports.ChaiDraggableBlock=e.ChaiDraggableBlock;exports.ChaiExportCodeModal=e.ExportCodeModal;exports.ChaiImportHTML=e.ImportHTML;exports.ChaiOutline=e.ListTree;exports.ChaiScreenSizes=e.Breakpoints;exports.ChaiThemeConfigPanel=e.ThemeConfigPanel;exports.ChaiUILibrariesPanel=e.UILibrariesPanel;exports.ChaiUndoRedo=e.UndoRedo;exports.IfChaiFeatureFlag=e.IfChaiFeatureFlag;exports.PERMISSIONS=e.PERMISSIONS;exports.getClassValueAndUnit=e.getClassValueAndUnit;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.useActiveSettingsTab=e.useActiveSettingsTab;exports.useAddBlock=e.useAddBlock;exports.useAddClassesToBlocks=e.useAddClassesToBlocks;exports.useAskAi=e.useAskAi;exports.useBlockHighlight=e.useBlockHighlight;exports.useBlocksHtmlForAi=e.useBlocksHtmlForAi;exports.useBlocksStore=e.useBlocksStore;exports.useBlocksStoreUndoableActions=e.useBlocksStoreUndoableActions;exports.useBrandingOptions=e.useBrandingOptions;exports.useBuilderProp=e.useBuilderProp;exports.useBuilderReset=e.useBuilderReset;exports.useCanvasDisplayWidth=e.useCanvasDisplayWidth;exports.useCanvasWidth=e.useCanvasWidth;exports.useCanvasZoom=e.useCanvasZoom;exports.useChaiFeatureFlag=e.useChaiFeatureFlag;exports.useChaiFeatureFlags=e.useChaiFeatureFlags;exports.useCodeEditor=e.useCodeEditor;exports.useCopyBlockIds=e.useCopyBlocks;exports.useCopyToClipboard=e.useCopyToClipboard;exports.useCurrentPage=e.useCurrentPage;exports.useCutBlockIds=e.useCutBlockIds;exports.useDarkMode=e.useDarkMode;exports.useDuplicateBlocks=e.useDuplicateBlocks;exports.useHighlightBlockId=e.useHighlightBlockId;exports.useHtmlToBlocks=e.useHtmlToBlocks;exports.useI18nBlocks=e.useI18nBlocks;exports.useInlineEditing=e.useInlineEditing;exports.useIsPageLoaded=e.useIsPageLoaded;exports.useLanguages=e.useLanguages;exports.useLibraryBlocks=e.useLibraryBlocks;exports.useMediaManagerComponent=e.useMediaManagerComponent;exports.usePartailBlocksStore=e.usePartialBlocksStore;exports.usePartialBlocksList=e.usePartialBlocksList;exports.usePasteBlocks=e.usePasteBlocks;exports.usePermissions=e.usePermissions;exports.usePreviewMode=e.usePreviewMode;exports.usePubSub=e.usePubSub;exports.useRemoveAllClassesForBlock=e.useRemoveAllClassesForBlock;exports.useRemoveBlocks=e.useRemoveBlocks;exports.useRemoveClassesFromBlocks=e.useRemoveClassesFromBlocks;exports.useReplaceBlock=e.useReplaceBlock;exports.useResetBlockStyles=e.useResetBlockStyles;exports.useRightPanel=e.useRightPanel;exports.useSavePage=e.useSavePage;exports.useScreenSizeWidth=e.useScreenSizeWidth;exports.useSelectedBlock=e.useSelectedBlock;exports.useSelectedBlockAllClasses=e.useSelectedBlockAllClasses;exports.useSelectedBlockCurrentClasses=e.useSelectedBlockCurrentClasses;exports.useSelectedBlockIds=e.useSelectedBlockIds;exports.useSelectedBlocksDisplayChild=e.useSelectedBlocksDisplayChild;exports.useSelectedBreakpoints=e.useSelectedBreakpoints;exports.useSelectedLibrary=e.useSelectedLibrary;exports.useSelectedStylingBlocks=e.useSelectedStylingBlocks;exports.useSidebarActivePanel=e.useSidebarActivePanel;exports.useStreamMultipleBlocksProps=e.useStreamMultipleBlocksProps;exports.useStylingBreakpoint=e.useStylingBreakpoint;exports.useStylingState=e.useStylingState;exports.useTheme=e.useTheme;exports.useThemeOptions=e.useThemeOptions;exports.useToggleChaiFeatureFlag=e.useToggleChaiFeatureFlag;exports.useUndoManager=e.useUndoManager;exports.useUpdateBlocksProps=e.useUpdateBlocksProps;exports.useUpdateBlocksPropsRealtime=e.useUpdateBlocksPropsRealtime;exports.useWrapperBlock=e.useWrapperBlock;exports.generateBlockId=s.generateUUID;exports.mergeClasses=s.cn;exports.convertHTMLToChaiBlocks=a.getBlocksFromHTML;exports.getBlocksFromHTML=a.getBlocksFromHTML;Object.defineProperty(exports,"useTranslation",{enumerable:!0,get:()=>i.useTranslation});exports.i18n=l;
|
package/dist/core.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { s as e, A as i, m as o, t as l, B as r, k as t, C as u, q as c, D as d, v as C, w as B, E as k, I as g, l as n, n as h, T as S, U as p, p as m, R as P, _ as A, x as F, z as T, F as b, G as I, y as M, S as v, V as y, J as L, K as H, H as R, O as f, P as D, Q as E, $ as U, a0 as x, a1 as O, a2 as W, a3 as w, a4 as z, h as j, aJ as q, a5 as G, i as J, a6 as K, aL as N, aK as V, a7 as Z, W as Q, X, u as Y, a8 as _, a9 as $, aa, ab as sa, ac as ea, ad as ia, ae as oa, af as la, ag as ra, ah as ta, ai as ua, b as ca, aj as da, Z as Ca, ak as Ba, al as ka, am as ga, an as na, ao as ha, ap as Sa, aq as pa, ar as ma, as as Pa, at as Aa, au as Fa, av as Ta, j as ba, aM as Ia, aw as Ma, ax as va, ay as ya, a as La, az as Ha, aA as Ra, aN as fa, aB as Da, aO as Ea, aC as Ua, aD as xa, aE as Oa, aF as Wa, aG as wa, Y as za, aH as ja, c as qa, d as Ga, aI as Ja } from "./index-DTZkrGK-.js";
|
|
2
2
|
import { g as Na, c as Va } from "./common-functions-D2lMFR6K.js";
|
|
3
3
|
import { h as Qa, h as Xa } from "./apply-binding-DLaiD20q.js";
|
|
4
4
|
import { useTranslation as _a } from "react-i18next";
|
|
@@ -15,8 +15,8 @@ export {
|
|
|
15
15
|
d as ChaiDarkModeSwitcher,
|
|
16
16
|
C as ChaiDefaultBlocks,
|
|
17
17
|
B as ChaiDraggableBlock,
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
k as ChaiExportCodeModal,
|
|
19
|
+
g as ChaiImportHTML,
|
|
20
20
|
n as ChaiOutline,
|
|
21
21
|
h as ChaiScreenSizes,
|
|
22
22
|
S as ChaiThemeConfigPanel,
|
|
@@ -44,8 +44,8 @@ export {
|
|
|
44
44
|
E as registerChaiTopBar,
|
|
45
45
|
U as useActiveSettingsTab,
|
|
46
46
|
x as useAddBlock,
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
O as useAddClassesToBlocks,
|
|
48
|
+
W as useAskAi,
|
|
49
49
|
w as useBlockHighlight,
|
|
50
50
|
z as useBlocksHtmlForAi,
|
|
51
51
|
j as useBlocksStore,
|
|
@@ -74,8 +74,8 @@ export {
|
|
|
74
74
|
da as useLibraryBlocks,
|
|
75
75
|
Ca as useMediaManagerComponent,
|
|
76
76
|
Ba as usePartailBlocksStore,
|
|
77
|
-
|
|
78
|
-
|
|
77
|
+
ka as usePartialBlocksList,
|
|
78
|
+
ga as usePasteBlocks,
|
|
79
79
|
na as usePermissions,
|
|
80
80
|
ha as usePreviewMode,
|
|
81
81
|
Sa as usePubSub,
|
|
@@ -98,8 +98,8 @@ export {
|
|
|
98
98
|
Ea as useSidebarActivePanel,
|
|
99
99
|
Ua as useStreamMultipleBlocksProps,
|
|
100
100
|
xa as useStylingBreakpoint,
|
|
101
|
-
|
|
102
|
-
|
|
101
|
+
Oa as useStylingState,
|
|
102
|
+
Wa as useTheme,
|
|
103
103
|
wa as useThemeOptions,
|
|
104
104
|
za as useToggleChaiFeatureFlag,
|
|
105
105
|
_a as useTranslation,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),a=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),a=require("./index-DhKXDngP.cjs");require("clsx");const L=require("lodash-es");require("nanoid");require("tailwind-merge");require("@chaibuilder/runtime");const d=require("react");require("jotai");require("sonner");const w=require("react-i18next"),m=require("./tooltip-Ba1-8jmj.cjs"),x=require("@radix-ui/react-icons"),b=({title:r,items:i,emptyLabel:n,onSelect:t,icon:o})=>s.jsxs("div",{className:"space-y-2",children:[s.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:r}),i.length>0?s.jsx("div",{className:"space-y-1",children:i.map(l=>s.jsx("button",{type:"button",onClick:()=>t(l.id),className:m.cn("group flex w-full items-center justify-between rounded-md border border-transparent bg-muted/40 px-3 py-1 text-left text-xs transition","hover:border-muted-foreground/20 hover:bg-muted/70 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-offset-1",l.isSelected&&"border-primary/40 bg-primary/10 text-primary"),children:s.jsxs("span",{className:"flex items-center space-x-2",children:[o&&o,s.jsx("span",{className:"truncate",children:l.label})]})},l.id))}):s.jsx("div",{className:"rounded border border-dashed border-muted px-3 py-1 text-xs text-muted-foreground",children:n})]}),M="#styles:",_=r=>{const n=[typeof r._name=="string"?r._name:void 0,typeof r._type=="string"?r._type:void 0].filter(Boolean).find(t=>t.trim().length>0);return n?n.length>40?`${n.slice(0,37)}...`:n:r._id},C=(r,i)=>{const n=`${i}`;return r.filter(t=>Object.values(t).some(o=>typeof o!="string"||!o.startsWith(M)?!1:o.includes(n))).map(t=>({id:t._id,label:_(t)}))},O=({tokenId:r,tokenName:i,children:n})=>{const{t}=w.useTranslation(),[o]=a.useBlocksStore(),[l,g]=a.useSelectedBlockIds(),h=a.useBuilderProp("pageId"),f=a.useBuilderProp("siteWideUsage"),y=d.useMemo(()=>C(o,r),[o,r]),S=d.useMemo(()=>y.map(e=>({id:e.id,label:e.label,isSelected:l.includes(e.id)})),[y,l]),u=d.useMemo(()=>f?Object.entries(f).reduce((e,[p,c])=>(p===h||!(c!=null&&c.designTokens)||!Object.keys(c.designTokens).some(P=>typeof P!="string"?!1:P===r)||e.push({id:p,name:c.name||p,isPartial:!!c.isPartial}),e),[]):[],[f,i,r,h]),k=d.useMemo(()=>u.filter(e=>!e.isPartial).map(e=>({id:e.id,label:e.name})),[u]),v=d.useMemo(()=>u.filter(e=>e.isPartial).map(e=>({id:e.id,label:e.name})),[u]),B=d.useCallback(e=>{g([e])},[g]),N=a.useBuilderProp("gotoPage",L.noop),{selectedLang:q,fallbackLang:T}=a.useLanguages(),{savePageAsync:I}=a.useSavePage(),j=async e=>{e&&(await I(!0),N({pageId:e,lang:q||T}))};return s.jsxs(m.Popover,{children:[s.jsx(m.PopoverTrigger,{asChild:!0,children:n}),s.jsxs(m.PopoverContent,{side:"bottom",align:"end",className:"w-80 p-0",children:[s.jsxs("div",{className:"space-y-1 px-4 py-3",children:[s.jsx("p",{className:"text-xs font-semibold",children:i}),s.jsx("p",{className:"text-[11px] text-muted-foreground",children:t("Usage summary for this design token across your site.")})]}),s.jsxs("div",{className:"no-scrollbar max-h-64 space-y-4 overflow-y-auto px-4 pb-4",children:[s.jsx(b,{title:t("Blocks affected on this page"),items:S,emptyLabel:t("None"),onSelect:B,icon:s.jsx(x.ArrowRightIcon,{fontSize:4})}),s.jsx(b,{title:t("Blocks affected on other pages"),items:k,emptyLabel:t("None"),onSelect:j,icon:s.jsx(x.FileIcon,{fontSize:8})}),s.jsx(b,{title:t("Blocks affected on partial blocks"),items:v,emptyLabel:t("None"),onSelect:j,icon:s.jsx(x.GlobeIcon,{fontSize:8})})]})]})]})};exports.default=O;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs as c, jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { h as w, a as _, i as f, b as C, j as I } from "./index-DTZkrGK-.js";
|
|
3
3
|
import "clsx";
|
|
4
4
|
import { noop as O } from "lodash-es";
|
|
5
5
|
import "nanoid";
|
|
@@ -11508,7 +11508,7 @@ const RichTextEditor = memo(
|
|
|
11508
11508
|
/* @__PURE__ */ jsx("p", { className: "font-semibold", children: r("Oops! Something went wrong.") }),
|
|
11509
11509
|
/* @__PURE__ */ jsx("p", { children: r("Please try again.") })
|
|
11510
11510
|
] }) });
|
|
11511
|
-
}, CodeEditor$1 = React__default.lazy(() => import("./code-editor-
|
|
11511
|
+
}, CodeEditor$1 = React__default.lazy(() => import("./code-editor-Be8OB-e6.js")), CanvasArea = () => {
|
|
11512
11512
|
const [r] = useCodeEditor(), n = useBuilderProp("onError", noop);
|
|
11513
11513
|
return /* @__PURE__ */ jsx("div", { className: "flex h-full max-h-full w-full flex-1 flex-col", children: /* @__PURE__ */ jsxs("div", { className: "relative flex h-full max-h-full flex-col overflow-hidden bg-gray-100/40", children: [
|
|
11514
11514
|
/* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Skeleton, { className: "h-full" }), children: /* @__PURE__ */ jsx(ErrorBoundary, { fallback: /* @__PURE__ */ jsx(FallbackError, {}), onError: n, children: /* @__PURE__ */ jsx(StaticCanvas, {}) }) }),
|
|
@@ -12077,7 +12077,7 @@ const DataBindingSelector = ({
|
|
|
12077
12077
|
]
|
|
12078
12078
|
}
|
|
12079
12079
|
) });
|
|
12080
|
-
}, RTEModal = React__default.lazy(() => import("./rte-widget-modal-
|
|
12080
|
+
}, RTEModal = React__default.lazy(() => import("./rte-widget-modal-DO06_gcz.js")), RichTextEditorFieldComp = ({ blockId: r, id: n, placeholder: o, value: a, onChange: i, onBlur: l }) => {
|
|
12081
12081
|
const c = useRef(null), [d, u] = useState(!1), p = useRTEditor({
|
|
12082
12082
|
blockId: r,
|
|
12083
12083
|
value: a,
|
|
@@ -12299,22 +12299,29 @@ const DataBindingSelector = ({
|
|
|
12299
12299
|
] }, d)) })
|
|
12300
12300
|
] });
|
|
12301
12301
|
}, CodeEditor = ({ id: r, placeholder: n }) => {
|
|
12302
|
-
const { t: o } = useTranslation(), [, a] = useCodeEditor(), i = useSelectedBlock();
|
|
12302
|
+
const { t: o } = useTranslation(), [, a] = useCodeEditor(), { selectedLang: i } = useLanguages(), l = useSelectedBlock();
|
|
12303
12303
|
if (typeof window > "u") return null;
|
|
12304
|
-
const
|
|
12305
|
-
const
|
|
12306
|
-
a({ blockId:
|
|
12304
|
+
const c = r.replace("root.", ""), d = getRegisteredChaiBlock(l == null ? void 0 : l._type), p = includes(get(d, "i18nProps", []), c) && i ? `${c}-${i}` : c, h = get(l, p, ""), f = useMemo(() => get(LANGUAGES, i, i), [i]), m = () => {
|
|
12305
|
+
const g = l == null ? void 0 : l._id;
|
|
12306
|
+
a({ blockId: g, blockProp: p, placeholder: n, initialCode: h });
|
|
12307
12307
|
};
|
|
12308
12308
|
return /* @__PURE__ */ jsxs("div", { className: "mt-2 flex flex-col gap-y-1", children: [
|
|
12309
|
+
/* @__PURE__ */ jsxs("label", { htmlFor: r, children: [
|
|
12310
|
+
"HTML Code",
|
|
12311
|
+
f && /* @__PURE__ */ jsxs("small", { className: "text-[9px] text-zinc-400", children: [
|
|
12312
|
+
" ",
|
|
12313
|
+
f
|
|
12314
|
+
] })
|
|
12315
|
+
] }),
|
|
12309
12316
|
/* @__PURE__ */ jsx(
|
|
12310
12317
|
"button",
|
|
12311
12318
|
{
|
|
12312
|
-
onClick:
|
|
12319
|
+
onClick: m,
|
|
12313
12320
|
className: "w-[90%] max-w-full cursor-default truncate text-pretty rounded border border-border bg-background p-2 text-left text-[10px]",
|
|
12314
|
-
children:
|
|
12321
|
+
children: h.trim().length > 0 ? h.substring(0, 46) : n || "Eg: <script>console.log('Hello, world!');<\/script>"
|
|
12315
12322
|
}
|
|
12316
12323
|
),
|
|
12317
|
-
/* @__PURE__ */ jsx(Button, { onClick:
|
|
12324
|
+
/* @__PURE__ */ jsx(Button, { onClick: m, size: "sm", variant: "outline", className: "w-fit", children: o("Open code editor") })
|
|
12318
12325
|
] });
|
|
12319
12326
|
}, CollectionFilterSortField = ({ id: r, value: n, onChange: o, onBlur: a }) => {
|
|
12320
12327
|
const i = useBuilderProp("collections", []), l = useSelectedBlock(), c = get(l, "repeaterItems", "").replace(/\{\{(.*)\}\}/g, "$1").replace(COLLECTION_PREFIX, ""), d = find(i, { id: c }), p = get(d, r === "root.filter" ? "filters" : "sorts", []);
|
|
@@ -16941,7 +16948,7 @@ const PartialWrapper = ({ partialBlockId: r }) => {
|
|
|
16941
16948
|
component: DefaultTopBar
|
|
16942
16949
|
}, registerChaiTopBar = (r) => {
|
|
16943
16950
|
TOP_BAR.component = r;
|
|
16944
|
-
}, useTopBarComponent = () => useMemo(() => TOP_BAR.component, []), ManageDesignTokens = React__default.lazy(() => import("./manage-design-tokens-
|
|
16951
|
+
}, useTopBarComponent = () => useMemo(() => TOP_BAR.component, []), ManageDesignTokens = React__default.lazy(() => import("./manage-design-tokens-DJzTXWE_.js")), DEFAULT_PANEL_WIDTH = 280, OutlineButton = ({ isActive: r, show: n }) => /* @__PURE__ */ jsx(Button, { variant: r ? "default" : "ghost", size: "icon", onClick: n, children: /* @__PURE__ */ jsx(StackIcon, { className: "h-5 w-5" }) }), AddBlocksButton = ({ isActive: r, show: n }) => useIsDragAndDropEnabled() && /* @__PURE__ */ jsx(Button, { variant: r ? "default" : "ghost", size: "icon", onClick: n, children: /* @__PURE__ */ jsx(PlusCircledIcon, { className: "h-5 w-5" }) }), AskAiButton = ({ isActive: r, show: n }) => /* @__PURE__ */ jsx(Button, { variant: r ? "default" : "ghost", size: "icon", onClick: n, children: /* @__PURE__ */ jsx(AiIcon, {}) });
|
|
16945
16952
|
registerChaiSidebarPanel("add-block", {
|
|
16946
16953
|
button: AddBlocksButton,
|
|
16947
16954
|
label: "Add Blocks",
|
|
@@ -18220,108 +18227,109 @@ ${i})
|
|
|
18220
18227
|
if (typeof window > "u")
|
|
18221
18228
|
throw new Error("@chaibuilder/sdk is only supported in the browser. Avoid using it in the server side.");
|
|
18222
18229
|
export {
|
|
18223
|
-
|
|
18230
|
+
useActiveSettingsTab as $,
|
|
18224
18231
|
AddBlocksPanel as A,
|
|
18225
18232
|
BlockSettings as B,
|
|
18226
18233
|
CanvasArea as C,
|
|
18227
18234
|
DarkMode as D,
|
|
18228
18235
|
ExportCodeModal as E,
|
|
18229
|
-
|
|
18230
|
-
|
|
18231
|
-
|
|
18236
|
+
registerBlockSettingTemplate as F,
|
|
18237
|
+
registerBlockSettingWidget as G,
|
|
18238
|
+
registerChaiPreImportHTMLHook as H,
|
|
18232
18239
|
ImportHTML as I,
|
|
18233
|
-
|
|
18234
|
-
|
|
18235
|
-
|
|
18240
|
+
registerChaiLibrary as J,
|
|
18241
|
+
registerChaiMediaManager as K,
|
|
18242
|
+
LANGUAGES as L,
|
|
18236
18243
|
ManualClasses as M,
|
|
18237
18244
|
NestedPathSelector as N,
|
|
18238
|
-
|
|
18239
|
-
|
|
18240
|
-
|
|
18241
|
-
|
|
18242
|
-
|
|
18245
|
+
registerChaiSaveToLibrary as O,
|
|
18246
|
+
registerChaiSidebarPanel as P,
|
|
18247
|
+
registerChaiTopBar as Q,
|
|
18248
|
+
IfChaiFeatureFlag as R,
|
|
18249
|
+
registerChaiFeatureFlag as S,
|
|
18243
18250
|
ThemeConfigPanel as T,
|
|
18244
18251
|
UILibrariesPanel as U,
|
|
18245
|
-
|
|
18246
|
-
|
|
18247
|
-
|
|
18248
|
-
|
|
18249
|
-
|
|
18250
|
-
|
|
18252
|
+
registerChaiFeatureFlags as V,
|
|
18253
|
+
useChaiFeatureFlag as W,
|
|
18254
|
+
useChaiFeatureFlags as X,
|
|
18255
|
+
useToggleChaiFeatureFlag as Y,
|
|
18256
|
+
useMediaManagerComponent as Z,
|
|
18257
|
+
PERMISSIONS as _,
|
|
18251
18258
|
useSelectedBlockIds as a,
|
|
18252
|
-
|
|
18253
|
-
|
|
18254
|
-
|
|
18255
|
-
|
|
18256
|
-
|
|
18257
|
-
|
|
18258
|
-
|
|
18259
|
-
|
|
18260
|
-
|
|
18261
|
-
|
|
18262
|
-
|
|
18263
|
-
|
|
18264
|
-
|
|
18265
|
-
|
|
18266
|
-
|
|
18267
|
-
|
|
18268
|
-
|
|
18269
|
-
|
|
18270
|
-
|
|
18271
|
-
|
|
18272
|
-
|
|
18273
|
-
|
|
18274
|
-
|
|
18275
|
-
|
|
18276
|
-
|
|
18277
|
-
|
|
18278
|
-
|
|
18279
|
-
|
|
18280
|
-
|
|
18281
|
-
|
|
18282
|
-
|
|
18283
|
-
|
|
18284
|
-
|
|
18285
|
-
|
|
18286
|
-
|
|
18287
|
-
|
|
18288
|
-
|
|
18289
|
-
|
|
18290
|
-
|
|
18291
|
-
|
|
18292
|
-
|
|
18293
|
-
|
|
18294
|
-
|
|
18295
|
-
|
|
18296
|
-
|
|
18297
|
-
|
|
18298
|
-
|
|
18299
|
-
|
|
18300
|
-
|
|
18301
|
-
|
|
18302
|
-
|
|
18303
|
-
|
|
18304
|
-
|
|
18305
|
-
|
|
18306
|
-
|
|
18307
|
-
|
|
18308
|
-
|
|
18309
|
-
|
|
18259
|
+
useAddBlock as a0,
|
|
18260
|
+
useAddClassesToBlocks as a1,
|
|
18261
|
+
useAskAi as a2,
|
|
18262
|
+
useBlockHighlight as a3,
|
|
18263
|
+
useBlocksHtmlForAi as a4,
|
|
18264
|
+
useBrandingOptions as a5,
|
|
18265
|
+
useBuilderReset as a6,
|
|
18266
|
+
useCanvasZoom as a7,
|
|
18267
|
+
useCopyBlocks as a8,
|
|
18268
|
+
useCopyToClipboard as a9,
|
|
18269
|
+
useSelectedBreakpoints as aA,
|
|
18270
|
+
useSelectedStylingBlocks as aB,
|
|
18271
|
+
useStreamMultipleBlocksProps as aC,
|
|
18272
|
+
useStylingBreakpoint as aD,
|
|
18273
|
+
useStylingState as aE,
|
|
18274
|
+
useTheme as aF,
|
|
18275
|
+
useThemeOptions as aG,
|
|
18276
|
+
useUndoManager as aH,
|
|
18277
|
+
useWrapperBlock as aI,
|
|
18278
|
+
useBlocksStoreUndoableActions as aJ,
|
|
18279
|
+
useCanvasWidth as aK,
|
|
18280
|
+
useCanvasDisplayWidth as aL,
|
|
18281
|
+
useScreenSizeWidth as aM,
|
|
18282
|
+
useSelectedLibrary as aN,
|
|
18283
|
+
useSidebarActivePanel as aO,
|
|
18284
|
+
useCurrentPage as aa,
|
|
18285
|
+
useCutBlockIds as ab,
|
|
18286
|
+
useDarkMode as ac,
|
|
18287
|
+
useDuplicateBlocks as ad,
|
|
18288
|
+
useHighlightBlockId as ae,
|
|
18289
|
+
useHtmlToBlocks as af,
|
|
18290
|
+
useI18nBlocks as ag,
|
|
18291
|
+
useInlineEditing as ah,
|
|
18292
|
+
useIsPageLoaded as ai,
|
|
18293
|
+
useLibraryBlocks as aj,
|
|
18294
|
+
usePartialBlocksStore as ak,
|
|
18295
|
+
usePartialBlocksList as al,
|
|
18296
|
+
usePasteBlocks as am,
|
|
18297
|
+
usePermissions as an,
|
|
18298
|
+
usePreviewMode as ao,
|
|
18299
|
+
usePubSub as ap,
|
|
18300
|
+
useRemoveAllClassesForBlock as aq,
|
|
18301
|
+
useRemoveBlocks as ar,
|
|
18302
|
+
useRemoveClassesFromBlocks as as,
|
|
18303
|
+
useReplaceBlock as at,
|
|
18304
|
+
useResetBlockStyles as au,
|
|
18305
|
+
useRightPanel as av,
|
|
18306
|
+
useSelectedBlock as aw,
|
|
18307
|
+
useSelectedBlockAllClasses as ax,
|
|
18308
|
+
useSelectedBlockCurrentClasses as ay,
|
|
18309
|
+
useSelectedBlocksDisplayChild as az,
|
|
18310
|
+
useLanguages as b,
|
|
18311
|
+
useUpdateBlocksProps as c,
|
|
18312
|
+
useUpdateBlocksPropsRealtime as d,
|
|
18313
|
+
usePageExternalData as e,
|
|
18314
|
+
chaiDesignTokensAtom as f,
|
|
18315
|
+
useIncrementActionsCount as g,
|
|
18316
|
+
useBlocksStore as h,
|
|
18317
|
+
useBuilderProp as i,
|
|
18310
18318
|
useSavePage as j,
|
|
18311
18319
|
BlockStyling as k,
|
|
18312
|
-
|
|
18313
|
-
|
|
18314
|
-
|
|
18320
|
+
ListTree as l,
|
|
18321
|
+
AIUserPrompt as m,
|
|
18322
|
+
Breakpoints$1 as n,
|
|
18315
18323
|
orderClassesByBreakpoint as o,
|
|
18316
|
-
|
|
18317
|
-
|
|
18324
|
+
UndoRedo as p,
|
|
18325
|
+
ChaiBuilderEditor as q,
|
|
18318
18326
|
removeDuplicateClasses as r,
|
|
18319
|
-
|
|
18320
|
-
|
|
18327
|
+
AddBlocksDialog as s,
|
|
18328
|
+
BlockAttributesEditor as t,
|
|
18321
18329
|
useCodeEditor as u,
|
|
18322
|
-
|
|
18323
|
-
|
|
18324
|
-
|
|
18325
|
-
|
|
18326
|
-
|
|
18330
|
+
DefaultChaiBlocks as v,
|
|
18331
|
+
ChaiDraggableBlock as w,
|
|
18332
|
+
getClassValueAndUnit as x,
|
|
18333
|
+
registerChaiAddBlockTab as y,
|
|
18334
|
+
registerBlockSettingField as z
|
|
18327
18335
|
};
|