@payloadcms/plugin-nested-docs 1.0.9 → 1.0.10

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.
package/README.md CHANGED
@@ -1,248 +1,7 @@
1
1
  # Payload Nested Docs Plugin
2
2
 
3
- [![NPM](https://img.shields.io/npm/v/@payloadcms/plugin-nested-docs)](https://www.npmjs.com/package/@payloadcms/plugin-nested-docs)
3
+ A plugin for [Payload](https://github.com/payloadcms/payload) to easily nest the documents of your application inside of one another.
4
4
 
5
- A plugin for [Payload CMS](https://github.com/payloadcms/payload) to easily allow for documents to be nested inside one another.
6
-
7
- Core features:
8
-
9
- - Allows for [parent/child](#parent) relationships between documents
10
- - Automatically populates [breadcrumbs](#breadcrumbs) data
11
-
12
- ## Installation
13
-
14
- ```bash
15
- yarn add @payloadcms/plugin-nested-docs
16
- # OR
17
- npm i @payloadcms/plugin-nested-docs
18
- ```
19
-
20
- ## Basic Usage
21
-
22
- In the `plugins` array of your [Payload config](https://payloadcms.com/docs/configuration/overview), call the plugin with [options](#options):
23
-
24
- ```js
25
- import { buildConfig } from "payload/config";
26
- import nestedDocs from "@payloadcms/plugin-nested-docs";
27
-
28
- const config = buildConfig({
29
- collections: [
30
- {
31
- slug: "pages",
32
- fields: [
33
- {
34
- name: "title",
35
- type: "text",
36
- },
37
- {
38
- name: "slug",
39
- type: "text",
40
- },
41
- ],
42
- },
43
- ],
44
- plugins: [
45
- nestedDocs({
46
- collections: ["pages"],
47
- generateLabel: (_, doc) => doc.title,
48
- generateURL: (docs) =>
49
- docs.reduce((url, doc) => `${url}/${doc.slug}`, ""),
50
- }),
51
- ],
52
- });
53
-
54
- export default config;
55
- ```
56
-
57
- ### Fields
58
-
59
- #### Parent
60
-
61
- The `parent` relationship field is automatically added to every document which allows editors to choose another document from the same collection to act as the direct parent.
62
-
63
- #### Breadcrumbs
64
-
65
- The `breadcrumbs` field is an array which dynamically populates all parent relationships of a document up to the top level. It does not store any data in the database, and instead, acts as a `virtual` field which is dynamically populated each time the document is loaded.
66
-
67
- The `breadcrumbs` array stores the following fields:
68
-
69
- - `label`
70
-
71
- The label of the breadcrumb. This field is automatically set to either the `collection.admin.useAsTitle` (if defined) or is set to the `ID` of the document. You can also dynamically define the `label` by passing a function to the options property of [`generateLabel`](#generateLabel).
72
-
73
- - `url`
74
-
75
- The URL of the breadcrumb. By default, this field is undefined. You can manually define this field by passing a property called function to the plugin options property of [`generateURL`](#generateURL).
76
-
77
- ### Options
78
-
79
- #### `collections`
80
-
81
- An array of collections slugs to enable nested docs.
82
-
83
- #### `generateLabel`
84
-
85
- Each `breadcrumb` has a required `label` field. By default, its value will be set to the collection's `admin.useAsTitle` or fallback the the `ID` of the document.
86
-
87
- You can also pass a function to dynamically set the `label` of your breadcrumb.
88
-
89
- ```js
90
- {
91
- plugins: [
92
- ...
93
- nestedDocs({
94
- ...
95
- generateLabel: (_, doc) => doc.title // NOTE: 'title' is a hypothetical field
96
- })
97
- ]
98
- ```
99
-
100
- The function takes two arguments and returns a string:
101
-
102
- 1. `breadcrumbs` - an array of the breadcrumbs up to that point
103
- 2. `currentDoc` - the current document being edited
104
-
105
- #### `generateURL`
106
-
107
- A function that allows you to dynamically generate each breadcrumb `url`. Each `breadcrumb` has an optional `url` field which is undefined by default. For example, you might want to format a full URL to contain all of the breadcrumbs up to that point, like `/about-us/company/our-team`.
108
-
109
- ```js
110
- plugins: [
111
- ...
112
- nestedDocs({
113
- ...
114
- generateURL: (docs) => docs.reduce((url, doc) => `${url}/${doc.slug}`, ''), // NOTE: 'slug' is a hypothetical field
115
- })
116
- ]
117
- ```
118
-
119
- This function takes two arguments and returns a string:
120
-
121
- 1. `breadcrumbs` - an array of the breadcrumbs up to that point
122
- 1. `currentDoc` - the current document being edited
123
-
124
- #### `parentFieldSlug`
125
-
126
- When defined, the `parent` field will not be provided for you automatically, and instead, expects you to add your own `parent` field to each collection manually. This gives you complete control over where you put the field in your admin dashboard, etc. Set this property to the `name` of your custom field.
127
-
128
- #### `breadcrumbsFieldSlug`
129
-
130
- When defined, the `breadcrumbs` field will not be provided for you, and instead, expects your to add your own `breadcrumbs` field to each collection manually. Set this property to the `name` of your custom field.
131
-
132
- > Note - if you opt out of automatically being provided a `parent` or `breadcrumbs` field, you need to make sure that both fields are placed at the top-level of your document. They cannot exist within any nested data structures like a `group`, `array`, or `blocks`.
133
-
134
- ## Overrides
135
-
136
- You can also extend the built-in `parent` and `breadcrumbs` fields per collection by using the `createParentField` and `createBreadcrumbField` methods. They will merge your customizations overtop the plugin's base field configurations.
137
-
138
- ```js
139
- import { CollectionConfig } from "payload/types";
140
- import createParentField from "@payloadcms/plugin-nested-docs/fields/parent";
141
- import createBreadcrumbsField from "@payloadcms/plugin-nested-docs/fields/breadcrumbs";
142
-
143
- const examplePageConfig: CollectionConfig = {
144
- slug: "pages",
145
- fields: [
146
- createParentField(
147
- // First argument is equal to the slug of the collection
148
- // that the field references
149
- "pages",
150
-
151
- // Second argument is equal to field overrides that you specify,
152
- // which will be merged into the base parent field config
153
- {
154
- admin: {
155
- position: "sidebar",
156
- },
157
- // Note: if you override the `filterOptions` of the `parent` field,
158
- // be sure to continue to prevent the document from referencing itself as the parent like this:
159
- // filterOptions: ({ id }) => ({ id: {not_equals: id }})`
160
- }
161
- ),
162
- createBreadcrumbsField(
163
- // First argument is equal to the slug of the collection
164
- // that the field references
165
- "pages",
166
-
167
- // Argument equal to field overrides that you specify,
168
- // which will be merged into the base `breadcrumbs` field config
169
- {
170
- label: "Page Breadcrumbs",
171
- }
172
- ),
173
- ],
174
- };
175
- ```
176
-
177
- ## Localization
178
-
179
- This plugin supports localization by default. If the `localization` property is set in your Payload config, the `breadcrumbs` field is automatically localized. For more details on how localization works in Payload, see the [Localization](https://payloadcms.com/docs/localization/overview) docs.
180
-
181
- ## TypeScript
182
-
183
- All types can be directly imported:
184
-
185
- ```js
186
- import {
187
- PluginConfig,
188
- GenerateURL,
189
- GenerateLabel,
190
- } from "@payloadcms/plugin-nested-docs/types";
191
- ```
192
-
193
- ## Development
194
-
195
- To actively develop or debug this plugin you can either work directly within the demo directory of this repo, or link your own project.
196
-
197
- 1. #### Internal Demo
198
-
199
- This repo includes a fully working, self-seeding instance of Payload that installs the plugin directly from the source code. This is the easiest way to get started. To spin up this demo, follow these steps:
200
-
201
- 1. First clone the repo
202
- 1. Then, `cd YOUR_PLUGIN_REPO && yarn && cd demo && yarn && yarn dev`
203
- 1. Now open `http://localhost:3000/admin` in your browser
204
- 1. Enter username `dev@payloadcms.com` and password `test`
205
-
206
- That's it! Changes made in `./src` will be reflected in your demo. Keep in mind that the demo database is automatically seeded on every startup, any changes you make to the data get destroyed each time you reboot the app.
207
-
208
- 1. #### Linked Project
209
-
210
- You can alternatively link your own project to the source code:
211
-
212
- 1. First clone the repo
213
- 1. Then, `cd YOUR_PLUGIN_REPO && yarn && cd demo && cp env.example .env && yarn && yarn dev`
214
- 1. Now `cd` back into your own project and run, `yarn link @payloadcms/plugin-nested-docs`
215
- 1. If this plugin using React in any way, continue to the next step. Otherwise skip to step 7.
216
- 1. From your own project, `cd node_modules/react && yarn link && cd ../react-dom && yarn link && cd ../../`
217
- 1. Then, `cd YOUR_PLUGIN_REPO && yarn link react react-dom`
218
-
219
- All set! You can now boot up your own project as normal, and your local copy of the plugin source code will be used. Keep in mind that changes to the source code require a rebuild, `yarn build`.
220
-
221
- You might also need to alias these modules in your Webpack config. To do this, open your project's Payload config and add the following:
222
-
223
- ```js
224
- import { buildConfig } from "payload/config";
225
-
226
- export default buildConfig({
227
- admin: {
228
- webpack: (config) => ({
229
- ...config,
230
- resolve: {
231
- ...config.resolve,
232
- alias: {
233
- ...config.resolve.alias,
234
- react: path.join(__dirname, "../node_modules/react"),
235
- "react-dom": path.join(__dirname, "../node_modules/react-dom"),
236
- payload: path.join(__dirname, "../node_modules/payload"),
237
- "@payloadcms/plugin-nested-docs": path.join(
238
- __dirname,
239
- "../../payload/plugin-nested-docs/src"
240
- ),
241
- },
242
- },
243
- }),
244
- },
245
- });
246
- ```
247
-
248
- ## Screenshots
5
+ - [Source code](https://github.com/payloadcms/payload/tree/main/packages/plugin-nested-docs)
6
+ - [Documentation](https://payloadcms.com/docs/plugins/nested-docs)
7
+ - [Documentation source](https://github.com/payloadcms/payload/tree/main/docs/plugins/nested-docs.mdx)
@@ -1,4 +1,4 @@
1
1
  import type { ArrayField, Field } from 'payload/types';
2
- declare const createBreadcrumbsField: (relationTo: string, overrides?: Partial<ArrayField>) => Field;
2
+ export declare const createBreadcrumbsField: (relationTo: string, overrides?: Partial<ArrayField>) => Field;
3
3
  export default createBreadcrumbsField;
4
4
  //# sourceMappingURL=breadcrumbs.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"breadcrumbs.d.ts","sourceRoot":"","sources":["../../src/fields/breadcrumbs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AAEtD,QAAA,MAAM,sBAAsB,eACd,MAAM,cACP,QAAQ,UAAU,CAAC,KAC7B,KAyCD,CAAA;AAEF,eAAe,sBAAsB,CAAA"}
1
+ {"version":3,"file":"breadcrumbs.d.ts","sourceRoot":"","sources":["../../src/fields/breadcrumbs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AAEtD,eAAO,MAAM,sBAAsB,eACrB,MAAM,cACP,QAAQ,UAAU,CAAC,KAC7B,KAyCD,CAAA;AAEF,eAAe,sBAAsB,CAAA"}
@@ -2,9 +2,17 @@
2
2
  Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
- Object.defineProperty(exports, "default", {
6
- enumerable: true,
7
- get: function() {
5
+ function _export(target, all) {
6
+ for(var name in all)Object.defineProperty(target, name, {
7
+ enumerable: true,
8
+ get: all[name]
9
+ });
10
+ }
11
+ _export(exports, {
12
+ createBreadcrumbsField: function() {
13
+ return createBreadcrumbsField;
14
+ },
15
+ default: function() {
8
16
  return _default;
9
17
  }
10
18
  });
@@ -52,4 +60,4 @@ const createBreadcrumbsField = (relationTo, overrides = {})=>({
52
60
  });
53
61
  const _default = createBreadcrumbsField;
54
62
 
55
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9maWVsZHMvYnJlYWRjcnVtYnMudHMiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHR5cGUgeyBBcnJheUZpZWxkLCBGaWVsZCB9IGZyb20gJ3BheWxvYWQvdHlwZXMnXG5cbmNvbnN0IGNyZWF0ZUJyZWFkY3J1bWJzRmllbGQgPSAoXG4gIHJlbGF0aW9uVG86IHN0cmluZyxcbiAgb3ZlcnJpZGVzOiBQYXJ0aWFsPEFycmF5RmllbGQ+ID0ge30sXG4pOiBGaWVsZCA9PiAoe1xuICBuYW1lOiAnYnJlYWRjcnVtYnMnLFxuICB0eXBlOiAnYXJyYXknLFxuICBsb2NhbGl6ZWQ6IHRydWUsXG4gIGZpZWxkczogW1xuICAgIHtcbiAgICAgIG5hbWU6ICdkb2MnLFxuICAgICAgdHlwZTogJ3JlbGF0aW9uc2hpcCcsXG4gICAgICByZWxhdGlvblRvLFxuICAgICAgbWF4RGVwdGg6IDAsXG4gICAgICBhZG1pbjoge1xuICAgICAgICBkaXNhYmxlZDogdHJ1ZSxcbiAgICAgIH0sXG4gICAgfSxcbiAgICB7XG4gICAgICB0eXBlOiAncm93JyxcbiAgICAgIGZpZWxkczogW1xuICAgICAgICB7XG4gICAgICAgICAgbmFtZTogJ3VybCcsXG4gICAgICAgICAgbGFiZWw6ICdVUkwnLFxuICAgICAgICAgIHR5cGU6ICd0ZXh0JyxcbiAgICAgICAgICBhZG1pbjoge1xuICAgICAgICAgICAgd2lkdGg6ICc1MCUnLFxuICAgICAgICAgIH0sXG4gICAgICAgIH0sXG4gICAgICAgIHtcbiAgICAgICAgICBuYW1lOiAnbGFiZWwnLFxuICAgIC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FDTEMsVUFBVTtnQkFDWjtZQUNGO1lBQ0E7Z0JBQ0VMLE1BQU07Z0JBQ05FLFFBQVE7b0JBQ047d0JBQ0VILE1BQU07d0JBQ05PLE9BQU87d0JBQ1BOLE1BQU07d0JBQ05JLE9BQU87NEJBQ0xHLE9BQU87d0JBQ1Q7b0JBQ0Y7b0JBQ0E7d0JBQ0VSLE1BQU07d0JBQ05DLE1BQU07d0JBQ05JLE9BQU87NEJBQ0xHLE9BQU87d0JBQ1Q7b0JBQ0Y7aUJBQ0Q7WUFDSDtlQUNJVCxXQUFXSSxVQUFVLEVBQUU7U0FDNUI7UUFDREUsT0FBTztZQUNMSSxVQUFVO1lBQ1YsR0FBSVYsV0FBV00sU0FBUyxDQUFDLENBQUM7UUFDNUI7UUFDQSxHQUFJTixhQUFhLENBQUMsQ0FBQztJQUNyQixDQUFBO01BRUEsV0FBZUYifQ==
@@ -1,6 +1,6 @@
1
- import type { RelationshipField } from 'payload/types';
2
- declare const createParentField: (relationTo: string, overrides?: Partial<RelationshipField & {
1
+ import type { SingleRelationshipField } from 'payload/types';
2
+ export declare const createParentField: (relationTo: string, overrides?: Partial<SingleRelationshipField & {
3
3
  hasMany: false;
4
- }>) => RelationshipField;
4
+ }>) => SingleRelationshipField;
5
5
  export default createParentField;
6
6
  //# sourceMappingURL=parent.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"parent.d.ts","sourceRoot":"","sources":["../../src/fields/parent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AAEtD,QAAA,MAAM,iBAAiB,eACT,MAAM,cACN,QACV,iBAAiB,GAAG;IAClB,OAAO,EAAE,KAAK,CAAA;CACf,CACF,KACA,iBAoBD,CAAA;AAEF,eAAe,iBAAiB,CAAA"}
1
+ {"version":3,"file":"parent.d.ts","sourceRoot":"","sources":["../../src/fields/parent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAA;AAE5D,eAAO,MAAM,iBAAiB,eAChB,MAAM,cACN,QACV,uBAAuB,GAAG;IACxB,OAAO,EAAE,KAAK,CAAA;CACf,CACF,KACA,uBAoBD,CAAA;AAEF,eAAe,iBAAiB,CAAA"}
@@ -2,9 +2,17 @@
2
2
  Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
- Object.defineProperty(exports, "default", {
6
- enumerable: true,
7
- get: function() {
5
+ function _export(target, all) {
6
+ for(var name in all)Object.defineProperty(target, name, {
7
+ enumerable: true,
8
+ get: all[name]
9
+ });
10
+ }
11
+ _export(exports, {
12
+ createParentField: function() {
13
+ return createParentField;
14
+ },
15
+ default: function() {
8
16
  return _default;
9
17
  }
10
18
  });
@@ -36,4 +44,4 @@ const createParentField = (relationTo, overrides)=>({
36
44
  });
37
45
  const _default = createParentField;
38
46
 
39
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9maWVsZHMvcGFyZW50LnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB0eXBlIHsgUmVsYXRpb25zaGlwRmllbGQgfSBmcm9tICdwYXlsb2FkL3R5cGVzJ1xuXG5jb25zdCBjcmVhdGVQYXJlbnRGaWVsZCA9IChcbiAgcmVsYXRpb25Ubzogc3RyaW5nLFxuICBvdmVycmlkZXM/OiBQYXJ0aWFsPFxuICAgIFJlbGF0aW9uc2hpcEZpZWxkICYge1xuICAgICAgaGFzTWFueTogZmFsc2VcbiAgICB9XG4gID4sXG4pOiBSZWxhdGlvbnNoaXBGaWVsZCA9PiAoe1xuICBuYW1lOiAncGFyZW50JyxcbiAgcmVsYXRpb25UbyxcbiAgdHlwZTogJ3JlbGF0aW9uc2hpcCcsXG4gIG1heERlcHRoOiAxLFxuICBmaWx0ZXJPcHRpb25zOiAoeyBpZCB9KSA9PiB7XG4gICAgaWYgKGlkKSB7XG4gICAgICByZXR1cm4ge1xuIC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RGVwdGgiLCJmaWx0ZXJPcHRpb25zIiwiaWQiLCJub3RfZXF1YWxzIiwibm90X2luIiwiYWRtaW4iLCJwb3NpdGlvbiJdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7SUFFYUEsaUJBQWlCO2VBQWpCQTs7SUE2QmIsT0FBZ0M7ZUFBaEM7OztBQTdCTyxNQUFNQSxvQkFBb0IsQ0FDL0JDLFlBQ0FDLFlBSzZCLENBQUE7UUFDN0JDLE1BQU07UUFDTkY7UUFDQUcsTUFBTTtRQUNOQyxVQUFVO1FBQ1ZDLGVBQWUsQ0FBQyxFQUFFQyxFQUFFLEVBQUU7WUFDcEIsSUFBSUEsSUFBSTtnQkFDTixPQUFPO29CQUNMQSxJQUFJO3dCQUFFQyxZQUFZRDtvQkFBRztvQkFDckIsbUJBQW1CO3dCQUFFRSxRQUFROzRCQUFDRjt5QkFBRztvQkFBQztnQkFDcEM7WUFDRjtZQUVBLE9BQU87UUFDVDtRQUNBRyxPQUFPO1lBQ0xDLFVBQVU7WUFDVixHQUFJVCxXQUFXUSxTQUFTLENBQUMsQ0FBQztRQUM1QjtRQUNBLEdBQUlSLGFBQWEsQ0FBQyxDQUFDO0lBQ3JCLENBQUE7TUFFQSxXQUFlRiJ9
package/fields.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export * from './dist/fields/breadcrumbs';
2
- export * from './dist/fields/parent';
1
+ export * from './dist/fields/breadcrumbs'
2
+ export * from './dist/fields/parent'
package/fields.js CHANGED
@@ -1,7 +1,7 @@
1
- const breadcrumbs = require('./dist/fields/breadcrumbs');
2
- const parent = require('./dist/fields/parent');
1
+ const breadcrumbs = require('./dist/fields/breadcrumbs')
2
+ const parent = require('./dist/fields/parent')
3
3
 
4
4
  module.exports = {
5
5
  breadcrumbs,
6
- parent
7
- };
6
+ parent,
7
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@payloadcms/plugin-nested-docs",
3
- "version": "1.0.9",
3
+ "version": "1.0.10",
4
4
  "description": "The official Nested Docs plugin for Payload",
5
5
  "repository": "https://github.com/payloadcms/payload",
6
6
  "license": "MIT",
@@ -9,8 +9,8 @@
9
9
  "main": "./dist/index.js",
10
10
  "types": "./dist/index.d.ts",
11
11
  "devDependencies": {
12
- "@payloadcms/eslint-config": "1.0.0",
13
- "payload": "2.2.0"
12
+ "payload": "2.5.0",
13
+ "@payloadcms/eslint-config": "1.0.0"
14
14
  },
15
15
  "exports": null,
16
16
  "publishConfig": {
package/types.d.ts CHANGED
@@ -1 +1 @@
1
- export * from './dist/types';
1
+ export * from './dist/types'
package/types.js CHANGED
@@ -1 +1 @@
1
- module.exports = require('./dist/types');
1
+ module.exports = require('./dist/types')