-1
+ data.root._meta?.locked?.indexOf(fieldName) > -1
}
- value={data.page[fieldName]}
+ value={data.root[fieldName]}
onChange={onChange}
/>
);
diff --git a/packages/core/components/Render/index.tsx b/packages/core/components/Render/index.tsx
index ec2c2f320c..d399c43219 100644
--- a/packages/core/components/Render/index.tsx
+++ b/packages/core/components/Render/index.tsx
@@ -9,11 +9,11 @@ export function Render({ config, data }: { config: Config; data: Data }) {
return
;
});
- if (config.page) {
+ if (config.root) {
return (
-
+
{children}
-
+
);
}
diff --git a/packages/core/types/Config.tsx b/packages/core/types/Config.tsx
index 79746bca9c..910e5775a3 100644
--- a/packages/core/types/Config.tsx
+++ b/packages/core/types/Config.tsx
@@ -33,7 +33,7 @@ export type Field<
}[];
};
-export type DefaultPageProps = {
+export type DefaultRootProps = {
children: ReactNode;
title: string;
editMode: boolean;
@@ -61,12 +61,12 @@ export type ComponentConfig<
export type Config<
Props extends { [key: string]: any } = { [key: string]: any },
- PageProps extends DefaultPageProps = DefaultPageProps
+ RootProps extends DefaultRootProps = DefaultRootProps
> = {
components: {
[ComponentName in keyof Props]: ComponentConfig
;
};
- page?: ComponentConfig;
+ root?: ComponentConfig;
};
type MappedItem =
@@ -79,11 +79,11 @@ type MappedItem =
export type Data<
Props extends { [key: string]: any } = { [key: string]: any },
- PageProps extends { title: string; [key: string]: any } = {
+ RootProps extends { title: string; [key: string]: any } = {
title: string;
[key: string]: any;
}
> = {
- page: PageProps;
+ root: RootProps;
content: MappedItem[];
};
diff --git a/packages/core/types/Plugin.ts b/packages/core/types/Plugin.ts
index da0687c1e7..980ec4e6aa 100644
--- a/packages/core/types/Plugin.ts
+++ b/packages/core/types/Plugin.ts
@@ -2,11 +2,11 @@ import { ReactElement, ReactNode } from "react";
import { Data } from "./Config";
export type Plugin = {
- renderPageFields?: (props: {
+ renderRootFields?: (props: {
children: ReactNode;
data: Data;
}) => ReactElement;
- renderPage?: (props: {
+ renderRoot?: (props: {
children: ReactNode;
data: Data;
}) => ReactElement;
diff --git a/packages/plugin-heading-analyzer/src/HeadingAnalyzer.tsx b/packages/plugin-heading-analyzer/src/HeadingAnalyzer.tsx
index 543be95f66..95cb883f04 100644
--- a/packages/plugin-heading-analyzer/src/HeadingAnalyzer.tsx
+++ b/packages/plugin-heading-analyzer/src/HeadingAnalyzer.tsx
@@ -195,7 +195,7 @@ const HeadingOutlineAnalyer = ({
};
const HeadingAnalyzer: Plugin = {
- renderPageFields: HeadingOutlineAnalyer,
+ renderRootFields: HeadingOutlineAnalyer,
};
export default HeadingAnalyzer;