@taiga-ui/addon-doc 3.23.1-dev.main-d8b7500 → 3.23.1-dev.main-14214d9
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/bundles/taiga-ui-addon-doc.umd.js +20 -12
- package/bundles/taiga-ui-addon-doc.umd.js.map +1 -1
- package/components/main/main.component.d.ts +4 -3
- package/esm2015/components/main/main.component.js +9 -7
- package/esm2015/services/theme-night.options.js +4 -1
- package/esm2015/services/theme-night.service.js +8 -4
- package/fesm2015/taiga-ui-addon-doc.js +17 -10
- package/fesm2015/taiga-ui-addon-doc.js.map +1 -1
- package/package.json +1 -1
- package/services/theme-night.options.d.ts +1 -0
- package/services/theme-night.service.d.ts +2 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('rxjs'), require('rxjs/operators'), require('markdown-it'), require('@angular/common'), require('ngx-highlightjs'), require('@taiga-ui/cdk'), require('@taiga-ui/kit'), require('@taiga-ui/core'), require('@angular/forms'), require('@angular/router'), require('@angular/animations'), require('@angular/cdk/clipboard'), require('@ng-web-apis/common'), require('@tinkoff/ng-polymorpheus'), require('@taiga-ui/i18n'), require('@angular/platform-browser'), require('@taiga-ui/addon-mobile')) :
|
|
3
|
-
typeof define === 'function' && define.amd ? define('@taiga-ui/addon-doc', ['exports', '@angular/core', 'rxjs', 'rxjs/operators', 'markdown-it', '@angular/common', 'ngx-highlightjs', '@taiga-ui/cdk', '@taiga-ui/kit', '@taiga-ui/core', '@angular/forms', '@angular/router', '@angular/animations', '@angular/cdk/clipboard', '@ng-web-apis/common', '@tinkoff/ng-polymorpheus', '@taiga-ui/i18n', '@angular/platform-browser', '@taiga-ui/addon-mobile'], factory) :
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global["taiga-ui"] = global["taiga-ui"] || {}, global["taiga-ui"]["addon-doc"] = {}), global.ng.core, global.rxjs, global.rxjs.operators, global.MarkdownIt, global.ng.common, global.i2, global.i6, global.i1, global.i2$1, global.ng.forms, global.ng.router, global.ng.animations, global.ng.cdk.clipboard, global.common, global.i6$2, global.i5$1, global.ng.platformBrowser, global.i4$1));
|
|
5
|
-
})(this, (function (exports, i0, i9, operators, MarkdownIt, i4, i2, i6, i1, i2$1, i5, i6$1, animations, i8, common, i6$2, i5$1, i8$1, i4$1) { 'use strict';
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('rxjs'), require('rxjs/operators'), require('markdown-it'), require('@angular/common'), require('ngx-highlightjs'), require('@taiga-ui/cdk'), require('@taiga-ui/kit'), require('@taiga-ui/core'), require('@angular/forms'), require('@angular/router'), require('@angular/animations'), require('@angular/cdk/clipboard'), require('@ng-web-apis/common'), require('@tinkoff/ng-polymorpheus'), require('@taiga-ui/i18n'), require('@taiga-ui/cdk/constants'), require('@angular/platform-browser'), require('@taiga-ui/addon-mobile')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('@taiga-ui/addon-doc', ['exports', '@angular/core', 'rxjs', 'rxjs/operators', 'markdown-it', '@angular/common', 'ngx-highlightjs', '@taiga-ui/cdk', '@taiga-ui/kit', '@taiga-ui/core', '@angular/forms', '@angular/router', '@angular/animations', '@angular/cdk/clipboard', '@ng-web-apis/common', '@tinkoff/ng-polymorpheus', '@taiga-ui/i18n', '@taiga-ui/cdk/constants', '@angular/platform-browser', '@taiga-ui/addon-mobile'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global["taiga-ui"] = global["taiga-ui"] || {}, global["taiga-ui"]["addon-doc"] = {}), global.ng.core, global.rxjs, global.rxjs.operators, global.MarkdownIt, global.ng.common, global.i2, global.i6, global.i1, global.i2$1, global.ng.forms, global.ng.router, global.ng.animations, global.ng.cdk.clipboard, global.common, global.i6$2, global.i5$1, global.constants, global.ng.platformBrowser, global.i4$1));
|
|
5
|
+
})(this, (function (exports, i0, i9, operators, MarkdownIt, i4, i2, i6, i1, i2$1, i5, i6$1, animations, i8, common, i6$2, i5$1, constants, i8$1, i4$1) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
8
|
|
|
@@ -1925,16 +1925,18 @@
|
|
|
1925
1925
|
|
|
1926
1926
|
var TUI_THEME_NIGHT_STORAGE_DEFAULT_KEY = "tuiNight";
|
|
1927
1927
|
var TUI_THEME_NIGHT_STORAGE_KEY = new i0.InjectionToken("[TUI_THEME_NIGHT_STORAGE_KEY]", { factory: function () { return TUI_THEME_NIGHT_STORAGE_DEFAULT_KEY; } });
|
|
1928
|
+
var TUI_USE_DEFAULT_NIGHT_THEME = new i0.InjectionToken("[TUI_USE_DEFAULT_NIGHT_THEME]", { factory: constants.ALWAYS_TRUE_HANDLER });
|
|
1928
1929
|
|
|
1929
1930
|
var TuiThemeNightService = /** @class */ (function (_super) {
|
|
1930
1931
|
__extends(TuiThemeNightService, _super);
|
|
1931
|
-
function TuiThemeNightService(windowRef, storage, key) {
|
|
1932
|
+
function TuiThemeNightService(windowRef, storage, key, useDefaultNightTheme) {
|
|
1932
1933
|
var _this = _super.call(this, storage.getItem(key) === "true" ||
|
|
1933
1934
|
(storage.getItem(key) === null &&
|
|
1934
1935
|
windowRef.matchMedia("(prefers-color-scheme: dark)").matches)) || this;
|
|
1935
1936
|
_this.windowRef = windowRef;
|
|
1936
1937
|
_this.storage = storage;
|
|
1937
1938
|
_this.key = key;
|
|
1939
|
+
_this.useDefaultNightTheme = useDefaultNightTheme;
|
|
1938
1940
|
return _this;
|
|
1939
1941
|
}
|
|
1940
1942
|
TuiThemeNightService.prototype.next = function (night) {
|
|
@@ -1946,7 +1948,7 @@
|
|
|
1946
1948
|
};
|
|
1947
1949
|
return TuiThemeNightService;
|
|
1948
1950
|
}(i9.BehaviorSubject));
|
|
1949
|
-
TuiThemeNightService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TuiThemeNightService, deps: [{ token: common.WINDOW }, { token: common.LOCAL_STORAGE }, { token: TUI_THEME_NIGHT_STORAGE_KEY }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
1951
|
+
TuiThemeNightService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TuiThemeNightService, deps: [{ token: common.WINDOW }, { token: common.LOCAL_STORAGE }, { token: TUI_THEME_NIGHT_STORAGE_KEY }, { token: TUI_USE_DEFAULT_NIGHT_THEME }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
1950
1952
|
TuiThemeNightService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TuiThemeNightService, providedIn: "root" });
|
|
1951
1953
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TuiThemeNightService, decorators: [{
|
|
1952
1954
|
type: i0.Injectable,
|
|
@@ -1963,6 +1965,9 @@
|
|
|
1963
1965
|
}] }, { type: undefined, decorators: [{
|
|
1964
1966
|
type: i0.Inject,
|
|
1965
1967
|
args: [TUI_THEME_NIGHT_STORAGE_KEY]
|
|
1968
|
+
}] }, { type: undefined, decorators: [{
|
|
1969
|
+
type: i0.Inject,
|
|
1970
|
+
args: [TUI_USE_DEFAULT_NIGHT_THEME]
|
|
1966
1971
|
}] }];
|
|
1967
1972
|
} });
|
|
1968
1973
|
|
|
@@ -2440,14 +2445,16 @@
|
|
|
2440
2445
|
} });
|
|
2441
2446
|
|
|
2442
2447
|
var TuiDocMainComponent = /** @class */ (function () {
|
|
2443
|
-
function TuiDocMainComponent(
|
|
2444
|
-
|
|
2445
|
-
this.
|
|
2446
|
-
this.
|
|
2448
|
+
function TuiDocMainComponent(theme, night) {
|
|
2449
|
+
var _this = this;
|
|
2450
|
+
this.theme = theme;
|
|
2451
|
+
this.night = night;
|
|
2452
|
+
this.change$ = this.night;
|
|
2453
|
+
this.night$ = this.change$.pipe(operators.startWith(null), operators.map(function () { return _this.night.value; }), operators.distinctUntilChanged(), operators.share());
|
|
2447
2454
|
}
|
|
2448
2455
|
Object.defineProperty(TuiDocMainComponent.prototype, "mode", {
|
|
2449
2456
|
get: function () {
|
|
2450
|
-
return this.
|
|
2457
|
+
return this.night.value ? 'onDark' : null;
|
|
2451
2458
|
},
|
|
2452
2459
|
enumerable: false,
|
|
2453
2460
|
configurable: true
|
|
@@ -2461,7 +2468,7 @@
|
|
|
2461
2468
|
useExisting: i0.forwardRef(function () { return TuiDocMainComponent; }),
|
|
2462
2469
|
},
|
|
2463
2470
|
i6.TuiSwipeService,
|
|
2464
|
-
], ngImport: i0__namespace, template: "<tui-theme-night *ngIf=\"
|
|
2471
|
+
], ngImport: i0__namespace, template: "<tui-theme-night *ngIf=\"theme.isDefaultTheme && night.useDefaultNightTheme && (night$ | async)\"></tui-theme-night>\n<tui-root>\n <div class=\"tui-doc-page\">\n <tui-doc-navigation class=\"tui-doc-navigation\">\n <ng-content select=\"tuiDocNavigation\"></ng-content>\n </tui-doc-navigation>\n <div class=\"tui-doc-content\">\n <router-outlet class=\"tui-doc-outlet\"></router-outlet>\n </div>\n </div>\n <header tuiDocHeader>\n <ng-content select=\"tuiDocHeader\"></ng-content>\n <button\n tuiIconButton\n tuiMode=\"onLight\"\n appearance=\"secondary\"\n size=\"s\"\n shape=\"rounded\"\n type=\"button\"\n class=\"tui-doc-night-mode-switch\"\n [icon]=\"night.value ? 'tuiIconSunLarge' : 'tuiIconMoonLarge'\"\n (click)=\"night.toggle()\"\n ></button>\n </header>\n <ng-container ngProjectAs=\"tuiOverContent\">\n <ng-content select=\"tuiOverContent\"></ng-content>\n </ng-container>\n <ng-container ngProjectAs=\"tuiOverDialogs\">\n <ng-content select=\"tuiOverDialogs\"></ng-content>\n </ng-container>\n <ng-container ngProjectAs=\"tuiOverAlerts\">\n <ng-content select=\"tuiOverAlerts\"></ng-content>\n </ng-container>\n <ng-container ngProjectAs=\"tuiOverPortals\">\n <ng-content select=\"tuiOverPortals\"></ng-content>\n </ng-container>\n <ng-container ngProjectAs=\"tuiOverHints\">\n <ng-content select=\"tuiOverHints\"></ng-content>\n </ng-container>\n</tui-root>\n", styles: ["html{scroll-padding-top:4rem;height:auto}tui-root>tui-scroll-controls>.t-bar_vertical{top:4rem!important}@keyframes tuiShaking{0%,to{transform:translate(0)}10%,30%,50%,70%,90%{transform:translate(-.3125rem)}20%,40%,60%,80%{transform:translate(.3125rem)}}body{background:var(--tui-base-01);height:auto}tui-doc-main{display:block}code:not(pre code):not(.hljs):not([class*=\"language-\"]){transition-property:background;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;background:var(--tui-base-02);color:var(--tui-text-02);vertical-align:middle;box-shadow:inset 0 -2px var(--tui-secondary);padding:.375rem .5rem;font-size:.875rem;border-radius:.5rem}button:focus code,a:focus code{background:var(--tui-base-01)}.tui-doc-page{position:relative;z-index:0;padding-top:4rem}tui-doc-navigation.tui-doc-navigation{position:fixed;top:4rem;bottom:0;width:16.25rem;border-right:1px solid var(--tui-base-03)}@media screen and (max-width: 47.9625em){tui-doc-navigation.tui-doc-navigation{display:none}}.tui-doc-content{margin-left:16.25rem}@media screen and (max-width: 47.9625em){.tui-doc-content{margin-left:0}}.tui-doc-outlet+*{display:block}.tui-doc-animated-example{animation:1s .3s tuiShaking}.tui-doc-night-mode-switch{margin-left:1rem}.tui-doc-night-mode-switch tui-svg{color:var(--tui-text-02)}tui-doc-code .hljs-tag{background:none}tui-doc-code .hljs{display:block;overflow-x:auto;padding:.5em;color:var(--tui-text-01);background-color:var(--tui-clear)}tui-doc-code .hljs.hljs-line-numbers{background:transparent}tui-doc-code .hljs-subst,tui-doc-code .hljs-title{font-weight:normal;color:var(--tui-text-01)}tui-doc-code .hljs-comment,tui-doc-code .hljs-quote{color:var(--tui-text-03);font-style:italic}tui-doc-code .hljs-meta{color:#e38162}tui-doc-code .hljs-section,tui-doc-code .hljs-name,tui-doc-code .hljs-literal,tui-doc-code .hljs-keyword,tui-doc-code .hljs-selector-tag,tui-doc-code .hljs-type,tui-doc-code .hljs-selector-id,tui-doc-code .hljs-selector-class{font-weight:bold;color:var(--tui-link)}tui-doc-code .hljs-attribute,tui-doc-code .hljs-number,tui-doc-code .hljs-regexp,tui-doc-code .hljs-link{font-weight:bold;color:var(--tui-support-06)}tui-doc-code .hljs-number,tui-doc-code .hljs-regexp,tui-doc-code .hljs-link{font-weight:normal}tui-doc-code .hljs-string{color:var(--tui-positive);font-weight:bold}tui-doc-code .hljs-symbol,tui-doc-code .hljs-bullet,tui-doc-code .hljs-formula{color:var(--tui-text-01);background:var(--tui-base-02);font-style:italic}tui-doc-code .hljs-doctag{text-decoration:underline}tui-doc-code .hljs-variable,tui-doc-code .hljs-template-variable{color:var(--tui-link-hover)}tui-doc-code [data-mode=onDark] .hljs-variable,tui-doc-code [data-mode=onDark] .hljs-template-variable{color:var(--tui-warning-fill)}tui-doc-code .hljs-addition{background:var(--tui-success-bg)}tui-doc-code .hljs-deletion{background:var(--tui-error-bg)}tui-doc-code .hljs-emphasis{font-style:italic}tui-doc-code .hljs-strong{font-weight:bold}tui-doc-code .hljs .hljs-line-numbers{padding:0}tui-doc-code .hljs-ln-numbers{vertical-align:top;opacity:.3;text-align:right;padding-right:1em!important}\n"], components: [{ type: i2__namespace$1.TuiThemeNightComponent, selector: "tui-theme-night" }, { type: i2__namespace$1.TuiRootComponent, selector: "tui-root" }, { type: TuiDocNavigationComponent, selector: "tui-doc-navigation" }, { type: TuiDocHeaderComponent, selector: "header[tuiDocHeader]" }, { type: i2__namespace$1.TuiButtonComponent, selector: "button[tuiButton], button[tuiIconButton], a[tuiButton], a[tuiIconButton]", inputs: ["appearance", "disabled", "icon", "iconRight", "shape", "showLoader", "size"] }], directives: [{ type: i4__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6__namespace.RouterOutlet, selector: "router-outlet", outputs: ["activate", "deactivate"], exportAs: ["outlet"] }, { type: i2__namespace$1.TuiModeDirective, selector: "[tuiMode]", inputs: ["tuiMode"] }], pipes: { "async": i4__namespace.AsyncPipe }, changeDetection: i0__namespace.ChangeDetectionStrategy.Default, encapsulation: i0__namespace.ViewEncapsulation.None });
|
|
2465
2472
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TuiDocMainComponent, decorators: [{
|
|
2466
2473
|
type: i0.Component,
|
|
2467
2474
|
args: [{
|
|
@@ -3078,6 +3085,7 @@
|
|
|
3078
3085
|
exports.TUI_THEME_NIGHT_STORAGE_KEY = TUI_THEME_NIGHT_STORAGE_KEY;
|
|
3079
3086
|
exports.TUI_THEME_STORAGE_DEFAULT_KEY = TUI_THEME_STORAGE_DEFAULT_KEY;
|
|
3080
3087
|
exports.TUI_THEME_STORAGE_KEY = TUI_THEME_STORAGE_KEY;
|
|
3088
|
+
exports.TUI_USE_DEFAULT_NIGHT_THEME = TUI_USE_DEFAULT_NIGHT_THEME;
|
|
3081
3089
|
exports.TuiAddonDocModule = TuiAddonDocModule;
|
|
3082
3090
|
exports.TuiDocCodeComponent = TuiDocCodeComponent;
|
|
3083
3091
|
exports.TuiDocCodeModule = TuiDocCodeModule;
|