tinacms 1.6.5 → 1.6.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +98 -91
- package/dist/index.mjs +97 -90
- package/dist/toolkit/components/media/utils.d.ts +1 -0
- package/dist/toolkit/core/media-store.default.d.ts +1 -0
- package/dist/toolkit/core/media.d.ts +5 -0
- package/dist/toolkit/react-sidebar/components/sidebar.d.ts +1 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
(function(global, factory) {
|
|
2
|
-
typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("zod"), require("react"), require("react-dom"), require("@udecode/plate-headless"), require("@monaco-editor/react"), require("slate-react"), require("@headlessui/react"), require("slate"), require("final-form-arrays"), require("final-form-set-field-data"), require("final-form"), require("react-final-form"), require("prop-types"), require("react-beautiful-dnd"), require("@radix-ui/react-popover"), require("react-color"), require("color-string"), require("react-dropzone"), require("@tinacms/sharedctx"), require("lodash.get"), require("moment"), require("date-fns"), require("
|
|
3
|
-
})(this, function(exports2, zod, React, reactDom, plateHeadless, MonacoEditor, slateReact, react, slate, arrayMutators, setFieldData, finalForm, reactFinalForm, PropTypes, reactBeautifulDnd, Popover$1, pkg$1, pkg, dropzone, sharedctx, get, moment, dateFns,
|
|
2
|
+
typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("zod"), require("react"), require("react-dom"), require("@udecode/plate-headless"), require("@monaco-editor/react"), require("slate-react"), require("@headlessui/react"), require("slate"), require("final-form-arrays"), require("final-form-set-field-data"), require("final-form"), require("react-final-form"), require("prop-types"), require("react-beautiful-dnd"), require("@radix-ui/react-popover"), require("react-color"), require("color-string"), require("react-dropzone"), require("@tinacms/sharedctx"), require("lodash.get"), require("moment"), require("date-fns"), require("is-hotkey"), require("@floating-ui/dom"), require("@react-hook/window-size"), require("graphql"), require("graphql-tag"), require("@tinacms/schema-tools"), require("yup"), require("@graphql-inspector/core"), require("react-router-dom"), require("@tinacms/mdx")) : typeof define === "function" && define.amd ? define(["exports", "zod", "react", "react-dom", "@udecode/plate-headless", "@monaco-editor/react", "slate-react", "@headlessui/react", "slate", "final-form-arrays", "final-form-set-field-data", "final-form", "react-final-form", "prop-types", "react-beautiful-dnd", "@radix-ui/react-popover", "react-color", "color-string", "react-dropzone", "@tinacms/sharedctx", "lodash.get", "moment", "date-fns", "is-hotkey", "@floating-ui/dom", "@react-hook/window-size", "graphql", "graphql-tag", "@tinacms/schema-tools", "yup", "@graphql-inspector/core", "react-router-dom", "@tinacms/mdx"], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(global.tinacms = {}, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP, global.NOOP));
|
|
3
|
+
})(this, function(exports2, zod, React, reactDom, plateHeadless, MonacoEditor, slateReact, react, slate, arrayMutators, setFieldData, finalForm, reactFinalForm, PropTypes, reactBeautifulDnd, Popover$1, pkg$1, pkg, dropzone, sharedctx, get, moment, dateFns, isHotkey, dom, windowSize, graphql, gql$1, schemaTools, yup, core, reactRouterDom, mdx) {
|
|
4
4
|
"use strict";var __defProp = Object.defineProperty;
|
|
5
5
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
6
|
var __publicField = (obj, key, value) => {
|
|
@@ -2803,6 +2803,9 @@ var __publicField = (obj, key, value) => {
|
|
|
2803
2803
|
function BiMenu(props) {
|
|
2804
2804
|
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "d": "M4 6h16v2H4zm0 5h16v2H4zm0 5h16v2H4z" }, "child": [] }] })(props);
|
|
2805
2805
|
}
|
|
2806
|
+
function BiMovie(props) {
|
|
2807
|
+
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "d": "M20 3H4c-1.103 0-2 .897-2 2v14c0 1.103.897 2 2 2h16c1.103 0 2-.897 2-2V5c0-1.103-.897-2-2-2zm.001 6c-.001 0-.001 0 0 0h-.466l-2.667-4H20l.001 4zM9.535 9 6.868 5h2.597l2.667 4H9.535zm5 0-2.667-4h2.597l2.667 4h-2.597zM4 5h.465l2.667 4H4V5zm0 14v-8h16l.002 8H4z" }, "child": [] }] })(props);
|
|
2808
|
+
}
|
|
2806
2809
|
function BiPencil(props) {
|
|
2807
2810
|
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "d": "M4 21a1 1 0 0 0 .24 0l4-1a1 1 0 0 0 .47-.26L21 7.41a2 2 0 0 0 0-2.82L19.42 3a2 2 0 0 0-2.83 0L4.3 15.29a1.06 1.06 0 0 0-.27.47l-1 4A1 1 0 0 0 3.76 21 1 1 0 0 0 4 21zM18 4.41 19.59 6 18 7.59 16.42 6zM5.91 16.51 15 7.41 16.59 9l-9.1 9.1-2.11.52z" }, "child": [] }] })(props);
|
|
2808
2811
|
}
|
|
@@ -2887,13 +2890,13 @@ var __publicField = (obj, key, value) => {
|
|
|
2887
2890
|
{
|
|
2888
2891
|
className: `rounded-lg border shadow-sm ${sizeClasses[size]} ${containerClasses[type]} ${className}`
|
|
2889
2892
|
},
|
|
2890
|
-
/* @__PURE__ */ React.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ React.createElement(
|
|
2893
|
+
/* @__PURE__ */ React.createElement("div", { className: "flex flex-col sm:flex-row items-start sm:items-center gap-2" }, /* @__PURE__ */ React.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ React.createElement(
|
|
2891
2894
|
MessageIcon,
|
|
2892
2895
|
{
|
|
2893
2896
|
type,
|
|
2894
2897
|
className: `${size === "small" ? "w-5" : "w-6"} h-auto flex-shrink-0 ${iconClasses[type]}`
|
|
2895
2898
|
}
|
|
2896
|
-
), /* @__PURE__ */ React.createElement("div", { className: `flex-1 ${textClasses[type]}` }, children), link && /* @__PURE__ */ React.createElement(
|
|
2899
|
+
), /* @__PURE__ */ React.createElement("div", { className: `flex-1 ${textClasses[type]}` }, children)), link && /* @__PURE__ */ React.createElement(
|
|
2897
2900
|
"a",
|
|
2898
2901
|
{
|
|
2899
2902
|
href: link,
|
|
@@ -3513,7 +3516,7 @@ var __publicField = (obj, key, value) => {
|
|
|
3513
3516
|
ref.current.focus();
|
|
3514
3517
|
}
|
|
3515
3518
|
}, [field == null ? void 0 : field.experimental_focusIntent, ref]);
|
|
3516
|
-
return /* @__PURE__ */ React__namespace.createElement("div", { className: "relative group" }, /* @__PURE__ */ React__namespace.createElement(
|
|
3519
|
+
return /* @__PURE__ */ React__namespace.createElement("div", { className: "relative group w-full md:w-auto" }, /* @__PURE__ */ React__namespace.createElement(
|
|
3517
3520
|
"select",
|
|
3518
3521
|
{
|
|
3519
3522
|
id: input.name,
|
|
@@ -3715,6 +3718,9 @@ var __publicField = (obj, key, value) => {
|
|
|
3715
3718
|
const isImage = (filename) => {
|
|
3716
3719
|
return /\.(gif|jpg|jpeg|tiff|png|svg|webp|avif)(\?.*)?$/i.test(filename);
|
|
3717
3720
|
};
|
|
3721
|
+
const isVideo = (filename) => {
|
|
3722
|
+
return /\.(mp4|webm|ogg|m4v|mov|avi|flv|mkv)(\?.*)?$/i.test(filename);
|
|
3723
|
+
};
|
|
3718
3724
|
const absoluteImgURL = (str) => {
|
|
3719
3725
|
if (str.startsWith("http"))
|
|
3720
3726
|
return str;
|
|
@@ -7691,6 +7697,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7691
7697
|
return fetch(input, init);
|
|
7692
7698
|
};
|
|
7693
7699
|
this.accept = DEFAULT_MEDIA_UPLOAD_TYPES;
|
|
7700
|
+
this.maxSize = 100 * 1024 * 1024;
|
|
7694
7701
|
this.parse = (img) => {
|
|
7695
7702
|
return img.src;
|
|
7696
7703
|
};
|
|
@@ -7991,6 +7998,9 @@ var __publicField = (obj, key, value) => {
|
|
|
7991
7998
|
get accept() {
|
|
7992
7999
|
return this.store.accept;
|
|
7993
8000
|
}
|
|
8001
|
+
get maxSize() {
|
|
8002
|
+
return this.store.maxSize || void 0;
|
|
8003
|
+
}
|
|
7994
8004
|
async persist(files) {
|
|
7995
8005
|
try {
|
|
7996
8006
|
this.events.dispatch({ type: "media:upload:start", uploaded: files });
|
|
@@ -9091,7 +9101,7 @@ var __publicField = (obj, key, value) => {
|
|
|
9091
9101
|
const SidebarContext = React__namespace.createContext(null);
|
|
9092
9102
|
const minPreviewWidth = 440;
|
|
9093
9103
|
const minSidebarWidth = 360;
|
|
9094
|
-
const navBreakpoint =
|
|
9104
|
+
const navBreakpoint = 1279;
|
|
9095
9105
|
const LOCALSTATEKEY = "tina.sidebarState";
|
|
9096
9106
|
const LOCALWIDTHKEY = "tina.sidebarWidth";
|
|
9097
9107
|
const defaultSidebarWidth = 440;
|
|
@@ -9562,12 +9572,12 @@ var __publicField = (obj, key, value) => {
|
|
|
9562
9572
|
return /* @__PURE__ */ React__namespace.createElement(
|
|
9563
9573
|
"div",
|
|
9564
9574
|
{
|
|
9565
|
-
className: `fixed top-0 left-0 h-
|
|
9575
|
+
className: `fixed top-0 left-0 h-dvh z-base ${displayState === "closed" ? `pointer-events-none` : ``}`
|
|
9566
9576
|
},
|
|
9567
9577
|
/* @__PURE__ */ React__namespace.createElement(
|
|
9568
9578
|
"div",
|
|
9569
9579
|
{
|
|
9570
|
-
className: `relative h-
|
|
9580
|
+
className: `relative h-dvh transform flex ${displayState !== "closed" ? `` : `-translate-x-full`} ${resizingSidebar ? `transition-none` : displayState === "closed" ? `transition-all duration-300 ease-in` : displayState === "fullscreen" ? `transition-all duration-150 ease-out` : `transition-all duration-300 ease-out`}`,
|
|
9571
9581
|
style: {
|
|
9572
9582
|
width: displayState === "fullscreen" ? "100vw" : sidebarWidth + "px",
|
|
9573
9583
|
maxWidth: displayState === "fullscreen" ? "100vw" : "calc(100vw - 8px)",
|
|
@@ -9634,7 +9644,12 @@ var __publicField = (obj, key, value) => {
|
|
|
9634
9644
|
return /* @__PURE__ */ React.createElement("div", { className: "w-full flex flex-shrink-0 justify-end gap-2 items-center" }, /* @__PURE__ */ React.createElement(Button, { variant, disabled: !hasPrev, onClick: navigatePrev }, /* @__PURE__ */ React.createElement(BiLeftArrowAlt, { className: "w-6 h-full mr-2 opacity-70" }), " Previous"), /* @__PURE__ */ React.createElement(Button, { variant, disabled: !hasNext, onClick: navigateNext }, "Next ", /* @__PURE__ */ React.createElement(BiRightArrowAlt, { className: "w-6 h-full ml-2 opacity-70" })));
|
|
9635
9645
|
}
|
|
9636
9646
|
function ListMediaItem({ item, onClick, active }) {
|
|
9637
|
-
|
|
9647
|
+
let FileIcon = BiFile;
|
|
9648
|
+
if (item.type === "dir") {
|
|
9649
|
+
FileIcon = BiFolder;
|
|
9650
|
+
} else if (isVideo(item.src)) {
|
|
9651
|
+
FileIcon = BiMovie;
|
|
9652
|
+
}
|
|
9638
9653
|
const thumbnail = (item.thumbnails || {})["75x75"];
|
|
9639
9654
|
return /* @__PURE__ */ React.createElement(
|
|
9640
9655
|
"li",
|
|
@@ -9667,7 +9682,12 @@ var __publicField = (obj, key, value) => {
|
|
|
9667
9682
|
);
|
|
9668
9683
|
}
|
|
9669
9684
|
function GridMediaItem({ item, active, onClick }) {
|
|
9670
|
-
|
|
9685
|
+
let FileIcon = BiFile;
|
|
9686
|
+
if (item.type === "dir") {
|
|
9687
|
+
FileIcon = BiFolder;
|
|
9688
|
+
} else if (isVideo(item.src)) {
|
|
9689
|
+
FileIcon = BiMovie;
|
|
9690
|
+
}
|
|
9671
9691
|
const thumbnail = (item.thumbnails || {})["400x400"];
|
|
9672
9692
|
return /* @__PURE__ */ React.createElement(
|
|
9673
9693
|
"li",
|
|
@@ -9876,6 +9896,7 @@ var __publicField = (obj, key, value) => {
|
|
|
9876
9896
|
close: close2,
|
|
9877
9897
|
...props
|
|
9878
9898
|
}) {
|
|
9899
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
9879
9900
|
const cms = useCMS();
|
|
9880
9901
|
const [listState, setListState] = React.useState(() => {
|
|
9881
9902
|
if (cms.media.isConfigured)
|
|
@@ -9970,10 +9991,14 @@ var __publicField = (obj, key, value) => {
|
|
|
9970
9991
|
};
|
|
9971
9992
|
}
|
|
9972
9993
|
const [uploading, setUploading] = React.useState(false);
|
|
9994
|
+
const accept = Array.isArray(
|
|
9995
|
+
(_c = (_b = (_a = cms.api.tina.schema.schema) == null ? void 0 : _a.config) == null ? void 0 : _b.media) == null ? void 0 : _c.accept
|
|
9996
|
+
) ? (_f = (_e = (_d = cms.api.tina.schema.schema) == null ? void 0 : _d.config) == null ? void 0 : _e.media) == null ? void 0 : _f.accept.join(",") : (_i = (_h = (_g = cms.api.tina.schema.schema) == null ? void 0 : _g.config) == null ? void 0 : _h.media) == null ? void 0 : _i.accept;
|
|
9973
9997
|
const { getRootProps, getInputProps, isDragActive } = useDropzone({
|
|
9974
9998
|
accept: dropzoneAcceptFromString(
|
|
9975
|
-
cms.media.accept || DEFAULT_MEDIA_UPLOAD_TYPES
|
|
9999
|
+
accept || cms.media.accept || DEFAULT_MEDIA_UPLOAD_TYPES
|
|
9976
10000
|
),
|
|
10001
|
+
maxSize: cms.media.maxSize,
|
|
9977
10002
|
multiple: true,
|
|
9978
10003
|
onDrop: async (files, fileRejections) => {
|
|
9979
10004
|
try {
|
|
@@ -11070,16 +11095,13 @@ var __publicField = (obj, key, value) => {
|
|
|
11070
11095
|
const openModal = () => setOpen(true);
|
|
11071
11096
|
const { currentBranch } = useBranchData();
|
|
11072
11097
|
const isProtected = cms.api.tina.usingProtectedBranch();
|
|
11073
|
-
const navBreakpoint2 = 1e3;
|
|
11074
|
-
const windowWidth = windowSize.useWindowWidth();
|
|
11075
|
-
const renderNavToggle = windowWidth < navBreakpoint2 + 1;
|
|
11076
11098
|
const previewFunction = (_d = (_c = (_b = (_a = cms.api.tina.schema) == null ? void 0 : _a.config) == null ? void 0 : _b.config) == null ? void 0 : _c.ui) == null ? void 0 : _d.previewUrl;
|
|
11077
11099
|
const branch = decodeURIComponent(cms.api.tina.branch);
|
|
11078
11100
|
const previewUrl = previewFunction ? (_e = previewFunction({ branch })) == null ? void 0 : _e.url : null;
|
|
11079
11101
|
return /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, /* @__PURE__ */ React__namespace.createElement(
|
|
11080
11102
|
"div",
|
|
11081
11103
|
{
|
|
11082
|
-
className: `w-full bg-white flex items-center gap-2 -mb-px border-b border-gray-100 py-3 pr-4
|
|
11104
|
+
className: `w-full bg-white flex items-center gap-2 -mb-px border-b border-gray-100 py-3 pr-4 pl-20 xl:pl-4`
|
|
11083
11105
|
},
|
|
11084
11106
|
/* @__PURE__ */ React__namespace.createElement(
|
|
11085
11107
|
Button,
|
|
@@ -11341,7 +11363,7 @@ var __publicField = (obj, key, value) => {
|
|
|
11341
11363
|
);
|
|
11342
11364
|
};
|
|
11343
11365
|
const FormStatus = ({ pristine }) => {
|
|
11344
|
-
return /* @__PURE__ */ React__namespace.createElement("div", { className: "flex flex-0 items-center" }, !pristine && /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, /* @__PURE__ */ React__namespace.createElement("
|
|
11366
|
+
return /* @__PURE__ */ React__namespace.createElement("div", { className: "flex flex-0 items-center" }, !pristine && /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, /* @__PURE__ */ React__namespace.createElement("p", { className: "text-gray-500 text-xs leading-tight whitespace-nowrap mr-2" }, "Unsaved Changes"), /* @__PURE__ */ React__namespace.createElement("span", { className: "w-3 h-3 flex-0 rounded-full bg-red-300 border border-red-400" }), " "), pristine && /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, /* @__PURE__ */ React__namespace.createElement("span", { className: "w-3 h-3 flex-0 rounded-full bg-green-300 border border-green-400" }), " "));
|
|
11345
11367
|
};
|
|
11346
11368
|
const FormWrapper = ({
|
|
11347
11369
|
header,
|
|
@@ -11355,7 +11377,7 @@ var __publicField = (obj, key, value) => {
|
|
|
11355
11377
|
className: "h-full overflow-y-auto max-h-full bg-gray-50"
|
|
11356
11378
|
},
|
|
11357
11379
|
header,
|
|
11358
|
-
/* @__PURE__ */ React__namespace.createElement("div", { className: "py-5 px-6" }, /* @__PURE__ */ React__namespace.createElement("div", { className: "w-full flex justify-center" }, /* @__PURE__ */ React__namespace.createElement("div", { className: "w-full
|
|
11380
|
+
/* @__PURE__ */ React__namespace.createElement("div", { className: "py-5 px-6 xl:px-12" }, /* @__PURE__ */ React__namespace.createElement("div", { className: "w-full flex justify-center" }, /* @__PURE__ */ React__namespace.createElement("div", { className: "w-full" }, children)))
|
|
11359
11381
|
);
|
|
11360
11382
|
};
|
|
11361
11383
|
const Emoji = ({ className = "", ...props }) => /* @__PURE__ */ React__namespace.createElement(
|
|
@@ -13055,7 +13077,7 @@ var __publicField = (obj, key, value) => {
|
|
|
13055
13077
|
function ErrorMessage({ error }) {
|
|
13056
13078
|
const message = buildErrorMessage(error);
|
|
13057
13079
|
const { setRawMode } = useEditorContext();
|
|
13058
|
-
return /* @__PURE__ */ React.createElement("div", { contentEditable: false, className: "bg-red-50 sm:rounded-lg" }, /* @__PURE__ */ React.createElement("div", { className: "px-4 py-5 sm:p-6" }, /* @__PURE__ */ React.createElement("h3", { className: "text-lg leading-6 font-medium text-red-800" }, "Error parsing markdown"), /* @__PURE__ */ React.createElement("div", { className: "mt-2 max-w-xl text-sm text-red-800 space-y-4" }, /* @__PURE__ */ React.createElement("p", null, message), /* @__PURE__ */ React.createElement("p", null, "To fix these errors, edit the content in raw-mode."), /* @__PURE__ */ React.createElement(
|
|
13080
|
+
return /* @__PURE__ */ React.createElement("div", { contentEditable: false, className: "bg-red-50 sm:rounded-lg" }, /* @__PURE__ */ React.createElement("div", { className: "px-4 py-5 sm:p-6" }, /* @__PURE__ */ React.createElement("h3", { className: "text-lg leading-6 font-medium text-red-800" }, "❌ Error parsing markdown"), /* @__PURE__ */ React.createElement("div", { className: "mt-2 max-w-xl text-sm text-red-800 space-y-4" }, /* @__PURE__ */ React.createElement("p", null, message), /* @__PURE__ */ React.createElement("p", null, "To fix these errors, edit the content in raw-mode."), /* @__PURE__ */ React.createElement(
|
|
13059
13081
|
"button",
|
|
13060
13082
|
{
|
|
13061
13083
|
onClick: () => setRawMode(true),
|
|
@@ -28025,7 +28047,7 @@ mutation addPendingDocumentMutation(
|
|
|
28025
28047
|
});
|
|
28026
28048
|
}
|
|
28027
28049
|
};
|
|
28028
|
-
let modalTitle = "Tina Cloud
|
|
28050
|
+
let modalTitle = "Tina Cloud";
|
|
28029
28051
|
if (activeModal === "authenticate" && loginStrategy === "Redirect" && !isTinaCloud) {
|
|
28030
28052
|
modalTitle = "Enter into edit mode";
|
|
28031
28053
|
} else if (activeModal === "authenticate" && loginStrategy === "UsernamePassword") {
|
|
@@ -28041,20 +28063,12 @@ mutation addPendingDocumentMutation(
|
|
|
28041
28063
|
ModalBuilder,
|
|
28042
28064
|
{
|
|
28043
28065
|
title: modalTitle,
|
|
28044
|
-
message: isTinaCloud ? "
|
|
28066
|
+
message: isTinaCloud ? "Your site uses Tina Cloud 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.",
|
|
28045
28067
|
close,
|
|
28046
28068
|
actions: [
|
|
28047
28069
|
...otherModalActions,
|
|
28048
28070
|
{
|
|
28049
|
-
|
|
28050
|
-
sharedctx.setEditing(false);
|
|
28051
|
-
window.location.reload();
|
|
28052
|
-
},
|
|
28053
|
-
name: "Close",
|
|
28054
|
-
primary: false
|
|
28055
|
-
},
|
|
28056
|
-
{
|
|
28057
|
-
name: isTinaCloud ? "Continue to Tina Cloud" : "Enter Edit Mode",
|
|
28071
|
+
name: isTinaCloud ? "Log in" : "Enter Edit Mode",
|
|
28058
28072
|
action: handleAuthenticate,
|
|
28059
28073
|
primary: true
|
|
28060
28074
|
}
|
|
@@ -28808,7 +28822,7 @@ This will work when developing locally but NOT when deployed to production.
|
|
|
28808
28822
|
const cloudConfigs = cms.plugins.getType("cloud-config").all();
|
|
28809
28823
|
const [menuIsOpen, setMenuIsOpen] = React.useState(false);
|
|
28810
28824
|
const isLocalMode = (_b = (_a = cms.api) == null ? void 0 : _a.tina) == null ? void 0 : _b.isLocalMode;
|
|
28811
|
-
const navBreakpoint2 =
|
|
28825
|
+
const navBreakpoint2 = 1279;
|
|
28812
28826
|
const windowWidth = windowSize.useWindowWidth();
|
|
28813
28827
|
const renderDesktopNav = windowWidth > navBreakpoint2;
|
|
28814
28828
|
const activeScreens = screens.filter(
|
|
@@ -29115,14 +29129,14 @@ This will work when developing locally but NOT when deployed to production.
|
|
|
29115
29129
|
isLocalMode,
|
|
29116
29130
|
children
|
|
29117
29131
|
}) => {
|
|
29118
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, isLocalMode && /* @__PURE__ */ React.createElement(LocalWarning, null), !isLocalMode && /* @__PURE__ */ React.createElement(BillingWarning, null), /* @__PURE__ */ React.createElement("div", { className: "pt-12 px-12" }, /* @__PURE__ */ React.createElement("div", { className: "w-full mx-auto max-w-screen-xl" }, /* @__PURE__ */ React.createElement("div", { className: "w-full flex justify-between items-end" }, children))));
|
|
29132
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, isLocalMode && /* @__PURE__ */ React.createElement(LocalWarning, null), !isLocalMode && /* @__PURE__ */ React.createElement(BillingWarning, null), /* @__PURE__ */ React.createElement("div", { className: "pt-16 xl:pt-12 px-6 xl:px-12" }, /* @__PURE__ */ React.createElement("div", { className: "w-full mx-auto max-w-screen-xl" }, /* @__PURE__ */ React.createElement("div", { className: "w-full flex justify-between items-end" }, children))));
|
|
29119
29133
|
};
|
|
29120
29134
|
const PageBody = ({
|
|
29121
29135
|
children
|
|
29122
|
-
}) => /* @__PURE__ */ React.createElement("div", { className: "py-8 px-12" }, children);
|
|
29136
|
+
}) => /* @__PURE__ */ React.createElement("div", { className: "py-8 px-6 xl:px-12" }, children);
|
|
29123
29137
|
const PageBodyNarrow = ({
|
|
29124
29138
|
children
|
|
29125
|
-
}) => /* @__PURE__ */ React.createElement("div", { className: "py-10 px-12" }, /* @__PURE__ */ React.createElement("div", { className: "w-full mx-auto max-w-screen-xl" }, children));
|
|
29139
|
+
}) => /* @__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));
|
|
29126
29140
|
const DashboardPage = () => {
|
|
29127
29141
|
return /* @__PURE__ */ React.createElement(GetCMS, null, (cms) => {
|
|
29128
29142
|
var _a, _b;
|
|
@@ -29637,7 +29651,6 @@ This will work when developing locally but NOT when deployed to production.
|
|
|
29637
29651
|
},
|
|
29638
29652
|
(collection, _loading, reFetchCollection, collectionExtra) => {
|
|
29639
29653
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
|
|
29640
|
-
collection.documents.totalCount;
|
|
29641
29654
|
const documents = collection.documents.edges;
|
|
29642
29655
|
const admin = cms.api.admin;
|
|
29643
29656
|
const pageInfo = collection.documents.pageInfo;
|
|
@@ -29771,7 +29784,7 @@ This will work when developing locally but NOT when deployed to production.
|
|
|
29771
29784
|
},
|
|
29772
29785
|
close: () => setFolderModalOpen(false)
|
|
29773
29786
|
}
|
|
29774
|
-
), /* @__PURE__ */ React.createElement(PageHeader, { isLocalMode: (_l = (_k = cms == null ? void 0 : cms.api) == null ? void 0 : _k.tina) == null ? void 0 : _l.isLocalMode }, /* @__PURE__ */ React.createElement("div", { className: "w-full
|
|
29787
|
+
), /* @__PURE__ */ React.createElement(PageHeader, { isLocalMode: (_l = (_k = cms == null ? void 0 : cms.api) == null ? void 0 : _k.tina) == null ? void 0 : _l.isLocalMode }, /* @__PURE__ */ React.createElement("div", { className: "w-full" }, /* @__PURE__ */ React.createElement("h3", { className: "font-sans text-2xl text-gray-700" }, collection.label ? collection.label : collection.name), /* @__PURE__ */ React.createElement("div", { className: "flex flex-col lg:flex-row justify-between lg:items-end pt-2" }, /* @__PURE__ */ React.createElement("div", { className: "flex flex-col md:flex-row gap-2 md:gap-4 items-start" }, (fields == null ? void 0 : fields.length) > 0 && /* @__PURE__ */ React.createElement(React.Fragment, null, !search && /* @__PURE__ */ React.createElement("div", { className: "flex flex-col gap-2 items-start w-full md:w-auto" }, /* @__PURE__ */ React.createElement(
|
|
29775
29788
|
"label",
|
|
29776
29789
|
{
|
|
29777
29790
|
htmlFor: "sort",
|
|
@@ -29842,7 +29855,7 @@ This will work when developing locally but NOT when deployed to production.
|
|
|
29842
29855
|
size: "small"
|
|
29843
29856
|
},
|
|
29844
29857
|
"Search not configured."
|
|
29845
|
-
))))
|
|
29858
|
+
)))), /* @__PURE__ */ React.createElement("div", { className: "flex flex-col md:flex-row items-start md:items-end gap-2 md:gap-0 pt-4 lg:pt-0" }, !collection.templates && allowCreate && /* @__PURE__ */ React.createElement(React.Fragment, null, allowCreateNestedFolder && /* @__PURE__ */ React.createElement(
|
|
29846
29859
|
reactRouterDom.Link,
|
|
29847
29860
|
{
|
|
29848
29861
|
onMouseDown: (evt) => {
|
|
@@ -29855,7 +29868,7 @@ This will work when developing locally but NOT when deployed to production.
|
|
|
29855
29868
|
evt.stopPropagation();
|
|
29856
29869
|
},
|
|
29857
29870
|
to: "/collections/new-folder",
|
|
29858
|
-
className: "icon-parent inline-flex items-center font-medium focus:outline-none focus:ring-2 focus:shadow-outline text-center rounded-full justify-center transition-all duration-150 ease-out whitespace-nowrap shadow text-blue-500 bg-white hover:bg-[#f1f5f9] focus:ring-white focus:ring-blue-500 text-sm h-10 px-6 mr-4"
|
|
29871
|
+
className: "icon-parent inline-flex items-center font-medium focus:outline-none focus:ring-2 focus:shadow-outline text-center rounded-full justify-center transition-all duration-150 ease-out whitespace-nowrap shadow text-blue-500 bg-white hover:bg-[#f1f5f9] focus:ring-white focus:ring-blue-500 w-full md:w-auto text-sm h-10 px-6 mr-4"
|
|
29859
29872
|
},
|
|
29860
29873
|
/* @__PURE__ */ React.createElement(FaFolder, { className: "mr-2" }),
|
|
29861
29874
|
"Add Folder",
|
|
@@ -29874,7 +29887,7 @@ This will work when developing locally but NOT when deployed to production.
|
|
|
29874
29887
|
"new",
|
|
29875
29888
|
collectionName
|
|
29876
29889
|
].join("/")}`,
|
|
29877
|
-
className: "inline-flex items-center font-medium focus:outline-none focus:ring-2 focus:shadow-outline text-center rounded-full justify-center transition-all duration-150 ease-out whitespace-nowrap shadow text-white bg-blue-500 hover:bg-blue-600 text-sm h-10 px-6"
|
|
29890
|
+
className: "inline-flex items-center font-medium focus:outline-none focus:ring-2 focus:shadow-outline text-center rounded-full justify-center transition-all duration-150 ease-out whitespace-nowrap shadow text-white bg-blue-500 hover:bg-blue-600 w-full md:w-auto text-sm h-10 px-6"
|
|
29878
29891
|
},
|
|
29879
29892
|
/* @__PURE__ */ React.createElement(FaFile, { className: "mr-2" }),
|
|
29880
29893
|
"Add Files",
|
|
@@ -29886,7 +29899,7 @@ This will work when developing locally but NOT when deployed to production.
|
|
|
29886
29899
|
templates: collection.templates,
|
|
29887
29900
|
folder
|
|
29888
29901
|
}
|
|
29889
|
-
)))), /* @__PURE__ */ React.createElement(PageBody, null, /* @__PURE__ */ React.createElement("div", { className: "w-full mx-auto max-w-screen-xl" }, sortField && !sortField.required && /* @__PURE__ */ React.createElement("p", { className: "mb-4 text-gray-500" }, /* @__PURE__ */ React.createElement("em", null, "Sorting on a non-required field. Some documents may be excluded (if they don't have a value for", " ", sortName, ")")), (folder.name && !search || documents.length > 0) && /* @__PURE__ */ React.createElement("table", { className: "table-auto shadow bg-white border-b border-gray-200 w-full max-w-full rounded-lg" }, /* @__PURE__ */ React.createElement("tbody", { className: "divide-y divide-gray-150" }, folder.name && !search ? /* @__PURE__ */ React.createElement("tr", null, /* @__PURE__ */ React.createElement("td", { colSpan: 5 }, /* @__PURE__ */ React.createElement(
|
|
29902
|
+
))))), /* @__PURE__ */ React.createElement(PageBody, null, /* @__PURE__ */ React.createElement("div", { className: "w-full mx-auto max-w-screen-xl" }, sortField && !sortField.required && /* @__PURE__ */ React.createElement("p", { className: "mb-4 text-gray-500" }, /* @__PURE__ */ React.createElement("em", null, "Sorting on a non-required field. Some documents may be excluded (if they don't have a value for", " ", sortName, ")")), /* @__PURE__ */ React.createElement("div", { className: "w-full overflow-x-auto" }, (folder.name && !search || documents.length > 0) && /* @__PURE__ */ React.createElement("table", { className: "table-auto shadow bg-white border-b border-gray-200 w-full max-w-full rounded-lg" }, /* @__PURE__ */ React.createElement("tbody", { className: "divide-y divide-gray-150" }, folder.name && !search ? /* @__PURE__ */ React.createElement("tr", null, /* @__PURE__ */ React.createElement("td", { colSpan: 5 }, /* @__PURE__ */ React.createElement(
|
|
29890
29903
|
Breadcrumb,
|
|
29891
29904
|
{
|
|
29892
29905
|
folder,
|
|
@@ -29896,34 +29909,33 @@ This will work when developing locally but NOT when deployed to production.
|
|
|
29896
29909
|
))) : null, documents.length > 0 && documents.map((document2) => {
|
|
29897
29910
|
var _a2;
|
|
29898
29911
|
if (document2.node.__typename === "Folder") {
|
|
29899
|
-
return /* @__PURE__ */ React.createElement(
|
|
29900
|
-
"
|
|
29901
|
-
{
|
|
29902
|
-
className: "text-blue-600 hover:text-blue-400 flex items-center gap-3 cursor-pointer truncate",
|
|
29903
|
-
onClick: () => {
|
|
29904
|
-
navigate(
|
|
29905
|
-
`/${[
|
|
29906
|
-
"collections",
|
|
29907
|
-
collectionName,
|
|
29908
|
-
document2.node.path
|
|
29909
|
-
].join("/")}`,
|
|
29910
|
-
{ replace: true }
|
|
29911
|
-
);
|
|
29912
|
-
}
|
|
29913
|
-
},
|
|
29914
|
-
/* @__PURE__ */ React.createElement(BiFolder, { className: "inline-block h-6 w-auto flex-shrink-0 opacity-70" }),
|
|
29915
|
-
/* @__PURE__ */ React.createElement("span", { className: "truncate block" }, /* @__PURE__ */ React.createElement("span", { className: "block text-xs text-gray-400 mb-1 uppercase" }, "Name"), /* @__PURE__ */ React.createElement("span", { className: "h-5 leading-5 block truncate" }, /* @__PURE__ */ React.createElement("span", null, document2.node.name)))
|
|
29916
|
-
)), /* @__PURE__ */ React.createElement(
|
|
29917
|
-
"td",
|
|
29912
|
+
return /* @__PURE__ */ React.createElement(
|
|
29913
|
+
"tr",
|
|
29918
29914
|
{
|
|
29919
|
-
|
|
29920
|
-
colSpan: 4
|
|
29915
|
+
key: `folder-${document2.node.path}`
|
|
29921
29916
|
},
|
|
29922
|
-
/* @__PURE__ */ React.createElement("
|
|
29923
|
-
|
|
29917
|
+
/* @__PURE__ */ React.createElement("td", { className: "pl-5 pr-3 py-3" }, /* @__PURE__ */ React.createElement(
|
|
29918
|
+
"a",
|
|
29919
|
+
{
|
|
29920
|
+
className: "text-blue-600 hover:text-blue-400 flex items-center gap-3 cursor-pointer truncate",
|
|
29921
|
+
onClick: () => {
|
|
29922
|
+
navigate(
|
|
29923
|
+
`/${[
|
|
29924
|
+
"collections",
|
|
29925
|
+
collectionName,
|
|
29926
|
+
document2.node.path
|
|
29927
|
+
].join("/")}`,
|
|
29928
|
+
{ replace: true }
|
|
29929
|
+
);
|
|
29930
|
+
}
|
|
29931
|
+
},
|
|
29932
|
+
/* @__PURE__ */ React.createElement(BiFolder, { className: "inline-block h-6 w-auto flex-shrink-0 opacity-70" }),
|
|
29933
|
+
/* @__PURE__ */ React.createElement("span", { className: "truncate block" }, /* @__PURE__ */ React.createElement("span", { className: "block text-xs text-gray-400 mb-1 uppercase" }, "Name"), /* @__PURE__ */ React.createElement("span", { className: "h-5 leading-5 block truncate" }, /* @__PURE__ */ React.createElement("span", null, document2.node.name)))
|
|
29934
|
+
)),
|
|
29935
|
+
/* @__PURE__ */ React.createElement("td", { className: "px-3 py-3", colSpan: 4 }, /* @__PURE__ */ React.createElement("span", { className: "block text-xs text-gray-400 mb-1 uppercase" }, "Path"), /* @__PURE__ */ React.createElement("span", { className: "leading-5 block text-sm font-medium text-gray-900 truncate" }, document2.node.path.substring(2).split("/").map((node) => {
|
|
29924
29936
|
return /* @__PURE__ */ React.createElement("span", { key: node }, /* @__PURE__ */ React.createElement("span", { className: "text-gray-300 pr-0.5" }, "/"), /* @__PURE__ */ React.createElement("span", { className: "pr-0.5" }, node));
|
|
29925
|
-
}))
|
|
29926
|
-
)
|
|
29937
|
+
})))
|
|
29938
|
+
);
|
|
29927
29939
|
}
|
|
29928
29940
|
const hasTitle = Boolean(
|
|
29929
29941
|
document2.node._sys.title
|
|
@@ -29932,13 +29944,12 @@ This will work when developing locally but NOT when deployed to production.
|
|
|
29932
29944
|
return /* @__PURE__ */ React.createElement(
|
|
29933
29945
|
"tr",
|
|
29934
29946
|
{
|
|
29935
|
-
key: `document-${document2.node._sys.relativePath}
|
|
29936
|
-
className: ""
|
|
29947
|
+
key: `document-${document2.node._sys.relativePath}`
|
|
29937
29948
|
},
|
|
29938
29949
|
/* @__PURE__ */ React.createElement(
|
|
29939
29950
|
"td",
|
|
29940
29951
|
{
|
|
29941
|
-
className: "pl-5 pr-3 py-3
|
|
29952
|
+
className: "pl-5 pr-3 py-3",
|
|
29942
29953
|
colSpan: hasTitle ? 1 : 2
|
|
29943
29954
|
},
|
|
29944
29955
|
/* @__PURE__ */ React.createElement(
|
|
@@ -29959,9 +29970,9 @@ This will work when developing locally but NOT when deployed to production.
|
|
|
29959
29970
|
/* @__PURE__ */ React.createElement("span", { className: "truncate block" }, /* @__PURE__ */ React.createElement("span", { className: "block text-xs text-gray-400 mb-1 uppercase" }, hasTitle ? "Title" : "Filename"), /* @__PURE__ */ React.createElement("span", { className: "h-5 leading-5 block truncate" }, !folderView && !hasTitle && subfolders && /* @__PURE__ */ React.createElement("span", { className: "text-xs text-gray-400" }, `${subfolders}/`), /* @__PURE__ */ React.createElement("span", null, hasTitle ? (_a2 = document2.node._sys) == null ? void 0 : _a2.title : document2.node._sys.filename)))
|
|
29960
29971
|
)
|
|
29961
29972
|
),
|
|
29962
|
-
hasTitle && /* @__PURE__ */ React.createElement("td", { className: "px-3 py-3
|
|
29963
|
-
/* @__PURE__ */ React.createElement("td", { className: "px-3 py-3
|
|
29964
|
-
/* @__PURE__ */ React.createElement("td", { className: "px-3 py-3
|
|
29973
|
+
hasTitle && /* @__PURE__ */ React.createElement("td", { className: "px-3 py-3" }, /* @__PURE__ */ React.createElement("span", { className: "block text-xs text-gray-400 mb-1 uppercase" }, "Filename"), /* @__PURE__ */ React.createElement("span", { className: "h-5 leading-5 block text-sm font-medium text-gray-900 truncate" }, !folderView && subfolders && /* @__PURE__ */ React.createElement("span", { className: "text-xs text-gray-400" }, `${subfolders}/`), /* @__PURE__ */ React.createElement("span", null, document2.node._sys.filename))),
|
|
29974
|
+
/* @__PURE__ */ React.createElement("td", { className: "px-3 py-3" }, /* @__PURE__ */ React.createElement("span", { className: "block text-xs text-gray-400 mb-1 uppercase" }, "Extension"), /* @__PURE__ */ React.createElement("span", { className: "h-5 leading-5 block text-sm font-medium text-gray-900" }, document2.node._sys.extension)),
|
|
29975
|
+
/* @__PURE__ */ React.createElement("td", { className: "px-3 py-3" }, /* @__PURE__ */ React.createElement("span", { className: "block text-xs text-gray-400 mb-1 uppercase" }, "Template"), /* @__PURE__ */ React.createElement("span", { className: "h-5 leading-5 block text-sm font-medium text-gray-900" }, document2.node._sys.template)),
|
|
29965
29976
|
/* @__PURE__ */ React.createElement("td", { className: "w-0" }, /* @__PURE__ */ React.createElement(
|
|
29966
29977
|
OverflowMenu$1,
|
|
29967
29978
|
{
|
|
@@ -30054,7 +30065,7 @@ This will work when developing locally but NOT when deployed to production.
|
|
|
30054
30065
|
}
|
|
30055
30066
|
))
|
|
30056
30067
|
);
|
|
30057
|
-
}))), documents.length === 0 && /* @__PURE__ */ React.createElement(NoDocumentsPlaceholder, null), /* @__PURE__ */ React.createElement("div", { className: "pt-4" }, /* @__PURE__ */ React.createElement(
|
|
30068
|
+
})))), documents.length === 0 && /* @__PURE__ */ React.createElement(NoDocumentsPlaceholder, null), /* @__PURE__ */ React.createElement("div", { className: "pt-4" }, /* @__PURE__ */ React.createElement(
|
|
30058
30069
|
CursorPaginator,
|
|
30059
30070
|
{
|
|
30060
30071
|
variant: "white",
|
|
@@ -30101,7 +30112,7 @@ This will work when developing locally but NOT when deployed to production.
|
|
|
30101
30112
|
className: "block font-sans text-xs font-semibold text-gray-500 whitespace-normal"
|
|
30102
30113
|
},
|
|
30103
30114
|
"Search"
|
|
30104
|
-
), /* @__PURE__ */ React.createElement("div", { className: "flex flex-
|
|
30115
|
+
), /* @__PURE__ */ React.createElement("div", { className: "flex flex-col md:flex-row items-start md:items-center w-full md:w-auto gap-3" }, /* @__PURE__ */ React.createElement("div", { className: "flex-1 min-w-[200px] w-full md:w-auto" }, /* @__PURE__ */ React.createElement(
|
|
30105
30116
|
Input,
|
|
30106
30117
|
{
|
|
30107
30118
|
type: "text",
|
|
@@ -30112,14 +30123,15 @@ This will work when developing locally but NOT when deployed to production.
|
|
|
30112
30123
|
setSearchInput(e.target.value);
|
|
30113
30124
|
}
|
|
30114
30125
|
}
|
|
30115
|
-
)), /* @__PURE__ */ React.createElement("div", { className: "flex gap-3" }, /* @__PURE__ */ React.createElement(
|
|
30126
|
+
)), /* @__PURE__ */ React.createElement("div", { className: "flex w-full md:w-auto gap-3" }, /* @__PURE__ */ React.createElement(
|
|
30116
30127
|
Button,
|
|
30117
30128
|
{
|
|
30118
30129
|
onClick: () => {
|
|
30119
30130
|
setSearch(searchInput);
|
|
30120
30131
|
setSearchLoaded(false);
|
|
30121
30132
|
},
|
|
30122
|
-
variant: "primary"
|
|
30133
|
+
variant: "primary",
|
|
30134
|
+
className: "w-full md:w-auto"
|
|
30123
30135
|
},
|
|
30124
30136
|
"Search ",
|
|
30125
30137
|
/* @__PURE__ */ React.createElement(BiSearch, { className: "w-5 h-full ml-1.5 opacity-70" })
|
|
@@ -30539,10 +30551,6 @@ This will work when developing locally but NOT when deployed to production.
|
|
|
30539
30551
|
}
|
|
30540
30552
|
});
|
|
30541
30553
|
}, [cms, collection, mutationInfo]);
|
|
30542
|
-
const navBreakpoint2 = 1e3;
|
|
30543
|
-
const windowWidth = windowSize.useWindowWidth();
|
|
30544
|
-
const renderNavToggle = windowWidth < navBreakpoint2 + 1;
|
|
30545
|
-
const headerPadding = renderNavToggle ? "px-20" : "px-6";
|
|
30546
30554
|
React.useEffect(() => {
|
|
30547
30555
|
cms.dispatch({ type: "forms:add", value: form });
|
|
30548
30556
|
cms.dispatch({ type: "forms:set-active-form-id", value: form.id });
|
|
@@ -30560,9 +30568,9 @@ This will work when developing locally but NOT when deployed to production.
|
|
|
30560
30568
|
return /* @__PURE__ */ React.createElement(PageWrapper, null, /* @__PURE__ */ React.createElement(React.Fragment, null, ((_f = (_e = cms == null ? void 0 : cms.api) == null ? void 0 : _e.tina) == null ? void 0 : _f.isLocalMode) ? /* @__PURE__ */ React.createElement(LocalWarning, null) : /* @__PURE__ */ React.createElement(BillingWarning, null), /* @__PURE__ */ React.createElement(
|
|
30561
30569
|
"div",
|
|
30562
30570
|
{
|
|
30563
|
-
className: `pt-3 pb-4 border-b border-gray-200 bg-white w-full grow-0 shrink basis-0 flex justify-center
|
|
30571
|
+
className: `pt-10 xl:pt-3 pb-10 xl:pb-4 px-20 xl:px-12 border-b border-gray-200 bg-white w-full grow-0 shrink basis-0 flex justify-center`
|
|
30564
30572
|
},
|
|
30565
|
-
/* @__PURE__ */ React.createElement("div", { className: "w-full
|
|
30573
|
+
/* @__PURE__ */ React.createElement("div", { className: "w-full flex gap-1.5 justify-between items-center" }, /* @__PURE__ */ React.createElement(
|
|
30566
30574
|
reactRouterDom.Link,
|
|
30567
30575
|
{
|
|
30568
30576
|
to: `/collections/${collection.name}${folder.fullyQualifiedName ? `/${folder.fullyQualifiedName}` : ""}`,
|
|
@@ -30770,10 +30778,6 @@ This will work when developing locally but NOT when deployed to production.
|
|
|
30770
30778
|
}
|
|
30771
30779
|
});
|
|
30772
30780
|
}, [cms, document2, relativePath2, collection, mutationInfo]);
|
|
30773
|
-
const navBreakpoint2 = 1e3;
|
|
30774
|
-
const windowWidth = windowSize.useWindowWidth();
|
|
30775
|
-
const renderNavToggle = windowWidth < navBreakpoint2 + 1;
|
|
30776
|
-
const headerPadding = renderNavToggle ? "px-20" : "px-6";
|
|
30777
30781
|
React.useEffect(() => {
|
|
30778
30782
|
cms.dispatch({ type: "forms:add", value: form });
|
|
30779
30783
|
cms.dispatch({ type: "forms:set-active-form-id", value: form.id });
|
|
@@ -30791,9 +30795,9 @@ This will work when developing locally but NOT when deployed to production.
|
|
|
30791
30795
|
return /* @__PURE__ */ React.createElement(React.Fragment, null, ((_b = (_a = cms == null ? void 0 : cms.api) == null ? void 0 : _a.tina) == null ? void 0 : _b.isLocalMode) ? /* @__PURE__ */ React.createElement(LocalWarning, null) : /* @__PURE__ */ React.createElement(BillingWarning, null), /* @__PURE__ */ React.createElement(
|
|
30792
30796
|
"div",
|
|
30793
30797
|
{
|
|
30794
|
-
className: `pt-3 pb-4 border-b border-gray-200 bg-white w-full grow-0 shrink basis-0 flex justify-center
|
|
30798
|
+
className: `pt-10 xl:pt-3 pb-10 xl:pb-4 px-20 xl:px-12 border-b border-gray-200 bg-white w-full grow-0 shrink basis-0 flex justify-center`
|
|
30795
30799
|
},
|
|
30796
|
-
/* @__PURE__ */ React.createElement("div", { className: "w-full
|
|
30800
|
+
/* @__PURE__ */ React.createElement("div", { className: "w-full flex gap-1.5 justify-between items-center" }, /* @__PURE__ */ React.createElement(
|
|
30797
30801
|
reactRouterDom.Link,
|
|
30798
30802
|
{
|
|
30799
30803
|
to: `/collections/${collection.name}/~${parentFolder2}`,
|
|
@@ -30805,16 +30809,19 @@ This will work when developing locally but NOT when deployed to production.
|
|
|
30805
30809
|
};
|
|
30806
30810
|
const ScreenPage = () => {
|
|
30807
30811
|
const { screenName } = reactRouterDom.useParams();
|
|
30808
|
-
const navBreakpoint2 = 1e3;
|
|
30809
|
-
const windowWidth = windowSize.useWindowWidth();
|
|
30810
|
-
const renderNavToggle = windowWidth < navBreakpoint2 + 1;
|
|
30811
30812
|
return /* @__PURE__ */ React.createElement(GetCMS, null, (cms) => {
|
|
30812
30813
|
var _a, _b;
|
|
30813
30814
|
const screens = cms.plugins.getType("screen").all();
|
|
30814
30815
|
const selectedScreen = screens.find(
|
|
30815
30816
|
({ name }) => slugify(name) === screenName
|
|
30816
30817
|
);
|
|
30817
|
-
return /* @__PURE__ */ React.createElement("div", { className: "relative w-full h-full flex flex-col items-stretch justify-between" }, ((_b = (_a = cms == null ? void 0 : cms.api) == null ? void 0 : _a.tina) == null ? void 0 : _b.isLocalMode) ? /* @__PURE__ */ React.createElement(LocalWarning, null) : /* @__PURE__ */ React.createElement(BillingWarning, null),
|
|
30818
|
+
return /* @__PURE__ */ React.createElement("div", { className: "relative w-full h-full flex flex-col items-stretch justify-between" }, ((_b = (_a = cms == null ? void 0 : cms.api) == null ? void 0 : _a.tina) == null ? void 0 : _b.isLocalMode) ? /* @__PURE__ */ React.createElement(LocalWarning, null) : /* @__PURE__ */ React.createElement(BillingWarning, null), /* @__PURE__ */ React.createElement(
|
|
30819
|
+
"div",
|
|
30820
|
+
{
|
|
30821
|
+
className: `xl:hidden py-5 border-b border-gray-200 bg-white pl-18`
|
|
30822
|
+
},
|
|
30823
|
+
selectedScreen.name
|
|
30824
|
+
), /* @__PURE__ */ React.createElement("div", { className: "flex-1 overflow-y-auto relative flex flex-col items-stretch justify-between" }, /* @__PURE__ */ React.createElement(selectedScreen.Component, { close: () => {
|
|
30818
30825
|
} })));
|
|
30819
30826
|
});
|
|
30820
30827
|
};
|
|
@@ -31188,7 +31195,7 @@ This will work when developing locally but NOT when deployed to production.
|
|
|
31188
31195
|
cms,
|
|
31189
31196
|
children
|
|
31190
31197
|
}) => {
|
|
31191
|
-
return /* @__PURE__ */ React.createElement(Layout, null, /* @__PURE__ */ React.createElement("div", { className: "flex items-stretch h-
|
|
31198
|
+
return /* @__PURE__ */ React.createElement(Layout, null, /* @__PURE__ */ React.createElement("div", { className: "flex items-stretch h-dvh overflow-hidden" }, /* @__PURE__ */ React.createElement(Sidebar, { cms }), /* @__PURE__ */ React.createElement("div", { className: "w-full relative" }, children)));
|
|
31192
31199
|
};
|
|
31193
31200
|
const PlainLayout = ({ children }) => {
|
|
31194
31201
|
return /* @__PURE__ */ React.createElement(
|
package/dist/index.mjs
CHANGED
|
@@ -27,9 +27,9 @@ import { EditContext, useEditState, setEditing } from "@tinacms/sharedctx";
|
|
|
27
27
|
import get from "lodash.get";
|
|
28
28
|
import moment from "moment";
|
|
29
29
|
import { formatDistanceToNow } from "date-fns";
|
|
30
|
-
import { useWindowWidth } from "@react-hook/window-size";
|
|
31
30
|
import { isHotkey } from "is-hotkey";
|
|
32
31
|
import { computePosition, flip, shift } from "@floating-ui/dom";
|
|
32
|
+
import { useWindowWidth } from "@react-hook/window-size";
|
|
33
33
|
import { getIntrospectionQuery, buildClientSchema, print, parse as parse$3, buildSchema } from "graphql";
|
|
34
34
|
import gql$1 from "graphql-tag";
|
|
35
35
|
import { TinaSchema, addNamespaceToSchema, parseURL, resolveForm, normalizePath, validateSchema } from "@tinacms/schema-tools";
|
|
@@ -2811,6 +2811,9 @@ function BiLogOut(props) {
|
|
|
2811
2811
|
function BiMenu(props) {
|
|
2812
2812
|
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "d": "M4 6h16v2H4zm0 5h16v2H4zm0 5h16v2H4z" }, "child": [] }] })(props);
|
|
2813
2813
|
}
|
|
2814
|
+
function BiMovie(props) {
|
|
2815
|
+
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "d": "M20 3H4c-1.103 0-2 .897-2 2v14c0 1.103.897 2 2 2h16c1.103 0 2-.897 2-2V5c0-1.103-.897-2-2-2zm.001 6c-.001 0-.001 0 0 0h-.466l-2.667-4H20l.001 4zM9.535 9 6.868 5h2.597l2.667 4H9.535zm5 0-2.667-4h2.597l2.667 4h-2.597zM4 5h.465l2.667 4H4V5zm0 14v-8h16l.002 8H4z" }, "child": [] }] })(props);
|
|
2816
|
+
}
|
|
2814
2817
|
function BiPencil(props) {
|
|
2815
2818
|
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "d": "M4 21a1 1 0 0 0 .24 0l4-1a1 1 0 0 0 .47-.26L21 7.41a2 2 0 0 0 0-2.82L19.42 3a2 2 0 0 0-2.83 0L4.3 15.29a1.06 1.06 0 0 0-.27.47l-1 4A1 1 0 0 0 3.76 21 1 1 0 0 0 4 21zM18 4.41 19.59 6 18 7.59 16.42 6zM5.91 16.51 15 7.41 16.59 9l-9.1 9.1-2.11.52z" }, "child": [] }] })(props);
|
|
2816
2819
|
}
|
|
@@ -2895,13 +2898,13 @@ const Message = ({
|
|
|
2895
2898
|
{
|
|
2896
2899
|
className: `rounded-lg border shadow-sm ${sizeClasses[size]} ${containerClasses[type]} ${className}`
|
|
2897
2900
|
},
|
|
2898
|
-
/* @__PURE__ */ React__default.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ React__default.createElement(
|
|
2901
|
+
/* @__PURE__ */ React__default.createElement("div", { className: "flex flex-col sm:flex-row items-start sm:items-center gap-2" }, /* @__PURE__ */ React__default.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ React__default.createElement(
|
|
2899
2902
|
MessageIcon,
|
|
2900
2903
|
{
|
|
2901
2904
|
type,
|
|
2902
2905
|
className: `${size === "small" ? "w-5" : "w-6"} h-auto flex-shrink-0 ${iconClasses[type]}`
|
|
2903
2906
|
}
|
|
2904
|
-
), /* @__PURE__ */ React__default.createElement("div", { className: `flex-1 ${textClasses[type]}` }, children), link && /* @__PURE__ */ React__default.createElement(
|
|
2907
|
+
), /* @__PURE__ */ React__default.createElement("div", { className: `flex-1 ${textClasses[type]}` }, children)), link && /* @__PURE__ */ React__default.createElement(
|
|
2905
2908
|
"a",
|
|
2906
2909
|
{
|
|
2907
2910
|
href: link,
|
|
@@ -3521,7 +3524,7 @@ const Select = ({
|
|
|
3521
3524
|
ref.current.focus();
|
|
3522
3525
|
}
|
|
3523
3526
|
}, [field == null ? void 0 : field.experimental_focusIntent, ref]);
|
|
3524
|
-
return /* @__PURE__ */ React.createElement("div", { className: "relative group" }, /* @__PURE__ */ React.createElement(
|
|
3527
|
+
return /* @__PURE__ */ React.createElement("div", { className: "relative group w-full md:w-auto" }, /* @__PURE__ */ React.createElement(
|
|
3525
3528
|
"select",
|
|
3526
3529
|
{
|
|
3527
3530
|
id: input.name,
|
|
@@ -3723,6 +3726,9 @@ const dropzoneAcceptFromString = (str) => {
|
|
|
3723
3726
|
const isImage = (filename) => {
|
|
3724
3727
|
return /\.(gif|jpg|jpeg|tiff|png|svg|webp|avif)(\?.*)?$/i.test(filename);
|
|
3725
3728
|
};
|
|
3729
|
+
const isVideo = (filename) => {
|
|
3730
|
+
return /\.(mp4|webm|ogg|m4v|mov|avi|flv|mkv)(\?.*)?$/i.test(filename);
|
|
3731
|
+
};
|
|
3726
3732
|
const absoluteImgURL = (str) => {
|
|
3727
3733
|
if (str.startsWith("http"))
|
|
3728
3734
|
return str;
|
|
@@ -7699,6 +7705,7 @@ class TinaMediaStore {
|
|
|
7699
7705
|
return fetch(input, init);
|
|
7700
7706
|
};
|
|
7701
7707
|
this.accept = DEFAULT_MEDIA_UPLOAD_TYPES;
|
|
7708
|
+
this.maxSize = 100 * 1024 * 1024;
|
|
7702
7709
|
this.parse = (img) => {
|
|
7703
7710
|
return img.src;
|
|
7704
7711
|
};
|
|
@@ -7999,6 +8006,9 @@ let MediaManager$1 = class MediaManager {
|
|
|
7999
8006
|
get accept() {
|
|
8000
8007
|
return this.store.accept;
|
|
8001
8008
|
}
|
|
8009
|
+
get maxSize() {
|
|
8010
|
+
return this.store.maxSize || void 0;
|
|
8011
|
+
}
|
|
8002
8012
|
async persist(files) {
|
|
8003
8013
|
try {
|
|
8004
8014
|
this.events.dispatch({ type: "media:upload:start", uploaded: files });
|
|
@@ -9099,7 +9109,7 @@ const ResizeHandle = () => {
|
|
|
9099
9109
|
const SidebarContext = React.createContext(null);
|
|
9100
9110
|
const minPreviewWidth = 440;
|
|
9101
9111
|
const minSidebarWidth = 360;
|
|
9102
|
-
const navBreakpoint =
|
|
9112
|
+
const navBreakpoint = 1279;
|
|
9103
9113
|
const LOCALSTATEKEY = "tina.sidebarState";
|
|
9104
9114
|
const LOCALWIDTHKEY = "tina.sidebarWidth";
|
|
9105
9115
|
const defaultSidebarWidth = 440;
|
|
@@ -9570,12 +9580,12 @@ const SidebarWrapper = ({ children }) => {
|
|
|
9570
9580
|
return /* @__PURE__ */ React.createElement(
|
|
9571
9581
|
"div",
|
|
9572
9582
|
{
|
|
9573
|
-
className: `fixed top-0 left-0 h-
|
|
9583
|
+
className: `fixed top-0 left-0 h-dvh z-base ${displayState === "closed" ? `pointer-events-none` : ``}`
|
|
9574
9584
|
},
|
|
9575
9585
|
/* @__PURE__ */ React.createElement(
|
|
9576
9586
|
"div",
|
|
9577
9587
|
{
|
|
9578
|
-
className: `relative h-
|
|
9588
|
+
className: `relative h-dvh transform flex ${displayState !== "closed" ? `` : `-translate-x-full`} ${resizingSidebar ? `transition-none` : displayState === "closed" ? `transition-all duration-300 ease-in` : displayState === "fullscreen" ? `transition-all duration-150 ease-out` : `transition-all duration-300 ease-out`}`,
|
|
9579
9589
|
style: {
|
|
9580
9590
|
width: displayState === "fullscreen" ? "100vw" : sidebarWidth + "px",
|
|
9581
9591
|
maxWidth: displayState === "fullscreen" ? "100vw" : "calc(100vw - 8px)",
|
|
@@ -9642,7 +9652,12 @@ function CursorPaginator({
|
|
|
9642
9652
|
return /* @__PURE__ */ React__default.createElement("div", { className: "w-full flex flex-shrink-0 justify-end gap-2 items-center" }, /* @__PURE__ */ React__default.createElement(Button, { variant, disabled: !hasPrev, onClick: navigatePrev }, /* @__PURE__ */ React__default.createElement(BiLeftArrowAlt, { className: "w-6 h-full mr-2 opacity-70" }), " Previous"), /* @__PURE__ */ React__default.createElement(Button, { variant, disabled: !hasNext, onClick: navigateNext }, "Next ", /* @__PURE__ */ React__default.createElement(BiRightArrowAlt, { className: "w-6 h-full ml-2 opacity-70" })));
|
|
9643
9653
|
}
|
|
9644
9654
|
function ListMediaItem({ item, onClick, active }) {
|
|
9645
|
-
|
|
9655
|
+
let FileIcon = BiFile;
|
|
9656
|
+
if (item.type === "dir") {
|
|
9657
|
+
FileIcon = BiFolder;
|
|
9658
|
+
} else if (isVideo(item.src)) {
|
|
9659
|
+
FileIcon = BiMovie;
|
|
9660
|
+
}
|
|
9646
9661
|
const thumbnail = (item.thumbnails || {})["75x75"];
|
|
9647
9662
|
return /* @__PURE__ */ React__default.createElement(
|
|
9648
9663
|
"li",
|
|
@@ -9675,7 +9690,12 @@ function ListMediaItem({ item, onClick, active }) {
|
|
|
9675
9690
|
);
|
|
9676
9691
|
}
|
|
9677
9692
|
function GridMediaItem({ item, active, onClick }) {
|
|
9678
|
-
|
|
9693
|
+
let FileIcon = BiFile;
|
|
9694
|
+
if (item.type === "dir") {
|
|
9695
|
+
FileIcon = BiFolder;
|
|
9696
|
+
} else if (isVideo(item.src)) {
|
|
9697
|
+
FileIcon = BiMovie;
|
|
9698
|
+
}
|
|
9679
9699
|
const thumbnail = (item.thumbnails || {})["400x400"];
|
|
9680
9700
|
return /* @__PURE__ */ React__default.createElement(
|
|
9681
9701
|
"li",
|
|
@@ -9884,6 +9904,7 @@ function MediaPicker({
|
|
|
9884
9904
|
close: close2,
|
|
9885
9905
|
...props
|
|
9886
9906
|
}) {
|
|
9907
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
9887
9908
|
const cms = useCMS();
|
|
9888
9909
|
const [listState, setListState] = useState(() => {
|
|
9889
9910
|
if (cms.media.isConfigured)
|
|
@@ -9978,10 +9999,14 @@ function MediaPicker({
|
|
|
9978
9999
|
};
|
|
9979
10000
|
}
|
|
9980
10001
|
const [uploading, setUploading] = useState(false);
|
|
10002
|
+
const accept = Array.isArray(
|
|
10003
|
+
(_c = (_b = (_a = cms.api.tina.schema.schema) == null ? void 0 : _a.config) == null ? void 0 : _b.media) == null ? void 0 : _c.accept
|
|
10004
|
+
) ? (_f = (_e = (_d = cms.api.tina.schema.schema) == null ? void 0 : _d.config) == null ? void 0 : _e.media) == null ? void 0 : _f.accept.join(",") : (_i = (_h = (_g = cms.api.tina.schema.schema) == null ? void 0 : _g.config) == null ? void 0 : _h.media) == null ? void 0 : _i.accept;
|
|
9981
10005
|
const { getRootProps, getInputProps, isDragActive } = useDropzone({
|
|
9982
10006
|
accept: dropzoneAcceptFromString(
|
|
9983
|
-
cms.media.accept || DEFAULT_MEDIA_UPLOAD_TYPES
|
|
10007
|
+
accept || cms.media.accept || DEFAULT_MEDIA_UPLOAD_TYPES
|
|
9984
10008
|
),
|
|
10009
|
+
maxSize: cms.media.maxSize,
|
|
9985
10010
|
multiple: true,
|
|
9986
10011
|
onDrop: async (files, fileRejections) => {
|
|
9987
10012
|
try {
|
|
@@ -11078,16 +11103,13 @@ const BranchBanner = () => {
|
|
|
11078
11103
|
const openModal = () => setOpen(true);
|
|
11079
11104
|
const { currentBranch } = useBranchData();
|
|
11080
11105
|
const isProtected = cms.api.tina.usingProtectedBranch();
|
|
11081
|
-
const navBreakpoint2 = 1e3;
|
|
11082
|
-
const windowWidth = useWindowWidth();
|
|
11083
|
-
const renderNavToggle = windowWidth < navBreakpoint2 + 1;
|
|
11084
11106
|
const previewFunction = (_d = (_c = (_b = (_a = cms.api.tina.schema) == null ? void 0 : _a.config) == null ? void 0 : _b.config) == null ? void 0 : _c.ui) == null ? void 0 : _d.previewUrl;
|
|
11085
11107
|
const branch = decodeURIComponent(cms.api.tina.branch);
|
|
11086
11108
|
const previewUrl = previewFunction ? (_e = previewFunction({ branch })) == null ? void 0 : _e.url : null;
|
|
11087
11109
|
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
11088
11110
|
"div",
|
|
11089
11111
|
{
|
|
11090
|
-
className: `w-full bg-white flex items-center gap-2 -mb-px border-b border-gray-100 py-3 pr-4
|
|
11112
|
+
className: `w-full bg-white flex items-center gap-2 -mb-px border-b border-gray-100 py-3 pr-4 pl-20 xl:pl-4`
|
|
11091
11113
|
},
|
|
11092
11114
|
/* @__PURE__ */ React.createElement(
|
|
11093
11115
|
Button,
|
|
@@ -11349,7 +11371,7 @@ const FormBuilder = ({
|
|
|
11349
11371
|
);
|
|
11350
11372
|
};
|
|
11351
11373
|
const FormStatus = ({ pristine }) => {
|
|
11352
|
-
return /* @__PURE__ */ React.createElement("div", { className: "flex flex-0 items-center" }, !pristine && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("
|
|
11374
|
+
return /* @__PURE__ */ React.createElement("div", { className: "flex flex-0 items-center" }, !pristine && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("p", { className: "text-gray-500 text-xs leading-tight whitespace-nowrap mr-2" }, "Unsaved Changes"), /* @__PURE__ */ React.createElement("span", { className: "w-3 h-3 flex-0 rounded-full bg-red-300 border border-red-400" }), " "), pristine && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("span", { className: "w-3 h-3 flex-0 rounded-full bg-green-300 border border-green-400" }), " "));
|
|
11353
11375
|
};
|
|
11354
11376
|
const FormWrapper = ({
|
|
11355
11377
|
header,
|
|
@@ -11363,7 +11385,7 @@ const FormWrapper = ({
|
|
|
11363
11385
|
className: "h-full overflow-y-auto max-h-full bg-gray-50"
|
|
11364
11386
|
},
|
|
11365
11387
|
header,
|
|
11366
|
-
/* @__PURE__ */ React.createElement("div", { className: "py-5 px-6" }, /* @__PURE__ */ React.createElement("div", { className: "w-full flex justify-center" }, /* @__PURE__ */ React.createElement("div", { className: "w-full
|
|
11388
|
+
/* @__PURE__ */ React.createElement("div", { className: "py-5 px-6 xl:px-12" }, /* @__PURE__ */ React.createElement("div", { className: "w-full flex justify-center" }, /* @__PURE__ */ React.createElement("div", { className: "w-full" }, children)))
|
|
11367
11389
|
);
|
|
11368
11390
|
};
|
|
11369
11391
|
const Emoji = ({ className = "", ...props }) => /* @__PURE__ */ React.createElement(
|
|
@@ -13063,7 +13085,7 @@ const createInvalidMarkdownPlugin = createPluginFactory({
|
|
|
13063
13085
|
function ErrorMessage({ error }) {
|
|
13064
13086
|
const message = buildErrorMessage(error);
|
|
13065
13087
|
const { setRawMode } = useEditorContext();
|
|
13066
|
-
return /* @__PURE__ */ React__default.createElement("div", { contentEditable: false, className: "bg-red-50 sm:rounded-lg" }, /* @__PURE__ */ React__default.createElement("div", { className: "px-4 py-5 sm:p-6" }, /* @__PURE__ */ React__default.createElement("h3", { className: "text-lg leading-6 font-medium text-red-800" }, "Error parsing markdown"), /* @__PURE__ */ React__default.createElement("div", { className: "mt-2 max-w-xl text-sm text-red-800 space-y-4" }, /* @__PURE__ */ React__default.createElement("p", null, message), /* @__PURE__ */ React__default.createElement("p", null, "To fix these errors, edit the content in raw-mode."), /* @__PURE__ */ React__default.createElement(
|
|
13088
|
+
return /* @__PURE__ */ React__default.createElement("div", { contentEditable: false, className: "bg-red-50 sm:rounded-lg" }, /* @__PURE__ */ React__default.createElement("div", { className: "px-4 py-5 sm:p-6" }, /* @__PURE__ */ React__default.createElement("h3", { className: "text-lg leading-6 font-medium text-red-800" }, "❌ Error parsing markdown"), /* @__PURE__ */ React__default.createElement("div", { className: "mt-2 max-w-xl text-sm text-red-800 space-y-4" }, /* @__PURE__ */ React__default.createElement("p", null, message), /* @__PURE__ */ React__default.createElement("p", null, "To fix these errors, edit the content in raw-mode."), /* @__PURE__ */ React__default.createElement(
|
|
13067
13089
|
"button",
|
|
13068
13090
|
{
|
|
13069
13091
|
onClick: () => setRawMode(true),
|
|
@@ -28033,7 +28055,7 @@ const AuthWallInner = ({
|
|
|
28033
28055
|
});
|
|
28034
28056
|
}
|
|
28035
28057
|
};
|
|
28036
|
-
let modalTitle = "Tina Cloud
|
|
28058
|
+
let modalTitle = "Tina Cloud";
|
|
28037
28059
|
if (activeModal === "authenticate" && loginStrategy === "Redirect" && !isTinaCloud) {
|
|
28038
28060
|
modalTitle = "Enter into edit mode";
|
|
28039
28061
|
} else if (activeModal === "authenticate" && loginStrategy === "UsernamePassword") {
|
|
@@ -28049,20 +28071,12 @@ const AuthWallInner = ({
|
|
|
28049
28071
|
ModalBuilder,
|
|
28050
28072
|
{
|
|
28051
28073
|
title: modalTitle,
|
|
28052
|
-
message: isTinaCloud ? "
|
|
28074
|
+
message: isTinaCloud ? "Your site uses Tina Cloud 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.",
|
|
28053
28075
|
close,
|
|
28054
28076
|
actions: [
|
|
28055
28077
|
...otherModalActions,
|
|
28056
28078
|
{
|
|
28057
|
-
|
|
28058
|
-
setEditing(false);
|
|
28059
|
-
window.location.reload();
|
|
28060
|
-
},
|
|
28061
|
-
name: "Close",
|
|
28062
|
-
primary: false
|
|
28063
|
-
},
|
|
28064
|
-
{
|
|
28065
|
-
name: isTinaCloud ? "Continue to Tina Cloud" : "Enter Edit Mode",
|
|
28079
|
+
name: isTinaCloud ? "Log in" : "Enter Edit Mode",
|
|
28066
28080
|
action: handleAuthenticate,
|
|
28067
28081
|
primary: true
|
|
28068
28082
|
}
|
|
@@ -28816,7 +28830,7 @@ const Sidebar = ({ cms }) => {
|
|
|
28816
28830
|
const cloudConfigs = cms.plugins.getType("cloud-config").all();
|
|
28817
28831
|
const [menuIsOpen, setMenuIsOpen] = React__default.useState(false);
|
|
28818
28832
|
const isLocalMode = (_b = (_a = cms.api) == null ? void 0 : _a.tina) == null ? void 0 : _b.isLocalMode;
|
|
28819
|
-
const navBreakpoint2 =
|
|
28833
|
+
const navBreakpoint2 = 1279;
|
|
28820
28834
|
const windowWidth = useWindowWidth();
|
|
28821
28835
|
const renderDesktopNav = windowWidth > navBreakpoint2;
|
|
28822
28836
|
const activeScreens = screens.filter(
|
|
@@ -29123,14 +29137,14 @@ const PageHeader = ({
|
|
|
29123
29137
|
isLocalMode,
|
|
29124
29138
|
children
|
|
29125
29139
|
}) => {
|
|
29126
|
-
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, isLocalMode && /* @__PURE__ */ React__default.createElement(LocalWarning, null), !isLocalMode && /* @__PURE__ */ React__default.createElement(BillingWarning, null), /* @__PURE__ */ React__default.createElement("div", { className: "pt-12 px-12" }, /* @__PURE__ */ React__default.createElement("div", { className: "w-full mx-auto max-w-screen-xl" }, /* @__PURE__ */ React__default.createElement("div", { className: "w-full flex justify-between items-end" }, children))));
|
|
29140
|
+
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, isLocalMode && /* @__PURE__ */ React__default.createElement(LocalWarning, null), !isLocalMode && /* @__PURE__ */ React__default.createElement(BillingWarning, null), /* @__PURE__ */ React__default.createElement("div", { className: "pt-16 xl:pt-12 px-6 xl:px-12" }, /* @__PURE__ */ React__default.createElement("div", { className: "w-full mx-auto max-w-screen-xl" }, /* @__PURE__ */ React__default.createElement("div", { className: "w-full flex justify-between items-end" }, children))));
|
|
29127
29141
|
};
|
|
29128
29142
|
const PageBody = ({
|
|
29129
29143
|
children
|
|
29130
|
-
}) => /* @__PURE__ */ React__default.createElement("div", { className: "py-8 px-12" }, children);
|
|
29144
|
+
}) => /* @__PURE__ */ React__default.createElement("div", { className: "py-8 px-6 xl:px-12" }, children);
|
|
29131
29145
|
const PageBodyNarrow = ({
|
|
29132
29146
|
children
|
|
29133
|
-
}) => /* @__PURE__ */ React__default.createElement("div", { className: "py-10 px-12" }, /* @__PURE__ */ React__default.createElement("div", { className: "w-full mx-auto max-w-screen-xl" }, children));
|
|
29147
|
+
}) => /* @__PURE__ */ React__default.createElement("div", { className: "py-10 px-6 xl:px-12" }, /* @__PURE__ */ React__default.createElement("div", { className: "w-full mx-auto max-w-screen-xl" }, children));
|
|
29134
29148
|
const DashboardPage = () => {
|
|
29135
29149
|
return /* @__PURE__ */ React__default.createElement(GetCMS, null, (cms) => {
|
|
29136
29150
|
var _a, _b;
|
|
@@ -29645,7 +29659,6 @@ const CollectionListPage = () => {
|
|
|
29645
29659
|
},
|
|
29646
29660
|
(collection, _loading, reFetchCollection, collectionExtra) => {
|
|
29647
29661
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
|
|
29648
|
-
collection.documents.totalCount;
|
|
29649
29662
|
const documents = collection.documents.edges;
|
|
29650
29663
|
const admin = cms.api.admin;
|
|
29651
29664
|
const pageInfo = collection.documents.pageInfo;
|
|
@@ -29779,7 +29792,7 @@ const CollectionListPage = () => {
|
|
|
29779
29792
|
},
|
|
29780
29793
|
close: () => setFolderModalOpen(false)
|
|
29781
29794
|
}
|
|
29782
|
-
), /* @__PURE__ */ React__default.createElement(PageHeader, { isLocalMode: (_l = (_k = cms == null ? void 0 : cms.api) == null ? void 0 : _k.tina) == null ? void 0 : _l.isLocalMode }, /* @__PURE__ */ React__default.createElement("div", { className: "w-full
|
|
29795
|
+
), /* @__PURE__ */ React__default.createElement(PageHeader, { isLocalMode: (_l = (_k = cms == null ? void 0 : cms.api) == null ? void 0 : _k.tina) == null ? void 0 : _l.isLocalMode }, /* @__PURE__ */ React__default.createElement("div", { className: "w-full" }, /* @__PURE__ */ React__default.createElement("h3", { className: "font-sans text-2xl text-gray-700" }, collection.label ? collection.label : collection.name), /* @__PURE__ */ React__default.createElement("div", { className: "flex flex-col lg:flex-row justify-between lg:items-end pt-2" }, /* @__PURE__ */ React__default.createElement("div", { className: "flex flex-col md:flex-row gap-2 md:gap-4 items-start" }, (fields == null ? void 0 : fields.length) > 0 && /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, !search && /* @__PURE__ */ React__default.createElement("div", { className: "flex flex-col gap-2 items-start w-full md:w-auto" }, /* @__PURE__ */ React__default.createElement(
|
|
29783
29796
|
"label",
|
|
29784
29797
|
{
|
|
29785
29798
|
htmlFor: "sort",
|
|
@@ -29850,7 +29863,7 @@ const CollectionListPage = () => {
|
|
|
29850
29863
|
size: "small"
|
|
29851
29864
|
},
|
|
29852
29865
|
"Search not configured."
|
|
29853
|
-
))))
|
|
29866
|
+
)))), /* @__PURE__ */ React__default.createElement("div", { className: "flex flex-col md:flex-row items-start md:items-end gap-2 md:gap-0 pt-4 lg:pt-0" }, !collection.templates && allowCreate && /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, allowCreateNestedFolder && /* @__PURE__ */ React__default.createElement(
|
|
29854
29867
|
Link,
|
|
29855
29868
|
{
|
|
29856
29869
|
onMouseDown: (evt) => {
|
|
@@ -29863,7 +29876,7 @@ const CollectionListPage = () => {
|
|
|
29863
29876
|
evt.stopPropagation();
|
|
29864
29877
|
},
|
|
29865
29878
|
to: "/collections/new-folder",
|
|
29866
|
-
className: "icon-parent inline-flex items-center font-medium focus:outline-none focus:ring-2 focus:shadow-outline text-center rounded-full justify-center transition-all duration-150 ease-out whitespace-nowrap shadow text-blue-500 bg-white hover:bg-[#f1f5f9] focus:ring-white focus:ring-blue-500 text-sm h-10 px-6 mr-4"
|
|
29879
|
+
className: "icon-parent inline-flex items-center font-medium focus:outline-none focus:ring-2 focus:shadow-outline text-center rounded-full justify-center transition-all duration-150 ease-out whitespace-nowrap shadow text-blue-500 bg-white hover:bg-[#f1f5f9] focus:ring-white focus:ring-blue-500 w-full md:w-auto text-sm h-10 px-6 mr-4"
|
|
29867
29880
|
},
|
|
29868
29881
|
/* @__PURE__ */ React__default.createElement(FaFolder, { className: "mr-2" }),
|
|
29869
29882
|
"Add Folder",
|
|
@@ -29882,7 +29895,7 @@ const CollectionListPage = () => {
|
|
|
29882
29895
|
"new",
|
|
29883
29896
|
collectionName
|
|
29884
29897
|
].join("/")}`,
|
|
29885
|
-
className: "inline-flex items-center font-medium focus:outline-none focus:ring-2 focus:shadow-outline text-center rounded-full justify-center transition-all duration-150 ease-out whitespace-nowrap shadow text-white bg-blue-500 hover:bg-blue-600 text-sm h-10 px-6"
|
|
29898
|
+
className: "inline-flex items-center font-medium focus:outline-none focus:ring-2 focus:shadow-outline text-center rounded-full justify-center transition-all duration-150 ease-out whitespace-nowrap shadow text-white bg-blue-500 hover:bg-blue-600 w-full md:w-auto text-sm h-10 px-6"
|
|
29886
29899
|
},
|
|
29887
29900
|
/* @__PURE__ */ React__default.createElement(FaFile, { className: "mr-2" }),
|
|
29888
29901
|
"Add Files",
|
|
@@ -29894,7 +29907,7 @@ const CollectionListPage = () => {
|
|
|
29894
29907
|
templates: collection.templates,
|
|
29895
29908
|
folder
|
|
29896
29909
|
}
|
|
29897
|
-
)))), /* @__PURE__ */ React__default.createElement(PageBody, null, /* @__PURE__ */ React__default.createElement("div", { className: "w-full mx-auto max-w-screen-xl" }, sortField && !sortField.required && /* @__PURE__ */ React__default.createElement("p", { className: "mb-4 text-gray-500" }, /* @__PURE__ */ React__default.createElement("em", null, "Sorting on a non-required field. Some documents may be excluded (if they don't have a value for", " ", sortName, ")")), (folder.name && !search || documents.length > 0) && /* @__PURE__ */ React__default.createElement("table", { className: "table-auto shadow bg-white border-b border-gray-200 w-full max-w-full rounded-lg" }, /* @__PURE__ */ React__default.createElement("tbody", { className: "divide-y divide-gray-150" }, folder.name && !search ? /* @__PURE__ */ React__default.createElement("tr", null, /* @__PURE__ */ React__default.createElement("td", { colSpan: 5 }, /* @__PURE__ */ React__default.createElement(
|
|
29910
|
+
))))), /* @__PURE__ */ React__default.createElement(PageBody, null, /* @__PURE__ */ React__default.createElement("div", { className: "w-full mx-auto max-w-screen-xl" }, sortField && !sortField.required && /* @__PURE__ */ React__default.createElement("p", { className: "mb-4 text-gray-500" }, /* @__PURE__ */ React__default.createElement("em", null, "Sorting on a non-required field. Some documents may be excluded (if they don't have a value for", " ", sortName, ")")), /* @__PURE__ */ React__default.createElement("div", { className: "w-full overflow-x-auto" }, (folder.name && !search || documents.length > 0) && /* @__PURE__ */ React__default.createElement("table", { className: "table-auto shadow bg-white border-b border-gray-200 w-full max-w-full rounded-lg" }, /* @__PURE__ */ React__default.createElement("tbody", { className: "divide-y divide-gray-150" }, folder.name && !search ? /* @__PURE__ */ React__default.createElement("tr", null, /* @__PURE__ */ React__default.createElement("td", { colSpan: 5 }, /* @__PURE__ */ React__default.createElement(
|
|
29898
29911
|
Breadcrumb,
|
|
29899
29912
|
{
|
|
29900
29913
|
folder,
|
|
@@ -29904,34 +29917,33 @@ const CollectionListPage = () => {
|
|
|
29904
29917
|
))) : null, documents.length > 0 && documents.map((document2) => {
|
|
29905
29918
|
var _a2;
|
|
29906
29919
|
if (document2.node.__typename === "Folder") {
|
|
29907
|
-
return /* @__PURE__ */ React__default.createElement(
|
|
29908
|
-
"
|
|
29909
|
-
{
|
|
29910
|
-
className: "text-blue-600 hover:text-blue-400 flex items-center gap-3 cursor-pointer truncate",
|
|
29911
|
-
onClick: () => {
|
|
29912
|
-
navigate(
|
|
29913
|
-
`/${[
|
|
29914
|
-
"collections",
|
|
29915
|
-
collectionName,
|
|
29916
|
-
document2.node.path
|
|
29917
|
-
].join("/")}`,
|
|
29918
|
-
{ replace: true }
|
|
29919
|
-
);
|
|
29920
|
-
}
|
|
29921
|
-
},
|
|
29922
|
-
/* @__PURE__ */ React__default.createElement(BiFolder, { className: "inline-block h-6 w-auto flex-shrink-0 opacity-70" }),
|
|
29923
|
-
/* @__PURE__ */ React__default.createElement("span", { className: "truncate block" }, /* @__PURE__ */ React__default.createElement("span", { className: "block text-xs text-gray-400 mb-1 uppercase" }, "Name"), /* @__PURE__ */ React__default.createElement("span", { className: "h-5 leading-5 block truncate" }, /* @__PURE__ */ React__default.createElement("span", null, document2.node.name)))
|
|
29924
|
-
)), /* @__PURE__ */ React__default.createElement(
|
|
29925
|
-
"td",
|
|
29920
|
+
return /* @__PURE__ */ React__default.createElement(
|
|
29921
|
+
"tr",
|
|
29926
29922
|
{
|
|
29927
|
-
|
|
29928
|
-
colSpan: 4
|
|
29923
|
+
key: `folder-${document2.node.path}`
|
|
29929
29924
|
},
|
|
29930
|
-
/* @__PURE__ */ React__default.createElement("
|
|
29931
|
-
|
|
29925
|
+
/* @__PURE__ */ React__default.createElement("td", { className: "pl-5 pr-3 py-3" }, /* @__PURE__ */ React__default.createElement(
|
|
29926
|
+
"a",
|
|
29927
|
+
{
|
|
29928
|
+
className: "text-blue-600 hover:text-blue-400 flex items-center gap-3 cursor-pointer truncate",
|
|
29929
|
+
onClick: () => {
|
|
29930
|
+
navigate(
|
|
29931
|
+
`/${[
|
|
29932
|
+
"collections",
|
|
29933
|
+
collectionName,
|
|
29934
|
+
document2.node.path
|
|
29935
|
+
].join("/")}`,
|
|
29936
|
+
{ replace: true }
|
|
29937
|
+
);
|
|
29938
|
+
}
|
|
29939
|
+
},
|
|
29940
|
+
/* @__PURE__ */ React__default.createElement(BiFolder, { className: "inline-block h-6 w-auto flex-shrink-0 opacity-70" }),
|
|
29941
|
+
/* @__PURE__ */ React__default.createElement("span", { className: "truncate block" }, /* @__PURE__ */ React__default.createElement("span", { className: "block text-xs text-gray-400 mb-1 uppercase" }, "Name"), /* @__PURE__ */ React__default.createElement("span", { className: "h-5 leading-5 block truncate" }, /* @__PURE__ */ React__default.createElement("span", null, document2.node.name)))
|
|
29942
|
+
)),
|
|
29943
|
+
/* @__PURE__ */ React__default.createElement("td", { className: "px-3 py-3", colSpan: 4 }, /* @__PURE__ */ React__default.createElement("span", { className: "block text-xs text-gray-400 mb-1 uppercase" }, "Path"), /* @__PURE__ */ React__default.createElement("span", { className: "leading-5 block text-sm font-medium text-gray-900 truncate" }, document2.node.path.substring(2).split("/").map((node) => {
|
|
29932
29944
|
return /* @__PURE__ */ React__default.createElement("span", { key: node }, /* @__PURE__ */ React__default.createElement("span", { className: "text-gray-300 pr-0.5" }, "/"), /* @__PURE__ */ React__default.createElement("span", { className: "pr-0.5" }, node));
|
|
29933
|
-
}))
|
|
29934
|
-
)
|
|
29945
|
+
})))
|
|
29946
|
+
);
|
|
29935
29947
|
}
|
|
29936
29948
|
const hasTitle = Boolean(
|
|
29937
29949
|
document2.node._sys.title
|
|
@@ -29940,13 +29952,12 @@ const CollectionListPage = () => {
|
|
|
29940
29952
|
return /* @__PURE__ */ React__default.createElement(
|
|
29941
29953
|
"tr",
|
|
29942
29954
|
{
|
|
29943
|
-
key: `document-${document2.node._sys.relativePath}
|
|
29944
|
-
className: ""
|
|
29955
|
+
key: `document-${document2.node._sys.relativePath}`
|
|
29945
29956
|
},
|
|
29946
29957
|
/* @__PURE__ */ React__default.createElement(
|
|
29947
29958
|
"td",
|
|
29948
29959
|
{
|
|
29949
|
-
className: "pl-5 pr-3 py-3
|
|
29960
|
+
className: "pl-5 pr-3 py-3",
|
|
29950
29961
|
colSpan: hasTitle ? 1 : 2
|
|
29951
29962
|
},
|
|
29952
29963
|
/* @__PURE__ */ React__default.createElement(
|
|
@@ -29967,9 +29978,9 @@ const CollectionListPage = () => {
|
|
|
29967
29978
|
/* @__PURE__ */ React__default.createElement("span", { className: "truncate block" }, /* @__PURE__ */ React__default.createElement("span", { className: "block text-xs text-gray-400 mb-1 uppercase" }, hasTitle ? "Title" : "Filename"), /* @__PURE__ */ React__default.createElement("span", { className: "h-5 leading-5 block truncate" }, !folderView && !hasTitle && subfolders && /* @__PURE__ */ React__default.createElement("span", { className: "text-xs text-gray-400" }, `${subfolders}/`), /* @__PURE__ */ React__default.createElement("span", null, hasTitle ? (_a2 = document2.node._sys) == null ? void 0 : _a2.title : document2.node._sys.filename)))
|
|
29968
29979
|
)
|
|
29969
29980
|
),
|
|
29970
|
-
hasTitle && /* @__PURE__ */ React__default.createElement("td", { className: "px-3 py-3
|
|
29971
|
-
/* @__PURE__ */ React__default.createElement("td", { className: "px-3 py-3
|
|
29972
|
-
/* @__PURE__ */ React__default.createElement("td", { className: "px-3 py-3
|
|
29981
|
+
hasTitle && /* @__PURE__ */ React__default.createElement("td", { className: "px-3 py-3" }, /* @__PURE__ */ React__default.createElement("span", { className: "block text-xs text-gray-400 mb-1 uppercase" }, "Filename"), /* @__PURE__ */ React__default.createElement("span", { className: "h-5 leading-5 block text-sm font-medium text-gray-900 truncate" }, !folderView && subfolders && /* @__PURE__ */ React__default.createElement("span", { className: "text-xs text-gray-400" }, `${subfolders}/`), /* @__PURE__ */ React__default.createElement("span", null, document2.node._sys.filename))),
|
|
29982
|
+
/* @__PURE__ */ React__default.createElement("td", { className: "px-3 py-3" }, /* @__PURE__ */ React__default.createElement("span", { className: "block text-xs text-gray-400 mb-1 uppercase" }, "Extension"), /* @__PURE__ */ React__default.createElement("span", { className: "h-5 leading-5 block text-sm font-medium text-gray-900" }, document2.node._sys.extension)),
|
|
29983
|
+
/* @__PURE__ */ React__default.createElement("td", { className: "px-3 py-3" }, /* @__PURE__ */ React__default.createElement("span", { className: "block text-xs text-gray-400 mb-1 uppercase" }, "Template"), /* @__PURE__ */ React__default.createElement("span", { className: "h-5 leading-5 block text-sm font-medium text-gray-900" }, document2.node._sys.template)),
|
|
29973
29984
|
/* @__PURE__ */ React__default.createElement("td", { className: "w-0" }, /* @__PURE__ */ React__default.createElement(
|
|
29974
29985
|
OverflowMenu$1,
|
|
29975
29986
|
{
|
|
@@ -30062,7 +30073,7 @@ const CollectionListPage = () => {
|
|
|
30062
30073
|
}
|
|
30063
30074
|
))
|
|
30064
30075
|
);
|
|
30065
|
-
}))), documents.length === 0 && /* @__PURE__ */ React__default.createElement(NoDocumentsPlaceholder, null), /* @__PURE__ */ React__default.createElement("div", { className: "pt-4" }, /* @__PURE__ */ React__default.createElement(
|
|
30076
|
+
})))), documents.length === 0 && /* @__PURE__ */ React__default.createElement(NoDocumentsPlaceholder, null), /* @__PURE__ */ React__default.createElement("div", { className: "pt-4" }, /* @__PURE__ */ React__default.createElement(
|
|
30066
30077
|
CursorPaginator,
|
|
30067
30078
|
{
|
|
30068
30079
|
variant: "white",
|
|
@@ -30109,7 +30120,7 @@ const SearchInput = ({
|
|
|
30109
30120
|
className: "block font-sans text-xs font-semibold text-gray-500 whitespace-normal"
|
|
30110
30121
|
},
|
|
30111
30122
|
"Search"
|
|
30112
|
-
), /* @__PURE__ */ React__default.createElement("div", { className: "flex flex-
|
|
30123
|
+
), /* @__PURE__ */ React__default.createElement("div", { className: "flex flex-col md:flex-row items-start md:items-center w-full md:w-auto gap-3" }, /* @__PURE__ */ React__default.createElement("div", { className: "flex-1 min-w-[200px] w-full md:w-auto" }, /* @__PURE__ */ React__default.createElement(
|
|
30113
30124
|
Input,
|
|
30114
30125
|
{
|
|
30115
30126
|
type: "text",
|
|
@@ -30120,14 +30131,15 @@ const SearchInput = ({
|
|
|
30120
30131
|
setSearchInput(e.target.value);
|
|
30121
30132
|
}
|
|
30122
30133
|
}
|
|
30123
|
-
)), /* @__PURE__ */ React__default.createElement("div", { className: "flex gap-3" }, /* @__PURE__ */ React__default.createElement(
|
|
30134
|
+
)), /* @__PURE__ */ React__default.createElement("div", { className: "flex w-full md:w-auto gap-3" }, /* @__PURE__ */ React__default.createElement(
|
|
30124
30135
|
Button,
|
|
30125
30136
|
{
|
|
30126
30137
|
onClick: () => {
|
|
30127
30138
|
setSearch(searchInput);
|
|
30128
30139
|
setSearchLoaded(false);
|
|
30129
30140
|
},
|
|
30130
|
-
variant: "primary"
|
|
30141
|
+
variant: "primary",
|
|
30142
|
+
className: "w-full md:w-auto"
|
|
30131
30143
|
},
|
|
30132
30144
|
"Search ",
|
|
30133
30145
|
/* @__PURE__ */ React__default.createElement(BiSearch, { className: "w-5 h-full ml-1.5 opacity-70" })
|
|
@@ -30547,10 +30559,6 @@ const RenderForm$1 = ({
|
|
|
30547
30559
|
}
|
|
30548
30560
|
});
|
|
30549
30561
|
}, [cms, collection, mutationInfo]);
|
|
30550
|
-
const navBreakpoint2 = 1e3;
|
|
30551
|
-
const windowWidth = useWindowWidth();
|
|
30552
|
-
const renderNavToggle = windowWidth < navBreakpoint2 + 1;
|
|
30553
|
-
const headerPadding = renderNavToggle ? "px-20" : "px-6";
|
|
30554
30562
|
React__default.useEffect(() => {
|
|
30555
30563
|
cms.dispatch({ type: "forms:add", value: form });
|
|
30556
30564
|
cms.dispatch({ type: "forms:set-active-form-id", value: form.id });
|
|
@@ -30568,9 +30576,9 @@ const RenderForm$1 = ({
|
|
|
30568
30576
|
return /* @__PURE__ */ React__default.createElement(PageWrapper, null, /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, ((_f = (_e = cms == null ? void 0 : cms.api) == null ? void 0 : _e.tina) == null ? void 0 : _f.isLocalMode) ? /* @__PURE__ */ React__default.createElement(LocalWarning, null) : /* @__PURE__ */ React__default.createElement(BillingWarning, null), /* @__PURE__ */ React__default.createElement(
|
|
30569
30577
|
"div",
|
|
30570
30578
|
{
|
|
30571
|
-
className: `pt-3 pb-4 border-b border-gray-200 bg-white w-full grow-0 shrink basis-0 flex justify-center
|
|
30579
|
+
className: `pt-10 xl:pt-3 pb-10 xl:pb-4 px-20 xl:px-12 border-b border-gray-200 bg-white w-full grow-0 shrink basis-0 flex justify-center`
|
|
30572
30580
|
},
|
|
30573
|
-
/* @__PURE__ */ React__default.createElement("div", { className: "w-full
|
|
30581
|
+
/* @__PURE__ */ React__default.createElement("div", { className: "w-full flex gap-1.5 justify-between items-center" }, /* @__PURE__ */ React__default.createElement(
|
|
30574
30582
|
Link,
|
|
30575
30583
|
{
|
|
30576
30584
|
to: `/collections/${collection.name}${folder.fullyQualifiedName ? `/${folder.fullyQualifiedName}` : ""}`,
|
|
@@ -30778,10 +30786,6 @@ const RenderForm = ({
|
|
|
30778
30786
|
}
|
|
30779
30787
|
});
|
|
30780
30788
|
}, [cms, document2, relativePath2, collection, mutationInfo]);
|
|
30781
|
-
const navBreakpoint2 = 1e3;
|
|
30782
|
-
const windowWidth = useWindowWidth();
|
|
30783
|
-
const renderNavToggle = windowWidth < navBreakpoint2 + 1;
|
|
30784
|
-
const headerPadding = renderNavToggle ? "px-20" : "px-6";
|
|
30785
30789
|
React__default.useEffect(() => {
|
|
30786
30790
|
cms.dispatch({ type: "forms:add", value: form });
|
|
30787
30791
|
cms.dispatch({ type: "forms:set-active-form-id", value: form.id });
|
|
@@ -30799,9 +30803,9 @@ const RenderForm = ({
|
|
|
30799
30803
|
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, ((_b = (_a = cms == null ? void 0 : cms.api) == null ? void 0 : _a.tina) == null ? void 0 : _b.isLocalMode) ? /* @__PURE__ */ React__default.createElement(LocalWarning, null) : /* @__PURE__ */ React__default.createElement(BillingWarning, null), /* @__PURE__ */ React__default.createElement(
|
|
30800
30804
|
"div",
|
|
30801
30805
|
{
|
|
30802
|
-
className: `pt-3 pb-4 border-b border-gray-200 bg-white w-full grow-0 shrink basis-0 flex justify-center
|
|
30806
|
+
className: `pt-10 xl:pt-3 pb-10 xl:pb-4 px-20 xl:px-12 border-b border-gray-200 bg-white w-full grow-0 shrink basis-0 flex justify-center`
|
|
30803
30807
|
},
|
|
30804
|
-
/* @__PURE__ */ React__default.createElement("div", { className: "w-full
|
|
30808
|
+
/* @__PURE__ */ React__default.createElement("div", { className: "w-full flex gap-1.5 justify-between items-center" }, /* @__PURE__ */ React__default.createElement(
|
|
30805
30809
|
Link,
|
|
30806
30810
|
{
|
|
30807
30811
|
to: `/collections/${collection.name}/~${parentFolder2}`,
|
|
@@ -30813,16 +30817,19 @@ const RenderForm = ({
|
|
|
30813
30817
|
};
|
|
30814
30818
|
const ScreenPage = () => {
|
|
30815
30819
|
const { screenName } = useParams();
|
|
30816
|
-
const navBreakpoint2 = 1e3;
|
|
30817
|
-
const windowWidth = useWindowWidth();
|
|
30818
|
-
const renderNavToggle = windowWidth < navBreakpoint2 + 1;
|
|
30819
30820
|
return /* @__PURE__ */ React__default.createElement(GetCMS, null, (cms) => {
|
|
30820
30821
|
var _a, _b;
|
|
30821
30822
|
const screens = cms.plugins.getType("screen").all();
|
|
30822
30823
|
const selectedScreen = screens.find(
|
|
30823
30824
|
({ name }) => slugify(name) === screenName
|
|
30824
30825
|
);
|
|
30825
|
-
return /* @__PURE__ */ React__default.createElement("div", { className: "relative w-full h-full flex flex-col items-stretch justify-between" }, ((_b = (_a = cms == null ? void 0 : cms.api) == null ? void 0 : _a.tina) == null ? void 0 : _b.isLocalMode) ? /* @__PURE__ */ React__default.createElement(LocalWarning, null) : /* @__PURE__ */ React__default.createElement(BillingWarning, null),
|
|
30826
|
+
return /* @__PURE__ */ React__default.createElement("div", { className: "relative w-full h-full flex flex-col items-stretch justify-between" }, ((_b = (_a = cms == null ? void 0 : cms.api) == null ? void 0 : _a.tina) == null ? void 0 : _b.isLocalMode) ? /* @__PURE__ */ React__default.createElement(LocalWarning, null) : /* @__PURE__ */ React__default.createElement(BillingWarning, null), /* @__PURE__ */ React__default.createElement(
|
|
30827
|
+
"div",
|
|
30828
|
+
{
|
|
30829
|
+
className: `xl:hidden py-5 border-b border-gray-200 bg-white pl-18`
|
|
30830
|
+
},
|
|
30831
|
+
selectedScreen.name
|
|
30832
|
+
), /* @__PURE__ */ React__default.createElement("div", { className: "flex-1 overflow-y-auto relative flex flex-col items-stretch justify-between" }, /* @__PURE__ */ React__default.createElement(selectedScreen.Component, { close: () => {
|
|
30826
30833
|
} })));
|
|
30827
30834
|
});
|
|
30828
30835
|
};
|
|
@@ -31196,7 +31203,7 @@ const DefaultWrapper = ({
|
|
|
31196
31203
|
cms,
|
|
31197
31204
|
children
|
|
31198
31205
|
}) => {
|
|
31199
|
-
return /* @__PURE__ */ React__default.createElement(Layout, null, /* @__PURE__ */ React__default.createElement("div", { className: "flex items-stretch h-
|
|
31206
|
+
return /* @__PURE__ */ React__default.createElement(Layout, null, /* @__PURE__ */ React__default.createElement("div", { className: "flex items-stretch h-dvh overflow-hidden" }, /* @__PURE__ */ React__default.createElement(Sidebar, { cms }), /* @__PURE__ */ React__default.createElement("div", { className: "w-full relative" }, children)));
|
|
31200
31207
|
};
|
|
31201
31208
|
const PlainLayout = ({ children }) => {
|
|
31202
31209
|
return /* @__PURE__ */ React__default.createElement(
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export declare const DEFAULT_MEDIA_UPLOAD_TYPES: string;
|
|
2
2
|
export declare const dropzoneAcceptFromString: (str: string) => any;
|
|
3
3
|
export declare const isImage: (filename: string) => boolean;
|
|
4
|
+
export declare const isVideo: (filename: string) => boolean;
|
|
4
5
|
export declare const absoluteImgURL: (str: string) => string;
|
|
@@ -34,6 +34,7 @@ export declare class TinaMediaStore implements MediaStore {
|
|
|
34
34
|
setup(): void;
|
|
35
35
|
isAuthenticated(): Promise<boolean>;
|
|
36
36
|
accept: string;
|
|
37
|
+
maxSize: number;
|
|
37
38
|
private persist_cloud;
|
|
38
39
|
private persist_local;
|
|
39
40
|
persist(media: MediaUploadOptions[]): Promise<Media[]>;
|
|
@@ -47,6 +47,10 @@ export interface MediaStore {
|
|
|
47
47
|
* that describes what kind of files the Media Store will accept.
|
|
48
48
|
*/
|
|
49
49
|
accept: string;
|
|
50
|
+
/**
|
|
51
|
+
* The maximum size of a file that can be uploaded.
|
|
52
|
+
*/
|
|
53
|
+
maxSize?: number;
|
|
50
54
|
/**
|
|
51
55
|
* Uploads a set of files to the Media Store and
|
|
52
56
|
* returns a Promise containing the Media objects
|
|
@@ -112,6 +116,7 @@ export declare class MediaManager implements MediaStore {
|
|
|
112
116
|
set pageSize(pageSize: number);
|
|
113
117
|
open(options?: SelectMediaOptions): void;
|
|
114
118
|
get accept(): string;
|
|
119
|
+
get maxSize(): number;
|
|
115
120
|
persist(files: MediaUploadOptions[]): Promise<Media[]>;
|
|
116
121
|
delete(media: Media): Promise<void>;
|
|
117
122
|
list(options: MediaListOptions): Promise<MediaList>;
|
|
@@ -8,7 +8,7 @@ import { SidebarState, SidebarStateOptions } from '../sidebar';
|
|
|
8
8
|
export declare const SidebarContext: React.Context<any>;
|
|
9
9
|
export declare const minPreviewWidth = 440;
|
|
10
10
|
export declare const minSidebarWidth = 360;
|
|
11
|
-
export declare const navBreakpoint =
|
|
11
|
+
export declare const navBreakpoint = 1279;
|
|
12
12
|
export interface SidebarProviderProps {
|
|
13
13
|
sidebar: SidebarState;
|
|
14
14
|
resizingSidebar: boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tinacms",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.7",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"module": "./dist/index.mjs",
|
|
6
6
|
"exports": {
|
|
@@ -97,9 +97,9 @@
|
|
|
97
97
|
"webfontloader": "1.6.28",
|
|
98
98
|
"yup": "^0.32.0",
|
|
99
99
|
"zod": "^3.14.3",
|
|
100
|
-
"@tinacms/mdx": "1.3.
|
|
101
|
-
"@tinacms/schema-tools": "1.4.
|
|
102
|
-
"@tinacms/search": "1.0.
|
|
100
|
+
"@tinacms/mdx": "1.3.27",
|
|
101
|
+
"@tinacms/schema-tools": "1.4.18",
|
|
102
|
+
"@tinacms/search": "1.0.22",
|
|
103
103
|
"@tinacms/sharedctx": "1.0.3"
|
|
104
104
|
},
|
|
105
105
|
"devDependencies": {
|