From 5efdf5e457d531e50779ab969511a9b1bb1f9f10 Mon Sep 17 00:00:00 2001
From: Martin Trapp <94928215+martrapp@users.noreply.github.com>
Date: Wed, 25 Sep 2024 12:24:05 +0200
Subject: [PATCH] Signal (#194)
* new: turn-signal
* renaming and restructuring
* updates
* merge
* bumps
* update
---
.changeset/beige-chairs-shake.md | 5 +
README.md | 5 +-
components/TurnSignal.astro | 29 ++
components/TurnSignal.d.ts | 1 +
package-lock.json | 308 ++++++++++++++++++----
package.json | 11 +-
test/fixture/src/pages/signal/_nav.astro | 5 +
test/fixture/src/pages/signal/one.astro | 32 +++
test/fixture/src/pages/signal/three.astro | 1 +
test/fixture/src/pages/signal/two.astro | 1 +
test/vt-bot.spec.ts | 22 ++
11 files changed, 356 insertions(+), 64 deletions(-)
create mode 100644 .changeset/beige-chairs-shake.md
create mode 100644 components/TurnSignal.astro
create mode 100644 components/TurnSignal.d.ts
create mode 100644 test/fixture/src/pages/signal/_nav.astro
create mode 100644 test/fixture/src/pages/signal/one.astro
create mode 120000 test/fixture/src/pages/signal/three.astro
create mode 120000 test/fixture/src/pages/signal/two.astro
diff --git a/.changeset/beige-chairs-shake.md b/.changeset/beige-chairs-shake.md
new file mode 100644
index 0000000..d1be291
--- /dev/null
+++ b/.changeset/beige-chairs-shake.md
@@ -0,0 +1,5 @@
+---
+'astro-vtbot': minor
+---
+
+Introducing a new tool for your transition from `` to `@view-transitions {navigation: auto}`: The `` component enables seamless integration of forward and backward animations from `transition:animate` in cross-document transitions. Sync the direction of your animations with browser history navigation, or even with the page order of your site, if you prefer!
diff --git a/README.md b/README.md
index c05afb5..bf5b31c 100644
--- a/README.md
+++ b/README.md
@@ -15,10 +15,9 @@ A current deployment of tech demos and the documentation can be found at https:/
## !!! NEW TRICKS ✨ IN THE BAG 👜 !!!
+New component for cross-document view transitions: The `` enables Astro's forward/backward animations provided by `transition:animate` to work with native cross-document `@view-transition{}`. Slide right and left as you traverse the browser's history! Optionally you can configure the component with a total order of your site's pages, allowing it to automatically detect the transition direction.
-Bug fix for the Linter and an update of the InspectionChamber!
-
-For details, see the [CHANGELOG of the Bag](https://github.com/martrapp/astro-vtbot/blob/main/CHANGELOG.md) and of the [CHANGELOG of the InstructionChamber](https://github.com/vtbag/inspection-chamber/blob/main/CHANGELOG.md)
+For details, see the [CHANGELOG of the Bag](https://github.com/martrapp/astro-vtbot/blob/main/CHANGELOG.md) and of the [CHANGELOG of the InstructionChamber](https://github.com/vtbag/inspection-chamber/blob/main/CHANGELOG.md) for minor improvements regarding the Chamber.
## Recently Learned Tricks ##
diff --git a/components/TurnSignal.astro b/components/TurnSignal.astro
new file mode 100644
index 0000000..2c7fc42
--- /dev/null
+++ b/components/TurnSignal.astro
@@ -0,0 +1,29 @@
+---
+import signalURL from '@vtbag/turn-signal?url';
+import forcedTraversalURL from '@vtbag/turn-signal/forced-traversal?url';
+export interface Props {
+ selector?: string;
+ forcedTraversal?: boolean;
+ directionTypes?: string;
+ directionAttribute?: string;
+}
+
+const {
+ selector,
+ forcedTraversal,
+ directionTypes = '',
+ directionAttribute = 'data-astro-transition, back, forward, forward',
+} = Astro.props;
+---
+
+{forcedTraversal && }{
+ (
+
+ )
+}
diff --git a/components/TurnSignal.d.ts b/components/TurnSignal.d.ts
new file mode 100644
index 0000000..3e9f385
--- /dev/null
+++ b/components/TurnSignal.d.ts
@@ -0,0 +1 @@
+export default function TurnSignal(_props: import('./TurnSignal.astro').Props): any;
diff --git a/package-lock.json b/package-lock.json
index 9b83a93..32b9097 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,26 +1,27 @@
{
"name": "astro-vtbot",
- "version": "1.9.3",
+ "version": "1.9.4",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "astro-vtbot",
- "version": "1.9.3",
+ "version": "1.9.4",
"license": "ISC",
"dependencies": {
"@vtbag/element-crossing": "^1.0.1",
- "@vtbag/inspection-chamber": "^1.0.13"
+ "@vtbag/inspection-chamber": "^1.0.14",
+ "@vtbag/turn-signal": "^1.0.0"
},
"devDependencies": {
"@astrojs/check": "^0.9.3",
- "@astrojs/starlight": "^0.28.1",
+ "@astrojs/starlight": "^0.28.2",
"@changesets/changelog-github": "0.5.0",
"@changesets/cli": "^2.27.8",
- "@playwright/test": "^1.47.1",
+ "@playwright/test": "^1.47.2",
"@types/dom-view-transitions": "^1.0.5",
- "@types/node": "^22.5.5",
- "astro": "^4.15.8",
+ "@types/node": "^22.7.0",
+ "astro": "^4.15.9",
"prettier": "^3.3.3",
"prettier-plugin-astro": "^0.14.1",
"typescript": "^5.6.2"
@@ -204,9 +205,9 @@
}
},
"node_modules/@astrojs/starlight": {
- "version": "0.28.1",
- "resolved": "https://registry.npmjs.org/@astrojs/starlight/-/starlight-0.28.1.tgz",
- "integrity": "sha512-aEBy6k1w8L25lP+jV1WYvujxfigFxh10NFPxHCW76J695Xgw1jC1TVALbhkctIuCdIAmzUElpXfuOuOiARJf0g==",
+ "version": "0.28.2",
+ "resolved": "https://registry.npmjs.org/@astrojs/starlight/-/starlight-0.28.2.tgz",
+ "integrity": "sha512-Q1/Ujl2EzWX71qwqdt/0KP3wOyX6Rvyzcep/zD3hRCtw/Vi2TReh4Q2wLwz7mnbuYU9H7YvBKYknbkmjC+K/0w==",
"dev": true,
"dependencies": {
"@astrojs/mdx": "^3.1.3",
@@ -1588,9 +1589,10 @@
}
},
"node_modules/@oslojs/encoding": {
- "version": "0.4.1",
- "dev": true,
- "license": "MIT"
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/@oslojs/encoding/-/encoding-1.0.0.tgz",
+ "integrity": "sha512-dyIB0SdZgMm5BhGwdSp8rMxEFIopLKxDG1vxIBaiogyom6ZqH2aXPb6DEC2WzOOWKdPSq1cxdNeRx2wAn1Z+ZQ==",
+ "dev": true
},
"node_modules/@pagefind/darwin-arm64": {
"version": "1.1.1",
@@ -1664,12 +1666,12 @@
]
},
"node_modules/@playwright/test": {
- "version": "1.47.1",
- "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.47.1.tgz",
- "integrity": "sha512-dbWpcNQZ5nj16m+A5UNScYx7HX5trIy7g4phrcitn+Nk83S32EBX/CLU4hiF4RGKX/yRc93AAqtfaXB7JWBd4Q==",
+ "version": "1.47.2",
+ "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.47.2.tgz",
+ "integrity": "sha512-jTXRsoSPONAs8Za9QEQdyjFn+0ZQFjCiIztAIF6bi1HqhBzG9Ma7g1WotyiGqFSBRZjIEqMdT8RUlbk1QVhzCQ==",
"dev": true,
"dependencies": {
- "playwright": "1.47.1"
+ "playwright": "1.47.2"
},
"bin": {
"playwright": "cli.js"
@@ -1704,30 +1706,214 @@
"dev": true,
"license": "MIT"
},
+ "node_modules/@rollup/rollup-android-arm-eabi": {
+ "version": "4.22.4",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.22.4.tgz",
+ "integrity": "sha512-Fxamp4aEZnfPOcGA8KSNEohV8hX7zVHOemC8jVBoBUHu5zpJK/Eu3uJwt6BMgy9fkvzxDaurgj96F/NiLukF2w==",
+ "cpu": [
+ "arm"
+ ],
+ "dev": true,
+ "optional": true,
+ "os": [
+ "android"
+ ]
+ },
+ "node_modules/@rollup/rollup-android-arm64": {
+ "version": "4.22.4",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.22.4.tgz",
+ "integrity": "sha512-VXoK5UMrgECLYaMuGuVTOx5kcuap1Jm8g/M83RnCHBKOqvPPmROFJGQaZhGccnsFtfXQ3XYa4/jMCJvZnbJBdA==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "optional": true,
+ "os": [
+ "android"
+ ]
+ },
+ "node_modules/@rollup/rollup-darwin-arm64": {
+ "version": "4.22.4",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.22.4.tgz",
+ "integrity": "sha512-xMM9ORBqu81jyMKCDP+SZDhnX2QEVQzTcC6G18KlTQEzWK8r/oNZtKuZaCcHhnsa6fEeOBionoyl5JsAbE/36Q==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "optional": true,
+ "os": [
+ "darwin"
+ ]
+ },
+ "node_modules/@rollup/rollup-darwin-x64": {
+ "version": "4.22.4",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.22.4.tgz",
+ "integrity": "sha512-aJJyYKQwbHuhTUrjWjxEvGnNNBCnmpHDvrb8JFDbeSH3m2XdHcxDd3jthAzvmoI8w/kSjd2y0udT+4okADsZIw==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "optional": true,
+ "os": [
+ "darwin"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-arm-gnueabihf": {
+ "version": "4.22.4",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.22.4.tgz",
+ "integrity": "sha512-j63YtCIRAzbO+gC2L9dWXRh5BFetsv0j0va0Wi9epXDgU/XUi5dJKo4USTttVyK7fGw2nPWK0PbAvyliz50SCQ==",
+ "cpu": [
+ "arm"
+ ],
+ "dev": true,
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-arm-musleabihf": {
+ "version": "4.22.4",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.22.4.tgz",
+ "integrity": "sha512-dJnWUgwWBX1YBRsuKKMOlXCzh2Wu1mlHzv20TpqEsfdZLb3WoJW2kIEsGwLkroYf24IrPAvOT/ZQ2OYMV6vlrg==",
+ "cpu": [
+ "arm"
+ ],
+ "dev": true,
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-arm64-gnu": {
+ "version": "4.22.4",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.22.4.tgz",
+ "integrity": "sha512-AdPRoNi3NKVLolCN/Sp4F4N1d98c4SBnHMKoLuiG6RXgoZ4sllseuGioszumnPGmPM2O7qaAX/IJdeDU8f26Aw==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-arm64-musl": {
+ "version": "4.22.4",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.22.4.tgz",
+ "integrity": "sha512-Gl0AxBtDg8uoAn5CCqQDMqAx22Wx22pjDOjBdmG0VIWX3qUBHzYmOKh8KXHL4UpogfJ14G4wk16EQogF+v8hmA==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-powerpc64le-gnu": {
+ "version": "4.22.4",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.22.4.tgz",
+ "integrity": "sha512-3aVCK9xfWW1oGQpTsYJJPF6bfpWfhbRnhdlyhak2ZiyFLDaayz0EP5j9V1RVLAAxlmWKTDfS9wyRyY3hvhPoOg==",
+ "cpu": [
+ "ppc64"
+ ],
+ "dev": true,
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-riscv64-gnu": {
+ "version": "4.22.4",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.22.4.tgz",
+ "integrity": "sha512-ePYIir6VYnhgv2C5Xe9u+ico4t8sZWXschR6fMgoPUK31yQu7hTEJb7bCqivHECwIClJfKgE7zYsh1qTP3WHUA==",
+ "cpu": [
+ "riscv64"
+ ],
+ "dev": true,
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-s390x-gnu": {
+ "version": "4.22.4",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.22.4.tgz",
+ "integrity": "sha512-GqFJ9wLlbB9daxhVlrTe61vJtEY99/xB3C8e4ULVsVfflcpmR6c8UZXjtkMA6FhNONhj2eA5Tk9uAVw5orEs4Q==",
+ "cpu": [
+ "s390x"
+ ],
+ "dev": true,
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
"node_modules/@rollup/rollup-linux-x64-gnu": {
- "version": "4.20.0",
+ "version": "4.22.4",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.22.4.tgz",
+ "integrity": "sha512-87v0ol2sH9GE3cLQLNEy0K/R0pz1nvg76o8M5nhMR0+Q+BBGLnb35P0fVz4CQxHYXaAOhE8HhlkaZfsdUOlHwg==",
"cpu": [
"x64"
],
"dev": true,
- "license": "MIT",
"optional": true,
"os": [
"linux"
]
},
"node_modules/@rollup/rollup-linux-x64-musl": {
- "version": "4.20.0",
+ "version": "4.22.4",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.22.4.tgz",
+ "integrity": "sha512-UV6FZMUgePDZrFjrNGIWzDo/vABebuXBhJEqrHxrGiU6HikPy0Z3LfdtciIttEUQfuDdCn8fqh7wiFJjCNwO+g==",
"cpu": [
"x64"
],
"dev": true,
- "license": "MIT",
"optional": true,
"os": [
"linux"
]
},
+ "node_modules/@rollup/rollup-win32-arm64-msvc": {
+ "version": "4.22.4",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.22.4.tgz",
+ "integrity": "sha512-BjI+NVVEGAXjGWYHz/vv0pBqfGoUH0IGZ0cICTn7kB9PyjrATSkX+8WkguNjWoj2qSr1im/+tTGRaY+4/PdcQw==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "optional": true,
+ "os": [
+ "win32"
+ ]
+ },
+ "node_modules/@rollup/rollup-win32-ia32-msvc": {
+ "version": "4.22.4",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.22.4.tgz",
+ "integrity": "sha512-SiWG/1TuUdPvYmzmYnmd3IEifzR61Tragkbx9D3+R8mzQqDBz8v+BvZNDlkiTtI9T15KYZhP0ehn3Dld4n9J5g==",
+ "cpu": [
+ "ia32"
+ ],
+ "dev": true,
+ "optional": true,
+ "os": [
+ "win32"
+ ]
+ },
+ "node_modules/@rollup/rollup-win32-x64-msvc": {
+ "version": "4.22.4",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.22.4.tgz",
+ "integrity": "sha512-j8pPKp53/lq9lMXN57S8cFz0MynJk8OWNuUnXct/9KCpKU7DgU3bYMJhwWmcqC0UU29p8Lr0/7KEVcaM6bf47Q==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "optional": true,
+ "os": [
+ "win32"
+ ]
+ },
"node_modules/@shikijs/core": {
"version": "1.17.5",
"resolved": "https://registry.npmjs.org/@shikijs/core/-/core-1.17.5.tgz",
@@ -1889,9 +2075,9 @@
}
},
"node_modules/@types/node": {
- "version": "22.5.5",
- "resolved": "https://registry.npmjs.org/@types/node/-/node-22.5.5.tgz",
- "integrity": "sha512-Xjs4y5UPO/CLdzpgR6GirZJx36yScjh73+2NlLlkFRSoQN8B0DpfXPdZGnvVmLRLOsqDpOfTNv7D9trgGhmOIA==",
+ "version": "22.7.0",
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-22.7.0.tgz",
+ "integrity": "sha512-MOdOibwBs6KW1vfqz2uKMlxq5xAfAZ98SZjO8e3XnAbFnTJtAspqhWk7hrdSAs9/Y14ZWMiy7/MxMUzAOadYEw==",
"dev": true,
"dependencies": {
"undici-types": "~6.19.2"
@@ -2017,9 +2203,18 @@
}
},
"node_modules/@vtbag/inspection-chamber": {
- "version": "1.0.13",
- "resolved": "https://registry.npmjs.org/@vtbag/inspection-chamber/-/inspection-chamber-1.0.13.tgz",
- "integrity": "sha512-TEj8D405pT0uqtvxvTsGDPYe/gYbxs+gXFm63cdw3KV9jOlZiVRhNoDXtl/KGQSSNjk+M6Y03Dq9IlzSppBNKg==",
+ "version": "1.0.14",
+ "resolved": "https://registry.npmjs.org/@vtbag/inspection-chamber/-/inspection-chamber-1.0.14.tgz",
+ "integrity": "sha512-YZJFgj/5q/7CnC2DQcHYgkxeuQSrkOEILthuKELm6q0R/3AlTO13W/lF0a2wwkH9KsFloiJA+W98RZf7HrqwuQ==",
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/martrapp"
+ }
+ },
+ "node_modules/@vtbag/turn-signal": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/@vtbag/turn-signal/-/turn-signal-1.0.0.tgz",
+ "integrity": "sha512-WdS0lQfbWmFczEkReiNAcfsCcw5v+maZXQ/WdE71RWpQnaxH4KNfMf5+yTgAyvOCOeK1bayd+l+oC4X+Rq/W5w==",
"funding": {
"type": "github",
"url": "https://github.com/sponsors/martrapp"
@@ -2194,9 +2389,9 @@
}
},
"node_modules/astro": {
- "version": "4.15.8",
- "resolved": "https://registry.npmjs.org/astro/-/astro-4.15.8.tgz",
- "integrity": "sha512-pdXjtRF6O1xChiPAUF32R7oVRTW7AK1/Oy/JqPNhLfbelO0l6C7cLdSEuSLektwOEnMhOVXqccetjBs7HPaoxA==",
+ "version": "4.15.9",
+ "resolved": "https://registry.npmjs.org/astro/-/astro-4.15.9.tgz",
+ "integrity": "sha512-51oXq9qrZ5OPWYmEXt1kGrvWmVeWsx28SgBTzi2XW6iwcnW/wC5ONm6ol6qBGSCF93tQvZplXvuzpaw1injECA==",
"dev": true,
"dependencies": {
"@astrojs/compiler": "^2.10.3",
@@ -2206,7 +2401,7 @@
"@babel/core": "^7.25.2",
"@babel/plugin-transform-react-jsx": "^7.25.2",
"@babel/types": "^7.25.6",
- "@oslojs/encoding": "^0.4.1",
+ "@oslojs/encoding": "^1.0.0",
"@rollup/pluginutils": "^5.1.0",
"@types/babel__core": "^7.20.5",
"@types/cookie": "^0.6.0",
@@ -5855,12 +6050,12 @@
}
},
"node_modules/playwright": {
- "version": "1.47.1",
- "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.47.1.tgz",
- "integrity": "sha512-SUEKi6947IqYbKxRiqnbUobVZY4bF1uu+ZnZNJX9DfU1tlf2UhWfvVjLf01pQx9URsOr18bFVUKXmanYWhbfkw==",
+ "version": "1.47.2",
+ "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.47.2.tgz",
+ "integrity": "sha512-nx1cLMmQWqmA3UsnjaaokyoUpdVaaDhJhMoxX2qj3McpjnsqFHs516QAKYhqHAgOP+oCFTEOCOAaD1RgD/RQfA==",
"dev": true,
"dependencies": {
- "playwright-core": "1.47.1"
+ "playwright-core": "1.47.2"
},
"bin": {
"playwright": "cli.js"
@@ -5873,9 +6068,9 @@
}
},
"node_modules/playwright-core": {
- "version": "1.47.1",
- "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.47.1.tgz",
- "integrity": "sha512-i1iyJdLftqtt51mEk6AhYFaAJCDx0xQ/O5NU8EKaWFgMjItPVma542Nh/Aq8aLCjIJSzjaiEQGW/nyqLkGF1OQ==",
+ "version": "1.47.2",
+ "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.47.2.tgz",
+ "integrity": "sha512-3JvMfF+9LJfe16l7AbSmU555PaTl2tPyQsVInqm3id16pdDfvZ8TTZ/pyzmkbDrZTQefyzU7AIHlZqQnxpqHVQ==",
"dev": true,
"bin": {
"playwright-core": "cli.js"
@@ -6405,9 +6600,10 @@
}
},
"node_modules/rollup": {
- "version": "4.20.0",
+ "version": "4.22.4",
+ "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.22.4.tgz",
+ "integrity": "sha512-vD8HJ5raRcWOyymsR6Z3o6+RzfEPCnVLMFJ6vRslO1jt4LO6dUo5Qnpg7y4RkZFM2DMe3WUirkI5c16onjrc6A==",
"dev": true,
- "license": "MIT",
"dependencies": {
"@types/estree": "1.0.5"
},
@@ -6419,22 +6615,22 @@
"npm": ">=8.0.0"
},
"optionalDependencies": {
- "@rollup/rollup-android-arm-eabi": "4.20.0",
- "@rollup/rollup-android-arm64": "4.20.0",
- "@rollup/rollup-darwin-arm64": "4.20.0",
- "@rollup/rollup-darwin-x64": "4.20.0",
- "@rollup/rollup-linux-arm-gnueabihf": "4.20.0",
- "@rollup/rollup-linux-arm-musleabihf": "4.20.0",
- "@rollup/rollup-linux-arm64-gnu": "4.20.0",
- "@rollup/rollup-linux-arm64-musl": "4.20.0",
- "@rollup/rollup-linux-powerpc64le-gnu": "4.20.0",
- "@rollup/rollup-linux-riscv64-gnu": "4.20.0",
- "@rollup/rollup-linux-s390x-gnu": "4.20.0",
- "@rollup/rollup-linux-x64-gnu": "4.20.0",
- "@rollup/rollup-linux-x64-musl": "4.20.0",
- "@rollup/rollup-win32-arm64-msvc": "4.20.0",
- "@rollup/rollup-win32-ia32-msvc": "4.20.0",
- "@rollup/rollup-win32-x64-msvc": "4.20.0",
+ "@rollup/rollup-android-arm-eabi": "4.22.4",
+ "@rollup/rollup-android-arm64": "4.22.4",
+ "@rollup/rollup-darwin-arm64": "4.22.4",
+ "@rollup/rollup-darwin-x64": "4.22.4",
+ "@rollup/rollup-linux-arm-gnueabihf": "4.22.4",
+ "@rollup/rollup-linux-arm-musleabihf": "4.22.4",
+ "@rollup/rollup-linux-arm64-gnu": "4.22.4",
+ "@rollup/rollup-linux-arm64-musl": "4.22.4",
+ "@rollup/rollup-linux-powerpc64le-gnu": "4.22.4",
+ "@rollup/rollup-linux-riscv64-gnu": "4.22.4",
+ "@rollup/rollup-linux-s390x-gnu": "4.22.4",
+ "@rollup/rollup-linux-x64-gnu": "4.22.4",
+ "@rollup/rollup-linux-x64-musl": "4.22.4",
+ "@rollup/rollup-win32-arm64-msvc": "4.22.4",
+ "@rollup/rollup-win32-ia32-msvc": "4.22.4",
+ "@rollup/rollup-win32-x64-msvc": "4.22.4",
"fsevents": "~2.3.2"
}
},
diff --git a/package.json b/package.json
index b8bdd15..86e0750 100644
--- a/package.json
+++ b/package.json
@@ -76,17 +76,18 @@
},
"dependencies": {
"@vtbag/element-crossing": "^1.0.1",
- "@vtbag/inspection-chamber": "^1.0.13"
+ "@vtbag/inspection-chamber": "^1.0.14",
+ "@vtbag/turn-signal": "^1.0.0"
},
"devDependencies": {
"@astrojs/check": "^0.9.3",
- "@astrojs/starlight": "^0.28.1",
+ "@astrojs/starlight": "^0.28.2",
"@changesets/changelog-github": "0.5.0",
"@changesets/cli": "^2.27.8",
- "@playwright/test": "^1.47.1",
+ "@playwright/test": "^1.47.2",
"@types/dom-view-transitions": "^1.0.5",
- "@types/node": "^22.5.5",
- "astro": "^4.15.8",
+ "@types/node": "^22.7.0",
+ "astro": "^4.15.9",
"prettier": "^3.3.3",
"prettier-plugin-astro": "^0.14.1",
"typescript": "^5.6.2"
diff --git a/test/fixture/src/pages/signal/_nav.astro b/test/fixture/src/pages/signal/_nav.astro
new file mode 100644
index 0000000..efdba12
--- /dev/null
+++ b/test/fixture/src/pages/signal/_nav.astro
@@ -0,0 +1,5 @@
+
diff --git a/test/fixture/src/pages/signal/one.astro b/test/fixture/src/pages/signal/one.astro
new file mode 100644
index 0000000..25e8f35
--- /dev/null
+++ b/test/fixture/src/pages/signal/one.astro
@@ -0,0 +1,32 @@
+---
+import TurnSignal from 'astro-vtbot/components/TurnSignal.astro';
+import Nav from './_nav.astro';
+---
+
+
+
+
+
+ {Astro.url.pathname}
+
+
+ {Astro.url.pathname}
+
+
+
diff --git a/test/fixture/src/pages/signal/three.astro b/test/fixture/src/pages/signal/three.astro
new file mode 120000
index 0000000..b620c60
--- /dev/null
+++ b/test/fixture/src/pages/signal/three.astro
@@ -0,0 +1 @@
+one.astro
\ No newline at end of file
diff --git a/test/fixture/src/pages/signal/two.astro b/test/fixture/src/pages/signal/two.astro
new file mode 120000
index 0000000..b620c60
--- /dev/null
+++ b/test/fixture/src/pages/signal/two.astro
@@ -0,0 +1 @@
+one.astro
\ No newline at end of file
diff --git a/test/vt-bot.spec.ts b/test/vt-bot.spec.ts
index 4e4520e..f2b3fca 100644
--- a/test/vt-bot.spec.ts
+++ b/test/vt-bot.spec.ts
@@ -278,3 +278,25 @@ test.describe('Loading Indicator', () => {
expect(msgs.slice(0, 2).join('|')).toBe('test:loading|test:');
});
});
+test.describe('Turn-Signal', () => {
+ test('inserts forward and backward values', async ({ page }) => {
+ const msgs: string[] = [];
+ page.on('console', (msg) => msg.text().startsWith('test:') && msgs.push(msg.text()));
+ await page.goto('/signal/one/');
+ await expect(page).toHaveTitle('/signal/one/');
+ await page.click('text=Two');
+ await expect(page).toHaveTitle('/signal/two/');
+ await page.goBack();
+ await expect(page).toHaveTitle('/signal/one/');
+ await page.click('text=Three');
+ await expect(page).toHaveTitle('/signal/three/');
+ await page.click('text=Two');
+ await expect(page).toHaveTitle('/signal/two/');
+ await page.click('text=One');
+ await expect(page).toHaveTitle('/signal/one/');
+ await new Promise((resolve) => setTimeout(resolve, 500));
+ expect(msgs.join('|')).toBe(
+ 'test: forward|test: undefined|test: back|test: undefined|test: forward|test: undefined|test: back|test: undefined|test: back|test: undefined'
+ );
+ });
+});