@domternal/extension-details 0.2.0 → 0.2.1
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/README.md +23 -41
- package/package.json +11 -13
package/README.md
CHANGED
|
@@ -1,53 +1,35 @@
|
|
|
1
1
|
# @domternal/extension-details
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/@domternal/extension-details)
|
|
4
|
+
[](https://github.com/domternal/domternal/blob/main/LICENSE)
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
A lightweight, extensible rich text editor toolkit built on [ProseMirror](https://prosemirror.net/). Framework-agnostic headless core with first-class **Angular** support. Use it headless with vanilla JS/TS, add the built-in toolbar and theme, or drop in ready-made Angular components. Fully tree-shakeable, import only what you use, unused extensions are stripped from your bundle.
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
**[Website](https://domternal.dev)** · **[Documentation](https://domternal.dev/v1/introduction)** · **[StackBlitz (Vanilla TS)](https://stackblitz.com/edit/domternal-vanilla-full-example)** · **[StackBlitz (Angular)](https://stackblitz.com/edit/domternal-angular-full-example)**
|
|
8
9
|
|
|
9
|
-
|
|
10
|
-
npm install @domternal/core @domternal/extension-details
|
|
11
|
-
```
|
|
10
|
+
## Features
|
|
12
11
|
|
|
13
|
-
|
|
12
|
+
See [Packages & Bundle Size](https://domternal.dev/v1/packages) for a full breakdown of all packages and what each one includes.
|
|
14
13
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
- **Headless core** - use with any framework or vanilla JS/TS
|
|
15
|
+
- **Angular components** - editor, toolbar, bubble menu, floating menu, emoji picker (signals, OnPush, zoneless-ready)
|
|
16
|
+
- **57 extensions across 10 packages** - 23 nodes, 9 marks, and 25 behavior extensions
|
|
17
|
+
- **140+ chainable commands** - `editor.chain().focus().toggleBold().run()`
|
|
18
|
+
- **Full table support** - cell merging, column resize, row/column controls, cell toolbar, all free and MIT licensed
|
|
19
|
+
- **Tree-shakeable** - import only what you use, your bundler strips the rest
|
|
20
|
+
- **~38 KB gzipped** (own code), [~108 KB total](https://domternal.dev/v1/packages) with ProseMirror
|
|
21
|
+
- **TypeScript first** - 100% typed, zero `any`
|
|
22
|
+
- **4,200+ tests** - 2,675 unit tests and 1,550 E2E tests across 34 Playwright specs
|
|
23
|
+
- **Light and dark theme** - 70+ CSS custom properties for full visual control
|
|
24
|
+
- **Inline styles export** - `getHTML({ styled: true })` produces inline CSS ready for email clients, CMS, and Google Docs
|
|
25
|
+
- **SSR helpers** - `generateHTML`, `generateJSON`, `generateText` for server-side rendering
|
|
18
26
|
|
|
19
|
-
|
|
20
|
-
element: document.getElementById('editor')!,
|
|
21
|
-
extensions: [StarterKit, Details, DetailsSummary, DetailsContent],
|
|
22
|
-
content: '<p>Hello world</p>',
|
|
23
|
-
});
|
|
27
|
+
## Documentation
|
|
24
28
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
editor.commands.toggleDetails();
|
|
30
|
-
|
|
31
|
-
// Open or close programmatically
|
|
32
|
-
editor.commands.openDetails();
|
|
33
|
-
editor.commands.closeDetails();
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
### Commands
|
|
37
|
-
|
|
38
|
-
| Command | Description |
|
|
39
|
-
|---|---|
|
|
40
|
-
| `setDetails` | Wrap selected content in a details structure |
|
|
41
|
-
| `unsetDetails` | Lift content out of details (preserves summary as paragraph) |
|
|
42
|
-
| `toggleDetails` | Toggle between wrapped and unwrapped |
|
|
43
|
-
| `openDetails` / `closeDetails` | Programmatic open/close control |
|
|
44
|
-
| `setDetailsOpen(boolean)` | Set the open state explicitly |
|
|
45
|
-
|
|
46
|
-
### Options
|
|
47
|
-
|
|
48
|
-
| Option | Default | Description |
|
|
49
|
-
|---|---|---|
|
|
50
|
-
| `persist` | `false` | Persist the open/closed state in the document |
|
|
29
|
+
- [Getting Started](https://domternal.dev/v1/getting-started) - install and create your first editor
|
|
30
|
+
- [Introduction](https://domternal.dev/v1/introduction) - core concepts, architecture, and design decisions
|
|
31
|
+
- [Packages & Bundle Size](https://domternal.dev/v1/packages) - what each package includes and bundle size breakdown
|
|
32
|
+
- [Blog](https://domternal.dev/blog)
|
|
51
33
|
|
|
52
34
|
## License
|
|
53
35
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@domternal/extension-details",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Details/accordion extension for Domternal editor",
|
|
5
5
|
"author": "https://github.com/ThomasNowHere",
|
|
6
6
|
"license": "MIT",
|
|
@@ -27,16 +27,6 @@
|
|
|
27
27
|
"files": [
|
|
28
28
|
"dist"
|
|
29
29
|
],
|
|
30
|
-
"scripts": {
|
|
31
|
-
"build": "tsup --clean",
|
|
32
|
-
"dev": "tsup --watch",
|
|
33
|
-
"test": "vitest run",
|
|
34
|
-
"test:watch": "vitest",
|
|
35
|
-
"lint": "eslint src",
|
|
36
|
-
"typecheck": "tsc --noEmit",
|
|
37
|
-
"prepublishOnly": "node -e \"const p=JSON.parse(require('fs').readFileSync('package.json','utf8'));delete p.devDependencies;if(p.dependencies){for(const[k,v]of Object.entries(p.dependencies)){if(v==='workspace:*')p.dependencies[k]='>=0.2.0'}}require('fs').writeFileSync('package.json',JSON.stringify(p,null,2)+'\\n')\"",
|
|
38
|
-
"postpublish": "git checkout package.json"
|
|
39
|
-
},
|
|
40
30
|
"peerDependencies": {
|
|
41
31
|
"@domternal/core": ">=0.2.0",
|
|
42
32
|
"@domternal/pm": ">=0.2.0"
|
|
@@ -56,5 +46,13 @@
|
|
|
56
46
|
"bugs": {
|
|
57
47
|
"url": "https://github.com/domternal/domternal/issues"
|
|
58
48
|
},
|
|
59
|
-
"homepage": "https://domternal.dev"
|
|
60
|
-
|
|
49
|
+
"homepage": "https://domternal.dev",
|
|
50
|
+
"scripts": {
|
|
51
|
+
"build": "tsup --clean",
|
|
52
|
+
"dev": "tsup --watch",
|
|
53
|
+
"test": "vitest run",
|
|
54
|
+
"test:watch": "vitest",
|
|
55
|
+
"lint": "eslint src",
|
|
56
|
+
"typecheck": "tsc --noEmit"
|
|
57
|
+
}
|
|
58
|
+
}
|