Skip to content

Commit

Permalink
Starlight sidebar support (#167)
Browse files Browse the repository at this point in the history
  • Loading branch information
martrapp authored Aug 16, 2024
1 parent ecc0966 commit b28f195
Show file tree
Hide file tree
Showing 5 changed files with 106 additions and 30 deletions.
5 changes: 5 additions & 0 deletions .changeset/two-queens-sing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'astro-vtbot': patch
---

Starlight support: Honor the persisted sidebar state introduced with Starlight v0.26.0
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@ A current deployment of tech demos and the documentation can be found at https:/

## !!! NEW TRICKS ✨ IN THE BAG 👜 !!!

This release introduces an updated version of the Inspection Chamber, now packed with new, shiny displays and knobs. The Chamber is steadily maturing, evolving from a cool prototype into a cool, reliable tool.
V1.18.5 throws a colorful mix of things into the bag. Most notable is support for Starlight's persisted sidebar state, but also various improvements to the chamber and view transition name encoding. See the changelog for details!

See your view transitions like never before: examine every detail, reveal, debug, and optimize! Now, drill down into the effects of each pseudo-element introduced by the view transition API and even selectively toggle individual animations to better understand what’s happening!
## Recently Learned Tricks ##

> V1.18.4 introduced an updated version of the Inspection Chamber, now packed with new, shiny displays and knobs. The Chamber is steadily maturing, evolving from a cool prototype into a cool, reliable tool.
> See your view transitions like never before: examine every detail, reveal, debug, and optimize! Now, drill down into the effects of each pseudo-element introduced by the view transition API and even selectively toggle individual animations to better understand what’s happening!
## Recently Learned Tricks ##

> Summon the Inspection Chamber as a component ([<InspectionChamber />](https://events-3bg.pages.dev/library/InspectionChamber/)) or [install The Bag as an integration!](hhttps://events-3bg.pages.dev/library/Installation/#installing-as-an-astro-integration) and access the Chamber from the devToolbar!
Expand Down
4 changes: 4 additions & 0 deletions components/starlight/StarlightConnector.astro
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@
oldContent?.removeAttribute('data-vtbot-replace');
newContent?.removeAttribute('data-vtbot-replace');
}

[...newDoc.scripts]
.filter((s) => (s.textContent ?? '').includes('sl-sidebar-state-persist'))
.forEach((s) => (s.setAttribute("data-astro-rerun","")));
} else {
/* check for known extensions */
updateMultiSidebar(document);
Expand Down
111 changes: 88 additions & 23 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,17 +73,17 @@
"release": "changeset publish"
},
"dependencies": {
"@vtbag/inspection-chamber": "^1.0.6"
"@vtbag/inspection-chamber": "^1.0.7"
},
"devDependencies": {
"@astrojs/check": "^0.9.2",
"@astrojs/starlight": "^0.25.5",
"@astrojs/starlight": "^0.26.0",
"@changesets/changelog-github": "0.5.0",
"@changesets/cli": "^2.27.7",
"@playwright/test": "^1.46.0",
"@types/dom-view-transitions": "^1.0.5",
"@types/node": "^22.2.0",
"astro": "^4.13.3",
"@types/node": "^22.4.0",
"astro": "^4.14.2",
"prettier": "^3.3.3",
"prettier-plugin-astro": "^0.14.1",
"typescript": "^5.5.4"
Expand Down

0 comments on commit b28f195

Please sign in to comment.