Commit Graph

66 Commits

Author SHA1 Message Date
Jacob Fletcher
277448d9c0 docs: performance (#13068)
Payload is designed with performance in mind, but its customizability
means that there are many ways to configure your app that can impact
performance.

While Payload provides several features and best practices to help you
optimize your app's specific performance needs, these are not currently
well surfaced and can be obscure.

Now:

- A high-level performance doc now exists at `/docs/performance`
- There's a new section on performance within the `/docs/queries` doc
- There's a new section on performance within the `/docs/hooks` doc
- There's a new section on performance within the
`/docs/custom-components` doc

This PR also:

- Restructures and elaborates on the `/docs/queries/pagination` docs
- Adds a new `/docs/database/indexing` doc
- More

---
- To see the specific tasks where the Asana app for GitHub is being
used, see below:
  - https://app.asana.com/0/0/1210743577153856
2025-07-14 23:55:16 -04:00
Sasha
d91478cd24 docs: virtual fields linking with relationship fields (#12145)
Adds docs for these changes
https://github.com/payloadcms/payload/pull/11805
2025-04-18 14:56:19 -04:00
Alessio Gravili
9f9db3ff81 chore: bump prettier, re-enable prettier for docs (#11695)
## Introducing Prettier for docs

Prettier [was originally disabled for our docs as it didn't support MDX
2.0](1fa636417f),
outputting invalid MDX syntax.

This has since been fixed - prettier now supports MDX 2.0.

## Reducing print width

This also reduces the print width for the docs folder from 100 to 70.
Our docs code field are very narrow - this should help make code more
readable.

**Before**
![CleanShot 2025-03-13 at 19 58
11@2x](https://github.com/user-attachments/assets/0ae9e27b-cddf-44e5-a978-c8e24e99a314)

**After**

![CleanShot 2025-03-13 at 19 59
19@2x](https://github.com/user-attachments/assets/0e424f99-002c-4adc-9b37-edaeef239b0d)



**Before**
![CleanShot 2025-03-13 at 20 00
05@2x](https://github.com/user-attachments/assets/614e51b3-aa0d-45e7-98f4-fcdb1a778bcf)

**After**

![CleanShot 2025-03-13 at 20 00
16@2x](https://github.com/user-attachments/assets/be46988a-2cba-43fc-a8cd-fd3c781da930)
2025-03-14 17:13:08 +00:00
Jacob Fletcher
0ca37364ea docs: moves customizing fields doc to fields overview (#10742)
Continuation of #10741. Field-level admin options, including the
conditional logic and custom field components, are currently documented
within the "admin > customizing views" page. This makes them hard to
find because users, myself included, intuitively navigate to the fields
overview doc first to locate this information. Now, they are rendered
within "fields > overview" as expected. This should help keep the user
from jumping around from doc to doc and getting lost.
2025-01-22 23:58:05 -05:00
Alessio Gravili
b774f557be docs: minor lexical docs improvements (#10414) 2025-01-07 16:22:40 +00:00
Alessio Gravili
182eaa3433 feat(richtext-lexical): ability to override default placeholder (#10278)
![CleanShot 2024-12-30 at 23 28
01@2x](https://github.com/user-attachments/assets/0bab3a2a-bded-440f-9bfe-cb8bf5b74e2a)

![CleanShot 2024-12-30 at 23 28
08@2x](https://github.com/user-attachments/assets/589b7be0-f662-4c4a-b66b-66f9b88ee7c6)
2024-12-31 07:09:03 +00:00
Alessio Gravili
5b4730d13c docs: fix incorrect escaping of * (#10274) 2024-12-30 17:02:13 -07:00
Germán Jabloñski
abee24e1d0 docs: refactor and improve rich text docs (#9929)
- Refactoring that simplifies finding things:
    ```md
    ## BEFORE
    
    - Rich Text
      - Overview
      - Slate
      - Lexical
    - Lexical
      - Overview
      - Converters
      - Migration
      - Custom Features
    
    ## AFTER
    
    - Rich Text
      - Overview
      - Converters
      - Custom Features
      - Migration
      - Slate (legacy) 
    ```

- It takes some of the spotlight away from Slate. Lexical is assumed as
the default editor and a banner at the beginning refers to the Slate
documentation.
- Various writing improvements.

PENDING:
- [ ] some 301 redirects needed
  - `/docs/rich-text/lexical` to `/docs/rich-text/overview`
  - `/docs/lexical/overview` to `/docs/rich-text/overview`
  - `/docs/lexical/converters` to `/docs/rich-text/converters`
  - `/docs/lexical/migration` to `/docs/rich-text/migration`
2024-12-12 14:20:01 -07:00
Dan Ribbens
a25ddc5448 docs: migration guide more info (#9305) 2024-11-18 17:35:36 -05:00
Said Akhrarov
0574155e59 docs: fix docs-wide spelling errors and formatting issues (#8942)
### What?
I noticed a spelling error in the banner of the beta docs and decided I
could save everyone some time by *running the entirety of the beta docs*
through a spellchecker.

### Why?
To fix many spelling and formatting mistakes at once.

### How?
By enabling `edit mode` in my browser and letting the built-in
spellchecker perform its magic (and changing _only_ where it made
sense).

~~Ironically, the original spelling mistake that inspired me to do this
remains unchanged as that is a part of the website repo. [PR for that is
here](https://github.com/payloadcms/website/pull/388).~~
2024-10-30 11:54:44 -06:00
Sasha
197e3bc010 docs: corrects old imports (#8769)
1
`import type { Field } from 'payload/types'`
to
`import type { Field } from 'payload'`
2
`import { buildConfig } from 'payload/config'`
to
`import { buildConfig } from 'payload'`

3
```
import { SelectInput, useField } from 'payload/components/forms';
import { useAuth } from 'payload/components/utilities';
```
to
`import { SelectInput, useAuth, useField } from '@payloadcms/ui'`

4
uses `import type` for `import type { CollectionConfig } from 'payload'`
2024-10-18 10:47:47 +03:00
Sasha
bf48af411d feat: add virtual property to the fields config (#7621)
## Description

Adds `virtual` property to the fields config. Providing `true`
completely disables the field in the DB, which is useful for [Virtual
Fields](https://payloadcms.com/blog/learn-how-virtual-fields-can-help-solve-common-cms-challenges)
Disables abillity to query by a field with `virtual: true`.
Currently, they bloat the DB with unused tables / columns, which may as
well introduce additional joins.
Discussion https://github.com/payloadcms/payload/discussions/6270
Prev PR (this one contains only this feature):
https://github.com/payloadcms/payload/pull/6983

- [x] I have read and understand the
[CONTRIBUTING.md](https://github.com/payloadcms/payload/blob/main/CONTRIBUTING.md)
document in this repository.

## Type of change

<!-- Please delete options that are not relevant. -->

- [x] New feature (non-breaking change which adds functionality)
- [x] This change requires a documentation update

## Checklist:

- [x] I have added tests that prove my fix is effective or that my
feature works
- [x] Existing test suite passes locally with my changes
- [x] I have made corresponding changes to the documentation
2024-09-17 10:40:54 -04:00
Jarrod Flesch
46707e4c5e chore: update lexical docs links 2024-09-10 14:11:11 -04:00
Jacob Fletcher
b6d4bc4d37 docs: cleanup to individual field docs (#7202) 2024-07-22 23:46:06 -04:00
Jacob Fletcher
edb501349f docs: improves authentication docs (#7195) 2024-07-17 12:52:41 -04:00
Jacob Fletcher
0e673c6335 docs: improves access control docs (#7154) 2024-07-15 15:29:11 -04:00
Jacob Fletcher
a1bb661a1a docs: misc improvements (#7107) 2024-07-11 09:54:21 -04:00
Jacob Fletcher
5a76d6db8b docs: improves configuration docs (#7090) 2024-07-09 18:10:04 -04:00
Ritsu
eb2f7631f7 feat: allow users/plugins to modify and extend generated types for fields & config, add generated types for json field (#6984)
- Improves type for `jsonSchema` property of JSON field
- Adds type generation of JSON field with `jsonSchema`
- Adds `typescriptSchema` property to fields that allows you override
default field type generation by providing a JSON schema.
- Adds `typescript.schema` property in payload config, to allow for any
modifications of the type schemas

---------

Co-authored-by: Alessio Gravili <alessio@gravili.de>
2024-07-02 16:48:21 +00:00
Jacob Fletcher
ae8a5a9cb8 docs: automatic custom component detection (#6939) 2024-06-26 10:19:28 -04:00
Alessio Gravili
1a9c63bf26 docs(richtext-lexical): docs for building custom lexical features (#6862) 2024-06-25 14:54:59 +00:00
Jarrod Flesch
238b69278b chore: updated 3.0 upload docs (#6860) 2024-06-21 15:34:35 -04:00
Jacob Fletcher
a20cf70105 docs: removes express 2024-05-13 10:29:59 -04:00
Alessio Gravili
19f8cbcf76 docs: new and improve lexical docs, hoist up all headings (#6639) 2024-06-05 17:08:15 -04:00
Alessio Gravili
6789e61488 chore: run lint & prettier on everything 2024-03-14 23:53:47 -04:00
James
077bd7fad3 chore: rich text docs 2023-10-08 19:37:41 -04:00
Alessio Gravili
a81401cf77 feat: breaking: richtext adapter (#3311)
BREAKING: requires user to install @payloacms-richtext-slate and specify a `config.editor` property

* chore: move slate stuff into packages/richtext-slate

* chore: fieldTypes stuff

* chore: fix richtext-slate tsconfig

* chore: add clean:unix command

* chore: fix up things

* chore: undo subpath imports being hoisted up

* chore: fix incorrect imports

* chore: improve AdapterArguments type

* chore: remove unused richTextToHTML and stringifyRichText files

* fix: core-dev scss imports

* chore: fix publishConfig exports for richtext-slate

* chore: adjust joi schema for richtext field

* chore: various fixes

* chore: handle afterRead population in richText adapter

* chore: handle more after-read promise stuff

* chore: fix joi validation

* chore: add richtext adapter to tests

* chore: merge adapter props with field props

* chore: index.tsx => index.ts

* chore: rename `adapter` to `editor`

* chore: fix e2e tests not running due to importing a constant from a file (`Tabs`) which imports createSlate.

This fails because createSlate imports React components.

* chore: remove unnecessary import

* chore: improve various typings

* chore: improve typings for List view Cell components

* feat: richText adapter cell component

* chore: add missing types packages for packages/richtext-slate

* chore: add new adapter interface properties to joi schema

* chore: withMergedProps utility which replaces getSlateCellComponent and getSlateFieldComponent

* feat: added config.defaultEditor property which is now required. field.editor is no longer required and overrides config.defaultEditor

* docs: mention editor and defaultEditor property in the docs

* chore: fix incorrectly formatted JSX in docs files breaking mdx parser

* chore: fix various errors

* chore: auto-generated pointer files
2023-09-19 11:03:31 +02:00
Alessio Gravili
ae7d6f97d2 chore: formatting and linting (#3261)
* chore: lint packages/payload

* chore: lint packages/db-postgres

* chore: lint packages/db-mongodb

* chore: update eslintrc exclusion rules

* chore: update eslintrc exclusion rules

* chore: lint misc files

* chore: run prettier through packages

* chore: run eslint on payload again

* chore: prettier misc files

* chore: prettier docs
2023-09-01 17:39:44 +02:00
Alessio Gravili
9467074fb9 chore: update 2.0 branch from master (#3207)
Co-authored-by: Jacob Fletcher <jacobsfletch@gmail.com>
Co-authored-by: Alessio Gravili <alessio@gravili.de>
Co-authored-by: PatrikKozak <patrik@trbl.design>
Co-authored-by: Lucas Blancas <lablancas@gmail.com>
Co-authored-by: Stef Gootzen <37367280+stefgootzen@users.noreply.github.com>
Co-authored-by: Jarrod Flesch <30633324+JarrodMFlesch@users.noreply.github.com>
Co-authored-by: Jessica Chowdhury <67977755+JessChowdhury@users.noreply.github.com>
Co-authored-by: PatrikKozak <35232443+PatrikKozak@users.noreply.github.com>
Co-authored-by: Greg Willard <Wickett06@gmail.com>
Co-authored-by: James Mikrut <james@payloadcms.com>
Co-authored-by: Dan Ribbens <dan.ribbens@gmail.com>
Co-authored-by: Elliot DeNolf <denolfe@gmail.com>
fix: WhereBuilder component does not accept all valid Where queries (#3087)
fix: passes in height to resizeOptions upload option to allow height resize (#3171)
2023-08-22 16:04:50 -04:00
Alessio Gravili
f911257cd9 feat: RTL Support (#3003)
Co-authored-by: Alessio Gravili <alessio@gravili.de>
Co-authored-by: ibr-hin95 <ibr.hin95@gmail.com>
Co-authored-by: Seied Ali Mirkarimi <dasmergo@gmail.com>
Co-authored-by: muathkhatib <mkhatib.dev@gmail.com>
Co-authored-by: ibr-hin95 <40246707+ibr-hin95@users.noreply.github.com>
fix: recursiveNestedPaths not merging existing fields when hoisting row/collapsible fields (#2769)
fix: exclude monaco code editor from ltr due to microsoft/monaco-editor#2371

BREAKING CHANGE:
- The admin hook for `useLocale` now returns a Locale object of the currently active locale. Previously this would only return the code as a string. Any custom components built which had `locale = useLocale()` should be replaced with `{ code: locale } = useLocale()` to maintain the same functionality.
- The property `localization.locales` of `SanitizedConfig` type has changed. This was an array of strings and is now an array of Locale objects having: `label: string`, `code: string` and `rtl: boolean`. If you are using localization.locales from the config you will need to adjust your project or plugin accordingly.
2023-08-22 12:18:15 -04:00
Mark Barton
a0b13a5b01 feat: text alignment for richtext editor (#2803)
* Update isActive.tsx

This change allows us to define toggling of custom types in Slate. Specifically, this fixes the ability to toggle Alignment on nodes that use other active elements.

isElementActive(editor, format, TEXT_ALIGN_TYPES.includes(format) ? 'align' : 'type');

Type is the default for elements, allowing us to use a custom field lets us greater extend the functionality of Slate in Payload without causing any breaking changes

* Update toggle.tsx

Added to toggleElement public function

* Update isActive.tsx

* Update toggle.tsx

Added Rich Text Alignment, updated toggle function, added tests and doc updates

* added margin to void elements

* fix: list alignment

* removed textAlign from elements and added docs

* chore: fix typo

---------

Co-authored-by: Alessio Gravili <alessio@gravili.de>
2023-08-14 17:08:50 +02:00
Jessica Chowdhury
8ae98503f5 docs: adds images to each field page (#3137) 2023-08-08 10:00:21 -04:00
Michel v. Varendorff
967899229f feat: collection admin.enableRichTextLink property (#2560) 2023-05-04 16:31:40 -04:00
Harrison-Blair
13179a9498 chore: misc documentation updates (#2589)
* chore: ensures example configs are being exported when necessary
* chore: adds note regarding updating of hidden fields

---------

Co-authored-by: Jessica Boezwinkle <jessica@trbl.design>
2023-05-01 16:28:13 -04:00
Michel v. Varendorff
bf6522898d feat: allow customizing the link fields (#2559) 2023-04-26 11:08:47 -04:00
Jessica Boezwinkle
4fb8b0fa28 chore: updates richText docs 2023-04-24 17:58:49 +01:00
mauricewegner
ed230a42e0 feat: add rich-text blockquote element, change quote node type to blockquote 2023-04-20 21:52:05 +02:00
Teun Mooij
023719d775 feat: configuration extension points
* added custom config extension points

* Added custom field to documentation

* fix deeprequired issue
2023-04-18 15:28:42 -04:00
Jacob Fletcher
8e6b2c4f9d docs: reserved field names 2023-01-02 00:47:54 -05:00
Dan Ribbens
924d903456 docs: remove GraphQL from label descriptions 2022-12-01 15:48:40 -05:00
James
183cd9a0be chore: updates docs to reflect new website public images folder 2022-11-13 17:41:39 -05:00
James
f9b1b1fe7f docs: adds Link example in rich text 2022-09-13 21:25:08 -07:00
Elliot DeNolf
4357c5491d docs: add rich text link fields 2022-09-08 15:40:49 -07:00
Elliot DeNolf
1ed867ce0c docs: update examples with ts types 2022-08-23 11:43:24 -04:00
Elliot DeNolf
cc360191b5 docs: remove references to demo config 2022-07-19 11:09:13 -07:00
James
beec04a1bc docs: collapsible 2022-07-13 15:40:59 -07:00
Dan Ribbens
e4affd4bf9 docs: updated links 2022-04-29 14:40:49 -04:00
Jarrod Flesch
0e4eb906f2 feat: enhances rich text upload with custom field API
* feat: adds admin.upload.collections[collection-name].fields to the RTE to save specific data on upload elements

* chore: renames flatten to unflatten in reduceFieldsToValues, disables automatic arrow function return in eslint

* docs: adds documentation for upload.collections[collection-name].fields feature

* feat: adds recursion to richText field to populate relationship and upload nested fields

* chore: removes unused css

* fix: import path for createRichTextRelationshipPromise

* docs: updates docs to include images for the RTE upload docs
2022-01-21 10:15:51 -05:00
James Mikrut
7df50f9bf9 feat: adds indentation controls to rich text
* feat: rich text indent PoC

* fix: new slate version types

* feat: ensures only lowest rich text list is shown as active

* feat: adds icons for indentation

* docs: adds indent to rich text
2022-01-12 14:16:05 -05:00
James
77a208fff7 docs: typescript 2021-11-26 17:10:01 -05:00