@vscode/markdown-editor 0.0.2-6 → 0.0.2-60
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 +26 -0
- package/dist/_observables/observableInternal/index.d.ts +1 -1
- package/dist/_observables/observableInternal/logging/consoleObservableLogger.d.ts +1 -1
- package/dist/_observables/observableInternal/logging/debugger/devToolsLogger.d.ts +1 -1
- package/dist/_observables/observableInternal/logging/logging.d.ts +1 -1
- package/dist/_observables/observableInternal/reactions/{autorun.d.ts → createEffect.d.ts} +11 -3
- package/dist/commands.d.ts +65 -0
- package/dist/commands.js +159 -0
- package/dist/commands.js.map +1 -0
- package/dist/config-BGeaJqWk.js +286 -0
- package/dist/config-BGeaJqWk.js.map +1 -0
- package/dist/config.d.ts +10 -0
- package/dist/config.js +6 -0
- package/dist/config.js.map +1 -0
- package/dist/index.d.ts +1459 -104
- package/dist/index.js +6070 -2000
- package/dist/index.js.map +1 -1
- package/dist/markdown-editor.css +1 -0
- package/dist/observables.js +45 -43
- package/dist/observables.js.map +1 -1
- package/dist/{runOnChange-C00UIwqQ.js → runOnChange-e7FtCqOQ.js} +115 -111
- package/dist/runOnChange-e7FtCqOQ.js.map +1 -0
- package/dist/stringEdit-CVDbCUBY.js +215 -0
- package/dist/stringEdit-CVDbCUBY.js.map +1 -0
- package/dist/web-editors.d.ts +282 -0
- package/dist/web-editors.js +6471 -0
- package/dist/web-editors.js.map +1 -0
- package/package.json +60 -13
- package/src/contrib/comments/commentInput.css +150 -0
- package/src/contrib/comments/comments.css +129 -0
- package/src/contrib/commentsVscode/vscodeCommentWidgetV2.css +171 -0
- package/src/contrib/find/find.css +347 -0
- package/src/view/editor.css +505 -20
- package/src/view/themes/default.css +13 -4
- package/src/view/themes/github.css +16 -13
- package/src/view/themes/vscode-default.css +397 -0
- package/src/view/themes/vscode-github.css +393 -0
- package/dist/runOnChange-C00UIwqQ.js.map +0 -1
- /package/dist/_observables/observableInternal/reactions/{autorunImpl.d.ts → createEffectImpl.d.ts} +0 -0
package/README.md
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Markdown editor
|
|
2
|
+
|
|
3
|
+
`@vscode/markdown-editor` is an experimental, browser-based hybrid Markdown
|
|
4
|
+
editor. It keeps Markdown source as the canonical document while presenting
|
|
5
|
+
inactive blocks in rendered form and active blocks in editable source form.
|
|
6
|
+
|
|
7
|
+
Start with the [current implementation specification](./docs/specification.md).
|
|
8
|
+
It explains the architecture, runtime data flow, public integration surface,
|
|
9
|
+
extension points, the VS Code custom text editor adapter, tests, and current
|
|
10
|
+
limitations.
|
|
11
|
+
|
|
12
|
+
Other package documents:
|
|
13
|
+
|
|
14
|
+
- [Original design](./docs/design.md) - historical design intent.
|
|
15
|
+
- [Original implementation plan](./docs/plan.md) - historical roadmap; its
|
|
16
|
+
checkboxes do not describe current completion.
|
|
17
|
+
- [Engineering backlog](./docs/todo.md) - known issues and future work.
|
|
18
|
+
|
|
19
|
+
From this package directory:
|
|
20
|
+
|
|
21
|
+
```sh
|
|
22
|
+
pnpm test
|
|
23
|
+
pnpm test:e2e
|
|
24
|
+
pnpm build
|
|
25
|
+
pnpm build:explorer
|
|
26
|
+
```
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { observableValueOpts } from './observables/observableValueOpts';
|
|
2
|
-
export { autorun, autorunDelta, autorunHandleChanges, autorunOpts, autorunWithStore, autorunWithStoreHandleChanges, autorunIterableDelta, autorunSelfDisposable } from './reactions/
|
|
2
|
+
export { createEffect, createEffectOpts, autorun, autorunDelta, autorunHandleChanges, autorunOpts, autorunWithStore, autorunWithStoreHandleChanges, autorunIterableDelta, autorunSelfDisposable } from './reactions/createEffect';
|
|
3
3
|
export { type IObservable, type IObservableWithChange, type IObserver, type IReader, type ISettable, type ISettableObservable, type ITransaction } from './base';
|
|
4
4
|
export { disposableObservableValue } from './observables/observableValue';
|
|
5
5
|
export { derived, derivedDisposable, derivedHandleChanges, derivedOpts, derivedWithSetter, derivedWithStore } from './observables/derived';
|
|
@@ -3,7 +3,7 @@ import { TransactionImpl } from '../transaction';
|
|
|
3
3
|
import { IObservableLogger, IChangeInformation } from './logging';
|
|
4
4
|
import { FromEventObservable } from '../observables/observableFromEvent';
|
|
5
5
|
import { Derived } from '../observables/derivedImpl';
|
|
6
|
-
import { AutorunObserver } from '../reactions/
|
|
6
|
+
import { AutorunObserver } from '../reactions/createEffectImpl';
|
|
7
7
|
export declare function logObservableToConsole(obs: IObservable<any>): void;
|
|
8
8
|
export declare class ConsoleObservableLogger implements IObservableLogger {
|
|
9
9
|
private indentation;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AutorunObserver } from '../../reactions/
|
|
1
|
+
import { AutorunObserver } from '../../reactions/createEffectImpl';
|
|
2
2
|
import { TransactionImpl } from '../../transaction';
|
|
3
3
|
import { IChangeInformation, IObservableLogger } from '../logging';
|
|
4
4
|
import { IObservable } from '../../base';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AutorunObserver } from '../reactions/
|
|
1
|
+
import { AutorunObserver } from '../reactions/createEffectImpl';
|
|
2
2
|
import { IObservable } from '../base';
|
|
3
3
|
import { TransactionImpl } from '../transaction';
|
|
4
4
|
import type { Derived } from '../observables/derivedImpl';
|
|
@@ -5,14 +5,22 @@ import { IDebugNameData } from '../debugName';
|
|
|
5
5
|
import { DebugLocation } from '../debugLocation';
|
|
6
6
|
/**
|
|
7
7
|
* Runs immediately and whenever a transaction ends and an observed observable changed.
|
|
8
|
-
* {@link fn} should start with a JS Doc using `@description` to name the
|
|
8
|
+
* {@link fn} should start with a JS Doc using `@description` to name the effect.
|
|
9
|
+
*/
|
|
10
|
+
export declare function createEffect(fn: (reader: IReaderWithStore) => void, debugLocation?: DebugLocation): IDisposable;
|
|
11
|
+
/**
|
|
12
|
+
* @deprecated Use {@link createEffect} instead.
|
|
9
13
|
*/
|
|
10
|
-
export declare
|
|
14
|
+
export declare const autorun: typeof createEffect;
|
|
11
15
|
/**
|
|
12
16
|
* Runs immediately and whenever a transaction ends and an observed observable changed.
|
|
13
17
|
* {@link fn} should start with a JS Doc using `@description` to name the autorun.
|
|
14
18
|
*/
|
|
15
|
-
export declare function
|
|
19
|
+
export declare function createEffectOpts(options: IDebugNameData & {}, fn: (reader: IReaderWithStore) => void, debugLocation?: DebugLocation): IDisposable;
|
|
20
|
+
/**
|
|
21
|
+
* @deprecated Use {@link createEffectOpts} instead.
|
|
22
|
+
*/
|
|
23
|
+
export declare const autorunOpts: typeof createEffectOpts;
|
|
16
24
|
/**
|
|
17
25
|
* Runs immediately and whenever a transaction ends and an observed observable changed.
|
|
18
26
|
* {@link fn} should start with a JS Doc using `@description` to name the autorun.
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canonical editor command catalog. Standalone keyboard handling and host
|
|
3
|
+
* integrations derive their command registration and default keybindings from
|
|
4
|
+
* this list.
|
|
5
|
+
*/
|
|
6
|
+
export declare const commands: readonly EditorCommandDefinition[];
|
|
7
|
+
|
|
8
|
+
export declare type CursorKeyboardAction = 'left' | 'right' | 'up' | 'down' | 'wordLeft' | 'wordRight' | 'visualLineStart' | 'visualLineEnd' | 'logicalLineStart' | 'logicalLineEnd' | 'documentStart' | 'documentEnd';
|
|
9
|
+
|
|
10
|
+
export declare type EditKeyboardAction = 'deleteLeft' | 'deleteRight' | 'deleteWordLeft' | 'deleteWordRight' | 'deleteLineLeft' | 'deleteLineRight';
|
|
11
|
+
|
|
12
|
+
export declare interface EditorCommandDefinition {
|
|
13
|
+
readonly id: `markdown.editor.${string}`;
|
|
14
|
+
readonly title: string;
|
|
15
|
+
readonly action: EditorKeyboardAction;
|
|
16
|
+
readonly keybindings: readonly EditorCommandKeybinding[];
|
|
17
|
+
/**
|
|
18
|
+
* Local commands must execute synchronously in the webview instead of being
|
|
19
|
+
* forwarded through the VS Code keybinding service.
|
|
20
|
+
*/
|
|
21
|
+
readonly routing?: 'host' | 'local';
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export declare interface EditorCommandKeybinding {
|
|
25
|
+
readonly key: string;
|
|
26
|
+
readonly modifiers?: KeyboardModifiers;
|
|
27
|
+
readonly platforms?: readonly KeyboardPlatform[];
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export declare type EditorKeyboardAction = {
|
|
31
|
+
readonly kind: 'cursor';
|
|
32
|
+
readonly command: CursorKeyboardAction;
|
|
33
|
+
readonly extend: boolean;
|
|
34
|
+
} | {
|
|
35
|
+
readonly kind: 'edit';
|
|
36
|
+
readonly command: EditKeyboardAction;
|
|
37
|
+
} | {
|
|
38
|
+
readonly kind: 'history';
|
|
39
|
+
readonly command: HistoryKeyboardAction;
|
|
40
|
+
} | {
|
|
41
|
+
readonly kind: 'tab';
|
|
42
|
+
readonly command: TabKeyboardAction;
|
|
43
|
+
} | {
|
|
44
|
+
readonly kind: 'toggleTabFocus';
|
|
45
|
+
} | {
|
|
46
|
+
readonly kind: 'selectAll';
|
|
47
|
+
} | {
|
|
48
|
+
readonly kind: 'enter';
|
|
49
|
+
readonly command: 'smartEnter' | 'insertParagraph' | 'insertHardLineBreak';
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export declare type HistoryKeyboardAction = 'undo' | 'redo';
|
|
53
|
+
|
|
54
|
+
export declare interface KeyboardModifiers {
|
|
55
|
+
readonly shift?: boolean;
|
|
56
|
+
readonly alt?: boolean;
|
|
57
|
+
readonly ctrl?: boolean;
|
|
58
|
+
readonly meta?: boolean;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export declare type KeyboardPlatform = 'macos' | 'windows' | 'linux';
|
|
62
|
+
|
|
63
|
+
export declare type TabKeyboardAction = 'insert' | 'outdent';
|
|
64
|
+
|
|
65
|
+
export { }
|
package/dist/commands.js
ADDED
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
const r = ["macos"], i = ["windows", "linux"], o = (n, u = !1) => ({
|
|
2
|
+
kind: "cursor",
|
|
3
|
+
command: n,
|
|
4
|
+
extend: u
|
|
5
|
+
}), d = (n) => ({ kind: "edit", command: n }), l = (n) => ({ kind: "history", command: n }), s = (n) => ({ kind: "tab", command: n }), c = (n) => ({
|
|
6
|
+
kind: "enter",
|
|
7
|
+
command: n
|
|
8
|
+
}), t = (n, u, a) => ({ key: n, modifiers: u, platforms: a }), e = (n, u, a, m, w = "host") => ({ id: n, title: u, action: a, keybindings: m, routing: w }), L = [
|
|
9
|
+
e("markdown.editor.cursorLeft", "Move Cursor Left", o("left"), [
|
|
10
|
+
t("b", { ctrl: !0 }, r),
|
|
11
|
+
t("ArrowLeft")
|
|
12
|
+
]),
|
|
13
|
+
e("markdown.editor.cursorRight", "Move Cursor Right", o("right"), [
|
|
14
|
+
t("f", { ctrl: !0 }, r),
|
|
15
|
+
t("ArrowRight")
|
|
16
|
+
]),
|
|
17
|
+
e("markdown.editor.cursorUp", "Move Cursor Up", o("up"), [
|
|
18
|
+
t("p", { ctrl: !0 }, r),
|
|
19
|
+
t("ArrowUp")
|
|
20
|
+
]),
|
|
21
|
+
e("markdown.editor.cursorDown", "Move Cursor Down", o("down"), [
|
|
22
|
+
t("n", { ctrl: !0 }, r),
|
|
23
|
+
t("ArrowDown")
|
|
24
|
+
]),
|
|
25
|
+
e("markdown.editor.cursorLeftSelect", "Select Left", o("left", !0), [
|
|
26
|
+
t("ArrowLeft", { shift: !0 })
|
|
27
|
+
]),
|
|
28
|
+
e("markdown.editor.cursorRightSelect", "Select Right", o("right", !0), [
|
|
29
|
+
t("ArrowRight", { shift: !0 })
|
|
30
|
+
]),
|
|
31
|
+
e("markdown.editor.cursorUpSelect", "Select Up", o("up", !0), [
|
|
32
|
+
t("ArrowUp", { shift: !0 })
|
|
33
|
+
]),
|
|
34
|
+
e("markdown.editor.cursorDownSelect", "Select Down", o("down", !0), [
|
|
35
|
+
t("ArrowDown", { shift: !0 })
|
|
36
|
+
]),
|
|
37
|
+
e("markdown.editor.cursorWordLeft", "Move Cursor Word Left", o("wordLeft"), [
|
|
38
|
+
t("ArrowLeft", { alt: !0 }, r),
|
|
39
|
+
t("ArrowLeft", { ctrl: !0 }, i)
|
|
40
|
+
]),
|
|
41
|
+
e("markdown.editor.cursorWordRight", "Move Cursor Word Right", o("wordRight"), [
|
|
42
|
+
t("ArrowRight", { alt: !0 }, r),
|
|
43
|
+
t("ArrowRight", { ctrl: !0 }, i)
|
|
44
|
+
]),
|
|
45
|
+
e("markdown.editor.cursorWordLeftSelect", "Select Word Left", o("wordLeft", !0), [
|
|
46
|
+
t("ArrowLeft", { alt: !0, shift: !0 }, r),
|
|
47
|
+
t("ArrowLeft", { ctrl: !0, shift: !0 }, i)
|
|
48
|
+
]),
|
|
49
|
+
e("markdown.editor.cursorWordRightSelect", "Select Word Right", o("wordRight", !0), [
|
|
50
|
+
t("ArrowRight", { alt: !0, shift: !0 }, r),
|
|
51
|
+
t("ArrowRight", { ctrl: !0, shift: !0 }, i)
|
|
52
|
+
]),
|
|
53
|
+
e("markdown.editor.cursorVisualLineStart", "Move Cursor to Visual Line Start", o("visualLineStart"), [
|
|
54
|
+
t("ArrowLeft", { meta: !0 }, r),
|
|
55
|
+
t("Home")
|
|
56
|
+
]),
|
|
57
|
+
e("markdown.editor.cursorVisualLineEnd", "Move Cursor to Visual Line End", o("visualLineEnd"), [
|
|
58
|
+
t("ArrowRight", { meta: !0 }, r),
|
|
59
|
+
t("End")
|
|
60
|
+
]),
|
|
61
|
+
e("markdown.editor.cursorVisualLineStartSelect", "Select to Visual Line Start", o("visualLineStart", !0), [
|
|
62
|
+
t("ArrowLeft", { meta: !0, shift: !0 }, r),
|
|
63
|
+
t("Home", { shift: !0 })
|
|
64
|
+
]),
|
|
65
|
+
e("markdown.editor.cursorVisualLineEndSelect", "Select to Visual Line End", o("visualLineEnd", !0), [
|
|
66
|
+
t("ArrowRight", { meta: !0, shift: !0 }, r),
|
|
67
|
+
t("End", { shift: !0 })
|
|
68
|
+
]),
|
|
69
|
+
e("markdown.editor.cursorLogicalLineStart", "Move Cursor to Logical Line Start", o("logicalLineStart"), [
|
|
70
|
+
t("a", { ctrl: !0 }, r)
|
|
71
|
+
]),
|
|
72
|
+
e("markdown.editor.cursorLogicalLineEnd", "Move Cursor to Logical Line End", o("logicalLineEnd"), [
|
|
73
|
+
t("e", { ctrl: !0 }, r)
|
|
74
|
+
]),
|
|
75
|
+
e("markdown.editor.cursorLogicalLineStartSelect", "Select to Logical Line Start", o("logicalLineStart", !0), [
|
|
76
|
+
t("a", { ctrl: !0, shift: !0 }, r)
|
|
77
|
+
]),
|
|
78
|
+
e("markdown.editor.cursorLogicalLineEndSelect", "Select to Logical Line End", o("logicalLineEnd", !0), [
|
|
79
|
+
t("e", { ctrl: !0, shift: !0 }, r)
|
|
80
|
+
]),
|
|
81
|
+
e("markdown.editor.cursorDocumentStart", "Move Cursor to Document Start", o("documentStart"), [
|
|
82
|
+
t("ArrowUp", { meta: !0 }, r),
|
|
83
|
+
t("Home", { ctrl: !0 }, i)
|
|
84
|
+
]),
|
|
85
|
+
e("markdown.editor.cursorDocumentEnd", "Move Cursor to Document End", o("documentEnd"), [
|
|
86
|
+
t("ArrowDown", { meta: !0 }, r),
|
|
87
|
+
t("End", { ctrl: !0 }, i)
|
|
88
|
+
]),
|
|
89
|
+
e("markdown.editor.cursorDocumentStartSelect", "Select to Document Start", o("documentStart", !0), [
|
|
90
|
+
t("ArrowUp", { meta: !0, shift: !0 }, r),
|
|
91
|
+
t("Home", { ctrl: !0, shift: !0 }, i)
|
|
92
|
+
]),
|
|
93
|
+
e("markdown.editor.cursorDocumentEndSelect", "Select to Document End", o("documentEnd", !0), [
|
|
94
|
+
t("ArrowDown", { meta: !0, shift: !0 }, r),
|
|
95
|
+
t("End", { ctrl: !0, shift: !0 }, i)
|
|
96
|
+
]),
|
|
97
|
+
e("markdown.editor.selectAll", "Select All", { kind: "selectAll" }, [
|
|
98
|
+
t("a", { meta: !0 }, r),
|
|
99
|
+
t("a", { ctrl: !0 }, i)
|
|
100
|
+
]),
|
|
101
|
+
e("markdown.editor.deleteLeft", "Delete Left", d("deleteLeft"), [
|
|
102
|
+
t("h", { ctrl: !0 }, r),
|
|
103
|
+
t("Backspace", { ctrl: !0 }, r),
|
|
104
|
+
t("Backspace"),
|
|
105
|
+
t("Backspace", { shift: !0 })
|
|
106
|
+
]),
|
|
107
|
+
e("markdown.editor.deleteRight", "Delete Right", d("deleteRight"), [
|
|
108
|
+
t("d", { ctrl: !0 }, r),
|
|
109
|
+
t("Delete", { ctrl: !0 }, r),
|
|
110
|
+
t("Delete")
|
|
111
|
+
]),
|
|
112
|
+
e("markdown.editor.deleteWordLeft", "Delete Word Left", d("deleteWordLeft"), [
|
|
113
|
+
t("Backspace", { alt: !0 }, r),
|
|
114
|
+
t("Backspace", { ctrl: !0 }, i)
|
|
115
|
+
]),
|
|
116
|
+
e("markdown.editor.deleteWordRight", "Delete Word Right", d("deleteWordRight"), [
|
|
117
|
+
t("Delete", { alt: !0 }, r),
|
|
118
|
+
t("Delete", { ctrl: !0 }, i)
|
|
119
|
+
]),
|
|
120
|
+
e("markdown.editor.deleteLineLeft", "Delete All Left", d("deleteLineLeft"), [
|
|
121
|
+
t("Backspace", { meta: !0 }, r)
|
|
122
|
+
]),
|
|
123
|
+
e("markdown.editor.deleteLineRight", "Delete All Right", d("deleteLineRight"), [
|
|
124
|
+
t("Delete", { meta: !0 }, r),
|
|
125
|
+
t("k", { ctrl: !0 }, r)
|
|
126
|
+
]),
|
|
127
|
+
e("markdown.editor.undo", "Undo", l("undo"), [
|
|
128
|
+
t("z", { meta: !0 }, r),
|
|
129
|
+
t("z", { ctrl: !0 }, i)
|
|
130
|
+
]),
|
|
131
|
+
e("markdown.editor.redo", "Redo", l("redo"), [
|
|
132
|
+
t("z", { meta: !0, shift: !0 }, r),
|
|
133
|
+
t("z", { ctrl: !0, shift: !0 }, i),
|
|
134
|
+
t("y", { ctrl: !0 }, i)
|
|
135
|
+
]),
|
|
136
|
+
e("markdown.editor.insertTab", "Insert Tab", s("insert"), [
|
|
137
|
+
t("Tab")
|
|
138
|
+
], "local"),
|
|
139
|
+
e("markdown.editor.outdent", "Outdent", s("outdent"), [
|
|
140
|
+
t("Tab", { shift: !0 })
|
|
141
|
+
], "local"),
|
|
142
|
+
e("markdown.editor.toggleTabFocus", "Toggle Tab Key Moves Focus", { kind: "toggleTabFocus" }, [
|
|
143
|
+
t("m", { ctrl: !0 })
|
|
144
|
+
], "local"),
|
|
145
|
+
e("markdown.editor.smartEnter", "Insert Paragraph", c("smartEnter"), [
|
|
146
|
+
t("Enter")
|
|
147
|
+
]),
|
|
148
|
+
e("markdown.editor.insertHardLineBreak", "Insert Hard Line Break", c("insertHardLineBreak"), [
|
|
149
|
+
t("Enter", { shift: !0 })
|
|
150
|
+
]),
|
|
151
|
+
e("markdown.editor.insertParagraph", "Insert Paragraph Without Continuing Markup", c("insertParagraph"), [
|
|
152
|
+
t("Enter", { meta: !0 }, r),
|
|
153
|
+
t("Enter", { ctrl: !0 })
|
|
154
|
+
])
|
|
155
|
+
];
|
|
156
|
+
export {
|
|
157
|
+
L as commands
|
|
158
|
+
};
|
|
159
|
+
//# sourceMappingURL=commands.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commands.js","sources":["../src/editorCommands.ts"],"sourcesContent":["export type KeyboardPlatform = 'macos' | 'windows' | 'linux';\n\nexport type CursorKeyboardAction =\n\t| 'left'\n\t| 'right'\n\t| 'up'\n\t| 'down'\n\t| 'wordLeft'\n\t| 'wordRight'\n\t| 'visualLineStart'\n\t| 'visualLineEnd'\n\t| 'logicalLineStart'\n\t| 'logicalLineEnd'\n\t| 'documentStart'\n\t| 'documentEnd';\n\nexport type EditKeyboardAction =\n\t| 'deleteLeft'\n\t| 'deleteRight'\n\t| 'deleteWordLeft'\n\t| 'deleteWordRight'\n\t| 'deleteLineLeft'\n\t| 'deleteLineRight';\n\nexport type HistoryKeyboardAction = 'undo' | 'redo';\nexport type TabKeyboardAction = 'insert' | 'outdent';\n\nexport type EditorKeyboardAction =\n\t| { readonly kind: 'cursor'; readonly command: CursorKeyboardAction; readonly extend: boolean }\n\t| { readonly kind: 'edit'; readonly command: EditKeyboardAction }\n\t| { readonly kind: 'history'; readonly command: HistoryKeyboardAction }\n\t| { readonly kind: 'tab'; readonly command: TabKeyboardAction }\n\t| { readonly kind: 'toggleTabFocus' }\n\t| { readonly kind: 'selectAll' }\n\t| { readonly kind: 'enter'; readonly command: 'smartEnter' | 'insertParagraph' | 'insertHardLineBreak' };\n\nexport interface KeyboardModifiers {\n\treadonly shift?: boolean;\n\treadonly alt?: boolean;\n\treadonly ctrl?: boolean;\n\treadonly meta?: boolean;\n}\n\nexport interface EditorCommandKeybinding {\n\treadonly key: string;\n\treadonly modifiers?: KeyboardModifiers;\n\treadonly platforms?: readonly KeyboardPlatform[];\n}\n\nexport interface EditorCommandDefinition {\n\treadonly id: `markdown.editor.${string}`;\n\treadonly title: string;\n\treadonly action: EditorKeyboardAction;\n\treadonly keybindings: readonly EditorCommandKeybinding[];\n\t/**\n\t * Local commands must execute synchronously in the webview instead of being\n\t * forwarded through the VS Code keybinding service.\n\t */\n\treadonly routing?: 'host' | 'local';\n}\n\nconst MACOS = ['macos'] as const;\nconst NON_MACOS = ['windows', 'linux'] as const;\n\nconst cursor = (command: CursorKeyboardAction, extend = false): EditorKeyboardAction => ({\n\tkind: 'cursor',\n\tcommand,\n\textend,\n});\nconst edit = (command: EditKeyboardAction): EditorKeyboardAction => ({ kind: 'edit', command });\nconst history = (command: HistoryKeyboardAction): EditorKeyboardAction => ({ kind: 'history', command });\nconst tab = (command: TabKeyboardAction): EditorKeyboardAction => ({ kind: 'tab', command });\nconst enter = (command: 'smartEnter' | 'insertParagraph' | 'insertHardLineBreak'): EditorKeyboardAction => ({\n\tkind: 'enter',\n\tcommand,\n});\nconst binding = (\n\tkey: string,\n\tmodifiers?: KeyboardModifiers,\n\tplatforms?: readonly KeyboardPlatform[],\n): EditorCommandKeybinding => ({ key, modifiers, platforms });\nconst command = (\n\tid: EditorCommandDefinition['id'],\n\ttitle: string,\n\taction: EditorKeyboardAction,\n\tkeybindings: readonly EditorCommandKeybinding[],\n\trouting: EditorCommandDefinition['routing'] = 'host',\n): EditorCommandDefinition => ({ id, title, action, keybindings, routing });\n\n/**\n * Canonical editor command catalog. Standalone keyboard handling and host\n * integrations derive their command registration and default keybindings from\n * this list.\n */\nexport const commands: readonly EditorCommandDefinition[] = [\n\tcommand('markdown.editor.cursorLeft', 'Move Cursor Left', cursor('left'), [\n\t\tbinding('b', { ctrl: true }, MACOS),\n\t\tbinding('ArrowLeft'),\n\t]),\n\tcommand('markdown.editor.cursorRight', 'Move Cursor Right', cursor('right'), [\n\t\tbinding('f', { ctrl: true }, MACOS),\n\t\tbinding('ArrowRight'),\n\t]),\n\tcommand('markdown.editor.cursorUp', 'Move Cursor Up', cursor('up'), [\n\t\tbinding('p', { ctrl: true }, MACOS),\n\t\tbinding('ArrowUp'),\n\t]),\n\tcommand('markdown.editor.cursorDown', 'Move Cursor Down', cursor('down'), [\n\t\tbinding('n', { ctrl: true }, MACOS),\n\t\tbinding('ArrowDown'),\n\t]),\n\tcommand('markdown.editor.cursorLeftSelect', 'Select Left', cursor('left', true), [\n\t\tbinding('ArrowLeft', { shift: true }),\n\t]),\n\tcommand('markdown.editor.cursorRightSelect', 'Select Right', cursor('right', true), [\n\t\tbinding('ArrowRight', { shift: true }),\n\t]),\n\tcommand('markdown.editor.cursorUpSelect', 'Select Up', cursor('up', true), [\n\t\tbinding('ArrowUp', { shift: true }),\n\t]),\n\tcommand('markdown.editor.cursorDownSelect', 'Select Down', cursor('down', true), [\n\t\tbinding('ArrowDown', { shift: true }),\n\t]),\n\tcommand('markdown.editor.cursorWordLeft', 'Move Cursor Word Left', cursor('wordLeft'), [\n\t\tbinding('ArrowLeft', { alt: true }, MACOS),\n\t\tbinding('ArrowLeft', { ctrl: true }, NON_MACOS),\n\t]),\n\tcommand('markdown.editor.cursorWordRight', 'Move Cursor Word Right', cursor('wordRight'), [\n\t\tbinding('ArrowRight', { alt: true }, MACOS),\n\t\tbinding('ArrowRight', { ctrl: true }, NON_MACOS),\n\t]),\n\tcommand('markdown.editor.cursorWordLeftSelect', 'Select Word Left', cursor('wordLeft', true), [\n\t\tbinding('ArrowLeft', { alt: true, shift: true }, MACOS),\n\t\tbinding('ArrowLeft', { ctrl: true, shift: true }, NON_MACOS),\n\t]),\n\tcommand('markdown.editor.cursorWordRightSelect', 'Select Word Right', cursor('wordRight', true), [\n\t\tbinding('ArrowRight', { alt: true, shift: true }, MACOS),\n\t\tbinding('ArrowRight', { ctrl: true, shift: true }, NON_MACOS),\n\t]),\n\tcommand('markdown.editor.cursorVisualLineStart', 'Move Cursor to Visual Line Start', cursor('visualLineStart'), [\n\t\tbinding('ArrowLeft', { meta: true }, MACOS),\n\t\tbinding('Home'),\n\t]),\n\tcommand('markdown.editor.cursorVisualLineEnd', 'Move Cursor to Visual Line End', cursor('visualLineEnd'), [\n\t\tbinding('ArrowRight', { meta: true }, MACOS),\n\t\tbinding('End'),\n\t]),\n\tcommand('markdown.editor.cursorVisualLineStartSelect', 'Select to Visual Line Start', cursor('visualLineStart', true), [\n\t\tbinding('ArrowLeft', { meta: true, shift: true }, MACOS),\n\t\tbinding('Home', { shift: true }),\n\t]),\n\tcommand('markdown.editor.cursorVisualLineEndSelect', 'Select to Visual Line End', cursor('visualLineEnd', true), [\n\t\tbinding('ArrowRight', { meta: true, shift: true }, MACOS),\n\t\tbinding('End', { shift: true }),\n\t]),\n\tcommand('markdown.editor.cursorLogicalLineStart', 'Move Cursor to Logical Line Start', cursor('logicalLineStart'), [\n\t\tbinding('a', { ctrl: true }, MACOS),\n\t]),\n\tcommand('markdown.editor.cursorLogicalLineEnd', 'Move Cursor to Logical Line End', cursor('logicalLineEnd'), [\n\t\tbinding('e', { ctrl: true }, MACOS),\n\t]),\n\tcommand('markdown.editor.cursorLogicalLineStartSelect', 'Select to Logical Line Start', cursor('logicalLineStart', true), [\n\t\tbinding('a', { ctrl: true, shift: true }, MACOS),\n\t]),\n\tcommand('markdown.editor.cursorLogicalLineEndSelect', 'Select to Logical Line End', cursor('logicalLineEnd', true), [\n\t\tbinding('e', { ctrl: true, shift: true }, MACOS),\n\t]),\n\tcommand('markdown.editor.cursorDocumentStart', 'Move Cursor to Document Start', cursor('documentStart'), [\n\t\tbinding('ArrowUp', { meta: true }, MACOS),\n\t\tbinding('Home', { ctrl: true }, NON_MACOS),\n\t]),\n\tcommand('markdown.editor.cursorDocumentEnd', 'Move Cursor to Document End', cursor('documentEnd'), [\n\t\tbinding('ArrowDown', { meta: true }, MACOS),\n\t\tbinding('End', { ctrl: true }, NON_MACOS),\n\t]),\n\tcommand('markdown.editor.cursorDocumentStartSelect', 'Select to Document Start', cursor('documentStart', true), [\n\t\tbinding('ArrowUp', { meta: true, shift: true }, MACOS),\n\t\tbinding('Home', { ctrl: true, shift: true }, NON_MACOS),\n\t]),\n\tcommand('markdown.editor.cursorDocumentEndSelect', 'Select to Document End', cursor('documentEnd', true), [\n\t\tbinding('ArrowDown', { meta: true, shift: true }, MACOS),\n\t\tbinding('End', { ctrl: true, shift: true }, NON_MACOS),\n\t]),\n\tcommand('markdown.editor.selectAll', 'Select All', { kind: 'selectAll' }, [\n\t\tbinding('a', { meta: true }, MACOS),\n\t\tbinding('a', { ctrl: true }, NON_MACOS),\n\t]),\n\tcommand('markdown.editor.deleteLeft', 'Delete Left', edit('deleteLeft'), [\n\t\tbinding('h', { ctrl: true }, MACOS),\n\t\tbinding('Backspace', { ctrl: true }, MACOS),\n\t\tbinding('Backspace'),\n\t\tbinding('Backspace', { shift: true }),\n\t]),\n\tcommand('markdown.editor.deleteRight', 'Delete Right', edit('deleteRight'), [\n\t\tbinding('d', { ctrl: true }, MACOS),\n\t\tbinding('Delete', { ctrl: true }, MACOS),\n\t\tbinding('Delete'),\n\t]),\n\tcommand('markdown.editor.deleteWordLeft', 'Delete Word Left', edit('deleteWordLeft'), [\n\t\tbinding('Backspace', { alt: true }, MACOS),\n\t\tbinding('Backspace', { ctrl: true }, NON_MACOS),\n\t]),\n\tcommand('markdown.editor.deleteWordRight', 'Delete Word Right', edit('deleteWordRight'), [\n\t\tbinding('Delete', { alt: true }, MACOS),\n\t\tbinding('Delete', { ctrl: true }, NON_MACOS),\n\t]),\n\tcommand('markdown.editor.deleteLineLeft', 'Delete All Left', edit('deleteLineLeft'), [\n\t\tbinding('Backspace', { meta: true }, MACOS),\n\t]),\n\tcommand('markdown.editor.deleteLineRight', 'Delete All Right', edit('deleteLineRight'), [\n\t\tbinding('Delete', { meta: true }, MACOS),\n\t\tbinding('k', { ctrl: true }, MACOS),\n\t]),\n\tcommand('markdown.editor.undo', 'Undo', history('undo'), [\n\t\tbinding('z', { meta: true }, MACOS),\n\t\tbinding('z', { ctrl: true }, NON_MACOS),\n\t]),\n\tcommand('markdown.editor.redo', 'Redo', history('redo'), [\n\t\tbinding('z', { meta: true, shift: true }, MACOS),\n\t\tbinding('z', { ctrl: true, shift: true }, NON_MACOS),\n\t\tbinding('y', { ctrl: true }, NON_MACOS),\n\t]),\n\tcommand('markdown.editor.insertTab', 'Insert Tab', tab('insert'), [\n\t\tbinding('Tab'),\n\t], 'local'),\n\tcommand('markdown.editor.outdent', 'Outdent', tab('outdent'), [\n\t\tbinding('Tab', { shift: true }),\n\t], 'local'),\n\tcommand('markdown.editor.toggleTabFocus', 'Toggle Tab Key Moves Focus', { kind: 'toggleTabFocus' }, [\n\t\tbinding('m', { ctrl: true }),\n\t], 'local'),\n\tcommand('markdown.editor.smartEnter', 'Insert Paragraph', enter('smartEnter'), [\n\t\tbinding('Enter'),\n\t]),\n\tcommand('markdown.editor.insertHardLineBreak', 'Insert Hard Line Break', enter('insertHardLineBreak'), [\n\t\tbinding('Enter', { shift: true }),\n\t]),\n\tcommand('markdown.editor.insertParagraph', 'Insert Paragraph Without Continuing Markup', enter('insertParagraph'), [\n\t\tbinding('Enter', { meta: true }, MACOS),\n\t\tbinding('Enter', { ctrl: true }),\n\t]),\n];\n"],"names":["MACOS","NON_MACOS","cursor","command","extend","edit","history","tab","enter","binding","key","modifiers","platforms","id","title","action","keybindings","routing","commands"],"mappings":"AA6DA,MAAMA,IAAQ,CAAC,OAAO,GAChBC,IAAY,CAAC,WAAW,OAAO,GAE/BC,IAAS,CAACC,GAA+BC,IAAS,QAAiC;AAAA,EACxF,MAAM;AAAA,EACN,SAAAD;AAAAA,EACA,QAAAC;AACD,IACMC,IAAO,CAACF,OAAuD,EAAE,MAAM,QAAQ,SAAAA,MAC/EG,IAAU,CAACH,OAA0D,EAAE,MAAM,WAAW,SAAAA,MACxFI,IAAM,CAACJ,OAAsD,EAAE,MAAM,OAAO,SAAAA,MAC5EK,IAAQ,CAACL,OAA6F;AAAA,EAC3G,MAAM;AAAA,EACN,SAAAA;AACD,IACMM,IAAU,CACfC,GACAC,GACAC,OAC8B,EAAE,KAAAF,GAAK,WAAAC,GAAW,WAAAC,MAC3CT,IAAU,CACfU,GACAC,GACAC,GACAC,GACAC,IAA8C,YAChB,EAAE,IAAAJ,GAAI,OAAAC,GAAO,QAAAC,GAAQ,aAAAC,GAAa,SAAAC,EAAA,IAOpDC,IAA+C;AAAA,EAC3Df,EAAQ,8BAA8B,oBAAoBD,EAAO,MAAM,GAAG;AAAA,IACzEO,EAAQ,KAAK,EAAE,MAAM,GAAA,GAAQT,CAAK;AAAA,IAClCS,EAAQ,WAAW;AAAA,EAAA,CACnB;AAAA,EACDN,EAAQ,+BAA+B,qBAAqBD,EAAO,OAAO,GAAG;AAAA,IAC5EO,EAAQ,KAAK,EAAE,MAAM,GAAA,GAAQT,CAAK;AAAA,IAClCS,EAAQ,YAAY;AAAA,EAAA,CACpB;AAAA,EACDN,EAAQ,4BAA4B,kBAAkBD,EAAO,IAAI,GAAG;AAAA,IACnEO,EAAQ,KAAK,EAAE,MAAM,GAAA,GAAQT,CAAK;AAAA,IAClCS,EAAQ,SAAS;AAAA,EAAA,CACjB;AAAA,EACDN,EAAQ,8BAA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 -0,0 +1,286 @@
|
|
|
1
|
+
const C = "`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?", f = {
|
|
2
|
+
wordSeparators: C,
|
|
3
|
+
wordSegmenterLocales: []
|
|
4
|
+
};
|
|
5
|
+
function _(e, n) {
|
|
6
|
+
return e !== void 0 && !/\s/u.test(e) && !n.includes(e);
|
|
7
|
+
}
|
|
8
|
+
class S {
|
|
9
|
+
_separators;
|
|
10
|
+
_segmenter;
|
|
11
|
+
_cachedLine;
|
|
12
|
+
_cachedWords = [];
|
|
13
|
+
constructor(n) {
|
|
14
|
+
this._separators = new Set(n.wordSeparators), this._segmenter = L(n.wordSegmenterLocales);
|
|
15
|
+
}
|
|
16
|
+
classify(n) {
|
|
17
|
+
return n === void 0 || n === " " || n === " " ? 1 : this._separators.has(n) ? 2 : 0;
|
|
18
|
+
}
|
|
19
|
+
previousIntlWord(n, i) {
|
|
20
|
+
let t;
|
|
21
|
+
for (const r of this._intlWords(n)) {
|
|
22
|
+
if (r.index > i)
|
|
23
|
+
break;
|
|
24
|
+
t = r;
|
|
25
|
+
}
|
|
26
|
+
return t;
|
|
27
|
+
}
|
|
28
|
+
nextIntlWord(n, i) {
|
|
29
|
+
return this._intlWords(n).find((t) => t.index >= i);
|
|
30
|
+
}
|
|
31
|
+
_intlWords(n) {
|
|
32
|
+
if (!this._segmenter)
|
|
33
|
+
return [];
|
|
34
|
+
if (this._cachedLine === n)
|
|
35
|
+
return this._cachedWords;
|
|
36
|
+
const i = [];
|
|
37
|
+
for (const t of this._segmenter.segment(n))
|
|
38
|
+
t.isWordLike && i.push({ index: t.index, segment: t.segment });
|
|
39
|
+
return this._cachedLine = n, this._cachedWords = i, i;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
function L(e) {
|
|
43
|
+
if (e.length === 0)
|
|
44
|
+
return;
|
|
45
|
+
const n = [];
|
|
46
|
+
for (const i of e) {
|
|
47
|
+
if (typeof i != "string" || i.length === 0) {
|
|
48
|
+
console.warn("Ignoring invalid editor.wordSegmenterLocales entry", i);
|
|
49
|
+
continue;
|
|
50
|
+
}
|
|
51
|
+
try {
|
|
52
|
+
n.push(...Intl.Segmenter.supportedLocalesOf(i));
|
|
53
|
+
} catch (t) {
|
|
54
|
+
console.warn(`Ignoring invalid editor.wordSegmenterLocales entry: ${i}`, t);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
if (n.length !== 0)
|
|
58
|
+
try {
|
|
59
|
+
return new Intl.Segmenter(n, { granularity: "word" });
|
|
60
|
+
} catch (i) {
|
|
61
|
+
console.warn(`Unable to initialize editor.wordSegmenterLocales: ${n.join(", ")}`, i);
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
const y = /* @__PURE__ */ new Map();
|
|
66
|
+
function W(e) {
|
|
67
|
+
const n = `${e.wordSeparators}/${e.wordSegmenterLocales.join(",")}`;
|
|
68
|
+
let i = y.get(n);
|
|
69
|
+
return i || (i = new S(e), y.set(n, i)), i;
|
|
70
|
+
}
|
|
71
|
+
function x(e, n, i = f) {
|
|
72
|
+
if (n = p(n, 0, e.length), n === 0)
|
|
73
|
+
return 0;
|
|
74
|
+
let t = e.lastIndexOf(`
|
|
75
|
+
`, n - 1) + 1, r = e.indexOf(`
|
|
76
|
+
`, n);
|
|
77
|
+
r === -1 && (r = e.length);
|
|
78
|
+
let s = n - t;
|
|
79
|
+
if (s === 0) {
|
|
80
|
+
const a = t - 1;
|
|
81
|
+
t = a <= 0 ? 0 : e.lastIndexOf(`
|
|
82
|
+
`, a - 1) + 1, r = a, s = Math.max(0, a - t);
|
|
83
|
+
}
|
|
84
|
+
const l = e.slice(t, r), d = W(i);
|
|
85
|
+
let o = v(l, d, s);
|
|
86
|
+
return o?.type === 1 && o.end - o.start === 1 && o.nextClass === 0 && (o = v(l, d, o.start)), t + (o?.start ?? 0);
|
|
87
|
+
}
|
|
88
|
+
function E(e, n, i = f) {
|
|
89
|
+
if (n = p(n, 0, e.length), n === e.length)
|
|
90
|
+
return e.length;
|
|
91
|
+
let t = e.lastIndexOf(`
|
|
92
|
+
`, n - 1) + 1, r = e.indexOf(`
|
|
93
|
+
`, n);
|
|
94
|
+
r === -1 && (r = e.length);
|
|
95
|
+
let s = n - t;
|
|
96
|
+
n === r && r < e.length && (t = r + 1, r = e.indexOf(`
|
|
97
|
+
`, t), r === -1 && (r = e.length), s = 0);
|
|
98
|
+
const l = e.slice(t, r), d = W(i);
|
|
99
|
+
let o = O(l, d, s);
|
|
100
|
+
return o?.type === 1 && o.end - o.start === 1 && o.nextClass === 0 && (o = O(l, d, o.end)), t + (o?.end ?? l.length);
|
|
101
|
+
}
|
|
102
|
+
function A(e, n, i = f) {
|
|
103
|
+
if (n = p(n, 0, e.length), n === 0)
|
|
104
|
+
return 0;
|
|
105
|
+
const t = n === 0 ? 0 : e.lastIndexOf(`
|
|
106
|
+
`, n - 1) + 1, r = n - t;
|
|
107
|
+
if (r === 0)
|
|
108
|
+
return n - 1;
|
|
109
|
+
let s = r - 1;
|
|
110
|
+
for (; s >= 0 && (e[t + s] === " " || e[t + s] === " "); )
|
|
111
|
+
s--;
|
|
112
|
+
if (s + 1 < r - 1)
|
|
113
|
+
return t + s + 1;
|
|
114
|
+
let l = e.indexOf(`
|
|
115
|
+
`, n);
|
|
116
|
+
l === -1 && (l = e.length);
|
|
117
|
+
const d = e.slice(t, l), o = v(d, W(i), r);
|
|
118
|
+
return t + (o?.start ?? 0);
|
|
119
|
+
}
|
|
120
|
+
function D(e, n, i = f) {
|
|
121
|
+
if (n = p(n, 0, e.length), n === e.length)
|
|
122
|
+
return e.length;
|
|
123
|
+
const t = e.lastIndexOf(`
|
|
124
|
+
`, n - 1) + 1;
|
|
125
|
+
let r = e.indexOf(`
|
|
126
|
+
`, n);
|
|
127
|
+
r === -1 && (r = e.length);
|
|
128
|
+
const s = n - t, l = e.slice(t, r);
|
|
129
|
+
let d = s;
|
|
130
|
+
for (; d < l.length && (l[d] === " " || l[d] === " "); )
|
|
131
|
+
d++;
|
|
132
|
+
if (s < d)
|
|
133
|
+
return t + d;
|
|
134
|
+
const o = W(i), a = O(l, o, s);
|
|
135
|
+
if (a)
|
|
136
|
+
return t + a.end;
|
|
137
|
+
if (n < r || r === e.length)
|
|
138
|
+
return r;
|
|
139
|
+
const h = r + 1;
|
|
140
|
+
let c = e.indexOf(`
|
|
141
|
+
`, h);
|
|
142
|
+
c === -1 && (c = e.length);
|
|
143
|
+
const u = e.slice(h, c), g = O(u, o, 0);
|
|
144
|
+
return h + (g?.start ?? u.length);
|
|
145
|
+
}
|
|
146
|
+
function R(e, n, i = f) {
|
|
147
|
+
if (n = p(n, 0, e.length), n === e.length)
|
|
148
|
+
return { start: n, end: n };
|
|
149
|
+
const t = e[n];
|
|
150
|
+
if (/\s/u.test(t)) {
|
|
151
|
+
let g = n, m = n + 1;
|
|
152
|
+
for (; g > 0 && /\s/u.test(e[g - 1]); )
|
|
153
|
+
g--;
|
|
154
|
+
for (; m < e.length && /\s/u.test(e[m]); )
|
|
155
|
+
m++;
|
|
156
|
+
return { start: g, end: m };
|
|
157
|
+
}
|
|
158
|
+
const r = e.lastIndexOf(`
|
|
159
|
+
`, n - 1) + 1;
|
|
160
|
+
let s = e.indexOf(`
|
|
161
|
+
`, n);
|
|
162
|
+
s === -1 && (s = e.length);
|
|
163
|
+
const l = e.slice(r, s), d = n - r, o = W(i), a = o.previousIntlWord(l, d);
|
|
164
|
+
if (a && d < a.index + a.segment.length)
|
|
165
|
+
return {
|
|
166
|
+
start: r + a.index,
|
|
167
|
+
end: r + a.index + a.segment.length
|
|
168
|
+
};
|
|
169
|
+
const h = o.classify(t);
|
|
170
|
+
let c = d, u = d + 1;
|
|
171
|
+
for (; c > 0 && o.classify(l[c - 1]) === h; )
|
|
172
|
+
c--;
|
|
173
|
+
for (; u < l.length && o.classify(l[u]) === h; )
|
|
174
|
+
u++;
|
|
175
|
+
return { start: r + c, end: r + u };
|
|
176
|
+
}
|
|
177
|
+
function v(e, n, i) {
|
|
178
|
+
let t;
|
|
179
|
+
const r = n.previousIntlWord(e, i - 1);
|
|
180
|
+
for (let s = i - 1; s >= 0; s--) {
|
|
181
|
+
const l = n.classify(e[s]);
|
|
182
|
+
if (r && s === r.index)
|
|
183
|
+
return {
|
|
184
|
+
start: r.index,
|
|
185
|
+
end: r.index + r.segment.length,
|
|
186
|
+
type: 0,
|
|
187
|
+
nextClass: l
|
|
188
|
+
};
|
|
189
|
+
if (l === 0) {
|
|
190
|
+
if (t === 1) {
|
|
191
|
+
const d = s + 1;
|
|
192
|
+
return { start: d, end: w(e, n, t, d), type: t, nextClass: l };
|
|
193
|
+
}
|
|
194
|
+
t = 0;
|
|
195
|
+
} else if (l === 2) {
|
|
196
|
+
if (t === 0) {
|
|
197
|
+
const d = s + 1;
|
|
198
|
+
return { start: d, end: w(e, n, t, d), type: t, nextClass: l };
|
|
199
|
+
}
|
|
200
|
+
t = 1;
|
|
201
|
+
} else if (t !== void 0) {
|
|
202
|
+
const d = s + 1;
|
|
203
|
+
return { start: d, end: w(e, n, t, d), type: t, nextClass: l };
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
return t === void 0 ? void 0 : {
|
|
207
|
+
start: 0,
|
|
208
|
+
end: w(e, n, t, 0),
|
|
209
|
+
type: t,
|
|
210
|
+
nextClass: 1
|
|
211
|
+
/* Whitespace */
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
function O(e, n, i) {
|
|
215
|
+
let t;
|
|
216
|
+
const r = n.nextIntlWord(e, i);
|
|
217
|
+
for (let s = i; s < e.length; s++) {
|
|
218
|
+
const l = n.classify(e[s]);
|
|
219
|
+
if (r && s === r.index)
|
|
220
|
+
return {
|
|
221
|
+
start: r.index,
|
|
222
|
+
end: r.index + r.segment.length,
|
|
223
|
+
type: 0,
|
|
224
|
+
nextClass: l
|
|
225
|
+
};
|
|
226
|
+
if (l === 0) {
|
|
227
|
+
if (t === 1) {
|
|
228
|
+
const d = s;
|
|
229
|
+
return { start: I(e, n, t, d - 1), end: d, type: t, nextClass: l };
|
|
230
|
+
}
|
|
231
|
+
t = 0;
|
|
232
|
+
} else if (l === 2) {
|
|
233
|
+
if (t === 0) {
|
|
234
|
+
const d = s;
|
|
235
|
+
return { start: I(e, n, t, d - 1), end: d, type: t, nextClass: l };
|
|
236
|
+
}
|
|
237
|
+
t = 1;
|
|
238
|
+
} else if (t !== void 0) {
|
|
239
|
+
const d = s;
|
|
240
|
+
return { start: I(e, n, t, d - 1), end: d, type: t, nextClass: l };
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
return t === void 0 ? void 0 : {
|
|
244
|
+
start: I(e, n, t, e.length - 1),
|
|
245
|
+
end: e.length,
|
|
246
|
+
type: t,
|
|
247
|
+
nextClass: 1
|
|
248
|
+
/* Whitespace */
|
|
249
|
+
};
|
|
250
|
+
}
|
|
251
|
+
function w(e, n, i, t) {
|
|
252
|
+
const r = n.nextIntlWord(e, t);
|
|
253
|
+
for (let s = t; s < e.length; s++) {
|
|
254
|
+
if (r && s === r.index + r.segment.length)
|
|
255
|
+
return s;
|
|
256
|
+
const l = n.classify(e[s]);
|
|
257
|
+
if (l === 1 || i === 0 && l === 2 || i === 1 && l === 0)
|
|
258
|
+
return s;
|
|
259
|
+
}
|
|
260
|
+
return e.length;
|
|
261
|
+
}
|
|
262
|
+
function I(e, n, i, t) {
|
|
263
|
+
const r = n.previousIntlWord(e, t);
|
|
264
|
+
for (let s = t; s >= 0; s--) {
|
|
265
|
+
if (r && s === r.index)
|
|
266
|
+
return s;
|
|
267
|
+
const l = n.classify(e[s]);
|
|
268
|
+
if (l === 1 || i === 0 && l === 2 || i === 1 && l === 0)
|
|
269
|
+
return s + 1;
|
|
270
|
+
}
|
|
271
|
+
return 0;
|
|
272
|
+
}
|
|
273
|
+
function p(e, n, i) {
|
|
274
|
+
return Math.min(Math.max(e, n), i);
|
|
275
|
+
}
|
|
276
|
+
export {
|
|
277
|
+
f as D,
|
|
278
|
+
E as a,
|
|
279
|
+
A as b,
|
|
280
|
+
D as c,
|
|
281
|
+
R as d,
|
|
282
|
+
C as e,
|
|
283
|
+
x as f,
|
|
284
|
+
_ as i
|
|
285
|
+
};
|
|
286
|
+
//# sourceMappingURL=config-BGeaJqWk.js.map
|