@measured/puck-plugin-heading-analyzer 0.15.0-canary.e2cd445 → 0.15.1-canary.0daf478
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 +14 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +54 -22
- package/package.json +2 -2
package/dist/index.css
CHANGED
@@ -1,3 +1,17 @@
|
|
1
|
+
/* css-module:/home/runner/work/puck/puck/packages/plugin-heading-analyzer/src/HeadingAnalyzer.module.css/#css-module-data */
|
2
|
+
._HeadingAnalyzer_116v6_1 {
|
3
|
+
display: block;
|
4
|
+
}
|
5
|
+
._HeadingAnalyzer-cssWarning_116v6_5 {
|
6
|
+
display: none !important;
|
7
|
+
}
|
8
|
+
._HeadingAnalyzerItem_116v6_9 {
|
9
|
+
display: inline;
|
10
|
+
}
|
11
|
+
._HeadingAnalyzerItem--missing_116v6_13 {
|
12
|
+
color: var(--puck-color-red-04);
|
13
|
+
}
|
14
|
+
|
1
15
|
/* css-module:/home/runner/work/puck/puck/packages/core/components/SidebarSection/styles.module.css/#css-module-data */
|
2
16
|
._SidebarSection_125qe_1 {
|
3
17
|
display: flex;
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
@@ -42996,7 +42996,7 @@ var require_factoryWithTypeCheckers = __commonJS({
|
|
42996
42996
|
function validate2(props, propName, componentName, location, propFullName) {
|
42997
42997
|
if (!(props[propName] instanceof expectedClass)) {
|
42998
42998
|
var expectedClassName = expectedClass.name || ANONYMOUS;
|
42999
|
-
var actualClassName =
|
42999
|
+
var actualClassName = getClassName6(props[propName]);
|
43000
43000
|
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + actualClassName + "` supplied to `" + componentName + "`, expected ") + ("instance of `" + expectedClassName + "`."));
|
43001
43001
|
}
|
43002
43002
|
return null;
|
@@ -43248,7 +43248,7 @@ var require_factoryWithTypeCheckers = __commonJS({
|
|
43248
43248
|
return type;
|
43249
43249
|
}
|
43250
43250
|
}
|
43251
|
-
function
|
43251
|
+
function getClassName6(propValue) {
|
43252
43252
|
if (!propValue.constructor || !propValue.constructor.name) {
|
43253
43253
|
return ANONYMOUS;
|
43254
43254
|
}
|
@@ -73739,7 +73739,7 @@ var require_dist = __commonJS({
|
|
73739
73739
|
};
|
73740
73740
|
var get_class_name_factory_default2 = getClassNameFactory2;
|
73741
73741
|
init_react_import2();
|
73742
|
-
var styles_module_default5 = { "Input": "
|
73742
|
+
var styles_module_default5 = { "Input": "_Input_3pq3z_1", "Input-label": "_Input-label_3pq3z_26", "Input-labelIcon": "_Input-labelIcon_3pq3z_35", "Input-disabledIcon": "_Input-disabledIcon_3pq3z_42", "Input-input": "_Input-input_3pq3z_47", "Input--readOnly": "_Input--readOnly_3pq3z_91", "Input-radioGroupItems": "_Input-radioGroupItems_3pq3z_102", "Input-radio": "_Input-radio_3pq3z_102", "Input-radioInner": "_Input-radioInner_3pq3z_119", "Input-radioInput": "_Input-radioInput_3pq3z_164" };
|
73743
73743
|
var import_react112 = require("react");
|
73744
73744
|
init_react_import2();
|
73745
73745
|
init_react_import2();
|
@@ -73976,7 +73976,7 @@ var require_dist = __commonJS({
|
|
73976
73976
|
init_react_import2();
|
73977
73977
|
var styles_module_default32 = { "Loader": "_Loader_nacdm_13", "loader-animation": "_loader-animation_nacdm_1" };
|
73978
73978
|
var import_jsx_runtime9 = require("react/jsx-runtime");
|
73979
|
-
var
|
73979
|
+
var getClassName6 = get_class_name_factory_default2("Loader", styles_module_default32);
|
73980
73980
|
var Loader2 = (_a3) => {
|
73981
73981
|
var _b = _a3, {
|
73982
73982
|
color,
|
@@ -73988,7 +73988,7 @@ var require_dist = __commonJS({
|
|
73988
73988
|
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
73989
73989
|
"span",
|
73990
73990
|
__spreadValues2({
|
73991
|
-
className:
|
73991
|
+
className: getClassName6(),
|
73992
73992
|
style: {
|
73993
73993
|
width: size,
|
73994
73994
|
height: size,
|
@@ -74284,7 +74284,7 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
|
|
74284
74284
|
};
|
74285
74285
|
var import_jsx_runtime82 = require("react/jsx-runtime");
|
74286
74286
|
var getClassName42 = get_class_name_factory_default2("ArrayField", styles_module_default22);
|
74287
|
-
var
|
74287
|
+
var getClassNameItem3 = get_class_name_factory_default2("ArrayFieldItem", styles_module_default22);
|
74288
74288
|
var ArrayField = ({
|
74289
74289
|
field,
|
74290
74290
|
onChange,
|
@@ -74417,7 +74417,7 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
|
|
74417
74417
|
{
|
74418
74418
|
id: _arrayId,
|
74419
74419
|
index: i2,
|
74420
|
-
className: (_, snapshot2) =>
|
74420
|
+
className: (_, snapshot2) => getClassNameItem3({
|
74421
74421
|
isExpanded: arrayState.openId === _arrayId,
|
74422
74422
|
isDragging: snapshot2 == null ? void 0 : snapshot2.isDragging,
|
74423
74423
|
readOnly
|
@@ -74442,11 +74442,11 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
|
|
74442
74442
|
);
|
74443
74443
|
}
|
74444
74444
|
},
|
74445
|
-
className:
|
74445
|
+
className: getClassNameItem3("summary"),
|
74446
74446
|
children: [
|
74447
74447
|
field.getItemSummary ? field.getItemSummary(data, i2) : `Item #${_originalIndex}`,
|
74448
|
-
/* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { className:
|
74449
|
-
!readOnly && /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("div", { className:
|
74448
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { className: getClassNameItem3("rhs"), children: [
|
74449
|
+
!readOnly && /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("div", { className: getClassNameItem3("actions"), children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("div", { className: getClassNameItem3("action"), children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
74450
74450
|
IconButton,
|
74451
74451
|
{
|
74452
74452
|
type: "button",
|
@@ -74477,7 +74477,7 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
|
|
74477
74477
|
]
|
74478
74478
|
}
|
74479
74479
|
),
|
74480
|
-
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)("div", { className:
|
74480
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)("div", { className: getClassNameItem3("body"), children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("fieldset", { className: getClassNameItem3("fieldset"), children: Object.keys(field.arrayFields).map(
|
74481
74481
|
(fieldName) => {
|
74482
74482
|
const subField = field.arrayFields[fieldName];
|
74483
74483
|
const subFieldName = `${name}[${i2}].${fieldName}`;
|
@@ -74595,7 +74595,7 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
|
|
74595
74595
|
var styles_module_default6 = { "Modal": "_Modal_ikbaj_1", "Modal--isOpen": "_Modal--isOpen_ikbaj_15", "Modal-inner": "_Modal-inner_ikbaj_19" };
|
74596
74596
|
var import_react_dom3 = __toESM2(require_react_dom2());
|
74597
74597
|
var import_jsx_runtime10 = require("react/jsx-runtime");
|
74598
|
-
var
|
74598
|
+
var getClassName62 = get_class_name_factory_default2("Modal", styles_module_default6);
|
74599
74599
|
var Modal = ({
|
74600
74600
|
children,
|
74601
74601
|
onClose,
|
@@ -74609,10 +74609,10 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
|
|
74609
74609
|
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", {});
|
74610
74610
|
}
|
74611
74611
|
return (0, import_react_dom3.createPortal)(
|
74612
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className:
|
74612
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: getClassName62({ isOpen }), onClick: onClose, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
74613
74613
|
"div",
|
74614
74614
|
{
|
74615
|
-
className:
|
74615
|
+
className: getClassName62("inner"),
|
74616
74616
|
onClick: (e2) => e2.stopPropagation(),
|
74617
74617
|
children
|
74618
74618
|
}
|
@@ -75732,6 +75732,8 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
|
|
75732
75732
|
"No configuration for ",
|
75733
75733
|
item.type
|
75734
75734
|
] });
|
75735
|
+
const componentConfig = config.components[item.type];
|
75736
|
+
const label = (_b = componentConfig == null ? void 0 : componentConfig["label"]) != null ? _b : item.type.toString();
|
75735
75737
|
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
75736
75738
|
"div",
|
75737
75739
|
{
|
@@ -75747,7 +75749,7 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
|
|
75747
75749
|
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
75748
75750
|
DraggableComponent,
|
75749
75751
|
{
|
75750
|
-
label
|
75752
|
+
label,
|
75751
75753
|
id: `draggable-${componentId}`,
|
75752
75754
|
index: i2,
|
75753
75755
|
isSelected,
|
@@ -76637,7 +76639,7 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
|
|
76637
76639
|
var styles_module_default14 = { "Puck": "_Puck_1g88c_19", "Puck-portal": "_Puck-portal_1g88c_24", "PuckLayout": "_PuckLayout_1g88c_31", "PuckLayout-inner": "_PuckLayout-inner_1g88c_39", "PuckLayout--mounted": "_PuckLayout--mounted_1g88c_51", "PuckLayout--leftSideBarVisible": "_PuckLayout--leftSideBarVisible_1g88c_55", "PuckLayout--rightSideBarVisible": "_PuckLayout--rightSideBarVisible_1g88c_61", "PuckLayout-mounted": "_PuckLayout-mounted_1g88c_75", "PuckLayout-header": "_PuckLayout-header_1g88c_116", "PuckLayout-headerInner": "_PuckLayout-headerInner_1g88c_125", "PuckLayout-headerToggle": "_PuckLayout-headerToggle_1g88c_135", "PuckLayout-rightSideBarToggle": "_PuckLayout-rightSideBarToggle_1g88c_142", "PuckLayout-leftSideBarToggle": "_PuckLayout-leftSideBarToggle_1g88c_143", "PuckLayout-headerTitle": "_PuckLayout-headerTitle_1g88c_147", "PuckLayout-headerPath": "_PuckLayout-headerPath_1g88c_151", "PuckLayout-headerTools": "_PuckLayout-headerTools_1g88c_158", "PuckLayout-menuButton": "_PuckLayout-menuButton_1g88c_164", "PuckLayout--menuOpen": "_PuckLayout--menuOpen_1g88c_169", "PuckLayout-leftSideBar": "_PuckLayout-leftSideBar_1g88c_143", "PuckLayout-rightSideBar": "_PuckLayout-rightSideBar_1g88c_142" };
|
76638
76640
|
init_react_import2();
|
76639
76641
|
init_react_import2();
|
76640
|
-
var styles_module_default15 = { "PuckFields": "
|
76642
|
+
var styles_module_default15 = { "PuckFields": "_PuckFields_jp3lw_1", "PuckFields--isLoading": "_PuckFields--isLoading_jp3lw_6", "PuckFields-loadingOverlay": "_PuckFields-loadingOverlay_jp3lw_10", "PuckFields-loadingOverlayInner": "_PuckFields-loadingOverlayInner_jp3lw_25" };
|
76641
76643
|
var import_react20 = require("react");
|
76642
76644
|
var import_jsx_runtime26 = require("react/jsx-runtime");
|
76643
76645
|
var getClassName20 = get_class_name_factory_default2("PuckFields", styles_module_default15);
|
@@ -77298,6 +77300,8 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
|
|
77298
77300
|
const selectedItem = itemSelector && data ? getItem2(itemSelector, data) : null;
|
77299
77301
|
const isHovering = hoveringComponent === item.props.id;
|
77300
77302
|
const childIsSelected = isChildOfZone(item, selectedItem, ctx);
|
77303
|
+
const componentConfig = config.components[item.type];
|
77304
|
+
const label2 = (_a3 = componentConfig == null ? void 0 : componentConfig["label"]) != null ? _a3 : item.type.toString();
|
77301
77305
|
return /* @__PURE__ */ (0, import_jsx_runtime322.jsxs)(
|
77302
77306
|
"li",
|
77303
77307
|
{
|
@@ -77350,7 +77354,7 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
|
|
77350
77354
|
),
|
77351
77355
|
/* @__PURE__ */ (0, import_jsx_runtime322.jsxs)("div", { className: getClassNameLayer("title"), children: [
|
77352
77356
|
/* @__PURE__ */ (0, import_jsx_runtime322.jsx)("div", { className: getClassNameLayer("icon"), children: item.type === "Text" || item.type === "Heading" ? /* @__PURE__ */ (0, import_jsx_runtime322.jsx)(Type, { size: "16" }) : /* @__PURE__ */ (0, import_jsx_runtime322.jsx)(LayoutGrid, { size: "16" }) }),
|
77353
|
-
/* @__PURE__ */ (0, import_jsx_runtime322.jsx)("div", { className: getClassNameLayer("name"), children:
|
77357
|
+
/* @__PURE__ */ (0, import_jsx_runtime322.jsx)("div", { className: getClassNameLayer("name"), children: label2 })
|
77354
77358
|
] })
|
77355
77359
|
]
|
77356
77360
|
}
|
@@ -77643,7 +77647,7 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
|
|
77643
77647
|
init_react_import2();
|
77644
77648
|
var import_react28 = require("react");
|
77645
77649
|
init_react_import2();
|
77646
|
-
var styles_module_default19 = { "ViewportControls": "
|
77650
|
+
var styles_module_default19 = { "ViewportControls": "_ViewportControls_g1wgg_1", "ViewportControls-divider": "_ViewportControls-divider_g1wgg_15", "ViewportControls-zoomSelect": "_ViewportControls-zoomSelect_g1wgg_21", "ViewportButton--isActive": "_ViewportButton--isActive_g1wgg_34", "ViewportButton-inner": "_ViewportButton-inner_g1wgg_34" };
|
77647
77651
|
var import_jsx_runtime34 = require("react/jsx-runtime");
|
77648
77652
|
var icons = {
|
77649
77653
|
Smartphone: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Smartphone, { size: 16 }),
|
@@ -78127,6 +78131,8 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
|
|
78127
78131
|
(0, import_react30.useEffect)(() => {
|
78128
78132
|
setMounted(true);
|
78129
78133
|
}, []);
|
78134
|
+
const selectedComponentConfig = selectedItem && config.components[selectedItem.type];
|
78135
|
+
const selectedComponentLabel = selectedItem ? (_a3 = selectedComponentConfig == null ? void 0 : selectedComponentConfig["label"]) != null ? _a3 : selectedItem.type.toString() : "";
|
78130
78136
|
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: `Puck ${getClassName26()}`, children: [
|
78131
78137
|
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
78132
78138
|
AppProvider,
|
@@ -78335,7 +78341,7 @@ See https://github.com/measuredco/puck/issues/411 for more information. This mes
|
|
78335
78341
|
noPadding: true,
|
78336
78342
|
noBorderTop: true,
|
78337
78343
|
showBreadcrumbs: true,
|
78338
|
-
title: selectedItem ?
|
78344
|
+
title: selectedItem ? selectedComponentLabel : "Page",
|
78339
78345
|
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Fields, {})
|
78340
78346
|
}
|
78341
78347
|
) })
|
@@ -78555,6 +78561,12 @@ init_react_import();
|
|
78555
78561
|
// src/HeadingAnalyzer.tsx
|
78556
78562
|
init_react_import();
|
78557
78563
|
var import_react12 = require("react");
|
78564
|
+
|
78565
|
+
// css-module:/home/runner/work/puck/puck/packages/plugin-heading-analyzer/src/HeadingAnalyzer.module.css#css-module
|
78566
|
+
init_react_import();
|
78567
|
+
var HeadingAnalyzer_module_default = { "HeadingAnalyzer": "_HeadingAnalyzer_116v6_1", "HeadingAnalyzer-cssWarning": "_HeadingAnalyzer-cssWarning_116v6_5", "HeadingAnalyzerItem": "_HeadingAnalyzerItem_116v6_9", "HeadingAnalyzerItem--missing": "_HeadingAnalyzerItem--missing_116v6_13" };
|
78568
|
+
|
78569
|
+
// src/HeadingAnalyzer.tsx
|
78558
78570
|
var import_puck = __toESM(require_dist());
|
78559
78571
|
|
78560
78572
|
// ../core/components/SidebarSection/index.tsx
|
@@ -79002,6 +79014,8 @@ var getFrame2 = () => {
|
|
79002
79014
|
// src/HeadingAnalyzer.tsx
|
79003
79015
|
var import_react_from_json = __toESM(require("react-from-json"));
|
79004
79016
|
var import_jsx_runtime8 = require("react/jsx-runtime");
|
79017
|
+
var getClassName5 = get_class_name_factory_default("HeadingAnalyzer", HeadingAnalyzer_module_default);
|
79018
|
+
var getClassNameItem2 = get_class_name_factory_default("HeadingAnalyzerItem", HeadingAnalyzer_module_default);
|
79005
79019
|
var dataAttr = "data-puck-heading-analyzer-id";
|
79006
79020
|
var getOutline = ({
|
79007
79021
|
addDataAttr = false,
|
@@ -79072,7 +79086,24 @@ var HeadingAnalyzer = () => {
|
|
79072
79086
|
setHierarchy(buildHierarchy(frame));
|
79073
79087
|
}
|
79074
79088
|
}, [appState.data]);
|
79075
|
-
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
79089
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: getClassName5(), children: [
|
79090
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
79091
|
+
"small",
|
79092
|
+
{
|
79093
|
+
className: getClassName5("cssWarning"),
|
79094
|
+
style: {
|
79095
|
+
color: "var(--puck-color-red-04)",
|
79096
|
+
display: "block",
|
79097
|
+
marginBottom: 16
|
79098
|
+
},
|
79099
|
+
children: [
|
79100
|
+
"Heading analyzer styles not loaded. Please review the",
|
79101
|
+
" ",
|
79102
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("a", { href: "https://github.com/measuredco/puck/blob/main/packages/plugin-heading-analyzer/README.md", children: "README" }),
|
79103
|
+
"."
|
79104
|
+
]
|
79105
|
+
}
|
79106
|
+
),
|
79076
79107
|
hierarchy.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { children: "No headings." }),
|
79077
79108
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(OutlineList, { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
79078
79109
|
import_react_from_json.default,
|
@@ -79083,6 +79114,7 @@ var HeadingAnalyzer = () => {
|
|
79083
79114
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(OutlineList.Clickable, { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
79084
79115
|
"small",
|
79085
79116
|
{
|
79117
|
+
className: getClassNameItem2({ missing: props.missing }),
|
79086
79118
|
onClick: typeof props.analyzeId == "undefined" ? void 0 : (e2) => {
|
79087
79119
|
e2.stopPropagation();
|
79088
79120
|
const frame = getFrame2();
|
@@ -79100,13 +79132,13 @@ var HeadingAnalyzer = () => {
|
|
79100
79132
|
}, 2e3);
|
79101
79133
|
}
|
79102
79134
|
},
|
79103
|
-
children: props.missing ? /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
79135
|
+
children: props.missing ? /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
|
79104
79136
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("b", { children: [
|
79105
79137
|
"H",
|
79106
79138
|
props.rank
|
79107
79139
|
] }),
|
79108
79140
|
": Missing"
|
79109
|
-
] }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
79141
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
|
79110
79142
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("b", { children: [
|
79111
79143
|
"H",
|
79112
79144
|
props.rank
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@measured/puck-plugin-heading-analyzer",
|
3
|
-
"version": "0.15.
|
3
|
+
"version": "0.15.1-canary.0daf478",
|
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.15.
|
21
|
+
"@measured/puck": "^0.15.1-canary.0daf478",
|
22
22
|
"@types/react": "^18.2.0",
|
23
23
|
"@types/react-dom": "^18.2.0",
|
24
24
|
"eslint": "^7.32.0",
|