tinacms 0.0.0-a1ff961-20250623024558 → 0.0.0-a23fec8-20251217045135
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/api.d.ts +4 -1
- package/dist/auth/AuthModal.d.ts +1 -4
- package/dist/auth/TinaCloudProvider.d.ts +0 -1
- package/dist/cache/node-cache.d.ts +6 -2
- package/dist/client.js +240 -181
- package/dist/index.js +120164 -118241
- package/dist/internalClient/index.d.ts +55 -2
- package/dist/react.js +209 -210
- package/dist/rich-text/index.d.ts +6 -0
- package/dist/rich-text/index.js +234 -230
- package/dist/rich-text/prism.js +16 -18
- package/dist/rich-text/static.d.ts +154 -0
- package/dist/rich-text/{index.mjs → static.js} +90 -96
- package/dist/tina-cms.d.ts +1 -1
- package/dist/toolkit/components/ProgressBar.d.ts +11 -0
- package/dist/toolkit/components/media/media-item.d.ts +10 -0
- package/dist/toolkit/components/ui/button.d.ts +11 -0
- package/dist/toolkit/components/ui/calendar.d.ts +8 -0
- package/dist/toolkit/components/ui/date-time-picker.d.ts +111 -0
- package/dist/toolkit/components/ui/input.d.ts +3 -0
- package/dist/toolkit/components/ui/popover.d.ts +7 -0
- package/dist/toolkit/components/ui/select.d.ts +13 -0
- package/dist/toolkit/fields/components/color-picker/block-widget.d.ts +3 -0
- package/dist/toolkit/fields/components/color-picker/color-input.d.ts +35 -0
- package/dist/toolkit/fields/components/color-picker/color-picker.d.ts +6 -2
- package/dist/toolkit/fields/components/color-picker/color-utils.d.ts +37 -0
- package/dist/toolkit/fields/components/color-picker/sketch-widget.d.ts +3 -0
- package/dist/toolkit/fields/components/select.d.ts +1 -1
- package/dist/toolkit/fields/plugins/button-toggle-field-plugin.d.ts +2 -2
- package/dist/toolkit/fields/plugins/checkbox-group-field-plugin.d.ts +2 -2
- package/dist/toolkit/fields/plugins/color-field-plugin.d.ts +1 -0
- package/dist/toolkit/fields/plugins/date-field-plugin.d.ts +0 -2
- package/dist/toolkit/fields/plugins/dnd-kit-wrapper.d.ts +49 -0
- package/dist/toolkit/fields/plugins/group-list-field-plugin.d.ts +3 -1
- package/dist/toolkit/fields/plugins/list-field-plugin.d.ts +3 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/editor.d.ts +2 -2
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/blockquote-element.d.ts +1 -1
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/button.d.ts +2 -2
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/code-block/code-block-element.d.ts +1 -1
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/code-line-element.d.ts +1 -1
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/command.d.ts +7 -7
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/list-element.d.ts +2 -2
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/paragraph-element.d.ts +1 -1
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/slash-input-element.d.ts +1 -1
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/table/table-cell-element.d.ts +2 -2
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/table/table-element.d.ts +1 -1
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/table/table-row-element.d.ts +1 -1
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/use-floating-toolbar-hook.d.ts +1 -1
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/ui/components.d.ts +20 -19
- package/dist/toolkit/fields/plugins/radio-group-field-plugin.d.ts +2 -2
- package/dist/toolkit/fields/plugins/select-field-plugin.d.ts +2 -2
- package/dist/toolkit/fields/plugins/toggle-field-plugin.d.ts +2 -2
- package/dist/toolkit/form-builder/create-branch-modal.d.ts +13 -0
- package/dist/toolkit/form-builder/editorial-workflow-constants.d.ts +17 -0
- package/dist/toolkit/form-builder/form-builder.d.ts +0 -11
- package/dist/toolkit/form-builder/index.d.ts +1 -0
- package/dist/toolkit/icons/TinaExtended.d.ts +4 -0
- package/dist/toolkit/icons/index.d.ts +1 -0
- package/dist/toolkit/index.d.ts +1 -1
- package/dist/toolkit/plugin-branch-switcher/branch-button.d.ts +3 -1
- package/dist/toolkit/react-modals/modal/modal-actions.d.ts +2 -1
- package/dist/toolkit/react-modals/modal/modal-header.d.ts +1 -1
- package/dist/toolkit/react-sidebar/components/NavMenuTrigger.d.ts +11 -0
- package/dist/toolkit/react-sidebar/components/VersionInfo.d.ts +2 -0
- package/dist/toolkit/react-sidebar/components/badge.d.ts +6 -0
- package/dist/toolkit/react-sidebar/components/callout.d.ts +5 -0
- package/dist/toolkit/react-sidebar/components/local-warning.d.ts +3 -1
- package/dist/toolkit/react-sidebar/components/nav-components.d.ts +11 -0
- package/dist/toolkit/react-sidebar/components/nav-context.d.ts +15 -0
- package/dist/toolkit/react-sidebar/components/nav.d.ts +3 -2
- package/dist/toolkit/react-sidebar/components/sidebar-body.d.ts +26 -1
- package/dist/toolkit/react-sidebar/index.d.ts +3 -0
- package/dist/toolkit/styles/button.d.ts +1 -1
- package/dist/toolkit/styles/dropdown-button.d.ts +75 -0
- package/dist/toolkit/styles/index.d.ts +1 -0
- package/dist/unifiedClient/index.d.ts +1 -1
- package/dist/utils/index.d.ts +1 -0
- package/package.json +34 -65
- package/dist/admin/pages/IndexingPage.d.ts +0 -2
- package/dist/client.mjs +0 -132
- package/dist/index.mjs +0 -121720
- package/dist/node-cache-5e8db9f0.mjs +0 -63
- package/dist/react.mjs +0 -252
- package/dist/rich-text/prism.mjs +0 -16
- package/dist/toolkit/react-datetime/DateTime.d.ts +0 -135
- package/dist/toolkit/react-sidebar/components/alert.d.ts +0 -5
- /package/dist/admin/components/{Sidebar.d.ts → AdminNav.d.ts} +0 -0
package/dist/client.mjs
DELETED
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
import AsyncLock from "async-lock";
|
|
2
|
-
const TINA_HOST = "content.tinajs.io";
|
|
3
|
-
function replaceGithubPathSplit(url, replacement) {
|
|
4
|
-
const parts = url.split("github/");
|
|
5
|
-
if (parts.length > 1 && replacement) {
|
|
6
|
-
return parts[0] + "github/" + replacement;
|
|
7
|
-
} else {
|
|
8
|
-
return url;
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
class TinaClient {
|
|
12
|
-
constructor({
|
|
13
|
-
token,
|
|
14
|
-
url,
|
|
15
|
-
queries,
|
|
16
|
-
errorPolicy,
|
|
17
|
-
cacheDir
|
|
18
|
-
}) {
|
|
19
|
-
this.initialized = false;
|
|
20
|
-
this.apiUrl = url;
|
|
21
|
-
this.readonlyToken = token == null ? void 0 : token.trim();
|
|
22
|
-
this.queries = queries(this);
|
|
23
|
-
this.errorPolicy = errorPolicy || "throw";
|
|
24
|
-
this.cacheDir = cacheDir || "";
|
|
25
|
-
}
|
|
26
|
-
async init() {
|
|
27
|
-
if (this.initialized) {
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
try {
|
|
31
|
-
if (this.cacheDir && typeof window === "undefined" && typeof require !== "undefined") {
|
|
32
|
-
const { NodeCache } = await import("./node-cache-5e8db9f0.mjs");
|
|
33
|
-
this.cache = await NodeCache(this.cacheDir);
|
|
34
|
-
this.cacheLock = new AsyncLock();
|
|
35
|
-
}
|
|
36
|
-
} catch (e) {
|
|
37
|
-
console.error(e);
|
|
38
|
-
}
|
|
39
|
-
this.initialized = true;
|
|
40
|
-
}
|
|
41
|
-
async request({ errorPolicy, ...args }, options) {
|
|
42
|
-
var _a;
|
|
43
|
-
await this.init();
|
|
44
|
-
const errorPolicyDefined = errorPolicy || this.errorPolicy;
|
|
45
|
-
const headers = new Headers();
|
|
46
|
-
if (this.readonlyToken) {
|
|
47
|
-
headers.append("X-API-KEY", this.readonlyToken);
|
|
48
|
-
}
|
|
49
|
-
headers.append("Content-Type", "application/json");
|
|
50
|
-
if (options == null ? void 0 : options.fetchOptions) {
|
|
51
|
-
if ((_a = options == null ? void 0 : options.fetchOptions) == null ? void 0 : _a.headers) {
|
|
52
|
-
Object.entries(options.fetchOptions.headers).forEach(([key2, value]) => {
|
|
53
|
-
headers.append(key2, value);
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
const { headers: _, ...providedFetchOptions } = (options == null ? void 0 : options.fetchOptions) || {};
|
|
58
|
-
const bodyString = JSON.stringify({
|
|
59
|
-
query: args.query,
|
|
60
|
-
variables: (args == null ? void 0 : args.variables) || {}
|
|
61
|
-
});
|
|
62
|
-
const optionsObject = {
|
|
63
|
-
method: "POST",
|
|
64
|
-
headers,
|
|
65
|
-
body: bodyString,
|
|
66
|
-
redirect: "follow",
|
|
67
|
-
...providedFetchOptions
|
|
68
|
-
};
|
|
69
|
-
const draftBranch = headers.get("x-branch");
|
|
70
|
-
const url = replaceGithubPathSplit((args == null ? void 0 : args.url) || this.apiUrl, draftBranch);
|
|
71
|
-
let key = "";
|
|
72
|
-
let result;
|
|
73
|
-
if (this.cache) {
|
|
74
|
-
key = this.cache.makeKey(bodyString);
|
|
75
|
-
await this.cacheLock.acquire(key, async () => {
|
|
76
|
-
result = await this.cache.get(key);
|
|
77
|
-
if (!result) {
|
|
78
|
-
result = await requestFromServer(
|
|
79
|
-
url,
|
|
80
|
-
args.query,
|
|
81
|
-
optionsObject,
|
|
82
|
-
errorPolicyDefined
|
|
83
|
-
);
|
|
84
|
-
await this.cache.set(key, result);
|
|
85
|
-
}
|
|
86
|
-
});
|
|
87
|
-
} else {
|
|
88
|
-
result = await requestFromServer(
|
|
89
|
-
url,
|
|
90
|
-
args.query,
|
|
91
|
-
optionsObject,
|
|
92
|
-
errorPolicyDefined
|
|
93
|
-
);
|
|
94
|
-
}
|
|
95
|
-
return result;
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
async function requestFromServer(url, query, optionsObject, errorPolicyDefined) {
|
|
99
|
-
const res = await fetch(url, optionsObject);
|
|
100
|
-
if (!res.ok) {
|
|
101
|
-
let additionalInfo = "";
|
|
102
|
-
if (res.status === 401) {
|
|
103
|
-
additionalInfo = "Please check that your client ID, URL and read only token are configured properly.";
|
|
104
|
-
}
|
|
105
|
-
throw new Error(
|
|
106
|
-
`Server responded with status code ${res.status}, ${res.statusText}. ${additionalInfo ? additionalInfo : ""} Please see our FAQ for more information: https://tina.io/docs/errors/faq/`
|
|
107
|
-
);
|
|
108
|
-
}
|
|
109
|
-
const json = await res.json();
|
|
110
|
-
if (json.errors && errorPolicyDefined === "throw") {
|
|
111
|
-
throw new Error(
|
|
112
|
-
`Unable to fetch, please see our FAQ for more information: https://tina.io/docs/errors/faq/
|
|
113
|
-
Errors:
|
|
114
|
-
${json.errors.map((error) => error.message).join("\n")}`
|
|
115
|
-
);
|
|
116
|
-
}
|
|
117
|
-
const result = {
|
|
118
|
-
data: json == null ? void 0 : json.data,
|
|
119
|
-
errors: (json == null ? void 0 : json.errors) || null,
|
|
120
|
-
query
|
|
121
|
-
};
|
|
122
|
-
return result;
|
|
123
|
-
}
|
|
124
|
-
function createClient(args) {
|
|
125
|
-
const client = new TinaClient(args);
|
|
126
|
-
return client;
|
|
127
|
-
}
|
|
128
|
-
export {
|
|
129
|
-
TINA_HOST,
|
|
130
|
-
TinaClient,
|
|
131
|
-
createClient
|
|
132
|
-
};
|