@chaibuilder/sdk 3.1.11 → 3.1.13
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/README.md +1 -0
- package/dist/{IconPicker-OPOFkNZu.cjs → IconPicker-BWE43eMO.cjs} +1 -1
- package/dist/{IconPicker-DB-dcym6.js → IconPicker-CluS-5Mv.js} +1 -1
- package/dist/{code-display-BcpLta9W.cjs → code-display-B1O2gN5f.cjs} +1 -1
- package/dist/{code-display-BJJV-nKI.js → code-display-BOOy3Lpy.js} +1 -1
- package/dist/{code-editor-BAXjzGAE.cjs → code-editor-BhsT9_jf.cjs} +1 -1
- package/dist/{code-editor-3fQ6LcgC.js → code-editor-DrzGdqvV.js} +2 -2
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +46 -3
- package/dist/core.js +91 -90
- package/dist/{css-import-modal-BLAkS06W.cjs → css-import-modal-CrlmcFy4.cjs} +1 -1
- package/dist/{css-import-modal-DgLi5BIu.js → css-import-modal-sHoiyimv.js} +1 -1
- package/dist/{get-chai-builder-theme-B1tr_NJB.cjs → get-chai-builder-theme-Bw2iD8P4.cjs} +1 -1
- package/dist/{get-chai-builder-theme-BarMkcGH.js → get-chai-builder-theme-jTJ8F0Vo.js} +1 -1
- package/dist/index-BaPNNyIM.cjs +365 -0
- package/dist/index-zENTTCH5.js +33856 -0
- package/dist/plugin-BGIqPJSF.cjs +22 -0
- package/dist/{plugin-BOcGV_IY.js → plugin-Cn2Shmk3.js} +15 -13
- package/dist/render.cjs +1 -1
- package/dist/render.js +3 -3
- package/dist/{rte-widget-modal-CPDuB58F.cjs → rte-widget-modal-BaiE-vjR.cjs} +1 -1
- package/dist/{rte-widget-modal-CkdQf3xI.js → rte-widget-modal-CVt85o7n.js} +2 -2
- package/dist/tailwind.cjs +1 -1
- package/dist/tailwind.js +2 -2
- package/dist/{tooltip-4-b9QGDK.js → tooltip-Bz2MxMHf.js} +1 -0
- package/dist/{tooltip-C2BCZ8Al.cjs → tooltip-CzZ7Fvt7.cjs} +1 -1
- package/dist/ui.cjs +1 -1
- package/dist/ui.js +1 -1
- package/package.json +1 -1
- package/dist/index-B4arQ22-.js +0 -11102
- package/dist/index-B506vH5V.cjs +0 -153
- package/dist/plugin-CSgw-f78.cjs +0 -22
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs as i, jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import { av as f, ay as b, v as M, ax as C, at as j } from "./tooltip-
|
|
2
|
+
import { av as f, ay as b, v as M, ax as C, at as j } from "./tooltip-Bz2MxMHf.js";
|
|
3
3
|
import { MagnifyingGlassIcon as x } from "@radix-ui/react-icons";
|
|
4
4
|
import H from "fuse.js";
|
|
5
5
|
import { useState as g, useMemo as a } from "react";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),i=require("./tooltip-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),i=require("./tooltip-CzZ7Fvt7.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,5 +1,5 @@
|
|
|
1
1
|
import { jsxs as o, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { v as l } from "./tooltip-
|
|
2
|
+
import { v as l } from "./tooltip-Bz2MxMHf.js";
|
|
3
3
|
import m from "@monaco-editor/react";
|
|
4
4
|
import { CheckIcon as h, CopyIcon as C, DownloadIcon as y } from "@radix-ui/react-icons";
|
|
5
5
|
import { useState as s } from "react";
|
|
@@ -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-BaPNNyIM.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;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as o, jsxs as d } from "react/jsx-runtime";
|
|
2
|
-
import { u as C, a as k, b as v, c as g } from "./index-
|
|
2
|
+
import { u as C, a as k, b as v, c as g } from "./index-zENTTCH5.js";
|
|
3
3
|
import "lodash-es";
|
|
4
4
|
import "clsx";
|
|
5
5
|
import "tailwind-merge";
|
|
@@ -9,7 +9,7 @@ import "jotai";
|
|
|
9
9
|
import "@chaibuilder/runtime";
|
|
10
10
|
import "sonner";
|
|
11
11
|
import { useTranslation as w } from "react-i18next";
|
|
12
|
-
import { a1 as N, a3 as E, a6 as D, a9 as H, b1 as P } from "./tooltip-
|
|
12
|
+
import { a1 as N, a3 as E, a6 as D, a9 as H, b1 as P } from "./tooltip-Bz2MxMHf.js";
|
|
13
13
|
import { useThrottledCallback as B } from "@react-hookz/web";
|
|
14
14
|
const p = (a) => {
|
|
15
15
|
const t = document.createElement("div");
|
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-BaPNNyIM.cjs"),s=require("./common-functions-BZmyleS1.cjs"),a=require("./apply-binding-DCZAw7M-.cjs"),l=require("react-i18next"),i=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.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:()=>l.useTranslation});exports.i18n=i;
|
package/dist/core.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ClassValue } from 'clsx';
|
|
2
2
|
import { ComponentType } from 'react';
|
|
3
3
|
import { default as default_2 } from 'react';
|
|
4
|
+
import { DragEvent as DragEvent_2 } from 'react';
|
|
4
5
|
import { default as i18n } from 'i18next';
|
|
5
6
|
import { JSX } from 'react/jsx-runtime';
|
|
6
7
|
import * as React_2 from 'react';
|
|
@@ -42,11 +43,12 @@ export declare type BreakpointName = "xs" | "sm" | "md" | "lg" | "xl" | "2xl";
|
|
|
42
43
|
|
|
43
44
|
export declare const ChaiAddBlocksDialog: () => JSX.Element;
|
|
44
45
|
|
|
45
|
-
export declare const ChaiAddBlocksPanel: ({ className, showHeading, parentId, position, }: {
|
|
46
|
+
export declare const ChaiAddBlocksPanel: ({ className, showHeading, parentId, position, fromSidebar, }: {
|
|
46
47
|
parentId?: string;
|
|
47
48
|
showHeading?: boolean;
|
|
48
49
|
className?: string;
|
|
49
50
|
position?: number;
|
|
51
|
+
fromSidebar?: boolean;
|
|
50
52
|
}) => JSX.Element;
|
|
51
53
|
|
|
52
54
|
export declare const ChaiAskAiUserPrompt: ({ blockId }: {
|
|
@@ -267,6 +269,7 @@ export declare interface ChaiBuilderEditorProps {
|
|
|
267
269
|
importHtml?: boolean;
|
|
268
270
|
importTheme?: boolean;
|
|
269
271
|
gotoSettings?: boolean;
|
|
272
|
+
dragAndDrop?: boolean;
|
|
270
273
|
};
|
|
271
274
|
}
|
|
272
275
|
|
|
@@ -296,6 +299,44 @@ export declare const ChaiDefaultBlocks: ({ parentId, position, gridCols, disable
|
|
|
296
299
|
disableBlockGroupsSidebar?: boolean;
|
|
297
300
|
}) => JSX.Element;
|
|
298
301
|
|
|
302
|
+
/**
|
|
303
|
+
* @component ChaiDraggableBlock
|
|
304
|
+
* @description
|
|
305
|
+
* A draggable wrapper component for Chai Builder blocks.
|
|
306
|
+
* Supports multiple input formats: HTML strings, single blocks, or block arrays.
|
|
307
|
+
* Can handle both synchronous and asynchronous data loading.
|
|
308
|
+
*
|
|
309
|
+
* @example
|
|
310
|
+
* // With HTML
|
|
311
|
+
* <ChaiDraggableBlock html="<div>Content</div>">
|
|
312
|
+
* <div>Drag me</div>
|
|
313
|
+
* </ChaiDraggableBlock>
|
|
314
|
+
*
|
|
315
|
+
* @example
|
|
316
|
+
* // With block object
|
|
317
|
+
* <ChaiDraggableBlock block={{ type: "Box", props: {} }}>
|
|
318
|
+
* <div>Drag me</div>
|
|
319
|
+
* </ChaiDraggableBlock>
|
|
320
|
+
*
|
|
321
|
+
* @example
|
|
322
|
+
* // With async blocks
|
|
323
|
+
* <ChaiDraggableBlock blocks={async () => await fetchBlocks()}>
|
|
324
|
+
* <div>Drag me</div>
|
|
325
|
+
* </ChaiDraggableBlock>
|
|
326
|
+
*/
|
|
327
|
+
export declare const ChaiDraggableBlock: ({ block, html, blocks, children, onDragStart: customOnDragStart, onDragEnd: customOnDragEnd, draggable: customDraggable, className, }: ChaiDraggableBlockProps) => JSX.Element;
|
|
328
|
+
|
|
329
|
+
declare type ChaiDraggableBlockProps = {
|
|
330
|
+
html?: string | (() => Promise<string>);
|
|
331
|
+
block?: any | (() => Promise<any>);
|
|
332
|
+
blocks?: any[] | (() => Promise<any[]>);
|
|
333
|
+
children: default_2.ReactNode;
|
|
334
|
+
onDragStart?: (e: DragEvent_2) => void;
|
|
335
|
+
onDragEnd?: (e: DragEvent_2) => void;
|
|
336
|
+
draggable?: boolean;
|
|
337
|
+
className?: string;
|
|
338
|
+
};
|
|
339
|
+
|
|
299
340
|
export declare const ChaiExportCodeModal: () => JSX.Element;
|
|
300
341
|
|
|
301
342
|
declare type ChaiFlagOptions = {
|
|
@@ -304,9 +345,10 @@ declare type ChaiFlagOptions = {
|
|
|
304
345
|
description?: string;
|
|
305
346
|
};
|
|
306
347
|
|
|
307
|
-
export declare const ChaiImportHTML: ({ parentId, position }: {
|
|
348
|
+
export declare const ChaiImportHTML: ({ parentId, position, fromSidebar, }: {
|
|
308
349
|
parentId?: string;
|
|
309
350
|
position?: number;
|
|
351
|
+
fromSidebar?: boolean;
|
|
310
352
|
}) => JSX.Element;
|
|
311
353
|
|
|
312
354
|
export declare type ChaiLibrary<T = Record<string, any>> = {
|
|
@@ -395,9 +437,10 @@ export declare type ChaiThemeValues = {
|
|
|
395
437
|
};
|
|
396
438
|
};
|
|
397
439
|
|
|
398
|
-
export declare const ChaiUILibrariesPanel: ({ parentId, position }: {
|
|
440
|
+
export declare const ChaiUILibrariesPanel: ({ parentId, position, fromSidebar, }: {
|
|
399
441
|
parentId?: string;
|
|
400
442
|
position?: number;
|
|
443
|
+
fromSidebar?: boolean;
|
|
401
444
|
}) => JSX.Element;
|
|
402
445
|
|
|
403
446
|
export declare const ChaiUndoRedo: () => JSX.Element;
|
package/dist/core.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
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,
|
|
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, m as B, E as k, I as g, L as n, g as h, T as p, U as S, h as m, z as P, P as F, n as A, o as T, p as b, q as M, r as y, F as I, G as v, t as L, v as f, s as H, w as R, x as D, y as E, O as U, Q as x, R as W, S as O, V as w, W as z, aC as j, X as q, Y as G, Z as V, aE as Z, aD as J, _ as K, H as N, J as Q, u 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, ab as ca, M as da, ac as Ca, ad as Ba, ae as ka, af as ga, ag as na, ah as ha, ai as pa, aj as Sa, ak as ma, al as Pa, am as Fa, an as Aa, ao as Ta, aF as ba, ap as Ma, aq as ya, ar as Ia, a as va, as as La, at as fa, aG as Ha, au as Ra, aH as Da, av as Ea, aw as Ua, ax as xa, ay as Wa, az as Oa, K as wa, aA as za, b as ja, c as qa, aB as Ga } from "./index-zENTTCH5.js";
|
|
2
|
+
import { g as Za, c as Ja } from "./common-functions-BGzDsf1z.js";
|
|
3
|
+
import { h as Na, h as Qa } from "./apply-binding-DXR0sMuX.js";
|
|
4
|
+
import { useTranslation as Ya } from "react-i18next";
|
|
5
|
+
import { default as $a } from "i18next";
|
|
6
6
|
export {
|
|
7
7
|
e as ChaiAddBlocksDialog,
|
|
8
8
|
o as ChaiAddBlocksPanel,
|
|
@@ -14,95 +14,96 @@ export {
|
|
|
14
14
|
c as ChaiBuilderEditor,
|
|
15
15
|
d as ChaiDarkModeSwitcher,
|
|
16
16
|
C as ChaiDefaultBlocks,
|
|
17
|
-
B as
|
|
18
|
-
k as
|
|
17
|
+
B as ChaiDraggableBlock,
|
|
18
|
+
k as ChaiExportCodeModal,
|
|
19
|
+
g as ChaiImportHTML,
|
|
19
20
|
n as ChaiOutline,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
21
|
+
h as ChaiScreenSizes,
|
|
22
|
+
p as ChaiThemeConfigPanel,
|
|
23
|
+
S as ChaiUILibrariesPanel,
|
|
24
|
+
m as ChaiUndoRedo,
|
|
25
|
+
P as IfChaiFeatureFlag,
|
|
26
|
+
F as PERMISSIONS,
|
|
27
|
+
Na as convertHTMLToChaiBlocks,
|
|
28
|
+
Za as generateBlockId,
|
|
29
|
+
Qa as getBlocksFromHTML,
|
|
30
|
+
A as getClassValueAndUnit,
|
|
31
|
+
$a as i18n,
|
|
32
|
+
Ja as mergeClasses,
|
|
33
|
+
T as registerBlockSettingField,
|
|
34
|
+
b as registerBlockSettingTemplate,
|
|
34
35
|
M as registerBlockSettingWidget,
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
36
|
+
y as registerChaiAddBlockTab,
|
|
37
|
+
I as registerChaiFeatureFlag,
|
|
38
|
+
v as registerChaiFeatureFlags,
|
|
39
|
+
L as registerChaiLibrary,
|
|
40
|
+
f as registerChaiMediaManager,
|
|
41
|
+
H as registerChaiPreImportHTMLHook,
|
|
41
42
|
R as registerChaiSaveToLibrary,
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
43
|
+
D as registerChaiSidebarPanel,
|
|
44
|
+
E as registerChaiTopBar,
|
|
45
|
+
U as useAddBlock,
|
|
46
|
+
x as useAddClassesToBlocks,
|
|
47
|
+
W as useAskAi,
|
|
48
|
+
O as useBlockHighlight,
|
|
49
|
+
w as useBlocksHtmlForAi,
|
|
50
|
+
z as useBlocksStore,
|
|
51
|
+
j as useBlocksStoreUndoableActions,
|
|
52
|
+
q as useBrandingOptions,
|
|
53
|
+
G as useBuilderProp,
|
|
54
|
+
V as useBuilderReset,
|
|
55
|
+
Z as useCanvasDisplayWidth,
|
|
56
|
+
J as useCanvasWidth,
|
|
57
|
+
K as useCanvasZoom,
|
|
58
|
+
N as useChaiFeatureFlag,
|
|
59
|
+
Q as useChaiFeatureFlags,
|
|
60
|
+
X as useCodeEditor,
|
|
61
|
+
Y as useCopyBlockIds,
|
|
62
|
+
_ as useCopyToClipboard,
|
|
63
|
+
$ as useCurrentPage,
|
|
64
|
+
aa as useCutBlockIds,
|
|
65
|
+
sa as useDarkMode,
|
|
66
|
+
ea as useDuplicateBlocks,
|
|
67
|
+
oa as useHighlightBlockId,
|
|
68
|
+
ia as useHtmlToBlocks,
|
|
69
|
+
la as useI18nBlocks,
|
|
70
|
+
ra as useInlineEditing,
|
|
71
|
+
ta as useIsPageLoaded,
|
|
72
|
+
ua as useLanguages,
|
|
73
|
+
ca as useLibraryBlocks,
|
|
74
|
+
da as useMediaManagerComponent,
|
|
75
|
+
Ca as usePartailBlocksStore,
|
|
76
|
+
Ba as usePartialBlocksList,
|
|
77
|
+
ka as usePasteBlocks,
|
|
78
|
+
ga as usePermissions,
|
|
78
79
|
na as usePreviewMode,
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
80
|
+
ha as usePubSub,
|
|
81
|
+
pa as useRemoveAllClassesForBlock,
|
|
82
|
+
Sa as useRemoveBlocks,
|
|
83
|
+
ma as useRemoveClassesFromBlocks,
|
|
84
|
+
Pa as useReplaceBlock,
|
|
85
|
+
Fa as useResetBlockStyles,
|
|
86
|
+
Aa as useRightPanel,
|
|
87
|
+
Ta as useSavePage,
|
|
88
|
+
ba as useScreenSizeWidth,
|
|
88
89
|
Ma as useSelectedBlock,
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
90
|
+
ya as useSelectedBlockAllClasses,
|
|
91
|
+
Ia as useSelectedBlockCurrentClasses,
|
|
92
|
+
va as useSelectedBlockIds,
|
|
93
|
+
La as useSelectedBlocksDisplayChild,
|
|
94
|
+
fa as useSelectedBreakpoints,
|
|
95
|
+
Ha as useSelectedLibrary,
|
|
95
96
|
Ra as useSelectedStylingBlocks,
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
97
|
+
Da as useSidebarActivePanel,
|
|
98
|
+
Ea as useStreamMultipleBlocksProps,
|
|
99
|
+
Ua as useStylingBreakpoint,
|
|
100
|
+
xa as useStylingState,
|
|
101
|
+
Wa as useTheme,
|
|
102
|
+
Oa as useThemeOptions,
|
|
103
|
+
wa as useToggleChaiFeatureFlag,
|
|
104
|
+
Ya as useTranslation,
|
|
105
|
+
za as useUndoManager,
|
|
106
|
+
ja as useUpdateBlocksProps,
|
|
107
|
+
qa as useUpdateBlocksPropsRealtime,
|
|
108
|
+
Ga as useWrapperBlock
|
|
108
109
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),w=require("react"),c=require("./tooltip-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),w=require("react"),c=require("./tooltip-CzZ7Fvt7.cjs"),T=require("culori"),V=require("@chaibuilder/runtime"),N=require("react-i18next");function $(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(o,t,r.get?r:{enumerable:!0,get:()=>e[t]})}}return o.default=e,Object.freeze(o)}const S=$(w),y=$(T),f=e=>e?e%1===0?e:e.toFixed(4):"0",R=e=>`hsl(${f(e.h)} ${f(e.s*100)}% ${f(e.l*100)}%)`,E=(e,o="hsl",t="4")=>{try{const r=y.parse(e);if(!r)throw new Error("Invalid color input");switch(o){case"hsl":{const s=y.converter("hsl")(r);return t==="4"?R(s):`${f(s.h)} ${f(s.s*100)}% ${f(s.l*100)}%`}case"rgb":return y.formatRgb(r);case"oklch":{const s=y.converter("oklch")(r);return`oklch(${f(s.l)} ${f(s.c)} ${f(s.h)})`}case"hex":return y.formatHex(r);default:return e}}catch(r){return console.error(`Failed to convert color: ${e}`,r),e}},b=e=>E(e,"hex"),I=e=>{const o={fontFamily:{heading:"",body:""},borderRadius:"",colors:{}};try{const t=F(e);if(!t.isValid)return console.warn("CSS validation failed:",t.error),k();const r=C(e,":root"),s=C(e,".dark"),l=m(r,"--font-sans")||m(r,"--font-family")||m(r,"--font-heading")||m(r,"--font-body"),a=D(l);o.fontFamily={heading:a,body:a};const u=m(r,"--radius")||m(r,"--border-radius")||"0.5rem";o.borderRadius=P(u),["background","foreground","primary","primary-foreground","secondary","secondary-foreground","muted","muted-foreground","accent","accent-foreground","destructive","destructive-foreground","border","input","ring","card","card-foreground","popover","popover-foreground"].forEach(i=>{const p=m(r,`--${i}`),g=m(s,`--${i}`);if(p||g){const d=p?v(p):"#000000",x=g?v(g):d;o.colors[i]=[d,x]}})}catch(t){return console.error("Error parsing CSS to ChaiThemeValues:",t),k()}return o},C=(e,o)=>{var r,s;const t=new RegExp(`${j(o)}\\s*{([^}]+)}`);return((s=(r=e.match(t))==null?void 0:r[1])==null?void 0:s.trim())||null},m=(e,o)=>{var s;if(!e)return null;const t=new RegExp(`${j(o)}\\s*:\\s*([^;]+)`),r=e.match(t);return((s=r==null?void 0:r[1])==null?void 0:s.trim())||null},v=e=>{if(!e||typeof e!="string")return"#000000";try{const o=e.replace(/var\([^)]+\)/g,"").trim();if(!o)return"#000000";if(/^[a-z]+$/i.test(o))return b(o)||"#000000";if(/^#?([0-9A-F]{3,4}|[0-9A-F]{6}|[0-9A-F]{8})$/i.test(o.replace(/#/g,""))){const r=o.startsWith("#")?o:`#${o}`;return r.length<=5?`#${r.slice(1).split("").map(s=>s+s).join("")}`.slice(0,7):r.length>7?r.slice(0,7):r}if(/^(rgb|hsl|oklch)a?\(/i.test(o))return b(o)||"#000000";const t=o.match(/^(\d+\.?\d*)\s+(\d+\.?\d*)%\s+(\d+\.?\d*)%$/);if(t){const[r,s,l,a]=t,u=`hsl(${s} ${l}% ${a}%)`;return b(u)||"#000000"}if(/^[\d.]+[\s,]+[\d.]+[\s,]+[\d.]+(?:[\s,/]+[\d.]+)?$/.test(o)){const r=o.split(/[\s,]+/).filter(Boolean);if(r.length>=3){const l=r.some(a=>a.includes("%"))?`hsl(${r[0]} ${r[1]} ${r[2]})`:`rgb(${r[0]}, ${r[1]}, ${r[2]})`;return b(l)||"#000000"}}return b(o)||"#000000"}catch(o){return console.warn("Failed to process color:",e,o),"#000000"}},D=e=>{const o=V.getAllRegisteredFonts();if(!e)return"ui-sans-serif, system-ui, sans-serif";try{const r=e.replace(/["']/g,"").trim().split(",")[0].trim(),s=o.find(l=>l.family.toLowerCase()===r.toLowerCase());return(s==null?void 0:s.family)||"ui-sans-serif, system-ui, sans-serif"}catch(t){return console.warn("Error processing font family:",e,t),"ui-sans-serif, system-ui, sans-serif"}},P=e=>{if(!e)return"8px";try{const o=e.trim();if(o.endsWith("px"))return o;if(o.endsWith("rem")){const r=parseFloat(o.replace("rem",""));if(!isNaN(r))return`${Math.round(r*16)}px`}if(o.endsWith("em")){const r=parseFloat(o.replace("em",""));if(!isNaN(r))return`${Math.round(r*16)}px`}const t=parseFloat(o);return isNaN(t)?"8px":`${Math.round(t)}px`}catch(o){return console.warn("Error converting border radius to px:",e,o),"8px"}},k=()=>({fontFamily:{heading:"ui-sans-serif, system-ui, sans-serif",body:"ui-sans-serif, system-ui, sans-serif"},borderRadius:"8px",colors:{background:["#ffffff","#000000"],foreground:["#000000","#ffffff"],primary:["#3b82f6","#60a5fa"],"primary-foreground":["#ffffff","#1e293b"],secondary:["#f1f5f9","#334155"],"secondary-foreground":["#0f172a","#f8fafc"],muted:["#f8fafc","#1e293b"],"muted-foreground":["#64748b","#94a3b8"],accent:["#f1f5f9","#334155"],"accent-foreground":["#0f172a","#f8fafc"],destructive:["#ef4444","#f87171"],"destructive-foreground":["#ffffff","#1e293b"],border:["#e2e8f0","#475569"],input:["#e2e8f0","#475569"],ring:["#3b82f6","#60a5fa"],card:["#ffffff","#0f172a"],"card-foreground":["#000000","#f8fafc"],popover:["#ffffff","#0f172a"],"popover-foreground":["#000000","#f8fafc"]}}),j=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),q=e=>["background","foreground","primary","primary-foreground"].every(r=>e.colors[r]&&Array.isArray(e.colors[r])&&e.colors[r].length>=2)&&!!e.fontFamily.heading&&!!e.fontFamily.body&&!!e.borderRadius,F=e=>{if(!e||typeof e!="string")return{isValid:!1,error:"Please enter valid CSS content"};const o=e.trim();if(!o)return{isValid:!1,error:"Please enter CSS content"};try{if(!o.includes("{")||!o.includes("}"))return{isValid:!1,error:"Invalid CSS format. CSS should contain proper block structure with { }"};const t=(o.match(/{/g)||[]).length,r=(o.match(/}/g)||[]).length;return t!==r?{isValid:!1,error:"Invalid CSS format. Unmatched braces detected"}:!o.includes("--")||!o.includes(":")?{isValid:!1,error:"Invalid CSS format. CSS should contain variable definitions like --primary: #color"}:!o.includes(":root")&&!o.includes(".dark")?{isValid:!1,error:"CSS should contain at least :root or .dark selector with theme variables"}:{isValid:!0}}catch(t){return console.error("CSS validation error:",t),{isValid:!1,error:"Failed to parse CSS. Please check your syntax."}}},M=`:root {
|
|
2
2
|
--background: 0 0% 100%;
|
|
3
3
|
--foreground: oklch(0.52 0.13 144.17);
|
|
4
4
|
--primary: #3e2723;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as i, jsxs as m } from "react/jsx-runtime";
|
|
2
2
|
import * as x from "react";
|
|
3
|
-
import { a1 as V, a3 as T, a6 as N, a9 as R, a4 as E, v as y, au as I, b1 as D, a5 as A } from "./tooltip-
|
|
3
|
+
import { a1 as V, a3 as T, a6 as N, a9 as R, a4 as E, v as y, au as I, b1 as D, a5 as A } from "./tooltip-Bz2MxMHf.js";
|
|
4
4
|
import * as b from "culori";
|
|
5
5
|
import { getAllRegisteredFonts as P } from "@chaibuilder/runtime";
|
|
6
6
|
import { useTranslation as H } from "react-i18next";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("./plugin-
|
|
1
|
+
"use strict";const e=require("./plugin-BGIqPJSF.cjs"),i=(t=e.defaultThemeOptions)=>({container:{center:!0,padding:"1rem",screens:{"2xl":"1400px"}},...e.getChaiThemeOptions(t)});exports.getChaiBuilderTheme=i;
|