diff --git a/docs/access-control/globals.mdx b/docs/access-control/globals.mdx index 2f1698b74..07656c567 100644 --- a/docs/access-control/globals.mdx +++ b/docs/access-control/globals.mdx @@ -39,7 +39,7 @@ const GlobalWithAccessControl: GlobalConfig = { update: ({ req: { user } }) => {...}, // Version-enabled Globals only - readVersion: () => {...}, + readVersions: () => {...}, }, // highlight-end } @@ -64,7 +64,7 @@ If a Global supports [Versions](../versions/overview), the following additional Returns a boolean result or optionally a [query constraint](../queries/overview) which limits who can read this global based on its current properties. -To add read Access Control to a [Global](../configuration/globals), use the `read` property in the [Global Config](../configuration/globals): +To add read Access Control to a [Global](../configuration/globals), use the `access` property in the [Global Config](../configuration/globals): ```ts import { GlobalConfig } from 'payload' @@ -72,7 +72,7 @@ import { GlobalConfig } from 'payload' const Header: GlobalConfig = { // ... // highlight-start - read: { + access: { read: ({ req: { user } }) => { return Boolean(user) }, diff --git a/docs/admin/preview.mdx b/docs/admin/preview.mdx index 08c6dbbce..b52b49e13 100644 --- a/docs/admin/preview.mdx +++ b/docs/admin/preview.mdx @@ -65,7 +65,7 @@ preview: (doc, { req }) => `${req.protocol}//${req.host}/${doc.slug}` // highlig The Preview feature can be used to achieve "Draft Preview". After clicking the preview button from the Admin Panel, you can enter into "draft mode" within your front-end application. This will allow you to adjust your page queries to include the `draft: true` param. When this param is present on the request, Payload will send back a draft document as opposed to a published one based on the document's `_status` field. -To enter draft mode, the URL provided to the `preview` function can point to a custom endpoint in your front-end application that sets a cookie or session variable to indicate that draft mode is enabled. This is framework specific, so the mechanisms here very from framework to framework although the underlying concept is the same. +To enter draft mode, the URL provided to the `preview` function can point to a custom endpoint in your front-end application that sets a cookie or session variable to indicate that draft mode is enabled. This is framework specific, so the mechanisms here vary from framework to framework although the underlying concept is the same. ### Next.js diff --git a/docs/admin/react-hooks.mdx b/docs/admin/react-hooks.mdx index 96c435c31..bbc24c521 100644 --- a/docs/admin/react-hooks.mdx +++ b/docs/admin/react-hooks.mdx @@ -605,7 +605,7 @@ return ( textField: { initialValue: 'Updated text', valid: true, - value: 'Upddated text', + value: 'Updated text', }, }, // blockType: "yourBlockSlug", @@ -875,7 +875,7 @@ Useful to retrieve info about the currently logged in user as well as methods fo | **`refreshCookie`** | A method to trigger the silent refreshing of a user's auth token | | **`setToken`** | Set the token of the user, to be decoded and used to reset the user and token in memory | | **`token`** | The logged in user's token (useful for creating preview links, etc.) | -| **`refreshPermissions`** | Load new permissions (useful when content that effects permissions has been changed) | +| **`refreshPermissions`** | Load new permissions (useful when content that affects permissions has been changed) | | **`permissions`** | The permissions of the current user | ```tsx @@ -1143,7 +1143,7 @@ This is useful for scenarios where you need to trigger another fetch regardless Route transitions are useful in showing immediate visual feedback to the user when navigating between pages. This is especially useful on slow networks when navigating to data heavy or process intensive pages. -By default, any instances of `Link` from `@payloadcms/ui` will trigger route transitions dy default. +By default, any instances of `Link` from `@payloadcms/ui` will trigger route transitions by default. ```tsx import { Link } from '@payloadcms/ui' diff --git a/docs/authentication/cookies.mdx b/docs/authentication/cookies.mdx index f0a54f7f7..639271911 100644 --- a/docs/authentication/cookies.mdx +++ b/docs/authentication/cookies.mdx @@ -62,7 +62,7 @@ In this scenario, if your cookie was still valid, malicious-intent.com would be ### CSRF Prevention -Define domains that your trust and are willing to accept Payload HTTP-only cookie based requests from. Use the `csrf` option on the base Payload Config to do this: +Define domains that you trust and are willing to accept Payload HTTP-only cookie based requests from. Use the `csrf` option on the base Payload Config to do this: ```ts // payload.config.ts @@ -102,8 +102,8 @@ If option 1 isn't possible, then you can get around this limitation by [configur ``` SameSite: None // allows the cookie to cross domains -Secure: true // ensures its sent over HTTPS only -HttpOnly: true // ensures its not accessible via client side JavaScript +Secure: true // ensures it's sent over HTTPS only +HttpOnly: true // ensures it's not accessible via client side JavaScript ``` Configuration example: diff --git a/docs/authentication/email.mdx b/docs/authentication/email.mdx index 07b7c33dc..15b49cc09 100644 --- a/docs/authentication/email.mdx +++ b/docs/authentication/email.mdx @@ -71,7 +71,7 @@ export const Customers: CollectionConfig = { #### generateEmailSubject -Similarly to the above `generateEmailHTML`, you can also customize the subject of the email. The function argument are the same but you can only return a string - not HTML. +Similarly to the above `generateEmailHTML`, you can also customize the subject of the email. The function arguments are the same but you can only return a string - not HTML. ```ts import type { CollectionConfig } from 'payload' @@ -178,7 +178,7 @@ The following arguments are passed to the `generateEmailHTML` function: #### generateEmailSubject -Similarly to the above `generateEmailHTML`, you can also customize the subject of the email. The function argument are the same but you can only return a string - not HTML. +Similarly to the above `generateEmailHTML`, you can also customize the subject of the email. The function arguments are the same but you can only return a string - not HTML. ```ts import type { CollectionConfig } from 'payload' diff --git a/docs/authentication/jwt.mdx b/docs/authentication/jwt.mdx index b00ac75b8..45fed8074 100644 --- a/docs/authentication/jwt.mdx +++ b/docs/authentication/jwt.mdx @@ -38,7 +38,7 @@ const request = await fetch('http://localhost:3000', { ### Omitting The Token -In some cases you may want to prevent the token from being returned from the auth operations. You can do that by setting `removeTokenFromResponse` to `true` like so: +In some cases you may want to prevent the token from being returned from the auth operations. You can do that by setting `removeTokenFromResponses` to `true` like so: ```ts import type { CollectionConfig } from 'payload' @@ -46,7 +46,7 @@ import type { CollectionConfig } from 'payload' export const UsersWithoutJWTs: CollectionConfig = { slug: 'users-without-jwts', auth: { - removeTokenFromResponse: true, // highlight-line + removeTokenFromResponses: true, // highlight-line }, } ``` diff --git a/docs/authentication/operations.mdx b/docs/authentication/operations.mdx index 88c81baaf..0415f5054 100644 --- a/docs/authentication/operations.mdx +++ b/docs/authentication/operations.mdx @@ -67,7 +67,7 @@ query { } ``` -Document access can also be queried on a collection/global basis. Access on a global can queried like `http://localhost:3000/api/global-slug/access`, Collection document access can be queried like `http://localhost:3000/api/collection-slug/access/:id`. +Document access can also be queried on a collection/global basis. Access on a global can be queried like `http://localhost:3000/api/global-slug/access`, Collection document access can be queried like `http://localhost:3000/api/collection-slug/access/:id`. ## Me diff --git a/docs/authentication/overview.mdx b/docs/authentication/overview.mdx index 688c71b85..7afa2369f 100644 --- a/docs/authentication/overview.mdx +++ b/docs/authentication/overview.mdx @@ -71,7 +71,7 @@ export const Admins: CollectionConfig = { - **Note:** Auth-enabled Collections with be automatically injected with the + **Note:** Auth-enabled Collections will be automatically injected with the `hash`, `salt`, and `email` fields. [More details](../fields/overview#field-names). diff --git a/docs/authentication/token-data.mdx b/docs/authentication/token-data.mdx index f8d5d2260..5cfc309b1 100644 --- a/docs/authentication/token-data.mdx +++ b/docs/authentication/token-data.mdx @@ -8,7 +8,7 @@ keywords: authentication, config, configuration, documentation, Content Manageme During the lifecycle of a request you will be able to access the data you have configured to be stored in the JWT by accessing `req.user`. The user object is automatically appended to the request for you. -### Definining Token Data +### Defining Token Data You can specify what data gets encoded to the Cookie/JWT-Token by setting `saveToJWT` property on fields within your auth collection. diff --git a/docs/configuration/collections.mdx b/docs/configuration/collections.mdx index 94ff2f9c8..6a5d483bd 100644 --- a/docs/configuration/collections.mdx +++ b/docs/configuration/collections.mdx @@ -177,7 +177,7 @@ The following options are available: #### Edit View Options ```ts -import type { CollectionCOnfig } from 'payload' +import type { CollectionConfig } from 'payload' export const MyCollection: CollectionConfig = { // ... @@ -275,7 +275,7 @@ You can also pass an object to the collection's `graphQL` property, which allows ## TypeScript -You can import types from Payload to help make writing your Collection configs easier and type-safe. There are two main types that represent the Collection Config, `CollectionConfig` and `SanitizeCollectionConfig`. +You can import types from Payload to help make writing your Collection configs easier and type-safe. There are two main types that represent the Collection Config, `CollectionConfig` and `SanitizedCollectionConfig`. The `CollectionConfig` type represents a raw Collection Config in its full form, where only the bare minimum properties are marked as required. The `SanitizedCollectionConfig` type represents a Collection Config after it has been fully sanitized. Generally, this is only used internally by Payload. diff --git a/docs/configuration/globals.mdx b/docs/configuration/globals.mdx index 933926210..42af1fd4b 100644 --- a/docs/configuration/globals.mdx +++ b/docs/configuration/globals.mdx @@ -205,7 +205,7 @@ You can also pass an object to the global's `graphQL` property, which allows you ## TypeScript -You can import types from Payload to help make writing your Global configs easier and type-safe. There are two main types that represent the Global Config, `GlobalConfig` and `SanitizeGlobalConfig`. +You can import types from Payload to help make writing your Global configs easier and type-safe. There are two main types that represent the Global Config, `GlobalConfig` and `SanitizedGlobalConfig`. The `GlobalConfig` type represents a raw Global Config in its full form, where only the bare minimum properties are marked as required. The `SanitizedGlobalConfig` type represents a Global Config after it has been fully sanitized. Generally, this is only used internally by Payload. diff --git a/docs/configuration/overview.mdx b/docs/configuration/overview.mdx index 204cabc57..417849ce9 100644 --- a/docs/configuration/overview.mdx +++ b/docs/configuration/overview.mdx @@ -213,7 +213,7 @@ For more information about what we track, take a look at our [privacy policy](/p ## Cross-origin resource sharing (CORS)#cors -Cross-origin resource sharing (CORS) can be configured with either a whitelist array of URLS to allow CORS requests from, a wildcard string (`*`) to accept incoming requests from any domain, or a object with the following properties: +Cross-origin resource sharing (CORS) can be configured with either a whitelist array of URLS to allow CORS requests from, a wildcard string (`*`) to accept incoming requests from any domain, or an object with the following properties: | Option | Description | | ------------- | --------------------------------------------------------------------------------------------------------------------------------------- | @@ -292,7 +292,7 @@ export const script = async (config: SanitizedConfig) => { collection: 'pages', data: { title: 'my title' }, }) - payload.logger.info('Succesffully seeded!') + payload.logger.info('Successfully seeded!') process.exit(0) } ``` diff --git a/docs/custom-components/document-views.mdx b/docs/custom-components/document-views.mdx index 0680b7cf5..3404f9982 100644 --- a/docs/custom-components/document-views.mdx +++ b/docs/custom-components/document-views.mdx @@ -59,7 +59,7 @@ _For details on how to build Custom Views, including all available props, see [B ### Document Root -The Document Root is mounted on the top-level route for a Document. Setting this property will completely take over the entire Document View layout, including the title, [Document Tabs](#ocument-tabs), _and all other nested Document Views_ including the [Edit View](./edit-view), API View, etc. +The Document Root is mounted on the top-level route for a Document. Setting this property will completely take over the entire Document View layout, including the title, [Document Tabs](#document-tabs), _and all other nested Document Views_ including the [Edit View](./edit-view), API View, etc. When setting a Document Root, you are responsible for rendering all necessary components and controls, as no document controls or tabs would be rendered. To replace only the Edit View precisely, use the `edit.default` key instead. diff --git a/docs/custom-components/root-components.mdx b/docs/custom-components/root-components.mdx index cb4523b0e..234a6a69c 100644 --- a/docs/custom-components/root-components.mdx +++ b/docs/custom-components/root-components.mdx @@ -40,7 +40,7 @@ The following options are available: | `beforeDashboard` | An array of Custom Components to inject into the built-in Dashboard, _before_ the default dashboard contents. [More details](#beforedashboard). | | `beforeLogin` | An array of Custom Components to inject into the built-in Login, _before_ the default login form. [More details](#beforelogin). | | `beforeNavLinks` | An array of Custom Components to inject into the built-in Nav, _before_ the links themselves. [More details](#beforenavlinks). | -| `graphics.Icon` | The simplified logo used in contexts like the the `Nav` component. [More details](#graphicsicon). | +| `graphics.Icon` | The simplified logo used in contexts like the `Nav` component. [More details](#graphicsicon). | | `graphics.Logo` | The full logo used in contexts like the `Login` view. [More details](#graphicslogo). | | `header` | An array of Custom Components to be injected above the Payload header. [More details](#header). | | `logout.Button` | The button displayed in the sidebar that logs the user out. [More details](#logoutbutton). | @@ -345,7 +345,7 @@ export default function MyCustomIcon() { The `Logo` property is the full logo used in contexts like the `Login` view. This is typically a larger, more detailed representation of your brand. -To add a custom logo, use the `admin.components.graphic.Logo` property in your Payload Config: +To add a custom logo, use the `admin.components.graphics.Logo` property in your Payload Config: ```ts import { buildConfig } from 'payload' diff --git a/docs/database/postgres.mdx b/docs/database/postgres.mdx index b8f3ec736..4224066b3 100644 --- a/docs/database/postgres.mdx +++ b/docs/database/postgres.mdx @@ -39,7 +39,7 @@ export default buildConfig({ import { vercelPostgresAdapter } from '@payloadcms/db-vercel-postgres' export default buildConfig({ - // Automatically uses proces.env.POSTGRES_URL if no options are provided. + // Automatically uses process.env.POSTGRES_URL if no options are provided. db: vercelPostgresAdapter(), // Optionally, can accept the same options as the @vercel/postgres package. db: vercelPostgresAdapter({ @@ -224,7 +224,7 @@ Make sure Payload doesn't overlap table names with its collections. For example, ### afterSchemaInit Runs after the Drizzle schema is built. You can use this hook to modify the schema with features that aren't supported by Payload, or if you want to add a column that you don't want to be in the Payload config. -To extend a table, Payload exposes `extendTable` utillity to the args. You can refer to the [Drizzle documentation](https://orm.drizzle.team/docs/sql-schema-declaration). +To extend a table, Payload exposes `extendTable` utility to the args. You can refer to the [Drizzle documentation](https://orm.drizzle.team/docs/sql-schema-declaration). The following example adds the `extra_integer_column` column and a composite index on `country` and `city` columns. ```ts diff --git a/docs/database/sqlite.mdx b/docs/database/sqlite.mdx index 7d440603b..4b906cda8 100644 --- a/docs/database/sqlite.mdx +++ b/docs/database/sqlite.mdx @@ -189,7 +189,7 @@ Make sure Payload doesn't overlap table names with its collections. For example, ### afterSchemaInit Runs after the Drizzle schema is built. You can use this hook to modify the schema with features that aren't supported by Payload, or if you want to add a column that you don't want to be in the Payload config. -To extend a table, Payload exposes `extendTable` utillity to the args. You can refer to the [Drizzle documentation](https://orm.drizzle.team/docs/sql-schema-declaration). +To extend a table, Payload exposes `extendTable` utility to the args. You can refer to the [Drizzle documentation](https://orm.drizzle.team/docs/sql-schema-declaration). The following example adds the `extra_integer_column` column and a composite index on `country` and `city` columns. ```ts diff --git a/docs/fields/radio.mdx b/docs/fields/radio.mdx index 6160cc164..3d02e9d1e 100644 --- a/docs/fields/radio.mdx +++ b/docs/fields/radio.mdx @@ -36,7 +36,7 @@ export const MyRadioField: Field = { | Option | Description | | ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **`name`** \* | To be used as the property name when stored and retrieved from the database. [More](/docs/fields/overview#field-names) | -| **`options`** \* | Array of options to allow the field to store. Can either be an array of strings, or an array of objects containing an `label` string and a `value` string. | +| **`options`** \* | Array of options to allow the field to store. Can either be an array of strings, or an array of objects containing a `label` string and a `value` string. | | **`label`** | Text used as a field label in the Admin Panel or an object with keys for each language. | | **`validate`** | Provide a custom validation function that will be executed on both the Admin Panel and the backend. [More](/docs/fields/overview#validation) | | **`index`** | Build an [index](/docs/database/overview) for this field to produce faster queries. Set this field to `true` if your users will perform queries on this field's data often. | diff --git a/docs/hooks/context.mdx b/docs/hooks/context.mdx index 54bed46a9..c690e5aa5 100644 --- a/docs/hooks/context.mdx +++ b/docs/hooks/context.mdx @@ -23,7 +23,7 @@ Let's see examples on how context can be used in the first two scenarios mention ### Passing Data Between Hooks -To pass data between hooks, you can assign values to context in an earlier hook in the lifecycle of a request and expect it the context in a later hook. +To pass data between hooks, you can assign values to context in an earlier hook in the lifecycle of a request and expect it in the context of a later hook. For example: diff --git a/docs/jobs-queue/tasks.mdx b/docs/jobs-queue/tasks.mdx index 097d8ec48..32eb23e96 100644 --- a/docs/jobs-queue/tasks.mdx +++ b/docs/jobs-queue/tasks.mdx @@ -33,7 +33,7 @@ Simply add a task to the `jobs.tasks` array in your Payload config. A task consi | `onSuccess` | Function to be executed if the task succeeds. | | `retries` | Specify the number of times that this step should be retried if it fails. If this is undefined, the task will either inherit the retries from the workflow or have no retries. If this is 0, the task will not be retried. By default, this is undefined. | -The logic for the Task is defined in the `handler` - which can be defined as a function, or a path to a function. The `handler` will run once a worker picks picks up a Job that includes this task. +The logic for the Task is defined in the `handler` - which can be defined as a function, or a path to a function. The `handler` will run once a worker picks up a Job that includes this task. It should return an object with an `output` key, which should contain the output of the task as you've defined. @@ -213,7 +213,7 @@ export default buildConfig({ ## Nested tasks -You can run sub-tasks within an existing task, by using the `tasks` or `ìnlineTask` arguments passed to the task `handler` function: +You can run sub-tasks within an existing task, by using the `tasks` or `inlineTask` arguments passed to the task `handler` function: ```ts export default buildConfig({ diff --git a/docs/live-preview/client.mdx b/docs/live-preview/client.mdx index 9dd2784a5..47783ac9f 100644 --- a/docs/live-preview/client.mdx +++ b/docs/live-preview/client.mdx @@ -260,7 +260,7 @@ If you are using relationships or uploads in your front-end application, and you { // ... // If your site is running on a different domain than your Payload server, - // This will allows requests to be made between the two domains + // This will allow requests to be made between the two domains cors: [ 'http://localhost:3001' // Your front-end application ], diff --git a/docs/rich-text/converting-jsx.mdx b/docs/rich-text/converting-jsx.mdx index 254a31db3..cf924d21a 100644 --- a/docs/rich-text/converting-jsx.mdx +++ b/docs/rich-text/converting-jsx.mdx @@ -135,7 +135,7 @@ export const MyComponent: React.FC<{ ### Overriding Converters -You can override any of the default JSX converters by passing passing your custom converter, keyed to the node type, to the `converters` prop / the converters function. +You can override any of the default JSX converters by passing your custom converter, keyed to the node type, to the `converters` prop / the converters function. Example - overriding the upload node converter to use next/image: diff --git a/docs/versions/autosave.mdx b/docs/versions/autosave.mdx index 5d1b9d6a7..bc3d2e91c 100644 --- a/docs/versions/autosave.mdx +++ b/docs/versions/autosave.mdx @@ -3,7 +3,7 @@ title: Autosave label: Autosave order: 30 desc: Using Payload's Draft functionality, you can configure your collections and globals to autosave changes as drafts, and publish only you're ready. -keywords: version history, revisions, audit log, draft, publish, autosave, Content Management System, cms, headless, javascript, node, react, nextjss +keywords: version history, revisions, audit log, draft, publish, autosave, Content Management System, cms, headless, javascript, node, react, nextjs --- Extending on Payload's [Draft](/docs/versions/drafts) functionality, you can configure your collections and globals to autosave changes as drafts, and publish only you're ready. The Admin UI will automatically adapt to autosaving progress at an interval that you define, and will store all autosaved changes as a new Draft version. Never lose your work - and publish changes to the live document only when you're ready.