@digabi/exam-engine-core 22.0.1-alpha.7 → 22.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (174) 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__/EditableGradingInstruction.test.js +44 -51
  6. package/dist/__tests__/EditableGradingInstruction.test.js.map +1 -1
  7. package/dist/__tests__/editor/Formula.test.d.ts +2 -0
  8. package/dist/__tests__/editor/Formula.test.d.ts.map +1 -0
  9. package/dist/__tests__/editor/Formula.test.js +43 -0
  10. package/dist/__tests__/editor/Formula.test.js.map +1 -0
  11. package/dist/__tests__/editor/NBSP.test.d.ts +2 -0
  12. package/dist/__tests__/editor/NBSP.test.d.ts.map +1 -0
  13. package/dist/__tests__/editor/NBSP.test.js +59 -0
  14. package/dist/__tests__/editor/NBSP.test.js.map +1 -0
  15. package/dist/__tests__/editor/br.test.d.ts +2 -0
  16. package/dist/__tests__/editor/br.test.d.ts.map +1 -0
  17. package/dist/__tests__/editor/br.test.js +43 -0
  18. package/dist/__tests__/editor/br.test.js.map +1 -0
  19. package/dist/__tests__/editor/hr.test.d.ts +2 -0
  20. package/dist/__tests__/editor/hr.test.d.ts.map +1 -0
  21. package/dist/__tests__/editor/hr.test.js +43 -0
  22. package/dist/__tests__/editor/hr.test.js.map +1 -0
  23. package/dist/__tests__/editor/no-wrap.test.d.ts +2 -0
  24. package/dist/__tests__/editor/no-wrap.test.d.ts.map +1 -0
  25. package/dist/__tests__/editor/no-wrap.test.js +43 -0
  26. package/dist/__tests__/editor/no-wrap.test.js.map +1 -0
  27. package/dist/__tests__/editor/noWrap.test.d.ts +2 -0
  28. package/dist/__tests__/editor/noWrap.test.d.ts.map +1 -0
  29. package/dist/__tests__/editor/noWrap.test.js +62 -0
  30. package/dist/__tests__/editor/noWrap.test.js.map +1 -0
  31. package/dist/__tests__/tsconfig.tsbuildinfo +1 -1
  32. package/dist/__tests__/utils/EditableGradingInstructionsWrapper.d.ts +1 -0
  33. package/dist/__tests__/utils/EditableGradingInstructionsWrapper.d.ts.map +1 -0
  34. package/dist/__tests__/utils/EditableGradingInstructionsWrapper.js +2 -0
  35. package/dist/__tests__/utils/EditableGradingInstructionsWrapper.js.map +1 -0
  36. package/dist/__tests__/utils/renderEditableGradingInstruction.d.ts +2 -0
  37. package/dist/__tests__/utils/renderEditableGradingInstruction.d.ts.map +1 -0
  38. package/dist/__tests__/utils/renderEditableGradingInstruction.js +16 -0
  39. package/dist/__tests__/utils/renderEditableGradingInstruction.js.map +1 -0
  40. package/dist/__tests__/utils/renderEditableGradingInstructions.d.ts +1 -0
  41. package/dist/__tests__/utils/renderEditableGradingInstructions.d.ts.map +1 -0
  42. package/dist/__tests__/utils/renderEditableGradingInstructions.js +2 -0
  43. package/dist/__tests__/utils/renderEditableGradingInstructions.js.map +1 -0
  44. package/dist/components/LexicalEditor.d.ts +3 -0
  45. package/dist/components/LexicalEditor.d.ts.map +1 -0
  46. package/dist/components/LexicalEditor.js +44 -0
  47. package/dist/components/LexicalEditor.js.map +1 -0
  48. package/dist/components/RTE.d.ts +3 -0
  49. package/dist/components/RTE.d.ts.map +1 -0
  50. package/dist/components/RTE.js +23 -0
  51. package/dist/components/RTE.js.map +1 -0
  52. package/dist/components/TablePlugin.d.ts +1 -0
  53. package/dist/components/TablePlugin.d.ts.map +1 -0
  54. package/dist/components/TablePlugin.js +2 -0
  55. package/dist/components/TablePlugin.js.map +1 -0
  56. package/dist/components/ToolBarPlugin.d.ts +10 -0
  57. package/dist/components/ToolBarPlugin.d.ts.map +1 -0
  58. package/dist/components/ToolBarPlugin.js +111 -0
  59. package/dist/components/ToolBarPlugin.js.map +1 -0
  60. package/dist/components/context/AnnotationContext.d.ts +8 -0
  61. package/dist/components/context/AnnotationContext.d.ts.map +1 -0
  62. package/dist/components/context/AnnotationContext.js +3 -0
  63. package/dist/components/context/AnnotationContext.js.map +1 -0
  64. package/dist/components/context/CommonExamContext.d.ts +0 -1
  65. package/dist/components/context/CommonExamContext.d.ts.map +1 -1
  66. package/dist/components/context/CommonExamContext.js +0 -3
  67. package/dist/components/context/CommonExamContext.js.map +1 -1
  68. package/dist/components/exam/ExamineExam.d.ts +5 -0
  69. package/dist/components/exam/ExamineExam.d.ts.map +1 -0
  70. package/dist/components/exam/ExamineExam.js +20 -0
  71. package/dist/components/exam/ExamineExam.js.map +1 -0
  72. package/dist/components/exam/FinishExam.d.ts +5 -0
  73. package/dist/components/exam/FinishExam.d.ts.map +1 -0
  74. package/dist/components/exam/FinishExam.js +17 -0
  75. package/dist/components/exam/FinishExam.js.map +1 -0
  76. package/dist/components/grading/reactAnnotation.d.ts +4 -0
  77. package/dist/components/grading/reactAnnotation.d.ts.map +1 -0
  78. package/dist/components/grading/reactAnnotation.js +54 -0
  79. package/dist/components/grading/reactAnnotation.js.map +1 -0
  80. package/dist/components/grading-instructions/AnswerGradingInstruction.d.ts.map +1 -1
  81. package/dist/components/grading-instructions/AnswerGradingInstruction.js +2 -7
  82. package/dist/components/grading-instructions/AnswerGradingInstruction.js.map +1 -1
  83. package/dist/components/grading-instructions/EditableGradingInstruction.d.ts.map +1 -1
  84. package/dist/components/grading-instructions/EditableGradingInstruction.js +56 -12
  85. package/dist/components/grading-instructions/EditableGradingInstruction.js.map +1 -1
  86. package/dist/components/grading-instructions/ExamGradingInstruction.d.ts.map +1 -1
  87. package/dist/components/grading-instructions/ExamGradingInstruction.js +2 -7
  88. package/dist/components/grading-instructions/ExamGradingInstruction.js.map +1 -1
  89. package/dist/components/grading-instructions/GradingInstructions.d.ts +1 -2
  90. package/dist/components/grading-instructions/GradingInstructions.d.ts.map +1 -1
  91. package/dist/components/grading-instructions/GradingInstructions.js +15 -18
  92. package/dist/components/grading-instructions/GradingInstructions.js.map +1 -1
  93. package/dist/components/grading-instructions/SlateTableEditor.d.ts +22 -0
  94. package/dist/components/grading-instructions/SlateTableEditor.d.ts.map +1 -0
  95. package/dist/components/grading-instructions/SlateTableEditor.js +44 -0
  96. package/dist/components/grading-instructions/SlateTableEditor.js.map +1 -0
  97. package/dist/components/grading-instructions/SlateUtils.d.ts +5 -0
  98. package/dist/components/grading-instructions/SlateUtils.d.ts.map +1 -0
  99. package/dist/components/grading-instructions/SlateUtils.js +28 -0
  100. package/dist/components/grading-instructions/SlateUtils.js.map +1 -0
  101. package/dist/components/grading-instructions/editor/FormatButton.d.ts +4 -2
  102. package/dist/components/grading-instructions/editor/FormatButton.d.ts.map +1 -1
  103. package/dist/components/grading-instructions/editor/FormatButton.js +5 -2
  104. package/dist/components/grading-instructions/editor/FormatButton.js.map +1 -1
  105. package/dist/components/grading-instructions/editor/Formula.d.ts +17 -0
  106. package/dist/components/grading-instructions/editor/Formula.d.ts.map +1 -0
  107. package/dist/components/grading-instructions/editor/Formula.js +81 -0
  108. package/dist/components/grading-instructions/editor/Formula.js.map +1 -0
  109. package/dist/components/grading-instructions/editor/FormulaPopup.d.ts +7 -0
  110. package/dist/components/grading-instructions/editor/FormulaPopup.d.ts.map +1 -0
  111. package/dist/components/grading-instructions/editor/FormulaPopup.js +49 -0
  112. package/dist/components/grading-instructions/editor/FormulaPopup.js.map +1 -0
  113. package/dist/components/grading-instructions/editor/MathPopup.d.ts +10 -0
  114. package/dist/components/grading-instructions/editor/MathPopup.d.ts.map +1 -0
  115. package/dist/components/grading-instructions/editor/MathPopup.js +94 -0
  116. package/dist/components/grading-instructions/editor/MathPopup.js.map +1 -0
  117. package/dist/components/grading-instructions/editor/NBSP.d.ts +4 -0
  118. package/dist/components/grading-instructions/editor/NBSP.d.ts.map +1 -0
  119. package/dist/components/grading-instructions/editor/NBSP.js +17 -0
  120. package/dist/components/grading-instructions/editor/NBSP.js.map +1 -0
  121. package/dist/components/grading-instructions/editor/Table.d.ts.map +1 -1
  122. package/dist/components/grading-instructions/editor/Table.js +24 -5
  123. package/dist/components/grading-instructions/editor/Table.js.map +1 -1
  124. package/dist/components/grading-instructions/editor/math-svg.d.ts +2 -0
  125. package/dist/components/grading-instructions/editor/math-svg.d.ts.map +1 -0
  126. package/dist/components/grading-instructions/editor/math-svg.js +22 -0
  127. package/dist/components/grading-instructions/editor/math-svg.js.map +1 -0
  128. package/dist/components/grading-instructions/editor/math.d.ts +4 -0
  129. package/dist/components/grading-instructions/editor/math.d.ts.map +1 -0
  130. package/dist/components/grading-instructions/editor/math.js +55 -0
  131. package/dist/components/grading-instructions/editor/math.js.map +1 -0
  132. package/dist/components/grading-instructions/editor/noWrap.d.ts +3 -0
  133. package/dist/components/grading-instructions/editor/noWrap.d.ts.map +1 -0
  134. package/dist/components/grading-instructions/editor/noWrap.js +13 -0
  135. package/dist/components/grading-instructions/editor/noWrap.js.map +1 -0
  136. package/dist/components/grading-instructions/editor/spanWithClass.d.ts +3 -0
  137. package/dist/components/grading-instructions/editor/spanWithClass.d.ts.map +1 -0
  138. package/dist/components/grading-instructions/editor/spanWithClass.js +19 -0
  139. package/dist/components/grading-instructions/editor/spanWithClass.js.map +1 -0
  140. package/dist/components/grading-instructions/editor/spanWithNowrap.d.ts +3 -0
  141. package/dist/components/grading-instructions/editor/spanWithNowrap.d.ts.map +1 -0
  142. package/dist/components/grading-instructions/editor/spanWithNowrap.js +19 -0
  143. package/dist/components/grading-instructions/editor/spanWithNowrap.js.map +1 -0
  144. package/dist/components/grading-instructions/prosemirror.d.ts +8 -0
  145. package/dist/components/grading-instructions/prosemirror.d.ts.map +1 -0
  146. package/dist/components/grading-instructions/prosemirror.js +108 -0
  147. package/dist/components/grading-instructions/prosemirror.js.map +1 -0
  148. package/dist/components/results/isExamFinishPageHook.d.ts +2 -0
  149. package/dist/components/results/isExamFinishPageHook.d.ts.map +1 -0
  150. package/dist/components/results/isExamFinishPageHook.js +7 -0
  151. package/dist/components/results/isExamFinishPageHook.js.map +1 -0
  152. package/dist/components/shared/CreateAnnotationPopup.d.ts +6 -0
  153. package/dist/components/shared/CreateAnnotationPopup.d.ts.map +1 -0
  154. package/dist/components/shared/CreateAnnotationPopup.js +11 -0
  155. package/dist/components/shared/CreateAnnotationPopup.js.map +1 -0
  156. package/dist/components/shared/Popup.d.ts +15 -0
  157. package/dist/components/shared/Popup.d.ts.map +1 -0
  158. package/dist/components/shared/Popup.js +90 -0
  159. package/dist/components/shared/Popup.js.map +1 -0
  160. package/dist/components/shared/PopupUtils.d.ts +4 -0
  161. package/dist/components/shared/PopupUtils.d.ts.map +1 -0
  162. package/dist/components/shared/PopupUtils.js +26 -0
  163. package/dist/components/shared/PopupUtils.js.map +1 -0
  164. package/dist/dom-utils.d.ts.map +1 -1
  165. package/dist/dom-utils.js +4 -2
  166. package/dist/dom-utils.js.map +1 -1
  167. package/dist/main-bundle.js +1 -1
  168. package/dist/main-bundle.js.LICENSE.txt +1 -1
  169. package/dist/main.css +1 -1
  170. package/dist/store/listenerMiddleware.d.ts +89 -0
  171. package/dist/store/listenerMiddleware.d.ts.map +1 -0
  172. package/dist/store/listenerMiddleware.js +6 -0
  173. package/dist/store/listenerMiddleware.js.map +1 -0
  174. package/package.json +3 -10
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const react_1 = require("@testing-library/react");
4
+ const prosemirror_1 = require("../utils/prosemirror");
5
+ const renderEditableGradingInstruction_1 = require("../utils/renderEditableGradingInstruction");
6
+ const act = react_1.act;
7
+ describe('Editor - e-nowrap', () => {
8
+ let cleanup;
9
+ let onContentChangeMock;
10
+ beforeEach(() => {
11
+ onContentChangeMock = jest.fn();
12
+ cleanup = (0, prosemirror_1.mockCreateRange)();
13
+ });
14
+ afterEach(() => {
15
+ if (cleanup) {
16
+ cleanup();
17
+ }
18
+ cleanup = null;
19
+ });
20
+ it('e-nowrap is rendered and returned as expected outside paragraph', async () => {
21
+ const inputData = '<p>bar</p><span class="e-nowrap">foo</span>';
22
+ const expectedDom = '<p>foo</p><p><span class="e-nowrap">foo</span></p>';
23
+ const expectedOutput = '<p>foo</p><p><span class="e-nowrap">foo</span></p>';
24
+ const result = (0, renderEditableGradingInstruction_1.renderGradingInstruction)(inputData, onContentChangeMock);
25
+ await act(async () => {
26
+ insertText(await result.findByText('bar'), 'foo');
27
+ });
28
+ const element = result.container.querySelector('.ProseMirror');
29
+ expect(element.innerHTML).toBe(expectedDom);
30
+ expect(onContentChangeMock).toHaveBeenCalledWith(expectedOutput, '');
31
+ });
32
+ it('e:formula is rendered as expected when wrapped inside e-nowrap', async () => {
33
+ const inputData = '<p>bar</p><span class="e-nowrap"><e:formula data-editor-id=e-formula>foo</e:formula></span>';
34
+ const expectedDom = '<p>foo</p><p><span class="e-nowrap"><img alt="foo" src="/math.svg?latex=foo"><img class="ProseMirror-separator" alt=""></span><br class="ProseMirror-trailingBreak"></p>';
35
+ const expectedOutput = '<p>foo</p><p><span class="e-nowrap"><e:formula>foo</e:formula></span></p>';
36
+ const result = (0, renderEditableGradingInstruction_1.renderGradingInstruction)(inputData, onContentChangeMock);
37
+ await act(async () => {
38
+ insertText(await result.findByText('bar'), 'foo');
39
+ });
40
+ const element = result.container.querySelector('.ProseMirror');
41
+ expect(element.innerHTML).toBe(expectedDom);
42
+ expect(onContentChangeMock).toHaveBeenCalledWith(expectedOutput, '');
43
+ });
44
+ it('e-nowrap is rendered as expected inside paragraph', async () => {
45
+ const inputData = '<p>bar</p><p><span class="e-nowrap">foo</span></p>';
46
+ const expectedDom = '<p>foo</p><p><span class="e-nowrap">foo</span></p>';
47
+ const expectedOutput = '<p>foo</p><p><span class="e-nowrap">foo</span></p>';
48
+ const result = (0, renderEditableGradingInstruction_1.renderGradingInstruction)(inputData, onContentChangeMock);
49
+ await act(async () => {
50
+ insertText(await result.findByText('bar'), 'foo');
51
+ });
52
+ const element = result.container.querySelector('.ProseMirror');
53
+ expect(element.innerHTML).toBe(expectedDom);
54
+ expect(onContentChangeMock).toHaveBeenCalledWith(expectedOutput, '');
55
+ });
56
+ });
57
+ function insertText(element, text) {
58
+ react_1.fireEvent.input(element, {
59
+ target: { innerText: text, innerHTML: text }
60
+ });
61
+ }
62
+ //# sourceMappingURL=noWrap.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"noWrap.test.js","sourceRoot":"","sources":["../../../__tests__/editor/noWrap.test.tsx"],"names":[],"mappings":";;AAAA,kDAAkE;AAClE,sDAAsD;AACtD,gGAAoF;AAEpF,MAAM,GAAG,GAAG,WAAuD,CAAA;AAEnE,QAAQ,CAAC,mBAAmB,EAAE,GAAG,EAAE;IACjC,IAAI,OAA4B,CAAA;IAChC,IAAI,mBAA8B,CAAA;IAElC,UAAU,CAAC,GAAG,EAAE;QACd,mBAAmB,GAAG,IAAI,CAAC,EAAE,EAAE,CAAA;QAC/B,OAAO,GAAG,IAAA,6BAAe,GAAE,CAAA;IAC7B,CAAC,CAAC,CAAA;IAEF,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,OAAO,EAAE,CAAC;YACZ,OAAO,EAAE,CAAA;QACX,CAAC;QACD,OAAO,GAAG,IAAI,CAAA;IAChB,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,iEAAiE,EAAE,KAAK,IAAI,EAAE;QAC/E,MAAM,SAAS,GAAG,6CAA6C,CAAA;QAC/D,MAAM,WAAW,GAAG,oDAAoD,CAAA;QACxE,MAAM,cAAc,GAAG,oDAAoD,CAAA;QAC3E,MAAM,MAAM,GAAG,IAAA,2DAAwB,EAAC,SAAS,EAAE,mBAAmB,CAAC,CAAA;QACvE,MAAM,GAAG,CAAC,KAAK,IAAI,EAAE;YACnB,UAAU,CAAC,MAAM,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,CAAA;QACnD,CAAC,CAAC,CAAA;QACF,MAAM,OAAO,GAAG,MAAM,CAAC,SAAS,CAAC,aAAa,CAAC,cAAc,CAAC,CAAA;QAC9D,MAAM,CAAC,OAAQ,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,WA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