wysio 0.0.1 → 0.2.0-alpha.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/CHANGELOG.md +25 -0
- package/LICENSE +21 -0
- package/README.md +241 -3
- package/dist/auto-init.d.ts +12 -0
- package/dist/auto-init.d.ts.map +1 -0
- package/dist/cdn-full.d.ts +3 -0
- package/dist/cdn-full.d.ts.map +1 -0
- package/dist/cdn.d.ts +2 -0
- package/dist/cdn.d.ts.map +1 -0
- package/dist/commands.d.ts +19 -0
- package/dist/commands.d.ts.map +1 -0
- package/dist/content.d.ts +31 -0
- package/dist/content.d.ts.map +1 -0
- package/dist/editor.d.ts +158 -0
- package/dist/editor.d.ts.map +1 -0
- package/dist/emitter.d.ts +9 -0
- package/dist/emitter.d.ts.map +1 -0
- package/dist/format-html.d.ts +7 -0
- package/dist/format-html.d.ts.map +1 -0
- package/dist/i18n.d.ts +16 -0
- package/dist/i18n.d.ts.map +1 -0
- package/dist/icons.d.ts +34 -0
- package/dist/icons.d.ts.map +1 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/locales/nl.d.ts +81 -0
- package/dist/locales/nl.d.ts.map +1 -0
- package/dist/markdown/index.d.ts +17 -0
- package/dist/markdown/index.d.ts.map +1 -0
- package/dist/markdown.js +179 -0
- package/dist/markdown.js.map +1 -0
- package/dist/messages.d.ts +83 -0
- package/dist/messages.d.ts.map +1 -0
- package/dist/plugin.d.ts +94 -0
- package/dist/plugin.d.ts.map +1 -0
- package/dist/plugins/alignment.d.ts +10 -0
- package/dist/plugins/alignment.d.ts.map +1 -0
- package/dist/plugins/base.d.ts +7 -0
- package/dist/plugins/base.d.ts.map +1 -0
- package/dist/plugins/blocks.d.ts +4 -0
- package/dist/plugins/blocks.d.ts.map +1 -0
- package/dist/plugins/clear-formatting.d.ts +10 -0
- package/dist/plugins/clear-formatting.d.ts.map +1 -0
- package/dist/plugins/color.d.ts +36 -0
- package/dist/plugins/color.d.ts.map +1 -0
- package/dist/plugins/heading.d.ts +3 -0
- package/dist/plugins/heading.d.ts.map +1 -0
- package/dist/plugins/history.d.ts +2 -0
- package/dist/plugins/history.d.ts.map +1 -0
- package/dist/plugins/image.d.ts +56 -0
- package/dist/plugins/image.d.ts.map +1 -0
- package/dist/plugins/index.d.ts +29 -0
- package/dist/plugins/index.d.ts.map +1 -0
- package/dist/plugins/link.d.ts +15 -0
- package/dist/plugins/link.d.ts.map +1 -0
- package/dist/plugins/lists.d.ts +2 -0
- package/dist/plugins/lists.d.ts.map +1 -0
- package/dist/plugins/marks.d.ts +7 -0
- package/dist/plugins/marks.d.ts.map +1 -0
- package/dist/plugins/paste.d.ts +9 -0
- package/dist/plugins/paste.d.ts.map +1 -0
- package/dist/plugins/placeholder.d.ts +3 -0
- package/dist/plugins/placeholder.d.ts.map +1 -0
- package/dist/plugins/source.d.ts +5 -0
- package/dist/plugins/source.d.ts.map +1 -0
- package/dist/plugins/table.d.ts +14 -0
- package/dist/plugins/table.d.ts.map +1 -0
- package/dist/registry-BfhH2s8N.js +19 -0
- package/dist/registry-BfhH2s8N.js.map +1 -0
- package/dist/registry.d.ts +10 -0
- package/dist/registry.d.ts.map +1 -0
- package/dist/schema.d.ts +5 -0
- package/dist/schema.d.ts.map +1 -0
- package/dist/style.css +824 -0
- package/dist/toolbar/toolbar.d.ts +56 -0
- package/dist/toolbar/toolbar.d.ts.map +1 -0
- package/dist/ui/menu.d.ts +20 -0
- package/dist/ui/menu.d.ts.map +1 -0
- package/dist/ui/popover.d.ts +29 -0
- package/dist/ui/popover.d.ts.map +1 -0
- package/dist/url.d.ts +23 -0
- package/dist/url.d.ts.map +1 -0
- package/dist/web-component.d.ts +21 -0
- package/dist/web-component.d.ts.map +1 -0
- package/dist/wysio.full.iife.js +72 -0
- package/dist/wysio.iife.js +49 -0
- package/dist/wysio.js +2668 -0
- package/dist/wysio.js.map +1 -0
- package/package.json +68 -6
- package/index.js +0 -1
package/dist/icons.d.ts
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export declare const icons: {
|
|
2
|
+
bold: string;
|
|
3
|
+
italic: string;
|
|
4
|
+
underline: string;
|
|
5
|
+
strike: string;
|
|
6
|
+
code: string;
|
|
7
|
+
bulletList: string;
|
|
8
|
+
orderedList: string;
|
|
9
|
+
blockquote: string;
|
|
10
|
+
horizontalRule: string;
|
|
11
|
+
link: string;
|
|
12
|
+
unlink: string;
|
|
13
|
+
image: string;
|
|
14
|
+
table: string;
|
|
15
|
+
tableRowBefore: string;
|
|
16
|
+
tableRowAfter: string;
|
|
17
|
+
tableColumnBefore: string;
|
|
18
|
+
tableColumnAfter: string;
|
|
19
|
+
tableDeleteRow: string;
|
|
20
|
+
tableDeleteColumn: string;
|
|
21
|
+
tableHeaderRow: string;
|
|
22
|
+
tableDelete: string;
|
|
23
|
+
alignLeft: string;
|
|
24
|
+
alignCenter: string;
|
|
25
|
+
alignRight: string;
|
|
26
|
+
alignJustify: string;
|
|
27
|
+
textColor: string;
|
|
28
|
+
highlight: string;
|
|
29
|
+
clearFormatting: string;
|
|
30
|
+
source: string;
|
|
31
|
+
undo: string;
|
|
32
|
+
redo: string;
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=icons.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../src/icons.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsDjB,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export { createEditor, defaultToolbar, Editor, type ContentFormat, type EditorErrorInfo, type EditorEvents, type EditorMode, type EditorOptions, } from './editor';
|
|
2
|
+
export { definePlugin, type ContentFormatHandler, type PluginContext, type ToolbarButton, type ToolbarButtonHandle, type ToolbarItem, type ToolbarSelect, type WysioPlugin, } from './plugin';
|
|
3
|
+
export type { Content, JSONContent } from './content';
|
|
4
|
+
export { defaultMessages, type MessageKey, type Messages } from './messages';
|
|
5
|
+
export { availableLocales, registerLocale } from './i18n';
|
|
6
|
+
export { registerPlugin } from './registry';
|
|
7
|
+
export { autoInit, getEditor } from './auto-init';
|
|
8
|
+
export { nl } from './locales/nl';
|
|
9
|
+
export { sanitizeImageUrl, sanitizeUrl } from './url';
|
|
10
|
+
export { formatHTML } from './format-html';
|
|
11
|
+
export { fitCount, type ToolbarMode } from './toolbar/toolbar';
|
|
12
|
+
export { isMarkActive, findAncestor, getMarkRange, toggleList, toggleWrap } from './commands';
|
|
13
|
+
export * from './plugins';
|
|
14
|
+
export { defineWysioElement, type WysioEditorElement } from './web-component';
|
|
15
|
+
/** Package version, injected at build time. */
|
|
16
|
+
export declare const version: string;
|
|
17
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,cAAc,EACd,MAAM,EACN,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,aAAa,GACnB,MAAM,UAAU,CAAC;AAClB,OAAO,EACL,YAAY,EACZ,KAAK,oBAAoB,EACzB,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,mBAAmB,EACxB,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB,KAAK,WAAW,GACjB,MAAM,UAAU,CAAC;AAClB,YAAY,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,KAAK,UAAU,EAAE,KAAK,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC7E,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,KAAK,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC9F,cAAc,WAAW,CAAC;AAC1B,OAAO,EAAE,kBAAkB,EAAE,KAAK,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAE9E,+CAA+C;AAC/C,eAAO,MAAM,OAAO,EAAE,MAA0B,CAAC"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/** Dutch. Terminology follows the Dutch versions of Word and Google Docs. */
|
|
2
|
+
export declare const nl: {
|
|
3
|
+
toolbar: string;
|
|
4
|
+
'toolbar.more': string;
|
|
5
|
+
editor: string;
|
|
6
|
+
bold: string;
|
|
7
|
+
italic: string;
|
|
8
|
+
underline: string;
|
|
9
|
+
strike: string;
|
|
10
|
+
code: string;
|
|
11
|
+
heading: string;
|
|
12
|
+
paragraph: string;
|
|
13
|
+
heading1: string;
|
|
14
|
+
heading2: string;
|
|
15
|
+
heading3: string;
|
|
16
|
+
heading4: string;
|
|
17
|
+
bulletList: string;
|
|
18
|
+
orderedList: string;
|
|
19
|
+
blockquote: string;
|
|
20
|
+
horizontalRule: string;
|
|
21
|
+
link: string;
|
|
22
|
+
unlink: string;
|
|
23
|
+
image: string;
|
|
24
|
+
'image.dialog': string;
|
|
25
|
+
'image.url': string;
|
|
26
|
+
'image.alt': string;
|
|
27
|
+
'image.altHint': string;
|
|
28
|
+
'image.upload': string;
|
|
29
|
+
'image.uploading': string;
|
|
30
|
+
'image.invalid': string;
|
|
31
|
+
'image.align': string;
|
|
32
|
+
'image.alignNone': string;
|
|
33
|
+
'image.alignLeft': string;
|
|
34
|
+
'image.alignCenter': string;
|
|
35
|
+
'image.alignRight': string;
|
|
36
|
+
'image.remove': string;
|
|
37
|
+
table: string;
|
|
38
|
+
'table.insert': string;
|
|
39
|
+
'table.size': string;
|
|
40
|
+
'table.cells': string;
|
|
41
|
+
'table.header': string;
|
|
42
|
+
'table.addRowBefore': string;
|
|
43
|
+
'table.addRowAfter': string;
|
|
44
|
+
'table.addColumnBefore': string;
|
|
45
|
+
'table.addColumnAfter': string;
|
|
46
|
+
'table.deleteRow': string;
|
|
47
|
+
'table.deleteColumn': string;
|
|
48
|
+
'table.toggleHeaderRow': string;
|
|
49
|
+
'table.delete': string;
|
|
50
|
+
align: string;
|
|
51
|
+
alignLeft: string;
|
|
52
|
+
alignCenter: string;
|
|
53
|
+
alignRight: string;
|
|
54
|
+
alignJustify: string;
|
|
55
|
+
textColor: string;
|
|
56
|
+
highlight: string;
|
|
57
|
+
'color.remove': string;
|
|
58
|
+
'highlight.remove': string;
|
|
59
|
+
'color.gray': string;
|
|
60
|
+
'color.red': string;
|
|
61
|
+
'color.orange': string;
|
|
62
|
+
'color.yellow': string;
|
|
63
|
+
'color.green': string;
|
|
64
|
+
'color.teal': string;
|
|
65
|
+
'color.blue': string;
|
|
66
|
+
'color.violet': string;
|
|
67
|
+
'color.pink': string;
|
|
68
|
+
clearFormatting: string;
|
|
69
|
+
source: string;
|
|
70
|
+
'source.label': string;
|
|
71
|
+
undo: string;
|
|
72
|
+
redo: string;
|
|
73
|
+
'link.dialog': string;
|
|
74
|
+
'link.url': string;
|
|
75
|
+
'link.newTab': string;
|
|
76
|
+
'dialog.apply': string;
|
|
77
|
+
'dialog.cancel': string;
|
|
78
|
+
'link.remove': string;
|
|
79
|
+
'link.invalid': string;
|
|
80
|
+
};
|
|
81
|
+
//# sourceMappingURL=nl.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nl.d.ts","sourceRoot":"","sources":["../../src/locales/nl.ts"],"names":[],"mappings":"AAEA,6EAA6E;AAC7E,eAAO,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+EuB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Node as PMNode, Schema } from 'prosemirror-model';
|
|
2
|
+
import { type WysioPlugin } from '../plugin';
|
|
3
|
+
/**
|
|
4
|
+
* Parses Markdown (CommonMark + GFM tables and strikethrough) into a document. The
|
|
5
|
+
* result is not sanitised yet: the editor does that, as for HTML input. Raw HTML in
|
|
6
|
+
* the Markdown is kept as literal text.
|
|
7
|
+
*/
|
|
8
|
+
export declare function parseMarkdown(markdown: string, schema: Schema): PMNode;
|
|
9
|
+
/**
|
|
10
|
+
* Serialises a document to Markdown. Lossy: underline, colours, highlight, alignment,
|
|
11
|
+
* link targets, image size/alignment and merged cells are dropped; GFM tables always
|
|
12
|
+
* get a header row and cells are flattened to one line.
|
|
13
|
+
*/
|
|
14
|
+
export declare function serializeMarkdown(doc: PMNode): string;
|
|
15
|
+
/** Adds the `markdown` format: `editor.getMarkdown()`, `setContent(md, { format: 'markdown' })`. */
|
|
16
|
+
export declare function markdown(): WysioPlugin;
|
|
17
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/markdown/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,IAAI,MAAM,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAQhE,OAAO,EAAgB,KAAK,WAAW,EAAE,MAAM,WAAW,CAAC;AAiP3D;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAEtE;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAErD;AAED,oGAAoG;AACpG,wBAAgB,QAAQ,IAAI,WAAW,CAUtC"}
|
package/dist/markdown.js
ADDED
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import e from "markdown-it";
|
|
2
|
+
import { MarkdownParser as t, MarkdownSerializer as n, defaultMarkdownSerializer as r } from "prosemirror-markdown";
|
|
3
|
+
import { r as i, t as a } from "./registry-BfhH2s8N.js";
|
|
4
|
+
// src/markdown/index.ts
|
|
5
|
+
function o() {
|
|
6
|
+
let t = new e("commonmark", {
|
|
7
|
+
html: !1,
|
|
8
|
+
linkify: !1
|
|
9
|
+
}).enable(["table", "strikethrough"]);
|
|
10
|
+
return t.core.ruler.push("wysio", (e) => {
|
|
11
|
+
let t = [], n = (t) => {
|
|
12
|
+
let n = new e.Token(t === 1 ? "paragraph_open" : "paragraph_close", "p", t);
|
|
13
|
+
return n.block = !0, n;
|
|
14
|
+
};
|
|
15
|
+
for (let r of e.tokens) if (r.type === "fence" || r.type === "code_block") {
|
|
16
|
+
let i = new e.Token("inline", "", 0);
|
|
17
|
+
i.children = [], r.content.replace(/\n$/, "").split("\n").forEach((t, n) => {
|
|
18
|
+
if (n && i.children.push(new e.Token("hardbreak", "br", 0)), !t) return;
|
|
19
|
+
let r = new e.Token("code_inline", "code", 0);
|
|
20
|
+
r.content = t, i.children.push(r);
|
|
21
|
+
}), t.push(n(1), i, n(-1));
|
|
22
|
+
} else r.type === "th_open" || r.type === "td_open" ? t.push(r, n(1)) : r.type === "th_close" || r.type === "td_close" ? t.push(n(-1), r) : t.push(r);
|
|
23
|
+
e.tokens = t;
|
|
24
|
+
}), t;
|
|
25
|
+
}
|
|
26
|
+
function s(e) {
|
|
27
|
+
let t = (t) => !!e.nodes[t], n = (t) => !!e.marks[t], r = { ignore: !0 };
|
|
28
|
+
return {
|
|
29
|
+
paragraph: { block: "paragraph" },
|
|
30
|
+
heading: t("heading") ? {
|
|
31
|
+
block: "heading",
|
|
32
|
+
getAttrs: (e) => ({ level: Math.min(4, Number(e.tag.slice(1))) })
|
|
33
|
+
} : { block: "paragraph" },
|
|
34
|
+
blockquote: t("blockquote") ? { block: "blockquote" } : r,
|
|
35
|
+
bullet_list: t("bullet_list") ? { block: "bullet_list" } : r,
|
|
36
|
+
ordered_list: t("ordered_list") ? {
|
|
37
|
+
block: "ordered_list",
|
|
38
|
+
getAttrs: (e) => ({ start: Number(e.attrGet("start")) || 1 })
|
|
39
|
+
} : r,
|
|
40
|
+
list_item: t("list_item") ? { block: "list_item" } : r,
|
|
41
|
+
hr: t("horizontal_rule") ? { node: "horizontal_rule" } : {
|
|
42
|
+
ignore: !0,
|
|
43
|
+
noCloseToken: !0
|
|
44
|
+
},
|
|
45
|
+
image: t("image") ? {
|
|
46
|
+
node: "image",
|
|
47
|
+
getAttrs: (e) => ({
|
|
48
|
+
src: e.attrGet("src") ?? "",
|
|
49
|
+
alt: e.content || null,
|
|
50
|
+
title: e.attrGet("title") || null
|
|
51
|
+
})
|
|
52
|
+
} : {
|
|
53
|
+
ignore: !0,
|
|
54
|
+
noCloseToken: !0
|
|
55
|
+
},
|
|
56
|
+
hardbreak: t("hard_break") ? { node: "hard_break" } : {
|
|
57
|
+
ignore: !0,
|
|
58
|
+
noCloseToken: !0
|
|
59
|
+
},
|
|
60
|
+
table: t("table") ? { block: "table" } : r,
|
|
61
|
+
thead: r,
|
|
62
|
+
tbody: r,
|
|
63
|
+
tr: t("table_row") ? { block: "table_row" } : r,
|
|
64
|
+
th: t("table_header") ? { block: "table_header" } : r,
|
|
65
|
+
td: t("table_cell") ? { block: "table_cell" } : r,
|
|
66
|
+
em: n("italic") ? { mark: "italic" } : r,
|
|
67
|
+
strong: n("bold") ? { mark: "bold" } : r,
|
|
68
|
+
s: n("strike") ? { mark: "strike" } : r,
|
|
69
|
+
link: n("link") ? {
|
|
70
|
+
mark: "link",
|
|
71
|
+
getAttrs: (e) => ({ href: e.attrGet("href") ?? "" })
|
|
72
|
+
} : r,
|
|
73
|
+
code_inline: n("code") ? {
|
|
74
|
+
mark: "code",
|
|
75
|
+
noCloseToken: !0
|
|
76
|
+
} : {
|
|
77
|
+
ignore: !0,
|
|
78
|
+
noCloseToken: !0
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
var c = {
|
|
83
|
+
open: "",
|
|
84
|
+
close: "",
|
|
85
|
+
mixable: !0
|
|
86
|
+
};
|
|
87
|
+
function l(e) {
|
|
88
|
+
let t = {
|
|
89
|
+
blockquote: r.nodes.blockquote,
|
|
90
|
+
heading: (e, t) => {
|
|
91
|
+
e.write(`${e.repeat("#", t.attrs.level)} `), e.renderInline(t, !1), e.closeBlock(t);
|
|
92
|
+
},
|
|
93
|
+
horizontal_rule: (e, t) => {
|
|
94
|
+
e.write("---"), e.closeBlock(t);
|
|
95
|
+
},
|
|
96
|
+
bullet_list: (e, t) => e.renderList(t, " ", () => "- "),
|
|
97
|
+
ordered_list: (e, t) => {
|
|
98
|
+
let n = t.attrs.start || 1, r = String(n + t.childCount - 1).length, i = e.repeat(" ", r + 2);
|
|
99
|
+
e.renderList(t, i, (t) => {
|
|
100
|
+
let i = String(n + t);
|
|
101
|
+
return `${e.repeat(" ", r - i.length)}${i}. `;
|
|
102
|
+
});
|
|
103
|
+
},
|
|
104
|
+
list_item: (e, t) => e.renderContent(t),
|
|
105
|
+
paragraph: r.nodes.paragraph,
|
|
106
|
+
image: (e, t) => {
|
|
107
|
+
let n = e.esc(t.attrs.alt ?? ""), r = t.attrs.src.replace(/[()\s]/g, (e) => encodeURIComponent(e)), i = t.attrs.title ? ` "${t.attrs.title.replace(/"/g, "\\\"")}"` : "";
|
|
108
|
+
e.write(``);
|
|
109
|
+
},
|
|
110
|
+
hard_break: r.nodes.hard_break,
|
|
111
|
+
text: r.nodes.text,
|
|
112
|
+
table: (e, t) => {
|
|
113
|
+
let n = [];
|
|
114
|
+
t.forEach((e) => {
|
|
115
|
+
let t = [];
|
|
116
|
+
e.forEach((e) => {
|
|
117
|
+
t.push(s(e));
|
|
118
|
+
for (let n = 1; n < (e.attrs.colspan || 1); n++) t.push("");
|
|
119
|
+
}), n.push(t);
|
|
120
|
+
});
|
|
121
|
+
let r = Math.max(...n.map((e) => e.length)), i = (e) => `| ${Array.from({ length: r }, (t, n) => e[n] ?? "").join(" | ")} |`;
|
|
122
|
+
[
|
|
123
|
+
i(n[0] ?? []),
|
|
124
|
+
i(Array(r).fill("---")),
|
|
125
|
+
...n.slice(1).map(i)
|
|
126
|
+
].forEach((t, n) => {
|
|
127
|
+
n && e.ensureNewLine(), e.write(t);
|
|
128
|
+
}), e.closeBlock(t);
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
for (let [n, r] of Object.entries(e.nodes)) t[n] || n === "doc" || (t[n] = r.isTextblock ? (e, t) => {
|
|
132
|
+
e.renderInline(t), e.closeBlock(t);
|
|
133
|
+
} : r.isLeaf ? () => {} : (e, t) => e.renderContent(t));
|
|
134
|
+
let i = (e) => ({
|
|
135
|
+
open: e,
|
|
136
|
+
close: e,
|
|
137
|
+
mixable: !0,
|
|
138
|
+
expelEnclosingWhitespace: !0
|
|
139
|
+
}), a = {
|
|
140
|
+
italic: i("*"),
|
|
141
|
+
bold: i("**"),
|
|
142
|
+
strike: i("~~"),
|
|
143
|
+
code: r.marks.code,
|
|
144
|
+
link: r.marks.link
|
|
145
|
+
};
|
|
146
|
+
for (let t of Object.keys(e.marks)) a[t] ??= c;
|
|
147
|
+
let o = new n(t, a, { escapeExtraCharacters: /[<>&]/g });
|
|
148
|
+
function s(e) {
|
|
149
|
+
return o.serialize(e, { tightLists: !0 }).replace(/\\\n/g, " ").replace(/\s*\n+\s*/g, " ").replace(/\|/g, "\\|").trim();
|
|
150
|
+
}
|
|
151
|
+
return o;
|
|
152
|
+
}
|
|
153
|
+
var u = o(), d = /* @__PURE__ */ new WeakMap();
|
|
154
|
+
function f(e) {
|
|
155
|
+
let n = d.get(e);
|
|
156
|
+
return n || (n = {
|
|
157
|
+
parser: new t(e, u, s(e)),
|
|
158
|
+
serializer: l(e)
|
|
159
|
+
}, d.set(e, n)), n;
|
|
160
|
+
}
|
|
161
|
+
function p(e, t) {
|
|
162
|
+
return f(t).parser.parse(e);
|
|
163
|
+
}
|
|
164
|
+
function m(e) {
|
|
165
|
+
return f(e.type.schema).serializer.serialize(e, { tightLists: !0 });
|
|
166
|
+
}
|
|
167
|
+
function h() {
|
|
168
|
+
return i({
|
|
169
|
+
name: "markdown",
|
|
170
|
+
formats: () => ({ markdown: {
|
|
171
|
+
parse: (e, t) => p(e, t),
|
|
172
|
+
serialize: m
|
|
173
|
+
} })
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
a("markdown", h);
|
|
177
|
+
export { h as markdown, p as parseMarkdown, m as serializeMarkdown };
|
|
178
|
+
|
|
179
|
+
//# sourceMappingURL=markdown.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markdown.js","names":["MarkdownIt","MarkdownParser","MarkdownSerializer","defaultMarkdownSerializer","definePlugin","registerPlugin","createTokenizer","md","state","out","paragraph","nesting","tok","inline","line","i","code","parserTokens","schema","node","name","mark","ignore","blankMark","createSerializer","nodes","start","width","space","n","alt","src","c","title","rows","row","cells","cell","cellText","columns","r","_","text","type","emphasis","open","marks","serializer","tokenizer","cache","forSchema","entry","parseMarkdown","markdown","serializeMarkdown","doc"],"sources":["../src/markdown/index.ts"],"sourcesContent":["import MarkdownIt from 'markdown-it';\nimport type { Node as PMNode, Schema } from 'prosemirror-model';\nimport {\n defaultMarkdownSerializer,\n MarkdownParser,\n MarkdownSerializer,\n type MarkdownSerializerState,\n type ParseSpec,\n} from 'prosemirror-markdown';\nimport { definePlugin, type WysioPlugin } from '../plugin';\nimport { registerPlugin } from '../registry';\n\ntype Tokenizer = InstanceType<typeof MarkdownIt>;\ntype Token = ReturnType<Tokenizer['parse']>[number];\ntype NodeSerializer = (\n state: MarkdownSerializerState,\n node: PMNode,\n parent: PMNode,\n index: number,\n) => void;\n\n/**\n * markdown-it with CommonMark + GFM tables and strikethrough. Raw HTML is off: it is\n * shown as text, never parsed.\n */\nfunction createTokenizer(): Tokenizer {\n const md = new MarkdownIt('commonmark', { html: false, linkify: false }).enable([\n 'table',\n 'strikethrough',\n ]);\n // Adapt tokens to the schema: there is no code block node, and table cells hold\n // blocks rather than inline content.\n md.core.ruler.push('wysio', (state) => {\n const out: Token[] = [];\n const paragraph = (nesting: 1 | -1) => {\n const tok = new state.Token(\n nesting === 1 ? 'paragraph_open' : 'paragraph_close',\n 'p',\n nesting,\n );\n tok.block = true;\n return tok;\n };\n for (const tok of state.tokens) {\n if (tok.type === 'fence' || tok.type === 'code_block') {\n // Each line becomes inline code, separated by hard breaks.\n const inline = new state.Token('inline', '', 0);\n inline.children = [];\n tok.content\n .replace(/\\n$/, '')\n .split('\\n')\n .forEach((line, i) => {\n if (i) inline.children!.push(new state.Token('hardbreak', 'br', 0));\n if (!line) return;\n const code = new state.Token('code_inline', 'code', 0);\n code.content = line;\n inline.children!.push(code);\n });\n out.push(paragraph(1), inline, paragraph(-1));\n } else if (tok.type === 'th_open' || tok.type === 'td_open') {\n out.push(tok, paragraph(1));\n } else if (tok.type === 'th_close' || tok.type === 'td_close') {\n out.push(paragraph(-1), tok);\n } else {\n out.push(tok);\n }\n }\n state.tokens = out;\n });\n return md;\n}\n\n/** Token mapping for the parts of the schema that exist; missing ones degrade gracefully. */\nfunction parserTokens(schema: Schema): Record<string, ParseSpec> {\n const node = (name: string) => !!schema.nodes[name];\n const mark = (name: string) => !!schema.marks[name];\n const ignore: ParseSpec = { ignore: true };\n return {\n paragraph: { block: 'paragraph' },\n heading: node('heading')\n ? { block: 'heading', getAttrs: (tok) => ({ level: Math.min(4, Number(tok.tag.slice(1))) }) }\n : { block: 'paragraph' },\n blockquote: node('blockquote') ? { block: 'blockquote' } : ignore,\n bullet_list: node('bullet_list') ? { block: 'bullet_list' } : ignore,\n ordered_list: node('ordered_list')\n ? {\n block: 'ordered_list',\n getAttrs: (tok) => ({ start: Number(tok.attrGet('start')) || 1 }),\n }\n : ignore,\n list_item: node('list_item') ? { block: 'list_item' } : ignore,\n hr: node('horizontal_rule')\n ? { node: 'horizontal_rule' }\n : { ignore: true, noCloseToken: true },\n image: node('image')\n ? {\n node: 'image',\n getAttrs: (tok) => ({\n src: tok.attrGet('src') ?? '',\n alt: tok.content || null,\n title: tok.attrGet('title') || null,\n }),\n }\n : { ignore: true, noCloseToken: true },\n hardbreak: node('hard_break') ? { node: 'hard_break' } : { ignore: true, noCloseToken: true },\n table: node('table') ? { block: 'table' } : ignore,\n thead: ignore,\n tbody: ignore,\n tr: node('table_row') ? { block: 'table_row' } : ignore,\n th: node('table_header') ? { block: 'table_header' } : ignore,\n td: node('table_cell') ? { block: 'table_cell' } : ignore,\n em: mark('italic') ? { mark: 'italic' } : ignore,\n strong: mark('bold') ? { mark: 'bold' } : ignore,\n s: mark('strike') ? { mark: 'strike' } : ignore,\n // An unsafe href is left empty here and removed by the editor's sanitising.\n link: mark('link')\n ? { mark: 'link', getAttrs: (tok) => ({ href: tok.attrGet('href') ?? '' }) }\n : ignore,\n code_inline: mark('code')\n ? { mark: 'code', noCloseToken: true }\n : { ignore: true, noCloseToken: true },\n };\n}\n\nconst blankMark = { open: '', close: '', mixable: true };\n\nfunction createSerializer(schema: Schema): MarkdownSerializer {\n const nodes: Record<string, NodeSerializer> = {\n blockquote: defaultMarkdownSerializer.nodes.blockquote!,\n heading: (state, node) => {\n state.write(`${state.repeat('#', node.attrs.level as number)} `);\n state.renderInline(node, false);\n state.closeBlock(node);\n },\n horizontal_rule: (state, node) => {\n state.write('---');\n state.closeBlock(node);\n },\n bullet_list: (state, node) => state.renderList(node, ' ', () => '- '),\n ordered_list: (state, node) => {\n const start = (node.attrs.start as number) || 1;\n const width = String(start + node.childCount - 1).length;\n const space = state.repeat(' ', width + 2);\n state.renderList(node, space, (i) => {\n const n = String(start + i);\n return `${state.repeat(' ', width - n.length)}${n}. `;\n });\n },\n list_item: (state, node) => state.renderContent(node),\n paragraph: defaultMarkdownSerializer.nodes.paragraph!,\n image: (state, node) => {\n const alt = state.esc((node.attrs.alt as string | null) ?? '');\n const src = (node.attrs.src as string).replace(/[()\\s]/g, (c) => encodeURIComponent(c));\n const title = node.attrs.title\n ? ` \"${(node.attrs.title as string).replace(/\"/g, '\\\\\"')}\"`\n : '';\n state.write(``);\n },\n hard_break: defaultMarkdownSerializer.nodes.hard_break!,\n text: defaultMarkdownSerializer.nodes.text!,\n table: (state, node) => {\n const rows: string[][] = [];\n node.forEach((row) => {\n const cells: string[] = [];\n row.forEach((cell) => {\n cells.push(cellText(cell));\n // Merged cells are not supported by GFM: pad so the columns stay aligned.\n for (let i = 1; i < ((cell.attrs.colspan as number) || 1); i++) cells.push('');\n });\n rows.push(cells);\n });\n const columns = Math.max(...rows.map((r) => r.length));\n const line = (cells: string[]) =>\n `| ${Array.from({ length: columns }, (_, i) => cells[i] ?? '').join(' | ')} |`;\n // GFM tables always have a header row: the first row is used.\n const lines = [\n line(rows[0] ?? []),\n line(Array(columns).fill('---')),\n ...rows.slice(1).map(line),\n ];\n lines.forEach((text, i) => {\n if (i) state.ensureNewLine();\n state.write(text);\n });\n state.closeBlock(node);\n },\n };\n // Anything else (e.g. nodes from custom plugins): keep the text.\n for (const [name, type] of Object.entries(schema.nodes)) {\n if (nodes[name] || name === 'doc') continue;\n nodes[name] = type.isTextblock\n ? (state, node) => {\n state.renderInline(node);\n state.closeBlock(node);\n }\n : type.isLeaf\n ? () => {}\n : (state, node) => state.renderContent(node);\n }\n\n const emphasis = (open: string) => ({\n open,\n close: open,\n mixable: true,\n expelEnclosingWhitespace: true,\n });\n const marks: Record<string, (typeof defaultMarkdownSerializer.marks)[string]> = {\n italic: emphasis('*'),\n bold: emphasis('**'),\n strike: emphasis('~~'),\n code: defaultMarkdownSerializer.marks.code!,\n link: defaultMarkdownSerializer.marks.link!,\n };\n // Underline, colours, highlight and custom marks have no Markdown equivalent.\n for (const name of Object.keys(schema.marks)) marks[name] ??= blankMark;\n\n const serializer = new MarkdownSerializer(nodes, marks, {\n // Text that looks like HTML or an entity must stay text in any Markdown renderer,\n // including ones with raw HTML enabled.\n escapeExtraCharacters: /[<>&]/g,\n });\n\n /** A table cell's blocks as one line of inline Markdown. */\n function cellText(cell: PMNode): string {\n return serializer\n .serialize(cell, { tightLists: true })\n .replace(/\\\\\\n/g, ' ')\n .replace(/\\s*\\n+\\s*/g, ' ')\n .replace(/\\|/g, '\\\\|')\n .trim();\n }\n\n return serializer;\n}\n\nconst tokenizer = createTokenizer();\nconst cache = new WeakMap<Schema, { parser: MarkdownParser; serializer: MarkdownSerializer }>();\n\nfunction forSchema(schema: Schema) {\n let entry = cache.get(schema);\n if (!entry) {\n entry = {\n parser: new MarkdownParser(schema, tokenizer, parserTokens(schema)),\n serializer: createSerializer(schema),\n };\n cache.set(schema, entry);\n }\n return entry;\n}\n\n/**\n * Parses Markdown (CommonMark + GFM tables and strikethrough) into a document. The\n * result is not sanitised yet: the editor does that, as for HTML input. Raw HTML in\n * the Markdown is kept as literal text.\n */\nexport function parseMarkdown(markdown: string, schema: Schema): PMNode {\n return forSchema(schema).parser.parse(markdown);\n}\n\n/**\n * Serialises a document to Markdown. Lossy: underline, colours, highlight, alignment,\n * link targets, image size/alignment and merged cells are dropped; GFM tables always\n * get a header row and cells are flattened to one line.\n */\nexport function serializeMarkdown(doc: PMNode): string {\n return forSchema(doc.type.schema).serializer.serialize(doc, { tightLists: true });\n}\n\n/** Adds the `markdown` format: `editor.getMarkdown()`, `setContent(md, { format: 'markdown' })`. */\nexport function markdown(): WysioPlugin {\n return definePlugin({\n name: 'markdown',\n formats: () => ({\n markdown: {\n parse: (text, schema) => parseMarkdown(text, schema),\n serialize: serializeMarkdown,\n },\n }),\n });\n}\n\n// Lets JSON configuration enable it by name: plugins: ['markdown'].\nregisterPlugin('markdown', markdown);\n"],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,GAAkBnC,GAAwB;CACtE,OAAOgC,EAAUhC,CAAM,CAAC,CAAC,OAAO,MAAMmC,CAAQ;AAChD;AAOA,SAAgBC,EAAkBC,GAAqB;CACrD,OAAOL,EAAUK,EAAI,KAAK,MAAM,CAAC,CAAC,WAAW,UAAUA,GAAK,EAAE,YAAY,GAAK,CAAC;AAClF;AAGA,SAAgBF,IAAwB;CACtC,OAAOjD,EAAa;EAClB,MAAM;EACN,gBAAgB,EACd,UAAU;GACR,QAAQsC,GAAMxB,MAAWkC,EAAcV,GAAMxB,CAAM;GACnD,WAAWoC;EACb,EACF;CACF,CAAC;AACH;AAGAjD,EAAe,YAAYgD,CAAQ"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/** English UI strings: the default and the fallback for missing keys in other locales. */
|
|
2
|
+
export declare const defaultMessages: {
|
|
3
|
+
toolbar: string;
|
|
4
|
+
'toolbar.more': string;
|
|
5
|
+
editor: string;
|
|
6
|
+
bold: string;
|
|
7
|
+
italic: string;
|
|
8
|
+
underline: string;
|
|
9
|
+
strike: string;
|
|
10
|
+
code: string;
|
|
11
|
+
heading: string;
|
|
12
|
+
paragraph: string;
|
|
13
|
+
heading1: string;
|
|
14
|
+
heading2: string;
|
|
15
|
+
heading3: string;
|
|
16
|
+
heading4: string;
|
|
17
|
+
bulletList: string;
|
|
18
|
+
orderedList: string;
|
|
19
|
+
blockquote: string;
|
|
20
|
+
horizontalRule: string;
|
|
21
|
+
link: string;
|
|
22
|
+
unlink: string;
|
|
23
|
+
image: string;
|
|
24
|
+
'image.dialog': string;
|
|
25
|
+
'image.url': string;
|
|
26
|
+
'image.alt': string;
|
|
27
|
+
'image.altHint': string;
|
|
28
|
+
'image.upload': string;
|
|
29
|
+
'image.uploading': string;
|
|
30
|
+
'image.invalid': string;
|
|
31
|
+
'image.align': string;
|
|
32
|
+
'image.alignNone': string;
|
|
33
|
+
'image.alignLeft': string;
|
|
34
|
+
'image.alignCenter': string;
|
|
35
|
+
'image.alignRight': string;
|
|
36
|
+
'image.remove': string;
|
|
37
|
+
table: string;
|
|
38
|
+
'table.insert': string;
|
|
39
|
+
'table.size': string;
|
|
40
|
+
'table.cells': string;
|
|
41
|
+
'table.header': string;
|
|
42
|
+
'table.addRowBefore': string;
|
|
43
|
+
'table.addRowAfter': string;
|
|
44
|
+
'table.addColumnBefore': string;
|
|
45
|
+
'table.addColumnAfter': string;
|
|
46
|
+
'table.deleteRow': string;
|
|
47
|
+
'table.deleteColumn': string;
|
|
48
|
+
'table.toggleHeaderRow': string;
|
|
49
|
+
'table.delete': string;
|
|
50
|
+
align: string;
|
|
51
|
+
alignLeft: string;
|
|
52
|
+
alignCenter: string;
|
|
53
|
+
alignRight: string;
|
|
54
|
+
alignJustify: string;
|
|
55
|
+
textColor: string;
|
|
56
|
+
highlight: string;
|
|
57
|
+
'color.remove': string;
|
|
58
|
+
'highlight.remove': string;
|
|
59
|
+
'color.gray': string;
|
|
60
|
+
'color.red': string;
|
|
61
|
+
'color.orange': string;
|
|
62
|
+
'color.yellow': string;
|
|
63
|
+
'color.green': string;
|
|
64
|
+
'color.teal': string;
|
|
65
|
+
'color.blue': string;
|
|
66
|
+
'color.violet': string;
|
|
67
|
+
'color.pink': string;
|
|
68
|
+
clearFormatting: string;
|
|
69
|
+
source: string;
|
|
70
|
+
'source.label': string;
|
|
71
|
+
undo: string;
|
|
72
|
+
redo: string;
|
|
73
|
+
'link.dialog': string;
|
|
74
|
+
'link.url': string;
|
|
75
|
+
'link.newTab': string;
|
|
76
|
+
'dialog.apply': string;
|
|
77
|
+
'dialog.cancel': string;
|
|
78
|
+
'link.remove': string;
|
|
79
|
+
'link.invalid': string;
|
|
80
|
+
};
|
|
81
|
+
export type MessageKey = keyof typeof defaultMessages;
|
|
82
|
+
export type Messages = Partial<Record<MessageKey, string>> & Record<string, string>;
|
|
83
|
+
//# sourceMappingURL=messages.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../src/messages.ts"],"names":[],"mappings":"AAAA,0FAA0F;AAC1F,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+E3B,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,MAAM,OAAO,eAAe,CAAC;AACtD,MAAM,MAAM,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC"}
|
package/dist/plugin.d.ts
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import type { InputRule } from 'prosemirror-inputrules';
|
|
2
|
+
import type { MarkSpec, Node as PMNode, NodeSpec, Schema } from 'prosemirror-model';
|
|
3
|
+
import type { Command, EditorState, Plugin } from 'prosemirror-state';
|
|
4
|
+
import type { Editor } from './editor';
|
|
5
|
+
export interface PluginContext {
|
|
6
|
+
schema: Schema;
|
|
7
|
+
editor: Editor;
|
|
8
|
+
}
|
|
9
|
+
interface ToolbarItemBase {
|
|
10
|
+
/** Accessible label and tooltip (already translated). Give this or `labelKey`. */
|
|
11
|
+
label?: string;
|
|
12
|
+
/** Message key for the label, translated by the toolbar (e.g. for custom items). */
|
|
13
|
+
labelKey?: string;
|
|
14
|
+
/** Whether the item can be used in the current state. Defaults to the command's dry run. */
|
|
15
|
+
isEnabled?: (state: EditorState, editor: Editor) => boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Keep the item usable in source mode and when the editor is read-only (e.g. the
|
|
18
|
+
* source toggle itself). Other items are disabled then.
|
|
19
|
+
*/
|
|
20
|
+
availableInSourceMode?: boolean;
|
|
21
|
+
}
|
|
22
|
+
export interface ToolbarButton extends ToolbarItemBase {
|
|
23
|
+
type?: 'button';
|
|
24
|
+
/** Trusted HTML (usually an inline SVG). */
|
|
25
|
+
icon: string;
|
|
26
|
+
/** Keyboard shortcut in ProseMirror notation, shown in the tooltip, e.g. `Mod-b`. */
|
|
27
|
+
shortcut?: string;
|
|
28
|
+
/** ProseMirror command to run. Focus returns to the editor afterwards. */
|
|
29
|
+
command?: Command;
|
|
30
|
+
/** Custom action, for items that open UI (e.g. the link dialog). */
|
|
31
|
+
run?: (editor: Editor) => void;
|
|
32
|
+
/** When given, the button is a toggle and reflects this state through `aria-pressed`. */
|
|
33
|
+
isActive?: (state: EditorState) => boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Key of the popover this button opens (see `getPopover`). The button then gets
|
|
36
|
+
* `aria-haspopup="dialog"` and an `aria-expanded` that follows the popover.
|
|
37
|
+
*/
|
|
38
|
+
popover?: string;
|
|
39
|
+
/** Show a dropdown caret (for buttons that open a chooser). */
|
|
40
|
+
dropdown?: boolean;
|
|
41
|
+
/** Updates the button on every state change, e.g. to show the current colour. */
|
|
42
|
+
render?: (state: EditorState, button: ToolbarButtonHandle) => void;
|
|
43
|
+
}
|
|
44
|
+
/** What `render` can change on a toolbar button. */
|
|
45
|
+
export interface ToolbarButtonHandle {
|
|
46
|
+
readonly el: HTMLButtonElement;
|
|
47
|
+
/** Replaces the icon (trusted HTML); a no-op when unchanged. */
|
|
48
|
+
setIcon: (html: string) => void;
|
|
49
|
+
}
|
|
50
|
+
export interface ToolbarSelect extends ToolbarItemBase {
|
|
51
|
+
type: 'select';
|
|
52
|
+
options: {
|
|
53
|
+
value: string;
|
|
54
|
+
label: string;
|
|
55
|
+
}[];
|
|
56
|
+
/** Current value, or `''` when the selection does not match any option. */
|
|
57
|
+
getValue: (state: EditorState) => string;
|
|
58
|
+
onSelect: (editor: Editor, value: string) => void;
|
|
59
|
+
}
|
|
60
|
+
export type ToolbarItem = ToolbarButton | ToolbarSelect;
|
|
61
|
+
/** A text format a plugin can read and write (e.g. Markdown). */
|
|
62
|
+
export interface ContentFormatHandler {
|
|
63
|
+
/** Parses text into a document. The editor sanitises the result like HTML input. */
|
|
64
|
+
parse: (text: string, schema: Schema) => PMNode;
|
|
65
|
+
serialize: (doc: PMNode) => string;
|
|
66
|
+
}
|
|
67
|
+
export interface WysioPlugin {
|
|
68
|
+
/** Unique name. */
|
|
69
|
+
name: string;
|
|
70
|
+
/** Nodes and marks this plugin adds to the schema. Order matters (see ProseMirror docs). */
|
|
71
|
+
schema?: {
|
|
72
|
+
nodes?: Record<string, NodeSpec>;
|
|
73
|
+
marks?: Record<string, MarkSpec>;
|
|
74
|
+
/**
|
|
75
|
+
* Changes node specs defined by other plugins (e.g. adding an attribute to
|
|
76
|
+
* `paragraph`). Applied after all nodes are collected; missing nodes are skipped.
|
|
77
|
+
*/
|
|
78
|
+
extendNodes?: Record<string, (spec: NodeSpec) => NodeSpec>;
|
|
79
|
+
};
|
|
80
|
+
/** Toolbar items, keyed by the name used in the `toolbar` option. */
|
|
81
|
+
toolbarItems?: (ctx: PluginContext) => Record<string, ToolbarItem>;
|
|
82
|
+
/** Key bindings, in ProseMirror notation (`Mod-b`, `Shift-Enter`). */
|
|
83
|
+
keymap?: (ctx: PluginContext) => Record<string, Command>;
|
|
84
|
+
/** Markdown-style input rules. */
|
|
85
|
+
inputRules?: (ctx: PluginContext) => InputRule[];
|
|
86
|
+
/** Text formats this plugin adds, keyed by name (e.g. `markdown`). */
|
|
87
|
+
formats?: (ctx: PluginContext) => Record<string, ContentFormatHandler>;
|
|
88
|
+
/** Any other ProseMirror plugins. */
|
|
89
|
+
prosemirrorPlugins?: (ctx: PluginContext) => Plugin[];
|
|
90
|
+
}
|
|
91
|
+
/** Identity helper that gives plugin definitions full type checking. */
|
|
92
|
+
export declare function definePlugin(plugin: WysioPlugin): WysioPlugin;
|
|
93
|
+
export {};
|
|
94
|
+
//# sourceMappingURL=plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC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E;IACtE,MAAM,CAAC,EAAE,CAAC,GAAG,EAAE,aAAa,KAAK,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACzD,kCAAkC;IAClC,UAAU,CAAC,EAAE,CAAC,GAAG,EAAE,aAAa,KAAK,SAAS,EAAE,CAAC;IACjD,sEAAsE;IACtE,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,aAAa,KAAK,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC;IACvE,qCAAqC;IACrC,kBAAkB,CAAC,EAAE,CAAC,GAAG,EAAE,aAAa,KAAK,MAAM,EAAE,CAAC;CACvD;AAED,wEAAwE;AACxE,wBAAgB,YAAY,CAAC,MAAM,EAAE,WAAW,GAAG,WAAW,CAE7D"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Command, EditorState } from 'prosemirror-state';
|
|
2
|
+
import type { Editor } from '../editor';
|
|
3
|
+
export declare const ALIGNMENTS: readonly ["left", "center", "right", "justify"];
|
|
4
|
+
export type Alignment = (typeof ALIGNMENTS)[number];
|
|
5
|
+
export declare function setAlignment(align: Alignment): Command;
|
|
6
|
+
export declare function isAlignmentActive(state: EditorState, align: Alignment): boolean;
|
|
7
|
+
/** Opens the alignment menu. */
|
|
8
|
+
export declare function openAlignmentMenu(editor: Editor): void;
|
|
9
|
+
export declare const alignment: import("..").WysioPlugin;
|
|
10
|
+
//# sourceMappingURL=alignment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alignment.d.ts","sourceRoot":"","sources":["../../src/plugins/alignment.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAMxC,eAAO,MAAM,UAAU,iDAAkD,CAAC;AAC1E,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC;AAgFpD,wBAAgB,YAAY,CAAC,KAAK,EAAE,SAAS,GAAG,OAAO,CAatD;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,SAAS,GAAG,OAAO,CAM/E;AAWD,gCAAgC;AAChC,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAmBtD;AAED,eAAO,MAAM,SAAS,0BAmCpB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The document, paragraphs and text. Always first: paragraph is the default block.
|
|
3
|
+
* Also adds the gap cursor (to reach positions next to tables, rules and images)
|
|
4
|
+
* and the drop cursor.
|
|
5
|
+
*/
|
|
6
|
+
export declare const base: import("..").WysioPlugin;
|
|
7
|
+
//# sourceMappingURL=base.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../src/plugins/base.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AACH,eAAO,MAAM,IAAI,0BAef,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blocks.d.ts","sourceRoot":"","sources":["../../src/plugins/blocks.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,UAAU,0BA2BrB,CAAC;AAEH,eAAO,MAAM,cAAc,0BAuCzB,CAAC;AAEH,eAAO,MAAM,SAAS,0BAsBpB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Command } from 'prosemirror-state';
|
|
2
|
+
/** Block attributes that count as formatting and are reset by {@link clearFormatting}. */
|
|
3
|
+
export declare const FORMATTING_ATTRIBUTES: string[];
|
|
4
|
+
/**
|
|
5
|
+
* Removes all formatting marks (links are kept) and resets formatting attributes such
|
|
6
|
+
* as alignment on the blocks in the selection. Returns false when there is nothing to clear.
|
|
7
|
+
*/
|
|
8
|
+
export declare const clearFormatting: Command;
|
|
9
|
+
export declare const clearFormattingPlugin: import("..").WysioPlugin;
|
|
10
|
+
//# sourceMappingURL=clear-formatting.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clear-formatting.d.ts","sourceRoot":"","sources":["../../src/plugins/clear-formatting.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAIjD,0FAA0F;AAC1F,eAAO,MAAM,qBAAqB,UAAY,CAAC;AAK/C;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,OAgD7B,CAAC;AAEF,eAAO,MAAM,qBAAqB,0BAWhC,CAAC"}
|