@chaibuilder/sdk 3.0.27 → 3.0.28
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-B0zk9FXR.cjs → code-editor-D9Lla5Lr.cjs} +1 -1
- package/dist/{code-editor-H0MQ5vzI.js → code-editor-DmN41-qr.js} +1 -1
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +2 -0
- package/dist/core.js +40 -39
- package/dist/{index-CcmtMRO-.cjs → index-BtVNiUIw.cjs} +2 -2
- package/dist/{index-B9XD9X3W.js → index-Ct0lOt4c.js} +41 -22
- package/dist/{rte-widget-modal-DaEpcuOz.cjs → rte-widget-modal-DzEtNny0.cjs} +1 -1
- package/dist/{rte-widget-modal-HU1ZwziZ.js → rte-widget-modal-jYxk5Q4W.js} +1 -1
- package/package.json +1 -1
|
@@ -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-BtVNiUIw.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-BtVNiUIw.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.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.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.d.ts
CHANGED
|
@@ -687,6 +687,8 @@ export declare const useRemoveBlocks: () => (blockIds: Array<string>) => void;
|
|
|
687
687
|
|
|
688
688
|
export declare const useRemoveClassesFromBlocks: () => Function;
|
|
689
689
|
|
|
690
|
+
export declare const useReplaceBlock: () => (blockId: string, replacementBlocks: ChaiBlock[]) => void;
|
|
691
|
+
|
|
690
692
|
/**
|
|
691
693
|
* useResetBlockStyles
|
|
692
694
|
*
|
package/dist/core.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
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
|
|
2
|
-
import { g as
|
|
3
|
-
import { h as
|
|
4
|
-
import { useTranslation as
|
|
5
|
-
import { default as
|
|
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 c, D as d, l as g, I as C, L as k, g as B, T as n, U as h, h as S, x as p, P as m, m as P, n as F, o as T, r as y, y as A, 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, au as O, R as W, S as w, V as z, av 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 ca, ac as da, ad as ga, ae as Ca, af as ka, ag as Ba, ah as na, aw as ha, ai as Sa, aj as pa, ak as ma, a as Pa, al as Fa, am as Ta, ax as ya, an as Aa, ay as Ia, ao as Ma, ap as ba, aq as va, ar as La, G as fa, as as Ra, b as Da, c as Ea, at as Ha } from "./index-Ct0lOt4c.js";
|
|
2
|
+
import { g as xa, c as Oa } from "./common-functions-BGzDsf1z.js";
|
|
3
|
+
import { h as wa, h as za } from "./apply-binding-YbVf4970.js";
|
|
4
|
+
import { useTranslation as qa } from "react-i18next";
|
|
5
|
+
import { default as Ga } from "i18next";
|
|
6
6
|
export {
|
|
7
7
|
e as ChaiAddBlocksDialog,
|
|
8
8
|
i as ChaiAddBlocksPanel,
|
|
@@ -11,27 +11,27 @@ export {
|
|
|
11
11
|
l as ChaiBlockPropsEditor,
|
|
12
12
|
t as ChaiBlockStyleEditor,
|
|
13
13
|
u as ChaiBuilderCanvas,
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
c as ChaiBuilderEditor,
|
|
15
|
+
d as ChaiDarkModeSwitcher,
|
|
16
16
|
g as ChaiDefaultBlocks,
|
|
17
17
|
C as ChaiImportHTML,
|
|
18
18
|
k as ChaiOutline,
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
B as ChaiScreenSizes,
|
|
20
|
+
n as ChaiThemeConfigPanel,
|
|
21
21
|
h as ChaiUILibrariesPanel,
|
|
22
22
|
S as ChaiUndoRedo,
|
|
23
23
|
p as IfChaiFeatureFlag,
|
|
24
24
|
m as PERMISSIONS,
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
wa as convertHTMLToChaiBlocks,
|
|
26
|
+
xa as generateBlockId,
|
|
27
|
+
za as getBlocksFromHTML,
|
|
28
|
+
Ga as i18n,
|
|
29
|
+
Oa as mergeClasses,
|
|
30
30
|
P as registerBlockSettingField,
|
|
31
31
|
F as registerBlockSettingTemplate,
|
|
32
32
|
T as registerBlockSettingWidget,
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
y as registerChaiAddBlockTab,
|
|
34
|
+
A as registerChaiFeatureFlag,
|
|
35
35
|
I as registerChaiFeatureFlags,
|
|
36
36
|
M as registerChaiLibrary,
|
|
37
37
|
b as registerChaiMediaManager,
|
|
@@ -70,30 +70,31 @@ export {
|
|
|
70
70
|
la as usePasteBlocks,
|
|
71
71
|
ta as usePermissions,
|
|
72
72
|
ua as usePreviewMode,
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
ca as useRemoveAllClassesForBlock,
|
|
74
|
+
da as useRemoveBlocks,
|
|
75
75
|
ga as useRemoveClassesFromBlocks,
|
|
76
|
-
Ca as
|
|
77
|
-
ka as
|
|
76
|
+
Ca as useReplaceBlock,
|
|
77
|
+
ka as useResetBlockStyles,
|
|
78
|
+
Ba as useRightPanel,
|
|
78
79
|
na as useSavePage,
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
80
|
+
ha as useScreenSizeWidth,
|
|
81
|
+
Sa as useSelectedBlock,
|
|
82
|
+
pa as useSelectedBlockAllClasses,
|
|
83
|
+
ma as useSelectedBlockCurrentClasses,
|
|
84
|
+
Pa as useSelectedBlockIds,
|
|
85
|
+
Fa as useSelectedBlocksDisplayChild,
|
|
86
|
+
Ta as useSelectedBreakpoints,
|
|
87
|
+
ya as useSelectedLibrary,
|
|
87
88
|
Aa as useSelectedStylingBlocks,
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
89
|
+
Ia as useSidebarActivePanel,
|
|
90
|
+
Ma as useStylingBreakpoint,
|
|
91
|
+
ba as useStylingState,
|
|
92
|
+
va as useTheme,
|
|
93
|
+
La as useThemeOptions,
|
|
94
|
+
fa as useToggleChaiFeatureFlag,
|
|
95
|
+
qa as useTranslation,
|
|
96
|
+
Ra as useUndoManager,
|
|
97
|
+
Da as useUpdateBlocksProps,
|
|
98
|
+
Ea as useUpdateBlocksPropsRealtime,
|
|
99
|
+
Ha as useWrapperBlock
|
|
99
100
|
};
|