@measured/puck-plugin-heading-analyzer 0.14.0-canary.f81931a → 0.14.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.css +38 -38
- package/dist/index.d.ts +1 -1
- package/dist/index.js +125 -168
- package/package.json +4 -3
package/dist/index.css
CHANGED
@@ -1,37 +1,37 @@
|
|
1
|
-
/*
|
2
|
-
.
|
1
|
+
/* css-module:/home/runner/work/puck/puck/packages/core/components/SidebarSection/styles.module.css/#css-module-data */
|
2
|
+
._SidebarSection_125qe_1 {
|
3
3
|
display: flex;
|
4
4
|
position: relative;
|
5
5
|
flex-direction: column;
|
6
6
|
color: var(--puck-color-black);
|
7
7
|
}
|
8
|
-
.
|
8
|
+
._SidebarSection_125qe_1:last-of-type {
|
9
9
|
flex-grow: 1;
|
10
10
|
}
|
11
|
-
.
|
11
|
+
._SidebarSection-title_125qe_12 {
|
12
12
|
background: var(--puck-color-white);
|
13
13
|
padding: 16px;
|
14
14
|
border-bottom: 1px solid var(--puck-color-grey-09);
|
15
15
|
border-top: 1px solid var(--puck-color-grey-09);
|
16
16
|
overflow-x: auto;
|
17
17
|
}
|
18
|
-
.
|
18
|
+
._SidebarSection--noBorderTop_125qe_20 > ._SidebarSection-title_125qe_12 {
|
19
19
|
border-top: 0px;
|
20
20
|
}
|
21
|
-
.
|
21
|
+
._SidebarSection-content_125qe_24 {
|
22
22
|
padding: 16px;
|
23
23
|
}
|
24
|
-
.
|
24
|
+
._SidebarSection--noPadding_125qe_28 > ._SidebarSection-content_125qe_24 {
|
25
25
|
padding: 0px;
|
26
26
|
}
|
27
|
-
.
|
27
|
+
._SidebarSection--noPadding_125qe_28 > ._SidebarSection-content_125qe_24:last-child {
|
28
28
|
padding-bottom: 4px;
|
29
29
|
}
|
30
|
-
.
|
30
|
+
._SidebarSection_125qe_1:last-of-type ._SidebarSection-content_125qe_24 {
|
31
31
|
border-bottom: none;
|
32
32
|
flex-grow: 1;
|
33
33
|
}
|
34
|
-
.
|
34
|
+
._SidebarSection-breadcrumbLabel_125qe_41 {
|
35
35
|
background: none;
|
36
36
|
border: 0;
|
37
37
|
border-radius: 2px;
|
@@ -42,34 +42,34 @@
|
|
42
42
|
padding: 0;
|
43
43
|
transition: color 50ms ease-in;
|
44
44
|
}
|
45
|
-
.
|
45
|
+
._SidebarSection-breadcrumbLabel_125qe_41:focus-visible {
|
46
46
|
outline: 2px solid var(--puck-color-azure-05);
|
47
47
|
outline-offset: 2px;
|
48
48
|
}
|
49
49
|
@media (hover: hover) and (pointer: fine) {
|
50
|
-
.
|
50
|
+
._SidebarSection-breadcrumbLabel_125qe_41:hover {
|
51
51
|
color: var(--puck-color-azure-03);
|
52
52
|
transition: none;
|
53
53
|
}
|
54
54
|
}
|
55
|
-
.
|
55
|
+
._SidebarSection-breadcrumbLabel_125qe_41:active {
|
56
56
|
color: var(--puck-color-azure-02);
|
57
57
|
transition: none;
|
58
58
|
}
|
59
|
-
.
|
59
|
+
._SidebarSection-breadcrumbs_125qe_70 {
|
60
60
|
align-items: center;
|
61
61
|
display: flex;
|
62
62
|
gap: 4px;
|
63
63
|
}
|
64
|
-
.
|
64
|
+
._SidebarSection-breadcrumb_125qe_41 {
|
65
65
|
align-items: center;
|
66
66
|
display: flex;
|
67
67
|
gap: 4px;
|
68
68
|
}
|
69
|
-
.
|
69
|
+
._SidebarSection-heading_125qe_82 {
|
70
70
|
padding-right: 16px;
|
71
71
|
}
|
72
|
-
.
|
72
|
+
._SidebarSection-loadingOverlay_125qe_86 {
|
73
73
|
background: var(--puck-color-white);
|
74
74
|
display: flex;
|
75
75
|
justify-content: center;
|
@@ -84,45 +84,45 @@
|
|
84
84
|
opacity: 0.8;
|
85
85
|
}
|
86
86
|
|
87
|
-
/*
|
88
|
-
.
|
87
|
+
/* css-module:/home/runner/work/puck/puck/packages/core/components/Heading/styles.module.css/#css-module-data */
|
88
|
+
._Heading_qxrry_1 {
|
89
89
|
display: block;
|
90
90
|
color: var(--puck-color-black);
|
91
91
|
font-weight: 700;
|
92
92
|
margin: 0;
|
93
93
|
}
|
94
|
-
.
|
94
|
+
._Heading_qxrry_1 b {
|
95
95
|
font-weight: 700;
|
96
96
|
}
|
97
|
-
.
|
97
|
+
._Heading--xxxxl_qxrry_12 {
|
98
98
|
font-size: var(--puck-font-size-xxxxl);
|
99
99
|
letter-spacing: 0.08ch;
|
100
100
|
font-weight: 800;
|
101
101
|
}
|
102
|
-
.
|
102
|
+
._Heading--xxxl_qxrry_18 {
|
103
103
|
font-size: var(--puck-font-size-xxxl);
|
104
104
|
}
|
105
|
-
.
|
105
|
+
._Heading--xxl_qxrry_22 {
|
106
106
|
font-size: var(--puck-font-size-xxl);
|
107
107
|
}
|
108
|
-
.
|
108
|
+
._Heading--xl_qxrry_26 {
|
109
109
|
font-size: var(--puck-font-size-xl);
|
110
110
|
}
|
111
|
-
.
|
111
|
+
._Heading--l_qxrry_30 {
|
112
112
|
font-size: var(--puck-font-size-l);
|
113
113
|
}
|
114
|
-
.
|
114
|
+
._Heading--m_qxrry_34 {
|
115
115
|
font-size: var(--puck-font-size-m);
|
116
116
|
}
|
117
|
-
.
|
117
|
+
._Heading--s_qxrry_38 {
|
118
118
|
font-size: var(--puck-font-size-s);
|
119
119
|
}
|
120
|
-
.
|
120
|
+
._Heading--xs_qxrry_42 {
|
121
121
|
font-size: var(--puck-font-size-xs);
|
122
122
|
}
|
123
123
|
|
124
|
-
/*
|
125
|
-
.
|
124
|
+
/* css-module:/home/runner/work/puck/puck/packages/core/components/OutlineList/styles.module.css/#css-module-data */
|
125
|
+
._OutlineList_18bgy_1 {
|
126
126
|
color: var(--puck-color-grey-03);
|
127
127
|
font-family: var(--puck-font-family);
|
128
128
|
margin: 0;
|
@@ -130,7 +130,7 @@
|
|
130
130
|
position: relative;
|
131
131
|
list-style: none;
|
132
132
|
}
|
133
|
-
.
|
133
|
+
._OutlineList_18bgy_1::before {
|
134
134
|
background: var(--puck-color-grey-08);
|
135
135
|
position: absolute;
|
136
136
|
left: -1px;
|
@@ -139,11 +139,11 @@
|
|
139
139
|
height: calc(100% - 9px);
|
140
140
|
content: "";
|
141
141
|
}
|
142
|
-
.
|
142
|
+
._OutlineListItem_18bgy_20 {
|
143
143
|
position: relative;
|
144
144
|
margin-bottom: 4px;
|
145
145
|
}
|
146
|
-
.
|
146
|
+
._OutlineListItem_18bgy_20::before {
|
147
147
|
background: var(--puck-color-grey-08);
|
148
148
|
position: absolute;
|
149
149
|
left: -17px;
|
@@ -152,24 +152,24 @@
|
|
152
152
|
height: 1px;
|
153
153
|
content: "";
|
154
154
|
}
|
155
|
-
.
|
155
|
+
._OutlineListItem--clickable_18bgy_35 {
|
156
156
|
cursor: pointer;
|
157
157
|
transition: color 50ms ease-in;
|
158
158
|
}
|
159
|
-
.
|
159
|
+
._OutlineListItem--clickable_18bgy_35:focus-visible {
|
160
160
|
outline: 2px solid var(--puck-color-azure-05);
|
161
161
|
outline-offset: 2px;
|
162
162
|
}
|
163
163
|
@media (hover: hover) and (pointer: fine) {
|
164
|
-
.
|
164
|
+
._OutlineListItem--clickable_18bgy_35:hover {
|
165
165
|
color: var(--puck-color-azure-04);
|
166
166
|
transition: none;
|
167
167
|
}
|
168
168
|
}
|
169
|
-
.
|
169
|
+
._OutlineListItem--clickable_18bgy_35:active {
|
170
170
|
color: var(--puck-color-azure-03);
|
171
171
|
transition: none;
|
172
172
|
}
|
173
|
-
.
|
173
|
+
._OutlineListItem_18bgy_20 > ._OutlineList_18bgy_1 {
|
174
174
|
margin: 8px 0;
|
175
175
|
}
|
package/dist/index.d.ts
CHANGED
@@ -93,7 +93,7 @@ type ExternalField<Props extends {
|
|
93
93
|
}) => Promise<any[] | null>;
|
94
94
|
mapProp?: (value: any) => Props;
|
95
95
|
mapRow?: (value: any) => Record<string, string | number>;
|
96
|
-
getItemSummary
|
96
|
+
getItemSummary?: (item: Props, index?: number) => string;
|
97
97
|
showSearch?: boolean;
|
98
98
|
initialQuery?: string;
|
99
99
|
filterFields?: Record<string, Field>;
|
package/dist/index.js
CHANGED
@@ -73,8 +73,7 @@ var init_react_import = __esm({
|
|
73
73
|
|
74
74
|
// ../../node_modules/classnames/index.js
|
75
75
|
var require_classnames = __commonJS({
|
76
|
-
"../../node_modules/classnames/index.js"(
|
77
|
-
"use strict";
|
76
|
+
"../../node_modules/classnames/index.js"(exports, module2) {
|
78
77
|
init_react_import();
|
79
78
|
(function() {
|
80
79
|
"use strict";
|
@@ -135,144 +134,14 @@ init_react_import();
|
|
135
134
|
// src/HeadingAnalyzer.tsx
|
136
135
|
init_react_import();
|
137
136
|
var import_react6 = require("react");
|
138
|
-
|
139
|
-
// ../core/lib/use-puck.ts
|
140
|
-
init_react_import();
|
141
|
-
|
142
|
-
// ../core/components/Puck/context.tsx
|
143
|
-
init_react_import();
|
144
|
-
var import_react2 = require("react");
|
145
|
-
|
146
|
-
// ../core/lib/get-item.ts
|
147
|
-
init_react_import();
|
148
|
-
|
149
|
-
// ../core/lib/root-droppable-id.ts
|
150
|
-
init_react_import();
|
151
|
-
var rootDroppableId = "default-zone";
|
152
|
-
|
153
|
-
// ../core/lib/setup-zone.ts
|
154
|
-
init_react_import();
|
155
|
-
var setupZone = (data, zoneKey) => {
|
156
|
-
if (zoneKey === rootDroppableId) {
|
157
|
-
return data;
|
158
|
-
}
|
159
|
-
const newData = __spreadValues({}, data);
|
160
|
-
newData.zones = data.zones || {};
|
161
|
-
newData.zones[zoneKey] = newData.zones[zoneKey] || [];
|
162
|
-
return newData;
|
163
|
-
};
|
164
|
-
|
165
|
-
// ../core/lib/get-item.ts
|
166
|
-
var getItem = (selector, data, dynamicProps = {}) => {
|
167
|
-
if (!selector.zone || selector.zone === rootDroppableId) {
|
168
|
-
const item2 = data.content[selector.index];
|
169
|
-
return __spreadProps(__spreadValues({}, item2), { props: dynamicProps[item2.props.id] || item2.props });
|
170
|
-
}
|
171
|
-
const item = setupZone(data, selector.zone).zones[selector.zone][selector.index];
|
172
|
-
return __spreadProps(__spreadValues({}, item), { props: dynamicProps[item.props.id] || item.props });
|
173
|
-
};
|
174
|
-
|
175
|
-
// ../core/components/ViewportControls/default-viewports.ts
|
176
|
-
init_react_import();
|
177
|
-
var defaultViewports = [
|
178
|
-
{ width: 360, height: "auto", icon: "Smartphone", label: "Small" },
|
179
|
-
{ width: 768, height: "auto", icon: "Tablet", label: "Medium" },
|
180
|
-
{ width: 1280, height: "auto", icon: "Monitor", label: "Large" }
|
181
|
-
];
|
182
|
-
|
183
|
-
// ../core/components/Puck/context.tsx
|
184
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
185
|
-
var defaultAppState = {
|
186
|
-
data: { content: [], root: { props: { title: "" } } },
|
187
|
-
ui: {
|
188
|
-
leftSideBarVisible: true,
|
189
|
-
rightSideBarVisible: true,
|
190
|
-
arrayState: {},
|
191
|
-
itemSelector: null,
|
192
|
-
componentList: {},
|
193
|
-
isDragging: false,
|
194
|
-
viewports: {
|
195
|
-
current: {
|
196
|
-
width: defaultViewports[0].width,
|
197
|
-
height: defaultViewports[0].height || "auto"
|
198
|
-
},
|
199
|
-
options: [],
|
200
|
-
controlsVisible: true
|
201
|
-
}
|
202
|
-
}
|
203
|
-
};
|
204
|
-
var defaultContext = {
|
205
|
-
state: defaultAppState,
|
206
|
-
dispatch: () => null,
|
207
|
-
config: { components: {} },
|
208
|
-
componentState: {},
|
209
|
-
resolveData: () => {
|
210
|
-
},
|
211
|
-
plugins: [],
|
212
|
-
overrides: {},
|
213
|
-
history: {},
|
214
|
-
viewports: defaultViewports,
|
215
|
-
zoomConfig: {
|
216
|
-
autoZoom: 1,
|
217
|
-
rootHeight: 0,
|
218
|
-
zoom: 1
|
219
|
-
},
|
220
|
-
setZoomConfig: () => null,
|
221
|
-
status: "LOADING",
|
222
|
-
setStatus: () => null,
|
223
|
-
iframe: {}
|
224
|
-
};
|
225
|
-
var appContext = (0, import_react2.createContext)(defaultContext);
|
226
|
-
function useAppContext() {
|
227
|
-
const mainContext = (0, import_react2.useContext)(appContext);
|
228
|
-
const selectedItem = mainContext.state.ui.itemSelector ? getItem(mainContext.state.ui.itemSelector, mainContext.state.data) : void 0;
|
229
|
-
return __spreadProps(__spreadValues({}, mainContext), {
|
230
|
-
// Helpers
|
231
|
-
selectedItem,
|
232
|
-
setUi: (ui, recordHistory) => {
|
233
|
-
return mainContext.dispatch({
|
234
|
-
type: "setUi",
|
235
|
-
ui,
|
236
|
-
recordHistory
|
237
|
-
});
|
238
|
-
}
|
239
|
-
});
|
240
|
-
}
|
241
|
-
|
242
|
-
// ../core/lib/use-puck.ts
|
243
|
-
var usePuck = () => {
|
244
|
-
const {
|
245
|
-
state: appState,
|
246
|
-
config,
|
247
|
-
history,
|
248
|
-
dispatch,
|
249
|
-
selectedItem
|
250
|
-
} = useAppContext();
|
251
|
-
return {
|
252
|
-
appState,
|
253
|
-
config,
|
254
|
-
dispatch,
|
255
|
-
history,
|
256
|
-
selectedItem: selectedItem || null
|
257
|
-
};
|
258
|
-
};
|
137
|
+
var import_puck = require("@measured/puck");
|
259
138
|
|
260
139
|
// ../core/components/SidebarSection/index.tsx
|
261
140
|
init_react_import();
|
262
141
|
|
263
|
-
//
|
264
|
-
|
265
|
-
|
266
|
-
"SidebarSection-title": "styles_SidebarSection-title",
|
267
|
-
"SidebarSection--noBorderTop": "styles_SidebarSection--noBorderTop",
|
268
|
-
"SidebarSection-content": "styles_SidebarSection-content",
|
269
|
-
"SidebarSection--noPadding": "styles_SidebarSection--noPadding",
|
270
|
-
"SidebarSection-breadcrumbLabel": "styles_SidebarSection-breadcrumbLabel",
|
271
|
-
"SidebarSection-breadcrumbs": "styles_SidebarSection-breadcrumbs",
|
272
|
-
"SidebarSection-breadcrumb": "styles_SidebarSection-breadcrumb",
|
273
|
-
"SidebarSection-heading": "styles_SidebarSection-heading",
|
274
|
-
"SidebarSection-loadingOverlay": "styles_SidebarSection-loadingOverlay"
|
275
|
-
};
|
142
|
+
// css-module:/home/runner/work/puck/puck/packages/core/components/SidebarSection/styles.module.css#css-module
|
143
|
+
init_react_import();
|
144
|
+
var styles_module_default = { "SidebarSection": "_SidebarSection_125qe_1", "SidebarSection-title": "_SidebarSection-title_125qe_12", "SidebarSection--noBorderTop": "_SidebarSection--noBorderTop_125qe_20", "SidebarSection-content": "_SidebarSection-content_125qe_24", "SidebarSection--noPadding": "_SidebarSection--noPadding_125qe_28", "SidebarSection-breadcrumbLabel": "_SidebarSection-breadcrumbLabel_125qe_41", "SidebarSection-breadcrumbs": "_SidebarSection-breadcrumbs_125qe_70", "SidebarSection-breadcrumb": "_SidebarSection-breadcrumb_125qe_41", "SidebarSection-heading": "_SidebarSection-heading_125qe_82", "SidebarSection-loadingOverlay": "_SidebarSection-loadingOverlay_125qe_86" };
|
276
145
|
|
277
146
|
// ../core/lib/get-class-name-factory.ts
|
278
147
|
init_react_import();
|
@@ -309,25 +178,16 @@ var get_class_name_factory_default = getClassNameFactory;
|
|
309
178
|
// ../core/components/Heading/index.tsx
|
310
179
|
init_react_import();
|
311
180
|
|
312
|
-
//
|
313
|
-
|
314
|
-
|
315
|
-
"Heading--xxxxl": "styles_Heading--xxxxl",
|
316
|
-
"Heading--xxxl": "styles_Heading--xxxl",
|
317
|
-
"Heading--xxl": "styles_Heading--xxl",
|
318
|
-
"Heading--xl": "styles_Heading--xl",
|
319
|
-
"Heading--l": "styles_Heading--l",
|
320
|
-
"Heading--m": "styles_Heading--m",
|
321
|
-
"Heading--s": "styles_Heading--s",
|
322
|
-
"Heading--xs": "styles_Heading--xs"
|
323
|
-
};
|
181
|
+
// css-module:/home/runner/work/puck/puck/packages/core/components/Heading/styles.module.css#css-module
|
182
|
+
init_react_import();
|
183
|
+
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" };
|
324
184
|
|
325
185
|
// ../core/components/Heading/index.tsx
|
326
|
-
var
|
327
|
-
var getClassName = get_class_name_factory_default("Heading",
|
186
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
187
|
+
var getClassName = get_class_name_factory_default("Heading", styles_module_default2);
|
328
188
|
var Heading = ({ children, rank, size = "m" }) => {
|
329
189
|
const Tag = rank ? `h${rank}` : "span";
|
330
|
-
return /* @__PURE__ */ (0,
|
190
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
331
191
|
Tag,
|
332
192
|
{
|
333
193
|
className: getClassName({
|
@@ -343,7 +203,7 @@ init_react_import();
|
|
343
203
|
|
344
204
|
// ../../node_modules/lucide-react/dist/esm/createLucideIcon.js
|
345
205
|
init_react_import();
|
346
|
-
var
|
206
|
+
var import_react2 = require("react");
|
347
207
|
|
348
208
|
// ../../node_modules/lucide-react/dist/esm/defaultAttributes.js
|
349
209
|
init_react_import();
|
@@ -362,10 +222,10 @@ var defaultAttributes = {
|
|
362
222
|
// ../../node_modules/lucide-react/dist/esm/createLucideIcon.js
|
363
223
|
var toKebabCase = (string) => string.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase().trim();
|
364
224
|
var createLucideIcon = (iconName, iconNode) => {
|
365
|
-
const Component = (0,
|
225
|
+
const Component = (0, import_react2.forwardRef)(
|
366
226
|
(_a, ref) => {
|
367
227
|
var _b = _a, { color = "currentColor", size = 24, strokeWidth = 2, absoluteStrokeWidth, className = "", children } = _b, rest = __objRest(_b, ["color", "size", "strokeWidth", "absoluteStrokeWidth", "className", "children"]);
|
368
|
-
return (0,
|
228
|
+
return (0, import_react2.createElement)(
|
369
229
|
"svg",
|
370
230
|
__spreadValues(__spreadProps(__spreadValues({
|
371
231
|
ref
|
@@ -377,7 +237,7 @@ var createLucideIcon = (iconName, iconNode) => {
|
|
377
237
|
className: ["lucide", `lucide-${toKebabCase(iconName)}`, className].join(" ")
|
378
238
|
}), rest),
|
379
239
|
[
|
380
|
-
...iconNode.map(([tag, attrs]) => (0,
|
240
|
+
...iconNode.map(([tag, attrs]) => (0, import_react2.createElement)(tag, attrs)),
|
381
241
|
...Array.isArray(children) ? children : [children]
|
382
242
|
]
|
383
243
|
);
|
@@ -399,7 +259,36 @@ var import_react5 = require("react");
|
|
399
259
|
|
400
260
|
// ../core/components/DropZone/context.tsx
|
401
261
|
init_react_import();
|
402
|
-
var
|
262
|
+
var import_react3 = require("react");
|
263
|
+
|
264
|
+
// ../core/lib/get-item.ts
|
265
|
+
init_react_import();
|
266
|
+
|
267
|
+
// ../core/lib/root-droppable-id.ts
|
268
|
+
init_react_import();
|
269
|
+
var rootDroppableId = "default-zone";
|
270
|
+
|
271
|
+
// ../core/lib/setup-zone.ts
|
272
|
+
init_react_import();
|
273
|
+
var setupZone = (data, zoneKey) => {
|
274
|
+
if (zoneKey === rootDroppableId) {
|
275
|
+
return data;
|
276
|
+
}
|
277
|
+
const newData = __spreadValues({}, data);
|
278
|
+
newData.zones = data.zones || {};
|
279
|
+
newData.zones[zoneKey] = newData.zones[zoneKey] || [];
|
280
|
+
return newData;
|
281
|
+
};
|
282
|
+
|
283
|
+
// ../core/lib/get-item.ts
|
284
|
+
var getItem = (selector, data, dynamicProps = {}) => {
|
285
|
+
if (!selector.zone || selector.zone === rootDroppableId) {
|
286
|
+
const item2 = data.content[selector.index];
|
287
|
+
return __spreadProps(__spreadValues({}, item2), { props: dynamicProps[item2.props.id] || item2.props });
|
288
|
+
}
|
289
|
+
const item = setupZone(data, selector.zone).zones[selector.zone][selector.index];
|
290
|
+
return __spreadProps(__spreadValues({}, item), { props: dynamicProps[item.props.id] || item.props });
|
291
|
+
};
|
403
292
|
|
404
293
|
// ../core/lib/get-zone-id.ts
|
405
294
|
init_react_import();
|
@@ -414,8 +303,79 @@ var getZoneId = (zoneCompound) => {
|
|
414
303
|
};
|
415
304
|
|
416
305
|
// ../core/components/DropZone/context.tsx
|
306
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
307
|
+
var dropZoneContext = (0, import_react3.createContext)(null);
|
308
|
+
|
309
|
+
// ../core/components/Puck/context.tsx
|
310
|
+
init_react_import();
|
311
|
+
var import_react4 = require("react");
|
312
|
+
|
313
|
+
// ../core/components/ViewportControls/default-viewports.ts
|
314
|
+
init_react_import();
|
315
|
+
var defaultViewports = [
|
316
|
+
{ width: 360, height: "auto", icon: "Smartphone", label: "Small" },
|
317
|
+
{ width: 768, height: "auto", icon: "Tablet", label: "Medium" },
|
318
|
+
{ width: 1280, height: "auto", icon: "Monitor", label: "Large" }
|
319
|
+
];
|
320
|
+
|
321
|
+
// ../core/components/Puck/context.tsx
|
417
322
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
418
|
-
var
|
323
|
+
var defaultAppState = {
|
324
|
+
data: { content: [], root: { props: { title: "" } } },
|
325
|
+
ui: {
|
326
|
+
leftSideBarVisible: true,
|
327
|
+
rightSideBarVisible: true,
|
328
|
+
arrayState: {},
|
329
|
+
itemSelector: null,
|
330
|
+
componentList: {},
|
331
|
+
isDragging: false,
|
332
|
+
viewports: {
|
333
|
+
current: {
|
334
|
+
width: defaultViewports[0].width,
|
335
|
+
height: defaultViewports[0].height || "auto"
|
336
|
+
},
|
337
|
+
options: [],
|
338
|
+
controlsVisible: true
|
339
|
+
}
|
340
|
+
}
|
341
|
+
};
|
342
|
+
var defaultContext = {
|
343
|
+
state: defaultAppState,
|
344
|
+
dispatch: () => null,
|
345
|
+
config: { components: {} },
|
346
|
+
componentState: {},
|
347
|
+
resolveData: () => {
|
348
|
+
},
|
349
|
+
plugins: [],
|
350
|
+
overrides: {},
|
351
|
+
history: {},
|
352
|
+
viewports: defaultViewports,
|
353
|
+
zoomConfig: {
|
354
|
+
autoZoom: 1,
|
355
|
+
rootHeight: 0,
|
356
|
+
zoom: 1
|
357
|
+
},
|
358
|
+
setZoomConfig: () => null,
|
359
|
+
status: "LOADING",
|
360
|
+
setStatus: () => null,
|
361
|
+
iframe: {}
|
362
|
+
};
|
363
|
+
var appContext = (0, import_react4.createContext)(defaultContext);
|
364
|
+
function useAppContext() {
|
365
|
+
const mainContext = (0, import_react4.useContext)(appContext);
|
366
|
+
const selectedItem = mainContext.state.ui.itemSelector ? getItem(mainContext.state.ui.itemSelector, mainContext.state.data) : void 0;
|
367
|
+
return __spreadProps(__spreadValues({}, mainContext), {
|
368
|
+
// Helpers
|
369
|
+
selectedItem,
|
370
|
+
setUi: (ui, recordHistory) => {
|
371
|
+
return mainContext.dispatch({
|
372
|
+
type: "setUi",
|
373
|
+
ui,
|
374
|
+
recordHistory
|
375
|
+
});
|
376
|
+
}
|
377
|
+
});
|
378
|
+
}
|
419
379
|
|
420
380
|
// ../core/lib/use-breadcrumbs.ts
|
421
381
|
var convertPathDataToBreadcrumbs = (selectedItem, pathData, data) => {
|
@@ -592,7 +552,7 @@ var ClipLoader_default = ClipLoader;
|
|
592
552
|
|
593
553
|
// ../core/components/SidebarSection/index.tsx
|
594
554
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
595
|
-
var getClassName2 = get_class_name_factory_default("SidebarSection",
|
555
|
+
var getClassName2 = get_class_name_factory_default("SidebarSection", styles_module_default);
|
596
556
|
var SidebarSection = ({
|
597
557
|
children,
|
598
558
|
title,
|
@@ -634,17 +594,14 @@ var SidebarSection = ({
|
|
634
594
|
// ../core/components/OutlineList/index.tsx
|
635
595
|
init_react_import();
|
636
596
|
|
637
|
-
//
|
638
|
-
|
639
|
-
|
640
|
-
OutlineListItem: "styles_OutlineListItem",
|
641
|
-
"OutlineListItem--clickable": "styles_OutlineListItem--clickable"
|
642
|
-
};
|
597
|
+
// css-module:/home/runner/work/puck/puck/packages/core/components/OutlineList/styles.module.css#css-module
|
598
|
+
init_react_import();
|
599
|
+
var styles_module_default3 = { "OutlineList": "_OutlineList_18bgy_1", "OutlineListItem": "_OutlineListItem_18bgy_20", "OutlineListItem--clickable": "_OutlineListItem--clickable_18bgy_35" };
|
643
600
|
|
644
601
|
// ../core/components/OutlineList/index.tsx
|
645
602
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
646
|
-
var getClassName3 = get_class_name_factory_default("OutlineList",
|
647
|
-
var getClassNameItem = get_class_name_factory_default("OutlineListItem",
|
603
|
+
var getClassName3 = get_class_name_factory_default("OutlineList", styles_module_default3);
|
604
|
+
var getClassNameItem = get_class_name_factory_default("OutlineListItem", styles_module_default3);
|
648
605
|
var OutlineList = ({ children }) => {
|
649
606
|
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("ul", { className: getClassName3(), children });
|
650
607
|
};
|
@@ -741,7 +698,7 @@ function buildHierarchy(frame) {
|
|
741
698
|
return root.children;
|
742
699
|
}
|
743
700
|
var HeadingAnalyzer = () => {
|
744
|
-
const { appState } = usePuck();
|
701
|
+
const { appState } = (0, import_puck.usePuck)();
|
745
702
|
const [hierarchy, setHierarchy] = (0, import_react6.useState)([]);
|
746
703
|
const [firstRender, setFirstRender] = (0, import_react6.useState)(true);
|
747
704
|
(0, import_react6.useEffect)(() => {
|
@@ -756,7 +713,7 @@ var HeadingAnalyzer = () => {
|
|
756
713
|
} else {
|
757
714
|
setHierarchy(buildHierarchy(frame));
|
758
715
|
}
|
759
|
-
}, [appState.data
|
716
|
+
}, [appState.data]);
|
760
717
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
761
718
|
hierarchy.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { children: "No headings." }),
|
762
719
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(OutlineList, { children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@measured/puck-plugin-heading-analyzer",
|
3
|
-
"version": "0.14.0
|
3
|
+
"version": "0.14.0",
|
4
4
|
"author": "Measured Corporation Ltd <hello@measured.co>",
|
5
5
|
"repository": "measuredco/puck",
|
6
6
|
"bugs": "https://github.com/measuredco/puck/issues",
|
@@ -18,13 +18,13 @@
|
|
18
18
|
"dist"
|
19
19
|
],
|
20
20
|
"devDependencies": {
|
21
|
-
"@measured/puck": "^0.14.0
|
21
|
+
"@measured/puck": "^0.14.0",
|
22
22
|
"@types/react": "^18.2.0",
|
23
23
|
"@types/react-dom": "^18.2.0",
|
24
24
|
"eslint": "^7.32.0",
|
25
25
|
"eslint-config-custom": "*",
|
26
26
|
"tsconfig": "*",
|
27
|
-
"tsup": "^
|
27
|
+
"tsup": "^6.7.0",
|
28
28
|
"tsup-config": "*",
|
29
29
|
"typescript": "^4.5.2"
|
30
30
|
},
|
@@ -32,6 +32,7 @@
|
|
32
32
|
"react-from-json": "^0.8.0"
|
33
33
|
},
|
34
34
|
"peerDependencies": {
|
35
|
+
"@measured/puck": "^0.13.1",
|
35
36
|
"react": "^17.0.0 || ^18.0.0"
|
36
37
|
}
|
37
38
|
}
|