tinacms 0.0.0-df15737-20250329200825 → 0.0.0-df15996-20250420014759
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/README.md +1 -1
- package/dist/auth/authenticate.d.ts +1 -1
- package/dist/client.js +10 -1
- package/dist/client.mjs +10 -1
- package/dist/index.js +411 -398
- package/dist/index.mjs +412 -399
- package/dist/internalClient/authProvider.d.ts +2 -0
- package/dist/internalClient/index.d.ts +3 -3
- package/dist/toolkit/components/media/media-manager.d.ts +1 -1
- package/dist/toolkit/plugin-branch-switcher/branch-switcher-legacy.d.ts +1 -1
- package/dist/toolkit/plugin-branch-switcher/branch-switcher.d.ts +1 -1
- package/dist/toolkit/react-cloud-config/cloud-config-plugin.d.ts +3 -3
- package/dist/unifiedClient/index.d.ts +1 -1
- package/package.json +5 -5
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/cn"), require("@udecode/plate"), require("@udecode/plate-common"), require("@udecode/plate-slash-command"), require("slate-react"), require("@udecode/plate-code-block"), require("@monaco-editor/react"), require("@headlessui/react"), require("class-variance-authority"), require("lucide-react"), require("mermaid"), require("@udecode/plate-heading"), require("@ariakit/react"), require("@udecode/plate-combobox"), require("@udecode/plate-table"), require("@udecode/plate-resizable"), require("@radix-ui/react-popover"), require("@radix-ui/react-slot"), require("@radix-ui/react-dropdown-menu"), require("@radix-ui/react-separator"), 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("react-color"), require("color-string"), require("react-dropzone"), require("clsx"), require("tailwind-merge"), require("cmdk"), require("is-hotkey"), require("slate"), require("@react-hook/window-size"), require("lodash.get"), require("moment"), require("date-fns"), require("@udecode/plate-link"), require("@radix-ui/react-toolbar"), require("@radix-ui/react-tooltip"), require("@udecode/plate-paragraph"), require("@udecode/plate-block-quote"), require("@udecode/plate-floating"), require("graphql"), require("
|
|
3
|
-
})(this, function(exports2, zod, React, reactDom, cn$1, plate, plateCommon, plateSlashCommand, slateReact, plateCodeBlock, MonacoEditor, react, classVarianceAuthority, lucideReact, mermaid, plateHeading, react$1, plateCombobox, plateTable, plateResizable, PopoverPrimitive, reactSlot, DropdownMenuPrimitive, SeparatorPrimitive, arrayMutators, setFieldData, finalForm, reactFinalForm, PropTypes, reactBeautifulDnd, pkg$1, pkg, dropzone, clsx, tailwindMerge, cmdk, isHotkey, slate, windowSize, get, moment, dateFns, plateLink, ToolbarPrimitive, TooltipPrimitive, plateParagraph, plateBlockQuote, plateFloating, graphql,
|
|
2
|
+
typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("zod"), require("react"), require("react-dom"), require("@udecode/cn"), require("@udecode/plate"), require("@udecode/plate-common"), require("@udecode/plate-slash-command"), require("slate-react"), require("@udecode/plate-code-block"), require("@monaco-editor/react"), require("@headlessui/react"), require("class-variance-authority"), require("lucide-react"), require("mermaid"), require("@udecode/plate-heading"), require("@ariakit/react"), require("@udecode/plate-combobox"), require("@udecode/plate-table"), require("@udecode/plate-resizable"), require("@radix-ui/react-popover"), require("@radix-ui/react-slot"), require("@radix-ui/react-dropdown-menu"), require("@radix-ui/react-separator"), 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("react-color"), require("color-string"), require("react-dropzone"), require("clsx"), require("tailwind-merge"), require("cmdk"), require("is-hotkey"), require("slate"), require("@react-hook/window-size"), require("lodash.get"), require("moment"), require("date-fns"), require("@udecode/plate-link"), require("@radix-ui/react-toolbar"), require("@radix-ui/react-tooltip"), require("@udecode/plate-paragraph"), require("@udecode/plate-block-quote"), require("@udecode/plate-floating"), require("graphql"), require("@tinacms/schema-tools"), require("graphql-tag"), require("@graphql-inspector/core"), require("yup"), require("react-router-dom"), require("@tinacms/mdx")) : typeof define === "function" && define.amd ? define(["exports", "zod", "react", "react-dom", "@udecode/cn", "@udecode/plate", "@udecode/plate-common", "@udecode/plate-slash-command", "slate-react", "@udecode/plate-code-block", "@monaco-editor/react", "@headlessui/react", "class-variance-authority", "lucide-react", "mermaid", "@udecode/plate-heading", "@ariakit/react", "@udecode/plate-combobox", "@udecode/plate-table", "@udecode/plate-resizable", "@radix-ui/react-popover", "@radix-ui/react-slot", "@radix-ui/react-dropdown-menu", "@radix-ui/react-separator", "final-form-arrays", "final-form-set-field-data", "final-form", "react-final-form", "prop-types", "react-beautiful-dnd", "react-color", "color-string", "react-dropzone", "clsx", "tailwind-merge", "cmdk", "is-hotkey", "slate", "@react-hook/window-size", "lodash.get", "moment", "date-fns", "@udecode/plate-link", "@radix-ui/react-toolbar", "@radix-ui/react-tooltip", "@udecode/plate-paragraph", "@udecode/plate-block-quote", "@udecode/plate-floating", "graphql", "@tinacms/schema-tools", "graphql-tag", "@graphql-inspector/core", "yup", "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, 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, cn$1, plate, plateCommon, plateSlashCommand, slateReact, plateCodeBlock, MonacoEditor, react, classVarianceAuthority, lucideReact, mermaid, plateHeading, react$1, plateCombobox, plateTable, plateResizable, PopoverPrimitive, reactSlot, DropdownMenuPrimitive, SeparatorPrimitive, arrayMutators, setFieldData, finalForm, reactFinalForm, PropTypes, reactBeautifulDnd, pkg$1, pkg, dropzone, clsx, tailwindMerge, cmdk, isHotkey, slate, windowSize, get, moment, dateFns, plateLink, ToolbarPrimitive, TooltipPrimitive, plateParagraph, plateBlockQuote, plateFloating, graphql, schemaTools, gql, core, yup, 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) => {
|
|
@@ -4403,36 +4403,6 @@ flowchart TD
|
|
|
4403
4403
|
function MdOutlinePerson(props) {
|
|
4404
4404
|
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "fill": "none", "d": "M0 0h24v24H0V0z" }, "child": [] }, { "tag": "path", "attr": { "d": "M12 6c1.1 0 2 .9 2 2s-.9 2-2 2-2-.9-2-2 .9-2 2-2m0 10c2.7 0 5.8 1.29 6 2H6c.23-.72 3.31-2 6-2m0-12C9.79 4 8 5.79 8 8s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm0 10c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z" }, "child": [] }] })(props);
|
|
4405
4405
|
}
|
|
4406
|
-
const BranchContext = React__namespace.createContext({
|
|
4407
|
-
currentBranch: null,
|
|
4408
|
-
setCurrentBranch: (branch) => {
|
|
4409
|
-
console.warn("BranchContext not initialized");
|
|
4410
|
-
}
|
|
4411
|
-
});
|
|
4412
|
-
const BranchDataProvider = ({
|
|
4413
|
-
currentBranch,
|
|
4414
|
-
setCurrentBranch,
|
|
4415
|
-
children
|
|
4416
|
-
}) => {
|
|
4417
|
-
return /* @__PURE__ */ React__namespace.createElement(
|
|
4418
|
-
BranchContext.Provider,
|
|
4419
|
-
{
|
|
4420
|
-
value: {
|
|
4421
|
-
currentBranch,
|
|
4422
|
-
setCurrentBranch
|
|
4423
|
-
}
|
|
4424
|
-
},
|
|
4425
|
-
children
|
|
4426
|
-
);
|
|
4427
|
-
};
|
|
4428
|
-
const useBranchData = () => {
|
|
4429
|
-
const branchData = React__namespace.useContext(BranchContext);
|
|
4430
|
-
const { dispatch } = useEvent("branch:change");
|
|
4431
|
-
React__namespace.useEffect(() => {
|
|
4432
|
-
dispatch({ branchName: branchData.currentBranch });
|
|
4433
|
-
}, [branchData.currentBranch]);
|
|
4434
|
-
return branchData;
|
|
4435
|
-
};
|
|
4436
4406
|
const textFieldClasses = "shadow-inner focus:shadow-outline focus:border-blue-500 focus:outline-none block text-base placeholder:text-gray-300 px-3 py-2 text-gray-600 w-full bg-white border border-gray-200 transition-all ease-out duration-150 focus:text-gray-900 rounded-md";
|
|
4437
4407
|
const disabledClasses$1 = "opacity-50 pointer-events-none cursor-not-allowed";
|
|
4438
4408
|
const BaseTextField = React__namespace.forwardRef(({ className, disabled, ...rest }, ref) => {
|
|
@@ -8036,9 +8006,6 @@ flowchart TD
|
|
|
8036
8006
|
},
|
|
8037
8007
|
parse: parse$2
|
|
8038
8008
|
};
|
|
8039
|
-
function GrCircleQuestion(props) {
|
|
8040
|
-
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "fill": "none", "strokeWidth": "2", "d": "M12,22 C17.5228475,22 22,17.5228475 22,12 C22,6.4771525 17.5228475,2 12,2 C6.4771525,2 2,6.4771525 2,12 C2,17.5228475 6.4771525,22 12,22 Z M12,15 L12,14 C12,13 12,12.5 13,12 C14,11.5 15,11 15,9.5 C15,8.5 14,7 12,7 C10,7 9,8.26413718 9,10 M12,16 L12,18" }, "child": [] }] })(props);
|
|
8041
|
-
}
|
|
8042
8009
|
function AiFillWarning(props) {
|
|
8043
8010
|
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 1024 1024" }, "child": [{ "tag": "path", "attr": { "d": "M955.7 856l-416-720c-6.2-10.7-16.9-16-27.7-16s-21.6 5.3-27.7 16l-416 720C56 877.4 71.4 904 96 904h832c24.6 0 40-26.6 27.7-48zM480 416c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v184c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V416zm32 352a48.01 48.01 0 0 1 0-96 48.01 48.01 0 0 1 0 96z" }, "child": [] }] })(props);
|
|
8044
8011
|
}
|
|
@@ -8057,6 +8024,39 @@ flowchart TD
|
|
|
8057
8024
|
function FaUnlock(props) {
|
|
8058
8025
|
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 448 512" }, "child": [{ "tag": "path", "attr": { "d": "M400 256H152V152.9c0-39.6 31.7-72.5 71.3-72.9 40-.4 72.7 32.1 72.7 72v16c0 13.3 10.7 24 24 24h32c13.3 0 24-10.7 24-24v-16C376 68 307.5-.3 223.5 0 139.5.3 72 69.5 72 153.5V256H48c-26.5 0-48 21.5-48 48v160c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V304c0-26.5-21.5-48-48-48z" }, "child": [] }] })(props);
|
|
8059
8026
|
}
|
|
8027
|
+
function GrCircleQuestion(props) {
|
|
8028
|
+
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "fill": "none", "strokeWidth": "2", "d": "M12,22 C17.5228475,22 22,17.5228475 22,12 C22,6.4771525 17.5228475,2 12,2 C6.4771525,2 2,6.4771525 2,12 C2,17.5228475 6.4771525,22 12,22 Z M12,15 L12,14 C12,13 12,12.5 13,12 C14,11.5 15,11 15,9.5 C15,8.5 14,7 12,7 C10,7 9,8.26413718 9,10 M12,16 L12,18" }, "child": [] }] })(props);
|
|
8029
|
+
}
|
|
8030
|
+
const BranchContext = React__namespace.createContext({
|
|
8031
|
+
currentBranch: null,
|
|
8032
|
+
setCurrentBranch: (branch) => {
|
|
8033
|
+
console.warn("BranchContext not initialized");
|
|
8034
|
+
}
|
|
8035
|
+
});
|
|
8036
|
+
const BranchDataProvider = ({
|
|
8037
|
+
currentBranch,
|
|
8038
|
+
setCurrentBranch,
|
|
8039
|
+
children
|
|
8040
|
+
}) => {
|
|
8041
|
+
return /* @__PURE__ */ React__namespace.createElement(
|
|
8042
|
+
BranchContext.Provider,
|
|
8043
|
+
{
|
|
8044
|
+
value: {
|
|
8045
|
+
currentBranch,
|
|
8046
|
+
setCurrentBranch
|
|
8047
|
+
}
|
|
8048
|
+
},
|
|
8049
|
+
children
|
|
8050
|
+
);
|
|
8051
|
+
};
|
|
8052
|
+
const useBranchData = () => {
|
|
8053
|
+
const branchData = React__namespace.useContext(BranchContext);
|
|
8054
|
+
const { dispatch } = useEvent("branch:change");
|
|
8055
|
+
React__namespace.useEffect(() => {
|
|
8056
|
+
dispatch({ branchName: branchData.currentBranch });
|
|
8057
|
+
}, [branchData.currentBranch]);
|
|
8058
|
+
return branchData;
|
|
8059
|
+
};
|
|
8060
8060
|
function formatBranchName$1(str) {
|
|
8061
8061
|
const pattern = /[^/\w-]+/g;
|
|
8062
8062
|
const formattedStr = str.replace(pattern, "");
|
|
@@ -8155,7 +8155,7 @@ flowchart TD
|
|
|
8155
8155
|
className: "transition-all duration-150 ease-out text-blue-600 hover:text-blue-400 hover:underline no-underline",
|
|
8156
8156
|
href: "https://tina.io/docs/tina-cloud/"
|
|
8157
8157
|
},
|
|
8158
|
-
"Learn more about moving to production with
|
|
8158
|
+
"Learn more about moving to production with TinaCloud."
|
|
8159
8159
|
)), /* @__PURE__ */ React__namespace.createElement("p", null, /* @__PURE__ */ React__namespace.createElement(
|
|
8160
8160
|
Button$1,
|
|
8161
8161
|
{
|
|
@@ -8391,7 +8391,7 @@ flowchart TD
|
|
|
8391
8391
|
className: "transition-all duration-150 ease-out text-blue-600 hover:text-blue-400 hover:underline no-underline",
|
|
8392
8392
|
href: "https://tina.io/docs/tina-cloud/"
|
|
8393
8393
|
},
|
|
8394
|
-
"Learn more about moving to production with
|
|
8394
|
+
"Learn more about moving to production with TinaCloud."
|
|
8395
8395
|
)), /* @__PURE__ */ React__namespace.createElement("p", null, /* @__PURE__ */ React__namespace.createElement(
|
|
8396
8396
|
Button$1,
|
|
8397
8397
|
{
|
|
@@ -9423,7 +9423,7 @@ flowchart TD
|
|
|
9423
9423
|
});
|
|
9424
9424
|
new MediaListError({
|
|
9425
9425
|
title: "An Error Occurred",
|
|
9426
|
-
message: "Something went wrong accessing your media from
|
|
9426
|
+
message: "Something went wrong accessing your media from TinaCloud.",
|
|
9427
9427
|
docsLink: ""
|
|
9428
9428
|
// TODO
|
|
9429
9429
|
});
|
|
@@ -9953,7 +9953,7 @@ flowchart TD
|
|
|
9953
9953
|
"Event Log"
|
|
9954
9954
|
));
|
|
9955
9955
|
};
|
|
9956
|
-
const version = "2.7.
|
|
9956
|
+
const version = "2.7.5";
|
|
9957
9957
|
const Nav = ({
|
|
9958
9958
|
isLocalMode,
|
|
9959
9959
|
className = "",
|
|
@@ -11016,6 +11016,93 @@ flowchart TD
|
|
|
11016
11016
|
);
|
|
11017
11017
|
};
|
|
11018
11018
|
}
|
|
11019
|
+
function dirname(path) {
|
|
11020
|
+
var _a, _b;
|
|
11021
|
+
const pattern = new RegExp("(?<prevDir>.*)/");
|
|
11022
|
+
return (_b = (_a = path.match(pattern)) == null ? void 0 : _a.groups) == null ? void 0 : _b.prevDir;
|
|
11023
|
+
}
|
|
11024
|
+
const BreadcrumbButton = ({ className = "", ...props }) => /* @__PURE__ */ React.createElement(
|
|
11025
|
+
"button",
|
|
11026
|
+
{
|
|
11027
|
+
className: "capitalize transition-colors duration-150 border-0 bg-transparent hover:text-blue-500 " + className,
|
|
11028
|
+
...props
|
|
11029
|
+
}
|
|
11030
|
+
);
|
|
11031
|
+
function Breadcrumb$1({ directory = "", setDirectory }) {
|
|
11032
|
+
directory = directory.replace(/^\/|\/$/g, "");
|
|
11033
|
+
let prevDir = dirname(directory) || "";
|
|
11034
|
+
if (prevDir === ".") {
|
|
11035
|
+
prevDir = "";
|
|
11036
|
+
}
|
|
11037
|
+
return /* @__PURE__ */ React.createElement("div", { className: "w-full flex items-center text-[16px] text-gray-300" }, directory !== "" && /* @__PURE__ */ React.createElement(
|
|
11038
|
+
IconButton,
|
|
11039
|
+
{
|
|
11040
|
+
variant: "ghost",
|
|
11041
|
+
className: "mr-2",
|
|
11042
|
+
onClick: () => setDirectory(prevDir)
|
|
11043
|
+
},
|
|
11044
|
+
/* @__PURE__ */ React.createElement(
|
|
11045
|
+
LeftArrowIcon,
|
|
11046
|
+
{
|
|
11047
|
+
className: `w-7 h-auto fill-gray-300 hover:fill-gray-900 transition duration-150 ease-out`
|
|
11048
|
+
}
|
|
11049
|
+
)
|
|
11050
|
+
), /* @__PURE__ */ React.createElement(
|
|
11051
|
+
BreadcrumbButton,
|
|
11052
|
+
{
|
|
11053
|
+
onClick: () => setDirectory(""),
|
|
11054
|
+
className: directory === "" ? "text-gray-500 font-bold" : "text-gray-300 font-medium after:pl-1.5 after:content-['/']"
|
|
11055
|
+
},
|
|
11056
|
+
"Media"
|
|
11057
|
+
), directory && directory.split("/").map((part, index, parts) => {
|
|
11058
|
+
const currentDir = parts.slice(0, index + 1).join("/");
|
|
11059
|
+
return /* @__PURE__ */ React.createElement(
|
|
11060
|
+
BreadcrumbButton,
|
|
11061
|
+
{
|
|
11062
|
+
className: "pl-1.5 " + (index + 1 === parts.length ? "text-gray-500 font-bold" : "text-gray-300 font-medium after:pl-1.5 after:content-['/']"),
|
|
11063
|
+
key: currentDir,
|
|
11064
|
+
onClick: () => {
|
|
11065
|
+
setDirectory(currentDir);
|
|
11066
|
+
}
|
|
11067
|
+
},
|
|
11068
|
+
part
|
|
11069
|
+
);
|
|
11070
|
+
}));
|
|
11071
|
+
}
|
|
11072
|
+
const CopyField = ({ label, description, value }) => {
|
|
11073
|
+
const [copied, setCopied] = React.useState(false);
|
|
11074
|
+
const [fadeOut, setFadeOut] = React.useState(false);
|
|
11075
|
+
return /* @__PURE__ */ React.createElement("div", { className: "w-full" }, label && /* @__PURE__ */ React.createElement("label", { className: "w-full mb-1 block flex-1 text-sm font-bold leading-5 text-gray-700" }, label), /* @__PURE__ */ React.createElement(
|
|
11076
|
+
"span",
|
|
11077
|
+
{
|
|
11078
|
+
onClick: () => {
|
|
11079
|
+
if (copied === true)
|
|
11080
|
+
return;
|
|
11081
|
+
setCopied(true);
|
|
11082
|
+
setTimeout(() => {
|
|
11083
|
+
setFadeOut(true);
|
|
11084
|
+
}, 2500);
|
|
11085
|
+
setTimeout(() => {
|
|
11086
|
+
setCopied(false);
|
|
11087
|
+
setFadeOut(false);
|
|
11088
|
+
}, 3e3);
|
|
11089
|
+
navigator.clipboard.writeText(value);
|
|
11090
|
+
},
|
|
11091
|
+
className: `shadow-inner text-base leading-5 whitespace-normal break-all px-3 py-2 text-gray-600 w-full bg-gray-50 border border-gray-200 transition-all ease-out duration-150 rounded-md relative overflow-hidden appearance-none flex items-center w-full cursor-pointer hover:bg-white hover:text-blue-500 ${copied ? `pointer-events-none` : ``}`
|
|
11092
|
+
},
|
|
11093
|
+
/* @__PURE__ */ React.createElement(BiCopyAlt, { className: "relative text-blue-500 shrink-0 w-5 h-auto mr-1.5 -ml-0.5 z-20" }),
|
|
11094
|
+
" ",
|
|
11095
|
+
value,
|
|
11096
|
+
" ",
|
|
11097
|
+
copied && /* @__PURE__ */ React.createElement(
|
|
11098
|
+
"span",
|
|
11099
|
+
{
|
|
11100
|
+
className: `${fadeOut ? `opacity-0` : `opacity-100`} text-blue-500 transition-opacity duration-500 absolute right-0 w-full h-full px-3 py-2 bg-white bg-opacity-90 flex items-center justify-center text-center tracking-wide font-medium z-10`
|
|
11101
|
+
},
|
|
11102
|
+
/* @__PURE__ */ React.createElement("span", null, "Copied to clipboard!")
|
|
11103
|
+
)
|
|
11104
|
+
), description && /* @__PURE__ */ React.createElement("p", { className: "mt-2 text-sm text-gray-500" }, description));
|
|
11105
|
+
};
|
|
11019
11106
|
function ListMediaItem({ item, onClick, active }) {
|
|
11020
11107
|
let FileIcon = BiFile;
|
|
11021
11108
|
if (item.type === "dir") {
|
|
@@ -11091,59 +11178,6 @@ flowchart TD
|
|
|
11091
11178
|
)
|
|
11092
11179
|
);
|
|
11093
11180
|
}
|
|
11094
|
-
function dirname(path) {
|
|
11095
|
-
var _a, _b;
|
|
11096
|
-
const pattern = new RegExp("(?<prevDir>.*)/");
|
|
11097
|
-
return (_b = (_a = path.match(pattern)) == null ? void 0 : _a.groups) == null ? void 0 : _b.prevDir;
|
|
11098
|
-
}
|
|
11099
|
-
const BreadcrumbButton = ({ className = "", ...props }) => /* @__PURE__ */ React.createElement(
|
|
11100
|
-
"button",
|
|
11101
|
-
{
|
|
11102
|
-
className: "capitalize transition-colors duration-150 border-0 bg-transparent hover:text-blue-500 " + className,
|
|
11103
|
-
...props
|
|
11104
|
-
}
|
|
11105
|
-
);
|
|
11106
|
-
function Breadcrumb$1({ directory = "", setDirectory }) {
|
|
11107
|
-
directory = directory.replace(/^\/|\/$/g, "");
|
|
11108
|
-
let prevDir = dirname(directory) || "";
|
|
11109
|
-
if (prevDir === ".") {
|
|
11110
|
-
prevDir = "";
|
|
11111
|
-
}
|
|
11112
|
-
return /* @__PURE__ */ React.createElement("div", { className: "w-full flex items-center text-[16px] text-gray-300" }, directory !== "" && /* @__PURE__ */ React.createElement(
|
|
11113
|
-
IconButton,
|
|
11114
|
-
{
|
|
11115
|
-
variant: "ghost",
|
|
11116
|
-
className: "mr-2",
|
|
11117
|
-
onClick: () => setDirectory(prevDir)
|
|
11118
|
-
},
|
|
11119
|
-
/* @__PURE__ */ React.createElement(
|
|
11120
|
-
LeftArrowIcon,
|
|
11121
|
-
{
|
|
11122
|
-
className: `w-7 h-auto fill-gray-300 hover:fill-gray-900 transition duration-150 ease-out`
|
|
11123
|
-
}
|
|
11124
|
-
)
|
|
11125
|
-
), /* @__PURE__ */ React.createElement(
|
|
11126
|
-
BreadcrumbButton,
|
|
11127
|
-
{
|
|
11128
|
-
onClick: () => setDirectory(""),
|
|
11129
|
-
className: directory === "" ? "text-gray-500 font-bold" : "text-gray-300 font-medium after:pl-1.5 after:content-['/']"
|
|
11130
|
-
},
|
|
11131
|
-
"Media"
|
|
11132
|
-
), directory && directory.split("/").map((part, index, parts) => {
|
|
11133
|
-
const currentDir = parts.slice(0, index + 1).join("/");
|
|
11134
|
-
return /* @__PURE__ */ React.createElement(
|
|
11135
|
-
BreadcrumbButton,
|
|
11136
|
-
{
|
|
11137
|
-
className: "pl-1.5 " + (index + 1 === parts.length ? "text-gray-500 font-bold" : "text-gray-300 font-medium after:pl-1.5 after:content-['/']"),
|
|
11138
|
-
key: currentDir,
|
|
11139
|
-
onClick: () => {
|
|
11140
|
-
setDirectory(currentDir);
|
|
11141
|
-
}
|
|
11142
|
-
},
|
|
11143
|
-
part
|
|
11144
|
-
);
|
|
11145
|
-
}));
|
|
11146
|
-
}
|
|
11147
11181
|
const DeleteModal$1 = ({
|
|
11148
11182
|
close: close2,
|
|
11149
11183
|
deleteFunc,
|
|
@@ -11197,40 +11231,6 @@ flowchart TD
|
|
|
11197
11231
|
"Create New Folder"
|
|
11198
11232
|
))));
|
|
11199
11233
|
};
|
|
11200
|
-
const CopyField = ({ label, description, value }) => {
|
|
11201
|
-
const [copied, setCopied] = React.useState(false);
|
|
11202
|
-
const [fadeOut, setFadeOut] = React.useState(false);
|
|
11203
|
-
return /* @__PURE__ */ React.createElement("div", { className: "w-full" }, label && /* @__PURE__ */ React.createElement("label", { className: "w-full mb-1 block flex-1 text-sm font-bold leading-5 text-gray-700" }, label), /* @__PURE__ */ React.createElement(
|
|
11204
|
-
"span",
|
|
11205
|
-
{
|
|
11206
|
-
onClick: () => {
|
|
11207
|
-
if (copied === true)
|
|
11208
|
-
return;
|
|
11209
|
-
setCopied(true);
|
|
11210
|
-
setTimeout(() => {
|
|
11211
|
-
setFadeOut(true);
|
|
11212
|
-
}, 2500);
|
|
11213
|
-
setTimeout(() => {
|
|
11214
|
-
setCopied(false);
|
|
11215
|
-
setFadeOut(false);
|
|
11216
|
-
}, 3e3);
|
|
11217
|
-
navigator.clipboard.writeText(value);
|
|
11218
|
-
},
|
|
11219
|
-
className: `shadow-inner text-base leading-5 whitespace-normal break-all px-3 py-2 text-gray-600 w-full bg-gray-50 border border-gray-200 transition-all ease-out duration-150 rounded-md relative overflow-hidden appearance-none flex items-center w-full cursor-pointer hover:bg-white hover:text-blue-500 ${copied ? `pointer-events-none` : ``}`
|
|
11220
|
-
},
|
|
11221
|
-
/* @__PURE__ */ React.createElement(BiCopyAlt, { className: "relative text-blue-500 shrink-0 w-5 h-auto mr-1.5 -ml-0.5 z-20" }),
|
|
11222
|
-
" ",
|
|
11223
|
-
value,
|
|
11224
|
-
" ",
|
|
11225
|
-
copied && /* @__PURE__ */ React.createElement(
|
|
11226
|
-
"span",
|
|
11227
|
-
{
|
|
11228
|
-
className: `${fadeOut ? `opacity-0` : `opacity-100`} text-blue-500 transition-opacity duration-500 absolute right-0 w-full h-full px-3 py-2 bg-white bg-opacity-90 flex items-center justify-center text-center tracking-wide font-medium z-10`
|
|
11229
|
-
},
|
|
11230
|
-
/* @__PURE__ */ React.createElement("span", null, "Copied to clipboard!")
|
|
11231
|
-
)
|
|
11232
|
-
), description && /* @__PURE__ */ React.createElement("p", { className: "mt-2 text-sm text-gray-500" }, description));
|
|
11233
|
-
};
|
|
11234
11234
|
const { useDropzone } = dropzone__namespace;
|
|
11235
11235
|
const join = function(...parts) {
|
|
11236
11236
|
const [first, last, slash] = [0, parts.length - 1, "/"];
|
|
@@ -11732,7 +11732,7 @@ flowchart TD
|
|
|
11732
11732
|
target: "_blank",
|
|
11733
11733
|
href: `${cms.api.tina.appDashboardLink}/media`
|
|
11734
11734
|
},
|
|
11735
|
-
"Sync Your Media In
|
|
11735
|
+
"Sync Your Media In TinaCloud.",
|
|
11736
11736
|
/* @__PURE__ */ React.createElement(BiLinkExternal, { className: `w-5 h-auto flex-shrink-0` })
|
|
11737
11737
|
)
|
|
11738
11738
|
)))) : /* @__PURE__ */ React.createElement(SyncStatusContext.Provider, { value: { syncStatus } }, children);
|
|
@@ -30337,9 +30337,15 @@ flowchart TD
|
|
|
30337
30337
|
}
|
|
30338
30338
|
const TINA_LOGIN_EVENT = "tinaCloudLogin";
|
|
30339
30339
|
const AUTH_TOKEN_KEY = "tinacms-auth";
|
|
30340
|
-
const authenticate = (clientId, frontendUrl) => {
|
|
30340
|
+
const authenticate = (clientId, frontendUrl, oauth2) => {
|
|
30341
30341
|
return new Promise((resolve) => {
|
|
30342
30342
|
const origin = `${window.location.protocol}//${window.location.host}`;
|
|
30343
|
+
if (oauth2) {
|
|
30344
|
+
const redirectUri = encodeURIComponent(`${origin}/admin/auth/callback`);
|
|
30345
|
+
const codeChallenge = "jksdfjdsklf";
|
|
30346
|
+
window.location.href = `${frontendUrl}/oauth-signin?redirect_uri=${redirectUri}&code_challenge=${codeChallenge}&client_id=${clientId}`;
|
|
30347
|
+
return;
|
|
30348
|
+
}
|
|
30343
30349
|
const authTab = popupWindow(
|
|
30344
30350
|
`${frontendUrl}/signin?clientId=${clientId}&origin=${origin}`,
|
|
30345
30351
|
"_blank",
|
|
@@ -30420,6 +30426,7 @@ flowchart TD
|
|
|
30420
30426
|
this.frontendUrl = frontendUrl;
|
|
30421
30427
|
this.clientId = clientId;
|
|
30422
30428
|
this.identityApiUrl = identityApiUrl;
|
|
30429
|
+
this.oauth2 = options.oauth2 || false;
|
|
30423
30430
|
switch (tokenStorage) {
|
|
30424
30431
|
case "LOCAL_STORAGE":
|
|
30425
30432
|
this.getToken = async function() {
|
|
@@ -30465,7 +30472,11 @@ flowchart TD
|
|
|
30465
30472
|
}
|
|
30466
30473
|
}
|
|
30467
30474
|
async authenticate() {
|
|
30468
|
-
const token = await authenticate(
|
|
30475
|
+
const token = await authenticate(
|
|
30476
|
+
this.clientId,
|
|
30477
|
+
this.frontendUrl,
|
|
30478
|
+
this.oauth2
|
|
30479
|
+
);
|
|
30469
30480
|
this.setToken(token);
|
|
30470
30481
|
return token;
|
|
30471
30482
|
}
|
|
@@ -30576,7 +30587,7 @@ flowchart TD
|
|
|
30576
30587
|
});
|
|
30577
30588
|
class Client {
|
|
30578
30589
|
constructor({ tokenStorage = "MEMORY", ...options }) {
|
|
30579
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u;
|
|
30590
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w;
|
|
30580
30591
|
this.events = new EventBus();
|
|
30581
30592
|
this.protectedBranches = [];
|
|
30582
30593
|
this.usingEditorialWorkflow = false;
|
|
@@ -30657,7 +30668,8 @@ mutation addPendingDocumentMutation(
|
|
|
30657
30668
|
identityApiUrl: this.identityApiUrl,
|
|
30658
30669
|
getTokenFn: options.getTokenFn,
|
|
30659
30670
|
tokenStorage,
|
|
30660
|
-
frontendUrl: this.frontendUrl
|
|
30671
|
+
frontendUrl: this.frontendUrl,
|
|
30672
|
+
oauth2: (_w = (_v = options.schema) == null ? void 0 : _v.config) == null ? void 0 : _w.oauth2
|
|
30661
30673
|
});
|
|
30662
30674
|
}
|
|
30663
30675
|
get isLocalMode() {
|
|
@@ -30669,6 +30681,7 @@ mutation addPendingDocumentMutation(
|
|
|
30669
30681
|
setBranch(branchName) {
|
|
30670
30682
|
var _a, _b, _c, _d;
|
|
30671
30683
|
const encodedBranch = encodeURIComponent(branchName);
|
|
30684
|
+
document.cookie = `x-branch=${encodedBranch}; path=/; max-age=3600`;
|
|
30672
30685
|
this.branch = encodedBranch;
|
|
30673
30686
|
this.assetsApiUrl = ((_a = this.options.tinaioConfig) == null ? void 0 : _a.assetsApiUrlOverride) || "https://assets.tinajs.io";
|
|
30674
30687
|
this.frontendUrl = ((_b = this.options.tinaioConfig) == null ? void 0 : _b.frontendUrlOverride) || "https://app.tina.io";
|
|
@@ -30711,7 +30724,7 @@ mutation addPendingDocumentMutation(
|
|
|
30711
30724
|
branch: ${this.branch}.`;
|
|
30712
30725
|
if (this.branch !== "main") {
|
|
30713
30726
|
errorMessage = `${errorMessage}
|
|
30714
|
-
Note: This error can occur if the branch does not exist on GitHub or on
|
|
30727
|
+
Note: This error can occur if the branch does not exist on GitHub or on TinaCloud`;
|
|
30715
30728
|
}
|
|
30716
30729
|
}
|
|
30717
30730
|
throw new Error(errorMessage);
|
|
@@ -30847,7 +30860,7 @@ mutation addPendingDocumentMutation(
|
|
|
30847
30860
|
unknownCount++;
|
|
30848
30861
|
if (unknownCount > 5) {
|
|
30849
30862
|
throw new Error(
|
|
30850
|
-
"AsyncPoller: status unknown for too long, please check indexing progress the
|
|
30863
|
+
"AsyncPoller: status unknown for too long, please check indexing progress the TinaCloud dashboard"
|
|
30851
30864
|
);
|
|
30852
30865
|
}
|
|
30853
30866
|
}
|
|
@@ -31558,7 +31571,7 @@ mutation addPendingDocumentMutation(
|
|
|
31558
31571
|
});
|
|
31559
31572
|
}
|
|
31560
31573
|
};
|
|
31561
|
-
let modalTitle = "
|
|
31574
|
+
let modalTitle = "TinaCloud";
|
|
31562
31575
|
if (activeModal === "authenticate" && loginStrategy === "Redirect" && !isTinaCloud) {
|
|
31563
31576
|
modalTitle = "Enter into edit mode";
|
|
31564
31577
|
} else if (activeModal === "authenticate" && loginStrategy === "UsernamePassword") {
|
|
@@ -31574,7 +31587,7 @@ mutation addPendingDocumentMutation(
|
|
|
31574
31587
|
ModalBuilder,
|
|
31575
31588
|
{
|
|
31576
31589
|
title: modalTitle,
|
|
31577
|
-
message: isTinaCloud ? "Your site uses
|
|
31590
|
+
message: isTinaCloud ? "Your site uses TinaCloud to track changes. To make edits, you must log in." : "To save edits, enter into edit mode. On save, changes will saved to the local filesystem.",
|
|
31578
31591
|
close,
|
|
31579
31592
|
actions: [
|
|
31580
31593
|
...otherModalActions,
|
|
@@ -32297,6 +32310,14 @@ This will work when developing locally but NOT when deployed to production.
|
|
|
32297
32310
|
}
|
|
32298
32311
|
return client.request(query, { variables });
|
|
32299
32312
|
};
|
|
32313
|
+
const GetCMS = ({ children }) => {
|
|
32314
|
+
try {
|
|
32315
|
+
const cms = useCMS$1();
|
|
32316
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, children(cms));
|
|
32317
|
+
} catch (e) {
|
|
32318
|
+
return null;
|
|
32319
|
+
}
|
|
32320
|
+
};
|
|
32300
32321
|
const Layout = ({ children }) => {
|
|
32301
32322
|
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
32302
32323
|
"div",
|
|
@@ -32508,47 +32529,6 @@ This will work when developing locally but NOT when deployed to production.
|
|
|
32508
32529
|
}
|
|
32509
32530
|
return /* @__PURE__ */ React.createElement("span", { className: "text-base tracking-wide text-gray-500 hover:text-blue-600 flex items-center opacity-90 hover:opacity-100" }, /* @__PURE__ */ React.createElement(config.Icon, { className: "mr-2 h-6 opacity-80 w-auto" }), /* @__PURE__ */ React.createElement("a", { target: "_blank", href: config.link.href }, config.link.text));
|
|
32510
32531
|
};
|
|
32511
|
-
const GetCMS = ({ children }) => {
|
|
32512
|
-
try {
|
|
32513
|
-
const cms = useCMS$1();
|
|
32514
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, children(cms));
|
|
32515
|
-
} catch (e) {
|
|
32516
|
-
return null;
|
|
32517
|
-
}
|
|
32518
|
-
};
|
|
32519
|
-
const PageWrapper = ({ children }) => {
|
|
32520
|
-
var _a, _b;
|
|
32521
|
-
const cms = useCMS$1();
|
|
32522
|
-
const isLocalMode = (_b = (_a = cms.api) == null ? void 0 : _a.tina) == null ? void 0 : _b.isLocalMode;
|
|
32523
|
-
const [branchingEnabled, setBranchingEnabled] = React.useState(
|
|
32524
|
-
() => cms.flags.get("branch-switcher")
|
|
32525
|
-
);
|
|
32526
|
-
React.useEffect(() => {
|
|
32527
|
-
cms.events.subscribe("flag:set", ({ key, value }) => {
|
|
32528
|
-
if (key === "branch-switcher") {
|
|
32529
|
-
setBranchingEnabled(value);
|
|
32530
|
-
}
|
|
32531
|
-
});
|
|
32532
|
-
}, [cms.events]);
|
|
32533
|
-
return /* @__PURE__ */ React.createElement("div", { className: "relative left-0 w-full h-full bg-gradient-to-b from-gray-50/50 to-gray-50 shadow-2xl overflow-y-auto transition-opacity duration-300 ease-out flex flex-col opacity-100" }, branchingEnabled && !isLocalMode && /* @__PURE__ */ React.createElement(BranchBanner, null), children);
|
|
32534
|
-
};
|
|
32535
|
-
const PageHeader = ({
|
|
32536
|
-
isLocalMode,
|
|
32537
|
-
children
|
|
32538
|
-
}) => {
|
|
32539
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, isLocalMode && /* @__PURE__ */ React.createElement(LocalWarning, null), !isLocalMode && /* @__PURE__ */ React.createElement(BillingWarning, null), /* @__PURE__ */ React.createElement("div", { className: "pt-16 xl:pt-12 px-6 xl:px-12" }, /* @__PURE__ */ React.createElement("div", { className: "w-full mx-auto max-w-screen-xl" }, /* @__PURE__ */ React.createElement("div", { className: "w-full flex justify-between items-end" }, children))));
|
|
32540
|
-
};
|
|
32541
|
-
const PageBody = ({ children }) => /* @__PURE__ */ React.createElement("div", { className: "py-8 px-6 xl:px-12" }, children);
|
|
32542
|
-
const PageBodyNarrow = ({ children }) => /* @__PURE__ */ React.createElement("div", { className: "py-10 px-6 xl:px-12" }, /* @__PURE__ */ React.createElement("div", { className: "w-full mx-auto max-w-screen-xl" }, children));
|
|
32543
|
-
const DashboardPage = () => {
|
|
32544
|
-
return /* @__PURE__ */ React.createElement(GetCMS, null, (cms) => {
|
|
32545
|
-
var _a, _b;
|
|
32546
|
-
return /* @__PURE__ */ React.createElement(PageWrapper, null, /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(PageHeader, { isLocalMode: (_b = (_a = cms.api) == null ? void 0 : _a.tina) == null ? void 0 : _b.isLocalMode }, /* @__PURE__ */ React.createElement("h3", { className: "text-2xl font-sans text-gray-700" }, "Welcome to Tina!")), /* @__PURE__ */ React.createElement(PageBodyNarrow, null, "This is your dashboard for editing or creating content. Select a collection on the left to begin.")));
|
|
32547
|
-
});
|
|
32548
|
-
};
|
|
32549
|
-
function RiHome2Line(props) {
|
|
32550
|
-
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "d": "M19 21H5C4.44772 21 4 20.5523 4 20V11L1 11L11.3273 1.6115C11.7087 1.26475 12.2913 1.26475 12.6727 1.6115L23 11L20 11V20C20 20.5523 19.5523 21 19 21ZM6 19H18V9.15745L12 3.7029L6 9.15745V19Z" }, "child": [] }] })(props);
|
|
32551
|
-
}
|
|
32552
32532
|
const LoadingPage = () => /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
32553
32533
|
"div",
|
|
32554
32534
|
{
|
|
@@ -32658,231 +32638,33 @@ This will work when developing locally but NOT when deployed to production.
|
|
|
32658
32638
|
)
|
|
32659
32639
|
)
|
|
32660
32640
|
));
|
|
32661
|
-
|
|
32662
|
-
|
|
32663
|
-
|
|
32664
|
-
}) => {
|
|
32665
|
-
|
|
32666
|
-
|
|
32667
|
-
|
|
32668
|
-
|
|
32669
|
-
|
|
32670
|
-
|
|
32671
|
-
} else if (collection.templates) {
|
|
32672
|
-
const collectionMap = {};
|
|
32673
|
-
const conflictedFields = /* @__PURE__ */ new Set();
|
|
32674
|
-
for (const template of collection.templates) {
|
|
32675
|
-
for (const field of template.fields) {
|
|
32676
|
-
if (collectionMap[field.name]) {
|
|
32677
|
-
if (collectionMap[field.name].type !== field.type) {
|
|
32678
|
-
conflictedFields.add(field.name);
|
|
32679
|
-
}
|
|
32680
|
-
} else {
|
|
32681
|
-
collectionMap[field.name] = field;
|
|
32682
|
-
}
|
|
32683
|
-
}
|
|
32684
|
-
}
|
|
32685
|
-
for (const key in conflictedFields) {
|
|
32686
|
-
delete collectionMap[key];
|
|
32687
|
-
}
|
|
32688
|
-
for (const key in collectionMap) {
|
|
32689
|
-
if (key === sortKey) {
|
|
32690
|
-
return true;
|
|
32691
|
-
}
|
|
32692
|
-
}
|
|
32693
|
-
return false;
|
|
32694
|
-
}
|
|
32695
|
-
};
|
|
32696
|
-
const useGetCollection = (cms, collectionName, includeDocuments = true, folder, after = "", sortKey, filterArgs) => {
|
|
32697
|
-
const api = new TinaAdminApi(cms);
|
|
32698
|
-
const schema = cms.api.tina.schema;
|
|
32699
|
-
const collectionExtra = schema.getCollection(collectionName);
|
|
32700
|
-
const [collection, setCollection] = React.useState(void 0);
|
|
32701
|
-
const [loading, setLoading] = React.useState(true);
|
|
32702
|
-
const [error, setError] = React.useState(void 0);
|
|
32703
|
-
const [resetState, setResetSate] = React.useState(0);
|
|
32704
|
-
React.useEffect(() => {
|
|
32705
|
-
let cancelled = false;
|
|
32706
|
-
const fetchCollection = async () => {
|
|
32707
|
-
if (await api.isAuthenticated() && !folder.loading && !cancelled) {
|
|
32708
|
-
const { name, order } = JSON.parse(sortKey || "{}");
|
|
32709
|
-
const validSortKey = isValidSortKey(name, collectionExtra) ? name : void 0;
|
|
32710
|
-
try {
|
|
32711
|
-
const collection2 = await api.fetchCollection(
|
|
32712
|
-
collectionName,
|
|
32713
|
-
includeDocuments,
|
|
32714
|
-
(filterArgs == null ? void 0 : filterArgs.filterField) ? "" : folder.fullyQualifiedName,
|
|
32715
|
-
after,
|
|
32716
|
-
validSortKey,
|
|
32717
|
-
order,
|
|
32718
|
-
filterArgs
|
|
32719
|
-
);
|
|
32720
|
-
setCollection(collection2);
|
|
32721
|
-
} catch (error2) {
|
|
32722
|
-
cms.alerts.error(
|
|
32723
|
-
`[${error2.name}] GetCollection failed: ${error2.message}`
|
|
32724
|
-
);
|
|
32725
|
-
console.error(error2);
|
|
32726
|
-
setCollection(void 0);
|
|
32727
|
-
setError(error2);
|
|
32728
|
-
}
|
|
32729
|
-
setLoading(false);
|
|
32730
|
-
}
|
|
32731
|
-
};
|
|
32732
|
-
if (cancelled)
|
|
32733
|
-
return;
|
|
32734
|
-
setLoading(true);
|
|
32735
|
-
fetchCollection();
|
|
32736
|
-
return () => {
|
|
32737
|
-
cancelled = true;
|
|
32738
|
-
};
|
|
32739
|
-
}, [
|
|
32740
|
-
cms,
|
|
32741
|
-
collectionName,
|
|
32742
|
-
folder.loading,
|
|
32743
|
-
folder.fullyQualifiedName,
|
|
32744
|
-
resetState,
|
|
32745
|
-
after,
|
|
32746
|
-
sortKey
|
|
32747
|
-
]);
|
|
32748
|
-
const reFetchCollection = () => setResetSate((x) => x + 1);
|
|
32749
|
-
return { collection, loading, error, reFetchCollection, collectionExtra };
|
|
32750
|
-
};
|
|
32751
|
-
const useSearchCollection = (cms, collectionName, includeDocuments = true, folder, after = "", search) => {
|
|
32752
|
-
const api = new TinaAdminApi(cms);
|
|
32753
|
-
const schema = cms.api.tina.schema;
|
|
32754
|
-
const collectionExtra = schema.getCollection(collectionName);
|
|
32755
|
-
const [collection, setCollection] = React.useState(void 0);
|
|
32756
|
-
const [loading, setLoading] = React.useState(true);
|
|
32757
|
-
const [error, setError] = React.useState(void 0);
|
|
32758
|
-
const [resetState, setResetSate] = React.useState(0);
|
|
32641
|
+
function RiHome2Line(props) {
|
|
32642
|
+
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "d": "M19 21H5C4.44772 21 4 20.5523 4 20V11L1 11L11.3273 1.6115C11.7087 1.26475 12.2913 1.26475 12.6727 1.6115L23 11L20 11V20C20 20.5523 19.5523 21 19 21ZM6 19H18V9.15745L12 3.7029L6 9.15745V19Z" }, "child": [] }] })(props);
|
|
32643
|
+
}
|
|
32644
|
+
const PageWrapper = ({ children }) => {
|
|
32645
|
+
var _a, _b;
|
|
32646
|
+
const cms = useCMS$1();
|
|
32647
|
+
const isLocalMode = (_b = (_a = cms.api) == null ? void 0 : _a.tina) == null ? void 0 : _b.isLocalMode;
|
|
32648
|
+
const [branchingEnabled, setBranchingEnabled] = React.useState(
|
|
32649
|
+
() => cms.flags.get("branch-switcher")
|
|
32650
|
+
);
|
|
32759
32651
|
React.useEffect(() => {
|
|
32760
|
-
|
|
32761
|
-
|
|
32762
|
-
|
|
32763
|
-
try {
|
|
32764
|
-
const response = await cms.api.search.query(
|
|
32765
|
-
`${search} AND _collection:${collectionName}`,
|
|
32766
|
-
{
|
|
32767
|
-
limit: 15,
|
|
32768
|
-
cursor: after
|
|
32769
|
-
}
|
|
32770
|
-
);
|
|
32771
|
-
const docs = await Promise.allSettled(
|
|
32772
|
-
response.results.map((result) => {
|
|
32773
|
-
const [collection2, relativePath2] = result._id.split(":");
|
|
32774
|
-
return api.fetchDocument(collection2, relativePath2, false);
|
|
32775
|
-
})
|
|
32776
|
-
);
|
|
32777
|
-
const edges = docs.filter((p) => {
|
|
32778
|
-
var _a;
|
|
32779
|
-
return p.status === "fulfilled" && !!((_a = p.value) == null ? void 0 : _a.document);
|
|
32780
|
-
}).map((result) => ({ node: result.value.document }));
|
|
32781
|
-
const c = await api.fetchCollection(collectionName, false, "");
|
|
32782
|
-
setCollection({
|
|
32783
|
-
format: collection.format,
|
|
32784
|
-
label: collection.label,
|
|
32785
|
-
name: collectionName,
|
|
32786
|
-
templates: collection.templates,
|
|
32787
|
-
documents: {
|
|
32788
|
-
pageInfo: {
|
|
32789
|
-
hasNextPage: !!response.nextCursor,
|
|
32790
|
-
hasPreviousPage: !!response.prevCursor,
|
|
32791
|
-
startCursor: "",
|
|
32792
|
-
endCursor: response.nextCursor || ""
|
|
32793
|
-
},
|
|
32794
|
-
edges
|
|
32795
|
-
}
|
|
32796
|
-
});
|
|
32797
|
-
} catch (error2) {
|
|
32798
|
-
cms.alerts.error(
|
|
32799
|
-
`[${error2.name}] GetCollection failed: ${error2.message}`
|
|
32800
|
-
);
|
|
32801
|
-
console.error(error2);
|
|
32802
|
-
setCollection(void 0);
|
|
32803
|
-
setError(error2);
|
|
32804
|
-
}
|
|
32805
|
-
setLoading(false);
|
|
32652
|
+
cms.events.subscribe("flag:set", ({ key, value }) => {
|
|
32653
|
+
if (key === "branch-switcher") {
|
|
32654
|
+
setBranchingEnabled(value);
|
|
32806
32655
|
}
|
|
32807
|
-
};
|
|
32808
|
-
|
|
32809
|
-
|
|
32810
|
-
setLoading(true);
|
|
32811
|
-
searchCollection();
|
|
32812
|
-
return () => {
|
|
32813
|
-
cancelled = true;
|
|
32814
|
-
};
|
|
32815
|
-
}, [
|
|
32816
|
-
cms,
|
|
32817
|
-
collectionName,
|
|
32818
|
-
folder.loading,
|
|
32819
|
-
folder.fullyQualifiedName,
|
|
32820
|
-
resetState,
|
|
32821
|
-
after,
|
|
32822
|
-
search
|
|
32823
|
-
]);
|
|
32824
|
-
const reFetchCollection = () => setResetSate((x) => x + 1);
|
|
32825
|
-
return { collection, loading, error, reFetchCollection, collectionExtra };
|
|
32656
|
+
});
|
|
32657
|
+
}, [cms.events]);
|
|
32658
|
+
return /* @__PURE__ */ React.createElement("div", { className: "relative left-0 w-full h-full bg-gradient-to-b from-gray-50/50 to-gray-50 shadow-2xl overflow-y-auto transition-opacity duration-300 ease-out flex flex-col opacity-100" }, branchingEnabled && !isLocalMode && /* @__PURE__ */ React.createElement(BranchBanner, null), children);
|
|
32826
32659
|
};
|
|
32827
|
-
const
|
|
32828
|
-
|
|
32829
|
-
|
|
32830
|
-
folder,
|
|
32831
|
-
includeDocuments = true,
|
|
32832
|
-
startCursor,
|
|
32833
|
-
sortKey,
|
|
32834
|
-
children,
|
|
32835
|
-
filterArgs,
|
|
32836
|
-
search
|
|
32660
|
+
const PageHeader = ({
|
|
32661
|
+
isLocalMode,
|
|
32662
|
+
children
|
|
32837
32663
|
}) => {
|
|
32838
|
-
|
|
32839
|
-
const { collection, loading, error, reFetchCollection, collectionExtra } = search ? useSearchCollection(
|
|
32840
|
-
cms,
|
|
32841
|
-
collectionName,
|
|
32842
|
-
includeDocuments,
|
|
32843
|
-
folder,
|
|
32844
|
-
startCursor || "",
|
|
32845
|
-
search
|
|
32846
|
-
) : useGetCollection(
|
|
32847
|
-
cms,
|
|
32848
|
-
collectionName,
|
|
32849
|
-
includeDocuments,
|
|
32850
|
-
folder,
|
|
32851
|
-
startCursor || "",
|
|
32852
|
-
sortKey,
|
|
32853
|
-
filterArgs
|
|
32854
|
-
) || {};
|
|
32855
|
-
React.useEffect(() => {
|
|
32856
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
32857
|
-
if (loading)
|
|
32858
|
-
return;
|
|
32859
|
-
const collectionDefinition = cms.api.tina.schema.getCollection(
|
|
32860
|
-
collection.name
|
|
32861
|
-
);
|
|
32862
|
-
const allowCreate = ((_b = (_a = collectionDefinition == null ? void 0 : collectionDefinition.ui) == null ? void 0 : _a.allowedActions) == null ? void 0 : _b.create) ?? true;
|
|
32863
|
-
const allowDelete = ((_d = (_c = collectionDefinition == null ? void 0 : collectionDefinition.ui) == null ? void 0 : _c.allowedActions) == null ? void 0 : _d.delete) ?? true;
|
|
32864
|
-
const collectionResponse = collection;
|
|
32865
|
-
if (!allowCreate && !allowDelete && // Check there is only one document
|
|
32866
|
-
((_f = (_e = collectionResponse.documents) == null ? void 0 : _e.edges) == null ? void 0 : _f.length) === 1 && // Check to make sure the file is not a folder
|
|
32867
|
-
((_i = (_h = (_g = collectionResponse.documents) == null ? void 0 : _g.edges[0]) == null ? void 0 : _h.node) == null ? void 0 : _i.__typename) !== "Folder") {
|
|
32868
|
-
const doc = collectionResponse.documents.edges[0].node;
|
|
32869
|
-
handleNavigate(
|
|
32870
|
-
navigate,
|
|
32871
|
-
cms,
|
|
32872
|
-
collectionResponse,
|
|
32873
|
-
collectionDefinition,
|
|
32874
|
-
doc
|
|
32875
|
-
);
|
|
32876
|
-
}
|
|
32877
|
-
}, [(collection == null ? void 0 : collection.name) || "", loading]);
|
|
32878
|
-
if (error) {
|
|
32879
|
-
return /* @__PURE__ */ React.createElement(FullscreenError, null);
|
|
32880
|
-
}
|
|
32881
|
-
if (loading) {
|
|
32882
|
-
return /* @__PURE__ */ React.createElement(LoadingPage, null);
|
|
32883
|
-
}
|
|
32884
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, children(collection, loading, reFetchCollection, collectionExtra));
|
|
32664
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, isLocalMode && /* @__PURE__ */ React.createElement(LocalWarning, null), !isLocalMode && /* @__PURE__ */ React.createElement(BillingWarning, null), /* @__PURE__ */ React.createElement("div", { className: "pt-16 xl:pt-12 px-6 xl:px-12" }, /* @__PURE__ */ React.createElement("div", { className: "w-full mx-auto max-w-screen-xl" }, /* @__PURE__ */ React.createElement("div", { className: "w-full flex justify-between items-end" }, children))));
|
|
32885
32665
|
};
|
|
32666
|
+
const PageBody = ({ children }) => /* @__PURE__ */ React.createElement("div", { className: "py-8 px-6 xl:px-12" }, children);
|
|
32667
|
+
const PageBodyNarrow = ({ children }) => /* @__PURE__ */ React.createElement("div", { className: "py-10 px-6 xl:px-12" }, /* @__PURE__ */ React.createElement("div", { className: "w-full mx-auto max-w-screen-xl" }, children));
|
|
32886
32668
|
const folderRegex = /^.*\/~\/*(.*)$/;
|
|
32887
32669
|
const parentFolder = (folder) => {
|
|
32888
32670
|
return {
|
|
@@ -33760,6 +33542,231 @@ This will work when developing locally but NOT when deployed to production.
|
|
|
33760
33542
|
"Rename"
|
|
33761
33543
|
))));
|
|
33762
33544
|
};
|
|
33545
|
+
const FullscreenError = ({
|
|
33546
|
+
title = "Error",
|
|
33547
|
+
errorMessage = "It looks like something went wrong."
|
|
33548
|
+
}) => {
|
|
33549
|
+
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"));
|
|
33550
|
+
};
|
|
33551
|
+
const isValidSortKey = (sortKey, collection) => {
|
|
33552
|
+
if (collection.fields) {
|
|
33553
|
+
const sortKeys = collection.fields.map((x) => x.name);
|
|
33554
|
+
return sortKeys.includes(sortKey);
|
|
33555
|
+
} else if (collection.templates) {
|
|
33556
|
+
const collectionMap = {};
|
|
33557
|
+
const conflictedFields = /* @__PURE__ */ new Set();
|
|
33558
|
+
for (const template of collection.templates) {
|
|
33559
|
+
for (const field of template.fields) {
|
|
33560
|
+
if (collectionMap[field.name]) {
|
|
33561
|
+
if (collectionMap[field.name].type !== field.type) {
|
|
33562
|
+
conflictedFields.add(field.name);
|
|
33563
|
+
}
|
|
33564
|
+
} else {
|
|
33565
|
+
collectionMap[field.name] = field;
|
|
33566
|
+
}
|
|
33567
|
+
}
|
|
33568
|
+
}
|
|
33569
|
+
for (const key in conflictedFields) {
|
|
33570
|
+
delete collectionMap[key];
|
|
33571
|
+
}
|
|
33572
|
+
for (const key in collectionMap) {
|
|
33573
|
+
if (key === sortKey) {
|
|
33574
|
+
return true;
|
|
33575
|
+
}
|
|
33576
|
+
}
|
|
33577
|
+
return false;
|
|
33578
|
+
}
|
|
33579
|
+
};
|
|
33580
|
+
const useGetCollection = (cms, collectionName, includeDocuments = true, folder, after = "", sortKey, filterArgs) => {
|
|
33581
|
+
const api = new TinaAdminApi(cms);
|
|
33582
|
+
const schema = cms.api.tina.schema;
|
|
33583
|
+
const collectionExtra = schema.getCollection(collectionName);
|
|
33584
|
+
const [collection, setCollection] = React.useState(void 0);
|
|
33585
|
+
const [loading, setLoading] = React.useState(true);
|
|
33586
|
+
const [error, setError] = React.useState(void 0);
|
|
33587
|
+
const [resetState, setResetSate] = React.useState(0);
|
|
33588
|
+
React.useEffect(() => {
|
|
33589
|
+
let cancelled = false;
|
|
33590
|
+
const fetchCollection = async () => {
|
|
33591
|
+
if (await api.isAuthenticated() && !folder.loading && !cancelled) {
|
|
33592
|
+
const { name, order } = JSON.parse(sortKey || "{}");
|
|
33593
|
+
const validSortKey = isValidSortKey(name, collectionExtra) ? name : void 0;
|
|
33594
|
+
try {
|
|
33595
|
+
const collection2 = await api.fetchCollection(
|
|
33596
|
+
collectionName,
|
|
33597
|
+
includeDocuments,
|
|
33598
|
+
(filterArgs == null ? void 0 : filterArgs.filterField) ? "" : folder.fullyQualifiedName,
|
|
33599
|
+
after,
|
|
33600
|
+
validSortKey,
|
|
33601
|
+
order,
|
|
33602
|
+
filterArgs
|
|
33603
|
+
);
|
|
33604
|
+
setCollection(collection2);
|
|
33605
|
+
} catch (error2) {
|
|
33606
|
+
cms.alerts.error(
|
|
33607
|
+
`[${error2.name}] GetCollection failed: ${error2.message}`
|
|
33608
|
+
);
|
|
33609
|
+
console.error(error2);
|
|
33610
|
+
setCollection(void 0);
|
|
33611
|
+
setError(error2);
|
|
33612
|
+
}
|
|
33613
|
+
setLoading(false);
|
|
33614
|
+
}
|
|
33615
|
+
};
|
|
33616
|
+
if (cancelled)
|
|
33617
|
+
return;
|
|
33618
|
+
setLoading(true);
|
|
33619
|
+
fetchCollection();
|
|
33620
|
+
return () => {
|
|
33621
|
+
cancelled = true;
|
|
33622
|
+
};
|
|
33623
|
+
}, [
|
|
33624
|
+
cms,
|
|
33625
|
+
collectionName,
|
|
33626
|
+
folder.loading,
|
|
33627
|
+
folder.fullyQualifiedName,
|
|
33628
|
+
resetState,
|
|
33629
|
+
after,
|
|
33630
|
+
sortKey
|
|
33631
|
+
]);
|
|
33632
|
+
const reFetchCollection = () => setResetSate((x) => x + 1);
|
|
33633
|
+
return { collection, loading, error, reFetchCollection, collectionExtra };
|
|
33634
|
+
};
|
|
33635
|
+
const useSearchCollection = (cms, collectionName, includeDocuments = true, folder, after = "", search) => {
|
|
33636
|
+
const api = new TinaAdminApi(cms);
|
|
33637
|
+
const schema = cms.api.tina.schema;
|
|
33638
|
+
const collectionExtra = schema.getCollection(collectionName);
|
|
33639
|
+
const [collection, setCollection] = React.useState(void 0);
|
|
33640
|
+
const [loading, setLoading] = React.useState(true);
|
|
33641
|
+
const [error, setError] = React.useState(void 0);
|
|
33642
|
+
const [resetState, setResetSate] = React.useState(0);
|
|
33643
|
+
React.useEffect(() => {
|
|
33644
|
+
let cancelled = false;
|
|
33645
|
+
const searchCollection = async () => {
|
|
33646
|
+
if (await api.isAuthenticated() && !folder.loading && !cancelled) {
|
|
33647
|
+
try {
|
|
33648
|
+
const response = await cms.api.search.query(
|
|
33649
|
+
`${search} AND _collection:${collectionName}`,
|
|
33650
|
+
{
|
|
33651
|
+
limit: 15,
|
|
33652
|
+
cursor: after
|
|
33653
|
+
}
|
|
33654
|
+
);
|
|
33655
|
+
const docs = await Promise.allSettled(
|
|
33656
|
+
response.results.map((result) => {
|
|
33657
|
+
const [collection2, relativePath2] = result._id.split(":");
|
|
33658
|
+
return api.fetchDocument(collection2, relativePath2, false);
|
|
33659
|
+
})
|
|
33660
|
+
);
|
|
33661
|
+
const edges = docs.filter((p) => {
|
|
33662
|
+
var _a;
|
|
33663
|
+
return p.status === "fulfilled" && !!((_a = p.value) == null ? void 0 : _a.document);
|
|
33664
|
+
}).map((result) => ({ node: result.value.document }));
|
|
33665
|
+
const c = await api.fetchCollection(collectionName, false, "");
|
|
33666
|
+
setCollection({
|
|
33667
|
+
format: collection.format,
|
|
33668
|
+
label: collection.label,
|
|
33669
|
+
name: collectionName,
|
|
33670
|
+
templates: collection.templates,
|
|
33671
|
+
documents: {
|
|
33672
|
+
pageInfo: {
|
|
33673
|
+
hasNextPage: !!response.nextCursor,
|
|
33674
|
+
hasPreviousPage: !!response.prevCursor,
|
|
33675
|
+
startCursor: "",
|
|
33676
|
+
endCursor: response.nextCursor || ""
|
|
33677
|
+
},
|
|
33678
|
+
edges
|
|
33679
|
+
}
|
|
33680
|
+
});
|
|
33681
|
+
} catch (error2) {
|
|
33682
|
+
cms.alerts.error(
|
|
33683
|
+
`[${error2.name}] GetCollection failed: ${error2.message}`
|
|
33684
|
+
);
|
|
33685
|
+
console.error(error2);
|
|
33686
|
+
setCollection(void 0);
|
|
33687
|
+
setError(error2);
|
|
33688
|
+
}
|
|
33689
|
+
setLoading(false);
|
|
33690
|
+
}
|
|
33691
|
+
};
|
|
33692
|
+
if (cancelled)
|
|
33693
|
+
return;
|
|
33694
|
+
setLoading(true);
|
|
33695
|
+
searchCollection();
|
|
33696
|
+
return () => {
|
|
33697
|
+
cancelled = true;
|
|
33698
|
+
};
|
|
33699
|
+
}, [
|
|
33700
|
+
cms,
|
|
33701
|
+
collectionName,
|
|
33702
|
+
folder.loading,
|
|
33703
|
+
folder.fullyQualifiedName,
|
|
33704
|
+
resetState,
|
|
33705
|
+
after,
|
|
33706
|
+
search
|
|
33707
|
+
]);
|
|
33708
|
+
const reFetchCollection = () => setResetSate((x) => x + 1);
|
|
33709
|
+
return { collection, loading, error, reFetchCollection, collectionExtra };
|
|
33710
|
+
};
|
|
33711
|
+
const GetCollection = ({
|
|
33712
|
+
cms,
|
|
33713
|
+
collectionName,
|
|
33714
|
+
folder,
|
|
33715
|
+
includeDocuments = true,
|
|
33716
|
+
startCursor,
|
|
33717
|
+
sortKey,
|
|
33718
|
+
children,
|
|
33719
|
+
filterArgs,
|
|
33720
|
+
search
|
|
33721
|
+
}) => {
|
|
33722
|
+
const navigate = reactRouterDom.useNavigate();
|
|
33723
|
+
const { collection, loading, error, reFetchCollection, collectionExtra } = search ? useSearchCollection(
|
|
33724
|
+
cms,
|
|
33725
|
+
collectionName,
|
|
33726
|
+
includeDocuments,
|
|
33727
|
+
folder,
|
|
33728
|
+
startCursor || "",
|
|
33729
|
+
search
|
|
33730
|
+
) : useGetCollection(
|
|
33731
|
+
cms,
|
|
33732
|
+
collectionName,
|
|
33733
|
+
includeDocuments,
|
|
33734
|
+
folder,
|
|
33735
|
+
startCursor || "",
|
|
33736
|
+
sortKey,
|
|
33737
|
+
filterArgs
|
|
33738
|
+
) || {};
|
|
33739
|
+
React.useEffect(() => {
|
|
33740
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
33741
|
+
if (loading)
|
|
33742
|
+
return;
|
|
33743
|
+
const collectionDefinition = cms.api.tina.schema.getCollection(
|
|
33744
|
+
collection.name
|
|
33745
|
+
);
|
|
33746
|
+
const allowCreate = ((_b = (_a = collectionDefinition == null ? void 0 : collectionDefinition.ui) == null ? void 0 : _a.allowedActions) == null ? void 0 : _b.create) ?? true;
|
|
33747
|
+
const allowDelete = ((_d = (_c = collectionDefinition == null ? void 0 : collectionDefinition.ui) == null ? void 0 : _c.allowedActions) == null ? void 0 : _d.delete) ?? true;
|
|
33748
|
+
const collectionResponse = collection;
|
|
33749
|
+
if (!allowCreate && !allowDelete && // Check there is only one document
|
|
33750
|
+
((_f = (_e = collectionResponse.documents) == null ? void 0 : _e.edges) == null ? void 0 : _f.length) === 1 && // Check to make sure the file is not a folder
|
|
33751
|
+
((_i = (_h = (_g = collectionResponse.documents) == null ? void 0 : _g.edges[0]) == null ? void 0 : _h.node) == null ? void 0 : _i.__typename) !== "Folder") {
|
|
33752
|
+
const doc = collectionResponse.documents.edges[0].node;
|
|
33753
|
+
handleNavigate(
|
|
33754
|
+
navigate,
|
|
33755
|
+
cms,
|
|
33756
|
+
collectionResponse,
|
|
33757
|
+
collectionDefinition,
|
|
33758
|
+
doc
|
|
33759
|
+
);
|
|
33760
|
+
}
|
|
33761
|
+
}, [(collection == null ? void 0 : collection.name) || "", loading]);
|
|
33762
|
+
if (error) {
|
|
33763
|
+
return /* @__PURE__ */ React.createElement(FullscreenError, null);
|
|
33764
|
+
}
|
|
33765
|
+
if (loading) {
|
|
33766
|
+
return /* @__PURE__ */ React.createElement(LoadingPage, null);
|
|
33767
|
+
}
|
|
33768
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, children(collection, loading, reFetchCollection, collectionExtra));
|
|
33769
|
+
};
|
|
33763
33770
|
const ErrorDialog = (props) => {
|
|
33764
33771
|
return /* @__PURE__ */ React.createElement(
|
|
33765
33772
|
"div",
|
|
@@ -34303,6 +34310,12 @@ This will work when developing locally but NOT when deployed to production.
|
|
|
34303
34310
|
), /* @__PURE__ */ React.createElement("span", { className: "opacity-30 text-sm leading-tight whitespace-nowrap flex-0" }, "/"), /* @__PURE__ */ React.createElement("span", { className: "flex-1 w-full text-sm leading-tight whitespace-nowrap truncate" }, `${filename}.${collection.format}`), /* @__PURE__ */ React.createElement(FormStatus, { pristine: formIsPristine }))
|
|
34304
34311
|
), activeForm && /* @__PURE__ */ React.createElement(FormBuilder, { form: activeForm, onPristineChange: setFormIsPristine }));
|
|
34305
34312
|
};
|
|
34313
|
+
const DashboardPage = () => {
|
|
34314
|
+
return /* @__PURE__ */ React.createElement(GetCMS, null, (cms) => {
|
|
34315
|
+
var _a, _b;
|
|
34316
|
+
return /* @__PURE__ */ React.createElement(PageWrapper, null, /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(PageHeader, { isLocalMode: (_b = (_a = cms.api) == null ? void 0 : _a.tina) == null ? void 0 : _b.isLocalMode }, /* @__PURE__ */ React.createElement("h3", { className: "text-2xl font-sans text-gray-700" }, "Welcome to Tina!")), /* @__PURE__ */ React.createElement(PageBodyNarrow, null, "This is your dashboard for editing or creating content. Select a collection on the left to begin.")));
|
|
34317
|
+
});
|
|
34318
|
+
};
|
|
34306
34319
|
const ScreenPage = () => {
|
|
34307
34320
|
const { screenName } = reactRouterDom.useParams();
|
|
34308
34321
|
return /* @__PURE__ */ React.createElement(GetCMS, null, (cms) => {
|
|
@@ -34385,7 +34398,7 @@ This will work when developing locally but NOT when deployed to production.
|
|
|
34385
34398
|
} catch {
|
|
34386
34399
|
cms.alerts.error("Branch indexing failed.");
|
|
34387
34400
|
setErrorMessage(
|
|
34388
|
-
'Branch indexing failed, please check the
|
|
34401
|
+
'Branch indexing failed, please check the TinaCloud dashboard for more information. To try again chick "re-index" on the branch in the dashboard.'
|
|
34389
34402
|
);
|
|
34390
34403
|
setState("error");
|
|
34391
34404
|
}
|
|
@@ -34553,7 +34566,7 @@ This will work when developing locally but NOT when deployed to production.
|
|
|
34553
34566
|
);
|
|
34554
34567
|
}
|
|
34555
34568
|
}).catch((e) => {
|
|
34556
|
-
if (e.message.includes("has not been indexed by
|
|
34569
|
+
if (e.message.includes("has not been indexed by TinaCloud")) {
|
|
34557
34570
|
setSchemaMissingError(true);
|
|
34558
34571
|
} else {
|
|
34559
34572
|
cms.alerts.error(`Unexpected error checking schema: ${e}`);
|