@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.
- package/LICENSE.md +21 -0
- package/README.md +147 -1
- package/fesm2022/gravionlabs-helix-app-frame.mjs +1633 -0
- package/fesm2022/gravionlabs-helix-app-frame.mjs.map +1 -0
- package/fesm2022/gravionlabs-helix-app-tauri.mjs +493 -0
- package/fesm2022/gravionlabs-helix-app-tauri.mjs.map +1 -0
- package/fesm2022/gravionlabs-helix-app.mjs +1023 -0
- package/fesm2022/gravionlabs-helix-app.mjs.map +1 -0
- package/frame/package.json +5 -0
- package/frame.css +540 -0
- package/package.json +61 -5
- package/styles.css +12 -0
- package/tauri/package.json +5 -0
- package/types/gravionlabs-helix-app-frame.d.ts +636 -0
- package/types/gravionlabs-helix-app-tauri.d.ts +208 -0
- package/types/gravionlabs-helix-app.d.ts +360 -0
package/LICENSE.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 GravionLabs
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,149 @@
|
|
|
1
1
|
# @gravionlabs/helix-app
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The Helix desktop frame for Angular: app shell, activity bar, views, status bar, mobile shell, settings view and the
|
|
4
|
+
platform switch (see [ADR 0036](../../docs/adr/0036-helix-app-its-split-with-helix-ui-and-tauri-in-helix-tauri.md)).
|
|
5
|
+
|
|
6
|
+
```sh
|
|
7
|
+
pnpm add @gravionlabs/helix-app
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## Components
|
|
11
|
+
|
|
12
|
+
| Selector | Component | Entry | What it is |
|
|
13
|
+
| ----------------------- | -------------------- | -------- | --------------------------------------------------------------- |
|
|
14
|
+
| `hx-app-shell` | `HxAppShell` | /frame | desktop layout: toolbar, activity bar, sidebar, content, panels |
|
|
15
|
+
| `hx-app-toolbar` | `HxAppToolbar` | /frame | top bar that drags a Tauri window |
|
|
16
|
+
| `hx-activity-bar` | `HxActivityBar` | /frame | icon rail that selects the sidebar view and holds actions |
|
|
17
|
+
| `hx-status-bar` | `HxStatusBar` | /frame | bottom bar with a start and an end group |
|
|
18
|
+
| `hx-status-item` | `HxStatusItem` | /frame | text or button item of the status bar, with an optional popover |
|
|
19
|
+
| `hx-status-version` | `HxStatusVersion` | /frame | version with an optional channel badge |
|
|
20
|
+
| `hx-status-zoom` | `HxStatusZoom` | /frame | zoom control |
|
|
21
|
+
| `hx-mobile-shell` | `HxMobileShell` | /frame | phone layout: top bar, content, bottom bar and a drawer |
|
|
22
|
+
| `hx-bottom-bar` | `HxBottomBar` | /frame | bottom navigation of the phone layout |
|
|
23
|
+
| `hx-settings-view` | `HxSettingsView` | main | tree of settings pages with a search |
|
|
24
|
+
| `hx-status-update` | `HxStatusUpdate` | `/tauri` | update state as a status item |
|
|
25
|
+
| `hx-status-app-version` | `HxStatusAppVersion` | `/tauri` | version and channel of the running app |
|
|
26
|
+
|
|
27
|
+
See [Helix App](https://github.com/GravionLabs/helix/blob/main/docs/HELIX-APP.md) for the full reference.
|
|
28
|
+
|
|
29
|
+
## Entry points
|
|
30
|
+
|
|
31
|
+
| Entry | Content |
|
|
32
|
+
| ------------------------------ | --------------------------------------------------------------- |
|
|
33
|
+
| `@gravionlabs/helix-app` | View contract, platform switch, settings. No `@tauri-apps/*`. |
|
|
34
|
+
| `@gravionlabs/helix-app/frame` | The frames: app shell, activity bar, status bar, mobile shell. |
|
|
35
|
+
| `@gravionlabs/helix-app/tauri` | The Tauri bindings. Only this entry may import `@tauri-apps/*`. |
|
|
36
|
+
|
|
37
|
+
Stylesheets: `styles.css` (main entry) and `frame.css` (the `/frame` entry). Moving from the former desktop package: [migration note](https://github.com/GravionLabs/helix/blob/main/docs/MIGRATION-helix-app.md).
|
|
38
|
+
|
|
39
|
+
`pnpm lint:no-tauri` fails on an `@tauri-apps/*` import outside the `tauri` entry.
|
|
40
|
+
|
|
41
|
+
## Appearance settings
|
|
42
|
+
|
|
43
|
+
`provideHxSettings(options?)` registers the page "Appearance" (theme Light/Dark/System, density, UI font family and
|
|
44
|
+
size) in the shared group "Appearance & Behavior"; "General" is for pages of the app.
|
|
45
|
+
|
|
46
|
+
```ts
|
|
47
|
+
providers: [provideHxTheme({ storageKey: "my-app-theme" }), provideHxSettings()];
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
An app with a settings file of its own passes `appearance.store` (`HxAppearanceStore`). A color scheme that fixes
|
|
51
|
+
light or dark calls `HxTheme.setDark()` and leaves the stored mode alone, so the page shows the store's mode. Details:
|
|
52
|
+
[Settings](https://github.com/GravionLabs/helix/blob/main/docs/HELIX-APP.md#appearance-settings).
|
|
53
|
+
|
|
54
|
+
## Settings view
|
|
55
|
+
|
|
56
|
+
`HxSettingsView` (`<hx-settings-view>`) shows the settings of the app: a tree of groups and pages with a search, and the
|
|
57
|
+
current page beside it. The app registers its groups and pages with `HxSettingsRegistry` and keeps every value itself.
|
|
58
|
+
|
|
59
|
+
```ts
|
|
60
|
+
const settings = inject(HxSettingsRegistry);
|
|
61
|
+
|
|
62
|
+
const undo = [
|
|
63
|
+
settings.registerGroup({ id: "workspace", title: "Workspace", order: 10 }),
|
|
64
|
+
settings.registerPage({
|
|
65
|
+
id: "projects",
|
|
66
|
+
group: "workspace",
|
|
67
|
+
title: "Projects",
|
|
68
|
+
sections: () => [
|
|
69
|
+
{
|
|
70
|
+
id: "general",
|
|
71
|
+
title: "General",
|
|
72
|
+
items: [{ id: "open-last", kind: "toggle", label: "Open the last project", get: openLast, set: (v) => openLast.set(v) }],
|
|
73
|
+
},
|
|
74
|
+
],
|
|
75
|
+
}),
|
|
76
|
+
];
|
|
77
|
+
inject(DestroyRef).onDestroy(() => undo.forEach((remove) => remove()));
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
- Register a group before its pages. `HX_SETTINGS_GROUP_APPEARANCE` and `HX_SETTINGS_GROUP_GENERAL` already exist; add
|
|
81
|
+
pages to them.
|
|
82
|
+
- Item kinds: `toggle`, `select` and `segmented` (`options`), `text`, `number`, `action` (`run`), `readonly` (`value`)
|
|
83
|
+
and `custom`. A `custom` item renders its own `template` (a `TemplateRef`) and needs `keywords`, because the search
|
|
84
|
+
cannot read its texts.
|
|
85
|
+
- A section with `form` groups dependent fields under one Save button. There `set` only stages the value, so `get`
|
|
86
|
+
returns the staged value; `form.dirty()` enables Save and `form.save()` stores the values.
|
|
87
|
+
|
|
88
|
+
Persistence and deep links are the app's: keep `page` and `collapsed` in the app's state and bind them.
|
|
89
|
+
|
|
90
|
+
```html
|
|
91
|
+
<hx-settings-view [(page)]="page" [(collapsed)]="collapsed" />
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
- Set `page` to open a deep link. A retired page id, registered with `settings.retire(oldId, newId)`, still opens its
|
|
95
|
+
page, and an unknown id shows the first page; the view does not overwrite the id.
|
|
96
|
+
- Opening in a tab: keep the view in an editor tab and its `page` and `collapsed` in the tab state, as the desktop
|
|
97
|
+
overview demo does. Opening as a view or route: put the view in a route and provide the registry there with
|
|
98
|
+
`providers: [provideHxSettings()]`, so the shared Appearance page is available in it. Angular keeps a route's injector
|
|
99
|
+
after navigation unless route auto cleanup is enabled, so the registrations stay until then. Do not register a page
|
|
100
|
+
with an id the shared pages use: the later `remove()` of one removes the other.
|
|
101
|
+
|
|
102
|
+
```ts
|
|
103
|
+
// A custom item renders its own template; the search cannot read its texts, so give it keywords.
|
|
104
|
+
{
|
|
105
|
+
id: 'status-line',
|
|
106
|
+
kind: 'custom',
|
|
107
|
+
label: 'Status',
|
|
108
|
+
keywords: ['badge', 'state'],
|
|
109
|
+
template: this.badge(), // a TemplateRef<unknown>, e.g. from viewChild.required
|
|
110
|
+
}
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
```ts
|
|
114
|
+
// A form groups dependent fields under one Save button: set() only stages the value.
|
|
115
|
+
{
|
|
116
|
+
id: 'form',
|
|
117
|
+
title: 'Editor form',
|
|
118
|
+
description: 'Changes are staged until Save.',
|
|
119
|
+
form: {
|
|
120
|
+
dirty: () => this.dirty(), // enables Save
|
|
121
|
+
save: () => this.saved.set(this.staged()), // stores the staged values
|
|
122
|
+
},
|
|
123
|
+
items: [
|
|
124
|
+
{ id: 'tab-size', kind: 'number', label: 'Tab size', min: 1, max: 8,
|
|
125
|
+
get: () => this.staged(), set: (v) => this.staged.set(v) },
|
|
126
|
+
],
|
|
127
|
+
}
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
The demo page `apps/helix-demo` (route `/desktop/settings`) shows every item kind, a form and a deep link. See
|
|
131
|
+
[Settings](https://github.com/GravionLabs/helix/blob/main/docs/HELIX-APP.md#settings) for the full reference.
|
|
132
|
+
|
|
133
|
+
## Peer dependencies
|
|
134
|
+
|
|
135
|
+
Required: `@angular/core`, `@angular/common` and `@angular/cdk` (`>=22`), and `@gravionlabs/helix-ui` (`>=0.1.0`).
|
|
136
|
+
|
|
137
|
+
Optional, for the `/tauri` entry only: `@tauri-apps/api`, `@tauri-apps/plugin-process` and `@tauri-apps/plugin-updater`
|
|
138
|
+
(`>=2`).
|
|
139
|
+
|
|
140
|
+
## Styles
|
|
141
|
+
|
|
142
|
+
```css
|
|
143
|
+
@import "@gravionlabs/helix-ui/tokens.css";
|
|
144
|
+
@import "@gravionlabs/helix-app/styles.css";
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
The styles read only `--h-*` tokens, so light and dark follow `HxTheme`.
|
|
148
|
+
|
|
149
|
+
In a Tauri app the content security policy must leave `style-src` alone (`"dangerousDisableAssetCspModification": ["style-src"]`), or the release build renders without its component and grid styles. See [Tauri content security policy](https://github.com/GravionLabs/helix/blob/main/docs/HELIX-APP.md#tauri-content-security-policy).
|