@cmssy/cli 14.2.0 → 16.0.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/assets/init/astro/src/cmssy/layout-slot.tsx +4 -4
- package/assets/init/next/app/[[...path]]/page.tsx +2 -2
- package/assets/init/next/app/cmssy-edit/[[...path]]/page.tsx +2 -2
- package/assets/init/remix/app/cmssy/layout-slot.tsx +4 -4
- package/assets/init/remix/app/routes/page.tsx +8 -8
- package/package.json +2 -2
|
@@ -12,7 +12,7 @@ import { blocks } from "./blocks";
|
|
|
12
12
|
|
|
13
13
|
export interface LayoutSlotProps {
|
|
14
14
|
groups: CmssyLayoutGroup[];
|
|
15
|
-
|
|
15
|
+
region: CmssyRegion<typeof layout>;
|
|
16
16
|
page: CmssyBlockPage;
|
|
17
17
|
locale: string;
|
|
18
18
|
defaultLocale: string;
|
|
@@ -24,7 +24,7 @@ export interface LayoutSlotProps {
|
|
|
24
24
|
|
|
25
25
|
export default function LayoutSlot({
|
|
26
26
|
groups,
|
|
27
|
-
|
|
27
|
+
region,
|
|
28
28
|
page,
|
|
29
29
|
locale,
|
|
30
30
|
defaultLocale,
|
|
@@ -37,7 +37,7 @@ export default function LayoutSlot({
|
|
|
37
37
|
return (
|
|
38
38
|
<CmssyLazyLayout
|
|
39
39
|
groups={groups}
|
|
40
|
-
|
|
40
|
+
region={region}
|
|
41
41
|
page={page}
|
|
42
42
|
locale={locale}
|
|
43
43
|
defaultLocale={defaultLocale}
|
|
@@ -50,7 +50,7 @@ export default function LayoutSlot({
|
|
|
50
50
|
);
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
const group = groups.find((candidate) => candidate.
|
|
53
|
+
const group = groups.find((candidate) => candidate.region === region);
|
|
54
54
|
if (!group) return null;
|
|
55
55
|
|
|
56
56
|
const blockMap = buildBlockMap(blocks);
|
|
@@ -22,11 +22,11 @@ const CmssyPage = createCmssyPage(cmssy, blocks, { editor: CmssyEditor });
|
|
|
22
22
|
|
|
23
23
|
export default async function Page(props: PageProps) {
|
|
24
24
|
const { path } = await props.params;
|
|
25
|
-
const slot = (
|
|
25
|
+
const slot = (region: CmssyRegion<typeof layout>) => (
|
|
26
26
|
<CmssyLayoutSlot
|
|
27
27
|
config={cmssy}
|
|
28
28
|
blocks={blocks}
|
|
29
|
-
|
|
29
|
+
region={region}
|
|
30
30
|
path={path ?? []}
|
|
31
31
|
editMode={false}
|
|
32
32
|
editable={EditableLayout}
|
|
@@ -25,11 +25,11 @@ export default async function EditPage(props: PageProps) {
|
|
|
25
25
|
|
|
26
26
|
const editMode = await isCmssyEditMode();
|
|
27
27
|
|
|
28
|
-
const slot = (
|
|
28
|
+
const slot = (region: CmssyRegion<typeof layout>) => (
|
|
29
29
|
<CmssyLayoutSlot
|
|
30
30
|
config={cmssy}
|
|
31
31
|
blocks={blocks}
|
|
32
|
-
|
|
32
|
+
region={region}
|
|
33
33
|
path={path ?? []}
|
|
34
34
|
editMode={editMode}
|
|
35
35
|
editable={EditableLayout}
|
|
@@ -12,7 +12,7 @@ import { blocks } from "./blocks";
|
|
|
12
12
|
|
|
13
13
|
export interface LayoutSlotProps {
|
|
14
14
|
groups: CmssyLayoutGroup[];
|
|
15
|
-
|
|
15
|
+
region: CmssyRegion<typeof layout>;
|
|
16
16
|
page: CmssyBlockPage;
|
|
17
17
|
locale: string;
|
|
18
18
|
defaultLocale: string;
|
|
@@ -24,7 +24,7 @@ export interface LayoutSlotProps {
|
|
|
24
24
|
|
|
25
25
|
export function LayoutSlot({
|
|
26
26
|
groups,
|
|
27
|
-
|
|
27
|
+
region,
|
|
28
28
|
page,
|
|
29
29
|
locale,
|
|
30
30
|
defaultLocale,
|
|
@@ -37,7 +37,7 @@ export function LayoutSlot({
|
|
|
37
37
|
return (
|
|
38
38
|
<CmssyLazyLayout
|
|
39
39
|
groups={groups}
|
|
40
|
-
|
|
40
|
+
region={region}
|
|
41
41
|
page={page}
|
|
42
42
|
locale={locale}
|
|
43
43
|
defaultLocale={defaultLocale}
|
|
@@ -50,7 +50,7 @@ export function LayoutSlot({
|
|
|
50
50
|
);
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
const group = groups.find((candidate) => candidate.
|
|
53
|
+
const group = groups.find((candidate) => candidate.region === region);
|
|
54
54
|
if (!group) return null;
|
|
55
55
|
|
|
56
56
|
const blockMap = buildBlockMap(blocks);
|
|
@@ -20,13 +20,13 @@ import type { Route } from "./+types/page";
|
|
|
20
20
|
|
|
21
21
|
const cmssyLoader = createCmssyLoader(cmssy, { blocks });
|
|
22
22
|
|
|
23
|
-
type
|
|
23
|
+
type Region = CmssyRegion<typeof layout>;
|
|
24
24
|
|
|
25
25
|
async function resolveSlot(
|
|
26
|
-
options: Omit<ResolveLayoutBlockDataOptions, "
|
|
27
|
-
|
|
26
|
+
options: Omit<ResolveLayoutBlockDataOptions, "region">,
|
|
27
|
+
region: Region,
|
|
28
28
|
) {
|
|
29
|
-
const resolved = await resolveEditorLayoutBlockData({ ...options,
|
|
29
|
+
const resolved = await resolveEditorLayoutBlockData({ ...options, region });
|
|
30
30
|
return { data: resolved.data, resolvedContent: resolved.content };
|
|
31
31
|
}
|
|
32
32
|
|
|
@@ -90,17 +90,17 @@ export default function CmssyPage({ loaderData }: Route.ComponentProps) {
|
|
|
90
90
|
return <div dangerouslySetInnerHTML={{ __html: diagnostics }} />;
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
-
const slot = (
|
|
93
|
+
const slot = (region: Region) => (
|
|
94
94
|
<LayoutSlot
|
|
95
95
|
groups={layouts}
|
|
96
|
-
|
|
96
|
+
region={region}
|
|
97
97
|
page={pageContext}
|
|
98
98
|
locale={locale}
|
|
99
99
|
defaultLocale={defaultLocale}
|
|
100
100
|
enabledLocales={enabledLocales}
|
|
101
101
|
edit={isEdit ? { editorOrigin } : undefined}
|
|
102
|
-
data={layoutData[
|
|
103
|
-
resolvedContent={layoutData[
|
|
102
|
+
data={layoutData[region]?.data}
|
|
103
|
+
resolvedContent={layoutData[region]?.resolvedContent}
|
|
104
104
|
/>
|
|
105
105
|
);
|
|
106
106
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cmssy/cli",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "16.0.0",
|
|
4
4
|
"description": "The cmssy CLI: `cmssy init` wires cmssy into an existing Next.js, Astro or React Router app; `cmssy link` connects it to a workspace and verifies the editor wiring.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cmssy",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
],
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"esbuild": "^0.27.7",
|
|
31
|
-
"@cmssy/core": "
|
|
31
|
+
"@cmssy/core": "16.0.0"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@types/node": "^20.0.0",
|