@iyulab/editor-components 0.6.0 → 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,21 @@
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
+
10
+ ## [0.6.1] - 2026-10-05
11
+
12
+ ### Fixed
13
+
14
+ - **`@iyulab/editor-components/react` resolves.** The build has always emitted the React wrappers to
15
+ `dist/react/` and the README documents the subpath, but `exports` did not list it, so the import
16
+ failed with `ERR_PACKAGE_PATH_NOT_EXPORTED`. `./react` and `./react/*` are now exported, as in
17
+ the sibling packages.
18
+
3
19
  ## [0.6.0] - 2026-10-05
4
20
 
5
21
  ### Added
@@ -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.0",
4
+ "version": "0.6.2",
5
5
  "keywords": [
6
6
  "iyulab",
7
7
  "web-components",
@@ -43,11 +43,14 @@
43
43
  "./dist/*": {
44
44
  "types": "./dist/*.d.ts",
45
45
  "import": "./dist/*"
46
- }
46
+ },
47
+ "./react": "./dist/react/index.js",
48
+ "./react/*": "./dist/react/*"
47
49
  },
48
50
  "scripts": {
49
51
  "preversion": "node -e \"if(require('fs').existsSync('../../scripts/preversion-check.mjs'))require('child_process').execFileSync('node',['../../scripts/preversion-check.mjs'],{stdio:'inherit'})\"",
50
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'})\"",
51
54
  "test": "vitest run",
52
55
  "test:watch": "vitest",
53
56
  "lint": "eslint src/",