@impermeable/waterproof-editor 0.9.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/LICENSE +21 -0
- package/README.md +20 -0
- package/dist/api/Completions.d.ts +21 -0
- package/dist/api/Completions.d.ts.map +1 -0
- package/dist/api/DocChange.d.ts +19 -0
- package/dist/api/DocChange.d.ts.map +1 -0
- package/dist/api/FileFormat.d.ts +10 -0
- package/dist/api/FileFormat.d.ts.map +1 -0
- package/dist/api/InputAreaStatus.d.ts +14 -0
- package/dist/api/InputAreaStatus.d.ts.map +1 -0
- package/dist/api/LineNumber.d.ts +10 -0
- package/dist/api/LineNumber.d.ts.map +1 -0
- package/dist/api/ServerStatus.d.ts +18 -0
- package/dist/api/ServerStatus.d.ts.map +1 -0
- package/dist/api/Severity.d.ts +12 -0
- package/dist/api/Severity.d.ts.map +1 -0
- package/dist/api/index.d.ts +12 -0
- package/dist/api/index.d.ts.map +1 -0
- package/dist/api/types.d.ts +105 -0
- package/dist/api/types.d.ts.map +1 -0
- package/dist/autocomplete/coqTerms.d.ts +3 -0
- package/dist/autocomplete/coqTerms.d.ts.map +1 -0
- package/dist/autocomplete/emojis.d.ts +10 -0
- package/dist/autocomplete/emojis.d.ts.map +1 -0
- package/dist/autocomplete/index.d.ts +2 -0
- package/dist/autocomplete/index.d.ts.map +1 -0
- package/dist/autocomplete/renderSymbol.d.ts +7 -0
- package/dist/autocomplete/renderSymbol.d.ts.map +1 -0
- package/dist/autocomplete/symbols.d.ts +7 -0
- package/dist/autocomplete/symbols.d.ts.map +1 -0
- package/dist/codeview/code-plugin.d.ts +27 -0
- package/dist/codeview/code-plugin.d.ts.map +1 -0
- package/dist/codeview/color-scheme.d.ts +6 -0
- package/dist/codeview/color-scheme.d.ts.map +1 -0
- package/dist/codeview/debouncer.d.ts +8 -0
- package/dist/codeview/debouncer.d.ts.map +1 -0
- package/dist/codeview/index.d.ts +3 -0
- package/dist/codeview/index.d.ts.map +1 -0
- package/dist/codeview/lang-pack/index.d.ts +7 -0
- package/dist/codeview/lang-pack/index.d.ts.map +1 -0
- package/dist/codeview/lang-pack/syntax.d.ts +3 -0
- package/dist/codeview/lang-pack/syntax.d.ts.map +1 -0
- package/dist/codeview/lang-pack/syntax.terms.d.ts +2 -0
- package/dist/codeview/lang-pack/syntax.terms.d.ts.map +1 -0
- package/dist/codeview/nodeview.d.ts +65 -0
- package/dist/codeview/nodeview.d.ts.map +1 -0
- package/dist/commands/command-helpers.d.ts +48 -0
- package/dist/commands/command-helpers.d.ts.map +1 -0
- package/dist/commands/commands.d.ts +30 -0
- package/dist/commands/commands.d.ts.map +1 -0
- package/dist/commands/delete-command.d.ts +4 -0
- package/dist/commands/delete-command.d.ts.map +1 -0
- package/dist/commands/index.d.ts +4 -0
- package/dist/commands/index.d.ts.map +1 -0
- package/dist/commands/insert-command.d.ts +34 -0
- package/dist/commands/insert-command.d.ts.map +1 -0
- package/dist/commands/types.d.ts +15 -0
- package/dist/commands/types.d.ts.map +1 -0
- package/dist/context-menu/index.d.ts +2 -0
- package/dist/context-menu/index.d.ts.map +1 -0
- package/dist/context-menu/menu.d.ts +8 -0
- package/dist/context-menu/menu.d.ts.map +1 -0
- package/dist/document/blocks/block.d.ts +24 -0
- package/dist/document/blocks/block.d.ts.map +1 -0
- package/dist/document/blocks/blocktypes.d.ts +78 -0
- package/dist/document/blocks/blocktypes.d.ts.map +1 -0
- package/dist/document/blocks/index.d.ts +3 -0
- package/dist/document/blocks/index.d.ts.map +1 -0
- package/dist/document/blocks/schema.d.ts +21 -0
- package/dist/document/blocks/schema.d.ts.map +1 -0
- package/dist/document/blocks/typeguards.d.ts +11 -0
- package/dist/document/blocks/typeguards.d.ts.map +1 -0
- package/dist/document/construct-document.d.ts +4 -0
- package/dist/document/construct-document.d.ts.map +1 -0
- package/dist/document/index.d.ts +5 -0
- package/dist/document/index.d.ts.map +1 -0
- package/dist/document/utils.d.ts +49 -0
- package/dist/document/utils.d.ts.map +1 -0
- package/dist/documentProgressDecorator.d.ts +9 -0
- package/dist/documentProgressDecorator.d.ts.map +1 -0
- package/dist/editor.d.ts +117 -0
- package/dist/editor.d.ts.map +1 -0
- package/dist/embedded-codemirror/embedded-codemirror-keymap.d.ts +9 -0
- package/dist/embedded-codemirror/embedded-codemirror-keymap.d.ts.map +1 -0
- package/dist/embedded-codemirror/embeddedCodemirror.d.ts +40 -0
- package/dist/embedded-codemirror/embeddedCodemirror.d.ts.map +1 -0
- package/dist/embedded-codemirror/index.d.ts +3 -0
- package/dist/embedded-codemirror/index.d.ts.map +1 -0
- package/dist/embedded-codemirror/types.d.ts +9 -0
- package/dist/embedded-codemirror/types.d.ts.map +1 -0
- package/dist/hinting/hint-plugin.d.ts +9 -0
- package/dist/hinting/hint-plugin.d.ts.map +1 -0
- package/dist/hinting/index.d.ts +2 -0
- package/dist/hinting/index.d.ts.map +1 -0
- package/dist/index.css +2 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +341 -0
- package/dist/inputArea.d.ts +14 -0
- package/dist/inputArea.d.ts.map +1 -0
- package/dist/markup-views/CoqdocPlugin.d.ts +19 -0
- package/dist/markup-views/CoqdocPlugin.d.ts.map +1 -0
- package/dist/markup-views/CoqdocView.d.ts +15 -0
- package/dist/markup-views/CoqdocView.d.ts.map +1 -0
- package/dist/markup-views/MarkdownPlugin.d.ts +21 -0
- package/dist/markup-views/MarkdownPlugin.d.ts.map +1 -0
- package/dist/markup-views/MarkdownView.d.ts +15 -0
- package/dist/markup-views/MarkdownView.d.ts.map +1 -0
- package/dist/markup-views/index.d.ts +5 -0
- package/dist/markup-views/index.d.ts.map +1 -0
- package/dist/markup-views/switchable-view/EditableView.d.ts +22 -0
- package/dist/markup-views/switchable-view/EditableView.d.ts.map +1 -0
- package/dist/markup-views/switchable-view/EditorTheme.d.ts +8 -0
- package/dist/markup-views/switchable-view/EditorTheme.d.ts.map +1 -0
- package/dist/markup-views/switchable-view/MarkdownSchema.d.ts +8 -0
- package/dist/markup-views/switchable-view/MarkdownSchema.d.ts.map +1 -0
- package/dist/markup-views/switchable-view/RenderedView.d.ts +13 -0
- package/dist/markup-views/switchable-view/RenderedView.d.ts.map +1 -0
- package/dist/markup-views/switchable-view/SwitchableView.d.ts +62 -0
- package/dist/markup-views/switchable-view/SwitchableView.d.ts.map +1 -0
- package/dist/markup-views/switchable-view/index.d.ts +2 -0
- package/dist/markup-views/switchable-view/index.d.ts.map +1 -0
- package/dist/math-integration/index.d.ts +2 -0
- package/dist/math-integration/index.d.ts.map +1 -0
- package/dist/math-integration/nodespecs.d.ts +4 -0
- package/dist/math-integration/nodespecs.d.ts.map +1 -0
- package/dist/menubar/index.d.ts +2 -0
- package/dist/menubar/index.d.ts.map +1 -0
- package/dist/menubar/menubar.d.ts +25 -0
- package/dist/menubar/menubar.d.ts.map +1 -0
- package/dist/osType.d.ts +8 -0
- package/dist/osType.d.ts.map +1 -0
- package/dist/progressBar.d.ts +13 -0
- package/dist/progressBar.d.ts.map +1 -0
- package/dist/qedStatus.d.ts +9 -0
- package/dist/qedStatus.d.ts.map +1 -0
- package/dist/schema/index.d.ts +2 -0
- package/dist/schema/index.d.ts.map +1 -0
- package/dist/schema/schema-nodes.d.ts +1 -0
- package/dist/schema/schema-nodes.d.ts.map +1 -0
- package/dist/schema/schema.d.ts +23 -0
- package/dist/schema/schema.d.ts.map +1 -0
- package/dist/styles/index.d.ts +16 -0
- package/dist/styles/index.d.ts.map +1 -0
- package/dist/themeStore.d.ts +4 -0
- package/dist/themeStore.d.ts.map +1 -0
- package/dist/translation/Translator.d.ts +12 -0
- package/dist/translation/Translator.d.ts.map +1 -0
- package/dist/translation/index.d.ts +2 -0
- package/dist/translation/index.d.ts.map +1 -0
- package/dist/translation/toProsemirror/index.d.ts +2 -0
- package/dist/translation/toProsemirror/index.d.ts.map +1 -0
- package/dist/translation/toProsemirror/mvFileToProsemirror.d.ts +2 -0
- package/dist/translation/toProsemirror/mvFileToProsemirror.d.ts.map +1 -0
- package/dist/translation/toProsemirror/parseAsMv.d.ts +7 -0
- package/dist/translation/toProsemirror/parseAsMv.d.ts.map +1 -0
- package/dist/translation/toProsemirror/parser.d.ts +3 -0
- package/dist/translation/toProsemirror/parser.d.ts.map +1 -0
- package/dist/translation/types.d.ts +12 -0
- package/dist/translation/types.d.ts.map +1 -0
- package/dist/utilities/index.d.ts +2 -0
- package/dist/utilities/index.d.ts.map +1 -0
- package/dist/utilities/prosemirror.d.ts +13 -0
- package/dist/utilities/prosemirror.d.ts.map +1 -0
- package/package.json +78 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 impermeable
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Important
|
|
2
|
+
WaterproofEditor is currently developed as a part of the [waterproof-vscode](https://www.github.com/impermeable/waterproof-vscode) project, but will be moved into this repository eventually.
|
|
3
|
+
|
|
4
|
+
At the present this repostiory is very much a work in progress.
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
# WaterproofEditor
|
|
8
|
+
|
|
9
|
+
This repository contains the source required to construct the editor as is used in the [waterproof-vscode](https://www.github.com/impermeable/waterproof-vscode) extension.
|
|
10
|
+
|
|
11
|
+
## Mixed documents
|
|
12
|
+
|
|
13
|
+
WaterproofEditor supports and is designed to be used with mixed documents, containing code as well as rich text in the form of Markdown or LaTeX.
|
|
14
|
+
|
|
15
|
+
#### Example (adapted from [waterproof-vscode](https://www.github.com/impermeable/waterproof-vscode))
|
|
16
|
+

|
|
17
|
+
|
|
18
|
+
As WaterproofEditor was designed to be used in an educational setting it supports two additional types of 'cells':
|
|
19
|
+
- **Input areas**: Specific regions of a document meant to be edited.
|
|
20
|
+
- **Hints**: Collapseable regions of a document that can be used to hide parts of a document from a user. This can be used to give hints to students or to simply hide the import of packages/libraries.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type of completions.
|
|
3
|
+
*/
|
|
4
|
+
export type WaterproofCompletion = {
|
|
5
|
+
/** The label shown in the completion panel */
|
|
6
|
+
label: string;
|
|
7
|
+
/** The type of the completion */
|
|
8
|
+
type: string;
|
|
9
|
+
detail: string;
|
|
10
|
+
template: string;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Completion that can always be inserted.
|
|
14
|
+
* Does not support templating.
|
|
15
|
+
*/
|
|
16
|
+
export type WaterproofSymbol = {
|
|
17
|
+
label: string;
|
|
18
|
+
type: string;
|
|
19
|
+
apply: string;
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=Completions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Completions.d.ts","sourceRoot":"","sources":["../../src/api/Completions.ts"],"names":[],"mappings":"AACA;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG;IAC/B,8CAA8C;IAC9C,KAAK,EAAE,MAAM,CAAC;IACd,iCAAiC;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAA;CACnB,CAAA;AAED;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAA;CAChB,CAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This object specifies a TextDocument change. As in prosemirror:
|
|
3
|
+
* startInFile == endInFile: insert operation
|
|
4
|
+
* else: replace or deletion with finalText
|
|
5
|
+
*/
|
|
6
|
+
export type DocChange = {
|
|
7
|
+
startInFile: number;
|
|
8
|
+
endInFile: number;
|
|
9
|
+
finalText: string;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* This object specifies a wrapping TextDocument change. This happens when nodes
|
|
13
|
+
* are wrapped with input or hint
|
|
14
|
+
*/
|
|
15
|
+
export type WrappingDocChange = {
|
|
16
|
+
firstEdit: DocChange;
|
|
17
|
+
secondEdit: DocChange;
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=DocChange.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DocChange.d.ts","sourceRoot":"","sources":["../../src/api/DocChange.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,MAAM,SAAS,GAAG;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACrB,CAAA;AAED;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC5B,SAAS,EAAE,SAAS,CAAC;IACrB,UAAU,EAAE,SAAS,CAAC;CACzB,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The different supported input/output file types
|
|
3
|
+
*/
|
|
4
|
+
export declare enum FileFormat {
|
|
5
|
+
/** Markdown enabled coq file (extension: `.mv`) */
|
|
6
|
+
MarkdownV = "MarkdownV",
|
|
7
|
+
/** Regular coq file, with the possibility for coqdoc comments (extension: `.v`) */
|
|
8
|
+
RegularV = "RegularV"
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=FileFormat.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FileFormat.d.ts","sourceRoot":"","sources":["../../src/api/FileFormat.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,oBAAY,UAAU;IAClB,mDAAmD;IACnD,SAAS,cAAc;IACvB,mFAAmF;IACnF,QAAQ,aAAa;CACxB"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The status of an input area.
|
|
3
|
+
*/
|
|
4
|
+
export declare enum InputAreaStatus {
|
|
5
|
+
/** The proof is correct. */
|
|
6
|
+
Proven = "proven",
|
|
7
|
+
/** The proof is unfinished or contains an error. */
|
|
8
|
+
Incomplete = "incomplete",
|
|
9
|
+
/** The input area does not contain `Qed.` at the end, so the status cannot be determined. */
|
|
10
|
+
Invalid = "invalid",
|
|
11
|
+
/** Not in view, so was not requested */
|
|
12
|
+
NotInView = "not-in-view"
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=InputAreaStatus.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InputAreaStatus.d.ts","sourceRoot":"","sources":["../../src/api/InputAreaStatus.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,oBAAY,eAAe;IACvB,4BAA4B;IAC5B,MAAM,WAAW;IACjB,oDAAoD;IACpD,UAAU,eAAe;IACzB,6FAA6F;IAC7F,OAAO,YAAY;IACnB,wCAAwC;IACxC,SAAS,gBAAgB;CAC5B"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This is the versioned linenumber message
|
|
3
|
+
*/
|
|
4
|
+
export type LineNumber = {
|
|
5
|
+
/** The linenumbers */
|
|
6
|
+
linenumbers: Array<number>;
|
|
7
|
+
/** Version of the document the linenumbers correspond to.. */
|
|
8
|
+
version: number;
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=LineNumber.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LineNumber.d.ts","sourceRoot":"","sources":["../../src/api/LineNumber.ts"],"names":[],"mappings":"AACA;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG;IACrB,sBAAsB;IACtB,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC3B,8DAA8D;IAC9D,OAAO,EAAE,MAAM,CAAC;CACnB,CAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type that indicates that the server is busy processing a document.
|
|
3
|
+
*/
|
|
4
|
+
export type Busy = {
|
|
5
|
+
/** Status */
|
|
6
|
+
status: "Busy";
|
|
7
|
+
/** Extra metadata, can be used to communicate what the server is currently processing */
|
|
8
|
+
metadata: string;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Type that indicates that the server is idle. This means that it has
|
|
12
|
+
* either completed checking or is stopped.
|
|
13
|
+
*/
|
|
14
|
+
export type Idle = {
|
|
15
|
+
status: "Idle" | "Stopped";
|
|
16
|
+
};
|
|
17
|
+
export type ServerStatus = Busy | Idle;
|
|
18
|
+
//# sourceMappingURL=ServerStatus.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ServerStatus.d.ts","sourceRoot":"","sources":["../../src/api/ServerStatus.ts"],"names":[],"mappings":"AACA;;GAEG;AACH,MAAM,MAAM,IAAI,GAAG;IACf,aAAa;IACb,MAAM,EAAE,MAAM,CAAC;IACf,yFAAyF;IACzF,QAAQ,EAAE,MAAM,CAAC;CACpB,CAAA;AAED;;;GAGG;AACH,MAAM,MAAM,IAAI,GAAG;IACf,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;CAC9B,CAAA;AAED,MAAM,MAAM,YAAY,GAAG,IAAI,GAAG,IAAI,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Severity of reported diagnostics
|
|
3
|
+
*/
|
|
4
|
+
export declare enum Severity {
|
|
5
|
+
Error = 0,
|
|
6
|
+
Warning = 1,
|
|
7
|
+
Information = 2,
|
|
8
|
+
Hint = 3
|
|
9
|
+
}
|
|
10
|
+
export type SeverityLabel = "hint" | "info" | "warning" | "error";
|
|
11
|
+
export declare const SeverityLabelMap: Record<Severity, SeverityLabel>;
|
|
12
|
+
//# sourceMappingURL=Severity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Severity.d.ts","sourceRoot":"","sources":["../../src/api/Severity.ts"],"names":[],"mappings":"AACA;;GAEG;AACH,oBAAY,QAAQ;IACnB,KAAK,IAAI;IACT,OAAO,IAAI;IACX,WAAW,IAAI;IACZ,IAAI,IAAI;CACX;AAED,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC;AAElE,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,QAAQ,EAAE,aAAa,CAK5D,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export { DocChange, WrappingDocChange } from "./DocChange";
|
|
2
|
+
export { InputAreaStatus } from "./InputAreaStatus";
|
|
3
|
+
export { LineNumber } from "./LineNumber";
|
|
4
|
+
export { Severity, SeverityLabel, SeverityLabelMap } from "./Severity";
|
|
5
|
+
export { FileFormat } from "./FileFormat";
|
|
6
|
+
export * from "./types";
|
|
7
|
+
export { WaterproofCompletion, WaterproofSymbol } from "./Completions";
|
|
8
|
+
export { Completion } from "@codemirror/autocomplete";
|
|
9
|
+
export { Step, ReplaceStep, ReplaceAroundStep } from "prosemirror-transform";
|
|
10
|
+
export { Fragment } from "prosemirror-model";
|
|
11
|
+
export { ServerStatus, Idle, Busy } from "./ServerStatus";
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAG3D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAC,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAEvE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,cAAc,SAAS,CAAC;AAExB,OAAO,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEvE,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC7E,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,105 @@
|
|
|
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
|
+
* WaterproofDocument is a collection of blocks
|
|
24
|
+
*/
|
|
25
|
+
export type WaterproofDocument = Block[];
|
|
26
|
+
export type WaterproofCallbacks = {
|
|
27
|
+
executeCommand: (command: string, time: number) => void;
|
|
28
|
+
executeHelp: () => void;
|
|
29
|
+
editorReady: () => void;
|
|
30
|
+
documentChange: (change: DocChange | WrappingDocChange) => void;
|
|
31
|
+
applyStepError: (errorMessage: string) => void;
|
|
32
|
+
cursorChange: (cursorPosition: number) => void;
|
|
33
|
+
lineNumbers: (linenumbers: Array<number>, version: number) => void;
|
|
34
|
+
viewportHint: (start: number, end: number) => void;
|
|
35
|
+
};
|
|
36
|
+
export declare abstract class WaterproofMapping {
|
|
37
|
+
abstract getMapping: () => Map<number, StringCell>;
|
|
38
|
+
abstract get version(): number;
|
|
39
|
+
abstract findPosition: (index: number) => number;
|
|
40
|
+
abstract findInvPosition: (index: number) => number;
|
|
41
|
+
abstract update: (step: Step) => DocChange | WrappingDocChange;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Configuration object for the WaterproofEditor.
|
|
45
|
+
*
|
|
46
|
+
* - `api` contains the callbacks that the editor will use to communicate with the host application.
|
|
47
|
+
* - `documentConstructor` is a function that takes a string and returns a WaterproofDocument (block representation of a ProseMirror document).
|
|
48
|
+
* - `mapping` is a constructor for the WaterproofMapping class, which handles the mapping between the ProseMirror document and the text document in the host application.
|
|
49
|
+
*/
|
|
50
|
+
export type WaterproofEditorConfig = {
|
|
51
|
+
/** Set of (static) completions that should be shown to the user. */
|
|
52
|
+
completions: Array<WaterproofCompletion>;
|
|
53
|
+
/** Set of (static) symbol completions that should be shown to the user. */
|
|
54
|
+
symbols: Array<WaterproofSymbol>;
|
|
55
|
+
/** How the editor communicates to the parent process */
|
|
56
|
+
api: WaterproofCallbacks;
|
|
57
|
+
/** Determines how the editor document gets constructed from a string input */
|
|
58
|
+
documentConstructor: (document: string) => WaterproofDocument;
|
|
59
|
+
/** 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. */
|
|
60
|
+
mapping: new (inputString: string, versionNum: number) => WaterproofMapping;
|
|
61
|
+
/** THIS IS A TEMPORARY FEATURE THAT WILL GET REMOVED */
|
|
62
|
+
documentPreprocessor?: (inputString: string) => {
|
|
63
|
+
resultingDocument: string;
|
|
64
|
+
documentChange: DocChange | WrappingDocChange | undefined;
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
export declare enum HistoryChange {
|
|
68
|
+
Undo = 0,
|
|
69
|
+
Redo = 1
|
|
70
|
+
}
|
|
71
|
+
export type SimpleProgressInfo = {
|
|
72
|
+
/** Range for which the processing info was reported. */
|
|
73
|
+
range: {
|
|
74
|
+
start: {
|
|
75
|
+
line: number;
|
|
76
|
+
character: number;
|
|
77
|
+
};
|
|
78
|
+
end: {
|
|
79
|
+
line: number;
|
|
80
|
+
character: number;
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
/** Kind of progress that was reported. */
|
|
84
|
+
kind?: CoqFileProgressKind;
|
|
85
|
+
};
|
|
86
|
+
export type SimpleProgressParams = {
|
|
87
|
+
numberOfLines: number;
|
|
88
|
+
progress: SimpleProgressInfo[];
|
|
89
|
+
};
|
|
90
|
+
export declare enum CoqFileProgressKind {
|
|
91
|
+
Processing = 1,
|
|
92
|
+
FatalError = 2
|
|
93
|
+
}
|
|
94
|
+
export interface OffsetDiagnostic {
|
|
95
|
+
message: string;
|
|
96
|
+
severity: Severity;
|
|
97
|
+
startOffset: number;
|
|
98
|
+
endOffset: number;
|
|
99
|
+
}
|
|
100
|
+
export type DiagnosticMessage = {
|
|
101
|
+
positionedDiagnostics: OffsetDiagnostic[];
|
|
102
|
+
version: number;
|
|
103
|
+
};
|
|
104
|
+
export type ThemeStyle = "light" | "dark";
|
|
105
|
+
//# 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,CAAC,IAAI;IACxB,GAAG,EAAE,CAAC,CAAC;IACP,GAAG,EAAE,MAAM,GAAG,SAAS,CAAC;CAC3B,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,KAAK,EAAE,CAAC;AAEzC,MAAM,MAAM,mBAAmB,GAAG;IAC9B,cAAc,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACxD,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,cAAc,EAAE,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}
|
|
@@ -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,27 @@
|
|
|
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, WaterproofCompletion, WaterproofSymbol } from "../api";
|
|
6
|
+
import { Completion } from "@codemirror/autocomplete";
|
|
7
|
+
export interface ICodePluginState {
|
|
8
|
+
macros: {
|
|
9
|
+
[cmd: string]: string;
|
|
10
|
+
};
|
|
11
|
+
/** A list of currently active `NodeView`s, in insertion order. */
|
|
12
|
+
activeNodeViews: Set<CodeBlockView>;
|
|
13
|
+
/** The schema of the outer editor */
|
|
14
|
+
schema: Schema;
|
|
15
|
+
/** Should the codemirror cells show line numbers */
|
|
16
|
+
showLines: boolean;
|
|
17
|
+
/** The lastest versioned linenumbers */
|
|
18
|
+
lines: LineNumber;
|
|
19
|
+
}
|
|
20
|
+
export declare const CODE_PLUGIN_KEY: PluginKey<ICodePluginState>;
|
|
21
|
+
/**
|
|
22
|
+
* Returns a function suitable for passing as a field in `EditorProps.nodeViews`.
|
|
23
|
+
* @see https://prosemirror.net/docs/ref/#view.EditorProps.nodeViews
|
|
24
|
+
*/
|
|
25
|
+
export declare function createCoqCodeView(completions: Array<Completion>, symbols: Array<Completion>): (node: ProseNode, view: EditorView, getPos: () => number | undefined) => CodeBlockView;
|
|
26
|
+
export declare const codePlugin: (completions: Array<WaterproofCompletion>, symbols: Array<WaterproofSymbol>) => ProsePlugin<ICodePluginState>;
|
|
27
|
+
//# 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,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAC5E,OAAO,EAAE,UAAU,EAAqB,MAAM,0BAA0B,CAAC;AAIzE,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,IACnF,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,kCAOpG,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,7 @@
|
|
|
1
|
+
import { HighlightStyle, LRLanguage, LanguageSupport } from "@codemirror/language";
|
|
2
|
+
export declare const highlight_dark: HighlightStyle;
|
|
3
|
+
export declare const highlight_light: HighlightStyle;
|
|
4
|
+
export declare const coqLanguage: LRLanguage;
|
|
5
|
+
export declare function coq(): LanguageSupport;
|
|
6
|
+
export declare function coqSyntaxHighlighting(theme: string): import("@codemirror/state").Extension;
|
|
7
|
+
//# 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;AAkB7B,eAAO,MAAM,cAAc,gBAOzB,CAAA;AAGF,eAAO,MAAM,eAAe,gBAO1B,CAAC;AAGH,eAAO,MAAM,WAAW,YA4BtB,CAAA;AAEF,wBAAgB,GAAG,oBAElB;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,yCAGlD"}
|
|
@@ -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 Comment = 1, ProofandQed = 2, Program = 3, Sentence = 4, WaterproofTactic = 5, TacticBullet = 6, TacticEnd = 7, TacticInput = 8, TacticLabelAs = 10, TacticMiddleDefine = 12, TacticMiddleExpand = 13, TacticMiddleObtain = 14, TacticMiddleByOrSince = 15, TacticMiddleBecauseFirst = 17, TacticMiddleBecauseSecond = 19, TacticMiddleEither = 21, Lemma = 23, LemmaStatement = 24, LemmaEnd = 25, Statement = 26, StatementInput = 27, StatementEnd = 28;
|
|
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,WAAW,IAAI,EACf,OAAO,IAAI,EACX,QAAQ,IAAI,EACZ,gBAAgB,IAAI,EACpB,YAAY,IAAI,EAChB,SAAS,IAAI,EACb,WAAW,IAAI,EACf,aAAa,KAAK,EAClB,kBAAkB,KAAK,EACvB,kBAAkB,KAAK,EACvB,kBAAkB,KAAK,EACvB,qBAAqB,KAAK,EAC1B,wBAAwB,KAAK,EAC7B,yBAAyB,KAAK,EAC9B,kBAAkB,KAAK,EACvB,KAAK,KAAK,EACV,cAAc,KAAK,EACnB,QAAQ,KAAK,EACb,SAAS,KAAK,EACd,cAAc,KAAK,EACnB,YAAY,KAAK,CAAA"}
|
|
@@ -0,0 +1,65 @@
|
|
|
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 { ThemeStyle } from "../api";
|
|
6
|
+
/**
|
|
7
|
+
* Export CodeBlockView class that implements the custom codeblock nodeview.
|
|
8
|
+
* Corresponds with the example as can be found here:
|
|
9
|
+
* https://prosemirror.net/examples/codemirror/
|
|
10
|
+
*/
|
|
11
|
+
export declare class CodeBlockView extends EmbeddedCodeMirrorEditor {
|
|
12
|
+
dom: HTMLElement;
|
|
13
|
+
private _lineNumberCompartment;
|
|
14
|
+
private _lineNumbersExtension;
|
|
15
|
+
private _dynamicCompletions;
|
|
16
|
+
private _readOnlyCompartment;
|
|
17
|
+
private _themeCompartment;
|
|
18
|
+
private _diags;
|
|
19
|
+
private _themeColor;
|
|
20
|
+
private debouncer;
|
|
21
|
+
constructor(node: Node, view: EditorView, getPos: (() => number | undefined), schema: Schema, completions: Array<Completion>, symbols: Array<Completion>);
|
|
22
|
+
private partOfInputArea;
|
|
23
|
+
handleSnippet(template: string, posFrom: number, posTo: number, completion?: Completion | undefined): void;
|
|
24
|
+
private lintingFunction;
|
|
25
|
+
/**
|
|
26
|
+
* set edit permission
|
|
27
|
+
*/
|
|
28
|
+
setEditPermission(): void;
|
|
29
|
+
/**
|
|
30
|
+
* Update the theme of the editor.
|
|
31
|
+
*/
|
|
32
|
+
updateThemeFromVSCode(theme: ThemeStyle): void;
|
|
33
|
+
/**
|
|
34
|
+
* Update the line numbers extension
|
|
35
|
+
*/
|
|
36
|
+
updateLineNumbers(firstLineNo: number, toggleState: boolean): void;
|
|
37
|
+
/**
|
|
38
|
+
* This method needs to be called with the new list to update it.
|
|
39
|
+
*/
|
|
40
|
+
handleNewComplete(newCompletions: Completion[]): void;
|
|
41
|
+
/**
|
|
42
|
+
* (Dynamic) Completion Source.
|
|
43
|
+
* Contains completions for defined theorems/lemmas/etc.
|
|
44
|
+
*/
|
|
45
|
+
dynamicCompletionSource: CompletionSource;
|
|
46
|
+
/**
|
|
47
|
+
* Add a new coq error to this view
|
|
48
|
+
* @param from The from position of the error.
|
|
49
|
+
* @param to The to postion of the error (should be larger than `from`).
|
|
50
|
+
* @param message The message attached to this error.
|
|
51
|
+
* @param severity The severity attached to this error.
|
|
52
|
+
*/
|
|
53
|
+
addCoqError(from: number, to: number, message: string, severity: number): void;
|
|
54
|
+
private showCopyNotification;
|
|
55
|
+
/**
|
|
56
|
+
* Helper function that forces the linter function to run.
|
|
57
|
+
* Should be called after an error has been added or after the errors have been cleared.
|
|
58
|
+
*/
|
|
59
|
+
private forceUpdateLinting;
|
|
60
|
+
/**
|
|
61
|
+
* Clear all coq errors from this view.
|
|
62
|
+
*/
|
|
63
|
+
clearCoqErrors(): void;
|
|
64
|
+
}
|
|
65
|
+
//# 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,EAA6C,MAAM,0BAA0B,CAAC;AAQxJ,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAChD,OAAO,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AAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;IA0E9E,OAAO,CAAC,oBAAoB;IAyB5B;;;OAGG;IACH,OAAO,CAAC,kBAAkB;IAM1B;;OAEG;IACI,cAAc;CAIrB"}
|
|
@@ -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
|