feat(writekit): rename @robonen/editor to @robonen/writekit

Rename the rich-text editor package and all Editor* exports to Writekit*;
remove the old vue/editor tree.
This commit is contained in:
2026-06-15 16:54:06 +07:00
parent 55e78786d6
commit 263c32002f
149 changed files with 1563 additions and 1748 deletions
+12
View File
@@ -0,0 +1,12 @@
import { defineMark } from '../registry';
export const bold = defineMark({
type: 'bold',
spec: {
inclusive: true,
rank: 1,
toDOM: () => ['strong', 0],
parseDOM: [{ tag: 'strong' }, { tag: 'b' }],
},
meta: { title: 'Bold', icon: 'bold', hotkey: 'Mod-b' },
});
+13
View File
@@ -0,0 +1,13 @@
import { defineMark } from '../registry';
export const code = defineMark({
type: 'code',
spec: {
inclusive: false,
rank: 9,
excludes: '_all', // inline code wins: it strips every other mark on the range
toDOM: () => ['code', 0],
parseDOM: [{ tag: 'code' }],
},
meta: { title: 'Inline code', icon: 'code', hotkey: 'Mod-e' },
});
+12
View File
@@ -0,0 +1,12 @@
import { defineMark } from '../registry';
export const highlight = defineMark({
type: 'highlight',
spec: {
inclusive: true,
rank: 5,
toDOM: () => ['mark', 0],
parseDOM: [{ tag: 'mark' }],
},
meta: { title: 'Highlight', icon: 'highlighter' },
});
+7
View File
@@ -0,0 +1,7 @@
export { bold } from './bold';
export { italic } from './italic';
export { underline } from './underline';
export { strike } from './strike';
export { highlight } from './highlight';
export { code } from './code';
export { link } from './link';
+12
View File
@@ -0,0 +1,12 @@
import { defineMark } from '../registry';
export const italic = defineMark({
type: 'italic',
spec: {
inclusive: true,
rank: 2,
toDOM: () => ['em', 0],
parseDOM: [{ tag: 'em' }, { tag: 'i' }],
},
meta: { title: 'Italic', icon: 'italic', hotkey: 'Mod-i' },
});
+31
View File
@@ -0,0 +1,31 @@
import type { Mark } from '../model';
import { defineMark } from '../registry';
export const link = defineMark({
type: 'link',
spec: {
inclusive: false, // typing past a link's end does not extend it
rank: 10,
attrs: {
href: { default: '' },
target: { default: '_blank' },
},
toDOM: (mark: Mark) => [
'a',
{
href: String(mark.attrs?.['href'] ?? ''),
target: String(mark.attrs?.['target'] ?? '_blank'),
rel: 'noopener noreferrer',
},
0,
],
parseDOM: [{
tag: 'a[href]',
getAttrs: (el: HTMLElement) => ({
href: el.getAttribute('href') ?? '',
target: el.getAttribute('target') ?? '_blank',
}),
}],
},
meta: { title: 'Link', icon: 'link', hotkey: 'Mod-k' },
});
+12
View File
@@ -0,0 +1,12 @@
import { defineMark } from '../registry';
export const strike = defineMark({
type: 'strike',
spec: {
inclusive: true,
rank: 4,
toDOM: () => ['s', 0],
parseDOM: [{ tag: 's' }, { tag: 'del' }],
},
meta: { title: 'Strikethrough', icon: 'strikethrough', hotkey: 'Mod-Shift-s' },
});
+12
View File
@@ -0,0 +1,12 @@
import { defineMark } from '../registry';
export const underline = defineMark({
type: 'underline',
spec: {
inclusive: true,
rank: 3,
toDOM: () => ['u', 0],
parseDOM: [{ tag: 'u' }],
},
meta: { title: 'Underline', icon: 'underline', hotkey: 'Mod-u' },
});