tinacms 2.7.3 → 2.7.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/admin/components/GetCollection.d.ts +2 -2
- package/dist/client.js +10 -1
- package/dist/client.mjs +10 -1
- package/dist/index.js +789 -714
- package/dist/index.mjs +790 -715
- package/dist/internalClient/index.d.ts +3 -3
- package/dist/react.js +3 -0
- package/dist/react.mjs +3 -0
- 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/toolkit/react-sidebar/components/sidebar-body.d.ts +5 -4
- package/dist/toolkit/react-sidebar/components/sidebar-loading-placeholder.d.ts +2 -0
- package/dist/toolkit/react-sidebar/components/sidebar-no-forms-placeholder.d.ts +2 -0
- package/dist/toolkit/react-sidebar/sidebar.d.ts +2 -2
- package/dist/toolkit/tina-state.d.ts +4 -0
- package/dist/unifiedClient/index.d.ts +1 -1
- package/package.json +5 -5
- package/dist/toolkit/react-sidebar/components/no-forms-placeholder.d.ts +0 -8
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("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("
|
|
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, get, moment, dateFns, plateLink, ToolbarPrimitive, TooltipPrimitive, plateParagraph, plateBlockQuote, plateFloating,
|
|
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
|
});
|
|
@@ -9608,7 +9608,7 @@ flowchart TD
|
|
|
9608
9608
|
return this.add("error", message, timeout);
|
|
9609
9609
|
}
|
|
9610
9610
|
};
|
|
9611
|
-
const
|
|
9611
|
+
const SidebarLoadingPlaceholder = () => /* @__PURE__ */ React__namespace.createElement(
|
|
9612
9612
|
"div",
|
|
9613
9613
|
{
|
|
9614
9614
|
className: "relative flex flex-col items-center justify-center text-center p-5 pb-16 w-full h-full overflow-y-auto",
|
|
@@ -9621,25 +9621,8 @@ flowchart TD
|
|
|
9621
9621
|
animationDuration: "150ms"
|
|
9622
9622
|
}
|
|
9623
9623
|
},
|
|
9624
|
-
/* @__PURE__ */ React__namespace.createElement(
|
|
9625
|
-
/* @__PURE__ */ React__namespace.createElement(
|
|
9626
|
-
/* @__PURE__ */ React__namespace.createElement("p", { className: "block" }, /* @__PURE__ */ React__namespace.createElement(
|
|
9627
|
-
Button$1,
|
|
9628
|
-
{
|
|
9629
|
-
href: "https://tina.io/docs/tinacms-context/",
|
|
9630
|
-
target: "_blank",
|
|
9631
|
-
as: "a"
|
|
9632
|
-
},
|
|
9633
|
-
/* @__PURE__ */ React__namespace.createElement(Emoji$1, { className: "mr-1.5" }, "📖"),
|
|
9634
|
-
" Contextual Editing"
|
|
9635
|
-
))
|
|
9636
|
-
);
|
|
9637
|
-
const Emoji$1 = ({ className = "", ...props }) => /* @__PURE__ */ React__namespace.createElement(
|
|
9638
|
-
"span",
|
|
9639
|
-
{
|
|
9640
|
-
className: `text-[24px] leading-none inline-block ${className}`,
|
|
9641
|
-
...props
|
|
9642
|
-
}
|
|
9624
|
+
/* @__PURE__ */ React__namespace.createElement("p", { className: "block pb-5" }, "Please wait while TinaCMS", /* @__PURE__ */ React__namespace.createElement("br", null), "loads your content"),
|
|
9625
|
+
/* @__PURE__ */ React__namespace.createElement(LoadingDots, { color: "var(--tina-color-primary)" })
|
|
9643
9626
|
);
|
|
9644
9627
|
class SidebarState {
|
|
9645
9628
|
constructor(events, options = {}) {
|
|
@@ -9654,7 +9637,7 @@ flowchart TD
|
|
|
9654
9637
|
};
|
|
9655
9638
|
this.position = options.position || "displace";
|
|
9656
9639
|
this.renderNav = options.renderNav || true;
|
|
9657
|
-
this.
|
|
9640
|
+
this.loadingPlaceholder = options.placeholder || SidebarLoadingPlaceholder;
|
|
9658
9641
|
if ((_a = options.buttons) == null ? void 0 : _a.save) {
|
|
9659
9642
|
this.buttons.save = options.buttons.save;
|
|
9660
9643
|
}
|
|
@@ -9728,238 +9711,6 @@ flowchart TD
|
|
|
9728
9711
|
children
|
|
9729
9712
|
)));
|
|
9730
9713
|
};
|
|
9731
|
-
const Item = ({
|
|
9732
|
-
item,
|
|
9733
|
-
depth,
|
|
9734
|
-
setActiveFormId
|
|
9735
|
-
}) => {
|
|
9736
|
-
const cms = useCMS();
|
|
9737
|
-
const depths = ["pl-6", "pl-10", "pl-14"];
|
|
9738
|
-
const form = React__namespace.useMemo(
|
|
9739
|
-
() => cms.state.forms.find(({ tinaForm }) => item.formId === tinaForm.id),
|
|
9740
|
-
[item.formId]
|
|
9741
|
-
);
|
|
9742
|
-
return /* @__PURE__ */ React__namespace.createElement(
|
|
9743
|
-
"button",
|
|
9744
|
-
{
|
|
9745
|
-
type: "button",
|
|
9746
|
-
key: item.path,
|
|
9747
|
-
onClick: () => setActiveFormId(item.formId),
|
|
9748
|
-
className: `${depths[depth] || "pl-12"} pr-6 py-3 w-full h-full bg-transparent border-none text-lg text-gray-700 group hover:bg-gray-50 transition-all ease-out duration-150 flex items-center justify-between gap-2`
|
|
9749
|
-
},
|
|
9750
|
-
/* @__PURE__ */ React__namespace.createElement(BiEdit, { className: "opacity-70 w-5 h-auto text-blue-500 flex-none" }),
|
|
9751
|
-
/* @__PURE__ */ React__namespace.createElement("div", { className: "flex-1 flex flex-col gap-0.5 items-start" }, /* @__PURE__ */ React__namespace.createElement("div", { className: "group-hover:text-blue-500 font-sans text-xs font-semibold text-gray-700 whitespace-normal" }, form.tinaForm.label), /* @__PURE__ */ React__namespace.createElement("div", { className: "group-hover:text-blue-500 text-base truncate leading-tight text-gray-600" }, form.tinaForm.id))
|
|
9752
|
-
);
|
|
9753
|
-
};
|
|
9754
|
-
const FormListItem = ({
|
|
9755
|
-
item,
|
|
9756
|
-
depth,
|
|
9757
|
-
setActiveFormId
|
|
9758
|
-
}) => {
|
|
9759
|
-
var _a;
|
|
9760
|
-
return /* @__PURE__ */ React__namespace.createElement("div", { className: "divide-y divide-gray-200" }, /* @__PURE__ */ React__namespace.createElement(Item, { setActiveFormId, item, depth }), item.subItems && /* @__PURE__ */ React__namespace.createElement("ul", { className: "divide-y divide-gray-200" }, (_a = item.subItems) == null ? void 0 : _a.map((subItem) => {
|
|
9761
|
-
if (subItem.type === "document") {
|
|
9762
|
-
return /* @__PURE__ */ React__namespace.createElement("li", { key: subItem.formId }, /* @__PURE__ */ React__namespace.createElement(
|
|
9763
|
-
Item,
|
|
9764
|
-
{
|
|
9765
|
-
setActiveFormId,
|
|
9766
|
-
depth: depth + 1,
|
|
9767
|
-
item: subItem
|
|
9768
|
-
}
|
|
9769
|
-
));
|
|
9770
|
-
}
|
|
9771
|
-
})));
|
|
9772
|
-
};
|
|
9773
|
-
const FormLists = (props) => {
|
|
9774
|
-
const cms = useCMS();
|
|
9775
|
-
return /* @__PURE__ */ React__namespace.createElement(
|
|
9776
|
-
react.Transition,
|
|
9777
|
-
{
|
|
9778
|
-
appear: true,
|
|
9779
|
-
show: true,
|
|
9780
|
-
as: "div",
|
|
9781
|
-
enter: "transition-all ease-out duration-150",
|
|
9782
|
-
enterFrom: "opacity-0 -translate-x-1/2",
|
|
9783
|
-
enterTo: "opacity-100",
|
|
9784
|
-
leave: "transition-all ease-out duration-150",
|
|
9785
|
-
leaveFrom: "opacity-100",
|
|
9786
|
-
leaveTo: "opacity-0 -translate-x-1/2"
|
|
9787
|
-
},
|
|
9788
|
-
cms.state.formLists.map((formList, index) => /* @__PURE__ */ React__namespace.createElement("div", { key: `${formList.id}-${index}`, className: "pt-16" }, /* @__PURE__ */ React__namespace.createElement(
|
|
9789
|
-
FormList,
|
|
9790
|
-
{
|
|
9791
|
-
isEditing: props.isEditing,
|
|
9792
|
-
setActiveFormId: (id) => {
|
|
9793
|
-
cms.dispatch({ type: "forms:set-active-form-id", value: id });
|
|
9794
|
-
},
|
|
9795
|
-
formList
|
|
9796
|
-
}
|
|
9797
|
-
)))
|
|
9798
|
-
);
|
|
9799
|
-
};
|
|
9800
|
-
const FormList = (props) => {
|
|
9801
|
-
const cms = useCMS();
|
|
9802
|
-
const listItems = React__namespace.useMemo(() => {
|
|
9803
|
-
var _a;
|
|
9804
|
-
const orderedListItems = [];
|
|
9805
|
-
const globalItems = [];
|
|
9806
|
-
const topItems = [];
|
|
9807
|
-
props.formList.items.forEach((item) => {
|
|
9808
|
-
if (item.type === "document") {
|
|
9809
|
-
const form = cms.state.forms.find(
|
|
9810
|
-
({ tinaForm }) => tinaForm.id === item.formId
|
|
9811
|
-
);
|
|
9812
|
-
if (form.tinaForm.global) {
|
|
9813
|
-
globalItems.push(item);
|
|
9814
|
-
} else {
|
|
9815
|
-
orderedListItems.push(item);
|
|
9816
|
-
}
|
|
9817
|
-
} else {
|
|
9818
|
-
orderedListItems.push(item);
|
|
9819
|
-
}
|
|
9820
|
-
});
|
|
9821
|
-
if (((_a = orderedListItems[0]) == null ? void 0 : _a.type) === "document") {
|
|
9822
|
-
topItems.push({ type: "list", label: "Documents" });
|
|
9823
|
-
}
|
|
9824
|
-
let extra = [];
|
|
9825
|
-
if (globalItems.length) {
|
|
9826
|
-
extra = [{ type: "list", label: "Global Documents" }, ...globalItems];
|
|
9827
|
-
}
|
|
9828
|
-
return [...topItems, ...orderedListItems, ...extra];
|
|
9829
|
-
}, [JSON.stringify(props.formList.items)]);
|
|
9830
|
-
return /* @__PURE__ */ React__namespace.createElement("ul", null, /* @__PURE__ */ React__namespace.createElement("li", { className: "divide-y divide-gray-200" }, listItems.map((item, index) => {
|
|
9831
|
-
if (item.type === "list") {
|
|
9832
|
-
return /* @__PURE__ */ React__namespace.createElement(
|
|
9833
|
-
"div",
|
|
9834
|
-
{
|
|
9835
|
-
key: item.label,
|
|
9836
|
-
className: `relative group text-left w-full bg-white shadow-sm
|
|
9837
|
-
border-gray-100 px-6 -mt-px pb-3 ${index > 0 ? "pt-6 bg-gradient-to-b from-gray-50 via-white to-white" : "pt-3"}`
|
|
9838
|
-
},
|
|
9839
|
-
/* @__PURE__ */ React__namespace.createElement(
|
|
9840
|
-
"span",
|
|
9841
|
-
{
|
|
9842
|
-
className: "text-sm tracking-wide font-bold text-gray-700 uppercase"
|
|
9843
|
-
},
|
|
9844
|
-
item.label
|
|
9845
|
-
)
|
|
9846
|
-
);
|
|
9847
|
-
}
|
|
9848
|
-
return /* @__PURE__ */ React__namespace.createElement(
|
|
9849
|
-
FormListItem,
|
|
9850
|
-
{
|
|
9851
|
-
setActiveFormId: (id) => props.setActiveFormId(id),
|
|
9852
|
-
key: item.formId,
|
|
9853
|
-
item,
|
|
9854
|
-
depth: 0
|
|
9855
|
-
}
|
|
9856
|
-
);
|
|
9857
|
-
})));
|
|
9858
|
-
};
|
|
9859
|
-
const FormsView = ({
|
|
9860
|
-
children
|
|
9861
|
-
}) => {
|
|
9862
|
-
const cms = useCMS$1();
|
|
9863
|
-
const { setFormIsPristine } = React__namespace.useContext(SidebarContext);
|
|
9864
|
-
const isMultiform = cms.state.forms.length > 1;
|
|
9865
|
-
const activeForm = cms.state.forms.find(
|
|
9866
|
-
({ tinaForm }) => tinaForm.id === cms.state.activeFormId
|
|
9867
|
-
);
|
|
9868
|
-
const isEditing = !!activeForm;
|
|
9869
|
-
if (!cms.state.formLists.length) {
|
|
9870
|
-
return /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, " ", children, " ");
|
|
9871
|
-
}
|
|
9872
|
-
if (isMultiform && !activeForm) {
|
|
9873
|
-
return /* @__PURE__ */ React__namespace.createElement(FormLists, { isEditing });
|
|
9874
|
-
}
|
|
9875
|
-
const formMetas = cms.plugins.all("form:meta");
|
|
9876
|
-
return /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, activeForm && /* @__PURE__ */ React__namespace.createElement(FormWrapper$1, { isEditing, isMultiform }, isMultiform && /* @__PURE__ */ React__namespace.createElement(MultiformFormHeader, { activeForm }), !isMultiform && /* @__PURE__ */ React__namespace.createElement(FormHeader, { activeForm }), formMetas == null ? void 0 : formMetas.map((meta) => /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, { key: meta.name }, /* @__PURE__ */ React__namespace.createElement(meta.Component, null))), /* @__PURE__ */ React__namespace.createElement(FormBuilder, { form: activeForm, onPristineChange: setFormIsPristine })));
|
|
9877
|
-
};
|
|
9878
|
-
const FormWrapper$1 = ({ isEditing, children }) => {
|
|
9879
|
-
return /* @__PURE__ */ React__namespace.createElement(
|
|
9880
|
-
"div",
|
|
9881
|
-
{
|
|
9882
|
-
className: "flex-1 flex flex-col flex-nowrap overflow-hidden h-full w-full relative bg-white",
|
|
9883
|
-
style: isEditing ? {
|
|
9884
|
-
transform: "none",
|
|
9885
|
-
animationName: "fly-in-left",
|
|
9886
|
-
animationDuration: "150ms",
|
|
9887
|
-
animationDelay: "0",
|
|
9888
|
-
animationIterationCount: 1,
|
|
9889
|
-
animationTimingFunction: "ease-out"
|
|
9890
|
-
} : {
|
|
9891
|
-
transform: "translate3d(100%, 0, 0)"
|
|
9892
|
-
}
|
|
9893
|
-
},
|
|
9894
|
-
children
|
|
9895
|
-
);
|
|
9896
|
-
};
|
|
9897
|
-
const MultiformFormHeader = ({
|
|
9898
|
-
activeForm
|
|
9899
|
-
}) => {
|
|
9900
|
-
const cms = useCMS$1();
|
|
9901
|
-
const { formIsPristine } = React__namespace.useContext(SidebarContext);
|
|
9902
|
-
return /* @__PURE__ */ React__namespace.createElement(
|
|
9903
|
-
"div",
|
|
9904
|
-
{
|
|
9905
|
-
className: "pt-18 pb-4 px-6 border-b border-gray-200 bg-gradient-to-t from-white to-gray-50"
|
|
9906
|
-
},
|
|
9907
|
-
/* @__PURE__ */ React__namespace.createElement("div", { className: "max-w-form mx-auto flex gap-2 justify-between items-center" }, /* @__PURE__ */ React__namespace.createElement(
|
|
9908
|
-
"button",
|
|
9909
|
-
{
|
|
9910
|
-
type: "button",
|
|
9911
|
-
className: "pointer-events-auto text-xs text-blue-400 hover:text-blue-500 hover:underline transition-all ease-out duration-150",
|
|
9912
|
-
onClick: () => {
|
|
9913
|
-
const state = activeForm.tinaForm.finalForm.getState();
|
|
9914
|
-
if (state.invalid === true) {
|
|
9915
|
-
cms.alerts.error("Cannot navigate away from an invalid form.");
|
|
9916
|
-
} else {
|
|
9917
|
-
cms.dispatch({ type: "forms:set-active-form-id", value: null });
|
|
9918
|
-
}
|
|
9919
|
-
}
|
|
9920
|
-
},
|
|
9921
|
-
/* @__PURE__ */ React__namespace.createElement(BiDotsVertical, { className: "h-auto w-5 inline-block opacity-70" })
|
|
9922
|
-
), /* @__PURE__ */ React__namespace.createElement(
|
|
9923
|
-
"button",
|
|
9924
|
-
{
|
|
9925
|
-
type: "button",
|
|
9926
|
-
className: "pointer-events-auto text-xs text-blue-400 hover:text-blue-500 hover:underline transition-all ease-out duration-150",
|
|
9927
|
-
onClick: () => {
|
|
9928
|
-
const collectionName = cms.api.tina.schema.getCollectionByFullPath(
|
|
9929
|
-
cms.state.activeFormId
|
|
9930
|
-
).name;
|
|
9931
|
-
window.location.href = `${new URL(window.location.href).pathname}#/collections/${collectionName}/~`;
|
|
9932
|
-
}
|
|
9933
|
-
},
|
|
9934
|
-
/* @__PURE__ */ React__namespace.createElement(BiHomeAlt, { className: "h-auto w-5 inline-block opacity-70" })
|
|
9935
|
-
), /* @__PURE__ */ React__namespace.createElement("span", { className: "opacity-30 text-sm leading-tight whitespace-nowrap flex-0" }, "/"), /* @__PURE__ */ React__namespace.createElement("span", { className: "block w-full text-sm leading-tight whitespace-nowrap truncate" }, activeForm.tinaForm.label || activeForm.tinaForm.id), /* @__PURE__ */ React__namespace.createElement(FormStatus, { pristine: formIsPristine }))
|
|
9936
|
-
);
|
|
9937
|
-
};
|
|
9938
|
-
const FormHeader = ({ activeForm }) => {
|
|
9939
|
-
const { formIsPristine } = React__namespace.useContext(SidebarContext);
|
|
9940
|
-
const cms = useCMS$1();
|
|
9941
|
-
const shortFormLabel = activeForm.tinaForm.label ? activeForm.tinaForm.label.replace(/^.*[\\\/]/, "") : false;
|
|
9942
|
-
return /* @__PURE__ */ React__namespace.createElement(
|
|
9943
|
-
"div",
|
|
9944
|
-
{
|
|
9945
|
-
className: "pt-18 pb-4 px-6 border-b border-gray-200 bg-gradient-to-t from-white to-gray-50"
|
|
9946
|
-
},
|
|
9947
|
-
/* @__PURE__ */ React__namespace.createElement("div", { className: "max-w-form mx-auto flex gap-2 justify-between items-center" }, /* @__PURE__ */ React__namespace.createElement(
|
|
9948
|
-
"button",
|
|
9949
|
-
{
|
|
9950
|
-
type: "button",
|
|
9951
|
-
className: "pointer-events-auto text-xs text-blue-400 hover:text-blue-500 hover:underline transition-all ease-out duration-150",
|
|
9952
|
-
onClick: () => {
|
|
9953
|
-
const collectionName = cms.api.tina.schema.getCollectionByFullPath(
|
|
9954
|
-
cms.state.activeFormId
|
|
9955
|
-
).name;
|
|
9956
|
-
window.location.href = `${new URL(window.location.href).pathname}#/collections/${collectionName}/~`;
|
|
9957
|
-
}
|
|
9958
|
-
},
|
|
9959
|
-
/* @__PURE__ */ React__namespace.createElement(BiHomeAlt, { className: "h-auto w-5 inline-block opacity-70" })
|
|
9960
|
-
), shortFormLabel && /* @__PURE__ */ React__namespace.createElement("span", { className: "block w-full text-sm leading-tight whitespace-nowrap truncate" }, shortFormLabel), /* @__PURE__ */ React__namespace.createElement(FormStatus, { pristine: formIsPristine }))
|
|
9961
|
-
);
|
|
9962
|
-
};
|
|
9963
9714
|
function ImFilesEmpty(props) {
|
|
9964
9715
|
return GenIcon({ "tag": "svg", "attr": { "version": "1.1", "viewBox": "0 0 16 16" }, "child": [{ "tag": "path", "attr": { "d": "M14.341 5.579c-0.347-0.473-0.831-1.027-1.362-1.558s-1.085-1.015-1.558-1.362c-0.806-0.591-1.197-0.659-1.421-0.659h-5.75c-0.689 0-1.25 0.561-1.25 1.25v11.5c0 0.689 0.561 1.25 1.25 1.25h9.5c0.689 0 1.25-0.561 1.25-1.25v-7.75c0-0.224-0.068-0.615-0.659-1.421zM12.271 4.729c0.48 0.48 0.856 0.912 1.134 1.271h-2.406v-2.405c0.359 0.278 0.792 0.654 1.271 1.134v0zM14 14.75c0 0.136-0.114 0.25-0.25 0.25h-9.5c-0.136 0-0.25-0.114-0.25-0.25v-11.5c0-0.135 0.114-0.25 0.25-0.25 0 0 5.749-0 5.75 0v3.5c0 0.276 0.224 0.5 0.5 0.5h3.5v7.75z" }, "child": [] }, { "tag": "path", "attr": { "d": "M9.421 0.659c-0.806-0.591-1.197-0.659-1.421-0.659h-5.75c-0.689 0-1.25 0.561-1.25 1.25v11.5c0 0.604 0.43 1.109 1 1.225v-12.725c0-0.135 0.115-0.25 0.25-0.25h7.607c-0.151-0.124-0.297-0.238-0.437-0.341z" }, "child": [] }] })(props);
|
|
9965
9716
|
}
|
|
@@ -10202,7 +9953,7 @@ flowchart TD
|
|
|
10202
9953
|
"Event Log"
|
|
10203
9954
|
));
|
|
10204
9955
|
};
|
|
10205
|
-
const version = "2.7.
|
|
9956
|
+
const version = "2.7.5";
|
|
10206
9957
|
const Nav = ({
|
|
10207
9958
|
isLocalMode,
|
|
10208
9959
|
className = "",
|
|
@@ -10444,6 +10195,293 @@ flowchart TD
|
|
|
10444
10195
|
/* @__PURE__ */ React__namespace.createElement("span", { className: "absolute top-1/2 left-1/2 h-4/6 w-px bg-gray-200 transform -translate-y-1/2 -translate-x-1/2 opacity-30 transition-opacity duration-150 ease-out group-hover:opacity-100" })
|
|
10445
10196
|
);
|
|
10446
10197
|
};
|
|
10198
|
+
const Item = ({
|
|
10199
|
+
item,
|
|
10200
|
+
depth,
|
|
10201
|
+
setActiveFormId
|
|
10202
|
+
}) => {
|
|
10203
|
+
const cms = useCMS();
|
|
10204
|
+
const depths = ["pl-6", "pl-10", "pl-14"];
|
|
10205
|
+
const form = React__namespace.useMemo(
|
|
10206
|
+
() => cms.state.forms.find(({ tinaForm }) => item.formId === tinaForm.id),
|
|
10207
|
+
[item.formId]
|
|
10208
|
+
);
|
|
10209
|
+
return /* @__PURE__ */ React__namespace.createElement(
|
|
10210
|
+
"button",
|
|
10211
|
+
{
|
|
10212
|
+
type: "button",
|
|
10213
|
+
key: item.path,
|
|
10214
|
+
onClick: () => setActiveFormId(item.formId),
|
|
10215
|
+
className: `${depths[depth] || "pl-12"} pr-6 py-3 w-full h-full bg-transparent border-none text-lg text-gray-700 group hover:bg-gray-50 transition-all ease-out duration-150 flex items-center justify-between gap-2`
|
|
10216
|
+
},
|
|
10217
|
+
/* @__PURE__ */ React__namespace.createElement(BiEdit, { className: "opacity-70 w-5 h-auto text-blue-500 flex-none" }),
|
|
10218
|
+
/* @__PURE__ */ React__namespace.createElement("div", { className: "flex-1 flex flex-col gap-0.5 items-start" }, /* @__PURE__ */ React__namespace.createElement("div", { className: "group-hover:text-blue-500 font-sans text-xs font-semibold text-gray-700 whitespace-normal" }, form.tinaForm.label), /* @__PURE__ */ React__namespace.createElement("div", { className: "group-hover:text-blue-500 text-base truncate leading-tight text-gray-600" }, form.tinaForm.id))
|
|
10219
|
+
);
|
|
10220
|
+
};
|
|
10221
|
+
const FormListItem = ({
|
|
10222
|
+
item,
|
|
10223
|
+
depth,
|
|
10224
|
+
setActiveFormId
|
|
10225
|
+
}) => {
|
|
10226
|
+
var _a;
|
|
10227
|
+
return /* @__PURE__ */ React__namespace.createElement("div", { className: "divide-y divide-gray-200" }, /* @__PURE__ */ React__namespace.createElement(Item, { setActiveFormId, item, depth }), item.subItems && /* @__PURE__ */ React__namespace.createElement("ul", { className: "divide-y divide-gray-200" }, (_a = item.subItems) == null ? void 0 : _a.map((subItem) => {
|
|
10228
|
+
if (subItem.type === "document") {
|
|
10229
|
+
return /* @__PURE__ */ React__namespace.createElement("li", { key: subItem.formId }, /* @__PURE__ */ React__namespace.createElement(
|
|
10230
|
+
Item,
|
|
10231
|
+
{
|
|
10232
|
+
setActiveFormId,
|
|
10233
|
+
depth: depth + 1,
|
|
10234
|
+
item: subItem
|
|
10235
|
+
}
|
|
10236
|
+
));
|
|
10237
|
+
}
|
|
10238
|
+
})));
|
|
10239
|
+
};
|
|
10240
|
+
const FormLists = (props) => {
|
|
10241
|
+
const cms = useCMS();
|
|
10242
|
+
return /* @__PURE__ */ React__namespace.createElement(
|
|
10243
|
+
react.Transition,
|
|
10244
|
+
{
|
|
10245
|
+
appear: true,
|
|
10246
|
+
show: true,
|
|
10247
|
+
as: "div",
|
|
10248
|
+
enter: "transition-all ease-out duration-150",
|
|
10249
|
+
enterFrom: "opacity-0 -translate-x-1/2",
|
|
10250
|
+
enterTo: "opacity-100",
|
|
10251
|
+
leave: "transition-all ease-out duration-150",
|
|
10252
|
+
leaveFrom: "opacity-100",
|
|
10253
|
+
leaveTo: "opacity-0 -translate-x-1/2"
|
|
10254
|
+
},
|
|
10255
|
+
cms.state.formLists.map((formList, index) => /* @__PURE__ */ React__namespace.createElement("div", { key: `${formList.id}-${index}`, className: "pt-16" }, /* @__PURE__ */ React__namespace.createElement(
|
|
10256
|
+
FormList,
|
|
10257
|
+
{
|
|
10258
|
+
isEditing: props.isEditing,
|
|
10259
|
+
setActiveFormId: (id) => {
|
|
10260
|
+
cms.dispatch({ type: "forms:set-active-form-id", value: id });
|
|
10261
|
+
},
|
|
10262
|
+
formList
|
|
10263
|
+
}
|
|
10264
|
+
)))
|
|
10265
|
+
);
|
|
10266
|
+
};
|
|
10267
|
+
const FormList = (props) => {
|
|
10268
|
+
const cms = useCMS();
|
|
10269
|
+
const listItems = React__namespace.useMemo(() => {
|
|
10270
|
+
var _a;
|
|
10271
|
+
const orderedListItems = [];
|
|
10272
|
+
const globalItems = [];
|
|
10273
|
+
const topItems = [];
|
|
10274
|
+
props.formList.items.forEach((item) => {
|
|
10275
|
+
if (item.type === "document") {
|
|
10276
|
+
const form = cms.state.forms.find(
|
|
10277
|
+
({ tinaForm }) => tinaForm.id === item.formId
|
|
10278
|
+
);
|
|
10279
|
+
if (form.tinaForm.global) {
|
|
10280
|
+
globalItems.push(item);
|
|
10281
|
+
} else {
|
|
10282
|
+
orderedListItems.push(item);
|
|
10283
|
+
}
|
|
10284
|
+
} else {
|
|
10285
|
+
orderedListItems.push(item);
|
|
10286
|
+
}
|
|
10287
|
+
});
|
|
10288
|
+
if (((_a = orderedListItems[0]) == null ? void 0 : _a.type) === "document") {
|
|
10289
|
+
topItems.push({ type: "list", label: "Documents" });
|
|
10290
|
+
}
|
|
10291
|
+
let extra = [];
|
|
10292
|
+
if (globalItems.length) {
|
|
10293
|
+
extra = [{ type: "list", label: "Global Documents" }, ...globalItems];
|
|
10294
|
+
}
|
|
10295
|
+
return [...topItems, ...orderedListItems, ...extra];
|
|
10296
|
+
}, [JSON.stringify(props.formList.items)]);
|
|
10297
|
+
return /* @__PURE__ */ React__namespace.createElement("ul", null, /* @__PURE__ */ React__namespace.createElement("li", { className: "divide-y divide-gray-200" }, listItems.map((item, index) => {
|
|
10298
|
+
if (item.type === "list") {
|
|
10299
|
+
return /* @__PURE__ */ React__namespace.createElement(
|
|
10300
|
+
"div",
|
|
10301
|
+
{
|
|
10302
|
+
key: item.label,
|
|
10303
|
+
className: `relative group text-left w-full bg-white shadow-sm
|
|
10304
|
+
border-gray-100 px-6 -mt-px pb-3 ${index > 0 ? "pt-6 bg-gradient-to-b from-gray-50 via-white to-white" : "pt-3"}`
|
|
10305
|
+
},
|
|
10306
|
+
/* @__PURE__ */ React__namespace.createElement(
|
|
10307
|
+
"span",
|
|
10308
|
+
{
|
|
10309
|
+
className: "text-sm tracking-wide font-bold text-gray-700 uppercase"
|
|
10310
|
+
},
|
|
10311
|
+
item.label
|
|
10312
|
+
)
|
|
10313
|
+
);
|
|
10314
|
+
}
|
|
10315
|
+
return /* @__PURE__ */ React__namespace.createElement(
|
|
10316
|
+
FormListItem,
|
|
10317
|
+
{
|
|
10318
|
+
setActiveFormId: (id) => props.setActiveFormId(id),
|
|
10319
|
+
key: item.formId,
|
|
10320
|
+
item,
|
|
10321
|
+
depth: 0
|
|
10322
|
+
}
|
|
10323
|
+
);
|
|
10324
|
+
})));
|
|
10325
|
+
};
|
|
10326
|
+
const SidebarNoFormsPlaceholder = () => /* @__PURE__ */ React__namespace.createElement(
|
|
10327
|
+
"div",
|
|
10328
|
+
{
|
|
10329
|
+
className: "relative flex flex-col items-center justify-center text-center p-5 pb-16 w-full h-full overflow-y-auto",
|
|
10330
|
+
style: {
|
|
10331
|
+
animationName: "fade-in",
|
|
10332
|
+
animationDelay: "300ms",
|
|
10333
|
+
animationTimingFunction: "ease-out",
|
|
10334
|
+
animationIterationCount: 1,
|
|
10335
|
+
animationFillMode: "both",
|
|
10336
|
+
animationDuration: "150ms"
|
|
10337
|
+
}
|
|
10338
|
+
},
|
|
10339
|
+
/* @__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."),
|
|
10340
|
+
/* @__PURE__ */ React__namespace.createElement("p", { className: "block pt-5" }, /* @__PURE__ */ React__namespace.createElement(
|
|
10341
|
+
Button$1,
|
|
10342
|
+
{
|
|
10343
|
+
href: "https://tina.io/docs/contextual-editing/overview",
|
|
10344
|
+
target: "_blank",
|
|
10345
|
+
as: "a"
|
|
10346
|
+
},
|
|
10347
|
+
/* @__PURE__ */ React__namespace.createElement(Emoji$1, { className: "mr-1.5" }, "📖"),
|
|
10348
|
+
" Contextual Editing Docs"
|
|
10349
|
+
))
|
|
10350
|
+
);
|
|
10351
|
+
const Emoji$1 = ({ className = "", ...props }) => /* @__PURE__ */ React__namespace.createElement(
|
|
10352
|
+
"span",
|
|
10353
|
+
{
|
|
10354
|
+
className: `text-[24px] leading-none inline-block ${className}`,
|
|
10355
|
+
...props
|
|
10356
|
+
}
|
|
10357
|
+
);
|
|
10358
|
+
const minimumTimeToShowLoadingIndicator = 1e3;
|
|
10359
|
+
const FormsView = ({ loadingPlaceholder } = {}) => {
|
|
10360
|
+
const cms = useCMS$1();
|
|
10361
|
+
const { setFormIsPristine } = React__namespace.useContext(SidebarContext);
|
|
10362
|
+
const [isShowingLoading, setIsShowingLoading] = React__namespace.useState(true);
|
|
10363
|
+
const [initialLoadComplete, setInitialLoadComplete] = React__namespace.useState(false);
|
|
10364
|
+
React__namespace.useEffect(() => {
|
|
10365
|
+
if (cms.state.isLoadingContent) {
|
|
10366
|
+
setIsShowingLoading(true);
|
|
10367
|
+
const timer = setTimeout(() => {
|
|
10368
|
+
if (!cms.state.isLoadingContent) {
|
|
10369
|
+
setIsShowingLoading(false);
|
|
10370
|
+
setInitialLoadComplete(true);
|
|
10371
|
+
}
|
|
10372
|
+
}, minimumTimeToShowLoadingIndicator);
|
|
10373
|
+
return () => clearTimeout(timer);
|
|
10374
|
+
} else {
|
|
10375
|
+
const timer = setTimeout(() => {
|
|
10376
|
+
setIsShowingLoading(false);
|
|
10377
|
+
setInitialLoadComplete(true);
|
|
10378
|
+
}, minimumTimeToShowLoadingIndicator);
|
|
10379
|
+
return () => clearTimeout(timer);
|
|
10380
|
+
}
|
|
10381
|
+
}, [cms.state.isLoadingContent]);
|
|
10382
|
+
if (isShowingLoading || !initialLoadComplete) {
|
|
10383
|
+
const LoadingPlaceholder = loadingPlaceholder || SidebarLoadingPlaceholder;
|
|
10384
|
+
return /* @__PURE__ */ React__namespace.createElement(LoadingPlaceholder, null);
|
|
10385
|
+
}
|
|
10386
|
+
if (!cms.state.formLists.length) {
|
|
10387
|
+
return /* @__PURE__ */ React__namespace.createElement(SidebarNoFormsPlaceholder, null);
|
|
10388
|
+
}
|
|
10389
|
+
const isMultiform = cms.state.forms.length > 1;
|
|
10390
|
+
const activeForm = cms.state.forms.find(
|
|
10391
|
+
({ tinaForm }) => tinaForm.id === cms.state.activeFormId
|
|
10392
|
+
);
|
|
10393
|
+
const isEditing = !!activeForm;
|
|
10394
|
+
if (isMultiform && !activeForm) {
|
|
10395
|
+
return /* @__PURE__ */ React__namespace.createElement(FormLists, { isEditing });
|
|
10396
|
+
}
|
|
10397
|
+
const formMetas = cms.plugins.all("form:meta");
|
|
10398
|
+
return /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, activeForm && /* @__PURE__ */ React__namespace.createElement(FormWrapper$1, { isEditing, isMultiform }, isMultiform && /* @__PURE__ */ React__namespace.createElement(MultiformFormHeader, { activeForm }), !isMultiform && /* @__PURE__ */ React__namespace.createElement(FormHeader, { activeForm }), formMetas == null ? void 0 : formMetas.map((meta) => /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, { key: meta.name }, /* @__PURE__ */ React__namespace.createElement(meta.Component, null))), /* @__PURE__ */ React__namespace.createElement(FormBuilder, { form: activeForm, onPristineChange: setFormIsPristine })));
|
|
10399
|
+
};
|
|
10400
|
+
const FormWrapper$1 = ({ isEditing, children }) => {
|
|
10401
|
+
return /* @__PURE__ */ React__namespace.createElement(
|
|
10402
|
+
"div",
|
|
10403
|
+
{
|
|
10404
|
+
className: "flex-1 flex flex-col flex-nowrap overflow-hidden h-full w-full relative bg-white",
|
|
10405
|
+
style: isEditing ? {
|
|
10406
|
+
transform: "none",
|
|
10407
|
+
animationName: "fly-in-left",
|
|
10408
|
+
animationDuration: "150ms",
|
|
10409
|
+
animationDelay: "0",
|
|
10410
|
+
animationIterationCount: 1,
|
|
10411
|
+
animationTimingFunction: "ease-out"
|
|
10412
|
+
} : {
|
|
10413
|
+
transform: "translate3d(100%, 0, 0)"
|
|
10414
|
+
}
|
|
10415
|
+
},
|
|
10416
|
+
children
|
|
10417
|
+
);
|
|
10418
|
+
};
|
|
10419
|
+
const MultiformFormHeader = ({
|
|
10420
|
+
activeForm
|
|
10421
|
+
}) => {
|
|
10422
|
+
const cms = useCMS$1();
|
|
10423
|
+
const { formIsPristine } = React__namespace.useContext(SidebarContext);
|
|
10424
|
+
return /* @__PURE__ */ React__namespace.createElement(
|
|
10425
|
+
"div",
|
|
10426
|
+
{
|
|
10427
|
+
className: "pt-18 pb-4 px-6 border-b border-gray-200 bg-gradient-to-t from-white to-gray-50"
|
|
10428
|
+
},
|
|
10429
|
+
/* @__PURE__ */ React__namespace.createElement("div", { className: "max-w-form mx-auto flex gap-2 justify-between items-center" }, /* @__PURE__ */ React__namespace.createElement(
|
|
10430
|
+
"button",
|
|
10431
|
+
{
|
|
10432
|
+
type: "button",
|
|
10433
|
+
className: "pointer-events-auto text-xs text-blue-400 hover:text-blue-500 hover:underline transition-all ease-out duration-150",
|
|
10434
|
+
onClick: () => {
|
|
10435
|
+
const state = activeForm.tinaForm.finalForm.getState();
|
|
10436
|
+
if (state.invalid === true) {
|
|
10437
|
+
cms.alerts.error("Cannot navigate away from an invalid form.");
|
|
10438
|
+
} else {
|
|
10439
|
+
cms.dispatch({ type: "forms:set-active-form-id", value: null });
|
|
10440
|
+
}
|
|
10441
|
+
}
|
|
10442
|
+
},
|
|
10443
|
+
/* @__PURE__ */ React__namespace.createElement(BiDotsVertical, { className: "h-auto w-5 inline-block opacity-70" })
|
|
10444
|
+
), /* @__PURE__ */ React__namespace.createElement(
|
|
10445
|
+
"button",
|
|
10446
|
+
{
|
|
10447
|
+
type: "button",
|
|
10448
|
+
className: "pointer-events-auto text-xs text-blue-400 hover:text-blue-500 hover:underline transition-all ease-out duration-150",
|
|
10449
|
+
onClick: () => {
|
|
10450
|
+
const collectionName = cms.api.tina.schema.getCollectionByFullPath(
|
|
10451
|
+
cms.state.activeFormId
|
|
10452
|
+
).name;
|
|
10453
|
+
window.location.href = `${new URL(window.location.href).pathname}#/collections/${collectionName}/~`;
|
|
10454
|
+
}
|
|
10455
|
+
},
|
|
10456
|
+
/* @__PURE__ */ React__namespace.createElement(BiHomeAlt, { className: "h-auto w-5 inline-block opacity-70" })
|
|
10457
|
+
), /* @__PURE__ */ React__namespace.createElement("span", { className: "opacity-30 text-sm leading-tight whitespace-nowrap flex-0" }, "/"), /* @__PURE__ */ React__namespace.createElement("span", { className: "block w-full text-sm leading-tight whitespace-nowrap truncate" }, activeForm.tinaForm.label || activeForm.tinaForm.id), /* @__PURE__ */ React__namespace.createElement(FormStatus, { pristine: formIsPristine }))
|
|
10458
|
+
);
|
|
10459
|
+
};
|
|
10460
|
+
const FormHeader = ({ activeForm }) => {
|
|
10461
|
+
const { formIsPristine } = React__namespace.useContext(SidebarContext);
|
|
10462
|
+
const cms = useCMS$1();
|
|
10463
|
+
const shortFormLabel = activeForm.tinaForm.label ? activeForm.tinaForm.label.replace(/^.*[\\\/]/, "") : false;
|
|
10464
|
+
return /* @__PURE__ */ React__namespace.createElement(
|
|
10465
|
+
"div",
|
|
10466
|
+
{
|
|
10467
|
+
className: "pt-18 pb-4 px-6 border-b border-gray-200 bg-gradient-to-t from-white to-gray-50"
|
|
10468
|
+
},
|
|
10469
|
+
/* @__PURE__ */ React__namespace.createElement("div", { className: "max-w-form mx-auto flex gap-2 justify-between items-center" }, /* @__PURE__ */ React__namespace.createElement(
|
|
10470
|
+
"button",
|
|
10471
|
+
{
|
|
10472
|
+
type: "button",
|
|
10473
|
+
className: "pointer-events-auto text-xs text-blue-400 hover:text-blue-500 hover:underline transition-all ease-out duration-150",
|
|
10474
|
+
onClick: () => {
|
|
10475
|
+
const collectionName = cms.api.tina.schema.getCollectionByFullPath(
|
|
10476
|
+
cms.state.activeFormId
|
|
10477
|
+
).name;
|
|
10478
|
+
window.location.href = `${new URL(window.location.href).pathname}#/collections/${collectionName}/~`;
|
|
10479
|
+
}
|
|
10480
|
+
},
|
|
10481
|
+
/* @__PURE__ */ React__namespace.createElement(BiHomeAlt, { className: "h-auto w-5 inline-block opacity-70" })
|
|
10482
|
+
), shortFormLabel && /* @__PURE__ */ React__namespace.createElement("span", { className: "block w-full text-sm leading-tight whitespace-nowrap truncate" }, shortFormLabel), /* @__PURE__ */ React__namespace.createElement(FormStatus, { pristine: formIsPristine }))
|
|
10483
|
+
);
|
|
10484
|
+
};
|
|
10447
10485
|
const SidebarContext = React__namespace.createContext(null);
|
|
10448
10486
|
const minPreviewWidth = 440;
|
|
10449
10487
|
const minSidebarWidth = 360;
|
|
@@ -10662,7 +10700,7 @@ flowchart TD
|
|
|
10662
10700
|
isLocalMode: (_d = (_c = cms.api) == null ? void 0 : _c.tina) == null ? void 0 : _d.isLocalMode,
|
|
10663
10701
|
branchingEnabled
|
|
10664
10702
|
}
|
|
10665
|
-
), /* @__PURE__ */ React__namespace.createElement(FormsView,
|
|
10703
|
+
), /* @__PURE__ */ React__namespace.createElement(FormsView, { loadingPlaceholder: sidebar.loadingPlaceholder }), activeScreen && /* @__PURE__ */ React__namespace.createElement(
|
|
10666
10704
|
ScreenPluginModal,
|
|
10667
10705
|
{
|
|
10668
10706
|
screen: activeScreen,
|
|
@@ -10978,6 +11016,93 @@ flowchart TD
|
|
|
10978
11016
|
);
|
|
10979
11017
|
};
|
|
10980
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
|
+
};
|
|
10981
11106
|
function ListMediaItem({ item, onClick, active }) {
|
|
10982
11107
|
let FileIcon = BiFile;
|
|
10983
11108
|
if (item.type === "dir") {
|
|
@@ -11053,59 +11178,6 @@ flowchart TD
|
|
|
11053
11178
|
)
|
|
11054
11179
|
);
|
|
11055
11180
|
}
|
|
11056
|
-
function dirname(path) {
|
|
11057
|
-
var _a, _b;
|
|
11058
|
-
const pattern = new RegExp("(?<prevDir>.*)/");
|
|
11059
|
-
return (_b = (_a = path.match(pattern)) == null ? void 0 : _a.groups) == null ? void 0 : _b.prevDir;
|
|
11060
|
-
}
|
|
11061
|
-
const BreadcrumbButton = ({ className = "", ...props }) => /* @__PURE__ */ React.createElement(
|
|
11062
|
-
"button",
|
|
11063
|
-
{
|
|
11064
|
-
className: "capitalize transition-colors duration-150 border-0 bg-transparent hover:text-blue-500 " + className,
|
|
11065
|
-
...props
|
|
11066
|
-
}
|
|
11067
|
-
);
|
|
11068
|
-
function Breadcrumb$1({ directory = "", setDirectory }) {
|
|
11069
|
-
directory = directory.replace(/^\/|\/$/g, "");
|
|
11070
|
-
let prevDir = dirname(directory) || "";
|
|
11071
|
-
if (prevDir === ".") {
|
|
11072
|
-
prevDir = "";
|
|
11073
|
-
}
|
|
11074
|
-
return /* @__PURE__ */ React.createElement("div", { className: "w-full flex items-center text-[16px] text-gray-300" }, directory !== "" && /* @__PURE__ */ React.createElement(
|
|
11075
|
-
IconButton,
|
|
11076
|
-
{
|
|
11077
|
-
variant: "ghost",
|
|
11078
|
-
className: "mr-2",
|
|
11079
|
-
onClick: () => setDirectory(prevDir)
|
|
11080
|
-
},
|
|
11081
|
-
/* @__PURE__ */ React.createElement(
|
|
11082
|
-
LeftArrowIcon,
|
|
11083
|
-
{
|
|
11084
|
-
className: `w-7 h-auto fill-gray-300 hover:fill-gray-900 transition duration-150 ease-out`
|
|
11085
|
-
}
|
|
11086
|
-
)
|
|
11087
|
-
), /* @__PURE__ */ React.createElement(
|
|
11088
|
-
BreadcrumbButton,
|
|
11089
|
-
{
|
|
11090
|
-
onClick: () => setDirectory(""),
|
|
11091
|
-
className: directory === "" ? "text-gray-500 font-bold" : "text-gray-300 font-medium after:pl-1.5 after:content-['/']"
|
|
11092
|
-
},
|
|
11093
|
-
"Media"
|
|
11094
|
-
), directory && directory.split("/").map((part, index, parts) => {
|
|
11095
|
-
const currentDir = parts.slice(0, index + 1).join("/");
|
|
11096
|
-
return /* @__PURE__ */ React.createElement(
|
|
11097
|
-
BreadcrumbButton,
|
|
11098
|
-
{
|
|
11099
|
-
className: "pl-1.5 " + (index + 1 === parts.length ? "text-gray-500 font-bold" : "text-gray-300 font-medium after:pl-1.5 after:content-['/']"),
|
|
11100
|
-
key: currentDir,
|
|
11101
|
-
onClick: () => {
|
|
11102
|
-
setDirectory(currentDir);
|
|
11103
|
-
}
|
|
11104
|
-
},
|
|
11105
|
-
part
|
|
11106
|
-
);
|
|
11107
|
-
}));
|
|
11108
|
-
}
|
|
11109
11181
|
const DeleteModal$1 = ({
|
|
11110
11182
|
close: close2,
|
|
11111
11183
|
deleteFunc,
|
|
@@ -11159,40 +11231,6 @@ flowchart TD
|
|
|
11159
11231
|
"Create New Folder"
|
|
11160
11232
|
))));
|
|
11161
11233
|
};
|
|
11162
|
-
const CopyField = ({ label, description, value }) => {
|
|
11163
|
-
const [copied, setCopied] = React.useState(false);
|
|
11164
|
-
const [fadeOut, setFadeOut] = React.useState(false);
|
|
11165
|
-
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(
|
|
11166
|
-
"span",
|
|
11167
|
-
{
|
|
11168
|
-
onClick: () => {
|
|
11169
|
-
if (copied === true)
|
|
11170
|
-
return;
|
|
11171
|
-
setCopied(true);
|
|
11172
|
-
setTimeout(() => {
|
|
11173
|
-
setFadeOut(true);
|
|
11174
|
-
}, 2500);
|
|
11175
|
-
setTimeout(() => {
|
|
11176
|
-
setCopied(false);
|
|
11177
|
-
setFadeOut(false);
|
|
11178
|
-
}, 3e3);
|
|
11179
|
-
navigator.clipboard.writeText(value);
|
|
11180
|
-
},
|
|
11181
|
-
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` : ``}`
|
|
11182
|
-
},
|
|
11183
|
-
/* @__PURE__ */ React.createElement(BiCopyAlt, { className: "relative text-blue-500 shrink-0 w-5 h-auto mr-1.5 -ml-0.5 z-20" }),
|
|
11184
|
-
" ",
|
|
11185
|
-
value,
|
|
11186
|
-
" ",
|
|
11187
|
-
copied && /* @__PURE__ */ React.createElement(
|
|
11188
|
-
"span",
|
|
11189
|
-
{
|
|
11190
|
-
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`
|
|
11191
|
-
},
|
|
11192
|
-
/* @__PURE__ */ React.createElement("span", null, "Copied to clipboard!")
|
|
11193
|
-
)
|
|
11194
|
-
), description && /* @__PURE__ */ React.createElement("p", { className: "mt-2 text-sm text-gray-500" }, description));
|
|
11195
|
-
};
|
|
11196
11234
|
const { useDropzone } = dropzone__namespace;
|
|
11197
11235
|
const join = function(...parts) {
|
|
11198
11236
|
const [first, last, slash] = [0, parts.length - 1, "/"];
|
|
@@ -11694,7 +11732,7 @@ flowchart TD
|
|
|
11694
11732
|
target: "_blank",
|
|
11695
11733
|
href: `${cms.api.tina.appDashboardLink}/media`
|
|
11696
11734
|
},
|
|
11697
|
-
"Sync Your Media In
|
|
11735
|
+
"Sync Your Media In TinaCloud.",
|
|
11698
11736
|
/* @__PURE__ */ React.createElement(BiLinkExternal, { className: `w-5 h-auto flex-shrink-0` })
|
|
11699
11737
|
)
|
|
11700
11738
|
)))) : /* @__PURE__ */ React.createElement(SyncStatusContext.Provider, { value: { syncStatus } }, children);
|
|
@@ -12026,6 +12064,7 @@ flowchart TD
|
|
|
12026
12064
|
forms: [],
|
|
12027
12065
|
formLists: [],
|
|
12028
12066
|
editingMode: "basic",
|
|
12067
|
+
isLoadingContent: false,
|
|
12029
12068
|
quickEditSupported: false,
|
|
12030
12069
|
sidebarDisplayState: ((_a = cms == null ? void 0 : cms.sidebar) == null ? void 0 : _a.defaultState) || "open"
|
|
12031
12070
|
};
|
|
@@ -12085,7 +12124,12 @@ flowchart TD
|
|
|
12085
12124
|
}
|
|
12086
12125
|
});
|
|
12087
12126
|
}
|
|
12088
|
-
return {
|
|
12127
|
+
return {
|
|
12128
|
+
...state,
|
|
12129
|
+
activeFormId,
|
|
12130
|
+
formLists: nextFormLists,
|
|
12131
|
+
isLoadingContent: false
|
|
12132
|
+
};
|
|
12089
12133
|
}
|
|
12090
12134
|
case "form-lists:remove": {
|
|
12091
12135
|
const nextFormLists = state.formLists.filter(
|
|
@@ -12154,6 +12198,9 @@ flowchart TD
|
|
|
12154
12198
|
}
|
|
12155
12199
|
return { ...state, sidebarDisplayState: action.value };
|
|
12156
12200
|
}
|
|
12201
|
+
case "sidebar:set-loading-state": {
|
|
12202
|
+
return { ...state, isLoadingContent: action.value };
|
|
12203
|
+
}
|
|
12157
12204
|
default:
|
|
12158
12205
|
throw new Error(`Unhandled action ${action.type}`);
|
|
12159
12206
|
}
|
|
@@ -12839,7 +12886,6 @@ flowchart TD
|
|
|
12839
12886
|
}) => {
|
|
12840
12887
|
const cms = useCMS$1();
|
|
12841
12888
|
const tinaApi = cms.api.tina;
|
|
12842
|
-
tinaApi.branch;
|
|
12843
12889
|
const [disabled, setDisabled] = React__namespace.useState(false);
|
|
12844
12890
|
const [newBranchName, setNewBranchName] = React__namespace.useState("");
|
|
12845
12891
|
const [error, setError] = React__namespace.useState("");
|
|
@@ -12865,10 +12911,10 @@ flowchart TD
|
|
|
12865
12911
|
const newUrl = window.location.href.replace(hash, newHash);
|
|
12866
12912
|
window.location.href = newUrl;
|
|
12867
12913
|
};
|
|
12868
|
-
return /* @__PURE__ */ React__namespace.createElement(Modal, null, /* @__PURE__ */ React__namespace.createElement(PopupModal, null, /* @__PURE__ */ React__namespace.createElement(ModalHeader, { close: close2 }, /* @__PURE__ */ React__namespace.createElement(BiGitBranch, { className: "w-6 h-auto mr-1 text-blue-500 opacity-70" }), " ", "Create Branch"), /* @__PURE__ */ React__namespace.createElement(ModalBody, { padded: true }, /* @__PURE__ */ React__namespace.createElement("p", { className: "text-
|
|
12914
|
+
return /* @__PURE__ */ React__namespace.createElement(Modal, null, /* @__PURE__ */ React__namespace.createElement(PopupModal, null, /* @__PURE__ */ React__namespace.createElement(ModalHeader, { close: close2 }, /* @__PURE__ */ React__namespace.createElement(BiGitBranch, { className: "w-6 h-auto mr-1 text-blue-500 opacity-70" }), " ", "Create Branch"), /* @__PURE__ */ React__namespace.createElement(ModalBody, { padded: true }, /* @__PURE__ */ React__namespace.createElement("p", { className: "text-lg text-gray-700 font-bold mb-2" }, "This content is protected 🚧"), /* @__PURE__ */ React__namespace.createElement("p", { className: "text-sm text-gray-700 mb-4" }, "To make changes, you need to create a copy then get it approved and merged for it to go live."), /* @__PURE__ */ React__namespace.createElement(
|
|
12869
12915
|
PrefixedTextField,
|
|
12870
12916
|
{
|
|
12871
|
-
placeholder: "
|
|
12917
|
+
placeholder: "e.g. {{PAGE-NAME}}-updates",
|
|
12872
12918
|
value: newBranchName,
|
|
12873
12919
|
onChange: (e) => {
|
|
12874
12920
|
setError("");
|
|
@@ -30623,6 +30669,7 @@ mutation addPendingDocumentMutation(
|
|
|
30623
30669
|
setBranch(branchName) {
|
|
30624
30670
|
var _a, _b, _c, _d;
|
|
30625
30671
|
const encodedBranch = encodeURIComponent(branchName);
|
|
30672
|
+
document.cookie = `x-branch=${encodedBranch}; path=/; max-age=3600`;
|
|
30626
30673
|
this.branch = encodedBranch;
|
|
30627
30674
|
this.assetsApiUrl = ((_a = this.options.tinaioConfig) == null ? void 0 : _a.assetsApiUrlOverride) || "https://assets.tinajs.io";
|
|
30628
30675
|
this.frontendUrl = ((_b = this.options.tinaioConfig) == null ? void 0 : _b.frontendUrlOverride) || "https://app.tina.io";
|
|
@@ -30665,7 +30712,7 @@ mutation addPendingDocumentMutation(
|
|
|
30665
30712
|
branch: ${this.branch}.`;
|
|
30666
30713
|
if (this.branch !== "main") {
|
|
30667
30714
|
errorMessage = `${errorMessage}
|
|
30668
|
-
Note: This error can occur if the branch does not exist on GitHub or on
|
|
30715
|
+
Note: This error can occur if the branch does not exist on GitHub or on TinaCloud`;
|
|
30669
30716
|
}
|
|
30670
30717
|
}
|
|
30671
30718
|
throw new Error(errorMessage);
|
|
@@ -30801,7 +30848,7 @@ mutation addPendingDocumentMutation(
|
|
|
30801
30848
|
unknownCount++;
|
|
30802
30849
|
if (unknownCount > 5) {
|
|
30803
30850
|
throw new Error(
|
|
30804
|
-
"AsyncPoller: status unknown for too long, please check indexing progress the
|
|
30851
|
+
"AsyncPoller: status unknown for too long, please check indexing progress the TinaCloud dashboard"
|
|
30805
30852
|
);
|
|
30806
30853
|
}
|
|
30807
30854
|
}
|
|
@@ -31512,7 +31559,7 @@ mutation addPendingDocumentMutation(
|
|
|
31512
31559
|
});
|
|
31513
31560
|
}
|
|
31514
31561
|
};
|
|
31515
|
-
let modalTitle = "
|
|
31562
|
+
let modalTitle = "TinaCloud";
|
|
31516
31563
|
if (activeModal === "authenticate" && loginStrategy === "Redirect" && !isTinaCloud) {
|
|
31517
31564
|
modalTitle = "Enter into edit mode";
|
|
31518
31565
|
} else if (activeModal === "authenticate" && loginStrategy === "UsernamePassword") {
|
|
@@ -31528,7 +31575,7 @@ mutation addPendingDocumentMutation(
|
|
|
31528
31575
|
ModalBuilder,
|
|
31529
31576
|
{
|
|
31530
31577
|
title: modalTitle,
|
|
31531
|
-
message: isTinaCloud ? "Your site uses
|
|
31578
|
+
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.",
|
|
31532
31579
|
close,
|
|
31533
31580
|
actions: [
|
|
31534
31581
|
...otherModalActions,
|
|
@@ -32251,6 +32298,14 @@ This will work when developing locally but NOT when deployed to production.
|
|
|
32251
32298
|
}
|
|
32252
32299
|
return client.request(query, { variables });
|
|
32253
32300
|
};
|
|
32301
|
+
const GetCMS = ({ children }) => {
|
|
32302
|
+
try {
|
|
32303
|
+
const cms = useCMS$1();
|
|
32304
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, children(cms));
|
|
32305
|
+
} catch (e) {
|
|
32306
|
+
return null;
|
|
32307
|
+
}
|
|
32308
|
+
};
|
|
32254
32309
|
const Layout = ({ children }) => {
|
|
32255
32310
|
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
32256
32311
|
"div",
|
|
@@ -32462,14 +32517,118 @@ This will work when developing locally but NOT when deployed to production.
|
|
|
32462
32517
|
}
|
|
32463
32518
|
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));
|
|
32464
32519
|
};
|
|
32465
|
-
const
|
|
32466
|
-
|
|
32467
|
-
|
|
32468
|
-
|
|
32469
|
-
|
|
32470
|
-
|
|
32471
|
-
|
|
32472
|
-
|
|
32520
|
+
const LoadingPage = () => /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
32521
|
+
"div",
|
|
32522
|
+
{
|
|
32523
|
+
style: {
|
|
32524
|
+
position: "absolute",
|
|
32525
|
+
top: 0,
|
|
32526
|
+
left: 0,
|
|
32527
|
+
width: "100%",
|
|
32528
|
+
height: "100%",
|
|
32529
|
+
zIndex: 200,
|
|
32530
|
+
opacity: "0.8",
|
|
32531
|
+
display: "flex",
|
|
32532
|
+
alignItems: "start",
|
|
32533
|
+
justifyContent: "center",
|
|
32534
|
+
padding: "120px 40px 40px 40px"
|
|
32535
|
+
}
|
|
32536
|
+
},
|
|
32537
|
+
/* @__PURE__ */ React.createElement(
|
|
32538
|
+
"div",
|
|
32539
|
+
{
|
|
32540
|
+
style: {
|
|
32541
|
+
background: "#FFF",
|
|
32542
|
+
border: "1px solid #EDECF3",
|
|
32543
|
+
boxShadow: "0px 2px 3px rgba(0, 0, 0, 0.05), 0 4px 12px rgba(0, 0, 0, 0.1)",
|
|
32544
|
+
borderRadius: "8px",
|
|
32545
|
+
padding: "32px 24px",
|
|
32546
|
+
width: "460px",
|
|
32547
|
+
maxWidth: "90%",
|
|
32548
|
+
display: "flex",
|
|
32549
|
+
alignItems: "center",
|
|
32550
|
+
justifyContent: "center",
|
|
32551
|
+
flexDirection: "column"
|
|
32552
|
+
}
|
|
32553
|
+
},
|
|
32554
|
+
/* @__PURE__ */ React.createElement(
|
|
32555
|
+
"svg",
|
|
32556
|
+
{
|
|
32557
|
+
style: {
|
|
32558
|
+
width: "64px",
|
|
32559
|
+
color: "#2296fe",
|
|
32560
|
+
marginTop: "-8px",
|
|
32561
|
+
marginBottom: "16px"
|
|
32562
|
+
},
|
|
32563
|
+
version: "1.1",
|
|
32564
|
+
id: "L5",
|
|
32565
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
32566
|
+
xmlnsXlink: "http://www.w3.org/1999/xlink",
|
|
32567
|
+
x: "0px",
|
|
32568
|
+
y: "0px",
|
|
32569
|
+
viewBox: "0 0 100 64",
|
|
32570
|
+
enableBackground: "new 0 0 0 0",
|
|
32571
|
+
xmlSpace: "preserve"
|
|
32572
|
+
},
|
|
32573
|
+
/* @__PURE__ */ React.createElement("circle", { fill: "currentColor", stroke: "none", cx: 6, cy: 32, r: 6 }, /* @__PURE__ */ React.createElement(
|
|
32574
|
+
"animateTransform",
|
|
32575
|
+
{
|
|
32576
|
+
attributeName: "transform",
|
|
32577
|
+
dur: "1s",
|
|
32578
|
+
type: "translate",
|
|
32579
|
+
values: "0 15 ; 0 -15; 0 15",
|
|
32580
|
+
calcMode: "spline",
|
|
32581
|
+
keySplines: "0.8 0 0.4 1; 0.4 0 0.2 1",
|
|
32582
|
+
repeatCount: "indefinite",
|
|
32583
|
+
begin: "0.1"
|
|
32584
|
+
}
|
|
32585
|
+
)),
|
|
32586
|
+
/* @__PURE__ */ React.createElement("circle", { fill: "currentColor", stroke: "none", cx: 30, cy: 32, r: 6 }, /* @__PURE__ */ React.createElement(
|
|
32587
|
+
"animateTransform",
|
|
32588
|
+
{
|
|
32589
|
+
attributeName: "transform",
|
|
32590
|
+
dur: "1s",
|
|
32591
|
+
type: "translate",
|
|
32592
|
+
values: "0 15 ; 0 -10; 0 15",
|
|
32593
|
+
calcMode: "spline",
|
|
32594
|
+
keySplines: "0.8 0 0.4 1; 0.4 0 0.2 1",
|
|
32595
|
+
repeatCount: "indefinite",
|
|
32596
|
+
begin: "0.2"
|
|
32597
|
+
}
|
|
32598
|
+
)),
|
|
32599
|
+
/* @__PURE__ */ React.createElement("circle", { fill: "currentColor", stroke: "none", cx: 54, cy: 32, r: 6 }, /* @__PURE__ */ React.createElement(
|
|
32600
|
+
"animateTransform",
|
|
32601
|
+
{
|
|
32602
|
+
attributeName: "transform",
|
|
32603
|
+
dur: "1s",
|
|
32604
|
+
type: "translate",
|
|
32605
|
+
values: "0 15 ; 0 -5; 0 15",
|
|
32606
|
+
calcMode: "spline",
|
|
32607
|
+
keySplines: "0.8 0 0.4 1; 0.4 0 0.2 1",
|
|
32608
|
+
repeatCount: "indefinite",
|
|
32609
|
+
begin: "0.3"
|
|
32610
|
+
}
|
|
32611
|
+
))
|
|
32612
|
+
),
|
|
32613
|
+
/* @__PURE__ */ React.createElement(
|
|
32614
|
+
"p",
|
|
32615
|
+
{
|
|
32616
|
+
style: {
|
|
32617
|
+
fontSize: "16px",
|
|
32618
|
+
color: "#716c7f",
|
|
32619
|
+
textAlign: "center",
|
|
32620
|
+
lineHeight: "1.3",
|
|
32621
|
+
fontFamily: "'Inter', sans-serif",
|
|
32622
|
+
fontWeight: "normal"
|
|
32623
|
+
}
|
|
32624
|
+
},
|
|
32625
|
+
"Please wait, Tina is loading data..."
|
|
32626
|
+
)
|
|
32627
|
+
)
|
|
32628
|
+
));
|
|
32629
|
+
function RiHome2Line(props) {
|
|
32630
|
+
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);
|
|
32631
|
+
}
|
|
32473
32632
|
const PageWrapper = ({ children }) => {
|
|
32474
32633
|
var _a, _b;
|
|
32475
32634
|
const cms = useCMS$1();
|
|
@@ -32494,321 +32653,6 @@ This will work when developing locally but NOT when deployed to production.
|
|
|
32494
32653
|
};
|
|
32495
32654
|
const PageBody = ({ children }) => /* @__PURE__ */ React.createElement("div", { className: "py-8 px-6 xl:px-12" }, children);
|
|
32496
32655
|
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));
|
|
32497
|
-
const DashboardPage = () => {
|
|
32498
|
-
return /* @__PURE__ */ React.createElement(GetCMS, null, (cms) => {
|
|
32499
|
-
var _a, _b;
|
|
32500
|
-
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.")));
|
|
32501
|
-
});
|
|
32502
|
-
};
|
|
32503
|
-
function RiHome2Line(props) {
|
|
32504
|
-
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);
|
|
32505
|
-
}
|
|
32506
|
-
const LoadingPage = () => /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
32507
|
-
"div",
|
|
32508
|
-
{
|
|
32509
|
-
style: {
|
|
32510
|
-
position: "absolute",
|
|
32511
|
-
top: 0,
|
|
32512
|
-
left: 0,
|
|
32513
|
-
width: "100%",
|
|
32514
|
-
height: "100%",
|
|
32515
|
-
zIndex: 200,
|
|
32516
|
-
opacity: "0.8",
|
|
32517
|
-
display: "flex",
|
|
32518
|
-
alignItems: "start",
|
|
32519
|
-
justifyContent: "center",
|
|
32520
|
-
padding: "120px 40px 40px 40px"
|
|
32521
|
-
}
|
|
32522
|
-
},
|
|
32523
|
-
/* @__PURE__ */ React.createElement(
|
|
32524
|
-
"div",
|
|
32525
|
-
{
|
|
32526
|
-
style: {
|
|
32527
|
-
background: "#FFF",
|
|
32528
|
-
border: "1px solid #EDECF3",
|
|
32529
|
-
boxShadow: "0px 2px 3px rgba(0, 0, 0, 0.05), 0 4px 12px rgba(0, 0, 0, 0.1)",
|
|
32530
|
-
borderRadius: "8px",
|
|
32531
|
-
padding: "32px 24px",
|
|
32532
|
-
width: "460px",
|
|
32533
|
-
maxWidth: "90%",
|
|
32534
|
-
display: "flex",
|
|
32535
|
-
alignItems: "center",
|
|
32536
|
-
justifyContent: "center",
|
|
32537
|
-
flexDirection: "column"
|
|
32538
|
-
}
|
|
32539
|
-
},
|
|
32540
|
-
/* @__PURE__ */ React.createElement(
|
|
32541
|
-
"svg",
|
|
32542
|
-
{
|
|
32543
|
-
style: {
|
|
32544
|
-
width: "64px",
|
|
32545
|
-
color: "#2296fe",
|
|
32546
|
-
marginTop: "-8px",
|
|
32547
|
-
marginBottom: "16px"
|
|
32548
|
-
},
|
|
32549
|
-
version: "1.1",
|
|
32550
|
-
id: "L5",
|
|
32551
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
32552
|
-
xmlnsXlink: "http://www.w3.org/1999/xlink",
|
|
32553
|
-
x: "0px",
|
|
32554
|
-
y: "0px",
|
|
32555
|
-
viewBox: "0 0 100 64",
|
|
32556
|
-
enableBackground: "new 0 0 0 0",
|
|
32557
|
-
xmlSpace: "preserve"
|
|
32558
|
-
},
|
|
32559
|
-
/* @__PURE__ */ React.createElement("circle", { fill: "currentColor", stroke: "none", cx: 6, cy: 32, r: 6 }, /* @__PURE__ */ React.createElement(
|
|
32560
|
-
"animateTransform",
|
|
32561
|
-
{
|
|
32562
|
-
attributeName: "transform",
|
|
32563
|
-
dur: "1s",
|
|
32564
|
-
type: "translate",
|
|
32565
|
-
values: "0 15 ; 0 -15; 0 15",
|
|
32566
|
-
calcMode: "spline",
|
|
32567
|
-
keySplines: "0.8 0 0.4 1; 0.4 0 0.2 1",
|
|
32568
|
-
repeatCount: "indefinite",
|
|
32569
|
-
begin: "0.1"
|
|
32570
|
-
}
|
|
32571
|
-
)),
|
|
32572
|
-
/* @__PURE__ */ React.createElement("circle", { fill: "currentColor", stroke: "none", cx: 30, cy: 32, r: 6 }, /* @__PURE__ */ React.createElement(
|
|
32573
|
-
"animateTransform",
|
|
32574
|
-
{
|
|
32575
|
-
attributeName: "transform",
|
|
32576
|
-
dur: "1s",
|
|
32577
|
-
type: "translate",
|
|
32578
|
-
values: "0 15 ; 0 -10; 0 15",
|
|
32579
|
-
calcMode: "spline",
|
|
32580
|
-
keySplines: "0.8 0 0.4 1; 0.4 0 0.2 1",
|
|
32581
|
-
repeatCount: "indefinite",
|
|
32582
|
-
begin: "0.2"
|
|
32583
|
-
}
|
|
32584
|
-
)),
|
|
32585
|
-
/* @__PURE__ */ React.createElement("circle", { fill: "currentColor", stroke: "none", cx: 54, cy: 32, r: 6 }, /* @__PURE__ */ React.createElement(
|
|
32586
|
-
"animateTransform",
|
|
32587
|
-
{
|
|
32588
|
-
attributeName: "transform",
|
|
32589
|
-
dur: "1s",
|
|
32590
|
-
type: "translate",
|
|
32591
|
-
values: "0 15 ; 0 -5; 0 15",
|
|
32592
|
-
calcMode: "spline",
|
|
32593
|
-
keySplines: "0.8 0 0.4 1; 0.4 0 0.2 1",
|
|
32594
|
-
repeatCount: "indefinite",
|
|
32595
|
-
begin: "0.3"
|
|
32596
|
-
}
|
|
32597
|
-
))
|
|
32598
|
-
),
|
|
32599
|
-
/* @__PURE__ */ React.createElement(
|
|
32600
|
-
"p",
|
|
32601
|
-
{
|
|
32602
|
-
style: {
|
|
32603
|
-
fontSize: "16px",
|
|
32604
|
-
color: "#716c7f",
|
|
32605
|
-
textAlign: "center",
|
|
32606
|
-
lineHeight: "1.3",
|
|
32607
|
-
fontFamily: "'Inter', sans-serif",
|
|
32608
|
-
fontWeight: "normal"
|
|
32609
|
-
}
|
|
32610
|
-
},
|
|
32611
|
-
"Please wait, Tina is loading data..."
|
|
32612
|
-
)
|
|
32613
|
-
)
|
|
32614
|
-
));
|
|
32615
|
-
const FullscreenError = ({
|
|
32616
|
-
title = "Error",
|
|
32617
|
-
errorMessage = "It looks like something went wrong."
|
|
32618
|
-
}) => {
|
|
32619
|
-
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"));
|
|
32620
|
-
};
|
|
32621
|
-
const useGetCollection = (cms, collectionName, includeDocuments = true, folder, after = "", sortKey, filterArgs) => {
|
|
32622
|
-
const api = new TinaAdminApi(cms);
|
|
32623
|
-
const schema = cms.api.tina.schema;
|
|
32624
|
-
const collectionExtra = schema.getCollection(collectionName);
|
|
32625
|
-
const [collection, setCollection] = React.useState(void 0);
|
|
32626
|
-
const [loading, setLoading] = React.useState(true);
|
|
32627
|
-
const [error, setError] = React.useState(void 0);
|
|
32628
|
-
const [resetState, setResetSate] = React.useState(0);
|
|
32629
|
-
React.useEffect(() => {
|
|
32630
|
-
let cancelled = false;
|
|
32631
|
-
const fetchCollection = async () => {
|
|
32632
|
-
var _a;
|
|
32633
|
-
if (await api.isAuthenticated() && !folder.loading && !cancelled) {
|
|
32634
|
-
const { name, order } = JSON.parse(sortKey || "{}");
|
|
32635
|
-
const validSortKey = ((_a = collectionExtra.fields) == null ? void 0 : _a.map((x) => x.name).includes(name)) ? name : void 0;
|
|
32636
|
-
try {
|
|
32637
|
-
const collection2 = await api.fetchCollection(
|
|
32638
|
-
collectionName,
|
|
32639
|
-
includeDocuments,
|
|
32640
|
-
(filterArgs == null ? void 0 : filterArgs.filterField) ? "" : folder.fullyQualifiedName,
|
|
32641
|
-
after,
|
|
32642
|
-
validSortKey,
|
|
32643
|
-
order,
|
|
32644
|
-
filterArgs
|
|
32645
|
-
);
|
|
32646
|
-
setCollection(collection2);
|
|
32647
|
-
} catch (error2) {
|
|
32648
|
-
cms.alerts.error(
|
|
32649
|
-
`[${error2.name}] GetCollection failed: ${error2.message}`
|
|
32650
|
-
);
|
|
32651
|
-
console.error(error2);
|
|
32652
|
-
setCollection(void 0);
|
|
32653
|
-
setError(error2);
|
|
32654
|
-
}
|
|
32655
|
-
setLoading(false);
|
|
32656
|
-
}
|
|
32657
|
-
};
|
|
32658
|
-
if (cancelled)
|
|
32659
|
-
return;
|
|
32660
|
-
setLoading(true);
|
|
32661
|
-
fetchCollection();
|
|
32662
|
-
return () => {
|
|
32663
|
-
cancelled = true;
|
|
32664
|
-
};
|
|
32665
|
-
}, [
|
|
32666
|
-
cms,
|
|
32667
|
-
collectionName,
|
|
32668
|
-
folder.loading,
|
|
32669
|
-
folder.fullyQualifiedName,
|
|
32670
|
-
resetState,
|
|
32671
|
-
after,
|
|
32672
|
-
sortKey
|
|
32673
|
-
]);
|
|
32674
|
-
const reFetchCollection = () => setResetSate((x) => x + 1);
|
|
32675
|
-
return { collection, loading, error, reFetchCollection, collectionExtra };
|
|
32676
|
-
};
|
|
32677
|
-
const useSearchCollection = (cms, collectionName, includeDocuments = true, folder, after = "", search) => {
|
|
32678
|
-
const api = new TinaAdminApi(cms);
|
|
32679
|
-
const schema = cms.api.tina.schema;
|
|
32680
|
-
const collectionExtra = schema.getCollection(collectionName);
|
|
32681
|
-
const [collection, setCollection] = React.useState(void 0);
|
|
32682
|
-
const [loading, setLoading] = React.useState(true);
|
|
32683
|
-
const [error, setError] = React.useState(void 0);
|
|
32684
|
-
const [resetState, setResetSate] = React.useState(0);
|
|
32685
|
-
React.useEffect(() => {
|
|
32686
|
-
let cancelled = false;
|
|
32687
|
-
const searchCollection = async () => {
|
|
32688
|
-
if (await api.isAuthenticated() && !folder.loading && !cancelled) {
|
|
32689
|
-
try {
|
|
32690
|
-
const response = await cms.api.search.query(
|
|
32691
|
-
`${search} AND _collection:${collectionName}`,
|
|
32692
|
-
{
|
|
32693
|
-
limit: 15,
|
|
32694
|
-
cursor: after
|
|
32695
|
-
}
|
|
32696
|
-
);
|
|
32697
|
-
const docs = await Promise.allSettled(
|
|
32698
|
-
response.results.map((result) => {
|
|
32699
|
-
const [collection2, relativePath2] = result._id.split(":");
|
|
32700
|
-
return api.fetchDocument(collection2, relativePath2, false);
|
|
32701
|
-
})
|
|
32702
|
-
);
|
|
32703
|
-
const edges = docs.filter((p) => {
|
|
32704
|
-
var _a;
|
|
32705
|
-
return p.status === "fulfilled" && !!((_a = p.value) == null ? void 0 : _a.document);
|
|
32706
|
-
}).map((result) => ({ node: result.value.document }));
|
|
32707
|
-
const c = await api.fetchCollection(collectionName, false, "");
|
|
32708
|
-
setCollection({
|
|
32709
|
-
format: collection.format,
|
|
32710
|
-
label: collection.label,
|
|
32711
|
-
name: collectionName,
|
|
32712
|
-
templates: collection.templates,
|
|
32713
|
-
documents: {
|
|
32714
|
-
pageInfo: {
|
|
32715
|
-
hasNextPage: !!response.nextCursor,
|
|
32716
|
-
hasPreviousPage: !!response.prevCursor,
|
|
32717
|
-
startCursor: "",
|
|
32718
|
-
endCursor: response.nextCursor || ""
|
|
32719
|
-
},
|
|
32720
|
-
edges
|
|
32721
|
-
}
|
|
32722
|
-
});
|
|
32723
|
-
} catch (error2) {
|
|
32724
|
-
cms.alerts.error(
|
|
32725
|
-
`[${error2.name}] GetCollection failed: ${error2.message}`
|
|
32726
|
-
);
|
|
32727
|
-
console.error(error2);
|
|
32728
|
-
setCollection(void 0);
|
|
32729
|
-
setError(error2);
|
|
32730
|
-
}
|
|
32731
|
-
setLoading(false);
|
|
32732
|
-
}
|
|
32733
|
-
};
|
|
32734
|
-
if (cancelled)
|
|
32735
|
-
return;
|
|
32736
|
-
setLoading(true);
|
|
32737
|
-
searchCollection();
|
|
32738
|
-
return () => {
|
|
32739
|
-
cancelled = true;
|
|
32740
|
-
};
|
|
32741
|
-
}, [
|
|
32742
|
-
cms,
|
|
32743
|
-
collectionName,
|
|
32744
|
-
folder.loading,
|
|
32745
|
-
folder.fullyQualifiedName,
|
|
32746
|
-
resetState,
|
|
32747
|
-
after,
|
|
32748
|
-
search
|
|
32749
|
-
]);
|
|
32750
|
-
const reFetchCollection = () => setResetSate((x) => x + 1);
|
|
32751
|
-
return { collection, loading, error, reFetchCollection, collectionExtra };
|
|
32752
|
-
};
|
|
32753
|
-
const GetCollection = ({
|
|
32754
|
-
cms,
|
|
32755
|
-
collectionName,
|
|
32756
|
-
folder,
|
|
32757
|
-
includeDocuments = true,
|
|
32758
|
-
startCursor,
|
|
32759
|
-
sortKey,
|
|
32760
|
-
children,
|
|
32761
|
-
filterArgs,
|
|
32762
|
-
search
|
|
32763
|
-
}) => {
|
|
32764
|
-
const navigate = reactRouterDom.useNavigate();
|
|
32765
|
-
const { collection, loading, error, reFetchCollection, collectionExtra } = search ? useSearchCollection(
|
|
32766
|
-
cms,
|
|
32767
|
-
collectionName,
|
|
32768
|
-
includeDocuments,
|
|
32769
|
-
folder,
|
|
32770
|
-
startCursor || "",
|
|
32771
|
-
search
|
|
32772
|
-
) : useGetCollection(
|
|
32773
|
-
cms,
|
|
32774
|
-
collectionName,
|
|
32775
|
-
includeDocuments,
|
|
32776
|
-
folder,
|
|
32777
|
-
startCursor || "",
|
|
32778
|
-
sortKey,
|
|
32779
|
-
filterArgs
|
|
32780
|
-
) || {};
|
|
32781
|
-
React.useEffect(() => {
|
|
32782
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
32783
|
-
if (loading)
|
|
32784
|
-
return;
|
|
32785
|
-
const collectionDefinition = cms.api.tina.schema.getCollection(
|
|
32786
|
-
collection.name
|
|
32787
|
-
);
|
|
32788
|
-
const allowCreate = ((_b = (_a = collectionDefinition == null ? void 0 : collectionDefinition.ui) == null ? void 0 : _a.allowedActions) == null ? void 0 : _b.create) ?? true;
|
|
32789
|
-
const allowDelete = ((_d = (_c = collectionDefinition == null ? void 0 : collectionDefinition.ui) == null ? void 0 : _c.allowedActions) == null ? void 0 : _d.delete) ?? true;
|
|
32790
|
-
const collectionResponse = collection;
|
|
32791
|
-
if (!allowCreate && !allowDelete && // Check there is only one document
|
|
32792
|
-
((_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
|
|
32793
|
-
((_i = (_h = (_g = collectionResponse.documents) == null ? void 0 : _g.edges[0]) == null ? void 0 : _h.node) == null ? void 0 : _i.__typename) !== "Folder") {
|
|
32794
|
-
const doc = collectionResponse.documents.edges[0].node;
|
|
32795
|
-
handleNavigate(
|
|
32796
|
-
navigate,
|
|
32797
|
-
cms,
|
|
32798
|
-
collectionResponse,
|
|
32799
|
-
collectionDefinition,
|
|
32800
|
-
doc
|
|
32801
|
-
);
|
|
32802
|
-
}
|
|
32803
|
-
}, [(collection == null ? void 0 : collection.name) || "", loading]);
|
|
32804
|
-
if (error) {
|
|
32805
|
-
return /* @__PURE__ */ React.createElement(FullscreenError, null);
|
|
32806
|
-
}
|
|
32807
|
-
if (loading) {
|
|
32808
|
-
return /* @__PURE__ */ React.createElement(LoadingPage, null);
|
|
32809
|
-
}
|
|
32810
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, children(collection, loading, reFetchCollection, collectionExtra));
|
|
32811
|
-
};
|
|
32812
32656
|
const folderRegex = /^.*\/~\/*(.*)$/;
|
|
32813
32657
|
const parentFolder = (folder) => {
|
|
32814
32658
|
return {
|
|
@@ -33686,6 +33530,231 @@ This will work when developing locally but NOT when deployed to production.
|
|
|
33686
33530
|
"Rename"
|
|
33687
33531
|
))));
|
|
33688
33532
|
};
|
|
33533
|
+
const FullscreenError = ({
|
|
33534
|
+
title = "Error",
|
|
33535
|
+
errorMessage = "It looks like something went wrong."
|
|
33536
|
+
}) => {
|
|
33537
|
+
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"));
|
|
33538
|
+
};
|
|
33539
|
+
const isValidSortKey = (sortKey, collection) => {
|
|
33540
|
+
if (collection.fields) {
|
|
33541
|
+
const sortKeys = collection.fields.map((x) => x.name);
|
|
33542
|
+
return sortKeys.includes(sortKey);
|
|
33543
|
+
} else if (collection.templates) {
|
|
33544
|
+
const collectionMap = {};
|
|
33545
|
+
const conflictedFields = /* @__PURE__ */ new Set();
|
|
33546
|
+
for (const template of collection.templates) {
|
|
33547
|
+
for (const field of template.fields) {
|
|
33548
|
+
if (collectionMap[field.name]) {
|
|
33549
|
+
if (collectionMap[field.name].type !== field.type) {
|
|
33550
|
+
conflictedFields.add(field.name);
|
|
33551
|
+
}
|
|
33552
|
+
} else {
|
|
33553
|
+
collectionMap[field.name] = field;
|
|
33554
|
+
}
|
|
33555
|
+
}
|
|
33556
|
+
}
|
|
33557
|
+
for (const key in conflictedFields) {
|
|
33558
|
+
delete collectionMap[key];
|
|
33559
|
+
}
|
|
33560
|
+
for (const key in collectionMap) {
|
|
33561
|
+
if (key === sortKey) {
|
|
33562
|
+
return true;
|
|
33563
|
+
}
|
|
33564
|
+
}
|
|
33565
|
+
return false;
|
|
33566
|
+
}
|
|
33567
|
+
};
|
|
33568
|
+
const useGetCollection = (cms, collectionName, includeDocuments = true, folder, after = "", sortKey, filterArgs) => {
|
|
33569
|
+
const api = new TinaAdminApi(cms);
|
|
33570
|
+
const schema = cms.api.tina.schema;
|
|
33571
|
+
const collectionExtra = schema.getCollection(collectionName);
|
|
33572
|
+
const [collection, setCollection] = React.useState(void 0);
|
|
33573
|
+
const [loading, setLoading] = React.useState(true);
|
|
33574
|
+
const [error, setError] = React.useState(void 0);
|
|
33575
|
+
const [resetState, setResetSate] = React.useState(0);
|
|
33576
|
+
React.useEffect(() => {
|
|
33577
|
+
let cancelled = false;
|
|
33578
|
+
const fetchCollection = async () => {
|
|
33579
|
+
if (await api.isAuthenticated() && !folder.loading && !cancelled) {
|
|
33580
|
+
const { name, order } = JSON.parse(sortKey || "{}");
|
|
33581
|
+
const validSortKey = isValidSortKey(name, collectionExtra) ? name : void 0;
|
|
33582
|
+
try {
|
|
33583
|
+
const collection2 = await api.fetchCollection(
|
|
33584
|
+
collectionName,
|
|
33585
|
+
includeDocuments,
|
|
33586
|
+
(filterArgs == null ? void 0 : filterArgs.filterField) ? "" : folder.fullyQualifiedName,
|
|
33587
|
+
after,
|
|
33588
|
+
validSortKey,
|
|
33589
|
+
order,
|
|
33590
|
+
filterArgs
|
|
33591
|
+
);
|
|
33592
|
+
setCollection(collection2);
|
|
33593
|
+
} catch (error2) {
|
|
33594
|
+
cms.alerts.error(
|
|
33595
|
+
`[${error2.name}] GetCollection failed: ${error2.message}`
|
|
33596
|
+
);
|
|
33597
|
+
console.error(error2);
|
|
33598
|
+
setCollection(void 0);
|
|
33599
|
+
setError(error2);
|
|
33600
|
+
}
|
|
33601
|
+
setLoading(false);
|
|
33602
|
+
}
|
|
33603
|
+
};
|
|
33604
|
+
if (cancelled)
|
|
33605
|
+
return;
|
|
33606
|
+
setLoading(true);
|
|
33607
|
+
fetchCollection();
|
|
33608
|
+
return () => {
|
|
33609
|
+
cancelled = true;
|
|
33610
|
+
};
|
|
33611
|
+
}, [
|
|
33612
|
+
cms,
|
|
33613
|
+
collectionName,
|
|
33614
|
+
folder.loading,
|
|
33615
|
+
folder.fullyQualifiedName,
|
|
33616
|
+
resetState,
|
|
33617
|
+
after,
|
|
33618
|
+
sortKey
|
|
33619
|
+
]);
|
|
33620
|
+
const reFetchCollection = () => setResetSate((x) => x + 1);
|
|
33621
|
+
return { collection, loading, error, reFetchCollection, collectionExtra };
|
|
33622
|
+
};
|
|
33623
|
+
const useSearchCollection = (cms, collectionName, includeDocuments = true, folder, after = "", search) => {
|
|
33624
|
+
const api = new TinaAdminApi(cms);
|
|
33625
|
+
const schema = cms.api.tina.schema;
|
|
33626
|
+
const collectionExtra = schema.getCollection(collectionName);
|
|
33627
|
+
const [collection, setCollection] = React.useState(void 0);
|
|
33628
|
+
const [loading, setLoading] = React.useState(true);
|
|
33629
|
+
const [error, setError] = React.useState(void 0);
|
|
33630
|
+
const [resetState, setResetSate] = React.useState(0);
|
|
33631
|
+
React.useEffect(() => {
|
|
33632
|
+
let cancelled = false;
|
|
33633
|
+
const searchCollection = async () => {
|
|
33634
|
+
if (await api.isAuthenticated() && !folder.loading && !cancelled) {
|
|
33635
|
+
try {
|
|
33636
|
+
const response = await cms.api.search.query(
|
|
33637
|
+
`${search} AND _collection:${collectionName}`,
|
|
33638
|
+
{
|
|
33639
|
+
limit: 15,
|
|
33640
|
+
cursor: after
|
|
33641
|
+
}
|
|
33642
|
+
);
|
|
33643
|
+
const docs = await Promise.allSettled(
|
|
33644
|
+
response.results.map((result) => {
|
|
33645
|
+
const [collection2, relativePath2] = result._id.split(":");
|
|
33646
|
+
return api.fetchDocument(collection2, relativePath2, false);
|
|
33647
|
+
})
|
|
33648
|
+
);
|
|
33649
|
+
const edges = docs.filter((p) => {
|
|
33650
|
+
var _a;
|
|
33651
|
+
return p.status === "fulfilled" && !!((_a = p.value) == null ? void 0 : _a.document);
|
|
33652
|
+
}).map((result) => ({ node: result.value.document }));
|
|
33653
|
+
const c = await api.fetchCollection(collectionName, false, "");
|
|
33654
|
+
setCollection({
|
|
33655
|
+
format: collection.format,
|
|
33656
|
+
label: collection.label,
|
|
33657
|
+
name: collectionName,
|
|
33658
|
+
templates: collection.templates,
|
|
33659
|
+
documents: {
|
|
33660
|
+
pageInfo: {
|
|
33661
|
+
hasNextPage: !!response.nextCursor,
|
|
33662
|
+
hasPreviousPage: !!response.prevCursor,
|
|
33663
|
+
startCursor: "",
|
|
33664
|
+
endCursor: response.nextCursor || ""
|
|
33665
|
+
},
|
|
33666
|
+
edges
|
|
33667
|
+
}
|
|
33668
|
+
});
|
|
33669
|
+
} catch (error2) {
|
|
33670
|
+
cms.alerts.error(
|
|
33671
|
+
`[${error2.name}] GetCollection failed: ${error2.message}`
|
|
33672
|
+
);
|
|
33673
|
+
console.error(error2);
|
|
33674
|
+
setCollection(void 0);
|
|
33675
|
+
setError(error2);
|
|
33676
|
+
}
|
|
33677
|
+
setLoading(false);
|
|
33678
|
+
}
|
|
33679
|
+
};
|
|
33680
|
+
if (cancelled)
|
|
33681
|
+
return;
|
|
33682
|
+
setLoading(true);
|
|
33683
|
+
searchCollection();
|
|
33684
|
+
return () => {
|
|
33685
|
+
cancelled = true;
|
|
33686
|
+
};
|
|
33687
|
+
}, [
|
|
33688
|
+
cms,
|
|
33689
|
+
collectionName,
|
|
33690
|
+
folder.loading,
|
|
33691
|
+
folder.fullyQualifiedName,
|
|
33692
|
+
resetState,
|
|
33693
|
+
after,
|
|
33694
|
+
search
|
|
33695
|
+
]);
|
|
33696
|
+
const reFetchCollection = () => setResetSate((x) => x + 1);
|
|
33697
|
+
return { collection, loading, error, reFetchCollection, collectionExtra };
|
|
33698
|
+
};
|
|
33699
|
+
const GetCollection = ({
|
|
33700
|
+
cms,
|
|
33701
|
+
collectionName,
|
|
33702
|
+
folder,
|
|
33703
|
+
includeDocuments = true,
|
|
33704
|
+
startCursor,
|
|
33705
|
+
sortKey,
|
|
33706
|
+
children,
|
|
33707
|
+
filterArgs,
|
|
33708
|
+
search
|
|
33709
|
+
}) => {
|
|
33710
|
+
const navigate = reactRouterDom.useNavigate();
|
|
33711
|
+
const { collection, loading, error, reFetchCollection, collectionExtra } = search ? useSearchCollection(
|
|
33712
|
+
cms,
|
|
33713
|
+
collectionName,
|
|
33714
|
+
includeDocuments,
|
|
33715
|
+
folder,
|
|
33716
|
+
startCursor || "",
|
|
33717
|
+
search
|
|
33718
|
+
) : useGetCollection(
|
|
33719
|
+
cms,
|
|
33720
|
+
collectionName,
|
|
33721
|
+
includeDocuments,
|
|
33722
|
+
folder,
|
|
33723
|
+
startCursor || "",
|
|
33724
|
+
sortKey,
|
|
33725
|
+
filterArgs
|
|
33726
|
+
) || {};
|
|
33727
|
+
React.useEffect(() => {
|
|
33728
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
33729
|
+
if (loading)
|
|
33730
|
+
return;
|
|
33731
|
+
const collectionDefinition = cms.api.tina.schema.getCollection(
|
|
33732
|
+
collection.name
|
|
33733
|
+
);
|
|
33734
|
+
const allowCreate = ((_b = (_a = collectionDefinition == null ? void 0 : collectionDefinition.ui) == null ? void 0 : _a.allowedActions) == null ? void 0 : _b.create) ?? true;
|
|
33735
|
+
const allowDelete = ((_d = (_c = collectionDefinition == null ? void 0 : collectionDefinition.ui) == null ? void 0 : _c.allowedActions) == null ? void 0 : _d.delete) ?? true;
|
|
33736
|
+
const collectionResponse = collection;
|
|
33737
|
+
if (!allowCreate && !allowDelete && // Check there is only one document
|
|
33738
|
+
((_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
|
|
33739
|
+
((_i = (_h = (_g = collectionResponse.documents) == null ? void 0 : _g.edges[0]) == null ? void 0 : _h.node) == null ? void 0 : _i.__typename) !== "Folder") {
|
|
33740
|
+
const doc = collectionResponse.documents.edges[0].node;
|
|
33741
|
+
handleNavigate(
|
|
33742
|
+
navigate,
|
|
33743
|
+
cms,
|
|
33744
|
+
collectionResponse,
|
|
33745
|
+
collectionDefinition,
|
|
33746
|
+
doc
|
|
33747
|
+
);
|
|
33748
|
+
}
|
|
33749
|
+
}, [(collection == null ? void 0 : collection.name) || "", loading]);
|
|
33750
|
+
if (error) {
|
|
33751
|
+
return /* @__PURE__ */ React.createElement(FullscreenError, null);
|
|
33752
|
+
}
|
|
33753
|
+
if (loading) {
|
|
33754
|
+
return /* @__PURE__ */ React.createElement(LoadingPage, null);
|
|
33755
|
+
}
|
|
33756
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, children(collection, loading, reFetchCollection, collectionExtra));
|
|
33757
|
+
};
|
|
33689
33758
|
const ErrorDialog = (props) => {
|
|
33690
33759
|
return /* @__PURE__ */ React.createElement(
|
|
33691
33760
|
"div",
|
|
@@ -34229,6 +34298,12 @@ This will work when developing locally but NOT when deployed to production.
|
|
|
34229
34298
|
), /* @__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 }))
|
|
34230
34299
|
), activeForm && /* @__PURE__ */ React.createElement(FormBuilder, { form: activeForm, onPristineChange: setFormIsPristine }));
|
|
34231
34300
|
};
|
|
34301
|
+
const DashboardPage = () => {
|
|
34302
|
+
return /* @__PURE__ */ React.createElement(GetCMS, null, (cms) => {
|
|
34303
|
+
var _a, _b;
|
|
34304
|
+
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.")));
|
|
34305
|
+
});
|
|
34306
|
+
};
|
|
34232
34307
|
const ScreenPage = () => {
|
|
34233
34308
|
const { screenName } = reactRouterDom.useParams();
|
|
34234
34309
|
return /* @__PURE__ */ React.createElement(GetCMS, null, (cms) => {
|
|
@@ -34311,7 +34386,7 @@ This will work when developing locally but NOT when deployed to production.
|
|
|
34311
34386
|
} catch {
|
|
34312
34387
|
cms.alerts.error("Branch indexing failed.");
|
|
34313
34388
|
setErrorMessage(
|
|
34314
|
-
'Branch indexing failed, please check the
|
|
34389
|
+
'Branch indexing failed, please check the TinaCloud dashboard for more information. To try again chick "re-index" on the branch in the dashboard.'
|
|
34315
34390
|
);
|
|
34316
34391
|
setState("error");
|
|
34317
34392
|
}
|
|
@@ -34479,7 +34554,7 @@ This will work when developing locally but NOT when deployed to production.
|
|
|
34479
34554
|
);
|
|
34480
34555
|
}
|
|
34481
34556
|
}).catch((e) => {
|
|
34482
|
-
if (e.message.includes("has not been indexed by
|
|
34557
|
+
if (e.message.includes("has not been indexed by TinaCloud")) {
|
|
34483
34558
|
setSchemaMissingError(true);
|
|
34484
34559
|
} else {
|
|
34485
34560
|
cms.alerts.error(`Unexpected error checking schema: ${e}`);
|