payload-live-preview 1.5.0 → 1.7.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.
@@ -9,6 +9,11 @@ interface LivePreviewAstroOptions {
9
9
  *
10
10
  * - `'inline'` (default) — bake the runtime into every page at
11
11
  * build time. For `output: 'static'` projects.
12
+ * - `'loader'` — inject a few hundred bytes that check the preview
13
+ * context and fetch the runtime as a hashed, SRI-verified asset only
14
+ * when it is one. Also for `output: 'static'`, and the better choice
15
+ * there: `'inline'` charges every ordinary visitor ~21 KB gzip for a
16
+ * feature only an editor uses.
12
17
  * - `'middleware'` — auto-register the preview middleware:
13
18
  * request-time injection into requests with preview intent,
14
19
  * plus `frame-ancestors` CSP management. For `output: 'server'`.
@@ -19,7 +24,7 @@ interface LivePreviewAstroOptions {
19
24
  * must be access-controlled, compose `createLivePreviewMiddleware()`
20
25
  * manually after an application-owned server-side authorization.
21
26
  */
22
- readonly mode?: 'inline' | 'middleware';
27
+ readonly mode?: 'inline' | 'loader' | 'middleware';
23
28
  /**
24
29
  * Allowed Payload admin origin(s) for inbound browser messages and
25
30
  * the optional Referer intent signal. This does not authenticate the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "payload-live-preview",
3
- "version": "1.5.0",
3
+ "version": "1.7.0",
4
4
  "description": "Live preview for Payload CMS in Astro and any SSR/static frontend (SvelteKit, Nuxt, Next.js, plain HTML). Patches the DOM live, no rebuild.",
5
5
  "author": "relative23",
6
6
  "license": "MIT",