@nexo-labs/payload-taxonomies 0.9.2 → 0.9.4

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,8 +1,10 @@
1
1
  import { JSONSchema4 } from "json-schema";
2
2
  import type { CollectionConfig } from "payload";
3
3
  export declare const COLLECTION_SLUG_TAXONOMY: "taxonomy";
4
- type TaxonomyTypescriptSchema = Array<(args: {
5
- jsonSchema: JSONSchema4;
6
- }) => JSONSchema4>;
7
- export declare const taxonomiesCollection: (config: Partial<CollectionConfig>, typescriptSchema?: TaxonomyTypescriptSchema) => CollectionConfig;
4
+ type TaxonomyTypescriptSchema = {
5
+ payloadTypescriptSchema: Array<(args: {
6
+ jsonSchema: JSONSchema4;
7
+ }) => JSONSchema4>;
8
+ };
9
+ export declare const taxonomiesCollection: (config: Partial<CollectionConfig> & TaxonomyTypescriptSchema) => CollectionConfig;
8
10
  export {};
package/dist/taxonomy.js CHANGED
@@ -1,13 +1,14 @@
1
1
  export const COLLECTION_SLUG_TAXONOMY = 'taxonomy';
2
- export const taxonomiesCollection = (config, typescriptSchema) => ({
3
- ...config,
2
+ export const taxonomiesCollection = ({ payloadTypescriptSchema, ...config }) => ({
4
3
  slug: COLLECTION_SLUG_TAXONOMY,
4
+ ...config,
5
5
  labels: {
6
6
  singular: 'Taxonomia',
7
7
  plural: 'Taxonomias',
8
+ ...config.labels
8
9
  },
9
10
  admin: {
10
- useAsTitle: 'singular_name',
11
+ useAsTitle: 'title',
11
12
  group: 'Contenido',
12
13
  ...config.admin
13
14
  },
@@ -24,7 +25,7 @@ export const taxonomiesCollection = (config, typescriptSchema) => ({
24
25
  label: 'Payload Adicional',
25
26
  type: 'json',
26
27
  required: false,
27
- typescriptSchema
28
+ typescriptSchema: payloadTypescriptSchema
28
29
  },
29
30
  ...(config.fields ?? []),
30
31
  ],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nexo-labs/payload-taxonomies",
3
- "version": "0.9.2",
3
+ "version": "0.9.4",
4
4
  "description": "Taxonomies for Payload CMS",
5
5
  "type": "module",
6
6
  "publishConfig": {