@chaibuilder/sdk 1.2.71 → 1.2.73

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.
@@ -18,7 +18,7 @@ import { S as SLOT_KEY, I as I18N_KEY, a as STYLES_KEY, R as ROOT_TEMP_KEY, O as
18
18
  import { useHotkeys } from "react-hotkeys-hook";
19
19
  import { flip as flip$2 } from "@floating-ui/dom";
20
20
  import { useFloating as useFloating$1, shift, getOverflowAncestors, autoUpdate, size, offset, limitShift, flip as flip$3, inline, arrow } from "@floating-ui/react-dom";
21
- import { ArrowUpIcon, PlusIcon, CopyIcon as CopyIcon$1, TrashIcon, DragHandleDots2Icon, 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, CardStackPlusIcon, CardStackIcon, ScissorsIcon, TriangleRightIcon, Cross2Icon, EyeOpenIcon, EyeClosedIcon, WidthIcon, HeightIcon, ArrowRightIcon, ArrowDownIcon, ArrowLeftIcon, ArrowTopLeftIcon, ArrowTopRightIcon, ArrowBottomRightIcon, ArrowBottomLeftIcon, AlignLeftIcon, AlignCenterHorizontallyIcon, AlignRightIcon, StretchHorizontallyIcon, FontItalicIcon, UnderlineIcon, OverlineIcon, LetterCaseUppercaseIcon, Cross1Icon, InfoCircledIcon, MinusIcon, TriangleDownIcon, RowSpacingIcon, CrossCircledIcon, CaretDownIcon, CaretSortIcon, CheckIcon, CaretRightIcon, MixerHorizontalIcon, ResetIcon, SunIcon, DotsVerticalIcon, MobileIcon, LaptopIcon, DesktopIcon, EraserIcon, ZoomInIcon } from "@radix-ui/react-icons";
21
+ import { ArrowUpIcon, PlusIcon, CopyIcon as CopyIcon$1, TrashIcon, DragHandleDots2Icon, 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, CardStackPlusIcon, CardStackIcon, ScissorsIcon, TriangleRightIcon, Cross2Icon, EyeOpenIcon, EyeClosedIcon, WidthIcon, HeightIcon, ArrowRightIcon, ArrowDownIcon, ArrowLeftIcon, ArrowTopLeftIcon, ArrowTopRightIcon, ArrowBottomRightIcon, ArrowBottomLeftIcon, AlignLeftIcon, AlignCenterHorizontallyIcon, AlignRightIcon, StretchHorizontallyIcon, FontItalicIcon, UnderlineIcon, OverlineIcon, LetterCaseUppercaseIcon, Cross1Icon, InfoCircledIcon, MinusIcon, TriangleDownIcon, RowSpacingIcon, CrossCircledIcon, CaretDownIcon, CaretRightIcon, CheckIcon, ResetIcon, SunIcon, DotsVerticalIcon, MobileIcon, LaptopIcon, DesktopIcon, EraserIcon, ZoomInIcon, MixerHorizontalIcon, LightningBoltIcon } from "@radix-ui/react-icons";
22
22
  import { useFeature, FlagsProvider } from "flagged";
23
23
  import typography$1 from "@tailwindcss/typography";
24
24
  import forms from "@tailwindcss/forms";
@@ -32,7 +32,7 @@ import { Resizable } from "re-resizable";
32
32
  import validator from "@rjsf/validator-ajv8";
33
33
  import Form from "@rjsf/core";
34
34
  import { Tree } from "react-arborist";
35
- import { DatabaseIcon, PlusIcon as PlusIcon$1, EditIcon, TrashIcon as TrashIcon$1, Check, Loader as Loader$1, SparklesIcon, SmileIcon, ShuffleIcon, Edit2, X, ChevronDown, Layers, PaintBucketIcon } from "lucide-react";
35
+ import { DatabaseIcon, PlusIcon as PlusIcon$1, EditIcon, TrashIcon as TrashIcon$1, Check, Loader as Loader$1, SparklesIcon, SmileIcon, ShuffleIcon, ChevronDown, Edit2, X, Layers, PaintBucketIcon } from "lucide-react";
36
36
  import { parse as parse$1, stringify as stringify$3 } from "himalaya";
37
37
  import IconPicker, { IconPickerItem } from "react-icons-picker";
38
38
  import Autosuggest from "react-autosuggest";
@@ -41,7 +41,6 @@ import clsx from "clsx";
41
41
  import i18n from "i18next";
42
42
  import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
43
43
  import { motion } from "framer-motion";
44
- import { isEmpty as isEmpty$1, each as each$1 } from "lodash";
45
44
  const canAcceptChildBlock = (r, n) => {
46
45
  if (!r)
47
46
  return !0;
@@ -3576,7 +3575,7 @@ let ErrorBoundary$2 = class extends React__default.Component {
3576
3575
  ] }) : this.props.children;
3577
3576
  }
3578
3577
  };
3579
- const CodeEditor$1 = React__default.lazy(() => import("./CodeEditor-aLPRKFR0.js")), CanvasArea = () => {
3578
+ const CodeEditor$1 = React__default.lazy(() => import("./CodeEditor-YW3qlWKm.js")), CanvasArea = () => {
3580
3579
  const [r] = useCodeEditor();
3581
3580
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex h-full w-full flex-col", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "relative flex h-full flex-col overflow-hidden bg-gray-100/40 px-2", children: [
3582
3581
  /* @__PURE__ */ jsxRuntimeExports.jsx(Suspense, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton, { className: "h-full" }), children: /* @__PURE__ */ jsxRuntimeExports.jsx(ErrorBoundary$2, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(StaticCanvas$1, {}) }) }),
@@ -3991,10 +3990,17 @@ const Node = memo(({ node: r, style: n, dragHandle: o }) => {
3991
3990
  const O = k.getBoundingClientRect(), T = c.getBoundingClientRect();
3992
3991
  O.top >= T.top && O.left >= T.left && O.bottom <= T.bottom && O.right <= T.right || (j.documentElement.scrollTop = k.offsetTop - T.top);
3993
3992
  };
3994
- return p === ROOT_TEMP_KEY ? /* @__PURE__ */ jsxRuntimeExports.jsxs("button", { onClick: () => i(ROOT_TEMP_KEY), className: "mb-10 w-full rounded bg-gray-100 p-1 hover:bg-gray-200", children: [
3995
- "+ ",
3996
- l("add_block")
3997
- ] }) : /* @__PURE__ */ jsxRuntimeExports.jsx(BlockContextMenu, { id: p, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
3993
+ return p === ROOT_TEMP_KEY ? /* @__PURE__ */ jsxRuntimeExports.jsxs(
3994
+ "button",
3995
+ {
3996
+ onClick: () => i(ROOT_TEMP_KEY),
3997
+ className: "mb-10 mt-5 w-full rounded bg-gray-100 p-1 hover:bg-gray-200",
3998
+ children: [
3999
+ "+ ",
4000
+ l("add_block")
4001
+ ]
4002
+ }
4003
+ ) : /* @__PURE__ */ jsxRuntimeExports.jsx(BlockContextMenu, { id: p, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
3998
4004
  "div",
3999
4005
  {
4000
4006
  onClick: A,
@@ -4013,7 +4019,7 @@ const Node = memo(({ node: r, style: n, dragHandle: o }) => {
4013
4019
  R.preventDefault(), C(p, "no");
4014
4020
  },
4015
4021
  className: cn(
4016
- "group flex !h-fit w-full items-center justify-between space-x-px !rounded py-px outline-none",
4022
+ "group flex !h-full w-full items-center justify-between space-x-px !rounded py-px outline-none",
4017
4023
  g ? "bg-blue-500 text-white" : "text-gray-600 hover:bg-gray-200 dark:hover:bg-gray-800",
4018
4024
  h && canAcceptChildBlock(m._type, "Icon") ? "bg-green-200" : "",
4019
4025
  b && "opacity-20"
@@ -4052,12 +4058,12 @@ const Node = memo(({ node: r, style: n, dragHandle: o }) => {
4052
4058
  TooltipTrigger,
4053
4059
  {
4054
4060
  onClick: () => i(p),
4055
- className: "cursor-pointer rounded bg-transparent hover:bg-white hover:text-blue-500",
4061
+ className: "cursor-pointer rounded bg-transparent hover:bg-white hover:text-black",
4056
4062
  asChild: !0,
4057
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(PlusIcon$1, { size: "14" })
4063
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(PlusIcon$1, { size: "18" })
4058
4064
  }
4059
4065
  ),
4060
- /* @__PURE__ */ jsxRuntimeExports.jsx(TooltipContent, { className: "z-[9999]", children: l("Add block") })
4066
+ /* @__PURE__ */ jsxRuntimeExports.jsx(TooltipContent, { className: "isolate", children: l("Add block") })
4061
4067
  ] }) : null,
4062
4068
  a.map((R) => /* @__PURE__ */ jsxRuntimeExports.jsxs(Tooltip$1, { children: [
4063
4069
  /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -4068,7 +4074,7 @@ const Node = memo(({ node: r, style: n, dragHandle: o }) => {
4068
4074
  children: React__default.createElement(R.item, { blockId: p })
4069
4075
  }
4070
4076
  ),
4071
- /* @__PURE__ */ jsxRuntimeExports.jsx(TooltipContent, { className: "z-[9999]", children: R.tooltip })
4077
+ /* @__PURE__ */ jsxRuntimeExports.jsx(TooltipContent, { className: "isolate", children: R.tooltip })
4072
4078
  ] }))
4073
4079
  ] })
4074
4080
  ]
@@ -4172,7 +4178,7 @@ const Node = memo(({ node: r, style: n, dragHandle: o }) => {
4172
4178
  /* @__PURE__ */ jsxRuntimeExports.jsx("br", {}),
4173
4179
  /* @__PURE__ */ jsxRuntimeExports.jsx("br", {}),
4174
4180
  /* @__PURE__ */ jsxRuntimeExports.jsx(Button$1, { onClick: () => setOpen(ROOT_TEMP_KEY), variant: "default", size: "sm", children: t("add_block") })
4175
- ] }) }) }) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: cn("-mx-1 -mt-1 flex h-full select-none flex-col space-y-1"), onClick: () => clearSelection(), children: /* @__PURE__ */ jsxRuntimeExports.jsx(
4181
+ ] }) }) }) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: cn("flex h-full select-none flex-col space-y-1"), onClick: () => clearSelection(), children: /* @__PURE__ */ jsxRuntimeExports.jsx(
4176
4182
  "div",
4177
4183
  {
4178
4184
  id: "outline-view",
@@ -4190,7 +4196,7 @@ const Node = memo(({ node: r, style: n, dragHandle: o }) => {
4190
4196
  onRename,
4191
4197
  openByDefault: !1,
4192
4198
  onMove,
4193
- rowHeight: 20,
4199
+ rowHeight: 25,
4194
4200
  data: [...filteredTreeData],
4195
4201
  renderCursor: DefaultCursor,
4196
4202
  onSelect,
@@ -4954,7 +4960,7 @@ const ViewData = ({ data: r, fullView: n }) => {
4954
4960
  }
4955
4961
  )
4956
4962
  ] });
4957
- }, UnsplashImages = React__default.lazy(() => import("./UnsplashImages-MGBAHsZC.js")), UploadImages = React__default.lazy(() => import("./UploadImages-4keVl9aw.js")), ImagesPanel = ({
4963
+ }, UnsplashImages = React__default.lazy(() => import("./UnsplashImages-gWlRHso5.js")), UploadImages = React__default.lazy(() => import("./UploadImages-hwW7jgSV.js")), ImagesPanel = ({
4958
4964
  isModalView: r = !1,
4959
4965
  onSelect: n = () => {
4960
4966
  }
@@ -6627,53 +6633,50 @@ function BlockStyling() {
6627
6633
  ] })
6628
6634
  ] });
6629
6635
  }
6636
+ const ChaiSelect = ({
6637
+ defaultValue: r = "",
6638
+ onValueChange: n,
6639
+ options: o,
6640
+ placeholder: a = "Select",
6641
+ className: i = ""
6642
+ }) => {
6643
+ const [l, c] = useState$1(r), u = (d) => {
6644
+ const p = d.target.value;
6645
+ c(p), n(p);
6646
+ };
6647
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: cn("relative inline-block w-full", i), children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
6648
+ "select",
6649
+ {
6650
+ className: "focus:shadow-outline w-full appearance-none rounded border border-gray-300 bg-white px-4 py-1 pr-8 text-sm leading-tight shadow hover:border-gray-400 focus:outline-none",
6651
+ value: l,
6652
+ onChange: u,
6653
+ children: [
6654
+ /* @__PURE__ */ jsxRuntimeExports.jsx("option", { value: "", disabled: !0, children: a }),
6655
+ o.map((d) => /* @__PURE__ */ jsxRuntimeExports.jsx("option", { value: d.value, children: d.label }, d.value))
6656
+ ]
6657
+ }
6658
+ ) });
6659
+ }, ChaiSelect$1 = ChaiSelect;
6630
6660
  function UILibrariesSelect({
6631
6661
  uiLibraries: r,
6632
6662
  library: n,
6633
6663
  setLibrary: o
6634
6664
  }) {
6635
- var c;
6636
- const [a, i] = React.useState(!1), { t: l } = useTranslation();
6637
- return n ? /* @__PURE__ */ jsxRuntimeExports.jsxs(Popover$1, { open: a, onOpenChange: i, children: [
6638
- /* @__PURE__ */ jsxRuntimeExports.jsx(PopoverTrigger, { asChild: !0, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col gap-y-1", children: [
6639
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-xs font-bold text-gray-500", children: l("choose_library") }),
6640
- /* @__PURE__ */ jsxRuntimeExports.jsxs(
6641
- Button$1,
6642
- {
6643
- variant: "outline",
6644
- size: "sm",
6645
- role: "combobox",
6646
- "aria-expanded": a,
6647
- className: "w-[200px] justify-between",
6648
- children: [
6649
- l(n ? (c = r.find((u) => u.uuid === n)) == null ? void 0 : c.name : "choose_library"),
6650
- /* @__PURE__ */ jsxRuntimeExports.jsx(CaretSortIcon, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })
6651
- ]
6652
- }
6653
- )
6654
- ] }) }),
6655
- /* @__PURE__ */ jsxRuntimeExports.jsx(PopoverContent, { className: "w-[200px] p-0", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Command, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(CommandList, { children: [
6656
- /* @__PURE__ */ jsxRuntimeExports.jsx(CommandEmpty, { children: l("no_library_found") }),
6657
- /* @__PURE__ */ jsxRuntimeExports.jsx(CommandGroup, { children: r.map((u) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
6658
- CommandItem,
6659
- {
6660
- value: u.uuid,
6661
- onSelect: (d) => {
6662
- o(d), i(!1);
6663
- },
6664
- children: [
6665
- u.name,
6666
- /* @__PURE__ */ jsxRuntimeExports.jsx(
6667
- CheckIcon,
6668
- {
6669
- className: cn("ml-auto h-4 w-4", n === u.uuid ? "opacity-100" : "opacity-0")
6670
- }
6671
- )
6672
- ]
6673
- },
6674
- u.uuid
6675
- )) })
6676
- ] }) }) })
6665
+ const { t: a } = useTranslation();
6666
+ return n ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
6667
+ /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs font-bold text-gray-500", children: a("choose_library") }),
6668
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
6669
+ ChaiSelect$1,
6670
+ {
6671
+ className: "mt-1",
6672
+ options: r.map((i) => ({
6673
+ value: i.uuid,
6674
+ label: i.name
6675
+ })),
6676
+ defaultValue: n,
6677
+ onValueChange: (i) => o(i)
6678
+ }
6679
+ )
6677
6680
  ] }) : null;
6678
6681
  }
6679
6682
  const BlockCard = ({
@@ -6693,7 +6696,7 @@ const BlockCard = ({
6693
6696
  i(!0);
6694
6697
  const E = await l(o, r);
6695
6698
  let A = first(d);
6696
- x(first(E)) && (A = null), isEmpty(E) || u(syncBlocksWithDefaults(E), A), n();
6699
+ isEmpty(E) || u(syncBlocksWithDefaults(E), A), n();
6697
6700
  },
6698
6701
  [r]
6699
6702
  ), S = async (w) => {
@@ -6754,7 +6757,10 @@ const BlockCard = ({
6754
6757
  h.current && m(S);
6755
6758
  }, 300);
6756
6759
  };
6757
- return u ? /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton, { className: "h-full w-full" }) : /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "relative flex h-full max-h-full flex-col overflow-hidden bg-background", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex h-full pt-2", children: [
6760
+ return u ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-4 grid h-full w-full grid-cols-12 gap-2", children: [
6761
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton, { className: "col-span-3 h-full" }),
6762
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton, { className: "col-span-9 h-full" })
6763
+ ] }) : /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "relative flex h-full max-h-full flex-col overflow-hidden bg-background", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex h-full pt-2", children: [
6758
6764
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex h-full w-52 flex-col gap-1 px-1", children: [
6759
6765
  /* @__PURE__ */ jsxRuntimeExports.jsx(UILibrariesSelect, { library: l == null ? void 0 : l.uuid, setLibrary: n, uiLibraries: o }),
6760
6766
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-2 flex flex-col", children: [
@@ -6899,7 +6905,7 @@ const BlockCard = ({
6899
6905
  multiple_choice: "Multiple Choice",
6900
6906
  textarea: "Textarea",
6901
6907
  rows: "Rows"
6902
- }, ai_assistant = "AI Assistant", close_preview = "Close Preview", saved = "Saved", unsaved = "Unsaved", saving = "Saving...", page_is_empty = "This page is empty.", Theme = "Theme", Outline = "Outline", clipboard_not_supported = "Not supported", please_use_chrome_firefox_or_safari = "Please use Chrome, Firefox or Safari", classes_copied_to_clipboard = "Classes copied to clipboard", download_complete = "Download complete", copied = "Copied", enter_classes_separated_by_space = "Enter classes separated by space", copy_classes_to_clipboard = "Copy classes to clipboard", classes = "Classes", ask_ai = "Ask AI", edit_with_ai = "Edit with AI", generating_please_wait = "Generating... Please wait", stop$1 = "Stop", eg_this_page_is_about_an_ai_assistant_app_called_chai_studio_it_allows_users_to_create_beautiful_webpages_and_edit_content_with_ai = "E.g.: This page is about an AI assistant app called Chai Studio. It allows users to create beautiful webpages and edit content with AI.", ask_ai_to_edit_styles = "Ask AI to edit styles", ask_ai_to_edit_content = "Ask AI to edit content", ai_context = "AI Context", please_select_a_block_to_ask_ai = "Select a block to ask AI", edit = "Edit", tell_about_this_page_eg_this_page_is_about = "Describe this page. E.g.: This page is about...", tag = "Tag", value = "Value", background_image = "Background Image", enter_image_url = "Enter image URL", replace_image = "Replace image", choose_image = "Choose image", images = "Images", typography = "Typography", background = "Background", library = "Library", blocks = "Blocks", basic = "Basic", media = "Media", advanced = "Advanced", form = "Form", choose_icon_or_enter_svg = "Choose an icon or enter SVG", groups = "Groups", ui_libraries = "UI Libraries", accordions = "Accordions", buttons = "Buttons", layouts = "Layouts", choose_library = "Choose library", no_library_found = "No library found.", faq = "FAQ", hero = "Hero", features = "Features", footer = "Footer", navbar = "Navbar", icons = "Icons", testimonials = "Testimonials", blog = "Blog", ai_quick_prompts = {
6908
+ }, ai_assistant = "AI Assistant", close_preview = "Close Preview", saved = "Saved", unsaved = "Unsaved", saving = "Saving...", page_is_empty = "This page is empty.", Theme = "Theme", Outline = "Outline", clipboard_not_supported = "Not supported", please_use_chrome_firefox_or_safari = "Please use Chrome, Firefox or Safari", classes_copied_to_clipboard = "Classes copied to clipboard", download_complete = "Download complete", copied = "Copied", enter_classes_separated_by_space = "Enter classes separated by space", copy_classes_to_clipboard = "Copy classes to clipboard", classes = "Classes", ask_ai = "Ask AI", edit_with_ai = "Edit with AI", generating_please_wait = "Generating... Please wait", stop$1 = "Stop", eg_this_page_is_about_an_ai_assistant_app_called_chai_studio_it_allows_users_to_create_beautiful_webpages_and_edit_content_with_ai = "E.g.: This page is about an AI assistant app called Chai Studio. It allows users to create beautiful webpages and edit content with AI.", ask_ai_to_edit_styles = "Ask AI to edit styles", ask_ai_to_edit_content = "Ask AI to edit content", ai_context = "AI Context", please_select_a_block_to_ask_ai = "Select a block to edit with AI", please_select_a_block_to_edit = "Please select a block to edit", edit = "Edit", tell_about_this_page_eg_this_page_is_about = "Describe this page. E.g.: This page is about...", tag = "Tag", value = "Value", background_image = "Background Image", enter_image_url = "Enter image URL", replace_image = "Replace image", choose_image = "Choose image", images = "Images", typography = "Typography", background = "Background", library = "Library", blocks = "Blocks", basic = "Basic", media = "Media", advanced = "Advanced", form = "Form", choose_icon_or_enter_svg = "Choose an icon or enter SVG", groups = "Groups", ui_libraries = "UI Libraries", accordions = "Accordions", buttons = "Buttons", layouts = "Layouts", choose_library = "Choose library", no_library_found = "No library found.", faq = "FAQ", hero = "Hero", features = "Features", footer = "Footer", navbar = "Navbar", icons = "Icons", testimonials = "Testimonials", blog = "Blog", ai_quick_prompts = {
6903
6909
  improve_writing: "Improve writing",
6904
6910
  replace_placeholder_content: "Replace placeholder content",
6905
6911
  fix_grammar: "Fix grammar",
@@ -6907,7 +6913,12 @@ const BlockCard = ({
6907
6913
  make_shorter: "Make shorter",
6908
6914
  add_emojis: "Add emojis",
6909
6915
  randomize: "Randomize"
6910
- }, lngEn = {
6916
+ }, sidebar = {
6917
+ outline: "Outline",
6918
+ edit_block: "Edit Block",
6919
+ ai_assistant: "AI Assistant",
6920
+ theme: "Theme"
6921
+ }, remove_context = "Remove context", yes_delete = "Yes, Delete", ai_context_updated = "AI Context Updated", you_can_now_ask_ai_to_edit_your_content = "You can now ask AI to edit your content.", lngEn = {
6911
6922
  add_block,
6912
6923
  enter_paste_tailwind_html,
6913
6924
  click_to_add_block,
@@ -7168,6 +7179,7 @@ const BlockCard = ({
7168
7179
  ask_ai_to_edit_content,
7169
7180
  ai_context,
7170
7181
  please_select_a_block_to_ask_ai,
7182
+ please_select_a_block_to_edit,
7171
7183
  edit,
7172
7184
  tell_about_this_page_eg_this_page_is_about,
7173
7185
  tag,
@@ -7201,7 +7213,12 @@ const BlockCard = ({
7201
7213
  icons,
7202
7214
  testimonials,
7203
7215
  blog,
7204
- ai_quick_prompts
7216
+ ai_quick_prompts,
7217
+ sidebar,
7218
+ remove_context,
7219
+ yes_delete,
7220
+ ai_context_updated,
7221
+ you_can_now_ask_ai_to_edit_your_content
7205
7222
  };
7206
7223
  i18n.use(initReactI18next).init({
7207
7224
  // the translations
@@ -7386,76 +7403,85 @@ function QuickPrompts({ onClick: r }) {
7386
7403
  ) }) });
7387
7404
  }
7388
7405
  const AIUserPrompt = ({ blockId: r }) => {
7389
- const { t: n } = useTranslation(), { askAi: o, loading: a, error: i } = useAskAi(), [l, c] = useState$1(""), u = useRef$1(null);
7406
+ const { t: n } = useTranslation(), { askAi: o, loading: a, error: i } = useAskAi(), [l, c] = useState$1(""), [u, d] = useState$1(!0), p = useRef$1(null);
7390
7407
  useEffect$1(() => {
7391
- var p;
7392
- (p = u.current) == null || p.focus();
7408
+ var g;
7409
+ (g = p.current) == null || g.focus();
7393
7410
  }, []);
7394
- const d = () => {
7411
+ const m = () => {
7395
7412
  i || c("");
7396
7413
  };
7397
- return r ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-4", children: [
7398
- /* @__PURE__ */ jsxRuntimeExports.jsxs("h2", { className: "mb-2 text-xs font-semibold leading-none tracking-tight text-gray-500", children: [
7399
- n("ask_ai"),
7400
- " (GPT-4o mini)"
7401
- ] }),
7402
- /* @__PURE__ */ jsxRuntimeExports.jsx(
7403
- Textarea,
7414
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "", children: [
7415
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
7416
+ "div",
7404
7417
  {
7405
- ref: u,
7406
- value: l,
7407
- onChange: (p) => c(p.target.value),
7408
- placeholder: n("ask_ai_to_edit_content"),
7409
- className: "w-full border border-gray-400 focus:border-0",
7410
- rows: 3,
7411
- onKeyDown: (p) => {
7412
- p.key === "Enter" && (p.preventDefault(), o("content", r, l, d));
7413
- }
7418
+ onClick: () => d(!u),
7419
+ className: "flex cursor-default items-center justify-between border-b border-gray-300 py-2 text-sm font-bold text-gray-600 hover:bg-gray-50",
7420
+ children: [
7421
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: n("ask_ai") }),
7422
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronDown, { className: "h-4 w-4 text-gray-500 " + (u ? "rotate-180" : "") }) })
7423
+ ]
7414
7424
  }
7415
7425
  ),
7416
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "my-2 flex items-center gap-2", children: [
7417
- a ? null : /* @__PURE__ */ jsxRuntimeExports.jsx(
7418
- Button$1,
7426
+ u && r ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-2", children: [
7427
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
7428
+ Textarea,
7419
7429
  {
7420
- disabled: l.trim().length < 5 || a,
7421
- onClick: () => o("content", r, l, d),
7422
- variant: "default",
7423
- className: "w-fit",
7424
- size: "sm",
7425
- children: a ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
7426
- /* @__PURE__ */ jsxRuntimeExports.jsx(Loader$1, { className: "h-5 w-5 animate-spin" }),
7427
- n("generating_please_wait")
7428
- ] }) : n("edit_with_ai")
7430
+ ref: p,
7431
+ value: l,
7432
+ onChange: (g) => c(g.target.value),
7433
+ placeholder: n("ask_ai_to_edit_content"),
7434
+ className: "w-full border border-gray-400 focus:border-0",
7435
+ rows: 3,
7436
+ onKeyDown: (g) => {
7437
+ g.key === "Enter" && (g.preventDefault(), o("content", r, l, m));
7438
+ }
7429
7439
  }
7430
7440
  ),
7431
- a ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col gap-2", children: [
7432
- /* @__PURE__ */ jsxRuntimeExports.jsxs(Skeleton, { className: "flex w-full items-center space-x-1 px-4 py-1 pl-2", children: [
7433
- /* @__PURE__ */ jsxRuntimeExports.jsx(FaSpinner, { className: "h-4 w-4 animate-spin text-gray-500" }),
7434
- /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs", children: n("generating_please_wait") })
7435
- ] }),
7436
- /* @__PURE__ */ jsxRuntimeExports.jsx(Button$1, { variant: "destructive", onClick: () => stop(), className: "hidden w-fit", size: "sm", children: n("Stop") })
7437
- ] }) : null
7438
- ] }),
7439
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "max-w-full", children: i && /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "break-words rounded border border-red-500 bg-red-100 p-1 text-xs text-red-500", children: i.message }) }),
7440
- /* @__PURE__ */ jsxRuntimeExports.jsx(QuickPrompts, { onClick: (p) => o("content", r, p, d) })
7441
- ] }) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-4 text-center", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-4 rounded-xl p-4", children: [
7442
- /* @__PURE__ */ jsxRuntimeExports.jsx(SparklesIcon, { className: "mx-auto text-3xl" }),
7443
- /* @__PURE__ */ jsxRuntimeExports.jsx("h1", { children: n("please_select_a_block_to_ask_ai") })
7444
- ] }) });
7441
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "my-2 flex items-center gap-2", children: [
7442
+ a ? null : /* @__PURE__ */ jsxRuntimeExports.jsx(
7443
+ Button$1,
7444
+ {
7445
+ disabled: l.trim().length < 5 || a,
7446
+ onClick: () => o("content", r, l, m),
7447
+ variant: "default",
7448
+ className: "w-fit",
7449
+ size: "sm",
7450
+ children: a ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
7451
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Loader$1, { className: "h-5 w-5 animate-spin" }),
7452
+ n("generating_please_wait")
7453
+ ] }) : n("edit_with_ai")
7454
+ }
7455
+ ),
7456
+ a ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col gap-2", children: [
7457
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(Skeleton, { className: "flex w-full items-center space-x-1 px-4 py-1 pl-2", children: [
7458
+ /* @__PURE__ */ jsxRuntimeExports.jsx(FaSpinner, { className: "h-4 w-4 animate-spin text-gray-500" }),
7459
+ /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs", children: n("generating_please_wait") })
7460
+ ] }),
7461
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Button$1, { variant: "destructive", onClick: () => stop(), className: "hidden w-fit", size: "sm", children: n("Stop") })
7462
+ ] }) : null
7463
+ ] }),
7464
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "max-w-full", children: i && /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "break-words rounded border border-red-500 bg-red-100 p-1 text-xs text-red-500", children: i.message }) }),
7465
+ /* @__PURE__ */ jsxRuntimeExports.jsx(QuickPrompts, { onClick: (g) => o("content", r, g, m) })
7466
+ ] }) : u ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-4 text-center", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-4 rounded-xl p-4", children: [
7467
+ /* @__PURE__ */ jsxRuntimeExports.jsx(SparklesIcon, { className: "mx-auto text-3xl" }),
7468
+ /* @__PURE__ */ jsxRuntimeExports.jsx("h1", { children: n("please_select_a_block_to_ask_ai") })
7469
+ ] }) }) : null
7470
+ ] });
7445
7471
  }, AISetContext = () => {
7446
- const { t: r } = useTranslation(), n = useBuilderProp("aiContext", ""), [o, a] = useState$1(n), i = useRef$1(null), l = useBuilderProp("saveAiContextCallback", noop$1), [c, u] = useState$1(!1), [d, p] = useState$1(null), [m, g] = useState$1(!1), { toast: h } = useToast(), b = useRef$1(null);
7472
+ const { t: r } = useTranslation(), n = useBuilderProp("aiContext", ""), [o, a] = useState$1(n), i = useRef$1(null), l = useBuilderProp("saveAiContextCallback", noop$1), [c, u] = useState$1(!1), [d, p] = useState$1(null), [, m] = useState$1(!1), { toast: g } = useToast(), h = useRef$1(null);
7447
7473
  useEffect$1(() => {
7448
7474
  n && a(n);
7449
7475
  }, [n]);
7450
- const x = async () => {
7476
+ const b = async () => {
7451
7477
  try {
7452
- u(!0), p(null), await l(o), h({
7478
+ u(!0), p(null), await l(o), g({
7453
7479
  title: r("ai_context_updated"),
7454
7480
  description: r("you_can_now_ask_ai_to_edit_your_content"),
7455
7481
  variant: "default"
7456
- }), b.current.click();
7457
- } catch (v) {
7458
- p(v);
7482
+ }), h.current.click();
7483
+ } catch (x) {
7484
+ p(x);
7459
7485
  } finally {
7460
7486
  u(!1);
7461
7487
  }
@@ -7463,33 +7489,25 @@ const AIUserPrompt = ({ blockId: r }) => {
7463
7489
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
7464
7490
  Accordion,
7465
7491
  {
7466
- onValueChange: (v) => {
7467
- g(v !== "");
7492
+ onValueChange: (x) => {
7493
+ m(x !== "");
7468
7494
  },
7469
7495
  type: "single",
7470
7496
  collapsible: !0,
7471
- className: "rounded-md border bg-gray-100 px-2",
7472
- children: /* @__PURE__ */ jsxRuntimeExports.jsxs(AccordionItem, { value: "set-context", children: [
7473
- /* @__PURE__ */ jsxRuntimeExports.jsx(AccordionTrigger, { ref: b, hideArrow: !0, className: "py-1 hover:no-underline", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex w-full items-center justify-between", children: [
7474
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "font-semibold", children: r("ai_context") }),
7475
- /* @__PURE__ */ jsxRuntimeExports.jsxs(Button$1, { variant: "default", size: "sm", children: [
7476
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: r(m ? "cancel" : "edit") }),
7477
- "  ",
7478
- m ? /* @__PURE__ */ jsxRuntimeExports.jsx(Cross2Icon, { className: "h-4 w-4" }) : /* @__PURE__ */ jsxRuntimeExports.jsx(EditIcon, { className: "h-4 w-4" })
7479
- ] })
7480
- ] }) }),
7497
+ children: /* @__PURE__ */ jsxRuntimeExports.jsxs(AccordionItem, { value: "set-context", className: "border-none", children: [
7498
+ /* @__PURE__ */ jsxRuntimeExports.jsx(AccordionTrigger, { ref: h, className: "border-b py-2 text-gray-600 hover:no-underline", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex w-full items-center justify-between", children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "font-bold", children: r("ai_context") }) }) }),
7481
7499
  /* @__PURE__ */ jsxRuntimeExports.jsxs(AccordionContent, { children: [
7482
7500
  /* @__PURE__ */ jsxRuntimeExports.jsx(
7483
7501
  Textarea,
7484
7502
  {
7485
7503
  ref: i,
7486
7504
  value: o,
7487
- onChange: (v) => a(v.target.value),
7505
+ onChange: (x) => a(x.target.value),
7488
7506
  placeholder: r("tell_about_this_page_eg_this_page_is_about"),
7489
7507
  className: "w-full border border-gray-400 bg-background focus:border",
7490
7508
  rows: 10,
7491
- onKeyDown: (v) => {
7492
- v.key === "Enter" && (v.preventDefault(), x());
7509
+ onKeyDown: (x) => {
7510
+ x.key === "Enter" && (x.preventDefault(), b());
7493
7511
  }
7494
7512
  }
7495
7513
  ),
@@ -7501,7 +7519,7 @@ const AIUserPrompt = ({ blockId: r }) => {
7501
7519
  Button$1,
7502
7520
  {
7503
7521
  disabled: o.trim().length < 5,
7504
- onClick: () => x(),
7522
+ onClick: () => b(),
7505
7523
  variant: "default",
7506
7524
  className: "w-fit",
7507
7525
  size: "sm",
@@ -7518,7 +7536,10 @@ const AIUserPrompt = ({ blockId: r }) => {
7518
7536
  ] }) : r("delete") }) }),
7519
7537
  /* @__PURE__ */ jsxRuntimeExports.jsxs(AlertDialogContent, { children: [
7520
7538
  /* @__PURE__ */ jsxRuntimeExports.jsxs(AlertDialogHeader, { children: [
7521
- /* @__PURE__ */ jsxRuntimeExports.jsx(AlertDialogTitle, { children: r("remove_context?") }),
7539
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(AlertDialogTitle, { children: [
7540
+ r("remove_context"),
7541
+ " ?"
7542
+ ] }),
7522
7543
  /* @__PURE__ */ jsxRuntimeExports.jsx(AlertDialogDescription, {})
7523
7544
  ] }),
7524
7545
  /* @__PURE__ */ jsxRuntimeExports.jsxs(AlertDialogFooter, { children: [
@@ -7527,9 +7548,9 @@ const AIUserPrompt = ({ blockId: r }) => {
7527
7548
  AlertDialogAction,
7528
7549
  {
7529
7550
  onClick: () => {
7530
- a(""), x();
7551
+ a(""), b();
7531
7552
  },
7532
- children: "Yes, Delete"
7553
+ children: r("yes_delete")
7533
7554
  }
7534
7555
  )
7535
7556
  ] })
@@ -7543,7 +7564,7 @@ const AIUserPrompt = ({ blockId: r }) => {
7543
7564
  );
7544
7565
  }, AskAI = () => {
7545
7566
  const [r] = useSelectedBlockIds();
7546
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "absolute inset-0 z-50 h-full w-full bg-background p-2", children: [
7567
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-2", children: [
7547
7568
  /* @__PURE__ */ jsxRuntimeExports.jsx(AISetContext, {}),
7548
7569
  /* @__PURE__ */ jsxRuntimeExports.jsx(AIUserPrompt, { blockId: first(r) })
7549
7570
  ] });
@@ -33642,31 +33663,7 @@ const FEATURE_TOGGLES = {
33642
33663
  const i = first(r);
33643
33664
  isString$1(i) && (a = [i, ...getParentNodeIds(n, i)]), o(a);
33644
33665
  }, [r, n, o]);
33645
- }, SettingsPanel = () => {
33646
- const r = useSelectedBlock(), { t: n } = useTranslation(), [o, a] = useState$1(!0);
33647
- return isNull(r) ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-4 text-center", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-4 rounded-xl p-4", children: [
33648
- /* @__PURE__ */ jsxRuntimeExports.jsx(MixerHorizontalIcon, { className: "mx-auto text-3xl" }),
33649
- /* @__PURE__ */ jsxRuntimeExports.jsx("h1", { children: n("please_select_a_block_to_ask_ai") })
33650
- ] }) }) : /* @__PURE__ */ jsxRuntimeExports.jsx(ErrorBoundary$2, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "relative flex w-full flex-col px-2 pr-4", children: [
33651
- /* @__PURE__ */ jsxRuntimeExports.jsx(BlockSettings, {}),
33652
- /* @__PURE__ */ jsxRuntimeExports.jsx(BlockStyling, {}),
33653
- /* @__PURE__ */ jsxRuntimeExports.jsxs(
33654
- "div",
33655
- {
33656
- onClick: () => a(!o),
33657
- className: "flex cursor-default items-center justify-between border-b border-gray-300 py-2 text-sm font-bold hover:bg-gray-50",
33658
- children: [
33659
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: n("Attributes") }),
33660
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronDown, { className: "h-4 w-4 text-gray-500 " + (o ? "rotate-180" : "") }) })
33661
- ]
33662
- }
33663
- ),
33664
- o && /* @__PURE__ */ jsxRuntimeExports.jsx(BlockAttributesEditor, {}),
33665
- /* @__PURE__ */ jsxRuntimeExports.jsx("br", {}),
33666
- /* @__PURE__ */ jsxRuntimeExports.jsx("br", {}),
33667
- /* @__PURE__ */ jsxRuntimeExports.jsx("br", {})
33668
- ] }) });
33669
- }, SettingsPanel$1 = SettingsPanel, UndoRedo = () => {
33666
+ }, UndoRedo = () => {
33670
33667
  const { hasUndo: r, hasRedo: n, undo: o, redo: a } = useUndoManager();
33671
33668
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center", children: [
33672
33669
  /* @__PURE__ */ jsxRuntimeExports.jsx(Button$1, { disabled: !r(), size: "sm", onClick: o, className: "rounded-full", variant: "ghost", children: /* @__PURE__ */ jsxRuntimeExports.jsx(ResetIcon, {}) }),
@@ -33827,25 +33824,6 @@ const TabletIcon = ({ landscape: r = !1 }) => /* @__PURE__ */ jsxRuntimeExports.
33827
33824
  ] })
33828
33825
  ] })
33829
33826
  ] }) });
33830
- }, AiAssistant = () => {
33831
- const [r, n] = useAtom$1(aiAssistantActiveAtom), o = useBuilderProp("askAiCallBack", null), { t: a } = useTranslation();
33832
- return o ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center space-x-2", children: [
33833
- /* @__PURE__ */ jsxRuntimeExports.jsxs(Label, { htmlFor: "ai-assistant", className: "flex items-center gap-x-1 text-sm text-yellow-600", children: [
33834
- /* @__PURE__ */ jsxRuntimeExports.jsx(SparklesIcon, { className: "w-4" }),
33835
- a("ai_assistant")
33836
- ] }),
33837
- /* @__PURE__ */ jsxRuntimeExports.jsx(
33838
- Switch,
33839
- {
33840
- className: "scale-90",
33841
- checked: r,
33842
- onCheckedChange: (i) => {
33843
- n(i);
33844
- },
33845
- id: "ai-assitantt"
33846
- }
33847
- )
33848
- ] }) : null;
33849
33827
  }, CanvasTopBar = () => {
33850
33828
  const r = useBuilderProp("darkMode", !0), [n] = useCanvasZoom();
33851
33829
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex h-10 items-center justify-between border-b bg-background/70 px-2", children: [
@@ -33867,35 +33845,61 @@ const TabletIcon = ({ landscape: r = !1 }) => /* @__PURE__ */ jsxRuntimeExports.
33867
33845
  /* @__PURE__ */ jsxRuntimeExports.jsx(Separator, { orientation: "vertical" }),
33868
33846
  /* @__PURE__ */ jsxRuntimeExports.jsx(UndoRedo, {})
33869
33847
  ] }),
33870
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex h-full items-center space-x-2", children: [
33871
- /* @__PURE__ */ jsxRuntimeExports.jsx(ClearCanvas, {}),
33872
- /* @__PURE__ */ jsxRuntimeExports.jsx(Separator, { orientation: "vertical" }),
33873
- /* @__PURE__ */ jsxRuntimeExports.jsx(AiAssistant, {})
33874
- ] })
33848
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex h-full items-center space-x-2", children: /* @__PURE__ */ jsxRuntimeExports.jsx(ClearCanvas, {}) })
33875
33849
  ] });
33876
33850
  }, AddBlocksDialog = () => {
33877
33851
  const { t: r } = useTranslation(), [n, o] = useAddBlocksModal();
33878
- return /* @__PURE__ */ jsxRuntimeExports.jsx(AlertDialog, { open: !isEmpty$1(n), onOpenChange: () => n ? o("") : "", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(AlertDialogContent, { className: "max-h-[80vh] max-w-5xl overflow-hidden", children: [
33852
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(AlertDialog, { open: !isEmpty(n), onOpenChange: () => n ? o("") : "", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(AlertDialogContent, { className: "max-h-[80vh] max-w-5xl overflow-hidden", children: [
33879
33853
  /* @__PURE__ */ jsxRuntimeExports.jsx(AlertDialogHeader, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(AlertDialogTitle, { children: r("add_block") }) }),
33880
33854
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "no-scrollbar h-[500px] max-h-full overflow-hidden", children: /* @__PURE__ */ jsxRuntimeExports.jsx(AddBlocksPanel$1, { showHeading: !1 }) }),
33881
33855
  /* @__PURE__ */ jsxRuntimeExports.jsx(AlertDialogFooter, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(AlertDialogCancel, { children: r("Close") }) })
33882
33856
  ] }) });
33883
- }, TopBar = lazy(() => import("./Topbar-0kMZdGSR.js")), menuItems = [
33884
- { icon: /* @__PURE__ */ jsxRuntimeExports.jsx(Layers, { size: 20 }), label: "Outline", component: Outline$1 },
33885
- { icon: /* @__PURE__ */ jsxRuntimeExports.jsx(PaintBucketIcon, { size: 20 }), label: "Theme", component: () => /* @__PURE__ */ jsxRuntimeExports.jsx(ThemeOptions, { showHeading: !1 }) }
33857
+ }, SettingsPanel = () => {
33858
+ const r = useSelectedBlock(), { t: n } = useTranslation(), [o, a] = useState$1(!0);
33859
+ return isNull(r) ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-4 text-center", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-4 rounded-xl p-4", children: [
33860
+ /* @__PURE__ */ jsxRuntimeExports.jsx(MixerHorizontalIcon, { className: "mx-auto text-3xl" }),
33861
+ /* @__PURE__ */ jsxRuntimeExports.jsx("h1", { children: n("please_select_a_block_to_edit") })
33862
+ ] }) }) : /* @__PURE__ */ jsxRuntimeExports.jsx(ErrorBoundary$2, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "relative flex w-full flex-col", children: [
33863
+ /* @__PURE__ */ jsxRuntimeExports.jsx(BlockSettings, {}),
33864
+ /* @__PURE__ */ jsxRuntimeExports.jsx(BlockStyling, {}),
33865
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
33866
+ "div",
33867
+ {
33868
+ onClick: () => a(!o),
33869
+ className: "flex cursor-default items-center justify-between border-b border-gray-300 py-2 text-sm font-bold hover:bg-gray-50",
33870
+ children: [
33871
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: n("Attributes") }),
33872
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronDown, { className: "h-4 w-4 text-gray-500 " + (o ? "rotate-180" : "") }) })
33873
+ ]
33874
+ }
33875
+ ),
33876
+ o && /* @__PURE__ */ jsxRuntimeExports.jsx(BlockAttributesEditor, {}),
33877
+ /* @__PURE__ */ jsxRuntimeExports.jsx("br", {}),
33878
+ /* @__PURE__ */ jsxRuntimeExports.jsx("br", {}),
33879
+ /* @__PURE__ */ jsxRuntimeExports.jsx("br", {})
33880
+ ] }) });
33881
+ }, SettingsPanel$1 = SettingsPanel, TopBar = lazy(() => import("./Topbar-AxOo012V.js")), menuItems = [
33882
+ { icon: /* @__PURE__ */ jsxRuntimeExports.jsx(Layers, { size: 20 }), label: "sidebar.outline", component: Outline$1 },
33883
+ { icon: /* @__PURE__ */ jsxRuntimeExports.jsx(EditIcon, { size: 16 }), label: "sidebar.edit_block", component: SettingsPanel$1 },
33884
+ { icon: /* @__PURE__ */ jsxRuntimeExports.jsx(LightningBoltIcon, { className: "size-5" }), label: "sidebar.ai_assistant", component: AskAI },
33885
+ {
33886
+ icon: /* @__PURE__ */ jsxRuntimeExports.jsx(PaintBucketIcon, { size: 20 }),
33887
+ label: "sidebar.theme",
33888
+ component: () => /* @__PURE__ */ jsxRuntimeExports.jsx(ThemeOptions, { showHeading: !1 })
33889
+ }
33886
33890
  ], useAutoSave = () => {
33887
33891
  const { savePage: r } = useSavePage(), n = useBuilderProp("autoSaveSupport", !0), o = useBuilderProp("autoSaveInterval", 60);
33888
33892
  useIntervalEffect(() => {
33889
33893
  n && r();
33890
33894
  }, o * 1e3);
33891
33895
  }, RootLayout = () => {
33892
- const [r] = useAtom$1(aiAssistantActiveAtom), n = (c) => {
33893
- c.preventDefault();
33896
+ const r = useBuilderProp("sideBarComponents.top", []), n = (u) => {
33897
+ u.preventDefault();
33894
33898
  };
33895
33899
  useAtom$1(selectedLibraryAtom), useKeyEventWatcher(), useExpandTree(), useAutoSave();
33896
- const [o, a] = useState$1(0), i = (c) => {
33897
- a(o === c ? null : c);
33898
- }, { t: l } = useTranslation();
33900
+ const [o, a] = useState$1(0), i = (u) => {
33901
+ a(o === u ? null : u);
33902
+ }, { t: l } = useTranslation(), c = [...menuItems, ...r];
33899
33903
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "h-screen w-screen bg-background text-foreground", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(TooltipProvider, { children: [
33900
33904
  /* @__PURE__ */ jsxRuntimeExports.jsxs(
33901
33905
  "div",
@@ -33905,36 +33909,35 @@ const TabletIcon = ({ landscape: r = !1 }) => /* @__PURE__ */ jsxRuntimeExports.
33905
33909
  children: [
33906
33910
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "h-14 w-screen shrink-0 border-b border-border", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Suspense, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(TopBar, {}) }) }),
33907
33911
  /* @__PURE__ */ jsxRuntimeExports.jsxs("main", { className: "relative flex h-full flex-1 flex-row", children: [
33908
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex w-12 flex-col items-center border-r py-2", children: menuItems.map((c, u) => /* @__PURE__ */ jsxRuntimeExports.jsx(
33912
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex w-12 flex-col items-center border-r py-2", children: c.map((u, d) => /* @__PURE__ */ jsxRuntimeExports.jsx(
33909
33913
  "button",
33910
33914
  {
33911
- className: `mb-4 rounded-lg p-2 text-gray-500 transition-colors ${o === u ? "bg-primary text-white" : "hover:bg-primary hover:text-white"}`,
33912
- onClick: () => i(u),
33913
- children: c.icon
33915
+ className: `mb-2 rounded-lg p-2 text-gray-500 transition-colors ${o === d ? "bg-primary text-white" : "hover:bg-primary hover:text-white"}`,
33916
+ onClick: () => i(d),
33917
+ children: u.icon
33914
33918
  },
33915
- u
33919
+ d
33916
33920
  )) }),
33917
33921
  /* @__PURE__ */ jsxRuntimeExports.jsx(
33918
33922
  motion.div,
33919
33923
  {
33920
33924
  className: "h-full max-h-full overflow-hidden border-r border-border",
33921
- initial: { width: 250 },
33922
- animate: { width: o !== null ? 250 : 0 },
33925
+ initial: { width: 280 },
33926
+ animate: { width: o !== null ? 280 : 0 },
33923
33927
  transition: { duration: 0.3, ease: "easeInOut" },
33924
- children: o !== null && /* @__PURE__ */ jsxRuntimeExports.jsx(ScrollArea$1, { className: "h-full", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col p-2", children: [
33925
- /* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "h-10 text-base font-bold", children: l(menuItems[o].label) }),
33926
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex-1", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Suspense, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading..." }), children: React__default.createElement(menuItems[o].component, {}) }) })
33928
+ children: o !== null && /* @__PURE__ */ jsxRuntimeExports.jsx(ScrollArea$1, { className: "no-scrollbar h-full", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col p-2", children: [
33929
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("h2", { className: "-mt-1 flex h-10 items-center space-x-1 text-base font-bold", children: [
33930
+ c[o].icon,
33931
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: l(c[o].label) })
33932
+ ] }),
33933
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex-1 pr-2", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Suspense, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading..." }), children: React__default.createElement(c[o].component, {}) }) })
33927
33934
  ] }) })
33928
33935
  }
33929
33936
  ),
33930
33937
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "h-full flex-1 bg-slate-800/20", children: [
33931
33938
  /* @__PURE__ */ jsxRuntimeExports.jsx(CanvasTopBar, {}),
33932
33939
  /* @__PURE__ */ jsxRuntimeExports.jsx(Suspense, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(CanvasArea$1, {}) })
33933
- ] }),
33934
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "relative flex h-[100%] w-[280px] min-w-[280px] border-l border-border pb-10", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(ScrollArea$1, { className: "h-full w-full overflow-y-auto", children: [
33935
- /* @__PURE__ */ jsxRuntimeExports.jsx(Suspense, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(SettingsPanel$1, {}) }),
33936
- r ? /* @__PURE__ */ jsxRuntimeExports.jsx(AskAI, {}) : null
33937
- ] }) })
33940
+ ] })
33938
33941
  ] })
33939
33942
  ]
33940
33943
  }
@@ -33980,7 +33983,7 @@ const TabletIcon = ({ landscape: r = !1 }) => /* @__PURE__ */ jsxRuntimeExports.
33980
33983
  }, [r.locale]), useEffect$1(() => {
33981
33984
  setDebugLogs(r.showDebugLogs);
33982
33985
  }, [r.showDebugLogs]), useEffect$1(() => {
33983
- r.translations && each$1(r.translations, (c, u) => {
33986
+ r.translations && each(r.translations, (c, u) => {
33984
33987
  i18n.addResourceBundle(u, "translation", c, !0, !0);
33985
33988
  });
33986
33989
  }, [r.translations]), useEffect$1(() => {
@@ -33999,62 +34002,63 @@ const TabletIcon = ({ landscape: r = !1 }) => /* @__PURE__ */ jsxRuntimeExports.
33999
34002
  ] }) });
34000
34003
  };
34001
34004
  export {
34002
- useAllBlocks as $,
34005
+ useSelectedBlocksDisplayChild as $,
34003
34006
  AddBlocksPanel$1 as A,
34004
34007
  BlockSettings as B,
34005
- CanvasArea$1 as C,
34008
+ ChaiSelect$1 as C,
34006
34009
  DarkMode as D,
34007
- useCurrentPage as E,
34010
+ useCopyToClipboard as E,
34008
34011
  FaCheck as F,
34009
- useCutBlockIds as G,
34010
- useDarkMode as H,
34012
+ useCurrentPage as G,
34013
+ useCutBlockIds as H,
34011
34014
  ImportHTML$1 as I,
34012
- useDuplicateBlocks as J,
34013
- useGetPageData as K,
34014
- useHiddenBlockIds as L,
34015
- useHighlightBlockId as M,
34016
- usePasteBlocks as N,
34015
+ useDarkMode as J,
34016
+ useDuplicateBlocks as K,
34017
+ useGetPageData as L,
34018
+ useHiddenBlockIds as M,
34019
+ useHighlightBlockId as N,
34017
34020
  Outline$1 as O,
34018
- useBrandingOptions as P,
34019
- useRemoveBlocks as Q,
34020
- useRemoveClassesFromBlocks as R,
34021
- useSelectedBlockCurrentClasses as S,
34021
+ usePasteBlocks as P,
34022
+ useBrandingOptions as Q,
34023
+ useRemoveBlocks as R,
34024
+ useRemoveClassesFromBlocks as S,
34022
34025
  ThemeOptions as T,
34023
34026
  UILibraries as U,
34024
- useSelectedBlockAllClasses as V,
34025
- useSelectedBlock as W,
34026
- useStylingBreakpoint as X,
34027
- useUILibraryBlocks as Y,
34028
- useStylingState as Z,
34029
- useSelectedBlocksDisplayChild as _,
34027
+ useSelectedBlockCurrentClasses as V,
34028
+ useSelectedBlockAllClasses as W,
34029
+ useSelectedBlock as X,
34030
+ useStylingBreakpoint as Y,
34031
+ useUILibraryBlocks as Z,
34032
+ useStylingState as _,
34030
34033
  useSelectedBlockIds as a,
34031
- useActivePanel as a0,
34032
- useAddBlockParent as a1,
34033
- useSelectedBreakpoints as a2,
34034
- useSelectedStylingBlocks as a3,
34034
+ useAllBlocks as a0,
34035
+ useActivePanel as a1,
34036
+ useAddBlockParent as a2,
34037
+ useSelectedBreakpoints as a3,
34038
+ useSelectedStylingBlocks as a4,
34035
34039
  useUpdateBlocksProps as b,
34036
34040
  useUpdateBlocksPropsRealtime as c,
34037
34041
  useBuilderProp as d,
34038
34042
  useSavePage as e,
34039
34043
  usePreviewMode as f,
34040
- BlockStyling as g,
34041
- AISetContext as h,
34042
- AIUserPrompt as i,
34043
- BlockAttributesEditor as j,
34044
- ChaiBuilderEditor as k,
34045
- Breakpoints as l,
34046
- UndoRedo as m,
34047
- getBlocksFromHTML as n,
34048
- useBlocksStore as o,
34049
- useUndoManager as p,
34050
- useBuilderReset as q,
34051
- useReadOnlyMode as r,
34052
- useActiveModal as s,
34053
- useAddBlock as t,
34044
+ CanvasArea$1 as g,
34045
+ BlockStyling as h,
34046
+ AISetContext as i,
34047
+ AIUserPrompt as j,
34048
+ BlockAttributesEditor as k,
34049
+ ChaiBuilderEditor as l,
34050
+ Breakpoints as m,
34051
+ UndoRedo as n,
34052
+ getBlocksFromHTML as o,
34053
+ useBlocksStore as p,
34054
+ useUndoManager as q,
34055
+ useBuilderReset as r,
34056
+ useReadOnlyMode as s,
34057
+ useActiveModal as t,
34054
34058
  useCodeEditor as u,
34055
- useAddClassesToBlocks as v,
34056
- useCanvasWidth as w,
34057
- useCanvasZoom as x,
34058
- useCopyBlockIds as y,
34059
- useCopyToClipboard as z
34059
+ useAddBlock as v,
34060
+ useAddClassesToBlocks as w,
34061
+ useCanvasWidth as x,
34062
+ useCanvasZoom as y,
34063
+ useCopyBlockIds as z
34060
34064
  };