@flogeez/angular-tiptap-editor 3.0.2 → 3.0.3
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/CHANGELOG.md +8 -0
- package/fesm2022/flogeez-angular-tiptap-editor.mjs +176 -39
- package/fesm2022/flogeez-angular-tiptap-editor.mjs.map +1 -1
- package/index.d.ts +48 -12
- package/package.json +1 -1
- package/src/lib/styles/ate-bubble-menu.global.css +13 -9
- package/src/lib/styles/ate-tooltip.global.css +47 -0
- package/src/lib/styles/index.css +1 -0
package/index.d.ts
CHANGED
|
@@ -5,8 +5,26 @@ import { Editor, NodeConfig, Extension, Node as Node$2, Mark, EditorOptions, JSO
|
|
|
5
5
|
import { Observable } from 'rxjs';
|
|
6
6
|
import { Node as Node$1 } from '@tiptap/pm/model';
|
|
7
7
|
import { ControlValueAccessor } from '@angular/forms';
|
|
8
|
+
import * as _popperjs_core from '@popperjs/core';
|
|
8
9
|
import { Decoration, EditorView, NodeView } from '@tiptap/pm/view';
|
|
9
10
|
|
|
11
|
+
/**
|
|
12
|
+
* Interface representing a single item in the slash commands menu.
|
|
13
|
+
*/
|
|
14
|
+
interface AteSlashCommandItem {
|
|
15
|
+
title: string;
|
|
16
|
+
description: string;
|
|
17
|
+
icon: string;
|
|
18
|
+
keywords: string[];
|
|
19
|
+
command: (editor: Editor) => void;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Custom slash commands configuration.
|
|
23
|
+
*/
|
|
24
|
+
interface AteCustomSlashCommands {
|
|
25
|
+
commands?: AteSlashCommandItem[];
|
|
26
|
+
}
|
|
27
|
+
|
|
10
28
|
type SupportedLocale = "en" | "fr" | (string & {});
|
|
11
29
|
interface AteTranslations {
|
|
12
30
|
toolbar: {
|
|
@@ -409,17 +427,6 @@ declare class AteI18nService {
|
|
|
409
427
|
static ɵprov: _angular_core.ɵɵInjectableDeclaration<AteI18nService>;
|
|
410
428
|
}
|
|
411
429
|
|
|
412
|
-
interface AteSlashCommandItem {
|
|
413
|
-
title: string;
|
|
414
|
-
description: string;
|
|
415
|
-
icon: string;
|
|
416
|
-
keywords: string[];
|
|
417
|
-
command: (editor: Editor) => void;
|
|
418
|
-
}
|
|
419
|
-
interface AteCustomSlashCommands {
|
|
420
|
-
commands?: AteSlashCommandItem[];
|
|
421
|
-
}
|
|
422
|
-
|
|
423
430
|
type AteStateCalculator = (editor: Editor) => Partial<{
|
|
424
431
|
[K in keyof AteEditorStateSnapshot]: AteEditorStateSnapshot[K] extends object ? Partial<AteEditorStateSnapshot[K]> : AteEditorStateSnapshot[K];
|
|
425
432
|
}>;
|
|
@@ -1275,6 +1282,35 @@ declare class AngularTiptapEditorComponent implements AfterViewInit, OnDestroy {
|
|
|
1275
1282
|
*/
|
|
1276
1283
|
declare function provideAteEditor(config?: AteEditorConfig): EnvironmentProviders;
|
|
1277
1284
|
|
|
1285
|
+
declare class AteTooltipDirective implements OnDestroy {
|
|
1286
|
+
private readonly el;
|
|
1287
|
+
private tippyInstance;
|
|
1288
|
+
content: _angular_core.InputSignal<string | null>;
|
|
1289
|
+
placement: _angular_core.InputSignal<_popperjs_core.Placement>;
|
|
1290
|
+
delay: _angular_core.InputSignal<number | [number, number]>;
|
|
1291
|
+
disabled: _angular_core.InputSignal<boolean>;
|
|
1292
|
+
/**
|
|
1293
|
+
* Computed logic for ARIA shortcuts.
|
|
1294
|
+
*/
|
|
1295
|
+
protected readonly ariaShortcut: _angular_core.Signal<string | null>;
|
|
1296
|
+
/**
|
|
1297
|
+
* Computed logic for Tippy content.
|
|
1298
|
+
* Includes strict escaping of dynamic content to prevent XSS.
|
|
1299
|
+
*/
|
|
1300
|
+
private readonly processedTooltip;
|
|
1301
|
+
constructor();
|
|
1302
|
+
ngOnDestroy(): void;
|
|
1303
|
+
/**
|
|
1304
|
+
* Basic HTML escaping for security.
|
|
1305
|
+
* Effectively neutralizes scripts or malicious HTML tags.
|
|
1306
|
+
*/
|
|
1307
|
+
private escapeHtml;
|
|
1308
|
+
private initTippy;
|
|
1309
|
+
private destroyTippy;
|
|
1310
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<AteTooltipDirective, never>;
|
|
1311
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<AteTooltipDirective, "[ateTooltip]", never, { "content": { "alias": "ateTooltip"; "required": false; "isSignal": true; }; "placement": { "alias": "ateTooltipPlacement"; "required": false; "isSignal": true; }; "delay": { "alias": "ateTooltipDelay"; "required": false; "isSignal": true; }; "disabled": { "alias": "ateTooltipDisabled"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
1312
|
+
}
|
|
1313
|
+
|
|
1278
1314
|
declare class AteImageService {
|
|
1279
1315
|
/** Signals for image state */
|
|
1280
1316
|
selectedImage: _angular_core.WritableSignal<AteImageData | null>;
|
|
@@ -1661,5 +1697,5 @@ declare function createAngularComponentExtension<T = unknown>(injector: Injector
|
|
|
1661
1697
|
*/
|
|
1662
1698
|
declare function registerAngularComponent<T = unknown>(injectorOrOptions: Injector | RegisterAngularComponentOptions<T>, maybeOptions?: RegisterAngularComponentOptions<T>): Node$2;
|
|
1663
1699
|
|
|
1664
|
-
export { ATE_BUBBLE_MENU_KEYS, ATE_CELL_BUBBLE_MENU_KEYS, ATE_DEFAULT_BUBBLE_MENU_CONFIG, ATE_DEFAULT_CELL_MENU_CONFIG, ATE_DEFAULT_CONFIG, ATE_DEFAULT_IMAGE_BUBBLE_MENU_CONFIG, ATE_DEFAULT_IMAGE_UPLOAD_CONFIG, ATE_DEFAULT_SLASH_COMMANDS_CONFIG, ATE_DEFAULT_TABLE_MENU_CONFIG, ATE_DEFAULT_TOOLBAR_CONFIG, ATE_GLOBAL_CONFIG, ATE_IMAGE_BUBBLE_MENU_KEYS, ATE_INITIAL_EDITOR_STATE, ATE_SLASH_COMMAND_KEYS, ATE_TABLE_BUBBLE_MENU_KEYS, ATE_TOOLBAR_KEYS, AngularTiptapEditorComponent, AteAngularNodeView, AteColorPickerService, AteDiscoveryCalculator, AteEditorCommandsService, AteI18nService, AteImageCalculator, AteImageService, AteLinkService, AteMarksCalculator, AteNodeViewRenderer, AteNoopValueAccessorDirective, AteSelectionCalculator, AteStructureCalculator, AteTableCalculator, createAngularComponentExtension, createDefaultSlashCommands, filterSlashCommands, provideAteEditor, registerAngularComponent };
|
|
1700
|
+
export { ATE_BUBBLE_MENU_KEYS, ATE_CELL_BUBBLE_MENU_KEYS, ATE_DEFAULT_BUBBLE_MENU_CONFIG, ATE_DEFAULT_CELL_MENU_CONFIG, ATE_DEFAULT_CONFIG, ATE_DEFAULT_IMAGE_BUBBLE_MENU_CONFIG, ATE_DEFAULT_IMAGE_UPLOAD_CONFIG, ATE_DEFAULT_SLASH_COMMANDS_CONFIG, ATE_DEFAULT_TABLE_MENU_CONFIG, ATE_DEFAULT_TOOLBAR_CONFIG, ATE_GLOBAL_CONFIG, ATE_IMAGE_BUBBLE_MENU_KEYS, ATE_INITIAL_EDITOR_STATE, ATE_SLASH_COMMAND_KEYS, ATE_TABLE_BUBBLE_MENU_KEYS, ATE_TOOLBAR_KEYS, AngularTiptapEditorComponent, AteAngularNodeView, AteColorPickerService, AteDiscoveryCalculator, AteEditorCommandsService, AteI18nService, AteImageCalculator, AteImageService, AteLinkService, AteMarksCalculator, AteNodeViewRenderer, AteNoopValueAccessorDirective, AteSelectionCalculator, AteStructureCalculator, AteTableCalculator, AteTooltipDirective, createAngularComponentExtension, createDefaultSlashCommands, filterSlashCommands, provideAteEditor, registerAngularComponent };
|
|
1665
1701
|
export type { AteAngularNode, AteBubbleMenuConfig, AteBubbleMenuKey, AteCellBubbleMenuConfig, AteCellBubbleMenuKey, AteColorEditMode, AteColorPickerSelection, AteComponentRenderOptions, AteCustomBubbleMenuItem, AteCustomSlashCommands, AteCustomToolbarItem, AteEditorConfig, AteEditorStateSnapshot, AteImageBubbleMenuConfig, AteImageBubbleMenuKey, AteImageData, AteImageUploadConfig, AteImageUploadContext, AteImageUploadHandler, AteImageUploadHandlerResult, AteImageUploadOptions, AteImageUploadResult, AteResizeOptions, AteSlashCommandItem, AteSlashCommandKey, AteSlashCommandsConfig, AteStateCalculator, AteTableBubbleMenuConfig, AteTableBubbleMenuKey, AteToolbarConfig, AteToolbarKey, AteTranslations, RegisterAngularComponentOptions, SupportedLocale };
|
package/package.json
CHANGED
|
@@ -1,17 +1,20 @@
|
|
|
1
|
-
/*
|
|
2
|
-
.tippy-box
|
|
3
|
-
|
|
1
|
+
/* Global styles for Tiptap bubble menus & Slash menu */
|
|
2
|
+
.tippy-box[data-theme~="ate-bubble-menu"],
|
|
3
|
+
.tippy-box[data-theme~="slash-menu"] {
|
|
4
|
+
/* Default Tippy limits to 350px */
|
|
4
5
|
max-width: none !important;
|
|
5
6
|
background: transparent !important;
|
|
6
7
|
box-shadow: none !important;
|
|
7
8
|
}
|
|
8
9
|
|
|
9
|
-
.tippy-content
|
|
10
|
-
|
|
11
|
-
padding
|
|
10
|
+
.tippy-box[data-theme~="ate-bubble-menu"] .tippy-content,
|
|
11
|
+
.tippy-box[data-theme~="slash-menu"] .tippy-content {
|
|
12
|
+
/* Internal container shouldn't add padding, we handle it in .bubble-menu or .slash-commands-menu */
|
|
13
|
+
padding: 0 !important;
|
|
12
14
|
}
|
|
13
15
|
|
|
14
|
-
|
|
16
|
+
/* Scoped bubble-menu styles - Restoring original design exactly as requested */
|
|
17
|
+
.tippy-box[data-theme~="ate-bubble-menu"] .bubble-menu {
|
|
15
18
|
display: flex !important;
|
|
16
19
|
align-items: center;
|
|
17
20
|
gap: var(--ate-menu-gap, 2px);
|
|
@@ -25,8 +28,9 @@
|
|
|
25
28
|
white-space: nowrap;
|
|
26
29
|
}
|
|
27
30
|
|
|
28
|
-
/*
|
|
29
|
-
.tippy-box[data-reference-hidden]
|
|
31
|
+
/* Hidden state when reference scrolls out of view */
|
|
32
|
+
.tippy-box[data-theme~="ate-bubble-menu"][data-reference-hidden],
|
|
33
|
+
.tippy-box[data-theme~="slash-menu"][data-reference-hidden] {
|
|
30
34
|
opacity: 0 !important;
|
|
31
35
|
transition: opacity 0.18s cubic-bezier(0, 0, 0.2, 1);
|
|
32
36
|
pointer-events: none !important;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/* ate-tooltip tippy theme */
|
|
2
|
+
.tippy-box[data-theme~="ate-tooltip"] {
|
|
3
|
+
background-color: var(--ate-tooltip-bg, #0f172a);
|
|
4
|
+
color: var(--ate-tooltip-color, #e2e8f0);
|
|
5
|
+
border-radius: var(--ate-sub-border-radius, 6px);
|
|
6
|
+
font-size: 12px;
|
|
7
|
+
line-height: 1.4;
|
|
8
|
+
padding: 0;
|
|
9
|
+
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
|
|
10
|
+
border: 1px solid rgba(255, 255, 255, 0.1);
|
|
11
|
+
pointer-events: none;
|
|
12
|
+
transition: opacity 0.1s ease-out;
|
|
13
|
+
text-align: center;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.tippy-box[data-theme~="ate-tooltip"] .tippy-content {
|
|
17
|
+
padding: 4px 6px;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/* Multi-line support */
|
|
21
|
+
.tippy-box[data-theme~="ate-tooltip"] .ate-tooltip-label {
|
|
22
|
+
display: block;
|
|
23
|
+
color: var(--ate-tooltip-color, #e2e8f0);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.tippy-box[data-theme~="ate-tooltip"] .ate-tooltip-shortcut {
|
|
27
|
+
display: block;
|
|
28
|
+
font-size: 10px;
|
|
29
|
+
opacity: 0.6;
|
|
30
|
+
margin-top: 2px;
|
|
31
|
+
font-family:
|
|
32
|
+
ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New",
|
|
33
|
+
monospace;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.tippy-box[data-theme~="ate-tooltip"] .ate-tooltip-shortcut kbd {
|
|
37
|
+
background: none;
|
|
38
|
+
border: none;
|
|
39
|
+
padding: 0;
|
|
40
|
+
color: inherit;
|
|
41
|
+
font: inherit;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/* Visibility state */
|
|
45
|
+
.tippy-box[data-theme~="ate-tooltip"][data-state="hidden"] {
|
|
46
|
+
opacity: 0;
|
|
47
|
+
}
|