Content Lock
Configuration
Every content-lock option.
contentLock({
disabled?: boolean
order?: number // default 1000
groups?: Array<{
key: string
label: string | Record<string, string>
collections?: string[]
globals?: string[]
custom?: string[] // custom target keys
}>
customTargets?: Array<string | {
key: string
label?: string | Record<string, string>
path?: Path | Path[] // Path = string | { path: string; match?: 'prefix' | 'exact' }
}>
individualSelection?: boolean | { access?: ({ req }) => boolean } // default false
exempt?: string[]
retryAfter?: number | 'untilEnd' // default 3600
timezone?: boolean | DateField['timezone'] // default true
localeMap?: Record<string, string>
editor?: {
features?: FeatureProviderServer[] | (({ defaultFeatures }) => FeatureProviderServer[])
converters?: string
}
jobs?: false | { queues?: string[] }
collection?: {
slug?: string // default 'content-locks'
access?: CollectionConfig['access'] | Access // one function: create, update, delete
overrides?: (collection: CollectionConfig) => CollectionConfig
}
translations?: TranslationsOption
})| Option | Default | |
|---|---|---|
disabled | false | Return the config untouched, for opting out per environment. |
order | 1000 | Plugin order. Keep it after plugins that add or change access on your collections. |
groups | [] | What a window can freeze besides everything. See scope. |
customTargets | [] | Things a window can lock besides collections and globals, for your code to check. See custom targets. |
individualSelection | false | Raw collection and global pickers on the window, optionally gated by access. |
exempt | [] | Slugs never frozen, on top of the lock collection, Payload's system collections, and collections marked custom: { contentLock: { exempt: true } }. |
retryAfter | 3600 | Retry-After seconds, or 'untilEnd' for the seconds until the known end. |
timezone | true | Time zone picker on the window's dates, from admin.timezones. Pass Payload's date timezone config to narrow the zones, or false to turn it off. The banner always shows the viewer's local time. |
localeMap | {} | Admin language to content locale, for message locales. |
editor | Extra Lexical features and their converters for messages. | |
jobs | on | Jobs integration, when @10x-media/jobs is installed. |
collection.slug | 'content-locks' | |
collection.access | signed-in users | Who may read and manage windows: per operation, or one function for create, update and delete. The plugin always narrows update to windows that have not ended. |
collection.overrides | Last-word override of the generated collection. Ended windows stay read-only even if it replaces access. | |
translations | Per-key string overrides. See i18n. |
Exports
| Path | |
|---|---|
@10x-media/content-lock | contentLock, getContentLockState, isContentLocked, assertContentUnlocked, withoutContentLock, ContentLockedError, isContentLockedError, notEndedWhere, ContentLockTokenFeature, types |
@10x-media/content-lock/client | useContentLock, LocalDate, the admin components |
@10x-media/content-lock/rsc | ContentLockHeader, StageFilterBar |
@10x-media/content-lock/types | ContentLockState, LockWindow, LockStage, and friends |
@10x-media/content-lock/i18n | keys, translations |