@nexo-labs/payload-taxonomies 0.9.0 → 0.9.2

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,3 +1,8 @@
1
+ import { JSONSchema4 } from "json-schema";
1
2
  import type { CollectionConfig } from "payload";
2
3
  export declare const COLLECTION_SLUG_TAXONOMY: "taxonomy";
3
- export declare const taxonomiesCollection: (config: Partial<CollectionConfig>) => CollectionConfig;
4
+ type TaxonomyTypescriptSchema = Array<(args: {
5
+ jsonSchema: JSONSchema4;
6
+ }) => JSONSchema4>;
7
+ export declare const taxonomiesCollection: (config: Partial<CollectionConfig>, typescriptSchema?: TaxonomyTypescriptSchema) => CollectionConfig;
8
+ export {};
package/dist/taxonomy.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export const COLLECTION_SLUG_TAXONOMY = 'taxonomy';
2
- export const taxonomiesCollection = (config) => ({
2
+ export const taxonomiesCollection = (config, typescriptSchema) => ({
3
3
  ...config,
4
4
  slug: COLLECTION_SLUG_TAXONOMY,
5
5
  labels: {
@@ -13,24 +13,18 @@ export const taxonomiesCollection = (config) => ({
13
13
  },
14
14
  fields: [
15
15
  {
16
- name: 'singular_name',
17
- label: 'Nombre singular',
16
+ name: 'title',
17
+ label: 'Título',
18
18
  type: 'text',
19
19
  localized: true,
20
20
  required: true,
21
21
  },
22
- {
23
- name: 'plural_name',
24
- label: 'Nombre plural',
25
- type: 'text',
26
- localized: true,
27
- required: false,
28
- },
29
22
  {
30
23
  name: 'payload',
31
24
  label: 'Payload Adicional',
32
25
  type: 'json',
33
26
  required: false,
27
+ typescriptSchema
34
28
  },
35
29
  ...(config.fields ?? []),
36
30
  ],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nexo-labs/payload-taxonomies",
3
- "version": "0.9.0",
3
+ "version": "0.9.2",
4
4
  "description": "Taxonomies for Payload CMS",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -24,7 +24,8 @@
24
24
  "peerDependencies": {
25
25
  "@payloadcms/ui": "^3.35.1",
26
26
  "payload": "3.35.1",
27
- "react": "^19.0.0"
27
+ "react": "^19.0.0",
28
+ "@types/json-schema": "^7.0.15"
28
29
  },
29
30
  "devDependencies": {
30
31
  "@types/node": "^22.0.0",