asksuite-citrus 1.7.5 → 1.7.7
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/assets/citrus-i18n/en.json +2 -0
- package/assets/citrus-i18n/es.json +2 -0
- package/assets/citrus-i18n/pt.json +2 -0
- package/esm2022/lib/asksuite-citrus.module.mjs +18 -4
- package/esm2022/lib/classes/richtext-wrapper.mjs +298 -0
- package/esm2022/lib/classes/toolbox-bubble.mjs +46 -0
- package/esm2022/lib/classes/toolbox-topbar.mjs +34 -0
- package/esm2022/lib/classes/toolbox.mjs +109 -0
- package/esm2022/lib/components/autocomplete/autocomplete.component.mjs +2 -2
- package/esm2022/lib/components/avatar/avatar.component.mjs +2 -2
- package/esm2022/lib/components/box/box.component.mjs +2 -2
- package/esm2022/lib/components/button/button.component.mjs +2 -2
- package/esm2022/lib/components/character-counter/character-counter.component.mjs +2 -2
- package/esm2022/lib/components/checkbox/checkbox.component.mjs +2 -2
- package/esm2022/lib/components/chips/chips.component.mjs +2 -2
- package/esm2022/lib/components/date-picker/date-picker-calendar/date-picker-calendar.component.mjs +2 -2
- package/esm2022/lib/components/date-picker/date-picker.component.mjs +2 -2
- package/esm2022/lib/components/dropdown-container/dropdown-container.component.mjs +2 -2
- package/esm2022/lib/components/input/input.component.mjs +2 -2
- package/esm2022/lib/components/modal/modal.component.mjs +2 -2
- package/esm2022/lib/components/pagination/pagination.component.mjs +2 -2
- package/esm2022/lib/components/richtext-toolbox-core/richtext-toolbox-core.component.mjs +82 -0
- package/esm2022/lib/components/richtext-url-prompt/richtext-url-prompt-state.service.mjs +16 -0
- package/esm2022/lib/components/richtext-url-prompt/richtext-url-prompt.component.mjs +66 -0
- package/esm2022/lib/components/select/select.component.mjs +2 -2
- package/esm2022/lib/components/table/table.component.mjs +2 -2
- package/esm2022/lib/components/toast/toast.component.mjs +3 -3
- package/esm2022/lib/constants/richtext-toolbox.constants.mjs +40 -0
- package/esm2022/lib/constants/url-regex.constant.mjs +2 -0
- package/esm2022/lib/directives/button/ask-base-button.directive.mjs +26 -0
- package/esm2022/lib/directives/button/ask-button.directive.mjs +9 -23
- package/esm2022/lib/directives/button/ask-text-button.directive.mjs +18 -0
- package/esm2022/lib/directives/button/index.mjs +3 -0
- package/esm2022/lib/directives/index.mjs +3 -2
- package/esm2022/lib/directives/richtext-toolbox/richtext-toolbox.directive.mjs +169 -0
- package/esm2022/lib/helpers/are-objects-equal.helper.mjs +4 -0
- package/esm2022/lib/interfaces/richtext-toolbox.interface.mjs +2 -0
- package/esm2022/lib/services/quill-builder.service.mjs +18 -0
- package/esm2022/public-api.mjs +3 -1
- package/fesm2022/asksuite-citrus.mjs +953 -68
- package/fesm2022/asksuite-citrus.mjs.map +1 -1
- package/lib/asksuite-citrus.module.d.ts +11 -7
- package/lib/classes/richtext-wrapper.d.ts +52 -0
- package/lib/classes/toolbox-bubble.d.ts +12 -0
- package/lib/classes/toolbox-topbar.d.ts +8 -0
- package/lib/classes/toolbox.d.ts +31 -0
- package/lib/components/richtext-toolbox-core/richtext-toolbox-core.component.d.ts +25 -0
- package/lib/components/richtext-url-prompt/richtext-url-prompt-state.service.d.ts +6 -0
- package/lib/components/richtext-url-prompt/richtext-url-prompt.component.d.ts +19 -0
- package/lib/components/toast/toast.component.d.ts +1 -2
- package/lib/constants/richtext-toolbox.constants.d.ts +4 -0
- package/lib/constants/url-regex.constant.d.ts +1 -0
- package/lib/directives/button/ask-base-button.directive.d.ts +9 -0
- package/lib/directives/button/ask-button.directive.d.ts +3 -4
- package/lib/directives/button/ask-text-button.directive.d.ts +8 -0
- package/lib/directives/button/index.d.ts +2 -0
- package/lib/directives/index.d.ts +2 -1
- package/lib/directives/richtext-toolbox/richtext-toolbox.directive.d.ts +40 -0
- package/lib/helpers/are-objects-equal.helper.d.ts +1 -0
- package/lib/interfaces/richtext-toolbox.interface.d.ts +54 -0
- package/lib/services/quill-builder.service.d.ts +8 -0
- package/package.json +3 -2
- package/public-api.d.ts +1 -0
- package/styles/ask-mixins.scss +45 -0
- package/styles/button.scss +29 -0
- package/styles/font-weights.scss +1 -0
- package/styles/quill.scss +18 -0
- package/styles/styles.scss +2 -30
@@ -30,14 +30,18 @@ import * as i28 from "./components/accordion/extendable-panel/extendable-panel.c
|
|
30
30
|
import * as i29 from "./components/table/table.component";
|
31
31
|
import * as i30 from "./components/pagination/pagination.component";
|
32
32
|
import * as i31 from "./pipes/paginate/paginate.pipe";
|
33
|
-
import * as i32 from "
|
34
|
-
import * as i33 from "
|
35
|
-
import * as i34 from "
|
36
|
-
import * as i35 from "
|
37
|
-
import * as i36 from "
|
38
|
-
import * as i37 from "@angular/
|
33
|
+
import * as i32 from "./directives/richtext-toolbox/richtext-toolbox.directive";
|
34
|
+
import * as i33 from "./components/richtext-url-prompt/richtext-url-prompt.component";
|
35
|
+
import * as i34 from "./components/richtext-toolbox-core/richtext-toolbox-core.component";
|
36
|
+
import * as i35 from "./directives/button/ask-text-button.directive";
|
37
|
+
import * as i36 from "@angular/common";
|
38
|
+
import * as i37 from "@angular/forms";
|
39
|
+
import * as i38 from "@angular/cdk/overlay";
|
40
|
+
import * as i39 from "@ngx-translate/core";
|
41
|
+
import * as i40 from "ngx-skeleton-loader";
|
42
|
+
import * as i41 from "@angular/material/tooltip";
|
39
43
|
export declare class AsksuiteCitrusModule {
|
40
44
|
static ɵfac: i0.ɵɵFactoryDeclaration<AsksuiteCitrusModule, never>;
|
41
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<AsksuiteCitrusModule, [typeof i1.ButtonComponent, typeof i2.InputComponent, typeof i3.SelectComponent, typeof i4.BoxComponent, typeof i5.AvatarComponent, typeof i6.DropdownContainerComponent, typeof i7.AskDropdownDirective, typeof i8.AutocompleteComponent, typeof i9.ChipsComponent, typeof i10.CheckboxComponent, typeof i11.DatePickerComponent, typeof i12.DatePickerCalendarComponent, typeof i13.SkeletonComponent, typeof i14.SpinnerComponent, typeof i15.SpinnerDirective, typeof i16.BadgeDirective, typeof i17.AutofocusDirective, typeof i18.ScrollDirective, typeof i19.AskTooltipDirective, typeof i20.ToastComponent, typeof i21.AskButtonDirective, typeof i22.ModalComponent, typeof i23.ModalBodyDirective, typeof i24.ModalHeaderDirective, typeof i25.ModalFooterDirective, typeof i26.CharacterCounterComponent, typeof i27.AccordionComponent, typeof i28.ExtendablePanelComponent, typeof i29.TableComponent, typeof i30.PaginationComponent, typeof i31.PaginatePipe], [typeof
|
45
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<AsksuiteCitrusModule, [typeof i1.ButtonComponent, typeof i2.InputComponent, typeof i3.SelectComponent, typeof i4.BoxComponent, typeof i5.AvatarComponent, typeof i6.DropdownContainerComponent, typeof i7.AskDropdownDirective, typeof i8.AutocompleteComponent, typeof i9.ChipsComponent, typeof i10.CheckboxComponent, typeof i11.DatePickerComponent, typeof i12.DatePickerCalendarComponent, typeof i13.SkeletonComponent, typeof i14.SpinnerComponent, typeof i15.SpinnerDirective, typeof i16.BadgeDirective, typeof i17.AutofocusDirective, typeof i18.ScrollDirective, typeof i19.AskTooltipDirective, typeof i20.ToastComponent, typeof i21.AskButtonDirective, typeof i22.ModalComponent, typeof i23.ModalBodyDirective, typeof i24.ModalHeaderDirective, typeof i25.ModalFooterDirective, typeof i26.CharacterCounterComponent, typeof i27.AccordionComponent, typeof i28.ExtendablePanelComponent, typeof i29.TableComponent, typeof i30.PaginationComponent, typeof i31.PaginatePipe, typeof i32.RichtextToolboxDirective, typeof i33.RichtextUrlPromptComponent, typeof i34.RichtextToolboxCoreComponent, typeof i35.AskTextButtonDirective], [typeof i36.CommonModule, typeof i37.FormsModule, typeof i37.ReactiveFormsModule, typeof i38.CdkOverlayOrigin, typeof i38.CdkConnectedOverlay, typeof i38.OverlayModule, typeof i39.TranslateModule, typeof i40.NgxSkeletonLoaderModule, typeof i41.MatTooltipModule], [typeof i1.ButtonComponent, typeof i2.InputComponent, typeof i3.SelectComponent, typeof i4.BoxComponent, typeof i5.AvatarComponent, typeof i6.DropdownContainerComponent, typeof i7.AskDropdownDirective, typeof i8.AutocompleteComponent, typeof i9.ChipsComponent, typeof i10.CheckboxComponent, typeof i11.DatePickerComponent, typeof i12.DatePickerCalendarComponent, typeof i13.SkeletonComponent, typeof i15.SpinnerDirective, typeof i16.BadgeDirective, typeof i17.AutofocusDirective, typeof i18.ScrollDirective, typeof i19.AskTooltipDirective, typeof i21.AskButtonDirective, typeof i35.AskTextButtonDirective, typeof i23.ModalBodyDirective, typeof i24.ModalHeaderDirective, typeof i25.ModalFooterDirective, typeof i26.CharacterCounterComponent, typeof i27.AccordionComponent, typeof i28.ExtendablePanelComponent, typeof i29.TableComponent, typeof i30.PaginationComponent, typeof i31.PaginatePipe, typeof i32.RichtextToolboxDirective]>;
|
42
46
|
static ɵinj: i0.ɵɵInjectorDeclaration<AsksuiteCitrusModule>;
|
43
47
|
}
|
@@ -0,0 +1,52 @@
|
|
1
|
+
import { ChangeDetectorRef, ElementRef, NgZone } from '@angular/core';
|
2
|
+
import { RichTextFunctions, ToolKeys, ToolsState } from '../interfaces/richtext-toolbox.interface';
|
3
|
+
import { QuillBuilderService } from '../services/quill-builder.service';
|
4
|
+
export declare class RichtextWrapper implements RichTextFunctions {
|
5
|
+
private ngZone;
|
6
|
+
private cd;
|
7
|
+
private quillBuilder;
|
8
|
+
private elementRef;
|
9
|
+
private quill;
|
10
|
+
private stateSub;
|
11
|
+
private esc$;
|
12
|
+
private enter$;
|
13
|
+
private maxLength;
|
14
|
+
private breakOnEnter;
|
15
|
+
private textChangeHandler;
|
16
|
+
private selectionChangeHandler;
|
17
|
+
private bindings;
|
18
|
+
private maxLengthSubscription?;
|
19
|
+
get state(): ToolsState;
|
20
|
+
state$: import("rxjs").Observable<ToolsState>;
|
21
|
+
get listenTextChanges$(): import("rxjs").Observable<string>;
|
22
|
+
get listenOnTouched$(): import("rxjs").Observable<boolean>;
|
23
|
+
get listenEscape$(): import("rxjs").Observable<boolean>;
|
24
|
+
get listenEnter$(): import("rxjs").Observable<boolean>;
|
25
|
+
constructor(ngZone: NgZone, cd: ChangeDetectorRef, quillBuilder: QuillBuilderService, elementRef: ElementRef<HTMLElement>);
|
26
|
+
setItalic(): void;
|
27
|
+
setBold(): void;
|
28
|
+
setUnderline(): void;
|
29
|
+
setStrike(): void;
|
30
|
+
setListNumbered(): void;
|
31
|
+
setListBulleted(): void;
|
32
|
+
setLink(link: string): void;
|
33
|
+
setJustifyLeft(): void;
|
34
|
+
setJustifyCenter(): void;
|
35
|
+
setJustifyRight(): void;
|
36
|
+
setRemove(): void;
|
37
|
+
setPlaceholder(placeholder: string): void;
|
38
|
+
setText(text: string): void;
|
39
|
+
setMaxLength(length: number): void;
|
40
|
+
setDisabledTools(tools: ToolKeys): void;
|
41
|
+
setEditorClass(className: string): void;
|
42
|
+
getEditorElement(): HTMLDivElement;
|
43
|
+
disable(): void;
|
44
|
+
enable(): void;
|
45
|
+
focus(): void;
|
46
|
+
setBreakOnEnter(breakOnEnter: boolean): void;
|
47
|
+
destroy(): void;
|
48
|
+
private isToolDisabled;
|
49
|
+
private urlMatcher;
|
50
|
+
private listenEditorChanges;
|
51
|
+
private update;
|
52
|
+
}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import { Injector } from "@angular/core";
|
2
|
+
import { Toolbox } from "./toolbox";
|
3
|
+
import { ToolsState } from "../interfaces/richtext-toolbox.interface";
|
4
|
+
export declare class BubbleStrategy extends Toolbox {
|
5
|
+
private clickListener?;
|
6
|
+
constructor(injector: Injector);
|
7
|
+
private move;
|
8
|
+
private listenOutsideClicks;
|
9
|
+
onToolsChanged(state: ToolsState): void;
|
10
|
+
displayComponent(): void;
|
11
|
+
destroyAll(): void;
|
12
|
+
}
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import { Injector } from "@angular/core";
|
2
|
+
import { Toolbox } from "./toolbox";
|
3
|
+
import { ToolbarItem, ToolsState } from "../interfaces/richtext-toolbox.interface";
|
4
|
+
export declare class TopbarStrategy extends Toolbox {
|
5
|
+
constructor(injector: Injector);
|
6
|
+
displayComponent(): void;
|
7
|
+
prepareUpdatedTools(toolState: ToolsState): ToolbarItem[];
|
8
|
+
}
|
@@ -0,0 +1,31 @@
|
|
1
|
+
import { ChangeDetectorRef, ComponentRef, ElementRef, Injector, NgZone, Renderer2, ViewContainerRef } from '@angular/core';
|
2
|
+
import { RichtextWrapper } from './richtext-wrapper';
|
3
|
+
import { ToolbarItem, ToolboxInput, ToolsState } from '../interfaces/richtext-toolbox.interface';
|
4
|
+
import { RichtextToolboxCoreComponent } from '../components/richtext-toolbox-core/richtext-toolbox-core.component';
|
5
|
+
export declare abstract class Toolbox {
|
6
|
+
readonly richtextWrapper: RichtextWrapper;
|
7
|
+
protected hostEl: ElementRef<HTMLElement>;
|
8
|
+
protected viewContainerRef: ViewContainerRef;
|
9
|
+
protected renderer2: Renderer2;
|
10
|
+
protected ngZone: NgZone;
|
11
|
+
protected cd: ChangeDetectorRef;
|
12
|
+
protected componentRef?: ComponentRef<RichtextToolboxCoreComponent>;
|
13
|
+
protected get component(): RichtextToolboxCoreComponent | undefined;
|
14
|
+
protected get componentEl(): HTMLElement | undefined;
|
15
|
+
private parentEl?;
|
16
|
+
private toolboxInput?;
|
17
|
+
private _subscription?;
|
18
|
+
constructor(injector: Injector);
|
19
|
+
destroyAll(): void;
|
20
|
+
toggleInputDisplay(display: boolean): void;
|
21
|
+
setToolInput(toolInput: ToolboxInput): void;
|
22
|
+
private isInputVisible;
|
23
|
+
private getDisabledTools;
|
24
|
+
private listenRichtextState;
|
25
|
+
private getDefaultTools;
|
26
|
+
protected onToolsChanged(toolsState: ToolsState): void;
|
27
|
+
protected isVisible(): boolean;
|
28
|
+
protected destroyComponent(): void;
|
29
|
+
protected displayComponent(): void;
|
30
|
+
protected prepareUpdatedTools(toolState: ToolsState): ToolbarItem[];
|
31
|
+
}
|
@@ -0,0 +1,25 @@
|
|
1
|
+
import { EventEmitter, QueryList, SimpleChanges } from '@angular/core';
|
2
|
+
import { ToolbarItem } from '../../interfaces/richtext-toolbox.interface';
|
3
|
+
import { AskDropdownDirective } from '../../directives';
|
4
|
+
import * as i0 from "@angular/core";
|
5
|
+
export declare class RichtextToolboxCoreComponent {
|
6
|
+
dropdowns?: QueryList<AskDropdownDirective>;
|
7
|
+
close: EventEmitter<void>;
|
8
|
+
tool: EventEmitter<ToolbarItem>;
|
9
|
+
get toolbarItems(): ToolbarItem[];
|
10
|
+
set toolbarItems(value: ToolbarItem[]);
|
11
|
+
type: 'topbar' | 'bubble';
|
12
|
+
class: 'top-toolbox' | 'bubble-toolbox' | string;
|
13
|
+
private _toolbarItems;
|
14
|
+
private urlIdx;
|
15
|
+
protected isUrlMode: boolean;
|
16
|
+
get linkTool(): ToolbarItem | undefined;
|
17
|
+
get urlDropdownRef(): AskDropdownDirective | undefined;
|
18
|
+
ngOnChanges(sp: SimpleChanges): void;
|
19
|
+
onTool(toolbarItem: ToolbarItem): void;
|
20
|
+
onUrl(link: string): void;
|
21
|
+
trackByToolFn(index: number, item: ToolbarItem): import("../../interfaces/richtext-toolbox.interface").Tool;
|
22
|
+
protected closeUrlInput(): void;
|
23
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RichtextToolboxCoreComponent, never>;
|
24
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<RichtextToolboxCoreComponent, "ask-richtext-toolbox-core", never, { "toolbarItems": { "alias": "toolbarItems"; "required": false; }; "type": { "alias": "type"; "required": false; }; "class": { "alias": "class"; "required": false; }; }, { "close": "close"; "tool": "tool"; }, never, never, false, never>;
|
25
|
+
}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
import { DestroyRef, ElementRef, EventEmitter } from '@angular/core';
|
2
|
+
import { FormControl } from '@angular/forms';
|
3
|
+
import { RichtextUrlPromptStateService } from './richtext-url-prompt-state.service';
|
4
|
+
import * as i0 from "@angular/core";
|
5
|
+
export declare class RichtextUrlPromptComponent {
|
6
|
+
private destroyRef;
|
7
|
+
private state;
|
8
|
+
inputEl?: ElementRef<HTMLInputElement>;
|
9
|
+
isPreset: boolean;
|
10
|
+
set _url(url: string);
|
11
|
+
url: EventEmitter<string>;
|
12
|
+
formControl: FormControl<string>;
|
13
|
+
get isValid(): boolean;
|
14
|
+
constructor(destroyRef: DestroyRef, state: RichtextUrlPromptStateService);
|
15
|
+
onSubmit(event: Event): void;
|
16
|
+
ngAfterViewInit(): void;
|
17
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RichtextUrlPromptComponent, never>;
|
18
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<RichtextUrlPromptComponent, "ask-richtext-url-prompt", never, { "_url": { "alias": "url"; "required": false; }; }, { "url": "url"; }, never, never, false, never>;
|
19
|
+
}
|
@@ -1,4 +1,3 @@
|
|
1
|
-
/// <reference types="node" />
|
2
1
|
import { OnDestroy, OnInit } from '@angular/core';
|
3
2
|
import { ToastConfig, ToastData, ToastType } from '../../services/toast/toast.config';
|
4
3
|
import { ToastRef } from "../../services/toast/toast-ref";
|
@@ -8,7 +7,7 @@ export declare class ToastComponent implements OnInit, OnDestroy {
|
|
8
7
|
private ref;
|
9
8
|
message: string;
|
10
9
|
icon: string;
|
11
|
-
timeoutRef:
|
10
|
+
timeoutRef: number;
|
12
11
|
config: ToastConfig;
|
13
12
|
color: string;
|
14
13
|
fontColor: string;
|
@@ -0,0 +1,4 @@
|
|
1
|
+
import { RichTextFunctionsKeys, Tool, ToolKeys } from "../interfaces/richtext-toolbox.interface";
|
2
|
+
export declare const TOOL_FUNCTION_MAP: Record<Tool, RichTextFunctionsKeys>;
|
3
|
+
export declare const TOOL_ICON_MAP: Record<Tool, string>;
|
4
|
+
export declare const ALL_TOOLS: ToolKeys;
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare const URL_REGEX: RegExp;
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import { ElementRef } from "@angular/core";
|
2
|
+
import * as i0 from "@angular/core";
|
3
|
+
export declare abstract class AskBaseButtonDirective {
|
4
|
+
private el;
|
5
|
+
color: 'primary' | 'secondary' | '';
|
6
|
+
protected constructor(el: ElementRef);
|
7
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AskBaseButtonDirective, never>;
|
8
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<AskBaseButtonDirective, never, never, { "color": { "alias": "color"; "required": false; }; }, {}, never, never, false, never>;
|
9
|
+
}
|
@@ -1,9 +1,8 @@
|
|
1
1
|
import { ElementRef } from '@angular/core';
|
2
|
+
import { AskBaseButtonDirective } from "./ask-base-button.directive";
|
2
3
|
import * as i0 from "@angular/core";
|
3
|
-
export declare class AskButtonDirective {
|
4
|
-
private el;
|
5
|
-
set color(value: 'primary' | 'secondary' | '');
|
4
|
+
export declare class AskButtonDirective extends AskBaseButtonDirective {
|
6
5
|
constructor(el: ElementRef);
|
7
6
|
static ɵfac: i0.ɵɵFactoryDeclaration<AskButtonDirective, never>;
|
8
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<AskButtonDirective, "[askButton]", never, {
|
7
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<AskButtonDirective, "button[askButton]", never, {}, {}, never, never, false, never>;
|
9
8
|
}
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import { ElementRef } from '@angular/core';
|
2
|
+
import { AskBaseButtonDirective } from "./ask-base-button.directive";
|
3
|
+
import * as i0 from "@angular/core";
|
4
|
+
export declare class AskTextButtonDirective extends AskBaseButtonDirective {
|
5
|
+
constructor(el: ElementRef);
|
6
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AskTextButtonDirective, never>;
|
7
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<AskTextButtonDirective, "[askTextButton]", never, {}, {}, never, never, false, never>;
|
8
|
+
}
|
@@ -1,7 +1,8 @@
|
|
1
1
|
export * from './badge/badge.directive';
|
2
2
|
export * from './scroll/scroll.directive';
|
3
|
-
export * from './button
|
3
|
+
export * from './button';
|
4
4
|
export * from './tooltip/ask-tooltip.directive';
|
5
5
|
export * from './spinner/spinner.directive';
|
6
6
|
export * from './ask-dropdown.directive';
|
7
7
|
export * from './autofocus/autofocus.directive';
|
8
|
+
export * from './richtext-toolbox/richtext-toolbox.directive';
|
@@ -0,0 +1,40 @@
|
|
1
|
+
import { EventEmitter, Injector, OnChanges, SimpleChanges } from '@angular/core';
|
2
|
+
import { ToolKeys, ToolLayout, ToolsState } from '../../interfaces/richtext-toolbox.interface';
|
3
|
+
import { ControlValueAccessor } from '@angular/forms';
|
4
|
+
import * as i0 from "@angular/core";
|
5
|
+
export declare class RichtextToolboxDirective implements OnChanges, ControlValueAccessor {
|
6
|
+
private injector;
|
7
|
+
private toolbox?;
|
8
|
+
private onChange;
|
9
|
+
private onTouched;
|
10
|
+
private subscription?;
|
11
|
+
private text;
|
12
|
+
rtPlaceholder: string;
|
13
|
+
rtTools: ToolKeys;
|
14
|
+
rtDisabledTools: ToolKeys;
|
15
|
+
rtType: ToolLayout;
|
16
|
+
rtToolbarOnly: boolean;
|
17
|
+
maxlength: number;
|
18
|
+
rtToolbarClass: string;
|
19
|
+
rtEditorClass: string;
|
20
|
+
rtBreakOnEnter: boolean;
|
21
|
+
inputChange: EventEmitter<string>;
|
22
|
+
inputEnter: EventEmitter<any>;
|
23
|
+
inputEscape: EventEmitter<any>;
|
24
|
+
toolChange: EventEmitter<ToolsState>;
|
25
|
+
constructor(injector: Injector);
|
26
|
+
ngOnChanges(sp: SimpleChanges): void;
|
27
|
+
ngOnDestroy(): void;
|
28
|
+
focus(): void;
|
29
|
+
writeValue(text: string): void;
|
30
|
+
registerOnChange(fn: any): void;
|
31
|
+
registerOnTouched(fn: any): void;
|
32
|
+
setDisabledState(isDisabled: boolean): void;
|
33
|
+
private prepareToolbar;
|
34
|
+
private prepareListeners;
|
35
|
+
private update;
|
36
|
+
private destroyAll;
|
37
|
+
private generateToolboxLayout;
|
38
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RichtextToolboxDirective, never>;
|
39
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<RichtextToolboxDirective, "[askRichtextToolbox]", never, { "rtPlaceholder": { "alias": "rtPlaceholder"; "required": false; }; "rtTools": { "alias": "rtTools"; "required": false; }; "rtDisabledTools": { "alias": "rtDisabledTools"; "required": false; }; "rtType": { "alias": "rtType"; "required": false; }; "rtToolbarOnly": { "alias": "rtToolbarOnly"; "required": false; }; "maxlength": { "alias": "maxlength"; "required": false; }; "rtToolbarClass": { "alias": "rtToolbarClass"; "required": false; }; "rtEditorClass": { "alias": "rtEditorClass"; "required": false; }; "rtBreakOnEnter": { "alias": "rtBreakOnEnter"; "required": false; }; }, { "inputChange": "inputChange"; "inputEnter": "inputEnter"; "inputEscape": "inputEscape"; "toolChange": "toolChange"; }, never, never, false, never>;
|
40
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare function areObjectsEqual(obj1: Record<string, any>, obj2: Record<string, any>): boolean;
|
@@ -0,0 +1,54 @@
|
|
1
|
+
import { BoundsStatic } from 'quill';
|
2
|
+
export interface RichtextFormats {
|
3
|
+
italic: boolean;
|
4
|
+
bold: boolean;
|
5
|
+
underline: boolean;
|
6
|
+
strike: boolean;
|
7
|
+
link: string;
|
8
|
+
list_bulleted: boolean;
|
9
|
+
list_numbered: boolean;
|
10
|
+
justify_left: boolean;
|
11
|
+
justify_center: boolean;
|
12
|
+
justify_right: boolean;
|
13
|
+
}
|
14
|
+
export interface ToolsState {
|
15
|
+
hasSelection: boolean;
|
16
|
+
hasFocus: boolean;
|
17
|
+
disabledTools: ToolKeys;
|
18
|
+
formats: RichtextFormats;
|
19
|
+
bounds?: BoundsStatic;
|
20
|
+
}
|
21
|
+
type FunctionKeys<T> = {
|
22
|
+
[K in keyof T]: T[K] extends (...args: any[]) => any ? K : never;
|
23
|
+
}[keyof T];
|
24
|
+
export interface RichTextFunctions {
|
25
|
+
setItalic(): void;
|
26
|
+
setBold(): void;
|
27
|
+
setUnderline(): void;
|
28
|
+
setStrike(): void;
|
29
|
+
setListNumbered(): void;
|
30
|
+
setListBulleted(): void;
|
31
|
+
setLink(link: string): void;
|
32
|
+
setJustifyLeft(): void;
|
33
|
+
setJustifyCenter(): void;
|
34
|
+
setJustifyRight(): void;
|
35
|
+
setRemove(): void;
|
36
|
+
}
|
37
|
+
export type RichTextFunctionsKeys = FunctionKeys<RichTextFunctions>;
|
38
|
+
export type ToolbarItem = {
|
39
|
+
tool: Tool;
|
40
|
+
selected: boolean;
|
41
|
+
disabled: boolean;
|
42
|
+
icon: string;
|
43
|
+
toolFunctionName: RichTextFunctionsKeys;
|
44
|
+
value?: string;
|
45
|
+
};
|
46
|
+
export type Tool = 'bold' | 'italic' | 'underline' | 'strike' | 'list_numbered' | 'list_bulleted' | 'link' | 'justify_left' | 'justify_center' | 'justify_right' | 'clear';
|
47
|
+
export type ToolKeys = Tool[];
|
48
|
+
export type ToolLayout = 'bubble' | 'topbar';
|
49
|
+
export interface ToolboxInput {
|
50
|
+
availableTools: ToolKeys;
|
51
|
+
disabledTools: ToolKeys;
|
52
|
+
class: string;
|
53
|
+
}
|
54
|
+
export {};
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import Quill from 'quill';
|
2
|
+
import * as i0 from "@angular/core";
|
3
|
+
export declare class QuillBuilderService {
|
4
|
+
constructor();
|
5
|
+
getQuill(): typeof Quill;
|
6
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<QuillBuilderService, never>;
|
7
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<QuillBuilderService>;
|
8
|
+
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "asksuite-citrus",
|
3
|
-
"version": "1.7.
|
3
|
+
"version": "1.7.7",
|
4
4
|
"peerDependencies": {
|
5
5
|
"@angular/common": "^16.1.0",
|
6
6
|
"@angular/core": "^16.1.0",
|
@@ -8,7 +8,8 @@
|
|
8
8
|
"@ngx-translate/core": "^15.0.0",
|
9
9
|
"@ngx-translate/http-loader": "^8.0.0",
|
10
10
|
"moment": "^2.29.4",
|
11
|
-
"ngx-skeleton-loader": "^8.0.0"
|
11
|
+
"ngx-skeleton-loader": "^8.0.0",
|
12
|
+
"quill": "^1.3.7"
|
12
13
|
},
|
13
14
|
"dependencies": {
|
14
15
|
"tslib": "^2.3.0"
|
package/public-api.d.ts
CHANGED
@@ -0,0 +1,45 @@
|
|
1
|
+
@mixin remove-button-layout {
|
2
|
+
background: none;
|
3
|
+
color: inherit;
|
4
|
+
border: none;
|
5
|
+
padding: 0;
|
6
|
+
margin: 0;
|
7
|
+
font: inherit;
|
8
|
+
cursor: pointer;
|
9
|
+
outline: inherit;
|
10
|
+
line-height: 0;
|
11
|
+
}
|
12
|
+
|
13
|
+
@mixin remove-input-layout {
|
14
|
+
border: none;
|
15
|
+
outline: none;
|
16
|
+
background-color: transparent;
|
17
|
+
}
|
18
|
+
|
19
|
+
@mixin default-input() {
|
20
|
+
position: relative;
|
21
|
+
display: flex;
|
22
|
+
align-items: center;
|
23
|
+
border-radius: $radii-xs;
|
24
|
+
border: 1px solid $grey-200;
|
25
|
+
padding: 16px;
|
26
|
+
outline: none;
|
27
|
+
gap: 8px;
|
28
|
+
line-height: 14px;
|
29
|
+
color: $grey-700;
|
30
|
+
height: 48px;
|
31
|
+
font-size: $font-sm;
|
32
|
+
font-weight: $font-weight-regular;
|
33
|
+
transition: border 0.2s;
|
34
|
+
|
35
|
+
&:focus {
|
36
|
+
border-color: $asksuite-orange;
|
37
|
+
}
|
38
|
+
|
39
|
+
.material-icons {
|
40
|
+
display: flex;
|
41
|
+
align-items: center;
|
42
|
+
justify-content: center;
|
43
|
+
height: 14px;
|
44
|
+
}
|
45
|
+
}
|
package/styles/button.scss
CHANGED
@@ -38,5 +38,34 @@
|
|
38
38
|
background: $asksuite-orange;
|
39
39
|
color: white;
|
40
40
|
}
|
41
|
+
}
|
41
42
|
|
43
|
+
.ask-text-button {
|
44
|
+
padding: 8px 16px;
|
45
|
+
border: none;
|
46
|
+
border-radius: $radii-xs;
|
47
|
+
outline: none;
|
48
|
+
background: none;
|
49
|
+
color: var(--asksuite-orange);
|
50
|
+
font-size: $font-md;
|
51
|
+
font-weight: $font-weight-medium;
|
52
|
+
cursor: pointer;
|
53
|
+
transition: all .3ms;
|
54
|
+
|
55
|
+
&:hover {
|
56
|
+
text-decoration: none;
|
57
|
+
background: $grey-50;
|
58
|
+
}
|
59
|
+
&:disabled {
|
60
|
+
cursor: not-allowed;
|
61
|
+
color: $grey-300;
|
62
|
+
}
|
63
|
+
|
64
|
+
&.-primary {
|
65
|
+
color: white;
|
66
|
+
}
|
67
|
+
|
68
|
+
&.-secondary {
|
69
|
+
color: $grey-500;
|
70
|
+
}
|
42
71
|
}
|
package/styles/font-weights.scss
CHANGED
@@ -0,0 +1,18 @@
|
|
1
|
+
@import url("https://cdn.quilljs.com/1.0.0/quill.core.css");
|
2
|
+
|
3
|
+
.ql-editor {
|
4
|
+
padding: 14px 16px;
|
5
|
+
font-size: 0.875rem;
|
6
|
+
word-break: break-word;
|
7
|
+
}
|
8
|
+
|
9
|
+
.bubble-toolbox {
|
10
|
+
position: absolute;
|
11
|
+
background-color: var(--grey-800);
|
12
|
+
border-radius: 8px;
|
13
|
+
z-index: 999;
|
14
|
+
}
|
15
|
+
|
16
|
+
.top-toolbox {
|
17
|
+
background-color: var(--grey-100);
|
18
|
+
}
|
package/styles/styles.scss
CHANGED
@@ -5,36 +5,8 @@
|
|
5
5
|
|
6
6
|
@import './button';
|
7
7
|
@import './modal';
|
8
|
-
|
9
|
-
|
10
|
-
*/
|
11
|
-
@mixin default-input() {
|
12
|
-
position: relative;
|
13
|
-
display: flex;
|
14
|
-
align-items: center;
|
15
|
-
border-radius: $radii-xs;
|
16
|
-
border: 1px solid $grey-200;
|
17
|
-
padding: 16px;
|
18
|
-
outline: none;
|
19
|
-
gap: 8px;
|
20
|
-
line-height: 14px;
|
21
|
-
color: $grey-700;
|
22
|
-
height: 48px;
|
23
|
-
font-size: $font-sm;
|
24
|
-
font-weight: $font-weight-regular;
|
25
|
-
transition: border .2s;
|
26
|
-
|
27
|
-
&:focus {
|
28
|
-
border-color: $asksuite-orange;
|
29
|
-
}
|
30
|
-
|
31
|
-
.material-icons {
|
32
|
-
display: flex;
|
33
|
-
align-items: center;
|
34
|
-
justify-content: center;
|
35
|
-
height: 14px;
|
36
|
-
}
|
37
|
-
}
|
8
|
+
@import './ask-mixins';
|
9
|
+
@import './quill';
|
38
10
|
|
39
11
|
/*
|
40
12
|
* Material Icons
|