tinacms 2.0.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 +346 -169
- package/dist/index.mjs +350 -167
- 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/dist/toolkit/fields/plugins/mdx-field-plugin/index.d.ts +4 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/ui/toolbar/index.d.ts +5 -2
- package/package.json +13 -6
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,
|
|
@@ -3699,7 +3705,18 @@ var __publicField = (obj, key, value) => {
|
|
|
3699
3705
|
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
3700
3706
|
"application/msword",
|
|
3701
3707
|
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
|
3702
|
-
"
|
|
3708
|
+
"application/postscript",
|
|
3709
|
+
"model/fbx",
|
|
3710
|
+
"model/gltf+json",
|
|
3711
|
+
"model/ply",
|
|
3712
|
+
"model/u3d+mesh",
|
|
3713
|
+
"model/vnd.usdz+zip",
|
|
3714
|
+
"application/x-indesign",
|
|
3715
|
+
"application/vnd.apple.mpegurl",
|
|
3716
|
+
"application/dash+xml",
|
|
3717
|
+
"application/mxf",
|
|
3718
|
+
"image/*",
|
|
3719
|
+
"video/*"
|
|
3703
3720
|
];
|
|
3704
3721
|
const DEFAULT_MEDIA_UPLOAD_TYPES = supportedFileTypes.join(",");
|
|
3705
3722
|
const dropzoneAcceptFromString = (str) => {
|
|
@@ -3780,6 +3797,128 @@ var __publicField = (obj, key, value) => {
|
|
|
3780
3797
|
return /* @__PURE__ */ React__namespace.createElement(IconButton, { variant: "white", className: "flex-none", onClick }, /* @__PURE__ */ React__namespace.createElement(TrashIcon, { className: "w-7 h-auto" }));
|
|
3781
3798
|
};
|
|
3782
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;
|
|
3783
3922
|
const useGetOptionSets = (cms, collections) => {
|
|
3784
3923
|
const [optionSets, setOptionSets] = React__namespace.useState([]);
|
|
3785
3924
|
const [loading, setLoading] = React__namespace.useState(true);
|
|
@@ -3799,8 +3938,9 @@ var __publicField = (obj, key, value) => {
|
|
|
3799
3938
|
id,
|
|
3800
3939
|
}
|
|
3801
3940
|
...on Document {
|
|
3941
|
+
_values
|
|
3802
3942
|
_internalSys: _sys {
|
|
3803
|
-
|
|
3943
|
+
filename
|
|
3804
3944
|
}
|
|
3805
3945
|
}
|
|
3806
3946
|
}
|
|
@@ -3834,41 +3974,78 @@ var __publicField = (obj, key, value) => {
|
|
|
3834
3974
|
}, [cms, collections]);
|
|
3835
3975
|
return { optionSets, loading };
|
|
3836
3976
|
};
|
|
3837
|
-
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 = ({
|
|
3838
3985
|
cms,
|
|
3839
3986
|
input,
|
|
3840
3987
|
field
|
|
3841
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);
|
|
3842
3992
|
const { optionSets, loading } = useGetOptionSets(cms, field.collections);
|
|
3843
|
-
const ref = React__namespace.useRef(null);
|
|
3844
3993
|
React__namespace.useEffect(() => {
|
|
3845
|
-
|
|
3846
|
-
|
|
3847
|
-
|
|
3848
|
-
}, [field.experimental_focusIntent, ref]);
|
|
3994
|
+
setDisplayText(getFilename(optionSets, value));
|
|
3995
|
+
input.onChange(value);
|
|
3996
|
+
}, [value, input, optionSets]);
|
|
3849
3997
|
if (loading === true) {
|
|
3850
3998
|
return /* @__PURE__ */ React__namespace.createElement(LoadingDots, { color: "var(--tina-color-primary)" });
|
|
3851
3999
|
}
|
|
3852
|
-
return /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, /* @__PURE__ */ React__namespace.createElement(
|
|
3853
|
-
|
|
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,
|
|
3854
4002
|
{
|
|
3855
|
-
|
|
3856
|
-
|
|
3857
|
-
|
|
3858
|
-
|
|
3859
|
-
className: selectFieldClasses,
|
|
3860
|
-
...input
|
|
4003
|
+
variant: "outline",
|
|
4004
|
+
role: "combobox",
|
|
4005
|
+
"aria-expanded": open2,
|
|
4006
|
+
className: "w-52 justify-between"
|
|
3861
4007
|
},
|
|
3862
|
-
/* @__PURE__ */ React__namespace.createElement("
|
|
3863
|
-
|
|
3864
|
-
|
|
3865
|
-
|
|
3866
|
-
|
|
3867
|
-
|
|
3868
|
-
|
|
3869
|
-
|
|
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
|
+
))
|
|
3870
4047
|
)))
|
|
3871
|
-
)
|
|
4048
|
+
))));
|
|
3872
4049
|
};
|
|
3873
4050
|
const useGetNode = (cms, id) => {
|
|
3874
4051
|
const [document2, setDocument] = React__namespace.useState(
|
|
@@ -3933,7 +4110,7 @@ var __publicField = (obj, key, value) => {
|
|
|
3933
4110
|
"a",
|
|
3934
4111
|
{
|
|
3935
4112
|
href: `${tinaPreview ? `/${tinaPreview}/index.html#` : "/admin#"}/collections/${document2._sys.collection.name}/${document2._sys.breadcrumbs.join("/")}`,
|
|
3936
|
-
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"
|
|
3937
4114
|
},
|
|
3938
4115
|
/* @__PURE__ */ React__namespace.createElement(BiEdit, { className: "h-5 w-auto opacity-80 mr-2" }),
|
|
3939
4116
|
"Edit in CMS"
|
|
@@ -3941,7 +4118,7 @@ var __publicField = (obj, key, value) => {
|
|
|
3941
4118
|
};
|
|
3942
4119
|
const Reference = ({ input, field }) => {
|
|
3943
4120
|
const cms = useCMS();
|
|
3944
|
-
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 }));
|
|
3945
4122
|
};
|
|
3946
4123
|
const ButtonToggle = ({
|
|
3947
4124
|
input,
|
|
@@ -6217,21 +6394,21 @@ var __publicField = (obj, key, value) => {
|
|
|
6217
6394
|
return parsedDate;
|
|
6218
6395
|
}
|
|
6219
6396
|
getClassName() {
|
|
6220
|
-
let
|
|
6397
|
+
let cn2 = "rdt";
|
|
6221
6398
|
let props = this.props;
|
|
6222
6399
|
let propCn = props.className;
|
|
6223
6400
|
if (Array.isArray(propCn)) {
|
|
6224
|
-
|
|
6401
|
+
cn2 += " " + propCn.join(" ");
|
|
6225
6402
|
} else if (propCn) {
|
|
6226
|
-
|
|
6403
|
+
cn2 += " " + propCn;
|
|
6227
6404
|
}
|
|
6228
6405
|
if (!props.input) {
|
|
6229
|
-
|
|
6406
|
+
cn2 += " rdtStatic";
|
|
6230
6407
|
}
|
|
6231
6408
|
if (this.isOpen()) {
|
|
6232
|
-
|
|
6409
|
+
cn2 += " rdtOpen";
|
|
6233
6410
|
}
|
|
6234
|
-
return
|
|
6411
|
+
return cn2;
|
|
6235
6412
|
}
|
|
6236
6413
|
isOpen() {
|
|
6237
6414
|
return !this.props.input || (this.props.open === void 0 ? this.state.open : this.props.open);
|
|
@@ -6705,7 +6882,7 @@ var __publicField = (obj, key, value) => {
|
|
|
6705
6882
|
}
|
|
6706
6883
|
}
|
|
6707
6884
|
), /* @__PURE__ */ React__namespace.createElement(
|
|
6708
|
-
Button,
|
|
6885
|
+
Button$1,
|
|
6709
6886
|
{
|
|
6710
6887
|
variant: "secondary",
|
|
6711
6888
|
disabled: password === void 0 && confirmPassword === void 0,
|
|
@@ -6865,7 +7042,7 @@ var __publicField = (obj, key, value) => {
|
|
|
6865
7042
|
},
|
|
6866
7043
|
"Learn more about moving to production with Tina Cloud."
|
|
6867
7044
|
)), /* @__PURE__ */ React__namespace.createElement("p", null, /* @__PURE__ */ React__namespace.createElement(
|
|
6868
|
-
Button,
|
|
7045
|
+
Button$1,
|
|
6869
7046
|
{
|
|
6870
7047
|
href: "https://tina.io/docs/tina-cloud/",
|
|
6871
7048
|
target: "_blank",
|
|
@@ -6886,7 +7063,7 @@ var __publicField = (obj, key, value) => {
|
|
|
6886
7063
|
chooseBranch(branchName);
|
|
6887
7064
|
}
|
|
6888
7065
|
}
|
|
6889
|
-
) : /* @__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" }))))));
|
|
6890
7067
|
};
|
|
6891
7068
|
const getFilteredBranchList$1 = (branchList, filter, currentBranchName) => {
|
|
6892
7069
|
const filteredBranchList = branchList.filter(
|
|
@@ -6971,7 +7148,7 @@ var __publicField = (obj, key, value) => {
|
|
|
6971
7148
|
onChange: (e) => setNewBranchName(e.target.value)
|
|
6972
7149
|
}
|
|
6973
7150
|
), /* @__PURE__ */ React__namespace.createElement(
|
|
6974
|
-
Button,
|
|
7151
|
+
Button$1,
|
|
6975
7152
|
{
|
|
6976
7153
|
className: "flex-0 flex items-center gap-2 whitespace-nowrap",
|
|
6977
7154
|
size: "medium",
|
|
@@ -7101,7 +7278,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7101
7278
|
},
|
|
7102
7279
|
"Learn more about moving to production with Tina Cloud."
|
|
7103
7280
|
)), /* @__PURE__ */ React__namespace.createElement("p", null, /* @__PURE__ */ React__namespace.createElement(
|
|
7104
|
-
Button,
|
|
7281
|
+
Button$1,
|
|
7105
7282
|
{
|
|
7106
7283
|
href: "https://tina.io/docs/tina-cloud/",
|
|
7107
7284
|
target: "_blank",
|
|
@@ -7129,7 +7306,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7129
7306
|
chooseBranch(branchName);
|
|
7130
7307
|
}
|
|
7131
7308
|
}
|
|
7132
|
-
) : /* @__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" }))))));
|
|
7133
7310
|
};
|
|
7134
7311
|
const getFilteredBranchList = (branchList, search, currentBranchName, filter = "all") => {
|
|
7135
7312
|
const filteredBranchList = branchList.filter(
|
|
@@ -7183,7 +7360,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7183
7360
|
onChange: (e) => setBranchName(e.target.value)
|
|
7184
7361
|
}
|
|
7185
7362
|
))), /* @__PURE__ */ React__namespace.createElement("div", { className: "w-full flex justify-between gap-4 items-center" }, /* @__PURE__ */ React__namespace.createElement(
|
|
7186
|
-
Button,
|
|
7363
|
+
Button$1,
|
|
7187
7364
|
{
|
|
7188
7365
|
style: { flexGrow: 1 },
|
|
7189
7366
|
onClick: () => {
|
|
@@ -7192,7 +7369,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7192
7369
|
},
|
|
7193
7370
|
"Cancel"
|
|
7194
7371
|
), /* @__PURE__ */ React__namespace.createElement(
|
|
7195
|
-
Button,
|
|
7372
|
+
Button$1,
|
|
7196
7373
|
{
|
|
7197
7374
|
variant: "primary",
|
|
7198
7375
|
type: "submit",
|
|
@@ -7293,7 +7470,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7293
7470
|
}
|
|
7294
7471
|
))),
|
|
7295
7472
|
/* @__PURE__ */ React__namespace.createElement("div", { className: "flex items-center" }, indexingStatus === "complete" && !isCurrentBranch && /* @__PURE__ */ React__namespace.createElement(
|
|
7296
|
-
Button,
|
|
7473
|
+
Button$1,
|
|
7297
7474
|
{
|
|
7298
7475
|
variant: "white",
|
|
7299
7476
|
size: "custom",
|
|
@@ -8264,7 +8441,7 @@ var __publicField = (obj, key, value) => {
|
|
|
8264
8441
|
/* @__PURE__ */ React__namespace.createElement(Emoji$1, { className: "pb-5" }, "🔎"),
|
|
8265
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."),
|
|
8266
8443
|
/* @__PURE__ */ React__namespace.createElement("p", { className: "block" }, /* @__PURE__ */ React__namespace.createElement(
|
|
8267
|
-
Button,
|
|
8444
|
+
Button$1,
|
|
8268
8445
|
{
|
|
8269
8446
|
href: "https://tina.io/docs/tinacms-context/",
|
|
8270
8447
|
target: "_blank",
|
|
@@ -8783,7 +8960,7 @@ var __publicField = (obj, key, value) => {
|
|
|
8783
8960
|
/* @__PURE__ */ React__namespace.createElement("span", { className: "w-full block text-gray-300 text-xs mt-0.5" }, time)
|
|
8784
8961
|
));
|
|
8785
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(
|
|
8786
|
-
Button,
|
|
8963
|
+
Button$1,
|
|
8787
8964
|
{
|
|
8788
8965
|
onClick: () => {
|
|
8789
8966
|
setExistingEvents(events);
|
|
@@ -9333,7 +9510,7 @@ var __publicField = (obj, key, value) => {
|
|
|
9333
9510
|
)
|
|
9334
9511
|
},
|
|
9335
9512
|
/* @__PURE__ */ React__namespace.createElement("div", { className: "absolute top-8 right-0 transform translate-x-full overflow-hidden" }, /* @__PURE__ */ React__namespace.createElement(
|
|
9336
|
-
Button,
|
|
9513
|
+
Button$1,
|
|
9337
9514
|
{
|
|
9338
9515
|
rounded: "right",
|
|
9339
9516
|
variant: "secondary",
|
|
@@ -9407,7 +9584,7 @@ var __publicField = (obj, key, value) => {
|
|
|
9407
9584
|
const branch = (_h = (_g = cms.api) == null ? void 0 : _g.tina) == null ? void 0 : _h.branch;
|
|
9408
9585
|
const previewUrl = typeof previewFunction === "function" ? (_i = previewFunction({ branch })) == null ? void 0 : _i.url : null;
|
|
9409
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(
|
|
9410
|
-
Button,
|
|
9587
|
+
Button$1,
|
|
9411
9588
|
{
|
|
9412
9589
|
rounded: "right",
|
|
9413
9590
|
variant: "white",
|
|
@@ -9433,7 +9610,7 @@ var __publicField = (obj, key, value) => {
|
|
|
9433
9610
|
className: `flex items-center pointer-events-auto transition-opacity duration-150 ease-in-out -mr-px`
|
|
9434
9611
|
},
|
|
9435
9612
|
/* @__PURE__ */ React__namespace.createElement(
|
|
9436
|
-
Button,
|
|
9613
|
+
Button$1,
|
|
9437
9614
|
{
|
|
9438
9615
|
rounded: "left",
|
|
9439
9616
|
variant: "white",
|
|
@@ -9443,7 +9620,7 @@ var __publicField = (obj, key, value) => {
|
|
|
9443
9620
|
},
|
|
9444
9621
|
/* @__PURE__ */ React__namespace.createElement(MdOutlineArrowBackIos, { className: "h-[18px] w-auto -mr-1 text-blue-500" })
|
|
9445
9622
|
),
|
|
9446
|
-
/* @__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" ? (
|
|
9447
9624
|
// BiCollapseAlt
|
|
9448
9625
|
/* @__PURE__ */ React__namespace.createElement(
|
|
9449
9626
|
"svg",
|
|
@@ -9512,7 +9689,7 @@ var __publicField = (obj, key, value) => {
|
|
|
9512
9689
|
const EditButton = ({}) => {
|
|
9513
9690
|
const { displayState, toggleSidebarOpen } = React__namespace.useContext(SidebarContext);
|
|
9514
9691
|
return /* @__PURE__ */ React__namespace.createElement(
|
|
9515
|
-
Button,
|
|
9692
|
+
Button$1,
|
|
9516
9693
|
{
|
|
9517
9694
|
rounded: "right",
|
|
9518
9695
|
variant: "primary",
|
|
@@ -9598,7 +9775,7 @@ var __publicField = (obj, key, value) => {
|
|
|
9598
9775
|
hasPrev,
|
|
9599
9776
|
variant = "white"
|
|
9600
9777
|
}) {
|
|
9601
|
-
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" })));
|
|
9602
9779
|
}
|
|
9603
9780
|
function ListMediaItem({ item, onClick, active }) {
|
|
9604
9781
|
let FileIcon = BiFile;
|
|
@@ -9733,8 +9910,8 @@ var __publicField = (obj, key, value) => {
|
|
|
9733
9910
|
deleteFunc,
|
|
9734
9911
|
filename
|
|
9735
9912
|
}) => {
|
|
9736
|
-
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(
|
|
9737
|
-
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,
|
|
9738
9915
|
{
|
|
9739
9916
|
style: { flexGrow: 3 },
|
|
9740
9917
|
variant: "danger",
|
|
@@ -9756,8 +9933,8 @@ var __publicField = (obj, key, value) => {
|
|
|
9756
9933
|
required: true,
|
|
9757
9934
|
onChange: (e) => setFolderName(e.target.value)
|
|
9758
9935
|
}
|
|
9759
|
-
)), /* @__PURE__ */ React.createElement(ModalActions, null, /* @__PURE__ */ React.createElement(Button, { style: { flexGrow: 2 }, onClick: close2 }, "Cancel"), /* @__PURE__ */ React.createElement(
|
|
9760
|
-
Button,
|
|
9936
|
+
)), /* @__PURE__ */ React.createElement(ModalActions, null, /* @__PURE__ */ React.createElement(Button$1, { style: { flexGrow: 2 }, onClick: close2 }, "Cancel"), /* @__PURE__ */ React.createElement(
|
|
9937
|
+
Button$1,
|
|
9761
9938
|
{
|
|
9762
9939
|
disabled: !folderName,
|
|
9763
9940
|
style: { flexGrow: 3 },
|
|
@@ -10065,7 +10242,7 @@ var __publicField = (obj, key, value) => {
|
|
|
10065
10242
|
close: () => setNewFolderModalOpen(false)
|
|
10066
10243
|
}
|
|
10067
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(
|
|
10068
|
-
Button,
|
|
10245
|
+
Button$1,
|
|
10069
10246
|
{
|
|
10070
10247
|
busy: false,
|
|
10071
10248
|
variant: "white",
|
|
@@ -10075,7 +10252,7 @@ var __publicField = (obj, key, value) => {
|
|
|
10075
10252
|
"Refresh",
|
|
10076
10253
|
/* @__PURE__ */ React.createElement(IoMdRefresh, { className: "w-6 h-full ml-2 opacity-70 text-blue-500" })
|
|
10077
10254
|
), /* @__PURE__ */ React.createElement(
|
|
10078
|
-
Button,
|
|
10255
|
+
Button$1,
|
|
10079
10256
|
{
|
|
10080
10257
|
busy: false,
|
|
10081
10258
|
variant: "white",
|
|
@@ -10167,7 +10344,7 @@ var __publicField = (obj, key, value) => {
|
|
|
10167
10344
|
alt: activeItem.filename
|
|
10168
10345
|
}
|
|
10169
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(
|
|
10170
|
-
Button,
|
|
10347
|
+
Button$1,
|
|
10171
10348
|
{
|
|
10172
10349
|
size: "medium",
|
|
10173
10350
|
variant: "primary",
|
|
@@ -10177,7 +10354,7 @@ var __publicField = (obj, key, value) => {
|
|
|
10177
10354
|
"Insert",
|
|
10178
10355
|
/* @__PURE__ */ React.createElement(BiArrowToBottom, { className: "ml-1 -mr-0.5 w-6 h-auto text-white opacity-70" })
|
|
10179
10356
|
), allowDelete && /* @__PURE__ */ React.createElement(
|
|
10180
|
-
Button,
|
|
10357
|
+
Button$1,
|
|
10181
10358
|
{
|
|
10182
10359
|
variant: "white",
|
|
10183
10360
|
size: "medium",
|
|
@@ -10191,7 +10368,7 @@ var __publicField = (obj, key, value) => {
|
|
|
10191
10368
|
};
|
|
10192
10369
|
const UploadButton = ({ onClick, uploading }) => {
|
|
10193
10370
|
return /* @__PURE__ */ React.createElement(
|
|
10194
|
-
Button,
|
|
10371
|
+
Button$1,
|
|
10195
10372
|
{
|
|
10196
10373
|
variant: "primary",
|
|
10197
10374
|
size: "custom",
|
|
@@ -10413,7 +10590,7 @@ var __publicField = (obj, key, value) => {
|
|
|
10413
10590
|
required: true
|
|
10414
10591
|
}
|
|
10415
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(
|
|
10416
|
-
Button,
|
|
10593
|
+
Button$1,
|
|
10417
10594
|
{
|
|
10418
10595
|
onClick: updatePassword,
|
|
10419
10596
|
disabled: err,
|
|
@@ -10765,7 +10942,7 @@ var __publicField = (obj, key, value) => {
|
|
|
10765
10942
|
" ",
|
|
10766
10943
|
"Error"
|
|
10767
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(
|
|
10768
|
-
Button,
|
|
10945
|
+
Button$1,
|
|
10769
10946
|
{
|
|
10770
10947
|
style: { flexGrow: 1 },
|
|
10771
10948
|
onClick: () => {
|
|
@@ -11064,7 +11241,7 @@ var __publicField = (obj, key, value) => {
|
|
|
11064
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`
|
|
11065
11242
|
},
|
|
11066
11243
|
/* @__PURE__ */ React__namespace.createElement(
|
|
11067
|
-
Button,
|
|
11244
|
+
Button$1,
|
|
11068
11245
|
{
|
|
11069
11246
|
variant: isProtected ? "primary" : "white",
|
|
11070
11247
|
size: "small",
|
|
@@ -11086,7 +11263,7 @@ var __publicField = (obj, key, value) => {
|
|
|
11086
11263
|
)
|
|
11087
11264
|
),
|
|
11088
11265
|
previewUrl && /* @__PURE__ */ React__namespace.createElement(
|
|
11089
|
-
Button,
|
|
11266
|
+
Button$1,
|
|
11090
11267
|
{
|
|
11091
11268
|
variant: "white",
|
|
11092
11269
|
size: "small",
|
|
@@ -11302,7 +11479,7 @@ var __publicField = (obj, key, value) => {
|
|
|
11302
11479
|
},
|
|
11303
11480
|
tinaForm.buttons.reset
|
|
11304
11481
|
), /* @__PURE__ */ React__namespace.createElement(
|
|
11305
|
-
Button,
|
|
11482
|
+
Button$1,
|
|
11306
11483
|
{
|
|
11307
11484
|
onClick: safeHandleSubmit,
|
|
11308
11485
|
disabled: !canSubmit,
|
|
@@ -11429,8 +11606,8 @@ var __publicField = (obj, key, value) => {
|
|
|
11429
11606
|
setNewBranchName(formatBranchName(e.target.value));
|
|
11430
11607
|
}
|
|
11431
11608
|
}
|
|
11432
|
-
), 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(
|
|
11433
|
-
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,
|
|
11434
11611
|
{
|
|
11435
11612
|
variant: "primary",
|
|
11436
11613
|
style: { flexGrow: 2 },
|
|
@@ -12406,7 +12583,7 @@ var __publicField = (obj, key, value) => {
|
|
|
12406
12583
|
props.onClose();
|
|
12407
12584
|
}, [editor, formValues]);
|
|
12408
12585
|
const UpdateLink = React.useCallback(
|
|
12409
|
-
() => /* @__PURE__ */ React.createElement(Button, { variant: "primary", onClick: handleUpdate }, "Update Link"),
|
|
12586
|
+
() => /* @__PURE__ */ React.createElement(Button$1, { variant: "primary", onClick: handleUpdate }, "Update Link"),
|
|
12410
12587
|
[handleUpdate]
|
|
12411
12588
|
);
|
|
12412
12589
|
return /* @__PURE__ */ React.createElement(
|
|
@@ -12770,6 +12947,7 @@ var __publicField = (obj, key, value) => {
|
|
|
12770
12947
|
const EMBED_ICON_WIDTH = 85;
|
|
12771
12948
|
function Toolbar({
|
|
12772
12949
|
templates,
|
|
12950
|
+
toolbarOverride,
|
|
12773
12951
|
tinaForm
|
|
12774
12952
|
}) {
|
|
12775
12953
|
const { setRawMode } = useEditorContext();
|
|
@@ -12785,8 +12963,8 @@ var __publicField = (obj, key, value) => {
|
|
|
12785
12963
|
const codeBlockActive = helpers.isNodeActive(editor, plateHeadless.ELEMENT_CODE_BLOCK);
|
|
12786
12964
|
const blockQuoteActive = helpers.isNodeActive(editor, plateHeadless.ELEMENT_BLOCKQUOTE);
|
|
12787
12965
|
const isImgActive = helpers.isNodeActive(editor, ELEMENT_IMG);
|
|
12788
|
-
const
|
|
12789
|
-
{
|
|
12966
|
+
const toolbarItemLookup = {
|
|
12967
|
+
heading: {
|
|
12790
12968
|
tinaForm,
|
|
12791
12969
|
name: "heading",
|
|
12792
12970
|
label: "Heading",
|
|
@@ -12807,19 +12985,19 @@ var __publicField = (obj, key, value) => {
|
|
|
12807
12985
|
item.render
|
|
12808
12986
|
))
|
|
12809
12987
|
},
|
|
12810
|
-
{
|
|
12988
|
+
link: {
|
|
12811
12989
|
tinaForm,
|
|
12812
12990
|
name: "link",
|
|
12813
12991
|
label: "Link",
|
|
12814
12992
|
active: isLinkActive2
|
|
12815
12993
|
},
|
|
12816
|
-
{
|
|
12994
|
+
image: {
|
|
12817
12995
|
tinaForm,
|
|
12818
12996
|
name: "image",
|
|
12819
12997
|
label: "Image",
|
|
12820
12998
|
active: isImgActive
|
|
12821
12999
|
},
|
|
12822
|
-
{
|
|
13000
|
+
quote: {
|
|
12823
13001
|
tinaForm,
|
|
12824
13002
|
name: "quote",
|
|
12825
13003
|
label: "Quote",
|
|
@@ -12830,7 +13008,7 @@ var __publicField = (obj, key, value) => {
|
|
|
12830
13008
|
plateHeadless.toggleNodeType(editor, { activeType: plateHeadless.ELEMENT_BLOCKQUOTE });
|
|
12831
13009
|
}
|
|
12832
13010
|
},
|
|
12833
|
-
{
|
|
13011
|
+
ul: {
|
|
12834
13012
|
tinaForm,
|
|
12835
13013
|
name: "ul",
|
|
12836
13014
|
label: "Bullet List",
|
|
@@ -12841,7 +13019,7 @@ var __publicField = (obj, key, value) => {
|
|
|
12841
13019
|
plateHeadless.toggleList(editor, { type: plateHeadless.ELEMENT_UL });
|
|
12842
13020
|
}
|
|
12843
13021
|
},
|
|
12844
|
-
{
|
|
13022
|
+
ol: {
|
|
12845
13023
|
tinaForm,
|
|
12846
13024
|
name: "ol",
|
|
12847
13025
|
label: "List",
|
|
@@ -12852,7 +13030,7 @@ var __publicField = (obj, key, value) => {
|
|
|
12852
13030
|
plateHeadless.toggleList(editor, { type: plateHeadless.ELEMENT_OL });
|
|
12853
13031
|
}
|
|
12854
13032
|
},
|
|
12855
|
-
{
|
|
13033
|
+
code: {
|
|
12856
13034
|
tinaForm,
|
|
12857
13035
|
name: "code",
|
|
12858
13036
|
label: "Code",
|
|
@@ -12863,7 +13041,7 @@ var __publicField = (obj, key, value) => {
|
|
|
12863
13041
|
plateHeadless.toggleMark(editor, { key: plateHeadless.MARK_CODE });
|
|
12864
13042
|
}
|
|
12865
13043
|
},
|
|
12866
|
-
{
|
|
13044
|
+
codeBlock: {
|
|
12867
13045
|
tinaForm,
|
|
12868
13046
|
name: "codeBlock",
|
|
12869
13047
|
label: "Code Block",
|
|
@@ -12874,7 +13052,7 @@ var __publicField = (obj, key, value) => {
|
|
|
12874
13052
|
insertEmptyCodeBlock(editor);
|
|
12875
13053
|
}
|
|
12876
13054
|
},
|
|
12877
|
-
{
|
|
13055
|
+
bold: {
|
|
12878
13056
|
tinaForm,
|
|
12879
13057
|
name: "bold",
|
|
12880
13058
|
label: "Bold",
|
|
@@ -12885,7 +13063,7 @@ var __publicField = (obj, key, value) => {
|
|
|
12885
13063
|
plateHeadless.toggleMark(editor, { key: plateHeadless.MARK_BOLD });
|
|
12886
13064
|
}
|
|
12887
13065
|
},
|
|
12888
|
-
{
|
|
13066
|
+
italic: {
|
|
12889
13067
|
tinaForm,
|
|
12890
13068
|
name: "italic",
|
|
12891
13069
|
label: "Italic",
|
|
@@ -12896,14 +13074,15 @@ var __publicField = (obj, key, value) => {
|
|
|
12896
13074
|
plateHeadless.toggleMark(editor, { key: plateHeadless.MARK_ITALIC });
|
|
12897
13075
|
}
|
|
12898
13076
|
},
|
|
12899
|
-
{
|
|
13077
|
+
raw: {
|
|
12900
13078
|
tinaForm,
|
|
12901
13079
|
name: "raw",
|
|
12902
13080
|
label: "Raw",
|
|
12903
13081
|
active: false,
|
|
12904
13082
|
onMouseDown: () => setRawMode(true)
|
|
12905
13083
|
}
|
|
12906
|
-
|
|
13084
|
+
};
|
|
13085
|
+
const toolbarItems = toolbarOverride === void 0 ? Object.values(toolbarItemLookup) : toolbarOverride.map((item) => toolbarItemLookup[item]).filter((item) => item !== void 0);
|
|
12907
13086
|
const [itemsShown, setItemsShown] = React__namespace.useState(toolbarItems.length);
|
|
12908
13087
|
useResize(toolbarRef, (entry) => {
|
|
12909
13088
|
const width = entry.target.getBoundingClientRect().width;
|
|
@@ -13048,10 +13227,11 @@ var __publicField = (obj, key, value) => {
|
|
|
13048
13227
|
))));
|
|
13049
13228
|
}
|
|
13050
13229
|
const RichEditor = (props) => {
|
|
13230
|
+
var _a;
|
|
13051
13231
|
const initialValue = React.useMemo(
|
|
13052
13232
|
() => {
|
|
13053
|
-
var
|
|
13054
|
-
return ((_b = (
|
|
13233
|
+
var _a2, _b;
|
|
13234
|
+
return ((_b = (_a2 = props.input.value) == null ? void 0 : _a2.children) == null ? void 0 : _b.length) ? props.input.value.children.map(helpers.normalize) : [{ type: "p", children: [{ type: "text", text: "" }] }];
|
|
13055
13235
|
},
|
|
13056
13236
|
[]
|
|
13057
13237
|
);
|
|
@@ -13079,8 +13259,8 @@ var __publicField = (obj, key, value) => {
|
|
|
13079
13259
|
React.useEffect(() => {
|
|
13080
13260
|
if (ref.current) {
|
|
13081
13261
|
setTimeout(() => {
|
|
13082
|
-
var
|
|
13083
|
-
const plateElement = (
|
|
13262
|
+
var _a2;
|
|
13263
|
+
const plateElement = (_a2 = ref.current) == null ? void 0 : _a2.querySelector(
|
|
13084
13264
|
'[role="textbox"]'
|
|
13085
13265
|
);
|
|
13086
13266
|
if (props.field.experimental_focusIntent && plateElement) {
|
|
@@ -13106,6 +13286,7 @@ var __publicField = (obj, key, value) => {
|
|
|
13106
13286
|
Toolbar,
|
|
13107
13287
|
{
|
|
13108
13288
|
tinaForm: props.tinaForm,
|
|
13289
|
+
toolbarOverride: (_a = props.field) == null ? void 0 : _a.toolbarOverride,
|
|
13109
13290
|
templates: props.field.templates,
|
|
13110
13291
|
inlineOnly: false
|
|
13111
13292
|
}
|
|
@@ -13115,38 +13296,36 @@ var __publicField = (obj, key, value) => {
|
|
|
13115
13296
|
};
|
|
13116
13297
|
const MdxFieldPlugin = {
|
|
13117
13298
|
name: "rich-text",
|
|
13118
|
-
Component: wrapFieldsWithMeta(
|
|
13119
|
-
(
|
|
13120
|
-
|
|
13121
|
-
|
|
13122
|
-
|
|
13123
|
-
|
|
13124
|
-
|
|
13125
|
-
|
|
13126
|
-
|
|
13127
|
-
|
|
13128
|
-
|
|
13129
|
-
|
|
13130
|
-
|
|
13299
|
+
Component: wrapFieldsWithMeta((props) => {
|
|
13300
|
+
const [rawMode, setRawMode] = React.useState(false);
|
|
13301
|
+
const [key, setKey] = React.useState(0);
|
|
13302
|
+
React.useMemo(() => {
|
|
13303
|
+
const { reset } = props.form;
|
|
13304
|
+
props.form.reset = (initialValues) => {
|
|
13305
|
+
setKey((key2) => key2 + 1);
|
|
13306
|
+
return reset(initialValues);
|
|
13307
|
+
};
|
|
13308
|
+
}, []);
|
|
13309
|
+
return /* @__PURE__ */ React.createElement(
|
|
13310
|
+
EditorContext.Provider,
|
|
13311
|
+
{
|
|
13312
|
+
key,
|
|
13313
|
+
value: {
|
|
13314
|
+
fieldName: props.field.name,
|
|
13315
|
+
templates: props.field.templates,
|
|
13316
|
+
rawMode,
|
|
13317
|
+
setRawMode
|
|
13318
|
+
}
|
|
13319
|
+
},
|
|
13320
|
+
/* @__PURE__ */ React.createElement(
|
|
13321
|
+
"div",
|
|
13131
13322
|
{
|
|
13132
|
-
|
|
13133
|
-
value: {
|
|
13134
|
-
fieldName: props.field.name,
|
|
13135
|
-
templates: props.field.templates,
|
|
13136
|
-
rawMode,
|
|
13137
|
-
setRawMode
|
|
13138
|
-
}
|
|
13323
|
+
className: "min-h-[100px] max-w-full tina-prose relative shadow-inner focus-within:shadow-outline focus-within:border-blue-500 block w-full bg-white border border-gray-200 text-gray-600 focus-within:text-gray-900 rounded-md px-3 py-2"
|
|
13139
13324
|
},
|
|
13140
|
-
/* @__PURE__ */ React.createElement(
|
|
13141
|
-
|
|
13142
|
-
|
|
13143
|
-
|
|
13144
|
-
},
|
|
13145
|
-
/* @__PURE__ */ React.createElement(RichEditor, { ...props })
|
|
13146
|
-
)
|
|
13147
|
-
);
|
|
13148
|
-
}
|
|
13149
|
-
)
|
|
13325
|
+
/* @__PURE__ */ React.createElement(RichEditor, { ...props })
|
|
13326
|
+
)
|
|
13327
|
+
);
|
|
13328
|
+
})
|
|
13150
13329
|
};
|
|
13151
13330
|
const MdxFieldPluginExtendible = {
|
|
13152
13331
|
name: "rich-text",
|
|
@@ -13157,37 +13336,35 @@ var __publicField = (obj, key, value) => {
|
|
|
13157
13336
|
return void 0;
|
|
13158
13337
|
}
|
|
13159
13338
|
},
|
|
13160
|
-
Component: wrapFieldsWithMeta(
|
|
13161
|
-
(
|
|
13162
|
-
|
|
13163
|
-
|
|
13164
|
-
|
|
13165
|
-
|
|
13166
|
-
|
|
13167
|
-
|
|
13168
|
-
|
|
13169
|
-
|
|
13170
|
-
|
|
13171
|
-
|
|
13339
|
+
Component: wrapFieldsWithMeta((props) => {
|
|
13340
|
+
const [key, setKey] = React.useState(0);
|
|
13341
|
+
React.useMemo(() => {
|
|
13342
|
+
const { reset } = props.form;
|
|
13343
|
+
props.form.reset = (initialValues) => {
|
|
13344
|
+
setKey((key2) => key2 + 1);
|
|
13345
|
+
return reset(initialValues);
|
|
13346
|
+
};
|
|
13347
|
+
}, []);
|
|
13348
|
+
return /* @__PURE__ */ React.createElement(
|
|
13349
|
+
EditorContext.Provider,
|
|
13350
|
+
{
|
|
13351
|
+
key,
|
|
13352
|
+
value: {
|
|
13353
|
+
fieldName: props.field.name,
|
|
13354
|
+
templates: props.field.templates,
|
|
13355
|
+
rawMode: props.rawMode,
|
|
13356
|
+
setRawMode: props.setRawMode
|
|
13357
|
+
}
|
|
13358
|
+
},
|
|
13359
|
+
/* @__PURE__ */ React.createElement(
|
|
13360
|
+
"div",
|
|
13172
13361
|
{
|
|
13173
|
-
|
|
13174
|
-
value: {
|
|
13175
|
-
fieldName: props.field.name,
|
|
13176
|
-
templates: props.field.templates,
|
|
13177
|
-
rawMode: props.rawMode,
|
|
13178
|
-
setRawMode: props.setRawMode
|
|
13179
|
-
}
|
|
13362
|
+
className: "min-h-[100px] max-w-full tina-prose relative shadow-inner focus-within:shadow-outline focus-within:border-blue-500 block w-full bg-white border border-gray-200 text-gray-600 focus-within:text-gray-900 rounded-md px-3 py-2"
|
|
13180
13363
|
},
|
|
13181
|
-
/* @__PURE__ */ React.createElement(
|
|
13182
|
-
|
|
13183
|
-
|
|
13184
|
-
|
|
13185
|
-
},
|
|
13186
|
-
props.rawMode ? props.rawEditor : /* @__PURE__ */ React.createElement(RichEditor, { ...props })
|
|
13187
|
-
)
|
|
13188
|
-
);
|
|
13189
|
-
}
|
|
13190
|
-
)
|
|
13364
|
+
props.rawMode ? props.rawEditor : /* @__PURE__ */ React.createElement(RichEditor, { ...props })
|
|
13365
|
+
)
|
|
13366
|
+
);
|
|
13367
|
+
})
|
|
13191
13368
|
};
|
|
13192
13369
|
class FormMetaPlugin {
|
|
13193
13370
|
constructor(options) {
|
|
@@ -27506,7 +27683,7 @@ mutation addPendingDocumentMutation(
|
|
|
27506
27683
|
}
|
|
27507
27684
|
}, [action, setSubmitting, mounted]);
|
|
27508
27685
|
return /* @__PURE__ */ React.createElement(
|
|
27509
|
-
Button,
|
|
27686
|
+
Button$1,
|
|
27510
27687
|
{
|
|
27511
27688
|
"data-test": name.replace(/\s/g, "-").toLowerCase(),
|
|
27512
27689
|
variant: primary ? "primary" : "secondary",
|
|
@@ -28880,7 +29057,7 @@ This will work when developing locally but NOT when deployed to production.
|
|
|
28880
29057
|
)
|
|
28881
29058
|
},
|
|
28882
29059
|
/* @__PURE__ */ React.createElement("div", { className: "absolute top-8 right-0 transform translate-x-full overflow-hidden" }, /* @__PURE__ */ React.createElement(
|
|
28883
|
-
Button,
|
|
29060
|
+
Button$1,
|
|
28884
29061
|
{
|
|
28885
29062
|
rounded: "right",
|
|
28886
29063
|
variant: "secondary",
|
|
@@ -28914,7 +29091,7 @@ This will work when developing locally but NOT when deployed to production.
|
|
|
28914
29091
|
}
|
|
28915
29092
|
)
|
|
28916
29093
|
)), !renderDesktopNav && /* @__PURE__ */ React.createElement(
|
|
28917
|
-
Button,
|
|
29094
|
+
Button$1,
|
|
28918
29095
|
{
|
|
28919
29096
|
rounded: "right",
|
|
28920
29097
|
variant: "secondary",
|
|
@@ -29111,7 +29288,7 @@ This will work when developing locally but NOT when deployed to production.
|
|
|
29111
29288
|
title = "Error",
|
|
29112
29289
|
errorMessage = "It looks like something went wrong."
|
|
29113
29290
|
}) => {
|
|
29114
|
-
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"));
|
|
29115
29292
|
};
|
|
29116
29293
|
const useGetCollection = (cms, collectionName, includeDocuments = true, folder, after = "", sortKey, filterArgs) => {
|
|
29117
29294
|
const api = new TinaAdminApi(cms);
|
|
@@ -29976,7 +30153,7 @@ This will work when developing locally but NOT when deployed to production.
|
|
|
29976
30153
|
}
|
|
29977
30154
|
}
|
|
29978
30155
|
)), /* @__PURE__ */ React.createElement("div", { className: "flex w-full md:w-auto gap-3" }, /* @__PURE__ */ React.createElement(
|
|
29979
|
-
Button,
|
|
30156
|
+
Button$1,
|
|
29980
30157
|
{
|
|
29981
30158
|
onClick: () => {
|
|
29982
30159
|
setSearch(searchInput);
|
|
@@ -29988,7 +30165,7 @@ This will work when developing locally but NOT when deployed to production.
|
|
|
29988
30165
|
"Search ",
|
|
29989
30166
|
/* @__PURE__ */ React.createElement(BiSearch, { className: "w-5 h-full ml-1.5 opacity-70" })
|
|
29990
30167
|
), search && searchLoaded && /* @__PURE__ */ React.createElement(
|
|
29991
|
-
Button,
|
|
30168
|
+
Button$1,
|
|
29992
30169
|
{
|
|
29993
30170
|
onClick: () => {
|
|
29994
30171
|
setSearch("");
|
|
@@ -30058,8 +30235,8 @@ This will work when developing locally but NOT when deployed to production.
|
|
|
30058
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."));
|
|
30059
30236
|
};
|
|
30060
30237
|
const DeleteModal = ({ close: close2, deleteFunc, filename }) => {
|
|
30061
|
-
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(
|
|
30062
|
-
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,
|
|
30063
30240
|
{
|
|
30064
30241
|
style: { flexGrow: 3 },
|
|
30065
30242
|
variant: "danger",
|
|
@@ -30084,8 +30261,8 @@ This will work when developing locally but NOT when deployed to production.
|
|
|
30084
30261
|
value: folderName,
|
|
30085
30262
|
onChange: (event) => setFolderName(event.target.value)
|
|
30086
30263
|
}
|
|
30087
|
-
))), /* @__PURE__ */ React.createElement(ModalActions, null, /* @__PURE__ */ React.createElement(Button, { style: { flexGrow: 2 }, onClick: close2 }, "Cancel"), /* @__PURE__ */ React.createElement(
|
|
30088
|
-
Button,
|
|
30264
|
+
))), /* @__PURE__ */ React.createElement(ModalActions, null, /* @__PURE__ */ React.createElement(Button$1, { style: { flexGrow: 2 }, onClick: close2 }, "Cancel"), /* @__PURE__ */ React.createElement(
|
|
30265
|
+
Button$1,
|
|
30089
30266
|
{
|
|
30090
30267
|
style: { flexGrow: 3 },
|
|
30091
30268
|
variant: "primary",
|
|
@@ -30111,8 +30288,8 @@ This will work when developing locally but NOT when deployed to production.
|
|
|
30111
30288
|
value: newRelativePath,
|
|
30112
30289
|
onChange: (event) => setNewRelativePath(event.target.value)
|
|
30113
30290
|
}
|
|
30114
|
-
))), /* @__PURE__ */ React.createElement(ModalActions, null, /* @__PURE__ */ React.createElement(Button, { style: { flexGrow: 2 }, onClick: close2 }, "Cancel"), /* @__PURE__ */ React.createElement(
|
|
30115
|
-
Button,
|
|
30291
|
+
))), /* @__PURE__ */ React.createElement(ModalActions, null, /* @__PURE__ */ React.createElement(Button$1, { style: { flexGrow: 2 }, onClick: close2 }, "Cancel"), /* @__PURE__ */ React.createElement(
|
|
30292
|
+
Button$1,
|
|
30116
30293
|
{
|
|
30117
30294
|
style: { flexGrow: 3 },
|
|
30118
30295
|
variant: "primary",
|
|
@@ -30910,7 +31087,7 @@ This will work when developing locally but NOT when deployed to production.
|
|
|
30910
31087
|
}
|
|
30911
31088
|
}, [cms, JSON.stringify(schemaJson || {}), url]);
|
|
30912
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(
|
|
30913
|
-
Button,
|
|
31090
|
+
Button$1,
|
|
30914
31091
|
{
|
|
30915
31092
|
style: { flexGrow: 1 },
|
|
30916
31093
|
className: "w-full",
|
|
@@ -31221,7 +31398,7 @@ This will work when developing locally but NOT when deployed to production.
|
|
|
31221
31398
|
exports2.BranchDataProvider = BranchDataProvider;
|
|
31222
31399
|
exports2.BranchSwitcher = BranchSwitcher;
|
|
31223
31400
|
exports2.BranchSwitcherPlugin = BranchSwitcherPlugin;
|
|
31224
|
-
exports2.Button = Button;
|
|
31401
|
+
exports2.Button = Button$1;
|
|
31225
31402
|
exports2.ButtonToggle = ButtonToggle;
|
|
31226
31403
|
exports2.ButtonToggleField = ButtonToggleField;
|
|
31227
31404
|
exports2.ButtonToggleFieldPlugin = ButtonToggleFieldPlugin;
|