@chaibuilder/sdk 3.1.5 → 3.1.7
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-CCtMapeT.js → code-editor-D1w8nUwt.js} +1 -1
- package/dist/{code-editor-DwJyCB5f.cjs → code-editor-DEY4IkBJ.cjs} +1 -1
- package/dist/core.cjs +1 -1
- package/dist/core.js +1 -1
- package/dist/{index-ENH8SVib.cjs → index-CONV5Fbc.cjs} +4 -4
- package/dist/{index-DHTitEQZ.js → index-Cj8rTugy.js} +9 -9
- package/dist/{rte-widget-modal-BRoDWnTe.js → rte-widget-modal-CsOaIXCW.js} +1 -1
- package/dist/{rte-widget-modal-7tiucEMf.cjs → rte-widget-modal-D_Yor38o.cjs} +1 -1
- package/package.json +1 -1
- package/dist/code-display-Brl9NCVZ.cjs +0 -11
- package/dist/code-display-CX2P1oME.js +0 -620
|
@@ -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-CONV5Fbc.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-CONV5Fbc.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.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
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-
|
|
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-Cj8rTugy.js";
|
|
2
2
|
import { g as Va, c as Za } from "./common-functions-BGzDsf1z.js";
|
|
3
3
|
import { h as Ka, h as Na } from "./apply-binding-w7OMcHcu.js";
|
|
4
4
|
import { useTranslation as Xa } from "react-i18next";
|