tinacms 2.4.0 → 2.5.0
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/admin/types.d.ts +3 -0
- package/dist/index.js +50 -5
- package/dist/index.mjs +50 -5
- package/package.json +25 -25
package/dist/admin/types.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -5726,10 +5726,11 @@ flowchart TD
|
|
|
5726
5726
|
return /* @__PURE__ */ React.createElement(
|
|
5727
5727
|
"button",
|
|
5728
5728
|
{
|
|
5729
|
-
|
|
5729
|
+
type: "button",
|
|
5730
|
+
className: `w-8 px-1 py-2.5 flex items-center justify-center text-gray-200 hover:opacity-100 opacity-30 hover:bg-gray-50 ${disabled && "pointer-events-none opacity-30 cursor-not-allowed"}`,
|
|
5730
5731
|
onClick
|
|
5731
5732
|
},
|
|
5732
|
-
/* @__PURE__ */ React.createElement(TrashIcon, { className: "fill-current transition-colors ease-out
|
|
5733
|
+
/* @__PURE__ */ React.createElement(TrashIcon, { className: "h-5 w-auto fill-current text-red-500 transition-colors duration-150 ease-out" })
|
|
5733
5734
|
);
|
|
5734
5735
|
};
|
|
5735
5736
|
const DragHandle = ({ isDragging }) => {
|
|
@@ -10332,7 +10333,7 @@ flowchart TD
|
|
|
10332
10333
|
"Event Log"
|
|
10333
10334
|
));
|
|
10334
10335
|
};
|
|
10335
|
-
const version = "2.
|
|
10336
|
+
const version = "2.5.0";
|
|
10336
10337
|
const Nav = ({
|
|
10337
10338
|
isLocalMode,
|
|
10338
10339
|
className = "",
|
|
@@ -30112,6 +30113,7 @@ mutation addPendingDocumentMutation(
|
|
|
30112
30113
|
relativePath
|
|
30113
30114
|
filename
|
|
30114
30115
|
extension
|
|
30116
|
+
hasReferences
|
|
30115
30117
|
}
|
|
30116
30118
|
}
|
|
30117
30119
|
}
|
|
@@ -30203,6 +30205,9 @@ mutation addPendingDocumentMutation(
|
|
|
30203
30205
|
document(collection:$collection, relativePath:$relativePath) {
|
|
30204
30206
|
... on Document {
|
|
30205
30207
|
_values
|
|
30208
|
+
_sys {
|
|
30209
|
+
hasReferences
|
|
30210
|
+
}
|
|
30206
30211
|
}
|
|
30207
30212
|
}
|
|
30208
30213
|
}`;
|
|
@@ -31929,6 +31934,23 @@ This will work when developing locally but NOT when deployed to production.
|
|
|
31929
31934
|
DeleteModal,
|
|
31930
31935
|
{
|
|
31931
31936
|
filename: vars.relativePath,
|
|
31937
|
+
checkRefsFunc: async () => {
|
|
31938
|
+
var _a2, _b2;
|
|
31939
|
+
try {
|
|
31940
|
+
const doc = await admin.fetchDocument(
|
|
31941
|
+
collection.name,
|
|
31942
|
+
vars.relativePath,
|
|
31943
|
+
true
|
|
31944
|
+
);
|
|
31945
|
+
return (_b2 = (_a2 = doc == null ? void 0 : doc.document) == null ? void 0 : _a2._sys) == null ? void 0 : _b2.hasReferences;
|
|
31946
|
+
} catch (error) {
|
|
31947
|
+
cms.alerts.error(
|
|
31948
|
+
"Document was not found, ask a developer for help or check the console for an error message"
|
|
31949
|
+
);
|
|
31950
|
+
console.error(error);
|
|
31951
|
+
throw error;
|
|
31952
|
+
}
|
|
31953
|
+
},
|
|
31932
31954
|
deleteFunc: async () => {
|
|
31933
31955
|
try {
|
|
31934
31956
|
await admin.deleteDocument(vars);
|
|
@@ -31937,6 +31959,12 @@ This will work when developing locally but NOT when deployed to production.
|
|
|
31937
31959
|
);
|
|
31938
31960
|
reFetchCollection();
|
|
31939
31961
|
} catch (error) {
|
|
31962
|
+
if (error.message.indexOf("has references")) {
|
|
31963
|
+
cms.alerts.error(
|
|
31964
|
+
error.message.split("\n ").filter(Boolean)[1]
|
|
31965
|
+
);
|
|
31966
|
+
return;
|
|
31967
|
+
}
|
|
31940
31968
|
cms.alerts.warn(
|
|
31941
31969
|
"Document was not deleted, ask a developer for help or check the console for an error message"
|
|
31942
31970
|
);
|
|
@@ -31988,6 +32016,12 @@ This will work when developing locally but NOT when deployed to production.
|
|
|
31988
32016
|
cms.alerts.info("Document was successfully renamed");
|
|
31989
32017
|
reFetchCollection();
|
|
31990
32018
|
} catch (error) {
|
|
32019
|
+
if (error.message.indexOf("has references")) {
|
|
32020
|
+
cms.alerts.error(
|
|
32021
|
+
error.message.split("\n ").filter(Boolean)[1]
|
|
32022
|
+
);
|
|
32023
|
+
return;
|
|
32024
|
+
}
|
|
31991
32025
|
cms.alerts.warn(
|
|
31992
32026
|
"Document was not renamed, ask a developer for help or check the console for an error message"
|
|
31993
32027
|
);
|
|
@@ -32461,8 +32495,19 @@ This will work when developing locally but NOT when deployed to production.
|
|
|
32461
32495
|
const NoDocumentsPlaceholder = () => {
|
|
32462
32496
|
return /* @__PURE__ */ React.createElement("div", { className: "text-center px-5 py-3 flex flex-col items-center justify-center shadow border border-gray-100 bg-gray-50 border-b border-gray-200 w-full max-w-full rounded-lg" }, /* @__PURE__ */ React.createElement("p", { className: "text-base italic font-medium text-gray-300" }, "No documents found."));
|
|
32463
32497
|
};
|
|
32464
|
-
const DeleteModal = ({
|
|
32465
|
-
|
|
32498
|
+
const DeleteModal = ({
|
|
32499
|
+
close: close2,
|
|
32500
|
+
deleteFunc,
|
|
32501
|
+
checkRefsFunc,
|
|
32502
|
+
filename
|
|
32503
|
+
}) => {
|
|
32504
|
+
const [hasRefs, setHasRefs] = React.useState();
|
|
32505
|
+
React.useEffect(() => {
|
|
32506
|
+
checkRefsFunc().then((result) => {
|
|
32507
|
+
setHasRefs(result);
|
|
32508
|
+
});
|
|
32509
|
+
}, [filename, checkRefsFunc]);
|
|
32510
|
+
return /* @__PURE__ */ React.createElement(Modal, null, /* @__PURE__ */ React.createElement(PopupModal, null, /* @__PURE__ */ React.createElement(ModalHeader, { close: close2 }, "Delete ", filename), /* @__PURE__ */ React.createElement(ModalBody, { padded: true }, /* @__PURE__ */ React.createElement("p", null, `Are you sure you want to delete ${filename}?${hasRefs ? " References to this document will also be deleted." : ""}`)), /* @__PURE__ */ React.createElement(ModalActions, null, /* @__PURE__ */ React.createElement(Button$1, { style: { flexGrow: 2 }, onClick: close2 }, "Cancel"), /* @__PURE__ */ React.createElement(
|
|
32466
32511
|
Button$1,
|
|
32467
32512
|
{
|
|
32468
32513
|
style: { flexGrow: 3 },
|
package/dist/index.mjs
CHANGED
|
@@ -5753,10 +5753,11 @@ const ItemDeleteButton = ({ onClick, disabled = false }) => {
|
|
|
5753
5753
|
return /* @__PURE__ */ React__default.createElement(
|
|
5754
5754
|
"button",
|
|
5755
5755
|
{
|
|
5756
|
-
|
|
5756
|
+
type: "button",
|
|
5757
|
+
className: `w-8 px-1 py-2.5 flex items-center justify-center text-gray-200 hover:opacity-100 opacity-30 hover:bg-gray-50 ${disabled && "pointer-events-none opacity-30 cursor-not-allowed"}`,
|
|
5757
5758
|
onClick
|
|
5758
5759
|
},
|
|
5759
|
-
/* @__PURE__ */ React__default.createElement(TrashIcon, { className: "fill-current transition-colors ease-out
|
|
5760
|
+
/* @__PURE__ */ React__default.createElement(TrashIcon, { className: "h-5 w-auto fill-current text-red-500 transition-colors duration-150 ease-out" })
|
|
5760
5761
|
);
|
|
5761
5762
|
};
|
|
5762
5763
|
const DragHandle = ({ isDragging }) => {
|
|
@@ -10359,7 +10360,7 @@ const SyncStatus = ({ cms, setEventsOpen }) => {
|
|
|
10359
10360
|
"Event Log"
|
|
10360
10361
|
));
|
|
10361
10362
|
};
|
|
10362
|
-
const version = "2.
|
|
10363
|
+
const version = "2.5.0";
|
|
10363
10364
|
const Nav = ({
|
|
10364
10365
|
isLocalMode,
|
|
10365
10366
|
className = "",
|
|
@@ -30139,6 +30140,7 @@ class TinaAdminApi {
|
|
|
30139
30140
|
relativePath
|
|
30140
30141
|
filename
|
|
30141
30142
|
extension
|
|
30143
|
+
hasReferences
|
|
30142
30144
|
}
|
|
30143
30145
|
}
|
|
30144
30146
|
}
|
|
@@ -30230,6 +30232,9 @@ class TinaAdminApi {
|
|
|
30230
30232
|
document(collection:$collection, relativePath:$relativePath) {
|
|
30231
30233
|
... on Document {
|
|
30232
30234
|
_values
|
|
30235
|
+
_sys {
|
|
30236
|
+
hasReferences
|
|
30237
|
+
}
|
|
30233
30238
|
}
|
|
30234
30239
|
}
|
|
30235
30240
|
}`;
|
|
@@ -31956,6 +31961,23 @@ const CollectionListPage = () => {
|
|
|
31956
31961
|
DeleteModal,
|
|
31957
31962
|
{
|
|
31958
31963
|
filename: vars.relativePath,
|
|
31964
|
+
checkRefsFunc: async () => {
|
|
31965
|
+
var _a2, _b2;
|
|
31966
|
+
try {
|
|
31967
|
+
const doc = await admin.fetchDocument(
|
|
31968
|
+
collection.name,
|
|
31969
|
+
vars.relativePath,
|
|
31970
|
+
true
|
|
31971
|
+
);
|
|
31972
|
+
return (_b2 = (_a2 = doc == null ? void 0 : doc.document) == null ? void 0 : _a2._sys) == null ? void 0 : _b2.hasReferences;
|
|
31973
|
+
} catch (error) {
|
|
31974
|
+
cms.alerts.error(
|
|
31975
|
+
"Document was not found, ask a developer for help or check the console for an error message"
|
|
31976
|
+
);
|
|
31977
|
+
console.error(error);
|
|
31978
|
+
throw error;
|
|
31979
|
+
}
|
|
31980
|
+
},
|
|
31959
31981
|
deleteFunc: async () => {
|
|
31960
31982
|
try {
|
|
31961
31983
|
await admin.deleteDocument(vars);
|
|
@@ -31964,6 +31986,12 @@ const CollectionListPage = () => {
|
|
|
31964
31986
|
);
|
|
31965
31987
|
reFetchCollection();
|
|
31966
31988
|
} catch (error) {
|
|
31989
|
+
if (error.message.indexOf("has references")) {
|
|
31990
|
+
cms.alerts.error(
|
|
31991
|
+
error.message.split("\n ").filter(Boolean)[1]
|
|
31992
|
+
);
|
|
31993
|
+
return;
|
|
31994
|
+
}
|
|
31967
31995
|
cms.alerts.warn(
|
|
31968
31996
|
"Document was not deleted, ask a developer for help or check the console for an error message"
|
|
31969
31997
|
);
|
|
@@ -32015,6 +32043,12 @@ const CollectionListPage = () => {
|
|
|
32015
32043
|
cms.alerts.info("Document was successfully renamed");
|
|
32016
32044
|
reFetchCollection();
|
|
32017
32045
|
} catch (error) {
|
|
32046
|
+
if (error.message.indexOf("has references")) {
|
|
32047
|
+
cms.alerts.error(
|
|
32048
|
+
error.message.split("\n ").filter(Boolean)[1]
|
|
32049
|
+
);
|
|
32050
|
+
return;
|
|
32051
|
+
}
|
|
32018
32052
|
cms.alerts.warn(
|
|
32019
32053
|
"Document was not renamed, ask a developer for help or check the console for an error message"
|
|
32020
32054
|
);
|
|
@@ -32488,8 +32522,19 @@ const Breadcrumb = ({ folder, navigate, collectionName }) => {
|
|
|
32488
32522
|
const NoDocumentsPlaceholder = () => {
|
|
32489
32523
|
return /* @__PURE__ */ React__default.createElement("div", { className: "text-center px-5 py-3 flex flex-col items-center justify-center shadow border border-gray-100 bg-gray-50 border-b border-gray-200 w-full max-w-full rounded-lg" }, /* @__PURE__ */ React__default.createElement("p", { className: "text-base italic font-medium text-gray-300" }, "No documents found."));
|
|
32490
32524
|
};
|
|
32491
|
-
const DeleteModal = ({
|
|
32492
|
-
|
|
32525
|
+
const DeleteModal = ({
|
|
32526
|
+
close: close2,
|
|
32527
|
+
deleteFunc,
|
|
32528
|
+
checkRefsFunc,
|
|
32529
|
+
filename
|
|
32530
|
+
}) => {
|
|
32531
|
+
const [hasRefs, setHasRefs] = React__default.useState();
|
|
32532
|
+
useEffect(() => {
|
|
32533
|
+
checkRefsFunc().then((result) => {
|
|
32534
|
+
setHasRefs(result);
|
|
32535
|
+
});
|
|
32536
|
+
}, [filename, checkRefsFunc]);
|
|
32537
|
+
return /* @__PURE__ */ React__default.createElement(Modal, null, /* @__PURE__ */ React__default.createElement(PopupModal, null, /* @__PURE__ */ React__default.createElement(ModalHeader, { close: close2 }, "Delete ", filename), /* @__PURE__ */ React__default.createElement(ModalBody, { padded: true }, /* @__PURE__ */ React__default.createElement("p", null, `Are you sure you want to delete ${filename}?${hasRefs ? " References to this document will also be deleted." : ""}`)), /* @__PURE__ */ React__default.createElement(ModalActions, null, /* @__PURE__ */ React__default.createElement(Button$1, { style: { flexGrow: 2 }, onClick: close2 }, "Cancel"), /* @__PURE__ */ React__default.createElement(
|
|
32493
32538
|
Button$1,
|
|
32494
32539
|
{
|
|
32495
32540
|
style: { flexGrow: 3 },
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tinacms",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.5.0",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"module": "./dist/index.mjs",
|
|
6
6
|
"exports": {
|
|
@@ -60,21 +60,21 @@
|
|
|
60
60
|
"typings": "dist/index.d.ts",
|
|
61
61
|
"license": "Apache-2.0",
|
|
62
62
|
"dependencies": {
|
|
63
|
-
"@ariakit/react": "^0.4.
|
|
64
|
-
"@floating-ui/dom": "^1.6.
|
|
63
|
+
"@ariakit/react": "^0.4.13",
|
|
64
|
+
"@floating-ui/dom": "^1.6.12",
|
|
65
65
|
"@floating-ui/react-dom": "^2.1.2",
|
|
66
|
-
"@graphql-inspector/core": "^6.
|
|
66
|
+
"@graphql-inspector/core": "^6.2.0",
|
|
67
67
|
"@headlessui/react": "2.1.8",
|
|
68
68
|
"@heroicons/react": "^1.0.6",
|
|
69
69
|
"@monaco-editor/react": "4.4.5",
|
|
70
|
-
"@radix-ui/react-checkbox": "^1.1.
|
|
71
|
-
"@radix-ui/react-dialog": "^1.1.
|
|
72
|
-
"@radix-ui/react-dropdown-menu": "^2.1.
|
|
73
|
-
"@radix-ui/react-popover": "^1.1.
|
|
70
|
+
"@radix-ui/react-checkbox": "^1.1.2",
|
|
71
|
+
"@radix-ui/react-dialog": "^1.1.2",
|
|
72
|
+
"@radix-ui/react-dropdown-menu": "^2.1.2",
|
|
73
|
+
"@radix-ui/react-popover": "^1.1.2",
|
|
74
74
|
"@radix-ui/react-separator": "^1.1.0",
|
|
75
75
|
"@radix-ui/react-slot": "^1.1.0",
|
|
76
76
|
"@radix-ui/react-toolbar": "^1.1.0",
|
|
77
|
-
"@radix-ui/react-tooltip": "^1.1.
|
|
77
|
+
"@radix-ui/react-tooltip": "^1.1.4",
|
|
78
78
|
"@react-hook/window-size": "^3.1.1",
|
|
79
79
|
"@udecode/cn": "^33.0.0",
|
|
80
80
|
"@udecode/plate": "^36.5.9",
|
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
"@udecode/plate-table": "36.5.8",
|
|
95
95
|
"class-variance-authority": "^0.7.0",
|
|
96
96
|
"clsx": "^2.1.1",
|
|
97
|
-
"cmdk": "^1.0.
|
|
97
|
+
"cmdk": "^1.0.4",
|
|
98
98
|
"color-string": "^1.9.1",
|
|
99
99
|
"crypto-js": "^4.2.0",
|
|
100
100
|
"date-fns": "2.30.0",
|
|
@@ -125,18 +125,18 @@
|
|
|
125
125
|
"slate-history": "^0.100.0",
|
|
126
126
|
"slate-hyperscript": "^0.100.0",
|
|
127
127
|
"slate-react": "^0.107.1",
|
|
128
|
-
"tailwind-merge": "^2.5.
|
|
128
|
+
"tailwind-merge": "^2.5.4",
|
|
129
129
|
"webfontloader": "1.6.28",
|
|
130
130
|
"yup": "^1.4.0",
|
|
131
131
|
"zod": "^3.23.8",
|
|
132
|
-
"@tinacms/mdx": "1.5.
|
|
133
|
-
"@tinacms/
|
|
134
|
-
"@tinacms/
|
|
132
|
+
"@tinacms/mdx": "1.5.2",
|
|
133
|
+
"@tinacms/search": "1.0.35",
|
|
134
|
+
"@tinacms/schema-tools": "1.6.8"
|
|
135
135
|
},
|
|
136
136
|
"devDependencies": {
|
|
137
|
-
"@graphql-tools/utils": "^10.5.
|
|
137
|
+
"@graphql-tools/utils": "^10.5.6",
|
|
138
138
|
"@testing-library/dom": "^10.4.0",
|
|
139
|
-
"@testing-library/jest-dom": "^6.
|
|
139
|
+
"@testing-library/jest-dom": "^6.6.3",
|
|
140
140
|
"@testing-library/react": "^16.0.1",
|
|
141
141
|
"@testing-library/user-event": "^14.5.2",
|
|
142
142
|
"@types/atob": "^2.1.4",
|
|
@@ -144,14 +144,14 @@
|
|
|
144
144
|
"@types/color-string": "^1.5.5",
|
|
145
145
|
"@types/lodash.debounce": "^4.0.9",
|
|
146
146
|
"@types/lodash.get": "^4.4.9",
|
|
147
|
-
"@types/node": "^22.
|
|
147
|
+
"@types/node": "^22.9.0",
|
|
148
148
|
"@types/prop-types": "^15.7.13",
|
|
149
|
-
"@types/react": "^18.3.
|
|
149
|
+
"@types/react": "^18.3.12",
|
|
150
150
|
"@types/react-beautiful-dnd": "^13.1.8",
|
|
151
151
|
"@types/react-color": "^3.0.12",
|
|
152
|
-
"@types/react-dom": "^18.3.
|
|
152
|
+
"@types/react-dom": "^18.3.1",
|
|
153
153
|
"@types/yup": "^0.32.0",
|
|
154
|
-
"happy-dom": "
|
|
154
|
+
"happy-dom": "15.10.2",
|
|
155
155
|
"identity-obj-proxy": "^3.0.0",
|
|
156
156
|
"isomorphic-fetch": "^3.0.0",
|
|
157
157
|
"jest-file-snapshot": "^0.7.0",
|
|
@@ -160,11 +160,11 @@
|
|
|
160
160
|
"react-dom": "^18.3.1",
|
|
161
161
|
"react-is": "^18.3.1",
|
|
162
162
|
"tsc-alias": "^1.8.10",
|
|
163
|
-
"tslib": "^2.
|
|
164
|
-
"typescript": "^5.6.
|
|
165
|
-
"vite": "^5.4.
|
|
166
|
-
"vitest": "^2.1.
|
|
167
|
-
"@tinacms/scripts": "1.3.
|
|
163
|
+
"tslib": "^2.8.1",
|
|
164
|
+
"typescript": "^5.6.3",
|
|
165
|
+
"vite": "^5.4.11",
|
|
166
|
+
"vitest": "^2.1.5",
|
|
167
|
+
"@tinacms/scripts": "1.3.1"
|
|
168
168
|
},
|
|
169
169
|
"peerDependencies": {
|
|
170
170
|
"react": ">=16.14.0",
|