Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions API.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,13 @@ export interface AteEditorConfig {

## 📤 Outputs

| Output | Type | Description |
| ---------------- | --------------------------------------- | --------------------------------- |
| `contentChange` | `string` | Emitted when content changes |
| `editorCreated` | `Editor` | Emitted when editor is created |
| `editorUpdate` | `{ editor: Editor; transaction: any }` | Emitted on every editor update |
| `editorFocus` | `{ editor: Editor; event: FocusEvent }` | Emitted when editor gains focus |
| `editorBlur` | `{ editor: Editor; event: FocusEvent }` | Emitted when editor loses focus |
| `editableChange` | `boolean` | Emitted when edit mode is toggled |
| Output | Type | Description |
| ----------------- | ------------------------------------------ | --------------------------------- |
| `contentChange` | `string` | Emitted when content changes |
| `editorCreated` | `Editor` | Emitted when editor is created |
| `editorUpdate` | `{ editor: Editor; transaction: any }` | Emitted on every editor update |
| `editorFocus` | `{ editor: Editor; event: FocusEvent }` | Emitted when editor gains focus |
| `editorBlur` | `{ editor: Editor; event: FocusEvent }` | Emitted when editor loses focus |
| `editableChange` | `boolean` | Emitted when edit mode is toggled |
| `imageUploaded` | `AteImageUploadResult` | Emitted when an image is uploaded |

6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to `@flogeez/angular-tiptap-editor` will be documented in th
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html), with the exception that the major version is specifically aligned with the major version of [Tiptap](https://tiptap.dev).

## [3.2.1] - 2026-06-18

### Added

- **Image Upload Hook**: Introduced `imageUploaded` output (emits `AteImageUploadResult` when an image is successfully uploaded and inserted).

## [3.2.0] - 2026-06-09

### Added
Expand Down
20 changes: 5 additions & 15 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,11 @@
}
},
"options": {
"assets": [
"src/favicon.ico"
],
"assets": ["src/favicon.ico"],
"index": "src/index.html",
"browser": "src/main.ts",
"outputPath": "demo-dist",
"polyfills": [
"zone.js"
],
"polyfills": ["zone.js"],
"scripts": [],
"styles": [
"node_modules/@fontsource/material-symbols-outlined/index.css",
Expand All @@ -62,10 +58,7 @@
"lint": {
"builder": "@angular-eslint/builder:lint",
"options": {
"lintFilePatterns": [
"src/**/*.ts",
"src/**/*.html"
]
"lintFilePatterns": ["src/**/*.ts", "src/**/*.html"]
}
}
},
Expand Down Expand Up @@ -100,10 +93,7 @@
"builder": "@angular/build:karma",
"options": {
"tsConfig": "projects/angular-tiptap-editor/tsconfig.spec.json",
"polyfills": [
"zone.js",
"zone.js/testing"
]
"polyfills": ["zone.js", "zone.js/testing"]
}
},
"lint": {
Expand All @@ -120,4 +110,4 @@
}
},
"version": 1
}
}
4 changes: 2 additions & 2 deletions projects/angular-tiptap-editor/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@flogeez/angular-tiptap-editor",
"version": "3.2.0",
"version": "3.2.1",
"description": "A modern, customizable rich-text editor for Angular (18+), built with Tiptap and featuring complete internationalization support",
"keywords": [
"angular",
Expand Down Expand Up @@ -45,4 +45,4 @@
"tslib": "^2.3.0"
},
"sideEffects": false
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,18 @@ export abstract class AteBaseBubbleMenu implements AfterViewInit, OnDestroy {
constructor() {
// Effect to reactively update the menu when editor state
// or toolbar interaction changes.
effect(() => {
this.state();
this.isToolbarInteracting();
// Also react to link/color edit modes to hide when sub-menus activate
this.editorCommands.linkEditMode();
this.editorCommands.colorEditMode();

this.updateMenu();
}, { allowSignalWrites: true });
effect(
() => {
this.state();
this.isToolbarInteracting();
// Also react to link/color edit modes to hide when sub-menus activate
this.editorCommands.linkEditMode();
this.editorCommands.colorEditMode();

this.updateMenu();
},
{ allowSignalWrites: true }
);
}

ngAfterViewInit() {
Expand All @@ -72,7 +75,9 @@ export abstract class AteBaseBubbleMenu implements AfterViewInit, OnDestroy {
*/
protected initTippy() {
const nativeElement = this.menuRef().nativeElement;
if (!nativeElement) {return;}
if (!nativeElement) {
return;
}

const ed = this.editor();
if (this.tippyInstance) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,16 @@ export abstract class AteBaseSubBubbleMenu implements AfterViewInit, OnDestroy {

constructor() {
// Reactive effect for menu updates (re-positioning)
effect(() => {
// Monitor editor state and specific sub-menu states
this.state();
this.onStateChange();
effect(
() => {
// Monitor editor state and specific sub-menu states
this.state();
this.onStateChange();

this.updateMenu();
}, { allowSignalWrites: true });
this.updateMenu();
},
{ allowSignalWrites: true }
);
}

ngAfterViewInit() {
Expand All @@ -65,7 +68,9 @@ export abstract class AteBaseSubBubbleMenu implements AfterViewInit, OnDestroy {
*/
protected initTippy() {
const nativeElement = this.menuRef().nativeElement;
if (!nativeElement) {return;}
if (!nativeElement) {
return;
}

const ed = this.editor();
if (this.tippyInstance) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,18 +131,21 @@ export class AteLinkBubbleMenuComponent extends AteBaseSubBubbleMenu {
super();

// Reactive effect for URL sync
effect(() => {
const state = this.state();
const isInteracting = this.linkSvc.isInteracting();
const currentLinkHref = state.marks.linkHref || "";

// SYNC LOGIC:
// If we are NOT currently typing (interacting),
// always keep the input in sync with the current editor selection.
if (!isInteracting) {
this.editUrl.set(currentLinkHref);
}
}, { allowSignalWrites: true });
effect(
() => {
const state = this.state();
const isInteracting = this.linkSvc.isInteracting();
const currentLinkHref = state.marks.linkHref || "";

// SYNC LOGIC:
// If we are NOT currently typing (interacting),
// always keep the input in sync with the current editor selection.
if (!isInteracting) {
this.editUrl.set(currentLinkHref);
}
},
{ allowSignalWrites: true }
);
}

protected override onStateChange() {
Expand Down
Loading
Loading