@decocms/blocks 8.14.0 → 8.15.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/package.json
CHANGED
|
@@ -37,9 +37,11 @@ layout from being cached.
|
|
|
37
37
|
|
|
38
38
|
## What it does
|
|
39
39
|
|
|
40
|
-
- **The
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
- **The shortcut script** listens for the "." shortcut, only outside a frame.
|
|
41
|
+
It answers no message: v8 only, v7's framed handler (scroll-to-section,
|
|
42
|
+
rerender) is gone, so no script on the page compares the window with `top`
|
|
43
|
+
or `parent`, and a test runner that rewrites "frame-busting" code (Cypress)
|
|
44
|
+
serves the page as is.
|
|
43
45
|
- **The Studio channel** runs on every page, production included (about
|
|
44
46
|
0.7 kB gzipped). Framed by a trusted origin, it posts `{ type: "deco:ready" }`
|
|
45
47
|
and imports a module only when the answer `{ type: "deco:load", url }`
|
|
@@ -50,7 +50,7 @@ What else it mounts:
|
|
|
50
50
|
after hydration. Work that must follow hydration waits for it.
|
|
51
51
|
- `NavigationProgress` and `StableOutlet` ([`router-and-navigation.md`](./router-and-navigation.md)).
|
|
52
52
|
- An inline script that publishes the request's draft and CDN segment token to `window`.
|
|
53
|
-
-
|
|
53
|
+
- The "." edit shortcut, and `StudioChannel` and `DraftBadge` from `@decocms/blocks/preview` (below).
|
|
54
54
|
|
|
55
55
|
## The head
|
|
56
56
|
|
|
@@ -76,18 +76,18 @@ import { DecoPreview } from "@decocms/tanstack/react";
|
|
|
76
76
|
```
|
|
77
77
|
|
|
78
78
|
`DecoPreview` takes `site`, `editShortcut`, `nonce` and `studioOrigins`. It renders the draft
|
|
79
|
-
script,
|
|
80
|
-
without the badge. You then own `<HeadContent />`, `<Scripts />`, `lang`, the events bus and the
|
|
79
|
+
script, the "." shortcut, `StudioChannel` and `DraftBadge`. You then own `<HeadContent />`, `<Scripts />`, `lang`, the events bus and the
|
|
81
80
|
progress bar.
|
|
82
81
|
|
|
83
82
|
## Studio inside the page
|
|
84
83
|
|
|
85
|
-
-
|
|
86
|
-
|
|
87
|
-
|
|
84
|
+
- **The "." shortcut**: outside Studio's frame, "." opens the current page in Studio's editor: the
|
|
85
|
+
page whose route returns `pathTemplate` (and optionally `pageId`) in its loader data, else Studio
|
|
86
|
+
picks it from the URL. In a frame it does nothing (v8 only: no v7 `scrollToComponent` /
|
|
87
|
+
`editor::rerender` handler).
|
|
88
88
|
- **`StudioChannel`**: on every page, production included, about 0.7 kB gzipped. When a trusted
|
|
89
89
|
Studio origin frames the page, it loads Studio's editor modules from that origin. Otherwise it
|
|
90
|
-
does nothing.
|
|
90
|
+
does nothing. It is the only way Studio's editor reaches the page.
|
|
91
91
|
- **`DraftBadge`**: shown on a draft page outside Studio's frame. A draft link that can't be read
|
|
92
92
|
anymore shows a notice and the release.
|
|
93
93
|
|
|
@@ -98,8 +98,7 @@ from `@decocms/tanstack`). Each entry must be an exact `http(s)` origin; anythin
|
|
|
98
98
|
The worker puts the same list into the CSP. If you set `studioOrigins` on `DecoDocument`, set the
|
|
99
99
|
same list on `createDecoWorker`; `DECO_STUDIO_ORIGIN` sets both.
|
|
100
100
|
|
|
101
|
-
|
|
102
|
-
`data-manifest-key` equals the id Studio sends, else the element with that `id`. How to render
|
|
101
|
+
Studio's editor modules find the page's sections by their `data-manifest-key`. How to render
|
|
103
102
|
sections: `deco-site-authoring`.
|
|
104
103
|
|
|
105
104
|
## Security headers
|