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