@digabi/exam-engine-core 22.0.3 → 22.0.4-alpha.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (240) hide show
  1. package/dist/__tests__/EditableGradingInstruction.test.d.ts +2 -0
  2. package/dist/__tests__/EditableGradingInstruction.test.d.ts.map +1 -0
  3. package/dist/__tests__/EditableGradingInstruction.test.js +174 -0
  4. package/dist/__tests__/EditableGradingInstruction.test.js.map +1 -0
  5. package/dist/__tests__/EditableGradingInstructionLocalization.test.d.ts +2 -0
  6. package/dist/__tests__/EditableGradingInstructionLocalization.test.d.ts.map +1 -0
  7. package/dist/__tests__/EditableGradingInstructionLocalization.test.js +112 -0
  8. package/dist/__tests__/EditableGradingInstructionLocalization.test.js.map +1 -0
  9. package/dist/__tests__/FormatButton.test.d.ts +2 -0
  10. package/dist/__tests__/FormatButton.test.d.ts.map +1 -0
  11. package/dist/__tests__/FormatButton.test.js +94 -0
  12. package/dist/__tests__/FormatButton.test.js.map +1 -0
  13. package/dist/__tests__/annotations.test.js +7 -7
  14. package/dist/__tests__/annotations.test.js.map +1 -1
  15. package/dist/__tests__/editor/FormatButton.test.d.ts +2 -0
  16. package/dist/__tests__/editor/FormatButton.test.d.ts.map +1 -0
  17. package/dist/__tests__/editor/FormatButton.test.js +98 -0
  18. package/dist/__tests__/editor/FormatButton.test.js.map +1 -0
  19. package/dist/__tests__/editor/Formula.test.d.ts +2 -0
  20. package/dist/__tests__/editor/Formula.test.d.ts.map +1 -0
  21. package/dist/__tests__/editor/Formula.test.js +61 -0
  22. package/dist/__tests__/editor/Formula.test.js.map +1 -0
  23. package/dist/__tests__/editor/ImageUploadButton.test.d.ts +2 -0
  24. package/dist/__tests__/editor/ImageUploadButton.test.d.ts.map +1 -0
  25. package/dist/__tests__/editor/ImageUploadButton.test.js +94 -0
  26. package/dist/__tests__/editor/ImageUploadButton.test.js.map +1 -0
  27. package/dist/__tests__/editor/List.test.d.ts +2 -0
  28. package/dist/__tests__/editor/List.test.d.ts.map +1 -0
  29. package/dist/__tests__/editor/List.test.js +72 -0
  30. package/dist/__tests__/editor/List.test.js.map +1 -0
  31. package/dist/__tests__/editor/Table.test.d.ts +2 -0
  32. package/dist/__tests__/editor/Table.test.d.ts.map +1 -0
  33. package/dist/__tests__/editor/Table.test.js +172 -0
  34. package/dist/__tests__/editor/Table.test.js.map +1 -0
  35. package/dist/__tests__/editor/br.test.d.ts +2 -0
  36. package/dist/__tests__/editor/br.test.d.ts.map +1 -0
  37. package/dist/__tests__/editor/br.test.js +39 -0
  38. package/dist/__tests__/editor/br.test.js.map +1 -0
  39. package/dist/__tests__/editor/hr.test.d.ts +2 -0
  40. package/dist/__tests__/editor/hr.test.d.ts.map +1 -0
  41. package/dist/__tests__/editor/hr.test.js +39 -0
  42. package/dist/__tests__/editor/hr.test.js.map +1 -0
  43. package/dist/__tests__/editor/nbsp.test.d.ts +2 -0
  44. package/dist/__tests__/editor/nbsp.test.d.ts.map +1 -0
  45. package/dist/__tests__/editor/nbsp.test.js +55 -0
  46. package/dist/__tests__/editor/nbsp.test.js.map +1 -0
  47. package/dist/__tests__/editor/noWrap.test.d.ts +2 -0
  48. package/dist/__tests__/editor/noWrap.test.d.ts.map +1 -0
  49. package/dist/__tests__/editor/noWrap.test.js +62 -0
  50. package/dist/__tests__/editor/noWrap.test.js.map +1 -0
  51. package/dist/__tests__/editor/spanWithLang.test.d.ts +2 -0
  52. package/dist/__tests__/editor/spanWithLang.test.d.ts.map +1 -0
  53. package/dist/__tests__/editor/spanWithLang.test.js +38 -0
  54. package/dist/__tests__/editor/spanWithLang.test.js.map +1 -0
  55. package/dist/__tests__/editor/subSup.test.d.ts +2 -0
  56. package/dist/__tests__/editor/subSup.test.d.ts.map +1 -0
  57. package/dist/__tests__/editor/subSup.test.js +50 -0
  58. package/dist/__tests__/editor/subSup.test.js.map +1 -0
  59. package/dist/__tests__/tsconfig.tsbuildinfo +1 -1
  60. package/dist/__tests__/utils/ProseMirrorWrapper.d.ts +8 -0
  61. package/dist/__tests__/utils/ProseMirrorWrapper.d.ts.map +1 -0
  62. package/dist/__tests__/utils/ProseMirrorWrapper.js +44 -0
  63. package/dist/__tests__/utils/ProseMirrorWrapper.js.map +1 -0
  64. package/dist/__tests__/utils/prosemirror.d.ts +2 -0
  65. package/dist/__tests__/utils/prosemirror.d.ts.map +1 -0
  66. package/dist/__tests__/utils/prosemirror.js +30 -0
  67. package/dist/__tests__/utils/prosemirror.js.map +1 -0
  68. package/dist/__tests__/utils/renderEditableGradingInstruction.d.ts +4 -0
  69. package/dist/__tests__/utils/renderEditableGradingInstruction.d.ts.map +1 -0
  70. package/dist/__tests__/utils/renderEditableGradingInstruction.js +22 -0
  71. package/dist/__tests__/utils/renderEditableGradingInstruction.js.map +1 -0
  72. package/dist/__tests__/utils/util.d.ts +2 -0
  73. package/dist/__tests__/utils/util.d.ts.map +1 -0
  74. package/dist/__tests__/utils/util.js +10 -0
  75. package/dist/__tests__/utils/util.js.map +1 -0
  76. package/dist/components/Localization.d.ts +5 -0
  77. package/dist/components/Localization.d.ts.map +1 -0
  78. package/dist/components/Localization.js +9 -0
  79. package/dist/components/Localization.js.map +1 -0
  80. package/dist/components/context/AnnotationProvider.d.ts +2 -2
  81. package/dist/components/context/AnnotationProvider.d.ts.map +1 -1
  82. package/dist/components/context/AnnotationProvider.js +3 -2
  83. package/dist/components/context/AnnotationProvider.js.map +1 -1
  84. package/dist/components/context/AttachmentContext.d.ts.map +1 -1
  85. package/dist/components/context/CommonExamContext.d.ts +1 -0
  86. package/dist/components/context/CommonExamContext.d.ts.map +1 -1
  87. package/dist/components/context/CommonExamContext.js +3 -0
  88. package/dist/components/context/CommonExamContext.js.map +1 -1
  89. package/dist/components/context/ExamContext.d.ts.map +1 -1
  90. package/dist/components/context/GradingInstructionContext.d.ts +17 -0
  91. package/dist/components/context/GradingInstructionContext.d.ts.map +1 -0
  92. package/dist/components/context/GradingInstructionContext.js +3 -0
  93. package/dist/components/context/GradingInstructionContext.js.map +1 -0
  94. package/dist/components/context/QuestionContext.d.ts.map +1 -1
  95. package/dist/components/context/ResultsContext.d.ts.map +1 -1
  96. package/dist/components/context/SectionContext.d.ts.map +1 -1
  97. package/dist/components/grading-instructions/AnswerGradingInstruction.d.ts.map +1 -1
  98. package/dist/components/grading-instructions/AnswerGradingInstruction.js +7 -2
  99. package/dist/components/grading-instructions/AnswerGradingInstruction.js.map +1 -1
  100. package/dist/components/grading-instructions/EditableGradingInstruction.d.ts +6 -0
  101. package/dist/components/grading-instructions/EditableGradingInstruction.d.ts.map +1 -0
  102. package/dist/components/grading-instructions/EditableGradingInstruction.js +121 -0
  103. package/dist/components/grading-instructions/EditableGradingInstruction.js.map +1 -0
  104. package/dist/components/grading-instructions/GradingInstruction.d.ts +7 -0
  105. package/dist/components/grading-instructions/GradingInstruction.d.ts.map +1 -0
  106. package/dist/components/grading-instructions/GradingInstruction.js +9 -0
  107. package/dist/components/grading-instructions/GradingInstruction.js.map +1 -0
  108. package/dist/components/grading-instructions/GradingInstructionProvider.d.ts +4 -0
  109. package/dist/components/grading-instructions/GradingInstructionProvider.d.ts.map +1 -0
  110. package/dist/components/grading-instructions/GradingInstructionProvider.js +7 -0
  111. package/dist/components/grading-instructions/GradingInstructionProvider.js.map +1 -0
  112. package/dist/components/grading-instructions/GradingInstructions.d.ts +2 -1
  113. package/dist/components/grading-instructions/GradingInstructions.d.ts.map +1 -1
  114. package/dist/components/grading-instructions/GradingInstructions.js +18 -15
  115. package/dist/components/grading-instructions/GradingInstructions.js.map +1 -1
  116. package/dist/components/grading-instructions/editor/AttributeToggleButton.d.ts +9 -0
  117. package/dist/components/grading-instructions/editor/AttributeToggleButton.d.ts.map +1 -0
  118. package/dist/components/grading-instructions/editor/AttributeToggleButton.js +53 -0
  119. package/dist/components/grading-instructions/editor/AttributeToggleButton.js.map +1 -0
  120. package/dist/components/grading-instructions/editor/CurrentElement.d.ts +2 -0
  121. package/dist/components/grading-instructions/editor/CurrentElement.d.ts.map +1 -0
  122. package/dist/components/grading-instructions/editor/CurrentElement.js +8 -0
  123. package/dist/components/grading-instructions/editor/CurrentElement.js.map +1 -0
  124. package/dist/components/grading-instructions/editor/CurrentLocalization.d.ts +7 -0
  125. package/dist/components/grading-instructions/editor/CurrentLocalization.d.ts.map +1 -0
  126. package/dist/components/grading-instructions/editor/CurrentLocalization.js +13 -0
  127. package/dist/components/grading-instructions/editor/CurrentLocalization.js.map +1 -0
  128. package/dist/components/grading-instructions/editor/FormatButton.d.ts +9 -0
  129. package/dist/components/grading-instructions/editor/FormatButton.d.ts.map +1 -0
  130. package/dist/components/grading-instructions/editor/FormatButton.js +26 -0
  131. package/dist/components/grading-instructions/editor/FormatButton.js.map +1 -0
  132. package/dist/components/grading-instructions/editor/Formula.d.ts +15 -0
  133. package/dist/components/grading-instructions/editor/Formula.d.ts.map +1 -0
  134. package/dist/components/grading-instructions/editor/Formula.js +41 -0
  135. package/dist/components/grading-instructions/editor/Formula.js.map +1 -0
  136. package/dist/components/grading-instructions/editor/FormulaPopup.d.ts +7 -0
  137. package/dist/components/grading-instructions/editor/FormulaPopup.d.ts.map +1 -0
  138. package/dist/components/grading-instructions/editor/FormulaPopup.js +49 -0
  139. package/dist/components/grading-instructions/editor/FormulaPopup.js.map +1 -0
  140. package/dist/components/grading-instructions/editor/ImageUploadButton.d.ts +6 -0
  141. package/dist/components/grading-instructions/editor/ImageUploadButton.d.ts.map +1 -0
  142. package/dist/components/grading-instructions/editor/ImageUploadButton.js +77 -0
  143. package/dist/components/grading-instructions/editor/ImageUploadButton.js.map +1 -0
  144. package/dist/components/grading-instructions/editor/List.d.ts +9 -0
  145. package/dist/components/grading-instructions/editor/List.d.ts.map +1 -0
  146. package/dist/components/grading-instructions/editor/List.js +41 -0
  147. package/dist/components/grading-instructions/editor/List.js.map +1 -0
  148. package/dist/components/grading-instructions/editor/Localization.d.ts +3 -0
  149. package/dist/components/grading-instructions/editor/Localization.d.ts.map +1 -0
  150. package/dist/components/grading-instructions/editor/Localization.js +36 -0
  151. package/dist/components/grading-instructions/editor/Localization.js.map +1 -0
  152. package/dist/components/grading-instructions/editor/LocalizationButtons.d.ts +6 -0
  153. package/dist/components/grading-instructions/editor/LocalizationButtons.d.ts.map +1 -0
  154. package/dist/components/grading-instructions/editor/LocalizationButtons.js +14 -0
  155. package/dist/components/grading-instructions/editor/LocalizationButtons.js.map +1 -0
  156. package/dist/components/grading-instructions/editor/NBSP.d.ts +4 -0
  157. package/dist/components/grading-instructions/editor/NBSP.d.ts.map +1 -0
  158. package/dist/components/grading-instructions/editor/NBSP.js +17 -0
  159. package/dist/components/grading-instructions/editor/NBSP.js.map +1 -0
  160. package/dist/components/grading-instructions/editor/Table.d.ts +6 -0
  161. package/dist/components/grading-instructions/editor/Table.d.ts.map +1 -0
  162. package/dist/components/grading-instructions/editor/Table.js +186 -0
  163. package/dist/components/grading-instructions/editor/Table.js.map +1 -0
  164. package/dist/components/grading-instructions/editor/findNode.d.ts +3 -0
  165. package/dist/components/grading-instructions/editor/findNode.d.ts.map +1 -0
  166. package/dist/components/grading-instructions/editor/findNode.js +10 -0
  167. package/dist/components/grading-instructions/editor/findNode.js.map +1 -0
  168. package/dist/components/grading-instructions/editor/localizatio.d.ts +3 -0
  169. package/dist/components/grading-instructions/editor/localizatio.d.ts.map +1 -0
  170. package/dist/components/grading-instructions/editor/localizatio.js +36 -0
  171. package/dist/components/grading-instructions/editor/localizatio.js.map +1 -0
  172. package/dist/components/grading-instructions/editor/localizationSpan.d.ts +3 -0
  173. package/dist/components/grading-instructions/editor/localizationSpan.d.ts.map +1 -0
  174. package/dist/components/grading-instructions/editor/localizationSpan.js +36 -0
  175. package/dist/components/grading-instructions/editor/localizationSpan.js.map +1 -0
  176. package/dist/components/grading-instructions/editor/schemas/formulaSchema.d.ts +4 -0
  177. package/dist/components/grading-instructions/editor/schemas/formulaSchema.d.ts.map +1 -0
  178. package/dist/components/grading-instructions/editor/schemas/formulaSchema.js +62 -0
  179. package/dist/components/grading-instructions/editor/schemas/formulaSchema.js.map +1 -0
  180. package/dist/components/grading-instructions/editor/schemas/image-schema.d.ts +4 -0
  181. package/dist/components/grading-instructions/editor/schemas/image-schema.d.ts.map +1 -0
  182. package/dist/components/grading-instructions/editor/schemas/image-schema.js +47 -0
  183. package/dist/components/grading-instructions/editor/schemas/image-schema.js.map +1 -0
  184. package/dist/components/grading-instructions/editor/schemas/imageSchema.d.ts +4 -0
  185. package/dist/components/grading-instructions/editor/schemas/imageSchema.d.ts.map +1 -0
  186. package/dist/components/grading-instructions/editor/schemas/imageSchema.js +61 -0
  187. package/dist/components/grading-instructions/editor/schemas/imageSchema.js.map +1 -0
  188. package/dist/components/grading-instructions/editor/schemas/listSchema.d.ts +72 -0
  189. package/dist/components/grading-instructions/editor/schemas/listSchema.d.ts.map +1 -0
  190. package/dist/components/grading-instructions/editor/schemas/listSchema.js +7 -0
  191. package/dist/components/grading-instructions/editor/schemas/listSchema.js.map +1 -0
  192. package/dist/components/grading-instructions/editor/schemas/localizationSchema.d.ts +3 -0
  193. package/dist/components/grading-instructions/editor/schemas/localizationSchema.d.ts.map +1 -0
  194. package/dist/components/grading-instructions/editor/schemas/localizationSchema.js +39 -0
  195. package/dist/components/grading-instructions/editor/schemas/localizationSchema.js.map +1 -0
  196. package/dist/components/grading-instructions/editor/schemas/spanWithLangSchema.d.ts +3 -0
  197. package/dist/components/grading-instructions/editor/schemas/spanWithLangSchema.d.ts.map +1 -0
  198. package/dist/components/grading-instructions/editor/schemas/spanWithLangSchema.js +19 -0
  199. package/dist/components/grading-instructions/editor/schemas/spanWithLangSchema.js.map +1 -0
  200. package/dist/components/grading-instructions/editor/schemas/spanWithNowrapSchema.d.ts +3 -0
  201. package/dist/components/grading-instructions/editor/schemas/spanWithNowrapSchema.d.ts.map +1 -0
  202. package/dist/components/grading-instructions/editor/schemas/spanWithNowrapSchema.js +19 -0
  203. package/dist/components/grading-instructions/editor/schemas/spanWithNowrapSchema.js.map +1 -0
  204. package/dist/components/grading-instructions/editor/schemas/subSupSchema.d.ts +3 -0
  205. package/dist/components/grading-instructions/editor/schemas/subSupSchema.d.ts.map +1 -0
  206. package/dist/components/grading-instructions/editor/schemas/subSupSchema.js +23 -0
  207. package/dist/components/grading-instructions/editor/schemas/subSupSchema.js.map +1 -0
  208. package/dist/components/grading-instructions/editor/schemas/tableSchema.d.ts +3 -0
  209. package/dist/components/grading-instructions/editor/schemas/tableSchema.d.ts.map +1 -0
  210. package/dist/components/grading-instructions/editor/schemas/tableSchema.js +43 -0
  211. package/dist/components/grading-instructions/editor/schemas/tableSchema.js.map +1 -0
  212. package/dist/components/grading-instructions/editor/spanWithNowrap.d.ts +3 -0
  213. package/dist/components/grading-instructions/editor/spanWithNowrap.d.ts.map +1 -0
  214. package/dist/components/grading-instructions/editor/spanWithNowrap.js +19 -0
  215. package/dist/components/grading-instructions/editor/spanWithNowrap.js.map +1 -0
  216. package/dist/components/grading-instructions/editor/spanWithPath.d.ts +3 -0
  217. package/dist/components/grading-instructions/editor/spanWithPath.d.ts.map +1 -0
  218. package/dist/components/grading-instructions/editor/spanWithPath.js +24 -0
  219. package/dist/components/grading-instructions/editor/spanWithPath.js.map +1 -0
  220. package/dist/components/grading-instructions/editor/util.d.ts +6 -0
  221. package/dist/components/grading-instructions/editor/util.d.ts.map +1 -0
  222. package/dist/components/grading-instructions/editor/util.js +10 -0
  223. package/dist/components/grading-instructions/editor/util.js.map +1 -0
  224. package/dist/components/shared/AnnotationMark.d.ts +1 -1
  225. package/dist/components/shared/AnnotationMark.d.ts.map +1 -1
  226. package/dist/components/shared/AnnotationPopup.d.ts +1 -1
  227. package/dist/components/shared/AnnotationPopup.d.ts.map +1 -1
  228. package/dist/components/shared/AnnotationPopup.js +11 -70
  229. package/dist/components/shared/AnnotationPopup.js.map +1 -1
  230. package/dist/components/shared/Popup.d.ts +15 -0
  231. package/dist/components/shared/Popup.d.ts.map +1 -0
  232. package/dist/components/shared/Popup.js +90 -0
  233. package/dist/components/shared/Popup.js.map +1 -0
  234. package/dist/components/shared/markText.d.ts +1 -1
  235. package/dist/components/shared/markText.d.ts.map +1 -1
  236. package/dist/components/shared/markText.js.map +1 -1
  237. package/dist/main-bundle.js +1 -1
  238. package/dist/main-bundle.js.LICENSE.txt +1 -1
  239. package/dist/main.css +1 -1
  240. package/package.json +11 -2
@@ -0,0 +1,8 @@
1
+ import React, { ReactNode } from 'react';
2
+ interface WrapperProps {
3
+ children?: ReactNode;
4
+ innerHtml?: string;
5
+ }
6
+ declare const ProseMirrorWrapper: React.FC<WrapperProps>;
7
+ export default ProseMirrorWrapper;
8
+ //# sourceMappingURL=ProseMirrorWrapper.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ProseMirrorWrapper.d.ts","sourceRoot":"","sources":["../../../__tests__/utils/ProseMirrorWrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAY,MAAM,OAAO,CAAA;AAMlD,UAAU,YAAY;IACpB,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,QAAA,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CAmB9C,CAAA;AAED,eAAe,kBAAkB,CAAA"}
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ const react_1 = __importStar(require("react"));
27
+ const react_prosemirror_1 = require("@nytimes/react-prosemirror");
28
+ const prosemirror_schema_basic_1 = require("prosemirror-schema-basic");
29
+ const prosemirror_model_1 = require("prosemirror-model");
30
+ const prosemirror_state_1 = require("prosemirror-state");
31
+ const ProseMirrorWrapper = ({ children, innerHtml = '' }) => {
32
+ const [mount, setMount] = (0, react_1.useState)(null);
33
+ const container = document.createElement('div');
34
+ container.innerHTML = innerHtml;
35
+ const doc = prosemirror_model_1.DOMParser.fromSchema(prosemirror_schema_basic_1.schema).parse(container);
36
+ const [state, setState] = (0, react_1.useState)(prosemirror_state_1.EditorState.create({ schema: prosemirror_schema_basic_1.schema, doc }));
37
+ return (react_1.default.createElement(react_prosemirror_1.ProseMirror, { state: state, mount: mount, dispatchTransaction: tr => {
38
+ setState(s => s.apply(tr));
39
+ } },
40
+ react_1.default.createElement("div", { ref: setMount }),
41
+ children));
42
+ };
43
+ exports.default = ProseMirrorWrapper;
44
+ //# sourceMappingURL=ProseMirrorWrapper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ProseMirrorWrapper.js","sourceRoot":"","sources":["../../../__tests__/utils/ProseMirrorWrapper.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAkD;AAClD,kEAAwD;AACxD,uEAAiD;AACjD,yDAA+D;AAC/D,yDAA+C;AAO/C,MAAM,kBAAkB,GAA2B,CAAC,EAAE,QAAQ,EAAE,SAAS,GAAG,EAAE,EAAE,EAAE,EAAE;IAClF,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,IAAA,gBAAQ,EAAqB,IAAI,CAAC,CAAA;IAC5D,MAAM,SAAS,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAA;IAC/C,SAAS,CAAC,SAAS,GAAG,SAAS,CAAA;IAC/B,MAAM,GAAG,GAAG,6BAAc,CAAC,UAAU,CAAC,iCAAM,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,CAAA;IAC9D,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,IAAA,gBAAQ,EAAC,+BAAW,CAAC,MAAM,CAAC,EAAE,MAAM,EAAN,iCAAM,EAAE,GAAG,EAAE,CAAC,CAAC,CAAA;IAEvE,OAAO,CACL,8BAAC,+BAAW,IACV,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,KAAK,EACZ,mBAAmB,EAAE,EAAE,CAAC,EAAE;YACxB,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAA;QAC5B,CAAC;QAED,uCAAK,GAAG,EAAE,QAAQ,GAAI;QACrB,QAAQ,CACG,CACf,CAAA;AACH,CAAC,CAAA;AAED,kBAAe,kBAAkB,CAAA"}
@@ -0,0 +1,2 @@
1
+ export declare function mockCreateRange(): () => () => Range;
2
+ //# sourceMappingURL=prosemirror.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prosemirror.d.ts","sourceRoot":"","sources":["../../../__tests__/utils/prosemirror.ts"],"names":[],"mappings":"AAAA,wBAAgB,eAAe,sBA2B9B"}
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.mockCreateRange = mockCreateRange;
4
+ function mockCreateRange() {
5
+ const originalCreateRange = global.window.document.createRange;
6
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
7
+ // @ts-expect-error
8
+ global.Range = function Range() { };
9
+ const createContextualFragment = (html) => {
10
+ const div = document.createElement('div');
11
+ div.innerHTML = html;
12
+ return div.children[0];
13
+ };
14
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
15
+ // @ts-expect-error
16
+ Range.prototype.createContextualFragment = (html) => createContextualFragment(html);
17
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
18
+ // @ts-expect-error
19
+ global.window.document.createRange = function createRange() {
20
+ return {
21
+ setEnd: () => { },
22
+ setStart: () => { },
23
+ getBoundingClientRect: () => ({ right: 0 }),
24
+ getClientRects: () => [],
25
+ createContextualFragment
26
+ };
27
+ };
28
+ return () => (global.window.document.createRange = originalCreateRange);
29
+ }
30
+ //# sourceMappingURL=prosemirror.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prosemirror.js","sourceRoot":"","sources":["../../../__tests__/utils/prosemirror.ts"],"names":[],"mappings":";;AAAA,0CA2BC;AA3BD,SAAgB,eAAe;IAC7B,MAAM,mBAAmB,GAAG,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAA;IAC9D,6DAA6D;IAC7D,mBAAmB;IACnB,MAAM,CAAC,KAAK,GAAG,SAAS,KAAK,KAAI,CAAC,CAAA;IAElC,MAAM,wBAAwB,GAAG,CAAC,IAAY,EAAE,EAAE;QAChD,MAAM,GAAG,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAA;QACzC,GAAG,CAAC,SAAS,GAAG,IAAI,CAAA;QACpB,OAAO,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAA;IACxB,CAAC,CAAA;IACD,6DAA6D;IAC7D,mBAAmB;IACnB,KAAK,CAAC,SAAS,CAAC,wBAAwB,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,wBAAwB,CAAC,IAAI,CAAC,CAAA;IAE3F,6DAA6D;IAC7D,mBAAmB;IACnB,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,WAAW,GAAG,SAAS,WAAW;QACvD,OAAO;YACL,MAAM,EAAE,GAAG,EAAE,GAAE,CAAC;YAChB,QAAQ,EAAE,GAAG,EAAE,GAAE,CAAC;YAClB,qBAAqB,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;YAC3C,cAAc,EAAE,GAAG,EAAE,CAAC,EAAE;YACxB,wBAAwB;SACzB,CAAA;IACH,CAAC,CAAA;IACD,OAAO,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,WAAW,GAAG,mBAAmB,CAAC,CAAA;AACzE,CAAC"}
@@ -0,0 +1,4 @@
1
+ export declare const mockedPermanentUrl = "mocked-permanent-url";
2
+ export declare const mockedResolvedPath = "mock-resolved-path";
3
+ export declare function renderGradingInstruction(inputData: string, onContentChangeMock?: () => void): import("@testing-library/react").RenderResult<typeof import("@testing-library/dom/types/queries"), HTMLElement, HTMLElement>;
4
+ //# sourceMappingURL=renderEditableGradingInstruction.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"renderEditableGradingInstruction.d.ts","sourceRoot":"","sources":["../../../__tests__/utils/renderEditableGradingInstruction.tsx"],"names":[],"mappings":"AAQA,eAAO,MAAM,kBAAkB,yBAAyB,CAAA;AACxD,eAAO,MAAM,kBAAkB,uBAAuB,CAAA;AAMtD,wBAAgB,wBAAwB,CAAC,SAAS,EAAE,MAAM,EAAE,mBAAmB,aAAW,gIAezF"}
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.mockedResolvedPath = exports.mockedPermanentUrl = void 0;
7
+ exports.renderGradingInstruction = renderGradingInstruction;
8
+ const react_1 = require("@testing-library/react");
9
+ const GradingInstructionProvider_1 = require("../../src/components/grading-instructions/GradingInstructionProvider");
10
+ const EditableGradingInstruction_1 = __importDefault(require("../../src/components/grading-instructions/EditableGradingInstruction"));
11
+ const react_2 = __importDefault(require("react"));
12
+ const CommonExamContext_1 = require("../../src/components/context/CommonExamContext");
13
+ exports.mockedPermanentUrl = 'mocked-permanent-url';
14
+ exports.mockedResolvedPath = 'mock-resolved-path';
15
+ const WrappedGradingInstructionProvider = (0, CommonExamContext_1.withCommonExamContext)(GradingInstructionProvider_1.GradingInstructionProvider);
16
+ function renderGradingInstruction(inputData, onContentChangeMock = () => { }) {
17
+ const doc = new DOMParser().parseFromString(inputData, 'text/html');
18
+ return (0, react_1.render)(react_2.default.createElement(WrappedGradingInstructionProvider, { editable: true, onContentChange: onContentChangeMock, onSaveImage: () => Promise.resolve(exports.mockedPermanentUrl), answers: [], attachmentsURL: "", resolveAttachment: filename => `/${exports.mockedResolvedPath}/${filename}`, doc: doc },
19
+ react_2.default.createElement(EditableGradingInstruction_1.default, { element: doc.documentElement }),
20
+ "x"));
21
+ }
22
+ //# sourceMappingURL=renderEditableGradingInstruction.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"renderEditableGradingInstruction.js","sourceRoot":"","sources":["../../../__tests__/utils/renderEditableGradingInstruction.tsx"],"names":[],"mappings":";;;;;;AAeA,4DAeC;AA9BD,kDAA+C;AAC/C,qHAAiH;AACjH,sIAA6G;AAC7G,kDAAyB;AACzB,sFAAsF;AAIzE,QAAA,kBAAkB,GAAG,sBAAsB,CAAA;AAC3C,QAAA,kBAAkB,GAAG,oBAAoB,CAAA;AAEtD,MAAM,iCAAiC,GAAG,IAAA,yCAAqB,EAC7D,uDAA0B,CAC3B,CAAA;AAED,SAAgB,wBAAwB,CAAC,SAAiB,EAAE,mBAAmB,GAAG,GAAG,EAAE,GAAE,CAAC;IACxF,MAAM,GAAG,GAAG,IAAI,SAAS,EAAE,CAAC,eAAe,CAAC,SAAS,EAAE,WAAW,CAAC,CAAA;IACnE,OAAO,IAAA,cAAM,EACX,8BAAC,iCAAiC,IAChC,QAAQ,EAAE,IAAI,EACd,eAAe,EAAE,mBAAmB,EACpC,WAAW,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,0BAAkB,CAAC,EACtD,OAAO,EAAE,EAAE,EACX,cAAc,EAAC,EAAE,EACjB,iBAAiB,EAAE,QAAQ,CAAC,EAAE,CAAC,IAAI,0BAAkB,IAAI,QAAQ,EAAE,EACnE,GAAG,EAAE,GAAG;QAER,8BAAC,oCAA0B,IAAC,OAAO,EAAE,GAAG,CAAC,eAAe,GAAI;YAC1B,CACrC,CAAA;AACH,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function insertText(element: HTMLElement, text: string): void;
2
+ //# sourceMappingURL=util.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../__tests__/utils/util.ts"],"names":[],"mappings":"AAEA,wBAAgB,UAAU,CAAC,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,QAI5D"}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.insertText = insertText;
4
+ const react_1 = require("@testing-library/react");
5
+ function insertText(element, text) {
6
+ react_1.fireEvent.input(element, {
7
+ target: { innerText: text, innerHTML: text }
8
+ });
9
+ }
10
+ //# sourceMappingURL=util.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"util.js","sourceRoot":"","sources":["../../../__tests__/utils/util.ts"],"names":[],"mappings":";;AAEA,gCAIC;AAND,kDAAkD;AAElD,SAAgB,UAAU,CAAC,OAAoB,EAAE,IAAY;IAC3D,iBAAS,CAAC,KAAK,CAAC,OAAO,EAAE;QACvB,MAAM,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE;KAC7C,CAAC,CAAA;AACJ,CAAC"}
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import { ExamComponentProps } from '../createRenderChildNodes';
3
+ declare const Localization: React.FunctionComponent<ExamComponentProps>;
4
+ export default Localization;
5
+ //# sourceMappingURL=Localization.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Localization.d.ts","sourceRoot":"","sources":["../../src/components/Localization.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAA;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AAI9D,QAAA,MAAM,YAAY,EAAE,KAAK,CAAC,iBAAiB,CAAC,kBAAkB,CAW7D,CAAA;AACD,eAAe,YAAY,CAAA"}
@@ -0,0 +1,9 @@
1
+ import React, { useContext } from 'react';
2
+ import { GradingInstructionContext } from './context/GradingInstructionContext';
3
+ import EditableGradingInstruction from './grading-instructions/EditableGradingInstruction';
4
+ const Localization = ({ element, renderChildNodes }) => {
5
+ const { editable } = useContext(GradingInstructionContext);
6
+ return (React.createElement("div", { className: "e-exam-grading-instruction-localization notification e-pad-4", "data-annotation-anchor": "exam-grading-instruction-localization" }, editable ? React.createElement(EditableGradingInstruction, { element: element }) : renderChildNodes(element)));
7
+ };
8
+ export default Localization;
9
+ //# sourceMappingURL=Localization.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Localization.js","sourceRoot":"","sources":["../../src/components/Localization.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAEzC,OAAO,EAAE,yBAAyB,EAAE,MAAM,qCAAqC,CAAA;AAC/E,OAAO,0BAA0B,MAAM,mDAAmD,CAAA;AAE1F,MAAM,YAAY,GAAgD,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,EAAE,EAAE;IAClG,MAAM,EAAE,QAAQ,EAAE,GAAG,UAAU,CAAC,yBAAyB,CAAC,CAAA;IAE1D,OAAO,CACL,6BACE,SAAS,EAAC,8DAA8D,4BACjD,uCAAuC,IAE7D,QAAQ,CAAC,CAAC,CAAC,oBAAC,0BAA0B,IAAC,OAAO,EAAE,OAAO,GAAI,CAAC,CAAC,CAAC,gBAAgB,CAAC,OAAO,CAAC,CACpF,CACP,CAAA;AACH,CAAC,CAAA;AACD,eAAe,YAAY,CAAA"}
@@ -12,8 +12,8 @@ export interface RenderableAnnotationProps {
12
12
  export interface AnnotationContextType extends RenderableAnnotationProps {
13
13
  newAnnotation: NewExamAnnotation | null;
14
14
  setNewAnnotation: (a: NewExamAnnotation | null) => void;
15
- newAnnotationRef: HTMLElement | undefined;
16
- setNewAnnotationRef: (ref: HTMLElement | undefined) => void;
15
+ newAnnotationRef: HTMLElement | null;
16
+ setNewAnnotationRef: (ref: HTMLElement | null) => void;
17
17
  }
18
18
  export declare const AnnotationContext: React.Context<AnnotationContextType>;
19
19
  export declare const AnnotationProvider: ({ children, annotations, onClickAnnotation, onSaveAnnotation }: Props & AnnotationProps) => string | number | boolean | Iterable<React.ReactNode> | React.JSX.Element | null | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"AnnotationProvider.d.ts","sourceRoot":"","sources":["../../../src/components/context/AnnotationProvider.tsx"],"names":[],"mappings":"AACA,OAAO,KAAkB,MAAM,OAAO,CAAA;AACtC,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAA;AAC3E,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAI9C,UAAU,KAAK;IACb,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAC1B;AAED,MAAM,WAAW,yBAAyB;IACxC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,oBAAoB,EAAE,CAAC,CAAA;IACnD,iBAAiB,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,EAAE,UAAU,CAAC,EAAE,UAAU,EAAE,oBAAoB,KAAK,IAAI,CAAA;IAC5G,gBAAgB,CAAC,EAAE,CAAC,UAAU,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;CAC5E;AAED,MAAM,WAAW,qBAAsB,SAAQ,yBAAyB;IACtE,aAAa,EAAE,iBAAiB,GAAG,IAAI,CAAA;IACvC,gBAAgB,EAAE,CAAC,CAAC,EAAE,iBAAiB,G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D,CAAA;AAEjF,eAAO,MAAM,kBAAkB,mEAK5B,KAAK,GAAG,eAAe,iGA2DzB,CAAA"}
@@ -5,15 +5,16 @@ import { AnnotationPopup } from '../shared/AnnotationPopup';
5
5
  export const AnnotationContext = React.createContext({});
6
6
  export const AnnotationProvider = ({ children, annotations, onClickAnnotation, onSaveAnnotation }) => {
7
7
  const [newAnnotation, setNewAnnotation] = React.useState(null);
8
- const [newAnnotationRef, setNewAnnotationRef] = React.useState();
8
+ const [newAnnotationRef, setNewAnnotationRef] = React.useState(null);
9
9
  const mouseUpCallback = (annotation) => {
10
10
  setNewAnnotation(annotation);
11
11
  };
12
12
  function onMouseDown(e) {
13
13
  const target = e.target;
14
- const clickIsInPopup = !!target.closest('.annotation-popup');
14
+ const clickIsInPopup = !!target.closest('.e-popup');
15
15
  if (!clickIsInPopup) {
16
16
  setNewAnnotation(null);
17
+ setNewAnnotationRef(null);
17
18
  }
18
19
  onMouseDownForAnnotation(e, mouseUpCallback);
19
20
  }
@@ -1 +1 @@
1
- {"version":3,"file":"AnnotationProvider.js","sourceRoot":"","sources":["../../../src/components/context/AnnotationProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,WAAW,CAAA;AAC9B,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAGtC,OAAO,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAA;AACzE,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAmB3D,MAAM,CAAC,MAAM,iBAAiB,GAAG,KAAK,CAAC,aAAa,CAAC,EAA2B,CAAC,CAAA;AAEjF,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,EACjC,QAAQ,EACR,WAAW,EACX,iBAAiB,EACjB,gBAAgB,EACQ,EAAE,EAAE;IAC5B,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,KAAK,CAAC,QAAQ,CAA2B,IAAI,CAAC,CAAA;IACxF,MAA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O,CACL,oBAAC,iBAAiB,CAAC,QAAQ,IACzB,KAAK,EAAE;YACL,WAAW,EAAE,sCAAsC;YACnD,iBAAiB;YACjB,gBAAgB;YAChB,aAAa;YACb,gBAAgB;YAChB,gBAAgB;YAChB,mBAAmB;SACpB;QAED,8BAAM,WAAW,EAAE,WAAW;YAC5B,oBAAC,eAAe,OAAG;YAClB,QAAQ,CACJ,CACoB,CAC9B,CAAA;AACH,CAAC,CAAA"}
1
+ {"version":3,"file":"AnnotationProvider.js","sourceRoot":"","sources":["../../../src/components/context/AnnotationProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,WAAW,CAAA;AAC9B,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAGtC,OAAO,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAA;AACzE,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAmB3D,MAAM,CAAC,MAAM,iBAAiB,GAAG,KAAK,CAAC,aAAa,CAAC,EAA2B,CAAC,CAAA;AAEjF,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,EACjC,QAAQ,EACR,WAAW,EACX,iBAAiB,EACjB,gBAAgB,EACQ,EAAE,EAAE;IAC5B,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,KAAK,CAAC,QAAQ,CAA2B,IAAI,CAAC,CAAA;IACxF,MAAM,CAAC,gBAAgB,EAAE,mBAAmB,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAqB,IAAI,CAAC,CAAA;IAExF,MAAM,eAAe,GAAG,CAAC,UAA6B,EAAE,EAAE;QACxD,gBAAgB,CAAC,UAAU,CAAC,CAAA;IAC9B,CAAC,CAAA;IAED,SAAS,WAAW,CAAC,CAAmB;QACtC,MAAM,MAAM,GAAG,CAAC,CAAC,MAAiB,CAAA;QAClC,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,CA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{"version":3,"file":"AttachmentContext.d.ts","sourceRoot":"","sources":["../../../src/components/context/AttachmentContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAKzB,MAAM,MAAM,iBAAiB,GACzB;IAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,UAAU,EAAE,KAAK,CAAC;IAAC,aAAa,EAAE,IAAI,CAAA;CAAE,GAC/D;IAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,UAAU,EAAE,IAAI,CAAC;IAAC,aAAa,EAAE,MAAM,CAAA;CAAE,CAAA;AAEpE,eAAO,MAAM,iBAAiB,kCAAkE,CAAA;AAEhG,eAAO,MAAM,qBAAqB,cAR2B,MAE5D,aAAa,UAAO,MAAO,aACnB,KAcR,CAAA"}
1
+ {"version":3,"file":"AttachmentContext.d.ts","sourceRoot":"","sources":["../../../src/components/context/AttachmentContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAKzB,MAAM,MAAM,iBAAiB,GACzB;IAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,UAAU,EAAE,KAAK,CAAC;IAAC,aAAa,EAAE,IAAI,CAAA;CAAE,GAC/D;IAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,UAAU,EAAE,IAAI,CAAC;IAAC,aAAa,EAAE,MAAM,CAAA;CAAE,CAAA;AAEpE,eAAO,MAAM,iBAAiB,kCAAkE,CAAA;AAEhG,eAAO,MAAM,qBAAqB,mEASjC,CAAA"}
@@ -8,6 +8,7 @@ export interface CommonExamContext {
8
8
  examCode?: string;
9
9
  /** The language of the exam. */
10
10
  language: string;
11
+ examType: string;
11
12
  /** The language of the subject matter. Differs from the language in foreign language exams. */
12
13
  subjectLanguage: string;
13
14
  maxAnswers?: number;
@@ -1 +1 @@
1
- {"version":3,"file":"CommonExamContext.d.ts","sourceRoot":"","sources":["../../../src/components/context/CommonExamContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAG9C,MAAM,WAAW,iBAAiB;IAChC,cAAc,EAAE,MAAM,CAAA;IACtB,IAAI,CAAC,EAAE,IAAI,CAAA;IACX,iBAAiB,EAAE,IAAI,CAAC,cAAc,CAAA;IACtC,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,gCAAgC;IAChC,QAAQ,EAAE,MAAM,CAAA;IAChB,+FAA+F;IAC/F,eAAe,EAAE,MAAM,CAAA;IACvB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,OAAO,EAAE,CAAA;IACnB,iBAAiB,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAM,CAAA;IAC/C,IAAI,EAAE,OAAO,CAAA;IACb,OAAO,EAAE,OAAO,CAAA;CACjB;AAED,eAAO,MAAM,iBAAiB,kCAA+C,CAAA;AAE7E,wBAAgB,qBAAqB,CAAC,CAAC,SAAS,eAAe,EAC7D,SAAS,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,GAChC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,CAuBxB"}
1
+ {"version":3,"file":"CommonExamContext.d.ts","sourceRoot":"","sources":["../../../src/components/context/CommonExamContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAG9C,MAAM,WAAW,iBAAiB;IAChC,cAAc,EAAE,MAAM,CAAA;IACtB,IAAI,CAAC,EAAE,IAAI,CAAA;IACX,iBAAiB,EAAE,IAAI,CAAC,cAAc,CAAA;IACtC,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,gCAAgC;IAChC,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;IAChB,+FAA+F;IAC/F,eAAe,EAAE,MAAM,CAAA;IACvB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,OAAO,EAAE,CAAA;IACnB,iBAAiB,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAM,CAAA;IAC/C,IAAI,EAAE,OAAO,CAAA;IACb,OAAO,EAAE,OAAO,CAAA;CACjB;AAED,eAAO,MAAM,iBAAiB,kCAA+C,CAAA;AAE7E,wBAAgB,qBAAqB,CAAC,CAAC,SAAS,eAAe,EAC7D,SAAS,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,GAChC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,CAyBxB"}
@@ -4,9 +4,11 @@ import { withContext } from './withContext';
4
4
  export const CommonExamContext = React.createContext({});
5
5
  export function withCommonExamContext(Component) {
6
6
  return withContext(CommonExamContext, ({ attachmentsURL, resolveAttachment, doc, abitti2 }) => {
7
+ var _a;
7
8
  const root = doc.documentElement;
8
9
  const maybeDate = getAttribute(root, 'date');
9
10
  const language = getAttribute(root, 'exam-lang');
11
+ const examType = (_a = getAttribute(root, 'exam-type')) !== null && _a !== void 0 ? _a : 'normal';
10
12
  const subjectLanguage = getAttribute(root, 'lang') || language;
11
13
  return {
12
14
  attachmentsURL,
@@ -16,6 +18,7 @@ export function withCommonExamContext(Component) {
16
18
  examCode: getAttribute(root, 'exam-code'),
17
19
  language,
18
20
  subjectLanguage,
21
+ examType,
19
22
  maxAnswers: getNumericAttribute(root, 'max-answers'),
20
23
  maxScore: getNumericAttribute(root, 'max-score'),
21
24
  sections: queryAll(root, 'section'),
@@ -1 +1 @@
1
- {"version":3,"file":"CommonExamContext.js","sourceRoot":"","sources":["../../../src/components/context/CommonExamContext.tsx"],"names":[],"mappings":"AAAA,OAAO,K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W,CAAC;YACzC,QAAQ;YACR,eAAe;YACf,QAAQ;YACR,UAAU,EAAE,mBAAmB,CAAC,IAAI,EAAE,aAAa,CAAC;YACpD,QAAQ,EAAE,mBAAmB,CAAC,IAAI,EAAE,WAAW,CAAC;YAChD,QAAQ,EAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;YACnC,iBAAiB;YACjB,OAAO,EAAE,OAAO,IAAI,KAAK;YACzB,IAAI;SACL,CAAA;IACH,CAAC,CAAC,CAAC,SAAS,CAAC,CAAA;AACf,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ExamContext.d.ts","sourceRoot":"","sources":["../../../src/components/context/ExamContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAE3C,MAAM,WAAW,WAAW;IAC1B,oBAAoB,EAAE,MAAM,CAAA;IAC5B,aAAa,EAAE,aAAa,CAAA;CAC7B;AAED,eAAO,MAAM,WAAW,4BAAyC,CAAA;AAEjE,eAAO,MAAM,eAAe,cAPJ,MACtB,aAAW,UAAO,MAAO,aAClB,KAYP,CAAA"}
1
+ {"version":3,"file":"ExamContext.d.ts","sourceRoot":"","sources":["../../../src/components/context/ExamContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAE3C,MAAM,WAAW,WAAW;IAC1B,oBAAoB,EAAE,MAAM,CAAA;IAC5B,aAAa,EAAE,aAAa,CAAA;CAC7B;AAED,eAAO,MAAM,WAAW,4BAAyC,CAAA;AAEjE,eAAO,MAAM,eAAe,mEAO1B,CAAA"}
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ export interface GradingInstructionPropsBase {
3
+ children?: React.ReactNode;
4
+ }
5
+ export interface EditableProps extends GradingInstructionPropsBase {
6
+ editable: true;
7
+ onContentChange: (answerHTML: string, path: string) => void;
8
+ onSaveImage: (file: File, displayNumber?: string) => Promise<string>;
9
+ }
10
+ export interface NotEditableProps extends GradingInstructionPropsBase {
11
+ editable?: false;
12
+ onContentChange?: never;
13
+ onSaveImage?: never;
14
+ }
15
+ export type GradingInstructionProps = EditableProps | NotEditableProps;
16
+ export declare const GradingInstructionContext: React.Context<GradingInstructionProps>;
17
+ //# sourceMappingURL=GradingInstructionContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GradingInstructionContext.d.ts","sourceRoot":"","sources":["../../../src/components/context/GradingInstructionContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAC3B;AAED,MAAM,WAAW,aAAc,SAAQ,2BAA2B;IAChE,QAAQ,EAAE,IAAI,CAAA;IACd,eAAe,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IAC3D,WAAW,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,aAAa,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAA;CACrE;AAED,MAAM,WAAW,gBAAiB,SAAQ,2BAA2B;IACnE,QAAQ,CAAC,EAAE,KAAK,CAAA;IAChB,eAAe,CAAC,EAAE,KAAK,CAAA;IACvB,WAAW,CAAC,EAAE,KAAK,CAAA;CACpB;AAED,MAAM,MAAM,uBAAuB,GAAG,aAAa,GAAG,gBAAgB,CAAA;AAEtE,eAAO,MAAM,yBAAyB,wCAAqD,CAAA"}
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ export const GradingInstructionContext = React.createContext({});
3
+ //# sourceMappingURL=GradingInstructionContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GradingInstructionContext.js","sourceRoot":"","sources":["../../../src/components/context/GradingInstructionContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAoBzB,MAAM,CAAC,MAAM,yBAAyB,GAAG,KAAK,CAAC,aAAa,CAAC,EAA6B,CAAC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"QuestionContext.d.ts","sourceRoot":"","sources":["../../../src/components/context/QuestionContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAMzB,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,OAAO,EAAE,CAAA;IAClB,aAAa,EAAE,MAAM,CAAA;IACrB,mBAAmB,EAAE,OAAO,CAAA;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,QAAQ,EAAE,MAAM,CAAA;IAChB,KAAK,EAAE,MAAM,CAAA;IACb,cAAc,EAAE,OAAO,EAAE,CAAA;IACzB,gBAAgB,EAAE,MAAM,CAAA;CACzB;AAED,eAAO,MAAM,eAAe,gCAA8D,CAAA;AAE1F,eAAO,MAAM,mBAAmB,cAhBpB,MAAO,aAAa,UAAO,MAAO,aAAa,KAsCzD,CAAA"}
1
+ {"version":3,"file":"QuestionContext.d.ts","sourceRoot":"","sources":["../../../src/components/context/QuestionContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAMzB,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,OAAO,EAAE,CAAA;IAClB,aAAa,EAAE,MAAM,CAAA;IACrB,mBAAmB,EAAE,OAAO,CAAA;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,QAAQ,EAAE,MAAM,CAAA;IAChB,KAAK,EAAE,MAAM,CAAA;IACb,cAAc,EAAE,OAAO,EAAE,CAAA;IACzB,gBAAgB,EAAE,MAAM,CAAA;CACzB;AAED,eAAO,MAAM,eAAe,gCAA8D,CAAA;AAE1F,eAAO,MAAM,mBAAmB,mEAsB9B,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"ResultsContext.d.ts","sourceRoot":"","sources":["../../../src/components/context/ResultsContext.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAgB,iBAAiB,EAAE,UAAU,EAAE,gBAAgB,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAI9G,MAAM,WAAW,cAAc;IAC7B,mBAAmB,EAAE,MAAM,CAAC,UAAU,EAAE,UAAU,CAAC,CAAA;IACnD,gBAAgB,EAAE,gBAAgB,CAAA;IAClC,MAAM,EAAE,KAAK,EAAE,CAAA;IACf,WAAW,EAAE,MAAM,GAAG,SAAS,CAAA;IAC/B,UAAU,EAAE,MAAM,CAAA;IAClB,aAAa,CAAC,EAAE,OAAO,CAAA;CACxB;AAED,eAAO,MAAM,cAAc,+BAA4D,CAAA;AAEvF,eAAO,MAAM,kBAAkB,cAfR,MAAM,aAAa,UAAO,MAAO,aAAa,KA+BpE,CAAA;AAED,wBAAgB,mCAAmC,CACjD,gBAAgB,EAAE,gBAAgB,EAClC,EAAE,EAAE,MAAM,GACT,iBAAiB,GAAG,SAAS,CAY/B;AAED,wBAAgB,SAAS,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,GAAG,KAAK,GAAG,SAAS,CAEhF;AAED,wBAAgB,+BAA+B,CAC7C,iBAAiB,EAAE,OAAO,EAAE,EAC5B,gBAAgB,EAAE,gBAAgB,EAClC,MAAM,EAAE,KAAK,EAAE,EACf,mBAAmB,EAAE,MAAM,CAAC,UAAU,EAAE,UAAU,CAAC,GAClD,MAAM,CAMR;AAED,wBAAgB,yBAAyB,CACvC,eAAe,EAAE,OAAO,EACxB,gBAAgB,EAAE,gBAAgB,EAClC,MAAM,EAAE,KAAK,EAAE,EACf,WAAW,EAAE,MAAM,CAAC,UAAU,EAAE,UAAU,CAAC,GAC1C,MAAM,CAgCR"}
1
+ {"version":3,"file":"ResultsContext.d.ts","sourceRoot":"","sources":["../../../src/components/context/ResultsContext.ts"],"names":[],"mappings":"AACA,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,YAAY,EAAE,OAAO,CAAA;IACrB,aAAa,EAAE,MAAM,CAAA;IACrB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,QAAQ,EAAE,MAAM,CAAA;IAChB,cAAc,EAAE,OAAO,EAAE,CAAA;CAC1B;AAED,eAAO,MAAM,cAAc,+BAA4D,CAAA;AAEvF,eAAO,MAAM,kBAAkB,cAbd,MAAO,aAAa,UAAO,MAAO,aAAa,KA+B9D,CAAA"}
1
+ {"version":3,"file":"SectionContext.d.ts","sourceRoot":"","sources":["../../../src/components/context/SectionContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAKzB,MAAM,WAAW,cAAc;IAC7B,YAAY,EAAE,OAAO,CAAA;IACrB,aAAa,EAAE,MAAM,CAAA;IACrB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,QAAQ,EAAE,MAAM,CAAA;IAChB,cAAc,EAAE,OAAO,EAAE,CAAA;CAC1B;AAED,eAAO,MAAM,cAAc,+BAA4D,CAAA;AAEvF,eAAO,MAAM,kBAAkB,mEAkB7B,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"AnswerGradingInstruction.d.ts","sourceRoot":"","sources":["../../../src/components/grading-instructions/AnswerGradingInstruction.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAA;AAEjE,QAAA,MAAM,wBAAwB,EAAE,KAAK,CAAC,iBAAiB,CAAC,kBAAkB,CAIzE,CAAA;AAED,eAAe,wBAAwB,CAAA"}
1
+ {"version":3,"file":"AnswerGradingInstruction.d.ts","sourceRoot":"","sources":["../../../src/components/grading-instructions/AnswerGradingInstruction.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAA;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAA;AAIjE,QAAA,MAAM,wBAAwB,EAAE,KAAK,CAAC,iBAAiB,CAAC,kBAAkB,CAOzE,CAAA;AAED,eAAe,wBAAwB,CAAA"}
@@ -1,4 +1,9 @@
1
- import React from 'react';
2
- const AnswerGradingInstruction = ({ element, renderChildNodes }) => (React.createElement("div", { className: "e-answer-grading-instruction e-multiline-results-text-answer e-mrg-b-2 e-pad-l-2" }, renderChildNodes(element)));
1
+ import React, { useContext } from 'react';
2
+ import { GradingInstructionContext } from '../context/GradingInstructionContext';
3
+ import EditableGradingInstruction from './EditableGradingInstruction';
4
+ const AnswerGradingInstruction = ({ element, renderChildNodes }) => {
5
+ const { editable } = useContext(GradingInstructionContext);
6
+ return (React.createElement("div", { className: "e-answer-grading-instruction e-multiline-results-text-answer e-mrg-b-2 e-pad-l-2" }, editable ? React.createElement(EditableGradingInstruction, { element: element }) : renderChildNodes(element)));
7
+ };
3
8
  export default AnswerGradingInstruction;
4
9
  //# sourceMappingURL=AnswerGradingInstruction.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AnswerGradingInstruction.js","sourceRoot":"","sources":["../../../src/components/grading-instructions/AnswerGradingInstruction.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,MAAM,wBAAwB,GAAgD,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,EAAE,EAAE,CAAC,CAC/G,6BAAK,SAAS,EAAC,kFAAkF,IAC9F,gBAAgB,CAAC,OAAO,CAAC,CACtB,CACP,CAAA;AAED,eAAe,wBAAwB,CAAA"}
1
+ {"version":3,"file":"AnswerGradingInstruction.js","sourceRoot":"","sources":["../../../src/components/grading-instructions/AnswerGradingInstruction.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAEzC,OAAO,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAA;AAChF,OAAO,0BAA0B,MAAM,8BAA8B,CAAA;AAErE,MAAM,wBAAwB,GAAgD,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,EAAE,EAAE;IAC9G,MAAM,EAAE,QAAQ,EAAE,GAAG,UAAU,CAAC,yBAAyB,CAAC,CAAA;IAC1D,OAAO,CACL,6BAAK,SAAS,EAAC,kFAAkF,IAC9F,QAAQ,CAAC,CAAC,CAAC,oBAAC,0BAA0B,IAAC,OAAO,EAAE,OAAO,GAAI,CAAC,CAAC,CAAC,gBAAgB,CAAC,OAAO,CAAC,CACpF,CACP,CAAA;AACH,CAAC,CAAA;AAED,eAAe,wBAAwB,CAAA"}
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ declare function EditableGradingInstruction({ element }: {
3
+ element: Element;
4
+ }): React.JSX.Element;
5
+ export default EditableGradingInstruction;
6
+ //# sourceMappingURL=EditableGradingInstruction.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EditableGradingInstruction.d.ts","sourceRoot":"","sources":["../../../src/components/grading-instructions/EditableGradingInstruction.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA0C,MAAM,OAAO,CAAA;AAwE9D,iBAAS,0BAA0B,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,qBAoFpE;AAED,eAAe,0BAA0B,CAAA"}
@@ -0,0 +1,121 @@
1
+ import React, { useContext, useEffect, useState } from 'react';
2
+ import { schema as baseSchema } from 'prosemirror-schema-basic';
3
+ import { EditorState } from 'prosemirror-state';
4
+ import { baseKeymap } from 'prosemirror-commands';
5
+ import { GradingInstructionContext } from '../context/GradingInstructionContext';
6
+ import { ProseMirror } from '@nytimes/react-prosemirror';
7
+ import { DOMParser as ProseDOMParser, DOMSerializer, Schema } from 'prosemirror-model';
8
+ import { keymap } from 'prosemirror-keymap';
9
+ import { FormulaButton, FormulaPlugin } from './editor/Formula';
10
+ import { TableMenu, tablePlugin } from './editor/Table';
11
+ import { FormulaPopup } from './editor/FormulaPopup';
12
+ import FormatButton from './editor/FormatButton';
13
+ import { NbspButton, nbspPlugin } from './editor/NBSP';
14
+ import { ImageUploadButton } from './editor/ImageUploadButton';
15
+ import { imageInputSchema, imageOutputSchema } from './editor/schemas/imageSchema';
16
+ import { CommonExamContext } from '../context/CommonExamContext';
17
+ import { faBold, faItalic, faList, faListOl } from '@fortawesome/free-solid-svg-icons';
18
+ import { formulaOutputSchema, formulaSchema } from './editor/schemas/formulaSchema';
19
+ import { tableSchema } from './editor/schemas/tableSchema';
20
+ import { spanWithNowrapSchema } from './editor/schemas/spanWithNowrapSchema';
21
+ import { localizationSchema } from './editor/schemas/localizationSchema';
22
+ import { listSchema } from './editor/schemas/listSchema';
23
+ import { createListPlugin, ListButton } from './editor/List';
24
+ import { subSupSchema } from './editor/schemas/subSupSchema';
25
+ import { spanWithLangSchema } from './editor/schemas/spanWithLangSchema';
26
+ function Menu(props) {
27
+ const { onSaveImage } = useContext(GradingInstructionContext);
28
+ const [isFloating, setIsFloating] = useState(false);
29
+ useEffect(() => {
30
+ const handleScroll = () => {
31
+ const rect = props.editorElement.getBoundingClientRect();
32
+ if (rect.top < 25 && rect.bottom > 100) {
33
+ setIsFloating(true);
34
+ }
35
+ else {
36
+ setIsFloating(false);
37
+ }
38
+ };
39
+ window.addEventListener('scroll', handleScroll);
40
+ return () => {
41
+ window.removeEventListener('scroll', handleScroll);
42
+ };
43
+ }, []);
44
+ return (React.createElement(React.Fragment, null,
45
+ React.createElement("div", { className: "editor-menu-placeholder" },
46
+ React.createElement("div", { className: `editor-menu ${isFloating ? 'floating' : ''}` },
47
+ React.createElement(FormatButton, { markName: "strong", icon: faBold }),
48
+ React.createElement(FormatButton, { markName: "em", icon: faItalic }),
49
+ React.createElement("span", { className: "editor-menu-separator" }),
50
+ React.createElement(ListButton, { nodeType: props.schema.nodes.bullet_list, icon: faList }),
51
+ React.createElement(ListButton, { nodeType: props.schema.nodes.ordered_list, icon: faListOl }),
52
+ onSaveImage && React.createElement(ImageUploadButton, { saveImage: onSaveImage }),
53
+ React.createElement("span", { className: "editor-menu-separator" }),
54
+ React.createElement(FormulaButton, { disabled: !!props.formulaState, setFormulaState: props.setFormulaState }),
55
+ React.createElement("span", { className: "editor-menu-separator" }),
56
+ React.createElement(TableMenu, { dropdownsBelow: isFloating }),
57
+ React.createElement("span", { className: "editor-menu-separator" }),
58
+ React.createElement(NbspButton, null)))));
59
+ }
60
+ function EditableGradingInstruction({ element }) {
61
+ const { onContentChange } = useContext(GradingInstructionContext);
62
+ const { resolveAttachment } = useContext(CommonExamContext);
63
+ const inputSchema = new Schema({
64
+ nodes: baseSchema.spec.nodes
65
+ .append(formulaSchema)
66
+ .append(tableSchema)
67
+ .append(listSchema)
68
+ .update('image', imageInputSchema(resolveAttachment))
69
+ .append(localizationSchema(true, 'inline'))
70
+ .append(localizationSchema(true, 'block')),
71
+ marks: baseSchema.spec.marks.append(spanWithNowrapSchema).append(subSupSchema).append(spanWithLangSchema)
72
+ });
73
+ const outputSchema = new Schema({
74
+ nodes: baseSchema.spec.nodes
75
+ .append(formulaOutputSchema)
76
+ .append(tableSchema)
77
+ .append(listSchema)
78
+ .update('image', imageOutputSchema)
79
+ .append(localizationSchema(false, 'inline'))
80
+ .append(localizationSchema(false, 'block')),
81
+ marks: baseSchema.spec.marks.append(spanWithNowrapSchema).append(subSupSchema).append(spanWithLangSchema)
82
+ });
83
+ const doc = ProseDOMParser.fromSchema(inputSchema).parse(element);
84
+ const [mount, setMount] = useState(null);
85
+ const [formulaState, setFormulaState] = useState(null);
86
+ const formulaPlugin = new FormulaPlugin(setFormulaState);
87
+ const [state, setState] = useState(EditorState.create({
88
+ schema: inputSchema,
89
+ doc,
90
+ plugins: [tablePlugin(), createListPlugin(inputSchema), keymap(baseKeymap), formulaPlugin, nbspPlugin]
91
+ }));
92
+ return (React.createElement(ProseMirror, { mount: mount, state: state, dispatchTransaction: tr => {
93
+ setState(s => {
94
+ var _a;
95
+ const newContent = s.apply(tr);
96
+ if (tr.docChanged) {
97
+ const fragment = DOMSerializer.fromSchema(outputSchema).serializeFragment(tr.doc.content);
98
+ const div = document.createElement('div');
99
+ div.appendChild(fragment);
100
+ const path = (_a = element.getAttribute('path')) !== null && _a !== void 0 ? _a : '';
101
+ if (onContentChange) {
102
+ const fixedHtml = div.innerHTML
103
+ .replace(/&nbsp;/g, '&#160;')
104
+ .replace(/<br>/g, '<br/>')
105
+ .replace(/<hr>/g, '<hr/>')
106
+ .replace(/&amp;gt;/g, '&gt;')
107
+ .replace(/&amp;lt;/g, '&lt;');
108
+ onContentChange(fixedHtml, path);
109
+ }
110
+ }
111
+ return newContent;
112
+ });
113
+ } },
114
+ mount && (React.createElement(Menu, { schema: inputSchema, formulaState: formulaState, setFormulaState: setFormulaState, editorElement: mount })),
115
+ React.createElement("div", { ref: setMount }),
116
+ formulaState && (React.createElement(FormulaPopup, { state: formulaState, onFinish: () => {
117
+ setFormulaState(null);
118
+ } }))));
119
+ }
120
+ export default EditableGradingInstruction;
121
+ //# sourceMappingURL=EditableGradingInstruction.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EditableGradingInstruction.js","sourceRoot":"","sources":["../../../src/components/grading-instructions/EditableGradingInstruction.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAC9D,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACjD,OAAO,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAA;AAChF,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AACxD,OAAO,EAAE,SAAS,IAAI,cAAc,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AACtF,OAAO,EA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AC,GAAG,CAAC,OAAO,CAAC,CAAA;oBACzF,MAAM,GAAG,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAA;oBACzC,GAAG,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAA;oBACzB,MAAM,IAAI,GAAG,MAAA,OAAO,CAAC,YAAY,CAAC,MAAM,CAAC,mCAAI,EAAE,CAAA;oBAC/C,IAAI,eAAe,EAAE,CAAC;wBACpB,MAAM,SAAS,GAAG,GAAG,CAAC,SAAS;6BAC5B,OAAO,CAAC,SAAS,EAAE,QAAQ,CAAC;6BAC5B,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC;6BACzB,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC;6BACzB,OAAO,CAAC,WAAW,EAAE,MAAM,CAAC;6BAC5B,OAAO,CAAC,WAAW,EAAE,MAAM,CAAC,CAAA;wBAC/B,eAAe,CAAC,SAAS,EAAE,IAAI,CAAC,CAAA;oBAClC,CAAC;gBACH,CAAC;gBACD,OAAO,UAAU,CAAA;YACnB,CAAC,CAAC,CAAA;QACJ,CAAC;QAEA,KAAK,IAAI,CACR,oBAAC,IAAI,IACH,MAAM,EAAE,WAAW,EACnB,YAAY,EAAE,YAAY,EAC1B,eAAe,EAAE,eAAe,EAChC,aAAa,EAAE,KAAK,GACpB,CACH;QACD,6BAAK,GAAG,EAAE,QAAQ,GAAI;QAErB,YAAY,IAAI,CACf,oBAAC,YAAY,IACX,KAAK,EAAE,YAAY,EACnB,QAAQ,EAAE,GAAG,EAAE;gBACb,eAAe,CAAC,IAAI,CAAC,CAAA;YACvB,CAAC,GACD,CACH,CACW,CACf,CAAA;AACH,CAAC;AAED,eAAe,0BAA0B,CAAA"}
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ declare const GradingInstruction: React.FunctionComponent<{
3
+ element: Element;
4
+ instructionType: string;
5
+ }>;
6
+ export default GradingInstruction;
7
+ //# sourceMappingURL=GradingInstruction.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GradingInstruction.d.ts","sourceRoot":"","sources":["../../../src/components/grading-instructions/GradingInstruction.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAQzB,QAAA,MAAM,kBAAkB,EAAE,KAAK,CAAC,iBAAiB,CAAC;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,eAAe,EAAE,MAAM,CAAA;CAAE,CAO9F,CAAA;AAED,eAAe,kBAAkB,CAAA"}
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import { createRenderChildNodes } from '../../createRenderChildNodes';
3
+ import Localization from '../Localization';
4
+ const renderChildNodes = createRenderChildNodes({
5
+ 'e:localization': Localization
6
+ });
7
+ const GradingInstruction = ({ element, instructionType }) => (React.createElement("div", { className: `${instructionType} e-multiline-results-text-answer e-mrg-b-2 e-pad-l-2` }, renderChildNodes(element)));
8
+ export default GradingInstruction;
9
+ //# sourceMappingURL=GradingInstruction.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GradingInstruction.js","sourceRoot":"","sources":["../../../src/components/grading-instructions/GradingInstruction.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAA;AACrE,OAAO,YAAY,MAAM,iBAAiB,CAAA;AAE1C,MAAM,gBAAgB,GAAG,sBAAsB,CAAC;IAC9C,gBAAgB,EAAE,YAAY;CAC/B,CAAC,CAAA;AAEF,MAAM,kBAAkB,GAA2E,CAAC,EAClG,OAAO,EACP,eAAe,EAChB,EAAE,EAAE,CAAC,CACJ,6BAAK,SAAS,EAAE,GAAG,eAAe,sDAAsD,IACrF,gBAAgB,CAAC,OAAO,CAAC,CACtB,CACP,CAAA;AAED,eAAe,kBAAkB,CAAA"}
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { GradingInstructionProps } from '../context/GradingInstructionContext';
3
+ export declare const GradingInstructionProvider: ({ editable, onContentChange, onSaveImage, children }: GradingInstructionProps) => React.JSX.Element;
4
+ //# sourceMappingURL=GradingInstructionProvider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GradingInstructionProvider.d.ts","sourceRoot":"","sources":["../../../src/components/grading-instructions/GradingInstructionProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAA6B,uBAAuB,EAAE,MAAM,sCAAsC,CAAA;AAEzG,eAAO,MAAM,0BAA0B,yDAKpC,uBAAuB,sBAGzB,CAAA"}
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import { GradingInstructionContext } from '../context/GradingInstructionContext';
3
+ export const GradingInstructionProvider = ({ editable, onContentChange, onSaveImage, children }) => {
4
+ const contextValue = editable ? { editable, onContentChange, onSaveImage } : { editable };
5
+ return React.createElement(GradingInstructionContext.Provider, { value: contextValue }, children);
6
+ };
7
+ //# sourceMappingURL=GradingInstructionProvider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GradingInstructionProvider.js","sourceRoot":"","sources":["../../../src/components/grading-instructions/GradingInstructionProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,yBAAyB,EAA2B,MAAM,sCAAsC,CAAA;AAEzG,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,EACzC,QAAQ,EACR,eAAe,EACf,WAAW,EACX,QAAQ,EACgB,EAAE,EAAE;IAC5B,MAAM,YAAY,GAAG,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,eAAe,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAA;IACzF,OAAO,oBAAC,yBAAyB,CAAC,QAAQ,IAAC,KAAK,EAAE,YAAY,IAAG,QAAQ,CAAsC,CAAA;AACjH,CAAC,CAAA"}