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.
Files changed (87) hide show
  1. package/dist/admin/api.d.ts +4 -1
  2. package/dist/auth/AuthModal.d.ts +1 -4
  3. package/dist/auth/TinaCloudProvider.d.ts +0 -1
  4. package/dist/cache/node-cache.d.ts +6 -2
  5. package/dist/client.js +240 -181
  6. package/dist/index.js +120164 -118241
  7. package/dist/internalClient/index.d.ts +55 -2
  8. package/dist/react.js +209 -210
  9. package/dist/rich-text/index.d.ts +6 -0
  10. package/dist/rich-text/index.js +234 -230
  11. package/dist/rich-text/prism.js +16 -18
  12. package/dist/rich-text/static.d.ts +154 -0
  13. package/dist/rich-text/{index.mjs → static.js} +90 -96
  14. package/dist/tina-cms.d.ts +1 -1
  15. package/dist/toolkit/components/ProgressBar.d.ts +11 -0
  16. package/dist/toolkit/components/media/media-item.d.ts +10 -0
  17. package/dist/toolkit/components/ui/button.d.ts +11 -0
  18. package/dist/toolkit/components/ui/calendar.d.ts +8 -0
  19. package/dist/toolkit/components/ui/date-time-picker.d.ts +111 -0
  20. package/dist/toolkit/components/ui/input.d.ts +3 -0
  21. package/dist/toolkit/components/ui/popover.d.ts +7 -0
  22. package/dist/toolkit/components/ui/select.d.ts +13 -0
  23. package/dist/toolkit/fields/components/color-picker/block-widget.d.ts +3 -0
  24. package/dist/toolkit/fields/components/color-picker/color-input.d.ts +35 -0
  25. package/dist/toolkit/fields/components/color-picker/color-picker.d.ts +6 -2
  26. package/dist/toolkit/fields/components/color-picker/color-utils.d.ts +37 -0
  27. package/dist/toolkit/fields/components/color-picker/sketch-widget.d.ts +3 -0
  28. package/dist/toolkit/fields/components/select.d.ts +1 -1
  29. package/dist/toolkit/fields/plugins/button-toggle-field-plugin.d.ts +2 -2
  30. package/dist/toolkit/fields/plugins/checkbox-group-field-plugin.d.ts +2 -2
  31. package/dist/toolkit/fields/plugins/color-field-plugin.d.ts +1 -0
  32. package/dist/toolkit/fields/plugins/date-field-plugin.d.ts +0 -2
  33. package/dist/toolkit/fields/plugins/dnd-kit-wrapper.d.ts +49 -0
  34. package/dist/toolkit/fields/plugins/group-list-field-plugin.d.ts +3 -1
  35. package/dist/toolkit/fields/plugins/list-field-plugin.d.ts +3 -0
  36. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/editor.d.ts +2 -2
  37. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/blockquote-element.d.ts +1 -1
  38. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/button.d.ts +2 -2
  39. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/code-block/code-block-element.d.ts +1 -1
  40. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/code-line-element.d.ts +1 -1
  41. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/command.d.ts +7 -7
  42. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/list-element.d.ts +2 -2
  43. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/paragraph-element.d.ts +1 -1
  44. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/slash-input-element.d.ts +1 -1
  45. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/table/table-cell-element.d.ts +2 -2
  46. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/table/table-element.d.ts +1 -1
  47. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/table/table-row-element.d.ts +1 -1
  48. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/use-floating-toolbar-hook.d.ts +1 -1
  49. package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/ui/components.d.ts +20 -19
  50. package/dist/toolkit/fields/plugins/radio-group-field-plugin.d.ts +2 -2
  51. package/dist/toolkit/fields/plugins/select-field-plugin.d.ts +2 -2
  52. package/dist/toolkit/fields/plugins/toggle-field-plugin.d.ts +2 -2
  53. package/dist/toolkit/form-builder/create-branch-modal.d.ts +13 -0
  54. package/dist/toolkit/form-builder/editorial-workflow-constants.d.ts +17 -0
  55. package/dist/toolkit/form-builder/form-builder.d.ts +0 -11
  56. package/dist/toolkit/form-builder/index.d.ts +1 -0
  57. package/dist/toolkit/icons/TinaExtended.d.ts +4 -0
  58. package/dist/toolkit/icons/index.d.ts +1 -0
  59. package/dist/toolkit/index.d.ts +1 -1
  60. package/dist/toolkit/plugin-branch-switcher/branch-button.d.ts +3 -1
  61. package/dist/toolkit/react-modals/modal/modal-actions.d.ts +2 -1
  62. package/dist/toolkit/react-modals/modal/modal-header.d.ts +1 -1
  63. package/dist/toolkit/react-sidebar/components/NavMenuTrigger.d.ts +11 -0
  64. package/dist/toolkit/react-sidebar/components/VersionInfo.d.ts +2 -0
  65. package/dist/toolkit/react-sidebar/components/badge.d.ts +6 -0
  66. package/dist/toolkit/react-sidebar/components/callout.d.ts +5 -0
  67. package/dist/toolkit/react-sidebar/components/local-warning.d.ts +3 -1
  68. package/dist/toolkit/react-sidebar/components/nav-components.d.ts +11 -0
  69. package/dist/toolkit/react-sidebar/components/nav-context.d.ts +15 -0
  70. package/dist/toolkit/react-sidebar/components/nav.d.ts +3 -2
  71. package/dist/toolkit/react-sidebar/components/sidebar-body.d.ts +26 -1
  72. package/dist/toolkit/react-sidebar/index.d.ts +3 -0
  73. package/dist/toolkit/styles/button.d.ts +1 -1
  74. package/dist/toolkit/styles/dropdown-button.d.ts +75 -0
  75. package/dist/toolkit/styles/index.d.ts +1 -0
  76. package/dist/unifiedClient/index.d.ts +1 -1
  77. package/dist/utils/index.d.ts +1 -0
  78. package/package.json +34 -65
  79. package/dist/admin/pages/IndexingPage.d.ts +0 -2
  80. package/dist/client.mjs +0 -132
  81. package/dist/index.mjs +0 -121720
  82. package/dist/node-cache-5e8db9f0.mjs +0 -63
  83. package/dist/react.mjs +0 -252
  84. package/dist/rich-text/prism.mjs +0 -16
  85. package/dist/toolkit/react-datetime/DateTime.d.ts +0 -135
  86. package/dist/toolkit/react-sidebar/components/alert.d.ts +0 -5
  87. /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
- };