starlight-heading-badges 0.3.0 → 0.4.1

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/CHANGELOG.md ADDED
@@ -0,0 +1,17 @@
1
+ # starlight-heading-badges
2
+
3
+ ## 0.4.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#10](https://github.com/HiDeoo/starlight-heading-badges/pull/10) [`68a2977`](https://github.com/HiDeoo/starlight-heading-badges/commit/68a29775e0852ade39ae34cb92ba6522a01b2c9d) Thanks [@DaniFoldi](https://github.com/DaniFoldi)! - Moves `mdast-util-directive` package to non-dev dependencies to prevent issues in monorepos with hoisting disabled.
8
+
9
+ ## 0.4.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [#8](https://github.com/HiDeoo/starlight-heading-badges/pull/8) [`51c2bca`](https://github.com/HiDeoo/starlight-heading-badges/commit/51c2bcad815af8be5d2d93fba8221eba182cd72d) Thanks [@HiDeoo](https://github.com/HiDeoo)! - Adds support for Astro v5, drops support for Astro v4.
14
+
15
+ ⚠️ **BREAKING CHANGE:** The minimum supported version of Starlight is now `0.30.0`.
16
+
17
+ Please follow the [upgrade guide](https://github.com/withastro/starlight/releases/tag/%40astrojs/starlight%400.30.0) to update your project.
@@ -157,11 +157,11 @@ const { toc } = Astro.props
157
157
  link.addEventListener('click', closeToC)
158
158
  }
159
159
  // Close the table of contents when a user clicks outside of it.
160
- window.addEventListener('click', (e) => {
160
+ globalThis.addEventListener('click', (e) => {
161
161
  if (!details.contains(e.target as Node)) closeToC()
162
162
  })
163
163
  // Or when they press the escape key.
164
- window.addEventListener('keydown', (e) => {
164
+ globalThis.addEventListener('keydown', (e) => {
165
165
  if (e.key === 'Escape' && details.open) {
166
166
  const hasFocus = details.contains(document.activeElement)
167
167
  closeToC()
@@ -74,8 +74,7 @@ export class StarlightTOC extends HTMLElement {
74
74
  observe()
75
75
 
76
76
  // `requestIdleCallback` is not available in Safari.
77
- // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
78
- const onIdle = window.requestIdleCallback || ((cb) => setTimeout(cb, 1))
77
+ const onIdle = globalThis.requestIdleCallback || ((cb) => setTimeout(cb, 1))
79
78
  let timeout: NodeJS.Timeout
80
79
  window.addEventListener('resize', () => {
81
80
  // Disable intersection observer while window is resizing.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "starlight-heading-badges",
3
- "version": "0.3.0",
3
+ "version": "0.4.1",
4
4
  "license": "MIT",
5
5
  "description": "Starlight plugin to add badges to your Markdown and MDX headings.",
6
6
  "author": "HiDeoo <github@hideoo.dev> (https://hideoo.dev)",
@@ -15,24 +15,25 @@
15
15
  "./package.json": "./package.json"
16
16
  },
17
17
  "dependencies": {
18
- "@astrojs/markdown-remark": "^5.1.1",
18
+ "@astrojs/markdown-remark": "^6.0.1",
19
19
  "github-slugger": "^2.0.0",
20
+ "mdast-util-directive": "^3.0.0",
20
21
  "unist-util-visit": "^5.0.0"
21
22
  },
22
23
  "devDependencies": {
23
- "@playwright/test": "^1.45.0",
24
+ "@playwright/test": "^1.49.1",
24
25
  "@types/hast": "^3.0.4",
25
- "@types/mdast": "^4.0.4",
26
- "mdast-util-directive": "^3.0.0"
26
+ "@types/mdast": "^4.0.4"
27
27
  },
28
28
  "peerDependencies": {
29
- "@astrojs/starlight": ">=0.28.0"
29
+ "@astrojs/starlight": ">=0.30.0"
30
30
  },
31
31
  "engines": {
32
32
  "node": ">=18"
33
33
  },
34
34
  "publishConfig": {
35
- "access": "public"
35
+ "access": "public",
36
+ "provenance": true
36
37
  },
37
38
  "sideEffects": false,
38
39
  "keywords": [
@@ -52,6 +53,6 @@
52
53
  "bugs": "https://github.com/HiDeoo/starlight-heading-badges/issues",
53
54
  "scripts": {
54
55
  "test": "playwright install --with-deps chromium && playwright test",
55
- "lint": "prettier -c --cache . && eslint . --cache --max-warnings=0"
56
+ "lint": "eslint . --cache --max-warnings=0"
56
57
  }
57
58
  }