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.mjs CHANGED
@@ -39,10 +39,10 @@ import arrayMutators from "final-form-arrays";
39
39
  import setFieldData from "final-form-set-field-data";
40
40
  import { Field, Form as Form$1 } from "react-final-form";
41
41
  import PropTypes from "prop-types";
42
- import * as pkg$1 from "react-color";
43
- import * as pkg from "color-string";
44
42
  import { twMerge } from "tailwind-merge";
45
43
  import { Droppable, Draggable, DragDropContext } from "react-beautiful-dnd";
44
+ import * as pkg$1 from "react-color";
45
+ import * as pkg from "color-string";
46
46
  import { buildSchema, print, getIntrospectionQuery, buildClientSchema, parse as parse$4 } from "graphql";
47
47
  import { diff as diff$1 } from "@graphql-inspector/core";
48
48
  import * as dropzone from "react-dropzone";
@@ -38335,6 +38335,171 @@ TinaField.propTypes = {
38335
38335
  Component: PropTypes.any.isRequired,
38336
38336
  children: PropTypes.any
38337
38337
  };
38338
+ function cn$1(...inputs) {
38339
+ return twMerge(clsx(inputs));
38340
+ }
38341
+ const Button$1 = ({
38342
+ variant = "secondary",
38343
+ as: Tag2 = "button",
38344
+ size: size2 = "medium",
38345
+ busy,
38346
+ disabled,
38347
+ rounded = "full",
38348
+ children,
38349
+ className = "",
38350
+ ...props
38351
+ }) => {
38352
+ 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 ";
38353
+ const variantClasses = {
38354
+ primary: `shadow text-white bg-tina-orange-dark hover:bg-tina-orange focus:ring-tina-orange-dark border-0`,
38355
+ secondary: `shadow text-gray-500 hover:tina-orange-dark bg-gray-50 hover:bg-white border border-gray-100`,
38356
+ white: `shadow text-gray-500 hover:tina-orange-dark bg-white hover:bg-gray-50 border border-gray-100`,
38357
+ ghost: `text-gray-500 hover:tina-orange-dark hover:shadow border border-transparent border-0 hover:border hover:border-gray-200 bg-transparent`,
38358
+ danger: `shadow text-white bg-red-500 hover:bg-red-600 focus:ring-red-500`,
38359
+ accent: `shadow text-white bg-orange-500 hover:bg-orange-600 focus:ring-orange-500`,
38360
+ custom: ""
38361
+ };
38362
+ const state = busy ? `busy` : disabled ? `disabled` : `default`;
38363
+ const stateClasses = {
38364
+ disabled: `pointer-events-none opacity-30 cursor-not-allowed`,
38365
+ busy: `pointer-events-none opacity-70 cursor-wait`,
38366
+ default: ``
38367
+ };
38368
+ const roundedClasses = {
38369
+ full: `rounded`,
38370
+ left: `rounded-l`,
38371
+ right: `rounded-r`,
38372
+ custom: "",
38373
+ none: ""
38374
+ };
38375
+ const sizeClasses = {
38376
+ small: `text-xs h-8 px-3`,
38377
+ medium: `text-sm h-10 px-8`,
38378
+ custom: ``
38379
+ };
38380
+ return /* @__PURE__ */ React.createElement(
38381
+ Tag2,
38382
+ {
38383
+ className: cn$1(
38384
+ baseClasses,
38385
+ variantClasses[variant],
38386
+ sizeClasses[size2],
38387
+ stateClasses[state],
38388
+ roundedClasses[rounded],
38389
+ className
38390
+ ),
38391
+ ...props
38392
+ },
38393
+ children
38394
+ );
38395
+ };
38396
+ const IconButton = ({
38397
+ variant = "secondary",
38398
+ size: size2 = "medium",
38399
+ busy,
38400
+ disabled,
38401
+ children,
38402
+ className,
38403
+ ...props
38404
+ }) => {
38405
+ 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";
38406
+ const variantClasses = {
38407
+ primary: `shadow text-white bg-tina-orange-dark hover:bg-tina-orange focus:ring-tina-orange-dark`,
38408
+ secondary: `shadow text-gray-500 hover:text-blue-500 bg-gray-50 hover:bg-white border border-gray-200`,
38409
+ white: `shadow text-gray-500 hover:text-blue-500 bg-white hover:bg-gray-50 border border-gray-200`,
38410
+ ghost: `text-gray-500 hover:text-blue-500 hover:shadow border border-transparent hover:border-gray-200 bg-transparent`,
38411
+ accent: `shadow text-white bg-orange-500 hover:bg-orange-600 focus:ring-orange-500`
38412
+ };
38413
+ const state = busy ? `busy` : disabled ? `disabled` : `default`;
38414
+ const stateClasses = {
38415
+ disabled: `pointer-events-none opacity-30 cursor-not-allowed`,
38416
+ busy: `pointer-events-none opacity-70 cursor-wait`,
38417
+ default: ``
38418
+ };
38419
+ const sizeClasses = {
38420
+ small: `h-7 w-7`,
38421
+ medium: `h-9 w-9`,
38422
+ custom: ``
38423
+ };
38424
+ return /* @__PURE__ */ React.createElement(
38425
+ "button",
38426
+ {
38427
+ className: cn$1(
38428
+ baseClasses,
38429
+ variantClasses[variant],
38430
+ sizeClasses[size2],
38431
+ stateClasses[state],
38432
+ className
38433
+ ),
38434
+ ...props
38435
+ },
38436
+ children
38437
+ );
38438
+ };
38439
+ function FontLoader() {
38440
+ React.useEffect(() => {
38441
+ const link = document.createElement("link");
38442
+ link.href = "https://fonts.googleapis.com/css2?family=Inter:wght@400;600&family=Libre+Baskerville:wght@400;500;600;700&display=swap";
38443
+ link.rel = "stylesheet";
38444
+ document.head.appendChild(link);
38445
+ return () => {
38446
+ document.head.removeChild(link);
38447
+ };
38448
+ }, []);
38449
+ return null;
38450
+ }
38451
+ function classNames(...classes) {
38452
+ return classes.filter(Boolean).join(" ");
38453
+ }
38454
+ const OverflowMenu$1 = ({ toolbarItems: toolbarItems2, className = "w-full" }) => {
38455
+ const [open, setOpen] = useState(false);
38456
+ return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, toolbarItems2.length > 0 && /* @__PURE__ */ React__default.createElement(PopoverPrimitive.Root, { open, onOpenChange: setOpen }, /* @__PURE__ */ React__default.createElement(
38457
+ PopoverPrimitive.Trigger,
38458
+ {
38459
+ 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}}`
38460
+ },
38461
+ /* @__PURE__ */ React__default.createElement(
38462
+ "svg",
38463
+ {
38464
+ xmlns: "http://www.w3.org/2000/svg",
38465
+ className: "h-5 w-5",
38466
+ fill: "none",
38467
+ viewBox: "0 0 24 24",
38468
+ stroke: "currentColor"
38469
+ },
38470
+ /* @__PURE__ */ React__default.createElement(
38471
+ "path",
38472
+ {
38473
+ strokeLinecap: "round",
38474
+ strokeLinejoin: "round",
38475
+ strokeWidth: 2,
38476
+ 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"
38477
+ }
38478
+ )
38479
+ )
38480
+ ), /* @__PURE__ */ React__default.createElement(PopoverPrimitive.Portal, null, /* @__PURE__ */ React__default.createElement(PopoverPrimitive.Content, { style: { zIndex: 2e4 }, align: "end" }, /* @__PURE__ */ React__default.createElement("div", { className: "mt-0 -mr-1 rounded shadow-lg bg-white ring-1 ring-black ring-opacity-5 py-1" }, toolbarItems2.map((toolbarItem) => {
38481
+ return /* @__PURE__ */ React__default.createElement(
38482
+ "span",
38483
+ {
38484
+ "data-test": `${toolbarItem.name}OverflowButton`,
38485
+ key: toolbarItem.name,
38486
+ onMouseDown: (event) => {
38487
+ event.preventDefault();
38488
+ toolbarItem.onMouseDown(event);
38489
+ setOpen(false);
38490
+ },
38491
+ className: classNames(
38492
+ toolbarItem.active ? "bg-gray-50 text-blue-500" : "bg-white text-gray-600",
38493
+ "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",
38494
+ toolbarItem.className ?? ""
38495
+ )
38496
+ },
38497
+ /* @__PURE__ */ React__default.createElement("div", { className: "mr-2 opacity-80" }, toolbarItem.Icon),
38498
+ " ",
38499
+ toolbarItem.label
38500
+ );
38501
+ }))))));
38502
+ };
38338
38503
  var DefaultContext = {
38339
38504
  color: void 0,
38340
38505
  size: void 0,
@@ -38576,30 +38741,270 @@ function BiTrash(props) {
38576
38741
  function BiX(props) {
38577
38742
  return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "d": "m16.192 6.344-4.243 4.242-4.242-4.242-1.414 1.414L10.535 12l-4.242 4.242 1.414 1.414 4.242-4.242 4.243 4.242 1.414-1.414L13.364 12l4.242-4.242z" }, "child": [] }] })(props);
38578
38743
  }
38579
- const textFieldClasses = "shadow-inner focus:shadow-outline focus:border-blue-500 focus:outline-none block text-base placeholder:text-gray-300 px-3 py-2 text-gray-600 w-full bg-white border border-gray-200 transition-all ease-out duration-150 focus:text-gray-900 rounded";
38580
- const disabledClasses$1 = "opacity-50 pointer-events-none cursor-not-allowed";
38581
- const BaseTextField = React.forwardRef(({ className, disabled, ...rest }, ref) => {
38744
+ function BsArrowRightShort(props) {
38745
+ 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);
38746
+ }
38747
+ function BsCheckCircleFill(props) {
38748
+ 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);
38749
+ }
38750
+ function BsExclamationOctagonFill(props) {
38751
+ 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);
38752
+ }
38753
+ const MessageIcon = ({
38754
+ type = "success",
38755
+ className = ""
38756
+ }) => {
38757
+ const icons = {
38758
+ success: BiCheckCircle,
38759
+ warning: BiError,
38760
+ error: BiError,
38761
+ info: BiInfoCircle
38762
+ };
38763
+ const Icon = icons[type];
38764
+ return /* @__PURE__ */ React__default.createElement(Icon, { className });
38765
+ };
38766
+ const Message = ({
38767
+ children,
38768
+ type = "success",
38769
+ size: size2 = "medium",
38770
+ className = "",
38771
+ link,
38772
+ linkLabel = "Learn More"
38773
+ }) => {
38774
+ const containerClasses = {
38775
+ success: "bg-gradient-to-r from-green-50 to-green-100 border-green-200",
38776
+ warning: "bg-gradient-to-r from-yellow-50 to-yellow-100 border-yellow-200",
38777
+ error: "bg-gradient-to-r from-red-50 to-red-100 border-red-200",
38778
+ info: "bg-gradient-to-r from-blue-50 to-blue-100 border-blue-100"
38779
+ };
38780
+ const textClasses = {
38781
+ success: "text-green-700",
38782
+ warning: "text-yellow-700",
38783
+ error: "text-red-700",
38784
+ info: "text-blue-700"
38785
+ };
38786
+ const iconClasses = {
38787
+ success: "text-green-400",
38788
+ warning: "text-yellow-400",
38789
+ error: "text-red-400",
38790
+ info: "text-blue-400"
38791
+ };
38792
+ const sizeClasses = {
38793
+ small: "px-3 py-1.5 text-xs",
38794
+ medium: "px-4 py-2.5 text-sm"
38795
+ };
38796
+ return /* @__PURE__ */ React__default.createElement(
38797
+ "div",
38798
+ {
38799
+ className: `rounded-lg border shadow-sm ${sizeClasses[size2]} ${containerClasses[type]} ${className}`
38800
+ },
38801
+ /* @__PURE__ */ React__default.createElement("div", { className: "flex flex-col sm:flex-row items-start sm:items-center gap-2" }, /* @__PURE__ */ React__default.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ React__default.createElement(
38802
+ MessageIcon,
38803
+ {
38804
+ type,
38805
+ className: `${size2 === "small" ? "w-5" : "w-6"} h-auto flex-shrink-0 ${iconClasses[type]}`
38806
+ }
38807
+ ), /* @__PURE__ */ React__default.createElement("div", { className: `flex-1 ${textClasses[type]}` }, children)), link && /* @__PURE__ */ React__default.createElement(
38808
+ "a",
38809
+ {
38810
+ href: link,
38811
+ target: "_blank",
38812
+ 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"
38813
+ },
38814
+ linkLabel,
38815
+ " ",
38816
+ /* @__PURE__ */ React__default.createElement(BsArrowRightShort, { className: "w-4 h-auto" })
38817
+ ))
38818
+ );
38819
+ };
38820
+ function cn(...inputs) {
38821
+ return twMerge(clsx(inputs));
38822
+ }
38823
+ function DropdownMenu({
38824
+ ...props
38825
+ }) {
38826
+ return /* @__PURE__ */ React.createElement(DropdownMenuPrimitive.Root, { "data-slot": "dropdown-menu", ...props });
38827
+ }
38828
+ function DropdownMenuTrigger({
38829
+ ...props
38830
+ }) {
38582
38831
  return /* @__PURE__ */ React.createElement(
38583
- "input",
38832
+ DropdownMenuPrimitive.Trigger,
38584
38833
  {
38585
- ref,
38586
- type: "text",
38587
- className: `${textFieldClasses} ${disabled ? disabledClasses$1 : ""} ${className}`,
38588
- ...rest
38834
+ "data-slot": "dropdown-menu-trigger",
38835
+ ...props
38589
38836
  }
38590
38837
  );
38591
- });
38592
- const TextArea = React.forwardRef(({ ...props }, ref) => {
38838
+ }
38839
+ function DropdownMenuContent({
38840
+ className,
38841
+ sideOffset = 4,
38842
+ ...props
38843
+ }) {
38844
+ return /* @__PURE__ */ React.createElement(DropdownMenuPrimitive.Portal, null, /* @__PURE__ */ React.createElement(
38845
+ DropdownMenuPrimitive.Content,
38846
+ {
38847
+ "data-slot": "dropdown-menu-content",
38848
+ sideOffset,
38849
+ className: cn(
38850
+ "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",
38851
+ className
38852
+ ),
38853
+ ...props
38854
+ }
38855
+ ));
38856
+ }
38857
+ function DropdownMenuItem({
38858
+ className,
38859
+ inset,
38860
+ variant = "default",
38861
+ ...props
38862
+ }) {
38593
38863
  return /* @__PURE__ */ React.createElement(
38594
- "textarea",
38864
+ DropdownMenuPrimitive.Item,
38595
38865
  {
38596
- ...props,
38597
- className: "shadow-inner text-base px-3 py-2 text-gray-600 resize-y focus:shadow-outline focus:border-blue-500 block w-full border border-gray-200 focus:text-gray-900 rounded",
38598
- ref,
38599
- style: { minHeight: "160px" }
38866
+ "data-slot": "dropdown-menu-item",
38867
+ "data-inset": inset,
38868
+ "data-variant": variant,
38869
+ className: cn(
38870
+ "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",
38871
+ className
38872
+ ),
38873
+ ...props
38600
38874
  }
38601
38875
  );
38602
- });
38876
+ }
38877
+ function DropdownMenuSeparator({
38878
+ className,
38879
+ ...props
38880
+ }) {
38881
+ return /* @__PURE__ */ React.createElement(
38882
+ DropdownMenuPrimitive.Separator,
38883
+ {
38884
+ "data-slot": "dropdown-menu-separator",
38885
+ className: cn("bg-border -mx-1 my-1 h-px", className),
38886
+ ...props
38887
+ }
38888
+ );
38889
+ }
38890
+ const DropdownButton = React.forwardRef(
38891
+ ({
38892
+ variant = "primary",
38893
+ size: size2 = "medium",
38894
+ busy,
38895
+ disabled,
38896
+ rounded = "full",
38897
+ children,
38898
+ className = "",
38899
+ onMainAction,
38900
+ items: items2,
38901
+ showSplitButton = true,
38902
+ ...props
38903
+ }, ref) => {
38904
+ const [open, setOpen] = React.useState(false);
38905
+ if (!onMainAction || !showSplitButton) {
38906
+ return /* @__PURE__ */ React.createElement(DropdownMenu, { open, onOpenChange: setOpen, modal: false }, /* @__PURE__ */ React.createElement(DropdownMenuTrigger, { asChild: true }, /* @__PURE__ */ React.createElement(
38907
+ Button$1,
38908
+ {
38909
+ variant,
38910
+ size: size2,
38911
+ busy,
38912
+ disabled,
38913
+ rounded,
38914
+ className: cn$1("gap-2", className),
38915
+ ...props
38916
+ },
38917
+ children,
38918
+ /* @__PURE__ */ React.createElement(
38919
+ ChevronDownIcon$1,
38920
+ {
38921
+ className: cn$1(
38922
+ "h-4 w-4 transition-transform duration-200",
38923
+ open && "rotate-180"
38924
+ )
38925
+ }
38926
+ )
38927
+ )), /* @__PURE__ */ React.createElement(DropdownMenuContent, { align: "end", side: "bottom", className: "z-[100000]" }, items2.map((item, index) => /* @__PURE__ */ React.createElement(
38928
+ DropdownMenuItem,
38929
+ {
38930
+ key: index,
38931
+ onClick: item.onClick,
38932
+ disabled: item.disabled,
38933
+ variant: item.variant
38934
+ },
38935
+ item.icon && item.icon,
38936
+ item.label
38937
+ ))));
38938
+ }
38939
+ return /* @__PURE__ */ React.createElement("div", { className: cn$1("inline-flex", className) }, /* @__PURE__ */ React.createElement(
38940
+ Button$1,
38941
+ {
38942
+ variant,
38943
+ size: size2,
38944
+ busy,
38945
+ disabled,
38946
+ rounded: "left",
38947
+ onClick: onMainAction,
38948
+ className: "border-r-0 w-full",
38949
+ ...props
38950
+ },
38951
+ children
38952
+ ), /* @__PURE__ */ React.createElement(DropdownMenu, { open, onOpenChange: setOpen }, /* @__PURE__ */ React.createElement(DropdownMenuTrigger, null, /* @__PURE__ */ React.createElement(
38953
+ Button$1,
38954
+ {
38955
+ variant,
38956
+ size: size2,
38957
+ busy,
38958
+ disabled,
38959
+ rounded: "right",
38960
+ className: "px-4 border-l",
38961
+ style: { borderColor: "#00000030" },
38962
+ "aria-label": "More options"
38963
+ },
38964
+ /* @__PURE__ */ React.createElement(
38965
+ ChevronDownIcon$1,
38966
+ {
38967
+ className: cn$1(
38968
+ "h-4 w-4 transition-transform duration-200 fill-none",
38969
+ open && "rotate-180"
38970
+ ),
38971
+ style: { fill: "none" }
38972
+ }
38973
+ )
38974
+ )), /* @__PURE__ */ React.createElement(DropdownMenuContent, { align: "end", side: "bottom" }, items2.map((item, index) => {
38975
+ var _a2;
38976
+ return /* @__PURE__ */ React.createElement(React.Fragment, { key: index }, /* @__PURE__ */ React.createElement(
38977
+ DropdownMenuItem,
38978
+ {
38979
+ onClick: item.onClick,
38980
+ disabled: item.disabled,
38981
+ variant: item.variant
38982
+ },
38983
+ item.icon && item.icon,
38984
+ item.label
38985
+ ), item.variant === "destructive" && index < items2.length - 1 && ((_a2 = items2[index + 1]) == null ? void 0 : _a2.variant) !== "destructive" && /* @__PURE__ */ React.createElement(DropdownMenuSeparator, null));
38986
+ }))));
38987
+ }
38988
+ );
38989
+ DropdownButton.displayName = "DropdownButton";
38990
+ function FaCircle(props) {
38991
+ 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);
38992
+ }
38993
+ function FaFile(props) {
38994
+ 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);
38995
+ }
38996
+ function FaFolder(props) {
38997
+ 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);
38998
+ }
38999
+ function FaLock(props) {
39000
+ 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);
39001
+ }
39002
+ function FaSpinner(props) {
39003
+ 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);
39004
+ }
39005
+ function FaUnlock(props) {
39006
+ 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);
39007
+ }
38603
39008
  const Dismissible = ({
38604
39009
  onDismiss,
38605
39010
  escape: escape2,
@@ -38672,6 +39077,159 @@ function useDismissible({
38672
39077
  }, [click, customDocument, escape2, disabled, onDismiss]);
38673
39078
  return area;
38674
39079
  }
39080
+ const FormActionMenu = ({ actions, form }) => {
39081
+ const [actionMenuVisibility, setActionMenuVisibility] = useState(false);
39082
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(MoreActionsButton, { onClick: () => setActionMenuVisibility((p2) => !p2) }), /* @__PURE__ */ React.createElement(ActionsOverlay, { open: actionMenuVisibility }, /* @__PURE__ */ React.createElement(
39083
+ Dismissible,
39084
+ {
39085
+ click: true,
39086
+ escape: true,
39087
+ disabled: !actionMenuVisibility,
39088
+ onDismiss: () => {
39089
+ setActionMenuVisibility((p2) => !p2);
39090
+ }
39091
+ },
39092
+ actions.map((Action, i2) => (
39093
+ // TODO: `i` will suppress warnings but this indicates that maybe
39094
+ // Actions should just be componets
39095
+ /* @__PURE__ */ React.createElement(Action, { form, key: i2 })
39096
+ ))
39097
+ )));
39098
+ };
39099
+ const MoreActionsButton = ({ className = "", ...props }) => /* @__PURE__ */ React.createElement(
39100
+ "button",
39101
+ {
39102
+ 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}`,
39103
+ ...props
39104
+ },
39105
+ /* @__PURE__ */ React.createElement(EllipsisVerticalIcon, null)
39106
+ );
39107
+ const ActionsOverlay = ({ open, className = "", style = {}, ...props }) => /* @__PURE__ */ React.createElement(
39108
+ "div",
39109
+ {
39110
+ 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}`,
39111
+ style: {
39112
+ transform: open ? "translate3d(0, -28px, 0) scale3d(1, 1, 1)" : "translate3d(0, 0, 0) scale3d(0.5, 0.5, 1)",
39113
+ pointerEvents: open ? "all" : "none",
39114
+ ...style
39115
+ },
39116
+ ...props
39117
+ }
39118
+ );
39119
+ const ActionButton = ({ className = "", ...props }) => /* @__PURE__ */ React.createElement(
39120
+ "button",
39121
+ {
39122
+ 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}`,
39123
+ ...props
39124
+ }
39125
+ );
39126
+ const FormPortalContext = React.createContext(() => {
39127
+ return null;
39128
+ });
39129
+ function useFormPortal() {
39130
+ return React.useContext(FormPortalContext);
39131
+ }
39132
+ const FormPortalProvider = ({
39133
+ children
39134
+ }) => {
39135
+ const wrapperRef = React.useRef(null);
39136
+ const zIndexRef = React.useRef(0);
39137
+ const FormPortal = React.useCallback(
39138
+ (props) => {
39139
+ if (!wrapperRef.current)
39140
+ return null;
39141
+ return createPortal(
39142
+ props.children({ zIndexShift: zIndexRef.current += 1 }),
39143
+ wrapperRef.current
39144
+ );
39145
+ },
39146
+ [wrapperRef, zIndexRef]
39147
+ );
39148
+ return /* @__PURE__ */ React.createElement(FormPortalContext.Provider, { value: FormPortal }, /* @__PURE__ */ React.createElement("div", { ref: wrapperRef, className: "relative w-full flex-1 overflow-hidden" }, children));
39149
+ };
39150
+ const LoadingDots = ({
39151
+ dotSize = 8,
39152
+ color = "white"
39153
+ }) => {
39154
+ return /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(SingleDot, { dotSize, color }), /* @__PURE__ */ React.createElement(SingleDot, { dotSize, color, delay: 0.3 }), /* @__PURE__ */ React.createElement(SingleDot, { dotSize, color, delay: 0.5 }));
39155
+ };
39156
+ const SingleDot = ({ delay = 0, color, dotSize }) => /* @__PURE__ */ React.createElement(
39157
+ "span",
39158
+ {
39159
+ className: "inline-block mr-1",
39160
+ style: {
39161
+ animation: "loading-dots-scale-up-and-down 2s linear infinite",
39162
+ animationDelay: `${delay}s`,
39163
+ background: color,
39164
+ width: dotSize,
39165
+ height: dotSize,
39166
+ borderRadius: dotSize
39167
+ }
39168
+ }
39169
+ );
39170
+ const ResetForm = ({
39171
+ pristine,
39172
+ reset: reset2,
39173
+ children,
39174
+ ...props
39175
+ }) => {
39176
+ const [open, setOpen] = React.useState(false);
39177
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
39178
+ Button$1,
39179
+ {
39180
+ onClick: () => {
39181
+ setOpen((p2) => !p2);
39182
+ },
39183
+ disabled: pristine,
39184
+ ...props
39185
+ },
39186
+ children
39187
+ ), open && /* @__PURE__ */ React.createElement(ResetModal, { reset: reset2, close: () => setOpen(false) }));
39188
+ };
39189
+ const ResetModal = ({ close: close2, reset: reset2 }) => {
39190
+ return /* @__PURE__ */ React.createElement(Modal, null, /* @__PURE__ */ React.createElement(ModalPopup, null, /* @__PURE__ */ React.createElement(ModalHeader, { close: close2 }, "Reset"), /* @__PURE__ */ React.createElement(ModalBody, { padded: true }, /* @__PURE__ */ React.createElement("p", null, "Are you sure you want to reset all changes?")), /* @__PURE__ */ React.createElement(ModalActions, null, /* @__PURE__ */ React.createElement(Button$1, { style: { flexGrow: 2 }, onClick: close2 }, "Cancel"), /* @__PURE__ */ React.createElement(
39191
+ Button$1,
39192
+ {
39193
+ style: { flexGrow: 3 },
39194
+ variant: "primary",
39195
+ onClick: async () => {
39196
+ await reset2();
39197
+ close2();
39198
+ }
39199
+ },
39200
+ "Reset"
39201
+ ))));
39202
+ };
39203
+ function AiFillWarning(props) {
39204
+ 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);
39205
+ }
39206
+ function AiOutlineLoading(props) {
39207
+ 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);
39208
+ }
39209
+ 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";
39210
+ const disabledClasses$1 = "opacity-50 pointer-events-none cursor-not-allowed";
39211
+ const BaseTextField = React.forwardRef(({ className, disabled, ...rest }, ref) => {
39212
+ return /* @__PURE__ */ React.createElement(
39213
+ "input",
39214
+ {
39215
+ ref,
39216
+ type: "text",
39217
+ className: `${textFieldClasses} ${disabled ? disabledClasses$1 : ""} ${className}`,
39218
+ ...rest
39219
+ }
39220
+ );
39221
+ });
39222
+ const TextArea = React.forwardRef(({ ...props }, ref) => {
39223
+ return /* @__PURE__ */ React.createElement(
39224
+ "textarea",
39225
+ {
39226
+ ...props,
39227
+ 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",
39228
+ ref,
39229
+ style: { minHeight: "160px" }
39230
+ }
39231
+ );
39232
+ });
38675
39233
  const { get: getColor, to: toColor } = pkg;
38676
39234
  var ColorFormat = /* @__PURE__ */ ((ColorFormat2) => {
38677
39235
  ColorFormat2["Hex"] = "hex";
@@ -39214,533 +39772,122 @@ const NumberInput = ({
39214
39772
  }
39215
39773
  }
39216
39774
  );
39217
- function cn$1(...inputs) {
39218
- return twMerge(clsx(inputs));
39775
+ function useCMS() {
39776
+ return useCMS$1();
39219
39777
  }
39220
- const Button$1 = ({
39221
- variant = "secondary",
39222
- as: Tag2 = "button",
39223
- size: size2 = "medium",
39224
- busy,
39225
- disabled,
39226
- rounded = "full",
39227
- children,
39228
- className = "",
39229
- ...props
39230
- }) => {
39231
- const baseClasses = "icon-parent inline-flex items-center font-medium focus:outline-none focus:ring-2 focus:shadow-outline text-center inline-flex justify-center transition-all duration-150 ease-out ";
39232
- const variantClasses = {
39233
- primary: `shadow text-white bg-tina-orange-dark hover:bg-tina-orange focus:ring-tina-orange-dark border-0`,
39234
- secondary: `shadow text-gray-500 hover:tina-orange-dark bg-gray-50 hover:bg-white border border-gray-100`,
39235
- white: `shadow text-gray-500 hover:tina-orange-dark bg-white hover:bg-gray-50 border border-gray-100`,
39236
- ghost: `text-gray-500 hover:tina-orange-dark hover:shadow border border-transparent border-0 hover:border hover:border-gray-200 bg-transparent`,
39237
- danger: `shadow text-white bg-red-500 hover:bg-red-600 focus:ring-red-500`,
39238
- accent: `shadow text-white bg-orange-500 hover:bg-orange-600 focus:ring-orange-500`,
39239
- custom: ""
39240
- };
39241
- const state = busy ? `busy` : disabled ? `disabled` : `default`;
39242
- const stateClasses = {
39243
- disabled: `pointer-events-none opacity-30 cursor-not-allowed`,
39244
- busy: `pointer-events-none opacity-70 cursor-wait`,
39245
- default: ``
39246
- };
39247
- const roundedClasses = {
39248
- full: `rounded`,
39249
- left: `rounded-l`,
39250
- right: `rounded-r`,
39251
- custom: "",
39252
- none: ""
39253
- };
39254
- const sizeClasses = {
39255
- small: `text-xs h-8 px-3`,
39256
- medium: `text-sm h-10 px-8`,
39257
- custom: ``
39258
- };
39259
- return /* @__PURE__ */ React.createElement(
39260
- Tag2,
39261
- {
39262
- className: cn$1(
39263
- baseClasses,
39264
- variantClasses[variant],
39265
- sizeClasses[size2],
39266
- stateClasses[state],
39267
- roundedClasses[rounded],
39268
- className
39269
- ),
39270
- ...props
39271
- },
39272
- children
39778
+ const supportedFileTypes = [
39779
+ "text/*",
39780
+ "application/pdf",
39781
+ "application/octet-stream",
39782
+ "application/json",
39783
+ "application/ld+json",
39784
+ "application/vnd.ms-excel",
39785
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
39786
+ "application/msword",
39787
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
39788
+ "application/postscript",
39789
+ "model/fbx",
39790
+ "model/gltf+json",
39791
+ "model/ply",
39792
+ "model/u3d+mesh",
39793
+ "model/vnd.usdz+zip",
39794
+ "application/x-indesign",
39795
+ "application/vnd.apple.mpegurl",
39796
+ "application/dash+xml",
39797
+ "application/mxf",
39798
+ "image/*",
39799
+ "video/*"
39800
+ ];
39801
+ const DEFAULT_MEDIA_UPLOAD_TYPES = supportedFileTypes.join(",");
39802
+ const dropzoneAcceptFromString = (str) => {
39803
+ return Object.assign(
39804
+ {},
39805
+ ...(str || DEFAULT_MEDIA_UPLOAD_TYPES).split(",").map((x) => ({ [x]: [] }))
39273
39806
  );
39274
39807
  };
39275
- const IconButton = ({
39276
- variant = "secondary",
39277
- size: size2 = "medium",
39278
- busy,
39279
- disabled,
39280
- children,
39281
- className,
39282
- ...props
39283
- }) => {
39284
- const baseClasses = "icon-parent inline-flex items-center border border-transparent text-sm font-medium focus:outline-none focus:ring-2 focus:shadow-outline text-center inline-flex justify-center transition-all duration-150 ease-out rounded-full";
39285
- const variantClasses = {
39286
- primary: `shadow text-white bg-tina-orange-dark hover:bg-tina-orange focus:ring-tina-orange-dark`,
39287
- secondary: `shadow text-gray-500 hover:text-blue-500 bg-gray-50 hover:bg-white border border-gray-200`,
39288
- white: `shadow text-gray-500 hover:text-blue-500 bg-white hover:bg-gray-50 border border-gray-200`,
39289
- ghost: `text-gray-500 hover:text-blue-500 hover:shadow border border-transparent hover:border-gray-200 bg-transparent`,
39290
- accent: `shadow text-white bg-orange-500 hover:bg-orange-600 focus:ring-orange-500`
39291
- };
39292
- const state = busy ? `busy` : disabled ? `disabled` : `default`;
39293
- const stateClasses = {
39294
- disabled: `pointer-events-none opacity-30 cursor-not-allowed`,
39295
- busy: `pointer-events-none opacity-70 cursor-wait`,
39296
- default: ``
39297
- };
39298
- const sizeClasses = {
39299
- small: `h-7 w-7`,
39300
- medium: `h-9 w-9`,
39301
- custom: ``
39302
- };
39808
+ const isImage = (filename) => {
39809
+ return /\.(gif|jpg|jpeg|tiff|png|svg|webp|avif)(\?.*)?$/i.test(filename);
39810
+ };
39811
+ const isVideo = (filename) => {
39812
+ return /\.(mp4|webm|ogg|m4v|mov|avi|flv|mkv)(\?.*)?$/i.test(filename);
39813
+ };
39814
+ const absoluteImgURL = (str) => {
39815
+ if (str.startsWith("http"))
39816
+ return str;
39817
+ return `${window.location.origin}${str}`;
39818
+ };
39819
+ const { useDropzone: useDropzone$1 } = dropzone;
39820
+ const StyledImage = ({ src }) => {
39821
+ const isSvg = /\.svg$/.test(src);
39303
39822
  return /* @__PURE__ */ React.createElement(
39304
- "button",
39823
+ "img",
39305
39824
  {
39306
- className: cn$1(
39307
- baseClasses,
39308
- variantClasses[variant],
39309
- sizeClasses[size2],
39310
- stateClasses[state],
39311
- className
39312
- ),
39313
- ...props
39314
- },
39315
- children
39825
+ src,
39826
+ 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]" : ""}`
39827
+ }
39316
39828
  );
39317
39829
  };
39318
- function FontLoader() {
39319
- React.useEffect(() => {
39320
- const link = document.createElement("link");
39321
- link.href = "https://fonts.googleapis.com/css2?family=Inter:wght@400;600&family=Libre+Baskerville:wght@400;500;600;700&display=swap";
39322
- link.rel = "stylesheet";
39323
- document.head.appendChild(link);
39324
- return () => {
39325
- document.head.removeChild(link);
39326
- };
39327
- }, []);
39328
- return null;
39329
- }
39330
- function classNames(...classes) {
39331
- return classes.filter(Boolean).join(" ");
39332
- }
39333
- const OverflowMenu$1 = ({ toolbarItems: toolbarItems2, className = "w-full" }) => {
39334
- const [open, setOpen] = useState(false);
39335
- return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, toolbarItems2.length > 0 && /* @__PURE__ */ React__default.createElement(PopoverPrimitive.Root, { open, onOpenChange: setOpen }, /* @__PURE__ */ React__default.createElement(
39336
- PopoverPrimitive.Trigger,
39830
+ const StyledFile = ({ src }) => {
39831
+ return /* @__PURE__ */ React.createElement("div", { className: "max-w-full w-full flex-1 flex justify-start items-center gap-3" }, /* @__PURE__ */ React.createElement("div", { className: "w-12 h-12 bg-white shadow border border-gray-100 rounded flex justify-center flex-none" }, /* @__PURE__ */ React.createElement(BiFileBlank, { className: "w-3/5 h-full fill-gray-300" })), /* @__PURE__ */ React.createElement("span", { className: "text-base text-left flex-1 text-gray-500 w-full break-words truncate" }, src));
39832
+ };
39833
+ const ImageUpload = React.forwardRef(({ onDrop, onClear, onClick, value, src, loading }, ref) => {
39834
+ const cms = useCMS();
39835
+ const { getRootProps, getInputProps } = useDropzone$1({
39836
+ accept: dropzoneAcceptFromString(
39837
+ cms.media.accept || DEFAULT_MEDIA_UPLOAD_TYPES
39838
+ ),
39839
+ onDrop,
39840
+ noClick: !!onClick
39841
+ });
39842
+ return /* @__PURE__ */ React.createElement("div", { className: "w-full max-w-full", ...getRootProps() }, /* @__PURE__ */ React.createElement("input", { ...getInputProps() }), value ? loading ? /* @__PURE__ */ React.createElement(ImageLoadingIndicator, null) : /* @__PURE__ */ React.createElement(
39843
+ "div",
39337
39844
  {
39338
- className: `cursor-pointer relative justify-center inline-flex items-center p-3 text-sm font-medium focus:outline-1 focus:outline-blue-200 pointer-events-auto ${open ? `text-blue-400` : `text-gray-300 hover:text-blue-500`} ${className}}`
39845
+ className: `relative w-full max-w-full flex justify-start ${isImage(src) ? `items-start gap-3` : `items-center gap-2`}`
39339
39846
  },
39340
- /* @__PURE__ */ React__default.createElement(
39341
- "svg",
39847
+ /* @__PURE__ */ React.createElement(
39848
+ "button",
39342
39849
  {
39343
- xmlns: "http://www.w3.org/2000/svg",
39344
- className: "h-5 w-5",
39345
- fill: "none",
39346
- viewBox: "0 0 24 24",
39347
- stroke: "currentColor"
39850
+ 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",
39851
+ onClick,
39852
+ ref
39348
39853
  },
39349
- /* @__PURE__ */ React__default.createElement(
39350
- "path",
39351
- {
39352
- strokeLinecap: "round",
39353
- strokeLinejoin: "round",
39354
- strokeWidth: 2,
39355
- d: "M12 5v.01M12 12v.01M12 19v.01M12 6a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2z"
39854
+ isImage(src) ? /* @__PURE__ */ React.createElement(StyledImage, { src }) : /* @__PURE__ */ React.createElement(StyledFile, { src })
39855
+ ),
39856
+ onClear && /* @__PURE__ */ React.createElement(
39857
+ DeleteImageButton,
39858
+ {
39859
+ onClick: (e3) => {
39860
+ e3.stopPropagation();
39861
+ onClear();
39356
39862
  }
39357
- )
39863
+ }
39358
39864
  )
39359
- ), /* @__PURE__ */ React__default.createElement(PopoverPrimitive.Portal, null, /* @__PURE__ */ React__default.createElement(PopoverPrimitive.Content, { style: { zIndex: 2e4 }, align: "end" }, /* @__PURE__ */ React__default.createElement("div", { className: "mt-0 -mr-1 rounded shadow-lg bg-white ring-1 ring-black ring-opacity-5 py-1" }, toolbarItems2.map((toolbarItem) => {
39360
- return /* @__PURE__ */ React__default.createElement(
39361
- "span",
39362
- {
39363
- "data-test": `${toolbarItem.name}OverflowButton`,
39364
- key: toolbarItem.name,
39365
- onMouseDown: (event) => {
39366
- event.preventDefault();
39367
- toolbarItem.onMouseDown(event);
39368
- setOpen(false);
39369
- },
39370
- className: classNames(
39371
- toolbarItem.active ? "bg-gray-50 text-blue-500" : "bg-white text-gray-600",
39372
- "hover:bg-gray-50 hover:text-blue-500 cursor-pointer pointer-events-auto px-4 py-2 text-sm w-full flex items-center whitespace-nowrap",
39373
- toolbarItem.className ?? ""
39374
- )
39375
- },
39376
- /* @__PURE__ */ React__default.createElement("div", { className: "mr-2 opacity-80" }, toolbarItem.Icon),
39377
- " ",
39378
- toolbarItem.label
39379
- );
39380
- }))))));
39381
- };
39382
- function BsArrowRightShort(props) {
39383
- return GenIcon({ "tag": "svg", "attr": { "fill": "currentColor", "viewBox": "0 0 16 16" }, "child": [{ "tag": "path", "attr": { "fillRule": "evenodd", "d": "M4 8a.5.5 0 0 1 .5-.5h5.793L8.146 5.354a.5.5 0 1 1 .708-.708l3 3a.5.5 0 0 1 0 .708l-3 3a.5.5 0 0 1-.708-.708L10.293 8.5H4.5A.5.5 0 0 1 4 8" }, "child": [] }] })(props);
39384
- }
39385
- function BsCheckCircleFill(props) {
39386
- return GenIcon({ "tag": "svg", "attr": { "fill": "currentColor", "viewBox": "0 0 16 16" }, "child": [{ "tag": "path", "attr": { "d": "M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0m-3.97-3.03a.75.75 0 0 0-1.08.022L7.477 9.417 5.384 7.323a.75.75 0 0 0-1.06 1.06L6.97 11.03a.75.75 0 0 0 1.079-.02l3.992-4.99a.75.75 0 0 0-.01-1.05z" }, "child": [] }] })(props);
39387
- }
39388
- function BsExclamationOctagonFill(props) {
39389
- return GenIcon({ "tag": "svg", "attr": { "fill": "currentColor", "viewBox": "0 0 16 16" }, "child": [{ "tag": "path", "attr": { "d": "M11.46.146A.5.5 0 0 0 11.107 0H4.893a.5.5 0 0 0-.353.146L.146 4.54A.5.5 0 0 0 0 4.893v6.214a.5.5 0 0 0 .146.353l4.394 4.394a.5.5 0 0 0 .353.146h6.214a.5.5 0 0 0 .353-.146l4.394-4.394a.5.5 0 0 0 .146-.353V4.893a.5.5 0 0 0-.146-.353zM8 4c.535 0 .954.462.9.995l-.35 3.507a.552.552 0 0 1-1.1 0L7.1 4.995A.905.905 0 0 1 8 4m.002 6a1 1 0 1 1 0 2 1 1 0 0 1 0-2" }, "child": [] }] })(props);
39390
- }
39391
- const MessageIcon = ({
39392
- type = "success",
39393
- className = ""
39394
- }) => {
39395
- const icons = {
39396
- success: BiCheckCircle,
39397
- warning: BiError,
39398
- error: BiError,
39399
- info: BiInfoCircle
39400
- };
39401
- const Icon = icons[type];
39402
- return /* @__PURE__ */ React__default.createElement(Icon, { className });
39403
- };
39404
- const Message = ({
39405
- children,
39406
- type = "success",
39407
- size: size2 = "medium",
39408
- className = "",
39409
- link,
39410
- linkLabel = "Learn More"
39411
- }) => {
39412
- const containerClasses = {
39413
- success: "bg-gradient-to-r from-green-50 to-green-100 border-green-200",
39414
- warning: "bg-gradient-to-r from-yellow-50 to-yellow-100 border-yellow-200",
39415
- error: "bg-gradient-to-r from-red-50 to-red-100 border-red-200",
39416
- info: "bg-gradient-to-r from-blue-50 to-blue-100 border-blue-100"
39417
- };
39418
- const textClasses = {
39419
- success: "text-green-700",
39420
- warning: "text-yellow-700",
39421
- error: "text-red-700",
39422
- info: "text-blue-700"
39423
- };
39424
- const iconClasses = {
39425
- success: "text-green-400",
39426
- warning: "text-yellow-400",
39427
- error: "text-red-400",
39428
- info: "text-blue-400"
39429
- };
39430
- const sizeClasses = {
39431
- small: "px-3 py-1.5 text-xs",
39432
- medium: "px-4 py-2.5 text-sm"
39433
- };
39434
- return /* @__PURE__ */ React__default.createElement(
39435
- "div",
39865
+ ) : /* @__PURE__ */ React.createElement(
39866
+ "button",
39436
39867
  {
39437
- className: `rounded-lg border shadow-sm ${sizeClasses[size2]} ${containerClasses[type]} ${className}`
39868
+ className: "outline-none relative hover:opacity-60 w-full",
39869
+ onClick
39438
39870
  },
39439
- /* @__PURE__ */ React__default.createElement("div", { className: "flex flex-col sm:flex-row items-start sm:items-center gap-2" }, /* @__PURE__ */ React__default.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ React__default.createElement(
39440
- MessageIcon,
39441
- {
39442
- type,
39443
- className: `${size2 === "small" ? "w-5" : "w-6"} h-auto flex-shrink-0 ${iconClasses[type]}`
39444
- }
39445
- ), /* @__PURE__ */ React__default.createElement("div", { className: `flex-1 ${textClasses[type]}` }, children)), link && /* @__PURE__ */ React__default.createElement(
39446
- "a",
39447
- {
39448
- href: link,
39449
- target: "_blank",
39450
- className: "flex-shrink-0 flex items-center gap-1 text-blue-600 underline decoration-blue-200 hover:text-blue-500 hover:decoration-blue-500 transition-all ease-out duration-150"
39451
- },
39452
- linkLabel,
39453
- " ",
39454
- /* @__PURE__ */ React__default.createElement(BsArrowRightShort, { className: "w-4 h-auto" })
39455
- ))
39456
- );
39871
+ loading ? /* @__PURE__ */ React.createElement(ImageLoadingIndicator, null) : /* @__PURE__ */ React.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.createElement("br", null), "or click to select a file")
39872
+ ));
39873
+ });
39874
+ const DeleteImageButton = ({
39875
+ onClick
39876
+ }) => {
39877
+ return /* @__PURE__ */ React.createElement(IconButton, { variant: "white", className: "flex-none", onClick }, /* @__PURE__ */ React.createElement(TrashIcon, { className: "w-7 h-auto caret-transparent" }));
39457
39878
  };
39458
- function cn(...inputs) {
39459
- return twMerge(clsx(inputs));
39879
+ const ImageLoadingIndicator = () => /* @__PURE__ */ React.createElement("div", { className: "p-4 w-full min-h-[96px] flex flex-col justify-center items-center" }, /* @__PURE__ */ React.createElement(LoadingDots, null));
39880
+ function IoMdArrowDropdown(props) {
39881
+ return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 512 512" }, "child": [{ "tag": "path", "attr": { "d": "M128 192l128 128 128-128z" }, "child": [] }] })(props);
39460
39882
  }
39461
- function DropdownMenu({
39462
- ...props
39463
- }) {
39464
- return /* @__PURE__ */ React.createElement(DropdownMenuPrimitive.Root, { "data-slot": "dropdown-menu", ...props });
39883
+ function IoMdArrowDropup(props) {
39884
+ return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 512 512" }, "child": [{ "tag": "path", "attr": { "d": "M128 320l128-128 128 128z" }, "child": [] }] })(props);
39465
39885
  }
39466
- function DropdownMenuTrigger({
39467
- ...props
39468
- }) {
39469
- return /* @__PURE__ */ React.createElement(
39470
- DropdownMenuPrimitive.Trigger,
39471
- {
39472
- "data-slot": "dropdown-menu-trigger",
39473
- ...props
39474
- }
39475
- );
39886
+ function IoMdClose(props) {
39887
+ 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);
39476
39888
  }
39477
- function DropdownMenuContent({
39478
- className,
39479
- sideOffset = 4,
39480
- ...props
39481
- }) {
39482
- return /* @__PURE__ */ React.createElement(DropdownMenuPrimitive.Portal, null, /* @__PURE__ */ React.createElement(
39483
- DropdownMenuPrimitive.Content,
39484
- {
39485
- "data-slot": "dropdown-menu-content",
39486
- sideOffset,
39487
- className: cn(
39488
- "bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-base max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",
39489
- className
39490
- ),
39491
- ...props
39492
- }
39493
- ));
39494
- }
39495
- function DropdownMenuItem({
39496
- className,
39497
- inset,
39498
- variant = "default",
39499
- ...props
39500
- }) {
39501
- return /* @__PURE__ */ React.createElement(
39502
- DropdownMenuPrimitive.Item,
39503
- {
39504
- "data-slot": "dropdown-menu-item",
39505
- "data-inset": inset,
39506
- "data-variant": variant,
39507
- className: cn(
39508
- "focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 cursor-pointer text-gray-700 hover:text-blue-500",
39509
- className
39510
- ),
39511
- ...props
39512
- }
39513
- );
39514
- }
39515
- function DropdownMenuSeparator({
39516
- className,
39517
- ...props
39518
- }) {
39519
- return /* @__PURE__ */ React.createElement(
39520
- DropdownMenuPrimitive.Separator,
39521
- {
39522
- "data-slot": "dropdown-menu-separator",
39523
- className: cn("bg-border -mx-1 my-1 h-px", className),
39524
- ...props
39525
- }
39526
- );
39527
- }
39528
- const DropdownButton = React.forwardRef(
39529
- ({
39530
- variant = "primary",
39531
- size: size2 = "medium",
39532
- busy,
39533
- disabled,
39534
- rounded = "full",
39535
- children,
39536
- className = "",
39537
- onMainAction,
39538
- items: items2,
39539
- showSplitButton = true,
39540
- ...props
39541
- }, ref) => {
39542
- const [open, setOpen] = React.useState(false);
39543
- if (!onMainAction || !showSplitButton) {
39544
- return /* @__PURE__ */ React.createElement(DropdownMenu, { open, onOpenChange: setOpen, modal: false }, /* @__PURE__ */ React.createElement(DropdownMenuTrigger, { asChild: true }, /* @__PURE__ */ React.createElement(
39545
- Button$1,
39546
- {
39547
- variant,
39548
- size: size2,
39549
- busy,
39550
- disabled,
39551
- rounded,
39552
- className: cn$1("gap-2", className),
39553
- ...props
39554
- },
39555
- children,
39556
- /* @__PURE__ */ React.createElement(
39557
- ChevronDownIcon$1,
39558
- {
39559
- className: cn$1(
39560
- "h-4 w-4 transition-transform duration-200",
39561
- open && "rotate-180"
39562
- )
39563
- }
39564
- )
39565
- )), /* @__PURE__ */ React.createElement(DropdownMenuContent, { align: "end", side: "bottom", className: "z-[100000]" }, items2.map((item, index) => /* @__PURE__ */ React.createElement(
39566
- DropdownMenuItem,
39567
- {
39568
- key: index,
39569
- onClick: item.onClick,
39570
- disabled: item.disabled,
39571
- variant: item.variant
39572
- },
39573
- item.icon && item.icon,
39574
- item.label
39575
- ))));
39576
- }
39577
- return /* @__PURE__ */ React.createElement("div", { className: cn$1("inline-flex", className) }, /* @__PURE__ */ React.createElement(
39578
- Button$1,
39579
- {
39580
- variant,
39581
- size: size2,
39582
- busy,
39583
- disabled,
39584
- rounded: "left",
39585
- onClick: onMainAction,
39586
- className: "border-r-0 w-full",
39587
- ...props
39588
- },
39589
- children
39590
- ), /* @__PURE__ */ React.createElement(DropdownMenu, { open, onOpenChange: setOpen }, /* @__PURE__ */ React.createElement(DropdownMenuTrigger, null, /* @__PURE__ */ React.createElement(
39591
- Button$1,
39592
- {
39593
- variant,
39594
- size: size2,
39595
- busy,
39596
- disabled,
39597
- rounded: "right",
39598
- className: "px-4 border-l",
39599
- style: { borderColor: "#00000030" },
39600
- "aria-label": "More options"
39601
- },
39602
- /* @__PURE__ */ React.createElement(
39603
- ChevronDownIcon$1,
39604
- {
39605
- className: cn$1(
39606
- "h-4 w-4 transition-transform duration-200 fill-none",
39607
- open && "rotate-180"
39608
- ),
39609
- style: { fill: "none" }
39610
- }
39611
- )
39612
- )), /* @__PURE__ */ React.createElement(DropdownMenuContent, { align: "end", side: "bottom" }, items2.map((item, index) => {
39613
- var _a2;
39614
- return /* @__PURE__ */ React.createElement(React.Fragment, { key: index }, /* @__PURE__ */ React.createElement(
39615
- DropdownMenuItem,
39616
- {
39617
- onClick: item.onClick,
39618
- disabled: item.disabled,
39619
- variant: item.variant
39620
- },
39621
- item.icon && item.icon,
39622
- item.label
39623
- ), item.variant === "destructive" && index < items2.length - 1 && ((_a2 = items2[index + 1]) == null ? void 0 : _a2.variant) !== "destructive" && /* @__PURE__ */ React.createElement(DropdownMenuSeparator, null));
39624
- }))));
39625
- }
39626
- );
39627
- DropdownButton.displayName = "DropdownButton";
39628
- function useCMS() {
39629
- return useCMS$1();
39630
- }
39631
- const supportedFileTypes = [
39632
- "text/*",
39633
- "application/pdf",
39634
- "application/octet-stream",
39635
- "application/json",
39636
- "application/ld+json",
39637
- "application/vnd.ms-excel",
39638
- "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
39639
- "application/msword",
39640
- "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
39641
- "application/postscript",
39642
- "model/fbx",
39643
- "model/gltf+json",
39644
- "model/ply",
39645
- "model/u3d+mesh",
39646
- "model/vnd.usdz+zip",
39647
- "application/x-indesign",
39648
- "application/vnd.apple.mpegurl",
39649
- "application/dash+xml",
39650
- "application/mxf",
39651
- "image/*",
39652
- "video/*"
39653
- ];
39654
- const DEFAULT_MEDIA_UPLOAD_TYPES = supportedFileTypes.join(",");
39655
- const dropzoneAcceptFromString = (str) => {
39656
- return Object.assign(
39657
- {},
39658
- ...(str || DEFAULT_MEDIA_UPLOAD_TYPES).split(",").map((x) => ({ [x]: [] }))
39659
- );
39660
- };
39661
- const isImage = (filename) => {
39662
- return /\.(gif|jpg|jpeg|tiff|png|svg|webp|avif)(\?.*)?$/i.test(filename);
39663
- };
39664
- const isVideo = (filename) => {
39665
- return /\.(mp4|webm|ogg|m4v|mov|avi|flv|mkv)(\?.*)?$/i.test(filename);
39666
- };
39667
- const absoluteImgURL = (str) => {
39668
- if (str.startsWith("http"))
39669
- return str;
39670
- return `${window.location.origin}${str}`;
39671
- };
39672
- const { useDropzone: useDropzone$1 } = dropzone;
39673
- const StyledImage = ({ src }) => {
39674
- const isSvg = /\.svg$/.test(src);
39675
- return /* @__PURE__ */ React.createElement(
39676
- "img",
39677
- {
39678
- src,
39679
- 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]" : ""}`
39680
- }
39681
- );
39682
- };
39683
- const StyledFile = ({ src }) => {
39684
- return /* @__PURE__ */ React.createElement("div", { className: "max-w-full w-full flex-1 flex justify-start items-center gap-3" }, /* @__PURE__ */ React.createElement("div", { className: "w-12 h-12 bg-white shadow border border-gray-100 rounded flex justify-center flex-none" }, /* @__PURE__ */ React.createElement(BiFileBlank, { className: "w-3/5 h-full fill-gray-300" })), /* @__PURE__ */ React.createElement("span", { className: "text-base text-left flex-1 text-gray-500 w-full break-words truncate" }, src));
39685
- };
39686
- const ImageUpload = React.forwardRef(({ onDrop, onClear, onClick, value, src, loading }, ref) => {
39687
- const cms = useCMS();
39688
- const { getRootProps, getInputProps } = useDropzone$1({
39689
- accept: dropzoneAcceptFromString(
39690
- cms.media.accept || DEFAULT_MEDIA_UPLOAD_TYPES
39691
- ),
39692
- onDrop,
39693
- noClick: !!onClick
39694
- });
39695
- return /* @__PURE__ */ React.createElement("div", { className: "w-full max-w-full", ...getRootProps() }, /* @__PURE__ */ React.createElement("input", { ...getInputProps() }), value ? loading ? /* @__PURE__ */ React.createElement(ImageLoadingIndicator, null) : /* @__PURE__ */ React.createElement(
39696
- "div",
39697
- {
39698
- className: `relative w-full max-w-full flex justify-start ${isImage(src) ? `items-start gap-3` : `items-center gap-2`}`
39699
- },
39700
- /* @__PURE__ */ React.createElement(
39701
- "button",
39702
- {
39703
- 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",
39704
- onClick,
39705
- ref
39706
- },
39707
- isImage(src) ? /* @__PURE__ */ React.createElement(StyledImage, { src }) : /* @__PURE__ */ React.createElement(StyledFile, { src })
39708
- ),
39709
- onClear && /* @__PURE__ */ React.createElement(
39710
- DeleteImageButton,
39711
- {
39712
- onClick: (e3) => {
39713
- e3.stopPropagation();
39714
- onClear();
39715
- }
39716
- }
39717
- )
39718
- ) : /* @__PURE__ */ React.createElement(
39719
- "button",
39720
- {
39721
- className: "outline-none relative hover:opacity-60 w-full",
39722
- onClick
39723
- },
39724
- loading ? /* @__PURE__ */ React.createElement(ImageLoadingIndicator, null) : /* @__PURE__ */ React.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.createElement("br", null), "or click to select a file")
39725
- ));
39726
- });
39727
- const DeleteImageButton = ({
39728
- onClick
39729
- }) => {
39730
- return /* @__PURE__ */ React.createElement(IconButton, { variant: "white", className: "flex-none", onClick }, /* @__PURE__ */ React.createElement(TrashIcon, { className: "w-7 h-auto caret-transparent" }));
39731
- };
39732
- const ImageLoadingIndicator = () => /* @__PURE__ */ React.createElement("div", { className: "p-4 w-full min-h-[96px] flex flex-col justify-center items-center" }, /* @__PURE__ */ React.createElement(LoadingDots, null));
39733
- function IoMdArrowDropdown(props) {
39734
- return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 512 512" }, "child": [{ "tag": "path", "attr": { "d": "M128 192l128 128 128-128z" }, "child": [] }] })(props);
39735
- }
39736
- function IoMdArrowDropup(props) {
39737
- return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 512 512" }, "child": [{ "tag": "path", "attr": { "d": "M128 320l128-128 128 128z" }, "child": [] }] })(props);
39738
- }
39739
- function IoMdClose(props) {
39740
- 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);
39741
- }
39742
- function IoMdRefresh(props) {
39743
- 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);
39889
+ function IoMdRefresh(props) {
39890
+ 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);
39744
39891
  }
39745
39892
  const buttonVariants = cva(
39746
39893
  "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",
@@ -42733,30 +42880,6 @@ const PasswordFieldPlugin = {
42733
42880
  },
42734
42881
  parse: parse$2
42735
42882
  };
42736
- function AiFillWarning(props) {
42737
- return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 1024 1024" }, "child": [{ "tag": "path", "attr": { "d": "M955.7 856l-416-720c-6.2-10.7-16.9-16-27.7-16s-21.6 5.3-27.7 16l-416 720C56 877.4 71.4 904 96 904h832c24.6 0 40-26.6 27.7-48zM480 416c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v184c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V416zm32 352a48.01 48.01 0 0 1 0-96 48.01 48.01 0 0 1 0 96z" }, "child": [] }] })(props);
42738
- }
42739
- function AiOutlineLoading(props) {
42740
- return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 1024 1024" }, "child": [{ "tag": "path", "attr": { "d": "M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 0 0-94.3-139.9 437.71 437.71 0 0 0-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z" }, "child": [] }] })(props);
42741
- }
42742
- function FaCircle(props) {
42743
- return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 512 512" }, "child": [{ "tag": "path", "attr": { "d": "M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8z" }, "child": [] }] })(props);
42744
- }
42745
- function FaFile(props) {
42746
- return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 384 512" }, "child": [{ "tag": "path", "attr": { "d": "M224 136V0H24C10.7 0 0 10.7 0 24v464c0 13.3 10.7 24 24 24h336c13.3 0 24-10.7 24-24V160H248c-13.2 0-24-10.8-24-24zm160-14.1v6.1H256V0h6.1c6.4 0 12.5 2.5 17 7l97.9 98c4.5 4.5 7 10.6 7 16.9z" }, "child": [] }] })(props);
42747
- }
42748
- function FaFolder(props) {
42749
- return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 512 512" }, "child": [{ "tag": "path", "attr": { "d": "M464 128H272l-64-64H48C21.49 64 0 85.49 0 112v288c0 26.51 21.49 48 48 48h416c26.51 0 48-21.49 48-48V176c0-26.51-21.49-48-48-48z" }, "child": [] }] })(props);
42750
- }
42751
- function FaLock(props) {
42752
- return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 448 512" }, "child": [{ "tag": "path", "attr": { "d": "M400 224h-24v-72C376 68.2 307.8 0 224 0S72 68.2 72 152v72H48c-26.5 0-48 21.5-48 48v192c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V272c0-26.5-21.5-48-48-48zm-104 0H152v-72c0-39.7 32.3-72 72-72s72 32.3 72 72v72z" }, "child": [] }] })(props);
42753
- }
42754
- function FaSpinner(props) {
42755
- return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 512 512" }, "child": [{ "tag": "path", "attr": { "d": "M304 48c0 26.51-21.49 48-48 48s-48-21.49-48-48 21.49-48 48-48 48 21.49 48 48zm-48 368c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.49-48-48-48zm208-208c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.49-48-48-48zM96 256c0-26.51-21.49-48-48-48S0 229.49 0 256s21.49 48 48 48 48-21.49 48-48zm12.922 99.078c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48c0-26.509-21.491-48-48-48zm294.156 0c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48c0-26.509-21.49-48-48-48zM108.922 60.922c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.491-48-48-48z" }, "child": [] }] })(props);
42756
- }
42757
- function FaUnlock(props) {
42758
- return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 448 512" }, "child": [{ "tag": "path", "attr": { "d": "M400 256H152V152.9c0-39.6 31.7-72.5 71.3-72.9 40-.4 72.7 32.1 72.7 72v16c0 13.3 10.7 24 24 24h32c13.3 0 24-10.7 24-24v-16C376 68 307.5-.3 223.5 0 139.5.3 72 69.5 72 153.5V256H48c-26.5 0-48 21.5-48 48v160c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V304c0-26.5-21.5-48-48-48z" }, "child": [] }] })(props);
42759
- }
42760
42883
  function GrCircleQuestion(props) {
42761
42884
  return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "fill": "none", "strokeWidth": "2", "d": "M12,22 C17.5228475,22 22,17.5228475 22,12 C22,6.4771525 17.5228475,2 12,2 C6.4771525,2 2,6.4771525 2,12 C2,17.5228475 6.4771525,22 12,22 Z M12,15 L12,14 C12,13 12,12.5 13,12 C14,11.5 15,11 15,9.5 C15,8.5 14,7 12,7 C10,7 9,8.26413718 9,10 M12,16 L12,18" }, "child": [] }] })(props);
42762
42885
  }
@@ -45457,7 +45580,7 @@ const Callout = ({
45457
45580
  className = "",
45458
45581
  ...props
45459
45582
  }) => {
45460
- const commonAlertStyles = "ml-8 text-sm px-4 py-3 rounded-md border";
45583
+ const commonAlertStyles = "text-sm px-4 py-3 rounded-md border";
45461
45584
  const styles = {
45462
45585
  warning: `text-amber-700 bg-amber-100 border-amber-700/20`,
45463
45586
  info: `text-blue-600 bg-blue-100/50 border-blue-600/20`,
@@ -46229,7 +46352,7 @@ function formatDistanceToNow(dirtyDate, options) {
46229
46352
  requiredArgs(1, arguments);
46230
46353
  return formatDistance2(dirtyDate, Date.now(), options);
46231
46354
  }
46232
- const version$1 = "2.9.3";
46355
+ const version$1 = "2.9.5";
46233
46356
  const VersionInfo = () => {
46234
46357
  var _a2, _b, _c, _d, _e, _f;
46235
46358
  const cms = useCMS();
@@ -47869,7 +47992,7 @@ function Alerts2({ alerts }) {
47869
47992
  if (!alerts.all.length) {
47870
47993
  return null;
47871
47994
  }
47872
- return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement("div", { className: "fixed bottom-0 left-0 right-0 p-6 flex flex-col items-center z-[999999]" }, alerts.all.filter((alert) => {
47995
+ return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement("div", { className: "fixed top-0 left-0 p-6 flex flex-col items-center z-[999999]" }, alerts.all.filter((alert) => {
47873
47996
  return alert.level !== "error";
47874
47997
  }).map((alert) => {
47875
47998
  return /* @__PURE__ */ React__default.createElement(Alert, { key: alert.id, level: alert.level }, alert.level === "info" && /* @__PURE__ */ React__default.createElement(MdInfo, { className: "w-5 h-auto opacity-70" }), alert.level === "success" && /* @__PURE__ */ React__default.createElement(MdCheckCircle, { className: "w-5 h-auto opacity-70" }), alert.level === "warn" && /* @__PURE__ */ React__default.createElement(MdWarning, { className: "w-5 h-auto opacity-70" }), /* @__PURE__ */ React__default.createElement("p", { className: "m-0 flex-1 max-w-[680px] text-left" }, parseUrlsInText(alert.message.toString())), /* @__PURE__ */ React__default.createElement(
@@ -47913,10 +48036,10 @@ const Alert = ({
47913
48036
  ...props
47914
48037
  }) => {
47915
48038
  const colorClasses = {
47916
- info: "bg-blue-100 border-blue-500 text-blue-600 fill-blue-500",
47917
- success: "bg-green-100 border-green-500 text-green-600 fill-green-500",
47918
- warn: "bg-yellow-100 border-yellow-500 text-yellow-600 fill-yellow-500",
47919
- error: "bg-red-100 border-red-500 text-red-600 fill-red-500"
48039
+ info: "bg-white border-blue-500 text-blue-600 fill-blue-500",
48040
+ success: "bg-white border-green-500 text-green-600 fill-green-500",
48041
+ warn: "bg-white border-yellow-500 text-yellow-600 fill-yellow-500",
48042
+ error: "bg-white border-red-500 text-red-600 fill-red-500"
47920
48043
  };
47921
48044
  const borderClasses = {
47922
48045
  info: "border-blue-200",
@@ -47939,7 +48062,7 @@ const Alert = ({
47939
48062
  /* @__PURE__ */ React__default.createElement(
47940
48063
  "div",
47941
48064
  {
47942
- className: `flex items-center gap-1.5 min-w-[350px] rounded-md border p-2 ${borderClasses[level]}`,
48065
+ className: `flex items-center gap-1.5 w-[350px] rounded-md border p-2 ${borderClasses[level]}`,
47943
48066
  ...props
47944
48067
  }
47945
48068
  )
@@ -47951,7 +48074,7 @@ const CloseAlert = ({ ...styleProps }) => /* @__PURE__ */ React__default.createE
47951
48074
  className: "border-none bg-transparent p-0 outline-none flex items-center",
47952
48075
  ...styleProps
47953
48076
  },
47954
- /* @__PURE__ */ React__default.createElement(BiX, { className: "w-5 auto flex-grow-0 flex-shrink-0" })
48077
+ /* @__PURE__ */ React__default.createElement(BiX, { className: "w-5 auto flex-grow-0 flex-shrink-0 text-gray-700" })
47955
48078
  );
47956
48079
  function CursorPaginator({
47957
48080
  navigateNext,
@@ -48248,6 +48371,18 @@ const BranchPreviewButton = (props) => {
48248
48371
  /* @__PURE__ */ React.createElement(BiLinkExternal, { className: "h-5 w-auto" })
48249
48372
  );
48250
48373
  };
48374
+ const EDITORIAL_WORKFLOW_STATUS = {
48375
+ QUEUED: "queued",
48376
+ PROCESSING: "processing",
48377
+ SETTING_UP: "setting_up",
48378
+ CREATING_BRANCH: "creating_branch",
48379
+ INDEXING: "indexing",
48380
+ CONTENT_GENERATION: "content_generation",
48381
+ CREATING_PR: "creating_pr",
48382
+ COMPLETE: "complete",
48383
+ ERROR: "error",
48384
+ TIMEOUT: "timeout"
48385
+ };
48251
48386
  const num123 = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"];
48252
48387
  const numFas = ["۱", "۲", "۳", "۴", "۵", "۶", "۷", "۸", "۹", "۰"];
48253
48388
  const numKor = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"];
@@ -63661,367 +63796,6 @@ class TinaAdminApi {
63661
63796
  );
63662
63797
  }
63663
63798
  }
63664
- const ProgressBar = ({
63665
- progress,
63666
- className = "",
63667
- color = "blue"
63668
- }) => {
63669
- const clampedProgress = Math.min(Math.max(progress, 0), 100);
63670
- const colorClass = color === "green" ? "bg-green-500" : "bg-blue-500";
63671
- return /* @__PURE__ */ React.createElement("div", { className: `w-full ${className}` }, /* @__PURE__ */ React.createElement("div", { className: "w-full bg-gray-200 rounded-full h-2" }, /* @__PURE__ */ React.createElement(
63672
- "div",
63673
- {
63674
- className: `${colorClass} h-2 rounded-full transition-all duration-300 ease-out`,
63675
- style: { width: `${clampedProgress}%` }
63676
- }
63677
- )));
63678
- };
63679
- const EDITORIAL_WORKFLOW_STATUS = {
63680
- QUEUED: "queued",
63681
- PROCESSING: "processing",
63682
- SETTING_UP: "setting_up",
63683
- CREATING_BRANCH: "creating_branch",
63684
- INDEXING: "indexing",
63685
- CONTENT_GENERATION: "content_generation",
63686
- CREATING_PR: "creating_pr",
63687
- COMPLETE: "complete",
63688
- ERROR: "error",
63689
- TIMEOUT: "timeout"
63690
- };
63691
- const FormActionMenu = ({ actions, form }) => {
63692
- const [actionMenuVisibility, setActionMenuVisibility] = useState(false);
63693
- return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(MoreActionsButton, { onClick: () => setActionMenuVisibility((p2) => !p2) }), /* @__PURE__ */ React.createElement(ActionsOverlay, { open: actionMenuVisibility }, /* @__PURE__ */ React.createElement(
63694
- Dismissible,
63695
- {
63696
- click: true,
63697
- escape: true,
63698
- disabled: !actionMenuVisibility,
63699
- onDismiss: () => {
63700
- setActionMenuVisibility((p2) => !p2);
63701
- }
63702
- },
63703
- actions.map((Action, i2) => (
63704
- // TODO: `i` will suppress warnings but this indicates that maybe
63705
- // Actions should just be componets
63706
- /* @__PURE__ */ React.createElement(Action, { form, key: i2 })
63707
- ))
63708
- )));
63709
- };
63710
- const MoreActionsButton = ({ className = "", ...props }) => /* @__PURE__ */ React.createElement(
63711
- "button",
63712
- {
63713
- className: `h-16 w-10 self-stretch bg-transparent bg-center bg-[length:auto_18px] -mr-4 ml-2 outline-none cursor-pointer transition-opacity duration-100 ease-out flex justify-center items-center hover:bg-gray-50 hover:fill-gray-700 ${className}`,
63714
- ...props
63715
- },
63716
- /* @__PURE__ */ React.createElement(EllipsisVerticalIcon, null)
63717
- );
63718
- const ActionsOverlay = ({ open, className = "", style = {}, ...props }) => /* @__PURE__ */ React.createElement(
63719
- "div",
63720
- {
63721
- className: `min-w-[192px] rounded-3xl border border-solid border-[#efefef] block absolute bottom-5 right-5 ${open ? "opacity-100" : "opacity-0"} transition-all duration-100 ease-out origin-bottom-right shadow-[0_2px_3px_rgba(0,0,0,0.05)] bg-white overflow-hidden z-10 ${className}`,
63722
- style: {
63723
- transform: open ? "translate3d(0, -28px, 0) scale3d(1, 1, 1)" : "translate3d(0, 0, 0) scale3d(0.5, 0.5, 1)",
63724
- pointerEvents: open ? "all" : "none",
63725
- ...style
63726
- },
63727
- ...props
63728
- }
63729
- );
63730
- const ActionButton = ({ className = "", ...props }) => /* @__PURE__ */ React.createElement(
63731
- "button",
63732
- {
63733
- className: `relative text-center text-[13px] px-3 h-10 font-normal w-full bg-none cursor-pointer outline-none border-0 transition-all duration-[150ms] ease-out hover:text-blue-500 hover:bg-gray50 [&:not(:last-child)]: border-b-[1px] border-solid border-b-[#edecf3] ${className}`,
63734
- ...props
63735
- }
63736
- );
63737
- const FormPortalContext = React.createContext(() => {
63738
- return null;
63739
- });
63740
- function useFormPortal() {
63741
- return React.useContext(FormPortalContext);
63742
- }
63743
- const FormPortalProvider = ({
63744
- children
63745
- }) => {
63746
- const wrapperRef = React.useRef(null);
63747
- const zIndexRef = React.useRef(0);
63748
- const FormPortal = React.useCallback(
63749
- (props) => {
63750
- if (!wrapperRef.current)
63751
- return null;
63752
- return createPortal(
63753
- props.children({ zIndexShift: zIndexRef.current += 1 }),
63754
- wrapperRef.current
63755
- );
63756
- },
63757
- [wrapperRef, zIndexRef]
63758
- );
63759
- return /* @__PURE__ */ React.createElement(FormPortalContext.Provider, { value: FormPortal }, /* @__PURE__ */ React.createElement("div", { ref: wrapperRef, className: "relative w-full flex-1 overflow-hidden" }, children));
63760
- };
63761
- const LoadingDots = ({
63762
- dotSize = 8,
63763
- color = "white"
63764
- }) => {
63765
- return /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(SingleDot, { dotSize, color }), /* @__PURE__ */ React.createElement(SingleDot, { dotSize, color, delay: 0.3 }), /* @__PURE__ */ React.createElement(SingleDot, { dotSize, color, delay: 0.5 }));
63766
- };
63767
- const SingleDot = ({ delay = 0, color, dotSize }) => /* @__PURE__ */ React.createElement(
63768
- "span",
63769
- {
63770
- className: "inline-block mr-1",
63771
- style: {
63772
- animation: "loading-dots-scale-up-and-down 2s linear infinite",
63773
- animationDelay: `${delay}s`,
63774
- background: color,
63775
- width: dotSize,
63776
- height: dotSize,
63777
- borderRadius: dotSize
63778
- }
63779
- }
63780
- );
63781
- const ResetForm = ({
63782
- pristine,
63783
- reset: reset2,
63784
- children,
63785
- ...props
63786
- }) => {
63787
- const [open, setOpen] = React.useState(false);
63788
- return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
63789
- Button$1,
63790
- {
63791
- onClick: () => {
63792
- setOpen((p2) => !p2);
63793
- },
63794
- disabled: pristine,
63795
- ...props
63796
- },
63797
- children
63798
- ), open && /* @__PURE__ */ React.createElement(ResetModal, { reset: reset2, close: () => setOpen(false) }));
63799
- };
63800
- const ResetModal = ({ close: close2, reset: reset2 }) => {
63801
- return /* @__PURE__ */ React.createElement(Modal, null, /* @__PURE__ */ React.createElement(ModalPopup, null, /* @__PURE__ */ React.createElement(ModalHeader, { close: close2 }, "Reset"), /* @__PURE__ */ React.createElement(ModalBody, { padded: true }, /* @__PURE__ */ React.createElement("p", null, "Are you sure you want to reset all changes?")), /* @__PURE__ */ React.createElement(ModalActions, null, /* @__PURE__ */ React.createElement(Button$1, { style: { flexGrow: 2 }, onClick: close2 }, "Cancel"), /* @__PURE__ */ React.createElement(
63802
- Button$1,
63803
- {
63804
- style: { flexGrow: 3 },
63805
- variant: "primary",
63806
- onClick: async () => {
63807
- await reset2();
63808
- close2();
63809
- }
63810
- },
63811
- "Reset"
63812
- ))));
63813
- };
63814
- const NoFieldsPlaceholder = () => /* @__PURE__ */ React.createElement(
63815
- "div",
63816
- {
63817
- className: "relative flex flex-col items-center justify-center text-center p-5 pb-16 w-full h-full overflow-y-auto",
63818
- style: {
63819
- animationName: "fade-in",
63820
- animationDelay: "300ms",
63821
- animationTimingFunction: "ease-out",
63822
- animationIterationCount: 1,
63823
- animationFillMode: "both",
63824
- animationDuration: "150ms"
63825
- }
63826
- },
63827
- /* @__PURE__ */ React.createElement(Emoji, { className: "block pb-5" }, "🤔"),
63828
- /* @__PURE__ */ React.createElement("h3", { className: "font-sans font-normal text-lg block pb-5" }, "Hey, you don't have any fields added to this form."),
63829
- /* @__PURE__ */ React.createElement("p", { className: "block pb-5" }, /* @__PURE__ */ React.createElement(
63830
- "a",
63831
- {
63832
- className: "text-center rounded-3xl border border-solid border-gray-100 shadow-[0_2px_3px_rgba(0,0,0,0.12)] font-normal cursor-pointer text-[12px] transition-all duration-100 ease-out bg-white text-gray-700 py-3 pr-5 pl-14 relative no-underline inline-block hover:text-blue-500",
63833
- href: "https://tinacms.org/docs/fields",
63834
- target: "_blank",
63835
- rel: "noopener noreferrer"
63836
- },
63837
- /* @__PURE__ */ React.createElement(
63838
- Emoji,
63839
- {
63840
- className: "absolute left-5 top-1/2 origin-center -translate-y-1/2 transition-all duration-100 ease-out",
63841
- style: { fontSize: 24 }
63842
- },
63843
- "📖"
63844
- ),
63845
- " ",
63846
- "Field Setup Guide"
63847
- ))
63848
- );
63849
- const FormKeyBindings = ({ onSubmit }) => {
63850
- useEffect(() => {
63851
- const handleKeyDown = (e3) => {
63852
- if ((e3.metaKey || e3.ctrlKey) && e3.key === "s") {
63853
- e3.preventDefault();
63854
- onSubmit();
63855
- }
63856
- };
63857
- window.addEventListener("keydown", handleKeyDown);
63858
- return () => window.removeEventListener("keydown", handleKeyDown);
63859
- }, [onSubmit]);
63860
- return null;
63861
- };
63862
- const FormBuilder = ({
63863
- form,
63864
- onPristineChange,
63865
- ...rest
63866
- }) => {
63867
- const cms = useCMS$1();
63868
- const hideFooter = !!rest.hideFooter;
63869
- const [createBranchModalOpen, setCreateBranchModalOpen] = React.useState(false);
63870
- const tinaForm = form.tinaForm;
63871
- const finalForm = form.tinaForm.finalForm;
63872
- React.useEffect(() => {
63873
- var _a2;
63874
- const collection = cms.api.tina.schema.getCollectionByFullPath(
63875
- tinaForm.path
63876
- );
63877
- if ((_a2 = collection == null ? void 0 : collection.ui) == null ? void 0 : _a2.beforeSubmit) {
63878
- tinaForm.beforeSubmit = (values) => collection.ui.beforeSubmit({ cms, form: tinaForm, values });
63879
- } else {
63880
- tinaForm.beforeSubmit = void 0;
63881
- }
63882
- }, [tinaForm.path]);
63883
- const moveArrayItem = React.useCallback(
63884
- (result) => {
63885
- if (!result.destination || !finalForm)
63886
- return;
63887
- const name = result.type;
63888
- finalForm.mutators.move(
63889
- name,
63890
- result.source.index,
63891
- result.destination.index
63892
- );
63893
- },
63894
- [tinaForm]
63895
- );
63896
- React.useEffect(() => {
63897
- const unsubscribe = finalForm.subscribe(
63898
- ({ pristine }) => {
63899
- if (onPristineChange) {
63900
- onPristineChange(pristine);
63901
- }
63902
- },
63903
- { pristine: true }
63904
- );
63905
- return () => {
63906
- unsubscribe();
63907
- };
63908
- }, [finalForm]);
63909
- const fieldGroup = tinaForm.getActiveField(form.activeFieldName);
63910
- return /* @__PURE__ */ React.createElement(
63911
- Form$1,
63912
- {
63913
- key: tinaForm.id,
63914
- form: tinaForm.finalForm,
63915
- onSubmit: tinaForm.onSubmit
63916
- },
63917
- ({
63918
- handleSubmit,
63919
- pristine,
63920
- invalid,
63921
- submitting,
63922
- dirtySinceLastSubmit,
63923
- hasValidationErrors
63924
- }) => {
63925
- const usingProtectedBranch = cms.api.tina.usingProtectedBranch();
63926
- const canSubmit = !pristine && !submitting && !hasValidationErrors && !(invalid && !dirtySinceLastSubmit);
63927
- const safeSubmit = async () => {
63928
- if (canSubmit) {
63929
- await handleSubmit();
63930
- }
63931
- };
63932
- const safeHandleSubmit = async () => {
63933
- if (usingProtectedBranch) {
63934
- setCreateBranchModalOpen(true);
63935
- } else {
63936
- safeSubmit();
63937
- }
63938
- };
63939
- return /* @__PURE__ */ React.createElement(React.Fragment, null, createBranchModalOpen && /* @__PURE__ */ React.createElement(
63940
- CreateBranchModal,
63941
- {
63942
- safeSubmit,
63943
- crudType: tinaForm.crudType,
63944
- path: tinaForm.path,
63945
- values: tinaForm.values,
63946
- close: () => setCreateBranchModalOpen(false)
63947
- }
63948
- ), /* @__PURE__ */ React.createElement(DragDropContext, { onDragEnd: moveArrayItem }, /* @__PURE__ */ React.createElement(FormKeyBindings, { onSubmit: safeHandleSubmit }), /* @__PURE__ */ React.createElement(FormPortalProvider, null, /* @__PURE__ */ React.createElement(FormWrapper, { id: tinaForm.id }, (tinaForm == null ? void 0 : tinaForm.fields.length) ? /* @__PURE__ */ React.createElement(
63949
- FieldsBuilder,
63950
- {
63951
- form: tinaForm,
63952
- activeFieldName: form.activeFieldName,
63953
- fields: fieldGroup.fields
63954
- }
63955
- ) : /* @__PURE__ */ React.createElement(NoFieldsPlaceholder, null))), !hideFooter && /* @__PURE__ */ React.createElement("div", { className: "relative flex-none w-full h-16 px-6 bg-white border-t border-gray-100 flex items-center justify-end" }, /* @__PURE__ */ React.createElement("div", { className: "flex-1 w-full justify-end gap-2 flex items-center max-w-form" }, tinaForm.reset && /* @__PURE__ */ React.createElement(
63956
- ResetForm,
63957
- {
63958
- pristine,
63959
- reset: async () => {
63960
- finalForm.reset();
63961
- await tinaForm.reset();
63962
- }
63963
- },
63964
- tinaForm.buttons.reset
63965
- ), /* @__PURE__ */ React.createElement(
63966
- Button$1,
63967
- {
63968
- onClick: safeHandleSubmit,
63969
- disabled: !canSubmit,
63970
- busy: submitting,
63971
- variant: "primary"
63972
- },
63973
- submitting && /* @__PURE__ */ React.createElement(LoadingDots, null),
63974
- !submitting && tinaForm.buttons.save
63975
- ), tinaForm.actions.length > 0 && /* @__PURE__ */ React.createElement(
63976
- FormActionMenu,
63977
- {
63978
- form: tinaForm,
63979
- actions: tinaForm.actions
63980
- }
63981
- )))));
63982
- }
63983
- );
63984
- };
63985
- const FormStatus = ({ pristine }) => {
63986
- const pristineClass = pristine ? "text-green-500" : "text-red-500";
63987
- return /* @__PURE__ */ React.createElement(FaCircle, { className: cn("h-3", pristineClass) });
63988
- };
63989
- const FormWrapper = ({
63990
- id: id2,
63991
- children
63992
- }) => {
63993
- return /* @__PURE__ */ React.createElement(
63994
- "div",
63995
- {
63996
- "data-test": `form:${id2 == null ? void 0 : id2.replace(/\\/g, "/")}`,
63997
- className: "h-full overflow-y-auto max-h-full bg-gray-50"
63998
- },
63999
- /* @__PURE__ */ React.createElement("div", { className: "py-5 px-6" }, children)
64000
- );
64001
- };
64002
- const Emoji = ({ className = "", ...props }) => /* @__PURE__ */ React.createElement(
64003
- "span",
64004
- {
64005
- className: `text-[40px] leading-none inline-block ${className}`,
64006
- ...props
64007
- }
64008
- );
64009
- const CreateBranchModel = ({
64010
- close: close2,
64011
- safeSubmit,
64012
- relativePath: relativePath2,
64013
- values,
64014
- crudType
64015
- }) => /* @__PURE__ */ React.createElement(
64016
- CreateBranchModal,
64017
- {
64018
- close: close2,
64019
- safeSubmit,
64020
- path: relativePath2,
64021
- values,
64022
- crudType
64023
- }
64024
- );
64025
63799
  const pathRelativeToCollection = (collectionPath, fullPath) => {
64026
63800
  const normalizedCollectionPath = collectionPath.replace(/\\/g, "/");
64027
63801
  const normalizedFullPath = fullPath.replace(/\\/g, "/");
@@ -64050,7 +63824,6 @@ const CreateBranchModal = ({
64050
63824
  const [isExecuting, setIsExecuting] = React.useState(false);
64051
63825
  const [errorMessage, setErrorMessage] = React.useState("");
64052
63826
  const [currentStep, setCurrentStep] = React.useState(0);
64053
- const [statusMessage, setStatusMessage] = React.useState("");
64054
63827
  const [elapsedTime, setElapsedTime] = React.useState(0);
64055
63828
  React.useEffect(() => {
64056
63829
  let interval;
@@ -64094,7 +63867,6 @@ const CreateBranchModal = ({
64094
63867
  setDisabled(true);
64095
63868
  setIsExecuting(true);
64096
63869
  setCurrentStep(1);
64097
- setStatusMessage("Initializing workflow...");
64098
63870
  let graphql2 = "";
64099
63871
  if (crudType === "create") {
64100
63872
  graphql2 = CREATE_DOCUMENT_GQL;
@@ -64119,8 +63891,6 @@ const CreateBranchModal = ({
64119
63891
  }
64120
63892
  },
64121
63893
  onStatusUpdate: (status) => {
64122
- const message = status.message || `Status: ${status.status}`;
64123
- setStatusMessage(message);
64124
63894
  switch (status.status) {
64125
63895
  case EDITORIAL_WORKFLOW_STATUS.SETTING_UP:
64126
63896
  case EDITORIAL_WORKFLOW_STATUS.CREATING_BRANCH:
@@ -64157,9 +63927,7 @@ const CreateBranchModal = ({
64157
63927
  }
64158
63928
  };
64159
63929
  const renderProgressIndicator = () => {
64160
- var _a2;
64161
- const progressPercentage = (currentStep - 1) / steps.length * 100;
64162
- return /* @__PURE__ */ React.createElement("div", { className: "py-6" }, /* @__PURE__ */ React.createElement("div", { className: "flex justify-between mb-4 relative px-5 sm:gap-x-8" }, /* @__PURE__ */ React.createElement(
63930
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", { className: "flex justify-between my-8 relative px-5 sm:gap-x-8" }, /* @__PURE__ */ React.createElement(
64163
63931
  "div",
64164
63932
  {
64165
63933
  className: "absolute top-5 h-0.5 bg-gray-200 -z-10",
@@ -64168,7 +63936,7 @@ const CreateBranchModal = ({
64168
63936
  ), currentStep > 1 && currentStep <= steps.length && /* @__PURE__ */ React.createElement(
64169
63937
  "div",
64170
63938
  {
64171
- className: "absolute top-5 h-0.5 bg-blue-500 -z-10 transition-all duration-500",
63939
+ className: "absolute top-5 h-0.5 bg-tina-orange -z-10 transition-all duration-500",
64172
63940
  style: {
64173
63941
  left: "50px",
64174
63942
  width: `calc((100% - 100px) * ${(currentStep - 1) / (steps.length - 1)})`
@@ -64196,7 +63964,7 @@ const CreateBranchModal = ({
64196
63964
  /* @__PURE__ */ React.createElement(
64197
63965
  "div",
64198
63966
  {
64199
- className: `w-10 h-10 rounded-full flex items-center justify-center font-medium mb-3 border-2 transition-all duration-300 ${isCompleted ? "bg-green-500 border-green-500 text-white" : isActive ? "bg-blue-500 border-blue-500 text-white" : "bg-white border-gray-200 text-gray-400"}`
63967
+ className: `w-10 h-10 rounded-full flex items-center justify-center font-medium mb-3 border-2 transition-all duration-300 select-none ${isCompleted ? "bg-green-500 border-green-500 text-white" : isActive ? "bg-tina-orange border-tina-orange text-white" : "bg-white border-gray-200 text-gray-400"}`
64200
63968
  },
64201
63969
  isCompleted ? /* @__PURE__ */ React.createElement(
64202
63970
  "svg",
@@ -64217,7 +63985,7 @@ const CreateBranchModal = ({
64217
63985
  ),
64218
63986
  /* @__PURE__ */ React.createElement("div", { className: "text-center max-w-24" }, /* @__PURE__ */ React.createElement("div", { className: "text-sm font-semibold leading-tight" }, step.name), /* @__PURE__ */ React.createElement("div", { className: "text-xs text-gray-400 mt-1 leading-tight" }, step.description))
64219
63987
  );
64220
- })), /* @__PURE__ */ React.createElement("div", { className: "flex items-center justify-between mb-4" }, /* @__PURE__ */ React.createElement("div", { className: "text-sm font-medium text-gray-700" }, "Step ", currentStep > steps.length ? steps.length : currentStep, " of", " ", steps.length), isExecuting && currentStep > 0 && /* @__PURE__ */ React.createElement("div", { className: "flex items-center gap-1 text-sm text-gray-500" }, /* @__PURE__ */ React.createElement("svg", { className: "w-4 h-4", fill: "currentColor", viewBox: "0 0 20 20" }, /* @__PURE__ */ React.createElement(
63988
+ })), /* @__PURE__ */ React.createElement("div", { className: "flex items-center justify-between" }, /* @__PURE__ */ React.createElement("div", { className: "text-xs text-gray-500" }, "Estimated time: 1-2 min "), isExecuting && currentStep > 0 && /* @__PURE__ */ React.createElement("div", { className: "flex items-center gap-1 text-sm text-gray-500" }, /* @__PURE__ */ React.createElement("svg", { className: "w-4 h-4", fill: "currentColor", viewBox: "0 0 20 20" }, /* @__PURE__ */ React.createElement(
64221
63989
  "path",
64222
63990
  {
64223
63991
  fillRule: "evenodd",
@@ -64225,34 +63993,20 @@ const CreateBranchModal = ({
64225
63993
  clipRule: "evenodd"
64226
63994
  }
64227
63995
  )), formatTime(elapsedTime))), /* @__PURE__ */ React.createElement(
64228
- ProgressBar,
64229
- {
64230
- progress: progressPercentage,
64231
- className: "mb-4",
64232
- color: currentStep > steps.length ? "green" : "blue"
64233
- }
64234
- ), /* @__PURE__ */ React.createElement("div", { className: "flex items-center gap-2 mb-2" }, currentStep >= 4 ? /* @__PURE__ */ React.createElement(
64235
- "svg",
63996
+ "a",
64236
63997
  {
64237
- className: "w-4 h-4 text-green-500",
64238
- fill: "currentColor",
64239
- viewBox: "0 0 20 20"
63998
+ className: "underline text-tina-orange-dark font-medium text-xs",
63999
+ href: "https://tina.io/docs/tinacloud/editorial-workflow",
64000
+ target: "_blank"
64240
64001
  },
64241
- /* @__PURE__ */ React.createElement(
64242
- "path",
64243
- {
64244
- fillRule: "evenodd",
64245
- d: "M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",
64246
- clipRule: "evenodd"
64247
- }
64248
- )
64249
- ) : /* @__PURE__ */ React.createElement(AiOutlineLoading, { className: "text-blue-500 animate-spin" }), /* @__PURE__ */ React.createElement("span", { className: "text-sm font-medium text-gray-700" }, statusMessage || `${(_a2 = steps[currentStep - 1]) == null ? void 0 : _a2.name}...`)), /* @__PURE__ */ React.createElement("div", { className: "text-left" }, /* @__PURE__ */ React.createElement("p", { className: "text-xs text-gray-500" }, "Estimated time: 1-2 minutes")));
64002
+ "Learn more about Editorial Workflow"
64003
+ ));
64250
64004
  };
64251
64005
  const renderStateContent = () => {
64252
64006
  if (isExecuting) {
64253
64007
  return renderProgressIndicator();
64254
64008
  } else {
64255
- return /* @__PURE__ */ React.createElement("div", { className: "max-w-sm" }, errorMessage && /* @__PURE__ */ React.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.createElement(BiError, { className: "w-5 h-auto text-red-400 flex-shrink-0" }), /* @__PURE__ */ React.createElement("span", { className: "text-sm" }, /* @__PURE__ */ React.createElement("b", null, "Error:"), " ", errorMessage)), /* @__PURE__ */ React.createElement("p", { className: "text-lg text-gray-700 font-bold mb-2" }, "First, let's create a copy"), /* @__PURE__ */ React.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.createElement(
64009
+ return /* @__PURE__ */ React.createElement("div", { className: "max-w-sm" }, errorMessage && /* @__PURE__ */ React.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.createElement(BiError, { className: "w-5 h-auto text-red-400 flex-shrink-0" }), /* @__PURE__ */ React.createElement("span", { className: "text-sm" }, /* @__PURE__ */ React.createElement("b", null, "Error:"), " ", errorMessage)), /* @__PURE__ */ React.createElement("p", { className: "text-lg text-gray-700 font-bold mb-2" }, "First, let's create a copy"), /* @__PURE__ */ React.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.createElement("br", null), /* @__PURE__ */ React.createElement("br", null), /* @__PURE__ */ React.createElement("span", { className: "text-gray-500" }, "Learn more about "), /* @__PURE__ */ React.createElement(
64256
64010
  "a",
64257
64011
  {
64258
64012
  className: "underline text-tina-orange-dark font-medium",
@@ -64260,7 +64014,7 @@ const CreateBranchModal = ({
64260
64014
  target: "_blank"
64261
64015
  },
64262
64016
  "Editorial Workflow"
64263
- )), /* @__PURE__ */ React.createElement(
64017
+ ), "."), /* @__PURE__ */ React.createElement(
64264
64018
  PrefixedTextField,
64265
64019
  {
64266
64020
  name: "new-branch-name",
@@ -64269,7 +64023,6 @@ const CreateBranchModal = ({
64269
64023
  value: newBranchName,
64270
64024
  onChange: (e3) => {
64271
64025
  setErrorMessage("");
64272
- setStatusMessage("");
64273
64026
  setNewBranchName(e3.target.value);
64274
64027
  }
64275
64028
  }
@@ -64320,6 +64073,217 @@ const PrefixedTextField = ({
64320
64073
  }
64321
64074
  )));
64322
64075
  };
64076
+ const NoFieldsPlaceholder = () => /* @__PURE__ */ React.createElement(
64077
+ "div",
64078
+ {
64079
+ className: "relative flex flex-col items-center justify-center text-center p-5 pb-16 w-full h-full overflow-y-auto",
64080
+ style: {
64081
+ animationName: "fade-in",
64082
+ animationDelay: "300ms",
64083
+ animationTimingFunction: "ease-out",
64084
+ animationIterationCount: 1,
64085
+ animationFillMode: "both",
64086
+ animationDuration: "150ms"
64087
+ }
64088
+ },
64089
+ /* @__PURE__ */ React.createElement(Emoji, { className: "block pb-5" }, "🤔"),
64090
+ /* @__PURE__ */ React.createElement("h3", { className: "font-sans font-normal text-lg block pb-5" }, "Hey, you don't have any fields added to this form."),
64091
+ /* @__PURE__ */ React.createElement("p", { className: "block pb-5" }, /* @__PURE__ */ React.createElement(
64092
+ "a",
64093
+ {
64094
+ 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",
64095
+ href: "https://tinacms.org/docs/fields",
64096
+ target: "_blank",
64097
+ rel: "noopener noreferrer"
64098
+ },
64099
+ /* @__PURE__ */ React.createElement(
64100
+ Emoji,
64101
+ {
64102
+ className: "absolute left-5 top-1/2 origin-center -translate-y-1/2 transition-all duration-100 ease-out",
64103
+ style: { fontSize: 24 }
64104
+ },
64105
+ "📖"
64106
+ ),
64107
+ " ",
64108
+ "Field Setup Guide"
64109
+ ))
64110
+ );
64111
+ const FormKeyBindings = ({ onSubmit }) => {
64112
+ useEffect(() => {
64113
+ const handleKeyDown = (e3) => {
64114
+ if ((e3.metaKey || e3.ctrlKey) && e3.key === "s") {
64115
+ e3.preventDefault();
64116
+ onSubmit();
64117
+ }
64118
+ };
64119
+ window.addEventListener("keydown", handleKeyDown);
64120
+ return () => window.removeEventListener("keydown", handleKeyDown);
64121
+ }, [onSubmit]);
64122
+ return null;
64123
+ };
64124
+ const FormBuilder = ({
64125
+ form,
64126
+ onPristineChange,
64127
+ ...rest
64128
+ }) => {
64129
+ const cms = useCMS$1();
64130
+ const hideFooter = !!rest.hideFooter;
64131
+ const [createBranchModalOpen, setCreateBranchModalOpen] = React.useState(false);
64132
+ const tinaForm = form.tinaForm;
64133
+ const finalForm = form.tinaForm.finalForm;
64134
+ React.useEffect(() => {
64135
+ var _a2;
64136
+ const collection = cms.api.tina.schema.getCollectionByFullPath(
64137
+ tinaForm.path
64138
+ );
64139
+ if ((_a2 = collection == null ? void 0 : collection.ui) == null ? void 0 : _a2.beforeSubmit) {
64140
+ tinaForm.beforeSubmit = (values) => collection.ui.beforeSubmit({ cms, form: tinaForm, values });
64141
+ } else {
64142
+ tinaForm.beforeSubmit = void 0;
64143
+ }
64144
+ }, [tinaForm.path]);
64145
+ const moveArrayItem = React.useCallback(
64146
+ (result) => {
64147
+ if (!result.destination || !finalForm)
64148
+ return;
64149
+ const name = result.type;
64150
+ finalForm.mutators.move(
64151
+ name,
64152
+ result.source.index,
64153
+ result.destination.index
64154
+ );
64155
+ },
64156
+ [tinaForm]
64157
+ );
64158
+ React.useEffect(() => {
64159
+ const unsubscribe = finalForm.subscribe(
64160
+ ({ pristine }) => {
64161
+ if (onPristineChange) {
64162
+ onPristineChange(pristine);
64163
+ }
64164
+ },
64165
+ { pristine: true }
64166
+ );
64167
+ return () => {
64168
+ unsubscribe();
64169
+ };
64170
+ }, [finalForm]);
64171
+ const fieldGroup = tinaForm.getActiveField(form.activeFieldName);
64172
+ return /* @__PURE__ */ React.createElement(
64173
+ Form$1,
64174
+ {
64175
+ key: tinaForm.id,
64176
+ form: tinaForm.finalForm,
64177
+ onSubmit: tinaForm.onSubmit
64178
+ },
64179
+ ({
64180
+ handleSubmit,
64181
+ pristine,
64182
+ invalid,
64183
+ submitting,
64184
+ dirtySinceLastSubmit,
64185
+ hasValidationErrors
64186
+ }) => {
64187
+ const usingProtectedBranch = cms.api.tina.usingProtectedBranch();
64188
+ const canSubmit = !pristine && !submitting && !hasValidationErrors && !(invalid && !dirtySinceLastSubmit);
64189
+ const safeSubmit = async () => {
64190
+ if (canSubmit) {
64191
+ await handleSubmit();
64192
+ }
64193
+ };
64194
+ const safeHandleSubmit = async () => {
64195
+ if (usingProtectedBranch) {
64196
+ setCreateBranchModalOpen(true);
64197
+ } else {
64198
+ safeSubmit();
64199
+ }
64200
+ };
64201
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, createBranchModalOpen && /* @__PURE__ */ React.createElement(
64202
+ CreateBranchModal,
64203
+ {
64204
+ safeSubmit,
64205
+ crudType: tinaForm.crudType,
64206
+ path: tinaForm.path,
64207
+ values: tinaForm.values,
64208
+ close: () => setCreateBranchModalOpen(false)
64209
+ }
64210
+ ), /* @__PURE__ */ React.createElement(DragDropContext, { onDragEnd: moveArrayItem }, /* @__PURE__ */ React.createElement(FormKeyBindings, { onSubmit: safeHandleSubmit }), /* @__PURE__ */ React.createElement(FormPortalProvider, null, /* @__PURE__ */ React.createElement(FormWrapper, { id: tinaForm.id }, (tinaForm == null ? void 0 : tinaForm.fields.length) ? /* @__PURE__ */ React.createElement(
64211
+ FieldsBuilder,
64212
+ {
64213
+ form: tinaForm,
64214
+ activeFieldName: form.activeFieldName,
64215
+ fields: fieldGroup.fields
64216
+ }
64217
+ ) : /* @__PURE__ */ React.createElement(NoFieldsPlaceholder, null))), !hideFooter && /* @__PURE__ */ React.createElement("div", { className: "relative flex-none w-full h-16 px-6 bg-white border-t border-gray-100 flex items-center justify-end" }, /* @__PURE__ */ React.createElement("div", { className: "flex-1 w-full justify-end gap-2 flex items-center max-w-form" }, tinaForm.reset && /* @__PURE__ */ React.createElement(
64218
+ ResetForm,
64219
+ {
64220
+ pristine,
64221
+ reset: async () => {
64222
+ finalForm.reset();
64223
+ await tinaForm.reset();
64224
+ }
64225
+ },
64226
+ tinaForm.buttons.reset
64227
+ ), /* @__PURE__ */ React.createElement(
64228
+ Button$1,
64229
+ {
64230
+ onClick: safeHandleSubmit,
64231
+ disabled: !canSubmit,
64232
+ busy: submitting,
64233
+ variant: "primary"
64234
+ },
64235
+ submitting && /* @__PURE__ */ React.createElement(LoadingDots, null),
64236
+ !submitting && tinaForm.buttons.save
64237
+ ), tinaForm.actions.length > 0 && /* @__PURE__ */ React.createElement(
64238
+ FormActionMenu,
64239
+ {
64240
+ form: tinaForm,
64241
+ actions: tinaForm.actions
64242
+ }
64243
+ )))));
64244
+ }
64245
+ );
64246
+ };
64247
+ const FormStatus = ({ pristine }) => {
64248
+ const pristineClass = pristine ? "text-green-500" : "text-red-500";
64249
+ return /* @__PURE__ */ React.createElement(FaCircle, { className: cn("h-3", pristineClass) });
64250
+ };
64251
+ const FormWrapper = ({
64252
+ id: id2,
64253
+ children
64254
+ }) => {
64255
+ return /* @__PURE__ */ React.createElement(
64256
+ "div",
64257
+ {
64258
+ "data-test": `form:${id2 == null ? void 0 : id2.replace(/\\/g, "/")}`,
64259
+ className: "h-full overflow-y-auto max-h-full bg-gray-50"
64260
+ },
64261
+ /* @__PURE__ */ React.createElement("div", { className: "py-5 px-6" }, children)
64262
+ );
64263
+ };
64264
+ const Emoji = ({ className = "", ...props }) => /* @__PURE__ */ React.createElement(
64265
+ "span",
64266
+ {
64267
+ className: `text-[40px] leading-none inline-block ${className}`,
64268
+ ...props
64269
+ }
64270
+ );
64271
+ const CreateBranchModel = ({
64272
+ close: close2,
64273
+ safeSubmit,
64274
+ relativePath: relativePath2,
64275
+ values,
64276
+ crudType
64277
+ }) => /* @__PURE__ */ React.createElement(
64278
+ CreateBranchModal,
64279
+ {
64280
+ close: close2,
64281
+ safeSubmit,
64282
+ path: relativePath2,
64283
+ values,
64284
+ crudType
64285
+ }
64286
+ );
64323
64287
  const NestedForm = (props) => {
64324
64288
  const FormPortal = useFormPortal();
64325
64289
  const id2 = React__default.useMemo(() => uuid(), [props.id, props.initialValues]);
@@ -121066,7 +121030,7 @@ const CollectionListPage = () => {
121066
121030
  },
121067
121031
  close: () => setFolderModalOpen(false)
121068
121032
  }
121069
- ), /* @__PURE__ */ React__default.createElement(PageHeader, null, /* @__PURE__ */ React__default.createElement("div", { className: "w-full" }, /* @__PURE__ */ React__default.createElement("h3", { className: "font-sans text-2xl text-tina-orange" }, collection.label ? collection.label : collection.name), /* @__PURE__ */ React__default.createElement("div", { className: "flex flex-col lg:flex-row justify-between lg:items-end pt-2" }, /* @__PURE__ */ React__default.createElement("div", { className: "flex flex-col md:flex-row gap-2 md:gap-4 items-baseline" }, (fields == null ? void 0 : fields.length) > 0 && /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, !search && /* @__PURE__ */ React__default.createElement("div", { className: "flex flex-col gap-2 items-start w-full md:w-auto" }, /* @__PURE__ */ React__default.createElement(
121033
+ ), /* @__PURE__ */ React__default.createElement(PageHeader, null, /* @__PURE__ */ React__default.createElement("div", { className: "w-full mx-auto max-w-screen-xl" }, /* @__PURE__ */ React__default.createElement("h3", { className: "font-sans text-2xl text-tina-orange" }, collection.label ? collection.label : collection.name), /* @__PURE__ */ React__default.createElement("div", { className: "flex flex-col lg:flex-row justify-between lg:items-end pt-2" }, /* @__PURE__ */ React__default.createElement("div", { className: "flex flex-col md:flex-row gap-2 md:gap-4 items-baseline" }, (fields == null ? void 0 : fields.length) > 0 && /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, !search && /* @__PURE__ */ React__default.createElement("div", { className: "flex flex-col gap-2 items-start w-full md:w-auto" }, /* @__PURE__ */ React__default.createElement(
121070
121034
  "label",
121071
121035
  {
121072
121036
  htmlFor: "sort",