@tinacms/schema-tools 0.1.7 → 0.1.8

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.
@@ -92,7 +92,7 @@ export interface UICollection {
92
92
  collection: TinaCloudCollection<true>;
93
93
  }) => string | undefined;
94
94
  }
95
- declare type DefaultItem<ReturnType> = () => ReturnType | ReturnType;
95
+ declare type DefaultItem<ReturnType> = ReturnType | (() => ReturnType);
96
96
  interface BaseCollection {
97
97
  label?: string;
98
98
  name: string;
@@ -266,6 +266,7 @@ interface ObjectTemplatesInnerWithList<WithNamespace extends boolean> extends Ob
266
266
  key?: string;
267
267
  label?: string;
268
268
  };
269
+ defaultItem?: DefaultItem<Record<string, any>>;
269
270
  } & UIField<any, string>);
270
271
  }
271
272
  interface ObjectTemplatesInnerWithoutList<WithNamespace extends boolean> extends ObjectTemplatesInnerBase<WithNamespace> {
@@ -293,6 +294,10 @@ interface ObjectTemplatesWithNamespace<WithNamespace extends boolean> extends Ti
293
294
  visualSelector?: boolean;
294
295
  required?: false;
295
296
  ui?: UIField<any, Record<string, any>> & {
297
+ itemProps?(item: Record<string, any>): {
298
+ key?: string;
299
+ label?: string;
300
+ };
296
301
  defaultItem?: DefaultItem<Record<string, any>>;
297
302
  };
298
303
  list?: boolean;
@@ -314,6 +319,10 @@ interface InnerObjectFields<WithNamespace extends boolean> extends TinaField {
314
319
  visualSelector?: boolean;
315
320
  required?: false;
316
321
  ui?: UIField<any, Record<string, any>> & {
322
+ itemProps?(item: Record<string, any>): {
323
+ key?: string;
324
+ label?: string;
325
+ };
317
326
  defaultItem?: DefaultItem<Record<string, any>>;
318
327
  };
319
328
  /**
@@ -331,6 +340,10 @@ interface InnerObjectFieldsWithNamespace<WithNamespace extends boolean> extends
331
340
  visualSelector?: boolean;
332
341
  required?: false;
333
342
  ui?: UIField<any, Record<string, any>> & {
343
+ itemProps?(item: Record<string, any>): {
344
+ key?: string;
345
+ label?: string;
346
+ };
334
347
  defaultItem?: DefaultItem<Record<string, any>>;
335
348
  };
336
349
  /**
@@ -400,6 +413,10 @@ export declare type CollectionTemplateableObject = {
400
413
  type: 'object';
401
414
  visualSelector?: boolean;
402
415
  ui?: UIField<any, Record<string, any>> & {
416
+ itemProps?(item: Record<string, any>): {
417
+ key?: string;
418
+ label?: string;
419
+ };
403
420
  defaultItem?: DefaultItem<Record<string, any>>;
404
421
  };
405
422
  required?: false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tinacms/schema-tools",
3
- "version": "0.1.7",
3
+ "version": "0.1.8",
4
4
  "main": "dist/index.js",
5
5
  "module": "./dist/index.es.js",
6
6
  "exports": {