payload-live-preview 2.0.2 → 2.0.4

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 (73) hide show
  1. package/README.md +13 -8
  2. package/dist/adapters/astro/index.js +1 -1
  3. package/dist/adapters/astro/index.js.map +1 -1
  4. package/dist/adapters/astro/middleware-entry.js +1 -1
  5. package/dist/adapters/astro/middleware-entry.js.map +1 -1
  6. package/dist/adapters/nextjs/index.js +1 -1
  7. package/dist/adapters/nextjs/index.js.map +1 -1
  8. package/dist/adapters/nuxt/index.js +1 -1
  9. package/dist/adapters/nuxt/index.js.map +1 -1
  10. package/dist/adapters/sveltekit/index.js +1 -1
  11. package/dist/adapters/sveltekit/index.js.map +1 -1
  12. package/dist/client.cjs +1 -1
  13. package/dist/client.cjs.map +1 -1
  14. package/dist/client.d.cts +10 -3
  15. package/dist/client.d.ts +10 -3
  16. package/dist/client.js +1 -1
  17. package/dist/client.js.map +1 -1
  18. package/dist/codegen-astro.js.map +1 -1
  19. package/dist/codegen-cli.js.map +1 -1
  20. package/dist/codegen.cjs +1 -1
  21. package/dist/codegen.cjs.map +1 -1
  22. package/dist/codegen.d.cts +1 -16
  23. package/dist/codegen.d.ts +1 -16
  24. package/dist/codegen.js +1 -1
  25. package/dist/codegen.js.map +1 -1
  26. package/dist/core.cjs +1 -1
  27. package/dist/core.cjs.map +1 -1
  28. package/dist/core.d.cts +13 -5
  29. package/dist/core.d.ts +13 -5
  30. package/dist/core.js +1 -1
  31. package/dist/core.js.map +1 -1
  32. package/dist/doctor-cli.d.ts +1 -1
  33. package/dist/doctor-cli.js +1 -1
  34. package/dist/doctor-cli.js.map +1 -1
  35. package/dist/doctor.d.ts +2 -2
  36. package/dist/doctor.js +1 -1
  37. package/dist/doctor.js.map +1 -1
  38. package/dist/fragment.cjs +1 -1
  39. package/dist/fragment.cjs.map +1 -1
  40. package/dist/fragment.d.cts +5 -1
  41. package/dist/fragment.d.ts +5 -1
  42. package/dist/fragment.js +1 -1
  43. package/dist/fragment.js.map +1 -1
  44. package/dist/index.cjs +1 -1
  45. package/dist/index.cjs.map +1 -1
  46. package/dist/index.d.cts +13 -5
  47. package/dist/index.d.ts +13 -5
  48. package/dist/index.js +1 -1
  49. package/dist/index.js.map +1 -1
  50. package/dist/lean.cjs +1 -1
  51. package/dist/lean.cjs.map +1 -1
  52. package/dist/lean.js +1 -1
  53. package/dist/lean.js.map +1 -1
  54. package/dist/lexical.cjs +1 -1
  55. package/dist/lexical.cjs.map +1 -1
  56. package/dist/lexical.js +1 -1
  57. package/dist/lexical.js.map +1 -1
  58. package/dist/plugins.cjs +1 -1
  59. package/dist/plugins.cjs.map +1 -1
  60. package/dist/plugins.d.cts +5 -1
  61. package/dist/plugins.d.ts +5 -1
  62. package/dist/plugins.js +1 -1
  63. package/dist/plugins.js.map +1 -1
  64. package/dist/{probe-DqaItcwX.d.ts → probe-Bzm4fYFL.d.ts} +11 -1
  65. package/dist/server.cjs +1 -1
  66. package/dist/server.cjs.map +1 -1
  67. package/dist/server.js +1 -1
  68. package/dist/server.js.map +1 -1
  69. package/dist/structural.cjs +2 -2
  70. package/dist/structural.cjs.map +1 -1
  71. package/dist/structural.js +2 -2
  72. package/dist/structural.js.map +1 -1
  73. package/package.json +1 -1
package/dist/index.d.cts CHANGED
@@ -158,12 +158,15 @@ interface LivePreviewInspection {
158
158
  /**
159
159
  * The fidelity verdicts as `inspect()` reports them (LP0411). A positive
160
160
  * `unfaithful` beside `escalated: 0` is a page that keeps a degraded patch —
161
- * because `mode` says so, or because neither `fragments.handler` nor
162
- * `route.handler` is there to escalate to.
161
+ * because `mode` says so, or because `canEscalate` is false: neither
162
+ * `fragments.handler` nor `route.handler` is there to escalate to, which the
163
+ * runtime also says once as LP0808 when `mode` is `'escalate'`.
163
164
  */
164
165
  interface InspectionFidelity {
165
166
  /** `onUnfaithfulPatch` as resolved from both of its names. */
166
167
  readonly mode: 'ignore' | 'warn' | 'escalate';
168
+ /** Whether a fragment or route strategy exists for `'escalate'` to hand a patch to. */
169
+ readonly canEscalate: boolean;
167
170
  /** Bindings reported unfaithful since start — once per element, like LP0411, and under every mode. */
168
171
  readonly unfaithful: number;
169
172
  /** Of those, how many were handed to the fragment or route strategy. */
@@ -302,10 +305,12 @@ declare const DIAGNOSTIC_CODES: Readonly<{
302
305
  readonly PluginIncompatible: "LP0103";
303
306
  /** The page carries the lean runtime and needs a feature that profile leaves out. */
304
307
  readonly ProfileFeatureOmitted: "LP0104";
305
- /** An update named a field with no binding anchor on the page. */
308
+ /** An update named an empty field with no binding anchor on the page; an edit to it has nowhere to land. */
306
309
  readonly OrphanField: "LP0201";
307
310
  /** Owner scoping is on and the update names no document it could belong to. */
308
311
  readonly UnattributableUpdate: "LP0202";
312
+ /** An update carried a value for a field the page binds nowhere; editing it changes nothing on this page. */
313
+ readonly UnboundField: "LP0203";
309
314
  /** The visibility gate held offscreen writes back until they scroll into view. */
310
315
  readonly VisibilityGateDeferred: "LP0301";
311
316
  /** A value was refused because the attribute or the value itself is unsafe. */
@@ -382,6 +387,8 @@ declare const DIAGNOSTIC_CODES: Readonly<{
382
387
  readonly FragmentStrategyUnavailable: "LP0806";
383
388
  /** A revision changed a field with no binding; `onUnfaithfulPatch` refreshed the route. */
384
389
  readonly UnboundChangeRefresh: "LP0807";
390
+ /** `onUnfaithfulPatch: 'escalate'` found no route or fragment strategy to hand an unfaithful patch to; the page keeps it. */
391
+ readonly EscalationUnavailable: "LP0808";
385
392
  /** A readiness row is not yet at its 2.0 value; `pll doctor --v2` reports it. */
386
393
  readonly V2ReadinessGap: "LP0709";
387
394
  /** The preview runtime is served to anonymous visitors, not only inside the admin frame. */
@@ -1939,8 +1946,9 @@ declare function previewBindingsFromLocals(locals: unknown, options?: {
1939
1946
 
1940
1947
  /**
1941
1948
  * Hydrated islands own their subtree, so the runtime never patches inside one.
1942
- * Instead every flush dispatches `payload-live-preview:update` on each island
1943
- * root with the update in `detail`. `data-payload-island="patch"` opts back in.
1949
+ * Instead every flush that carried a change dispatches `payload-live-preview:update`
1950
+ * on each island root with the update in `detail`, whether or not a binding
1951
+ * outside the islands was written. `data-payload-island="patch"` opts back in.
1944
1952
  * @internal
1945
1953
  */
1946
1954
  declare const ISLAND_EVENT = "payload-live-preview:update";
package/dist/index.d.ts CHANGED
@@ -158,12 +158,15 @@ interface LivePreviewInspection {
158
158
  /**
159
159
  * The fidelity verdicts as `inspect()` reports them (LP0411). A positive
160
160
  * `unfaithful` beside `escalated: 0` is a page that keeps a degraded patch —
161
- * because `mode` says so, or because neither `fragments.handler` nor
162
- * `route.handler` is there to escalate to.
161
+ * because `mode` says so, or because `canEscalate` is false: neither
162
+ * `fragments.handler` nor `route.handler` is there to escalate to, which the
163
+ * runtime also says once as LP0808 when `mode` is `'escalate'`.
163
164
  */
164
165
  interface InspectionFidelity {
165
166
  /** `onUnfaithfulPatch` as resolved from both of its names. */
166
167
  readonly mode: 'ignore' | 'warn' | 'escalate';
168
+ /** Whether a fragment or route strategy exists for `'escalate'` to hand a patch to. */
169
+ readonly canEscalate: boolean;
167
170
  /** Bindings reported unfaithful since start — once per element, like LP0411, and under every mode. */
168
171
  readonly unfaithful: number;
169
172
  /** Of those, how many were handed to the fragment or route strategy. */
@@ -302,10 +305,12 @@ declare const DIAGNOSTIC_CODES: Readonly<{
302
305
  readonly PluginIncompatible: "LP0103";
303
306
  /** The page carries the lean runtime and needs a feature that profile leaves out. */
304
307
  readonly ProfileFeatureOmitted: "LP0104";
305
- /** An update named a field with no binding anchor on the page. */
308
+ /** An update named an empty field with no binding anchor on the page; an edit to it has nowhere to land. */
306
309
  readonly OrphanField: "LP0201";
307
310
  /** Owner scoping is on and the update names no document it could belong to. */
308
311
  readonly UnattributableUpdate: "LP0202";
312
+ /** An update carried a value for a field the page binds nowhere; editing it changes nothing on this page. */
313
+ readonly UnboundField: "LP0203";
309
314
  /** The visibility gate held offscreen writes back until they scroll into view. */
310
315
  readonly VisibilityGateDeferred: "LP0301";
311
316
  /** A value was refused because the attribute or the value itself is unsafe. */
@@ -382,6 +387,8 @@ declare const DIAGNOSTIC_CODES: Readonly<{
382
387
  readonly FragmentStrategyUnavailable: "LP0806";
383
388
  /** A revision changed a field with no binding; `onUnfaithfulPatch` refreshed the route. */
384
389
  readonly UnboundChangeRefresh: "LP0807";
390
+ /** `onUnfaithfulPatch: 'escalate'` found no route or fragment strategy to hand an unfaithful patch to; the page keeps it. */
391
+ readonly EscalationUnavailable: "LP0808";
385
392
  /** A readiness row is not yet at its 2.0 value; `pll doctor --v2` reports it. */
386
393
  readonly V2ReadinessGap: "LP0709";
387
394
  /** The preview runtime is served to anonymous visitors, not only inside the admin frame. */
@@ -1939,8 +1946,9 @@ declare function previewBindingsFromLocals(locals: unknown, options?: {
1939
1946
 
1940
1947
  /**
1941
1948
  * Hydrated islands own their subtree, so the runtime never patches inside one.
1942
- * Instead every flush dispatches `payload-live-preview:update` on each island
1943
- * root with the update in `detail`. `data-payload-island="patch"` opts back in.
1949
+ * Instead every flush that carried a change dispatches `payload-live-preview:update`
1950
+ * on each island root with the update in `detail`, whether or not a binding
1951
+ * outside the islands was written. `data-payload-island="patch"` opts back in.
1944
1952
  * @internal
1945
1953
  */
1946
1954
  declare const ISLAND_EVENT = "payload-live-preview:update";