@acorex/cdk 22.4.7 → 22.4.9
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/fesm2022/acorex-cdk-overlay-scrollbar.mjs +808 -0
- package/fesm2022/acorex-cdk-overlay-scrollbar.mjs.map +1 -0
- package/fesm2022/acorex-cdk-text-editor.mjs +942 -0
- package/fesm2022/acorex-cdk-text-editor.mjs.map +1 -0
- package/fesm2022/acorex-cdk-wysiwyg.mjs +2 -2
- package/fesm2022/acorex-cdk-wysiwyg.mjs.map +1 -1
- package/overlay-scrollbar/README.md +27 -0
- package/package.json +12 -2
- package/text-editor/README.md +5 -0
- package/types/acorex-cdk-overlay-scrollbar.d.ts +86 -0
- package/types/acorex-cdk-text-editor.d.ts +156 -0
- package/types/acorex-cdk-wysiwyg.d.ts +1 -1
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
import * as _tiptap_core from '@tiptap/core';
|
|
3
|
+
import { Content, Extensions, Editor, JSONContent } from '@tiptap/core';
|
|
4
|
+
|
|
5
|
+
type AXTextEditorTiptapEditor = Editor;
|
|
6
|
+
type AXTextEditorTiptapContent = Content;
|
|
7
|
+
type AXTextEditorTiptapJSON = JSONContent;
|
|
8
|
+
type AXTextEditorTiptapChain = ReturnType<Editor['chain']>;
|
|
9
|
+
type AXTextEditorHeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;
|
|
10
|
+
type AXTextEditorTextAlign = 'left' | 'center' | 'right' | 'justify';
|
|
11
|
+
type AXTextEditorTextDirection = 'rtl' | 'ltr';
|
|
12
|
+
type AXTextEditorFontSizeToken = 'small' | 'large' | 'huge';
|
|
13
|
+
declare const AX_TEXT_EDITOR_FONT_SIZE_TOKEN_VALUES: Record<AXTextEditorFontSizeToken, string>;
|
|
14
|
+
type AXTextEditorCommandAttrs = Record<string, unknown>;
|
|
15
|
+
declare const AX_TEXT_EDITOR_ZOOM_PRESETS: readonly [40, 50, 75, 90, 100, 125, 150, 175, 200];
|
|
16
|
+
declare const AX_TEXT_EDITOR_ZOOM_MIN = 40;
|
|
17
|
+
declare const AX_TEXT_EDITOR_ZOOM_MAX = 200;
|
|
18
|
+
declare const AX_TEXT_EDITOR_FONT_SIZES: readonly [8, 9, 10, 11, 12, 14, 16, 18, 20, 24, 28, 32, 36, 48, 72];
|
|
19
|
+
type AXTextEditorFontSize = (typeof AX_TEXT_EDITOR_FONT_SIZES)[number];
|
|
20
|
+
declare const AX_TEXT_EDITOR_DEFAULT_TEXT_COLORS: string[];
|
|
21
|
+
declare const AX_TEXT_EDITOR_DEFAULT_BACKGROUND_COLORS: string[];
|
|
22
|
+
interface AXTextEditorRecentColor {
|
|
23
|
+
color: string;
|
|
24
|
+
kind: 'text' | 'background';
|
|
25
|
+
}
|
|
26
|
+
type AXTextEditorCommandType = 'undo' | 'redo' | 'bold' | 'italic' | 'underline' | 'strike' | 'heading' | 'paragraph' | 'align' | 'direction' | 'color' | 'highlight' | 'fontSize' | 'bulletList' | 'orderedList' | 'superscript' | 'subscript' | 'link' | 'unlink' | 'blockquote' | 'code' | 'codeBlock' | 'horizontalRule' | 'image' | 'video' | 'insertTable' | 'addColumnBefore' | 'addColumnAfter' | 'deleteColumn' | 'addRowBefore' | 'addRowAfter' | 'deleteRow' | 'toggleHeaderRow' | 'deleteTable';
|
|
27
|
+
interface AXTextEditorFeatures {
|
|
28
|
+
table?: boolean;
|
|
29
|
+
image?: boolean;
|
|
30
|
+
video?: boolean;
|
|
31
|
+
superscript?: boolean;
|
|
32
|
+
subscript?: boolean;
|
|
33
|
+
keepSelection?: boolean;
|
|
34
|
+
placeholder?: boolean;
|
|
35
|
+
}
|
|
36
|
+
declare const AX_DEFAULT_TEXT_EDITOR_FEATURES: AXTextEditorFeatures;
|
|
37
|
+
interface AXTextEditorLoadExtensionsOptions {
|
|
38
|
+
placeholder?: string | (() => string);
|
|
39
|
+
features?: AXTextEditorFeatures;
|
|
40
|
+
headingLevels?: AXTextEditorHeadingLevel[];
|
|
41
|
+
extensions?: Extensions;
|
|
42
|
+
}
|
|
43
|
+
interface AXTextEditorState {
|
|
44
|
+
bold: boolean;
|
|
45
|
+
italic: boolean;
|
|
46
|
+
underline: boolean;
|
|
47
|
+
strike: boolean;
|
|
48
|
+
code: boolean;
|
|
49
|
+
codeBlock: boolean;
|
|
50
|
+
headingLevel: AXTextEditorHeadingLevel | null;
|
|
51
|
+
bulletList: boolean;
|
|
52
|
+
orderedList: boolean;
|
|
53
|
+
blockquote: boolean;
|
|
54
|
+
superscript: boolean;
|
|
55
|
+
subscript: boolean;
|
|
56
|
+
textAlign: AXTextEditorTextAlign | null;
|
|
57
|
+
textColor: string | null;
|
|
58
|
+
highlightColor: string | null;
|
|
59
|
+
linkHref: string | null;
|
|
60
|
+
fontSize: string | null;
|
|
61
|
+
textDirection: AXTextEditorTextDirection | null;
|
|
62
|
+
table: boolean;
|
|
63
|
+
canUndo: boolean;
|
|
64
|
+
canRedo: boolean;
|
|
65
|
+
isEmpty: boolean;
|
|
66
|
+
isFocused: boolean;
|
|
67
|
+
}
|
|
68
|
+
declare const AX_EMPTY_TEXT_EDITOR_STATE: AXTextEditorState;
|
|
69
|
+
interface AXTextEditorInitOptions {
|
|
70
|
+
content?: AXTextEditorTiptapContent;
|
|
71
|
+
editable?: boolean;
|
|
72
|
+
placeholder?: string | (() => string);
|
|
73
|
+
features?: AXTextEditorFeatures;
|
|
74
|
+
headingLevels?: AXTextEditorHeadingLevel[];
|
|
75
|
+
extensions?: Extensions;
|
|
76
|
+
editorProps?: _tiptap_core.EditorOptions['editorProps'];
|
|
77
|
+
/** @deprecated Use `editable: false` instead. */
|
|
78
|
+
readOnly?: boolean;
|
|
79
|
+
onUpdate?: (editor: AXTextEditorTiptapEditor) => void;
|
|
80
|
+
onFocus?: (editor: AXTextEditorTiptapEditor, event?: FocusEvent) => void;
|
|
81
|
+
onBlur?: (editor: AXTextEditorTiptapEditor, event?: FocusEvent) => void;
|
|
82
|
+
onSelectionUpdate?: (editor: AXTextEditorTiptapEditor) => void;
|
|
83
|
+
onTransaction?: (editor: AXTextEditorTiptapEditor) => void;
|
|
84
|
+
}
|
|
85
|
+
declare module '@tiptap/core' {
|
|
86
|
+
interface Commands<ReturnType> {
|
|
87
|
+
superscript: {
|
|
88
|
+
toggleSuperscript: () => ReturnType;
|
|
89
|
+
};
|
|
90
|
+
subscript: {
|
|
91
|
+
toggleSubscript: () => ReturnType;
|
|
92
|
+
};
|
|
93
|
+
axTextEditorFontSize: {
|
|
94
|
+
setFontSize: (size: string | null) => ReturnType;
|
|
95
|
+
};
|
|
96
|
+
axTextEditorVideo: {
|
|
97
|
+
setVideo: (options: {
|
|
98
|
+
src: string;
|
|
99
|
+
}) => ReturnType;
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
declare class AXTextEditor {
|
|
105
|
+
readonly editor: _angular_core.WritableSignal<_tiptap_core.Editor>;
|
|
106
|
+
readonly state: _angular_core.WritableSignal<AXTextEditorState>;
|
|
107
|
+
readonly ready: _angular_core.WritableSignal<boolean>;
|
|
108
|
+
readonly version: _angular_core.WritableSignal<number>;
|
|
109
|
+
private readonly platformId;
|
|
110
|
+
private destroyed;
|
|
111
|
+
private applyingContent;
|
|
112
|
+
init(container: HTMLElement | string, options?: AXTextEditorInitOptions): Promise<void>;
|
|
113
|
+
destroy(): void;
|
|
114
|
+
refresh(): void;
|
|
115
|
+
setContent(value: AXTextEditorTiptapContent | null | undefined, emit?: boolean): void;
|
|
116
|
+
getHTML(): string;
|
|
117
|
+
getJSON(): AXTextEditorTiptapJSON | null;
|
|
118
|
+
getText(options?: {
|
|
119
|
+
blockSeparator?: string;
|
|
120
|
+
}): string;
|
|
121
|
+
isEmpty(): boolean;
|
|
122
|
+
isFocused(): boolean;
|
|
123
|
+
isEditable(): boolean;
|
|
124
|
+
setEditable(editable: boolean): void;
|
|
125
|
+
focus(): void;
|
|
126
|
+
blur(): void;
|
|
127
|
+
chain(): AXTextEditorTiptapChain | null;
|
|
128
|
+
get commands(): AXTextEditorTiptapEditor['commands'] | undefined;
|
|
129
|
+
isActive(command: AXTextEditorCommandType, attrs?: AXTextEditorCommandAttrs): boolean;
|
|
130
|
+
can(command: AXTextEditorCommandType, attrs?: AXTextEditorCommandAttrs): boolean;
|
|
131
|
+
run(command: AXTextEditorCommandType, attrs?: AXTextEditorCommandAttrs): boolean;
|
|
132
|
+
private commandsApi;
|
|
133
|
+
private getCommandsApi;
|
|
134
|
+
insertContent(value: AXTextEditorTiptapContent): boolean;
|
|
135
|
+
clearContent(): boolean;
|
|
136
|
+
insertImage(src: string, alt?: string): void;
|
|
137
|
+
insertVideo(src: string): void;
|
|
138
|
+
setLink(href: string): void;
|
|
139
|
+
unsetLink(): void;
|
|
140
|
+
clearFormatting(): void;
|
|
141
|
+
toggleHeading(level: AXTextEditorHeadingLevel): void;
|
|
142
|
+
setTextAlign(align: AXTextEditorTextAlign): void;
|
|
143
|
+
setTextDirection(direction: AXTextEditorTextDirection): void;
|
|
144
|
+
private refreshState;
|
|
145
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<AXTextEditor, never>;
|
|
146
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<any>;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
declare function isTextEditorCommandActive(editor: AXTextEditorTiptapEditor, command: AXTextEditorCommandType, attrs?: AXTextEditorCommandAttrs): boolean;
|
|
150
|
+
declare function canRunTextEditorCommand(editor: AXTextEditorTiptapEditor, command: AXTextEditorCommandType, attrs?: AXTextEditorCommandAttrs): boolean;
|
|
151
|
+
declare function runTextEditorCommand(editor: AXTextEditorTiptapEditor, command: AXTextEditorCommandType, attrs?: AXTextEditorCommandAttrs): boolean;
|
|
152
|
+
|
|
153
|
+
declare function createTextEditorExtensions(placeholderOrOptions?: string | (() => string) | AXTextEditorLoadExtensionsOptions): Promise<_tiptap_core.AnyExtension[]>;
|
|
154
|
+
|
|
155
|
+
export { AXTextEditor, AX_DEFAULT_TEXT_EDITOR_FEATURES, AX_EMPTY_TEXT_EDITOR_STATE, AX_TEXT_EDITOR_DEFAULT_BACKGROUND_COLORS, AX_TEXT_EDITOR_DEFAULT_TEXT_COLORS, AX_TEXT_EDITOR_FONT_SIZES, AX_TEXT_EDITOR_FONT_SIZE_TOKEN_VALUES, AX_TEXT_EDITOR_ZOOM_MAX, AX_TEXT_EDITOR_ZOOM_MIN, AX_TEXT_EDITOR_ZOOM_PRESETS, canRunTextEditorCommand, createTextEditorExtensions, isTextEditorCommandActive, runTextEditorCommand };
|
|
156
|
+
export type { AXTextEditorCommandAttrs, AXTextEditorCommandType, AXTextEditorFeatures, AXTextEditorFontSize, AXTextEditorFontSizeToken, AXTextEditorHeadingLevel, AXTextEditorInitOptions, AXTextEditorLoadExtensionsOptions, AXTextEditorRecentColor, AXTextEditorState, AXTextEditorTextAlign, AXTextEditorTextDirection, AXTextEditorTiptapChain, AXTextEditorTiptapContent, AXTextEditorTiptapEditor, AXTextEditorTiptapJSON };
|
|
@@ -65,7 +65,7 @@ interface AXWysiwygLoadExtensionsOptions {
|
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
/**
|
|
68
|
-
* @deprecated Use `
|
|
68
|
+
* @deprecated Use `AXTextEditor` from `@acorex/cdk/text-editor` instead.
|
|
69
69
|
*/
|
|
70
70
|
declare class AXWysiwyg {
|
|
71
71
|
readonly editor: _angular_core.WritableSignal<Editor>;
|