payload-live-preview 1.0.4 → 1.1.0
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 +48 -0
- package/dist/adapters/astro/index.js +1 -1
- package/dist/adapters/astro/index.js.map +1 -1
- package/dist/adapters/astro/middleware-entry.js +1 -1
- package/dist/adapters/astro/middleware-entry.js.map +1 -1
- package/dist/adapters/nextjs/index.js +1 -1
- package/dist/adapters/nextjs/index.js.map +1 -1
- package/dist/adapters/nuxt/index.js +1 -1
- package/dist/adapters/nuxt/index.js.map +1 -1
- package/dist/adapters/sveltekit/index.js +1 -1
- package/dist/adapters/sveltekit/index.js.map +1 -1
- package/dist/core.cjs +1 -1
- package/dist/core.cjs.map +1 -1
- package/dist/core.d.cts +23 -0
- package/dist/core.d.ts +23 -0
- package/dist/core.js +1 -1
- package/dist/core.js.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +32 -0
- package/dist/index.d.ts +32 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -379,6 +379,15 @@ interface CachedElement {
|
|
|
379
379
|
readonly arraySeparator?: string;
|
|
380
380
|
/** Optional locale code locked onto this element (overrides the global locale). */
|
|
381
381
|
readonly locale?: string;
|
|
382
|
+
/**
|
|
383
|
+
* Optional document this binding belongs to, resolved from the nearest
|
|
384
|
+
* `data-payload-owner` ancestor (the element itself included).
|
|
385
|
+
*
|
|
386
|
+
* Only consulted while owner scoping is enabled. Without it a field name is
|
|
387
|
+
* the sole identity, so every document rendered on the page competes for the
|
|
388
|
+
* same name.
|
|
389
|
+
*/
|
|
390
|
+
readonly owner?: string;
|
|
382
391
|
}
|
|
383
392
|
/**
|
|
384
393
|
* Context passed to every field renderer. Provides access to the
|
|
@@ -550,6 +559,20 @@ interface LivePreviewClientConfig {
|
|
|
550
559
|
readonly heartbeatMs?: number;
|
|
551
560
|
/** IntersectionObserver rootMargin. Defaults to `200px`. */
|
|
552
561
|
readonly intersectionRootMargin?: string;
|
|
562
|
+
/**
|
|
563
|
+
* Restrict each update to the bindings owned by the document it describes.
|
|
564
|
+
*
|
|
565
|
+
* Ownership is declared in markup with `data-payload-owner`, resolved from
|
|
566
|
+
* the nearest ancestor: `global:<slug>`, `collection:<slug>`, or
|
|
567
|
+
* `collection:<slug>:<id>`. Payload already sends the edited document's
|
|
568
|
+
* identity, so nothing else needs configuring.
|
|
569
|
+
*
|
|
570
|
+
* Defaults to `false`, which keeps the 1.x behaviour of matching on the
|
|
571
|
+
* field name alone. Enable it when one page previews more than one document
|
|
572
|
+
* and a field name is therefore no longer a unique identity. While enabled,
|
|
573
|
+
* a binding without an owner is never updated.
|
|
574
|
+
*/
|
|
575
|
+
readonly scopeBindingsByOwner?: boolean;
|
|
553
576
|
/** Bypass the visibility gate (apply every update). Defaults to `false`. */
|
|
554
577
|
readonly disableVisibilityGate?: boolean;
|
|
555
578
|
/** Cache-size threshold above which off-screen updates are queued for replay. Defaults to 50. */
|
|
@@ -721,6 +744,15 @@ interface InlineScriptConfig {
|
|
|
721
744
|
* a production-like origin list. Default `false`.
|
|
722
745
|
*/
|
|
723
746
|
readonly disableLocalhostMatching?: boolean;
|
|
747
|
+
/**
|
|
748
|
+
* Restrict each update to the bindings owned by the document it describes,
|
|
749
|
+
* declared in markup with `data-payload-owner` and resolved from the nearest
|
|
750
|
+
* ancestor. Default `false`, which keeps matching on the field name alone.
|
|
751
|
+
*
|
|
752
|
+
* Enable it when one page previews more than one document. While enabled a
|
|
753
|
+
* binding without an owner is never updated.
|
|
754
|
+
*/
|
|
755
|
+
readonly scopeBindingsByOwner?: boolean;
|
|
724
756
|
/**
|
|
725
757
|
* Retained for 1.x source compatibility, but has no effect here:
|
|
726
758
|
* `generateInlineScript()` returns a script body and creates no tag.
|
package/dist/index.d.ts
CHANGED
|
@@ -379,6 +379,15 @@ interface CachedElement {
|
|
|
379
379
|
readonly arraySeparator?: string;
|
|
380
380
|
/** Optional locale code locked onto this element (overrides the global locale). */
|
|
381
381
|
readonly locale?: string;
|
|
382
|
+
/**
|
|
383
|
+
* Optional document this binding belongs to, resolved from the nearest
|
|
384
|
+
* `data-payload-owner` ancestor (the element itself included).
|
|
385
|
+
*
|
|
386
|
+
* Only consulted while owner scoping is enabled. Without it a field name is
|
|
387
|
+
* the sole identity, so every document rendered on the page competes for the
|
|
388
|
+
* same name.
|
|
389
|
+
*/
|
|
390
|
+
readonly owner?: string;
|
|
382
391
|
}
|
|
383
392
|
/**
|
|
384
393
|
* Context passed to every field renderer. Provides access to the
|
|
@@ -550,6 +559,20 @@ interface LivePreviewClientConfig {
|
|
|
550
559
|
readonly heartbeatMs?: number;
|
|
551
560
|
/** IntersectionObserver rootMargin. Defaults to `200px`. */
|
|
552
561
|
readonly intersectionRootMargin?: string;
|
|
562
|
+
/**
|
|
563
|
+
* Restrict each update to the bindings owned by the document it describes.
|
|
564
|
+
*
|
|
565
|
+
* Ownership is declared in markup with `data-payload-owner`, resolved from
|
|
566
|
+
* the nearest ancestor: `global:<slug>`, `collection:<slug>`, or
|
|
567
|
+
* `collection:<slug>:<id>`. Payload already sends the edited document's
|
|
568
|
+
* identity, so nothing else needs configuring.
|
|
569
|
+
*
|
|
570
|
+
* Defaults to `false`, which keeps the 1.x behaviour of matching on the
|
|
571
|
+
* field name alone. Enable it when one page previews more than one document
|
|
572
|
+
* and a field name is therefore no longer a unique identity. While enabled,
|
|
573
|
+
* a binding without an owner is never updated.
|
|
574
|
+
*/
|
|
575
|
+
readonly scopeBindingsByOwner?: boolean;
|
|
553
576
|
/** Bypass the visibility gate (apply every update). Defaults to `false`. */
|
|
554
577
|
readonly disableVisibilityGate?: boolean;
|
|
555
578
|
/** Cache-size threshold above which off-screen updates are queued for replay. Defaults to 50. */
|
|
@@ -721,6 +744,15 @@ interface InlineScriptConfig {
|
|
|
721
744
|
* a production-like origin list. Default `false`.
|
|
722
745
|
*/
|
|
723
746
|
readonly disableLocalhostMatching?: boolean;
|
|
747
|
+
/**
|
|
748
|
+
* Restrict each update to the bindings owned by the document it describes,
|
|
749
|
+
* declared in markup with `data-payload-owner` and resolved from the nearest
|
|
750
|
+
* ancestor. Default `false`, which keeps matching on the field name alone.
|
|
751
|
+
*
|
|
752
|
+
* Enable it when one page previews more than one document. While enabled a
|
|
753
|
+
* binding without an owner is never updated.
|
|
754
|
+
*/
|
|
755
|
+
readonly scopeBindingsByOwner?: boolean;
|
|
724
756
|
/**
|
|
725
757
|
* Retained for 1.x source compatibility, but has no effect here:
|
|
726
758
|
* `generateInlineScript()` returns a script body and creates no tag.
|