wacom 21.1.19 → 21.1.20
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/fesm2022/wacom.mjs +23 -0
- package/fesm2022/wacom.mjs.map +1 -1
- package/package.json +1 -1
- package/types/wacom.d.ts +2 -0
package/fesm2022/wacom.mjs
CHANGED
|
@@ -4305,6 +4305,7 @@ class ThemeService {
|
|
|
4305
4305
|
this.densities = signal(['comfortable', 'compact'], ...(ngDevMode ? [{ debugName: "densities" }] : []));
|
|
4306
4306
|
this.radius = signal(undefined, ...(ngDevMode ? [{ debugName: "radius" }] : []));
|
|
4307
4307
|
this.radiuses = signal(['rounded', 'square'], ...(ngDevMode ? [{ debugName: "radiuses" }] : []));
|
|
4308
|
+
this.themeIndex = signal(0, ...(ngDevMode ? [{ debugName: "themeIndex" }] : []));
|
|
4308
4309
|
}
|
|
4309
4310
|
setMode(mode) {
|
|
4310
4311
|
if (this._isBrowser) {
|
|
@@ -4327,6 +4328,25 @@ class ThemeService {
|
|
|
4327
4328
|
}
|
|
4328
4329
|
this.radius.set(radius);
|
|
4329
4330
|
}
|
|
4331
|
+
nextTheme() {
|
|
4332
|
+
const modes = this.modes().length;
|
|
4333
|
+
const densities = this.densities().length;
|
|
4334
|
+
const radiuses = this.radiuses().length;
|
|
4335
|
+
const maxIndex = modes * densities * radiuses;
|
|
4336
|
+
const nextIndex = (this.themeIndex() + 1) % maxIndex;
|
|
4337
|
+
this.themeIndex.set(nextIndex);
|
|
4338
|
+
const block = densities * radiuses;
|
|
4339
|
+
const modeIndex = Math.floor(nextIndex / block);
|
|
4340
|
+
const rem = nextIndex % block;
|
|
4341
|
+
const densityIndex = Math.floor(rem / radiuses);
|
|
4342
|
+
const radiusIndex = rem % radiuses;
|
|
4343
|
+
this.setMode(this.modes()[modeIndex]);
|
|
4344
|
+
this.setDensity(this.densities()[densityIndex]);
|
|
4345
|
+
this.setRadius(this.radiuses()[radiusIndex]);
|
|
4346
|
+
if (this._isBrowser) {
|
|
4347
|
+
localStorage.setItem('theme.index', String(nextIndex));
|
|
4348
|
+
}
|
|
4349
|
+
}
|
|
4330
4350
|
init() {
|
|
4331
4351
|
const mode = this._isBrowser
|
|
4332
4352
|
? localStorage.getItem('theme.mode') || 'light'
|
|
@@ -4341,6 +4361,9 @@ class ThemeService {
|
|
|
4341
4361
|
this.mode.set(mode);
|
|
4342
4362
|
this.density.set(density);
|
|
4343
4363
|
this.radius.set(radius);
|
|
4364
|
+
this.themeIndex.set(this._isBrowser
|
|
4365
|
+
? Number(localStorage.getItem('theme.index')) || 0
|
|
4366
|
+
: 0);
|
|
4344
4367
|
if (this._isBrowser) {
|
|
4345
4368
|
this._doc.documentElement.dataset['mode'] = mode;
|
|
4346
4369
|
this._doc.documentElement.dataset['density'] = density;
|