@domternal/pm 0.11.1 → 0.11.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/README.md +46 -29
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -3,42 +3,59 @@
|
|
|
3
3
|
[](https://www.npmjs.com/package/@domternal/pm)
|
|
4
4
|
[](https://github.com/domternal/domternal/blob/main/LICENSE)
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
The ProseMirror dependency layer for the [Domternal](https://domternal.dev) editor. It
|
|
7
|
+
re-exports the underlying `prosemirror-*` libraries under stable `@domternal/pm/*`
|
|
8
|
+
subpaths so every Domternal package imports ProseMirror from one place. Because the
|
|
9
|
+
`prosemirror-*` packages are pinned here as direct dependencies, your package manager
|
|
10
|
+
dedupes them to a single copy across `@domternal/core` and every extension. You rarely
|
|
11
|
+
install it yourself: it ships transitively with `@domternal/core`.
|
|
8
12
|
|
|
9
13
|
## Links
|
|
10
14
|
|
|
11
|
-
<u>[Website](https://domternal.dev)</u> • <u>[Documentation](https://domternal.dev/v1/
|
|
12
|
-
<u>[StackBlitz (Angular)](https://stackblitz.com/edit/domternal-angular-full-example)</u> • <u>[StackBlitz (React)](https://stackblitz.com/edit/domternal-react-full-example)</u> • <u>[StackBlitz (Vue)](https://stackblitz.com/edit/domternal-vue-full-example)</u> • <u>[StackBlitz (Vanilla TS)](https://stackblitz.com/edit/domternal-vanilla-full-example)</u>
|
|
15
|
+
<u>[Website](https://domternal.dev)</u> • <u>[Documentation](https://domternal.dev/v1/packages)</u> • <u>[Live examples](https://domternal.dev/examples)</u>
|
|
13
16
|
|
|
14
|
-
##
|
|
17
|
+
## Install
|
|
15
18
|
|
|
16
|
-
|
|
19
|
+
Install it explicitly only when you import ProseMirror primitives in your own code:
|
|
17
20
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
- **Vue components** - composable `Domternal` component, `useEditor`/`useEditorState` composables, toolbar, bubble menu, floating menu, emoji picker, notion color picker, custom node views (Vue 3.3+)
|
|
22
|
-
- **Vanilla wrapper** - framework-free class-based API for Astro, Svelte, Solid, plain HTML, and Web Components - editor, toolbar, bubble menu, floating menu, emoji picker, notion color picker
|
|
23
|
-
- **Notion-style block UX** - drag-to-reorder, block context menu, slash command, smart paste, keyboard reorder, floating Table of Contents
|
|
24
|
-
- **70+ extensions across 16 packages** - nodes, marks, and behavior extensions
|
|
25
|
-
- **125+ chainable commands** - `editor.chain().focus().toggleBold().run()`
|
|
26
|
-
- **Full table support** - cell merging, column resize, row/column controls, cell toolbar, all free and MIT licensed
|
|
27
|
-
- **Tree-shakeable** - import only what you use, your bundler strips the rest
|
|
28
|
-
- **~44 KB gzipped** (own code), <u>[see Packages](https://domternal.dev/v1/packages)</u> for full bundle breakdown with ProseMirror
|
|
29
|
-
- **TypeScript first** - 100% typed, zero `any`
|
|
30
|
-
- **15,000+ tests** - 4,000+ unit and 11,000+ E2E across 230+ Playwright specs and 4 demo apps
|
|
31
|
-
- **Light and dark theme** - 120+ CSS custom properties for full visual control
|
|
32
|
-
- **Inline styles export** - `getHTML({ styled: true })` produces inline CSS ready for email clients, CMS, and Google Docs
|
|
33
|
-
- **SSR helpers** - `generateHTML`, `generateJSON`, `generateText` for server-side rendering
|
|
21
|
+
```bash
|
|
22
|
+
pnpm add @domternal/pm
|
|
23
|
+
```
|
|
34
24
|
|
|
35
|
-
|
|
25
|
+
There are no peer dependencies: the `prosemirror-*` libraries are bundled as
|
|
26
|
+
dependencies of this package.
|
|
36
27
|
|
|
37
|
-
|
|
38
|
-
- <u>[Introduction](https://domternal.dev/v1/introduction)</u> - core concepts, architecture, and design decisions
|
|
39
|
-
- <u>[Packages & Bundle Size](https://domternal.dev/v1/packages)</u> - what each package includes and bundle size breakdown
|
|
40
|
-
- <u>[Blog](https://domternal.dev/blog)</u>
|
|
28
|
+
## Usage
|
|
41
29
|
|
|
42
|
-
|
|
30
|
+
Import from a subpath matching the ProseMirror package you need. Each subpath
|
|
31
|
+
re-exports the full API of its `prosemirror-*` counterpart.
|
|
43
32
|
|
|
44
|
-
|
|
33
|
+
```ts
|
|
34
|
+
import { Plugin, PluginKey } from '@domternal/pm/state';
|
|
35
|
+
import type { EditorView } from '@domternal/pm/view';
|
|
36
|
+
|
|
37
|
+
const myPlugin = new Plugin({
|
|
38
|
+
key: new PluginKey('my-plugin'),
|
|
39
|
+
view: (view: EditorView) => ({ destroy: () => {} }),
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
// Every `@domternal/pm/*` subpath re-exports its `prosemirror-*`
|
|
43
|
+
// counterpart unchanged.
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Subpaths
|
|
47
|
+
|
|
48
|
+
| Subpath | Re-exports |
|
|
49
|
+
| --- | --- |
|
|
50
|
+
| `@domternal/pm/commands` | `prosemirror-commands` |
|
|
51
|
+
| `@domternal/pm/dropcursor` | `prosemirror-dropcursor` |
|
|
52
|
+
| `@domternal/pm/gapcursor` | `prosemirror-gapcursor` |
|
|
53
|
+
| `@domternal/pm/history` | `prosemirror-history` |
|
|
54
|
+
| `@domternal/pm/inputrules` | `prosemirror-inputrules` |
|
|
55
|
+
| `@domternal/pm/keymap` | `prosemirror-keymap` |
|
|
56
|
+
| `@domternal/pm/model` | `prosemirror-model` |
|
|
57
|
+
| `@domternal/pm/schema-list` | `prosemirror-schema-list` |
|
|
58
|
+
| `@domternal/pm/state` | `prosemirror-state` |
|
|
59
|
+
| `@domternal/pm/tables` | `prosemirror-tables` |
|
|
60
|
+
| `@domternal/pm/transform` | `prosemirror-transform` |
|
|
61
|
+
| `@domternal/pm/view` | `prosemirror-view` |
|