@digabi/exam-engine-core 22.1.6-alpha.1 → 22.1.7-alpha.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (210) hide show
  1. package/dist/__tests__/EditableGradingInsatruction.test.d.ts +1 -0
  2. package/dist/__tests__/EditableGradingInsatruction.test.d.ts.map +1 -0
  3. package/dist/__tests__/EditableGradingInsatruction.test.js +2 -0
  4. package/dist/__tests__/EditableGradingInsatruction.test.js.map +1 -0
  5. package/dist/__tests__/editor/List.test.d.ts +2 -0
  6. package/dist/__tests__/editor/List.test.d.ts.map +1 -0
  7. package/dist/__tests__/editor/List.test.js +54 -0
  8. package/dist/__tests__/editor/List.test.js.map +1 -0
  9. package/dist/__tests__/editor/Table.test.d.ts +2 -0
  10. package/dist/__tests__/editor/Table.test.d.ts.map +1 -0
  11. package/dist/__tests__/editor/Table.test.js +172 -0
  12. package/dist/__tests__/editor/Table.test.js.map +1 -0
  13. package/dist/__tests__/editor/no-wrap.test.d.ts +2 -0
  14. package/dist/__tests__/editor/no-wrap.test.d.ts.map +1 -0
  15. package/dist/__tests__/editor/no-wrap.test.js +43 -0
  16. package/dist/__tests__/editor/no-wrap.test.js.map +1 -0
  17. package/dist/__tests__/tsconfig.tsbuildinfo +1 -1
  18. package/dist/__tests__/utils/EditableGradingInstructionsWrapper.d.ts +1 -0
  19. package/dist/__tests__/utils/EditableGradingInstructionsWrapper.d.ts.map +1 -0
  20. package/dist/__tests__/utils/EditableGradingInstructionsWrapper.js +2 -0
  21. package/dist/__tests__/utils/EditableGradingInstructionsWrapper.js.map +1 -0
  22. package/dist/__tests__/utils/renderEditableGradingInstructions.d.ts +1 -0
  23. package/dist/__tests__/utils/renderEditableGradingInstructions.d.ts.map +1 -0
  24. package/dist/__tests__/utils/renderEditableGradingInstructions.js +2 -0
  25. package/dist/__tests__/utils/renderEditableGradingInstructions.js.map +1 -0
  26. package/dist/components/LexicalEditor.d.ts +3 -0
  27. package/dist/components/LexicalEditor.d.ts.map +1 -0
  28. package/dist/components/LexicalEditor.js +44 -0
  29. package/dist/components/LexicalEditor.js.map +1 -0
  30. package/dist/components/RTE.d.ts +3 -0
  31. package/dist/components/RTE.d.ts.map +1 -0
  32. package/dist/components/RTE.js +23 -0
  33. package/dist/components/RTE.js.map +1 -0
  34. package/dist/components/TablePlugin.d.ts +1 -0
  35. package/dist/components/TablePlugin.d.ts.map +1 -0
  36. package/dist/components/TablePlugin.js +2 -0
  37. package/dist/components/TablePlugin.js.map +1 -0
  38. package/dist/components/ToolBarPlugin.d.ts +10 -0
  39. package/dist/components/ToolBarPlugin.d.ts.map +1 -0
  40. package/dist/components/ToolBarPlugin.js +111 -0
  41. package/dist/components/ToolBarPlugin.js.map +1 -0
  42. package/dist/components/context/AnnotationContext.d.ts +8 -0
  43. package/dist/components/context/AnnotationContext.d.ts.map +1 -0
  44. package/dist/components/context/AnnotationContext.js +3 -0
  45. package/dist/components/context/AnnotationContext.js.map +1 -0
  46. package/dist/components/context/AttachmentContext.d.ts.map +1 -1
  47. package/dist/components/context/ExamContext.d.ts.map +1 -1
  48. package/dist/components/context/QuestionContext.d.ts.map +1 -1
  49. package/dist/components/context/ResultsContext.d.ts.map +1 -1
  50. package/dist/components/context/SectionContext.d.ts.map +1 -1
  51. package/dist/components/exam/ExamineExam.d.ts +5 -0
  52. package/dist/components/exam/ExamineExam.d.ts.map +1 -0
  53. package/dist/components/exam/ExamineExam.js +20 -0
  54. package/dist/components/exam/ExamineExam.js.map +1 -0
  55. package/dist/components/exam/FinishExam.d.ts +5 -0
  56. package/dist/components/exam/FinishExam.d.ts.map +1 -0
  57. package/dist/components/exam/FinishExam.js +17 -0
  58. package/dist/components/exam/FinishExam.js.map +1 -0
  59. package/dist/components/grading/reactAnnotation.d.ts +4 -0
  60. package/dist/components/grading/reactAnnotation.d.ts.map +1 -0
  61. package/dist/components/grading/reactAnnotation.js +54 -0
  62. package/dist/components/grading/reactAnnotation.js.map +1 -0
  63. package/dist/components/grading-instructions/EditableGradingInstruction.d.ts.map +1 -1
  64. package/dist/components/grading-instructions/EditableGradingInstruction.js +19 -9
  65. package/dist/components/grading-instructions/EditableGradingInstruction.js.map +1 -1
  66. package/dist/components/grading-instructions/GradingInstructions.d.ts +1 -1
  67. package/dist/components/grading-instructions/SlateTableEditor.d.ts +22 -0
  68. package/dist/components/grading-instructions/SlateTableEditor.d.ts.map +1 -0
  69. package/dist/components/grading-instructions/SlateTableEditor.js +44 -0
  70. package/dist/components/grading-instructions/SlateTableEditor.js.map +1 -0
  71. package/dist/components/grading-instructions/SlateUtils.d.ts +5 -0
  72. package/dist/components/grading-instructions/SlateUtils.d.ts.map +1 -0
  73. package/dist/components/grading-instructions/SlateUtils.js +28 -0
  74. package/dist/components/grading-instructions/SlateUtils.js.map +1 -0
  75. package/dist/components/grading-instructions/editor/Formula.d.ts +0 -3
  76. package/dist/components/grading-instructions/editor/Formula.d.ts.map +1 -1
  77. package/dist/components/grading-instructions/editor/Formula.js +0 -54
  78. package/dist/components/grading-instructions/editor/Formula.js.map +1 -1
  79. package/dist/components/grading-instructions/editor/List.d.ts +7 -0
  80. package/dist/components/grading-instructions/editor/List.d.ts.map +1 -0
  81. package/dist/components/grading-instructions/editor/List.js +41 -0
  82. package/dist/components/grading-instructions/editor/List.js.map +1 -0
  83. package/dist/components/grading-instructions/editor/MathPopup.d.ts +10 -0
  84. package/dist/components/grading-instructions/editor/MathPopup.d.ts.map +1 -0
  85. package/dist/components/grading-instructions/editor/MathPopup.js +94 -0
  86. package/dist/components/grading-instructions/editor/MathPopup.js.map +1 -0
  87. package/dist/components/grading-instructions/editor/Menu.d.ts +1 -0
  88. package/dist/components/grading-instructions/editor/Menu.d.ts.map +1 -0
  89. package/dist/components/grading-instructions/editor/Menu.js +2 -0
  90. package/dist/components/grading-instructions/editor/Menu.js.map +1 -0
  91. package/dist/components/grading-instructions/editor/Table.d.ts +0 -2
  92. package/dist/components/grading-instructions/editor/Table.d.ts.map +1 -1
  93. package/dist/components/grading-instructions/editor/Table.js +3 -52
  94. package/dist/components/grading-instructions/editor/Table.js.map +1 -1
  95. package/dist/components/grading-instructions/editor/findNode.d.ts +3 -0
  96. package/dist/components/grading-instructions/editor/findNode.d.ts.map +1 -0
  97. package/dist/components/grading-instructions/editor/findNode.js +10 -0
  98. package/dist/components/grading-instructions/editor/findNode.js.map +1 -0
  99. package/dist/components/grading-instructions/editor/keymap.d.ts +2 -0
  100. package/dist/components/grading-instructions/editor/keymap.d.ts.map +1 -0
  101. package/dist/components/grading-instructions/editor/keymap.js +12 -0
  102. package/dist/components/grading-instructions/editor/keymap.js.map +1 -0
  103. package/dist/components/grading-instructions/editor/math-svg.d.ts +2 -0
  104. package/dist/components/grading-instructions/editor/math-svg.d.ts.map +1 -0
  105. package/dist/components/grading-instructions/editor/math-svg.js +22 -0
  106. package/dist/components/grading-instructions/editor/math-svg.js.map +1 -0
  107. package/dist/components/grading-instructions/editor/math.d.ts +4 -0
  108. package/dist/components/grading-instructions/editor/math.d.ts.map +1 -0
  109. package/dist/components/grading-instructions/editor/math.js +55 -0
  110. package/dist/components/grading-instructions/editor/math.js.map +1 -0
  111. package/dist/components/grading-instructions/editor/noWrap.d.ts +3 -0
  112. package/dist/components/grading-instructions/editor/noWrap.d.ts.map +1 -0
  113. package/dist/components/grading-instructions/editor/noWrap.js +13 -0
  114. package/dist/components/grading-instructions/editor/noWrap.js.map +1 -0
  115. package/dist/components/grading-instructions/editor/schemas/formulaSchema.d.ts +4 -0
  116. package/dist/components/grading-instructions/editor/schemas/formulaSchema.d.ts.map +1 -0
  117. package/dist/components/grading-instructions/editor/schemas/formulaSchema.js +55 -0
  118. package/dist/components/grading-instructions/editor/schemas/formulaSchema.js.map +1 -0
  119. package/dist/components/grading-instructions/editor/schemas/imageSchema.d.ts +4 -0
  120. package/dist/components/grading-instructions/editor/schemas/imageSchema.d.ts.map +1 -0
  121. package/dist/components/grading-instructions/editor/schemas/imageSchema.js +47 -0
  122. package/dist/components/grading-instructions/editor/schemas/imageSchema.js.map +1 -0
  123. package/dist/components/grading-instructions/editor/schemas/listSchema.d.ts +72 -0
  124. package/dist/components/grading-instructions/editor/schemas/listSchema.d.ts.map +1 -0
  125. package/dist/components/grading-instructions/editor/schemas/listSchema.js +7 -0
  126. package/dist/components/grading-instructions/editor/schemas/listSchema.js.map +1 -0
  127. package/dist/components/grading-instructions/editor/schemas/spanWithNowrapSchema.d.ts +3 -0
  128. package/dist/components/grading-instructions/editor/schemas/spanWithNowrapSchema.d.ts.map +1 -0
  129. package/dist/components/grading-instructions/editor/schemas/spanWithNowrapSchema.js +19 -0
  130. package/dist/components/grading-instructions/editor/schemas/spanWithNowrapSchema.js.map +1 -0
  131. package/dist/components/grading-instructions/editor/schemas/tableSchema.d.ts +3 -0
  132. package/dist/components/grading-instructions/editor/schemas/tableSchema.d.ts.map +1 -0
  133. package/dist/components/grading-instructions/editor/schemas/tableSchema.js +43 -0
  134. package/dist/components/grading-instructions/editor/schemas/tableSchema.js.map +1 -0
  135. package/dist/components/grading-instructions/editor/spanWithClass.d.ts +3 -0
  136. package/dist/components/grading-instructions/editor/spanWithClass.d.ts.map +1 -0
  137. package/dist/components/grading-instructions/editor/spanWithClass.js +19 -0
  138. package/dist/components/grading-instructions/editor/spanWithClass.js.map +1 -0
  139. package/dist/components/grading-instructions/prosemirror.d.ts +8 -0
  140. package/dist/components/grading-instructions/prosemirror.d.ts.map +1 -0
  141. package/dist/components/grading-instructions/prosemirror.js +108 -0
  142. package/dist/components/grading-instructions/prosemirror.js.map +1 -0
  143. package/dist/components/results/isExamFinishPageHook.d.ts +2 -0
  144. package/dist/components/results/isExamFinishPageHook.d.ts.map +1 -0
  145. package/dist/components/results/isExamFinishPageHook.js +7 -0
  146. package/dist/components/results/isExamFinishPageHook.js.map +1 -0
  147. package/dist/components/shared/CreateAnnotationPopup.d.ts +6 -0
  148. package/dist/components/shared/CreateAnnotationPopup.d.ts.map +1 -0
  149. package/dist/components/shared/CreateAnnotationPopup.js +11 -0
  150. package/dist/components/shared/CreateAnnotationPopup.js.map +1 -0
  151. package/dist/components/shared/PopupUtils.d.ts +4 -0
  152. package/dist/components/shared/PopupUtils.d.ts.map +1 -0
  153. package/dist/components/shared/PopupUtils.js +26 -0
  154. package/dist/components/shared/PopupUtils.js.map +1 -0
  155. package/dist/main-bundle.js +1 -1
  156. package/dist/main-bundle.js.LICENSE.txt +1 -1
  157. package/dist/main.css +1 -1
  158. package/dist/store/listenerMiddleware.d.ts +89 -0
  159. package/dist/store/listenerMiddleware.d.ts.map +1 -0
  160. package/dist/store/listenerMiddleware.js +6 -0
  161. package/dist/store/listenerMiddleware.js.map +1 -0
  162. package/package.json +3 -2
  163. package/dist/components/Localization.d.ts +0 -5
  164. package/dist/components/Localization.d.ts.map +0 -1
  165. package/dist/components/Localization.js +0 -9
  166. package/dist/components/Localization.js.map +0 -1
  167. package/dist/components/grading-instructions/GradingInstruction.d.ts +0 -7
  168. package/dist/components/grading-instructions/GradingInstruction.d.ts.map +0 -1
  169. package/dist/components/grading-instructions/GradingInstruction.js +0 -9
  170. package/dist/components/grading-instructions/GradingInstruction.js.map +0 -1
  171. package/dist/components/grading-instructions/editor/AttributeToggleButton.d.ts +0 -9
  172. package/dist/components/grading-instructions/editor/AttributeToggleButton.d.ts.map +0 -1
  173. package/dist/components/grading-instructions/editor/AttributeToggleButton.js +0 -53
  174. package/dist/components/grading-instructions/editor/AttributeToggleButton.js.map +0 -1
  175. package/dist/components/grading-instructions/editor/CurrentElement.d.ts +0 -2
  176. package/dist/components/grading-instructions/editor/CurrentElement.d.ts.map +0 -1
  177. package/dist/components/grading-instructions/editor/CurrentElement.js +0 -8
  178. package/dist/components/grading-instructions/editor/CurrentElement.js.map +0 -1
  179. package/dist/components/grading-instructions/editor/CurrentLocalization.d.ts +0 -7
  180. package/dist/components/grading-instructions/editor/CurrentLocalization.d.ts.map +0 -1
  181. package/dist/components/grading-instructions/editor/CurrentLocalization.js +0 -13
  182. package/dist/components/grading-instructions/editor/CurrentLocalization.js.map +0 -1
  183. package/dist/components/grading-instructions/editor/LocalizationButtons.d.ts +0 -6
  184. package/dist/components/grading-instructions/editor/LocalizationButtons.d.ts.map +0 -1
  185. package/dist/components/grading-instructions/editor/LocalizationButtons.js +0 -14
  186. package/dist/components/grading-instructions/editor/LocalizationButtons.js.map +0 -1
  187. package/dist/components/grading-instructions/editor/localizatio.d.ts +0 -3
  188. package/dist/components/grading-instructions/editor/localizatio.d.ts.map +0 -1
  189. package/dist/components/grading-instructions/editor/localizatio.js +0 -36
  190. package/dist/components/grading-instructions/editor/localizatio.js.map +0 -1
  191. package/dist/components/grading-instructions/editor/localizationSpan.d.ts +0 -3
  192. package/dist/components/grading-instructions/editor/localizationSpan.d.ts.map +0 -1
  193. package/dist/components/grading-instructions/editor/localizationSpan.js +0 -36
  194. package/dist/components/grading-instructions/editor/localizationSpan.js.map +0 -1
  195. package/dist/components/grading-instructions/editor/spanWithPath.d.ts +0 -3
  196. package/dist/components/grading-instructions/editor/spanWithPath.d.ts.map +0 -1
  197. package/dist/components/grading-instructions/editor/spanWithPath.js +0 -24
  198. package/dist/components/grading-instructions/editor/spanWithPath.js.map +0 -1
  199. package/dist/components/grading-instructions/editor/util.d.ts +0 -6
  200. package/dist/components/grading-instructions/editor/util.d.ts.map +0 -1
  201. package/dist/components/grading-instructions/editor/util.js +0 -10
  202. package/dist/components/grading-instructions/editor/util.js.map +0 -1
  203. /package/dist/__tests__/editor/{nbsp.test.d.ts → NBSP.test.d.ts} +0 -0
  204. /package/dist/__tests__/editor/{nbsp.test.d.ts.map → NBSP.test.d.ts.map} +0 -0
  205. /package/dist/__tests__/editor/{nbsp.test.js → NBSP.test.js} +0 -0
  206. /package/dist/__tests__/editor/{nbsp.test.js.map → NBSP.test.js.map} +0 -0
  207. /package/dist/components/grading-instructions/editor/{Localization.d.ts → localization.d.ts} +0 -0
  208. /package/dist/components/grading-instructions/editor/{Localization.d.ts.map → localization.d.ts.map} +0 -0
  209. /package/dist/components/grading-instructions/editor/{Localization.js → localization.js} +0 -0
  210. /package/dist/components/grading-instructions/editor/{Localization.js.map → localization.js.map} +0 -0
@@ -0,0 +1,22 @@
1
+ import React from 'react';
2
+ import { ReactEditor } from 'slate-react';
3
+ import { BaseEditor } from 'slate';
4
+ import { HistoryEditor } from 'slate-history';
5
+ export type CustomElement = {
6
+ type: 'paragraph' | 'table' | 'table-row' | 'table-cell';
7
+ children: CustomText[];
8
+ };
9
+ type CustomText = {
10
+ text: string;
11
+ bold?: true;
12
+ };
13
+ declare module 'slate' {
14
+ interface CustomTypes {
15
+ Editor: BaseEditor & ReactEditor & HistoryEditor;
16
+ Element: CustomElement;
17
+ Text: CustomText;
18
+ }
19
+ }
20
+ export declare const SlateTableEditor: React.FC;
21
+ export {};
22
+ //# sourceMappingURL=SlateTableEditor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SlateTableEditor.d.ts","sourceRoot":"","sources":["../../../src/components/grading-instructions/SlateTableEditor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyC,MAAM,OAAO,CAAA;AAC7D,OAAO,EAAE,WAAW,EAAkD,MAAM,aAAa,CAAA;AACzF,OAAO,EAAgB,UAAU,EAAc,MAAM,OAAO,CAAA;AAC5D,OAAO,EAAE,aAAa,EAAe,MAAM,eAAe,CAAA;AAK1D,MAAM,MAAM,aAAa,GAAG;IAAE,IAAI,EAAE,WAAW,GAAG,OAAO,GAAG,WAAW,GAAG,YAAY,CAAC;IAAC,QAAQ,EAAE,UAAU,EAAE,CAAA;CAAE,CAAA;AAChH,KAAK,UAAU,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,IAAI,CAAA;CAAE,CAAA;AAE/C,OAAO,QAAQ,OAAO,CAAC;IACrB,UAAU,WAAW;QACnB,MAAM,EAAE,UAAU,GAAG,WAAW,GAAG,aAAa,CAAA;QAChD,OAAO,EAAE,aAAa,CAAA;QACtB,IAAI,EAAE,UAAU,CAAA;KACjB;CACF;AAED,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EA8CpC,CAAA"}
@@ -0,0 +1,44 @@
1
+ import React, { useMemo, useCallback, useState } from 'react';
2
+ import { Slate, Editable, withReact } from 'slate-react';
3
+ import { createEditor } from 'slate';
4
+ import { withHistory } from 'slate-history';
5
+ import { insertTable, isTableActive, removeTable } from './SlateUtils';
6
+ export const SlateTableEditor = () => {
7
+ const editor = useMemo(() => withHistory(withReact(createEditor())), []);
8
+ const [value, setValue] = useState([
9
+ {
10
+ type: 'paragraph',
11
+ children: [{ text: 'This is a Slate editor with table functionalities.' }]
12
+ }
13
+ ]);
14
+ const renderElement = useCallback((props) => {
15
+ switch (props.element.type) {
16
+ case 'table':
17
+ return React.createElement(Table, { ...props });
18
+ case 'table-row':
19
+ return React.createElement(TableRow, { ...props });
20
+ case 'table-cell':
21
+ return React.createElement(TableCell, { ...props });
22
+ default:
23
+ return React.createElement(DefaultElement, { ...props });
24
+ }
25
+ }, []);
26
+ const insertTableCallback = () => insertTable(editor, 3, 3); // Inserts a 3x3 table
27
+ const removeTableCallback = () => removeTable(editor);
28
+ return (React.createElement("div", null,
29
+ "hello",
30
+ React.createElement(Slate, { editor: editor, initialValue: value, onChange: newValue => {
31
+ console.log(newValue);
32
+ setValue(newValue);
33
+ } },
34
+ React.createElement("div", null,
35
+ React.createElement("button", { onClick: insertTableCallback }, "Insert Table"),
36
+ React.createElement("button", { onClick: removeTableCallback, disabled: !isTableActive(editor) }, "Remove Table")),
37
+ React.createElement(Editable, { renderElement: renderElement }))));
38
+ };
39
+ const Table = ({ attributes, children }) => (React.createElement("table", null,
40
+ React.createElement("tbody", { ...attributes }, children)));
41
+ const TableRow = ({ attributes, children }) => React.createElement("tr", { ...attributes }, children);
42
+ const TableCell = ({ attributes, children }) => React.createElement("td", { ...attributes }, children);
43
+ const DefaultElement = ({ attributes, children }) => React.createElement("p", { ...attributes }, children);
44
+ //# sourceMappingURL=SlateTableEditor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SlateTableEditor.js","sourceRoot":"","sources":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AE,CAAC,EAAE,CAAC,CAAC,CAAA,CAAC,sBAAsB;IAClF,MAAM,mBAAmB,GAAG,GAAG,EAAE,CAAC,WAAW,CAAC,MAAM,CAAC,CAAA;IAErD,OAAO,CACL;;QAEE,oBAAC,KAAK,IACJ,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,KAAK,EACnB,QAAQ,EAAE,QAAQ,CAAC,EAAE;gBACnB,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;gBACrB,QAAQ,CAAC,QAAQ,CAAC,CAAA;YACpB,CAAC;YAED;gBACE,gCAAQ,OAAO,EAAE,mBAAmB,mBAAuB;gBAC3D,gCAAQ,OAAO,EAAE,mBAAmB,EAAE,QAAQ,EAAE,CAAC,aAAa,CAAC,MAAM,CAAC,mBAE7D,CACL;YACN,oBAAC,QAAQ,IAAC,aAAa,EAAE,aAAa,GAAI,CACpC,CACJ,CACP,CAAA;AACH,CAAC,CAAA;AAED,MAAM,KAAK,GAAiC,CAAC,EAAE,UAAU,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,CACxE;IACE,kCAAW,UAAU,IAAG,QAAQ,CAAS,CACnC,CACT,CAAA;AAED,MAAM,QAAQ,GAAiC,CAAC,EAAE,UAAU,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,+BAAQ,UAAU,IAAG,QAAQ,CAAM,CAAA;AAEhH,MAAM,SAAS,GAAiC,CAAC,EAAE,UAAU,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,+BAAQ,UAAU,IAAG,QAAQ,CAAM,CAAA;AAEjH,MAAM,cAAc,GAAiC,CAAC,EAAE,UAAU,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,8BAAO,UAAU,IAAG,QAAQ,CAAK,CAAA"}
@@ -0,0 +1,5 @@
1
+ import { Editor } from 'slate';
2
+ export declare const insertTable: (editor: Editor, rows: number, columns: number) => void;
3
+ export declare const isTableActive: (editor: Editor) => boolean;
4
+ export declare const removeTable: (editor: Editor) => void;
5
+ //# sourceMappingURL=SlateUtils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SlateUtils.d.ts","sourceRoot":"","sources":["../../../src/components/grading-instructions/SlateUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,MAAM,EAAE,MAAM,OAAO,CAAA;AAG1C,eAAO,MAAM,WAAW,WAAY,MAAM,QAAQ,MAAM,WAAW,MAAM,SAcxE,CAAA;AAED,eAAO,MAAM,aAAa,WAAY,MAAM,YAQ3C,CAAA;AAED,eAAO,MAAM,WAAW,WAAY,MAAM,SAEzC,CAAA"}
@@ -0,0 +1,28 @@
1
+ import { Transforms, Editor } from 'slate';
2
+ export const insertTable = (editor, rows, columns) => {
3
+ const table = {
4
+ type: 'table',
5
+ children: Array.from({ length: rows }, () => ({
6
+ type: 'table-row',
7
+ children: Array.from({ length: columns }, () => ({
8
+ type: 'table-cell',
9
+ children: [{ text: '' }]
10
+ }))
11
+ }))
12
+ };
13
+ // @ts-expect-error
14
+ Transforms.insertNodes(editor, table);
15
+ };
16
+ export const isTableActive = (editor) => {
17
+ const [match] = Editor.nodes(editor, {
18
+ match: n => {
19
+ console.log(n, typeof n);
20
+ return n.type === 'table';
21
+ }
22
+ });
23
+ return !!match;
24
+ };
25
+ export const removeTable = (editor) => {
26
+ Transforms.removeNodes(editor, { match: n => n.type === 'table' });
27
+ };
28
+ //# sourceMappingURL=SlateUtils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SlateUtils.js","sourceRoot":"","sources":["../../../src/components/grading-instructions/SlateUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AAG1C,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,MAAc,EAAE,IAAY,EAAE,OAAe,EAAE,EAAE;IAC3E,MAAM,KAAK,GAAG;QACZ,IAAI,EAAE,OAAO;QACb,QAAQ,EAAE,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC;YAC5C,IAAI,EAAE,WAAW;YACjB,QAAQ,EAAE,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC;gBAC/C,IAAI,EAAE,YAAY;gBAClB,QAAQ,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC;aACzB,CAAC,CAAC;SACJ,CAAC,CAAC;KACJ,CAAA;IAED,mBAAmB;IACnB,UAAU,CAAC,WAAW,CAAC,MAAM,EAAE,KAAK,CAAC,CAAA;AACvC,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,MAAc,EAAE,EAAE;IAC9C,MAAM,CAAC,KAAK,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,MAAM,EAAE;QACnC,KAAK,EAAE,CAAC,CAAC,EAAE;YACT,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAA;YACxB,OAAQ,CAAmB,CAAC,IAAI,KAAK,OAAO,CAAA;QAC9C,CAAC;KACF,CAAC,CAAA;IACF,OAAO,CAAC,CAAC,KAAK,CAAA;AAChB,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,MAAc,EAAE,EAAE;IAC5C,UAAU,CAAC,WAAW,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,EAAE,CAAE,CAAmB,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC,CAAA;AACvF,CAAC,CAAA"}
@@ -1,13 +1,10 @@
1
1
  import { Plugin } from 'prosemirror-state';
2
- import { NodeSpec } from 'prosemirror-model';
3
2
  import React from 'react';
4
3
  export type FormulaEditorState = {
5
4
  pos: number;
6
5
  latex: string;
7
6
  element: Element;
8
7
  };
9
- export declare const formulaSchema: NodeSpec;
10
- export declare const formulaOutputSchema: NodeSpec;
11
8
  export declare function FormulaButton(props: {
12
9
  disabled: boolean;
13
10
  setFormulaState: (values: FormulaEditorState) => void;
@@ -1 +1 @@
1
- {"version":3,"file":"Formula.d.ts","sourceRoot":"","sources":["../../../../src/components/grading-instructions/editor/Formula.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAA0B,MAAM,mBAAmB,CAAA;AAElE,OAAO,EAAiC,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAE3E,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,MAAM,MAAM,kBAAkB,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,CAAA;AAEjF,eAAO,MAAM,aAAa,EAAE,QAgC3B,CAAA;AAED,eAAO,MAAM,mBAAmB,EAAE,QAoBjC,CAAA;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE;IAAE,QAAQ,EAAE,OAAO,CAAC;IAAC,eAAe,EAAE,CAAC,MAAM,EAAE,kBAAkB,KAAK,IAAI,CAAA;CAAE,qBAoBhH;AAED,qBAAa,aAAc,SAAQ,MAAM;gBAC3B,kBAAkB,EAAE,CAAC,MAAM,EAAE,kBAAkB,KAAK,IAAI;CAmBrE"}
1
+ {"version":3,"file":"Formula.d.ts","sourceRoot":"","sources":["../../../../src/components/grading-instructions/editor/Formula.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAA0B,MAAM,mBAAmB,CAAA;AAIlE,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,MAAM,MAAM,kBAAkB,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,CAAA;AAEjF,wBAAgB,aAAa,CAAC,KAAK,EAAE;IAAE,QAAQ,EAAE,OAAO,CAAC;IAAC,eAAe,EAAE,CAAC,MAAM,EAAE,kBAAkB,KAAK,IAAI,CAAA;CAAE,qBAoBhH;AAED,qBAAa,aAAc,SAAQ,MAAM;gBAC3B,kBAAkB,EAAE,CAAC,MAAM,EAAE,kBAAkB,KAAK,IAAI;CAmBrE"}
@@ -2,60 +2,6 @@ import { Plugin, PluginKey } from 'prosemirror-state';
2
2
  import { Fragment } from 'prosemirror-model';
3
3
  import { useEditorEventCallback } from '@nytimes/react-prosemirror';
4
4
  import React from 'react';
5
- export const formulaSchema = {
6
- formula: {
7
- inline: true,
8
- group: 'inline',
9
- atom: true,
10
- attrs: {
11
- latex: {},
12
- mode: { default: '' },
13
- assistiveTitle: { default: '' }
14
- },
15
- parseDOM: [
16
- {
17
- tag: '[data-editor-id=e-formula]',
18
- getAttrs(dom) {
19
- return {
20
- latex: dom.textContent,
21
- mode: dom.getAttribute('mode'),
22
- assistiveTitle: dom.getAttribute('assistive-title')
23
- };
24
- }
25
- }
26
- ],
27
- toDOM(node) {
28
- const container = document.createElement('img');
29
- if (node.attrs.latex) {
30
- container.setAttribute('alt', node.attrs.latex);
31
- container.setAttribute('formula', 'true');
32
- container.setAttribute('src', `/math.svg?latex=${encodeURIComponent(node.attrs.latex)}`);
33
- }
34
- return container;
35
- }
36
- }
37
- };
38
- export const formulaOutputSchema = {
39
- formula: {
40
- ...formulaSchema.formula,
41
- toDOM(node) {
42
- if (!node.attrs.latex) {
43
- return '';
44
- }
45
- const formulaElement = document.createElement('e:formula');
46
- if (node.attrs.mode) {
47
- formulaElement.setAttribute('mode', node.attrs.mode);
48
- }
49
- if (node.attrs.assistiveTitle) {
50
- formulaElement.setAttribute('assistive-title', node.attrs.assistiveTitle);
51
- }
52
- formulaElement.textContent = node.attrs.latex;
53
- const container = document.createElement('span');
54
- container.appendChild(formulaElement);
55
- return container.firstElementChild;
56
- }
57
- }
58
- };
59
5
  export function FormulaButton(props) {
60
6
  const onClick = useEditorEventCallback(view => {
61
7
  const transaction = view.state.tr;
@@ -1 +1 @@
1
- {"version":3,"file":"Formula.js","sourceRoot":"","sources":["../../../../src/components/grading-instructions/editor/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C;QACH,CAAC;IACH,CAAC,CAAC,CAAA;IAEF,OAAO,CACL,gCAAQ,OAAO,EAAE,OAAO,iBAAc,aAAa,EAAC,QAAQ,EAAE,KAAK,CAAC,QAAQ,4BAEnE,CACV,CAAA;AACH,CAAC;AAED,MAAM,OAAO,aAAc,SAAQ,MAAM;IACvC,YAAY,kBAAwD;QAClE,KAAK,CAAC;YACJ,GAAG,EAAE,IAAI,SAAS,CAAC,SAAS,CAAC;YAC7B,KAAK,EAAE;gBACL,WAAW,CAAC,IAAgB,EAAE,GAAW;oBACvC,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,CAAA;oBACtB,MAAM,IAAI,GAAG,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;oBAClC,IAAI,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;wBACzC,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;wBACjC,IAAI,OAAO,YAAY,OAAO,EAAE,CAAC;4BAC/B,kBAAkB,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAe,EAAE,CAAC,CAAA;4BAChF,OAAO,IAAI,CAAA;wBACb,CAAC;oBACH,CAAC;oBACD,OAAO,KAAK,CAAA;gBACd,CAAC;aACF;SACF,CAAC,CAAA;IACJ,CAAC;CACF"}
@@ -0,0 +1,7 @@
1
+ import { Schema } from 'prosemirror-model';
2
+ import React from 'react';
3
+ export declare function createListPlugin(schema: Schema): import("prosemirror-state").Plugin<any>;
4
+ export declare function ListButton(props: {
5
+ schema: Schema;
6
+ }): React.JSX.Element;
7
+ //# sourceMappingURL=List.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"List.d.ts","sourceRoot":"","sources":["../../../../src/components/grading-instructions/editor/List.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAkB,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAI1D,OAAO,KAA8B,MAAM,OAAO,CAAA;AAKlD,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,2CAM9C;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,qBA8BnD"}
@@ -0,0 +1,41 @@
1
+ import { keymap } from 'prosemirror-keymap';
2
+ import { liftListItem, sinkListItem, splitListItem } from 'prosemirror-schema-list';
3
+ import { Fragment } from 'prosemirror-model';
4
+ import classNames from 'classnames';
5
+ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
6
+ import { faList } from '@fortawesome/free-solid-svg-icons';
7
+ import React, { useEffect, useState } from 'react';
8
+ import { useEditorEventCallback, useEditorState } from '@nytimes/react-prosemirror';
9
+ import { TextSelection } from 'prosemirror-state';
10
+ import { getNodeFromPosition } from './findNode';
11
+ export function createListPlugin(schema) {
12
+ return keymap({
13
+ Enter: splitListItem(schema.nodes.list_item),
14
+ 'Shift-Tab': liftListItem(schema.nodes.list_item),
15
+ Tab: sinkListItem(schema.nodes.list_item)
16
+ });
17
+ }
18
+ export function ListButton(props) {
19
+ const [isActive, setIsActive] = useState(false);
20
+ const editorState = useEditorState();
21
+ useEffect(() => {
22
+ const node = getNodeFromPosition(editorState.selection.$from, props.schema.nodes.bullet_list.name);
23
+ setIsActive(!!node);
24
+ }, [editorState]);
25
+ const onClick = useEditorEventCallback(view => {
26
+ const offset = view.state.selection.anchor + 1;
27
+ const transaction = view.state.tr;
28
+ const cell = view.state.schema.nodes.list_item.createAndFill(null, Fragment.empty);
29
+ const bulletList = view.state.schema.nodes.bullet_list.create({}, Fragment.fromArray([cell]));
30
+ if (view.dispatch) {
31
+ view.dispatch(transaction
32
+ .insert(view.state.selection.to, bulletList)
33
+ .scrollIntoView()
34
+ .setSelection(TextSelection.near(transaction.doc.resolve(offset))));
35
+ view.focus();
36
+ }
37
+ });
38
+ return (React.createElement("button", { onClick: onClick, className: classNames({ active: isActive }), "data-testid": "editor-menu-add-list" },
39
+ React.createElement(FontAwesomeIcon, { size: "lg", icon: faList, className: "editor-menu-icon", fixedWidth: true })));
40
+ }
41
+ //# sourceMappingURL=List.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"List.js","sourceRoot":"","sources":["../../../../src/components/grading-instructions/editor/List.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAC3C,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AACnF,OAAO,EAAE,QAAQ,EAAgB,MAAM,mBAAmB,CAAA;AAC1D,OAAO,UAAU,MAAM,YAAY,CAAA;AACnC,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAA;AAChE,OAAO,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAA;AAC1D,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAClD,OAAO,EAAE,sBAAsB,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AACnF,OAAO,EAAE,aAAa,EAAe,MAAM,mBAAmB,CAAA;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA;AAEhD,MAAM,UAAU,gBAAgB,CAAC,MAAc;IAC7C,OAAO,MAAM,CAAC;QACZ,KAAK,EAAE,aAAa,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC;QAC5C,WAAW,EAAE,YAAY,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC;QACjD,GAAG,EAAE,YAAY,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC;KAC1C,CAAC,CAAA;AACJ,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,KAAyB;IAClD,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAA;IAC/C,MAAM,WAAW,GAAG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,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,iBAAc,sBAAsB;QACvG,oBAAC,eAAe,IAAC,IAAI,EAAC,IAAI,EAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAC,kBAAkB,EAAC,UAAU,SAAG,CAC5E,CACV,CAAA;AACH,CAAC"}
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import { EditorView } from 'prosemirror-view';
3
+ export declare function MathPopup({ latex, update, pos, element, onCancel }: {
4
+ latex: string;
5
+ update: (view: EditorView, pos: number, latex: string) => void;
6
+ pos: number;
7
+ element: Element;
8
+ onCancel: () => void;
9
+ }): React.JSX.Element;
10
+ //# sourceMappingURL=MathPopup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MathPopup.d.ts","sourceRoot":"","sources":["../../../../src/components/grading-instructions/editor/MathPopup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAA;AAGlD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAE7C,wBAAgB,SAAS,CAAC,EACxB,KAAK,EACL,MAAM,EACN,GAAG,EACH,OAAO,EACP,QAAQ,EACT,EAAE;IACD,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,CAAC,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IAC9D,GAAG,EAAE,MAAM,CAAA;IACX,OAAO,EAAE,OAAO,CAAA;IAChB,QAAQ,EAAE,MAAM,IAAI,CAAA;CACrB,qBAkGA"}
@@ -0,0 +1,94 @@
1
+ import React, { useEffect, useState } from 'react';
2
+ import { makeRichText } from 'rich-text-editor';
3
+ import { useEditorEventCallback } from '@nytimes/react-prosemirror';
4
+ export function MathPopup({ latex, update, pos, element, onCancel }) {
5
+ const popupRef = React.createRef();
6
+ const textAreaRef = React.createRef();
7
+ const initialValue = latex.length ? `<img alt="${latex}" src="/math.svg?latex=${latex}">` : '';
8
+ const [comment, setComment] = useState(initialValue);
9
+ const [saveEnabled, setSaveEnabled] = useState(false);
10
+ const [dataError, setDataError] = useState('');
11
+ useEffect(() => {
12
+ if (textAreaRef.current) {
13
+ textAreaRef.current.innerHTML = latex.length ? `<img alt="${latex}" src="/math.svg?latex=${latex}">` : '';
14
+ makeRichText(textAreaRef.current, {
15
+ locale: 'FI',
16
+ screenshotSaver: () => Promise.resolve('')
17
+ }, value => {
18
+ if (value.answerHTML.length && !containsOnlyOneImgTag(value.answerHTML)) {
19
+ setDataError('Vain kaavat sallitaan kaavaneditointinäkymässä');
20
+ }
21
+ else {
22
+ setDataError('');
23
+ }
24
+ setComment(value.answerHTML);
25
+ setSaveEnabled(value.answerHTML.trim().length > 0);
26
+ });
27
+ showAndPositionElement(element, popupRef);
28
+ }
29
+ }, [latex]);
30
+ const closeEditor = () => {
31
+ onCancel();
32
+ closeMathEditor(textAreaRef.current);
33
+ };
34
+ const extractLatex = (value) => {
35
+ const latexPattern = /alt="([^&]+)" src=/;
36
+ const latexMatch = value.match(latexPattern);
37
+ if (!latexMatch || latexMatch.length < 2) {
38
+ return;
39
+ }
40
+ return decodeURIComponent(latexMatch[1]);
41
+ };
42
+ const onShit = useEditorEventCallback((view, dummy) => {
43
+ if (pos) {
44
+ const latex = dummy ? extractLatex(dummy) || '' : '';
45
+ update(view, pos, latex);
46
+ }
47
+ });
48
+ return (React.createElement("div", { className: "annotation-popup", style: { position: 'absolute', opacity: 1 }, ref: popupRef, "data-testid": "annotation-popup" },
49
+ React.createElement("div", { className: "comment-content", "data-testid": "edit-comment", role: "textbox", "aria-multiline": "true", ref: textAreaRef }),
50
+ dataError && React.createElement("span", null, dataError),
51
+ React.createElement("span", { className: "comment-button-area" },
52
+ React.createElement("span", null,
53
+ React.createElement("button", { className: "button", onClick: e => {
54
+ e.stopPropagation();
55
+ closeMathEditor(textAreaRef.current);
56
+ onShit(comment);
57
+ }, "data-testid": "save-comment", disabled: !saveEnabled }, "Tallenna"),
58
+ React.createElement("button", { className: "button text-button", onClick: closeEditor }, "Peru"),
59
+ React.createElement("button", { className: "button text-button", onClick: () => {
60
+ closeMathEditor(textAreaRef.current);
61
+ onShit('');
62
+ } }, "Poista")))));
63
+ }
64
+ function showAndPositionElement(mark, popupRef) {
65
+ const popup = popupRef.current;
66
+ if (mark && popup) {
67
+ const style = popup.style;
68
+ const markRect = mark === null || mark === void 0 ? void 0 : mark.getBoundingClientRect();
69
+ const popupRect = popup.getBoundingClientRect();
70
+ const top = markRect.height + markRect.top + window.scrollY;
71
+ const windowWidth = window.innerWidth;
72
+ style.top = `${String(top)}px`;
73
+ style.opacity = '1';
74
+ const popupHitsWindowRight = markRect.left + popupRect.width > windowWidth;
75
+ if (popupHitsWindowRight) {
76
+ style.left = `${markRect.right - popupRect.width}px`;
77
+ }
78
+ else {
79
+ style.left = `${markRect.left}px`;
80
+ }
81
+ }
82
+ }
83
+ function closeMathEditor(element) {
84
+ // rich-text-editor does not properly support several rich-text-editor instances created at different times.
85
+ // In order to close math editor that is open, we need to dispatch events like this.
86
+ element.dispatchEvent(new Event('focus', { bubbles: true, cancelable: true }));
87
+ element.dispatchEvent(new Event('blur', { bubbles: true, cancelable: true }));
88
+ }
89
+ function containsOnlyOneImgTag(htmlString) {
90
+ const imgTagPattern = /^<img\s+[^>]*>$/g;
91
+ const matches = htmlString.trim().match(imgTagPattern);
92
+ return matches && matches.length === 1;
93
+ }
94
+ //# sourceMappingURL=MathPopup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MathPopup.js","sourceRoot":"","sources":["../../../../src/components/grading-instructions/editor/MathPopup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAC/C,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAA;AAGnE,MAAM,UAAU,SAAS,CAA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,IAAI,GAAG,SAAS,CAAC,KAAK,GAAG,WAAW,CAAA;QAE1E,IAAI,oBAAoB,EAAE,CAAC;YACzB,KAAK,CAAC,IAAI,GAAG,GAAG,QAAQ,CAAC,KAAK,GAAG,SAAS,CAAC,KAAK,IAAI,CAAA;QACtD,CAAC;aAAM,CAAC;YACN,KAAK,CAAC,IAAI,GAAG,GAAG,QAAQ,CAAC,IAAI,IAAI,CAAA;QACnC,CAAC;IACH,CAAC;AACH,CAAC;AAED,SAAS,eAAe,CAAC,OAAuB;IAC9C,4GAA4G;IAC5G,oFAAoF;IACpF,OAAO,CAAC,aAAa,CAAC,IAAI,KAAK,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC,CAAA;IAC9E,OAAO,CAAC,aAAa,CAAC,IAAI,KAAK,CAAC,MAAM,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC,CAAA;AAC/E,CAAC;AAED,SAAS,qBAAqB,CAAC,UAAkB;IAC/C,MAAM,aAAa,GAAG,kBAAkB,CAAA;IACxC,MAAM,OAAO,GAAG,UAAU,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,aAAa,CAAC,CAAA;IACtD,OAAO,OAAO,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,CAAA;AACxC,CAAC"}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=Menu.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Menu.d.ts","sourceRoot":"","sources":["../../../../src/components/grading-instructions/editor/Menu.tsx"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=Menu.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Menu.js","sourceRoot":"","sources":["../../../../src/components/grading-instructions/editor/Menu.tsx"],"names":[],"mappings":""}
@@ -1,6 +1,4 @@
1
- import { NodeSpec } from 'prosemirror-model';
2
1
  import React from 'react';
3
- export declare const tableSchema: NodeSpec;
4
2
  export declare function tablePlugin(): import("prosemirror-state").Plugin<any>;
5
3
  export declare function TableMenu(props: {
6
4
  dropdownsBelow: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"Table.d.ts","sourceRoot":"","sources":["../../../../src/components/grading-instructions/editor/Table.tsx"],"names":[],"mappings":"AASA,OAAO,EAAkB,QAAQ,EAAe,MAAM,mBAAmB,CAAA;AACzE,OAAO,KAA8B,MAAM,OAAO,CAAA;AAelD,eAAO,MAAM,WAAW,EAAE,QAmCzB,CAAA;AAED,wBAAgB,WAAW,4CAK1B;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE;IAAE,cAAc,EAAE,OAAO,CAAA;CAAE,qBA0L3D"}
1
+ {"version":3,"file":"Table.d.ts","sourceRoot":"","sources":["../../../../src/components/grading-instructions/editor/Table.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA8B,MAAM,OAAO,CAAA;AAUlD,wBAAgB,WAAW,4CAK1B;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE;IAAE,cAAc,EAAE,OAAO,CAAA;CAAE,qBAgL3D"}
@@ -1,4 +1,4 @@
1
- import { addColumnAfter, addRowAfter, deleteColumn, deleteRow, deleteTable, goToNextCell, tableNodes } from 'prosemirror-tables';
1
+ import { addColumnAfter, addRowAfter, deleteColumn, deleteRow, deleteTable, goToNextCell } from 'prosemirror-tables';
2
2
  import { Fragment } from 'prosemirror-model';
3
3
  import React, { useEffect, useState } from 'react';
4
4
  import { useEditorEventCallback, useEditorState } from '@nytimes/react-prosemirror';
@@ -7,47 +7,7 @@ import { faTable, faAngleUp, faAngleDown } from '@fortawesome/free-solid-svg-ico
7
7
  import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
8
8
  import classNames from 'classnames';
9
9
  import { keymap } from 'prosemirror-keymap';
10
- const defaultSchema = tableNodes({
11
- tableGroup: 'block',
12
- cellContent: 'inline*',
13
- cellAttributes: { class: { default: '' } }
14
- });
15
- export const tableSchema = {
16
- ...defaultSchema,
17
- table: {
18
- ...defaultSchema.table,
19
- parseDOM: [
20
- {
21
- tag: 'table',
22
- getAttrs: (dom) => ({ class: dom.getAttribute('class') })
23
- }
24
- ],
25
- attrs: { class: { default: '' } },
26
- toDOM(node) {
27
- const classNames = node.attrs.class || undefined;
28
- return [
29
- 'table',
30
- {
31
- class: classNames
32
- },
33
- ['tbody', 0]
34
- ];
35
- }
36
- },
37
- table_cell: {
38
- ...defaultSchema.table_cell,
39
- parseDOM: [
40
- {
41
- tag: 'td',
42
- getAttrs: (dom) => ({ class: dom.getAttribute('class') })
43
- }
44
- ],
45
- toDOM(node) {
46
- const classNames = node.attrs.class || undefined;
47
- return ['td', { class: classNames }, 0];
48
- }
49
- }
50
- };
10
+ import { getNodeFromPosition } from './findNode';
51
11
  export function tablePlugin() {
52
12
  return keymap({
53
13
  Tab: goToNextCell(1),
@@ -59,17 +19,8 @@ export function TableMenu(props) {
59
19
  const [isOpen, setIsOpen] = useState({ add: false, remove: false, styles: false });
60
20
  const [classes, setClasses] = useState([]);
61
21
  const editorState = useEditorState();
62
- const getTableFromPosition = (pos) => {
63
- for (let d = pos.depth; d > 0; d--) {
64
- const node = pos.node(d);
65
- if (node.type.name === 'table') {
66
- return node;
67
- }
68
- }
69
- return null;
70
- };
71
22
  useEffect(() => {
72
- const table = getTableFromPosition(editorState.selection.$from);
23
+ const table = getNodeFromPosition(editorState.selection.$from, 'table');
73
24
  setIsActive(!!table);
74
25
  if (table) {
75
26
  setIsOpen({ add: false, remove: false, styles: false });
@@ -1 +1 @@
1
- {"version":3,"file":"Table.js","sourceRoot":"","sources":["../../../../src/components/grading-instructions/editor/Table.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,WAAW,EACX,YAAY,EACZ,SAAS,EACT,WAAW,EACX,YAAY,EACZ,UAAU,EACX,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAAE,QAAQ,EAA+B,MAAM,m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AC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAA;AAC/G,CAAC;AAED,SAAS,aAAa,CACpB,IAAgB,EAChB,SAAiB,EACjB,cAA8D;IAE9D,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,KAAK,CAAA;IACvC,KAAK,IAAI,KAAK,GAAG,IAAI,CAAC,KAAK,EAAE,KAAK,GAAG,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC;QAChD,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;QAC7B,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,IAAI,OAAO,EAAE,CAAC;YACxC,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;gBAClB,IAAI,CAAC,QAAQ,CACX,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE;oBACpD,GAAG,IAAI,CAAC,KAAK;oBACb,GAAG,EAAE,KAAK,EAAE,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,KAAe,EAAE,SAAS,CAAC,EAAE;iBACpE,CAAC,CACH,CAAA;YACH,CAAC;YACD,IAAI,CAAC,KAAK,EAAE,CAAA;YACZ,OAAO,IAAI,CAAA;QACb,CAAC;IACH,CAAC;AACH,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { ResolvedPos } from 'prosemirror-model';
2
+ export declare function getNodeFromPosition(pos: ResolvedPos, type: string): import("prosemirror-model").Node | null;
3
+ //# sourceMappingURL=findNode.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"findNode.d.ts","sourceRoot":"","sources":["../../../../src/components/grading-instructions/editor/findNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAE/C,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,2CAQjE"}
@@ -0,0 +1,10 @@
1
+ export function getNodeFromPosition(pos, type) {
2
+ for (let d = pos.depth; d > 0; d--) {
3
+ const node = pos.node(d);
4
+ if (node.type.name === type) {
5
+ return node;
6
+ }
7
+ }
8
+ return null;
9
+ }
10
+ //# sourceMappingURL=findNode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"findNode.js","sourceRoot":"","sources":["../../../../src/components/grading-instructions/editor/findNode.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,mBAAmB,CAAC,GAAgB,EAAE,IAAY;IAChE,KAAK,IAAI,CAAC,GAAG,GAAG,CAAC,KAAK,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;QACnC,MAAM,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;QACxB,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,KAAK,IAAI,EAAE,CAAC;YAC5B,OAAO,IAAI,CAAA;QACb,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAA;AACb,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function createKeyMap(): import("prosemirror-state").Plugin<any>;
2
+ //# sourceMappingURL=keymap.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"keymap.d.ts","sourceRoot":"","sources":["../../../../src/components/grading-instructions/editor/keymap.ts"],"names":[],"mappings":"AAIA,wBAAgB,YAAY,4CAO3B"}
@@ -0,0 +1,12 @@
1
+ import { keymap } from 'prosemirror-keymap';
2
+ import { baseKeymap } from 'prosemirror-commands';
3
+ import { goToNextCell } from 'prosemirror-tables';
4
+ export function createKeyMap() {
5
+ return keymap({
6
+ ...baseKeymap,
7
+ Tab: goToNextCell(1),
8
+ 'Shift-Tab': goToNextCell(-1)
9
+ //Enter: splitListItem(schema.nodes.list_item)
10
+ });
11
+ }
12
+ //# sourceMappingURL=keymap.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"keymap.js","sourceRoot":"","sources":["../../../../src/components/grading-instructions/editor/keymap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAEjD,MAAM,UAAU,YAAY;IAC1B,OAAO,MAAM,CAAC;QACZ,GAAG,UAAU;QACb,GAAG,EAAE,YAAY,CAAC,CAAC,CAAC;QACpB,WAAW,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC;QAC7B,8CAA8C;KAC/C,CAAC,CAAA;AACJ,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function getMathSvg(math: string): string;
2
+ //# sourceMappingURL=math-svg.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"math-svg.d.ts","sourceRoot":"","sources":["../../../../src/components/grading-instructions/editor/math-svg.ts"],"names":[],"mappings":"AAsBA,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAG/C"}