tinacms 0.0.0-ad8dbc0-20241003000436 → 0.0.0-ad9a889-20250218035304
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/cache/node-cache.d.ts +1 -0
- package/dist/client.js +91 -62
- package/dist/client.mjs +50 -36
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1687 -1099
- package/dist/index.mjs +1677 -1085
- package/dist/node-cache-5e8db9f0.mjs +63 -0
- package/dist/react.d.ts +1 -0
- package/dist/react.js +10 -1
- package/dist/react.mjs +10 -1
- package/dist/rich-text/index.d.ts +3 -0
- package/dist/rich-text/index.js +45 -12
- package/dist/rich-text/index.mjs +45 -12
- package/dist/toolkit/fields/components/reference/reference-select.d.ts +2 -2
- package/dist/toolkit/fields/plugins/mdx-field-plugin/index.d.ts +4 -1
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/fixed-toolbar-buttons.d.ts +0 -4
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/icons.d.ts +2 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/mermaid-element.d.ts +11 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/mermaid-toolbar-button.d.ts +20 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/resizable.d.ts +39 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/table-cell-element.d.ts +27 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/table-dropdown-menu.d.ts +3 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/table-element.d.ts +14 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/table-row-element.d.ts +13 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/text-area.d.ts +5 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/index.d.ts +1 -1
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/core/common.d.ts +1 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/custom/mermaid-plugin.d.ts +2 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/ui/code-block/index.d.ts +4 -2
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/ui/components.d.ts +58 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/toolbar/toolbar-overrides.d.ts +11 -3
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/toolbar/toolbar-provider.d.ts +3 -3
- package/dist/toolkit/fields/plugins/wrap-field-with-meta.d.ts +8 -0
- package/dist/unifiedClient/index.d.ts +8 -1
- package/package.json +30 -28
- package/dist/__vite-browser-external-d06ac358.mjs +0 -4
- package/dist/node-cache-7fa2452c.mjs +0 -43
|
@@ -60,6 +60,16 @@ export declare const Components: () => {
|
|
|
60
60
|
editor: any;
|
|
61
61
|
element: any;
|
|
62
62
|
}) => React.JSX.Element;
|
|
63
|
+
mermaid: React.ForwardRefExoticComponent<Omit<Omit<{
|
|
64
|
+
elementToAttributes?: (element: import("@udecode/plate-common").TElement) => any;
|
|
65
|
+
} & Omit<{
|
|
66
|
+
as?: React.ElementType<any, keyof React.JSX.IntrinsicElements> | undefined;
|
|
67
|
+
asChild?: boolean | undefined;
|
|
68
|
+
} & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<any>, "ref"> & {
|
|
69
|
+
ref?: React.Ref<any>;
|
|
70
|
+
} & import("@udecode/plate-common").PlateRenderNodeProps<import("@udecode/plate-common").Value, import("@udecode/plate-common").PlateEditor<import("@udecode/plate-common").Value>> & {
|
|
71
|
+
element: import("@udecode/plate-common").TElement;
|
|
72
|
+
} & Omit<import("slate-react").RenderElementProps, "element"> & React.RefAttributes<HTMLDivElement>, "ref">, never> & React.RefAttributes<any>>;
|
|
63
73
|
blockquote: React.ForwardRefExoticComponent<Omit<Omit<{
|
|
64
74
|
elementToAttributes?: (element: import("@udecode/plate-common").TElement) => any;
|
|
65
75
|
} & Omit<{
|
|
@@ -215,4 +225,52 @@ export declare const Components: () => {
|
|
|
215
225
|
element: any;
|
|
216
226
|
children: any;
|
|
217
227
|
}) => React.JSX.Element;
|
|
228
|
+
table: React.ForwardRefExoticComponent<Omit<Omit<Omit<{
|
|
229
|
+
elementToAttributes?: (element: import("@udecode/plate-common").TElement) => any;
|
|
230
|
+
} & Omit<{
|
|
231
|
+
as?: React.ElementType<any, keyof React.JSX.IntrinsicElements> | undefined;
|
|
232
|
+
asChild?: boolean | undefined;
|
|
233
|
+
} & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<any>, "ref"> & {
|
|
234
|
+
ref?: React.Ref<any>;
|
|
235
|
+
} & import("@udecode/plate-common").PlateRenderNodeProps<import("@udecode/plate-common").Value, import("@udecode/plate-common").PlateEditor<import("@udecode/plate-common").Value>> & {
|
|
236
|
+
element: import("@udecode/plate-common").TElement;
|
|
237
|
+
} & Omit<import("slate-react").RenderElementProps, "element"> & React.RefAttributes<HTMLDivElement>, "ref">, never> & React.RefAttributes<any>, "ref"> & React.RefAttributes<unknown>>;
|
|
238
|
+
tr: React.ForwardRefExoticComponent<{
|
|
239
|
+
hideBorder?: boolean;
|
|
240
|
+
} & Omit<Omit<{
|
|
241
|
+
elementToAttributes?: (element: import("@udecode/plate-common").TElement) => any;
|
|
242
|
+
} & Omit<{
|
|
243
|
+
as?: React.ElementType<any, keyof React.JSX.IntrinsicElements> | undefined;
|
|
244
|
+
asChild?: boolean | undefined;
|
|
245
|
+
} & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<any>, "ref"> & {
|
|
246
|
+
ref?: React.Ref<any>;
|
|
247
|
+
} & import("@udecode/plate-common").PlateRenderNodeProps<import("@udecode/plate-common").Value, import("@udecode/plate-common").PlateEditor<import("@udecode/plate-common").Value>> & {
|
|
248
|
+
element: import("@udecode/plate-common").TElement;
|
|
249
|
+
} & Omit<import("slate-react").RenderElementProps, "element"> & React.RefAttributes<HTMLDivElement>, "ref">, "hideBorder"> & React.RefAttributes<any>>;
|
|
250
|
+
td: React.ForwardRefExoticComponent<{
|
|
251
|
+
hideBorder?: boolean;
|
|
252
|
+
isHeader?: boolean;
|
|
253
|
+
} & Omit<Omit<{
|
|
254
|
+
elementToAttributes?: (element: import("@udecode/plate-common").TElement) => any;
|
|
255
|
+
} & Omit<{
|
|
256
|
+
as?: React.ElementType<any, keyof React.JSX.IntrinsicElements> | undefined;
|
|
257
|
+
asChild?: boolean | undefined;
|
|
258
|
+
} & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<any>, "ref"> & {
|
|
259
|
+
ref?: React.Ref<any>;
|
|
260
|
+
} & import("@udecode/plate-common").PlateRenderNodeProps<import("@udecode/plate-common").Value, import("@udecode/plate-common").PlateEditor<import("@udecode/plate-common").Value>> & {
|
|
261
|
+
element: import("@udecode/plate-common").TElement;
|
|
262
|
+
} & Omit<import("slate-react").RenderElementProps, "element"> & React.RefAttributes<HTMLDivElement>, "ref">, "hideBorder" | "isHeader"> & React.RefAttributes<any>>;
|
|
263
|
+
th: React.ForwardRefExoticComponent<Omit<{
|
|
264
|
+
hideBorder?: boolean;
|
|
265
|
+
isHeader?: boolean;
|
|
266
|
+
} & Omit<Omit<{
|
|
267
|
+
elementToAttributes?: (element: import("@udecode/plate-common").TElement) => any;
|
|
268
|
+
} & Omit<{
|
|
269
|
+
as?: React.ElementType<any, keyof React.JSX.IntrinsicElements> | undefined;
|
|
270
|
+
asChild?: boolean | undefined;
|
|
271
|
+
} & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<any>, "ref"> & {
|
|
272
|
+
ref?: React.Ref<any>;
|
|
273
|
+
} & import("@udecode/plate-common").PlateRenderNodeProps<import("@udecode/plate-common").Value, import("@udecode/plate-common").PlateEditor<import("@udecode/plate-common").Value>> & {
|
|
274
|
+
element: import("@udecode/plate-common").TElement;
|
|
275
|
+
} & Omit<import("slate-react").RenderElementProps, "element"> & React.RefAttributes<HTMLDivElement>, "ref">, "hideBorder" | "isHeader"> & React.RefAttributes<any>, "ref"> & React.RefAttributes<any>>;
|
|
218
276
|
};
|
|
@@ -1,4 +1,12 @@
|
|
|
1
|
-
export type ToolbarOverrideType = 'heading' | 'link' | 'image' | 'quote' | 'ul' | 'ol' | 'code' | 'codeBlock' | 'bold' | 'italic' | 'raw' | 'embed';
|
|
2
|
-
export declare const
|
|
1
|
+
export type ToolbarOverrideType = 'heading' | 'link' | 'image' | 'quote' | 'ul' | 'ol' | 'code' | 'codeBlock' | 'bold' | 'italic' | 'mermaid' | 'raw' | 'embed' | 'table';
|
|
2
|
+
export declare const STANDARD_ICON_WIDTH = 32;
|
|
3
|
+
export declare const HEADING_ICON_WITH_TEXT = 127;
|
|
4
|
+
export declare const HEADING_ICON_ONLY = 58;
|
|
3
5
|
export declare const EMBED_ICON_WIDTH = 78;
|
|
4
|
-
export declare const
|
|
6
|
+
export declare const CONTAINER_MD_BREAKPOINT = 448;
|
|
7
|
+
export declare const FLOAT_BUTTON_WIDTH = 25;
|
|
8
|
+
export declare const HEADING_LABEL = "Headings";
|
|
9
|
+
export type ToolbarOverrides = {
|
|
10
|
+
toolbar?: ToolbarOverrideType[];
|
|
11
|
+
showFloatingToolbar?: boolean;
|
|
12
|
+
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type ReactNode } from 'react';
|
|
3
|
-
import type { MdxTemplate } from '../types';
|
|
4
3
|
import type { Form } from '../../../../../forms';
|
|
5
|
-
import type {
|
|
4
|
+
import type { MdxTemplate } from '../types';
|
|
5
|
+
import type { ToolbarOverrides, ToolbarOverrideType } from './toolbar-overrides';
|
|
6
6
|
interface ToolbarContextProps {
|
|
7
7
|
tinaForm: Form;
|
|
8
8
|
templates: MdxTemplate[];
|
|
9
|
-
overrides: ToolbarOverrideType[];
|
|
9
|
+
overrides: ToolbarOverrideType[] | ToolbarOverrides;
|
|
10
10
|
}
|
|
11
11
|
interface ToolbarProviderProps extends ToolbarContextProps {
|
|
12
12
|
children: ReactNode;
|
|
@@ -3,6 +3,14 @@ import { FieldProps } from './field-props';
|
|
|
3
3
|
import { Form } from '../../forms';
|
|
4
4
|
export type InputFieldType<ExtraFieldProps, InputProps> = FieldProps<InputProps> & ExtraFieldProps;
|
|
5
5
|
export declare function wrapFieldsWithMeta<ExtraFieldProps = {}, InputProps = {}>(Field: React.FunctionComponent<InputFieldType<ExtraFieldProps, InputProps>> | React.ComponentClass<InputFieldType<ExtraFieldProps, InputProps>>): (props: InputFieldType<ExtraFieldProps, InputProps>) => React.JSX.Element;
|
|
6
|
+
/**
|
|
7
|
+
* Same as wrapFieldsWithMeta but excludes the label, and description useful for fields that render their label and description
|
|
8
|
+
*/
|
|
9
|
+
export declare function wrapFieldWithNoHeader<ExtraFieldProps = {}, InputProps = {}>(Field: React.FunctionComponent<InputFieldType<ExtraFieldProps, InputProps>> | React.ComponentClass<InputFieldType<ExtraFieldProps, InputProps>>): (props: InputFieldType<ExtraFieldProps, InputProps>) => React.JSX.Element;
|
|
10
|
+
/**
|
|
11
|
+
* Same as above but excludes the label, useful for fields that have their own label
|
|
12
|
+
* @deprecated This function is deprecated and will be removed in future versions.
|
|
13
|
+
*/
|
|
6
14
|
export declare function wrapFieldWithError<ExtraFieldProps = {}, InputProps = {}>(Field: React.FunctionComponent<InputFieldType<ExtraFieldProps, InputProps>> | React.ComponentClass<InputFieldType<ExtraFieldProps, InputProps>>): (props: InputFieldType<ExtraFieldProps, InputProps>) => React.JSX.Element;
|
|
7
15
|
interface FieldMetaProps extends React.HTMLAttributes<HTMLElement> {
|
|
8
16
|
name: string;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import AsyncLock from 'async-lock';
|
|
2
|
+
import type { GraphQLError } from 'graphql';
|
|
1
3
|
import type { Config } from '@tinacms/schema-tools';
|
|
2
4
|
import type { Cache } from '../cache/index';
|
|
3
5
|
export declare const TINA_HOST = "content.tinajs.io";
|
|
@@ -25,12 +27,17 @@ export declare class TinaClient<GenQueries> {
|
|
|
25
27
|
queries: GenQueries;
|
|
26
28
|
errorPolicy: Config['client']['errorPolicy'];
|
|
27
29
|
initialized: boolean;
|
|
30
|
+
cacheLock: AsyncLock | undefined;
|
|
28
31
|
cacheDir: string;
|
|
29
32
|
cache: Cache;
|
|
30
33
|
constructor({ token, url, queries, errorPolicy, cacheDir, }: TinaClientArgs<GenQueries>);
|
|
31
34
|
init(): Promise<void>;
|
|
32
35
|
request<DataType extends Record<string, any> = any>({ errorPolicy, ...args }: TinaClientRequestArgs, options: {
|
|
33
36
|
fetchOptions?: Parameters<typeof fetch>[1];
|
|
34
|
-
}): Promise<
|
|
37
|
+
}): Promise<{
|
|
38
|
+
data: DataType;
|
|
39
|
+
errors: GraphQLError[] | null;
|
|
40
|
+
query: string;
|
|
41
|
+
}>;
|
|
35
42
|
}
|
|
36
43
|
export declare function createClient<GenQueries>(args: TinaClientArgs<GenQueries>): TinaClient<GenQueries>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tinacms",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-ad9a889-20250218035304",
|
|
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",
|
|
@@ -85,19 +85,20 @@
|
|
|
85
85
|
"@udecode/plate-common": "^36.5.9",
|
|
86
86
|
"@udecode/plate-floating": "^36.3.8",
|
|
87
87
|
"@udecode/plate-heading": "^36.0.12",
|
|
88
|
-
"@udecode/plate-indent": "^36.0.0",
|
|
89
88
|
"@udecode/plate-indent-list": "^36.5.2",
|
|
90
89
|
"@udecode/plate-link": "^36.5.9",
|
|
91
90
|
"@udecode/plate-list": "^36.5.2",
|
|
92
91
|
"@udecode/plate-paragraph": "^36.0.0",
|
|
92
|
+
"@udecode/plate-resizable": "36.0.0",
|
|
93
93
|
"@udecode/plate-slash-command": "^36.0.0",
|
|
94
|
+
"@udecode/plate-table": "36.5.8",
|
|
95
|
+
"async-lock": "^1.4.1",
|
|
94
96
|
"class-variance-authority": "^0.7.0",
|
|
95
97
|
"clsx": "^2.1.1",
|
|
96
|
-
"cmdk": "^1.0.
|
|
98
|
+
"cmdk": "^1.0.4",
|
|
97
99
|
"color-string": "^1.9.1",
|
|
98
100
|
"crypto-js": "^4.2.0",
|
|
99
101
|
"date-fns": "2.30.0",
|
|
100
|
-
"fetch-ponyfill": "^7.1.0",
|
|
101
102
|
"final-form": "4.20.10",
|
|
102
103
|
"final-form-arrays": "^3.1.0",
|
|
103
104
|
"final-form-set-field-data": "^1.0.2",
|
|
@@ -107,6 +108,7 @@
|
|
|
107
108
|
"lodash.get": "^4.4.2",
|
|
108
109
|
"lodash.set": "^4.3.2",
|
|
109
110
|
"lucide-react": "^0.424.0",
|
|
111
|
+
"mermaid": "9.3.0",
|
|
110
112
|
"moment": "2.29.4",
|
|
111
113
|
"monaco-editor": "0.31.0",
|
|
112
114
|
"prism-react-renderer": "^2.4.0",
|
|
@@ -117,24 +119,24 @@
|
|
|
117
119
|
"react-dropzone": "14.2.3",
|
|
118
120
|
"react-final-form": "^6.5.9",
|
|
119
121
|
"react-icons": "^5.3.0",
|
|
120
|
-
"react-onclickoutside": "^6.13.1",
|
|
121
122
|
"react-router-dom": "6.3.0",
|
|
123
|
+
"react-use": "^17.6.0",
|
|
122
124
|
"slate": "^0.103.0",
|
|
123
125
|
"slate-history": "^0.100.0",
|
|
124
126
|
"slate-hyperscript": "^0.100.0",
|
|
125
127
|
"slate-react": "^0.107.1",
|
|
126
|
-
"tailwind-merge": "^2.5.
|
|
128
|
+
"tailwind-merge": "^2.5.4",
|
|
127
129
|
"webfontloader": "1.6.28",
|
|
128
130
|
"yup": "^1.4.0",
|
|
129
131
|
"zod": "^3.23.8",
|
|
130
|
-
"@tinacms/
|
|
131
|
-
"@tinacms/
|
|
132
|
-
"@tinacms/
|
|
132
|
+
"@tinacms/schema-tools": "1.7.0",
|
|
133
|
+
"@tinacms/search": "1.0.39",
|
|
134
|
+
"@tinacms/mdx": "1.5.4"
|
|
133
135
|
},
|
|
134
136
|
"devDependencies": {
|
|
135
|
-
"@graphql-tools/utils": "^10.5.
|
|
137
|
+
"@graphql-tools/utils": "^10.5.6",
|
|
136
138
|
"@testing-library/dom": "^10.4.0",
|
|
137
|
-
"@testing-library/jest-dom": "^6.
|
|
139
|
+
"@testing-library/jest-dom": "^6.6.3",
|
|
138
140
|
"@testing-library/react": "^16.0.1",
|
|
139
141
|
"@testing-library/user-event": "^14.5.2",
|
|
140
142
|
"@types/atob": "^2.1.4",
|
|
@@ -142,14 +144,14 @@
|
|
|
142
144
|
"@types/color-string": "^1.5.5",
|
|
143
145
|
"@types/lodash.debounce": "^4.0.9",
|
|
144
146
|
"@types/lodash.get": "^4.4.9",
|
|
145
|
-
"@types/node": "^22.
|
|
147
|
+
"@types/node": "^22.9.0",
|
|
146
148
|
"@types/prop-types": "^15.7.13",
|
|
147
|
-
"@types/react": "^18.3.
|
|
149
|
+
"@types/react": "^18.3.12",
|
|
148
150
|
"@types/react-beautiful-dnd": "^13.1.8",
|
|
149
151
|
"@types/react-color": "^3.0.12",
|
|
150
|
-
"@types/react-dom": "^18.3.
|
|
152
|
+
"@types/react-dom": "^18.3.1",
|
|
151
153
|
"@types/yup": "^0.32.0",
|
|
152
|
-
"happy-dom": "
|
|
154
|
+
"happy-dom": "15.10.2",
|
|
153
155
|
"identity-obj-proxy": "^3.0.0",
|
|
154
156
|
"isomorphic-fetch": "^3.0.0",
|
|
155
157
|
"jest-file-snapshot": "^0.7.0",
|
|
@@ -158,11 +160,11 @@
|
|
|
158
160
|
"react-dom": "^18.3.1",
|
|
159
161
|
"react-is": "^18.3.1",
|
|
160
162
|
"tsc-alias": "^1.8.10",
|
|
161
|
-
"tslib": "^2.
|
|
162
|
-
"typescript": "^5.6.
|
|
163
|
-
"vite": "^5.4.
|
|
164
|
-
"vitest": "^2.1.
|
|
165
|
-
"@tinacms/scripts": "1.
|
|
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"
|
|
166
168
|
},
|
|
167
169
|
"peerDependencies": {
|
|
168
170
|
"react": ">=16.14.0",
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
const makeCacheDir = async (dir, fs) => {
|
|
2
|
-
const path = await import("./__vite-browser-external-d06ac358.mjs");
|
|
3
|
-
const os = await import("./__vite-browser-external-d06ac358.mjs");
|
|
4
|
-
const parts = dir.split(path.sep).filter(Boolean);
|
|
5
|
-
let cacheDir = dir;
|
|
6
|
-
if (!fs.existsSync(path.join(path.sep, parts[0]))) {
|
|
7
|
-
cacheDir = path.join(os.tmpdir(), parts[parts.length - 1]);
|
|
8
|
-
}
|
|
9
|
-
fs.mkdirSync(cacheDir, { recursive: true });
|
|
10
|
-
return cacheDir;
|
|
11
|
-
};
|
|
12
|
-
const NodeCache = async (dir) => {
|
|
13
|
-
const fs = await import("./__vite-browser-external-d06ac358.mjs");
|
|
14
|
-
const { createHash } = await import("./__vite-browser-external-d06ac358.mjs");
|
|
15
|
-
const cacheDir = await makeCacheDir(dir, fs);
|
|
16
|
-
return {
|
|
17
|
-
makeKey: (key) => {
|
|
18
|
-
const input = key && key instanceof Object ? JSON.stringify(key) : key || "";
|
|
19
|
-
return createHash("sha256").update(input).digest("hex");
|
|
20
|
-
},
|
|
21
|
-
get: async (key) => {
|
|
22
|
-
try {
|
|
23
|
-
const data = await fs.promises.readFile(`${cacheDir}/${key}`, "utf-8");
|
|
24
|
-
return JSON.parse(data);
|
|
25
|
-
} catch (e) {
|
|
26
|
-
if (e.code === "ENOENT") {
|
|
27
|
-
return void 0;
|
|
28
|
-
}
|
|
29
|
-
throw e;
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
set: async (key, value) => {
|
|
33
|
-
await fs.promises.writeFile(
|
|
34
|
-
`${cacheDir}/${key}`,
|
|
35
|
-
JSON.stringify(value),
|
|
36
|
-
"utf-8"
|
|
37
|
-
);
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
};
|
|
41
|
-
export {
|
|
42
|
-
NodeCache
|
|
43
|
-
};
|