payload-live-preview 2.2.1 → 2.3.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 +21 -18
- 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 +141 -6
- package/dist/core.d.ts +141 -6
- 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-DGGLIijM.d.ts → fragment-endpoint-CQE_7MKi.d.ts} +5 -3
- 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 +79 -16
- package/dist/index.d.ts +79 -16
- 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 +23 -3
- package/dist/server.d.ts +23 -3
- package/dist/server.js +1 -1
- package/dist/server.js.map +1 -1
- package/dist/structural.cjs +2 -2
- package/dist/structural.cjs.map +1 -1
- package/dist/structural.d.cts +2 -0
- package/dist/structural.d.ts +2 -0
- package/dist/structural.js +1 -1
- package/dist/structural.js.map +1 -1
- package/package.json +7 -4
package/dist/core.d.cts
CHANGED
|
@@ -37,6 +37,8 @@ declare const DIAGNOSTIC_CODES: Readonly<{
|
|
|
37
37
|
readonly UnattributableUpdate: "LP0202";
|
|
38
38
|
/** An update carried a value for a field the page binds nowhere; editing it changes nothing on this page. */
|
|
39
39
|
readonly UnboundField: "LP0203";
|
|
40
|
+
/** In development: a bound path covers its group under the `descendant` default, which 3.0 changes. */
|
|
41
|
+
readonly CoverageDefaultChanges: "LP0204";
|
|
40
42
|
/** The visibility gate held offscreen writes back until they scroll into view. */
|
|
41
43
|
readonly VisibilityGateDeferred: "LP0301";
|
|
42
44
|
/** A value was refused because the attribute or the value itself is unsafe. */
|
|
@@ -61,7 +63,7 @@ declare const DIAGNOSTIC_CODES: Readonly<{
|
|
|
61
63
|
readonly UnrenderedBlockKept: "LP0410";
|
|
62
64
|
/** A patch cannot reach what the server would have drawn; `onUnfaithfulPatch` decided what happens next. */
|
|
63
65
|
readonly UnfaithfulPatch: "LP0411";
|
|
64
|
-
/** The first write to a date, number or
|
|
66
|
+
/** The first write to a date, number, checkbox, select or radio binding replaced a different reading of the same value. */
|
|
65
67
|
readonly ServerFormatReplaced: "LP0412";
|
|
66
68
|
/** A Lexical block has no renderer, and the write could not keep the markup the server rendered for it; it is gone. */
|
|
67
69
|
readonly UnrenderedBlockLost: "LP0413";
|
|
@@ -81,7 +83,7 @@ declare const DIAGNOSTIC_CODES: Readonly<{
|
|
|
81
83
|
readonly StartupFailed: "LP0605";
|
|
82
84
|
/** Sending the ready handshake failed. */
|
|
83
85
|
readonly ReadyFailed: "LP0606";
|
|
84
|
-
/** The page declared hydration, but no React commit, Vue mount
|
|
86
|
+
/** The page declared hydration, but no React commit, Vue mount, SvelteKit mount or `markHydrated()` call came within the cap; the runtime started without waiting. */
|
|
85
87
|
readonly HydrationWaitTimedOut: "LP0607";
|
|
86
88
|
/** The audit found no runtime in a response that carried preview intent. */
|
|
87
89
|
readonly AuditRuntimeMissing: "LP0701";
|
|
@@ -123,6 +125,8 @@ declare const DIAGNOSTIC_CODES: Readonly<{
|
|
|
123
125
|
readonly V2ReadinessGap: "LP0709";
|
|
124
126
|
/** The preview runtime is served to anonymous visitors, not only inside the admin frame. */
|
|
125
127
|
readonly RuntimeOnPublicPage: "LP0710";
|
|
128
|
+
/** An element carries attributes that only mean something beside `data-payload-field`, and has none. */
|
|
129
|
+
readonly AuditModifierWithoutField: "LP0711";
|
|
126
130
|
}>;
|
|
127
131
|
/** A diagnostic code, as it appears in log output and on the `error` event. */
|
|
128
132
|
type DiagnosticCode = (typeof DIAGNOSTIC_CODES)[keyof typeof DIAGNOSTIC_CODES];
|
|
@@ -209,8 +213,8 @@ interface SanitizeOptions {
|
|
|
209
213
|
/** Extra tags to allow. Lower-case, untrimmed. */
|
|
210
214
|
readonly additionalAllowedTags?: readonly string[];
|
|
211
215
|
/**
|
|
212
|
-
* Extra per-tag attributes, lower-case. Cannot re-admit handlers, `style`,
|
|
213
|
-
*
|
|
216
|
+
* Extra per-tag attributes, lower-case. Cannot re-admit handlers, `style`, or —
|
|
217
|
+
* under `'strict'` — `id`, `name` and `data-payload-*`; their URLs are checked.
|
|
214
218
|
*/
|
|
215
219
|
readonly additionalAllowedAttributes?: Readonly<Record<string, readonly string[]>>;
|
|
216
220
|
/**
|
|
@@ -345,6 +349,8 @@ interface RenderContext {
|
|
|
345
349
|
* completes the sentence 'field "x" …' in LP0411.
|
|
346
350
|
*/
|
|
347
351
|
readonly reportUnfaithful?: (target: CachedElement, reason: string) => void;
|
|
352
|
+
/** The route of a Lexical internal link, as `internalLinkPattern` gives it. */
|
|
353
|
+
readonly internalLinkPattern?: string;
|
|
348
354
|
}
|
|
349
355
|
/**
|
|
350
356
|
* A renderer writes one value into its element. It must not throw: one bad
|
|
@@ -851,7 +857,7 @@ interface LivePreviewInspection {
|
|
|
851
857
|
* SvelteKit page is not connected yet; `timed-out` is LP0607.
|
|
852
858
|
*/
|
|
853
859
|
readonly hydration: {
|
|
854
|
-
readonly mode: 'off' | 'react' | 'vue' | 'sveltekit';
|
|
860
|
+
readonly mode: 'off' | 'react' | 'vue' | 'sveltekit' | 'manual';
|
|
855
861
|
readonly state: 'idle' | 'waiting' | 'committed' | 'timed-out';
|
|
856
862
|
};
|
|
857
863
|
}
|
|
@@ -1004,6 +1010,12 @@ interface LivePreviewClientConfig {
|
|
|
1004
1010
|
readonly apiRoute?: string;
|
|
1005
1011
|
/** Population depth used with `serverURL`. Required with it; `defaults: 'v1'` falls back to `1`. */
|
|
1006
1012
|
readonly mergeDepth?: number;
|
|
1013
|
+
/** Milliseconds the `serverURL` merge may wait before the update shows its raw values. Off by default. */
|
|
1014
|
+
readonly mergeTimeoutMs?: number;
|
|
1015
|
+
/** The route of a Lexical internal link with no `url` of its own, as `/{locale}/{slug}/`. */
|
|
1016
|
+
readonly internalLinkPattern?: string;
|
|
1017
|
+
/** Hold a route render until Payload reports the save: the route shows what is saved. */
|
|
1018
|
+
readonly routeAfterSave?: boolean;
|
|
1007
1019
|
/** Custom fetch for the `serverURL` merge request: attach auth headers or route through a proxy. */
|
|
1008
1020
|
readonly mergeFetch?: typeof fetch;
|
|
1009
1021
|
/** Verbose console output. Defaults to dev-mode detection. */
|
|
@@ -1411,6 +1423,11 @@ interface FieldBindingAttributes {
|
|
|
1411
1423
|
readonly 'data-payload-alt'?: string;
|
|
1412
1424
|
readonly 'data-payload-href'?: string;
|
|
1413
1425
|
readonly 'data-payload-array-template'?: string;
|
|
1426
|
+
readonly 'data-payload-format'?: string;
|
|
1427
|
+
readonly 'data-payload-text'?: string;
|
|
1428
|
+
readonly 'data-payload-strategy'?: string;
|
|
1429
|
+
readonly 'data-payload-depends'?: string;
|
|
1430
|
+
readonly 'data-payload-boundary'?: string;
|
|
1414
1431
|
}
|
|
1415
1432
|
interface BindOptions {
|
|
1416
1433
|
/** Attribute to write instead of the text content, e.g. `'src'` for `<img>`. */
|
|
@@ -1429,6 +1446,19 @@ interface BindOptions {
|
|
|
1429
1446
|
readonly href?: string;
|
|
1430
1447
|
/** Markup per array item with `{{value}}` placeholders. */
|
|
1431
1448
|
readonly arrayTemplate?: string;
|
|
1449
|
+
/** How a date or number is written, from `data-payload-format`'s vocabulary. */
|
|
1450
|
+
readonly format?: string;
|
|
1451
|
+
/** Let a text write replace the element's children. */
|
|
1452
|
+
readonly text?: boolean;
|
|
1453
|
+
/** Who shows this field: the patch (default), a server-rendered fragment, or the route. */
|
|
1454
|
+
readonly strategy?: 'patch' | 'fragment' | 'route';
|
|
1455
|
+
/** Fields whose change re-applies this binding under `skipUnchanged`. */
|
|
1456
|
+
readonly dependsOn?: readonly string[];
|
|
1457
|
+
/**
|
|
1458
|
+
* An anchor for a field that may be empty, so an edit that fills it has somewhere to
|
|
1459
|
+
* land. Set `hidden` yourself while the value is empty; the runtime keeps it right after that.
|
|
1460
|
+
*/
|
|
1461
|
+
readonly anchor?: boolean;
|
|
1432
1462
|
}
|
|
1433
1463
|
/** `bind<Homepage>('heroTitle')`; without `T` any string is accepted. */
|
|
1434
1464
|
declare function bind<T = Record<string, unknown>>(field: FieldName<T>, options?: BindOptions): FieldBindingAttributes;
|
|
@@ -1514,6 +1544,111 @@ interface IslandUpdateDetail {
|
|
|
1514
1544
|
/** Whether `element` (or an ancestor) is an island that did not opt into patching. @internal */
|
|
1515
1545
|
declare function isInsideIsland(element: Element): boolean;
|
|
1516
1546
|
|
|
1547
|
+
/**
|
|
1548
|
+
* The document a framework hook exposes, kept outside any framework: the
|
|
1549
|
+
* message bus decides which windows may speak, `DataMerger` turns the admin's
|
|
1550
|
+
* raw form values back into a populated document, and this class holds the one
|
|
1551
|
+
* snapshot a `useSyncExternalStore`-shaped API reads.
|
|
1552
|
+
*
|
|
1553
|
+
* It touches no DOM. A hook that re-renders a component tree needs the data,
|
|
1554
|
+
* not the bindings — everything about elements lives in the runtime instead.
|
|
1555
|
+
*
|
|
1556
|
+
* The session is per instance (ADR 0002): two hooks on one page have two
|
|
1557
|
+
* mergers, two revisions and two snapshots, so a request or an error in one
|
|
1558
|
+
* never reaches the other. A session given a `document` merges only the
|
|
1559
|
+
* messages for that document; without one it follows the document the admin
|
|
1560
|
+
* sends, whichever document it started from.
|
|
1561
|
+
*/
|
|
1562
|
+
/**
|
|
1563
|
+
* `idle` — connected, nothing received yet. `live` — the newest update was
|
|
1564
|
+
* merged and is in `data`. `unavailable` — it could not be, and `data` is the
|
|
1565
|
+
* last good document rather than a half-merged one.
|
|
1566
|
+
*/
|
|
1567
|
+
type DocumentStatus = 'idle' | 'live' | 'unavailable';
|
|
1568
|
+
interface DocumentSnapshot<T> {
|
|
1569
|
+
/** The newest document that merged; never a partially applied one. */
|
|
1570
|
+
readonly data: T;
|
|
1571
|
+
/** No update has settled yet, or a merge is in flight. */
|
|
1572
|
+
readonly isLoading: boolean;
|
|
1573
|
+
readonly status: DocumentStatus;
|
|
1574
|
+
/** Why the last update did not merge; `undefined` while `status` is not `unavailable`. */
|
|
1575
|
+
readonly error: Error | undefined;
|
|
1576
|
+
/**
|
|
1577
|
+
* Which of this session's messages `data` came from: `0` for the initial
|
|
1578
|
+
* data, and unchanged when a merge fails. The framework paints `data` in its
|
|
1579
|
+
* own commit; a component that must know it was painted compares this in an
|
|
1580
|
+
* effect (ADR 0023).
|
|
1581
|
+
*/
|
|
1582
|
+
readonly revision: number;
|
|
1583
|
+
}
|
|
1584
|
+
/**
|
|
1585
|
+
* The document a session previews: a collection document by its id, or a global by its slug.
|
|
1586
|
+
* `locale` narrows it to the updates the admin sends for that locale.
|
|
1587
|
+
*/
|
|
1588
|
+
type PreviewDocument = {
|
|
1589
|
+
readonly collection: string;
|
|
1590
|
+
readonly id: string | number;
|
|
1591
|
+
readonly locale?: string;
|
|
1592
|
+
} | {
|
|
1593
|
+
readonly global: string;
|
|
1594
|
+
readonly locale?: string;
|
|
1595
|
+
};
|
|
1596
|
+
interface DocumentSessionOptions {
|
|
1597
|
+
/** Payload server origin the update is re-fetched from. */
|
|
1598
|
+
readonly serverURL: string;
|
|
1599
|
+
/** REST route prefix. Default `/api`. */
|
|
1600
|
+
readonly apiRoute?: string;
|
|
1601
|
+
/** Population depth for the merge. Default `1`, as Payload's own hook. */
|
|
1602
|
+
readonly depth?: number;
|
|
1603
|
+
/**
|
|
1604
|
+
* Milliseconds a merge may wait for the server; after that the update is `unavailable`
|
|
1605
|
+
* and `data` stays the last good document. Off by default: a merge waits as long as the
|
|
1606
|
+
* server takes.
|
|
1607
|
+
*/
|
|
1608
|
+
readonly timeoutMs?: number;
|
|
1609
|
+
/**
|
|
1610
|
+
* Admin origins allowed to post updates. Without one the session falls back
|
|
1611
|
+
* to the localhost matcher in development and trusts nothing in production.
|
|
1612
|
+
*/
|
|
1613
|
+
readonly allowedOrigins?: readonly string[];
|
|
1614
|
+
/** `'parent-or-opener'` (default) refuses every window but the framing or opening one. */
|
|
1615
|
+
readonly eventSourcePolicy?: 'any' | 'parent-or-opener';
|
|
1616
|
+
/** Trust `document.referrer` as an origin source. Default `false`. */
|
|
1617
|
+
readonly enableReferrerDetection?: boolean;
|
|
1618
|
+
/** Match `localhost` origins in development. Default `true`. */
|
|
1619
|
+
readonly enableLocalhostMatching?: boolean;
|
|
1620
|
+
/**
|
|
1621
|
+
* The document this session previews. An update for another document is ignored, and so is
|
|
1622
|
+
* one that does not say which document it is for: Payload 2 sends no collection or global
|
|
1623
|
+
* slug, and a create screen has no id yet. Without it the session merges every update.
|
|
1624
|
+
*/
|
|
1625
|
+
readonly document?: PreviewDocument;
|
|
1626
|
+
/** Injected for tests. */
|
|
1627
|
+
readonly fetchFn?: typeof fetch;
|
|
1628
|
+
/** Window to listen on. Default the global one. */
|
|
1629
|
+
readonly target?: Window;
|
|
1630
|
+
}
|
|
1631
|
+
type Listener = () => void;
|
|
1632
|
+
declare class DocumentSession<T> {
|
|
1633
|
+
#private;
|
|
1634
|
+
constructor(initialData: T, options: DocumentSessionOptions);
|
|
1635
|
+
/**
|
|
1636
|
+
* Attach on the first subscriber and detach with the last, so a component
|
|
1637
|
+
* that mounts twice (React's strict mode) listens once and a page that
|
|
1638
|
+
* unmounts the hook stops listening at all.
|
|
1639
|
+
*/
|
|
1640
|
+
subscribe: (listener: Listener) => (() => void);
|
|
1641
|
+
getSnapshot: () => DocumentSnapshot<T>;
|
|
1642
|
+
/** Server rendering has no window and no messages: the initial snapshot a client render starts from. */
|
|
1643
|
+
getServerSnapshot: () => DocumentSnapshot<T>;
|
|
1644
|
+
}
|
|
1645
|
+
/**
|
|
1646
|
+
* One preview document, with no framework around it: `subscribe` and `getSnapshot`
|
|
1647
|
+
* fit a `useSyncExternalStore` or a Svelte store.
|
|
1648
|
+
* @beta
|
|
1649
|
+
*/
|
|
1650
|
+
declare function createDocumentSession<T extends Record<string, unknown>>(initialData: T, options: DocumentSessionOptions): DocumentSession<T>;
|
|
1651
|
+
|
|
1517
1652
|
/**
|
|
1518
1653
|
* Narrow public entry — the minimum API for sites that only need to
|
|
1519
1654
|
* receive postMessage updates and apply them to the DOM.
|
|
@@ -1536,4 +1671,4 @@ declare function isInsideIsland(element: Element): boolean;
|
|
|
1536
1671
|
/** @internal */
|
|
1537
1672
|
declare const CORE_ENTRY = true;
|
|
1538
1673
|
|
|
1539
|
-
export { AUTHORIZED_PREVIEW_BRAND_KEY, type AuthorizedPreviewContext, type AuthorizedPreviewDocument, type AuthorizedPreviewPayloadScope, type AuthorizedPreviewScope, type BindOptions, CAPABILITY_DECLARATIONS, CAPABILITY_DOCUMENTATION, CORE_ENTRY, type CachedElement, type CapabilityDeclaration, type CapabilityDocumentation, type CapabilitySource, type ConnectionStatus, type CustomRendererKey, DIAGNOSTIC_CODES, type DefaultsProfile, type DiagnosticCode, EventEmitter, type EventHandler, type EventSourcePolicy, type FieldBindingAttributes, type FieldName, type FieldPath, type FieldRenderer, type FieldType, type FragmentBoundaryAttributes, type FragmentBoundaryOptions, type FragmentContext, type FragmentReport, type FragmentStrategy, type FrameAncestorsOptions, ISLAND_EVENT, type InspectionBindings, type InspectionFidelity, type InspectionFragments, type InspectionOrigins, type InspectionProtocol, type InspectionRevisions, type InspectionRoute, type InspectionScheduler, type IslandUpdateDetail, LIBRARY_PROTOCOL_VERSION, LivePreviewClient, type LivePreviewClientConfig, type LivePreviewEventMap, type LivePreviewInspection, OriginDetector, type OwnerBindingAttributes, PROTOCOL_CAPABILITIES, type PayloadDocumentEventDetail, type PayloadFieldCondition, type PayloadFieldSchema, type PayloadFieldType, type PayloadLivePreviewData, type PayloadLivePreviewMessage, type PluginCompatibility, type PluginInspection, type PreviewAuthorizationStrategyName, type PreviewBindings, type PreviewBindingsOptions, type ProtocolCapability, type ProtocolNegotiation, type ProtocolProfile, type ProtocolProfileName, type RenderContext, type RendererKey, type RevisionDisplay, type RevisionDisplayState, type RevisionShortfall, type RichTextRenderer, type RouteContext, type RouteOutcome, type RoutePlanContext, type RouteRefresh, type RouteStrategy, type SanitizerDocument, type SanitizerPolicyMode, type StrategyHandlers, type SuppressedBinding, type Unsubscribe, type UpdateSource, VERSION, type ValueAt, bind, bindByPath, buildFrameAncestors, buildScriptSrcWithNonce, createPreviewBindings, detectInitialLocale, detectProtocolProfile, escapeHtml, escapeHtmlAttribute, generateCspNonce, hasCapability, initLivePreview, isAuthorizedPreviewContext, isDevMode, isExternalHttpUrl, isInIframe, isInPopup, isInPreviewContext, isInsideIsland, isSafeUrl, negotiateProtocol, registerRouteRefresh, sanitizeHtml, setCspCrypto, setSanitizerDocument };
|
|
1674
|
+
export { AUTHORIZED_PREVIEW_BRAND_KEY, type AuthorizedPreviewContext, type AuthorizedPreviewDocument, type AuthorizedPreviewPayloadScope, type AuthorizedPreviewScope, type BindOptions, CAPABILITY_DECLARATIONS, CAPABILITY_DOCUMENTATION, CORE_ENTRY, type CachedElement, type CapabilityDeclaration, type CapabilityDocumentation, type CapabilitySource, type ConnectionStatus, type CustomRendererKey, DIAGNOSTIC_CODES, type DefaultsProfile, type DiagnosticCode, DocumentSession, type DocumentSessionOptions, type DocumentSnapshot, type DocumentStatus, EventEmitter, type EventHandler, type EventSourcePolicy, type FieldBindingAttributes, type FieldName, type FieldPath, type FieldRenderer, type FieldType, type FragmentBoundaryAttributes, type FragmentBoundaryOptions, type FragmentContext, type FragmentReport, type FragmentStrategy, type FrameAncestorsOptions, ISLAND_EVENT, type InspectionBindings, type InspectionFidelity, type InspectionFragments, type InspectionOrigins, type InspectionProtocol, type InspectionRevisions, type InspectionRoute, type InspectionScheduler, type IslandUpdateDetail, LIBRARY_PROTOCOL_VERSION, LivePreviewClient, type LivePreviewClientConfig, type LivePreviewEventMap, type LivePreviewInspection, OriginDetector, type OwnerBindingAttributes, PROTOCOL_CAPABILITIES, type PayloadDocumentEventDetail, type PayloadFieldCondition, type PayloadFieldSchema, type PayloadFieldType, type PayloadLivePreviewData, type PayloadLivePreviewMessage, type PluginCompatibility, type PluginInspection, type PreviewAuthorizationStrategyName, type PreviewBindings, type PreviewBindingsOptions, type PreviewDocument, type ProtocolCapability, type ProtocolNegotiation, type ProtocolProfile, type ProtocolProfileName, type RenderContext, type RendererKey, type RevisionDisplay, type RevisionDisplayState, type RevisionShortfall, type RichTextRenderer, type RouteContext, type RouteOutcome, type RoutePlanContext, type RouteRefresh, type RouteStrategy, type SanitizerDocument, type SanitizerPolicyMode, type StrategyHandlers, type SuppressedBinding, type Unsubscribe, type UpdateSource, VERSION, type ValueAt, bind, bindByPath, buildFrameAncestors, buildScriptSrcWithNonce, createDocumentSession, createPreviewBindings, detectInitialLocale, detectProtocolProfile, escapeHtml, escapeHtmlAttribute, generateCspNonce, hasCapability, initLivePreview, isAuthorizedPreviewContext, isDevMode, isExternalHttpUrl, isInIframe, isInPopup, isInPreviewContext, isInsideIsland, isSafeUrl, negotiateProtocol, registerRouteRefresh, sanitizeHtml, setCspCrypto, setSanitizerDocument };
|
package/dist/core.d.ts
CHANGED
|
@@ -37,6 +37,8 @@ declare const DIAGNOSTIC_CODES: Readonly<{
|
|
|
37
37
|
readonly UnattributableUpdate: "LP0202";
|
|
38
38
|
/** An update carried a value for a field the page binds nowhere; editing it changes nothing on this page. */
|
|
39
39
|
readonly UnboundField: "LP0203";
|
|
40
|
+
/** In development: a bound path covers its group under the `descendant` default, which 3.0 changes. */
|
|
41
|
+
readonly CoverageDefaultChanges: "LP0204";
|
|
40
42
|
/** The visibility gate held offscreen writes back until they scroll into view. */
|
|
41
43
|
readonly VisibilityGateDeferred: "LP0301";
|
|
42
44
|
/** A value was refused because the attribute or the value itself is unsafe. */
|
|
@@ -61,7 +63,7 @@ declare const DIAGNOSTIC_CODES: Readonly<{
|
|
|
61
63
|
readonly UnrenderedBlockKept: "LP0410";
|
|
62
64
|
/** A patch cannot reach what the server would have drawn; `onUnfaithfulPatch` decided what happens next. */
|
|
63
65
|
readonly UnfaithfulPatch: "LP0411";
|
|
64
|
-
/** The first write to a date, number or
|
|
66
|
+
/** The first write to a date, number, checkbox, select or radio binding replaced a different reading of the same value. */
|
|
65
67
|
readonly ServerFormatReplaced: "LP0412";
|
|
66
68
|
/** A Lexical block has no renderer, and the write could not keep the markup the server rendered for it; it is gone. */
|
|
67
69
|
readonly UnrenderedBlockLost: "LP0413";
|
|
@@ -81,7 +83,7 @@ declare const DIAGNOSTIC_CODES: Readonly<{
|
|
|
81
83
|
readonly StartupFailed: "LP0605";
|
|
82
84
|
/** Sending the ready handshake failed. */
|
|
83
85
|
readonly ReadyFailed: "LP0606";
|
|
84
|
-
/** The page declared hydration, but no React commit, Vue mount
|
|
86
|
+
/** The page declared hydration, but no React commit, Vue mount, SvelteKit mount or `markHydrated()` call came within the cap; the runtime started without waiting. */
|
|
85
87
|
readonly HydrationWaitTimedOut: "LP0607";
|
|
86
88
|
/** The audit found no runtime in a response that carried preview intent. */
|
|
87
89
|
readonly AuditRuntimeMissing: "LP0701";
|
|
@@ -123,6 +125,8 @@ declare const DIAGNOSTIC_CODES: Readonly<{
|
|
|
123
125
|
readonly V2ReadinessGap: "LP0709";
|
|
124
126
|
/** The preview runtime is served to anonymous visitors, not only inside the admin frame. */
|
|
125
127
|
readonly RuntimeOnPublicPage: "LP0710";
|
|
128
|
+
/** An element carries attributes that only mean something beside `data-payload-field`, and has none. */
|
|
129
|
+
readonly AuditModifierWithoutField: "LP0711";
|
|
126
130
|
}>;
|
|
127
131
|
/** A diagnostic code, as it appears in log output and on the `error` event. */
|
|
128
132
|
type DiagnosticCode = (typeof DIAGNOSTIC_CODES)[keyof typeof DIAGNOSTIC_CODES];
|
|
@@ -209,8 +213,8 @@ interface SanitizeOptions {
|
|
|
209
213
|
/** Extra tags to allow. Lower-case, untrimmed. */
|
|
210
214
|
readonly additionalAllowedTags?: readonly string[];
|
|
211
215
|
/**
|
|
212
|
-
* Extra per-tag attributes, lower-case. Cannot re-admit handlers, `style`,
|
|
213
|
-
*
|
|
216
|
+
* Extra per-tag attributes, lower-case. Cannot re-admit handlers, `style`, or —
|
|
217
|
+
* under `'strict'` — `id`, `name` and `data-payload-*`; their URLs are checked.
|
|
214
218
|
*/
|
|
215
219
|
readonly additionalAllowedAttributes?: Readonly<Record<string, readonly string[]>>;
|
|
216
220
|
/**
|
|
@@ -345,6 +349,8 @@ interface RenderContext {
|
|
|
345
349
|
* completes the sentence 'field "x" …' in LP0411.
|
|
346
350
|
*/
|
|
347
351
|
readonly reportUnfaithful?: (target: CachedElement, reason: string) => void;
|
|
352
|
+
/** The route of a Lexical internal link, as `internalLinkPattern` gives it. */
|
|
353
|
+
readonly internalLinkPattern?: string;
|
|
348
354
|
}
|
|
349
355
|
/**
|
|
350
356
|
* A renderer writes one value into its element. It must not throw: one bad
|
|
@@ -851,7 +857,7 @@ interface LivePreviewInspection {
|
|
|
851
857
|
* SvelteKit page is not connected yet; `timed-out` is LP0607.
|
|
852
858
|
*/
|
|
853
859
|
readonly hydration: {
|
|
854
|
-
readonly mode: 'off' | 'react' | 'vue' | 'sveltekit';
|
|
860
|
+
readonly mode: 'off' | 'react' | 'vue' | 'sveltekit' | 'manual';
|
|
855
861
|
readonly state: 'idle' | 'waiting' | 'committed' | 'timed-out';
|
|
856
862
|
};
|
|
857
863
|
}
|
|
@@ -1004,6 +1010,12 @@ interface LivePreviewClientConfig {
|
|
|
1004
1010
|
readonly apiRoute?: string;
|
|
1005
1011
|
/** Population depth used with `serverURL`. Required with it; `defaults: 'v1'` falls back to `1`. */
|
|
1006
1012
|
readonly mergeDepth?: number;
|
|
1013
|
+
/** Milliseconds the `serverURL` merge may wait before the update shows its raw values. Off by default. */
|
|
1014
|
+
readonly mergeTimeoutMs?: number;
|
|
1015
|
+
/** The route of a Lexical internal link with no `url` of its own, as `/{locale}/{slug}/`. */
|
|
1016
|
+
readonly internalLinkPattern?: string;
|
|
1017
|
+
/** Hold a route render until Payload reports the save: the route shows what is saved. */
|
|
1018
|
+
readonly routeAfterSave?: boolean;
|
|
1007
1019
|
/** Custom fetch for the `serverURL` merge request: attach auth headers or route through a proxy. */
|
|
1008
1020
|
readonly mergeFetch?: typeof fetch;
|
|
1009
1021
|
/** Verbose console output. Defaults to dev-mode detection. */
|
|
@@ -1411,6 +1423,11 @@ interface FieldBindingAttributes {
|
|
|
1411
1423
|
readonly 'data-payload-alt'?: string;
|
|
1412
1424
|
readonly 'data-payload-href'?: string;
|
|
1413
1425
|
readonly 'data-payload-array-template'?: string;
|
|
1426
|
+
readonly 'data-payload-format'?: string;
|
|
1427
|
+
readonly 'data-payload-text'?: string;
|
|
1428
|
+
readonly 'data-payload-strategy'?: string;
|
|
1429
|
+
readonly 'data-payload-depends'?: string;
|
|
1430
|
+
readonly 'data-payload-boundary'?: string;
|
|
1414
1431
|
}
|
|
1415
1432
|
interface BindOptions {
|
|
1416
1433
|
/** Attribute to write instead of the text content, e.g. `'src'` for `<img>`. */
|
|
@@ -1429,6 +1446,19 @@ interface BindOptions {
|
|
|
1429
1446
|
readonly href?: string;
|
|
1430
1447
|
/** Markup per array item with `{{value}}` placeholders. */
|
|
1431
1448
|
readonly arrayTemplate?: string;
|
|
1449
|
+
/** How a date or number is written, from `data-payload-format`'s vocabulary. */
|
|
1450
|
+
readonly format?: string;
|
|
1451
|
+
/** Let a text write replace the element's children. */
|
|
1452
|
+
readonly text?: boolean;
|
|
1453
|
+
/** Who shows this field: the patch (default), a server-rendered fragment, or the route. */
|
|
1454
|
+
readonly strategy?: 'patch' | 'fragment' | 'route';
|
|
1455
|
+
/** Fields whose change re-applies this binding under `skipUnchanged`. */
|
|
1456
|
+
readonly dependsOn?: readonly string[];
|
|
1457
|
+
/**
|
|
1458
|
+
* An anchor for a field that may be empty, so an edit that fills it has somewhere to
|
|
1459
|
+
* land. Set `hidden` yourself while the value is empty; the runtime keeps it right after that.
|
|
1460
|
+
*/
|
|
1461
|
+
readonly anchor?: boolean;
|
|
1432
1462
|
}
|
|
1433
1463
|
/** `bind<Homepage>('heroTitle')`; without `T` any string is accepted. */
|
|
1434
1464
|
declare function bind<T = Record<string, unknown>>(field: FieldName<T>, options?: BindOptions): FieldBindingAttributes;
|
|
@@ -1514,6 +1544,111 @@ interface IslandUpdateDetail {
|
|
|
1514
1544
|
/** Whether `element` (or an ancestor) is an island that did not opt into patching. @internal */
|
|
1515
1545
|
declare function isInsideIsland(element: Element): boolean;
|
|
1516
1546
|
|
|
1547
|
+
/**
|
|
1548
|
+
* The document a framework hook exposes, kept outside any framework: the
|
|
1549
|
+
* message bus decides which windows may speak, `DataMerger` turns the admin's
|
|
1550
|
+
* raw form values back into a populated document, and this class holds the one
|
|
1551
|
+
* snapshot a `useSyncExternalStore`-shaped API reads.
|
|
1552
|
+
*
|
|
1553
|
+
* It touches no DOM. A hook that re-renders a component tree needs the data,
|
|
1554
|
+
* not the bindings — everything about elements lives in the runtime instead.
|
|
1555
|
+
*
|
|
1556
|
+
* The session is per instance (ADR 0002): two hooks on one page have two
|
|
1557
|
+
* mergers, two revisions and two snapshots, so a request or an error in one
|
|
1558
|
+
* never reaches the other. A session given a `document` merges only the
|
|
1559
|
+
* messages for that document; without one it follows the document the admin
|
|
1560
|
+
* sends, whichever document it started from.
|
|
1561
|
+
*/
|
|
1562
|
+
/**
|
|
1563
|
+
* `idle` — connected, nothing received yet. `live` — the newest update was
|
|
1564
|
+
* merged and is in `data`. `unavailable` — it could not be, and `data` is the
|
|
1565
|
+
* last good document rather than a half-merged one.
|
|
1566
|
+
*/
|
|
1567
|
+
type DocumentStatus = 'idle' | 'live' | 'unavailable';
|
|
1568
|
+
interface DocumentSnapshot<T> {
|
|
1569
|
+
/** The newest document that merged; never a partially applied one. */
|
|
1570
|
+
readonly data: T;
|
|
1571
|
+
/** No update has settled yet, or a merge is in flight. */
|
|
1572
|
+
readonly isLoading: boolean;
|
|
1573
|
+
readonly status: DocumentStatus;
|
|
1574
|
+
/** Why the last update did not merge; `undefined` while `status` is not `unavailable`. */
|
|
1575
|
+
readonly error: Error | undefined;
|
|
1576
|
+
/**
|
|
1577
|
+
* Which of this session's messages `data` came from: `0` for the initial
|
|
1578
|
+
* data, and unchanged when a merge fails. The framework paints `data` in its
|
|
1579
|
+
* own commit; a component that must know it was painted compares this in an
|
|
1580
|
+
* effect (ADR 0023).
|
|
1581
|
+
*/
|
|
1582
|
+
readonly revision: number;
|
|
1583
|
+
}
|
|
1584
|
+
/**
|
|
1585
|
+
* The document a session previews: a collection document by its id, or a global by its slug.
|
|
1586
|
+
* `locale` narrows it to the updates the admin sends for that locale.
|
|
1587
|
+
*/
|
|
1588
|
+
type PreviewDocument = {
|
|
1589
|
+
readonly collection: string;
|
|
1590
|
+
readonly id: string | number;
|
|
1591
|
+
readonly locale?: string;
|
|
1592
|
+
} | {
|
|
1593
|
+
readonly global: string;
|
|
1594
|
+
readonly locale?: string;
|
|
1595
|
+
};
|
|
1596
|
+
interface DocumentSessionOptions {
|
|
1597
|
+
/** Payload server origin the update is re-fetched from. */
|
|
1598
|
+
readonly serverURL: string;
|
|
1599
|
+
/** REST route prefix. Default `/api`. */
|
|
1600
|
+
readonly apiRoute?: string;
|
|
1601
|
+
/** Population depth for the merge. Default `1`, as Payload's own hook. */
|
|
1602
|
+
readonly depth?: number;
|
|
1603
|
+
/**
|
|
1604
|
+
* Milliseconds a merge may wait for the server; after that the update is `unavailable`
|
|
1605
|
+
* and `data` stays the last good document. Off by default: a merge waits as long as the
|
|
1606
|
+
* server takes.
|
|
1607
|
+
*/
|
|
1608
|
+
readonly timeoutMs?: number;
|
|
1609
|
+
/**
|
|
1610
|
+
* Admin origins allowed to post updates. Without one the session falls back
|
|
1611
|
+
* to the localhost matcher in development and trusts nothing in production.
|
|
1612
|
+
*/
|
|
1613
|
+
readonly allowedOrigins?: readonly string[];
|
|
1614
|
+
/** `'parent-or-opener'` (default) refuses every window but the framing or opening one. */
|
|
1615
|
+
readonly eventSourcePolicy?: 'any' | 'parent-or-opener';
|
|
1616
|
+
/** Trust `document.referrer` as an origin source. Default `false`. */
|
|
1617
|
+
readonly enableReferrerDetection?: boolean;
|
|
1618
|
+
/** Match `localhost` origins in development. Default `true`. */
|
|
1619
|
+
readonly enableLocalhostMatching?: boolean;
|
|
1620
|
+
/**
|
|
1621
|
+
* The document this session previews. An update for another document is ignored, and so is
|
|
1622
|
+
* one that does not say which document it is for: Payload 2 sends no collection or global
|
|
1623
|
+
* slug, and a create screen has no id yet. Without it the session merges every update.
|
|
1624
|
+
*/
|
|
1625
|
+
readonly document?: PreviewDocument;
|
|
1626
|
+
/** Injected for tests. */
|
|
1627
|
+
readonly fetchFn?: typeof fetch;
|
|
1628
|
+
/** Window to listen on. Default the global one. */
|
|
1629
|
+
readonly target?: Window;
|
|
1630
|
+
}
|
|
1631
|
+
type Listener = () => void;
|
|
1632
|
+
declare class DocumentSession<T> {
|
|
1633
|
+
#private;
|
|
1634
|
+
constructor(initialData: T, options: DocumentSessionOptions);
|
|
1635
|
+
/**
|
|
1636
|
+
* Attach on the first subscriber and detach with the last, so a component
|
|
1637
|
+
* that mounts twice (React's strict mode) listens once and a page that
|
|
1638
|
+
* unmounts the hook stops listening at all.
|
|
1639
|
+
*/
|
|
1640
|
+
subscribe: (listener: Listener) => (() => void);
|
|
1641
|
+
getSnapshot: () => DocumentSnapshot<T>;
|
|
1642
|
+
/** Server rendering has no window and no messages: the initial snapshot a client render starts from. */
|
|
1643
|
+
getServerSnapshot: () => DocumentSnapshot<T>;
|
|
1644
|
+
}
|
|
1645
|
+
/**
|
|
1646
|
+
* One preview document, with no framework around it: `subscribe` and `getSnapshot`
|
|
1647
|
+
* fit a `useSyncExternalStore` or a Svelte store.
|
|
1648
|
+
* @beta
|
|
1649
|
+
*/
|
|
1650
|
+
declare function createDocumentSession<T extends Record<string, unknown>>(initialData: T, options: DocumentSessionOptions): DocumentSession<T>;
|
|
1651
|
+
|
|
1517
1652
|
/**
|
|
1518
1653
|
* Narrow public entry — the minimum API for sites that only need to
|
|
1519
1654
|
* receive postMessage updates and apply them to the DOM.
|
|
@@ -1536,4 +1671,4 @@ declare function isInsideIsland(element: Element): boolean;
|
|
|
1536
1671
|
/** @internal */
|
|
1537
1672
|
declare const CORE_ENTRY = true;
|
|
1538
1673
|
|
|
1539
|
-
export { AUTHORIZED_PREVIEW_BRAND_KEY, type AuthorizedPreviewContext, type AuthorizedPreviewDocument, type AuthorizedPreviewPayloadScope, type AuthorizedPreviewScope, type BindOptions, CAPABILITY_DECLARATIONS, CAPABILITY_DOCUMENTATION, CORE_ENTRY, type CachedElement, type CapabilityDeclaration, type CapabilityDocumentation, type CapabilitySource, type ConnectionStatus, type CustomRendererKey, DIAGNOSTIC_CODES, type DefaultsProfile, type DiagnosticCode, EventEmitter, type EventHandler, type EventSourcePolicy, type FieldBindingAttributes, type FieldName, type FieldPath, type FieldRenderer, type FieldType, type FragmentBoundaryAttributes, type FragmentBoundaryOptions, type FragmentContext, type FragmentReport, type FragmentStrategy, type FrameAncestorsOptions, ISLAND_EVENT, type InspectionBindings, type InspectionFidelity, type InspectionFragments, type InspectionOrigins, type InspectionProtocol, type InspectionRevisions, type InspectionRoute, type InspectionScheduler, type IslandUpdateDetail, LIBRARY_PROTOCOL_VERSION, LivePreviewClient, type LivePreviewClientConfig, type LivePreviewEventMap, type LivePreviewInspection, OriginDetector, type OwnerBindingAttributes, PROTOCOL_CAPABILITIES, type PayloadDocumentEventDetail, type PayloadFieldCondition, type PayloadFieldSchema, type PayloadFieldType, type PayloadLivePreviewData, type PayloadLivePreviewMessage, type PluginCompatibility, type PluginInspection, type PreviewAuthorizationStrategyName, type PreviewBindings, type PreviewBindingsOptions, type ProtocolCapability, type ProtocolNegotiation, type ProtocolProfile, type ProtocolProfileName, type RenderContext, type RendererKey, type RevisionDisplay, type RevisionDisplayState, type RevisionShortfall, type RichTextRenderer, type RouteContext, type RouteOutcome, type RoutePlanContext, type RouteRefresh, type RouteStrategy, type SanitizerDocument, type SanitizerPolicyMode, type StrategyHandlers, type SuppressedBinding, type Unsubscribe, type UpdateSource, VERSION, type ValueAt, bind, bindByPath, buildFrameAncestors, buildScriptSrcWithNonce, createPreviewBindings, detectInitialLocale, detectProtocolProfile, escapeHtml, escapeHtmlAttribute, generateCspNonce, hasCapability, initLivePreview, isAuthorizedPreviewContext, isDevMode, isExternalHttpUrl, isInIframe, isInPopup, isInPreviewContext, isInsideIsland, isSafeUrl, negotiateProtocol, registerRouteRefresh, sanitizeHtml, setCspCrypto, setSanitizerDocument };
|
|
1674
|
+
export { AUTHORIZED_PREVIEW_BRAND_KEY, type AuthorizedPreviewContext, type AuthorizedPreviewDocument, type AuthorizedPreviewPayloadScope, type AuthorizedPreviewScope, type BindOptions, CAPABILITY_DECLARATIONS, CAPABILITY_DOCUMENTATION, CORE_ENTRY, type CachedElement, type CapabilityDeclaration, type CapabilityDocumentation, type CapabilitySource, type ConnectionStatus, type CustomRendererKey, DIAGNOSTIC_CODES, type DefaultsProfile, type DiagnosticCode, DocumentSession, type DocumentSessionOptions, type DocumentSnapshot, type DocumentStatus, EventEmitter, type EventHandler, type EventSourcePolicy, type FieldBindingAttributes, type FieldName, type FieldPath, type FieldRenderer, type FieldType, type FragmentBoundaryAttributes, type FragmentBoundaryOptions, type FragmentContext, type FragmentReport, type FragmentStrategy, type FrameAncestorsOptions, ISLAND_EVENT, type InspectionBindings, type InspectionFidelity, type InspectionFragments, type InspectionOrigins, type InspectionProtocol, type InspectionRevisions, type InspectionRoute, type InspectionScheduler, type IslandUpdateDetail, LIBRARY_PROTOCOL_VERSION, LivePreviewClient, type LivePreviewClientConfig, type LivePreviewEventMap, type LivePreviewInspection, OriginDetector, type OwnerBindingAttributes, PROTOCOL_CAPABILITIES, type PayloadDocumentEventDetail, type PayloadFieldCondition, type PayloadFieldSchema, type PayloadFieldType, type PayloadLivePreviewData, type PayloadLivePreviewMessage, type PluginCompatibility, type PluginInspection, type PreviewAuthorizationStrategyName, type PreviewBindings, type PreviewBindingsOptions, type PreviewDocument, type ProtocolCapability, type ProtocolNegotiation, type ProtocolProfile, type ProtocolProfileName, type RenderContext, type RendererKey, type RevisionDisplay, type RevisionDisplayState, type RevisionShortfall, type RichTextRenderer, type RouteContext, type RouteOutcome, type RoutePlanContext, type RouteRefresh, type RouteStrategy, type SanitizerDocument, type SanitizerPolicyMode, type StrategyHandlers, type SuppressedBinding, type Unsubscribe, type UpdateSource, VERSION, type ValueAt, bind, bindByPath, buildFrameAncestors, buildScriptSrcWithNonce, createDocumentSession, createPreviewBindings, detectInitialLocale, detectProtocolProfile, escapeHtml, escapeHtmlAttribute, generateCspNonce, hasCapability, initLivePreview, isAuthorizedPreviewContext, isDevMode, isExternalHttpUrl, isInIframe, isInPopup, isInPreviewContext, isInsideIsland, isSafeUrl, negotiateProtocol, registerRouteRefresh, sanitizeHtml, setCspCrypto, setSanitizerDocument };
|