@measured/puck-plugin-heading-analyzer 0.16.0-canary.60fe631 → 0.16.0-canary.6386bd1
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.js +20 -25
- package/package.json +2 -2
package/dist/index.js
CHANGED
@@ -75162,7 +75162,7 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
|
|
75162
75162
|
return ui;
|
75163
75163
|
};
|
75164
75164
|
init_react_import2();
|
75165
|
-
var storeInterceptor = (reducer2, record) => {
|
75165
|
+
var storeInterceptor = (reducer2, record, onAction) => {
|
75166
75166
|
return (state, action) => {
|
75167
75167
|
const newAppState = reducer2(state, action);
|
75168
75168
|
const isValidType = ![
|
@@ -75175,6 +75175,7 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
|
|
75175
75175
|
if (typeof action.recordHistory !== "undefined" ? action.recordHistory : isValidType) {
|
75176
75176
|
if (record) record(newAppState);
|
75177
75177
|
}
|
75178
|
+
onAction == null ? void 0 : onAction(action, newAppState, state);
|
75178
75179
|
return newAppState;
|
75179
75180
|
};
|
75180
75181
|
};
|
@@ -75186,16 +75187,21 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
|
|
75186
75187
|
};
|
75187
75188
|
function createReducer({
|
75188
75189
|
config,
|
75189
|
-
record
|
75190
|
+
record,
|
75191
|
+
onAction
|
75190
75192
|
}) {
|
75191
|
-
return storeInterceptor(
|
75192
|
-
|
75193
|
-
|
75194
|
-
|
75195
|
-
|
75196
|
-
|
75197
|
-
|
75198
|
-
|
75193
|
+
return storeInterceptor(
|
75194
|
+
(state, action) => {
|
75195
|
+
const data = reduceData(state.data, action, config);
|
75196
|
+
const ui = reduceUi(state.ui, action);
|
75197
|
+
if (action.type === "set") {
|
75198
|
+
return setAction(state, action);
|
75199
|
+
}
|
75200
|
+
return { data, ui };
|
75201
|
+
},
|
75202
|
+
record,
|
75203
|
+
onAction
|
75204
|
+
);
|
75199
75205
|
}
|
75200
75206
|
init_react_import2();
|
75201
75207
|
var flushZones = (appState) => {
|
@@ -75434,20 +75440,8 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
|
|
75434
75440
|
},
|
75435
75441
|
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: getClassName19("inner"), children: [
|
75436
75442
|
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: getClassName19("history"), children: [
|
75437
|
-
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(IconButton, { title: "undo", disabled: !hasPast, onClick: back, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
75438
|
-
|
75439
|
-
{
|
75440
|
-
size: 21,
|
75441
|
-
stroke: hasPast ? "var(--puck-color-black)" : "var(--puck-color-grey-08)"
|
75442
|
-
}
|
75443
|
-
) }),
|
75444
|
-
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(IconButton, { title: "redo", disabled: !hasFuture, onClick: forward, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
75445
|
-
Redo2,
|
75446
|
-
{
|
75447
|
-
size: 21,
|
75448
|
-
stroke: hasFuture ? "var(--puck-color-black)" : "var(--puck-color-grey-08)"
|
75449
|
-
}
|
75450
|
-
) })
|
75443
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(IconButton, { title: "undo", disabled: !hasPast, onClick: back, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Undo2, { size: 21 }) }),
|
75444
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(IconButton, { title: "redo", disabled: !hasFuture, onClick: forward, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Redo2, { size: 21 }) })
|
75451
75445
|
] }),
|
75452
75446
|
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_jsx_runtime25.Fragment, { children: renderHeaderActions && renderHeaderActions({
|
75453
75447
|
state: appState,
|
@@ -76793,6 +76787,7 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
|
|
76793
76787
|
ui: initialUi,
|
76794
76788
|
onChange,
|
76795
76789
|
onPublish,
|
76790
|
+
onAction,
|
76796
76791
|
plugins = [],
|
76797
76792
|
overrides = {},
|
76798
76793
|
renderHeader,
|
@@ -76809,7 +76804,7 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
|
|
76809
76804
|
var _a3;
|
76810
76805
|
const historyStore = useHistoryStore(initialHistory);
|
76811
76806
|
const [reducer2] = (0, import_react30.useState)(
|
76812
|
-
() => createReducer({ config, record: historyStore.record })
|
76807
|
+
() => createReducer({ config, record: historyStore.record, onAction })
|
76813
76808
|
);
|
76814
76809
|
const [initialAppState] = (0, import_react30.useState)(() => {
|
76815
76810
|
var _a22, _b2, _c, _d, _e, _f, _g;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@measured/puck-plugin-heading-analyzer",
|
3
|
-
"version": "0.16.0-canary.
|
3
|
+
"version": "0.16.0-canary.6386bd1",
|
4
4
|
"author": "Measured Corporation Ltd <hello@measured.co>",
|
5
5
|
"repository": "measuredco/puck",
|
6
6
|
"bugs": "https://github.com/measuredco/puck/issues",
|
@@ -18,7 +18,7 @@
|
|
18
18
|
"dist"
|
19
19
|
],
|
20
20
|
"devDependencies": {
|
21
|
-
"@measured/puck": "^0.16.0-canary.
|
21
|
+
"@measured/puck": "^0.16.0-canary.6386bd1",
|
22
22
|
"@types/react": "^18.2.0",
|
23
23
|
"@types/react-dom": "^18.2.0",
|
24
24
|
"eslint": "^7.32.0",
|