@classic-homes/theme-svelte 1.24.1 → 1.24.2

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.
@@ -102,6 +102,16 @@
102
102
  let inputRef: HTMLInputElement | undefined = $state();
103
103
  let debounceTimer: ReturnType<typeof setTimeout> | null = null;
104
104
 
105
+ // The shortcut hint names the platform's modifier. The server cannot know the
106
+ // platform, so it renders "Ctrl" and Apple devices switch to ⌘ once mounted.
107
+ let modifierKey = $state('Ctrl');
108
+ $effect(() => {
109
+ const platform =
110
+ (navigator as Navigator & { userAgentData?: { platform?: string } }).userAgentData
111
+ ?.platform || navigator.platform;
112
+ if (/mac|iphone|ipad|ipod/i.test(platform)) modifierKey = '⌘';
113
+ });
114
+
105
115
  function isGrouped(
106
116
  value: SearchResultItem[] | SearchResultGroup[]
107
117
  ): value is SearchResultGroup[] {
@@ -228,7 +238,7 @@
228
238
  className
229
239
  )}
230
240
  aria-label="Search"
231
- title={enableShortcut ? `Search (⌘/${shortcutKey.toUpperCase()})` : 'Search'}
241
+ title={enableShortcut ? `Search (${modifierKey}+${shortcutKey.toUpperCase()})` : 'Search'}
232
242
  >
233
243
  <svg class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
234
244
  <path
@@ -264,7 +274,7 @@
264
274
  <kbd
265
275
  class="pointer-events-none hidden h-5 select-none items-center gap-1 rounded border bg-muted px-1.5 font-mono text-[10px] font-medium text-muted-foreground sm:inline-flex"
266
276
  >
267
- <span class="text-xs">⌘</span>{shortcutKey.toUpperCase()}
277
+ <span class="text-xs">{modifierKey}</span>{shortcutKey.toUpperCase()}
268
278
  </kbd>
269
279
  {/if}
270
280
  </button>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@classic-homes/theme-svelte",
3
- "version": "1.24.1",
3
+ "version": "1.24.2",
4
4
  "description": "Svelte components for the Classic theme system",
5
5
  "type": "module",
6
6
  "svelte": "./dist/lib/index.js",