payload-live-preview 2.2.2 → 2.3.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.
- package/README.md +35 -30
- package/dist/adapters/astro/PreviewBoundary.astro +17 -4
- package/dist/adapters/astro/RichText.astro +13 -2
- package/dist/adapters/astro/index.d.ts +7 -7
- package/dist/adapters/astro/index.js +1 -1
- package/dist/adapters/astro/index.js.map +1 -1
- package/dist/adapters/astro/middleware-entry.d.ts +3 -3
- package/dist/adapters/astro/middleware-entry.js +1 -1
- package/dist/adapters/astro/middleware-entry.js.map +1 -1
- package/dist/adapters/nextjs/index.d.ts +2 -2
- package/dist/adapters/nextjs/index.js +1 -1
- package/dist/adapters/nextjs/index.js.map +1 -1
- package/dist/adapters/nuxt/index.d.ts +4 -4
- package/dist/adapters/nuxt/index.js +1 -1
- package/dist/adapters/nuxt/index.js.map +1 -1
- package/dist/adapters/nuxt/module.d.ts +1 -1
- package/dist/adapters/react/index.d.ts +2 -2
- package/dist/adapters/react/index.js +1 -1
- package/dist/adapters/react/index.js.map +1 -1
- package/dist/adapters/sveltekit/index.d.ts +5 -5
- package/dist/adapters/sveltekit/index.js +1 -1
- package/dist/adapters/sveltekit/index.js.map +1 -1
- package/dist/adapters/vue/index.d.ts +2 -2
- package/dist/adapters/vue/index.js +1 -1
- package/dist/adapters/vue/index.js.map +1 -1
- package/dist/client.cjs +1 -1
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +15 -3
- package/dist/client.d.ts +15 -3
- package/dist/client.js +1 -1
- package/dist/client.js.map +1 -1
- package/dist/codegen-astro.js +1 -1
- package/dist/codegen-astro.js.map +1 -1
- package/dist/codegen-cli.js +1 -1
- package/dist/codegen-cli.js.map +1 -1
- package/dist/codegen.cjs +1 -1
- package/dist/codegen.cjs.map +1 -1
- package/dist/codegen.js +1 -1
- package/dist/codegen.js.map +1 -1
- package/dist/core.cjs +1 -1
- package/dist/core.cjs.map +1 -1
- package/dist/core.d.cts +139 -4
- package/dist/core.d.ts +139 -4
- package/dist/core.js +1 -1
- package/dist/core.js.map +1 -1
- package/dist/doctor-cli.d.ts +1 -1
- package/dist/doctor-cli.js +1 -1
- package/dist/doctor-cli.js.map +1 -1
- package/dist/doctor.d.ts +2 -2
- package/dist/doctor.js +1 -1
- package/dist/doctor.js.map +1 -1
- package/dist/{document-session-Bkd181PV.d.ts → document-session-BuYuO3ae.d.ts} +27 -2
- package/dist/{fragment-endpoint-CLRpNQ3n.d.ts → fragment-endpoint-CQE_7MKi.d.ts} +1 -1
- package/dist/fragment.cjs +1 -1
- package/dist/fragment.cjs.map +1 -1
- package/dist/fragment.d.cts +6 -2
- package/dist/fragment.d.ts +6 -2
- package/dist/fragment.js +1 -1
- package/dist/fragment.js.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +73 -12
- package/dist/index.d.ts +73 -12
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/lean.cjs +1 -1
- package/dist/lean.cjs.map +1 -1
- package/dist/lean.js +1 -1
- package/dist/lean.js.map +1 -1
- package/dist/lexical.cjs +1 -1
- package/dist/lexical.cjs.map +1 -1
- package/dist/lexical.d.cts +16 -4
- package/dist/lexical.d.ts +16 -4
- package/dist/lexical.js +1 -1
- package/dist/lexical.js.map +1 -1
- package/dist/{locals-zz2gi9dj.d.ts → locals-CyzDKfKU.d.ts} +7 -1
- package/dist/{middleware-CI-UTf6R.d.ts → middleware-Dnt6u4nF.d.ts} +2 -2
- package/dist/{options-CnYybG51.d.ts → options-DTzhFVJ4.d.ts} +13 -1
- package/dist/plugin.cjs +1 -1
- package/dist/plugin.cjs.map +1 -1
- package/dist/plugin.d.cts +15 -9
- package/dist/plugin.d.ts +15 -9
- package/dist/plugin.js +1 -1
- package/dist/plugin.js.map +1 -1
- package/dist/plugins.cjs +1 -1
- package/dist/plugins.cjs.map +1 -1
- package/dist/plugins.d.cts +8 -2
- package/dist/plugins.d.ts +8 -2
- package/dist/plugins.js +1 -1
- package/dist/plugins.js.map +1 -1
- package/dist/{probe-D-IHg9dF.d.ts → probe-afwdYebU.d.ts} +6 -2
- package/dist/server.cjs +1 -1
- package/dist/server.cjs.map +1 -1
- package/dist/server.d.cts +19 -1
- package/dist/server.d.ts +19 -1
- package/dist/server.js +1 -1
- package/dist/server.js.map +1 -1
- package/dist/structural.d.cts +2 -0
- package/dist/structural.d.ts +2 -0
- package/package.json +2 -1
package/dist/client.d.cts
CHANGED
|
@@ -33,6 +33,8 @@ declare const DIAGNOSTIC_CODES: Readonly<{
|
|
|
33
33
|
readonly UnattributableUpdate: "LP0202";
|
|
34
34
|
/** An update carried a value for a field the page binds nowhere; editing it changes nothing on this page. */
|
|
35
35
|
readonly UnboundField: "LP0203";
|
|
36
|
+
/** In development: a bound path covers its group under the `descendant` default, which 3.0 changes. */
|
|
37
|
+
readonly CoverageDefaultChanges: "LP0204";
|
|
36
38
|
/** The visibility gate held offscreen writes back until they scroll into view. */
|
|
37
39
|
readonly VisibilityGateDeferred: "LP0301";
|
|
38
40
|
/** A value was refused because the attribute or the value itself is unsafe. */
|
|
@@ -57,7 +59,7 @@ declare const DIAGNOSTIC_CODES: Readonly<{
|
|
|
57
59
|
readonly UnrenderedBlockKept: "LP0410";
|
|
58
60
|
/** A patch cannot reach what the server would have drawn; `onUnfaithfulPatch` decided what happens next. */
|
|
59
61
|
readonly UnfaithfulPatch: "LP0411";
|
|
60
|
-
/** The first write to a date, number or
|
|
62
|
+
/** The first write to a date, number, checkbox, select or radio binding replaced a different reading of the same value. */
|
|
61
63
|
readonly ServerFormatReplaced: "LP0412";
|
|
62
64
|
/** A Lexical block has no renderer, and the write could not keep the markup the server rendered for it; it is gone. */
|
|
63
65
|
readonly UnrenderedBlockLost: "LP0413";
|
|
@@ -77,7 +79,7 @@ declare const DIAGNOSTIC_CODES: Readonly<{
|
|
|
77
79
|
readonly StartupFailed: "LP0605";
|
|
78
80
|
/** Sending the ready handshake failed. */
|
|
79
81
|
readonly ReadyFailed: "LP0606";
|
|
80
|
-
/** The page declared hydration, but no React commit, Vue mount
|
|
82
|
+
/** The page declared hydration, but no React commit, Vue mount, SvelteKit mount or `markHydrated()` call came within the cap; the runtime started without waiting. */
|
|
81
83
|
readonly HydrationWaitTimedOut: "LP0607";
|
|
82
84
|
/** The audit found no runtime in a response that carried preview intent. */
|
|
83
85
|
readonly AuditRuntimeMissing: "LP0701";
|
|
@@ -119,6 +121,8 @@ declare const DIAGNOSTIC_CODES: Readonly<{
|
|
|
119
121
|
readonly V2ReadinessGap: "LP0709";
|
|
120
122
|
/** The preview runtime is served to anonymous visitors, not only inside the admin frame. */
|
|
121
123
|
readonly RuntimeOnPublicPage: "LP0710";
|
|
124
|
+
/** An element carries attributes that only mean something beside `data-payload-field`, and has none. */
|
|
125
|
+
readonly AuditModifierWithoutField: "LP0711";
|
|
122
126
|
}>;
|
|
123
127
|
/** A diagnostic code, as it appears in log output and on the `error` event. */
|
|
124
128
|
type DiagnosticCode = (typeof DIAGNOSTIC_CODES)[keyof typeof DIAGNOSTIC_CODES];
|
|
@@ -264,6 +268,8 @@ interface RenderContext {
|
|
|
264
268
|
* completes the sentence 'field "x" …' in LP0411.
|
|
265
269
|
*/
|
|
266
270
|
readonly reportUnfaithful?: (target: CachedElement, reason: string) => void;
|
|
271
|
+
/** The route of a Lexical internal link, as `internalLinkPattern` gives it. */
|
|
272
|
+
readonly internalLinkPattern?: string;
|
|
267
273
|
}
|
|
268
274
|
/**
|
|
269
275
|
* A renderer writes one value into its element. It must not throw: one bad
|
|
@@ -702,7 +708,7 @@ interface LivePreviewInspection {
|
|
|
702
708
|
* SvelteKit page is not connected yet; `timed-out` is LP0607.
|
|
703
709
|
*/
|
|
704
710
|
readonly hydration: {
|
|
705
|
-
readonly mode: 'off' | 'react' | 'vue' | 'sveltekit';
|
|
711
|
+
readonly mode: 'off' | 'react' | 'vue' | 'sveltekit' | 'manual';
|
|
706
712
|
readonly state: 'idle' | 'waiting' | 'committed' | 'timed-out';
|
|
707
713
|
};
|
|
708
714
|
}
|
|
@@ -855,6 +861,12 @@ interface LivePreviewClientConfig {
|
|
|
855
861
|
readonly apiRoute?: string;
|
|
856
862
|
/** Population depth used with `serverURL`. Required with it; `defaults: 'v1'` falls back to `1`. */
|
|
857
863
|
readonly mergeDepth?: number;
|
|
864
|
+
/** Milliseconds the `serverURL` merge may wait before the update shows its raw values. Off by default. */
|
|
865
|
+
readonly mergeTimeoutMs?: number;
|
|
866
|
+
/** The route of a Lexical internal link with no `url` of its own, as `/{locale}/{slug}/`. */
|
|
867
|
+
readonly internalLinkPattern?: string;
|
|
868
|
+
/** Hold a route render until Payload reports the save: the route shows what is saved. */
|
|
869
|
+
readonly routeAfterSave?: boolean;
|
|
858
870
|
/** Custom fetch for the `serverURL` merge request: attach auth headers or route through a proxy. */
|
|
859
871
|
readonly mergeFetch?: typeof fetch;
|
|
860
872
|
/** Verbose console output. Defaults to dev-mode detection. */
|
package/dist/client.d.ts
CHANGED
|
@@ -33,6 +33,8 @@ declare const DIAGNOSTIC_CODES: Readonly<{
|
|
|
33
33
|
readonly UnattributableUpdate: "LP0202";
|
|
34
34
|
/** An update carried a value for a field the page binds nowhere; editing it changes nothing on this page. */
|
|
35
35
|
readonly UnboundField: "LP0203";
|
|
36
|
+
/** In development: a bound path covers its group under the `descendant` default, which 3.0 changes. */
|
|
37
|
+
readonly CoverageDefaultChanges: "LP0204";
|
|
36
38
|
/** The visibility gate held offscreen writes back until they scroll into view. */
|
|
37
39
|
readonly VisibilityGateDeferred: "LP0301";
|
|
38
40
|
/** A value was refused because the attribute or the value itself is unsafe. */
|
|
@@ -57,7 +59,7 @@ declare const DIAGNOSTIC_CODES: Readonly<{
|
|
|
57
59
|
readonly UnrenderedBlockKept: "LP0410";
|
|
58
60
|
/** A patch cannot reach what the server would have drawn; `onUnfaithfulPatch` decided what happens next. */
|
|
59
61
|
readonly UnfaithfulPatch: "LP0411";
|
|
60
|
-
/** The first write to a date, number or
|
|
62
|
+
/** The first write to a date, number, checkbox, select or radio binding replaced a different reading of the same value. */
|
|
61
63
|
readonly ServerFormatReplaced: "LP0412";
|
|
62
64
|
/** A Lexical block has no renderer, and the write could not keep the markup the server rendered for it; it is gone. */
|
|
63
65
|
readonly UnrenderedBlockLost: "LP0413";
|
|
@@ -77,7 +79,7 @@ declare const DIAGNOSTIC_CODES: Readonly<{
|
|
|
77
79
|
readonly StartupFailed: "LP0605";
|
|
78
80
|
/** Sending the ready handshake failed. */
|
|
79
81
|
readonly ReadyFailed: "LP0606";
|
|
80
|
-
/** The page declared hydration, but no React commit, Vue mount
|
|
82
|
+
/** The page declared hydration, but no React commit, Vue mount, SvelteKit mount or `markHydrated()` call came within the cap; the runtime started without waiting. */
|
|
81
83
|
readonly HydrationWaitTimedOut: "LP0607";
|
|
82
84
|
/** The audit found no runtime in a response that carried preview intent. */
|
|
83
85
|
readonly AuditRuntimeMissing: "LP0701";
|
|
@@ -119,6 +121,8 @@ declare const DIAGNOSTIC_CODES: Readonly<{
|
|
|
119
121
|
readonly V2ReadinessGap: "LP0709";
|
|
120
122
|
/** The preview runtime is served to anonymous visitors, not only inside the admin frame. */
|
|
121
123
|
readonly RuntimeOnPublicPage: "LP0710";
|
|
124
|
+
/** An element carries attributes that only mean something beside `data-payload-field`, and has none. */
|
|
125
|
+
readonly AuditModifierWithoutField: "LP0711";
|
|
122
126
|
}>;
|
|
123
127
|
/** A diagnostic code, as it appears in log output and on the `error` event. */
|
|
124
128
|
type DiagnosticCode = (typeof DIAGNOSTIC_CODES)[keyof typeof DIAGNOSTIC_CODES];
|
|
@@ -264,6 +268,8 @@ interface RenderContext {
|
|
|
264
268
|
* completes the sentence 'field "x" …' in LP0411.
|
|
265
269
|
*/
|
|
266
270
|
readonly reportUnfaithful?: (target: CachedElement, reason: string) => void;
|
|
271
|
+
/** The route of a Lexical internal link, as `internalLinkPattern` gives it. */
|
|
272
|
+
readonly internalLinkPattern?: string;
|
|
267
273
|
}
|
|
268
274
|
/**
|
|
269
275
|
* A renderer writes one value into its element. It must not throw: one bad
|
|
@@ -702,7 +708,7 @@ interface LivePreviewInspection {
|
|
|
702
708
|
* SvelteKit page is not connected yet; `timed-out` is LP0607.
|
|
703
709
|
*/
|
|
704
710
|
readonly hydration: {
|
|
705
|
-
readonly mode: 'off' | 'react' | 'vue' | 'sveltekit';
|
|
711
|
+
readonly mode: 'off' | 'react' | 'vue' | 'sveltekit' | 'manual';
|
|
706
712
|
readonly state: 'idle' | 'waiting' | 'committed' | 'timed-out';
|
|
707
713
|
};
|
|
708
714
|
}
|
|
@@ -855,6 +861,12 @@ interface LivePreviewClientConfig {
|
|
|
855
861
|
readonly apiRoute?: string;
|
|
856
862
|
/** Population depth used with `serverURL`. Required with it; `defaults: 'v1'` falls back to `1`. */
|
|
857
863
|
readonly mergeDepth?: number;
|
|
864
|
+
/** Milliseconds the `serverURL` merge may wait before the update shows its raw values. Off by default. */
|
|
865
|
+
readonly mergeTimeoutMs?: number;
|
|
866
|
+
/** The route of a Lexical internal link with no `url` of its own, as `/{locale}/{slug}/`. */
|
|
867
|
+
readonly internalLinkPattern?: string;
|
|
868
|
+
/** Hold a route render until Payload reports the save: the route shows what is saved. */
|
|
869
|
+
readonly routeAfterSave?: boolean;
|
|
858
870
|
/** Custom fetch for the `serverURL` merge request: attach auth headers or route through a proxy. */
|
|
859
871
|
readonly mergeFetch?: typeof fetch;
|
|
860
872
|
/** Verbose console output. Defaults to dev-mode detection. */
|