markupeditor 0.9.4 → 0.9.6
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 +21 -5
- package/config/behaviorconfig.json +6 -0
- package/config/keymapconfig.json +25 -0
- package/config/toolbarconfig.json +79 -0
- package/dist/custom-elements.json +2 -2
- package/dist/markup-editor.js +262 -255
- package/package.json +5 -3
package/README.md
CHANGED
|
@@ -63,6 +63,20 @@ a [VSCode extension](https://github.com/stevengharris/markupeditor-vs).
|
|
|
63
63
|
You can try the MarkupEditor out right from the [project web site](https://stevengharris.github.io/markupeditor-base/). The web site has all
|
|
64
64
|
the information you need to use the MarkupEditor in your application.
|
|
65
65
|
|
|
66
|
+
If you have `npx` installed, you can open the MarkupEditor on the demo page using
|
|
67
|
+
`npx markupeditor https://stevengharris.github.io/markupeditor-base/demo/demo.html`.
|
|
68
|
+
This uses the `muedit` script provided with the project and starts a node/express server
|
|
69
|
+
on port 3000 by default.
|
|
70
|
+
|
|
71
|
+
```
|
|
72
|
+
$ npx markupeditor https://stevengharris.github.io/markupeditor-base/demo/demo.html
|
|
73
|
+
Need to install the following packages:
|
|
74
|
+
markupeditor@0.9.4
|
|
75
|
+
Ok to proceed? (y) y
|
|
76
|
+
|
|
77
|
+
Server listening at http://localhost:3000
|
|
78
|
+
```
|
|
79
|
+
|
|
66
80
|
## Install
|
|
67
81
|
|
|
68
82
|
Clone the repository.
|
|
@@ -91,7 +105,7 @@ Build the project.
|
|
|
91
105
|
```
|
|
92
106
|
$ npm run build
|
|
93
107
|
|
|
94
|
-
> markupeditor@0.9.
|
|
108
|
+
> markupeditor@0.9.4 build
|
|
95
109
|
> rollup -c
|
|
96
110
|
|
|
97
111
|
|
|
@@ -122,7 +136,7 @@ contents of the "home" page.
|
|
|
122
136
|
```
|
|
123
137
|
$ npm run docs
|
|
124
138
|
|
|
125
|
-
> markupeditor@0.9.
|
|
139
|
+
> markupeditor@0.9.4 predocs
|
|
126
140
|
> sh predocs.sh && jsdoc -c jsdoc.json
|
|
127
141
|
|
|
128
142
|
Updating ./docs dependencies...
|
|
@@ -132,7 +146,7 @@ cp -f ./styles/markup.css ./docs/styles/markup.css
|
|
|
132
146
|
cp -f ./styles/mirror.css ./docs/styles/mirror.css
|
|
133
147
|
cp -f ./styles/toolbar.css ./docs/styles/toolbar.css
|
|
134
148
|
|
|
135
|
-
> markupeditor@0.9.
|
|
149
|
+
> markupeditor@0.9.4 docs
|
|
136
150
|
> node ./docs/index.js
|
|
137
151
|
|
|
138
152
|
Server listening at http://localhost:3000
|
|
@@ -145,8 +159,10 @@ test the web site locally.
|
|
|
145
159
|
|
|
146
160
|
## Resources
|
|
147
161
|
|
|
148
|
-
|
|
149
|
-
|
|
162
|
+
You can start with the [MarkupEditor Developer's Guide](https://stevengharris.github.io/markupeditor-base/guide/index.html),
|
|
163
|
+
or you can check out the [Resources](https://stevengharris.github.io/markupeditor-base/#resources) section of
|
|
164
|
+
the [project web site](https://stevengharris.github.io/markupeditor-base/) for links to documentation, demos, and
|
|
165
|
+
other projects using the MarkupEditor.
|
|
150
166
|
|
|
151
167
|
## Acknowledgements
|
|
152
168
|
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"undo": "Mod-z",
|
|
3
|
+
"redo": "Shift-Mod-z",
|
|
4
|
+
"link": ["Mod-K", "Mod-k"],
|
|
5
|
+
"image": ["Mod-G", "Mod-g"],
|
|
6
|
+
"p": "Ctrl-Shift-0",
|
|
7
|
+
"h1": "Ctrl-Shift-1",
|
|
8
|
+
"h2": "Ctrl-Shift-2",
|
|
9
|
+
"h3": "Ctrl-Shift-3",
|
|
10
|
+
"h4": "Ctrl-Shift-4",
|
|
11
|
+
"h5": "Ctrl-Shift-5",
|
|
12
|
+
"h6": "Ctrl-Shift-6",
|
|
13
|
+
"bullet": ["Ctrl-U", "Ctrl-u"],
|
|
14
|
+
"number": ["Ctrl-O", "Ctrl-o"],
|
|
15
|
+
"indent": ["Mod-]", "Ctrl-q"],
|
|
16
|
+
"outdent": ["Mod-[", "Shift-Ctrl-q"],
|
|
17
|
+
"bold": ["Mod-B", "Mod-b"],
|
|
18
|
+
"italic": ["Mod-I", "Mod-i"],
|
|
19
|
+
"underline": ["Mod-U", "Mod-u"],
|
|
20
|
+
"strikethrough": ["Ctrl-S", "Ctrl-s"],
|
|
21
|
+
"code": "Mod-`",
|
|
22
|
+
"subscript": "Ctrl-Mod--",
|
|
23
|
+
"superscript": "Ctrl-Mod-+",
|
|
24
|
+
"search": ["Ctrl-F", "Ctrl-f"]
|
|
25
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
{
|
|
2
|
+
"visibility": {
|
|
3
|
+
"toolbar": true,
|
|
4
|
+
"correctionBar": true,
|
|
5
|
+
"insertBar": true,
|
|
6
|
+
"styleMenu": true,
|
|
7
|
+
"styleBar": true,
|
|
8
|
+
"formatBar": true,
|
|
9
|
+
"search": true
|
|
10
|
+
},
|
|
11
|
+
"ordering": {
|
|
12
|
+
"correctionBar": 10,
|
|
13
|
+
"insertBar": 20,
|
|
14
|
+
"styleMenu": 30,
|
|
15
|
+
"styleBar": 40,
|
|
16
|
+
"formatBar": 50,
|
|
17
|
+
"search": 60
|
|
18
|
+
},
|
|
19
|
+
"insertBar": {
|
|
20
|
+
"link": true,
|
|
21
|
+
"image": true,
|
|
22
|
+
"tableMenu": true
|
|
23
|
+
},
|
|
24
|
+
"formatBar": {
|
|
25
|
+
"bold": true,
|
|
26
|
+
"italic": true,
|
|
27
|
+
"underline": true,
|
|
28
|
+
"code": true,
|
|
29
|
+
"strikethrough": true,
|
|
30
|
+
"subscript": true,
|
|
31
|
+
"superscript": true
|
|
32
|
+
},
|
|
33
|
+
"styleMenu": {
|
|
34
|
+
"p": "Body",
|
|
35
|
+
"h1": "H1",
|
|
36
|
+
"h2": "H2",
|
|
37
|
+
"h3": "H3",
|
|
38
|
+
"h4": "H4",
|
|
39
|
+
"h5": "H5",
|
|
40
|
+
"h6": "H6",
|
|
41
|
+
"pre": "Code"
|
|
42
|
+
},
|
|
43
|
+
"styleBar": {
|
|
44
|
+
"list": true,
|
|
45
|
+
"dent": true
|
|
46
|
+
},
|
|
47
|
+
"tableMenu": {
|
|
48
|
+
"header": true,
|
|
49
|
+
"border": true
|
|
50
|
+
},
|
|
51
|
+
"augmentation": {
|
|
52
|
+
"prepend": null,
|
|
53
|
+
"append": null
|
|
54
|
+
},
|
|
55
|
+
"icons": {
|
|
56
|
+
"undo": "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 0 24 24\" width=\"24px\"><path d=\"M0 0h24v24H0V0z\" fill=\"none\"/><path d=\"M12.5 8c-2.65 0-5.05.99-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z\"/></svg>",
|
|
57
|
+
"redo": "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 0 24 24\" width=\"24px\"><path d=\"M0 0h24v24H0V0z\" fill=\"none\"/><path d=\"M18.4 10.6C16.55 8.99 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16c1.05-3.19 4.05-5.5 7.6-5.5 1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z\"/></svg>",
|
|
58
|
+
"strong": "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 0 24 24\" width=\"24px\"><path d=\"M0 0h24v24H0V0z\" fill=\"none\"/><path d=\"M15.6 10.79c.97-.67 1.65-1.77 1.65-2.79 0-2.26-1.75-4-4-4H7v14h7.04c2.09 0 3.71-1.7 3.71-3.79 0-1.52-.86-2.82-2.15-3.42zM10 6.5h3c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5h-3v-3zm3.5 9H10v-3h3.5c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5z\"/></svg>",
|
|
59
|
+
"em": "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\" width=\"24px\"><path d=\"M200-200v-100h160l120-360H320v-100h400v100H580L460-300h140v100H200Z\"/></svg>",
|
|
60
|
+
"u": "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\" width=\"24px\"><path d=\"M200-120v-80h560v80H200Zm280-160q-101 0-157-63t-56-167v-330h103v336q0 56 28 91t82 35q54 0 82-35t28-91v-336h103v330q0 104-56 167t-157 63Z\"/></svg>",
|
|
61
|
+
"s": "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\" width=\"24px\"><path d=\"M486-160q-76 0-135-45t-85-123l88-38q14 48 48.5 79t85.5 31q42 0 76-20t34-64q0-18-7-33t-19-27h112q5 14 7.5 28.5T694-340q0 86-61.5 133T486-160ZM80-480v-80h800v80H80Zm402-326q66 0 115.5 32.5T674-674l-88 39q-9-29-33.5-52T484-710q-41 0-68 18.5T386-640h-96q2-69 54.5-117.5T482-806Z\"/></svg>",
|
|
62
|
+
"code": "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\" width=\"24px\"><path d=\"M560-160v-80h120q17 0 28.5-11.5T720-280v-80q0-38 22-69t58-44v-14q-36-13-58-44t-22-69v-80q0-17-11.5-28.5T680-720H560v-80h120q50 0 85 35t35 85v80q0 17 11.5 28.5T840-560h40v160h-40q-17 0-28.5 11.5T800-360v80q0 50-35 85t-85 35H560Zm-280 0q-50 0-85-35t-35-85v-80q0-17-11.5-28.5T120-400H80v-160h40q17 0 28.5-11.5T160-600v-80q0-50 35-85t85-35h120v80H280q-17 0-28.5 11.5T240-680v80q0 38-22 69t-58 44v14q36 13 58 44t22 69v80q0 17 11.5 28.5T280-240h120v80H280Z\"/></svg>",
|
|
63
|
+
"sub": "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\" width=\"24px\"><path d=\"M760-160v-80q0-17 11.5-28.5T800-280h80v-40H760v-40h120q17 0 28.5 11.5T920-320v40q0 17-11.5 28.5T880-240h-80v40h120v40H760Zm-525-80 185-291-172-269h106l124 200h4l123-200h107L539-531l186 291H618L482-457h-4L342-240H235Z\"/></svg>",
|
|
64
|
+
"sup": "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\" width=\"24px\"><path d=\"M760-600v-80q0-17 11.5-28.5T800-720h80v-40H760v-40h120q17 0 28.5 11.5T920-760v40q0 17-11.5 28.5T880-680h-80v40h120v40H760ZM235-160l185-291-172-269h106l124 200h4l123-200h107L539-451l186 291H618L482-377h-4L342-160H235Z\"/></svg>",
|
|
65
|
+
"link": "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 0 24 24\" width=\"24px\"><path d=\"M0 0h24v24H0V0z\" fill=\"none\"/><path d=\"M17 7h-4v2h4c1.65 0 3 1.35 3 3s-1.35 3-3 3h-4v2h4c2.76 0 5-2.24 5-5s-2.24-5-5-5zm-6 8H7c-1.65 0-3-1.35-3-3s1.35-3 3-3h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-2zm-3-4h8v2H8z\"/></svg>",
|
|
66
|
+
"image": "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\" width=\"24px\"><path d=\"M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm0-80h560v-560H200v560Zm40-80h480L570-480 450-320l-90-120-120 160Zm-40 80v-560 560Z\"/></svg>",
|
|
67
|
+
"table": "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\" width=\"24px\"><path d=\"M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm240-240H200v160h240v-160Zm80 0v160h240v-160H520Zm-80-80v-160H200v160h240Zm80 0h240v-160H520v160ZM200-680h560v-80H200v80Z\"/></svg>",
|
|
68
|
+
"bulletList": "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\" width=\"24px\"><path d=\"M360-200v-80h480v80H360Zm0-240v-80h480v80H360Zm0-240v-80h480v80H360ZM200-160q-33 0-56.5-23.5T120-240q0-33 23.5-56.5T200-320q33 0 56.5 23.5T280-240q0 33-23.5 56.5T200-160Zm0-240q-33 0-56.5-23.5T120-480q0-33 23.5-56.5T200-560q33 0 56.5 23.5T280-480q0 33-23.5 56.5T200-400Zm0-240q-33 0-56.5-23.5T120-720q0-33 23.5-56.5T200-800q33 0 56.5 23.5T280-720q0 33-23.5 56.5T200-640Z\"/></svg>",
|
|
69
|
+
"orderedList": "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\" width=\"24px\"><path d=\"M120-80v-60h100v-30h-60v-60h60v-30H120v-60h120q17 0 28.5 11.5T280-280v40q0 17-11.5 28.5T240-200q17 0 28.5 11.5T280-160v40q0 17-11.5 28.5T240-80H120Zm0-280v-110q0-17 11.5-28.5T160-510h60v-30H120v-60h120q17 0 28.5 11.5T280-560v70q0 17-11.5 28.5T240-450h-60v30h100v60H120Zm60-280v-180h-60v-60h120v240h-60Zm180 440v-80h480v80H360Zm0-240v-80h480v80H360Zm0-240v-80h480v80H360Z\"/></svg>",
|
|
70
|
+
"blockquote": "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\" width=\"24px\"><path d=\"M120-120v-80h720v80H120Zm320-160v-80h400v80H440Zm0-160v-80h400v80H440Zm0-160v-80h400v80H440ZM120-760v-80h720v80H120Zm0 440v-320l160 160-160 160Z\"/></svg>",
|
|
71
|
+
"lift": "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\" width=\"24px\"><path d=\"M120-120v-80h720v80H120Zm320-160v-80h400v80H440Zm0-160v-80h400v80H440Zm0-160v-80h400v80H440ZM120-760v-80h720v80H120Zm160 440L120-480l160-160v320Z\"/></svg>",
|
|
72
|
+
"search": "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\" width=\"24px\" fill=\"#1f1f1f\"><path d=\"M784-120 532-372q-30 24-69 38t-83 14q-109 0-184.5-75.5T120-580q0-109 75.5-184.5T380-840q109 0 184.5 75.5T640-580q0 44-14 83t-38 69l252 252-56 56ZM380-400q75 0 127.5-52.5T560-580q0-75-52.5-127.5T380-760q-75 0-127.5 52.5T200-580q0 75 52.5 127.5T380-400Z\"/></svg>",
|
|
73
|
+
"searchForward": "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\" width=\"24px\" fill=\"#1f1f1f\"><path d=\"M504-480 320-664l56-56 240 240-240 240-56-56 184-184Z\"/></svg>",
|
|
74
|
+
"searchBackward": "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\" width=\"24px\" fill=\"#1f1f1f\"><path d=\"M560-240 320-480l240-240 56 56-184 184 184 184-56 56Z\"/></svg>",
|
|
75
|
+
"matchCase": "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\" width=\"24px\" fill=\"#1f1f1f\"><path d=\"m131-252 165-440h79l165 440h-76l-39-112H247l-40 112h-76Zm139-176h131l-64-182h-4l-63 182Zm395 186q-51 0-81-27.5T554-342q0-44 34.5-72.5T677-443q23 0 45 4t38 11v-12q0-29-20.5-47T685-505q-23 0-42 9.5T610-468l-47-35q24-29 54.5-43t68.5-14q69 0 103 32.5t34 97.5v178h-63v-37h-4q-14 23-38 35t-53 12Zm12-54q35 0 59.5-24t24.5-56q-14-8-33.5-12.5T689-393q-32 0-50 14t-18 37q0 20 16 33t40 13Z\"/></svg>",
|
|
76
|
+
"paragraphStyle": "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\" width=\"24px\" fill=\"#1f1f1f\"><path d=\"M360-160v-240q-83 0-141.5-58.5T160-600q0-83 58.5-141.5T360-800h360v80h-80v560h-80v-560H440v560h-80Z\"/></svg>",
|
|
77
|
+
"more": "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\" width=\"24px\" fill=\"#1f1f1f\"><path d=\"M240-400q-33 0-56.5-23.5T160-480q0-33 23.5-56.5T240-560q33 0 56.5 23.5T320-480q0 33-23.5 56.5T240-400Zm240 0q-33 0-56.5-23.5T400-480q0-33 23.5-56.5T480-560q33 0 56.5 23.5T560-480q0 33-23.5 56.5T480-400Zm240 0q-33 0-56.5-23.5T640-480q0-33 23.5-56.5T720-560q33 0 56.5 23.5T800-480q0 33-23.5 56.5T720-400Z\"/></svg>"
|
|
78
|
+
}
|
|
79
|
+
}
|
|
@@ -3411,7 +3411,7 @@
|
|
|
3411
3411
|
"declarations": [
|
|
3412
3412
|
{
|
|
3413
3413
|
"kind": "class",
|
|
3414
|
-
"description": "ToolbarConfig contains static utility methods to obtain a JavaScript object with properties \nthat define the configuration of the MarkupEditor toolbar. The class makes it convenient \nto write and use the utility methods, but an instance of ToolbarConfig itself is not meaningful.\n\n`ToolbarConfig.standard()` is the default for the MarkupEditor. It can be overridden by \npassing a new ToolbarConfig by name using the `toolbar` attribute of the `<markup-editor>` \nelement. You can use the pre-defined static methods like `standard()` and customize what \nit returns, or you can use your own ToolbarConfig.\n\nTo customize the toolbar, for example, in a `userscript` named `mytoolbar.js`:\n\n```\nimport {MU} from \"src/markup-editor.js\"\nlet toolbarConfig = MU.ToolbarConfig.full(true); // Grab the full toolbar, including correction, as a baseline\ntoolbarConfig.insertBar.tableMenu = false; // Turn off table insert menu\nMU.registerConfig(toolbarConfig, \"MyToolbarConfig\") // Register the instance by name so we can reference it\n````\n\nThen, where you insert the `<markup-editor>` element, set the ToolbarConfig by name:\n\n```\n<markup-editor userscript=\"mytoolbar.js\" toolbar=\"MyToolbarConfig\">\n```\n \nTurn off entire toolbars and menus using the \"visibility\" settings. Turn off specific items\nwithin a toolbar or menu using the settings specific to that toolbar or menu. Customize \nleft-to-right ordering using the \"ordering\" settings. Specify icon SVG in the \"icon\" settings.\nUse \"augmentation\" to prepend and/or append a toolbar you define yourself.\n\nThe following properties are supported:\n\n```\n{\n \"visibility\": { // Control the visibility of toolbars, etc\n \"toolbar\": true, // Whether the toolbar is visible at all\n \"correctionBar\": true, // Whether the correction bar (undo/redo) is visible\n \"insertBar\": true, // Whether the insert bar (link, image, table) is visible\n \"styleMenu\": true, // Whether the style menu (p, h1-h6, code) is visible\n \"styleBar\": true, // Whether the style bar (bullet/numbered lists) is visible\n \"formatBar\": true, // Whether the format bar (b, i, u, etc) is visible\n \"search\": true, // Whether the search item (hide/show search bar) is visible\n },\n \"ordering\": { // Control the ordering of toolbars, etc, ascending left-to-right\n \"correctionBar\": 10, // Correction bar order if it is visible\n \"insertBar\": 20, // Insert bar (link, image, table) order if it is visible\n \"styleMenu\": 30, // Style menu (p, h1-h6, code) order if it is visible\n \"styleBar\": 40, // Style bar (bullet/numbered lists) order if it is visible\n \"formatBar\": 50, // Format bar (b, i, u, etc) order if it is visible\n \"search\": 60, // Search item (hide/show search bar) order if it is visible\n },\n \"insertBar\": {\n \"link\": true, // Whether the link menu item is visible\n \"image\": true, // Whether the image menu item is visible\n \"tableMenu\": true, // Whether the table menu is visible\n },\n \"formatBar\": {\n \"bold\": true, // Whether the bold menu item is visible\n \"italic\": true, // Whether the italic menu item is visible\n \"underline\": true, // Whether the underline menu item is visible\n \"code\": true, // Whether the code menu item is visible\n \"strikethrough\": true, // Whether the strikethrough menu item is visible\n \"subscript\": true, // Whether the subscript menu item is visible\n \"superscript\": true, // Whether the superscript menu item is visible\n },\n \"styleMenu\": {\n \"p\": \"Body\", // The label in the menu for \"P\" style\n \"h1\": \"H1\", // The label in the menu for \"H1\" style\n \"h2\": \"H2\", // The label in the menu for \"H2\" style\n \"h3\": \"H3\", // The label in the menu for \"H3\" style\n \"h4\": \"H4\", // The label in the menu for \"H4\" style\n \"h5\": \"H5\", // The label in the menu for \"H5\" style\n \"h6\": \"H6\", // The label in the menu for \"H6\" style\n \"pre\": \"Code\", // The label in the menu for \"PRE\" aka code_block style\n },\n \"styleBar\": {\n \"list\": true, // Whether bullet and numbered list items are visible\n \"dent\": true, // Whether indent and outdent items are visible\n },\n \"tableMenu\": {\n \"header\": true, // Whether the \"Header\" item is visible in the \"Table->Add\" menu\n \"border\": true, // Whether the \"Border\" item is visible in the \"Table\" menu\n },\n \"augmentation\": {\n \"prepend\": null, // Name of a registered array of cmdItems to prepend\n \"append\": null // Name of a registered array of cmdItems to append\n },\n \"icons\": {\n // <span class=\"material-icons-outlined\">undo</span>\n \"undo\": '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 0 24 24\" width=\"24px\"><path d=\"M0 0h24v24H0V0z\" fill=\"none\"/><path d=\"M12.5 8c-2.65 0-5.05.99-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z\"/></svg>',\n // <span class=\"material-icons-outlined\">redo</span>\n \"redo\": '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 0 24 24\" width=\"24px\"><path d=\"M0 0h24v24H0V0z\" fill=\"none\"/><path d=\"M18.4 10.6C16.55 8.99 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16c1.05-3.19 4.05-5.5 7.6-5.5 1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z\"/></svg>',\n // <span class=\"material-icons-outlined\">format_bold</span>\n \"strong\": '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 0 24 24\" width=\"24px\"><path d=\"M0 0h24v24H0V0z\" fill=\"none\"/><path d=\"M15.6 10.79c.97-.67 1.65-1.77 1.65-2.79 0-2.26-1.75-4-4-4H7v14h7.04c2.09 0 3.71-1.7 3.71-3.79 0-1.52-.86-2.82-2.15-3.42zM10 6.5h3c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5h-3v-3zm3.5 9H10v-3h3.5c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5z\"/></svg>',\n // <span class=\"material-icons-outlined\">format_italic</span>\n \"em\": '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\" width=\"24px\"><path d=\"M200-200v-100h160l120-360H320v-100h400v100H580L460-300h140v100H200Z\"/></svg>',\n // <span class=\"material-icons-outlined\">format_underlined</span>\n \"u\": '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\" width=\"24px\"><path d=\"M200-120v-80h560v80H200Zm280-160q-101 0-157-63t-56-167v-330h103v336q0 56 28 91t82 35q54 0 82-35t28-91v-336h103v330q0 104-56 167t-157 63Z\"/></svg>',\n // <span class=\"material-icons-outlined\">strikethrough_s</span>\n \"s\": '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\" width=\"24px\"><path d=\"M486-160q-76 0-135-45t-85-123l88-38q14 48 48.5 79t85.5 31q42 0 76-20t34-64q0-18-7-33t-19-27h112q5 14 7.5 28.5T694-340q0 86-61.5 133T486-160ZM80-480v-80h800v80H80Zm402-326q66 0 115.5 32.5T674-674l-88 39q-9-29-33.5-52T484-710q-41 0-68 18.5T386-640h-96q2-69 54.5-117.5T482-806Z\"/></svg>',\n // <span class=\"material-icons-outlined\">data_object</span>\n \"code\": '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\" width=\"24px\"><path d=\"M560-160v-80h120q17 0 28.5-11.5T720-280v-80q0-38 22-69t58-44v-14q-36-13-58-44t-22-69v-80q0-17-11.5-28.5T680-720H560v-80h120q50 0 85 35t35 85v80q0 17 11.5 28.5T840-560h40v160h-40q-17 0-28.5 11.5T800-360v80q0 50-35 85t-85 35H560Zm-280 0q-50 0-85-35t-35-85v-80q0-17-11.5-28.5T120-400H80v-160h40q17 0 28.5-11.5T160-600v-80q0-50 35-85t85-35h120v80H280q-17 0-28.5 11.5T240-680v80q0 38-22 69t-58 44v14q36 13 58 44t22 69v80q0 17 11.5 28.5T280-240h120v80H280Z\"/></svg>',\n // <span class=\"material-icons-outlined\">subscript</span>\n \"sub\": '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\" width=\"24px\"><path d=\"M760-160v-80q0-17 11.5-28.5T800-280h80v-40H760v-40h120q17 0 28.5 11.5T920-320v40q0 17-11.5 28.5T880-240h-80v40h120v40H760Zm-525-80 185-291-172-269h106l124 200h4l123-200h107L539-531l186 291H618L482-457h-4L342-240H235Z\"/></svg>',\n // <span class=\"material-icons-outlined\">superscript</span>\n \"sup\": '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\" width=\"24px\"><path d=\"M760-600v-80q0-17 11.5-28.5T800-720h80v-40H760v-40h120q17 0 28.5 11.5T920-760v40q0 17-11.5 28.5T880-680h-80v40h120v40H760ZM235-160l185-291-172-269h106l124 200h4l123-200h107L539-451l186 291H618L482-377h-4L342-160H235Z\"/></svg>',\n // <span class=\"material-icons-outlined\">link</span>\n \"link\": '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 0 24 24\" width=\"24px\"><path d=\"M0 0h24v24H0V0z\" fill=\"none\"/><path d=\"M17 7h-4v2h4c1.65 0 3 1.35 3 3s-1.35 3-3 3h-4v2h4c2.76 0 5-2.24 5-5s-2.24-5-5-5zm-6 8H7c-1.65 0-3-1.35-3-3s1.35-3 3-3h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-2zm-3-4h8v2H8z\"/></svg>',\n // <span class=\"material-icons-outlined\">image</span>\n \"image\": '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\" width=\"24px\"><path d=\"M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm0-80h560v-560H200v560Zm40-80h480L570-480 450-320l-90-120-120 160Zm-40 80v-560 560Z\"/></svg>',\n // <span class=\"material-icons-outlined\">table</span>\n \"table\": '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\" width=\"24px\"><path d=\"M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm240-240H200v160h240v-160Zm80 0v160h240v-160H520Zm-80-80v-160H200v160h240Zm80 0h240v-160H520v160ZM200-680h560v-80H200v80Z\"/></svg>',\n // <span class=\"material-icons-outlined\">format_list_bulleted</span>\n \"bulletList\": '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\" width=\"24px\"><path d=\"M360-200v-80h480v80H360Zm0-240v-80h480v80H360Zm0-240v-80h480v80H360ZM200-160q-33 0-56.5-23.5T120-240q0-33 23.5-56.5T200-320q33 0 56.5 23.5T280-240q0 33-23.5 56.5T200-160Zm0-240q-33 0-56.5-23.5T120-480q0-33 23.5-56.5T200-560q33 0 56.5 23.5T280-480q0 33-23.5 56.5T200-400Zm0-240q-33 0-56.5-23.5T120-720q0-33 23.5-56.5T200-800q33 0 56.5 23.5T280-720q0 33-23.5 56.5T200-640Z\"/></svg>',\n // <span class=\"material-icons-outlined\">format_list_numbered</span>\n \"orderedList\": '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\" width=\"24px\"><path d=\"M120-80v-60h100v-30h-60v-60h60v-30H120v-60h120q17 0 28.5 11.5T280-280v40q0 17-11.5 28.5T240-200q17 0 28.5 11.5T280-160v40q0 17-11.5 28.5T240-80H120Zm0-280v-110q0-17 11.5-28.5T160-510h60v-30H120v-60h120q17 0 28.5 11.5T280-560v70q0 17-11.5 28.5T240-450h-60v30h100v60H120Zm60-280v-180h-60v-60h120v240h-60Zm180 440v-80h480v80H360Zm0-240v-80h480v80H360Zm0-240v-80h480v80H360Z\"/></svg>',\n // <span class=\"material-icons-outlined\">format_indent_increase</span>\n \"blockquote\": '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\" width=\"24px\"><path d=\"M120-120v-80h720v80H120Zm320-160v-80h400v80H440Zm0-160v-80h400v80H440Zm0-160v-80h400v80H440ZM120-760v-80h720v80H120Zm0 440v-320l160 160-160 160Z\"/></svg>',\n // <span class=\"material-icons-outlined\">format_indent_decrease</span>\n \"lift\": '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\" width=\"24px\"><path d=\"M120-120v-80h720v80H120Zm320-160v-80h400v80H440Zm0-160v-80h400v80H440Zm0-160v-80h400v80H440ZM120-760v-80h720v80H120Zm160 440L120-480l160-160v320Z\"/></svg>',\n // <span class=\"material-symbols-outlined\">search</span>\n \"search\": '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\" width=\"24px\" fill=\"#1f1f1f\"><path d=\"M784-120 532-372q-30 24-69 38t-83 14q-109 0-184.5-75.5T120-580q0-109 75.5-184.5T380-840q109 0 184.5 75.5T640-580q0 44-14 83t-38 69l252 252-56 56ZM380-400q75 0 127.5-52.5T560-580q0-75-52.5-127.5T380-760q-75 0-127.5 52.5T200-580q0 75 52.5 127.5T380-400Z\"/></svg>',\n // <span class=\"material-symbols-outlined\">chevron_forward</span>\n \"searchForward\": '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\" width=\"24px\" fill=\"#1f1f1f\"><path d=\"M504-480 320-664l56-56 240 240-240 240-56-56 184-184Z\"/></svg>',\n // <span class=\"material-symbols-outlined\">chevron_backward</span>\n \"searchBackward\": '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\" width=\"24px\" fill=\"#1f1f1f\"><path d=\"M560-240 320-480l240-240 56 56-184 184 184 184-56 56Z\"/></svg>',\n // <span class=\"material-symbols-outlined\">match_case</span>\n \"matchCase\": '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\" width=\"24px\" fill=\"#1f1f1f\"><path d=\"m131-252 165-440h79l165 440h-76l-39-112H247l-40 112h-76Zm139-176h131l-64-182h-4l-63 182Zm395 186q-51 0-81-27.5T554-342q0-44 34.5-72.5T677-443q23 0 45 4t38 11v-12q0-29-20.5-47T685-505q-23 0-42 9.5T610-468l-47-35q24-29 54.5-43t68.5-14q69 0 103 32.5t34 97.5v178h-63v-37h-4q-14 23-38 35t-53 12Zm12-54q35 0 59.5-24t24.5-56q-14-8-33.5-12.5T689-393q-32 0-50 14t-18 37q0 20 16 33t40 13Z\"/></svg>',\n // <span class=\"material-symbols-outlined\">format_paragraph</span>\n \"paragraphStyle\": '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\" width=\"24px\" fill=\"#1f1f1f\"><path d=\"M360-160v-240q-83 0-141.5-58.5T160-600q0-83 58.5-141.5T360-800h360v80h-80v560h-80v-560H440v560h-80Z\"/></svg>',\n // <span class=\"material-symbols-outlined\">more_horiz</span>\n \"more\": '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\" width=\"24px\" fill=\"#1f1f1f\"><path d=\"M240-400q-33 0-56.5-23.5T160-480q0-33 23.5-56.5T240-560q33 0 56.5 23.5T320-480q0 33-23.5 56.5T240-400Zm240 0q-33 0-56.5-23.5T400-480q0-33 23.5-56.5T480-560q33 0 56.5 23.5T560-480q0 33-23.5 56.5T480-400Zm240 0q-33 0-56.5-23.5T640-480q0-33 23.5-56.5T720-560q33 0 56.5 23.5T800-480q0 33-23.5 56.5T720-400Z\"/></svg>'\n }\n}\n```",
|
|
3414
|
+
"description": "ToolbarConfig contains static utility methods to obtain a JavaScript object with properties \nthat define the configuration of the MarkupEditor toolbar. The class makes it convenient \nto write and use the utility methods, but an instance of ToolbarConfig itself is not meaningful.\n\n`ToolbarConfig.standard()` is the default for the MarkupEditor. It can be overridden by \npassing a new ToolbarConfig by name using the `toolbar` attribute of the `<markup-editor>` \nelement. You can use the pre-defined static methods like `standard()` and customize what \nit returns, or you can use your own ToolbarConfig.\n\nTo customize the toolbar, for example, in a `userscript` named `mytoolbar.js`:\n\n```\nimport {MU} from \"src/markup-editor.js\"\nlet toolbarConfig = MU.ToolbarConfig.full(true); // Grab the full toolbar, including correction, as a baseline\ntoolbarConfig.insertBar.tableMenu = false; // Turn off table insert menu\nMU.registerConfig(toolbarConfig, \"MyToolbarConfig\") // Register the instance by name so we can reference it\n````\n\nThen, where you insert the `<markup-editor>` element, set the ToolbarConfig by name:\n\n```\n<markup-editor userscript=\"mytoolbar.js\" toolbar=\"MyToolbarConfig\">\n```\n \nTurn off entire toolbars and menus using the \"visibility\" settings. Turn off specific items\nwithin a toolbar or menu using the settings specific to that toolbar or menu. Customize \nleft-to-right ordering using the \"ordering\" settings. Specify icon SVG in the \"icon\" settings.\nUse \"augmentation\" to prepend and/or append a toolbar you define yourself.\n\nThe following properties are supported:\n\n```\n{\n \"visibility\": { // Control the visibility of toolbars, etc\n \"toolbar\": true, // Whether the toolbar is visible at all\n \"correctionBar\": true, // Whether the correction bar (undo/redo) is visible\n \"insertBar\": true, // Whether the insert bar (link, image, table) is visible\n \"styleMenu\": true, // Whether the style menu (p, h1-h6, code) is visible\n \"styleBar\": true, // Whether the style bar (bullet/numbered lists) is visible\n \"formatBar\": true, // Whether the format bar (b, i, u, etc) is visible\n \"search\": true, // Whether the search item (hide/show search bar) is visible\n },\n \"ordering\": { // Control the ordering of toolbars, etc, ascending left-to-right\n \"correctionBar\": 10, // Correction bar order if it is visible\n \"insertBar\": 20, // Insert bar (link, image, table) order if it is visible\n \"styleMenu\": 30, // Style menu (p, h1-h6, code) order if it is visible\n \"styleBar\": 40, // Style bar (bullet/numbered lists) order if it is visible\n \"formatBar\": 50, // Format bar (b, i, u, etc) order if it is visible\n \"search\": 60, // Search item (hide/show search bar) order if it is visible\n },\n \"insertBar\": {\n \"link\": true, // Whether the link menu item is visible\n \"image\": true, // Whether the image menu item is visible\n \"tableMenu\": true, // Whether the table menu is visible\n },\n \"formatBar\": {\n \"bold\": true, // Whether the bold menu item is visible\n \"italic\": true, // Whether the italic menu item is visible\n \"underline\": true, // Whether the underline menu item is visible\n \"code\": true, // Whether the code menu item is visible\n \"strikethrough\": true, // Whether the strikethrough menu item is visible\n \"subscript\": true, // Whether the subscript menu item is visible\n \"superscript\": true, // Whether the superscript menu item is visible\n },\n \"styleMenu\": {\n \"p\": \"Body\", // The label in the menu for \"P\" style\n \"h1\": \"H1\", // The label in the menu for \"H1\" style\n \"h2\": \"H2\", // The label in the menu for \"H2\" style\n \"h3\": \"H3\", // The label in the menu for \"H3\" style\n \"h4\": \"H4\", // The label in the menu for \"H4\" style\n \"h5\": \"H5\", // The label in the menu for \"H5\" style\n \"h6\": \"H6\", // The label in the menu for \"H6\" style\n \"pre\": \"Code\", // The label in the menu for \"PRE\" aka code_block style\n },\n \"styleBar\": {\n \"list\": true, // Whether bullet and numbered list items are visible\n \"dent\": true, // Whether indent and outdent items are visible\n },\n \"tableMenu\": {\n \"header\": true, // Whether the \"Header\" item is visible in the \"Table->Add\" menu\n \"border\": true, // Whether the \"Border\" item is visible in the \"Table\" menu\n },\n \"augmentation\": {\n \"prepend\": null, // Name of a registered array of cmdItems to prepend\n \"append\": null // Name of a registered array of cmdItems to append\n },\n \"icons\": { // Outlined 400 weight versions from https://fonts.google.com/icons\n // undo\n \"undo\": \"<svg xmlns=\\\"http://www.w3.org/2000/svg\\\" height=\\\"24px\\\" viewBox=\\\"0 0 24 24\\\" width=\\\"24px\\\"><path d=\\\"M0 0h24v24H0V0z\\\" fill=\\\"none\\\"/><path d=\\\"M12.5 8c-2.65 0-5.05.99-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z\\\"/></svg>\",\n // redo\n \"redo\": \"<svg xmlns=\\\"http://www.w3.org/2000/svg\\\" height=\\\"24px\\\" viewBox=\\\"0 0 24 24\\\" width=\\\"24px\\\"><path d=\\\"M0 0h24v24H0V0z\\\" fill=\\\"none\\\"/><path d=\\\"M18.4 10.6C16.55 8.99 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16c1.05-3.19 4.05-5.5 7.6-5.5 1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z\\\"/></svg>\",\n // format_bold\n \"strong\": \"<svg xmlns=\\\"http://www.w3.org/2000/svg\\\" height=\\\"24px\\\" viewBox=\\\"0 0 24 24\\\" width=\\\"24px\\\"><path d=\\\"M0 0h24v24H0V0z\\\" fill=\\\"none\\\"/><path d=\\\"M15.6 10.79c.97-.67 1.65-1.77 1.65-2.79 0-2.26-1.75-4-4-4H7v14h7.04c2.09 0 3.71-1.7 3.71-3.79 0-1.52-.86-2.82-2.15-3.42zM10 6.5h3c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5h-3v-3zm3.5 9H10v-3h3.5c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5z\\\"/></svg>\",\n // format_italic\n \"em\": \"<svg xmlns=\\\"http://www.w3.org/2000/svg\\\" height=\\\"24px\\\" viewBox=\\\"0 -960 960 960\\\" width=\\\"24px\\\"><path d=\\\"M200-200v-100h160l120-360H320v-100h400v100H580L460-300h140v100H200Z\\\"/></svg>\",\n // format_underlined\n \"u\": \"<svg xmlns=\\\"http://www.w3.org/2000/svg\\\" height=\\\"24px\\\" viewBox=\\\"0 -960 960 960\\\" width=\\\"24px\\\"><path d=\\\"M200-120v-80h560v80H200Zm280-160q-101 0-157-63t-56-167v-330h103v336q0 56 28 91t82 35q54 0 82-35t28-91v-336h103v330q0 104-56 167t-157 63Z\\\"/></svg>\",\n // strikethrough_s\n \"s\": \"<svg xmlns=\\\"http://www.w3.org/2000/svg\\\" height=\\\"24px\\\" viewBox=\\\"0 -960 960 960\\\" width=\\\"24px\\\"><path d=\\\"M486-160q-76 0-135-45t-85-123l88-38q14 48 48.5 79t85.5 31q42 0 76-20t34-64q0-18-7-33t-19-27h112q5 14 7.5 28.5T694-340q0 86-61.5 133T486-160ZM80-480v-80h800v80H80Zm402-326q66 0 115.5 32.5T674-674l-88 39q-9-29-33.5-52T484-710q-41 0-68 18.5T386-640h-96q2-69 54.5-117.5T482-806Z\\\"/></svg>\",\n // data_object\n \"code\": \"<svg xmlns=\\\"http://www.w3.org/2000/svg\\\" height=\\\"24px\\\" viewBox=\\\"0 -960 960 960\\\" width=\\\"24px\\\"><path d=\\\"M560-160v-80h120q17 0 28.5-11.5T720-280v-80q0-38 22-69t58-44v-14q-36-13-58-44t-22-69v-80q0-17-11.5-28.5T680-720H560v-80h120q50 0 85 35t35 85v80q0 17 11.5 28.5T840-560h40v160h-40q-17 0-28.5 11.5T800-360v80q0 50-35 85t-85 35H560Zm-280 0q-50 0-85-35t-35-85v-80q0-17-11.5-28.5T120-400H80v-160h40q17 0 28.5-11.5T160-600v-80q0-50 35-85t85-35h120v80H280q-17 0-28.5 11.5T240-680v80q0 38-22 69t-58 44v14q36 13 58 44t22 69v80q0 17 11.5 28.5T280-240h120v80H280Z\\\"/></svg>\",\n // subscript\n \"sub\": \"<svg xmlns=\\\"http://www.w3.org/2000/svg\\\" height=\\\"24px\\\" viewBox=\\\"0 -960 960 960\\\" width=\\\"24px\\\"><path d=\\\"M760-160v-80q0-17 11.5-28.5T800-280h80v-40H760v-40h120q17 0 28.5 11.5T920-320v40q0 17-11.5 28.5T880-240h-80v40h120v40H760Zm-525-80 185-291-172-269h106l124 200h4l123-200h107L539-531l186 291H618L482-457h-4L342-240H235Z\\\"/></svg>\",\n // superscript\n \"sup\": \"<svg xmlns=\\\"http://www.w3.org/2000/svg\\\" height=\\\"24px\\\" viewBox=\\\"0 -960 960 960\\\" width=\\\"24px\\\"><path d=\\\"M760-600v-80q0-17 11.5-28.5T800-720h80v-40H760v-40h120q17 0 28.5 11.5T920-760v40q0 17-11.5 28.5T880-680h-80v40h120v40H760ZM235-160l185-291-172-269h106l124 200h4l123-200h107L539-451l186 291H618L482-377h-4L342-160H235Z\\\"/></svg>\",\n // link\n \"link\": \"<svg xmlns=\\\"http://www.w3.org/2000/svg\\\" height=\\\"24px\\\" viewBox=\\\"0 0 24 24\\\" width=\\\"24px\\\"><path d=\\\"M0 0h24v24H0V0z\\\" fill=\\\"none\\\"/><path d=\\\"M17 7h-4v2h4c1.65 0 3 1.35 3 3s-1.35 3-3 3h-4v2h4c2.76 0 5-2.24 5-5s-2.24-5-5-5zm-6 8H7c-1.65 0-3-1.35-3-3s1.35-3 3-3h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-2zm-3-4h8v2H8z\\\"/></svg>\",\n // image\n \"image\": \"<svg xmlns=\\\"http://www.w3.org/2000/svg\\\" height=\\\"24px\\\" viewBox=\\\"0 -960 960 960\\\" width=\\\"24px\\\"><path d=\\\"M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm0-80h560v-560H200v560Zm40-80h480L570-480 450-320l-90-120-120 160Zm-40 80v-560 560Z\\\"/></svg>\",\n // table\n \"table\": \"<svg xmlns=\\\"http://www.w3.org/2000/svg\\\" height=\\\"24px\\\" viewBox=\\\"0 -960 960 960\\\" width=\\\"24px\\\"><path d=\\\"M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm240-240H200v160h240v-160Zm80 0v160h240v-160H520Zm-80-80v-160H200v160h240Zm80 0h240v-160H520v160ZM200-680h560v-80H200v80Z\\\"/></svg>\",\n // format_list_bulleted\n \"bulletList\": \"<svg xmlns=\\\"http://www.w3.org/2000/svg\\\" height=\\\"24px\\\" viewBox=\\\"0 -960 960 960\\\" width=\\\"24px\\\"><path d=\\\"M360-200v-80h480v80H360Zm0-240v-80h480v80H360Zm0-240v-80h480v80H360ZM200-160q-33 0-56.5-23.5T120-240q0-33 23.5-56.5T200-320q33 0 56.5 23.5T280-240q0 33-23.5 56.5T200-160Zm0-240q-33 0-56.5-23.5T120-480q0-33 23.5-56.5T200-560q33 0 56.5 23.5T280-480q0 33-23.5 56.5T200-400Zm0-240q-33 0-56.5-23.5T120-720q0-33 23.5-56.5T200-800q33 0 56.5 23.5T280-720q0 33-23.5 56.5T200-640Z\\\"/></svg>\",\n // format_list_numbered\n \"orderedList\": \"<svg xmlns=\\\"http://www.w3.org/2000/svg\\\" height=\\\"24px\\\" viewBox=\\\"0 -960 960 960\\\" width=\\\"24px\\\"><path d=\\\"M120-80v-60h100v-30h-60v-60h60v-30H120v-60h120q17 0 28.5 11.5T280-280v40q0 17-11.5 28.5T240-200q17 0 28.5 11.5T280-160v40q0 17-11.5 28.5T240-80H120Zm0-280v-110q0-17 11.5-28.5T160-510h60v-30H120v-60h120q17 0 28.5 11.5T280-560v70q0 17-11.5 28.5T240-450h-60v30h100v60H120Zm60-280v-180h-60v-60h120v240h-60Zm180 440v-80h480v80H360Zm0-240v-80h480v80H360Zm0-240v-80h480v80H360Z\\\"/></svg>\",\n // format_indent_increase\n \"blockquote\": \"<svg xmlns=\\\"http://www.w3.org/2000/svg\\\" height=\\\"24px\\\" viewBox=\\\"0 -960 960 960\\\" width=\\\"24px\\\"><path d=\\\"M120-120v-80h720v80H120Zm320-160v-80h400v80H440Zm0-160v-80h400v80H440Zm0-160v-80h400v80H440ZM120-760v-80h720v80H120Zm0 440v-320l160 160-160 160Z\\\"/></svg>\",\n // format_indent_decrease\n \"lift\": \"<svg xmlns=\\\"http://www.w3.org/2000/svg\\\" height=\\\"24px\\\" viewBox=\\\"0 -960 960 960\\\" width=\\\"24px\\\"><path d=\\\"M120-120v-80h720v80H120Zm320-160v-80h400v80H440Zm0-160v-80h400v80H440Zm0-160v-80h400v80H440ZM120-760v-80h720v80H120Zm160 440L120-480l160-160v320Z\\\"/></svg>\",\n // search\n \"search\": \"<svg xmlns=\\\"http://www.w3.org/2000/svg\\\" height=\\\"24px\\\" viewBox=\\\"0 -960 960 960\\\" width=\\\"24px\\\" fill=\\\"#1f1f1f\\\"><path d=\\\"M784-120 532-372q-30 24-69 38t-83 14q-109 0-184.5-75.5T120-580q0-109 75.5-184.5T380-840q109 0 184.5 75.5T640-580q0 44-14 83t-38 69l252 252-56 56ZM380-400q75 0 127.5-52.5T560-580q0-75-52.5-127.5T380-760q-75 0-127.5 52.5T200-580q0 75 52.5 127.5T380-400Z\\\"/></svg>\",\n // chevron_forward\n \"searchForward\": \"<svg xmlns=\\\"http://www.w3.org/2000/svg\\\" height=\\\"24px\\\" viewBox=\\\"0 -960 960 960\\\" width=\\\"24px\\\" fill=\\\"#1f1f1f\\\"><path d=\\\"M504-480 320-664l56-56 240 240-240 240-56-56 184-184Z\\\"/></svg>\",\n // chevron_backward\n \"searchBackward\": \"<svg xmlns=\\\"http://www.w3.org/2000/svg\\\" height=\\\"24px\\\" viewBox=\\\"0 -960 960 960\\\" width=\\\"24px\\\" fill=\\\"#1f1f1f\\\"><path d=\\\"M560-240 320-480l240-240 56 56-184 184 184 184-56 56Z\\\"/></svg>\",\n // match_case\n \"matchCase\": \"<svg xmlns=\\\"http://www.w3.org/2000/svg\\\" height=\\\"24px\\\" viewBox=\\\"0 -960 960 960\\\" width=\\\"24px\\\" fill=\\\"#1f1f1f\\\"><path d=\\\"m131-252 165-440h79l165 440h-76l-39-112H247l-40 112h-76Zm139-176h131l-64-182h-4l-63 182Zm395 186q-51 0-81-27.5T554-342q0-44 34.5-72.5T677-443q23 0 45 4t38 11v-12q0-29-20.5-47T685-505q-23 0-42 9.5T610-468l-47-35q24-29 54.5-43t68.5-14q69 0 103 32.5t34 97.5v178h-63v-37h-4q-14 23-38 35t-53 12Zm12-54q35 0 59.5-24t24.5-56q-14-8-33.5-12.5T689-393q-32 0-50 14t-18 37q0 20 16 33t40 13Z\\\"/></svg>\",\n // format_paragraph\n \"paragraphStyle\": \"<svg xmlns=\\\"http://www.w3.org/2000/svg\\\" height=\\\"24px\\\" viewBox=\\\"0 -960 960 960\\\" width=\\\"24px\\\" fill=\\\"#1f1f1f\\\"><path d=\\\"M360-160v-240q-83 0-141.5-58.5T160-600q0-83 58.5-141.5T360-800h360v80h-80v560h-80v-560H440v560h-80Z\\\"/></svg>\",\n // more_horiz\n \"more\": \"<svg xmlns=\\\"http://www.w3.org/2000/svg\\\" height=\\\"24px\\\" viewBox=\\\"0 -960 960 960\\\" width=\\\"24px\\\" fill=\\\"#1f1f1f\\\"><path d=\\\"M240-400q-33 0-56.5-23.5T160-480q0-33 23.5-56.5T240-560q33 0 56.5 23.5T320-480q0 33-23.5 56.5T240-400Zm240 0q-33 0-56.5-23.5T400-480q0-33 23.5-56.5T480-560q33 0 56.5 23.5T560-480q0 33-23.5 56.5T480-400Zm240 0q-33 0-56.5-23.5T640-480q0-33 23.5-56.5T720-560q33 0 56.5 23.5T800-480q0 33-23.5 56.5T720-400Z\\\"/></svg>\"\n }\n}\n```",
|
|
3415
3415
|
"name": "ToolbarConfig",
|
|
3416
3416
|
"members": [
|
|
3417
3417
|
{
|
|
@@ -3569,7 +3569,7 @@
|
|
|
3569
3569
|
"declarations": [
|
|
3570
3570
|
{
|
|
3571
3571
|
"kind": "class",
|
|
3572
|
-
"description": "KeymapConfig contains static utility methods to obtain a JavaScript object with properties \nthat define the key
|
|
3572
|
+
"description": "KeymapConfig contains static utility methods to obtain a JavaScript object with properties \nthat define the key mapping configuration of the MarkupEditor toolbar. The class makes it convenient \nto write and use the utility methods, but an instance of KeymapConfig itself is not meaningful.\n\n`KeymapConfig.standard()` is the default for the MarkupEditor. It can be overridden by \npassing a new KeymapConfig by name using the `keymap` attribute of the `<markup-editor>` \nelement. You can use the pre-defined static methods like `standard()` and customize what \nit returns, or you can use your own KeymapConfig.\n\nTo customize the key mapping, for example, in a `userscript` named `mykeymap.js`:\n\n```\nimport {MU} from \"src/markup-editor.js\"\nlet keymapConfig = MU.KeymapConfig.standard(); // Grab the standard keymap config as a baseline\nkeymapConfig.link = [\"Ctrl-L\", \"Ctrl-l\"]; // Use Control+L instead of Command+k\nMU.registerConfig(keymapConfig, \"MyKeymapConfig\") // Register the instance by name so we can reference it\n```\n\nThen, where you insert the `<markup-editor>` element, set the KeymapConfig by name:\n\n```\n<markup-editor userscript=\"mykeymap.js\" keymap=\"MyKeymapConfig\">\n```\n \nNote that the key mapping will exist and work regardless of whether you disable a toolbar \nor a specific item in a menu. For example, undo/redo by default map to Mod-z/Shift-Mod-z even \nthough the \"correctionBar\" is off by default in the MarkupEditor. You can remove a key mapping \nby setting its value to null or an empty string. \n\nThe following properties are supported:\n\n```\n{\n // Correction\n \"undo\": \"Mod-z\",\n \"redo\": \"Shift-Mod-z\",\n // Insert\n \"link\": [\"Mod-K\", \"Mod-k\"],\n \"image\": [\"Mod-G\", \"Mod-g\"],\n //\"table\": [\"Mod-T\", \"Mod-t\"], // Does not work\n // Stylemenu\n \"p\": \"Ctrl-Shift-0\",\n \"h1\": \"Ctrl-Shift-1\",\n \"h2\": \"Ctrl-Shift-2\",\n \"h3\": \"Ctrl-Shift-3\",\n \"h4\": \"Ctrl-Shift-4\",\n \"h5\": \"Ctrl-Shift-5\",\n \"h6\": \"Ctrl-Shift-6\",\n // Stylebar\n \"bullet\": [\"Ctrl-U\", \"Ctrl-u\"],\n \"number\": [\"Ctrl-O\", \"Ctrl-o\"],\n \"indent\": [\"Mod-]\", \"Ctrl-q\"],\n \"outdent\": [\"Mod-[\", \"Shift-Ctrl-q\"],\n // Format\n \"bold\": [\"Mod-B\", \"Mod-b\"],\n \"italic\": [\"Mod-I\", \"Mod-i\"],\n \"underline\": [\"Mod-U\", \"Mod-u\"],\n \"strikethrough\": [\"Ctrl-S\", \"Ctrl-s\"],\n \"code\": \"Mod-`\",\n \"subscript\": \"Ctrl-Mod--\",\n \"superscript\": \"Ctrl-Mod-+\",\n // Search\n \"search\": [\"Ctrl-F\", \"Ctrl-f\"],\n}\n```",
|
|
3573
3573
|
"name": "KeymapConfig",
|
|
3574
3574
|
"members": [
|
|
3575
3575
|
{
|
package/dist/markup-editor.js
CHANGED
|
@@ -13023,7 +13023,7 @@ for (var i = 65; i <= 90; i++) {
|
|
|
13023
13023
|
}
|
|
13024
13024
|
|
|
13025
13025
|
// For each code that doesn't have a shift-equivalent, copy the base name
|
|
13026
|
-
for (var code in base) if (!shift.hasOwnProperty(code)) shift[code] = base[code];
|
|
13026
|
+
for (var code$1 in base) if (!shift.hasOwnProperty(code$1)) shift[code$1] = base[code$1];
|
|
13027
13027
|
|
|
13028
13028
|
function keyName(event) {
|
|
13029
13029
|
// On macOS, keys held with Shift and Cmd don't reflect the effect of Shift in `.key`.
|
|
@@ -16118,7 +16118,7 @@ function history(config = {}) {
|
|
|
16118
16118
|
handleDOMEvents: {
|
|
16119
16119
|
beforeinput(view, e) {
|
|
16120
16120
|
let inputType = e.inputType;
|
|
16121
|
-
let command = inputType == "historyUndo" ? undo : inputType == "historyRedo" ? redo : null;
|
|
16121
|
+
let command = inputType == "historyUndo" ? undo$1 : inputType == "historyRedo" ? redo$1 : null;
|
|
16122
16122
|
if (!command || !view.editable)
|
|
16123
16123
|
return false;
|
|
16124
16124
|
e.preventDefault();
|
|
@@ -16144,11 +16144,11 @@ function buildCommand(redo, scroll) {
|
|
|
16144
16144
|
/**
|
|
16145
16145
|
A command function that undoes the last change, if any.
|
|
16146
16146
|
*/
|
|
16147
|
-
const undo = buildCommand(false, true);
|
|
16147
|
+
const undo$1 = buildCommand(false, true);
|
|
16148
16148
|
/**
|
|
16149
16149
|
A command function that redoes the last undone change, if any.
|
|
16150
16150
|
*/
|
|
16151
|
-
const redo = buildCommand(true, true);
|
|
16151
|
+
const redo$1 = buildCommand(true, true);
|
|
16152
16152
|
|
|
16153
16153
|
/**
|
|
16154
16154
|
* Define various arrays of tags used to represent MarkupEditor-specific concepts.
|
|
@@ -17572,7 +17572,7 @@ function updateNode(node, targetListType, targetListItemType, listTypes, listIte
|
|
|
17572
17572
|
* Else, put into a blockquote to indent.
|
|
17573
17573
|
*
|
|
17574
17574
|
*/
|
|
17575
|
-
function indent() {
|
|
17575
|
+
function indent$1() {
|
|
17576
17576
|
const view = activeView();
|
|
17577
17577
|
let command = indentCommand();
|
|
17578
17578
|
return command(view.state, view.dispatch, view)
|
|
@@ -17584,6 +17584,7 @@ function indentCommand() {
|
|
|
17584
17584
|
let li = state.schema.nodes.list_item;
|
|
17585
17585
|
let ul = state.schema.nodes.bullet_list;
|
|
17586
17586
|
let ol = state.schema.nodes.ordered_list;
|
|
17587
|
+
let div = state.schema.nodes.div;
|
|
17587
17588
|
const { $from, $to } = state.selection;
|
|
17588
17589
|
let tr = state.tr;
|
|
17589
17590
|
let willWrap = false;
|
|
@@ -17639,7 +17640,8 @@ function indentCommand() {
|
|
|
17639
17640
|
// Find the parents to skip as we try to indent ones above us
|
|
17640
17641
|
parentsInSelection = allParents.filter((np) => {
|
|
17641
17642
|
let npNode = np.node;
|
|
17642
|
-
|
|
17643
|
+
if (npNode.type == div) return true // Always skip divs
|
|
17644
|
+
let npIsList = (npNode.type == ul) || (npNode.type == ol);
|
|
17643
17645
|
if (!npIsList) return false // We are only skipping lists
|
|
17644
17646
|
if (npNode.type != node.type) return false // We are only skipping parent lists of same type
|
|
17645
17647
|
// And only lists outside of the original selection
|
|
@@ -17649,8 +17651,9 @@ function indentCommand() {
|
|
|
17649
17651
|
} else {
|
|
17650
17652
|
parentsInSelection = allParents.filter((np) => {
|
|
17651
17653
|
let npNode = np.node;
|
|
17652
|
-
|
|
17653
|
-
|
|
17654
|
+
if (npNode.type == div) return true // Always skip divs
|
|
17655
|
+
let npIsBlockquoteOrDiv = (npNode.type == blockquote);
|
|
17656
|
+
if (!npIsBlockquoteOrDiv) return false // We are only skipping blockquotes
|
|
17654
17657
|
// And only blockquotes outside of the original selection
|
|
17655
17658
|
return (np.start < $from.pos) && (np.end > $to.pos)
|
|
17656
17659
|
});
|
|
@@ -17684,7 +17687,7 @@ function indentCommand() {
|
|
|
17684
17687
|
* happens, we should probably just do the equivalent of toggleListType.
|
|
17685
17688
|
*
|
|
17686
17689
|
*/
|
|
17687
|
-
function outdent() {
|
|
17690
|
+
function outdent$1() {
|
|
17688
17691
|
const view = activeView();
|
|
17689
17692
|
let command = outdentCommand();
|
|
17690
17693
|
return command(view.state, view.dispatch, view)
|
|
@@ -18394,7 +18397,7 @@ function doUndo() {
|
|
|
18394
18397
|
*/
|
|
18395
18398
|
function undoCommand() {
|
|
18396
18399
|
let commandAdapter = (state, dispatch, view) => {
|
|
18397
|
-
let result = undo(state, dispatch);
|
|
18400
|
+
let result = undo$1(state, dispatch);
|
|
18398
18401
|
if (result && dispatch) {
|
|
18399
18402
|
stateChanged(view);
|
|
18400
18403
|
}
|
|
@@ -18417,7 +18420,7 @@ function doRedo() {
|
|
|
18417
18420
|
*/
|
|
18418
18421
|
function redoCommand() {
|
|
18419
18422
|
let commandAdapter = (state, dispatch, view) => {
|
|
18420
|
-
let result = redo(state, dispatch, view);
|
|
18423
|
+
let result = redo$1(state, dispatch, view);
|
|
18421
18424
|
if (result && dispatch) {
|
|
18422
18425
|
stateChanged(view);
|
|
18423
18426
|
}
|
|
@@ -18488,7 +18491,7 @@ function testPasteTextPreprocessing(html) {
|
|
|
18488
18491
|
*
|
|
18489
18492
|
* @param {string} url The url/href to use for the link
|
|
18490
18493
|
*/
|
|
18491
|
-
function insertLink(url) {
|
|
18494
|
+
function insertLink$1(url) {
|
|
18492
18495
|
const view = activeView();
|
|
18493
18496
|
let command = insertLinkCommand(url);
|
|
18494
18497
|
let result = command(view.state, view.dispatch, view);
|
|
@@ -18735,7 +18738,7 @@ function selectFullLink(view) {
|
|
|
18735
18738
|
* @param {string} src The url of the image.
|
|
18736
18739
|
* @param {string} alt The alt text describing the image.
|
|
18737
18740
|
*/
|
|
18738
|
-
function insertImage(src, alt) {
|
|
18741
|
+
function insertImage$1(src, alt) {
|
|
18739
18742
|
const view = activeView();
|
|
18740
18743
|
let command = insertImageCommand(src, alt);
|
|
18741
18744
|
return command(view.state, view.dispatch, view)
|
|
@@ -19385,6 +19388,95 @@ function consoleLog(string) {
|
|
|
19385
19388
|
_callback(JSON.stringify(messageDict));
|
|
19386
19389
|
}
|
|
19387
19390
|
|
|
19391
|
+
var visibility = {
|
|
19392
|
+
toolbar: true,
|
|
19393
|
+
correctionBar: true,
|
|
19394
|
+
insertBar: true,
|
|
19395
|
+
styleMenu: true,
|
|
19396
|
+
styleBar: true,
|
|
19397
|
+
formatBar: true,
|
|
19398
|
+
search: true
|
|
19399
|
+
};
|
|
19400
|
+
var ordering = {
|
|
19401
|
+
correctionBar: 10,
|
|
19402
|
+
insertBar: 20,
|
|
19403
|
+
styleMenu: 30,
|
|
19404
|
+
styleBar: 40,
|
|
19405
|
+
formatBar: 50,
|
|
19406
|
+
search: 60
|
|
19407
|
+
};
|
|
19408
|
+
var insertBar = {
|
|
19409
|
+
link: true,
|
|
19410
|
+
image: true,
|
|
19411
|
+
tableMenu: true
|
|
19412
|
+
};
|
|
19413
|
+
var formatBar = {
|
|
19414
|
+
bold: true,
|
|
19415
|
+
italic: true,
|
|
19416
|
+
underline: true,
|
|
19417
|
+
code: true,
|
|
19418
|
+
strikethrough: true,
|
|
19419
|
+
subscript: true,
|
|
19420
|
+
superscript: true
|
|
19421
|
+
};
|
|
19422
|
+
var styleMenu = {
|
|
19423
|
+
p: "Body",
|
|
19424
|
+
h1: "H1",
|
|
19425
|
+
h2: "H2",
|
|
19426
|
+
h3: "H3",
|
|
19427
|
+
h4: "H4",
|
|
19428
|
+
h5: "H5",
|
|
19429
|
+
h6: "H6",
|
|
19430
|
+
pre: "Code"
|
|
19431
|
+
};
|
|
19432
|
+
var styleBar = {
|
|
19433
|
+
list: true,
|
|
19434
|
+
dent: true
|
|
19435
|
+
};
|
|
19436
|
+
var tableMenu = {
|
|
19437
|
+
header: true,
|
|
19438
|
+
border: true
|
|
19439
|
+
};
|
|
19440
|
+
var augmentation = {
|
|
19441
|
+
prepend: null,
|
|
19442
|
+
append: null
|
|
19443
|
+
};
|
|
19444
|
+
var icons = {
|
|
19445
|
+
undo: "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 0 24 24\" width=\"24px\"><path d=\"M0 0h24v24H0V0z\" fill=\"none\"/><path d=\"M12.5 8c-2.65 0-5.05.99-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z\"/></svg>",
|
|
19446
|
+
redo: "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 0 24 24\" width=\"24px\"><path d=\"M0 0h24v24H0V0z\" fill=\"none\"/><path d=\"M18.4 10.6C16.55 8.99 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16c1.05-3.19 4.05-5.5 7.6-5.5 1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z\"/></svg>",
|
|
19447
|
+
strong: "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 0 24 24\" width=\"24px\"><path d=\"M0 0h24v24H0V0z\" fill=\"none\"/><path d=\"M15.6 10.79c.97-.67 1.65-1.77 1.65-2.79 0-2.26-1.75-4-4-4H7v14h7.04c2.09 0 3.71-1.7 3.71-3.79 0-1.52-.86-2.82-2.15-3.42zM10 6.5h3c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5h-3v-3zm3.5 9H10v-3h3.5c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5z\"/></svg>",
|
|
19448
|
+
em: "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\" width=\"24px\"><path d=\"M200-200v-100h160l120-360H320v-100h400v100H580L460-300h140v100H200Z\"/></svg>",
|
|
19449
|
+
u: "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\" width=\"24px\"><path d=\"M200-120v-80h560v80H200Zm280-160q-101 0-157-63t-56-167v-330h103v336q0 56 28 91t82 35q54 0 82-35t28-91v-336h103v330q0 104-56 167t-157 63Z\"/></svg>",
|
|
19450
|
+
s: "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\" width=\"24px\"><path d=\"M486-160q-76 0-135-45t-85-123l88-38q14 48 48.5 79t85.5 31q42 0 76-20t34-64q0-18-7-33t-19-27h112q5 14 7.5 28.5T694-340q0 86-61.5 133T486-160ZM80-480v-80h800v80H80Zm402-326q66 0 115.5 32.5T674-674l-88 39q-9-29-33.5-52T484-710q-41 0-68 18.5T386-640h-96q2-69 54.5-117.5T482-806Z\"/></svg>",
|
|
19451
|
+
code: "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\" width=\"24px\"><path d=\"M560-160v-80h120q17 0 28.5-11.5T720-280v-80q0-38 22-69t58-44v-14q-36-13-58-44t-22-69v-80q0-17-11.5-28.5T680-720H560v-80h120q50 0 85 35t35 85v80q0 17 11.5 28.5T840-560h40v160h-40q-17 0-28.5 11.5T800-360v80q0 50-35 85t-85 35H560Zm-280 0q-50 0-85-35t-35-85v-80q0-17-11.5-28.5T120-400H80v-160h40q17 0 28.5-11.5T160-600v-80q0-50 35-85t85-35h120v80H280q-17 0-28.5 11.5T240-680v80q0 38-22 69t-58 44v14q36 13 58 44t22 69v80q0 17 11.5 28.5T280-240h120v80H280Z\"/></svg>",
|
|
19452
|
+
sub: "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\" width=\"24px\"><path d=\"M760-160v-80q0-17 11.5-28.5T800-280h80v-40H760v-40h120q17 0 28.5 11.5T920-320v40q0 17-11.5 28.5T880-240h-80v40h120v40H760Zm-525-80 185-291-172-269h106l124 200h4l123-200h107L539-531l186 291H618L482-457h-4L342-240H235Z\"/></svg>",
|
|
19453
|
+
sup: "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\" width=\"24px\"><path d=\"M760-600v-80q0-17 11.5-28.5T800-720h80v-40H760v-40h120q17 0 28.5 11.5T920-760v40q0 17-11.5 28.5T880-680h-80v40h120v40H760ZM235-160l185-291-172-269h106l124 200h4l123-200h107L539-451l186 291H618L482-377h-4L342-160H235Z\"/></svg>",
|
|
19454
|
+
link: "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 0 24 24\" width=\"24px\"><path d=\"M0 0h24v24H0V0z\" fill=\"none\"/><path d=\"M17 7h-4v2h4c1.65 0 3 1.35 3 3s-1.35 3-3 3h-4v2h4c2.76 0 5-2.24 5-5s-2.24-5-5-5zm-6 8H7c-1.65 0-3-1.35-3-3s1.35-3 3-3h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-2zm-3-4h8v2H8z\"/></svg>",
|
|
19455
|
+
image: "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\" width=\"24px\"><path d=\"M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm0-80h560v-560H200v560Zm40-80h480L570-480 450-320l-90-120-120 160Zm-40 80v-560 560Z\"/></svg>",
|
|
19456
|
+
table: "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\" width=\"24px\"><path d=\"M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm240-240H200v160h240v-160Zm80 0v160h240v-160H520Zm-80-80v-160H200v160h240Zm80 0h240v-160H520v160ZM200-680h560v-80H200v80Z\"/></svg>",
|
|
19457
|
+
bulletList: "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\" width=\"24px\"><path d=\"M360-200v-80h480v80H360Zm0-240v-80h480v80H360Zm0-240v-80h480v80H360ZM200-160q-33 0-56.5-23.5T120-240q0-33 23.5-56.5T200-320q33 0 56.5 23.5T280-240q0 33-23.5 56.5T200-160Zm0-240q-33 0-56.5-23.5T120-480q0-33 23.5-56.5T200-560q33 0 56.5 23.5T280-480q0 33-23.5 56.5T200-400Zm0-240q-33 0-56.5-23.5T120-720q0-33 23.5-56.5T200-800q33 0 56.5 23.5T280-720q0 33-23.5 56.5T200-640Z\"/></svg>",
|
|
19458
|
+
orderedList: "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\" width=\"24px\"><path d=\"M120-80v-60h100v-30h-60v-60h60v-30H120v-60h120q17 0 28.5 11.5T280-280v40q0 17-11.5 28.5T240-200q17 0 28.5 11.5T280-160v40q0 17-11.5 28.5T240-80H120Zm0-280v-110q0-17 11.5-28.5T160-510h60v-30H120v-60h120q17 0 28.5 11.5T280-560v70q0 17-11.5 28.5T240-450h-60v30h100v60H120Zm60-280v-180h-60v-60h120v240h-60Zm180 440v-80h480v80H360Zm0-240v-80h480v80H360Zm0-240v-80h480v80H360Z\"/></svg>",
|
|
19459
|
+
blockquote: "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\" width=\"24px\"><path d=\"M120-120v-80h720v80H120Zm320-160v-80h400v80H440Zm0-160v-80h400v80H440Zm0-160v-80h400v80H440ZM120-760v-80h720v80H120Zm0 440v-320l160 160-160 160Z\"/></svg>",
|
|
19460
|
+
lift: "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\" width=\"24px\"><path d=\"M120-120v-80h720v80H120Zm320-160v-80h400v80H440Zm0-160v-80h400v80H440Zm0-160v-80h400v80H440ZM120-760v-80h720v80H120Zm160 440L120-480l160-160v320Z\"/></svg>",
|
|
19461
|
+
search: "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\" width=\"24px\" fill=\"#1f1f1f\"><path d=\"M784-120 532-372q-30 24-69 38t-83 14q-109 0-184.5-75.5T120-580q0-109 75.5-184.5T380-840q109 0 184.5 75.5T640-580q0 44-14 83t-38 69l252 252-56 56ZM380-400q75 0 127.5-52.5T560-580q0-75-52.5-127.5T380-760q-75 0-127.5 52.5T200-580q0 75 52.5 127.5T380-400Z\"/></svg>",
|
|
19462
|
+
searchForward: "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\" width=\"24px\" fill=\"#1f1f1f\"><path d=\"M504-480 320-664l56-56 240 240-240 240-56-56 184-184Z\"/></svg>",
|
|
19463
|
+
searchBackward: "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\" width=\"24px\" fill=\"#1f1f1f\"><path d=\"M560-240 320-480l240-240 56 56-184 184 184 184-56 56Z\"/></svg>",
|
|
19464
|
+
matchCase: "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\" width=\"24px\" fill=\"#1f1f1f\"><path d=\"m131-252 165-440h79l165 440h-76l-39-112H247l-40 112h-76Zm139-176h131l-64-182h-4l-63 182Zm395 186q-51 0-81-27.5T554-342q0-44 34.5-72.5T677-443q23 0 45 4t38 11v-12q0-29-20.5-47T685-505q-23 0-42 9.5T610-468l-47-35q24-29 54.5-43t68.5-14q69 0 103 32.5t34 97.5v178h-63v-37h-4q-14 23-38 35t-53 12Zm12-54q35 0 59.5-24t24.5-56q-14-8-33.5-12.5T689-393q-32 0-50 14t-18 37q0 20 16 33t40 13Z\"/></svg>",
|
|
19465
|
+
paragraphStyle: "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\" width=\"24px\" fill=\"#1f1f1f\"><path d=\"M360-160v-240q-83 0-141.5-58.5T160-600q0-83 58.5-141.5T360-800h360v80h-80v560h-80v-560H440v560h-80Z\"/></svg>",
|
|
19466
|
+
more: "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\" width=\"24px\" fill=\"#1f1f1f\"><path d=\"M240-400q-33 0-56.5-23.5T160-480q0-33 23.5-56.5T240-560q33 0 56.5 23.5T320-480q0 33-23.5 56.5T240-400Zm240 0q-33 0-56.5-23.5T400-480q0-33 23.5-56.5T480-560q33 0 56.5 23.5T560-480q0 33-23.5 56.5T480-400Zm240 0q-33 0-56.5-23.5T640-480q0-33 23.5-56.5T720-560q33 0 56.5 23.5T800-480q0 33-23.5 56.5T720-400Z\"/></svg>"
|
|
19467
|
+
};
|
|
19468
|
+
var toolbarConfig = {
|
|
19469
|
+
visibility: visibility,
|
|
19470
|
+
ordering: ordering,
|
|
19471
|
+
insertBar: insertBar,
|
|
19472
|
+
formatBar: formatBar,
|
|
19473
|
+
styleMenu: styleMenu,
|
|
19474
|
+
styleBar: styleBar,
|
|
19475
|
+
tableMenu: tableMenu,
|
|
19476
|
+
augmentation: augmentation,
|
|
19477
|
+
icons: icons
|
|
19478
|
+
};
|
|
19479
|
+
|
|
19388
19480
|
/**
|
|
19389
19481
|
* ToolbarConfig contains static utility methods to obtain a JavaScript object with properties
|
|
19390
19482
|
* that define the configuration of the MarkupEditor toolbar. The class makes it convenient
|
|
@@ -19472,170 +19564,57 @@ function consoleLog(string) {
|
|
|
19472
19564
|
* "prepend": null, // Name of a registered array of cmdItems to prepend
|
|
19473
19565
|
* "append": null // Name of a registered array of cmdItems to append
|
|
19474
19566
|
* },
|
|
19475
|
-
* "icons": {
|
|
19476
|
-
* //
|
|
19477
|
-
* "undo":
|
|
19478
|
-
* //
|
|
19479
|
-
* "redo":
|
|
19480
|
-
* //
|
|
19481
|
-
* "strong":
|
|
19482
|
-
* //
|
|
19483
|
-
* "em":
|
|
19484
|
-
* //
|
|
19485
|
-
* "u":
|
|
19486
|
-
* //
|
|
19487
|
-
* "s":
|
|
19488
|
-
* //
|
|
19489
|
-
* "code":
|
|
19490
|
-
* //
|
|
19491
|
-
* "sub":
|
|
19492
|
-
* //
|
|
19493
|
-
* "sup":
|
|
19494
|
-
* //
|
|
19495
|
-
* "link":
|
|
19496
|
-
* //
|
|
19497
|
-
* "image":
|
|
19498
|
-
* //
|
|
19499
|
-
* "table":
|
|
19500
|
-
* //
|
|
19501
|
-
* "bulletList":
|
|
19502
|
-
* //
|
|
19503
|
-
* "orderedList":
|
|
19504
|
-
* //
|
|
19505
|
-
* "blockquote":
|
|
19506
|
-
* //
|
|
19507
|
-
* "lift":
|
|
19508
|
-
* //
|
|
19509
|
-
* "search":
|
|
19510
|
-
* //
|
|
19511
|
-
* "searchForward":
|
|
19512
|
-
* //
|
|
19513
|
-
* "searchBackward":
|
|
19514
|
-
* //
|
|
19515
|
-
* "matchCase":
|
|
19516
|
-
* //
|
|
19517
|
-
* "paragraphStyle":
|
|
19518
|
-
* //
|
|
19519
|
-
* "more":
|
|
19567
|
+
* "icons": { // Outlined 400 weight versions from https://fonts.google.com/icons
|
|
19568
|
+
* // undo
|
|
19569
|
+
* "undo": "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 0 24 24\" width=\"24px\"><path d=\"M0 0h24v24H0V0z\" fill=\"none\"/><path d=\"M12.5 8c-2.65 0-5.05.99-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z\"/></svg>",
|
|
19570
|
+
* // redo
|
|
19571
|
+
* "redo": "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 0 24 24\" width=\"24px\"><path d=\"M0 0h24v24H0V0z\" fill=\"none\"/><path d=\"M18.4 10.6C16.55 8.99 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16c1.05-3.19 4.05-5.5 7.6-5.5 1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z\"/></svg>",
|
|
19572
|
+
* // format_bold
|
|
19573
|
+
* "strong": "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 0 24 24\" width=\"24px\"><path d=\"M0 0h24v24H0V0z\" fill=\"none\"/><path d=\"M15.6 10.79c.97-.67 1.65-1.77 1.65-2.79 0-2.26-1.75-4-4-4H7v14h7.04c2.09 0 3.71-1.7 3.71-3.79 0-1.52-.86-2.82-2.15-3.42zM10 6.5h3c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5h-3v-3zm3.5 9H10v-3h3.5c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5z\"/></svg>",
|
|
19574
|
+
* // format_italic
|
|
19575
|
+
* "em": "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\" width=\"24px\"><path d=\"M200-200v-100h160l120-360H320v-100h400v100H580L460-300h140v100H200Z\"/></svg>",
|
|
19576
|
+
* // format_underlined
|
|
19577
|
+
* "u": "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\" width=\"24px\"><path d=\"M200-120v-80h560v80H200Zm280-160q-101 0-157-63t-56-167v-330h103v336q0 56 28 91t82 35q54 0 82-35t28-91v-336h103v330q0 104-56 167t-157 63Z\"/></svg>",
|
|
19578
|
+
* // strikethrough_s
|
|
19579
|
+
* "s": "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\" width=\"24px\"><path d=\"M486-160q-76 0-135-45t-85-123l88-38q14 48 48.5 79t85.5 31q42 0 76-20t34-64q0-18-7-33t-19-27h112q5 14 7.5 28.5T694-340q0 86-61.5 133T486-160ZM80-480v-80h800v80H80Zm402-326q66 0 115.5 32.5T674-674l-88 39q-9-29-33.5-52T484-710q-41 0-68 18.5T386-640h-96q2-69 54.5-117.5T482-806Z\"/></svg>",
|
|
19580
|
+
* // data_object
|
|
19581
|
+
* "code": "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\" width=\"24px\"><path d=\"M560-160v-80h120q17 0 28.5-11.5T720-280v-80q0-38 22-69t58-44v-14q-36-13-58-44t-22-69v-80q0-17-11.5-28.5T680-720H560v-80h120q50 0 85 35t35 85v80q0 17 11.5 28.5T840-560h40v160h-40q-17 0-28.5 11.5T800-360v80q0 50-35 85t-85 35H560Zm-280 0q-50 0-85-35t-35-85v-80q0-17-11.5-28.5T120-400H80v-160h40q17 0 28.5-11.5T160-600v-80q0-50 35-85t85-35h120v80H280q-17 0-28.5 11.5T240-680v80q0 38-22 69t-58 44v14q36 13 58 44t22 69v80q0 17 11.5 28.5T280-240h120v80H280Z\"/></svg>",
|
|
19582
|
+
* // subscript
|
|
19583
|
+
* "sub": "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\" width=\"24px\"><path d=\"M760-160v-80q0-17 11.5-28.5T800-280h80v-40H760v-40h120q17 0 28.5 11.5T920-320v40q0 17-11.5 28.5T880-240h-80v40h120v40H760Zm-525-80 185-291-172-269h106l124 200h4l123-200h107L539-531l186 291H618L482-457h-4L342-240H235Z\"/></svg>",
|
|
19584
|
+
* // superscript
|
|
19585
|
+
* "sup": "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\" width=\"24px\"><path d=\"M760-600v-80q0-17 11.5-28.5T800-720h80v-40H760v-40h120q17 0 28.5 11.5T920-760v40q0 17-11.5 28.5T880-680h-80v40h120v40H760ZM235-160l185-291-172-269h106l124 200h4l123-200h107L539-451l186 291H618L482-377h-4L342-160H235Z\"/></svg>",
|
|
19586
|
+
* // link
|
|
19587
|
+
* "link": "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 0 24 24\" width=\"24px\"><path d=\"M0 0h24v24H0V0z\" fill=\"none\"/><path d=\"M17 7h-4v2h4c1.65 0 3 1.35 3 3s-1.35 3-3 3h-4v2h4c2.76 0 5-2.24 5-5s-2.24-5-5-5zm-6 8H7c-1.65 0-3-1.35-3-3s1.35-3 3-3h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-2zm-3-4h8v2H8z\"/></svg>",
|
|
19588
|
+
* // image
|
|
19589
|
+
* "image": "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\" width=\"24px\"><path d=\"M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm0-80h560v-560H200v560Zm40-80h480L570-480 450-320l-90-120-120 160Zm-40 80v-560 560Z\"/></svg>",
|
|
19590
|
+
* // table
|
|
19591
|
+
* "table": "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\" width=\"24px\"><path d=\"M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm240-240H200v160h240v-160Zm80 0v160h240v-160H520Zm-80-80v-160H200v160h240Zm80 0h240v-160H520v160ZM200-680h560v-80H200v80Z\"/></svg>",
|
|
19592
|
+
* // format_list_bulleted
|
|
19593
|
+
* "bulletList": "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\" width=\"24px\"><path d=\"M360-200v-80h480v80H360Zm0-240v-80h480v80H360Zm0-240v-80h480v80H360ZM200-160q-33 0-56.5-23.5T120-240q0-33 23.5-56.5T200-320q33 0 56.5 23.5T280-240q0 33-23.5 56.5T200-160Zm0-240q-33 0-56.5-23.5T120-480q0-33 23.5-56.5T200-560q33 0 56.5 23.5T280-480q0 33-23.5 56.5T200-400Zm0-240q-33 0-56.5-23.5T120-720q0-33 23.5-56.5T200-800q33 0 56.5 23.5T280-720q0 33-23.5 56.5T200-640Z\"/></svg>",
|
|
19594
|
+
* // format_list_numbered
|
|
19595
|
+
* "orderedList": "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\" width=\"24px\"><path d=\"M120-80v-60h100v-30h-60v-60h60v-30H120v-60h120q17 0 28.5 11.5T280-280v40q0 17-11.5 28.5T240-200q17 0 28.5 11.5T280-160v40q0 17-11.5 28.5T240-80H120Zm0-280v-110q0-17 11.5-28.5T160-510h60v-30H120v-60h120q17 0 28.5 11.5T280-560v70q0 17-11.5 28.5T240-450h-60v30h100v60H120Zm60-280v-180h-60v-60h120v240h-60Zm180 440v-80h480v80H360Zm0-240v-80h480v80H360Zm0-240v-80h480v80H360Z\"/></svg>",
|
|
19596
|
+
* // format_indent_increase
|
|
19597
|
+
* "blockquote": "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\" width=\"24px\"><path d=\"M120-120v-80h720v80H120Zm320-160v-80h400v80H440Zm0-160v-80h400v80H440Zm0-160v-80h400v80H440ZM120-760v-80h720v80H120Zm0 440v-320l160 160-160 160Z\"/></svg>",
|
|
19598
|
+
* // format_indent_decrease
|
|
19599
|
+
* "lift": "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\" width=\"24px\"><path d=\"M120-120v-80h720v80H120Zm320-160v-80h400v80H440Zm0-160v-80h400v80H440Zm0-160v-80h400v80H440ZM120-760v-80h720v80H120Zm160 440L120-480l160-160v320Z\"/></svg>",
|
|
19600
|
+
* // search
|
|
19601
|
+
* "search": "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\" width=\"24px\" fill=\"#1f1f1f\"><path d=\"M784-120 532-372q-30 24-69 38t-83 14q-109 0-184.5-75.5T120-580q0-109 75.5-184.5T380-840q109 0 184.5 75.5T640-580q0 44-14 83t-38 69l252 252-56 56ZM380-400q75 0 127.5-52.5T560-580q0-75-52.5-127.5T380-760q-75 0-127.5 52.5T200-580q0 75 52.5 127.5T380-400Z\"/></svg>",
|
|
19602
|
+
* // chevron_forward
|
|
19603
|
+
* "searchForward": "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\" width=\"24px\" fill=\"#1f1f1f\"><path d=\"M504-480 320-664l56-56 240 240-240 240-56-56 184-184Z\"/></svg>",
|
|
19604
|
+
* // chevron_backward
|
|
19605
|
+
* "searchBackward": "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\" width=\"24px\" fill=\"#1f1f1f\"><path d=\"M560-240 320-480l240-240 56 56-184 184 184 184-56 56Z\"/></svg>",
|
|
19606
|
+
* // match_case
|
|
19607
|
+
* "matchCase": "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\" width=\"24px\" fill=\"#1f1f1f\"><path d=\"m131-252 165-440h79l165 440h-76l-39-112H247l-40 112h-76Zm139-176h131l-64-182h-4l-63 182Zm395 186q-51 0-81-27.5T554-342q0-44 34.5-72.5T677-443q23 0 45 4t38 11v-12q0-29-20.5-47T685-505q-23 0-42 9.5T610-468l-47-35q24-29 54.5-43t68.5-14q69 0 103 32.5t34 97.5v178h-63v-37h-4q-14 23-38 35t-53 12Zm12-54q35 0 59.5-24t24.5-56q-14-8-33.5-12.5T689-393q-32 0-50 14t-18 37q0 20 16 33t40 13Z\"/></svg>",
|
|
19608
|
+
* // format_paragraph
|
|
19609
|
+
* "paragraphStyle": "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\" width=\"24px\" fill=\"#1f1f1f\"><path d=\"M360-160v-240q-83 0-141.5-58.5T160-600q0-83 58.5-141.5T360-800h360v80h-80v560h-80v-560H440v560h-80Z\"/></svg>",
|
|
19610
|
+
* // more_horiz
|
|
19611
|
+
* "more": "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\" width=\"24px\" fill=\"#1f1f1f\"><path d=\"M240-400q-33 0-56.5-23.5T160-480q0-33 23.5-56.5T240-560q33 0 56.5 23.5T320-480q0 33-23.5 56.5T240-400Zm240 0q-33 0-56.5-23.5T400-480q0-33 23.5-56.5T480-560q33 0 56.5 23.5T560-480q0 33-23.5 56.5T480-400Zm240 0q-33 0-56.5-23.5T640-480q0-33 23.5-56.5T720-560q33 0 56.5 23.5T800-480q0 33-23.5 56.5T720-400Z\"/></svg>"
|
|
19520
19612
|
* }
|
|
19521
19613
|
* }
|
|
19522
19614
|
* ```
|
|
19523
19615
|
*/
|
|
19524
19616
|
class ToolbarConfig {
|
|
19525
19617
|
|
|
19526
|
-
/**
|
|
19527
|
-
* The private definition of all toolbar config options used by the public static methods.
|
|
19528
|
-
* Needs to be a function not property for multiple editors.
|
|
19529
|
-
*
|
|
19530
|
-
* If you add or modify these options, include those changes in the class doc above.
|
|
19531
|
-
*
|
|
19532
|
-
* @ignore
|
|
19533
|
-
* @returns {object} A JavaScript object with all options enabled.
|
|
19534
|
-
*/
|
|
19535
|
-
static _all() { // Needs to be a function not property for multiple editors
|
|
19536
|
-
return {
|
|
19537
|
-
"visibility": { // Control the visibility of toolbars, etc
|
|
19538
|
-
"toolbar": true, // Whether the toolbar is visible at all
|
|
19539
|
-
"correctionBar": true, // Whether the correction bar (undo/redo) is visible
|
|
19540
|
-
"insertBar": true, // Whether the insert bar (link, image, table) is visible
|
|
19541
|
-
"styleMenu": true, // Whether the style menu (p, h1-h6, code) is visible
|
|
19542
|
-
"styleBar": true, // Whether the style bar (bullet/numbered lists) is visible
|
|
19543
|
-
"formatBar": true, // Whether the format bar (b, i, u, etc) is visible
|
|
19544
|
-
"search": true, // Whether the search item (hide/show search bar) is visible
|
|
19545
|
-
},
|
|
19546
|
-
"ordering": { // Control the ordering of toolbars, etc, ascending left-to-right
|
|
19547
|
-
"correctionBar": 10, // Correction bar order if it is visible
|
|
19548
|
-
"insertBar": 20, // Insert bar (link, image, table) order if it is visible
|
|
19549
|
-
"styleMenu": 30, // Style menu (p, h1-h6, code) order if it is visible
|
|
19550
|
-
"styleBar": 40, // Style bar (bullet/numbered lists) order if it is visible
|
|
19551
|
-
"formatBar": 50, // Format bar (b, i, u, etc) order if it is visible
|
|
19552
|
-
"search": 60, // Search item (hide/show search bar) order if it is visible
|
|
19553
|
-
},
|
|
19554
|
-
"insertBar": {
|
|
19555
|
-
"link": true, // Whether the link menu item is visible
|
|
19556
|
-
"image": true, // Whether the image menu item is visible
|
|
19557
|
-
"tableMenu": true, // Whether the table menu is visible
|
|
19558
|
-
},
|
|
19559
|
-
"formatBar": {
|
|
19560
|
-
"bold": true, // Whether the bold menu item is visible
|
|
19561
|
-
"italic": true, // Whether the italic menu item is visible
|
|
19562
|
-
"underline": true, // Whether the underline menu item is visible
|
|
19563
|
-
"code": true, // Whether the code menu item is visible
|
|
19564
|
-
"strikethrough": true, // Whether the strikethrough menu item is visible
|
|
19565
|
-
"subscript": true, // Whether the subscript menu item is visible
|
|
19566
|
-
"superscript": true, // Whether the superscript menu item is visible
|
|
19567
|
-
},
|
|
19568
|
-
"styleMenu": {
|
|
19569
|
-
"p": "Body", // The label in the menu for "P" style
|
|
19570
|
-
"h1": "H1", // The label in the menu for "H1" style
|
|
19571
|
-
"h2": "H2", // The label in the menu for "H2" style
|
|
19572
|
-
"h3": "H3", // The label in the menu for "H3" style
|
|
19573
|
-
"h4": "H4", // The label in the menu for "H4" style
|
|
19574
|
-
"h5": "H5", // The label in the menu for "H5" style
|
|
19575
|
-
"h6": "H6", // The label in the menu for "H6" style
|
|
19576
|
-
"pre": "Code", // The label in the menu for "PRE" aka code_block style
|
|
19577
|
-
},
|
|
19578
|
-
"styleBar": {
|
|
19579
|
-
"list": true, // Whether bullet and numbered list items are visible
|
|
19580
|
-
"dent": true, // Whether indent and outdent items are visible
|
|
19581
|
-
},
|
|
19582
|
-
"tableMenu": {
|
|
19583
|
-
"header": true, // Whether the "Header" item is visible in the "Table->Add" menu
|
|
19584
|
-
"border": true, // Whether the "Border" item is visible in the "Table" menu
|
|
19585
|
-
},
|
|
19586
|
-
"augmentation": {
|
|
19587
|
-
"prepend": null, // Name of a registered array of cmdItems to prepend
|
|
19588
|
-
"append": null // Name of a registered array of cmdItems to append
|
|
19589
|
-
},
|
|
19590
|
-
"icons": {
|
|
19591
|
-
// <span class="material-icons-outlined">undo</span>
|
|
19592
|
-
"undo": '<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M12.5 8c-2.65 0-5.05.99-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z"/></svg>',
|
|
19593
|
-
// <span class="material-icons-outlined">redo</span>
|
|
19594
|
-
"redo": '<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M18.4 10.6C16.55 8.99 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16c1.05-3.19 4.05-5.5 7.6-5.5 1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z"/></svg>',
|
|
19595
|
-
// <span class="material-icons-outlined">format_bold</span>
|
|
19596
|
-
"strong": '<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M15.6 10.79c.97-.67 1.65-1.77 1.65-2.79 0-2.26-1.75-4-4-4H7v14h7.04c2.09 0 3.71-1.7 3.71-3.79 0-1.52-.86-2.82-2.15-3.42zM10 6.5h3c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5h-3v-3zm3.5 9H10v-3h3.5c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5z"/></svg>',
|
|
19597
|
-
// <span class="material-icons-outlined">format_italic</span>
|
|
19598
|
-
"em": '<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px"><path d="M200-200v-100h160l120-360H320v-100h400v100H580L460-300h140v100H200Z"/></svg>',
|
|
19599
|
-
// <span class="material-icons-outlined">format_underlined</span>
|
|
19600
|
-
"u": '<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px"><path d="M200-120v-80h560v80H200Zm280-160q-101 0-157-63t-56-167v-330h103v336q0 56 28 91t82 35q54 0 82-35t28-91v-336h103v330q0 104-56 167t-157 63Z"/></svg>',
|
|
19601
|
-
// <span class="material-icons-outlined">strikethrough_s</span>
|
|
19602
|
-
"s": '<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px"><path d="M486-160q-76 0-135-45t-85-123l88-38q14 48 48.5 79t85.5 31q42 0 76-20t34-64q0-18-7-33t-19-27h112q5 14 7.5 28.5T694-340q0 86-61.5 133T486-160ZM80-480v-80h800v80H80Zm402-326q66 0 115.5 32.5T674-674l-88 39q-9-29-33.5-52T484-710q-41 0-68 18.5T386-640h-96q2-69 54.5-117.5T482-806Z"/></svg>',
|
|
19603
|
-
// <span class="material-icons-outlined">data_object</span>
|
|
19604
|
-
"code": '<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px"><path d="M560-160v-80h120q17 0 28.5-11.5T720-280v-80q0-38 22-69t58-44v-14q-36-13-58-44t-22-69v-80q0-17-11.5-28.5T680-720H560v-80h120q50 0 85 35t35 85v80q0 17 11.5 28.5T840-560h40v160h-40q-17 0-28.5 11.5T800-360v80q0 50-35 85t-85 35H560Zm-280 0q-50 0-85-35t-35-85v-80q0-17-11.5-28.5T120-400H80v-160h40q17 0 28.5-11.5T160-600v-80q0-50 35-85t85-35h120v80H280q-17 0-28.5 11.5T240-680v80q0 38-22 69t-58 44v14q36 13 58 44t22 69v80q0 17 11.5 28.5T280-240h120v80H280Z"/></svg>',
|
|
19605
|
-
// <span class="material-icons-outlined">subscript</span>
|
|
19606
|
-
"sub": '<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px"><path d="M760-160v-80q0-17 11.5-28.5T800-280h80v-40H760v-40h120q17 0 28.5 11.5T920-320v40q0 17-11.5 28.5T880-240h-80v40h120v40H760Zm-525-80 185-291-172-269h106l124 200h4l123-200h107L539-531l186 291H618L482-457h-4L342-240H235Z"/></svg>',
|
|
19607
|
-
// <span class="material-icons-outlined">superscript</span>
|
|
19608
|
-
"sup": '<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px"><path d="M760-600v-80q0-17 11.5-28.5T800-720h80v-40H760v-40h120q17 0 28.5 11.5T920-760v40q0 17-11.5 28.5T880-680h-80v40h120v40H760ZM235-160l185-291-172-269h106l124 200h4l123-200h107L539-451l186 291H618L482-377h-4L342-160H235Z"/></svg>',
|
|
19609
|
-
// <span class="material-icons-outlined">link</span>
|
|
19610
|
-
"link": '<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M17 7h-4v2h4c1.65 0 3 1.35 3 3s-1.35 3-3 3h-4v2h4c2.76 0 5-2.24 5-5s-2.24-5-5-5zm-6 8H7c-1.65 0-3-1.35-3-3s1.35-3 3-3h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-2zm-3-4h8v2H8z"/></svg>',
|
|
19611
|
-
// <span class="material-icons-outlined">image</span>
|
|
19612
|
-
"image": '<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px"><path d="M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm0-80h560v-560H200v560Zm40-80h480L570-480 450-320l-90-120-120 160Zm-40 80v-560 560Z"/></svg>',
|
|
19613
|
-
// <span class="material-icons-outlined">table</span>
|
|
19614
|
-
"table": '<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px"><path d="M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm240-240H200v160h240v-160Zm80 0v160h240v-160H520Zm-80-80v-160H200v160h240Zm80 0h240v-160H520v160ZM200-680h560v-80H200v80Z"/></svg>',
|
|
19615
|
-
// <span class="material-icons-outlined">format_list_bulleted</span>
|
|
19616
|
-
"bulletList": '<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px"><path d="M360-200v-80h480v80H360Zm0-240v-80h480v80H360Zm0-240v-80h480v80H360ZM200-160q-33 0-56.5-23.5T120-240q0-33 23.5-56.5T200-320q33 0 56.5 23.5T280-240q0 33-23.5 56.5T200-160Zm0-240q-33 0-56.5-23.5T120-480q0-33 23.5-56.5T200-560q33 0 56.5 23.5T280-480q0 33-23.5 56.5T200-400Zm0-240q-33 0-56.5-23.5T120-720q0-33 23.5-56.5T200-800q33 0 56.5 23.5T280-720q0 33-23.5 56.5T200-640Z"/></svg>',
|
|
19617
|
-
// <span class="material-icons-outlined">format_list_numbered</span>
|
|
19618
|
-
"orderedList": '<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px"><path d="M120-80v-60h100v-30h-60v-60h60v-30H120v-60h120q17 0 28.5 11.5T280-280v40q0 17-11.5 28.5T240-200q17 0 28.5 11.5T280-160v40q0 17-11.5 28.5T240-80H120Zm0-280v-110q0-17 11.5-28.5T160-510h60v-30H120v-60h120q17 0 28.5 11.5T280-560v70q0 17-11.5 28.5T240-450h-60v30h100v60H120Zm60-280v-180h-60v-60h120v240h-60Zm180 440v-80h480v80H360Zm0-240v-80h480v80H360Zm0-240v-80h480v80H360Z"/></svg>',
|
|
19619
|
-
// <span class="material-icons-outlined">format_indent_increase</span>
|
|
19620
|
-
"blockquote": '<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px"><path d="M120-120v-80h720v80H120Zm320-160v-80h400v80H440Zm0-160v-80h400v80H440Zm0-160v-80h400v80H440ZM120-760v-80h720v80H120Zm0 440v-320l160 160-160 160Z"/></svg>',
|
|
19621
|
-
// <span class="material-icons-outlined">format_indent_decrease</span>
|
|
19622
|
-
"lift": '<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px"><path d="M120-120v-80h720v80H120Zm320-160v-80h400v80H440Zm0-160v-80h400v80H440Zm0-160v-80h400v80H440ZM120-760v-80h720v80H120Zm160 440L120-480l160-160v320Z"/></svg>',
|
|
19623
|
-
// <span class="material-symbols-outlined">search</span>
|
|
19624
|
-
"search": '<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#1f1f1f"><path d="M784-120 532-372q-30 24-69 38t-83 14q-109 0-184.5-75.5T120-580q0-109 75.5-184.5T380-840q109 0 184.5 75.5T640-580q0 44-14 83t-38 69l252 252-56 56ZM380-400q75 0 127.5-52.5T560-580q0-75-52.5-127.5T380-760q-75 0-127.5 52.5T200-580q0 75 52.5 127.5T380-400Z"/></svg>',
|
|
19625
|
-
// <span class="material-symbols-outlined">chevron_forward</span>
|
|
19626
|
-
"searchForward": '<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#1f1f1f"><path d="M504-480 320-664l56-56 240 240-240 240-56-56 184-184Z"/></svg>',
|
|
19627
|
-
// <span class="material-symbols-outlined">chevron_backward</span>
|
|
19628
|
-
"searchBackward": '<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#1f1f1f"><path d="M560-240 320-480l240-240 56 56-184 184 184 184-56 56Z"/></svg>',
|
|
19629
|
-
// <span class="material-symbols-outlined">match_case</span>
|
|
19630
|
-
"matchCase": '<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#1f1f1f"><path d="m131-252 165-440h79l165 440h-76l-39-112H247l-40 112h-76Zm139-176h131l-64-182h-4l-63 182Zm395 186q-51 0-81-27.5T554-342q0-44 34.5-72.5T677-443q23 0 45 4t38 11v-12q0-29-20.5-47T685-505q-23 0-42 9.5T610-468l-47-35q24-29 54.5-43t68.5-14q69 0 103 32.5t34 97.5v178h-63v-37h-4q-14 23-38 35t-53 12Zm12-54q35 0 59.5-24t24.5-56q-14-8-33.5-12.5T689-393q-32 0-50 14t-18 37q0 20 16 33t40 13Z"/></svg>',
|
|
19631
|
-
// <span class="material-symbols-outlined">format_paragraph</span>
|
|
19632
|
-
"paragraphStyle": '<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#1f1f1f"><path d="M360-160v-240q-83 0-141.5-58.5T160-600q0-83 58.5-141.5T360-800h360v80h-80v560h-80v-560H440v560h-80Z"/></svg>',
|
|
19633
|
-
// <span class="material-symbols-outlined">more_horiz</span>
|
|
19634
|
-
"more": '<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#1f1f1f"><path d="M240-400q-33 0-56.5-23.5T160-480q0-33 23.5-56.5T240-560q33 0 56.5 23.5T320-480q0 33-23.5 56.5T240-400Zm240 0q-33 0-56.5-23.5T400-480q0-33 23.5-56.5T480-560q33 0 56.5 23.5T560-480q0 33-23.5 56.5T480-400Zm240 0q-33 0-56.5-23.5T640-480q0-33 23.5-56.5T720-560q33 0 56.5 23.5T800-480q0 33-23.5 56.5T720-400Z"/></svg>'
|
|
19635
|
-
}
|
|
19636
|
-
}
|
|
19637
|
-
}
|
|
19638
|
-
|
|
19639
19618
|
/**
|
|
19640
19619
|
* Return a toolbar configuration object, but defined from a stringified JSON object.
|
|
19641
19620
|
*
|
|
@@ -19657,7 +19636,7 @@ class ToolbarConfig {
|
|
|
19657
19636
|
* @returns {string | null} The SVG definition of the icon if found
|
|
19658
19637
|
*/
|
|
19659
19638
|
static iconFor(string) {
|
|
19660
|
-
return
|
|
19639
|
+
return toolbarConfig.icons[string]
|
|
19661
19640
|
}
|
|
19662
19641
|
|
|
19663
19642
|
/**
|
|
@@ -19667,7 +19646,7 @@ class ToolbarConfig {
|
|
|
19667
19646
|
* @returns {object} A JavaScript object with all options enabled.
|
|
19668
19647
|
*/
|
|
19669
19648
|
static full(correction = false) {
|
|
19670
|
-
let full =
|
|
19649
|
+
let full = structuredClone(toolbarConfig);
|
|
19671
19650
|
full.visibility.correctionBar = correction;
|
|
19672
19651
|
return full
|
|
19673
19652
|
}
|
|
@@ -19698,7 +19677,7 @@ class ToolbarConfig {
|
|
|
19698
19677
|
* @returns {object} A toolbar configuration object with `visibility.toolbar` set to `false`
|
|
19699
19678
|
*/
|
|
19700
19679
|
static none() {
|
|
19701
|
-
let none =
|
|
19680
|
+
let none = structuredClone(toolbarConfig);
|
|
19702
19681
|
none.visibility.toolbar = false;
|
|
19703
19682
|
return none
|
|
19704
19683
|
}
|
|
@@ -19717,11 +19696,94 @@ class ToolbarConfig {
|
|
|
19717
19696
|
markdown.formatBar.superscript = false;
|
|
19718
19697
|
return markdown
|
|
19719
19698
|
}
|
|
19699
|
+
|
|
19720
19700
|
}
|
|
19721
19701
|
|
|
19702
|
+
var undo = "Mod-z";
|
|
19703
|
+
var redo = "Shift-Mod-z";
|
|
19704
|
+
var link = [
|
|
19705
|
+
"Mod-K",
|
|
19706
|
+
"Mod-k"
|
|
19707
|
+
];
|
|
19708
|
+
var image = [
|
|
19709
|
+
"Mod-G",
|
|
19710
|
+
"Mod-g"
|
|
19711
|
+
];
|
|
19712
|
+
var p = "Ctrl-Shift-0";
|
|
19713
|
+
var h1 = "Ctrl-Shift-1";
|
|
19714
|
+
var h2 = "Ctrl-Shift-2";
|
|
19715
|
+
var h3 = "Ctrl-Shift-3";
|
|
19716
|
+
var h4 = "Ctrl-Shift-4";
|
|
19717
|
+
var h5 = "Ctrl-Shift-5";
|
|
19718
|
+
var h6 = "Ctrl-Shift-6";
|
|
19719
|
+
var bullet = [
|
|
19720
|
+
"Ctrl-U",
|
|
19721
|
+
"Ctrl-u"
|
|
19722
|
+
];
|
|
19723
|
+
var number = [
|
|
19724
|
+
"Ctrl-O",
|
|
19725
|
+
"Ctrl-o"
|
|
19726
|
+
];
|
|
19727
|
+
var indent = [
|
|
19728
|
+
"Mod-]",
|
|
19729
|
+
"Ctrl-q"
|
|
19730
|
+
];
|
|
19731
|
+
var outdent = [
|
|
19732
|
+
"Mod-[",
|
|
19733
|
+
"Shift-Ctrl-q"
|
|
19734
|
+
];
|
|
19735
|
+
var bold = [
|
|
19736
|
+
"Mod-B",
|
|
19737
|
+
"Mod-b"
|
|
19738
|
+
];
|
|
19739
|
+
var italic = [
|
|
19740
|
+
"Mod-I",
|
|
19741
|
+
"Mod-i"
|
|
19742
|
+
];
|
|
19743
|
+
var underline = [
|
|
19744
|
+
"Mod-U",
|
|
19745
|
+
"Mod-u"
|
|
19746
|
+
];
|
|
19747
|
+
var strikethrough = [
|
|
19748
|
+
"Ctrl-S",
|
|
19749
|
+
"Ctrl-s"
|
|
19750
|
+
];
|
|
19751
|
+
var code = "Mod-`";
|
|
19752
|
+
var subscript = "Ctrl-Mod--";
|
|
19753
|
+
var superscript = "Ctrl-Mod-+";
|
|
19754
|
+
var search$1 = [
|
|
19755
|
+
"Ctrl-F",
|
|
19756
|
+
"Ctrl-f"
|
|
19757
|
+
];
|
|
19758
|
+
var keymapConfig = {
|
|
19759
|
+
undo: undo,
|
|
19760
|
+
redo: redo,
|
|
19761
|
+
link: link,
|
|
19762
|
+
image: image,
|
|
19763
|
+
p: p,
|
|
19764
|
+
h1: h1,
|
|
19765
|
+
h2: h2,
|
|
19766
|
+
h3: h3,
|
|
19767
|
+
h4: h4,
|
|
19768
|
+
h5: h5,
|
|
19769
|
+
h6: h6,
|
|
19770
|
+
bullet: bullet,
|
|
19771
|
+
number: number,
|
|
19772
|
+
indent: indent,
|
|
19773
|
+
outdent: outdent,
|
|
19774
|
+
bold: bold,
|
|
19775
|
+
italic: italic,
|
|
19776
|
+
underline: underline,
|
|
19777
|
+
strikethrough: strikethrough,
|
|
19778
|
+
code: code,
|
|
19779
|
+
subscript: subscript,
|
|
19780
|
+
superscript: superscript,
|
|
19781
|
+
search: search$1
|
|
19782
|
+
};
|
|
19783
|
+
|
|
19722
19784
|
/**
|
|
19723
19785
|
* KeymapConfig contains static utility methods to obtain a JavaScript object with properties
|
|
19724
|
-
* that define the key
|
|
19786
|
+
* that define the key mapping configuration of the MarkupEditor toolbar. The class makes it convenient
|
|
19725
19787
|
* to write and use the utility methods, but an instance of KeymapConfig itself is not meaningful.
|
|
19726
19788
|
*
|
|
19727
19789
|
* `KeymapConfig.standard()` is the default for the MarkupEditor. It can be overridden by
|
|
@@ -19788,50 +19850,6 @@ class ToolbarConfig {
|
|
|
19788
19850
|
*/
|
|
19789
19851
|
class KeymapConfig {
|
|
19790
19852
|
|
|
19791
|
-
/**
|
|
19792
|
-
* The private definition of all keymap config options used by the public static methods.
|
|
19793
|
-
* Needs to be a function not property for multiple editors.
|
|
19794
|
-
*
|
|
19795
|
-
* If you add or modify these options, include those changes in the class doc above.
|
|
19796
|
-
*
|
|
19797
|
-
* @ignore
|
|
19798
|
-
* @returns {object} A JavaScript object with all options enabled.
|
|
19799
|
-
*/
|
|
19800
|
-
static _all() {
|
|
19801
|
-
return {
|
|
19802
|
-
// Correction
|
|
19803
|
-
"undo": "Mod-z",
|
|
19804
|
-
"redo": "Shift-Mod-z",
|
|
19805
|
-
// Insert
|
|
19806
|
-
"link": ["Mod-K", "Mod-k"],
|
|
19807
|
-
"image": ["Mod-G", "Mod-g"],
|
|
19808
|
-
//"table": ["Mod-T", "Mod-t"], // Does not work
|
|
19809
|
-
// Stylemenu
|
|
19810
|
-
"p": "Ctrl-Shift-0",
|
|
19811
|
-
"h1": "Ctrl-Shift-1",
|
|
19812
|
-
"h2": "Ctrl-Shift-2",
|
|
19813
|
-
"h3": "Ctrl-Shift-3",
|
|
19814
|
-
"h4": "Ctrl-Shift-4",
|
|
19815
|
-
"h5": "Ctrl-Shift-5",
|
|
19816
|
-
"h6": "Ctrl-Shift-6",
|
|
19817
|
-
// Stylebar
|
|
19818
|
-
"bullet": ["Ctrl-U", "Ctrl-u"],
|
|
19819
|
-
"number": ["Ctrl-O", "Ctrl-o"],
|
|
19820
|
-
"indent": ["Mod-]", "Ctrl-q"],
|
|
19821
|
-
"outdent": ["Mod-[", "Shift-Ctrl-q"],
|
|
19822
|
-
// Format
|
|
19823
|
-
"bold": ["Mod-B", "Mod-b"],
|
|
19824
|
-
"italic": ["Mod-I", "Mod-i"],
|
|
19825
|
-
"underline": ["Mod-U", "Mod-u"],
|
|
19826
|
-
"strikethrough": ["Ctrl-S", "Ctrl-s"],
|
|
19827
|
-
"code": "Mod-`",
|
|
19828
|
-
"subscript": "Ctrl-Mod--",
|
|
19829
|
-
"superscript": "Ctrl-Mod-+",
|
|
19830
|
-
// Search
|
|
19831
|
-
"search": ["Ctrl-F", "Ctrl-f"],
|
|
19832
|
-
}
|
|
19833
|
-
}
|
|
19834
|
-
|
|
19835
19853
|
/**
|
|
19836
19854
|
* Return a keymap configuration object, but defined from a stringified JSON object.
|
|
19837
19855
|
*
|
|
@@ -19852,7 +19870,7 @@ class KeymapConfig {
|
|
|
19852
19870
|
* @returns {object} A JavaScript object with all options enabled.
|
|
19853
19871
|
*/
|
|
19854
19872
|
static full() {
|
|
19855
|
-
return
|
|
19873
|
+
return structuredClone(keymapConfig)
|
|
19856
19874
|
}
|
|
19857
19875
|
|
|
19858
19876
|
/**
|
|
@@ -19888,6 +19906,17 @@ class KeymapConfig {
|
|
|
19888
19906
|
}
|
|
19889
19907
|
}
|
|
19890
19908
|
|
|
19909
|
+
var focusAfterLoad = true;
|
|
19910
|
+
var selectImage = false;
|
|
19911
|
+
var insertLink = false;
|
|
19912
|
+
var insertImage = false;
|
|
19913
|
+
var behaviorConfig = {
|
|
19914
|
+
focusAfterLoad: focusAfterLoad,
|
|
19915
|
+
selectImage: selectImage,
|
|
19916
|
+
insertLink: insertLink,
|
|
19917
|
+
insertImage: insertImage
|
|
19918
|
+
};
|
|
19919
|
+
|
|
19891
19920
|
/**
|
|
19892
19921
|
* BehaviorConfig contains static utility methods to obtain a JavaScript object with properties
|
|
19893
19922
|
* that define the behavior configuration of the MarkupEditor. The class makes it convenient
|
|
@@ -19929,24 +19958,6 @@ class KeymapConfig {
|
|
|
19929
19958
|
*/
|
|
19930
19959
|
class BehaviorConfig {
|
|
19931
19960
|
|
|
19932
|
-
/**
|
|
19933
|
-
* The private definition of all behavior config options used by the public static methods.
|
|
19934
|
-
* Needs to be a function not property for multiple editors.
|
|
19935
|
-
*
|
|
19936
|
-
* If you add or modify these options, include those changes in the class doc above.
|
|
19937
|
-
*
|
|
19938
|
-
* @ignore
|
|
19939
|
-
* @returns {object} A JavaScript object with all options enabled.
|
|
19940
|
-
*/
|
|
19941
|
-
static _all() {
|
|
19942
|
-
return {
|
|
19943
|
-
"focusAfterLoad": true, // Whether the editor should take focus after loading
|
|
19944
|
-
"selectImage": false, // Whether to show a "Select..." button in the Insert Image dialog
|
|
19945
|
-
"insertLink": false, // Whether to defer to the MarkupDelegate rather than use the default LinkDialog
|
|
19946
|
-
"insertImage": false, // Whether to defer to the MarkupDelagate rather than use the default ImageDialog
|
|
19947
|
-
}
|
|
19948
|
-
}
|
|
19949
|
-
|
|
19950
19961
|
/**
|
|
19951
19962
|
* Return a behavior configuration object, but defined from a stringified JSON object.
|
|
19952
19963
|
*
|
|
@@ -19967,7 +19978,7 @@ class BehaviorConfig {
|
|
|
19967
19978
|
* @returns {object} A JavaScript object with all options enabled.
|
|
19968
19979
|
*/
|
|
19969
19980
|
static full() {
|
|
19970
|
-
return
|
|
19981
|
+
return structuredClone(behaviorConfig)
|
|
19971
19982
|
}
|
|
19972
19983
|
|
|
19973
19984
|
/**
|
|
@@ -19976,7 +19987,7 @@ class BehaviorConfig {
|
|
|
19976
19987
|
* @returns {object} A JavaScript object with all settings.
|
|
19977
19988
|
*/
|
|
19978
19989
|
static standard() {
|
|
19979
|
-
return this.
|
|
19990
|
+
return this.full()
|
|
19980
19991
|
}
|
|
19981
19992
|
|
|
19982
19993
|
/**
|
|
@@ -23019,31 +23030,27 @@ const undoInputRule = (state, dispatch) => {
|
|
|
23019
23030
|
/**
|
|
23020
23031
|
Converts double dashes to an emdash.
|
|
23021
23032
|
*/
|
|
23022
|
-
|
|
23033
|
+
new InputRule(/--$/, "—", { inCodeMark: false });
|
|
23023
23034
|
/**
|
|
23024
23035
|
Converts three dots to an ellipsis character.
|
|
23025
23036
|
*/
|
|
23026
|
-
|
|
23037
|
+
new InputRule(/\.\.\.$/, "…", { inCodeMark: false });
|
|
23027
23038
|
/**
|
|
23028
23039
|
“Smart” opening double quotes.
|
|
23029
23040
|
*/
|
|
23030
|
-
|
|
23041
|
+
new InputRule(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(")$/, "“", { inCodeMark: false });
|
|
23031
23042
|
/**
|
|
23032
23043
|
“Smart” closing double quotes.
|
|
23033
23044
|
*/
|
|
23034
|
-
|
|
23045
|
+
new InputRule(/"$/, "”", { inCodeMark: false });
|
|
23035
23046
|
/**
|
|
23036
23047
|
“Smart” opening single quotes.
|
|
23037
23048
|
*/
|
|
23038
|
-
|
|
23049
|
+
new InputRule(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(')$/, "‘", { inCodeMark: false });
|
|
23039
23050
|
/**
|
|
23040
23051
|
“Smart” closing single quotes.
|
|
23041
23052
|
*/
|
|
23042
|
-
|
|
23043
|
-
/**
|
|
23044
|
-
Smart-quote related input rules.
|
|
23045
|
-
*/
|
|
23046
|
-
const smartQuotes = [openDoubleQuote, closeDoubleQuote, openSingleQuote, closeSingleQuote];
|
|
23053
|
+
new InputRule(/'$/, "’", { inCodeMark: false });
|
|
23047
23054
|
|
|
23048
23055
|
/**
|
|
23049
23056
|
Build an input rule for automatically wrapping a textblock when a
|
|
@@ -23341,7 +23348,7 @@ function headingRule(nodeType, maxLevel) {
|
|
|
23341
23348
|
// A set of input rules for creating the basic block quotes, lists,
|
|
23342
23349
|
// code blocks, and heading.
|
|
23343
23350
|
function buildInputRules(schema) {
|
|
23344
|
-
let rules =
|
|
23351
|
+
let rules = [], type;
|
|
23345
23352
|
if (type = schema.nodes.blockquote) rules.push(blockQuoteRule(type));
|
|
23346
23353
|
if (type = schema.nodes.ordered_list) rules.push(orderedListRule(type));
|
|
23347
23354
|
if (type = schema.nodes.bullet_list) rules.push(bulletListRule(type));
|
|
@@ -24744,15 +24751,15 @@ const MU = {
|
|
|
24744
24751
|
getLinkAttributes,
|
|
24745
24752
|
getSelectionState,
|
|
24746
24753
|
getTestHTML,
|
|
24747
|
-
indent,
|
|
24748
|
-
insertImage,
|
|
24749
|
-
insertLink,
|
|
24754
|
+
indent: indent$1,
|
|
24755
|
+
insertImage: insertImage$1,
|
|
24756
|
+
insertLink: insertLink$1,
|
|
24750
24757
|
insertTable,
|
|
24751
24758
|
loadUserFiles,
|
|
24752
24759
|
modifyImage,
|
|
24753
24760
|
openImageDialog,
|
|
24754
24761
|
openLinkDialog,
|
|
24755
|
-
outdent,
|
|
24762
|
+
outdent: outdent$1,
|
|
24756
24763
|
padBottom,
|
|
24757
24764
|
pasteHTML,
|
|
24758
24765
|
pasteText,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "markupeditor",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.6",
|
|
4
4
|
"description": "A web component and API for WYSIWYG HTML editing.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"wysiwyg",
|
|
@@ -18,7 +18,8 @@
|
|
|
18
18
|
"files": [
|
|
19
19
|
"dist",
|
|
20
20
|
"bin",
|
|
21
|
-
"styles"
|
|
21
|
+
"styles",
|
|
22
|
+
"config"
|
|
22
23
|
],
|
|
23
24
|
"license": "MIT",
|
|
24
25
|
"author": "Steven G. Harris <steven.g.harris@gmail.com>",
|
|
@@ -48,12 +49,13 @@
|
|
|
48
49
|
"@custom-elements-manifest/analyzer": "^0.11.0",
|
|
49
50
|
"@eslint/js": "^9.35.0",
|
|
50
51
|
"@rollup/plugin-node-resolve": "^16.0.0",
|
|
52
|
+
"@rollup/plugin-json": "6.1.0",
|
|
51
53
|
"eslint": "^9.35.0",
|
|
52
54
|
"jsdoc": "^4.0.5",
|
|
53
55
|
"jsdom": "^27.0.1",
|
|
54
56
|
"modern-jsdoc-template": "^1.0.0",
|
|
55
57
|
"rollup": "^4.31.0",
|
|
56
|
-
"rollup-plugin-import-css": "4.0.1",
|
|
58
|
+
"rollup-plugin-import-css": "4.0.1",
|
|
57
59
|
"vitest": "^3.2.4"
|
|
58
60
|
},
|
|
59
61
|
"scripts": {
|