@puckeditor/plugin-pages 0.9.0-canary.406bbac4 → 0.9.0-canary.4146ddf7
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.css +38 -36
- package/dist/index.d.mts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +89 -66
- package/dist/index.mjs +36 -10
- package/package.json +6 -6
package/dist/index.css
CHANGED
|
@@ -311,7 +311,7 @@ p {
|
|
|
311
311
|
}
|
|
312
312
|
|
|
313
313
|
/* css-module:/home/runner/work/platform/platform/packages/platform-client/components/Modal/Modal.module.css/#css-module-data */
|
|
314
|
-
._Modal-
|
|
314
|
+
._Modal-background_mocy5_1 {
|
|
315
315
|
align-items: center;
|
|
316
316
|
display: flex;
|
|
317
317
|
justify-content: center;
|
|
@@ -325,12 +325,12 @@ p {
|
|
|
325
325
|
opacity: 0;
|
|
326
326
|
pointer-events: none;
|
|
327
327
|
}
|
|
328
|
-
._Modal--
|
|
328
|
+
._Modal--visible_mocy5_16 > ._Modal-background_mocy5_1 {
|
|
329
329
|
opacity: 1;
|
|
330
330
|
transition: opacity ease 100ms;
|
|
331
331
|
pointer-events: auto;
|
|
332
332
|
}
|
|
333
|
-
._Modal-
|
|
333
|
+
._Modal-modal_mocy5_22 {
|
|
334
334
|
background: white;
|
|
335
335
|
border-radius: 16px;
|
|
336
336
|
display: block;
|
|
@@ -929,15 +929,15 @@ p {
|
|
|
929
929
|
}
|
|
930
930
|
|
|
931
931
|
/* css-module:/home/runner/work/platform/platform/packages/platform-client/components/Menu/styles.module.css/#css-module-data */
|
|
932
|
-
.
|
|
932
|
+
._Menu_1jr57_1 {
|
|
933
933
|
display: flex;
|
|
934
934
|
position: relative;
|
|
935
935
|
}
|
|
936
|
-
._Menu-
|
|
936
|
+
._Menu-content_1jr57_6 {
|
|
937
937
|
outline: none;
|
|
938
938
|
z-index: 1;
|
|
939
939
|
}
|
|
940
|
-
._Menu-
|
|
940
|
+
._Menu-sections_1jr57_11 {
|
|
941
941
|
background-color: white;
|
|
942
942
|
border: 1px solid var(--puck-color-grey-09);
|
|
943
943
|
border-radius: 8px;
|
|
@@ -947,40 +947,41 @@ p {
|
|
|
947
947
|
padding-bottom: 4px;
|
|
948
948
|
padding-top: 4px;
|
|
949
949
|
}
|
|
950
|
-
._Menu-
|
|
950
|
+
._Menu-action_1jr57_22 {
|
|
951
951
|
background: none;
|
|
952
952
|
border: none;
|
|
953
953
|
margin-left: auto;
|
|
954
954
|
padding: 0;
|
|
955
955
|
}
|
|
956
|
-
._Menu-
|
|
956
|
+
._Menu-action_1jr57_22:hover:not(:disabled) {
|
|
957
957
|
cursor: pointer;
|
|
958
958
|
opacity: 0.8;
|
|
959
959
|
}
|
|
960
|
-
._Menu-
|
|
960
|
+
._Menu-action_1jr57_22:disabled {
|
|
961
961
|
cursor: not-allowed;
|
|
962
962
|
opacity: 0.5;
|
|
963
963
|
}
|
|
964
|
-
._Menu-
|
|
964
|
+
._Menu-action_1jr57_22:focus-visible {
|
|
965
965
|
outline: 2px solid var(--puck-color-azure-05);
|
|
966
966
|
outline-offset: 2px;
|
|
967
967
|
}
|
|
968
|
-
._Menu-
|
|
968
|
+
._Menu-list_1jr57_44 {
|
|
969
969
|
list-style: none;
|
|
970
970
|
margin: 0;
|
|
971
971
|
padding: 0;
|
|
972
972
|
}
|
|
973
|
-
._Menu-
|
|
973
|
+
._Menu-list_1jr57_44 + ._Menu-list_1jr57_44 {
|
|
974
974
|
border-top: 1px solid var(--puck-color-grey-09);
|
|
975
975
|
margin-top: 4px;
|
|
976
976
|
}
|
|
977
|
-
._Menu-
|
|
977
|
+
._Menu-item_1jr57_55 {
|
|
978
978
|
align-items: center;
|
|
979
979
|
background: none;
|
|
980
980
|
border: none;
|
|
981
981
|
box-sizing: border-box;
|
|
982
982
|
color: var(--puck-color-grey-02);
|
|
983
983
|
display: flex;
|
|
984
|
+
font-family: var(--puck-font-family);
|
|
984
985
|
font-size: var(--puck-font-size-xxs);
|
|
985
986
|
font-weight: 500;
|
|
986
987
|
gap: 8px;
|
|
@@ -990,16 +991,16 @@ p {
|
|
|
990
991
|
white-space: nowrap;
|
|
991
992
|
width: 100%;
|
|
992
993
|
}
|
|
993
|
-
a._Menu-
|
|
994
|
-
button._Menu-
|
|
994
|
+
a._Menu-item_1jr57_55,
|
|
995
|
+
button._Menu-item_1jr57_55 {
|
|
995
996
|
cursor: pointer;
|
|
996
997
|
}
|
|
997
|
-
a._Menu-
|
|
998
|
-
button._Menu-
|
|
998
|
+
a._Menu-item_1jr57_55:hover,
|
|
999
|
+
button._Menu-item_1jr57_55:hover {
|
|
999
1000
|
background-color: var(--puck-color-azure-11);
|
|
1000
1001
|
color: var(--puck-color-azure-04);
|
|
1001
1002
|
}
|
|
1002
|
-
._Menu-item--
|
|
1003
|
+
._Menu-item--disabled_1jr57_84 {
|
|
1003
1004
|
cursor: not-allowed;
|
|
1004
1005
|
opacity: 0.5;
|
|
1005
1006
|
}
|
|
@@ -1294,15 +1295,15 @@ button._Menu-item_1tu16_55:hover {
|
|
|
1294
1295
|
}
|
|
1295
1296
|
|
|
1296
1297
|
/* css-module:/home/runner/work/platform/platform/packages/platform-client/components/Tag/Tag.module.css/#css-module-data */
|
|
1297
|
-
.
|
|
1298
|
+
._Tag_162k8_1 {
|
|
1298
1299
|
align-items: center;
|
|
1299
1300
|
display: flex;
|
|
1300
|
-
text-transform:
|
|
1301
|
+
text-transform: lowercase;
|
|
1301
1302
|
font-family: var(--puck-font-family-monospaced);
|
|
1302
|
-
font-weight:
|
|
1303
|
+
font-weight: 500;
|
|
1303
1304
|
font-size: var(--puck-font-size-xxxs);
|
|
1304
1305
|
gap: 6px;
|
|
1305
|
-
border-radius:
|
|
1306
|
+
border-radius: 16px;
|
|
1306
1307
|
border: 1px solid currentColor;
|
|
1307
1308
|
color: var(--puck-color-grey-05);
|
|
1308
1309
|
padding: 4px 8px;
|
|
@@ -1311,34 +1312,35 @@ button._Menu-item_1tu16_55:hover {
|
|
|
1311
1312
|
position: relative;
|
|
1312
1313
|
z-index: 0;
|
|
1313
1314
|
}
|
|
1314
|
-
._Tag--
|
|
1315
|
+
._Tag--borderless_162k8_21 {
|
|
1315
1316
|
border: none;
|
|
1316
1317
|
}
|
|
1317
|
-
._Tag--
|
|
1318
|
-
color: var(--puck-color-azure-05);
|
|
1318
|
+
._Tag--colorBlue_162k8_25 {
|
|
1319
|
+
background-color: var(--puck-color-azure-05);
|
|
1320
|
+
color: var(--puck-color-white);
|
|
1319
1321
|
}
|
|
1320
|
-
._Tag--
|
|
1322
|
+
._Tag--colorGreen_162k8_30 {
|
|
1321
1323
|
color: var(--puck-color-green-06);
|
|
1322
1324
|
}
|
|
1323
|
-
._Tag--
|
|
1325
|
+
._Tag--colorRed_162k8_34 {
|
|
1324
1326
|
color: var(--puck-color-red-04);
|
|
1325
1327
|
}
|
|
1326
|
-
._Tag--
|
|
1327
|
-
color: var(--puck-color-grey-
|
|
1328
|
+
._Tag--colorMuted_162k8_38 {
|
|
1329
|
+
color: var(--puck-color-grey-05);
|
|
1328
1330
|
}
|
|
1329
|
-
._Tag-
|
|
1331
|
+
._Tag-sprite_162k8_42 {
|
|
1330
1332
|
display: flex;
|
|
1331
1333
|
}
|
|
1332
|
-
._Tag--
|
|
1333
|
-
._Tag-
|
|
1334
|
+
._Tag--pulse_162k8_46 {
|
|
1335
|
+
._Tag-sprite_162k8_42 {
|
|
1334
1336
|
background: currentColor;
|
|
1335
1337
|
border-radius: 50%;
|
|
1336
1338
|
height: 5px;
|
|
1337
1339
|
position: relative;
|
|
1338
1340
|
width: 5px;
|
|
1339
1341
|
}
|
|
1340
|
-
._Tag-
|
|
1341
|
-
animation:
|
|
1342
|
+
._Tag-sprite_162k8_42::before {
|
|
1343
|
+
animation: _pulse_162k8_1 1s 0s infinite alternate;
|
|
1342
1344
|
animation-fill-mode: both;
|
|
1343
1345
|
background-color: color-mix(in srgb, currentColor 25%, transparent);
|
|
1344
1346
|
border-radius: 50%;
|
|
@@ -1352,7 +1354,7 @@ button._Menu-item_1tu16_55:hover {
|
|
|
1352
1354
|
z-index: -1;
|
|
1353
1355
|
}
|
|
1354
1356
|
}
|
|
1355
|
-
@keyframes
|
|
1357
|
+
@keyframes _pulse_162k8_1 {
|
|
1356
1358
|
0% {
|
|
1357
1359
|
transform: scale(1);
|
|
1358
1360
|
}
|
|
@@ -1360,7 +1362,7 @@ button._Menu-item_1tu16_55:hover {
|
|
|
1360
1362
|
transform: scale(2);
|
|
1361
1363
|
}
|
|
1362
1364
|
}
|
|
1363
|
-
._Tag-
|
|
1365
|
+
._Tag-label_162k8_80 {
|
|
1364
1366
|
margin-top: 1px;
|
|
1365
1367
|
}
|
|
1366
1368
|
|
package/dist/index.d.mts
CHANGED
|
@@ -13,7 +13,9 @@ declare function createPagesPlugin(opts?: PagePluginOptions): {
|
|
|
13
13
|
render: () => react_jsx_runtime.JSX.Element;
|
|
14
14
|
icon: react_jsx_runtime.JSX.Element;
|
|
15
15
|
overrides: {
|
|
16
|
-
headerActions: (
|
|
16
|
+
headerActions: ({ children }: {
|
|
17
|
+
children: react.ReactNode;
|
|
18
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
17
19
|
preview: ({ children }: {
|
|
18
20
|
children: react.ReactNode;
|
|
19
21
|
}) => react_jsx_runtime.JSX.Element;
|
package/dist/index.d.ts
CHANGED
|
@@ -13,7 +13,9 @@ declare function createPagesPlugin(opts?: PagePluginOptions): {
|
|
|
13
13
|
render: () => react_jsx_runtime.JSX.Element;
|
|
14
14
|
icon: react_jsx_runtime.JSX.Element;
|
|
15
15
|
overrides: {
|
|
16
|
-
headerActions: (
|
|
16
|
+
headerActions: ({ children }: {
|
|
17
|
+
children: react.ReactNode;
|
|
18
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
17
19
|
preview: ({ children }: {
|
|
18
20
|
children: react.ReactNode;
|
|
19
21
|
}) => react_jsx_runtime.JSX.Element;
|
package/dist/index.js
CHANGED
|
@@ -4721,6 +4721,15 @@ function ToastWrapper({ children }) {
|
|
|
4721
4721
|
] });
|
|
4722
4722
|
}
|
|
4723
4723
|
|
|
4724
|
+
// ../platform-client/lib/header-actions.ts
|
|
4725
|
+
init_react_import();
|
|
4726
|
+
var import_react7 = require("react");
|
|
4727
|
+
var HEADER_ACTIONS = Symbol.for("@puckeditor/header-actions");
|
|
4728
|
+
var isHeaderActions = (node) => (0, import_react7.isValidElement)(node) && typeof node.type !== "string" && HEADER_ACTIONS in node.type;
|
|
4729
|
+
var keepHeaderActions = (children) => isHeaderActions(children) ? (0, import_react7.cloneElement)(children, {
|
|
4730
|
+
children: keepHeaderActions(children.props.children)
|
|
4731
|
+
}) : null;
|
|
4732
|
+
|
|
4724
4733
|
// src/components/PagePlugin/index.tsx
|
|
4725
4734
|
init_react_import();
|
|
4726
4735
|
|
|
@@ -4779,18 +4788,18 @@ init_react_import();
|
|
|
4779
4788
|
|
|
4780
4789
|
// css-module:/home/runner/work/platform/platform/packages/platform-client/components/Modal/Modal.module.css#css-module
|
|
4781
4790
|
init_react_import();
|
|
4782
|
-
var Modal_module_default = { "Modal-background": "_Modal-
|
|
4791
|
+
var Modal_module_default = { "Modal-background": "_Modal-background_mocy5_1", "Modal--visible": "_Modal--visible_mocy5_16", "Modal-modal": "_Modal-modal_mocy5_22" };
|
|
4783
4792
|
|
|
4784
4793
|
// ../platform-client/components/Modal/Modal.tsx
|
|
4785
|
-
var
|
|
4794
|
+
var import_react10 = require("react");
|
|
4786
4795
|
|
|
4787
4796
|
// ../platform-client/lib/use-modal-visible.ts
|
|
4788
4797
|
init_react_import();
|
|
4789
|
-
var
|
|
4798
|
+
var import_react8 = require("react");
|
|
4790
4799
|
var useModalVisible = (defaultVisible) => {
|
|
4791
|
-
const [visible, setVisible] = (0,
|
|
4792
|
-
const ref = (0,
|
|
4793
|
-
(0,
|
|
4800
|
+
const [visible, setVisible] = (0, import_react8.useState)(defaultVisible ?? false);
|
|
4801
|
+
const ref = (0, import_react8.useRef)(null);
|
|
4802
|
+
(0, import_react8.useEffect)(() => {
|
|
4794
4803
|
if (!visible) {
|
|
4795
4804
|
return;
|
|
4796
4805
|
}
|
|
@@ -4812,7 +4821,7 @@ init_react_import();
|
|
|
4812
4821
|
|
|
4813
4822
|
// ../platform-client/components/Button/Button.tsx
|
|
4814
4823
|
init_react_import();
|
|
4815
|
-
var
|
|
4824
|
+
var import_react9 = require("react");
|
|
4816
4825
|
|
|
4817
4826
|
// css-module:/home/runner/work/platform/platform/packages/platform-client/components/Button/Button.module.css#css-module
|
|
4818
4827
|
init_react_import();
|
|
@@ -4865,8 +4874,8 @@ var Button = ({
|
|
|
4865
4874
|
size: size4 = "medium",
|
|
4866
4875
|
loading: loadingProp = false
|
|
4867
4876
|
}) => {
|
|
4868
|
-
const [loading, setLoading] = (0,
|
|
4869
|
-
(0,
|
|
4877
|
+
const [loading, setLoading] = (0, import_react9.useState)(loadingProp);
|
|
4878
|
+
(0, import_react9.useEffect)(() => {
|
|
4870
4879
|
const resetLoading = () => setLoading(loadingProp);
|
|
4871
4880
|
resetLoading();
|
|
4872
4881
|
window.addEventListener("pageshow", resetLoading);
|
|
@@ -4916,7 +4925,7 @@ var Button = ({
|
|
|
4916
4925
|
// ../platform-client/components/Modal/Modal.tsx
|
|
4917
4926
|
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
4918
4927
|
var getClassName3 = getClassNameFactory("Modal", Modal_module_default);
|
|
4919
|
-
var modalContext = (0,
|
|
4928
|
+
var modalContext = (0, import_react10.createContext)({
|
|
4920
4929
|
buttonVariant: "primary",
|
|
4921
4930
|
buttonSize: "medium",
|
|
4922
4931
|
visible: false,
|
|
@@ -4940,7 +4949,7 @@ var ModalProvider = ({
|
|
|
4940
4949
|
);
|
|
4941
4950
|
};
|
|
4942
4951
|
var useModal = () => {
|
|
4943
|
-
const { visible, setVisible } = (0,
|
|
4952
|
+
const { visible, setVisible } = (0, import_react10.useContext)(modalContext);
|
|
4944
4953
|
return { visible, setVisible };
|
|
4945
4954
|
};
|
|
4946
4955
|
var Modal = ({
|
|
@@ -4948,7 +4957,7 @@ var Modal = ({
|
|
|
4948
4957
|
children,
|
|
4949
4958
|
hideButton = false
|
|
4950
4959
|
}) => {
|
|
4951
|
-
const { visible, setVisible, buttonVariant, buttonSize, ref } = (0,
|
|
4960
|
+
const { visible, setVisible, buttonVariant, buttonSize, ref } = (0, import_react10.useContext)(modalContext);
|
|
4952
4961
|
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: getClassName3({ visible }), children: [
|
|
4953
4962
|
!hideButton && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: getClassName3("button"), children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
4954
4963
|
Button,
|
|
@@ -5031,7 +5040,7 @@ init_react_import();
|
|
|
5031
5040
|
|
|
5032
5041
|
// ../platform-client/components/Align/Align.tsx
|
|
5033
5042
|
init_react_import();
|
|
5034
|
-
var
|
|
5043
|
+
var import_react11 = __toESM(require("react"));
|
|
5035
5044
|
|
|
5036
5045
|
// css-module:/home/runner/work/platform/platform/packages/platform-client/components/Align/Align.module.css#css-module
|
|
5037
5046
|
init_react_import();
|
|
@@ -5128,7 +5137,7 @@ var Align = ({
|
|
|
5128
5137
|
horizontal = "left",
|
|
5129
5138
|
vertical = "top"
|
|
5130
5139
|
}) => {
|
|
5131
|
-
const wrappedChildren =
|
|
5140
|
+
const wrappedChildren = import_react11.default.Children.map(children, (child, i) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(AlignItem, { children: child }, i));
|
|
5132
5141
|
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
5133
5142
|
"div",
|
|
5134
5143
|
{
|
|
@@ -5150,7 +5159,7 @@ init_react_import();
|
|
|
5150
5159
|
// ../platform-client/components/AutoForm/AutoForm.tsx
|
|
5151
5160
|
init_react_import();
|
|
5152
5161
|
var import_core2 = require("@puckeditor/core");
|
|
5153
|
-
var
|
|
5162
|
+
var import_react12 = require("react");
|
|
5154
5163
|
|
|
5155
5164
|
// css-module:/home/runner/work/platform/platform/packages/platform-client/components/AutoForm/AutoForm.module.css#css-module
|
|
5156
5165
|
init_react_import();
|
|
@@ -5232,11 +5241,11 @@ var Code_module_default = { "Code": "_Code_d4378_1", "Code-body": "_Code-body_d4
|
|
|
5232
5241
|
|
|
5233
5242
|
// ../platform-client/components/Code/CopyAction.tsx
|
|
5234
5243
|
init_react_import();
|
|
5235
|
-
var
|
|
5244
|
+
var import_react13 = require("react");
|
|
5236
5245
|
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
5237
5246
|
|
|
5238
5247
|
// ../platform-client/components/Code/Code.tsx
|
|
5239
|
-
var
|
|
5248
|
+
var import_react14 = require("react");
|
|
5240
5249
|
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
5241
5250
|
var getClassName9 = get_class_name_factory_default2("Code", Code_module_default);
|
|
5242
5251
|
var getClassNameTab = get_class_name_factory_default2("Tab", Code_module_default);
|
|
@@ -5246,7 +5255,7 @@ init_react_import();
|
|
|
5246
5255
|
|
|
5247
5256
|
// ../platform-client/components/IconButton/IconButton.tsx
|
|
5248
5257
|
init_react_import();
|
|
5249
|
-
var
|
|
5258
|
+
var import_react15 = require("react");
|
|
5250
5259
|
|
|
5251
5260
|
// css-module:/home/runner/work/platform/platform/packages/platform-client/components/IconButton/IconButton.module.css#css-module
|
|
5252
5261
|
init_react_import();
|
|
@@ -5349,11 +5358,11 @@ var getClassName12 = get_class_name_factory_default("Link", Link_module_default)
|
|
|
5349
5358
|
|
|
5350
5359
|
// ../platform-client/components/Menu/index.tsx
|
|
5351
5360
|
init_react_import();
|
|
5352
|
-
var
|
|
5361
|
+
var import_react17 = require("react");
|
|
5353
5362
|
|
|
5354
5363
|
// css-module:/home/runner/work/platform/platform/packages/platform-client/components/Menu/styles.module.css#css-module
|
|
5355
5364
|
init_react_import();
|
|
5356
|
-
var styles_module_default3 = { "Menu": "
|
|
5365
|
+
var styles_module_default3 = { "Menu": "_Menu_1jr57_1", "Menu-content": "_Menu-content_1jr57_6", "Menu-sections": "_Menu-sections_1jr57_11", "Menu-action": "_Menu-action_1jr57_22", "Menu-list": "_Menu-list_1jr57_44", "Menu-item": "_Menu-item_1jr57_55", "Menu-item--disabled": "_Menu-item--disabled_1jr57_84" };
|
|
5357
5366
|
|
|
5358
5367
|
// ../../node_modules/.pnpm/@radix-ui+react-popover@1.1.15_@types+react-dom@19.2.0_@types+react@19.2.0__@types+reac_e6e9e3f3089a7a72fc73cc2cd9dafc33/node_modules/@radix-ui/react-popover/dist/index.mjs
|
|
5359
5368
|
init_react_import();
|
|
@@ -6832,9 +6841,9 @@ function assignRef(ref, value) {
|
|
|
6832
6841
|
|
|
6833
6842
|
// ../../node_modules/.pnpm/use-callback-ref@1.3.3_@types+react@19.2.0_react@19.2.8/node_modules/use-callback-ref/dist/es2015/useRef.js
|
|
6834
6843
|
init_react_import();
|
|
6835
|
-
var
|
|
6844
|
+
var import_react16 = require("react");
|
|
6836
6845
|
function useCallbackRef2(initialValue, callback) {
|
|
6837
|
-
var ref = (0,
|
|
6846
|
+
var ref = (0, import_react16.useState)(function() {
|
|
6838
6847
|
return {
|
|
6839
6848
|
// value
|
|
6840
6849
|
value: initialValue,
|
|
@@ -7810,7 +7819,7 @@ var Menu = ({
|
|
|
7810
7819
|
ariaLabel,
|
|
7811
7820
|
renderLink
|
|
7812
7821
|
}) => {
|
|
7813
|
-
const [open, setOpen] = (0,
|
|
7822
|
+
const [open, setOpen] = (0, import_react17.useState)(false);
|
|
7814
7823
|
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Popover, { open, onOpenChange: setOpen, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: getClassName13(), children: [
|
|
7815
7824
|
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
7816
7825
|
"button",
|
|
@@ -7912,7 +7921,7 @@ init_react_import();
|
|
|
7912
7921
|
|
|
7913
7922
|
// ../platform-client/components/Pagination/Pagination.tsx
|
|
7914
7923
|
init_react_import();
|
|
7915
|
-
var
|
|
7924
|
+
var import_react18 = require("react");
|
|
7916
7925
|
|
|
7917
7926
|
// css-module:/home/runner/work/platform/platform/packages/platform-client/components/Pagination/Pagination.module.css#css-module
|
|
7918
7927
|
init_react_import();
|
|
@@ -7994,7 +8003,7 @@ init_react_import();
|
|
|
7994
8003
|
|
|
7995
8004
|
// css-module:/home/runner/work/platform/platform/packages/platform-client/components/Tag/Tag.module.css#css-module
|
|
7996
8005
|
init_react_import();
|
|
7997
|
-
var Tag_module_default = { "Tag": "
|
|
8006
|
+
var Tag_module_default = { "Tag": "_Tag_162k8_1", "Tag--borderless": "_Tag--borderless_162k8_21", "Tag--colorBlue": "_Tag--colorBlue_162k8_25", "Tag--colorGreen": "_Tag--colorGreen_162k8_30", "Tag--colorRed": "_Tag--colorRed_162k8_34", "Tag--colorMuted": "_Tag--colorMuted_162k8_38", "Tag-sprite": "_Tag-sprite_162k8_42", "Tag--pulse": "_Tag--pulse_162k8_46", "pulse": "_pulse_162k8_1", "Tag-label": "_Tag-label_162k8_80" };
|
|
7998
8007
|
|
|
7999
8008
|
// ../platform-client/components/Tag/Tag.tsx
|
|
8000
8009
|
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
@@ -8043,7 +8052,7 @@ init_react_import();
|
|
|
8043
8052
|
|
|
8044
8053
|
// ../platform-client/components/Table/Table.tsx
|
|
8045
8054
|
init_react_import();
|
|
8046
|
-
var
|
|
8055
|
+
var import_react19 = require("react");
|
|
8047
8056
|
|
|
8048
8057
|
// css-module:/home/runner/work/platform/platform/packages/platform-client/components/Table/Table.module.css#css-module
|
|
8049
8058
|
init_react_import();
|
|
@@ -8084,22 +8093,22 @@ var cx6 = getClassNameFactory2("Viewport", styles_module_default5);
|
|
|
8084
8093
|
|
|
8085
8094
|
// ../platform-client/context/editor.tsx
|
|
8086
8095
|
init_react_import();
|
|
8087
|
-
var
|
|
8096
|
+
var import_react20 = require("react");
|
|
8088
8097
|
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
8089
|
-
var ctx = (0,
|
|
8098
|
+
var ctx = (0, import_react20.createContext)({});
|
|
8090
8099
|
|
|
8091
8100
|
// css-module:/home/runner/work/platform/platform/packages/plugin-pages/src/components/PagePlugin/styles.module.css#css-module
|
|
8092
8101
|
init_react_import();
|
|
8093
8102
|
var styles_module_default6 = { "Pages": "_Pages_ey49w_5", "Pages-addPage": "_Pages-addPage_ey49w_12", "Pages-loader": "_Pages-loader_ey49w_18", "Pages-list": "_Pages-list_ey49w_26", "Pages-search": "_Pages-search_ey49w_34", "Pages-searchInput": "_Pages-searchInput_ey49w_38", "PagesPage": "_PagesPage_ey49w_59", "PagesPage--expanded": "_PagesPage--expanded_ey49w_69", "PagesPage-versions": "_PagesPage-versions_ey49w_73", "PagesPage-header": "_PagesPage-header_ey49w_96", "PagesPage--active": "_PagesPage--active_ey49w_124", "PagesPage-headerMain": "_PagesPage-headerMain_ey49w_137", "PagesPage-headerIcon": "_PagesPage-headerIcon_ey49w_144", "PagesPage-loader": "_PagesPage-loader_ey49w_148", "PagesVersion": "_PagesVersion_ey49w_174", "PagesVersion-inner": "_PagesVersion-inner_ey49w_174", "PagesVersion--current": "_PagesVersion--current_ey49w_189", "PagesVersion-header": "_PagesVersion-header_ey49w_204", "PagesVersion-version": "_PagesVersion-version_ey49w_210", "PagesVersion-date": "_PagesVersion-date_ey49w_216" };
|
|
8094
8103
|
|
|
8095
8104
|
// src/components/PagePlugin/index.tsx
|
|
8096
|
-
var
|
|
8105
|
+
var import_react24 = require("react");
|
|
8097
8106
|
var import_core11 = require("@puckeditor/core");
|
|
8098
8107
|
|
|
8099
8108
|
// src/components/CreateForm/index.tsx
|
|
8100
8109
|
init_react_import();
|
|
8101
8110
|
var import_core10 = require("@puckeditor/core");
|
|
8102
|
-
var
|
|
8111
|
+
var import_react21 = require("react");
|
|
8103
8112
|
|
|
8104
8113
|
// ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/index.js
|
|
8105
8114
|
init_react_import();
|
|
@@ -21984,7 +21993,7 @@ var usePagesStore = (0, import_zustand.create)((set3) => ({
|
|
|
21984
21993
|
};
|
|
21985
21994
|
})
|
|
21986
21995
|
})),
|
|
21987
|
-
setPageVersions: (pageId, versions, path) => set3((state) => ({
|
|
21996
|
+
setPageVersions: (pageId, versions, path, { replace = false } = {}) => set3((state) => ({
|
|
21988
21997
|
...state,
|
|
21989
21998
|
pagesData: state.pagesData.map((page) => {
|
|
21990
21999
|
const matchesPage = page.id === pageId || !!path && page.path === path;
|
|
@@ -21998,7 +22007,7 @@ var usePagesStore = (0, import_zustand.create)((set3) => ({
|
|
|
21998
22007
|
return {
|
|
21999
22008
|
...page,
|
|
22000
22009
|
id: pageId,
|
|
22001
|
-
versions: isFirstPersistForOptimisticPage ? versions : merged
|
|
22010
|
+
versions: replace || isFirstPersistForOptimisticPage ? versions : merged
|
|
22002
22011
|
};
|
|
22003
22012
|
})
|
|
22004
22013
|
})),
|
|
@@ -22063,8 +22072,8 @@ var removeTrailingSlash = (slug) => slug.length > 0 && slug.endsWith("/") ? slug
|
|
|
22063
22072
|
var CreateForm = () => {
|
|
22064
22073
|
const getPuck = (0, import_core10.useGetPuck)();
|
|
22065
22074
|
const { createPage, pagesData } = usePagesStore();
|
|
22066
|
-
const [slug, setSlug] = (0,
|
|
22067
|
-
const [slugError, setSlugError] = (0,
|
|
22075
|
+
const [slug, setSlug] = (0, import_react21.useState)("");
|
|
22076
|
+
const [slugError, setSlugError] = (0, import_react21.useState)(null);
|
|
22068
22077
|
const { setVisible } = useModal();
|
|
22069
22078
|
const handleSubmit = async (values) => {
|
|
22070
22079
|
const slug2 = removeTrailingSlash(values.slug);
|
|
@@ -22177,8 +22186,8 @@ var highlightMatch = (text, query) => {
|
|
|
22177
22186
|
|
|
22178
22187
|
// src/hooks/useSiteId.ts
|
|
22179
22188
|
init_react_import();
|
|
22180
|
-
var
|
|
22181
|
-
var useSiteId = () => (0,
|
|
22189
|
+
var import_react22 = require("react");
|
|
22190
|
+
var useSiteId = () => (0, import_react22.useMemo)(() => {
|
|
22182
22191
|
try {
|
|
22183
22192
|
return new URLSearchParams(window.location.search).get("siteId");
|
|
22184
22193
|
} catch {
|
|
@@ -22256,8 +22265,13 @@ var postMessageToParent = ({
|
|
|
22256
22265
|
window.parent.postMessage(message2, parentOrigin);
|
|
22257
22266
|
};
|
|
22258
22267
|
|
|
22268
|
+
// src/lib/is-embedded.ts
|
|
22269
|
+
init_react_import();
|
|
22270
|
+
var isEmbedded = () => typeof window !== "undefined" && window.self !== window.top;
|
|
22271
|
+
|
|
22259
22272
|
// src/lib/request-token.ts
|
|
22260
22273
|
var requestToken = (parentOrigin) => {
|
|
22274
|
+
if (!isEmbedded()) return Promise.resolve("");
|
|
22261
22275
|
return new Promise((resolve) => {
|
|
22262
22276
|
const handler = async (event) => {
|
|
22263
22277
|
if (event.origin !== parentOrigin) return;
|
|
@@ -22298,6 +22312,7 @@ var getActiveVersion = ({
|
|
|
22298
22312
|
init_react_import();
|
|
22299
22313
|
var RETRY_INTERVAL_MS = 100;
|
|
22300
22314
|
var waitForParentReady = (parentOrigin) => {
|
|
22315
|
+
if (!isEmbedded()) return Promise.resolve();
|
|
22301
22316
|
return new Promise((resolve) => {
|
|
22302
22317
|
let intervalId = 0;
|
|
22303
22318
|
const sendReadyCheck = () => {
|
|
@@ -22324,8 +22339,8 @@ var waitForParentReady = (parentOrigin) => {
|
|
|
22324
22339
|
|
|
22325
22340
|
// src/hooks/usePath.ts
|
|
22326
22341
|
init_react_import();
|
|
22327
|
-
var
|
|
22328
|
-
var usePath = () => (0,
|
|
22342
|
+
var import_react23 = require("react");
|
|
22343
|
+
var usePath = () => (0, import_react23.useMemo)(() => {
|
|
22329
22344
|
try {
|
|
22330
22345
|
return new URLSearchParams(window.location.search).get("path");
|
|
22331
22346
|
} catch {
|
|
@@ -24409,9 +24424,9 @@ function registerDynamicConfig(config2, data) {
|
|
|
24409
24424
|
}
|
|
24410
24425
|
var PagePlugin = (opts) => {
|
|
24411
24426
|
const getPuck = (0, import_core11.useGetPuck)();
|
|
24412
|
-
const [confirmModalOpen, setConfirmModalOpen] = (0,
|
|
24413
|
-
const [pendingNavigation, setPendingNavigation] = (0,
|
|
24414
|
-
const lastRequestedPathRef = (0,
|
|
24427
|
+
const [confirmModalOpen, setConfirmModalOpen] = (0, import_react24.useState)(false);
|
|
24428
|
+
const [pendingNavigation, setPendingNavigation] = (0, import_react24.useState)(null);
|
|
24429
|
+
const lastRequestedPathRef = (0, import_react24.useRef)(void 0);
|
|
24415
24430
|
const parentOrigin = opts?.parentOrigin ?? "https://cloud.puckeditor.com";
|
|
24416
24431
|
const siteIdHeader = useSiteId();
|
|
24417
24432
|
const path = usePath();
|
|
@@ -24433,7 +24448,7 @@ var PagePlugin = (opts) => {
|
|
|
24433
24448
|
initialLoad,
|
|
24434
24449
|
createPage
|
|
24435
24450
|
} = usePagesStore();
|
|
24436
|
-
const currentVersion = (0,
|
|
24451
|
+
const currentVersion = (0, import_react24.useMemo)(() => {
|
|
24437
24452
|
if (activePage) {
|
|
24438
24453
|
return getActiveVersion({
|
|
24439
24454
|
pagesData,
|
|
@@ -24443,11 +24458,11 @@ var PagePlugin = (opts) => {
|
|
|
24443
24458
|
}
|
|
24444
24459
|
return void 0;
|
|
24445
24460
|
}, [activePage, activeVersion, pagesData]);
|
|
24446
|
-
const postToParent = (0,
|
|
24461
|
+
const postToParent = (0, import_react24.useCallback)(
|
|
24447
24462
|
(message2) => postMessageToParent({ parentOrigin, ...message2 }),
|
|
24448
24463
|
[parentOrigin]
|
|
24449
24464
|
);
|
|
24450
|
-
const getPageState = (0,
|
|
24465
|
+
const getPageState = (0, import_react24.useCallback)(
|
|
24451
24466
|
async (data) => {
|
|
24452
24467
|
const { appState, config: config2 } = getPuck();
|
|
24453
24468
|
const pageData = data && Object.keys(data).length > 0 ? data : appState.data;
|
|
@@ -24465,7 +24480,7 @@ var PagePlugin = (opts) => {
|
|
|
24465
24480
|
},
|
|
24466
24481
|
[getPuck, import_core11.resolveAllData]
|
|
24467
24482
|
);
|
|
24468
|
-
const pushPageHistoryState = (0,
|
|
24483
|
+
const pushPageHistoryState = (0, import_react24.useCallback)(
|
|
24469
24484
|
async (data) => {
|
|
24470
24485
|
const { history, dispatch } = getPuck();
|
|
24471
24486
|
const nextState = await getPageState(data);
|
|
@@ -24477,11 +24492,11 @@ var PagePlugin = (opts) => {
|
|
|
24477
24492
|
},
|
|
24478
24493
|
[getPageState, getPuck]
|
|
24479
24494
|
);
|
|
24480
|
-
const filteredPages = (0,
|
|
24495
|
+
const filteredPages = (0, import_react24.useMemo)(() => {
|
|
24481
24496
|
const q = searchQuery.toLowerCase();
|
|
24482
24497
|
return pagesData.filter((page) => page.path.toLowerCase().includes(q));
|
|
24483
24498
|
}, [pagesData, searchQuery]);
|
|
24484
|
-
const handleRead = (0,
|
|
24499
|
+
const handleRead = (0, import_react24.useCallback)(
|
|
24485
24500
|
async (path2) => {
|
|
24486
24501
|
await waitForParentReady(parentOrigin);
|
|
24487
24502
|
const token = await requestToken(parentOrigin);
|
|
@@ -24514,8 +24529,8 @@ var PagePlugin = (opts) => {
|
|
|
24514
24529
|
createPage("/");
|
|
24515
24530
|
postToParent({ type: "DATA_READY" });
|
|
24516
24531
|
}
|
|
24517
|
-
setLoading(false);
|
|
24518
24532
|
}
|
|
24533
|
+
setLoading(false);
|
|
24519
24534
|
},
|
|
24520
24535
|
[
|
|
24521
24536
|
host,
|
|
@@ -24532,7 +24547,7 @@ var PagePlugin = (opts) => {
|
|
|
24532
24547
|
siteId
|
|
24533
24548
|
]
|
|
24534
24549
|
);
|
|
24535
|
-
(0,
|
|
24550
|
+
(0, import_react24.useEffect)(() => {
|
|
24536
24551
|
const requestedPath = path ?? void 0;
|
|
24537
24552
|
if (initialLoad && lastRequestedPathRef.current === requestedPath) {
|
|
24538
24553
|
return;
|
|
@@ -24545,11 +24560,11 @@ var PagePlugin = (opts) => {
|
|
|
24545
24560
|
setInitialLoad(false);
|
|
24546
24561
|
}
|
|
24547
24562
|
}, [handleRead, initialLoad, path, setInitialLoad]);
|
|
24548
|
-
const [expandedPage, setExpandedPage] = (0,
|
|
24549
|
-
(0,
|
|
24563
|
+
const [expandedPage, setExpandedPage] = (0, import_react24.useState)(activePage);
|
|
24564
|
+
(0, import_react24.useEffect)(() => {
|
|
24550
24565
|
setExpandedPage(activePage);
|
|
24551
24566
|
}, [activePage, setExpandedPage]);
|
|
24552
|
-
const performPageSwitch = (0,
|
|
24567
|
+
const performPageSwitch = (0, import_react24.useCallback)(
|
|
24553
24568
|
(page) => {
|
|
24554
24569
|
if (page.path === activePage) return;
|
|
24555
24570
|
const selectedPage = pagesData.find(
|
|
@@ -24580,7 +24595,7 @@ var PagePlugin = (opts) => {
|
|
|
24580
24595
|
setExpandedPage
|
|
24581
24596
|
]
|
|
24582
24597
|
);
|
|
24583
|
-
const performVersionSwitch = (0,
|
|
24598
|
+
const performVersionSwitch = (0, import_react24.useCallback)(
|
|
24584
24599
|
(page, version3) => {
|
|
24585
24600
|
if (version3.id === currentVersion?.id) return;
|
|
24586
24601
|
const selectedPage = pagesData.find(
|
|
@@ -24595,7 +24610,7 @@ var PagePlugin = (opts) => {
|
|
|
24595
24610
|
},
|
|
24596
24611
|
[currentVersion?.id, pagesData, pushPageHistoryState, setActiveVersion]
|
|
24597
24612
|
);
|
|
24598
|
-
const requiresSwitchConfirmation = (0,
|
|
24613
|
+
const requiresSwitchConfirmation = (0, import_react24.useCallback)(() => {
|
|
24599
24614
|
if (currentVersion?.isNew) return true;
|
|
24600
24615
|
const { history, appState } = getPuck();
|
|
24601
24616
|
if (currentVersion && history.histories.length > 1) {
|
|
@@ -24603,7 +24618,7 @@ var PagePlugin = (opts) => {
|
|
|
24603
24618
|
}
|
|
24604
24619
|
return false;
|
|
24605
24620
|
}, [currentVersion, getPuck]);
|
|
24606
|
-
const onPageClick = (0,
|
|
24621
|
+
const onPageClick = (0, import_react24.useCallback)(
|
|
24607
24622
|
(page) => {
|
|
24608
24623
|
if (page.path === activePage) {
|
|
24609
24624
|
setExpandedPage((s) => s === page.path ? "" : page.path);
|
|
@@ -24618,7 +24633,7 @@ var PagePlugin = (opts) => {
|
|
|
24618
24633
|
},
|
|
24619
24634
|
[activePage, performPageSwitch, requiresSwitchConfirmation, setExpandedPage]
|
|
24620
24635
|
);
|
|
24621
|
-
const onVersionClick = (0,
|
|
24636
|
+
const onVersionClick = (0, import_react24.useCallback)(
|
|
24622
24637
|
(page, version3) => {
|
|
24623
24638
|
if (version3.id === currentVersion?.id) return;
|
|
24624
24639
|
if (requiresSwitchConfirmation()) {
|
|
@@ -24635,7 +24650,7 @@ var PagePlugin = (opts) => {
|
|
|
24635
24650
|
setPendingNavigation
|
|
24636
24651
|
]
|
|
24637
24652
|
);
|
|
24638
|
-
const handleConfirmNavigation = (0,
|
|
24653
|
+
const handleConfirmNavigation = (0, import_react24.useCallback)(async () => {
|
|
24639
24654
|
const action = pendingNavigation;
|
|
24640
24655
|
setPendingNavigation(null);
|
|
24641
24656
|
if (!action) return;
|
|
@@ -24740,7 +24755,7 @@ var PagePlugin = (opts) => {
|
|
|
24740
24755
|
// src/components/HeaderActions/index.tsx
|
|
24741
24756
|
init_react_import();
|
|
24742
24757
|
var import_core12 = require("@puckeditor/core");
|
|
24743
|
-
var
|
|
24758
|
+
var import_react25 = require("react");
|
|
24744
24759
|
|
|
24745
24760
|
// css-module:/home/runner/work/platform/platform/packages/plugin-pages/src/components/HeaderActions/styles.module.css#css-module
|
|
24746
24761
|
init_react_import();
|
|
@@ -24804,7 +24819,7 @@ var HeaderActions = (opts) => {
|
|
|
24804
24819
|
const siteIdHeader = useSiteId();
|
|
24805
24820
|
const siteId = opts?.siteId ?? siteIdHeader;
|
|
24806
24821
|
const host = opts?.host ?? "/api/puck/pages";
|
|
24807
|
-
const [confirmAction, setConfirmAction] = (0,
|
|
24822
|
+
const [confirmAction, setConfirmAction] = (0, import_react25.useState)(null);
|
|
24808
24823
|
const {
|
|
24809
24824
|
buttonsDisabled,
|
|
24810
24825
|
setButtonsDisabled,
|
|
@@ -24818,7 +24833,7 @@ var HeaderActions = (opts) => {
|
|
|
24818
24833
|
setActivePage,
|
|
24819
24834
|
setActiveVersion
|
|
24820
24835
|
} = usePagesStore();
|
|
24821
|
-
const currentVersion = (0,
|
|
24836
|
+
const currentVersion = (0, import_react25.useMemo)(() => {
|
|
24822
24837
|
if (activePage) {
|
|
24823
24838
|
return getActiveVersion({
|
|
24824
24839
|
pagesData,
|
|
@@ -24828,7 +24843,7 @@ var HeaderActions = (opts) => {
|
|
|
24828
24843
|
}
|
|
24829
24844
|
return void 0;
|
|
24830
24845
|
}, [activePage, activeVersion, pagesData]);
|
|
24831
|
-
const currentPage = (0,
|
|
24846
|
+
const currentPage = (0, import_react25.useMemo)(
|
|
24832
24847
|
() => pagesData.find((page) => page.path === activePage),
|
|
24833
24848
|
[activePage, pagesData]
|
|
24834
24849
|
);
|
|
@@ -24885,9 +24900,13 @@ var HeaderActions = (opts) => {
|
|
|
24885
24900
|
nextActiveVersion,
|
|
24886
24901
|
syncHistoryData
|
|
24887
24902
|
}) => {
|
|
24888
|
-
setPageVersions(data.page.id, data.page.versions, data.page.path ?? path
|
|
24903
|
+
setPageVersions(data.page.id, data.page.versions, data.page.path ?? path, {
|
|
24904
|
+
replace: true
|
|
24905
|
+
});
|
|
24889
24906
|
setActivePage(data.page.path ?? path);
|
|
24890
|
-
setActiveVersion(
|
|
24907
|
+
setActiveVersion(
|
|
24908
|
+
data.page.versions?.some((version3) => version3.id === nextActiveVersion) ? nextActiveVersion : data.versionId ?? null
|
|
24909
|
+
);
|
|
24891
24910
|
if (syncHistoryData) {
|
|
24892
24911
|
syncSavedHistory(syncHistoryData);
|
|
24893
24912
|
}
|
|
@@ -24936,7 +24955,7 @@ var HeaderActions = (opts) => {
|
|
|
24936
24955
|
const defaultVersion = getDefaultPageVersion(resolvedPage);
|
|
24937
24956
|
replaceEditorState(defaultVersion?.data);
|
|
24938
24957
|
};
|
|
24939
|
-
const saving = (0,
|
|
24958
|
+
const saving = (0, import_react25.useRef)(false);
|
|
24940
24959
|
const handleSaveDraft = async () => {
|
|
24941
24960
|
if (saving.current) return;
|
|
24942
24961
|
const path = activePage;
|
|
@@ -24973,7 +24992,7 @@ var HeaderActions = (opts) => {
|
|
|
24973
24992
|
saving.current = false;
|
|
24974
24993
|
}
|
|
24975
24994
|
};
|
|
24976
|
-
const publishing = (0,
|
|
24995
|
+
const publishing = (0, import_react25.useRef)(false);
|
|
24977
24996
|
const handlePublish = async () => {
|
|
24978
24997
|
if (publishing.current) return;
|
|
24979
24998
|
const path = activePage;
|
|
@@ -25215,7 +25234,11 @@ function createPagesPlugin(opts) {
|
|
|
25215
25234
|
render: () => /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(PagePlugin, { ...opts }),
|
|
25216
25235
|
icon: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(FileText, {}),
|
|
25217
25236
|
overrides: {
|
|
25218
|
-
|
|
25237
|
+
// Replaces Puck's default actions, keeping other plugins' marked ones.
|
|
25238
|
+
headerActions: ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(import_jsx_runtime52.Fragment, { children: [
|
|
25239
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(ToastWrapper, { children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(HeaderActions, { ...opts }) }),
|
|
25240
|
+
keepHeaderActions(children)
|
|
25241
|
+
] }),
|
|
25219
25242
|
preview: ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Preview, { children })
|
|
25220
25243
|
}
|
|
25221
25244
|
};
|
package/dist/index.mjs
CHANGED
|
@@ -4713,6 +4713,18 @@ function ToastWrapper({ children }) {
|
|
|
4713
4713
|
] });
|
|
4714
4714
|
}
|
|
4715
4715
|
|
|
4716
|
+
// ../platform-client/lib/header-actions.ts
|
|
4717
|
+
init_react_import();
|
|
4718
|
+
import {
|
|
4719
|
+
cloneElement as cloneElement2,
|
|
4720
|
+
isValidElement
|
|
4721
|
+
} from "react";
|
|
4722
|
+
var HEADER_ACTIONS = Symbol.for("@puckeditor/header-actions");
|
|
4723
|
+
var isHeaderActions = (node) => isValidElement(node) && typeof node.type !== "string" && HEADER_ACTIONS in node.type;
|
|
4724
|
+
var keepHeaderActions = (children) => isHeaderActions(children) ? cloneElement2(children, {
|
|
4725
|
+
children: keepHeaderActions(children.props.children)
|
|
4726
|
+
}) : null;
|
|
4727
|
+
|
|
4716
4728
|
// src/components/PagePlugin/index.tsx
|
|
4717
4729
|
init_react_import();
|
|
4718
4730
|
|
|
@@ -4771,7 +4783,7 @@ init_react_import();
|
|
|
4771
4783
|
|
|
4772
4784
|
// css-module:/home/runner/work/platform/platform/packages/platform-client/components/Modal/Modal.module.css#css-module
|
|
4773
4785
|
init_react_import();
|
|
4774
|
-
var Modal_module_default = { "Modal-background": "_Modal-
|
|
4786
|
+
var Modal_module_default = { "Modal-background": "_Modal-background_mocy5_1", "Modal--visible": "_Modal--visible_mocy5_16", "Modal-modal": "_Modal-modal_mocy5_22" };
|
|
4775
4787
|
|
|
4776
4788
|
// ../platform-client/components/Modal/Modal.tsx
|
|
4777
4789
|
import { createContext as createContext6, useContext as useContext7 } from "react";
|
|
@@ -5345,7 +5357,7 @@ import { useState as useState25 } from "react";
|
|
|
5345
5357
|
|
|
5346
5358
|
// css-module:/home/runner/work/platform/platform/packages/platform-client/components/Menu/styles.module.css#css-module
|
|
5347
5359
|
init_react_import();
|
|
5348
|
-
var styles_module_default3 = { "Menu": "
|
|
5360
|
+
var styles_module_default3 = { "Menu": "_Menu_1jr57_1", "Menu-content": "_Menu-content_1jr57_6", "Menu-sections": "_Menu-sections_1jr57_11", "Menu-action": "_Menu-action_1jr57_22", "Menu-list": "_Menu-list_1jr57_44", "Menu-item": "_Menu-item_1jr57_55", "Menu-item--disabled": "_Menu-item--disabled_1jr57_84" };
|
|
5349
5361
|
|
|
5350
5362
|
// ../../node_modules/.pnpm/@radix-ui+react-popover@1.1.15_@types+react-dom@19.2.0_@types+react@19.2.0__@types+reac_e6e9e3f3089a7a72fc73cc2cd9dafc33/node_modules/@radix-ui/react-popover/dist/index.mjs
|
|
5351
5363
|
init_react_import();
|
|
@@ -7986,7 +7998,7 @@ init_react_import();
|
|
|
7986
7998
|
|
|
7987
7999
|
// css-module:/home/runner/work/platform/platform/packages/platform-client/components/Tag/Tag.module.css#css-module
|
|
7988
8000
|
init_react_import();
|
|
7989
|
-
var Tag_module_default = { "Tag": "
|
|
8001
|
+
var Tag_module_default = { "Tag": "_Tag_162k8_1", "Tag--borderless": "_Tag--borderless_162k8_21", "Tag--colorBlue": "_Tag--colorBlue_162k8_25", "Tag--colorGreen": "_Tag--colorGreen_162k8_30", "Tag--colorRed": "_Tag--colorRed_162k8_34", "Tag--colorMuted": "_Tag--colorMuted_162k8_38", "Tag-sprite": "_Tag-sprite_162k8_42", "Tag--pulse": "_Tag--pulse_162k8_46", "pulse": "_pulse_162k8_1", "Tag-label": "_Tag-label_162k8_80" };
|
|
7990
8002
|
|
|
7991
8003
|
// ../platform-client/components/Tag/Tag.tsx
|
|
7992
8004
|
import { jsx as jsx33, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
@@ -21979,7 +21991,7 @@ var usePagesStore = create((set3) => ({
|
|
|
21979
21991
|
};
|
|
21980
21992
|
})
|
|
21981
21993
|
})),
|
|
21982
|
-
setPageVersions: (pageId, versions, path) => set3((state) => ({
|
|
21994
|
+
setPageVersions: (pageId, versions, path, { replace = false } = {}) => set3((state) => ({
|
|
21983
21995
|
...state,
|
|
21984
21996
|
pagesData: state.pagesData.map((page) => {
|
|
21985
21997
|
const matchesPage = page.id === pageId || !!path && page.path === path;
|
|
@@ -21993,7 +22005,7 @@ var usePagesStore = create((set3) => ({
|
|
|
21993
22005
|
return {
|
|
21994
22006
|
...page,
|
|
21995
22007
|
id: pageId,
|
|
21996
|
-
versions: isFirstPersistForOptimisticPage ? versions : merged
|
|
22008
|
+
versions: replace || isFirstPersistForOptimisticPage ? versions : merged
|
|
21997
22009
|
};
|
|
21998
22010
|
})
|
|
21999
22011
|
})),
|
|
@@ -22251,8 +22263,13 @@ var postMessageToParent = ({
|
|
|
22251
22263
|
window.parent.postMessage(message2, parentOrigin);
|
|
22252
22264
|
};
|
|
22253
22265
|
|
|
22266
|
+
// src/lib/is-embedded.ts
|
|
22267
|
+
init_react_import();
|
|
22268
|
+
var isEmbedded = () => typeof window !== "undefined" && window.self !== window.top;
|
|
22269
|
+
|
|
22254
22270
|
// src/lib/request-token.ts
|
|
22255
22271
|
var requestToken = (parentOrigin) => {
|
|
22272
|
+
if (!isEmbedded()) return Promise.resolve("");
|
|
22256
22273
|
return new Promise((resolve) => {
|
|
22257
22274
|
const handler = async (event) => {
|
|
22258
22275
|
if (event.origin !== parentOrigin) return;
|
|
@@ -22293,6 +22310,7 @@ var getActiveVersion = ({
|
|
|
22293
22310
|
init_react_import();
|
|
22294
22311
|
var RETRY_INTERVAL_MS = 100;
|
|
22295
22312
|
var waitForParentReady = (parentOrigin) => {
|
|
22313
|
+
if (!isEmbedded()) return Promise.resolve();
|
|
22296
22314
|
return new Promise((resolve) => {
|
|
22297
22315
|
let intervalId = 0;
|
|
22298
22316
|
const sendReadyCheck = () => {
|
|
@@ -24509,8 +24527,8 @@ var PagePlugin = (opts) => {
|
|
|
24509
24527
|
createPage("/");
|
|
24510
24528
|
postToParent({ type: "DATA_READY" });
|
|
24511
24529
|
}
|
|
24512
|
-
setLoading(false);
|
|
24513
24530
|
}
|
|
24531
|
+
setLoading(false);
|
|
24514
24532
|
},
|
|
24515
24533
|
[
|
|
24516
24534
|
host,
|
|
@@ -24880,9 +24898,13 @@ var HeaderActions = (opts) => {
|
|
|
24880
24898
|
nextActiveVersion,
|
|
24881
24899
|
syncHistoryData
|
|
24882
24900
|
}) => {
|
|
24883
|
-
setPageVersions(data.page.id, data.page.versions, data.page.path ?? path
|
|
24901
|
+
setPageVersions(data.page.id, data.page.versions, data.page.path ?? path, {
|
|
24902
|
+
replace: true
|
|
24903
|
+
});
|
|
24884
24904
|
setActivePage(data.page.path ?? path);
|
|
24885
|
-
setActiveVersion(
|
|
24905
|
+
setActiveVersion(
|
|
24906
|
+
data.page.versions?.some((version3) => version3.id === nextActiveVersion) ? nextActiveVersion : data.versionId ?? null
|
|
24907
|
+
);
|
|
24886
24908
|
if (syncHistoryData) {
|
|
24887
24909
|
syncSavedHistory(syncHistoryData);
|
|
24888
24910
|
}
|
|
@@ -25202,7 +25224,7 @@ var Preview = ({ children }) => {
|
|
|
25202
25224
|
};
|
|
25203
25225
|
|
|
25204
25226
|
// src/index.tsx
|
|
25205
|
-
import { jsx as jsx45 } from "react/jsx-runtime";
|
|
25227
|
+
import { Fragment as Fragment10, jsx as jsx45, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
25206
25228
|
function createPagesPlugin(opts) {
|
|
25207
25229
|
return {
|
|
25208
25230
|
label: "Pages",
|
|
@@ -25210,7 +25232,11 @@ function createPagesPlugin(opts) {
|
|
|
25210
25232
|
render: () => /* @__PURE__ */ jsx45(PagePlugin, { ...opts }),
|
|
25211
25233
|
icon: /* @__PURE__ */ jsx45(FileText, {}),
|
|
25212
25234
|
overrides: {
|
|
25213
|
-
|
|
25235
|
+
// Replaces Puck's default actions, keeping other plugins' marked ones.
|
|
25236
|
+
headerActions: ({ children }) => /* @__PURE__ */ jsxs22(Fragment10, { children: [
|
|
25237
|
+
/* @__PURE__ */ jsx45(ToastWrapper, { children: /* @__PURE__ */ jsx45(HeaderActions, { ...opts }) }),
|
|
25238
|
+
keepHeaderActions(children)
|
|
25239
|
+
] }),
|
|
25214
25240
|
preview: ({ children }) => /* @__PURE__ */ jsx45(Preview, { children })
|
|
25215
25241
|
}
|
|
25216
25242
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@puckeditor/plugin-pages",
|
|
3
|
-
"version": "0.9.0-canary.
|
|
3
|
+
"version": "0.9.0-canary.4146ddf7",
|
|
4
4
|
"author": "Chris Villa <chris@puckeditor.com>",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"zustand": "^5.0.8"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@puckeditor/core": "0.24.0
|
|
31
|
+
"@puckeditor/core": "0.24.0",
|
|
32
32
|
"@radix-ui/react-popover": "^1.1.15",
|
|
33
33
|
"@testing-library/dom": "^10.4.1",
|
|
34
34
|
"@testing-library/react": "^16.3.2",
|
|
@@ -46,10 +46,10 @@
|
|
|
46
46
|
"vite-tsconfig-paths": "^5.1.4",
|
|
47
47
|
"vitest": "^4.1.11",
|
|
48
48
|
"zod": "^4.1.12",
|
|
49
|
-
"@puckeditor/platform-types": "0.9.0-canary.
|
|
50
|
-
"eslint-config-custom": "0.9.0-canary.
|
|
51
|
-
"
|
|
52
|
-
"
|
|
49
|
+
"@puckeditor/platform-types": "0.9.0-canary.4146ddf7",
|
|
50
|
+
"eslint-config-custom": "0.9.0-canary.4146ddf7",
|
|
51
|
+
"tsconfig": "0.9.0-canary.4146ddf7",
|
|
52
|
+
"tsup-config": "0.9.0-canary.4146ddf7"
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
55
55
|
"@puckeditor/core": "^0.21.0 || 0.21.0-canary.de0baf39",
|