@chaibuilder/sdk 3.1.3 → 3.1.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/{code-editor-BpQxKJGQ.js → code-editor-BIKk8hmw.js} +1 -1
- package/dist/{code-editor-B5oshOO9.cjs → code-editor-DyPXY3uT.cjs} +1 -1
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +17 -1
- package/dist/core.js +86 -84
- package/dist/index-H7tjcODf.cjs +128 -0
- package/dist/{index-C9p-YGGl.js → index-lrl587-2.js} +1595 -1560
- package/dist/{rte-widget-modal-_UcsVj49.cjs → rte-widget-modal-CAUSWNvB.cjs} +1 -1
- package/dist/{rte-widget-modal-BFbI7jcA.js → rte-widget-modal-D4K_qgBv.js} +1 -1
- package/package.json +1 -1
- package/dist/index-Bcp30Thz.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-H7tjcODf.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-C2BCZ8Al.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-H7tjcODf.cjs"),s=require("./common-functions-BZmyleS1.cjs"),a=require("./apply-binding-CExho6DS.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.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.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.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.d.ts
CHANGED
|
@@ -38,6 +38,8 @@ declare type Breakpoint = {
|
|
|
38
38
|
width: number;
|
|
39
39
|
};
|
|
40
40
|
|
|
41
|
+
export declare type BreakpointName = "xs" | "sm" | "md" | "lg" | "xl" | "2xl";
|
|
42
|
+
|
|
41
43
|
export declare const ChaiAddBlocksDialog: () => JSX_2.Element;
|
|
42
44
|
|
|
43
45
|
export declare const ChaiAddBlocksPanel: ({ className, showHeading, parentId, position, }: {
|
|
@@ -267,6 +269,8 @@ export declare interface ChaiBuilderEditorProps {
|
|
|
267
269
|
flags?: {
|
|
268
270
|
librarySite?: boolean;
|
|
269
271
|
useClipboard?: boolean;
|
|
272
|
+
disableDarkmode?: boolean;
|
|
273
|
+
disableDataBinding?: boolean;
|
|
270
274
|
};
|
|
271
275
|
}
|
|
272
276
|
|
|
@@ -289,10 +293,11 @@ declare type ChaiCollectoin = {
|
|
|
289
293
|
|
|
290
294
|
export declare function ChaiDarkModeSwitcher(): JSX_2.Element;
|
|
291
295
|
|
|
292
|
-
export declare const ChaiDefaultBlocks: ({ parentId, position, gridCols, }: {
|
|
296
|
+
export declare const ChaiDefaultBlocks: ({ parentId, position, gridCols, disableBlockGroupsSidebar, }: {
|
|
293
297
|
parentId?: string;
|
|
294
298
|
position?: number;
|
|
295
299
|
gridCols?: string;
|
|
300
|
+
disableBlockGroupsSidebar?: boolean;
|
|
296
301
|
}) => JSX_2.Element;
|
|
297
302
|
|
|
298
303
|
declare type ChaiFlagOptions = {
|
|
@@ -439,6 +444,15 @@ declare const getBlocksFromHTML: (html: string) => ChaiBlock[];
|
|
|
439
444
|
export { getBlocksFromHTML as convertHTMLToChaiBlocks }
|
|
440
445
|
export { getBlocksFromHTML }
|
|
441
446
|
|
|
447
|
+
/**
|
|
448
|
+
* Get the value and unit for a tw class
|
|
449
|
+
* @param className
|
|
450
|
+
*/
|
|
451
|
+
export declare const getClassValueAndUnit: (className: string) => {
|
|
452
|
+
unit: string;
|
|
453
|
+
value: string;
|
|
454
|
+
};
|
|
455
|
+
|
|
442
456
|
declare type HexColor = string;
|
|
443
457
|
|
|
444
458
|
declare type HSLColor = string;
|
|
@@ -593,6 +607,8 @@ export declare const useBuilderReset: () => () => void;
|
|
|
593
607
|
|
|
594
608
|
export declare const useCanvasDisplayWidth: () => readonly [number, (args_0: number | RESET | ((prev: number) => number | RESET)) => void];
|
|
595
609
|
|
|
610
|
+
export declare const useCanvasWidth: () => readonly [number, BreakpointName];
|
|
611
|
+
|
|
596
612
|
/**
|
|
597
613
|
* Wrapper hook around useAtom
|
|
598
614
|
*/
|
package/dist/core.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { j as e, A 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 l, B as r, e as t, C as u, i as c, D as d, l as B, I as k, L as C, g as n, T as g, U as h, h as p, y as S, P as m, m as P, n as A, o as F, p as T, r as y, z as I, E as M, s as v, t as b, q as L, v as f, w as R, x as H, K as D, M as E, O as U, Q as x, R as W, S as O, az as w, V as z, W as j, X as q, aA as V, aC as Z, Y as G, F as J, G as K, u as N, Z as Q, _ as X, $ as Y, a0 as _, a1 as $, a2 as aa, a3 as sa, a4 as ea, a5 as ia, a6 as oa, a7 as la, a8 as ra, a9 as ta, J as ua, aa as ca, ab as da, ac as Ba, ad as ka, ae as Ca, af as na, ag as ga, ah as ha, ai as pa, aj as Sa, ak as ma, al as Pa, aB as Aa, am as Fa, an as Ta, ao as ya, a as Ia, ap as Ma, aq as va, aD as ba, ar as La, aE as fa, as as Ra, at as Ha, au as Da, av as Ea, aw as Ua, H as xa, ax as Wa, b as Oa, c as wa, ay as za } from "./index-lrl587-2.js";
|
|
2
|
+
import { g as qa, c as Va } from "./common-functions-BGzDsf1z.js";
|
|
3
|
+
import { h as Ga, h as Ja } from "./apply-binding-w7OMcHcu.js";
|
|
4
|
+
import { useTranslation as Na } from "react-i18next";
|
|
5
|
+
import { default as Xa } from "i18next";
|
|
6
6
|
export {
|
|
7
7
|
e as ChaiAddBlocksDialog,
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
i as ChaiAddBlocksPanel,
|
|
9
|
+
o as ChaiAskAiUserPrompt,
|
|
10
10
|
l as ChaiBlockAttributesEditor,
|
|
11
11
|
r as ChaiBlockPropsEditor,
|
|
12
12
|
t as ChaiBlockStyleEditor,
|
|
@@ -16,89 +16,91 @@ export {
|
|
|
16
16
|
B as ChaiDefaultBlocks,
|
|
17
17
|
k as ChaiImportHTML,
|
|
18
18
|
C as ChaiOutline,
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
n as ChaiScreenSizes,
|
|
20
|
+
g as ChaiThemeConfigPanel,
|
|
21
21
|
h as ChaiUILibrariesPanel,
|
|
22
22
|
p as ChaiUndoRedo,
|
|
23
23
|
S as IfChaiFeatureFlag,
|
|
24
24
|
m as PERMISSIONS,
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
25
|
+
Ga as convertHTMLToChaiBlocks,
|
|
26
|
+
qa as generateBlockId,
|
|
27
|
+
Ja as getBlocksFromHTML,
|
|
28
|
+
P as getClassValueAndUnit,
|
|
29
|
+
Xa as i18n,
|
|
30
|
+
Va as mergeClasses,
|
|
31
|
+
A as registerBlockSettingField,
|
|
31
32
|
F as registerBlockSettingTemplate,
|
|
32
33
|
T as registerBlockSettingWidget,
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
y as registerChaiAddBlockTab,
|
|
35
|
+
I as registerChaiFeatureFlag,
|
|
36
|
+
M as registerChaiFeatureFlags,
|
|
37
|
+
v as registerChaiLibrary,
|
|
37
38
|
b as registerChaiMediaManager,
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
39
|
+
L as registerChaiPreImportHTMLHook,
|
|
40
|
+
f as registerChaiSaveToLibrary,
|
|
41
|
+
R as registerChaiSidebarPanel,
|
|
42
|
+
H as registerChaiTopBar,
|
|
43
|
+
D as useAddBlock,
|
|
44
|
+
E as useAddClassesToBlocks,
|
|
45
|
+
U as useAskAi,
|
|
46
|
+
x as useBlockHighlight,
|
|
47
|
+
W as useBlocksHtmlForAi,
|
|
47
48
|
O as useBlocksStore,
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
Z as
|
|
54
|
-
G as
|
|
55
|
-
J as
|
|
56
|
-
K as
|
|
57
|
-
N as
|
|
58
|
-
Q as
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
oa as
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
ga as
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
Fa as
|
|
86
|
-
Ta as
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
ba as
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
Oa as
|
|
103
|
-
|
|
49
|
+
w as useBlocksStoreUndoableActions,
|
|
50
|
+
z as useBrandingOptions,
|
|
51
|
+
j as useBuilderProp,
|
|
52
|
+
q as useBuilderReset,
|
|
53
|
+
V as useCanvasDisplayWidth,
|
|
54
|
+
Z as useCanvasWidth,
|
|
55
|
+
G as useCanvasZoom,
|
|
56
|
+
J as useChaiFeatureFlag,
|
|
57
|
+
K as useChaiFeatureFlags,
|
|
58
|
+
N as useCodeEditor,
|
|
59
|
+
Q as useCopyBlockIds,
|
|
60
|
+
X as useCopyToClipboard,
|
|
61
|
+
Y as useCurrentPage,
|
|
62
|
+
_ as useCutBlockIds,
|
|
63
|
+
$ as useDarkMode,
|
|
64
|
+
aa as useDuplicateBlocks,
|
|
65
|
+
sa as useHighlightBlockId,
|
|
66
|
+
ea as useHtmlToBlocks,
|
|
67
|
+
ia as useI18nBlocks,
|
|
68
|
+
oa as useInlineEditing,
|
|
69
|
+
la as useIsPageLoaded,
|
|
70
|
+
ra as useLanguages,
|
|
71
|
+
ta as useLibraryBlocks,
|
|
72
|
+
ua as useMediaManagerComponent,
|
|
73
|
+
ca as usePartailBlocksStore,
|
|
74
|
+
da as usePartialBlocksList,
|
|
75
|
+
Ba as usePasteBlocks,
|
|
76
|
+
ka as usePermissions,
|
|
77
|
+
Ca as usePreviewMode,
|
|
78
|
+
na as useRemoveAllClassesForBlock,
|
|
79
|
+
ga as useRemoveBlocks,
|
|
80
|
+
ha as useRemoveClassesFromBlocks,
|
|
81
|
+
pa as useReplaceBlock,
|
|
82
|
+
Sa as useResetBlockStyles,
|
|
83
|
+
ma as useRightPanel,
|
|
84
|
+
Pa as useSavePage,
|
|
85
|
+
Aa as useScreenSizeWidth,
|
|
86
|
+
Fa as useSelectedBlock,
|
|
87
|
+
Ta as useSelectedBlockAllClasses,
|
|
88
|
+
ya as useSelectedBlockCurrentClasses,
|
|
89
|
+
Ia as useSelectedBlockIds,
|
|
90
|
+
Ma as useSelectedBlocksDisplayChild,
|
|
91
|
+
va as useSelectedBreakpoints,
|
|
92
|
+
ba as useSelectedLibrary,
|
|
93
|
+
La as useSelectedStylingBlocks,
|
|
94
|
+
fa as useSidebarActivePanel,
|
|
95
|
+
Ra as useStreamMultipleBlocksProps,
|
|
96
|
+
Ha as useStylingBreakpoint,
|
|
97
|
+
Da as useStylingState,
|
|
98
|
+
Ea as useTheme,
|
|
99
|
+
Ua as useThemeOptions,
|
|
100
|
+
xa as useToggleChaiFeatureFlag,
|
|
101
|
+
Na as useTranslation,
|
|
102
|
+
Wa as useUndoManager,
|
|
103
|
+
Oa as useUpdateBlocksProps,
|
|
104
|
+
wa as useUpdateBlocksPropsRealtime,
|
|
105
|
+
za as useWrapperBlock
|
|
104
106
|
};
|