@alauda/doom 1.0.0-next.6 → 1.0.0-next.7

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/README.md CHANGED
@@ -5,6 +5,7 @@
5
5
  [![CodeRabbit Pull Request Reviews](https://img.shields.io/coderabbit/prs/github/alauda/doom)](https://coderabbit.ai)
6
6
  [![npm](https://img.shields.io/npm/v/@alauda/doom.svg)](https://www.npmjs.com/package/@alauda/doom)
7
7
  [![GitHub Release](https://img.shields.io/github/release/alauda/doom)](https://github.com/alauda/doom/releases)
8
+ [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/alauda/doom)
8
9
 
9
10
  [![Conventional Commits](https://img.shields.io/badge/conventional%20commits-1.0.0-yellow.svg)](https://conventionalcommits.org)
10
11
  [![Renovate enabled](https://img.shields.io/badge/renovate-enabled-brightgreen.svg)](https://renovatebot.com)
@@ -8,14 +8,11 @@ export const HeadingTitle = ({ slug, slugger, uid, level, children, }) => {
8
8
  return [null, X.h1, X.h2, X.h3, X.h4, X.h5, X.h6];
9
9
  }, [X]);
10
10
  const HeadingComponent = HeadingComponents[level];
11
- const id = useMemo(() => [
12
- uid,
13
- slug ||
14
- slugger?.slug(Children.toArray(children)
15
- .filter((it) => typeof it === 'string')
16
- .join('')),
17
- ]
11
+ const slugFromChildren = useMemo(() => Children.toArray(children)
12
+ .filter((it) => typeof it === 'string')
13
+ .join(''), [children]);
14
+ const id = useMemo(() => [uid, slug || slugger?.slug(slugFromChildren)]
18
15
  .filter(Boolean)
19
- .join('-') || undefined, [slug, uid, children]);
16
+ .join('-') || undefined, [slug, uid, slugFromChildren]);
20
17
  return (_jsxs(HeadingComponent, { id: id, children: [children, _jsx(X.a, { className: "header-anchor", href: `#${id}`, "aria-hidden": true, children: "#" })] }));
21
18
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alauda/doom",
3
- "version": "1.0.0-next.6",
3
+ "version": "1.0.0-next.7",
4
4
  "type": "module",
5
5
  "description": "Doctor Doom making docs.",
6
6
  "repository": "git+https://github.com/alauda/doom.git",