payload 1.0.5 → 1.0.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.
- package/README.md +3 -0
- package/components/styles.css +1 -1
- package/dist/admin/components/elements/Banner/index.scss +1 -1
- package/dist/bin/generateTypes.js +6 -2
- package/dist/collections/config/defaults.d.ts +5 -5
- package/dist/fields/hooks/afterChange/index.js +2 -5
- package/dist/fields/hooks/afterChange/promise.d.ts +1 -2
- package/dist/fields/hooks/afterChange/promise.js +16 -15
- package/dist/fields/hooks/afterChange/traverseFields.d.ts +1 -2
- package/dist/fields/hooks/afterChange/traverseFields.js +4 -3
- package/dist/fields/hooks/beforeChange/index.js +2 -5
- package/dist/fields/hooks/beforeChange/promise.d.ts +1 -2
- package/dist/fields/hooks/beforeChange/promise.js +22 -24
- package/dist/fields/hooks/beforeChange/traverseFields.d.ts +1 -2
- package/dist/fields/hooks/beforeChange/traverseFields.js +4 -3
- package/dist/fields/hooks/beforeValidate/index.js +2 -5
- package/dist/fields/hooks/beforeValidate/promise.d.ts +1 -2
- package/dist/fields/hooks/beforeValidate/promise.js +16 -15
- package/dist/fields/hooks/beforeValidate/traverseFields.d.ts +1 -2
- package/dist/fields/hooks/beforeValidate/traverseFields.js +4 -3
- package/dist/index.js +3 -3
- package/dist/init.d.ts +3 -1
- package/dist/init.js +27 -11
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.js +1 -1
- package/docs/admin/components.mdx +5 -5
- package/docs/configuration/collections.mdx +1 -1
- package/docs/configuration/globals.mdx +2 -2
- package/docs/configuration/overview.mdx +1 -1
- package/docs/fields/rich-text.mdx +1 -1
- package/package.json +1 -1
- package/CHANGELOG.md +0 -1598
package/dist/types/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Document as MongooseDocument } from 'mongoose';
|
|
2
2
|
import { TypeWithTimestamps } from '../collections/config/types';
|
|
3
3
|
import { FileData } from '../uploads/types';
|
|
4
|
+
export { PayloadRequest } from '../express/types';
|
|
4
5
|
export declare type Operator = 'equals' | 'not_equals' | 'in' | 'not_in' | 'exists' | 'greater_than' | 'greater_than_equal' | 'less_than' | 'less_than_equal' | 'like' | 'near';
|
|
5
6
|
export declare type WhereField = {
|
|
6
7
|
[key in Operator]?: unknown;
|
package/dist/types/index.js
CHANGED
|
@@ -5,4 +5,4 @@ function docHasTimestamps(doc) {
|
|
|
5
5
|
return (doc === null || doc === void 0 ? void 0 : doc.createdAt) && (doc === null || doc === void 0 ? void 0 : doc.updatedAt);
|
|
6
6
|
}
|
|
7
7
|
exports.docHasTimestamps = docHasTimestamps;
|
|
8
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
8
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvdHlwZXMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBdUNBLFNBQWdCLGdCQUFnQixDQUFDLEdBQVE7SUFDdkMsT0FBTyxDQUFBLEdBQUcsYUFBSCxHQUFHLHVCQUFILEdBQUcsQ0FBRSxTQUFTLE1BQUksR0FBRyxhQUFILEdBQUcsdUJBQUgsR0FBRyxDQUFFLFNBQVMsQ0FBQSxDQUFDO0FBQzFDLENBQUM7QUFGRCw0Q0FFQyJ9
|
|
@@ -22,8 +22,8 @@ You can override a set of admin panel-wide components by providing a component t
|
|
|
22
22
|
| Path | Description |
|
|
23
23
|
| --------------------- | -------------|
|
|
24
24
|
| **`Nav`** | Contains the sidebar and mobile Nav in its entirety. |
|
|
25
|
-
| **`BeforeDashboard`** | Array of components to inject into the built-in Dashboard, _before_ the default dashboard contents.
|
|
26
|
-
| **`AfterDashboard`** | Array of components to inject into the built-in Dashboard, _after_ the default dashboard contents. |
|
|
25
|
+
| **`BeforeDashboard`** | Array of components to inject into the built-in Dashboard, _before_ the default dashboard contents. |
|
|
26
|
+
| **`AfterDashboard`** | Array of components to inject into the built-in Dashboard, _after_ the default dashboard contents. [Demo](https://github.com/payloadcms/payload/tree/master/test/admin/components/AfterDashboard/index.tsx)|
|
|
27
27
|
| **`BeforeLogin`** | Array of components to inject into the built-in Login, _before_ the default login form. |
|
|
28
28
|
| **`AfterLogin`** | Array of components to inject into the built-in Login, _after_ the default login form. |
|
|
29
29
|
| **`BeforeNavLinks`** | Array of components to inject into the built-in Nav, _before_ the links themselves. |
|
|
@@ -60,7 +60,7 @@ export default buildConfig({
|
|
|
60
60
|
})
|
|
61
61
|
```
|
|
62
62
|
|
|
63
|
-
*For more examples regarding how to customize components, look at the [
|
|
63
|
+
*For more examples regarding how to customize components, look at the following [examples](https://github.com/payloadcms/payload/tree/master/test/admin/components).*
|
|
64
64
|
|
|
65
65
|
### Collections
|
|
66
66
|
|
|
@@ -195,12 +195,12 @@ Your custom route components will be given all the props that a React Router `<R
|
|
|
195
195
|
|
|
196
196
|
#### Example
|
|
197
197
|
|
|
198
|
-
You can find examples of custom route views in the [Payload source code `/
|
|
198
|
+
You can find examples of custom route views in the [Payload source code `/test/admin/components/views` folder](https://github.com/payloadcms/payload/tree/master/test/admin/components/views). There, you'll find two custom routes:
|
|
199
199
|
|
|
200
200
|
1. A custom view that uses the `DefaultTemplate`, which is the built-in Payload template that displays the sidebar and "eyebrow nav"
|
|
201
201
|
1. A custom view that uses the `MinimalTemplate` - which is just a centered template used for things like logging in or out
|
|
202
202
|
|
|
203
|
-
To see how to pass in your custom views to create custom routes of your own, take a look at the `admin.components.routes` property of the [Payload
|
|
203
|
+
To see how to pass in your custom views to create custom routes of your own, take a look at the `admin.components.routes` property of the [Payload test admin config](https://github.com/payloadcms/payload/blob/master/test/admin/config.ts).
|
|
204
204
|
|
|
205
205
|
## Custom providers
|
|
206
206
|
|
|
@@ -52,7 +52,7 @@ const Orders = {
|
|
|
52
52
|
|
|
53
53
|
#### More collection config examples
|
|
54
54
|
|
|
55
|
-
You can find an assortment of [example collection configs](https://github.com/payloadcms/
|
|
55
|
+
You can find an assortment of [example collection configs](https://github.com/payloadcms/public-demo/tree/master/src/collections) in the Public Demo source code on GitHub.
|
|
56
56
|
|
|
57
57
|
### Admin options
|
|
58
58
|
|
|
@@ -50,9 +50,9 @@ const Nav = {
|
|
|
50
50
|
}
|
|
51
51
|
```
|
|
52
52
|
|
|
53
|
-
####
|
|
53
|
+
#### Global config example
|
|
54
54
|
|
|
55
|
-
You can find an
|
|
55
|
+
You can find an [example Global config](https://github.com/payloadcms/public-demo/blob/master/src/globals/MainMenu.ts) in the Public Demo source code on GitHub.
|
|
56
56
|
|
|
57
57
|
### Admin options
|
|
58
58
|
|
|
@@ -89,7 +89,7 @@ export default config;
|
|
|
89
89
|
|
|
90
90
|
#### Full example config
|
|
91
91
|
|
|
92
|
-
You can see a full [example config](https://github.com/payloadcms/
|
|
92
|
+
You can see a full [example config](https://github.com/payloadcms/public-demo/blob/master/src/payload.config.ts) in the Public Demo source code on GitHub.
|
|
93
93
|
|
|
94
94
|
### Using environment variables in your config
|
|
95
95
|
|
|
@@ -181,7 +181,7 @@ Custom `Leaf` objects follow a similar pattern but require you to define the `Le
|
|
|
181
181
|
}
|
|
182
182
|
```
|
|
183
183
|
|
|
184
|
-
For more examples regarding how to define your own elements and leaves, check out the example [`RichText`
|
|
184
|
+
For more examples regarding how to define your own elements and leaves, check out the example [`RichText` field](https://github.com/payloadcms/public-demo/blob/master/src/fields/hero.ts) within the Public Demo source code.
|
|
185
185
|
|
|
186
186
|
### Generating HTML
|
|
187
187
|
|