You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Return a [Query](../queries/overview) to limit the Documents to only those that match the constraint. This can be helpful to restrict users' access to specific Documents. [More details](../queries/overview).
Return a [Query](../queries/overview) to limit the Documents to only those that match the constraint. This can be helpful to restrict users' access to specific Documents. [More details](../queries/overview).
In the [Local API](../local-api/overview), all Access Control is _skipped_ by default. This allows your server to have full control over your application. To opt back in, you can set the `overrideAccess` option to `false` in your requests.
47
47
</Banner>
48
48
@@ -53,7 +53,7 @@ The Admin Panel responds dynamically to your changes to Access Control. For exam
53
53
To accomplish this, Payload exposes the [Access Operation](../authentication/operations#access). Upon login, Payload executes each Access Control function at the top level, across all Collections, Globals, and Fields, and returns a response that contains a reflection of what the currently authenticated user can do within your application.
54
54
55
55
<Bannertype="warning">
56
-
<strong>Important:</strong>
56
+
**Important:**
57
57
When your access control functions are executed via the [Access Operation](../authentication/operations#access), the `id` and `data` arguments will be `undefined`. This is because Payload is executing your functions without referencing a specific Document.
For fully working example of this, check of the official [Draft Preview Example](https://github.com/payloadcms/payload/tree/main/examples/draft-preview) in the [Examples Directory](https://github.com/payloadcms/payload/tree/main/examples).
Copy file name to clipboardExpand all lines: docs/admin/components.mdx
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@ The Payload [Admin Panel](./overview) is designed to be as minimal and straightf
11
11
All Custom Components in Payload are [React Server Components](https://react.dev/reference/rsc/server-components) by default. This enables the use of the [Local API](../local-api/overview) directly on the front-end. Custom Components are available for nearly every part of the Admin Panel for extreme granularity and control.
12
12
13
13
<Bannertype="success">
14
-
<strong>Note:</strong>
14
+
**Note:**
15
15
Client Components continue to be fully supported. To use Client Components in your app, simply include the `use client` directive. Payload will automatically detect and remove all default, [non-serializable props](https://react.dev/reference/rsc/use-client#serializable-types) before rendering your component. [More details](#client-components).
16
16
</Banner>
17
17
@@ -46,7 +46,7 @@ const config = buildConfig({
46
46
```
47
47
48
48
<Bannertype="success">
49
-
<strong>Note:</strong>
49
+
**Note:**
50
50
All Custom Components can be either Server Components or Client Components, depending on the presence of the `use client` directive at the top of the file.
51
51
</Banner>
52
52
@@ -184,7 +184,7 @@ Each Custom Component receives the following props by default:
184
184
| `i18n` | The [i18n](../configuration/i18n) object. |
185
185
186
186
<Banner type="warning">
187
-
<strong>Reminder:</strong>
187
+
**Reminder:**
188
188
All Custom Components also receive various other props that are specific component being rendered. See [Root Components](#root-components), [Collection Components](./collections#custom-components), [Global Components](./globals#custom-components), or [Field Components](./fields#custom-components) for a complete list of all default props per component.
Client Components cannot be passed [non-serializable props](https://react.dev/reference/rsc/use-client#serializable-types). If you are rendering your Client Component _from within_ a Server Component, ensure that its props are serializable.
248
248
</Banner>
249
249
@@ -455,7 +455,7 @@ Payload also exports its [SCSS](https://sass-lang.com) library for reuse which i
455
455
```
456
456
457
457
<Bannertype="success">
458
-
<strong>Note:</strong>
458
+
**Note:**
459
459
YoucanalsodrillintoPayload's own component styles, or easily apply global, app-wide CSS. More on that [here](./customizing-css).
460
460
</Banner>
461
461
@@ -503,7 +503,7 @@ The following options are available:
Copy file name to clipboardExpand all lines: docs/admin/customizing-css.mdx
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,7 +29,7 @@ Here is an example of how you might target the Dashboard View and change the bac
29
29
```
30
30
31
31
<Bannertype="warning">
32
-
<strong>Note:</strong>
32
+
**Note:**
33
33
If you are building [Custom Components](./components), it is best to import your own stylesheets directly into your components, rather than using the global stylesheet. You can continue to use the [CSS library](#css-library) as needed.
34
34
</Banner>
35
35
@@ -77,7 +77,7 @@ The following variables are defined and can be overridden:
77
77
For an up-to-date, comprehensive list of all available variables, please refer to the [Source Code](https://github.com/payloadcms/payload/blob/main/packages/ui/src/scss).
78
78
79
79
<Banner type="warning">
80
-
<strong>Warning:</strong>
80
+
**Warning:**
81
81
If you're overriding colors or theme elevations, make sure to consider how [your changes will affect dark mode](#dark-mode).
Copy file name to clipboardExpand all lines: docs/admin/fields.mdx
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@ keywords:
11
11
For example, your app might need to render a specific interface that Payload does not inherently support, such as a color picker. To do this, you could replace the default [Text Field](../fields/text) input with your own user-friendly component that formats the data into a valid color value.
12
12
13
13
<Bannertype="success">
14
-
<strong>Tip:</strong>
14
+
**Tip:**
15
15
Don't see a built-in field type that you need? Build it! Using a combination of [Field Validations](../fields/overview#validation)
16
16
and [Custom Components](./components), you can override the entirety of how a component functions within the [Admin Panel](./overview) to effectively create your own field type.
To replace the Field Description with a [Custom Component](./components), use the `admin.components.Description` property. [More details](#description).
92
92
</Banner>
93
93
@@ -122,7 +122,7 @@ All Description Functions receive the following arguments:
122
122
|**`t`**| The `t` function used to internationalize the Admin Panel. [More details](../configuration/i18n)|
123
123
124
124
<Bannertype="info">
125
-
<strong>Note:</strong>
125
+
**Note:**
126
126
If you need to subscribe to live updates within your form, use a Description Component instead. [More details](#description).
Copy file name to clipboardExpand all lines: docs/admin/globals.mdx
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -65,7 +65,7 @@ The following options are available:
65
65
|**`views`**| Override or create new views within the Admin Panel. [More details](./views). |
66
66
67
67
<Bannertype="success">
68
-
<strong>Note:</strong>
68
+
**Note:**
69
69
For details on how to build Custom Components, see [Building Custom Components](./components#building-custom-components).
70
70
</Banner>
71
71
@@ -102,6 +102,6 @@ The preview function receives two arguments:
102
102
|**`ctx`**| An object containing `locale` and `token` properties. The `token` is the currently logged-in user's JWT. |
103
103
104
104
<Bannertype="success">
105
-
<strong>Note:</strong>
105
+
**Note:**
106
106
For fully working example of this, check of the official [Draft Preview Example](https://github.com/payloadcms/payload/tree/main/examples/draft-preview) in the [Examples Directory](https://github.com/payloadcms/payload/tree/main/examples).
Payload provides a variety of powerful [React Hooks](https://react.dev/reference/react-dom/hooks) that can be used within your own [Custom Components](./components), such as [Custom Fields](./fields). With them, you can interface with Payload itself to build just about any type of complex customization you can think of.
10
10
11
11
<Bannertype="warning">
12
-
<strong>Reminder:</strong>
12
+
**Reminder:**
13
13
All Custom Components are [React Server Components](https://react.dev/reference/rsc/server-components) by default. Hooks, on the other hand, are only available in client-side environments. To use hooks, [ensure your component is a client component](./components#client-components).
14
14
</Banner>
15
15
@@ -78,7 +78,7 @@ type FieldType<T> = {
78
78
There are times when a custom field component needs to have access to data from other fields, and you have a few options to do so. The `useFormFields` hook is a powerful and highly performant way to retrieve a form's field state, as well as to retrieve the `dispatchFields` method, which can be helpful for setting other fields' form states from anywhere within a form.
79
79
80
80
<Banner type="success">
81
-
<strong>This hook is great for retrieving only certain fields from form state</strong> because it
81
+
**This hook is great for retrieving only certain fields from form state** because it
82
82
ensures that it will only cause a rerender when the items that you ask for change.
83
83
</Banner>
84
84
@@ -157,8 +157,8 @@ To see types for each action supported within the `dispatchFields` hook, check o
157
157
The `useForm` hook can be used to interact with the form itself, and sends back many methods that can be used to reactively fetch form state without causing rerenders within your components each time a field is changed. This is useful if you have action-based callbacks that your components fire, and need to interact with form state _based on a user action_.
158
158
159
159
<Bannertype="warning">
160
-
<strong>Warning:</strong>
161
-
<br />
160
+
**Warning:**
161
+
162
162
This hook is optimized to avoid causing rerenders when fields change, and as such, its `fields`
163
163
property will be out of date. You should only leverage this hook if you need to perform actions
164
164
against the form in response to your users' actions. Do not rely on its returned "fields" as being
Copy file name to clipboardExpand all lines: docs/admin/locked-documents.mdx
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,13 +20,13 @@ When a user starts editing a document, Payload locks it for that user. If anothe
20
20
21
21
The lock will automatically expire after a set period of inactivity, configurable using the `duration` property in the `lockDocuments` configuration, after which others can resume editing.
22
22
23
-
<Bannertype="info"> <strong>Note:</strong> If your application does not require document locking, you can disable this feature for any collection or global by setting the <code>lockDocuments</code> property to <code>false</code>. </Banner>
23
+
<Bannertype="info"> **Note:** If your application does not require document locking, you can disable this feature for any collection or global by setting the `lockDocuments` property to `false`. </Banner>
24
24
25
25
### Config Options
26
26
27
27
The `lockDocuments` property exists on both the Collection Config and the Global Config. Document locking is enabled by default, but you can customize the lock duration or turn off the feature for any collection or global.
28
28
29
-
Here’s an example configuration for document locking:
29
+
Here's an example configuration for document locking:
0 commit comments