astro-vtbot
Advanced tools
Comparing version 1.7.27 to 1.8.1
import type { AstroIntegration } from 'astro'; | ||
import vitePluginVtbotExtend from './vite-plugin-extend'; | ||
//@ts-expect-error | ||
import icon from '../assets/bag-of-tricks-mono.svg?raw'; | ||
import inspectionChamber from '../../@vtbag/inspection-chamber?raw'; | ||
import { fileURLToPath } from 'node:url'; | ||
const DTB_TOKEN = 'vtbot-inspection-chamber'; | ||
type VtBotOptions = { | ||
@@ -13,7 +19,7 @@ autoLint?: boolean; | ||
hooks: { | ||
'astro:config:setup': ({ updateConfig }) => { | ||
'astro:config:setup': (setupOptions) => { | ||
const linter = options?.autoLint ?? true; | ||
const loading = options?.loadingIndicator ?? true; | ||
if (linter || loading) { | ||
updateConfig({ | ||
setupOptions.updateConfig({ | ||
vite: { | ||
@@ -24,2 +30,21 @@ plugins: [vitePluginVtbotExtend({ linter, loading })], | ||
} | ||
//@ts-expect-error | ||
if (import.meta.env.DEV) { | ||
setupOptions.injectRoute({ | ||
pattern: '/_vtbot_inspection_chamber', | ||
entrypoint: 'node_modules/astro-vtbot/components/InspectionChamber.astro', | ||
}); | ||
setupOptions.injectScript( | ||
'head-inline', | ||
`if (sessionStorage.getItem('${DTB_TOKEN}') === 'true') {${inspectionChamber}}; document.currentScript.remove()` | ||
); | ||
} | ||
setupOptions.addDevToolbarApp({ | ||
id: 'vtbot', | ||
name: 'The Bag', | ||
icon, | ||
entrypoint: fileURLToPath(new URL('../devToolbar/app.ts', import.meta.url)), | ||
}); | ||
}, | ||
@@ -26,0 +51,0 @@ }, |
@@ -6,5 +6,5 @@ { | ||
}, | ||
"version": "1.7.27", | ||
"version": "1.8.1", | ||
"description": "The ๐ Bag of Tricks โจ for Astro's View Transitions", | ||
"homepage": "https://github.com/martrapp/astro-vtbot#readme", | ||
"homepage": "https://events-3bg.pages.dev/", | ||
"bugs": { | ||
@@ -27,3 +27,4 @@ "url": "https://github.com/martrapp/astro-vtbot/issues" | ||
"integration", | ||
"assets" | ||
"assets", | ||
"devToolbar" | ||
], | ||
@@ -76,13 +77,16 @@ "exports": { | ||
}, | ||
"dependencies": { | ||
"@vtbag/inspection-chamber": "latest" | ||
}, | ||
"devDependencies": { | ||
"@astrojs/check": "^0.7.0", | ||
"@astrojs/starlight": "^0.25.0", | ||
"@astrojs/check": "^0.8.2", | ||
"@astrojs/starlight": "^0.25.1", | ||
"@changesets/changelog-github": "0.5.0", | ||
"@changesets/cli": "^2.27.7", | ||
"@playwright/test": "^1.45.1", | ||
"@playwright/test": "^1.45.2", | ||
"@types/dom-view-transitions": "^1.0.4", | ||
"@types/node": "^20.14.10", | ||
"astro": "^4.11.5", | ||
"prettier": "^3.3.2", | ||
"prettier-plugin-astro": "^0.14.0", | ||
"@types/node": "^20.14.11", | ||
"astro": "^4.11.6", | ||
"prettier": "^3.3.3", | ||
"prettier-plugin-astro": "^0.14.1", | ||
"typescript": "^5.5.3" | ||
@@ -89,0 +93,0 @@ }, |
@@ -14,24 +14,9 @@ No, its **_NOT_** a roBOT ๐ค, its a ๐ <b>B</b>ag <b>o</b>f <b>T</b>ricks!โจ | ||
### More Starlight Improvements: ### | ||
Deep down at the bottom of the Bag of Tricks, in a hidden inner pocket, there is a secret passage to an ominous machine room. In the machine room stands the [inspection chamber](https://events-3bg.pages.dev/inspection-chamber-demo/first-page/), quietly humming to itself. | ||
#### Mission Accomplished | ||
> This release completes the series of additions to the view transition support for Starlight! | ||
The last two of the [originally planned features](https://events-3bg.pages.dev/jotter/starlight/inner-workings/) are: | ||
- The [`<BorderControl fence={{}} />` component](https://events-3bg.pages.dev/library/BorderControl/) that helps you to maintain Starlight state in a mixed Starlight / non-Starlight project. | ||
- The [`<SwapSound src="..." />` component](https://events-3bg.pages.dev/library/SwapSound/) that provides transition animation for the ears, an audible loading and transition indicator, or simply lots of noise from click to finish. | ||
See your view transitions like never before: examine all details, reveal, debug, and optimize! | ||
Of course there will be further additions if required. Please contact me if you are missing something. | ||
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) | ||
#### Friendly Neighbor List | ||
> The Friendly Neighbor List of the Starlight support keeps growing. Now features: | ||
- starlight-image-zoom | ||
- starlight-utils | ||
- starlight-blog | ||
- starlight-docsearch | ||
### Automatically Name Selected Elements for Additional Morph Effects | ||
> The Bag features a new component to declaratively assign view transition names to selected elements: `<AutoNameSelected/>`. [This component](https://events-3bg.pages.dev/library/AutoNameSelected/) provides for a lot of fun as can be seen in the [image gallery demo](https://events-3bg.pages.dev/image-gallery/). | ||
## Recently Learned Tricks ## | ||
@@ -42,12 +27,3 @@ | ||
The selection of optional Starlight components keeps growing: | ||
> Ever wished clicking on Starlight's _previous page_ and _next page_ links would slide content from the left respectively from the right? Now you can enable `<PageOrder />` on Starlight sites. This automatically alters the _direction_ of the view transition. Visit a page further down the sidebar and get a _forward_ navigation, visit a page further up, and you get a _back_ navigation. | ||
> Eliminate the Pseudo-Scrolling of the Main Section: With [`<PageOffset />`](https://events-3bg.pages.dev/library/PageOffset/), The Bag offers a simple to use component that eliminates pseudo scrolling effects induced by morph transitions on elements that are larger than the viewport. Especially useful to get a smooth and neat transition animation for your main content. | ||
## Reusable Components ๐งฉ | ||
@@ -54,0 +30,0 @@ |
126516
68
1421
1
93
+ Added@vtbag/inspection-chamber@1.0.21(transitive)