@whiskeyjack-net/tauri 0.5.4 → 0.5.6
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.
- package/LICENSE +0 -0
- package/README.md +0 -0
- package/css/window-controls.css +0 -0
- package/dist/desktop.d.ts +0 -0
- package/dist/index.d.ts +0 -0
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/narrow-window-chrome.d.ts +0 -0
- package/dist/open-external.d.ts +0 -0
- package/dist/update-banner.d.ts +0 -0
- package/dist/update-dialog.d.ts +0 -0
- package/dist/updater.d.ts +0 -0
- package/dist/use-system-accent.d.ts +0 -0
- package/dist/use-window-drag.d.ts +0 -0
- package/dist/warn.d.ts +0 -0
- package/dist/window-controls.d.ts +0 -0
- package/package.json +2 -2
package/LICENSE
CHANGED
|
File without changes
|
package/README.md
CHANGED
|
File without changes
|
package/css/window-controls.css
CHANGED
|
File without changes
|
package/dist/desktop.d.ts
CHANGED
|
File without changes
|
package/dist/index.d.ts
CHANGED
|
File without changes
|
package/dist/index.js
CHANGED
|
@@ -414,7 +414,7 @@ function UpdateDialog({ updater, onClose }) {
|
|
|
414
414
|
/* @__PURE__ */ jsx4(ArrowSquareOut2, { size: 16, weight: "bold" }),
|
|
415
415
|
t("update.download")
|
|
416
416
|
] }),
|
|
417
|
-
/* @__PURE__ */ jsx4(Button2, { variant: "
|
|
417
|
+
/* @__PURE__ */ jsx4(Button2, { variant: "secondary", onClick: onClose, children: t("update.later") })
|
|
418
418
|
] })
|
|
419
419
|
] }),
|
|
420
420
|
state === "done" && result?.status === "up-to-date" && /* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
@@ -423,12 +423,12 @@ function UpdateDialog({ updater, onClose }) {
|
|
|
423
423
|
/* @__PURE__ */ jsx4("p", { className: "text-sm font-medium text-[var(--color-text-primary-light)] dark:text-[var(--color-text-primary-dark)]", children: t("update.upToDate") }),
|
|
424
424
|
/* @__PURE__ */ jsx4("p", { className: "text-xs text-[var(--color-text-muted-light)] dark:text-[var(--color-text-muted-dark)] mt-1", children: t("update.currentVersion", { version: currentVersion }) })
|
|
425
425
|
] }),
|
|
426
|
-
/* @__PURE__ */ jsx4(Button2, { variant: "
|
|
426
|
+
/* @__PURE__ */ jsx4(Button2, { variant: "secondary", onClick: onClose, children: t("common.cancel") })
|
|
427
427
|
] }),
|
|
428
428
|
state === "done" && result?.status === "error" && /* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
429
429
|
/* @__PURE__ */ jsx4(Warning, { size: 40, weight: "fill", className: "text-[var(--color-warning-500)]" }),
|
|
430
430
|
/* @__PURE__ */ jsx4("p", { className: "text-sm text-[var(--color-text-secondary-light)] dark:text-[var(--color-text-secondary-dark)]", children: t("update.error") }),
|
|
431
|
-
/* @__PURE__ */ jsx4(Button2, { variant: "
|
|
431
|
+
/* @__PURE__ */ jsx4(Button2, { variant: "secondary", onClick: onClose, children: t("common.cancel") })
|
|
432
432
|
] })
|
|
433
433
|
] });
|
|
434
434
|
}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/desktop.ts","../src/window-controls.tsx","../src/use-window-drag.ts","../src/warn.ts","../src/narrow-window-chrome.tsx","../src/use-system-accent.ts","../src/open-external.ts","../src/updater.ts","../src/update-banner.tsx","../src/update-dialog.tsx"],"sourcesContent":["// Tauri environment guards. `__TAURI_INTERNALS__` is present on mobile Tauri\n// too, so the desktop shell (window controls, CSD drag zone, OS-accent read)\n// must gate on DESKTOP explicitly -- otherwise its desktop-only CSS leaks onto\n// iOS/Android.\nexport const isTauri = (): boolean => '__TAURI_INTERNALS__' in window\n\n/**\n * Tauri mobile build (iOS/Android). iPads can report a \"Macintosh\" UA in\n * WKWebView, so the touch-point check keeps them off the macOS/desktop path.\n */\nexport const isMobileTauri = (): boolean =>\n isTauri() &&\n (/android|iphone|ipad|ipod/i.test(navigator.userAgent) ||\n (navigator.userAgent.includes('Mac') && navigator.maxTouchPoints > 1))\n\nexport const isDesktopTauri = (): boolean => isTauri() && !isMobileTauri()\n\n/** macOS desktop (draws OS traffic lights rather than custom window controls). */\nexport const isMacDesktop = (): boolean =>\n navigator.userAgent.includes('Mac') && !isMobileTauri()\n\n/**\n * Linux desktop -- the platform whose window is undecorated + `transparent`,\n * with rounded corners done purely in CSS (see `tauri-platform-linux` in\n * `use-system-accent.ts`). Anything that would make the canvas opaque has to\n * gate on this.\n *\n * Android's user agent also says \"Linux\", so `isMobileTauri()` has to be\n * excluded rather than assumed away.\n */\nexport const isLinuxDesktop = (): boolean =>\n navigator.userAgent.includes('Linux') && !isMobileTauri()\n","import { useState, useEffect } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport type { Window } from \"@tauri-apps/api/window\"\nimport { isTauri } from \"./desktop\"\n\n/**\n * Reads the per-side window-control button lists the backend detected (set as\n * `data-wc-left` / `data-wc-right` on <html> by useSystemAccent, comma-separated\n * close/minimize/maximize). Rendering the exact buttons per side lets the app\n * match the desktop's own convention (e.g. close-only on stock GNOME, the split\n * close:maximize on elementary, min/max/close on KDE/Windows).\n */\nfunction useWindowControls() {\n const [left, setLeft] = useState<string[]>([])\n const [right, setRight] = useState<string[]>([])\n const [windowMod, setWindowMod] = useState<typeof import('@tauri-apps/api/window') | null>(null)\n\n useEffect(() => {\n if (!isTauri()) return\n\n const parse = (v: string | null): string[] =>\n (v ?? '').split(',').map((s) => s.trim()).filter(Boolean)\n\n const read = () => {\n const root = document.documentElement\n setLeft(parse(root.getAttribute('data-wc-left')))\n setRight(parse(root.getAttribute('data-wc-right')))\n }\n\n read()\n // The attributes are set asynchronously after the backend responds.\n const observer = new MutationObserver(read)\n observer.observe(document.documentElement, {\n attributes: true,\n attributeFilter: ['data-wc-left', 'data-wc-right'],\n })\n return () => observer.disconnect()\n }, [])\n\n useEffect(() => {\n if (!isTauri()) return\n import('@tauri-apps/api/window').then(setWindowMod)\n }, [])\n\n return { left, right, windowMod }\n}\n\nfunction ControlButton({ kind, win }: { kind: string; win: Window }) {\n const { t } = useTranslation()\n switch (kind) {\n case 'close':\n return (\n <button\n onClick={() => win.close()}\n aria-label={t('window.close')}\n title={t('window.close')}\n className=\"window-control window-control-close\"\n >\n ✕\n </button>\n )\n case 'minimize':\n return (\n <button\n onClick={() => win.minimize()}\n aria-label={t('window.minimize')}\n title={t('window.minimize')}\n className=\"window-control\"\n >\n −\n </button>\n )\n case 'maximize':\n return (\n <button\n onClick={() => win.toggleMaximize()}\n aria-label={t('window.maximize')}\n title={t('window.maximize')}\n className=\"window-control\"\n >\n ▢\n </button>\n )\n default:\n return null\n }\n}\n\nexport function WindowControlsLeft() {\n const { left, windowMod } = useWindowControls()\n if (!windowMod || left.length === 0) return null\n const win = windowMod.getCurrentWindow()\n return (\n <div className=\"window-controls\">\n {left.map((kind) => (\n <ControlButton key={kind} kind={kind} win={win} />\n ))}\n </div>\n )\n}\n\nexport function WindowControlsRight() {\n const { right, windowMod } = useWindowControls()\n if (!windowMod || right.length === 0) return null\n const win = windowMod.getCurrentWindow()\n return (\n <div className=\"window-controls\">\n {right.map((kind) => (\n <ControlButton key={kind} kind={kind} win={win} />\n ))}\n </div>\n )\n}\n","import { useCallback, useEffect, type MouseEvent as ReactMouseEvent } from 'react'\nimport { isTauri, isMobileTauri } from './desktop'\nimport { isPermissionError, warnOnce } from './warn'\n\n/**\n * The window module, imported once and shared.\n *\n * Resolving the dynamic import inside the handler costs a frame or two on the\n * first drag, which reads as the window sticking before it moves. Warming it\n * on mount and reusing the promise removes that.\n */\nlet windowModule: Promise<typeof import('@tauri-apps/api/window')> | null = null\n\nfunction loadWindowModule() {\n windowModule ??= import('@tauri-apps/api/window')\n return windowModule\n}\n\n/**\n * Interactive descendants that must keep their click.\n *\n * `startDragging()` takes over the pointer, and the click that would have\n * followed never arrives -- so a header that drags from anywhere is a header\n * whose navigation does nothing. Anything focusable or role-bearing is excluded.\n */\nconst INTERACTIVE = 'a, button, input, select, textarea, nav, [role=\"tab\"], [role=\"button\"], [contenteditable]'\n\nexport interface WindowDragProps {\n onMouseDown: (event: ReactMouseEvent) => void\n}\n\n/**\n * Drag the window by an element, with the double-click zoom a title bar is\n * expected to have.\n *\n * Spread the result onto whatever should behave like a title bar:\n *\n * ```tsx\n * const drag = useWindowDrag()\n * <AppHeader {...drag}>…</AppHeader>\n * ```\n *\n * Inert outside Tauri desktop, so the same Layout serves the web build with no\n * branch at the call site.\n */\nexport function useWindowDrag(): WindowDragProps {\n useEffect(() => {\n if (!isTauri() || isMobileTauri()) return\n void loadWindowModule().catch(() => {})\n }, [])\n\n const onMouseDown = useCallback((event: ReactMouseEvent) => {\n if (!isTauri() || isMobileTauri()) return\n // Only the primary button drags; a right-click belongs to the context menu.\n if (event.button !== 0) return\n if ((event.target as HTMLElement | null)?.closest(INTERACTIVE)) return\n\n event.preventDefault()\n void loadWindowModule()\n .then(({ getCurrentWindow }) => {\n const win = getCurrentWindow()\n // Double-click zooms, which is the platform convention for a title bar\n // on macOS and Windows alike.\n const zoom = event.detail === 2\n return (zoom ? win.toggleMaximize() : win.startDragging()).catch((err: unknown) => {\n // Tauri refuses this call without the permission: `startDragging`\n // needs `core:window:allow-start-dragging`, which `core:default`\n // does NOT include, so a scaffolded app has a header that does\n // nothing and no hint anywhere as to why.\n const command = zoom ? 'toggle-maximize' : 'start-dragging'\n if (isPermissionError(err)) {\n warnOnce(\n `window-drag-${command}`,\n `dragging the window was refused. Add \\`core:window:allow-${command}\\` ` +\n `to src-tauri/capabilities/default.json -- \\`core:default\\` does not ` +\n `include it (see the package README).`,\n err,\n )\n } else {\n warnOnce(`window-drag-${command}`, `dragging the window failed.`, err)\n }\n })\n })\n .catch(() => {\n // The module itself would not load, which means this is not a Tauri\n // host after all. The gesture simply does nothing, correctly.\n })\n }, [])\n\n return { onMouseDown }\n}\n","const warned = new Set<string>()\n\n/** Vite-style consumers expose this; anything else stays quiet rather than guess. */\nfunction isDev(): boolean {\n try {\n return Boolean((import.meta as ImportMeta & { env?: { DEV?: boolean } }).env?.DEV)\n } catch {\n return false\n }\n}\n\n/**\n * Say what went wrong, once, in development.\n *\n * This pack sits on top of a Rust side it does not own: commands the app has to\n * register, and capabilities the app has to grant. Both fail as rejected\n * promises, and a bare `catch {}` around either produces the same thing -- a\n * window that is subtly wrong with nothing anywhere to explain it. Production\n * stays quiet, because these are developer configuration errors and a user\n * cannot act on them.\n */\nexport function warnOnce(key: string, message: string, err: unknown): void {\n if (warned.has(key) || !isDev()) return\n warned.add(key)\n console.warn(`[@whiskeyjack-net/tauri] ${message}`, err)\n}\n\n/**\n * Whether a rejection is Tauri refusing a call the app has not been granted.\n *\n * Tauri v2 gates each window command behind its own capability, and\n * `core:default` covers fewer of them than the name suggests -- `startDragging`\n * is not in it. The rejection says so plainly, so the distinction is worth\n * drawing: a missing capability is a one-line fix in `capabilities/`, while any\n * other failure is not.\n */\nexport function isPermissionError(err: unknown): boolean {\n return String(err).includes('not allowed')\n}\n","import { WindowControlsLeft, WindowControlsRight } from './window-controls'\nimport { useWindowDrag } from './use-window-drag'\n\n/**\n * Window chrome for a desktop window narrower than `md`.\n *\n * The DS `AppHeader` is `hidden md:block`, so a desktop window dragged below\n * 768px loses the header -- and with it the drag region and, on Windows and\n * Linux, the only way to close the window. Width is not a proxy for platform\n * once an app ships as a resizable window. This is the strip that stands in:\n * `WJ_NARROW_CHROME_PX` tall, pinned to the top, with the platform's controls\n * at the edges.\n *\n * Inert everywhere else: the strip is `display: none` until `useSystemAccent`\n * marks the document `.tauri-desktop`, and hidden again from 768px up. Render\n * it as a child of the app shell, above the header. All styling comes from\n * this package's `css/window-controls` stylesheet -- Tailwind utilities are\n * unusable here, because consumer content globs do not scan this package and\n * classes used only by it would never be generated.\n *\n * Pair it with the clearance -- `css/window-controls` reserves the same height\n * on the DS main scroller (`main[data-app-main]`) below `md`, so content starts\n * under the strip instead of behind it. On macOS the controls are the OS's own\n * and this component draws none, but the clearance is what keeps the traffic\n * lights off the first line of content.\n */\nexport function NarrowWindowChrome() {\n const drag = useWindowDrag()\n return (\n <div {...drag} className=\"tauri-drag-zone\">\n <div className=\"tauri-drag-zone-row\">\n <WindowControlsLeft />\n <div className=\"tauri-drag-zone-spacer\" />\n <WindowControlsRight />\n </div>\n </div>\n )\n}\n\n/**\n * The strip's height in px, matching `h-7` and the CSS clearance. Exported for\n * an app that has to clear it somewhere the stylesheet cannot reach (a sticky\n * element inside the scroller sticks to the scrollport, not the padding edge).\n */\nexport const WJ_NARROW_CHROME_PX = 28\n","import { useEffect } from 'react'\nimport { isTauri, isMobileTauri } from './desktop'\nimport { warnOnce } from './warn'\n\n/**\n * In Tauri desktop builds, fetch the system accent color and override\n * the design-system accent CSS variables so the app matches the OS theme.\n */\nexport function useSystemAccent() {\n useEffect(() => {\n if (!isTauri()) return\n // `__TAURI_INTERNALS__` is present on mobile Tauri too, so this hook -- the\n // window controls, the CSD drag zone, the OS-accent read, and the\n // `.tauri-desktop` marker class -- must gate on DESKTOP explicitly. Without\n // this, `.tauri-desktop` lands on iOS/Android and its desktop-only CSS (e.g.\n // the drag-zone tab-clearance padding) leaks onto mobile. Mobile accent is\n // handled in Layout.\n if (isMobileTauri()) return\n\n // Mark the document so CSS can target Tauri-specific styles\n document.documentElement.classList.add('tauri-desktop')\n\n // Add platform class for platform-specific control styling\n if (navigator.userAgent.includes('Windows')) {\n document.documentElement.classList.add('tauri-platform-windows')\n }\n\n // Linux desktop: the window is undecorated + transparent (decorations:false\n // + transparent:true in tauri.linux.conf.json) and its corners are rounded\n // entirely in CSS -- `.tauri-platform-linux #root` carries the border-radius\n // and clips to genuine window alpha (see index.css); no native GTK decoration\n // is involved. Mark the platform so that CSS applies, and track the maximized\n // state so the radius drops to 0 while maximized/tiled -- the app goes\n // edge-to-edge then, like every other windowed app (mobile Tauri is already\n // excluded above, so \"Linux\" here means desktop).\n let unlistenResized: (() => void) | undefined\n let disposed = false\n if (navigator.userAgent.includes('Linux')) {\n document.documentElement.classList.add('tauri-platform-linux')\n import('@tauri-apps/api/window').then(({ getCurrentWindow }) => {\n const win = getCurrentWindow()\n const syncMaximized = async () => {\n try {\n document.documentElement.classList.toggle(\n 'tauri-window-maximized',\n await win.isMaximized(),\n )\n } catch {\n // ignore -- corners just stay rounded\n }\n }\n syncMaximized()\n // onResized registers asynchronously; if the effect already tore down by\n // the time it resolves, unlisten immediately instead of leaking it.\n win.onResized(syncMaximized).then((unlisten) => {\n if (disposed) unlisten()\n else unlistenResized = unlisten\n })\n })\n }\n\n async function applyAccent() {\n try {\n const { invoke } = await import('@tauri-apps/api/core')\n const hex = await invoke<string | null>('get_system_accent_color')\n if (!hex) return\n\n const r = parseInt(hex.slice(1, 3), 16)\n const g = parseInt(hex.slice(3, 5), 16)\n const b = parseInt(hex.slice(5, 7), 16)\n\n const root = document.documentElement\n // Derive lighter/darker shades from the accent\n root.style.setProperty('--color-accent-50', adjustBrightness(r, g, b, 0.95))\n root.style.setProperty('--color-accent-100', adjustBrightness(r, g, b, 0.88))\n root.style.setProperty('--color-accent-400', adjustBrightness(r, g, b, 0.15))\n root.style.setProperty('--color-accent-500', hex)\n root.style.setProperty('--color-accent-600', adjustBrightness(r, g, b, -0.12))\n root.style.setProperty('--color-accent-700', adjustBrightness(r, g, b, -0.25))\n } catch (err) {\n // The theme accent is a fine outcome, so this one only needs saying in\n // development -- unlike the controls layout, nothing looks broken.\n warnOnce(\n 'get_system_accent_color',\n 'the command `get_system_accent_color` is not registered, so the app ' +\n 'keeps its theme accent instead of the OS one (see the package README).',\n err,\n )\n }\n }\n\n applyAccent()\n\n async function applyWindowControls() {\n let layout: WindowControlsLayout\n try {\n const { invoke } = await import('@tauri-apps/api/core')\n layout = await invoke<WindowControlsLayout>('get_window_controls_layout')\n } catch (err) {\n // The command is the app's to implement, and a scaffolded app has not\n // implemented it yet. Falling back to what the platform almost\n // certainly wants makes a fresh scaffold correct on macOS and Windows\n // with no Rust at all; only Linux, where the button layout is a\n // per-desktop setting, genuinely needs the command.\n layout = platformDefaultLayout()\n warnOnce(\n 'get_window_controls_layout',\n 'the command `get_window_controls_layout` is not registered, so window ' +\n 'controls fall back to the platform default. Implement it to read the ' +\n 'desktop’s own button layout (see the package README).',\n err,\n )\n }\n\n {\n const root = document.documentElement\n // Per-side button lists drive which controls WindowControls renders, in\n // order (matches the desktop's own convention -- see window_controls.rs).\n root.setAttribute('data-wc-left', layout.left.join(','))\n root.setAttribute('data-wc-right', layout.right.join(','))\n // The side class drives the action-pill clearance padding (index.css).\n root.classList.remove('tauri-controls-left', 'tauri-controls-right', 'tauri-controls-both', 'tauri-controls-native')\n const side = layout.native\n ? 'native'\n : layout.left.length && layout.right.length\n ? 'both'\n : layout.left.length\n ? 'left'\n : layout.right.length\n ? 'right'\n : null\n if (side) root.classList.add(`tauri-controls-${side}`)\n\n // Publish each side's control footprint (px from the window edge to the\n // controls' inner edge) so the CSS clears them CONTINUOUSLY (index.css)\n // rather than via fixed width breakpoints -- exact for any layout and\n // any platform. Sizes mirror .window-control: Windows controls are 46px\n // wide flush to the edge; the custom (Linux) controls are 28px with a 6px\n // gap, inset 16px (left-4/right-4).\n const isWindows = navigator.userAgent.includes('Windows')\n const footprint = (count: number): number =>\n count === 0 ? 0 : isWindows ? count * 46 : 16 + count * 28 + (count - 1) * 6\n if (layout.native) {\n // macOS draws OS traffic lights (the app renders no custom controls, so\n // both button lists are empty). They sit on the LEFT and never vary in\n // count, so publish a fixed 64px left footprint (+1rem gap = the 80px\n // clearance used before) and let macOS ride the SAME continuous formula\n // as Linux/Windows -- fluid clearance instead of a width breakpoint.\n root.style.setProperty('--wc-left-px', '64px')\n root.style.setProperty('--wc-right-px', '0px')\n } else {\n root.style.setProperty('--wc-left-px', `${footprint(layout.left.length)}px`)\n root.style.setProperty('--wc-right-px', `${footprint(layout.right.length)}px`)\n }\n }\n }\n\n applyWindowControls()\n\n return () => {\n disposed = true\n unlistenResized?.()\n }\n }, [])\n}\n\ninterface WindowControlsLayout {\n left: string[]\n right: string[]\n native: boolean\n}\n\n/**\n * What the platform almost certainly wants, for an app that has not implemented\n * `get_window_controls_layout`.\n *\n * macOS draws its own traffic lights in an overlay title bar, so the app draws\n * none and only reserves room. Windows and the Linux fallback take the\n * conventional right-hand set. Linux is the one platform where this is a guess\n * rather than a rule -- the button layout is a desktop setting, and reading it\n * needs the Rust command.\n */\nfunction platformDefaultLayout(): WindowControlsLayout {\n const ua = navigator.userAgent\n if (ua.includes('Mac')) return { left: [], right: [], native: true }\n return { left: [], right: ['minimize', 'maximize', 'close'], native: false }\n}\n\n/** Lighten (positive amount) or darken (negative amount) an RGB color. */\nfunction adjustBrightness(r: number, g: number, b: number, amount: number): string {\n const adjust = (c: number) => {\n if (amount > 0) {\n // Lighten: blend toward white\n return Math.round(c + (255 - c) * amount)\n }\n // Darken: blend toward black\n return Math.round(c * (1 + amount))\n }\n\n const clamp = (v: number) => Math.max(0, Math.min(255, v))\n const rr = clamp(adjust(r))\n const gg = clamp(adjust(g))\n const bb = clamp(adjust(b))\n\n return `#${rr.toString(16).padStart(2, '0')}${gg.toString(16).padStart(2, '0')}${bb.toString(16).padStart(2, '0')}`\n}\n","/**\n * Open a URL outside the app: the system browser on Tauri (desktop and mobile,\n * via the opener plugin -- window.open is a no-op in the Tauri WebView), a new\n * tab on the web.\n *\n * Requires the `@tauri-apps/plugin-opener` peer plus its capability grant in the\n * Tauri app (`opener:allow-open-url`).\n */\nexport async function openExternal(url: string) {\n if ('__TAURI_INTERNALS__' in window) {\n const { openUrl } = await import('@tauri-apps/plugin-opener')\n await openUrl(url)\n } else {\n window.open(url, '_blank', 'noopener,noreferrer')\n }\n}\n","/**\n * Desktop in-app update checker for direct-download Tauri builds. Polls a\n * GitHub repo's releases, matches this app's tag prefix, compares semver\n * against the running version, and resolves the best installer asset for the\n * current platform. Store-distributed builds (App Store, Snap, ...) update\n * through the store and should never call this.\n */\n\nexport interface UpdateResult {\n status: 'update-available' | 'up-to-date' | 'error'\n latestVersion?: string\n releaseUrl?: string\n downloadUrl?: string\n}\n\nexport interface UpdaterConfig {\n /** GitHub `owner/repo` whose releases list is polled. */\n repo: string\n /** Tag prefix marking this app's releases, e.g. `chip-away-v`. */\n tagPrefix: string\n /**\n * Version used when the app is not running under Tauri (the web/PWA build,\n * where `@tauri-apps/api/app` is unavailable) -- typically the build-time\n * version constant. Under Tauri the real version comes from the runtime.\n */\n fallbackVersion: string\n /** Releases page size to fetch (default 10). */\n perPage?: number\n}\n\nexport interface Updater {\n /** The running app's version (Tauri runtime, else `fallbackVersion`). */\n getAppVersion(): Promise<string>\n /** Check the configured repo for a newer release. */\n checkForUpdates(): Promise<UpdateResult>\n}\n\ninterface GitHubAsset {\n name: string\n browser_download_url: string\n}\n\ninterface GitHubRelease {\n tag_name: string\n html_url: string\n draft: boolean\n assets: GitHubAsset[]\n}\n\n/** Compare two semver strings. Positive if a > b, negative if a < b, 0 if equal. */\nfunction compareSemver(a: string, b: string): number {\n const aParts = a.split('.').map(Number)\n const bParts = b.split('.').map(Number)\n const len = Math.max(aParts.length, bParts.length)\n\n for (let i = 0; i < len; i++) {\n const av = i < aParts.length ? aParts[i] : 0\n const bv = i < bParts.length ? bParts[i] : 0\n if (av !== bv) return av - bv\n }\n return 0\n}\n\n/** Find the best download URL for the current platform. */\nfunction getDownloadUrlForPlatform(assets: GitHubAsset[]): string | undefined {\n const ua = navigator.userAgent.toLowerCase()\n let patterns: string[]\n\n if (ua.includes('mac')) {\n patterns = ['.dmg']\n } else if (ua.includes('win')) {\n patterns = ['.msi', '-setup.exe', '.exe']\n } else {\n patterns = ['.appimage', '.deb']\n }\n\n for (const pattern of patterns) {\n const match = assets.find((a) => a.name.toLowerCase().endsWith(pattern))\n if (match) return match.browser_download_url\n }\n return undefined\n}\n\n/**\n * Build an updater bound to one app's release config. Give it the app's repo,\n * tag prefix, and build-time version:\n *\n * ```ts\n * export const updater = createUpdater({\n * repo: 'whiskeyjack-net/downloads',\n * tagPrefix: 'chip-away-v',\n * fallbackVersion: __APP_VERSION__,\n * })\n * ```\n */\nexport function createUpdater(config: UpdaterConfig): Updater {\n const releasesUrl = `https://api.github.com/repos/${config.repo}/releases?per_page=${config.perPage ?? 10}`\n\n async function getAppVersion(): Promise<string> {\n if ('__TAURI_INTERNALS__' in window) {\n try {\n const { getVersion } = await import('@tauri-apps/api/app')\n return await getVersion()\n } catch {\n // Fall through to the configured fallback.\n }\n }\n return config.fallbackVersion\n }\n\n async function checkForUpdates(): Promise<UpdateResult> {\n try {\n const response = await fetch(releasesUrl, {\n headers: { Accept: 'application/vnd.github+json' },\n signal: AbortSignal.timeout(15000),\n })\n\n if (!response.ok) return { status: 'error' }\n\n const releases: GitHubRelease[] = await response.json()\n\n // Latest release matching our tag prefix, skipping drafts.\n const matching = releases.filter(\n (r) => r.tag_name.startsWith(config.tagPrefix) && !r.draft,\n )\n\n if (matching.length === 0) return { status: 'up-to-date' }\n\n const latest = matching[0]\n const remoteVersion = latest.tag_name.slice(config.tagPrefix.length)\n const currentVersion = await getAppVersion()\n\n if (compareSemver(remoteVersion, currentVersion) > 0) {\n return {\n status: 'update-available',\n latestVersion: remoteVersion,\n releaseUrl: latest.html_url,\n downloadUrl: getDownloadUrlForPlatform(latest.assets) ?? latest.html_url,\n }\n }\n\n return { status: 'up-to-date' }\n } catch {\n return { status: 'error' }\n }\n }\n\n return { getAppVersion, checkForUpdates }\n}\n","import { useTranslation } from 'react-i18next'\nimport { ArrowSquareOut } from '@phosphor-icons/react'\nimport { Button, Toast } from '@whiskeyjack-net/design-system'\n\ninterface UpdateBannerProps {\n version: string\n releaseUrl: string\n onDismiss: () => void\n}\n\n/**\n * \"Update available\" notification for the desktop build. A persistent DS\n * Toast (floating below the header) with a download action and a dismiss\n * button -- the caller unmounts it on dismiss, so `open` is always true.\n *\n * Requires the app's locales to define `update.available` (interpolates\n * `{{version}}`), `update.download`, and `update.later`.\n */\nexport function UpdateBanner({ version, releaseUrl, onDismiss }: UpdateBannerProps) {\n const { t } = useTranslation()\n\n return (\n <Toast\n open\n icon={<ArrowSquareOut size={16} weight=\"bold\" className=\"text-[var(--color-accent-500)]\" />}\n onDismiss={onDismiss}\n dismissLabel={t('update.later')}\n action={\n <a href={releaseUrl} target=\"_blank\" rel=\"noopener noreferrer\" className=\"shrink-0\">\n <Button variant=\"accent\">{t('update.download')}</Button>\n </a>\n }\n >\n {t('update.available', { version })}\n </Toast>\n )\n}\n","import { useState, useCallback } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport { ArrowSquareOut, ArrowsClockwise, CheckCircle, Warning } from '@phosphor-icons/react'\nimport { Button } from '@whiskeyjack-net/design-system'\nimport { openExternal } from './open-external'\nimport type { Updater, UpdateResult } from './updater'\n\ninterface UpdateDialogProps {\n /** The app's updater (from `createUpdater`); drives the check. */\n updater: Updater\n onClose: () => void\n}\n\n/**\n * \"Check for updates\" dialog body for the desktop build (mount inside a DS\n * BottomDrawer). Auto-runs the check on first render, then shows the result\n * with a download or up-to-date state.\n *\n * Requires the app's locales to define `update.checking`, `update.available`\n * (interpolates `{{version}}`), `update.currentVersion` (interpolates\n * `{{version}}`), `update.upToDate`, `update.download`, `update.later`,\n * `update.error`, and `common.cancel`.\n */\nexport function UpdateDialog({ updater, onClose }: UpdateDialogProps) {\n const { t } = useTranslation()\n const [state, setState] = useState<'idle' | 'checking' | 'done'>('idle')\n const [result, setResult] = useState<UpdateResult | null>(null)\n const [currentVersion, setCurrentVersion] = useState<string>('')\n\n const handleCheck = useCallback(async () => {\n setState('checking')\n const [version, updateResult] = await Promise.all([\n updater.getAppVersion(),\n updater.checkForUpdates(),\n ])\n setCurrentVersion(version)\n setResult(updateResult)\n setState('done')\n }, [updater])\n\n // Auto-trigger check on first render\n if (state === 'idle') {\n handleCheck()\n }\n\n return (\n <div className=\"flex flex-col items-center gap-4 py-2\">\n {state === 'checking' && (\n <>\n <ArrowsClockwise size={40} weight=\"bold\" className=\"text-[var(--color-accent-500)] animate-spin\" />\n <p className=\"text-sm text-[var(--color-text-secondary-light)] dark:text-[var(--color-text-secondary-dark)]\">\n {t('update.checking')}\n </p>\n </>\n )}\n\n {state === 'done' && result?.status === 'update-available' && (\n <>\n <ArrowsClockwise size={40} weight=\"bold\" className=\"text-[var(--color-accent-500)]\" />\n <div className=\"text-center\">\n <p className=\"text-sm font-medium text-[var(--color-text-primary-light)] dark:text-[var(--color-text-primary-dark)]\">\n {t('update.available', { version: result.latestVersion })}\n </p>\n <p className=\"text-xs text-[var(--color-text-muted-light)] dark:text-[var(--color-text-muted-dark)] mt-1\">\n {t('update.currentVersion', { version: currentVersion })}\n </p>\n </div>\n <div className=\"flex gap-3\">\n <Button variant=\"accent\" onClick={() => openExternal(result.downloadUrl || result.releaseUrl || '')}>\n <ArrowSquareOut size={16} weight=\"bold\" />\n {t('update.download')}\n </Button>\n <Button variant=\"outline\" onClick={onClose}>\n {t('update.later')}\n </Button>\n </div>\n </>\n )}\n\n {state === 'done' && result?.status === 'up-to-date' && (\n <>\n <CheckCircle size={40} weight=\"fill\" className=\"text-[var(--color-success-500)]\" />\n <div className=\"text-center\">\n <p className=\"text-sm font-medium text-[var(--color-text-primary-light)] dark:text-[var(--color-text-primary-dark)]\">\n {t('update.upToDate')}\n </p>\n <p className=\"text-xs text-[var(--color-text-muted-light)] dark:text-[var(--color-text-muted-dark)] mt-1\">\n {t('update.currentVersion', { version: currentVersion })}\n </p>\n </div>\n <Button variant=\"outline\" onClick={onClose}>\n {t('common.cancel')}\n </Button>\n </>\n )}\n\n {state === 'done' && result?.status === 'error' && (\n <>\n <Warning size={40} weight=\"fill\" className=\"text-[var(--color-warning-500)]\" />\n <p className=\"text-sm text-[var(--color-text-secondary-light)] dark:text-[var(--color-text-secondary-dark)]\">\n {t('update.error')}\n </p>\n <Button variant=\"outline\" onClick={onClose}>\n {t('common.cancel')}\n </Button>\n </>\n )}\n </div>\n )\n}\n"],"mappings":";AAIO,IAAM,UAAU,MAAe,yBAAyB;AAMxD,IAAM,gBAAgB,MAC3B,QAAQ,MACP,4BAA4B,KAAK,UAAU,SAAS,KAClD,UAAU,UAAU,SAAS,KAAK,KA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AAAA,OACF;AAAA,IAGD,UAAU,UAAU,QAAQ,WAAW,gBACtC,gBAAAJ,MAAA,YACE;AAAA,sBAAAD,KAAC,eAAY,MAAM,IAAI,QAAO,QAAO,WAAU,mCAAkC;AAAA,MACjF,gBAAAC,MAAC,SAAI,WAAU,eACb;AAAA,wBAAAD,KAAC,OAAE,WAAU,yGACV,YAAE,iBAAiB,GACtB;AAAA,QACA,gBAAAA,KAAC,OAAE,WAAU,8FACV,YAAE,yBAAyB,EAAE,SAAS,eAAe,CAAC,GACzD;AAAA,SACF;AAAA,MACA,gBAAAA,KAACK,SAAA,EAAO,SAAQ,WAAU,SAAS,SAChC,YAAE,eAAe,GACpB;AAAA,OACF;AAAA,IAGD,UAAU,UAAU,QAAQ,WAAW,WACtC,gBAAAJ,MAAA,YACE;AAAA,sBAAAD,KAAC,WAAQ,MAAM,IAAI,QAAO,QAAO,WAAU,mCAAkC;AAAA,MAC7E,gBAAAA,KAAC,OAAE,WAAU,iGACV,YAAE,cAAc,GACnB;AAAA,MACA,gBAAAA,KAACK,SAAA,EAAO,SAAQ,WAAU,SAAS,SAChC,YAAE,eAAe,GACpB;AAAA,OACF;AAAA,KAEJ;AAEJ;","names":["useEffect","useEffect","jsx","useEffect","useEffect","useTranslation","jsx","useState","useCallback","useTranslation","ArrowSquareOut","Button","jsx","jsxs","useTranslation","useState","useCallback","Button","ArrowSquareOut"]}
|
|
1
|
+
{"version":3,"sources":["../src/desktop.ts","../src/window-controls.tsx","../src/use-window-drag.ts","../src/warn.ts","../src/narrow-window-chrome.tsx","../src/use-system-accent.ts","../src/open-external.ts","../src/updater.ts","../src/update-banner.tsx","../src/update-dialog.tsx"],"sourcesContent":["// Tauri environment guards. `__TAURI_INTERNALS__` is present on mobile Tauri\n// too, so the desktop shell (window controls, CSD drag zone, OS-accent read)\n// must gate on DESKTOP explicitly -- otherwise its desktop-only CSS leaks onto\n// iOS/Android.\nexport const isTauri = (): boolean => '__TAURI_INTERNALS__' in window\n\n/**\n * Tauri mobile build (iOS/Android). iPads can report a \"Macintosh\" UA in\n * WKWebView, so the touch-point check keeps them off the macOS/desktop path.\n */\nexport const isMobileTauri = (): boolean =>\n isTauri() &&\n (/android|iphone|ipad|ipod/i.test(navigator.userAgent) ||\n (navigator.userAgent.includes('Mac') && navigator.maxTouchPoints > 1))\n\nexport const isDesktopTauri = (): boolean => isTauri() && !isMobileTauri()\n\n/** macOS desktop (draws OS traffic lights rather than custom window controls). */\nexport const isMacDesktop = (): boolean =>\n navigator.userAgent.includes('Mac') && !isMobileTauri()\n\n/**\n * Linux desktop -- the platform whose window is undecorated + `transparent`,\n * with rounded corners done purely in CSS (see `tauri-platform-linux` in\n * `use-system-accent.ts`). Anything that would make the canvas opaque has to\n * gate on this.\n *\n * Android's user agent also says \"Linux\", so `isMobileTauri()` has to be\n * excluded rather than assumed away.\n */\nexport const isLinuxDesktop = (): boolean =>\n navigator.userAgent.includes('Linux') && !isMobileTauri()\n","import { useState, useEffect } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport type { Window } from \"@tauri-apps/api/window\"\nimport { isTauri } from \"./desktop\"\n\n/**\n * Reads the per-side window-control button lists the backend detected (set as\n * `data-wc-left` / `data-wc-right` on <html> by useSystemAccent, comma-separated\n * close/minimize/maximize). Rendering the exact buttons per side lets the app\n * match the desktop's own convention (e.g. close-only on stock GNOME, the split\n * close:maximize on elementary, min/max/close on KDE/Windows).\n */\nfunction useWindowControls() {\n const [left, setLeft] = useState<string[]>([])\n const [right, setRight] = useState<string[]>([])\n const [windowMod, setWindowMod] = useState<typeof import('@tauri-apps/api/window') | null>(null)\n\n useEffect(() => {\n if (!isTauri()) return\n\n const parse = (v: string | null): string[] =>\n (v ?? '').split(',').map((s) => s.trim()).filter(Boolean)\n\n const read = () => {\n const root = document.documentElement\n setLeft(parse(root.getAttribute('data-wc-left')))\n setRight(parse(root.getAttribute('data-wc-right')))\n }\n\n read()\n // The attributes are set asynchronously after the backend responds.\n const observer = new MutationObserver(read)\n observer.observe(document.documentElement, {\n attributes: true,\n attributeFilter: ['data-wc-left', 'data-wc-right'],\n })\n return () => observer.disconnect()\n }, [])\n\n useEffect(() => {\n if (!isTauri()) return\n import('@tauri-apps/api/window').then(setWindowMod)\n }, [])\n\n return { left, right, windowMod }\n}\n\nfunction ControlButton({ kind, win }: { kind: string; win: Window }) {\n const { t } = useTranslation()\n switch (kind) {\n case 'close':\n return (\n <button\n onClick={() => win.close()}\n aria-label={t('window.close')}\n title={t('window.close')}\n className=\"window-control window-control-close\"\n >\n ✕\n </button>\n )\n case 'minimize':\n return (\n <button\n onClick={() => win.minimize()}\n aria-label={t('window.minimize')}\n title={t('window.minimize')}\n className=\"window-control\"\n >\n −\n </button>\n )\n case 'maximize':\n return (\n <button\n onClick={() => win.toggleMaximize()}\n aria-label={t('window.maximize')}\n title={t('window.maximize')}\n className=\"window-control\"\n >\n ▢\n </button>\n )\n default:\n return null\n }\n}\n\nexport function WindowControlsLeft() {\n const { left, windowMod } = useWindowControls()\n if (!windowMod || left.length === 0) return null\n const win = windowMod.getCurrentWindow()\n return (\n <div className=\"window-controls\">\n {left.map((kind) => (\n <ControlButton key={kind} kind={kind} win={win} />\n ))}\n </div>\n )\n}\n\nexport function WindowControlsRight() {\n const { right, windowMod } = useWindowControls()\n if (!windowMod || right.length === 0) return null\n const win = windowMod.getCurrentWindow()\n return (\n <div className=\"window-controls\">\n {right.map((kind) => (\n <ControlButton key={kind} kind={kind} win={win} />\n ))}\n </div>\n )\n}\n","import { useCallback, useEffect, type MouseEvent as ReactMouseEvent } from 'react'\nimport { isTauri, isMobileTauri } from './desktop'\nimport { isPermissionError, warnOnce } from './warn'\n\n/**\n * The window module, imported once and shared.\n *\n * Resolving the dynamic import inside the handler costs a frame or two on the\n * first drag, which reads as the window sticking before it moves. Warming it\n * on mount and reusing the promise removes that.\n */\nlet windowModule: Promise<typeof import('@tauri-apps/api/window')> | null = null\n\nfunction loadWindowModule() {\n windowModule ??= import('@tauri-apps/api/window')\n return windowModule\n}\n\n/**\n * Interactive descendants that must keep their click.\n *\n * `startDragging()` takes over the pointer, and the click that would have\n * followed never arrives -- so a header that drags from anywhere is a header\n * whose navigation does nothing. Anything focusable or role-bearing is excluded.\n */\nconst INTERACTIVE = 'a, button, input, select, textarea, nav, [role=\"tab\"], [role=\"button\"], [contenteditable]'\n\nexport interface WindowDragProps {\n onMouseDown: (event: ReactMouseEvent) => void\n}\n\n/**\n * Drag the window by an element, with the double-click zoom a title bar is\n * expected to have.\n *\n * Spread the result onto whatever should behave like a title bar:\n *\n * ```tsx\n * const drag = useWindowDrag()\n * <AppHeader {...drag}>…</AppHeader>\n * ```\n *\n * Inert outside Tauri desktop, so the same Layout serves the web build with no\n * branch at the call site.\n */\nexport function useWindowDrag(): WindowDragProps {\n useEffect(() => {\n if (!isTauri() || isMobileTauri()) return\n void loadWindowModule().catch(() => {})\n }, [])\n\n const onMouseDown = useCallback((event: ReactMouseEvent) => {\n if (!isTauri() || isMobileTauri()) return\n // Only the primary button drags; a right-click belongs to the context menu.\n if (event.button !== 0) return\n if ((event.target as HTMLElement | null)?.closest(INTERACTIVE)) return\n\n event.preventDefault()\n void loadWindowModule()\n .then(({ getCurrentWindow }) => {\n const win = getCurrentWindow()\n // Double-click zooms, which is the platform convention for a title bar\n // on macOS and Windows alike.\n const zoom = event.detail === 2\n return (zoom ? win.toggleMaximize() : win.startDragging()).catch((err: unknown) => {\n // Tauri refuses this call without the permission: `startDragging`\n // needs `core:window:allow-start-dragging`, which `core:default`\n // does NOT include, so a scaffolded app has a header that does\n // nothing and no hint anywhere as to why.\n const command = zoom ? 'toggle-maximize' : 'start-dragging'\n if (isPermissionError(err)) {\n warnOnce(\n `window-drag-${command}`,\n `dragging the window was refused. Add \\`core:window:allow-${command}\\` ` +\n `to src-tauri/capabilities/default.json -- \\`core:default\\` does not ` +\n `include it (see the package README).`,\n err,\n )\n } else {\n warnOnce(`window-drag-${command}`, `dragging the window failed.`, err)\n }\n })\n })\n .catch(() => {\n // The module itself would not load, which means this is not a Tauri\n // host after all. The gesture simply does nothing, correctly.\n })\n }, [])\n\n return { onMouseDown }\n}\n","const warned = new Set<string>()\n\n/** Vite-style consumers expose this; anything else stays quiet rather than guess. */\nfunction isDev(): boolean {\n try {\n return Boolean((import.meta as ImportMeta & { env?: { DEV?: boolean } }).env?.DEV)\n } catch {\n return false\n }\n}\n\n/**\n * Say what went wrong, once, in development.\n *\n * This pack sits on top of a Rust side it does not own: commands the app has to\n * register, and capabilities the app has to grant. Both fail as rejected\n * promises, and a bare `catch {}` around either produces the same thing -- a\n * window that is subtly wrong with nothing anywhere to explain it. Production\n * stays quiet, because these are developer configuration errors and a user\n * cannot act on them.\n */\nexport function warnOnce(key: string, message: string, err: unknown): void {\n if (warned.has(key) || !isDev()) return\n warned.add(key)\n console.warn(`[@whiskeyjack-net/tauri] ${message}`, err)\n}\n\n/**\n * Whether a rejection is Tauri refusing a call the app has not been granted.\n *\n * Tauri v2 gates each window command behind its own capability, and\n * `core:default` covers fewer of them than the name suggests -- `startDragging`\n * is not in it. The rejection says so plainly, so the distinction is worth\n * drawing: a missing capability is a one-line fix in `capabilities/`, while any\n * other failure is not.\n */\nexport function isPermissionError(err: unknown): boolean {\n return String(err).includes('not allowed')\n}\n","import { WindowControlsLeft, WindowControlsRight } from './window-controls'\nimport { useWindowDrag } from './use-window-drag'\n\n/**\n * Window chrome for a desktop window narrower than `md`.\n *\n * The DS `AppHeader` is `hidden md:block`, so a desktop window dragged below\n * 768px loses the header -- and with it the drag region and, on Windows and\n * Linux, the only way to close the window. Width is not a proxy for platform\n * once an app ships as a resizable window. This is the strip that stands in:\n * `WJ_NARROW_CHROME_PX` tall, pinned to the top, with the platform's controls\n * at the edges.\n *\n * Inert everywhere else: the strip is `display: none` until `useSystemAccent`\n * marks the document `.tauri-desktop`, and hidden again from 768px up. Render\n * it as a child of the app shell, above the header. All styling comes from\n * this package's `css/window-controls` stylesheet -- Tailwind utilities are\n * unusable here, because consumer content globs do not scan this package and\n * classes used only by it would never be generated.\n *\n * Pair it with the clearance -- `css/window-controls` reserves the same height\n * on the DS main scroller (`main[data-app-main]`) below `md`, so content starts\n * under the strip instead of behind it. On macOS the controls are the OS's own\n * and this component draws none, but the clearance is what keeps the traffic\n * lights off the first line of content.\n */\nexport function NarrowWindowChrome() {\n const drag = useWindowDrag()\n return (\n <div {...drag} className=\"tauri-drag-zone\">\n <div className=\"tauri-drag-zone-row\">\n <WindowControlsLeft />\n <div className=\"tauri-drag-zone-spacer\" />\n <WindowControlsRight />\n </div>\n </div>\n )\n}\n\n/**\n * The strip's height in px, matching `h-7` and the CSS clearance. Exported for\n * an app that has to clear it somewhere the stylesheet cannot reach (a sticky\n * element inside the scroller sticks to the scrollport, not the padding edge).\n */\nexport const WJ_NARROW_CHROME_PX = 28\n","import { useEffect } from 'react'\nimport { isTauri, isMobileTauri } from './desktop'\nimport { warnOnce } from './warn'\n\n/**\n * In Tauri desktop builds, fetch the system accent color and override\n * the design-system accent CSS variables so the app matches the OS theme.\n */\nexport function useSystemAccent() {\n useEffect(() => {\n if (!isTauri()) return\n // `__TAURI_INTERNALS__` is present on mobile Tauri too, so this hook -- the\n // window controls, the CSD drag zone, the OS-accent read, and the\n // `.tauri-desktop` marker class -- must gate on DESKTOP explicitly. Without\n // this, `.tauri-desktop` lands on iOS/Android and its desktop-only CSS (e.g.\n // the drag-zone tab-clearance padding) leaks onto mobile. Mobile accent is\n // handled in Layout.\n if (isMobileTauri()) return\n\n // Mark the document so CSS can target Tauri-specific styles\n document.documentElement.classList.add('tauri-desktop')\n\n // Add platform class for platform-specific control styling\n if (navigator.userAgent.includes('Windows')) {\n document.documentElement.classList.add('tauri-platform-windows')\n }\n\n // Linux desktop: the window is undecorated + transparent (decorations:false\n // + transparent:true in tauri.linux.conf.json) and its corners are rounded\n // entirely in CSS -- `.tauri-platform-linux #root` carries the border-radius\n // and clips to genuine window alpha (see index.css); no native GTK decoration\n // is involved. Mark the platform so that CSS applies, and track the maximized\n // state so the radius drops to 0 while maximized/tiled -- the app goes\n // edge-to-edge then, like every other windowed app (mobile Tauri is already\n // excluded above, so \"Linux\" here means desktop).\n let unlistenResized: (() => void) | undefined\n let disposed = false\n if (navigator.userAgent.includes('Linux')) {\n document.documentElement.classList.add('tauri-platform-linux')\n import('@tauri-apps/api/window').then(({ getCurrentWindow }) => {\n const win = getCurrentWindow()\n const syncMaximized = async () => {\n try {\n document.documentElement.classList.toggle(\n 'tauri-window-maximized',\n await win.isMaximized(),\n )\n } catch {\n // ignore -- corners just stay rounded\n }\n }\n syncMaximized()\n // onResized registers asynchronously; if the effect already tore down by\n // the time it resolves, unlisten immediately instead of leaking it.\n win.onResized(syncMaximized).then((unlisten) => {\n if (disposed) unlisten()\n else unlistenResized = unlisten\n })\n })\n }\n\n async function applyAccent() {\n try {\n const { invoke } = await import('@tauri-apps/api/core')\n const hex = await invoke<string | null>('get_system_accent_color')\n if (!hex) return\n\n const r = parseInt(hex.slice(1, 3), 16)\n const g = parseInt(hex.slice(3, 5), 16)\n const b = parseInt(hex.slice(5, 7), 16)\n\n const root = document.documentElement\n // Derive lighter/darker shades from the accent\n root.style.setProperty('--color-accent-50', adjustBrightness(r, g, b, 0.95))\n root.style.setProperty('--color-accent-100', adjustBrightness(r, g, b, 0.88))\n root.style.setProperty('--color-accent-400', adjustBrightness(r, g, b, 0.15))\n root.style.setProperty('--color-accent-500', hex)\n root.style.setProperty('--color-accent-600', adjustBrightness(r, g, b, -0.12))\n root.style.setProperty('--color-accent-700', adjustBrightness(r, g, b, -0.25))\n } catch (err) {\n // The theme accent is a fine outcome, so this one only needs saying in\n // development -- unlike the controls layout, nothing looks broken.\n warnOnce(\n 'get_system_accent_color',\n 'the command `get_system_accent_color` is not registered, so the app ' +\n 'keeps its theme accent instead of the OS one (see the package README).',\n err,\n )\n }\n }\n\n applyAccent()\n\n async function applyWindowControls() {\n let layout: WindowControlsLayout\n try {\n const { invoke } = await import('@tauri-apps/api/core')\n layout = await invoke<WindowControlsLayout>('get_window_controls_layout')\n } catch (err) {\n // The command is the app's to implement, and a scaffolded app has not\n // implemented it yet. Falling back to what the platform almost\n // certainly wants makes a fresh scaffold correct on macOS and Windows\n // with no Rust at all; only Linux, where the button layout is a\n // per-desktop setting, genuinely needs the command.\n layout = platformDefaultLayout()\n warnOnce(\n 'get_window_controls_layout',\n 'the command `get_window_controls_layout` is not registered, so window ' +\n 'controls fall back to the platform default. Implement it to read the ' +\n 'desktop’s own button layout (see the package README).',\n err,\n )\n }\n\n {\n const root = document.documentElement\n // Per-side button lists drive which controls WindowControls renders, in\n // order (matches the desktop's own convention -- see window_controls.rs).\n root.setAttribute('data-wc-left', layout.left.join(','))\n root.setAttribute('data-wc-right', layout.right.join(','))\n // The side class drives the action-pill clearance padding (index.css).\n root.classList.remove('tauri-controls-left', 'tauri-controls-right', 'tauri-controls-both', 'tauri-controls-native')\n const side = layout.native\n ? 'native'\n : layout.left.length && layout.right.length\n ? 'both'\n : layout.left.length\n ? 'left'\n : layout.right.length\n ? 'right'\n : null\n if (side) root.classList.add(`tauri-controls-${side}`)\n\n // Publish each side's control footprint (px from the window edge to the\n // controls' inner edge) so the CSS clears them CONTINUOUSLY (index.css)\n // rather than via fixed width breakpoints -- exact for any layout and\n // any platform. Sizes mirror .window-control: Windows controls are 46px\n // wide flush to the edge; the custom (Linux) controls are 28px with a 6px\n // gap, inset 16px (left-4/right-4).\n const isWindows = navigator.userAgent.includes('Windows')\n const footprint = (count: number): number =>\n count === 0 ? 0 : isWindows ? count * 46 : 16 + count * 28 + (count - 1) * 6\n if (layout.native) {\n // macOS draws OS traffic lights (the app renders no custom controls, so\n // both button lists are empty). They sit on the LEFT and never vary in\n // count, so publish a fixed 64px left footprint (+1rem gap = the 80px\n // clearance used before) and let macOS ride the SAME continuous formula\n // as Linux/Windows -- fluid clearance instead of a width breakpoint.\n root.style.setProperty('--wc-left-px', '64px')\n root.style.setProperty('--wc-right-px', '0px')\n } else {\n root.style.setProperty('--wc-left-px', `${footprint(layout.left.length)}px`)\n root.style.setProperty('--wc-right-px', `${footprint(layout.right.length)}px`)\n }\n }\n }\n\n applyWindowControls()\n\n return () => {\n disposed = true\n unlistenResized?.()\n }\n }, [])\n}\n\ninterface WindowControlsLayout {\n left: string[]\n right: string[]\n native: boolean\n}\n\n/**\n * What the platform almost certainly wants, for an app that has not implemented\n * `get_window_controls_layout`.\n *\n * macOS draws its own traffic lights in an overlay title bar, so the app draws\n * none and only reserves room. Windows and the Linux fallback take the\n * conventional right-hand set. Linux is the one platform where this is a guess\n * rather than a rule -- the button layout is a desktop setting, and reading it\n * needs the Rust command.\n */\nfunction platformDefaultLayout(): WindowControlsLayout {\n const ua = navigator.userAgent\n if (ua.includes('Mac')) return { left: [], right: [], native: true }\n return { left: [], right: ['minimize', 'maximize', 'close'], native: false }\n}\n\n/** Lighten (positive amount) or darken (negative amount) an RGB color. */\nfunction adjustBrightness(r: number, g: number, b: number, amount: number): string {\n const adjust = (c: number) => {\n if (amount > 0) {\n // Lighten: blend toward white\n return Math.round(c + (255 - c) * amount)\n }\n // Darken: blend toward black\n return Math.round(c * (1 + amount))\n }\n\n const clamp = (v: number) => Math.max(0, Math.min(255, v))\n const rr = clamp(adjust(r))\n const gg = clamp(adjust(g))\n const bb = clamp(adjust(b))\n\n return `#${rr.toString(16).padStart(2, '0')}${gg.toString(16).padStart(2, '0')}${bb.toString(16).padStart(2, '0')}`\n}\n","/**\n * Open a URL outside the app: the system browser on Tauri (desktop and mobile,\n * via the opener plugin -- window.open is a no-op in the Tauri WebView), a new\n * tab on the web.\n *\n * Requires the `@tauri-apps/plugin-opener` peer plus its capability grant in the\n * Tauri app (`opener:allow-open-url`).\n */\nexport async function openExternal(url: string) {\n if ('__TAURI_INTERNALS__' in window) {\n const { openUrl } = await import('@tauri-apps/plugin-opener')\n await openUrl(url)\n } else {\n window.open(url, '_blank', 'noopener,noreferrer')\n }\n}\n","/**\n * Desktop in-app update checker for direct-download Tauri builds. Polls a\n * GitHub repo's releases, matches this app's tag prefix, compares semver\n * against the running version, and resolves the best installer asset for the\n * current platform. Store-distributed builds (App Store, Snap, ...) update\n * through the store and should never call this.\n */\n\nexport interface UpdateResult {\n status: 'update-available' | 'up-to-date' | 'error'\n latestVersion?: string\n releaseUrl?: string\n downloadUrl?: string\n}\n\nexport interface UpdaterConfig {\n /** GitHub `owner/repo` whose releases list is polled. */\n repo: string\n /** Tag prefix marking this app's releases, e.g. `chip-away-v`. */\n tagPrefix: string\n /**\n * Version used when the app is not running under Tauri (the web/PWA build,\n * where `@tauri-apps/api/app` is unavailable) -- typically the build-time\n * version constant. Under Tauri the real version comes from the runtime.\n */\n fallbackVersion: string\n /** Releases page size to fetch (default 10). */\n perPage?: number\n}\n\nexport interface Updater {\n /** The running app's version (Tauri runtime, else `fallbackVersion`). */\n getAppVersion(): Promise<string>\n /** Check the configured repo for a newer release. */\n checkForUpdates(): Promise<UpdateResult>\n}\n\ninterface GitHubAsset {\n name: string\n browser_download_url: string\n}\n\ninterface GitHubRelease {\n tag_name: string\n html_url: string\n draft: boolean\n assets: GitHubAsset[]\n}\n\n/** Compare two semver strings. Positive if a > b, negative if a < b, 0 if equal. */\nfunction compareSemver(a: string, b: string): number {\n const aParts = a.split('.').map(Number)\n const bParts = b.split('.').map(Number)\n const len = Math.max(aParts.length, bParts.length)\n\n for (let i = 0; i < len; i++) {\n const av = i < aParts.length ? aParts[i] : 0\n const bv = i < bParts.length ? bParts[i] : 0\n if (av !== bv) return av - bv\n }\n return 0\n}\n\n/** Find the best download URL for the current platform. */\nfunction getDownloadUrlForPlatform(assets: GitHubAsset[]): string | undefined {\n const ua = navigator.userAgent.toLowerCase()\n let patterns: string[]\n\n if (ua.includes('mac')) {\n patterns = ['.dmg']\n } else if (ua.includes('win')) {\n patterns = ['.msi', '-setup.exe', '.exe']\n } else {\n patterns = ['.appimage', '.deb']\n }\n\n for (const pattern of patterns) {\n const match = assets.find((a) => a.name.toLowerCase().endsWith(pattern))\n if (match) return match.browser_download_url\n }\n return undefined\n}\n\n/**\n * Build an updater bound to one app's release config. Give it the app's repo,\n * tag prefix, and build-time version:\n *\n * ```ts\n * export const updater = createUpdater({\n * repo: 'whiskeyjack-net/downloads',\n * tagPrefix: 'chip-away-v',\n * fallbackVersion: __APP_VERSION__,\n * })\n * ```\n */\nexport function createUpdater(config: UpdaterConfig): Updater {\n const releasesUrl = `https://api.github.com/repos/${config.repo}/releases?per_page=${config.perPage ?? 10}`\n\n async function getAppVersion(): Promise<string> {\n if ('__TAURI_INTERNALS__' in window) {\n try {\n const { getVersion } = await import('@tauri-apps/api/app')\n return await getVersion()\n } catch {\n // Fall through to the configured fallback.\n }\n }\n return config.fallbackVersion\n }\n\n async function checkForUpdates(): Promise<UpdateResult> {\n try {\n const response = await fetch(releasesUrl, {\n headers: { Accept: 'application/vnd.github+json' },\n signal: AbortSignal.timeout(15000),\n })\n\n if (!response.ok) return { status: 'error' }\n\n const releases: GitHubRelease[] = await response.json()\n\n // Latest release matching our tag prefix, skipping drafts.\n const matching = releases.filter(\n (r) => r.tag_name.startsWith(config.tagPrefix) && !r.draft,\n )\n\n if (matching.length === 0) return { status: 'up-to-date' }\n\n const latest = matching[0]\n const remoteVersion = latest.tag_name.slice(config.tagPrefix.length)\n const currentVersion = await getAppVersion()\n\n if (compareSemver(remoteVersion, currentVersion) > 0) {\n return {\n status: 'update-available',\n latestVersion: remoteVersion,\n releaseUrl: latest.html_url,\n downloadUrl: getDownloadUrlForPlatform(latest.assets) ?? latest.html_url,\n }\n }\n\n return { status: 'up-to-date' }\n } catch {\n return { status: 'error' }\n }\n }\n\n return { getAppVersion, checkForUpdates }\n}\n","import { useTranslation } from 'react-i18next'\nimport { ArrowSquareOut } from '@phosphor-icons/react'\nimport { Button, Toast } from '@whiskeyjack-net/design-system'\n\ninterface UpdateBannerProps {\n version: string\n releaseUrl: string\n onDismiss: () => void\n}\n\n/**\n * \"Update available\" notification for the desktop build. A persistent DS\n * Toast (floating below the header) with a download action and a dismiss\n * button -- the caller unmounts it on dismiss, so `open` is always true.\n *\n * Requires the app's locales to define `update.available` (interpolates\n * `{{version}}`), `update.download`, and `update.later`.\n */\nexport function UpdateBanner({ version, releaseUrl, onDismiss }: UpdateBannerProps) {\n const { t } = useTranslation()\n\n return (\n <Toast\n open\n icon={<ArrowSquareOut size={16} weight=\"bold\" className=\"text-[var(--color-accent-500)]\" />}\n onDismiss={onDismiss}\n dismissLabel={t('update.later')}\n action={\n <a href={releaseUrl} target=\"_blank\" rel=\"noopener noreferrer\" className=\"shrink-0\">\n <Button variant=\"accent\">{t('update.download')}</Button>\n </a>\n }\n >\n {t('update.available', { version })}\n </Toast>\n )\n}\n","import { useState, useCallback } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport { ArrowSquareOut, ArrowsClockwise, CheckCircle, Warning } from '@phosphor-icons/react'\nimport { Button } from '@whiskeyjack-net/design-system'\nimport { openExternal } from './open-external'\nimport type { Updater, UpdateResult } from './updater'\n\ninterface UpdateDialogProps {\n /** The app's updater (from `createUpdater`); drives the check. */\n updater: Updater\n onClose: () => void\n}\n\n/**\n * \"Check for updates\" dialog body for the desktop build (mount inside a DS\n * BottomDrawer). Auto-runs the check on first render, then shows the result\n * with a download or up-to-date state.\n *\n * Requires the app's locales to define `update.checking`, `update.available`\n * (interpolates `{{version}}`), `update.currentVersion` (interpolates\n * `{{version}}`), `update.upToDate`, `update.download`, `update.later`,\n * `update.error`, and `common.cancel`.\n */\nexport function UpdateDialog({ updater, onClose }: UpdateDialogProps) {\n const { t } = useTranslation()\n const [state, setState] = useState<'idle' | 'checking' | 'done'>('idle')\n const [result, setResult] = useState<UpdateResult | null>(null)\n const [currentVersion, setCurrentVersion] = useState<string>('')\n\n const handleCheck = useCallback(async () => {\n setState('checking')\n const [version, updateResult] = await Promise.all([\n updater.getAppVersion(),\n updater.checkForUpdates(),\n ])\n setCurrentVersion(version)\n setResult(updateResult)\n setState('done')\n }, [updater])\n\n // Auto-trigger check on first render\n if (state === 'idle') {\n handleCheck()\n }\n\n return (\n <div className=\"flex flex-col items-center gap-4 py-2\">\n {state === 'checking' && (\n <>\n <ArrowsClockwise size={40} weight=\"bold\" className=\"text-[var(--color-accent-500)] animate-spin\" />\n <p className=\"text-sm text-[var(--color-text-secondary-light)] dark:text-[var(--color-text-secondary-dark)]\">\n {t('update.checking')}\n </p>\n </>\n )}\n\n {state === 'done' && result?.status === 'update-available' && (\n <>\n <ArrowsClockwise size={40} weight=\"bold\" className=\"text-[var(--color-accent-500)]\" />\n <div className=\"text-center\">\n <p className=\"text-sm font-medium text-[var(--color-text-primary-light)] dark:text-[var(--color-text-primary-dark)]\">\n {t('update.available', { version: result.latestVersion })}\n </p>\n <p className=\"text-xs text-[var(--color-text-muted-light)] dark:text-[var(--color-text-muted-dark)] mt-1\">\n {t('update.currentVersion', { version: currentVersion })}\n </p>\n </div>\n <div className=\"flex gap-3\">\n <Button variant=\"accent\" onClick={() => openExternal(result.downloadUrl || result.releaseUrl || '')}>\n <ArrowSquareOut size={16} weight=\"bold\" />\n {t('update.download')}\n </Button>\n <Button variant=\"secondary\" onClick={onClose}>\n {t('update.later')}\n </Button>\n </div>\n </>\n )}\n\n {state === 'done' && result?.status === 'up-to-date' && (\n <>\n <CheckCircle size={40} weight=\"fill\" className=\"text-[var(--color-success-500)]\" />\n <div className=\"text-center\">\n <p className=\"text-sm font-medium text-[var(--color-text-primary-light)] dark:text-[var(--color-text-primary-dark)]\">\n {t('update.upToDate')}\n </p>\n <p className=\"text-xs text-[var(--color-text-muted-light)] dark:text-[var(--color-text-muted-dark)] mt-1\">\n {t('update.currentVersion', { version: currentVersion })}\n </p>\n </div>\n <Button variant=\"secondary\" onClick={onClose}>\n {t('common.cancel')}\n </Button>\n </>\n )}\n\n {state === 'done' && result?.status === 'error' && (\n <>\n <Warning size={40} weight=\"fill\" className=\"text-[var(--color-warning-500)]\" />\n <p className=\"text-sm text-[var(--color-text-secondary-light)] dark:text-[var(--color-text-secondary-dark)]\">\n {t('update.error')}\n </p>\n <Button variant=\"secondary\" onClick={onCl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AChG;AAAA,0BAAAL,KAACM,iBAAA,EAAe,MAAM,IAAI,QAAO,QAAO;AAAA,UACvC,EAAE,iBAAiB;AAAA,WACtB;AAAA,QACA,gBAAAN,KAACK,SAAA,EAAO,SAAQ,aAAY,SAAS,SAClC,YAAE,cAAc,GACnB;AAAA,SACF;AAAA,OACF;AAAA,IAGD,UAAU,UAAU,QAAQ,WAAW,gBACtC,gBAAAJ,MAAA,YACE;AAAA,sBAAAD,KAAC,eAAY,MAAM,IAAI,QAAO,QAAO,WAAU,mCAAkC;AAAA,MACjF,gBAAAC,MAAC,SAAI,WAAU,eACb;AAAA,wBAAAD,KAAC,OAAE,WAAU,yGACV,YAAE,iBAAiB,GACtB;AAAA,QACA,gBAAAA,KAAC,OAAE,WAAU,8FACV,YAAE,yBAAyB,EAAE,SAAS,eAAe,CAAC,GACzD;AAAA,SACF;AAAA,MACA,gBAAAA,KAACK,SAAA,EAAO,SAAQ,aAAY,SAAS,SAClC,YAAE,eAAe,GACpB;AAAA,OACF;AAAA,IAGD,UAAU,UAAU,QAAQ,WAAW,WACtC,gBAAAJ,MAAA,YACE;AAAA,sBAAAD,KAAC,WAAQ,MAAM,IAAI,QAAO,QAAO,WAAU,mCAAkC;AAAA,MAC7E,gBAAAA,KAAC,OAAE,WAAU,iGACV,YAAE,cAAc,GACnB;AAAA,MACA,gBAAAA,KAACK,SAAA,EAAO,SAAQ,aAAY,SAAS,SAClC,YAAE,eAAe,GACpB;AAAA,OACF;AAAA,KAEJ;AAEJ;","names":["useEffect","useEffect","jsx","useEffect","useEffect","useTranslation","jsx","useState","useCallback","useTranslation","ArrowSquareOut","Button","jsx","jsxs","useTranslation","useState","useCallback","Button","ArrowSquareOut"]}
|
|
File without changes
|
package/dist/open-external.d.ts
CHANGED
|
File without changes
|
package/dist/update-banner.d.ts
CHANGED
|
File without changes
|
package/dist/update-dialog.d.ts
CHANGED
|
File without changes
|
package/dist/updater.d.ts
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/warn.d.ts
CHANGED
|
File without changes
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@whiskeyjack-net/tauri",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.6",
|
|
4
4
|
"description": "Tauri-native app-shell layer for the Whiskeyjack design system: per-platform CSD window controls, OS accent integration, and desktop guards.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"tauri",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"@phosphor-icons/react": "^2.0.0",
|
|
35
35
|
"@tauri-apps/api": "^2.0.0",
|
|
36
36
|
"@tauri-apps/plugin-opener": "^2.0.0",
|
|
37
|
-
"@whiskeyjack-net/design-system": "^0.
|
|
37
|
+
"@whiskeyjack-net/design-system": "^0.24.0",
|
|
38
38
|
"react": "^18.0.0",
|
|
39
39
|
"react-dom": "^18.0.0",
|
|
40
40
|
"react-i18next": "^14.0.0 || ^15.0.0"
|