@iyulab/editor-components 0.6.1 → 0.6.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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.6.2] - 2026-10-06
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
|
|
7
|
+
- **`u-text-editor`'s `change` is typed for TypeScript listeners** (`UTextEditorEventMap`): a listener
|
|
8
|
+
gets `CustomEvent<{ html, text, delta }>` instead of the native `Event`, so `e.detail.html` compiles.
|
|
9
|
+
|
|
3
10
|
## [0.6.1] - 2026-10-05
|
|
4
11
|
|
|
5
12
|
### Fixed
|
|
@@ -82,6 +82,24 @@ export declare class UTextEditor extends UElement {
|
|
|
82
82
|
*/
|
|
83
83
|
focus(): void;
|
|
84
84
|
}
|
|
85
|
+
/** Events `<u-text-editor>` dispatches — bubbling and composed. `change` is a CustomEvent here, not the native one. */
|
|
86
|
+
export interface UTextEditorEventMap {
|
|
87
|
+
/** The user edited the text (not programmatic `value` changes). `delta` is Quill's document model. */
|
|
88
|
+
'change': CustomEvent<{
|
|
89
|
+
html: string;
|
|
90
|
+
text: string;
|
|
91
|
+
delta: ReturnType<Quill['getContents']>;
|
|
92
|
+
}>;
|
|
93
|
+
}
|
|
94
|
+
/** Typed listeners for {@link UTextEditorEventMap} — element-scoped, the DOM's own pattern (`HTMLMediaElementEventMap`). */
|
|
95
|
+
export interface UTextEditor {
|
|
96
|
+
addEventListener<K extends keyof UTextEditorEventMap>(type: K, listener: (this: UTextEditor, ev: UTextEditorEventMap[K]) => unknown, options?: boolean | AddEventListenerOptions): void;
|
|
97
|
+
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: UTextEditor, ev: HTMLElementEventMap[K]) => unknown, options?: boolean | AddEventListenerOptions): void;
|
|
98
|
+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
99
|
+
removeEventListener<K extends keyof UTextEditorEventMap>(type: K, listener: (this: UTextEditor, ev: UTextEditorEventMap[K]) => unknown, options?: boolean | EventListenerOptions): void;
|
|
100
|
+
removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: UTextEditor, ev: HTMLElementEventMap[K]) => unknown, options?: boolean | EventListenerOptions): void;
|
|
101
|
+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
102
|
+
}
|
|
85
103
|
declare global {
|
|
86
104
|
interface HTMLElementTagNameMap {
|
|
87
105
|
"u-text-editor": UTextEditor;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@iyulab/editor-components",
|
|
3
3
|
"description": "various editor components by iyulab",
|
|
4
|
-
"version": "0.6.
|
|
4
|
+
"version": "0.6.2",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"iyulab",
|
|
7
7
|
"web-components",
|
|
@@ -50,6 +50,7 @@
|
|
|
50
50
|
"scripts": {
|
|
51
51
|
"preversion": "node -e \"if(require('fs').existsSync('../../scripts/preversion-check.mjs'))require('child_process').execFileSync('node',['../../scripts/preversion-check.mjs'],{stdio:'inherit'})\"",
|
|
52
52
|
"preview": "vite",
|
|
53
|
+
"pretest": "node -e \"if(require('fs').existsSync('../../scripts/sibling-dist-check.js'))require('child_process').execFileSync('node',['../../scripts/sibling-dist-check.js'],{stdio:'inherit'})\"",
|
|
53
54
|
"test": "vitest run",
|
|
54
55
|
"test:watch": "vitest",
|
|
55
56
|
"lint": "eslint src/",
|