tinacms 2.9.3 → 2.9.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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("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", "react-color", "color-string", "tailwind-merge", "react-beautiful-dnd", "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));
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, dropzone, cmdk$1, react$1, plateTrailingBlock, plateFloating, plateBlockQuote, plateNodeId, plateLink, plateAutoformat, get$5, moment, dateFns, 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("react-beautiful-dnd"), 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", "react-beautiful-dnd", "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));
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, reactBeautifulDnd, pkg$1, pkg, graphql$1, core$1, 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,270 @@ 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
+ function FaCircle(props) {
38964
+ 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);
38965
+ }
38966
+ function FaFile(props) {
38967
+ 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);
38968
+ }
38969
+ function FaFolder(props) {
38970
+ 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);
38971
+ }
38972
+ function FaLock(props) {
38973
+ 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);
38974
+ }
38975
+ function FaSpinner(props) {
38976
+ 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);
38977
+ }
38978
+ function FaUnlock(props) {
38979
+ 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);
38980
+ }
38576
38981
  const Dismissible = ({
38577
38982
  onDismiss,
38578
38983
  escape: escape2,
@@ -38645,64 +39050,217 @@ Please wrap them with useCallback or configure the deps array correctly.`
38645
39050
  }, [click, customDocument, escape2, disabled, onDismiss]);
38646
39051
  return area;
38647
39052
  }
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);
38656
- };
38657
- function ParseColorStr(color) {
38658
- if (!color) {
38659
- return null;
38660
- }
38661
- const colorDescriptor = getColor(color);
38662
- if (!colorDescriptor)
38663
- return null;
38664
- const colorVals = colorDescriptor.value;
38665
- return { r: colorVals[0], g: colorVals[1], b: colorVals[2], a: colorVals[3] };
38666
- }
38667
- const ColorFormatter = {
38668
- [
38669
- "rgb"
38670
- /* RGB */
38671
- ]: {
38672
- getLabel(color) {
38673
- return `R${color.r} G${color.g} B${color.b}`;
38674
- },
38675
- getValue(color) {
38676
- const colorVals = [color.r, color.g, color.b, color.a];
38677
- return toColor.rgb(colorVals);
38678
- },
38679
- parse: ParseColorStr
38680
- },
38681
- [
38682
- "hex"
38683
- /* Hex */
38684
- ]: {
38685
- getLabel(color) {
38686
- return rgbToHex(color);
38687
- },
38688
- getValue(color) {
38689
- const colorVals = [color.r, color.g, color.b, color.a];
38690
- return toColor.hex(colorVals);
39053
+ const FormActionMenu = ({ actions, form }) => {
39054
+ const [actionMenuVisibility, setActionMenuVisibility] = React.useState(false);
39055
+ 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(
39056
+ Dismissible,
39057
+ {
39058
+ click: true,
39059
+ escape: true,
39060
+ disabled: !actionMenuVisibility,
39061
+ onDismiss: () => {
39062
+ setActionMenuVisibility((p2) => !p2);
39063
+ }
38691
39064
  },
38692
- parse: ParseColorStr
38693
- }
38694
- };
38695
- const { SketchPicker, BlockPicker } = pkg__namespace$1;
38696
- const GetTextColorForBackground = function(backgroundColor) {
38697
- return !backgroundColor || backgroundColor.r * 0.299 + backgroundColor.g * 0.587 + backgroundColor.b * 0.114 > 186 ? "#000000" : "#ffffff";
39065
+ actions.map((Action, i2) => (
39066
+ // TODO: `i` will suppress warnings but this indicates that maybe
39067
+ // Actions should just be componets
39068
+ /* @__PURE__ */ React__namespace.createElement(Action, { form, key: i2 })
39069
+ ))
39070
+ )));
38698
39071
  };
38699
- const Swatch = ({
38700
- colorRGBA,
38701
- colorFormat,
38702
- unselectable,
38703
- ...props
38704
- }) => /* @__PURE__ */ React__namespace.createElement(
38705
- "div",
39072
+ const MoreActionsButton = ({ className = "", ...props }) => /* @__PURE__ */ React__namespace.createElement(
39073
+ "button",
39074
+ {
39075
+ 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}`,
39076
+ ...props
39077
+ },
39078
+ /* @__PURE__ */ React__namespace.createElement(EllipsisVerticalIcon, null)
39079
+ );
39080
+ const ActionsOverlay = ({ open, className = "", style = {}, ...props }) => /* @__PURE__ */ React__namespace.createElement(
39081
+ "div",
39082
+ {
39083
+ 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}`,
39084
+ style: {
39085
+ transform: open ? "translate3d(0, -28px, 0) scale3d(1, 1, 1)" : "translate3d(0, 0, 0) scale3d(0.5, 0.5, 1)",
39086
+ pointerEvents: open ? "all" : "none",
39087
+ ...style
39088
+ },
39089
+ ...props
39090
+ }
39091
+ );
39092
+ const ActionButton = ({ className = "", ...props }) => /* @__PURE__ */ React__namespace.createElement(
39093
+ "button",
39094
+ {
39095
+ 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}`,
39096
+ ...props
39097
+ }
39098
+ );
39099
+ const FormPortalContext = React__namespace.createContext(() => {
39100
+ return null;
39101
+ });
39102
+ function useFormPortal() {
39103
+ return React__namespace.useContext(FormPortalContext);
39104
+ }
39105
+ const FormPortalProvider = ({
39106
+ children
39107
+ }) => {
39108
+ const wrapperRef = React__namespace.useRef(null);
39109
+ const zIndexRef = React__namespace.useRef(0);
39110
+ const FormPortal = React__namespace.useCallback(
39111
+ (props) => {
39112
+ if (!wrapperRef.current)
39113
+ return null;
39114
+ return ReactDOM.createPortal(
39115
+ props.children({ zIndexShift: zIndexRef.current += 1 }),
39116
+ wrapperRef.current
39117
+ );
39118
+ },
39119
+ [wrapperRef, zIndexRef]
39120
+ );
39121
+ 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));
39122
+ };
39123
+ const LoadingDots = ({
39124
+ dotSize = 8,
39125
+ color = "white"
39126
+ }) => {
39127
+ 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 }));
39128
+ };
39129
+ const SingleDot = ({ delay = 0, color, dotSize }) => /* @__PURE__ */ React__namespace.createElement(
39130
+ "span",
39131
+ {
39132
+ className: "inline-block mr-1",
39133
+ style: {
39134
+ animation: "loading-dots-scale-up-and-down 2s linear infinite",
39135
+ animationDelay: `${delay}s`,
39136
+ background: color,
39137
+ width: dotSize,
39138
+ height: dotSize,
39139
+ borderRadius: dotSize
39140
+ }
39141
+ }
39142
+ );
39143
+ const ResetForm = ({
39144
+ pristine,
39145
+ reset: reset2,
39146
+ children,
39147
+ ...props
39148
+ }) => {
39149
+ const [open, setOpen] = React__namespace.useState(false);
39150
+ return /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, /* @__PURE__ */ React__namespace.createElement(
39151
+ Button$1,
39152
+ {
39153
+ onClick: () => {
39154
+ setOpen((p2) => !p2);
39155
+ },
39156
+ disabled: pristine,
39157
+ ...props
39158
+ },
39159
+ children
39160
+ ), open && /* @__PURE__ */ React__namespace.createElement(ResetModal, { reset: reset2, close: () => setOpen(false) }));
39161
+ };
39162
+ const ResetModal = ({ close: close2, reset: reset2 }) => {
39163
+ 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(
39164
+ Button$1,
39165
+ {
39166
+ style: { flexGrow: 3 },
39167
+ variant: "primary",
39168
+ onClick: async () => {
39169
+ await reset2();
39170
+ close2();
39171
+ }
39172
+ },
39173
+ "Reset"
39174
+ ))));
39175
+ };
39176
+ function AiFillWarning(props) {
39177
+ 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);
39178
+ }
39179
+ function AiOutlineLoading(props) {
39180
+ 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);
39181
+ }
39182
+ 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";
39183
+ const disabledClasses$1 = "opacity-50 pointer-events-none cursor-not-allowed";
39184
+ const BaseTextField = React__namespace.forwardRef(({ className, disabled, ...rest }, ref) => {
39185
+ return /* @__PURE__ */ React__namespace.createElement(
39186
+ "input",
39187
+ {
39188
+ ref,
39189
+ type: "text",
39190
+ className: `${textFieldClasses} ${disabled ? disabledClasses$1 : ""} ${className}`,
39191
+ ...rest
39192
+ }
39193
+ );
39194
+ });
39195
+ const TextArea = React__namespace.forwardRef(({ ...props }, ref) => {
39196
+ return /* @__PURE__ */ React__namespace.createElement(
39197
+ "textarea",
39198
+ {
39199
+ ...props,
39200
+ 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",
39201
+ ref,
39202
+ style: { minHeight: "160px" }
39203
+ }
39204
+ );
39205
+ });
39206
+ const { get: getColor, to: toColor } = pkg__namespace;
39207
+ var ColorFormat = /* @__PURE__ */ ((ColorFormat2) => {
39208
+ ColorFormat2["Hex"] = "hex";
39209
+ ColorFormat2["RGB"] = "rgb";
39210
+ return ColorFormat2;
39211
+ })(ColorFormat || {});
39212
+ const rgbToHex = function(color) {
39213
+ return "#" + ((1 << 24) + (color.r << 16) + (color.g << 8) + color.b).toString(16).slice(1);
39214
+ };
39215
+ function ParseColorStr(color) {
39216
+ if (!color) {
39217
+ return null;
39218
+ }
39219
+ const colorDescriptor = getColor(color);
39220
+ if (!colorDescriptor)
39221
+ return null;
39222
+ const colorVals = colorDescriptor.value;
39223
+ return { r: colorVals[0], g: colorVals[1], b: colorVals[2], a: colorVals[3] };
39224
+ }
39225
+ const ColorFormatter = {
39226
+ [
39227
+ "rgb"
39228
+ /* RGB */
39229
+ ]: {
39230
+ getLabel(color) {
39231
+ return `R${color.r} G${color.g} B${color.b}`;
39232
+ },
39233
+ getValue(color) {
39234
+ const colorVals = [color.r, color.g, color.b, color.a];
39235
+ return toColor.rgb(colorVals);
39236
+ },
39237
+ parse: ParseColorStr
39238
+ },
39239
+ [
39240
+ "hex"
39241
+ /* Hex */
39242
+ ]: {
39243
+ getLabel(color) {
39244
+ return rgbToHex(color);
39245
+ },
39246
+ getValue(color) {
39247
+ const colorVals = [color.r, color.g, color.b, color.a];
39248
+ return toColor.hex(colorVals);
39249
+ },
39250
+ parse: ParseColorStr
39251
+ }
39252
+ };
39253
+ const { SketchPicker, BlockPicker } = pkg__namespace$1;
39254
+ const GetTextColorForBackground = function(backgroundColor) {
39255
+ return !backgroundColor || backgroundColor.r * 0.299 + backgroundColor.g * 0.587 + backgroundColor.b * 0.114 > 186 ? "#000000" : "#ffffff";
39256
+ };
39257
+ const Swatch = ({
39258
+ colorRGBA,
39259
+ colorFormat,
39260
+ unselectable,
39261
+ ...props
39262
+ }) => /* @__PURE__ */ React__namespace.createElement(
39263
+ "div",
38706
39264
  {
38707
39265
  className: "bg-gray-100 rounded-3xl shadow-[0_2px_3px_rgba(0,0,0,0.12)] cursor-pointer w-full m-0",
38708
39266
  ...props
@@ -39187,546 +39745,135 @@ Please wrap them with useCallback or configure the deps array correctly.`
39187
39745
  }
39188
39746
  }
39189
39747
  );
39190
- function cn$1(...inputs) {
39191
- return tailwindMerge.twMerge(clsx.clsx(inputs));
39748
+ function useCMS() {
39749
+ return useCMS$1();
39192
39750
  }
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
39751
+ const supportedFileTypes = [
39752
+ "text/*",
39753
+ "application/pdf",
39754
+ "application/octet-stream",
39755
+ "application/json",
39756
+ "application/ld+json",
39757
+ "application/vnd.ms-excel",
39758
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
39759
+ "application/msword",
39760
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
39761
+ "application/postscript",
39762
+ "model/fbx",
39763
+ "model/gltf+json",
39764
+ "model/ply",
39765
+ "model/u3d+mesh",
39766
+ "model/vnd.usdz+zip",
39767
+ "application/x-indesign",
39768
+ "application/vnd.apple.mpegurl",
39769
+ "application/dash+xml",
39770
+ "application/mxf",
39771
+ "image/*",
39772
+ "video/*"
39773
+ ];
39774
+ const DEFAULT_MEDIA_UPLOAD_TYPES = supportedFileTypes.join(",");
39775
+ const dropzoneAcceptFromString = (str) => {
39776
+ return Object.assign(
39777
+ {},
39778
+ ...(str || DEFAULT_MEDIA_UPLOAD_TYPES).split(",").map((x) => ({ [x]: [] }))
39246
39779
  );
39247
39780
  };
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
- };
39781
+ const isImage = (filename) => {
39782
+ return /\.(gif|jpg|jpeg|tiff|png|svg|webp|avif)(\?.*)?$/i.test(filename);
39783
+ };
39784
+ const isVideo = (filename) => {
39785
+ return /\.(mp4|webm|ogg|m4v|mov|avi|flv|mkv)(\?.*)?$/i.test(filename);
39786
+ };
39787
+ const absoluteImgURL = (str) => {
39788
+ if (str.startsWith("http"))
39789
+ return str;
39790
+ return `${window.location.origin}${str}`;
39791
+ };
39792
+ const { useDropzone: useDropzone$1 } = dropzone__namespace;
39793
+ const StyledImage = ({ src }) => {
39794
+ const isSvg = /\.svg$/.test(src);
39276
39795
  return /* @__PURE__ */ React__namespace.createElement(
39277
- "button",
39796
+ "img",
39278
39797
  {
39279
- className: cn$1(
39280
- baseClasses,
39281
- variantClasses[variant],
39282
- sizeClasses[size2],
39283
- stateClasses[state],
39284
- className
39285
- ),
39286
- ...props
39287
- },
39288
- children
39798
+ src,
39799
+ className: `block max-w-full rounded shadow overflow-hidden max-h-48 lg:max-h-64 h-auto object-contain transition-opacity duration-100 ease-out m-0 bg-gray-200 bg-auto bg-center bg-no-repeat ${isSvg ? "min-w-[12rem]" : ""}`
39800
+ }
39289
39801
  );
39290
39802
  };
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,
39803
+ const StyledFile = ({ src }) => {
39804
+ return /* @__PURE__ */ React__namespace.createElement("div", { className: "max-w-full w-full flex-1 flex justify-start items-center gap-3" }, /* @__PURE__ */ React__namespace.createElement("div", { className: "w-12 h-12 bg-white shadow border border-gray-100 rounded flex justify-center flex-none" }, /* @__PURE__ */ React__namespace.createElement(BiFileBlank, { className: "w-3/5 h-full fill-gray-300" })), /* @__PURE__ */ React__namespace.createElement("span", { className: "text-base text-left flex-1 text-gray-500 w-full break-words truncate" }, src));
39805
+ };
39806
+ const ImageUpload = React__namespace.forwardRef(({ onDrop, onClear, onClick, value, src, loading }, ref) => {
39807
+ const cms = useCMS();
39808
+ const { getRootProps, getInputProps } = useDropzone$1({
39809
+ accept: dropzoneAcceptFromString(
39810
+ cms.media.accept || DEFAULT_MEDIA_UPLOAD_TYPES
39811
+ ),
39812
+ onDrop,
39813
+ noClick: !!onClick
39814
+ });
39815
+ return /* @__PURE__ */ React__namespace.createElement("div", { className: "w-full max-w-full", ...getRootProps() }, /* @__PURE__ */ React__namespace.createElement("input", { ...getInputProps() }), value ? loading ? /* @__PURE__ */ React__namespace.createElement(ImageLoadingIndicator, null) : /* @__PURE__ */ React__namespace.createElement(
39816
+ "div",
39310
39817
  {
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}}`
39818
+ className: `relative w-full max-w-full flex justify-start ${isImage(src) ? `items-start gap-3` : `items-center gap-2`}`
39312
39819
  },
39313
- /* @__PURE__ */ React.createElement(
39314
- "svg",
39820
+ /* @__PURE__ */ React__namespace.createElement(
39821
+ "button",
39315
39822
  {
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"
39823
+ className: "flex-shrink min-w-0 focus-within:shadow-outline focus-within:border-blue-500 rounded outline-none overflow-visible cursor-pointer border-none hover:opacity-60 transition ease-out duration-100",
39824
+ onClick,
39825
+ ref
39321
39826
  },
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"
39827
+ isImage(src) ? /* @__PURE__ */ React__namespace.createElement(StyledImage, { src }) : /* @__PURE__ */ React__namespace.createElement(StyledFile, { src })
39828
+ ),
39829
+ onClear && /* @__PURE__ */ React__namespace.createElement(
39830
+ DeleteImageButton,
39831
+ {
39832
+ onClick: (e3) => {
39833
+ e3.stopPropagation();
39834
+ onClear();
39329
39835
  }
39330
- )
39836
+ }
39331
39837
  )
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
- }))))));
39838
+ ) : /* @__PURE__ */ React__namespace.createElement(
39839
+ "button",
39840
+ {
39841
+ className: "outline-none relative hover:opacity-60 w-full",
39842
+ onClick
39843
+ },
39844
+ loading ? /* @__PURE__ */ React__namespace.createElement(ImageLoadingIndicator, null) : /* @__PURE__ */ React__namespace.createElement("div", { className: "text-center rounded-[5px] bg-gray-100 text-gray-300 leading-[1.35] py-3 text-[15px] font-normal transition-all ease-out duration-100 hover:opacity-60" }, "Drag 'n' drop a file here,", /* @__PURE__ */ React__namespace.createElement("br", null), "or click to select a file")
39845
+ ));
39846
+ });
39847
+ const DeleteImageButton = ({
39848
+ onClick
39849
+ }) => {
39850
+ return /* @__PURE__ */ React__namespace.createElement(IconButton, { variant: "white", className: "flex-none", onClick }, /* @__PURE__ */ React__namespace.createElement(TrashIcon, { className: "w-7 h-auto caret-transparent" }));
39354
39851
  };
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);
39852
+ const ImageLoadingIndicator = () => /* @__PURE__ */ React__namespace.createElement("div", { className: "p-4 w-full min-h-[96px] flex flex-col justify-center items-center" }, /* @__PURE__ */ React__namespace.createElement(LoadingDots, null));
39853
+ function IoMdArrowDropdown(props) {
39854
+ return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 512 512" }, "child": [{ "tag": "path", "attr": { "d": "M128 192l128 128 128-128z" }, "child": [] }] })(props);
39357
39855
  }
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);
39856
+ function IoMdArrowDropup(props) {
39857
+ return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 512 512" }, "child": [{ "tag": "path", "attr": { "d": "M128 320l128-128 128 128z" }, "child": [] }] })(props);
39360
39858
  }
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);
39859
+ function IoMdClose(props) {
39860
+ return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 512 512" }, "child": [{ "tag": "path", "attr": { "d": "M405 136.798L375.202 107 256 226.202 136.798 107 107 136.798 226.202 256 107 375.202 136.798 405 256 285.798 375.202 405 405 375.202 285.798 256z" }, "child": [] }] })(props);
39363
39861
  }
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,
39457
- {
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
- }
39466
- ));
39467
- }
39468
- function DropdownMenuItem({
39469
- className,
39470
- inset,
39471
- variant = "default",
39472
- ...props
39473
- }) {
39474
- return /* @__PURE__ */ React__namespace.createElement(
39475
- DropdownMenuPrimitive__namespace.Item,
39476
- {
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
- ),
39484
- ...props
39485
- }
39486
- );
39487
- }
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
39498
- }
39499
- );
39500
- }
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,
39513
- ...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,
39519
- {
39520
- variant,
39521
- size: size2,
39522
- busy,
39523
- disabled,
39524
- rounded,
39525
- className: cn$1("gap-2", className),
39526
- ...props
39527
- },
39528
- children,
39529
- /* @__PURE__ */ React__namespace.createElement(
39530
- lucideReact.ChevronDownIcon,
39531
- {
39532
- className: cn$1(
39533
- "h-4 w-4 transition-transform duration-200",
39534
- open && "rotate-180"
39535
- )
39536
- }
39537
- )
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
- },
39575
- /* @__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,
39589
- {
39590
- onClick: item.onClick,
39591
- disabled: item.disabled,
39592
- variant: item.variant
39593
- },
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
- }))));
39598
- }
39599
- );
39600
- DropdownButton.displayName = "DropdownButton";
39601
- function useCMS() {
39602
- return useCMS$1();
39603
- }
39604
- const supportedFileTypes = [
39605
- "text/*",
39606
- "application/pdf",
39607
- "application/octet-stream",
39608
- "application/json",
39609
- "application/ld+json",
39610
- "application/vnd.ms-excel",
39611
- "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
39612
- "application/msword",
39613
- "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
39614
- "application/postscript",
39615
- "model/fbx",
39616
- "model/gltf+json",
39617
- "model/ply",
39618
- "model/u3d+mesh",
39619
- "model/vnd.usdz+zip",
39620
- "application/x-indesign",
39621
- "application/vnd.apple.mpegurl",
39622
- "application/dash+xml",
39623
- "application/mxf",
39624
- "image/*",
39625
- "video/*"
39626
- ];
39627
- const DEFAULT_MEDIA_UPLOAD_TYPES = supportedFileTypes.join(",");
39628
- const dropzoneAcceptFromString = (str) => {
39629
- return Object.assign(
39630
- {},
39631
- ...(str || DEFAULT_MEDIA_UPLOAD_TYPES).split(",").map((x) => ({ [x]: [] }))
39632
- );
39633
- };
39634
- const isImage = (filename) => {
39635
- return /\.(gif|jpg|jpeg|tiff|png|svg|webp|avif)(\?.*)?$/i.test(filename);
39636
- };
39637
- const isVideo = (filename) => {
39638
- return /\.(mp4|webm|ogg|m4v|mov|avi|flv|mkv)(\?.*)?$/i.test(filename);
39639
- };
39640
- const absoluteImgURL = (str) => {
39641
- if (str.startsWith("http"))
39642
- return str;
39643
- return `${window.location.origin}${str}`;
39644
- };
39645
- const { useDropzone: useDropzone$1 } = dropzone__namespace;
39646
- const StyledImage = ({ src }) => {
39647
- const isSvg = /\.svg$/.test(src);
39648
- return /* @__PURE__ */ React__namespace.createElement(
39649
- "img",
39650
- {
39651
- src,
39652
- className: `block max-w-full rounded shadow overflow-hidden max-h-48 lg:max-h-64 h-auto object-contain transition-opacity duration-100 ease-out m-0 bg-gray-200 bg-auto bg-center bg-no-repeat ${isSvg ? "min-w-[12rem]" : ""}`
39653
- }
39654
- );
39655
- };
39656
- const StyledFile = ({ src }) => {
39657
- return /* @__PURE__ */ React__namespace.createElement("div", { className: "max-w-full w-full flex-1 flex justify-start items-center gap-3" }, /* @__PURE__ */ React__namespace.createElement("div", { className: "w-12 h-12 bg-white shadow border border-gray-100 rounded flex justify-center flex-none" }, /* @__PURE__ */ React__namespace.createElement(BiFileBlank, { className: "w-3/5 h-full fill-gray-300" })), /* @__PURE__ */ React__namespace.createElement("span", { className: "text-base text-left flex-1 text-gray-500 w-full break-words truncate" }, src));
39658
- };
39659
- const ImageUpload = React__namespace.forwardRef(({ onDrop, onClear, onClick, value, src, loading }, ref) => {
39660
- const cms = useCMS();
39661
- const { getRootProps, getInputProps } = useDropzone$1({
39662
- accept: dropzoneAcceptFromString(
39663
- cms.media.accept || DEFAULT_MEDIA_UPLOAD_TYPES
39664
- ),
39665
- onDrop,
39666
- noClick: !!onClick
39667
- });
39668
- return /* @__PURE__ */ React__namespace.createElement("div", { className: "w-full max-w-full", ...getRootProps() }, /* @__PURE__ */ React__namespace.createElement("input", { ...getInputProps() }), value ? loading ? /* @__PURE__ */ React__namespace.createElement(ImageLoadingIndicator, null) : /* @__PURE__ */ React__namespace.createElement(
39669
- "div",
39670
- {
39671
- className: `relative w-full max-w-full flex justify-start ${isImage(src) ? `items-start gap-3` : `items-center gap-2`}`
39672
- },
39673
- /* @__PURE__ */ React__namespace.createElement(
39674
- "button",
39675
- {
39676
- className: "flex-shrink min-w-0 focus-within:shadow-outline focus-within:border-blue-500 rounded outline-none overflow-visible cursor-pointer border-none hover:opacity-60 transition ease-out duration-100",
39677
- onClick,
39678
- ref
39679
- },
39680
- isImage(src) ? /* @__PURE__ */ React__namespace.createElement(StyledImage, { src }) : /* @__PURE__ */ React__namespace.createElement(StyledFile, { src })
39681
- ),
39682
- onClear && /* @__PURE__ */ React__namespace.createElement(
39683
- DeleteImageButton,
39684
- {
39685
- onClick: (e3) => {
39686
- e3.stopPropagation();
39687
- onClear();
39688
- }
39689
- }
39690
- )
39691
- ) : /* @__PURE__ */ React__namespace.createElement(
39692
- "button",
39693
- {
39694
- className: "outline-none relative hover:opacity-60 w-full",
39695
- onClick
39696
- },
39697
- loading ? /* @__PURE__ */ React__namespace.createElement(ImageLoadingIndicator, null) : /* @__PURE__ */ React__namespace.createElement("div", { className: "text-center rounded-[5px] bg-gray-100 text-gray-300 leading-[1.35] py-3 text-[15px] font-normal transition-all ease-out duration-100 hover:opacity-60" }, "Drag 'n' drop a file here,", /* @__PURE__ */ React__namespace.createElement("br", null), "or click to select a file")
39698
- ));
39699
- });
39700
- const DeleteImageButton = ({
39701
- onClick
39702
- }) => {
39703
- return /* @__PURE__ */ React__namespace.createElement(IconButton, { variant: "white", className: "flex-none", onClick }, /* @__PURE__ */ React__namespace.createElement(TrashIcon, { className: "w-7 h-auto caret-transparent" }));
39704
- };
39705
- const ImageLoadingIndicator = () => /* @__PURE__ */ React__namespace.createElement("div", { className: "p-4 w-full min-h-[96px] flex flex-col justify-center items-center" }, /* @__PURE__ */ React__namespace.createElement(LoadingDots, null));
39706
- function IoMdArrowDropdown(props) {
39707
- return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 512 512" }, "child": [{ "tag": "path", "attr": { "d": "M128 192l128 128 128-128z" }, "child": [] }] })(props);
39708
- }
39709
- function IoMdArrowDropup(props) {
39710
- return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 512 512" }, "child": [{ "tag": "path", "attr": { "d": "M128 320l128-128 128 128z" }, "child": [] }] })(props);
39711
- }
39712
- function IoMdClose(props) {
39713
- return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 512 512" }, "child": [{ "tag": "path", "attr": { "d": "M405 136.798L375.202 107 256 226.202 136.798 107 107 136.798 226.202 256 107 375.202 136.798 405 256 285.798 375.202 405 405 375.202 285.798 256z" }, "child": [] }] })(props);
39714
- }
39715
- function IoMdRefresh(props) {
39716
- return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 512 512" }, "child": [{ "tag": "path", "attr": { "d": "M256 388c-72.597 0-132-59.405-132-132 0-72.601 59.403-132 132-132 36.3 0 69.299 15.4 92.406 39.601L278 234h154V80l-51.698 51.702C348.406 99.798 304.406 80 256 80c-96.797 0-176 79.203-176 176s78.094 176 176 176c81.045 0 148.287-54.134 169.401-128H378.85c-18.745 49.561-67.138 84-122.85 84z" }, "child": [] }] })(props);
39717
- }
39718
- const buttonVariants = classVarianceAuthority.cva(
39719
- "inline-flex items-center justify-center whitespace-nowrap rounded text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
39720
- {
39721
- variants: {
39722
- variant: {
39723
- outline: "border border-gray-200 bg-white hover:bg-white hover:text-accent-foreground"
39724
- },
39725
- size: {
39726
- default: "h-10 px-4 py-2",
39727
- sm: "h-9 rounded px-3",
39728
- lg: "h-11 rounded px-8",
39729
- icon: "h-10 w-10"
39862
+ function IoMdRefresh(props) {
39863
+ return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 512 512" }, "child": [{ "tag": "path", "attr": { "d": "M256 388c-72.597 0-132-59.405-132-132 0-72.601 59.403-132 132-132 36.3 0 69.299 15.4 92.406 39.601L278 234h154V80l-51.698 51.702C348.406 99.798 304.406 80 256 80c-96.797 0-176 79.203-176 176s78.094 176 176 176c81.045 0 148.287-54.134 169.401-128H378.85c-18.745 49.561-67.138 84-122.85 84z" }, "child": [] }] })(props);
39864
+ }
39865
+ const buttonVariants = classVarianceAuthority.cva(
39866
+ "inline-flex items-center justify-center whitespace-nowrap rounded text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
39867
+ {
39868
+ variants: {
39869
+ variant: {
39870
+ outline: "border border-gray-200 bg-white hover:bg-white hover:text-accent-foreground"
39871
+ },
39872
+ size: {
39873
+ default: "h-10 px-4 py-2",
39874
+ sm: "h-9 rounded px-3",
39875
+ lg: "h-11 rounded px-8",
39876
+ icon: "h-10 w-10"
39730
39877
  }
39731
39878
  },
39732
39879
  defaultVariants: {
@@ -42706,30 +42853,6 @@ Please wrap them with useCallback or configure the deps array correctly.`
42706
42853
  },
42707
42854
  parse: parse$2
42708
42855
  };
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
42856
  function GrCircleQuestion(props) {
42734
42857
  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
42858
  }
@@ -45430,7 +45553,7 @@ Please wrap them with useCallback or configure the deps array correctly.`
45430
45553
  className = "",
45431
45554
  ...props
45432
45555
  }) => {
45433
- const commonAlertStyles = "ml-8 text-sm px-4 py-3 rounded-md border";
45556
+ const commonAlertStyles = "text-sm px-4 py-3 rounded-md border";
45434
45557
  const styles = {
45435
45558
  warning: `text-amber-700 bg-amber-100 border-amber-700/20`,
45436
45559
  info: `text-blue-600 bg-blue-100/50 border-blue-600/20`,
@@ -46202,7 +46325,7 @@ Please wrap them with useCallback or configure the deps array correctly.`
46202
46325
  requiredArgs(1, arguments);
46203
46326
  return formatDistance(dirtyDate, Date.now(), options);
46204
46327
  }
46205
- const version$1 = "2.9.3";
46328
+ const version$1 = "2.9.5";
46206
46329
  const VersionInfo = () => {
46207
46330
  var _a2, _b, _c, _d, _e, _f;
46208
46331
  const cms = useCMS();
@@ -47842,7 +47965,7 @@ Please wrap them with useCallback or configure the deps array correctly.`
47842
47965
  if (!alerts.all.length) {
47843
47966
  return null;
47844
47967
  }
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) => {
47968
+ 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
47969
  return alert.level !== "error";
47847
47970
  }).map((alert) => {
47848
47971
  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 +48009,10 @@ Please wrap them with useCallback or configure the deps array correctly.`
47886
48009
  ...props
47887
48010
  }) => {
47888
48011
  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"
48012
+ info: "bg-white border-blue-500 text-blue-600 fill-blue-500",
48013
+ success: "bg-white border-green-500 text-green-600 fill-green-500",
48014
+ warn: "bg-white border-yellow-500 text-yellow-600 fill-yellow-500",
48015
+ error: "bg-white border-red-500 text-red-600 fill-red-500"
47893
48016
  };
47894
48017
  const borderClasses = {
47895
48018
  info: "border-blue-200",
@@ -47912,7 +48035,7 @@ Please wrap them with useCallback or configure the deps array correctly.`
47912
48035
  /* @__PURE__ */ React.createElement(
47913
48036
  "div",
47914
48037
  {
47915
- className: `flex items-center gap-1.5 min-w-[350px] rounded-md border p-2 ${borderClasses[level]}`,
48038
+ className: `flex items-center gap-1.5 w-[350px] rounded-md border p-2 ${borderClasses[level]}`,
47916
48039
  ...props
47917
48040
  }
47918
48041
  )
@@ -47924,7 +48047,7 @@ Please wrap them with useCallback or configure the deps array correctly.`
47924
48047
  className: "border-none bg-transparent p-0 outline-none flex items-center",
47925
48048
  ...styleProps
47926
48049
  },
47927
- /* @__PURE__ */ React.createElement(BiX, { className: "w-5 auto flex-grow-0 flex-shrink-0" })
48050
+ /* @__PURE__ */ React.createElement(BiX, { className: "w-5 auto flex-grow-0 flex-shrink-0 text-gray-700" })
47928
48051
  );
47929
48052
  function CursorPaginator({
47930
48053
  navigateNext,
@@ -48221,6 +48344,18 @@ Please wrap them with useCallback or configure the deps array correctly.`
48221
48344
  /* @__PURE__ */ React__namespace.createElement(BiLinkExternal, { className: "h-5 w-auto" })
48222
48345
  );
48223
48346
  };
48347
+ const EDITORIAL_WORKFLOW_STATUS = {
48348
+ QUEUED: "queued",
48349
+ PROCESSING: "processing",
48350
+ SETTING_UP: "setting_up",
48351
+ CREATING_BRANCH: "creating_branch",
48352
+ INDEXING: "indexing",
48353
+ CONTENT_GENERATION: "content_generation",
48354
+ CREATING_PR: "creating_pr",
48355
+ COMPLETE: "complete",
48356
+ ERROR: "error",
48357
+ TIMEOUT: "timeout"
48358
+ };
48224
48359
  const num123 = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"];
48225
48360
  const numFas = ["۱", "۲", "۳", "۴", "۵", "۶", "۷", "۸", "۹", "۰"];
48226
48361
  const numKor = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"];
@@ -63634,367 +63769,6 @@ mutation DeleteDocument($collection: String!, $relativePath: String!){
63634
63769
  );
63635
63770
  }
63636
63771
  }
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
63772
  const pathRelativeToCollection = (collectionPath, fullPath) => {
63999
63773
  const normalizedCollectionPath = collectionPath.replace(/\\/g, "/");
64000
63774
  const normalizedFullPath = fullPath.replace(/\\/g, "/");
@@ -64023,7 +63797,6 @@ mutation DeleteDocument($collection: String!, $relativePath: String!){
64023
63797
  const [isExecuting, setIsExecuting] = React__namespace.useState(false);
64024
63798
  const [errorMessage, setErrorMessage] = React__namespace.useState("");
64025
63799
  const [currentStep, setCurrentStep] = React__namespace.useState(0);
64026
- const [statusMessage, setStatusMessage] = React__namespace.useState("");
64027
63800
  const [elapsedTime, setElapsedTime] = React__namespace.useState(0);
64028
63801
  React__namespace.useEffect(() => {
64029
63802
  let interval;
@@ -64067,7 +63840,6 @@ mutation DeleteDocument($collection: String!, $relativePath: String!){
64067
63840
  setDisabled(true);
64068
63841
  setIsExecuting(true);
64069
63842
  setCurrentStep(1);
64070
- setStatusMessage("Initializing workflow...");
64071
63843
  let graphql2 = "";
64072
63844
  if (crudType === "create") {
64073
63845
  graphql2 = CREATE_DOCUMENT_GQL;
@@ -64092,8 +63864,6 @@ mutation DeleteDocument($collection: String!, $relativePath: String!){
64092
63864
  }
64093
63865
  },
64094
63866
  onStatusUpdate: (status) => {
64095
- const message = status.message || `Status: ${status.status}`;
64096
- setStatusMessage(message);
64097
63867
  switch (status.status) {
64098
63868
  case EDITORIAL_WORKFLOW_STATUS.SETTING_UP:
64099
63869
  case EDITORIAL_WORKFLOW_STATUS.CREATING_BRANCH:
@@ -64130,9 +63900,7 @@ mutation DeleteDocument($collection: String!, $relativePath: String!){
64130
63900
  }
64131
63901
  };
64132
63902
  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(
63903
+ 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
63904
  "div",
64137
63905
  {
64138
63906
  className: "absolute top-5 h-0.5 bg-gray-200 -z-10",
@@ -64141,7 +63909,7 @@ mutation DeleteDocument($collection: String!, $relativePath: String!){
64141
63909
  ), currentStep > 1 && currentStep <= steps.length && /* @__PURE__ */ React__namespace.createElement(
64142
63910
  "div",
64143
63911
  {
64144
- className: "absolute top-5 h-0.5 bg-blue-500 -z-10 transition-all duration-500",
63912
+ className: "absolute top-5 h-0.5 bg-tina-orange -z-10 transition-all duration-500",
64145
63913
  style: {
64146
63914
  left: "50px",
64147
63915
  width: `calc((100% - 100px) * ${(currentStep - 1) / (steps.length - 1)})`
@@ -64169,7 +63937,7 @@ mutation DeleteDocument($collection: String!, $relativePath: String!){
64169
63937
  /* @__PURE__ */ React__namespace.createElement(
64170
63938
  "div",
64171
63939
  {
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"}`
63940
+ 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
63941
  },
64174
63942
  isCompleted ? /* @__PURE__ */ React__namespace.createElement(
64175
63943
  "svg",
@@ -64190,7 +63958,7 @@ mutation DeleteDocument($collection: String!, $relativePath: String!){
64190
63958
  ),
64191
63959
  /* @__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
63960
  );
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(
63961
+ })), /* @__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
63962
  "path",
64195
63963
  {
64196
63964
  fillRule: "evenodd",
@@ -64198,34 +63966,20 @@ mutation DeleteDocument($collection: String!, $relativePath: String!){
64198
63966
  clipRule: "evenodd"
64199
63967
  }
64200
63968
  )), 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",
63969
+ "a",
64209
63970
  {
64210
- className: "w-4 h-4 text-green-500",
64211
- fill: "currentColor",
64212
- viewBox: "0 0 20 20"
63971
+ className: "underline text-tina-orange-dark font-medium text-xs",
63972
+ href: "https://tina.io/docs/tinacloud/editorial-workflow",
63973
+ target: "_blank"
64213
63974
  },
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")));
63975
+ "Learn more about Editorial Workflow"
63976
+ ));
64223
63977
  };
64224
63978
  const renderStateContent = () => {
64225
63979
  if (isExecuting) {
64226
63980
  return renderProgressIndicator();
64227
63981
  } else {
64228
- return /* @__PURE__ */ React__namespace.createElement("div", { className: "max-w-sm" }, errorMessage && /* @__PURE__ */ React__namespace.createElement("div", { className: "flex items-center gap-1 text-red-700 py-2 px-3 mb-4 bg-red-50 border border-red-200 rounded" }, /* @__PURE__ */ React__namespace.createElement(BiError, { className: "w-5 h-auto text-red-400 flex-shrink-0" }), /* @__PURE__ */ React__namespace.createElement("span", { className: "text-sm" }, /* @__PURE__ */ React__namespace.createElement("b", null, "Error:"), " ", errorMessage)), /* @__PURE__ */ React__namespace.createElement("p", { className: "text-lg text-gray-700 font-bold mb-2" }, "First, let's create a copy"), /* @__PURE__ */ React__namespace.createElement("p", { className: "text-sm text-gray-700 mb-4 max-w-sm" }, "To make changes, create a copy then get it approved and merged for it to go live.", " ", /* @__PURE__ */ React__namespace.createElement(
63982
+ return /* @__PURE__ */ React__namespace.createElement("div", { className: "max-w-sm" }, errorMessage && /* @__PURE__ */ React__namespace.createElement("div", { className: "flex items-center gap-1 text-red-700 py-2 px-3 mb-4 bg-red-50 border border-red-200 rounded" }, /* @__PURE__ */ React__namespace.createElement(BiError, { className: "w-5 h-auto text-red-400 flex-shrink-0" }), /* @__PURE__ */ React__namespace.createElement("span", { className: "text-sm" }, /* @__PURE__ */ React__namespace.createElement("b", null, "Error:"), " ", errorMessage)), /* @__PURE__ */ React__namespace.createElement("p", { className: "text-lg text-gray-700 font-bold mb-2" }, "First, let's create a copy"), /* @__PURE__ */ React__namespace.createElement("p", { className: "text-sm text-gray-700 mb-4 max-w-sm" }, "To make changes, you need to create a copy then get it approved and merged for it to go live.", /* @__PURE__ */ React__namespace.createElement("br", null), /* @__PURE__ */ React__namespace.createElement("br", null), /* @__PURE__ */ React__namespace.createElement("span", { className: "text-gray-500" }, "Learn more about "), /* @__PURE__ */ React__namespace.createElement(
64229
63983
  "a",
64230
63984
  {
64231
63985
  className: "underline text-tina-orange-dark font-medium",
@@ -64233,7 +63987,7 @@ mutation DeleteDocument($collection: String!, $relativePath: String!){
64233
63987
  target: "_blank"
64234
63988
  },
64235
63989
  "Editorial Workflow"
64236
- )), /* @__PURE__ */ React__namespace.createElement(
63990
+ ), "."), /* @__PURE__ */ React__namespace.createElement(
64237
63991
  PrefixedTextField,
64238
63992
  {
64239
63993
  name: "new-branch-name",
@@ -64242,7 +63996,6 @@ mutation DeleteDocument($collection: String!, $relativePath: String!){
64242
63996
  value: newBranchName,
64243
63997
  onChange: (e3) => {
64244
63998
  setErrorMessage("");
64245
- setStatusMessage("");
64246
63999
  setNewBranchName(e3.target.value);
64247
64000
  }
64248
64001
  }
@@ -64293,6 +64046,217 @@ mutation DeleteDocument($collection: String!, $relativePath: String!){
64293
64046
  }
64294
64047
  )));
64295
64048
  };
64049
+ const NoFieldsPlaceholder = () => /* @__PURE__ */ React__namespace.createElement(
64050
+ "div",
64051
+ {
64052
+ className: "relative flex flex-col items-center justify-center text-center p-5 pb-16 w-full h-full overflow-y-auto",
64053
+ style: {
64054
+ animationName: "fade-in",
64055
+ animationDelay: "300ms",
64056
+ animationTimingFunction: "ease-out",
64057
+ animationIterationCount: 1,
64058
+ animationFillMode: "both",
64059
+ animationDuration: "150ms"
64060
+ }
64061
+ },
64062
+ /* @__PURE__ */ React__namespace.createElement(Emoji, { className: "block pb-5" }, "🤔"),
64063
+ /* @__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."),
64064
+ /* @__PURE__ */ React__namespace.createElement("p", { className: "block pb-5" }, /* @__PURE__ */ React__namespace.createElement(
64065
+ "a",
64066
+ {
64067
+ 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",
64068
+ href: "https://tinacms.org/docs/fields",
64069
+ target: "_blank",
64070
+ rel: "noopener noreferrer"
64071
+ },
64072
+ /* @__PURE__ */ React__namespace.createElement(
64073
+ Emoji,
64074
+ {
64075
+ className: "absolute left-5 top-1/2 origin-center -translate-y-1/2 transition-all duration-100 ease-out",
64076
+ style: { fontSize: 24 }
64077
+ },
64078
+ "📖"
64079
+ ),
64080
+ " ",
64081
+ "Field Setup Guide"
64082
+ ))
64083
+ );
64084
+ const FormKeyBindings = ({ onSubmit }) => {
64085
+ React.useEffect(() => {
64086
+ const handleKeyDown = (e3) => {
64087
+ if ((e3.metaKey || e3.ctrlKey) && e3.key === "s") {
64088
+ e3.preventDefault();
64089
+ onSubmit();
64090
+ }
64091
+ };
64092
+ window.addEventListener("keydown", handleKeyDown);
64093
+ return () => window.removeEventListener("keydown", handleKeyDown);
64094
+ }, [onSubmit]);
64095
+ return null;
64096
+ };
64097
+ const FormBuilder = ({
64098
+ form,
64099
+ onPristineChange,
64100
+ ...rest
64101
+ }) => {
64102
+ const cms = useCMS$1();
64103
+ const hideFooter = !!rest.hideFooter;
64104
+ const [createBranchModalOpen, setCreateBranchModalOpen] = React__namespace.useState(false);
64105
+ const tinaForm = form.tinaForm;
64106
+ const finalForm2 = form.tinaForm.finalForm;
64107
+ React__namespace.useEffect(() => {
64108
+ var _a2;
64109
+ const collection = cms.api.tina.schema.getCollectionByFullPath(
64110
+ tinaForm.path
64111
+ );
64112
+ if ((_a2 = collection == null ? void 0 : collection.ui) == null ? void 0 : _a2.beforeSubmit) {
64113
+ tinaForm.beforeSubmit = (values) => collection.ui.beforeSubmit({ cms, form: tinaForm, values });
64114
+ } else {
64115
+ tinaForm.beforeSubmit = void 0;
64116
+ }
64117
+ }, [tinaForm.path]);
64118
+ const moveArrayItem = React__namespace.useCallback(
64119
+ (result) => {
64120
+ if (!result.destination || !finalForm2)
64121
+ return;
64122
+ const name = result.type;
64123
+ finalForm2.mutators.move(
64124
+ name,
64125
+ result.source.index,
64126
+ result.destination.index
64127
+ );
64128
+ },
64129
+ [tinaForm]
64130
+ );
64131
+ React__namespace.useEffect(() => {
64132
+ const unsubscribe = finalForm2.subscribe(
64133
+ ({ pristine }) => {
64134
+ if (onPristineChange) {
64135
+ onPristineChange(pristine);
64136
+ }
64137
+ },
64138
+ { pristine: true }
64139
+ );
64140
+ return () => {
64141
+ unsubscribe();
64142
+ };
64143
+ }, [finalForm2]);
64144
+ const fieldGroup = tinaForm.getActiveField(form.activeFieldName);
64145
+ return /* @__PURE__ */ React__namespace.createElement(
64146
+ reactFinalForm.Form,
64147
+ {
64148
+ key: tinaForm.id,
64149
+ form: tinaForm.finalForm,
64150
+ onSubmit: tinaForm.onSubmit
64151
+ },
64152
+ ({
64153
+ handleSubmit,
64154
+ pristine,
64155
+ invalid,
64156
+ submitting,
64157
+ dirtySinceLastSubmit,
64158
+ hasValidationErrors
64159
+ }) => {
64160
+ const usingProtectedBranch = cms.api.tina.usingProtectedBranch();
64161
+ const canSubmit = !pristine && !submitting && !hasValidationErrors && !(invalid && !dirtySinceLastSubmit);
64162
+ const safeSubmit = async () => {
64163
+ if (canSubmit) {
64164
+ await handleSubmit();
64165
+ }
64166
+ };
64167
+ const safeHandleSubmit = async () => {
64168
+ if (usingProtectedBranch) {
64169
+ setCreateBranchModalOpen(true);
64170
+ } else {
64171
+ safeSubmit();
64172
+ }
64173
+ };
64174
+ return /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, createBranchModalOpen && /* @__PURE__ */ React__namespace.createElement(
64175
+ CreateBranchModal,
64176
+ {
64177
+ safeSubmit,
64178
+ crudType: tinaForm.crudType,
64179
+ path: tinaForm.path,
64180
+ values: tinaForm.values,
64181
+ close: () => setCreateBranchModalOpen(false)
64182
+ }
64183
+ ), /* @__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(
64184
+ FieldsBuilder,
64185
+ {
64186
+ form: tinaForm,
64187
+ activeFieldName: form.activeFieldName,
64188
+ fields: fieldGroup.fields
64189
+ }
64190
+ ) : /* @__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(
64191
+ ResetForm,
64192
+ {
64193
+ pristine,
64194
+ reset: async () => {
64195
+ finalForm2.reset();
64196
+ await tinaForm.reset();
64197
+ }
64198
+ },
64199
+ tinaForm.buttons.reset
64200
+ ), /* @__PURE__ */ React__namespace.createElement(
64201
+ Button$1,
64202
+ {
64203
+ onClick: safeHandleSubmit,
64204
+ disabled: !canSubmit,
64205
+ busy: submitting,
64206
+ variant: "primary"
64207
+ },
64208
+ submitting && /* @__PURE__ */ React__namespace.createElement(LoadingDots, null),
64209
+ !submitting && tinaForm.buttons.save
64210
+ ), tinaForm.actions.length > 0 && /* @__PURE__ */ React__namespace.createElement(
64211
+ FormActionMenu,
64212
+ {
64213
+ form: tinaForm,
64214
+ actions: tinaForm.actions
64215
+ }
64216
+ )))));
64217
+ }
64218
+ );
64219
+ };
64220
+ const FormStatus = ({ pristine }) => {
64221
+ const pristineClass = pristine ? "text-green-500" : "text-red-500";
64222
+ return /* @__PURE__ */ React__namespace.createElement(FaCircle, { className: cn("h-3", pristineClass) });
64223
+ };
64224
+ const FormWrapper = ({
64225
+ id: id2,
64226
+ children
64227
+ }) => {
64228
+ return /* @__PURE__ */ React__namespace.createElement(
64229
+ "div",
64230
+ {
64231
+ "data-test": `form:${id2 == null ? void 0 : id2.replace(/\\/g, "/")}`,
64232
+ className: "h-full overflow-y-auto max-h-full bg-gray-50"
64233
+ },
64234
+ /* @__PURE__ */ React__namespace.createElement("div", { className: "py-5 px-6" }, children)
64235
+ );
64236
+ };
64237
+ const Emoji = ({ className = "", ...props }) => /* @__PURE__ */ React__namespace.createElement(
64238
+ "span",
64239
+ {
64240
+ className: `text-[40px] leading-none inline-block ${className}`,
64241
+ ...props
64242
+ }
64243
+ );
64244
+ const CreateBranchModel = ({
64245
+ close: close2,
64246
+ safeSubmit,
64247
+ relativePath: relativePath2,
64248
+ values,
64249
+ crudType
64250
+ }) => /* @__PURE__ */ React__namespace.createElement(
64251
+ CreateBranchModal,
64252
+ {
64253
+ close: close2,
64254
+ safeSubmit,
64255
+ path: relativePath2,
64256
+ values,
64257
+ crudType
64258
+ }
64259
+ );
64296
64260
  const NestedForm = (props) => {
64297
64261
  const FormPortal = useFormPortal();
64298
64262
  const id2 = React.useMemo(() => uuid(), [props.id, props.initialValues]);
@@ -121039,7 +121003,7 @@ This will work when developing locally but NOT when deployed to production.
121039
121003
  },
121040
121004
  close: () => setFolderModalOpen(false)
121041
121005
  }
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(
121006
+ ), /* @__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 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(
121043
121007
  "label",
121044
121008
  {
121045
121009
  htmlFor: "sort",