@measured/puck-plugin-heading-analyzer 0.21.0-canary.ece26d91 → 0.21.0-canary.ed351ce5

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
@@ -1,4 +1,4 @@
1
- import { ReactElement, CSSProperties, ReactNode, ElementType, JSX } from 'react';
1
+ import { ReactElement, CSSProperties, ReactNode, ElementType, Ref, JSX } from 'react';
2
2
  import { EditorStateSnapshot, Editor, Extensions } from '@tiptap/react';
3
3
  import { BlockquoteOptions } from '@tiptap/extension-blockquote';
4
4
  import { BoldOptions } from '@tiptap/extension-bold';
@@ -347,6 +347,7 @@ type DropZoneProps = {
347
347
  className?: string;
348
348
  collisionAxis?: DragAxis;
349
349
  as?: ElementType;
350
+ ref?: Ref<any>;
350
351
  };
351
352
 
352
353
  type PuckContext = {
@@ -520,6 +521,7 @@ interface FieldMetadata extends Metadata {
520
521
  type ItemWithId = {
521
522
  _arrayId: string;
522
523
  _originalIndex: number;
524
+ _currentIndex: number;
523
525
  };
524
526
  type ArrayState = {
525
527
  items: ItemWithId[];
@@ -530,6 +532,7 @@ type UiState = {
530
532
  rightSideBarVisible: boolean;
531
533
  leftSideBarWidth?: number | null;
532
534
  rightSideBarWidth?: number | null;
535
+ mobilePanelExpanded?: boolean;
533
536
  itemSelector: ItemSelector | null;
534
537
  arrayState: Record<string, ArrayState | undefined>;
535
538
  previewMode: "interactive" | "edit";
@@ -542,7 +545,7 @@ type UiState = {
542
545
  isDragging: boolean;
543
546
  viewports: {
544
547
  current: {
545
- width: number;
548
+ width: number | "100%";
546
549
  height: number | "auto";
547
550
  };
548
551
  controlsVisible: boolean;
@@ -552,6 +555,9 @@ type UiState = {
552
555
  focus?: string | null;
553
556
  metadata?: Record<string, any>;
554
557
  };
558
+ plugin: {
559
+ current: string | null;
560
+ };
555
561
  };
556
562
  type AppState<UserData extends Data = Data> = {
557
563
  data: UserData;
@@ -595,6 +601,11 @@ type LeftOrExactRight<Union, Left, Right> = (Left & Union extends Right ? Exact<
595
601
  type AssertHasValue<T, True = T, False = never> = [keyof T] extends [
596
602
  never
597
603
  ] ? False : True;
604
+ type RenderFunc<Props extends {
605
+ [key: string]: any;
606
+ } = {
607
+ children: ReactNode;
608
+ }> = (props: Props) => ReactElement;
598
609
 
599
610
  type MapFnParams<ThisField = Field> = {
600
611
  value: any;
@@ -618,11 +629,6 @@ G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>, UserField extends
618
629
  [Type in UserField["type"]]: FieldTransformFn<ExtractField<UserField, Type>>;
619
630
  }>;
620
631
 
621
- type RenderFunc<Props extends {
622
- [key: string]: any;
623
- } = {
624
- children: ReactNode;
625
- }> = (props: Props) => ReactElement;
626
632
  declare const overrideKeys: readonly ["header", "headerActions", "fields", "fieldLabel", "drawer", "drawerItem", "componentOverlay", "outline", "puck", "preview"];
627
633
  type OverrideKey = (typeof overrideKeys)[number];
628
634
  type OverridesGeneric<Shape extends {
@@ -693,7 +699,7 @@ type DragAxis = "dynamic" | "y" | "x";
693
699
 
694
700
  type iconTypes = "Smartphone" | "Monitor" | "Tablet";
695
701
  type Viewport = {
696
- width: number;
702
+ width: number | "100%";
697
703
  height?: number | "auto";
698
704
  label?: string;
699
705
  icon?: iconTypes | ReactNode;
@@ -707,8 +713,13 @@ type Permissions = {
707
713
  insert: boolean;
708
714
  } & Record<string, boolean>;
709
715
  type Plugin<UserConfig extends Config = Config> = {
716
+ name?: string;
717
+ label?: string;
718
+ icon?: ReactNode;
719
+ render?: () => ReactElement;
710
720
  overrides?: Partial<Overrides<UserConfig>>;
711
721
  fieldTransforms?: FieldTransforms<UserConfig>;
722
+ mobilePanelHeight?: "toggle" | "min-content";
712
723
  };
713
724
  type Slot<Props extends {
714
725
  [key: string]: DefaultComponentProps;
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { ReactElement, CSSProperties, ReactNode, ElementType, JSX } from 'react';
1
+ import { ReactElement, CSSProperties, ReactNode, ElementType, Ref, JSX } from 'react';
2
2
  import { EditorStateSnapshot, Editor, Extensions } from '@tiptap/react';
3
3
  import { BlockquoteOptions } from '@tiptap/extension-blockquote';
4
4
  import { BoldOptions } from '@tiptap/extension-bold';
@@ -347,6 +347,7 @@ type DropZoneProps = {
347
347
  className?: string;
348
348
  collisionAxis?: DragAxis;
349
349
  as?: ElementType;
350
+ ref?: Ref<any>;
350
351
  };
351
352
 
352
353
  type PuckContext = {
@@ -520,6 +521,7 @@ interface FieldMetadata extends Metadata {
520
521
  type ItemWithId = {
521
522
  _arrayId: string;
522
523
  _originalIndex: number;
524
+ _currentIndex: number;
523
525
  };
524
526
  type ArrayState = {
525
527
  items: ItemWithId[];
@@ -530,6 +532,7 @@ type UiState = {
530
532
  rightSideBarVisible: boolean;
531
533
  leftSideBarWidth?: number | null;
532
534
  rightSideBarWidth?: number | null;
535
+ mobilePanelExpanded?: boolean;
533
536
  itemSelector: ItemSelector | null;
534
537
  arrayState: Record<string, ArrayState | undefined>;
535
538
  previewMode: "interactive" | "edit";
@@ -542,7 +545,7 @@ type UiState = {
542
545
  isDragging: boolean;
543
546
  viewports: {
544
547
  current: {
545
- width: number;
548
+ width: number | "100%";
546
549
  height: number | "auto";
547
550
  };
548
551
  controlsVisible: boolean;
@@ -552,6 +555,9 @@ type UiState = {
552
555
  focus?: string | null;
553
556
  metadata?: Record<string, any>;
554
557
  };
558
+ plugin: {
559
+ current: string | null;
560
+ };
555
561
  };
556
562
  type AppState<UserData extends Data = Data> = {
557
563
  data: UserData;
@@ -595,6 +601,11 @@ type LeftOrExactRight<Union, Left, Right> = (Left & Union extends Right ? Exact<
595
601
  type AssertHasValue<T, True = T, False = never> = [keyof T] extends [
596
602
  never
597
603
  ] ? False : True;
604
+ type RenderFunc<Props extends {
605
+ [key: string]: any;
606
+ } = {
607
+ children: ReactNode;
608
+ }> = (props: Props) => ReactElement;
598
609
 
599
610
  type MapFnParams<ThisField = Field> = {
600
611
  value: any;
@@ -618,11 +629,6 @@ G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>, UserField extends
618
629
  [Type in UserField["type"]]: FieldTransformFn<ExtractField<UserField, Type>>;
619
630
  }>;
620
631
 
621
- type RenderFunc<Props extends {
622
- [key: string]: any;
623
- } = {
624
- children: ReactNode;
625
- }> = (props: Props) => ReactElement;
626
632
  declare const overrideKeys: readonly ["header", "headerActions", "fields", "fieldLabel", "drawer", "drawerItem", "componentOverlay", "outline", "puck", "preview"];
627
633
  type OverrideKey = (typeof overrideKeys)[number];
628
634
  type OverridesGeneric<Shape extends {
@@ -693,7 +699,7 @@ type DragAxis = "dynamic" | "y" | "x";
693
699
 
694
700
  type iconTypes = "Smartphone" | "Monitor" | "Tablet";
695
701
  type Viewport = {
696
- width: number;
702
+ width: number | "100%";
697
703
  height?: number | "auto";
698
704
  label?: string;
699
705
  icon?: iconTypes | ReactNode;
@@ -707,8 +713,13 @@ type Permissions = {
707
713
  insert: boolean;
708
714
  } & Record<string, boolean>;
709
715
  type Plugin<UserConfig extends Config = Config> = {
716
+ name?: string;
717
+ label?: string;
718
+ icon?: ReactNode;
719
+ render?: () => ReactElement;
710
720
  overrides?: Partial<Overrides<UserConfig>>;
711
721
  fieldTransforms?: FieldTransforms<UserConfig>;
722
+ mobilePanelHeight?: "toggle" | "min-content";
712
723
  };
713
724
  type Slot<Props extends {
714
725
  [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();
@@ -1410,7 +1445,8 @@ init_react_import();
1410
1445
  var defaultViewports = [
1411
1446
  { width: 360, height: "auto", icon: "Smartphone", label: "Small" },
1412
1447
  { width: 768, height: "auto", icon: "Tablet", label: "Medium" },
1413
- { width: 1280, height: "auto", icon: "Monitor", label: "Large" }
1448
+ { width: 1280, height: "auto", icon: "Monitor", label: "Large" },
1449
+ { width: "100%", height: "auto", icon: "FullWidth", label: "Full-width" }
1414
1450
  ];
1415
1451
 
1416
1452
  // ../../node_modules/zustand/esm/vanilla.mjs
@@ -2315,7 +2351,8 @@ var defaultAppState = {
2315
2351
  options: [],
2316
2352
  controlsVisible: true
2317
2353
  },
2318
- field: { focus: null }
2354
+ field: { focus: null },
2355
+ plugin: { current: null }
2319
2356
  },
2320
2357
  indexes: {
2321
2358
  nodes: {},
@@ -2331,6 +2368,7 @@ var createAppStore = (initialAppStore) => create()(
2331
2368
  subscribeWithSelector((set, get) => {
2332
2369
  var _a, _b;
2333
2370
  return __spreadProps(__spreadValues({
2371
+ instanceId: generateId(),
2334
2372
  state: defaultAppState,
2335
2373
  config: { components: {} },
2336
2374
  componentState: {},
@@ -2351,6 +2389,11 @@ var createAppStore = (initialAppStore) => create()(
2351
2389
  history: createHistorySlice(set, get),
2352
2390
  nodes: createNodesSlice(set, get),
2353
2391
  permissions: createPermissionsSlice(set, get),
2392
+ getCurrentData: () => {
2393
+ var _a2;
2394
+ const s = get();
2395
+ return (_a2 = s.selectedItem) != null ? _a2 : s.state.data.root;
2396
+ },
2354
2397
  getComponentConfig: (type) => {
2355
2398
  var _a2;
2356
2399
  const { config, selectedItem } = get();
@@ -2501,203 +2544,14 @@ var createAppStore = (initialAppStore) => create()(
2501
2544
  })
2502
2545
  );
2503
2546
  var appStoreContext = (0, import_react9.createContext)(createAppStore());
2504
- function useAppStore(selector) {
2505
- const context = (0, import_react9.useContext)(appStoreContext);
2506
- return useStore(context, selector);
2507
- }
2508
- function useAppStoreApi() {
2509
- return (0, import_react9.useContext)(appStoreContext);
2510
- }
2511
-
2512
- // ../core/lib/use-breadcrumbs.ts
2513
- var useBreadcrumbs = (renderCount) => {
2514
- const selectedId = useAppStore((s) => {
2515
- var _a;
2516
- return (_a = s.selectedItem) == null ? void 0 : _a.props.id;
2517
- });
2518
- const config = useAppStore((s) => s.config);
2519
- const path = useAppStore((s) => {
2520
- var _a;
2521
- return (_a = s.state.indexes.nodes[selectedId]) == null ? void 0 : _a.path;
2522
- });
2523
- const appStore = useAppStoreApi();
2524
- return (0, import_react10.useMemo)(() => {
2525
- const breadcrumbs = (path == null ? void 0 : path.map((zoneCompound) => {
2526
- var _a, _b, _c;
2527
- const [componentId] = zoneCompound.split(":");
2528
- if (componentId === "root") {
2529
- return {
2530
- label: "Page",
2531
- selector: null
2532
- };
2533
- }
2534
- const node = appStore.getState().state.indexes.nodes[componentId];
2535
- const parentId = node.path[node.path.length - 1];
2536
- const contentIds = ((_a = appStore.getState().state.indexes.zones[parentId]) == null ? void 0 : _a.contentIds) || [];
2537
- const index = contentIds.indexOf(componentId);
2538
- const label = node ? (_c = (_b = config.components[node.data.type]) == null ? void 0 : _b.label) != null ? _c : node.data.type : "Component";
2539
- return {
2540
- label,
2541
- selector: node ? {
2542
- index,
2543
- zone: node.path[node.path.length - 1]
2544
- } : null
2545
- };
2546
- })) || [];
2547
- if (renderCount) {
2548
- return breadcrumbs.slice(breadcrumbs.length - renderCount);
2549
- }
2550
- return breadcrumbs;
2551
- }, [path, renderCount]);
2552
- };
2553
-
2554
- // ../core/components/Loader/index.tsx
2555
- init_react_import();
2556
-
2557
- // ../core/lib/index.ts
2558
- init_react_import();
2559
-
2560
- // ../core/lib/filter.ts
2561
- init_react_import();
2562
-
2563
- // ../core/lib/data/reorder.ts
2564
- init_react_import();
2565
-
2566
- // ../core/lib/data/replace.ts
2567
- init_react_import();
2568
-
2569
- // ../core/lib/use-reset-auto-zoom.ts
2570
- init_react_import();
2571
2547
 
2572
2548
  // ../core/lib/get-zoom-config.ts
2573
2549
  init_react_import();
2574
2550
 
2575
- // css-module:/home/runner/work/puck/puck/packages/core/components/Loader/styles.module.css#css-module
2576
- init_react_import();
2577
- var styles_module_default3 = { "Loader": "_Loader_nacdm_13", "loader-animation": "_loader-animation_nacdm_1" };
2578
-
2579
- // ../core/components/Loader/index.tsx
2580
- var import_jsx_runtime2 = require("react/jsx-runtime");
2581
- var getClassName2 = get_class_name_factory_default("Loader", styles_module_default3);
2582
- var Loader = (_a) => {
2583
- var _b = _a, {
2584
- color,
2585
- size = 16
2586
- } = _b, props = __objRest(_b, [
2587
- "color",
2588
- "size"
2589
- ]);
2590
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
2591
- "span",
2592
- __spreadValues({
2593
- className: getClassName2(),
2594
- style: {
2595
- width: size,
2596
- height: size,
2597
- color
2598
- },
2599
- "aria-label": "loading"
2600
- }, props)
2601
- );
2602
- };
2603
-
2604
- // ../core/components/SidebarSection/index.tsx
2605
- var import_jsx_runtime3 = require("react/jsx-runtime");
2606
- var getClassName3 = get_class_name_factory_default("SidebarSection", styles_module_default);
2607
- var SidebarSection = ({
2608
- children,
2609
- title,
2610
- background,
2611
- showBreadcrumbs,
2612
- noBorderTop,
2613
- noPadding,
2614
- isLoading
2615
- }) => {
2616
- const setUi = useAppStore((s) => s.setUi);
2617
- const breadcrumbs = useBreadcrumbs(1);
2618
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
2619
- "div",
2620
- {
2621
- className: getClassName3({ noBorderTop, noPadding }),
2622
- style: { background },
2623
- children: [
2624
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: getClassName3("title"), children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: getClassName3("breadcrumbs"), children: [
2625
- showBreadcrumbs ? breadcrumbs.map((breadcrumb, i) => /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: getClassName3("breadcrumb"), children: [
2626
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
2627
- "button",
2628
- {
2629
- type: "button",
2630
- className: getClassName3("breadcrumbLabel"),
2631
- onClick: () => setUi({ itemSelector: breadcrumb.selector }),
2632
- children: breadcrumb.label
2633
- }
2634
- ),
2635
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ChevronRight, { size: 16 })
2636
- ] }, i)) : null,
2637
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: getClassName3("heading"), children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Heading, { rank: "2", size: "xs", children: title }) })
2638
- ] }) }),
2639
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: getClassName3("content"), children }),
2640
- isLoading && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: getClassName3("loadingOverlay"), children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Loader, { size: 32 }) })
2641
- ]
2642
- }
2643
- );
2644
- };
2645
-
2646
- // ../core/components/OutlineList/index.tsx
2647
- init_react_import();
2648
-
2649
- // css-module:/home/runner/work/puck/puck/packages/core/components/OutlineList/styles.module.css#css-module
2650
- init_react_import();
2651
- var styles_module_default4 = { "OutlineList": "_OutlineList_w4lzv_1", "OutlineListItem": "_OutlineListItem_w4lzv_25", "OutlineListItem--clickable": "_OutlineListItem--clickable_w4lzv_45" };
2652
-
2653
- // ../core/components/OutlineList/index.tsx
2654
- var import_jsx_runtime4 = require("react/jsx-runtime");
2655
- var getClassName4 = get_class_name_factory_default("OutlineList", styles_module_default4);
2656
- var getClassNameItem = get_class_name_factory_default("OutlineListItem", styles_module_default4);
2657
- var OutlineList = ({ children }) => {
2658
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("ul", { className: getClassName4(), children });
2659
- };
2660
- OutlineList.Clickable = ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: getClassNameItem({ clickable: true }), children });
2661
- OutlineList.Item = ({
2662
- children,
2663
- onClick
2664
- }) => {
2665
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
2666
- "li",
2667
- {
2668
- className: getClassNameItem({ clickable: !!onClick }),
2669
- onClick,
2670
- children
2671
- }
2672
- );
2673
- };
2674
-
2675
- // ../core/lib/scroll-into-view.ts
2676
- init_react_import();
2677
- var scrollIntoView = (el) => {
2678
- const oldStyle = __spreadValues({}, el.style);
2679
- el.style.scrollMargin = "256px";
2680
- if (el) {
2681
- el == null ? void 0 : el.scrollIntoView({ behavior: "smooth" });
2682
- el.style.scrollMargin = oldStyle.scrollMargin || "";
2683
- }
2684
- };
2685
-
2686
- // ../core/lib/get-frame.ts
2687
- init_react_import();
2688
- var getFrame = () => {
2689
- if (typeof window === "undefined") return;
2690
- let frameEl = document.querySelector("#preview-frame");
2691
- if ((frameEl == null ? void 0 : frameEl.tagName) === "IFRAME") {
2692
- return frameEl.contentDocument || document;
2693
- }
2694
- return (frameEl == null ? void 0 : frameEl.ownerDocument) || document;
2695
- };
2696
-
2697
2551
  // src/HeadingAnalyzer.tsx
2698
2552
  var import_react_from_json = __toESM(require("react-from-json"));
2699
- var import_jsx_runtime5 = require("react/jsx-runtime");
2700
- var getClassName5 = get_class_name_factory_default("HeadingAnalyzer", HeadingAnalyzer_module_default);
2553
+ var import_jsx_runtime2 = require("react/jsx-runtime");
2554
+ var getClassName2 = get_class_name_factory_default("HeadingAnalyzer", HeadingAnalyzer_module_default);
2701
2555
  var getClassNameItem2 = get_class_name_factory_default("HeadingAnalyzerItem", HeadingAnalyzer_module_default);
2702
2556
  var ReactFromJSON = import_react_from_json.default.default || import_react_from_json.default;
2703
2557
  var getOutline = ({ frame } = {}) => {
@@ -2752,8 +2606,8 @@ function buildHierarchy(frame) {
2752
2606
  var usePuck = (0, import_puck.createUsePuck)();
2753
2607
  var HeadingAnalyzer = () => {
2754
2608
  const data = usePuck((s) => s.appState.data);
2755
- const [hierarchy, setHierarchy] = (0, import_react11.useState)([]);
2756
- (0, import_react11.useEffect)(() => {
2609
+ const [hierarchy, setHierarchy] = (0, import_react10.useState)([]);
2610
+ (0, import_react10.useEffect)(() => {
2757
2611
  const frame = getFrame();
2758
2612
  let entry = frame == null ? void 0 : frame.querySelector(`[data-puck-entry]`);
2759
2613
  const createHierarchy = () => {
@@ -2788,11 +2642,11 @@ var HeadingAnalyzer = () => {
2788
2642
  frameObserver.disconnect();
2789
2643
  };
2790
2644
  }, [data]);
2791
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: getClassName5(), children: [
2792
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
2645
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: getClassName2(), children: [
2646
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
2793
2647
  "small",
2794
2648
  {
2795
- className: getClassName5("cssWarning"),
2649
+ className: getClassName2("cssWarning"),
2796
2650
  style: {
2797
2651
  color: "var(--puck-color-red-04)",
2798
2652
  display: "block",
@@ -2801,19 +2655,19 @@ var HeadingAnalyzer = () => {
2801
2655
  children: [
2802
2656
  "Heading analyzer styles not loaded. Please review the",
2803
2657
  " ",
2804
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("a", { href: "https://github.com/measuredco/puck/blob/main/packages/plugin-heading-analyzer/README.md", children: "README" }),
2658
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("a", { href: "https://github.com/measuredco/puck/blob/main/packages/plugin-heading-analyzer/README.md", children: "README" }),
2805
2659
  "."
2806
2660
  ]
2807
2661
  }
2808
2662
  ),
2809
- hierarchy.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { children: "No headings." }),
2810
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(OutlineList, { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
2663
+ hierarchy.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { children: "No headings." }),
2664
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(OutlineList, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
2811
2665
  ReactFromJSON,
2812
2666
  {
2813
2667
  mapping: {
2814
- Root: (props) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_jsx_runtime5.Fragment, { children: props.children }),
2815
- OutlineListItem: (props) => /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(OutlineList.Item, { children: [
2816
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(OutlineList.Clickable, { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
2668
+ Root: (props) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_jsx_runtime2.Fragment, { children: props.children }),
2669
+ OutlineListItem: (props) => /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(OutlineList.Item, { children: [
2670
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(OutlineList.Clickable, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
2817
2671
  "small",
2818
2672
  {
2819
2673
  className: getClassNameItem2({ missing: props.missing }),
@@ -2831,14 +2685,14 @@ var HeadingAnalyzer = () => {
2831
2685
  }, 2e3);
2832
2686
  }
2833
2687
  },
2834
- children: props.missing ? /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
2835
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("b", { children: [
2688
+ children: props.missing ? /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [
2689
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("b", { children: [
2836
2690
  "H",
2837
2691
  props.rank
2838
2692
  ] }),
2839
2693
  ": Missing"
2840
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
2841
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("b", { children: [
2694
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [
2695
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("b", { children: [
2842
2696
  "H",
2843
2697
  props.rank
2844
2698
  ] }),
@@ -2847,7 +2701,7 @@ var HeadingAnalyzer = () => {
2847
2701
  ] })
2848
2702
  }
2849
2703
  ) }),
2850
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(OutlineList, { children: props.children })
2704
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(OutlineList, { children: props.children })
2851
2705
  ] })
2852
2706
  },
2853
2707
  entry: {
@@ -2868,12 +2722,10 @@ var HeadingAnalyzer = () => {
2868
2722
  ] });
2869
2723
  };
2870
2724
  var headingAnalyzer = {
2871
- overrides: {
2872
- fields: ({ children, itemSelector }) => /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
2873
- children,
2874
- /* @__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, {}) }) })
2875
- ] })
2876
- }
2725
+ name: "heading-analyzer",
2726
+ label: "Audit",
2727
+ render: HeadingAnalyzer,
2728
+ icon: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Heading1, {})
2877
2729
  };
2878
2730
  var HeadingAnalyzer_default = headingAnalyzer;
2879
2731
  /*! Bundled license information:
@@ -2889,7 +2741,7 @@ lucide-react/dist/esm/shared/src/utils.js:
2889
2741
  lucide-react/dist/esm/defaultAttributes.js:
2890
2742
  lucide-react/dist/esm/Icon.js:
2891
2743
  lucide-react/dist/esm/createLucideIcon.js:
2892
- lucide-react/dist/esm/icons/chevron-right.js:
2744
+ lucide-react/dist/esm/icons/heading-1.js:
2893
2745
  lucide-react/dist/esm/lucide-react.js:
2894
2746
  (**
2895
2747
  * @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();
@@ -1398,7 +1433,8 @@ init_react_import();
1398
1433
  var defaultViewports = [
1399
1434
  { width: 360, height: "auto", icon: "Smartphone", label: "Small" },
1400
1435
  { width: 768, height: "auto", icon: "Tablet", label: "Medium" },
1401
- { width: 1280, height: "auto", icon: "Monitor", label: "Large" }
1436
+ { width: 1280, height: "auto", icon: "Monitor", label: "Large" },
1437
+ { width: "100%", height: "auto", icon: "FullWidth", label: "Full-width" }
1402
1438
  ];
1403
1439
 
1404
1440
  // ../../node_modules/zustand/esm/vanilla.mjs
@@ -2303,7 +2339,8 @@ var defaultAppState = {
2303
2339
  options: [],
2304
2340
  controlsVisible: true
2305
2341
  },
2306
- field: { focus: null }
2342
+ field: { focus: null },
2343
+ plugin: { current: null }
2307
2344
  },
2308
2345
  indexes: {
2309
2346
  nodes: {},
@@ -2319,6 +2356,7 @@ var createAppStore = (initialAppStore) => create()(
2319
2356
  subscribeWithSelector((set, get) => {
2320
2357
  var _a, _b;
2321
2358
  return __spreadProps(__spreadValues({
2359
+ instanceId: generateId(),
2322
2360
  state: defaultAppState,
2323
2361
  config: { components: {} },
2324
2362
  componentState: {},
@@ -2339,6 +2377,11 @@ var createAppStore = (initialAppStore) => create()(
2339
2377
  history: createHistorySlice(set, get),
2340
2378
  nodes: createNodesSlice(set, get),
2341
2379
  permissions: createPermissionsSlice(set, get),
2380
+ getCurrentData: () => {
2381
+ var _a2;
2382
+ const s = get();
2383
+ return (_a2 = s.selectedItem) != null ? _a2 : s.state.data.root;
2384
+ },
2342
2385
  getComponentConfig: (type) => {
2343
2386
  var _a2;
2344
2387
  const { config, selectedItem } = get();
@@ -2489,203 +2532,14 @@ var createAppStore = (initialAppStore) => create()(
2489
2532
  })
2490
2533
  );
2491
2534
  var appStoreContext = createContext(createAppStore());
2492
- function useAppStore(selector) {
2493
- const context = useContext(appStoreContext);
2494
- return useStore(context, selector);
2495
- }
2496
- function useAppStoreApi() {
2497
- return useContext(appStoreContext);
2498
- }
2499
-
2500
- // ../core/lib/use-breadcrumbs.ts
2501
- var useBreadcrumbs = (renderCount) => {
2502
- const selectedId = useAppStore((s) => {
2503
- var _a;
2504
- return (_a = s.selectedItem) == null ? void 0 : _a.props.id;
2505
- });
2506
- const config = useAppStore((s) => s.config);
2507
- const path = useAppStore((s) => {
2508
- var _a;
2509
- return (_a = s.state.indexes.nodes[selectedId]) == null ? void 0 : _a.path;
2510
- });
2511
- const appStore = useAppStoreApi();
2512
- return useMemo(() => {
2513
- const breadcrumbs = (path == null ? void 0 : path.map((zoneCompound) => {
2514
- var _a, _b, _c;
2515
- const [componentId] = zoneCompound.split(":");
2516
- if (componentId === "root") {
2517
- return {
2518
- label: "Page",
2519
- selector: null
2520
- };
2521
- }
2522
- const node = appStore.getState().state.indexes.nodes[componentId];
2523
- const parentId = node.path[node.path.length - 1];
2524
- const contentIds = ((_a = appStore.getState().state.indexes.zones[parentId]) == null ? void 0 : _a.contentIds) || [];
2525
- const index = contentIds.indexOf(componentId);
2526
- const label = node ? (_c = (_b = config.components[node.data.type]) == null ? void 0 : _b.label) != null ? _c : node.data.type : "Component";
2527
- return {
2528
- label,
2529
- selector: node ? {
2530
- index,
2531
- zone: node.path[node.path.length - 1]
2532
- } : null
2533
- };
2534
- })) || [];
2535
- if (renderCount) {
2536
- return breadcrumbs.slice(breadcrumbs.length - renderCount);
2537
- }
2538
- return breadcrumbs;
2539
- }, [path, renderCount]);
2540
- };
2541
-
2542
- // ../core/components/Loader/index.tsx
2543
- init_react_import();
2544
-
2545
- // ../core/lib/index.ts
2546
- init_react_import();
2547
-
2548
- // ../core/lib/filter.ts
2549
- init_react_import();
2550
-
2551
- // ../core/lib/data/reorder.ts
2552
- init_react_import();
2553
-
2554
- // ../core/lib/data/replace.ts
2555
- init_react_import();
2556
-
2557
- // ../core/lib/use-reset-auto-zoom.ts
2558
- init_react_import();
2559
2535
 
2560
2536
  // ../core/lib/get-zoom-config.ts
2561
2537
  init_react_import();
2562
2538
 
2563
- // css-module:/home/runner/work/puck/puck/packages/core/components/Loader/styles.module.css#css-module
2564
- init_react_import();
2565
- var styles_module_default3 = { "Loader": "_Loader_nacdm_13", "loader-animation": "_loader-animation_nacdm_1" };
2566
-
2567
- // ../core/components/Loader/index.tsx
2568
- import { jsx as jsx2 } from "react/jsx-runtime";
2569
- var getClassName2 = get_class_name_factory_default("Loader", styles_module_default3);
2570
- var Loader = (_a) => {
2571
- var _b = _a, {
2572
- color,
2573
- size = 16
2574
- } = _b, props = __objRest(_b, [
2575
- "color",
2576
- "size"
2577
- ]);
2578
- return /* @__PURE__ */ jsx2(
2579
- "span",
2580
- __spreadValues({
2581
- className: getClassName2(),
2582
- style: {
2583
- width: size,
2584
- height: size,
2585
- color
2586
- },
2587
- "aria-label": "loading"
2588
- }, props)
2589
- );
2590
- };
2591
-
2592
- // ../core/components/SidebarSection/index.tsx
2593
- import { jsx as jsx3, jsxs } from "react/jsx-runtime";
2594
- var getClassName3 = get_class_name_factory_default("SidebarSection", styles_module_default);
2595
- var SidebarSection = ({
2596
- children,
2597
- title,
2598
- background,
2599
- showBreadcrumbs,
2600
- noBorderTop,
2601
- noPadding,
2602
- isLoading
2603
- }) => {
2604
- const setUi = useAppStore((s) => s.setUi);
2605
- const breadcrumbs = useBreadcrumbs(1);
2606
- return /* @__PURE__ */ jsxs(
2607
- "div",
2608
- {
2609
- className: getClassName3({ noBorderTop, noPadding }),
2610
- style: { background },
2611
- children: [
2612
- /* @__PURE__ */ jsx3("div", { className: getClassName3("title"), children: /* @__PURE__ */ jsxs("div", { className: getClassName3("breadcrumbs"), children: [
2613
- showBreadcrumbs ? breadcrumbs.map((breadcrumb, i) => /* @__PURE__ */ jsxs("div", { className: getClassName3("breadcrumb"), children: [
2614
- /* @__PURE__ */ jsx3(
2615
- "button",
2616
- {
2617
- type: "button",
2618
- className: getClassName3("breadcrumbLabel"),
2619
- onClick: () => setUi({ itemSelector: breadcrumb.selector }),
2620
- children: breadcrumb.label
2621
- }
2622
- ),
2623
- /* @__PURE__ */ jsx3(ChevronRight, { size: 16 })
2624
- ] }, i)) : null,
2625
- /* @__PURE__ */ jsx3("div", { className: getClassName3("heading"), children: /* @__PURE__ */ jsx3(Heading, { rank: "2", size: "xs", children: title }) })
2626
- ] }) }),
2627
- /* @__PURE__ */ jsx3("div", { className: getClassName3("content"), children }),
2628
- isLoading && /* @__PURE__ */ jsx3("div", { className: getClassName3("loadingOverlay"), children: /* @__PURE__ */ jsx3(Loader, { size: 32 }) })
2629
- ]
2630
- }
2631
- );
2632
- };
2633
-
2634
- // ../core/components/OutlineList/index.tsx
2635
- init_react_import();
2636
-
2637
- // css-module:/home/runner/work/puck/puck/packages/core/components/OutlineList/styles.module.css#css-module
2638
- init_react_import();
2639
- var styles_module_default4 = { "OutlineList": "_OutlineList_w4lzv_1", "OutlineListItem": "_OutlineListItem_w4lzv_25", "OutlineListItem--clickable": "_OutlineListItem--clickable_w4lzv_45" };
2640
-
2641
- // ../core/components/OutlineList/index.tsx
2642
- import { jsx as jsx4 } from "react/jsx-runtime";
2643
- var getClassName4 = get_class_name_factory_default("OutlineList", styles_module_default4);
2644
- var getClassNameItem = get_class_name_factory_default("OutlineListItem", styles_module_default4);
2645
- var OutlineList = ({ children }) => {
2646
- return /* @__PURE__ */ jsx4("ul", { className: getClassName4(), children });
2647
- };
2648
- OutlineList.Clickable = ({ children }) => /* @__PURE__ */ jsx4("div", { className: getClassNameItem({ clickable: true }), children });
2649
- OutlineList.Item = ({
2650
- children,
2651
- onClick
2652
- }) => {
2653
- return /* @__PURE__ */ jsx4(
2654
- "li",
2655
- {
2656
- className: getClassNameItem({ clickable: !!onClick }),
2657
- onClick,
2658
- children
2659
- }
2660
- );
2661
- };
2662
-
2663
- // ../core/lib/scroll-into-view.ts
2664
- init_react_import();
2665
- var scrollIntoView = (el) => {
2666
- const oldStyle = __spreadValues({}, el.style);
2667
- el.style.scrollMargin = "256px";
2668
- if (el) {
2669
- el == null ? void 0 : el.scrollIntoView({ behavior: "smooth" });
2670
- el.style.scrollMargin = oldStyle.scrollMargin || "";
2671
- }
2672
- };
2673
-
2674
- // ../core/lib/get-frame.ts
2675
- init_react_import();
2676
- var getFrame = () => {
2677
- if (typeof window === "undefined") return;
2678
- let frameEl = document.querySelector("#preview-frame");
2679
- if ((frameEl == null ? void 0 : frameEl.tagName) === "IFRAME") {
2680
- return frameEl.contentDocument || document;
2681
- }
2682
- return (frameEl == null ? void 0 : frameEl.ownerDocument) || document;
2683
- };
2684
-
2685
2539
  // src/HeadingAnalyzer.tsx
2686
2540
  import ReactFromJSONModule from "react-from-json";
2687
- import { Fragment, jsx as jsx5, jsxs as jsxs2 } from "react/jsx-runtime";
2688
- var getClassName5 = get_class_name_factory_default("HeadingAnalyzer", HeadingAnalyzer_module_default);
2541
+ import { Fragment, jsx as jsx2, jsxs } from "react/jsx-runtime";
2542
+ var getClassName2 = get_class_name_factory_default("HeadingAnalyzer", HeadingAnalyzer_module_default);
2689
2543
  var getClassNameItem2 = get_class_name_factory_default("HeadingAnalyzerItem", HeadingAnalyzer_module_default);
2690
2544
  var ReactFromJSON = ReactFromJSONModule.default || ReactFromJSONModule;
2691
2545
  var getOutline = ({ frame } = {}) => {
@@ -2776,11 +2630,11 @@ var HeadingAnalyzer = () => {
2776
2630
  frameObserver.disconnect();
2777
2631
  };
2778
2632
  }, [data]);
2779
- return /* @__PURE__ */ jsxs2("div", { className: getClassName5(), children: [
2780
- /* @__PURE__ */ jsxs2(
2633
+ return /* @__PURE__ */ jsxs("div", { className: getClassName2(), children: [
2634
+ /* @__PURE__ */ jsxs(
2781
2635
  "small",
2782
2636
  {
2783
- className: getClassName5("cssWarning"),
2637
+ className: getClassName2("cssWarning"),
2784
2638
  style: {
2785
2639
  color: "var(--puck-color-red-04)",
2786
2640
  display: "block",
@@ -2789,19 +2643,19 @@ var HeadingAnalyzer = () => {
2789
2643
  children: [
2790
2644
  "Heading analyzer styles not loaded. Please review the",
2791
2645
  " ",
2792
- /* @__PURE__ */ jsx5("a", { href: "https://github.com/measuredco/puck/blob/main/packages/plugin-heading-analyzer/README.md", children: "README" }),
2646
+ /* @__PURE__ */ jsx2("a", { href: "https://github.com/measuredco/puck/blob/main/packages/plugin-heading-analyzer/README.md", children: "README" }),
2793
2647
  "."
2794
2648
  ]
2795
2649
  }
2796
2650
  ),
2797
- hierarchy.length === 0 && /* @__PURE__ */ jsx5("div", { children: "No headings." }),
2798
- /* @__PURE__ */ jsx5(OutlineList, { children: /* @__PURE__ */ jsx5(
2651
+ hierarchy.length === 0 && /* @__PURE__ */ jsx2("div", { children: "No headings." }),
2652
+ /* @__PURE__ */ jsx2(OutlineList, { children: /* @__PURE__ */ jsx2(
2799
2653
  ReactFromJSON,
2800
2654
  {
2801
2655
  mapping: {
2802
- Root: (props) => /* @__PURE__ */ jsx5(Fragment, { children: props.children }),
2803
- OutlineListItem: (props) => /* @__PURE__ */ jsxs2(OutlineList.Item, { children: [
2804
- /* @__PURE__ */ jsx5(OutlineList.Clickable, { children: /* @__PURE__ */ jsx5(
2656
+ Root: (props) => /* @__PURE__ */ jsx2(Fragment, { children: props.children }),
2657
+ OutlineListItem: (props) => /* @__PURE__ */ jsxs(OutlineList.Item, { children: [
2658
+ /* @__PURE__ */ jsx2(OutlineList.Clickable, { children: /* @__PURE__ */ jsx2(
2805
2659
  "small",
2806
2660
  {
2807
2661
  className: getClassNameItem2({ missing: props.missing }),
@@ -2819,14 +2673,14 @@ var HeadingAnalyzer = () => {
2819
2673
  }, 2e3);
2820
2674
  }
2821
2675
  },
2822
- children: props.missing ? /* @__PURE__ */ jsxs2(Fragment, { children: [
2823
- /* @__PURE__ */ jsxs2("b", { children: [
2676
+ children: props.missing ? /* @__PURE__ */ jsxs(Fragment, { children: [
2677
+ /* @__PURE__ */ jsxs("b", { children: [
2824
2678
  "H",
2825
2679
  props.rank
2826
2680
  ] }),
2827
2681
  ": Missing"
2828
- ] }) : /* @__PURE__ */ jsxs2(Fragment, { children: [
2829
- /* @__PURE__ */ jsxs2("b", { children: [
2682
+ ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
2683
+ /* @__PURE__ */ jsxs("b", { children: [
2830
2684
  "H",
2831
2685
  props.rank
2832
2686
  ] }),
@@ -2835,7 +2689,7 @@ var HeadingAnalyzer = () => {
2835
2689
  ] })
2836
2690
  }
2837
2691
  ) }),
2838
- /* @__PURE__ */ jsx5(OutlineList, { children: props.children })
2692
+ /* @__PURE__ */ jsx2(OutlineList, { children: props.children })
2839
2693
  ] })
2840
2694
  },
2841
2695
  entry: {
@@ -2856,12 +2710,10 @@ var HeadingAnalyzer = () => {
2856
2710
  ] });
2857
2711
  };
2858
2712
  var headingAnalyzer = {
2859
- overrides: {
2860
- fields: ({ children, itemSelector }) => /* @__PURE__ */ jsxs2(Fragment, { children: [
2861
- children,
2862
- /* @__PURE__ */ jsx5("div", { style: { display: itemSelector ? "none" : "block" }, children: /* @__PURE__ */ jsx5(SidebarSection, { title: "Heading Outline", children: /* @__PURE__ */ jsx5(HeadingAnalyzer, {}) }) })
2863
- ] })
2864
- }
2713
+ name: "heading-analyzer",
2714
+ label: "Audit",
2715
+ render: HeadingAnalyzer,
2716
+ icon: /* @__PURE__ */ jsx2(Heading1, {})
2865
2717
  };
2866
2718
  var HeadingAnalyzer_default = headingAnalyzer;
2867
2719
  export {
@@ -2880,7 +2732,7 @@ lucide-react/dist/esm/shared/src/utils.js:
2880
2732
  lucide-react/dist/esm/defaultAttributes.js:
2881
2733
  lucide-react/dist/esm/Icon.js:
2882
2734
  lucide-react/dist/esm/createLucideIcon.js:
2883
- lucide-react/dist/esm/icons/chevron-right.js:
2735
+ lucide-react/dist/esm/icons/heading-1.js:
2884
2736
  lucide-react/dist/esm/lucide-react.js:
2885
2737
  (**
2886
2738
  * @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.ece26d91",
3
+ "version": "0.21.0-canary.ed351ce5",
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.ece26d91",
28
+ "@measured/puck": "^0.21.0-canary.ed351ce5",
29
29
  "@types/minimatch": "3.0.5",
30
30
  "@types/react": "^19.0.1",
31
31
  "@types/react-dom": "^19.0.2",