wacom 21.2.5 → 21.2.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/README.md +28 -18
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
# waw Angular (ngx) common
|
|
2
2
|
|
|
3
|
-
Module which has common services, pipes, directives and interfaces which can be used on all projects.
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
Module which has common services, pipes, directives and interfaces which can be used on all projects.
|
|
4
|
+
|
|
5
|
+
Wacom is SSR-safe and works with Angular Universal: browser-only APIs are guarded, and features that require a browser runtime activate only on the client.
|
|
6
|
+
|
|
7
|
+
## License
|
|
6
8
|
|
|
7
9
|
[MIT](LICENSE)
|
|
8
10
|
|
|
@@ -66,7 +68,7 @@ export const appConfig = {
|
|
|
66
68
|
| [**`RTC`**](https://www.npmjs.com/package/wacom#rtc-service) | Wraps WebRTC peer connections and local media streams |
|
|
67
69
|
| [**`Util`**](https://www.npmjs.com/package/wacom#util-service) | Utility methods for forms, validation, and CSS variables |
|
|
68
70
|
| [**`Theme`**](#theme-service) | Manages UI theme mode, density, and radius preferences |
|
|
69
|
-
| [**`Translate`**](#translate-service) |
|
|
71
|
+
| [**`Translate`**](#translate-service) | Lightweight, signal-based runtime translate engine |
|
|
70
72
|
|
|
71
73
|
## [Core Service](#core-service)
|
|
72
74
|
|
|
@@ -2144,7 +2146,7 @@ ngOnInit() {
|
|
|
2144
2146
|
}
|
|
2145
2147
|
```
|
|
2146
2148
|
|
|
2147
|
-
## [Translate Service](#translate-service)
|
|
2149
|
+
## [Translate Service](#translate-service)
|
|
2148
2150
|
|
|
2149
2151
|
Wacom includes a lightweight, signal-based runtime translation engine built for Angular Signals.
|
|
2150
2152
|
|
|
@@ -2160,13 +2162,13 @@ Unlike compile-time Angular i18n, this works fully at runtime.
|
|
|
2160
2162
|
|
|
2161
2163
|
---
|
|
2162
2164
|
|
|
2163
|
-
### Translate model
|
|
2165
|
+
### Translate model
|
|
2164
2166
|
|
|
2165
2167
|
```ts
|
|
2166
|
-
export interface Translate {
|
|
2167
|
-
sourceText: string;
|
|
2168
|
-
text: string;
|
|
2169
|
-
}
|
|
2168
|
+
export interface Translate {
|
|
2169
|
+
sourceText: string;
|
|
2170
|
+
text: string;
|
|
2171
|
+
}
|
|
2170
2172
|
```
|
|
2171
2173
|
|
|
2172
2174
|
Each `sourceText` acts as both:
|
|
@@ -2179,11 +2181,11 @@ Each `sourceText` acts as both:
|
|
|
2179
2181
|
### Basic usage (signal API)
|
|
2180
2182
|
|
|
2181
2183
|
```ts
|
|
2182
|
-
import { TranslateService } from "wacom";
|
|
2183
|
-
|
|
2184
|
-
private _translateService = inject(TranslateService);
|
|
2185
|
-
|
|
2186
|
-
title = this._translateService.translate("Create project");
|
|
2184
|
+
import { TranslateService } from "wacom";
|
|
2185
|
+
|
|
2186
|
+
private _translateService = inject(TranslateService);
|
|
2187
|
+
|
|
2188
|
+
title = this._translateService.translate("Create project");
|
|
2187
2189
|
```
|
|
2188
2190
|
|
|
2189
2191
|
The returned value is a `WritableSignal<string>`.
|
|
@@ -2201,7 +2203,7 @@ automatically.
|
|
|
2201
2203
|
### Updating translations in bulk (language switch)
|
|
2202
2204
|
|
|
2203
2205
|
```ts
|
|
2204
|
-
this._translateService.setMany([
|
|
2206
|
+
this._translateService.setMany([
|
|
2205
2207
|
{ sourceText: 'Create project', text: 'Створити проєкт' },
|
|
2206
2208
|
{ sourceText: 'Save', text: 'Зберегти' },
|
|
2207
2209
|
]);
|
|
@@ -2218,7 +2220,7 @@ Behavior:
|
|
|
2218
2220
|
### Updating a single translation
|
|
2219
2221
|
|
|
2220
2222
|
```ts
|
|
2221
|
-
this._translateService.setOne({
|
|
2223
|
+
this._translateService.setOne({
|
|
2222
2224
|
sourceText: 'Save',
|
|
2223
2225
|
text: 'Зберегти',
|
|
2224
2226
|
});
|
|
@@ -2263,9 +2265,17 @@ Optional explicit key:
|
|
|
2263
2265
|
|
|
2264
2266
|
### Persistence
|
|
2265
2267
|
|
|
2266
|
-
Translate entries are automatically:
|
|
2268
|
+
Translate entries are automatically:
|
|
2267
2269
|
|
|
2268
2270
|
- hydrated from storage on startup
|
|
2269
2271
|
- synced after every update
|
|
2270
2272
|
|
|
2271
2273
|
No extra config required.
|
|
2274
|
+
|
|
2275
|
+
## AGENTS.md
|
|
2276
|
+
|
|
2277
|
+
Copy this into `AGENTS.md`.
|
|
2278
|
+
|
|
2279
|
+
```md
|
|
2280
|
+
Wacom is an Angular utility library that provides shared services, directives, pipes, interfaces, and configuration for apps. It is SSR-safe by design: the library guards browser-only APIs so Angular Universal / SSR can render normally, while browser-specific features degrade gracefully on the server or activate only in the browser runtime. Bootstrap via `provideWacom()` (or legacy `WacomModule`), configure `http`, `store`, `meta`, `network`, and optional `socket/io`; core capabilities include `CoreService` helpers (device detection, ids, debounce, signals), `HttpService` with headers and CRUD-style callbacks/observables, `StoreService` storage helpers, `MetaService` with route-driven and manual SEO tags plus link management and optional `MetaGuard`, `CrudService` for offline-aware data syncing with signals, `EmitterService` for app-wide events and completion tasks, `DomService` for dynamic component rendering, `NetworkService` for connectivity monitoring, `SocketService` for realtime messaging, `RtcService` for browser WebRTC flows, `TimeService` for date utilities, `UtilService` for assorted helpers, `ThemeService` and `TranslateService`, and common directives/pipes like click-outside, manual-\* attributes, and array/search/safe/pagination helpers.
|
|
2281
|
+
```
|