@measured/puck-plugin-heading-analyzer 0.16.0-canary.f761e5f → 0.16.0-canary.fc564d7

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.js CHANGED
@@ -1419,7 +1419,7 @@ init_react_import();
1419
1419
 
1420
1420
  // src/HeadingAnalyzer.tsx
1421
1421
  init_react_import();
1422
- var import_react6 = require("react");
1422
+ var import_react8 = require("react");
1423
1423
 
1424
1424
  // css-module:/home/runner/work/puck/puck/packages/plugin-heading-analyzer/src/HeadingAnalyzer.module.css#css-module
1425
1425
  init_react_import();
@@ -1542,7 +1542,7 @@ var ChevronRight = createLucideIcon("ChevronRight", [
1542
1542
 
1543
1543
  // ../core/lib/use-breadcrumbs.ts
1544
1544
  init_react_import();
1545
- var import_react5 = require("react");
1545
+ var import_react7 = require("react");
1546
1546
 
1547
1547
  // ../core/components/DropZone/context.tsx
1548
1548
  init_react_import();
@@ -1557,26 +1557,6 @@ var rootDroppableId = "default-zone";
1557
1557
 
1558
1558
  // ../core/lib/setup-zone.ts
1559
1559
  init_react_import();
1560
- var setupZone = (data, zoneKey) => {
1561
- if (zoneKey === rootDroppableId) {
1562
- return data;
1563
- }
1564
- const newData = __spreadProps(__spreadValues({}, data), {
1565
- zones: data.zones || {}
1566
- });
1567
- newData.zones[zoneKey] = newData.zones[zoneKey] || [];
1568
- return newData;
1569
- };
1570
-
1571
- // ../core/lib/get-item.ts
1572
- function getItem(selector, data, dynamicProps = {}) {
1573
- if (!selector.zone || selector.zone === rootDroppableId) {
1574
- const item2 = data.content[selector.index];
1575
- return (item2 == null ? void 0 : item2.props) ? __spreadProps(__spreadValues({}, item2), { props: dynamicProps[item2.props.id] || item2.props }) : void 0;
1576
- }
1577
- const item = setupZone(data, selector.zone).zones[selector.zone][selector.index];
1578
- return (item == null ? void 0 : item.props) ? __spreadProps(__spreadValues({}, item), { props: dynamicProps[item.props.id] || item.props }) : void 0;
1579
- }
1580
1560
 
1581
1561
  // ../core/lib/get-zone-id.ts
1582
1562
  init_react_import();
@@ -1596,7 +1576,7 @@ var dropZoneContext = (0, import_react3.createContext)(null);
1596
1576
 
1597
1577
  // ../core/components/Puck/context.tsx
1598
1578
  init_react_import();
1599
- var import_react4 = require("react");
1579
+ var import_react6 = require("react");
1600
1580
 
1601
1581
  // ../core/components/ViewportControls/default-viewports.ts
1602
1582
  init_react_import();
@@ -1608,6 +1588,31 @@ var defaultViewports = [
1608
1588
 
1609
1589
  // ../core/components/Puck/context.tsx
1610
1590
  var import_ua_parser_js = __toESM(require_ua_parser());
1591
+
1592
+ // ../core/lib/use-resolved-permissions.ts
1593
+ init_react_import();
1594
+ var import_react4 = require("react");
1595
+
1596
+ // ../core/lib/flatten-data.ts
1597
+ init_react_import();
1598
+
1599
+ // ../core/lib/get-changed.ts
1600
+ init_react_import();
1601
+
1602
+ // ../core/lib/use-resolved-data.ts
1603
+ init_react_import();
1604
+ var import_react5 = require("react");
1605
+
1606
+ // ../core/lib/resolve-component-data.ts
1607
+ init_react_import();
1608
+
1609
+ // ../core/lib/apply-dynamic-props.ts
1610
+ init_react_import();
1611
+
1612
+ // ../core/lib/resolve-root-data.ts
1613
+ init_react_import();
1614
+
1615
+ // ../core/components/Puck/context.tsx
1611
1616
  var import_jsx_runtime3 = require("react/jsx-runtime");
1612
1617
  var defaultAppState = {
1613
1618
  data: { content: [], root: {} },
@@ -1633,6 +1638,8 @@ var defaultContext = {
1633
1638
  dispatch: () => null,
1634
1639
  config: { components: {} },
1635
1640
  componentState: {},
1641
+ setComponentState: () => {
1642
+ },
1636
1643
  resolveData: () => {
1637
1644
  },
1638
1645
  plugins: [],
@@ -1649,15 +1656,15 @@ var defaultContext = {
1649
1656
  setStatus: () => null,
1650
1657
  iframe: {},
1651
1658
  safariFallbackMode: false,
1652
- globalPermissions: {}
1659
+ globalPermissions: {},
1660
+ getPermissions: () => ({}),
1661
+ refreshPermissions: () => null
1653
1662
  };
1654
- var appContext = (0, import_react4.createContext)(defaultContext);
1663
+ var appContext = (0, import_react6.createContext)(defaultContext);
1655
1664
  function useAppContext() {
1656
- const mainContext = (0, import_react4.useContext)(appContext);
1657
- const selectedItem = mainContext.state.ui.itemSelector ? getItem(mainContext.state.ui.itemSelector, mainContext.state.data) : void 0;
1665
+ const mainContext = (0, import_react6.useContext)(appContext);
1658
1666
  return __spreadProps(__spreadValues({}, mainContext), {
1659
1667
  // Helpers
1660
- selectedItem,
1661
1668
  setUi: (ui, recordHistory) => {
1662
1669
  return mainContext.dispatch({
1663
1670
  type: "setUi",
@@ -1718,8 +1725,8 @@ var useBreadcrumbs = (renderCount) => {
1718
1725
  state: { data },
1719
1726
  selectedItem
1720
1727
  } = useAppContext();
1721
- const dzContext = (0, import_react5.useContext)(dropZoneContext);
1722
- return (0, import_react5.useMemo)(() => {
1728
+ const dzContext = (0, import_react7.useContext)(dropZoneContext);
1729
+ return (0, import_react7.useMemo)(() => {
1723
1730
  const breadcrumbs = convertPathDataToBreadcrumbs(
1724
1731
  selectedItem,
1725
1732
  dzContext == null ? void 0 : dzContext.pathData,
@@ -1929,9 +1936,9 @@ function buildHierarchy(frame) {
1929
1936
  }
1930
1937
  var HeadingAnalyzer = () => {
1931
1938
  const { appState } = (0, import_puck.usePuck)();
1932
- const [hierarchy, setHierarchy] = (0, import_react6.useState)([]);
1933
- const [firstRender, setFirstRender] = (0, import_react6.useState)(true);
1934
- (0, import_react6.useEffect)(() => {
1939
+ const [hierarchy, setHierarchy] = (0, import_react8.useState)([]);
1940
+ const [firstRender, setFirstRender] = (0, import_react8.useState)(true);
1941
+ (0, import_react8.useEffect)(() => {
1935
1942
  const frame = getFrame();
1936
1943
  if (!frame) return;
1937
1944
  if (firstRender) {
package/dist/index.mjs CHANGED
@@ -1407,7 +1407,7 @@ init_react_import();
1407
1407
 
1408
1408
  // src/HeadingAnalyzer.tsx
1409
1409
  init_react_import();
1410
- import { useEffect as useEffect2, useState as useState3 } from "react";
1410
+ import { useEffect as useEffect4, useState as useState5 } from "react";
1411
1411
 
1412
1412
  // css-module:/home/runner/work/puck/puck/packages/plugin-heading-analyzer/src/HeadingAnalyzer.module.css#css-module
1413
1413
  init_react_import();
@@ -1549,26 +1549,6 @@ var rootDroppableId = "default-zone";
1549
1549
 
1550
1550
  // ../core/lib/setup-zone.ts
1551
1551
  init_react_import();
1552
- var setupZone = (data, zoneKey) => {
1553
- if (zoneKey === rootDroppableId) {
1554
- return data;
1555
- }
1556
- const newData = __spreadProps(__spreadValues({}, data), {
1557
- zones: data.zones || {}
1558
- });
1559
- newData.zones[zoneKey] = newData.zones[zoneKey] || [];
1560
- return newData;
1561
- };
1562
-
1563
- // ../core/lib/get-item.ts
1564
- function getItem(selector, data, dynamicProps = {}) {
1565
- if (!selector.zone || selector.zone === rootDroppableId) {
1566
- const item2 = data.content[selector.index];
1567
- return (item2 == null ? void 0 : item2.props) ? __spreadProps(__spreadValues({}, item2), { props: dynamicProps[item2.props.id] || item2.props }) : void 0;
1568
- }
1569
- const item = setupZone(data, selector.zone).zones[selector.zone][selector.index];
1570
- return (item == null ? void 0 : item.props) ? __spreadProps(__spreadValues({}, item), { props: dynamicProps[item.props.id] || item.props }) : void 0;
1571
- }
1572
1552
 
1573
1553
  // ../core/lib/get-zone-id.ts
1574
1554
  init_react_import();
@@ -1591,8 +1571,8 @@ init_react_import();
1591
1571
  import {
1592
1572
  createContext as createContext2,
1593
1573
  useContext,
1594
- useEffect,
1595
- useState as useState2
1574
+ useEffect as useEffect3,
1575
+ useState as useState4
1596
1576
  } from "react";
1597
1577
 
1598
1578
  // ../core/components/ViewportControls/default-viewports.ts
@@ -1605,6 +1585,31 @@ var defaultViewports = [
1605
1585
 
1606
1586
  // ../core/components/Puck/context.tsx
1607
1587
  var import_ua_parser_js = __toESM(require_ua_parser());
1588
+
1589
+ // ../core/lib/use-resolved-permissions.ts
1590
+ init_react_import();
1591
+ import { useCallback as useCallback2, useEffect, useState as useState2 } from "react";
1592
+
1593
+ // ../core/lib/flatten-data.ts
1594
+ init_react_import();
1595
+
1596
+ // ../core/lib/get-changed.ts
1597
+ init_react_import();
1598
+
1599
+ // ../core/lib/use-resolved-data.ts
1600
+ init_react_import();
1601
+ import { useCallback as useCallback3, useEffect as useEffect2, useState as useState3 } from "react";
1602
+
1603
+ // ../core/lib/resolve-component-data.ts
1604
+ init_react_import();
1605
+
1606
+ // ../core/lib/apply-dynamic-props.ts
1607
+ init_react_import();
1608
+
1609
+ // ../core/lib/resolve-root-data.ts
1610
+ init_react_import();
1611
+
1612
+ // ../core/components/Puck/context.tsx
1608
1613
  import { jsx as jsx3 } from "react/jsx-runtime";
1609
1614
  var defaultAppState = {
1610
1615
  data: { content: [], root: {} },
@@ -1630,6 +1635,8 @@ var defaultContext = {
1630
1635
  dispatch: () => null,
1631
1636
  config: { components: {} },
1632
1637
  componentState: {},
1638
+ setComponentState: () => {
1639
+ },
1633
1640
  resolveData: () => {
1634
1641
  },
1635
1642
  plugins: [],
@@ -1646,15 +1653,15 @@ var defaultContext = {
1646
1653
  setStatus: () => null,
1647
1654
  iframe: {},
1648
1655
  safariFallbackMode: false,
1649
- globalPermissions: {}
1656
+ globalPermissions: {},
1657
+ getPermissions: () => ({}),
1658
+ refreshPermissions: () => null
1650
1659
  };
1651
1660
  var appContext = createContext2(defaultContext);
1652
1661
  function useAppContext() {
1653
1662
  const mainContext = useContext(appContext);
1654
- const selectedItem = mainContext.state.ui.itemSelector ? getItem(mainContext.state.ui.itemSelector, mainContext.state.data) : void 0;
1655
1663
  return __spreadProps(__spreadValues({}, mainContext), {
1656
1664
  // Helpers
1657
- selectedItem,
1658
1665
  setUi: (ui, recordHistory) => {
1659
1666
  return mainContext.dispatch({
1660
1667
  type: "setUi",
@@ -1926,9 +1933,9 @@ function buildHierarchy(frame) {
1926
1933
  }
1927
1934
  var HeadingAnalyzer = () => {
1928
1935
  const { appState } = usePuck();
1929
- const [hierarchy, setHierarchy] = useState3([]);
1930
- const [firstRender, setFirstRender] = useState3(true);
1931
- useEffect2(() => {
1936
+ const [hierarchy, setHierarchy] = useState5([]);
1937
+ const [firstRender, setFirstRender] = useState5(true);
1938
+ useEffect4(() => {
1932
1939
  const frame = getFrame();
1933
1940
  if (!frame) return;
1934
1941
  if (firstRender) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@measured/puck-plugin-heading-analyzer",
3
- "version": "0.16.0-canary.f761e5f",
3
+ "version": "0.16.0-canary.fc564d7",
4
4
  "author": "Measured Corporation Ltd <hello@measured.co>",
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.16.0-canary.f761e5f",
28
+ "@measured/puck": "^0.16.0-canary.fc564d7",
29
29
  "@types/react": "^18.2.0",
30
30
  "@types/react-dom": "^18.2.0",
31
31
  "eslint": "^7.32.0",