tinacms 2.1.0 → 2.1.1
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 +258 -92
- package/dist/index.mjs +262 -90
- package/dist/lib/utils.d.ts +2 -0
- package/dist/toolkit/fields/components/reference/components/button.d.ts +11 -0
- package/dist/toolkit/fields/components/reference/components/command.d.ts +67 -0
- package/dist/toolkit/fields/components/reference/components/popover.d.ts +6 -0
- package/dist/toolkit/fields/components/reference/reference-select.d.ts +4 -4
- package/package.json +11 -4
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
(function(global, factory) {
|
|
2
|
-
typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("zod"), require("react"), require("react-dom"), require("@udecode/plate-headless"), require("@monaco-editor/react"), require("slate-react"), require("@headlessui/react"), require("slate"), require("final-form-arrays"), require("final-form-set-field-data"), require("final-form"), require("react-final-form"), require("prop-types"), require("react-beautiful-dnd"), require("@radix-ui/react-popover"), require("react-color"), require("color-string"), require("react-dropzone"), require("lodash.get"), require("moment"), require("date-fns"), require("is-hotkey"), require("@floating-ui/dom"), require("@react-hook/window-size"), require("graphql"), require("graphql-tag"), require("@tinacms/schema-tools"), require("yup"), require("@graphql-inspector/core"), require("react-router-dom"), require("@tinacms/mdx")) : typeof define === "function" && define.amd ? define(["exports", "zod", "react", "react-dom", "@udecode/plate-headless", "@monaco-editor/react", "slate-react", "@headlessui/react", "slate", "final-form-arrays", "final-form-set-field-data", "final-form", "react-final-form", "prop-types", "react-beautiful-dnd", "@radix-ui/react-popover", "react-color", "color-string", "react-dropzone", "lodash.get", "moment", "date-fns", "is-hotkey", "@floating-ui/dom", "@react-hook/window-size", "graphql", "graphql-tag", "@tinacms/schema-tools", "yup", "@graphql-inspector/core", "react-router-dom", "@tinacms/mdx"], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(global.tinacms = {}, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP));
|
|
3
|
-
})(this, function(exports2, zod, React, reactDom, plateHeadless, MonacoEditor, slateReact, react, slate, arrayMutators, setFieldData, finalForm, reactFinalForm, PropTypes, reactBeautifulDnd,
|
|
2
|
+
typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("zod"), require("react"), require("react-dom"), require("@udecode/plate-headless"), require("@monaco-editor/react"), require("slate-react"), require("@headlessui/react"), require("slate"), require("final-form-arrays"), require("final-form-set-field-data"), require("final-form"), require("react-final-form"), require("prop-types"), require("react-beautiful-dnd"), require("@radix-ui/react-popover"), require("react-color"), require("color-string"), require("react-dropzone"), require("@radix-ui/react-slot"), require("class-variance-authority"), require("clsx"), require("tailwind-merge"), require("cmdk"), require("lucide-react"), require("lodash.get"), require("moment"), require("date-fns"), require("is-hotkey"), require("@floating-ui/dom"), require("@react-hook/window-size"), require("graphql"), require("graphql-tag"), require("@tinacms/schema-tools"), require("yup"), require("@graphql-inspector/core"), require("react-router-dom"), require("@tinacms/mdx")) : typeof define === "function" && define.amd ? define(["exports", "zod", "react", "react-dom", "@udecode/plate-headless", "@monaco-editor/react", "slate-react", "@headlessui/react", "slate", "final-form-arrays", "final-form-set-field-data", "final-form", "react-final-form", "prop-types", "react-beautiful-dnd", "@radix-ui/react-popover", "react-color", "color-string", "react-dropzone", "@radix-ui/react-slot", "class-variance-authority", "clsx", "tailwind-merge", "cmdk", "lucide-react", "lodash.get", "moment", "date-fns", "is-hotkey", "@floating-ui/dom", "@react-hook/window-size", "graphql", "graphql-tag", "@tinacms/schema-tools", "yup", "@graphql-inspector/core", "react-router-dom", "@tinacms/mdx"], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(global.tinacms = {}, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP));
|
|
3
|
+
})(this, function(exports2, zod, React, reactDom, plateHeadless, MonacoEditor, slateReact, react, slate, arrayMutators, setFieldData, finalForm, reactFinalForm, PropTypes, reactBeautifulDnd, PopoverPrimitive, pkg$1, pkg, dropzone, reactSlot, classVarianceAuthority, clsx, tailwindMerge, cmdk, lucideReact, get, moment, dateFns, isHotkey, dom, windowSize, graphql, gql, schemaTools, yup, core, reactRouterDom, mdx) {
|
|
4
4
|
"use strict";var __defProp = Object.defineProperty;
|
|
5
5
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
6
|
var __publicField = (obj, key, value) => {
|
|
@@ -25,7 +25,7 @@ var __publicField = (obj, key, value) => {
|
|
|
25
25
|
return Object.freeze(n);
|
|
26
26
|
}
|
|
27
27
|
const React__namespace = /* @__PURE__ */ _interopNamespaceDefault(React);
|
|
28
|
-
const
|
|
28
|
+
const PopoverPrimitive__namespace = /* @__PURE__ */ _interopNamespaceDefault(PopoverPrimitive);
|
|
29
29
|
const pkg__namespace$1 = /* @__PURE__ */ _interopNamespaceDefault(pkg$1);
|
|
30
30
|
const pkg__namespace = /* @__PURE__ */ _interopNamespaceDefault(pkg);
|
|
31
31
|
const dropzone__namespace = /* @__PURE__ */ _interopNamespaceDefault(dropzone);
|
|
@@ -2428,7 +2428,7 @@ var __publicField = (obj, key, value) => {
|
|
|
2428
2428
|
Component: PropTypes.any.isRequired,
|
|
2429
2429
|
children: PropTypes.any
|
|
2430
2430
|
};
|
|
2431
|
-
const Button = ({
|
|
2431
|
+
const Button$1 = ({
|
|
2432
2432
|
variant = "secondary",
|
|
2433
2433
|
as: Tag2 = "button",
|
|
2434
2434
|
size = "medium",
|
|
@@ -2532,8 +2532,8 @@ var __publicField = (obj, key, value) => {
|
|
|
2532
2532
|
return classes.filter(Boolean).join(" ");
|
|
2533
2533
|
}
|
|
2534
2534
|
const OverflowMenu$1 = ({ toolbarItems, className = "w-full" }) => {
|
|
2535
|
-
return /* @__PURE__ */ React.createElement(
|
|
2536
|
-
|
|
2535
|
+
return /* @__PURE__ */ React.createElement(PopoverPrimitive__namespace.Root, null, /* @__PURE__ */ React.createElement(
|
|
2536
|
+
PopoverPrimitive__namespace.Trigger,
|
|
2537
2537
|
{
|
|
2538
2538
|
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}}`
|
|
2539
2539
|
},
|
|
@@ -2556,7 +2556,7 @@ var __publicField = (obj, key, value) => {
|
|
|
2556
2556
|
}
|
|
2557
2557
|
)
|
|
2558
2558
|
)
|
|
2559
|
-
), /* @__PURE__ */ React.createElement(
|
|
2559
|
+
), /* @__PURE__ */ React.createElement(PopoverPrimitive__namespace.Portal, null, /* @__PURE__ */ React.createElement(PopoverPrimitive__namespace.Content, { style: { zIndex: 2e4 }, align: "end" }, /* @__PURE__ */ React.createElement("div", { className: "mt-0 -mr-1 rounded-md shadow-lg bg-white ring-1 ring-black ring-opacity-5 py-1" }, toolbarItems.map((toolbarItem) => {
|
|
2560
2560
|
return /* @__PURE__ */ React.createElement(
|
|
2561
2561
|
"span",
|
|
2562
2562
|
{
|
|
@@ -2967,7 +2967,7 @@ var __publicField = (obj, key, value) => {
|
|
|
2967
2967
|
}) => {
|
|
2968
2968
|
const [open2, setOpen] = React__namespace.useState(false);
|
|
2969
2969
|
return /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, /* @__PURE__ */ React__namespace.createElement(
|
|
2970
|
-
Button,
|
|
2970
|
+
Button$1,
|
|
2971
2971
|
{
|
|
2972
2972
|
onClick: () => {
|
|
2973
2973
|
setOpen((p) => !p);
|
|
@@ -2979,8 +2979,8 @@ var __publicField = (obj, key, value) => {
|
|
|
2979
2979
|
), open2 && /* @__PURE__ */ React__namespace.createElement(ResetModal, { reset, close: () => setOpen(false) }));
|
|
2980
2980
|
};
|
|
2981
2981
|
const ResetModal = ({ close: close2, reset }) => {
|
|
2982
|
-
return /* @__PURE__ */ React__namespace.createElement(Modal, null, /* @__PURE__ */ React__namespace.createElement(ModalPopup, null, /* @__PURE__ */ React__namespace.createElement(ModalHeader, { close: close2 }, "Reset"), /* @__PURE__ */ React__namespace.createElement(ModalBody, { padded: true }, /* @__PURE__ */ React__namespace.createElement("p", null, "Are you sure you want to reset all changes?")), /* @__PURE__ */ React__namespace.createElement(ModalActions, null, /* @__PURE__ */ React__namespace.createElement(Button, { style: { flexGrow: 2 }, onClick: close2 }, "Cancel"), /* @__PURE__ */ React__namespace.createElement(
|
|
2983
|
-
Button,
|
|
2982
|
+
return /* @__PURE__ */ React__namespace.createElement(Modal, null, /* @__PURE__ */ React__namespace.createElement(ModalPopup, null, /* @__PURE__ */ React__namespace.createElement(ModalHeader, { close: close2 }, "Reset"), /* @__PURE__ */ React__namespace.createElement(ModalBody, { padded: true }, /* @__PURE__ */ React__namespace.createElement("p", null, "Are you sure you want to reset all changes?")), /* @__PURE__ */ React__namespace.createElement(ModalActions, null, /* @__PURE__ */ React__namespace.createElement(Button$1, { style: { flexGrow: 2 }, onClick: close2 }, "Cancel"), /* @__PURE__ */ React__namespace.createElement(
|
|
2983
|
+
Button$1,
|
|
2984
2984
|
{
|
|
2985
2985
|
style: { flexGrow: 3 },
|
|
2986
2986
|
variant: "primary",
|
|
@@ -3111,6 +3111,12 @@ var __publicField = (obj, key, value) => {
|
|
|
3111
3111
|
...props
|
|
3112
3112
|
}
|
|
3113
3113
|
);
|
|
3114
|
+
function IoMdArrowDropdown(props) {
|
|
3115
|
+
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 512 512" }, "child": [{ "tag": "path", "attr": { "d": "M128 192l128 128 128-128z" }, "child": [] }] })(props);
|
|
3116
|
+
}
|
|
3117
|
+
function IoMdArrowDropup(props) {
|
|
3118
|
+
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 512 512" }, "child": [{ "tag": "path", "attr": { "d": "M128 320l128-128 128 128z" }, "child": [] }] })(props);
|
|
3119
|
+
}
|
|
3114
3120
|
function IoMdClose(props) {
|
|
3115
3121
|
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 512 512" }, "child": [{ "tag": "path", "attr": { "d": "M405 136.798L375.202 107 256 226.202 136.798 107 107 136.798 226.202 256 107 375.202 136.798 405 256 285.798 375.202 405 405 375.202 285.798 256z" }, "child": [] }] })(props);
|
|
3116
3122
|
}
|
|
@@ -3282,7 +3288,7 @@ var __publicField = (obj, key, value) => {
|
|
|
3282
3288
|
!colorRGBA ? "Click to add color" : ColorFormatter[colorFormat].getLabel(colorRGBA)
|
|
3283
3289
|
)
|
|
3284
3290
|
);
|
|
3285
|
-
const Popover = ({
|
|
3291
|
+
const Popover$1 = ({
|
|
3286
3292
|
triggerBoundingBox,
|
|
3287
3293
|
openTop,
|
|
3288
3294
|
className = "",
|
|
@@ -3410,7 +3416,7 @@ var __publicField = (obj, key, value) => {
|
|
|
3410
3416
|
colorFormat: getColorFormat
|
|
3411
3417
|
}
|
|
3412
3418
|
), displayColorPicker && /* @__PURE__ */ React__namespace.createElement(FormPortal, null, ({ zIndexShift }) => /* @__PURE__ */ React__namespace.createElement(
|
|
3413
|
-
Popover,
|
|
3419
|
+
Popover$1,
|
|
3414
3420
|
{
|
|
3415
3421
|
openTop,
|
|
3416
3422
|
triggerBoundingBox,
|
|
@@ -3791,6 +3797,128 @@ var __publicField = (obj, key, value) => {
|
|
|
3791
3797
|
return /* @__PURE__ */ React__namespace.createElement(IconButton, { variant: "white", className: "flex-none", onClick }, /* @__PURE__ */ React__namespace.createElement(TrashIcon, { className: "w-7 h-auto" }));
|
|
3792
3798
|
};
|
|
3793
3799
|
const ImageLoadingIndicator = () => /* @__PURE__ */ React__namespace.createElement("div", { className: "p-4 w-full min-h-[96px] flex flex-col justify-center items-center" }, /* @__PURE__ */ React__namespace.createElement(LoadingDots, null));
|
|
3800
|
+
function cn(...inputs) {
|
|
3801
|
+
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
3802
|
+
}
|
|
3803
|
+
const buttonVariants = classVarianceAuthority.cva(
|
|
3804
|
+
"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
|
|
3805
|
+
{
|
|
3806
|
+
variants: {
|
|
3807
|
+
variant: {
|
|
3808
|
+
outline: "border border-gray-200 bg-white hover:bg-white hover:text-accent-foreground"
|
|
3809
|
+
},
|
|
3810
|
+
size: {
|
|
3811
|
+
default: "h-10 px-4 py-2",
|
|
3812
|
+
sm: "h-9 rounded-md px-3",
|
|
3813
|
+
lg: "h-11 rounded-md px-8",
|
|
3814
|
+
icon: "h-10 w-10"
|
|
3815
|
+
}
|
|
3816
|
+
},
|
|
3817
|
+
defaultVariants: {
|
|
3818
|
+
variant: "outline",
|
|
3819
|
+
size: "default"
|
|
3820
|
+
}
|
|
3821
|
+
}
|
|
3822
|
+
);
|
|
3823
|
+
const Button = React__namespace.forwardRef(
|
|
3824
|
+
({ className, variant, size, asChild = false, ...props }, ref) => {
|
|
3825
|
+
const Comp = asChild ? reactSlot.Slot : "button";
|
|
3826
|
+
return /* @__PURE__ */ React__namespace.createElement(
|
|
3827
|
+
Comp,
|
|
3828
|
+
{
|
|
3829
|
+
className: cn(buttonVariants({ variant, size, className })),
|
|
3830
|
+
ref,
|
|
3831
|
+
...props
|
|
3832
|
+
}
|
|
3833
|
+
);
|
|
3834
|
+
}
|
|
3835
|
+
);
|
|
3836
|
+
Button.displayName = "Button";
|
|
3837
|
+
const Command = React__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React__namespace.createElement(
|
|
3838
|
+
cmdk.Command,
|
|
3839
|
+
{
|
|
3840
|
+
ref,
|
|
3841
|
+
className: cn(
|
|
3842
|
+
"flex h-full w-full flex-col overflow-hidden rounded-md bg-white text-popover-foreground",
|
|
3843
|
+
className
|
|
3844
|
+
),
|
|
3845
|
+
...props
|
|
3846
|
+
}
|
|
3847
|
+
));
|
|
3848
|
+
Command.displayName = cmdk.Command.displayName;
|
|
3849
|
+
const CommandInput = React__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React__namespace.createElement("div", { className: "flex items-center border-b px-3", "cmdk-input-wrapper": "" }, /* @__PURE__ */ React__namespace.createElement(lucideReact.Search, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }), /* @__PURE__ */ React__namespace.createElement(
|
|
3850
|
+
cmdk.Command.Input,
|
|
3851
|
+
{
|
|
3852
|
+
ref,
|
|
3853
|
+
className: cn(
|
|
3854
|
+
"flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",
|
|
3855
|
+
className
|
|
3856
|
+
),
|
|
3857
|
+
...props
|
|
3858
|
+
}
|
|
3859
|
+
)));
|
|
3860
|
+
CommandInput.displayName = cmdk.Command.Input.displayName;
|
|
3861
|
+
const CommandList = React__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React__namespace.createElement(
|
|
3862
|
+
cmdk.Command.List,
|
|
3863
|
+
{
|
|
3864
|
+
ref,
|
|
3865
|
+
className: cn("overflow-x-hidden", className),
|
|
3866
|
+
...props
|
|
3867
|
+
}
|
|
3868
|
+
));
|
|
3869
|
+
CommandList.displayName = cmdk.Command.List.displayName;
|
|
3870
|
+
const CommandEmpty = React__namespace.forwardRef((props, ref) => /* @__PURE__ */ React__namespace.createElement(
|
|
3871
|
+
cmdk.Command.Empty,
|
|
3872
|
+
{
|
|
3873
|
+
ref,
|
|
3874
|
+
className: "py-6 text-center text-sm",
|
|
3875
|
+
...props
|
|
3876
|
+
}
|
|
3877
|
+
));
|
|
3878
|
+
CommandEmpty.displayName = cmdk.Command.Empty.displayName;
|
|
3879
|
+
const CommandGroup = React__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React__namespace.createElement(
|
|
3880
|
+
cmdk.Command.Group,
|
|
3881
|
+
{
|
|
3882
|
+
ref,
|
|
3883
|
+
className: cn(
|
|
3884
|
+
"overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-sm [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",
|
|
3885
|
+
className
|
|
3886
|
+
),
|
|
3887
|
+
...props
|
|
3888
|
+
}
|
|
3889
|
+
));
|
|
3890
|
+
CommandGroup.displayName = cmdk.Command.Group.displayName;
|
|
3891
|
+
const CommandItem = React__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React__namespace.createElement(
|
|
3892
|
+
cmdk.Command.Item,
|
|
3893
|
+
{
|
|
3894
|
+
ref,
|
|
3895
|
+
className: cn(
|
|
3896
|
+
"hover:bg-slate-100 relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled='true']:pointer-events-none data-[disabled='true']:opacity-50",
|
|
3897
|
+
className
|
|
3898
|
+
),
|
|
3899
|
+
...props
|
|
3900
|
+
}
|
|
3901
|
+
));
|
|
3902
|
+
CommandItem.displayName = cmdk.Command.Item.displayName;
|
|
3903
|
+
const Popover = PopoverPrimitive__namespace.Root;
|
|
3904
|
+
const PopoverTrigger = PopoverPrimitive__namespace.Trigger;
|
|
3905
|
+
const PopoverContent = React__namespace.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ React__namespace.createElement(PopoverPrimitive__namespace.Portal, null, /* @__PURE__ */ React__namespace.createElement(
|
|
3906
|
+
PopoverPrimitive__namespace.Content,
|
|
3907
|
+
{
|
|
3908
|
+
ref,
|
|
3909
|
+
style: { zIndex: 9999 },
|
|
3910
|
+
align,
|
|
3911
|
+
sideOffset,
|
|
3912
|
+
side: "bottom",
|
|
3913
|
+
className: cn(
|
|
3914
|
+
"rounded-md border bg-white p-4 text-popover-foreground shadow-md outline-none 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",
|
|
3915
|
+
"max-h-[30vh] overflow-y-auto",
|
|
3916
|
+
className
|
|
3917
|
+
),
|
|
3918
|
+
...props
|
|
3919
|
+
}
|
|
3920
|
+
)));
|
|
3921
|
+
PopoverContent.displayName = PopoverPrimitive__namespace.Content.displayName;
|
|
3794
3922
|
const useGetOptionSets = (cms, collections) => {
|
|
3795
3923
|
const [optionSets, setOptionSets] = React__namespace.useState([]);
|
|
3796
3924
|
const [loading, setLoading] = React__namespace.useState(true);
|
|
@@ -3810,8 +3938,9 @@ var __publicField = (obj, key, value) => {
|
|
|
3810
3938
|
id,
|
|
3811
3939
|
}
|
|
3812
3940
|
...on Document {
|
|
3941
|
+
_values
|
|
3813
3942
|
_internalSys: _sys {
|
|
3814
|
-
|
|
3943
|
+
filename
|
|
3815
3944
|
}
|
|
3816
3945
|
}
|
|
3817
3946
|
}
|
|
@@ -3845,41 +3974,78 @@ var __publicField = (obj, key, value) => {
|
|
|
3845
3974
|
}, [cms, collections]);
|
|
3846
3975
|
return { optionSets, loading };
|
|
3847
3976
|
};
|
|
3848
|
-
const
|
|
3977
|
+
const getFilename = (optionSets, value) => {
|
|
3978
|
+
const nodes = optionSets.flatMap(
|
|
3979
|
+
(optionSet) => optionSet.edges.map((edge) => edge.node)
|
|
3980
|
+
);
|
|
3981
|
+
const node = nodes.find((node2) => node2.id === value);
|
|
3982
|
+
return node ? node._internalSys.filename : null;
|
|
3983
|
+
};
|
|
3984
|
+
const ComboboxDemo = ({
|
|
3849
3985
|
cms,
|
|
3850
3986
|
input,
|
|
3851
3987
|
field
|
|
3852
3988
|
}) => {
|
|
3989
|
+
const [open2, setOpen] = React__namespace.useState(false);
|
|
3990
|
+
const [value, setValue] = React__namespace.useState(input.value);
|
|
3991
|
+
const [displayText, setDisplayText] = React__namespace.useState(null);
|
|
3853
3992
|
const { optionSets, loading } = useGetOptionSets(cms, field.collections);
|
|
3854
|
-
const ref = React__namespace.useRef(null);
|
|
3855
3993
|
React__namespace.useEffect(() => {
|
|
3856
|
-
|
|
3857
|
-
|
|
3858
|
-
|
|
3859
|
-
}, [field.experimental_focusIntent, ref]);
|
|
3994
|
+
setDisplayText(getFilename(optionSets, value));
|
|
3995
|
+
input.onChange(value);
|
|
3996
|
+
}, [value, input, optionSets]);
|
|
3860
3997
|
if (loading === true) {
|
|
3861
3998
|
return /* @__PURE__ */ React__namespace.createElement(LoadingDots, { color: "var(--tina-color-primary)" });
|
|
3862
3999
|
}
|
|
3863
|
-
return /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, /* @__PURE__ */ React__namespace.createElement(
|
|
3864
|
-
|
|
4000
|
+
return /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, /* @__PURE__ */ React__namespace.createElement(Popover, { open: open2, onOpenChange: setOpen }, /* @__PURE__ */ React__namespace.createElement(PopoverTrigger, { asChild: true }, /* @__PURE__ */ React__namespace.createElement(
|
|
4001
|
+
Button,
|
|
3865
4002
|
{
|
|
3866
|
-
|
|
3867
|
-
|
|
3868
|
-
|
|
3869
|
-
|
|
3870
|
-
className: selectFieldClasses,
|
|
3871
|
-
...input
|
|
4003
|
+
variant: "outline",
|
|
4004
|
+
role: "combobox",
|
|
4005
|
+
"aria-expanded": open2,
|
|
4006
|
+
className: "w-52 justify-between"
|
|
3872
4007
|
},
|
|
3873
|
-
/* @__PURE__ */ React__namespace.createElement("
|
|
3874
|
-
|
|
3875
|
-
|
|
3876
|
-
|
|
3877
|
-
|
|
3878
|
-
|
|
3879
|
-
|
|
3880
|
-
|
|
4008
|
+
/* @__PURE__ */ React__namespace.createElement("p", { className: "truncate" }, displayText ?? "Choose an option..."),
|
|
4009
|
+
open2 ? /* @__PURE__ */ React__namespace.createElement(IoMdArrowDropup, { size: 20 }) : /* @__PURE__ */ React__namespace.createElement(IoMdArrowDropdown, { size: 20 })
|
|
4010
|
+
)), /* @__PURE__ */ React__namespace.createElement(PopoverContent, { className: "p-0 relative" }, /* @__PURE__ */ React__namespace.createElement(
|
|
4011
|
+
Command,
|
|
4012
|
+
{
|
|
4013
|
+
filter: (value2, search) => {
|
|
4014
|
+
if (value2.includes(search))
|
|
4015
|
+
return 1;
|
|
4016
|
+
return 0;
|
|
4017
|
+
}
|
|
4018
|
+
},
|
|
4019
|
+
/* @__PURE__ */ React__namespace.createElement(CommandInput, { placeholder: "Search reference..." }),
|
|
4020
|
+
/* @__PURE__ */ React__namespace.createElement(CommandEmpty, null, "No reference found"),
|
|
4021
|
+
/* @__PURE__ */ React__namespace.createElement(CommandList, null, optionSets.length > 0 && optionSets.map(({ collection, edges }) => /* @__PURE__ */ React__namespace.createElement(
|
|
4022
|
+
CommandGroup,
|
|
4023
|
+
{
|
|
4024
|
+
key: `${collection}-group`,
|
|
4025
|
+
heading: collection
|
|
4026
|
+
},
|
|
4027
|
+
/* @__PURE__ */ React__namespace.createElement(CommandList, null, edges.map(
|
|
4028
|
+
({
|
|
4029
|
+
node: {
|
|
4030
|
+
id,
|
|
4031
|
+
_internalSys: { filename },
|
|
4032
|
+
_values: { title, name }
|
|
4033
|
+
}
|
|
4034
|
+
}) => /* @__PURE__ */ React__namespace.createElement(
|
|
4035
|
+
CommandItem,
|
|
4036
|
+
{
|
|
4037
|
+
key: `${id}-option`,
|
|
4038
|
+
value: id || title,
|
|
4039
|
+
onSelect: () => {
|
|
4040
|
+
setValue(id);
|
|
4041
|
+
setOpen(false);
|
|
4042
|
+
}
|
|
4043
|
+
},
|
|
4044
|
+
/* @__PURE__ */ React__namespace.createElement("div", { className: "flex flex-col" }, /* @__PURE__ */ React__namespace.createElement("span", { className: "font-semibold text-sm" }, title || name || id), (title || name) && /* @__PURE__ */ React__namespace.createElement("span", { className: "text-x" }, filename))
|
|
4045
|
+
)
|
|
4046
|
+
))
|
|
3881
4047
|
)))
|
|
3882
|
-
)
|
|
4048
|
+
))));
|
|
3883
4049
|
};
|
|
3884
4050
|
const useGetNode = (cms, id) => {
|
|
3885
4051
|
const [document2, setDocument] = React__namespace.useState(
|
|
@@ -3944,7 +4110,7 @@ var __publicField = (obj, key, value) => {
|
|
|
3944
4110
|
"a",
|
|
3945
4111
|
{
|
|
3946
4112
|
href: `${tinaPreview ? `/${tinaPreview}/index.html#` : "/admin#"}/collections/${document2._sys.collection.name}/${document2._sys.breadcrumbs.join("/")}`,
|
|
3947
|
-
className: "text-gray-700 hover:text-blue-500 flex items-center uppercase text-sm mt-2 mb-2 leading-none"
|
|
4113
|
+
className: "text-gray-700 hover:text-blue-500 inline-flex items-center uppercase text-sm mt-2 mb-2 leading-none"
|
|
3948
4114
|
},
|
|
3949
4115
|
/* @__PURE__ */ React__namespace.createElement(BiEdit, { className: "h-5 w-auto opacity-80 mr-2" }),
|
|
3950
4116
|
"Edit in CMS"
|
|
@@ -3952,7 +4118,7 @@ var __publicField = (obj, key, value) => {
|
|
|
3952
4118
|
};
|
|
3953
4119
|
const Reference = ({ input, field }) => {
|
|
3954
4120
|
const cms = useCMS();
|
|
3955
|
-
return /* @__PURE__ */ React__namespace.createElement("div", null, /* @__PURE__ */ React__namespace.createElement("div", { className: "relative group" }, /* @__PURE__ */ React__namespace.createElement(
|
|
4121
|
+
return /* @__PURE__ */ React__namespace.createElement("div", null, /* @__PURE__ */ React__namespace.createElement("div", { className: "relative group" }, /* @__PURE__ */ React__namespace.createElement(ComboboxDemo, { cms, input, field })), /* @__PURE__ */ React__namespace.createElement(ReferenceLink, { cms, input }));
|
|
3956
4122
|
};
|
|
3957
4123
|
const ButtonToggle = ({
|
|
3958
4124
|
input,
|
|
@@ -6228,21 +6394,21 @@ var __publicField = (obj, key, value) => {
|
|
|
6228
6394
|
return parsedDate;
|
|
6229
6395
|
}
|
|
6230
6396
|
getClassName() {
|
|
6231
|
-
let
|
|
6397
|
+
let cn2 = "rdt";
|
|
6232
6398
|
let props = this.props;
|
|
6233
6399
|
let propCn = props.className;
|
|
6234
6400
|
if (Array.isArray(propCn)) {
|
|
6235
|
-
|
|
6401
|
+
cn2 += " " + propCn.join(" ");
|
|
6236
6402
|
} else if (propCn) {
|
|
6237
|
-
|
|
6403
|
+
cn2 += " " + propCn;
|
|
6238
6404
|
}
|
|
6239
6405
|
if (!props.input) {
|
|
6240
|
-
|
|
6406
|
+
cn2 += " rdtStatic";
|
|
6241
6407
|
}
|
|
6242
6408
|
if (this.isOpen()) {
|
|
6243
|
-
|
|
6409
|
+
cn2 += " rdtOpen";
|
|
6244
6410
|
}
|
|
6245
|
-
return
|
|
6411
|
+
return cn2;
|
|
6246
6412
|
}
|
|
6247
6413
|
isOpen() {
|
|
6248
6414
|
return !this.props.input || (this.props.open === void 0 ? this.state.open : this.props.open);
|
|
@@ -6716,7 +6882,7 @@ var __publicField = (obj, key, value) => {
|
|
|
6716
6882
|
}
|
|
6717
6883
|
}
|
|
6718
6884
|
), /* @__PURE__ */ React__namespace.createElement(
|
|
6719
|
-
Button,
|
|
6885
|
+
Button$1,
|
|
6720
6886
|
{
|
|
6721
6887
|
variant: "secondary",
|
|
6722
6888
|
disabled: password === void 0 && confirmPassword === void 0,
|
|
@@ -6876,7 +7042,7 @@ var __publicField = (obj, key, value) => {
|
|
|
6876
7042
|
},
|
|
6877
7043
|
"Learn more about moving to production with Tina Cloud."
|
|
6878
7044
|
)), /* @__PURE__ */ React__namespace.createElement("p", null, /* @__PURE__ */ React__namespace.createElement(
|
|
6879
|
-
Button,
|
|
7045
|
+
Button$1,
|
|
6880
7046
|
{
|
|
6881
7047
|
href: "https://tina.io/docs/tina-cloud/",
|
|
6882
7048
|
target: "_blank",
|
|
@@ -6897,7 +7063,7 @@ var __publicField = (obj, key, value) => {
|
|
|
6897
7063
|
chooseBranch(branchName);
|
|
6898
7064
|
}
|
|
6899
7065
|
}
|
|
6900
|
-
) : /* @__PURE__ */ React__namespace.createElement("div", { className: "px-6 py-8 w-full h-full flex flex-col items-center justify-center" }, /* @__PURE__ */ React__namespace.createElement("p", { className: "text-base mb-4 text-center" }, "An error occurred while retrieving the branch list."), /* @__PURE__ */ React__namespace.createElement(Button, { className: "mb-4", onClick: refreshBranchList }, "Try again ", /* @__PURE__ */ React__namespace.createElement(BiRefresh, { className: "w-6 h-full ml-1 opacity-70" }))))));
|
|
7066
|
+
) : /* @__PURE__ */ React__namespace.createElement("div", { className: "px-6 py-8 w-full h-full flex flex-col items-center justify-center" }, /* @__PURE__ */ React__namespace.createElement("p", { className: "text-base mb-4 text-center" }, "An error occurred while retrieving the branch list."), /* @__PURE__ */ React__namespace.createElement(Button$1, { className: "mb-4", onClick: refreshBranchList }, "Try again ", /* @__PURE__ */ React__namespace.createElement(BiRefresh, { className: "w-6 h-full ml-1 opacity-70" }))))));
|
|
6901
7067
|
};
|
|
6902
7068
|
const getFilteredBranchList$1 = (branchList, filter, currentBranchName) => {
|
|
6903
7069
|
const filteredBranchList = branchList.filter(
|
|
@@ -6982,7 +7148,7 @@ var __publicField = (obj, key, value) => {
|
|
|
6982
7148
|
onChange: (e) => setNewBranchName(e.target.value)
|
|
6983
7149
|
}
|
|
6984
7150
|
), /* @__PURE__ */ React__namespace.createElement(
|
|
6985
|
-
Button,
|
|
7151
|
+
Button$1,
|
|
6986
7152
|
{
|
|
6987
7153
|
className: "flex-0 flex items-center gap-2 whitespace-nowrap",
|
|
6988
7154
|
size: "medium",
|
|
@@ -7112,7 +7278,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7112
7278
|
},
|
|
7113
7279
|
"Learn more about moving to production with Tina Cloud."
|
|
7114
7280
|
)), /* @__PURE__ */ React__namespace.createElement("p", null, /* @__PURE__ */ React__namespace.createElement(
|
|
7115
|
-
Button,
|
|
7281
|
+
Button$1,
|
|
7116
7282
|
{
|
|
7117
7283
|
href: "https://tina.io/docs/tina-cloud/",
|
|
7118
7284
|
target: "_blank",
|
|
@@ -7140,7 +7306,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7140
7306
|
chooseBranch(branchName);
|
|
7141
7307
|
}
|
|
7142
7308
|
}
|
|
7143
|
-
) : /* @__PURE__ */ React__namespace.createElement("div", { className: "px-6 py-8 w-full h-full flex flex-col items-center justify-center" }, /* @__PURE__ */ React__namespace.createElement("p", { className: "text-base mb-4 text-center" }, "An error occurred while retrieving the branch list."), /* @__PURE__ */ React__namespace.createElement(Button, { className: "mb-4", onClick: refreshBranchList }, "Try again ", /* @__PURE__ */ React__namespace.createElement(BiRefresh, { className: "w-6 h-full ml-1 opacity-70" }))))));
|
|
7309
|
+
) : /* @__PURE__ */ React__namespace.createElement("div", { className: "px-6 py-8 w-full h-full flex flex-col items-center justify-center" }, /* @__PURE__ */ React__namespace.createElement("p", { className: "text-base mb-4 text-center" }, "An error occurred while retrieving the branch list."), /* @__PURE__ */ React__namespace.createElement(Button$1, { className: "mb-4", onClick: refreshBranchList }, "Try again ", /* @__PURE__ */ React__namespace.createElement(BiRefresh, { className: "w-6 h-full ml-1 opacity-70" }))))));
|
|
7144
7310
|
};
|
|
7145
7311
|
const getFilteredBranchList = (branchList, search, currentBranchName, filter = "all") => {
|
|
7146
7312
|
const filteredBranchList = branchList.filter(
|
|
@@ -7194,7 +7360,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7194
7360
|
onChange: (e) => setBranchName(e.target.value)
|
|
7195
7361
|
}
|
|
7196
7362
|
))), /* @__PURE__ */ React__namespace.createElement("div", { className: "w-full flex justify-between gap-4 items-center" }, /* @__PURE__ */ React__namespace.createElement(
|
|
7197
|
-
Button,
|
|
7363
|
+
Button$1,
|
|
7198
7364
|
{
|
|
7199
7365
|
style: { flexGrow: 1 },
|
|
7200
7366
|
onClick: () => {
|
|
@@ -7203,7 +7369,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7203
7369
|
},
|
|
7204
7370
|
"Cancel"
|
|
7205
7371
|
), /* @__PURE__ */ React__namespace.createElement(
|
|
7206
|
-
Button,
|
|
7372
|
+
Button$1,
|
|
7207
7373
|
{
|
|
7208
7374
|
variant: "primary",
|
|
7209
7375
|
type: "submit",
|
|
@@ -7304,7 +7470,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7304
7470
|
}
|
|
7305
7471
|
))),
|
|
7306
7472
|
/* @__PURE__ */ React__namespace.createElement("div", { className: "flex items-center" }, indexingStatus === "complete" && !isCurrentBranch && /* @__PURE__ */ React__namespace.createElement(
|
|
7307
|
-
Button,
|
|
7473
|
+
Button$1,
|
|
7308
7474
|
{
|
|
7309
7475
|
variant: "white",
|
|
7310
7476
|
size: "custom",
|
|
@@ -8275,7 +8441,7 @@ var __publicField = (obj, key, value) => {
|
|
|
8275
8441
|
/* @__PURE__ */ React__namespace.createElement(Emoji$1, { className: "pb-5" }, "🔎"),
|
|
8276
8442
|
/* @__PURE__ */ React__namespace.createElement("p", { className: "block pb-5" }, "Looks like there's ", /* @__PURE__ */ React__namespace.createElement("br", null), "nothing to edit on ", /* @__PURE__ */ React__namespace.createElement("br", null), "this page."),
|
|
8277
8443
|
/* @__PURE__ */ React__namespace.createElement("p", { className: "block" }, /* @__PURE__ */ React__namespace.createElement(
|
|
8278
|
-
Button,
|
|
8444
|
+
Button$1,
|
|
8279
8445
|
{
|
|
8280
8446
|
href: "https://tina.io/docs/tinacms-context/",
|
|
8281
8447
|
target: "_blank",
|
|
@@ -8794,7 +8960,7 @@ var __publicField = (obj, key, value) => {
|
|
|
8794
8960
|
/* @__PURE__ */ React__namespace.createElement("span", { className: "w-full block text-gray-300 text-xs mt-0.5" }, time)
|
|
8795
8961
|
));
|
|
8796
8962
|
}).flat())), loading && /* @__PURE__ */ React__namespace.createElement("div", { className: "text-sm text-gray-400 text-center" }, "Loading..."), error && /* @__PURE__ */ React__namespace.createElement("div", null, "Error: ", error.message), /* @__PURE__ */ React__namespace.createElement("div", { className: "text-center flex-1" }, /* @__PURE__ */ React__namespace.createElement(
|
|
8797
|
-
Button,
|
|
8963
|
+
Button$1,
|
|
8798
8964
|
{
|
|
8799
8965
|
onClick: () => {
|
|
8800
8966
|
setExistingEvents(events);
|
|
@@ -9344,7 +9510,7 @@ var __publicField = (obj, key, value) => {
|
|
|
9344
9510
|
)
|
|
9345
9511
|
},
|
|
9346
9512
|
/* @__PURE__ */ React__namespace.createElement("div", { className: "absolute top-8 right-0 transform translate-x-full overflow-hidden" }, /* @__PURE__ */ React__namespace.createElement(
|
|
9347
|
-
Button,
|
|
9513
|
+
Button$1,
|
|
9348
9514
|
{
|
|
9349
9515
|
rounded: "right",
|
|
9350
9516
|
variant: "secondary",
|
|
@@ -9418,7 +9584,7 @@ var __publicField = (obj, key, value) => {
|
|
|
9418
9584
|
const branch = (_h = (_g = cms.api) == null ? void 0 : _g.tina) == null ? void 0 : _h.branch;
|
|
9419
9585
|
const previewUrl = typeof previewFunction === "function" ? (_i = previewFunction({ branch })) == null ? void 0 : _i.url : null;
|
|
9420
9586
|
return /* @__PURE__ */ React__namespace.createElement("div", { className: "flex-grow-0 w-full overflow-visible z-20" }, isLocalMode && /* @__PURE__ */ React__namespace.createElement(LocalWarning, null), !isLocalMode && /* @__PURE__ */ React__namespace.createElement(BillingWarning, null), /* @__PURE__ */ React__namespace.createElement("div", { className: "mt-4 -mb-14 w-full flex gap-3 items-center justify-between pointer-events-none" }, displayMenuButton && /* @__PURE__ */ React__namespace.createElement(
|
|
9421
|
-
Button,
|
|
9587
|
+
Button$1,
|
|
9422
9588
|
{
|
|
9423
9589
|
rounded: "right",
|
|
9424
9590
|
variant: "white",
|
|
@@ -9444,7 +9610,7 @@ var __publicField = (obj, key, value) => {
|
|
|
9444
9610
|
className: `flex items-center pointer-events-auto transition-opacity duration-150 ease-in-out -mr-px`
|
|
9445
9611
|
},
|
|
9446
9612
|
/* @__PURE__ */ React__namespace.createElement(
|
|
9447
|
-
Button,
|
|
9613
|
+
Button$1,
|
|
9448
9614
|
{
|
|
9449
9615
|
rounded: "left",
|
|
9450
9616
|
variant: "white",
|
|
@@ -9454,7 +9620,7 @@ var __publicField = (obj, key, value) => {
|
|
|
9454
9620
|
},
|
|
9455
9621
|
/* @__PURE__ */ React__namespace.createElement(MdOutlineArrowBackIos, { className: "h-[18px] w-auto -mr-1 text-blue-500" })
|
|
9456
9622
|
),
|
|
9457
|
-
/* @__PURE__ */ React__namespace.createElement(Button, { rounded: "custom", variant: "white", onClick: toggleFullscreen }, displayState === "fullscreen" ? (
|
|
9623
|
+
/* @__PURE__ */ React__namespace.createElement(Button$1, { rounded: "custom", variant: "white", onClick: toggleFullscreen }, displayState === "fullscreen" ? (
|
|
9458
9624
|
// BiCollapseAlt
|
|
9459
9625
|
/* @__PURE__ */ React__namespace.createElement(
|
|
9460
9626
|
"svg",
|
|
@@ -9523,7 +9689,7 @@ var __publicField = (obj, key, value) => {
|
|
|
9523
9689
|
const EditButton = ({}) => {
|
|
9524
9690
|
const { displayState, toggleSidebarOpen } = React__namespace.useContext(SidebarContext);
|
|
9525
9691
|
return /* @__PURE__ */ React__namespace.createElement(
|
|
9526
|
-
Button,
|
|
9692
|
+
Button$1,
|
|
9527
9693
|
{
|
|
9528
9694
|
rounded: "right",
|
|
9529
9695
|
variant: "primary",
|
|
@@ -9609,7 +9775,7 @@ var __publicField = (obj, key, value) => {
|
|
|
9609
9775
|
hasPrev,
|
|
9610
9776
|
variant = "white"
|
|
9611
9777
|
}) {
|
|
9612
|
-
return /* @__PURE__ */ React.createElement("div", { className: "w-full flex flex-shrink-0 justify-end gap-2 items-center" }, /* @__PURE__ */ React.createElement(Button, { variant, disabled: !hasPrev, onClick: navigatePrev }, /* @__PURE__ */ React.createElement(BiLeftArrowAlt, { className: "w-6 h-full mr-2 opacity-70" }), " Previous"), /* @__PURE__ */ React.createElement(Button, { variant, disabled: !hasNext, onClick: navigateNext }, "Next ", /* @__PURE__ */ React.createElement(BiRightArrowAlt, { className: "w-6 h-full ml-2 opacity-70" })));
|
|
9778
|
+
return /* @__PURE__ */ React.createElement("div", { className: "w-full flex flex-shrink-0 justify-end gap-2 items-center" }, /* @__PURE__ */ React.createElement(Button$1, { variant, disabled: !hasPrev, onClick: navigatePrev }, /* @__PURE__ */ React.createElement(BiLeftArrowAlt, { className: "w-6 h-full mr-2 opacity-70" }), " Previous"), /* @__PURE__ */ React.createElement(Button$1, { variant, disabled: !hasNext, onClick: navigateNext }, "Next ", /* @__PURE__ */ React.createElement(BiRightArrowAlt, { className: "w-6 h-full ml-2 opacity-70" })));
|
|
9613
9779
|
}
|
|
9614
9780
|
function ListMediaItem({ item, onClick, active }) {
|
|
9615
9781
|
let FileIcon = BiFile;
|
|
@@ -9744,8 +9910,8 @@ var __publicField = (obj, key, value) => {
|
|
|
9744
9910
|
deleteFunc,
|
|
9745
9911
|
filename
|
|
9746
9912
|
}) => {
|
|
9747
|
-
return /* @__PURE__ */ React.createElement(Modal, null, /* @__PURE__ */ React.createElement(PopupModal, null, /* @__PURE__ */ React.createElement(ModalHeader, { close: close2 }, "Delete ", filename), /* @__PURE__ */ React.createElement(ModalBody, { padded: true }, /* @__PURE__ */ React.createElement("p", null, "Are you sure you want to delete ", /* @__PURE__ */ React.createElement("strong", null, filename), "?")), /* @__PURE__ */ React.createElement(ModalActions, null, /* @__PURE__ */ React.createElement(Button, { style: { flexGrow: 2 }, onClick: close2 }, "Cancel"), /* @__PURE__ */ React.createElement(
|
|
9748
|
-
Button,
|
|
9913
|
+
return /* @__PURE__ */ React.createElement(Modal, null, /* @__PURE__ */ React.createElement(PopupModal, null, /* @__PURE__ */ React.createElement(ModalHeader, { close: close2 }, "Delete ", filename), /* @__PURE__ */ React.createElement(ModalBody, { padded: true }, /* @__PURE__ */ React.createElement("p", null, "Are you sure you want to delete ", /* @__PURE__ */ React.createElement("strong", null, filename), "?")), /* @__PURE__ */ React.createElement(ModalActions, null, /* @__PURE__ */ React.createElement(Button$1, { style: { flexGrow: 2 }, onClick: close2 }, "Cancel"), /* @__PURE__ */ React.createElement(
|
|
9914
|
+
Button$1,
|
|
9749
9915
|
{
|
|
9750
9916
|
style: { flexGrow: 3 },
|
|
9751
9917
|
variant: "danger",
|
|
@@ -9767,8 +9933,8 @@ var __publicField = (obj, key, value) => {
|
|
|
9767
9933
|
required: true,
|
|
9768
9934
|
onChange: (e) => setFolderName(e.target.value)
|
|
9769
9935
|
}
|
|
9770
|
-
)), /* @__PURE__ */ React.createElement(ModalActions, null, /* @__PURE__ */ React.createElement(Button, { style: { flexGrow: 2 }, onClick: close2 }, "Cancel"), /* @__PURE__ */ React.createElement(
|
|
9771
|
-
Button,
|
|
9936
|
+
)), /* @__PURE__ */ React.createElement(ModalActions, null, /* @__PURE__ */ React.createElement(Button$1, { style: { flexGrow: 2 }, onClick: close2 }, "Cancel"), /* @__PURE__ */ React.createElement(
|
|
9937
|
+
Button$1,
|
|
9772
9938
|
{
|
|
9773
9939
|
disabled: !folderName,
|
|
9774
9940
|
style: { flexGrow: 3 },
|
|
@@ -10076,7 +10242,7 @@ var __publicField = (obj, key, value) => {
|
|
|
10076
10242
|
close: () => setNewFolderModalOpen(false)
|
|
10077
10243
|
}
|
|
10078
10244
|
), /* @__PURE__ */ React.createElement(MediaPickerWrap, null, /* @__PURE__ */ React.createElement(SyncStatusContainer, null, /* @__PURE__ */ React.createElement("div", { className: "flex flex-wrap items-center bg-gray-50 border-b border-gray-150 gap-4 py-3 px-5 shadow-sm flex-shrink-0" }, /* @__PURE__ */ React.createElement("div", { className: "flex flex-1 items-center gap-4" }, /* @__PURE__ */ React.createElement(ViewModeToggle, { viewMode, setViewMode }), /* @__PURE__ */ React.createElement(Breadcrumb$1, { directory, setDirectory })), cms.media.store.isStatic ? null : /* @__PURE__ */ React.createElement("div", { className: "flex flex-wrap items-center gap-4" }, /* @__PURE__ */ React.createElement(
|
|
10079
|
-
Button,
|
|
10245
|
+
Button$1,
|
|
10080
10246
|
{
|
|
10081
10247
|
busy: false,
|
|
10082
10248
|
variant: "white",
|
|
@@ -10086,7 +10252,7 @@ var __publicField = (obj, key, value) => {
|
|
|
10086
10252
|
"Refresh",
|
|
10087
10253
|
/* @__PURE__ */ React.createElement(IoMdRefresh, { className: "w-6 h-full ml-2 opacity-70 text-blue-500" })
|
|
10088
10254
|
), /* @__PURE__ */ React.createElement(
|
|
10089
|
-
Button,
|
|
10255
|
+
Button$1,
|
|
10090
10256
|
{
|
|
10091
10257
|
busy: false,
|
|
10092
10258
|
variant: "white",
|
|
@@ -10178,7 +10344,7 @@ var __publicField = (obj, key, value) => {
|
|
|
10178
10344
|
alt: activeItem.filename
|
|
10179
10345
|
}
|
|
10180
10346
|
)) : /* @__PURE__ */ React.createElement("span", { className: "p-3 border border-gray-100 rounded-md overflow-hidden bg-gray-50 shadow" }, /* @__PURE__ */ React.createElement(BiFile, { className: "w-14 h-auto fill-gray-300" })), /* @__PURE__ */ React.createElement("div", { className: "grow h-full w-full shrink flex flex-col gap-3 items-start justify-start" }, /* @__PURE__ */ React.createElement(CopyField, { value: absoluteImgURL(activeItem.src), label: "URL" })), /* @__PURE__ */ React.createElement("div", { className: "shrink-0 w-full flex flex-col justify-end items-start" }, /* @__PURE__ */ React.createElement("div", { className: "flex w-full gap-3" }, selectMediaItem && /* @__PURE__ */ React.createElement(
|
|
10181
|
-
Button,
|
|
10347
|
+
Button$1,
|
|
10182
10348
|
{
|
|
10183
10349
|
size: "medium",
|
|
10184
10350
|
variant: "primary",
|
|
@@ -10188,7 +10354,7 @@ var __publicField = (obj, key, value) => {
|
|
|
10188
10354
|
"Insert",
|
|
10189
10355
|
/* @__PURE__ */ React.createElement(BiArrowToBottom, { className: "ml-1 -mr-0.5 w-6 h-auto text-white opacity-70" })
|
|
10190
10356
|
), allowDelete && /* @__PURE__ */ React.createElement(
|
|
10191
|
-
Button,
|
|
10357
|
+
Button$1,
|
|
10192
10358
|
{
|
|
10193
10359
|
variant: "white",
|
|
10194
10360
|
size: "medium",
|
|
@@ -10202,7 +10368,7 @@ var __publicField = (obj, key, value) => {
|
|
|
10202
10368
|
};
|
|
10203
10369
|
const UploadButton = ({ onClick, uploading }) => {
|
|
10204
10370
|
return /* @__PURE__ */ React.createElement(
|
|
10205
|
-
Button,
|
|
10371
|
+
Button$1,
|
|
10206
10372
|
{
|
|
10207
10373
|
variant: "primary",
|
|
10208
10374
|
size: "custom",
|
|
@@ -10424,7 +10590,7 @@ var __publicField = (obj, key, value) => {
|
|
|
10424
10590
|
required: true
|
|
10425
10591
|
}
|
|
10426
10592
|
)), result && /* @__PURE__ */ React.createElement("div", { className: "text-center text-sm text-gray-500" }, result), err && /* @__PURE__ */ React.createElement("div", { className: "text-center text-sm text-red-500" }, err), /* @__PURE__ */ React.createElement(
|
|
10427
|
-
Button,
|
|
10593
|
+
Button$1,
|
|
10428
10594
|
{
|
|
10429
10595
|
onClick: updatePassword,
|
|
10430
10596
|
disabled: err,
|
|
@@ -10776,7 +10942,7 @@ var __publicField = (obj, key, value) => {
|
|
|
10776
10942
|
" ",
|
|
10777
10943
|
"Error"
|
|
10778
10944
|
), /* @__PURE__ */ React.createElement(ModalBody, { padded: true }, /* @__PURE__ */ React.createElement("div", { className: "tina-prose" }, /* @__PURE__ */ React.createElement(AlertMessage, null))), /* @__PURE__ */ React.createElement(ModalActions, null, /* @__PURE__ */ React.createElement("div", { className: "flex-1" }), /* @__PURE__ */ React.createElement(
|
|
10779
|
-
Button,
|
|
10945
|
+
Button$1,
|
|
10780
10946
|
{
|
|
10781
10947
|
style: { flexGrow: 1 },
|
|
10782
10948
|
onClick: () => {
|
|
@@ -11075,7 +11241,7 @@ var __publicField = (obj, key, value) => {
|
|
|
11075
11241
|
className: `w-full bg-white flex items-center gap-2 -mb-px border-b border-gray-100 py-3 pr-4 pl-20 xl:pl-4`
|
|
11076
11242
|
},
|
|
11077
11243
|
/* @__PURE__ */ React__namespace.createElement(
|
|
11078
|
-
Button,
|
|
11244
|
+
Button$1,
|
|
11079
11245
|
{
|
|
11080
11246
|
variant: isProtected ? "primary" : "white",
|
|
11081
11247
|
size: "small",
|
|
@@ -11097,7 +11263,7 @@ var __publicField = (obj, key, value) => {
|
|
|
11097
11263
|
)
|
|
11098
11264
|
),
|
|
11099
11265
|
previewUrl && /* @__PURE__ */ React__namespace.createElement(
|
|
11100
|
-
Button,
|
|
11266
|
+
Button$1,
|
|
11101
11267
|
{
|
|
11102
11268
|
variant: "white",
|
|
11103
11269
|
size: "small",
|
|
@@ -11313,7 +11479,7 @@ var __publicField = (obj, key, value) => {
|
|
|
11313
11479
|
},
|
|
11314
11480
|
tinaForm.buttons.reset
|
|
11315
11481
|
), /* @__PURE__ */ React__namespace.createElement(
|
|
11316
|
-
Button,
|
|
11482
|
+
Button$1,
|
|
11317
11483
|
{
|
|
11318
11484
|
onClick: safeHandleSubmit,
|
|
11319
11485
|
disabled: !canSubmit,
|
|
@@ -11440,8 +11606,8 @@ var __publicField = (obj, key, value) => {
|
|
|
11440
11606
|
setNewBranchName(formatBranchName(e.target.value));
|
|
11441
11607
|
}
|
|
11442
11608
|
}
|
|
11443
|
-
), error && /* @__PURE__ */ React__namespace.createElement("div", { className: "mt-2 text-sm text-red-700" }, error)), /* @__PURE__ */ React__namespace.createElement(ModalActions, null, /* @__PURE__ */ React__namespace.createElement(Button, { style: { flexGrow: 1 }, onClick: close2 }, "Cancel"), /* @__PURE__ */ React__namespace.createElement(
|
|
11444
|
-
Button,
|
|
11609
|
+
), error && /* @__PURE__ */ React__namespace.createElement("div", { className: "mt-2 text-sm text-red-700" }, error)), /* @__PURE__ */ React__namespace.createElement(ModalActions, null, /* @__PURE__ */ React__namespace.createElement(Button$1, { style: { flexGrow: 1 }, onClick: close2 }, "Cancel"), /* @__PURE__ */ React__namespace.createElement(
|
|
11610
|
+
Button$1,
|
|
11445
11611
|
{
|
|
11446
11612
|
variant: "primary",
|
|
11447
11613
|
style: { flexGrow: 2 },
|
|
@@ -12417,7 +12583,7 @@ var __publicField = (obj, key, value) => {
|
|
|
12417
12583
|
props.onClose();
|
|
12418
12584
|
}, [editor, formValues]);
|
|
12419
12585
|
const UpdateLink = React.useCallback(
|
|
12420
|
-
() => /* @__PURE__ */ React.createElement(Button, { variant: "primary", onClick: handleUpdate }, "Update Link"),
|
|
12586
|
+
() => /* @__PURE__ */ React.createElement(Button$1, { variant: "primary", onClick: handleUpdate }, "Update Link"),
|
|
12421
12587
|
[handleUpdate]
|
|
12422
12588
|
);
|
|
12423
12589
|
return /* @__PURE__ */ React.createElement(
|
|
@@ -27517,7 +27683,7 @@ mutation addPendingDocumentMutation(
|
|
|
27517
27683
|
}
|
|
27518
27684
|
}, [action, setSubmitting, mounted]);
|
|
27519
27685
|
return /* @__PURE__ */ React.createElement(
|
|
27520
|
-
Button,
|
|
27686
|
+
Button$1,
|
|
27521
27687
|
{
|
|
27522
27688
|
"data-test": name.replace(/\s/g, "-").toLowerCase(),
|
|
27523
27689
|
variant: primary ? "primary" : "secondary",
|
|
@@ -28891,7 +29057,7 @@ This will work when developing locally but NOT when deployed to production.
|
|
|
28891
29057
|
)
|
|
28892
29058
|
},
|
|
28893
29059
|
/* @__PURE__ */ React.createElement("div", { className: "absolute top-8 right-0 transform translate-x-full overflow-hidden" }, /* @__PURE__ */ React.createElement(
|
|
28894
|
-
Button,
|
|
29060
|
+
Button$1,
|
|
28895
29061
|
{
|
|
28896
29062
|
rounded: "right",
|
|
28897
29063
|
variant: "secondary",
|
|
@@ -28925,7 +29091,7 @@ This will work when developing locally but NOT when deployed to production.
|
|
|
28925
29091
|
}
|
|
28926
29092
|
)
|
|
28927
29093
|
)), !renderDesktopNav && /* @__PURE__ */ React.createElement(
|
|
28928
|
-
Button,
|
|
29094
|
+
Button$1,
|
|
28929
29095
|
{
|
|
28930
29096
|
rounded: "right",
|
|
28931
29097
|
variant: "secondary",
|
|
@@ -29122,7 +29288,7 @@ This will work when developing locally but NOT when deployed to production.
|
|
|
29122
29288
|
title = "Error",
|
|
29123
29289
|
errorMessage = "It looks like something went wrong."
|
|
29124
29290
|
}) => {
|
|
29125
|
-
return /* @__PURE__ */ React.createElement("div", { className: "flex flex-col justify-center items-center h-screen bg-gray-100" }, /* @__PURE__ */ React.createElement("div", { className: "text-red-500 text-4xl mb-6 flex items-center" }, /* @__PURE__ */ React.createElement(BiError, { className: "w-12 h-auto fill-current text-red-400 opacity-70 mr-1" }), " ", title), /* @__PURE__ */ React.createElement("p", { className: "text-gray-700 text-xl mb-8" }, errorMessage), /* @__PURE__ */ React.createElement(Button, { variant: "danger", onClick: () => window.location.reload() }, /* @__PURE__ */ React.createElement(BiSync, { className: "w-7 h-auto fill-current opacity-70 mr-1" }), " Reload"));
|
|
29291
|
+
return /* @__PURE__ */ React.createElement("div", { className: "flex flex-col justify-center items-center h-screen bg-gray-100" }, /* @__PURE__ */ React.createElement("div", { className: "text-red-500 text-4xl mb-6 flex items-center" }, /* @__PURE__ */ React.createElement(BiError, { className: "w-12 h-auto fill-current text-red-400 opacity-70 mr-1" }), " ", title), /* @__PURE__ */ React.createElement("p", { className: "text-gray-700 text-xl mb-8" }, errorMessage), /* @__PURE__ */ React.createElement(Button$1, { variant: "danger", onClick: () => window.location.reload() }, /* @__PURE__ */ React.createElement(BiSync, { className: "w-7 h-auto fill-current opacity-70 mr-1" }), " Reload"));
|
|
29126
29292
|
};
|
|
29127
29293
|
const useGetCollection = (cms, collectionName, includeDocuments = true, folder, after = "", sortKey, filterArgs) => {
|
|
29128
29294
|
const api = new TinaAdminApi(cms);
|
|
@@ -29987,7 +30153,7 @@ This will work when developing locally but NOT when deployed to production.
|
|
|
29987
30153
|
}
|
|
29988
30154
|
}
|
|
29989
30155
|
)), /* @__PURE__ */ React.createElement("div", { className: "flex w-full md:w-auto gap-3" }, /* @__PURE__ */ React.createElement(
|
|
29990
|
-
Button,
|
|
30156
|
+
Button$1,
|
|
29991
30157
|
{
|
|
29992
30158
|
onClick: () => {
|
|
29993
30159
|
setSearch(searchInput);
|
|
@@ -29999,7 +30165,7 @@ This will work when developing locally but NOT when deployed to production.
|
|
|
29999
30165
|
"Search ",
|
|
30000
30166
|
/* @__PURE__ */ React.createElement(BiSearch, { className: "w-5 h-full ml-1.5 opacity-70" })
|
|
30001
30167
|
), search && searchLoaded && /* @__PURE__ */ React.createElement(
|
|
30002
|
-
Button,
|
|
30168
|
+
Button$1,
|
|
30003
30169
|
{
|
|
30004
30170
|
onClick: () => {
|
|
30005
30171
|
setSearch("");
|
|
@@ -30069,8 +30235,8 @@ This will work when developing locally but NOT when deployed to production.
|
|
|
30069
30235
|
return /* @__PURE__ */ React.createElement("div", { className: "text-center px-5 py-3 flex flex-col items-center justify-center shadow border border-gray-100 bg-gray-50 border-b border-gray-200 w-full max-w-full rounded-lg" }, /* @__PURE__ */ React.createElement("p", { className: "text-base italic font-medium text-gray-300" }, "No documents found."));
|
|
30070
30236
|
};
|
|
30071
30237
|
const DeleteModal = ({ close: close2, deleteFunc, filename }) => {
|
|
30072
|
-
return /* @__PURE__ */ React.createElement(Modal, null, /* @__PURE__ */ React.createElement(PopupModal, null, /* @__PURE__ */ React.createElement(ModalHeader, { close: close2 }, "Delete ", filename), /* @__PURE__ */ React.createElement(ModalBody, { padded: true }, /* @__PURE__ */ React.createElement("p", null, `Are you sure you want to delete ${filename}?`)), /* @__PURE__ */ React.createElement(ModalActions, null, /* @__PURE__ */ React.createElement(Button, { style: { flexGrow: 2 }, onClick: close2 }, "Cancel"), /* @__PURE__ */ React.createElement(
|
|
30073
|
-
Button,
|
|
30238
|
+
return /* @__PURE__ */ React.createElement(Modal, null, /* @__PURE__ */ React.createElement(PopupModal, null, /* @__PURE__ */ React.createElement(ModalHeader, { close: close2 }, "Delete ", filename), /* @__PURE__ */ React.createElement(ModalBody, { padded: true }, /* @__PURE__ */ React.createElement("p", null, `Are you sure you want to delete ${filename}?`)), /* @__PURE__ */ React.createElement(ModalActions, null, /* @__PURE__ */ React.createElement(Button$1, { style: { flexGrow: 2 }, onClick: close2 }, "Cancel"), /* @__PURE__ */ React.createElement(
|
|
30239
|
+
Button$1,
|
|
30074
30240
|
{
|
|
30075
30241
|
style: { flexGrow: 3 },
|
|
30076
30242
|
variant: "danger",
|
|
@@ -30095,8 +30261,8 @@ This will work when developing locally but NOT when deployed to production.
|
|
|
30095
30261
|
value: folderName,
|
|
30096
30262
|
onChange: (event) => setFolderName(event.target.value)
|
|
30097
30263
|
}
|
|
30098
|
-
))), /* @__PURE__ */ React.createElement(ModalActions, null, /* @__PURE__ */ React.createElement(Button, { style: { flexGrow: 2 }, onClick: close2 }, "Cancel"), /* @__PURE__ */ React.createElement(
|
|
30099
|
-
Button,
|
|
30264
|
+
))), /* @__PURE__ */ React.createElement(ModalActions, null, /* @__PURE__ */ React.createElement(Button$1, { style: { flexGrow: 2 }, onClick: close2 }, "Cancel"), /* @__PURE__ */ React.createElement(
|
|
30265
|
+
Button$1,
|
|
30100
30266
|
{
|
|
30101
30267
|
style: { flexGrow: 3 },
|
|
30102
30268
|
variant: "primary",
|
|
@@ -30122,8 +30288,8 @@ This will work when developing locally but NOT when deployed to production.
|
|
|
30122
30288
|
value: newRelativePath,
|
|
30123
30289
|
onChange: (event) => setNewRelativePath(event.target.value)
|
|
30124
30290
|
}
|
|
30125
|
-
))), /* @__PURE__ */ React.createElement(ModalActions, null, /* @__PURE__ */ React.createElement(Button, { style: { flexGrow: 2 }, onClick: close2 }, "Cancel"), /* @__PURE__ */ React.createElement(
|
|
30126
|
-
Button,
|
|
30291
|
+
))), /* @__PURE__ */ React.createElement(ModalActions, null, /* @__PURE__ */ React.createElement(Button$1, { style: { flexGrow: 2 }, onClick: close2 }, "Cancel"), /* @__PURE__ */ React.createElement(
|
|
30292
|
+
Button$1,
|
|
30127
30293
|
{
|
|
30128
30294
|
style: { flexGrow: 3 },
|
|
30129
30295
|
variant: "primary",
|
|
@@ -30921,7 +31087,7 @@ This will work when developing locally but NOT when deployed to production.
|
|
|
30921
31087
|
}
|
|
30922
31088
|
}, [cms, JSON.stringify(schemaJson || {}), url]);
|
|
30923
31089
|
return /* @__PURE__ */ React.createElement(React.Fragment, null, schemaMissingError ? /* @__PURE__ */ React.createElement(Modal, null, /* @__PURE__ */ React.createElement(PopupModal, null, /* @__PURE__ */ React.createElement(ModalHeader, null, "Branch Not Found"), /* @__PURE__ */ React.createElement(ModalBody, { padded: true }, /* @__PURE__ */ React.createElement("div", { className: "tina-prose" }, "The current branch (", /* @__PURE__ */ React.createElement("span", { className: "font-bold" }, currentBranch), ") has either been merged or deleted.")), /* @__PURE__ */ React.createElement(ModalActions, null, /* @__PURE__ */ React.createElement("div", { className: "flex-1" }), /* @__PURE__ */ React.createElement(
|
|
30924
|
-
Button,
|
|
31090
|
+
Button$1,
|
|
30925
31091
|
{
|
|
30926
31092
|
style: { flexGrow: 1 },
|
|
30927
31093
|
className: "w-full",
|
|
@@ -31232,7 +31398,7 @@ This will work when developing locally but NOT when deployed to production.
|
|
|
31232
31398
|
exports2.BranchDataProvider = BranchDataProvider;
|
|
31233
31399
|
exports2.BranchSwitcher = BranchSwitcher;
|
|
31234
31400
|
exports2.BranchSwitcherPlugin = BranchSwitcherPlugin;
|
|
31235
|
-
exports2.Button = Button;
|
|
31401
|
+
exports2.Button = Button$1;
|
|
31236
31402
|
exports2.ButtonToggle = ButtonToggle;
|
|
31237
31403
|
exports2.ButtonToggleField = ButtonToggleField;
|
|
31238
31404
|
exports2.ButtonToggleFieldPlugin = ButtonToggleFieldPlugin;
|