@gravionlabs/helix-app 0.0.1 → 22.20.0

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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gravionlabs-helix-app-frame.mjs","names":[],"sources":["../../../projects/app/frame/activity-bar/activity-bar.ts","../../../projects/app/frame/activity-bar/activity-bar.html","../../../projects/app/frame/app-shell/app-shell.ts","../../../projects/app/frame/app-shell/app-shell.html","../../../projects/app/frame/app-shell/app-toolbar.ts","../../../projects/app/frame/app-shell/app-toolbar.html","../../../projects/app/frame/mobile-shell/bottom-bar.ts","../../../projects/app/frame/mobile-shell/bottom-bar.html","../../../projects/app/frame/mobile-shell/mobile-shell.ts","../../../projects/app/frame/mobile-shell/mobile-shell.html","../../../projects/app/frame/status-bar/status-bar.ts","../../../projects/app/frame/status-bar/status-bar.html","../../../projects/app/frame/status-bar/status-item.ts","../../../projects/app/frame/status-bar/status-item.html","../../../projects/app/frame/status-bar/status-version.ts","../../../projects/app/frame/status-bar/status-version.html","../../../projects/app/frame/status-bar/status-zoom.ts","../../../projects/app/frame/status-bar/status-zoom.html"],"sourcesContent":["import { NgTemplateOutlet } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n computed,\n type ElementRef,\n input,\n output,\n type TemplateRef,\n viewChildren,\n} from '@angular/core';\nimport type { HelixView } from '@gravionlabs/helix-app';\n\n/** A badge on an item: a count, or a dot when `true`. */\nexport type HxActivityBarBadge = number | string | true;\n\n/**\n * An item of the activity bar. A view (`kind` absent or `'view'`) is a toggle with `aria-pressed`; an\n * action is a plain button.\n */\nexport interface HxActivityBarItem extends Pick<HelixView, 'id' | 'label' | 'icon' | 'position'> {\n readonly kind?: 'view' | 'action';\n readonly badge?: HxActivityBarBadge | null;\n}\n\n/**\n * The narrow icon rail at the far left (or, with `side=\"right\"`, the far right). It selects the sidebar view, opens tab views and holds actions.\n *\n * ```html\n * <hx-activity-bar [items]=\"items\" [activeId]=\"activeId()\" [expanded]=\"open()\" (selected)=\"select($event)\" />\n * ```\n *\n * The active view is marked only while the sidebar is `expanded`. The rail is one tab stop (roving\n * tabindex); the arrow keys, Home and End move the focus between the items. An icon given as a name is\n * rendered as `<span class=\"{name}\">`, so the app's icon font or registry draws it; a template is drawn as is.\n * Both sit in a box of one size.\n */\n@Component({\n selector: 'hx-activity-bar',\n imports: [NgTemplateOutlet],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'hx-activity-bar',\n '[class.hx-activity-bar-end]': \"side() === 'right'\",\n '[class.hx-activity-bar-small]': \"size() === 'small'\",\n role: 'toolbar',\n 'aria-orientation': 'vertical',\n '[attr.aria-label]': 'label()',\n '(keydown)': 'onKeydown($event)',\n },\n templateUrl: './activity-bar.html',\n})\nexport class HxActivityBar {\n /** The views and actions; `position` puts them at the top or the bottom (settings). */\n readonly items = input.required<readonly HxActivityBarItem[]>();\n /** The id of the active view. */\n readonly activeId = input<string | null>(null);\n /** Whether the sidebar is open; the active view is marked only then. */\n readonly expanded = input(true);\n /** The window edge the rail sits at: `right` puts the marker and the border on the other side. */\n readonly side = input<'left' | 'right'>('left');\n /** `small` draws a narrower rail with smaller items and icons (sizes: `--hx-activity-bar-*`). */\n readonly size = input<'default' | 'small'>('default');\n /** The accessible name of the rail. */\n readonly label = input('Activity bar');\n\n /** Emits the id of the selected view or the activated action. */\n readonly selected = output<string>();\n\n private readonly buttons = viewChildren<ElementRef<HTMLButtonElement>>('button');\n\n protected readonly groups = computed(() => {\n const items = this.items();\n return [\n { name: 'top', items: items.filter((i) => i.position !== 'bottom') },\n { name: 'bottom', items: items.filter((i) => i.position === 'bottom') },\n ].filter((g) => g.items.length > 0);\n });\n\n private readonly ordered = computed(() => this.groups().flatMap((g) => g.items));\n\n /** The one item in the tab order: the active view when marked, else the first. */\n protected readonly tabStopId = computed(() => {\n const ordered = this.ordered();\n const active = this.expanded() ? ordered.find((i) => i.id === this.activeId()) : undefined;\n return (active ?? ordered[0])?.id ?? null;\n });\n\n protected isView(item: HxActivityBarItem): boolean {\n return item.kind !== 'action';\n }\n\n protected isActive(item: HxActivityBarItem): boolean {\n return this.isView(item) && this.expanded() && item.id === this.activeId();\n }\n\n protected asTemplate(icon: HxActivityBarItem['icon']): TemplateRef<unknown> | null {\n return typeof icon === 'string' ? null : icon;\n }\n\n protected select(item: HxActivityBarItem): void {\n this.selected.emit(item.id);\n }\n\n protected onKeydown(event: KeyboardEvent): void {\n const buttons = this.buttons().map((b) => b.nativeElement);\n if (buttons.length === 0) return;\n const current = buttons.indexOf(document.activeElement as HTMLButtonElement);\n let next: number;\n switch (event.key) {\n case 'ArrowDown':\n case 'ArrowRight':\n next = (current + 1) % buttons.length;\n break;\n case 'ArrowUp':\n case 'ArrowLeft':\n next = (current - 1 + buttons.length) % buttons.length;\n break;\n case 'Home':\n next = 0;\n break;\n case 'End':\n next = buttons.length - 1;\n break;\n default:\n return;\n }\n event.preventDefault();\n buttons[next]?.focus();\n }\n}\n","@for (group of groups(); track group.name) {\n <div class=\"hx-activity-bar-group\" [class.hx-activity-bar-bottom]=\"group.name === 'bottom'\">\n @for (item of group.items; track item.id) {\n <button\n #button\n type=\"button\"\n class=\"hx-activity-bar-item\"\n [class.hx-activity-bar-active]=\"isActive(item)\"\n [attr.data-id]=\"item.id\"\n [attr.aria-label]=\"item.label\"\n [attr.aria-pressed]=\"isView(item) ? isActive(item) : null\"\n [attr.title]=\"item.label\"\n [attr.tabindex]=\"item.id === tabStopId() ? 0 : -1\"\n (click)=\"select(item)\"\n >\n <span class=\"hx-activity-bar-icon\" aria-hidden=\"true\">\n @if (asTemplate(item.icon); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" />\n } @else {\n <span [class]=\"item.icon\"></span>\n }\n </span>\n @if (item.badge !== undefined && item.badge !== null) {\n <span\n class=\"hx-activity-bar-badge\"\n [class.hx-activity-bar-badge-dot]=\"item.badge === true\"\n >{{ item.badge === true ? '' : item.badge }}</span\n >\n }\n </button>\n }\n </div>\n}\n","import {\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n computed,\n input,\n model,\n numberAttribute,\n output,\n} from '@angular/core';\nimport { HxSplitter } from '@gravionlabs/helix-ui';\nimport { getHxPlatform, hxViewsFor, type HelixView, type HxPlatform } from '@gravionlabs/helix-app';\n\n/** The width and the collapsed state of the sidebar, as the app stores them. */\nexport interface HxSidebarState {\n readonly width: number;\n readonly collapsed: boolean;\n}\n\n/**\n * The layout of a desktop app: toolbar, activity bar, one sidebar, content, an optional right panel and a\n * status bar.\n *\n * ```html\n * <hx-app-shell #shell [views]=\"VIEWS\" [(sidebarWidth)]=\"width\" [(collapsed)]=\"collapsed\" [(activeId)]=\"viewId\">\n * <hx-app-toolbar slot=\"toolbar\">...</hx-app-toolbar>\n * <hx-activity-bar slot=\"activity\" [items]=\"hxViewsFor(VIEWS)\" [activeId]=\"shell.activeId()\"\n * [expanded]=\"!shell.collapsed()\" (selected)=\"shell.selectView($event)\" />\n * <nav slot=\"sidebar\">...the view of activeId...</nav>\n * <hx-tab-bar>...</hx-tab-bar>\n * <aside slot=\"panel\">...</aside>\n * <hx-status-bar slot=\"status\">...</hx-status-bar>\n * </hx-app-shell>\n * ```\n *\n * `VIEWS` is one `HelixView[]` for both shells; the app binds `hxViewsFor(VIEWS)` to the activity bar. With\n * `views` (and `platform`, default `getHxPlatform()`) `showView` and `selectView` ignore an id that is not\n * a view of the platform. Without `views` they accept any id.\n *\n * There is one sidebar: the app puts the view of `activeId` into it. `selectView` collapses the sidebar\n * when the active view is selected again and expands it for another one; `showView` only shows a view. The splitter (`hx-splitter`) is a\n * `role=\"separator\"`: drag it, or use the arrow keys (Shift for a larger step), Home and End. The shell\n * has no tab logic: the unslotted content is the app's tab layout.\n *\n * `slot=\"activity-end\"` is a second activity bar at the right window edge, right of `slot=\"panel\"`; give\n * it `side=\"right\"` (and `size=\"small\"` for a narrow rail). It stays visible with or without the panel.\n *\n * `slot=\"bottom\"` is a panel below the content (not under the activity bar), for an output panel or the\n * panel of an editor. It shows when `bottomOpen` is true; its horizontal splitter resizes `bottomHeight`\n * with the pointer or the Up and Down keys (Shift for a larger step), Home and End.\n */\n@Component({\n selector: 'hx-app-shell',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [HxSplitter],\n host: { class: 'hx-app-shell' },\n templateUrl: './app-shell.html',\n})\nexport class HxAppShell {\n /** The views of the app; with it `showView` and `selectView` ignore an id that does not exist on the platform. */\n readonly views = input<readonly HelixView[] | undefined>(undefined);\n /** The platform the views are filtered for. */\n readonly platform = input<HxPlatform>(getHxPlatform());\n /** The sidebar width in px (two-way); it is kept between `minWidth` and `maxWidth`. */\n readonly sidebarWidth = model(260);\n /** Whether the sidebar is collapsed (two-way). */\n readonly collapsed = model(false);\n /** The id of the active sidebar view (two-way). */\n readonly activeId = model<string | null>(null);\n readonly minWidth = input(160, { transform: numberAttribute });\n readonly maxWidth = input(480, { transform: numberAttribute });\n /** The step of an arrow key in px; Shift multiplies it by 4. */\n readonly step = input(16, { transform: numberAttribute });\n readonly resizerLabel = input('Resize sidebar');\n /** Set to disable the pointer and keyboard resize. */\n readonly fixedWidth = input(false, { transform: booleanAttribute });\n\n /** The height in px of the bottom panel (two-way); it is kept between `minBottomHeight` and `maxBottomHeight`. */\n readonly bottomHeight = model(200);\n /** Whether the bottom panel (`slot=\"bottom\"`) is open (two-way); closed hides the slot and its splitter. */\n readonly bottomOpen = model(false);\n readonly minBottomHeight = input(80, { transform: numberAttribute });\n readonly maxBottomHeight = input(480, { transform: numberAttribute });\n readonly bottomResizerLabel = input('Resize bottom panel');\n\n /** Emits the width and the collapsed state whenever either changes through the shell. */\n readonly sidebarChange = output<HxSidebarState>();\n\n protected readonly width = computed(() => this.clamp(this.sidebarWidth()));\n protected readonly height = computed(() => this.clampHeight(this.bottomHeight()));\n\n /**\n * Select a sidebar view: the active one collapses the sidebar (when open), any other shows it and\n * expands the sidebar.\n */\n selectView(id: string): void {\n if (!this.isKnown(id)) return;\n if (id === this.activeId() && !this.collapsed()) {\n this.collapsed.set(true);\n } else {\n this.activeId.set(id);\n this.collapsed.set(false);\n }\n this.report();\n }\n\n /**\n * Show a sidebar view without toggling: activates it and expands the sidebar, and never collapses it.\n * For links to a view from outside the activity bar (status bar, notifications, commands).\n */\n showView(id: string): void {\n if (!this.isKnown(id)) return;\n this.activeId.set(id);\n this.collapsed.set(false);\n this.report();\n }\n\n /** Set the width, clamped to the minimum and the maximum. */\n resizeTo(width: number): void {\n const next = this.clamp(width);\n if (next === this.sidebarWidth()) return;\n this.sidebarWidth.set(next);\n this.report();\n }\n\n /** Open the bottom panel when it is closed and close it when it is open. */\n toggleBottom(): void {\n this.bottomOpen.update((open) => !open);\n }\n\n /** Set the height of the bottom panel, clamped to the minimum and the maximum. */\n resizeBottomTo(height: number): void {\n const next = this.clampHeight(height);\n if (next === this.bottomHeight()) return;\n this.bottomHeight.set(next);\n }\n\n private isKnown(id: string): boolean {\n const views = this.views();\n return !views || hxViewsFor(views, this.platform()).some((v) => v.id === id);\n }\n\n private clamp(width: number): number {\n return Math.min(this.maxWidth(), Math.max(this.minWidth(), Math.round(width)));\n }\n\n private clampHeight(height: number): number {\n return Math.min(this.maxBottomHeight(), Math.max(this.minBottomHeight(), Math.round(height)));\n }\n\n private report(): void {\n this.sidebarChange.emit({ width: this.width(), collapsed: this.collapsed() });\n }\n}\n","<ng-content select=\"[slot=toolbar]\" />\n<div class=\"hx-app-shell-body\">\n <ng-content select=\"[slot=activity]\" />\n <div class=\"hx-app-shell-sidebar\" [hidden]=\"collapsed()\" [style.width.px]=\"width()\">\n <ng-content select=\"[slot=sidebar]\" />\n </div>\n @if (!collapsed()) {\n <hx-splitter\n class=\"hx-app-shell-resizer\"\n [value]=\"width()\"\n [min]=\"minWidth()\"\n [max]=\"maxWidth()\"\n [step]=\"step()\"\n [label]=\"resizerLabel()\"\n [disabled]=\"fixedWidth()\"\n (valueChange)=\"resizeTo($event)\"\n />\n }\n <div class=\"hx-app-shell-main\">\n <main class=\"hx-app-shell-content\"><ng-content /></main>\n @if (bottomOpen()) {\n <hx-splitter\n class=\"hx-app-shell-resizer hx-app-shell-resizer-bottom\"\n orientation=\"horizontal\"\n inverse\n [value]=\"height()\"\n [min]=\"minBottomHeight()\"\n [max]=\"maxBottomHeight()\"\n [step]=\"step()\"\n [label]=\"bottomResizerLabel()\"\n [disabled]=\"fixedWidth()\"\n (valueChange)=\"resizeBottomTo($event)\"\n />\n }\n <div class=\"hx-app-shell-bottom\" [hidden]=\"!bottomOpen()\" [style.height.px]=\"height()\">\n <ng-content select=\"[slot=bottom]\" />\n </div>\n </div>\n <ng-content select=\"[slot=panel]\" />\n <ng-content select=\"[slot=activity-end]\" />\n</div>\n<ng-content select=\"[slot=status]\" />\n","import { booleanAttribute, ChangeDetectionStrategy, Component, input } from '@angular/core';\n\n/**\n * The slim bar (26 px) at the top of a desktop app: a start, a centre (title) and an end slot.\n *\n * ```html\n * <hx-app-toolbar slot=\"toolbar\" [windowButtonsInset]=\"true\">\n * <button slot=\"start\">Back</button>\n * <span slot=\"centre\">Project</span>\n * <button slot=\"end\">Share</button>\n * </hx-app-toolbar>\n * ```\n *\n * The bar and its centre carry `data-tauri-drag-region`, so a Tauri window is dragged by them; buttons\n * in the start and end slot are not part of the region. Set `windowButtonsInset` when the title bar is\n * hidden on macOS: the start group then leaves room for the window buttons.\n */\n@Component({\n selector: 'hx-app-toolbar',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'hx-app-toolbar',\n '[class.hx-app-toolbar-inset]': 'windowButtonsInset()',\n 'data-tauri-drag-region': '',\n },\n templateUrl: './app-toolbar.html',\n})\nexport class HxAppToolbar {\n /** Reserve room at the start for the macOS window buttons (a hidden title bar). */\n readonly windowButtonsInset = input(false, { transform: booleanAttribute });\n}\n","<div class=\"hx-app-toolbar-start\"><ng-content select=\"[slot=start]\" /></div>\n<div class=\"hx-app-toolbar-centre\" data-tauri-drag-region>\n <ng-content select=\"[slot=centre]\" />\n</div>\n<div class=\"hx-app-toolbar-end\"><ng-content select=\"[slot=end]\" /></div>\n","import { NgTemplateOutlet } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n computed,\n input,\n output,\n type TemplateRef,\n} from '@angular/core';\nimport type { HxActivityBarItem } from '../activity-bar/activity-bar';\nimport { HX_BOTTOM_BAR_MAX_ITEMS } from '@gravionlabs/helix-app';\n\nexport { HX_BOTTOM_BAR_MAX_ITEMS };\n\n/** An item of the bottom bar: the same shape as an activity bar item. */\nexport type HxBottomBarItem = HxActivityBarItem;\n\n/**\n * The tab bar at the bottom of the mobile shell: up to five views or actions, each a touch target of at\n * least 44 pt. It has no tooltips. The bottom safe area (home indicator) is part of its padding.\n *\n * ```html\n * <hx-bottom-bar [items]=\"items\" [activeId]=\"activeId()\" (selected)=\"select($event)\" />\n * ```\n */\n@Component({\n selector: 'hx-bottom-bar',\n imports: [NgTemplateOutlet],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: { class: 'hx-bottom-bar', role: 'toolbar', '[attr.aria-label]': 'label()' },\n templateUrl: './bottom-bar.html',\n})\nexport class HxBottomBar {\n /** The views and actions; only the first five are shown. */\n readonly items = input.required<readonly HxBottomBarItem[]>();\n readonly activeId = input<string | null>(null);\n readonly label = input('Views');\n\n /** Emits the id of the selected view or the activated action. */\n readonly selected = output<string>();\n\n protected readonly visible = computed(() => this.items().slice(0, HX_BOTTOM_BAR_MAX_ITEMS));\n\n protected isActive(item: HxBottomBarItem): boolean {\n return item.kind !== 'action' && item.id === this.activeId();\n }\n\n protected asTemplate(icon: HxBottomBarItem['icon']): TemplateRef<unknown> | null {\n return typeof icon === 'string' ? null : icon;\n }\n}\n","@for (item of visible(); track item.id) {\n <button\n type=\"button\"\n class=\"hx-bottom-bar-item\"\n [class.hx-bottom-bar-active]=\"isActive(item)\"\n [attr.data-id]=\"item.id\"\n [attr.aria-label]=\"item.label\"\n [attr.aria-pressed]=\"item.kind === 'action' ? null : isActive(item)\"\n (click)=\"selected.emit(item.id)\"\n >\n <span class=\"hx-bottom-bar-icon\" aria-hidden=\"true\">\n @if (asTemplate(item.icon); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" />\n } @else {\n <span [class]=\"item.icon\"></span>\n }\n </span>\n <span class=\"hx-bottom-bar-label\">{{ item.label }}</span>\n @if (item.badge !== undefined && item.badge !== null) {\n <span class=\"hx-bottom-bar-badge\" [class.hx-bottom-bar-badge-dot]=\"item.badge === true\">{{\n item.badge === true ? '' : item.badge\n }}</span>\n }\n </button>\n}\n","import { NgTemplateOutlet } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n computed,\n input,\n model,\n output,\n type TemplateRef,\n} from '@angular/core';\nimport { HxDrawer } from '@gravionlabs/helix-ui';\nimport {\n getHxPlatform,\n hxMobileViews,\n hxViewsFor,\n type HelixView,\n type HxPlatform,\n} from '@gravionlabs/helix-app';\nimport { HxBottomBar, type HxBottomBarItem } from './bottom-bar';\n\n/** A view of the mobile shell; an app may mark an entry as an action (`kind: 'action'`). */\nexport type HxMobileShellView = HelixView & { readonly kind?: 'view' | 'action' };\n\n/** A horizontal swipe toward the edge of the drawer closes it from this distance (px). */\nconst SWIPE_DISTANCE = 48;\n\n/**\n * The layout of a phone app: a top bar with the menu button, the content, a bottom bar, and a drawer for\n * the sidebar views. It has no status bar and no hover tooltips. The notch, the home indicator and the\n * keyboard are kept clear with `env(safe-area-inset-*)`.\n *\n * ```html\n * <hx-mobile-shell #shell [items]=\"items\" [(activeId)]=\"viewId\" [(drawerOpen)]=\"drawer\" heading=\"Helix\">\n * <nav slot=\"drawer\"><button (click)=\"shell.chooseView('files')\">Files</button></nav>\n * ...the view of activeId...\n * </hx-mobile-shell>\n * ```\n *\n * With `views` (and `platform`, default `getHxPlatform()`) the bottom bar shows the views with\n * `mobilePlacement: 'bar'` in `barOrder` and the drawer lists the others (icon and label, the active one\n * marked) above the `drawer` slot. `showView(id)` activates a view of the platform and closes the drawer;\n * `selected` emits the id of every tap, an entry with `kind: 'action'` never becomes active.\n *\n * Choose it by platform: `@if (platform === 'mobile') { <hx-mobile-shell> } @else { <hx-app-shell> }`\n * (`getHxPlatform()`), never by the window width. The drawer closes on a tap outside, on a swipe toward its\n * edge, on Escape and after `chooseView`. Set `<meta name=\"viewport\" content=\"..., viewport-fit=cover,\n * interactive-widget=resizes-content\">` so the safe-area insets and the keyboard work.\n */\n@Component({\n selector: 'hx-mobile-shell',\n imports: [HxBottomBar, HxDrawer, NgTemplateOutlet],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: { class: 'hx-mobile-shell' },\n templateUrl: './mobile-shell.html',\n})\nexport class HxMobileShell {\n /** The views and actions of the bottom bar (at most five are shown); `views` wins when both are set. */\n readonly items = input<readonly HxBottomBarItem[]>([]);\n /**\n * The views of the app. The bottom bar shows `hxMobileViews(views, platform).bar`, the drawer lists the\n * others above the `drawer` slot.\n */\n readonly views = input<readonly HxMobileShellView[] | undefined>(undefined);\n /** The platform the views are filtered for. */\n readonly platform = input<HxPlatform>(getHxPlatform());\n /** The id of the active view (two-way). */\n readonly activeId = model<string | null>(null);\n /** Whether the drawer is open (two-way). */\n readonly drawerOpen = model(false);\n readonly heading = input('');\n readonly menuLabel = input('Menu');\n readonly closeLabel = input('Close');\n readonly barLabel = input('Views');\n\n /** Emits the id of every tap on a bar or drawer entry, an action included. */\n readonly selected = output<string>();\n\n private readonly split = computed(() => {\n const views = this.views();\n return views ? hxMobileViews(views, this.platform()) : null;\n });\n protected readonly barItems = computed<readonly HxBottomBarItem[]>(\n () => this.split()?.bar ?? this.items(),\n );\n protected readonly drawerViews = computed<readonly HxMobileShellView[]>(\n () => this.split()?.drawer ?? [],\n );\n\n private touchX: number | null = null;\n\n /**\n * Make a view active and close the drawer. With `views` set, an id that does not exist on the platform\n * is ignored.\n */\n showView(id: string): void {\n const views = this.views();\n if (views && !hxViewsFor(views, this.platform()).some((v) => v.id === id)) return;\n this.activeId.set(id);\n this.drawerOpen.set(false);\n }\n\n /** Make a view active and close the drawer: call it when a sidebar view was chosen. */\n chooseView(id: string): void {\n this.showView(id);\n }\n\n protected onSelect(id: string): void {\n this.selected.emit(id);\n if (this.barItems().find((i) => i.id === id)?.kind === 'action') {\n this.drawerOpen.set(false);\n } else if (this.drawerViews().find((v) => v.id === id)?.kind === 'action') {\n this.drawerOpen.set(false);\n } else {\n this.showView(id);\n }\n }\n\n protected asTemplate(icon: HelixView['icon']): TemplateRef<unknown> | null {\n return typeof icon === 'string' ? null : icon;\n }\n\n protected onTouchStart(event: TouchEvent): void {\n this.touchX = event.changedTouches[0]?.clientX ?? null;\n }\n\n protected onTouchEnd(event: TouchEvent): void {\n const start = this.touchX;\n this.touchX = null;\n const end = event.changedTouches[0]?.clientX;\n if (start === null || end === undefined) return;\n const rtl = getComputedStyle(event.target as HTMLElement).direction === 'rtl';\n const delta = end - start;\n if (rtl ? delta >= SWIPE_DISTANCE : delta <= -SWIPE_DISTANCE) this.drawerOpen.set(false);\n }\n}\n","<header class=\"hx-mobile-shell-bar\">\n <button\n type=\"button\"\n class=\"hx-mobile-shell-menu\"\n [attr.aria-label]=\"menuLabel()\"\n aria-haspopup=\"dialog\"\n [attr.aria-expanded]=\"drawerOpen()\"\n (click)=\"drawerOpen.set(true)\"\n >\n <span aria-hidden=\"true\">&#9776;</span>\n </button>\n <span class=\"hx-mobile-shell-title\">{{ heading() }}</span>\n <ng-content select=\"[slot=end]\" />\n</header>\n<main class=\"hx-mobile-shell-content\"><ng-content /></main>\n<hx-bottom-bar\n [items]=\"barItems()\"\n [activeId]=\"activeId()\"\n [label]=\"barLabel()\"\n (selected)=\"onSelect($event)\"\n/>\n<hx-drawer\n [(visible)]=\"drawerOpen\"\n position=\"left\"\n [ariaLabel]=\"menuLabel()\"\n [closeLabel]=\"closeLabel()\"\n width=\"min(20rem, 85vw)\"\n panelClass=\"hx-mobile-shell-drawer\"\n>\n <div\n class=\"hx-mobile-shell-drawer-body\"\n (touchstart)=\"onTouchStart($event)\"\n (touchend)=\"onTouchEnd($event)\"\n >\n @if (views()) {\n <ul class=\"hx-mobile-shell-drawer-list\" [attr.aria-label]=\"barLabel()\">\n @for (view of drawerViews(); track view.id) {\n <li>\n <button\n type=\"button\"\n class=\"hx-mobile-shell-drawer-item\"\n [class.hx-mobile-shell-drawer-active]=\"view.kind !== 'action' && view.id === activeId()\"\n [attr.data-id]=\"view.id\"\n [attr.aria-current]=\"view.kind !== 'action' && view.id === activeId() ? 'true' : null\"\n (click)=\"onSelect(view.id)\"\n >\n <span class=\"hx-mobile-shell-drawer-icon\" aria-hidden=\"true\">\n @if (asTemplate(view.icon); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" />\n } @else {\n <span [class]=\"view.icon\"></span>\n }\n </span>\n <span class=\"hx-mobile-shell-drawer-label\">{{ view.label }}</span>\n </button>\n </li>\n }\n </ul>\n }\n <ng-content select=\"[slot=drawer]\" />\n </div>\n</hx-drawer>\n","import { ChangeDetectionStrategy, Component } from '@angular/core';\n\n/**\n * The bottom bar of a desktop app: a start group at the left and an end group at the right.\n *\n * ```html\n * <hx-status-bar>\n * <hx-status-item slot=\"start\">Ready</hx-status-item>\n * <hx-status-version slot=\"end\" version=\"1.4.0\" channel=\"RC\" />\n * </hx-status-bar>\n * ```\n *\n * A conditional group of items needs one root node that carries the slot, because content projection\n * selects by attribute and an `@if` with several root nodes projects nothing (NG8011):\n *\n * ```html\n * @if (active()) {\n * <ng-container ngProjectAs=\"[slot=end]\">\n * <hx-status-item>Input</hx-status-item>\n * <hx-status-item>119×46</hx-status-item>\n * </ng-container>\n * }\n * ```\n *\n * Project items with `slot=\"start\"` or `slot=\"end\"`. The bar has no role of its own: only an item that\n * announces a change sets `role=\"status\"` (see `HxStatusItem`).\n */\n@Component({\n selector: 'hx-status-bar',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: { class: 'hx-status-bar' },\n templateUrl: './status-bar.html',\n})\nexport class HxStatusBar {}\n","<div class=\"hx-status-group hx-status-start\"><ng-content select=\"[slot=start]\" /></div>\n<div class=\"hx-status-group hx-status-end\"><ng-content select=\"[slot=end]\" /></div>\n","import { NgTemplateOutlet } from '@angular/common';\nimport {\n afterEveryRender,\n afterRenderEffect,\n ChangeDetectionStrategy,\n Component,\n contentChild,\n Directive,\n ElementRef,\n inject,\n input,\n model,\n output,\n viewChild,\n} from '@angular/core';\n\n/** Marks the content of a status item that opens as a popover above the bar. */\n@Directive({ selector: '[hxStatusPopover]' })\nexport class HxStatusPopover {}\n\n/** The tone of a status item. */\nexport type HxStatusTone = 'neutral' | 'warn' | 'error' | 'accent';\n\n/** The gap in px that an open popover keeps to the left and right window edge. */\nconst POPOVER_EDGE_GAP = 4;\n\n/**\n * One item of the status bar, as text or as a button.\n *\n * ```html\n * <hx-status-item kind=\"button\" title=\"Update available\" ariaLabel=\"Update details\" tone=\"accent\"\n * [(popoverOpen)]=\"open\">\n * Update 1.5.0\n * <div hxStatusPopover>Release notes ...</div>\n * </hx-status-item>\n * ```\n *\n * - `kind`: `'text'` (default) or `'button'`.\n * - `pressed`: emits when a button item is activated (click, Enter or Space). Not for a disabled item, a text\n * item or a click inside the popover.\n * - `announce`: sets `role=\"status\"` on the item, for a value that changes while the user works (a sync\n * state). The bar itself is not a live region.\n * - An element with `hxStatusPopover` inside the item is a popover above the bar, shown while\n * `popoverOpen` is true. Escape and a click outside close it. Give a popover item `kind=\"button\"`.\n * The popover ends at the end edge of the item and shifts as far as needed to stay inside the window.\n */\n@Component({\n selector: 'hx-status-item',\n imports: [NgTemplateOutlet],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'hx-status-item',\n '[class.hx-status-warn]': \"tone() === 'warn'\",\n '[class.hx-status-error]': \"tone() === 'error'\",\n '[class.hx-status-accent]': \"tone() === 'accent'\",\n '[attr.title]': 'null',\n '[attr.role]': \"announce() ? 'status' : null\",\n '(document:keydown.escape)': 'close()',\n '(document:click)': 'onDocumentClick($event)',\n '(window:resize)': 'placePopover()',\n },\n templateUrl: './status-item.html',\n})\nexport class HxStatusItem {\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /** Text or button. */\n readonly kind = input<'text' | 'button'>('text');\n /** The tooltip. */\n readonly title = input<string | null>(null);\n /** The accessible name, when the visible text is not enough. */\n readonly ariaLabel = input<string | null>(null);\n readonly disabled = input(false);\n readonly tone = input<HxStatusTone>('neutral');\n /** Marks the item as a live region (`role=\"status\"`). */\n readonly announce = input(false);\n /** Whether the popover is open. */\n readonly popoverOpen = model(false);\n /** Emits when a button item is activated by click, Enter or Space. */\n readonly pressed = output<void>();\n\n private readonly popover = contentChild(HxStatusPopover);\n private readonly panel = viewChild<ElementRef<HTMLElement>>('panel');\n\n constructor() {\n // The popover can grow after it opened (content that arrives later, an image, a web font).\n afterRenderEffect((onCleanup) => {\n const panel = this.panel()?.nativeElement;\n if (!panel || typeof ResizeObserver === 'undefined') return;\n const observer = new ResizeObserver(() => this.placePopover());\n observer.observe(panel);\n onCleanup(() => observer.disconnect());\n });\n // The item can move while the popover is open, for example when a neighbour's text changes.\n afterEveryRender(() => this.placePopover());\n }\n\n protected get hasPopover(): boolean {\n return this.popover() !== undefined;\n }\n\n protected onButtonClick(): void {\n if (this.hasPopover) this.popoverOpen.update((open) => !open);\n this.pressed.emit();\n }\n\n protected close(): void {\n if (this.popoverOpen()) this.popoverOpen.set(false);\n }\n\n /** Shifts the open popover horizontally so that it stays inside the window. */\n protected placePopover(): void {\n const panel = this.panel()?.nativeElement;\n if (!panel) return;\n // Measure the position the stylesheet gives, without an earlier shift.\n panel.style.transform = '';\n const { left, right } = panel.getBoundingClientRect();\n const maxRight = panel.ownerDocument.documentElement.clientWidth - POPOVER_EDGE_GAP;\n // The left edge wins: a popover wider than the window keeps its start readable.\n const shift = Math.max(Math.min(0, maxRight - right), POPOVER_EDGE_GAP - left);\n if (shift !== 0) panel.style.transform = `translateX(${shift}px)`;\n }\n\n protected onDocumentClick(event: Event): void {\n if (this.popoverOpen() && !this.host.nativeElement.contains(event.target as Node)) {\n this.popoverOpen.set(false);\n }\n }\n}\n","@if (kind() === 'button') {\n <button\n type=\"button\"\n class=\"hx-status-control\"\n [attr.title]=\"title()\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-haspopup]=\"hasPopover ? 'dialog' : null\"\n [attr.aria-expanded]=\"hasPopover ? popoverOpen() : null\"\n [disabled]=\"disabled()\"\n (click)=\"onButtonClick()\"\n >\n <ng-container [ngTemplateOutlet]=\"content\" />\n </button>\n} @else {\n <span class=\"hx-status-control\" [attr.title]=\"title()\" [attr.aria-label]=\"ariaLabel()\">\n <ng-container [ngTemplateOutlet]=\"content\" />\n </span>\n}\n<ng-template #content><ng-content /></ng-template>\n@if (popoverOpen()) {\n <div #panel class=\"hx-status-popover\"><ng-content select=\"[hxStatusPopover]\" /></div>\n}\n","import { ChangeDetectionStrategy, Component, input } from '@angular/core';\n\n/** The app version with an optional channel badge (`RC`). */\n@Component({\n selector: 'hx-status-version',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: { class: 'hx-status-version' },\n templateUrl: './status-version.html',\n})\nexport class HxStatusVersion {\n readonly version = input.required<string>();\n /** A channel badge such as `RC` or `beta`; none for a stable release. */\n readonly channel = input<string | null>(null);\n}\n","<span class=\"hx-status-control hx-status-version-text\">v{{ version() }}</span>\n@if (channel()) {\n <span class=\"hx-status-channel\">{{ channel() }}</span>\n}\n","import { ChangeDetectionStrategy, Component, input, model } from '@angular/core';\n\n/**\n * Zoom out, the level in percent (a click resets to `reset`), zoom in.\n *\n * ```html\n * <hx-status-zoom slot=\"end\" [(value)]=\"zoom\" [min]=\"50\" [max]=\"200\" />\n * ```\n *\n * `value` is a percentage and changes in steps of `step`, kept between `min` and `max`.\n */\n@Component({\n selector: 'hx-status-zoom',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: { class: 'hx-status-zoom' },\n templateUrl: './status-zoom.html',\n})\nexport class HxStatusZoom {\n /** The zoom level in percent. */\n readonly value = model(100);\n readonly min = input(50);\n readonly max = input(200);\n readonly step = input(10);\n /** The level a click on the percentage resets to. */\n readonly reset = input(100);\n\n protected change(delta: number): void {\n this.set(this.value() + delta);\n }\n\n protected set(next: number): void {\n const clamped = Math.min(this.max(), Math.max(this.min(), next));\n if (clamped !== this.value()) this.value.set(clamped);\n }\n}\n","<button\n type=\"button\"\n class=\"hx-status-control hx-status-zoom-out\"\n title=\"Zoom out\"\n aria-label=\"Zoom out\"\n [disabled]=\"value() <= min()\"\n (click)=\"change(-step())\"\n>\n &minus;\n</button>\n<button\n type=\"button\"\n class=\"hx-status-control hx-status-zoom-level\"\n title=\"Reset zoom\"\n [attr.aria-label]=\"'Reset zoom, ' + value() + ' percent'\"\n (click)=\"set(reset())\"\n>\n {{ value() }}%\n</button>\n<button\n type=\"button\"\n class=\"hx-status-control hx-status-zoom-in\"\n title=\"Zoom in\"\n aria-label=\"Zoom in\"\n [disabled]=\"value() >= max()\"\n (click)=\"change(step())\"\n>\n +\n</button>\n"],"mappings":";;;;;AAoDA,IAAa,gBAAb,MAAa,cAAa;CAEf,QAAQ,MAAM,SAAwC,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CAEtD,WAAW,MAAqB,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,WAAA,CAAA,+BAAA,CAAA,CAAA;CAErC,WAAW,MAAM,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,WAAA,CAAA,+BAAA,CAAA,CAAA;CAEtB,OAAO,MAAwB,QAAO,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CAEtC,OAAO,MAA2B,WAAU,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CAE5C,QAAQ,MAAM,gBAAe,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CAG7B,WAAW,OAAM;CAET,UAAU,aAA4C,UAAS,GAAA,YAAA,CAAA,EA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A,MAAA;EAAY,cAAA;EAAA,UAAA;EAAA,QAAA;GAAA,OAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,KAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,KAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,MAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,OAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;EAAA;EAAA,SAAA,EAAA,OAAA,cAAA;EAAA,MAAA,EAAA,gBAAA,iBAAA;EAAA,UAAA;EAAA,UCjBzB;EA6BA,iBAAA,GAAA,wBAAA;CAAA,CAAA;;ADZa,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAY,YAAA,CAAA;EANxB,MAAA;EACW,MAAA,CAAA;GAAA,UAAA;GAAgB,iBACT,wBAAwB;GAAM,MACzC,EAAE,OAAO,iBAAgB;GAAE,UAAA;EAAA,CAAA"}
@@ -0,0 +1,493 @@
1
+ import { DOCUMENT } from "@angular/common";
2
+ import * as i0 from "@angular/core";
3
+ import { ChangeDetectionStrategy, Component, Injectable, InjectionToken, computed, inject, input, provideEnvironmentInitializer, signal } from "@angular/core";
4
+ import { getHxPlatform, getHxPlatformKind, setHxPlatform } from "@gravionlabs/helix-app";
5
+ import { HxStatusItem, HxStatusPopover, HxStatusVersion } from "@gravionlabs/helix-app/frame";
6
+ const noopUpdateBackend = {
7
+ check: () => Promise.resolve(null),
8
+ install: () => Promise.resolve(),
9
+ relaunch: () => Promise.resolve()
10
+ };
11
+ function isTauri() {
12
+ return typeof window !== "undefined" && "__TAURI_INTERNALS__" in window;
13
+ }
14
+ function tauriUpdateBackend() {
15
+ let pending = null;
16
+ return {
17
+ async check() {
18
+ const { check } = await import("@tauri-apps/plugin-updater");
19
+ const update = await check();
20
+ if (!update) {
21
+ pending = null;
22
+ return null;
23
+ }
24
+ pending = update;
25
+ return {
26
+ version: update.version,
27
+ notes: update.body ?? null,
28
+ date: update.date ?? null
29
+ };
30
+ },
31
+ async install(onProgress) {
32
+ if (!pending) throw new Error("No update to install");
33
+ let total = 0;
34
+ let done = 0;
35
+ await pending.downloadAndInstall((e) => {
36
+ if (!onProgress) return;
37
+ if (e.event === "Started") {
38
+ total = e.data?.contentLength ?? 0;
39
+ done = 0;
40
+ onProgress(total > 0 ? 0 : null);
41
+ } else if (e.event === "Progress") {
42
+ done += e.data?.chunkLength ?? 0;
43
+ onProgress(total > 0 ? Math.min(100, Math.round(done / total * 100)) : null);
44
+ } else onProgress(total > 0 ? 100 : null);
45
+ });
46
+ },
47
+ async relaunch() {
48
+ const { relaunch } = await import("@tauri-apps/plugin-process");
49
+ await relaunch();
50
+ }
51
+ };
52
+ }
53
+ function defaultUpdateBackend() {
54
+ return isTauri() ? tauriUpdateBackend() : noopUpdateBackend;
55
+ }
56
+ const HX_APP_INFO = new InjectionToken("HX_APP_INFO", { factory: () => ({
57
+ version: "",
58
+ channel: "stable"
59
+ }) });
60
+ function channelOfVersion(version) {
61
+ return /-rc(\.|\d|$)/i.test(version) ? "rc" : "stable";
62
+ }
63
+ function provideHxAppInfo(info) {
64
+ return {
65
+ provide: HX_APP_INFO,
66
+ useValue: {
67
+ version: info.version,
68
+ channel: info.channel ?? channelOfVersion(info.version)
69
+ }
70
+ };
71
+ }
72
+ async function readTauriVersion(fallback = "") {
73
+ if (!isTauri()) return fallback;
74
+ try {
75
+ const { getVersion } = await import("@tauri-apps/api/app");
76
+ return await getVersion();
77
+ } catch {
78
+ return fallback;
79
+ }
80
+ }
81
+ function detectHxOs(ua = typeof navigator === "undefined" ? "" : navigator.userAgent, tauri = isTauri()) {
82
+ if (!tauri) return "web";
83
+ if (/android/i.test(ua)) return "android";
84
+ if (/iphone|ipad|ipod/i.test(ua)) return "ios";
85
+ if (/windows/i.test(ua)) return "windows";
86
+ if (/mac/i.test(ua)) return "macos";
87
+ if (/linux|x11/i.test(ua)) return "linux";
88
+ return "web";
89
+ }
90
+ function providePlatform(os) {
91
+ return provideEnvironmentInitializer(() => {
92
+ setHxPlatform(os ?? detectHxOs(), inject(DOCUMENT).documentElement);
93
+ });
94
+ }
95
+ var HxStatusAppVersion = class HxStatusAppVersion {
96
+ info = inject(HX_APP_INFO);
97
+ static ɵfac = i0.ɵɵngDeclareFactory({
98
+ minVersion: "12.0.0",
99
+ version: "22.3.0",
100
+ ngImport: i0,
101
+ type: HxStatusAppVersion,
102
+ deps: [],
103
+ target: i0.ɵɵFactoryTarget.Component
104
+ });
105
+ static ɵcmp = i0.ɵɵngDeclareComponent({
106
+ minVersion: "14.0.0",
107
+ version: "22.3.0",
108
+ type: HxStatusAppVersion,
109
+ isStandalone: true,
110
+ selector: "hx-status-app-version",
111
+ ngImport: i0,
112
+ template: "<hx-status-version [version]=\"info.version\" [channel]=\"info.channel === 'rc' ? 'RC' : null\" />\n",
113
+ dependencies: [{
114
+ kind: "component",
115
+ type: HxStatusVersion,
116
+ selector: "hx-status-version",
117
+ inputs: ["version", "channel"]
118
+ }],
119
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
120
+ });
121
+ };
122
+ i0.ɵɵngDeclareClassMetadata({
123
+ minVersion: "12.0.0",
124
+ version: "22.3.0",
125
+ ngImport: i0,
126
+ type: HxStatusAppVersion,
127
+ decorators: [{
128
+ type: Component,
129
+ args: [{
130
+ selector: "hx-status-app-version",
131
+ imports: [HxStatusVersion],
132
+ changeDetection: ChangeDetectionStrategy.OnPush,
133
+ template: "<hx-status-version [version]=\"info.version\" [channel]=\"info.channel === 'rc' ? 'RC' : null\" />\n"
134
+ }]
135
+ }]
136
+ });
137
+ const HX_UPDATE_BACKEND = new InjectionToken("HX_UPDATE_BACKEND", { factory: () => defaultUpdateBackend() });
138
+ const HX_UPDATE_BEFORE_INSTALL = new InjectionToken("HX_UPDATE_BEFORE_INSTALL", { factory: () => null });
139
+ const HX_UPDATE_CURRENT_MS = 3e3;
140
+ var HxUpdateService = class HxUpdateService {
141
+ backend = inject(HX_UPDATE_BACKEND);
142
+ beforeInstall = inject(HX_UPDATE_BEFORE_INSTALL);
143
+ info = inject(HX_APP_INFO);
144
+ _currentShown = signal(false, ...ngDevMode ? [{ debugName: "_currentShown" }] : /* istanbul ignore next */ []);
145
+ retryUpdate = null;
146
+ currentTimer;
147
+ _state = signal({ status: "idle" }, ...ngDevMode ? [{ debugName: "_state" }] : /* istanbul ignore next */ []);
148
+ state = this._state.asReadonly();
149
+ currentShown = this._currentShown.asReadonly();
150
+ version = this.info.version;
151
+ channel = this.info.channel;
152
+ update = computed(() => {
153
+ const s = this._state();
154
+ return s.status === "available" || s.status === "installing" ? s.update : null;
155
+ }, ...ngDevMode ? [{ debugName: "update" }] : /* istanbul ignore next */ []);
156
+ start() {
157
+ return this.channel === "rc" ? Promise.resolve() : this.check();
158
+ }
159
+ async check(options = {}) {
160
+ const s = this._state().status;
161
+ if (s === "checking" || s === "installing") return;
162
+ clearTimeout(this.currentTimer);
163
+ this._currentShown.set(false);
164
+ this.retryUpdate = null;
165
+ this._state.set({ status: "checking" });
166
+ try {
167
+ const update = await this.backend.check();
168
+ this._state.set(update ? {
169
+ status: "available",
170
+ update
171
+ } : { status: "current" });
172
+ if (!update && options.manual) {
173
+ this._currentShown.set(true);
174
+ this.currentTimer = setTimeout(() => {
175
+ this._currentShown.set(false);
176
+ if (this._state().status === "current") this._state.set({ status: "idle" });
177
+ }, HX_UPDATE_CURRENT_MS);
178
+ }
179
+ } catch (e) {
180
+ this.fail("check", e);
181
+ }
182
+ }
183
+ async installAndRestart() {
184
+ const state = this._state();
185
+ const update = state.status === "available" ? state.update : state.status === "error" && state.step === "install" ? this.retryUpdate : null;
186
+ if (!update) return;
187
+ this.retryUpdate = update;
188
+ this._state.set({
189
+ status: "installing",
190
+ update,
191
+ percent: null
192
+ });
193
+ try {
194
+ await this.beforeInstall?.(update);
195
+ await this.backend.install((percent) => {
196
+ if (this._state().status === "installing") this._state.set({
197
+ status: "installing",
198
+ update,
199
+ percent
200
+ });
201
+ });
202
+ } catch (e) {
203
+ this.fail("install", e);
204
+ return;
205
+ }
206
+ try {
207
+ await this.backend.relaunch();
208
+ } catch (e) {
209
+ this.fail("relaunch", e);
210
+ }
211
+ }
212
+ fail(step, e) {
213
+ this._state.set({
214
+ status: "error",
215
+ step,
216
+ message: e instanceof Error ? e.message : String(e)
217
+ });
218
+ }
219
+ static ɵfac = i0.ɵɵngDeclareFactory({
220
+ minVersion: "12.0.0",
221
+ version: "22.3.0",
222
+ ngImport: i0,
223
+ type: HxUpdateService,
224
+ deps: [],
225
+ target: i0.ɵɵFactoryTarget.Injectable
226
+ });
227
+ static ɵprov = i0.ɵɵngDeclareInjectable({
228
+ minVersion: "12.0.0",
229
+ version: "22.3.0",
230
+ ngImport: i0,
231
+ type: HxUpdateService,
232
+ providedIn: "root"
233
+ });
234
+ };
235
+ i0.ɵɵngDeclareClassMetadata({
236
+ minVersion: "12.0.0",
237
+ version: "22.3.0",
238
+ ngImport: i0,
239
+ type: HxUpdateService,
240
+ decorators: [{
241
+ type: Injectable,
242
+ args: [{ providedIn: "root" }]
243
+ }]
244
+ });
245
+ var HxStatusUpdate = class HxStatusUpdate {
246
+ service = inject(HxUpdateService);
247
+ root = inject(DOCUMENT).documentElement;
248
+ checkingLabel = input("Checking for updates", ...ngDevMode ? [{ debugName: "checkingLabel" }] : /* istanbul ignore next */ []);
249
+ availableLabel = input("Update", ...ngDevMode ? [{ debugName: "availableLabel" }] : /* istanbul ignore next */ []);
250
+ installingLabel = input("Installing update", ...ngDevMode ? [{ debugName: "installingLabel" }] : /* istanbul ignore next */ []);
251
+ errorLabel = input("Update failed", ...ngDevMode ? [{ debugName: "errorLabel" }] : /* istanbul ignore next */ []);
252
+ installLabel = input("Install and restart", ...ngDevMode ? [{ debugName: "installLabel" }] : /* istanbul ignore next */ []);
253
+ retryLabel = input("Try again", ...ngDevMode ? [{ debugName: "retryLabel" }] : /* istanbul ignore next */ []);
254
+ checkLabel = input("Check for updates", ...ngDevMode ? [{ debugName: "checkLabel" }] : /* istanbul ignore next */ []);
255
+ upToDateLabel = input("Up to date", ...ngDevMode ? [{ debugName: "upToDateLabel" }] : /* istanbul ignore next */ []);
256
+ alwaysVisible = input(false, ...ngDevMode ? [{ debugName: "alwaysVisible" }] : /* istanbul ignore next */ []);
257
+ open = signal(false, ...ngDevMode ? [{ debugName: "open" }] : /* istanbul ignore next */ []);
258
+ state = this.service.state;
259
+ visible = computed(() => {
260
+ if (getHxPlatformKind(getHxPlatform(this.root)) === "mobile") return false;
261
+ const status = this.state().status;
262
+ if ([
263
+ "checking",
264
+ "available",
265
+ "installing",
266
+ "error"
267
+ ].includes(status)) return true;
268
+ return this.alwaysVisible() || status === "current" && this.service.currentShown();
269
+ }, ...ngDevMode ? [{ debugName: "visible" }] : /* istanbul ignore next */ []);
270
+ checkOnly = computed(() => ["idle", "current"].includes(this.state().status), ...ngDevMode ? [{ debugName: "checkOnly" }] : /* istanbul ignore next */ []);
271
+ checkNow() {
272
+ this.service.check({ manual: true });
273
+ }
274
+ retry() {
275
+ const s = this.state();
276
+ s.status === "error" && s.step === "install" ? this.service.installAndRestart() : this.service.check();
277
+ }
278
+ label = computed(() => {
279
+ const s = this.state();
280
+ switch (s.status) {
281
+ case "checking": return this.checkingLabel();
282
+ case "available": return `${this.availableLabel()} ${s.update.version}`;
283
+ case "installing": return s.percent === null ? this.installingLabel() : `${this.installingLabel()} ${s.percent}%`;
284
+ case "current": return this.service.currentShown() ? this.upToDateLabel() : this.checkLabel();
285
+ case "idle": return this.checkLabel();
286
+ case "error": return this.errorLabel();
287
+ default: return "";
288
+ }
289
+ }, ...ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []);
290
+ tone = computed(() => {
291
+ const s = this.state().status;
292
+ return s === "error" ? "error" : s === "available" ? "accent" : "neutral";
293
+ }, ...ngDevMode ? [{ debugName: "tone" }] : /* istanbul ignore next */ []);
294
+ errorText = computed(() => {
295
+ const s = this.state();
296
+ return s.status === "error" ? `${s.step}: ${s.message}` : "";
297
+ }, ...ngDevMode ? [{ debugName: "errorText" }] : /* istanbul ignore next */ []);
298
+ static ɵfac = i0.ɵɵngDeclareFactory({
299
+ minVersion: "12.0.0",
300
+ version: "22.3.0",
301
+ ngImport: i0,
302
+ type: HxStatusUpdate,
303
+ deps: [],
304
+ target: i0.ɵɵFactoryTarget.Component
305
+ });
306
+ static ɵcmp = i0.ɵɵngDeclareComponent({
307
+ minVersion: "17.0.0",
308
+ version: "22.3.0",
309
+ type: HxStatusUpdate,
310
+ isStandalone: true,
311
+ selector: "hx-status-update",
312
+ inputs: {
313
+ checkingLabel: {
314
+ classPropertyName: "checkingLabel",
315
+ publicName: "checkingLabel",
316
+ isSignal: true,
317
+ isRequired: false,
318
+ transformFunction: null
319
+ },
320
+ availableLabel: {
321
+ classPropertyName: "availableLabel",
322
+ publicName: "availableLabel",
323
+ isSignal: true,
324
+ isRequired: false,
325
+ transformFunction: null
326
+ },
327
+ installingLabel: {
328
+ classPropertyName: "installingLabel",
329
+ publicName: "installingLabel",
330
+ isSignal: true,
331
+ isRequired: false,
332
+ transformFunction: null
333
+ },
334
+ errorLabel: {
335
+ classPropertyName: "errorLabel",
336
+ publicName: "errorLabel",
337
+ isSignal: true,
338
+ isRequired: false,
339
+ transformFunction: null
340
+ },
341
+ installLabel: {
342
+ classPropertyName: "installLabel",
343
+ publicName: "installLabel",
344
+ isSignal: true,
345
+ isRequired: false,
346
+ transformFunction: null
347
+ },
348
+ retryLabel: {
349
+ classPropertyName: "retryLabel",
350
+ publicName: "retryLabel",
351
+ isSignal: true,
352
+ isRequired: false,
353
+ transformFunction: null
354
+ },
355
+ checkLabel: {
356
+ classPropertyName: "checkLabel",
357
+ publicName: "checkLabel",
358
+ isSignal: true,
359
+ isRequired: false,
360
+ transformFunction: null
361
+ },
362
+ upToDateLabel: {
363
+ classPropertyName: "upToDateLabel",
364
+ publicName: "upToDateLabel",
365
+ isSignal: true,
366
+ isRequired: false,
367
+ transformFunction: null
368
+ },
369
+ alwaysVisible: {
370
+ classPropertyName: "alwaysVisible",
371
+ publicName: "alwaysVisible",
372
+ isSignal: true,
373
+ isRequired: false,
374
+ transformFunction: null
375
+ }
376
+ },
377
+ ngImport: i0,
378
+ template: "@if (visible() && checkOnly()) {\n <hx-status-item\n kind=\"button\"\n [announce]=\"true\"\n [title]=\"label()\"\n [ariaLabel]=\"label()\"\n (pressed)=\"checkNow()\"\n >\n <span class=\"hx-update-label\">{{ label() }}</span>\n </hx-status-item>\n} @else if (visible()) {\n <hx-status-item\n kind=\"button\"\n [announce]=\"true\"\n [tone]=\"tone()\"\n [title]=\"label()\"\n [ariaLabel]=\"label()\"\n [(popoverOpen)]=\"open\"\n >\n <span class=\"hx-update-label\">{{ label() }}</span>\n <div hxStatusPopover class=\"hx-update-details\">\n @switch (state().status) {\n @case ('error') {\n <p class=\"hx-update-message\">{{ errorText() }}</p>\n <button type=\"button\" class=\"hx-update-action\" (click)=\"retry()\">\n {{ retryLabel() }}\n </button>\n }\n @default {\n @if (service.update(); as update) {\n <p class=\"hx-update-version\">{{ update.version }}</p>\n @if (update.notes) {\n <p class=\"hx-update-notes\">{{ update.notes }}</p>\n }\n <button\n type=\"button\"\n class=\"hx-update-action\"\n [disabled]=\"state().status === 'installing'\"\n (click)=\"service.installAndRestart()\"\n >\n {{ installLabel() }}\n </button>\n }\n }\n }\n </div>\n </hx-status-item>\n}\n",
379
+ dependencies: [{
380
+ kind: "component",
381
+ type: HxStatusItem,
382
+ selector: "hx-status-item",
383
+ inputs: [
384
+ "kind",
385
+ "title",
386
+ "ariaLabel",
387
+ "disabled",
388
+ "tone",
389
+ "announce",
390
+ "popoverOpen"
391
+ ],
392
+ outputs: ["popoverOpenChange", "pressed"]
393
+ }, {
394
+ kind: "directive",
395
+ type: HxStatusPopover,
396
+ selector: "[hxStatusPopover]"
397
+ }],
398
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
399
+ });
400
+ };
401
+ i0.ɵɵngDeclareClassMetadata({
402
+ minVersion: "12.0.0",
403
+ version: "22.3.0",
404
+ ngImport: i0,
405
+ type: HxStatusUpdate,
406
+ decorators: [{
407
+ type: Component,
408
+ args: [{
409
+ selector: "hx-status-update",
410
+ imports: [HxStatusItem, HxStatusPopover],
411
+ changeDetection: ChangeDetectionStrategy.OnPush,
412
+ template: "@if (visible() && checkOnly()) {\n <hx-status-item\n kind=\"button\"\n [announce]=\"true\"\n [title]=\"label()\"\n [ariaLabel]=\"label()\"\n (pressed)=\"checkNow()\"\n >\n <span class=\"hx-update-label\">{{ label() }}</span>\n </hx-status-item>\n} @else if (visible()) {\n <hx-status-item\n kind=\"button\"\n [announce]=\"true\"\n [tone]=\"tone()\"\n [title]=\"label()\"\n [ariaLabel]=\"label()\"\n [(popoverOpen)]=\"open\"\n >\n <span class=\"hx-update-label\">{{ label() }}</span>\n <div hxStatusPopover class=\"hx-update-details\">\n @switch (state().status) {\n @case ('error') {\n <p class=\"hx-update-message\">{{ errorText() }}</p>\n <button type=\"button\" class=\"hx-update-action\" (click)=\"retry()\">\n {{ retryLabel() }}\n </button>\n }\n @default {\n @if (service.update(); as update) {\n <p class=\"hx-update-version\">{{ update.version }}</p>\n @if (update.notes) {\n <p class=\"hx-update-notes\">{{ update.notes }}</p>\n }\n <button\n type=\"button\"\n class=\"hx-update-action\"\n [disabled]=\"state().status === 'installing'\"\n (click)=\"service.installAndRestart()\"\n >\n {{ installLabel() }}\n </button>\n }\n }\n }\n </div>\n </hx-status-item>\n}\n"
413
+ }]
414
+ }],
415
+ propDecorators: {
416
+ checkingLabel: [{
417
+ type: i0.Input,
418
+ args: [{
419
+ isSignal: true,
420
+ alias: "checkingLabel",
421
+ required: false
422
+ }]
423
+ }],
424
+ availableLabel: [{
425
+ type: i0.Input,
426
+ args: [{
427
+ isSignal: true,
428
+ alias: "availableLabel",
429
+ required: false
430
+ }]
431
+ }],
432
+ installingLabel: [{
433
+ type: i0.Input,
434
+ args: [{
435
+ isSignal: true,
436
+ alias: "installingLabel",
437
+ required: false
438
+ }]
439
+ }],
440
+ errorLabel: [{
441
+ type: i0.Input,
442
+ args: [{
443
+ isSignal: true,
444
+ alias: "errorLabel",
445
+ required: false
446
+ }]
447
+ }],
448
+ installLabel: [{
449
+ type: i0.Input,
450
+ args: [{
451
+ isSignal: true,
452
+ alias: "installLabel",
453
+ required: false
454
+ }]
455
+ }],
456
+ retryLabel: [{
457
+ type: i0.Input,
458
+ args: [{
459
+ isSignal: true,
460
+ alias: "retryLabel",
461
+ required: false
462
+ }]
463
+ }],
464
+ checkLabel: [{
465
+ type: i0.Input,
466
+ args: [{
467
+ isSignal: true,
468
+ alias: "checkLabel",
469
+ required: false
470
+ }]
471
+ }],
472
+ upToDateLabel: [{
473
+ type: i0.Input,
474
+ args: [{
475
+ isSignal: true,
476
+ alias: "upToDateLabel",
477
+ required: false
478
+ }]
479
+ }],
480
+ alwaysVisible: [{
481
+ type: i0.Input,
482
+ args: [{
483
+ isSignal: true,
484
+ alias: "alwaysVisible",
485
+ required: false
486
+ }]
487
+ }]
488
+ }
489
+ });
490
+ const HELIX_DESKTOP_TAURI = true;
491
+ export { HELIX_DESKTOP_TAURI, HX_APP_INFO, HX_UPDATE_BACKEND, HX_UPDATE_BEFORE_INSTALL, HX_UPDATE_CURRENT_MS, HxStatusAppVersion, HxStatusUpdate, HxUpdateService, channelOfVersion, defaultUpdateBackend, detectHxOs, isTauri, noopUpdateBackend, provideHxAppInfo, providePlatform, readTauriVersion, tauriUpdateBackend };
492
+
493
+ //# sourceMappingURL=gravionlabs-helix-app-tauri.mjs.map