@measured/puck-plugin-heading-analyzer 0.20.0-canary.0708ce21 → 0.20.0-canary.158d52dd
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 +0 -145
- package/dist/index.d.mts +11 -5
- package/dist/index.d.ts +11 -5
- package/dist/index.js +82 -239
- package/dist/index.mjs +79 -236
- package/package.json +2 -2
package/dist/index.css
CHANGED
@@ -12,151 +12,6 @@
|
|
12
12
|
color: var(--puck-color-red-04);
|
13
13
|
}
|
14
14
|
|
15
|
-
/* css-module:/home/runner/work/puck/puck/packages/core/components/SidebarSection/styles.module.css/#css-module-data */
|
16
|
-
._SidebarSection_8boj8_1 {
|
17
|
-
display: flex;
|
18
|
-
position: relative;
|
19
|
-
flex-direction: column;
|
20
|
-
color: var(--puck-color-black);
|
21
|
-
}
|
22
|
-
._SidebarSection_8boj8_1:last-of-type {
|
23
|
-
flex-grow: 1;
|
24
|
-
}
|
25
|
-
._SidebarSection-title_8boj8_12 {
|
26
|
-
background: var(--puck-color-white);
|
27
|
-
padding: 16px;
|
28
|
-
border-bottom: 1px solid var(--puck-color-grey-09);
|
29
|
-
border-top: 1px solid var(--puck-color-grey-09);
|
30
|
-
overflow-x: auto;
|
31
|
-
}
|
32
|
-
._SidebarSection--noBorderTop_8boj8_20 > ._SidebarSection-title_8boj8_12 {
|
33
|
-
border-top: 0px;
|
34
|
-
}
|
35
|
-
._SidebarSection-content_8boj8_24 {
|
36
|
-
padding: 16px;
|
37
|
-
}
|
38
|
-
._SidebarSection--noPadding_8boj8_28 > ._SidebarSection-content_8boj8_24 {
|
39
|
-
padding: 0px;
|
40
|
-
}
|
41
|
-
._SidebarSection--noPadding_8boj8_28 > ._SidebarSection-content_8boj8_24:last-child {
|
42
|
-
padding-bottom: 4px;
|
43
|
-
}
|
44
|
-
._SidebarSection_8boj8_1:last-of-type ._SidebarSection-content_8boj8_24 {
|
45
|
-
border-bottom: none;
|
46
|
-
flex-grow: 1;
|
47
|
-
}
|
48
|
-
._SidebarSection-breadcrumbLabel_8boj8_41 {
|
49
|
-
background: none;
|
50
|
-
border: 0;
|
51
|
-
border-radius: 2px;
|
52
|
-
color: var(--puck-color-azure-04);
|
53
|
-
cursor: pointer;
|
54
|
-
font: inherit;
|
55
|
-
flex-shrink: 0;
|
56
|
-
padding: 0;
|
57
|
-
transition: color 50ms ease-in;
|
58
|
-
}
|
59
|
-
._SidebarSection-breadcrumbLabel_8boj8_41:focus-visible {
|
60
|
-
outline: 2px solid var(--puck-color-azure-05);
|
61
|
-
outline-offset: 2px;
|
62
|
-
}
|
63
|
-
@media (hover: hover) and (pointer: fine) {
|
64
|
-
._SidebarSection-breadcrumbLabel_8boj8_41:hover {
|
65
|
-
color: var(--puck-color-azure-03);
|
66
|
-
transition: none;
|
67
|
-
}
|
68
|
-
}
|
69
|
-
._SidebarSection-breadcrumbLabel_8boj8_41:active {
|
70
|
-
color: var(--puck-color-azure-02);
|
71
|
-
transition: none;
|
72
|
-
}
|
73
|
-
._SidebarSection-breadcrumbs_8boj8_70 {
|
74
|
-
align-items: center;
|
75
|
-
display: flex;
|
76
|
-
gap: 4px;
|
77
|
-
}
|
78
|
-
._SidebarSection-breadcrumb_8boj8_41 {
|
79
|
-
align-items: center;
|
80
|
-
display: flex;
|
81
|
-
gap: 4px;
|
82
|
-
}
|
83
|
-
._SidebarSection-heading_8boj8_82 {
|
84
|
-
padding-inline-end: 16px;
|
85
|
-
}
|
86
|
-
._SidebarSection-loadingOverlay_8boj8_86 {
|
87
|
-
background: var(--puck-color-white);
|
88
|
-
display: flex;
|
89
|
-
justify-content: center;
|
90
|
-
align-items: center;
|
91
|
-
height: 100%;
|
92
|
-
width: 100%;
|
93
|
-
top: 0;
|
94
|
-
position: absolute;
|
95
|
-
z-index: 1;
|
96
|
-
pointer-events: all;
|
97
|
-
box-sizing: border-box;
|
98
|
-
opacity: 0.8;
|
99
|
-
}
|
100
|
-
|
101
|
-
/* css-module:/home/runner/work/puck/puck/packages/core/components/Heading/styles.module.css/#css-module-data */
|
102
|
-
._Heading_qxrry_1 {
|
103
|
-
display: block;
|
104
|
-
color: var(--puck-color-black);
|
105
|
-
font-weight: 700;
|
106
|
-
margin: 0;
|
107
|
-
}
|
108
|
-
._Heading_qxrry_1 b {
|
109
|
-
font-weight: 700;
|
110
|
-
}
|
111
|
-
._Heading--xxxxl_qxrry_12 {
|
112
|
-
font-size: var(--puck-font-size-xxxxl);
|
113
|
-
letter-spacing: 0.08ch;
|
114
|
-
font-weight: 800;
|
115
|
-
}
|
116
|
-
._Heading--xxxl_qxrry_18 {
|
117
|
-
font-size: var(--puck-font-size-xxxl);
|
118
|
-
}
|
119
|
-
._Heading--xxl_qxrry_22 {
|
120
|
-
font-size: var(--puck-font-size-xxl);
|
121
|
-
}
|
122
|
-
._Heading--xl_qxrry_26 {
|
123
|
-
font-size: var(--puck-font-size-xl);
|
124
|
-
}
|
125
|
-
._Heading--l_qxrry_30 {
|
126
|
-
font-size: var(--puck-font-size-l);
|
127
|
-
}
|
128
|
-
._Heading--m_qxrry_34 {
|
129
|
-
font-size: var(--puck-font-size-m);
|
130
|
-
}
|
131
|
-
._Heading--s_qxrry_38 {
|
132
|
-
font-size: var(--puck-font-size-s);
|
133
|
-
}
|
134
|
-
._Heading--xs_qxrry_42 {
|
135
|
-
font-size: var(--puck-font-size-xs);
|
136
|
-
}
|
137
|
-
|
138
|
-
/* css-module:/home/runner/work/puck/puck/packages/core/components/Loader/styles.module.css/#css-module-data */
|
139
|
-
@keyframes _loader-animation_nacdm_1 {
|
140
|
-
0% {
|
141
|
-
transform: rotate(0deg) scale(1);
|
142
|
-
}
|
143
|
-
50% {
|
144
|
-
transform: rotate(180deg) scale(0.8);
|
145
|
-
}
|
146
|
-
100% {
|
147
|
-
transform: rotate(360deg) scale(1);
|
148
|
-
}
|
149
|
-
}
|
150
|
-
._Loader_nacdm_13 {
|
151
|
-
background: transparent;
|
152
|
-
border-radius: 100%;
|
153
|
-
border: 2px solid currentColor;
|
154
|
-
border-bottom-color: transparent;
|
155
|
-
display: inline-block;
|
156
|
-
animation: _loader-animation_nacdm_1 1s 0s infinite linear;
|
157
|
-
animation-fill-mode: both;
|
158
|
-
}
|
159
|
-
|
160
15
|
/* css-module:/home/runner/work/puck/puck/packages/core/components/OutlineList/styles.module.css/#css-module-data */
|
161
16
|
._OutlineList_w4lzv_1 {
|
162
17
|
color: var(--puck-color-grey-03);
|
package/dist/index.d.mts
CHANGED
@@ -136,6 +136,7 @@ type Metadata = {
|
|
136
136
|
type ItemWithId = {
|
137
137
|
_arrayId: string;
|
138
138
|
_originalIndex: number;
|
139
|
+
_currentIndex: number;
|
139
140
|
};
|
140
141
|
type ArrayState = {
|
141
142
|
items: ItemWithId[];
|
@@ -169,6 +170,12 @@ type UiState = {
|
|
169
170
|
};
|
170
171
|
};
|
171
172
|
|
173
|
+
type RenderFunc<Props extends {
|
174
|
+
[key: string]: any;
|
175
|
+
} = {
|
176
|
+
children: ReactNode;
|
177
|
+
}> = (props: Props) => ReactElement;
|
178
|
+
|
172
179
|
type MapFnParams<ThisField = Field> = {
|
173
180
|
value: any;
|
174
181
|
parentId: string;
|
@@ -186,11 +193,6 @@ type FieldTransforms = Partial<{
|
|
186
193
|
[FieldType in Field["type"]]: FieldTransformFn<ExtractField<FieldType>>;
|
187
194
|
}>;
|
188
195
|
|
189
|
-
type RenderFunc<Props extends {
|
190
|
-
[key: string]: any;
|
191
|
-
} = {
|
192
|
-
children: ReactNode;
|
193
|
-
}> = (props: Props) => ReactElement;
|
194
196
|
declare const overrideKeys: readonly ["header", "headerActions", "fields", "fieldLabel", "drawer", "drawerItem", "componentOverlay", "outline", "puck", "preview"];
|
195
197
|
type OverrideKey = (typeof overrideKeys)[number];
|
196
198
|
type OverridesGeneric<Shape extends {
|
@@ -271,6 +273,10 @@ type Viewport = {
|
|
271
273
|
};
|
272
274
|
|
273
275
|
type Plugin = {
|
276
|
+
name?: string;
|
277
|
+
label?: string;
|
278
|
+
icon?: ReactNode;
|
279
|
+
render?: () => ReactElement;
|
274
280
|
overrides?: Partial<Overrides>;
|
275
281
|
fieldTransforms?: FieldTransforms;
|
276
282
|
};
|
package/dist/index.d.ts
CHANGED
@@ -136,6 +136,7 @@ type Metadata = {
|
|
136
136
|
type ItemWithId = {
|
137
137
|
_arrayId: string;
|
138
138
|
_originalIndex: number;
|
139
|
+
_currentIndex: number;
|
139
140
|
};
|
140
141
|
type ArrayState = {
|
141
142
|
items: ItemWithId[];
|
@@ -169,6 +170,12 @@ type UiState = {
|
|
169
170
|
};
|
170
171
|
};
|
171
172
|
|
173
|
+
type RenderFunc<Props extends {
|
174
|
+
[key: string]: any;
|
175
|
+
} = {
|
176
|
+
children: ReactNode;
|
177
|
+
}> = (props: Props) => ReactElement;
|
178
|
+
|
172
179
|
type MapFnParams<ThisField = Field> = {
|
173
180
|
value: any;
|
174
181
|
parentId: string;
|
@@ -186,11 +193,6 @@ type FieldTransforms = Partial<{
|
|
186
193
|
[FieldType in Field["type"]]: FieldTransformFn<ExtractField<FieldType>>;
|
187
194
|
}>;
|
188
195
|
|
189
|
-
type RenderFunc<Props extends {
|
190
|
-
[key: string]: any;
|
191
|
-
} = {
|
192
|
-
children: ReactNode;
|
193
|
-
}> = (props: Props) => ReactElement;
|
194
196
|
declare const overrideKeys: readonly ["header", "headerActions", "fields", "fieldLabel", "drawer", "drawerItem", "componentOverlay", "outline", "puck", "preview"];
|
195
197
|
type OverrideKey = (typeof overrideKeys)[number];
|
196
198
|
type OverridesGeneric<Shape extends {
|
@@ -271,6 +273,10 @@ type Viewport = {
|
|
271
273
|
};
|
272
274
|
|
273
275
|
type Plugin = {
|
276
|
+
name?: string;
|
277
|
+
label?: string;
|
278
|
+
icon?: ReactNode;
|
279
|
+
render?: () => ReactElement;
|
274
280
|
overrides?: Partial<Overrides>;
|
275
281
|
fieldTransforms?: FieldTransforms;
|
276
282
|
};
|
package/dist/index.js
CHANGED
@@ -313,7 +313,7 @@ init_react_import();
|
|
313
313
|
|
314
314
|
// src/HeadingAnalyzer.tsx
|
315
315
|
init_react_import();
|
316
|
-
var
|
316
|
+
var import_react10 = require("react");
|
317
317
|
|
318
318
|
// css-module:/home/runner/work/puck/puck/packages/plugin-heading-analyzer/src/HeadingAnalyzer.module.css#css-module
|
319
319
|
init_react_import();
|
@@ -322,12 +322,12 @@ var HeadingAnalyzer_module_default = { "HeadingAnalyzer": "_HeadingAnalyzer_116v
|
|
322
322
|
// src/HeadingAnalyzer.tsx
|
323
323
|
var import_puck = require("@measured/puck");
|
324
324
|
|
325
|
-
// ../core/components/
|
325
|
+
// ../core/components/OutlineList/index.tsx
|
326
326
|
init_react_import();
|
327
327
|
|
328
|
-
// css-module:/home/runner/work/puck/puck/packages/core/components/
|
328
|
+
// css-module:/home/runner/work/puck/puck/packages/core/components/OutlineList/styles.module.css#css-module
|
329
329
|
init_react_import();
|
330
|
-
var styles_module_default = { "
|
330
|
+
var styles_module_default = { "OutlineList": "_OutlineList_w4lzv_1", "OutlineListItem": "_OutlineListItem_w4lzv_25", "OutlineListItem--clickable": "_OutlineListItem--clickable_w4lzv_45" };
|
331
331
|
|
332
332
|
// ../core/lib/get-class-name-factory.ts
|
333
333
|
init_react_import();
|
@@ -356,29 +356,50 @@ var getClassNameFactory = (rootClass, styles, config = { baseClass: "" }) => (op
|
|
356
356
|
};
|
357
357
|
var get_class_name_factory_default = getClassNameFactory;
|
358
358
|
|
359
|
-
// ../core/components/
|
360
|
-
init_react_import();
|
361
|
-
|
362
|
-
// css-module:/home/runner/work/puck/puck/packages/core/components/Heading/styles.module.css#css-module
|
363
|
-
init_react_import();
|
364
|
-
var styles_module_default2 = { "Heading": "_Heading_qxrry_1", "Heading--xxxxl": "_Heading--xxxxl_qxrry_12", "Heading--xxxl": "_Heading--xxxl_qxrry_18", "Heading--xxl": "_Heading--xxl_qxrry_22", "Heading--xl": "_Heading--xl_qxrry_26", "Heading--l": "_Heading--l_qxrry_30", "Heading--m": "_Heading--m_qxrry_34", "Heading--s": "_Heading--s_qxrry_38", "Heading--xs": "_Heading--xs_qxrry_42" };
|
365
|
-
|
366
|
-
// ../core/components/Heading/index.tsx
|
359
|
+
// ../core/components/OutlineList/index.tsx
|
367
360
|
var import_jsx_runtime = require("react/jsx-runtime");
|
368
|
-
var getClassName = get_class_name_factory_default("
|
369
|
-
var
|
370
|
-
|
361
|
+
var getClassName = get_class_name_factory_default("OutlineList", styles_module_default);
|
362
|
+
var getClassNameItem = get_class_name_factory_default("OutlineListItem", styles_module_default);
|
363
|
+
var OutlineList = ({ children }) => {
|
364
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("ul", { className: getClassName(), children });
|
365
|
+
};
|
366
|
+
OutlineList.Clickable = ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: getClassNameItem({ clickable: true }), children });
|
367
|
+
OutlineList.Item = ({
|
368
|
+
children,
|
369
|
+
onClick
|
370
|
+
}) => {
|
371
371
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
372
|
-
|
372
|
+
"li",
|
373
373
|
{
|
374
|
-
className:
|
375
|
-
|
376
|
-
}),
|
374
|
+
className: getClassNameItem({ clickable: !!onClick }),
|
375
|
+
onClick,
|
377
376
|
children
|
378
377
|
}
|
379
378
|
);
|
380
379
|
};
|
381
380
|
|
381
|
+
// ../core/lib/scroll-into-view.ts
|
382
|
+
init_react_import();
|
383
|
+
var scrollIntoView = (el) => {
|
384
|
+
const oldStyle = __spreadValues({}, el.style);
|
385
|
+
el.style.scrollMargin = "256px";
|
386
|
+
if (el) {
|
387
|
+
el == null ? void 0 : el.scrollIntoView({ behavior: "smooth" });
|
388
|
+
el.style.scrollMargin = oldStyle.scrollMargin || "";
|
389
|
+
}
|
390
|
+
};
|
391
|
+
|
392
|
+
// ../core/lib/get-frame.ts
|
393
|
+
init_react_import();
|
394
|
+
var getFrame = () => {
|
395
|
+
if (typeof window === "undefined") return;
|
396
|
+
let frameEl = document.querySelector("#preview-frame");
|
397
|
+
if ((frameEl == null ? void 0 : frameEl.tagName) === "IFRAME") {
|
398
|
+
return frameEl.contentDocument || document;
|
399
|
+
}
|
400
|
+
return (frameEl == null ? void 0 : frameEl.ownerDocument) || document;
|
401
|
+
};
|
402
|
+
|
382
403
|
// ../../node_modules/lucide-react/dist/esm/lucide-react.js
|
383
404
|
init_react_import();
|
384
405
|
|
@@ -466,15 +487,29 @@ var createLucideIcon = (iconName, iconNode) => {
|
|
466
487
|
return Component;
|
467
488
|
};
|
468
489
|
|
469
|
-
// ../../node_modules/lucide-react/dist/esm/icons/
|
490
|
+
// ../../node_modules/lucide-react/dist/esm/icons/heading-1.js
|
470
491
|
init_react_import();
|
471
|
-
var
|
472
|
-
["path", { d: "
|
492
|
+
var Heading1 = createLucideIcon("Heading1", [
|
493
|
+
["path", { d: "M4 12h8", key: "17cfdx" }],
|
494
|
+
["path", { d: "M4 18V6", key: "1rz3zl" }],
|
495
|
+
["path", { d: "M12 18V6", key: "zqpxq5" }],
|
496
|
+
["path", { d: "m17 12 3-2v8", key: "1hhhft" }]
|
473
497
|
]);
|
474
498
|
|
475
|
-
// ../core/lib/
|
499
|
+
// ../core/lib/index.ts
|
500
|
+
init_react_import();
|
501
|
+
|
502
|
+
// ../core/lib/filter.ts
|
503
|
+
init_react_import();
|
504
|
+
|
505
|
+
// ../core/lib/data/reorder.ts
|
506
|
+
init_react_import();
|
507
|
+
|
508
|
+
// ../core/lib/data/replace.ts
|
509
|
+
init_react_import();
|
510
|
+
|
511
|
+
// ../core/lib/use-reset-auto-zoom.ts
|
476
512
|
init_react_import();
|
477
|
-
var import_react10 = require("react");
|
478
513
|
|
479
514
|
// ../core/store/index.ts
|
480
515
|
init_react_import();
|
@@ -2115,204 +2150,14 @@ var createAppStore = (initialAppStore) => create()(
|
|
2115
2150
|
})
|
2116
2151
|
);
|
2117
2152
|
var appStoreContext = (0, import_react9.createContext)(createAppStore());
|
2118
|
-
function useAppStore(selector) {
|
2119
|
-
const context = (0, import_react9.useContext)(appStoreContext);
|
2120
|
-
return useStore(context, selector);
|
2121
|
-
}
|
2122
|
-
function useAppStoreApi() {
|
2123
|
-
return (0, import_react9.useContext)(appStoreContext);
|
2124
|
-
}
|
2125
|
-
|
2126
|
-
// ../core/lib/use-breadcrumbs.ts
|
2127
|
-
var useBreadcrumbs = (renderCount) => {
|
2128
|
-
const selectedId = useAppStore((s) => {
|
2129
|
-
var _a;
|
2130
|
-
return (_a = s.selectedItem) == null ? void 0 : _a.props.id;
|
2131
|
-
});
|
2132
|
-
const config = useAppStore((s) => s.config);
|
2133
|
-
const path = useAppStore((s) => {
|
2134
|
-
var _a;
|
2135
|
-
return (_a = s.state.indexes.nodes[selectedId]) == null ? void 0 : _a.path;
|
2136
|
-
});
|
2137
|
-
const appStore = useAppStoreApi();
|
2138
|
-
return (0, import_react10.useMemo)(() => {
|
2139
|
-
const breadcrumbs = (path == null ? void 0 : path.map((zoneCompound) => {
|
2140
|
-
var _a, _b, _c;
|
2141
|
-
const [componentId] = zoneCompound.split(":");
|
2142
|
-
if (componentId === "root") {
|
2143
|
-
return {
|
2144
|
-
label: "Page",
|
2145
|
-
selector: null
|
2146
|
-
};
|
2147
|
-
}
|
2148
|
-
const node = appStore.getState().state.indexes.nodes[componentId];
|
2149
|
-
const parentId = node.path[node.path.length - 1];
|
2150
|
-
const contentIds = ((_a = appStore.getState().state.indexes.zones[parentId]) == null ? void 0 : _a.contentIds) || [];
|
2151
|
-
const index = contentIds.indexOf(componentId);
|
2152
|
-
const label = node ? (_c = (_b = config.components[node.data.type]) == null ? void 0 : _b.label) != null ? _c : node.data.type : "Component";
|
2153
|
-
return {
|
2154
|
-
label,
|
2155
|
-
selector: node ? {
|
2156
|
-
index,
|
2157
|
-
zone: node.path[node.path.length - 1]
|
2158
|
-
} : null
|
2159
|
-
};
|
2160
|
-
})) || [];
|
2161
|
-
if (renderCount) {
|
2162
|
-
return breadcrumbs.slice(breadcrumbs.length - renderCount);
|
2163
|
-
}
|
2164
|
-
return breadcrumbs;
|
2165
|
-
}, [path, renderCount]);
|
2166
|
-
};
|
2167
|
-
|
2168
|
-
// ../core/components/Loader/index.tsx
|
2169
|
-
init_react_import();
|
2170
|
-
|
2171
|
-
// ../core/lib/index.ts
|
2172
|
-
init_react_import();
|
2173
|
-
|
2174
|
-
// ../core/lib/filter.ts
|
2175
|
-
init_react_import();
|
2176
|
-
|
2177
|
-
// ../core/lib/data/reorder.ts
|
2178
|
-
init_react_import();
|
2179
|
-
|
2180
|
-
// ../core/lib/data/replace.ts
|
2181
|
-
init_react_import();
|
2182
|
-
|
2183
|
-
// ../core/lib/use-reset-auto-zoom.ts
|
2184
|
-
init_react_import();
|
2185
|
-
var import_react11 = require("react");
|
2186
2153
|
|
2187
2154
|
// ../core/lib/get-zoom-config.ts
|
2188
2155
|
init_react_import();
|
2189
2156
|
|
2190
|
-
// css-module:/home/runner/work/puck/puck/packages/core/components/Loader/styles.module.css#css-module
|
2191
|
-
init_react_import();
|
2192
|
-
var styles_module_default3 = { "Loader": "_Loader_nacdm_13", "loader-animation": "_loader-animation_nacdm_1" };
|
2193
|
-
|
2194
|
-
// ../core/components/Loader/index.tsx
|
2195
|
-
var import_jsx_runtime2 = require("react/jsx-runtime");
|
2196
|
-
var getClassName2 = get_class_name_factory_default("Loader", styles_module_default3);
|
2197
|
-
var Loader = (_a) => {
|
2198
|
-
var _b = _a, {
|
2199
|
-
color,
|
2200
|
-
size = 16
|
2201
|
-
} = _b, props = __objRest(_b, [
|
2202
|
-
"color",
|
2203
|
-
"size"
|
2204
|
-
]);
|
2205
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
2206
|
-
"span",
|
2207
|
-
__spreadValues({
|
2208
|
-
className: getClassName2(),
|
2209
|
-
style: {
|
2210
|
-
width: size,
|
2211
|
-
height: size,
|
2212
|
-
color
|
2213
|
-
},
|
2214
|
-
"aria-label": "loading"
|
2215
|
-
}, props)
|
2216
|
-
);
|
2217
|
-
};
|
2218
|
-
|
2219
|
-
// ../core/components/SidebarSection/index.tsx
|
2220
|
-
var import_jsx_runtime3 = require("react/jsx-runtime");
|
2221
|
-
var getClassName3 = get_class_name_factory_default("SidebarSection", styles_module_default);
|
2222
|
-
var SidebarSection = ({
|
2223
|
-
children,
|
2224
|
-
title,
|
2225
|
-
background,
|
2226
|
-
showBreadcrumbs,
|
2227
|
-
noBorderTop,
|
2228
|
-
noPadding,
|
2229
|
-
isLoading
|
2230
|
-
}) => {
|
2231
|
-
const setUi = useAppStore((s) => s.setUi);
|
2232
|
-
const breadcrumbs = useBreadcrumbs(1);
|
2233
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
2234
|
-
"div",
|
2235
|
-
{
|
2236
|
-
className: getClassName3({ noBorderTop, noPadding }),
|
2237
|
-
style: { background },
|
2238
|
-
children: [
|
2239
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: getClassName3("title"), children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: getClassName3("breadcrumbs"), children: [
|
2240
|
-
showBreadcrumbs ? breadcrumbs.map((breadcrumb, i) => /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: getClassName3("breadcrumb"), children: [
|
2241
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
2242
|
-
"button",
|
2243
|
-
{
|
2244
|
-
type: "button",
|
2245
|
-
className: getClassName3("breadcrumbLabel"),
|
2246
|
-
onClick: () => setUi({ itemSelector: breadcrumb.selector }),
|
2247
|
-
children: breadcrumb.label
|
2248
|
-
}
|
2249
|
-
),
|
2250
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ChevronRight, { size: 16 })
|
2251
|
-
] }, i)) : null,
|
2252
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: getClassName3("heading"), children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Heading, { rank: "2", size: "xs", children: title }) })
|
2253
|
-
] }) }),
|
2254
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: getClassName3("content"), children }),
|
2255
|
-
isLoading && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: getClassName3("loadingOverlay"), children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Loader, { size: 32 }) })
|
2256
|
-
]
|
2257
|
-
}
|
2258
|
-
);
|
2259
|
-
};
|
2260
|
-
|
2261
|
-
// ../core/components/OutlineList/index.tsx
|
2262
|
-
init_react_import();
|
2263
|
-
|
2264
|
-
// css-module:/home/runner/work/puck/puck/packages/core/components/OutlineList/styles.module.css#css-module
|
2265
|
-
init_react_import();
|
2266
|
-
var styles_module_default4 = { "OutlineList": "_OutlineList_w4lzv_1", "OutlineListItem": "_OutlineListItem_w4lzv_25", "OutlineListItem--clickable": "_OutlineListItem--clickable_w4lzv_45" };
|
2267
|
-
|
2268
|
-
// ../core/components/OutlineList/index.tsx
|
2269
|
-
var import_jsx_runtime4 = require("react/jsx-runtime");
|
2270
|
-
var getClassName4 = get_class_name_factory_default("OutlineList", styles_module_default4);
|
2271
|
-
var getClassNameItem = get_class_name_factory_default("OutlineListItem", styles_module_default4);
|
2272
|
-
var OutlineList = ({ children }) => {
|
2273
|
-
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("ul", { className: getClassName4(), children });
|
2274
|
-
};
|
2275
|
-
OutlineList.Clickable = ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: getClassNameItem({ clickable: true }), children });
|
2276
|
-
OutlineList.Item = ({
|
2277
|
-
children,
|
2278
|
-
onClick
|
2279
|
-
}) => {
|
2280
|
-
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
2281
|
-
"li",
|
2282
|
-
{
|
2283
|
-
className: getClassNameItem({ clickable: !!onClick }),
|
2284
|
-
onClick,
|
2285
|
-
children
|
2286
|
-
}
|
2287
|
-
);
|
2288
|
-
};
|
2289
|
-
|
2290
|
-
// ../core/lib/scroll-into-view.ts
|
2291
|
-
init_react_import();
|
2292
|
-
var scrollIntoView = (el) => {
|
2293
|
-
const oldStyle = __spreadValues({}, el.style);
|
2294
|
-
el.style.scrollMargin = "256px";
|
2295
|
-
if (el) {
|
2296
|
-
el == null ? void 0 : el.scrollIntoView({ behavior: "smooth" });
|
2297
|
-
el.style.scrollMargin = oldStyle.scrollMargin || "";
|
2298
|
-
}
|
2299
|
-
};
|
2300
|
-
|
2301
|
-
// ../core/lib/get-frame.ts
|
2302
|
-
init_react_import();
|
2303
|
-
var getFrame = () => {
|
2304
|
-
if (typeof window === "undefined") return;
|
2305
|
-
let frameEl = document.querySelector("#preview-frame");
|
2306
|
-
if ((frameEl == null ? void 0 : frameEl.tagName) === "IFRAME") {
|
2307
|
-
return frameEl.contentDocument || document;
|
2308
|
-
}
|
2309
|
-
return (frameEl == null ? void 0 : frameEl.ownerDocument) || document;
|
2310
|
-
};
|
2311
|
-
|
2312
2157
|
// src/HeadingAnalyzer.tsx
|
2313
2158
|
var import_react_from_json = __toESM(require("react-from-json"));
|
2314
|
-
var
|
2315
|
-
var
|
2159
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
2160
|
+
var getClassName2 = get_class_name_factory_default("HeadingAnalyzer", HeadingAnalyzer_module_default);
|
2316
2161
|
var getClassNameItem2 = get_class_name_factory_default("HeadingAnalyzerItem", HeadingAnalyzer_module_default);
|
2317
2162
|
var ReactFromJSON = import_react_from_json.default.default || import_react_from_json.default;
|
2318
2163
|
var getOutline = ({ frame } = {}) => {
|
@@ -2367,8 +2212,8 @@ function buildHierarchy(frame) {
|
|
2367
2212
|
var usePuck = (0, import_puck.createUsePuck)();
|
2368
2213
|
var HeadingAnalyzer = () => {
|
2369
2214
|
const data = usePuck((s) => s.appState.data);
|
2370
|
-
const [hierarchy, setHierarchy] = (0,
|
2371
|
-
(0,
|
2215
|
+
const [hierarchy, setHierarchy] = (0, import_react10.useState)([]);
|
2216
|
+
(0, import_react10.useEffect)(() => {
|
2372
2217
|
const frame = getFrame();
|
2373
2218
|
let entry = frame == null ? void 0 : frame.querySelector(`[data-puck-entry]`);
|
2374
2219
|
const createHierarchy = () => {
|
@@ -2403,11 +2248,11 @@ var HeadingAnalyzer = () => {
|
|
2403
2248
|
frameObserver.disconnect();
|
2404
2249
|
};
|
2405
2250
|
}, [data]);
|
2406
|
-
return /* @__PURE__ */ (0,
|
2407
|
-
/* @__PURE__ */ (0,
|
2251
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: getClassName2(), children: [
|
2252
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
2408
2253
|
"small",
|
2409
2254
|
{
|
2410
|
-
className:
|
2255
|
+
className: getClassName2("cssWarning"),
|
2411
2256
|
style: {
|
2412
2257
|
color: "var(--puck-color-red-04)",
|
2413
2258
|
display: "block",
|
@@ -2416,19 +2261,19 @@ var HeadingAnalyzer = () => {
|
|
2416
2261
|
children: [
|
2417
2262
|
"Heading analyzer styles not loaded. Please review the",
|
2418
2263
|
" ",
|
2419
|
-
/* @__PURE__ */ (0,
|
2264
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("a", { href: "https://github.com/measuredco/puck/blob/main/packages/plugin-heading-analyzer/README.md", children: "README" }),
|
2420
2265
|
"."
|
2421
2266
|
]
|
2422
2267
|
}
|
2423
2268
|
),
|
2424
|
-
hierarchy.length === 0 && /* @__PURE__ */ (0,
|
2425
|
-
/* @__PURE__ */ (0,
|
2269
|
+
hierarchy.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { children: "No headings." }),
|
2270
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(OutlineList, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
2426
2271
|
ReactFromJSON,
|
2427
2272
|
{
|
2428
2273
|
mapping: {
|
2429
|
-
Root: (props) => /* @__PURE__ */ (0,
|
2430
|
-
OutlineListItem: (props) => /* @__PURE__ */ (0,
|
2431
|
-
/* @__PURE__ */ (0,
|
2274
|
+
Root: (props) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_jsx_runtime2.Fragment, { children: props.children }),
|
2275
|
+
OutlineListItem: (props) => /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(OutlineList.Item, { children: [
|
2276
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(OutlineList.Clickable, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
2432
2277
|
"small",
|
2433
2278
|
{
|
2434
2279
|
className: getClassNameItem2({ missing: props.missing }),
|
@@ -2446,14 +2291,14 @@ var HeadingAnalyzer = () => {
|
|
2446
2291
|
}, 2e3);
|
2447
2292
|
}
|
2448
2293
|
},
|
2449
|
-
children: props.missing ? /* @__PURE__ */ (0,
|
2450
|
-
/* @__PURE__ */ (0,
|
2294
|
+
children: props.missing ? /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [
|
2295
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("b", { children: [
|
2451
2296
|
"H",
|
2452
2297
|
props.rank
|
2453
2298
|
] }),
|
2454
2299
|
": Missing"
|
2455
|
-
] }) : /* @__PURE__ */ (0,
|
2456
|
-
/* @__PURE__ */ (0,
|
2300
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [
|
2301
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("b", { children: [
|
2457
2302
|
"H",
|
2458
2303
|
props.rank
|
2459
2304
|
] }),
|
@@ -2462,7 +2307,7 @@ var HeadingAnalyzer = () => {
|
|
2462
2307
|
] })
|
2463
2308
|
}
|
2464
2309
|
) }),
|
2465
|
-
/* @__PURE__ */ (0,
|
2310
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(OutlineList, { children: props.children })
|
2466
2311
|
] })
|
2467
2312
|
},
|
2468
2313
|
entry: {
|
@@ -2483,12 +2328,10 @@ var HeadingAnalyzer = () => {
|
|
2483
2328
|
] });
|
2484
2329
|
};
|
2485
2330
|
var headingAnalyzer = {
|
2486
|
-
|
2487
|
-
|
2488
|
-
|
2489
|
-
|
2490
|
-
] })
|
2491
|
-
}
|
2331
|
+
name: "heading-analyzer",
|
2332
|
+
label: "Audit",
|
2333
|
+
render: HeadingAnalyzer,
|
2334
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Heading1, {})
|
2492
2335
|
};
|
2493
2336
|
var HeadingAnalyzer_default = headingAnalyzer;
|
2494
2337
|
/*! Bundled license information:
|
@@ -2532,7 +2375,7 @@ lucide-react/dist/esm/createLucideIcon.js:
|
|
2532
2375
|
* See the LICENSE file in the root directory of this source tree.
|
2533
2376
|
*)
|
2534
2377
|
|
2535
|
-
lucide-react/dist/esm/icons/
|
2378
|
+
lucide-react/dist/esm/icons/heading-1.js:
|
2536
2379
|
(**
|
2537
2380
|
* @license lucide-react v0.468.0 - ISC
|
2538
2381
|
*
|
package/dist/index.mjs
CHANGED
@@ -310,12 +310,12 @@ var HeadingAnalyzer_module_default = { "HeadingAnalyzer": "_HeadingAnalyzer_116v
|
|
310
310
|
// src/HeadingAnalyzer.tsx
|
311
311
|
import { createUsePuck } from "@measured/puck";
|
312
312
|
|
313
|
-
// ../core/components/
|
313
|
+
// ../core/components/OutlineList/index.tsx
|
314
314
|
init_react_import();
|
315
315
|
|
316
|
-
// css-module:/home/runner/work/puck/puck/packages/core/components/
|
316
|
+
// css-module:/home/runner/work/puck/puck/packages/core/components/OutlineList/styles.module.css#css-module
|
317
317
|
init_react_import();
|
318
|
-
var styles_module_default = { "
|
318
|
+
var styles_module_default = { "OutlineList": "_OutlineList_w4lzv_1", "OutlineListItem": "_OutlineListItem_w4lzv_25", "OutlineListItem--clickable": "_OutlineListItem--clickable_w4lzv_45" };
|
319
319
|
|
320
320
|
// ../core/lib/get-class-name-factory.ts
|
321
321
|
init_react_import();
|
@@ -344,29 +344,50 @@ var getClassNameFactory = (rootClass, styles, config = { baseClass: "" }) => (op
|
|
344
344
|
};
|
345
345
|
var get_class_name_factory_default = getClassNameFactory;
|
346
346
|
|
347
|
-
// ../core/components/
|
348
|
-
init_react_import();
|
349
|
-
|
350
|
-
// css-module:/home/runner/work/puck/puck/packages/core/components/Heading/styles.module.css#css-module
|
351
|
-
init_react_import();
|
352
|
-
var styles_module_default2 = { "Heading": "_Heading_qxrry_1", "Heading--xxxxl": "_Heading--xxxxl_qxrry_12", "Heading--xxxl": "_Heading--xxxl_qxrry_18", "Heading--xxl": "_Heading--xxl_qxrry_22", "Heading--xl": "_Heading--xl_qxrry_26", "Heading--l": "_Heading--l_qxrry_30", "Heading--m": "_Heading--m_qxrry_34", "Heading--s": "_Heading--s_qxrry_38", "Heading--xs": "_Heading--xs_qxrry_42" };
|
353
|
-
|
354
|
-
// ../core/components/Heading/index.tsx
|
347
|
+
// ../core/components/OutlineList/index.tsx
|
355
348
|
import { jsx } from "react/jsx-runtime";
|
356
|
-
var getClassName = get_class_name_factory_default("
|
357
|
-
var
|
358
|
-
|
349
|
+
var getClassName = get_class_name_factory_default("OutlineList", styles_module_default);
|
350
|
+
var getClassNameItem = get_class_name_factory_default("OutlineListItem", styles_module_default);
|
351
|
+
var OutlineList = ({ children }) => {
|
352
|
+
return /* @__PURE__ */ jsx("ul", { className: getClassName(), children });
|
353
|
+
};
|
354
|
+
OutlineList.Clickable = ({ children }) => /* @__PURE__ */ jsx("div", { className: getClassNameItem({ clickable: true }), children });
|
355
|
+
OutlineList.Item = ({
|
356
|
+
children,
|
357
|
+
onClick
|
358
|
+
}) => {
|
359
359
|
return /* @__PURE__ */ jsx(
|
360
|
-
|
360
|
+
"li",
|
361
361
|
{
|
362
|
-
className:
|
363
|
-
|
364
|
-
}),
|
362
|
+
className: getClassNameItem({ clickable: !!onClick }),
|
363
|
+
onClick,
|
365
364
|
children
|
366
365
|
}
|
367
366
|
);
|
368
367
|
};
|
369
368
|
|
369
|
+
// ../core/lib/scroll-into-view.ts
|
370
|
+
init_react_import();
|
371
|
+
var scrollIntoView = (el) => {
|
372
|
+
const oldStyle = __spreadValues({}, el.style);
|
373
|
+
el.style.scrollMargin = "256px";
|
374
|
+
if (el) {
|
375
|
+
el == null ? void 0 : el.scrollIntoView({ behavior: "smooth" });
|
376
|
+
el.style.scrollMargin = oldStyle.scrollMargin || "";
|
377
|
+
}
|
378
|
+
};
|
379
|
+
|
380
|
+
// ../core/lib/get-frame.ts
|
381
|
+
init_react_import();
|
382
|
+
var getFrame = () => {
|
383
|
+
if (typeof window === "undefined") return;
|
384
|
+
let frameEl = document.querySelector("#preview-frame");
|
385
|
+
if ((frameEl == null ? void 0 : frameEl.tagName) === "IFRAME") {
|
386
|
+
return frameEl.contentDocument || document;
|
387
|
+
}
|
388
|
+
return (frameEl == null ? void 0 : frameEl.ownerDocument) || document;
|
389
|
+
};
|
390
|
+
|
370
391
|
// ../../node_modules/lucide-react/dist/esm/lucide-react.js
|
371
392
|
init_react_import();
|
372
393
|
|
@@ -454,15 +475,29 @@ var createLucideIcon = (iconName, iconNode) => {
|
|
454
475
|
return Component;
|
455
476
|
};
|
456
477
|
|
457
|
-
// ../../node_modules/lucide-react/dist/esm/icons/
|
478
|
+
// ../../node_modules/lucide-react/dist/esm/icons/heading-1.js
|
458
479
|
init_react_import();
|
459
|
-
var
|
460
|
-
["path", { d: "
|
480
|
+
var Heading1 = createLucideIcon("Heading1", [
|
481
|
+
["path", { d: "M4 12h8", key: "17cfdx" }],
|
482
|
+
["path", { d: "M4 18V6", key: "1rz3zl" }],
|
483
|
+
["path", { d: "M12 18V6", key: "zqpxq5" }],
|
484
|
+
["path", { d: "m17 12 3-2v8", key: "1hhhft" }]
|
461
485
|
]);
|
462
486
|
|
463
|
-
// ../core/lib/
|
487
|
+
// ../core/lib/index.ts
|
488
|
+
init_react_import();
|
489
|
+
|
490
|
+
// ../core/lib/filter.ts
|
491
|
+
init_react_import();
|
492
|
+
|
493
|
+
// ../core/lib/data/reorder.ts
|
494
|
+
init_react_import();
|
495
|
+
|
496
|
+
// ../core/lib/data/replace.ts
|
497
|
+
init_react_import();
|
498
|
+
|
499
|
+
// ../core/lib/use-reset-auto-zoom.ts
|
464
500
|
init_react_import();
|
465
|
-
import { useMemo } from "react";
|
466
501
|
|
467
502
|
// ../core/store/index.ts
|
468
503
|
init_react_import();
|
@@ -2103,204 +2138,14 @@ var createAppStore = (initialAppStore) => create()(
|
|
2103
2138
|
})
|
2104
2139
|
);
|
2105
2140
|
var appStoreContext = createContext(createAppStore());
|
2106
|
-
function useAppStore(selector) {
|
2107
|
-
const context = useContext(appStoreContext);
|
2108
|
-
return useStore(context, selector);
|
2109
|
-
}
|
2110
|
-
function useAppStoreApi() {
|
2111
|
-
return useContext(appStoreContext);
|
2112
|
-
}
|
2113
|
-
|
2114
|
-
// ../core/lib/use-breadcrumbs.ts
|
2115
|
-
var useBreadcrumbs = (renderCount) => {
|
2116
|
-
const selectedId = useAppStore((s) => {
|
2117
|
-
var _a;
|
2118
|
-
return (_a = s.selectedItem) == null ? void 0 : _a.props.id;
|
2119
|
-
});
|
2120
|
-
const config = useAppStore((s) => s.config);
|
2121
|
-
const path = useAppStore((s) => {
|
2122
|
-
var _a;
|
2123
|
-
return (_a = s.state.indexes.nodes[selectedId]) == null ? void 0 : _a.path;
|
2124
|
-
});
|
2125
|
-
const appStore = useAppStoreApi();
|
2126
|
-
return useMemo(() => {
|
2127
|
-
const breadcrumbs = (path == null ? void 0 : path.map((zoneCompound) => {
|
2128
|
-
var _a, _b, _c;
|
2129
|
-
const [componentId] = zoneCompound.split(":");
|
2130
|
-
if (componentId === "root") {
|
2131
|
-
return {
|
2132
|
-
label: "Page",
|
2133
|
-
selector: null
|
2134
|
-
};
|
2135
|
-
}
|
2136
|
-
const node = appStore.getState().state.indexes.nodes[componentId];
|
2137
|
-
const parentId = node.path[node.path.length - 1];
|
2138
|
-
const contentIds = ((_a = appStore.getState().state.indexes.zones[parentId]) == null ? void 0 : _a.contentIds) || [];
|
2139
|
-
const index = contentIds.indexOf(componentId);
|
2140
|
-
const label = node ? (_c = (_b = config.components[node.data.type]) == null ? void 0 : _b.label) != null ? _c : node.data.type : "Component";
|
2141
|
-
return {
|
2142
|
-
label,
|
2143
|
-
selector: node ? {
|
2144
|
-
index,
|
2145
|
-
zone: node.path[node.path.length - 1]
|
2146
|
-
} : null
|
2147
|
-
};
|
2148
|
-
})) || [];
|
2149
|
-
if (renderCount) {
|
2150
|
-
return breadcrumbs.slice(breadcrumbs.length - renderCount);
|
2151
|
-
}
|
2152
|
-
return breadcrumbs;
|
2153
|
-
}, [path, renderCount]);
|
2154
|
-
};
|
2155
|
-
|
2156
|
-
// ../core/components/Loader/index.tsx
|
2157
|
-
init_react_import();
|
2158
|
-
|
2159
|
-
// ../core/lib/index.ts
|
2160
|
-
init_react_import();
|
2161
|
-
|
2162
|
-
// ../core/lib/filter.ts
|
2163
|
-
init_react_import();
|
2164
|
-
|
2165
|
-
// ../core/lib/data/reorder.ts
|
2166
|
-
init_react_import();
|
2167
|
-
|
2168
|
-
// ../core/lib/data/replace.ts
|
2169
|
-
init_react_import();
|
2170
|
-
|
2171
|
-
// ../core/lib/use-reset-auto-zoom.ts
|
2172
|
-
init_react_import();
|
2173
|
-
import { useCallback as useCallback2 } from "react";
|
2174
2141
|
|
2175
2142
|
// ../core/lib/get-zoom-config.ts
|
2176
2143
|
init_react_import();
|
2177
2144
|
|
2178
|
-
// css-module:/home/runner/work/puck/puck/packages/core/components/Loader/styles.module.css#css-module
|
2179
|
-
init_react_import();
|
2180
|
-
var styles_module_default3 = { "Loader": "_Loader_nacdm_13", "loader-animation": "_loader-animation_nacdm_1" };
|
2181
|
-
|
2182
|
-
// ../core/components/Loader/index.tsx
|
2183
|
-
import { jsx as jsx2 } from "react/jsx-runtime";
|
2184
|
-
var getClassName2 = get_class_name_factory_default("Loader", styles_module_default3);
|
2185
|
-
var Loader = (_a) => {
|
2186
|
-
var _b = _a, {
|
2187
|
-
color,
|
2188
|
-
size = 16
|
2189
|
-
} = _b, props = __objRest(_b, [
|
2190
|
-
"color",
|
2191
|
-
"size"
|
2192
|
-
]);
|
2193
|
-
return /* @__PURE__ */ jsx2(
|
2194
|
-
"span",
|
2195
|
-
__spreadValues({
|
2196
|
-
className: getClassName2(),
|
2197
|
-
style: {
|
2198
|
-
width: size,
|
2199
|
-
height: size,
|
2200
|
-
color
|
2201
|
-
},
|
2202
|
-
"aria-label": "loading"
|
2203
|
-
}, props)
|
2204
|
-
);
|
2205
|
-
};
|
2206
|
-
|
2207
|
-
// ../core/components/SidebarSection/index.tsx
|
2208
|
-
import { jsx as jsx3, jsxs } from "react/jsx-runtime";
|
2209
|
-
var getClassName3 = get_class_name_factory_default("SidebarSection", styles_module_default);
|
2210
|
-
var SidebarSection = ({
|
2211
|
-
children,
|
2212
|
-
title,
|
2213
|
-
background,
|
2214
|
-
showBreadcrumbs,
|
2215
|
-
noBorderTop,
|
2216
|
-
noPadding,
|
2217
|
-
isLoading
|
2218
|
-
}) => {
|
2219
|
-
const setUi = useAppStore((s) => s.setUi);
|
2220
|
-
const breadcrumbs = useBreadcrumbs(1);
|
2221
|
-
return /* @__PURE__ */ jsxs(
|
2222
|
-
"div",
|
2223
|
-
{
|
2224
|
-
className: getClassName3({ noBorderTop, noPadding }),
|
2225
|
-
style: { background },
|
2226
|
-
children: [
|
2227
|
-
/* @__PURE__ */ jsx3("div", { className: getClassName3("title"), children: /* @__PURE__ */ jsxs("div", { className: getClassName3("breadcrumbs"), children: [
|
2228
|
-
showBreadcrumbs ? breadcrumbs.map((breadcrumb, i) => /* @__PURE__ */ jsxs("div", { className: getClassName3("breadcrumb"), children: [
|
2229
|
-
/* @__PURE__ */ jsx3(
|
2230
|
-
"button",
|
2231
|
-
{
|
2232
|
-
type: "button",
|
2233
|
-
className: getClassName3("breadcrumbLabel"),
|
2234
|
-
onClick: () => setUi({ itemSelector: breadcrumb.selector }),
|
2235
|
-
children: breadcrumb.label
|
2236
|
-
}
|
2237
|
-
),
|
2238
|
-
/* @__PURE__ */ jsx3(ChevronRight, { size: 16 })
|
2239
|
-
] }, i)) : null,
|
2240
|
-
/* @__PURE__ */ jsx3("div", { className: getClassName3("heading"), children: /* @__PURE__ */ jsx3(Heading, { rank: "2", size: "xs", children: title }) })
|
2241
|
-
] }) }),
|
2242
|
-
/* @__PURE__ */ jsx3("div", { className: getClassName3("content"), children }),
|
2243
|
-
isLoading && /* @__PURE__ */ jsx3("div", { className: getClassName3("loadingOverlay"), children: /* @__PURE__ */ jsx3(Loader, { size: 32 }) })
|
2244
|
-
]
|
2245
|
-
}
|
2246
|
-
);
|
2247
|
-
};
|
2248
|
-
|
2249
|
-
// ../core/components/OutlineList/index.tsx
|
2250
|
-
init_react_import();
|
2251
|
-
|
2252
|
-
// css-module:/home/runner/work/puck/puck/packages/core/components/OutlineList/styles.module.css#css-module
|
2253
|
-
init_react_import();
|
2254
|
-
var styles_module_default4 = { "OutlineList": "_OutlineList_w4lzv_1", "OutlineListItem": "_OutlineListItem_w4lzv_25", "OutlineListItem--clickable": "_OutlineListItem--clickable_w4lzv_45" };
|
2255
|
-
|
2256
|
-
// ../core/components/OutlineList/index.tsx
|
2257
|
-
import { jsx as jsx4 } from "react/jsx-runtime";
|
2258
|
-
var getClassName4 = get_class_name_factory_default("OutlineList", styles_module_default4);
|
2259
|
-
var getClassNameItem = get_class_name_factory_default("OutlineListItem", styles_module_default4);
|
2260
|
-
var OutlineList = ({ children }) => {
|
2261
|
-
return /* @__PURE__ */ jsx4("ul", { className: getClassName4(), children });
|
2262
|
-
};
|
2263
|
-
OutlineList.Clickable = ({ children }) => /* @__PURE__ */ jsx4("div", { className: getClassNameItem({ clickable: true }), children });
|
2264
|
-
OutlineList.Item = ({
|
2265
|
-
children,
|
2266
|
-
onClick
|
2267
|
-
}) => {
|
2268
|
-
return /* @__PURE__ */ jsx4(
|
2269
|
-
"li",
|
2270
|
-
{
|
2271
|
-
className: getClassNameItem({ clickable: !!onClick }),
|
2272
|
-
onClick,
|
2273
|
-
children
|
2274
|
-
}
|
2275
|
-
);
|
2276
|
-
};
|
2277
|
-
|
2278
|
-
// ../core/lib/scroll-into-view.ts
|
2279
|
-
init_react_import();
|
2280
|
-
var scrollIntoView = (el) => {
|
2281
|
-
const oldStyle = __spreadValues({}, el.style);
|
2282
|
-
el.style.scrollMargin = "256px";
|
2283
|
-
if (el) {
|
2284
|
-
el == null ? void 0 : el.scrollIntoView({ behavior: "smooth" });
|
2285
|
-
el.style.scrollMargin = oldStyle.scrollMargin || "";
|
2286
|
-
}
|
2287
|
-
};
|
2288
|
-
|
2289
|
-
// ../core/lib/get-frame.ts
|
2290
|
-
init_react_import();
|
2291
|
-
var getFrame = () => {
|
2292
|
-
if (typeof window === "undefined") return;
|
2293
|
-
let frameEl = document.querySelector("#preview-frame");
|
2294
|
-
if ((frameEl == null ? void 0 : frameEl.tagName) === "IFRAME") {
|
2295
|
-
return frameEl.contentDocument || document;
|
2296
|
-
}
|
2297
|
-
return (frameEl == null ? void 0 : frameEl.ownerDocument) || document;
|
2298
|
-
};
|
2299
|
-
|
2300
2145
|
// src/HeadingAnalyzer.tsx
|
2301
2146
|
import ReactFromJSONModule from "react-from-json";
|
2302
|
-
import { Fragment, jsx as
|
2303
|
-
var
|
2147
|
+
import { Fragment, jsx as jsx2, jsxs } from "react/jsx-runtime";
|
2148
|
+
var getClassName2 = get_class_name_factory_default("HeadingAnalyzer", HeadingAnalyzer_module_default);
|
2304
2149
|
var getClassNameItem2 = get_class_name_factory_default("HeadingAnalyzerItem", HeadingAnalyzer_module_default);
|
2305
2150
|
var ReactFromJSON = ReactFromJSONModule.default || ReactFromJSONModule;
|
2306
2151
|
var getOutline = ({ frame } = {}) => {
|
@@ -2391,11 +2236,11 @@ var HeadingAnalyzer = () => {
|
|
2391
2236
|
frameObserver.disconnect();
|
2392
2237
|
};
|
2393
2238
|
}, [data]);
|
2394
|
-
return /* @__PURE__ */
|
2395
|
-
/* @__PURE__ */
|
2239
|
+
return /* @__PURE__ */ jsxs("div", { className: getClassName2(), children: [
|
2240
|
+
/* @__PURE__ */ jsxs(
|
2396
2241
|
"small",
|
2397
2242
|
{
|
2398
|
-
className:
|
2243
|
+
className: getClassName2("cssWarning"),
|
2399
2244
|
style: {
|
2400
2245
|
color: "var(--puck-color-red-04)",
|
2401
2246
|
display: "block",
|
@@ -2404,19 +2249,19 @@ var HeadingAnalyzer = () => {
|
|
2404
2249
|
children: [
|
2405
2250
|
"Heading analyzer styles not loaded. Please review the",
|
2406
2251
|
" ",
|
2407
|
-
/* @__PURE__ */
|
2252
|
+
/* @__PURE__ */ jsx2("a", { href: "https://github.com/measuredco/puck/blob/main/packages/plugin-heading-analyzer/README.md", children: "README" }),
|
2408
2253
|
"."
|
2409
2254
|
]
|
2410
2255
|
}
|
2411
2256
|
),
|
2412
|
-
hierarchy.length === 0 && /* @__PURE__ */
|
2413
|
-
/* @__PURE__ */
|
2257
|
+
hierarchy.length === 0 && /* @__PURE__ */ jsx2("div", { children: "No headings." }),
|
2258
|
+
/* @__PURE__ */ jsx2(OutlineList, { children: /* @__PURE__ */ jsx2(
|
2414
2259
|
ReactFromJSON,
|
2415
2260
|
{
|
2416
2261
|
mapping: {
|
2417
|
-
Root: (props) => /* @__PURE__ */
|
2418
|
-
OutlineListItem: (props) => /* @__PURE__ */
|
2419
|
-
/* @__PURE__ */
|
2262
|
+
Root: (props) => /* @__PURE__ */ jsx2(Fragment, { children: props.children }),
|
2263
|
+
OutlineListItem: (props) => /* @__PURE__ */ jsxs(OutlineList.Item, { children: [
|
2264
|
+
/* @__PURE__ */ jsx2(OutlineList.Clickable, { children: /* @__PURE__ */ jsx2(
|
2420
2265
|
"small",
|
2421
2266
|
{
|
2422
2267
|
className: getClassNameItem2({ missing: props.missing }),
|
@@ -2434,14 +2279,14 @@ var HeadingAnalyzer = () => {
|
|
2434
2279
|
}, 2e3);
|
2435
2280
|
}
|
2436
2281
|
},
|
2437
|
-
children: props.missing ? /* @__PURE__ */
|
2438
|
-
/* @__PURE__ */
|
2282
|
+
children: props.missing ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
2283
|
+
/* @__PURE__ */ jsxs("b", { children: [
|
2439
2284
|
"H",
|
2440
2285
|
props.rank
|
2441
2286
|
] }),
|
2442
2287
|
": Missing"
|
2443
|
-
] }) : /* @__PURE__ */
|
2444
|
-
/* @__PURE__ */
|
2288
|
+
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
2289
|
+
/* @__PURE__ */ jsxs("b", { children: [
|
2445
2290
|
"H",
|
2446
2291
|
props.rank
|
2447
2292
|
] }),
|
@@ -2450,7 +2295,7 @@ var HeadingAnalyzer = () => {
|
|
2450
2295
|
] })
|
2451
2296
|
}
|
2452
2297
|
) }),
|
2453
|
-
/* @__PURE__ */
|
2298
|
+
/* @__PURE__ */ jsx2(OutlineList, { children: props.children })
|
2454
2299
|
] })
|
2455
2300
|
},
|
2456
2301
|
entry: {
|
@@ -2471,12 +2316,10 @@ var HeadingAnalyzer = () => {
|
|
2471
2316
|
] });
|
2472
2317
|
};
|
2473
2318
|
var headingAnalyzer = {
|
2474
|
-
|
2475
|
-
|
2476
|
-
|
2477
|
-
|
2478
|
-
] })
|
2479
|
-
}
|
2319
|
+
name: "heading-analyzer",
|
2320
|
+
label: "Audit",
|
2321
|
+
render: HeadingAnalyzer,
|
2322
|
+
icon: /* @__PURE__ */ jsx2(Heading1, {})
|
2480
2323
|
};
|
2481
2324
|
var HeadingAnalyzer_default = headingAnalyzer;
|
2482
2325
|
export {
|
@@ -2523,7 +2366,7 @@ lucide-react/dist/esm/createLucideIcon.js:
|
|
2523
2366
|
* See the LICENSE file in the root directory of this source tree.
|
2524
2367
|
*)
|
2525
2368
|
|
2526
|
-
lucide-react/dist/esm/icons/
|
2369
|
+
lucide-react/dist/esm/icons/heading-1.js:
|
2527
2370
|
(**
|
2528
2371
|
* @license lucide-react v0.468.0 - ISC
|
2529
2372
|
*
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@measured/puck-plugin-heading-analyzer",
|
3
|
-
"version": "0.20.0-canary.
|
3
|
+
"version": "0.20.0-canary.158d52dd",
|
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.20.0-canary.
|
28
|
+
"@measured/puck": "^0.20.0-canary.158d52dd",
|
29
29
|
"@types/react": "^19.0.1",
|
30
30
|
"@types/react-dom": "^19.0.2",
|
31
31
|
"eslint": "^7.32.0",
|