@chaibuilder/sdk 1.2.57 → 1.2.59

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.
Files changed (44) hide show
  1. package/dist/CanvasArea-NLbaLcFM.cjs +59 -0
  2. package/dist/{CanvasArea-8f_Ki3B7.js → CanvasArea-akw7npWW.js} +385 -366
  3. package/dist/{CurrentPage-nzo4lszx.js → CurrentPage-cOvRmEIZ.js} +2 -2
  4. package/dist/{CurrentPage-7aEIhzQ0.cjs → CurrentPage-pwDwQsWa.cjs} +1 -1
  5. package/dist/{ListTree-KUGhFsb_.js → ListTree-0iy8aBgI.js} +74 -53
  6. package/dist/{ListTree-A-097CZ-.cjs → ListTree-Njsk1AzL.cjs} +1 -1
  7. package/dist/{PagesPanel-hleqqZBo.js → PagesPanel-A3du_vDn.js} +3 -3
  8. package/dist/{PagesPanel-L1mI3y_6.cjs → PagesPanel-bfNUqq2a.cjs} +1 -1
  9. package/dist/{ProjectPanel-RXEhYr0a.js → ProjectPanel-92EtwSrh.js} +3 -3
  10. package/dist/{ProjectPanel-HTxa1kHv.cjs → ProjectPanel-QMaTK2Jx.cjs} +1 -1
  11. package/dist/{Settings-b1ZuIn4y.js → Settings-3ZuMFtd6.js} +2 -2
  12. package/dist/Settings-8_Twq9DO.cjs +1 -0
  13. package/dist/{SidePanels-_6WlMWq_.cjs → SidePanels-C8RdCe7y.cjs} +1 -1
  14. package/dist/{SidePanels-6hZeCR5Z.js → SidePanels-XUVc9jMH.js} +3 -3
  15. package/dist/{Topbar-WdGZIIZp.cjs → Topbar-EkBS5_nt.cjs} +1 -1
  16. package/dist/{Topbar-YfsC1DZ2.js → Topbar-VdVqOT-8.js} +1 -1
  17. package/dist/UILibrariesPanel-CaGLzB9c.cjs +1 -0
  18. package/dist/UILibrariesPanel-raxCToMd.js +216 -0
  19. package/dist/{add-page-modal-CtMwNEsW.js → add-page-modal-OH7DL-Yz.js} +2 -2
  20. package/dist/{add-page-modal-DA5P4pVu.cjs → add-page-modal-VmIvQ5ug.cjs} +1 -1
  21. package/dist/core.cjs +1 -1
  22. package/dist/core.js +1 -1
  23. package/dist/{delete-page-modal-TMpN1Dvm.js → delete-page-modal--g92Sj1h.js} +2 -2
  24. package/dist/{delete-page-modal-AvUZI9Tk.cjs → delete-page-modal-uSFaC2aS.cjs} +1 -1
  25. package/dist/email.cjs +1 -1
  26. package/dist/email.js +1 -1
  27. package/dist/{index-IgLSTkN6.js → index--t_K8Sw6.js} +1 -1
  28. package/dist/{index-zaKhyTQ6.cjs → index-4C2qT6ju.cjs} +1 -1
  29. package/dist/{index-sspgZwTk.cjs → index-Phf9F3An.cjs} +1 -1
  30. package/dist/{index--hN9ZQsP.js → index-yVCgnTlS.js} +2 -2
  31. package/dist/mockServiceWorker.js +18 -10
  32. package/dist/{page-viewer-D8nsi13f.js → page-viewer-hBsE440V.js} +3 -3
  33. package/dist/{page-viewer-2BMSxxfd.cjs → page-viewer-yIl2jRO8.cjs} +1 -1
  34. package/dist/{project-general-setting-HGjTNFRx.js → project-general-setting-9AGMKDNq.js} +2 -2
  35. package/dist/{project-general-setting--0hX9Otn.cjs → project-general-setting-NFCzMKqN.cjs} +1 -1
  36. package/dist/{single-page-detail-eMnjt_Ih.js → single-page-detail-5qDQmlL-.js} +3 -3
  37. package/dist/{single-page-detail-7BpYAyMO.cjs → single-page-detail-wwJYm5lF.cjs} +1 -1
  38. package/dist/studio.cjs +1 -1
  39. package/dist/studio.js +2 -2
  40. package/package.json +1 -1
  41. package/dist/CanvasArea-UisRL54b.cjs +0 -56
  42. package/dist/Settings-7EMwx6zL.cjs +0 -1
  43. package/dist/UILibrariesPanel-5QxxXYg2.js +0 -191
  44. package/dist/UILibrariesPanel-r8nQzXQ-.cjs +0 -1
@@ -3,7 +3,7 @@ import { Q as h, az as f, aA as j, aB as y, aC as v, aD as P } from "./index-uLn
3
3
  import { sortBy as C, filter as b, get as w, isEmpty as m, find as n, capitalize as N, map as S } from "lodash-es";
4
4
  import { toast as k } from "sonner";
5
5
  import { useEffect as p } from "react";
6
- import { a as B, u as E, c as T, d as z } from "./index--hN9ZQsP.js";
6
+ import { a as B, u as E, c as T, d as z } from "./index-yVCgnTlS.js";
7
7
  import { BriefcaseIcon as A } from "lucide-react";
8
8
  import { useTranslation as D } from "react-i18next";
9
9
  import "./_commonjsHelpers-UyOWmZb0.js";
@@ -40,7 +40,7 @@ import "@chaibuilder/runtime";
40
40
  import "jotai";
41
41
  import "@react-hookz/web";
42
42
  import "tree-model";
43
- import "./index-IgLSTkN6.js";
43
+ import "./index--t_K8Sw6.js";
44
44
  import "i18next";
45
45
  import "@floating-ui/react-dom";
46
46
  import "flagged";
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),s=require("./index-0FIxW0gR.cjs"),i=require("lodash-es"),j=require("sonner"),l=require("react"),o=require("./index-zaKhyTQ6.cjs"),p=require("lucide-react"),f=require("react-i18next");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-D_vtk3zK.cjs");require("./MODIFIERS-mVmfEGgo.cjs");require("clsx");require("tailwind-merge");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-icons");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("./Functions-N3yhPYKY.cjs");require("@chaibuilder/runtime");require("jotai");require("@react-hookz/web");require("tree-model");require("./index-sspgZwTk.cjs");require("i18next");require("@floating-ui/react-dom");require("flagged");require("react-hotkeys-hook");require("./index--mLLy7QQ.cjs");require("./html-to-json-ndxaXRT8.cjs");require("himalaya");require("lodash");const E=()=>{const{data:t}=o.useProject(),{data:u,isLoading:x}=o.usePages(),{saveState:d}=s.useSavePage(),m=o.useChangePage(),{t:q}=f.useTranslation(),[n,a]=o.useCurrentPage(),c=i.sortBy(i.filter(u,{type:"STATIC"}),r=>i.get(r,"uuid")===(t==null?void 0:t.homepage)?0:1);l.useEffect(()=>{!i.isEmpty(u)&&t.homepage&&!i.find(u,{uuid:n})&&a(t.homepage)},[n,u,t,a]),l.useEffect(()=>()=>a(null),[a]);const g=r=>{if(d!=="SAVED")j.toast.error(q("You have unsaved changes. Please save before changing the page."));else{const h=i.find(c,{uuid:r});m(h)}};return x||i.isEmpty(n)?null:e.jsxRuntimeExports.jsx("nav",{className:"flex rounded-lg border border-gray-200 bg-gray-50 px-3 py-1 pr-0 text-gray-700 dark:border-gray-700 dark:bg-gray-800","aria-label":"Breadcrumb",children:e.jsxRuntimeExports.jsxs("ol",{className:"inline-flex items-center space-x-1 md:space-x-3",children:[e.jsxRuntimeExports.jsx("li",{className:"inline-flex items-center",children:e.jsxRuntimeExports.jsxs("div",{className:"inline-flex items-center text-sm font-medium text-gray-500 dark:text-gray-400",children:[e.jsxRuntimeExports.jsx(p.BriefcaseIcon,{className:"mr-2 h-4 w-4"}),i.capitalize(t.name)]})}),e.jsxRuntimeExports.jsx("li",{"aria-current":"page",children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[e.jsxRuntimeExports.jsx("svg",{className:"mx-1 h-3 w-3 text-gray-400","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 6 10",children:e.jsxRuntimeExports.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"m1 9 4-4-4-4"})}),e.jsxRuntimeExports.jsxs(s.Select,{value:n||"",onValueChange:g,children:[e.jsxRuntimeExports.jsx(s.SelectTrigger,{className:"h-max border-0 py-0 text-sm font-medium text-gray-600 shadow-none outline-none ring-0 focus:ring-0 dark:text-gray-400",children:e.jsxRuntimeExports.jsx(s.SelectValue,{placeholder:"Page"})}),e.jsxRuntimeExports.jsx(s.SelectContent,{className:"z-[999]",children:i.map(c,r=>e.jsxRuntimeExports.jsx(s.SelectItem,{value:r.uuid,children:r==null?void 0:r.name},r.uuid))})]})]})})]})})};exports.default=E;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),s=require("./index-0FIxW0gR.cjs"),i=require("lodash-es"),j=require("sonner"),l=require("react"),o=require("./index-4C2qT6ju.cjs"),p=require("lucide-react"),f=require("react-i18next");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-D_vtk3zK.cjs");require("./MODIFIERS-mVmfEGgo.cjs");require("clsx");require("tailwind-merge");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-icons");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("./Functions-N3yhPYKY.cjs");require("@chaibuilder/runtime");require("jotai");require("@react-hookz/web");require("tree-model");require("./index-Phf9F3An.cjs");require("i18next");require("@floating-ui/react-dom");require("flagged");require("react-hotkeys-hook");require("./index--mLLy7QQ.cjs");require("./html-to-json-ndxaXRT8.cjs");require("himalaya");require("lodash");const E=()=>{const{data:t}=o.useProject(),{data:u,isLoading:x}=o.usePages(),{saveState:d}=s.useSavePage(),m=o.useChangePage(),{t:q}=f.useTranslation(),[n,a]=o.useCurrentPage(),c=i.sortBy(i.filter(u,{type:"STATIC"}),r=>i.get(r,"uuid")===(t==null?void 0:t.homepage)?0:1);l.useEffect(()=>{!i.isEmpty(u)&&t.homepage&&!i.find(u,{uuid:n})&&a(t.homepage)},[n,u,t,a]),l.useEffect(()=>()=>a(null),[a]);const g=r=>{if(d!=="SAVED")j.toast.error(q("You have unsaved changes. Please save before changing the page."));else{const h=i.find(c,{uuid:r});m(h)}};return x||i.isEmpty(n)?null:e.jsxRuntimeExports.jsx("nav",{className:"flex rounded-lg border border-gray-200 bg-gray-50 px-3 py-1 pr-0 text-gray-700 dark:border-gray-700 dark:bg-gray-800","aria-label":"Breadcrumb",children:e.jsxRuntimeExports.jsxs("ol",{className:"inline-flex items-center space-x-1 md:space-x-3",children:[e.jsxRuntimeExports.jsx("li",{className:"inline-flex items-center",children:e.jsxRuntimeExports.jsxs("div",{className:"inline-flex items-center text-sm font-medium text-gray-500 dark:text-gray-400",children:[e.jsxRuntimeExports.jsx(p.BriefcaseIcon,{className:"mr-2 h-4 w-4"}),i.capitalize(t.name)]})}),e.jsxRuntimeExports.jsx("li",{"aria-current":"page",children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[e.jsxRuntimeExports.jsx("svg",{className:"mx-1 h-3 w-3 text-gray-400","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 6 10",children:e.jsxRuntimeExports.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"m1 9 4-4-4-4"})}),e.jsxRuntimeExports.jsxs(s.Select,{value:n||"",onValueChange:g,children:[e.jsxRuntimeExports.jsx(s.SelectTrigger,{className:"h-max border-0 py-0 text-sm font-medium text-gray-600 shadow-none outline-none ring-0 focus:ring-0 dark:text-gray-400",children:e.jsxRuntimeExports.jsx(s.SelectValue,{placeholder:"Page"})}),e.jsxRuntimeExports.jsx(s.SelectContent,{className:"z-[999]",children:i.map(c,r=>e.jsxRuntimeExports.jsx(s.SelectItem,{value:r.uuid,children:r==null?void 0:r.name},r.uuid))})]})]})})]})})};exports.default=E;
@@ -3,7 +3,7 @@ import React__default, { memo, useMemo, useCallback, useEffect, useRef } from "r
3
3
  import { useAtom } from "jotai";
4
4
  import { useDebouncedCallback } from "@react-hookz/web";
5
5
  import { Tree } from "react-arborist";
6
- import { D as useBlocksStore, r as useSelectedBlockIds, s as useRemoveBlocks, ai as useSelectedBlock, bC as ContextMenuItem, b2 as canDeleteBlock, t as useDuplicateBlocks, bD as ContextMenuContent, b1 as canDuplicateBlock, bE as ContextMenu, bF as ContextMenuTrigger, h as useBuilderProp, ad as useHighlightBlockId, b5 as canAcceptChildBlock, aF as Tooltip, aG as TooltipTrigger, aH as TooltipContent, bG as treeDSBlocks, am as useUpdateBlocksProps, at as useSelectedStylingBlocks, aW as useBlocksStoreUndoableActions, a$ as treeRefAtom } from "./index-uLn8W3eR.js";
6
+ import { D as useBlocksStore, r as useSelectedBlockIds, s as useRemoveBlocks, ai as useSelectedBlock, bC as ContextMenuItem, b2 as canDeleteBlock, t as useDuplicateBlocks, bD as ContextMenuContent, b1 as canDuplicateBlock, bE as ContextMenu, bF as ContextMenuTrigger, h as useBuilderProp, b7 as canvasIframeAtom, b5 as canAcceptChildBlock, aF as Tooltip, aG as TooltipTrigger, aH as TooltipContent, bG as treeDSBlocks, am as useUpdateBlocksProps, at as useSelectedStylingBlocks, aW as useBlocksStoreUndoableActions, a$ as treeRefAtom } from "./index-uLn8W3eR.js";
7
7
  import { c as cn } from "./Functions-7jnEwJyw.js";
8
8
  import { BoxModelIcon, BoxIcon, DragHandleHorizontalIcon, ViewHorizontalIcon, BorderAllIcon, BorderTopIcon, TableIcon, DropdownMenuIcon, RadiobuttonIcon, InputIcon, ButtonIcon, CheckboxIcon, GroupIcon, SpaceBetweenVerticallyIcon, ColumnsIcon, RowsIcon, TextIcon, SketchLogoIcon, DividerHorizontalIcon, CodeIcon, CursorTextIcon, VideoIcon, Link1Icon, HeadingIcon, ImageIcon, TrashIcon, CopyIcon, TriangleRightIcon } from "@radix-ui/react-icons";
9
9
  import { DatabaseIcon } from "lucide-react";
@@ -107,18 +107,18 @@ const TypeIcon = (a) => {
107
107
  alignItems: "center",
108
108
  zIndex: 1
109
109
  }, DefaultCursor = React__default.memo(function({ top: l, left: r }) {
110
- const n = {
110
+ const o = {
111
111
  position: "absolute",
112
112
  pointerEvents: "none",
113
113
  top: l + "px",
114
114
  left: r + "px",
115
115
  right: 0
116
116
  };
117
- return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { ...placeholderStyle, ...n }, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "h-0.5 flex-1 rounded-[1px] bg-green-500" }) });
117
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { ...placeholderStyle, ...o }, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "h-0.5 flex-1 rounded-[1px] bg-green-500" }) });
118
118
  }), Overlay = memo(function({ children: l, isDragging: r }) {
119
119
  return r ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "pointer-events-none fixed left-0 top-0 z-[100] h-full w-full", children: l }) : null;
120
120
  }), DefaultDragPreview = memo(({ id: a, isDragging: l, mouse: r }) => {
121
- const [n] = useBlocksStore(), i = useMemo(() => n.find((c) => c._id === a), [n, a]), d = useMemo(
121
+ const [o] = useBlocksStore(), i = useMemo(() => o.find((M) => M._id === a), [o, a]), c = useMemo(
122
122
  () => ({
123
123
  transform: `translate(${(r == null ? void 0 : r.x) - 10}px, ${(r == null ? void 0 : r.y) - 10}px)`
124
124
  }),
@@ -128,7 +128,7 @@ const TypeIcon = (a) => {
128
128
  "div",
129
129
  {
130
130
  className: "pointer-events-none absolute z-50 rounded border border-gray-200 bg-gray-100/80 font-semibold text-blue-600 shadow-md dark:border-gray-700 dark:bg-gray-800",
131
- style: d,
131
+ style: c,
132
132
  children: /* @__PURE__ */ jsxRuntimeExports.jsxs("button", { type: "button", className: "flex !cursor-grab items-center p-0.5", "aria-label": `Type: ${i == null ? void 0 : i._type}`, children: [
133
133
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "-mt-0.5 h-3 w-3", children: /* @__PURE__ */ jsxRuntimeExports.jsx(TypeIcon, { type: i == null ? void 0 : i._type }) }),
134
134
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ml-2 truncate text-[11px]", children: (i == null ? void 0 : i._name) || (i == null ? void 0 : i._type) })
@@ -150,7 +150,7 @@ const TypeIcon = (a) => {
150
150
  }
151
151
  );
152
152
  }, BlockContextMenuContent = () => {
153
- const [a] = useSelectedBlockIds(), l = useDuplicateBlocks(), r = useSelectedBlock(), n = useCallback(() => {
153
+ const [a] = useSelectedBlockIds(), l = useDuplicateBlocks(), r = useSelectedBlock(), o = useCallback(() => {
154
154
  l(a);
155
155
  }, [a, l]);
156
156
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(ContextMenuContent, { className: "text-xs", children: [
@@ -159,7 +159,7 @@ const TypeIcon = (a) => {
159
159
  {
160
160
  disabled: !canDuplicateBlock(r == null ? void 0 : r._type),
161
161
  className: "flex items-center gap-x-4 text-xs",
162
- onClick: n,
162
+ onClick: o,
163
163
  children: [
164
164
  /* @__PURE__ */ jsxRuntimeExports.jsx(CopyIcon, {}),
165
165
  " Duplicate"
@@ -196,8 +196,8 @@ function selectPrev(a) {
196
196
  a.select(l.id);
197
197
  }
198
198
  const selectParent = (a, l) => {
199
- var n;
200
- const r = ((n = a.selectedIds[0]) == null ? void 0 : n.parent) || null;
199
+ var o;
200
+ const r = ((o = a.selectedIds[0]) == null ? void 0 : o.parent) || null;
201
201
  r && l && a.select(r.id);
202
202
  }, open = (a, l) => {
203
203
  const r = a.selectedNodes[0];
@@ -25506,39 +25506,60 @@ function TbZzz(a) {
25506
25506
  return GenIcon({ tag: "svg", attr: { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { d: "M4 12h6l-6 8h6" }, child: [] }, { tag: "path", attr: { d: "M14 4h6l-6 8h6" }, child: [] }] })(a);
25507
25507
  }
25508
25508
  const Node = memo(({ node: a, style: l, dragHandle: r }) => {
25509
- const n = useBuilderProp("outlineMenuItems", []), [, i] = useHighlightBlockId(), d = a.children.length > 0, { id: c, data: h, isSelected: f, willReceiveDrop: u, isDragging: k, isEditing: L, handleClick: C } = a, B = useDebouncedCallback((o) => i(o), [], 300), m = (o) => {
25510
- o.stopPropagation(), a.toggle();
25511
- }, z = (o) => {
25512
- o.stopPropagation(), a.isOpen || a.toggle(), C(o);
25509
+ const o = useBuilderProp("outlineMenuItems", []), [i] = useAtom(canvasIframeAtom);
25510
+ let c = null;
25511
+ const M = a.children.length > 0, { id: d, data: h, isSelected: m, willReceiveDrop: k, isDragging: L, isEditing: z, handleClick: w } = a, x = (n) => {
25512
+ n.stopPropagation(), a.toggle();
25513
+ }, I = (n) => {
25514
+ n.isInternal && (c = n.isOpen, n.isOpen && n.close());
25515
+ }, G = (n) => {
25516
+ n.isInternal && c !== null && (c ? n.open() : n.close(), c = null);
25517
+ }, V = (n) => {
25518
+ n.stopPropagation(), a.isOpen || a.toggle(), w(n);
25513
25519
  };
25514
25520
  useEffect(() => {
25515
- const o = setTimeout(() => {
25516
- u && !a.isOpen && a.toggle();
25521
+ const n = setTimeout(() => {
25522
+ k && !a.isOpen && !L && a.toggle();
25517
25523
  }, 500);
25518
- return () => clearTimeout(o);
25519
- }, [u, a]);
25520
- const p = useMemo(() => {
25521
- const o = Object.keys(h), g = [];
25522
- for (let v = 0; v < o.length; v++)
25523
- if (o[v].endsWith("_attrs")) {
25524
- const w = h[o[v]], M = Object.keys(w).join("|");
25525
- M.match(/x-data/) && g.push("data"), M.match(/x-on:|@click/) && g.push("event"), M.match(/x-show/) && g.push("show");
25524
+ return () => clearTimeout(n);
25525
+ }, [k, a, L]);
25526
+ const C = useMemo(() => {
25527
+ const n = Object.keys(h), u = [];
25528
+ for (let v = 0; v < n.length; v++)
25529
+ if (n[v].endsWith("_attrs")) {
25530
+ const p = h[n[v]], g = Object.keys(p).join("|");
25531
+ g.match(/x-data/) && u.push("data"), g.match(/x-on/) && u.push("event"), g.match(/x-show|x-if/) && u.push("show");
25526
25532
  }
25527
- return g;
25528
- }, [h]);
25529
- return /* @__PURE__ */ jsxRuntimeExports.jsx(BlockContextMenu, { id: c, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
25533
+ return u;
25534
+ }, [h]), B = (n, u) => {
25535
+ const v = i.contentDocument || i.contentWindow.document, p = v.querySelector(`[data-block-id=${n}]`);
25536
+ p && p.setAttribute("data-drop", u);
25537
+ const g = p.getBoundingClientRect(), f = i.getBoundingClientRect();
25538
+ g.top >= f.top && g.left >= f.left && g.bottom <= f.bottom && g.right <= f.right || (v.documentElement.scrollTop = p.offsetTop - f.top);
25539
+ };
25540
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(BlockContextMenu, { id: d, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
25530
25541
  "div",
25531
25542
  {
25532
- onClick: z,
25533
- onMouseEnter: () => B(c),
25543
+ onClick: V,
25534
25544
  style: l,
25535
- "data-node-id": c,
25545
+ "data-node-id": d,
25536
25546
  ref: r,
25547
+ onDragStart: () => I(a),
25548
+ onDragEnd: () => G(a),
25549
+ onDragOver: (n) => {
25550
+ n.preventDefault(), B(d, "yes");
25551
+ },
25552
+ onDragLeave: (n) => {
25553
+ n.preventDefault(), B(d, "no");
25554
+ },
25555
+ onDrop: (n) => {
25556
+ n.preventDefault(), B(d, "no");
25557
+ },
25537
25558
  className: cn(
25538
25559
  "group flex !h-fit w-full items-center justify-between space-x-px py-px outline-none",
25539
- f ? "bg-blue-500 text-white" : "text-gray-600 hover:bg-gray-200 dark:hover:bg-gray-800",
25540
- u && canAcceptChildBlock(h._type, "Icon") ? "bg-green-200" : "",
25541
- k && "opacity-20"
25560
+ m ? "bg-blue-500 text-white" : "text-gray-600 hover:bg-gray-200 dark:hover:bg-gray-800",
25561
+ k && canAcceptChildBlock(h._type, "Icon") ? "bg-green-200" : "",
25562
+ L && "opacity-20"
25542
25563
  ),
25543
25564
  children: [
25544
25565
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center", children: [
@@ -25546,38 +25567,38 @@ const Node = memo(({ node: a, style: l, dragHandle: r }) => {
25546
25567
  "div",
25547
25568
  {
25548
25569
  className: `flex h-4 w-4 rotate-0 transform cursor-pointer items-center justify-center text-xs transition-transform duration-100 ${a.isOpen ? "rotate-90" : ""}`,
25549
- children: d && /* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick: m, type: "button", children: /* @__PURE__ */ jsxRuntimeExports.jsx(TriangleRightIcon, {}) })
25570
+ children: M && /* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick: x, type: "button", children: /* @__PURE__ */ jsxRuntimeExports.jsx(TriangleRightIcon, {}) })
25550
25571
  }
25551
25572
  ),
25552
25573
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center", children: [
25553
25574
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "-mt-0.5 h-3 w-3", children: /* @__PURE__ */ jsxRuntimeExports.jsx(TypeIcon, { type: h == null ? void 0 : h._type }) }),
25554
- L ? /* @__PURE__ */ jsxRuntimeExports.jsx(Input, { node: a }) : /* @__PURE__ */ jsxRuntimeExports.jsxs(
25575
+ z ? /* @__PURE__ */ jsxRuntimeExports.jsx(Input, { node: a }) : /* @__PURE__ */ jsxRuntimeExports.jsxs(
25555
25576
  "div",
25556
25577
  {
25557
25578
  className: "ml-2 flex items-center gap-x-1 truncate text-[11px]",
25558
- onDoubleClick: (o) => {
25559
- o.stopPropagation(), a.edit(), a.deselect();
25579
+ onDoubleClick: (n) => {
25580
+ n.stopPropagation(), a.edit(), a.deselect();
25560
25581
  },
25561
25582
  children: [
25562
25583
  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: (h == null ? void 0 : h._name) || (h == null ? void 0 : h._type.split("/").pop()) }),
25563
- p.includes("data") && /* @__PURE__ */ jsxRuntimeExports.jsx(VscJson, { className: "h-3 w-3 text-orange-600" }),
25564
- p.includes("event") && /* @__PURE__ */ jsxRuntimeExports.jsx(BsLightningFill, { className: "h-3 w-3 text-yellow-500" }),
25565
- p.includes("show") && /* @__PURE__ */ jsxRuntimeExports.jsx(TbEyeDown, { className: "h-3 w-3 text-orange-600" })
25584
+ C.includes("data") && /* @__PURE__ */ jsxRuntimeExports.jsx(VscJson, { className: "h-3 w-3 text-orange-600" }),
25585
+ C.includes("event") && /* @__PURE__ */ jsxRuntimeExports.jsx(BsLightningFill, { className: "h-3 w-3 text-yellow-500" }),
25586
+ C.includes("show") && /* @__PURE__ */ jsxRuntimeExports.jsx(TbEyeDown, { className: "h-3 w-3 text-orange-600" })
25566
25587
  ]
25567
25588
  }
25568
25589
  )
25569
25590
  ] })
25570
25591
  ] }),
25571
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "invisible flex items-center space-x-1 pr-2 group-hover:visible", children: n.map((o) => /* @__PURE__ */ jsxRuntimeExports.jsxs(Tooltip, { children: [
25592
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "invisible flex items-center space-x-1 pr-2 group-hover:visible", children: o.map((n) => /* @__PURE__ */ jsxRuntimeExports.jsxs(Tooltip, { children: [
25572
25593
  /* @__PURE__ */ jsxRuntimeExports.jsx(
25573
25594
  TooltipTrigger,
25574
25595
  {
25575
25596
  className: "cursor-pointer rounded bg-transparent hover:bg-white hover:text-blue-500",
25576
25597
  asChild: !0,
25577
- children: React__default.createElement(o.item, { blockId: c })
25598
+ children: React__default.createElement(n.item, { blockId: d })
25578
25599
  }
25579
25600
  ),
25580
- /* @__PURE__ */ jsxRuntimeExports.jsx(TooltipContent, { className: "z-[9999]", children: o.tooltip })
25601
+ /* @__PURE__ */ jsxRuntimeExports.jsx(TooltipContent, { className: "z-[9999]", children: n.tooltip })
25581
25602
  ] })) })
25582
25603
  ]
25583
25604
  }
@@ -25591,22 +25612,22 @@ const Node = memo(({ node: a, style: l, dragHandle: r }) => {
25591
25612
  className: "ml-2 w-full rounded-sm border border-black/30 bg-transparent px-1 text-[11px] outline-none",
25592
25613
  type: "text",
25593
25614
  defaultValue: ((l = a.data) == null ? void 0 : l._name) || ((r = a.data) == null ? void 0 : r._type),
25594
- onFocus: (n) => n.currentTarget.select(),
25595
- onBlur: (n) => a.submit(n.currentTarget.value),
25596
- onKeyDown: (n) => {
25597
- n.key === "Enter" && a.submit(n.currentTarget.value);
25615
+ onFocus: (o) => o.currentTarget.select(),
25616
+ onBlur: (o) => a.submit(o.currentTarget.value),
25617
+ onKeyDown: (o) => {
25618
+ o.key === "Enter" && a.submit(o.currentTarget.value);
25598
25619
  }
25599
25620
  }
25600
25621
  );
25601
25622
  }, useCanMove = () => {
25602
25623
  const [a] = useBlocksStore();
25603
25624
  return (l, r) => {
25604
- var d;
25605
- const n = (d = find(a, { _id: r })) == null ? void 0 : d._type, i = first(l.map((c) => {
25606
- var h;
25607
- return (h = find(a, { _id: c })) == null ? void 0 : h._type;
25625
+ var c;
25626
+ const o = (c = find(a, { _id: r })) == null ? void 0 : c._type, i = first(l.map((M) => {
25627
+ var d;
25628
+ return (d = find(a, { _id: M })) == null ? void 0 : d._type;
25608
25629
  }));
25609
- return canAcceptChildBlock(n, i);
25630
+ return canAcceptChildBlock(o, i);
25610
25631
  };
25611
25632
  }, ListTree = () => {
25612
25633
  const [treeData] = useAtom(treeDSBlocks), [ids, setIds] = useSelectedBlockIds(), updateBlockProps = useUpdateBlocksProps(), [, setStyleBlocks] = useSelectedStylingBlocks(), { moveBlocks } = useBlocksStoreUndoableActions(), canMove = useCanMove(), treeRef = useRef(null), [, setTreeRef] = useAtom(treeRefAtom), { t } = useTranslation(), clearSelection = () => {
@@ -25625,9 +25646,9 @@ const Node = memo(({ node: a, style: l, dragHandle: r }) => {
25625
25646
  const l = a[0] ? a[0].id : "";
25626
25647
  setStyleBlocks([]), setIds([l]);
25627
25648
  }, onContextMenu = (a) => {
25628
- var n;
25649
+ var o;
25629
25650
  a.preventDefault();
25630
- const l = a.target, r = l.getAttribute("data-node-id") || ((n = l.closest("[data-node-id]")) == null ? void 0 : n.getAttribute("data-node-id"));
25651
+ const l = a.target, r = l.getAttribute("data-node-id") || ((o = l.closest("[data-node-id]")) == null ? void 0 : o.getAttribute("data-node-id"));
25631
25652
  r && (setStyleBlocks([]), setIds([r]));
25632
25653
  }, debouncedDisableDrop = useDebouncedCallback(
25633
25654
  ({ parentNode: a, dragNodes: l }) => {