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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "rankrunners-cms",
3
3
  "type": "module",
4
- "version": "0.0.13",
4
+ "version": "0.0.14",
5
5
  "peerDependencies": {
6
6
  "@puckeditor/core": "^0.21.0",
7
7
  "next": "^16.1.2",
@@ -31,11 +31,8 @@ export type BaseEditorInitializerProps = {
31
31
 
32
32
  export const BaseEditor =
33
33
  ({ usePathname, useSearchParams }: BaseEditorInitializerProps) =>
34
- <UserData extends CMSUserData<any>>({
35
- config,
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 as UserData);
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 as UserData);
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 as unknown as Config}
104
+ config={config}
108
105
  data={data}
109
106
  onPublish={async (d) => {
110
107
  if (!previewToken || !pageId) {