@puckeditor/plugin-pages 0.8.0-canary.d8162401 → 0.8.0-canary.dc11b4e2
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/dist/index.js +16 -6
- package/dist/index.mjs +20 -7
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -13353,7 +13353,7 @@ var PlanCard = ({
|
|
|
13353
13353
|
size: "large",
|
|
13354
13354
|
fullWidth: true,
|
|
13355
13355
|
variant: "ghost",
|
|
13356
|
-
href: "https://
|
|
13356
|
+
href: "https://puckeditor.com/contact-sales",
|
|
13357
13357
|
children: "Book a call"
|
|
13358
13358
|
}
|
|
13359
13359
|
) })
|
|
@@ -13413,7 +13413,7 @@ var PlanCard = ({
|
|
|
13413
13413
|
size: "large",
|
|
13414
13414
|
fullWidth: true,
|
|
13415
13415
|
variant: "primary",
|
|
13416
|
-
href: "https://
|
|
13416
|
+
href: "https://puckeditor.com/contact-sales",
|
|
13417
13417
|
children: "Book a call"
|
|
13418
13418
|
}
|
|
13419
13419
|
) })
|
|
@@ -29856,6 +29856,17 @@ var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
|
29856
29856
|
var cx9 = getClassNameFactory2("Pages", styles_module_default7);
|
|
29857
29857
|
var cxPage = getClassNameFactory2("PagesPage", styles_module_default7);
|
|
29858
29858
|
var cxVersion = getClassNameFactory2("PagesVersion", styles_module_default7);
|
|
29859
|
+
function registerDynamicConfig(config2, data) {
|
|
29860
|
+
const dynamicConfig = data.root?.props?._dynamicConfig;
|
|
29861
|
+
if (!dynamicConfig?.components) return;
|
|
29862
|
+
for (const [name, def] of Object.entries(dynamicConfig.components)) {
|
|
29863
|
+
if (config2.components[name]) continue;
|
|
29864
|
+
config2.components[name] = {
|
|
29865
|
+
fields: { ...def.fields ?? {} },
|
|
29866
|
+
render: () => null
|
|
29867
|
+
};
|
|
29868
|
+
}
|
|
29869
|
+
}
|
|
29859
29870
|
var PagePlugin = (opts) => {
|
|
29860
29871
|
const getPuck = (0, import_core11.useGetPuck)();
|
|
29861
29872
|
const [confirmModalOpen, setConfirmModalOpen] = (0, import_react25.useState)(false);
|
|
@@ -29899,10 +29910,9 @@ var PagePlugin = (opts) => {
|
|
|
29899
29910
|
const getPageState = (0, import_react25.useCallback)(
|
|
29900
29911
|
async (data) => {
|
|
29901
29912
|
const { appState, config: config2 } = getPuck();
|
|
29902
|
-
const
|
|
29903
|
-
|
|
29904
|
-
|
|
29905
|
-
);
|
|
29913
|
+
const pageData = data && Object.keys(data).length > 0 ? data : appState.data;
|
|
29914
|
+
registerDynamicConfig(config2, pageData);
|
|
29915
|
+
const resolvedData = await (0, import_core11.resolveAllData)(pageData, config2);
|
|
29906
29916
|
const nextState = {
|
|
29907
29917
|
...appState,
|
|
29908
29918
|
data: resolvedData,
|
package/dist/index.mjs
CHANGED
|
@@ -13345,7 +13345,7 @@ var PlanCard = ({
|
|
|
13345
13345
|
size: "large",
|
|
13346
13346
|
fullWidth: true,
|
|
13347
13347
|
variant: "ghost",
|
|
13348
|
-
href: "https://
|
|
13348
|
+
href: "https://puckeditor.com/contact-sales",
|
|
13349
13349
|
children: "Book a call"
|
|
13350
13350
|
}
|
|
13351
13351
|
) })
|
|
@@ -13405,7 +13405,7 @@ var PlanCard = ({
|
|
|
13405
13405
|
size: "large",
|
|
13406
13406
|
fullWidth: true,
|
|
13407
13407
|
variant: "primary",
|
|
13408
|
-
href: "https://
|
|
13408
|
+
href: "https://puckeditor.com/contact-sales",
|
|
13409
13409
|
children: "Book a call"
|
|
13410
13410
|
}
|
|
13411
13411
|
) })
|
|
@@ -13546,7 +13546,10 @@ var styles_module_default7 = { "Pages": "_Pages_ey49w_5", "Pages-addPage": "_Pag
|
|
|
13546
13546
|
|
|
13547
13547
|
// src/components/PagePlugin/index.tsx
|
|
13548
13548
|
import { useCallback as useCallback9, useEffect as useEffect29, useMemo as useMemo22, useRef as useRef22, useState as useState30 } from "react";
|
|
13549
|
-
import {
|
|
13549
|
+
import {
|
|
13550
|
+
resolveAllData as resolveAllData2,
|
|
13551
|
+
useGetPuck as useGetPuck2
|
|
13552
|
+
} from "@puckeditor/core";
|
|
13550
13553
|
|
|
13551
13554
|
// src/components/CreateForm/index.tsx
|
|
13552
13555
|
init_react_import();
|
|
@@ -29848,6 +29851,17 @@ import { jsx as jsx43, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
|
29848
29851
|
var cx9 = getClassNameFactory2("Pages", styles_module_default7);
|
|
29849
29852
|
var cxPage = getClassNameFactory2("PagesPage", styles_module_default7);
|
|
29850
29853
|
var cxVersion = getClassNameFactory2("PagesVersion", styles_module_default7);
|
|
29854
|
+
function registerDynamicConfig(config2, data) {
|
|
29855
|
+
const dynamicConfig = data.root?.props?._dynamicConfig;
|
|
29856
|
+
if (!dynamicConfig?.components) return;
|
|
29857
|
+
for (const [name, def] of Object.entries(dynamicConfig.components)) {
|
|
29858
|
+
if (config2.components[name]) continue;
|
|
29859
|
+
config2.components[name] = {
|
|
29860
|
+
fields: { ...def.fields ?? {} },
|
|
29861
|
+
render: () => null
|
|
29862
|
+
};
|
|
29863
|
+
}
|
|
29864
|
+
}
|
|
29851
29865
|
var PagePlugin = (opts) => {
|
|
29852
29866
|
const getPuck = useGetPuck2();
|
|
29853
29867
|
const [confirmModalOpen, setConfirmModalOpen] = useState30(false);
|
|
@@ -29891,10 +29905,9 @@ var PagePlugin = (opts) => {
|
|
|
29891
29905
|
const getPageState = useCallback9(
|
|
29892
29906
|
async (data) => {
|
|
29893
29907
|
const { appState, config: config2 } = getPuck();
|
|
29894
|
-
const
|
|
29895
|
-
|
|
29896
|
-
|
|
29897
|
-
);
|
|
29908
|
+
const pageData = data && Object.keys(data).length > 0 ? data : appState.data;
|
|
29909
|
+
registerDynamicConfig(config2, pageData);
|
|
29910
|
+
const resolvedData = await resolveAllData2(pageData, config2);
|
|
29898
29911
|
const nextState = {
|
|
29899
29912
|
...appState,
|
|
29900
29913
|
data: resolvedData,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@puckeditor/plugin-pages",
|
|
3
|
-
"version": "0.8.0-canary.
|
|
3
|
+
"version": "0.8.0-canary.dc11b4e2",
|
|
4
4
|
"author": "Chris Villa <chris@puckeditor.com>",
|
|
5
5
|
"repository": "puckeditor/puck",
|
|
6
6
|
"bugs": "https://github.com/puckeditor/puck/issues",
|
|
@@ -31,15 +31,15 @@
|
|
|
31
31
|
"zustand": "^5.0.8"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@puckeditor/core": "0.22.0
|
|
34
|
+
"@puckeditor/core": "0.22.0",
|
|
35
35
|
"@puckeditor/platform-types": "workspace:*",
|
|
36
36
|
"@radix-ui/react-popover": "^1.1.15",
|
|
37
37
|
"@testing-library/dom": "^10.4.1",
|
|
38
38
|
"@testing-library/react": "^16.3.2",
|
|
39
39
|
"@types/jest": "^30.0.0",
|
|
40
40
|
"@types/node": "^24.3.0",
|
|
41
|
-
"@types/react": "
|
|
42
|
-
"@types/react-dom": "
|
|
41
|
+
"@types/react": "catalog:",
|
|
42
|
+
"@types/react-dom": "catalog:",
|
|
43
43
|
"date-fns": "^4.1.0",
|
|
44
44
|
"eslint": "^9.39.4",
|
|
45
45
|
"eslint-config-custom": "workspace:*",
|
|
@@ -49,9 +49,9 @@
|
|
|
49
49
|
"tsconfig": "workspace:*",
|
|
50
50
|
"tsup": "^8.2.4",
|
|
51
51
|
"tsup-config": "workspace:*",
|
|
52
|
-
"typescript": "
|
|
52
|
+
"typescript": "catalog:",
|
|
53
53
|
"vite-tsconfig-paths": "^5.1.4",
|
|
54
|
-
"vitest": "
|
|
54
|
+
"vitest": "catalog:",
|
|
55
55
|
"zod": "^4.1.9"
|
|
56
56
|
},
|
|
57
57
|
"peerDependencies": {
|