@digabi/exam-engine-core 22.1.3-alpha.2 → 22.1.4-alpha.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (99) hide show
  1. package/dist/__tests__/EditableGradingInstruction.test.js +3 -7
  2. package/dist/__tests__/EditableGradingInstruction.test.js.map +1 -1
  3. package/dist/__tests__/editor/FormatButton.test.d.ts +2 -0
  4. package/dist/__tests__/editor/FormatButton.test.d.ts.map +1 -0
  5. package/dist/__tests__/editor/FormatButton.test.js +97 -0
  6. package/dist/__tests__/editor/FormatButton.test.js.map +1 -0
  7. package/dist/__tests__/editor/Formula.test.js +15 -8
  8. package/dist/__tests__/editor/Formula.test.js.map +1 -1
  9. package/dist/__tests__/editor/ImageUploadButton.test.d.ts +2 -0
  10. package/dist/__tests__/editor/ImageUploadButton.test.d.ts.map +1 -0
  11. package/dist/__tests__/editor/ImageUploadButton.test.js +69 -0
  12. package/dist/__tests__/editor/ImageUploadButton.test.js.map +1 -0
  13. package/dist/__tests__/editor/br.test.js +2 -6
  14. package/dist/__tests__/editor/br.test.js.map +1 -1
  15. package/dist/__tests__/editor/hr.test.js +2 -6
  16. package/dist/__tests__/editor/hr.test.js.map +1 -1
  17. package/dist/__tests__/editor/nbsp.test.js +3 -7
  18. package/dist/__tests__/editor/nbsp.test.js.map +1 -1
  19. package/dist/__tests__/tsconfig.tsbuildinfo +1 -1
  20. package/dist/__tests__/utils/prosemirror.d.ts +0 -1
  21. package/dist/__tests__/utils/prosemirror.d.ts.map +1 -1
  22. package/dist/__tests__/utils/prosemirror.js +0 -8
  23. package/dist/__tests__/utils/prosemirror.js.map +1 -1
  24. package/dist/__tests__/utils/renderEditableGradingInstruction.d.ts +2 -0
  25. package/dist/__tests__/utils/renderEditableGradingInstruction.d.ts.map +1 -1
  26. package/dist/__tests__/utils/renderEditableGradingInstruction.js +8 -2
  27. package/dist/__tests__/utils/renderEditableGradingInstruction.js.map +1 -1
  28. package/dist/__tests__/utils/util.d.ts +2 -0
  29. package/dist/__tests__/utils/util.d.ts.map +1 -0
  30. package/dist/__tests__/utils/util.js +10 -0
  31. package/dist/__tests__/utils/util.js.map +1 -0
  32. package/dist/components/context/AttachmentContext.d.ts.map +1 -1
  33. package/dist/components/context/ExamContext.d.ts.map +1 -1
  34. package/dist/components/context/GradingInstructionContext.d.ts +2 -2
  35. package/dist/components/context/GradingInstructionContext.d.ts.map +1 -1
  36. package/dist/components/context/QuestionContext.d.ts.map +1 -1
  37. package/dist/components/context/ResultsContext.d.ts.map +1 -1
  38. package/dist/components/context/SectionContext.d.ts.map +1 -1
  39. package/dist/components/grading-instructions/EditableGradingInstruction.d.ts.map +1 -1
  40. package/dist/components/grading-instructions/EditableGradingInstruction.js +37 -55
  41. package/dist/components/grading-instructions/EditableGradingInstruction.js.map +1 -1
  42. package/dist/components/grading-instructions/ExamGradingInstruction.d.ts.map +1 -1
  43. package/dist/components/grading-instructions/ExamGradingInstruction.js +7 -2
  44. package/dist/components/grading-instructions/ExamGradingInstruction.js.map +1 -1
  45. package/dist/components/grading-instructions/GradingInstructionProvider.d.ts +1 -1
  46. package/dist/components/grading-instructions/GradingInstructionProvider.d.ts.map +1 -1
  47. package/dist/components/grading-instructions/GradingInstructionProvider.js +2 -2
  48. package/dist/components/grading-instructions/GradingInstructionProvider.js.map +1 -1
  49. package/dist/components/grading-instructions/GradingInstructions.d.ts +1 -1
  50. package/dist/components/grading-instructions/GradingInstructions.js +2 -2
  51. package/dist/components/grading-instructions/GradingInstructions.js.map +1 -1
  52. package/dist/components/grading-instructions/editor/Formula.d.ts +1 -0
  53. package/dist/components/grading-instructions/editor/Formula.d.ts.map +1 -1
  54. package/dist/components/grading-instructions/editor/Formula.js +17 -4
  55. package/dist/components/grading-instructions/editor/Formula.js.map +1 -1
  56. package/dist/components/grading-instructions/editor/ImageUploadButton.d.ts +6 -0
  57. package/dist/components/grading-instructions/editor/ImageUploadButton.d.ts.map +1 -0
  58. package/dist/components/grading-instructions/editor/ImageUploadButton.js +73 -0
  59. package/dist/components/grading-instructions/editor/ImageUploadButton.js.map +1 -0
  60. package/dist/components/grading-instructions/editor/schemas/image-schema.d.ts +4 -0
  61. package/dist/components/grading-instructions/editor/schemas/image-schema.d.ts.map +1 -0
  62. package/dist/components/grading-instructions/editor/schemas/image-schema.js +47 -0
  63. package/dist/components/grading-instructions/editor/schemas/image-schema.js.map +1 -0
  64. package/dist/main-bundle.js +1 -1
  65. package/dist/main-bundle.js.LICENSE.txt +1 -1
  66. package/dist/main.css +1 -1
  67. package/package.json +2 -2
  68. package/dist/components/Localization.d.ts +0 -5
  69. package/dist/components/Localization.d.ts.map +0 -1
  70. package/dist/components/Localization.js +0 -9
  71. package/dist/components/Localization.js.map +0 -1
  72. package/dist/components/grading-instructions/GradingInstruction.d.ts +0 -7
  73. package/dist/components/grading-instructions/GradingInstruction.d.ts.map +0 -1
  74. package/dist/components/grading-instructions/GradingInstruction.js +0 -9
  75. package/dist/components/grading-instructions/GradingInstruction.js.map +0 -1
  76. package/dist/components/grading-instructions/editor/CurrentElement.d.ts +0 -2
  77. package/dist/components/grading-instructions/editor/CurrentElement.d.ts.map +0 -1
  78. package/dist/components/grading-instructions/editor/CurrentElement.js +0 -8
  79. package/dist/components/grading-instructions/editor/CurrentElement.js.map +0 -1
  80. package/dist/components/grading-instructions/editor/CurrentLocalization.d.ts +0 -5
  81. package/dist/components/grading-instructions/editor/CurrentLocalization.d.ts.map +0 -1
  82. package/dist/components/grading-instructions/editor/CurrentLocalization.js +0 -17
  83. package/dist/components/grading-instructions/editor/CurrentLocalization.js.map +0 -1
  84. package/dist/components/grading-instructions/editor/Localization.d.ts +0 -3
  85. package/dist/components/grading-instructions/editor/Localization.d.ts.map +0 -1
  86. package/dist/components/grading-instructions/editor/Localization.js +0 -36
  87. package/dist/components/grading-instructions/editor/Localization.js.map +0 -1
  88. package/dist/components/grading-instructions/editor/localizatio.d.ts +0 -3
  89. package/dist/components/grading-instructions/editor/localizatio.d.ts.map +0 -1
  90. package/dist/components/grading-instructions/editor/localizatio.js +0 -36
  91. package/dist/components/grading-instructions/editor/localizatio.js.map +0 -1
  92. package/dist/components/grading-instructions/editor/localizationSpan.d.ts +0 -3
  93. package/dist/components/grading-instructions/editor/localizationSpan.d.ts.map +0 -1
  94. package/dist/components/grading-instructions/editor/localizationSpan.js +0 -36
  95. package/dist/components/grading-instructions/editor/localizationSpan.js.map +0 -1
  96. package/dist/components/grading-instructions/editor/spanWithPath.d.ts +0 -3
  97. package/dist/components/grading-instructions/editor/spanWithPath.d.ts.map +0 -1
  98. package/dist/components/grading-instructions/editor/spanWithPath.js +0 -24
  99. package/dist/components/grading-instructions/editor/spanWithPath.js.map +0 -1
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const react_1 = require("@testing-library/react");
7
7
  const user_event_1 = __importDefault(require("@testing-library/user-event"));
8
8
  const renderEditableGradingInstruction_1 = require("./utils/renderEditableGradingInstruction");
9
+ const util_1 = require("./utils/util");
9
10
  const act = react_1.act;
10
11
  describe('EditableGradingInstruction', () => {
11
12
  let cleanup;
@@ -33,7 +34,7 @@ describe('EditableGradingInstruction', () => {
33
34
  const expectedOutput = '<table class="e-table"><tbody><tr><td>bar</td></tr></tbody></table>';
34
35
  const result = (0, renderEditableGradingInstruction_1.renderGradingInstruction)(inputData, onContentChangeMock);
35
36
  await act(async () => {
36
- insertText(await result.findByText('foo'), 'bar');
37
+ (0, util_1.insertText)(await result.findByText('foo'), 'bar');
37
38
  });
38
39
  expect(onContentChangeMock).toHaveBeenCalledTimes(1);
39
40
  expect(onContentChangeMock).toHaveBeenCalledWith(expectedOutput, '');
@@ -135,12 +136,7 @@ async function clickTableMenuButtonWithFocusOnCell(result, cellText, buttonText)
135
136
  async function focusOnTablesCell(result, text) {
136
137
  // Replace cell's text with same text
137
138
  // Hack to get focus on cell without need to mock createRange
138
- insertText(await result.findByText(text), text);
139
- }
140
- function insertText(element, text) {
141
- react_1.fireEvent.input(element, {
142
- target: { innerText: text, innerHTML: text }
143
- });
139
+ (0, util_1.insertText)(await result.findByText(text), text);
144
140
  }
145
141
  function mockCreateRange() {
146
142
  const originalCreateRange = global.window.document.createRange;
@@ -1 +1 @@
1
- {"version":3,"file":"EditableGradingInstruction.test.js","sourceRoot":"","sources":["../../__tests__/EditableGradingInstruction.test.tsx"],"names":[],"mappings":";;;;;AAAA,kDAAgF;AAChF,6EAAmD;AACnD,+FAAmF;AAEnF,MAAM,GAAG,GAAG,WAAuD,CAAA;AAEnE,QAAQ,CAAC,4BAA4B,EAAE,GAAG,EAAE;IAC1C,IAAI,OAA4B,CAAA;IAChC,IAAI,mBAA8B,CAAA;IAElC,UAAU,CAAC,GAAG,EAAE;QACd,mBAAmB,GAAG,IAAI,CAAC,EAAE,EAAE,CAAA;IACjC,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,QAAQ,CAAC,OAAO,EAAE,GAAG,EAAE;QACrB,EAAE,CAAC,+BAA+B,EAAE,GAAG,EAAE;YACvC,MAAM,SAAS,GAAG,qEAAqE,CAAA;YACvF,MAAM,cAAc,GAAG,qEAAqE,CAAA;YAC5F,MAAM,MAAM,GAAG,IAAA,2DAAwB,EAAC,SAAS,CAAC,CAAA;YAClD,MAAM,KAAK,GAAG,MAAM,CAAC,SAAS,CAAC,aAAa,CAAC,cAAc,CAAC,CAAA;YAC5D,MAAM,CAAC,KAAM,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,CAAA;QAC/C,CAAC,CAAC,CAAA;QAEF,EAAE,CAAC,yCAAyC,EAAE,KAAK,IAAI,EAAE;YACvD,OAAO,GAAG,eAAe,EAAE,CAAA;YAC3B,MAAM,SAAS,GAAG,qEAAqE,CAAA;YACvF,MAAM,cAAc,GAAG,qEAAqE,CAAA;YAC5F,MAAM,MAAM,GAAG,IAAA,2DAA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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"}
1
+ {"version":3,"file":"EditableGradingInstruction.test.js","sourceRoot":"","sources":["../../__tests__/EditableGradingInstruction.test.tsx"],"names":[],"mappings":";;;;;AAAA,kDAAqE;AACrE,6EAAmD;AACnD,+FAAmF;AACnF,uCAAyC;AAEzC,MAAM,GAAG,GAAG,WAAuD,CAAA;AAEnE,QAAQ,CAAC,4BAA4B,EAAE,GAAG,EAAE;IAC1C,IAAI,OAA4B,CAAA;IAChC,IAAI,mBAA8B,CAAA;IAElC,UAAU,CAAC,GAAG,EAAE;QACd,mBAAmB,GAAG,IAAI,CAAC,EAAE,EAAE,CAAA;IACjC,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,QAAQ,CAAC,OAAO,EAAE,GAAG,EAAE;QACrB,EA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Ae;IACtB,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,2 @@
1
+ import '@testing-library/jest-dom';
2
+ //# sourceMappingURL=FormatButton.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FormatButton.test.d.ts","sourceRoot":"","sources":["../../../__tests__/editor/FormatButton.test.tsx"],"names":[],"mappings":"AACA,OAAO,2BAA2B,CAAA"}
@@ -0,0 +1,97 @@
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
+ const react_1 = __importDefault(require("react"));
7
+ require("@testing-library/jest-dom");
8
+ const react_2 = require("@testing-library/react");
9
+ const ProseMirrorWrapper_1 = __importDefault(require("../utils/ProseMirrorWrapper"));
10
+ const prosemirror_1 = require("../utils/prosemirror");
11
+ const FormatButton_1 = __importDefault(require("../../src/components/grading-instructions/editor/FormatButton"));
12
+ const user_event_1 = __importDefault(require("@testing-library/user-event"));
13
+ const util_1 = require("../utils/util");
14
+ const act = react_2.act;
15
+ describe('FormatButton', () => {
16
+ beforeAll(() => {
17
+ (0, prosemirror_1.mockCreateRange)();
18
+ });
19
+ afterEach(() => {
20
+ (0, react_2.cleanup)();
21
+ });
22
+ describe('Italics', () => {
23
+ it('Renders italics button', () => {
24
+ const props = { markName: 'em', displayName: 'Italic' };
25
+ const { button } = renderEditorWithFormatButton(props);
26
+ expect(button).toHaveTextContent(props.displayName);
27
+ });
28
+ it('Toggles button active state when clicked', async () => {
29
+ const props = { markName: 'em', displayName: 'Italic' };
30
+ const { button } = renderEditorWithFormatButton(props);
31
+ expect(button).toHaveStyle('font-weight: normal');
32
+ await user_event_1.default.click(button);
33
+ expect(button).toHaveStyle('font-weight: bold');
34
+ await user_event_1.default.click(button);
35
+ expect(button).toHaveStyle('font-weight: normal');
36
+ });
37
+ it('formats text', async () => {
38
+ const props = { markName: 'em', displayName: 'Italic' };
39
+ const { button, paragraph, container } = renderEditorWithFormatButton(props);
40
+ await user_event_1.default.click(button);
41
+ await act(async () => (0, util_1.insertText)(await container.findByRole('paragraph'), 'hello'));
42
+ expect((0, react_2.within)(paragraph).getByRole('emphasis')).toHaveTextContent('hello');
43
+ });
44
+ it('em tags are rendered as italic', () => {
45
+ const props = { markName: 'em', displayName: 'Italic', innerHtml: '<em>Italic text</em>' };
46
+ const { paragraph } = renderEditorWithFormatButton(props);
47
+ expect((0, react_2.within)(paragraph).getByRole('emphasis')).toHaveTextContent('Italic text');
48
+ });
49
+ it('i tags are rendered as italic', () => {
50
+ const props = { markName: 'em', displayName: 'Italic', innerHtml: '<i>Italic text</i>' };
51
+ const { paragraph } = renderEditorWithFormatButton(props);
52
+ expect((0, react_2.within)(paragraph).getByRole('emphasis')).toHaveTextContent('Italic text');
53
+ });
54
+ });
55
+ describe('Bold', () => {
56
+ it('Renders bold button', () => {
57
+ const props = { markName: 'strong', displayName: 'Bold' };
58
+ const { button } = renderEditorWithFormatButton(props);
59
+ expect(button).toHaveTextContent(props.displayName);
60
+ });
61
+ it('Toggles button active state when clicked', async () => {
62
+ const props = { markName: 'strong', displayName: 'Bold' };
63
+ const { button } = renderEditorWithFormatButton(props);
64
+ expect(button).toHaveStyle('font-weight: normal');
65
+ await user_event_1.default.click(button);
66
+ expect(button).toHaveStyle('font-weight: bold');
67
+ await user_event_1.default.click(button);
68
+ expect(button).toHaveStyle('font-weight: normal');
69
+ });
70
+ it('formats text', async () => {
71
+ const props = { markName: 'strong', displayName: 'Bold' };
72
+ const { button, container, paragraph } = renderEditorWithFormatButton(props);
73
+ await user_event_1.default.click(button);
74
+ await act(async () => {
75
+ (0, util_1.insertText)(await container.findByRole('paragraph'), 'hello');
76
+ });
77
+ expect((0, react_2.within)(paragraph).getByRole('strong')).toHaveTextContent('hello');
78
+ });
79
+ it('b tags are rendered as bold', () => {
80
+ const props = { markName: 'strong', displayName: 'bold', innerHtml: '<b>Bold text</b>' };
81
+ const { paragraph } = renderEditorWithFormatButton(props);
82
+ expect((0, react_2.within)(paragraph).getByRole('strong')).toHaveTextContent('Bold text');
83
+ });
84
+ it('strong tags are rendered as bold', () => {
85
+ const props = { markName: 'strong', displayName: 'bold', innerHtml: '<strong>Bold text</strong>' };
86
+ const { paragraph } = renderEditorWithFormatButton(props);
87
+ expect((0, react_2.within)(paragraph).getByRole('strong')).toHaveTextContent('Bold text');
88
+ });
89
+ });
90
+ function renderEditorWithFormatButton(props) {
91
+ const { markName, displayName, innerHtml = '' } = props;
92
+ const container = (0, react_2.render)(react_1.default.createElement(ProseMirrorWrapper_1.default, { innerHtml: innerHtml },
93
+ react_1.default.createElement(FormatButton_1.default, { markName: markName, displayName: displayName })));
94
+ return { button: container.getByRole('button'), paragraph: container.getByRole('paragraph'), container };
95
+ }
96
+ });
97
+ //# sourceMappingURL=FormatButton.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FormatButton.test.js","sourceRoot":"","sources":["../../../__tests__/editor/FormatButton.test.tsx"],"names":[],"mappings":";;;;;AAAA,kDAAyB;AACzB,qCAAkC;AAClC,kDAAgF;AAChF,qFAA4D;AAC5D,sDAAsD;AACtD,iHAAwF;AACxF,6EAAmD;AACnD,wCAA0C;AAE1C,MAAM,GAAG,GAAG,WAAuD,CAAA;AAEnE,QAAQ,CAAC,cAAc,EAAE,GAAG,EAAE;IAC5B,SAAS,CAAC,GAAG,EAAE;QACb,IAAA,6BAAe,GAAE,CAAA;IACnB,CAAC,CAAC,CAAA;IAEF,SAAS,CAAC,GAAG,EAAE;QACb,IAAA,eAAO,GAAE,CAAA;IACX,CAAC,CAAC,CAAA;IAEF,QAAQ,CAAC,SAAS,EAAE,GAAG,EAAE;QACvB,EAAE,CAAC,wBAAwB,EAAE,GAAG,EAAE;YAChC,MAAM,KAAK,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,CAAA;YACvD,MAAM,EAAE,MAAM,EAAE,GAAG,4BAA4B,CAAC,KAAK,CAAC,CAAA;YACtD,MAAM,CAAC,MAAM,CAAC,CAAC,iBAAiB,CAAC,KAAK,CAAC,WAAW,CAAC,CAAA;QACrD,CAAC,CAAC,CAAA;QAEF,EAAE,CAAC,0CAA0C,EAAE,KAAK,IAAI,EAAE;YACxD,MAAM,KAAK,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,E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AAE;YAC1C,MAAM,KAAK,GAAG,EAAE,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,4BAA4B,EAAE,CAAA;YAClG,MAAM,EAAE,SAAS,EAAE,GAAG,4BAA4B,CAAC,KAAK,CAAC,CAAA;YACzD,MAAM,CAAC,IAAA,cAAM,EAAC,SAAS,CAAC,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAAA;QAC9E,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;IAEF,SAAS,4BAA4B,CAAC,KAAoE;QACxG,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,GAAG,EAAE,EAAE,GAAG,KAAK,CAAA;QACvD,MAAM,SAAS,GAAG,IAAA,cAAM,EACtB,8BAAC,4BAAkB,IAAC,SAAS,EAAE,SAAS;YACtC,8BAAC,sBAAY,IAAC,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,GAAI,CAC3C,CACtB,CAAA;QACD,OAAO,EAAE,MAAM,EAAE,SAAS,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE,SAAS,EAAE,SAAS,CAAC,SAAS,CAAC,WAAW,CAAC,EAAE,SAAS,EAAE,CAAA;IAC1G,CAAC;AACH,CAAC,CAAC,CAAA"}
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const react_1 = require("@testing-library/react");
4
4
  const prosemirror_1 = require("../utils/prosemirror");
5
5
  const renderEditableGradingInstruction_1 = require("../utils/renderEditableGradingInstruction");
6
+ const util_1 = require("../utils/util");
6
7
  const act = react_1.act;
7
8
  describe('Editor - Formula', () => {
8
9
  let cleanup;
@@ -25,19 +26,25 @@ describe('Editor - Formula', () => {
25
26
  });
26
27
  it('Change in content causes formula to be returned as expected', async () => {
27
28
  cleanup = (0, prosemirror_1.mockCreateRange)();
28
- const inputData = '<p>bar</p><p><e:formula data-editor-id="e-formula" mode="inline">foo</e:formula><e:formula data-editor-id="e-formula">bar</e:formula></p>';
29
- const expectedOutput = '<p>foo</p><p><e:formula mode="inline">foo</e:formula><e:formula>bar</e:formula></p>';
29
+ const inputData = '<p>bar</p><p><e:formula data-editor-id="e-formula" mode="inline">foo</e:formula><e:formula data-editor-id="e-formula" assistive-title="foobar">bar</e:formula></p>';
30
+ const expectedOutput = '<p>foo</p><p><e:formula mode="inline">foo</e:formula><e:formula assistive-title="foobar">bar</e:formula></p>';
30
31
  const result = (0, renderEditableGradingInstruction_1.renderGradingInstruction)(inputData, onContentChangeMock);
31
32
  await act(async () => {
32
- insertText(await result.findByText('bar'), 'foo');
33
+ (0, util_1.insertText)(await result.findByText('bar'), 'foo');
33
34
  });
34
35
  expect(onContentChangeMock).toHaveBeenCalledTimes(1);
35
36
  expect(onContentChangeMock).toHaveBeenCalledWith(expectedOutput, '');
36
37
  });
37
- });
38
- function insertText(element, text) {
39
- react_1.fireEvent.input(element, {
40
- target: { innerText: text, innerHTML: text }
38
+ it('Empty formula is removed when sending changed content', async () => {
39
+ cleanup = (0, prosemirror_1.mockCreateRange)();
40
+ const inputData = '<p>bar</p><p><e:formula data-editor-id="e-formula"></e:formula></p>';
41
+ const expectedOutput = '<p>foo</p><p></p>';
42
+ const result = (0, renderEditableGradingInstruction_1.renderGradingInstruction)(inputData, onContentChangeMock);
43
+ await act(async () => {
44
+ (0, util_1.insertText)(await result.findByText('bar'), 'foo');
45
+ });
46
+ expect(onContentChangeMock).toHaveBeenCalledTimes(1);
47
+ expect(onContentChangeMock).toHaveBeenCalledWith(expectedOutput, '');
41
48
  });
42
- }
49
+ });
43
50
  //# sourceMappingURL=Formula.test.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Formula.test.js","sourceRoot":"","sources":["../../../__tests__/editor/Formula.test.tsx"],"names":[],"mappings":";;AAAA,kDAAkE;AAClE,sDAAsD;AACtD,gGAAoF;AAEpF,MAAM,GAAG,GAAG,WAAuD,CAAA;AAE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1
+ {"version":3,"file":"ImageUploadButton.test.d.ts","sourceRoot":"","sources":["../../../__tests__/editor/ImageUploadButton.test.tsx"],"names":[],"mappings":"AAAA,OAAO,2BAA2B,CAAA"}
@@ -0,0 +1,69 @@
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
+ require("@testing-library/jest-dom");
7
+ const react_1 = require("@testing-library/react");
8
+ const prosemirror_1 = require("../utils/prosemirror");
9
+ const renderEditableGradingInstruction_1 = require("../utils/renderEditableGradingInstruction");
10
+ const user_event_1 = __importDefault(require("@testing-library/user-event"));
11
+ const util_1 = require("../utils/util");
12
+ const prosemirror_view_1 = require("prosemirror-view");
13
+ jest.spyOn(prosemirror_view_1.EditorView.prototype, 'focus').mockImplementation(() => { });
14
+ const act = react_1.act;
15
+ describe('ImageUploadButton', () => {
16
+ let onContentChangeMock;
17
+ const mockedTempUrl = 'mocked-temp-url';
18
+ beforeEach(() => {
19
+ onContentChangeMock = jest.fn();
20
+ });
21
+ beforeAll(() => {
22
+ (0, prosemirror_1.mockCreateRange)();
23
+ global.URL.createObjectURL = jest.fn(() => mockedTempUrl);
24
+ File.prototype.arrayBuffer = jest.fn().mockResolvedValue(new ArrayBuffer(8));
25
+ });
26
+ afterEach(() => {
27
+ (0, react_1.cleanup)();
28
+ });
29
+ describe('Renders Image', () => {
30
+ const htmlAttrs = {
31
+ width: '504',
32
+ height: '504',
33
+ class: 'foo',
34
+ lang: 'fi-FI',
35
+ src: `/${renderEditableGradingInstruction_1.mockedResolvedPath}/foo.bar`
36
+ };
37
+ const xmlAttrs = {
38
+ lang: htmlAttrs.lang,
39
+ class: htmlAttrs.class,
40
+ src: 'foo.bar'
41
+ };
42
+ it('e:image tags are rendered in and rendered out with correct attributes and tags', async () => {
43
+ const container = (0, renderEditableGradingInstruction_1.renderGradingInstruction)(`<div><p>hello</p><e:image data-editor-id="e-image" width=${htmlAttrs.width} height=${htmlAttrs.height} lang=${htmlAttrs.lang} class=${htmlAttrs.class} src=${xmlAttrs.src}></e:image></div>`, onContentChangeMock);
44
+ const image = container.getByRole('img');
45
+ for (const [key, value] of Object.entries(htmlAttrs)) {
46
+ expect(image).toHaveAttribute(key, value);
47
+ }
48
+ await act(async () => {
49
+ (0, util_1.insertText)(await container.findByText('hello'), 'hello world');
50
+ });
51
+ expect(onContentChangeMock).toHaveBeenCalledTimes(1);
52
+ expect(onContentChangeMock).toHaveBeenCalledWith(`<p>hello world</p><p><e:image lang="${xmlAttrs.lang}" class="${xmlAttrs.class}" src="${xmlAttrs.src}"></e:image></p>`, '');
53
+ });
54
+ it('image can be uploaded', async () => {
55
+ const container = (0, renderEditableGradingInstruction_1.renderGradingInstruction)('', onContentChangeMock);
56
+ const file = new File(['hello'], 'hello.png', { type: 'image/png' });
57
+ const input = container.queryByTestId('image-upload-button');
58
+ await user_event_1.default.upload(input, file);
59
+ await (0, react_1.waitFor)(() => {
60
+ expect(onContentChangeMock).toHaveBeenCalledTimes(2);
61
+ expect(onContentChangeMock).toHaveBeenNthCalledWith(1, `<p><e:image src="${mockedTempUrl}"></e:image></p>`, '');
62
+ expect(onContentChangeMock).toHaveBeenNthCalledWith(2, `<p><e:image src="${renderEditableGradingInstruction_1.mockedPermanentUrl}"></e:image></p>`, '');
63
+ const image = container.getByRole('img');
64
+ expect(image).toHaveAttribute('src', `/${renderEditableGradingInstruction_1.mockedResolvedPath}/${renderEditableGradingInstruction_1.mockedPermanentUrl}`);
65
+ });
66
+ });
67
+ });
68
+ });
69
+ //# sourceMappingURL=ImageUploadButton.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ImageUploadButton.test.js","sourceRoot":"","sources":["../../../__tests__/editor/ImageUploadButton.test.tsx"],"names":[],"mappings":";;;;;AAAA,qCAAkC;AAClC,kDAAyE;AACzE,sDAAsD;AACtD,gGAIkD;AAClD,6EAAmD;AACnD,wCAA0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AM,IAAA,eAAO,EAAC,GAAG,EAAE;gBACjB,MAAM,CAAC,mBAAmB,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAA;gBACpD,MAAM,CAAC,mBAAmB,CAAC,CAAC,uBAAuB,CAAC,CAAC,EAAE,oBAAoB,aAAa,kBAAkB,EAAE,EAAE,CAAC,CAAA;gBAC/G,MAAM,CAAC,mBAAmB,CAAC,CAAC,uBAAuB,CACjD,CAAC,EACD,oBAAoB,qDAAkB,kBAAkB,EACxD,EAAE,CACH,CAAA;gBACD,MAAM,KAAK,GAAG,SAAS,CAAC,SAAS,CAAC,KAAK,CAAC,CAAA;gBACxC,MAAM,CAAC,KAAK,CAAC,CAAC,eAAe,CAAC,KAAK,EAAE,IAAI,qDAAkB,IAAI,qDAAkB,EAAE,CAAC,CAAA;YACtF,CAAC,CAAC,CAAA;QACJ,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const react_1 = require("@testing-library/react");
4
4
  const prosemirror_1 = require("../utils/prosemirror");
5
5
  const renderEditableGradingInstruction_1 = require("../utils/renderEditableGradingInstruction");
6
+ const util_1 = require("../utils/util");
6
7
  const act = react_1.act;
7
8
  describe('Editor - BR', () => {
8
9
  let cleanup;
@@ -29,15 +30,10 @@ describe('Editor - BR', () => {
29
30
  const expectedOutput = '<p>foo<br/></p><p>foo</p>';
30
31
  const result = (0, renderEditableGradingInstruction_1.renderGradingInstruction)(inputData, onContentChangeMock);
31
32
  await act(async () => {
32
- insertText(await result.findByText('bar'), 'foo');
33
+ (0, util_1.insertText)(await result.findByText('bar'), 'foo');
33
34
  });
34
35
  expect(onContentChangeMock).toHaveBeenCalledTimes(1);
35
36
  expect(onContentChangeMock).toHaveBeenCalledWith(expectedOutput, '');
36
37
  });
37
38
  });
38
- function insertText(element, text) {
39
- react_1.fireEvent.input(element, {
40
- target: { innerText: text, innerHTML: text }
41
- });
42
- }
43
39
  //# sourceMappingURL=br.test.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"br.test.js","sourceRoot":"","sources":["../../../__tests__/editor/br.test.tsx"],"names":[],"mappings":";;AAAA,kDAAkE;AAClE,sDAAsD;AACtD,gGAAoF;AAEpF,MAAM,GAAG,GAAG,WAAuD,CAAA;AAEnE,QAAQ,CAAC,aAAa,EAAE,GAAG,EAAE;IAC3B,IAAI,OAA4B,CAAA;IAChC,IAAI,mBAA8B,CAAA;IAElC,UAAU,CAAC,GAAG,EAAE;QACd,mBAAmB,GAAG,IAAI,CAAC,EAAE,EAAE,CAAA;IACjC,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,4BAA4B,EAAE,GAAG,EAAE;QACpC,MAAM,SAAS,GAAG,iBAAiB,CAAA;QACnC,MAAM,cAAc,GAAG,sDAAsD,CAAA;QAC7E,MAAM,MAAM,GAAG,IAAA,2DAAwB,EAAC,SAAS,CAAC,CAAA;QAClD,MAAM,KAAK,GAAG,MAAM,CAAC,SAAS,CAAC,aAAa,CAAC,cAAc,CAAC,CAAA;QAC5D,MAAM,CAAC,KAAM,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,CAAA;IAC/C,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,wDAAwD,EAAE,KAAK,IAAI,EAAE;QACtE,OAAO,GAAG,IAAA,6BAAe,GAAE,CAAA;QAC3B,MAAM,SAAS,GAAG,2BAA2B,CAAA;QAC7C,MAAM,cAAc,GAAG,2BAA2B,CAAA;QAClD,MAAM,MAAM,GAAG,IAAA,2DAAwB,EAAC,SAAS,EAAE,mBAAmB,CAAC,CAAA;QACvE,MAAM,GAAG,CAAC,KAAK,IAAI,EA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AAG,MAAM,CAAC,SAAS,CAAC,aAAa,CAAC,cAAc,CAAC,CAAA;QAC5D,MAAM,CAAC,KAAM,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,CAAA;IAC/C,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,wDAAwD,EAAE,KAAK,IAAI,EAAE;QACtE,OAAO,GAAG,IAAA,6BAAe,GAAE,CAAA;QAC3B,MAAM,SAAS,GAAG,2BAA2B,CAAA;QAC7C,MAAM,cAAc,GAAG,2BAA2B,CAAA;QAClD,MAAM,MAAM,GAAG,IAAA,2DAAwB,EAAC,SAAS,EAAE,mBAAmB,CAAC,CAAA;QACvE,MAAM,GAAG,CAAC,KAAK,IAAI,EAAE;YACnB,IAAA,iBAAU,EAAC,MAAM,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,CAAA;QACnD,CAAC,CAAC,CAAA;QACF,MAAM,CAAC,mBAAmB,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAA;QACpD,MAAM,CAAC,mBAAmB,CAAC,CAAC,oBAAoB,CAAC,cAAc,EAAE,EAAE,CAAC,CAAA;IACtE,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const react_1 = require("@testing-library/react");
4
4
  const prosemirror_1 = require("../utils/prosemirror");
5
5
  const renderEditableGradingInstruction_1 = require("../utils/renderEditableGradingInstruction");
6
+ const util_1 = require("../utils/util");
6
7
  const act = react_1.act;
7
8
  describe('Editor - HR', () => {
8
9
  let cleanup;
@@ -29,15 +30,10 @@ describe('Editor - HR', () => {
29
30
  const expectedOutput = '<p>foo</p><hr/><p>foo</p>';
30
31
  const result = (0, renderEditableGradingInstruction_1.renderGradingInstruction)(inputData, onContentChangeMock);
31
32
  await act(async () => {
32
- insertText(await result.findByText('bar'), 'foo');
33
+ (0, util_1.insertText)(await result.findByText('bar'), 'foo');
33
34
  });
34
35
  expect(onContentChangeMock).toHaveBeenCalledTimes(1);
35
36
  expect(onContentChangeMock).toHaveBeenCalledWith(expectedOutput, '');
36
37
  });
37
38
  });
38
- function insertText(element, text) {
39
- react_1.fireEvent.input(element, {
40
- target: { innerText: text, innerHTML: text }
41
- });
42
- }
43
39
  //# sourceMappingURL=hr.test.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"hr.test.js","sourceRoot":"","sources":["../../../__tests__/editor/hr.test.tsx"],"names":[],"mappings":";;AAAA,kDAAkE;AAClE,sDAAsD;AACtD,gGAAoF;AAEpF,MAAM,GAAG,GAAG,WAAuD,CAAA;AAEnE,QAAQ,CAAC,aAAa,EAAE,GAAG,EAAE;IAC3B,IAAI,OAA4B,CAAA;IAChC,IAAI,mBAA8B,CAAA;IAElC,UAAU,CAAC,GAAG,EAAE;QACd,mBAAmB,GAAG,IAAI,CAAC,EAAE,EAAE,CAAA;IACjC,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,4BAA4B,EAAE,GAAG,EAAE;QACpC,MAAM,SAAS,GAAG,iBAAiB,CAAA;QACnC,MAAM,cAAc,GAAG,gBAAgB,CAAA;QACvC,MAAM,MAAM,GAAG,IAAA,2DAAwB,EAAC,SAAS,CAAC,CAAA;QAClD,MAAM,KAAK,GAAG,MAAM,CAAC,SAAS,CAAC,aAAa,CAAC,cAAc,CAAC,CAAA;QAC5D,MAAM,CAAC,KAAM,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,CAAA;IAC/C,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,wDAAwD,EAAE,KAAK,IAAI,EAAE;QACtE,OAAO,GAAG,IAAA,6BAAe,GAAE,CAAA;QAC3B,MAAM,SAAS,GAA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E,GAAG,EAAE;QACpC,MAAM,SAAS,GAAG,iBAAiB,CAAA;QACnC,MAAM,cAAc,GAAG,gBAAgB,CAAA;QACvC,MAAM,MAAM,GAAG,IAAA,2DAAwB,EAAC,SAAS,CAAC,CAAA;QAClD,MAAM,KAAK,GAAG,MAAM,CAAC,SAAS,CAAC,aAAa,CAAC,cAAc,CAAC,CAAA;QAC5D,MAAM,CAAC,KAAM,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,CAAA;IAC/C,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,wDAAwD,EAAE,KAAK,IAAI,EAAE;QACtE,OAAO,GAAG,IAAA,6BAAe,GAAE,CAAA;QAC3B,MAAM,SAAS,GAAG,2BAA2B,CAAA;QAC7C,MAAM,cAAc,GAAG,2BAA2B,CAAA;QAClD,MAAM,MAAM,GAAG,IAAA,2DAAwB,EAAC,SAAS,EAAE,mBAAmB,CAAC,CAAA;QACvE,MAAM,GAAG,CAAC,KAAK,IAAI,EAAE;YACnB,IAAA,iBAAU,EAAC,MAAM,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,CAAA;QACnD,CAAC,CAAC,CAAA;QACF,MAAM,CAAC,mBAAmB,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAA;QACpD,MAAM,CAAC,mBAAmB,CAAC,CAAC,oBAAoB,CAAC,cAAc,EAAE,EAAE,CAAC,CAAA;IACtE,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
@@ -7,6 +7,7 @@ const react_1 = require("@testing-library/react");
7
7
  const prosemirror_1 = require("../utils/prosemirror");
8
8
  const renderEditableGradingInstruction_1 = require("../utils/renderEditableGradingInstruction");
9
9
  const user_event_1 = __importDefault(require("@testing-library/user-event"));
10
+ const util_1 = require("../utils/util");
10
11
  const act = react_1.act;
11
12
  describe('Editor - NBSP', () => {
12
13
  let cleanup;
@@ -33,7 +34,7 @@ describe('Editor - NBSP', () => {
33
34
  const expectedOutput = '<p>&#160;foo</p><p>foo</p>';
34
35
  const result = (0, renderEditableGradingInstruction_1.renderGradingInstruction)(inputData, onContentChangeMock);
35
36
  await act(async () => {
36
- insertText(await result.findByText('bar'), 'foo');
37
+ (0, util_1.insertText)(await result.findByText('bar'), 'foo');
37
38
  });
38
39
  expect(onContentChangeMock).toHaveBeenCalledTimes(1);
39
40
  expect(onContentChangeMock).toHaveBeenCalledWith(expectedOutput, '');
@@ -47,13 +48,8 @@ describe('Editor - NBSP', () => {
47
48
  await act(async () => {
48
49
  await user_event_1.default.click(await result.findByText('NBSP'));
49
50
  });
50
- expect(onContentChangeMock).toHaveBeenCalledTimes(1);
51
+ expect(onContentChangeMock).toHaveBeenCalledTimes(2); // focus causes another call
51
52
  expect(onContentChangeMock).toHaveBeenLastCalledWith(expectedOutput, '');
52
53
  });
53
54
  });
54
- function insertText(element, text) {
55
- react_1.fireEvent.input(element, {
56
- target: { innerText: text, innerHTML: text }
57
- });
58
- }
59
55
  //# sourceMappingURL=nbsp.test.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"nbsp.test.js","sourceRoot":"","sources":["../../../__tests__/editor/nbsp.test.tsx"],"names":[],"mappings":";;;;;AAAA,kDAAkE;AAClE,sDAAsD;AACtD,gGAAoF;AACpF,6EAAmD;AAEnD,MAAM,GAAG,GAAG,WAAuD,CAAA;AAEnE,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE;IAC7B,IAAI,OAA4B,CAAA;IAChC,IAAI,mBAA8B,CAAA;IAElC,UAAU,CAAC,GAAG,EAAE;QACd,mBAAmB,GAAG,IAAI,CAAC,EAAE,EAAE,CAAA;IACjC,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,8BAA8B,EAAE,GAAG,E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