rankrunners-cms 0.0.13 → 0.0.14
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
|
@@ -31,11 +31,8 @@ export type BaseEditorInitializerProps = {
|
|
|
31
31
|
|
|
32
32
|
export const BaseEditor =
|
|
33
33
|
({ usePathname, useSearchParams }: BaseEditorInitializerProps) =>
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
allPageData,
|
|
37
|
-
}: BaseEditorProps) => {
|
|
38
|
-
const [data, setData] = useState<UserData | null>(null);
|
|
34
|
+
({ config, allPageData }: BaseEditorProps) => {
|
|
35
|
+
const [data, setData] = useState<CMSUserData<any> | null>(null);
|
|
39
36
|
const currentPath = usePathname();
|
|
40
37
|
const path = currentPath.replace(/^\/+|\/+$/g, ""); // remove trailing slashes
|
|
41
38
|
const searchParams = useSearchParams();
|
|
@@ -67,7 +64,7 @@ export const BaseEditor =
|
|
|
67
64
|
const content = JSON.parse(json.content);
|
|
68
65
|
|
|
69
66
|
if (content.root && content.content) {
|
|
70
|
-
setData(content
|
|
67
|
+
setData(content);
|
|
71
68
|
return;
|
|
72
69
|
}
|
|
73
70
|
}
|
|
@@ -76,7 +73,7 @@ export const BaseEditor =
|
|
|
76
73
|
|
|
77
74
|
if (actualData) {
|
|
78
75
|
// Starting new page from existing published data
|
|
79
|
-
setData(actualData
|
|
76
|
+
setData(actualData);
|
|
80
77
|
} else {
|
|
81
78
|
// Starting new blank page
|
|
82
79
|
setData({
|
|
@@ -104,7 +101,7 @@ export const BaseEditor =
|
|
|
104
101
|
|
|
105
102
|
return (
|
|
106
103
|
<Puck
|
|
107
|
-
config={config
|
|
104
|
+
config={config}
|
|
108
105
|
data={data}
|
|
109
106
|
onPublish={async (d) => {
|
|
110
107
|
if (!previewToken || !pageId) {
|