@14ch/svelte-md-outliner 0.0.1
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.ja.md +190 -0
- package/README.md +190 -0
- package/dist/assets/styles/editor.css +1459 -0
- package/dist/assets/styles/theme.css +486 -0
- package/dist/components/ContextMenu.svelte +279 -0
- package/dist/components/ContextMenu.svelte.d.ts +9 -0
- package/dist/components/EditorSurface.svelte +99 -0
- package/dist/components/EditorSurface.svelte.d.ts +16 -0
- package/dist/components/FocusBreadcrumb.svelte +138 -0
- package/dist/components/FocusBreadcrumb.svelte.d.ts +16 -0
- package/dist/components/MarkdownEditor.svelte +393 -0
- package/dist/components/MarkdownEditor.svelte.d.ts +119 -0
- package/dist/components/ShortcutHelpDialog.svelte +155 -0
- package/dist/components/ShortcutHelpDialog.svelte.d.ts +12 -0
- package/dist/components/internal/Dialog.svelte +157 -0
- package/dist/components/internal/Dialog.svelte.d.ts +23 -0
- package/dist/components/internal/Modal.svelte +181 -0
- package/dist/components/internal/Modal.svelte.d.ts +18 -0
- package/dist/components/internal/Popup.svelte +248 -0
- package/dist/components/internal/Popup.svelte.d.ts +26 -0
- package/dist/index.d.ts +32 -0
- package/dist/index.js +28 -0
- package/dist/markdown.d.ts +13 -0
- package/dist/markdown.js +10 -0
- package/dist/messages/en.d.ts +2 -0
- package/dist/messages/en.js +107 -0
- package/dist/messages/index.d.ts +13 -0
- package/dist/messages/index.js +31 -0
- package/dist/messages/ja.d.ts +2 -0
- package/dist/messages/ja.js +112 -0
- package/dist/messages/messages.types.d.ts +59 -0
- package/dist/messages/messages.types.js +1 -0
- package/dist/models/document/bodySelection.d.ts +32 -0
- package/dist/models/document/bodySelection.js +43 -0
- package/dist/models/document/document.types.d.ts +27 -0
- package/dist/models/document/document.types.js +8 -0
- package/dist/models/document/foldable.d.ts +18 -0
- package/dist/models/document/foldable.js +21 -0
- package/dist/models/document/schema.d.ts +2 -0
- package/dist/models/document/schema.js +428 -0
- package/dist/models/document/sectionTree.d.ts +15 -0
- package/dist/models/document/sectionTree.js +123 -0
- package/dist/models/markdown/blockOutline.d.ts +9 -0
- package/dist/models/markdown/blockOutline.js +82 -0
- package/dist/models/markdown/frontMatter.d.ts +98 -0
- package/dist/models/markdown/frontMatter.js +300 -0
- package/dist/models/markdown/markdown.types.d.ts +60 -0
- package/dist/models/markdown/markdown.types.js +1 -0
- package/dist/models/markdown/markdownIt.d.ts +1 -0
- package/dist/models/markdown/markdownIt.js +92 -0
- package/dist/models/markdown/parser.d.ts +4 -0
- package/dist/models/markdown/parser.js +505 -0
- package/dist/models/markdown/plainText.d.ts +1 -0
- package/dist/models/markdown/plainText.js +25 -0
- package/dist/models/markdown/serializer.d.ts +17 -0
- package/dist/models/markdown/serializer.js +453 -0
- package/dist/models/viewState/viewState.types.d.ts +38 -0
- package/dist/models/viewState/viewState.types.js +17 -0
- package/dist/models/viewState/viewStateCodec.d.ts +31 -0
- package/dist/models/viewState/viewStateCodec.js +173 -0
- package/dist/operations/autoformat.d.ts +9 -0
- package/dist/operations/autoformat.js +86 -0
- package/dist/operations/commands/block.d.ts +24 -0
- package/dist/operations/commands/block.js +139 -0
- package/dist/operations/commands/codeBlock.d.ts +7 -0
- package/dist/operations/commands/codeBlock.js +26 -0
- package/dist/operations/commands/element.d.ts +67 -0
- package/dist/operations/commands/element.js +269 -0
- package/dist/operations/commands/frontMatter.d.ts +35 -0
- package/dist/operations/commands/frontMatter.js +120 -0
- package/dist/operations/commands/lineBreak.d.ts +9 -0
- package/dist/operations/commands/lineBreak.js +16 -0
- package/dist/operations/commands/link.d.ts +7 -0
- package/dist/operations/commands/link.js +21 -0
- package/dist/operations/commands/list.d.ts +126 -0
- package/dist/operations/commands/list.js +652 -0
- package/dist/operations/commands/mermaidBlock.d.ts +9 -0
- package/dist/operations/commands/mermaidBlock.js +28 -0
- package/dist/operations/commands/section.d.ts +217 -0
- package/dist/operations/commands/section.js +865 -0
- package/dist/operations/commands/sectionFold.d.ts +36 -0
- package/dist/operations/commands/sectionFold.js +219 -0
- package/dist/operations/commands/sectionJump.d.ts +8 -0
- package/dist/operations/commands/sectionJump.js +144 -0
- package/dist/operations/commands/selectedBlock.d.ts +37 -0
- package/dist/operations/commands/selectedBlock.js +170 -0
- package/dist/operations/commands/table.d.ts +64 -0
- package/dist/operations/commands/table.js +437 -0
- package/dist/operations/keymap/assemble.d.ts +22 -0
- package/dist/operations/keymap/assemble.js +165 -0
- package/dist/operations/keymap/coreActions.d.ts +2 -0
- package/dist/operations/keymap/coreActions.js +711 -0
- package/dist/operations/keymap/menuItems.d.ts +52 -0
- package/dist/operations/keymap/menuItems.js +114 -0
- package/dist/operations/keymap/shortcutKeys.d.ts +42 -0
- package/dist/operations/keymap/shortcutKeys.js +114 -0
- package/dist/operations/keymap/viewActions.d.ts +30 -0
- package/dist/operations/keymap/viewActions.js +182 -0
- package/dist/operations/operations.types.d.ts +121 -0
- package/dist/operations/operations.types.js +1 -0
- package/dist/operations/plugins/blockHandle.d.ts +25 -0
- package/dist/operations/plugins/blockHandle.js +112 -0
- package/dist/operations/plugins/contextMenu.d.ts +33 -0
- package/dist/operations/plugins/contextMenu.js +204 -0
- package/dist/operations/plugins/focus.d.ts +39 -0
- package/dist/operations/plugins/focus.js +350 -0
- package/dist/operations/plugins/foldClick.d.ts +11 -0
- package/dist/operations/plugins/foldClick.js +117 -0
- package/dist/operations/plugins/foldGuard.d.ts +15 -0
- package/dist/operations/plugins/foldGuard.js +31 -0
- package/dist/operations/plugins/frontMatterGuard.d.ts +21 -0
- package/dist/operations/plugins/frontMatterGuard.js +150 -0
- package/dist/operations/plugins/frontMatterView.d.ts +34 -0
- package/dist/operations/plugins/frontMatterView.js +137 -0
- package/dist/operations/plugins/linkPaste.d.ts +3 -0
- package/dist/operations/plugins/linkPaste.js +20 -0
- package/dist/operations/plugins/listStructure.d.ts +13 -0
- package/dist/operations/plugins/listStructure.js +18 -0
- package/dist/operations/plugins/markdownClipboard.d.ts +8 -0
- package/dist/operations/plugins/markdownClipboard.js +208 -0
- package/dist/operations/plugins/mermaidView.d.ts +20 -0
- package/dist/operations/plugins/mermaidView.js +206 -0
- package/dist/operations/plugins/requiredSelectionEntry.d.ts +10 -0
- package/dist/operations/plugins/requiredSelectionEntry.js +124 -0
- package/dist/operations/plugins/sectionView.d.ts +12 -0
- package/dist/operations/plugins/sectionView.js +44 -0
- package/dist/operations/plugins/tabEscape.d.ts +21 -0
- package/dist/operations/plugins/tabEscape.js +41 -0
- package/dist/operations/plugins/tableHandles.d.ts +24 -0
- package/dist/operations/plugins/tableHandles.js +89 -0
- package/dist/operations/transaction.d.ts +26 -0
- package/dist/operations/transaction.js +51 -0
- package/dist/operations/transactionOrigin.d.ts +17 -0
- package/dist/operations/transactionOrigin.js +9 -0
- package/dist/states/contextMenuController.svelte.d.ts +57 -0
- package/dist/states/contextMenuController.svelte.js +206 -0
- package/dist/states/editorSession.d.ts +12 -0
- package/dist/states/editorSession.js +268 -0
- package/dist/states/editorSession.types.d.ts +57 -0
- package/dist/states/editorSession.types.js +1 -0
- package/dist/states/outlineViewController.svelte.d.ts +52 -0
- package/dist/states/outlineViewController.svelte.js +134 -0
- package/dist/utils/dateText.d.ts +25 -0
- package/dist/utils/dateText.js +71 -0
- package/dist/utils/geometry.types.d.ts +13 -0
- package/dist/utils/geometry.types.js +1 -0
- package/dist/utils/json.types.d.ts +4 -0
- package/dist/utils/json.types.js +1 -0
- package/dist/utils/platform.d.ts +8 -0
- package/dist/utils/platform.js +10 -0
- package/dist/utils/result.types.d.ts +7 -0
- package/dist/utils/result.types.js +1 -0
- package/package.json +109 -0
|
@@ -0,0 +1,711 @@
|
|
|
1
|
+
import { toggleMark } from 'prosemirror-commands';
|
|
2
|
+
import { redo, undo } from 'prosemirror-history';
|
|
3
|
+
import { undoInputRule } from 'prosemirror-inputrules';
|
|
4
|
+
import { outlineSchema } from '../../models/document/schema';
|
|
5
|
+
import { isInCodeBlock } from '../commands/codeBlock';
|
|
6
|
+
import { inTable, liftByContext, moveByContext, sectionCommands, sinkByContext } from '../commands/element';
|
|
7
|
+
import { holdBackspaceAtFrontMatter } from '../commands/frontMatter';
|
|
8
|
+
import { insertLineBreak } from '../commands/lineBreak';
|
|
9
|
+
import { toggleLink } from '../commands/link';
|
|
10
|
+
import { listCommands } from '../commands/list';
|
|
11
|
+
import { mermaidBlockOnEnter } from '../commands/mermaidBlock';
|
|
12
|
+
import { dissolveHeadingAtStart, insertHeadingBefore, insertSectionAfter, removeEmptyLeadingBlock, targetSection } from '../commands/section';
|
|
13
|
+
import { requiredSelectionBlock } from '../commands/selectedBlock';
|
|
14
|
+
import { tableCommands } from '../commands/table';
|
|
15
|
+
import { verticalFromSelectedBlock } from '../plugins/requiredSelectionEntry';
|
|
16
|
+
import { enterTabEscape } from '../plugins/tabEscape';
|
|
17
|
+
/**
|
|
18
|
+
* 基盤の操作の宣言。**コマンド本体はここに書かない**(対象別の
|
|
19
|
+
* `operations/commands/` から import する)。宣言と組み立て(`assemble.ts`)を
|
|
20
|
+
* 分けることで、操作の一覧がコマンドの実装に埋もれない。
|
|
21
|
+
*
|
|
22
|
+
* 軸は操作であり、キーはその属性である。同じ操作を複数のキーで呼べる場合は、
|
|
23
|
+
* 定義を分けずに `keys` の並びへ足す。
|
|
24
|
+
*/
|
|
25
|
+
/**
|
|
26
|
+
* 対象が「内容物にカーソルがあるだけの要選択ブロック」か。
|
|
27
|
+
*
|
|
28
|
+
* カーソルが内容物にあるとき、メニューはその粒度のものだけを操作する。外側のブロック
|
|
29
|
+
* (表・引用・コードブロック)を動かす・消すには、まず指す(要選択の原則)。指した状態
|
|
30
|
+
* (kind: 'selectedBlock')は対象が見えているので出す。
|
|
31
|
+
*/
|
|
32
|
+
function unpointedRequiredSelectionTarget(state) {
|
|
33
|
+
const target = sectionCommands.targetElement(state);
|
|
34
|
+
return target?.kind === 'block' && requiredSelectionBlock.isRequiredSelectionBlock(target.node);
|
|
35
|
+
}
|
|
36
|
+
/** カーソルが属する箇条書きの項目の種別。項目の中でなければ null */
|
|
37
|
+
function listKindAt(state) {
|
|
38
|
+
const kind = listCommands.enclosingListItem(state)?.node.attrs.kind;
|
|
39
|
+
return typeof kind === 'string' ? kind : null;
|
|
40
|
+
}
|
|
41
|
+
/** カーソルが引用の中にあるか。もっとも内側の要選択ブロックで見る */
|
|
42
|
+
function isInBlockquote(state) {
|
|
43
|
+
const block = requiredSelectionBlock.enclosingBlock(state.selection.$from);
|
|
44
|
+
return block?.node.type === outlineSchema.nodes.blockquote;
|
|
45
|
+
}
|
|
46
|
+
export const coreActions = [
|
|
47
|
+
/**
|
|
48
|
+
* 表の操作は、**同じキーを持つ既存の項目より前に置く。**
|
|
49
|
+
*
|
|
50
|
+
* `bindingsOf` は同じキーの操作を定義順に連鎖させ、先に `true` を返した方で止まる。
|
|
51
|
+
* セクションの移動は「動かせなくてもキーを受け止める」ため常に `true` を返し、
|
|
52
|
+
* 後ろに置くと表の中で行の移動へ到達しない。
|
|
53
|
+
*
|
|
54
|
+
* セクションの移動(修飾キー + カーソルキー)が、表の中では行・列の入れ替えになる。
|
|
55
|
+
* 同じ指の運びで、対象がセクションから行・列へ変わる。
|
|
56
|
+
*/
|
|
57
|
+
{
|
|
58
|
+
id: 'table.insertRowBefore',
|
|
59
|
+
category: 'table',
|
|
60
|
+
scope: 'item',
|
|
61
|
+
listed: true,
|
|
62
|
+
changesDocument: true,
|
|
63
|
+
keys: [{ key: 'Enter', mod: true }],
|
|
64
|
+
command: inTable(tableCommands.insertRowBefore),
|
|
65
|
+
// 表の中でしか実行できない。メニューは文脈が決まっているので条件を繰り返さない
|
|
66
|
+
variantId: () => 'table.insertRowBefore.inTable'
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
id: 'table.insertRowAfter',
|
|
70
|
+
category: 'table',
|
|
71
|
+
scope: 'item',
|
|
72
|
+
listed: true,
|
|
73
|
+
changesDocument: true,
|
|
74
|
+
keys: [{ key: 'Enter' }],
|
|
75
|
+
command: inTable(tableCommands.insertRowAfter),
|
|
76
|
+
variantId: () => 'table.insertRowAfter.inTable'
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
id: 'table.insertColumnBefore',
|
|
80
|
+
category: 'table',
|
|
81
|
+
scope: 'item',
|
|
82
|
+
listed: true,
|
|
83
|
+
changesDocument: true,
|
|
84
|
+
keys: [{ key: '[', mod: true, alt: true }],
|
|
85
|
+
command: inTable(tableCommands.insertColumnBefore)
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
id: 'table.insertColumnAfter',
|
|
89
|
+
category: 'table',
|
|
90
|
+
scope: 'item',
|
|
91
|
+
listed: true,
|
|
92
|
+
changesDocument: true,
|
|
93
|
+
keys: [{ key: ']', mod: true, alt: true }],
|
|
94
|
+
command: inTable(tableCommands.insertColumnAfter)
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
id: 'table.deleteSelected',
|
|
98
|
+
category: 'table',
|
|
99
|
+
scope: 'item',
|
|
100
|
+
listed: true,
|
|
101
|
+
changesDocument: true,
|
|
102
|
+
keys: [{ key: 'Backspace', mod: true, shift: true }],
|
|
103
|
+
command: inTable(tableCommands.deleteSelected),
|
|
104
|
+
variantId: () => 'table.deleteSelected.inTable'
|
|
105
|
+
},
|
|
106
|
+
// 修飾キーを伴わない削除。なぞって選んで消す、が成り立つようにする。
|
|
107
|
+
// 覆いきらない選択では譲るため、セルの中身を空にする既定の意味は残る
|
|
108
|
+
{
|
|
109
|
+
id: 'table.deleteRowOrColumn',
|
|
110
|
+
category: 'table',
|
|
111
|
+
scope: 'item',
|
|
112
|
+
listed: true,
|
|
113
|
+
changesDocument: true,
|
|
114
|
+
keys: [{ key: 'Backspace' }],
|
|
115
|
+
command: tableCommands.deleteSelectedRowOrColumn,
|
|
116
|
+
variantId: () => 'table.deleteRowOrColumn.inTable'
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
id: 'table.moveRowUp',
|
|
120
|
+
category: 'table',
|
|
121
|
+
scope: 'item',
|
|
122
|
+
listed: true,
|
|
123
|
+
changesDocument: true,
|
|
124
|
+
keys: [{ key: 'ArrowUp', mod: true }],
|
|
125
|
+
command: inTable(tableCommands.moveRow('up')),
|
|
126
|
+
variantId: () => 'table.moveRowUp.inTable'
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
id: 'table.moveRowDown',
|
|
130
|
+
category: 'table',
|
|
131
|
+
scope: 'item',
|
|
132
|
+
listed: true,
|
|
133
|
+
changesDocument: true,
|
|
134
|
+
keys: [{ key: 'ArrowDown', mod: true }],
|
|
135
|
+
command: inTable(tableCommands.moveRow('down')),
|
|
136
|
+
variantId: () => 'table.moveRowDown.inTable'
|
|
137
|
+
},
|
|
138
|
+
// 表の中での左右キーの意味は、セル間の移動から列の入れ替えへ置き換える。
|
|
139
|
+
// セル間の移動は `Tab` と矢印キーで行えるため、重複していた
|
|
140
|
+
{
|
|
141
|
+
id: 'table.moveColumnLeft',
|
|
142
|
+
category: 'table',
|
|
143
|
+
scope: 'item',
|
|
144
|
+
listed: true,
|
|
145
|
+
changesDocument: true,
|
|
146
|
+
keys: [{ key: 'ArrowLeft', mod: true }],
|
|
147
|
+
command: inTable(tableCommands.moveColumn('left')),
|
|
148
|
+
variantId: () => 'table.moveColumnLeft.inTable'
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
id: 'table.moveColumnRight',
|
|
152
|
+
category: 'table',
|
|
153
|
+
scope: 'item',
|
|
154
|
+
listed: true,
|
|
155
|
+
changesDocument: true,
|
|
156
|
+
keys: [{ key: 'ArrowRight', mod: true }],
|
|
157
|
+
command: inTable(tableCommands.moveColumn('right')),
|
|
158
|
+
variantId: () => 'table.moveColumnRight.inTable'
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
id: 'table.alignLeftward',
|
|
162
|
+
category: 'table',
|
|
163
|
+
scope: 'item',
|
|
164
|
+
listed: true,
|
|
165
|
+
changesDocument: true,
|
|
166
|
+
keys: [{ key: 'ArrowLeft', mod: true, alt: true, shift: true }],
|
|
167
|
+
command: inTable(tableCommands.align('leftward'))
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
id: 'table.alignRightward',
|
|
171
|
+
category: 'table',
|
|
172
|
+
scope: 'item',
|
|
173
|
+
listed: true,
|
|
174
|
+
changesDocument: true,
|
|
175
|
+
keys: [{ key: 'ArrowRight', mod: true, alt: true, shift: true }],
|
|
176
|
+
command: inTable(tableCommands.align('rightward'))
|
|
177
|
+
},
|
|
178
|
+
/**
|
|
179
|
+
* 代替のキーは**独立した定義にせず、この並びの 2 番目以降**に置く。
|
|
180
|
+
*
|
|
181
|
+
* 2 つ目は修飾キーを伴う代替。3 つ目はカーソルキーによる代替で、上下移動
|
|
182
|
+
* (`Mod-ArrowUp` / `Mod-ArrowDown`)と対にすることで、構造を動かす操作が
|
|
183
|
+
* 縦横すべて修飾キー + カーソルキーに揃う。
|
|
184
|
+
*
|
|
185
|
+
* カーソルキーでは実行環境の既定の動きが使えなくなる(意図した割り切り)。macOS では
|
|
186
|
+
* 行頭・行末への移動(`Ctrl-A` / `Ctrl-E` が残る)、その他では単語単位の移動が該当する。
|
|
187
|
+
* 選択を伴う `Shift` つきの組み合わせは奪わないため、単語単位の選択は残る。
|
|
188
|
+
*/
|
|
189
|
+
{
|
|
190
|
+
id: 'hierarchy.sink',
|
|
191
|
+
category: 'subtree',
|
|
192
|
+
scope: 'item',
|
|
193
|
+
listed: true,
|
|
194
|
+
changesDocument: true,
|
|
195
|
+
keys: [{ key: 'Tab' }, { key: ']', mod: true }, { key: 'ArrowRight', mod: true }],
|
|
196
|
+
command: sinkByContext,
|
|
197
|
+
/**
|
|
198
|
+
* `Tab` は文脈で意味が変わる唯一のキーであり、メニューでは総称ではなく
|
|
199
|
+
* **この場で起きること**を言う。分岐は `sinkByContext` と同じ判定
|
|
200
|
+
* (字下げの判定 → `targetElement` の種別)から導き、別の決め方を持たない。
|
|
201
|
+
*
|
|
202
|
+
* 段落では「箇条書きにする」と同じ結果になるため、独立した項目として出さない。
|
|
203
|
+
*/
|
|
204
|
+
variantId: (state) => {
|
|
205
|
+
if (isInCodeBlock(state))
|
|
206
|
+
return 'hierarchy.sink.indent';
|
|
207
|
+
const kind = sectionCommands.targetElement(state)?.kind;
|
|
208
|
+
if (kind === 'selectedBlock')
|
|
209
|
+
return 'hierarchy.sink.intoItem';
|
|
210
|
+
if (kind === 'section')
|
|
211
|
+
return 'hierarchy.sink.heading';
|
|
212
|
+
if (kind === 'listItem')
|
|
213
|
+
return 'hierarchy.sink';
|
|
214
|
+
return null;
|
|
215
|
+
}
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
id: 'hierarchy.lift',
|
|
219
|
+
category: 'subtree',
|
|
220
|
+
scope: 'item',
|
|
221
|
+
listed: true,
|
|
222
|
+
changesDocument: true,
|
|
223
|
+
keys: [
|
|
224
|
+
{ key: 'Tab', shift: true },
|
|
225
|
+
{ key: '[', mod: true },
|
|
226
|
+
{ key: 'ArrowLeft', mod: true }
|
|
227
|
+
],
|
|
228
|
+
command: liftByContext,
|
|
229
|
+
variantId: (state) => {
|
|
230
|
+
if (isInCodeBlock(state))
|
|
231
|
+
return 'hierarchy.lift.indent';
|
|
232
|
+
const kind = sectionCommands.targetElement(state)?.kind;
|
|
233
|
+
if (kind === 'selectedBlock')
|
|
234
|
+
return 'hierarchy.lift.outOfItem';
|
|
235
|
+
if (kind === 'section')
|
|
236
|
+
return 'hierarchy.lift.heading';
|
|
237
|
+
if (kind === 'listItem')
|
|
238
|
+
return 'hierarchy.lift';
|
|
239
|
+
return null;
|
|
240
|
+
}
|
|
241
|
+
},
|
|
242
|
+
// 上下移動は使う頻度が高いため、修飾キーを 1 つに抑える。
|
|
243
|
+
// macOS の `Cmd-ArrowUp` / `Cmd-ArrowDown` は本来「文書の先頭・末尾へ移動」
|
|
244
|
+
// に割り当てられており、その既定の動きは使えなくなる(意図した割り切り)。
|
|
245
|
+
{
|
|
246
|
+
id: 'subtree.moveUp',
|
|
247
|
+
category: 'subtree',
|
|
248
|
+
scope: 'item',
|
|
249
|
+
listed: true,
|
|
250
|
+
changesDocument: true,
|
|
251
|
+
keys: [{ key: 'ArrowUp', mod: true }],
|
|
252
|
+
command: moveByContext('up'),
|
|
253
|
+
variantId: (state) => (unpointedRequiredSelectionTarget(state) ? null : 'subtree.moveUp')
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
id: 'subtree.moveDown',
|
|
257
|
+
category: 'subtree',
|
|
258
|
+
scope: 'item',
|
|
259
|
+
listed: true,
|
|
260
|
+
changesDocument: true,
|
|
261
|
+
keys: [{ key: 'ArrowDown', mod: true }],
|
|
262
|
+
command: moveByContext('down'),
|
|
263
|
+
variantId: (state) => (unpointedRequiredSelectionTarget(state) ? null : 'subtree.moveDown')
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
id: 'subtree.duplicate',
|
|
267
|
+
category: 'edit',
|
|
268
|
+
scope: 'item',
|
|
269
|
+
listed: true,
|
|
270
|
+
changesDocument: true,
|
|
271
|
+
keys: [{ key: 'd', mod: true, shift: true }],
|
|
272
|
+
command: sectionCommands.duplicateElement,
|
|
273
|
+
variantId: (state) => (unpointedRequiredSelectionTarget(state) ? null : 'subtree.duplicate')
|
|
274
|
+
},
|
|
275
|
+
{
|
|
276
|
+
id: 'format.toggleTask',
|
|
277
|
+
category: 'edit',
|
|
278
|
+
scope: 'item',
|
|
279
|
+
listed: true,
|
|
280
|
+
changesDocument: true,
|
|
281
|
+
// Enter の並びで最も打ちにくい位置。使う頻度が最も低く、マウスでも切り替えられる
|
|
282
|
+
keys: [{ key: 'Enter', mod: true, alt: true }],
|
|
283
|
+
command: listCommands.toggleTaskChecked,
|
|
284
|
+
/**
|
|
285
|
+
* **メニューには出さない。** チェックは印を直接押して切り替えられるので、
|
|
286
|
+
* 同じことをする項目をメニューへ重ねない。`null` は「この文脈では独立した
|
|
287
|
+
* 項目として出さない」を表し、キーからの実行は残る。
|
|
288
|
+
*/
|
|
289
|
+
variantId: () => null
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
id: 'subtree.delete',
|
|
293
|
+
category: 'edit',
|
|
294
|
+
scope: 'item',
|
|
295
|
+
listed: true,
|
|
296
|
+
changesDocument: true,
|
|
297
|
+
keys: [{ key: 'Backspace', mod: true, shift: true }],
|
|
298
|
+
command: sectionCommands.deleteElement,
|
|
299
|
+
variantId: (state) => (unpointedRequiredSelectionTarget(state) ? null : 'subtree.delete')
|
|
300
|
+
},
|
|
301
|
+
{
|
|
302
|
+
id: 'document.undo',
|
|
303
|
+
category: 'document',
|
|
304
|
+
scope: 'document',
|
|
305
|
+
listed: true,
|
|
306
|
+
changesDocument: true,
|
|
307
|
+
keys: [{ key: 'z', mod: true }],
|
|
308
|
+
command: undo
|
|
309
|
+
},
|
|
310
|
+
{
|
|
311
|
+
id: 'document.redo',
|
|
312
|
+
category: 'document',
|
|
313
|
+
scope: 'document',
|
|
314
|
+
listed: true,
|
|
315
|
+
changesDocument: true,
|
|
316
|
+
keys: [{ key: 'z', mod: true, shift: true }],
|
|
317
|
+
command: redo
|
|
318
|
+
},
|
|
319
|
+
{
|
|
320
|
+
id: 'editing.escapeTab',
|
|
321
|
+
category: 'document',
|
|
322
|
+
scope: 'input',
|
|
323
|
+
listed: true,
|
|
324
|
+
// 読み取り専用でも塞がない。塞ぐとキーボードで編集エリアから出られなくなる
|
|
325
|
+
changesDocument: false,
|
|
326
|
+
keys: [{ key: 'Escape' }],
|
|
327
|
+
command: enterTabEscape
|
|
328
|
+
},
|
|
329
|
+
{
|
|
330
|
+
// 行頭の ```mermaid に続く改行での変換(要件 6.4 の改行側。空白側は InputRule)。
|
|
331
|
+
// 項目の中の段落でも働くよう、Enter の並びで splitListItem より前に置く
|
|
332
|
+
id: 'editing.mermaidBlockOnEnter',
|
|
333
|
+
category: 'format',
|
|
334
|
+
scope: 'input',
|
|
335
|
+
listed: false,
|
|
336
|
+
changesDocument: true,
|
|
337
|
+
keys: [{ key: 'Enter' }],
|
|
338
|
+
command: mermaidBlockOnEnter
|
|
339
|
+
},
|
|
340
|
+
{
|
|
341
|
+
id: 'editing.splitListItem',
|
|
342
|
+
category: 'edit',
|
|
343
|
+
scope: 'input',
|
|
344
|
+
listed: true,
|
|
345
|
+
changesDocument: true,
|
|
346
|
+
keys: [{ key: 'Enter' }],
|
|
347
|
+
command: listCommands.splitListItem
|
|
348
|
+
},
|
|
349
|
+
/**
|
|
350
|
+
* 見出しの先頭での `Enter`。ここに割り当てが無いと編集基盤の既定の分割まで落ち、
|
|
351
|
+
* セクションが見出しを 2 つ持てないぶん**後ろ半分が段落になる**。見出しが空になって
|
|
352
|
+
* 中身が下の段落へ落ちるため、見出しが段落に化けたように見える。
|
|
353
|
+
*
|
|
354
|
+
* 項目の分割(`editing.splitListItem`)より後ろでよい。見出しは項目の中に来ない
|
|
355
|
+
*/
|
|
356
|
+
{
|
|
357
|
+
id: 'editing.insertHeadingBefore',
|
|
358
|
+
category: 'document',
|
|
359
|
+
scope: 'input',
|
|
360
|
+
listed: true,
|
|
361
|
+
changesDocument: true,
|
|
362
|
+
keys: [{ key: 'Enter' }],
|
|
363
|
+
command: insertHeadingBefore
|
|
364
|
+
},
|
|
365
|
+
/**
|
|
366
|
+
* 段落を分けずに改行する。`Shift+Enter` は多くのエディタでこの意味を持つ。
|
|
367
|
+
*
|
|
368
|
+
* 置けない場所(見出し・表のセル)では偽を返し、何も起きない。同じキーへ別の意味を
|
|
369
|
+
* 用意しないのは、キーの意味を場所ごとに覚えることになるためである。
|
|
370
|
+
*/
|
|
371
|
+
{
|
|
372
|
+
id: 'editing.insertLineBreak',
|
|
373
|
+
category: 'edit',
|
|
374
|
+
scope: 'input',
|
|
375
|
+
listed: true,
|
|
376
|
+
changesDocument: true,
|
|
377
|
+
keys: [{ key: 'Enter', shift: true }],
|
|
378
|
+
command: insertLineBreak
|
|
379
|
+
},
|
|
380
|
+
/**
|
|
381
|
+
* いまいるセクションの下に、空の見出しのセクションを足す。
|
|
382
|
+
*
|
|
383
|
+
* `Shift+Enter` は段落内改行に譲った(→ `editing.insertLineBreak`)。修飾キーが
|
|
384
|
+
* 1 つ増えるが、`⌘Enter`(見出しにする)・`⌥⌘Enter`(チェック)・`⇧⌥⌘Enter`(表)と
|
|
385
|
+
* 同じ Enter の並びに収まる。
|
|
386
|
+
*
|
|
387
|
+
* 分類を `edit` にするのは、取り消しを独立した単位にするためである(→ `OWN_UNDO_STEP`)。
|
|
388
|
+
* 打った文字と同じ単位に入ると、1 回の取り消しで文字まで消える。
|
|
389
|
+
*/
|
|
390
|
+
{
|
|
391
|
+
id: 'editing.insertSectionAfter',
|
|
392
|
+
category: 'edit',
|
|
393
|
+
scope: 'input',
|
|
394
|
+
listed: true,
|
|
395
|
+
changesDocument: true,
|
|
396
|
+
keys: [{ key: 'Enter', mod: true, shift: true }],
|
|
397
|
+
command: insertSectionAfter
|
|
398
|
+
},
|
|
399
|
+
{
|
|
400
|
+
id: 'format.bold',
|
|
401
|
+
category: 'format',
|
|
402
|
+
scope: 'selection',
|
|
403
|
+
listed: true,
|
|
404
|
+
changesDocument: true,
|
|
405
|
+
keys: [{ key: 'b', mod: true }],
|
|
406
|
+
command: toggleMark(outlineSchema.marks.strong)
|
|
407
|
+
},
|
|
408
|
+
{
|
|
409
|
+
id: 'format.italic',
|
|
410
|
+
category: 'format',
|
|
411
|
+
scope: 'selection',
|
|
412
|
+
listed: true,
|
|
413
|
+
changesDocument: true,
|
|
414
|
+
keys: [{ key: 'i', mod: true }],
|
|
415
|
+
command: toggleMark(outlineSchema.marks.em)
|
|
416
|
+
},
|
|
417
|
+
{
|
|
418
|
+
id: 'format.code',
|
|
419
|
+
category: 'format',
|
|
420
|
+
scope: 'selection',
|
|
421
|
+
listed: true,
|
|
422
|
+
changesDocument: true,
|
|
423
|
+
keys: [{ key: 'e', mod: true }],
|
|
424
|
+
command: toggleMark(outlineSchema.marks.code)
|
|
425
|
+
},
|
|
426
|
+
{
|
|
427
|
+
id: 'format.strikethrough',
|
|
428
|
+
category: 'format',
|
|
429
|
+
scope: 'selection',
|
|
430
|
+
listed: true,
|
|
431
|
+
changesDocument: true,
|
|
432
|
+
keys: [{ key: 'x', mod: true, shift: true }],
|
|
433
|
+
command: toggleMark(outlineSchema.marks.strikethrough)
|
|
434
|
+
},
|
|
435
|
+
{
|
|
436
|
+
id: 'format.link',
|
|
437
|
+
category: 'format',
|
|
438
|
+
scope: 'selection',
|
|
439
|
+
listed: true,
|
|
440
|
+
changesDocument: true,
|
|
441
|
+
keys: [{ key: 'k', mod: true }],
|
|
442
|
+
command: toggleLink
|
|
443
|
+
},
|
|
444
|
+
{
|
|
445
|
+
id: 'format.heading',
|
|
446
|
+
category: 'convert',
|
|
447
|
+
scope: 'item',
|
|
448
|
+
listed: true,
|
|
449
|
+
changesDocument: true,
|
|
450
|
+
// このエディタで最も多い操作なので、Enter の並びで最も打ちやすい位置を与える。
|
|
451
|
+
// 文字キーを避けるのは、`Cmd+Shift` + 文字が拡張機能・常駐アプリの取り合いに
|
|
452
|
+
// なっているため(スクリーンショット系など)。Enter はそこから外れる
|
|
453
|
+
keys: [{ key: 'Enter', mod: true }],
|
|
454
|
+
command: sectionCommands.toggleHeading,
|
|
455
|
+
// 見出しの上なら戻す側、それ以外なら見出しにする側に決まる
|
|
456
|
+
variantId: (state) => targetSection(state) ? 'format.heading.toListItem' : 'format.heading.toHeading'
|
|
457
|
+
},
|
|
458
|
+
{
|
|
459
|
+
id: 'format.paragraph',
|
|
460
|
+
category: 'convert',
|
|
461
|
+
scope: 'item',
|
|
462
|
+
listed: true,
|
|
463
|
+
changesDocument: true,
|
|
464
|
+
keys: [{ key: '0', mod: true, alt: true }],
|
|
465
|
+
command: sectionCommands.setBlockKind('paragraph')
|
|
466
|
+
},
|
|
467
|
+
{
|
|
468
|
+
id: 'format.bulletList',
|
|
469
|
+
category: 'convert',
|
|
470
|
+
scope: 'item',
|
|
471
|
+
listed: true,
|
|
472
|
+
changesDocument: true,
|
|
473
|
+
keys: [{ key: '8', mod: true, shift: true }],
|
|
474
|
+
command: sectionCommands.setBlockKind('bullet_list'),
|
|
475
|
+
/**
|
|
476
|
+
* いまの種別への変換は**実体が解除**で、結果は段落になる。「箇条書きをやめる」と
|
|
477
|
+
* 書くと番号なしリスト行きと誤読されるため項目としては出さず、結果を正しく名乗る
|
|
478
|
+
* 「段落にする」に委ねる(キーは従来どおり働く)。
|
|
479
|
+
*/
|
|
480
|
+
variantId: (state) => (listKindAt(state) === 'bullet' ? null : 'format.bulletList')
|
|
481
|
+
},
|
|
482
|
+
{
|
|
483
|
+
id: 'format.orderedList',
|
|
484
|
+
category: 'convert',
|
|
485
|
+
scope: 'item',
|
|
486
|
+
listed: true,
|
|
487
|
+
changesDocument: true,
|
|
488
|
+
keys: [{ key: '7', mod: true, shift: true }],
|
|
489
|
+
command: sectionCommands.setBlockKind('ordered_list'),
|
|
490
|
+
variantId: (state) => (listKindAt(state) === 'ordered' ? null : 'format.orderedList')
|
|
491
|
+
},
|
|
492
|
+
{
|
|
493
|
+
id: 'format.taskList',
|
|
494
|
+
category: 'convert',
|
|
495
|
+
scope: 'item',
|
|
496
|
+
listed: true,
|
|
497
|
+
changesDocument: true,
|
|
498
|
+
keys: [{ key: '9', mod: true, shift: true }],
|
|
499
|
+
command: sectionCommands.setBlockKind('task_list'),
|
|
500
|
+
variantId: (state) => (listKindAt(state) === 'task' ? null : 'format.taskList')
|
|
501
|
+
},
|
|
502
|
+
{
|
|
503
|
+
id: 'format.blockquote',
|
|
504
|
+
category: 'convert',
|
|
505
|
+
scope: 'item',
|
|
506
|
+
listed: true,
|
|
507
|
+
changesDocument: true,
|
|
508
|
+
keys: [{ key: '.', mod: true, shift: true }],
|
|
509
|
+
command: sectionCommands.setBlockKind('blockquote'),
|
|
510
|
+
variantId: (state) => (isInBlockquote(state) ? null : 'format.blockquote')
|
|
511
|
+
},
|
|
512
|
+
{
|
|
513
|
+
id: 'format.codeBlock',
|
|
514
|
+
category: 'convert',
|
|
515
|
+
scope: 'item',
|
|
516
|
+
listed: true,
|
|
517
|
+
changesDocument: true,
|
|
518
|
+
// 引用にする(⌘⇧.)の隣。どちらもブロックを何かで包む操作なので並びとして読める。
|
|
519
|
+
// 記号を使うのは、修飾キー 2 つ + 文字が拡張機能・DevTools の取り合いになっているため
|
|
520
|
+
keys: [{ key: ',', mod: true, shift: true }],
|
|
521
|
+
command: sectionCommands.setBlockKind('code_block')
|
|
522
|
+
},
|
|
523
|
+
{
|
|
524
|
+
id: 'table.create',
|
|
525
|
+
category: 'insert',
|
|
526
|
+
scope: 'item',
|
|
527
|
+
listed: true,
|
|
528
|
+
changesDocument: true,
|
|
529
|
+
keys: [{ key: 'Enter', mod: true, alt: true, shift: true }],
|
|
530
|
+
command: tableCommands.createTable
|
|
531
|
+
},
|
|
532
|
+
{
|
|
533
|
+
id: 'editing.undoInputRule',
|
|
534
|
+
category: 'document',
|
|
535
|
+
scope: 'input',
|
|
536
|
+
listed: true,
|
|
537
|
+
changesDocument: true,
|
|
538
|
+
keys: [{ key: 'Backspace' }],
|
|
539
|
+
// 自動変換の直後の取り消しで、打った記法の文字がそのまま残る
|
|
540
|
+
command: undoInputRule
|
|
541
|
+
},
|
|
542
|
+
{
|
|
543
|
+
id: 'editing.dissolveHeading',
|
|
544
|
+
category: 'document',
|
|
545
|
+
scope: 'input',
|
|
546
|
+
listed: true,
|
|
547
|
+
changesDocument: true,
|
|
548
|
+
keys: [{ key: 'Backspace' }],
|
|
549
|
+
command: dissolveHeadingAtStart
|
|
550
|
+
},
|
|
551
|
+
/**
|
|
552
|
+
* ここから下は**一覧に出さない割り当て**である。操作ではなくカーソルの動きと、
|
|
553
|
+
* 編集基盤の既定の差し替えであり、書き手が覚えるものではない。
|
|
554
|
+
*
|
|
555
|
+
* 一覧に出さないことと、覆い(変換中の抑止・読み取り専用の遮断・取り消し単位)を
|
|
556
|
+
* 掛けるかどうかは**別のことである**。同じ経路を通し、宣言と分類で決める。
|
|
557
|
+
*/
|
|
558
|
+
/**
|
|
559
|
+
* 全選択を段階的にする。中身全体 → そのブロック → 文書全体。
|
|
560
|
+
*
|
|
561
|
+
* 一覧に出さないのは、既存の全選択と同じキーであり、覚えることが増えないためである。
|
|
562
|
+
* 最後の段は今までの全選択とまったく同じ結果になる。
|
|
563
|
+
*/
|
|
564
|
+
{
|
|
565
|
+
id: 'editing.expandSelection',
|
|
566
|
+
category: 'document',
|
|
567
|
+
scope: 'input',
|
|
568
|
+
listed: false,
|
|
569
|
+
changesDocument: false,
|
|
570
|
+
keys: [{ key: 'a', mod: true }],
|
|
571
|
+
command: requiredSelectionBlock.expandSelection
|
|
572
|
+
},
|
|
573
|
+
/**
|
|
574
|
+
* 指している状態からの上下移動。入ってきたのと同じ向きなら中へ、逆なら外へ。
|
|
575
|
+
* 指していないときは譲るので、後段の割り当て(表のセル移動)と両立する。
|
|
576
|
+
*/
|
|
577
|
+
{
|
|
578
|
+
id: 'editing.selectedBlockUp',
|
|
579
|
+
category: 'document',
|
|
580
|
+
scope: 'input',
|
|
581
|
+
listed: false,
|
|
582
|
+
changesDocument: false,
|
|
583
|
+
keys: [{ key: 'ArrowUp' }],
|
|
584
|
+
command: verticalFromSelectedBlock('up')
|
|
585
|
+
},
|
|
586
|
+
{
|
|
587
|
+
id: 'editing.selectedBlockDown',
|
|
588
|
+
category: 'document',
|
|
589
|
+
scope: 'input',
|
|
590
|
+
listed: false,
|
|
591
|
+
changesDocument: false,
|
|
592
|
+
keys: [{ key: 'ArrowDown' }],
|
|
593
|
+
command: verticalFromSelectedBlock('down')
|
|
594
|
+
},
|
|
595
|
+
{
|
|
596
|
+
id: 'editing.cellAbove',
|
|
597
|
+
category: 'document',
|
|
598
|
+
scope: 'input',
|
|
599
|
+
listed: false,
|
|
600
|
+
changesDocument: false,
|
|
601
|
+
keys: [{ key: 'ArrowUp' }],
|
|
602
|
+
command: tableCommands.goToCellAbove
|
|
603
|
+
},
|
|
604
|
+
{
|
|
605
|
+
id: 'editing.cellBelow',
|
|
606
|
+
category: 'document',
|
|
607
|
+
scope: 'input',
|
|
608
|
+
listed: false,
|
|
609
|
+
changesDocument: false,
|
|
610
|
+
keys: [{ key: 'ArrowDown' }],
|
|
611
|
+
command: tableCommands.goToCellBelow
|
|
612
|
+
},
|
|
613
|
+
/**
|
|
614
|
+
* セル範囲の選択をキーボードだけで作る。表の外では譲るので、文字の選択は変わらない。
|
|
615
|
+
*
|
|
616
|
+
* 一覧に出さないのは、`Shift` を押しながらの移動が「選択を広げる」を意味することが
|
|
617
|
+
* 文字の選択と共通の作法であり、表のための決まりごとを増やさないためである。
|
|
618
|
+
*/
|
|
619
|
+
{
|
|
620
|
+
id: 'editing.extendCellsUp',
|
|
621
|
+
category: 'document',
|
|
622
|
+
scope: 'input',
|
|
623
|
+
listed: false,
|
|
624
|
+
changesDocument: false,
|
|
625
|
+
keys: [{ key: 'ArrowUp', shift: true }],
|
|
626
|
+
command: tableCommands.extendSelection('up')
|
|
627
|
+
},
|
|
628
|
+
{
|
|
629
|
+
id: 'editing.extendCellsDown',
|
|
630
|
+
category: 'document',
|
|
631
|
+
scope: 'input',
|
|
632
|
+
listed: false,
|
|
633
|
+
changesDocument: false,
|
|
634
|
+
keys: [{ key: 'ArrowDown', shift: true }],
|
|
635
|
+
command: tableCommands.extendSelection('down')
|
|
636
|
+
},
|
|
637
|
+
{
|
|
638
|
+
id: 'editing.extendCellsLeft',
|
|
639
|
+
category: 'document',
|
|
640
|
+
scope: 'input',
|
|
641
|
+
listed: false,
|
|
642
|
+
changesDocument: false,
|
|
643
|
+
keys: [{ key: 'ArrowLeft', shift: true }],
|
|
644
|
+
command: tableCommands.extendSelection('left')
|
|
645
|
+
},
|
|
646
|
+
{
|
|
647
|
+
id: 'editing.extendCellsRight',
|
|
648
|
+
category: 'document',
|
|
649
|
+
scope: 'input',
|
|
650
|
+
listed: false,
|
|
651
|
+
changesDocument: false,
|
|
652
|
+
keys: [{ key: 'ArrowRight', shift: true }],
|
|
653
|
+
command: tableCommands.extendSelection('right')
|
|
654
|
+
},
|
|
655
|
+
/**
|
|
656
|
+
* 文書の先頭の空行の削除。
|
|
657
|
+
*
|
|
658
|
+
* 先頭には繋げる相手がいないため、結合の連鎖は最後まで誰も受け止めない。後ろに内容が
|
|
659
|
+
* あっても**先頭の空行だけが消せない**状態になっていた。相手がいないなら、繋げる
|
|
660
|
+
* かわりにその行を取り除く(→ `removeEmptyLeadingBlock`)。
|
|
661
|
+
*
|
|
662
|
+
* 見出しの解除(`editing.dissolveHeading`)より後ろに置く。あちらが「移す先が無い」
|
|
663
|
+
* として譲った先頭のセクションだけが、ここへ来る。
|
|
664
|
+
*/
|
|
665
|
+
{
|
|
666
|
+
id: 'editing.removeEmptyLeadingBlock',
|
|
667
|
+
category: 'document',
|
|
668
|
+
scope: 'input',
|
|
669
|
+
listed: false,
|
|
670
|
+
changesDocument: true,
|
|
671
|
+
keys: [{ key: 'Backspace' }],
|
|
672
|
+
command: removeEmptyLeadingBlock
|
|
673
|
+
},
|
|
674
|
+
/**
|
|
675
|
+
* 本文の先頭でフロントマターへ繋げない(→ `holdBackspaceAtFrontMatter`)。
|
|
676
|
+
*
|
|
677
|
+
* 空の先頭行を取り除く道(`editing.removeEmptyLeadingBlock`)より後ろに置く。
|
|
678
|
+
* あちらが受け止めなかったものだけがここへ来る。
|
|
679
|
+
*/
|
|
680
|
+
{
|
|
681
|
+
id: 'editing.holdBackspaceAtFrontMatter',
|
|
682
|
+
category: 'document',
|
|
683
|
+
scope: 'input',
|
|
684
|
+
listed: false,
|
|
685
|
+
changesDocument: true,
|
|
686
|
+
keys: [{ key: 'Backspace' }],
|
|
687
|
+
command: holdBackspaceAtFrontMatter
|
|
688
|
+
},
|
|
689
|
+
/**
|
|
690
|
+
* 削除の結合。**項目の本文の先頭だけ、箇条書きの側が受け持つ。**
|
|
691
|
+
*
|
|
692
|
+
* 項目の先頭で押したとき、直前に受け止められる相手(兄弟の項目・親の本文)がいれば
|
|
693
|
+
* そこへ吸収する。いなければ従来どおり格上げしてリストの外へ出す。それ以外の位置は
|
|
694
|
+
* 一覧ライブラリの結合がそのまま担う(→ `listCommands.backspace`)。
|
|
695
|
+
*
|
|
696
|
+
* 編集基盤の既定の結合を使わないのは、繋げたあとに「次のノードが同じ種別ならそれも
|
|
697
|
+
* 繋げる」ためである。**このエディタでは項目 1 つが 1 つのノードなので、次の項目まで
|
|
698
|
+
* 巻き込まれる**(段落を項目へ繋げると、その次の項目まで同じ項目の中身になる)。
|
|
699
|
+
*
|
|
700
|
+
* 同じキーを持つ上の 3 つより後ろに置く。それらが譲ったときの受け皿である。
|
|
701
|
+
*/
|
|
702
|
+
{
|
|
703
|
+
id: 'editing.joinBackward',
|
|
704
|
+
category: 'document',
|
|
705
|
+
scope: 'input',
|
|
706
|
+
listed: false,
|
|
707
|
+
changesDocument: true,
|
|
708
|
+
keys: [{ key: 'Backspace' }],
|
|
709
|
+
command: listCommands.backspace
|
|
710
|
+
}
|
|
711
|
+
];
|