payload-live-preview 1.0.5 → 1.2.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/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.
@@ -1755,12 +1787,24 @@ interface FieldBindingAttributes {
1755
1787
  readonly 'data-payload-field': string;
1756
1788
  readonly 'data-payload-attribute'?: string;
1757
1789
  readonly 'data-payload-type'?: string;
1790
+ readonly 'data-payload-richtext'?: string;
1791
+ readonly 'data-payload-html'?: string;
1792
+ readonly 'data-payload-locale'?: string;
1758
1793
  }
1759
1794
  interface BindOptions {
1760
1795
  /** Override the bound attribute (e.g., `'src'` for `<img>`). Default: textContent. */
1761
1796
  readonly attribute?: string;
1762
1797
  /** Explicit field-type override — bypasses schema detection. */
1763
1798
  readonly type?: string;
1799
+ /**
1800
+ * Mark the binding as Lexical rich text. Usually detected automatically;
1801
+ * set it where the initial render is empty and there is nothing to detect.
1802
+ */
1803
+ readonly richtext?: boolean;
1804
+ /** Render the value as sanitised HTML rather than text. */
1805
+ readonly html?: boolean;
1806
+ /** Lock this element to one locale, overriding the message locale. */
1807
+ readonly locale?: string;
1764
1808
  }
1765
1809
  /**
1766
1810
  * String-literal binding helper.
@@ -1795,4 +1839,90 @@ declare function bind<T = Record<string, unknown>>(field: FieldName<T>, options?
1795
1839
  */
1796
1840
  declare function bindByPath<T = Record<string, unknown>>(picker: (data: T) => unknown, options?: BindOptions): FieldBindingAttributes;
1797
1841
 
1798
- export { type AnalyticsSnapshot, type BindOptions, type BlockRenderContext, type BlockRenderer, type CachedElement, type CspDirectiveMerge, type DocumentSaveHandler, type DocumentSavePluginOptions, type DocumentSaveStrategy, EventEmitter, type EventHandler, type FetchPreviewDocumentOptions, type FetchPreviewGlobalOptions, type FieldBindingAttributes, type FieldName, type FieldPath, type FieldRenderer, type FieldTransform, type FieldType, type FrameAncestorsOptions, type InlineScriptConfig, LIBRARY_PROTOCOL_VERSION, type LexicalNode, type LexicalRoot, LivePreviewClient, type LivePreviewClientConfig, type LivePreviewEventMap, type LivePreviewPlugin, OriginDetector, type PayloadFieldSchema, type PayloadFieldType, type PayloadLivePreviewData, type PayloadLivePreviewMessage, type PayloadMedia, type PayloadRelationship, type PluginContext, type PluginDisposer, type PluginEvents, type PreviewFetchBaseOptions, type PreviewRequestLike, type PreviewRequestOptions, type PreviewWhere, type ProtocolCapability, type ProtocolNegotiation, type RenderContext, type SanitizerDocument, type Unsubscribe, VERSION, type ValueAt, bind, bindByPath, buildBuiltinRenderers, buildFrameAncestors, buildScriptSrcWithNonce, createAnalyticsPlugin, debugPlugin, detectInitialLocale, documentSavePlugin, escapeHtml, escapeHtmlAttribute, fetchPreviewDocument, fetchPreviewGlobal, generateCspNonce, generateInlineScript, hasCapability, highlightPlugin, initLivePreview, isDevMode, isExternalHttpUrl, isInIframe, isInPopup, isInPreviewContext, isLexicalContent, isPreviewRequest, isSafeUrl, lexicalToHtml, lexicalToPlainText, mergeCspHeader, negotiateProtocol, registerBlockRenderer, registerBuiltinRenderer, runtimeBuildInfo, sanitizeHtml, setCspCrypto, setSanitizerDocument, wrapWithScriptTag };
1842
+ /**
1843
+ * Authorization-gated binding emission.
1844
+ *
1845
+ * Binding attributes are not neutral markup. `data-payload-field` names a CMS
1846
+ * field, and `data-payload-owner` names a global, a collection and often a
1847
+ * document id. Emitted unconditionally they publish the shape of the content
1848
+ * model — and the identity of documents — to every anonymous visitor and
1849
+ * crawler of the page.
1850
+ *
1851
+ * The gate belongs to the application, not to this package: it is the same
1852
+ * decision that already controls draft reads and cache policy. What this
1853
+ * module provides is a place to apply that decision **once per request** so no
1854
+ * individual call site can forget it, and an emission unit that cannot be
1855
+ * partially suppressed.
1856
+ *
1857
+ * That second property matters more than it looks. A binding is not one
1858
+ * attribute: a field travels with its type, its locale, its rich-text marker
1859
+ * and its owner. Gating only the field name leaves the companions behind,
1860
+ * which discloses the taxonomy anyway and leaves the runtime looking at a
1861
+ * binding whose field is gone.
1862
+ *
1863
+ * @module @dsl/preview-bindings
1864
+ */
1865
+
1866
+ /** Owner marker naming the document a subtree belongs to. */
1867
+ interface OwnerBindingAttributes {
1868
+ readonly 'data-payload-owner': string;
1869
+ }
1870
+ /**
1871
+ * The complete absence of binding attributes.
1872
+ *
1873
+ * Spreading this into markup contributes nothing, which is the point: an
1874
+ * unauthorized response must be byte-identical to one that never knew about
1875
+ * live preview.
1876
+ */
1877
+ type SuppressedBinding = Readonly<Record<string, never>>;
1878
+ interface PreviewBindingsOptions {
1879
+ /**
1880
+ * The application's own authorization verdict for this request.
1881
+ *
1882
+ * Never derive this from `?preview=true`, an iframe destination or a
1883
+ * referer — those are client-controlled intent signals. Use the same
1884
+ * verified result that decides whether drafts may be read.
1885
+ */
1886
+ readonly authorized: boolean;
1887
+ /**
1888
+ * Document this subtree belongs to, emitted as `data-payload-owner` by
1889
+ * {@link PreviewBindings.owner}. Required only when the page previews more
1890
+ * than one document and the runtime runs with `scopeBindingsByOwner`.
1891
+ */
1892
+ readonly owner?: string;
1893
+ }
1894
+ /** Request-scoped binding helpers that carry one authorization decision. */
1895
+ interface PreviewBindings {
1896
+ /** The verdict these helpers were built with. */
1897
+ readonly authorized: boolean;
1898
+ /** Typed field binding, or nothing at all while unauthorized. */
1899
+ bind: <T = Record<string, unknown>>(field: FieldName<T>, options?: BindOptions) => FieldBindingAttributes | SuppressedBinding;
1900
+ /** Rename-safe field binding, or nothing at all while unauthorized. */
1901
+ bindByPath: <T = Record<string, unknown>>(picker: (data: T) => unknown, options?: BindOptions) => FieldBindingAttributes | SuppressedBinding;
1902
+ /**
1903
+ * Owner marker for the element that owns this subtree, or nothing at all
1904
+ * while unauthorized or when no owner was configured.
1905
+ */
1906
+ owner: () => OwnerBindingAttributes | SuppressedBinding;
1907
+ }
1908
+ /**
1909
+ * Build request-scoped binding helpers around one authorization decision.
1910
+ *
1911
+ * ```ts
1912
+ * const preview = createPreviewBindings({
1913
+ * authorized: authorization !== null,
1914
+ * owner: `global:${slug}`,
1915
+ * });
1916
+ * ```
1917
+ * ```astro
1918
+ * <section {...preview.owner()}>
1919
+ * <h1 {...preview.bind<Homepage>('heroTitle')}>{data.heroTitle}</h1>
1920
+ * </section>
1921
+ * ```
1922
+ *
1923
+ * While unauthorized every helper returns an empty attribute set, so the
1924
+ * public response carries no `data-payload-*` at all.
1925
+ */
1926
+ declare function createPreviewBindings(options: PreviewBindingsOptions): PreviewBindings;
1927
+
1928
+ export { type AnalyticsSnapshot, type BindOptions, type BlockRenderContext, type BlockRenderer, type CachedElement, type CspDirectiveMerge, type DocumentSaveHandler, type DocumentSavePluginOptions, type DocumentSaveStrategy, EventEmitter, type EventHandler, type FetchPreviewDocumentOptions, type FetchPreviewGlobalOptions, type FieldBindingAttributes, type FieldName, type FieldPath, type FieldRenderer, type FieldTransform, type FieldType, type FrameAncestorsOptions, type InlineScriptConfig, LIBRARY_PROTOCOL_VERSION, type LexicalNode, type LexicalRoot, LivePreviewClient, type LivePreviewClientConfig, type LivePreviewEventMap, type LivePreviewPlugin, OriginDetector, type OwnerBindingAttributes, type PayloadFieldSchema, type PayloadFieldType, type PayloadLivePreviewData, type PayloadLivePreviewMessage, type PayloadMedia, type PayloadRelationship, type PluginContext, type PluginDisposer, type PluginEvents, type PreviewBindings, type PreviewBindingsOptions, type PreviewFetchBaseOptions, type PreviewRequestLike, type PreviewRequestOptions, type PreviewWhere, type ProtocolCapability, type ProtocolNegotiation, type RenderContext, type SanitizerDocument, type SuppressedBinding, type Unsubscribe, VERSION, type ValueAt, bind, bindByPath, buildBuiltinRenderers, buildFrameAncestors, buildScriptSrcWithNonce, createAnalyticsPlugin, createPreviewBindings, debugPlugin, detectInitialLocale, documentSavePlugin, escapeHtml, escapeHtmlAttribute, fetchPreviewDocument, fetchPreviewGlobal, generateCspNonce, generateInlineScript, hasCapability, highlightPlugin, initLivePreview, isDevMode, isExternalHttpUrl, isInIframe, isInPopup, isInPreviewContext, isLexicalContent, isPreviewRequest, isSafeUrl, lexicalToHtml, lexicalToPlainText, mergeCspHeader, negotiateProtocol, registerBlockRenderer, registerBuiltinRenderer, runtimeBuildInfo, sanitizeHtml, setCspCrypto, setSanitizerDocument, wrapWithScriptTag };
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.
@@ -1755,12 +1787,24 @@ interface FieldBindingAttributes {
1755
1787
  readonly 'data-payload-field': string;
1756
1788
  readonly 'data-payload-attribute'?: string;
1757
1789
  readonly 'data-payload-type'?: string;
1790
+ readonly 'data-payload-richtext'?: string;
1791
+ readonly 'data-payload-html'?: string;
1792
+ readonly 'data-payload-locale'?: string;
1758
1793
  }
1759
1794
  interface BindOptions {
1760
1795
  /** Override the bound attribute (e.g., `'src'` for `<img>`). Default: textContent. */
1761
1796
  readonly attribute?: string;
1762
1797
  /** Explicit field-type override — bypasses schema detection. */
1763
1798
  readonly type?: string;
1799
+ /**
1800
+ * Mark the binding as Lexical rich text. Usually detected automatically;
1801
+ * set it where the initial render is empty and there is nothing to detect.
1802
+ */
1803
+ readonly richtext?: boolean;
1804
+ /** Render the value as sanitised HTML rather than text. */
1805
+ readonly html?: boolean;
1806
+ /** Lock this element to one locale, overriding the message locale. */
1807
+ readonly locale?: string;
1764
1808
  }
1765
1809
  /**
1766
1810
  * String-literal binding helper.
@@ -1795,4 +1839,90 @@ declare function bind<T = Record<string, unknown>>(field: FieldName<T>, options?
1795
1839
  */
1796
1840
  declare function bindByPath<T = Record<string, unknown>>(picker: (data: T) => unknown, options?: BindOptions): FieldBindingAttributes;
1797
1841
 
1798
- export { type AnalyticsSnapshot, type BindOptions, type BlockRenderContext, type BlockRenderer, type CachedElement, type CspDirectiveMerge, type DocumentSaveHandler, type DocumentSavePluginOptions, type DocumentSaveStrategy, EventEmitter, type EventHandler, type FetchPreviewDocumentOptions, type FetchPreviewGlobalOptions, type FieldBindingAttributes, type FieldName, type FieldPath, type FieldRenderer, type FieldTransform, type FieldType, type FrameAncestorsOptions, type InlineScriptConfig, LIBRARY_PROTOCOL_VERSION, type LexicalNode, type LexicalRoot, LivePreviewClient, type LivePreviewClientConfig, type LivePreviewEventMap, type LivePreviewPlugin, OriginDetector, type PayloadFieldSchema, type PayloadFieldType, type PayloadLivePreviewData, type PayloadLivePreviewMessage, type PayloadMedia, type PayloadRelationship, type PluginContext, type PluginDisposer, type PluginEvents, type PreviewFetchBaseOptions, type PreviewRequestLike, type PreviewRequestOptions, type PreviewWhere, type ProtocolCapability, type ProtocolNegotiation, type RenderContext, type SanitizerDocument, type Unsubscribe, VERSION, type ValueAt, bind, bindByPath, buildBuiltinRenderers, buildFrameAncestors, buildScriptSrcWithNonce, createAnalyticsPlugin, debugPlugin, detectInitialLocale, documentSavePlugin, escapeHtml, escapeHtmlAttribute, fetchPreviewDocument, fetchPreviewGlobal, generateCspNonce, generateInlineScript, hasCapability, highlightPlugin, initLivePreview, isDevMode, isExternalHttpUrl, isInIframe, isInPopup, isInPreviewContext, isLexicalContent, isPreviewRequest, isSafeUrl, lexicalToHtml, lexicalToPlainText, mergeCspHeader, negotiateProtocol, registerBlockRenderer, registerBuiltinRenderer, runtimeBuildInfo, sanitizeHtml, setCspCrypto, setSanitizerDocument, wrapWithScriptTag };
1842
+ /**
1843
+ * Authorization-gated binding emission.
1844
+ *
1845
+ * Binding attributes are not neutral markup. `data-payload-field` names a CMS
1846
+ * field, and `data-payload-owner` names a global, a collection and often a
1847
+ * document id. Emitted unconditionally they publish the shape of the content
1848
+ * model — and the identity of documents — to every anonymous visitor and
1849
+ * crawler of the page.
1850
+ *
1851
+ * The gate belongs to the application, not to this package: it is the same
1852
+ * decision that already controls draft reads and cache policy. What this
1853
+ * module provides is a place to apply that decision **once per request** so no
1854
+ * individual call site can forget it, and an emission unit that cannot be
1855
+ * partially suppressed.
1856
+ *
1857
+ * That second property matters more than it looks. A binding is not one
1858
+ * attribute: a field travels with its type, its locale, its rich-text marker
1859
+ * and its owner. Gating only the field name leaves the companions behind,
1860
+ * which discloses the taxonomy anyway and leaves the runtime looking at a
1861
+ * binding whose field is gone.
1862
+ *
1863
+ * @module @dsl/preview-bindings
1864
+ */
1865
+
1866
+ /** Owner marker naming the document a subtree belongs to. */
1867
+ interface OwnerBindingAttributes {
1868
+ readonly 'data-payload-owner': string;
1869
+ }
1870
+ /**
1871
+ * The complete absence of binding attributes.
1872
+ *
1873
+ * Spreading this into markup contributes nothing, which is the point: an
1874
+ * unauthorized response must be byte-identical to one that never knew about
1875
+ * live preview.
1876
+ */
1877
+ type SuppressedBinding = Readonly<Record<string, never>>;
1878
+ interface PreviewBindingsOptions {
1879
+ /**
1880
+ * The application's own authorization verdict for this request.
1881
+ *
1882
+ * Never derive this from `?preview=true`, an iframe destination or a
1883
+ * referer — those are client-controlled intent signals. Use the same
1884
+ * verified result that decides whether drafts may be read.
1885
+ */
1886
+ readonly authorized: boolean;
1887
+ /**
1888
+ * Document this subtree belongs to, emitted as `data-payload-owner` by
1889
+ * {@link PreviewBindings.owner}. Required only when the page previews more
1890
+ * than one document and the runtime runs with `scopeBindingsByOwner`.
1891
+ */
1892
+ readonly owner?: string;
1893
+ }
1894
+ /** Request-scoped binding helpers that carry one authorization decision. */
1895
+ interface PreviewBindings {
1896
+ /** The verdict these helpers were built with. */
1897
+ readonly authorized: boolean;
1898
+ /** Typed field binding, or nothing at all while unauthorized. */
1899
+ bind: <T = Record<string, unknown>>(field: FieldName<T>, options?: BindOptions) => FieldBindingAttributes | SuppressedBinding;
1900
+ /** Rename-safe field binding, or nothing at all while unauthorized. */
1901
+ bindByPath: <T = Record<string, unknown>>(picker: (data: T) => unknown, options?: BindOptions) => FieldBindingAttributes | SuppressedBinding;
1902
+ /**
1903
+ * Owner marker for the element that owns this subtree, or nothing at all
1904
+ * while unauthorized or when no owner was configured.
1905
+ */
1906
+ owner: () => OwnerBindingAttributes | SuppressedBinding;
1907
+ }
1908
+ /**
1909
+ * Build request-scoped binding helpers around one authorization decision.
1910
+ *
1911
+ * ```ts
1912
+ * const preview = createPreviewBindings({
1913
+ * authorized: authorization !== null,
1914
+ * owner: `global:${slug}`,
1915
+ * });
1916
+ * ```
1917
+ * ```astro
1918
+ * <section {...preview.owner()}>
1919
+ * <h1 {...preview.bind<Homepage>('heroTitle')}>{data.heroTitle}</h1>
1920
+ * </section>
1921
+ * ```
1922
+ *
1923
+ * While unauthorized every helper returns an empty attribute set, so the
1924
+ * public response carries no `data-payload-*` at all.
1925
+ */
1926
+ declare function createPreviewBindings(options: PreviewBindingsOptions): PreviewBindings;
1927
+
1928
+ export { type AnalyticsSnapshot, type BindOptions, type BlockRenderContext, type BlockRenderer, type CachedElement, type CspDirectiveMerge, type DocumentSaveHandler, type DocumentSavePluginOptions, type DocumentSaveStrategy, EventEmitter, type EventHandler, type FetchPreviewDocumentOptions, type FetchPreviewGlobalOptions, type FieldBindingAttributes, type FieldName, type FieldPath, type FieldRenderer, type FieldTransform, type FieldType, type FrameAncestorsOptions, type InlineScriptConfig, LIBRARY_PROTOCOL_VERSION, type LexicalNode, type LexicalRoot, LivePreviewClient, type LivePreviewClientConfig, type LivePreviewEventMap, type LivePreviewPlugin, OriginDetector, type OwnerBindingAttributes, type PayloadFieldSchema, type PayloadFieldType, type PayloadLivePreviewData, type PayloadLivePreviewMessage, type PayloadMedia, type PayloadRelationship, type PluginContext, type PluginDisposer, type PluginEvents, type PreviewBindings, type PreviewBindingsOptions, type PreviewFetchBaseOptions, type PreviewRequestLike, type PreviewRequestOptions, type PreviewWhere, type ProtocolCapability, type ProtocolNegotiation, type RenderContext, type SanitizerDocument, type SuppressedBinding, type Unsubscribe, VERSION, type ValueAt, bind, bindByPath, buildBuiltinRenderers, buildFrameAncestors, buildScriptSrcWithNonce, createAnalyticsPlugin, createPreviewBindings, debugPlugin, detectInitialLocale, documentSavePlugin, escapeHtml, escapeHtmlAttribute, fetchPreviewDocument, fetchPreviewGlobal, generateCspNonce, generateInlineScript, hasCapability, highlightPlugin, initLivePreview, isDevMode, isExternalHttpUrl, isInIframe, isInPopup, isInPreviewContext, isLexicalContent, isPreviewRequest, isSafeUrl, lexicalToHtml, lexicalToPlainText, mergeCspHeader, negotiateProtocol, registerBlockRenderer, registerBuiltinRenderer, runtimeBuildInfo, sanitizeHtml, setCspCrypto, setSanitizerDocument, wrapWithScriptTag };