@measured/puck-plugin-heading-analyzer 0.1.6 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.css CHANGED
@@ -1,25 +1,32 @@
1
1
  /* css-module:/home/runner/work/puck/puck/packages/core/components/SidebarSection/styles.module.css/#css-module-data */
2
- ._SidebarSection_jsf8x_1:last-of-type ._SidebarSection-content_jsf8x_1 {
3
- border-bottom: none;
4
- height: 100%;
2
+ ._SidebarSection_yd8db_1 {
3
+ display: flex;
4
+ flex-direction: column;
5
+ }
6
+ ._SidebarSection_yd8db_1:last-of-type {
7
+ flex-grow: 1;
5
8
  }
6
- ._SidebarSection-title_jsf8x_6 {
9
+ ._SidebarSection-title_yd8db_10 {
7
10
  background: white;
8
11
  padding: 16px;
9
12
  border-bottom: 1px solid var(--puck-color-grey-8);
10
13
  }
11
- ._SidebarSection-title_jsf8x_6:hover {
14
+ ._SidebarSection-title_yd8db_10:hover {
12
15
  opacity: 0.6;
13
16
  cursor: pointer;
14
17
  }
15
- ._SidebarSection-content_jsf8x_1 {
18
+ ._SidebarSection-content_yd8db_21 {
16
19
  border-bottom: 1px solid var(--puck-color-grey-8);
17
20
  padding: 16px;
18
21
  }
19
- ._SidebarSection_jsf8x_1 > summary {
22
+ ._SidebarSection_yd8db_1:last-of-type ._SidebarSection-content_yd8db_21 {
23
+ border-bottom: none;
24
+ flex-grow: 1;
25
+ }
26
+ ._SidebarSection_yd8db_1 > summary {
20
27
  list-style: none;
21
28
  }
22
- ._SidebarSection_jsf8x_1 > summary::-webkit-details-marker {
29
+ ._SidebarSection_yd8db_1 > summary::-webkit-details-marker {
23
30
  display: none;
24
31
  }
25
32
 
package/dist/index.js CHANGED
@@ -125,7 +125,7 @@ init_react_import();
125
125
 
126
126
  // css-module:/home/runner/work/puck/puck/packages/core/components/SidebarSection/styles.module.css#css-module
127
127
  init_react_import();
128
- var styles_module_default = { "SidebarSection": "_SidebarSection_jsf8x_1", "SidebarSection-content": "_SidebarSection-content_jsf8x_1", "SidebarSection-title": "_SidebarSection-title_jsf8x_6" };
128
+ var styles_module_default = { "SidebarSection": "_SidebarSection_yd8db_1", "SidebarSection-title": "_SidebarSection-title_yd8db_10", "SidebarSection-content": "_SidebarSection-content_yd8db_21" };
129
129
 
130
130
  // ../core/lib/get-class-name-factory.ts
131
131
  init_react_import();
@@ -182,9 +182,10 @@ var Heading = ({ children, rank, size = "m" }) => {
182
182
  var getClassName2 = get_class_name_factory_default("SidebarSection", styles_module_default);
183
183
  var SidebarSection = ({
184
184
  children,
185
- title
185
+ title,
186
+ background
186
187
  }) => {
187
- return /* @__PURE__ */ import_react.default.createElement("details", { className: getClassName2({}), open: true }, /* @__PURE__ */ import_react.default.createElement("summary", { className: getClassName2("title") }, /* @__PURE__ */ import_react.default.createElement(Heading, { rank: 2, size: "xs" }, title)), /* @__PURE__ */ import_react.default.createElement("div", { className: getClassName2("content") }, children));
188
+ return /* @__PURE__ */ import_react.default.createElement("details", { className: getClassName2(), open: true, style: { background } }, /* @__PURE__ */ import_react.default.createElement("summary", { className: getClassName2("title") }, /* @__PURE__ */ import_react.default.createElement(Heading, { rank: 2, size: "xs" }, title)), /* @__PURE__ */ import_react.default.createElement("div", { className: getClassName2("content") }, children));
188
189
  };
189
190
 
190
191
  // ../core/components/OutlineList/index.tsx
@@ -280,7 +281,7 @@ function buildHierarchy() {
280
281
  }
281
282
  return root.children;
282
283
  }
283
- var HeadingOutlineAnalyzer = ({
284
+ var HeadingOutlineAnalyer = ({
284
285
  children,
285
286
  data
286
287
  }) => {
@@ -296,7 +297,7 @@ var HeadingOutlineAnalyzer = ({
296
297
  setHierarchy(buildHierarchy());
297
298
  }
298
299
  }, [data.content]);
299
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { children: [
300
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [
300
301
  children,
301
302
  /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(SidebarSection, { title: "Heading Outline", children: [
302
303
  hierarchy.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { children: "No headings." }),
@@ -363,7 +364,7 @@ var HeadingOutlineAnalyzer = ({
363
364
  ] });
364
365
  };
365
366
  var HeadingAnalyzer = {
366
- renderPageFields: HeadingOutlineAnalyzer
367
+ renderPageFields: HeadingOutlineAnalyer
367
368
  };
368
369
  var HeadingAnalyzer_default = HeadingAnalyzer;
369
370
  /*! Bundled license information:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@measured/puck-plugin-heading-analyzer",
3
- "version": "0.1.6",
3
+ "version": "0.2.1",
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.1.6",
17
+ "@measured/puck": "^0.2.1",
18
18
  "@types/react": "^18.2.0",
19
19
  "@types/react-dom": "^18.2.0",
20
20
  "eslint": "^7.32.0",