payload-live-preview 2.1.2 → 2.2.1

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 (89) hide show
  1. package/README.md +191 -62
  2. package/dist/adapters/astro/index.d.ts +7 -7
  3. package/dist/adapters/astro/index.js +1 -1
  4. package/dist/adapters/astro/index.js.map +1 -1
  5. package/dist/adapters/astro/middleware-entry.d.ts +3 -3
  6. package/dist/adapters/astro/middleware-entry.js +1 -1
  7. package/dist/adapters/astro/middleware-entry.js.map +1 -1
  8. package/dist/adapters/nextjs/index.d.ts +2 -2
  9. package/dist/adapters/nextjs/index.js +1 -1
  10. package/dist/adapters/nextjs/index.js.map +1 -1
  11. package/dist/adapters/nuxt/index.d.ts +4 -4
  12. package/dist/adapters/nuxt/index.js +1 -1
  13. package/dist/adapters/nuxt/index.js.map +1 -1
  14. package/dist/adapters/nuxt/module.d.ts +1 -1
  15. package/dist/adapters/react/index.d.ts +2 -2
  16. package/dist/adapters/react/index.js +1 -1
  17. package/dist/adapters/react/index.js.map +1 -1
  18. package/dist/adapters/sveltekit/index.d.ts +5 -5
  19. package/dist/adapters/sveltekit/index.js +1 -1
  20. package/dist/adapters/sveltekit/index.js.map +1 -1
  21. package/dist/adapters/vue/index.d.ts +2 -2
  22. package/dist/adapters/vue/index.js +1 -1
  23. package/dist/adapters/vue/index.js.map +1 -1
  24. package/dist/annotate.d.ts +22 -15
  25. package/dist/annotate.js +1 -1
  26. package/dist/annotate.js.map +1 -1
  27. package/dist/client.cjs +1 -1
  28. package/dist/client.cjs.map +1 -1
  29. package/dist/client.d.cts +114 -114
  30. package/dist/client.d.ts +114 -114
  31. package/dist/client.js +1 -1
  32. package/dist/client.js.map +1 -1
  33. package/dist/codegen-cli.js +1 -1
  34. package/dist/codegen-cli.js.map +1 -1
  35. package/dist/codegen.cjs +1 -1
  36. package/dist/codegen.cjs.map +1 -1
  37. package/dist/codegen.d.cts +14 -16
  38. package/dist/codegen.d.ts +14 -16
  39. package/dist/codegen.js +1 -1
  40. package/dist/codegen.js.map +1 -1
  41. package/dist/core.cjs +1 -1
  42. package/dist/core.cjs.map +1 -1
  43. package/dist/core.d.cts +178 -172
  44. package/dist/core.d.ts +178 -172
  45. package/dist/core.js +1 -1
  46. package/dist/core.js.map +1 -1
  47. package/dist/doctor-cli.d.ts +1 -1
  48. package/dist/doctor-cli.js +1 -1
  49. package/dist/doctor-cli.js.map +1 -1
  50. package/dist/doctor.d.ts +15 -2
  51. package/dist/doctor.js +1 -1
  52. package/dist/doctor.js.map +1 -1
  53. package/dist/{document-session-DWi9H3Qk.d.ts → document-session-Bkd181PV.d.ts} +3 -2
  54. package/dist/{fragment-endpoint-B2qcRw5T.d.ts → fragment-endpoint-DGGLIijM.d.ts} +1 -1
  55. package/dist/fragment.cjs.map +1 -1
  56. package/dist/fragment.d.cts +3 -3
  57. package/dist/fragment.d.ts +3 -3
  58. package/dist/fragment.js.map +1 -1
  59. package/dist/index.cjs +1 -1
  60. package/dist/index.cjs.map +1 -1
  61. package/dist/index.d.cts +183 -177
  62. package/dist/index.d.ts +183 -177
  63. package/dist/index.js +1 -1
  64. package/dist/index.js.map +1 -1
  65. package/dist/lean.cjs +1 -1
  66. package/dist/lean.cjs.map +1 -1
  67. package/dist/lean.js +1 -1
  68. package/dist/lean.js.map +1 -1
  69. package/dist/lexical.cjs +1 -1
  70. package/dist/lexical.cjs.map +1 -1
  71. package/dist/lexical.js +1 -1
  72. package/dist/lexical.js.map +1 -1
  73. package/dist/{locals-B1mF3aTb.d.ts → locals-zz2gi9dj.d.ts} +1 -1
  74. package/dist/{middleware-BGobLN9P.d.ts → middleware-CI-UTf6R.d.ts} +2 -2
  75. package/dist/{options-Cm8fC7dj.d.ts → options-CnYybG51.d.ts} +8 -0
  76. package/dist/plugins.cjs +1 -1
  77. package/dist/plugins.cjs.map +1 -1
  78. package/dist/plugins.d.cts +3 -3
  79. package/dist/plugins.d.ts +3 -3
  80. package/dist/plugins.js +1 -1
  81. package/dist/plugins.js.map +1 -1
  82. package/dist/{probe-DGPDsnbj.d.ts → probe-D-IHg9dF.d.ts} +3 -3
  83. package/dist/structural.cjs +2 -2
  84. package/dist/structural.cjs.map +1 -1
  85. package/dist/structural.d.cts +27 -27
  86. package/dist/structural.d.ts +27 -27
  87. package/dist/structural.js +2 -2
  88. package/dist/structural.js.map +1 -1
  89. package/package.json +11 -6
package/dist/index.d.ts CHANGED
@@ -91,11 +91,11 @@ declare const DIAGNOSTIC_CODES: Readonly<{
91
91
  readonly AuditFrameOptionsBlocks: "LP0703";
92
92
  /** Binding attributes are served to anonymous visitors. */
93
93
  readonly AuditBindingsExposed: "LP0704";
94
- /** More bindings than the default visibility gate will write eagerly. */
94
+ /** More bindings than the visibility gate will write eagerly. */
95
95
  readonly AuditGateThresholdExceeded: "LP0705";
96
96
  /** Owner markers exist, but some bindings are outside all of them. */
97
97
  readonly AuditUnownedBindings: "LP0706";
98
- /** The preview response carries no bindings at all. */
98
+ /** The preview response carries no bindings and no fragment boundary. */
99
99
  readonly AuditNoBindings: "LP0707";
100
100
  /** The URL did not return an HTML page, so nothing else can be judged. */
101
101
  readonly AuditNotAPage: "LP0708";
@@ -113,7 +113,7 @@ declare const DIAGNOSTIC_CODES: Readonly<{
113
113
  readonly FragmentStrategyUnavailable: "LP0806";
114
114
  /** A revision changed a field with no binding; `onUnfaithfulPatch` refreshed the route. */
115
115
  readonly UnboundChangeRefresh: "LP0807";
116
- /** `onUnfaithfulPatch: 'escalate'` found no route or fragment strategy to hand an unfaithful patch to; the page keeps it. */
116
+ /** `onUnfaithfulPatch: 'escalate'` found no route or fragment strategy, or no boundary, to hand an unfaithful patch to; the page keeps it. */
117
117
  readonly EscalationUnavailable: "LP0808";
118
118
  /** A fragment inserted an Astro island the page cannot start: it never loaded the island element or that client directive. */
119
119
  readonly IslandStartUnavailable: "LP0809";
@@ -190,6 +190,177 @@ type PayloadFieldType = 'text' | 'textarea' | 'richText' | 'email' | 'number' |
190
190
  /** `admin.condition` is a function in source and cannot cross `postMessage`; modelled, not consumed. */
191
191
  type PayloadFieldCondition = (data: unknown, siblingData: unknown) => boolean;
192
192
 
193
+ /**
194
+ * `'strict'` (default) strips `id`, `name` and `data-payload-*` and passes
195
+ * other `data-*` only via `allowedDataAttributes`; `'compat'` keeps them.
196
+ */
197
+ type SanitizerPolicyMode = 'compat' | 'strict';
198
+ interface SanitizeOptions {
199
+ /** Overrides the module default set by `setSanitizerPolicy()`. */
200
+ readonly policy?: SanitizerPolicyMode;
201
+ /** `data-*` attributes (full names) that pass under `'strict'`; `data-payload-*` never does. */
202
+ readonly allowedDataAttributes?: readonly string[];
203
+ /**
204
+ * Keep `input`, `button`, `textarea`, `select`, `option` and `label` — only
205
+ * for markup the page author wrote, never for CMS content. `form`,
206
+ * handlers, `style` and unsafe URLs stay dropped.
207
+ */
208
+ readonly allowFormControls?: boolean;
209
+ /** Extra tags to allow. Lower-case, untrimmed. */
210
+ readonly additionalAllowedTags?: readonly string[];
211
+ /**
212
+ * Extra per-tag attributes, lower-case. Cannot re-admit handlers, `style`,
213
+ * or — under `'strict'` — `id`, `name` and `data-payload-*`.
214
+ */
215
+ readonly additionalAllowedAttributes?: Readonly<Record<string, readonly string[]>>;
216
+ /**
217
+ * The input is a page-author item template, so `'strict'` keeps the
218
+ * applier's reconciliation attributes (`TEMPLATE_ATTRIBUTES`) and nothing
219
+ * else — every other `data-payload-*` is still stripped, so a template can
220
+ * never add a binding.
221
+ */
222
+ readonly templateMode?: boolean;
223
+ /**
224
+ * The DOM to parse with, for this call: an SSR document such as linkedom's
225
+ * or jsdom's. Wins over `setSanitizerDocument()` and over the global
226
+ * `document`, and two callers with two documents never share one.
227
+ */
228
+ readonly document?: SanitizerDocument;
229
+ }
230
+ /**
231
+ * The default for calls without an explicit `policy`, per package entry. A
232
+ * runtime carries its own `sanitizerPolicy` and never writes here (ADR 0002).
233
+ */
234
+ declare function setSanitizerPolicy(mode: SanitizerPolicyMode): void;
235
+ /** The `Document` surface the sanitizer needs; jsdom, linkedom and happy-dom all provide it. */
236
+ interface SanitizerDocument {
237
+ createElement: (tagName: string) => {
238
+ innerHTML: string;
239
+ readonly content: ParentNode;
240
+ };
241
+ }
242
+ /**
243
+ * Supply a `Document` for SSR, e.g. linkedom's `parseHTML(...).document`;
244
+ * `null` clears it, for every entry. The fallback for a call that names no
245
+ * document of its own.
246
+ *
247
+ * @deprecated Since 2.1 a call names its document: `sanitizeHtml(html, { document })`,
248
+ * `lexicalToHtml(content, { document })`. The process-wide slot stays until 3.0
249
+ * (ADR 0007 ledger).
250
+ */
251
+ declare function setSanitizerDocument(doc: SanitizerDocument | null): void;
252
+ /**
253
+ * Sanitize `html`; malformed input is recovered by the parser first. The
254
+ * result is a fixed point: sanitising it again changes nothing.
255
+ *
256
+ * @throws {SanitizerEnvironmentError} when no DOM is available.
257
+ */
258
+ declare function sanitizeHtml(html: string, options?: SanitizeOptions): string;
259
+
260
+ /** Types shared by the runtime primitives. */
261
+
262
+ /** Payload's field set plus the DOM-binding categories `html`, `url`, `image` and `structural-array`. */
263
+ type FieldType = PayloadFieldType | 'html' | 'url' | 'image' | 'structural-array';
264
+ /** A namespaced project renderer key, so a typo of a built-in type can never become one. */
265
+ type CustomRendererKey = `${string}:${string}`;
266
+ /** What a renderer may be registered under and an element may ask for. */
267
+ type RendererKey = FieldType | CustomRendererKey;
268
+ /**
269
+ * A project rich-text renderer, shared by SSR and preview. Its output goes
270
+ * through the sanitizer; call the same `sanitizeHtml()` server-side for byte equality.
271
+ */
272
+ type RichTextRenderer = (value: unknown, context: {
273
+ readonly fieldName: string;
274
+ readonly element: Element;
275
+ readonly locale: string | undefined;
276
+ }) => string;
277
+ /** One registered binding. Several may share a field name when it renders in several places. */
278
+ interface CachedElement {
279
+ /** The bound DOM element. */
280
+ readonly element: Element;
281
+ /** Payload field path, e.g., `title` or `hero.subtitle`. */
282
+ readonly fieldName: string;
283
+ /** Resolved from attributes and tag heuristics; the schema may override it unless explicit. */
284
+ readonly fieldType: RendererKey;
285
+ /** Whether `data-payload-type` set the type, in which case the schema must not override it. */
286
+ readonly explicitFieldType?: boolean;
287
+ /** Fields this binding depends on (`data-payload-depends`); a change in any re-applies it under `skipUnchanged`. */
288
+ readonly dependsOn?: readonly string[];
289
+ /** Raw `data-payload-strategy` value. */
290
+ readonly strategy?: string;
291
+ /** How the runtime brings this binding up to date; `'unknown'` for an unrecognised strategy. Resolved by the cache. */
292
+ readonly strategyKind?: UpdateSource | 'unknown';
293
+ /** Nearest enclosing `data-payload-fragment` boundary. Resolved by the cache. */
294
+ readonly fragmentBoundary?: Element;
295
+ /** `data-payload-boundary`: an anchor that hides itself while its field is empty. */
296
+ readonly hidesWhenEmpty?: boolean;
297
+ /** Write the value into this attribute instead of the content; policed writes. */
298
+ readonly targetAttribute?: string;
299
+ /** Optional sibling-field path bound to the element's `href` attribute. */
300
+ readonly hrefField?: string;
301
+ /** Optional sibling-field path bound to the element's `src` attribute. */
302
+ readonly srcField?: string;
303
+ /** Optional sibling-field path bound to the element's `alt` attribute. */
304
+ readonly altField?: string;
305
+ /** Optional inline template for array/blocks rendering. */
306
+ readonly arrayTemplate?: string;
307
+ /** Optional separator for primitive-array stringification. */
308
+ readonly arraySeparator?: string;
309
+ /** Optional locale code locked onto this element (overrides the global locale). */
310
+ readonly locale?: string;
311
+ /** Raw `data-payload-format`; the date and number renderers read the vocabulary. */
312
+ readonly format?: string;
313
+ /** The document this binding belongs to, from the nearest `data-payload-owner`. */
314
+ readonly owner?: string;
315
+ /**
316
+ * The value an auto-binding matched on (`data-payload-guessed`), for a
317
+ * binding the runtime found by value rather than one the template declared.
318
+ * Absent for a declared binding.
319
+ */
320
+ readonly guessed?: string;
321
+ }
322
+ /** What a renderer is given; `allFields` lets it resolve a sibling field. */
323
+ interface RenderContext {
324
+ /** Full field map for the current update — used for sibling lookups. */
325
+ readonly allFields: Record<string, unknown>;
326
+ /** Active locale, or `undefined` when none is established. */
327
+ readonly locale: string | undefined;
328
+ /** Optional schema descriptor for the field, when available. */
329
+ readonly schema: PayloadFieldSchema | undefined;
330
+ /** The project's rich-text renderer, when the client was configured with one. */
331
+ readonly renderRichText?: RichTextRenderer;
332
+ /**
333
+ * The Payload server the runtime reads populated documents from (`serverURL`),
334
+ * absent without one. A renderer that writes a URL out of a media document
335
+ * resolves a path against it, as Payload's admin does; the built-in `upload`
336
+ * and `image` renderers do.
337
+ */
338
+ readonly serverURL?: string;
339
+ /**
340
+ * This instance's sanitizer policy, for every HTML write the renderer makes.
341
+ * Absent, the process default set by `setSanitizerPolicy()` applies.
342
+ */
343
+ readonly sanitizerPolicy?: SanitizerPolicyMode;
344
+ /**
345
+ * Say that this write cannot reproduce what the server drew, so
346
+ * `onUnfaithfulPatch` can have a strategy render the region instead of
347
+ * leaving a degraded patch on the page. The built-in rich-text renderer
348
+ * calls it for a Lexical block whose markup it had to drop; a project
349
+ * renderer may call it for any value it can only approximate. `reason`
350
+ * completes the sentence 'field "x" …' in LP0411.
351
+ */
352
+ readonly reportUnfaithful?: (target: CachedElement, reason: string) => void;
353
+ }
354
+ /**
355
+ * A renderer writes one value into its element. It must not throw: one bad
356
+ * field may not stop an update. The result stays `void` — the internal
357
+ * no-write sentinel is not part of the contract.
358
+ */
359
+ interface FieldRenderer {
360
+ readonly name: RendererKey;
361
+ render(target: CachedElement, value: unknown, context: RenderContext): void;
362
+ }
363
+
193
364
  /**
194
365
  * How a bound region is brought up to date: the runtime patches it, a server
195
366
  * renders a `data-payload-fragment` boundary from the unsaved form state, or
@@ -416,177 +587,6 @@ declare class EventEmitter<TMap extends object = LivePreviewEventMap> {
416
587
  eventNames(): (keyof TMap)[];
417
588
  }
418
589
 
419
- /**
420
- * `'strict'` (default) strips `id`, `name` and `data-payload-*` and passes
421
- * other `data-*` only via `allowedDataAttributes`; `'compat'` keeps them.
422
- */
423
- type SanitizerPolicyMode = 'compat' | 'strict';
424
- interface SanitizeOptions {
425
- /** Overrides the module default set by `setSanitizerPolicy()`. */
426
- readonly policy?: SanitizerPolicyMode;
427
- /** `data-*` attributes (full names) that pass under `'strict'`; `data-payload-*` never does. */
428
- readonly allowedDataAttributes?: readonly string[];
429
- /**
430
- * Keep `input`, `button`, `textarea`, `select`, `option` and `label` — only
431
- * for markup the page author wrote, never for CMS content. `form`,
432
- * handlers, `style` and unsafe URLs stay dropped.
433
- */
434
- readonly allowFormControls?: boolean;
435
- /** Extra tags to allow. Lower-case, untrimmed. */
436
- readonly additionalAllowedTags?: readonly string[];
437
- /**
438
- * Extra per-tag attributes, lower-case. Cannot re-admit handlers, `style`,
439
- * or — under `'strict'` — `id`, `name` and `data-payload-*`.
440
- */
441
- readonly additionalAllowedAttributes?: Readonly<Record<string, readonly string[]>>;
442
- /**
443
- * The input is a page-author item template, so `'strict'` keeps the
444
- * applier's reconciliation attributes (`TEMPLATE_ATTRIBUTES`) and nothing
445
- * else — every other `data-payload-*` is still stripped, so a template can
446
- * never add a binding.
447
- */
448
- readonly templateMode?: boolean;
449
- /**
450
- * The DOM to parse with, for this call: an SSR document such as linkedom's
451
- * or jsdom's. Wins over `setSanitizerDocument()` and over the global
452
- * `document`, and two callers with two documents never share one.
453
- */
454
- readonly document?: SanitizerDocument;
455
- }
456
- /**
457
- * The default for calls without an explicit `policy`, per package entry. A
458
- * runtime carries its own `sanitizerPolicy` and never writes here (ADR 0002).
459
- */
460
- declare function setSanitizerPolicy(mode: SanitizerPolicyMode): void;
461
- /** The `Document` surface the sanitizer needs; jsdom, linkedom and happy-dom all provide it. */
462
- interface SanitizerDocument {
463
- createElement: (tagName: string) => {
464
- innerHTML: string;
465
- readonly content: ParentNode;
466
- };
467
- }
468
- /**
469
- * Supply a `Document` for SSR, e.g. linkedom's `parseHTML(...).document`;
470
- * `null` clears it, for every entry. The fallback for a call that names no
471
- * document of its own.
472
- *
473
- * @deprecated Since 2.1 a call names its document: `sanitizeHtml(html, { document })`,
474
- * `lexicalToHtml(content, { document })`. The process-wide slot stays until 3.0
475
- * (ADR 0007 ledger).
476
- */
477
- declare function setSanitizerDocument(doc: SanitizerDocument | null): void;
478
- /**
479
- * Sanitize `html`; malformed input is recovered by the parser first. The
480
- * result is a fixed point: sanitising it again changes nothing.
481
- *
482
- * @throws {SanitizerEnvironmentError} when no DOM is available.
483
- */
484
- declare function sanitizeHtml(html: string, options?: SanitizeOptions): string;
485
-
486
- /** Types shared by the runtime primitives. */
487
-
488
- /** Payload's field set plus the DOM-binding categories `html`, `url`, `image` and `structural-array`. */
489
- type FieldType = PayloadFieldType | 'html' | 'url' | 'image' | 'structural-array';
490
- /** A namespaced project renderer key, so a typo of a built-in type can never become one. */
491
- type CustomRendererKey = `${string}:${string}`;
492
- /** What a renderer may be registered under and an element may ask for. */
493
- type RendererKey = FieldType | CustomRendererKey;
494
- /**
495
- * A project rich-text renderer, shared by SSR and preview. Its output goes
496
- * through the sanitizer; call the same `sanitizeHtml()` server-side for byte equality.
497
- */
498
- type RichTextRenderer = (value: unknown, context: {
499
- readonly fieldName: string;
500
- readonly element: Element;
501
- readonly locale: string | undefined;
502
- }) => string;
503
- /** One registered binding. Several may share a field name when it renders in several places. */
504
- interface CachedElement {
505
- /** The bound DOM element. */
506
- readonly element: Element;
507
- /** Payload field path, e.g., `title` or `hero.subtitle`. */
508
- readonly fieldName: string;
509
- /** Resolved from attributes and tag heuristics; the schema may override it unless explicit. */
510
- readonly fieldType: RendererKey;
511
- /** Whether `data-payload-type` set the type, in which case the schema must not override it. */
512
- readonly explicitFieldType?: boolean;
513
- /** Fields this binding depends on (`data-payload-depends`); a change in any re-applies it under `skipUnchanged`. */
514
- readonly dependsOn?: readonly string[];
515
- /** Raw `data-payload-strategy` value. */
516
- readonly strategy?: string;
517
- /** How the runtime brings this binding up to date; `'unknown'` for an unrecognised strategy. Resolved by the cache. */
518
- readonly strategyKind?: UpdateSource | 'unknown';
519
- /** Nearest enclosing `data-payload-fragment` boundary. Resolved by the cache. */
520
- readonly fragmentBoundary?: Element;
521
- /** `data-payload-boundary`: an anchor that hides itself while its field is empty. */
522
- readonly hidesWhenEmpty?: boolean;
523
- /** Write the value into this attribute instead of the content; policed writes. */
524
- readonly targetAttribute?: string;
525
- /** Optional sibling-field path bound to the element's `href` attribute. */
526
- readonly hrefField?: string;
527
- /** Optional sibling-field path bound to the element's `src` attribute. */
528
- readonly srcField?: string;
529
- /** Optional sibling-field path bound to the element's `alt` attribute. */
530
- readonly altField?: string;
531
- /** Optional inline template for array/blocks rendering. */
532
- readonly arrayTemplate?: string;
533
- /** Optional separator for primitive-array stringification. */
534
- readonly arraySeparator?: string;
535
- /** Optional locale code locked onto this element (overrides the global locale). */
536
- readonly locale?: string;
537
- /** Raw `data-payload-format`; the date and number renderers read the vocabulary. */
538
- readonly format?: string;
539
- /** The document this binding belongs to, from the nearest `data-payload-owner`. */
540
- readonly owner?: string;
541
- /**
542
- * The value an auto-binding matched on (`data-payload-guessed`), for a
543
- * binding the runtime found by value rather than one the template declared.
544
- * Absent for a declared binding.
545
- */
546
- readonly guessed?: string;
547
- }
548
- /** What a renderer is given; `allFields` lets it resolve a sibling field. */
549
- interface RenderContext {
550
- /** Full field map for the current update — used for sibling lookups. */
551
- readonly allFields: Record<string, unknown>;
552
- /** Active locale, or `undefined` when none is established. */
553
- readonly locale: string | undefined;
554
- /** Optional schema descriptor for the field, when available. */
555
- readonly schema: PayloadFieldSchema | undefined;
556
- /** The project's rich-text renderer, when the client was configured with one. */
557
- readonly renderRichText?: RichTextRenderer;
558
- /**
559
- * The Payload server the runtime reads populated documents from (`serverURL`),
560
- * absent without one. A renderer that writes a URL out of a media document
561
- * resolves a path against it, as Payload's admin does; the built-in `upload`
562
- * and `image` renderers do.
563
- */
564
- readonly serverURL?: string;
565
- /**
566
- * This instance's sanitizer policy, for every HTML write the renderer makes.
567
- * Absent, the process default set by `setSanitizerPolicy()` applies.
568
- */
569
- readonly sanitizerPolicy?: SanitizerPolicyMode;
570
- /**
571
- * Say that this write cannot reproduce what the server drew, so
572
- * `onUnfaithfulPatch` can have a strategy render the region instead of
573
- * leaving a degraded patch on the page. The built-in rich-text renderer
574
- * calls it for a Lexical block whose markup it had to drop; a project
575
- * renderer may call it for any value it can only approximate. `reason`
576
- * completes the sentence 'field "x" …' in LP0411.
577
- */
578
- readonly reportUnfaithful?: (target: CachedElement, reason: string) => void;
579
- }
580
- /**
581
- * A renderer writes one value into its element. It must not throw: one bad
582
- * field may not stop an update. The result stays `void` — the internal
583
- * no-write sentinel is not part of the contract.
584
- */
585
- interface FieldRenderer {
586
- readonly name: RendererKey;
587
- render(target: CachedElement, value: unknown, context: RenderContext): void;
588
- }
589
-
590
590
  /**
591
591
  * Protocol negotiation. A capability is granted either by the version a peer
592
592
  * announces or by observation, since the stock Payload admin announces none:
@@ -874,7 +874,7 @@ interface InspectionFidelity {
874
874
  readonly canEscalate: boolean;
875
875
  /** Bindings reported unfaithful since start — once per element, like LP0411, and under every mode. */
876
876
  readonly unfaithful: number;
877
- /** Of those, how many were handed to the fragment or route strategy. */
877
+ /** How many times one of those was handed to the fragment or route strategy; a later edit hands it again. */
878
878
  readonly escalated: number;
879
879
  /** The field names behind `unfaithful`, sorted. Cumulative. */
880
880
  readonly fields: readonly string[];
@@ -1890,7 +1890,8 @@ declare function isDevMode(): boolean;
1890
1890
  /**
1891
1891
  * Which admin origins the runtime trusts: explicit ones always, the
1892
1892
  * `document.referrer` origin only when none is configured, any localhost port
1893
- * in development. See docs/security.md §1.
1893
+ * in development. See docs/security.md §1. The handshake goes to the trusted
1894
+ * origins, and to guessed localhost ports only while the browser names no parent.
1894
1895
  */
1895
1896
  interface OriginDetectorOptions {
1896
1897
  /** Explicit origins to trust. Always allowed. */
@@ -1915,7 +1916,12 @@ declare class OriginDetector {
1915
1916
  /** Release the lock (heartbeat timeout) so another allow-listed origin may reconnect. Returns the previous lock. */
1916
1917
  unlockOrigin(): string | undefined;
1917
1918
  get lockedOrigin(): string | undefined;
1918
- /** Every origin the `ready` handshake is broadcast to; the localhost pattern expands to the common dev ports. */
1919
+ /**
1920
+ * Every origin the `ready` handshake is broadcast to. The localhost pattern
1921
+ * expands to the common dev ports, a guess that costs a console error per
1922
+ * wrong port, so a parent the browser names replaces it: that origin when the
1923
+ * pattern trusts it, none when it is not on localhost.
1924
+ */
1919
1925
  enumerate(): string[];
1920
1926
  /** Whether `document.referrer` contributed an origin (absent under `Referrer-Policy: no-referrer`). */
1921
1927
  get referrerWasAvailable(): boolean;