asksuite-citrus 2.0.3 → 2.0.4-beta.2
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/esm2022/lib/asksuite-citrus.module.mjs +4 -1
- package/esm2022/lib/classes/richtext-wrapper.mjs +55 -4
- package/esm2022/lib/components/richtext-toolbox/richtext-toolbox.component.mjs +3 -3
- package/esm2022/lib/components/richtext-url-prompt/richtext-url-prompt.component.mjs +3 -3
- package/esm2022/lib/directives/richtext-toolbox/richtext-toolbox.directive.mjs +23 -2
- package/esm2022/lib/helpers/html-panel-quill-blot.helper.mjs +21 -0
- package/fesm2022/asksuite-citrus.mjs +101 -8
- package/fesm2022/asksuite-citrus.mjs.map +1 -1
- package/lib/classes/richtext-wrapper.d.ts +11 -2
- package/lib/directives/richtext-toolbox/richtext-toolbox.directive.d.ts +11 -1
- package/lib/helpers/html-panel-quill-blot.helper.d.ts +9 -0
- package/package.json +1 -1
@@ -1,21 +1,23 @@
|
|
1
1
|
import { ChangeDetectorRef, ElementRef, NgZone } from '@angular/core';
|
2
|
-
import Quill from 'quill';
|
2
|
+
import Quill, { RangeStatic } from 'quill';
|
3
3
|
import { RichTextFunctions, ToolKeys, ToolsState } from '../interfaces/richtext-toolbox.interface';
|
4
4
|
export declare class RichtextWrapper implements RichTextFunctions {
|
5
5
|
private ngZone;
|
6
6
|
private cd;
|
7
7
|
private elementRef;
|
8
8
|
private quill;
|
9
|
+
private maxLengthSubscription?;
|
10
|
+
private templateReplacerSubscription?;
|
9
11
|
private stateSub;
|
10
12
|
private esc$;
|
11
13
|
private enter$;
|
12
14
|
private maxLength;
|
13
15
|
private breakOnEnter;
|
16
|
+
private allowImages;
|
14
17
|
private quillFormats;
|
15
18
|
private textChangeHandler;
|
16
19
|
private selectionChangeHandler;
|
17
20
|
private bindings;
|
18
|
-
private maxLengthSubscription?;
|
19
21
|
get state(): ToolsState;
|
20
22
|
state$: import("rxjs").Observable<ToolsState>;
|
21
23
|
get listenTextChanges$(): import("rxjs").Observable<string>;
|
@@ -36,6 +38,9 @@ export declare class RichtextWrapper implements RichTextFunctions {
|
|
36
38
|
setRemove(): void;
|
37
39
|
setPlaceholder(placeholder: string): void;
|
38
40
|
setText(text: string): void;
|
41
|
+
getTextWithoutHtmlTags(): string;
|
42
|
+
insertText(index: number, text: string, emitEvent: boolean): void;
|
43
|
+
setShortcutTemplate(key: string, template: string): void;
|
39
44
|
setMaxLength(length: number): void;
|
40
45
|
setDisabledTools(tools: ToolKeys): void;
|
41
46
|
setEditorClass(className: string): void;
|
@@ -45,9 +50,13 @@ export declare class RichtextWrapper implements RichTextFunctions {
|
|
45
50
|
enable(): void;
|
46
51
|
focus(): void;
|
47
52
|
setBreakOnEnter(breakOnEnter: boolean): void;
|
53
|
+
setAllowImages(allowImages: boolean): void;
|
54
|
+
getCurrentCursorPosition(): RangeStatic | null;
|
48
55
|
destroy(): void;
|
49
56
|
private isToolDisabled;
|
50
57
|
private urlMatcher;
|
58
|
+
private imageMatcher;
|
59
|
+
private htmlPanelMatcher;
|
51
60
|
private listenEditorChanges;
|
52
61
|
private update;
|
53
62
|
}
|
@@ -2,6 +2,10 @@ import { EventEmitter, Injector, OnChanges, SimpleChanges } from '@angular/core'
|
|
2
2
|
import { ToolKeys, ToolLayout, ToolsState } from '../../interfaces/richtext-toolbox.interface';
|
3
3
|
import { ControlValueAccessor } from '@angular/forms';
|
4
4
|
import * as i0 from "@angular/core";
|
5
|
+
type ShortcutTemplate = {
|
6
|
+
key: string;
|
7
|
+
template: string;
|
8
|
+
};
|
5
9
|
export declare class RichtextToolboxDirective implements OnChanges, ControlValueAccessor {
|
6
10
|
private injector;
|
7
11
|
private toolbox?;
|
@@ -17,6 +21,8 @@ export declare class RichtextToolboxDirective implements OnChanges, ControlValue
|
|
17
21
|
rtToolbarClass: string;
|
18
22
|
rtEditorClass: string;
|
19
23
|
rtBreakOnEnter: boolean;
|
24
|
+
rtAllowImages: boolean;
|
25
|
+
rtShortcutTemplate?: ShortcutTemplate;
|
20
26
|
inputChange: EventEmitter<string>;
|
21
27
|
inputEnter: EventEmitter<any>;
|
22
28
|
inputEscape: EventEmitter<any>;
|
@@ -31,6 +37,9 @@ export declare class RichtextToolboxDirective implements OnChanges, ControlValue
|
|
31
37
|
registerOnChange(fn: any): void;
|
32
38
|
registerOnTouched(fn: any): void;
|
33
39
|
setDisabledState(isDisabled: boolean): void;
|
40
|
+
getCurrentCursorPosition(): import("quill").RangeStatic | null | undefined;
|
41
|
+
getTextWithoutHtmlTags(): string;
|
42
|
+
insertText(index: number, text: string, emitEvent?: boolean): void;
|
34
43
|
private prepareToolbar;
|
35
44
|
private prepareListeners;
|
36
45
|
private update;
|
@@ -38,5 +47,6 @@ export declare class RichtextToolboxDirective implements OnChanges, ControlValue
|
|
38
47
|
private generateToolboxLayout;
|
39
48
|
private getToolbox;
|
40
49
|
static ɵfac: i0.ɵɵFactoryDeclaration<RichtextToolboxDirective, never>;
|
41
|
-
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; }; "rtMaxlength": { "alias": "rtMaxlength"; "required": false; }; "rtToolbarClass": { "alias": "rtToolbarClass"; "required": false; }; "rtEditorClass": { "alias": "rtEditorClass"; "required": false; }; "rtBreakOnEnter": { "alias": "rtBreakOnEnter"; "required": false; }; }, { "inputChange": "inputChange"; "inputEnter": "inputEnter"; "inputEscape": "inputEscape"; "inputFocus": "inputFocus"; "toolChange": "toolChange"; }, never, never, false, never>;
|
50
|
+
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; }; "rtMaxlength": { "alias": "rtMaxlength"; "required": false; }; "rtToolbarClass": { "alias": "rtToolbarClass"; "required": false; }; "rtEditorClass": { "alias": "rtEditorClass"; "required": false; }; "rtBreakOnEnter": { "alias": "rtBreakOnEnter"; "required": false; }; "rtAllowImages": { "alias": "rtAllowImages"; "required": false; }; "rtShortcutTemplate": { "alias": "rtShortcutTemplate"; "required": false; }; }, { "inputChange": "inputChange"; "inputEnter": "inputEnter"; "inputEscape": "inputEscape"; "inputFocus": "inputFocus"; "toolChange": "toolChange"; }, never, never, false, never>;
|
42
51
|
}
|
52
|
+
export {};
|
@@ -0,0 +1,9 @@
|
|
1
|
+
declare let BlockEmbed: any;
|
2
|
+
export declare class HTMLPanelQuillBlot extends BlockEmbed {
|
3
|
+
static blotName: string;
|
4
|
+
static tagName: string;
|
5
|
+
static className: string;
|
6
|
+
static create(html: string): HTMLElement;
|
7
|
+
static value(domNode: HTMLElement): string;
|
8
|
+
}
|
9
|
+
export {};
|