wacom 21.1.11 → 21.1.13
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 +44 -13
- package/fesm2022/wacom.mjs +44 -2
- package/fesm2022/wacom.mjs.map +1 -1
- package/package.json +1 -1
- package/types/wacom.d.ts +19 -2
package/README.md
CHANGED
|
@@ -63,8 +63,9 @@ export const appConfig = {
|
|
|
63
63
|
| [**`Dom`**](https://www.npmjs.com/package/wacom#dom-service) | Facilitates DOM manipulation and dynamic component loading |
|
|
64
64
|
| [**`Network`**](https://www.npmjs.com/package/wacom#network-service) | Monitors network connectivity and latency |
|
|
65
65
|
| [**`RTC`**](https://www.npmjs.com/package/wacom#rtc-service) | Wraps WebRTC peer connections and local media streams |
|
|
66
|
-
| [**`Util`**](https://www.npmjs.com/package/wacom#util-service) | Utility methods for forms, validation, and CSS variables |
|
|
67
|
-
| [**`
|
|
66
|
+
| [**`Util`**](https://www.npmjs.com/package/wacom#util-service) | Utility methods for forms, validation, and CSS variables |
|
|
67
|
+
| [**`Theme`**](#theme-service) | Manages UI theme mode, density, and radius preferences |
|
|
68
|
+
| [**`Emitter`**](#emitter-service) | Lightweight app-wide event and task signaling |
|
|
68
69
|
|
|
69
70
|
## [Emitter Service](#emitter-service)
|
|
70
71
|
|
|
@@ -1999,7 +2000,7 @@ const weeksInMonth = timeService.getWeeksInMonth(2, 2025);
|
|
|
1999
2000
|
console.log(weeksInMonth); // Output: 6 (example for March 2025)
|
|
2000
2001
|
```
|
|
2001
2002
|
|
|
2002
|
-
## [Dom Service](#dom-service)
|
|
2003
|
+
## [Dom Service](#dom-service)
|
|
2003
2004
|
|
|
2004
2005
|
The `DomService` facilitates DOM manipulation and dynamic component loading in Angular applications.
|
|
2005
2006
|
|
|
@@ -2109,7 +2110,7 @@ export class AppComponent {
|
|
|
2109
2110
|
}
|
|
2110
2111
|
```
|
|
2111
2112
|
|
|
2112
|
-
## [Network Service](#network-service)
|
|
2113
|
+
## [Network Service](#network-service)
|
|
2113
2114
|
|
|
2114
2115
|
The `NetworkService` monitors network connectivity and latency using Angular signals.
|
|
2115
2116
|
It periodically probes configurable endpoints and emits `wacom_online` or `wacom_offline`
|
|
@@ -2133,7 +2134,7 @@ Performs an immediate connectivity check and updates all signals.
|
|
|
2133
2134
|
await networkService.recheckNow();
|
|
2134
2135
|
```
|
|
2135
2136
|
|
|
2136
|
-
## [RTC Service](#rtc-service)
|
|
2137
|
+
## [RTC Service](#rtc-service)
|
|
2137
2138
|
|
|
2138
2139
|
The `RtcService` wraps WebRTC peer connections and local media streams.
|
|
2139
2140
|
|
|
@@ -2152,14 +2153,44 @@ The `RtcService` wraps WebRTC peer connections and local media streams.
|
|
|
2152
2153
|
**Example**:
|
|
2153
2154
|
|
|
2154
2155
|
```Typescript
|
|
2155
|
-
import { RtcService } from 'wacom';
|
|
2156
|
+
import { RtcService } from 'wacom';
|
|
2156
2157
|
|
|
2157
2158
|
constructor(private rtc: RtcService) {}
|
|
2158
2159
|
|
|
2159
|
-
async connect(id: string) {
|
|
2160
|
-
await this.rtc.initLocalStream();
|
|
2161
|
-
await this.rtc.createPeer(id);
|
|
2162
|
-
const offer = await this.rtc.createOffer(id);
|
|
2163
|
-
// send offer to remote peer...
|
|
2164
|
-
}
|
|
2165
|
-
```
|
|
2160
|
+
async connect(id: string) {
|
|
2161
|
+
await this.rtc.initLocalStream();
|
|
2162
|
+
await this.rtc.createPeer(id);
|
|
2163
|
+
const offer = await this.rtc.createOffer(id);
|
|
2164
|
+
// send offer to remote peer...
|
|
2165
|
+
}
|
|
2166
|
+
```
|
|
2167
|
+
|
|
2168
|
+
## [Theme Service](#theme-service)
|
|
2169
|
+
|
|
2170
|
+
The `ThemeService` manages UI theme preferences by setting data attributes on the
|
|
2171
|
+
document root and persisting them in `localStorage`.
|
|
2172
|
+
|
|
2173
|
+
### Methods
|
|
2174
|
+
|
|
2175
|
+
- `getMode(): ThemeMode | null` – reads `theme.mode` from `localStorage`.
|
|
2176
|
+
- `setMode(mode: ThemeMode): void` – sets `data-mode` and persists `theme.mode`.
|
|
2177
|
+
- `getDensity(): ThemeDensity | null` – reads `theme.density` from `localStorage`.
|
|
2178
|
+
- `setDensity(density: ThemeDensity): void` – sets `data-density` and persists `theme.density`.
|
|
2179
|
+
- `getRadius(): ThemeRadius | string | null` – reads `theme.radius` from `localStorage`.
|
|
2180
|
+
- `setRadius(radius: ThemeRadius | string): void` – sets `data-radius` and persists `theme.radius`.
|
|
2181
|
+
- `init(): void` – loads preferences from `localStorage` (or defaults to `light`, `comfortable`, `rounded`).
|
|
2182
|
+
|
|
2183
|
+
### Usage Example
|
|
2184
|
+
|
|
2185
|
+
```Typescript
|
|
2186
|
+
import { ThemeService } from "wacom";
|
|
2187
|
+
|
|
2188
|
+
constructor(private theme: ThemeService) {}
|
|
2189
|
+
|
|
2190
|
+
ngOnInit() {
|
|
2191
|
+
this.theme.init();
|
|
2192
|
+
this.theme.setMode("dark");
|
|
2193
|
+
this.theme.setDensity("compact");
|
|
2194
|
+
this.theme.setRadius("square");
|
|
2195
|
+
}
|
|
2196
|
+
```
|
package/fesm2022/wacom.mjs
CHANGED
|
@@ -10,7 +10,7 @@ import { toObservable } from '@angular/core/rxjs-interop';
|
|
|
10
10
|
import * as i1$1 from '@angular/common/http';
|
|
11
11
|
import { HttpHeaders, HttpErrorResponse, provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
|
|
12
12
|
import * as i1$2 from '@angular/common';
|
|
13
|
-
import { CommonModule } from '@angular/common';
|
|
13
|
+
import { DOCUMENT, CommonModule } from '@angular/common';
|
|
14
14
|
import { FormsModule } from '@angular/forms';
|
|
15
15
|
|
|
16
16
|
const CONFIG_TOKEN = new InjectionToken('config');
|
|
@@ -4195,6 +4195,48 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImpor
|
|
|
4195
4195
|
args: [{ providedIn: 'root' }]
|
|
4196
4196
|
}], ctorParameters: () => [] });
|
|
4197
4197
|
|
|
4198
|
+
class ThemeService {
|
|
4199
|
+
constructor() {
|
|
4200
|
+
this.doc = inject(DOCUMENT);
|
|
4201
|
+
}
|
|
4202
|
+
getRadius() {
|
|
4203
|
+
return localStorage.getItem('theme.radius');
|
|
4204
|
+
}
|
|
4205
|
+
setRadius(radius) {
|
|
4206
|
+
this.doc.documentElement.dataset['radius'] = radius;
|
|
4207
|
+
localStorage.setItem('theme.radius', radius);
|
|
4208
|
+
}
|
|
4209
|
+
getMode() {
|
|
4210
|
+
return localStorage.getItem('theme.mode');
|
|
4211
|
+
}
|
|
4212
|
+
setMode(mode) {
|
|
4213
|
+
this.doc.documentElement.dataset['mode'] = mode;
|
|
4214
|
+
localStorage.setItem('theme.mode', mode);
|
|
4215
|
+
}
|
|
4216
|
+
getDensity() {
|
|
4217
|
+
return localStorage.getItem('theme.density');
|
|
4218
|
+
}
|
|
4219
|
+
setDensity(density) {
|
|
4220
|
+
this.doc.documentElement.dataset['density'] = density;
|
|
4221
|
+
localStorage.setItem('theme.density', density);
|
|
4222
|
+
}
|
|
4223
|
+
init() {
|
|
4224
|
+
this.doc.documentElement.dataset['mode'] =
|
|
4225
|
+
localStorage.getItem('theme.mode') || 'light';
|
|
4226
|
+
this.doc.documentElement.dataset['density'] =
|
|
4227
|
+
localStorage.getItem('theme.density') ||
|
|
4228
|
+
'comfortable';
|
|
4229
|
+
this.doc.documentElement.dataset['radius'] =
|
|
4230
|
+
localStorage.getItem('theme.radius') || 'rounded';
|
|
4231
|
+
}
|
|
4232
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: ThemeService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
4233
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: ThemeService, providedIn: 'root' }); }
|
|
4234
|
+
}
|
|
4235
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: ThemeService, decorators: [{
|
|
4236
|
+
type: Injectable,
|
|
4237
|
+
args: [{ providedIn: 'root' }]
|
|
4238
|
+
}] });
|
|
4239
|
+
|
|
4198
4240
|
function provideWacom(config = DEFAULT_CONFIG) {
|
|
4199
4241
|
return makeEnvironmentProviders([
|
|
4200
4242
|
{ provide: CONFIG_TOKEN, useValue: config },
|
|
@@ -4267,5 +4309,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImpor
|
|
|
4267
4309
|
* Generated bundle index. Do not edit.
|
|
4268
4310
|
*/
|
|
4269
4311
|
|
|
4270
|
-
export { ArrPipe, CONFIG_TOKEN, ClickOutsideDirective, CoreService, CrudComponent, CrudService, DEFAULT_CONFIG, DEFAULT_HTTP_CONFIG, DEFAULT_NETWORK_CONFIG, DomService, EmitterService, HttpService, ManualDisabledDirective, ManualNameDirective, ManualReadonlyDirective, ManualTypeDirective, MetaGuard, MetaService, MongodatePipe, NETWORK_CONFIG, NetworkService, NumberPipe, PaginationPipe, RtcService, SafePipe, SearchPipe, SocketService, SplicePipe, SplitPipe, StoreService, TimeService, UtilService, WacomModule, provideWacom };
|
|
4312
|
+
export { ArrPipe, CONFIG_TOKEN, ClickOutsideDirective, CoreService, CrudComponent, CrudService, DEFAULT_CONFIG, DEFAULT_HTTP_CONFIG, DEFAULT_NETWORK_CONFIG, DomService, EmitterService, HttpService, ManualDisabledDirective, ManualNameDirective, ManualReadonlyDirective, ManualTypeDirective, MetaGuard, MetaService, MongodatePipe, NETWORK_CONFIG, NetworkService, NumberPipe, PaginationPipe, RtcService, SafePipe, SearchPipe, SocketService, SplicePipe, SplitPipe, StoreService, ThemeService, TimeService, UtilService, WacomModule, provideWacom };
|
|
4271
4313
|
//# sourceMappingURL=wacom.mjs.map
|