@measured/puck-plugin-heading-analyzer 0.21.0-canary.79a26849 → 0.21.0-canary.7ed9655b

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 CHANGED
@@ -1,162 +1,18 @@
1
1
  /* css-module:/home/runner/work/puck/puck/packages/plugin-heading-analyzer/src/HeadingAnalyzer.module.css/#css-module-data */
2
- ._HeadingAnalyzer_116v6_1 {
2
+ ._HeadingAnalyzer_yg0s7_1 {
3
3
  display: block;
4
+ padding: 16px;
4
5
  }
5
- ._HeadingAnalyzer-cssWarning_116v6_5 {
6
+ ._HeadingAnalyzer-cssWarning_yg0s7_6 {
6
7
  display: none !important;
7
8
  }
8
- ._HeadingAnalyzerItem_116v6_9 {
9
+ ._HeadingAnalyzerItem_yg0s7_10 {
9
10
  display: inline;
10
11
  }
11
- ._HeadingAnalyzerItem--missing_116v6_13 {
12
+ ._HeadingAnalyzerItem--missing_yg0s7_14 {
12
13
  color: var(--puck-color-red-04);
13
14
  }
14
15
 
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
16
  /* css-module:/home/runner/work/puck/puck/packages/core/components/OutlineList/styles.module.css/#css-module-data */
161
17
  ._OutlineList_w4lzv_1 {
162
18
  color: var(--puck-color-grey-03);
package/dist/index.d.mts CHANGED
@@ -323,6 +323,7 @@ interface FieldMetadata extends Metadata {
323
323
  type ItemWithId = {
324
324
  _arrayId: string;
325
325
  _originalIndex: number;
326
+ _currentIndex: number;
326
327
  };
327
328
  type ArrayState = {
328
329
  items: ItemWithId[];
@@ -333,6 +334,7 @@ type UiState = {
333
334
  rightSideBarVisible: boolean;
334
335
  leftSideBarWidth?: number | null;
335
336
  rightSideBarWidth?: number | null;
337
+ mobilePanelExpanded?: boolean;
336
338
  itemSelector: ItemSelector | null;
337
339
  arrayState: Record<string, ArrayState | undefined>;
338
340
  previewMode: "interactive" | "edit";
@@ -345,7 +347,7 @@ type UiState = {
345
347
  isDragging: boolean;
346
348
  viewports: {
347
349
  current: {
348
- width: number;
350
+ width: number | "100%";
349
351
  height: number | "auto";
350
352
  };
351
353
  controlsVisible: boolean;
@@ -354,6 +356,9 @@ type UiState = {
354
356
  field: {
355
357
  focus?: string | null;
356
358
  };
359
+ plugin: {
360
+ current: string | null;
361
+ };
357
362
  };
358
363
  type AppState<UserData extends Data = Data> = {
359
364
  data: UserData;
@@ -397,6 +402,11 @@ type LeftOrExactRight<Union, Left, Right> = (Left & Union extends Right ? Exact<
397
402
  type AssertHasValue<T, True = T, False = never> = [keyof T] extends [
398
403
  never
399
404
  ] ? False : True;
405
+ type RenderFunc<Props extends {
406
+ [key: string]: any;
407
+ } = {
408
+ children: ReactNode;
409
+ }> = (props: Props) => ReactElement;
400
410
 
401
411
  type MapFnParams<ThisField = Field> = {
402
412
  value: any;
@@ -420,11 +430,6 @@ G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>, UserField extends
420
430
  [Type in UserField["type"]]: FieldTransformFn<ExtractField<UserField, Type>>;
421
431
  }>;
422
432
 
423
- type RenderFunc<Props extends {
424
- [key: string]: any;
425
- } = {
426
- children: ReactNode;
427
- }> = (props: Props) => ReactElement;
428
433
  declare const overrideKeys: readonly ["header", "headerActions", "fields", "fieldLabel", "drawer", "drawerItem", "componentOverlay", "outline", "puck", "preview"];
429
434
  type OverrideKey = (typeof overrideKeys)[number];
430
435
  type OverridesGeneric<Shape extends {
@@ -495,7 +500,7 @@ type DragAxis = "dynamic" | "y" | "x";
495
500
 
496
501
  type iconTypes = "Smartphone" | "Monitor" | "Tablet";
497
502
  type Viewport = {
498
- width: number;
503
+ width: number | "100%";
499
504
  height?: number | "auto";
500
505
  label?: string;
501
506
  icon?: iconTypes | ReactNode;
@@ -509,8 +514,13 @@ type Permissions = {
509
514
  insert: boolean;
510
515
  } & Record<string, boolean>;
511
516
  type Plugin<UserConfig extends Config = Config> = {
517
+ name?: string;
518
+ label?: string;
519
+ icon?: ReactNode;
520
+ render?: () => ReactElement;
512
521
  overrides?: Partial<Overrides<UserConfig>>;
513
522
  fieldTransforms?: FieldTransforms<UserConfig>;
523
+ mobilePanelHeight?: "toggle" | "min-content";
514
524
  };
515
525
  type Slot<Props extends {
516
526
  [key: string]: DefaultComponentProps;
package/dist/index.d.ts CHANGED
@@ -323,6 +323,7 @@ interface FieldMetadata extends Metadata {
323
323
  type ItemWithId = {
324
324
  _arrayId: string;
325
325
  _originalIndex: number;
326
+ _currentIndex: number;
326
327
  };
327
328
  type ArrayState = {
328
329
  items: ItemWithId[];
@@ -333,6 +334,7 @@ type UiState = {
333
334
  rightSideBarVisible: boolean;
334
335
  leftSideBarWidth?: number | null;
335
336
  rightSideBarWidth?: number | null;
337
+ mobilePanelExpanded?: boolean;
336
338
  itemSelector: ItemSelector | null;
337
339
  arrayState: Record<string, ArrayState | undefined>;
338
340
  previewMode: "interactive" | "edit";
@@ -345,7 +347,7 @@ type UiState = {
345
347
  isDragging: boolean;
346
348
  viewports: {
347
349
  current: {
348
- width: number;
350
+ width: number | "100%";
349
351
  height: number | "auto";
350
352
  };
351
353
  controlsVisible: boolean;
@@ -354,6 +356,9 @@ type UiState = {
354
356
  field: {
355
357
  focus?: string | null;
356
358
  };
359
+ plugin: {
360
+ current: string | null;
361
+ };
357
362
  };
358
363
  type AppState<UserData extends Data = Data> = {
359
364
  data: UserData;
@@ -397,6 +402,11 @@ type LeftOrExactRight<Union, Left, Right> = (Left & Union extends Right ? Exact<
397
402
  type AssertHasValue<T, True = T, False = never> = [keyof T] extends [
398
403
  never
399
404
  ] ? False : True;
405
+ type RenderFunc<Props extends {
406
+ [key: string]: any;
407
+ } = {
408
+ children: ReactNode;
409
+ }> = (props: Props) => ReactElement;
400
410
 
401
411
  type MapFnParams<ThisField = Field> = {
402
412
  value: any;
@@ -420,11 +430,6 @@ G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>, UserField extends
420
430
  [Type in UserField["type"]]: FieldTransformFn<ExtractField<UserField, Type>>;
421
431
  }>;
422
432
 
423
- type RenderFunc<Props extends {
424
- [key: string]: any;
425
- } = {
426
- children: ReactNode;
427
- }> = (props: Props) => ReactElement;
428
433
  declare const overrideKeys: readonly ["header", "headerActions", "fields", "fieldLabel", "drawer", "drawerItem", "componentOverlay", "outline", "puck", "preview"];
429
434
  type OverrideKey = (typeof overrideKeys)[number];
430
435
  type OverridesGeneric<Shape extends {
@@ -495,7 +500,7 @@ type DragAxis = "dynamic" | "y" | "x";
495
500
 
496
501
  type iconTypes = "Smartphone" | "Monitor" | "Tablet";
497
502
  type Viewport = {
498
- width: number;
503
+ width: number | "100%";
499
504
  height?: number | "auto";
500
505
  label?: string;
501
506
  icon?: iconTypes | ReactNode;
@@ -509,8 +514,13 @@ type Permissions = {
509
514
  insert: boolean;
510
515
  } & Record<string, boolean>;
511
516
  type Plugin<UserConfig extends Config = Config> = {
517
+ name?: string;
518
+ label?: string;
519
+ icon?: ReactNode;
520
+ render?: () => ReactElement;
512
521
  overrides?: Partial<Overrides<UserConfig>>;
513
522
  fieldTransforms?: FieldTransforms<UserConfig>;
523
+ mobilePanelHeight?: "toggle" | "min-content";
514
524
  };
515
525
  type Slot<Props extends {
516
526
  [key: string]: DefaultComponentProps;
package/dist/index.js CHANGED
@@ -277,21 +277,21 @@ init_react_import();
277
277
 
278
278
  // src/HeadingAnalyzer.tsx
279
279
  init_react_import();
280
- var import_react11 = require("react");
280
+ var import_react10 = require("react");
281
281
 
282
282
  // css-module:/home/runner/work/puck/puck/packages/plugin-heading-analyzer/src/HeadingAnalyzer.module.css#css-module
283
283
  init_react_import();
284
- var HeadingAnalyzer_module_default = { "HeadingAnalyzer": "_HeadingAnalyzer_116v6_1", "HeadingAnalyzer-cssWarning": "_HeadingAnalyzer-cssWarning_116v6_5", "HeadingAnalyzerItem": "_HeadingAnalyzerItem_116v6_9", "HeadingAnalyzerItem--missing": "_HeadingAnalyzerItem--missing_116v6_13" };
284
+ var HeadingAnalyzer_module_default = { "HeadingAnalyzer": "_HeadingAnalyzer_yg0s7_1", "HeadingAnalyzer-cssWarning": "_HeadingAnalyzer-cssWarning_yg0s7_6", "HeadingAnalyzerItem": "_HeadingAnalyzerItem_yg0s7_10", "HeadingAnalyzerItem--missing": "_HeadingAnalyzerItem--missing_yg0s7_14" };
285
285
 
286
286
  // src/HeadingAnalyzer.tsx
287
287
  var import_puck = require("@measured/puck");
288
288
 
289
- // ../core/components/SidebarSection/index.tsx
289
+ // ../core/components/OutlineList/index.tsx
290
290
  init_react_import();
291
291
 
292
- // css-module:/home/runner/work/puck/puck/packages/core/components/SidebarSection/styles.module.css#css-module
292
+ // css-module:/home/runner/work/puck/puck/packages/core/components/OutlineList/styles.module.css#css-module
293
293
  init_react_import();
294
- var styles_module_default = { "SidebarSection": "_SidebarSection_8boj8_1", "SidebarSection-title": "_SidebarSection-title_8boj8_12", "SidebarSection--noBorderTop": "_SidebarSection--noBorderTop_8boj8_20", "SidebarSection-content": "_SidebarSection-content_8boj8_24", "SidebarSection--noPadding": "_SidebarSection--noPadding_8boj8_28", "SidebarSection-breadcrumbLabel": "_SidebarSection-breadcrumbLabel_8boj8_41", "SidebarSection-breadcrumbs": "_SidebarSection-breadcrumbs_8boj8_70", "SidebarSection-breadcrumb": "_SidebarSection-breadcrumb_8boj8_41", "SidebarSection-heading": "_SidebarSection-heading_8boj8_82", "SidebarSection-loadingOverlay": "_SidebarSection-loadingOverlay_8boj8_86" };
294
+ var styles_module_default = { "OutlineList": "_OutlineList_w4lzv_1", "OutlineListItem": "_OutlineListItem_w4lzv_25", "OutlineListItem--clickable": "_OutlineListItem--clickable_w4lzv_45" };
295
295
 
296
296
  // ../core/lib/get-class-name-factory.ts
297
297
  init_react_import();
@@ -320,29 +320,50 @@ var getClassNameFactory = (rootClass, styles, config = { baseClass: "" }) => (op
320
320
  };
321
321
  var get_class_name_factory_default = getClassNameFactory;
322
322
 
323
- // ../core/components/Heading/index.tsx
324
- init_react_import();
325
-
326
- // css-module:/home/runner/work/puck/puck/packages/core/components/Heading/styles.module.css#css-module
327
- init_react_import();
328
- 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" };
329
-
330
- // ../core/components/Heading/index.tsx
323
+ // ../core/components/OutlineList/index.tsx
331
324
  var import_jsx_runtime = require("react/jsx-runtime");
332
- var getClassName = get_class_name_factory_default("Heading", styles_module_default2);
333
- var Heading = ({ children, rank, size = "m" }) => {
334
- const Tag = rank ? `h${rank}` : "span";
325
+ var getClassName = get_class_name_factory_default("OutlineList", styles_module_default);
326
+ var getClassNameItem = get_class_name_factory_default("OutlineListItem", styles_module_default);
327
+ var OutlineList = ({ children }) => {
328
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("ul", { className: getClassName(), children });
329
+ };
330
+ OutlineList.Clickable = ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: getClassNameItem({ clickable: true }), children });
331
+ OutlineList.Item = ({
332
+ children,
333
+ onClick
334
+ }) => {
335
335
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
336
- Tag,
336
+ "li",
337
337
  {
338
- className: getClassName({
339
- [size]: true
340
- }),
338
+ className: getClassNameItem({ clickable: !!onClick }),
339
+ onClick,
341
340
  children
342
341
  }
343
342
  );
344
343
  };
345
344
 
345
+ // ../core/lib/scroll-into-view.ts
346
+ init_react_import();
347
+ var scrollIntoView = (el) => {
348
+ const oldStyle = __spreadValues({}, el.style);
349
+ el.style.scrollMargin = "256px";
350
+ if (el) {
351
+ el == null ? void 0 : el.scrollIntoView({ behavior: "smooth" });
352
+ el.style.scrollMargin = oldStyle.scrollMargin || "";
353
+ }
354
+ };
355
+
356
+ // ../core/lib/get-frame.ts
357
+ init_react_import();
358
+ var getFrame = () => {
359
+ if (typeof window === "undefined") return;
360
+ let frameEl = document.querySelector("#preview-frame");
361
+ if ((frameEl == null ? void 0 : frameEl.tagName) === "IFRAME") {
362
+ return frameEl.contentDocument || document;
363
+ }
364
+ return (frameEl == null ? void 0 : frameEl.ownerDocument) || document;
365
+ };
366
+
346
367
  // ../../node_modules/lucide-react/dist/esm/lucide-react.js
347
368
  init_react_import();
348
369
 
@@ -430,15 +451,29 @@ var createLucideIcon = (iconName, iconNode) => {
430
451
  return Component;
431
452
  };
432
453
 
433
- // ../../node_modules/lucide-react/dist/esm/icons/chevron-right.js
454
+ // ../../node_modules/lucide-react/dist/esm/icons/heading-1.js
434
455
  init_react_import();
435
- var ChevronRight = createLucideIcon("ChevronRight", [
436
- ["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]
456
+ var Heading1 = createLucideIcon("Heading1", [
457
+ ["path", { d: "M4 12h8", key: "17cfdx" }],
458
+ ["path", { d: "M4 18V6", key: "1rz3zl" }],
459
+ ["path", { d: "M12 18V6", key: "zqpxq5" }],
460
+ ["path", { d: "m17 12 3-2v8", key: "1hhhft" }]
437
461
  ]);
438
462
 
439
- // ../core/lib/use-breadcrumbs.ts
463
+ // ../core/lib/index.ts
464
+ init_react_import();
465
+
466
+ // ../core/lib/filter.ts
467
+ init_react_import();
468
+
469
+ // ../core/lib/data/reorder.ts
470
+ init_react_import();
471
+
472
+ // ../core/lib/data/replace.ts
473
+ init_react_import();
474
+
475
+ // ../core/lib/use-reset-auto-zoom.ts
440
476
  init_react_import();
441
- var import_react10 = require("react");
442
477
 
443
478
  // ../core/store/index.ts
444
479
  init_react_import();
@@ -1408,7 +1443,8 @@ init_react_import();
1408
1443
  var defaultViewports = [
1409
1444
  { width: 360, height: "auto", icon: "Smartphone", label: "Small" },
1410
1445
  { width: 768, height: "auto", icon: "Tablet", label: "Medium" },
1411
- { width: 1280, height: "auto", icon: "Monitor", label: "Large" }
1446
+ { width: 1280, height: "auto", icon: "Monitor", label: "Large" },
1447
+ { width: "100%", height: "auto", icon: "FullWidth", label: "Full-width" }
1412
1448
  ];
1413
1449
 
1414
1450
  // ../../node_modules/zustand/esm/vanilla.mjs
@@ -2313,7 +2349,8 @@ var defaultAppState = {
2313
2349
  options: [],
2314
2350
  controlsVisible: true
2315
2351
  },
2316
- field: { focus: null }
2352
+ field: { focus: null },
2353
+ plugin: { current: null }
2317
2354
  },
2318
2355
  indexes: {
2319
2356
  nodes: {},
@@ -2329,6 +2366,7 @@ var createAppStore = (initialAppStore) => create()(
2329
2366
  subscribeWithSelector((set, get) => {
2330
2367
  var _a, _b;
2331
2368
  return __spreadProps(__spreadValues({
2369
+ instanceId: generateId(),
2332
2370
  state: defaultAppState,
2333
2371
  config: { components: {} },
2334
2372
  componentState: {},
@@ -2499,203 +2537,14 @@ var createAppStore = (initialAppStore) => create()(
2499
2537
  })
2500
2538
  );
2501
2539
  var appStoreContext = (0, import_react9.createContext)(createAppStore());
2502
- function useAppStore(selector) {
2503
- const context = (0, import_react9.useContext)(appStoreContext);
2504
- return useStore(context, selector);
2505
- }
2506
- function useAppStoreApi() {
2507
- return (0, import_react9.useContext)(appStoreContext);
2508
- }
2509
-
2510
- // ../core/lib/use-breadcrumbs.ts
2511
- var useBreadcrumbs = (renderCount) => {
2512
- const selectedId = useAppStore((s) => {
2513
- var _a;
2514
- return (_a = s.selectedItem) == null ? void 0 : _a.props.id;
2515
- });
2516
- const config = useAppStore((s) => s.config);
2517
- const path = useAppStore((s) => {
2518
- var _a;
2519
- return (_a = s.state.indexes.nodes[selectedId]) == null ? void 0 : _a.path;
2520
- });
2521
- const appStore = useAppStoreApi();
2522
- return (0, import_react10.useMemo)(() => {
2523
- const breadcrumbs = (path == null ? void 0 : path.map((zoneCompound) => {
2524
- var _a, _b, _c;
2525
- const [componentId] = zoneCompound.split(":");
2526
- if (componentId === "root") {
2527
- return {
2528
- label: "Page",
2529
- selector: null
2530
- };
2531
- }
2532
- const node = appStore.getState().state.indexes.nodes[componentId];
2533
- const parentId = node.path[node.path.length - 1];
2534
- const contentIds = ((_a = appStore.getState().state.indexes.zones[parentId]) == null ? void 0 : _a.contentIds) || [];
2535
- const index = contentIds.indexOf(componentId);
2536
- const label = node ? (_c = (_b = config.components[node.data.type]) == null ? void 0 : _b.label) != null ? _c : node.data.type : "Component";
2537
- return {
2538
- label,
2539
- selector: node ? {
2540
- index,
2541
- zone: node.path[node.path.length - 1]
2542
- } : null
2543
- };
2544
- })) || [];
2545
- if (renderCount) {
2546
- return breadcrumbs.slice(breadcrumbs.length - renderCount);
2547
- }
2548
- return breadcrumbs;
2549
- }, [path, renderCount]);
2550
- };
2551
-
2552
- // ../core/components/Loader/index.tsx
2553
- init_react_import();
2554
-
2555
- // ../core/lib/index.ts
2556
- init_react_import();
2557
-
2558
- // ../core/lib/filter.ts
2559
- init_react_import();
2560
-
2561
- // ../core/lib/data/reorder.ts
2562
- init_react_import();
2563
-
2564
- // ../core/lib/data/replace.ts
2565
- init_react_import();
2566
-
2567
- // ../core/lib/use-reset-auto-zoom.ts
2568
- init_react_import();
2569
2540
 
2570
2541
  // ../core/lib/get-zoom-config.ts
2571
2542
  init_react_import();
2572
2543
 
2573
- // css-module:/home/runner/work/puck/puck/packages/core/components/Loader/styles.module.css#css-module
2574
- init_react_import();
2575
- var styles_module_default3 = { "Loader": "_Loader_nacdm_13", "loader-animation": "_loader-animation_nacdm_1" };
2576
-
2577
- // ../core/components/Loader/index.tsx
2578
- var import_jsx_runtime2 = require("react/jsx-runtime");
2579
- var getClassName2 = get_class_name_factory_default("Loader", styles_module_default3);
2580
- var Loader = (_a) => {
2581
- var _b = _a, {
2582
- color,
2583
- size = 16
2584
- } = _b, props = __objRest(_b, [
2585
- "color",
2586
- "size"
2587
- ]);
2588
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
2589
- "span",
2590
- __spreadValues({
2591
- className: getClassName2(),
2592
- style: {
2593
- width: size,
2594
- height: size,
2595
- color
2596
- },
2597
- "aria-label": "loading"
2598
- }, props)
2599
- );
2600
- };
2601
-
2602
- // ../core/components/SidebarSection/index.tsx
2603
- var import_jsx_runtime3 = require("react/jsx-runtime");
2604
- var getClassName3 = get_class_name_factory_default("SidebarSection", styles_module_default);
2605
- var SidebarSection = ({
2606
- children,
2607
- title,
2608
- background,
2609
- showBreadcrumbs,
2610
- noBorderTop,
2611
- noPadding,
2612
- isLoading
2613
- }) => {
2614
- const setUi = useAppStore((s) => s.setUi);
2615
- const breadcrumbs = useBreadcrumbs(1);
2616
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
2617
- "div",
2618
- {
2619
- className: getClassName3({ noBorderTop, noPadding }),
2620
- style: { background },
2621
- children: [
2622
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: getClassName3("title"), children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: getClassName3("breadcrumbs"), children: [
2623
- showBreadcrumbs ? breadcrumbs.map((breadcrumb, i) => /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: getClassName3("breadcrumb"), children: [
2624
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
2625
- "button",
2626
- {
2627
- type: "button",
2628
- className: getClassName3("breadcrumbLabel"),
2629
- onClick: () => setUi({ itemSelector: breadcrumb.selector }),
2630
- children: breadcrumb.label
2631
- }
2632
- ),
2633
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ChevronRight, { size: 16 })
2634
- ] }, i)) : null,
2635
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: getClassName3("heading"), children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Heading, { rank: "2", size: "xs", children: title }) })
2636
- ] }) }),
2637
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: getClassName3("content"), children }),
2638
- isLoading && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: getClassName3("loadingOverlay"), children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Loader, { size: 32 }) })
2639
- ]
2640
- }
2641
- );
2642
- };
2643
-
2644
- // ../core/components/OutlineList/index.tsx
2645
- init_react_import();
2646
-
2647
- // css-module:/home/runner/work/puck/puck/packages/core/components/OutlineList/styles.module.css#css-module
2648
- init_react_import();
2649
- var styles_module_default4 = { "OutlineList": "_OutlineList_w4lzv_1", "OutlineListItem": "_OutlineListItem_w4lzv_25", "OutlineListItem--clickable": "_OutlineListItem--clickable_w4lzv_45" };
2650
-
2651
- // ../core/components/OutlineList/index.tsx
2652
- var import_jsx_runtime4 = require("react/jsx-runtime");
2653
- var getClassName4 = get_class_name_factory_default("OutlineList", styles_module_default4);
2654
- var getClassNameItem = get_class_name_factory_default("OutlineListItem", styles_module_default4);
2655
- var OutlineList = ({ children }) => {
2656
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("ul", { className: getClassName4(), children });
2657
- };
2658
- OutlineList.Clickable = ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: getClassNameItem({ clickable: true }), children });
2659
- OutlineList.Item = ({
2660
- children,
2661
- onClick
2662
- }) => {
2663
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
2664
- "li",
2665
- {
2666
- className: getClassNameItem({ clickable: !!onClick }),
2667
- onClick,
2668
- children
2669
- }
2670
- );
2671
- };
2672
-
2673
- // ../core/lib/scroll-into-view.ts
2674
- init_react_import();
2675
- var scrollIntoView = (el) => {
2676
- const oldStyle = __spreadValues({}, el.style);
2677
- el.style.scrollMargin = "256px";
2678
- if (el) {
2679
- el == null ? void 0 : el.scrollIntoView({ behavior: "smooth" });
2680
- el.style.scrollMargin = oldStyle.scrollMargin || "";
2681
- }
2682
- };
2683
-
2684
- // ../core/lib/get-frame.ts
2685
- init_react_import();
2686
- var getFrame = () => {
2687
- if (typeof window === "undefined") return;
2688
- let frameEl = document.querySelector("#preview-frame");
2689
- if ((frameEl == null ? void 0 : frameEl.tagName) === "IFRAME") {
2690
- return frameEl.contentDocument || document;
2691
- }
2692
- return (frameEl == null ? void 0 : frameEl.ownerDocument) || document;
2693
- };
2694
-
2695
2544
  // src/HeadingAnalyzer.tsx
2696
2545
  var import_react_from_json = __toESM(require("react-from-json"));
2697
- var import_jsx_runtime5 = require("react/jsx-runtime");
2698
- var getClassName5 = get_class_name_factory_default("HeadingAnalyzer", HeadingAnalyzer_module_default);
2546
+ var import_jsx_runtime2 = require("react/jsx-runtime");
2547
+ var getClassName2 = get_class_name_factory_default("HeadingAnalyzer", HeadingAnalyzer_module_default);
2699
2548
  var getClassNameItem2 = get_class_name_factory_default("HeadingAnalyzerItem", HeadingAnalyzer_module_default);
2700
2549
  var ReactFromJSON = import_react_from_json.default.default || import_react_from_json.default;
2701
2550
  var getOutline = ({ frame } = {}) => {
@@ -2750,8 +2599,8 @@ function buildHierarchy(frame) {
2750
2599
  var usePuck = (0, import_puck.createUsePuck)();
2751
2600
  var HeadingAnalyzer = () => {
2752
2601
  const data = usePuck((s) => s.appState.data);
2753
- const [hierarchy, setHierarchy] = (0, import_react11.useState)([]);
2754
- (0, import_react11.useEffect)(() => {
2602
+ const [hierarchy, setHierarchy] = (0, import_react10.useState)([]);
2603
+ (0, import_react10.useEffect)(() => {
2755
2604
  const frame = getFrame();
2756
2605
  let entry = frame == null ? void 0 : frame.querySelector(`[data-puck-entry]`);
2757
2606
  const createHierarchy = () => {
@@ -2786,11 +2635,11 @@ var HeadingAnalyzer = () => {
2786
2635
  frameObserver.disconnect();
2787
2636
  };
2788
2637
  }, [data]);
2789
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: getClassName5(), children: [
2790
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
2638
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: getClassName2(), children: [
2639
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
2791
2640
  "small",
2792
2641
  {
2793
- className: getClassName5("cssWarning"),
2642
+ className: getClassName2("cssWarning"),
2794
2643
  style: {
2795
2644
  color: "var(--puck-color-red-04)",
2796
2645
  display: "block",
@@ -2799,19 +2648,19 @@ var HeadingAnalyzer = () => {
2799
2648
  children: [
2800
2649
  "Heading analyzer styles not loaded. Please review the",
2801
2650
  " ",
2802
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("a", { href: "https://github.com/measuredco/puck/blob/main/packages/plugin-heading-analyzer/README.md", children: "README" }),
2651
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("a", { href: "https://github.com/measuredco/puck/blob/main/packages/plugin-heading-analyzer/README.md", children: "README" }),
2803
2652
  "."
2804
2653
  ]
2805
2654
  }
2806
2655
  ),
2807
- hierarchy.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { children: "No headings." }),
2808
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(OutlineList, { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
2656
+ hierarchy.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { children: "No headings." }),
2657
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(OutlineList, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
2809
2658
  ReactFromJSON,
2810
2659
  {
2811
2660
  mapping: {
2812
- Root: (props) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_jsx_runtime5.Fragment, { children: props.children }),
2813
- OutlineListItem: (props) => /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(OutlineList.Item, { children: [
2814
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(OutlineList.Clickable, { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
2661
+ Root: (props) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_jsx_runtime2.Fragment, { children: props.children }),
2662
+ OutlineListItem: (props) => /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(OutlineList.Item, { children: [
2663
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(OutlineList.Clickable, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
2815
2664
  "small",
2816
2665
  {
2817
2666
  className: getClassNameItem2({ missing: props.missing }),
@@ -2829,14 +2678,14 @@ var HeadingAnalyzer = () => {
2829
2678
  }, 2e3);
2830
2679
  }
2831
2680
  },
2832
- children: props.missing ? /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
2833
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("b", { children: [
2681
+ children: props.missing ? /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [
2682
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("b", { children: [
2834
2683
  "H",
2835
2684
  props.rank
2836
2685
  ] }),
2837
2686
  ": Missing"
2838
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
2839
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("b", { children: [
2687
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [
2688
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("b", { children: [
2840
2689
  "H",
2841
2690
  props.rank
2842
2691
  ] }),
@@ -2845,7 +2694,7 @@ var HeadingAnalyzer = () => {
2845
2694
  ] })
2846
2695
  }
2847
2696
  ) }),
2848
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(OutlineList, { children: props.children })
2697
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(OutlineList, { children: props.children })
2849
2698
  ] })
2850
2699
  },
2851
2700
  entry: {
@@ -2866,12 +2715,10 @@ var HeadingAnalyzer = () => {
2866
2715
  ] });
2867
2716
  };
2868
2717
  var headingAnalyzer = {
2869
- overrides: {
2870
- fields: ({ children, itemSelector }) => /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
2871
- children,
2872
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { style: { display: itemSelector ? "none" : "block" }, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SidebarSection, { title: "Heading Outline", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(HeadingAnalyzer, {}) }) })
2873
- ] })
2874
- }
2718
+ name: "heading-analyzer",
2719
+ label: "Audit",
2720
+ render: HeadingAnalyzer,
2721
+ icon: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Heading1, {})
2875
2722
  };
2876
2723
  var HeadingAnalyzer_default = headingAnalyzer;
2877
2724
  /*! Bundled license information:
@@ -2887,7 +2734,7 @@ lucide-react/dist/esm/shared/src/utils.js:
2887
2734
  lucide-react/dist/esm/defaultAttributes.js:
2888
2735
  lucide-react/dist/esm/Icon.js:
2889
2736
  lucide-react/dist/esm/createLucideIcon.js:
2890
- lucide-react/dist/esm/icons/chevron-right.js:
2737
+ lucide-react/dist/esm/icons/heading-1.js:
2891
2738
  lucide-react/dist/esm/lucide-react.js:
2892
2739
  (**
2893
2740
  * @license lucide-react v0.468.0 - ISC
package/dist/index.mjs CHANGED
@@ -269,17 +269,17 @@ import { useEffect as useEffect5, useState } from "react";
269
269
 
270
270
  // css-module:/home/runner/work/puck/puck/packages/plugin-heading-analyzer/src/HeadingAnalyzer.module.css#css-module
271
271
  init_react_import();
272
- var HeadingAnalyzer_module_default = { "HeadingAnalyzer": "_HeadingAnalyzer_116v6_1", "HeadingAnalyzer-cssWarning": "_HeadingAnalyzer-cssWarning_116v6_5", "HeadingAnalyzerItem": "_HeadingAnalyzerItem_116v6_9", "HeadingAnalyzerItem--missing": "_HeadingAnalyzerItem--missing_116v6_13" };
272
+ var HeadingAnalyzer_module_default = { "HeadingAnalyzer": "_HeadingAnalyzer_yg0s7_1", "HeadingAnalyzer-cssWarning": "_HeadingAnalyzer-cssWarning_yg0s7_6", "HeadingAnalyzerItem": "_HeadingAnalyzerItem_yg0s7_10", "HeadingAnalyzerItem--missing": "_HeadingAnalyzerItem--missing_yg0s7_14" };
273
273
 
274
274
  // src/HeadingAnalyzer.tsx
275
275
  import { createUsePuck } from "@measured/puck";
276
276
 
277
- // ../core/components/SidebarSection/index.tsx
277
+ // ../core/components/OutlineList/index.tsx
278
278
  init_react_import();
279
279
 
280
- // css-module:/home/runner/work/puck/puck/packages/core/components/SidebarSection/styles.module.css#css-module
280
+ // css-module:/home/runner/work/puck/puck/packages/core/components/OutlineList/styles.module.css#css-module
281
281
  init_react_import();
282
- var styles_module_default = { "SidebarSection": "_SidebarSection_8boj8_1", "SidebarSection-title": "_SidebarSection-title_8boj8_12", "SidebarSection--noBorderTop": "_SidebarSection--noBorderTop_8boj8_20", "SidebarSection-content": "_SidebarSection-content_8boj8_24", "SidebarSection--noPadding": "_SidebarSection--noPadding_8boj8_28", "SidebarSection-breadcrumbLabel": "_SidebarSection-breadcrumbLabel_8boj8_41", "SidebarSection-breadcrumbs": "_SidebarSection-breadcrumbs_8boj8_70", "SidebarSection-breadcrumb": "_SidebarSection-breadcrumb_8boj8_41", "SidebarSection-heading": "_SidebarSection-heading_8boj8_82", "SidebarSection-loadingOverlay": "_SidebarSection-loadingOverlay_8boj8_86" };
282
+ var styles_module_default = { "OutlineList": "_OutlineList_w4lzv_1", "OutlineListItem": "_OutlineListItem_w4lzv_25", "OutlineListItem--clickable": "_OutlineListItem--clickable_w4lzv_45" };
283
283
 
284
284
  // ../core/lib/get-class-name-factory.ts
285
285
  init_react_import();
@@ -308,29 +308,50 @@ var getClassNameFactory = (rootClass, styles, config = { baseClass: "" }) => (op
308
308
  };
309
309
  var get_class_name_factory_default = getClassNameFactory;
310
310
 
311
- // ../core/components/Heading/index.tsx
312
- init_react_import();
313
-
314
- // css-module:/home/runner/work/puck/puck/packages/core/components/Heading/styles.module.css#css-module
315
- init_react_import();
316
- 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" };
317
-
318
- // ../core/components/Heading/index.tsx
311
+ // ../core/components/OutlineList/index.tsx
319
312
  import { jsx } from "react/jsx-runtime";
320
- var getClassName = get_class_name_factory_default("Heading", styles_module_default2);
321
- var Heading = ({ children, rank, size = "m" }) => {
322
- const Tag = rank ? `h${rank}` : "span";
313
+ var getClassName = get_class_name_factory_default("OutlineList", styles_module_default);
314
+ var getClassNameItem = get_class_name_factory_default("OutlineListItem", styles_module_default);
315
+ var OutlineList = ({ children }) => {
316
+ return /* @__PURE__ */ jsx("ul", { className: getClassName(), children });
317
+ };
318
+ OutlineList.Clickable = ({ children }) => /* @__PURE__ */ jsx("div", { className: getClassNameItem({ clickable: true }), children });
319
+ OutlineList.Item = ({
320
+ children,
321
+ onClick
322
+ }) => {
323
323
  return /* @__PURE__ */ jsx(
324
- Tag,
324
+ "li",
325
325
  {
326
- className: getClassName({
327
- [size]: true
328
- }),
326
+ className: getClassNameItem({ clickable: !!onClick }),
327
+ onClick,
329
328
  children
330
329
  }
331
330
  );
332
331
  };
333
332
 
333
+ // ../core/lib/scroll-into-view.ts
334
+ init_react_import();
335
+ var scrollIntoView = (el) => {
336
+ const oldStyle = __spreadValues({}, el.style);
337
+ el.style.scrollMargin = "256px";
338
+ if (el) {
339
+ el == null ? void 0 : el.scrollIntoView({ behavior: "smooth" });
340
+ el.style.scrollMargin = oldStyle.scrollMargin || "";
341
+ }
342
+ };
343
+
344
+ // ../core/lib/get-frame.ts
345
+ init_react_import();
346
+ var getFrame = () => {
347
+ if (typeof window === "undefined") return;
348
+ let frameEl = document.querySelector("#preview-frame");
349
+ if ((frameEl == null ? void 0 : frameEl.tagName) === "IFRAME") {
350
+ return frameEl.contentDocument || document;
351
+ }
352
+ return (frameEl == null ? void 0 : frameEl.ownerDocument) || document;
353
+ };
354
+
334
355
  // ../../node_modules/lucide-react/dist/esm/lucide-react.js
335
356
  init_react_import();
336
357
 
@@ -418,15 +439,29 @@ var createLucideIcon = (iconName, iconNode) => {
418
439
  return Component;
419
440
  };
420
441
 
421
- // ../../node_modules/lucide-react/dist/esm/icons/chevron-right.js
442
+ // ../../node_modules/lucide-react/dist/esm/icons/heading-1.js
422
443
  init_react_import();
423
- var ChevronRight = createLucideIcon("ChevronRight", [
424
- ["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]
444
+ var Heading1 = createLucideIcon("Heading1", [
445
+ ["path", { d: "M4 12h8", key: "17cfdx" }],
446
+ ["path", { d: "M4 18V6", key: "1rz3zl" }],
447
+ ["path", { d: "M12 18V6", key: "zqpxq5" }],
448
+ ["path", { d: "m17 12 3-2v8", key: "1hhhft" }]
425
449
  ]);
426
450
 
427
- // ../core/lib/use-breadcrumbs.ts
451
+ // ../core/lib/index.ts
452
+ init_react_import();
453
+
454
+ // ../core/lib/filter.ts
455
+ init_react_import();
456
+
457
+ // ../core/lib/data/reorder.ts
458
+ init_react_import();
459
+
460
+ // ../core/lib/data/replace.ts
461
+ init_react_import();
462
+
463
+ // ../core/lib/use-reset-auto-zoom.ts
428
464
  init_react_import();
429
- import { useMemo } from "react";
430
465
 
431
466
  // ../core/store/index.ts
432
467
  init_react_import();
@@ -1396,7 +1431,8 @@ init_react_import();
1396
1431
  var defaultViewports = [
1397
1432
  { width: 360, height: "auto", icon: "Smartphone", label: "Small" },
1398
1433
  { width: 768, height: "auto", icon: "Tablet", label: "Medium" },
1399
- { width: 1280, height: "auto", icon: "Monitor", label: "Large" }
1434
+ { width: 1280, height: "auto", icon: "Monitor", label: "Large" },
1435
+ { width: "100%", height: "auto", icon: "FullWidth", label: "Full-width" }
1400
1436
  ];
1401
1437
 
1402
1438
  // ../../node_modules/zustand/esm/vanilla.mjs
@@ -2301,7 +2337,8 @@ var defaultAppState = {
2301
2337
  options: [],
2302
2338
  controlsVisible: true
2303
2339
  },
2304
- field: { focus: null }
2340
+ field: { focus: null },
2341
+ plugin: { current: null }
2305
2342
  },
2306
2343
  indexes: {
2307
2344
  nodes: {},
@@ -2317,6 +2354,7 @@ var createAppStore = (initialAppStore) => create()(
2317
2354
  subscribeWithSelector((set, get) => {
2318
2355
  var _a, _b;
2319
2356
  return __spreadProps(__spreadValues({
2357
+ instanceId: generateId(),
2320
2358
  state: defaultAppState,
2321
2359
  config: { components: {} },
2322
2360
  componentState: {},
@@ -2487,203 +2525,14 @@ var createAppStore = (initialAppStore) => create()(
2487
2525
  })
2488
2526
  );
2489
2527
  var appStoreContext = createContext(createAppStore());
2490
- function useAppStore(selector) {
2491
- const context = useContext(appStoreContext);
2492
- return useStore(context, selector);
2493
- }
2494
- function useAppStoreApi() {
2495
- return useContext(appStoreContext);
2496
- }
2497
-
2498
- // ../core/lib/use-breadcrumbs.ts
2499
- var useBreadcrumbs = (renderCount) => {
2500
- const selectedId = useAppStore((s) => {
2501
- var _a;
2502
- return (_a = s.selectedItem) == null ? void 0 : _a.props.id;
2503
- });
2504
- const config = useAppStore((s) => s.config);
2505
- const path = useAppStore((s) => {
2506
- var _a;
2507
- return (_a = s.state.indexes.nodes[selectedId]) == null ? void 0 : _a.path;
2508
- });
2509
- const appStore = useAppStoreApi();
2510
- return useMemo(() => {
2511
- const breadcrumbs = (path == null ? void 0 : path.map((zoneCompound) => {
2512
- var _a, _b, _c;
2513
- const [componentId] = zoneCompound.split(":");
2514
- if (componentId === "root") {
2515
- return {
2516
- label: "Page",
2517
- selector: null
2518
- };
2519
- }
2520
- const node = appStore.getState().state.indexes.nodes[componentId];
2521
- const parentId = node.path[node.path.length - 1];
2522
- const contentIds = ((_a = appStore.getState().state.indexes.zones[parentId]) == null ? void 0 : _a.contentIds) || [];
2523
- const index = contentIds.indexOf(componentId);
2524
- const label = node ? (_c = (_b = config.components[node.data.type]) == null ? void 0 : _b.label) != null ? _c : node.data.type : "Component";
2525
- return {
2526
- label,
2527
- selector: node ? {
2528
- index,
2529
- zone: node.path[node.path.length - 1]
2530
- } : null
2531
- };
2532
- })) || [];
2533
- if (renderCount) {
2534
- return breadcrumbs.slice(breadcrumbs.length - renderCount);
2535
- }
2536
- return breadcrumbs;
2537
- }, [path, renderCount]);
2538
- };
2539
-
2540
- // ../core/components/Loader/index.tsx
2541
- init_react_import();
2542
-
2543
- // ../core/lib/index.ts
2544
- init_react_import();
2545
-
2546
- // ../core/lib/filter.ts
2547
- init_react_import();
2548
-
2549
- // ../core/lib/data/reorder.ts
2550
- init_react_import();
2551
-
2552
- // ../core/lib/data/replace.ts
2553
- init_react_import();
2554
-
2555
- // ../core/lib/use-reset-auto-zoom.ts
2556
- init_react_import();
2557
2528
 
2558
2529
  // ../core/lib/get-zoom-config.ts
2559
2530
  init_react_import();
2560
2531
 
2561
- // css-module:/home/runner/work/puck/puck/packages/core/components/Loader/styles.module.css#css-module
2562
- init_react_import();
2563
- var styles_module_default3 = { "Loader": "_Loader_nacdm_13", "loader-animation": "_loader-animation_nacdm_1" };
2564
-
2565
- // ../core/components/Loader/index.tsx
2566
- import { jsx as jsx2 } from "react/jsx-runtime";
2567
- var getClassName2 = get_class_name_factory_default("Loader", styles_module_default3);
2568
- var Loader = (_a) => {
2569
- var _b = _a, {
2570
- color,
2571
- size = 16
2572
- } = _b, props = __objRest(_b, [
2573
- "color",
2574
- "size"
2575
- ]);
2576
- return /* @__PURE__ */ jsx2(
2577
- "span",
2578
- __spreadValues({
2579
- className: getClassName2(),
2580
- style: {
2581
- width: size,
2582
- height: size,
2583
- color
2584
- },
2585
- "aria-label": "loading"
2586
- }, props)
2587
- );
2588
- };
2589
-
2590
- // ../core/components/SidebarSection/index.tsx
2591
- import { jsx as jsx3, jsxs } from "react/jsx-runtime";
2592
- var getClassName3 = get_class_name_factory_default("SidebarSection", styles_module_default);
2593
- var SidebarSection = ({
2594
- children,
2595
- title,
2596
- background,
2597
- showBreadcrumbs,
2598
- noBorderTop,
2599
- noPadding,
2600
- isLoading
2601
- }) => {
2602
- const setUi = useAppStore((s) => s.setUi);
2603
- const breadcrumbs = useBreadcrumbs(1);
2604
- return /* @__PURE__ */ jsxs(
2605
- "div",
2606
- {
2607
- className: getClassName3({ noBorderTop, noPadding }),
2608
- style: { background },
2609
- children: [
2610
- /* @__PURE__ */ jsx3("div", { className: getClassName3("title"), children: /* @__PURE__ */ jsxs("div", { className: getClassName3("breadcrumbs"), children: [
2611
- showBreadcrumbs ? breadcrumbs.map((breadcrumb, i) => /* @__PURE__ */ jsxs("div", { className: getClassName3("breadcrumb"), children: [
2612
- /* @__PURE__ */ jsx3(
2613
- "button",
2614
- {
2615
- type: "button",
2616
- className: getClassName3("breadcrumbLabel"),
2617
- onClick: () => setUi({ itemSelector: breadcrumb.selector }),
2618
- children: breadcrumb.label
2619
- }
2620
- ),
2621
- /* @__PURE__ */ jsx3(ChevronRight, { size: 16 })
2622
- ] }, i)) : null,
2623
- /* @__PURE__ */ jsx3("div", { className: getClassName3("heading"), children: /* @__PURE__ */ jsx3(Heading, { rank: "2", size: "xs", children: title }) })
2624
- ] }) }),
2625
- /* @__PURE__ */ jsx3("div", { className: getClassName3("content"), children }),
2626
- isLoading && /* @__PURE__ */ jsx3("div", { className: getClassName3("loadingOverlay"), children: /* @__PURE__ */ jsx3(Loader, { size: 32 }) })
2627
- ]
2628
- }
2629
- );
2630
- };
2631
-
2632
- // ../core/components/OutlineList/index.tsx
2633
- init_react_import();
2634
-
2635
- // css-module:/home/runner/work/puck/puck/packages/core/components/OutlineList/styles.module.css#css-module
2636
- init_react_import();
2637
- var styles_module_default4 = { "OutlineList": "_OutlineList_w4lzv_1", "OutlineListItem": "_OutlineListItem_w4lzv_25", "OutlineListItem--clickable": "_OutlineListItem--clickable_w4lzv_45" };
2638
-
2639
- // ../core/components/OutlineList/index.tsx
2640
- import { jsx as jsx4 } from "react/jsx-runtime";
2641
- var getClassName4 = get_class_name_factory_default("OutlineList", styles_module_default4);
2642
- var getClassNameItem = get_class_name_factory_default("OutlineListItem", styles_module_default4);
2643
- var OutlineList = ({ children }) => {
2644
- return /* @__PURE__ */ jsx4("ul", { className: getClassName4(), children });
2645
- };
2646
- OutlineList.Clickable = ({ children }) => /* @__PURE__ */ jsx4("div", { className: getClassNameItem({ clickable: true }), children });
2647
- OutlineList.Item = ({
2648
- children,
2649
- onClick
2650
- }) => {
2651
- return /* @__PURE__ */ jsx4(
2652
- "li",
2653
- {
2654
- className: getClassNameItem({ clickable: !!onClick }),
2655
- onClick,
2656
- children
2657
- }
2658
- );
2659
- };
2660
-
2661
- // ../core/lib/scroll-into-view.ts
2662
- init_react_import();
2663
- var scrollIntoView = (el) => {
2664
- const oldStyle = __spreadValues({}, el.style);
2665
- el.style.scrollMargin = "256px";
2666
- if (el) {
2667
- el == null ? void 0 : el.scrollIntoView({ behavior: "smooth" });
2668
- el.style.scrollMargin = oldStyle.scrollMargin || "";
2669
- }
2670
- };
2671
-
2672
- // ../core/lib/get-frame.ts
2673
- init_react_import();
2674
- var getFrame = () => {
2675
- if (typeof window === "undefined") return;
2676
- let frameEl = document.querySelector("#preview-frame");
2677
- if ((frameEl == null ? void 0 : frameEl.tagName) === "IFRAME") {
2678
- return frameEl.contentDocument || document;
2679
- }
2680
- return (frameEl == null ? void 0 : frameEl.ownerDocument) || document;
2681
- };
2682
-
2683
2532
  // src/HeadingAnalyzer.tsx
2684
2533
  import ReactFromJSONModule from "react-from-json";
2685
- import { Fragment, jsx as jsx5, jsxs as jsxs2 } from "react/jsx-runtime";
2686
- var getClassName5 = get_class_name_factory_default("HeadingAnalyzer", HeadingAnalyzer_module_default);
2534
+ import { Fragment, jsx as jsx2, jsxs } from "react/jsx-runtime";
2535
+ var getClassName2 = get_class_name_factory_default("HeadingAnalyzer", HeadingAnalyzer_module_default);
2687
2536
  var getClassNameItem2 = get_class_name_factory_default("HeadingAnalyzerItem", HeadingAnalyzer_module_default);
2688
2537
  var ReactFromJSON = ReactFromJSONModule.default || ReactFromJSONModule;
2689
2538
  var getOutline = ({ frame } = {}) => {
@@ -2774,11 +2623,11 @@ var HeadingAnalyzer = () => {
2774
2623
  frameObserver.disconnect();
2775
2624
  };
2776
2625
  }, [data]);
2777
- return /* @__PURE__ */ jsxs2("div", { className: getClassName5(), children: [
2778
- /* @__PURE__ */ jsxs2(
2626
+ return /* @__PURE__ */ jsxs("div", { className: getClassName2(), children: [
2627
+ /* @__PURE__ */ jsxs(
2779
2628
  "small",
2780
2629
  {
2781
- className: getClassName5("cssWarning"),
2630
+ className: getClassName2("cssWarning"),
2782
2631
  style: {
2783
2632
  color: "var(--puck-color-red-04)",
2784
2633
  display: "block",
@@ -2787,19 +2636,19 @@ var HeadingAnalyzer = () => {
2787
2636
  children: [
2788
2637
  "Heading analyzer styles not loaded. Please review the",
2789
2638
  " ",
2790
- /* @__PURE__ */ jsx5("a", { href: "https://github.com/measuredco/puck/blob/main/packages/plugin-heading-analyzer/README.md", children: "README" }),
2639
+ /* @__PURE__ */ jsx2("a", { href: "https://github.com/measuredco/puck/blob/main/packages/plugin-heading-analyzer/README.md", children: "README" }),
2791
2640
  "."
2792
2641
  ]
2793
2642
  }
2794
2643
  ),
2795
- hierarchy.length === 0 && /* @__PURE__ */ jsx5("div", { children: "No headings." }),
2796
- /* @__PURE__ */ jsx5(OutlineList, { children: /* @__PURE__ */ jsx5(
2644
+ hierarchy.length === 0 && /* @__PURE__ */ jsx2("div", { children: "No headings." }),
2645
+ /* @__PURE__ */ jsx2(OutlineList, { children: /* @__PURE__ */ jsx2(
2797
2646
  ReactFromJSON,
2798
2647
  {
2799
2648
  mapping: {
2800
- Root: (props) => /* @__PURE__ */ jsx5(Fragment, { children: props.children }),
2801
- OutlineListItem: (props) => /* @__PURE__ */ jsxs2(OutlineList.Item, { children: [
2802
- /* @__PURE__ */ jsx5(OutlineList.Clickable, { children: /* @__PURE__ */ jsx5(
2649
+ Root: (props) => /* @__PURE__ */ jsx2(Fragment, { children: props.children }),
2650
+ OutlineListItem: (props) => /* @__PURE__ */ jsxs(OutlineList.Item, { children: [
2651
+ /* @__PURE__ */ jsx2(OutlineList.Clickable, { children: /* @__PURE__ */ jsx2(
2803
2652
  "small",
2804
2653
  {
2805
2654
  className: getClassNameItem2({ missing: props.missing }),
@@ -2817,14 +2666,14 @@ var HeadingAnalyzer = () => {
2817
2666
  }, 2e3);
2818
2667
  }
2819
2668
  },
2820
- children: props.missing ? /* @__PURE__ */ jsxs2(Fragment, { children: [
2821
- /* @__PURE__ */ jsxs2("b", { children: [
2669
+ children: props.missing ? /* @__PURE__ */ jsxs(Fragment, { children: [
2670
+ /* @__PURE__ */ jsxs("b", { children: [
2822
2671
  "H",
2823
2672
  props.rank
2824
2673
  ] }),
2825
2674
  ": Missing"
2826
- ] }) : /* @__PURE__ */ jsxs2(Fragment, { children: [
2827
- /* @__PURE__ */ jsxs2("b", { children: [
2675
+ ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
2676
+ /* @__PURE__ */ jsxs("b", { children: [
2828
2677
  "H",
2829
2678
  props.rank
2830
2679
  ] }),
@@ -2833,7 +2682,7 @@ var HeadingAnalyzer = () => {
2833
2682
  ] })
2834
2683
  }
2835
2684
  ) }),
2836
- /* @__PURE__ */ jsx5(OutlineList, { children: props.children })
2685
+ /* @__PURE__ */ jsx2(OutlineList, { children: props.children })
2837
2686
  ] })
2838
2687
  },
2839
2688
  entry: {
@@ -2854,12 +2703,10 @@ var HeadingAnalyzer = () => {
2854
2703
  ] });
2855
2704
  };
2856
2705
  var headingAnalyzer = {
2857
- overrides: {
2858
- fields: ({ children, itemSelector }) => /* @__PURE__ */ jsxs2(Fragment, { children: [
2859
- children,
2860
- /* @__PURE__ */ jsx5("div", { style: { display: itemSelector ? "none" : "block" }, children: /* @__PURE__ */ jsx5(SidebarSection, { title: "Heading Outline", children: /* @__PURE__ */ jsx5(HeadingAnalyzer, {}) }) })
2861
- ] })
2862
- }
2706
+ name: "heading-analyzer",
2707
+ label: "Audit",
2708
+ render: HeadingAnalyzer,
2709
+ icon: /* @__PURE__ */ jsx2(Heading1, {})
2863
2710
  };
2864
2711
  var HeadingAnalyzer_default = headingAnalyzer;
2865
2712
  export {
@@ -2878,7 +2725,7 @@ lucide-react/dist/esm/shared/src/utils.js:
2878
2725
  lucide-react/dist/esm/defaultAttributes.js:
2879
2726
  lucide-react/dist/esm/Icon.js:
2880
2727
  lucide-react/dist/esm/createLucideIcon.js:
2881
- lucide-react/dist/esm/icons/chevron-right.js:
2728
+ lucide-react/dist/esm/icons/heading-1.js:
2882
2729
  lucide-react/dist/esm/lucide-react.js:
2883
2730
  (**
2884
2731
  * @license lucide-react v0.468.0 - ISC
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@measured/puck-plugin-heading-analyzer",
3
- "version": "0.21.0-canary.79a26849",
3
+ "version": "0.21.0-canary.7ed9655b",
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.79a26849",
28
+ "@measured/puck": "^0.21.0-canary.7ed9655b",
29
29
  "@types/minimatch": "3.0.5",
30
30
  "@types/react": "^19.0.1",
31
31
  "@types/react-dom": "^19.0.2",