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