@chaibuilder/sdk 3.1.4 → 3.1.6
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-display-BJJV-nKI.js +64 -0
- package/dist/code-display-BcpLta9W.cjs +1 -0
- package/dist/{code-editor-DyPXY3uT.cjs → code-editor-BdEoZFSV.cjs} +1 -1
- package/dist/{code-editor-BIKk8hmw.js → code-editor-DhTHKGK0.js} +1 -1
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +29 -26
- package/dist/core.js +87 -85
- package/dist/get-chai-builder-tailwind-config-BqaIvg8p.js +74 -0
- package/dist/get-chai-builder-tailwind-config-C6MHaUM0.cjs +1 -0
- package/dist/{index-lrl587-2.js → index-CDJhqQK5.js} +1393 -1084
- package/dist/index-CooHzimL.cjs +151 -0
- package/dist/render.d.ts +2 -2
- package/dist/{rte-widget-modal-CAUSWNvB.cjs → rte-widget-modal-6RqYZqbC.cjs} +1 -1
- package/dist/{rte-widget-modal-D4K_qgBv.js → rte-widget-modal-BK6-O4Rv.js} +1 -1
- package/dist/tailwind.cjs +1 -1
- package/dist/tailwind.js +6 -75
- package/dist/ui.d.ts +13 -13
- package/package.json +5 -4
- package/dist/index-H7tjcODf.cjs +0 -128
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { jsxs as o, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { v as l } from "./tooltip-4-b9QGDK.js";
|
|
3
|
+
import m from "@monaco-editor/react";
|
|
4
|
+
import { CheckIcon as h, CopyIcon as C, DownloadIcon as y } from "@radix-ui/react-icons";
|
|
5
|
+
import { useState as s } from "react";
|
|
6
|
+
function N({
|
|
7
|
+
code: r,
|
|
8
|
+
onCopy: d,
|
|
9
|
+
language: a = "javascript",
|
|
10
|
+
onDownload: c,
|
|
11
|
+
downloadText: p = "Download"
|
|
12
|
+
}) {
|
|
13
|
+
const [n, i] = s(!1), [t, f] = s(r);
|
|
14
|
+
return /* @__PURE__ */ o("div", { className: "flex flex-col gap-4", children: [
|
|
15
|
+
/* @__PURE__ */ e("div", { className: "h-[500px] max-h-full overflow-hidden rounded-md border py-2", children: /* @__PURE__ */ e(
|
|
16
|
+
m,
|
|
17
|
+
{
|
|
18
|
+
height: "100%",
|
|
19
|
+
defaultLanguage: a,
|
|
20
|
+
language: a,
|
|
21
|
+
value: t,
|
|
22
|
+
onChange: (u) => f(u || ""),
|
|
23
|
+
theme: "vs-light",
|
|
24
|
+
options: {
|
|
25
|
+
minimap: { enabled: !1 },
|
|
26
|
+
fontSize: 12,
|
|
27
|
+
lineNumbers: "off",
|
|
28
|
+
roundedSelection: !1,
|
|
29
|
+
scrollBeyondLastLine: !1,
|
|
30
|
+
automaticLayout: !0,
|
|
31
|
+
tabSize: 2,
|
|
32
|
+
insertSpaces: !0,
|
|
33
|
+
wordWrap: "on",
|
|
34
|
+
bracketPairColorization: { enabled: !0 },
|
|
35
|
+
suggest: {
|
|
36
|
+
showKeywords: !1,
|
|
37
|
+
showSnippets: !1
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
) }),
|
|
42
|
+
/* @__PURE__ */ o("div", { className: "flex justify-end gap-2", children: [
|
|
43
|
+
/* @__PURE__ */ o(l, { type: "button", variant: "outline", onClick: () => {
|
|
44
|
+
d(t), i(!0), setTimeout(() => {
|
|
45
|
+
i(!1);
|
|
46
|
+
}, 2e3);
|
|
47
|
+
}, children: [
|
|
48
|
+
n ? /* @__PURE__ */ e(h, { className: "text-green-500" }) : /* @__PURE__ */ e(C, {}),
|
|
49
|
+
" ",
|
|
50
|
+
n ? "Copied" : "Copy"
|
|
51
|
+
] }),
|
|
52
|
+
/* @__PURE__ */ o(l, { type: "button", onClick: () => {
|
|
53
|
+
c(t);
|
|
54
|
+
}, children: [
|
|
55
|
+
/* @__PURE__ */ e(y, {}),
|
|
56
|
+
" ",
|
|
57
|
+
p
|
|
58
|
+
] })
|
|
59
|
+
] })
|
|
60
|
+
] });
|
|
61
|
+
}
|
|
62
|
+
export {
|
|
63
|
+
N as default
|
|
64
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),i=require("./tooltip-C2BCZ8Al.cjs"),m=require("@monaco-editor/react"),o=require("@radix-ui/react-icons"),l=require("react");function j({code:r,onCopy:d,language:s="javascript",onDownload:c,downloadText:u="Download"}){const[n,a]=l.useState(!1),[t,p]=l.useState(r),f=()=>{d(t),a(!0),setTimeout(()=>{a(!1)},2e3)},h=()=>{c(t)};return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx("div",{className:"h-[500px] max-h-full overflow-hidden rounded-md border py-2",children:e.jsx(m,{height:"100%",defaultLanguage:s,language:s,value:t,onChange:x=>p(x||""),theme:"vs-light",options:{minimap:{enabled:!1},fontSize:12,lineNumbers:"off",roundedSelection:!1,scrollBeyondLastLine:!1,automaticLayout:!0,tabSize:2,insertSpaces:!0,wordWrap:"on",bracketPairColorization:{enabled:!0},suggest:{showKeywords:!1,showSnippets:!1}}})}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsxs(i.Button,{type:"button",variant:"outline",onClick:f,children:[n?e.jsx(o.CheckIcon,{className:"text-green-500"}):e.jsx(o.CopyIcon,{})," ",n?"Copied":"Copy"]}),e.jsxs(i.Button,{type:"button",onClick:h,children:[e.jsx(o.DownloadIcon,{})," ",u]})]})]})}exports.default=j;
|
|
@@ -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-CooHzimL.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-CooHzimL.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.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.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.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { ClassValue } from 'clsx';
|
|
|
2
2
|
import { ComponentType } from 'react';
|
|
3
3
|
import { default as default_2 } from 'react';
|
|
4
4
|
import { default as i18n } from 'i18next';
|
|
5
|
-
import { JSX
|
|
5
|
+
import { JSX } from 'react/jsx-runtime';
|
|
6
6
|
import * as React_2 from 'react';
|
|
7
7
|
import { ReactNode } from 'react';
|
|
8
8
|
import { RESET } from 'jotai/utils';
|
|
@@ -40,18 +40,18 @@ declare type Breakpoint = {
|
|
|
40
40
|
|
|
41
41
|
export declare type BreakpointName = "xs" | "sm" | "md" | "lg" | "xl" | "2xl";
|
|
42
42
|
|
|
43
|
-
export declare const ChaiAddBlocksDialog: () =>
|
|
43
|
+
export declare const ChaiAddBlocksDialog: () => JSX.Element;
|
|
44
44
|
|
|
45
45
|
export declare const ChaiAddBlocksPanel: ({ className, showHeading, parentId, position, }: {
|
|
46
46
|
parentId?: string;
|
|
47
47
|
showHeading?: boolean;
|
|
48
48
|
className?: string;
|
|
49
49
|
position?: number;
|
|
50
|
-
}) =>
|
|
50
|
+
}) => JSX.Element;
|
|
51
51
|
|
|
52
52
|
export declare const ChaiAskAiUserPrompt: ({ blockId }: {
|
|
53
53
|
blockId: string | undefined;
|
|
54
|
-
}) =>
|
|
54
|
+
}) => JSX.Element;
|
|
55
55
|
|
|
56
56
|
declare type ChaiAsset = {
|
|
57
57
|
url: string;
|
|
@@ -81,15 +81,15 @@ declare type ChaiBlock_2<T = Record<string, any>> = {
|
|
|
81
81
|
_partialBlockId?: string;
|
|
82
82
|
} & T;
|
|
83
83
|
|
|
84
|
-
export declare const ChaiBlockAttributesEditor: React_2.MemoExoticComponent<() =>
|
|
84
|
+
export declare const ChaiBlockAttributesEditor: React_2.MemoExoticComponent<() => JSX.Element>;
|
|
85
85
|
|
|
86
86
|
/**
|
|
87
87
|
*
|
|
88
88
|
* @returns Block Setting
|
|
89
89
|
*/
|
|
90
|
-
export declare function ChaiBlockPropsEditor():
|
|
90
|
+
export declare function ChaiBlockPropsEditor(): JSX.Element;
|
|
91
91
|
|
|
92
|
-
export declare function ChaiBlockStyleEditor():
|
|
92
|
+
export declare function ChaiBlockStyleEditor(): JSX.Element;
|
|
93
93
|
|
|
94
94
|
export declare const ChaiBuilderCanvas: default_2.FC;
|
|
95
95
|
|
|
@@ -191,14 +191,6 @@ export declare interface ChaiBuilderEditorProps {
|
|
|
191
191
|
* Locale
|
|
192
192
|
*/
|
|
193
193
|
locale?: string;
|
|
194
|
-
/**
|
|
195
|
-
* Dark mode
|
|
196
|
-
*/
|
|
197
|
-
darkMode?: boolean;
|
|
198
|
-
/**
|
|
199
|
-
* Import HTML support
|
|
200
|
-
*/
|
|
201
|
-
importHTMLSupport?: boolean;
|
|
202
194
|
/**
|
|
203
195
|
* Ask AI callback
|
|
204
196
|
*/
|
|
@@ -268,9 +260,12 @@ export declare interface ChaiBuilderEditorProps {
|
|
|
268
260
|
*/
|
|
269
261
|
flags?: {
|
|
270
262
|
librarySite?: boolean;
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
263
|
+
copyPaste?: boolean;
|
|
264
|
+
exportCode?: boolean;
|
|
265
|
+
darkMode?: boolean;
|
|
266
|
+
dataBinding?: boolean;
|
|
267
|
+
importHtml?: boolean;
|
|
268
|
+
importTheme?: boolean;
|
|
274
269
|
};
|
|
275
270
|
}
|
|
276
271
|
|
|
@@ -291,14 +286,16 @@ declare type ChaiCollectoin = {
|
|
|
291
286
|
sorts?: SortOptions[];
|
|
292
287
|
};
|
|
293
288
|
|
|
294
|
-
export declare function ChaiDarkModeSwitcher():
|
|
289
|
+
export declare function ChaiDarkModeSwitcher(): JSX.Element;
|
|
295
290
|
|
|
296
291
|
export declare const ChaiDefaultBlocks: ({ parentId, position, gridCols, disableBlockGroupsSidebar, }: {
|
|
297
292
|
parentId?: string;
|
|
298
293
|
position?: number;
|
|
299
294
|
gridCols?: string;
|
|
300
295
|
disableBlockGroupsSidebar?: boolean;
|
|
301
|
-
}) =>
|
|
296
|
+
}) => JSX.Element;
|
|
297
|
+
|
|
298
|
+
export declare const ChaiExportCodeModal: () => JSX.Element;
|
|
302
299
|
|
|
303
300
|
declare type ChaiFlagOptions = {
|
|
304
301
|
key: string;
|
|
@@ -309,7 +306,7 @@ declare type ChaiFlagOptions = {
|
|
|
309
306
|
export declare const ChaiImportHTML: ({ parentId, position }: {
|
|
310
307
|
parentId?: string;
|
|
311
308
|
position?: number;
|
|
312
|
-
}) =>
|
|
309
|
+
}) => JSX.Element;
|
|
313
310
|
|
|
314
311
|
export declare type ChaiLibrary<T = Record<string, any>> = {
|
|
315
312
|
id: string;
|
|
@@ -338,13 +335,13 @@ declare type ChaiLibraryConfig<T> = {
|
|
|
338
335
|
}) => Promise<HTMLString | ChaiBlock_2[]>;
|
|
339
336
|
};
|
|
340
337
|
|
|
341
|
-
export declare const ChaiOutline: () =>
|
|
338
|
+
export declare const ChaiOutline: () => JSX.Element;
|
|
342
339
|
|
|
343
340
|
export declare const ChaiScreenSizes: ({ openDelay, canvas, tooltip, }: {
|
|
344
341
|
openDelay?: number;
|
|
345
342
|
canvas?: boolean;
|
|
346
343
|
tooltip?: boolean;
|
|
347
|
-
}) =>
|
|
344
|
+
}) => JSX.Element;
|
|
348
345
|
|
|
349
346
|
export declare interface ChaiSidebarPanel {
|
|
350
347
|
id: string;
|
|
@@ -398,9 +395,9 @@ export declare type ChaiThemeValues = {
|
|
|
398
395
|
export declare const ChaiUILibrariesPanel: ({ parentId, position }: {
|
|
399
396
|
parentId?: string;
|
|
400
397
|
position?: number;
|
|
401
|
-
}) =>
|
|
398
|
+
}) => JSX.Element;
|
|
402
399
|
|
|
403
|
-
export declare const ChaiUndoRedo: () =>
|
|
400
|
+
export declare const ChaiUndoRedo: () => JSX.Element;
|
|
404
401
|
|
|
405
402
|
declare type ClassDerivedObject = {
|
|
406
403
|
cls: string;
|
|
@@ -475,6 +472,10 @@ declare type MediaManagerProps = {
|
|
|
475
472
|
|
|
476
473
|
export declare const mergeClasses: (...inputs: ClassValue[]) => string;
|
|
477
474
|
|
|
475
|
+
declare type Options = {
|
|
476
|
+
EXTRA_CORE_BLOCKS?: string[];
|
|
477
|
+
};
|
|
478
|
+
|
|
478
479
|
declare type PageType = {
|
|
479
480
|
key: string;
|
|
480
481
|
name: string;
|
|
@@ -580,7 +581,7 @@ export declare const useBlockHighlight: () => {
|
|
|
580
581
|
lastHighlighted: HTMLElement;
|
|
581
582
|
};
|
|
582
583
|
|
|
583
|
-
export declare const useBlocksHtmlForAi: () => () => any;
|
|
584
|
+
export declare const useBlocksHtmlForAi: () => (options?: Options) => any;
|
|
584
585
|
|
|
585
586
|
export declare const useBlocksStore: () => [any[], (args_0: any[] | ((prev: any[]) => any[])) => void];
|
|
586
587
|
|
|
@@ -706,6 +707,8 @@ export declare const usePermissions: () => {
|
|
|
706
707
|
*/
|
|
707
708
|
export declare const usePreviewMode: () => [boolean, Function];
|
|
708
709
|
|
|
710
|
+
export declare function usePubSub<T>(eventName: string, callback: (data?: T) => void): void;
|
|
711
|
+
|
|
709
712
|
export declare const useRemoveAllClassesForBlock: () => (block: ChaiBlock, undo?: boolean) => void;
|
|
710
713
|
|
|
711
714
|
export declare const useRemoveBlocks: () => (blockIds: Array<string>) => void;
|
package/dist/core.js
CHANGED
|
@@ -1,106 +1,108 @@
|
|
|
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 o, f as i, k as l, B as r, e as t, C as u, i as c, D as d, l as C, E as B, I as k, L as n, g, T as h, U as p, h as S, y as m, P, m as F, n as A, o as T, p as M, r as b, z as y, F as I, s as v, t as L, q as f, v as R, w as E, x as H, M as D, O as U, Q as x, R as W, S as O, V as w, aB as z, W as j, X as q, Y as G, aD as V, aC as Z, Z as J, G as K, H as N, u as Q, _ as X, $ as Y, a0 as _, a1 as $, a2 as aa, a3 as sa, a4 as ea, a5 as oa, a6 as ia, a7 as la, a8 as ra, a9 as ta, aa as ua, K as ca, ab as da, ac as Ca, ad as Ba, ae as ka, af as na, ag as ga, ah as ha, ai as pa, aj as Sa, ak as ma, al as Pa, am as Fa, an as Aa, aE as Ta, ao as Ma, ap as ba, aq as ya, a as Ia, ar as va, as as La, aF as fa, at as Ra, aG as Ea, au as Ha, av as Da, aw as Ua, ax as xa, ay as Wa, J as Oa, az as wa, b as za, c as ja, aA as qa } from "./index-CDJhqQK5.js";
|
|
2
|
+
import { g as Va, c as Za } from "./common-functions-BGzDsf1z.js";
|
|
3
|
+
import { h as Ka, h as Na } from "./apply-binding-w7OMcHcu.js";
|
|
4
|
+
import { useTranslation as Xa } from "react-i18next";
|
|
5
|
+
import { default as _a } from "i18next";
|
|
6
6
|
export {
|
|
7
7
|
e as ChaiAddBlocksDialog,
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
o as ChaiAddBlocksPanel,
|
|
9
|
+
i as ChaiAskAiUserPrompt,
|
|
10
10
|
l as ChaiBlockAttributesEditor,
|
|
11
11
|
r as ChaiBlockPropsEditor,
|
|
12
12
|
t as ChaiBlockStyleEditor,
|
|
13
13
|
u as ChaiBuilderCanvas,
|
|
14
14
|
c as ChaiBuilderEditor,
|
|
15
15
|
d as ChaiDarkModeSwitcher,
|
|
16
|
-
|
|
16
|
+
C as ChaiDefaultBlocks,
|
|
17
|
+
B as ChaiExportCodeModal,
|
|
17
18
|
k as ChaiImportHTML,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
19
|
+
n as ChaiOutline,
|
|
20
|
+
g as ChaiScreenSizes,
|
|
21
|
+
h as ChaiThemeConfigPanel,
|
|
22
|
+
p as ChaiUILibrariesPanel,
|
|
23
|
+
S as ChaiUndoRedo,
|
|
24
|
+
m as IfChaiFeatureFlag,
|
|
25
|
+
P as PERMISSIONS,
|
|
26
|
+
Ka as convertHTMLToChaiBlocks,
|
|
27
|
+
Va as generateBlockId,
|
|
28
|
+
Na as getBlocksFromHTML,
|
|
29
|
+
F as getClassValueAndUnit,
|
|
30
|
+
_a as i18n,
|
|
31
|
+
Za as mergeClasses,
|
|
31
32
|
A as registerBlockSettingField,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
T as registerBlockSettingTemplate,
|
|
34
|
+
M as registerBlockSettingWidget,
|
|
35
|
+
b as registerChaiAddBlockTab,
|
|
36
|
+
y as registerChaiFeatureFlag,
|
|
37
|
+
I as registerChaiFeatureFlags,
|
|
37
38
|
v as registerChaiLibrary,
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
L as registerChaiMediaManager,
|
|
40
|
+
f as registerChaiPreImportHTMLHook,
|
|
41
|
+
R as registerChaiSaveToLibrary,
|
|
42
|
+
E as registerChaiSidebarPanel,
|
|
42
43
|
H as registerChaiTopBar,
|
|
43
44
|
D as useAddBlock,
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
45
|
+
U as useAddClassesToBlocks,
|
|
46
|
+
x as useAskAi,
|
|
47
|
+
W as useBlockHighlight,
|
|
48
|
+
O as useBlocksHtmlForAi,
|
|
49
|
+
w as useBlocksStore,
|
|
50
|
+
z as useBlocksStoreUndoableActions,
|
|
51
|
+
j as useBrandingOptions,
|
|
52
|
+
q as useBuilderProp,
|
|
53
|
+
G as useBuilderReset,
|
|
53
54
|
V as useCanvasDisplayWidth,
|
|
54
55
|
Z as useCanvasWidth,
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
56
|
+
J as useCanvasZoom,
|
|
57
|
+
K as useChaiFeatureFlag,
|
|
58
|
+
N as useChaiFeatureFlags,
|
|
59
|
+
Q as useCodeEditor,
|
|
60
|
+
X as useCopyBlockIds,
|
|
61
|
+
Y as useCopyToClipboard,
|
|
62
|
+
_ as useCurrentPage,
|
|
63
|
+
$ as useCutBlockIds,
|
|
64
|
+
aa as useDarkMode,
|
|
65
|
+
sa as useDuplicateBlocks,
|
|
66
|
+
ea as useHighlightBlockId,
|
|
67
|
+
oa as useHtmlToBlocks,
|
|
67
68
|
ia as useI18nBlocks,
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
69
|
+
la as useInlineEditing,
|
|
70
|
+
ra as useIsPageLoaded,
|
|
71
|
+
ta as useLanguages,
|
|
72
|
+
ua as useLibraryBlocks,
|
|
73
|
+
ca as useMediaManagerComponent,
|
|
74
|
+
da as usePartailBlocksStore,
|
|
75
|
+
Ca as usePartialBlocksList,
|
|
75
76
|
Ba as usePasteBlocks,
|
|
76
77
|
ka as usePermissions,
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
Aa as
|
|
86
|
-
|
|
87
|
-
|
|
78
|
+
na as usePreviewMode,
|
|
79
|
+
ga as usePubSub,
|
|
80
|
+
ha as useRemoveAllClassesForBlock,
|
|
81
|
+
pa as useRemoveBlocks,
|
|
82
|
+
Sa as useRemoveClassesFromBlocks,
|
|
83
|
+
ma as useReplaceBlock,
|
|
84
|
+
Pa as useResetBlockStyles,
|
|
85
|
+
Fa as useRightPanel,
|
|
86
|
+
Aa as useSavePage,
|
|
87
|
+
Ta as useScreenSizeWidth,
|
|
88
|
+
Ma as useSelectedBlock,
|
|
89
|
+
ba as useSelectedBlockAllClasses,
|
|
88
90
|
ya as useSelectedBlockCurrentClasses,
|
|
89
91
|
Ia as useSelectedBlockIds,
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
92
|
+
va as useSelectedBlocksDisplayChild,
|
|
93
|
+
La as useSelectedBreakpoints,
|
|
94
|
+
fa as useSelectedLibrary,
|
|
95
|
+
Ra as useSelectedStylingBlocks,
|
|
96
|
+
Ea as useSidebarActivePanel,
|
|
97
|
+
Ha as useStreamMultipleBlocksProps,
|
|
98
|
+
Da as useStylingBreakpoint,
|
|
99
|
+
Ua as useStylingState,
|
|
100
|
+
xa as useTheme,
|
|
101
|
+
Wa as useThemeOptions,
|
|
102
|
+
Oa as useToggleChaiFeatureFlag,
|
|
103
|
+
Xa as useTranslation,
|
|
104
|
+
wa as useUndoManager,
|
|
105
|
+
za as useUpdateBlocksProps,
|
|
106
|
+
ja as useUpdateBlocksPropsRealtime,
|
|
107
|
+
qa as useWrapperBlock
|
|
106
108
|
};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import o from "@tailwindcss/aspect-ratio";
|
|
2
|
+
import a from "@tailwindcss/forms";
|
|
3
|
+
import e from "@tailwindcss/typography";
|
|
4
|
+
import d from "tailwindcss-animate";
|
|
5
|
+
function n() {
|
|
6
|
+
return {
|
|
7
|
+
colors: {
|
|
8
|
+
border: "hsl(var(--border))",
|
|
9
|
+
input: "hsl(var(--input))",
|
|
10
|
+
ring: "hsl(var(--ring))",
|
|
11
|
+
background: "hsl(var(--background))",
|
|
12
|
+
foreground: "hsl(var(--foreground))",
|
|
13
|
+
primary: {
|
|
14
|
+
DEFAULT: "hsl(var(--primary))",
|
|
15
|
+
foreground: "hsl(var(--primary-foreground))"
|
|
16
|
+
},
|
|
17
|
+
secondary: {
|
|
18
|
+
DEFAULT: "hsl(var(--secondary))",
|
|
19
|
+
foreground: "hsl(var(--secondary-foreground))"
|
|
20
|
+
},
|
|
21
|
+
destructive: {
|
|
22
|
+
DEFAULT: "hsl(var(--destructive))",
|
|
23
|
+
foreground: "hsl(var(--destructive-foreground))"
|
|
24
|
+
},
|
|
25
|
+
muted: {
|
|
26
|
+
DEFAULT: "hsl(var(--muted))",
|
|
27
|
+
foreground: "hsl(var(--muted-foreground))"
|
|
28
|
+
},
|
|
29
|
+
accent: {
|
|
30
|
+
DEFAULT: "hsl(var(--accent))",
|
|
31
|
+
foreground: "hsl(var(--accent-foreground))"
|
|
32
|
+
},
|
|
33
|
+
popover: {
|
|
34
|
+
DEFAULT: "hsl(var(--popover))",
|
|
35
|
+
foreground: "hsl(var(--popover-foreground))"
|
|
36
|
+
},
|
|
37
|
+
card: {
|
|
38
|
+
DEFAULT: "hsl(var(--card))",
|
|
39
|
+
foreground: "hsl(var(--card-foreground))"
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
borderRadius: {
|
|
43
|
+
lg: "var(--radius)",
|
|
44
|
+
md: "calc(var(--radius) - 2px)",
|
|
45
|
+
sm: "calc(var(--radius) - 4px)"
|
|
46
|
+
},
|
|
47
|
+
keyframes: {
|
|
48
|
+
"accordion-down": {
|
|
49
|
+
from: { height: "0" },
|
|
50
|
+
to: { height: "var(--radix-accordion-content-height)" }
|
|
51
|
+
},
|
|
52
|
+
"accordion-up": {
|
|
53
|
+
from: { height: "var(--radix-accordion-content-height)" },
|
|
54
|
+
to: { height: "0" }
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
animation: {
|
|
58
|
+
"accordion-down": "accordion-down 0.2s ease-out",
|
|
59
|
+
"accordion-up": "accordion-up 0.2s ease-out"
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
const u = (r) => ({
|
|
64
|
+
darkMode: "class",
|
|
65
|
+
content: [...r, "node_modules/@chaibuilder/sdk/dist/*.{js,cjs}"],
|
|
66
|
+
theme: {
|
|
67
|
+
extend: n()
|
|
68
|
+
},
|
|
69
|
+
plugins: [d, e, a, o]
|
|
70
|
+
});
|
|
71
|
+
export {
|
|
72
|
+
u as g,
|
|
73
|
+
n as s
|
|
74
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("@tailwindcss/aspect-ratio"),a=require("@tailwindcss/forms"),n=require("@tailwindcss/typography"),d=require("tailwindcss-animate");function r(){return{colors:{border:"hsl(var(--border))",input:"hsl(var(--input))",ring:"hsl(var(--ring))",background:"hsl(var(--background))",foreground:"hsl(var(--foreground))",primary:{DEFAULT:"hsl(var(--primary))",foreground:"hsl(var(--primary-foreground))"},secondary:{DEFAULT:"hsl(var(--secondary))",foreground:"hsl(var(--secondary-foreground))"},destructive:{DEFAULT:"hsl(var(--destructive))",foreground:"hsl(var(--destructive-foreground))"},muted:{DEFAULT:"hsl(var(--muted))",foreground:"hsl(var(--muted-foreground))"},accent:{DEFAULT:"hsl(var(--accent))",foreground:"hsl(var(--accent-foreground))"},popover:{DEFAULT:"hsl(var(--popover))",foreground:"hsl(var(--popover-foreground))"},card:{DEFAULT:"hsl(var(--card))",foreground:"hsl(var(--card-foreground))"}},borderRadius:{lg:"var(--radius)",md:"calc(var(--radius) - 2px)",sm:"calc(var(--radius) - 4px)"},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"}}}const i=o=>({darkMode:"class",content:[...o,"node_modules/@chaibuilder/sdk/dist/*.{js,cjs}"],theme:{extend:r()},plugins:[d,n,a,e]});exports.getChaiBuilderTailwindConfig=i;exports.shadcnTheme=r;
|