@domternal/core 0.5.0 → 0.6.0

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 CHANGED
@@ -3,13 +3,13 @@
3
3
  [![Version](https://img.shields.io/npm/v/@domternal/core.svg)](https://www.npmjs.com/package/@domternal/core)
4
4
  [![MIT License](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/domternal/domternal/blob/main/LICENSE)
5
5
 
6
- A lightweight, extensible rich text editor toolkit built on <u>[ProseMirror](https://prosemirror.net/)</u>. Framework-agnostic headless core with first-class Angular and React support.
6
+ A lightweight, extensible rich text editor toolkit built on <u>[ProseMirror](https://prosemirror.net/)</u>. Framework-agnostic headless core with first-class Angular, React, and Vue support.
7
7
  Use it headless with vanilla JS/TS, add the built-in toolbar and theme, or drop in ready-made framework components. Fully tree-shakeable, import only what you use, unused extensions are stripped from your bundle.
8
8
 
9
9
  ## Links
10
10
 
11
11
  <u>[Website](https://domternal.dev)</u> &nbsp;&nbsp;&nbsp;•&nbsp;&nbsp;&nbsp; <u>[Documentation](https://domternal.dev/v1/introduction)</u>
12
- <u>[StackBlitz (Angular)](https://stackblitz.com/edit/domternal-angular-full-example)</u> &nbsp;&nbsp;&nbsp;•&nbsp;&nbsp;&nbsp; <u>[StackBlitz (React)](https://stackblitz.com/edit/domternal-react-full-example)</u> &nbsp;&nbsp;&nbsp;•&nbsp;&nbsp;&nbsp; <u>[StackBlitz (Vanilla TS)](https://stackblitz.com/edit/domternal-vanilla-full-example)</u>
12
+ <u>[StackBlitz (Angular)](https://stackblitz.com/edit/domternal-angular-full-example)</u> &nbsp;&nbsp;&nbsp;•&nbsp;&nbsp;&nbsp; <u>[StackBlitz (React)](https://stackblitz.com/edit/domternal-react-full-example)</u> &nbsp;&nbsp;&nbsp;•&nbsp;&nbsp;&nbsp; <u>[StackBlitz (Vue)](https://stackblitz.com/edit/domternal-vue-full-example)</u> &nbsp;&nbsp;&nbsp;•&nbsp;&nbsp;&nbsp; <u>[StackBlitz (Vanilla TS)](https://stackblitz.com/edit/domternal-vanilla-full-example)</u>
13
13
 
14
14
  ## Features
15
15
 
@@ -18,13 +18,14 @@ See <u>[Packages & Bundle Size](https://domternal.dev/v1/packages)</u> for a ful
18
18
  - **Headless core** - use with any framework or vanilla JS/TS
19
19
  - **Angular components** - editor, toolbar, bubble menu, floating menu, emoji picker (signals, OnPush, zoneless-ready)
20
20
  - **React components** - composable `Domternal` component, toolbar, bubble menu, floating menu, emoji picker, custom node views (React 18+)
21
- - **57 extensions across 11 packages** - 23 nodes, 9 marks, and 25 behavior extensions
21
+ - **Vue components** - composable `Domternal` component, `useEditor`/`useEditorState` composables, toolbar, bubble menu, floating menu, emoji picker, custom node views (Vue 3.3+)
22
+ - **57 extensions across 12 packages** - 23 nodes, 9 marks, and 25 behavior extensions
22
23
  - **140+ chainable commands** - `editor.chain().focus().toggleBold().run()`
23
24
  - **Full table support** - cell merging, column resize, row/column controls, cell toolbar, all free and MIT licensed
24
25
  - **Tree-shakeable** - import only what you use, your bundler strips the rest
25
26
  - **~38 KB gzipped** (own code), <u>[~108 KB total](https://domternal.dev/v1/packages)</u> with ProseMirror
26
27
  - **TypeScript first** - 100% typed, zero `any`
27
- - **6,400+ tests** - 2,677 unit tests and 3,767 E2E tests across 78 Playwright specs
28
+ - **8,500+ tests** - 2,677 unit tests and 5,800+ E2E tests across 120+ Playwright specs
28
29
  - **Light and dark theme** - 70+ CSS custom properties for full visual control
29
30
  - **Inline styles export** - `getHTML({ styled: true })` produces inline CSS ready for email clients, CMS, and Google Docs
30
31
  - **SSR helpers** - `generateHTML`, `generateJSON`, `generateText` for server-side rendering
package/dist/index.cjs CHANGED
@@ -5521,6 +5521,22 @@ var TaskItem = Node.create({
5521
5521
  if ($from.depth < 1 || $from.node(-1).type !== this.nodeType) return false;
5522
5522
  return schemaList.liftListItem(this.nodeType)(this.editor.state, this.editor.view.dispatch);
5523
5523
  },
5524
+ Backspace: () => {
5525
+ if (!this.editor || !this.nodeType) return false;
5526
+ const { state, view } = this.editor;
5527
+ const { $from, empty } = state.selection;
5528
+ if (!empty || $from.parentOffset !== 0) return false;
5529
+ let taskItemDepth = -1;
5530
+ for (let d = $from.depth; d > 0; d--) {
5531
+ if ($from.node(d).type === this.nodeType) {
5532
+ taskItemDepth = d;
5533
+ break;
5534
+ }
5535
+ }
5536
+ if (taskItemDepth === -1) return false;
5537
+ if ($from.index(taskItemDepth) !== 0) return false;
5538
+ return schemaList.liftListItem(this.nodeType)(state, view.dispatch);
5539
+ },
5524
5540
  "Mod-Enter": () => {
5525
5541
  return this.editor?.commands["toggleTask"]?.() ?? false;
5526
5542
  }
@@ -7470,7 +7486,7 @@ var SelectionDecoration = Extension.create(
7470
7486
  handleDOMEvents: {
7471
7487
  blur(view, event) {
7472
7488
  const related = event.relatedTarget;
7473
- if (related instanceof HTMLElement && related.closest("[data-dm-editor-ui]")) {
7489
+ if (related instanceof HTMLElement && (related.closest("[data-dm-editor-ui]") || related.closest(".dm-toolbar") || related.closest(".dm-bubble-menu"))) {
7474
7490
  return false;
7475
7491
  }
7476
7492
  const { from, to } = view.state.selection;