tiny-markdown-editor 0.1.32 → 0.2.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/dist/tiny-mde.js +2994 -3424
- package/dist/tiny-mde.min.js +1 -1
- package/dist/tiny-mde.tiny.js +1 -1
- package/lib/TinyMDE.d.ts +95 -0
- package/lib/TinyMDE.js +1434 -1714
- package/lib/TinyMDECommandBar.d.ts +35 -0
- package/lib/TinyMDECommandBar.js +311 -260
- package/lib/grammar.d.ts +70 -0
- package/lib/grammar.js +245 -367
- package/lib/index.d.ts +3 -0
- package/lib/index.js +9 -19
- package/lib/svg/svg.d.ts +2 -0
- package/lib/svg/svg.js +17 -21
- package/lib/tiny.d.ts +2 -0
- package/lib/tiny.js +7 -12
- package/package.json +12 -3
- package/globals.d.ts +0 -175
package/lib/index.d.ts
ADDED
package/lib/index.js
CHANGED
|
@@ -1,20 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
});
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
});
|
|
12
|
-
Object.defineProperty(exports, "Editor", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function () {
|
|
15
|
-
return _TinyMDE.default;
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
var _TinyMDECommandBar = _interopRequireDefault(require("./TinyMDECommandBar"));
|
|
19
|
-
var _TinyMDE = _interopRequireDefault(require("./TinyMDE"));
|
|
20
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.CommandBar = exports.Editor = void 0;
|
|
7
|
+
const TinyMDECommandBar_1 = __importDefault(require("./TinyMDECommandBar"));
|
|
8
|
+
exports.CommandBar = TinyMDECommandBar_1.default;
|
|
9
|
+
const TinyMDE_1 = __importDefault(require("./TinyMDE"));
|
|
10
|
+
exports.Editor = TinyMDE_1.default;
|
package/lib/svg/svg.d.ts
ADDED
package/lib/svg/svg.js
CHANGED
|
@@ -1,25 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
3
|
const svg = {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
4
|
+
blockquote: `<svg height="18" width="18"><rect width="5" height="5" x="3" y="4" ry="1"/><rect ry="1" y="4" x="10" height="5" width="5"/><path d="M8 6.999v3c0 1-1 3-1 3s-.331 1-1.331 1h-1c-1 0-.669-1-.669-1s1-2 1-3v-3zm7 0v3c0 1-1 3-1 3s-.331 1-1.331 1h-1c-1 0-.669-1-.669-1s1-2 1-3v-3z"/></svg>`,
|
|
5
|
+
bold: `<svg height="18" width="18"><path d="M4 2a1 1 0 00-1 1v12a1 1 0 001 1h6c4 0 5-2 5-4 0-1.322-.434-2.636-1.885-3.381C13.772 7.885 14 6.945 14 6c0-2-1-4-5-4zm1 2h4c1.668 0 2.32.393 2.6.672.28.279.4.662.4 1.328s-.12 1.057-.4 1.338c-.275.274-1.014.646-2.6.662H5zm5 6c1.666.005 2.318.388 2.596.666.277.278.404.667.404 1.334s-.127 1.06-.404 1.338c-.278.278-.93.66-2.596.662l-4.992.004L5 10z"/></svg>`,
|
|
6
|
+
clear_formatting: `<svg height="18" width="18"><path d="M11.03 1a1 1 0 00-.74.3l-9 9a1 1 0 000 1.4l4 4A1 1 0 006 16h2a1 1 0 00.7-.3l8-8a1 1 0 000-1.4l-5-5a1 1 0 00-.67-.3zM8.7 5.7l3.58 3.6L7.6 14H6.4l-3-3 5.3-5.3z"/><rect ry=".8" rx=".8" y="14" x="16" height="2" width="2"/><rect width="2" height="2" x="13" y="14" rx=".8" ry=".8"/><rect ry=".8" rx=".8" y="14" x="10" height="2" width="2"/></svg>`,
|
|
7
|
+
code: `<svg height="18" width="18"><path d="M13.5 2.994a.5.5 0 00-.5.5.5.5 0 000 .034V4.53a5.993 5.993 0 00-7.451-.445A6 6 0 1012.45 13.9a5.99 5.99 0 001.346-1.334.5.5 0 00.096-.101.5.5 0 00-.12-.698.5.5 0 00-.697.12l-.004-.005a5 5 0 01-1.197 1.2 5 5 0 111.215-6.965.5.5 0 00.697.12.5.5 0 00.211-.44V4.745H14V3.493a.5.5 0 00-.5-.5z"/></svg>`,
|
|
8
|
+
h1: `<svg height="18" width="18"><path d="M3 2s0-1 1-1h1c1 0 1 1 1 1v6h6V2s0-1 1-1h1c1 0 1 1 1 1v14s0 1-1 1h-1c-1 0-1-1-1-1v-6H6v6s0 1-1 1H4c-1 0-1-1-1-1z"/></svg>`,
|
|
9
|
+
h2: `<svg height="18" width="18"><path d="M4 2s0-1 1-1 1 1 1 1v6c1-1 2-1 4-1 3 0 4 2 4 4v5s0 1-1 1-1-1-1-1v-5c0-1.094-1-2-2-2-2 0-3 0-4 2v5s0 1-1 1-1-1-1-1z"/></svg>`,
|
|
10
|
+
hr: `<svg height="18" width="18"><rect ry="1" y="8" height="2" width="18" style="font-variation-settings:normal;marker:none"/></svg>`,
|
|
11
|
+
image: `<svg height="18" width="18"><path d="M1 2v14h16V2H1zm2 2h12v7l-3-3-4 4-2-2-3 3V4z"/><circle r="1.5" cy="6.5" cx="5.5"/></svg>`,
|
|
12
|
+
italic: `<svg height="18" width="18"><path d="M9 2a1 1 0 000 2L7 14a1 1 0 100 2h2a1 1 0 000-2l2-10a1 1 0 100-2z"/></svg>`,
|
|
13
|
+
link: `<svg height="18" width="18"><path d="M9.07 5.18a3.9 3.9 0 00-1.52.43C6.31 6.22 5.3 7.29 4.3 8.29c-1 1-2.07 2.02-2.68 3.26-.31.62-.5 1.33-.41 2.07.09.75.48 1.47 1.1 2.09.61.61 1.33 1 2.08 1.1.74.09 1.45-.1 2.07-.42 1.24-.61 2.26-1.68 3.26-2.68.46-.47.94-.94 1.39-1.44l-.43.26c-.68.34-1.49.56-2.36.46-.2-.03-.4-.08-.6-.14-.79.76-1.55 1.45-2.16 1.76-.38.19-.67.24-.92.21-.26-.03-.54-.14-.92-.53-.39-.38-.5-.66-.53-.91-.03-.26.02-.55.21-.93.39-.76 1.32-1.74 2.32-2.74 1-1 1.98-1.93 2.74-2.32.38-.19.67-.24.93-.21.25.03.53.14.91.53.39.38.5.66.53.92v.06l1.12-1.06.44-.47c-.18-.3-.4-.6-.67-.87-.62-.61-1.34-1-2.09-1.1a3.08 3.08 0 00-.55-.01z"/><path d="M13.07.86a3.9 3.9 0 00-1.52.43c-1.24.62-2.26 1.69-3.26 2.69-.46.47-.94.94-1.39 1.43.15-.08.28-.18.43-.25a4.4 4.4 0 012.36-.46c.2.02.4.07.6.14.79-.77 1.55-1.46 2.16-1.76.38-.19.67-.25.93-.21.25.03.53.14.91.52.39.38.5.66.53.92.03.26-.02.55-.21.93-.39.76-1.32 1.74-2.32 2.74-1 1-1.98 1.93-2.74 2.31-.38.2-.67.25-.93.22-.25-.04-.53-.15-.91-.53-.39-.38-.5-.66-.53-.92V9c-.36.33-.73.67-1.12 1.06l-.43.46c.17.3.4.6.66.87.62.62 1.34 1 2.08 1.1.75.1 1.46-.1 2.08-.41 1.24-.62 2.26-1.69 3.26-2.69s2.07-2.02 2.68-3.26c.31-.62.5-1.32.41-2.07a3.63 3.63 0 00-1.1-2.08c-.61-.62-1.33-1-2.07-1.1a3.08 3.08 0 00-.56-.02z"/></svg>`,
|
|
14
|
+
ol: `<svg height="18" width="18"><path d="M1.5 7a.5.5 0 100 1h1a.5.5 0 01.5.5c0 .164-.08.31-.14.355l-1.655 1.25A.492.492 0 001 10.5a.5.5 0 00.5.5h2a.5.5 0 000-1H3l.398-.299A1.5 1.5 0 002.5 7z"/><path d="M1.5 12c-.667 0-.667 1 0 1h1.25c.333 0 .333.5 0 .5H2.5c-.667 0-.667 1 0 1h.25c.333 0 .333.5 0 .5H1.5c-.667 0-.667 1 0 1h1c.398 0 .78-.131 1.06-.365.282-.235.44-.554.44-.885a1.121 1.121 0 00-.303-.75c.191-.204.3-.47.303-.75 0-.332-.158-.651-.44-.885-.3-.241-.675-.37-1.06-.365z"/><rect y="13" x="6" height="2" width="12" ry="1"/><rect ry="1" width="12" height="2" x="6" y="8"/><rect y="3" x="6" height="2" width="12" ry="1"/><path d="M1.5 2a.5.5 0 100 1H2v2h-.5a.5.5 0 100 1h2a.5.5 0 100-1H3V2.5c0-.277-.223-.5-.5-.5z"/></svg>`,
|
|
15
|
+
redo: `<svg height="18" width="18"><path d="M 7.2695308,2.7050781 C 8.1128755,2.7081581 8.9529895,2.8712156 9.730469,3.1347656 11.408874,3.7037121 12.90142,4.6847104 14,5.6367188 V 4 h 2 V 9 H 11 V 7 h 1.509765 C 11.59075,6.2485173 10.340208,5.453808 9.0878904,5.0292969 7.4309398,4.4676231 5.9453458,4.468717 4.7070308,5.7070312 c -1.225014,1.2250142 -1.409769,2.7206953 -0.779297,4.2968748 0.630472,1.57618 2.167475,3.158006 4.4433598,4.06836 l -0.7421878,1.855468 c -2.724115,-1.089646 -4.687112,-3.00782 -5.55664,-5.18164 -0.869528,-2.1738206 -0.554283,-4.6781393 1.220703,-6.4531252 0.923857,-0.9238568 2.015388,-1.388828 3.134765,-1.5351563 0.279845,-0.036582 0.560682,-0.053761 0.841797,-0.052734 z" /></svg>`,
|
|
16
|
+
strikethrough: `<svg width="18" height="18"><path d="M10 2C6 2 4 4 4 6c0 .338.08.672.193 1h2.34C6.113 6.629 6 6.295 6 6c0-.334.117-.725.691-1.154C7.265 4.416 8.331 4 10 4h3a1 1 0 000-2zm1.477 9c.413.368.523.706.523 1 0 .334-.127.712-.701 1.143-.575.43-1.632.85-3.299.857l-1.006.007V14H5a1 1 0 000 2h3c4 0 6-2 6-4 0-.338-.081-.672-.195-1z"/><rect ry="1" y="8" x="1" height="2" width="16"/></svg>`,
|
|
17
|
+
ul: `<svg height="18" width="18"><circle cx="2" cy="9" r="2"/><circle cy="4" cx="2" r="2"/><rect y="3" x="6" height="2" width="12" ry="1"/><circle cx="2" cy="14" r="2"/><rect ry="1" width="12" height="2" x="6" y="8"/><rect y="13" x="6" height="2" width="12" ry="1"/></svg>`,
|
|
18
|
+
undo: `<svg height="18" width="18"><path d="M 10.730469 2.7050781 C 9.8871243 2.7081594 9.0470103 2.8712156 8.2695312 3.1347656 C 6.5911256 3.7037121 5.0985797 4.6847104 4 5.6367188 L 4 4 L 2 4 L 2 9 L 7 9 L 7 7 L 5.4902344 7 C 6.4092499 6.2485173 7.6597914 5.453808 8.9121094 5.0292969 C 10.56906 4.4676231 12.054654 4.468717 13.292969 5.7070312 C 14.517983 6.9320454 14.702738 8.4277265 14.072266 10.003906 C 13.441794 11.580086 11.904791 13.161912 9.6289062 14.072266 L 10.371094 15.927734 C 13.095209 14.838088 15.058206 12.919914 15.927734 10.746094 C 16.797262 8.5722734 16.482017 6.0679547 14.707031 4.2929688 C 13.783174 3.369112 12.691643 2.9041408 11.572266 2.7578125 C 11.292421 2.7212304 11.011584 2.704051 10.730469 2.7050781 z " /></svg>
|
|
23
19
|
`
|
|
24
20
|
};
|
|
25
|
-
|
|
21
|
+
exports.default = svg;
|
package/lib/tiny.d.ts
ADDED
package/lib/tiny.js
CHANGED
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
});
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
return _TinyMDE.default;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
var _TinyMDE = _interopRequireDefault(require("./TinyMDE"));
|
|
13
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.Editor = void 0;
|
|
7
|
+
const TinyMDE_1 = __importDefault(require("./TinyMDE"));
|
|
8
|
+
exports.Editor = TinyMDE_1.default;
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tiny-markdown-editor",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "TinyMDE: A tiny, ultra low dependency, embeddable HTML/JavaScript Markdown editor.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"files": [
|
|
7
7
|
"dist/*",
|
|
8
8
|
"lib/*",
|
|
9
|
-
"
|
|
9
|
+
"lib/**/*.d.ts"
|
|
10
10
|
],
|
|
11
|
-
"types": "
|
|
11
|
+
"types": "lib/index.d.ts",
|
|
12
12
|
"keywords": [
|
|
13
13
|
"embeddable",
|
|
14
14
|
"markdown",
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
"test": "npx gulp test",
|
|
19
19
|
"build": "npx gulp",
|
|
20
20
|
"dev": "npx gulp dev",
|
|
21
|
+
"typecheck": "npx tsc --noEmit",
|
|
21
22
|
"prepublishOnly": "npx gulp prepublish",
|
|
22
23
|
"releasePatch": "npx gulp releasePatch",
|
|
23
24
|
"release": "npx gulp release"
|
|
@@ -41,16 +42,21 @@
|
|
|
41
42
|
"@babel/core": "^7.27.4",
|
|
42
43
|
"@babel/plugin-transform-modules-commonjs": "^7.27.1",
|
|
43
44
|
"@babel/preset-env": "^7.27.2",
|
|
45
|
+
"@babel/preset-typescript": "^7.27.1",
|
|
44
46
|
"@octokit/rest": "^22.0.0",
|
|
45
47
|
"@rollup/plugin-babel": "^6.0.4",
|
|
46
48
|
"@rollup/plugin-commonjs": "^28.0.3",
|
|
47
49
|
"@rollup/plugin-node-resolve": "^16.0.1",
|
|
50
|
+
"@rollup/plugin-typescript": "^12.1.1",
|
|
48
51
|
"@rollup/stream": "^3.0.1",
|
|
52
|
+
"@types/jest": "^29.5.14",
|
|
49
53
|
"autoprefixer": "^10.4.21",
|
|
50
54
|
"cssnano": "^7.0.7",
|
|
51
55
|
"del": "^8.0.0",
|
|
52
56
|
"dotenv": "^16.5.0",
|
|
53
57
|
"eslint": "^9.28.0",
|
|
58
|
+
"@typescript-eslint/eslint-plugin": "^8.20.0",
|
|
59
|
+
"@typescript-eslint/parser": "^8.20.0",
|
|
54
60
|
"express": "^5.1.0",
|
|
55
61
|
"gulp": "^5.0.1",
|
|
56
62
|
"gulp-babel": "^8.0.0",
|
|
@@ -58,6 +64,7 @@
|
|
|
58
64
|
"gulp-rename": "^2.0.0",
|
|
59
65
|
"gulp-size": "^5.0.0",
|
|
60
66
|
"gulp-terser": "^2.1.0",
|
|
67
|
+
"gulp-typescript": "^6.0.0-alpha.1",
|
|
61
68
|
"jest": "^29.7.0",
|
|
62
69
|
"jest-cli": "^29.7.0",
|
|
63
70
|
"jest-puppeteer": "^11.0.0",
|
|
@@ -66,6 +73,8 @@
|
|
|
66
73
|
"rollup": "^4.41.1",
|
|
67
74
|
"rollup-plugin-eslint": "^7.0.0",
|
|
68
75
|
"terser": "^5.40.0",
|
|
76
|
+
"tslib": "^2.8.1",
|
|
77
|
+
"typescript": "^5.7.3",
|
|
69
78
|
"vinyl-buffer": "^1.0.1",
|
|
70
79
|
"vinyl-source-stream": "^2.0.0"
|
|
71
80
|
}
|
package/globals.d.ts
DELETED
|
@@ -1,175 +0,0 @@
|
|
|
1
|
-
declare module "tiny-markdown-editor" {
|
|
2
|
-
type CursorPosition = {
|
|
3
|
-
col: number;
|
|
4
|
-
row: number;
|
|
5
|
-
node?: HTMLElement;
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
type CommonCommandName =
|
|
9
|
-
| "bold"
|
|
10
|
-
| "italic"
|
|
11
|
-
| "strikethrough"
|
|
12
|
-
| "code"
|
|
13
|
-
| "h1"
|
|
14
|
-
| "h2"
|
|
15
|
-
| "ul"
|
|
16
|
-
| "ol"
|
|
17
|
-
| "blockquote";
|
|
18
|
-
|
|
19
|
-
type CommandBarCommandName =
|
|
20
|
-
| CommonCommandName
|
|
21
|
-
| "hr"
|
|
22
|
-
| "insertLink"
|
|
23
|
-
| "insertImage";
|
|
24
|
-
|
|
25
|
-
type EditorCommandName = CommonCommandName | "h3" | "h4" | "h5" | "h6";
|
|
26
|
-
|
|
27
|
-
type ChangeEvent = {
|
|
28
|
-
content: string;
|
|
29
|
-
linesDirty: boolean[];
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
type SelectionEvent = {
|
|
33
|
-
focus: CursorPosition;
|
|
34
|
-
anchor: CursorPosition;
|
|
35
|
-
commandState: Record<EditorCommandName, boolean>;
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
type Listener<T extends "change" | "selection"> = (
|
|
39
|
-
event: T extends "change" ? ChangeEvent : SelectionEvent
|
|
40
|
-
) => void;
|
|
41
|
-
|
|
42
|
-
type EditorParams = {
|
|
43
|
-
element?: string | HTMLElement;
|
|
44
|
-
editor?: string | HTMLElement;
|
|
45
|
-
content?: string;
|
|
46
|
-
textarea?: string | HTMLElement;
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
export class Editor {
|
|
50
|
-
constructor(params?: EditorParams);
|
|
51
|
-
|
|
52
|
-
public getContent(): string;
|
|
53
|
-
|
|
54
|
-
public setContent(content: string): void;
|
|
55
|
-
|
|
56
|
-
public getSelection(getAnchor: boolean): CursorPosition | null;
|
|
57
|
-
|
|
58
|
-
public setSelection(
|
|
59
|
-
focus: CursorPosition,
|
|
60
|
-
anchor?: CursorPosition | null
|
|
61
|
-
): void;
|
|
62
|
-
|
|
63
|
-
public paste(
|
|
64
|
-
text: string,
|
|
65
|
-
anchor: CursorPosition,
|
|
66
|
-
focus: CursorPosition
|
|
67
|
-
): void;
|
|
68
|
-
|
|
69
|
-
public wrapSelection(
|
|
70
|
-
pre: string,
|
|
71
|
-
post: string,
|
|
72
|
-
anchor?: CursorPosition | null,
|
|
73
|
-
focus?: CursorPosition | null
|
|
74
|
-
): void;
|
|
75
|
-
|
|
76
|
-
public addEventListener<T extends "change" | "selection">(
|
|
77
|
-
type: T,
|
|
78
|
-
listener: Listener<T>
|
|
79
|
-
): void;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
type ModifierKey =
|
|
83
|
-
| "Ctrl"
|
|
84
|
-
| "Cmd"
|
|
85
|
-
| "Alt"
|
|
86
|
-
| "Option"
|
|
87
|
-
| "Win"
|
|
88
|
-
| "Shift"
|
|
89
|
-
| "Mod"
|
|
90
|
-
| "Mod2";
|
|
91
|
-
type AlphanumericKey =
|
|
92
|
-
| "A"
|
|
93
|
-
| "B"
|
|
94
|
-
| "C"
|
|
95
|
-
| "D"
|
|
96
|
-
| "E"
|
|
97
|
-
| "F"
|
|
98
|
-
| "G"
|
|
99
|
-
| "H"
|
|
100
|
-
| "I"
|
|
101
|
-
| "J"
|
|
102
|
-
| "K"
|
|
103
|
-
| "L"
|
|
104
|
-
| "M"
|
|
105
|
-
| "N"
|
|
106
|
-
| "O"
|
|
107
|
-
| "P"
|
|
108
|
-
| "Q"
|
|
109
|
-
| "R"
|
|
110
|
-
| "S"
|
|
111
|
-
| "T"
|
|
112
|
-
| "U"
|
|
113
|
-
| "V"
|
|
114
|
-
| "W"
|
|
115
|
-
| "X"
|
|
116
|
-
| "Y"
|
|
117
|
-
| "Z"
|
|
118
|
-
| "a"
|
|
119
|
-
| "b"
|
|
120
|
-
| "c"
|
|
121
|
-
| "d"
|
|
122
|
-
| "e"
|
|
123
|
-
| "f"
|
|
124
|
-
| "g"
|
|
125
|
-
| "h"
|
|
126
|
-
| "i"
|
|
127
|
-
| "j"
|
|
128
|
-
| "k"
|
|
129
|
-
| "l"
|
|
130
|
-
| "m"
|
|
131
|
-
| "n"
|
|
132
|
-
| "o"
|
|
133
|
-
| "p"
|
|
134
|
-
| "q"
|
|
135
|
-
| "r"
|
|
136
|
-
| "s"
|
|
137
|
-
| "t"
|
|
138
|
-
| "u"
|
|
139
|
-
| "v"
|
|
140
|
-
| "w"
|
|
141
|
-
| "x"
|
|
142
|
-
| "y"
|
|
143
|
-
| "z"
|
|
144
|
-
| "0"
|
|
145
|
-
| "1"
|
|
146
|
-
| "2"
|
|
147
|
-
| "3"
|
|
148
|
-
| "4"
|
|
149
|
-
| "5"
|
|
150
|
-
| "6"
|
|
151
|
-
| "7"
|
|
152
|
-
| "8"
|
|
153
|
-
| "9";
|
|
154
|
-
type HotKey = AlphanumericKey | `${ModifierKey}-${HotKey}`;
|
|
155
|
-
|
|
156
|
-
type CommandBarCommand =
|
|
157
|
-
| CommandBarCommandName
|
|
158
|
-
| "|"
|
|
159
|
-
| {
|
|
160
|
-
name: CommandBarCommandName | string;
|
|
161
|
-
title?: string | undefined;
|
|
162
|
-
innerHTML?: string;
|
|
163
|
-
action?: EditorCommandName | ((editor: Editor) => void);
|
|
164
|
-
hotkey?: HotKey;
|
|
165
|
-
};
|
|
166
|
-
|
|
167
|
-
type CommandBarParams = {
|
|
168
|
-
element?: string | HTMLElement;
|
|
169
|
-
editor: Editor;
|
|
170
|
-
commands?: CommandBarCommand[];
|
|
171
|
-
};
|
|
172
|
-
export class CommandBar {
|
|
173
|
-
constructor(params: CommandBarParams);
|
|
174
|
-
}
|
|
175
|
-
}
|