@tinacms/schema-tools 1.4.18 → 1.5.0

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.
@@ -1,4 +1,4 @@
1
- import { Schema, Collection, Template, Collectable, CollectionTemplateable, TinaField } from '../types/index';
1
+ import type { Schema, Collection, Template, Collectable, CollectionTemplateable, TinaField } from '../types/index';
2
2
  declare type Version = {
3
3
  fullVersion: string;
4
4
  major: string;
@@ -41,7 +41,7 @@ export declare class TinaSchema {
41
41
  }) => Template<true>;
42
42
  transformPayload: (collectionName: string, payload: object) => {
43
43
  [x: string]: {
44
- [x: string]: {};
44
+ [key: string]: unknown;
45
45
  };
46
46
  };
47
47
  private transformCollectablePayload;
@@ -76,6 +76,6 @@ export declare class TinaSchema {
76
76
  matchFiles({ collection, files, }: {
77
77
  collection: string | Collection;
78
78
  files: string[];
79
- }): any;
79
+ }): string[];
80
80
  }
81
81
  export {};
@@ -1,14 +1,14 @@
1
1
  /**
2
2
 
3
3
  */
4
- import { TinaField } from '../types/index';
5
- import { TinaSchema } from './TinaSchema';
4
+ import type { TinaField } from '../types/index';
5
+ import type { TinaSchema } from './TinaSchema';
6
6
  /**
7
7
  * Turns a field the schema (schema.{js,ts} file) into a valid front end FieldConfig
8
8
  */
9
9
  export declare const resolveField: (field: TinaField<true>, schema: TinaSchema) => {
10
10
  [key: string]: unknown;
11
11
  name: string;
12
- component: TinaField<true>['ui']['component'];
12
+ component: NonNullable<TinaField<true>['ui']>['component'];
13
13
  type: string;
14
14
  };
@@ -175,6 +175,7 @@ export declare type ReferenceField = (FieldGeneric<string, undefined> | FieldGen
175
175
  export declare type PasswordField = (FieldGeneric<string, undefined> | FieldGeneric<string, false>) & BaseField & {
176
176
  type: 'password';
177
177
  };
178
+ declare type toolbarItemName = 'heading' | 'link' | 'image' | 'quote' | 'ul' | 'ol' | 'code' | 'codeBlock' | 'bold' | 'italic' | 'raw';
178
179
  declare type RichTextAst = {
179
180
  type: 'root';
180
181
  children: Record<string, unknown>[];
@@ -187,6 +188,7 @@ export declare type RichTextField<WithNamespace extends boolean = false> = (Fiel
187
188
  * will be stored as frontmatter
188
189
  */
189
190
  isBody?: boolean;
191
+ toolbarOverride?: toolbarItemName[];
190
192
  templates?: RichTextTemplate<WithNamespace>[];
191
193
  /**
192
194
  * By default, Tina parses markdown with MDX, this is a more strict parser
@@ -333,6 +335,7 @@ export interface AuthProvider {
333
335
  getLoginScreen: () => FC<LoginScreenProps> | null;
334
336
  getSessionProvider: () => FC<{
335
337
  basePath?: string;
338
+ children?: React.ReactNode;
336
339
  }>;
337
340
  }
338
341
  interface AuthHooks {
@@ -1,7 +1,7 @@
1
1
  import type { Schema } from '../types/index';
2
2
  export { validateTinaCloudSchemaConfig } from './tinaCloudSchemaConfig';
3
3
  export declare class TinaSchemaValidationError extends Error {
4
- constructor(message: any);
4
+ constructor(message: string);
5
5
  }
6
6
  export declare const validateSchema: ({ schema }: {
7
7
  schema: Schema;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tinacms/schema-tools",
3
- "version": "1.4.18",
3
+ "version": "1.5.0",
4
4
  "main": "dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "exports": {
@@ -23,14 +23,16 @@
23
23
  ]
24
24
  },
25
25
  "devDependencies": {
26
+ "@types/jest": "^29.5.12",
26
27
  "@types/micromatch": "^4.0.2",
27
- "@types/react": "17.0.2",
28
+ "@types/react": "^18.3.3",
28
29
  "@types/yup": "^0.29.10",
29
30
  "jest": "^29.5.0",
30
- "react": "17.0.2",
31
+ "react": "^18.3.1",
32
+ "ts-jest": "^29.2.3",
31
33
  "typescript": "4.6.4",
32
34
  "yup": "^0.32.0",
33
- "@tinacms/scripts": "1.1.5"
35
+ "@tinacms/scripts": "1.1.6"
34
36
  },
35
37
  "peerDependencies": {
36
38
  "react": ">=16.14.0",
@@ -50,7 +52,7 @@
50
52
  },
51
53
  "scripts": {
52
54
  "build": "tinacms-scripts build",
53
- "test": "jest --passWithNoTests",
55
+ "test": "jest --config jest.config.js",
54
56
  "types": "pnpm tsc",
55
57
  "test-watch": "jest --passWithNoTests --watch",
56
58
  "generate:schema": "pnpm node scripts/generateSchema.js"