@tilde-nlp/ngx-common 8.1.60 → 8.1.61
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.
|
@@ -3747,11 +3747,11 @@ class StatusDisplayComponent {
|
|
|
3747
3747
|
const loading_r2 = i0.ɵɵreference(3);
|
|
3748
3748
|
i0.ɵɵadvance();
|
|
3749
3749
|
i0.ɵɵproperty("ngIf", !ctx.config.loading)("ngIfElse", loading_r2);
|
|
3750
|
-
} }, dependencies: [i1$1.NgIf, i2$6.MatProgressSpinner, i1.TranslatePipe], styles: [".status-display-wrapper[_ngcontent-%COMP%]{margin:4rem 0;display:flex;flex-direction:column;align-items:center}.status-display-row-title[_ngcontent-%COMP%], .status-display-row-description[_ngcontent-%COMP%], .status-display-row-extra[_ngcontent-%COMP%]{text-align:center}.status-display-row-description[_ngcontent-%COMP%]{max-width:500px;white-space:wrap}.status-display-row-extra[_ngcontent-%COMP%]{margin-top:1rem}.material-icons-outlined[_ngcontent-%COMP%]{font-size:4rem;color:var(--base-70)}mat-spinner[_ngcontent-%COMP%]{margin:auto}.material-icons[_ngcontent-%COMP%], .material-icons-outlined[_ngcontent-%COMP%]{margin-right:.5rem}"] }); }
|
|
3750
|
+
} }, dependencies: [i1$1.NgIf, i2$6.MatProgressSpinner, i1.TranslatePipe], styles: [".status-display-wrapper[_ngcontent-%COMP%]{margin:4rem 0;display:flex;flex-direction:column;align-items:center}.status-display-row-title[_ngcontent-%COMP%], .status-display-row-description[_ngcontent-%COMP%], .status-display-row-extra[_ngcontent-%COMP%]{text-align:center}.status-display-row-description[_ngcontent-%COMP%]{max-width:500px;white-space:wrap;color:var(--base-40)}.status-display-row-extra[_ngcontent-%COMP%]{margin-top:1rem}.material-icons-outlined[_ngcontent-%COMP%]{font-size:4rem;color:var(--base-70)}mat-spinner[_ngcontent-%COMP%]{margin:auto}.material-icons[_ngcontent-%COMP%], .material-icons-outlined[_ngcontent-%COMP%]{margin-right:.5rem}"] }); }
|
|
3751
3751
|
}
|
|
3752
3752
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(StatusDisplayComponent, [{
|
|
3753
3753
|
type: Component,
|
|
3754
|
-
args: [{ selector: 'lib-status-display', standalone: false, template: "<div class=\"status-display-wrapper\">\r\n <ng-container *ngIf=\"!config.loading; else loading\">\r\n <div>\r\n <span class=\"material-icons-outlined\">\r\n {{ config.icon }}\r\n </span>\r\n </div>\r\n <div\r\n class=\"text-xl-semi-bold status-display-row-title\"\r\n *ngIf=\"config.title\"\r\n [innerHtml]=\"config.title | translate : config.titleParams\"\r\n ></div>\r\n <div\r\n *ngIf=\"config.description\"\r\n class=\"text-l status-display-row-description\"\r\n [innerHtml]=\"config.description | translate : config.descriptionParams\"\r\n ></div>\r\n <div\r\n *ngIf=\"config.extraDescription\"\r\n class=\"text-l status-display-row-extra\"\r\n [innerHtml]=\"config.extraDescription | translate : config.extraDescriptionParams\"\r\n ></div>\r\n <ng-content></ng-content>\r\n </ng-container>\r\n <ng-template #loading>\r\n <mat-spinner color=\"accent\"></mat-spinner>\r\n </ng-template>\r\n</div>\r\n", styles: [".status-display-wrapper{margin:4rem 0;display:flex;flex-direction:column;align-items:center}.status-display-row-title,.status-display-row-description,.status-display-row-extra{text-align:center}.status-display-row-description{max-width:500px;white-space:wrap}.status-display-row-extra{margin-top:1rem}.material-icons-outlined{font-size:4rem;color:var(--base-70)}mat-spinner{margin:auto}.material-icons,.material-icons-outlined{margin-right:.5rem}\n"] }]
|
|
3754
|
+
args: [{ selector: 'lib-status-display', standalone: false, template: "<div class=\"status-display-wrapper\">\r\n <ng-container *ngIf=\"!config.loading; else loading\">\r\n <div>\r\n <span class=\"material-icons-outlined\">\r\n {{ config.icon }}\r\n </span>\r\n </div>\r\n <div\r\n class=\"text-xl-semi-bold status-display-row-title\"\r\n *ngIf=\"config.title\"\r\n [innerHtml]=\"config.title | translate : config.titleParams\"\r\n ></div>\r\n <div\r\n *ngIf=\"config.description\"\r\n class=\"text-l status-display-row-description\"\r\n [innerHtml]=\"config.description | translate : config.descriptionParams\"\r\n ></div>\r\n <div\r\n *ngIf=\"config.extraDescription\"\r\n class=\"text-l status-display-row-extra\"\r\n [innerHtml]=\"config.extraDescription | translate : config.extraDescriptionParams\"\r\n ></div>\r\n <ng-content></ng-content>\r\n </ng-container>\r\n <ng-template #loading>\r\n <mat-spinner color=\"accent\"></mat-spinner>\r\n </ng-template>\r\n</div>\r\n", styles: [".status-display-wrapper{margin:4rem 0;display:flex;flex-direction:column;align-items:center}.status-display-row-title,.status-display-row-description,.status-display-row-extra{text-align:center}.status-display-row-description{max-width:500px;white-space:wrap;color:var(--base-40)}.status-display-row-extra{margin-top:1rem}.material-icons-outlined{font-size:4rem;color:var(--base-70)}mat-spinner{margin:auto}.material-icons,.material-icons-outlined{margin-right:.5rem}\n"] }]
|
|
3755
3755
|
}], null, { config: [{
|
|
3756
3756
|
type: Input,
|
|
3757
3757
|
args: [{ required: true }]
|
|
@@ -8715,12 +8715,12 @@ class AccessibilityService {
|
|
|
8715
8715
|
this.#screenMask = inject(AccessibilityScreenMaskService);
|
|
8716
8716
|
this.#storage = inject(USER_CONFIG_STORAGE, { optional: true });
|
|
8717
8717
|
this.preferences = signal(DEFAULT_ACCESSIBILITY_PREFERENCES, ...(ngDevMode ? [{ debugName: "preferences" }] : []));
|
|
8718
|
-
this.#
|
|
8718
|
+
this.#readStorage();
|
|
8719
8719
|
}
|
|
8720
8720
|
toggleScreenMask() {
|
|
8721
8721
|
const updatedStatus = !this.preferences().screenMaskEnabled;
|
|
8722
8722
|
this.#screenMask.toggleScreenMask(updatedStatus);
|
|
8723
|
-
this.#
|
|
8723
|
+
this.#updateConfig({ screenMaskEnabled: updatedStatus });
|
|
8724
8724
|
}
|
|
8725
8725
|
closeFocusBar() {
|
|
8726
8726
|
this.#screenMask.closeFocusBar();
|
|
@@ -8728,43 +8728,17 @@ class AccessibilityService {
|
|
|
8728
8728
|
toggleTextMagnifier() {
|
|
8729
8729
|
const updatedStatus = !this.preferences().textMagnifierEnabled;
|
|
8730
8730
|
this.#textMagnifier.toggleTextMagnifier(updatedStatus);
|
|
8731
|
-
this.#
|
|
8731
|
+
this.#updateConfig({ textMagnifierEnabled: updatedStatus });
|
|
8732
8732
|
}
|
|
8733
8733
|
setSavedTextMagnifierStatus() {
|
|
8734
|
-
this
|
|
8734
|
+
const currnetStatus = this.preferences().textMagnifierEnabled;
|
|
8735
|
+
this.#textMagnifier.toggleTextMagnifier(currnetStatus);
|
|
8735
8736
|
}
|
|
8736
8737
|
setSavedScreenMaskStatus() {
|
|
8737
|
-
this
|
|
8738
|
+
const currnetStatus = this.preferences().screenMaskEnabled;
|
|
8739
|
+
this.#screenMask.toggleScreenMask(currnetStatus);
|
|
8738
8740
|
}
|
|
8739
8741
|
setFontSize(fontSizeIx) {
|
|
8740
|
-
this.#updatePreferencesAndStorage({ fontSizeIndex: fontSizeIx });
|
|
8741
|
-
}
|
|
8742
|
-
setContrast(contrast) {
|
|
8743
|
-
this.#updatePreferencesAndStorage({ contrast: contrast });
|
|
8744
|
-
}
|
|
8745
|
-
reset() {
|
|
8746
|
-
this.#updatePreferencesAndStorage({ ...DEFAULT_ACCESSIBILITY_PREFERENCES });
|
|
8747
|
-
}
|
|
8748
|
-
#updatePreferencesAndStorage(updates) {
|
|
8749
|
-
this.#updatePreferences(updates);
|
|
8750
|
-
this.#storage?.write({ accessibility: this.preferences() }).subscribe();
|
|
8751
|
-
}
|
|
8752
|
-
#updatePreferences(updates) {
|
|
8753
|
-
this.preferences.set({ ...this.preferences(), ...updates });
|
|
8754
|
-
this.#updateContrastFromPreferences();
|
|
8755
|
-
this.#updateFontSizeFromPreferences();
|
|
8756
|
-
this.#updateScreenMaskFromPreferences();
|
|
8757
|
-
this.#updateMagnifierFromPreferences();
|
|
8758
|
-
}
|
|
8759
|
-
#updateValuesFromStorage() {
|
|
8760
|
-
this.#storage?.read().subscribe(config => {
|
|
8761
|
-
if (config?.accessibility) {
|
|
8762
|
-
this.#updatePreferences({ ...config.accessibility });
|
|
8763
|
-
}
|
|
8764
|
-
});
|
|
8765
|
-
}
|
|
8766
|
-
#updateFontSizeFromPreferences() {
|
|
8767
|
-
const fontSizeIx = this.preferences().fontSizeIndex;
|
|
8768
8742
|
const sizes = Object.values(AccessibilityFontSizes);
|
|
8769
8743
|
if (fontSizeIx > 0) {
|
|
8770
8744
|
this.sizeIncreaseSubject.next(true);
|
|
@@ -8773,18 +8747,26 @@ class AccessibilityService {
|
|
|
8773
8747
|
this.sizeIncreaseSubject.next(false);
|
|
8774
8748
|
}
|
|
8775
8749
|
document.querySelector('html').style.fontSize = sizes[fontSizeIx];
|
|
8750
|
+
this.#updateConfig({ fontSizeIndex: fontSizeIx });
|
|
8776
8751
|
}
|
|
8777
|
-
|
|
8778
|
-
|
|
8752
|
+
setContrast(contrast) {
|
|
8753
|
+
this.contrastSubject.next(contrast);
|
|
8779
8754
|
document.querySelector('html').className = contrast;
|
|
8755
|
+
this.#updateConfig({ contrast: contrast });
|
|
8780
8756
|
}
|
|
8781
|
-
|
|
8782
|
-
|
|
8783
|
-
this.#textMagnifier.toggleTextMagnifier(isEnabled);
|
|
8757
|
+
reset() {
|
|
8758
|
+
this.#updateConfig({ ...DEFAULT_ACCESSIBILITY_PREFERENCES });
|
|
8784
8759
|
}
|
|
8785
|
-
#
|
|
8786
|
-
|
|
8787
|
-
this.#
|
|
8760
|
+
#updateConfig(updates) {
|
|
8761
|
+
this.preferences.set({ ...this.preferences(), ...updates });
|
|
8762
|
+
this.#storage?.write({ accessibility: this.preferences() }).subscribe();
|
|
8763
|
+
}
|
|
8764
|
+
#readStorage() {
|
|
8765
|
+
this.#storage?.read().subscribe(config => {
|
|
8766
|
+
if (config?.accessibility) {
|
|
8767
|
+
this.preferences.set({ ...config.accessibility });
|
|
8768
|
+
}
|
|
8769
|
+
});
|
|
8788
8770
|
}
|
|
8789
8771
|
static { this.ɵfac = function AccessibilityService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || AccessibilityService)(); }; }
|
|
8790
8772
|
static { this.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: AccessibilityService, factory: AccessibilityService.ɵfac, providedIn: 'root' }); }
|