@impermeable/waterproof-editor 0.12.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/types.d.ts +0 -4
- package/dist/api/types.d.ts.map +1 -1
- package/dist/codeview/code-plugin.d.ts +3 -2
- package/dist/codeview/code-plugin.d.ts.map +1 -1
- package/dist/codeview/nodeview.d.ts +14 -14
- package/dist/codeview/nodeview.d.ts.map +1 -1
- package/dist/codeview/progress-indicator.d.ts +19 -0
- package/dist/codeview/progress-indicator.d.ts.map +1 -0
- package/dist/commands/utils.d.ts +14 -0
- package/dist/commands/utils.d.ts.map +1 -0
- package/dist/editor.d.ts +45 -9
- package/dist/editor.d.ts.map +1 -1
- package/dist/index.js +66 -65
- package/dist/mapping/Tree.d.ts +75 -0
- package/dist/mapping/Tree.d.ts.map +1 -0
- package/dist/mapping/helper-functions.d.ts +4 -0
- package/dist/mapping/helper-functions.d.ts.map +1 -0
- package/dist/mapping/index.d.ts +4 -0
- package/dist/mapping/index.d.ts.map +1 -0
- package/dist/mapping/mapping.d.ts +65 -0
- package/dist/mapping/mapping.d.ts.map +1 -0
- package/dist/mapping/newmapping.d.ts +62 -0
- package/dist/mapping/newmapping.d.ts.map +1 -0
- package/dist/mapping/nodeUpdate.d.ts +27 -0
- package/dist/mapping/nodeUpdate.d.ts.map +1 -0
- package/dist/mapping/textUpdate.d.ts +8 -0
- package/dist/mapping/textUpdate.d.ts.map +1 -0
- package/dist/mapping/types.d.ts +22 -0
- package/dist/mapping/types.d.ts.map +1 -0
- package/dist/markdown-defaults/index.d.ts +4 -0
- package/dist/markdown-defaults/index.d.ts.map +1 -0
- package/dist/markdown-defaults/statemachine.d.ts +14 -0
- package/dist/markdown-defaults/statemachine.d.ts.map +1 -0
- package/dist/markup-views/SwitchableViewPlugin.d.ts +22 -0
- package/dist/markup-views/SwitchableViewPlugin.d.ts.map +1 -0
- package/dist/serialization/DocumentSerializer.d.ts +89 -0
- package/dist/serialization/DocumentSerializer.d.ts.map +1 -0
- package/dist/src/api/Completions.d.ts +21 -0
- package/dist/src/api/Completions.d.ts.map +1 -0
- package/dist/src/api/DocChange.d.ts +19 -0
- package/dist/src/api/DocChange.d.ts.map +1 -0
- package/dist/src/api/FileFormat.d.ts +10 -0
- package/dist/src/api/FileFormat.d.ts.map +1 -0
- package/dist/src/api/InputAreaStatus.d.ts +14 -0
- package/dist/src/api/InputAreaStatus.d.ts.map +1 -0
- package/dist/src/api/LineNumber.d.ts +10 -0
- package/dist/src/api/LineNumber.d.ts.map +1 -0
- package/dist/src/api/ServerStatus.d.ts +18 -0
- package/dist/src/api/ServerStatus.d.ts.map +1 -0
- package/dist/src/api/Severity.d.ts +12 -0
- package/dist/src/api/Severity.d.ts.map +1 -0
- package/dist/src/api/index.d.ts +12 -0
- package/dist/src/api/index.d.ts.map +1 -0
- package/dist/src/api/types.d.ts +119 -0
- package/dist/src/api/types.d.ts.map +1 -0
- package/dist/src/autocomplete/coqTerms.d.ts +3 -0
- package/dist/src/autocomplete/coqTerms.d.ts.map +1 -0
- package/dist/src/autocomplete/emojis.d.ts +10 -0
- package/dist/src/autocomplete/emojis.d.ts.map +1 -0
- package/dist/src/autocomplete/index.d.ts +2 -0
- package/dist/src/autocomplete/index.d.ts.map +1 -0
- package/dist/src/autocomplete/renderSymbol.d.ts +7 -0
- package/dist/src/autocomplete/renderSymbol.d.ts.map +1 -0
- package/dist/src/autocomplete/symbols.d.ts +7 -0
- package/dist/src/autocomplete/symbols.d.ts.map +1 -0
- package/dist/src/codeview/code-plugin.d.ts +28 -0
- package/dist/src/codeview/code-plugin.d.ts.map +1 -0
- package/dist/src/codeview/color-scheme.d.ts +6 -0
- package/dist/src/codeview/color-scheme.d.ts.map +1 -0
- package/dist/src/codeview/debouncer.d.ts +8 -0
- package/dist/src/codeview/debouncer.d.ts.map +1 -0
- package/dist/src/codeview/index.d.ts +3 -0
- package/dist/src/codeview/index.d.ts.map +1 -0
- package/dist/src/codeview/lang-pack/index.d.ts +8 -0
- package/dist/src/codeview/lang-pack/index.d.ts.map +1 -0
- package/dist/src/codeview/lang-pack/print-grammar.d.ts +2 -0
- package/dist/src/codeview/lang-pack/print-grammar.d.ts.map +1 -0
- package/dist/src/codeview/lang-pack/syntax.d.ts +3 -0
- package/dist/src/codeview/lang-pack/syntax.d.ts.map +1 -0
- package/dist/src/codeview/lang-pack/syntax.terms.d.ts +2 -0
- package/dist/src/codeview/lang-pack/syntax.terms.d.ts.map +1 -0
- package/dist/src/codeview/nodeview.d.ts +63 -0
- package/dist/src/codeview/nodeview.d.ts.map +1 -0
- package/dist/src/commands/command-helpers.d.ts +48 -0
- package/dist/src/commands/command-helpers.d.ts.map +1 -0
- package/dist/src/commands/commands.d.ts +30 -0
- package/dist/src/commands/commands.d.ts.map +1 -0
- package/dist/src/commands/delete-command.d.ts +4 -0
- package/dist/src/commands/delete-command.d.ts.map +1 -0
- package/dist/src/commands/index.d.ts +4 -0
- package/dist/src/commands/index.d.ts.map +1 -0
- package/dist/src/commands/insert-command.d.ts +34 -0
- package/dist/src/commands/insert-command.d.ts.map +1 -0
- package/dist/src/commands/types.d.ts +15 -0
- package/dist/src/commands/types.d.ts.map +1 -0
- package/dist/src/context-menu/index.d.ts +2 -0
- package/dist/src/context-menu/index.d.ts.map +1 -0
- package/dist/src/context-menu/menu.d.ts +8 -0
- package/dist/src/context-menu/menu.d.ts.map +1 -0
- package/dist/src/document/blocks/block.d.ts +24 -0
- package/dist/src/document/blocks/block.d.ts.map +1 -0
- package/dist/src/document/blocks/blocktypes.d.ts +78 -0
- package/dist/src/document/blocks/blocktypes.d.ts.map +1 -0
- package/dist/src/document/blocks/index.d.ts +3 -0
- package/dist/src/document/blocks/index.d.ts.map +1 -0
- package/dist/src/document/blocks/schema.d.ts +21 -0
- package/dist/src/document/blocks/schema.d.ts.map +1 -0
- package/dist/src/document/blocks/typeguards.d.ts +11 -0
- package/dist/src/document/blocks/typeguards.d.ts.map +1 -0
- package/dist/src/document/construct-document.d.ts +4 -0
- package/dist/src/document/construct-document.d.ts.map +1 -0
- package/dist/src/document/index.d.ts +5 -0
- package/dist/src/document/index.d.ts.map +1 -0
- package/dist/src/document/utils.d.ts +49 -0
- package/dist/src/document/utils.d.ts.map +1 -0
- package/dist/src/documentProgressDecorator.d.ts +9 -0
- package/dist/src/documentProgressDecorator.d.ts.map +1 -0
- package/dist/src/editor.d.ts +154 -0
- package/dist/src/editor.d.ts.map +1 -0
- package/dist/src/embedded-codemirror/embedded-codemirror-keymap.d.ts +9 -0
- package/dist/src/embedded-codemirror/embedded-codemirror-keymap.d.ts.map +1 -0
- package/dist/src/embedded-codemirror/embeddedCodemirror.d.ts +40 -0
- package/dist/src/embedded-codemirror/embeddedCodemirror.d.ts.map +1 -0
- package/dist/src/embedded-codemirror/index.d.ts +3 -0
- package/dist/src/embedded-codemirror/index.d.ts.map +1 -0
- package/dist/src/embedded-codemirror/types.d.ts +9 -0
- package/dist/src/embedded-codemirror/types.d.ts.map +1 -0
- package/dist/src/hinting/hint-plugin.d.ts +9 -0
- package/dist/src/hinting/hint-plugin.d.ts.map +1 -0
- package/dist/src/hinting/index.d.ts +2 -0
- package/dist/src/hinting/index.d.ts.map +1 -0
- package/dist/src/index.d.ts +6 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/inputArea.d.ts +14 -0
- package/dist/src/inputArea.d.ts.map +1 -0
- package/dist/src/markup-views/CoqdocPlugin.d.ts +19 -0
- package/dist/src/markup-views/CoqdocPlugin.d.ts.map +1 -0
- package/dist/src/markup-views/CoqdocView.d.ts +15 -0
- package/dist/src/markup-views/CoqdocView.d.ts.map +1 -0
- package/dist/src/markup-views/MarkdownPlugin.d.ts +21 -0
- package/dist/src/markup-views/MarkdownPlugin.d.ts.map +1 -0
- package/dist/src/markup-views/MarkdownView.d.ts +15 -0
- package/dist/src/markup-views/MarkdownView.d.ts.map +1 -0
- package/dist/src/markup-views/index.d.ts +5 -0
- package/dist/src/markup-views/index.d.ts.map +1 -0
- package/dist/src/markup-views/switchable-view/EditableView.d.ts +22 -0
- package/dist/src/markup-views/switchable-view/EditableView.d.ts.map +1 -0
- package/dist/src/markup-views/switchable-view/EditorTheme.d.ts +8 -0
- package/dist/src/markup-views/switchable-view/EditorTheme.d.ts.map +1 -0
- package/dist/src/markup-views/switchable-view/MarkdownSchema.d.ts +8 -0
- package/dist/src/markup-views/switchable-view/MarkdownSchema.d.ts.map +1 -0
- package/dist/src/markup-views/switchable-view/RenderedView.d.ts +13 -0
- package/dist/src/markup-views/switchable-view/RenderedView.d.ts.map +1 -0
- package/dist/src/markup-views/switchable-view/SwitchableView.d.ts +62 -0
- package/dist/src/markup-views/switchable-view/SwitchableView.d.ts.map +1 -0
- package/dist/src/markup-views/switchable-view/index.d.ts +2 -0
- package/dist/src/markup-views/switchable-view/index.d.ts.map +1 -0
- package/dist/src/math-integration/index.d.ts +2 -0
- package/dist/src/math-integration/index.d.ts.map +1 -0
- package/dist/src/math-integration/nodespecs.d.ts +4 -0
- package/dist/src/math-integration/nodespecs.d.ts.map +1 -0
- package/dist/src/menubar/index.d.ts +2 -0
- package/dist/src/menubar/index.d.ts.map +1 -0
- package/dist/src/menubar/menubar.d.ts +25 -0
- package/dist/src/menubar/menubar.d.ts.map +1 -0
- package/dist/src/osType.d.ts +8 -0
- package/dist/src/osType.d.ts.map +1 -0
- package/dist/src/progressBar.d.ts +13 -0
- package/dist/src/progressBar.d.ts.map +1 -0
- package/dist/src/qedStatus.d.ts +9 -0
- package/dist/src/qedStatus.d.ts.map +1 -0
- package/dist/src/schema/index.d.ts +2 -0
- package/dist/src/schema/index.d.ts.map +1 -0
- package/dist/src/schema/schema-nodes.d.ts +1 -0
- package/dist/src/schema/schema-nodes.d.ts.map +1 -0
- package/dist/src/schema/schema.d.ts +23 -0
- package/dist/src/schema/schema.d.ts.map +1 -0
- package/dist/src/styles/index.d.ts +17 -0
- package/dist/src/styles/index.d.ts.map +1 -0
- package/dist/src/translation/Translator.d.ts +12 -0
- package/dist/src/translation/Translator.d.ts.map +1 -0
- package/dist/src/translation/index.d.ts +2 -0
- package/dist/src/translation/index.d.ts.map +1 -0
- package/dist/src/translation/toProsemirror/index.d.ts +2 -0
- package/dist/src/translation/toProsemirror/index.d.ts.map +1 -0
- package/dist/src/translation/toProsemirror/mvFileToProsemirror.d.ts +2 -0
- package/dist/src/translation/toProsemirror/mvFileToProsemirror.d.ts.map +1 -0
- package/dist/src/translation/toProsemirror/parseAsMv.d.ts +7 -0
- package/dist/src/translation/toProsemirror/parseAsMv.d.ts.map +1 -0
- package/dist/src/translation/toProsemirror/parser.d.ts +3 -0
- package/dist/src/translation/toProsemirror/parser.d.ts.map +1 -0
- package/dist/src/translation/types.d.ts +12 -0
- package/dist/src/translation/types.d.ts.map +1 -0
- package/dist/src/utilities/index.d.ts +2 -0
- package/dist/src/utilities/index.d.ts.map +1 -0
- package/dist/src/utilities/prosemirror.d.ts +13 -0
- package/dist/src/utilities/prosemirror.d.ts.map +1 -0
- package/dist/translation/toMarkdownTranslation.d.ts +3 -0
- package/dist/translation/toMarkdownTranslation.d.ts.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/jest-thingie +0 -0
- package/package.json +3 -3
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { Step } from "prosemirror-transform";
|
|
2
|
+
import { DocChange, WrappingDocChange, Severity, WaterproofCompletion, WaterproofSymbol } from ".";
|
|
3
|
+
import { Block } from "../document";
|
|
4
|
+
/**
|
|
5
|
+
* Represents an area of text, that is editable in the prosemirror view and its
|
|
6
|
+
* mapping to the vscode document
|
|
7
|
+
*/
|
|
8
|
+
export type StringCell = {
|
|
9
|
+
/** The prosemirror starting index of this cell */
|
|
10
|
+
startProse: number;
|
|
11
|
+
/** The prosemirror ending index of this cell */
|
|
12
|
+
endProse: number;
|
|
13
|
+
/** The starting index of this cell in the text document string vscode side */
|
|
14
|
+
startText: number;
|
|
15
|
+
/** The ending index of this cell in the text document string vscode side */
|
|
16
|
+
endText: number;
|
|
17
|
+
};
|
|
18
|
+
export type Positioned<A> = {
|
|
19
|
+
obj: A;
|
|
20
|
+
pos: number | undefined;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* A `WaterproofDocument` is a collection of `Block`s. Every Block in this WaterproofDocument will get translated into some ProseMirror node.
|
|
24
|
+
*
|
|
25
|
+
* Supported blocks are `HintBlock`, `InputAreaBlock`, `MarkdownBlock`, `CoqBlock` and `MathDisplayBlock`.
|
|
26
|
+
*
|
|
27
|
+
* Also see [documentation/UsingWaterproofEditor.md](../../documentation/UsingWaterproofEditor.md)
|
|
28
|
+
*/
|
|
29
|
+
export type WaterproofDocument = Block[];
|
|
30
|
+
export type WaterproofCallbacks = {
|
|
31
|
+
/** Used by the editor to execute a command in the document. */
|
|
32
|
+
executeCommand: (command: string, time: number) => void;
|
|
33
|
+
/** Executed by the editor when the user asks for help via the keybinding or the context menu entry. */
|
|
34
|
+
executeHelp: () => void;
|
|
35
|
+
/** Used by the editor to communicate that it is ready. */
|
|
36
|
+
editorReady: () => void;
|
|
37
|
+
/** The editor will call this function on every change that is made to the underlying document.
|
|
38
|
+
*
|
|
39
|
+
* The change can either be a regular document change or a wrapping document change.
|
|
40
|
+
*/
|
|
41
|
+
documentChange: (change: DocChange | WrappingDocChange) => void;
|
|
42
|
+
/** Only ever used by the editor once an unrecoverable error has occured when mapping changes */
|
|
43
|
+
applyStepError: (errorMessage: string) => void;
|
|
44
|
+
/** Used by the editor to communicate the current cursor position, `cursorPosition` is an offset based position into the document. */
|
|
45
|
+
cursorChange: (cursorPosition: number) => void;
|
|
46
|
+
/** Used to communicate that the linenumbers need to be recomputed for the current document */
|
|
47
|
+
lineNumbers: (linenumbers: Array<number>, version: number) => void;
|
|
48
|
+
/** Fired by the editor when the viewport (the user visible part of the editor changes) */
|
|
49
|
+
viewportHint: (start: number, end: number) => void;
|
|
50
|
+
};
|
|
51
|
+
export declare abstract class WaterproofMapping {
|
|
52
|
+
abstract getMapping: () => Map<number, StringCell>;
|
|
53
|
+
abstract get version(): number;
|
|
54
|
+
abstract findPosition: (index: number) => number;
|
|
55
|
+
abstract findInvPosition: (index: number) => number;
|
|
56
|
+
abstract update: (step: Step) => DocChange | WrappingDocChange;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Configuration object for the WaterproofEditor.
|
|
60
|
+
*
|
|
61
|
+
* - `api` contains the callbacks that the editor will use to communicate with the host application.
|
|
62
|
+
* - `documentConstructor` is a function that takes a string and returns a WaterproofDocument (block representation of a ProseMirror document).
|
|
63
|
+
* - `mapping` is a constructor for the WaterproofMapping class, which handles the mapping between the ProseMirror document and the text document in the host application.
|
|
64
|
+
*/
|
|
65
|
+
export type WaterproofEditorConfig = {
|
|
66
|
+
/** Set of (static) completions that should be shown to the user. */
|
|
67
|
+
completions: Array<WaterproofCompletion>;
|
|
68
|
+
/** Set of (static) symbol completions that should be shown to the user. */
|
|
69
|
+
symbols: Array<WaterproofSymbol>;
|
|
70
|
+
/** How the editor communicates to the parent process */
|
|
71
|
+
api: WaterproofCallbacks;
|
|
72
|
+
/** Determines how the editor document gets constructed from a string input. */
|
|
73
|
+
documentConstructor: (document: string) => WaterproofDocument;
|
|
74
|
+
/** How to construct a mapping for this editor. The mapping is responsible for mapping changes from the underlying ProseMirror instance into changes that can be applied to the underlying document. */
|
|
75
|
+
mapping: new (inputString: string, versionNum: number) => WaterproofMapping;
|
|
76
|
+
/** THIS IS A TEMPORARY FEATURE THAT WILL GET REMOVED */
|
|
77
|
+
documentPreprocessor?: (inputString: string) => {
|
|
78
|
+
resultingDocument: string;
|
|
79
|
+
documentChange: DocChange | WrappingDocChange | undefined;
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
export declare enum HistoryChange {
|
|
83
|
+
Undo = 0,
|
|
84
|
+
Redo = 1
|
|
85
|
+
}
|
|
86
|
+
export type SimpleProgressInfo = {
|
|
87
|
+
/** Range for which the processing info was reported. */
|
|
88
|
+
range: {
|
|
89
|
+
start: {
|
|
90
|
+
line: number;
|
|
91
|
+
character: number;
|
|
92
|
+
};
|
|
93
|
+
end: {
|
|
94
|
+
line: number;
|
|
95
|
+
character: number;
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
/** Kind of progress that was reported. */
|
|
99
|
+
kind?: CoqFileProgressKind;
|
|
100
|
+
};
|
|
101
|
+
export type SimpleProgressParams = {
|
|
102
|
+
numberOfLines: number;
|
|
103
|
+
progress: SimpleProgressInfo[];
|
|
104
|
+
};
|
|
105
|
+
export declare enum CoqFileProgressKind {
|
|
106
|
+
Processing = 1,
|
|
107
|
+
FatalError = 2
|
|
108
|
+
}
|
|
109
|
+
export interface OffsetDiagnostic {
|
|
110
|
+
message: string;
|
|
111
|
+
severity: Severity;
|
|
112
|
+
startOffset: number;
|
|
113
|
+
endOffset: number;
|
|
114
|
+
}
|
|
115
|
+
export declare enum ThemeStyle {
|
|
116
|
+
Light = 0,
|
|
117
|
+
Dark = 1
|
|
118
|
+
}
|
|
119
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/api/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,QAAQ,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,GAAG,CAAC;AACnG,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC;;;GAGG;AACH,MAAM,MAAM,UAAU,GAAG;IACrB,kDAAkD;IAClD,UAAU,EAAE,MAAM,CAAC;IACnB,gDAAgD;IAChD,QAAQ,EAAE,MAAM,CAAC;IACjB,8EAA8E;IAC9E,SAAS,EAAE,MAAM,CAAC;IAClB,4EAA4E;IAC5E,OAAO,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,UAAU,CAAC,CA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C;IAChB,QAAQ,EAAE,QAAQ,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;CACrB;AAED,oBAAY,UAAU;IAClB,KAAK,IAAA;IAAE,IAAI,IAAA;CACd"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coqTerms.d.ts","sourceRoot":"","sources":["../../../src/autocomplete/coqTerms.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmD,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAO7G,eAAO,MAAM,mBAAmB,EAAE,gBAcjC,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CompletionSource } from "@codemirror/autocomplete";
|
|
2
|
+
/**
|
|
3
|
+
* Function that creates the `emojiCompletionSource`.
|
|
4
|
+
* This function can be used in the editor as a completion source.
|
|
5
|
+
*
|
|
6
|
+
* Emoji list has been generated by using https://github.com/github/gemoji/blob/master/db/emoji.json
|
|
7
|
+
* from https://github.com/github/gemoji
|
|
8
|
+
*/
|
|
9
|
+
export declare const emojiCompletionSource: CompletionSource;
|
|
10
|
+
//# sourceMappingURL=emojis.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"emojis.d.ts","sourceRoot":"","sources":["../../../src/autocomplete/emojis.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiC,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAK3F;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB,EAAE,gBAUnC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/autocomplete/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Completion } from "@codemirror/autocomplete";
|
|
2
|
+
import { EditorState } from "@codemirror/state";
|
|
3
|
+
export declare const renderIcon: {
|
|
4
|
+
render: (completion: Completion, _state: EditorState) => globalThis.Node | null;
|
|
5
|
+
position: number;
|
|
6
|
+
};
|
|
7
|
+
//# sourceMappingURL=renderSymbol.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderSymbol.d.ts","sourceRoot":"","sources":["../../../src/autocomplete/renderSymbol.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAgBhD,eAAO,MAAM,UAAU;yBAdK,UAAU,UAAU,WAAW,KAAG,UAAU,CAAC,IAAI,GAAG,IAAI;;CAiBnF,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { CompletionSource } from "@codemirror/autocomplete";
|
|
2
|
+
/**
|
|
3
|
+
* Function that creates the `symbolCompletionSource`.
|
|
4
|
+
* This function can be used in the editor as a completion source.
|
|
5
|
+
*/
|
|
6
|
+
export declare const symbolCompletionSource: CompletionSource;
|
|
7
|
+
//# sourceMappingURL=symbols.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"symbols.d.ts","sourceRoot":"","sources":["../../../src/autocomplete/symbols.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmD,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAM7G;;;GAGG;AACH,eAAO,MAAM,sBAAsB,EAAE,gBAapC,CAAA"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Schema, Node as ProseNode } from "prosemirror-model";
|
|
2
|
+
import { Plugin as ProsePlugin, PluginKey } from "prosemirror-state";
|
|
3
|
+
import { EditorView } from "prosemirror-view";
|
|
4
|
+
import { CodeBlockView } from "./nodeview";
|
|
5
|
+
import { LineNumber, ThemeStyle, WaterproofCompletion, WaterproofSymbol } from "../api";
|
|
6
|
+
import { Completion } from "@codemirror/autocomplete";
|
|
7
|
+
import { WaterproofEditor } from "../editor";
|
|
8
|
+
export interface ICodePluginState {
|
|
9
|
+
macros: {
|
|
10
|
+
[cmd: string]: string;
|
|
11
|
+
};
|
|
12
|
+
/** A list of currently active `NodeView`s, in insertion order. */
|
|
13
|
+
activeNodeViews: Set<CodeBlockView>;
|
|
14
|
+
/** The schema of the outer editor */
|
|
15
|
+
schema: Schema;
|
|
16
|
+
/** Should the codemirror cells show line numbers */
|
|
17
|
+
showLines: boolean;
|
|
18
|
+
/** The lastest versioned linenumbers */
|
|
19
|
+
lines: LineNumber;
|
|
20
|
+
}
|
|
21
|
+
export declare const CODE_PLUGIN_KEY: PluginKey<ICodePluginState>;
|
|
22
|
+
/**
|
|
23
|
+
* Returns a function suitable for passing as a field in `EditorProps.nodeViews`.
|
|
24
|
+
* @see https://prosemirror.net/docs/ref/#view.EditorProps.nodeViews
|
|
25
|
+
*/
|
|
26
|
+
export declare function createCoqCodeView(completions: Array<Completion>, symbols: Array<Completion>, editorInstance: WaterproofEditor, initialThemeStyle: ThemeStyle): (node: ProseNode, view: EditorView, getPos: () => number | undefined) => CodeBlockView;
|
|
27
|
+
export declare const codePlugin: (completions: Array<WaterproofCompletion>, symbols: Array<WaterproofSymbol>, editorInstance: WaterproofEditor, initialThemeStyle: ThemeStyle) => ProsePlugin<ICodePluginState>;
|
|
28
|
+
//# sourceMappingURL=code-plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"code-plugin.d.ts","sourceRoot":"","sources":["../../../src/codeview/code-plugin.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,MAAM,EAAE,IAAI,IAAI,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,MAAM,IAAI,WAAW,EAAE,SAAS,EAAc,MAAM,mBAAmB,CAAC;AACjF,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AACxF,OAAO,EAAE,UAAU,EAAqB,MAAM,0BAA0B,CAAC;AACzE,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAI7C,MAAM,WAAW,gBAAgB;IAChC,MAAM,EAAE;QAAE,CAAC,GAAG,EAAC,MAAM,GAAI,MAAM,CAAA;KAAE,CAAC;IAClC,kEAAkE;IAClE,eAAe,EAAE,GAAG,CAAC,aAAa,CAAC,CAAC;IACjC,qCAAqC;IACrC,MAAM,EAAE,MAAM,CAAC;IACf,oDAAoD;IACpD,SAAS,EAAE,OAAO,CAAC;IACtB,wCAAwC;IACxC,KAAK,EAAE,UAAU,CAAC;CAClB;AAED,eAAO,MAAM,eAAe,6BAAmE,CAAC;AAEhG;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,KAAK,CAAC,UAAU,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,UAAU,CAAC,EAAE,cAAc,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,UAAU,IACpJ,MAAM,SAAS,EAAE,MAAM,UAAU,EAAE,QAAQ,MAAM,MAAM,GAAG,SAAS,KAAG,aAAa,CAe3F;AAiED,eAAO,MAAM,UAAU,GAAI,aAAa,KAAK,CAAC,oBAAoB,CAAC,EAAE,SAAS,KAAK,CAAC,gBAAgB,CAAC,EAAE,gBAAgB,gBAAgB,EAAE,mBAAmB,UAAU,kCAOrK,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color-scheme.d.ts","sourceRoot":"","sources":["../../../src/codeview/color-scheme.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,eAAO,MAAM,WAAW,uCAA2C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debouncer.d.ts","sourceRoot":"","sources":["../../../src/codeview/debouncer.ts"],"names":[],"mappings":"AAAA,qBAAa,SAAS;IAClB,OAAO,CAAC,KAAK,CAAa;IAC1B,OAAO,CAAC,MAAM,CAAS;IAEvB,OAAO,CAAC,KAAK,CAAqB;gBAEtB,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,IAAI;IAKpC,IAAI;CAMd"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/codeview/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { HighlightStyle, LRLanguage, LanguageSupport } from "@codemirror/language";
|
|
2
|
+
import { ThemeStyle } from "../../api";
|
|
3
|
+
export declare const highlight_dark: HighlightStyle;
|
|
4
|
+
export declare const highlight_light: HighlightStyle;
|
|
5
|
+
export declare const coqLanguage: LRLanguage;
|
|
6
|
+
export declare function coq(): LanguageSupport;
|
|
7
|
+
export declare function coqSyntaxHighlighting(themeStyle: ThemeStyle): import("@codemirror/state").Extension;
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/codeview/lang-pack/index.ts"],"names":[],"mappings":"AACA,OAAO,EACH,cAAc,EAAE,UAAU,EAAE,eAAe,EAC9C,MAAM,sBAAsB,CAAA;AAE7B,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AAqBtC,eAAO,MAAM,cAAc,gBAUzB,CAAA;AAGF,eAAO,MAAM,eAAe,gBAU1B,CAAC;AAGH,eAAO,MAAM,WAAW,YAqFtB,CAAA;AAEF,wBAAgB,GAAG,oBAElB;AAED,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,UAAU,yCAG3D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"print-grammar.d.ts","sourceRoot":"","sources":["../../../../src/codeview/lang-pack/print-grammar.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"syntax.d.ts","sourceRoot":"","sources":["../../../../src/codeview/lang-pack/syntax.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,QAAQ,EAAkB,MAAM,WAAW,CAAA;AACnD,eAAO,MAAM,MAAM,UAajB,CAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const Program = 1, Sentence = 2, Comment = 3, FocusOperation = 4, Bullet = 5, FocusBrace = 6, UnfocusBrace = 7, WaterproofTactic = 8, Argument = 16, And = 17, That = 19, As = 23, DefineSymbol = 30, In = 31, All = 35, AccordingTo = 37, SuchAn = 38, Magic = 40, It = 41, We = 44, Both = 48, Or = 50, Vernac = 52, Lemmas = 69, LemmaKeyword = 70, Definitions = 74, DefinitionKeyword = 75, ArgumentEnd = 79;
|
|
2
|
+
//# sourceMappingURL=syntax.terms.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"syntax.terms.d.ts","sourceRoot":"","sources":["../../../../src/codeview/lang-pack/syntax.terms.ts"],"names":[],"mappings":"AACA,eAAO,MACL,OAAO,IAAI,EACX,QAAQ,IAAI,EACZ,OAAO,IAAI,EACX,cAAc,IAAI,EAClB,MAAM,IAAI,EACV,UAAU,IAAI,EACd,YAAY,IAAI,EAChB,gBAAgB,IAAI,EACpB,QAAQ,KAAK,EACb,GAAG,KAAK,EACR,IAAI,KAAK,EACT,EAAE,KAAK,EACP,YAAY,KAAK,EACjB,EAAE,KAAK,EACP,GAAG,KAAK,EACR,WAAW,KAAK,EAChB,MAAM,KAAK,EACX,KAAK,KAAK,EACV,EAAE,KAAK,EACP,EAAE,KAAK,EACP,IAAI,KAAK,EACT,EAAE,KAAK,EACP,MAAM,KAAK,EACX,MAAM,KAAK,EACX,YAAY,KAAK,EACjB,WAAW,KAAK,EAChB,iBAAiB,KAAK,EACtB,WAAW,KAAK,CAAA"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { Completion, CompletionSource } from "@codemirror/autocomplete";
|
|
2
|
+
import { Node, Schema } from "prosemirror-model";
|
|
3
|
+
import { EditorView } from "prosemirror-view";
|
|
4
|
+
import { EmbeddedCodeMirrorEditor } from "../embedded-codemirror";
|
|
5
|
+
import { Diagnostic } from "@codemirror/lint";
|
|
6
|
+
import { ThemeStyle } from "../api";
|
|
7
|
+
import { WaterproofEditor } from "../editor";
|
|
8
|
+
/**
|
|
9
|
+
* Export CodeBlockView class that implements the custom codeblock nodeview.
|
|
10
|
+
* Corresponds with the example as can be found here:
|
|
11
|
+
* https://prosemirror.net/examples/codemirror/
|
|
12
|
+
*/
|
|
13
|
+
export declare class CodeBlockView extends EmbeddedCodeMirrorEditor {
|
|
14
|
+
private readonly editorInstance;
|
|
15
|
+
dom: HTMLElement;
|
|
16
|
+
private _lineNumberCompartment;
|
|
17
|
+
private _lineNumbersExtension;
|
|
18
|
+
private _dynamicCompletions;
|
|
19
|
+
private _readOnlyCompartment;
|
|
20
|
+
private _themeCompartment;
|
|
21
|
+
private lastUsedDiagnosticsVersion;
|
|
22
|
+
constructor(node: Node, view: EditorView, editorInstance: WaterproofEditor, getPos: (() => number | undefined), schema: Schema, completions: Array<Completion>, symbols: Array<Completion>, initialThemeStyle: ThemeStyle);
|
|
23
|
+
dispatchEmpty(): void;
|
|
24
|
+
private partOfInputArea;
|
|
25
|
+
handleSnippet(template: string, posFrom: number, posTo: number, completion?: Completion | undefined): void;
|
|
26
|
+
/**
|
|
27
|
+
* set edit permission
|
|
28
|
+
*/
|
|
29
|
+
setEditPermission(): void;
|
|
30
|
+
/**
|
|
31
|
+
* Update the theme of the editor.
|
|
32
|
+
*/
|
|
33
|
+
updateThemeFromVSCode(theme: ThemeStyle): void;
|
|
34
|
+
/**
|
|
35
|
+
* Update the line numbers extension
|
|
36
|
+
*/
|
|
37
|
+
updateLineNumbers(firstLineNo: number, toggleState: boolean): void;
|
|
38
|
+
/**
|
|
39
|
+
* This method needs to be called with the new list to update it.
|
|
40
|
+
*/
|
|
41
|
+
handleNewComplete(newCompletions: Completion[]): void;
|
|
42
|
+
/**
|
|
43
|
+
* (Dynamic) Completion Source.
|
|
44
|
+
* Contains completions for defined theorems/lemmas/etc.
|
|
45
|
+
*/
|
|
46
|
+
dynamicCompletionSource: CompletionSource;
|
|
47
|
+
/**
|
|
48
|
+
* The {@linkcode LintSource} to use for the codemirror instance.
|
|
49
|
+
* This will use the outer {@linkcode WaterproofEditor} to get diagnostics in the range of this
|
|
50
|
+
* codemirror view.
|
|
51
|
+
*/
|
|
52
|
+
private lintingFunction;
|
|
53
|
+
/**
|
|
54
|
+
* Add a new coq error to this view
|
|
55
|
+
* @param from The from position of the error.
|
|
56
|
+
* @param to The to postion of the error (should be larger than `from`).
|
|
57
|
+
* @param message The message attached to this error.
|
|
58
|
+
* @param severity The severity attached to this error.
|
|
59
|
+
*/
|
|
60
|
+
preprocessDiagnostic(from: number, to: number, message: string, severity: number): Diagnostic;
|
|
61
|
+
private showCopyNotification;
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=nodeview.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nodeview.d.ts","sourceRoot":"","sources":["../../../src/codeview/nodeview.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAuC,gBAAgB,EAA+L,MAAM,0BAA0B,CAAC;AAQ1S,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAG7C,OAAO,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAClE,OAAO,EAAsB,UAAU,EAAc,MAAM,kBAAkB,CAAC;AAE9E,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,EA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OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,UAAU;IAuEpG,OAAO,CAAC,oBAAoB;CAwB5B"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { NodeType, Node as PNode } from "prosemirror-model";
|
|
2
|
+
import { EditorState, Transaction, Selection } from "prosemirror-state";
|
|
3
|
+
/**
|
|
4
|
+
* Get a selection type object from a user selection.
|
|
5
|
+
* @param sel Input user selection.
|
|
6
|
+
* @returns Object that stores booleans whether we have a text or node selection.
|
|
7
|
+
*/
|
|
8
|
+
export declare function selectionType(sel: Selection): {
|
|
9
|
+
isTextSelection: boolean;
|
|
10
|
+
isNodeSelection: boolean;
|
|
11
|
+
};
|
|
12
|
+
export declare function getNearestPosOutsideCoqblock(sel: Selection, _state: EditorState): {
|
|
13
|
+
start: number;
|
|
14
|
+
end: number;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Helper function for inserting a new node above the currently selected one.
|
|
18
|
+
* @param state The current editor state.
|
|
19
|
+
* @param tr The current transaction for the state of the editor.
|
|
20
|
+
* @param escapeContainingNode Whether to escape the containing node.
|
|
21
|
+
* @param nodeType Array of nodes to insert. Depending on the node type this will be either one or more
|
|
22
|
+
* (coqcode outside of a coqblock needs to be enclosed within a new coqblock)
|
|
23
|
+
* @returns An insertion transaction.
|
|
24
|
+
*/
|
|
25
|
+
export declare function insertAbove(state: EditorState, tr: Transaction, ...nodeType: NodeType[]): Transaction;
|
|
26
|
+
/**
|
|
27
|
+
* Helper function for inserting a new node underneath the currently selected one.
|
|
28
|
+
* @param state The current editor state.
|
|
29
|
+
* @param tr The current transaction for the state of the editor.
|
|
30
|
+
* @param escapeContainingNode Whether to escape the containing node.
|
|
31
|
+
* @param nodeType Array of nodes to insert. Depending on the node type this will be either one or more
|
|
32
|
+
* (coqcode outside of a coqblock needs to be enclosed within a new coqblock)
|
|
33
|
+
* @returns An insertion transaction.
|
|
34
|
+
*/
|
|
35
|
+
export declare function insertUnder(state: EditorState, tr: Transaction, ...nodeType: NodeType[]): Transaction;
|
|
36
|
+
/**
|
|
37
|
+
* Returns the containing node for the current selection.
|
|
38
|
+
* @param sel The user's selection.
|
|
39
|
+
* @returns The node containing this selection. Will *not* return text nodes.
|
|
40
|
+
*/
|
|
41
|
+
export declare function getContainingNode(sel: Selection): PNode | undefined;
|
|
42
|
+
export declare function allowedToInsert(state: EditorState): boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Helper function for checking if the selection is within an input area.
|
|
45
|
+
* @returns Whether the selection is within an input area.
|
|
46
|
+
*/
|
|
47
|
+
export declare function checkInputArea(sel: Selection): boolean;
|
|
48
|
+
//# sourceMappingURL=command-helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command-helpers.d.ts","sourceRoot":"","sources":["../../../src/commands/command-helpers.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,IAAI,IAAI,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAiB,WAAW,EAAE,SAAS,EAAiB,MAAM,mBAAmB,CAAC;AAKtG;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,SAAS;;;EAK3C;AAED,wBAAgB,4BAA4B,CAAC,GAAG,EAAE,SAAS,EAAE,MAAM,EAAE,WAAW;;;EAa/E;AAED;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,WAAW,EAAE,EAAE,EAAE,WAAW,EAAE,GAAG,QAAQ,EAAE,QAAQ,EAAE,GAAG,WAAW,CAwBrG;AAED;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,WAAW,EAAE,EAAE,EAAE,WAAW,EAAE,GAAG,QAAQ,EAAE,QAAQ,EAAE,GAAG,WAAW,CA8BrG;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,SAAS,GAAG,KAAK,GAAG,SAAS,CAUnE;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAS3D;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,SAAS,GAAG,OAAO,CAOtD"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Schema } from "prosemirror-model";
|
|
2
|
+
import { Command } from "prosemirror-state";
|
|
3
|
+
import { InsertionPlace } from "./types";
|
|
4
|
+
import { FileFormat } from "../api";
|
|
5
|
+
/**
|
|
6
|
+
* Creates a command that creates a new code cell above/underneath the currently selected node.
|
|
7
|
+
* @param schema The schema to use
|
|
8
|
+
* @param filef The format of the currently opened file.
|
|
9
|
+
* @param insertionPlace The place to insert the new node into: Underneath or Above the current node.
|
|
10
|
+
* @returns The `Command`.
|
|
11
|
+
*/
|
|
12
|
+
export declare function cmdInsertCode(schema: Schema, filef: FileFormat, insertionPlace: InsertionPlace): Command;
|
|
13
|
+
/**
|
|
14
|
+
* Creates a command that creates a new markdown cell underneath/above the currently selected node.
|
|
15
|
+
* @param schema The schema to use
|
|
16
|
+
* @param filef The fileformat of the file currently opened.
|
|
17
|
+
* @param insertionPlace The place to insert at: Above or Underneath current node.
|
|
18
|
+
* @returns The `Command`.
|
|
19
|
+
*/
|
|
20
|
+
export declare function cmdInsertMarkdown(schema: Schema, filef: FileFormat, insertionPlace: InsertionPlace): Command;
|
|
21
|
+
/**
|
|
22
|
+
* Returns a command that inserts a new Display Math cell above/underneath the currently selected cell.
|
|
23
|
+
* @param schema The schema in use.
|
|
24
|
+
* @param filef The file format of the current file.
|
|
25
|
+
* @param insertionPlace The place to insert the node at Above or Underneath the current node.
|
|
26
|
+
* @returns The `Command`
|
|
27
|
+
*/
|
|
28
|
+
export declare function cmdInsertLatex(schema: Schema, filef: FileFormat, insertionPlace: InsertionPlace): Command;
|
|
29
|
+
export declare const liftWrapper: Command;
|
|
30
|
+
//# sourceMappingURL=commands.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../../src/commands/commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,MAAM,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,OAAO,EAA2C,MAAM,mBAAmB,CAAC;AAErF,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAIzC,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAoBpC;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,cAAc,GAAG,OAAO,CAMxG;AAgBD;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,cAAc,GAAG,OAAO,CAO5G;AASD;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,cAAc,GAAG,OAAO,CAKzG;AAED,eAAO,MAAM,WAAW,EAAE,OAqBzB,CAAA"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { EditorState, Transaction } from "prosemirror-state";
|
|
2
|
+
import { EditorView } from "prosemirror-view";
|
|
3
|
+
export declare function deleteNodeIfEmpty(state: EditorState, dispatch?: ((tr: Transaction) => void), _view?: EditorView): boolean;
|
|
4
|
+
//# sourceMappingURL=delete-command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete-command.d.ts","sourceRoot":"","sources":["../../../src/commands/delete-command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,WAAW,EAAE,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,WAAW,KAAK,IAAI,CAAC,EAAE,KAAK,CAAC,EAAE,UAAU,GAAG,OAAO,CAmBzH"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAErD,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC3F,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Command } from "prosemirror-state";
|
|
2
|
+
import { FileFormat } from "../api/FileFormat";
|
|
3
|
+
import { InsertionFunction, InsertionPlace } from "./types";
|
|
4
|
+
import { NodeType } from "prosemirror-model";
|
|
5
|
+
/**
|
|
6
|
+
* Return a Markdown insertion command.
|
|
7
|
+
* @param filef The file format of the file in use.
|
|
8
|
+
* @param insertionFunction The function used to insert the node into the editor.
|
|
9
|
+
* @param place Where to insert the node into the editor. Either Above or Underneath the currently selected node.
|
|
10
|
+
* @param mvNodeType The node to use in the case of a `.mv` file.
|
|
11
|
+
* @param vNodeType The node to use in the case of a `.v` file.
|
|
12
|
+
* @returns The insertion command.
|
|
13
|
+
*/
|
|
14
|
+
export declare function getMdInsertCommand(filef: FileFormat, insertionFunction: InsertionFunction, place: InsertionPlace, mvNodeType: NodeType, vNodeType: NodeType): Command;
|
|
15
|
+
/**
|
|
16
|
+
* Returns an insertion command for insertion display latex into the editor.
|
|
17
|
+
* @param filef The file format of the file currently being edited.
|
|
18
|
+
* @param insertionFunction The insertion function to use.
|
|
19
|
+
* @param place The place to insert into, either Above or Underneath the currently selected node.
|
|
20
|
+
* @param latexNodeType The node type for a 'display latex' node.
|
|
21
|
+
* @returns The insertion command.
|
|
22
|
+
*/
|
|
23
|
+
export declare function getLatexInsertCommand(filef: FileFormat, insertionFunction: InsertionFunction, place: InsertionPlace, latexNodeType: NodeType): Command;
|
|
24
|
+
/**
|
|
25
|
+
* Returns an insertion command for inserting a new coq code cell. Will create a new coqblock if necessary.
|
|
26
|
+
* @param filef The file format of the file that is being edited.
|
|
27
|
+
* @param insertionFunction The insertion function to use.
|
|
28
|
+
* @param place The place of insertion, either Above or Underneath the currently selected node.
|
|
29
|
+
* @param coqblockNodeType The node type of a coqblock node (contains coqdoc and coqcode).
|
|
30
|
+
* @param coqcodeNodeType The node type of a coqcode node.
|
|
31
|
+
* @returns The insertion command.
|
|
32
|
+
*/
|
|
33
|
+
export declare function getCodeInsertCommand(filef: FileFormat, insertionFunction: InsertionFunction, place: InsertionPlace, coqblockNodeType: NodeType, coqcodeNodeType: NodeType): Command;
|
|
34
|
+
//# sourceMappingURL=insert-command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"insert-command.d.ts","sourceRoot":"","sources":["../../../src/commands/insert-command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAA4B,MAAM,mBAAmB,CAAC;AACtE,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAI7C;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAC9B,KAAK,EAAE,UAAU,EACjB,iBAAiB,EAAE,iBAAiB,EACpC,KAAK,EAAE,cAAc,EACrB,UAAU,EAAE,QAAQ,EACpB,SAAS,EAAE,QAAQ,GACpB,OAAO,CA2CT;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CACjC,KAAK,EAAE,UAAU,EACjB,iBAAiB,EAAE,iBAAiB,EACpC,KAAK,EAAE,cAAc,EACrB,aAAa,EAAE,QAAQ,GACxB,OAAO,CAmCT;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAChC,KAAK,EAAE,UAAU,EACjB,iBAAiB,EAAE,iBAAiB,EACpC,KAAK,EAAE,cAAc,EACrB,gBAAgB,EAAE,QAAQ,EAC1B,eAAe,EAAE,QAAQ,GAC1B,OAAO,CAkCT"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { NodeType } from "prosemirror-model";
|
|
2
|
+
import { EditorState, Transaction } from "prosemirror-state";
|
|
3
|
+
/**
|
|
4
|
+
* Enum for the insertion place, can be either `Above` or `Underneath` the currently selected cell.
|
|
5
|
+
*/
|
|
6
|
+
export declare enum InsertionPlace {
|
|
7
|
+
Above = 0,
|
|
8
|
+
Underneath = 1
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Insertion function type. This type of function is passed to the `get...Command` functions. The function will insert
|
|
12
|
+
* the correct NodeType either above or below the selected node.
|
|
13
|
+
*/
|
|
14
|
+
export type InsertionFunction = (state: EditorState, trans: Transaction, ...nodeType: NodeType[]) => Transaction;
|
|
15
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/commands/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAE7D;;GAEG;AACH,oBAAY,cAAc;IACtB,KAAK,IAAA;IACL,UAAU,IAAA;CACb;AAED;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,EAAE,GAAG,QAAQ,EAAE,QAAQ,EAAE,KAAK,WAAW,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/context-menu/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,QAAQ,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { WaterproofEditor } from "../editor";
|
|
2
|
+
/**
|
|
3
|
+
* Creates a context menu given the current editor.
|
|
4
|
+
* @param editor The editor in use.
|
|
5
|
+
* @returns HTMLDivElement storing the context menu element.
|
|
6
|
+
*/
|
|
7
|
+
export declare function createContextMenuHTML(editor: WaterproofEditor): HTMLDivElement;
|
|
8
|
+
//# sourceMappingURL=menu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"menu.d.ts","sourceRoot":"","sources":["../../../src/context-menu/menu.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAE7C;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,gBAAgB,GAAG,cAAc,CAmB9E"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Node as ProseNode } from "prosemirror-model";
|
|
2
|
+
export declare enum BLOCK_NAME {
|
|
3
|
+
COQ = "coq",
|
|
4
|
+
MATH_DISPLAY = "math_display",
|
|
5
|
+
INPUT_AREA = "input_area",
|
|
6
|
+
HINT = "hint",
|
|
7
|
+
MARKDOWN = "markdown",
|
|
8
|
+
COQ_MARKDOWN = "coqdown",
|
|
9
|
+
COQ_CODE = "coq_code",
|
|
10
|
+
COQ_DOC = "coq_doc"
|
|
11
|
+
}
|
|
12
|
+
export interface BlockRange {
|
|
13
|
+
from: number;
|
|
14
|
+
to: number;
|
|
15
|
+
}
|
|
16
|
+
export interface Block {
|
|
17
|
+
type: string;
|
|
18
|
+
stringContent: string;
|
|
19
|
+
range: BlockRange;
|
|
20
|
+
innerBlocks?: Block[];
|
|
21
|
+
toProseMirror(): ProseNode;
|
|
22
|
+
debugPrint(level: number): void;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=block.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"block.d.ts","sourceRoot":"","sources":["../../../../src/document/blocks/block.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,IAAI,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAGtD,oBAAY,UAAU;IAClB,GAAG,QAAQ;IACX,YAAY,iBAAiB;IAC7B,UAAU,eAAe;IACzB,IAAI,SAAS;IACb,QAAQ,aAAa;IACrB,YAAY,YAAY;IACxB,QAAQ,aAAa;IACrB,OAAO,YAAY;CACtB;AAED,MAAM,WAAW,UAAU;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,KAAK;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,UAAU,CAAC;IAElB,WAAW,CAAC,EAAE,KAAK,EAAE,CAAC;IAEtB,aAAa,IAAI,SAAS,CAAC;IAC3B,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACnC"}
|