@chaibuilder/sdk 3.1.17 → 3.1.19

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.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),c=require("./index-ByCJl7aR.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
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),c=require("./index-DV1NenGF.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-seEzvADJ.js";
2
+ import { u as C, a as k, b as v, c as g } from "./index-BjbJYOzg.js";
3
3
  import "lodash-es";
4
4
  import "clsx";
5
5
  import "tailwind-merge";
package/dist/core.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-ByCJl7aR.cjs"),s=require("./common-functions-BZmyleS1.cjs"),a=require("./apply-binding-DvHNFLQD.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;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-DV1NenGF.cjs"),s=require("./common-functions-BZmyleS1.cjs"),a=require("./apply-binding-DvHNFLQD.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.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, 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-seEzvADJ.js";
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-BjbJYOzg.js";
2
2
  import { g as Za, c as Ja } from "./common-functions-BGzDsf1z.js";
3
3
  import { h as Na, h as Qa } from "./apply-binding-DCno1xQL.js";
4
4
  import { useTranslation as Ya } from "react-i18next";
@@ -3335,14 +3335,14 @@ function detectDropZone(o, n, r, a, l) {
3335
3335
  if (L) {
3336
3336
  const O = L.getBoundingClientRect();
3337
3337
  if (u === "vertical") {
3338
- const H = A.width - j - _, $ = A.left + P + j;
3338
+ const $ = A.width - j - _, H = A.left + P + j;
3339
3339
  return {
3340
3340
  position: "before",
3341
3341
  placeholderOrientation: R,
3342
3342
  rect: {
3343
3343
  top: O.top + D - 2,
3344
- left: $,
3345
- width: H,
3344
+ left: H,
3345
+ width: $,
3346
3346
  height: 4
3347
3347
  },
3348
3348
  targetElement: L,
@@ -3351,15 +3351,15 @@ function detectDropZone(o, n, r, a, l) {
3351
3351
  confidence: 0.9
3352
3352
  };
3353
3353
  } else {
3354
- const H = A.top + D + N, $ = M.maxHeight > 0 ? M.maxHeight : A.height - N - T;
3354
+ const $ = A.top + D + N, H = M.maxHeight > 0 ? M.maxHeight : A.height - N - T;
3355
3355
  return {
3356
3356
  position: "before",
3357
3357
  placeholderOrientation: R,
3358
3358
  rect: {
3359
- top: H,
3359
+ top: $,
3360
3360
  left: O.left + P - 2,
3361
3361
  width: 4,
3362
- height: $
3362
+ height: H
3363
3363
  },
3364
3364
  targetElement: L,
3365
3365
  targetBlockId: L.getAttribute("data-block-id"),
@@ -3371,16 +3371,16 @@ function detectDropZone(o, n, r, a, l) {
3371
3371
  } else {
3372
3372
  const L = getChildBlocks(d), O = L[L.length - 1];
3373
3373
  if (O) {
3374
- const H = O.getBoundingClientRect();
3374
+ const $ = O.getBoundingClientRect();
3375
3375
  if (u === "vertical") {
3376
- const $ = A.width - j - _, F = A.left + P + j;
3376
+ const H = A.width - j - _, F = A.left + P + j;
3377
3377
  return {
3378
3378
  position: "after",
3379
3379
  placeholderOrientation: R,
3380
3380
  rect: {
3381
- top: H.bottom + D - 2,
3381
+ top: $.bottom + D - 2,
3382
3382
  left: F,
3383
- width: $,
3383
+ width: H,
3384
3384
  height: 4
3385
3385
  },
3386
3386
  targetElement: O,
@@ -3389,13 +3389,13 @@ function detectDropZone(o, n, r, a, l) {
3389
3389
  confidence: 0.9
3390
3390
  };
3391
3391
  } else {
3392
- const $ = A.top + D + N, F = M.maxHeight > 0 ? M.maxHeight : A.height - N - T;
3392
+ const H = A.top + D + N, F = M.maxHeight > 0 ? M.maxHeight : A.height - N - T;
3393
3393
  return {
3394
3394
  position: "after",
3395
3395
  placeholderOrientation: R,
3396
3396
  rect: {
3397
- top: $,
3398
- left: H.right + P - 2,
3397
+ top: H,
3398
+ left: $.right + P - 2,
3399
3399
  width: 4,
3400
3400
  height: F
3401
3401
  },
@@ -3746,7 +3746,7 @@ const useBlockDragStart = () => {
3746
3746
  f && setTimeout(() => {
3747
3747
  if (f) {
3748
3748
  const x = f.getBoundingClientRect().height;
3749
- getOrientation(f == null ? void 0 : f.parentElement) === "vertical" && x > 200 && (f.style.height = "max-content", f.style.maxHeight = "max-content", f.style.minHeight = "0", f.style.overflow = "hidden", f.innerHTML = "<div class='flex items-center justify-center w-full h-full outline-dashed font-medium outline-gray-500 py-4'>Currently dragging</div>", f.style.opacity = "0.4"), f.style.opacity = "0.4", f.setAttribute("data-dragging", "true");
3749
+ getOrientation(f == null ? void 0 : f.parentElement) === "vertical" && x > 200 && (f.style.height = "max-content", f.style.maxHeight = "max-content", f.style.minHeight = "0", f.style.overflow = "hidden", f.innerHTML = "<div class='flex items-center justify-center w-full h-full outline-[1px] outline-dashed font-medium outline-gray-500 bg-gray-500/10 py-4 text-transparent'>-</div>", f.style.opacity = "0.4"), f.style.opacity = "0.4", f.setAttribute("data-dragging", "true");
3750
3750
  }
3751
3751
  }, 0);
3752
3752
  }
@@ -3956,7 +3956,7 @@ const FrameContext = React__default.createContext({ document: doc, window: win }
3956
3956
  onClick: n = noop
3957
3957
  }) => /* @__PURE__ */ jsx("svg", { className: o, viewBox: "0 0 256 256", fill: "currentColor", onClick: n, children: /* @__PURE__ */ jsx("path", { d: "m198.39 128.986-52.16-19.216-19.216-52.16a16 16 0 0 0-30.028 0L77.77 109.77l-52.16 19.216a16 16 0 0 0 0 30.028l52.16 19.216 19.216 52.16a16 16 0 0 0 30.028 0l19.216-52.16 52.16-19.216a16 16 0 0 0 0-30.028m-57.69 34.23a15.97 15.97 0 0 0-9.483 9.483l-19.22 52.152-19.214-52.15a15.97 15.97 0 0 0-9.482-9.484l-52.152-19.22 52.15-19.214a15.97 15.97 0 0 0 9.484-9.482l19.22-52.152 19.214 52.15a15.97 15.97 0 0 0 9.482 9.484l52.152 19.22ZM144 40a8 8 0 0 1 8-8h16V16a8 8 0 0 1 16 0v16h16a8 8 0 0 1 0 16h-16v16a8 8 0 0 1-16 0V48h-16a8 8 0 0 1-8-8m104 48a8 8 0 0 1-8 8h-8v8a8 8 0 0 1-16 0v-8h-8a8 8 0 0 1 0-16h8v-8a8 8 0 0 1 16 0v8h8a8 8 0 0 1 8 8" }) }), GotoSettingsIcon = ({ blockId: o, className: n }) => /* @__PURE__ */ jsx(GearIcon, { className: n, onClick: () => {
3958
3958
  o && pubsub.publish(CHAI_BUILDER_EVENTS.GOTO_BLOCK_SETTINGS, o);
3959
- } });
3959
+ } }), lastClickTimeAtom = atom(0), clickCountAtom = atom(0);
3960
3960
  function getTargetedBlock(o) {
3961
3961
  if (o.getAttribute("data-block-id") === "canvas")
3962
3962
  return null;
@@ -3991,26 +3991,25 @@ const INLINE_EDITABLE_BLOCKS = ["Heading", "Paragraph", "Text", "Link", "Span",
3991
3991
  [o, n, r]
3992
3992
  );
3993
3993
  }, useHandleCanvasClick = () => {
3994
- const { editingBlockId: o } = useInlineEditing(), { clearHighlight: n } = useBlockHighlight(), r = useRef(0);
3994
+ const { editingBlockId: o } = useInlineEditing(), { clearHighlight: n } = useBlockHighlight(), [r] = useAtom$1(clickCountAtom);
3995
3995
  return useCallback(
3996
3996
  (a) => {
3997
- const l = (/* @__PURE__ */ new Date()).getTime();
3998
- if (o || (a.stopPropagation(), l - r.current < 400)) return;
3999
- const c = getTargetedBlock(a.target);
4000
- if (c != null && c.getAttribute("data-block-id") && (c == null ? void 0 : c.getAttribute("data-block-id")) === "container") {
3997
+ if (o || (a.stopPropagation(), r === 2)) return;
3998
+ const l = getTargetedBlock(a.target);
3999
+ if (l != null && l.getAttribute("data-block-id") && (l == null ? void 0 : l.getAttribute("data-block-id")) === "container") {
4001
4000
  pubsub.publish(CHAI_BUILDER_EVENTS.CLEAR_CANVAS_SELECTION);
4002
4001
  return;
4003
4002
  }
4004
- if (c != null && c.getAttribute("data-block-parent")) {
4005
- const d = c.getAttribute("data-style-prop"), p = c.getAttribute("data-style-id"), u = c.getAttribute("data-block-parent");
4006
- pubsub.publish(CHAI_BUILDER_EVENTS.CANVAS_BLOCK_STYLE_SELECTED, { blockId: u, styleId: p, styleProp: d });
4007
- } else if (c != null && c.getAttribute("data-block-id")) {
4008
- const d = c.getAttribute("data-block-id");
4009
- pubsub.publish(CHAI_BUILDER_EVENTS.CANVAS_BLOCK_SELECTED, d === "canvas" ? [] : [d]);
4003
+ if (l != null && l.getAttribute("data-block-parent")) {
4004
+ const i = l.getAttribute("data-style-prop"), c = l.getAttribute("data-style-id"), d = l.getAttribute("data-block-parent");
4005
+ pubsub.publish(CHAI_BUILDER_EVENTS.CANVAS_BLOCK_STYLE_SELECTED, { blockId: d, styleId: c, styleProp: i });
4006
+ } else if (l != null && l.getAttribute("data-block-id")) {
4007
+ const i = l.getAttribute("data-block-id");
4008
+ pubsub.publish(CHAI_BUILDER_EVENTS.CANVAS_BLOCK_SELECTED, i === "canvas" ? [] : [i]);
4010
4009
  }
4011
- n(), r.current = (/* @__PURE__ */ new Date()).getTime();
4010
+ n();
4012
4011
  },
4013
- [o]
4012
+ [o, r]
4014
4013
  );
4015
4014
  }, useHandleMouseMove = () => {
4016
4015
  const { editingBlockId: o } = useInlineEditing(), { highlightBlock: n } = useBlockHighlight();
@@ -4527,28 +4526,34 @@ const ChaiFrame = React__default.forwardRef((o, n) => /* @__PURE__ */ jsx(Frame,
4527
4526
  }
4528
4527
  );
4529
4528
  }, useDirectBlockDrag = () => {
4530
- const [, o] = useSelectedBlockIds(), { onDragStart: n, onDragEnd: r } = useDragAndDrop(), [a] = useBlocksStore(), l = useRef(null), i = useCallback(
4531
- (p) => {
4532
- var m;
4533
- if (p.button !== 0) return;
4534
- const g = (m = p.target.closest("[data-block-id]")) == null ? void 0 : m.getAttribute("data-block-id");
4535
- g && (o([g]), l.current = g);
4529
+ const [, o] = useSelectedBlockIds(), { onDragStart: n, onDragEnd: r } = useDragAndDrop(), [a] = useBlocksStore(), l = useRef(null), [i, c] = useAtom$1(lastClickTimeAtom), [d, p] = useAtom$1(clickCountAtom), u = useCallback(
4530
+ (f) => {
4531
+ var S;
4532
+ if (f.button !== 0) return;
4533
+ const h = Date.now(), x = h - i;
4534
+ if (x < 400 && x > 0) {
4535
+ p(2);
4536
+ return;
4537
+ }
4538
+ c(h);
4539
+ const y = (S = f.target.closest("[data-block-id]")) == null ? void 0 : S.getAttribute("data-block-id");
4540
+ y && (o([y]), l.current = y);
4536
4541
  },
4537
- [o]
4538
- ), c = useCallback(
4539
- (p) => {
4542
+ [o, i, c, d, p]
4543
+ ), g = useCallback(
4544
+ (f) => {
4540
4545
  if (!l.current) return;
4541
- const u = find$1(a, { _id: l.current });
4542
- u && n(p, u, !1);
4546
+ const h = find$1(a, { _id: l.current });
4547
+ h && n(f, h, !1);
4543
4548
  },
4544
4549
  [a, n]
4545
- ), d = useCallback(() => {
4550
+ ), m = useCallback(() => {
4546
4551
  r(), l.current = null;
4547
4552
  }, [r]);
4548
4553
  return {
4549
- onMouseDown: i,
4550
- onDragStart: c,
4551
- onDragEnd: d
4554
+ onMouseDown: u,
4555
+ onDragStart: g,
4556
+ onDragEnd: m
4552
4557
  };
4553
4558
  }, editorModeAtom = atom("edit"), useEditorMode = () => {
4554
4559
  const [o, n] = useAtom$1(editorModeAtom);
@@ -5499,7 +5504,7 @@ const RichTextEditor = memo(
5499
5504
  /* @__PURE__ */ jsx("p", { className: "font-semibold", children: o("Oops! Something went wrong.") }),
5500
5505
  /* @__PURE__ */ jsx("p", { children: o("Please try again.") })
5501
5506
  ] }) });
5502
- }, CodeEditor$1 = React__default.lazy(() => import("./code-editor-BWhFfK_2.js")), CanvasArea = () => {
5507
+ }, CodeEditor$1 = React__default.lazy(() => import("./code-editor-tQ-y-Wn4.js")), CanvasArea = () => {
5503
5508
  const [o] = useCodeEditor(), n = useBuilderProp("onError", noop);
5504
5509
  return /* @__PURE__ */ jsx("div", { className: "flex h-full max-h-full w-full flex-1 flex-col", children: /* @__PURE__ */ jsxs("div", { className: "relative flex h-full max-h-full flex-col overflow-hidden bg-gray-100/40", children: [
5505
5510
  /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Skeleton, { className: "h-full" }), children: /* @__PURE__ */ jsx(ErrorBoundary, { fallback: /* @__PURE__ */ jsx(FallbackError, {}), onError: n, children: /* @__PURE__ */ jsx(StaticCanvas, {}) }) }),
@@ -6069,7 +6074,7 @@ const DataBindingSelector = ({
6069
6074
  ]
6070
6075
  }
6071
6076
  ) });
6072
- }, RTEModal = React__default.lazy(() => import("./rte-widget-modal-6srLi8vj.js")), RichTextEditorFieldComp = ({ blockId: o, id: n, placeholder: r, value: a, onChange: l, onBlur: i }) => {
6077
+ }, RTEModal = React__default.lazy(() => import("./rte-widget-modal-Ao1azHBf.js")), RichTextEditorFieldComp = ({ blockId: o, id: n, placeholder: r, value: a, onChange: l, onBlur: i }) => {
6073
6078
  const c = useRef(null), [d, p] = useState(!1), u = useRTEditor({
6074
6079
  blockId: o,
6075
6080
  value: a,
@@ -7746,9 +7751,9 @@ function ManualClasses() {
7746
7751
  let R = [];
7747
7752
  if (P && P.length > 0) {
7748
7753
  const [M] = P, L = D.replace(M, "");
7749
- R = i.search(L).map((H) => ({
7750
- ...H,
7751
- item: { ...H.item, name: M + H.item.name }
7754
+ R = i.search(L).map(($) => ({
7755
+ ...$,
7756
+ item: { ...$.item, name: M + $.item.name }
7752
7757
  }));
7753
7758
  } else
7754
7759
  R = i.search(D);
@@ -9106,10 +9111,10 @@ const Input = ({ node: o }) => {
9106
9111
  return () => clearTimeout(L);
9107
9112
  }, [b, o, y]);
9108
9113
  const N = (L, O) => {
9109
- const H = i.contentDocument || i.contentWindow.document, $ = H.querySelector(`[data-block-id=${L}]`);
9110
- $ && $.setAttribute("data-drop", O);
9111
- const F = $.getBoundingClientRect(), U = i.getBoundingClientRect();
9112
- F.top >= U.top && F.left >= U.left && F.bottom <= U.bottom && F.right <= U.right || (H.documentElement.scrollTop = $.offsetTop - U.top);
9114
+ const $ = i.contentDocument || i.contentWindow.document, H = $.querySelector(`[data-block-id=${L}]`);
9115
+ H && H.setAttribute("data-drop", O);
9116
+ const F = H.getBoundingClientRect(), U = i.getBoundingClientRect();
9117
+ F.top >= U.top && F.left >= U.left && F.bottom <= U.bottom && F.right <= U.right || ($.documentElement.scrollTop = H.offsetTop - U.top);
9113
9118
  }, T = (L) => {
9114
9119
  j();
9115
9120
  const O = get(o, "parent.id");
@@ -10569,8 +10574,8 @@ const UndoRedo = () => {
10569
10574
  if (j) {
10570
10575
  const _ = j.selectionStart || 0, N = j.value || "", T = j.selectionEnd || _;
10571
10576
  if (T > _) {
10572
- const L = `{{${C}}}`, { text: O } = w(N, _, L), H = N.slice(0, _) + O + N.slice(T);
10573
- p(H);
10577
+ const L = `{{${C}}}`, { text: O } = w(N, _, L), $ = N.slice(0, _) + O + N.slice(T);
10578
+ p($);
10574
10579
  return;
10575
10580
  }
10576
10581
  const P = `{{${C}}}`, { text: R } = w(N, _, P), M = N.slice(0, _) + R + N.slice(_);