@chaibuilder/sdk 3.0.26 → 3.0.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/IconPicker-BWE43eMO.cjs +1 -0
- package/dist/IconPicker-CluS-5Mv.js +64 -0
- package/dist/{code-editor-CuilXtvr.cjs → code-editor-B0zk9FXR.cjs} +1 -1
- package/dist/{code-editor-DcA8_k1c.js → code-editor-H0MQ5vzI.js} +1 -1
- package/dist/core.cjs +1 -1
- package/dist/core.js +1 -1
- package/dist/{index-CqT7UFjI.js → index-B9XD9X3W.js} +8 -5
- package/dist/index-CcmtMRO-.cjs +128 -0
- package/dist/{rte-widget-modal-CtBOYzKl.cjs → rte-widget-modal-DaEpcuOz.cjs} +1 -1
- package/dist/{rte-widget-modal-BdsHiL3Q.js → rte-widget-modal-HU1ZwziZ.js} +1 -1
- package/package.json +2 -1
- package/dist/index-u0fTC0qG.cjs +0 -128
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),c=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),c=require("./index-CcmtMRO-.cjs");require("lodash-es");require("clsx");require("tailwind-merge");require("tree-model");const i=require("react");require("jotai");require("@chaibuilder/runtime");require("sonner");const q=require("react-i18next"),r=require("./tooltip-CzZ7Fvt7.cjs"),g=require("@react-hookz/web"),m=n=>{const s=document.createElement("div");return s.innerHTML=n,s.innerHTML};function j(){const{t:n}=q.useTranslation(),[s,h]=i.useState(!1),[a,p]=i.useState(""),[t,d]=c.useCodeEditor(),[u]=c.useSelectedBlockIds(),b=c.useUpdateBlocksProps(),f=c.useUpdateBlocksPropsRealtime(),C=g.useThrottledCallback(o=>{const l=m(o);f([t.blockId],{[t.blockProp]:l})},[],300),x=i.useCallback(()=>{if(s){const o=m(a);b([t.blockId],{[t.blockProp]:o})}},[s,a]);i.useEffect(()=>{u.includes(t==null?void 0:t.blockId)||(x(),d(null))},[u]);const k=()=>{x(),d(null)};return e.jsx(r.Dialog,{open:!0,onOpenChange:k,children:e.jsxs(r.DialogContent,{className:"flex max-h-[400px] min-h-[200px] max-w-4xl flex-col border-gray-700 text-black",children:[e.jsx(r.DialogHeader,{className:"shrink-0 border-b border-gray-700 pb-3",children:e.jsx(r.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:n("HTML Code Editor |")}),e.jsx("span",{className:"text-xs text-gray-400",children:n("Scripts will be only executed in preview and live mode.")})]})})}),e.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:e.jsx(r.Textarea,{className:"h-full w-full resize-none font-mono text-xs",value:a||t.initialCode,onChange:o=>{const l=o.target.value;h(!0),p(l),C(l)},rows:10,placeholder:"Enter your code here..."})})]})})}exports.default=j;
|
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-CcmtMRO-.cjs"),s=require("./common-functions-BZmyleS1.cjs"),a=require("./apply-binding-BIYK6lOq.cjs"),i=require("react-i18next"),r=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.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.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.useAddBlock=e.useAddBlock;exports.useAddClassesToBlocks=e.useAddClassesToBlocks;exports.useAskAi=e.useAskAi;exports.useBlockHighlight=e.useBlockHighlight;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.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.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.useRemoveAllClassesForBlock=e.useRemoveAllClassesForBlock;exports.useRemoveBlocks=e.useRemoveBlocks;exports.useRemoveClassesFromBlocks=e.useRemoveClassesFromBlocks;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.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=r;
|
package/dist/core.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { j as e, A as i, f as o, k as r, B as l, e as t, C as u, i as d, D as c, l as g, I as C, L as k, g as n, T as B, U as h, h as S, x as p, P as m, m as P, n as F, o as T, r as A, y, z as I, q as M, s as b, p as v, t as L, v as f, w as R, J as D, K as E, M as H, O as U, Q as x, at as O, R as W, S as w, V as z, au as j, W as q, E as Z, F as G, u as J, X as K, Y as N, Z as Q, _ as V, $ as X, a0 as Y, a1 as _, a2 as $, a3 as aa, a4 as sa, a5 as ea, H as ia, a6 as oa, a7 as ra, a8 as la, a9 as ta, aa as ua, ab as da, ac as ca, ad as ga, ae as Ca, af as ka, ag as na, av as Ba, ah as ha, ai as Sa, aj as pa, a as ma, ak as Pa, al as Fa, aw as Ta, am as Aa, ax as ya, an as Ia, ao as Ma, ap as ba, aq as va, G as La, ar as fa, b as Ra, c as Da, as as Ea } from "./index-
|
|
1
|
+
import { j as e, A as i, f as o, k as r, B as l, e as t, C as u, i as d, D as c, l as g, I as C, L as k, g as n, T as B, U as h, h as S, x as p, P as m, m as P, n as F, o as T, r as A, y, z as I, q as M, s as b, p as v, t as L, v as f, w as R, J as D, K as E, M as H, O as U, Q as x, at as O, R as W, S as w, V as z, au as j, W as q, E as Z, F as G, u as J, X as K, Y as N, Z as Q, _ as V, $ as X, a0 as Y, a1 as _, a2 as $, a3 as aa, a4 as sa, a5 as ea, H as ia, a6 as oa, a7 as ra, a8 as la, a9 as ta, aa as ua, ab as da, ac as ca, ad as ga, ae as Ca, af as ka, ag as na, av as Ba, ah as ha, ai as Sa, aj as pa, a as ma, ak as Pa, al as Fa, aw as Ta, am as Aa, ax as ya, an as Ia, ao as Ma, ap as ba, aq as va, G as La, ar as fa, b as Ra, c as Da, as as Ea } from "./index-B9XD9X3W.js";
|
|
2
2
|
import { g as Ua, c as xa } from "./common-functions-BGzDsf1z.js";
|
|
3
3
|
import { h as Wa, h as wa } from "./apply-binding-YbVf4970.js";
|
|
4
4
|
import { useTranslation as ja } from "react-i18next";
|
|
@@ -3048,7 +3048,7 @@ const INLINE_EDITABLE_BLOCKS = ["Heading", "Paragraph", "Text", "Link", "Span",
|
|
|
3048
3048
|
<head>
|
|
3049
3049
|
<meta charset="UTF-8">
|
|
3050
3050
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
3051
|
-
<script src="https://cdn.tailwindcss.com/3.4.
|
|
3051
|
+
<script src="https://cdn.tailwindcss.com/3.4.17?plugins=forms@0.5.9,typography@0.5.15,aspect-ratio@0.4.2"><\/script>
|
|
3052
3052
|
<style>
|
|
3053
3053
|
html { height: 100%; overflow:auto; }
|
|
3054
3054
|
body { height: 100%; }
|
|
@@ -4327,7 +4327,7 @@ const CanvasEventsWatcher = () => {
|
|
|
4327
4327
|
/* @__PURE__ */ jsx("p", { className: "font-semibold", children: o("Oops! Something went wrong.") }),
|
|
4328
4328
|
/* @__PURE__ */ jsx("p", { children: o("Please try again.") })
|
|
4329
4329
|
] }) });
|
|
4330
|
-
}, CodeEditor$1 = React__default.lazy(() => import("./code-editor-
|
|
4330
|
+
}, CodeEditor$1 = React__default.lazy(() => import("./code-editor-H0MQ5vzI.js")), CanvasArea = () => {
|
|
4331
4331
|
const [o] = useCodeEditor(), n = useBuilderProp("onError", noop);
|
|
4332
4332
|
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: [
|
|
4333
4333
|
/* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Skeleton, { className: "h-full" }), children: /* @__PURE__ */ jsx(ErrorBoundary, { fallback: /* @__PURE__ */ jsx(FallbackError, {}), onError: n, children: /* @__PURE__ */ jsx(StaticCanvas, {}) }) }),
|
|
@@ -4355,7 +4355,7 @@ const CanvasEventsWatcher = () => {
|
|
|
4355
4355
|
}, useBlockSettingComponents = (o) => Object.values(RJSF_EXTENSIONS).filter((n) => n.type === o).reduce(
|
|
4356
4356
|
(n, r) => (n[r.id] = r.component, n),
|
|
4357
4357
|
{}
|
|
4358
|
-
), sanitizeSvg = (o) => {
|
|
4358
|
+
), IconPicker = lazy(() => import("./IconPicker-CluS-5Mv.js").then((o) => ({ default: o.IconPicker }))), sanitizeSvg = (o) => {
|
|
4359
4359
|
try {
|
|
4360
4360
|
let n = o.replace(/<svg([^>]*)\sheight="[^"]*"([^>]*)>/gi, "<svg$1$2>").replace(/<svg([^>]*)\swidth="[^"]*"([^>]*)>/gi, "<svg$1$2>");
|
|
4361
4361
|
return n = n.replace(/>\s+</g, "><"), n = n.replace(/\n/g, "").replace(/\s{2,}/g, " "), n = n.replace(/\s+=/g, "=").replace(/=\s+/g, "="), n = n.replace(/<!--[\s\S]*?-->/g, ""), n.trim();
|
|
@@ -4390,7 +4390,10 @@ const CanvasEventsWatcher = () => {
|
|
|
4390
4390
|
}
|
|
4391
4391
|
)
|
|
4392
4392
|
] }),
|
|
4393
|
-
/* @__PURE__ */
|
|
4393
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
4394
|
+
/* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx("div", { className: "text-xs text-muted-foreground", children: "Loading..." }), children: /* @__PURE__ */ jsx(IconPicker, { onSelectIcon: c }) }),
|
|
4395
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: a("Paste SVG_code") })
|
|
4396
|
+
] })
|
|
4394
4397
|
] });
|
|
4395
4398
|
}, DefaultMediaManager = ({ close: o, onSelect: n, mode: r = "image" }) => {
|
|
4396
4399
|
const [a, l] = useState(""), [i, c] = useState(!1), [d, p] = useState(!1), [u, g] = useState(null), m = async (f) => {
|
|
@@ -4894,7 +4897,7 @@ const DataBindingSelector = ({
|
|
|
4894
4897
|
]
|
|
4895
4898
|
}
|
|
4896
4899
|
) });
|
|
4897
|
-
}, RTEModal = React__default.lazy(() => import("./rte-widget-modal-
|
|
4900
|
+
}, RTEModal = React__default.lazy(() => import("./rte-widget-modal-HU1ZwziZ.js")), RichTextEditorFieldComp = ({ blockId: o, id: n, placeholder: r, value: a, onChange: l, onBlur: i }) => {
|
|
4898
4901
|
const c = useRef(null), [d, p] = useState(!1), u = useRTEditor({
|
|
4899
4902
|
blockId: o,
|
|
4900
4903
|
value: a,
|