Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
525 commits
Select commit Hold shift + click to select a range
0647d63
get lexical blocks working again, fix incorrect usages of getFormState
AlessioGr Nov 4, 2024
2066184
fix: prevent drawer from closing upon create
JarrodMFlesch Nov 4, 2024
349686f
renames renderListFn
jacobsfletch Nov 4, 2024
3df7f69
relocates document and list view server fn handlers
jacobsfletch Nov 4, 2024
e81b3a8
fix list view filter options
jacobsfletch Nov 4, 2024
cbafa72
lexical: working blocks, working fields drawer
AlessioGr Nov 4, 2024
4c14677
remove console.log
AlessioGr Nov 4, 2024
d3990d1
fix: schema paths should not include _index in schema paths unless th…
JarrodMFlesch Nov 4, 2024
10ba802
Merge remote-tracking branch 'refs/remotes/origin/feat/on-demand-rsc'…
JarrodMFlesch Nov 4, 2024
f50f5d2
chore: delete blacklisted client-to-server keys instead of setting un…
JarrodMFlesch Nov 4, 2024
da00936
lexical: get remaining features to work
AlessioGr Nov 4, 2024
f70db1b
fix(richtext-lexical): fix node.getPoint errors when working with dra…
AlessioGr Nov 4, 2024
67acbfd
chore: move permissions to serverProps and only require on client for…
JarrodMFlesch Nov 4, 2024
6dd0967
Merge remote-tracking branch 'refs/remotes/origin/feat/on-demand-rsc'…
JarrodMFlesch Nov 4, 2024
968269a
fix: non-serializable formstate was being sent to onSubmit and before…
AlessioGr Nov 4, 2024
eba967d
almost restore fields test suite to its full glory
AlessioGr Nov 4, 2024
5450903
fix: tab index paths being incorrectly prepended to named field's paths
AlessioGr Nov 4, 2024
65d895d
fix: ensure sidebar fields do not cause error in RenderFields
AlessioGr Nov 4, 2024
a504b08
add missing prop to hook array
AlessioGr Nov 4, 2024
3607e4b
fix: ensure tabs save data by making sure the path & schemaPath of ch…
AlessioGr Nov 4, 2024
af0d356
wip join field
jacobsfletch Nov 4, 2024
503b94c
type cleanup inside RenderFields
JarrodMFlesch Nov 4, 2024
9c11be8
Merge remote-tracking branch 'refs/remotes/origin/feat/on-demand-rsc'…
JarrodMFlesch Nov 4, 2024
6e39d25
chore: remove useForm from renderFields
JarrodMFlesch Nov 4, 2024
4d5f06d
fixes search
jacobsfletch Nov 4, 2024
8fef770
chore: swap useField out for useFormFields
JarrodMFlesch Nov 4, 2024
a19a723
misc fixes
AlessioGr Nov 5, 2024
560d5ad
fix type errors
AlessioGr Nov 5, 2024
48523e1
chore: fix jarrod
AlessioGr Nov 5, 2024
7e215f5
prevent error if array field does not receive permissions
AlessioGr Nov 5, 2024
0f13978
working richtext-slate
AlessioGr Nov 5, 2024
8371299
restore whole fields test suite
AlessioGr Nov 5, 2024
15f485e
Merge remote-tracking branch 'refs/remotes/origin/feat/on-demand-rsc'…
JarrodMFlesch Nov 5, 2024
f5e749f
completes readOnly prop to custom components
JarrodMFlesch Nov 5, 2024
1057093
feat: implements custom logout, avatar, Icon and Logo
JarrodMFlesch Nov 5, 2024
52ca879
reuse Logo component
JarrodMFlesch Nov 5, 2024
6952b75
poc linked cell overrides for relationship table
jacobsfletch Nov 5, 2024
a969825
enables relationship table sort
jacobsfletch Nov 5, 2024
d3c78de
safely accesses admin components
jacobsfletch Nov 5, 2024
4534b74
adds providers back in
JarrodMFlesch Nov 5, 2024
aa5d1f5
Merge remote-tracking branch 'refs/remotes/origin/feat/on-demand-rsc'…
JarrodMFlesch Nov 5, 2024
ca485bd
fix fields not rendering
AlessioGr Nov 5, 2024
fbe4295
add back commented out fields test suite stuff
AlessioGr Nov 5, 2024
5d91a2e
chore: adjusts field not rendering logic
JarrodMFlesch Nov 5, 2024
181d8a6
Merge remote-tracking branch 'refs/remotes/origin/feat/on-demand-rsc'…
JarrodMFlesch Nov 5, 2024
da6154a
fix missing handleServerFunctions export
JarrodMFlesch Nov 5, 2024
0e32837
Merge branch 'beta' into feat/on-demand-rsc
jacobsfletch Nov 5, 2024
164020e
fix handleServerFunctions export/import
JarrodMFlesch Nov 5, 2024
516975b
chore: exports missing imports for ui package
JarrodMFlesch Nov 5, 2024
d6d3101
fixes step nav
jacobsfletch Nov 5, 2024
e50a899
fix custom server field in _community
jacobsfletch Nov 5, 2024
1807aac
safely checks admin.disabled in form state
jacobsfletch Nov 5, 2024
aad8e93
removes logs
jacobsfletch Nov 5, 2024
9bb2d97
chore: fix types remove _isPresentational prop
JarrodMFlesch Nov 5, 2024
c918991
chore: use types in custom cell component
JarrodMFlesch Nov 5, 2024
18d9a21
realign list subheader to match current beta dom
JarrodMFlesch Nov 5, 2024
31c2a2a
fix: ensure server form state is not merged if it's null
AlessioGr Nov 5, 2024
6dff40d
improve custom list Description props
JarrodMFlesch Nov 5, 2024
27c51c5
Merge remote-tracking branch 'refs/remotes/origin/feat/on-demand-rsc'…
JarrodMFlesch Nov 5, 2024
8fa047d
account view
jacobsfletch Nov 5, 2024
d8a4a6f
perf(richtext-lexical): optimize slash menu item selection by minimiz…
AlessioGr Nov 5, 2024
ea0fc62
attach custom list components to list view
JarrodMFlesch Nov 5, 2024
dc6515a
Merge remote-tracking branch 'refs/remotes/origin/feat/on-demand-rsc'…
JarrodMFlesch Nov 5, 2024
87ccd74
lexical: more reliable slash menu closing, avoid nested editor.update's
AlessioGr Nov 5, 2024
d0f31e7
chore: renders custom list view Description with props
JarrodMFlesch Nov 5, 2024
8a9cf9b
Merge remote-tracking branch 'refs/remotes/origin/feat/on-demand-rsc'…
JarrodMFlesch Nov 5, 2024
da1dd11
properly throws not found based on doc permissions
jacobsfletch Nov 5, 2024
dc572a1
properly throws not-found for unauthorized docs
jacobsfletch Nov 5, 2024
4c29ab0
chore: working global dependency components
JarrodMFlesch Nov 5, 2024
20e11e3
Merge remote-tracking branch 'refs/remotes/origin/feat/on-demand-rsc'…
JarrodMFlesch Nov 5, 2024
fbc82d4
moves doc drawer header definition out from view
jacobsfletch Nov 5, 2024
20723e2
adjust custom save button styles
JarrodMFlesch Nov 5, 2024
796c15d
chore: renders versions list view
JarrodMFlesch Nov 5, 2024
498d849
Merge remote-tracking branch 'refs/remotes/origin/feat/on-demand-rsc'…
JarrodMFlesch Nov 5, 2024
4d85b91
clear step nav on dashboard view
JarrodMFlesch Nov 5, 2024
0642127
reintroduces getDocPermissions into document info provider
jacobsfletch Nov 5, 2024
b97c143
fix(richtext-lexical): drawer fields sometimes not appearing. This en…
AlessioGr Nov 5, 2024
3014f96
fix(richtext-lexical): add missing dependency array
AlessioGr Nov 5, 2024
6c8de66
reduce flakes, reduce test timeout when running locally
AlessioGr Nov 5, 2024
1d7dc69
fix document tabs key prop
jacobsfletch Nov 6, 2024
8194809
fix document tabs key prop
jacobsfletch Nov 6, 2024
4e00231
fix props in custom field description within admin tests
jacobsfletch Nov 6, 2024
69bcfbf
properly retrieves in document controls and cleans up document slots
jacobsfletch Nov 6, 2024
223cf63
removes _isPreviewEnabled property from client config
jacobsfletch Nov 6, 2024
73c9a34
passing lexical tests, and less flakes than on current beta
AlessioGr Nov 6, 2024
2e18638
pass payload to server cell components, render richtext cells
AlessioGr Nov 6, 2024
189e514
fully-functional, lexical cell component. This is now an rsc, not a c…
AlessioGr Nov 6, 2024
2dff78a
pass i18n to cell component serverProps
AlessioGr Nov 6, 2024
33dbcb5
ensure lexical cell component displays "noLabel" if it's empty, inste…
AlessioGr Nov 6, 2024
55a9e94
slate: fully-functional rsc-only cell component
AlessioGr Nov 6, 2024
6dce541
slate: ensure initial or required form state requests are not aborted
AlessioGr Nov 6, 2024
9030aa8
fix(richtext-lexical): fix cannot find active editor state errors whe…
AlessioGr Nov 6, 2024
29a6ec1
minor fixes
AlessioGr Nov 6, 2024
94f8787
creates renderListViewSlots fn and avoids sending unnecessary slots, …
jacobsfletch Nov 6, 2024
760200c
chore: passing auth test suite
JarrodMFlesch Nov 6, 2024
7916991
chore: remove select from getVersions findVersions call
JarrodMFlesch Nov 6, 2024
d400a7e
prevents id field from rendering and dedupes duplicative custom id
jacobsfletch Nov 6, 2024
dbaff20
fix flaky document meta tests
jacobsfletch Nov 6, 2024
df007d4
chore: fixes field labels, brings back array test config
JarrodMFlesch Nov 6, 2024
bd56af1
simplify lexical cell editor state handling
AlessioGr Nov 6, 2024
4d75c56
perf: loads document dependencies in parallel to reduce load time
jmikrut Nov 6, 2024
096eefd
do not let playwright handle starting up the dev server, as playwrigh…
AlessioGr Nov 6, 2024
62724b5
Merge branch 'feat/on-demand-rsc' of github.com:payloadcms/payload in…
jmikrut Nov 6, 2024
f2d2630
log time for reInitializeDB
AlessioGr Nov 6, 2024
90d9d6e
speed up reinitDB for mongodb by not waiting for index creation to be…
AlessioGr Nov 6, 2024
d6d214b
implement RowLabels
JarrodMFlesch Nov 6, 2024
f70ef8d
Merge remote-tracking branch 'refs/remotes/origin/feat/on-demand-rsc'…
JarrodMFlesch Nov 6, 2024
29c9e45
deflakes routing e2e
jacobsfletch Nov 6, 2024
9cccbba
increase expect timeout. 2.5s is sometimes not enough for saving docu…
AlessioGr Nov 6, 2024
f9ea396
chore: passing fields->array
JarrodMFlesch Nov 6, 2024
3c288fa
Merge remote-tracking branch 'refs/remotes/origin/feat/on-demand-rsc'…
JarrodMFlesch Nov 6, 2024
0a61160
deflakes custom logout route e2e
jacobsfletch Nov 6, 2024
6cc18e9
renames renderFieldMethod to renderFieldFn
jacobsfletch Nov 6, 2024
b7a1f4c
chore: passing plugin-seo
jmikrut Nov 6, 2024
4548d30
Merge branch 'feat/on-demand-rsc' of github.com:payloadcms/payload in…
jmikrut Nov 6, 2024
23afac9
chore: passing form-builder tests
jmikrut Nov 6, 2024
1caf5d9
chore: passing fields->email
JarrodMFlesch Nov 7, 2024
f097287
chore: passing fields->blocks
JarrodMFlesch Nov 7, 2024
05b83f7
Merge remote-tracking branch 'refs/remotes/origin/feat/on-demand-rsc'…
JarrodMFlesch Nov 7, 2024
205650d
reduce lexical flakes
AlessioGr Nov 7, 2024
3016660
reduce lexical flakes
AlessioGr Nov 7, 2024
2bba6c8
fix: ensure drawers increase editdepth
AlessioGr Nov 7, 2024
0c8debe
fix some slate tests due to new class names
AlessioGr Nov 7, 2024
1e696bd
chore: passing fields->relationships
JarrodMFlesch Nov 7, 2024
fcecad6
Merge remote-tracking branch 'refs/remotes/origin/feat/on-demand-rsc'…
JarrodMFlesch Nov 7, 2024
cde1135
fix relationship drawers
jacobsfletch Nov 7, 2024
5e3eab7
chore: revert list header classname to current beta css class name
JarrodMFlesch Nov 7, 2024
4b2e863
fix: upload allowCreate
JarrodMFlesch Nov 7, 2024
ac85bc4
Merge remote-tracking branch 'refs/remotes/origin/feat/on-demand-rsc'…
JarrodMFlesch Nov 7, 2024
d352c35
chore: type fixes
jmikrut Nov 7, 2024
e11ad33
Merge branch 'feat/on-demand-rsc' of github.com:payloadcms/payload in…
jmikrut Nov 7, 2024
aa5abee
fix: re-render entire field when removing a row. Otherwise, the array…
AlessioGr Nov 7, 2024
9d5dd5a
fix flakes
AlessioGr Nov 7, 2024
f3cf304
chore: type fixes
jmikrut Nov 7, 2024
a749617
Merge branch 'feat/on-demand-rsc' of github.com:payloadcms/payload in…
jmikrut Nov 7, 2024
652e691
fix some lexical tests again
AlessioGr Nov 7, 2024
b9c41ee
fix existing doc drawer initialization
jacobsfletch Nov 7, 2024
fdbf86d
fix document drawer abort controller madness
AlessioGr Nov 7, 2024
51ec6b2
Merge remote-tracking branch 'origin/beta' into feat/on-demand-rsc
AlessioGr Nov 7, 2024
f451768
adjust list header rendering
JarrodMFlesch Nov 7, 2024
c35b316
Merge remote-tracking branch 'refs/remotes/origin/feat/on-demand-rsc'…
JarrodMFlesch Nov 7, 2024
0d468ff
fix(richtext-lexical): cell: replace headless editor functions to get…
AlessioGr Nov 7, 2024
81a904a
Merge remote-tracking branch 'origin/beta' into feat/on-demand-rsc
AlessioGr Nov 7, 2024
64154e0
fix edit depth, differentiates from drawer depth
jacobsfletch Nov 7, 2024
aa402bc
fix create new relationship drawer
jacobsfletch Nov 7, 2024
057a37b
fix docPermissions and getFormState type errors
AlessioGr Nov 7, 2024
2536107
chore: fixes types
jmikrut Nov 7, 2024
58c792c
Merge branch 'feat/on-demand-rsc' of github.com:payloadcms/payload in…
jmikrut Nov 7, 2024
fac30ad
fix(richtext-lexical): correct usages of fieldSchemasToFormState for …
AlessioGr Nov 7, 2024
6a6aa9a
fix(richtext-lexical): fix missing case where empty lexical editors w…
AlessioGr Nov 7, 2024
f8bc243
make fieldSchemaMap of fieldSchemasToFormState optional and add JSDocs
AlessioGr Nov 7, 2024
6a78be6
chore: fixes types
jmikrut Nov 7, 2024
8f3b0fd
Merge branch 'feat/on-demand-rsc' of github.com:payloadcms/payload in…
jmikrut Nov 7, 2024
2add224
chore: makes alessio happy
jmikrut Nov 7, 2024
6d11f79
chore: fix collapsible field test
JarrodMFlesch Nov 7, 2024
60fbc3e
Merge remote-tracking branch 'refs/remotes/origin/feat/on-demand-rsc'…
JarrodMFlesch Nov 7, 2024
36ce043
prevents infinitely referencing props
jacobsfletch Nov 7, 2024
0f081a4
fixes default file cell field type
jacobsfletch Nov 7, 2024
76ae855
fix: lexical blocks kicking focus out of editor when writing
AlessioGr Nov 7, 2024
b8d18a7
resolves more types
jacobsfletch Nov 7, 2024
42e20bd
resolves type in buildTableState error handler
jacobsfletch Nov 7, 2024
b78b1af
properly increments edit depth for rich text drawers and more
jacobsfletch Nov 7, 2024
b2dabb7
Merge remote-tracking branch 'origin/beta' into feat/on-demand-rsc
AlessioGr Nov 7, 2024
3ee58f2
fix(next): /create edit view not rendering any fields
AlessioGr Nov 8, 2024
b212e2d
fix(next): new doc creation for autosave-enabled collections. We need…
AlessioGr Nov 8, 2024
65553af
adjusts initialData logic
jacobsfletch Nov 8, 2024
b13eac2
switch to isRedirectError
AlessioGr Nov 8, 2024
a331310
fix(ui): frontend version count going above maximum version count
AlessioGr Nov 8, 2024
d2bf12a
fix(ui): ensure autosave is not triggered endlessly
AlessioGr Nov 8, 2024
5ec26e8
chore: fixes ui, conditional, indexed field test suites
JarrodMFlesch Nov 8, 2024
6167bf3
bulk edit
jacobsfletch Nov 8, 2024
906551b
fix where builder
jacobsfletch Nov 8, 2024
3e105a2
get slate and lexical to build
AlessioGr Nov 8, 2024
f8ab503
deflakes list filtering e2e tests
jacobsfletch Nov 8, 2024
997b9eb
fix type issues, allow '' paths to take precedence over field names i…
AlessioGr Nov 8, 2024
f1c9b2b
fix next build errors
jacobsfletch Nov 8, 2024
0392b3d
fix lexical errors
AlessioGr Nov 8, 2024
3fd74dd
export UI field component types
AlessioGr Nov 8, 2024
7422fab
fix plugin-stripe type error
AlessioGr Nov 8, 2024
0b5a294
fix incorrectly set up monorepo app folders
AlessioGr Nov 8, 2024
c975291
Merge remote-tracking branch 'origin/beta' into feat/on-demand-rsc
AlessioGr Nov 8, 2024
f599735
fix another autosave test
AlessioGr Nov 8, 2024
58c901d
fix another autosave test
AlessioGr Nov 8, 2024
50cc91e
chore: udpate all generated types
AlessioGr Nov 8, 2024
36925f3
fix selectors in list column e2e tests
jacobsfletch Nov 8, 2024
fbb8229
Merge remote-tracking branch 'origin/beta' into feat/on-demand-rsc
AlessioGr Nov 8, 2024
e26c95d
fix wrong import
AlessioGr Nov 8, 2024
d9711aa
fix e2e configs
AlessioGr Nov 8, 2024
d0da6bc
properly sets paths on nested unnamed fields
jacobsfletch Nov 8, 2024
8a8055a
proper fix for field paths
jacobsfletch Nov 8, 2024
1cae6cf
returns resolved promise from getClientConfig
jacobsfletch Nov 8, 2024
7aa4a56
fix(ui): ensure rscs not exported from client bundle imported from cl…
AlessioGr Nov 8, 2024
4df00f4
fix join field filter options
jacobsfletch Nov 8, 2024
b0f2436
fix: ensure richext rscs import from client bundle
AlessioGr Nov 8, 2024
7c44609
revert dumb code I wrote
AlessioGr Nov 8, 2024
20b09a8
update lockfile
AlessioGr Nov 8, 2024
6b2c939
update packages
AlessioGr Nov 8, 2024
e0f85b5
Merge remote-tracking branch 'origin/beta' into feat/on-demand-rsc
AlessioGr Nov 8, 2024
6ea473a
gets initial columns within renderTable
jacobsfletch Nov 8, 2024
46ebecf
updates underlying table after creating new from join field
jacobsfletch Nov 8, 2024
7fb5b60
fix join field query when creating new doc
jacobsfletch Nov 8, 2024
8597266
chore: fixes tests using previous selectors
JarrodMFlesch Nov 8, 2024
a93da86
chore: passing uploads
JarrodMFlesch Nov 8, 2024
df65781
properly initializes new doc drawer state for join field and renames …
jacobsfletch Nov 8, 2024
d5c9628
Merge branch 'beta' into feat/on-demand-rsc
jacobsfletch Nov 8, 2024
694040c
debug why failing tests show as passing
AlessioGr Nov 10, 2024
3a48251
fix running dev for nested test suite paths
AlessioGr Nov 10, 2024
8bb994f
fix: ensure runE2e command passed down env variables and prod flag to…
AlessioGr Nov 10, 2024
3f2566a
ensure matching react versions
AlessioGr Nov 10, 2024
6c3e272
log env variables
AlessioGr Nov 10, 2024
150a31b
passing int tests
AlessioGr Nov 10, 2024
eab9acb
ensure mongo memory server is started when running e2e tests in CI
AlessioGr Nov 10, 2024
8deab48
fix incorrect importMap import for admin-root test suite
AlessioGr Nov 10, 2024
b83a7f2
make running e2e tests more reliable
AlessioGr Nov 11, 2024
6d2a5dd
remove lie in console.log
AlessioGr Nov 11, 2024
ec7028a
fix jest not logging anything until entire test suite has finished
AlessioGr Nov 11, 2024
bc3c949
fix incorrect importMap import for admin-root test suite
AlessioGr Nov 11, 2024
d3c5cf7
for reliability, always ensure indexes between every test case run
AlessioGr Nov 11, 2024
7ed2859
add ability to disable lint-staged via DISABLE_HUSKY environment vari…
AlessioGr Nov 11, 2024
f336b2a
fix last int test
AlessioGr Nov 11, 2024
e6f73e0
make extra sure that the memorydb is started, even if runInit retries
AlessioGr Nov 11, 2024
a3360b5
fix script for running all e2e tests
AlessioGr Nov 11, 2024
6d6370c
fix auth and access-control test suites
AlessioGr Nov 11, 2024
de9aced
maybe fix admin-root test suite
AlessioGr Nov 11, 2024
50bab57
fix admin-root test suite
AlessioGr Nov 11, 2024
0c4ec43
fix: upload test order
JarrodMFlesch Nov 11, 2024
2e81661
fix broken upload file restoration in fields and admin test suites. N…
AlessioGr Nov 11, 2024
b841f01
chore: set defaults for version max docs on globals and collections
JarrodMFlesch Nov 11, 2024
faeef5b
chore: improve reliablity of autosave expectation
JarrodMFlesch Nov 11, 2024
cc0b88a
lexical tests: ensure blocks are rendered
AlessioGr Nov 11, 2024
eb82ee4
Merge remote-tracking branch 'origin/beta' into feat/on-demand-rsc
AlessioGr Nov 11, 2024
9eae3d6
chore: live preview e2e fix
jmikrut Nov 11, 2024
bda91d8
chore: adds autosave helper to live preview e2e
JarrodMFlesch Nov 11, 2024
7d627db
chore: fixes templates build
jmikrut Nov 11, 2024
6d8fd3a
removes custom server fn feature and related docs
jacobsfletch Nov 11, 2024
774838c
ignore monaco load errors due to slow CI network
AlessioGr Nov 11, 2024
a249935
rscs => rsc
AlessioGr Nov 11, 2024
b240291
make lexical tests wait even longer
AlessioGr Nov 11, 2024
3f74896
chore: fixes form state for disabled fields, createFirstUser
jmikrut Nov 11, 2024
a24b72c
exclude "TypeError: Failed to fetch" error from console error catch t…
AlessioGr Nov 11, 2024
dc8b1fe
removes old custom server function reduce
jacobsfletch Nov 11, 2024
1746313
chore: duplicate id key error
JarrodMFlesch Nov 11, 2024
12332ab
removes custom server fn test
jacobsfletch Nov 11, 2024
35ca534
perf: speeds up admin ui by not fetching for initial user if logged in
jmikrut Nov 11, 2024
707775d
Merge branch 'feat/on-demand-rsc' of github.com:payloadcms/payload in…
jmikrut Nov 11, 2024
aa8d422
fix tsconfig rscs paths
AlessioGr Nov 11, 2024
35ef5fc
chore: fixes website template build
jmikrut Nov 11, 2024
54a98d8
chore: fix bulk upload drawer
JarrodMFlesch Nov 11, 2024
3c66044
chore: fixes alessio's negligence
jmikrut Nov 11, 2024
0c3c216
chore: de-flakes access control
jmikrut Nov 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
17 changes: 14 additions & 3 deletions app/(payload)/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
/* THIS FILE WAS GENERATED AUTOMATICALLY BY PAYLOAD. */
/* DO NOT MODIFY IT BECAUSE IT COULD BE REWRITTEN AT ANY TIME. */
import configPromise from '@payload-config'
import { RootLayout } from '@payloadcms/next/layouts'
// import '@payloadcms/ui/styles.css' // Uncomment this line if `@payloadcms/ui` in `tsconfig.json` points to `/ui/dist` instead of `/ui/src`
import type { ServerFunctionClient } from 'payload'

import config from '@payload-config'
import { handleServerFunctions, RootLayout } from '@payloadcms/next/layouts'
import React from 'react'

import { importMap } from './admin/importMap.js'
Expand All @@ -12,8 +14,17 @@ type Args = {
children: React.ReactNode
}

const serverFunction: ServerFunctionClient = async function (args) {
'use server'
return handleServerFunctions({
...args,
config,
importMap,
})
}

const Layout = ({ children }: Args) => (
<RootLayout config={configPromise} importMap={importMap}>
<RootLayout config={config} importMap={importMap} serverFunction={serverFunction}>
{children}
</RootLayout>
)
Expand Down
1 change: 0 additions & 1 deletion docs/admin/fields.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,6 @@ The following additional properties are also provided to the `field` prop:

| Property | Description |
| ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **`_isPresentational`** | A boolean indicating that the field is purely visual and does not directly affect data or change data shape, i.e. the [UI Field](../fields/ui). |
| **`_path`** | A string representing the direct, dynamic path to the field at runtime, i.e. `myGroup.myArray[0].myField`. |
| **`_schemaPath`** | A string representing the direct, static path to the [Field Config](../fields/overview), i.e. `myGroup.myArray.myField` |

Expand Down
18 changes: 13 additions & 5 deletions docs/lexical/converters.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,12 @@ const yourEditorState: SerializedEditorState // <= your current editor state her

// Import editor state into your headless editor
try {
headlessEditor.setEditorState(headlessEditor.parseEditorState(yourEditorState)) // This should commit the editor state immediately
headlessEditor.update(
() => {
headlessEditor.setEditorState(headlessEditor.parseEditorState(yourEditorState))
},
{ discrete: true }, // This should commit the editor state immediately
)
} catch (e) {
logger.error({ err: e }, 'ERROR parsing editor state')
}
Expand All @@ -382,8 +387,6 @@ headlessEditor.getEditorState().read(() => {
})
```

The `.setEditorState()` function immediately updates your editor state. Thus, there's no need for the `discrete: true` flag when reading the state afterward.

## Lexical => Plain Text

Export content from the Lexical editor into plain text using these steps:
Expand All @@ -401,8 +404,13 @@ const yourEditorState: SerializedEditorState // <= your current editor state her

// Import editor state into your headless editor
try {
headlessEditor.setEditorState(headlessEditor.parseEditorState(yourEditorState)) // This should commit the editor state immediately
} catch (e) {
headlessEditor.update(
() => {
headlessEditor.setEditorState(headlessEditor.parseEditorState(yourEditorState))
},
{ discrete: true }, // This should commit the editor state immediately
)
} catch (e) {
logger.error({ err: e }, 'ERROR parsing editor state')
}

Expand Down
4 changes: 2 additions & 2 deletions examples/custom-components/src/app/(payload)/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* THIS FILE WAS GENERATED AUTOMATICALLY BY PAYLOAD. */
/* DO NOT MODIFY IT BECAUSE IT COULD BE REWRITTEN AT ANY TIME. */
import configPromise from '@payload-config'
import config from '@payload-config'
import '@payloadcms/next/css'
import { RootLayout } from '@payloadcms/next/layouts'
import React from 'react'
Expand All @@ -13,7 +13,7 @@ type Args = {
}

const Layout = ({ children }: Args) => (
<RootLayout config={configPromise} importMap={importMap}>
<RootLayout config={config} importMap={importMap}>
{children}
</RootLayout>
)
Expand Down
2 changes: 1 addition & 1 deletion examples/hierarchy/src/app/(payload)/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/* THIS FILE WAS GENERATED AUTOMATICALLY BY PAYLOAD. */
/* DO NOT MODIFY IT BECAUSE IT COULD BE REWRITTEN AT ANY TIME. */
import configPromise from '@payload-config'
import '@payloadcms/next/css'
import { RootLayout } from '@payloadcms/next/layouts'
/* DO NOT MODIFY IT BECAUSE IT COULD BE REWRITTEN AT ANY TIME. */
import React from 'react'

import './custom.scss'
Expand Down
4 changes: 2 additions & 2 deletions examples/multi-tenant/src/app/(payload)/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* THIS FILE WAS GENERATED AUTOMATICALLY BY PAYLOAD. */
/* DO NOT MODIFY IT BECAUSE IT COULD BE REWRITTEN AT ANY TIME. */
import configPromise from '@payload-config'
import config from '@payload-config'
import '@payloadcms/next/css'
import { RootLayout } from '@payloadcms/next/layouts'
import React from 'react'
Expand All @@ -13,7 +13,7 @@ type Args = {
}

const Layout = ({ children }: Args) => (
<RootLayout config={configPromise} importMap={importMap}>
<RootLayout config={config} importMap={importMap}>
{children}
</RootLayout>
)
Expand Down
5 changes: 5 additions & 0 deletions next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ const config = withBundleAnalyzer(
typescript: {
ignoreBuildErrors: true,
},
experimental: {
serverActions: {
bodySizeLimit: '5mb',
},
},
env: {
PAYLOAD_CORE_DEV: 'true',
ROOT_DIR: path.resolve(dirname),
Expand Down
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,19 +58,20 @@
"dev:generate-importmap": "pnpm runts ./test/generateImportMap.ts",
"dev:generate-types": "pnpm runts ./test/generateTypes.ts",
"dev:postgres": "cross-env PAYLOAD_DATABASE=postgres pnpm runts ./test/dev.ts",
"dev:prod": "cross-env NODE_OPTIONS=--no-deprecation tsx ./test/dev.ts --prod",
"dev:vercel-postgres": "cross-env PAYLOAD_DATABASE=vercel-postgres pnpm runts ./test/dev.ts",
"devsafe": "node ./scripts/delete-recursively.js '**/.next' && pnpm dev",
"docker:restart": "pnpm docker:stop --remove-orphans && pnpm docker:start",
"docker:start": "docker compose -f packages/plugin-cloud-storage/docker-compose.yml up -d",
"docker:stop": "docker compose -f packages/plugin-cloud-storage/docker-compose.yml down",
"force:build": "pnpm run build:core:force",
"lint": "turbo run lint --concurrency 1 --continue",
"lint-staged": "lint-staged",
"lint-staged": "node ./scripts/run-lint-staged.js",
"lint:fix": "turbo run lint:fix --concurrency 1 --continue",
"obliterate-playwright-cache-macos": "rm -rf ~/Library/Caches/ms-playwright && find /System/Volumes/Data/private/var/folders -type d -name 'playwright*' -exec rm -rf {} +",
"prepare": "husky",
"prepare-run-test-against-prod": "pnpm bf && rm -rf test/packed && rm -rf test/node_modules && rm -f test/pnpm-lock.yaml && pnpm run script:pack --all --no-build --dest test/packed && pnpm runts test/setupProd.ts && cd test && pnpm i --ignore-workspace && cd ..",
"prepare-run-test-against-prod:ci": "rm -rf test/node_modules && rm -f test/pnpm-lock.yaml && pnpm run script:pack --all --no-build --dest test/packed && pnpm runts test/setupProd.ts && cd test && pnpm i --ignore-workspace && cd ..",
"prepare-run-test-against-prod": "pnpm bf && rm -rf test/packed && rm -rf test/node_modules && rm -rf app && rm -f test/pnpm-lock.yaml && pnpm run script:pack --all --no-build --dest test/packed && pnpm runts test/setupProd.ts && cd test && pnpm i --ignore-workspace && cd ..",
"prepare-run-test-against-prod:ci": "rm -rf test/node_modules && rm -rf app && rm -f test/pnpm-lock.yaml && pnpm run script:pack --all --no-build --dest test/packed && pnpm runts test/setupProd.ts && cd test && pnpm i --ignore-workspace && cd ..",
"reinstall": "pnpm clean:all && pnpm install",
"release:alpha": "pnpm runts ./scripts/release.ts --bump prerelease --tag alpha",
"release:beta": "pnpm runts ./scripts/release.ts --bump prerelease --tag beta",
Expand Down
48 changes: 48 additions & 0 deletions packages/db-mongodb/src/countGlobalVersions.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import type { QueryOptions } from 'mongoose'
import type { CountGlobalVersions, PayloadRequest } from 'payload'

import { flattenWhereToOperators } from 'payload'

import type { MongooseAdapter } from './index.js'

import { withSession } from './withSession.js'

export const countGlobalVersions: CountGlobalVersions = async function countGlobalVersions(
this: MongooseAdapter,
{ global, locale, req = {} as PayloadRequest, where },
) {
const Model = this.versions[global]
const options: QueryOptions = await withSession(this, req)

let hasNearConstraint = false

if (where) {
const constraints = flattenWhereToOperators(where)
hasNearConstraint = constraints.some((prop) => Object.keys(prop).some((key) => key === 'near'))
}

const query = await Model.buildQuery({
locale,
payload: this.payload,
where,
})

// useEstimatedCount is faster, but not accurate, as it ignores any filters. It is thus set to true if there are no filters.
const useEstimatedCount = hasNearConstraint || !query || Object.keys(query).length === 0

if (!useEstimatedCount && Object.keys(query).length === 0 && this.disableIndexHints !== true) {
// Improve the performance of the countDocuments query which is used if useEstimatedCount is set to false by adding
// a hint. By default, if no hint is provided, MongoDB does not use an indexed field to count the returned documents,
// which makes queries very slow. This only happens when no query (filter) is provided. If one is provided, it uses
// the correct indexed field
options.hint = {
_id: 1,
}
}

const result = await Model.countDocuments(query, options)

return {
totalDocs: result,
}
}
48 changes: 48 additions & 0 deletions packages/db-mongodb/src/countVersions.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import type { QueryOptions } from 'mongoose'
import type { CountVersions, PayloadRequest } from 'payload'

import { flattenWhereToOperators } from 'payload'

import type { MongooseAdapter } from './index.js'

import { withSession } from './withSession.js'

export const countVersions: CountVersions = async function countVersions(
this: MongooseAdapter,
{ collection, locale, req = {} as PayloadRequest, where },
) {
const Model = this.versions[collection]
const options: QueryOptions = await withSession(this, req)

let hasNearConstraint = false

if (where) {
const constraints = flattenWhereToOperators(where)
hasNearConstraint = constraints.some((prop) => Object.keys(prop).some((key) => key === 'near'))
}

const query = await Model.buildQuery({
locale,
payload: this.payload,
where,
})

// useEstimatedCount is faster, but not accurate, as it ignores any filters. It is thus set to true if there are no filters.
const useEstimatedCount = hasNearConstraint || !query || Object.keys(query).length === 0

if (!useEstimatedCount && Object.keys(query).length === 0 && this.disableIndexHints !== true) {
// Improve the performance of the countDocuments query which is used if useEstimatedCount is set to false by adding
// a hint. By default, if no hint is provided, MongoDB does not use an indexed field to count the returned documents,
// which makes queries very slow. This only happens when no query (filter) is provided. If one is provided, it uses
// the correct indexed field
options.hint = {
_id: 1,
}
}

const result = await Model.countDocuments(query, options)

return {
totalDocs: result,
}
}
6 changes: 5 additions & 1 deletion packages/db-mongodb/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import type { CollectionModel, GlobalModel, MigrateDownArgs, MigrateUpArgs } fro

import { connect } from './connect.js'
import { count } from './count.js'
import { countGlobalVersions } from './countGlobalVersions.js'
import { countVersions } from './countVersions.js'
import { create } from './create.js'
import { createGlobal } from './createGlobal.js'
import { createGlobalVersion } from './createGlobalVersion.js'
Expand Down Expand Up @@ -154,7 +156,6 @@ export function mongooseAdapter({
collections: {},
connection: undefined,
connectOptions: connectOptions || {},
count,
disableIndexHints,
globals: undefined,
mongoMemoryServer,
Expand All @@ -166,6 +167,9 @@ export function mongooseAdapter({
beginTransaction: transactionOptions === false ? defaultBeginTransaction() : beginTransaction,
commitTransaction,
connect,
count,
countGlobalVersions,
countVersions,
create,
createGlobal,
createGlobalVersion,
Expand Down
12 changes: 5 additions & 7 deletions packages/db-mongodb/src/utilities/buildJoinAggregation.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import type { PipelineStage } from 'mongoose'
import type { CollectionSlug, JoinQuery, SanitizedCollectionConfig, Where } from 'payload'

import { combineQueries } from 'payload'

import type { MongooseAdapter } from '../index.js'

import { buildSortParam } from '../queries/buildSortParam.js'
Expand Down Expand Up @@ -60,19 +58,19 @@ export const buildJoinAggregation = async ({
for (const join of joinConfig[slug]) {
const joinModel = adapter.collections[join.field.collection]

if (projection && !projection[join.schemaPath]) {
if (projection && !projection[join.joinPath]) {
continue
}

if (joins?.[join.schemaPath] === false) {
if (joins?.[join.joinPath] === false) {
continue
}

const {
limit: limitJoin = join.field.defaultLimit ?? 10,
sort: sortJoin = join.field.defaultSort || collectionConfig.defaultSort,
where: whereJoin,
} = joins?.[join.schemaPath] || {}
} = joins?.[join.joinPath] || {}

const sort = buildSortParam({
config: adapter.payload.config,
Expand Down Expand Up @@ -105,7 +103,7 @@ export const buildJoinAggregation = async ({

if (adapter.payload.config.localization && locale === 'all') {
adapter.payload.config.localization.localeCodes.forEach((code) => {
const as = `${versions ? `version.${join.schemaPath}` : join.schemaPath}${code}`
const as = `${versions ? `version.${join.joinPath}` : join.joinPath}${code}`

aggregate.push(
{
Expand Down Expand Up @@ -146,7 +144,7 @@ export const buildJoinAggregation = async ({
} else {
const localeSuffix =
join.field.localized && adapter.payload.config.localization && locale ? `.${locale}` : ''
const as = `${versions ? `version.${join.schemaPath}` : join.schemaPath}${localeSuffix}`
const as = `${versions ? `version.${join.joinPath}` : join.joinPath}${localeSuffix}`

aggregate.push(
{
Expand Down
2 changes: 1 addition & 1 deletion packages/db-mongodb/src/utilities/handleError.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ export const handleError = ({
collection,
errors: [
{
field: Object.keys(error.keyValue)[0],
message: req.t('error:valueMustBeUnique'),
path: Object.keys(error.keyValue)[0],
},
],
global,
Expand Down
4 changes: 4 additions & 0 deletions packages/db-postgres/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import {
beginTransaction,
commitTransaction,
count,
countGlobalVersions,
countVersions,
create,
createGlobal,
createGlobalVersion,
Expand Down Expand Up @@ -126,6 +128,8 @@ export function postgresAdapter(args: Args): DatabaseAdapterObj<PostgresAdapter>
convertPathToJSONTraversal,
count,
countDistinct,
countGlobalVersions,
countVersions,
create,
createGlobal,
createGlobalVersion,
Expand Down
4 changes: 4 additions & 0 deletions packages/db-sqlite/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import {
beginTransaction,
commitTransaction,
count,
countGlobalVersions,
countVersions,
create,
createGlobal,
createGlobalVersion,
Expand Down Expand Up @@ -114,6 +116,8 @@ export function sqliteAdapter(args: Args): DatabaseAdapterObj<SQLiteAdapter> {
convertPathToJSONTraversal,
count,
countDistinct,
countGlobalVersions,
countVersions,
create,
createGlobal,
createGlobalVersion,
Expand Down
4 changes: 4 additions & 0 deletions packages/db-vercel-postgres/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import {
beginTransaction,
commitTransaction,
count,
countGlobalVersions,
countVersions,
create,
createGlobal,
createGlobalVersion,
Expand Down Expand Up @@ -127,6 +129,8 @@ export function vercelPostgresAdapter(args: Args = {}): DatabaseAdapterObj<Verce
convertPathToJSONTraversal,
count,
countDistinct,
countGlobalVersions,
countVersions,
create,
createGlobal,
createGlobalVersion,
Expand Down
Loading
Loading