tinacms 3.8.4 → 3.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client.js +14 -2
- package/dist/index.d.ts +0 -4
- package/dist/index.js +886 -293
- package/dist/internalClient/index.d.ts +30 -8
- package/dist/toolkit/components/media/media-workflow-overlay.d.ts +2 -0
- package/dist/toolkit/core/event.d.ts +15 -1
- package/dist/toolkit/core/media-store.default.d.ts +31 -4
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/command.d.ts +8 -8
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/input.d.ts +1 -1
- package/dist/toolkit/form-builder/create-branch-modal.d.ts +9 -0
- package/dist/toolkit/form-builder/editorial-workflow-progress-modal.d.ts +15 -0
- package/dist/toolkit/form-builder/editorial-workflow-utils.d.ts +20 -0
- package/dist/toolkit/form-builder/use-editorial-workflow.d.ts +2 -0
- package/dist/toolkit/git-client/git-client.d.ts +0 -6
- package/dist/toolkit/git-client/git-file.d.ts +1 -1
- package/dist/toolkit/index.d.ts +1 -0
- package/dist/toolkit/plugin-branch-switcher/branch-switcher.d.ts +2 -1
- package/dist/toolkit/plugin-branch-switcher/format-branch-name.d.ts +8 -0
- package/dist/toolkit/react-core/use-cms-event.d.ts +1 -1
- package/dist/unifiedClient/index.d.ts +9 -1
- package/package.json +1 -1
package/dist/client.js
CHANGED
|
@@ -126,6 +126,15 @@ function replaceGithubPathSplit(url, replacement) {
|
|
|
126
126
|
return url;
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
|
+
function isEdgeRuntimeWithoutFs() {
|
|
130
|
+
if (typeof navigator !== "undefined" && navigator.userAgent === "Cloudflare-Workers") {
|
|
131
|
+
return true;
|
|
132
|
+
}
|
|
133
|
+
if (typeof globalThis.EdgeRuntime !== "undefined") {
|
|
134
|
+
return true;
|
|
135
|
+
}
|
|
136
|
+
return false;
|
|
137
|
+
}
|
|
129
138
|
var TinaClient = class {
|
|
130
139
|
apiUrl;
|
|
131
140
|
readonlyToken;
|
|
@@ -135,25 +144,28 @@ var TinaClient = class {
|
|
|
135
144
|
cacheLock;
|
|
136
145
|
cacheDir;
|
|
137
146
|
cache;
|
|
147
|
+
cacheEnabled;
|
|
138
148
|
constructor({
|
|
139
149
|
token,
|
|
140
150
|
url,
|
|
141
151
|
queries,
|
|
142
152
|
errorPolicy,
|
|
143
|
-
cacheDir
|
|
153
|
+
cacheDir,
|
|
154
|
+
cache
|
|
144
155
|
}) {
|
|
145
156
|
this.apiUrl = url;
|
|
146
157
|
this.readonlyToken = token?.trim();
|
|
147
158
|
this.queries = queries(this);
|
|
148
159
|
this.errorPolicy = errorPolicy || "throw";
|
|
149
160
|
this.cacheDir = cacheDir || "";
|
|
161
|
+
this.cacheEnabled = cache !== false;
|
|
150
162
|
}
|
|
151
163
|
async init() {
|
|
152
164
|
if (this.initialized) {
|
|
153
165
|
return;
|
|
154
166
|
}
|
|
155
167
|
try {
|
|
156
|
-
if (this.cacheDir && typeof window === "undefined") {
|
|
168
|
+
if (this.cacheEnabled && this.cacheDir && typeof window === "undefined" && !isEdgeRuntimeWithoutFs()) {
|
|
157
169
|
const { NodeCache: NodeCache2 } = await Promise.resolve().then(() => (init_node_cache(), node_cache_exports));
|
|
158
170
|
this.cache = await NodeCache2(this.cacheDir);
|
|
159
171
|
if (this.cache) {
|
package/dist/index.d.ts
CHANGED
|
@@ -23,10 +23,6 @@ export { NAMER, resolveField } from '@tinacms/schema-tools';
|
|
|
23
23
|
export type { LoginScreenProps, LoginStrategy } from '@tinacms/schema-tools';
|
|
24
24
|
import { TinaSchema, TinaField, Config, Schema, Collection, Template } from '@tinacms/schema-tools';
|
|
25
25
|
export type { Config, Schema, Collection, Template, TinaField, TinaSchema };
|
|
26
|
-
/**
|
|
27
|
-
* @deprecated use `TinaField` instead
|
|
28
|
-
*/
|
|
29
|
-
export type TinaFieldEnriched = TinaField;
|
|
30
26
|
/**
|
|
31
27
|
* @deprecated use `TinaField` instead
|
|
32
28
|
*/
|