@measured/puck-plugin-heading-analyzer 0.21.0-canary.20aafb6a → 0.21.0-canary.2e1b5267

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.mjs CHANGED
@@ -91,7 +91,7 @@ var require_classnames = __commonJS({
91
91
  init_react_import();
92
92
  (function() {
93
93
  "use strict";
94
- var hasOwn = {}.hasOwnProperty;
94
+ var hasOwn2 = {}.hasOwnProperty;
95
95
  function classNames() {
96
96
  var classes = "";
97
97
  for (var i = 0; i < arguments.length; i++) {
@@ -117,7 +117,7 @@ var require_classnames = __commonJS({
117
117
  }
118
118
  var classes = "";
119
119
  for (var key in arg) {
120
- if (hasOwn.call(arg, key) && arg[key]) {
120
+ if (hasOwn2.call(arg, key) && arg[key]) {
121
121
  classes = appendClass(classes, key);
122
122
  }
123
123
  }
@@ -206,11 +206,11 @@ var require_flat = __commonJS({
206
206
  }
207
207
  function isEmpty(val) {
208
208
  const type = Object.prototype.toString.call(val);
209
- const isArray = type === "[object Array]";
209
+ const isArray2 = type === "[object Array]";
210
210
  const isObject = type === "[object Object]";
211
211
  if (!val) {
212
212
  return true;
213
- } else if (isArray) {
213
+ } else if (isArray2) {
214
214
  return !val.length;
215
215
  } else if (isObject) {
216
216
  return !Object.keys(val).length;
@@ -260,42 +260,6 @@ var require_flat = __commonJS({
260
260
  }
261
261
  });
262
262
 
263
- // ../../node_modules/fast-deep-equal/index.js
264
- var require_fast_deep_equal = __commonJS({
265
- "../../node_modules/fast-deep-equal/index.js"(exports, module) {
266
- "use strict";
267
- init_react_import();
268
- module.exports = function equal(a, b) {
269
- if (a === b) return true;
270
- if (a && b && typeof a == "object" && typeof b == "object") {
271
- if (a.constructor !== b.constructor) return false;
272
- var length, i, keys;
273
- if (Array.isArray(a)) {
274
- length = a.length;
275
- if (length != b.length) return false;
276
- for (i = length; i-- !== 0; )
277
- if (!equal(a[i], b[i])) return false;
278
- return true;
279
- }
280
- if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;
281
- if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();
282
- if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();
283
- keys = Object.keys(a);
284
- length = keys.length;
285
- if (length !== Object.keys(b).length) return false;
286
- for (i = length; i-- !== 0; )
287
- if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;
288
- for (i = length; i-- !== 0; ) {
289
- var key = keys[i];
290
- if (!equal(a[key], b[key])) return false;
291
- }
292
- return true;
293
- }
294
- return a !== a && b !== b;
295
- };
296
- }
297
- });
298
-
299
263
  // index.ts
300
264
  init_react_import();
301
265
 
@@ -305,17 +269,17 @@ import { useEffect as useEffect5, useState } from "react";
305
269
 
306
270
  // css-module:/home/runner/work/puck/puck/packages/plugin-heading-analyzer/src/HeadingAnalyzer.module.css#css-module
307
271
  init_react_import();
308
- 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" };
309
273
 
310
274
  // src/HeadingAnalyzer.tsx
311
275
  import { createUsePuck } from "@measured/puck";
312
276
 
313
- // ../core/components/SidebarSection/index.tsx
277
+ // ../core/components/OutlineList/index.tsx
314
278
  init_react_import();
315
279
 
316
- // 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
317
281
  init_react_import();
318
- 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" };
319
283
 
320
284
  // ../core/lib/get-class-name-factory.ts
321
285
  init_react_import();
@@ -344,29 +308,50 @@ var getClassNameFactory = (rootClass, styles, config = { baseClass: "" }) => (op
344
308
  };
345
309
  var get_class_name_factory_default = getClassNameFactory;
346
310
 
347
- // ../core/components/Heading/index.tsx
348
- init_react_import();
349
-
350
- // css-module:/home/runner/work/puck/puck/packages/core/components/Heading/styles.module.css#css-module
351
- init_react_import();
352
- var styles_module_default2 = { "Heading": "_Heading_qxrry_1", "Heading--xxxxl": "_Heading--xxxxl_qxrry_12", "Heading--xxxl": "_Heading--xxxl_qxrry_18", "Heading--xxl": "_Heading--xxl_qxrry_22", "Heading--xl": "_Heading--xl_qxrry_26", "Heading--l": "_Heading--l_qxrry_30", "Heading--m": "_Heading--m_qxrry_34", "Heading--s": "_Heading--s_qxrry_38", "Heading--xs": "_Heading--xs_qxrry_42" };
353
-
354
- // ../core/components/Heading/index.tsx
311
+ // ../core/components/OutlineList/index.tsx
355
312
  import { jsx } from "react/jsx-runtime";
356
- var getClassName = get_class_name_factory_default("Heading", styles_module_default2);
357
- var Heading = ({ children, rank, size = "m" }) => {
358
- 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
+ }) => {
359
323
  return /* @__PURE__ */ jsx(
360
- Tag,
324
+ "li",
361
325
  {
362
- className: getClassName({
363
- [size]: true
364
- }),
326
+ className: getClassNameItem({ clickable: !!onClick }),
327
+ onClick,
365
328
  children
366
329
  }
367
330
  );
368
331
  };
369
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
+
370
355
  // ../../node_modules/lucide-react/dist/esm/lucide-react.js
371
356
  init_react_import();
372
357
 
@@ -454,15 +439,29 @@ var createLucideIcon = (iconName, iconNode) => {
454
439
  return Component;
455
440
  };
456
441
 
457
- // ../../node_modules/lucide-react/dist/esm/icons/chevron-right.js
442
+ // ../../node_modules/lucide-react/dist/esm/icons/heading-1.js
458
443
  init_react_import();
459
- var ChevronRight = createLucideIcon("ChevronRight", [
460
- ["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" }]
461
449
  ]);
462
450
 
463
- // ../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
464
464
  init_react_import();
465
- import { useMemo } from "react";
466
465
 
467
466
  // ../core/store/index.ts
468
467
  init_react_import();
@@ -1432,7 +1431,8 @@ init_react_import();
1432
1431
  var defaultViewports = [
1433
1432
  { width: 360, height: "auto", icon: "Smartphone", label: "Small" },
1434
1433
  { width: 768, height: "auto", icon: "Tablet", label: "Medium" },
1435
- { 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" }
1436
1436
  ];
1437
1437
 
1438
1438
  // ../../node_modules/zustand/esm/vanilla.mjs
@@ -1678,7 +1678,7 @@ var flattenData = (state, config) => {
1678
1678
  (content) => content,
1679
1679
  (item) => {
1680
1680
  data.push(item);
1681
- return null;
1681
+ return item;
1682
1682
  }
1683
1683
  );
1684
1684
  return data;
@@ -1686,13 +1686,425 @@ var flattenData = (state, config) => {
1686
1686
 
1687
1687
  // ../core/lib/get-changed.ts
1688
1688
  init_react_import();
1689
- var import_fast_deep_equal = __toESM(require_fast_deep_equal());
1689
+
1690
+ // ../../node_modules/fast-equals/dist/esm/index.mjs
1691
+ init_react_import();
1692
+ var getOwnPropertyNames = Object.getOwnPropertyNames;
1693
+ var getOwnPropertySymbols = Object.getOwnPropertySymbols;
1694
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
1695
+ function combineComparators(comparatorA, comparatorB) {
1696
+ return function isEqual(a, b, state) {
1697
+ return comparatorA(a, b, state) && comparatorB(a, b, state);
1698
+ };
1699
+ }
1700
+ function createIsCircular(areItemsEqual) {
1701
+ return function isCircular(a, b, state) {
1702
+ if (!a || !b || typeof a !== "object" || typeof b !== "object") {
1703
+ return areItemsEqual(a, b, state);
1704
+ }
1705
+ var cache2 = state.cache;
1706
+ var cachedA = cache2.get(a);
1707
+ var cachedB = cache2.get(b);
1708
+ if (cachedA && cachedB) {
1709
+ return cachedA === b && cachedB === a;
1710
+ }
1711
+ cache2.set(a, b);
1712
+ cache2.set(b, a);
1713
+ var result = areItemsEqual(a, b, state);
1714
+ cache2.delete(a);
1715
+ cache2.delete(b);
1716
+ return result;
1717
+ };
1718
+ }
1719
+ function getStrictProperties(object) {
1720
+ return getOwnPropertyNames(object).concat(getOwnPropertySymbols(object));
1721
+ }
1722
+ var hasOwn = Object.hasOwn || function(object, property) {
1723
+ return hasOwnProperty.call(object, property);
1724
+ };
1725
+ function sameValueZeroEqual(a, b) {
1726
+ return a === b || !a && !b && a !== a && b !== b;
1727
+ }
1728
+ var PREACT_VNODE = "__v";
1729
+ var PREACT_OWNER = "__o";
1730
+ var REACT_OWNER = "_owner";
1731
+ var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
1732
+ var keys = Object.keys;
1733
+ function areArraysEqual(a, b, state) {
1734
+ var index = a.length;
1735
+ if (b.length !== index) {
1736
+ return false;
1737
+ }
1738
+ while (index-- > 0) {
1739
+ if (!state.equals(a[index], b[index], index, index, a, b, state)) {
1740
+ return false;
1741
+ }
1742
+ }
1743
+ return true;
1744
+ }
1745
+ function areDatesEqual(a, b) {
1746
+ return sameValueZeroEqual(a.getTime(), b.getTime());
1747
+ }
1748
+ function areErrorsEqual(a, b) {
1749
+ return a.name === b.name && a.message === b.message && a.cause === b.cause && a.stack === b.stack;
1750
+ }
1751
+ function areFunctionsEqual(a, b) {
1752
+ return a === b;
1753
+ }
1754
+ function areMapsEqual(a, b, state) {
1755
+ var size = a.size;
1756
+ if (size !== b.size) {
1757
+ return false;
1758
+ }
1759
+ if (!size) {
1760
+ return true;
1761
+ }
1762
+ var matchedIndices = new Array(size);
1763
+ var aIterable = a.entries();
1764
+ var aResult;
1765
+ var bResult;
1766
+ var index = 0;
1767
+ while (aResult = aIterable.next()) {
1768
+ if (aResult.done) {
1769
+ break;
1770
+ }
1771
+ var bIterable = b.entries();
1772
+ var hasMatch = false;
1773
+ var matchIndex = 0;
1774
+ while (bResult = bIterable.next()) {
1775
+ if (bResult.done) {
1776
+ break;
1777
+ }
1778
+ if (matchedIndices[matchIndex]) {
1779
+ matchIndex++;
1780
+ continue;
1781
+ }
1782
+ var aEntry = aResult.value;
1783
+ var bEntry = bResult.value;
1784
+ if (state.equals(aEntry[0], bEntry[0], index, matchIndex, a, b, state) && state.equals(aEntry[1], bEntry[1], aEntry[0], bEntry[0], a, b, state)) {
1785
+ hasMatch = matchedIndices[matchIndex] = true;
1786
+ break;
1787
+ }
1788
+ matchIndex++;
1789
+ }
1790
+ if (!hasMatch) {
1791
+ return false;
1792
+ }
1793
+ index++;
1794
+ }
1795
+ return true;
1796
+ }
1797
+ var areNumbersEqual = sameValueZeroEqual;
1798
+ function areObjectsEqual(a, b, state) {
1799
+ var properties = keys(a);
1800
+ var index = properties.length;
1801
+ if (keys(b).length !== index) {
1802
+ return false;
1803
+ }
1804
+ while (index-- > 0) {
1805
+ if (!isPropertyEqual(a, b, state, properties[index])) {
1806
+ return false;
1807
+ }
1808
+ }
1809
+ return true;
1810
+ }
1811
+ function areObjectsEqualStrict(a, b, state) {
1812
+ var properties = getStrictProperties(a);
1813
+ var index = properties.length;
1814
+ if (getStrictProperties(b).length !== index) {
1815
+ return false;
1816
+ }
1817
+ var property;
1818
+ var descriptorA;
1819
+ var descriptorB;
1820
+ while (index-- > 0) {
1821
+ property = properties[index];
1822
+ if (!isPropertyEqual(a, b, state, property)) {
1823
+ return false;
1824
+ }
1825
+ descriptorA = getOwnPropertyDescriptor(a, property);
1826
+ descriptorB = getOwnPropertyDescriptor(b, property);
1827
+ if ((descriptorA || descriptorB) && (!descriptorA || !descriptorB || descriptorA.configurable !== descriptorB.configurable || descriptorA.enumerable !== descriptorB.enumerable || descriptorA.writable !== descriptorB.writable)) {
1828
+ return false;
1829
+ }
1830
+ }
1831
+ return true;
1832
+ }
1833
+ function arePrimitiveWrappersEqual(a, b) {
1834
+ return sameValueZeroEqual(a.valueOf(), b.valueOf());
1835
+ }
1836
+ function areRegExpsEqual(a, b) {
1837
+ return a.source === b.source && a.flags === b.flags;
1838
+ }
1839
+ function areSetsEqual(a, b, state) {
1840
+ var size = a.size;
1841
+ if (size !== b.size) {
1842
+ return false;
1843
+ }
1844
+ if (!size) {
1845
+ return true;
1846
+ }
1847
+ var matchedIndices = new Array(size);
1848
+ var aIterable = a.values();
1849
+ var aResult;
1850
+ var bResult;
1851
+ while (aResult = aIterable.next()) {
1852
+ if (aResult.done) {
1853
+ break;
1854
+ }
1855
+ var bIterable = b.values();
1856
+ var hasMatch = false;
1857
+ var matchIndex = 0;
1858
+ while (bResult = bIterable.next()) {
1859
+ if (bResult.done) {
1860
+ break;
1861
+ }
1862
+ if (!matchedIndices[matchIndex] && state.equals(aResult.value, bResult.value, aResult.value, bResult.value, a, b, state)) {
1863
+ hasMatch = matchedIndices[matchIndex] = true;
1864
+ break;
1865
+ }
1866
+ matchIndex++;
1867
+ }
1868
+ if (!hasMatch) {
1869
+ return false;
1870
+ }
1871
+ }
1872
+ return true;
1873
+ }
1874
+ function areTypedArraysEqual(a, b) {
1875
+ var index = a.length;
1876
+ if (b.length !== index) {
1877
+ return false;
1878
+ }
1879
+ while (index-- > 0) {
1880
+ if (a[index] !== b[index]) {
1881
+ return false;
1882
+ }
1883
+ }
1884
+ return true;
1885
+ }
1886
+ function areUrlsEqual(a, b) {
1887
+ return a.hostname === b.hostname && a.pathname === b.pathname && a.protocol === b.protocol && a.port === b.port && a.hash === b.hash && a.username === b.username && a.password === b.password;
1888
+ }
1889
+ function isPropertyEqual(a, b, state, property) {
1890
+ if ((property === REACT_OWNER || property === PREACT_OWNER || property === PREACT_VNODE) && (a.$$typeof || b.$$typeof)) {
1891
+ return true;
1892
+ }
1893
+ return hasOwn(b, property) && state.equals(a[property], b[property], property, property, a, b, state);
1894
+ }
1895
+ var ARGUMENTS_TAG = "[object Arguments]";
1896
+ var BOOLEAN_TAG = "[object Boolean]";
1897
+ var DATE_TAG = "[object Date]";
1898
+ var ERROR_TAG = "[object Error]";
1899
+ var MAP_TAG = "[object Map]";
1900
+ var NUMBER_TAG = "[object Number]";
1901
+ var OBJECT_TAG = "[object Object]";
1902
+ var REG_EXP_TAG = "[object RegExp]";
1903
+ var SET_TAG = "[object Set]";
1904
+ var STRING_TAG = "[object String]";
1905
+ var URL_TAG = "[object URL]";
1906
+ var isArray = Array.isArray;
1907
+ var isTypedArray = typeof ArrayBuffer === "function" && ArrayBuffer.isView ? ArrayBuffer.isView : null;
1908
+ var assign = Object.assign;
1909
+ var getTag = Object.prototype.toString.call.bind(Object.prototype.toString);
1910
+ function createEqualityComparator(_a) {
1911
+ var areArraysEqual2 = _a.areArraysEqual, areDatesEqual2 = _a.areDatesEqual, areErrorsEqual2 = _a.areErrorsEqual, areFunctionsEqual2 = _a.areFunctionsEqual, areMapsEqual2 = _a.areMapsEqual, areNumbersEqual2 = _a.areNumbersEqual, areObjectsEqual2 = _a.areObjectsEqual, arePrimitiveWrappersEqual2 = _a.arePrimitiveWrappersEqual, areRegExpsEqual2 = _a.areRegExpsEqual, areSetsEqual2 = _a.areSetsEqual, areTypedArraysEqual2 = _a.areTypedArraysEqual, areUrlsEqual2 = _a.areUrlsEqual;
1912
+ return function comparator(a, b, state) {
1913
+ if (a === b) {
1914
+ return true;
1915
+ }
1916
+ if (a == null || b == null) {
1917
+ return false;
1918
+ }
1919
+ var type = typeof a;
1920
+ if (type !== typeof b) {
1921
+ return false;
1922
+ }
1923
+ if (type !== "object") {
1924
+ if (type === "number") {
1925
+ return areNumbersEqual2(a, b, state);
1926
+ }
1927
+ if (type === "function") {
1928
+ return areFunctionsEqual2(a, b, state);
1929
+ }
1930
+ return false;
1931
+ }
1932
+ var constructor = a.constructor;
1933
+ if (constructor !== b.constructor) {
1934
+ return false;
1935
+ }
1936
+ if (constructor === Object) {
1937
+ return areObjectsEqual2(a, b, state);
1938
+ }
1939
+ if (isArray(a)) {
1940
+ return areArraysEqual2(a, b, state);
1941
+ }
1942
+ if (isTypedArray != null && isTypedArray(a)) {
1943
+ return areTypedArraysEqual2(a, b, state);
1944
+ }
1945
+ if (constructor === Date) {
1946
+ return areDatesEqual2(a, b, state);
1947
+ }
1948
+ if (constructor === RegExp) {
1949
+ return areRegExpsEqual2(a, b, state);
1950
+ }
1951
+ if (constructor === Map) {
1952
+ return areMapsEqual2(a, b, state);
1953
+ }
1954
+ if (constructor === Set) {
1955
+ return areSetsEqual2(a, b, state);
1956
+ }
1957
+ var tag = getTag(a);
1958
+ if (tag === DATE_TAG) {
1959
+ return areDatesEqual2(a, b, state);
1960
+ }
1961
+ if (tag === REG_EXP_TAG) {
1962
+ return areRegExpsEqual2(a, b, state);
1963
+ }
1964
+ if (tag === MAP_TAG) {
1965
+ return areMapsEqual2(a, b, state);
1966
+ }
1967
+ if (tag === SET_TAG) {
1968
+ return areSetsEqual2(a, b, state);
1969
+ }
1970
+ if (tag === OBJECT_TAG) {
1971
+ return typeof a.then !== "function" && typeof b.then !== "function" && areObjectsEqual2(a, b, state);
1972
+ }
1973
+ if (tag === URL_TAG) {
1974
+ return areUrlsEqual2(a, b, state);
1975
+ }
1976
+ if (tag === ERROR_TAG) {
1977
+ return areErrorsEqual2(a, b, state);
1978
+ }
1979
+ if (tag === ARGUMENTS_TAG) {
1980
+ return areObjectsEqual2(a, b, state);
1981
+ }
1982
+ if (tag === BOOLEAN_TAG || tag === NUMBER_TAG || tag === STRING_TAG) {
1983
+ return arePrimitiveWrappersEqual2(a, b, state);
1984
+ }
1985
+ return false;
1986
+ };
1987
+ }
1988
+ function createEqualityComparatorConfig(_a) {
1989
+ var circular = _a.circular, createCustomConfig = _a.createCustomConfig, strict = _a.strict;
1990
+ var config = {
1991
+ areArraysEqual: strict ? areObjectsEqualStrict : areArraysEqual,
1992
+ areDatesEqual,
1993
+ areErrorsEqual,
1994
+ areFunctionsEqual,
1995
+ areMapsEqual: strict ? combineComparators(areMapsEqual, areObjectsEqualStrict) : areMapsEqual,
1996
+ areNumbersEqual,
1997
+ areObjectsEqual: strict ? areObjectsEqualStrict : areObjectsEqual,
1998
+ arePrimitiveWrappersEqual,
1999
+ areRegExpsEqual,
2000
+ areSetsEqual: strict ? combineComparators(areSetsEqual, areObjectsEqualStrict) : areSetsEqual,
2001
+ areTypedArraysEqual: strict ? areObjectsEqualStrict : areTypedArraysEqual,
2002
+ areUrlsEqual
2003
+ };
2004
+ if (createCustomConfig) {
2005
+ config = assign({}, config, createCustomConfig(config));
2006
+ }
2007
+ if (circular) {
2008
+ var areArraysEqual$1 = createIsCircular(config.areArraysEqual);
2009
+ var areMapsEqual$1 = createIsCircular(config.areMapsEqual);
2010
+ var areObjectsEqual$1 = createIsCircular(config.areObjectsEqual);
2011
+ var areSetsEqual$1 = createIsCircular(config.areSetsEqual);
2012
+ config = assign({}, config, {
2013
+ areArraysEqual: areArraysEqual$1,
2014
+ areMapsEqual: areMapsEqual$1,
2015
+ areObjectsEqual: areObjectsEqual$1,
2016
+ areSetsEqual: areSetsEqual$1
2017
+ });
2018
+ }
2019
+ return config;
2020
+ }
2021
+ function createInternalEqualityComparator(compare) {
2022
+ return function(a, b, _indexOrKeyA, _indexOrKeyB, _parentA, _parentB, state) {
2023
+ return compare(a, b, state);
2024
+ };
2025
+ }
2026
+ function createIsEqual(_a) {
2027
+ var circular = _a.circular, comparator = _a.comparator, createState = _a.createState, equals = _a.equals, strict = _a.strict;
2028
+ if (createState) {
2029
+ return function isEqual(a, b) {
2030
+ var _a2 = createState(), _b = _a2.cache, cache2 = _b === void 0 ? circular ? /* @__PURE__ */ new WeakMap() : void 0 : _b, meta = _a2.meta;
2031
+ return comparator(a, b, {
2032
+ cache: cache2,
2033
+ equals,
2034
+ meta,
2035
+ strict
2036
+ });
2037
+ };
2038
+ }
2039
+ if (circular) {
2040
+ return function isEqual(a, b) {
2041
+ return comparator(a, b, {
2042
+ cache: /* @__PURE__ */ new WeakMap(),
2043
+ equals,
2044
+ meta: void 0,
2045
+ strict
2046
+ });
2047
+ };
2048
+ }
2049
+ var state = {
2050
+ cache: void 0,
2051
+ equals,
2052
+ meta: void 0,
2053
+ strict
2054
+ };
2055
+ return function isEqual(a, b) {
2056
+ return comparator(a, b, state);
2057
+ };
2058
+ }
2059
+ var deepEqual = createCustomEqual();
2060
+ var strictDeepEqual = createCustomEqual({ strict: true });
2061
+ var circularDeepEqual = createCustomEqual({ circular: true });
2062
+ var strictCircularDeepEqual = createCustomEqual({
2063
+ circular: true,
2064
+ strict: true
2065
+ });
2066
+ var shallowEqual = createCustomEqual({
2067
+ createInternalComparator: function() {
2068
+ return sameValueZeroEqual;
2069
+ }
2070
+ });
2071
+ var strictShallowEqual = createCustomEqual({
2072
+ strict: true,
2073
+ createInternalComparator: function() {
2074
+ return sameValueZeroEqual;
2075
+ }
2076
+ });
2077
+ var circularShallowEqual = createCustomEqual({
2078
+ circular: true,
2079
+ createInternalComparator: function() {
2080
+ return sameValueZeroEqual;
2081
+ }
2082
+ });
2083
+ var strictCircularShallowEqual = createCustomEqual({
2084
+ circular: true,
2085
+ createInternalComparator: function() {
2086
+ return sameValueZeroEqual;
2087
+ },
2088
+ strict: true
2089
+ });
2090
+ function createCustomEqual(options) {
2091
+ if (options === void 0) {
2092
+ options = {};
2093
+ }
2094
+ var _a = options.circular, circular = _a === void 0 ? false : _a, createCustomInternalComparator = options.createInternalComparator, createState = options.createState, _b = options.strict, strict = _b === void 0 ? false : _b;
2095
+ var config = createEqualityComparatorConfig(options);
2096
+ var comparator = createEqualityComparator(config);
2097
+ var equals = createCustomInternalComparator ? createCustomInternalComparator(comparator) : createInternalEqualityComparator(comparator);
2098
+ return createIsEqual({ circular, comparator, createState, equals, strict });
2099
+ }
2100
+
2101
+ // ../core/lib/get-changed.ts
1690
2102
  var getChanged = (newItem, oldItem) => {
1691
2103
  return newItem ? Object.keys(newItem.props || {}).reduce((acc, item) => {
1692
2104
  const newItemProps = (newItem == null ? void 0 : newItem.props) || {};
1693
2105
  const oldItemProps = (oldItem == null ? void 0 : oldItem.props) || {};
1694
2106
  return __spreadProps(__spreadValues({}, acc), {
1695
- [item]: !(0, import_fast_deep_equal.default)(oldItemProps[item], newItemProps[item])
2107
+ [item]: !deepEqual(oldItemProps[item], newItemProps[item])
1696
2108
  });
1697
2109
  }, {}) : {};
1698
2110
  };
@@ -1817,7 +2229,6 @@ var createFieldsSlice = (_set, _get) => {
1817
2229
 
1818
2230
  // ../core/lib/resolve-component-data.ts
1819
2231
  init_react_import();
1820
- var import_fast_deep_equal2 = __toESM(require_fast_deep_equal());
1821
2232
  var cache = { lastChange: {} };
1822
2233
  var resolveComponentData = (_0, _1, ..._2) => __async(void 0, [_0, _1, ..._2], function* (item, config, metadata = {}, onResolveStart, onResolveEnd, trigger = "replace") {
1823
2234
  const configForItem = "type" in item && item.type !== "root" ? config.components[item.type] : config.root;
@@ -1826,7 +2237,7 @@ var resolveComponentData = (_0, _1, ..._2) => __async(void 0, [_0, _1, ..._2], f
1826
2237
  const id = "id" in item.props ? item.props.id : "root";
1827
2238
  if (shouldRunResolver) {
1828
2239
  const { item: oldItem = null, resolved = {} } = cache.lastChange[id] || {};
1829
- if (trigger !== "force" && item && (0, import_fast_deep_equal2.default)(item, oldItem)) {
2240
+ if (trigger !== "force" && item && deepEqual(item, oldItem)) {
1830
2241
  return { node: resolved, didChange: false };
1831
2242
  }
1832
2243
  const changed = getChanged(item, oldItem);
@@ -1876,7 +2287,7 @@ var resolveComponentData = (_0, _1, ..._2) => __async(void 0, [_0, _1, ..._2], f
1876
2287
  };
1877
2288
  return {
1878
2289
  node: itemWithResolvedChildren,
1879
- didChange: !(0, import_fast_deep_equal2.default)(item, itemWithResolvedChildren)
2290
+ didChange: !deepEqual(item, itemWithResolvedChildren)
1880
2291
  };
1881
2292
  });
1882
2293
 
@@ -1917,7 +2328,8 @@ var defaultAppState = {
1917
2328
  options: [],
1918
2329
  controlsVisible: true
1919
2330
  },
1920
- field: { focus: null }
2331
+ field: { focus: null },
2332
+ plugin: { current: null }
1921
2333
  },
1922
2334
  indexes: {
1923
2335
  nodes: {},
@@ -1933,6 +2345,7 @@ var createAppStore = (initialAppStore) => create()(
1933
2345
  subscribeWithSelector((set, get) => {
1934
2346
  var _a, _b;
1935
2347
  return __spreadProps(__spreadValues({
2348
+ instanceId: generateId(),
1936
2349
  state: defaultAppState,
1937
2350
  config: { components: {} },
1938
2351
  componentState: {},
@@ -2103,203 +2516,14 @@ var createAppStore = (initialAppStore) => create()(
2103
2516
  })
2104
2517
  );
2105
2518
  var appStoreContext = createContext(createAppStore());
2106
- function useAppStore(selector) {
2107
- const context = useContext(appStoreContext);
2108
- return useStore(context, selector);
2109
- }
2110
- function useAppStoreApi() {
2111
- return useContext(appStoreContext);
2112
- }
2113
-
2114
- // ../core/lib/use-breadcrumbs.ts
2115
- var useBreadcrumbs = (renderCount) => {
2116
- const selectedId = useAppStore((s) => {
2117
- var _a;
2118
- return (_a = s.selectedItem) == null ? void 0 : _a.props.id;
2119
- });
2120
- const config = useAppStore((s) => s.config);
2121
- const path = useAppStore((s) => {
2122
- var _a;
2123
- return (_a = s.state.indexes.nodes[selectedId]) == null ? void 0 : _a.path;
2124
- });
2125
- const appStore = useAppStoreApi();
2126
- return useMemo(() => {
2127
- const breadcrumbs = (path == null ? void 0 : path.map((zoneCompound) => {
2128
- var _a, _b, _c;
2129
- const [componentId] = zoneCompound.split(":");
2130
- if (componentId === "root") {
2131
- return {
2132
- label: "Page",
2133
- selector: null
2134
- };
2135
- }
2136
- const node = appStore.getState().state.indexes.nodes[componentId];
2137
- const parentId = node.path[node.path.length - 1];
2138
- const contentIds = ((_a = appStore.getState().state.indexes.zones[parentId]) == null ? void 0 : _a.contentIds) || [];
2139
- const index = contentIds.indexOf(componentId);
2140
- const label = node ? (_c = (_b = config.components[node.data.type]) == null ? void 0 : _b.label) != null ? _c : node.data.type : "Component";
2141
- return {
2142
- label,
2143
- selector: node ? {
2144
- index,
2145
- zone: node.path[node.path.length - 1]
2146
- } : null
2147
- };
2148
- })) || [];
2149
- if (renderCount) {
2150
- return breadcrumbs.slice(breadcrumbs.length - renderCount);
2151
- }
2152
- return breadcrumbs;
2153
- }, [path, renderCount]);
2154
- };
2155
-
2156
- // ../core/components/Loader/index.tsx
2157
- init_react_import();
2158
-
2159
- // ../core/lib/index.ts
2160
- init_react_import();
2161
-
2162
- // ../core/lib/filter.ts
2163
- init_react_import();
2164
-
2165
- // ../core/lib/data/reorder.ts
2166
- init_react_import();
2167
-
2168
- // ../core/lib/data/replace.ts
2169
- init_react_import();
2170
-
2171
- // ../core/lib/use-reset-auto-zoom.ts
2172
- init_react_import();
2173
2519
 
2174
2520
  // ../core/lib/get-zoom-config.ts
2175
2521
  init_react_import();
2176
2522
 
2177
- // css-module:/home/runner/work/puck/puck/packages/core/components/Loader/styles.module.css#css-module
2178
- init_react_import();
2179
- var styles_module_default3 = { "Loader": "_Loader_nacdm_13", "loader-animation": "_loader-animation_nacdm_1" };
2180
-
2181
- // ../core/components/Loader/index.tsx
2182
- import { jsx as jsx2 } from "react/jsx-runtime";
2183
- var getClassName2 = get_class_name_factory_default("Loader", styles_module_default3);
2184
- var Loader = (_a) => {
2185
- var _b = _a, {
2186
- color,
2187
- size = 16
2188
- } = _b, props = __objRest(_b, [
2189
- "color",
2190
- "size"
2191
- ]);
2192
- return /* @__PURE__ */ jsx2(
2193
- "span",
2194
- __spreadValues({
2195
- className: getClassName2(),
2196
- style: {
2197
- width: size,
2198
- height: size,
2199
- color
2200
- },
2201
- "aria-label": "loading"
2202
- }, props)
2203
- );
2204
- };
2205
-
2206
- // ../core/components/SidebarSection/index.tsx
2207
- import { jsx as jsx3, jsxs } from "react/jsx-runtime";
2208
- var getClassName3 = get_class_name_factory_default("SidebarSection", styles_module_default);
2209
- var SidebarSection = ({
2210
- children,
2211
- title,
2212
- background,
2213
- showBreadcrumbs,
2214
- noBorderTop,
2215
- noPadding,
2216
- isLoading
2217
- }) => {
2218
- const setUi = useAppStore((s) => s.setUi);
2219
- const breadcrumbs = useBreadcrumbs(1);
2220
- return /* @__PURE__ */ jsxs(
2221
- "div",
2222
- {
2223
- className: getClassName3({ noBorderTop, noPadding }),
2224
- style: { background },
2225
- children: [
2226
- /* @__PURE__ */ jsx3("div", { className: getClassName3("title"), children: /* @__PURE__ */ jsxs("div", { className: getClassName3("breadcrumbs"), children: [
2227
- showBreadcrumbs ? breadcrumbs.map((breadcrumb, i) => /* @__PURE__ */ jsxs("div", { className: getClassName3("breadcrumb"), children: [
2228
- /* @__PURE__ */ jsx3(
2229
- "button",
2230
- {
2231
- type: "button",
2232
- className: getClassName3("breadcrumbLabel"),
2233
- onClick: () => setUi({ itemSelector: breadcrumb.selector }),
2234
- children: breadcrumb.label
2235
- }
2236
- ),
2237
- /* @__PURE__ */ jsx3(ChevronRight, { size: 16 })
2238
- ] }, i)) : null,
2239
- /* @__PURE__ */ jsx3("div", { className: getClassName3("heading"), children: /* @__PURE__ */ jsx3(Heading, { rank: "2", size: "xs", children: title }) })
2240
- ] }) }),
2241
- /* @__PURE__ */ jsx3("div", { className: getClassName3("content"), children }),
2242
- isLoading && /* @__PURE__ */ jsx3("div", { className: getClassName3("loadingOverlay"), children: /* @__PURE__ */ jsx3(Loader, { size: 32 }) })
2243
- ]
2244
- }
2245
- );
2246
- };
2247
-
2248
- // ../core/components/OutlineList/index.tsx
2249
- init_react_import();
2250
-
2251
- // css-module:/home/runner/work/puck/puck/packages/core/components/OutlineList/styles.module.css#css-module
2252
- init_react_import();
2253
- var styles_module_default4 = { "OutlineList": "_OutlineList_w4lzv_1", "OutlineListItem": "_OutlineListItem_w4lzv_25", "OutlineListItem--clickable": "_OutlineListItem--clickable_w4lzv_45" };
2254
-
2255
- // ../core/components/OutlineList/index.tsx
2256
- import { jsx as jsx4 } from "react/jsx-runtime";
2257
- var getClassName4 = get_class_name_factory_default("OutlineList", styles_module_default4);
2258
- var getClassNameItem = get_class_name_factory_default("OutlineListItem", styles_module_default4);
2259
- var OutlineList = ({ children }) => {
2260
- return /* @__PURE__ */ jsx4("ul", { className: getClassName4(), children });
2261
- };
2262
- OutlineList.Clickable = ({ children }) => /* @__PURE__ */ jsx4("div", { className: getClassNameItem({ clickable: true }), children });
2263
- OutlineList.Item = ({
2264
- children,
2265
- onClick
2266
- }) => {
2267
- return /* @__PURE__ */ jsx4(
2268
- "li",
2269
- {
2270
- className: getClassNameItem({ clickable: !!onClick }),
2271
- onClick,
2272
- children
2273
- }
2274
- );
2275
- };
2276
-
2277
- // ../core/lib/scroll-into-view.ts
2278
- init_react_import();
2279
- var scrollIntoView = (el) => {
2280
- const oldStyle = __spreadValues({}, el.style);
2281
- el.style.scrollMargin = "256px";
2282
- if (el) {
2283
- el == null ? void 0 : el.scrollIntoView({ behavior: "smooth" });
2284
- el.style.scrollMargin = oldStyle.scrollMargin || "";
2285
- }
2286
- };
2287
-
2288
- // ../core/lib/get-frame.ts
2289
- init_react_import();
2290
- var getFrame = () => {
2291
- if (typeof window === "undefined") return;
2292
- let frameEl = document.querySelector("#preview-frame");
2293
- if ((frameEl == null ? void 0 : frameEl.tagName) === "IFRAME") {
2294
- return frameEl.contentDocument || document;
2295
- }
2296
- return (frameEl == null ? void 0 : frameEl.ownerDocument) || document;
2297
- };
2298
-
2299
2523
  // src/HeadingAnalyzer.tsx
2300
2524
  import ReactFromJSONModule from "react-from-json";
2301
- import { Fragment, jsx as jsx5, jsxs as jsxs2 } from "react/jsx-runtime";
2302
- var getClassName5 = get_class_name_factory_default("HeadingAnalyzer", HeadingAnalyzer_module_default);
2525
+ import { Fragment, jsx as jsx2, jsxs } from "react/jsx-runtime";
2526
+ var getClassName2 = get_class_name_factory_default("HeadingAnalyzer", HeadingAnalyzer_module_default);
2303
2527
  var getClassNameItem2 = get_class_name_factory_default("HeadingAnalyzerItem", HeadingAnalyzer_module_default);
2304
2528
  var ReactFromJSON = ReactFromJSONModule.default || ReactFromJSONModule;
2305
2529
  var getOutline = ({ frame } = {}) => {
@@ -2390,11 +2614,11 @@ var HeadingAnalyzer = () => {
2390
2614
  frameObserver.disconnect();
2391
2615
  };
2392
2616
  }, [data]);
2393
- return /* @__PURE__ */ jsxs2("div", { className: getClassName5(), children: [
2394
- /* @__PURE__ */ jsxs2(
2617
+ return /* @__PURE__ */ jsxs("div", { className: getClassName2(), children: [
2618
+ /* @__PURE__ */ jsxs(
2395
2619
  "small",
2396
2620
  {
2397
- className: getClassName5("cssWarning"),
2621
+ className: getClassName2("cssWarning"),
2398
2622
  style: {
2399
2623
  color: "var(--puck-color-red-04)",
2400
2624
  display: "block",
@@ -2403,19 +2627,19 @@ var HeadingAnalyzer = () => {
2403
2627
  children: [
2404
2628
  "Heading analyzer styles not loaded. Please review the",
2405
2629
  " ",
2406
- /* @__PURE__ */ jsx5("a", { href: "https://github.com/measuredco/puck/blob/main/packages/plugin-heading-analyzer/README.md", children: "README" }),
2630
+ /* @__PURE__ */ jsx2("a", { href: "https://github.com/measuredco/puck/blob/main/packages/plugin-heading-analyzer/README.md", children: "README" }),
2407
2631
  "."
2408
2632
  ]
2409
2633
  }
2410
2634
  ),
2411
- hierarchy.length === 0 && /* @__PURE__ */ jsx5("div", { children: "No headings." }),
2412
- /* @__PURE__ */ jsx5(OutlineList, { children: /* @__PURE__ */ jsx5(
2635
+ hierarchy.length === 0 && /* @__PURE__ */ jsx2("div", { children: "No headings." }),
2636
+ /* @__PURE__ */ jsx2(OutlineList, { children: /* @__PURE__ */ jsx2(
2413
2637
  ReactFromJSON,
2414
2638
  {
2415
2639
  mapping: {
2416
- Root: (props) => /* @__PURE__ */ jsx5(Fragment, { children: props.children }),
2417
- OutlineListItem: (props) => /* @__PURE__ */ jsxs2(OutlineList.Item, { children: [
2418
- /* @__PURE__ */ jsx5(OutlineList.Clickable, { children: /* @__PURE__ */ jsx5(
2640
+ Root: (props) => /* @__PURE__ */ jsx2(Fragment, { children: props.children }),
2641
+ OutlineListItem: (props) => /* @__PURE__ */ jsxs(OutlineList.Item, { children: [
2642
+ /* @__PURE__ */ jsx2(OutlineList.Clickable, { children: /* @__PURE__ */ jsx2(
2419
2643
  "small",
2420
2644
  {
2421
2645
  className: getClassNameItem2({ missing: props.missing }),
@@ -2433,14 +2657,14 @@ var HeadingAnalyzer = () => {
2433
2657
  }, 2e3);
2434
2658
  }
2435
2659
  },
2436
- children: props.missing ? /* @__PURE__ */ jsxs2(Fragment, { children: [
2437
- /* @__PURE__ */ jsxs2("b", { children: [
2660
+ children: props.missing ? /* @__PURE__ */ jsxs(Fragment, { children: [
2661
+ /* @__PURE__ */ jsxs("b", { children: [
2438
2662
  "H",
2439
2663
  props.rank
2440
2664
  ] }),
2441
2665
  ": Missing"
2442
- ] }) : /* @__PURE__ */ jsxs2(Fragment, { children: [
2443
- /* @__PURE__ */ jsxs2("b", { children: [
2666
+ ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
2667
+ /* @__PURE__ */ jsxs("b", { children: [
2444
2668
  "H",
2445
2669
  props.rank
2446
2670
  ] }),
@@ -2449,7 +2673,7 @@ var HeadingAnalyzer = () => {
2449
2673
  ] })
2450
2674
  }
2451
2675
  ) }),
2452
- /* @__PURE__ */ jsx5(OutlineList, { children: props.children })
2676
+ /* @__PURE__ */ jsx2(OutlineList, { children: props.children })
2453
2677
  ] })
2454
2678
  },
2455
2679
  entry: {
@@ -2470,12 +2694,10 @@ var HeadingAnalyzer = () => {
2470
2694
  ] });
2471
2695
  };
2472
2696
  var headingAnalyzer = {
2473
- overrides: {
2474
- fields: ({ children, itemSelector }) => /* @__PURE__ */ jsxs2(Fragment, { children: [
2475
- children,
2476
- /* @__PURE__ */ jsx5("div", { style: { display: itemSelector ? "none" : "block" }, children: /* @__PURE__ */ jsx5(SidebarSection, { title: "Heading Outline", children: /* @__PURE__ */ jsx5(HeadingAnalyzer, {}) }) })
2477
- ] })
2478
- }
2697
+ name: "heading-analyzer",
2698
+ label: "Audit",
2699
+ render: HeadingAnalyzer,
2700
+ icon: /* @__PURE__ */ jsx2(Heading1, {})
2479
2701
  };
2480
2702
  var HeadingAnalyzer_default = headingAnalyzer;
2481
2703
  export {
@@ -2522,7 +2744,7 @@ lucide-react/dist/esm/createLucideIcon.js:
2522
2744
  * See the LICENSE file in the root directory of this source tree.
2523
2745
  *)
2524
2746
 
2525
- lucide-react/dist/esm/icons/chevron-right.js:
2747
+ lucide-react/dist/esm/icons/heading-1.js:
2526
2748
  (**
2527
2749
  * @license lucide-react v0.468.0 - ISC
2528
2750
  *