tinacms 0.0.0-f717193-20251205011605 → 0.0.0-f894432-20251221235528

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.
@@ -173,17 +173,30 @@ export declare class LocalClient extends Client {
173
173
  export declare class TinaCMSSearchClient implements SearchClient {
174
174
  private client;
175
175
  private tinaSearchConfig?;
176
+ private fuzzyEnabled;
177
+ private defaultFuzzyOptions?;
176
178
  constructor(client: Client, tinaSearchConfig?: {
177
179
  stopwordLanguages?: string[];
180
+ fuzzyEnabled?: boolean;
181
+ fuzzyOptions?: {
182
+ maxDistance?: number;
183
+ minSimilarity?: number;
184
+ maxResults?: number;
185
+ useTranspositions?: boolean;
186
+ caseSensitive?: boolean;
187
+ };
178
188
  });
179
189
  query(query: string, options?: {
180
190
  limit?: number;
181
191
  cursor?: string;
192
+ fuzzy?: boolean;
193
+ fuzzyOptions?: any;
182
194
  }): Promise<{
183
195
  results: any[];
184
196
  nextCursor: string | null;
185
197
  total: number;
186
198
  prevCursor: string | null;
199
+ fuzzyMatches?: Record<string, any[]>;
187
200
  }>;
188
201
  del(ids: string[]): Promise<any>;
189
202
  put(docs: any[]): Promise<any>;
@@ -191,15 +204,30 @@ export declare class TinaCMSSearchClient implements SearchClient {
191
204
  }
192
205
  export declare class LocalSearchClient implements SearchClient {
193
206
  private client;
194
- constructor(client: Client);
207
+ private tinaSearchConfig?;
208
+ private fuzzyEnabled;
209
+ private defaultFuzzyOptions?;
210
+ constructor(client: Client, tinaSearchConfig?: {
211
+ fuzzyEnabled?: boolean;
212
+ fuzzyOptions?: {
213
+ maxDistance?: number;
214
+ minSimilarity?: number;
215
+ maxResults?: number;
216
+ useTranspositions?: boolean;
217
+ caseSensitive?: boolean;
218
+ };
219
+ });
195
220
  query(query: string, options?: {
196
221
  limit?: number;
197
222
  cursor?: string;
223
+ fuzzy?: boolean;
224
+ fuzzyOptions?: any;
198
225
  }): Promise<{
199
226
  results: any[];
200
227
  nextCursor: string | null;
201
228
  total: number;
202
229
  prevCursor: string | null;
230
+ fuzzyMatches?: Record<string, any[]>;
203
231
  }>;
204
232
  del(ids: string[]): Promise<any>;
205
233
  put(docs: any[]): Promise<any>;
@@ -1,6 +1,6 @@
1
1
  import 'moment-timezone';
2
2
  import * as React from 'react';
3
- import { DayPickerProps } from 'react-day-picker';
3
+ import { type DayPickerProps } from 'react-day-picker';
4
4
  type TimePickerType = 'minutes' | 'seconds' | 'hours' | '12hours';
5
5
  type Period = 'AM' | 'PM';
6
6
  declare const formatCurrentDate: ({ dateFormat, timeFormat, displayDate, }: {
@@ -3,12 +3,12 @@ import { type VariantProps } from 'class-variance-authority';
3
3
  export declare const buttonVariants: (props?: {
4
4
  isMenu?: boolean;
5
5
  size?: "default" | "none" | "icon" | "sm" | "lg" | "sms" | "xs";
6
- variant?: "default" | "link" | "secondary" | "ghost" | "destructive" | "outline" | "inlineLink";
6
+ variant?: "default" | "link" | "secondary" | "ghost" | "destructive" | "outline" | "inlineLink" | "tinaPrimary";
7
7
  } & import("class-variance-authority/types").ClassProp) => string;
8
8
  export declare const Button: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
9
9
  asChild?: boolean;
10
10
  } & VariantProps<(props?: {
11
11
  isMenu?: boolean;
12
12
  size?: "default" | "none" | "icon" | "sm" | "lg" | "sms" | "xs";
13
- variant?: "default" | "link" | "secondary" | "ghost" | "destructive" | "outline" | "inlineLink";
13
+ variant?: "default" | "link" | "secondary" | "ghost" | "destructive" | "outline" | "inlineLink" | "tinaPrimary";
14
14
  } & import("class-variance-authority/types").ClassProp) => string> & React.RefAttributes<HTMLButtonElement>>;
@@ -1,10 +1,11 @@
1
+ import { CodeLinePlugin } from '@udecode/plate-code-block/react';
1
2
  import React from 'react';
2
3
  import { CodeLeaf } from '../../components/plate-ui/code-leaf';
3
4
  import { CodeSyntaxLeaf } from '../../components/plate-ui/code-syntax-leaf';
4
5
  import { HrElement } from '../../components/plate-ui/hr-element';
5
6
  import { LinkElement } from '../../components/plate-ui/link-element';
6
7
  export declare const Components: () => {
7
- [x: number]: React.ForwardRefExoticComponent<Omit<Omit<import("@udecode/plate/react").PlateElementProps<import("@udecode/plate").TElement, import("@udecode/plate").AnyPluginConfig>, keyof {
8
+ [CodeLinePlugin.key]: React.ForwardRefExoticComponent<Omit<Omit<import("@udecode/plate/react").PlateElementProps<import("@udecode/plate").TElement, import("@udecode/plate").AnyPluginConfig>, keyof {
8
9
  className?: string;
9
10
  style?: React.CSSProperties;
10
11
  }> & import("@udecode/plate").BasePluginContext<import("@udecode/plate").AnyPluginConfig> & {
@@ -9,8 +9,33 @@ export interface FormHeaderProps {
9
9
  activeFieldName?: string;
10
10
  tinaForm: Form;
11
11
  };
12
+ branch?: string;
13
+ isLocalMode?: boolean;
14
+ repoProvider?: {
15
+ defaultBranchName?: string;
16
+ historyUrl?: (context: {
17
+ relativePath: string;
18
+ branch: string;
19
+ }) => {
20
+ url: string;
21
+ };
22
+ };
23
+ }
24
+ export declare const FormHeader: ({ activeForm, repoProvider, branch, isLocalMode, }: FormHeaderProps) => React.JSX.Element;
25
+ interface RepositoryProviderProps {
26
+ contentRelativePath: string;
27
+ tinaBranch?: string;
28
+ isLocalMode?: boolean;
29
+ defaultBranchName?: string;
30
+ historyUrl?: (context: {
31
+ relativePath: string;
32
+ branch: string;
33
+ }) => {
34
+ url: string;
35
+ };
12
36
  }
13
- export declare const FormHeader: ({ activeForm }: FormHeaderProps) => React.JSX.Element;
37
+ export declare const FileHistoryProvider: ({ contentRelativePath, tinaBranch, defaultBranchName, historyUrl, isLocalMode, }: RepositoryProviderProps) => React.JSX.Element;
14
38
  export declare const FormBreadcrumbs: ({ rootBreadcrumbName, ...props }: {
15
39
  rootBreadcrumbName?: string;
16
40
  } & React.HTMLAttributes<HTMLDivElement>) => React.JSX.Element;
41
+ export {};
@@ -29,7 +29,7 @@ export declare class TinaClient<GenQueries> {
29
29
  initialized: boolean;
30
30
  cacheLock: AsyncLock | undefined;
31
31
  cacheDir: string;
32
- cache: Cache;
32
+ cache: Cache | null;
33
33
  constructor({ token, url, queries, errorPolicy, cacheDir, }: TinaClientArgs<GenQueries>);
34
34
  init(): Promise<void>;
35
35
  request<DataType extends Record<string, any> = any>({ errorPolicy, ...args }: TinaClientRequestArgs, options: {
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "tinacms",
3
3
  "type": "module",
4
4
  "typings": "dist/index.d.ts",
5
- "version": "0.0.0-f717193-20251205011605",
5
+ "version": "0.0.0-f894432-20251221235528",
6
6
  "main": "dist/index.js",
7
7
  "module": "./dist/index.js",
8
8
  "exports": {
@@ -25,18 +25,11 @@
25
25
  "src/rich-text/static.tsx",
26
26
  "src/rich-text/prism.tsx",
27
27
  "src/react.tsx",
28
- "src/client.ts"
29
- ],
30
- "build": {
31
- "rollupOptions": {
32
- "external": [
33
- "crypto",
34
- "fs",
35
- "path",
36
- "os"
37
- ]
28
+ {
29
+ "name": "src/client.ts",
30
+ "target": "node"
38
31
  }
39
- }
32
+ ]
40
33
  },
41
34
  "license": "Apache-2.0",
42
35
  "dependencies": {
@@ -117,9 +110,9 @@
117
110
  "webfontloader": "1.6.28",
118
111
  "yup": "^1.6.1",
119
112
  "zod": "^3.24.2",
120
- "@tinacms/mdx": "2.0.0",
121
- "@tinacms/schema-tools": "2.0.0",
122
- "@tinacms/search": "1.1.4"
113
+ "@tinacms/mdx": "0.0.0-f894432-20251221235528",
114
+ "@tinacms/schema-tools": "0.0.0-f894432-20251221235528",
115
+ "@tinacms/search": "0.0.0-f894432-20251221235528"
123
116
  },
124
117
  "devDependencies": {
125
118
  "@graphql-tools/utils": "^10.8.1",
@@ -136,10 +129,9 @@
136
129
  "@types/react-dom": "^18.3.5",
137
130
  "happy-dom": "15.10.2",
138
131
  "identity-obj-proxy": "^3.0.0",
139
- "isomorphic-fetch": "^3.0.0",
140
132
  "jest-file-snapshot": "^0.7.0",
141
133
  "lowlight": "^3.3.0",
142
- "next": "14.2.10",
134
+ "next": "14.2.35",
143
135
  "react": "^18.3.1",
144
136
  "react-dom": "^18.3.1",
145
137
  "react-is": "^18.3.1",
@@ -148,7 +140,7 @@
148
140
  "typescript": "^5.7.3",
149
141
  "vite": "^5.4.14",
150
142
  "vitest": "^2.1.9",
151
- "@tinacms/scripts": "1.4.1"
143
+ "@tinacms/scripts": "1.4.2"
152
144
  },
153
145
  "peerDependencies": {
154
146
  "react": ">=16.14.0",
@@ -1,4 +0,0 @@
1
- const __viteBrowserExternal = {};
2
- export {
3
- __viteBrowserExternal as default
4
- };
@@ -1,63 +0,0 @@
1
- const makeCacheDir = async (dir, fs, path, os) => {
2
- const pathParts = dir.split(path.sep).filter(Boolean);
3
- const cacheHash = pathParts[pathParts.length - 1];
4
- const rootUser = pathParts[0];
5
- let cacheDir = dir;
6
- if (!fs.existsSync(path.join(path.sep, rootUser))) {
7
- cacheDir = path.join(os.tmpdir(), cacheHash);
8
- }
9
- try {
10
- fs.mkdirSync(cacheDir, { recursive: true });
11
- } catch (error) {
12
- throw new Error(`Failed to create cache directory: ${error.message}`);
13
- }
14
- return cacheDir;
15
- };
16
- const NodeCache = async (dir) => {
17
- const fs = await import("./__vite-browser-external-d06ac358.js");
18
- const path = await import("./__vite-browser-external-d06ac358.js");
19
- const os = await import("./__vite-browser-external-d06ac358.js");
20
- const crypto = await import("./__vite-browser-external-d06ac358.js");
21
- const cacheDir = await makeCacheDir(dir, fs, path, os);
22
- return {
23
- makeKey: (key) => {
24
- const input = key && key instanceof Object ? JSON.stringify(key) : key || "";
25
- return crypto.createHash("sha256").update(input).digest("hex");
26
- },
27
- get: async (key) => {
28
- let readValue;
29
- const cacheFilename = `${cacheDir}/${key}`;
30
- try {
31
- const data = await fs.promises.readFile(cacheFilename, "utf-8");
32
- readValue = JSON.parse(data);
33
- } catch (e) {
34
- if (e.code !== "ENOENT") {
35
- console.error(
36
- `Failed to read cache file to ${cacheFilename}: ${e.message}`
37
- );
38
- }
39
- }
40
- return readValue;
41
- },
42
- set: async (key, value) => {
43
- const cacheFilename = `${cacheDir}/${key}`;
44
- try {
45
- await fs.promises.writeFile(cacheFilename, JSON.stringify(value), {
46
- encoding: "utf-8",
47
- flag: "wx"
48
- // Don't overwrite existing caches
49
- });
50
- } catch (e) {
51
- if (e.code !== "EEXIST") {
52
- console.error(
53
- `Failed to write cache file to ${cacheFilename}: ${e.message}`
54
- );
55
- }
56
- }
57
- }
58
- };
59
- };
60
- export {
61
- NodeCache,
62
- makeCacheDir
63
- };