@bygghammar/cms-platform 0.62.0 → 0.62.1
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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bygghammar/cms-platform",
|
|
3
|
-
"version": "0.62.
|
|
3
|
+
"version": "0.62.1",
|
|
4
4
|
"description": "Shared CMS platform: blocks, block types, i18n core, UI primitives and design-token contract used by every Bygghammar/Voyara site.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": [
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { queryOptions, useSuspenseQuery } from "@tanstack/react-query";
|
|
9
9
|
|
|
10
|
+
import { PriorityMediaProvider } from "../media/priority";
|
|
10
11
|
import type { BlockDef } from "../blocks/registry";
|
|
11
12
|
import type { BlockInstance, BlockProps } from "../blocks/types";
|
|
12
13
|
|
|
@@ -91,8 +92,11 @@ export function DraftPageRendererView({
|
|
|
91
92
|
edit?: boolean;
|
|
92
93
|
selectedId?: string | null;
|
|
93
94
|
}) {
|
|
95
|
+
// Every page render gets its own priority scope, so the first first-screen
|
|
96
|
+
// image loads eagerly and the rest stay lazy. In the builder (`edit`) the
|
|
97
|
+
// editor jumps around the page, so no image is treated as the hero.
|
|
94
98
|
return (
|
|
95
|
-
|
|
99
|
+
<PriorityMediaProvider enabled={!edit}>
|
|
96
100
|
{blocks.map((b) => (
|
|
97
101
|
<RenderBlock
|
|
98
102
|
key={b.id}
|
|
@@ -103,7 +107,7 @@ export function DraftPageRendererView({
|
|
|
103
107
|
selectedId={selectedId}
|
|
104
108
|
/>
|
|
105
109
|
))}
|
|
106
|
-
|
|
110
|
+
</PriorityMediaProvider>
|
|
107
111
|
);
|
|
108
112
|
}
|
|
109
113
|
|
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import { notFound, redirect } from "@tanstack/react-router";
|
|
10
10
|
import type { ComponentType, ReactElement, ReactNode } from "react";
|
|
11
|
-
import { PriorityMediaProvider } from "../../media/priority";
|
|
12
11
|
|
|
13
12
|
export type ResolvedPath =
|
|
14
13
|
| { kind: "page"; pageKey: string }
|
|
@@ -90,14 +89,10 @@ export function createPublicPageRoute<Ctx>(deps: PublicPageRouteDeps<Ctx>): Publ
|
|
|
90
89
|
return deps.buildPageHead(loaderData.pageKey, loaderData.ctx);
|
|
91
90
|
},
|
|
92
91
|
|
|
93
|
-
// Only the page content may hold the priority image: chrome (header logo,
|
|
94
|
-
// footer marks) is small, and one page gets exactly one priority claim.
|
|
95
92
|
PublicPage: ({ pageKey }) => (
|
|
96
93
|
<Shell>
|
|
97
94
|
<div className={deps.contentClassName ?? "pt-24 md:pt-32"}>
|
|
98
|
-
<
|
|
99
|
-
<deps.PageRenderer pageKey={pageKey} />
|
|
100
|
-
</PriorityMediaProvider>
|
|
95
|
+
<deps.PageRenderer pageKey={pageKey} />
|
|
101
96
|
</div>
|
|
102
97
|
</Shell>
|
|
103
98
|
),
|