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.js CHANGED
@@ -5,8 +5,8 @@ var __publicField = (obj, key, value) => {
5
5
  return value;
6
6
  };
7
7
  (function(global2, factory) {
8
- typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("zod"), require("react"), require("react-dom"), require("@udecode/cn"), require("@udecode/plate-heading"), require("is-hotkey"), require("clsx"), require("@radix-ui/react-slot"), require("@udecode/plate-code-block"), require("lucide-react"), require("mermaid"), require("class-variance-authority"), require("cmdk"), require("@radix-ui/react-dialog"), require("@radix-ui/react-popover"), require("@udecode/plate"), require("@ariakit/react"), require("@udecode/plate-combobox"), require("@udecode/plate-reset-node"), require("@udecode/plate-list"), require("@udecode/plate-resizable"), require("@udecode/plate-dnd"), require("@udecode/plate-table"), require("@radix-ui/react-dropdown-menu"), require("@radix-ui/react-toolbar"), require("@radix-ui/react-separator"), require("@radix-ui/react-tooltip"), require("final-form"), require("final-form-arrays"), require("final-form-set-field-data"), require("react-final-form"), require("prop-types"), require("react-color"), require("color-string"), require("tailwind-merge"), require("react-beautiful-dnd"), require("graphql"), require("@graphql-inspector/core"), require("@headlessui/react"), require("@udecode/plate-trailing-block"), require("@udecode/plate-floating"), require("@udecode/plate-block-quote"), require("@udecode/plate-node-id"), require("@udecode/plate-link"), require("@udecode/plate-autoformat"), require("date-fns"), require("react-dropzone"), require("@udecode/cmdk"), require("lodash.get"), require("moment"), require("@tinacms/schema-tools"), require("graphql-tag"), require("yup"), require("react-router-dom"), require("@tinacms/mdx")) : typeof define === "function" && define.amd ? define(["exports", "zod", "react", "react-dom", "@udecode/cn", "@udecode/plate-heading", "is-hotkey", "clsx", "@radix-ui/react-slot", "@udecode/plate-code-block", "lucide-react", "mermaid", "class-variance-authority", "cmdk", "@radix-ui/react-dialog", "@radix-ui/react-popover", "@udecode/plate", "@ariakit/react", "@udecode/plate-combobox", "@udecode/plate-reset-node", "@udecode/plate-list", "@udecode/plate-resizable", "@udecode/plate-dnd", "@udecode/plate-table", "@radix-ui/react-dropdown-menu", "@radix-ui/react-toolbar", "@radix-ui/react-separator", "@radix-ui/react-tooltip", "final-form", "final-form-arrays", "final-form-set-field-data", "react-final-form", "prop-types", "react-color", "color-string", "tailwind-merge", "react-beautiful-dnd", "graphql", "@graphql-inspector/core", "@headlessui/react", "@udecode/plate-trailing-block", "@udecode/plate-floating", "@udecode/plate-block-quote", "@udecode/plate-node-id", "@udecode/plate-link", "@udecode/plate-autoformat", "date-fns", "react-dropzone", "@udecode/cmdk", "lodash.get", "moment", "@tinacms/schema-tools", "graphql-tag", "yup", "react-router-dom", "@tinacms/mdx"], factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, factory(global2.tinacms = {}, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP));
9
- })(this, function(exports2, zod, React, ReactDOM, cn$2, plateHeading, isHotkey, clsx, reactSlot, plateCodeBlock, lucideReact, mermaid, classVarianceAuthority, cmdk, DialogPrimitive, PopoverPrimitive, plate, react, plateCombobox, plateResetNode, plateList, plateResizable, plateDnd, plateTable, DropdownMenuPrimitive, ToolbarPrimitive, SeparatorPrimitive, TooltipPrimitive, finalForm, arrayMutators, setFieldData, reactFinalForm, PropTypes, pkg$1, pkg, tailwindMerge, reactBeautifulDnd, graphql$1, core$1, react$1, plateTrailingBlock, plateFloating, plateBlockQuote, plateNodeId, plateLink, plateAutoformat, dateFns, dropzone, cmdk$1, get$5, moment, schemaTools, gql, yup, reactRouterDom, mdx) {
8
+ typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("zod"), require("react"), require("react-dom"), require("@udecode/cn"), require("@udecode/plate-heading"), require("is-hotkey"), require("clsx"), require("@radix-ui/react-slot"), require("@udecode/plate-code-block"), require("lucide-react"), require("mermaid"), require("class-variance-authority"), require("cmdk"), require("@radix-ui/react-dialog"), require("@radix-ui/react-popover"), require("@udecode/plate"), require("@ariakit/react"), require("@udecode/plate-combobox"), require("@udecode/plate-reset-node"), require("@udecode/plate-list"), require("@udecode/plate-resizable"), require("@udecode/plate-dnd"), require("@udecode/plate-table"), require("@radix-ui/react-dropdown-menu"), require("@radix-ui/react-toolbar"), require("@radix-ui/react-separator"), require("@radix-ui/react-tooltip"), require("final-form"), require("final-form-arrays"), require("final-form-set-field-data"), require("react-final-form"), require("prop-types"), require("tailwind-merge"), require("@dnd-kit/core"), require("@dnd-kit/sortable"), require("@dnd-kit/utilities"), require("react-color"), require("color-string"), require("graphql"), require("@graphql-inspector/core"), require("react-dropzone"), require("@udecode/cmdk"), require("@headlessui/react"), require("@udecode/plate-trailing-block"), require("@udecode/plate-floating"), require("@udecode/plate-block-quote"), require("@udecode/plate-node-id"), require("@udecode/plate-link"), require("@udecode/plate-autoformat"), require("lodash.get"), require("moment"), require("date-fns"), require("@tinacms/schema-tools"), require("graphql-tag"), require("yup"), require("react-router-dom"), require("@tinacms/mdx")) : typeof define === "function" && define.amd ? define(["exports", "zod", "react", "react-dom", "@udecode/cn", "@udecode/plate-heading", "is-hotkey", "clsx", "@radix-ui/react-slot", "@udecode/plate-code-block", "lucide-react", "mermaid", "class-variance-authority", "cmdk", "@radix-ui/react-dialog", "@radix-ui/react-popover", "@udecode/plate", "@ariakit/react", "@udecode/plate-combobox", "@udecode/plate-reset-node", "@udecode/plate-list", "@udecode/plate-resizable", "@udecode/plate-dnd", "@udecode/plate-table", "@radix-ui/react-dropdown-menu", "@radix-ui/react-toolbar", "@radix-ui/react-separator", "@radix-ui/react-tooltip", "final-form", "final-form-arrays", "final-form-set-field-data", "react-final-form", "prop-types", "tailwind-merge", "@dnd-kit/core", "@dnd-kit/sortable", "@dnd-kit/utilities", "react-color", "color-string", "graphql", "@graphql-inspector/core", "react-dropzone", "@udecode/cmdk", "@headlessui/react", "@udecode/plate-trailing-block", "@udecode/plate-floating", "@udecode/plate-block-quote", "@udecode/plate-node-id", "@udecode/plate-link", "@udecode/plate-autoformat", "lodash.get", "moment", "date-fns", "@tinacms/schema-tools", "graphql-tag", "yup", "react-router-dom", "@tinacms/mdx"], factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, factory(global2.tinacms = {}, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP, global2.NOOP));
9
+ })(this, function(exports2, zod, React, ReactDOM, cn$2, plateHeading, isHotkey, clsx, reactSlot, plateCodeBlock, lucideReact, mermaid, classVarianceAuthority, cmdk, DialogPrimitive, PopoverPrimitive, plate, react, plateCombobox, plateResetNode, plateList, plateResizable, plateDnd, plateTable, DropdownMenuPrimitive, ToolbarPrimitive, SeparatorPrimitive, TooltipPrimitive, finalForm, arrayMutators, setFieldData, reactFinalForm, PropTypes, tailwindMerge, core$1, sortable, utilities, pkg$1, pkg, graphql$1, core$2, dropzone, cmdk$1, react$1, plateTrailingBlock, plateFloating, plateBlockQuote, plateNodeId, plateLink, plateAutoformat, get$5, moment, dateFns, schemaTools, gql, yup, reactRouterDom, mdx) {
10
10
  var _a;
11
11
  "use strict";
12
12
  function _interopNamespaceDefault(e3) {
@@ -38308,6 +38308,171 @@ Please wrap them with useCallback or configure the deps array correctly.`
38308
38308
  Component: PropTypes.any.isRequired,
38309
38309
  children: PropTypes.any
38310
38310
  };
38311
+ function cn$1(...inputs) {
38312
+ return tailwindMerge.twMerge(clsx.clsx(inputs));
38313
+ }
38314
+ const Button$1 = ({
38315
+ variant = "secondary",
38316
+ as: Tag2 = "button",
38317
+ size: size2 = "medium",
38318
+ busy,
38319
+ disabled,
38320
+ rounded = "full",
38321
+ children,
38322
+ className = "",
38323
+ ...props
38324
+ }) => {
38325
+ 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 ";
38326
+ const variantClasses = {
38327
+ primary: `shadow text-white bg-tina-orange-dark hover:bg-tina-orange focus:ring-tina-orange-dark border-0`,
38328
+ secondary: `shadow text-gray-500 hover:tina-orange-dark bg-gray-50 hover:bg-white border border-gray-100`,
38329
+ white: `shadow text-gray-500 hover:tina-orange-dark bg-white hover:bg-gray-50 border border-gray-100`,
38330
+ ghost: `text-gray-500 hover:tina-orange-dark hover:shadow border border-transparent border-0 hover:border hover:border-gray-200 bg-transparent`,
38331
+ danger: `shadow text-white bg-red-500 hover:bg-red-600 focus:ring-red-500`,
38332
+ accent: `shadow text-white bg-orange-500 hover:bg-orange-600 focus:ring-orange-500`,
38333
+ custom: ""
38334
+ };
38335
+ const state = busy ? `busy` : disabled ? `disabled` : `default`;
38336
+ const stateClasses = {
38337
+ disabled: `pointer-events-none opacity-30 cursor-not-allowed`,
38338
+ busy: `pointer-events-none opacity-70 cursor-wait`,
38339
+ default: ``
38340
+ };
38341
+ const roundedClasses = {
38342
+ full: `rounded`,
38343
+ left: `rounded-l`,
38344
+ right: `rounded-r`,
38345
+ custom: "",
38346
+ none: ""
38347
+ };
38348
+ const sizeClasses = {
38349
+ small: `text-xs h-8 px-3`,
38350
+ medium: `text-sm h-10 px-8`,
38351
+ custom: ``
38352
+ };
38353
+ return /* @__PURE__ */ React__namespace.createElement(
38354
+ Tag2,
38355
+ {
38356
+ className: cn$1(
38357
+ baseClasses,
38358
+ variantClasses[variant],
38359
+ sizeClasses[size2],
38360
+ stateClasses[state],
38361
+ roundedClasses[rounded],
38362
+ className
38363
+ ),
38364
+ ...props
38365
+ },
38366
+ children
38367
+ );
38368
+ };
38369
+ const IconButton = ({
38370
+ variant = "secondary",
38371
+ size: size2 = "medium",
38372
+ busy,
38373
+ disabled,
38374
+ children,
38375
+ className,
38376
+ ...props
38377
+ }) => {
38378
+ 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";
38379
+ const variantClasses = {
38380
+ primary: `shadow text-white bg-tina-orange-dark hover:bg-tina-orange focus:ring-tina-orange-dark`,
38381
+ secondary: `shadow text-gray-500 hover:text-blue-500 bg-gray-50 hover:bg-white border border-gray-200`,
38382
+ white: `shadow text-gray-500 hover:text-blue-500 bg-white hover:bg-gray-50 border border-gray-200`,
38383
+ ghost: `text-gray-500 hover:text-blue-500 hover:shadow border border-transparent hover:border-gray-200 bg-transparent`,
38384
+ accent: `shadow text-white bg-orange-500 hover:bg-orange-600 focus:ring-orange-500`
38385
+ };
38386
+ const state = busy ? `busy` : disabled ? `disabled` : `default`;
38387
+ const stateClasses = {
38388
+ disabled: `pointer-events-none opacity-30 cursor-not-allowed`,
38389
+ busy: `pointer-events-none opacity-70 cursor-wait`,
38390
+ default: ``
38391
+ };
38392
+ const sizeClasses = {
38393
+ small: `h-7 w-7`,
38394
+ medium: `h-9 w-9`,
38395
+ custom: ``
38396
+ };
38397
+ return /* @__PURE__ */ React__namespace.createElement(
38398
+ "button",
38399
+ {
38400
+ className: cn$1(
38401
+ baseClasses,
38402
+ variantClasses[variant],
38403
+ sizeClasses[size2],
38404
+ stateClasses[state],
38405
+ className
38406
+ ),
38407
+ ...props
38408
+ },
38409
+ children
38410
+ );
38411
+ };
38412
+ function FontLoader() {
38413
+ React__namespace.useEffect(() => {
38414
+ const link = document.createElement("link");
38415
+ link.href = "https://fonts.googleapis.com/css2?family=Inter:wght@400;600&family=Libre+Baskerville:wght@400;500;600;700&display=swap";
38416
+ link.rel = "stylesheet";
38417
+ document.head.appendChild(link);
38418
+ return () => {
38419
+ document.head.removeChild(link);
38420
+ };
38421
+ }, []);
38422
+ return null;
38423
+ }
38424
+ function classNames(...classes) {
38425
+ return classes.filter(Boolean).join(" ");
38426
+ }
38427
+ const OverflowMenu$1 = ({ toolbarItems: toolbarItems2, className = "w-full" }) => {
38428
+ const [open, setOpen] = React.useState(false);
38429
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, toolbarItems2.length > 0 && /* @__PURE__ */ React.createElement(PopoverPrimitive__namespace.Root, { open, onOpenChange: setOpen }, /* @__PURE__ */ React.createElement(
38430
+ PopoverPrimitive__namespace.Trigger,
38431
+ {
38432
+ 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}}`
38433
+ },
38434
+ /* @__PURE__ */ React.createElement(
38435
+ "svg",
38436
+ {
38437
+ xmlns: "http://www.w3.org/2000/svg",
38438
+ className: "h-5 w-5",
38439
+ fill: "none",
38440
+ viewBox: "0 0 24 24",
38441
+ stroke: "currentColor"
38442
+ },
38443
+ /* @__PURE__ */ React.createElement(
38444
+ "path",
38445
+ {
38446
+ strokeLinecap: "round",
38447
+ strokeLinejoin: "round",
38448
+ strokeWidth: 2,
38449
+ 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"
38450
+ }
38451
+ )
38452
+ )
38453
+ ), /* @__PURE__ */ React.createElement(PopoverPrimitive__namespace.Portal, null, /* @__PURE__ */ React.createElement(PopoverPrimitive__namespace.Content, { style: { zIndex: 2e4 }, align: "end" }, /* @__PURE__ */ React.createElement("div", { className: "mt-0 -mr-1 rounded shadow-lg bg-white ring-1 ring-black ring-opacity-5 py-1" }, toolbarItems2.map((toolbarItem) => {
38454
+ return /* @__PURE__ */ React.createElement(
38455
+ "span",
38456
+ {
38457
+ "data-test": `${toolbarItem.name}OverflowButton`,
38458
+ key: toolbarItem.name,
38459
+ onMouseDown: (event) => {
38460
+ event.preventDefault();
38461
+ toolbarItem.onMouseDown(event);
38462
+ setOpen(false);
38463
+ },
38464
+ className: classNames(
38465
+ toolbarItem.active ? "bg-gray-50 text-blue-500" : "bg-white text-gray-600",
38466
+ "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",
38467
+ toolbarItem.className ?? ""
38468
+ )
38469
+ },
38470
+ /* @__PURE__ */ React.createElement("div", { className: "mr-2 opacity-80" }, toolbarItem.Icon),
38471
+ " ",
38472
+ toolbarItem.label
38473
+ );
38474
+ }))))));
38475
+ };
38311
38476
  var DefaultContext = {
38312
38477
  color: void 0,
38313
38478
  size: void 0,
@@ -38549,30 +38714,392 @@ Please wrap them with useCallback or configure the deps array correctly.`
38549
38714
  function BiX(props) {
38550
38715
  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);
38551
38716
  }
38552
- 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";
38553
- const disabledClasses$1 = "opacity-50 pointer-events-none cursor-not-allowed";
38554
- const BaseTextField = React__namespace.forwardRef(({ className, disabled, ...rest }, ref) => {
38717
+ function BsArrowRightShort(props) {
38718
+ 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);
38719
+ }
38720
+ function BsCheckCircleFill(props) {
38721
+ 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);
38722
+ }
38723
+ function BsExclamationOctagonFill(props) {
38724
+ 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);
38725
+ }
38726
+ const MessageIcon = ({
38727
+ type = "success",
38728
+ className = ""
38729
+ }) => {
38730
+ const icons = {
38731
+ success: BiCheckCircle,
38732
+ warning: BiError,
38733
+ error: BiError,
38734
+ info: BiInfoCircle
38735
+ };
38736
+ const Icon = icons[type];
38737
+ return /* @__PURE__ */ React.createElement(Icon, { className });
38738
+ };
38739
+ const Message = ({
38740
+ children,
38741
+ type = "success",
38742
+ size: size2 = "medium",
38743
+ className = "",
38744
+ link,
38745
+ linkLabel = "Learn More"
38746
+ }) => {
38747
+ const containerClasses = {
38748
+ success: "bg-gradient-to-r from-green-50 to-green-100 border-green-200",
38749
+ warning: "bg-gradient-to-r from-yellow-50 to-yellow-100 border-yellow-200",
38750
+ error: "bg-gradient-to-r from-red-50 to-red-100 border-red-200",
38751
+ info: "bg-gradient-to-r from-blue-50 to-blue-100 border-blue-100"
38752
+ };
38753
+ const textClasses = {
38754
+ success: "text-green-700",
38755
+ warning: "text-yellow-700",
38756
+ error: "text-red-700",
38757
+ info: "text-blue-700"
38758
+ };
38759
+ const iconClasses = {
38760
+ success: "text-green-400",
38761
+ warning: "text-yellow-400",
38762
+ error: "text-red-400",
38763
+ info: "text-blue-400"
38764
+ };
38765
+ const sizeClasses = {
38766
+ small: "px-3 py-1.5 text-xs",
38767
+ medium: "px-4 py-2.5 text-sm"
38768
+ };
38769
+ return /* @__PURE__ */ React.createElement(
38770
+ "div",
38771
+ {
38772
+ className: `rounded-lg border shadow-sm ${sizeClasses[size2]} ${containerClasses[type]} ${className}`
38773
+ },
38774
+ /* @__PURE__ */ React.createElement("div", { className: "flex flex-col sm:flex-row items-start sm:items-center gap-2" }, /* @__PURE__ */ React.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ React.createElement(
38775
+ MessageIcon,
38776
+ {
38777
+ type,
38778
+ className: `${size2 === "small" ? "w-5" : "w-6"} h-auto flex-shrink-0 ${iconClasses[type]}`
38779
+ }
38780
+ ), /* @__PURE__ */ React.createElement("div", { className: `flex-1 ${textClasses[type]}` }, children)), link && /* @__PURE__ */ React.createElement(
38781
+ "a",
38782
+ {
38783
+ href: link,
38784
+ target: "_blank",
38785
+ 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"
38786
+ },
38787
+ linkLabel,
38788
+ " ",
38789
+ /* @__PURE__ */ React.createElement(BsArrowRightShort, { className: "w-4 h-auto" })
38790
+ ))
38791
+ );
38792
+ };
38793
+ function cn(...inputs) {
38794
+ return tailwindMerge.twMerge(clsx.clsx(inputs));
38795
+ }
38796
+ function DropdownMenu({
38797
+ ...props
38798
+ }) {
38799
+ return /* @__PURE__ */ React__namespace.createElement(DropdownMenuPrimitive__namespace.Root, { "data-slot": "dropdown-menu", ...props });
38800
+ }
38801
+ function DropdownMenuTrigger({
38802
+ ...props
38803
+ }) {
38555
38804
  return /* @__PURE__ */ React__namespace.createElement(
38556
- "input",
38805
+ DropdownMenuPrimitive__namespace.Trigger,
38557
38806
  {
38558
- ref,
38559
- type: "text",
38560
- className: `${textFieldClasses} ${disabled ? disabledClasses$1 : ""} ${className}`,
38561
- ...rest
38807
+ "data-slot": "dropdown-menu-trigger",
38808
+ ...props
38562
38809
  }
38563
38810
  );
38564
- });
38565
- const TextArea = React__namespace.forwardRef(({ ...props }, ref) => {
38811
+ }
38812
+ function DropdownMenuContent({
38813
+ className,
38814
+ sideOffset = 4,
38815
+ ...props
38816
+ }) {
38817
+ return /* @__PURE__ */ React__namespace.createElement(DropdownMenuPrimitive__namespace.Portal, null, /* @__PURE__ */ React__namespace.createElement(
38818
+ DropdownMenuPrimitive__namespace.Content,
38819
+ {
38820
+ "data-slot": "dropdown-menu-content",
38821
+ sideOffset,
38822
+ className: cn(
38823
+ "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",
38824
+ className
38825
+ ),
38826
+ ...props
38827
+ }
38828
+ ));
38829
+ }
38830
+ function DropdownMenuItem({
38831
+ className,
38832
+ inset,
38833
+ variant = "default",
38834
+ ...props
38835
+ }) {
38566
38836
  return /* @__PURE__ */ React__namespace.createElement(
38567
- "textarea",
38837
+ DropdownMenuPrimitive__namespace.Item,
38568
38838
  {
38569
- ...props,
38570
- 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",
38571
- ref,
38572
- style: { minHeight: "160px" }
38839
+ "data-slot": "dropdown-menu-item",
38840
+ "data-inset": inset,
38841
+ "data-variant": variant,
38842
+ className: cn(
38843
+ "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",
38844
+ className
38845
+ ),
38846
+ ...props
38573
38847
  }
38574
38848
  );
38575
- });
38849
+ }
38850
+ function DropdownMenuSeparator({
38851
+ className,
38852
+ ...props
38853
+ }) {
38854
+ return /* @__PURE__ */ React__namespace.createElement(
38855
+ DropdownMenuPrimitive__namespace.Separator,
38856
+ {
38857
+ "data-slot": "dropdown-menu-separator",
38858
+ className: cn("bg-border -mx-1 my-1 h-px", className),
38859
+ ...props
38860
+ }
38861
+ );
38862
+ }
38863
+ const DropdownButton = React__namespace.forwardRef(
38864
+ ({
38865
+ variant = "primary",
38866
+ size: size2 = "medium",
38867
+ busy,
38868
+ disabled,
38869
+ rounded = "full",
38870
+ children,
38871
+ className = "",
38872
+ onMainAction,
38873
+ items: items2,
38874
+ showSplitButton = true,
38875
+ ...props
38876
+ }, ref) => {
38877
+ const [open, setOpen] = React__namespace.useState(false);
38878
+ if (!onMainAction || !showSplitButton) {
38879
+ return /* @__PURE__ */ React__namespace.createElement(DropdownMenu, { open, onOpenChange: setOpen, modal: false }, /* @__PURE__ */ React__namespace.createElement(DropdownMenuTrigger, { asChild: true }, /* @__PURE__ */ React__namespace.createElement(
38880
+ Button$1,
38881
+ {
38882
+ variant,
38883
+ size: size2,
38884
+ busy,
38885
+ disabled,
38886
+ rounded,
38887
+ className: cn$1("gap-2", className),
38888
+ ...props
38889
+ },
38890
+ children,
38891
+ /* @__PURE__ */ React__namespace.createElement(
38892
+ lucideReact.ChevronDownIcon,
38893
+ {
38894
+ className: cn$1(
38895
+ "h-4 w-4 transition-transform duration-200",
38896
+ open && "rotate-180"
38897
+ )
38898
+ }
38899
+ )
38900
+ )), /* @__PURE__ */ React__namespace.createElement(DropdownMenuContent, { align: "end", side: "bottom", className: "z-[100000]" }, items2.map((item, index) => /* @__PURE__ */ React__namespace.createElement(
38901
+ DropdownMenuItem,
38902
+ {
38903
+ key: index,
38904
+ onClick: item.onClick,
38905
+ disabled: item.disabled,
38906
+ variant: item.variant
38907
+ },
38908
+ item.icon && item.icon,
38909
+ item.label
38910
+ ))));
38911
+ }
38912
+ return /* @__PURE__ */ React__namespace.createElement("div", { className: cn$1("inline-flex", className) }, /* @__PURE__ */ React__namespace.createElement(
38913
+ Button$1,
38914
+ {
38915
+ variant,
38916
+ size: size2,
38917
+ busy,
38918
+ disabled,
38919
+ rounded: "left",
38920
+ onClick: onMainAction,
38921
+ className: "border-r-0 w-full",
38922
+ ...props
38923
+ },
38924
+ children
38925
+ ), /* @__PURE__ */ React__namespace.createElement(DropdownMenu, { open, onOpenChange: setOpen }, /* @__PURE__ */ React__namespace.createElement(DropdownMenuTrigger, null, /* @__PURE__ */ React__namespace.createElement(
38926
+ Button$1,
38927
+ {
38928
+ variant,
38929
+ size: size2,
38930
+ busy,
38931
+ disabled,
38932
+ rounded: "right",
38933
+ className: "px-4 border-l",
38934
+ style: { borderColor: "#00000030" },
38935
+ "aria-label": "More options"
38936
+ },
38937
+ /* @__PURE__ */ React__namespace.createElement(
38938
+ lucideReact.ChevronDownIcon,
38939
+ {
38940
+ className: cn$1(
38941
+ "h-4 w-4 transition-transform duration-200 fill-none",
38942
+ open && "rotate-180"
38943
+ ),
38944
+ style: { fill: "none" }
38945
+ }
38946
+ )
38947
+ )), /* @__PURE__ */ React__namespace.createElement(DropdownMenuContent, { align: "end", side: "bottom" }, items2.map((item, index) => {
38948
+ var _a2;
38949
+ return /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, { key: index }, /* @__PURE__ */ React__namespace.createElement(
38950
+ DropdownMenuItem,
38951
+ {
38952
+ onClick: item.onClick,
38953
+ disabled: item.disabled,
38954
+ variant: item.variant
38955
+ },
38956
+ item.icon && item.icon,
38957
+ item.label
38958
+ ), item.variant === "destructive" && index < items2.length - 1 && ((_a2 = items2[index + 1]) == null ? void 0 : _a2.variant) !== "destructive" && /* @__PURE__ */ React__namespace.createElement(DropdownMenuSeparator, null));
38959
+ }))));
38960
+ }
38961
+ );
38962
+ DropdownButton.displayName = "DropdownButton";
38963
+ const DragDropContext = ({
38964
+ onDragEnd,
38965
+ children
38966
+ }) => {
38967
+ const sensors = core$1.useSensors(
38968
+ core$1.useSensor(core$1.PointerSensor, {
38969
+ activationConstraint: {
38970
+ delay: 100,
38971
+ tolerance: 5
38972
+ }
38973
+ }),
38974
+ core$1.useSensor(core$1.KeyboardSensor, {
38975
+ coordinateGetter: sortable.sortableKeyboardCoordinates
38976
+ })
38977
+ );
38978
+ const handleDragEnd = (event) => {
38979
+ const { active, over } = event;
38980
+ if (!over || active.id === over.id) {
38981
+ return;
38982
+ }
38983
+ const activeIdStr = String(active.id);
38984
+ const overIdStr = String(over.id);
38985
+ const activeFieldName = activeIdStr.substring(
38986
+ 0,
38987
+ activeIdStr.lastIndexOf(".")
38988
+ );
38989
+ const overFieldName = overIdStr.substring(0, overIdStr.lastIndexOf("."));
38990
+ const activeIndex = parseInt(
38991
+ activeIdStr.substring(activeIdStr.lastIndexOf(".") + 1)
38992
+ );
38993
+ const overIndex = parseInt(
38994
+ overIdStr.substring(overIdStr.lastIndexOf(".") + 1)
38995
+ );
38996
+ if (activeFieldName === overFieldName) {
38997
+ const result = {
38998
+ destination: {
38999
+ index: overIndex
39000
+ },
39001
+ source: {
39002
+ index: activeIndex
39003
+ },
39004
+ type: activeFieldName
39005
+ };
39006
+ onDragEnd(result);
39007
+ }
39008
+ };
39009
+ return /* @__PURE__ */ React.createElement(
39010
+ core$1.DndContext,
39011
+ {
39012
+ sensors,
39013
+ collisionDetection: core$1.closestCenter,
39014
+ onDragEnd: handleDragEnd
39015
+ },
39016
+ children
39017
+ );
39018
+ };
39019
+ const Droppable = ({
39020
+ droppableId,
39021
+ type,
39022
+ children
39023
+ }) => {
39024
+ const ref = React.useRef(null);
39025
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, children({
39026
+ innerRef: ref,
39027
+ placeholder: null
39028
+ }));
39029
+ };
39030
+ const Draggable = ({
39031
+ draggableId,
39032
+ children
39033
+ }) => {
39034
+ const animateLayoutChanges = (args) => {
39035
+ const { isSorting, wasDragging } = args;
39036
+ if (wasDragging) {
39037
+ return false;
39038
+ }
39039
+ if (isSorting) {
39040
+ return sortable.defaultAnimateLayoutChanges(args);
39041
+ }
39042
+ return true;
39043
+ };
39044
+ const {
39045
+ attributes,
39046
+ listeners,
39047
+ setNodeRef,
39048
+ transform,
39049
+ transition,
39050
+ isDragging,
39051
+ setActivatorNodeRef
39052
+ } = sortable.useSortable({
39053
+ id: draggableId,
39054
+ animateLayoutChanges
39055
+ });
39056
+ const style = {
39057
+ transform: utilities.CSS.Transform.toString(transform),
39058
+ transition,
39059
+ ...isDragging && { zIndex: 9999 }
39060
+ };
39061
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, children(
39062
+ {
39063
+ innerRef: { current: null },
39064
+ draggableProps: {
39065
+ ref: setNodeRef,
39066
+ style,
39067
+ ...attributes
39068
+ },
39069
+ dragHandleProps: {
39070
+ ref: setActivatorNodeRef,
39071
+ ...listeners
39072
+ }
39073
+ },
39074
+ {
39075
+ isDragging
39076
+ }
39077
+ ));
39078
+ };
39079
+ const SortableProvider = ({
39080
+ items: items2,
39081
+ children
39082
+ }) => {
39083
+ return /* @__PURE__ */ React.createElement(sortable.SortableContext, { items: items2, strategy: sortable.verticalListSortingStrategy }, children);
39084
+ };
39085
+ function FaCircle(props) {
39086
+ 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);
39087
+ }
39088
+ function FaFile(props) {
39089
+ 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);
39090
+ }
39091
+ function FaFolder(props) {
39092
+ 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);
39093
+ }
39094
+ function FaLock(props) {
39095
+ 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);
39096
+ }
39097
+ function FaSpinner(props) {
39098
+ 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);
39099
+ }
39100
+ function FaUnlock(props) {
39101
+ 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);
39102
+ }
38576
39103
  const Dismissible = ({
38577
39104
  onDismiss,
38578
39105
  escape: escape2,
@@ -38645,14 +39172,167 @@ Please wrap them with useCallback or configure the deps array correctly.`
38645
39172
  }, [click, customDocument, escape2, disabled, onDismiss]);
38646
39173
  return area;
38647
39174
  }
38648
- const { get: getColor, to: toColor } = pkg__namespace;
38649
- var ColorFormat = /* @__PURE__ */ ((ColorFormat2) => {
38650
- ColorFormat2["Hex"] = "hex";
38651
- ColorFormat2["RGB"] = "rgb";
38652
- return ColorFormat2;
38653
- })(ColorFormat || {});
38654
- const rgbToHex = function(color) {
38655
- return "#" + ((1 << 24) + (color.r << 16) + (color.g << 8) + color.b).toString(16).slice(1);
39175
+ const FormActionMenu = ({ actions, form }) => {
39176
+ const [actionMenuVisibility, setActionMenuVisibility] = React.useState(false);
39177
+ return /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, /* @__PURE__ */ React__namespace.createElement(MoreActionsButton, { onClick: () => setActionMenuVisibility((p2) => !p2) }), /* @__PURE__ */ React__namespace.createElement(ActionsOverlay, { open: actionMenuVisibility }, /* @__PURE__ */ React__namespace.createElement(
39178
+ Dismissible,
39179
+ {
39180
+ click: true,
39181
+ escape: true,
39182
+ disabled: !actionMenuVisibility,
39183
+ onDismiss: () => {
39184
+ setActionMenuVisibility((p2) => !p2);
39185
+ }
39186
+ },
39187
+ actions.map((Action, i2) => (
39188
+ // TODO: `i` will suppress warnings but this indicates that maybe
39189
+ // Actions should just be componets
39190
+ /* @__PURE__ */ React__namespace.createElement(Action, { form, key: i2 })
39191
+ ))
39192
+ )));
39193
+ };
39194
+ const MoreActionsButton = ({ className = "", ...props }) => /* @__PURE__ */ React__namespace.createElement(
39195
+ "button",
39196
+ {
39197
+ 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}`,
39198
+ ...props
39199
+ },
39200
+ /* @__PURE__ */ React__namespace.createElement(EllipsisVerticalIcon, null)
39201
+ );
39202
+ const ActionsOverlay = ({ open, className = "", style = {}, ...props }) => /* @__PURE__ */ React__namespace.createElement(
39203
+ "div",
39204
+ {
39205
+ 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}`,
39206
+ style: {
39207
+ transform: open ? "translate3d(0, -28px, 0) scale3d(1, 1, 1)" : "translate3d(0, 0, 0) scale3d(0.5, 0.5, 1)",
39208
+ pointerEvents: open ? "all" : "none",
39209
+ ...style
39210
+ },
39211
+ ...props
39212
+ }
39213
+ );
39214
+ const ActionButton = ({ className = "", ...props }) => /* @__PURE__ */ React__namespace.createElement(
39215
+ "button",
39216
+ {
39217
+ 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}`,
39218
+ ...props
39219
+ }
39220
+ );
39221
+ const FormPortalContext = React__namespace.createContext(() => {
39222
+ return null;
39223
+ });
39224
+ function useFormPortal() {
39225
+ return React__namespace.useContext(FormPortalContext);
39226
+ }
39227
+ const FormPortalProvider = ({
39228
+ children
39229
+ }) => {
39230
+ const wrapperRef = React__namespace.useRef(null);
39231
+ const zIndexRef = React__namespace.useRef(0);
39232
+ const FormPortal = React__namespace.useCallback(
39233
+ (props) => {
39234
+ if (!wrapperRef.current)
39235
+ return null;
39236
+ return ReactDOM.createPortal(
39237
+ props.children({ zIndexShift: zIndexRef.current += 1 }),
39238
+ wrapperRef.current
39239
+ );
39240
+ },
39241
+ [wrapperRef, zIndexRef]
39242
+ );
39243
+ return /* @__PURE__ */ React__namespace.createElement(FormPortalContext.Provider, { value: FormPortal }, /* @__PURE__ */ React__namespace.createElement("div", { ref: wrapperRef, className: "relative w-full flex-1 overflow-hidden" }, children));
39244
+ };
39245
+ const LoadingDots = ({
39246
+ dotSize = 8,
39247
+ color = "white"
39248
+ }) => {
39249
+ return /* @__PURE__ */ React__namespace.createElement("div", null, /* @__PURE__ */ React__namespace.createElement(SingleDot, { dotSize, color }), /* @__PURE__ */ React__namespace.createElement(SingleDot, { dotSize, color, delay: 0.3 }), /* @__PURE__ */ React__namespace.createElement(SingleDot, { dotSize, color, delay: 0.5 }));
39250
+ };
39251
+ const SingleDot = ({ delay = 0, color, dotSize }) => /* @__PURE__ */ React__namespace.createElement(
39252
+ "span",
39253
+ {
39254
+ className: "inline-block mr-1",
39255
+ style: {
39256
+ animation: "loading-dots-scale-up-and-down 2s linear infinite",
39257
+ animationDelay: `${delay}s`,
39258
+ background: color,
39259
+ width: dotSize,
39260
+ height: dotSize,
39261
+ borderRadius: dotSize
39262
+ }
39263
+ }
39264
+ );
39265
+ const ResetForm = ({
39266
+ pristine,
39267
+ reset: reset2,
39268
+ children,
39269
+ ...props
39270
+ }) => {
39271
+ const [open, setOpen] = React__namespace.useState(false);
39272
+ return /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, /* @__PURE__ */ React__namespace.createElement(
39273
+ Button$1,
39274
+ {
39275
+ onClick: () => {
39276
+ setOpen((p2) => !p2);
39277
+ },
39278
+ disabled: pristine,
39279
+ ...props
39280
+ },
39281
+ children
39282
+ ), open && /* @__PURE__ */ React__namespace.createElement(ResetModal, { reset: reset2, close: () => setOpen(false) }));
39283
+ };
39284
+ const ResetModal = ({ close: close2, reset: reset2 }) => {
39285
+ return /* @__PURE__ */ React__namespace.createElement(Modal, null, /* @__PURE__ */ React__namespace.createElement(ModalPopup, null, /* @__PURE__ */ React__namespace.createElement(ModalHeader, { close: close2 }, "Reset"), /* @__PURE__ */ React__namespace.createElement(ModalBody, { padded: true }, /* @__PURE__ */ React__namespace.createElement("p", null, "Are you sure you want to reset all changes?")), /* @__PURE__ */ React__namespace.createElement(ModalActions, null, /* @__PURE__ */ React__namespace.createElement(Button$1, { style: { flexGrow: 2 }, onClick: close2 }, "Cancel"), /* @__PURE__ */ React__namespace.createElement(
39286
+ Button$1,
39287
+ {
39288
+ style: { flexGrow: 3 },
39289
+ variant: "primary",
39290
+ onClick: async () => {
39291
+ await reset2();
39292
+ close2();
39293
+ }
39294
+ },
39295
+ "Reset"
39296
+ ))));
39297
+ };
39298
+ function AiFillWarning(props) {
39299
+ 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);
39300
+ }
39301
+ function AiOutlineLoading(props) {
39302
+ 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);
39303
+ }
39304
+ 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";
39305
+ const disabledClasses$1 = "opacity-50 pointer-events-none cursor-not-allowed";
39306
+ const BaseTextField = React__namespace.forwardRef(({ className, disabled, ...rest }, ref) => {
39307
+ return /* @__PURE__ */ React__namespace.createElement(
39308
+ "input",
39309
+ {
39310
+ ref,
39311
+ type: "text",
39312
+ className: `${textFieldClasses} ${disabled ? disabledClasses$1 : ""} ${className}`,
39313
+ ...rest
39314
+ }
39315
+ );
39316
+ });
39317
+ const TextArea = React__namespace.forwardRef(({ ...props }, ref) => {
39318
+ return /* @__PURE__ */ React__namespace.createElement(
39319
+ "textarea",
39320
+ {
39321
+ ...props,
39322
+ 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",
39323
+ ref,
39324
+ style: { minHeight: "160px" }
39325
+ }
39326
+ );
39327
+ });
39328
+ const { get: getColor, to: toColor } = pkg__namespace;
39329
+ var ColorFormat = /* @__PURE__ */ ((ColorFormat2) => {
39330
+ ColorFormat2["Hex"] = "hex";
39331
+ ColorFormat2["RGB"] = "rgb";
39332
+ return ColorFormat2;
39333
+ })(ColorFormat || {});
39334
+ const rgbToHex = function(color) {
39335
+ return "#" + ((1 << 24) + (color.r << 16) + (color.g << 8) + color.b).toString(16).slice(1);
38656
39336
  };
38657
39337
  function ParseColorStr(color) {
38658
39338
  if (!color) {
@@ -38915,689 +39595,287 @@ Please wrap them with useCallback or configure the deps array correctly.`
38915
39595
  transform: `translate3d(${checked ? "20px" : "0"}, -50%, 0)`
38916
39596
  }
38917
39597
  }
38918
- ))
38919
- )), labels && /* @__PURE__ */ React__namespace.createElement(
38920
- "span",
38921
- {
38922
- className: `text-sm ${checked ? "text-blue-500 font-bold" : "text-gray-300"}`
38923
- },
38924
- labels.true
38925
- ));
38926
- };
38927
- const ToggleInput = ({ disabled, ...props }) => {
38928
- return /* @__PURE__ */ React__namespace.createElement(
38929
- "input",
38930
- {
38931
- className: `absolute left-0 top-0 w-12 h-8 opacity-0 m-0 ${disabled ? `cursor-not-allowed pointer-events-none` : `cursor-pointer z-20`}`,
38932
- ...props
38933
- }
38934
- );
38935
- };
38936
- function MdCheckCircle(props) {
38937
- 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 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z" }, "child": [] }] })(props);
38938
- }
38939
- function MdInfo(props) {
38940
- 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 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z" }, "child": [] }] })(props);
38941
- }
38942
- function MdError(props) {
38943
- 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 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z" }, "child": [] }] })(props);
38944
- }
38945
- function MdWarning(props) {
38946
- return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "fill": "none", "d": "M0 0h24v24H0z" }, "child": [] }, { "tag": "path", "attr": { "d": "M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z" }, "child": [] }] })(props);
38947
- }
38948
- function MdVpnKey(props) {
38949
- 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);
38950
- }
38951
- function MdKeyboardArrowDown(props) {
38952
- 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);
38953
- }
38954
- function MdArrowForward(props) {
38955
- 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 4-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z" }, "child": [] }] })(props);
38956
- }
38957
- function MdSyncProblem(props) {
38958
- 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);
38959
- }
38960
- function MdOutlineHelpOutline(props) {
38961
- 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);
38962
- }
38963
- function MdOutlineSettings(props) {
38964
- 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.43 12.98c.04-.32.07-.64.07-.98 0-.34-.03-.66-.07-.98l2.11-1.65c.19-.15.24-.42.12-.64l-2-3.46a.5.5 0 0 0-.61-.22l-2.49 1c-.52-.4-1.08-.73-1.69-.98l-.38-2.65A.488.488 0 0 0 14 2h-4c-.25 0-.46.18-.49.42l-.38 2.65c-.61.25-1.17.59-1.69.98l-2.49-1a.566.566 0 0 0-.18-.03c-.17 0-.34.09-.43.25l-2 3.46c-.13.22-.07.49.12.64l2.11 1.65c-.04.32-.07.65-.07.98 0 .33.03.66.07.98l-2.11 1.65c-.19.15-.24.42-.12.64l2 3.46a.5.5 0 0 0 .61.22l2.49-1c.52.4 1.08.73 1.69.98l.38 2.65c.03.24.24.42.49.42h4c.25 0 .46-.18.49-.42l.38-2.65c.61-.25 1.17-.59 1.69-.98l2.49 1c.06.02.12.03.18.03.17 0 .34-.09.43-.25l2-3.46c.12-.22.07-.49-.12-.64l-2.11-1.65zm-1.98-1.71c.04.31.05.52.05.73 0 .21-.02.43-.05.73l-.14 1.13.89.7 1.08.84-.7 1.21-1.27-.51-1.04-.42-.9.68c-.43.32-.84.56-1.25.73l-1.06.43-.16 1.13-.2 1.35h-1.4l-.19-1.35-.16-1.13-1.06-.43c-.43-.18-.83-.41-1.23-.71l-.91-.7-1.06.43-1.27.51-.7-1.21 1.08-.84.89-.7-.14-1.13c-.03-.31-.05-.54-.05-.74s.02-.43.05-.73l.14-1.13-.89-.7-1.08-.84.7-1.21 1.27.51 1.04.42.9-.68c.43-.32.84-.56 1.25-.73l1.06-.43.16-1.13.2-1.35h1.39l.19 1.35.16 1.13 1.06.43c.43.18.83.41 1.23.71l.91.7 1.06-.43 1.27-.51.7 1.21-1.07.85-.89.7.14 1.13zM12 8c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm0 6c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2z" }, "child": [] }] })(props);
38965
- }
38966
- function MdOutlineClear(props) {
38967
- 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);
38968
- }
38969
- function MdOutlineCloud(props) {
38970
- 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);
38971
- }
38972
- function MdOutlinePhotoLibrary(props) {
38973
- return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "fill": "none", "d": "M0 0h24v24H0V0z" }, "child": [] }, { "tag": "path", "attr": { "d": "M20 4v12H8V4h12m0-2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-8.5 9.67 1.69 2.26 2.48-3.1L19 15H9zM2 6v14c0 1.1.9 2 2 2h14v-2H4V6H2z" }, "child": [] }] })(props);
38974
- }
38975
- function MdOutlinePerson(props) {
38976
- 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);
38977
- }
38978
- 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";
38979
- const Select = ({
38980
- input,
38981
- field,
38982
- options,
38983
- className = ""
38984
- }) => {
38985
- const selectOptions = options || field.options;
38986
- const ref = React__namespace.useRef(null);
38987
- React__namespace.useEffect(() => {
38988
- if (ref.current && (field == null ? void 0 : field.experimental_focusIntent)) {
38989
- ref.current.focus();
38990
- }
38991
- }, [field == null ? void 0 : field.experimental_focusIntent, ref]);
38992
- return /* @__PURE__ */ React__namespace.createElement("div", { className: "relative group w-full md:w-auto" }, /* @__PURE__ */ React__namespace.createElement(
38993
- "select",
38994
- {
38995
- id: input.name,
38996
- ref,
38997
- value: input.value,
38998
- onChange: input.onChange,
38999
- className: `${selectFieldClasses} ${input.value ? "text-gray-700" : "text-gray-300"} } ${className}`,
39000
- ...input
39001
- },
39002
- selectOptions ? selectOptions.map(toProps$1).map(toComponent) : /* @__PURE__ */ React__namespace.createElement("option", null, input.value)
39003
- ), /* @__PURE__ */ React__namespace.createElement(MdKeyboardArrowDown, { className: "absolute top-1/2 right-2 w-6 h-auto -translate-y-1/2 text-gray-300 group-hover:text-blue-500 transition duration-150 ease-out pointer-events-none" }));
39004
- };
39005
- function toProps$1(option) {
39006
- if (typeof option === "object")
39007
- return option;
39008
- return { value: option, label: option };
39009
- }
39010
- function toComponent(option) {
39011
- return /* @__PURE__ */ React__namespace.createElement("option", { key: option.value, value: option.value }, option.label);
39012
- }
39013
- const RadioGroup = ({
39014
- input,
39015
- field,
39016
- options
39017
- }) => {
39018
- const radioOptions = options || field.options;
39019
- const radioRefs = {};
39020
- const toProps2 = (option) => {
39021
- if (typeof option === "object")
39022
- return option;
39023
- return { value: option, label: option };
39024
- };
39025
- const toComponent2 = (option) => {
39026
- const optionId = `field-${field.name}-option-${option.value}`;
39027
- const checked = option.value === input.value;
39028
- return /* @__PURE__ */ React__namespace.createElement(
39029
- "div",
39030
- {
39031
- key: option.value,
39032
- ref: (ref) => {
39033
- radioRefs[`radio_${option.value}`] = ref;
39034
- }
39035
- },
39036
- /* @__PURE__ */ React__namespace.createElement(
39037
- "input",
39038
- {
39039
- className: "absolute w-0 h-0 opacity-0 cursor-pointer",
39040
- type: "radio",
39041
- id: optionId,
39042
- name: input.name,
39043
- value: option.value,
39044
- onChange: (event) => {
39045
- input.onChange(event.target.value);
39046
- },
39047
- checked
39048
- }
39049
- ),
39050
- /* @__PURE__ */ React__namespace.createElement(RadioOption, { htmlFor: optionId, checked }, option.label)
39051
- );
39052
- };
39053
- return /* @__PURE__ */ React__namespace.createElement(RadioOptions, { id: input.name, direction: field.direction }, radioOptions ? radioOptions.map(toProps2).map(toComponent2) : input.value);
39054
- };
39055
- const RadioOptions = ({ direction: direction2, children, ...props }) => /* @__PURE__ */ React__namespace.createElement(
39056
- "div",
39057
- {
39058
- className: `flex w-full ${direction2 === "horizontal" ? "flex-wrap gap-y-1 gap-x-3" : "flex-col gap-1"}`,
39059
- ...props
39060
- },
39061
- children
39062
- );
39063
- const RadioOption = ({ checked, htmlFor, children, ...props }) => /* @__PURE__ */ React__namespace.createElement(
39064
- "label",
39065
- {
39066
- className: "cursor-pointer flex group items-center gap-2",
39067
- htmlFor,
39068
- ...props
39069
- },
39070
- /* @__PURE__ */ React__namespace.createElement(
39071
- "span",
39072
- {
39073
- className: `relative h-[19px] w-[19px] rounded border text-indigo-600 focus:ring-indigo-500 transition ease-out duration-150 ${checked ? "border-blue-500 bg-blue-500 shadow-sm group-hover:bg-blue-400 group-hover:border-blue-400" : "border-gray-200 bg-white shadow-inner group-hover:bg-gray-100"}`
39074
- },
39075
- /* @__PURE__ */ React__namespace.createElement(
39076
- BiCheck,
39077
- {
39078
- className: `absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[17px] h-[17px] transition ease-out duration-150 ${checked ? "opacity-100 text-white group-hover:opacity-80" : "text-blue-500 opacity-0 grou-hover:opacity-30"}`
39079
- }
39080
- )
39081
- ),
39082
- /* @__PURE__ */ React__namespace.createElement(
39083
- "span",
39084
- {
39085
- className: `relative transition ease-out duration-150 ${checked ? "text-gray-800 opacity-100" : "text-gray-700 opacity-70 group-hover:opacity-100"}`
39086
- },
39087
- children
39088
- )
39089
- );
39090
- const CheckboxGroup = ({
39091
- input,
39092
- field,
39093
- options,
39094
- disabled = false
39095
- }) => {
39096
- const checkboxOptions = options || field.options;
39097
- const toProps2 = (option) => {
39098
- if (typeof option === "object")
39099
- return option;
39100
- return { value: option, label: option };
39101
- };
39102
- const toComponent2 = (option) => {
39103
- const optionId = `field-${field.name}-option-${option.value}`;
39104
- const checked = input.value ? input.value.includes(option.value) : false;
39105
- return /* @__PURE__ */ React__namespace.createElement("div", { key: option.value }, /* @__PURE__ */ React__namespace.createElement(
39106
- "input",
39107
- {
39108
- className: "absolute w-0 h-0 opacity-0 cursor-pointer",
39109
- type: "checkbox",
39110
- name: input.name,
39111
- id: optionId,
39112
- value: option.value,
39113
- checked,
39114
- disabled,
39115
- onChange: (event) => {
39116
- if (event.target.checked === true) {
39117
- input.onChange([...input.value, event.target.value]);
39118
- } else {
39119
- input.onChange([
39120
- ...input.value.filter((v) => v !== event.target.value)
39121
- ]);
39122
- }
39123
- }
39124
- }
39125
- ), /* @__PURE__ */ React__namespace.createElement(
39126
- "label",
39127
- {
39128
- className: "cursor-pointer flex group items-center gap-2",
39129
- htmlFor: optionId
39130
- },
39131
- /* @__PURE__ */ React__namespace.createElement(
39132
- "span",
39133
- {
39134
- className: `relative h-[18px] w-[18px] rounded border text-indigo-600 focus:ring-indigo-500 transition ease-out duration-150 ${checked ? "border-blue-500 bg-blue-500 shadow-sm group-hover:bg-blue-400 group-hover:border-blue-400" : "border-gray-200 bg-white shadow-inner group-hover:bg-gray-100"}`
39135
- },
39136
- /* @__PURE__ */ React__namespace.createElement(
39137
- BiCheck,
39138
- {
39139
- className: `absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[17px] h-[17px] transition ease-out duration-150 ${checked ? "opacity-100 text-white group-hover:opacity-80" : "text-blue-500 opacity-0 grou-hover:opacity-30"}`
39140
- }
39141
- )
39142
- ),
39143
- /* @__PURE__ */ React__namespace.createElement(
39144
- "span",
39145
- {
39146
- className: `relative transition ease-out duration-150 ${checked ? "text-gray-800 opacity-100" : "text-gray-700 opacity-70 group-hover:opacity-100"}`
39147
- },
39148
- option.label
39149
- )
39150
- ));
39151
- };
39152
- return /* @__PURE__ */ React__namespace.createElement(
39153
- "div",
39154
- {
39155
- className: `flex w-full ${field.direction === "horizontal" ? "flex-wrap gap-y-1 gap-x-3" : "flex-col gap-1"}`,
39156
- id: input.name
39157
- },
39158
- checkboxOptions == null ? void 0 : checkboxOptions.map(toProps2).map(toComponent2)
39159
- );
39160
- };
39161
- const Input = ({ ...props }) => {
39162
- return /* @__PURE__ */ React.createElement("input", { className: textFieldClasses, ...props });
39163
- };
39164
- const NumberInput = ({
39165
- onChange,
39166
- value,
39167
- step
39168
- }) => /* @__PURE__ */ React__namespace.createElement(
39169
- Input,
39170
- {
39171
- type: "number",
39172
- step,
39173
- value,
39174
- onChange: (event) => {
39175
- const inputValue = event.target.value;
39176
- const newValue = inputValue === "" ? void 0 : inputValue;
39177
- if (onChange) {
39178
- const syntheticEvent = {
39179
- ...event,
39180
- target: {
39181
- ...event.target,
39182
- value: newValue
39183
- }
39184
- };
39185
- onChange(syntheticEvent);
39186
- }
39187
- }
39188
- }
39189
- );
39190
- function cn$1(...inputs) {
39191
- return tailwindMerge.twMerge(clsx.clsx(inputs));
39192
- }
39193
- const Button$1 = ({
39194
- variant = "secondary",
39195
- as: Tag2 = "button",
39196
- size: size2 = "medium",
39197
- busy,
39198
- disabled,
39199
- rounded = "full",
39200
- children,
39201
- className = "",
39202
- ...props
39203
- }) => {
39204
- 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 ";
39205
- const variantClasses = {
39206
- primary: `shadow text-white bg-tina-orange-dark hover:bg-tina-orange focus:ring-tina-orange-dark border-0`,
39207
- secondary: `shadow text-gray-500 hover:tina-orange-dark bg-gray-50 hover:bg-white border border-gray-100`,
39208
- white: `shadow text-gray-500 hover:tina-orange-dark bg-white hover:bg-gray-50 border border-gray-100`,
39209
- ghost: `text-gray-500 hover:tina-orange-dark hover:shadow border border-transparent border-0 hover:border hover:border-gray-200 bg-transparent`,
39210
- danger: `shadow text-white bg-red-500 hover:bg-red-600 focus:ring-red-500`,
39211
- accent: `shadow text-white bg-orange-500 hover:bg-orange-600 focus:ring-orange-500`,
39212
- custom: ""
39213
- };
39214
- const state = busy ? `busy` : disabled ? `disabled` : `default`;
39215
- const stateClasses = {
39216
- disabled: `pointer-events-none opacity-30 cursor-not-allowed`,
39217
- busy: `pointer-events-none opacity-70 cursor-wait`,
39218
- default: ``
39219
- };
39220
- const roundedClasses = {
39221
- full: `rounded`,
39222
- left: `rounded-l`,
39223
- right: `rounded-r`,
39224
- custom: "",
39225
- none: ""
39226
- };
39227
- const sizeClasses = {
39228
- small: `text-xs h-8 px-3`,
39229
- medium: `text-sm h-10 px-8`,
39230
- custom: ``
39231
- };
39232
- return /* @__PURE__ */ React__namespace.createElement(
39233
- Tag2,
39234
- {
39235
- className: cn$1(
39236
- baseClasses,
39237
- variantClasses[variant],
39238
- sizeClasses[size2],
39239
- stateClasses[state],
39240
- roundedClasses[rounded],
39241
- className
39242
- ),
39243
- ...props
39244
- },
39245
- children
39246
- );
39247
- };
39248
- const IconButton = ({
39249
- variant = "secondary",
39250
- size: size2 = "medium",
39251
- busy,
39252
- disabled,
39253
- children,
39254
- className,
39255
- ...props
39256
- }) => {
39257
- 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";
39258
- const variantClasses = {
39259
- primary: `shadow text-white bg-tina-orange-dark hover:bg-tina-orange focus:ring-tina-orange-dark`,
39260
- secondary: `shadow text-gray-500 hover:text-blue-500 bg-gray-50 hover:bg-white border border-gray-200`,
39261
- white: `shadow text-gray-500 hover:text-blue-500 bg-white hover:bg-gray-50 border border-gray-200`,
39262
- ghost: `text-gray-500 hover:text-blue-500 hover:shadow border border-transparent hover:border-gray-200 bg-transparent`,
39263
- accent: `shadow text-white bg-orange-500 hover:bg-orange-600 focus:ring-orange-500`
39264
- };
39265
- const state = busy ? `busy` : disabled ? `disabled` : `default`;
39266
- const stateClasses = {
39267
- disabled: `pointer-events-none opacity-30 cursor-not-allowed`,
39268
- busy: `pointer-events-none opacity-70 cursor-wait`,
39269
- default: ``
39270
- };
39271
- const sizeClasses = {
39272
- small: `h-7 w-7`,
39273
- medium: `h-9 w-9`,
39274
- custom: ``
39275
- };
39276
- return /* @__PURE__ */ React__namespace.createElement(
39277
- "button",
39278
- {
39279
- className: cn$1(
39280
- baseClasses,
39281
- variantClasses[variant],
39282
- sizeClasses[size2],
39283
- stateClasses[state],
39284
- className
39285
- ),
39286
- ...props
39287
- },
39288
- children
39289
- );
39290
- };
39291
- function FontLoader() {
39292
- React__namespace.useEffect(() => {
39293
- const link = document.createElement("link");
39294
- link.href = "https://fonts.googleapis.com/css2?family=Inter:wght@400;600&family=Libre+Baskerville:wght@400;500;600;700&display=swap";
39295
- link.rel = "stylesheet";
39296
- document.head.appendChild(link);
39297
- return () => {
39298
- document.head.removeChild(link);
39299
- };
39300
- }, []);
39301
- return null;
39302
- }
39303
- function classNames(...classes) {
39304
- return classes.filter(Boolean).join(" ");
39305
- }
39306
- const OverflowMenu$1 = ({ toolbarItems: toolbarItems2, className = "w-full" }) => {
39307
- const [open, setOpen] = React.useState(false);
39308
- return /* @__PURE__ */ React.createElement(React.Fragment, null, toolbarItems2.length > 0 && /* @__PURE__ */ React.createElement(PopoverPrimitive__namespace.Root, { open, onOpenChange: setOpen }, /* @__PURE__ */ React.createElement(
39309
- PopoverPrimitive__namespace.Trigger,
39310
- {
39311
- 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}}`
39312
- },
39313
- /* @__PURE__ */ React.createElement(
39314
- "svg",
39315
- {
39316
- xmlns: "http://www.w3.org/2000/svg",
39317
- className: "h-5 w-5",
39318
- fill: "none",
39319
- viewBox: "0 0 24 24",
39320
- stroke: "currentColor"
39321
- },
39322
- /* @__PURE__ */ React.createElement(
39323
- "path",
39324
- {
39325
- strokeLinecap: "round",
39326
- strokeLinejoin: "round",
39327
- strokeWidth: 2,
39328
- 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"
39329
- }
39330
- )
39331
- )
39332
- ), /* @__PURE__ */ React.createElement(PopoverPrimitive__namespace.Portal, null, /* @__PURE__ */ React.createElement(PopoverPrimitive__namespace.Content, { style: { zIndex: 2e4 }, align: "end" }, /* @__PURE__ */ React.createElement("div", { className: "mt-0 -mr-1 rounded shadow-lg bg-white ring-1 ring-black ring-opacity-5 py-1" }, toolbarItems2.map((toolbarItem) => {
39333
- return /* @__PURE__ */ React.createElement(
39334
- "span",
39335
- {
39336
- "data-test": `${toolbarItem.name}OverflowButton`,
39337
- key: toolbarItem.name,
39338
- onMouseDown: (event) => {
39339
- event.preventDefault();
39340
- toolbarItem.onMouseDown(event);
39341
- setOpen(false);
39342
- },
39343
- className: classNames(
39344
- toolbarItem.active ? "bg-gray-50 text-blue-500" : "bg-white text-gray-600",
39345
- "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",
39346
- toolbarItem.className ?? ""
39347
- )
39348
- },
39349
- /* @__PURE__ */ React.createElement("div", { className: "mr-2 opacity-80" }, toolbarItem.Icon),
39350
- " ",
39351
- toolbarItem.label
39352
- );
39353
- }))))));
39354
- };
39355
- function BsArrowRightShort(props) {
39356
- 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);
39357
- }
39358
- function BsCheckCircleFill(props) {
39359
- 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);
39360
- }
39361
- function BsExclamationOctagonFill(props) {
39362
- 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);
39363
- }
39364
- const MessageIcon = ({
39365
- type = "success",
39366
- className = ""
39367
- }) => {
39368
- const icons = {
39369
- success: BiCheckCircle,
39370
- warning: BiError,
39371
- error: BiError,
39372
- info: BiInfoCircle
39373
- };
39374
- const Icon = icons[type];
39375
- return /* @__PURE__ */ React.createElement(Icon, { className });
39376
- };
39377
- const Message = ({
39378
- children,
39379
- type = "success",
39380
- size: size2 = "medium",
39381
- className = "",
39382
- link,
39383
- linkLabel = "Learn More"
39384
- }) => {
39385
- const containerClasses = {
39386
- success: "bg-gradient-to-r from-green-50 to-green-100 border-green-200",
39387
- warning: "bg-gradient-to-r from-yellow-50 to-yellow-100 border-yellow-200",
39388
- error: "bg-gradient-to-r from-red-50 to-red-100 border-red-200",
39389
- info: "bg-gradient-to-r from-blue-50 to-blue-100 border-blue-100"
39390
- };
39391
- const textClasses = {
39392
- success: "text-green-700",
39393
- warning: "text-yellow-700",
39394
- error: "text-red-700",
39395
- info: "text-blue-700"
39396
- };
39397
- const iconClasses = {
39398
- success: "text-green-400",
39399
- warning: "text-yellow-400",
39400
- error: "text-red-400",
39401
- info: "text-blue-400"
39402
- };
39403
- const sizeClasses = {
39404
- small: "px-3 py-1.5 text-xs",
39405
- medium: "px-4 py-2.5 text-sm"
39406
- };
39407
- return /* @__PURE__ */ React.createElement(
39408
- "div",
39409
- {
39410
- className: `rounded-lg border shadow-sm ${sizeClasses[size2]} ${containerClasses[type]} ${className}`
39411
- },
39412
- /* @__PURE__ */ React.createElement("div", { className: "flex flex-col sm:flex-row items-start sm:items-center gap-2" }, /* @__PURE__ */ React.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ React.createElement(
39413
- MessageIcon,
39414
- {
39415
- type,
39416
- className: `${size2 === "small" ? "w-5" : "w-6"} h-auto flex-shrink-0 ${iconClasses[type]}`
39417
- }
39418
- ), /* @__PURE__ */ React.createElement("div", { className: `flex-1 ${textClasses[type]}` }, children)), link && /* @__PURE__ */ React.createElement(
39419
- "a",
39420
- {
39421
- href: link,
39422
- target: "_blank",
39423
- 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"
39424
- },
39425
- linkLabel,
39426
- " ",
39427
- /* @__PURE__ */ React.createElement(BsArrowRightShort, { className: "w-4 h-auto" })
39428
- ))
39429
- );
39430
- };
39431
- function cn(...inputs) {
39432
- return tailwindMerge.twMerge(clsx.clsx(inputs));
39433
- }
39434
- function DropdownMenu({
39435
- ...props
39436
- }) {
39437
- return /* @__PURE__ */ React__namespace.createElement(DropdownMenuPrimitive__namespace.Root, { "data-slot": "dropdown-menu", ...props });
39438
- }
39439
- function DropdownMenuTrigger({
39440
- ...props
39441
- }) {
39442
- return /* @__PURE__ */ React__namespace.createElement(
39443
- DropdownMenuPrimitive__namespace.Trigger,
39444
- {
39445
- "data-slot": "dropdown-menu-trigger",
39446
- ...props
39447
- }
39448
- );
39449
- }
39450
- function DropdownMenuContent({
39451
- className,
39452
- sideOffset = 4,
39453
- ...props
39454
- }) {
39455
- return /* @__PURE__ */ React__namespace.createElement(DropdownMenuPrimitive__namespace.Portal, null, /* @__PURE__ */ React__namespace.createElement(
39456
- DropdownMenuPrimitive__namespace.Content,
39598
+ ))
39599
+ )), labels && /* @__PURE__ */ React__namespace.createElement(
39600
+ "span",
39457
39601
  {
39458
- "data-slot": "dropdown-menu-content",
39459
- sideOffset,
39460
- className: cn(
39461
- "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",
39462
- className
39463
- ),
39464
- ...props
39465
- }
39602
+ className: `text-sm ${checked ? "text-blue-500 font-bold" : "text-gray-300"}`
39603
+ },
39604
+ labels.true
39466
39605
  ));
39467
- }
39468
- function DropdownMenuItem({
39469
- className,
39470
- inset,
39471
- variant = "default",
39472
- ...props
39473
- }) {
39606
+ };
39607
+ const ToggleInput = ({ disabled, ...props }) => {
39474
39608
  return /* @__PURE__ */ React__namespace.createElement(
39475
- DropdownMenuPrimitive__namespace.Item,
39609
+ "input",
39476
39610
  {
39477
- "data-slot": "dropdown-menu-item",
39478
- "data-inset": inset,
39479
- "data-variant": variant,
39480
- className: cn(
39481
- "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",
39482
- className
39483
- ),
39611
+ className: `absolute left-0 top-0 w-12 h-8 opacity-0 m-0 ${disabled ? `cursor-not-allowed pointer-events-none` : `cursor-pointer z-20`}`,
39484
39612
  ...props
39485
39613
  }
39486
39614
  );
39615
+ };
39616
+ function MdCheckCircle(props) {
39617
+ 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 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z" }, "child": [] }] })(props);
39487
39618
  }
39488
- function DropdownMenuSeparator({
39489
- className,
39490
- ...props
39491
- }) {
39492
- return /* @__PURE__ */ React__namespace.createElement(
39493
- DropdownMenuPrimitive__namespace.Separator,
39494
- {
39495
- "data-slot": "dropdown-menu-separator",
39496
- className: cn("bg-border -mx-1 my-1 h-px", className),
39497
- ...props
39619
+ function MdInfo(props) {
39620
+ 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 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z" }, "child": [] }] })(props);
39621
+ }
39622
+ function MdError(props) {
39623
+ 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 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z" }, "child": [] }] })(props);
39624
+ }
39625
+ function MdWarning(props) {
39626
+ return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "fill": "none", "d": "M0 0h24v24H0z" }, "child": [] }, { "tag": "path", "attr": { "d": "M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z" }, "child": [] }] })(props);
39627
+ }
39628
+ function MdVpnKey(props) {
39629
+ 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);
39630
+ }
39631
+ function MdAccessTime(props) {
39632
+ 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);
39633
+ }
39634
+ function MdKeyboardArrowDown(props) {
39635
+ 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);
39636
+ }
39637
+ function MdArrowForward(props) {
39638
+ 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 4-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z" }, "child": [] }] })(props);
39639
+ }
39640
+ function MdSyncProblem(props) {
39641
+ 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);
39642
+ }
39643
+ function MdWifiOff(props) {
39644
+ 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);
39645
+ }
39646
+ function MdOutlineHelpOutline(props) {
39647
+ 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);
39648
+ }
39649
+ function MdOutlineSettings(props) {
39650
+ 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.43 12.98c.04-.32.07-.64.07-.98 0-.34-.03-.66-.07-.98l2.11-1.65c.19-.15.24-.42.12-.64l-2-3.46a.5.5 0 0 0-.61-.22l-2.49 1c-.52-.4-1.08-.73-1.69-.98l-.38-2.65A.488.488 0 0 0 14 2h-4c-.25 0-.46.18-.49.42l-.38 2.65c-.61.25-1.17.59-1.69.98l-2.49-1a.566.566 0 0 0-.18-.03c-.17 0-.34.09-.43.25l-2 3.46c-.13.22-.07.49.12.64l2.11 1.65c-.04.32-.07.65-.07.98 0 .33.03.66.07.98l-2.11 1.65c-.19.15-.24.42-.12.64l2 3.46a.5.5 0 0 0 .61.22l2.49-1c.52.4 1.08.73 1.69.98l.38 2.65c.03.24.24.42.49.42h4c.25 0 .46-.18.49-.42l.38-2.65c.61-.25 1.17-.59 1.69-.98l2.49 1c.06.02.12.03.18.03.17 0 .34-.09.43-.25l2-3.46c.12-.22.07-.49-.12-.64l-2.11-1.65zm-1.98-1.71c.04.31.05.52.05.73 0 .21-.02.43-.05.73l-.14 1.13.89.7 1.08.84-.7 1.21-1.27-.51-1.04-.42-.9.68c-.43.32-.84.56-1.25.73l-1.06.43-.16 1.13-.2 1.35h-1.4l-.19-1.35-.16-1.13-1.06-.43c-.43-.18-.83-.41-1.23-.71l-.91-.7-1.06.43-1.27.51-.7-1.21 1.08-.84.89-.7-.14-1.13c-.03-.31-.05-.54-.05-.74s.02-.43.05-.73l.14-1.13-.89-.7-1.08-.84.7-1.21 1.27.51 1.04.42.9-.68c.43-.32.84-.56 1.25-.73l1.06-.43.16-1.13.2-1.35h1.39l.19 1.35.16 1.13 1.06.43c.43.18.83.41 1.23.71l.91.7 1.06-.43 1.27-.51.7 1.21-1.07.85-.89.7.14 1.13zM12 8c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm0 6c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2z" }, "child": [] }] })(props);
39651
+ }
39652
+ function MdOutlineClear(props) {
39653
+ 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);
39654
+ }
39655
+ function MdOutlineDataSaverOff(props) {
39656
+ 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);
39657
+ }
39658
+ function MdOutlineCloud(props) {
39659
+ 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);
39660
+ }
39661
+ function MdOutlinePhotoLibrary(props) {
39662
+ return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "fill": "none", "d": "M0 0h24v24H0V0z" }, "child": [] }, { "tag": "path", "attr": { "d": "M20 4v12H8V4h12m0-2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-8.5 9.67 1.69 2.26 2.48-3.1L19 15H9zM2 6v14c0 1.1.9 2 2 2h14v-2H4V6H2z" }, "child": [] }] })(props);
39663
+ }
39664
+ function MdOutlinePerson(props) {
39665
+ 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);
39666
+ }
39667
+ 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";
39668
+ const Select = ({
39669
+ input,
39670
+ field,
39671
+ options,
39672
+ className = ""
39673
+ }) => {
39674
+ const selectOptions = options || field.options;
39675
+ const ref = React__namespace.useRef(null);
39676
+ React__namespace.useEffect(() => {
39677
+ if (ref.current && (field == null ? void 0 : field.experimental_focusIntent)) {
39678
+ ref.current.focus();
39498
39679
  }
39499
- );
39680
+ }, [field == null ? void 0 : field.experimental_focusIntent, ref]);
39681
+ return /* @__PURE__ */ React__namespace.createElement("div", { className: "relative group w-full h-full md:w-auto" }, /* @__PURE__ */ React__namespace.createElement(
39682
+ "select",
39683
+ {
39684
+ id: input.name,
39685
+ ref,
39686
+ value: input.value,
39687
+ onChange: input.onChange,
39688
+ className: `${selectFieldClasses} ${input.value ? "text-gray-700" : "text-gray-300"} } ${className}`,
39689
+ ...input
39690
+ },
39691
+ selectOptions ? selectOptions.map(toProps$1).map(toComponent) : /* @__PURE__ */ React__namespace.createElement("option", null, input.value)
39692
+ ), /* @__PURE__ */ React__namespace.createElement(MdKeyboardArrowDown, { className: "absolute top-1/2 right-2 w-6 h-auto -translate-y-1/2 text-gray-300 group-hover:text-blue-500 transition duration-150 ease-out pointer-events-none" }));
39693
+ };
39694
+ function toProps$1(option) {
39695
+ if (typeof option === "object")
39696
+ return option;
39697
+ return { value: option, label: option };
39500
39698
  }
39501
- const DropdownButton = React__namespace.forwardRef(
39502
- ({
39503
- variant = "primary",
39504
- size: size2 = "medium",
39505
- busy,
39506
- disabled,
39507
- rounded = "full",
39508
- children,
39509
- className = "",
39510
- onMainAction,
39511
- items: items2,
39512
- showSplitButton = true,
39699
+ function toComponent(option) {
39700
+ return /* @__PURE__ */ React__namespace.createElement("option", { key: option.value, value: option.value }, option.label);
39701
+ }
39702
+ const RadioGroup = ({
39703
+ input,
39704
+ field,
39705
+ options
39706
+ }) => {
39707
+ const radioOptions = options || field.options;
39708
+ const radioRefs = {};
39709
+ const toProps2 = (option) => {
39710
+ if (typeof option === "object")
39711
+ return option;
39712
+ return { value: option, label: option };
39713
+ };
39714
+ const toComponent2 = (option) => {
39715
+ const optionId = `field-${field.name}-option-${option.value}`;
39716
+ const checked = option.value === input.value;
39717
+ return /* @__PURE__ */ React__namespace.createElement(
39718
+ "div",
39719
+ {
39720
+ key: option.value,
39721
+ ref: (ref) => {
39722
+ radioRefs[`radio_${option.value}`] = ref;
39723
+ }
39724
+ },
39725
+ /* @__PURE__ */ React__namespace.createElement(
39726
+ "input",
39727
+ {
39728
+ className: "absolute w-0 h-0 opacity-0 cursor-pointer",
39729
+ type: "radio",
39730
+ id: optionId,
39731
+ name: input.name,
39732
+ value: option.value,
39733
+ onChange: (event) => {
39734
+ input.onChange(event.target.value);
39735
+ },
39736
+ checked
39737
+ }
39738
+ ),
39739
+ /* @__PURE__ */ React__namespace.createElement(RadioOption, { htmlFor: optionId, checked }, option.label)
39740
+ );
39741
+ };
39742
+ return /* @__PURE__ */ React__namespace.createElement(RadioOptions, { id: input.name, direction: field.direction }, radioOptions ? radioOptions.map(toProps2).map(toComponent2) : input.value);
39743
+ };
39744
+ const RadioOptions = ({ direction: direction2, children, ...props }) => /* @__PURE__ */ React__namespace.createElement(
39745
+ "div",
39746
+ {
39747
+ className: `flex w-full ${direction2 === "horizontal" ? "flex-wrap gap-y-1 gap-x-3" : "flex-col gap-1"}`,
39513
39748
  ...props
39514
- }, ref) => {
39515
- const [open, setOpen] = React__namespace.useState(false);
39516
- if (!onMainAction || !showSplitButton) {
39517
- return /* @__PURE__ */ React__namespace.createElement(DropdownMenu, { open, onOpenChange: setOpen, modal: false }, /* @__PURE__ */ React__namespace.createElement(DropdownMenuTrigger, { asChild: true }, /* @__PURE__ */ React__namespace.createElement(
39518
- Button$1,
39749
+ },
39750
+ children
39751
+ );
39752
+ const RadioOption = ({ checked, htmlFor, children, ...props }) => /* @__PURE__ */ React__namespace.createElement(
39753
+ "label",
39754
+ {
39755
+ className: "cursor-pointer flex group items-center gap-2",
39756
+ htmlFor,
39757
+ ...props
39758
+ },
39759
+ /* @__PURE__ */ React__namespace.createElement(
39760
+ "span",
39761
+ {
39762
+ className: `relative h-[19px] w-[19px] rounded border text-indigo-600 focus:ring-indigo-500 transition ease-out duration-150 ${checked ? "border-blue-500 bg-blue-500 shadow-sm group-hover:bg-blue-400 group-hover:border-blue-400" : "border-gray-200 bg-white shadow-inner group-hover:bg-gray-100"}`
39763
+ },
39764
+ /* @__PURE__ */ React__namespace.createElement(
39765
+ BiCheck,
39766
+ {
39767
+ className: `absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[17px] h-[17px] transition ease-out duration-150 ${checked ? "opacity-100 text-white group-hover:opacity-80" : "text-blue-500 opacity-0 grou-hover:opacity-30"}`
39768
+ }
39769
+ )
39770
+ ),
39771
+ /* @__PURE__ */ React__namespace.createElement(
39772
+ "span",
39773
+ {
39774
+ className: `relative transition ease-out duration-150 ${checked ? "text-gray-800 opacity-100" : "text-gray-700 opacity-70 group-hover:opacity-100"}`
39775
+ },
39776
+ children
39777
+ )
39778
+ );
39779
+ const CheckboxGroup = ({
39780
+ input,
39781
+ field,
39782
+ options,
39783
+ disabled = false
39784
+ }) => {
39785
+ const checkboxOptions = options || field.options;
39786
+ const toProps2 = (option) => {
39787
+ if (typeof option === "object")
39788
+ return option;
39789
+ return { value: option, label: option };
39790
+ };
39791
+ const toComponent2 = (option) => {
39792
+ const optionId = `field-${field.name}-option-${option.value}`;
39793
+ const checked = input.value ? input.value.includes(option.value) : false;
39794
+ return /* @__PURE__ */ React__namespace.createElement("div", { key: option.value }, /* @__PURE__ */ React__namespace.createElement(
39795
+ "input",
39796
+ {
39797
+ className: "absolute w-0 h-0 opacity-0 cursor-pointer",
39798
+ type: "checkbox",
39799
+ name: input.name,
39800
+ id: optionId,
39801
+ value: option.value,
39802
+ checked,
39803
+ disabled,
39804
+ onChange: (event) => {
39805
+ if (event.target.checked === true) {
39806
+ input.onChange([...input.value, event.target.value]);
39807
+ } else {
39808
+ input.onChange([
39809
+ ...input.value.filter((v) => v !== event.target.value)
39810
+ ]);
39811
+ }
39812
+ }
39813
+ }
39814
+ ), /* @__PURE__ */ React__namespace.createElement(
39815
+ "label",
39816
+ {
39817
+ className: "cursor-pointer flex group items-center gap-2",
39818
+ htmlFor: optionId
39819
+ },
39820
+ /* @__PURE__ */ React__namespace.createElement(
39821
+ "span",
39519
39822
  {
39520
- variant,
39521
- size: size2,
39522
- busy,
39523
- disabled,
39524
- rounded,
39525
- className: cn$1("gap-2", className),
39526
- ...props
39823
+ className: `relative h-[18px] w-[18px] rounded border text-indigo-600 focus:ring-indigo-500 transition ease-out duration-150 ${checked ? "border-blue-500 bg-blue-500 shadow-sm group-hover:bg-blue-400 group-hover:border-blue-400" : "border-gray-200 bg-white shadow-inner group-hover:bg-gray-100"}`
39527
39824
  },
39528
- children,
39529
39825
  /* @__PURE__ */ React__namespace.createElement(
39530
- lucideReact.ChevronDownIcon,
39826
+ BiCheck,
39531
39827
  {
39532
- className: cn$1(
39533
- "h-4 w-4 transition-transform duration-200",
39534
- open && "rotate-180"
39535
- )
39828
+ className: `absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[17px] h-[17px] transition ease-out duration-150 ${checked ? "opacity-100 text-white group-hover:opacity-80" : "text-blue-500 opacity-0 grou-hover:opacity-30"}`
39536
39829
  }
39537
39830
  )
39538
- )), /* @__PURE__ */ React__namespace.createElement(DropdownMenuContent, { align: "end", side: "bottom", className: "z-[100000]" }, items2.map((item, index) => /* @__PURE__ */ React__namespace.createElement(
39539
- DropdownMenuItem,
39540
- {
39541
- key: index,
39542
- onClick: item.onClick,
39543
- disabled: item.disabled,
39544
- variant: item.variant
39545
- },
39546
- item.icon && item.icon,
39547
- item.label
39548
- ))));
39549
- }
39550
- return /* @__PURE__ */ React__namespace.createElement("div", { className: cn$1("inline-flex", className) }, /* @__PURE__ */ React__namespace.createElement(
39551
- Button$1,
39552
- {
39553
- variant,
39554
- size: size2,
39555
- busy,
39556
- disabled,
39557
- rounded: "left",
39558
- onClick: onMainAction,
39559
- className: "border-r-0 w-full",
39560
- ...props
39561
- },
39562
- children
39563
- ), /* @__PURE__ */ React__namespace.createElement(DropdownMenu, { open, onOpenChange: setOpen }, /* @__PURE__ */ React__namespace.createElement(DropdownMenuTrigger, null, /* @__PURE__ */ React__namespace.createElement(
39564
- Button$1,
39565
- {
39566
- variant,
39567
- size: size2,
39568
- busy,
39569
- disabled,
39570
- rounded: "right",
39571
- className: "px-4 border-l",
39572
- style: { borderColor: "#00000030" },
39573
- "aria-label": "More options"
39574
- },
39831
+ ),
39575
39832
  /* @__PURE__ */ React__namespace.createElement(
39576
- lucideReact.ChevronDownIcon,
39577
- {
39578
- className: cn$1(
39579
- "h-4 w-4 transition-transform duration-200 fill-none",
39580
- open && "rotate-180"
39581
- ),
39582
- style: { fill: "none" }
39583
- }
39584
- )
39585
- )), /* @__PURE__ */ React__namespace.createElement(DropdownMenuContent, { align: "end", side: "bottom" }, items2.map((item, index) => {
39586
- var _a2;
39587
- return /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, { key: index }, /* @__PURE__ */ React__namespace.createElement(
39588
- DropdownMenuItem,
39833
+ "span",
39589
39834
  {
39590
- onClick: item.onClick,
39591
- disabled: item.disabled,
39592
- variant: item.variant
39835
+ className: `relative transition ease-out duration-150 ${checked ? "text-gray-800 opacity-100" : "text-gray-700 opacity-70 group-hover:opacity-100"}`
39593
39836
  },
39594
- item.icon && item.icon,
39595
- item.label
39596
- ), item.variant === "destructive" && index < items2.length - 1 && ((_a2 = items2[index + 1]) == null ? void 0 : _a2.variant) !== "destructive" && /* @__PURE__ */ React__namespace.createElement(DropdownMenuSeparator, null));
39597
- }))));
39837
+ option.label
39838
+ )
39839
+ ));
39840
+ };
39841
+ return /* @__PURE__ */ React__namespace.createElement(
39842
+ "div",
39843
+ {
39844
+ className: `flex w-full ${field.direction === "horizontal" ? "flex-wrap gap-y-1 gap-x-3" : "flex-col gap-1"}`,
39845
+ id: input.name
39846
+ },
39847
+ checkboxOptions == null ? void 0 : checkboxOptions.map(toProps2).map(toComponent2)
39848
+ );
39849
+ };
39850
+ const Input = ({ ...props }) => {
39851
+ return /* @__PURE__ */ React.createElement("input", { className: textFieldClasses, ...props });
39852
+ };
39853
+ const NumberInput = ({
39854
+ onChange,
39855
+ value,
39856
+ step
39857
+ }) => /* @__PURE__ */ React__namespace.createElement(
39858
+ Input,
39859
+ {
39860
+ type: "number",
39861
+ step,
39862
+ value,
39863
+ onChange: (event) => {
39864
+ const inputValue = event.target.value;
39865
+ const newValue = inputValue === "" ? void 0 : inputValue;
39866
+ if (onChange) {
39867
+ const syntheticEvent = {
39868
+ ...event,
39869
+ target: {
39870
+ ...event.target,
39871
+ value: newValue
39872
+ }
39873
+ };
39874
+ onChange(syntheticEvent);
39875
+ }
39876
+ }
39598
39877
  }
39599
39878
  );
39600
- DropdownButton.displayName = "DropdownButton";
39601
39879
  function useCMS() {
39602
39880
  return useCMS$1();
39603
39881
  }
@@ -40292,19 +40570,25 @@ Please wrap them with useCallback or configure the deps array correctly.`
40292
40570
  /* @__PURE__ */ React.createElement(AddIcon, { className: "w-5/6 h-auto" })
40293
40571
  )
40294
40572
  },
40295
- /* @__PURE__ */ React.createElement(ListPanel, null, /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(reactBeautifulDnd.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(
40296
- Item$2,
40573
+ /* @__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(
40574
+ SortableProvider,
40297
40575
  {
40298
- key: index2,
40299
- tinaForm,
40300
- field,
40301
- item,
40302
- index: index2,
40303
- isMin,
40304
- fixedLength,
40305
- ...itemProps(item)
40306
- }
40307
- )), provider.placeholder))))
40576
+ items: items2.map((_, index2) => `${field.name}.${index2}`)
40577
+ },
40578
+ items2.map((item, index2) => /* @__PURE__ */ React.createElement(
40579
+ Item$2,
40580
+ {
40581
+ key: index2,
40582
+ tinaForm,
40583
+ field,
40584
+ item,
40585
+ index: index2,
40586
+ isMin,
40587
+ fixedLength,
40588
+ ...itemProps(item)
40589
+ }
40590
+ ))
40591
+ ), provider.placeholder))))
40308
40592
  );
40309
40593
  };
40310
40594
  const Item$2 = ({
@@ -40324,14 +40608,20 @@ Please wrap them with useCallback or configure the deps array correctly.`
40324
40608
  const title = label || `${field.label || field.name} Item`;
40325
40609
  const { dispatch: setHoveredField } = useEvent("field:hover");
40326
40610
  const { dispatch: setFocusedField } = useEvent("field:focus");
40327
- return /* @__PURE__ */ React.createElement(reactBeautifulDnd.Draggable, { draggableId: `${field.name}.${index}`, index }, (provider, snapshot) => /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
40611
+ return /* @__PURE__ */ React.createElement(Draggable, { draggableId: `${field.name}.${index}`, index }, (provider, snapshot) => /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
40328
40612
  ItemHeader,
40329
40613
  {
40330
40614
  provider,
40331
40615
  isDragging: snapshot.isDragging,
40332
40616
  ...p2
40333
40617
  },
40334
- /* @__PURE__ */ React.createElement(DragHandle, { isDragging: snapshot.isDragging }),
40618
+ /* @__PURE__ */ React.createElement(
40619
+ DragHandle,
40620
+ {
40621
+ isDragging: snapshot.isDragging,
40622
+ dragHandleProps: provider.dragHandleProps
40623
+ }
40624
+ ),
40335
40625
  /* @__PURE__ */ React.createElement(
40336
40626
  ItemClickTarget,
40337
40627
  {
@@ -40395,17 +40685,16 @@ Please wrap them with useCallback or configure the deps array correctly.`
40395
40685
  provider,
40396
40686
  ...props
40397
40687
  }) => {
40688
+ var _a2, _b;
40398
40689
  return /* @__PURE__ */ React.createElement(
40399
40690
  "div",
40400
40691
  {
40401
- ref: provider.innerRef,
40692
+ ref: (_a2 = provider.draggableProps) == null ? void 0 : _a2.ref,
40402
40693
  ...provider.draggableProps,
40403
- ...provider.dragHandleProps,
40404
40694
  ...props,
40405
40695
  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 ?? ""}`,
40406
40696
  style: {
40407
- ...provider.draggableProps.style ?? {},
40408
- ...provider.dragHandleProps.style ?? {},
40697
+ ...((_b = provider.draggableProps) == null ? void 0 : _b.style) ?? {},
40409
40698
  ...props.style ?? {}
40410
40699
  }
40411
40700
  },
@@ -40423,10 +40712,14 @@ Please wrap them with useCallback or configure the deps array correctly.`
40423
40712
  /* @__PURE__ */ React.createElement(TrashIcon, { className: "h-5 w-auto fill-current text-red-500 transition-colors duration-150 ease-out" })
40424
40713
  );
40425
40714
  };
40426
- const DragHandle = ({ isDragging }) => {
40715
+ const DragHandle = ({
40716
+ isDragging,
40717
+ dragHandleProps
40718
+ }) => {
40427
40719
  return /* @__PURE__ */ React.createElement(
40428
40720
  "div",
40429
40721
  {
40722
+ ...dragHandleProps,
40430
40723
  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`}`
40431
40724
  },
40432
40725
  isDragging ? /* @__PURE__ */ React.createElement(ReorderIcon, { className: "fill-current w-7 h-auto" }) : /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(DragIcon, { className: "fill-current w-7 h-auto group-hover:opacity-0 transition-opacity duration-150 ease-out" }), /* @__PURE__ */ React.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" }))
@@ -40878,39 +41171,45 @@ Please wrap them with useCallback or configure the deps array correctly.`
40878
41171
  }
40879
41172
  ))
40880
41173
  },
40881
- /* @__PURE__ */ React__namespace.createElement(ListPanel, null, /* @__PURE__ */ React__namespace.createElement(reactBeautifulDnd.Droppable, { droppableId: field.name, type: field.name }, (provider) => /* @__PURE__ */ React__namespace.createElement("div", { ref: provider.innerRef, className: "edit-page--list-parent" }, items2.length === 0 && /* @__PURE__ */ React__namespace.createElement(EmptyList, null), items2.map((block2, index2) => {
40882
- const template = field.templates[block2._template];
40883
- if (!template) {
41174
+ /* @__PURE__ */ React__namespace.createElement(ListPanel, null, /* @__PURE__ */ React__namespace.createElement(Droppable, { droppableId: field.name, type: field.name }, (provider) => /* @__PURE__ */ React__namespace.createElement("div", { ref: provider.innerRef, className: "edit-page--list-parent" }, items2.length === 0 && /* @__PURE__ */ React__namespace.createElement(EmptyList, null), /* @__PURE__ */ React__namespace.createElement(
41175
+ SortableProvider,
41176
+ {
41177
+ items: items2.map((_, index2) => `${field.name}.${index2}`)
41178
+ },
41179
+ items2.map((block2, index2) => {
41180
+ const template = field.templates[block2._template];
41181
+ if (!template) {
41182
+ return /* @__PURE__ */ React__namespace.createElement(
41183
+ InvalidBlockListItem,
41184
+ {
41185
+ key: index2,
41186
+ index: index2,
41187
+ field,
41188
+ tinaForm
41189
+ }
41190
+ );
41191
+ }
41192
+ const itemProps = (item) => {
41193
+ if (!template.itemProps)
41194
+ return {};
41195
+ return template.itemProps(item);
41196
+ };
40884
41197
  return /* @__PURE__ */ React__namespace.createElement(
40885
- InvalidBlockListItem,
41198
+ BlockListItem,
40886
41199
  {
40887
41200
  key: index2,
41201
+ block: block2,
41202
+ template,
40888
41203
  index: index2,
40889
41204
  field,
40890
- tinaForm
41205
+ tinaForm,
41206
+ isMin,
41207
+ fixedLength,
41208
+ ...itemProps(block2)
40891
41209
  }
40892
41210
  );
40893
- }
40894
- const itemProps = (item) => {
40895
- if (!template.itemProps)
40896
- return {};
40897
- return template.itemProps(item);
40898
- };
40899
- return /* @__PURE__ */ React__namespace.createElement(
40900
- BlockListItem,
40901
- {
40902
- key: index2,
40903
- block: block2,
40904
- template,
40905
- index: index2,
40906
- field,
40907
- tinaForm,
40908
- isMin,
40909
- fixedLength,
40910
- ...itemProps(block2)
40911
- }
40912
- );
40913
- }), provider.placeholder)))
41211
+ })
41212
+ ), provider.placeholder)))
40914
41213
  );
40915
41214
  };
40916
41215
  const BlockListItem = ({
@@ -40928,7 +41227,13 @@ Please wrap them with useCallback or configure the deps array correctly.`
40928
41227
  }, [tinaForm, field, index]);
40929
41228
  const { dispatch: setHoveredField } = useEvent("field:hover");
40930
41229
  const { dispatch: setFocusedField } = useEvent("field:focus");
40931
- return /* @__PURE__ */ React__namespace.createElement(reactBeautifulDnd.Draggable, { key: index, draggableId: `${field.name}.${index}`, index }, (provider, snapshot) => /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, /* @__PURE__ */ React__namespace.createElement(ItemHeader, { provider, isDragging: snapshot.isDragging }, /* @__PURE__ */ React__namespace.createElement(DragHandle, { isDragging: snapshot.isDragging }), /* @__PURE__ */ React__namespace.createElement(
41230
+ return /* @__PURE__ */ React__namespace.createElement(Draggable, { key: index, draggableId: `${field.name}.${index}`, index }, (provider, snapshot) => /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, /* @__PURE__ */ React__namespace.createElement(ItemHeader, { provider, isDragging: snapshot.isDragging }, /* @__PURE__ */ React__namespace.createElement(
41231
+ DragHandle,
41232
+ {
41233
+ isDragging: snapshot.isDragging,
41234
+ dragHandleProps: provider.dragHandleProps
41235
+ }
41236
+ ), /* @__PURE__ */ React__namespace.createElement(
40932
41237
  ItemClickTarget,
40933
41238
  {
40934
41239
  onClick: () => {
@@ -40969,7 +41274,13 @@ Please wrap them with useCallback or configure the deps array correctly.`
40969
41274
  const removeItem = React__namespace.useCallback(() => {
40970
41275
  tinaForm.mutators.remove(field.name, index);
40971
41276
  }, [tinaForm, field, index]);
40972
- return /* @__PURE__ */ React__namespace.createElement(reactBeautifulDnd.Draggable, { key: index, draggableId: `${field.name}.${index}`, index }, (provider, snapshot) => /* @__PURE__ */ React__namespace.createElement(ItemHeader, { provider, isDragging: snapshot.isDragging }, /* @__PURE__ */ React__namespace.createElement(DragHandle, { isDragging: snapshot.isDragging }), /* @__PURE__ */ React__namespace.createElement(ItemClickTarget, null, /* @__PURE__ */ React__namespace.createElement(GroupLabel, { error: true }, "Invalid Block")), /* @__PURE__ */ React__namespace.createElement(ItemDeleteButton, { onClick: removeItem })));
41277
+ return /* @__PURE__ */ React__namespace.createElement(Draggable, { key: index, draggableId: `${field.name}.${index}`, index }, (provider, snapshot) => /* @__PURE__ */ React__namespace.createElement(ItemHeader, { provider, isDragging: snapshot.isDragging }, /* @__PURE__ */ React__namespace.createElement(
41278
+ DragHandle,
41279
+ {
41280
+ isDragging: snapshot.isDragging,
41281
+ dragHandleProps: provider.dragHandleProps
41282
+ }
41283
+ ), /* @__PURE__ */ React__namespace.createElement(ItemClickTarget, null, /* @__PURE__ */ React__namespace.createElement(GroupLabel, { error: true }, "Invalid Block")), /* @__PURE__ */ React__namespace.createElement(ItemDeleteButton, { onClick: removeItem })));
40973
41284
  };
40974
41285
  const BlocksField = Blocks;
40975
41286
  const BlocksFieldPlugin = {
@@ -41022,9 +41333,9 @@ Please wrap them with useCallback or configure the deps array correctly.`
41022
41333
  },
41023
41334
  [field.itemProps]
41024
41335
  );
41025
- const isMax = items2.length >= (field.max || Infinity);
41026
- const isMin = items2.length <= (field.min || 0);
41027
- const fixedLength = field.min === field.max;
41336
+ const isMax = items2.length >= (field == null ? void 0 : field.max);
41337
+ const isMin = items2.length <= (field == null ? void 0 : field.min);
41338
+ const fixedLength = (field == null ? void 0 : field.min) === (field == null ? void 0 : field.max);
41028
41339
  return /* @__PURE__ */ React__namespace.createElement(
41029
41340
  ListFieldMeta,
41030
41341
  {
@@ -41034,21 +41345,36 @@ Please wrap them with useCallback or configure the deps array correctly.`
41034
41345
  error: meta.error,
41035
41346
  index,
41036
41347
  tinaForm,
41037
- actions: (!fixedLength || fixedLength && !isMax) && /* @__PURE__ */ React__namespace.createElement(IconButton, { onClick: addItem, variant: "primary", size: "small" }, /* @__PURE__ */ React__namespace.createElement(AddIcon, { className: "w-5/6 h-auto" }))
41348
+ actions: /* @__PURE__ */ React__namespace.createElement(
41349
+ IconButton,
41350
+ {
41351
+ onClick: addItem,
41352
+ variant: "primary",
41353
+ size: "small",
41354
+ disabled: isMax
41355
+ },
41356
+ /* @__PURE__ */ React__namespace.createElement(AddIcon, { className: "w-5/6 h-auto" })
41357
+ )
41038
41358
  },
41039
- /* @__PURE__ */ React__namespace.createElement(ListPanel, null, /* @__PURE__ */ React__namespace.createElement("div", null, /* @__PURE__ */ React__namespace.createElement(reactBeautifulDnd.Droppable, { droppableId: field.name, type: field.name }, (provider) => /* @__PURE__ */ React__namespace.createElement("div", { ref: provider.innerRef }, items2.length === 0 && /* @__PURE__ */ React__namespace.createElement(EmptyList, null), items2.map((item, index2) => /* @__PURE__ */ React__namespace.createElement(
41040
- Item$1,
41359
+ /* @__PURE__ */ React__namespace.createElement(ListPanel, null, /* @__PURE__ */ React__namespace.createElement("div", null, /* @__PURE__ */ React__namespace.createElement(Droppable, { droppableId: field.name, type: field.name }, (provider) => /* @__PURE__ */ React__namespace.createElement("div", { ref: provider.innerRef }, items2.length === 0 && /* @__PURE__ */ React__namespace.createElement(EmptyList, null), /* @__PURE__ */ React__namespace.createElement(
41360
+ SortableProvider,
41041
41361
  {
41042
- key: index2,
41043
- tinaForm,
41044
- field,
41045
- item,
41046
- index: index2,
41047
- isMin,
41048
- fixedLength,
41049
- ...itemProps(item)
41050
- }
41051
- )), provider.placeholder))))
41362
+ items: items2.map((_, index2) => `${field.name}.${index2}`)
41363
+ },
41364
+ items2.map((item, index2) => /* @__PURE__ */ React__namespace.createElement(
41365
+ Item$1,
41366
+ {
41367
+ key: index2,
41368
+ tinaForm,
41369
+ field,
41370
+ item,
41371
+ index: index2,
41372
+ isMin,
41373
+ fixedLength,
41374
+ ...itemProps(item)
41375
+ }
41376
+ ))
41377
+ ), provider.placeholder))))
41052
41378
  );
41053
41379
  };
41054
41380
  const Item$1 = ({
@@ -41074,7 +41400,13 @@ Please wrap them with useCallback or configure the deps array correctly.`
41074
41400
  name: `${field.name}.${index}`
41075
41401
  }
41076
41402
  ];
41077
- return /* @__PURE__ */ React__namespace.createElement(reactBeautifulDnd.Draggable, { draggableId: `${field.name}.${index}`, index }, (provider, snapshot) => /* @__PURE__ */ React__namespace.createElement(ItemHeader, { provider, isDragging: snapshot.isDragging, ...p2 }, /* @__PURE__ */ React__namespace.createElement(DragHandle, { isDragging: snapshot.isDragging }), /* @__PURE__ */ React__namespace.createElement(ItemClickTarget, null, /* @__PURE__ */ React__namespace.createElement(FieldsBuilder, { padding: false, form: tinaForm, fields })), (!fixedLength || fixedLength && !isMin) && /* @__PURE__ */ React__namespace.createElement(ItemDeleteButton, { disabled: isMin, onClick: removeItem })));
41403
+ return /* @__PURE__ */ React__namespace.createElement(Draggable, { draggableId: `${field.name}.${index}`, index }, (provider, snapshot) => /* @__PURE__ */ React__namespace.createElement(ItemHeader, { provider, isDragging: snapshot.isDragging, ...p2 }, /* @__PURE__ */ React__namespace.createElement(
41404
+ DragHandle,
41405
+ {
41406
+ isDragging: snapshot.isDragging,
41407
+ dragHandleProps: provider.dragHandleProps
41408
+ }
41409
+ ), /* @__PURE__ */ React__namespace.createElement(ItemClickTarget, null, /* @__PURE__ */ React__namespace.createElement(FieldsBuilder, { padding: false, form: tinaForm, fields })), (!fixedLength || fixedLength && !isMin) && /* @__PURE__ */ React__namespace.createElement(ItemDeleteButton, { disabled: isMin, onClick: removeItem })));
41078
41410
  };
41079
41411
  const ListField = List;
41080
41412
  const ListFieldPlugin = {
@@ -42706,30 +43038,6 @@ Please wrap them with useCallback or configure the deps array correctly.`
42706
43038
  },
42707
43039
  parse: parse$2
42708
43040
  };
42709
- function AiFillWarning(props) {
42710
- 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);
42711
- }
42712
- function AiOutlineLoading(props) {
42713
- 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);
42714
- }
42715
- function FaCircle(props) {
42716
- 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);
42717
- }
42718
- function FaFile(props) {
42719
- 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);
42720
- }
42721
- function FaFolder(props) {
42722
- 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);
42723
- }
42724
- function FaLock(props) {
42725
- 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);
42726
- }
42727
- function FaSpinner(props) {
42728
- 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);
42729
- }
42730
- function FaUnlock(props) {
42731
- 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);
42732
- }
42733
43041
  function GrCircleQuestion(props) {
42734
43042
  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);
42735
43043
  }
@@ -42981,6 +43289,38 @@ Please wrap them with useCallback or configure the deps array correctly.`
42981
43289
  " Create Branch"
42982
43290
  )));
42983
43291
  };
43292
+ const Badge = ({
43293
+ children,
43294
+ calloutStyle = "warning",
43295
+ className = "",
43296
+ displayIcon = true,
43297
+ ...props
43298
+ }) => {
43299
+ const commonAlertStyles = "text-xs px-2 py-0.5 flex items-center rounded-md border";
43300
+ const styles = {
43301
+ warning: `text-amber-700 bg-amber-100 border-amber-700/20`,
43302
+ info: `text-blue-600 bg-blue-100/50 border-blue-600/20`,
43303
+ success: `text-green-600 bg-green-100/50 border-green-600/20`,
43304
+ error: `text-red-700 bg-red-100/50 border-red-700/20`
43305
+ };
43306
+ const icon = {
43307
+ warning: /* @__PURE__ */ React__namespace.createElement(MdAccessTime, { className: "w-5 h-auto inline-block mr-1 opacity-70 text-amber-600" }),
43308
+ info: /* @__PURE__ */ React__namespace.createElement(MdOutlineDataSaverOff, { className: "w-5 h-auto inline-block mr-1 opacity-70 text-blue-600" }),
43309
+ success: /* @__PURE__ */ React__namespace.createElement(MdCheckCircle, { className: "w-5 h-auto inline-block mr-1 opacity-70 text-green-600" }),
43310
+ error: /* @__PURE__ */ React__namespace.createElement(MdWifiOff, { className: "w-5 h-auto inline-block mr-1 opacity-70 text-red-700" })
43311
+ };
43312
+ return /* @__PURE__ */ React__namespace.createElement(
43313
+ "div",
43314
+ {
43315
+ className: cn$1(commonAlertStyles, styles[calloutStyle], className),
43316
+ ...props
43317
+ },
43318
+ displayIcon && icon[calloutStyle],
43319
+ " ",
43320
+ children
43321
+ );
43322
+ };
43323
+ const tableHeadingStyle = "px-3 py-3 text-left text-xs font-bold text-gray-700 tracking-wider";
42984
43324
  function formatBranchName(str) {
42985
43325
  const pattern = /[^/\w-]+/g;
42986
43326
  const formattedStr = str.replace(pattern, "-");
@@ -43224,7 +43564,7 @@ Please wrap them with useCallback or configure the deps array correctly.`
43224
43564
  filter2
43225
43565
  ).sort(sortBranchListFn(sortValue));
43226
43566
  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;
43227
- return /* @__PURE__ */ React__namespace.createElement("div", { className: "flex flex-col gap-4" }, /* @__PURE__ */ React__namespace.createElement("div", { className: "flex items-end space-x-4" }, /* @__PURE__ */ React__namespace.createElement("div", null, /* @__PURE__ */ React__namespace.createElement(
43567
+ return /* @__PURE__ */ React__namespace.createElement("div", { className: "flex flex-col gap-4" }, /* @__PURE__ */ React__namespace.createElement("div", { className: "flex items-stretch space-x-4" }, /* @__PURE__ */ React__namespace.createElement("div", null, /* @__PURE__ */ React__namespace.createElement(
43228
43568
  "label",
43229
43569
  {
43230
43570
  htmlFor: "search",
@@ -43247,7 +43587,7 @@ Please wrap them with useCallback or configure the deps array correctly.`
43247
43587
  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"
43248
43588
  },
43249
43589
  /* @__PURE__ */ React__namespace.createElement(MdOutlineClear, { className: "w-5 h-auto text-gray-600" })
43250
- ))), /* @__PURE__ */ React__namespace.createElement("div", null, /* @__PURE__ */ React__namespace.createElement(
43590
+ ))), /* @__PURE__ */ React__namespace.createElement("div", { className: "flex flex-col" }, /* @__PURE__ */ React__namespace.createElement(
43251
43591
  "label",
43252
43592
  {
43253
43593
  htmlFor: "branch-type",
@@ -43275,7 +43615,7 @@ Please wrap them with useCallback or configure the deps array correctly.`
43275
43615
  }
43276
43616
  ]
43277
43617
  }
43278
- ))), filteredBranchList.length === 0 && /* @__PURE__ */ React__namespace.createElement("div", { className: "block relative text-gray-300 italic py-1" }, "No branches to display"), filteredBranchList.length > 0 && /* @__PURE__ */ React__namespace.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__namespace.createElement(
43618
+ ))), filteredBranchList.length === 0 && /* @__PURE__ */ React__namespace.createElement("div", { className: "block relative text-gray-300 italic py-1" }, "No branches to display"), filteredBranchList.length > 0 && /* @__PURE__ */ React__namespace.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__namespace.createElement("table", { className: "w-full" }, /* @__PURE__ */ React__namespace.createElement("thead", { className: "bg-gray-100 border-b-2 border-gray-200" }, /* @__PURE__ */ React__namespace.createElement("tr", null, /* @__PURE__ */ React__namespace.createElement("th", { className: tableHeadingStyle }, "Branch Name"), /* @__PURE__ */ React__namespace.createElement("th", { className: tableHeadingStyle }, "Last Updated"), /* @__PURE__ */ React__namespace.createElement("th", null), /* @__PURE__ */ React__namespace.createElement("th", null))), /* @__PURE__ */ React__namespace.createElement("tbody", null, filteredBranchList.map((branch) => /* @__PURE__ */ React__namespace.createElement(
43279
43619
  BranchItem,
43280
43620
  {
43281
43621
  key: branch.name,
@@ -43286,7 +43626,7 @@ Please wrap them with useCallback or configure the deps array correctly.`
43286
43626
  previewFunction,
43287
43627
  cms
43288
43628
  }
43289
- ))));
43629
+ ))))));
43290
43630
  };
43291
43631
  const BranchItem = ({
43292
43632
  branch,
@@ -43322,15 +43662,15 @@ Please wrap them with useCallback or configure the deps array correctly.`
43322
43662
  const isCurrentBranch = branch.name === currentBranch;
43323
43663
  const indexingStatus = (_a2 = branch == null ? void 0 : branch.indexStatus) == null ? void 0 : _a2.status;
43324
43664
  return /* @__PURE__ */ React__namespace.createElement(
43325
- "div",
43665
+ "tr",
43326
43666
  {
43327
- 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"}`
43667
+ 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"}`
43328
43668
  },
43329
- /* @__PURE__ */ React__namespace.createElement("div", { className: "w-1/2" }, /* @__PURE__ */ React__namespace.createElement("div", { className: "flex items-center gap-1" }, /* @__PURE__ */ React__namespace.createElement("div", { className: "flex-0" }, branch.protected && /* @__PURE__ */ React__namespace.createElement(BiLock, { className: "w-5 h-auto opacity-70 text-blue-500" })), /* @__PURE__ */ React__namespace.createElement("div", { className: "truncate flex-1" }, branch.name)), indexingStatus !== "complete" && /* @__PURE__ */ React__namespace.createElement("div", { className: "w-fit" }, /* @__PURE__ */ React__namespace.createElement(IndexStatus, { indexingStatus: branch.indexStatus.status }))),
43330
- /* @__PURE__ */ React__namespace.createElement("div", { className: "flex-1" }, creatingPR ? /* @__PURE__ */ React__namespace.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ React__namespace.createElement("div", null, /* @__PURE__ */ React__namespace.createElement("div", { className: "text-xs font-bold text-blue-600" }, "Creating PR"), /* @__PURE__ */ React__namespace.createElement("span", { className: "text-sm leading-tight text-blue-500" }, "Please wait...")), /* @__PURE__ */ React__namespace.createElement(FaSpinner, { className: "w-3 h-auto animate-spin text-blue-500" })) : /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, /* @__PURE__ */ React__namespace.createElement("div", { className: "text-xs font-bold" }, "Last Updated"), /* @__PURE__ */ React__namespace.createElement("span", { className: "text-sm leading-tight" }, dateFns.formatDistanceToNow(new Date(branch.indexStatus.timestamp), {
43669
+ /* @__PURE__ */ React__namespace.createElement("td", { className: "pl-3 pr-3 py-1.5 min-w-0" }, /* @__PURE__ */ React__namespace.createElement("div", { className: "flex flex-col" }, /* @__PURE__ */ React__namespace.createElement("div", { className: "flex items-center gap-1" }, branch.protected && /* @__PURE__ */ React__namespace.createElement(BiLock, { className: "w-5 h-auto opacity-70 text-blue-500 flex-shrink-0" }), /* @__PURE__ */ React__namespace.createElement("span", { className: "text-sm leading-tight truncate" }, branch.name)), indexingStatus !== "complete" && /* @__PURE__ */ React__namespace.createElement("div", { className: "w-fit mt-1" }, /* @__PURE__ */ React__namespace.createElement(IndexStatus, { indexingStatus: branch.indexStatus.status })))),
43670
+ /* @__PURE__ */ React__namespace.createElement("td", { className: "px-3 py-1.5 min-w-0" }, creatingPR ? /* @__PURE__ */ React__namespace.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ React__namespace.createElement("div", null, /* @__PURE__ */ React__namespace.createElement("div", { className: "text-xs font-bold text-blue-600" }, "Creating PR"), /* @__PURE__ */ React__namespace.createElement("span", { className: "text-sm leading-tight text-blue-500" }, "Please wait...")), /* @__PURE__ */ React__namespace.createElement(FaSpinner, { className: "w-3 h-auto animate-spin text-blue-500" })) : /* @__PURE__ */ React__namespace.createElement("span", { className: "text-sm leading-tight whitespace-nowrap" }, dateFns.formatDistanceToNow(new Date(branch.indexStatus.timestamp), {
43331
43671
  addSuffix: true
43332
- })))),
43333
- /* @__PURE__ */ React__namespace.createElement("div", { className: "flex items-center" }, indexingStatus === "complete" && !isCurrentBranch && /* @__PURE__ */ React__namespace.createElement(
43672
+ }))),
43673
+ /* @__PURE__ */ React__namespace.createElement("td", { className: "px-3 py-1.5 text-left" }, indexingStatus === "complete" && !isCurrentBranch && /* @__PURE__ */ React__namespace.createElement(
43334
43674
  Button$1,
43335
43675
  {
43336
43676
  variant: "white",
@@ -43338,12 +43678,13 @@ Please wrap them with useCallback or configure the deps array correctly.`
43338
43678
  onClick: () => {
43339
43679
  onChange(branch.name);
43340
43680
  },
43341
- className: "mr-auto cursor-pointer text-sm h-9 px-4 flex items-center gap-1"
43681
+ className: "cursor-pointer text-sm h-9 px-4 flex items-center gap-1"
43342
43682
  },
43343
43683
  /* @__PURE__ */ React__namespace.createElement(BiPencil, { className: "h-4 w-auto text-blue-500 opacity-70 -mt-px" }),
43344
43684
  " ",
43345
43685
  "Select"
43346
- ), /* @__PURE__ */ React__namespace.createElement("div", { className: "ml-auto" }, /* @__PURE__ */ React__namespace.createElement(
43686
+ ), indexingStatus === "complete" && isCurrentBranch && /* @__PURE__ */ React__namespace.createElement(Badge, { calloutStyle: "info", className: "w-fit", displayIcon: false }, /* @__PURE__ */ React__namespace.createElement("span", null, "Selected"))),
43687
+ /* @__PURE__ */ React__namespace.createElement("td", { className: "px-3 py-1.5 text-right" }, /* @__PURE__ */ React__namespace.createElement(
43347
43688
  OverflowMenu$1,
43348
43689
  {
43349
43690
  toolbarItems: [
@@ -43374,7 +43715,7 @@ Please wrap them with useCallback or configure the deps array correctly.`
43374
43715
  }
43375
43716
  ].filter(Boolean)
43376
43717
  }
43377
- )))
43718
+ ))
43378
43719
  );
43379
43720
  };
43380
43721
  const IndexStatus = ({ indexingStatus }) => {
@@ -45430,7 +45771,7 @@ Please wrap them with useCallback or configure the deps array correctly.`
45430
45771
  className = "",
45431
45772
  ...props
45432
45773
  }) => {
45433
- const commonAlertStyles = "ml-8 text-sm px-4 py-3 rounded-md border";
45774
+ const commonAlertStyles = "text-sm px-4 py-3 rounded-md border";
45434
45775
  const styles = {
45435
45776
  warning: `text-amber-700 bg-amber-100 border-amber-700/20`,
45436
45777
  info: `text-blue-600 bg-blue-100/50 border-blue-600/20`,
@@ -46202,7 +46543,7 @@ Please wrap them with useCallback or configure the deps array correctly.`
46202
46543
  requiredArgs(1, arguments);
46203
46544
  return formatDistance(dirtyDate, Date.now(), options);
46204
46545
  }
46205
- const version$1 = "2.9.2";
46546
+ const version$1 = "2.9.5";
46206
46547
  const VersionInfo = () => {
46207
46548
  var _a2, _b, _c, _d, _e, _f;
46208
46549
  const cms = useCMS();
@@ -47842,7 +48183,7 @@ Please wrap them with useCallback or configure the deps array correctly.`
47842
48183
  if (!alerts.all.length) {
47843
48184
  return null;
47844
48185
  }
47845
- return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", { className: "fixed bottom-0 left-0 right-0 p-6 flex flex-col items-center z-[999999]" }, alerts.all.filter((alert) => {
48186
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", { className: "fixed top-0 left-0 p-6 flex flex-col items-center z-[999999]" }, alerts.all.filter((alert) => {
47846
48187
  return alert.level !== "error";
47847
48188
  }).map((alert) => {
47848
48189
  return /* @__PURE__ */ React.createElement(Alert, { key: alert.id, level: alert.level }, alert.level === "info" && /* @__PURE__ */ React.createElement(MdInfo, { className: "w-5 h-auto opacity-70" }), alert.level === "success" && /* @__PURE__ */ React.createElement(MdCheckCircle, { className: "w-5 h-auto opacity-70" }), alert.level === "warn" && /* @__PURE__ */ React.createElement(MdWarning, { className: "w-5 h-auto opacity-70" }), /* @__PURE__ */ React.createElement("p", { className: "m-0 flex-1 max-w-[680px] text-left" }, parseUrlsInText(alert.message.toString())), /* @__PURE__ */ React.createElement(
@@ -47886,10 +48227,10 @@ Please wrap them with useCallback or configure the deps array correctly.`
47886
48227
  ...props
47887
48228
  }) => {
47888
48229
  const colorClasses = {
47889
- info: "bg-blue-100 border-blue-500 text-blue-600 fill-blue-500",
47890
- success: "bg-green-100 border-green-500 text-green-600 fill-green-500",
47891
- warn: "bg-yellow-100 border-yellow-500 text-yellow-600 fill-yellow-500",
47892
- error: "bg-red-100 border-red-500 text-red-600 fill-red-500"
48230
+ info: "bg-white border-blue-500 text-blue-600 fill-blue-500",
48231
+ success: "bg-white border-green-500 text-green-600 fill-green-500",
48232
+ warn: "bg-white border-yellow-500 text-yellow-600 fill-yellow-500",
48233
+ error: "bg-white border-red-500 text-red-600 fill-red-500"
47893
48234
  };
47894
48235
  const borderClasses = {
47895
48236
  info: "border-blue-200",
@@ -47912,7 +48253,7 @@ Please wrap them with useCallback or configure the deps array correctly.`
47912
48253
  /* @__PURE__ */ React.createElement(
47913
48254
  "div",
47914
48255
  {
47915
- className: `flex items-center gap-1.5 min-w-[350px] rounded-md border p-2 ${borderClasses[level]}`,
48256
+ className: `flex items-center gap-1.5 w-[350px] rounded-md border p-2 ${borderClasses[level]}`,
47916
48257
  ...props
47917
48258
  }
47918
48259
  )
@@ -47924,7 +48265,7 @@ Please wrap them with useCallback or configure the deps array correctly.`
47924
48265
  className: "border-none bg-transparent p-0 outline-none flex items-center",
47925
48266
  ...styleProps
47926
48267
  },
47927
- /* @__PURE__ */ React.createElement(BiX, { className: "w-5 auto flex-grow-0 flex-shrink-0" })
48268
+ /* @__PURE__ */ React.createElement(BiX, { className: "w-5 auto flex-grow-0 flex-shrink-0 text-gray-700" })
47928
48269
  );
47929
48270
  function CursorPaginator({
47930
48271
  navigateNext,
@@ -48221,6 +48562,18 @@ Please wrap them with useCallback or configure the deps array correctly.`
48221
48562
  /* @__PURE__ */ React__namespace.createElement(BiLinkExternal, { className: "h-5 w-auto" })
48222
48563
  );
48223
48564
  };
48565
+ const EDITORIAL_WORKFLOW_STATUS = {
48566
+ QUEUED: "queued",
48567
+ PROCESSING: "processing",
48568
+ SETTING_UP: "setting_up",
48569
+ CREATING_BRANCH: "creating_branch",
48570
+ INDEXING: "indexing",
48571
+ CONTENT_GENERATION: "content_generation",
48572
+ CREATING_PR: "creating_pr",
48573
+ COMPLETE: "complete",
48574
+ ERROR: "error",
48575
+ TIMEOUT: "timeout"
48576
+ };
48224
48577
  const num123 = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"];
48225
48578
  const numFas = ["۱", "۲", "۳", "۴", "۵", "۶", "۷", "۸", "۹", "۰"];
48226
48579
  const numKor = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"];
@@ -63332,7 +63685,7 @@ mutation DeleteDocument($collection: String!, $relativePath: String!){
63332
63685
  const schemaFromCloud = await this.api.getSchema();
63333
63686
  const schema1 = schemaFromCloud;
63334
63687
  const schema2 = graphql$1.buildSchema(graphql$1.print(localSchema));
63335
- const diffOutput = await core$1.diff(schema1, schema2);
63688
+ const diffOutput = await core$2.diff(schema1, schema2);
63336
63689
  if (diffOutput.length > 0) {
63337
63690
  return false;
63338
63691
  } else {
@@ -63634,367 +63987,6 @@ mutation DeleteDocument($collection: String!, $relativePath: String!){
63634
63987
  );
63635
63988
  }
63636
63989
  }
63637
- const ProgressBar = ({
63638
- progress,
63639
- className = "",
63640
- color = "blue"
63641
- }) => {
63642
- const clampedProgress = Math.min(Math.max(progress, 0), 100);
63643
- const colorClass = color === "green" ? "bg-green-500" : "bg-blue-500";
63644
- return /* @__PURE__ */ React__namespace.createElement("div", { className: `w-full ${className}` }, /* @__PURE__ */ React__namespace.createElement("div", { className: "w-full bg-gray-200 rounded-full h-2" }, /* @__PURE__ */ React__namespace.createElement(
63645
- "div",
63646
- {
63647
- className: `${colorClass} h-2 rounded-full transition-all duration-300 ease-out`,
63648
- style: { width: `${clampedProgress}%` }
63649
- }
63650
- )));
63651
- };
63652
- const EDITORIAL_WORKFLOW_STATUS = {
63653
- QUEUED: "queued",
63654
- PROCESSING: "processing",
63655
- SETTING_UP: "setting_up",
63656
- CREATING_BRANCH: "creating_branch",
63657
- INDEXING: "indexing",
63658
- CONTENT_GENERATION: "content_generation",
63659
- CREATING_PR: "creating_pr",
63660
- COMPLETE: "complete",
63661
- ERROR: "error",
63662
- TIMEOUT: "timeout"
63663
- };
63664
- const FormActionMenu = ({ actions, form }) => {
63665
- const [actionMenuVisibility, setActionMenuVisibility] = React.useState(false);
63666
- return /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, /* @__PURE__ */ React__namespace.createElement(MoreActionsButton, { onClick: () => setActionMenuVisibility((p2) => !p2) }), /* @__PURE__ */ React__namespace.createElement(ActionsOverlay, { open: actionMenuVisibility }, /* @__PURE__ */ React__namespace.createElement(
63667
- Dismissible,
63668
- {
63669
- click: true,
63670
- escape: true,
63671
- disabled: !actionMenuVisibility,
63672
- onDismiss: () => {
63673
- setActionMenuVisibility((p2) => !p2);
63674
- }
63675
- },
63676
- actions.map((Action, i2) => (
63677
- // TODO: `i` will suppress warnings but this indicates that maybe
63678
- // Actions should just be componets
63679
- /* @__PURE__ */ React__namespace.createElement(Action, { form, key: i2 })
63680
- ))
63681
- )));
63682
- };
63683
- const MoreActionsButton = ({ className = "", ...props }) => /* @__PURE__ */ React__namespace.createElement(
63684
- "button",
63685
- {
63686
- 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}`,
63687
- ...props
63688
- },
63689
- /* @__PURE__ */ React__namespace.createElement(EllipsisVerticalIcon, null)
63690
- );
63691
- const ActionsOverlay = ({ open, className = "", style = {}, ...props }) => /* @__PURE__ */ React__namespace.createElement(
63692
- "div",
63693
- {
63694
- 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}`,
63695
- style: {
63696
- transform: open ? "translate3d(0, -28px, 0) scale3d(1, 1, 1)" : "translate3d(0, 0, 0) scale3d(0.5, 0.5, 1)",
63697
- pointerEvents: open ? "all" : "none",
63698
- ...style
63699
- },
63700
- ...props
63701
- }
63702
- );
63703
- const ActionButton = ({ className = "", ...props }) => /* @__PURE__ */ React__namespace.createElement(
63704
- "button",
63705
- {
63706
- 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}`,
63707
- ...props
63708
- }
63709
- );
63710
- const FormPortalContext = React__namespace.createContext(() => {
63711
- return null;
63712
- });
63713
- function useFormPortal() {
63714
- return React__namespace.useContext(FormPortalContext);
63715
- }
63716
- const FormPortalProvider = ({
63717
- children
63718
- }) => {
63719
- const wrapperRef = React__namespace.useRef(null);
63720
- const zIndexRef = React__namespace.useRef(0);
63721
- const FormPortal = React__namespace.useCallback(
63722
- (props) => {
63723
- if (!wrapperRef.current)
63724
- return null;
63725
- return ReactDOM.createPortal(
63726
- props.children({ zIndexShift: zIndexRef.current += 1 }),
63727
- wrapperRef.current
63728
- );
63729
- },
63730
- [wrapperRef, zIndexRef]
63731
- );
63732
- return /* @__PURE__ */ React__namespace.createElement(FormPortalContext.Provider, { value: FormPortal }, /* @__PURE__ */ React__namespace.createElement("div", { ref: wrapperRef, className: "relative w-full flex-1 overflow-hidden" }, children));
63733
- };
63734
- const LoadingDots = ({
63735
- dotSize = 8,
63736
- color = "white"
63737
- }) => {
63738
- return /* @__PURE__ */ React__namespace.createElement("div", null, /* @__PURE__ */ React__namespace.createElement(SingleDot, { dotSize, color }), /* @__PURE__ */ React__namespace.createElement(SingleDot, { dotSize, color, delay: 0.3 }), /* @__PURE__ */ React__namespace.createElement(SingleDot, { dotSize, color, delay: 0.5 }));
63739
- };
63740
- const SingleDot = ({ delay = 0, color, dotSize }) => /* @__PURE__ */ React__namespace.createElement(
63741
- "span",
63742
- {
63743
- className: "inline-block mr-1",
63744
- style: {
63745
- animation: "loading-dots-scale-up-and-down 2s linear infinite",
63746
- animationDelay: `${delay}s`,
63747
- background: color,
63748
- width: dotSize,
63749
- height: dotSize,
63750
- borderRadius: dotSize
63751
- }
63752
- }
63753
- );
63754
- const ResetForm = ({
63755
- pristine,
63756
- reset: reset2,
63757
- children,
63758
- ...props
63759
- }) => {
63760
- const [open, setOpen] = React__namespace.useState(false);
63761
- return /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, /* @__PURE__ */ React__namespace.createElement(
63762
- Button$1,
63763
- {
63764
- onClick: () => {
63765
- setOpen((p2) => !p2);
63766
- },
63767
- disabled: pristine,
63768
- ...props
63769
- },
63770
- children
63771
- ), open && /* @__PURE__ */ React__namespace.createElement(ResetModal, { reset: reset2, close: () => setOpen(false) }));
63772
- };
63773
- const ResetModal = ({ close: close2, reset: reset2 }) => {
63774
- return /* @__PURE__ */ React__namespace.createElement(Modal, null, /* @__PURE__ */ React__namespace.createElement(ModalPopup, null, /* @__PURE__ */ React__namespace.createElement(ModalHeader, { close: close2 }, "Reset"), /* @__PURE__ */ React__namespace.createElement(ModalBody, { padded: true }, /* @__PURE__ */ React__namespace.createElement("p", null, "Are you sure you want to reset all changes?")), /* @__PURE__ */ React__namespace.createElement(ModalActions, null, /* @__PURE__ */ React__namespace.createElement(Button$1, { style: { flexGrow: 2 }, onClick: close2 }, "Cancel"), /* @__PURE__ */ React__namespace.createElement(
63775
- Button$1,
63776
- {
63777
- style: { flexGrow: 3 },
63778
- variant: "primary",
63779
- onClick: async () => {
63780
- await reset2();
63781
- close2();
63782
- }
63783
- },
63784
- "Reset"
63785
- ))));
63786
- };
63787
- const NoFieldsPlaceholder = () => /* @__PURE__ */ React__namespace.createElement(
63788
- "div",
63789
- {
63790
- className: "relative flex flex-col items-center justify-center text-center p-5 pb-16 w-full h-full overflow-y-auto",
63791
- style: {
63792
- animationName: "fade-in",
63793
- animationDelay: "300ms",
63794
- animationTimingFunction: "ease-out",
63795
- animationIterationCount: 1,
63796
- animationFillMode: "both",
63797
- animationDuration: "150ms"
63798
- }
63799
- },
63800
- /* @__PURE__ */ React__namespace.createElement(Emoji, { className: "block pb-5" }, "🤔"),
63801
- /* @__PURE__ */ React__namespace.createElement("h3", { className: "font-sans font-normal text-lg block pb-5" }, "Hey, you don't have any fields added to this form."),
63802
- /* @__PURE__ */ React__namespace.createElement("p", { className: "block pb-5" }, /* @__PURE__ */ React__namespace.createElement(
63803
- "a",
63804
- {
63805
- 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",
63806
- href: "https://tinacms.org/docs/fields",
63807
- target: "_blank",
63808
- rel: "noopener noreferrer"
63809
- },
63810
- /* @__PURE__ */ React__namespace.createElement(
63811
- Emoji,
63812
- {
63813
- className: "absolute left-5 top-1/2 origin-center -translate-y-1/2 transition-all duration-100 ease-out",
63814
- style: { fontSize: 24 }
63815
- },
63816
- "📖"
63817
- ),
63818
- " ",
63819
- "Field Setup Guide"
63820
- ))
63821
- );
63822
- const FormKeyBindings = ({ onSubmit }) => {
63823
- React.useEffect(() => {
63824
- const handleKeyDown = (e3) => {
63825
- if ((e3.metaKey || e3.ctrlKey) && e3.key === "s") {
63826
- e3.preventDefault();
63827
- onSubmit();
63828
- }
63829
- };
63830
- window.addEventListener("keydown", handleKeyDown);
63831
- return () => window.removeEventListener("keydown", handleKeyDown);
63832
- }, [onSubmit]);
63833
- return null;
63834
- };
63835
- const FormBuilder = ({
63836
- form,
63837
- onPristineChange,
63838
- ...rest
63839
- }) => {
63840
- const cms = useCMS$1();
63841
- const hideFooter = !!rest.hideFooter;
63842
- const [createBranchModalOpen, setCreateBranchModalOpen] = React__namespace.useState(false);
63843
- const tinaForm = form.tinaForm;
63844
- const finalForm2 = form.tinaForm.finalForm;
63845
- React__namespace.useEffect(() => {
63846
- var _a2;
63847
- const collection = cms.api.tina.schema.getCollectionByFullPath(
63848
- tinaForm.path
63849
- );
63850
- if ((_a2 = collection == null ? void 0 : collection.ui) == null ? void 0 : _a2.beforeSubmit) {
63851
- tinaForm.beforeSubmit = (values) => collection.ui.beforeSubmit({ cms, form: tinaForm, values });
63852
- } else {
63853
- tinaForm.beforeSubmit = void 0;
63854
- }
63855
- }, [tinaForm.path]);
63856
- const moveArrayItem = React__namespace.useCallback(
63857
- (result) => {
63858
- if (!result.destination || !finalForm2)
63859
- return;
63860
- const name = result.type;
63861
- finalForm2.mutators.move(
63862
- name,
63863
- result.source.index,
63864
- result.destination.index
63865
- );
63866
- },
63867
- [tinaForm]
63868
- );
63869
- React__namespace.useEffect(() => {
63870
- const unsubscribe = finalForm2.subscribe(
63871
- ({ pristine }) => {
63872
- if (onPristineChange) {
63873
- onPristineChange(pristine);
63874
- }
63875
- },
63876
- { pristine: true }
63877
- );
63878
- return () => {
63879
- unsubscribe();
63880
- };
63881
- }, [finalForm2]);
63882
- const fieldGroup = tinaForm.getActiveField(form.activeFieldName);
63883
- return /* @__PURE__ */ React__namespace.createElement(
63884
- reactFinalForm.Form,
63885
- {
63886
- key: tinaForm.id,
63887
- form: tinaForm.finalForm,
63888
- onSubmit: tinaForm.onSubmit
63889
- },
63890
- ({
63891
- handleSubmit,
63892
- pristine,
63893
- invalid,
63894
- submitting,
63895
- dirtySinceLastSubmit,
63896
- hasValidationErrors
63897
- }) => {
63898
- const usingProtectedBranch = cms.api.tina.usingProtectedBranch();
63899
- const canSubmit = !pristine && !submitting && !hasValidationErrors && !(invalid && !dirtySinceLastSubmit);
63900
- const safeSubmit = async () => {
63901
- if (canSubmit) {
63902
- await handleSubmit();
63903
- }
63904
- };
63905
- const safeHandleSubmit = async () => {
63906
- if (usingProtectedBranch) {
63907
- setCreateBranchModalOpen(true);
63908
- } else {
63909
- safeSubmit();
63910
- }
63911
- };
63912
- return /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, createBranchModalOpen && /* @__PURE__ */ React__namespace.createElement(
63913
- CreateBranchModal,
63914
- {
63915
- safeSubmit,
63916
- crudType: tinaForm.crudType,
63917
- path: tinaForm.path,
63918
- values: tinaForm.values,
63919
- close: () => setCreateBranchModalOpen(false)
63920
- }
63921
- ), /* @__PURE__ */ React__namespace.createElement(reactBeautifulDnd.DragDropContext, { onDragEnd: moveArrayItem }, /* @__PURE__ */ React__namespace.createElement(FormKeyBindings, { onSubmit: safeHandleSubmit }), /* @__PURE__ */ React__namespace.createElement(FormPortalProvider, null, /* @__PURE__ */ React__namespace.createElement(FormWrapper, { id: tinaForm.id }, (tinaForm == null ? void 0 : tinaForm.fields.length) ? /* @__PURE__ */ React__namespace.createElement(
63922
- FieldsBuilder,
63923
- {
63924
- form: tinaForm,
63925
- activeFieldName: form.activeFieldName,
63926
- fields: fieldGroup.fields
63927
- }
63928
- ) : /* @__PURE__ */ React__namespace.createElement(NoFieldsPlaceholder, null))), !hideFooter && /* @__PURE__ */ React__namespace.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__namespace.createElement("div", { className: "flex-1 w-full justify-end gap-2 flex items-center max-w-form" }, tinaForm.reset && /* @__PURE__ */ React__namespace.createElement(
63929
- ResetForm,
63930
- {
63931
- pristine,
63932
- reset: async () => {
63933
- finalForm2.reset();
63934
- await tinaForm.reset();
63935
- }
63936
- },
63937
- tinaForm.buttons.reset
63938
- ), /* @__PURE__ */ React__namespace.createElement(
63939
- Button$1,
63940
- {
63941
- onClick: safeHandleSubmit,
63942
- disabled: !canSubmit,
63943
- busy: submitting,
63944
- variant: "primary"
63945
- },
63946
- submitting && /* @__PURE__ */ React__namespace.createElement(LoadingDots, null),
63947
- !submitting && tinaForm.buttons.save
63948
- ), tinaForm.actions.length > 0 && /* @__PURE__ */ React__namespace.createElement(
63949
- FormActionMenu,
63950
- {
63951
- form: tinaForm,
63952
- actions: tinaForm.actions
63953
- }
63954
- )))));
63955
- }
63956
- );
63957
- };
63958
- const FormStatus = ({ pristine }) => {
63959
- const pristineClass = pristine ? "text-green-500" : "text-red-500";
63960
- return /* @__PURE__ */ React__namespace.createElement(FaCircle, { className: cn("h-3", pristineClass) });
63961
- };
63962
- const FormWrapper = ({
63963
- id: id2,
63964
- children
63965
- }) => {
63966
- return /* @__PURE__ */ React__namespace.createElement(
63967
- "div",
63968
- {
63969
- "data-test": `form:${id2 == null ? void 0 : id2.replace(/\\/g, "/")}`,
63970
- className: "h-full overflow-y-auto max-h-full bg-gray-50"
63971
- },
63972
- /* @__PURE__ */ React__namespace.createElement("div", { className: "py-5 px-6" }, children)
63973
- );
63974
- };
63975
- const Emoji = ({ className = "", ...props }) => /* @__PURE__ */ React__namespace.createElement(
63976
- "span",
63977
- {
63978
- className: `text-[40px] leading-none inline-block ${className}`,
63979
- ...props
63980
- }
63981
- );
63982
- const CreateBranchModel = ({
63983
- close: close2,
63984
- safeSubmit,
63985
- relativePath: relativePath2,
63986
- values,
63987
- crudType
63988
- }) => /* @__PURE__ */ React__namespace.createElement(
63989
- CreateBranchModal,
63990
- {
63991
- close: close2,
63992
- safeSubmit,
63993
- path: relativePath2,
63994
- values,
63995
- crudType
63996
- }
63997
- );
63998
63990
  const pathRelativeToCollection = (collectionPath, fullPath) => {
63999
63991
  const normalizedCollectionPath = collectionPath.replace(/\\/g, "/");
64000
63992
  const normalizedFullPath = fullPath.replace(/\\/g, "/");
@@ -64023,7 +64015,6 @@ mutation DeleteDocument($collection: String!, $relativePath: String!){
64023
64015
  const [isExecuting, setIsExecuting] = React__namespace.useState(false);
64024
64016
  const [errorMessage, setErrorMessage] = React__namespace.useState("");
64025
64017
  const [currentStep, setCurrentStep] = React__namespace.useState(0);
64026
- const [statusMessage, setStatusMessage] = React__namespace.useState("");
64027
64018
  const [elapsedTime, setElapsedTime] = React__namespace.useState(0);
64028
64019
  React__namespace.useEffect(() => {
64029
64020
  let interval;
@@ -64067,7 +64058,6 @@ mutation DeleteDocument($collection: String!, $relativePath: String!){
64067
64058
  setDisabled(true);
64068
64059
  setIsExecuting(true);
64069
64060
  setCurrentStep(1);
64070
- setStatusMessage("Initializing workflow...");
64071
64061
  let graphql2 = "";
64072
64062
  if (crudType === "create") {
64073
64063
  graphql2 = CREATE_DOCUMENT_GQL;
@@ -64092,8 +64082,6 @@ mutation DeleteDocument($collection: String!, $relativePath: String!){
64092
64082
  }
64093
64083
  },
64094
64084
  onStatusUpdate: (status) => {
64095
- const message = status.message || `Status: ${status.status}`;
64096
- setStatusMessage(message);
64097
64085
  switch (status.status) {
64098
64086
  case EDITORIAL_WORKFLOW_STATUS.SETTING_UP:
64099
64087
  case EDITORIAL_WORKFLOW_STATUS.CREATING_BRANCH:
@@ -64130,9 +64118,7 @@ mutation DeleteDocument($collection: String!, $relativePath: String!){
64130
64118
  }
64131
64119
  };
64132
64120
  const renderProgressIndicator = () => {
64133
- var _a2;
64134
- const progressPercentage = (currentStep - 1) / steps.length * 100;
64135
- return /* @__PURE__ */ React__namespace.createElement("div", { className: "py-6" }, /* @__PURE__ */ React__namespace.createElement("div", { className: "flex justify-between mb-4 relative px-5 sm:gap-x-8" }, /* @__PURE__ */ React__namespace.createElement(
64121
+ return /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, /* @__PURE__ */ React__namespace.createElement("div", { className: "flex justify-between my-8 relative px-5 sm:gap-x-8" }, /* @__PURE__ */ React__namespace.createElement(
64136
64122
  "div",
64137
64123
  {
64138
64124
  className: "absolute top-5 h-0.5 bg-gray-200 -z-10",
@@ -64141,7 +64127,7 @@ mutation DeleteDocument($collection: String!, $relativePath: String!){
64141
64127
  ), currentStep > 1 && currentStep <= steps.length && /* @__PURE__ */ React__namespace.createElement(
64142
64128
  "div",
64143
64129
  {
64144
- className: "absolute top-5 h-0.5 bg-blue-500 -z-10 transition-all duration-500",
64130
+ className: "absolute top-5 h-0.5 bg-tina-orange -z-10 transition-all duration-500",
64145
64131
  style: {
64146
64132
  left: "50px",
64147
64133
  width: `calc((100% - 100px) * ${(currentStep - 1) / (steps.length - 1)})`
@@ -64169,7 +64155,7 @@ mutation DeleteDocument($collection: String!, $relativePath: String!){
64169
64155
  /* @__PURE__ */ React__namespace.createElement(
64170
64156
  "div",
64171
64157
  {
64172
- 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"}`
64158
+ 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"}`
64173
64159
  },
64174
64160
  isCompleted ? /* @__PURE__ */ React__namespace.createElement(
64175
64161
  "svg",
@@ -64190,7 +64176,7 @@ mutation DeleteDocument($collection: String!, $relativePath: String!){
64190
64176
  ),
64191
64177
  /* @__PURE__ */ React__namespace.createElement("div", { className: "text-center max-w-24" }, /* @__PURE__ */ React__namespace.createElement("div", { className: "text-sm font-semibold leading-tight" }, step.name), /* @__PURE__ */ React__namespace.createElement("div", { className: "text-xs text-gray-400 mt-1 leading-tight" }, step.description))
64192
64178
  );
64193
- })), /* @__PURE__ */ React__namespace.createElement("div", { className: "flex items-center justify-between mb-4" }, /* @__PURE__ */ React__namespace.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__namespace.createElement("div", { className: "flex items-center gap-1 text-sm text-gray-500" }, /* @__PURE__ */ React__namespace.createElement("svg", { className: "w-4 h-4", fill: "currentColor", viewBox: "0 0 20 20" }, /* @__PURE__ */ React__namespace.createElement(
64179
+ })), /* @__PURE__ */ React__namespace.createElement("div", { className: "flex items-center justify-between" }, /* @__PURE__ */ React__namespace.createElement("div", { className: "text-xs text-gray-500" }, "Estimated time: 1-2 min "), isExecuting && currentStep > 0 && /* @__PURE__ */ React__namespace.createElement("div", { className: "flex items-center gap-1 text-sm text-gray-500" }, /* @__PURE__ */ React__namespace.createElement("svg", { className: "w-4 h-4", fill: "currentColor", viewBox: "0 0 20 20" }, /* @__PURE__ */ React__namespace.createElement(
64194
64180
  "path",
64195
64181
  {
64196
64182
  fillRule: "evenodd",
@@ -64198,28 +64184,14 @@ mutation DeleteDocument($collection: String!, $relativePath: String!){
64198
64184
  clipRule: "evenodd"
64199
64185
  }
64200
64186
  )), formatTime(elapsedTime))), /* @__PURE__ */ React__namespace.createElement(
64201
- ProgressBar,
64202
- {
64203
- progress: progressPercentage,
64204
- className: "mb-4",
64205
- color: currentStep > steps.length ? "green" : "blue"
64206
- }
64207
- ), /* @__PURE__ */ React__namespace.createElement("div", { className: "flex items-center gap-2 mb-2" }, currentStep >= 4 ? /* @__PURE__ */ React__namespace.createElement(
64208
- "svg",
64187
+ "a",
64209
64188
  {
64210
- className: "w-4 h-4 text-green-500",
64211
- fill: "currentColor",
64212
- viewBox: "0 0 20 20"
64189
+ className: "underline text-tina-orange-dark font-medium text-xs",
64190
+ href: "https://tina.io/docs/tinacloud/editorial-workflow",
64191
+ target: "_blank"
64213
64192
  },
64214
- /* @__PURE__ */ React__namespace.createElement(
64215
- "path",
64216
- {
64217
- fillRule: "evenodd",
64218
- 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",
64219
- clipRule: "evenodd"
64220
- }
64221
- )
64222
- ) : /* @__PURE__ */ React__namespace.createElement(AiOutlineLoading, { className: "text-blue-500 animate-spin" }), /* @__PURE__ */ React__namespace.createElement("span", { className: "text-sm font-medium text-gray-700" }, statusMessage || `${(_a2 = steps[currentStep - 1]) == null ? void 0 : _a2.name}...`)), /* @__PURE__ */ React__namespace.createElement("div", { className: "text-left" }, /* @__PURE__ */ React__namespace.createElement("p", { className: "text-xs text-gray-500" }, "Estimated time: 1-2 minutes")));
64193
+ "Learn more about Editorial Workflow"
64194
+ ));
64223
64195
  };
64224
64196
  const renderStateContent = () => {
64225
64197
  if (isExecuting) {
@@ -64242,14 +64214,13 @@ mutation DeleteDocument($collection: String!, $relativePath: String!){
64242
64214
  value: newBranchName,
64243
64215
  onChange: (e3) => {
64244
64216
  setErrorMessage("");
64245
- setStatusMessage("");
64246
64217
  setNewBranchName(e3.target.value);
64247
64218
  }
64248
64219
  }
64249
64220
  ));
64250
64221
  }
64251
64222
  };
64252
- return /* @__PURE__ */ React__namespace.createElement(Modal, { className: "flex" }, /* @__PURE__ */ React__namespace.createElement(PopupModal, { className: "w-auto" }, /* @__PURE__ */ React__namespace.createElement(ModalHeader, { close: isExecuting ? void 0 : close2 }, /* @__PURE__ */ React__namespace.createElement("div", { className: "flex items-center justify-between w-full" }, /* @__PURE__ */ React__namespace.createElement("div", { className: "flex items-center" }, /* @__PURE__ */ React__namespace.createElement(TinaIcon, { className: "w-8 h-auto mr-1 text-blue-500 text-tina-orange" }), "Save changes to new branch"))), /* @__PURE__ */ React__namespace.createElement(ModalBody, { padded: true }, renderStateContent()), !isExecuting && /* @__PURE__ */ React__namespace.createElement(ModalActions, { align: "end" }, /* @__PURE__ */ React__namespace.createElement(Button$1, { variant: "secondary", className: "w-full sm:w-auto" }, "Cancel"), /* @__PURE__ */ React__namespace.createElement(
64223
+ return /* @__PURE__ */ React__namespace.createElement(Modal, { className: "flex" }, /* @__PURE__ */ React__namespace.createElement(PopupModal, { className: "w-auto" }, /* @__PURE__ */ React__namespace.createElement(ModalHeader, { close: isExecuting ? void 0 : close2 }, /* @__PURE__ */ React__namespace.createElement("div", { className: "flex items-center justify-between w-full" }, /* @__PURE__ */ React__namespace.createElement("div", { className: "flex items-center" }, "Save changes to new branch"))), /* @__PURE__ */ React__namespace.createElement(ModalBody, { padded: true }, renderStateContent()), !isExecuting && /* @__PURE__ */ React__namespace.createElement(ModalActions, { align: "end" }, /* @__PURE__ */ React__namespace.createElement(Button$1, { variant: "secondary", className: "w-full sm:w-auto" }, "Cancel"), /* @__PURE__ */ React__namespace.createElement(
64253
64224
  DropdownButton,
64254
64225
  {
64255
64226
  variant: "primary",
@@ -64293,6 +64264,217 @@ mutation DeleteDocument($collection: String!, $relativePath: String!){
64293
64264
  }
64294
64265
  )));
64295
64266
  };
64267
+ const NoFieldsPlaceholder = () => /* @__PURE__ */ React__namespace.createElement(
64268
+ "div",
64269
+ {
64270
+ className: "relative flex flex-col items-center justify-center text-center p-5 pb-16 w-full h-full overflow-y-auto",
64271
+ style: {
64272
+ animationName: "fade-in",
64273
+ animationDelay: "300ms",
64274
+ animationTimingFunction: "ease-out",
64275
+ animationIterationCount: 1,
64276
+ animationFillMode: "both",
64277
+ animationDuration: "150ms"
64278
+ }
64279
+ },
64280
+ /* @__PURE__ */ React__namespace.createElement(Emoji, { className: "block pb-5" }, "🤔"),
64281
+ /* @__PURE__ */ React__namespace.createElement("h3", { className: "font-sans font-normal text-lg block pb-5" }, "Hey, you don't have any fields added to this form."),
64282
+ /* @__PURE__ */ React__namespace.createElement("p", { className: "block pb-5" }, /* @__PURE__ */ React__namespace.createElement(
64283
+ "a",
64284
+ {
64285
+ 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",
64286
+ href: "https://tinacms.org/docs/fields",
64287
+ target: "_blank",
64288
+ rel: "noopener noreferrer"
64289
+ },
64290
+ /* @__PURE__ */ React__namespace.createElement(
64291
+ Emoji,
64292
+ {
64293
+ className: "absolute left-5 top-1/2 origin-center -translate-y-1/2 transition-all duration-100 ease-out",
64294
+ style: { fontSize: 24 }
64295
+ },
64296
+ "📖"
64297
+ ),
64298
+ " ",
64299
+ "Field Setup Guide"
64300
+ ))
64301
+ );
64302
+ const FormKeyBindings = ({ onSubmit }) => {
64303
+ React.useEffect(() => {
64304
+ const handleKeyDown = (e3) => {
64305
+ if ((e3.metaKey || e3.ctrlKey) && e3.key === "s") {
64306
+ e3.preventDefault();
64307
+ onSubmit();
64308
+ }
64309
+ };
64310
+ window.addEventListener("keydown", handleKeyDown);
64311
+ return () => window.removeEventListener("keydown", handleKeyDown);
64312
+ }, [onSubmit]);
64313
+ return null;
64314
+ };
64315
+ const FormBuilder = ({
64316
+ form,
64317
+ onPristineChange,
64318
+ ...rest
64319
+ }) => {
64320
+ const cms = useCMS$1();
64321
+ const hideFooter = !!rest.hideFooter;
64322
+ const [createBranchModalOpen, setCreateBranchModalOpen] = React__namespace.useState(false);
64323
+ const tinaForm = form.tinaForm;
64324
+ const finalForm2 = form.tinaForm.finalForm;
64325
+ React__namespace.useEffect(() => {
64326
+ var _a2;
64327
+ const collection = cms.api.tina.schema.getCollectionByFullPath(
64328
+ tinaForm.path
64329
+ );
64330
+ if ((_a2 = collection == null ? void 0 : collection.ui) == null ? void 0 : _a2.beforeSubmit) {
64331
+ tinaForm.beforeSubmit = (values) => collection.ui.beforeSubmit({ cms, form: tinaForm, values });
64332
+ } else {
64333
+ tinaForm.beforeSubmit = void 0;
64334
+ }
64335
+ }, [tinaForm.path]);
64336
+ const moveArrayItem = React__namespace.useCallback(
64337
+ (result) => {
64338
+ if (!result.destination || !finalForm2)
64339
+ return;
64340
+ const name = result.type;
64341
+ finalForm2.mutators.move(
64342
+ name,
64343
+ result.source.index,
64344
+ result.destination.index
64345
+ );
64346
+ },
64347
+ [tinaForm]
64348
+ );
64349
+ React__namespace.useEffect(() => {
64350
+ const unsubscribe = finalForm2.subscribe(
64351
+ ({ pristine }) => {
64352
+ if (onPristineChange) {
64353
+ onPristineChange(pristine);
64354
+ }
64355
+ },
64356
+ { pristine: true }
64357
+ );
64358
+ return () => {
64359
+ unsubscribe();
64360
+ };
64361
+ }, [finalForm2]);
64362
+ const fieldGroup = tinaForm.getActiveField(form.activeFieldName);
64363
+ return /* @__PURE__ */ React__namespace.createElement(
64364
+ reactFinalForm.Form,
64365
+ {
64366
+ key: tinaForm.id,
64367
+ form: tinaForm.finalForm,
64368
+ onSubmit: tinaForm.onSubmit
64369
+ },
64370
+ ({
64371
+ handleSubmit,
64372
+ pristine,
64373
+ invalid,
64374
+ submitting,
64375
+ dirtySinceLastSubmit,
64376
+ hasValidationErrors
64377
+ }) => {
64378
+ const usingProtectedBranch = cms.api.tina.usingProtectedBranch();
64379
+ const canSubmit = !pristine && !submitting && !hasValidationErrors && !(invalid && !dirtySinceLastSubmit);
64380
+ const safeSubmit = async () => {
64381
+ if (canSubmit) {
64382
+ await handleSubmit();
64383
+ }
64384
+ };
64385
+ const safeHandleSubmit = async () => {
64386
+ if (usingProtectedBranch) {
64387
+ setCreateBranchModalOpen(true);
64388
+ } else {
64389
+ safeSubmit();
64390
+ }
64391
+ };
64392
+ return /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, createBranchModalOpen && /* @__PURE__ */ React__namespace.createElement(
64393
+ CreateBranchModal,
64394
+ {
64395
+ safeSubmit,
64396
+ crudType: tinaForm.crudType,
64397
+ path: tinaForm.path,
64398
+ values: tinaForm.values,
64399
+ close: () => setCreateBranchModalOpen(false)
64400
+ }
64401
+ ), /* @__PURE__ */ React__namespace.createElement(DragDropContext, { onDragEnd: moveArrayItem }, /* @__PURE__ */ React__namespace.createElement(FormKeyBindings, { onSubmit: safeHandleSubmit }), /* @__PURE__ */ React__namespace.createElement(FormPortalProvider, null, /* @__PURE__ */ React__namespace.createElement(FormWrapper, { id: tinaForm.id }, (tinaForm == null ? void 0 : tinaForm.fields.length) ? /* @__PURE__ */ React__namespace.createElement(
64402
+ FieldsBuilder,
64403
+ {
64404
+ form: tinaForm,
64405
+ activeFieldName: form.activeFieldName,
64406
+ fields: fieldGroup.fields
64407
+ }
64408
+ ) : /* @__PURE__ */ React__namespace.createElement(NoFieldsPlaceholder, null))), !hideFooter && /* @__PURE__ */ React__namespace.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__namespace.createElement("div", { className: "flex-1 w-full justify-end gap-2 flex items-center max-w-form" }, tinaForm.reset && /* @__PURE__ */ React__namespace.createElement(
64409
+ ResetForm,
64410
+ {
64411
+ pristine,
64412
+ reset: async () => {
64413
+ finalForm2.reset();
64414
+ await tinaForm.reset();
64415
+ }
64416
+ },
64417
+ tinaForm.buttons.reset
64418
+ ), /* @__PURE__ */ React__namespace.createElement(
64419
+ Button$1,
64420
+ {
64421
+ onClick: safeHandleSubmit,
64422
+ disabled: !canSubmit,
64423
+ busy: submitting,
64424
+ variant: "primary"
64425
+ },
64426
+ submitting && /* @__PURE__ */ React__namespace.createElement(LoadingDots, null),
64427
+ !submitting && tinaForm.buttons.save
64428
+ ), tinaForm.actions.length > 0 && /* @__PURE__ */ React__namespace.createElement(
64429
+ FormActionMenu,
64430
+ {
64431
+ form: tinaForm,
64432
+ actions: tinaForm.actions
64433
+ }
64434
+ )))));
64435
+ }
64436
+ );
64437
+ };
64438
+ const FormStatus = ({ pristine }) => {
64439
+ const pristineClass = pristine ? "text-green-500" : "text-red-500";
64440
+ return /* @__PURE__ */ React__namespace.createElement(FaCircle, { className: cn("h-3", pristineClass) });
64441
+ };
64442
+ const FormWrapper = ({
64443
+ id: id2,
64444
+ children
64445
+ }) => {
64446
+ return /* @__PURE__ */ React__namespace.createElement(
64447
+ "div",
64448
+ {
64449
+ "data-test": `form:${id2 == null ? void 0 : id2.replace(/\\/g, "/")}`,
64450
+ className: "h-full overflow-y-auto max-h-full bg-gray-50"
64451
+ },
64452
+ /* @__PURE__ */ React__namespace.createElement("div", { className: "py-5 px-6" }, children)
64453
+ );
64454
+ };
64455
+ const Emoji = ({ className = "", ...props }) => /* @__PURE__ */ React__namespace.createElement(
64456
+ "span",
64457
+ {
64458
+ className: `text-[40px] leading-none inline-block ${className}`,
64459
+ ...props
64460
+ }
64461
+ );
64462
+ const CreateBranchModel = ({
64463
+ close: close2,
64464
+ safeSubmit,
64465
+ relativePath: relativePath2,
64466
+ values,
64467
+ crudType
64468
+ }) => /* @__PURE__ */ React__namespace.createElement(
64469
+ CreateBranchModal,
64470
+ {
64471
+ close: close2,
64472
+ safeSubmit,
64473
+ path: relativePath2,
64474
+ values,
64475
+ crudType
64476
+ }
64477
+ );
64296
64478
  const NestedForm = (props) => {
64297
64479
  const FormPortal = useFormPortal();
64298
64480
  const id2 = React.useMemo(() => uuid(), [props.id, props.initialValues]);
@@ -120400,10 +120582,12 @@ This will work when developing locally but NOT when deployed to production.
120400
120582
  };
120401
120583
  const Sidebar = ({ cms }) => {
120402
120584
  var _a2, _b;
120585
+ const location = reactRouterDom.useLocation();
120403
120586
  const collectionsInfo = useGetCollections(cms);
120404
120587
  const screens = cms.plugins.getType("screen").all();
120405
120588
  const cloudConfigs = cms.plugins.getType("cloud-config").all();
120406
- const [menuIsOpen, setMenuIsOpen] = React.useState(false);
120589
+ const isOnDashboard = location.pathname === "/";
120590
+ const [menuIsOpen, setMenuIsOpen] = React.useState(isOnDashboard);
120407
120591
  const isLocalMode = (_b = (_a2 = cms.api) == null ? void 0 : _a2.tina) == null ? void 0 : _b.isLocalMode;
120408
120592
  const activeScreens = screens.filter(
120409
120593
  (screen) => {
@@ -120647,7 +120831,7 @@ This will work when developing locally but NOT when deployed to production.
120647
120831
  headerClassName,
120648
120832
  children
120649
120833
  }) => {
120650
- return /* @__PURE__ */ React.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.createElement("div", { className: `py-2 pr-4 w-full ${headerClassName}` }, /* @__PURE__ */ React.createElement(LocalWarning, null), /* @__PURE__ */ React.createElement(BillingWarning, null), /* @__PURE__ */ React.createElement("div", { className: "flex items-center gap-4" }, /* @__PURE__ */ React.createElement(TinaIcon, { className: "self-center h-10 min-w-10 w-auto text-orange-500" }), /* @__PURE__ */ React.createElement(BranchButton, null), /* @__PURE__ */ React.createElement(BranchPreviewButton, null))), children);
120834
+ return /* @__PURE__ */ React.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.createElement("div", { className: `py-2 pr-4 w-full ${headerClassName}` }, /* @__PURE__ */ React.createElement(BillingWarning, null), /* @__PURE__ */ React.createElement("div", { className: "flex items-center gap-4" }, /* @__PURE__ */ React.createElement(TinaIcon, { className: "self-center h-10 min-w-10 w-auto text-orange-500" }), /* @__PURE__ */ React.createElement(LocalWarning, null), /* @__PURE__ */ React.createElement(BranchButton, null), /* @__PURE__ */ React.createElement(BranchPreviewButton, null))), children);
120651
120835
  };
120652
120836
  const PageHeader = ({
120653
120837
  children
@@ -120715,7 +120899,7 @@ This will work when developing locally but NOT when deployed to production.
120715
120899
  folder,
120716
120900
  collectionName
120717
120901
  }) => {
120718
- return /* @__PURE__ */ React.createElement(react$1.Menu, { as: "div", className: "relative inline-block text-left" }, () => /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(react$1.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.createElement(BiPlus, { className: "w-5 h-full ml-1 opacity-70" }))), /* @__PURE__ */ React.createElement(
120902
+ return /* @__PURE__ */ React.createElement(react$1.Menu, { as: "div", className: "relative inline-block text-left w-full md:w-auto" }, () => /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(react$1.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.createElement(BiPlus, { className: "w-5 h-full ml-1 opacity-70" }))), /* @__PURE__ */ React.createElement(
120719
120903
  react$1.Transition,
120720
120904
  {
120721
120905
  enter: "transition ease-out duration-100",
@@ -120843,6 +121027,9 @@ This will work when developing locally but NOT when deployed to production.
120843
121027
  booleanEquals: null
120844
121028
  }));
120845
121029
  }, [collectionName]);
121030
+ const tableRowStyle = "hover:bg-gray-50/50 border-b-2 border-gray-50 transition-colors duration-300";
121031
+ const tableHeadingCellStyle = "px-3 py-3 text-left text-xs font-bold text-gray-700 tracking-wider";
121032
+ const tableHeadingStyle2 = "bg-gray-100 border-b-2 border-gray-200";
120846
121033
  return /* @__PURE__ */ React.createElement(GetCMS, null, (cms) => {
120847
121034
  return /* @__PURE__ */ React.createElement(PageWrapper, null, /* @__PURE__ */ React.createElement(
120848
121035
  GetCollection,
@@ -120872,7 +121059,7 @@ This will work when developing locally but NOT when deployed to production.
120872
121059
  search
120873
121060
  },
120874
121061
  (collection, _loading, reFetchCollection, collectionExtra) => {
120875
- var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j;
121062
+ var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
120876
121063
  const documents = collection.documents.edges;
120877
121064
  const admin = cms.api.admin;
120878
121065
  const pageInfo = collection.documents.pageInfo;
@@ -121007,6 +121194,7 @@ This will work when developing locally but NOT when deployed to production.
121007
121194
  return { ...vars2, folderName };
121008
121195
  });
121009
121196
  },
121197
+ 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,
121010
121198
  createFunc: async () => {
121011
121199
  try {
121012
121200
  admin.createFolder(
@@ -121039,7 +121227,7 @@ This will work when developing locally but NOT when deployed to production.
121039
121227
  },
121040
121228
  close: () => setFolderModalOpen(false)
121041
121229
  }
121042
- ), /* @__PURE__ */ React.createElement(PageHeader, null, /* @__PURE__ */ React.createElement("div", { className: "w-full" }, /* @__PURE__ */ React.createElement("h3", { className: "font-sans text-2xl text-tina-orange" }, collection.label ? collection.label : collection.name), /* @__PURE__ */ React.createElement("div", { className: "flex flex-col lg:flex-row justify-between lg:items-end pt-2" }, /* @__PURE__ */ React.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.createElement(React.Fragment, null, !search && /* @__PURE__ */ React.createElement("div", { className: "flex flex-col gap-2 items-start w-full md:w-auto" }, /* @__PURE__ */ React.createElement(
121230
+ ), /* @__PURE__ */ React.createElement(PageHeader, null, /* @__PURE__ */ React.createElement("div", { className: "w-full mx-auto max-w-screen-xl" }, /* @__PURE__ */ React.createElement("h3", { className: "font-sans text-2xl text-tina-orange" }, collection.label ? collection.label : collection.name), /* @__PURE__ */ React.createElement("div", { className: "flex flex-col lg:flex-row justify-between lg:items-end pt-2" }, /* @__PURE__ */ React.createElement("div", { className: "flex flex-col md:flex-row gap-2 md:gap-4" }, (fields == null ? void 0 : fields.length) > 0 && /* @__PURE__ */ React.createElement(React.Fragment, null, !search && /* @__PURE__ */ React.createElement("div", { className: "flex flex-col gap-2 items-start w-full md:w-auto" }, /* @__PURE__ */ React.createElement(
121043
121231
  "label",
121044
121232
  {
121045
121233
  htmlFor: "sort",
@@ -121111,7 +121299,7 @@ This will work when developing locally but NOT when deployed to production.
121111
121299
  className: "underline hover:text-blue-700 transition-all duration-150"
121112
121300
  },
121113
121301
  "Read the docs"
121114
- ))))), allowCreate && /* @__PURE__ */ React.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.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(TooltipProvider, null, /* @__PURE__ */ React.createElement(Tooltip, null, /* @__PURE__ */ React.createElement(TooltipTrigger, { asChild: true }, /* @__PURE__ */ React.createElement("span", null, /* @__PURE__ */ React.createElement(
121302
+ ))))), allowCreate && /* @__PURE__ */ React.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.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(TooltipProvider, null, /* @__PURE__ */ React.createElement(Tooltip, null, /* @__PURE__ */ React.createElement(TooltipTrigger, { asChild: true }, /* @__PURE__ */ React.createElement(
121115
121303
  reactRouterDom.Link,
121116
121304
  {
121117
121305
  onMouseDown: (evt) => {
@@ -121129,7 +121317,7 @@ This will work when developing locally but NOT when deployed to production.
121129
121317
  },
121130
121318
  to: "/collections/new-folder",
121131
121319
  className: cn$1(
121132
- "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",
121320
+ "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",
121133
121321
  collection.templates && "opacity-50 pointer-events-none cursor-not-allowed"
121134
121322
  ),
121135
121323
  "aria-disabled": !!collection.templates,
@@ -121137,7 +121325,7 @@ This will work when developing locally but NOT when deployed to production.
121137
121325
  },
121138
121326
  /* @__PURE__ */ React.createElement(FaFolder, { className: "mr-2" }),
121139
121327
  "Add Folder"
121140
- ))), collection.templates && /* @__PURE__ */ React.createElement(
121328
+ )), collection.templates && /* @__PURE__ */ React.createElement(
121141
121329
  TooltipContent,
121142
121330
  {
121143
121331
  side: "top",
@@ -121178,175 +121366,225 @@ This will work when developing locally but NOT when deployed to production.
121178
121366
  templates: collection.templates,
121179
121367
  folder
121180
121368
  }
121181
- ))))), /* @__PURE__ */ React.createElement(PageBody, null, /* @__PURE__ */ React.createElement("div", { className: "w-full mx-auto max-w-screen-xl" }, sortField && !sortField.required && /* @__PURE__ */ React.createElement("p", { className: "mb-4 text-gray-500" }, /* @__PURE__ */ React.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.createElement("div", { className: "w-full overflow-x-auto shadow-md rounded-md" }, (folder.name && !search || documents.length > 0) && /* @__PURE__ */ React.createElement("table", { className: "table-auto shadow bg-white border-b border-gray-200 w-full max-w-full rounded-lg" }, /* @__PURE__ */ React.createElement("tbody", null, folder.name && !search ? /* @__PURE__ */ React.createElement("tr", null, /* @__PURE__ */ React.createElement("td", { colSpan: 5 }, /* @__PURE__ */ React.createElement(
121182
- Breadcrumb,
121183
- {
121184
- folder,
121185
- navigate,
121186
- collectionName
121187
- }
121188
- ))) : null, documents.length > 0 && documents.map((document2) => {
121189
- var _a3;
121190
- if (document2.node.__typename === "Folder") {
121191
- return /* @__PURE__ */ React.createElement(
121192
- "tr",
121193
- {
121194
- key: `folder-${document2.node.path}`
121195
- },
121196
- /* @__PURE__ */ React.createElement("td", { className: "pl-5 pr-3 py-3" }, /* @__PURE__ */ React.createElement(
121197
- "a",
121198
- {
121199
- className: "text-blue-600 hover:text-blue-400 flex items-center gap-3 cursor-pointer truncate",
121200
- onClick: () => {
121201
- navigate(
121202
- `/${[
121203
- "collections",
121204
- collectionName,
121205
- document2.node.path
121206
- ].join("/")}`,
121207
- { replace: true }
121208
- );
121209
- }
121210
- },
121211
- /* @__PURE__ */ React.createElement(BiFolder, { className: "inline-block h-6 w-auto flex-shrink-0 opacity-70" }),
121212
- /* @__PURE__ */ React.createElement("span", { className: "truncate block" }, /* @__PURE__ */ React.createElement("span", { className: "block text-xs text-gray-400 mb-1 uppercase" }, "Name"), /* @__PURE__ */ React.createElement("span", { className: "h-5 leading-5 block truncate" }, /* @__PURE__ */ React.createElement("span", null, document2.node.name)))
121213
- )),
121214
- /* @__PURE__ */ React.createElement("td", { className: "px-3 py-3", colSpan: 4 }, /* @__PURE__ */ React.createElement("span", { className: "block text-xs text-gray-400 mb-1 uppercase" }, "Path"), /* @__PURE__ */ React.createElement("span", { className: "leading-5 block text-sm font-medium text-gray-900 truncate" }, document2.node.path.substring(2).split("/").map((node2) => {
121215
- return /* @__PURE__ */ React.createElement("span", { key: node2 }, /* @__PURE__ */ React.createElement("span", { className: "text-gray-300 pr-0.5" }, "/"), /* @__PURE__ */ React.createElement("span", { className: "pr-0.5" }, node2));
121216
- })))
121217
- );
121218
- }
121219
- const hasTitle = Boolean(
121220
- document2.node._sys.title
121369
+ ))))), /* @__PURE__ */ React.createElement(PageBody, null, /* @__PURE__ */ React.createElement("div", { className: "w-full mx-auto max-w-screen-xl" }, sortField && !sortField.required && /* @__PURE__ */ React.createElement("p", { className: "mb-4 text-gray-500" }, /* @__PURE__ */ React.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.createElement("div", { className: "w-full overflow-x-auto shadow-md rounded-md" }, (folder.name && !search || documents.length > 0) && /* @__PURE__ */ React.createElement("table", { className: "table-auto shadow bg-white border border-gray-200 w-full max-w-full rounded-lg" }, (() => {
121370
+ const hasAnyDocuments = documents.some(
121371
+ (doc) => doc.node.__typename !== "Folder"
121221
121372
  );
121222
- const subfolders = document2.node._sys.breadcrumbs.slice(0, -1).join("/");
121223
- return /* @__PURE__ */ React.createElement(
121224
- "tr",
121373
+ const hasAnyFolders = documents.some(
121374
+ (doc) => doc.node.__typename === "Folder"
121375
+ );
121376
+ const hasAnyTitles = documents.some(
121377
+ (doc) => {
121378
+ var _a3;
121379
+ return doc.node.__typename !== "Folder" && Boolean((_a3 = doc.node._sys) == null ? void 0 : _a3.title);
121380
+ }
121381
+ );
121382
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, hasAnyDocuments && /* @__PURE__ */ React.createElement("thead", { className: tableHeadingStyle2 }, /* @__PURE__ */ React.createElement("tr", null, /* @__PURE__ */ React.createElement(
121383
+ "th",
121225
121384
  {
121226
- className: "hover:bg-gray-100 transition-colors duration-300",
121227
- key: `document-${document2.node._sys.relativePath}`
121385
+ className: tableHeadingCellStyle,
121386
+ colSpan: hasAnyTitles ? 1 : 2
121228
121387
  },
121229
- /* @__PURE__ */ React.createElement(
121230
- "td",
121231
- {
121232
- className: "pl-5 pr-3 py-3",
121233
- colSpan: hasTitle ? 1 : 2
121234
- },
121235
- /* @__PURE__ */ React.createElement(
121236
- "a",
121388
+ hasAnyTitles ? "Title" : "Filename"
121389
+ ), hasAnyTitles && /* @__PURE__ */ React.createElement(
121390
+ "th",
121391
+ {
121392
+ className: tableHeadingCellStyle
121393
+ },
121394
+ "Filename"
121395
+ ), /* @__PURE__ */ React.createElement("th", { className: tableHeadingCellStyle }, "Extension"), /* @__PURE__ */ React.createElement("th", { className: tableHeadingCellStyle }, "Template"), /* @__PURE__ */ React.createElement("th", null))), !hasAnyDocuments && hasAnyFolders && /* @__PURE__ */ React.createElement("thead", { className: tableHeadingStyle2 }, /* @__PURE__ */ React.createElement("tr", null, /* @__PURE__ */ React.createElement("th", { className: tableHeadingCellStyle }, "Name"), /* @__PURE__ */ React.createElement(
121396
+ "th",
121397
+ {
121398
+ className: tableHeadingCellStyle,
121399
+ colSpan: 4
121400
+ },
121401
+ "Path"
121402
+ ))), /* @__PURE__ */ React.createElement("tbody", null, folder.name && !search ? /* @__PURE__ */ React.createElement("tr", null, /* @__PURE__ */ React.createElement("td", { colSpan: 5 }, /* @__PURE__ */ React.createElement(
121403
+ Breadcrumb,
121404
+ {
121405
+ folder,
121406
+ navigate,
121407
+ collectionName
121408
+ }
121409
+ ))) : null, documents.length > 0 && documents.map((document2) => {
121410
+ var _a3;
121411
+ if (document2.node.__typename === "Folder") {
121412
+ return /* @__PURE__ */ React.createElement(
121413
+ "tr",
121237
121414
  {
121238
- className: "text-blue-600 hover:text-blue-400 flex items-center gap-3 cursor-pointer truncate",
121239
- onClick: () => {
121240
- handleNavigate(
121241
- navigate,
121242
- cms,
121243
- collection,
121244
- collectionDefinition,
121245
- document2.node
121246
- );
121247
- }
121415
+ className: tableRowStyle,
121416
+ key: `folder-${document2.node.path}`
121248
121417
  },
121249
- /* @__PURE__ */ React.createElement(BiFile, { className: "inline-block h-6 w-auto flex-shrink-0 opacity-70" }),
121250
- /* @__PURE__ */ React.createElement("span", { className: "truncate block" }, /* @__PURE__ */ React.createElement("span", { className: "block text-xs text-gray-400 mb-1 uppercase" }, hasTitle ? "Title" : "Filename"), /* @__PURE__ */ React.createElement("span", { className: "h-5 leading-5 block truncate mb-1" }, !folderView && !hasTitle && subfolders && /* @__PURE__ */ React.createElement("span", { className: "text-xs text-gray-400" }, `${subfolders}/`), /* @__PURE__ */ React.createElement("span", null, hasTitle ? (_a3 = document2.node._sys) == null ? void 0 : _a3.title : document2.node._sys.filename)), /* @__PURE__ */ React.createElement("span", { className: "block text-xs text-gray-400" }, document2.node._sys.path))
121251
- )
121252
- ),
121253
- hasTitle && /* @__PURE__ */ React.createElement("td", { className: "px-3 py-3" }, /* @__PURE__ */ React.createElement("span", { className: "block text-xs text-gray-400 mb-1 uppercase" }, "Filename"), /* @__PURE__ */ React.createElement("span", { className: "h-5 leading-5 block text-sm font-medium text-gray-900 truncate" }, !folderView && subfolders && /* @__PURE__ */ React.createElement("span", { className: "text-xs text-gray-400" }, `${subfolders}/`), /* @__PURE__ */ React.createElement("span", null, document2.node._sys.filename))),
121254
- /* @__PURE__ */ React.createElement("td", { className: "px-3 py-3" }, /* @__PURE__ */ React.createElement("span", { className: "block text-xs text-gray-400 mb-1 uppercase" }, "Extension"), /* @__PURE__ */ React.createElement("span", { className: "h-5 leading-5 block text-sm font-medium text-gray-900" }, document2.node._sys.extension)),
121255
- /* @__PURE__ */ React.createElement("td", { className: "px-3 py-3" }, /* @__PURE__ */ React.createElement("span", { className: "block text-xs text-gray-400 mb-1 uppercase" }, "Template"), /* @__PURE__ */ React.createElement("span", { className: "h-5 leading-5 block text-sm font-medium text-gray-900" }, document2.node._sys.template)),
121256
- /* @__PURE__ */ React.createElement("td", { className: "w-0" }, /* @__PURE__ */ React.createElement(
121257
- OverflowMenu$1,
121258
- {
121259
- toolbarItems: [
121418
+ /* @__PURE__ */ React.createElement("td", { className: "pl-5 pr-3 py-3" }, /* @__PURE__ */ React.createElement(
121419
+ "a",
121260
121420
  {
121261
- name: "edit",
121262
- label: "Edit in Admin",
121263
- Icon: /* @__PURE__ */ React.createElement(BiEdit, { size: "1.3rem" }),
121264
- onMouseDown: () => {
121265
- const pathToDoc = document2.node._sys.breadcrumbs;
121266
- if (folder.fullyQualifiedName) {
121267
- pathToDoc.unshift("~");
121268
- }
121421
+ className: "text-blue-600 flex items-center gap-3 cursor-pointer truncate",
121422
+ onClick: () => {
121269
121423
  navigate(
121270
121424
  `/${[
121271
121425
  "collections",
121272
- "edit",
121273
121426
  collectionName,
121274
- ...pathToDoc
121427
+ document2.node.path
121275
121428
  ].join("/")}`,
121276
121429
  { replace: true }
121277
121430
  );
121278
121431
  }
121279
121432
  },
121280
- allowCreate && {
121281
- name: "duplicate",
121282
- label: "Duplicate",
121283
- Icon: /* @__PURE__ */ React.createElement(BiCopy, { size: "1.3rem" }),
121284
- onMouseDown: () => {
121285
- const pathToDoc = document2.node._sys.breadcrumbs;
121286
- if (folder.fullyQualifiedName) {
121287
- pathToDoc.unshift("~");
121288
- }
121289
- navigate(
121290
- `/${[
121291
- "collections",
121292
- "duplicate",
121293
- collectionName,
121294
- ...pathToDoc
121295
- ].join("/")}`,
121296
- { replace: true }
121297
- );
121298
- }
121433
+ /* @__PURE__ */ React.createElement(BiFolder, { className: "inline-block h-6 w-auto flex-shrink-0 opacity-70" }),
121434
+ /* @__PURE__ */ React.createElement("span", { className: "truncate block" }, /* @__PURE__ */ React.createElement("span", { className: "leading-5 block truncate" }, /* @__PURE__ */ React.createElement("span", null, document2.node.name)))
121435
+ )),
121436
+ /* @__PURE__ */ React.createElement(
121437
+ "td",
121438
+ {
121439
+ className: "px-3 py-3",
121440
+ colSpan: 4
121299
121441
  },
121300
- allowDelete && {
121301
- name: "rename",
121302
- label: "Rename",
121303
- Icon: /* @__PURE__ */ React.createElement(BiRename, { size: "1.3rem" }),
121304
- onMouseDown: () => {
121305
- setVars((old) => ({
121306
- ...old,
121307
- collection: collectionName,
121308
- relativePathWithoutExtension: document2.node._sys.breadcrumbs.join(
121309
- "/"
121310
- ),
121311
- relativePath: document2.node._sys.breadcrumbs.join(
121312
- "/"
121313
- ) + document2.node._sys.extension,
121314
- newRelativePath: ""
121315
- }));
121316
- setRenameModalOpen(true);
121442
+ /* @__PURE__ */ React.createElement("span", { className: "leading-5 block text-sm font-medium text-gray-400 truncate" }, document2.node.path.substring(2).split("/").map((node2) => {
121443
+ return /* @__PURE__ */ React.createElement("span", { key: node2 }, /* @__PURE__ */ React.createElement("span", { className: "text-gray-300 pr-0.5" }, "/"), /* @__PURE__ */ React.createElement("span", { className: "pr-0.5" }, node2));
121444
+ }))
121445
+ )
121446
+ );
121447
+ }
121448
+ const hasTitle = Boolean(
121449
+ document2.node._sys.title
121450
+ );
121451
+ const subfolders = document2.node._sys.breadcrumbs.slice(0, -1).join("/");
121452
+ return /* @__PURE__ */ React.createElement(
121453
+ "tr",
121454
+ {
121455
+ className: tableRowStyle,
121456
+ key: `document-${document2.node._sys.relativePath}`
121457
+ },
121458
+ /* @__PURE__ */ React.createElement(
121459
+ "td",
121460
+ {
121461
+ className: "pl-5 pr-3 py-3",
121462
+ colSpan: hasTitle ? 1 : 2
121463
+ },
121464
+ /* @__PURE__ */ React.createElement(
121465
+ "a",
121466
+ {
121467
+ className: "text-blue-600 flex items-center gap-3 cursor-pointer truncate",
121468
+ onClick: () => {
121469
+ handleNavigate(
121470
+ navigate,
121471
+ cms,
121472
+ collection,
121473
+ collectionDefinition,
121474
+ document2.node
121475
+ );
121317
121476
  }
121318
121477
  },
121319
- allowDelete && {
121320
- name: "delete",
121321
- label: "Delete",
121322
- Icon: /* @__PURE__ */ React.createElement(
121323
- BiTrash,
121324
- {
121325
- size: "1.3rem",
121326
- className: "text-red-500"
121478
+ /* @__PURE__ */ React.createElement(BiFile, { className: "inline-block h-6 w-auto flex-shrink-0 opacity-70" }),
121479
+ /* @__PURE__ */ React.createElement("span", { className: "truncate block" }, /* @__PURE__ */ React.createElement("span", { className: "leading-5 block truncate mb-1" }, !folderView && !hasTitle && subfolders && /* @__PURE__ */ React.createElement("span", { className: "text-xs text-gray-400" }, `${subfolders}/`), /* @__PURE__ */ React.createElement("span", null, hasTitle ? (_a3 = document2.node._sys) == null ? void 0 : _a3.title : document2.node._sys.filename)), /* @__PURE__ */ React.createElement("span", { className: "block text-xs text-gray-400" }, document2.node._sys.path))
121480
+ )
121481
+ ),
121482
+ hasTitle && /* @__PURE__ */ React.createElement("td", { className: "px-3 py-3" }, /* @__PURE__ */ React.createElement("span", { className: "leading-5 block text-sm font-medium text-gray-900 truncate" }, !folderView && subfolders && /* @__PURE__ */ React.createElement("span", { className: "text-xs text-gray-400" }, `${subfolders}/`), /* @__PURE__ */ React.createElement("span", null, document2.node._sys.filename))),
121483
+ /* @__PURE__ */ React.createElement("td", { className: "px-3 py-3" }, /* @__PURE__ */ React.createElement("span", { className: "leading-5 block text-sm font-medium text-gray-900" }, document2.node._sys.extension)),
121484
+ /* @__PURE__ */ React.createElement("td", { className: "px-3 py-3" }, /* @__PURE__ */ React.createElement("span", { className: "leading-5 block text-sm font-medium text-gray-900" }, document2.node._sys.template)),
121485
+ /* @__PURE__ */ React.createElement("td", { className: "w-0" }, /* @__PURE__ */ React.createElement(
121486
+ OverflowMenu$1,
121487
+ {
121488
+ toolbarItems: [
121489
+ {
121490
+ name: "edit",
121491
+ label: "Edit in Admin",
121492
+ Icon: /* @__PURE__ */ React.createElement(BiEdit, { size: "1.3rem" }),
121493
+ onMouseDown: () => {
121494
+ const pathToDoc = document2.node._sys.breadcrumbs;
121495
+ if (folder.fullyQualifiedName) {
121496
+ pathToDoc.unshift(
121497
+ "~"
121498
+ );
121499
+ }
121500
+ navigate(
121501
+ `/${[
121502
+ "collections",
121503
+ "edit",
121504
+ collectionName,
121505
+ ...pathToDoc
121506
+ ].join("/")}`,
121507
+ { replace: true }
121508
+ );
121509
+ }
121510
+ },
121511
+ allowCreate && {
121512
+ name: "duplicate",
121513
+ label: "Duplicate",
121514
+ Icon: /* @__PURE__ */ React.createElement(BiCopy, { size: "1.3rem" }),
121515
+ onMouseDown: () => {
121516
+ const pathToDoc = document2.node._sys.breadcrumbs;
121517
+ if (folder.fullyQualifiedName) {
121518
+ pathToDoc.unshift(
121519
+ "~"
121520
+ );
121521
+ }
121522
+ navigate(
121523
+ `/${[
121524
+ "collections",
121525
+ "duplicate",
121526
+ collectionName,
121527
+ ...pathToDoc
121528
+ ].join("/")}`,
121529
+ { replace: true }
121530
+ );
121531
+ }
121532
+ },
121533
+ allowDelete && {
121534
+ name: "rename",
121535
+ label: "Rename",
121536
+ Icon: /* @__PURE__ */ React.createElement(BiRename, { size: "1.3rem" }),
121537
+ onMouseDown: () => {
121538
+ setVars((old) => ({
121539
+ ...old,
121540
+ collection: collectionName,
121541
+ relativePathWithoutExtension: document2.node._sys.breadcrumbs.join(
121542
+ "/"
121543
+ ),
121544
+ relativePath: document2.node._sys.breadcrumbs.join(
121545
+ "/"
121546
+ ) + document2.node._sys.extension,
121547
+ newRelativePath: ""
121548
+ }));
121549
+ setRenameModalOpen(
121550
+ true
121551
+ );
121552
+ }
121553
+ },
121554
+ allowDelete && {
121555
+ name: "delete",
121556
+ label: "Delete",
121557
+ Icon: /* @__PURE__ */ React.createElement(
121558
+ BiTrash,
121559
+ {
121560
+ size: "1.3rem",
121561
+ className: "text-red-500"
121562
+ }
121563
+ ),
121564
+ className: "text-red-500",
121565
+ onMouseDown: () => {
121566
+ setVars((old) => ({
121567
+ ...old,
121568
+ collection: collectionName,
121569
+ relativePathWithoutExtension: document2.node._sys.breadcrumbs.join(
121570
+ "/"
121571
+ ),
121572
+ relativePath: document2.node._sys.breadcrumbs.join(
121573
+ "/"
121574
+ ) + document2.node._sys.extension,
121575
+ newRelativePath: ""
121576
+ }));
121577
+ setDeleteModalOpen(
121578
+ true
121579
+ );
121327
121580
  }
121328
- ),
121329
- className: "text-red-500",
121330
- onMouseDown: () => {
121331
- setVars((old) => ({
121332
- ...old,
121333
- collection: collectionName,
121334
- relativePathWithoutExtension: document2.node._sys.breadcrumbs.join(
121335
- "/"
121336
- ),
121337
- relativePath: document2.node._sys.breadcrumbs.join(
121338
- "/"
121339
- ) + document2.node._sys.extension,
121340
- newRelativePath: ""
121341
- }));
121342
- setDeleteModalOpen(true);
121343
121581
  }
121344
- }
121345
- ].filter(Boolean)
121346
- }
121347
- ))
121348
- );
121349
- })))), documents.length === 0 && /* @__PURE__ */ React.createElement(NoDocumentsPlaceholder, null), /* @__PURE__ */ React.createElement("div", { className: "pt-4" }, /* @__PURE__ */ React.createElement(
121582
+ ].filter(Boolean)
121583
+ }
121584
+ ))
121585
+ );
121586
+ })));
121587
+ })())), documents.length === 0 && /* @__PURE__ */ React.createElement(NoDocumentsPlaceholder, null), /* @__PURE__ */ React.createElement("div", { className: "pt-4" }, /* @__PURE__ */ React.createElement(
121350
121588
  CursorPaginator,
121351
121589
  {
121352
121590
  variant: "white",
@@ -121506,20 +121744,47 @@ This will work when developing locally but NOT when deployed to production.
121506
121744
  close: close2,
121507
121745
  createFunc,
121508
121746
  folderName,
121509
- setFolderName
121747
+ setFolderName,
121748
+ validationRegex
121510
121749
  }) => {
121750
+ const [isFolderNameValid, setIsFolderNameValid] = React.useState(false);
121751
+ const [isInteracted, setIsInteracted] = React.useState(false);
121752
+ React.useEffect(() => {
121753
+ validateFolderName(folderName);
121754
+ }, [folderName]);
121755
+ const validateFolderName = (name) => {
121756
+ if (!validationRegex || !name.trim()) {
121757
+ setIsFolderNameValid(!!name.trim());
121758
+ return !!name.trim();
121759
+ }
121760
+ try {
121761
+ const regex = new RegExp(validationRegex);
121762
+ const valid = regex.test(name);
121763
+ setIsFolderNameValid(valid);
121764
+ return valid;
121765
+ } catch (error2) {
121766
+ setIsFolderNameValid(false);
121767
+ return false;
121768
+ }
121769
+ };
121511
121770
  return /* @__PURE__ */ React.createElement(Modal, null, /* @__PURE__ */ React.createElement(PopupModal, null, /* @__PURE__ */ React.createElement(ModalHeader, { close: close2 }, "Create Folder"), /* @__PURE__ */ React.createElement(ModalBody, { padded: true }, /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
121512
121771
  BaseTextField,
121513
121772
  {
121514
121773
  placeholder: "Enter the name of the new folder",
121515
121774
  value: folderName,
121516
- onChange: (event) => setFolderName(event.target.value)
121775
+ className: `mb-4 ${!isFolderNameValid && isInteracted ? "border-red-500" : ""}`,
121776
+ onChange: (event) => {
121777
+ setFolderName(event.target.value);
121778
+ setIsInteracted(true);
121779
+ validateFolderName(event.target.value);
121780
+ }
121517
121781
  }
121518
- ))), /* @__PURE__ */ React.createElement(ModalActions, null, /* @__PURE__ */ React.createElement(Button$1, { style: { flexGrow: 2 }, onClick: close2 }, "Cancel"), /* @__PURE__ */ React.createElement(
121782
+ ), !isFolderNameValid && isInteracted && /* @__PURE__ */ React.createElement("p", { className: "text-red-500 text-sm pl-1" }, "Folder name is not valid – please enter a valid folder name."))), /* @__PURE__ */ React.createElement(ModalActions, null, /* @__PURE__ */ React.createElement(Button$1, { style: { flexGrow: 2 }, onClick: close2 }, "Cancel"), /* @__PURE__ */ React.createElement(
121519
121783
  Button$1,
121520
121784
  {
121521
121785
  style: { flexGrow: 3 },
121522
121786
  variant: "primary",
121787
+ disabled: !isFolderNameValid,
121523
121788
  onClick: async () => {
121524
121789
  await createFunc();
121525
121790
  close2();