@velastack/cms 0.2.3 → 0.2.4
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.
|
@@ -20,16 +20,15 @@ export type OverlayIntent = {
|
|
|
20
20
|
versionKey: string;
|
|
21
21
|
locale: string;
|
|
22
22
|
}
|
|
23
|
-
/** `previewKey: null` fetches published-only
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
23
|
+
/** `previewKey: null` fetches published-only. Used whenever there is no
|
|
24
|
+
* open draft: the overlay then carries the locale's *current* published
|
|
25
|
+
* tree (with default-locale fallback merged by `loadAndApplyOverlay`'s
|
|
26
|
+
* dual-fetch), masking `page.data.cms.docs` — which on a static-export
|
|
27
|
+
* site is frozen at build time and goes stale with every publish. */
|
|
27
28
|
| {
|
|
28
29
|
kind: 'load-overlay';
|
|
29
30
|
previewKey: string | null;
|
|
30
31
|
locale: string;
|
|
31
|
-
} | {
|
|
32
|
-
kind: 'clear-overlay';
|
|
33
32
|
};
|
|
34
33
|
export interface OverlaySyncInput {
|
|
35
34
|
/** `?version=…` URL param: when set, we're in past-release snapshot mode. */
|
|
@@ -38,10 +37,10 @@ export interface OverlaySyncInput {
|
|
|
38
37
|
locale: string;
|
|
39
38
|
/**
|
|
40
39
|
* `page.data.cms.locale` — the locale the server rendered for this request.
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
40
|
+
* Kept on the input for parity with the store's `mergedTree`, which only
|
|
41
|
+
* folds `cms.docs` into the base when `locale === pageLocale`. The sync
|
|
42
|
+
* decision no longer branches on it: the published overlay is loaded
|
|
43
|
+
* either way (see rule 7).
|
|
45
44
|
*/
|
|
46
45
|
pageLocale: string;
|
|
47
46
|
/** Current open-release preview_key from `cmsStore.openRelease`, or null. */
|
|
@@ -66,16 +65,16 @@ export interface OverlaySyncInput {
|
|
|
66
65
|
* first; the param change re-runs the effect into rule 5.
|
|
67
66
|
* 5. With an open release whose key matches: load the draft overlay.
|
|
68
67
|
* 6. With no open release but a stale `?preview=`: strip the param. Then
|
|
69
|
-
* fall through to rule 7
|
|
70
|
-
*
|
|
71
|
-
* 7. With no open release
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
*
|
|
68
|
+
* fall through to rule 7 in the *same* intent batch so the field render
|
|
69
|
+
* isn't briefly empty between strip and the next effect run.
|
|
70
|
+
* 7. With no open release: load the published-only overlay for `locale`.
|
|
71
|
+
* The page's `cms.docs` is NOT authoritative for an editor — on a
|
|
72
|
+
* static-export site it was captured at build time, so after any later
|
|
73
|
+
* publish it lags the backend until the next deploy. The overlay fetched
|
|
74
|
+
* from `/docs` is always current, and for `locale !== pageLocale` it is
|
|
75
|
+
* the only source of content at all (`mergedTree` folds in no base for
|
|
76
|
+
* other locales). The dual-fetch in `loadAndApplyOverlay` composes the
|
|
77
|
+
* `requested → default → undefined` chain.
|
|
79
78
|
*/
|
|
80
79
|
export declare function deriveOverlayIntents(input: OverlaySyncInput): OverlayIntent[];
|
|
81
80
|
/** Stable cache key for `(scope, locale)` overlay/draft buckets. */
|
|
@@ -21,16 +21,16 @@
|
|
|
21
21
|
* first; the param change re-runs the effect into rule 5.
|
|
22
22
|
* 5. With an open release whose key matches: load the draft overlay.
|
|
23
23
|
* 6. With no open release but a stale `?preview=`: strip the param. Then
|
|
24
|
-
* fall through to rule 7
|
|
25
|
-
*
|
|
26
|
-
* 7. With no open release
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
24
|
+
* fall through to rule 7 in the *same* intent batch so the field render
|
|
25
|
+
* isn't briefly empty between strip and the next effect run.
|
|
26
|
+
* 7. With no open release: load the published-only overlay for `locale`.
|
|
27
|
+
* The page's `cms.docs` is NOT authoritative for an editor — on a
|
|
28
|
+
* static-export site it was captured at build time, so after any later
|
|
29
|
+
* publish it lags the backend until the next deploy. The overlay fetched
|
|
30
|
+
* from `/docs` is always current, and for `locale !== pageLocale` it is
|
|
31
|
+
* the only source of content at all (`mergedTree` folds in no base for
|
|
32
|
+
* other locales). The dual-fetch in `loadAndApplyOverlay` composes the
|
|
33
|
+
* `requested → default → undefined` chain.
|
|
34
34
|
*/
|
|
35
35
|
export function deriveOverlayIntents(input) {
|
|
36
36
|
const intents = [];
|
|
@@ -58,12 +58,7 @@ export function deriveOverlayIntents(input) {
|
|
|
58
58
|
if (input.previewParam) {
|
|
59
59
|
intents.push({ kind: 'set-preview-param', value: null });
|
|
60
60
|
}
|
|
61
|
-
|
|
62
|
-
intents.push({ kind: 'load-overlay', previewKey: null, locale: input.locale });
|
|
63
|
-
}
|
|
64
|
-
else {
|
|
65
|
-
intents.push({ kind: 'clear-overlay' });
|
|
66
|
-
}
|
|
61
|
+
intents.push({ kind: 'load-overlay', previewKey: null, locale: input.locale });
|
|
67
62
|
return intents;
|
|
68
63
|
}
|
|
69
64
|
/** Stable cache key for `(scope, locale)` overlay/draft buckets. */
|