@iyulab/editor-components 0.6.1 → 0.6.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 +15 -0
- package/README.md +27 -0
- package/dist/components/text-editor/UTextEditor.d.ts +18 -0
- package/package.json +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.6.3] - 2026-10-06
|
|
4
|
+
|
|
5
|
+
### Documentation
|
|
6
|
+
|
|
7
|
+
- README **Quick Start** — a first page with `u-text-editor` (its module only, so Monaco stays out of the bundle) that
|
|
8
|
+
reads the typed `change` detail. Checked against the published package in a clean Vite consumer: build, strict `tsc`
|
|
9
|
+
and a headless render.
|
|
10
|
+
|
|
11
|
+
## [0.6.2] - 2026-10-06
|
|
12
|
+
|
|
13
|
+
### Fixed
|
|
14
|
+
|
|
15
|
+
- **`u-text-editor`'s `change` is typed for TypeScript listeners** (`UTextEditorEventMap`): a listener
|
|
16
|
+
gets `CustomEvent<{ html, text, delta }>` instead of the native `Event`, so `e.detail.html` compiles.
|
|
17
|
+
|
|
3
18
|
## [0.6.1] - 2026-10-05
|
|
4
19
|
|
|
5
20
|
### Fixed
|
package/README.md
CHANGED
|
@@ -21,6 +21,33 @@ React 래퍼는 `/react` 서브패스로 제공됩니다:
|
|
|
21
21
|
import { UCodeEditor, UTextEditor } from '@iyulab/editor-components/react';
|
|
22
22
|
```
|
|
23
23
|
|
|
24
|
+
## Quick Start
|
|
25
|
+
|
|
26
|
+
첫 페이지 — 리치 텍스트 에디터 하나와 그 내용 읽기(Vite 기준, `index.html` 이 `src/main.ts` 를 모듈로 싣는다).
|
|
27
|
+
`u-text-editor` 만 쓰면 그 모듈만 불러 Monaco 를 번들에 넣지 않는다.
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
npm install @iyulab/editor-components @iyulab/components
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
```ts
|
|
34
|
+
// src/main.ts
|
|
35
|
+
import '@iyulab/components/styles/tokens.css';
|
|
36
|
+
import '@iyulab/editor-components/dist/components/text-editor/UTextEditor.js';
|
|
37
|
+
|
|
38
|
+
const editor = document.createElement('u-text-editor');
|
|
39
|
+
editor.label = 'Note';
|
|
40
|
+
editor.value = '<p>Hello <strong>editor</strong>.</p>';
|
|
41
|
+
editor.style.height = '320px'; // 호스트 상자가 높이를 정한다 — 아래 「크기」
|
|
42
|
+
|
|
43
|
+
const preview = document.createElement('pre');
|
|
44
|
+
editor.addEventListener('change', (e) => {
|
|
45
|
+
preview.textContent = e.detail.text; // e.detail: { html, text, delta } — 타입이 붙는다
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
document.body.append(editor, preview);
|
|
49
|
+
```
|
|
50
|
+
|
|
24
51
|
## 포함된 컴포넌트
|
|
25
52
|
|
|
26
53
|
### `u-code-editor` (UCodeEditor)
|
|
@@ -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.3",
|
|
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/",
|