Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/format-display-mod.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@tanstack/hotkeys': patch
---

`formatForDisplay` and `formatForAria` accept `Mod` on its own again, such as `formatForDisplay('Mod')`. It already formatted as `⌘` on macOS and `Ctrl` elsewhere, but since 0.20 the types rejected it.
5 changes: 5 additions & 0 deletions .changeset/recorder-shift-symbols.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@tanstack/hotkeys': minor
---

The recorder no longer records `Shift` with a symbol, such as `Shift+?` or `Mod+Shift+/`, which the types now reject. `recordBy: 'auto'` and `recordBy: 'key'` record the symbol alone when it fires on the press: Shift+/ records `?`, and Ctrl+Shift+/ records `Mod+?`. When the symbol alone wouldn't fire, or could also fire without Shift, as with macOS Command off the key's US position or a numpad operator, they record the key's physical code instead: Dvorak Cmd+Shift+/ records `Mod+Shift+[BracketLeft]`, and Cmd+Shift+, records `Mod+Shift+[Comma]`. A symbol that macOS reports with Command only when Shift typed it, such as `?`, is kept: French Cmd+Shift on the `?` key records `Mod+?`. Hotkeys recorded before this change still match as before.
12 changes: 12 additions & 0 deletions .changeset/shift-symbol-types.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
'@tanstack/hotkeys': minor
---

Hotkey string types no longer accept `Shift` with a symbol, such as `Shift+/` or `Mod+Shift+/`. Which symbol Shift types depends on the keyboard layout: on a German keyboard, Shift+7 types `/` and fires a `Shift+/` binding meant for `?`. Write the symbol Shift types instead:

- `Shift+/` becomes `?`, and `Shift+;` becomes `:`.
- `Shift+?` becomes `?`, since Shift is already part of typing it.
- Other modifiers stay: `Control+Shift+/` becomes `Control+?`, and `Mod+Shift+/` becomes `Mod+?`.
- To bind a key by position, use its physical code, such as `Shift+[Slash]`.

`Shift` still goes with letters, digits, named keys, and physical codes, which the new `ShiftableKey` type lists, so `Shift+K`, `Shift+1`, `Shift+Tab`, and `Mod+Shift+[Slash]` are unchanged. Letters from registered key sets, such as `Shift+Ä`, and keys of custom key sets that no built-in set has, such as Arabic `ا`, also go with Shift. Only the types changed. A saved or untyped string such as `'Shift+/'` still matches at runtime as before.
5 changes: 5 additions & 0 deletions .changeset/symbol-key-types.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@tanstack/hotkeys': minor
---

Rename the `PunctuationKey` type to `SymbolKey`, and `NonPunctuationKey` to `NonSymbolKey`. The set includes symbols such as `+`, `=`, and `$` that aren't punctuation, and the docs call them symbols. Update any imports of the old names.
2 changes: 1 addition & 1 deletion .github/workflows/autofix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
with:
persist-credentials: false
- name: Setup Tools
uses: TanStack/config/.github/setup@ade00ae6d3b67af1e961e2fe9727e614c0399c5f # main
uses: TanStack/config/.github/setup@e3cc8e6ec57318842dd54ffba909c99357530f67 # v1.0.0
- name: Fix formatting
run: pnpm run format
- name: Regenerate docs
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/e2e-flaky.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
with:
persist-credentials: false
- name: Setup Tools
uses: TanStack/config/.github/setup@ade00ae6d3b67af1e961e2fe9727e614c0399c5f # main
uses: TanStack/config/.github/setup@e3cc8e6ec57318842dd54ffba909c99357530f67 # v1.0.0
- name: Install Browsers
run: pnpm --filter @tanstack/hotkeys-e2e exec playwright install --with-deps chromium firefox webkit
- name: Run Browser Tests
Expand All @@ -40,7 +40,7 @@ jobs:
with:
persist-credentials: false
- name: Setup Tools
uses: TanStack/config/.github/setup@ade00ae6d3b67af1e961e2fe9727e614c0399c5f # main
uses: TanStack/config/.github/setup@e3cc8e6ec57318842dd54ffba909c99357530f67 # v1.0.0
- name: Install X11 Tools
run: |
sudo apt-get update
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/e2e-platforms.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
with:
persist-credentials: false
- name: Setup Tools
uses: TanStack/config/.github/setup@ade00ae6d3b67af1e961e2fe9727e614c0399c5f # main
uses: TanStack/config/.github/setup@e3cc8e6ec57318842dd54ffba909c99357530f67 # v1.0.0
- name: Install Browsers
run: pnpm --filter @tanstack/hotkeys-e2e exec playwright install chromium firefox webkit
# WebKit on macOS is much closer to Safari than WebKit on Linux.
Expand All @@ -40,7 +40,7 @@ jobs:
with:
persist-credentials: false
- name: Setup Tools
uses: TanStack/config/.github/setup@ade00ae6d3b67af1e961e2fe9727e614c0399c5f # main
uses: TanStack/config/.github/setup@e3cc8e6ec57318842dd54ffba909c99357530f67 # v1.0.0
# Edge comes with the runner image.
- name: Install Browsers
run: pnpm --filter @tanstack/hotkeys-e2e exec playwright install chromium firefox
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
with:
persist-credentials: false
- name: Setup Tools
uses: TanStack/config/.github/setup@ade00ae6d3b67af1e961e2fe9727e614c0399c5f # main
uses: TanStack/config/.github/setup@e3cc8e6ec57318842dd54ffba909c99357530f67 # v1.0.0
- name: Install Browsers
run: pnpm --filter @tanstack/hotkeys-e2e exec playwright install --with-deps chromium firefox webkit
- name: Run Browser Tests
Expand All @@ -37,7 +37,7 @@ jobs:
with:
persist-credentials: false
- name: Setup Tools
uses: TanStack/config/.github/setup@ade00ae6d3b67af1e961e2fe9727e614c0399c5f # main
uses: TanStack/config/.github/setup@e3cc8e6ec57318842dd54ffba909c99357530f67 # v1.0.0
- name: Install Browsers
run: pnpm --filter @tanstack/hotkeys-e2e exec playwright install --with-deps chromium firefox webkit
- name: Run Adapter Tests
Expand All @@ -52,7 +52,7 @@ jobs:
with:
persist-credentials: false
- name: Setup Tools
uses: TanStack/config/.github/setup@ade00ae6d3b67af1e961e2fe9727e614c0399c5f # main
uses: TanStack/config/.github/setup@e3cc8e6ec57318842dd54ffba909c99357530f67 # v1.0.0
- name: Install X11 Tools
run: |
sudo apt-get update
Expand All @@ -72,7 +72,7 @@ jobs:
with:
persist-credentials: false
- name: Setup Tools
uses: TanStack/config/.github/setup@ade00ae6d3b67af1e961e2fe9727e614c0399c5f # main
uses: TanStack/config/.github/setup@e3cc8e6ec57318842dd54ffba909c99357530f67 # v1.0.0
- name: Install Browsers
run: pnpm --filter @tanstack/hotkeys-e2e exec playwright install --with-deps chromium
- name: Run Server Rendering Tests
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ember-compat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
with:
persist-credentials: false
- name: Setup Tools
uses: TanStack/config/.github/setup@ade00ae6d3b67af1e961e2fe9727e614c0399c5f # main
uses: TanStack/config/.github/setup@e3cc8e6ec57318842dd54ffba909c99357530f67 # v1.0.0
# Chrome comes with the runner image.
- name: Run Probe App
run: pnpm test:e2e:ember-compat "~${EMBER_VERSION}.0"
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
with:
persist-credentials: false
- name: Setup Tools
uses: TanStack/config/.github/setup@ade00ae6d3b67af1e961e2fe9727e614c0399c5f # main
uses: TanStack/config/.github/setup@e3cc8e6ec57318842dd54ffba909c99357530f67 # v1.0.0
- name: Install Browsers
run: pnpm --filter @tanstack/hotkeys-e2e exec playwright install chromium firefox
- name: Add Keyboard Layouts
Expand Down Expand Up @@ -63,7 +63,7 @@ jobs:
with:
persist-credentials: false
- name: Setup Tools
uses: TanStack/config/.github/setup@ade00ae6d3b67af1e961e2fe9727e614c0399c5f # main
uses: TanStack/config/.github/setup@e3cc8e6ec57318842dd54ffba909c99357530f67 # v1.0.0
- name: Install Wayland Tools
run: |
sudo apt-get update
Expand Down Expand Up @@ -95,7 +95,7 @@ jobs:
with:
persist-credentials: false
- name: Setup Tools
uses: TanStack/config/.github/setup@ade00ae6d3b67af1e961e2fe9727e614c0399c5f # main
uses: TanStack/config/.github/setup@e3cc8e6ec57318842dd54ffba909c99357530f67 # v1.0.0
- name: Install X11 and ibus
run: |
sudo apt-get update
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
fetch-depth: 0
persist-credentials: false
- name: Setup Tools
uses: TanStack/config/.github/setup@ade00ae6d3b67af1e961e2fe9727e614c0399c5f # main
uses: TanStack/config/.github/setup@e3cc8e6ec57318842dd54ffba909c99357530f67 # v1.0.0
- name: Get base and head commits for `nx affected`
uses: nrwl/nx-set-shas@e602fada7ad5987b0f7b1905e7a99ea1c661514c # v5.1.0
with:
Expand All @@ -40,7 +40,7 @@ jobs:
with:
persist-credentials: false
- name: Setup Tools
uses: TanStack/config/.github/setup@ade00ae6d3b67af1e961e2fe9727e614c0399c5f # main
uses: TanStack/config/.github/setup@e3cc8e6ec57318842dd54ffba909c99357530f67 # v1.0.0
- name: Build Packages
run: pnpm run build:all
- name: Publish Previews
Expand All @@ -57,6 +57,6 @@ jobs:
with:
persist-credentials: false
- name: Setup Tools
uses: TanStack/config/.github/setup@ade00ae6d3b67af1e961e2fe9727e614c0399c5f # main
uses: TanStack/config/.github/setup@e3cc8e6ec57318842dd54ffba909c99357530f67 # v1.0.0
- name: Changeset Preview
uses: TanStack/config/.github/changeset-preview@ade00ae6d3b67af1e961e2fe9727e614c0399c5f # main
uses: TanStack/config/.github/changeset-preview@e3cc8e6ec57318842dd54ffba909c99357530f67 # v1.0.0
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
fetch-depth: 0
persist-credentials: false
- name: Setup Tools
uses: TanStack/config/.github/setup@ade00ae6d3b67af1e961e2fe9727e614c0399c5f # main
uses: TanStack/config/.github/setup@e3cc8e6ec57318842dd54ffba909c99357530f67 # v1.0.0
- name: Run Tests
run: pnpm run test:ci
- name: Run Changesets (version or publish)
Expand All @@ -42,6 +42,6 @@ jobs:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Comment on PRs about release
if: steps.changesets.outputs.published == 'true'
uses: TanStack/config/.github/comment-on-release@ade00ae6d3b67af1e961e2fe9727e614c0399c5f # main
uses: TanStack/config/.github/comment-on-release@e3cc8e6ec57318842dd54ffba909c99357530f67 # v1.0.0
with:
published-packages: ${{ steps.changesets.outputs.published-packages }}
Loading
Loading