@cuby-ui/core 0.0.274 → 0.0.276
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/editor/editor.component.d.ts +8 -6
- package/esm2022/editor/editor.component.mjs +16 -13
- package/esm2022/editor/widgets/editor-block/editor-block.component.mjs +4 -4
- package/esm2022/editor/widgets/editor-modal/editor-modal.component.mjs +3 -3
- package/esm2022/editor/widgets/editor-readonly/editor-readonly.component.mjs +3 -3
- package/esm2022/interceptors/auth.interceptor.mjs +2 -2
- package/esm2022/providers/auth.options.mjs +3 -2
- package/esm2022/providers/auth.provider.mjs +18 -24
- package/esm2022/providers/index.mjs +2 -1
- package/esm2022/services/auth.service.mjs +17 -15
- package/esm2022/services/browser-auth.service.mjs +30 -0
- package/esm2022/services/index.mjs +1 -2
- package/esm2022/services/mobile-auth.service.mjs +18 -0
- package/fesm2022/cuby-ui-core.mjs +124 -83
- package/fesm2022/cuby-ui-core.mjs.map +1 -1
- package/package.json +4 -4
- package/providers/auth.options.d.ts +6 -0
- package/providers/auth.provider.d.ts +1 -1
- package/providers/index.d.ts +1 -1
- package/services/auth.service.d.ts +3 -5
- package/services/browser-auth.service.d.ts +10 -0
- package/services/index.d.ts +0 -1
- package/services/mobile-auth.service.d.ts +8 -0
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { Component, ChangeDetectionStrategy, inject, Renderer2, input, model, effect, Directive, InjectionToken, Input, HostBinding, ChangeDetectorRef, ElementRef, ViewChild, EventEmitter, Output, NgModule, Injector, Injectable, SkipSelf, Optional, DestroyRef, NgZone, signal, TemplateRef, ContentChildren, HostListener, Self, INJECTOR, forwardRef, ViewContainerRef, booleanAttribute, computed, Pipe, APP_INITIALIZER, viewChild, afterRender, output, makeEnvironmentProviders } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/common';
|
|
4
|
-
import { CommonModule, DOCUMENT, NgForOf, NgIf, NgComponentOutlet, NgTemplateOutlet, NgFor, UpperCasePipe, NgClass } from '@angular/common';
|
|
4
|
+
import { CommonModule, DOCUMENT, NgForOf, NgIf, NgComponentOutlet, NgTemplateOutlet, NgFor, UpperCasePipe, NgClass, Location } from '@angular/common';
|
|
5
5
|
import * as i1$1 from '@cuby-ui/cdk';
|
|
6
6
|
import { CUI_WINDOW, cuiCreateToken, cuiCreateTokenFromFactory, CuiDestroyService, CuiFilterPipe, CuiLetDirective, CuiPopoverService, cuiProvide, CUI_ANIMATION_FRAME, cuiZonefree, EMPTY_CLIENT_RECT, cuiInjectElement, CUI_LOCAL_STORAGE, CUI_IS_WEBKIT, CuiItemDirective, CuiActiveZone, CuiFocusTrapDirective, cuiGetElementObscures, CUI_IS_MOBILE, CuiHoveredService, cuiPure, cuiPointToClientRect, cuiClamp, cuiPx, cuiIfMap, cuiIsPresent, cuiTypedFromEvent, cuiZonefreeScheduler, cuiZoneOptimized, cuiIsNativeFocused, CuiClickOutsideDirective, CuiTargetDirective, cuiGetClosestFocusable, CuiTime, CuiDimensionsObserverDirective, CuiAutoResizingDirective, CuiIdService, CuiElementDirective, CuiDragPointerDirective, CuiDragDropDirective, CuiDragListDirective, CuiHandleScrollDirective } from '@cuby-ui/cdk';
|
|
7
7
|
import { DomSanitizer } from '@angular/platform-browser';
|
|
8
8
|
import { cuiIsIcon, CUI_ICONS } from '@cuby-ui/icons';
|
|
9
9
|
import { BehaviorSubject, takeUntil, Observable, merge, distinctUntilChanged, startWith, map, finalize, timer, Subject, switchMap, of, delay, repeat, filter, tap, takeWhile, fromEvent, debounce, skip, take, forkJoin, throttleTime, concatMap, toArray, catchError, throwError, pairwise, debounceTime } from 'rxjs';
|
|
10
10
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
11
|
-
import { OAuthService, provideOAuthClient, OAuthInfoEvent } from 'angular-oauth2-oidc';
|
|
12
11
|
import { trigger, transition, query, animateChild, style, animate, stagger } from '@angular/animations';
|
|
13
12
|
import * as i2 from '@taiga-ui/polymorpheus';
|
|
14
13
|
import { PolymorpheusOutlet, PolymorpheusTemplate, PolymorpheusComponent, injectContext } from '@taiga-ui/polymorpheus';
|
|
@@ -25,6 +24,8 @@ import * as i2$2 from '@jsverse/transloco';
|
|
|
25
24
|
import { TranslocoDirective, TranslocoService, TranslocoModule } from '@jsverse/transloco';
|
|
26
25
|
import { HttpClient, HttpErrorResponse } from '@angular/common/http';
|
|
27
26
|
import { createCustomElement } from '@angular/elements';
|
|
27
|
+
import { OAuthService, OAuthInfoEvent, provideOAuthClient } from 'angular-oauth2-oidc';
|
|
28
|
+
import { Router } from '@angular/router';
|
|
28
29
|
import { CuiTreeStructNavigatorApiService, CuiFrameApiService, CuiNodeChecklistApiService, CuiTreeStructApiService } from '@cuby-ui/api';
|
|
29
30
|
|
|
30
31
|
class CuiAccordionComponent {
|
|
@@ -859,36 +860,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
859
860
|
}]
|
|
860
861
|
}] });
|
|
861
862
|
|
|
862
|
-
class CuiAuthService extends OAuthService {
|
|
863
|
-
useCheckTokenFlow() {
|
|
864
|
-
const isTokenExist = this.hasValidAccessToken();
|
|
865
|
-
if (isTokenExist) {
|
|
866
|
-
return this.refreshTokenWithExpiredChecking();
|
|
867
|
-
}
|
|
868
|
-
return this.initCodeFlow();
|
|
869
|
-
}
|
|
870
|
-
checkIsTokenExpired() {
|
|
871
|
-
const expiredTime = this.getAccessTokenExpiration();
|
|
872
|
-
const currentTime = Date.now();
|
|
873
|
-
return currentTime >= expiredTime;
|
|
874
|
-
}
|
|
875
|
-
refreshTokenWithExpiredChecking() {
|
|
876
|
-
const isExpired = this.checkIsTokenExpired();
|
|
877
|
-
if (!isExpired) {
|
|
878
|
-
return;
|
|
879
|
-
}
|
|
880
|
-
this.refreshToken();
|
|
881
|
-
}
|
|
882
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CuiAuthService, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
883
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CuiAuthService, providedIn: 'root' }); }
|
|
884
|
-
}
|
|
885
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CuiAuthService, decorators: [{
|
|
886
|
-
type: Injectable,
|
|
887
|
-
args: [{
|
|
888
|
-
providedIn: 'root'
|
|
889
|
-
}]
|
|
890
|
-
}] });
|
|
891
|
-
|
|
892
863
|
class CuiBannerComponent {
|
|
893
864
|
constructor() {
|
|
894
865
|
this.options = inject(CUI_BANNER_OPTIONS);
|
|
@@ -6939,6 +6910,7 @@ function setEditorEvents(editorElement, signal) {
|
|
|
6939
6910
|
class CuiEditorComponent {
|
|
6940
6911
|
constructor() {
|
|
6941
6912
|
this.destroy = inject(DestroyRef);
|
|
6913
|
+
this.cuiIdService = inject(CuiIdService);
|
|
6942
6914
|
this.editorService = inject(CuiEditorService);
|
|
6943
6915
|
this.jTextService = inject(CuiJTextApiService);
|
|
6944
6916
|
this.POOLING_DELAY = 100;
|
|
@@ -6946,9 +6918,6 @@ class CuiEditorComponent {
|
|
|
6946
6918
|
this.SCROLL_THROTTLE_TIME = 200;
|
|
6947
6919
|
this.isReadonly = computed(() => this.config?.readOnly);
|
|
6948
6920
|
this.emptyQueue = new Subject();
|
|
6949
|
-
this.editorEmpty = new EventEmitter();
|
|
6950
|
-
this.config = DEFAULT_CONFIG;
|
|
6951
|
-
this.requestSize = 40;
|
|
6952
6921
|
this.isSkipCombinedBlockOnChange = [];
|
|
6953
6922
|
this.isFirst = true;
|
|
6954
6923
|
this.isChanging = false;
|
|
@@ -6964,9 +6933,13 @@ class CuiEditorComponent {
|
|
|
6964
6933
|
this.removedBlocksIds = [];
|
|
6965
6934
|
this.changesQueue = [];
|
|
6966
6935
|
this.abortController = new AbortController();
|
|
6936
|
+
this.editorId = this.cuiIdService.generate();
|
|
6937
|
+
this.editorEmpty = new EventEmitter();
|
|
6938
|
+
this.config = DEFAULT_CONFIG;
|
|
6939
|
+
this.requestSize = 40;
|
|
6967
6940
|
}
|
|
6968
6941
|
ngOnChanges(changes) {
|
|
6969
|
-
if (changes['
|
|
6942
|
+
if (changes['editorApiId'] || changes['config']) {
|
|
6970
6943
|
this.initEditorChanges();
|
|
6971
6944
|
}
|
|
6972
6945
|
}
|
|
@@ -7033,7 +7006,7 @@ class CuiEditorComponent {
|
|
|
7033
7006
|
}
|
|
7034
7007
|
initEditorChanges() {
|
|
7035
7008
|
this.jTextService.addOptions(this.config.requestOptions);
|
|
7036
|
-
this.editor = this.initEditor(this.
|
|
7009
|
+
this.editor = this.initEditor(this.editorId);
|
|
7037
7010
|
this.editor.isReady.then(() => {
|
|
7038
7011
|
if (this.isDestroyed) {
|
|
7039
7012
|
return;
|
|
@@ -7137,7 +7110,7 @@ class CuiEditorComponent {
|
|
|
7137
7110
|
return { ...block, index };
|
|
7138
7111
|
});
|
|
7139
7112
|
const addedBlocks = [...defaultBlocksWithIndex, ...combinedBlocksWithIndex].sort((first, second) => first.index - second.index);
|
|
7140
|
-
const addBlocks$ = this.editorService.collectAddedBlocksRequest(this.
|
|
7113
|
+
const addBlocks$ = this.editorService.collectAddedBlocksRequest(this.editorApiId, addedBlocks);
|
|
7141
7114
|
return {
|
|
7142
7115
|
addedBlocks,
|
|
7143
7116
|
addBlocks$
|
|
@@ -7158,13 +7131,13 @@ class CuiEditorComponent {
|
|
|
7158
7131
|
const id = block.detail.target.id;
|
|
7159
7132
|
this.removedBlocksIds.push(id);
|
|
7160
7133
|
});
|
|
7161
|
-
const removeBlocks$ = this.editorService.collectRemovedBlocksRequest(this.
|
|
7134
|
+
const removeBlocks$ = this.editorService.collectRemovedBlocksRequest(this.editorApiId, this.removedBlocksIds, this.blockIdsMap);
|
|
7162
7135
|
this.removedBlocksIds = [];
|
|
7163
7136
|
return removeBlocks$;
|
|
7164
7137
|
}
|
|
7165
7138
|
getBlocks(page = 0, size = 40) {
|
|
7166
7139
|
let combinedBlock;
|
|
7167
|
-
return this.jTextService.getBlocks(this.
|
|
7140
|
+
return this.jTextService.getBlocks(this.editorApiId, page, size).pipe(takeUntilDestroyed(this.destroy), finalize(() => {
|
|
7168
7141
|
if (combinedBlock) {
|
|
7169
7142
|
this.addCombinedBlock(combinedBlock);
|
|
7170
7143
|
combinedBlock = null;
|
|
@@ -7255,7 +7228,7 @@ class CuiEditorComponent {
|
|
|
7255
7228
|
this.editor.render({ blocks: [] });
|
|
7256
7229
|
return;
|
|
7257
7230
|
}
|
|
7258
|
-
this.editorService.setStartBlock(this.
|
|
7231
|
+
this.editorService.setStartBlock(this.editorApiId, async (block, id) => {
|
|
7259
7232
|
this.blockIdsMap.set(id, id);
|
|
7260
7233
|
this.isSkipCombinedBlockOnChange.push(true);
|
|
7261
7234
|
await this.editor.render({ blocks: [block] });
|
|
@@ -7295,17 +7268,17 @@ class CuiEditorComponent {
|
|
|
7295
7268
|
this.abortController = new AbortController();
|
|
7296
7269
|
}
|
|
7297
7270
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CuiEditorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
7298
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: CuiEditorComponent, isStandalone: true, selector: "cui-editor", inputs: {
|
|
7271
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: CuiEditorComponent, isStandalone: true, selector: "cui-editor", inputs: { editorApiId: "editorApiId", config: "config", requestSize: "requestSize" }, outputs: { editorEmpty: "editorEmpty" }, providers: [CuiEditorService, CuiJTextApiService], viewQueries: [{ propertyName: "editorRef", first: true, predicate: ["editor"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div\n #editor\n [id]=\"editorId\"\n data-editor\n [class._readonly]=\"config.readOnly\"\n></div>\n", styles: [":host{--textColor: var(--cui-base-900);--menuBackground: var(--cui-base-0);--menuBorder: var(--cui-base-200);--menuItemHover: var(--cui-base-10);--menuItemBackground: var(cui-base-900);--menuIconBackground: var(--cui-base-50);--menuIconHover: var(--cui-base-10);font-weight:400;font-size:14px;line-height:20px;font-family:var(--cui-main-font)}:host ::ng-deep .ce-popover{--color-background: var(--menuBackground);--color-text-primary: var(--textColor);--color-border: var(--menuBorder);--color-border-icon: var(--menuBorder);--color-background-item: var(--menuItemBackground);--color-background-item-hover: var(--menuItemHover)}:host ::ng-deep .ce-popover__search{background:var(--menuIconBackground)}:host ::ng-deep .ce-popover .ce-popover-item__icon{background:var(--menuIconBackground)}:host ::ng-deep .ce-conversion-toolbar{background-color:var(--menuBackground);border-color:var(--menuBorder)}:host ::ng-deep .ce-conversion-toolbar__tools{padding:0 6px 6px}:host ::ng-deep .ce-conversion-tool{padding:3px;border-radius:6px}:host ::ng-deep .ce-conversion-tool__icon{border:1px solid var(--menuBorder);background-color:var(--menuIconBackground);box-shadow:none}:host ::ng-deep .ce-conversion-tool:hover{background-color:var(--menuItemHover)}:host ::ng-deep .ce-conversion-tool:hover .ce-conversion-tool__icon{border-color:var(--menuIconHover)}:host ::ng-deep .combined-text-block{padding:.4em 0;line-height:1.6em;outline:none}:host ::ng-deep .combined-text-block .combined-text-block-part{outline:none}:host ::ng-deep .combined-text-block .combined-text-block-part:only-child,:host ::ng-deep .combined-text-block .combined-text-block-part._selected{display:list-item}:host ::ng-deep .combined-text-block .combined-text-block-part:only-child::marker,:host ::ng-deep .combined-text-block .combined-text-block-part._selected::marker{content:\"\"}:host ::ng-deep .image-tool__image{border:1px solid var(--cui-base-200);background-color:var(--cui-base-0)}:host ::ng-deep .image-tool__image-preloader{background-color:var(--cui-base-200)}:host ::ng-deep .image-tool__image-preloader:after{border:1px solid var(--cui-base-200);border-top:1px solid var(--cui-blue-600)}:host ::ng-deep .cdx-button{border:1px solid var(--cui-base-200);color:var(--textColor);background-color:var(--cui-base-0);box-shadow:none}:host ::ng-deep .ce-inline-toolbar{border-color:var(--cui-base-100);color:var(--textColor);background-color:var(--cui-base-0)}:host ::ng-deep .ce-inline-toolbar__dropdown:hover{background-color:var(--cui-base-100)}:host ::ng-deep .ce-inline-tool:hover{background-color:var(--cui-base-100)}:host ::ng-deep .ce-toolbar__plus,:host ::ng-deep .ce-toolbar__settings-btn{color:var(--cui-base-500)}:host ::ng-deep .ce-toolbar__plus:hover,:host ::ng-deep .ce-toolbar__settings-btn:hover{background-color:var(--cui-base-100)}:host ::ng-deep .ce-toolbar__actions{right:100%}:host ::ng-deep .ce-toolbar__content{max-width:none}:host ::ng-deep .ce-block--selected .ce-block__content{background-color:var(--cui-base-200)}:host ::ng-deep .ce-block__content{max-width:100%}:host ::ng-deep .ce-block:only-of-type .combined-text-block[data-placeholder-active][data-empty=true]:before{content:attr(data-placeholder-active);position:absolute;color:var(--cui-base-400)}:host ::ng-deep [data-editor]{padding-right:4px;width:100%;height:100%;min-height:200px;overflow:hidden auto;scrollbar-gutter:stable}:host ::ng-deep [data-editor] .codex-editor{margin-left:60px}:host ::ng-deep [data-editor] .codex-editor--narrow .ce-popover{right:auto}:host ::ng-deep [data-editor] .codex-editor__redactor{margin-right:auto;padding-bottom:260px!important}:host ::ng-deep [data-editor]._readonly{min-height:auto}:host ::ng-deep [data-editor]._readonly .codex-editor{margin:auto}:host ::ng-deep [data-editor]._readonly .codex-editor__redactor{padding-bottom:0!important}:host ::ng-deep [data-editor]._readonly .combined-text-block{padding:0}:host ::ng-deep [data-editor] [data-item-name=move-up],:host ::ng-deep [data-editor] [data-item-name=move-down],:host ::ng-deep [data-editor] [data-tool=paragraph]{display:none}:host ::ng-deep [data-editor] *::selection{background:var(--cui-base-200)}:host ::ng-deep [data-editor] a{color:var(--cui-light-blue-600)}:host ::ng-deep .marker{cursor:pointer;text-decoration:underline;color:var(--cui-light-blue-600);background-color:transparent}:host ::ng-deep .tool-marker,:host ::ng-deep .role-marker{margin:0 5px}:host ::ng-deep .tool-marker{color:#e97c00}:host ::ng-deep .role-marker{color:#8803f1}.form{height:100%}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
7299
7272
|
}
|
|
7300
7273
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CuiEditorComponent, decorators: [{
|
|
7301
7274
|
type: Component,
|
|
7302
|
-
args: [{ selector: 'cui-editor', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, providers: [CuiEditorService, CuiJTextApiService], template: "<div\n #editor\n [id]=\"
|
|
7275
|
+
args: [{ selector: 'cui-editor', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, providers: [CuiEditorService, CuiJTextApiService], template: "<div\n #editor\n [id]=\"editorId\"\n data-editor\n [class._readonly]=\"config.readOnly\"\n></div>\n", styles: [":host{--textColor: var(--cui-base-900);--menuBackground: var(--cui-base-0);--menuBorder: var(--cui-base-200);--menuItemHover: var(--cui-base-10);--menuItemBackground: var(cui-base-900);--menuIconBackground: var(--cui-base-50);--menuIconHover: var(--cui-base-10);font-weight:400;font-size:14px;line-height:20px;font-family:var(--cui-main-font)}:host ::ng-deep .ce-popover{--color-background: var(--menuBackground);--color-text-primary: var(--textColor);--color-border: var(--menuBorder);--color-border-icon: var(--menuBorder);--color-background-item: var(--menuItemBackground);--color-background-item-hover: var(--menuItemHover)}:host ::ng-deep .ce-popover__search{background:var(--menuIconBackground)}:host ::ng-deep .ce-popover .ce-popover-item__icon{background:var(--menuIconBackground)}:host ::ng-deep .ce-conversion-toolbar{background-color:var(--menuBackground);border-color:var(--menuBorder)}:host ::ng-deep .ce-conversion-toolbar__tools{padding:0 6px 6px}:host ::ng-deep .ce-conversion-tool{padding:3px;border-radius:6px}:host ::ng-deep .ce-conversion-tool__icon{border:1px solid var(--menuBorder);background-color:var(--menuIconBackground);box-shadow:none}:host ::ng-deep .ce-conversion-tool:hover{background-color:var(--menuItemHover)}:host ::ng-deep .ce-conversion-tool:hover .ce-conversion-tool__icon{border-color:var(--menuIconHover)}:host ::ng-deep .combined-text-block{padding:.4em 0;line-height:1.6em;outline:none}:host ::ng-deep .combined-text-block .combined-text-block-part{outline:none}:host ::ng-deep .combined-text-block .combined-text-block-part:only-child,:host ::ng-deep .combined-text-block .combined-text-block-part._selected{display:list-item}:host ::ng-deep .combined-text-block .combined-text-block-part:only-child::marker,:host ::ng-deep .combined-text-block .combined-text-block-part._selected::marker{content:\"\"}:host ::ng-deep .image-tool__image{border:1px solid var(--cui-base-200);background-color:var(--cui-base-0)}:host ::ng-deep .image-tool__image-preloader{background-color:var(--cui-base-200)}:host ::ng-deep .image-tool__image-preloader:after{border:1px solid var(--cui-base-200);border-top:1px solid var(--cui-blue-600)}:host ::ng-deep .cdx-button{border:1px solid var(--cui-base-200);color:var(--textColor);background-color:var(--cui-base-0);box-shadow:none}:host ::ng-deep .ce-inline-toolbar{border-color:var(--cui-base-100);color:var(--textColor);background-color:var(--cui-base-0)}:host ::ng-deep .ce-inline-toolbar__dropdown:hover{background-color:var(--cui-base-100)}:host ::ng-deep .ce-inline-tool:hover{background-color:var(--cui-base-100)}:host ::ng-deep .ce-toolbar__plus,:host ::ng-deep .ce-toolbar__settings-btn{color:var(--cui-base-500)}:host ::ng-deep .ce-toolbar__plus:hover,:host ::ng-deep .ce-toolbar__settings-btn:hover{background-color:var(--cui-base-100)}:host ::ng-deep .ce-toolbar__actions{right:100%}:host ::ng-deep .ce-toolbar__content{max-width:none}:host ::ng-deep .ce-block--selected .ce-block__content{background-color:var(--cui-base-200)}:host ::ng-deep .ce-block__content{max-width:100%}:host ::ng-deep .ce-block:only-of-type .combined-text-block[data-placeholder-active][data-empty=true]:before{content:attr(data-placeholder-active);position:absolute;color:var(--cui-base-400)}:host ::ng-deep [data-editor]{padding-right:4px;width:100%;height:100%;min-height:200px;overflow:hidden auto;scrollbar-gutter:stable}:host ::ng-deep [data-editor] .codex-editor{margin-left:60px}:host ::ng-deep [data-editor] .codex-editor--narrow .ce-popover{right:auto}:host ::ng-deep [data-editor] .codex-editor__redactor{margin-right:auto;padding-bottom:260px!important}:host ::ng-deep [data-editor]._readonly{min-height:auto}:host ::ng-deep [data-editor]._readonly .codex-editor{margin:auto}:host ::ng-deep [data-editor]._readonly .codex-editor__redactor{padding-bottom:0!important}:host ::ng-deep [data-editor]._readonly .combined-text-block{padding:0}:host ::ng-deep [data-editor] [data-item-name=move-up],:host ::ng-deep [data-editor] [data-item-name=move-down],:host ::ng-deep [data-editor] [data-tool=paragraph]{display:none}:host ::ng-deep [data-editor] *::selection{background:var(--cui-base-200)}:host ::ng-deep [data-editor] a{color:var(--cui-light-blue-600)}:host ::ng-deep .marker{cursor:pointer;text-decoration:underline;color:var(--cui-light-blue-600);background-color:transparent}:host ::ng-deep .tool-marker,:host ::ng-deep .role-marker{margin:0 5px}:host ::ng-deep .tool-marker{color:#e97c00}:host ::ng-deep .role-marker{color:#8803f1}.form{height:100%}\n"] }]
|
|
7303
7276
|
}], propDecorators: { editorRef: [{
|
|
7304
7277
|
type: ViewChild,
|
|
7305
7278
|
args: ['editor']
|
|
7306
7279
|
}], editorEmpty: [{
|
|
7307
7280
|
type: Output
|
|
7308
|
-
}],
|
|
7281
|
+
}], editorApiId: [{
|
|
7309
7282
|
type: Input,
|
|
7310
7283
|
args: [{ required: true }]
|
|
7311
7284
|
}], config: [{
|
|
@@ -7343,11 +7316,11 @@ class CuiEditorReadonlyComponent {
|
|
|
7343
7316
|
}, { allowSignalWrites: true });
|
|
7344
7317
|
}
|
|
7345
7318
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CuiEditorReadonlyComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
7346
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: CuiEditorReadonlyComponent, isStandalone: true, selector: "cui-editor-readonly", inputs: { editorId: { classPropertyName: "editorId", publicName: "editorId", isSignal: true, isRequired: true, transformFunction: null }, config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null }, buttonTemplate: { classPropertyName: "buttonTemplate", publicName: "buttonTemplate", isSignal: true, isRequired: true, transformFunction: null }, shortHeight: { classPropertyName: "shortHeight", publicName: "shortHeight", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "editor", first: true, predicate: ["editor"], descendants: true, isSignal: true }], ngImport: i0, template: "<cui-editor\r\n #editor\r\n class=\"editor\"\r\n [class.editor_opened]=\"isShowMore()\"\r\n [
|
|
7319
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: CuiEditorReadonlyComponent, isStandalone: true, selector: "cui-editor-readonly", inputs: { editorId: { classPropertyName: "editorId", publicName: "editorId", isSignal: true, isRequired: true, transformFunction: null }, config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null }, buttonTemplate: { classPropertyName: "buttonTemplate", publicName: "buttonTemplate", isSignal: true, isRequired: true, transformFunction: null }, shortHeight: { classPropertyName: "shortHeight", publicName: "shortHeight", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "editor", first: true, predicate: ["editor"], descendants: true, isSignal: true }], ngImport: i0, template: "<cui-editor\r\n #editor\r\n class=\"editor\"\r\n [class.editor_opened]=\"isShowMore()\"\r\n [editorApiId]=\"editorId()\"\r\n [config]=\"editorConfig()\"\r\n/>\r\n@if (isMoreButtonShown()) {\r\n <button class=\"c-button\" (click)=\"onShow(editor)\">\r\n <ng-container [ngTemplateOutlet]=\"buttonTemplate()\" [ngTemplateOutletContext]=\"{ $implicit: isShowMore }\"></ng-container>\r\n </button>\r\n}\r\n", styles: [":host{--height: 68px;--fullHeight: 500px;display:flex;flex-direction:column;gap:8px}:host .editor{display:block;max-height:var(--height);overflow:hidden}:host .editor ::ng-deep [data-editor]{overflow:hidden}:host .editor_opened{max-height:var(--fullHeight)}:host .editor_opened ::ng-deep [data-editor]{max-height:var(--fullHeight);overflow:hidden auto}.c-button{padding:0}\n"], dependencies: [{ kind: "component", type: CuiEditorComponent, selector: "cui-editor", inputs: ["editorApiId", "config", "requestSize"], outputs: ["editorEmpty"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
7347
7320
|
}
|
|
7348
7321
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CuiEditorReadonlyComponent, decorators: [{
|
|
7349
7322
|
type: Component,
|
|
7350
|
-
args: [{ selector: 'cui-editor-readonly', standalone: true, imports: [CuiEditorComponent, NgTemplateOutlet], changeDetection: ChangeDetectionStrategy.OnPush, template: "<cui-editor\r\n #editor\r\n class=\"editor\"\r\n [class.editor_opened]=\"isShowMore()\"\r\n [
|
|
7323
|
+
args: [{ selector: 'cui-editor-readonly', standalone: true, imports: [CuiEditorComponent, NgTemplateOutlet], changeDetection: ChangeDetectionStrategy.OnPush, template: "<cui-editor\r\n #editor\r\n class=\"editor\"\r\n [class.editor_opened]=\"isShowMore()\"\r\n [editorApiId]=\"editorId()\"\r\n [config]=\"editorConfig()\"\r\n/>\r\n@if (isMoreButtonShown()) {\r\n <button class=\"c-button\" (click)=\"onShow(editor)\">\r\n <ng-container [ngTemplateOutlet]=\"buttonTemplate()\" [ngTemplateOutletContext]=\"{ $implicit: isShowMore }\"></ng-container>\r\n </button>\r\n}\r\n", styles: [":host{--height: 68px;--fullHeight: 500px;display:flex;flex-direction:column;gap:8px}:host .editor{display:block;max-height:var(--height);overflow:hidden}:host .editor ::ng-deep [data-editor]{overflow:hidden}:host .editor_opened{max-height:var(--fullHeight)}:host .editor_opened ::ng-deep [data-editor]{max-height:var(--fullHeight);overflow:hidden auto}.c-button{padding:0}\n"] }]
|
|
7351
7324
|
}], ctorParameters: () => [] });
|
|
7352
7325
|
|
|
7353
7326
|
class CuiEditorModalComponent {
|
|
@@ -7378,7 +7351,7 @@ class CuiEditorModalComponent {
|
|
|
7378
7351
|
this.modalClosed.emit();
|
|
7379
7352
|
}
|
|
7380
7353
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CuiEditorModalComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
7381
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: CuiEditorModalComponent, isStandalone: true, selector: "cui-editor-modal", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: true, transformFunction: null }, buttonTemplate: { classPropertyName: "buttonTemplate", publicName: "buttonTemplate", isSignal: true, isRequired: false, transformFunction: null }, config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null }, editorId: { classPropertyName: "editorId", publicName: "editorId", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { editorCreated: "editorCreated", modalClosed: "modalClosed" }, ngImport: i0, template: "@if (buttonTemplate(); as template) {\n <button\n type=\"button\"\n class=\"button\"\n (click)=\"onModalOpen()\"\n >\n <ng-container [ngTemplateOutlet]=\"template\" />\n </button>\n} @else {\n <button\n class=\"description\"\n cuiButton\n type=\"button\"\n appearance=\"outlined-gray\"\n icon=\"cuiIconRichText\"\n size=\"sm\"\n (click)=\"onModalOpen()\"\n [disabled]=\"isButtonDisabled()\"\n >\n @if (editorId()) {\n <span class=\"description__text _created\">{{ 'Description' }}</span>\n <cui-svg\n class=\"description__icon\"\n icon=\"cuiIconEdit\"\n color=\"var(--cui-base-500)\"\n />\n } @else {\n <cui-svg\n class=\"description__icon\"\n icon=\"cuiIconPlus\"\n color=\"var(--cui-light-blue-600)\"\n />\n <span class=\"description__text\">{{ 'Add description' }}</span>\n }\n </button>\n}\n@if (isOpen()) {\n <div class=\"wrapper\">\n @if (editorId(); as id) {\n <header class=\"header\">\n <div class=\"info\">\n <button\n cuiButton\n type=\"button\"\n icon=\"cuiIconChevronLeft\"\n size=\"xxs\"\n appearance=\"secondary\"\n shape=\"rounded\"\n (click)=\"close()\"\n ></button>\n <h1 class=\"title\">{{ title() }}</h1>\n </div>\n <div class=\"actions\">\n <!-- <cui-loader /> -->\n <button\n type=\"button\"\n cuiButton\n size=\"xs\"\n (click)=\"close()\"\n >\n {{ 'Done' }}\n </button>\n </div>\n </header>\n\n <section class=\"section\">\n <cui-editor\n #editorComponent\n class=\"editor\"\n [
|
|
7354
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: CuiEditorModalComponent, isStandalone: true, selector: "cui-editor-modal", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: true, transformFunction: null }, buttonTemplate: { classPropertyName: "buttonTemplate", publicName: "buttonTemplate", isSignal: true, isRequired: false, transformFunction: null }, config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null }, editorId: { classPropertyName: "editorId", publicName: "editorId", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { editorCreated: "editorCreated", modalClosed: "modalClosed" }, ngImport: i0, template: "@if (buttonTemplate(); as template) {\n <button\n type=\"button\"\n class=\"button\"\n (click)=\"onModalOpen()\"\n >\n <ng-container [ngTemplateOutlet]=\"template\" />\n </button>\n} @else {\n <button\n class=\"description\"\n cuiButton\n type=\"button\"\n appearance=\"outlined-gray\"\n icon=\"cuiIconRichText\"\n size=\"sm\"\n (click)=\"onModalOpen()\"\n [disabled]=\"isButtonDisabled()\"\n >\n @if (editorId()) {\n <span class=\"description__text _created\">{{ 'Description' }}</span>\n <cui-svg\n class=\"description__icon\"\n icon=\"cuiIconEdit\"\n color=\"var(--cui-base-500)\"\n />\n } @else {\n <cui-svg\n class=\"description__icon\"\n icon=\"cuiIconPlus\"\n color=\"var(--cui-light-blue-600)\"\n />\n <span class=\"description__text\">{{ 'Add description' }}</span>\n }\n </button>\n}\n@if (isOpen()) {\n <div class=\"wrapper\">\n @if (editorId(); as id) {\n <header class=\"header\">\n <div class=\"info\">\n <button\n cuiButton\n type=\"button\"\n icon=\"cuiIconChevronLeft\"\n size=\"xxs\"\n appearance=\"secondary\"\n shape=\"rounded\"\n (click)=\"close()\"\n ></button>\n <h1 class=\"title\">{{ title() }}</h1>\n </div>\n <div class=\"actions\">\n <!-- <cui-loader /> -->\n <button\n type=\"button\"\n cuiButton\n size=\"xs\"\n (click)=\"close()\"\n >\n {{ 'Done' }}\n </button>\n </div>\n </header>\n\n <section class=\"section\">\n <cui-editor\n #editorComponent\n class=\"editor\"\n [editorApiId]=\"id\"\n [config]=\"config()\"\n />\n </section>\n }\n </div>\n}\n", styles: [":host ::ng-deep .delete{width:max-content}:host ::ng-deep .delete .c-content{display:flex;align-items:center;gap:4px;color:var(--cui-danger)}:host ::ng-deep .description .c-content{display:flex;align-items:center;gap:4px}.button{padding:0}.description{width:max-content}.description__text{color:var(--cui-light-blue-600)}.description__text._created{color:var(--cui-base-900)}.description__icon{padding:4px}.wrapper{position:fixed;z-index:10;inset:0;background-color:var(--cui-base-0)}.header{display:flex;justify-content:space-between;padding:8px 16px;border-bottom:.5px solid var(--cui-base-200);background:var(--cui-base-0)}.info,.actions{display:flex;gap:12px;align-items:center}.section{padding-right:24px;padding-left:24px;padding-top:24px;height:calc(100% - 50px);overflow:hidden}.title{font-weight:500;font-size:14px;line-height:20px;margin:0}.editor{padding-right:32px;padding-left:32px;padding-top:32px;display:block;margin:0 auto;max-width:750px;height:100%}\n"], dependencies: [{ kind: "component", type: CuiEditorComponent, selector: "cui-editor", inputs: ["editorApiId", "config", "requestSize"], outputs: ["editorEmpty"] }, { kind: "ngmodule", type: CuiButtonModule }, { kind: "component", type: CuiButtonComponent, selector: "button[cuiButton], a[cuiButton]", inputs: ["shape", "disabled", "isLoaderShown", "icon", "iconRight", "appearance", "size"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: CuiSvgModule }, { kind: "component", type: CuiSvgComponent, selector: "cui-svg[icon]", inputs: ["width", "height", "strokeWidth", "color", "icon"] }] }); }
|
|
7382
7355
|
}
|
|
7383
7356
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CuiEditorModalComponent, decorators: [{
|
|
7384
7357
|
type: Component,
|
|
@@ -7387,7 +7360,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
7387
7360
|
CuiButtonModule,
|
|
7388
7361
|
NgTemplateOutlet,
|
|
7389
7362
|
CuiSvgModule
|
|
7390
|
-
], standalone: true, template: "@if (buttonTemplate(); as template) {\n <button\n type=\"button\"\n class=\"button\"\n (click)=\"onModalOpen()\"\n >\n <ng-container [ngTemplateOutlet]=\"template\" />\n </button>\n} @else {\n <button\n class=\"description\"\n cuiButton\n type=\"button\"\n appearance=\"outlined-gray\"\n icon=\"cuiIconRichText\"\n size=\"sm\"\n (click)=\"onModalOpen()\"\n [disabled]=\"isButtonDisabled()\"\n >\n @if (editorId()) {\n <span class=\"description__text _created\">{{ 'Description' }}</span>\n <cui-svg\n class=\"description__icon\"\n icon=\"cuiIconEdit\"\n color=\"var(--cui-base-500)\"\n />\n } @else {\n <cui-svg\n class=\"description__icon\"\n icon=\"cuiIconPlus\"\n color=\"var(--cui-light-blue-600)\"\n />\n <span class=\"description__text\">{{ 'Add description' }}</span>\n }\n </button>\n}\n@if (isOpen()) {\n <div class=\"wrapper\">\n @if (editorId(); as id) {\n <header class=\"header\">\n <div class=\"info\">\n <button\n cuiButton\n type=\"button\"\n icon=\"cuiIconChevronLeft\"\n size=\"xxs\"\n appearance=\"secondary\"\n shape=\"rounded\"\n (click)=\"close()\"\n ></button>\n <h1 class=\"title\">{{ title() }}</h1>\n </div>\n <div class=\"actions\">\n <!-- <cui-loader /> -->\n <button\n type=\"button\"\n cuiButton\n size=\"xs\"\n (click)=\"close()\"\n >\n {{ 'Done' }}\n </button>\n </div>\n </header>\n\n <section class=\"section\">\n <cui-editor\n #editorComponent\n class=\"editor\"\n [
|
|
7363
|
+
], standalone: true, template: "@if (buttonTemplate(); as template) {\n <button\n type=\"button\"\n class=\"button\"\n (click)=\"onModalOpen()\"\n >\n <ng-container [ngTemplateOutlet]=\"template\" />\n </button>\n} @else {\n <button\n class=\"description\"\n cuiButton\n type=\"button\"\n appearance=\"outlined-gray\"\n icon=\"cuiIconRichText\"\n size=\"sm\"\n (click)=\"onModalOpen()\"\n [disabled]=\"isButtonDisabled()\"\n >\n @if (editorId()) {\n <span class=\"description__text _created\">{{ 'Description' }}</span>\n <cui-svg\n class=\"description__icon\"\n icon=\"cuiIconEdit\"\n color=\"var(--cui-base-500)\"\n />\n } @else {\n <cui-svg\n class=\"description__icon\"\n icon=\"cuiIconPlus\"\n color=\"var(--cui-light-blue-600)\"\n />\n <span class=\"description__text\">{{ 'Add description' }}</span>\n }\n </button>\n}\n@if (isOpen()) {\n <div class=\"wrapper\">\n @if (editorId(); as id) {\n <header class=\"header\">\n <div class=\"info\">\n <button\n cuiButton\n type=\"button\"\n icon=\"cuiIconChevronLeft\"\n size=\"xxs\"\n appearance=\"secondary\"\n shape=\"rounded\"\n (click)=\"close()\"\n ></button>\n <h1 class=\"title\">{{ title() }}</h1>\n </div>\n <div class=\"actions\">\n <!-- <cui-loader /> -->\n <button\n type=\"button\"\n cuiButton\n size=\"xs\"\n (click)=\"close()\"\n >\n {{ 'Done' }}\n </button>\n </div>\n </header>\n\n <section class=\"section\">\n <cui-editor\n #editorComponent\n class=\"editor\"\n [editorApiId]=\"id\"\n [config]=\"config()\"\n />\n </section>\n }\n </div>\n}\n", styles: [":host ::ng-deep .delete{width:max-content}:host ::ng-deep .delete .c-content{display:flex;align-items:center;gap:4px;color:var(--cui-danger)}:host ::ng-deep .description .c-content{display:flex;align-items:center;gap:4px}.button{padding:0}.description{width:max-content}.description__text{color:var(--cui-light-blue-600)}.description__text._created{color:var(--cui-base-900)}.description__icon{padding:4px}.wrapper{position:fixed;z-index:10;inset:0;background-color:var(--cui-base-0)}.header{display:flex;justify-content:space-between;padding:8px 16px;border-bottom:.5px solid var(--cui-base-200);background:var(--cui-base-0)}.info,.actions{display:flex;gap:12px;align-items:center}.section{padding-right:24px;padding-left:24px;padding-top:24px;height:calc(100% - 50px);overflow:hidden}.title{font-weight:500;font-size:14px;line-height:20px;margin:0}.editor{padding-right:32px;padding-left:32px;padding-top:32px;display:block;margin:0 auto;max-width:750px;height:100%}\n"] }]
|
|
7391
7364
|
}] });
|
|
7392
7365
|
|
|
7393
7366
|
class CuiEditorBlockComponent {
|
|
@@ -7428,7 +7401,7 @@ class CuiEditorBlockComponent {
|
|
|
7428
7401
|
}, { allowSignalWrites: true });
|
|
7429
7402
|
}
|
|
7430
7403
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CuiEditorBlockComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
7431
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: CuiEditorBlockComponent, isStandalone: true, selector: "cui-editor-block", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: true, transformFunction: null }, editorId: { classPropertyName: "editorId", publicName: "editorId", isSignal: true, isRequired: true, transformFunction: null }, config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { editorEmpty: "editorEmpty" }, viewQueries: [{ propertyName: "editorContainer", first: true, predicate: ["editorContainer"], descendants: true, read: ElementRef, isSignal: true }], ngImport: i0, template: "<ng-container *transloco=\"let t\">\n <div class=\"wrapper\">\n <span class=\"title\">\n {{ t('DESCRIPTION') }}\n @if (required()) {\n <span class=\"title__required\">*</span>\n }\n </span>\n <ng-template #button>\n <button\n [cuiTooltip]=\"t('EXPAND_EDITOR_TO_FULLSCREEN')\"\n cuiButton\n size=\"xxs\"\n type=\"button\"\n appearance=\"ghost\"\n icon=\"cuiIconMaximizeSm\"\n (click)=\"onToggleDescriptionModal()\"\n ></button>\n </ng-template>\n <cui-editor-modal\n [title]=\"title()\"\n [editorId]=\"editorId()\"\n [buttonTemplate]=\"button\"\n [config]=\"config()\"\n (modalClosed)=\"onToggleDescriptionModal()\"\n />\n </div>\n <div\n #editorContainer\n cuiContentWrapper\n class=\"editor\"\n [class.editor_invalid]=\"required() && isDescriptionEmpty()\"\n >\n @if (!isDescriptionModalOpen() && editorConfig()) {\n <cui-editor\n #editorComponent\n [
|
|
7404
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: CuiEditorBlockComponent, isStandalone: true, selector: "cui-editor-block", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: true, transformFunction: null }, editorId: { classPropertyName: "editorId", publicName: "editorId", isSignal: true, isRequired: true, transformFunction: null }, config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { editorEmpty: "editorEmpty" }, viewQueries: [{ propertyName: "editorContainer", first: true, predicate: ["editorContainer"], descendants: true, read: ElementRef, isSignal: true }], ngImport: i0, template: "<ng-container *transloco=\"let t\">\n <div class=\"wrapper\">\n <span class=\"title\">\n {{ t('DESCRIPTION') }}\n @if (required()) {\n <span class=\"title__required\">*</span>\n }\n </span>\n <ng-template #button>\n <button\n [cuiTooltip]=\"t('EXPAND_EDITOR_TO_FULLSCREEN')\"\n cuiButton\n size=\"xxs\"\n type=\"button\"\n appearance=\"ghost\"\n icon=\"cuiIconMaximizeSm\"\n (click)=\"onToggleDescriptionModal()\"\n ></button>\n </ng-template>\n <cui-editor-modal\n [title]=\"title()\"\n [editorId]=\"editorId()\"\n [buttonTemplate]=\"button\"\n [config]=\"config()\"\n (modalClosed)=\"onToggleDescriptionModal()\"\n />\n </div>\n <div\n #editorContainer\n cuiContentWrapper\n class=\"editor\"\n [class.editor_invalid]=\"required() && isDescriptionEmpty()\"\n >\n @if (!isDescriptionModalOpen() && editorConfig()) {\n <cui-editor\n #editorComponent\n [editorApiId]=\"editorId()\"\n [config]=\"editorConfig()!\"\n (editorEmpty)=\"onDescriptionChange($event)\"\n />\n }\n </div>\n @if (required() && isDescriptionEmpty()) {\n <cui-hint hintType=\"error\">{{ t('DESCRIPTION_IS_REQUIRED') }}</cui-hint>\n }\n</ng-container>\n", styles: [":host{--max-editor-height: 650px;padding:16px;display:flex;flex-direction:column;gap:8px;background:var(--cui-base-10);border-radius:8px}:host .editor{max-height:var(--max-editor-height)}.wrapper{display:flex;gap:8px;align-items:center;justify-content:space-between}.editor{padding-top:16px;padding-bottom:16px;display:block;overflow:auto}.editor_invalid{border:1px solid var(--cui-danger)}.title{font-weight:500;font-size:14px;line-height:20px}.title__required{color:var(--cui-danger)}\n"], dependencies: [{ kind: "ngmodule", type: CuiButtonModule }, { kind: "component", type: CuiButtonComponent, selector: "button[cuiButton], a[cuiButton]", inputs: ["shape", "disabled", "isLoaderShown", "icon", "iconRight", "appearance", "size"] }, { kind: "component", type: CuiEditorModalComponent, selector: "cui-editor-modal", inputs: ["title", "buttonTemplate", "config", "editorId"], outputs: ["editorCreated", "modalClosed"] }, { kind: "component", type: CuiEditorComponent, selector: "cui-editor", inputs: ["editorApiId", "config", "requestSize"], outputs: ["editorEmpty"] }, { kind: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }, { kind: "component", type: CuiContentWrapperComponent, selector: "cui-content-wrapper, [cuiContentWrapper]", inputs: ["backgroundColor", "gap"] }, { kind: "directive", type: CuiTooltipDirective, selector: "[cuiTooltip]:not(ng-container):not(ng-template)", inputs: ["cuiTooltipContext", "cuiTooltipAppearance", "cuiTooltip"] }, { kind: "ngmodule", type: CuiHintModule }, { kind: "component", type: CuiHintComponent, selector: "cui-hint", inputs: ["hintType"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
7432
7405
|
}
|
|
7433
7406
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CuiEditorBlockComponent, decorators: [{
|
|
7434
7407
|
type: Component,
|
|
@@ -7440,7 +7413,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
7440
7413
|
CuiContentWrapperComponent,
|
|
7441
7414
|
CuiTooltip,
|
|
7442
7415
|
CuiHintModule
|
|
7443
|
-
], standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *transloco=\"let t\">\n <div class=\"wrapper\">\n <span class=\"title\">\n {{ t('DESCRIPTION') }}\n @if (required()) {\n <span class=\"title__required\">*</span>\n }\n </span>\n <ng-template #button>\n <button\n [cuiTooltip]=\"t('EXPAND_EDITOR_TO_FULLSCREEN')\"\n cuiButton\n size=\"xxs\"\n type=\"button\"\n appearance=\"ghost\"\n icon=\"cuiIconMaximizeSm\"\n (click)=\"onToggleDescriptionModal()\"\n ></button>\n </ng-template>\n <cui-editor-modal\n [title]=\"title()\"\n [editorId]=\"editorId()\"\n [buttonTemplate]=\"button\"\n [config]=\"config()\"\n (modalClosed)=\"onToggleDescriptionModal()\"\n />\n </div>\n <div\n #editorContainer\n cuiContentWrapper\n class=\"editor\"\n [class.editor_invalid]=\"required() && isDescriptionEmpty()\"\n >\n @if (!isDescriptionModalOpen() && editorConfig()) {\n <cui-editor\n #editorComponent\n [
|
|
7416
|
+
], standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *transloco=\"let t\">\n <div class=\"wrapper\">\n <span class=\"title\">\n {{ t('DESCRIPTION') }}\n @if (required()) {\n <span class=\"title__required\">*</span>\n }\n </span>\n <ng-template #button>\n <button\n [cuiTooltip]=\"t('EXPAND_EDITOR_TO_FULLSCREEN')\"\n cuiButton\n size=\"xxs\"\n type=\"button\"\n appearance=\"ghost\"\n icon=\"cuiIconMaximizeSm\"\n (click)=\"onToggleDescriptionModal()\"\n ></button>\n </ng-template>\n <cui-editor-modal\n [title]=\"title()\"\n [editorId]=\"editorId()\"\n [buttonTemplate]=\"button\"\n [config]=\"config()\"\n (modalClosed)=\"onToggleDescriptionModal()\"\n />\n </div>\n <div\n #editorContainer\n cuiContentWrapper\n class=\"editor\"\n [class.editor_invalid]=\"required() && isDescriptionEmpty()\"\n >\n @if (!isDescriptionModalOpen() && editorConfig()) {\n <cui-editor\n #editorComponent\n [editorApiId]=\"editorId()\"\n [config]=\"editorConfig()!\"\n (editorEmpty)=\"onDescriptionChange($event)\"\n />\n }\n </div>\n @if (required() && isDescriptionEmpty()) {\n <cui-hint hintType=\"error\">{{ t('DESCRIPTION_IS_REQUIRED') }}</cui-hint>\n }\n</ng-container>\n", styles: [":host{--max-editor-height: 650px;padding:16px;display:flex;flex-direction:column;gap:8px;background:var(--cui-base-10);border-radius:8px}:host .editor{max-height:var(--max-editor-height)}.wrapper{display:flex;gap:8px;align-items:center;justify-content:space-between}.editor{padding-top:16px;padding-bottom:16px;display:block;overflow:auto}.editor_invalid{border:1px solid var(--cui-danger)}.title{font-weight:500;font-size:14px;line-height:20px}.title__required{color:var(--cui-danger)}\n"] }]
|
|
7444
7417
|
}], ctorParameters: () => [] });
|
|
7445
7418
|
|
|
7446
7419
|
const cuiXNdjsonInterceptor = (request, next) => {
|
|
@@ -7512,6 +7485,107 @@ const cuiErrorHandlerInterceptor = (request, next) => {
|
|
|
7512
7485
|
}));
|
|
7513
7486
|
};
|
|
7514
7487
|
|
|
7488
|
+
const CuiAuthService = new InjectionToken('CUI_AUTH_SERVICE');
|
|
7489
|
+
|
|
7490
|
+
class CuiAuthBase extends OAuthService {
|
|
7491
|
+
useCheckTokenFlow(loginCallback) {
|
|
7492
|
+
const isTokenExist = this.hasValidAccessToken();
|
|
7493
|
+
if (isTokenExist) {
|
|
7494
|
+
return this.refreshTokenWithExpiredChecking();
|
|
7495
|
+
}
|
|
7496
|
+
return loginCallback();
|
|
7497
|
+
}
|
|
7498
|
+
checkIsTokenExpired() {
|
|
7499
|
+
const expiredTime = this.getAccessTokenExpiration();
|
|
7500
|
+
const currentTime = Date.now();
|
|
7501
|
+
return currentTime >= expiredTime;
|
|
7502
|
+
}
|
|
7503
|
+
refreshTokenWithExpiredChecking() {
|
|
7504
|
+
const isExpired = this.checkIsTokenExpired();
|
|
7505
|
+
if (!isExpired) {
|
|
7506
|
+
return;
|
|
7507
|
+
}
|
|
7508
|
+
this.refreshToken();
|
|
7509
|
+
}
|
|
7510
|
+
initAuthRefreshEvents(loginCallback) {
|
|
7511
|
+
this.events.pipe(filter((event) => event instanceof OAuthInfoEvent)).subscribe((event) => {
|
|
7512
|
+
if (event.type !== 'token_expires' || event.info !== 'access_token') {
|
|
7513
|
+
return;
|
|
7514
|
+
}
|
|
7515
|
+
if (!this.hasValidAccessToken()) {
|
|
7516
|
+
return loginCallback();
|
|
7517
|
+
}
|
|
7518
|
+
this.refreshToken();
|
|
7519
|
+
});
|
|
7520
|
+
}
|
|
7521
|
+
}
|
|
7522
|
+
|
|
7523
|
+
class CuiBrowserAuthService extends CuiAuthBase {
|
|
7524
|
+
constructor() {
|
|
7525
|
+
super(...arguments);
|
|
7526
|
+
this.router = inject(Router);
|
|
7527
|
+
this.location = inject(Location);
|
|
7528
|
+
}
|
|
7529
|
+
initAuth(authConfig) {
|
|
7530
|
+
this.setStorage(localStorage);
|
|
7531
|
+
this.configure(authConfig);
|
|
7532
|
+
this.loadDiscoveryDocumentAndTryLogin().then(() => {
|
|
7533
|
+
this.initAuthRefreshEvents(this.initLoginFlow.bind(this));
|
|
7534
|
+
this.useCheckTokenFlow(this.initLoginFlow.bind(this));
|
|
7535
|
+
this.router.navigateByUrl(this.location.path());
|
|
7536
|
+
});
|
|
7537
|
+
}
|
|
7538
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CuiBrowserAuthService, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
7539
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CuiBrowserAuthService, providedIn: 'root' }); }
|
|
7540
|
+
}
|
|
7541
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CuiBrowserAuthService, decorators: [{
|
|
7542
|
+
type: Injectable,
|
|
7543
|
+
args: [{
|
|
7544
|
+
providedIn: 'root'
|
|
7545
|
+
}]
|
|
7546
|
+
}] });
|
|
7547
|
+
|
|
7548
|
+
class CuiMobileAuthService extends CuiAuthBase {
|
|
7549
|
+
initAuth(authConfig) {
|
|
7550
|
+
this.setStorage(localStorage);
|
|
7551
|
+
this.configure(authConfig);
|
|
7552
|
+
}
|
|
7553
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CuiMobileAuthService, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
7554
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CuiMobileAuthService, providedIn: 'root' }); }
|
|
7555
|
+
}
|
|
7556
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CuiMobileAuthService, decorators: [{
|
|
7557
|
+
type: Injectable,
|
|
7558
|
+
args: [{
|
|
7559
|
+
providedIn: 'root'
|
|
7560
|
+
}]
|
|
7561
|
+
}] });
|
|
7562
|
+
|
|
7563
|
+
function provideCuiAuth({ authConfig, moduleConfig, platform = 'browser' }) {
|
|
7564
|
+
return [
|
|
7565
|
+
provideOAuthClient(moduleConfig),
|
|
7566
|
+
{
|
|
7567
|
+
provide: CuiAuthService,
|
|
7568
|
+
useFactory: () => {
|
|
7569
|
+
if (platform === 'mobile') {
|
|
7570
|
+
return inject(CuiMobileAuthService);
|
|
7571
|
+
}
|
|
7572
|
+
return inject(CuiBrowserAuthService);
|
|
7573
|
+
}
|
|
7574
|
+
},
|
|
7575
|
+
makeEnvironmentProviders([
|
|
7576
|
+
{
|
|
7577
|
+
provide: APP_INITIALIZER,
|
|
7578
|
+
useValue: () => initAuth(authConfig),
|
|
7579
|
+
multi: true
|
|
7580
|
+
}
|
|
7581
|
+
])
|
|
7582
|
+
];
|
|
7583
|
+
}
|
|
7584
|
+
function initAuth(authConfig) {
|
|
7585
|
+
const authService = inject(CuiAuthService);
|
|
7586
|
+
return authService.initAuth(authConfig);
|
|
7587
|
+
}
|
|
7588
|
+
|
|
7515
7589
|
const cuiAuthInterceptor = (request, next) => {
|
|
7516
7590
|
const authService = inject(CuiAuthService);
|
|
7517
7591
|
if (!authService.hasValidAccessToken()) {
|
|
@@ -9032,39 +9106,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
9032
9106
|
], standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, providers: [CuiCheckListBlockService], template: "<cui-content-wrapper\n *transloco=\"let t\"\n backgroundColor=\"var(--cui-base-10)\"\n [gap]=\"16\"\n>\n <ng-container *cuiLet=\"checkListItems() as checkListItems\">\n <header class=\"header\">\n <h2 class=\"heading\">{{ t('CHECKLIST') }}</h2>\n\n @if (checkListItems) {\n <span class=\"item\">{{ checkListItems?.length }} {{ t('ITEM_VARIANT') }}</span>\n }\n </header>\n <cui-content-wrapper>\n <cui-checklist-block-list [config]=\"config()\" />\n </cui-content-wrapper>\n <div>\n <button\n #actionButton=\"elementRef\"\n cuiElement\n cuiButton\n type=\"button\"\n appearance=\"flat\"\n size=\"xxs\"\n icon=\"cuiIconPlus\"\n >\n {{ t('ADD_NEW_ITEM') }}\n </button>\n <cui-context-menu\n [items]=\"CHECKLIST_BLOCK_SELECT_OPTIONS\"\n [target]=\"actionButton.nativeElement\"\n />\n </div>\n </ng-container>\n</cui-content-wrapper>\n", styles: [".header{display:flex;gap:12px;align-items:center;justify-content:space-between}.heading{font-weight:500;font-size:16px;line-height:24px}.item{font-weight:400;font-size:12px;line-height:14px;color:var(--cui-base-500)}\n"] }]
|
|
9033
9107
|
}], ctorParameters: () => [] });
|
|
9034
9108
|
|
|
9035
|
-
function provideCuiAuth({ authConfig, moduleConfig }) {
|
|
9036
|
-
return [
|
|
9037
|
-
provideOAuthClient(moduleConfig),
|
|
9038
|
-
makeEnvironmentProviders([
|
|
9039
|
-
{
|
|
9040
|
-
provide: APP_INITIALIZER,
|
|
9041
|
-
useValue: () => configureAuth(authConfig),
|
|
9042
|
-
multi: true
|
|
9043
|
-
}
|
|
9044
|
-
])
|
|
9045
|
-
];
|
|
9046
|
-
}
|
|
9047
|
-
function configureAuth(authConfig) {
|
|
9048
|
-
const authService = inject(CuiAuthService);
|
|
9049
|
-
authService.setStorage(localStorage);
|
|
9050
|
-
authService.configure(authConfig);
|
|
9051
|
-
authService.loadDiscoveryDocumentAndTryLogin().then(() => {
|
|
9052
|
-
initAuthEvents();
|
|
9053
|
-
authService.useCheckTokenFlow();
|
|
9054
|
-
});
|
|
9055
|
-
function initAuthEvents() {
|
|
9056
|
-
authService.events.pipe(filter((event) => event instanceof OAuthInfoEvent)).subscribe((event) => {
|
|
9057
|
-
if (event.type !== 'token_expires' || event.info !== 'access_token') {
|
|
9058
|
-
return;
|
|
9059
|
-
}
|
|
9060
|
-
if (!authService.hasValidAccessToken()) {
|
|
9061
|
-
return authService.initCodeFlow();
|
|
9062
|
-
}
|
|
9063
|
-
authService.refreshToken();
|
|
9064
|
-
});
|
|
9065
|
-
}
|
|
9066
|
-
}
|
|
9067
|
-
|
|
9068
9109
|
/**
|
|
9069
9110
|
* Generated bundle index. Do not edit.
|
|
9070
9111
|
*/
|