@measured/puck-plugin-heading-analyzer 0.21.0-canary.a3dabae1 → 0.21.0-canary.bd7b613d
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 +5 -5
- package/dist/index.mjs +5 -5
- package/package.json +2 -2
package/dist/index.js
CHANGED
@@ -544,7 +544,7 @@ var walkField = ({
|
|
544
544
|
config,
|
545
545
|
recurseSlots = false
|
546
546
|
}) => {
|
547
|
-
var _a, _b, _c, _d
|
547
|
+
var _a, _b, _c, _d;
|
548
548
|
const fieldType = (_a = fields[propKey]) == null ? void 0 : _a.type;
|
549
549
|
const map = mappers[fieldType];
|
550
550
|
if (map && fieldType === "slot") {
|
@@ -554,10 +554,10 @@ var walkField = ({
|
|
554
554
|
for (let i = 0; i < content.length; i++) {
|
555
555
|
const el = content[i];
|
556
556
|
const componentConfig = config.components[el.type];
|
557
|
-
if (!componentConfig
|
557
|
+
if (!componentConfig) {
|
558
558
|
continue;
|
559
559
|
}
|
560
|
-
const fields2 = (
|
560
|
+
const fields2 = (_b = componentConfig.fields) != null ? _b : {};
|
561
561
|
mappedContent.push(
|
562
562
|
walkField({
|
563
563
|
value: __spreadProps(__spreadValues({}, el), { props: defaultSlots(el.props, fields2) }),
|
@@ -591,7 +591,7 @@ var walkField = ({
|
|
591
591
|
}
|
592
592
|
if (value && typeof value === "object") {
|
593
593
|
if (Array.isArray(value)) {
|
594
|
-
const arrayFields = ((
|
594
|
+
const arrayFields = ((_c = fields[propKey]) == null ? void 0 : _c.type) === "array" ? fields[propKey].arrayFields : null;
|
595
595
|
if (!arrayFields) return value;
|
596
596
|
const newValue = value.map(
|
597
597
|
(el, idx) => walkField({
|
@@ -612,7 +612,7 @@ var walkField = ({
|
|
612
612
|
} else if ("$$typeof" in value) {
|
613
613
|
return value;
|
614
614
|
} else {
|
615
|
-
const objectFields = ((
|
615
|
+
const objectFields = ((_d = fields[propKey]) == null ? void 0 : _d.type) === "object" ? fields[propKey].objectFields : fields;
|
616
616
|
return walkObject({
|
617
617
|
value,
|
618
618
|
fields: objectFields,
|
package/dist/index.mjs
CHANGED
@@ -532,7 +532,7 @@ var walkField = ({
|
|
532
532
|
config,
|
533
533
|
recurseSlots = false
|
534
534
|
}) => {
|
535
|
-
var _a, _b, _c, _d
|
535
|
+
var _a, _b, _c, _d;
|
536
536
|
const fieldType = (_a = fields[propKey]) == null ? void 0 : _a.type;
|
537
537
|
const map = mappers[fieldType];
|
538
538
|
if (map && fieldType === "slot") {
|
@@ -542,10 +542,10 @@ var walkField = ({
|
|
542
542
|
for (let i = 0; i < content.length; i++) {
|
543
543
|
const el = content[i];
|
544
544
|
const componentConfig = config.components[el.type];
|
545
|
-
if (!componentConfig
|
545
|
+
if (!componentConfig) {
|
546
546
|
continue;
|
547
547
|
}
|
548
|
-
const fields2 = (
|
548
|
+
const fields2 = (_b = componentConfig.fields) != null ? _b : {};
|
549
549
|
mappedContent.push(
|
550
550
|
walkField({
|
551
551
|
value: __spreadProps(__spreadValues({}, el), { props: defaultSlots(el.props, fields2) }),
|
@@ -579,7 +579,7 @@ var walkField = ({
|
|
579
579
|
}
|
580
580
|
if (value && typeof value === "object") {
|
581
581
|
if (Array.isArray(value)) {
|
582
|
-
const arrayFields = ((
|
582
|
+
const arrayFields = ((_c = fields[propKey]) == null ? void 0 : _c.type) === "array" ? fields[propKey].arrayFields : null;
|
583
583
|
if (!arrayFields) return value;
|
584
584
|
const newValue = value.map(
|
585
585
|
(el, idx) => walkField({
|
@@ -600,7 +600,7 @@ var walkField = ({
|
|
600
600
|
} else if ("$$typeof" in value) {
|
601
601
|
return value;
|
602
602
|
} else {
|
603
|
-
const objectFields = ((
|
603
|
+
const objectFields = ((_d = fields[propKey]) == null ? void 0 : _d.type) === "object" ? fields[propKey].objectFields : fields;
|
604
604
|
return walkObject({
|
605
605
|
value,
|
606
606
|
fields: objectFields,
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@measured/puck-plugin-heading-analyzer",
|
3
|
-
"version": "0.21.0-canary.
|
3
|
+
"version": "0.21.0-canary.bd7b613d",
|
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.21.0-canary.
|
28
|
+
"@measured/puck": "^0.21.0-canary.bd7b613d",
|
29
29
|
"@types/react": "^19.0.1",
|
30
30
|
"@types/react-dom": "^19.0.2",
|
31
31
|
"eslint": "^7.32.0",
|