@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.
Files changed (101) hide show
  1. package/dist/api/InputAreaStatus.d.ts +7 -7
  2. package/dist/api/InputAreaStatus.d.ts.map +1 -1
  3. package/dist/api/MessageHandlerEditor.d.ts +29 -0
  4. package/dist/api/MessageHandlerEditor.d.ts.map +1 -0
  5. package/dist/api/index.d.ts +6 -7
  6. package/dist/api/index.d.ts.map +1 -1
  7. package/dist/api/types.d.ts +125 -58
  8. package/dist/api/types.d.ts.map +1 -1
  9. package/dist/autocomplete/renderSymbol.d.ts +1 -2
  10. package/dist/autocomplete/renderSymbol.d.ts.map +1 -1
  11. package/dist/codeview/busy-indicator.d.ts +113 -0
  12. package/dist/codeview/busy-indicator.d.ts.map +1 -0
  13. package/dist/codeview/code-plugin.d.ts +6 -5
  14. package/dist/codeview/code-plugin.d.ts.map +1 -1
  15. package/dist/codeview/nodeview.d.ts +24 -15
  16. package/dist/codeview/nodeview.d.ts.map +1 -1
  17. package/dist/commands/command-helpers.d.ts +7 -22
  18. package/dist/commands/command-helpers.d.ts.map +1 -1
  19. package/dist/commands/commands.d.ts +6 -28
  20. package/dist/commands/commands.d.ts.map +1 -1
  21. package/dist/commands/index.d.ts +1 -2
  22. package/dist/commands/index.d.ts.map +1 -1
  23. package/dist/commands/insert-command.d.ts +7 -33
  24. package/dist/commands/insert-command.d.ts.map +1 -1
  25. package/dist/commands/types.d.ts +2 -2
  26. package/dist/commands/types.d.ts.map +1 -1
  27. package/dist/commands/utils.d.ts +16 -0
  28. package/dist/commands/utils.d.ts.map +1 -0
  29. package/dist/document/blocks/block.d.ts +12 -6
  30. package/dist/document/blocks/block.d.ts.map +1 -1
  31. package/dist/document/blocks/blocktypes.d.ts +78 -35
  32. package/dist/document/blocks/blocktypes.d.ts.map +1 -1
  33. package/dist/document/blocks/index.d.ts +2 -1
  34. package/dist/document/blocks/index.d.ts.map +1 -1
  35. package/dist/document/blocks/schema.d.ts +4 -7
  36. package/dist/document/blocks/schema.d.ts.map +1 -1
  37. package/dist/document/blocks/typeguards.d.ts +4 -5
  38. package/dist/document/blocks/typeguards.d.ts.map +1 -1
  39. package/dist/document/utils.d.ts +6 -10
  40. package/dist/document/utils.d.ts.map +1 -1
  41. package/dist/edit-utils.d.ts +10 -0
  42. package/dist/edit-utils.d.ts.map +1 -0
  43. package/dist/editor.d.ts +88 -34
  44. package/dist/editor.d.ts.map +1 -1
  45. package/dist/embedded-codemirror/embedded-codemirror-keymap.d.ts.map +1 -1
  46. package/dist/embedded-codemirror/embeddedCodemirror.d.ts +2 -2
  47. package/dist/embedded-codemirror/embeddedCodemirror.d.ts.map +1 -1
  48. package/dist/hinting/hint-plugin.d.ts +1 -2
  49. package/dist/hinting/hint-plugin.d.ts.map +1 -1
  50. package/dist/index.css +2 -2
  51. package/dist/index.d.ts +6 -1
  52. package/dist/index.d.ts.map +1 -1
  53. package/dist/index.js +62 -81
  54. package/dist/inputArea.d.ts +2 -3
  55. package/dist/inputArea.d.ts.map +1 -1
  56. package/dist/mapping/Tree.d.ts +91 -0
  57. package/dist/mapping/Tree.d.ts.map +1 -0
  58. package/dist/mapping/helper-functions.d.ts +4 -0
  59. package/dist/mapping/helper-functions.d.ts.map +1 -0
  60. package/dist/mapping/index.d.ts +4 -0
  61. package/dist/mapping/index.d.ts.map +1 -0
  62. package/dist/mapping/mapping.d.ts +82 -0
  63. package/dist/mapping/mapping.d.ts.map +1 -0
  64. package/dist/mapping/nodeUpdate.d.ts +27 -0
  65. package/dist/mapping/nodeUpdate.d.ts.map +1 -0
  66. package/dist/mapping/textUpdate.d.ts +16 -0
  67. package/dist/mapping/textUpdate.d.ts.map +1 -0
  68. package/dist/mapping/types.d.ts +22 -0
  69. package/dist/mapping/types.d.ts.map +1 -0
  70. package/dist/markdown-defaults/index.d.ts +4 -0
  71. package/dist/markdown-defaults/index.d.ts.map +1 -0
  72. package/dist/markdown-defaults/statemachine.d.ts +23 -0
  73. package/dist/markdown-defaults/statemachine.d.ts.map +1 -0
  74. package/dist/markup-views/SwitchableViewPlugin.d.ts +22 -0
  75. package/dist/markup-views/SwitchableViewPlugin.d.ts.map +1 -0
  76. package/dist/markup-views/index.d.ts +1 -4
  77. package/dist/markup-views/index.d.ts.map +1 -1
  78. package/dist/markup-views/switchable-view/EditableView.d.ts.map +1 -1
  79. package/dist/markup-views/switchable-view/RenderedView.d.ts +1 -1
  80. package/dist/markup-views/switchable-view/RenderedView.d.ts.map +1 -1
  81. package/dist/markup-views/switchable-view/SwitchableView.d.ts +5 -8
  82. package/dist/markup-views/switchable-view/SwitchableView.d.ts.map +1 -1
  83. package/dist/menubar/menubar.d.ts +2 -4
  84. package/dist/menubar/menubar.d.ts.map +1 -1
  85. package/dist/progressBar.d.ts +31 -11
  86. package/dist/progressBar.d.ts.map +1 -1
  87. package/dist/qedStatus.d.ts.map +1 -1
  88. package/dist/schema/schema.d.ts +4 -3
  89. package/dist/schema/schema.d.ts.map +1 -1
  90. package/dist/serialization/DocumentSerializer.d.ts +127 -0
  91. package/dist/serialization/DocumentSerializer.d.ts.map +1 -0
  92. package/dist/styles/index.d.ts +3 -5
  93. package/dist/styles/index.d.ts.map +1 -1
  94. package/dist/styles/waterproof-defaults.css +2 -0
  95. package/dist/translation/index.d.ts +1 -1
  96. package/dist/translation/index.d.ts.map +1 -1
  97. package/dist/translation/toMarkdownTranslation.d.ts +3 -0
  98. package/dist/translation/toMarkdownTranslation.d.ts.map +1 -0
  99. package/impermeable-waterproof-editor-0.14.0.tgz +0 -0
  100. package/package.json +33 -10
  101. package/tsconfig.test.json +14 -0
@@ -1,12 +1,11 @@
1
1
  import { Plugin, PluginKey } from "prosemirror-state";
2
2
  /**
3
3
  * Interface describing the state of the input are plugin.
4
- * Contains fields `locked: boolean` indicating wether non-input areas should be locked (ie. non-teacher mode) and
5
- * `globalLock: boolean` indicating that we are in a global lockdown state (caused by an unrecoverable error).
4
+ * Contains field `teacher: boolean` indicating wether we are in teacher mode
5
+ * (in teacher mode content outside of input areas should be editable)
6
6
  */
7
7
  export interface IInputAreaPluginState {
8
8
  teacher: boolean;
9
- globalLock: boolean;
10
9
  }
11
10
  /** The plugin key for the input area plugin */
12
11
  export declare const INPUT_AREA_PLUGIN_KEY: PluginKey<IInputAreaPluginState>;
@@ -1 +1 @@
1
- {"version":3,"file":"inputArea.d.ts","sourceRoot":"","sources":["../src/inputArea.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,MAAM,EAAE,SAAS,EAA2B,MAClE,mBAAmB,CAAC;AAEpB;;;;GAIG;AACH,MAAM,WAAW,qBAAqB;IACrC,OAAO,EAAE,OAAO,CAAC;IACd,UAAU,EAAE,OAAO,CAAC;CACvB;AAED,+CAA+C;AAC/C,eAAO,MAAM,qBAAqB,kCAA8D,CAAC;AAiFjG,eAAO,MAAM,eAAe,+BAAkC,CAAC"}
1
+ {"version":3,"file":"inputArea.d.ts","sourceRoot":"","sources":["../src/inputArea.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,MAAM,EAAE,SAAS,EAA2B,MAAM,mBAAmB,CAAC;AAG5F;;;;GAIG;AACH,MAAM,WAAW,qBAAqB;IACrC,OAAO,EAAE,OAAO,CAAC;CACjB;AAED,+CAA+C;AAC/C,eAAO,MAAM,qBAAqB,kCAA8D,CAAC;AAwDjG,eAAO,MAAM,eAAe,+BAAkC,CAAC"}
@@ -0,0 +1,91 @@
1
+ export declare class TreeNode {
2
+ /** The type of this node, should be in the WaterproofSchema schema */
3
+ type: string;
4
+ /** The inner range of the node, that is, the range of the content */
5
+ contentRange: {
6
+ to: number;
7
+ from: number;
8
+ };
9
+ /** The outer range of the node, that is, the range of the content including possible tags */
10
+ tagRange: {
11
+ to: number;
12
+ from: number;
13
+ };
14
+ /** The title of a node, only relevant for hint nodes */
15
+ title: string;
16
+ /** The computed start position in ProseMirror, this is the prosemirror position at which the content starts.
17
+ * Thus, for nodes with content this includes a +1 due to stepping in to the node.
18
+ * For newlines, there is no content, so the start points directly before the newline.
19
+ */
20
+ prosemirrorStart: number;
21
+ /** The computed end position in ProseMirror */
22
+ prosemirrorEnd: number;
23
+ pmRange: {
24
+ from: number;
25
+ to: number;
26
+ };
27
+ lineStart: number;
28
+ /** Potential children of this tree node */
29
+ children: TreeNode[];
30
+ constructor(type: string, contentRange: {
31
+ to: number;
32
+ from: number;
33
+ }, tagRange: {
34
+ to: number;
35
+ from: number;
36
+ }, title: string, prosemirrorStart: number, prosemirrorEnd: number, pmRange: {
37
+ to: number;
38
+ from: number;
39
+ }, lineStart: number);
40
+ addChild(child: TreeNode): void;
41
+ removeChild(child: TreeNode): void;
42
+ shiftCloseOffsets(offset: number, offsetProsemirror?: number): void;
43
+ shiftOffsets(offset: number, offsetProsemirror?: number): void;
44
+ shiftLineStart(offset: number): void;
45
+ traverseDepthFirst(callback: (node: TreeNode) => void): void;
46
+ }
47
+ export declare class Tree {
48
+ root: TreeNode;
49
+ constructor(type: string, contentRange: {
50
+ from: number;
51
+ to: number;
52
+ }, range: {
53
+ from: number;
54
+ to: number;
55
+ }, title: string, prosemirrorStart: number, prosemirrorEnd: number, pmRange: {
56
+ from: number;
57
+ to: number;
58
+ }, lineStart: number);
59
+ traverseDepthFirst(callback: (node: TreeNode) => void, node?: TreeNode): void;
60
+ /**
61
+ * Finds the highest (closest to root) node that contains the given prosemirror position
62
+ */
63
+ findHighestContainingNode(pos: number, node?: TreeNode): TreeNode;
64
+ findParent(target: TreeNode, node?: TreeNode | null, parent?: TreeNode | null): TreeNode | null;
65
+ findNodeByOriginalPosition(pos: number, node?: TreeNode | null): TreeNode | null;
66
+ /**
67
+ * Find the most specific node that contains the given ProseMirror position, this function is biased to find the
68
+ * first node (in terms of position) containing the position. I.e. in a tree with a code cell that ends at 28 and a newline that
69
+ * starts at 28, we will return the code cell when searching for position 28.
70
+ *
71
+ * When using this method, be careful of the cases where you can get the first child of some node,
72
+ * since these might need some special casing. We suspect that changing this function to have a
73
+ * right-bias rather than a left-bias shifts the above issue to concern the final child.
74
+ *
75
+ * @param pos ProseMirror position to search for
76
+ * @param node The node to start the search from, defaults to the root node of the tree
77
+ * @returns The most specific node containing the position, or null if no such node exists
78
+ */
79
+ findNodeByProsePos(pos: number, node?: TreeNode): TreeNode | null;
80
+ /**
81
+ * This function returns the nodes fully contained in a range, descendant from a given node, but NOT transitively.
82
+ * i.e. if Node A is fully contained in Node B, and B is within the range, then A does not get returned.
83
+ * @param from Start of the range
84
+ * @param to End of range
85
+ * @param node TreeNode to start from
86
+ * @returns top-level TreeNodes contained in the range.
87
+ */
88
+ nodesInProseRange(from: number, to: number, node?: TreeNode | null): TreeNode[];
89
+ computeLineNumbers(): Array<number>;
90
+ }
91
+ //# sourceMappingURL=Tree.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Tree.d.ts","sourceRoot":"","sources":["../../src/mapping/Tree.ts"],"names":[],"mappings":"AAAA,qBAAa,QAAQ;IACjB,sEAAsE;IACtE,IAAI,EAAE,MAAM,CAAC;IACb,qEAAqE;IACrE,YAAY,EAAE;QAAC,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAC,CAAC;IACzC,6FAA6F;IAC7F,QAAQ,EAAE;QAAC,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAC,CAAC;IACrC,wDAAwD;IACxD,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,gBAAgB,EAAE,MAAM,CAAC;IACzB,+CAA+C;IAC/C,cAAc,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAC,CAAC;IACpC,SAAS,EAAE,MAAM,CAAC;IAClB,2CAA2C;IAC3C,QAAQ,EAAE,QAAQ,EAAE,CAAC;gBAGjB,IAAI,EAAE,MAAM,EACZ,YAAY,EAAE;QAAC,EAAE,EAAE,M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AE,QAAoB,GAAG,IAAI;IAOxF;;OAEG;IACH,yBAAyB,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,GAAE,QAAoB,GAAG,QAAQ;IAa5E,UAAU,CAAC,MAAM,EAAE,QAAQ,EAAE,IAAI,GAAE,QAAQ,GAAG,IAAgB,EAAE,MAAM,GAAE,QAAQ,GAAG,IAAW,GAAG,QAAQ,GAAG,IAAI;IAUhH,0BAA0B,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,GAAE,QAAQ,GAAG,IAAgB,GAAG,QAAQ,GAAG,IAAI;IAY3F;;;;;;;;;;;;OAYG;IACH,kBAAkB,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,GAAE,QAAoB,GAAG,QAAQ,GAAG,IAAI;IAwB5E;;;;;;;OAOG;IACH,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,GAAE,QAAQ,GAAG,IAAgB,GAAG,QAAQ,EAAE;IAY1F,kBAAkB,IAAI,KAAK,CAAC,MAAM,CAAC;CAStC"}
@@ -0,0 +1,4 @@
1
+ import { ReplaceAroundStep, ReplaceStep } from "prosemirror-transform";
2
+ import { OperationType } from "./types";
3
+ export declare function typeFromStep(step: ReplaceStep | ReplaceAroundStep): OperationType;
4
+ //# sourceMappingURL=helper-functions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helper-functions.d.ts","sourceRoot":"","sources":["../../src/mapping/helper-functions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAGxC,wBAAgB,YAAY,CAAC,IAAI,EAAE,WAAW,GAAG,iBAAiB,GAAG,aAAa,CAOjF"}
@@ -0,0 +1,4 @@
1
+ export { Mapping } from "./mapping";
2
+ export { Tree } from "./Tree";
3
+ export { TreeNode } from "./Tree";
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mapping/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC"}
@@ -0,0 +1,82 @@
1
+ import { Tree } from "./Tree";
2
+ import { Block } from "../document";
3
+ import { DocChange, DocumentSerializer, TagConfiguration, WrappingDocChange } from "../api";
4
+ import { Node } from "prosemirror-model";
5
+ import { Step } from "prosemirror-transform";
6
+ /**
7
+ * This class is responsible for keeping track of the mapping between the prosemirror state and the vscode Text
8
+ * Document model
9
+ */
10
+ export declare class Mapping {
11
+ /** This stores the String cells of the entire document */
12
+ private tree;
13
+ /** The version of the underlying textDocument */
14
+ private _version;
15
+ /**
16
+ * Tracks the ProseMirror document after each processed step.
17
+ * The caller of `update` always passes the pre-transaction document, so for
18
+ * step N in a multi-step transaction the passed `doc` is already stale.
19
+ * We keep `_currentDoc` in sync by applying each step to it, so that
20
+ * subsequent calls within the same transaction see the correct document.
21
+ */
22
+ private _currentDoc;
23
+ private readonly serializer;
24
+ private readonly nodeUpdate;
25
+ private readonly textUpdate;
26
+ /**
27
+ * Constructs the mapping instance given the source document in the form of a block array.
28
+ * @param inputBlocks Array containing the blocks that make up this document.
29
+ */
30
+ constructor(inputBlocks: Block[], versionNum: number, tMap: TagConfiguration, serializer: DocumentSerializer);
31
+ /**
32
+ * Returns the mapping to preserve integrity
33
+ */
34
+ getMapping(): Tree;
35
+ /**
36
+ * Get the version of the underlying text document
37
+ */
38
+ get version(): number;
39
+ /**
40
+ * Map a ProseMirror index into the corresponding text offset.
41
+ * @param index A valid ProseMirror offset.
42
+ * @returns The corresponding text offset into the document.
43
+ */
44
+ pmIndexToTextOffset(index: number): number;
45
+ /**
46
+ * Map a text offset into the corresponding ProseMirror index.
47
+ * @param offset The offset (in characters) in the document.
48
+ * @returns The corresponding ProseMirror index into the ProseMirror view.
49
+ */
50
+ textOffsetToPmIndex(offset: number): number;
51
+ computeLineNumbers(): Array<number>;
52
+ updateLines(lineDelta: number, from: number): void;
53
+ /**
54
+ * Resets the internally-evolved document to null so the next transaction
55
+ * starts fresh from the document passed by the caller.
56
+ * Call this at the beginning of each ProseMirror dispatchTransaction.
57
+ */
58
+ resetCurrentDoc(): void;
59
+ update(step: Step, doc: Node): DocChange | WrappingDocChange;
60
+ /**
61
+ * This checks if the doc change actually changed the document, since vscode
62
+ * does not register empty changes
63
+ */
64
+ private checkDocChange;
65
+ /**
66
+ * Initializes the mapping given the input document in the form of a Block array.
67
+ * @param blocks
68
+ */
69
+ private initTree;
70
+ /**
71
+ * Recursively computes the prosemirrorStart and prosemirrorEnd offsets for each node.
72
+ *
73
+ * @param node The current node to compute the offsets for.
74
+ * @param startTagMap The start tag mapping for each block type.
75
+ * @param endTagMap The end tag mapping for each block type.
76
+ * @param currentOffset The current offset from where the computation should begin.
77
+ * @param level The current depth level in the tree (used for adjusting offsets).
78
+ * @returns The updated offset after computing the current node.
79
+ */
80
+ private computeProsemirrorOffsets;
81
+ }
82
+ //# sourceMappingURL=mapping.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mapping.d.ts","sourceRoot":"","sources":["../../src/mapping/mapping.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAY,MAAM,QAAQ,CAAC;AAIxC,OAAO,EAAE,KAAK,EAAc,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAgB,gBAAgB,EAAmB,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AAE3H,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAkC,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAE7E;;;GAGG;AACH,qBAAa,OAAO;IAChB,0DAA0D;IAC1D,OAAO,CAAC,IAAI,CAAO;IACnB,iDAAiD;IACjD,OAAO,CAAC,QAAQ,CAAS;IACzB;;;;;;OAMG;IACH,OAAO,CAAC,WAAW,CAAqB;IAExC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAqB;IAChD,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAa;IACxC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAa;IAExC;;;OAGG;gBACS,WAAW,EAAE,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAgB,EAAE,UAAU,EAAE,kBAAkB;IAoB5G;;OAEG;IACI,UAAU;IAIjB;;OAEG;IACH,IAAW,OAAO,WAEjB;IAED;;;;OAIG;IACI,mBAAmB,CAAC,KAAK,EAAE,MAAM;IAMxC;;;;OAIG;IACI,mBAAmB,CAAC,MAAM,EAAE,MAAM;IAMlC,kBAAkB,IAAI,KAAK,CAAC,MAAM,CAAC;IAInC,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI;IAYzD;;;;OAIG;IACI,eAAe,IAAI,IAAI;IAIvB,MAAM,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,GAAG,SAAS,GAAG,iBAAiB;IA6DnE;;;OAGG;IACH,OAAO,CAAC,cAAc;IAQtB;;;OAGG;IACH,OAAO,CAAC,QAAQ;IAoChB;;;;;;;;;OASG;IACH,OAAO,CAAC,yBAAyB;CAyDpC"}
@@ -0,0 +1,27 @@
1
+ import { Tree, TreeNode } from "./Tree";
2
+ import { ParsedStep } from "./types";
3
+ import { Mapping } from "./mapping";
4
+ import { DocumentSerializer, TagConfiguration } from "../api";
5
+ import { Node } from "prosemirror-model";
6
+ import { ReplaceAroundStep, ReplaceStep } from "prosemirror-transform";
7
+ export declare class NodeUpdate {
8
+ private readonly tagConf;
9
+ private readonly serializer;
10
+ constructor(tagConf: TagConfiguration, serializer: DocumentSerializer);
11
+ nodeNameToTagPair(nodeName: string, title?: string): [string, string];
12
+ nodeUpdate(step: ReplaceStep | ReplaceAroundStep, mapping: Mapping, serializer: DocumentSerializer, proseDoc: Node): ParsedStep;
13
+ doReplaceStep(step: ReplaceStep, mapping: Mapping, serializer: DocumentSerializer, proseDoc: Node): ParsedStep;
14
+ doReplaceAroundStep(step: ReplaceAroundStep, mapping: Mapping): ParsedStep;
15
+ replaceInsert(step: ReplaceStep, tree: Tree, serializer: DocumentSerializer, proseDoc: Node): ParsedStep;
16
+ buildTreeFromNode(node: Node, startOrig: number, startProse: number, currentLine?: number): TreeNode;
17
+ /**
18
+ * Handles ReplaceSteps that delete content.
19
+ * @param step The ReplaceStep for which we determined that it is deletion of one or more nodes.
20
+ * @param tree The input tree
21
+ * @returns A ParsedStep containing the resulting DocChange and the updated tree.
22
+ */
23
+ replaceDelete(step: ReplaceStep, tree: Tree, serializer: DocumentSerializer, proseDoc: Node): ParsedStep;
24
+ replaceAroundDelete(step: ReplaceAroundStep, tree: Tree): ParsedStep;
25
+ replaceAroundReplace(step: ReplaceAroundStep, tree: Tree): ParsedStep;
26
+ }
27
+ //# sourceMappingURL=nodeUpdate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nodeUpdate.d.ts","sourceRoot":"","sources":["../../src/mapping/nodeUpdate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,EAAiB,UAAU,EAAE,MAAM,SAAS,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAa,kBAAkB,EAAmB,gBAAgB,EAAqB,MAAM,QAAQ,CAAC;AAG7G,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAUvE,qBAAa,UAAU;IAEN,OAAO,CAAC,QAAQ,CAAC,OAAO;IAAoB,OAAO,CAAC,QAAQ,CAAC,UAAU;gBAAtD,OAAO,EAAE,gBAAgB,EAAmB,UAAU,EAAE,kBAAkB;IAGxG,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,GAAE,MAAW,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC;IAoBlE,UAAU,CAAC,IAAI,EAAE,WAAW,GAAG,iBAAiB,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,QAAQ,EAAE,IAAI,GAAI,UAAU;IAYvI,aAAa,CAAC,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,QAAQ,EAAE,IAAI,GAAG,UAAU;IAc9G,mBAAmB,CAAC,IAAI,EAAE,iBAAiB,EAAE,OAAO,EAAE,OAAO,GAAG,UAAU;IAkB1E,aAAa,CAAC,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,kBAAkB,EAAE,QAAQ,EAAG,IAAI,GAAG,UAAU;IA8EzG,iBAAiB,CAAC,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,WAAW,GAAE,MAAU,GAAG,QAAQ;IA4EvG;;;;;OAKG;IACH,aAAa,CAAC,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,kBAAkB,EAAE,QAAQ,EAAE,IAAI,GAAG,UAAU;IA0ExG,mBAAmB,CAAC,IAAI,EAAE,iBAAiB,EAAE,IAAI,EAAE,IAAI,GAAG,UAAU;IAyEpE,oBAAoB,CAAC,IAAI,EAAE,iBAAiB,EAAE,IAAI,EAAE,IAAI,GAAG,UAAU;CAmIxE"}
@@ -0,0 +1,16 @@
1
+ import { Mapping } from "./mapping";
2
+ import { ParsedStep } from "./types";
3
+ import { Tree, TreeNode } from "./Tree";
4
+ import { ReplaceStep } from "prosemirror-transform";
5
+ export declare class TextUpdate {
6
+ /**
7
+ * We cache the last node in which a text update happened, as it is likely that the next text update will happen in the same node
8
+ * Note that this is a *reference* to the node in the tree.
9
+ */
10
+ private cachedNode;
11
+ invalidateCache(): void;
12
+ getNodeFromCacheOrSearch(step: ReplaceStep, tree: Tree): TreeNode | null;
13
+ /** This function is responsible for handling updates in prosemirror that happen exclusively as text edits and translating them to vscode text doc */
14
+ textUpdate(step: ReplaceStep, mapping: Mapping): ParsedStep;
15
+ }
16
+ //# sourceMappingURL=textUpdate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"textUpdate.d.ts","sourceRoot":"","sources":["../../src/mapping/textUpdate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,UAAU,EAAiB,MAAM,SAAS,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAExC,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAKpD,qBAAa,UAAU;IACnB;;;OAGG;IACH,OAAO,CAAC,UAAU,CAAyB;IAEpC,eAAe,IAAI,IAAI;IAI9B,wBAAwB,CAAC,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,IAAI,GAAG,QAAQ,GAAG,IAAI;IAmBxE,qJAAqJ;IACrJ,UAAU,CAAC,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,OAAO,GAAI,UAAU;CAqD/D"}
@@ -0,0 +1,22 @@
1
+ import { DocChange, WrappingDocChange } from "../api";
2
+ import { Tree } from "./Tree";
3
+ /**
4
+ * The type returned by the functions converting steps to Document Changes of the
5
+ * underlying vscode model of the document
6
+ */
7
+ export type ParsedStep = {
8
+ /** The document change that will be forwarded to vscode */
9
+ result: DocChange | WrappingDocChange;
10
+ /** The new tree that represents the updated mapping */
11
+ newTree: Tree;
12
+ };
13
+ /**
14
+ * In prosemirror, every step is a replace step. This enum is used to classify
15
+ * the steps into the given 'pure' operations
16
+ */
17
+ export declare enum OperationType {
18
+ insert = "insert",
19
+ delete = "delete",
20
+ replace = "replace"
21
+ }
22
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/mapping/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AACtD,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B;;;GAGG;AACH,MAAM,MAAM,UAAU,GAAG;IACrB,2DAA2D;IAC3D,MAAM,EAAE,SAAS,GAAG,iBAAiB,CAAC;IACtC,uDAAuD;IACvD,OAAO,EAAE,IAAI,CAAC;CACjB,CAAA;AAED;;;GAGG;AACH,oBAAY,aAAa;IACrB,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,OAAO,YAAY;CACtB"}
@@ -0,0 +1,4 @@
1
+ import { TagConfiguration } from "../api";
2
+ export { parse } from "./statemachine";
3
+ export declare function configuration(languageId: string): TagConfiguration;
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/markdown-defaults/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAE1C,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAEvC,wBAAgB,aAAa,CAAC,UAAU,EAAE,MAAM,GAAG,gBAAgB,CAiClE"}
@@ -0,0 +1,23 @@
1
+ import { WaterproofDocument } from "../api";
2
+ /**
3
+ * Parser for markdown documents.
4
+ *
5
+ * Next to the regular markdown and code parts this parser has predefined 'tags' for hints and input areas:
6
+ * * The content between `<hint title="{title}">` and ` </hint>` is turned into a hint cell, `{title}` will turn into the title that is displayed in the editor.
7
+ * * The content between `<input-area>` and `</input-area>` is turned into an input area.
8
+ * @param document The document to convert into a `WaterproofDocument`
9
+ * @param config An object that may contain
10
+ * - `language: string`: The language tag to use for the code cells. That is, the part of the ` ``` ` when opening a code block (` ```python ` for a python
11
+ * code block). Defaults to `""`.
12
+ * - `startParsingFrom: number`: An offset in `document` from where to start parsing the markdown document. Fox example, if you have a header in the
13
+ * markdown file use offset to start the markdown parser after the header content. Defaults to `0`.
14
+ * - `stopParsingAt: number`: Can be used to configure the parser to stop before the end of the file, when the file contains a footer for example.
15
+ * When not specified, parsing will stop only at the end of the file.
16
+ * @returns A array of `Block` that form a `WaterproofDocument`.
17
+ */
18
+ export declare function parse(document: string, config: {
19
+ language?: string;
20
+ startParsingFrom?: number;
21
+ stopParsingAt?: number;
22
+ }): WaterproofDocument;
23
+ //# sourceMappingURL=statemachine.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"statemachine.d.ts","sourceRoot":"","sources":["../../src/markdown-defaults/statemachine.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAC;AAuB5C;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAAC,aAAa,CAAC,EAAE,MAAM,CAAA;CAAC,GAAG,kBAAkB,CAsT1I"}
@@ -0,0 +1,22 @@
1
+ import { Node as ProseNode } from "prosemirror-model";
2
+ import { Plugin as ProsePlugin, PluginKey, TextSelection } from "prosemirror-state";
3
+ import { EditorView } from "prosemirror-view";
4
+ import { SwitchableView } from "./switchable-view";
5
+ import { WaterproofEditorConfig } from "../api";
6
+ export interface ISwitchableViewPluginState {
7
+ macros: {
8
+ [cmd: string]: string;
9
+ };
10
+ /** A list of currently active `NodeView`s, in insertion order. */
11
+ activeNodeViews: SwitchableView[];
12
+ /** The selection of the current cursor position */
13
+ cursor: TextSelection | undefined;
14
+ }
15
+ export declare const SWITCHABLE_VIEW_PLUGIN_KEY: PluginKey<ISwitchableViewPluginState>;
16
+ /**
17
+ * Returns a function suitable for passing as a field in `EditorProps.nodeViews`.
18
+ * @see https://prosemirror.net/docs/ref/#view.EditorProps.nodeViews
19
+ */
20
+ export declare function createRealMarkdownView(editorConfig: WaterproofEditorConfig): (node: ProseNode, view: EditorView, getPos: (() => number | undefined)) => SwitchableView;
21
+ export declare const switchableViewPlugin: (editorConfig: WaterproofEditorConfig) => ProsePlugin<ISwitchableViewPluginState>;
22
+ //# sourceMappingURL=SwitchableViewPlugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SwitchableViewPlugin.d.ts","sourceRoot":"","sources":["../../src/markup-views/SwitchableViewPlugin.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,IAAI,IAAI,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,MAAM,IAAI,WAAW,EAAE,SAAS,EAAc,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAChG,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,sBAAsB,EAAE,MAAM,QAAQ,CAAC;AAKhD,MAAM,WAAW,0BAA0B;IAC1C,MAAM,EAAE;QAAE,CAAC,GAAG,EAAC,MAAM,GAAI,MAAM,CAAA;KAAE,CAAC;IAClC,kEAAkE;IAClE,eAAe,EAAE,cAAc,EAAE,CAAC;IAClC,mDAAmD;IACnD,MAAM,EAAE,aAAa,GAAG,SAAS,CAAC;CAElC;AAED,eAAO,MAAM,0BAA0B,uCAA6E,CAAC;AAErH;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,YAAY,EAAE,sBAAsB,IAClE,MAAM,SAAS,EAAE,MAAM,UAAU,EAAE,QAAQ,CAAC,MAAM,MAAM,GAAG,SAAS,CAAC,KAAG,cAAc,CAa9F;AAmCD,eAAO,MAAM,oBAAoB,GAAI,cAAc,sBAAsB,4CAA0D,CAAC"}
@@ -1,5 +1,2 @@
1
- export { CoqdocView } from "./CoqdocView";
2
- export { coqdocPlugin, COQDOC_PLUGIN_KEY } from "./CoqdocPlugin";
3
- export { MarkdownView } from "./MarkdownView";
4
- export { realMarkdownPlugin, REAL_MARKDOWN_PLUGIN_KEY } from "./MarkdownPlugin";
1
+ export { switchableViewPlugin, SWITCHABLE_VIEW_PLUGIN_KEY } from "./SwitchableViewPlugin";
5
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/markup-views/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAGjE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,OAAO,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/markup-views/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"EditableView.d.ts","sourceRoot":"","sources":["../../../src/markup-views/switchable-view/EditableView.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,UAAU,IAAI,UAAU,EAAE,UAAU,EAEpC,MAAM,kBAAkB,CAAA;AAEzB,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAChD,OAAO,EAAE,SAAS,EAAiB,MAAM,mBAAmB,CAAA;AAC5D,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAIjD,OAAO,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAA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AAK,EAAE,WAAW,EAClB,MAAM,EAAE,cAAc,EACtB,SAAS,EAAE,SAAS;IA8BrB,KAAK;IACF,OAAO;IAGV,aAAa,CAAC,MAAM,EAAE,UAAU,GAAG,IAAI;IAkCvC,MAAM,CAAC,IAAI,EAAE,IAAI,EAAE,YAAY,EAAE,SAAS,UAAU,EAAE;CAgDtD"}
@@ -4,7 +4,7 @@ export declare class RenderedView {
4
4
  view: EditorView;
5
5
  private _outerView;
6
6
  private _parent;
7
- constructor(target: HTMLElement, content: string, outerView: EditorView, parent: SwitchableView, usingCoqdocSyntax: boolean, _getPos: (() => number | undefined));
7
+ constructor(target: HTMLElement, content: string, outerView: EditorView, parent: SwitchableView, _getPos: (() => number | undefined), disableMarkdownFeatures: Array<string>);
8
8
  setSelection(anchor: number, head: number, _root: Document | ShadowRoot): void;
9
9
  update(): boolean;
10
10
  focus(): void;
@@ -1 +1 @@
1
- {"version":3,"file":"RenderedView.d.ts","sourceRoot":"","sources":["../../../src/markup-views/switchable-view/RenderedView.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAK9C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGlD,qBAAa,YAAY;IACd,IAAI,EAAE,UAAU,CAAC;IACxB,OAAO,CAAC,UAAU,CAAa;IAC/B,OAAO,CAAC,OAAO,CAAiB;gBAG5B,MAAM,EAAE,WAAW,EACnB,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,UAAU,EACrB,MAAM,EAAE,cAAc,EACtB,iBAAiB,EAAE,OAAO,EAC1B,OAAO,EAAE,CAAC,MAAM,MAAM,GAAG,SAAS,CAAC;IAiCvC,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,GAAG,UAAU;IAUvE,MAAM;IAIN,KAAK;IACL,OAAO;CACV"}
1
+ {"version":3,"file":"RenderedView.d.ts","sourceRoot":"","sources":["../../../src/markup-views/switchable-view/RenderedView.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAK9C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGlD,qBAAa,YAAY;IACd,IAAI,EAAE,UAAU,CAAC;IACxB,OAAO,CAAC,UAAU,CAAa;IAC/B,OAAO,CAAC,OAAO,CAAiB;gBAG5B,MAAM,EAAE,WAAW,EACnB,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,UAAU,EACrB,MAAM,EAAE,cAAc,EACtB,OAAO,EAAE,CAAC,MAAM,MAAM,GAAG,SAAS,CAAC,EACnC,uBAAuB,EAAE,KAAK,CAAC,MAAM,CAAC;IA6B1C,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,GAAG,UAAU;IAUvE,MAAM;IAIN,KAAK;IACL,OAAO;CACV"}
@@ -1,11 +1,13 @@
1
1
  import { Decoration, EditorView, NodeView } from "prosemirror-view";
2
2
  import { PluginKey } from "prosemirror-state";
3
- import { Node as PNode, Schema } from "prosemirror-model";
3
+ import { Node as PNode } from "prosemirror-model";
4
4
  /**
5
5
  * Abstract class for a switchable view.
6
6
  * Switchable views allow for editing and rendering.
7
7
  */
8
- export declare abstract class SwitchableView implements NodeView {
8
+ export declare class SwitchableView implements NodeView {
9
+ private readonly processForRendering;
10
+ private readonly disableMarkdownFeatures;
9
11
  /** The DOM for this nodeview. */
10
12
  dom: HTMLElement;
11
13
  /** The currently active view. */
@@ -21,16 +23,13 @@ export declare abstract class SwitchableView implements NodeView {
21
23
  /** Represents whether the view is currently updating */
22
24
  private _updating;
23
25
  private _getPos;
24
- private _outerSchema;
25
- private _viewName;
26
26
  private _pluginKey;
27
27
  private _emptyClassName;
28
28
  private _viewClassName;
29
29
  private _editorClassName;
30
30
  private _renderedClassName;
31
- private _usingCoqdocSyntax;
32
31
  get content(): string;
33
- constructor(getPos: (() => number | undefined), outerView: EditorView, content: string, node: PNode, schema: Schema, pluginKey: PluginKey, viewName: string, usingCoqdocSyntax: boolean);
32
+ constructor(getPos: (() => number | undefined), outerView: EditorView, content: string, node: PNode, pluginKey: PluginKey, viewName: string, processForRendering: (input: string) => string, disableMarkdownFeatures: Array<string>);
34
33
  /**
35
34
  * Returns whether this view is currently in the updating state.
36
35
  */
@@ -49,8 +48,6 @@ export declare abstract class SwitchableView implements NodeView {
49
48
  * This destroys the view currently in place and then adds a new editable view.
50
49
  */
51
50
  makeEditableView(): void;
52
- abstract preprocessContentForEditing(input: string): string;
53
- abstract preprocessContentForRendering(input: string): string;
54
51
  update(node: PNode, decorations: readonly Decoration[]): boolean;
55
52
  selectNode(): void;
56
53
  deselectNode(): void;
@@ -1 +1 @@
1
- {"version":3,"file":"SwitchableView.d.ts","sourceRoot":"","sources":["../../../src/markup-views/switchable-view/SwitchableView.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAGpE,OAAO,EAAiB,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAE,IAAI,IAAI,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE1D;;;GAGG;AACH,8BAAsB,cAAe,YAAW,QAAQ;IACpD,iCAAiC;IACjC,GAAG,EAAE,WAAW,CAAC;IACjB,iCAAiC;IACjC,OAAO,CAAC,IAAI,CAA8B;IAC1C,sCAAsC;IACtC,OAAO,CAAC,YAAY,CAAiB;IACrC,yCAAyC;IACzC,OAAO,CAAC,MAAM,CAAc;IAC5B,mCAAmC;IACnC,OAAO,CAAC,UAAU,CAAa;IAC/B,6DAA6D;IAC7D,OAAO,CAAC,KAAK,CAAQ;IAErB,wDAAwD;IACxD,OAAO,CAAC,SAAS,CAAW;IAC5B,OAAO,CAAC,OAAO,CAA6B;IAC5C,OAAO,CAAC,YAAY,CAAC;IAGrB,OAAO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AAS,UAAU,EAAE;IAOtD,UAAU;IAWV,YAAY;IAQZ,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,GAAG,UAAU;IAKtE,SAAS,CAAC,KAAK,EAAE,KAAK;IAQtB,cAAc;IAEd,OAAO;CAGV"}
@@ -1,7 +1,6 @@
1
- import { Schema } from "prosemirror-model";
2
1
  import { Plugin, PluginKey } from "prosemirror-state";
3
2
  import { OS } from "../osType";
4
- import { FileFormat } from "../api/FileFormat";
3
+ import { MenuBarEntry, TagConfiguration } from "../api";
5
4
  /**
6
5
  * Interface describing the state of the menu plugin
7
6
  */
@@ -14,11 +13,10 @@ interface IMenuPluginState {
14
13
  export declare const MENU_PLUGIN_KEY: PluginKey<IMenuPluginState>;
15
14
  /**
16
15
  * Create a new menu plugin given the schema and file format.
17
- * @param schema The schema in use for the editor.
18
16
  * @param filef The file format of the currently opened file.
19
17
  * @returns A prosemirror `Plugin` type containing the menubar.
20
18
  */
21
- export declare function menuPlugin(schema: Schema, filef: FileFormat, os: OS): Plugin<{
19
+ export declare function menuPlugin(os: OS, tagConf: TagConfiguration, customEntries: Array<MenuBarEntry> | undefined): Plugin<{
22
20
  showMenuItems: boolean;
23
21
  }>;
24
22
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"menubar.d.ts","sourceRoot":"","sources":["../../src/menubar/menubar.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAuB,MAAM,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAI3E,OAAO,EAAE,EAAE,EAAE,MAAM,WAAW,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAiM/C;;GAEG;AACH,UAAU,gBAAgB;IACtB,aAAa,EAAE,OAAO,CAAC;CAC1B;AAED;;GAEG;AACH,eAAO,MAAM,eAAe,6BAAyD,CAAC;AAEtF;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,EAAE,EAAE,EAAE;;GAiCnE"}
1
+ {"version":3,"file":"menubar.d.ts","sourceRoot":"","sources":["../../src/menubar/menubar.ts"],"names":[],"mappings":"AACA,OAAO,EAAuB,MAAM,EAAE,SAAS,EAAe,MAAM,mBAAmB,CAAC;AAIxF,OAAO,EAAE,EAAE,EAAE,MAAM,WAAW,CAAC;AAE/B,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAsNxD;;GAEG;AACH,UAAU,gBAAgB;IACtB,aAAa,EAAE,OAAO,CAAC;CAC1B;AAED;;GAEG;AACH,eAAO,MAAM,eAAe,6BAAyD,CAAC;AAEtF;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,KAAK,CAAC,YAAY,CAAC,GAAG,SAAS;;GAiC3G"}
@@ -1,13 +1,33 @@
1
- import { Plugin, PluginKey } from "prosemirror-state";
2
- import { SimpleProgressParams } from "./api";
3
- import { ServerStatus } from "./api";
4
- export interface IProgressPluginState {
5
- progressParams: SimpleProgressParams;
6
- serverStatus: ServerStatus;
7
- resetProgressBar: boolean;
8
- endLine: number;
9
- startLine: number;
1
+ export declare class ProgressBar {
2
+ private readonly containerElem;
3
+ private readonly spinnerContainer;
4
+ private readonly progressBarContainer;
5
+ private readonly progress;
6
+ private readonly textSpan;
7
+ private shown;
8
+ constructor(insertAtTopOfNode: HTMLElement);
9
+ /**
10
+ * Hides the progress bar and spinner by setting
11
+ */
12
+ hide(): void;
13
+ /**
14
+ * Shows the progress bar and spinner
15
+ */
16
+ show(): void;
17
+ /**
18
+ * Updates the progress bar's value and text. If not already shown, it makes the progress bar visible.
19
+ * @param current The current progress value
20
+ * @param ofTotal The total progress value
21
+ * @param text Optional custom text; defaults to "Progress: current / ofTotal"
22
+ */
23
+ reportProgress(current: number, ofTotal: number, text?: string): void;
24
+ /**
25
+ * Starts the spinner
26
+ */
27
+ startSpinner(): void;
28
+ /**
29
+ * Stops the spinner
30
+ */
31
+ stopSpinner(): void;
10
32
  }
11
- export declare const PROGRESS_PLUGIN_KEY: PluginKey<IProgressPluginState>;
12
- export declare const progressBarPlugin: Plugin<IProgressPluginState>;
13
33
  //# sourceMappingURL=progressBar.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"progressBar.d.ts","sourceRoot":"","sources":["../src/progressBar.ts"],"names":[],"mappings":"AACA,OAAO,EAAe,MAAM,EAAE,SAAS,EAA2B,MAAM,mBAAmB,CAAC;AAC5F,OAAO,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAGrC,MAAM,WAAW,oBAAoB;IACnC,cAAc,EAAE,oBAAoB,CAAC;IACrC,YAAY,EAAE,YAAY,CAAC;IAC3B,gBAAgB,EAAE,OAAO,CAAC;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;CACnB;AAGD,eAAO,MAAM,mBAAmB,iCAAiE,CAAC;AAuIlG,eAAO,MAAM,iBAAiB,8BAAoC,CAAC"}
1
+ {"version":3,"file":"progressBar.d.ts","sourceRoot":"","sources":["../src/progressBar.ts"],"names":[],"mappings":"AACA,qBAAa,WAAW;IAYpB,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAiB;IAC/C,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAiB;IAClD,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAAiB;IACtD,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAsB;IAC/C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAkB;IAC3C,OAAO,CAAC,KAAK,CAAkB;gBAEnB,iBAAiB,EAAE,WAAW;IAkC1C;;OAEG;IACI,IAAI;IAMX;;OAEG;IACI,IAAI;IAMX;;;;;OAKG;IACI,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM;IASrE;;OAEG;IACI,YAAY;IAInB;;OAEG;IACI,WAAW;CAGrB"}
@@ -1 +1 @@
1
- {"version":3,"file":"qedStatus.d.ts","sourceRoot":"","sources":["../src/qedStatus.ts"],"names":[],"mappings":"AACA,OAAO,EAAe,MAAM,EAAE,SAAS,EAAc,MAAM,mBAAmB,CAAC;AAG/E,OAAO,EAAE,eAAe,EAAY,MAAM,OAAO,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAG5C,MAAM,WAAW,wBAAwB;IACvC,MAAM,EAAE,eAAe,EAAE,CAAC;CAC3B;AAGD,eAAO,MAAM,wBAAwB,qCAAuE,CAAC;AA8F7G,eAAO,MAAM,kBAAkB,GAAI,QAAQ,gBAAgB,qCAA0D,CAAC"}
1
+ {"version":3,"file":"qedStatus.d.ts","sourceRoot":"","sources":["../src/qedStatus.ts"],"names":[],"mappings":"AACA,OAAO,EAAe,MAAM,EAAE,SAAS,EAAc,MAAM,mBAAmB,CAAC;AAG/E,OAAO,EAAE,eAAe,EAAY,MAAM,OAAO,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAG5C,MAAM,WAAW,wBAAwB;IACvC,MAAM,EAAE,eAAe,EAAE,CAAC;CAC3B;AAGD,eAAO,MAAM,wBAAwB,qCAAuE,CAAC;AAuF7G,eAAO,MAAM,kBAAkB,GAAI,QAAQ,gBAAgB,qCAA0D,CAAC"}
@@ -1,9 +1,12 @@
1
1
  import { Schema } from "prosemirror-model";
2
2
  export declare const SchemaCell: {
3
3
  readonly InputArea: "input";
4
+ readonly Hint: "hint";
4
5
  readonly Markdown: "markdown";
5
6
  readonly MathDisplay: "math_display";
6
7
  readonly Code: "code";
8
+ readonly Newline: "newline";
9
+ readonly Container: "container";
7
10
  };
8
11
  export type SchemaKeys = keyof typeof SchemaCell;
9
12
  export type SchemaNames = typeof SchemaCell[SchemaKeys];
@@ -16,8 +19,6 @@ export type SchemaNames = typeof SchemaCell[SchemaKeys];
16
19
  *
17
20
  * math blocks obtained from `prosemirror-math`:
18
21
  * https://github.com/benrbray/prosemirror-math/blob/master/src/math-schema.ts
19
- *
20
- * see [notes](./notes.md)
21
22
  */
22
- export declare const WaterproofSchema: Schema;
23
+ export declare const WaterproofSchema: Schema<SchemaNames | "doc" | "text", any>;
23
24
  //# sourceMappingURL=schema.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/schema/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE1D,eAAO,MAAM,UAAU;;;;;CAKb,CAAC;AAEX,MAAM,MAAM,UAAU,GAAG,MAAM,OAAO,UAAU,CAAC;AACjD,MAAM,MAAM,WAAW,GAAG,OAAO,UAAU,CAAC,UAAU,CAAC,CAAC;AAMxD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,gBAAgB,EAAE,MA8H7B,CAAC"}
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/schema/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE1D,eAAO,MAAM,UAAU;;;;;;;;CAQb,CAAC;AAEX,MAAM,MAAM,UAAU,GAAG,MAAM,OAAO,UAAU,CAAC;AACjD,MAAM,MAAM,WAAW,GAAG,OAAO,UAAU,CAAC,UAAU,CAAC,CAAC;AAExD;;;;;;;;;GASG;AACH,eAAO,MAAM,gBAAgB,2CAgG3B,CAAC"}