@impermeable/waterproof-editor 0.12.0 → 0.14.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/InputAreaStatus.d.ts +7 -7
- package/dist/api/InputAreaStatus.d.ts.map +1 -1
- package/dist/api/MessageHandlerEditor.d.ts +29 -0
- package/dist/api/MessageHandlerEditor.d.ts.map +1 -0
- package/dist/api/index.d.ts +6 -7
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/types.d.ts +125 -58
- package/dist/api/types.d.ts.map +1 -1
- package/dist/autocomplete/renderSymbol.d.ts +1 -2
- package/dist/autocomplete/renderSymbol.d.ts.map +1 -1
- package/dist/codeview/busy-indicator.d.ts +113 -0
- package/dist/codeview/busy-indicator.d.ts.map +1 -0
- package/dist/codeview/code-plugin.d.ts +6 -5
- package/dist/codeview/code-plugin.d.ts.map +1 -1
- package/dist/codeview/nodeview.d.ts +24 -15
- package/dist/codeview/nodeview.d.ts.map +1 -1
- package/dist/commands/command-helpers.d.ts +7 -22
- package/dist/commands/command-helpers.d.ts.map +1 -1
- package/dist/commands/commands.d.ts +6 -28
- package/dist/commands/commands.d.ts.map +1 -1
- package/dist/commands/index.d.ts +1 -2
- package/dist/commands/index.d.ts.map +1 -1
- package/dist/commands/insert-command.d.ts +7 -33
- package/dist/commands/insert-command.d.ts.map +1 -1
- package/dist/commands/types.d.ts +2 -2
- package/dist/commands/types.d.ts.map +1 -1
- package/dist/commands/utils.d.ts +16 -0
- package/dist/commands/utils.d.ts.map +1 -0
- package/dist/document/blocks/block.d.ts +12 -6
- package/dist/document/blocks/block.d.ts.map +1 -1
- package/dist/document/blocks/blocktypes.d.ts +78 -35
- package/dist/document/blocks/blocktypes.d.ts.map +1 -1
- package/dist/document/blocks/index.d.ts +2 -1
- package/dist/document/blocks/index.d.ts.map +1 -1
- package/dist/document/blocks/schema.d.ts +4 -7
- package/dist/document/blocks/schema.d.ts.map +1 -1
- package/dist/document/blocks/typeguards.d.ts +4 -5
- package/dist/document/blocks/typeguards.d.ts.map +1 -1
- package/dist/document/utils.d.ts +6 -10
- package/dist/document/utils.d.ts.map +1 -1
- package/dist/edit-utils.d.ts +10 -0
- package/dist/edit-utils.d.ts.map +1 -0
- package/dist/editor.d.ts +88 -34
- package/dist/editor.d.ts.map +1 -1
- package/dist/embedded-codemirror/embedded-codemirror-keymap.d.ts.map +1 -1
- package/dist/embedded-codemirror/embeddedCodemirror.d.ts +2 -2
- package/dist/embedded-codemirror/embeddedCodemirror.d.ts.map +1 -1
- package/dist/hinting/hint-plugin.d.ts +1 -2
- package/dist/hinting/hint-plugin.d.ts.map +1 -1
- package/dist/index.css +2 -2
- package/dist/index.d.ts +6 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +62 -81
- package/dist/inputArea.d.ts +2 -3
- package/dist/inputArea.d.ts.map +1 -1
- package/dist/mapping/Tree.d.ts +91 -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 +82 -0
- package/dist/mapping/mapping.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 +16 -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 +23 -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/markup-views/index.d.ts +1 -4
- package/dist/markup-views/index.d.ts.map +1 -1
- package/dist/markup-views/switchable-view/EditableView.d.ts.map +1 -1
- package/dist/markup-views/switchable-view/RenderedView.d.ts +1 -1
- package/dist/markup-views/switchable-view/RenderedView.d.ts.map +1 -1
- package/dist/markup-views/switchable-view/SwitchableView.d.ts +5 -8
- package/dist/markup-views/switchable-view/SwitchableView.d.ts.map +1 -1
- package/dist/menubar/menubar.d.ts +2 -4
- package/dist/menubar/menubar.d.ts.map +1 -1
- package/dist/progressBar.d.ts +31 -11
- package/dist/progressBar.d.ts.map +1 -1
- package/dist/qedStatus.d.ts.map +1 -1
- package/dist/schema/schema.d.ts +4 -3
- package/dist/schema/schema.d.ts.map +1 -1
- package/dist/serialization/DocumentSerializer.d.ts +127 -0
- package/dist/serialization/DocumentSerializer.d.ts.map +1 -0
- package/dist/styles/index.d.ts +3 -5
- package/dist/styles/index.d.ts.map +1 -1
- package/dist/styles/waterproof-defaults.css +2 -0
- package/dist/translation/index.d.ts +1 -1
- package/dist/translation/index.d.ts.map +1 -1
- package/dist/translation/toMarkdownTranslation.d.ts +3 -0
- package/dist/translation/toMarkdownTranslation.d.ts.map +1 -0
- package/impermeable-waterproof-editor-0.14.0.tgz +0 -0
- package/package.json +33 -10
- package/tsconfig.test.json +14 -0
|
@@ -1,38 +1,23 @@
|
|
|
1
1
|
import { NodeType, Node as PNode } from "prosemirror-model";
|
|
2
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
|
-
};
|
|
3
|
+
import { TagConfiguration } from "../api";
|
|
16
4
|
/**
|
|
17
5
|
* Helper function for inserting a new node above the currently selected one.
|
|
18
6
|
* @param state The current editor state.
|
|
19
7
|
* @param tr The current transaction for the state of the editor.
|
|
20
|
-
* @param
|
|
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)
|
|
8
|
+
* @param nodeType The type of node to insert (one of `WaterproofSchema.nodes`)
|
|
23
9
|
* @returns An insertion transaction.
|
|
24
10
|
*/
|
|
25
|
-
export declare function insertAbove(state: EditorState, tr: Transaction,
|
|
11
|
+
export declare function insertAbove(state: EditorState, tr: Transaction, nodeType: NodeType, tagConf: TagConfiguration): Transaction | undefined;
|
|
26
12
|
/**
|
|
27
|
-
* Helper function for inserting a new node
|
|
13
|
+
* Helper function for inserting a new node below the currently selected one.
|
|
28
14
|
* @param state The current editor state.
|
|
29
15
|
* @param tr The current transaction for the state of the editor.
|
|
30
|
-
* @param
|
|
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)
|
|
16
|
+
* @param nodeType The type of node to insert (one of `WaterproofSchema.nodes`)
|
|
33
17
|
* @returns An insertion transaction.
|
|
34
18
|
*/
|
|
35
|
-
export declare function
|
|
19
|
+
export declare function insertBelow(state: EditorState, tr: Transaction, nodeType: NodeType, tagConf: TagConfiguration): Transaction | undefined;
|
|
20
|
+
export declare function nodeFromSel(sel: Selection): PNode | undefined;
|
|
36
21
|
/**
|
|
37
22
|
* Returns the containing node for the current selection.
|
|
38
23
|
* @param sel The user's selection.
|
|
@@ -1 +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
|
|
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,OAAO,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAI1C;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,WAAW,EAAE,EAAE,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,gBAAgB,GAAG,WAAW,GAAG,SAAS,CA4DvI;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,WAAW,EAAE,EAAE,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,gBAAgB,GAAG,WAAW,GAAG,SAAS,CA6DvI;AAED,wBAAgB,WAAW,CAAC,GAAG,EAAE,SAAS,GAAG,KAAK,GAAG,SAAS,CAQ7D;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,SAAS,GAAG,KAAK,GAAG,SAAS,CAQnE;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAO3D;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,SAAS,GAAG,OAAO,CAQtD"}
|
|
@@ -1,30 +1,8 @@
|
|
|
1
|
-
import { Schema } from "prosemirror-model";
|
|
2
1
|
import { Command } from "prosemirror-state";
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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;
|
|
2
|
+
import { TagConfiguration } from "../api";
|
|
3
|
+
export declare function wpLift(_tagConf: TagConfiguration): Command;
|
|
4
|
+
export declare function deleteSelection(tagConf: TagConfiguration): Command;
|
|
5
|
+
export declare function wrapInHint(tagConf: TagConfiguration): Command;
|
|
6
|
+
export declare function wrapInInput(tagConf: TagConfiguration): Command;
|
|
7
|
+
export declare function wrapInContainer(tagConf: TagConfiguration, name: string): Command;
|
|
30
8
|
//# sourceMappingURL=commands.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../src/commands/commands.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../src/commands/commands.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAA0D,MAAM,mBAAmB,CAAC;AAKpG,OAAO,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAE1C,wBAAgB,MAAM,CAAC,QAAQ,EAAE,gBAAgB,GAAG,OAAO,CAoD1D;AA6CD,wBAAgB,eAAe,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAqBlE;AA2CD,wBAAgB,UAAU,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAW7D;AAED,wBAAgB,WAAW,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAS9D;AAED,wBAAgB,eAAe,CAAC,OAAO,EAAE,gBAAgB,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAKhF"}
|
package/dist/commands/index.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export { cmdInsertCode, cmdInsertLatex, cmdInsertMarkdown, liftWrapper } from "./commands";
|
|
1
|
+
export { wpLift, wrapInHint, wrapInInput, wrapInContainer, deleteSelection } from "./commands";
|
|
3
2
|
export { InsertionPlace } from "./types";
|
|
4
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/commands/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/commands/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC/F,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -1,34 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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;
|
|
1
|
+
import { EditorState, Transaction } from "prosemirror-state";
|
|
2
|
+
import { EditorView } from "prosemirror-view";
|
|
3
|
+
import { InsertionPlace } from "./types";
|
|
4
|
+
import { TagConfiguration } from "../api";
|
|
5
|
+
export declare function getCmdInsertMarkdown(place: InsertionPlace, tagConf: TagConfiguration): (state: EditorState, dispatch?: ((tr: Transaction) => void), _view?: EditorView) => boolean;
|
|
6
|
+
export declare function getCmdInsertLatex(place: InsertionPlace, tagConf: TagConfiguration): (state: EditorState, dispatch?: ((tr: Transaction) => void), _view?: EditorView) => boolean;
|
|
7
|
+
export declare function getCmdInsertCode(place: InsertionPlace, tagConf: TagConfiguration): (state: EditorState, dispatch?: ((tr: Transaction) => void), _view?: EditorView) => boolean;
|
|
34
8
|
//# sourceMappingURL=insert-command.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"insert-command.d.ts","sourceRoot":"","sources":["../../src/commands/insert-command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"insert-command.d.ts","sourceRoot":"","sources":["../../src/commands/insert-command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAG9C,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAE1C,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE,gBAAgB,IACzE,OAAO,WAAW,EAAE,WAAW,CAAC,CAAC,EAAE,EAAE,WAAW,KAAK,IAAI,CAAC,EAAE,QAAQ,UAAU,KAAG,OAAO,CAoBnG;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE,gBAAgB,IACtE,OAAO,WAAW,EAAE,WAAW,CAAC,CAAC,EAAE,EAAE,WAAW,KAAK,IAAI,CAAC,EAAE,QAAQ,UAAU,KAAG,OAAO,CAenG;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE,gBAAgB,IACrE,OAAO,WAAW,EAAE,WAAW,CAAC,CAAC,EAAE,EAAE,WAAW,KAAK,IAAI,CAAC,EAAE,QAAQ,UAAU,KAAG,OAAO,CAenG"}
|
package/dist/commands/types.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { NodeType } from "prosemirror-model";
|
|
2
2
|
import { EditorState, Transaction } from "prosemirror-state";
|
|
3
3
|
/**
|
|
4
|
-
* Enum for the insertion place, can be either `Above` or `
|
|
4
|
+
* Enum for the insertion place, can be either `Above` or `Below` the currently selected cell.
|
|
5
5
|
*/
|
|
6
6
|
export declare enum InsertionPlace {
|
|
7
7
|
Above = 0,
|
|
8
|
-
|
|
8
|
+
Below = 1
|
|
9
9
|
}
|
|
10
10
|
/**
|
|
11
11
|
* Insertion function type. This type of function is passed to the `get...Command` functions. The function will insert
|
|
@@ -1 +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,
|
|
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,KAAK,IAAA;CACR;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,16 @@
|
|
|
1
|
+
import { Node, NodeType } from "prosemirror-model";
|
|
2
|
+
import { TagConfiguration } from "../api";
|
|
3
|
+
import { Selection } from "prosemirror-state";
|
|
4
|
+
export declare function getSurroundingNodes(sel: Selection): {
|
|
5
|
+
before: Node | null;
|
|
6
|
+
after: Node | null;
|
|
7
|
+
};
|
|
8
|
+
export declare function getParentAndIndex(sel: Selection): {
|
|
9
|
+
parent: Node;
|
|
10
|
+
index: number;
|
|
11
|
+
} | null;
|
|
12
|
+
export declare function needsNewlineBefore(nodeType: NodeType, tagConf: TagConfiguration): boolean;
|
|
13
|
+
export declare function needsNewlineAfter(nodeType: NodeType, tagConf: TagConfiguration): boolean;
|
|
14
|
+
export declare function openingTagEndsWithNewline(nodeType: NodeType, tagConf: TagConfiguration): boolean;
|
|
15
|
+
export declare function closingTagStartsWithNewline(nodeType: NodeType, tagConf: TagConfiguration): boolean;
|
|
16
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/commands/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAE1C,OAAO,EAAiB,SAAS,EAAiB,MAAM,mBAAmB,CAAC;AAE5E,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,SAAS,GAAG;IAAC,MAAM,EAAE,IAAI,GAAG,IAAI,CAAC;IAAC,KAAK,EAAE,IAAI,GAAG,IAAI,CAAA;CAAC,CAQ7F;AAED,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,SAAS,GAAG;IAAC,MAAM,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAC,GAAG,IAAI,CAWtF;AAYD,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAEzF;AAED,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAExF;AAED,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAKhG;AAED,wBAAgB,2BAA2B,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAElG"}
|
|
@@ -1,23 +1,29 @@
|
|
|
1
1
|
import { Node as ProseNode } from "prosemirror-model";
|
|
2
2
|
export declare enum BLOCK_NAME {
|
|
3
|
-
COQ = "coq",
|
|
4
3
|
MATH_DISPLAY = "math_display",
|
|
5
|
-
INPUT_AREA = "
|
|
4
|
+
INPUT_AREA = "input",
|
|
6
5
|
HINT = "hint",
|
|
7
6
|
MARKDOWN = "markdown",
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
CODE = "code",
|
|
8
|
+
NEWLINE = "newline",
|
|
9
|
+
CONTAINER = "container"
|
|
11
10
|
}
|
|
12
11
|
export interface BlockRange {
|
|
13
12
|
from: number;
|
|
14
13
|
to: number;
|
|
15
14
|
}
|
|
16
15
|
export interface Block {
|
|
17
|
-
type:
|
|
16
|
+
type: BLOCK_NAME;
|
|
18
17
|
stringContent: string;
|
|
18
|
+
/** Range in the original document, including possible tags (like <input-area>) */
|
|
19
19
|
range: BlockRange;
|
|
20
|
+
/** Range in the original document, but only the content within possible tags */
|
|
21
|
+
innerRange: BlockRange;
|
|
22
|
+
/** The linenumber (0 based) at the start of this block */
|
|
23
|
+
lineStart: number;
|
|
24
|
+
/** Blocks that are children of this block, only valid for InputArea, Hint, and Container Blocks. */
|
|
20
25
|
innerBlocks?: Block[];
|
|
26
|
+
/** Convert this block to the corresponding ProseMirror node. */
|
|
21
27
|
toProseMirror(): ProseNode;
|
|
22
28
|
debugPrint(level: number): void;
|
|
23
29
|
}
|
|
@@ -1 +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,
|
|
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,YAAY,iBAAiB;IAC7B,UAAU,UAAU;IACpB,IAAI,SAAS;IACb,QAAQ,aAAa;IACrB,IAAI,SAAS;IACb,OAAO,YAAY;IACnB,SAAS,cAAc;CAC1B;AAED,MAAM,WAAW,UAAU;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;CACd;AAGD,MAAM,WAAW,KAAK;IAClB,IAAI,EAAE,UAAU,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,kFAAkF;IAClF,KAAK,EAAE,UAAU,CAAC;IAClB,gFAAgF;IAChF,UAAU,EAAE,UAAU,CAAC;IACvB,0DAA0D;IAC1D,SAAS,EAAE,MAAM,CAAC;IAElB,oGAAoG;IACpG,WAAW,CAAC,EAAE,KAAK,EAAE,CAAC;IAEtB,gEAAgE;IAChE,aAAa,IAAI,SAAS,CAAC;IAC3B,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACnC"}
|
|
@@ -1,78 +1,121 @@
|
|
|
1
|
+
import { Node } from "prosemirror-model";
|
|
1
2
|
import { BLOCK_NAME, Block, BlockRange } from "./block";
|
|
3
|
+
/**
|
|
4
|
+
* InputAreaBlocks are the parts of the document that should be editable by students.
|
|
5
|
+
* Every input area has an accompanying status to indicate whether the input area is 'correct'.
|
|
6
|
+
*/
|
|
2
7
|
export declare class InputAreaBlock implements Block {
|
|
3
8
|
stringContent: string;
|
|
4
9
|
range: BlockRange;
|
|
10
|
+
innerRange: BlockRange;
|
|
11
|
+
lineStart: number;
|
|
5
12
|
type: BLOCK_NAME;
|
|
6
13
|
innerBlocks: Block[];
|
|
7
|
-
|
|
8
|
-
|
|
14
|
+
/**
|
|
15
|
+
* Construct a new InputAreaBlock.
|
|
16
|
+
* @param stringContent Content of the input area
|
|
17
|
+
* @param range The range (from position to to position in the original document) of the entire input area block, including the its tags.
|
|
18
|
+
* @param innerRange The range (from position to to position in the original document) of the inner content of the input area block, excluding its tags.
|
|
19
|
+
* @param childBlocks Either an array of child blocks of this input area block, or a function that constructs the child blocks given the inner range and content.
|
|
20
|
+
*/
|
|
21
|
+
constructor(stringContent: string, range: BlockRange, innerRange: BlockRange, lineStart: number, childBlocks: Block[] | ((innerContent: string, innerRange: BlockRange, lineStartOffset: number) => Block[]));
|
|
22
|
+
toProseMirror(): Node;
|
|
9
23
|
debugPrint(level: number): void;
|
|
10
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* HintBlocks are foldable blocks that can be used to hide parts of the document by default.
|
|
27
|
+
* Useful for giving hints to students or hiding import/configuration statements from the student.
|
|
28
|
+
*/
|
|
11
29
|
export declare class HintBlock implements Block {
|
|
12
30
|
stringContent: string;
|
|
13
31
|
title: string;
|
|
14
32
|
range: BlockRange;
|
|
33
|
+
innerRange: BlockRange;
|
|
34
|
+
lineStart: number;
|
|
15
35
|
type: BLOCK_NAME;
|
|
16
36
|
innerBlocks: Block[];
|
|
17
|
-
|
|
18
|
-
|
|
37
|
+
/**
|
|
38
|
+
* Construct a new HintBlock.
|
|
39
|
+
* @param stringContent Content of the hint block
|
|
40
|
+
* @param title Title of the hint block (the part that is displayed in the document when folded)
|
|
41
|
+
* @param range The range (from position to to position in the original document) of the entire hint block, including its tags.
|
|
42
|
+
* @param innerRange The range (from position to to position in the original document) of the inner content of the hint block, excluding its tags.
|
|
43
|
+
* @param childBlocks Either an array of child blocks of this hint block, or a function that constructs the child blocks given the inner range and content.
|
|
44
|
+
*/
|
|
45
|
+
constructor(stringContent: string, title: string, range: BlockRange, innerRange: BlockRange, lineStart: number, childBlocks: Block[] | ((innerContent: string, innerRange: BlockRange, lineStartOffset: number) => Block[]));
|
|
46
|
+
toProseMirror(): Node;
|
|
19
47
|
debugPrint(level: number): void;
|
|
20
48
|
}
|
|
49
|
+
/**
|
|
50
|
+
* MathDisplayBlocks display LaTeX in display mode (i.e., centered and on its own line).
|
|
51
|
+
*/
|
|
21
52
|
export declare class MathDisplayBlock implements Block {
|
|
22
53
|
stringContent: string;
|
|
23
54
|
range: BlockRange;
|
|
55
|
+
innerRange: BlockRange;
|
|
56
|
+
lineStart: number;
|
|
24
57
|
type: BLOCK_NAME;
|
|
25
|
-
constructor(stringContent: string, range: BlockRange);
|
|
26
|
-
toProseMirror():
|
|
27
|
-
debugPrint(level: number): void;
|
|
28
|
-
}
|
|
29
|
-
export declare class CoqBlock implements Block {
|
|
30
|
-
stringContent: string;
|
|
31
|
-
prePreWhite: string;
|
|
32
|
-
prePostWhite: string;
|
|
33
|
-
postPreWhite: string;
|
|
34
|
-
postPostWhite: string;
|
|
35
|
-
range: BlockRange;
|
|
36
|
-
type: BLOCK_NAME;
|
|
37
|
-
innerBlocks: Block[];
|
|
38
|
-
constructor(stringContent: string, prePreWhite: string, prePostWhite: string, postPreWhite: string, postPostWhite: string, range: BlockRange, innerBlockConstructor: (content: string) => Block[]);
|
|
39
|
-
toProseMirror(): import("prosemirror-model").Node;
|
|
58
|
+
constructor(stringContent: string, range: BlockRange, innerRange: BlockRange, lineStart: number);
|
|
59
|
+
toProseMirror(): Node;
|
|
40
60
|
debugPrint(level: number): void;
|
|
41
61
|
}
|
|
62
|
+
/**
|
|
63
|
+
* MarkdownBlocks contain markdown content (including inline LaTeX inside single dollars `$`).
|
|
64
|
+
*/
|
|
42
65
|
export declare class MarkdownBlock implements Block {
|
|
43
66
|
stringContent: string;
|
|
44
67
|
range: BlockRange;
|
|
68
|
+
innerRange: BlockRange;
|
|
69
|
+
lineStart: number;
|
|
45
70
|
type: BLOCK_NAME;
|
|
46
71
|
isNewLineOnly: boolean;
|
|
47
|
-
constructor(stringContent: string, range: BlockRange);
|
|
48
|
-
toProseMirror():
|
|
72
|
+
constructor(stringContent: string, range: BlockRange, innerRange: BlockRange, lineStart: number);
|
|
73
|
+
toProseMirror(): Node;
|
|
49
74
|
debugPrint(level: number): void;
|
|
50
75
|
}
|
|
51
|
-
|
|
76
|
+
/**
|
|
77
|
+
* CodeBlocks contain source code.
|
|
78
|
+
*/
|
|
79
|
+
export declare class CodeBlock implements Block {
|
|
52
80
|
stringContent: string;
|
|
53
|
-
preWhite: string;
|
|
54
|
-
postWhite: string;
|
|
55
81
|
range: BlockRange;
|
|
82
|
+
innerRange: BlockRange;
|
|
83
|
+
lineStart: number;
|
|
56
84
|
type: BLOCK_NAME;
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
debugPrint(level?: number): void;
|
|
85
|
+
constructor(stringContent: string, range: BlockRange, innerRange: BlockRange, lineStart: number);
|
|
86
|
+
toProseMirror(): Node;
|
|
87
|
+
debugPrint(level: number): void;
|
|
61
88
|
}
|
|
62
|
-
|
|
63
|
-
|
|
89
|
+
/**
|
|
90
|
+
* NewlineBlock are blocks that take the place of a newline that is significant in the document.
|
|
91
|
+
* That is, the newline should be preserved
|
|
92
|
+
*/
|
|
93
|
+
export declare class NewlineBlock implements Block {
|
|
64
94
|
range: BlockRange;
|
|
95
|
+
innerRange: BlockRange;
|
|
96
|
+
lineStart: number;
|
|
65
97
|
type: BLOCK_NAME;
|
|
66
|
-
constructor(
|
|
67
|
-
|
|
98
|
+
constructor(range: BlockRange, innerRange: BlockRange, lineStart: number);
|
|
99
|
+
stringContent: string;
|
|
100
|
+
toProseMirror(): Node;
|
|
68
101
|
debugPrint(level: number): void;
|
|
69
102
|
}
|
|
70
|
-
|
|
103
|
+
/**
|
|
104
|
+
* ContainerBlocks are generic container blocks that group multiple blocks together.
|
|
105
|
+
* They carry a name to identify the container type.
|
|
106
|
+
* In Lean context, multilean blocks are represented as containers with name "multilean".
|
|
107
|
+
* They can contain both top-level blocks (input, hint) and leaf blocks (math, code, markdown).
|
|
108
|
+
*/
|
|
109
|
+
export declare class ContainerBlock implements Block {
|
|
71
110
|
stringContent: string;
|
|
111
|
+
name: string;
|
|
72
112
|
range: BlockRange;
|
|
113
|
+
innerRange: BlockRange;
|
|
114
|
+
lineStart: number;
|
|
73
115
|
type: BLOCK_NAME;
|
|
74
|
-
|
|
75
|
-
|
|
116
|
+
innerBlocks: Block[];
|
|
117
|
+
constructor(stringContent: string, name: string, range: BlockRange, innerRange: BlockRange, lineStart: number, childBlocks: Block[] | ((innerContent: string, innerRange: BlockRange, lineStartOffset: number) => Block[]));
|
|
118
|
+
toProseMirror(): Node;
|
|
76
119
|
debugPrint(level: number): void;
|
|
77
120
|
}
|
|
78
121
|
//# sourceMappingURL=blocktypes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blocktypes.d.ts","sourceRoot":"","sources":["../../../src/document/blocks/blocktypes.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"blocktypes.d.ts","sourceRoot":"","sources":["../../../src/document/blocks/blocktypes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAEzC,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAMxD;;;GAGG;AACH,qBAAa,cAAe,YAAW,KAAK;IAWpB,aAAa,EAAE,MAAM;IAAS,KAAK,EAAE,UAAU;IAAS,UAAU,EAAE,UAAU;IAAS,SAAS,EAAE,MAAM;IAVrH,IAAI,aAAyB;IAC7B,WAAW,EAAE,KAAK,EAAE,CAAC;IAE5B;;;;;;OAMG;gBACiB,aAAa,EAAE,MAAM,EAAS,KAAK,EAAE,UAAU,EAAS,UAAU,EAAE,UAAU,EAAS,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,KAAK,KAAK,EAAE,CAAC;IASzO,aAAa;IAMb,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;CAKlC;AAED;;;GAGG;AACH,qBAAa,SAAU,YAAW,KAAK;IAYf,aAAa,EAAE,MAAM;IAAS,KAAK,EAAE,MAAM;IAAS,KAAK,EAAE,UAAU;IAAS,UAAU,EAAE,UAAU;IAAS,SAAS,EAAE,MAAM;IAX3I,IAAI,aAAmB;IACvB,WAAW,EAAE,KAAK,EAAE,CAAC;IAE5B;;;;;;;OAOG;gBACiB,aAAa,EAAE,MAAM,EAAS,KAAK,EAAE,MAAM,EAAS,KAAK,EAAE,UAAU,EAAS,UAAU,EAAE,UAAU,EAAS,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,KAAK,KAAK,EAAE,CAAC;IAQ/P,aAAa;IAOb,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;CAKlC;AAED;;GAEG;AACH,qBAAa,gBAAiB,YAAW,KAAK;IAEtB,aAAa,EAAE,MAAM;IAAS,KAAK,EAAE,UAAU;IAAS,UAAU,EAAE,UAAU;IAAS,SAAS,EAAE,MAAM;IADrH,IAAI,aAA2B;gBAClB,aAAa,EAAE,MAAM,EAAS,KAAK,EAAE,UAAU,EAAS,UAAU,EAAE,UAAU,EAAS,SAAS,EAAE,MAAM;IAE5H,aAAa;IASb,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;CAGlC;AAED;;GAEG;AACH,qBAAa,aAAc,YAAW,KAAK;IAInB,aAAa,EAAE,MAAM;IAAS,KAAK,EAAE,UAAU;IAAS,UAAU,EAAE,UAAU;IAAS,SAAS,EAAE,MAAM;IAHrH,IAAI,aAAuB;IAC3B,aAAa,UAAS;gBAET,aAAa,EAAE,MAAM,EAAS,KAAK,EAAE,UAAU,EAAS,UAAU,EAAE,UAAU,EAAS,SAAS,EAAE,MAAM;IAI5H,aAAa;IASb,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;CAGlC;AAED;;GAEG;AACH,qBAAa,SAAU,YAAW,KAAK;IAGf,aAAa,EAAE,MAAM;IAAS,KAAK,EAAE,UAAU;IAAS,UAAU,EAAE,UAAU;IAAS,SAAS,EAAE,MAAM;IAFrH,IAAI,aAAmB;gBAEV,aAAa,EAAE,MAAM,EAAS,KAAK,EAAE,UAAU,EAAS,UAAU,EAAE,UAAU,EAAS,SAAS,EAAE,MAAM;IAE5H,aAAa;IASb,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;CAGlC;AAED;;;GAGG;AACH,qBAAa,YAAa,YAAW,KAAK;IAGjB,KAAK,EAAE,UAAU;IAAS,UAAU,EAAE,UAAU;IAAS,SAAS,EAAE,MAAM;IAFxF,IAAI,aAAsB;gBAEZ,KAAK,EAAE,UAAU,EAAS,UAAU,EAAE,UAAU,EAAS,SAAS,EAAE,MAAM;IAE/F,aAAa,EAAE,MAAM,CAAM;IAE3B,aAAa,IAAK,IAAI;IAKtB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;CAGlC;AAED;;;;;GAKG;AACH,qBAAa,cAAe,YAAW,KAAK;IAK7B,aAAa,EAAE,MAAM;IACrB,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,UAAU;IACjB,UAAU,EAAE,UAAU;IACtB,SAAS,EAAE,MAAM;IARrB,IAAI,aAAwB;IAC5B,WAAW,EAAE,KAAK,EAAE,CAAC;gBAGjB,aAAa,EAAE,MAAM,EACrB,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,UAAU,EACjB,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,MAAM,EACxB,WAAW,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,KAAK,KAAK,EAAE,CAAC;IAS/G,aAAa;IAKb,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;CAKlC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export { BlockRange, Block } from "./block";
|
|
2
|
-
export
|
|
2
|
+
export * from "./blocktypes";
|
|
3
|
+
export * from "./typeguards";
|
|
3
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/document/blocks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAE5C,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/document/blocks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAE5C,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC"}
|
|
@@ -1,21 +1,18 @@
|
|
|
1
1
|
import { Node as ProseNode } from "prosemirror-model";
|
|
2
2
|
/** Construct basic prosemirror text node. */
|
|
3
3
|
export declare const text: (content: string) => ProseNode;
|
|
4
|
-
/** Construct coq markdown prosemirror node. */
|
|
5
|
-
export declare const coqMarkdown: (content: string) => ProseNode;
|
|
6
4
|
/** Construct math display prosemirror node. */
|
|
7
5
|
export declare const mathDisplay: (content: string) => ProseNode;
|
|
8
6
|
/** Construct markdown prosemirror node. */
|
|
9
7
|
export declare const markdown: (content: string) => ProseNode;
|
|
10
8
|
/** Construct coqcode prosemirror node. */
|
|
11
|
-
export declare const
|
|
9
|
+
export declare const code: (content: string) => ProseNode;
|
|
12
10
|
/** Construct input area prosemirror node. */
|
|
13
11
|
export declare const inputArea: (childNodes: ProseNode[]) => ProseNode;
|
|
14
12
|
/** Construct hint prosemirror node. */
|
|
15
13
|
export declare const hint: (title: string, childNodes: ProseNode[]) => ProseNode;
|
|
16
|
-
/** Construct
|
|
17
|
-
export declare const
|
|
18
|
-
|
|
19
|
-
export declare const coqDoc: (childNodes: ProseNode[], preWhite: string, postWhite: string) => ProseNode;
|
|
14
|
+
/** Construct container prosemirror node. */
|
|
15
|
+
export declare const container: (name: string, childNodes: ProseNode[]) => ProseNode;
|
|
16
|
+
export declare const newline: () => ProseNode;
|
|
20
17
|
export declare const root: (childNodes: ProseNode[]) => ProseNode;
|
|
21
18
|
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/document/blocks/schema.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,IAAI,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAItD,6CAA6C;AAC7C,eAAO,MAAM,IAAI,GAAI,SAAS,MAAM,KAAG,SAEtC,CAAA;AAED,+CAA+C;AAC/C,eAAO,MAAM,WAAW,GAAI,SAAS,MAAM,KAAG,SAE7C,CAAA;AAED
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/document/blocks/schema.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,IAAI,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAItD,6CAA6C;AAC7C,eAAO,MAAM,IAAI,GAAI,SAAS,MAAM,KAAG,SAEtC,CAAA;AAED,+CAA+C;AAC/C,eAAO,MAAM,WAAW,GAAI,SAAS,MAAM,KAAG,SAE7C,CAAA;AAED,2CAA2C;AAC3C,eAAO,MAAM,QAAQ,GAAI,SAAS,MAAM,KAAG,SAE1C,CAAA;AAED,0CAA0C;AAC1C,eAAO,MAAM,IAAI,GAAI,SAAS,MAAM,KAAG,SAEtC,CAAA;AAID,6CAA6C;AAC7C,eAAO,MAAM,SAAS,GAAI,YAAY,SAAS,EAAE,KAAG,SAEnD,CAAA;AAED,uCAAuC;AACvC,eAAO,MAAM,IAAI,GAAI,OAAO,MAAM,EAAE,YAAY,SAAS,EAAE,KAAG,SAE7D,CAAA;AAED,4CAA4C;AAC5C,eAAO,MAAM,SAAS,GAAI,MAAM,MAAM,EAAE,YAAY,SAAS,EAAE,KAAG,SAEjE,CAAA;AAGD,eAAO,MAAM,OAAO,iBAEnB,CAAA;AAGD,eAAO,MAAM,IAAI,GAAI,YAAY,SAAS,EAAE,KAAG,SAE9C,CAAA"}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { Block } from "./block";
|
|
2
|
-
import {
|
|
2
|
+
import { CodeBlock, ContainerBlock, HintBlock, InputAreaBlock, MarkdownBlock, MathDisplayBlock, NewlineBlock } from "./blocktypes";
|
|
3
3
|
export declare const isInputAreaBlock: (block: Block) => block is InputAreaBlock;
|
|
4
4
|
export declare const isHintBlock: (block: Block) => block is HintBlock;
|
|
5
5
|
export declare const isMathDisplayBlock: (block: Block) => block is MathDisplayBlock;
|
|
6
|
-
export declare const
|
|
6
|
+
export declare const isCodeBlock: (block: Block) => block is CodeBlock;
|
|
7
7
|
export declare const isMarkdownBlock: (block: Block) => block is MarkdownBlock;
|
|
8
|
-
export declare const
|
|
9
|
-
export declare const
|
|
10
|
-
export declare const isCoqCodeBlock: (block: Block) => block is CoqCodeBlock;
|
|
8
|
+
export declare const isNewlineBlock: (block: Block) => block is NewlineBlock;
|
|
9
|
+
export declare const isContainerBlock: (block: Block) => block is ContainerBlock;
|
|
11
10
|
//# sourceMappingURL=typeguards.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typeguards.d.ts","sourceRoot":"","sources":["../../../src/document/blocks/typeguards.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"typeguards.d.ts","sourceRoot":"","sources":["../../../src/document/blocks/typeguards.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,SAAS,EAAE,cAAc,EAAE,aAAa,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEnI,eAAO,MAAM,gBAAgB,GAAI,OAAO,KAAK,KAAG,KAAK,IAAI,cAAsD,CAAC;AAChH,eAAO,MAAM,WAAW,GAAI,OAAO,KAAK,KAAG,KAAK,IAAI,SAA2C,CAAC;AAChG,eAAO,MAAM,kBAAkB,GAAI,OAAO,KAAK,KAAG,KAAK,IAAI,gBAA0D,CAAC;AACtH,eAAO,MAAM,WAAW,GAAI,OAAO,KAAK,KAAG,KAAK,IAAI,SAA2C,CAAC;AAChG,eAAO,MAAM,eAAe,GAAI,OAAO,KAAK,KAAG,KAAK,IAAI,aAAmD,CAAC;AAC5G,eAAO,MAAM,cAAc,GAAI,OAAO,KAAK,KAAG,KAAK,IAAI,YAAiD,CAAC;AACzG,eAAO,MAAM,gBAAgB,GAAI,OAAO,KAAK,KAAG,KAAK,IAAI,cAAqD,CAAC"}
|
package/dist/document/utils.d.ts
CHANGED
|
@@ -25,15 +25,11 @@ export declare function iteratePairs<ArrayType, FunctionReturnType>(input: Array
|
|
|
25
25
|
* @param inputDocument The document the blocks are part of.
|
|
26
26
|
* @returns The ranges between the blocks.
|
|
27
27
|
*/
|
|
28
|
-
export declare
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
* @param mask The mask to use (defaults to `" "`).
|
|
34
|
-
* @returns The document (`string`) with the ranges covered by the blocks in `blocks` masked using `mask`.
|
|
35
|
-
*/
|
|
36
|
-
export declare function maskInputAndHints(inputDocument: string, blocks: Block[], mask?: string): string;
|
|
28
|
+
export declare const extractInterBlockRanges: (blocks: Array<Block>, inputDocument: string, parentOffset?: number) => {
|
|
29
|
+
from: number;
|
|
30
|
+
to: number;
|
|
31
|
+
}[];
|
|
32
|
+
export declare function maskInputAndHints(inputDocument: string, blocks: Block[]): string;
|
|
37
33
|
/**
|
|
38
34
|
* Create blocks based on ranges.
|
|
39
35
|
*
|
|
@@ -45,5 +41,5 @@ export declare function extractBlocksUsingRanges<BlockType extends Block>(inputD
|
|
|
45
41
|
}[], BlockConstructor: new (content: string, range: {
|
|
46
42
|
from: number;
|
|
47
43
|
to: number;
|
|
48
|
-
}) => BlockType): BlockType[];
|
|
44
|
+
}, innerRange: BlockRange, lineStart: number) => BlockType, parentOffset?: number): BlockType[];
|
|
49
45
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/document/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAE7C;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,KAAK,EAAE,sCAEvD;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,KAAK,EAAE,WAEzC;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,SAAS,EAAE,kBAAkB,EAAE,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,SAAS,KAAK,kBAAkB,wBAEzI;
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/document/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAE7C;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,KAAK,EAAE,sCAEvD;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,KAAK,EAAE,WAEzC;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,SAAS,EAAE,kBAAkB,EAAE,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,SAAS,KAAK,kBAAkB,wBAEzI;AAED;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,GAAI,QAAQ,KAAK,CAAC,KAAK,CAAC,EAAE,eAAe,MAAM,EAAE,eAAc,MAAU,KAAG;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAC,EAczI,CAAA;AAED,wBAAgB,iBAAiB,CAAC,aAAa,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,CAMhF;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,SAAS,SAAS,KAAK,EAC5D,aAAa,EAAE,MAAM,EACrB,MAAM,EAAE;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAC,EAAE,EACpC,gBAAgB,EAAE,KAAK,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,KAAK,SAAS,EACpI,YAAY,GAAE,MAAU,GAAG,SAAS,EAAE,CAYzC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { DocChange, WrappingDocChange } from "./api";
|
|
2
|
+
export declare const enum EditType {
|
|
3
|
+
Insert = 0,
|
|
4
|
+
Replace = 1,
|
|
5
|
+
Delete = 2
|
|
6
|
+
}
|
|
7
|
+
export declare function typeFromDocChange(change: DocChange): EditType;
|
|
8
|
+
export declare function isWrappingDocChange(change: DocChange | WrappingDocChange): change is WrappingDocChange;
|
|
9
|
+
export declare function isDocChange(change: DocChange | WrappingDocChange): change is DocChange;
|
|
10
|
+
//# sourceMappingURL=edit-utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"edit-utils.d.ts","sourceRoot":"","sources":["../src/edit-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAErD,0BAAkB,QAAQ;IACtB,MAAM,IAAA;IAAE,OAAO,IAAA;IAAE,MAAM,IAAA;CAC1B;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,SAAS,GAAG,QAAQ,CAQ7D;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,SAAS,GAAG,iBAAiB,GAAG,MAAM,IAAI,iBAAiB,CAEtG;AAED,wBAAgB,WAAW,CAAC,MAAM,EAAE,SAAS,GAAG,iBAAiB,GAAG,MAAM,IAAI,SAAS,CAEtF"}
|