orcas-angular 1.0.0 → 1.0.1
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/README.md +51 -15
- package/index.ts +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,17 +1,53 @@
|
|
|
1
1
|
# orcas-angular
|
|
2
2
|
|
|
3
|
-
A collection of reusable Angular utilities and services
|
|
4
|
-
|
|
5
|
-
##
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
3
|
+
A collection of reusable Angular utilities and services, designed with support for Tauri and Capacitor. This library provides structural support for common application needs like storage, localization, theme management, and structured logging.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install orcas-angular
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Features
|
|
12
|
+
|
|
13
|
+
- **Storage**: Reactive, file-backed storage layer using Angular signals. Supports Tauri, Capacitor, and `localStorage`.
|
|
14
|
+
- **Localization**: JSON-based runtime translation loading and switching.
|
|
15
|
+
- **Theme**: Light / dark mode management with system preference fallback.
|
|
16
|
+
- **Logging**: Structured logging with log levels and system tags.
|
|
17
|
+
- **Async**: Cancellation tokens and cooperative async helpers.
|
|
18
|
+
- **UI**: Context menu system with viewport clamping.
|
|
19
|
+
- **Navigation**: History stack management with back-navigation protection.
|
|
20
|
+
- **Framework**: Async-aware service initialization during app bootstrap.
|
|
21
|
+
|
|
22
|
+
## Usage
|
|
23
|
+
|
|
24
|
+
### Root Initialization
|
|
25
|
+
|
|
26
|
+
Use `ServicesInit` to initialize your file-backed services during app startup:
|
|
27
|
+
|
|
28
|
+
```typescript
|
|
29
|
+
import { ServicesInit, FileBoxService, ThemeService } from 'orcas-angular';
|
|
30
|
+
|
|
31
|
+
// In your app initialization (e.g., APP_INITIALIZER or similar)
|
|
32
|
+
await servicesInit.init(FileBoxService, 'settings.json');
|
|
33
|
+
await servicesInit.init(ThemeService);
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### Storage
|
|
37
|
+
|
|
38
|
+
```typescript
|
|
39
|
+
import { SettingsService } from 'orcas-angular';
|
|
40
|
+
|
|
41
|
+
export class MyService {
|
|
42
|
+
private settings = inject(SettingsService);
|
|
43
|
+
public $isExpertMode = this.settings.getNewSignal(false, 'expert-mode');
|
|
44
|
+
|
|
45
|
+
async toggle() {
|
|
46
|
+
await this.settings.set(!this.$isExpertMode(), 'expert-mode');
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## License
|
|
52
|
+
|
|
53
|
+
MPL-2.0 + Commons Clause (See LICENSE file for details).
|
package/index.ts
CHANGED
|
@@ -18,4 +18,5 @@ export * from './storage/tauri-files.service';
|
|
|
18
18
|
export * from './storage/capacitor-files.service';
|
|
19
19
|
export * from './storage/local-storage-files.service';
|
|
20
20
|
export * from './theme/theme.service';
|
|
21
|
+
export * from './log/index';
|
|
21
22
|
export * from './ui/context-menu/index';
|