@chaibuilder/sdk 1.1.3 → 1.1.5

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 (62) hide show
  1. package/dist/{AddBlocks-P3qHuE5J.cjs → AddBlocks-EBCXennD.cjs} +1 -1
  2. package/dist/{AddBlocks-imyQSCbI.js → AddBlocks-a2VUDT5t.js} +20 -20
  3. package/dist/{BrandingOptions-_2XBEPab.cjs → BrandingOptions-kjj0QNch.cjs} +1 -1
  4. package/dist/{BrandingOptions-tSNtQ1Kv.js → BrandingOptions-uU1nNRzP.js} +1 -1
  5. package/dist/CanvasArea-4ZhFTrfG.js +1426 -0
  6. package/dist/CanvasArea-_xT5Zr6U.cjs +59 -0
  7. package/dist/{CurrentPage--5VHTFmg.cjs → CurrentPage-NYsAabGv.cjs} +1 -1
  8. package/dist/{CurrentPage-ZjBcAU3o.js → CurrentPage-UcUSZ81g.js} +5 -5
  9. package/dist/{Layers-Qv1k4eqT.cjs → Layers-4Qo1Flcd.cjs} +1 -1
  10. package/dist/{Layers-RfOxPx_V.js → Layers-gtpXghW3.js} +15 -15
  11. package/dist/{MarkAsGlobalBlock-p_wvHkQZ.cjs → MarkAsGlobalBlock-E_w2sPGA.cjs} +1 -1
  12. package/dist/{MarkAsGlobalBlock-aqik3ouc.js → MarkAsGlobalBlock-vWOYzFKX.js} +1 -1
  13. package/dist/{PagesPanel-pQjl_qzS.cjs → PagesPanel-ebglMsO0.cjs} +1 -1
  14. package/dist/{PagesPanel-yOrHqpUR.js → PagesPanel-wkwMGcgn.js} +3 -3
  15. package/dist/{ProjectPanel-64NTjmau.js → ProjectPanel-HMY5d4po.js} +5 -5
  16. package/dist/{ProjectPanel-U4uQPSn8.cjs → ProjectPanel-PTTgh8uA.cjs} +1 -1
  17. package/dist/{Settings-2b17z_GV.js → Settings-Qxq1frcT.js} +294 -303
  18. package/dist/Settings-WK2g5ehT.cjs +1 -0
  19. package/dist/{SidePanels-gNBjhSWG.js → SidePanels-E-K69HnO.js} +9 -9
  20. package/dist/{SidePanels-auE-bKNc.cjs → SidePanels-fXTJlJLG.cjs} +1 -1
  21. package/dist/{Topbar-ZjAs5fDc.cjs → Topbar-b9Vt5SLF.cjs} +1 -1
  22. package/dist/{Topbar-Jc74a6oE.js → Topbar-oZ167R8x.js} +5 -5
  23. package/dist/UnsplashImages-dMdYJI8B.cjs +1 -0
  24. package/dist/{UnsplashImages-_PxEYx5c.js → UnsplashImages-yN_5vrmM.js} +5 -5
  25. package/dist/UploadImages-2h2MuCU2.cjs +1 -0
  26. package/dist/{UploadImages-zzSgKmP9.js → UploadImages-yVZs49iB.js} +29 -29
  27. package/dist/{add-page-modal-OukBwf5E.js → add-page-modal-f-4vS_9F.js} +3 -3
  28. package/dist/{add-page-modal-BREwIMPz.cjs → add-page-modal-vheD0KJZ.cjs} +1 -1
  29. package/dist/{confirm-alert-mzlwOW9w.cjs → confirm-alert-4bi7bxtP.cjs} +1 -1
  30. package/dist/{confirm-alert-2JxcNf3T.js → confirm-alert-iNzeta1I.js} +1 -1
  31. package/dist/core.cjs +1 -1
  32. package/dist/core.d.ts +0 -25
  33. package/dist/core.js +51 -55
  34. package/dist/{delete-page-modal-UWn_sHLC.cjs → delete-page-modal-Ex2OsWt4.cjs} +1 -1
  35. package/dist/{delete-page-modal-RZXdqvje.js → delete-page-modal-TmPs3b_D.js} +2 -2
  36. package/dist/{form-TQ7vwDYO.js → form-dmyeQkyn.js} +1 -1
  37. package/dist/{form-bSW-Pkw9.cjs → form-wY4tsyip.cjs} +1 -1
  38. package/dist/index-U_pW4Tkc.cjs +1 -0
  39. package/dist/{index-ORFlyrBx.js → index-bKgIzodL.js} +874 -878
  40. package/dist/{index-yo8mH0u8.cjs → index-ghpTTOME.cjs} +2 -2
  41. package/dist/{index-CMHxUxre.js → index-rz6hkGcq.js} +4 -4
  42. package/dist/{page-viewer-rPTxX-Lu.cjs → page-viewer-nVNwY5Ht.cjs} +1 -1
  43. package/dist/{page-viewer-PZRWwKP6.js → page-viewer-xLhBfvgr.js} +3 -3
  44. package/dist/{project-general-setting-FVlRHFpF.cjs → project-general-setting-8wv-2jG9.cjs} +1 -1
  45. package/dist/{project-general-setting-UzPhnhWp.js → project-general-setting-uCeWGv95.js} +3 -3
  46. package/dist/{project-seo-setting-cERASO9j.cjs → project-seo-setting-57XXrUTn.cjs} +1 -1
  47. package/dist/{project-seo-setting-k0HlefUD.js → project-seo-setting-dRUW-Zmp.js} +2 -2
  48. package/dist/{single-page-detail-Ftozh79X.cjs → single-page-detail-bGBYvzQx.cjs} +1 -1
  49. package/dist/{single-page-detail-Jb-S30JL.js → single-page-detail-kNdE5nsi.js} +4 -4
  50. package/dist/studio.cjs +1 -1
  51. package/dist/studio.js +2 -2
  52. package/dist/ui.cjs +1 -1
  53. package/dist/ui.js +41 -41
  54. package/dist/{useAddBlockByDrop-UA_Iw_4l.js → useAddBlockByDrop-LM3owe-j.js} +1 -1
  55. package/dist/{useAddBlockByDrop-DPV32UHP.cjs → useAddBlockByDrop-qOKe8QVt.cjs} +1 -1
  56. package/package.json +1 -1
  57. package/dist/CanvasArea-E0Mu1Cwe.cjs +0 -58
  58. package/dist/CanvasArea-K9fOlyJl.js +0 -1419
  59. package/dist/Settings-4XckYyzK.cjs +0 -1
  60. package/dist/UnsplashImages-nXceZLmd.cjs +0 -1
  61. package/dist/UploadImages-tcQb5NZu.cjs +0 -1
  62. package/dist/index-zkc4SQCu.cjs +0 -1
@@ -2,11 +2,11 @@ import { j as s } from "./jsx-runtime-NV737rRe.js";
2
2
  import I, { useState as j, useEffect as z } from "react";
3
3
  import { isString as L, isEmpty as x, isEqual as C, omit as y, kebabCase as B } from "lodash";
4
4
  import { HomeIcon as G } from "@radix-ui/react-icons";
5
- import { br as Y, B as q } from "./index-ORFlyrBx.js";
5
+ import { bo as Y, B as q } from "./index-bKgIzodL.js";
6
6
  import { u as g, b as Z, g as $, o as F, r as Q } from "./controls-G0puEH71.js";
7
7
  import { toast as U } from "sonner";
8
- import { F as h } from "./form-TQ7vwDYO.js";
9
- import { h as V, b as X, i as _, c as K } from "./index-CMHxUxre.js";
8
+ import { F as h } from "./form-dmyeQkyn.js";
9
+ import { h as V, b as X, i as _, c as K } from "./index-rz6hkGcq.js";
10
10
  import "./MODIFIERS-MLfpKQY1.js";
11
11
  import "@radix-ui/react-toggle";
12
12
  import "class-variance-authority";
@@ -60,7 +60,7 @@ import "@tailwindcss/line-clamp";
60
60
  import "./tailwind-config-d1VL1lzE.js";
61
61
  import "react-hotkeys-hook";
62
62
  import "lucide-react";
63
- const O = I.lazy(() => import("./delete-page-modal-RZXdqvje.js")), J = I.lazy(() => import("./confirm-alert-2JxcNf3T.js")), P = (r) => {
63
+ const O = I.lazy(() => import("./delete-page-modal-TmPs3b_D.js")), J = I.lazy(() => import("./confirm-alert-iNzeta1I.js")), P = (r) => {
64
64
  if (!L(r) || !(r.includes("/[") && r.includes("]")))
65
65
  return !1;
66
66
  const t = /^\[((?:\.{3})?[a-zA-Z0-9_-]+)\]$/, p = /^[a-zA-Z0-9_-]+$/;
package/dist/studio.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./jsx-runtime-WUGKV8jN.cjs");const e=require("./index-yo8mH0u8.cjs");require("react");require("sonner");require("./MODIFIERS-WFzDQfiT.cjs");require("i18next");require("react-i18next");require("./index-zkc4SQCu.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-It2K33fU.cjs");require("lodash");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("jotai");require("flat-to-nested");require("redux-undo");require("@chaibuilder/runtime");require("@react-hookz/web");require("@floating-ui/react-dom");require("react-textarea-autosize");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("./lib.cjs");require("himalaya");require("./functions-KMQYiBHf.cjs");require("@mhsdesign/jit-browser-tailwindcss");require("@bobthered/tailwindcss-palette-generator");require("@tailwindcss/forms");require("@tailwindcss/typography");require("@tailwindcss/aspect-ratio");require("@tailwindcss/line-clamp");require("./tailwind-config-OxLD7oFU.cjs");require("react-hotkeys-hook");require("lucide-react");exports.ChaiBuilderStudio=e.ChaiBuilderStudio;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./jsx-runtime-WUGKV8jN.cjs");const e=require("./index-ghpTTOME.cjs");require("react");require("sonner");require("./MODIFIERS-WFzDQfiT.cjs");require("i18next");require("react-i18next");require("./index-U_pW4Tkc.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-It2K33fU.cjs");require("lodash");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("jotai");require("flat-to-nested");require("redux-undo");require("@chaibuilder/runtime");require("@react-hookz/web");require("@floating-ui/react-dom");require("react-textarea-autosize");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("./lib.cjs");require("himalaya");require("./functions-KMQYiBHf.cjs");require("@mhsdesign/jit-browser-tailwindcss");require("@bobthered/tailwindcss-palette-generator");require("@tailwindcss/forms");require("@tailwindcss/typography");require("@tailwindcss/aspect-ratio");require("@tailwindcss/line-clamp");require("./tailwind-config-OxLD7oFU.cjs");require("react-hotkeys-hook");require("lucide-react");exports.ChaiBuilderStudio=e.ChaiBuilderStudio;
package/dist/studio.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import "./jsx-runtime-NV737rRe.js";
2
- import { C as pi } from "./index-CMHxUxre.js";
2
+ import { C as pi } from "./index-rz6hkGcq.js";
3
3
  import "react";
4
4
  import "sonner";
5
5
  import "./MODIFIERS-MLfpKQY1.js";
6
6
  import "i18next";
7
7
  import "react-i18next";
8
- import "./index-ORFlyrBx.js";
8
+ import "./index-bKgIzodL.js";
9
9
  import "@radix-ui/react-toggle";
10
10
  import "class-variance-authority";
11
11
  import "./utils-PPBbw5bk.js";
package/dist/ui.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-zkc4SQCu.cjs");require("./jsx-runtime-WUGKV8jN.cjs");require("./MODIFIERS-WFzDQfiT.cjs");require("react");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-It2K33fU.cjs");require("lodash");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("jotai");require("flat-to-nested");require("redux-undo");require("@chaibuilder/runtime");require("@react-hookz/web");require("react-i18next");exports.Accordion=e.Accordion;exports.AccordionContent=e.AccordionContent;exports.AccordionItem=e.AccordionItem;exports.AccordionTrigger=e.AccordionTrigger;exports.Alert=e.Alert;exports.AlertDescription=e.AlertDescription;exports.AlertDialog=e.AlertDialog;exports.AlertDialogAction=e.AlertDialogAction;exports.AlertDialogCancel=e.AlertDialogCancel;exports.AlertDialogContent=e.AlertDialogContent;exports.AlertDialogDescription=e.AlertDialogDescription;exports.AlertDialogFooter=e.AlertDialogFooter;exports.AlertDialogHeader=e.AlertDialogHeader;exports.AlertDialogTitle=e.AlertDialogTitle;exports.AlertDialogTrigger=e.AlertDialogTrigger;exports.AlertTitle=e.AlertTitle;exports.Badge=e.Badge;exports.Button=e.Button;exports.Card=e.Card;exports.CardContent=e.CardContent;exports.CardDescription=e.CardDescription;exports.CardFooter=e.CardFooter;exports.CardHeader=e.CardHeader;exports.CardTitle=e.CardTitle;exports.Command=e.Command;exports.CommandDialog=e.CommandDialog;exports.CommandEmpty=e.CommandEmpty;exports.CommandGroup=e.CommandGroup;exports.CommandInput=e.CommandInput;exports.CommandItem=e.CommandItem;exports.CommandList=e.CommandList;exports.CommandSeparator=e.CommandSeparator;exports.CommandShortcut=e.CommandShortcut;exports.ContextMenu=e.ContextMenu;exports.ContextMenuCheckboxItem=e.ContextMenuCheckboxItem;exports.ContextMenuContent=e.ContextMenuContent;exports.ContextMenuGroup=e.ContextMenuGroup;exports.ContextMenuItem=e.ContextMenuItem;exports.ContextMenuLabel=e.ContextMenuLabel;exports.ContextMenuPortal=e.ContextMenuPortal;exports.ContextMenuRadioGroup=e.ContextMenuRadioGroup;exports.ContextMenuRadioItem=e.ContextMenuRadioItem;exports.ContextMenuSeparator=e.ContextMenuSeparator;exports.ContextMenuShortcut=e.ContextMenuShortcut;exports.ContextMenuSub=e.ContextMenuSub;exports.ContextMenuSubContent=e.ContextMenuSubContent;exports.ContextMenuSubTrigger=e.ContextMenuSubTrigger;exports.ContextMenuTrigger=e.ContextMenuTrigger;exports.Dialog=e.Dialog;exports.DialogContent=e.DialogContent;exports.DialogDescription=e.DialogDescription;exports.DialogFooter=e.DialogFooter;exports.DialogHeader=e.DialogHeader;exports.DialogTitle=e.DialogTitle;exports.DialogTrigger=e.DialogTrigger;exports.DropdownMenu=e.DropdownMenu;exports.DropdownMenuCheckboxItem=e.DropdownMenuCheckboxItem;exports.DropdownMenuContent=e.DropdownMenuContent;exports.DropdownMenuGroup=e.DropdownMenuGroup;exports.DropdownMenuItem=e.DropdownMenuItem;exports.DropdownMenuLabel=e.DropdownMenuLabel;exports.DropdownMenuPortal=e.DropdownMenuPortal;exports.DropdownMenuRadioGroup=e.DropdownMenuRadioGroup;exports.DropdownMenuRadioItem=e.DropdownMenuRadioItem;exports.DropdownMenuSeparator=e.DropdownMenuSeparator;exports.DropdownMenuShortcut=e.DropdownMenuShortcut;exports.DropdownMenuSub=e.DropdownMenuSub;exports.DropdownMenuSubContent=e.DropdownMenuSubContent;exports.DropdownMenuSubTrigger=e.DropdownMenuSubTrigger;exports.DropdownMenuTrigger=e.DropdownMenuTrigger;exports.HoverCard=e.HoverCard;exports.HoverCardContent=e.HoverCardContent;exports.HoverCardTrigger=e.HoverCardTrigger;exports.IconPickerField=e.IconPickerField;exports.ImagePickerField=e.ImagePickerField;exports.Input=e.Input;exports.Label=e.Label;exports.LinkField=e.LinkField;exports.Menubar=e.Menubar;exports.MenubarCheckboxItem=e.MenubarCheckboxItem;exports.MenubarContent=e.MenubarContent;exports.MenubarGroup=e.MenubarGroup;exports.MenubarItem=e.MenubarItem;exports.MenubarLabel=e.MenubarLabel;exports.MenubarMenu=e.MenubarMenu;exports.MenubarPortal=e.MenubarPortal;exports.MenubarRadioGroup=e.MenubarRadioGroup;exports.MenubarRadioItem=e.MenubarRadioItem;exports.MenubarSeparator=e.MenubarSeparator;exports.MenubarShortcut=e.MenubarShortcut;exports.MenubarSub=e.MenubarSub;exports.MenubarSubContent=e.MenubarSubContent;exports.MenubarSubTrigger=e.MenubarSubTrigger;exports.MenubarTrigger=e.MenubarTrigger;exports.Popover=e.Popover;exports.PopoverContent=e.PopoverContent;exports.PopoverTrigger=e.PopoverTrigger;exports.RTEField=e.RichTextEditorField;exports.ScrollArea=e.ScrollArea;exports.ScrollBar=e.ScrollBar;exports.Select=e.Select;exports.SelectContent=e.SelectContent;exports.SelectGroup=e.SelectGroup;exports.SelectItem=e.SelectItem;exports.SelectLabel=e.SelectLabel;exports.SelectSeparator=e.SelectSeparator;exports.SelectTrigger=e.SelectTrigger;exports.SelectValue=e.SelectValue;exports.Separator=e.Separator;exports.Sheet=e.Sheet;exports.SheetClose=e.SheetClose;exports.SheetContent=e.SheetContent;exports.SheetDescription=e.SheetDescription;exports.SheetFooter=e.SheetFooter;exports.SheetHeader=e.SheetHeader;exports.SheetTitle=e.SheetTitle;exports.SheetTrigger=e.SheetTrigger;exports.Skeleton=e.Skeleton;exports.Switch=e.Switch;exports.Tabs=e.Tabs;exports.TabsContent=e.TabsContent;exports.TabsList=e.TabsList;exports.TabsTrigger=e.TabsTrigger;exports.Textarea=e.Textarea;exports.Toaster=e.Toaster;exports.Toggle=e.Toggle;exports.Tooltip=e.Tooltip;exports.TooltipContent=e.TooltipContent;exports.TooltipPortal=e.TooltipPortal;exports.TooltipProvider=e.TooltipProvider;exports.TooltipTrigger=e.TooltipTrigger;exports.badgeVariants=e.badgeVariants;exports.buttonVariants=e.buttonVariants;exports.reducer=e.reducer;exports.toast=e.toast;exports.toggleVariants=e.toggleVariants;exports.useToast=e.useToast;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-U_pW4Tkc.cjs");require("./jsx-runtime-WUGKV8jN.cjs");require("./MODIFIERS-WFzDQfiT.cjs");require("react");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-It2K33fU.cjs");require("lodash");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("jotai");require("flat-to-nested");require("redux-undo");require("@chaibuilder/runtime");require("@react-hookz/web");require("react-i18next");exports.Accordion=e.Accordion;exports.AccordionContent=e.AccordionContent;exports.AccordionItem=e.AccordionItem;exports.AccordionTrigger=e.AccordionTrigger;exports.Alert=e.Alert;exports.AlertDescription=e.AlertDescription;exports.AlertDialog=e.AlertDialog;exports.AlertDialogAction=e.AlertDialogAction;exports.AlertDialogCancel=e.AlertDialogCancel;exports.AlertDialogContent=e.AlertDialogContent;exports.AlertDialogDescription=e.AlertDialogDescription;exports.AlertDialogFooter=e.AlertDialogFooter;exports.AlertDialogHeader=e.AlertDialogHeader;exports.AlertDialogTitle=e.AlertDialogTitle;exports.AlertDialogTrigger=e.AlertDialogTrigger;exports.AlertTitle=e.AlertTitle;exports.Badge=e.Badge;exports.Button=e.Button;exports.Card=e.Card;exports.CardContent=e.CardContent;exports.CardDescription=e.CardDescription;exports.CardFooter=e.CardFooter;exports.CardHeader=e.CardHeader;exports.CardTitle=e.CardTitle;exports.Command=e.Command;exports.CommandDialog=e.CommandDialog;exports.CommandEmpty=e.CommandEmpty;exports.CommandGroup=e.CommandGroup;exports.CommandInput=e.CommandInput;exports.CommandItem=e.CommandItem;exports.CommandList=e.CommandList;exports.CommandSeparator=e.CommandSeparator;exports.CommandShortcut=e.CommandShortcut;exports.ContextMenu=e.ContextMenu;exports.ContextMenuCheckboxItem=e.ContextMenuCheckboxItem;exports.ContextMenuContent=e.ContextMenuContent;exports.ContextMenuGroup=e.ContextMenuGroup;exports.ContextMenuItem=e.ContextMenuItem;exports.ContextMenuLabel=e.ContextMenuLabel;exports.ContextMenuPortal=e.ContextMenuPortal;exports.ContextMenuRadioGroup=e.ContextMenuRadioGroup;exports.ContextMenuRadioItem=e.ContextMenuRadioItem;exports.ContextMenuSeparator=e.ContextMenuSeparator;exports.ContextMenuShortcut=e.ContextMenuShortcut;exports.ContextMenuSub=e.ContextMenuSub;exports.ContextMenuSubContent=e.ContextMenuSubContent;exports.ContextMenuSubTrigger=e.ContextMenuSubTrigger;exports.ContextMenuTrigger=e.ContextMenuTrigger;exports.Dialog=e.Dialog;exports.DialogContent=e.DialogContent;exports.DialogDescription=e.DialogDescription;exports.DialogFooter=e.DialogFooter;exports.DialogHeader=e.DialogHeader;exports.DialogTitle=e.DialogTitle;exports.DialogTrigger=e.DialogTrigger;exports.DropdownMenu=e.DropdownMenu;exports.DropdownMenuCheckboxItem=e.DropdownMenuCheckboxItem;exports.DropdownMenuContent=e.DropdownMenuContent;exports.DropdownMenuGroup=e.DropdownMenuGroup;exports.DropdownMenuItem=e.DropdownMenuItem;exports.DropdownMenuLabel=e.DropdownMenuLabel;exports.DropdownMenuPortal=e.DropdownMenuPortal;exports.DropdownMenuRadioGroup=e.DropdownMenuRadioGroup;exports.DropdownMenuRadioItem=e.DropdownMenuRadioItem;exports.DropdownMenuSeparator=e.DropdownMenuSeparator;exports.DropdownMenuShortcut=e.DropdownMenuShortcut;exports.DropdownMenuSub=e.DropdownMenuSub;exports.DropdownMenuSubContent=e.DropdownMenuSubContent;exports.DropdownMenuSubTrigger=e.DropdownMenuSubTrigger;exports.DropdownMenuTrigger=e.DropdownMenuTrigger;exports.HoverCard=e.HoverCard;exports.HoverCardContent=e.HoverCardContent;exports.HoverCardTrigger=e.HoverCardTrigger;exports.IconPickerField=e.IconPickerField;exports.ImagePickerField=e.ImagePickerField;exports.Input=e.Input;exports.Label=e.Label;exports.LinkField=e.LinkField;exports.Menubar=e.Menubar;exports.MenubarCheckboxItem=e.MenubarCheckboxItem;exports.MenubarContent=e.MenubarContent;exports.MenubarGroup=e.MenubarGroup;exports.MenubarItem=e.MenubarItem;exports.MenubarLabel=e.MenubarLabel;exports.MenubarMenu=e.MenubarMenu;exports.MenubarPortal=e.MenubarPortal;exports.MenubarRadioGroup=e.MenubarRadioGroup;exports.MenubarRadioItem=e.MenubarRadioItem;exports.MenubarSeparator=e.MenubarSeparator;exports.MenubarShortcut=e.MenubarShortcut;exports.MenubarSub=e.MenubarSub;exports.MenubarSubContent=e.MenubarSubContent;exports.MenubarSubTrigger=e.MenubarSubTrigger;exports.MenubarTrigger=e.MenubarTrigger;exports.Popover=e.Popover;exports.PopoverContent=e.PopoverContent;exports.PopoverTrigger=e.PopoverTrigger;exports.RTEField=e.RichTextEditorField;exports.ScrollArea=e.ScrollArea;exports.ScrollBar=e.ScrollBar;exports.Select=e.Select;exports.SelectContent=e.SelectContent;exports.SelectGroup=e.SelectGroup;exports.SelectItem=e.SelectItem;exports.SelectLabel=e.SelectLabel;exports.SelectSeparator=e.SelectSeparator;exports.SelectTrigger=e.SelectTrigger;exports.SelectValue=e.SelectValue;exports.Separator=e.Separator;exports.Sheet=e.Sheet;exports.SheetClose=e.SheetClose;exports.SheetContent=e.SheetContent;exports.SheetDescription=e.SheetDescription;exports.SheetFooter=e.SheetFooter;exports.SheetHeader=e.SheetHeader;exports.SheetTitle=e.SheetTitle;exports.SheetTrigger=e.SheetTrigger;exports.Skeleton=e.Skeleton;exports.Switch=e.Switch;exports.Tabs=e.Tabs;exports.TabsContent=e.TabsContent;exports.TabsList=e.TabsList;exports.TabsTrigger=e.TabsTrigger;exports.Textarea=e.Textarea;exports.Toaster=e.Toaster;exports.Toggle=e.Toggle;exports.Tooltip=e.Tooltip;exports.TooltipContent=e.TooltipContent;exports.TooltipPortal=e.TooltipPortal;exports.TooltipProvider=e.TooltipProvider;exports.TooltipTrigger=e.TooltipTrigger;exports.badgeVariants=e.badgeVariants;exports.buttonVariants=e.buttonVariants;exports.reducer=e.reducer;exports.toast=e.toast;exports.toggleVariants=e.toggleVariants;exports.useToast=e.useToast;
package/dist/ui.js CHANGED
@@ -1,4 +1,4 @@
1
- import { bk as K, bn as f, bl as j, bm as q, bz as z, bJ as N, D as O, at as Q, K as U, F as W, I as X, J as Y, G as Z, H as _, E as $, bA as aa, bK as ea, B as oa, bt as ta, bw as ra, bv as sa, by as na, bu as ia, bM as ba, b6 as pa, cn as ua, b9 as ca, ba as la, b7 as ma, bb as da, b8 as Ca, cp as ga, co as Ma, bE as Sa, cq as Da, bD as Ta, cv as xa, bC as Aa, cs as wa, cw as Ia, cA as ha, cr as Pa, ct as Fa, cu as va, cx as Ga, cy as Ha, cz as La, bF as ka, ao as Ra, ap as Va, as as Ba, bc as Ea, aq as ya, ar as Ja, bd as Ka, aR as fa, aW as ja, aT as qa, ce as za, cb as Na, aU as Oa, cf as Qa, cj as Ua, cc as Wa, aV as Xa, cd as Ya, cg as Za, ch as _a, ci as $a, aS as ae, aO as ee, aQ as oe, aP as te, bh as re, bi as se, bo as ne, aM as ie, bj as be, bO as pe, bV as ue, bR as ce, b$ as le, bS as me, bU as de, bP as Ce, bY as ge, bW as Me, bX as Se, bT as De, c1 as Te, c0 as xe, bZ as Ae, b_ as we, bQ as Ie, b3 as he, b5 as Pe, b4 as Fe, bg as ve, br as Ge, bN as He, au as Le, ax as ke, aF as Re, ay as Ve, aG as Be, c2 as Ee, av as ye, aw as Je, aL as Ke, c3 as fe, c5 as je, c6 as qe, ca as ze, c8 as Ne, c7 as Oe, c9 as Qe, c4 as Ue, S as We, aN as Xe, aB as Ye, aE as Ze, aC as _e, aD as $e, bx as ao, C as eo, aJ as oo, aH as to, aK as ro, bp as so, T as no, aI as io, bL as bo, bI as po, ck as uo, cm as co, bH as lo, cl as mo } from "./index-ORFlyrBx.js";
1
+ import { bh as J, bk as K, bi as j, bj as y, bw as z, bG as N, D as O, ap as Q, K as U, F as W, I as X, J as Y, G as Z, H as _, E as $, bx as aa, bH as ea, B as oa, bq as ta, bt as ra, bs as sa, bv as na, br as ia, bJ as ba, b3 as pa, ck as ua, b6 as la, b7 as ma, b4 as ca, b8 as da, b5 as Ca, cm as ga, cl as Ma, bB as Sa, cn as Da, bA as Ta, cs as xa, bz as Aa, cp as Ia, ct as ha, cx as wa, co as Pa, cq as Fa, cr as Ga, cu as ka, cv as Ha, cw as La, bC as va, ak as Ra, al as Ba, ao as Ea, b9 as Va, am as fa, an as qa, ba as Ja, aN as Ka, aS as ja, aP as ya, cb as za, c8 as Na, aQ as Oa, cc as Qa, cg as Ua, c9 as Wa, aR as Xa, ca as Ya, cd as Za, ce as _a, cf as $a, aO as ae, aK as ee, aM as oe, aL as te, be as re, bf as se, bl as ne, aI as ie, bg as be, bL as pe, bS as ue, bO as le, bY as me, bP as ce, bR as de, bM as Ce, bV as ge, bT as Me, bU as Se, bQ as De, b_ as Te, bZ as xe, bW as Ae, bX as Ie, bN as he, b0 as we, b2 as Pe, b1 as Fe, bd as Ge, bo as ke, bK as He, aq as Le, at as ve, aB as Re, au as Be, aC as Ee, b$ as Ve, ar as fe, as as qe, aH as Je, c0 as Ke, c2 as je, c3 as ye, c7 as ze, c5 as Ne, c4 as Oe, c6 as Qe, c1 as Ue, S as We, aJ as Xe, ax as Ye, aA as Ze, ay as _e, az as $e, bu as ao, C as eo, aF as oo, aD as to, aG as ro, bm as so, T as no, aE as io, bI as bo, bF as po, ch as uo, cj as lo, bE as mo, ci as co } from "./index-bKgIzodL.js";
2
2
  import "./jsx-runtime-NV737rRe.js";
3
3
  import "./MODIFIERS-MLfpKQY1.js";
4
4
  import "react";
@@ -37,10 +37,10 @@ import "@chaibuilder/runtime";
37
37
  import "@react-hookz/web";
38
38
  import "react-i18next";
39
39
  export {
40
- K as Accordion,
41
- f as AccordionContent,
40
+ J as Accordion,
41
+ K as AccordionContent,
42
42
  j as AccordionItem,
43
- q as AccordionTrigger,
43
+ y as AccordionTrigger,
44
44
  z as Alert,
45
45
  N as AlertDescription,
46
46
  O as AlertDialog,
@@ -63,9 +63,9 @@ export {
63
63
  ba as CardTitle,
64
64
  pa as Command,
65
65
  ua as CommandDialog,
66
- ca as CommandEmpty,
67
- la as CommandGroup,
68
- ma as CommandInput,
66
+ la as CommandEmpty,
67
+ ma as CommandGroup,
68
+ ca as CommandInput,
69
69
  da as CommandItem,
70
70
  Ca as CommandList,
71
71
  ga as CommandSeparator,
@@ -75,26 +75,26 @@ export {
75
75
  Ta as ContextMenuContent,
76
76
  xa as ContextMenuGroup,
77
77
  Aa as ContextMenuItem,
78
- wa as ContextMenuLabel,
79
- Ia as ContextMenuPortal,
80
- ha as ContextMenuRadioGroup,
78
+ Ia as ContextMenuLabel,
79
+ ha as ContextMenuPortal,
80
+ wa as ContextMenuRadioGroup,
81
81
  Pa as ContextMenuRadioItem,
82
82
  Fa as ContextMenuSeparator,
83
- va as ContextMenuShortcut,
84
- Ga as ContextMenuSub,
83
+ Ga as ContextMenuShortcut,
84
+ ka as ContextMenuSub,
85
85
  Ha as ContextMenuSubContent,
86
86
  La as ContextMenuSubTrigger,
87
- ka as ContextMenuTrigger,
87
+ va as ContextMenuTrigger,
88
88
  Ra as Dialog,
89
- Va as DialogContent,
90
- Ba as DialogDescription,
91
- Ea as DialogFooter,
92
- ya as DialogHeader,
93
- Ja as DialogTitle,
94
- Ka as DialogTrigger,
95
- fa as DropdownMenu,
89
+ Ba as DialogContent,
90
+ Ea as DialogDescription,
91
+ Va as DialogFooter,
92
+ fa as DialogHeader,
93
+ qa as DialogTitle,
94
+ Ja as DialogTrigger,
95
+ Ka as DropdownMenu,
96
96
  ja as DropdownMenuCheckboxItem,
97
- qa as DropdownMenuContent,
97
+ ya as DropdownMenuContent,
98
98
  za as DropdownMenuGroup,
99
99
  Na as DropdownMenuItem,
100
100
  Oa as DropdownMenuLabel,
@@ -117,9 +117,9 @@ export {
117
117
  be as LinkField,
118
118
  pe as Menubar,
119
119
  ue as MenubarCheckboxItem,
120
- ce as MenubarContent,
121
- le as MenubarGroup,
122
- me as MenubarItem,
120
+ le as MenubarContent,
121
+ me as MenubarGroup,
122
+ ce as MenubarItem,
123
123
  de as MenubarLabel,
124
124
  Ce as MenubarMenu,
125
125
  ge as MenubarPortal,
@@ -129,26 +129,26 @@ export {
129
129
  Te as MenubarShortcut,
130
130
  xe as MenubarSub,
131
131
  Ae as MenubarSubContent,
132
- we as MenubarSubTrigger,
133
- Ie as MenubarTrigger,
134
- he as Popover,
132
+ Ie as MenubarSubTrigger,
133
+ he as MenubarTrigger,
134
+ we as Popover,
135
135
  Pe as PopoverContent,
136
136
  Fe as PopoverTrigger,
137
- ve as RTEField,
138
- Ge as ScrollArea,
137
+ Ge as RTEField,
138
+ ke as ScrollArea,
139
139
  He as ScrollBar,
140
140
  Le as Select,
141
- ke as SelectContent,
141
+ ve as SelectContent,
142
142
  Re as SelectGroup,
143
- Ve as SelectItem,
144
- Be as SelectLabel,
145
- Ee as SelectSeparator,
146
- ye as SelectTrigger,
147
- Je as SelectValue,
148
- Ke as Separator,
149
- fe as Sheet,
143
+ Be as SelectItem,
144
+ Ee as SelectLabel,
145
+ Ve as SelectSeparator,
146
+ fe as SelectTrigger,
147
+ qe as SelectValue,
148
+ Je as Separator,
149
+ Ke as Sheet,
150
150
  je as SheetClose,
151
- qe as SheetContent,
151
+ ye as SheetContent,
152
152
  ze as SheetDescription,
153
153
  Ne as SheetFooter,
154
154
  Oe as SheetHeader,
@@ -171,7 +171,7 @@ export {
171
171
  bo as badgeVariants,
172
172
  po as buttonVariants,
173
173
  uo as reducer,
174
- co as toast,
175
- lo as toggleVariants,
176
- mo as useToast
174
+ lo as toast,
175
+ mo as toggleVariants,
176
+ co as useToast
177
177
  };
@@ -1,6 +1,6 @@
1
1
  import { useCallback as n } from "react";
2
2
  import { has as s } from "lodash";
3
- import { O as a, i as u } from "./index-ORFlyrBx.js";
3
+ import { O as a, i as u } from "./index-bKgIzodL.js";
4
4
  const B = () => {
5
5
  const { addCoreBlock: r } = a(), l = u("getExternalPredefinedBlock");
6
6
  return n(
@@ -1 +1 @@
1
- "use strict";const n=require("react"),u=require("lodash"),t=require("./index-zkc4SQCu.cjs"),a=()=>{const{addCoreBlock:r}=t.useAddBlock(),l=t.useBuilderProp("getExternalPredefinedBlock");return n.useCallback(async s=>{const{block:o,dropTargetId:e,relativeIndex:c}=s;if(u.has(o,"format")){const d=await l(o);return r({blocks:d},e===0?null:e,c)}return r(o,e===0?null:e,c)},[r])};exports.useAddBlockByDrop=a;
1
+ "use strict";const n=require("react"),u=require("lodash"),t=require("./index-U_pW4Tkc.cjs"),a=()=>{const{addCoreBlock:r}=t.useAddBlock(),l=t.useBuilderProp("getExternalPredefinedBlock");return n.useCallback(async s=>{const{block:o,dropTargetId:e,relativeIndex:c}=s;if(u.has(o,"format")){const d=await l(o);return r({blocks:d},e===0?null:e,c)}return r(o,e===0?null:e,c)},[r])};exports.useAddBlockByDrop=a;
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "author": "Suraj Air",
6
6
  "license": "BSD-3-Clause",
7
7
  "homepage": "https://chaibuilder.com",
8
- "version": "1.1.3",
8
+ "version": "1.1.5",
9
9
  "type": "module",
10
10
  "repository": {
11
11
  "type": "git",
@@ -1,58 +0,0 @@
1
- "use strict";var We=Object.defineProperty;var Fe=(e,t,n)=>t in e?We(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var U=(e,t,n)=>(Fe(e,typeof t!="symbol"?t+"":t,n),n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./jsx-runtime-WUGKV8jN.cjs"),m=require("react"),p=require("lodash"),P=require("@radix-ui/react-icons"),o=require("./index-zkc4SQCu.cjs"),$e=require("react-i18next"),F=require("jotai"),fe=require("react-dom"),V=require("./MODIFIERS-WFzDQfiT.cjs"),J=require("./index-yo8mH0u8.cjs"),He=require("react-quill"),Ue=require("./useAddBlockByDrop-DPV32UHP.cjs"),ze=require("flagged"),Ye=require("@floating-ui/dom"),xe=require("@floating-ui/react-dom"),Ke=require("react-dnd"),Ve=require("@react-hookz/web"),Xe=require("@bobthered/tailwindcss-palette-generator"),Je=require("react-wrap-balancer"),Ze=require("tailwind-merge"),Ge=require("@chaibuilder/runtime");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-It2K33fU.cjs");require("clsx");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");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("flat-to-nested");require("redux-undo");require("i18next");require("react-textarea-autosize");require("@minoru/react-dnd-treeview");require("./lib.cjs");require("himalaya");require("./functions-KMQYiBHf.cjs");require("@mhsdesign/jit-browser-tailwindcss");require("@tailwindcss/forms");require("@tailwindcss/typography");require("@tailwindcss/aspect-ratio");require("@tailwindcss/line-clamp");require("./tailwind-config-OxLD7oFU.cjs");require("react-hotkeys-hook");require("sonner");require("lucide-react");const Qe=()=>{const{undoCount:e,redoCount:t,undo:n,redo:i}=o.useCanvasHistory();return s.jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[s.jsxRuntimeExports.jsx(o.Button,{disabled:!e,size:"sm",onClick:n,className:"rounded-full",variant:"ghost",children:s.jsxRuntimeExports.jsx(P.ResetIcon,{})}),s.jsxRuntimeExports.jsx(o.Button,{disabled:!t,onClick:i,size:"sm",className:"rounded-full",variant:"ghost",children:s.jsxRuntimeExports.jsx(P.ResetIcon,{className:"rotate-180 scale-y-[-1] transform"})})]})};function et(){const[e,t]=o.useDarkMode(),{t:n}=$e.useTranslation();return s.jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[s.jsxRuntimeExports.jsx(o.Label,{htmlFor:"dark-mode-switch",children:n("dark_mode")}),s.jsxRuntimeExports.jsxs(o.Switch,{id:"dark-mode-switch",checked:e,onCheckedChange:()=>{t(!e)},className:`${e?"bg-violet-600":"bg-violet-300"}
2
- relative ml-2 inline-flex h-[20px] w-[40px] shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus-visible:ring-2 focus-visible:ring-white focus-visible:ring-opacity-75`,children:[s.jsxRuntimeExports.jsx("span",{className:"sr-only",children:"Use setting"}),s.jsxRuntimeExports.jsx("span",{"aria-hidden":"true",className:`${e?"translate-x-5":"translate-x-0"}
3
- pointer-events-none -mt-px inline-block h-[18px] w-[20px] transform rounded-full bg-white shadow-lg ring-0 transition duration-200 ease-in-out`})]})]})}const he=({landscape:e=!1})=>s.jsxRuntimeExports.jsxs("svg",{className:e?"rotate-90":"",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 13 13",xmlSpace:"preserve",width:13,height:13,children:[s.jsxRuntimeExports.jsx("g",{strokeWidth:0}),s.jsxRuntimeExports.jsx("g",{strokeLinecap:"round",strokeLinejoin:"round"}),s.jsxRuntimeExports.jsx("path",{d:"M10.65 0H2.349a.851.851 0 0 0-.851.852v11.299c0 .47.382.852.851.852h8.3a.851.851 0 0 0 .851-.852V.852A.851.851 0 0 0 10.65 0zM6.599 12.466a.367.367 0 1 1 0-.735.367.367 0 0 1 0 .735zm3.9-1.267H2.5V1h8.001v10.199z",style:{fill:"#000"}})]}),ge=[{title:"Mobile (XS)",content:"Styles set here are applied to all screen unless edited at higher breakpoint",breakpoint:"xs",icon:s.jsxRuntimeExports.jsx(P.MobileIcon,{}),width:400},{title:"Mobile landscape (SM)",content:"Styles set here are applied at 640px and up unless edited at higher breakpoint",breakpoint:"sm",icon:s.jsxRuntimeExports.jsx(P.MobileIcon,{className:"rotate-90"}),width:640},{title:"Tablet (MD)",content:"Styles set here are applied at 768px and up",breakpoint:"md",icon:s.jsxRuntimeExports.jsx(he,{}),width:800},{title:"Tablet Landscape (LG)",content:"Styles set here are applied at 1024px and up unless edited at higher breakpoint",breakpoint:"lg",icon:s.jsxRuntimeExports.jsx(he,{landscape:!0}),width:1024},{title:"Desktop (XL)",content:"Styles set here are applied at 1280px and up unless edited at higher breakpoint",breakpoint:"xl",icon:s.jsxRuntimeExports.jsx(P.LaptopIcon,{}),width:1420},{title:"Large Desktop (2XL)",content:"Styles set here are applied at 1536px and up",breakpoint:"2xl",icon:s.jsxRuntimeExports.jsx(P.DesktopIcon,{}),width:1920}],tt=({title:e,content:t,currentBreakpoint:n,breakpoint:i,width:c,icon:r,onClick:a})=>s.jsxRuntimeExports.jsxs(o.HoverCard,{children:[s.jsxRuntimeExports.jsx(o.HoverCardTrigger,{asChild:!0,children:s.jsxRuntimeExports.jsx(o.Button,{onClick:()=>a(c),size:"sm",variant:i===n?"secondary":"ghost",children:r})}),s.jsxRuntimeExports.jsx(o.HoverCardContent,{className:"w-52 border-border",children:s.jsxRuntimeExports.jsx("div",{className:"flex justify-between space-x-4",children:s.jsxRuntimeExports.jsxs("div",{className:"space-y-1",children:[s.jsxRuntimeExports.jsx("h4",{className:"text-sm font-semibold",children:e}),s.jsxRuntimeExports.jsx("p",{className:"text-xs",children:t})]})})})]}),nt=()=>{const[,e,t]=o.useCanvasWidth(),[n,i]=o.useSelectedBreakpoints(),c=r=>{n.includes(r)?n.length>2&&i(n.filter(a=>a!==r)):i(a=>[...a,r])};return s.jsxRuntimeExports.jsxs("div",{className:"flex items-center rounded-md",children:[p.map(ge.filter(r=>p.includes(n,p.toUpper(r.breakpoint))),r=>m.createElement(tt,{...r,onClick:t,key:r.breakpoint,currentBreakpoint:e})),s.jsxRuntimeExports.jsxs(o.DropdownMenu,{children:[s.jsxRuntimeExports.jsx(o.DropdownMenuTrigger,{asChild:!0,children:s.jsxRuntimeExports.jsx("span",{className:"cursor-pointer px-2.5 hover:opacity-80",children:s.jsxRuntimeExports.jsx(P.DotsVerticalIcon,{className:"scale-90 transform"})})}),s.jsxRuntimeExports.jsxs(o.DropdownMenuContent,{className:"w-56 border-border text-xs",children:[s.jsxRuntimeExports.jsx(o.DropdownMenuLabel,{children:"Breakpoints"}),s.jsxRuntimeExports.jsx(o.DropdownMenuSeparator,{}),p.map(ge,r=>s.jsxRuntimeExports.jsx(o.DropdownMenuCheckboxItem,{disabled:r.breakpoint==="xs",onCheckedChange:()=>c(p.toUpper(r.breakpoint)),checked:p.includes(n,p.toUpper(r.breakpoint)),children:r.title},r.breakpoint))]})]})]})},st=()=>{const[e]=o.useSetAllBlocks(),{createSnapshot:t}=o.useCanvasHistory(),[,n]=o.useSelectedBlockIds(),[,i]=o.useSelectedStylingBlocks(),c=m.useCallback(()=>{e([]),n([]),i([]),t()},[e,t]);return s.jsxRuntimeExports.jsx("div",{className:"flex items-center",children:s.jsxRuntimeExports.jsxs(o.AlertDialog,{children:[s.jsxRuntimeExports.jsx(o.AlertDialogTrigger,{asChild:!0,children:s.jsxRuntimeExports.jsxs(o.Button,{size:"sm",variant:"ghost",className:"flex items-center gap-x-1",children:[s.jsxRuntimeExports.jsx(P.EraserIcon,{})," Clear"]})}),s.jsxRuntimeExports.jsxs(o.AlertDialogContent,{className:"border-border",children:[s.jsxRuntimeExports.jsxs(o.AlertDialogHeader,{children:[s.jsxRuntimeExports.jsx(o.AlertDialogTitle,{children:"Clear whole canvas?"}),s.jsxRuntimeExports.jsx(o.AlertDialogDescription,{children:"Are you sure you want to clear the whole canvas?"})]}),s.jsxRuntimeExports.jsxs(o.AlertDialogFooter,{children:[s.jsxRuntimeExports.jsx(o.AlertDialogCancel,{children:"Cancel"}),s.jsxRuntimeExports.jsx(o.AlertDialogAction,{onClick:c,children:"Yes"})]})]})]})})},rt=()=>{const e=o.useFeatureSupport("darkMode",!1),[t]=o.useCanvasZoom();return s.jsxRuntimeExports.jsxs("div",{className:"flex h-10 items-center justify-between border-b bg-background/70 px-2",children:[s.jsxRuntimeExports.jsxs("div",{className:"flex h-full space-x-2",children:[e?s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[s.jsxRuntimeExports.jsx(et,{}),s.jsxRuntimeExports.jsx(o.Separator,{orientation:"vertical"})]}):null,s.jsxRuntimeExports.jsx(nt,{}),s.jsxRuntimeExports.jsx(o.Separator,{orientation:"vertical"}),s.jsxRuntimeExports.jsxs("div",{className:"flex w-12 items-center justify-center gap-x-1 space-x-0 font-medium",children:[s.jsxRuntimeExports.jsx(P.ZoomInIcon,{className:"h-3.5 w-3.5 flex-shrink-0"})," ",s.jsxRuntimeExports.jsxs("div",{className:"text-xs leading-3",children:[p.round(t,0),"%"]})]}),s.jsxRuntimeExports.jsx(o.Separator,{orientation:"vertical"}),s.jsxRuntimeExports.jsx(Qe,{})]}),s.jsxRuntimeExports.jsxs("div",{className:"flex h-full items-center space-x-2",children:[s.jsxRuntimeExports.jsx(o.Separator,{orientation:"vertical"}),s.jsxRuntimeExports.jsx(st,{})]})]})},ot=`<!doctype html>
4
- <html class="scroll-smooth h-full overflow-y-auto">
5
- <head>
6
- <meta charset="UTF-8">
7
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
8
- <script src="https://old.chaibuilder.com/offline/tailwind.cdn.js"><\/script>
9
- <style>
10
- html { height: 100%; overflow:auto; }
11
- body { height: 100%; }
12
- .air-highlight{ outline: 1px solid #42a1fc !important; outline-offset: -1px;}
13
- .air-highlight-multi{ outline: 1px solid #29e503 !important; outline-offset: -1px;}
14
- body{ -webkit-touch-callout: none; -webkit-user-select: none; -khtml-user-select: none;
15
- -moz-user-select: none;-ms-user-select: none; user-select: none; }
16
- html{
17
- -ms-overflow-style: none; /* IE and Edge */
18
- scrollbar-width: none; /* Firefox */
19
- }
20
- /** IMPORTANT: Make fields content editable in SAFARI */
21
- [contenteditable] {-webkit-user-select: text;user-select: text;}
22
-
23
- html::-webkit-scrollbar { width: 0 !important }
24
- .aspect-auto{aspect-ratio: auto;}
25
- .aspect-square{aspect-ratio: 1/1;}
26
- .aspect-video{aspect-ratio: 16/9;}
27
- .dragging [data-dnd="leaf"] { pointer-events: none; } .dragging [data-dnd="leaf"] * { pointer-events: none; }
28
- .dragging [data-dnd="ignore"], .dragging [data-dnd="ignore"] * { pointer-events: none; }
29
- a{ pointer-events: none !important; }
30
- [contenteditable="true"], [contenteditable="true"] * { cursor: text !important; }
31
- [contenteditable="true"] {
32
- outline: none;
33
- box-shadow: 0 0 0px 4px rgba(36, 150, 255, 0.2);
34
- -webkit-user-select: text;
35
- -moz-user-select: text;
36
- user-select: text;
37
- }
38
- </style>
39
- <style id="hidden-blocks"></style>
40
- <style id="selected-block"></style>
41
- <style id="selected-styling-block"></style>
42
- <style id="highlighted-block"></style>
43
-
44
- </head>
45
- <body class="font-body antialiased h-full">
46
- <div class="frame-root"></div>
47
- <script src="https://cdn.jsdelivr.net/npm/quill@2.0.0/dist/quill.js"><\/script>
48
- </body>
49
- </html>`,it=e=>{const[t]=o.useCanvasWidth(),[,n]=o.useCanvasZoom(),[i,c]=m.useState({}),r=m.useCallback(()=>{const{width:a,height:d}=e;if(a<t){const x=parseFloat((a/t).toString());let f={};d&&(f={height:d+2*d*(1-x)}),c({transform:`scale(${x})`,transformOrigin:"top left",...f,maxWidth:"none"}),n(x*100)}else c({}),n(100)},[t,e,n]);return m.useEffect(()=>{r()},[t,e,n,r]),i};var G={exports:{}};/*
50
- object-assign
51
- (c) Sindre Sorhus
52
- @license MIT
53
- */var ne,me;function at(){if(me)return ne;me=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function i(r){if(r==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(r)}function c(){try{if(!Object.assign)return!1;var r=new String("abc");if(r[5]="de",Object.getOwnPropertyNames(r)[0]==="5")return!1;for(var a={},d=0;d<10;d++)a["_"+String.fromCharCode(d)]=d;var x=Object.getOwnPropertyNames(a).map(function(g){return a[g]});if(x.join("")!=="0123456789")return!1;var f={};return"abcdefghijklmnopqrst".split("").forEach(function(g){f[g]=g}),Object.keys(Object.assign({},f)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return ne=c()?Object.assign:function(r,a){for(var d,x=i(r),f,g=1;g<arguments.length;g++){d=Object(arguments[g]);for(var h in d)t.call(d,h)&&(x[h]=d[h]);if(e){f=e(d);for(var b=0;b<f.length;b++)n.call(d,f[b])&&(x[f[b]]=d[f[b]])}}return x},ne}var se,ye;function de(){if(ye)return se;ye=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return se=e,se}var re,ve;function Re(){return ve||(ve=1,re=Function.call.bind(Object.prototype.hasOwnProperty)),re}var oe,je;function lt(){if(je)return oe;je=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=de(),n={},i=Re();e=function(r){var a="Warning: "+r;typeof console<"u"&&console.error(a);try{throw new Error(a)}catch{}}}function c(r,a,d,x,f){if(process.env.NODE_ENV!=="production"){for(var g in r)if(i(r,g)){var h;try{if(typeof r[g]!="function"){var b=Error((x||"React class")+": "+d+" type `"+g+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof r[g]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw b.name="Invariant Violation",b}h=r[g](a,g,x,d,null,t)}catch(M){h=M}if(h&&!(h instanceof Error)&&e((x||"React class")+": type specification of "+d+" `"+g+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof h+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),h instanceof Error&&!(h.message in n)){n[h.message]=!0;var R=f?f():"";e("Failed "+d+" type: "+h.message+(R??""))}}}}return c.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},oe=c,oe}var ie,be;function ct(){if(be)return ie;be=1;var e=J.reactIsExports,t=at(),n=de(),i=Re(),c=lt(),r=function(){};process.env.NODE_ENV!=="production"&&(r=function(d){var x="Warning: "+d;typeof console<"u"&&console.error(x);try{throw new Error(x)}catch{}});function a(){return null}return ie=function(d,x){var f=typeof Symbol=="function"&&Symbol.iterator,g="@@iterator";function h(l){var u=l&&(f&&l[f]||l[g]);if(typeof u=="function")return u}var b="<<anonymous>>",R={array:v("array"),bigint:v("bigint"),bool:v("boolean"),func:v("function"),number:v("number"),object:v("object"),string:v("string"),symbol:v("symbol"),any:z(),arrayOf:_,element:ee(),elementType:te(),instanceOf:A,node:qe(),objectOf:W,oneOf:N,oneOfType:Oe,shape:Pe,exact:Me};function M(l,u){return l===u?l!==0||1/l===1/u:l!==l&&u!==u}function S(l,u){this.message=l,this.data=u&&typeof u=="object"?u:{},this.stack=""}S.prototype=Error.prototype;function D(l){if(process.env.NODE_ENV!=="production")var u={},w=0;function E(C,j,k,T,I,B,L){if(T=T||b,B=B||k,L!==n){if(x){var O=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw O.name="Invariant Violation",O}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var Y=T+":"+k;!u[Y]&&w<3&&(r("You are manually calling a React.PropTypes validation function for the `"+B+"` prop on `"+T+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),u[Y]=!0,w++)}}return j[k]==null?C?j[k]===null?new S("The "+I+" `"+B+"` is marked as required "+("in `"+T+"`, but its value is `null`.")):new S("The "+I+" `"+B+"` is marked as required in "+("`"+T+"`, but its value is `undefined`.")):null:l(j,k,T,I,B)}var y=E.bind(null,!1);return y.isRequired=E.bind(null,!0),y}function v(l){function u(w,E,y,C,j,k){var T=w[E],I=$(T);if(I!==l){var B=K(T);return new S("Invalid "+C+" `"+j+"` of type "+("`"+B+"` supplied to `"+y+"`, expected ")+("`"+l+"`."),{expectedType:l})}return null}return D(u)}function z(){return D(a)}function _(l){function u(w,E,y,C,j){if(typeof l!="function")return new S("Property `"+j+"` of component `"+y+"` has invalid PropType notation inside arrayOf.");var k=w[E];if(!Array.isArray(k)){var T=$(k);return new S("Invalid "+C+" `"+j+"` of type "+("`"+T+"` supplied to `"+y+"`, expected an array."))}for(var I=0;I<k.length;I++){var B=l(k,I,y,C,j+"["+I+"]",n);if(B instanceof Error)return B}return null}return D(u)}function ee(){function l(u,w,E,y,C){var j=u[w];if(!d(j)){var k=$(j);return new S("Invalid "+y+" `"+C+"` of type "+("`"+k+"` supplied to `"+E+"`, expected a single ReactElement."))}return null}return D(l)}function te(){function l(u,w,E,y,C){var j=u[w];if(!e.isValidElementType(j)){var k=$(j);return new S("Invalid "+y+" `"+C+"` of type "+("`"+k+"` supplied to `"+E+"`, expected a single ReactElement type."))}return null}return D(l)}function A(l){function u(w,E,y,C,j){if(!(w[E]instanceof l)){var k=l.name||b,T=Ne(w[E]);return new S("Invalid "+C+" `"+j+"` of type "+("`"+T+"` supplied to `"+y+"`, expected ")+("instance of `"+k+"`."))}return null}return D(u)}function N(l){if(!Array.isArray(l))return process.env.NODE_ENV!=="production"&&(arguments.length>1?r("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):r("Invalid argument supplied to oneOf, expected an array.")),a;function u(w,E,y,C,j){for(var k=w[E],T=0;T<l.length;T++)if(M(k,l[T]))return null;var I=JSON.stringify(l,function(L,O){var Y=K(O);return Y==="symbol"?String(O):O});return new S("Invalid "+C+" `"+j+"` of value `"+String(k)+"` "+("supplied to `"+y+"`, expected one of "+I+"."))}return D(u)}function W(l){function u(w,E,y,C,j){if(typeof l!="function")return new S("Property `"+j+"` of component `"+y+"` has invalid PropType notation inside objectOf.");var k=w[E],T=$(k);if(T!=="object")return new S("Invalid "+C+" `"+j+"` of type "+("`"+T+"` supplied to `"+y+"`, expected an object."));for(var I in k)if(i(k,I)){var B=l(k,I,y,C,j+"."+I,n);if(B instanceof Error)return B}return null}return D(u)}function Oe(l){if(!Array.isArray(l))return process.env.NODE_ENV!=="production"&&r("Invalid argument supplied to oneOfType, expected an instance of array."),a;for(var u=0;u<l.length;u++){var w=l[u];if(typeof w!="function")return r("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+_e(w)+" at index "+u+"."),a}function E(y,C,j,k,T){for(var I=[],B=0;B<l.length;B++){var L=l[B],O=L(y,C,j,k,T,n);if(O==null)return null;O.data&&i(O.data,"expectedType")&&I.push(O.data.expectedType)}var Y=I.length>0?", expected one of type ["+I.join(", ")+"]":"";return new S("Invalid "+k+" `"+T+"` supplied to "+("`"+j+"`"+Y+"."))}return D(E)}function qe(){function l(u,w,E,y,C){return Z(u[w])?null:new S("Invalid "+y+" `"+C+"` supplied to "+("`"+E+"`, expected a ReactNode."))}return D(l)}function pe(l,u,w,E,y){return new S((l||"React class")+": "+u+" type `"+w+"."+E+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+y+"`.")}function Pe(l){function u(w,E,y,C,j){var k=w[E],T=$(k);if(T!=="object")return new S("Invalid "+C+" `"+j+"` of type `"+T+"` "+("supplied to `"+y+"`, expected `object`."));for(var I in l){var B=l[I];if(typeof B!="function")return pe(y,C,j,I,K(B));var L=B(k,I,y,C,j+"."+I,n);if(L)return L}return null}return D(u)}function Me(l){function u(w,E,y,C,j){var k=w[E],T=$(k);if(T!=="object")return new S("Invalid "+C+" `"+j+"` of type `"+T+"` "+("supplied to `"+y+"`, expected `object`."));var I=t({},w[E],l);for(var B in I){var L=l[B];if(i(l,B)&&typeof L!="function")return pe(y,C,j,B,K(L));if(!L)return new S("Invalid "+C+" `"+j+"` key `"+B+"` supplied to `"+y+"`.\nBad object: "+JSON.stringify(w[E],null," ")+`
54
- Valid keys: `+JSON.stringify(Object.keys(l),null," "));var O=L(k,B,y,C,j+"."+B,n);if(O)return O}return null}return D(u)}function Z(l){switch(typeof l){case"number":case"string":case"undefined":return!0;case"boolean":return!l;case"object":if(Array.isArray(l))return l.every(Z);if(l===null||d(l))return!0;var u=h(l);if(u){var w=u.call(l),E;if(u!==l.entries){for(;!(E=w.next()).done;)if(!Z(E.value))return!1}else for(;!(E=w.next()).done;){var y=E.value;if(y&&!Z(y[1]))return!1}}else return!1;return!0;default:return!1}}function Le(l,u){return l==="symbol"?!0:u?u["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&u instanceof Symbol:!1}function $(l){var u=typeof l;return Array.isArray(l)?"array":l instanceof RegExp?"object":Le(u,l)?"symbol":u}function K(l){if(typeof l>"u"||l===null)return""+l;var u=$(l);if(u==="object"){if(l instanceof Date)return"date";if(l instanceof RegExp)return"regexp"}return u}function _e(l){var u=K(l);switch(u){case"array":case"object":return"an "+u;case"boolean":case"date":case"regexp":return"a "+u;default:return u}}function Ne(l){return!l.constructor||!l.constructor.name?b:l.constructor.name}return R.checkPropTypes=c,R.resetWarningCache=c.resetWarningCache,R.PropTypes=R,R},ie}var ae,Ee;function dt(){if(Ee)return ae;Ee=1;var e=de();function t(){}function n(){}return n.resetWarningCache=t,ae=function(){function i(a,d,x,f,g,h){if(h!==e){var b=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw b.name="Invariant Violation",b}}i.isRequired=i;function c(){return i}var r={array:i,bigint:i,bool:i,func:i,number:i,object:i,string:i,symbol:i,any:i,arrayOf:c,element:i,elementType:i,instanceOf:c,node:i,objectOf:c,oneOf:c,oneOfType:c,shape:c,exact:c,checkPropTypes:n,resetWarningCache:t};return r.PropTypes=r,r},ae}var $t=G.exports;if(process.env.NODE_ENV!=="production"){var ut=J.reactIsExports,pt=!0;G.exports=ct()(ut.isElement,pt)}else G.exports=dt()();var ft=G.exports;const q=V.getDefaultExportFromCjs(ft);let Se,Ce;typeof document<"u"&&(Se=document);typeof window<"u"&&(Ce=window);const Te=m.createContext({document:Se,window:Ce}),Q=()=>m.useContext(Te),{Provider:xt,Consumer:Ht}=Te;class Be extends m.Component{componentDidMount(){this.props.contentDidMount()}componentDidUpdate(){this.props.contentDidUpdate()}render(){return m.Children.only(this.props.children)}}U(Be,"propTypes",{children:q.element.isRequired,contentDidMount:q.func.isRequired,contentDidUpdate:q.func.isRequired});class le extends m.Component{constructor(n,i){super(n,i);U(this,"setRef",n=>{this.nodeRef.current=n;const{forwardedRef:i}=this.props;typeof i=="function"?i(n):i&&(i.current=n)});U(this,"handleLoad",()=>{clearInterval(this.loadCheck),this.state.iframeLoaded||this.setState({iframeLoaded:!0})});U(this,"loadCheck",()=>setInterval(()=>{this.handleLoad()},500));this._isMounted=!1,this.nodeRef=m.createRef(),this.state={iframeLoaded:!1}}componentDidMount(){this._isMounted=!0,this.getDoc()&&this.nodeRef.current.contentWindow.addEventListener("DOMContentLoaded",this.handleLoad)}componentWillUnmount(){this._isMounted=!1,this.nodeRef.current.removeEventListener("DOMContentLoaded",this.handleLoad)}getDoc(){return this.nodeRef.current?this.nodeRef.current.contentDocument:null}getMountTarget(){const n=this.getDoc();return this.props.mountTarget?n.querySelector(this.props.mountTarget):n.body.children[0]}renderFrameContents(){if(!this._isMounted)return null;const n=this.getDoc();if(!n)return null;const i=this.props.contentDidMount,c=this.props.contentDidUpdate,r=n.defaultView||n.parentView,a=s.jsxRuntimeExports.jsx(Be,{contentDidMount:i,contentDidUpdate:c,children:s.jsxRuntimeExports.jsx(xt,{value:{document:n,window:r},children:s.jsxRuntimeExports.jsx("div",{className:"frame-content",children:this.props.children})})}),d=this.getMountTarget();return[fe.createPortal(this.props.head,this.getDoc().head),fe.createPortal(a,d)]}render(){const n={...this.props,srcDoc:this.props.initialContent,children:void 0};return delete n.head,delete n.initialContent,delete n.mountTarget,delete n.contentDidMount,delete n.contentDidUpdate,delete n.forwardedRef,s.jsxRuntimeExports.jsx("iframe",{...n,ref:this.setRef,onLoad:this.handleLoad,children:this.state.iframeLoaded&&this.renderFrameContents()})}}U(le,"propTypes",{style:q.object,head:q.node,initialContent:q.string,mountTarget:q.string,contentDidMount:q.func,contentDidUpdate:q.func,children:q.oneOfType([q.element,q.arrayOf(q.element)])}),U(le,"defaultProps",{style:{},head:null,children:void 0,mountTarget:void 0,contentDidMount:()=>{},contentDidUpdate:()=>{},initialContent:'<!DOCTYPE html><html><head></head><body><div class="frame-root"></div></body></html>'});const ht=m.forwardRef((e,t)=>s.jsxRuntimeExports.jsx(le,{...e,forwardedRef:t}));let H=null,X=[],Ie=null;function gt(e){const t=window.getComputedStyle(e),n=parseInt(t.paddingLeft,10),i=parseInt(t.paddingTop,10),c=parseInt(t.paddingRight,10),r=parseInt(t.paddingBottom,10);return{paddingLeft:n,paddingTop:i,paddingRight:c,paddingBottom:r}}const ke=(e,t,n)=>{if(!H)return;const i=e.getBoundingClientRect(),c=H==null?void 0:H.getElementById("placeholder"),{paddingLeft:r,paddingTop:a,paddingRight:d,paddingBottom:x}=gt(e);c.style.width=t==="vertical"?i.width-r-d+"px":"2px",c.style.height=t==="vertical"?"2px":i.height-a-x+"px",c.style.display="block";const f=X.reduce((g,h)=>Math.abs(h-n)<Math.abs(g-n)?h:g);Ie=X.indexOf(f),t==="vertical"?(c.style.top=e.offsetTop+f+"px",c.style.left=e.offsetLeft+r+"px"):(c.style.top=e.offsetTop+a+"px",c.style.left=e.offsetLeft+f+"px")},mt=e=>{const t=De(e),n=window.getComputedStyle(e),i=t==="horizontal",c=parseInt(n.paddingLeft),r=parseInt(n.paddingTop);let a=i?c:r;X=[a],Array.from(e.children).forEach(d=>{const x=window.getComputedStyle(d),f=parseInt(i?x.marginLeft+x.marginRight:x.marginTop+x.marginBottom),g=i?d.offsetWidth:d.offsetHeight;X.push(a+g+f),a+=g+f})};function De(e){const t=window.getComputedStyle(e).display,n=window.getComputedStyle(e).flexDirection;if(t==="flex")return n==="column"||n==="column-reverse"?"vertical":"horizontal";if(t==="grid"){const i=window.getComputedStyle(e).gridTemplateRows,c=window.getComputedStyle(e).gridTemplateColumns;if(i.includes("auto"))return"vertical";if(c.includes("auto"))return"horizontal"}return t==="block"?"vertical":"horizontal"}const yt=p.throttle(e=>{const t=e.target,n=De(t);if(n==="vertical"){const i=e.clientY-t.offsetTop;ke(t,n,i)}else{const i=e.clientX-t.offsetLeft;ke(t,n,i)}},200),vt=e=>{e.preventDefault(),e.stopPropagation(),yt(e)};function we(){const e=H==null?void 0:H.getElementById("placeholder");e.style.display="none"}const jt=()=>{const{document:e}=Q(),[t,n]=F.useAtom(o.draggingFlagAtom),i=Ue.useAddBlockByDrop(),c=ze.useFeature("dnd");return H=e,{isDragging:t,"data-dnd":"branch",onDragOver:c?vt:p.noop,onDrop:c?r=>{const a=JSON.parse(r.dataTransfer.getData("text/plain"));let d=r.target.getAttribute("data-block-id");d===null&&(d=r.target.parentElement.getAttribute("data-block-id")),i({block:a,dropTargetId:d||null,relativeIndex:Ie}),n(!1),setTimeout(()=>we(),300)}:p.noop,onDragEnter:c?r=>{const a=r;a.stopPropagation(),a.preventDefault(),X=[];const d=a.target;mt(d),d.classList.add("outline","outline-green-300","outline-2","-outline-offset-2"),n(!0)}:p.noop,onDragLeave:c?r=>{const a=r;a.stopPropagation(),a.preventDefault(),a.target.classList.remove("outline","outline-green-300","outline-2","-outline-offset-2")}:p.noop,onMouseOut:c?()=>{n(!1),we()}:p.noop}};function ue(e){return e.getAttribute("data-block-id")?e:e.closest("[data-block-id]")}function bt(e){e.container.innerHTML="",e.container.parentNode.removeChild(e.container);var t=document.querySelector(".ql-toolbar");t&&t.parentNode.removeChild(t),e=null}const Et=()=>{const e=["Heading","Paragraph","Text","Link","Span","Button"],t=o.useUpdateBlocksProps(),[,n]=o.useSelectedBlockIds(),[,i]=o.useHighlightBlockId(),[c,r]=F.useAtom(o.inlineEditingActiveAtom);return a=>{var b;if(c)return;const d=ue(a.target),x=d.getAttribute("data-block-type");if(!x||!e.includes(x))return;const f=d.cloneNode(!0);d.style.display="none",Array.from(f.attributes).forEach(R=>{R.name!=="class"&&f.removeAttribute(R.name)}),x==="Text"&&(f.style.display="inline-block"),d.parentNode.insertBefore(f,d.nextSibling);const g=new He.Quill(f,{placeholder:"Type here..."});function h(){const R=g.getText(0,g.getLength());t([d.getAttribute("data-block-id")],{content:R}),d.removeAttribute("style"),f.removeEventListener("blur",h,!0),bt(g),r(""),i("")}f.addEventListener("blur",h,!0),g.focus(),(b=f.querySelector(".ql-clipboard"))==null||b.remove(),n([]),r(d.getAttribute("data-block-id"))}},kt=()=>{const[,e]=o.useSelectedStylingBlocks(),[,t]=o.useSelectedBlockIds(),[n]=F.useAtom(o.inlineEditingActiveAtom);return i=>{if(n)return;i.stopPropagation();const c=ue(i.target);if(c.getAttribute("data-block-parent")){const r=c.getAttribute("data-style-prop"),a=c.getAttribute("data-style-id"),d=c.getAttribute("data-block-parent");e([{id:a,prop:r,blockId:d}]),t([d])}else c.getAttribute("data-block-id")&&t([c.getAttribute("data-block-id")])}},wt=p.throttle((e,t)=>{const n=ue(e.target);n.getAttribute("data-style-id")&&t(n.getAttribute("data-style-id"))},100),Rt=()=>{const[,e]=o.useHighlightBlockId(),[t]=F.useAtom(o.inlineEditingActiveAtom);return n=>{t||wt(n,e)}},St=({children:e})=>{const{document:t}=Q(),[n]=o.useSelectedBlockIds(),[i,c]=o.useSelectedStylingBlocks();m.useEffect(()=>{setTimeout(()=>{if(!p.isEmpty(i))return;const f=Ae(t,p.first(n));if(f){const g=f.getAttribute("data-style-prop");if(g){const h=f.getAttribute("data-style-id"),b=f.getAttribute("data-block-parent");c([{id:h,prop:g,blockId:b}])}}},100)},[t,n,c,i]);const r=Et(),a=kt(),d=Rt(),x=jt();return s.jsxRuntimeExports.jsx("div",{id:"canvas",onClick:a,onDoubleClick:r,onMouseMove:d,...p.omit(x,"isDragging"),className:"relative h-screen max-w-full "+(x.isDragging?"dragging":""),children:e})},Ae=(e,t)=>e.querySelector(`[data-block-id="${t}"]`),Ct=()=>{const{window:e}=Q(),[t,n]=o.useSelectedBlockIds(),[,i]=o.useSelectedStylingBlocks(),{undo:c,redo:r}=o.useCanvasHistory(),a=o.useDuplicateBlocks(),[,d]=o.useCutBlockIds(),[,x]=o.useCopyBlockIds(),{pasteBlocks:f}=o.usePasteBlocks(),[,g]=o.usePreviewMode(),h=o.useRemoveBlocks(),{savePage:b}=o.useSavePage(),[R]=F.useAtom(o.inlineEditingActiveAtom),[,M]=F.useAtom(o.editLayerNameAtom),S=D=>{D.key==="Enter"&&(D.preventDefault(),t.length===1&&M(p.first(t)))};return m.useEffect(()=>{const D=v=>{if(v.key==="Escape"){n([]),i([]);return}if(S(v),!R&&(v.key==="Delete"||v.key==="Backspace")&&(v.preventDefault(),h(t)),v.ctrlKey||v.metaKey){if(["z","y","d","x","c","p","s","v"].includes(v.key)){if(R&&["x","z","v"].includes(v.key))return!0;v.preventDefault()}v.key==="s"&&(v.stopPropagation(),v.preventDefault(),b()),v.key==="z"&&c(),v.key==="y"&&r(),v.key==="d"&&a(t),v.key==="x"&&d(t),v.key==="c"&&x(t),v.key==="v"&&t.length>0&&f(t[0])}};return e.removeEventListener("keydown",D),e.addEventListener("keydown",D),()=>{e.removeEventListener("keydown",D)}},[t,n,c,h,g,r,a,d,x,f,R,b,e]),null},Tt=({block:e,label:t})=>{const[,n]=Ke.useDrag(()=>({type:"CANVAS_BLOCK",item:e}));return s.jsxRuntimeExports.jsxs("div",{className:"mr-10 flex cursor-grab items-center space-x-1 px-1",ref:n,onDragStart:()=>{console.log("drag start")},children:[s.jsxRuntimeExports.jsx(P.DragHandleDots2Icon,{}),t]})},Bt=({selectedBlockElement:e,block:t})=>{const n=o.useRemoveBlocks(),i=o.useDuplicateBlocks(),[,c]=o.useSelectedBlockIds(),[,r]=o.useSelectedStylingBlocks(),{floatingStyles:a,refs:d,update:x}=xe.useFloating({placement:"top-start",middleware:[xe.shift(),Ye.flip()],elements:{reference:e}});Ve.useResizeObserver(e,()=>x(),e!==null);const f=p.get(t,"_parent",null),g=p.isEmpty(p.get(t,"_name",""))?p.get(t,"_type",""):p.get(t,"_name","");return!e||!t?null:s.jsxRuntimeExports.jsxs("div",{role:"button",tabIndex:0,ref:d.setFloating,style:a,onClick:h=>{h.stopPropagation(),h.preventDefault()},onKeyDown:h=>h.stopPropagation(),className:"z-50 flex h-6 items-center bg-blue-500 py-2 text-xs text-white",children:[s.jsxRuntimeExports.jsx(Tt,{label:g,block:t}),s.jsxRuntimeExports.jsxs("div",{className:"flex gap-2 px-1 ",children:[f&&s.jsxRuntimeExports.jsx(P.ArrowUpIcon,{className:"hover:scale-105 ",onClick:()=>{r([]),c([f])}}),o.canDuplicateBlock(p.get(t,"_type",""))?s.jsxRuntimeExports.jsx(P.CopyIcon,{className:"hover:scale-105 ",onClick:()=>i([t==null?void 0:t._id])}):null,o.canDeleteBlock(p.get(t,"_type",""))?s.jsxRuntimeExports.jsx(P.TrashIcon,{className:"hover:scale-105 ",onClick:()=>n([t==null?void 0:t._id])}):null]})]})},It=({model:e})=>{const[t]=o.useBrandingOptions(),[n]=o.useSelectedBlockIds(),[i]=o.useDarkMode(),[c]=o.useHighlightBlockId(),[r]=o.useSelectedStylingBlocks(),{document:a,window:d}=Q(),[x]=m.useState(a==null?void 0:a.getElementById("highlighted-block")),[f]=m.useState(a==null?void 0:a.getElementById("selected-block")),[g]=m.useState(a==null?void 0:a.getElementById("selected-styling-block"));m.useEffect(()=>{i?a==null||a.documentElement.classList.add("dark"):a==null||a.documentElement.classList.remove("dark")},[i,a]);const h=p.get(t,"headingFont","DM Sans"),b=p.get(t,"bodyFont","DM Sans");return m.useEffect(()=>{const R=p.get(t,"primaryColor","#000"),M=p.get(t,"secondaryColor","#FFF"),S=Xe.tailwindcssPaletteGenerator({colors:[R,M],names:["primary","secondary"]});S.primary.DEFAULT=R,S.secondary.DEFAULT=M;const D=p.get(t,"roundedCorners","0");!d||!d.tailwind||(d.tailwind.config={darkMode:"class",theme:{fontFamily:{heading:[h],body:[b]},extend:{borderRadius:{global:`${D||"0"}px`},colors:S}},plugins:[d.tailwind.plugin.withOptions(({prefix:v="ui"}={})=>({addVariant:z})=>{for(const _ of["open","checked","selected","active","disabled"])z(`${v}-${_}`,[`&[data-headlessui-state~="${_}"]`,`:where([data-headlessui-state~="${_}"]) &`]),z(`${v}-not-${_}`,[`&[data-headlessui-state]:not([data-headlessui-state~="${_}"])`,`:where([data-headlessui-state]:not([data-headlessui-state~="${_}"])) &:not([data-headlessui-state])`])})]})},[t,d,h,b]),m.useEffect(()=>{f&&(f.textContent=`${p.map(n,R=>`[data-block-id="${R}"]`).join(",")}{
55
- outline: 1px solid ${n.length===1?"#42a1fc":"orange"} !important; outline-offset: -1px;
56
- }`)},[n,f]),m.useEffect(()=>{x&&(x.textContent=c?`[data-style-id="${c}"]{ outline: 1px solid orange !important; outline-offset: -1px;}`:"")},[c,n,x]),m.useEffect(()=>{g&&(g.textContent=`${p.map(r,({id:R})=>`[data-style-id="${R}"]`).join(",")}{
57
- outline: 1px solid orange !important; outline-offset: -1px;
58
- }`)},[r,g]),m.useEffect(()=>{if(e==="section")return;const R=p.get(t,"bodyTextLightColor","#64748b"),M=p.get(t,"bodyTextDarkColor","#94a3b8"),S=p.get(t,"bodyBgLightColor","#FFFFFF"),D=p.get(t,"bodyBgDarkColor","#0f172a");a.body.className=`font-body antialiased text-[${R}] bg-[${S}] dark:text-[${M}] dark:bg-[${D}]`},[t,a,e]),e==="page"?s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[h&&s.jsxRuntimeExports.jsx("link",{id:"heading-font",rel:"stylesheet",type:"text/css",href:`https://fonts.googleapis.com/css2?family=${h.replace(/ /g,"+")}:wght@300;400;500;600;700;800;900&display=swap`,media:"all"}),b&&h!==b&&s.jsxRuntimeExports.jsx("link",{id:"body-font",rel:"stylesheet",type:"text/css",href:`https://fonts.googleapis.com/css2?family=${b.replace(/ /g,"+")}:wght@300;400;500;600;700;800;900&display=swap`,media:"all"}),h&&s.jsxRuntimeExports.jsx("style",{children:`h1,h2,h3,h4,h5,h6{font-family: "${h}",ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";}`})]}):null},Dt=e=>{const t={};return Object.keys(e).forEach(n=>{p.isString(e[n])&&e[n].startsWith(V.SLOT_KEY)&&(t[n]=e[n].replace(V.SLOT_KEY,"").split(","))}),t},At=p.memoize(e=>{const t=e.replace(V.STYLES_KEY,"").split(",");return Ze.twMerge(t[0],t[1])});function Ot(e,t){return p.get(e,`${t}_attrs`,{})}function qt(e){const t={};return Object.keys(e).forEach(n=>{if(p.isString(e[n])&&e[n].startsWith(V.STYLES_KEY)){const i=At(e[n]);t[n]={className:i,"data-style-prop":n,"data-block-parent":e._id,"data-style-id":`${n}-${e._id}`,...Ot(e,n)}}}),t}function Pt(e,t){const n=p.get(e,"_bindings",{});return p.isEmpty(n)?{...e}:(p.each(n,(i,c)=>{p.isString(i)&&p.get(t,i,null)&&(e[c]=p.get(t,i,null))}),e)}function ce({blocks:e}){const t=o.useAllBlocks(),n=m.useCallback(r=>qt(r),[]),[i]=J.useChaiExternalData(),[c]=o.useAtom(o.inlineEditingActiveAtom);return s.jsxRuntimeExports.jsx(s.jsxRuntimeExports.Fragment,{children:m.Children.toArray(e.map((r,a)=>{if(c===r._id)return null;const d=Dt(r),x={};p.isEmpty(d)||Object.keys(d).forEach(b=>{x[b]=m.Children.toArray(d[b].map(R=>s.jsxRuntimeExports.jsx(ce,{blocks:[p.find(t,{_id:R})]})))});const f=p.filter(t,{_parent:r._id});x.children=f.length?s.jsxRuntimeExports.jsx(ce,{blocks:f}):null;const g=Ge.getBlockComponent(r._type),h=p.get(g,"component",null);return p.isNull(h)?s.jsxRuntimeExports.jsx("noscript",{children:`<!-- ${r==null?void 0:r._type} not registered -->`}):s.jsxRuntimeExports.jsx(m.Suspense,{children:m.createElement(h,{blockProps:{"data-block-id":r._id,"data-block-type":r._type,"data-dnd":o.canAddChildBlock(r._type)?"branch":"leaf"},inBuilder:!0,index:a,...Pt(r,i),...n(r),...x})})}))})}const Mt=()=>{const e=o.useAllBlocks();return s.jsxRuntimeExports.jsx(Je.Provider,{children:p.isEmpty(e)?null:s.jsxRuntimeExports.jsx(J.BlocksExternalDataProvider,{children:s.jsxRuntimeExports.jsx(ce,{blocks:p.filter(e,t=>p.isEmpty(t._parent))})})})},Lt=(e,t)=>e.querySelector(`[data-style-id="${t}"]`),_t=()=>{const[e]=F.useAtom(o.networkModeAtom),[t]=o.usePreviewMode(),[n]=o.useCanvasWidth(),[,i]=o.useSelectedBlockIds(),c=o.useSelectedBlock(),[,r]=o.useHighlightBlockId(),a=m.useRef(null),d=m.useRef(null),[x,f]=m.useState({width:0,height:0}),g=it(x),[h,b]=m.useState(0),[R,M]=m.useState([]),[,S]=m.useState([]),[,D]=F.useAtom(o.canvasIframeAtom),[v,z]=o.useSelectedStylingBlocks(),_=o.useBuilderProp("loadingCanvas",!1);m.useEffect(()=>{const{clientWidth:A,clientHeight:N}=d.current;f({width:A,height:N}),h===0&&b(A)},[d,n,h]);const ee=(A,N=0)=>{const{top:W}=A.getBoundingClientRect();return W+N>=0&&W-N<=window.innerHeight};m.useEffect(()=>{var A,N;if(c&&c.type!=="Multiple"&&a.current){const W=Ae(a.current.contentDocument,c._id);W&&(ee(W)||(N=(A=a.current)==null?void 0:A.contentWindow)==null||N.scrollTo({top:W.offsetTop,behavior:"smooth"}),M([W]))}},[c]),m.useEffect(()=>{if(!p.isEmpty(v)&&a.current){const A=Lt(a.current.contentDocument,p.first(v).id);S(A?[A]:[null])}else S([null])},[v]);const te=m.useMemo(()=>{let A=ot;return e==="offline"&&(A=A.replace("https://old.chaibuilder.com/offline/tailwind.cdn.js","/offline/tailwind.cdn.js"),A=A.replace("https://unpkg.com/aos@next/dist/aos.css","/offline/aos.css"),A=A.replace("https://unpkg.com/aos@next/dist/aos.js","/offline/aos.js")),A},[e]);return s.jsxRuntimeExports.jsx("div",{onClick:()=>{i([]),z([])},onMouseLeave:()=>setTimeout(()=>r(""),300),className:"relative mx-auto h-full w-full",style:h>0&&!p.isEmpty(g)?{width:t?"100%":h}:{},ref:d,children:s.jsxRuntimeExports.jsxs(ht,{contentDidMount:()=>D(a.current),ref:a,id:"canvas-iframe",style:{width:`${n}px`,...g},className:"relative mx-auto box-content h-full max-w-full shadow-lg transition-all duration-300 ease-linear",initialContent:te,children:[s.jsxRuntimeExports.jsx(Ct,{}),s.jsxRuntimeExports.jsx(Bt,{block:c,selectedBlockElement:p.first(R)}),s.jsxRuntimeExports.jsx(It,{model:"page"}),s.jsxRuntimeExports.jsx(St,{children:_?s.jsxRuntimeExports.jsx("div",{className:"h-full p-4",children:s.jsxRuntimeExports.jsx(o.Skeleton,{className:"h-full"})}):s.jsxRuntimeExports.jsx(Mt,{})}),s.jsxRuntimeExports.jsx("div",{id:"placeholder",className:"absolute bg-green-500 z-[99999] max-w-full transition-transform"})]})})},Nt=m.lazy(()=>Promise.resolve().then(()=>require("./AddBlocks-P3qHuE5J.cjs"))),Wt=()=>{const[e,t]=F.useAtom(o.addBlocksModalAtom);return s.jsxRuntimeExports.jsxs("div",{className:"flex h-full w-full flex-col",children:[s.jsxRuntimeExports.jsx(rt,{}),s.jsxRuntimeExports.jsxs("div",{className:"relative flex-1 overflow-hidden bg-slate-800/90 px-2 bg-[linear-gradient(to_right,#222_0.5px,transparent_0.5px),linear-gradient(to_bottom,#222_0.5px,transparent_0.5px)] bg-[size:12px_12px]",children:[s.jsxRuntimeExports.jsx(m.Suspense,{fallback:s.jsxRuntimeExports.jsx(o.Skeleton,{className:"h-full"}),children:s.jsxRuntimeExports.jsx(J.ErrorBoundary,{children:s.jsxRuntimeExports.jsx(_t,{})})}),e?s.jsxRuntimeExports.jsx("div",{onClick:()=>t(!1),className:"absolute inset-0 z-50 flex items-center bg-black/30 backdrop-blur-sm",children:s.jsxRuntimeExports.jsx("div",{onClick:n=>n.stopPropagation(),className:"mx-auto h-[90%] w-[90%] max-w-3xl rounded-md bg-white p-4 shadow-lg shadow-black/10 xl:w-[65%]",children:s.jsxRuntimeExports.jsx(Nt,{})})}):null]})]})};exports.default=Wt;