@iyulab/editor-components 0.3.2 → 0.3.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 +19 -0
- package/dist/_virtual/{_@oxc-project_runtime@0.144.0 → _@oxc-project_runtime@0.147.0}/helpers/esm/decorate.js +1 -1
- package/dist/_virtual/{_@oxc-project_runtime@0.144.0 → _@oxc-project_runtime@0.147.0}/helpers/esm/decorateMetadata.js +1 -1
- package/dist/components/code-editor/UCodeEditor.js +2 -2
- package/dist/components/text-editor/UTextEditor.js +2 -2
- package/package.json +5 -1
- package/skills/iyulab-editor-components/SKILL.md +47 -0
- package/skills/iyulab-editor-components/references/components/code-editor.md +46 -0
- package/skills/iyulab-editor-components/references/components/text-editor.md +64 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.3.3] - 2026-08-25
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- Agent-skill reference docs for both components (`skills/iyulab-editor-components/`) —
|
|
8
|
+
properties, slots, events, and methods for `u-code-editor`/`u-text-editor`.
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- 🔴**`monaco-editor` bundles a vulnerable `dompurify` (`3.4.8`) with no pin protecting it.**
|
|
13
|
+
Four moderate/low DOMPurify advisories (GHSA-c2j3-45gr-mqc4, GHSA-cmwh-pvxp-8882,
|
|
14
|
+
GHSA-vxr8-fq34-vvx9, GHSA-55q2-fjhq-7xh7) affect `<=3.4.12`; a fresh install of this package
|
|
15
|
+
resolved the vulnerable version with nothing to stop it. Added `overrides: { dompurify:
|
|
16
|
+
"^3.4.13" }` — `dompurify` is a transitive dependency here (bundled via `monaco-editor`), not
|
|
17
|
+
a direct one, so this pins cleanly without touching `dependencies`. Verified with a clean
|
|
18
|
+
install: `npm audit` no longer reports any dompurify advisory, typecheck/lint/test/build all
|
|
19
|
+
pass. (`quill`'s own advisory, GHSA-v3m3-f69x-jf25, has no upstream fix yet and is unrelated
|
|
20
|
+
to this pin — still open, tracked separately.)
|
|
21
|
+
|
|
3
22
|
## [0.3.2] - 2026-08-18
|
|
4
23
|
|
|
5
24
|
### Changed
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region \0@oxc-project+runtime@0.
|
|
1
|
+
//#region \0@oxc-project+runtime@0.147.0/helpers/esm/decorate.js
|
|
2
2
|
function __decorate(decorators, target, key, desc) {
|
|
3
3
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
4
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region \0@oxc-project+runtime@0.
|
|
1
|
+
//#region \0@oxc-project+runtime@0.147.0/helpers/esm/decorateMetadata.js
|
|
2
2
|
function __decorateMetadata(k, v) {
|
|
3
3
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
4
4
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "./UCodeEditor.worker.js";
|
|
2
2
|
import { styles } from "./UCodeEditor.styles.js";
|
|
3
|
-
import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.
|
|
4
|
-
import __decorate from "../../_virtual/_@oxc-project_runtime@0.
|
|
3
|
+
import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.147.0/helpers/esm/decorateMetadata.js";
|
|
4
|
+
import __decorate from "../../_virtual/_@oxc-project_runtime@0.147.0/helpers/esm/decorate.js";
|
|
5
5
|
import { html, unsafeCSS } from "lit";
|
|
6
6
|
import { customElement, property } from "lit/decorators.js";
|
|
7
7
|
import { createRef, ref } from "lit/directives/ref.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.
|
|
2
|
-
import __decorate from "../../_virtual/_@oxc-project_runtime@0.
|
|
1
|
+
import __decorateMetadata from "../../_virtual/_@oxc-project_runtime@0.147.0/helpers/esm/decorateMetadata.js";
|
|
2
|
+
import __decorate from "../../_virtual/_@oxc-project_runtime@0.147.0/helpers/esm/decorate.js";
|
|
3
3
|
import { styles } from "./UTextEditor.styles.js";
|
|
4
4
|
import { html, unsafeCSS } from "lit";
|
|
5
5
|
import { customElement, property } from "lit/decorators.js";
|
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.3.
|
|
4
|
+
"version": "0.3.3",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"iyulab",
|
|
7
7
|
"web-components",
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
},
|
|
19
19
|
"files": [
|
|
20
20
|
"dist",
|
|
21
|
+
"skills",
|
|
21
22
|
"LICENSE",
|
|
22
23
|
"README.md",
|
|
23
24
|
"CHANGELOG.md",
|
|
@@ -83,5 +84,8 @@
|
|
|
83
84
|
"vite": "^8.1.4",
|
|
84
85
|
"vite-plugin-dts": "^5.0.3",
|
|
85
86
|
"vitest": "^4.1.10"
|
|
87
|
+
},
|
|
88
|
+
"overrides": {
|
|
89
|
+
"dompurify": "^3.4.13"
|
|
86
90
|
}
|
|
87
91
|
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: iyulab-editor-components
|
|
3
|
+
description: Editor web components — a Monaco-based code editor and a Quill-based rich text editor. Both auto-sync with the surrounding document theme (code editor) or the shared @iyulab/components design tokens (text editor). Use when working with @iyulab/editor-components package.
|
|
4
|
+
license: MIT
|
|
5
|
+
metadata:
|
|
6
|
+
author: iyulab
|
|
7
|
+
version: "0.3.3"
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# @iyulab/editor-components
|
|
11
|
+
|
|
12
|
+
Editor web components built on [Lit](https://lit.dev/). Custom elements (`u-*` tags) that work in any framework or vanilla HTML.
|
|
13
|
+
|
|
14
|
+
## Quick Start
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npm install @iyulab/editor-components
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Import all components at once:
|
|
21
|
+
|
|
22
|
+
```ts
|
|
23
|
+
import '@iyulab/editor-components';
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Import individual components (tree-shakable):
|
|
27
|
+
|
|
28
|
+
```ts
|
|
29
|
+
import '@iyulab/editor-components/dist/components/code-editor/UCodeEditor.js';
|
|
30
|
+
import '@iyulab/editor-components/dist/components/text-editor/UTextEditor.js';
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## Components
|
|
36
|
+
|
|
37
|
+
- [`u-code-editor`](./references/components/code-editor.md) — Monaco-based code editor. Language-aware syntax highlighting, automatic light/dark theme sync
|
|
38
|
+
- [`u-text-editor`](./references/components/text-editor.md) — Quill-based rich text editor. HTML/plain-text/Delta content access, customizable toolbar
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## Events
|
|
43
|
+
|
|
44
|
+
| Event | Source | Detail | Description |
|
|
45
|
+
|-------|--------|--------|--------------|
|
|
46
|
+
| `change` | `u-code-editor` | none (plain `Event`) | User edit in the Monaco editor |
|
|
47
|
+
| `change` | `u-text-editor` | `{ html, text, delta }` | User edit in the Quill editor |
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# u-code-editor
|
|
2
|
+
|
|
3
|
+
```ts
|
|
4
|
+
import '@iyulab/editor-components/dist/components/code-editor/UCodeEditor.js';
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
**Tag:** `u-code-editor`
|
|
8
|
+
|
|
9
|
+
Monaco Editor wrapped as a custom element. Syntax highlighting, per-language configuration, and automatic light/dark sync with the document theme (`Theme.resolved()` from `@iyulab/components`).
|
|
10
|
+
|
|
11
|
+
```html
|
|
12
|
+
<u-code-editor language="typescript" .value=${"const x: number = 42;"}></u-code-editor>
|
|
13
|
+
|
|
14
|
+
<!-- Without header -->
|
|
15
|
+
<u-code-editor language="json" headless .value=${JSON.stringify({key: 'value'}, null, 2)}></u-code-editor>
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## Properties
|
|
21
|
+
|
|
22
|
+
| Property | Type | Default | Reflect | Description |
|
|
23
|
+
|----------|------|---------|---------|-------------|
|
|
24
|
+
| `headless` | `boolean` | `false` | ✓ | Hides the header (label + `header-actions` slot) |
|
|
25
|
+
| `label` | `string` | `'Editor'` | — | Header title text |
|
|
26
|
+
| `theme` | `'light' \| 'dark'` | `'light'` | — | Editor color theme. Synced automatically from `Theme.resolved()` on connect and on every `data-theme`/`theme` attribute mutation on `document.documentElement` — the declared default is overwritten before first render, and setting it directly is overwritten by the next sync |
|
|
27
|
+
| `readOnly` | `boolean` | `false` | — | Prevents user input |
|
|
28
|
+
| `language` | `string` | `'json'` | — | Monaco language id (`"javascript"`, `"typescript"`, …) |
|
|
29
|
+
| `fontSize` | `number` | `14` | — | Editor font size in pixels |
|
|
30
|
+
| `value` | `string` | `''` | — | Current text content |
|
|
31
|
+
|
|
32
|
+
## Slots
|
|
33
|
+
|
|
34
|
+
| Name | Description |
|
|
35
|
+
|------|-------------|
|
|
36
|
+
| `header-actions` | Content placed at the end of the header (e.g. extra toolbar buttons) |
|
|
37
|
+
|
|
38
|
+
## Events
|
|
39
|
+
|
|
40
|
+
| Event | Detail | Description |
|
|
41
|
+
|-------|--------|--------------|
|
|
42
|
+
| `change` | none (plain `Event`) | Fired on user edits (`Monaco.onDidChangeModelContent`). Not fired for programmatic `value` assignment while Monaco already holds that value. Read the new content from `value` |
|
|
43
|
+
|
|
44
|
+
## CSS Custom Properties
|
|
45
|
+
|
|
46
|
+
None. `UCodeEditor.styles.ts` only sets a private layout variable (`--header-height`, not documented as a consumer override point) and otherwise relies on Monaco's own theme (`vs-light`/`vs-dark`) rather than this library's `--u-*` design tokens.
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# u-text-editor
|
|
2
|
+
|
|
3
|
+
```ts
|
|
4
|
+
import '@iyulab/editor-components/dist/components/text-editor/UTextEditor.js';
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
**Tag:** `u-text-editor`
|
|
8
|
+
|
|
9
|
+
Rich text editor built on [Quill](https://quilljs.com/). Reads and writes HTML, plain text, or Quill Delta.
|
|
10
|
+
|
|
11
|
+
```html
|
|
12
|
+
<u-text-editor placeholder="Start writing..." .value=${"<p>Hello</p>"}></u-text-editor>
|
|
13
|
+
|
|
14
|
+
<!-- Without header, custom toolbar -->
|
|
15
|
+
<u-text-editor headless .toolbar=${[['bold', 'italic'], ['link']]}></u-text-editor>
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## Properties
|
|
21
|
+
|
|
22
|
+
| Property | Type | Default | Reflect | Description |
|
|
23
|
+
|----------|------|---------|---------|-------------|
|
|
24
|
+
| `headless` | `boolean` | `false` | ✓ | Hides the header (label + `header-actions` slot) |
|
|
25
|
+
| `label` | `string` | `'Rich Text Editor'` | — | Header title text |
|
|
26
|
+
| `readOnly` | `boolean` | `false` | — | Prevents user input |
|
|
27
|
+
| `placeholder` | `string` | `'Start writing...'` | — | Placeholder shown when empty |
|
|
28
|
+
| `value` | `string` | `''` | — | Current content as HTML |
|
|
29
|
+
| `height` | `number` | `300` | — | Editor height in pixels |
|
|
30
|
+
| `toolbar` | `string[][]` | `undefined` | — | Custom toolbar configuration. When left unset, falls back at runtime to Quill's default 14-group toolbar (not a declared property default) |
|
|
31
|
+
|
|
32
|
+
## Methods
|
|
33
|
+
|
|
34
|
+
| Method | Returns | Description |
|
|
35
|
+
|--------|---------|--------------|
|
|
36
|
+
| `getHTML()` | `string` | Current content as HTML |
|
|
37
|
+
| `getText()` | `string` | Current content as plain text |
|
|
38
|
+
| `getDelta()` | `QuillDelta \| null` | Current content as a Quill Delta |
|
|
39
|
+
| `setHTML(html)` | `void` | Set content from HTML (same as setting `.value`) |
|
|
40
|
+
| `setDelta(delta)` | `void` | Set content from a Quill Delta |
|
|
41
|
+
| `clear()` | `void` | Clear all content |
|
|
42
|
+
| `focus()` | `void` | Focus the editor |
|
|
43
|
+
|
|
44
|
+
`setHTML`/`setDelta`/`clear` are programmatic — like the `value` property path, they do not fire `change`.
|
|
45
|
+
|
|
46
|
+
## Slots
|
|
47
|
+
|
|
48
|
+
| Name | Description |
|
|
49
|
+
|------|-------------|
|
|
50
|
+
| `header-actions` | Content placed at the end of the header (e.g. extra toolbar buttons) |
|
|
51
|
+
|
|
52
|
+
## Events
|
|
53
|
+
|
|
54
|
+
| Event | Detail | Description |
|
|
55
|
+
|-------|--------|--------------|
|
|
56
|
+
| `change` | `{ html: string, text: string, delta: QuillDelta }` | Fired only for user edits (Quill `source === 'user'`) — composed so it crosses the shadow boundary |
|
|
57
|
+
|
|
58
|
+
## CSS Custom Properties
|
|
59
|
+
|
|
60
|
+
`UTextEditor` doesn't declare any custom properties of its own — its styles read the shared
|
|
61
|
+
`@iyulab/components` design tokens directly (`--u-border-color`, `--u-panel-bg-color`,
|
|
62
|
+
`--u-txt-color`, `--u-txt-color-weak`, `--u-bg-color-hover`, `--u-radius-md`, `--u-primary-color`,
|
|
63
|
+
`--u-font-base`), so it re-themes automatically with the rest of the library and has nothing
|
|
64
|
+
component-specific to override.
|