@delmaredigital/payload-experiments 0.5.3 → 0.20.0-next.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/README.md +15 -4
  2. package/dist/admin/blocks/formApi.js +17 -15
  3. package/dist/admin/blocks/model.js +1 -1
  4. package/dist/admin/theme.css +43 -47
  5. package/dist/admin/views/renderCollectionList.js +1 -1
  6. package/dist/blocks/formState.d.ts +1 -1
  7. package/dist/blocks/formState.js +2 -5
  8. package/dist/blocks/placementLocale.js +10 -13
  9. package/dist/blocks/placementPublication.d.ts +1 -1
  10. package/dist/blocks/placementPublication.js +6 -5
  11. package/dist/collections/access.d.ts +2 -0
  12. package/dist/collections/access.js +2 -0
  13. package/dist/collections/cohortMembers.js +1 -0
  14. package/dist/collections/events.js +1 -0
  15. package/dist/collections/experiments/config.js +2 -1
  16. package/dist/collections/experiments/createDefaults.js +4 -3
  17. package/dist/collections/experiments/flagControlParams.js +2 -1
  18. package/dist/collections/experiments/lockHook.js +6 -4
  19. package/dist/collections/identities.js +1 -0
  20. package/dist/collections/layers.js +1 -0
  21. package/dist/collections/metrics.js +1 -0
  22. package/dist/collections/phases.js +1 -0
  23. package/dist/collections/snapshots.js +1 -0
  24. package/dist/db/appends.d.ts +4 -7
  25. package/dist/db/appends.js +5 -12
  26. package/dist/db/clickGoals.js +5 -2
  27. package/dist/db/executor.d.ts +1 -5
  28. package/dist/db/names.d.ts +1 -1
  29. package/dist/db/names.js +1 -1
  30. package/dist/db/pageContent.d.ts +1 -1
  31. package/dist/db/pageContent.js +1 -1
  32. package/dist/endpoints/pages.js +12 -7
  33. package/dist/globals/state.js +2 -0
  34. package/dist/goals/fairness.js +4 -1
  35. package/dist/hooks/pageGuard.d.ts +0 -3
  36. package/dist/hooks/pageGuard.js +14 -12
  37. package/dist/payloadCompat.d.ts +8 -0
  38. package/dist/payloadCompat.js +16 -0
  39. package/dist/puck/editor/editor.css +103 -103
  40. package/dist/server/previewDraft.js +0 -1
  41. package/dist/server/recordContentChange.d.ts +1 -1
  42. package/dist/server/recordContentChange.js +11 -15
  43. package/dist/server/runResults.d.ts +1 -1
  44. package/dist/server/runResults.js +1 -1
  45. package/dist/server/startExperiment.d.ts +1 -1
  46. package/dist/server/startExperiment.js +1 -1
  47. package/dist/transitions/contentFields.d.ts +3 -6
  48. package/dist/transitions/contentFields.js +3 -9
  49. package/dist/transitions/makeContent.js +34 -16
  50. package/dist/transitions/pageAddress.d.ts +3 -1
  51. package/dist/transitions/pageAddress.js +33 -3
  52. package/dist/ui/accent.d.ts +5 -1
  53. package/dist/ui/accent.js +6 -5
  54. package/package.json +11 -11
@@ -5,11 +5,7 @@ export { pgPoolExecutor, ownConnection, withStatementTimeout, raceDeadline, Resu
5
5
  /** Bound statements in an owned results transition without racing a write or commit. */
6
6
  export declare function setTransitionTimeout(exec: Executor, deadline: number): Promise<void>;
7
7
  type TransactionRequest = Pick<PayloadRequest, 'payload' | 'transactionID'>;
8
- export declare function transactionSession(req: TransactionRequest): Promise<{
9
- db: unknown;
10
- reject: () => Promise<void>;
11
- resolve: () => Promise<void>;
12
- }>;
8
+ export declare function transactionSession(req: TransactionRequest): Promise<NonNullable<Payload['db']['sessions']>[string]>;
13
9
  export declare function txExecutor(req: TransactionRequest): Executor & {
14
10
  schemaName?: string;
15
11
  };
@@ -1,4 +1,4 @@
1
- /** SQL identifiers from the Payload 3.90.2 generated-schema fixture (2026-12-04).
1
+ /** SQL identifiers from the Payload 4.0.0-beta.6 generated-schema fixture (2026-12-04).
2
2
  * All main, array, relationship and version tables are included. Access through
3
3
  * these literal keys is checked by TypeScript; names.test.ts checks fixture parity.
4
4
  */
package/dist/db/names.js CHANGED
@@ -1,4 +1,4 @@
1
- /** SQL identifiers from the Payload 3.90.2 generated-schema fixture (2026-12-04).
1
+ /** SQL identifiers from the Payload 4.0.0-beta.6 generated-schema fixture (2026-12-04).
2
2
  * All main, array, relationship and version tables are included. Access through
3
3
  * these literal keys is checked by TypeScript; names.test.ts checks fixture parity.
4
4
  */ export const TABLES = {
@@ -4,7 +4,7 @@ import type { DocId } from '../types/contracts.js';
4
4
  export declare function pageVersionContent(req: PayloadRequest, collection: string, id: DocId): Promise<(Record<string, unknown> & {
5
5
  id: DocId;
6
6
  }) | null>;
7
- /** Path selection only, after checking access to the page. Version content is not needed. */
7
+ /** Path selection only, after checking access to the page. Payload scopes the version status filter to the given locale. */
8
8
  export declare function hasPublishedPageVersion(req: PayloadRequest, collection: string, id: DocId, locale?: string): Promise<boolean>;
9
9
  /** §7.8: status computes a page's published (or never-published draft) path. */
10
10
  export declare function statusPageContent(req: PayloadRequest, collection: string, id: DocId): Promise<(Record<string, unknown> & {
@@ -12,7 +12,7 @@ import { pagePublicationStatus, publicationLocale, usesLocalizedPublication } fr
12
12
  overrideAccess: true
13
13
  });
14
14
  }
15
- /** Path selection only, after checking access to the page. Version content is not needed. */ export async function hasPublishedPageVersion(req, collection, id, locale) {
15
+ /** Path selection only, after checking access to the page. Payload scopes the version status filter to the given locale. */ export async function hasPublishedPageVersion(req, collection, id, locale) {
16
16
  const published = await req.payload.db.findVersions({
17
17
  collection,
18
18
  req,
@@ -2,7 +2,7 @@ import { flattenTopLevelFields, formatAdminURL } from 'payload/shared';
2
2
  import { placementReader } from '../blocks/placementLocale.js';
3
3
  import { pagePublicationStatus, publicationLocale, usesLocalizedPublication } from '../blocks/placementPublication.js';
4
4
  import { hasPublishedPageVersion } from '../db/pageContent.js';
5
- import { findDraftPageByPath, PAGE_ADDRESS_FIELDS } from '../transitions/pageAddress.js';
5
+ import { findDraftPageByPath, findPublishedPageIds, PAGE_ADDRESS_FIELDS } from '../transitions/pageAddress.js';
6
6
  import { normalisePath } from '../runtime/normalisePath.js';
7
7
  import { blockPageSlugs, hasPuckEditor } from '../options.js';
8
8
  import { XpRefusal } from '../errors.js';
@@ -58,7 +58,9 @@ export async function handlePages(req, { options }) {
58
58
  docs: [],
59
59
  hasNextPage: false
60
60
  });
61
- const published = !drafts || pagePublicationStatus(main, locale) === 'published';
61
+ const published = !drafts || (locale ? Boolean(found && (await findPublishedPageIds(req, slug, [
62
+ main.id
63
+ ], locale)).has(String(main.id))) : pagePublicationStatus(main) === 'published');
62
64
  const useMain = published || Boolean(locale && (!found || await hasPublishedPageVersion(req, slug, main.id, locale)));
63
65
  const row = useMain ? main : await req.payload.findByID({
64
66
  collection: slug,
@@ -101,8 +103,9 @@ export async function handlePages(req, { options }) {
101
103
  ]);
102
104
  const searchable = q ? await Promise.all(fields.map(async (field)=>{
103
105
  if (field.type !== 'text' && field.type !== 'textarea' || field.hidden || field.virtual || !searchFields.has(field.name)) return;
104
- if (field.access?.read && !await field.access.read({
105
- req
106
+ if (config && field.access?.read && !await field.access.read({
107
+ req,
108
+ collection: config
106
109
  })) return;
107
110
  return field.name;
108
111
  })) : [];
@@ -138,7 +141,8 @@ export async function handlePages(req, { options }) {
138
141
  // Payload applies the read constraint to the latest version when draft is
139
142
  // true. A manager scoped to published content needs to browse the live rows.
140
143
  const readScope = drafts ? await config?.access?.read?.({
141
- req
144
+ req,
145
+ slug
142
146
  }) : undefined;
143
147
  const readDrafts = drafts && !(readScope && typeof readScope === 'object' && requiresPublished(readScope));
144
148
  let searchTruncated = false;
@@ -210,6 +214,7 @@ export async function handlePages(req, { options }) {
210
214
  });
211
215
  const localizedPaths = Boolean(locale && collection && !blockMode);
212
216
  const draftIds = readDrafts ? result.docs.filter((doc)=>localizedPaths || pagePublicationStatus(doc, locale) === 'draft').map((doc)=>doc.id) : [];
217
+ const publishedIds = locale ? await findPublishedPageIds(req, slug, result.docs.map((doc)=>doc.id), locale) : undefined;
213
218
  const mainById = new Map();
214
219
  if (draftIds.length) {
215
220
  // Read the matching main rows in one bounded query. Localized drafts can
@@ -236,7 +241,7 @@ export async function handlePages(req, { options }) {
236
241
  }
237
242
  });
238
243
  await Promise.all(live.docs.map(async (doc)=>{
239
- const published = pagePublicationStatus(doc, locale) === 'published';
244
+ const published = publishedIds?.has(String(doc.id)) ?? pagePublicationStatus(doc) === 'published';
240
245
  if (!published && !localizedPaths) return;
241
246
  const usePath = published || await hasPublishedPageVersion(req, slug, doc.id, locale);
242
247
  mainById.set(String(doc.id), {
@@ -251,7 +256,7 @@ export async function handlePages(req, { options }) {
251
256
  const doc = placement.doc;
252
257
  const main = mainById.get(String(row.id));
253
258
  const versionPublished = pagePublicationStatus(row, locale) === 'published';
254
- const published = !drafts || (main?.published ?? versionPublished);
259
+ const published = !drafts || (publishedIds?.has(String(row.id)) ?? main?.published ?? versionPublished);
255
260
  const pathDoc = !blockMode && main?.usePath ? reader.read(main.doc, input).doc : doc;
256
261
  const rawPath = collection?.pathOf(pathDoc) ?? null;
257
262
  const storedAddress = blockMode ? addressFields.reduce((value, field)=>value ?? textValue(pathDoc[field]), undefined) : undefined;
@@ -5,6 +5,7 @@ export function stateGlobal(options) {
5
5
  slug: 'xp-state',
6
6
  dbName: 'xp_state',
7
7
  graphQL: false,
8
+ authorship: false,
8
9
  versions: false,
9
10
  admin: {
10
11
  hidden: true
@@ -12,6 +13,7 @@ export function stateGlobal(options) {
12
13
  access: {
13
14
  read: isTrue(options.access.manage),
14
15
  update: deny,
16
+ validate: deny,
15
17
  readVersions: deny
16
18
  },
17
19
  hooks: {
@@ -95,7 +95,9 @@ function blockLabels(req) {
95
95
  continue;
96
96
  }
97
97
  const reader = placementReader(req, collection.slug, options);
98
- for (const view of reader.documentViews)collect(collection.contentOf(reader.read(doc, 'all-locales', view).doc), byArm.get(arm.key), '', labels);
98
+ for (const view of reader.documentViews){
99
+ if (reader.isPublished(doc, view)) collect(collection.contentOf(reader.read(doc, 'all-locales', view).doc), byArm.get(arm.key), '', labels);
100
+ }
99
101
  readArms.add(arm.key);
100
102
  } catch (error) {
101
103
  failed(error, placement);
@@ -126,6 +128,7 @@ function blockLabels(req) {
126
128
  const raw = await clickGoalContent(req, placement.collection, placement.id);
127
129
  const reader = placementReader(req, placement.collection, options);
128
130
  for (const view of reader.views){
131
+ if (!reader.isPublished(raw, view)) continue;
129
132
  const localized = reader.read(raw, 'all-locales', view);
130
133
  const doc = localized.doc;
131
134
  if (!doc) continue;
@@ -11,7 +11,6 @@ type OperationFrame = PublicationFlags & {
11
11
  restore: boolean;
12
12
  versionId?: DocId;
13
13
  isBulk?: boolean;
14
- publishSpecificLocale?: string;
15
14
  pending?: boolean;
16
15
  scoped?: boolean;
17
16
  complete?: boolean;
@@ -23,8 +22,6 @@ type OperationFrame = PublicationFlags & {
23
22
  publicationWrites?: Map<string, Set<string>>;
24
23
  };
25
24
  export declare const pageGuardOperationScope: AsyncLocalStorage<OperationFrame | undefined>;
26
- /** Both Publish All and Restore can return a locale-projected document. */
27
- export declare function writesAllPublicationLocales(req: PayloadRequest, collection: string): boolean;
28
25
  /** Must be first: buildBeforeOperation invokes its first hook synchronously,
29
26
  * before the operation registers its await continuation. Later host hooks may
30
27
  * await nested operations; those keep separate async contexts. No IO here.
@@ -10,7 +10,7 @@ import { normalisePath } from '../runtime/normalisePath.js';
10
10
  import { XpNoTransactionError, XpRefusal } from '../errors.js';
11
11
  import { placementGuardCopy, pageGuardCopy, READINESS_COPY } from '../testSurface/copy/readiness.js';
12
12
  import { allPlacementSlugs, localizedPlacementAfter, mergedPlacementLocales, placementDocumentPaths, placementReader, selectPlacementLocales } from '../blocks/placementLocale.js';
13
- import { allLocalesStatus, usesLocalizedPublication } from '../blocks/placementPublication.js';
13
+ import { allLocalesStatus, hasPublishedLocale, usesLocalizedPublication } from '../blocks/placementPublication.js';
14
14
  import { isObject } from '../blocks/model.js';
15
15
  import { placementTests, removableBlockTests, appendPlacementDoc } from '../db/placements.js';
16
16
  import { isPageBusy } from '../db/pageBusy.js';
@@ -46,10 +46,6 @@ const operationFrame = (req, slug)=>{
46
46
  }
47
47
  return frame?.scoped && frame.collection === slug && (frame.restore || frame.request === req) ? frame : undefined;
48
48
  };
49
- /** Both Publish All and Restore can return a locale-projected document. */ export function writesAllPublicationLocales(req, collection) {
50
- const call = operationFrame(req, collection);
51
- return Boolean(call && !call.draft && (call.publishAllLocales || call.restore));
52
- }
53
49
  /** Must be first: buildBeforeOperation invokes its first hook synchronously,
54
50
  * before the operation registers its await continuation. Later host hooks may
55
51
  * await nested operations; those keep separate async contexts. No IO here.
@@ -97,7 +93,6 @@ export const pageGuardBeforeOperation = ({ args, operation })=>{
97
93
  restore: operation === 'restoreVersion',
98
94
  versionId: operation === 'restoreVersion' ? call.id : undefined,
99
95
  isBulk,
100
- publishSpecificLocale: call.publishSpecificLocale,
101
96
  publishAllLocales: call.publishAllLocales,
102
97
  unpublishAllLocales: call.unpublishAllLocales,
103
98
  duplicateFromID: call.duplicateFromID,
@@ -245,7 +240,7 @@ export const pageGuardBeforeDelete = async ({ req, id, collection })=>{
245
240
  const localized = usesLocalizedPublication(req, collection.slug, collection);
246
241
  const published = page && !localized ? await previousPublishedContent(req, collection.slug, id) : await storedContent(req, collection.slug, id);
247
242
  if (!published || published._status === 'draft') return;
248
- if (localized && (!isObject(published._status) || !Object.values(published._status).includes('published'))) return;
243
+ if (localized && !hasPublishedLocale(published)) return;
249
244
  const paths = sortLockKeys(documentPathsOf(req, collection.slug, [
250
245
  published
251
246
  ]).map(normalisePath));
@@ -274,6 +269,7 @@ export const pageGuardBeforeDelete = async ({ req, id, collection })=>{
274
269
  }
275
270
  };
276
271
  export const pageGuardBeforeChange = async ({ req, collection, originalDoc, operation, data })=>{
272
+ // Payload 4 runs beforeChange for read-only validation. Guard actual writes only.
277
273
  if (operation !== 'create' && operation !== 'update') return data;
278
274
  const drafts = Boolean(collection.versions && collection.versions.drafts);
279
275
  const call = operationFrame(req, collection.slug);
@@ -297,7 +293,6 @@ export const pageGuardBeforeChange = async ({ req, collection, originalDoc, oper
297
293
  versionId: call?.versionId,
298
294
  bulk: call?.isBulk,
299
295
  draft: call?.draft,
300
- publishSpecificLocale: call?.publishSpecificLocale,
301
296
  trashing: Boolean(collection.trash && data.deletedAt != null)
302
297
  });
303
298
  const before = published?._status === 'draft' ? undefined : published;
@@ -381,10 +376,17 @@ async function guardLocalizedSave(req, collection, originalDoc, operation, data,
381
376
  if (!localization) return data;
382
377
  try {
383
378
  const status = allLocalesStatus(req, call, data._status, operation);
384
- const locales = status && localization.filterAvailableLocales ? (await localization.filterAvailableLocales({
385
- locales: localization.locales,
386
- req
387
- })).map((entry)=>typeof entry === 'string' ? entry : entry.code) : localization.localeCodes;
379
+ let locales = localization.localeCodes;
380
+ if (status && localization.filterAvailableLocales) {
381
+ const available = await localization.filterAvailableLocales({
382
+ locales: localization.locales,
383
+ req
384
+ });
385
+ locales = available.map((entry)=>typeof entry === 'string' ? entry : entry.code);
386
+ // Payload writes the request locale before applying the all-locales flag
387
+ // to the available list.
388
+ if (req.locale && localization.localeCodes.includes(req.locale) && !locales.includes(req.locale)) locales.push(req.locale);
389
+ }
388
390
  const all = status ? {
389
391
  status,
390
392
  locales
@@ -0,0 +1,8 @@
1
+ import { createPayloadRequest, type Block, type Field, type Payload } from 'payload';
2
+ /** Payload 3 createLocalReq(options, payload) -> Payload 4 createPayloadRequest({ ...options, payload }).
3
+ * Differs from 3.90 for `user: null` with a user on `options.req`: 4.0 runs anonymous, 3.90 kept the req's user. */
4
+ export declare function createLocalReq(options: Omit<Parameters<typeof createPayloadRequest>[0], 'payload'>, payload: Payload): Promise<import("payload").PayloadRequest>;
5
+ /** Payload 3 blockReferences + inline blocks -> Payload 4 blocks with inline definitions or slug references. */
6
+ export declare function resolveContentBlocks(field: Extract<Field, {
7
+ type: 'blocks';
8
+ }>, blocks?: Block[]): Block[];
@@ -0,0 +1,16 @@
1
+ import { createPayloadRequest } from 'payload';
2
+ /** Payload 3 createLocalReq(options, payload) -> Payload 4 createPayloadRequest({ ...options, payload }).
3
+ * Differs from 3.90 for `user: null` with a user on `options.req`: 4.0 runs anonymous, 3.90 kept the req's user. */ export function createLocalReq(options, payload) {
4
+ return createPayloadRequest({
5
+ ...options,
6
+ payload
7
+ });
8
+ }
9
+ /** Payload 3 blockReferences + inline blocks -> Payload 4 blocks with inline definitions or slug references. */ export function resolveContentBlocks(field, blocks = []) {
10
+ return field.blocks.map((reference)=>{
11
+ if (typeof reference !== 'string') return reference;
12
+ const block = blocks.find((block)=>block.slug === reference);
13
+ if (!block) throw new Error('This page has an unavailable block; update it by hand.');
14
+ return block;
15
+ });
16
+ }
@@ -1,23 +1,23 @@
1
- /* generated — do not edit. Run pnpm generate:editor-css. Reference: Payload 3.90.2. */
1
+ /* generated — do not edit. Run pnpm generate:editor-css. Reference: Payload 4.0.0-beta.6. */
2
2
  .xp-slot-root {
3
- --xp-bg: rgb(245, 245, 245);
4
- --xp-surface: rgb(255, 255, 255);
5
- --xp-surface-2: rgb(235, 235, 235);
6
- --xp-surface-3: rgb(221, 221, 221);
7
- --xp-border: rgb(235, 235, 235);
8
- --xp-border-strong: rgb(195, 195, 195);
9
- --xp-text: rgb(34, 34, 34);
10
- --xp-text-2: rgb(87, 87, 87);
11
- --xp-text-3: rgb(141, 141, 141);
12
- --xp-accent: rgb(47, 47, 47);
13
- --xp-accent-hover: rgb(20, 20, 20);
14
- --xp-accent-active: rgb(7, 7, 7);
15
- --xp-accent-subtle: rgb(208, 208, 208);
16
- --xp-accent-fg: rgb(255, 255, 255);
17
- --xp-accent-text: rgb(34, 34, 34);
3
+ --xp-bg: #f5f5f5;
4
+ --xp-surface: #ffffff;
5
+ --xp-surface-2: #e6e6e6;
6
+ --xp-surface-3: #d9d9d9;
7
+ --xp-border: #e6e6e6;
8
+ --xp-border-strong: rgb(204, 204, 204);
9
+ --xp-text: rgb(26, 26, 26);
10
+ --xp-text-2: #595959;
11
+ --xp-text-3: rgb(128, 128, 128);
12
+ --xp-accent: #2c2c2c;
13
+ --xp-accent-hover: #383838;
14
+ --xp-accent-active: #444444;
15
+ --xp-accent-subtle: #d0d0d0;
16
+ --xp-accent-fg: rgb(234, 234, 234);
17
+ --xp-accent-text: rgb(26, 26, 26);
18
18
  --xp-accent-text-decoration: none;
19
- --xp-focus: rgb(47, 47, 47);
20
- --xp-series-muted: rgb(181, 181, 181);
19
+ --xp-focus: #2c2c2c;
20
+ --xp-series-muted: rgb(179, 179, 179);
21
21
  --xp-success: #1a6a3a;
22
22
  --xp-success-bg: #e8f4ec;
23
23
  --xp-success-border: #bddfc9;
@@ -33,12 +33,12 @@
33
33
  --xp-radius-control: 8px;
34
34
  --xp-radius-card: 12px;
35
35
  --xp-radius-chip: 6px;
36
- --xp-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
37
- --xp-mono: 'SF Mono', Menlo, Consolas, Monaco, monospace;
38
- --xp-text-display: 600 28px/32px -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
39
- --xp-text-title: 600 20px/28px -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
40
- --xp-text-body: 400 15px/22px -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
41
- --xp-text-small: 400 13px/18px -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
36
+ --xp-font: 'Inter', sans-serif;
37
+ --xp-mono: 'Roboto Mono', 'SF Mono', Menlo, Consolas, Monaco, monospace;
38
+ --xp-text-display: 600 28px/32px 'Inter', sans-serif;
39
+ --xp-text-title: 600 20px/28px 'Inter', sans-serif;
40
+ --xp-text-body: 400 15px/22px 'Inter', sans-serif;
41
+ --xp-text-small: 400 13px/18px 'Inter', sans-serif;
42
42
  --xp-motion: 120ms;
43
43
  --xp-space-half: 2px;
44
44
  --xp-space-one-half: 6px;
@@ -55,19 +55,19 @@
55
55
  --xp-space-3: 12px;
56
56
  --xp-space-4: 16px;
57
57
  --xp-space-5: 20px;
58
- --xp-field-gap: calc((20 / 13) * 1rem);
58
+ --xp-field-gap: 1.5rem;
59
59
  --xp-space-6: 24px;
60
60
  --xp-space-7: 28px;
61
61
  --xp-space-8: 32px;
62
- --xp-surface-raised: rgb(235, 235, 235);
63
- --xp-border-control: rgb(195, 195, 195);
64
- --xp-input-border: rgb(181, 181, 181);
65
- --xp-border-accent: rgb(154, 154, 154);
66
- --xp-text-muted: rgb(87, 87, 87);
67
- --xp-text-strong: rgb(34, 34, 34);
68
- --xp-text-emphasis: rgb(34, 34, 34);
69
- --xp-input-bg: rgb(255, 255, 255);
70
- --xp-overlay: rgba(5, 5, 5, 0.5);
62
+ --xp-surface-raised: #e6e6e6;
63
+ --xp-border-control: rgb(204, 204, 204);
64
+ --xp-input-border: rgb(179, 179, 179);
65
+ --xp-border-accent: rgb(128, 128, 128);
66
+ --xp-text-muted: #595959;
67
+ --xp-text-strong: rgb(26, 26, 26);
68
+ --xp-text-emphasis: rgb(26, 26, 26);
69
+ --xp-input-bg: #ffffff;
70
+ --xp-overlay: rgba(0, 0, 0, 0.5);
71
71
  --xp-success-surface: #e8f4ec;
72
72
  --xp-success-text: #1a6a3a;
73
73
  --xp-success-text-strong: #1a6a3a;
@@ -78,31 +78,31 @@
78
78
  --xp-error-text: #a63030;
79
79
  --xp-radius: 8px;
80
80
  --xp-radius-large: 12px;
81
- --xp-font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
81
+ --xp-font-body: 'Inter', sans-serif;
82
82
  --xp-font-size-small: 13px;
83
83
  --xp-font-size-body: 15px;
84
84
  }
85
85
 
86
86
  [data-theme='dark'] .xp-slot-root,
87
87
  .dark .xp-slot-root {
88
- --xp-bg: rgb(20, 20, 20);
89
- --xp-surface: rgb(34, 34, 34);
90
- --xp-surface-2: rgb(47, 47, 47);
91
- --xp-surface-3: rgb(60, 60, 60);
92
- --xp-border: rgb(47, 47, 47);
93
- --xp-border-strong: rgb(74, 74, 74);
94
- --xp-text: rgb(235, 235, 235);
95
- --xp-text-2: rgb(168, 168, 168);
96
- --xp-text-3: rgb(114, 114, 114);
97
- --xp-accent: rgb(235, 235, 235);
98
- --xp-accent-hover: rgb(255, 255, 255);
99
- --xp-accent-active: rgb(255, 255, 255);
100
- --xp-accent-subtle: rgb(74, 74, 74);
101
- --xp-accent-fg: rgb(20, 20, 20);
102
- --xp-accent-text: rgb(235, 235, 235);
88
+ --xp-bg: #1e1e1e;
89
+ --xp-surface: #2c2c2c;
90
+ --xp-surface-2: #383838;
91
+ --xp-surface-3: #444444;
92
+ --xp-border: #444444;
93
+ --xp-border-strong: rgb(86, 86, 86);
94
+ --xp-text: #ffffff;
95
+ --xp-text-2: rgb(192, 192, 192);
96
+ --xp-text-3: rgb(128, 128, 128);
97
+ --xp-accent: #ffffff;
98
+ --xp-accent-hover: #f5f5f5;
99
+ --xp-accent-active: #e6e6e6;
100
+ --xp-accent-subtle: #4f4f4f;
101
+ --xp-accent-fg: rgb(26, 26, 26);
102
+ --xp-accent-text: #ffffff;
103
103
  --xp-accent-text-decoration: none;
104
- --xp-focus: rgb(235, 235, 235);
105
- --xp-series-muted: rgb(87, 87, 87);
104
+ --xp-focus: #ffffff;
105
+ --xp-series-muted: rgb(86, 86, 86);
106
106
  --xp-success: #7fd49c;
107
107
  --xp-success-bg: #142b1d;
108
108
  --xp-success-border: #23492f;
@@ -118,12 +118,12 @@
118
118
  --xp-radius-control: 8px;
119
119
  --xp-radius-card: 12px;
120
120
  --xp-radius-chip: 6px;
121
- --xp-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
122
- --xp-mono: 'SF Mono', Menlo, Consolas, Monaco, monospace;
123
- --xp-text-display: 600 28px/32px -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
124
- --xp-text-title: 600 20px/28px -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
125
- --xp-text-body: 400 15px/22px -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
126
- --xp-text-small: 400 13px/18px -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
121
+ --xp-font: 'Inter', sans-serif;
122
+ --xp-mono: 'Roboto Mono', 'SF Mono', Menlo, Consolas, Monaco, monospace;
123
+ --xp-text-display: 600 28px/32px 'Inter', sans-serif;
124
+ --xp-text-title: 600 20px/28px 'Inter', sans-serif;
125
+ --xp-text-body: 400 15px/22px 'Inter', sans-serif;
126
+ --xp-text-small: 400 13px/18px 'Inter', sans-serif;
127
127
  --xp-motion: 120ms;
128
128
  --xp-space-half: 2px;
129
129
  --xp-space-one-half: 6px;
@@ -140,19 +140,19 @@
140
140
  --xp-space-3: 12px;
141
141
  --xp-space-4: 16px;
142
142
  --xp-space-5: 20px;
143
- --xp-field-gap: calc((20 / 13) * 1rem);
143
+ --xp-field-gap: 1.5rem;
144
144
  --xp-space-6: 24px;
145
145
  --xp-space-7: 28px;
146
146
  --xp-space-8: 32px;
147
- --xp-surface-raised: rgb(47, 47, 47);
148
- --xp-border-control: rgb(87, 87, 87);
149
- --xp-input-border: rgb(101, 101, 101);
150
- --xp-border-accent: rgb(141, 141, 141);
151
- --xp-text-muted: rgb(168, 168, 168);
152
- --xp-text-strong: rgb(235, 235, 235);
153
- --xp-text-emphasis: rgb(235, 235, 235);
154
- --xp-input-bg: rgb(34, 34, 34);
155
- --xp-overlay: rgba(5, 5, 5, 0.75);
147
+ --xp-surface-raised: #383838;
148
+ --xp-border-control: rgb(86, 86, 86);
149
+ --xp-input-border: rgb(86, 86, 86);
150
+ --xp-border-accent: rgb(128, 128, 128);
151
+ --xp-text-muted: rgb(192, 192, 192);
152
+ --xp-text-strong: #ffffff;
153
+ --xp-text-emphasis: #ffffff;
154
+ --xp-input-bg: #2c2c2c;
155
+ --xp-overlay: rgba(0, 0, 0, 0.5);
156
156
  --xp-success-surface: #142b1d;
157
157
  --xp-success-text: #7fd49c;
158
158
  --xp-success-text-strong: #7fd49c;
@@ -163,30 +163,30 @@
163
163
  --xp-error-text: #f09494;
164
164
  --xp-radius: 8px;
165
165
  --xp-radius-large: 12px;
166
- --xp-font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
166
+ --xp-font-body: 'Inter', sans-serif;
167
167
  --xp-font-size-small: 13px;
168
168
  --xp-font-size-body: 15px;
169
169
  }
170
170
 
171
171
  [class*="_PuckFields"] .xp-slot-root {
172
- --xp-bg: rgb(245, 245, 245);
173
- --xp-surface: rgb(255, 255, 255);
174
- --xp-surface-2: rgb(235, 235, 235);
175
- --xp-surface-3: rgb(221, 221, 221);
176
- --xp-border: rgb(235, 235, 235);
177
- --xp-border-strong: rgb(195, 195, 195);
178
- --xp-text: rgb(34, 34, 34);
179
- --xp-text-2: rgb(87, 87, 87);
180
- --xp-text-3: rgb(141, 141, 141);
181
- --xp-accent: rgb(47, 47, 47);
182
- --xp-accent-hover: rgb(20, 20, 20);
183
- --xp-accent-active: rgb(7, 7, 7);
184
- --xp-accent-subtle: rgb(208, 208, 208);
185
- --xp-accent-fg: rgb(255, 255, 255);
186
- --xp-accent-text: rgb(34, 34, 34);
172
+ --xp-bg: #f5f5f5;
173
+ --xp-surface: #ffffff;
174
+ --xp-surface-2: #e6e6e6;
175
+ --xp-surface-3: #d9d9d9;
176
+ --xp-border: #e6e6e6;
177
+ --xp-border-strong: rgb(204, 204, 204);
178
+ --xp-text: rgb(26, 26, 26);
179
+ --xp-text-2: #595959;
180
+ --xp-text-3: rgb(128, 128, 128);
181
+ --xp-accent: #2c2c2c;
182
+ --xp-accent-hover: #383838;
183
+ --xp-accent-active: #444444;
184
+ --xp-accent-subtle: #d0d0d0;
185
+ --xp-accent-fg: rgb(234, 234, 234);
186
+ --xp-accent-text: rgb(26, 26, 26);
187
187
  --xp-accent-text-decoration: none;
188
- --xp-focus: rgb(47, 47, 47);
189
- --xp-series-muted: rgb(181, 181, 181);
188
+ --xp-focus: #2c2c2c;
189
+ --xp-series-muted: rgb(179, 179, 179);
190
190
  --xp-success: #1a6a3a;
191
191
  --xp-success-bg: #e8f4ec;
192
192
  --xp-success-border: #bddfc9;
@@ -202,12 +202,12 @@
202
202
  --xp-radius-control: 8px;
203
203
  --xp-radius-card: 12px;
204
204
  --xp-radius-chip: 6px;
205
- --xp-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
206
- --xp-mono: 'SF Mono', Menlo, Consolas, Monaco, monospace;
207
- --xp-text-display: 600 28px/32px -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
208
- --xp-text-title: 600 20px/28px -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
209
- --xp-text-body: 400 15px/22px -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
210
- --xp-text-small: 400 13px/18px -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
205
+ --xp-font: 'Inter', sans-serif;
206
+ --xp-mono: 'Roboto Mono', 'SF Mono', Menlo, Consolas, Monaco, monospace;
207
+ --xp-text-display: 600 28px/32px 'Inter', sans-serif;
208
+ --xp-text-title: 600 20px/28px 'Inter', sans-serif;
209
+ --xp-text-body: 400 15px/22px 'Inter', sans-serif;
210
+ --xp-text-small: 400 13px/18px 'Inter', sans-serif;
211
211
  --xp-motion: 120ms;
212
212
  --xp-space-half: 2px;
213
213
  --xp-space-one-half: 6px;
@@ -224,19 +224,19 @@
224
224
  --xp-space-3: 12px;
225
225
  --xp-space-4: 16px;
226
226
  --xp-space-5: 20px;
227
- --xp-field-gap: calc((20 / 13) * 1rem);
227
+ --xp-field-gap: 1.5rem;
228
228
  --xp-space-6: 24px;
229
229
  --xp-space-7: 28px;
230
230
  --xp-space-8: 32px;
231
- --xp-surface-raised: rgb(235, 235, 235);
232
- --xp-border-control: rgb(195, 195, 195);
233
- --xp-input-border: rgb(181, 181, 181);
234
- --xp-border-accent: rgb(154, 154, 154);
235
- --xp-text-muted: rgb(87, 87, 87);
236
- --xp-text-strong: rgb(34, 34, 34);
237
- --xp-text-emphasis: rgb(34, 34, 34);
238
- --xp-input-bg: rgb(255, 255, 255);
239
- --xp-overlay: rgba(5, 5, 5, 0.5);
231
+ --xp-surface-raised: #e6e6e6;
232
+ --xp-border-control: rgb(204, 204, 204);
233
+ --xp-input-border: rgb(179, 179, 179);
234
+ --xp-border-accent: rgb(128, 128, 128);
235
+ --xp-text-muted: #595959;
236
+ --xp-text-strong: rgb(26, 26, 26);
237
+ --xp-text-emphasis: rgb(26, 26, 26);
238
+ --xp-input-bg: #ffffff;
239
+ --xp-overlay: rgba(0, 0, 0, 0.5);
240
240
  --xp-success-surface: #e8f4ec;
241
241
  --xp-success-text: #1a6a3a;
242
242
  --xp-success-text-strong: #1a6a3a;
@@ -247,7 +247,7 @@
247
247
  --xp-error-text: #a63030;
248
248
  --xp-radius: 8px;
249
249
  --xp-radius-large: 12px;
250
- --xp-font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
250
+ --xp-font-body: 'Inter', sans-serif;
251
251
  --xp-font-size-small: 13px;
252
252
  --xp-font-size-body: 15px;
253
253
  }
@@ -6,7 +6,6 @@
6
6
  id: token.e,
7
7
  depth: 0,
8
8
  overrideAccess: false,
9
- user,
10
9
  req: {
11
10
  user: user,
12
11
  headers
@@ -1,6 +1,6 @@
1
1
  import type { CollectionAfterChangeHook, CollectionBeforeChangeHook } from 'payload';
2
2
  /** Paired raw beforeChange capture: previousDoc may be an autosaved draft. */
3
- export declare function capturePublishedContent({ req, collection, originalDoc, operation, data }: Parameters<CollectionBeforeChangeHook>[0]): Promise<void>;
3
+ export declare function capturePublishedContent({ req, collection, originalDoc, operation }: Parameters<CollectionBeforeChangeHook>[0]): Promise<void>;
4
4
  type ContentChangeArgs = Pick<Parameters<CollectionAfterChangeHook>[0], 'doc' | 'previousDoc' | 'req' | 'collection'>;
5
5
  /** Publish-only host helper. Audit failures are logged after savepoint recovery. */
6
6
  export declare function recordContentChange(args: ContentChangeArgs): Promise<void>;