tinacms 0.0.0-9e8bc37-20251110225750 → 0.0.0-9fb1402-20251124051232

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -39,12 +39,16 @@ import arrayMutators from "final-form-arrays";
39
39
  import setFieldData from "final-form-set-field-data";
40
40
  import { Field, Form as Form$1 } from "react-final-form";
41
41
  import PropTypes from "prop-types";
42
+ import { twMerge } from "tailwind-merge";
43
+ import { useSensors, useSensor, PointerSensor, KeyboardSensor, DndContext, closestCenter } from "@dnd-kit/core";
44
+ import { sortableKeyboardCoordinates, useSortable, SortableContext, verticalListSortingStrategy, defaultAnimateLayoutChanges } from "@dnd-kit/sortable";
45
+ import { CSS } from "@dnd-kit/utilities";
42
46
  import * as pkg$1 from "react-color";
43
47
  import * as pkg from "color-string";
44
- import { twMerge } from "tailwind-merge";
45
- import { Droppable, Draggable, DragDropContext } from "react-beautiful-dnd";
46
48
  import { buildSchema, print, getIntrospectionQuery, buildClientSchema, parse as parse$4 } from "graphql";
47
49
  import { diff as diff$1 } from "@graphql-inspector/core";
50
+ import * as dropzone from "react-dropzone";
51
+ import { Command as Command$3 } from "@udecode/cmdk";
48
52
  import { Popover as Popover$3, PopoverButton, Transition, PopoverPanel, TransitionChild, Disclosure, DisclosureButton, DisclosurePanel, Menu, MenuButton, MenuItems, MenuItem } from "@headlessui/react";
49
53
  import { TrailingBlockPlugin } from "@udecode/plate-trailing-block";
50
54
  import { getRangeBoundingClientRect, getDOMSelectionBoundingClientRect, useVirtualFloating, offset, flip, getSelectionBoundingClientRect } from "@udecode/plate-floating";
@@ -52,16 +56,14 @@ import { BaseBlockquotePlugin as BaseBlockquotePlugin$1 } from "@udecode/plate-b
52
56
  import { NodeIdPlugin } from "@udecode/plate-node-id";
53
57
  import { getLinkAttributes as getLinkAttributes$1 } from "@udecode/plate-link";
54
58
  import { autoformatSmartQuotes, autoformatPunctuation, autoformatLegal, autoformatArrow, autoformatMath } from "@udecode/plate-autoformat";
55
- import { formatDistanceToNow as formatDistanceToNow$1 } from "date-fns";
56
- import * as dropzone from "react-dropzone";
57
- import { Command as Command$3 } from "@udecode/cmdk";
58
59
  import get$5 from "lodash.get";
59
60
  import moment from "moment";
61
+ import { formatDistanceToNow as formatDistanceToNow$1 } from "date-fns";
60
62
  import { TinaSchema, addNamespaceToSchema, parseURL, resolveForm, normalizePath, canonicalPath, validateSchema } from "@tinacms/schema-tools";
61
63
  import { NAMER, resolveField } from "@tinacms/schema-tools";
62
64
  import gql from "graphql-tag";
63
65
  import * as yup from "yup";
64
- import { NavLink, useLocation, useNavigate, useParams, Link as Link$1, HashRouter, Routes, Route } from "react-router-dom";
66
+ import { useLocation, NavLink, useNavigate, useParams, Link as Link$1, HashRouter, Routes, Route } from "react-router-dom";
65
67
  import { serializeMDX } from "@tinacms/mdx";
66
68
  const ModalProvider = ({ children }) => {
67
69
  const [modalRootContainerRef, setModalRootContainerRef] = useState(
@@ -38335,6 +38337,171 @@ TinaField.propTypes = {
38335
38337
  Component: PropTypes.any.isRequired,
38336
38338
  children: PropTypes.any
38337
38339
  };
38340
+ function cn$1(...inputs) {
38341
+ return twMerge(clsx(inputs));
38342
+ }
38343
+ const Button$1 = ({
38344
+ variant = "secondary",
38345
+ as: Tag2 = "button",
38346
+ size: size2 = "medium",
38347
+ busy,
38348
+ disabled,
38349
+ rounded = "full",
38350
+ children,
38351
+ className = "",
38352
+ ...props
38353
+ }) => {
38354
+ const baseClasses = "icon-parent inline-flex items-center font-medium focus:outline-none focus:ring-2 focus:shadow-outline text-center inline-flex justify-center transition-all duration-150 ease-out ";
38355
+ const variantClasses = {
38356
+ primary: `shadow text-white bg-tina-orange-dark hover:bg-tina-orange focus:ring-tina-orange-dark border-0`,
38357
+ secondary: `shadow text-gray-500 hover:tina-orange-dark bg-gray-50 hover:bg-white border border-gray-100`,
38358
+ white: `shadow text-gray-500 hover:tina-orange-dark bg-white hover:bg-gray-50 border border-gray-100`,
38359
+ ghost: `text-gray-500 hover:tina-orange-dark hover:shadow border border-transparent border-0 hover:border hover:border-gray-200 bg-transparent`,
38360
+ danger: `shadow text-white bg-red-500 hover:bg-red-600 focus:ring-red-500`,
38361
+ accent: `shadow text-white bg-orange-500 hover:bg-orange-600 focus:ring-orange-500`,
38362
+ custom: ""
38363
+ };
38364
+ const state = busy ? `busy` : disabled ? `disabled` : `default`;
38365
+ const stateClasses = {
38366
+ disabled: `pointer-events-none opacity-30 cursor-not-allowed`,
38367
+ busy: `pointer-events-none opacity-70 cursor-wait`,
38368
+ default: ``
38369
+ };
38370
+ const roundedClasses = {
38371
+ full: `rounded`,
38372
+ left: `rounded-l`,
38373
+ right: `rounded-r`,
38374
+ custom: "",
38375
+ none: ""
38376
+ };
38377
+ const sizeClasses = {
38378
+ small: `text-xs h-8 px-3`,
38379
+ medium: `text-sm h-10 px-8`,
38380
+ custom: ``
38381
+ };
38382
+ return /* @__PURE__ */ React.createElement(
38383
+ Tag2,
38384
+ {
38385
+ className: cn$1(
38386
+ baseClasses,
38387
+ variantClasses[variant],
38388
+ sizeClasses[size2],
38389
+ stateClasses[state],
38390
+ roundedClasses[rounded],
38391
+ className
38392
+ ),
38393
+ ...props
38394
+ },
38395
+ children
38396
+ );
38397
+ };
38398
+ const IconButton = ({
38399
+ variant = "secondary",
38400
+ size: size2 = "medium",
38401
+ busy,
38402
+ disabled,
38403
+ children,
38404
+ className,
38405
+ ...props
38406
+ }) => {
38407
+ const baseClasses = "icon-parent inline-flex items-center border border-transparent text-sm font-medium focus:outline-none focus:ring-2 focus:shadow-outline text-center inline-flex justify-center transition-all duration-150 ease-out rounded-full";
38408
+ const variantClasses = {
38409
+ primary: `shadow text-white bg-tina-orange-dark hover:bg-tina-orange focus:ring-tina-orange-dark`,
38410
+ secondary: `shadow text-gray-500 hover:text-blue-500 bg-gray-50 hover:bg-white border border-gray-200`,
38411
+ white: `shadow text-gray-500 hover:text-blue-500 bg-white hover:bg-gray-50 border border-gray-200`,
38412
+ ghost: `text-gray-500 hover:text-blue-500 hover:shadow border border-transparent hover:border-gray-200 bg-transparent`,
38413
+ accent: `shadow text-white bg-orange-500 hover:bg-orange-600 focus:ring-orange-500`
38414
+ };
38415
+ const state = busy ? `busy` : disabled ? `disabled` : `default`;
38416
+ const stateClasses = {
38417
+ disabled: `pointer-events-none opacity-30 cursor-not-allowed`,
38418
+ busy: `pointer-events-none opacity-70 cursor-wait`,
38419
+ default: ``
38420
+ };
38421
+ const sizeClasses = {
38422
+ small: `h-7 w-7`,
38423
+ medium: `h-9 w-9`,
38424
+ custom: ``
38425
+ };
38426
+ return /* @__PURE__ */ React.createElement(
38427
+ "button",
38428
+ {
38429
+ className: cn$1(
38430
+ baseClasses,
38431
+ variantClasses[variant],
38432
+ sizeClasses[size2],
38433
+ stateClasses[state],
38434
+ className
38435
+ ),
38436
+ ...props
38437
+ },
38438
+ children
38439
+ );
38440
+ };
38441
+ function FontLoader() {
38442
+ React.useEffect(() => {
38443
+ const link = document.createElement("link");
38444
+ link.href = "https://fonts.googleapis.com/css2?family=Inter:wght@400;600&family=Libre+Baskerville:wght@400;500;600;700&display=swap";
38445
+ link.rel = "stylesheet";
38446
+ document.head.appendChild(link);
38447
+ return () => {
38448
+ document.head.removeChild(link);
38449
+ };
38450
+ }, []);
38451
+ return null;
38452
+ }
38453
+ function classNames(...classes) {
38454
+ return classes.filter(Boolean).join(" ");
38455
+ }
38456
+ const OverflowMenu$1 = ({ toolbarItems: toolbarItems2, className = "w-full" }) => {
38457
+ const [open, setOpen] = useState(false);
38458
+ return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, toolbarItems2.length > 0 && /* @__PURE__ */ React__default.createElement(PopoverPrimitive.Root, { open, onOpenChange: setOpen }, /* @__PURE__ */ React__default.createElement(
38459
+ PopoverPrimitive.Trigger,
38460
+ {
38461
+ className: `cursor-pointer relative justify-center inline-flex items-center p-3 text-sm font-medium focus:outline-1 focus:outline-blue-200 pointer-events-auto ${open ? `text-blue-400` : `text-gray-300 hover:text-blue-500`} ${className}}`
38462
+ },
38463
+ /* @__PURE__ */ React__default.createElement(
38464
+ "svg",
38465
+ {
38466
+ xmlns: "http://www.w3.org/2000/svg",
38467
+ className: "h-5 w-5",
38468
+ fill: "none",
38469
+ viewBox: "0 0 24 24",
38470
+ stroke: "currentColor"
38471
+ },
38472
+ /* @__PURE__ */ React__default.createElement(
38473
+ "path",
38474
+ {
38475
+ strokeLinecap: "round",
38476
+ strokeLinejoin: "round",
38477
+ strokeWidth: 2,
38478
+ d: "M12 5v.01M12 12v.01M12 19v.01M12 6a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2z"
38479
+ }
38480
+ )
38481
+ )
38482
+ ), /* @__PURE__ */ React__default.createElement(PopoverPrimitive.Portal, null, /* @__PURE__ */ React__default.createElement(PopoverPrimitive.Content, { style: { zIndex: 2e4 }, align: "end" }, /* @__PURE__ */ React__default.createElement("div", { className: "mt-0 -mr-1 rounded shadow-lg bg-white ring-1 ring-black ring-opacity-5 py-1" }, toolbarItems2.map((toolbarItem) => {
38483
+ return /* @__PURE__ */ React__default.createElement(
38484
+ "span",
38485
+ {
38486
+ "data-test": `${toolbarItem.name}OverflowButton`,
38487
+ key: toolbarItem.name,
38488
+ onMouseDown: (event) => {
38489
+ event.preventDefault();
38490
+ toolbarItem.onMouseDown(event);
38491
+ setOpen(false);
38492
+ },
38493
+ className: classNames(
38494
+ toolbarItem.active ? "bg-gray-50 text-blue-500" : "bg-white text-gray-600",
38495
+ "hover:bg-gray-50 hover:text-blue-500 cursor-pointer pointer-events-auto px-4 py-2 text-sm w-full flex items-center whitespace-nowrap",
38496
+ toolbarItem.className ?? ""
38497
+ )
38498
+ },
38499
+ /* @__PURE__ */ React__default.createElement("div", { className: "mr-2 opacity-80" }, toolbarItem.Icon),
38500
+ " ",
38501
+ toolbarItem.label
38502
+ );
38503
+ }))))));
38504
+ };
38338
38505
  var DefaultContext = {
38339
38506
  color: void 0,
38340
38507
  size: void 0,
@@ -38576,30 +38743,392 @@ function BiTrash(props) {
38576
38743
  function BiX(props) {
38577
38744
  return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "d": "m16.192 6.344-4.243 4.242-4.242-4.242-1.414 1.414L10.535 12l-4.242 4.242 1.414 1.414 4.242-4.242 4.243 4.242 1.414-1.414L13.364 12l4.242-4.242z" }, "child": [] }] })(props);
38578
38745
  }
38579
- const textFieldClasses = "shadow-inner focus:shadow-outline focus:border-blue-500 focus:outline-none block text-base placeholder:text-gray-300 px-3 py-2 text-gray-600 w-full bg-white border border-gray-200 transition-all ease-out duration-150 focus:text-gray-900 rounded";
38580
- const disabledClasses$1 = "opacity-50 pointer-events-none cursor-not-allowed";
38581
- const BaseTextField = React.forwardRef(({ className, disabled, ...rest }, ref) => {
38746
+ function BsArrowRightShort(props) {
38747
+ return GenIcon({ "tag": "svg", "attr": { "fill": "currentColor", "viewBox": "0 0 16 16" }, "child": [{ "tag": "path", "attr": { "fillRule": "evenodd", "d": "M4 8a.5.5 0 0 1 .5-.5h5.793L8.146 5.354a.5.5 0 1 1 .708-.708l3 3a.5.5 0 0 1 0 .708l-3 3a.5.5 0 0 1-.708-.708L10.293 8.5H4.5A.5.5 0 0 1 4 8" }, "child": [] }] })(props);
38748
+ }
38749
+ function BsCheckCircleFill(props) {
38750
+ return GenIcon({ "tag": "svg", "attr": { "fill": "currentColor", "viewBox": "0 0 16 16" }, "child": [{ "tag": "path", "attr": { "d": "M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0m-3.97-3.03a.75.75 0 0 0-1.08.022L7.477 9.417 5.384 7.323a.75.75 0 0 0-1.06 1.06L6.97 11.03a.75.75 0 0 0 1.079-.02l3.992-4.99a.75.75 0 0 0-.01-1.05z" }, "child": [] }] })(props);
38751
+ }
38752
+ function BsExclamationOctagonFill(props) {
38753
+ return GenIcon({ "tag": "svg", "attr": { "fill": "currentColor", "viewBox": "0 0 16 16" }, "child": [{ "tag": "path", "attr": { "d": "M11.46.146A.5.5 0 0 0 11.107 0H4.893a.5.5 0 0 0-.353.146L.146 4.54A.5.5 0 0 0 0 4.893v6.214a.5.5 0 0 0 .146.353l4.394 4.394a.5.5 0 0 0 .353.146h6.214a.5.5 0 0 0 .353-.146l4.394-4.394a.5.5 0 0 0 .146-.353V4.893a.5.5 0 0 0-.146-.353zM8 4c.535 0 .954.462.9.995l-.35 3.507a.552.552 0 0 1-1.1 0L7.1 4.995A.905.905 0 0 1 8 4m.002 6a1 1 0 1 1 0 2 1 1 0 0 1 0-2" }, "child": [] }] })(props);
38754
+ }
38755
+ const MessageIcon = ({
38756
+ type = "success",
38757
+ className = ""
38758
+ }) => {
38759
+ const icons = {
38760
+ success: BiCheckCircle,
38761
+ warning: BiError,
38762
+ error: BiError,
38763
+ info: BiInfoCircle
38764
+ };
38765
+ const Icon = icons[type];
38766
+ return /* @__PURE__ */ React__default.createElement(Icon, { className });
38767
+ };
38768
+ const Message = ({
38769
+ children,
38770
+ type = "success",
38771
+ size: size2 = "medium",
38772
+ className = "",
38773
+ link,
38774
+ linkLabel = "Learn More"
38775
+ }) => {
38776
+ const containerClasses = {
38777
+ success: "bg-gradient-to-r from-green-50 to-green-100 border-green-200",
38778
+ warning: "bg-gradient-to-r from-yellow-50 to-yellow-100 border-yellow-200",
38779
+ error: "bg-gradient-to-r from-red-50 to-red-100 border-red-200",
38780
+ info: "bg-gradient-to-r from-blue-50 to-blue-100 border-blue-100"
38781
+ };
38782
+ const textClasses = {
38783
+ success: "text-green-700",
38784
+ warning: "text-yellow-700",
38785
+ error: "text-red-700",
38786
+ info: "text-blue-700"
38787
+ };
38788
+ const iconClasses = {
38789
+ success: "text-green-400",
38790
+ warning: "text-yellow-400",
38791
+ error: "text-red-400",
38792
+ info: "text-blue-400"
38793
+ };
38794
+ const sizeClasses = {
38795
+ small: "px-3 py-1.5 text-xs",
38796
+ medium: "px-4 py-2.5 text-sm"
38797
+ };
38798
+ return /* @__PURE__ */ React__default.createElement(
38799
+ "div",
38800
+ {
38801
+ className: `rounded-lg border shadow-sm ${sizeClasses[size2]} ${containerClasses[type]} ${className}`
38802
+ },
38803
+ /* @__PURE__ */ React__default.createElement("div", { className: "flex flex-col sm:flex-row items-start sm:items-center gap-2" }, /* @__PURE__ */ React__default.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ React__default.createElement(
38804
+ MessageIcon,
38805
+ {
38806
+ type,
38807
+ className: `${size2 === "small" ? "w-5" : "w-6"} h-auto flex-shrink-0 ${iconClasses[type]}`
38808
+ }
38809
+ ), /* @__PURE__ */ React__default.createElement("div", { className: `flex-1 ${textClasses[type]}` }, children)), link && /* @__PURE__ */ React__default.createElement(
38810
+ "a",
38811
+ {
38812
+ href: link,
38813
+ target: "_blank",
38814
+ className: "flex-shrink-0 flex items-center gap-1 text-blue-600 underline decoration-blue-200 hover:text-blue-500 hover:decoration-blue-500 transition-all ease-out duration-150"
38815
+ },
38816
+ linkLabel,
38817
+ " ",
38818
+ /* @__PURE__ */ React__default.createElement(BsArrowRightShort, { className: "w-4 h-auto" })
38819
+ ))
38820
+ );
38821
+ };
38822
+ function cn(...inputs) {
38823
+ return twMerge(clsx(inputs));
38824
+ }
38825
+ function DropdownMenu({
38826
+ ...props
38827
+ }) {
38828
+ return /* @__PURE__ */ React.createElement(DropdownMenuPrimitive.Root, { "data-slot": "dropdown-menu", ...props });
38829
+ }
38830
+ function DropdownMenuTrigger({
38831
+ ...props
38832
+ }) {
38582
38833
  return /* @__PURE__ */ React.createElement(
38583
- "input",
38834
+ DropdownMenuPrimitive.Trigger,
38584
38835
  {
38585
- ref,
38586
- type: "text",
38587
- className: `${textFieldClasses} ${disabled ? disabledClasses$1 : ""} ${className}`,
38588
- ...rest
38836
+ "data-slot": "dropdown-menu-trigger",
38837
+ ...props
38589
38838
  }
38590
38839
  );
38591
- });
38592
- const TextArea = React.forwardRef(({ ...props }, ref) => {
38840
+ }
38841
+ function DropdownMenuContent({
38842
+ className,
38843
+ sideOffset = 4,
38844
+ ...props
38845
+ }) {
38846
+ return /* @__PURE__ */ React.createElement(DropdownMenuPrimitive.Portal, null, /* @__PURE__ */ React.createElement(
38847
+ DropdownMenuPrimitive.Content,
38848
+ {
38849
+ "data-slot": "dropdown-menu-content",
38850
+ sideOffset,
38851
+ className: cn(
38852
+ "bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-base max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",
38853
+ className
38854
+ ),
38855
+ ...props
38856
+ }
38857
+ ));
38858
+ }
38859
+ function DropdownMenuItem({
38860
+ className,
38861
+ inset,
38862
+ variant = "default",
38863
+ ...props
38864
+ }) {
38593
38865
  return /* @__PURE__ */ React.createElement(
38594
- "textarea",
38866
+ DropdownMenuPrimitive.Item,
38595
38867
  {
38596
- ...props,
38597
- className: "shadow-inner text-base px-3 py-2 text-gray-600 resize-y focus:shadow-outline focus:border-blue-500 block w-full border border-gray-200 focus:text-gray-900 rounded",
38598
- ref,
38599
- style: { minHeight: "160px" }
38868
+ "data-slot": "dropdown-menu-item",
38869
+ "data-inset": inset,
38870
+ "data-variant": variant,
38871
+ className: cn(
38872
+ "focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 cursor-pointer text-gray-700 hover:text-blue-500",
38873
+ className
38874
+ ),
38875
+ ...props
38600
38876
  }
38601
38877
  );
38602
- });
38878
+ }
38879
+ function DropdownMenuSeparator({
38880
+ className,
38881
+ ...props
38882
+ }) {
38883
+ return /* @__PURE__ */ React.createElement(
38884
+ DropdownMenuPrimitive.Separator,
38885
+ {
38886
+ "data-slot": "dropdown-menu-separator",
38887
+ className: cn("bg-border -mx-1 my-1 h-px", className),
38888
+ ...props
38889
+ }
38890
+ );
38891
+ }
38892
+ const DropdownButton = React.forwardRef(
38893
+ ({
38894
+ variant = "primary",
38895
+ size: size2 = "medium",
38896
+ busy,
38897
+ disabled,
38898
+ rounded = "full",
38899
+ children,
38900
+ className = "",
38901
+ onMainAction,
38902
+ items: items2,
38903
+ showSplitButton = true,
38904
+ ...props
38905
+ }, ref) => {
38906
+ const [open, setOpen] = React.useState(false);
38907
+ if (!onMainAction || !showSplitButton) {
38908
+ return /* @__PURE__ */ React.createElement(DropdownMenu, { open, onOpenChange: setOpen, modal: false }, /* @__PURE__ */ React.createElement(DropdownMenuTrigger, { asChild: true }, /* @__PURE__ */ React.createElement(
38909
+ Button$1,
38910
+ {
38911
+ variant,
38912
+ size: size2,
38913
+ busy,
38914
+ disabled,
38915
+ rounded,
38916
+ className: cn$1("gap-2", className),
38917
+ ...props
38918
+ },
38919
+ children,
38920
+ /* @__PURE__ */ React.createElement(
38921
+ ChevronDownIcon$1,
38922
+ {
38923
+ className: cn$1(
38924
+ "h-4 w-4 transition-transform duration-200",
38925
+ open && "rotate-180"
38926
+ )
38927
+ }
38928
+ )
38929
+ )), /* @__PURE__ */ React.createElement(DropdownMenuContent, { align: "end", side: "bottom", className: "z-[100000]" }, items2.map((item, index) => /* @__PURE__ */ React.createElement(
38930
+ DropdownMenuItem,
38931
+ {
38932
+ key: index,
38933
+ onClick: item.onClick,
38934
+ disabled: item.disabled,
38935
+ variant: item.variant
38936
+ },
38937
+ item.icon && item.icon,
38938
+ item.label
38939
+ ))));
38940
+ }
38941
+ return /* @__PURE__ */ React.createElement("div", { className: cn$1("inline-flex", className) }, /* @__PURE__ */ React.createElement(
38942
+ Button$1,
38943
+ {
38944
+ variant,
38945
+ size: size2,
38946
+ busy,
38947
+ disabled,
38948
+ rounded: "left",
38949
+ onClick: onMainAction,
38950
+ className: "border-r-0 w-full",
38951
+ ...props
38952
+ },
38953
+ children
38954
+ ), /* @__PURE__ */ React.createElement(DropdownMenu, { open, onOpenChange: setOpen }, /* @__PURE__ */ React.createElement(DropdownMenuTrigger, null, /* @__PURE__ */ React.createElement(
38955
+ Button$1,
38956
+ {
38957
+ variant,
38958
+ size: size2,
38959
+ busy,
38960
+ disabled,
38961
+ rounded: "right",
38962
+ className: "px-4 border-l",
38963
+ style: { borderColor: "#00000030" },
38964
+ "aria-label": "More options"
38965
+ },
38966
+ /* @__PURE__ */ React.createElement(
38967
+ ChevronDownIcon$1,
38968
+ {
38969
+ className: cn$1(
38970
+ "h-4 w-4 transition-transform duration-200 fill-none",
38971
+ open && "rotate-180"
38972
+ ),
38973
+ style: { fill: "none" }
38974
+ }
38975
+ )
38976
+ )), /* @__PURE__ */ React.createElement(DropdownMenuContent, { align: "end", side: "bottom" }, items2.map((item, index) => {
38977
+ var _a2;
38978
+ return /* @__PURE__ */ React.createElement(React.Fragment, { key: index }, /* @__PURE__ */ React.createElement(
38979
+ DropdownMenuItem,
38980
+ {
38981
+ onClick: item.onClick,
38982
+ disabled: item.disabled,
38983
+ variant: item.variant
38984
+ },
38985
+ item.icon && item.icon,
38986
+ item.label
38987
+ ), item.variant === "destructive" && index < items2.length - 1 && ((_a2 = items2[index + 1]) == null ? void 0 : _a2.variant) !== "destructive" && /* @__PURE__ */ React.createElement(DropdownMenuSeparator, null));
38988
+ }))));
38989
+ }
38990
+ );
38991
+ DropdownButton.displayName = "DropdownButton";
38992
+ const DragDropContext = ({
38993
+ onDragEnd,
38994
+ children
38995
+ }) => {
38996
+ const sensors = useSensors(
38997
+ useSensor(PointerSensor, {
38998
+ activationConstraint: {
38999
+ delay: 100,
39000
+ tolerance: 5
39001
+ }
39002
+ }),
39003
+ useSensor(KeyboardSensor, {
39004
+ coordinateGetter: sortableKeyboardCoordinates
39005
+ })
39006
+ );
39007
+ const handleDragEnd = (event) => {
39008
+ const { active, over } = event;
39009
+ if (!over || active.id === over.id) {
39010
+ return;
39011
+ }
39012
+ const activeIdStr = String(active.id);
39013
+ const overIdStr = String(over.id);
39014
+ const activeFieldName = activeIdStr.substring(
39015
+ 0,
39016
+ activeIdStr.lastIndexOf(".")
39017
+ );
39018
+ const overFieldName = overIdStr.substring(0, overIdStr.lastIndexOf("."));
39019
+ const activeIndex = parseInt(
39020
+ activeIdStr.substring(activeIdStr.lastIndexOf(".") + 1)
39021
+ );
39022
+ const overIndex = parseInt(
39023
+ overIdStr.substring(overIdStr.lastIndexOf(".") + 1)
39024
+ );
39025
+ if (activeFieldName === overFieldName) {
39026
+ const result = {
39027
+ destination: {
39028
+ index: overIndex
39029
+ },
39030
+ source: {
39031
+ index: activeIndex
39032
+ },
39033
+ type: activeFieldName
39034
+ };
39035
+ onDragEnd(result);
39036
+ }
39037
+ };
39038
+ return /* @__PURE__ */ React__default.createElement(
39039
+ DndContext,
39040
+ {
39041
+ sensors,
39042
+ collisionDetection: closestCenter,
39043
+ onDragEnd: handleDragEnd
39044
+ },
39045
+ children
39046
+ );
39047
+ };
39048
+ const Droppable = ({
39049
+ droppableId,
39050
+ type,
39051
+ children
39052
+ }) => {
39053
+ const ref = React__default.useRef(null);
39054
+ return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, children({
39055
+ innerRef: ref,
39056
+ placeholder: null
39057
+ }));
39058
+ };
39059
+ const Draggable = ({
39060
+ draggableId,
39061
+ children
39062
+ }) => {
39063
+ const animateLayoutChanges = (args) => {
39064
+ const { isSorting, wasDragging } = args;
39065
+ if (wasDragging) {
39066
+ return false;
39067
+ }
39068
+ if (isSorting) {
39069
+ return defaultAnimateLayoutChanges(args);
39070
+ }
39071
+ return true;
39072
+ };
39073
+ const {
39074
+ attributes,
39075
+ listeners,
39076
+ setNodeRef,
39077
+ transform,
39078
+ transition,
39079
+ isDragging,
39080
+ setActivatorNodeRef
39081
+ } = useSortable({
39082
+ id: draggableId,
39083
+ animateLayoutChanges
39084
+ });
39085
+ const style = {
39086
+ transform: CSS.Transform.toString(transform),
39087
+ transition,
39088
+ ...isDragging && { zIndex: 9999 }
39089
+ };
39090
+ return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, children(
39091
+ {
39092
+ innerRef: { current: null },
39093
+ draggableProps: {
39094
+ ref: setNodeRef,
39095
+ style,
39096
+ ...attributes
39097
+ },
39098
+ dragHandleProps: {
39099
+ ref: setActivatorNodeRef,
39100
+ ...listeners
39101
+ }
39102
+ },
39103
+ {
39104
+ isDragging
39105
+ }
39106
+ ));
39107
+ };
39108
+ const SortableProvider = ({
39109
+ items: items2,
39110
+ children
39111
+ }) => {
39112
+ return /* @__PURE__ */ React__default.createElement(SortableContext, { items: items2, strategy: verticalListSortingStrategy }, children);
39113
+ };
39114
+ function FaCircle(props) {
39115
+ return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 512 512" }, "child": [{ "tag": "path", "attr": { "d": "M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8z" }, "child": [] }] })(props);
39116
+ }
39117
+ function FaFile(props) {
39118
+ return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 384 512" }, "child": [{ "tag": "path", "attr": { "d": "M224 136V0H24C10.7 0 0 10.7 0 24v464c0 13.3 10.7 24 24 24h336c13.3 0 24-10.7 24-24V160H248c-13.2 0-24-10.8-24-24zm160-14.1v6.1H256V0h6.1c6.4 0 12.5 2.5 17 7l97.9 98c4.5 4.5 7 10.6 7 16.9z" }, "child": [] }] })(props);
39119
+ }
39120
+ function FaFolder(props) {
39121
+ return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 512 512" }, "child": [{ "tag": "path", "attr": { "d": "M464 128H272l-64-64H48C21.49 64 0 85.49 0 112v288c0 26.51 21.49 48 48 48h416c26.51 0 48-21.49 48-48V176c0-26.51-21.49-48-48-48z" }, "child": [] }] })(props);
39122
+ }
39123
+ function FaLock(props) {
39124
+ return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 448 512" }, "child": [{ "tag": "path", "attr": { "d": "M400 224h-24v-72C376 68.2 307.8 0 224 0S72 68.2 72 152v72H48c-26.5 0-48 21.5-48 48v192c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V272c0-26.5-21.5-48-48-48zm-104 0H152v-72c0-39.7 32.3-72 72-72s72 32.3 72 72v72z" }, "child": [] }] })(props);
39125
+ }
39126
+ function FaSpinner(props) {
39127
+ return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 512 512" }, "child": [{ "tag": "path", "attr": { "d": "M304 48c0 26.51-21.49 48-48 48s-48-21.49-48-48 21.49-48 48-48 48 21.49 48 48zm-48 368c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.49-48-48-48zm208-208c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.49-48-48-48zM96 256c0-26.51-21.49-48-48-48S0 229.49 0 256s21.49 48 48 48 48-21.49 48-48zm12.922 99.078c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48c0-26.509-21.491-48-48-48zm294.156 0c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48c0-26.509-21.49-48-48-48zM108.922 60.922c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.491-48-48-48z" }, "child": [] }] })(props);
39128
+ }
39129
+ function FaUnlock(props) {
39130
+ return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 448 512" }, "child": [{ "tag": "path", "attr": { "d": "M400 256H152V152.9c0-39.6 31.7-72.5 71.3-72.9 40-.4 72.7 32.1 72.7 72v16c0 13.3 10.7 24 24 24h32c13.3 0 24-10.7 24-24v-16C376 68 307.5-.3 223.5 0 139.5.3 72 69.5 72 153.5V256H48c-26.5 0-48 21.5-48 48v160c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V304c0-26.5-21.5-48-48-48z" }, "child": [] }] })(props);
39131
+ }
38603
39132
  const Dismissible = ({
38604
39133
  onDismiss,
38605
39134
  escape: escape2,
@@ -38672,6 +39201,159 @@ function useDismissible({
38672
39201
  }, [click, customDocument, escape2, disabled, onDismiss]);
38673
39202
  return area;
38674
39203
  }
39204
+ const FormActionMenu = ({ actions, form }) => {
39205
+ const [actionMenuVisibility, setActionMenuVisibility] = useState(false);
39206
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(MoreActionsButton, { onClick: () => setActionMenuVisibility((p2) => !p2) }), /* @__PURE__ */ React.createElement(ActionsOverlay, { open: actionMenuVisibility }, /* @__PURE__ */ React.createElement(
39207
+ Dismissible,
39208
+ {
39209
+ click: true,
39210
+ escape: true,
39211
+ disabled: !actionMenuVisibility,
39212
+ onDismiss: () => {
39213
+ setActionMenuVisibility((p2) => !p2);
39214
+ }
39215
+ },
39216
+ actions.map((Action, i2) => (
39217
+ // TODO: `i` will suppress warnings but this indicates that maybe
39218
+ // Actions should just be componets
39219
+ /* @__PURE__ */ React.createElement(Action, { form, key: i2 })
39220
+ ))
39221
+ )));
39222
+ };
39223
+ const MoreActionsButton = ({ className = "", ...props }) => /* @__PURE__ */ React.createElement(
39224
+ "button",
39225
+ {
39226
+ className: `h-16 w-10 self-stretch bg-transparent bg-center bg-[length:auto_18px] -mr-4 ml-2 outline-none cursor-pointer transition-opacity duration-100 ease-out flex justify-center items-center hover:bg-gray-50 hover:fill-gray-700 ${className}`,
39227
+ ...props
39228
+ },
39229
+ /* @__PURE__ */ React.createElement(EllipsisVerticalIcon, null)
39230
+ );
39231
+ const ActionsOverlay = ({ open, className = "", style = {}, ...props }) => /* @__PURE__ */ React.createElement(
39232
+ "div",
39233
+ {
39234
+ className: `min-w-[192px] rounded-3xl border border-solid border-[#efefef] block absolute bottom-5 right-5 ${open ? "opacity-100" : "opacity-0"} transition-all duration-100 ease-out origin-bottom-right shadow-[0_2px_3px_rgba(0,0,0,0.05)] bg-white overflow-hidden z-10 ${className}`,
39235
+ style: {
39236
+ transform: open ? "translate3d(0, -28px, 0) scale3d(1, 1, 1)" : "translate3d(0, 0, 0) scale3d(0.5, 0.5, 1)",
39237
+ pointerEvents: open ? "all" : "none",
39238
+ ...style
39239
+ },
39240
+ ...props
39241
+ }
39242
+ );
39243
+ const ActionButton = ({ className = "", ...props }) => /* @__PURE__ */ React.createElement(
39244
+ "button",
39245
+ {
39246
+ className: `relative text-center text-[13px] px-3 h-10 font-normal w-full bg-none cursor-pointer outline-none border-0 transition-all duration-[150ms] ease-out hover:text-blue-500 hover:bg-gray50 [&:not(:last-child)]: border-b-[1px] border-solid border-b-[#edecf3] ${className}`,
39247
+ ...props
39248
+ }
39249
+ );
39250
+ const FormPortalContext = React.createContext(() => {
39251
+ return null;
39252
+ });
39253
+ function useFormPortal() {
39254
+ return React.useContext(FormPortalContext);
39255
+ }
39256
+ const FormPortalProvider = ({
39257
+ children
39258
+ }) => {
39259
+ const wrapperRef = React.useRef(null);
39260
+ const zIndexRef = React.useRef(0);
39261
+ const FormPortal = React.useCallback(
39262
+ (props) => {
39263
+ if (!wrapperRef.current)
39264
+ return null;
39265
+ return createPortal(
39266
+ props.children({ zIndexShift: zIndexRef.current += 1 }),
39267
+ wrapperRef.current
39268
+ );
39269
+ },
39270
+ [wrapperRef, zIndexRef]
39271
+ );
39272
+ return /* @__PURE__ */ React.createElement(FormPortalContext.Provider, { value: FormPortal }, /* @__PURE__ */ React.createElement("div", { ref: wrapperRef, className: "relative w-full flex-1 overflow-hidden" }, children));
39273
+ };
39274
+ const LoadingDots = ({
39275
+ dotSize = 8,
39276
+ color = "white"
39277
+ }) => {
39278
+ return /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(SingleDot, { dotSize, color }), /* @__PURE__ */ React.createElement(SingleDot, { dotSize, color, delay: 0.3 }), /* @__PURE__ */ React.createElement(SingleDot, { dotSize, color, delay: 0.5 }));
39279
+ };
39280
+ const SingleDot = ({ delay = 0, color, dotSize }) => /* @__PURE__ */ React.createElement(
39281
+ "span",
39282
+ {
39283
+ className: "inline-block mr-1",
39284
+ style: {
39285
+ animation: "loading-dots-scale-up-and-down 2s linear infinite",
39286
+ animationDelay: `${delay}s`,
39287
+ background: color,
39288
+ width: dotSize,
39289
+ height: dotSize,
39290
+ borderRadius: dotSize
39291
+ }
39292
+ }
39293
+ );
39294
+ const ResetForm = ({
39295
+ pristine,
39296
+ reset: reset2,
39297
+ children,
39298
+ ...props
39299
+ }) => {
39300
+ const [open, setOpen] = React.useState(false);
39301
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
39302
+ Button$1,
39303
+ {
39304
+ onClick: () => {
39305
+ setOpen((p2) => !p2);
39306
+ },
39307
+ disabled: pristine,
39308
+ ...props
39309
+ },
39310
+ children
39311
+ ), open && /* @__PURE__ */ React.createElement(ResetModal, { reset: reset2, close: () => setOpen(false) }));
39312
+ };
39313
+ const ResetModal = ({ close: close2, reset: reset2 }) => {
39314
+ return /* @__PURE__ */ React.createElement(Modal, null, /* @__PURE__ */ React.createElement(ModalPopup, null, /* @__PURE__ */ React.createElement(ModalHeader, { close: close2 }, "Reset"), /* @__PURE__ */ React.createElement(ModalBody, { padded: true }, /* @__PURE__ */ React.createElement("p", null, "Are you sure you want to reset all changes?")), /* @__PURE__ */ React.createElement(ModalActions, null, /* @__PURE__ */ React.createElement(Button$1, { style: { flexGrow: 2 }, onClick: close2 }, "Cancel"), /* @__PURE__ */ React.createElement(
39315
+ Button$1,
39316
+ {
39317
+ style: { flexGrow: 3 },
39318
+ variant: "primary",
39319
+ onClick: async () => {
39320
+ await reset2();
39321
+ close2();
39322
+ }
39323
+ },
39324
+ "Reset"
39325
+ ))));
39326
+ };
39327
+ function AiFillWarning(props) {
39328
+ return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 1024 1024" }, "child": [{ "tag": "path", "attr": { "d": "M955.7 856l-416-720c-6.2-10.7-16.9-16-27.7-16s-21.6 5.3-27.7 16l-416 720C56 877.4 71.4 904 96 904h832c24.6 0 40-26.6 27.7-48zM480 416c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v184c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V416zm32 352a48.01 48.01 0 0 1 0-96 48.01 48.01 0 0 1 0 96z" }, "child": [] }] })(props);
39329
+ }
39330
+ function AiOutlineLoading(props) {
39331
+ return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 1024 1024" }, "child": [{ "tag": "path", "attr": { "d": "M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 0 0-94.3-139.9 437.71 437.71 0 0 0-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z" }, "child": [] }] })(props);
39332
+ }
39333
+ const textFieldClasses = "shadow-inner focus:shadow-outline focus:border-blue-500 focus:outline-none block text-base placeholder:text-gray-300 px-3 py-2 text-gray-600 w-full bg-white border border-gray-200 transition-all ease-out duration-150 focus:text-gray-900 rounded";
39334
+ const disabledClasses$1 = "opacity-50 pointer-events-none cursor-not-allowed";
39335
+ const BaseTextField = React.forwardRef(({ className, disabled, ...rest }, ref) => {
39336
+ return /* @__PURE__ */ React.createElement(
39337
+ "input",
39338
+ {
39339
+ ref,
39340
+ type: "text",
39341
+ className: `${textFieldClasses} ${disabled ? disabledClasses$1 : ""} ${className}`,
39342
+ ...rest
39343
+ }
39344
+ );
39345
+ });
39346
+ const TextArea = React.forwardRef(({ ...props }, ref) => {
39347
+ return /* @__PURE__ */ React.createElement(
39348
+ "textarea",
39349
+ {
39350
+ ...props,
39351
+ className: "shadow-inner text-base px-3 py-2 text-gray-600 resize-y focus:shadow-outline focus:border-blue-500 block w-full border border-gray-200 focus:text-gray-900 rounded",
39352
+ ref,
39353
+ style: { minHeight: "160px" }
39354
+ }
39355
+ );
39356
+ });
38675
39357
  const { get: getColor, to: toColor } = pkg;
38676
39358
  var ColorFormat = /* @__PURE__ */ ((ColorFormat2) => {
38677
39359
  ColorFormat2["Hex"] = "hex";
@@ -38975,6 +39657,9 @@ function MdWarning(props) {
38975
39657
  function MdVpnKey(props) {
38976
39658
  return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "fill": "none", "d": "M0 0h24v24H0z" }, "child": [] }, { "tag": "path", "attr": { "d": "M12.65 10A5.99 5.99 0 0 0 7 6c-3.31 0-6 2.69-6 6s2.69 6 6 6a5.99 5.99 0 0 0 5.65-4H17v4h4v-4h2v-4H12.65zM7 14c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2z" }, "child": [] }] })(props);
38977
39659
  }
39660
+ function MdAccessTime(props) {
39661
+ return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "fill": "none", "d": "M0 0h24v24H0z" }, "child": [] }, { "tag": "path", "attr": { "d": "M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z" }, "child": [] }, { "tag": "path", "attr": { "d": "M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z" }, "child": [] }] })(props);
39662
+ }
38978
39663
  function MdKeyboardArrowDown(props) {
38979
39664
  return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "fill": "none", "d": "M0 0h24v24H0V0z" }, "child": [] }, { "tag": "path", "attr": { "d": "M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z" }, "child": [] }] })(props);
38980
39665
  }
@@ -38984,6 +39669,9 @@ function MdArrowForward(props) {
38984
39669
  function MdSyncProblem(props) {
38985
39670
  return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "fill": "none", "d": "M0 0h24v24H0z" }, "child": [] }, { "tag": "path", "attr": { "d": "M3 12c0 2.21.91 4.2 2.36 5.64L3 20h6v-6l-2.24 2.24A6.003 6.003 0 0 1 5 12a5.99 5.99 0 0 1 4-5.65V4.26C5.55 5.15 3 8.27 3 12zm8 5h2v-2h-2v2zM21 4h-6v6l2.24-2.24A6.003 6.003 0 0 1 19 12a5.99 5.99 0 0 1-4 5.65v2.09c3.45-.89 6-4.01 6-7.74 0-2.21-.91-4.2-2.36-5.64L21 4zm-10 9h2V7h-2v6z" }, "child": [] }] })(props);
38986
39671
  }
39672
+ function MdWifiOff(props) {
39673
+ return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "fill": "none", "d": "M24 .01c0-.01 0-.01 0 0L0 0v24h24V.01zM0 0h24v24H0V0zm0 0h24v24H0V0z" }, "child": [] }, { "tag": "path", "attr": { "d": "M22.99 9C19.15 5.16 13.8 3.76 8.84 4.78l2.52 2.52c3.47-.17 6.99 1.05 9.63 3.7l2-2zm-4 4a9.793 9.793 0 0 0-4.49-2.56l3.53 3.53.96-.97zM2 3.05 5.07 6.1C3.6 6.82 2.22 7.78 1 9l1.99 2c1.24-1.24 2.67-2.16 4.2-2.77l2.24 2.24A9.684 9.684 0 0 0 5 13v.01L6.99 15a7.042 7.042 0 0 1 4.92-2.06L18.98 20l1.27-1.26L3.29 1.79 2 3.05zM9 17l3 3 3-3a4.237 4.237 0 0 0-6 0z" }, "child": [] }] })(props);
39674
+ }
38987
39675
  function MdOutlineHelpOutline(props) {
38988
39676
  return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "fill": "none", "d": "M0 0h24v24H0V0z" }, "child": [] }, { "tag": "path", "attr": { "d": "M11 18h2v-2h-2v2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5 0-2.21-1.79-4-4-4z" }, "child": [] }] })(props);
38989
39677
  }
@@ -38993,6 +39681,9 @@ function MdOutlineSettings(props) {
38993
39681
  function MdOutlineClear(props) {
38994
39682
  return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "fill": "none", "d": "M0 0h24v24H0V0z" }, "child": [] }, { "tag": "path", "attr": { "d": "M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z" }, "child": [] }] })(props);
38995
39683
  }
39684
+ function MdOutlineDataSaverOff(props) {
39685
+ return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "fill": "none", "d": "M0 0h24v24H0V0z" }, "child": [] }, { "tag": "path", "attr": { "d": "M13 2.05v3.03c3.39.49 6 3.39 6 6.92 0 .9-.18 1.75-.48 2.54l2.6 1.53c.56-1.24.88-2.62.88-4.07 0-5.18-3.95-9.45-9-9.95zM12 19c-3.87 0-7-3.13-7-7 0-3.53 2.61-6.43 6-6.92V2.05c-5.06.5-9 4.76-9 9.95 0 5.52 4.47 10 9.99 10 3.31 0 6.24-1.61 8.06-4.09l-2.6-1.53A6.95 6.95 0 0 1 12 19z" }, "child": [] }] })(props);
39686
+ }
38996
39687
  function MdOutlineCloud(props) {
38997
39688
  return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "fill": "none", "d": "M0 0h24v24H0V0z" }, "child": [] }, { "tag": "path", "attr": { "d": "M12 6c2.62 0 4.88 1.86 5.39 4.43l.3 1.5 1.53.11A2.98 2.98 0 0 1 22 15c0 1.65-1.35 3-3 3H6c-2.21 0-4-1.79-4-4 0-2.05 1.53-3.76 3.56-3.97l1.07-.11.5-.95A5.469 5.469 0 0 1 12 6m0-2C9.11 4 6.6 5.64 5.35 8.04A5.994 5.994 0 0 0 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96A7.49 7.49 0 0 0 12 4z" }, "child": [] }] })(props);
38998
39689
  }
@@ -39002,7 +39693,7 @@ function MdOutlinePhotoLibrary(props) {
39002
39693
  function MdOutlinePerson(props) {
39003
39694
  return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "fill": "none", "d": "M0 0h24v24H0V0z" }, "child": [] }, { "tag": "path", "attr": { "d": "M12 6c1.1 0 2 .9 2 2s-.9 2-2 2-2-.9-2-2 .9-2 2-2m0 10c2.7 0 5.8 1.29 6 2H6c.23-.72 3.31-2 6-2m0-12C9.79 4 8 5.79 8 8s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm0 10c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z" }, "child": [] }] })(props);
39004
39695
  }
39005
- const selectFieldClasses = "shadow appearance-none bg-white block pl-3 pr-8 py-2 truncate w-full text-base cursor-pointer border border-gray-200 focus:outline-none focus:shadow-outline focus:ring-blue-500 focus:border-blue-500 sm:text-sm rounded";
39696
+ const selectFieldClasses = "shadow appearance-none h-full bg-white block pl-3 pr-8 py-2 truncate w-full text-base cursor-pointer border border-gray-200 focus:outline-none focus:shadow-outline focus:ring-blue-500 focus:border-blue-500 sm:text-sm rounded";
39006
39697
  const Select = ({
39007
39698
  input,
39008
39699
  field,
@@ -39016,7 +39707,7 @@ const Select = ({
39016
39707
  ref.current.focus();
39017
39708
  }
39018
39709
  }, [field == null ? void 0 : field.experimental_focusIntent, ref]);
39019
- return /* @__PURE__ */ React.createElement("div", { className: "relative group w-full md:w-auto" }, /* @__PURE__ */ React.createElement(
39710
+ return /* @__PURE__ */ React.createElement("div", { className: "relative group w-full h-full md:w-auto" }, /* @__PURE__ */ React.createElement(
39020
39711
  "select",
39021
39712
  {
39022
39713
  id: input.name,
@@ -39214,417 +39905,6 @@ const NumberInput = ({
39214
39905
  }
39215
39906
  }
39216
39907
  );
39217
- function cn$1(...inputs) {
39218
- return twMerge(clsx(inputs));
39219
- }
39220
- const Button$1 = ({
39221
- variant = "secondary",
39222
- as: Tag2 = "button",
39223
- size: size2 = "medium",
39224
- busy,
39225
- disabled,
39226
- rounded = "full",
39227
- children,
39228
- className = "",
39229
- ...props
39230
- }) => {
39231
- const baseClasses = "icon-parent inline-flex items-center font-medium focus:outline-none focus:ring-2 focus:shadow-outline text-center inline-flex justify-center transition-all duration-150 ease-out ";
39232
- const variantClasses = {
39233
- primary: `shadow text-white bg-tina-orange-dark hover:bg-tina-orange focus:ring-tina-orange-dark border-0`,
39234
- secondary: `shadow text-gray-500 hover:tina-orange-dark bg-gray-50 hover:bg-white border border-gray-100`,
39235
- white: `shadow text-gray-500 hover:tina-orange-dark bg-white hover:bg-gray-50 border border-gray-100`,
39236
- ghost: `text-gray-500 hover:tina-orange-dark hover:shadow border border-transparent border-0 hover:border hover:border-gray-200 bg-transparent`,
39237
- danger: `shadow text-white bg-red-500 hover:bg-red-600 focus:ring-red-500`,
39238
- accent: `shadow text-white bg-orange-500 hover:bg-orange-600 focus:ring-orange-500`,
39239
- custom: ""
39240
- };
39241
- const state = busy ? `busy` : disabled ? `disabled` : `default`;
39242
- const stateClasses = {
39243
- disabled: `pointer-events-none opacity-30 cursor-not-allowed`,
39244
- busy: `pointer-events-none opacity-70 cursor-wait`,
39245
- default: ``
39246
- };
39247
- const roundedClasses = {
39248
- full: `rounded`,
39249
- left: `rounded-l`,
39250
- right: `rounded-r`,
39251
- custom: "",
39252
- none: ""
39253
- };
39254
- const sizeClasses = {
39255
- small: `text-xs h-8 px-3`,
39256
- medium: `text-sm h-10 px-8`,
39257
- custom: ``
39258
- };
39259
- return /* @__PURE__ */ React.createElement(
39260
- Tag2,
39261
- {
39262
- className: cn$1(
39263
- baseClasses,
39264
- variantClasses[variant],
39265
- sizeClasses[size2],
39266
- stateClasses[state],
39267
- roundedClasses[rounded],
39268
- className
39269
- ),
39270
- ...props
39271
- },
39272
- children
39273
- );
39274
- };
39275
- const IconButton = ({
39276
- variant = "secondary",
39277
- size: size2 = "medium",
39278
- busy,
39279
- disabled,
39280
- children,
39281
- className,
39282
- ...props
39283
- }) => {
39284
- const baseClasses = "icon-parent inline-flex items-center border border-transparent text-sm font-medium focus:outline-none focus:ring-2 focus:shadow-outline text-center inline-flex justify-center transition-all duration-150 ease-out rounded-full";
39285
- const variantClasses = {
39286
- primary: `shadow text-white bg-tina-orange-dark hover:bg-tina-orange focus:ring-tina-orange-dark`,
39287
- secondary: `shadow text-gray-500 hover:text-blue-500 bg-gray-50 hover:bg-white border border-gray-200`,
39288
- white: `shadow text-gray-500 hover:text-blue-500 bg-white hover:bg-gray-50 border border-gray-200`,
39289
- ghost: `text-gray-500 hover:text-blue-500 hover:shadow border border-transparent hover:border-gray-200 bg-transparent`,
39290
- accent: `shadow text-white bg-orange-500 hover:bg-orange-600 focus:ring-orange-500`
39291
- };
39292
- const state = busy ? `busy` : disabled ? `disabled` : `default`;
39293
- const stateClasses = {
39294
- disabled: `pointer-events-none opacity-30 cursor-not-allowed`,
39295
- busy: `pointer-events-none opacity-70 cursor-wait`,
39296
- default: ``
39297
- };
39298
- const sizeClasses = {
39299
- small: `h-7 w-7`,
39300
- medium: `h-9 w-9`,
39301
- custom: ``
39302
- };
39303
- return /* @__PURE__ */ React.createElement(
39304
- "button",
39305
- {
39306
- className: cn$1(
39307
- baseClasses,
39308
- variantClasses[variant],
39309
- sizeClasses[size2],
39310
- stateClasses[state],
39311
- className
39312
- ),
39313
- ...props
39314
- },
39315
- children
39316
- );
39317
- };
39318
- function FontLoader() {
39319
- React.useEffect(() => {
39320
- const link = document.createElement("link");
39321
- link.href = "https://fonts.googleapis.com/css2?family=Inter:wght@400;600&family=Libre+Baskerville:wght@400;500;600;700&display=swap";
39322
- link.rel = "stylesheet";
39323
- document.head.appendChild(link);
39324
- return () => {
39325
- document.head.removeChild(link);
39326
- };
39327
- }, []);
39328
- return null;
39329
- }
39330
- function classNames(...classes) {
39331
- return classes.filter(Boolean).join(" ");
39332
- }
39333
- const OverflowMenu$1 = ({ toolbarItems: toolbarItems2, className = "w-full" }) => {
39334
- const [open, setOpen] = useState(false);
39335
- return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, toolbarItems2.length > 0 && /* @__PURE__ */ React__default.createElement(PopoverPrimitive.Root, { open, onOpenChange: setOpen }, /* @__PURE__ */ React__default.createElement(
39336
- PopoverPrimitive.Trigger,
39337
- {
39338
- className: `cursor-pointer relative justify-center inline-flex items-center p-3 text-sm font-medium focus:outline-1 focus:outline-blue-200 pointer-events-auto ${open ? `text-blue-400` : `text-gray-300 hover:text-blue-500`} ${className}}`
39339
- },
39340
- /* @__PURE__ */ React__default.createElement(
39341
- "svg",
39342
- {
39343
- xmlns: "http://www.w3.org/2000/svg",
39344
- className: "h-5 w-5",
39345
- fill: "none",
39346
- viewBox: "0 0 24 24",
39347
- stroke: "currentColor"
39348
- },
39349
- /* @__PURE__ */ React__default.createElement(
39350
- "path",
39351
- {
39352
- strokeLinecap: "round",
39353
- strokeLinejoin: "round",
39354
- strokeWidth: 2,
39355
- d: "M12 5v.01M12 12v.01M12 19v.01M12 6a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2z"
39356
- }
39357
- )
39358
- )
39359
- ), /* @__PURE__ */ React__default.createElement(PopoverPrimitive.Portal, null, /* @__PURE__ */ React__default.createElement(PopoverPrimitive.Content, { style: { zIndex: 2e4 }, align: "end" }, /* @__PURE__ */ React__default.createElement("div", { className: "mt-0 -mr-1 rounded shadow-lg bg-white ring-1 ring-black ring-opacity-5 py-1" }, toolbarItems2.map((toolbarItem) => {
39360
- return /* @__PURE__ */ React__default.createElement(
39361
- "span",
39362
- {
39363
- "data-test": `${toolbarItem.name}OverflowButton`,
39364
- key: toolbarItem.name,
39365
- onMouseDown: (event) => {
39366
- event.preventDefault();
39367
- toolbarItem.onMouseDown(event);
39368
- setOpen(false);
39369
- },
39370
- className: classNames(
39371
- toolbarItem.active ? "bg-gray-50 text-blue-500" : "bg-white text-gray-600",
39372
- "hover:bg-gray-50 hover:text-blue-500 cursor-pointer pointer-events-auto px-4 py-2 text-sm w-full flex items-center whitespace-nowrap",
39373
- toolbarItem.className ?? ""
39374
- )
39375
- },
39376
- /* @__PURE__ */ React__default.createElement("div", { className: "mr-2 opacity-80" }, toolbarItem.Icon),
39377
- " ",
39378
- toolbarItem.label
39379
- );
39380
- }))))));
39381
- };
39382
- function BsArrowRightShort(props) {
39383
- return GenIcon({ "tag": "svg", "attr": { "fill": "currentColor", "viewBox": "0 0 16 16" }, "child": [{ "tag": "path", "attr": { "fillRule": "evenodd", "d": "M4 8a.5.5 0 0 1 .5-.5h5.793L8.146 5.354a.5.5 0 1 1 .708-.708l3 3a.5.5 0 0 1 0 .708l-3 3a.5.5 0 0 1-.708-.708L10.293 8.5H4.5A.5.5 0 0 1 4 8" }, "child": [] }] })(props);
39384
- }
39385
- function BsCheckCircleFill(props) {
39386
- return GenIcon({ "tag": "svg", "attr": { "fill": "currentColor", "viewBox": "0 0 16 16" }, "child": [{ "tag": "path", "attr": { "d": "M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0m-3.97-3.03a.75.75 0 0 0-1.08.022L7.477 9.417 5.384 7.323a.75.75 0 0 0-1.06 1.06L6.97 11.03a.75.75 0 0 0 1.079-.02l3.992-4.99a.75.75 0 0 0-.01-1.05z" }, "child": [] }] })(props);
39387
- }
39388
- function BsExclamationOctagonFill(props) {
39389
- return GenIcon({ "tag": "svg", "attr": { "fill": "currentColor", "viewBox": "0 0 16 16" }, "child": [{ "tag": "path", "attr": { "d": "M11.46.146A.5.5 0 0 0 11.107 0H4.893a.5.5 0 0 0-.353.146L.146 4.54A.5.5 0 0 0 0 4.893v6.214a.5.5 0 0 0 .146.353l4.394 4.394a.5.5 0 0 0 .353.146h6.214a.5.5 0 0 0 .353-.146l4.394-4.394a.5.5 0 0 0 .146-.353V4.893a.5.5 0 0 0-.146-.353zM8 4c.535 0 .954.462.9.995l-.35 3.507a.552.552 0 0 1-1.1 0L7.1 4.995A.905.905 0 0 1 8 4m.002 6a1 1 0 1 1 0 2 1 1 0 0 1 0-2" }, "child": [] }] })(props);
39390
- }
39391
- const MessageIcon = ({
39392
- type = "success",
39393
- className = ""
39394
- }) => {
39395
- const icons = {
39396
- success: BiCheckCircle,
39397
- warning: BiError,
39398
- error: BiError,
39399
- info: BiInfoCircle
39400
- };
39401
- const Icon = icons[type];
39402
- return /* @__PURE__ */ React__default.createElement(Icon, { className });
39403
- };
39404
- const Message = ({
39405
- children,
39406
- type = "success",
39407
- size: size2 = "medium",
39408
- className = "",
39409
- link,
39410
- linkLabel = "Learn More"
39411
- }) => {
39412
- const containerClasses = {
39413
- success: "bg-gradient-to-r from-green-50 to-green-100 border-green-200",
39414
- warning: "bg-gradient-to-r from-yellow-50 to-yellow-100 border-yellow-200",
39415
- error: "bg-gradient-to-r from-red-50 to-red-100 border-red-200",
39416
- info: "bg-gradient-to-r from-blue-50 to-blue-100 border-blue-100"
39417
- };
39418
- const textClasses = {
39419
- success: "text-green-700",
39420
- warning: "text-yellow-700",
39421
- error: "text-red-700",
39422
- info: "text-blue-700"
39423
- };
39424
- const iconClasses = {
39425
- success: "text-green-400",
39426
- warning: "text-yellow-400",
39427
- error: "text-red-400",
39428
- info: "text-blue-400"
39429
- };
39430
- const sizeClasses = {
39431
- small: "px-3 py-1.5 text-xs",
39432
- medium: "px-4 py-2.5 text-sm"
39433
- };
39434
- return /* @__PURE__ */ React__default.createElement(
39435
- "div",
39436
- {
39437
- className: `rounded-lg border shadow-sm ${sizeClasses[size2]} ${containerClasses[type]} ${className}`
39438
- },
39439
- /* @__PURE__ */ React__default.createElement("div", { className: "flex flex-col sm:flex-row items-start sm:items-center gap-2" }, /* @__PURE__ */ React__default.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ React__default.createElement(
39440
- MessageIcon,
39441
- {
39442
- type,
39443
- className: `${size2 === "small" ? "w-5" : "w-6"} h-auto flex-shrink-0 ${iconClasses[type]}`
39444
- }
39445
- ), /* @__PURE__ */ React__default.createElement("div", { className: `flex-1 ${textClasses[type]}` }, children)), link && /* @__PURE__ */ React__default.createElement(
39446
- "a",
39447
- {
39448
- href: link,
39449
- target: "_blank",
39450
- className: "flex-shrink-0 flex items-center gap-1 text-blue-600 underline decoration-blue-200 hover:text-blue-500 hover:decoration-blue-500 transition-all ease-out duration-150"
39451
- },
39452
- linkLabel,
39453
- " ",
39454
- /* @__PURE__ */ React__default.createElement(BsArrowRightShort, { className: "w-4 h-auto" })
39455
- ))
39456
- );
39457
- };
39458
- function cn(...inputs) {
39459
- return twMerge(clsx(inputs));
39460
- }
39461
- function DropdownMenu({
39462
- ...props
39463
- }) {
39464
- return /* @__PURE__ */ React.createElement(DropdownMenuPrimitive.Root, { "data-slot": "dropdown-menu", ...props });
39465
- }
39466
- function DropdownMenuTrigger({
39467
- ...props
39468
- }) {
39469
- return /* @__PURE__ */ React.createElement(
39470
- DropdownMenuPrimitive.Trigger,
39471
- {
39472
- "data-slot": "dropdown-menu-trigger",
39473
- ...props
39474
- }
39475
- );
39476
- }
39477
- function DropdownMenuContent({
39478
- className,
39479
- sideOffset = 4,
39480
- ...props
39481
- }) {
39482
- return /* @__PURE__ */ React.createElement(DropdownMenuPrimitive.Portal, null, /* @__PURE__ */ React.createElement(
39483
- DropdownMenuPrimitive.Content,
39484
- {
39485
- "data-slot": "dropdown-menu-content",
39486
- sideOffset,
39487
- className: cn(
39488
- "bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-base max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",
39489
- className
39490
- ),
39491
- ...props
39492
- }
39493
- ));
39494
- }
39495
- function DropdownMenuItem({
39496
- className,
39497
- inset,
39498
- variant = "default",
39499
- ...props
39500
- }) {
39501
- return /* @__PURE__ */ React.createElement(
39502
- DropdownMenuPrimitive.Item,
39503
- {
39504
- "data-slot": "dropdown-menu-item",
39505
- "data-inset": inset,
39506
- "data-variant": variant,
39507
- className: cn(
39508
- "focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 cursor-pointer text-gray-700 hover:text-blue-500",
39509
- className
39510
- ),
39511
- ...props
39512
- }
39513
- );
39514
- }
39515
- function DropdownMenuSeparator({
39516
- className,
39517
- ...props
39518
- }) {
39519
- return /* @__PURE__ */ React.createElement(
39520
- DropdownMenuPrimitive.Separator,
39521
- {
39522
- "data-slot": "dropdown-menu-separator",
39523
- className: cn("bg-border -mx-1 my-1 h-px", className),
39524
- ...props
39525
- }
39526
- );
39527
- }
39528
- const DropdownButton = React.forwardRef(
39529
- ({
39530
- variant = "primary",
39531
- size: size2 = "medium",
39532
- busy,
39533
- disabled,
39534
- rounded = "full",
39535
- children,
39536
- className = "",
39537
- onMainAction,
39538
- items: items2,
39539
- showSplitButton = true,
39540
- ...props
39541
- }, ref) => {
39542
- const [open, setOpen] = React.useState(false);
39543
- if (!onMainAction || !showSplitButton) {
39544
- return /* @__PURE__ */ React.createElement(DropdownMenu, { open, onOpenChange: setOpen, modal: false }, /* @__PURE__ */ React.createElement(DropdownMenuTrigger, { asChild: true }, /* @__PURE__ */ React.createElement(
39545
- Button$1,
39546
- {
39547
- variant,
39548
- size: size2,
39549
- busy,
39550
- disabled,
39551
- rounded,
39552
- className: cn$1("gap-2", className),
39553
- ...props
39554
- },
39555
- children,
39556
- /* @__PURE__ */ React.createElement(
39557
- ChevronDownIcon$1,
39558
- {
39559
- className: cn$1(
39560
- "h-4 w-4 transition-transform duration-200",
39561
- open && "rotate-180"
39562
- )
39563
- }
39564
- )
39565
- )), /* @__PURE__ */ React.createElement(DropdownMenuContent, { align: "end", side: "bottom", className: "z-[100000]" }, items2.map((item, index) => /* @__PURE__ */ React.createElement(
39566
- DropdownMenuItem,
39567
- {
39568
- key: index,
39569
- onClick: item.onClick,
39570
- disabled: item.disabled,
39571
- variant: item.variant
39572
- },
39573
- item.icon && item.icon,
39574
- item.label
39575
- ))));
39576
- }
39577
- return /* @__PURE__ */ React.createElement("div", { className: cn$1("inline-flex", className) }, /* @__PURE__ */ React.createElement(
39578
- Button$1,
39579
- {
39580
- variant,
39581
- size: size2,
39582
- busy,
39583
- disabled,
39584
- rounded: "left",
39585
- onClick: onMainAction,
39586
- className: "border-r-0 w-full",
39587
- ...props
39588
- },
39589
- children
39590
- ), /* @__PURE__ */ React.createElement(DropdownMenu, { open, onOpenChange: setOpen }, /* @__PURE__ */ React.createElement(DropdownMenuTrigger, null, /* @__PURE__ */ React.createElement(
39591
- Button$1,
39592
- {
39593
- variant,
39594
- size: size2,
39595
- busy,
39596
- disabled,
39597
- rounded: "right",
39598
- className: "px-4 border-l",
39599
- style: { borderColor: "#00000030" },
39600
- "aria-label": "More options"
39601
- },
39602
- /* @__PURE__ */ React.createElement(
39603
- ChevronDownIcon$1,
39604
- {
39605
- className: cn$1(
39606
- "h-4 w-4 transition-transform duration-200 fill-none",
39607
- open && "rotate-180"
39608
- ),
39609
- style: { fill: "none" }
39610
- }
39611
- )
39612
- )), /* @__PURE__ */ React.createElement(DropdownMenuContent, { align: "end", side: "bottom" }, items2.map((item, index) => {
39613
- var _a2;
39614
- return /* @__PURE__ */ React.createElement(React.Fragment, { key: index }, /* @__PURE__ */ React.createElement(
39615
- DropdownMenuItem,
39616
- {
39617
- onClick: item.onClick,
39618
- disabled: item.disabled,
39619
- variant: item.variant
39620
- },
39621
- item.icon && item.icon,
39622
- item.label
39623
- ), item.variant === "destructive" && index < items2.length - 1 && ((_a2 = items2[index + 1]) == null ? void 0 : _a2.variant) !== "destructive" && /* @__PURE__ */ React.createElement(DropdownMenuSeparator, null));
39624
- }))));
39625
- }
39626
- );
39627
- DropdownButton.displayName = "DropdownButton";
39628
39908
  function useCMS() {
39629
39909
  return useCMS$1();
39630
39910
  }
@@ -40319,19 +40599,25 @@ const Group$1 = ({ tinaForm, form, field, input, meta, index }) => {
40319
40599
  /* @__PURE__ */ React__default.createElement(AddIcon, { className: "w-5/6 h-auto" })
40320
40600
  )
40321
40601
  },
40322
- /* @__PURE__ */ React__default.createElement(ListPanel, null, /* @__PURE__ */ React__default.createElement("div", null, /* @__PURE__ */ React__default.createElement(Droppable, { droppableId: field.name, type: field.name }, (provider) => /* @__PURE__ */ React__default.createElement("div", { ref: provider.innerRef }, items2.length === 0 && /* @__PURE__ */ React__default.createElement(EmptyList, null), items2.map((item, index2) => /* @__PURE__ */ React__default.createElement(
40323
- Item$2,
40602
+ /* @__PURE__ */ React__default.createElement(ListPanel, null, /* @__PURE__ */ React__default.createElement("div", null, /* @__PURE__ */ React__default.createElement(Droppable, { droppableId: field.name, type: field.name }, (provider) => /* @__PURE__ */ React__default.createElement("div", { ref: provider.innerRef }, items2.length === 0 && /* @__PURE__ */ React__default.createElement(EmptyList, null), /* @__PURE__ */ React__default.createElement(
40603
+ SortableProvider,
40324
40604
  {
40325
- key: index2,
40326
- tinaForm,
40327
- field,
40328
- item,
40329
- index: index2,
40330
- isMin,
40331
- fixedLength,
40332
- ...itemProps(item)
40333
- }
40334
- )), provider.placeholder))))
40605
+ items: items2.map((_, index2) => `${field.name}.${index2}`)
40606
+ },
40607
+ items2.map((item, index2) => /* @__PURE__ */ React__default.createElement(
40608
+ Item$2,
40609
+ {
40610
+ key: index2,
40611
+ tinaForm,
40612
+ field,
40613
+ item,
40614
+ index: index2,
40615
+ isMin,
40616
+ fixedLength,
40617
+ ...itemProps(item)
40618
+ }
40619
+ ))
40620
+ ), provider.placeholder))))
40335
40621
  );
40336
40622
  };
40337
40623
  const Item$2 = ({
@@ -40358,7 +40644,13 @@ const Item$2 = ({
40358
40644
  isDragging: snapshot.isDragging,
40359
40645
  ...p2
40360
40646
  },
40361
- /* @__PURE__ */ React__default.createElement(DragHandle, { isDragging: snapshot.isDragging }),
40647
+ /* @__PURE__ */ React__default.createElement(
40648
+ DragHandle,
40649
+ {
40650
+ isDragging: snapshot.isDragging,
40651
+ dragHandleProps: provider.dragHandleProps
40652
+ }
40653
+ ),
40362
40654
  /* @__PURE__ */ React__default.createElement(
40363
40655
  ItemClickTarget,
40364
40656
  {
@@ -40422,17 +40714,16 @@ const ItemHeader = ({
40422
40714
  provider,
40423
40715
  ...props
40424
40716
  }) => {
40717
+ var _a2, _b;
40425
40718
  return /* @__PURE__ */ React__default.createElement(
40426
40719
  "div",
40427
40720
  {
40428
- ref: provider.innerRef,
40721
+ ref: (_a2 = provider.draggableProps) == null ? void 0 : _a2.ref,
40429
40722
  ...provider.draggableProps,
40430
- ...provider.dragHandleProps,
40431
40723
  ...props,
40432
40724
  className: `relative group cursor-pointer flex justify-between items-stretch bg-white border border-gray-100 -mb-px overflow-visible p-0 text-sm font-normal ${isDragging ? "rounded shadow text-blue-600" : "text-gray-600 first:rounded-t last:rounded-b"} ${props.className ?? ""}`,
40433
40725
  style: {
40434
- ...provider.draggableProps.style ?? {},
40435
- ...provider.dragHandleProps.style ?? {},
40726
+ ...((_b = provider.draggableProps) == null ? void 0 : _b.style) ?? {},
40436
40727
  ...props.style ?? {}
40437
40728
  }
40438
40729
  },
@@ -40450,10 +40741,14 @@ const ItemDeleteButton = ({ onClick, disabled = false }) => {
40450
40741
  /* @__PURE__ */ React__default.createElement(TrashIcon, { className: "h-5 w-auto fill-current text-red-500 transition-colors duration-150 ease-out" })
40451
40742
  );
40452
40743
  };
40453
- const DragHandle = ({ isDragging }) => {
40744
+ const DragHandle = ({
40745
+ isDragging,
40746
+ dragHandleProps
40747
+ }) => {
40454
40748
  return /* @__PURE__ */ React__default.createElement(
40455
40749
  "div",
40456
40750
  {
40751
+ ...dragHandleProps,
40457
40752
  className: `relative w-8 px-1 py-2.5 flex items-center justify-center hover:bg-gray-50 group cursor-[grab] ${isDragging ? `text-blue-500` : `text-gray-200 hover:text-gray-600`}`
40458
40753
  },
40459
40754
  isDragging ? /* @__PURE__ */ React__default.createElement(ReorderIcon, { className: "fill-current w-7 h-auto" }) : /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(DragIcon, { className: "fill-current w-7 h-auto group-hover:opacity-0 transition-opacity duration-150 ease-out" }), /* @__PURE__ */ React__default.createElement(ReorderIcon, { className: "fill-current w-7 h-auto absolute top-1/2 left-1/2 -translate-y-1/2 -translate-x-1/2 opacity-0 group-hover:opacity-100 transition-opacity duration-150 ease-out" }))
@@ -40905,39 +41200,45 @@ const Blocks = ({
40905
41200
  }
40906
41201
  ))
40907
41202
  },
40908
- /* @__PURE__ */ React.createElement(ListPanel, null, /* @__PURE__ */ React.createElement(Droppable, { droppableId: field.name, type: field.name }, (provider) => /* @__PURE__ */ React.createElement("div", { ref: provider.innerRef, className: "edit-page--list-parent" }, items2.length === 0 && /* @__PURE__ */ React.createElement(EmptyList, null), items2.map((block2, index2) => {
40909
- const template = field.templates[block2._template];
40910
- if (!template) {
41203
+ /* @__PURE__ */ React.createElement(ListPanel, null, /* @__PURE__ */ React.createElement(Droppable, { droppableId: field.name, type: field.name }, (provider) => /* @__PURE__ */ React.createElement("div", { ref: provider.innerRef, className: "edit-page--list-parent" }, items2.length === 0 && /* @__PURE__ */ React.createElement(EmptyList, null), /* @__PURE__ */ React.createElement(
41204
+ SortableProvider,
41205
+ {
41206
+ items: items2.map((_, index2) => `${field.name}.${index2}`)
41207
+ },
41208
+ items2.map((block2, index2) => {
41209
+ const template = field.templates[block2._template];
41210
+ if (!template) {
41211
+ return /* @__PURE__ */ React.createElement(
41212
+ InvalidBlockListItem,
41213
+ {
41214
+ key: index2,
41215
+ index: index2,
41216
+ field,
41217
+ tinaForm
41218
+ }
41219
+ );
41220
+ }
41221
+ const itemProps = (item) => {
41222
+ if (!template.itemProps)
41223
+ return {};
41224
+ return template.itemProps(item);
41225
+ };
40911
41226
  return /* @__PURE__ */ React.createElement(
40912
- InvalidBlockListItem,
41227
+ BlockListItem,
40913
41228
  {
40914
41229
  key: index2,
41230
+ block: block2,
41231
+ template,
40915
41232
  index: index2,
40916
41233
  field,
40917
- tinaForm
41234
+ tinaForm,
41235
+ isMin,
41236
+ fixedLength,
41237
+ ...itemProps(block2)
40918
41238
  }
40919
41239
  );
40920
- }
40921
- const itemProps = (item) => {
40922
- if (!template.itemProps)
40923
- return {};
40924
- return template.itemProps(item);
40925
- };
40926
- return /* @__PURE__ */ React.createElement(
40927
- BlockListItem,
40928
- {
40929
- key: index2,
40930
- block: block2,
40931
- template,
40932
- index: index2,
40933
- field,
40934
- tinaForm,
40935
- isMin,
40936
- fixedLength,
40937
- ...itemProps(block2)
40938
- }
40939
- );
40940
- }), provider.placeholder)))
41240
+ })
41241
+ ), provider.placeholder)))
40941
41242
  );
40942
41243
  };
40943
41244
  const BlockListItem = ({
@@ -40955,7 +41256,13 @@ const BlockListItem = ({
40955
41256
  }, [tinaForm, field, index]);
40956
41257
  const { dispatch: setHoveredField } = useEvent("field:hover");
40957
41258
  const { dispatch: setFocusedField } = useEvent("field:focus");
40958
- return /* @__PURE__ */ React.createElement(Draggable, { key: index, draggableId: `${field.name}.${index}`, index }, (provider, snapshot) => /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(ItemHeader, { provider, isDragging: snapshot.isDragging }, /* @__PURE__ */ React.createElement(DragHandle, { isDragging: snapshot.isDragging }), /* @__PURE__ */ React.createElement(
41259
+ return /* @__PURE__ */ React.createElement(Draggable, { key: index, draggableId: `${field.name}.${index}`, index }, (provider, snapshot) => /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(ItemHeader, { provider, isDragging: snapshot.isDragging }, /* @__PURE__ */ React.createElement(
41260
+ DragHandle,
41261
+ {
41262
+ isDragging: snapshot.isDragging,
41263
+ dragHandleProps: provider.dragHandleProps
41264
+ }
41265
+ ), /* @__PURE__ */ React.createElement(
40959
41266
  ItemClickTarget,
40960
41267
  {
40961
41268
  onClick: () => {
@@ -40996,7 +41303,13 @@ const InvalidBlockListItem = ({
40996
41303
  const removeItem = React.useCallback(() => {
40997
41304
  tinaForm.mutators.remove(field.name, index);
40998
41305
  }, [tinaForm, field, index]);
40999
- return /* @__PURE__ */ React.createElement(Draggable, { key: index, draggableId: `${field.name}.${index}`, index }, (provider, snapshot) => /* @__PURE__ */ React.createElement(ItemHeader, { provider, isDragging: snapshot.isDragging }, /* @__PURE__ */ React.createElement(DragHandle, { isDragging: snapshot.isDragging }), /* @__PURE__ */ React.createElement(ItemClickTarget, null, /* @__PURE__ */ React.createElement(GroupLabel, { error: true }, "Invalid Block")), /* @__PURE__ */ React.createElement(ItemDeleteButton, { onClick: removeItem })));
41306
+ return /* @__PURE__ */ React.createElement(Draggable, { key: index, draggableId: `${field.name}.${index}`, index }, (provider, snapshot) => /* @__PURE__ */ React.createElement(ItemHeader, { provider, isDragging: snapshot.isDragging }, /* @__PURE__ */ React.createElement(
41307
+ DragHandle,
41308
+ {
41309
+ isDragging: snapshot.isDragging,
41310
+ dragHandleProps: provider.dragHandleProps
41311
+ }
41312
+ ), /* @__PURE__ */ React.createElement(ItemClickTarget, null, /* @__PURE__ */ React.createElement(GroupLabel, { error: true }, "Invalid Block")), /* @__PURE__ */ React.createElement(ItemDeleteButton, { onClick: removeItem })));
41000
41313
  };
41001
41314
  const BlocksField = Blocks;
41002
41315
  const BlocksFieldPlugin = {
@@ -41049,9 +41362,9 @@ const List = ({ tinaForm, form, field, input, meta, index }) => {
41049
41362
  },
41050
41363
  [field.itemProps]
41051
41364
  );
41052
- const isMax = items2.length >= (field.max || Infinity);
41053
- const isMin = items2.length <= (field.min || 0);
41054
- const fixedLength = field.min === field.max;
41365
+ const isMax = items2.length >= (field == null ? void 0 : field.max);
41366
+ const isMin = items2.length <= (field == null ? void 0 : field.min);
41367
+ const fixedLength = (field == null ? void 0 : field.min) === (field == null ? void 0 : field.max);
41055
41368
  return /* @__PURE__ */ React.createElement(
41056
41369
  ListFieldMeta,
41057
41370
  {
@@ -41061,21 +41374,36 @@ const List = ({ tinaForm, form, field, input, meta, index }) => {
41061
41374
  error: meta.error,
41062
41375
  index,
41063
41376
  tinaForm,
41064
- actions: (!fixedLength || fixedLength && !isMax) && /* @__PURE__ */ React.createElement(IconButton, { onClick: addItem, variant: "primary", size: "small" }, /* @__PURE__ */ React.createElement(AddIcon, { className: "w-5/6 h-auto" }))
41377
+ actions: /* @__PURE__ */ React.createElement(
41378
+ IconButton,
41379
+ {
41380
+ onClick: addItem,
41381
+ variant: "primary",
41382
+ size: "small",
41383
+ disabled: isMax
41384
+ },
41385
+ /* @__PURE__ */ React.createElement(AddIcon, { className: "w-5/6 h-auto" })
41386
+ )
41065
41387
  },
41066
- /* @__PURE__ */ React.createElement(ListPanel, null, /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(Droppable, { droppableId: field.name, type: field.name }, (provider) => /* @__PURE__ */ React.createElement("div", { ref: provider.innerRef }, items2.length === 0 && /* @__PURE__ */ React.createElement(EmptyList, null), items2.map((item, index2) => /* @__PURE__ */ React.createElement(
41067
- Item$1,
41388
+ /* @__PURE__ */ React.createElement(ListPanel, null, /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(Droppable, { droppableId: field.name, type: field.name }, (provider) => /* @__PURE__ */ React.createElement("div", { ref: provider.innerRef }, items2.length === 0 && /* @__PURE__ */ React.createElement(EmptyList, null), /* @__PURE__ */ React.createElement(
41389
+ SortableProvider,
41068
41390
  {
41069
- key: index2,
41070
- tinaForm,
41071
- field,
41072
- item,
41073
- index: index2,
41074
- isMin,
41075
- fixedLength,
41076
- ...itemProps(item)
41077
- }
41078
- )), provider.placeholder))))
41391
+ items: items2.map((_, index2) => `${field.name}.${index2}`)
41392
+ },
41393
+ items2.map((item, index2) => /* @__PURE__ */ React.createElement(
41394
+ Item$1,
41395
+ {
41396
+ key: index2,
41397
+ tinaForm,
41398
+ field,
41399
+ item,
41400
+ index: index2,
41401
+ isMin,
41402
+ fixedLength,
41403
+ ...itemProps(item)
41404
+ }
41405
+ ))
41406
+ ), provider.placeholder))))
41079
41407
  );
41080
41408
  };
41081
41409
  const Item$1 = ({
@@ -41101,7 +41429,13 @@ const Item$1 = ({
41101
41429
  name: `${field.name}.${index}`
41102
41430
  }
41103
41431
  ];
41104
- return /* @__PURE__ */ React.createElement(Draggable, { draggableId: `${field.name}.${index}`, index }, (provider, snapshot) => /* @__PURE__ */ React.createElement(ItemHeader, { provider, isDragging: snapshot.isDragging, ...p2 }, /* @__PURE__ */ React.createElement(DragHandle, { isDragging: snapshot.isDragging }), /* @__PURE__ */ React.createElement(ItemClickTarget, null, /* @__PURE__ */ React.createElement(FieldsBuilder, { padding: false, form: tinaForm, fields })), (!fixedLength || fixedLength && !isMin) && /* @__PURE__ */ React.createElement(ItemDeleteButton, { disabled: isMin, onClick: removeItem })));
41432
+ return /* @__PURE__ */ React.createElement(Draggable, { draggableId: `${field.name}.${index}`, index }, (provider, snapshot) => /* @__PURE__ */ React.createElement(ItemHeader, { provider, isDragging: snapshot.isDragging, ...p2 }, /* @__PURE__ */ React.createElement(
41433
+ DragHandle,
41434
+ {
41435
+ isDragging: snapshot.isDragging,
41436
+ dragHandleProps: provider.dragHandleProps
41437
+ }
41438
+ ), /* @__PURE__ */ React.createElement(ItemClickTarget, null, /* @__PURE__ */ React.createElement(FieldsBuilder, { padding: false, form: tinaForm, fields })), (!fixedLength || fixedLength && !isMin) && /* @__PURE__ */ React.createElement(ItemDeleteButton, { disabled: isMin, onClick: removeItem })));
41105
41439
  };
41106
41440
  const ListField = List;
41107
41441
  const ListFieldPlugin = {
@@ -42733,30 +43067,6 @@ const PasswordFieldPlugin = {
42733
43067
  },
42734
43068
  parse: parse$2
42735
43069
  };
42736
- function AiFillWarning(props) {
42737
- return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 1024 1024" }, "child": [{ "tag": "path", "attr": { "d": "M955.7 856l-416-720c-6.2-10.7-16.9-16-27.7-16s-21.6 5.3-27.7 16l-416 720C56 877.4 71.4 904 96 904h832c24.6 0 40-26.6 27.7-48zM480 416c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v184c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V416zm32 352a48.01 48.01 0 0 1 0-96 48.01 48.01 0 0 1 0 96z" }, "child": [] }] })(props);
42738
- }
42739
- function AiOutlineLoading(props) {
42740
- return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 1024 1024" }, "child": [{ "tag": "path", "attr": { "d": "M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 0 0-94.3-139.9 437.71 437.71 0 0 0-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z" }, "child": [] }] })(props);
42741
- }
42742
- function FaCircle(props) {
42743
- return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 512 512" }, "child": [{ "tag": "path", "attr": { "d": "M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8z" }, "child": [] }] })(props);
42744
- }
42745
- function FaFile(props) {
42746
- return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 384 512" }, "child": [{ "tag": "path", "attr": { "d": "M224 136V0H24C10.7 0 0 10.7 0 24v464c0 13.3 10.7 24 24 24h336c13.3 0 24-10.7 24-24V160H248c-13.2 0-24-10.8-24-24zm160-14.1v6.1H256V0h6.1c6.4 0 12.5 2.5 17 7l97.9 98c4.5 4.5 7 10.6 7 16.9z" }, "child": [] }] })(props);
42747
- }
42748
- function FaFolder(props) {
42749
- return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 512 512" }, "child": [{ "tag": "path", "attr": { "d": "M464 128H272l-64-64H48C21.49 64 0 85.49 0 112v288c0 26.51 21.49 48 48 48h416c26.51 0 48-21.49 48-48V176c0-26.51-21.49-48-48-48z" }, "child": [] }] })(props);
42750
- }
42751
- function FaLock(props) {
42752
- return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 448 512" }, "child": [{ "tag": "path", "attr": { "d": "M400 224h-24v-72C376 68.2 307.8 0 224 0S72 68.2 72 152v72H48c-26.5 0-48 21.5-48 48v192c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V272c0-26.5-21.5-48-48-48zm-104 0H152v-72c0-39.7 32.3-72 72-72s72 32.3 72 72v72z" }, "child": [] }] })(props);
42753
- }
42754
- function FaSpinner(props) {
42755
- return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 512 512" }, "child": [{ "tag": "path", "attr": { "d": "M304 48c0 26.51-21.49 48-48 48s-48-21.49-48-48 21.49-48 48-48 48 21.49 48 48zm-48 368c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.49-48-48-48zm208-208c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.49-48-48-48zM96 256c0-26.51-21.49-48-48-48S0 229.49 0 256s21.49 48 48 48 48-21.49 48-48zm12.922 99.078c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48c0-26.509-21.491-48-48-48zm294.156 0c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48c0-26.509-21.49-48-48-48zM108.922 60.922c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.491-48-48-48z" }, "child": [] }] })(props);
42756
- }
42757
- function FaUnlock(props) {
42758
- return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 448 512" }, "child": [{ "tag": "path", "attr": { "d": "M400 256H152V152.9c0-39.6 31.7-72.5 71.3-72.9 40-.4 72.7 32.1 72.7 72v16c0 13.3 10.7 24 24 24h32c13.3 0 24-10.7 24-24v-16C376 68 307.5-.3 223.5 0 139.5.3 72 69.5 72 153.5V256H48c-26.5 0-48 21.5-48 48v160c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V304c0-26.5-21.5-48-48-48z" }, "child": [] }] })(props);
42759
- }
42760
43070
  function GrCircleQuestion(props) {
42761
43071
  return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "fill": "none", "strokeWidth": "2", "d": "M12,22 C17.5228475,22 22,17.5228475 22,12 C22,6.4771525 17.5228475,2 12,2 C6.4771525,2 2,6.4771525 2,12 C2,17.5228475 6.4771525,22 12,22 Z M12,15 L12,14 C12,13 12,12.5 13,12 C14,11.5 15,11 15,9.5 C15,8.5 14,7 12,7 C10,7 9,8.26413718 9,10 M12,16 L12,18" }, "child": [] }] })(props);
42762
43072
  }
@@ -43008,6 +43318,38 @@ const CreateBranch = ({ currentBranch, newBranchName, onCreateBranch, setNewBran
43008
43318
  " Create Branch"
43009
43319
  )));
43010
43320
  };
43321
+ const Badge = ({
43322
+ children,
43323
+ calloutStyle = "warning",
43324
+ className = "",
43325
+ displayIcon = true,
43326
+ ...props
43327
+ }) => {
43328
+ const commonAlertStyles = "text-xs px-2 py-0.5 flex items-center rounded-md border";
43329
+ const styles = {
43330
+ warning: `text-amber-700 bg-amber-100 border-amber-700/20`,
43331
+ info: `text-blue-600 bg-blue-100/50 border-blue-600/20`,
43332
+ success: `text-green-600 bg-green-100/50 border-green-600/20`,
43333
+ error: `text-red-700 bg-red-100/50 border-red-700/20`
43334
+ };
43335
+ const icon = {
43336
+ warning: /* @__PURE__ */ React.createElement(MdAccessTime, { className: "w-5 h-auto inline-block mr-1 opacity-70 text-amber-600" }),
43337
+ info: /* @__PURE__ */ React.createElement(MdOutlineDataSaverOff, { className: "w-5 h-auto inline-block mr-1 opacity-70 text-blue-600" }),
43338
+ success: /* @__PURE__ */ React.createElement(MdCheckCircle, { className: "w-5 h-auto inline-block mr-1 opacity-70 text-green-600" }),
43339
+ error: /* @__PURE__ */ React.createElement(MdWifiOff, { className: "w-5 h-auto inline-block mr-1 opacity-70 text-red-700" })
43340
+ };
43341
+ return /* @__PURE__ */ React.createElement(
43342
+ "div",
43343
+ {
43344
+ className: cn$1(commonAlertStyles, styles[calloutStyle], className),
43345
+ ...props
43346
+ },
43347
+ displayIcon && icon[calloutStyle],
43348
+ " ",
43349
+ children
43350
+ );
43351
+ };
43352
+ const tableHeadingStyle = "px-3 py-3 text-left text-xs font-bold text-gray-700 tracking-wider";
43011
43353
  function formatBranchName(str) {
43012
43354
  const pattern = /[^/\w-]+/g;
43013
43355
  const formattedStr = str.replace(pattern, "-");
@@ -43251,7 +43593,7 @@ const BranchSelector = ({
43251
43593
  filter2
43252
43594
  ).sort(sortBranchListFn(sortValue));
43253
43595
  const previewFunction = (_d = (_c = (_b = (_a2 = cms.api.tina.schema) == null ? void 0 : _a2.config) == null ? void 0 : _b.config) == null ? void 0 : _c.ui) == null ? void 0 : _d.previewUrl;
43254
- return /* @__PURE__ */ React.createElement("div", { className: "flex flex-col gap-4" }, /* @__PURE__ */ React.createElement("div", { className: "flex items-end space-x-4" }, /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(
43596
+ return /* @__PURE__ */ React.createElement("div", { className: "flex flex-col gap-4" }, /* @__PURE__ */ React.createElement("div", { className: "flex items-stretch space-x-4" }, /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(
43255
43597
  "label",
43256
43598
  {
43257
43599
  htmlFor: "search",
@@ -43274,7 +43616,7 @@ const BranchSelector = ({
43274
43616
  className: "outline-none focus:outline-none bg-transparent border-0 p-0 m-0 absolute right-2.5 top-1/2 -translate-y-1/2 opacity-50 hover:opacity-100 transition-all ease-out duration-150"
43275
43617
  },
43276
43618
  /* @__PURE__ */ React.createElement(MdOutlineClear, { className: "w-5 h-auto text-gray-600" })
43277
- ))), /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(
43619
+ ))), /* @__PURE__ */ React.createElement("div", { className: "flex flex-col" }, /* @__PURE__ */ React.createElement(
43278
43620
  "label",
43279
43621
  {
43280
43622
  htmlFor: "branch-type",
@@ -43302,7 +43644,7 @@ const BranchSelector = ({
43302
43644
  }
43303
43645
  ]
43304
43646
  }
43305
- ))), filteredBranchList.length === 0 && /* @__PURE__ */ React.createElement("div", { className: "block relative text-gray-300 italic py-1" }, "No branches to display"), filteredBranchList.length > 0 && /* @__PURE__ */ React.createElement("div", { className: "min-w-[192px] max-h-[24rem] overflow-y-auto flex flex-col w-full h-full rounded-lg shadow-inner bg-white border border-gray-200" }, filteredBranchList.map((branch) => /* @__PURE__ */ React.createElement(
43647
+ ))), filteredBranchList.length === 0 && /* @__PURE__ */ React.createElement("div", { className: "block relative text-gray-300 italic py-1" }, "No branches to display"), filteredBranchList.length > 0 && /* @__PURE__ */ React.createElement("div", { className: "min-w-[192px] max-h-[24rem] overflow-y-auto w-full h-full rounded-lg shadow-inner bg-white border border-gray-200" }, /* @__PURE__ */ React.createElement("table", { className: "w-full" }, /* @__PURE__ */ React.createElement("thead", { className: "bg-gray-100 border-b-2 border-gray-200" }, /* @__PURE__ */ React.createElement("tr", null, /* @__PURE__ */ React.createElement("th", { className: tableHeadingStyle }, "Branch Name"), /* @__PURE__ */ React.createElement("th", { className: tableHeadingStyle }, "Last Updated"), /* @__PURE__ */ React.createElement("th", null), /* @__PURE__ */ React.createElement("th", null))), /* @__PURE__ */ React.createElement("tbody", null, filteredBranchList.map((branch) => /* @__PURE__ */ React.createElement(
43306
43648
  BranchItem,
43307
43649
  {
43308
43650
  key: branch.name,
@@ -43313,7 +43655,7 @@ const BranchSelector = ({
43313
43655
  previewFunction,
43314
43656
  cms
43315
43657
  }
43316
- ))));
43658
+ ))))));
43317
43659
  };
43318
43660
  const BranchItem = ({
43319
43661
  branch,
@@ -43349,15 +43691,15 @@ const BranchItem = ({
43349
43691
  const isCurrentBranch = branch.name === currentBranch;
43350
43692
  const indexingStatus = (_a2 = branch == null ? void 0 : branch.indexStatus) == null ? void 0 : _a2.status;
43351
43693
  return /* @__PURE__ */ React.createElement(
43352
- "div",
43694
+ "tr",
43353
43695
  {
43354
- className: `relative text-base py-1.5 px-3 flex items-center gap-1.5 border-l-0 border-t-0 border-r-0 border-gray-50 w-full outline-none transition-all ease-out duration-150 ${indexingStatus !== "complete" ? "bg-gray-50 text-gray-400" : isCurrentBranch ? "border-blue-500 border-l-5 bg-blue-50 text-blue-800 border-b-0" : "border-b-2"}`
43696
+ className: `text-base border-l-0 border-t-0 border-r-0 outline-none transition-all ease-out duration-150 ${indexingStatus !== "complete" ? "bg-gray-50 text-gray-400" : isCurrentBranch ? "bg-blue-50 text-blue-800 border-b-0" : "border-b-2 border-gray-50"}`
43355
43697
  },
43356
- /* @__PURE__ */ React.createElement("div", { className: "w-1/2" }, /* @__PURE__ */ React.createElement("div", { className: "flex items-center gap-1" }, /* @__PURE__ */ React.createElement("div", { className: "flex-0" }, branch.protected && /* @__PURE__ */ React.createElement(BiLock, { className: "w-5 h-auto opacity-70 text-blue-500" })), /* @__PURE__ */ React.createElement("div", { className: "truncate flex-1" }, branch.name)), indexingStatus !== "complete" && /* @__PURE__ */ React.createElement("div", { className: "w-fit" }, /* @__PURE__ */ React.createElement(IndexStatus, { indexingStatus: branch.indexStatus.status }))),
43357
- /* @__PURE__ */ React.createElement("div", { className: "flex-1" }, creatingPR ? /* @__PURE__ */ React.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("div", { className: "text-xs font-bold text-blue-600" }, "Creating PR"), /* @__PURE__ */ React.createElement("span", { className: "text-sm leading-tight text-blue-500" }, "Please wait...")), /* @__PURE__ */ React.createElement(FaSpinner, { className: "w-3 h-auto animate-spin text-blue-500" })) : /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", { className: "text-xs font-bold" }, "Last Updated"), /* @__PURE__ */ React.createElement("span", { className: "text-sm leading-tight" }, formatDistanceToNow$1(new Date(branch.indexStatus.timestamp), {
43698
+ /* @__PURE__ */ React.createElement("td", { className: "pl-3 pr-3 py-1.5 min-w-0" }, /* @__PURE__ */ React.createElement("div", { className: "flex flex-col" }, /* @__PURE__ */ React.createElement("div", { className: "flex items-center gap-1" }, branch.protected && /* @__PURE__ */ React.createElement(BiLock, { className: "w-5 h-auto opacity-70 text-blue-500 flex-shrink-0" }), /* @__PURE__ */ React.createElement("span", { className: "text-sm leading-tight truncate" }, branch.name)), indexingStatus !== "complete" && /* @__PURE__ */ React.createElement("div", { className: "w-fit mt-1" }, /* @__PURE__ */ React.createElement(IndexStatus, { indexingStatus: branch.indexStatus.status })))),
43699
+ /* @__PURE__ */ React.createElement("td", { className: "px-3 py-1.5 min-w-0" }, creatingPR ? /* @__PURE__ */ React.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("div", { className: "text-xs font-bold text-blue-600" }, "Creating PR"), /* @__PURE__ */ React.createElement("span", { className: "text-sm leading-tight text-blue-500" }, "Please wait...")), /* @__PURE__ */ React.createElement(FaSpinner, { className: "w-3 h-auto animate-spin text-blue-500" })) : /* @__PURE__ */ React.createElement("span", { className: "text-sm leading-tight whitespace-nowrap" }, formatDistanceToNow$1(new Date(branch.indexStatus.timestamp), {
43358
43700
  addSuffix: true
43359
- })))),
43360
- /* @__PURE__ */ React.createElement("div", { className: "flex items-center" }, indexingStatus === "complete" && !isCurrentBranch && /* @__PURE__ */ React.createElement(
43701
+ }))),
43702
+ /* @__PURE__ */ React.createElement("td", { className: "px-3 py-1.5 text-left" }, indexingStatus === "complete" && !isCurrentBranch && /* @__PURE__ */ React.createElement(
43361
43703
  Button$1,
43362
43704
  {
43363
43705
  variant: "white",
@@ -43365,12 +43707,13 @@ const BranchItem = ({
43365
43707
  onClick: () => {
43366
43708
  onChange(branch.name);
43367
43709
  },
43368
- className: "mr-auto cursor-pointer text-sm h-9 px-4 flex items-center gap-1"
43710
+ className: "cursor-pointer text-sm h-9 px-4 flex items-center gap-1"
43369
43711
  },
43370
43712
  /* @__PURE__ */ React.createElement(BiPencil, { className: "h-4 w-auto text-blue-500 opacity-70 -mt-px" }),
43371
43713
  " ",
43372
43714
  "Select"
43373
- ), /* @__PURE__ */ React.createElement("div", { className: "ml-auto" }, /* @__PURE__ */ React.createElement(
43715
+ ), indexingStatus === "complete" && isCurrentBranch && /* @__PURE__ */ React.createElement(Badge, { calloutStyle: "info", className: "w-fit", displayIcon: false }, /* @__PURE__ */ React.createElement("span", null, "Selected"))),
43716
+ /* @__PURE__ */ React.createElement("td", { className: "px-3 py-1.5 text-right" }, /* @__PURE__ */ React.createElement(
43374
43717
  OverflowMenu$1,
43375
43718
  {
43376
43719
  toolbarItems: [
@@ -43401,7 +43744,7 @@ const BranchItem = ({
43401
43744
  }
43402
43745
  ].filter(Boolean)
43403
43746
  }
43404
- )))
43747
+ ))
43405
43748
  );
43406
43749
  };
43407
43750
  const IndexStatus = ({ indexingStatus }) => {
@@ -45457,7 +45800,7 @@ const Callout = ({
45457
45800
  className = "",
45458
45801
  ...props
45459
45802
  }) => {
45460
- const commonAlertStyles = "ml-8 text-sm px-4 py-3 rounded-md border";
45803
+ const commonAlertStyles = "text-sm px-4 py-3 rounded-md border";
45461
45804
  const styles = {
45462
45805
  warning: `text-amber-700 bg-amber-100 border-amber-700/20`,
45463
45806
  info: `text-blue-600 bg-blue-100/50 border-blue-600/20`,
@@ -46229,7 +46572,7 @@ function formatDistanceToNow(dirtyDate, options) {
46229
46572
  requiredArgs(1, arguments);
46230
46573
  return formatDistance2(dirtyDate, Date.now(), options);
46231
46574
  }
46232
- const version$1 = "2.9.2";
46575
+ const version$1 = "2.9.5";
46233
46576
  const VersionInfo = () => {
46234
46577
  var _a2, _b, _c, _d, _e, _f;
46235
46578
  const cms = useCMS();
@@ -47869,7 +48212,7 @@ function Alerts2({ alerts }) {
47869
48212
  if (!alerts.all.length) {
47870
48213
  return null;
47871
48214
  }
47872
- return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement("div", { className: "fixed bottom-0 left-0 right-0 p-6 flex flex-col items-center z-[999999]" }, alerts.all.filter((alert) => {
48215
+ return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement("div", { className: "fixed top-0 left-0 p-6 flex flex-col items-center z-[999999]" }, alerts.all.filter((alert) => {
47873
48216
  return alert.level !== "error";
47874
48217
  }).map((alert) => {
47875
48218
  return /* @__PURE__ */ React__default.createElement(Alert, { key: alert.id, level: alert.level }, alert.level === "info" && /* @__PURE__ */ React__default.createElement(MdInfo, { className: "w-5 h-auto opacity-70" }), alert.level === "success" && /* @__PURE__ */ React__default.createElement(MdCheckCircle, { className: "w-5 h-auto opacity-70" }), alert.level === "warn" && /* @__PURE__ */ React__default.createElement(MdWarning, { className: "w-5 h-auto opacity-70" }), /* @__PURE__ */ React__default.createElement("p", { className: "m-0 flex-1 max-w-[680px] text-left" }, parseUrlsInText(alert.message.toString())), /* @__PURE__ */ React__default.createElement(
@@ -47913,10 +48256,10 @@ const Alert = ({
47913
48256
  ...props
47914
48257
  }) => {
47915
48258
  const colorClasses = {
47916
- info: "bg-blue-100 border-blue-500 text-blue-600 fill-blue-500",
47917
- success: "bg-green-100 border-green-500 text-green-600 fill-green-500",
47918
- warn: "bg-yellow-100 border-yellow-500 text-yellow-600 fill-yellow-500",
47919
- error: "bg-red-100 border-red-500 text-red-600 fill-red-500"
48259
+ info: "bg-white border-blue-500 text-blue-600 fill-blue-500",
48260
+ success: "bg-white border-green-500 text-green-600 fill-green-500",
48261
+ warn: "bg-white border-yellow-500 text-yellow-600 fill-yellow-500",
48262
+ error: "bg-white border-red-500 text-red-600 fill-red-500"
47920
48263
  };
47921
48264
  const borderClasses = {
47922
48265
  info: "border-blue-200",
@@ -47939,7 +48282,7 @@ const Alert = ({
47939
48282
  /* @__PURE__ */ React__default.createElement(
47940
48283
  "div",
47941
48284
  {
47942
- className: `flex items-center gap-1.5 min-w-[350px] rounded-md border p-2 ${borderClasses[level]}`,
48285
+ className: `flex items-center gap-1.5 w-[350px] rounded-md border p-2 ${borderClasses[level]}`,
47943
48286
  ...props
47944
48287
  }
47945
48288
  )
@@ -47951,7 +48294,7 @@ const CloseAlert = ({ ...styleProps }) => /* @__PURE__ */ React__default.createE
47951
48294
  className: "border-none bg-transparent p-0 outline-none flex items-center",
47952
48295
  ...styleProps
47953
48296
  },
47954
- /* @__PURE__ */ React__default.createElement(BiX, { className: "w-5 auto flex-grow-0 flex-shrink-0" })
48297
+ /* @__PURE__ */ React__default.createElement(BiX, { className: "w-5 auto flex-grow-0 flex-shrink-0 text-gray-700" })
47955
48298
  );
47956
48299
  function CursorPaginator({
47957
48300
  navigateNext,
@@ -48248,6 +48591,18 @@ const BranchPreviewButton = (props) => {
48248
48591
  /* @__PURE__ */ React.createElement(BiLinkExternal, { className: "h-5 w-auto" })
48249
48592
  );
48250
48593
  };
48594
+ const EDITORIAL_WORKFLOW_STATUS = {
48595
+ QUEUED: "queued",
48596
+ PROCESSING: "processing",
48597
+ SETTING_UP: "setting_up",
48598
+ CREATING_BRANCH: "creating_branch",
48599
+ INDEXING: "indexing",
48600
+ CONTENT_GENERATION: "content_generation",
48601
+ CREATING_PR: "creating_pr",
48602
+ COMPLETE: "complete",
48603
+ ERROR: "error",
48604
+ TIMEOUT: "timeout"
48605
+ };
48251
48606
  const num123 = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"];
48252
48607
  const numFas = ["۱", "۲", "۳", "۴", "۵", "۶", "۷", "۸", "۹", "۰"];
48253
48608
  const numKor = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"];
@@ -63661,367 +64016,6 @@ class TinaAdminApi {
63661
64016
  );
63662
64017
  }
63663
64018
  }
63664
- const ProgressBar = ({
63665
- progress,
63666
- className = "",
63667
- color = "blue"
63668
- }) => {
63669
- const clampedProgress = Math.min(Math.max(progress, 0), 100);
63670
- const colorClass = color === "green" ? "bg-green-500" : "bg-blue-500";
63671
- return /* @__PURE__ */ React.createElement("div", { className: `w-full ${className}` }, /* @__PURE__ */ React.createElement("div", { className: "w-full bg-gray-200 rounded-full h-2" }, /* @__PURE__ */ React.createElement(
63672
- "div",
63673
- {
63674
- className: `${colorClass} h-2 rounded-full transition-all duration-300 ease-out`,
63675
- style: { width: `${clampedProgress}%` }
63676
- }
63677
- )));
63678
- };
63679
- const EDITORIAL_WORKFLOW_STATUS = {
63680
- QUEUED: "queued",
63681
- PROCESSING: "processing",
63682
- SETTING_UP: "setting_up",
63683
- CREATING_BRANCH: "creating_branch",
63684
- INDEXING: "indexing",
63685
- CONTENT_GENERATION: "content_generation",
63686
- CREATING_PR: "creating_pr",
63687
- COMPLETE: "complete",
63688
- ERROR: "error",
63689
- TIMEOUT: "timeout"
63690
- };
63691
- const FormActionMenu = ({ actions, form }) => {
63692
- const [actionMenuVisibility, setActionMenuVisibility] = useState(false);
63693
- return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(MoreActionsButton, { onClick: () => setActionMenuVisibility((p2) => !p2) }), /* @__PURE__ */ React.createElement(ActionsOverlay, { open: actionMenuVisibility }, /* @__PURE__ */ React.createElement(
63694
- Dismissible,
63695
- {
63696
- click: true,
63697
- escape: true,
63698
- disabled: !actionMenuVisibility,
63699
- onDismiss: () => {
63700
- setActionMenuVisibility((p2) => !p2);
63701
- }
63702
- },
63703
- actions.map((Action, i2) => (
63704
- // TODO: `i` will suppress warnings but this indicates that maybe
63705
- // Actions should just be componets
63706
- /* @__PURE__ */ React.createElement(Action, { form, key: i2 })
63707
- ))
63708
- )));
63709
- };
63710
- const MoreActionsButton = ({ className = "", ...props }) => /* @__PURE__ */ React.createElement(
63711
- "button",
63712
- {
63713
- className: `h-16 w-10 self-stretch bg-transparent bg-center bg-[length:auto_18px] -mr-4 ml-2 outline-none cursor-pointer transition-opacity duration-100 ease-out flex justify-center items-center hover:bg-gray-50 hover:fill-gray-700 ${className}`,
63714
- ...props
63715
- },
63716
- /* @__PURE__ */ React.createElement(EllipsisVerticalIcon, null)
63717
- );
63718
- const ActionsOverlay = ({ open, className = "", style = {}, ...props }) => /* @__PURE__ */ React.createElement(
63719
- "div",
63720
- {
63721
- className: `min-w-[192px] rounded-3xl border border-solid border-[#efefef] block absolute bottom-5 right-5 ${open ? "opacity-100" : "opacity-0"} transition-all duration-100 ease-out origin-bottom-right shadow-[0_2px_3px_rgba(0,0,0,0.05)] bg-white overflow-hidden z-10 ${className}`,
63722
- style: {
63723
- transform: open ? "translate3d(0, -28px, 0) scale3d(1, 1, 1)" : "translate3d(0, 0, 0) scale3d(0.5, 0.5, 1)",
63724
- pointerEvents: open ? "all" : "none",
63725
- ...style
63726
- },
63727
- ...props
63728
- }
63729
- );
63730
- const ActionButton = ({ className = "", ...props }) => /* @__PURE__ */ React.createElement(
63731
- "button",
63732
- {
63733
- className: `relative text-center text-[13px] px-3 h-10 font-normal w-full bg-none cursor-pointer outline-none border-0 transition-all duration-[150ms] ease-out hover:text-blue-500 hover:bg-gray50 [&:not(:last-child)]: border-b-[1px] border-solid border-b-[#edecf3] ${className}`,
63734
- ...props
63735
- }
63736
- );
63737
- const FormPortalContext = React.createContext(() => {
63738
- return null;
63739
- });
63740
- function useFormPortal() {
63741
- return React.useContext(FormPortalContext);
63742
- }
63743
- const FormPortalProvider = ({
63744
- children
63745
- }) => {
63746
- const wrapperRef = React.useRef(null);
63747
- const zIndexRef = React.useRef(0);
63748
- const FormPortal = React.useCallback(
63749
- (props) => {
63750
- if (!wrapperRef.current)
63751
- return null;
63752
- return createPortal(
63753
- props.children({ zIndexShift: zIndexRef.current += 1 }),
63754
- wrapperRef.current
63755
- );
63756
- },
63757
- [wrapperRef, zIndexRef]
63758
- );
63759
- return /* @__PURE__ */ React.createElement(FormPortalContext.Provider, { value: FormPortal }, /* @__PURE__ */ React.createElement("div", { ref: wrapperRef, className: "relative w-full flex-1 overflow-hidden" }, children));
63760
- };
63761
- const LoadingDots = ({
63762
- dotSize = 8,
63763
- color = "white"
63764
- }) => {
63765
- return /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(SingleDot, { dotSize, color }), /* @__PURE__ */ React.createElement(SingleDot, { dotSize, color, delay: 0.3 }), /* @__PURE__ */ React.createElement(SingleDot, { dotSize, color, delay: 0.5 }));
63766
- };
63767
- const SingleDot = ({ delay = 0, color, dotSize }) => /* @__PURE__ */ React.createElement(
63768
- "span",
63769
- {
63770
- className: "inline-block mr-1",
63771
- style: {
63772
- animation: "loading-dots-scale-up-and-down 2s linear infinite",
63773
- animationDelay: `${delay}s`,
63774
- background: color,
63775
- width: dotSize,
63776
- height: dotSize,
63777
- borderRadius: dotSize
63778
- }
63779
- }
63780
- );
63781
- const ResetForm = ({
63782
- pristine,
63783
- reset: reset2,
63784
- children,
63785
- ...props
63786
- }) => {
63787
- const [open, setOpen] = React.useState(false);
63788
- return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
63789
- Button$1,
63790
- {
63791
- onClick: () => {
63792
- setOpen((p2) => !p2);
63793
- },
63794
- disabled: pristine,
63795
- ...props
63796
- },
63797
- children
63798
- ), open && /* @__PURE__ */ React.createElement(ResetModal, { reset: reset2, close: () => setOpen(false) }));
63799
- };
63800
- const ResetModal = ({ close: close2, reset: reset2 }) => {
63801
- return /* @__PURE__ */ React.createElement(Modal, null, /* @__PURE__ */ React.createElement(ModalPopup, null, /* @__PURE__ */ React.createElement(ModalHeader, { close: close2 }, "Reset"), /* @__PURE__ */ React.createElement(ModalBody, { padded: true }, /* @__PURE__ */ React.createElement("p", null, "Are you sure you want to reset all changes?")), /* @__PURE__ */ React.createElement(ModalActions, null, /* @__PURE__ */ React.createElement(Button$1, { style: { flexGrow: 2 }, onClick: close2 }, "Cancel"), /* @__PURE__ */ React.createElement(
63802
- Button$1,
63803
- {
63804
- style: { flexGrow: 3 },
63805
- variant: "primary",
63806
- onClick: async () => {
63807
- await reset2();
63808
- close2();
63809
- }
63810
- },
63811
- "Reset"
63812
- ))));
63813
- };
63814
- const NoFieldsPlaceholder = () => /* @__PURE__ */ React.createElement(
63815
- "div",
63816
- {
63817
- className: "relative flex flex-col items-center justify-center text-center p-5 pb-16 w-full h-full overflow-y-auto",
63818
- style: {
63819
- animationName: "fade-in",
63820
- animationDelay: "300ms",
63821
- animationTimingFunction: "ease-out",
63822
- animationIterationCount: 1,
63823
- animationFillMode: "both",
63824
- animationDuration: "150ms"
63825
- }
63826
- },
63827
- /* @__PURE__ */ React.createElement(Emoji, { className: "block pb-5" }, "🤔"),
63828
- /* @__PURE__ */ React.createElement("h3", { className: "font-sans font-normal text-lg block pb-5" }, "Hey, you don't have any fields added to this form."),
63829
- /* @__PURE__ */ React.createElement("p", { className: "block pb-5" }, /* @__PURE__ */ React.createElement(
63830
- "a",
63831
- {
63832
- className: "text-center rounded-3xl border border-solid border-gray-100 shadow-[0_2px_3px_rgba(0,0,0,0.12)] font-normal cursor-pointer text-[12px] transition-all duration-100 ease-out bg-white text-gray-700 py-3 pr-5 pl-14 relative no-underline inline-block hover:text-blue-500",
63833
- href: "https://tinacms.org/docs/fields",
63834
- target: "_blank",
63835
- rel: "noopener noreferrer"
63836
- },
63837
- /* @__PURE__ */ React.createElement(
63838
- Emoji,
63839
- {
63840
- className: "absolute left-5 top-1/2 origin-center -translate-y-1/2 transition-all duration-100 ease-out",
63841
- style: { fontSize: 24 }
63842
- },
63843
- "📖"
63844
- ),
63845
- " ",
63846
- "Field Setup Guide"
63847
- ))
63848
- );
63849
- const FormKeyBindings = ({ onSubmit }) => {
63850
- useEffect(() => {
63851
- const handleKeyDown = (e3) => {
63852
- if ((e3.metaKey || e3.ctrlKey) && e3.key === "s") {
63853
- e3.preventDefault();
63854
- onSubmit();
63855
- }
63856
- };
63857
- window.addEventListener("keydown", handleKeyDown);
63858
- return () => window.removeEventListener("keydown", handleKeyDown);
63859
- }, [onSubmit]);
63860
- return null;
63861
- };
63862
- const FormBuilder = ({
63863
- form,
63864
- onPristineChange,
63865
- ...rest
63866
- }) => {
63867
- const cms = useCMS$1();
63868
- const hideFooter = !!rest.hideFooter;
63869
- const [createBranchModalOpen, setCreateBranchModalOpen] = React.useState(false);
63870
- const tinaForm = form.tinaForm;
63871
- const finalForm = form.tinaForm.finalForm;
63872
- React.useEffect(() => {
63873
- var _a2;
63874
- const collection = cms.api.tina.schema.getCollectionByFullPath(
63875
- tinaForm.path
63876
- );
63877
- if ((_a2 = collection == null ? void 0 : collection.ui) == null ? void 0 : _a2.beforeSubmit) {
63878
- tinaForm.beforeSubmit = (values) => collection.ui.beforeSubmit({ cms, form: tinaForm, values });
63879
- } else {
63880
- tinaForm.beforeSubmit = void 0;
63881
- }
63882
- }, [tinaForm.path]);
63883
- const moveArrayItem = React.useCallback(
63884
- (result) => {
63885
- if (!result.destination || !finalForm)
63886
- return;
63887
- const name = result.type;
63888
- finalForm.mutators.move(
63889
- name,
63890
- result.source.index,
63891
- result.destination.index
63892
- );
63893
- },
63894
- [tinaForm]
63895
- );
63896
- React.useEffect(() => {
63897
- const unsubscribe = finalForm.subscribe(
63898
- ({ pristine }) => {
63899
- if (onPristineChange) {
63900
- onPristineChange(pristine);
63901
- }
63902
- },
63903
- { pristine: true }
63904
- );
63905
- return () => {
63906
- unsubscribe();
63907
- };
63908
- }, [finalForm]);
63909
- const fieldGroup = tinaForm.getActiveField(form.activeFieldName);
63910
- return /* @__PURE__ */ React.createElement(
63911
- Form$1,
63912
- {
63913
- key: tinaForm.id,
63914
- form: tinaForm.finalForm,
63915
- onSubmit: tinaForm.onSubmit
63916
- },
63917
- ({
63918
- handleSubmit,
63919
- pristine,
63920
- invalid,
63921
- submitting,
63922
- dirtySinceLastSubmit,
63923
- hasValidationErrors
63924
- }) => {
63925
- const usingProtectedBranch = cms.api.tina.usingProtectedBranch();
63926
- const canSubmit = !pristine && !submitting && !hasValidationErrors && !(invalid && !dirtySinceLastSubmit);
63927
- const safeSubmit = async () => {
63928
- if (canSubmit) {
63929
- await handleSubmit();
63930
- }
63931
- };
63932
- const safeHandleSubmit = async () => {
63933
- if (usingProtectedBranch) {
63934
- setCreateBranchModalOpen(true);
63935
- } else {
63936
- safeSubmit();
63937
- }
63938
- };
63939
- return /* @__PURE__ */ React.createElement(React.Fragment, null, createBranchModalOpen && /* @__PURE__ */ React.createElement(
63940
- CreateBranchModal,
63941
- {
63942
- safeSubmit,
63943
- crudType: tinaForm.crudType,
63944
- path: tinaForm.path,
63945
- values: tinaForm.values,
63946
- close: () => setCreateBranchModalOpen(false)
63947
- }
63948
- ), /* @__PURE__ */ React.createElement(DragDropContext, { onDragEnd: moveArrayItem }, /* @__PURE__ */ React.createElement(FormKeyBindings, { onSubmit: safeHandleSubmit }), /* @__PURE__ */ React.createElement(FormPortalProvider, null, /* @__PURE__ */ React.createElement(FormWrapper, { id: tinaForm.id }, (tinaForm == null ? void 0 : tinaForm.fields.length) ? /* @__PURE__ */ React.createElement(
63949
- FieldsBuilder,
63950
- {
63951
- form: tinaForm,
63952
- activeFieldName: form.activeFieldName,
63953
- fields: fieldGroup.fields
63954
- }
63955
- ) : /* @__PURE__ */ React.createElement(NoFieldsPlaceholder, null))), !hideFooter && /* @__PURE__ */ React.createElement("div", { className: "relative flex-none w-full h-16 px-6 bg-white border-t border-gray-100 flex items-center justify-end" }, /* @__PURE__ */ React.createElement("div", { className: "flex-1 w-full justify-end gap-2 flex items-center max-w-form" }, tinaForm.reset && /* @__PURE__ */ React.createElement(
63956
- ResetForm,
63957
- {
63958
- pristine,
63959
- reset: async () => {
63960
- finalForm.reset();
63961
- await tinaForm.reset();
63962
- }
63963
- },
63964
- tinaForm.buttons.reset
63965
- ), /* @__PURE__ */ React.createElement(
63966
- Button$1,
63967
- {
63968
- onClick: safeHandleSubmit,
63969
- disabled: !canSubmit,
63970
- busy: submitting,
63971
- variant: "primary"
63972
- },
63973
- submitting && /* @__PURE__ */ React.createElement(LoadingDots, null),
63974
- !submitting && tinaForm.buttons.save
63975
- ), tinaForm.actions.length > 0 && /* @__PURE__ */ React.createElement(
63976
- FormActionMenu,
63977
- {
63978
- form: tinaForm,
63979
- actions: tinaForm.actions
63980
- }
63981
- )))));
63982
- }
63983
- );
63984
- };
63985
- const FormStatus = ({ pristine }) => {
63986
- const pristineClass = pristine ? "text-green-500" : "text-red-500";
63987
- return /* @__PURE__ */ React.createElement(FaCircle, { className: cn("h-3", pristineClass) });
63988
- };
63989
- const FormWrapper = ({
63990
- id: id2,
63991
- children
63992
- }) => {
63993
- return /* @__PURE__ */ React.createElement(
63994
- "div",
63995
- {
63996
- "data-test": `form:${id2 == null ? void 0 : id2.replace(/\\/g, "/")}`,
63997
- className: "h-full overflow-y-auto max-h-full bg-gray-50"
63998
- },
63999
- /* @__PURE__ */ React.createElement("div", { className: "py-5 px-6" }, children)
64000
- );
64001
- };
64002
- const Emoji = ({ className = "", ...props }) => /* @__PURE__ */ React.createElement(
64003
- "span",
64004
- {
64005
- className: `text-[40px] leading-none inline-block ${className}`,
64006
- ...props
64007
- }
64008
- );
64009
- const CreateBranchModel = ({
64010
- close: close2,
64011
- safeSubmit,
64012
- relativePath: relativePath2,
64013
- values,
64014
- crudType
64015
- }) => /* @__PURE__ */ React.createElement(
64016
- CreateBranchModal,
64017
- {
64018
- close: close2,
64019
- safeSubmit,
64020
- path: relativePath2,
64021
- values,
64022
- crudType
64023
- }
64024
- );
64025
64019
  const pathRelativeToCollection = (collectionPath, fullPath) => {
64026
64020
  const normalizedCollectionPath = collectionPath.replace(/\\/g, "/");
64027
64021
  const normalizedFullPath = fullPath.replace(/\\/g, "/");
@@ -64050,7 +64044,6 @@ const CreateBranchModal = ({
64050
64044
  const [isExecuting, setIsExecuting] = React.useState(false);
64051
64045
  const [errorMessage, setErrorMessage] = React.useState("");
64052
64046
  const [currentStep, setCurrentStep] = React.useState(0);
64053
- const [statusMessage, setStatusMessage] = React.useState("");
64054
64047
  const [elapsedTime, setElapsedTime] = React.useState(0);
64055
64048
  React.useEffect(() => {
64056
64049
  let interval;
@@ -64094,7 +64087,6 @@ const CreateBranchModal = ({
64094
64087
  setDisabled(true);
64095
64088
  setIsExecuting(true);
64096
64089
  setCurrentStep(1);
64097
- setStatusMessage("Initializing workflow...");
64098
64090
  let graphql2 = "";
64099
64091
  if (crudType === "create") {
64100
64092
  graphql2 = CREATE_DOCUMENT_GQL;
@@ -64119,8 +64111,6 @@ const CreateBranchModal = ({
64119
64111
  }
64120
64112
  },
64121
64113
  onStatusUpdate: (status) => {
64122
- const message = status.message || `Status: ${status.status}`;
64123
- setStatusMessage(message);
64124
64114
  switch (status.status) {
64125
64115
  case EDITORIAL_WORKFLOW_STATUS.SETTING_UP:
64126
64116
  case EDITORIAL_WORKFLOW_STATUS.CREATING_BRANCH:
@@ -64157,9 +64147,7 @@ const CreateBranchModal = ({
64157
64147
  }
64158
64148
  };
64159
64149
  const renderProgressIndicator = () => {
64160
- var _a2;
64161
- const progressPercentage = (currentStep - 1) / steps.length * 100;
64162
- return /* @__PURE__ */ React.createElement("div", { className: "py-6" }, /* @__PURE__ */ React.createElement("div", { className: "flex justify-between mb-4 relative px-5 sm:gap-x-8" }, /* @__PURE__ */ React.createElement(
64150
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", { className: "flex justify-between my-8 relative px-5 sm:gap-x-8" }, /* @__PURE__ */ React.createElement(
64163
64151
  "div",
64164
64152
  {
64165
64153
  className: "absolute top-5 h-0.5 bg-gray-200 -z-10",
@@ -64168,7 +64156,7 @@ const CreateBranchModal = ({
64168
64156
  ), currentStep > 1 && currentStep <= steps.length && /* @__PURE__ */ React.createElement(
64169
64157
  "div",
64170
64158
  {
64171
- className: "absolute top-5 h-0.5 bg-blue-500 -z-10 transition-all duration-500",
64159
+ className: "absolute top-5 h-0.5 bg-tina-orange -z-10 transition-all duration-500",
64172
64160
  style: {
64173
64161
  left: "50px",
64174
64162
  width: `calc((100% - 100px) * ${(currentStep - 1) / (steps.length - 1)})`
@@ -64196,7 +64184,7 @@ const CreateBranchModal = ({
64196
64184
  /* @__PURE__ */ React.createElement(
64197
64185
  "div",
64198
64186
  {
64199
- className: `w-10 h-10 rounded-full flex items-center justify-center font-medium mb-3 border-2 transition-all duration-300 ${isCompleted ? "bg-green-500 border-green-500 text-white" : isActive ? "bg-blue-500 border-blue-500 text-white" : "bg-white border-gray-200 text-gray-400"}`
64187
+ className: `w-10 h-10 rounded-full flex items-center justify-center font-medium mb-3 border-2 transition-all duration-300 select-none ${isCompleted ? "bg-green-500 border-green-500 text-white" : isActive ? "bg-tina-orange border-tina-orange text-white" : "bg-white border-gray-200 text-gray-400"}`
64200
64188
  },
64201
64189
  isCompleted ? /* @__PURE__ */ React.createElement(
64202
64190
  "svg",
@@ -64217,7 +64205,7 @@ const CreateBranchModal = ({
64217
64205
  ),
64218
64206
  /* @__PURE__ */ React.createElement("div", { className: "text-center max-w-24" }, /* @__PURE__ */ React.createElement("div", { className: "text-sm font-semibold leading-tight" }, step.name), /* @__PURE__ */ React.createElement("div", { className: "text-xs text-gray-400 mt-1 leading-tight" }, step.description))
64219
64207
  );
64220
- })), /* @__PURE__ */ React.createElement("div", { className: "flex items-center justify-between mb-4" }, /* @__PURE__ */ React.createElement("div", { className: "text-sm font-medium text-gray-700" }, "Step ", currentStep > steps.length ? steps.length : currentStep, " of", " ", steps.length), isExecuting && currentStep > 0 && /* @__PURE__ */ React.createElement("div", { className: "flex items-center gap-1 text-sm text-gray-500" }, /* @__PURE__ */ React.createElement("svg", { className: "w-4 h-4", fill: "currentColor", viewBox: "0 0 20 20" }, /* @__PURE__ */ React.createElement(
64208
+ })), /* @__PURE__ */ React.createElement("div", { className: "flex items-center justify-between" }, /* @__PURE__ */ React.createElement("div", { className: "text-xs text-gray-500" }, "Estimated time: 1-2 min "), isExecuting && currentStep > 0 && /* @__PURE__ */ React.createElement("div", { className: "flex items-center gap-1 text-sm text-gray-500" }, /* @__PURE__ */ React.createElement("svg", { className: "w-4 h-4", fill: "currentColor", viewBox: "0 0 20 20" }, /* @__PURE__ */ React.createElement(
64221
64209
  "path",
64222
64210
  {
64223
64211
  fillRule: "evenodd",
@@ -64225,28 +64213,14 @@ const CreateBranchModal = ({
64225
64213
  clipRule: "evenodd"
64226
64214
  }
64227
64215
  )), formatTime(elapsedTime))), /* @__PURE__ */ React.createElement(
64228
- ProgressBar,
64229
- {
64230
- progress: progressPercentage,
64231
- className: "mb-4",
64232
- color: currentStep > steps.length ? "green" : "blue"
64233
- }
64234
- ), /* @__PURE__ */ React.createElement("div", { className: "flex items-center gap-2 mb-2" }, currentStep >= 4 ? /* @__PURE__ */ React.createElement(
64235
- "svg",
64216
+ "a",
64236
64217
  {
64237
- className: "w-4 h-4 text-green-500",
64238
- fill: "currentColor",
64239
- viewBox: "0 0 20 20"
64218
+ className: "underline text-tina-orange-dark font-medium text-xs",
64219
+ href: "https://tina.io/docs/tinacloud/editorial-workflow",
64220
+ target: "_blank"
64240
64221
  },
64241
- /* @__PURE__ */ React.createElement(
64242
- "path",
64243
- {
64244
- fillRule: "evenodd",
64245
- d: "M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",
64246
- clipRule: "evenodd"
64247
- }
64248
- )
64249
- ) : /* @__PURE__ */ React.createElement(AiOutlineLoading, { className: "text-blue-500 animate-spin" }), /* @__PURE__ */ React.createElement("span", { className: "text-sm font-medium text-gray-700" }, statusMessage || `${(_a2 = steps[currentStep - 1]) == null ? void 0 : _a2.name}...`)), /* @__PURE__ */ React.createElement("div", { className: "text-left" }, /* @__PURE__ */ React.createElement("p", { className: "text-xs text-gray-500" }, "Estimated time: 1-2 minutes")));
64222
+ "Learn more about Editorial Workflow"
64223
+ ));
64250
64224
  };
64251
64225
  const renderStateContent = () => {
64252
64226
  if (isExecuting) {
@@ -64269,14 +64243,13 @@ const CreateBranchModal = ({
64269
64243
  value: newBranchName,
64270
64244
  onChange: (e3) => {
64271
64245
  setErrorMessage("");
64272
- setStatusMessage("");
64273
64246
  setNewBranchName(e3.target.value);
64274
64247
  }
64275
64248
  }
64276
64249
  ));
64277
64250
  }
64278
64251
  };
64279
- return /* @__PURE__ */ React.createElement(Modal, { className: "flex" }, /* @__PURE__ */ React.createElement(PopupModal, { className: "w-auto" }, /* @__PURE__ */ React.createElement(ModalHeader, { close: isExecuting ? void 0 : close2 }, /* @__PURE__ */ React.createElement("div", { className: "flex items-center justify-between w-full" }, /* @__PURE__ */ React.createElement("div", { className: "flex items-center" }, /* @__PURE__ */ React.createElement(TinaIcon, { className: "w-8 h-auto mr-1 text-blue-500 text-tina-orange" }), "Save changes to new branch"))), /* @__PURE__ */ React.createElement(ModalBody, { padded: true }, renderStateContent()), !isExecuting && /* @__PURE__ */ React.createElement(ModalActions, { align: "end" }, /* @__PURE__ */ React.createElement(Button$1, { variant: "secondary", className: "w-full sm:w-auto" }, "Cancel"), /* @__PURE__ */ React.createElement(
64252
+ return /* @__PURE__ */ React.createElement(Modal, { className: "flex" }, /* @__PURE__ */ React.createElement(PopupModal, { className: "w-auto" }, /* @__PURE__ */ React.createElement(ModalHeader, { close: isExecuting ? void 0 : close2 }, /* @__PURE__ */ React.createElement("div", { className: "flex items-center justify-between w-full" }, /* @__PURE__ */ React.createElement("div", { className: "flex items-center" }, "Save changes to new branch"))), /* @__PURE__ */ React.createElement(ModalBody, { padded: true }, renderStateContent()), !isExecuting && /* @__PURE__ */ React.createElement(ModalActions, { align: "end" }, /* @__PURE__ */ React.createElement(Button$1, { variant: "secondary", className: "w-full sm:w-auto" }, "Cancel"), /* @__PURE__ */ React.createElement(
64280
64253
  DropdownButton,
64281
64254
  {
64282
64255
  variant: "primary",
@@ -64320,6 +64293,217 @@ const PrefixedTextField = ({
64320
64293
  }
64321
64294
  )));
64322
64295
  };
64296
+ const NoFieldsPlaceholder = () => /* @__PURE__ */ React.createElement(
64297
+ "div",
64298
+ {
64299
+ className: "relative flex flex-col items-center justify-center text-center p-5 pb-16 w-full h-full overflow-y-auto",
64300
+ style: {
64301
+ animationName: "fade-in",
64302
+ animationDelay: "300ms",
64303
+ animationTimingFunction: "ease-out",
64304
+ animationIterationCount: 1,
64305
+ animationFillMode: "both",
64306
+ animationDuration: "150ms"
64307
+ }
64308
+ },
64309
+ /* @__PURE__ */ React.createElement(Emoji, { className: "block pb-5" }, "🤔"),
64310
+ /* @__PURE__ */ React.createElement("h3", { className: "font-sans font-normal text-lg block pb-5" }, "Hey, you don't have any fields added to this form."),
64311
+ /* @__PURE__ */ React.createElement("p", { className: "block pb-5" }, /* @__PURE__ */ React.createElement(
64312
+ "a",
64313
+ {
64314
+ className: "text-center rounded-3xl border border-solid border-gray-100 shadow-[0_2px_3px_rgba(0,0,0,0.12)] font-normal cursor-pointer text-[12px] transition-all duration-100 ease-out bg-white text-gray-700 py-3 pr-5 pl-14 relative no-underline inline-block hover:text-blue-500",
64315
+ href: "https://tinacms.org/docs/fields",
64316
+ target: "_blank",
64317
+ rel: "noopener noreferrer"
64318
+ },
64319
+ /* @__PURE__ */ React.createElement(
64320
+ Emoji,
64321
+ {
64322
+ className: "absolute left-5 top-1/2 origin-center -translate-y-1/2 transition-all duration-100 ease-out",
64323
+ style: { fontSize: 24 }
64324
+ },
64325
+ "📖"
64326
+ ),
64327
+ " ",
64328
+ "Field Setup Guide"
64329
+ ))
64330
+ );
64331
+ const FormKeyBindings = ({ onSubmit }) => {
64332
+ useEffect(() => {
64333
+ const handleKeyDown = (e3) => {
64334
+ if ((e3.metaKey || e3.ctrlKey) && e3.key === "s") {
64335
+ e3.preventDefault();
64336
+ onSubmit();
64337
+ }
64338
+ };
64339
+ window.addEventListener("keydown", handleKeyDown);
64340
+ return () => window.removeEventListener("keydown", handleKeyDown);
64341
+ }, [onSubmit]);
64342
+ return null;
64343
+ };
64344
+ const FormBuilder = ({
64345
+ form,
64346
+ onPristineChange,
64347
+ ...rest
64348
+ }) => {
64349
+ const cms = useCMS$1();
64350
+ const hideFooter = !!rest.hideFooter;
64351
+ const [createBranchModalOpen, setCreateBranchModalOpen] = React.useState(false);
64352
+ const tinaForm = form.tinaForm;
64353
+ const finalForm = form.tinaForm.finalForm;
64354
+ React.useEffect(() => {
64355
+ var _a2;
64356
+ const collection = cms.api.tina.schema.getCollectionByFullPath(
64357
+ tinaForm.path
64358
+ );
64359
+ if ((_a2 = collection == null ? void 0 : collection.ui) == null ? void 0 : _a2.beforeSubmit) {
64360
+ tinaForm.beforeSubmit = (values) => collection.ui.beforeSubmit({ cms, form: tinaForm, values });
64361
+ } else {
64362
+ tinaForm.beforeSubmit = void 0;
64363
+ }
64364
+ }, [tinaForm.path]);
64365
+ const moveArrayItem = React.useCallback(
64366
+ (result) => {
64367
+ if (!result.destination || !finalForm)
64368
+ return;
64369
+ const name = result.type;
64370
+ finalForm.mutators.move(
64371
+ name,
64372
+ result.source.index,
64373
+ result.destination.index
64374
+ );
64375
+ },
64376
+ [tinaForm]
64377
+ );
64378
+ React.useEffect(() => {
64379
+ const unsubscribe = finalForm.subscribe(
64380
+ ({ pristine }) => {
64381
+ if (onPristineChange) {
64382
+ onPristineChange(pristine);
64383
+ }
64384
+ },
64385
+ { pristine: true }
64386
+ );
64387
+ return () => {
64388
+ unsubscribe();
64389
+ };
64390
+ }, [finalForm]);
64391
+ const fieldGroup = tinaForm.getActiveField(form.activeFieldName);
64392
+ return /* @__PURE__ */ React.createElement(
64393
+ Form$1,
64394
+ {
64395
+ key: tinaForm.id,
64396
+ form: tinaForm.finalForm,
64397
+ onSubmit: tinaForm.onSubmit
64398
+ },
64399
+ ({
64400
+ handleSubmit,
64401
+ pristine,
64402
+ invalid,
64403
+ submitting,
64404
+ dirtySinceLastSubmit,
64405
+ hasValidationErrors
64406
+ }) => {
64407
+ const usingProtectedBranch = cms.api.tina.usingProtectedBranch();
64408
+ const canSubmit = !pristine && !submitting && !hasValidationErrors && !(invalid && !dirtySinceLastSubmit);
64409
+ const safeSubmit = async () => {
64410
+ if (canSubmit) {
64411
+ await handleSubmit();
64412
+ }
64413
+ };
64414
+ const safeHandleSubmit = async () => {
64415
+ if (usingProtectedBranch) {
64416
+ setCreateBranchModalOpen(true);
64417
+ } else {
64418
+ safeSubmit();
64419
+ }
64420
+ };
64421
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, createBranchModalOpen && /* @__PURE__ */ React.createElement(
64422
+ CreateBranchModal,
64423
+ {
64424
+ safeSubmit,
64425
+ crudType: tinaForm.crudType,
64426
+ path: tinaForm.path,
64427
+ values: tinaForm.values,
64428
+ close: () => setCreateBranchModalOpen(false)
64429
+ }
64430
+ ), /* @__PURE__ */ React.createElement(DragDropContext, { onDragEnd: moveArrayItem }, /* @__PURE__ */ React.createElement(FormKeyBindings, { onSubmit: safeHandleSubmit }), /* @__PURE__ */ React.createElement(FormPortalProvider, null, /* @__PURE__ */ React.createElement(FormWrapper, { id: tinaForm.id }, (tinaForm == null ? void 0 : tinaForm.fields.length) ? /* @__PURE__ */ React.createElement(
64431
+ FieldsBuilder,
64432
+ {
64433
+ form: tinaForm,
64434
+ activeFieldName: form.activeFieldName,
64435
+ fields: fieldGroup.fields
64436
+ }
64437
+ ) : /* @__PURE__ */ React.createElement(NoFieldsPlaceholder, null))), !hideFooter && /* @__PURE__ */ React.createElement("div", { className: "relative flex-none w-full h-16 px-6 bg-white border-t border-gray-100 flex items-center justify-end" }, /* @__PURE__ */ React.createElement("div", { className: "flex-1 w-full justify-end gap-2 flex items-center max-w-form" }, tinaForm.reset && /* @__PURE__ */ React.createElement(
64438
+ ResetForm,
64439
+ {
64440
+ pristine,
64441
+ reset: async () => {
64442
+ finalForm.reset();
64443
+ await tinaForm.reset();
64444
+ }
64445
+ },
64446
+ tinaForm.buttons.reset
64447
+ ), /* @__PURE__ */ React.createElement(
64448
+ Button$1,
64449
+ {
64450
+ onClick: safeHandleSubmit,
64451
+ disabled: !canSubmit,
64452
+ busy: submitting,
64453
+ variant: "primary"
64454
+ },
64455
+ submitting && /* @__PURE__ */ React.createElement(LoadingDots, null),
64456
+ !submitting && tinaForm.buttons.save
64457
+ ), tinaForm.actions.length > 0 && /* @__PURE__ */ React.createElement(
64458
+ FormActionMenu,
64459
+ {
64460
+ form: tinaForm,
64461
+ actions: tinaForm.actions
64462
+ }
64463
+ )))));
64464
+ }
64465
+ );
64466
+ };
64467
+ const FormStatus = ({ pristine }) => {
64468
+ const pristineClass = pristine ? "text-green-500" : "text-red-500";
64469
+ return /* @__PURE__ */ React.createElement(FaCircle, { className: cn("h-3", pristineClass) });
64470
+ };
64471
+ const FormWrapper = ({
64472
+ id: id2,
64473
+ children
64474
+ }) => {
64475
+ return /* @__PURE__ */ React.createElement(
64476
+ "div",
64477
+ {
64478
+ "data-test": `form:${id2 == null ? void 0 : id2.replace(/\\/g, "/")}`,
64479
+ className: "h-full overflow-y-auto max-h-full bg-gray-50"
64480
+ },
64481
+ /* @__PURE__ */ React.createElement("div", { className: "py-5 px-6" }, children)
64482
+ );
64483
+ };
64484
+ const Emoji = ({ className = "", ...props }) => /* @__PURE__ */ React.createElement(
64485
+ "span",
64486
+ {
64487
+ className: `text-[40px] leading-none inline-block ${className}`,
64488
+ ...props
64489
+ }
64490
+ );
64491
+ const CreateBranchModel = ({
64492
+ close: close2,
64493
+ safeSubmit,
64494
+ relativePath: relativePath2,
64495
+ values,
64496
+ crudType
64497
+ }) => /* @__PURE__ */ React.createElement(
64498
+ CreateBranchModal,
64499
+ {
64500
+ close: close2,
64501
+ safeSubmit,
64502
+ path: relativePath2,
64503
+ values,
64504
+ crudType
64505
+ }
64506
+ );
64323
64507
  const NestedForm = (props) => {
64324
64508
  const FormPortal = useFormPortal();
64325
64509
  const id2 = React__default.useMemo(() => uuid(), [props.id, props.initialValues]);
@@ -120427,10 +120611,12 @@ const slugify = (text) => {
120427
120611
  };
120428
120612
  const Sidebar = ({ cms }) => {
120429
120613
  var _a2, _b;
120614
+ const location = useLocation();
120430
120615
  const collectionsInfo = useGetCollections(cms);
120431
120616
  const screens = cms.plugins.getType("screen").all();
120432
120617
  const cloudConfigs = cms.plugins.getType("cloud-config").all();
120433
- const [menuIsOpen, setMenuIsOpen] = React__default.useState(false);
120618
+ const isOnDashboard = location.pathname === "/";
120619
+ const [menuIsOpen, setMenuIsOpen] = React__default.useState(isOnDashboard);
120434
120620
  const isLocalMode = (_b = (_a2 = cms.api) == null ? void 0 : _a2.tina) == null ? void 0 : _b.isLocalMode;
120435
120621
  const activeScreens = screens.filter(
120436
120622
  (screen) => {
@@ -120674,7 +120860,7 @@ const PageWrapper = ({
120674
120860
  headerClassName,
120675
120861
  children
120676
120862
  }) => {
120677
- return /* @__PURE__ */ React__default.createElement("div", { className: "relative left-0 w-full h-full bg-gradient-to-b from-gray-50/50 to-gray-50 overflow-y-auto transition-opacity duration-300 ease-out flex flex-col opacity-100" }, /* @__PURE__ */ React__default.createElement("div", { className: `py-2 pr-4 w-full ${headerClassName}` }, /* @__PURE__ */ React__default.createElement(LocalWarning, null), /* @__PURE__ */ React__default.createElement(BillingWarning, null), /* @__PURE__ */ React__default.createElement("div", { className: "flex items-center gap-4" }, /* @__PURE__ */ React__default.createElement(TinaIcon, { className: "self-center h-10 min-w-10 w-auto text-orange-500" }), /* @__PURE__ */ React__default.createElement(BranchButton, null), /* @__PURE__ */ React__default.createElement(BranchPreviewButton, null))), children);
120863
+ return /* @__PURE__ */ React__default.createElement("div", { className: "relative left-0 w-full h-full bg-gradient-to-b from-gray-50/50 to-gray-50 overflow-y-auto transition-opacity duration-300 ease-out flex flex-col opacity-100" }, /* @__PURE__ */ React__default.createElement("div", { className: `py-2 pr-4 w-full ${headerClassName}` }, /* @__PURE__ */ React__default.createElement(BillingWarning, null), /* @__PURE__ */ React__default.createElement("div", { className: "flex items-center gap-4" }, /* @__PURE__ */ React__default.createElement(TinaIcon, { className: "self-center h-10 min-w-10 w-auto text-orange-500" }), /* @__PURE__ */ React__default.createElement(LocalWarning, null), /* @__PURE__ */ React__default.createElement(BranchButton, null), /* @__PURE__ */ React__default.createElement(BranchPreviewButton, null))), children);
120678
120864
  };
120679
120865
  const PageHeader = ({
120680
120866
  children
@@ -120742,7 +120928,7 @@ const TemplateMenu = ({
120742
120928
  folder,
120743
120929
  collectionName
120744
120930
  }) => {
120745
- return /* @__PURE__ */ React__default.createElement(Menu, { as: "div", className: "relative inline-block text-left" }, () => /* @__PURE__ */ React__default.createElement("div", null, /* @__PURE__ */ React__default.createElement("div", null, /* @__PURE__ */ React__default.createElement(MenuButton, { className: "icon-parent inline-flex items-center font-medium focus:outline-none focus:ring-2 focus:shadow-outline text-center rounded justify-center transition-all duration-150 ease-out shadow text-white bg-blue-500 hover:bg-blue-600 focus:ring-blue-500 text-sm h-10 px-6" }, "Create New ", /* @__PURE__ */ React__default.createElement(BiPlus, { className: "w-5 h-full ml-1 opacity-70" }))), /* @__PURE__ */ React__default.createElement(
120931
+ return /* @__PURE__ */ React__default.createElement(Menu, { as: "div", className: "relative inline-block text-left w-full md:w-auto" }, () => /* @__PURE__ */ React__default.createElement("div", null, /* @__PURE__ */ React__default.createElement("div", null, /* @__PURE__ */ React__default.createElement(MenuButton, { className: "w-full md:w-auto icon-parent inline-flex items-center font-medium focus:outline-none focus:ring-2 focus:shadow-outline text-center rounded justify-center transition-all duration-150 ease-out shadow text-white bg-tina-orange-dark hover:bg-tina-orange focus:ring-tina-orange-dark text-sm h-10 px-6" }, "Create New ", /* @__PURE__ */ React__default.createElement(BiPlus, { className: "w-5 h-full ml-1 opacity-70" }))), /* @__PURE__ */ React__default.createElement(
120746
120932
  Transition,
120747
120933
  {
120748
120934
  enter: "transition ease-out duration-100",
@@ -120870,6 +121056,9 @@ const CollectionListPage = () => {
120870
121056
  booleanEquals: null
120871
121057
  }));
120872
121058
  }, [collectionName]);
121059
+ const tableRowStyle = "hover:bg-gray-50/50 border-b-2 border-gray-50 transition-colors duration-300";
121060
+ const tableHeadingCellStyle = "px-3 py-3 text-left text-xs font-bold text-gray-700 tracking-wider";
121061
+ const tableHeadingStyle2 = "bg-gray-100 border-b-2 border-gray-200";
120873
121062
  return /* @__PURE__ */ React__default.createElement(GetCMS, null, (cms) => {
120874
121063
  return /* @__PURE__ */ React__default.createElement(PageWrapper, null, /* @__PURE__ */ React__default.createElement(
120875
121064
  GetCollection,
@@ -120899,7 +121088,7 @@ const CollectionListPage = () => {
120899
121088
  search
120900
121089
  },
120901
121090
  (collection, _loading, reFetchCollection, collectionExtra) => {
120902
- var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j;
121091
+ var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
120903
121092
  const documents = collection.documents.edges;
120904
121093
  const admin = cms.api.admin;
120905
121094
  const pageInfo = collection.documents.pageInfo;
@@ -121034,6 +121223,7 @@ const CollectionListPage = () => {
121034
121223
  return { ...vars2, folderName };
121035
121224
  });
121036
121225
  },
121226
+ validationRegex: (_m = (_l = (_k = cms.api.tina) == null ? void 0 : _k.schema.config.config.ui) == null ? void 0 : _l.regexValidation) == null ? void 0 : _m.folderNameRegex,
121037
121227
  createFunc: async () => {
121038
121228
  try {
121039
121229
  admin.createFolder(
@@ -121066,7 +121256,7 @@ const CollectionListPage = () => {
121066
121256
  },
121067
121257
  close: () => setFolderModalOpen(false)
121068
121258
  }
121069
- ), /* @__PURE__ */ React__default.createElement(PageHeader, null, /* @__PURE__ */ React__default.createElement("div", { className: "w-full" }, /* @__PURE__ */ React__default.createElement("h3", { className: "font-sans text-2xl text-tina-orange" }, collection.label ? collection.label : collection.name), /* @__PURE__ */ React__default.createElement("div", { className: "flex flex-col lg:flex-row justify-between lg:items-end pt-2" }, /* @__PURE__ */ React__default.createElement("div", { className: "flex flex-col md:flex-row gap-2 md:gap-4 items-baseline" }, (fields == null ? void 0 : fields.length) > 0 && /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, !search && /* @__PURE__ */ React__default.createElement("div", { className: "flex flex-col gap-2 items-start w-full md:w-auto" }, /* @__PURE__ */ React__default.createElement(
121259
+ ), /* @__PURE__ */ React__default.createElement(PageHeader, null, /* @__PURE__ */ React__default.createElement("div", { className: "w-full mx-auto max-w-screen-xl" }, /* @__PURE__ */ React__default.createElement("h3", { className: "font-sans text-2xl text-tina-orange" }, collection.label ? collection.label : collection.name), /* @__PURE__ */ React__default.createElement("div", { className: "flex flex-col lg:flex-row justify-between lg:items-end pt-2" }, /* @__PURE__ */ React__default.createElement("div", { className: "flex flex-col md:flex-row gap-2 md:gap-4" }, (fields == null ? void 0 : fields.length) > 0 && /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, !search && /* @__PURE__ */ React__default.createElement("div", { className: "flex flex-col gap-2 items-start w-full md:w-auto" }, /* @__PURE__ */ React__default.createElement(
121070
121260
  "label",
121071
121261
  {
121072
121262
  htmlFor: "sort",
@@ -121138,7 +121328,7 @@ const CollectionListPage = () => {
121138
121328
  className: "underline hover:text-blue-700 transition-all duration-150"
121139
121329
  },
121140
121330
  "Read the docs"
121141
- ))))), allowCreate && /* @__PURE__ */ React__default.createElement("div", { className: "flex flex-col md:flex-row items-start md:items-end gap-2 md:gap-0 pt-4 lg:pt-0" }, allowCreateNestedFolder && /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(TooltipProvider, null, /* @__PURE__ */ React__default.createElement(Tooltip, null, /* @__PURE__ */ React__default.createElement(TooltipTrigger, { asChild: true }, /* @__PURE__ */ React__default.createElement("span", null, /* @__PURE__ */ React__default.createElement(
121331
+ ))))), allowCreate && /* @__PURE__ */ React__default.createElement("div", { className: "flex flex-col md:flex-row items-start md:items-end gap-2 md:gap-0 pt-4 lg:pt-0" }, allowCreateNestedFolder && /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(TooltipProvider, null, /* @__PURE__ */ React__default.createElement(Tooltip, null, /* @__PURE__ */ React__default.createElement(TooltipTrigger, { asChild: true }, /* @__PURE__ */ React__default.createElement(
121142
121332
  Link$1,
121143
121333
  {
121144
121334
  onMouseDown: (evt) => {
@@ -121156,7 +121346,7 @@ const CollectionListPage = () => {
121156
121346
  },
121157
121347
  to: "/collections/new-folder",
121158
121348
  className: cn$1(
121159
- "icon-parent inline-flex items-center font-medium focus:outline-none focus:ring-2 focus:shadow-outline text-center rounded justify-center transition-all duration-150 ease-out whitespace-nowrap shadow text-gray-500 hover:tina-orange-dark bg-white hover:bg-gray-50 border border-gray-100 focus:ring-white focus:ring-tina-orange-dark w-full md:w-auto text-sm h-10 px-6 mr-4",
121349
+ "icon-parent inline-flex items-center font-medium focus:outline-none focus:ring-2 focus:shadow-outline text-center rounded justify-center transition-all duration-150 ease-out whitespace-nowrap shadow text-gray-500 bg-white hover:bg-gray-50 border border-gray-100 focus:ring-white focus:ring-blue-500 w-full md:w-auto text-sm h-10 px-6 mr-4",
121160
121350
  collection.templates && "opacity-50 pointer-events-none cursor-not-allowed"
121161
121351
  ),
121162
121352
  "aria-disabled": !!collection.templates,
@@ -121164,7 +121354,7 @@ const CollectionListPage = () => {
121164
121354
  },
121165
121355
  /* @__PURE__ */ React__default.createElement(FaFolder, { className: "mr-2" }),
121166
121356
  "Add Folder"
121167
- ))), collection.templates && /* @__PURE__ */ React__default.createElement(
121357
+ )), collection.templates && /* @__PURE__ */ React__default.createElement(
121168
121358
  TooltipContent,
121169
121359
  {
121170
121360
  side: "top",
@@ -121205,175 +121395,225 @@ const CollectionListPage = () => {
121205
121395
  templates: collection.templates,
121206
121396
  folder
121207
121397
  }
121208
- ))))), /* @__PURE__ */ React__default.createElement(PageBody, null, /* @__PURE__ */ React__default.createElement("div", { className: "w-full mx-auto max-w-screen-xl" }, sortField && !sortField.required && /* @__PURE__ */ React__default.createElement("p", { className: "mb-4 text-gray-500" }, /* @__PURE__ */ React__default.createElement("em", null, "Sorting on a non-required field. Some documents may be excluded (if they don't have a value for", " ", sortName, ")")), /* @__PURE__ */ React__default.createElement("div", { className: "w-full overflow-x-auto shadow-md rounded-md" }, (folder.name && !search || documents.length > 0) && /* @__PURE__ */ React__default.createElement("table", { className: "table-auto shadow bg-white border-b border-gray-200 w-full max-w-full rounded-lg" }, /* @__PURE__ */ React__default.createElement("tbody", null, folder.name && !search ? /* @__PURE__ */ React__default.createElement("tr", null, /* @__PURE__ */ React__default.createElement("td", { colSpan: 5 }, /* @__PURE__ */ React__default.createElement(
121209
- Breadcrumb,
121210
- {
121211
- folder,
121212
- navigate,
121213
- collectionName
121214
- }
121215
- ))) : null, documents.length > 0 && documents.map((document2) => {
121216
- var _a3;
121217
- if (document2.node.__typename === "Folder") {
121218
- return /* @__PURE__ */ React__default.createElement(
121219
- "tr",
121220
- {
121221
- key: `folder-${document2.node.path}`
121222
- },
121223
- /* @__PURE__ */ React__default.createElement("td", { className: "pl-5 pr-3 py-3" }, /* @__PURE__ */ React__default.createElement(
121224
- "a",
121225
- {
121226
- className: "text-blue-600 hover:text-blue-400 flex items-center gap-3 cursor-pointer truncate",
121227
- onClick: () => {
121228
- navigate(
121229
- `/${[
121230
- "collections",
121231
- collectionName,
121232
- document2.node.path
121233
- ].join("/")}`,
121234
- { replace: true }
121235
- );
121236
- }
121237
- },
121238
- /* @__PURE__ */ React__default.createElement(BiFolder, { className: "inline-block h-6 w-auto flex-shrink-0 opacity-70" }),
121239
- /* @__PURE__ */ React__default.createElement("span", { className: "truncate block" }, /* @__PURE__ */ React__default.createElement("span", { className: "block text-xs text-gray-400 mb-1 uppercase" }, "Name"), /* @__PURE__ */ React__default.createElement("span", { className: "h-5 leading-5 block truncate" }, /* @__PURE__ */ React__default.createElement("span", null, document2.node.name)))
121240
- )),
121241
- /* @__PURE__ */ React__default.createElement("td", { className: "px-3 py-3", colSpan: 4 }, /* @__PURE__ */ React__default.createElement("span", { className: "block text-xs text-gray-400 mb-1 uppercase" }, "Path"), /* @__PURE__ */ React__default.createElement("span", { className: "leading-5 block text-sm font-medium text-gray-900 truncate" }, document2.node.path.substring(2).split("/").map((node3) => {
121242
- return /* @__PURE__ */ React__default.createElement("span", { key: node3 }, /* @__PURE__ */ React__default.createElement("span", { className: "text-gray-300 pr-0.5" }, "/"), /* @__PURE__ */ React__default.createElement("span", { className: "pr-0.5" }, node3));
121243
- })))
121244
- );
121245
- }
121246
- const hasTitle = Boolean(
121247
- document2.node._sys.title
121398
+ ))))), /* @__PURE__ */ React__default.createElement(PageBody, null, /* @__PURE__ */ React__default.createElement("div", { className: "w-full mx-auto max-w-screen-xl" }, sortField && !sortField.required && /* @__PURE__ */ React__default.createElement("p", { className: "mb-4 text-gray-500" }, /* @__PURE__ */ React__default.createElement("em", null, "Sorting on a non-required field. Some documents may be excluded (if they don't have a value for", " ", sortName, ")")), /* @__PURE__ */ React__default.createElement("div", { className: "w-full overflow-x-auto shadow-md rounded-md" }, (folder.name && !search || documents.length > 0) && /* @__PURE__ */ React__default.createElement("table", { className: "table-auto shadow bg-white border border-gray-200 w-full max-w-full rounded-lg" }, (() => {
121399
+ const hasAnyDocuments = documents.some(
121400
+ (doc) => doc.node.__typename !== "Folder"
121248
121401
  );
121249
- const subfolders = document2.node._sys.breadcrumbs.slice(0, -1).join("/");
121250
- return /* @__PURE__ */ React__default.createElement(
121251
- "tr",
121402
+ const hasAnyFolders = documents.some(
121403
+ (doc) => doc.node.__typename === "Folder"
121404
+ );
121405
+ const hasAnyTitles = documents.some(
121406
+ (doc) => {
121407
+ var _a3;
121408
+ return doc.node.__typename !== "Folder" && Boolean((_a3 = doc.node._sys) == null ? void 0 : _a3.title);
121409
+ }
121410
+ );
121411
+ return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, hasAnyDocuments && /* @__PURE__ */ React__default.createElement("thead", { className: tableHeadingStyle2 }, /* @__PURE__ */ React__default.createElement("tr", null, /* @__PURE__ */ React__default.createElement(
121412
+ "th",
121252
121413
  {
121253
- className: "hover:bg-gray-100 transition-colors duration-300",
121254
- key: `document-${document2.node._sys.relativePath}`
121414
+ className: tableHeadingCellStyle,
121415
+ colSpan: hasAnyTitles ? 1 : 2
121255
121416
  },
121256
- /* @__PURE__ */ React__default.createElement(
121257
- "td",
121258
- {
121259
- className: "pl-5 pr-3 py-3",
121260
- colSpan: hasTitle ? 1 : 2
121261
- },
121262
- /* @__PURE__ */ React__default.createElement(
121263
- "a",
121417
+ hasAnyTitles ? "Title" : "Filename"
121418
+ ), hasAnyTitles && /* @__PURE__ */ React__default.createElement(
121419
+ "th",
121420
+ {
121421
+ className: tableHeadingCellStyle
121422
+ },
121423
+ "Filename"
121424
+ ), /* @__PURE__ */ React__default.createElement("th", { className: tableHeadingCellStyle }, "Extension"), /* @__PURE__ */ React__default.createElement("th", { className: tableHeadingCellStyle }, "Template"), /* @__PURE__ */ React__default.createElement("th", null))), !hasAnyDocuments && hasAnyFolders && /* @__PURE__ */ React__default.createElement("thead", { className: tableHeadingStyle2 }, /* @__PURE__ */ React__default.createElement("tr", null, /* @__PURE__ */ React__default.createElement("th", { className: tableHeadingCellStyle }, "Name"), /* @__PURE__ */ React__default.createElement(
121425
+ "th",
121426
+ {
121427
+ className: tableHeadingCellStyle,
121428
+ colSpan: 4
121429
+ },
121430
+ "Path"
121431
+ ))), /* @__PURE__ */ React__default.createElement("tbody", null, folder.name && !search ? /* @__PURE__ */ React__default.createElement("tr", null, /* @__PURE__ */ React__default.createElement("td", { colSpan: 5 }, /* @__PURE__ */ React__default.createElement(
121432
+ Breadcrumb,
121433
+ {
121434
+ folder,
121435
+ navigate,
121436
+ collectionName
121437
+ }
121438
+ ))) : null, documents.length > 0 && documents.map((document2) => {
121439
+ var _a3;
121440
+ if (document2.node.__typename === "Folder") {
121441
+ return /* @__PURE__ */ React__default.createElement(
121442
+ "tr",
121264
121443
  {
121265
- className: "text-blue-600 hover:text-blue-400 flex items-center gap-3 cursor-pointer truncate",
121266
- onClick: () => {
121267
- handleNavigate(
121268
- navigate,
121269
- cms,
121270
- collection,
121271
- collectionDefinition,
121272
- document2.node
121273
- );
121274
- }
121444
+ className: tableRowStyle,
121445
+ key: `folder-${document2.node.path}`
121275
121446
  },
121276
- /* @__PURE__ */ React__default.createElement(BiFile, { className: "inline-block h-6 w-auto flex-shrink-0 opacity-70" }),
121277
- /* @__PURE__ */ React__default.createElement("span", { className: "truncate block" }, /* @__PURE__ */ React__default.createElement("span", { className: "block text-xs text-gray-400 mb-1 uppercase" }, hasTitle ? "Title" : "Filename"), /* @__PURE__ */ React__default.createElement("span", { className: "h-5 leading-5 block truncate mb-1" }, !folderView && !hasTitle && subfolders && /* @__PURE__ */ React__default.createElement("span", { className: "text-xs text-gray-400" }, `${subfolders}/`), /* @__PURE__ */ React__default.createElement("span", null, hasTitle ? (_a3 = document2.node._sys) == null ? void 0 : _a3.title : document2.node._sys.filename)), /* @__PURE__ */ React__default.createElement("span", { className: "block text-xs text-gray-400" }, document2.node._sys.path))
121278
- )
121279
- ),
121280
- hasTitle && /* @__PURE__ */ React__default.createElement("td", { className: "px-3 py-3" }, /* @__PURE__ */ React__default.createElement("span", { className: "block text-xs text-gray-400 mb-1 uppercase" }, "Filename"), /* @__PURE__ */ React__default.createElement("span", { className: "h-5 leading-5 block text-sm font-medium text-gray-900 truncate" }, !folderView && subfolders && /* @__PURE__ */ React__default.createElement("span", { className: "text-xs text-gray-400" }, `${subfolders}/`), /* @__PURE__ */ React__default.createElement("span", null, document2.node._sys.filename))),
121281
- /* @__PURE__ */ React__default.createElement("td", { className: "px-3 py-3" }, /* @__PURE__ */ React__default.createElement("span", { className: "block text-xs text-gray-400 mb-1 uppercase" }, "Extension"), /* @__PURE__ */ React__default.createElement("span", { className: "h-5 leading-5 block text-sm font-medium text-gray-900" }, document2.node._sys.extension)),
121282
- /* @__PURE__ */ React__default.createElement("td", { className: "px-3 py-3" }, /* @__PURE__ */ React__default.createElement("span", { className: "block text-xs text-gray-400 mb-1 uppercase" }, "Template"), /* @__PURE__ */ React__default.createElement("span", { className: "h-5 leading-5 block text-sm font-medium text-gray-900" }, document2.node._sys.template)),
121283
- /* @__PURE__ */ React__default.createElement("td", { className: "w-0" }, /* @__PURE__ */ React__default.createElement(
121284
- OverflowMenu$1,
121285
- {
121286
- toolbarItems: [
121447
+ /* @__PURE__ */ React__default.createElement("td", { className: "pl-5 pr-3 py-3" }, /* @__PURE__ */ React__default.createElement(
121448
+ "a",
121287
121449
  {
121288
- name: "edit",
121289
- label: "Edit in Admin",
121290
- Icon: /* @__PURE__ */ React__default.createElement(BiEdit, { size: "1.3rem" }),
121291
- onMouseDown: () => {
121292
- const pathToDoc = document2.node._sys.breadcrumbs;
121293
- if (folder.fullyQualifiedName) {
121294
- pathToDoc.unshift("~");
121295
- }
121450
+ className: "text-blue-600 flex items-center gap-3 cursor-pointer truncate",
121451
+ onClick: () => {
121296
121452
  navigate(
121297
121453
  `/${[
121298
121454
  "collections",
121299
- "edit",
121300
121455
  collectionName,
121301
- ...pathToDoc
121456
+ document2.node.path
121302
121457
  ].join("/")}`,
121303
121458
  { replace: true }
121304
121459
  );
121305
121460
  }
121306
121461
  },
121307
- allowCreate && {
121308
- name: "duplicate",
121309
- label: "Duplicate",
121310
- Icon: /* @__PURE__ */ React__default.createElement(BiCopy, { size: "1.3rem" }),
121311
- onMouseDown: () => {
121312
- const pathToDoc = document2.node._sys.breadcrumbs;
121313
- if (folder.fullyQualifiedName) {
121314
- pathToDoc.unshift("~");
121315
- }
121316
- navigate(
121317
- `/${[
121318
- "collections",
121319
- "duplicate",
121320
- collectionName,
121321
- ...pathToDoc
121322
- ].join("/")}`,
121323
- { replace: true }
121324
- );
121325
- }
121462
+ /* @__PURE__ */ React__default.createElement(BiFolder, { className: "inline-block h-6 w-auto flex-shrink-0 opacity-70" }),
121463
+ /* @__PURE__ */ React__default.createElement("span", { className: "truncate block" }, /* @__PURE__ */ React__default.createElement("span", { className: "leading-5 block truncate" }, /* @__PURE__ */ React__default.createElement("span", null, document2.node.name)))
121464
+ )),
121465
+ /* @__PURE__ */ React__default.createElement(
121466
+ "td",
121467
+ {
121468
+ className: "px-3 py-3",
121469
+ colSpan: 4
121326
121470
  },
121327
- allowDelete && {
121328
- name: "rename",
121329
- label: "Rename",
121330
- Icon: /* @__PURE__ */ React__default.createElement(BiRename, { size: "1.3rem" }),
121331
- onMouseDown: () => {
121332
- setVars((old) => ({
121333
- ...old,
121334
- collection: collectionName,
121335
- relativePathWithoutExtension: document2.node._sys.breadcrumbs.join(
121336
- "/"
121337
- ),
121338
- relativePath: document2.node._sys.breadcrumbs.join(
121339
- "/"
121340
- ) + document2.node._sys.extension,
121341
- newRelativePath: ""
121342
- }));
121343
- setRenameModalOpen(true);
121471
+ /* @__PURE__ */ React__default.createElement("span", { className: "leading-5 block text-sm font-medium text-gray-400 truncate" }, document2.node.path.substring(2).split("/").map((node3) => {
121472
+ return /* @__PURE__ */ React__default.createElement("span", { key: node3 }, /* @__PURE__ */ React__default.createElement("span", { className: "text-gray-300 pr-0.5" }, "/"), /* @__PURE__ */ React__default.createElement("span", { className: "pr-0.5" }, node3));
121473
+ }))
121474
+ )
121475
+ );
121476
+ }
121477
+ const hasTitle = Boolean(
121478
+ document2.node._sys.title
121479
+ );
121480
+ const subfolders = document2.node._sys.breadcrumbs.slice(0, -1).join("/");
121481
+ return /* @__PURE__ */ React__default.createElement(
121482
+ "tr",
121483
+ {
121484
+ className: tableRowStyle,
121485
+ key: `document-${document2.node._sys.relativePath}`
121486
+ },
121487
+ /* @__PURE__ */ React__default.createElement(
121488
+ "td",
121489
+ {
121490
+ className: "pl-5 pr-3 py-3",
121491
+ colSpan: hasTitle ? 1 : 2
121492
+ },
121493
+ /* @__PURE__ */ React__default.createElement(
121494
+ "a",
121495
+ {
121496
+ className: "text-blue-600 flex items-center gap-3 cursor-pointer truncate",
121497
+ onClick: () => {
121498
+ handleNavigate(
121499
+ navigate,
121500
+ cms,
121501
+ collection,
121502
+ collectionDefinition,
121503
+ document2.node
121504
+ );
121344
121505
  }
121345
121506
  },
121346
- allowDelete && {
121347
- name: "delete",
121348
- label: "Delete",
121349
- Icon: /* @__PURE__ */ React__default.createElement(
121350
- BiTrash,
121351
- {
121352
- size: "1.3rem",
121353
- className: "text-red-500"
121507
+ /* @__PURE__ */ React__default.createElement(BiFile, { className: "inline-block h-6 w-auto flex-shrink-0 opacity-70" }),
121508
+ /* @__PURE__ */ React__default.createElement("span", { className: "truncate block" }, /* @__PURE__ */ React__default.createElement("span", { className: "leading-5 block truncate mb-1" }, !folderView && !hasTitle && subfolders && /* @__PURE__ */ React__default.createElement("span", { className: "text-xs text-gray-400" }, `${subfolders}/`), /* @__PURE__ */ React__default.createElement("span", null, hasTitle ? (_a3 = document2.node._sys) == null ? void 0 : _a3.title : document2.node._sys.filename)), /* @__PURE__ */ React__default.createElement("span", { className: "block text-xs text-gray-400" }, document2.node._sys.path))
121509
+ )
121510
+ ),
121511
+ hasTitle && /* @__PURE__ */ React__default.createElement("td", { className: "px-3 py-3" }, /* @__PURE__ */ React__default.createElement("span", { className: "leading-5 block text-sm font-medium text-gray-900 truncate" }, !folderView && subfolders && /* @__PURE__ */ React__default.createElement("span", { className: "text-xs text-gray-400" }, `${subfolders}/`), /* @__PURE__ */ React__default.createElement("span", null, document2.node._sys.filename))),
121512
+ /* @__PURE__ */ React__default.createElement("td", { className: "px-3 py-3" }, /* @__PURE__ */ React__default.createElement("span", { className: "leading-5 block text-sm font-medium text-gray-900" }, document2.node._sys.extension)),
121513
+ /* @__PURE__ */ React__default.createElement("td", { className: "px-3 py-3" }, /* @__PURE__ */ React__default.createElement("span", { className: "leading-5 block text-sm font-medium text-gray-900" }, document2.node._sys.template)),
121514
+ /* @__PURE__ */ React__default.createElement("td", { className: "w-0" }, /* @__PURE__ */ React__default.createElement(
121515
+ OverflowMenu$1,
121516
+ {
121517
+ toolbarItems: [
121518
+ {
121519
+ name: "edit",
121520
+ label: "Edit in Admin",
121521
+ Icon: /* @__PURE__ */ React__default.createElement(BiEdit, { size: "1.3rem" }),
121522
+ onMouseDown: () => {
121523
+ const pathToDoc = document2.node._sys.breadcrumbs;
121524
+ if (folder.fullyQualifiedName) {
121525
+ pathToDoc.unshift(
121526
+ "~"
121527
+ );
121528
+ }
121529
+ navigate(
121530
+ `/${[
121531
+ "collections",
121532
+ "edit",
121533
+ collectionName,
121534
+ ...pathToDoc
121535
+ ].join("/")}`,
121536
+ { replace: true }
121537
+ );
121538
+ }
121539
+ },
121540
+ allowCreate && {
121541
+ name: "duplicate",
121542
+ label: "Duplicate",
121543
+ Icon: /* @__PURE__ */ React__default.createElement(BiCopy, { size: "1.3rem" }),
121544
+ onMouseDown: () => {
121545
+ const pathToDoc = document2.node._sys.breadcrumbs;
121546
+ if (folder.fullyQualifiedName) {
121547
+ pathToDoc.unshift(
121548
+ "~"
121549
+ );
121550
+ }
121551
+ navigate(
121552
+ `/${[
121553
+ "collections",
121554
+ "duplicate",
121555
+ collectionName,
121556
+ ...pathToDoc
121557
+ ].join("/")}`,
121558
+ { replace: true }
121559
+ );
121560
+ }
121561
+ },
121562
+ allowDelete && {
121563
+ name: "rename",
121564
+ label: "Rename",
121565
+ Icon: /* @__PURE__ */ React__default.createElement(BiRename, { size: "1.3rem" }),
121566
+ onMouseDown: () => {
121567
+ setVars((old) => ({
121568
+ ...old,
121569
+ collection: collectionName,
121570
+ relativePathWithoutExtension: document2.node._sys.breadcrumbs.join(
121571
+ "/"
121572
+ ),
121573
+ relativePath: document2.node._sys.breadcrumbs.join(
121574
+ "/"
121575
+ ) + document2.node._sys.extension,
121576
+ newRelativePath: ""
121577
+ }));
121578
+ setRenameModalOpen(
121579
+ true
121580
+ );
121581
+ }
121582
+ },
121583
+ allowDelete && {
121584
+ name: "delete",
121585
+ label: "Delete",
121586
+ Icon: /* @__PURE__ */ React__default.createElement(
121587
+ BiTrash,
121588
+ {
121589
+ size: "1.3rem",
121590
+ className: "text-red-500"
121591
+ }
121592
+ ),
121593
+ className: "text-red-500",
121594
+ onMouseDown: () => {
121595
+ setVars((old) => ({
121596
+ ...old,
121597
+ collection: collectionName,
121598
+ relativePathWithoutExtension: document2.node._sys.breadcrumbs.join(
121599
+ "/"
121600
+ ),
121601
+ relativePath: document2.node._sys.breadcrumbs.join(
121602
+ "/"
121603
+ ) + document2.node._sys.extension,
121604
+ newRelativePath: ""
121605
+ }));
121606
+ setDeleteModalOpen(
121607
+ true
121608
+ );
121354
121609
  }
121355
- ),
121356
- className: "text-red-500",
121357
- onMouseDown: () => {
121358
- setVars((old) => ({
121359
- ...old,
121360
- collection: collectionName,
121361
- relativePathWithoutExtension: document2.node._sys.breadcrumbs.join(
121362
- "/"
121363
- ),
121364
- relativePath: document2.node._sys.breadcrumbs.join(
121365
- "/"
121366
- ) + document2.node._sys.extension,
121367
- newRelativePath: ""
121368
- }));
121369
- setDeleteModalOpen(true);
121370
121610
  }
121371
- }
121372
- ].filter(Boolean)
121373
- }
121374
- ))
121375
- );
121376
- })))), documents.length === 0 && /* @__PURE__ */ React__default.createElement(NoDocumentsPlaceholder, null), /* @__PURE__ */ React__default.createElement("div", { className: "pt-4" }, /* @__PURE__ */ React__default.createElement(
121611
+ ].filter(Boolean)
121612
+ }
121613
+ ))
121614
+ );
121615
+ })));
121616
+ })())), documents.length === 0 && /* @__PURE__ */ React__default.createElement(NoDocumentsPlaceholder, null), /* @__PURE__ */ React__default.createElement("div", { className: "pt-4" }, /* @__PURE__ */ React__default.createElement(
121377
121617
  CursorPaginator,
121378
121618
  {
121379
121619
  variant: "white",
@@ -121533,20 +121773,47 @@ const FolderModal = ({
121533
121773
  close: close2,
121534
121774
  createFunc,
121535
121775
  folderName,
121536
- setFolderName
121776
+ setFolderName,
121777
+ validationRegex
121537
121778
  }) => {
121779
+ const [isFolderNameValid, setIsFolderNameValid] = useState(false);
121780
+ const [isInteracted, setIsInteracted] = useState(false);
121781
+ useEffect(() => {
121782
+ validateFolderName(folderName);
121783
+ }, [folderName]);
121784
+ const validateFolderName = (name) => {
121785
+ if (!validationRegex || !name.trim()) {
121786
+ setIsFolderNameValid(!!name.trim());
121787
+ return !!name.trim();
121788
+ }
121789
+ try {
121790
+ const regex = new RegExp(validationRegex);
121791
+ const valid = regex.test(name);
121792
+ setIsFolderNameValid(valid);
121793
+ return valid;
121794
+ } catch (error2) {
121795
+ setIsFolderNameValid(false);
121796
+ return false;
121797
+ }
121798
+ };
121538
121799
  return /* @__PURE__ */ React__default.createElement(Modal, null, /* @__PURE__ */ React__default.createElement(PopupModal, null, /* @__PURE__ */ React__default.createElement(ModalHeader, { close: close2 }, "Create Folder"), /* @__PURE__ */ React__default.createElement(ModalBody, { padded: true }, /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(
121539
121800
  BaseTextField,
121540
121801
  {
121541
121802
  placeholder: "Enter the name of the new folder",
121542
121803
  value: folderName,
121543
- onChange: (event) => setFolderName(event.target.value)
121804
+ className: `mb-4 ${!isFolderNameValid && isInteracted ? "border-red-500" : ""}`,
121805
+ onChange: (event) => {
121806
+ setFolderName(event.target.value);
121807
+ setIsInteracted(true);
121808
+ validateFolderName(event.target.value);
121809
+ }
121544
121810
  }
121545
- ))), /* @__PURE__ */ React__default.createElement(ModalActions, null, /* @__PURE__ */ React__default.createElement(Button$1, { style: { flexGrow: 2 }, onClick: close2 }, "Cancel"), /* @__PURE__ */ React__default.createElement(
121811
+ ), !isFolderNameValid && isInteracted && /* @__PURE__ */ React__default.createElement("p", { className: "text-red-500 text-sm pl-1" }, "Folder name is not valid – please enter a valid folder name."))), /* @__PURE__ */ React__default.createElement(ModalActions, null, /* @__PURE__ */ React__default.createElement(Button$1, { style: { flexGrow: 2 }, onClick: close2 }, "Cancel"), /* @__PURE__ */ React__default.createElement(
121546
121812
  Button$1,
121547
121813
  {
121548
121814
  style: { flexGrow: 3 },
121549
121815
  variant: "primary",
121816
+ disabled: !isFolderNameValid,
121550
121817
  onClick: async () => {
121551
121818
  await createFunc();
121552
121819
  close2();