@measured/puck-plugin-heading-analyzer 0.19.0-canary.3bb481b1 → 0.19.0-canary.427e686f
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +14 -14
- package/dist/index.mjs +14 -14
- package/package.json +2 -2
package/dist/index.js
CHANGED
@@ -371,7 +371,7 @@ init_react_import();
|
|
371
371
|
// ../core/reducer/actions/set.ts
|
372
372
|
init_react_import();
|
373
373
|
|
374
|
-
// ../core/lib/data/walk-
|
374
|
+
// ../core/lib/data/walk-app-state.ts
|
375
375
|
init_react_import();
|
376
376
|
|
377
377
|
// ../core/lib/data/for-each-slot.ts
|
@@ -460,8 +460,8 @@ var stripSlots = (data) => {
|
|
460
460
|
});
|
461
461
|
};
|
462
462
|
|
463
|
-
// ../core/lib/data/walk-
|
464
|
-
function
|
463
|
+
// ../core/lib/data/walk-app-state.ts
|
464
|
+
function walkAppState(state, config, mapContent = (content) => content, mapNodeOrSkip = (item) => item) {
|
465
465
|
var _a;
|
466
466
|
let newZones = {};
|
467
467
|
const newZoneIndex = {};
|
@@ -594,7 +594,7 @@ var setAction = (state, action, appStore) => {
|
|
594
594
|
console.warn(
|
595
595
|
"`set` is expensive and may cause unnecessary re-renders. Consider using a more atomic action instead."
|
596
596
|
);
|
597
|
-
return
|
597
|
+
return walkAppState(newState, appStore.config);
|
598
598
|
}
|
599
599
|
return __spreadValues(__spreadValues({}, state), action.state(state));
|
600
600
|
};
|
@@ -691,7 +691,7 @@ function insertAction(state, action, appStore) {
|
|
691
691
|
};
|
692
692
|
const [parentId] = action.destinationZone.split(":");
|
693
693
|
const idsInPath = getIdsForParent(action.destinationZone, state);
|
694
|
-
return
|
694
|
+
return walkAppState(
|
695
695
|
state,
|
696
696
|
appStore.config,
|
697
697
|
(content, zoneCompound) => {
|
@@ -729,7 +729,7 @@ var replaceAction = (state, action, appStore) => {
|
|
729
729
|
`Can't change the id during a replace action. Please us "remove" and "insert" to define a new node.`
|
730
730
|
);
|
731
731
|
}
|
732
|
-
return
|
732
|
+
return walkAppState(
|
733
733
|
state,
|
734
734
|
appStore.config,
|
735
735
|
(content, zoneCompound) => {
|
@@ -758,7 +758,7 @@ var replaceAction = (state, action, appStore) => {
|
|
758
758
|
// ../core/reducer/actions/replace-root.ts
|
759
759
|
init_react_import();
|
760
760
|
var replaceRootAction = (state, action, appStore) => {
|
761
|
-
return
|
761
|
+
return walkAppState(
|
762
762
|
state,
|
763
763
|
appStore.config,
|
764
764
|
(content) => content,
|
@@ -797,7 +797,7 @@ function duplicateAction(state, action, appStore) {
|
|
797
797
|
id: generateId(item.type)
|
798
798
|
})
|
799
799
|
});
|
800
|
-
const modified =
|
800
|
+
const modified = walkAppState(
|
801
801
|
state,
|
802
802
|
appStore.config,
|
803
803
|
(content, zoneCompound) => {
|
@@ -862,7 +862,7 @@ var moveAction = (state, action, appStore) => {
|
|
862
862
|
if (!item) return state;
|
863
863
|
const idsInSourcePath = getIdsForParent(action.sourceZone, state);
|
864
864
|
const idsInDestinationPath = getIdsForParent(action.destinationZone, state);
|
865
|
-
return
|
865
|
+
return walkAppState(
|
866
866
|
state,
|
867
867
|
appStore.config,
|
868
868
|
(content, zoneCompound) => {
|
@@ -920,7 +920,7 @@ var removeAction = (state, action, appStore) => {
|
|
920
920
|
},
|
921
921
|
[item.props.id]
|
922
922
|
);
|
923
|
-
const newState =
|
923
|
+
const newState = walkAppState(
|
924
924
|
state,
|
925
925
|
appStore.config,
|
926
926
|
(content, zoneCompound) => {
|
@@ -1011,14 +1011,14 @@ var setDataAction = (state, action, appStore) => {
|
|
1011
1011
|
console.warn(
|
1012
1012
|
"`setData` is expensive and may cause unnecessary re-renders. Consider using a more atomic action instead."
|
1013
1013
|
);
|
1014
|
-
return
|
1014
|
+
return walkAppState(
|
1015
1015
|
__spreadProps(__spreadValues({}, state), {
|
1016
1016
|
data: __spreadValues(__spreadValues({}, state.data), action.data)
|
1017
1017
|
}),
|
1018
1018
|
appStore.config
|
1019
1019
|
);
|
1020
1020
|
}
|
1021
|
-
return
|
1021
|
+
return walkAppState(
|
1022
1022
|
__spreadProps(__spreadValues({}, state), {
|
1023
1023
|
data: __spreadValues(__spreadValues({}, state.data), action.data(state.data))
|
1024
1024
|
}),
|
@@ -1358,7 +1358,7 @@ var import_react7 = require("react");
|
|
1358
1358
|
init_react_import();
|
1359
1359
|
var flattenData = (state, config) => {
|
1360
1360
|
const data = [];
|
1361
|
-
|
1361
|
+
walkAppState(
|
1362
1362
|
state,
|
1363
1363
|
config,
|
1364
1364
|
(content) => content,
|
@@ -1770,7 +1770,7 @@ var createAppStore = (initialAppStore) => create()(
|
|
1770
1770
|
}),
|
1771
1771
|
resolveAndCommitData: () => __async(void 0, null, function* () {
|
1772
1772
|
const { config, state, dispatch, resolveComponentData: resolveComponentData2 } = get();
|
1773
|
-
|
1773
|
+
walkAppState(
|
1774
1774
|
state,
|
1775
1775
|
config,
|
1776
1776
|
(content) => content,
|
package/dist/index.mjs
CHANGED
@@ -359,7 +359,7 @@ init_react_import();
|
|
359
359
|
// ../core/reducer/actions/set.ts
|
360
360
|
init_react_import();
|
361
361
|
|
362
|
-
// ../core/lib/data/walk-
|
362
|
+
// ../core/lib/data/walk-app-state.ts
|
363
363
|
init_react_import();
|
364
364
|
|
365
365
|
// ../core/lib/data/for-each-slot.ts
|
@@ -448,8 +448,8 @@ var stripSlots = (data) => {
|
|
448
448
|
});
|
449
449
|
};
|
450
450
|
|
451
|
-
// ../core/lib/data/walk-
|
452
|
-
function
|
451
|
+
// ../core/lib/data/walk-app-state.ts
|
452
|
+
function walkAppState(state, config, mapContent = (content) => content, mapNodeOrSkip = (item) => item) {
|
453
453
|
var _a;
|
454
454
|
let newZones = {};
|
455
455
|
const newZoneIndex = {};
|
@@ -582,7 +582,7 @@ var setAction = (state, action, appStore) => {
|
|
582
582
|
console.warn(
|
583
583
|
"`set` is expensive and may cause unnecessary re-renders. Consider using a more atomic action instead."
|
584
584
|
);
|
585
|
-
return
|
585
|
+
return walkAppState(newState, appStore.config);
|
586
586
|
}
|
587
587
|
return __spreadValues(__spreadValues({}, state), action.state(state));
|
588
588
|
};
|
@@ -679,7 +679,7 @@ function insertAction(state, action, appStore) {
|
|
679
679
|
};
|
680
680
|
const [parentId] = action.destinationZone.split(":");
|
681
681
|
const idsInPath = getIdsForParent(action.destinationZone, state);
|
682
|
-
return
|
682
|
+
return walkAppState(
|
683
683
|
state,
|
684
684
|
appStore.config,
|
685
685
|
(content, zoneCompound) => {
|
@@ -717,7 +717,7 @@ var replaceAction = (state, action, appStore) => {
|
|
717
717
|
`Can't change the id during a replace action. Please us "remove" and "insert" to define a new node.`
|
718
718
|
);
|
719
719
|
}
|
720
|
-
return
|
720
|
+
return walkAppState(
|
721
721
|
state,
|
722
722
|
appStore.config,
|
723
723
|
(content, zoneCompound) => {
|
@@ -746,7 +746,7 @@ var replaceAction = (state, action, appStore) => {
|
|
746
746
|
// ../core/reducer/actions/replace-root.ts
|
747
747
|
init_react_import();
|
748
748
|
var replaceRootAction = (state, action, appStore) => {
|
749
|
-
return
|
749
|
+
return walkAppState(
|
750
750
|
state,
|
751
751
|
appStore.config,
|
752
752
|
(content) => content,
|
@@ -785,7 +785,7 @@ function duplicateAction(state, action, appStore) {
|
|
785
785
|
id: generateId(item.type)
|
786
786
|
})
|
787
787
|
});
|
788
|
-
const modified =
|
788
|
+
const modified = walkAppState(
|
789
789
|
state,
|
790
790
|
appStore.config,
|
791
791
|
(content, zoneCompound) => {
|
@@ -850,7 +850,7 @@ var moveAction = (state, action, appStore) => {
|
|
850
850
|
if (!item) return state;
|
851
851
|
const idsInSourcePath = getIdsForParent(action.sourceZone, state);
|
852
852
|
const idsInDestinationPath = getIdsForParent(action.destinationZone, state);
|
853
|
-
return
|
853
|
+
return walkAppState(
|
854
854
|
state,
|
855
855
|
appStore.config,
|
856
856
|
(content, zoneCompound) => {
|
@@ -908,7 +908,7 @@ var removeAction = (state, action, appStore) => {
|
|
908
908
|
},
|
909
909
|
[item.props.id]
|
910
910
|
);
|
911
|
-
const newState =
|
911
|
+
const newState = walkAppState(
|
912
912
|
state,
|
913
913
|
appStore.config,
|
914
914
|
(content, zoneCompound) => {
|
@@ -999,14 +999,14 @@ var setDataAction = (state, action, appStore) => {
|
|
999
999
|
console.warn(
|
1000
1000
|
"`setData` is expensive and may cause unnecessary re-renders. Consider using a more atomic action instead."
|
1001
1001
|
);
|
1002
|
-
return
|
1002
|
+
return walkAppState(
|
1003
1003
|
__spreadProps(__spreadValues({}, state), {
|
1004
1004
|
data: __spreadValues(__spreadValues({}, state.data), action.data)
|
1005
1005
|
}),
|
1006
1006
|
appStore.config
|
1007
1007
|
);
|
1008
1008
|
}
|
1009
|
-
return
|
1009
|
+
return walkAppState(
|
1010
1010
|
__spreadProps(__spreadValues({}, state), {
|
1011
1011
|
data: __spreadValues(__spreadValues({}, state.data), action.data(state.data))
|
1012
1012
|
}),
|
@@ -1346,7 +1346,7 @@ import { useEffect as useEffect3 } from "react";
|
|
1346
1346
|
init_react_import();
|
1347
1347
|
var flattenData = (state, config) => {
|
1348
1348
|
const data = [];
|
1349
|
-
|
1349
|
+
walkAppState(
|
1350
1350
|
state,
|
1351
1351
|
config,
|
1352
1352
|
(content) => content,
|
@@ -1758,7 +1758,7 @@ var createAppStore = (initialAppStore) => create()(
|
|
1758
1758
|
}),
|
1759
1759
|
resolveAndCommitData: () => __async(void 0, null, function* () {
|
1760
1760
|
const { config, state, dispatch, resolveComponentData: resolveComponentData2 } = get();
|
1761
|
-
|
1761
|
+
walkAppState(
|
1762
1762
|
state,
|
1763
1763
|
config,
|
1764
1764
|
(content) => content,
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@measured/puck-plugin-heading-analyzer",
|
3
|
-
"version": "0.19.0-canary.
|
3
|
+
"version": "0.19.0-canary.427e686f",
|
4
4
|
"author": "Chris Villa <chris@puckeditor.com>",
|
5
5
|
"repository": "measuredco/puck",
|
6
6
|
"bugs": "https://github.com/measuredco/puck/issues",
|
@@ -25,7 +25,7 @@
|
|
25
25
|
"dist"
|
26
26
|
],
|
27
27
|
"devDependencies": {
|
28
|
-
"@measured/puck": "^0.19.0-canary.
|
28
|
+
"@measured/puck": "^0.19.0-canary.427e686f",
|
29
29
|
"@types/react": "^19.0.1",
|
30
30
|
"@types/react-dom": "^19.0.2",
|
31
31
|
"eslint": "^7.32.0",
|