@measured/puck-plugin-heading-analyzer 0.10.0-canary.6a9145c → 0.10.0-canary.8d47fd7
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.js +10 -10
- package/package.json +2 -2
package/dist/index.js
CHANGED
@@ -1268,28 +1268,28 @@ var dropZoneContext = (0, import_react3.createContext)(null);
|
|
1268
1268
|
// ../core/components/Puck/context.tsx
|
1269
1269
|
init_react_import();
|
1270
1270
|
var import_react4 = require("react");
|
1271
|
-
var
|
1271
|
+
var defaultAppState = {
|
1272
1272
|
data: { content: [], root: { title: "" } },
|
1273
|
-
|
1273
|
+
ui: {
|
1274
1274
|
leftSideBarVisible: true,
|
1275
1275
|
arrayState: {}
|
1276
1276
|
}
|
1277
1277
|
};
|
1278
1278
|
var appContext = (0, import_react4.createContext)({
|
1279
|
-
|
1279
|
+
state: defaultAppState,
|
1280
1280
|
dispatch: () => null
|
1281
1281
|
});
|
1282
1282
|
var AppProvider = appContext.Provider;
|
1283
1283
|
var useAppContext = () => {
|
1284
1284
|
const mainContext = (0, import_react4.useContext)(appContext);
|
1285
|
-
const selectedItem = mainContext.
|
1285
|
+
const selectedItem = mainContext.state.ui.itemSelector ? getItem(mainContext.state.ui.itemSelector, mainContext.state.data) : void 0;
|
1286
1286
|
return __spreadProps(__spreadValues({}, mainContext), {
|
1287
1287
|
// Helpers
|
1288
1288
|
selectedItem,
|
1289
|
-
|
1289
|
+
setUi: (ui, recordHistory) => {
|
1290
1290
|
return mainContext.dispatch({
|
1291
|
-
type: "
|
1292
|
-
|
1291
|
+
type: "setUi",
|
1292
|
+
ui,
|
1293
1293
|
recordHistory
|
1294
1294
|
});
|
1295
1295
|
}
|
@@ -1343,7 +1343,7 @@ var convertPathDataToBreadcrumbs = (selectedItem, pathData, data) => {
|
|
1343
1343
|
};
|
1344
1344
|
var useBreadcrumbs = (renderCount) => {
|
1345
1345
|
const {
|
1346
|
-
|
1346
|
+
state: { data },
|
1347
1347
|
selectedItem
|
1348
1348
|
} = useAppContext();
|
1349
1349
|
const dzContext = (0, import_react5.useContext)(dropZoneContext);
|
@@ -1369,13 +1369,13 @@ var SidebarSection = ({
|
|
1369
1369
|
showBreadcrumbs,
|
1370
1370
|
noPadding
|
1371
1371
|
}) => {
|
1372
|
-
const {
|
1372
|
+
const { setUi } = useAppContext();
|
1373
1373
|
const breadcrumbs = useBreadcrumbs(1);
|
1374
1374
|
return /* @__PURE__ */ import_react.default.createElement("div", { className: getClassName2({ noPadding }), style: { background } }, /* @__PURE__ */ import_react.default.createElement("div", { className: getClassName2("title") }, /* @__PURE__ */ import_react.default.createElement("div", { className: getClassName2("breadcrumbs") }, showBreadcrumbs ? breadcrumbs.map((breadcrumb, i) => /* @__PURE__ */ import_react.default.createElement("div", { key: i, className: getClassName2("breadcrumb") }, /* @__PURE__ */ import_react.default.createElement(
|
1375
1375
|
"div",
|
1376
1376
|
{
|
1377
1377
|
className: getClassName2("breadcrumbLabel"),
|
1378
|
-
onClick: () =>
|
1378
|
+
onClick: () => setUi({ itemSelector: breadcrumb.selector })
|
1379
1379
|
},
|
1380
1380
|
breadcrumb.label
|
1381
1381
|
), /* @__PURE__ */ import_react.default.createElement(chevron_right_default, { size: 16 }))) : null, /* @__PURE__ */ import_react.default.createElement("div", { className: getClassName2("heading") }, /* @__PURE__ */ import_react.default.createElement(Heading, { rank: 2, size: "xs" }, title)))), /* @__PURE__ */ import_react.default.createElement("div", { className: getClassName2("content") }, children));
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@measured/puck-plugin-heading-analyzer",
|
3
|
-
"version": "0.10.0-canary.
|
3
|
+
"version": "0.10.0-canary.8d47fd7",
|
4
4
|
"private": false,
|
5
5
|
"main": "./dist/index.js",
|
6
6
|
"types": "./dist/index.d.ts",
|
@@ -14,7 +14,7 @@
|
|
14
14
|
"dist"
|
15
15
|
],
|
16
16
|
"devDependencies": {
|
17
|
-
"@measured/puck": "^0.10.0-canary.
|
17
|
+
"@measured/puck": "^0.10.0-canary.8d47fd7",
|
18
18
|
"@types/react": "^18.2.0",
|
19
19
|
"@types/react-dom": "^18.2.0",
|
20
20
|
"eslint": "^7.32.0",
|