@digabi/exam-engine-core 22.0.4-alpha.1 → 22.0.4-editor-ee-to-em.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (90) hide show
  1. package/dist/__tests__/tsconfig.tsbuildinfo +1 -1
  2. package/dist/components/context/AttachmentContext.d.ts.map +1 -1
  3. package/dist/components/context/ExamContext.d.ts.map +1 -1
  4. package/dist/components/context/GradingInstructionContext.d.ts +5 -11
  5. package/dist/components/context/GradingInstructionContext.d.ts.map +1 -1
  6. package/dist/components/context/GradingInstructionContext.js.map +1 -1
  7. package/dist/components/context/QuestionContext.d.ts.map +1 -1
  8. package/dist/components/context/ResultsContext.d.ts.map +1 -1
  9. package/dist/components/context/SectionContext.d.ts.map +1 -1
  10. package/dist/components/grading-instructions/AnswerGradingInstruction.d.ts.map +1 -1
  11. package/dist/components/grading-instructions/AnswerGradingInstruction.js +2 -3
  12. package/dist/components/grading-instructions/AnswerGradingInstruction.js.map +1 -1
  13. package/dist/components/grading-instructions/GradingInstructionProvider.d.ts +1 -1
  14. package/dist/components/grading-instructions/GradingInstructionProvider.d.ts.map +1 -1
  15. package/dist/components/grading-instructions/GradingInstructionProvider.js +1 -4
  16. package/dist/components/grading-instructions/GradingInstructionProvider.js.map +1 -1
  17. package/dist/components/grading-instructions/GradingInstructions.d.ts +5 -2
  18. package/dist/components/grading-instructions/GradingInstructions.d.ts.map +1 -1
  19. package/dist/components/grading-instructions/GradingInstructions.js +2 -3
  20. package/dist/components/grading-instructions/GradingInstructions.js.map +1 -1
  21. package/dist/components/grading-instructions/editor/List.d.ts +1 -1
  22. package/dist/components/grading-instructions/editor/List.d.ts.map +1 -1
  23. package/dist/components/grading-instructions/editor/NBSP.d.ts +1 -1
  24. package/dist/components/grading-instructions/editor/NBSP.d.ts.map +1 -1
  25. package/dist/components/grading-instructions/editor/Table.d.ts +1 -1
  26. package/dist/components/grading-instructions/editor/Table.d.ts.map +1 -1
  27. package/dist/components/grading-instructions/editor/findNode.d.ts +1 -1
  28. package/dist/components/grading-instructions/editor/findNode.d.ts.map +1 -1
  29. package/dist/components/grading-instructions/editor/schemas/listSchema.d.ts +3 -69
  30. package/dist/components/grading-instructions/editor/schemas/listSchema.d.ts.map +1 -1
  31. package/dist/main-bundle.js +1 -1
  32. package/dist/main-bundle.js.LICENSE.txt +1 -1
  33. package/dist/main.css +1 -1
  34. package/package.json +2 -11
  35. package/dist/__tests__/EditableGradingInstruction.test.d.ts +0 -2
  36. package/dist/__tests__/EditableGradingInstruction.test.d.ts.map +0 -1
  37. package/dist/__tests__/EditableGradingInstruction.test.js +0 -174
  38. package/dist/__tests__/EditableGradingInstruction.test.js.map +0 -1
  39. package/dist/__tests__/FormatButton.test.d.ts +0 -2
  40. package/dist/__tests__/FormatButton.test.d.ts.map +0 -1
  41. package/dist/__tests__/FormatButton.test.js +0 -94
  42. package/dist/__tests__/FormatButton.test.js.map +0 -1
  43. package/dist/components/Localization.d.ts +0 -5
  44. package/dist/components/Localization.d.ts.map +0 -1
  45. package/dist/components/Localization.js +0 -9
  46. package/dist/components/Localization.js.map +0 -1
  47. package/dist/components/grading-instructions/GradingInstruction.d.ts +0 -7
  48. package/dist/components/grading-instructions/GradingInstruction.d.ts.map +0 -1
  49. package/dist/components/grading-instructions/GradingInstruction.js +0 -9
  50. package/dist/components/grading-instructions/GradingInstruction.js.map +0 -1
  51. package/dist/components/grading-instructions/editor/AttributeToggleButton.d.ts +0 -9
  52. package/dist/components/grading-instructions/editor/AttributeToggleButton.d.ts.map +0 -1
  53. package/dist/components/grading-instructions/editor/AttributeToggleButton.js +0 -53
  54. package/dist/components/grading-instructions/editor/AttributeToggleButton.js.map +0 -1
  55. package/dist/components/grading-instructions/editor/CurrentElement.d.ts +0 -2
  56. package/dist/components/grading-instructions/editor/CurrentElement.d.ts.map +0 -1
  57. package/dist/components/grading-instructions/editor/CurrentElement.js +0 -8
  58. package/dist/components/grading-instructions/editor/CurrentElement.js.map +0 -1
  59. package/dist/components/grading-instructions/editor/CurrentLocalization.d.ts +0 -7
  60. package/dist/components/grading-instructions/editor/CurrentLocalization.d.ts.map +0 -1
  61. package/dist/components/grading-instructions/editor/CurrentLocalization.js +0 -13
  62. package/dist/components/grading-instructions/editor/CurrentLocalization.js.map +0 -1
  63. package/dist/components/grading-instructions/editor/LocalizationButtons.d.ts +0 -6
  64. package/dist/components/grading-instructions/editor/LocalizationButtons.d.ts.map +0 -1
  65. package/dist/components/grading-instructions/editor/LocalizationButtons.js +0 -14
  66. package/dist/components/grading-instructions/editor/LocalizationButtons.js.map +0 -1
  67. package/dist/components/grading-instructions/editor/localizatio.d.ts +0 -3
  68. package/dist/components/grading-instructions/editor/localizatio.d.ts.map +0 -1
  69. package/dist/components/grading-instructions/editor/localizatio.js +0 -36
  70. package/dist/components/grading-instructions/editor/localizatio.js.map +0 -1
  71. package/dist/components/grading-instructions/editor/localizationSpan.d.ts +0 -3
  72. package/dist/components/grading-instructions/editor/localizationSpan.d.ts.map +0 -1
  73. package/dist/components/grading-instructions/editor/localizationSpan.js +0 -36
  74. package/dist/components/grading-instructions/editor/localizationSpan.js.map +0 -1
  75. package/dist/components/grading-instructions/editor/schemas/image-schema.d.ts +0 -4
  76. package/dist/components/grading-instructions/editor/schemas/image-schema.d.ts.map +0 -1
  77. package/dist/components/grading-instructions/editor/schemas/image-schema.js +0 -47
  78. package/dist/components/grading-instructions/editor/schemas/image-schema.js.map +0 -1
  79. package/dist/components/grading-instructions/editor/spanWithPath.d.ts +0 -3
  80. package/dist/components/grading-instructions/editor/spanWithPath.d.ts.map +0 -1
  81. package/dist/components/grading-instructions/editor/spanWithPath.js +0 -24
  82. package/dist/components/grading-instructions/editor/spanWithPath.js.map +0 -1
  83. package/dist/components/grading-instructions/editor/util.d.ts +0 -6
  84. package/dist/components/grading-instructions/editor/util.d.ts.map +0 -1
  85. package/dist/components/grading-instructions/editor/util.js +0 -10
  86. package/dist/components/grading-instructions/editor/util.js.map +0 -1
  87. /package/dist/components/grading-instructions/editor/{Localization.d.ts → localization.d.ts} +0 -0
  88. /package/dist/components/grading-instructions/editor/{Localization.d.ts.map → localization.d.ts.map} +0 -0
  89. /package/dist/components/grading-instructions/editor/{Localization.js → localization.js} +0 -0
  90. /package/dist/components/grading-instructions/editor/{Localization.js.map → localization.js.map} +0 -0
@@ -1,174 +0,0 @@
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 = require("@testing-library/react");
7
- const user_event_1 = __importDefault(require("@testing-library/user-event"));
8
- const renderEditableGradingInstruction_1 = require("./utils/renderEditableGradingInstruction");
9
- const util_1 = require("./utils/util");
10
- require("@testing-library/jest-dom");
11
- const act = react_1.act;
12
- describe('EditableGradingInstruction', () => {
13
- let cleanup;
14
- let onContentChangeMock;
15
- beforeEach(() => {
16
- onContentChangeMock = jest.fn();
17
- });
18
- afterEach(() => {
19
- if (cleanup) {
20
- cleanup();
21
- }
22
- cleanup = null;
23
- });
24
- describe('table', () => {
25
- it('Table is rendered as expected', () => {
26
- const inputData = '<table class="e-table"><tbody><tr><td>foo</td></tr></tbody></table>';
27
- const expectedOutput = '<table class="e-table"><tbody><tr><td>foo</td></tr></tbody></table>';
28
- const result = (0, renderEditableGradingInstruction_1.renderGradingInstruction)(inputData);
29
- const table = result.container.querySelector('.ProseMirror');
30
- expect(table.innerHTML).toBe(expectedOutput);
31
- });
32
- it('Change in table is returned as expected', async () => {
33
- cleanup = mockCreateRange();
34
- const inputData = '<table class="e-table"><tbody><tr><td>foo</td></tr></tbody></table>';
35
- const expectedOutput = '<table class="e-table"><tbody><tr><td>bar</td></tr></tbody></table>';
36
- const result = (0, renderEditableGradingInstruction_1.renderGradingInstruction)(inputData, onContentChangeMock);
37
- await act(async () => {
38
- (0, util_1.insertText)(await result.findByText('foo'), 'bar');
39
- });
40
- expect(onContentChangeMock).toHaveBeenCalledTimes(1);
41
- expect(onContentChangeMock).toHaveBeenCalledWith(expectedOutput, '');
42
- });
43
- it('Insert table adds expected table', async () => {
44
- const inputData = '';
45
- const expectedOutput = '<table class="e-table e-width-half"><tbody><tr><td></td><td></td></tr><tr><td></td><td></td></tr></tbody></table>';
46
- const result = (0, renderEditableGradingInstruction_1.renderGradingInstruction)(inputData, onContentChangeMock);
47
- await act(async () => {
48
- await user_event_1.default.click(await result.findByTestId('editor-menu-add-table'));
49
- });
50
- expect(onContentChangeMock).toHaveBeenCalledWith(expectedOutput, '');
51
- });
52
- it('Remove table removes table', async () => {
53
- const inputData = '<table><tbody><tr><td>foo</td></tr></tbody></table>';
54
- const expectedOutput = '<p></p>';
55
- const result = (0, renderEditableGradingInstruction_1.renderGradingInstruction)(inputData, onContentChangeMock);
56
- await clickTableMenuButtonWithFocusOnCell(result, 'foo', 'Poista taulukko');
57
- expect(onContentChangeMock).toHaveBeenCalledWith(expectedOutput, '');
58
- });
59
- it('Insert column adds column', async () => {
60
- const inputData = '<table><tbody><tr><td>foo</td></tr></tbody></table>';
61
- const expectedOutput = '<table><tbody><tr><td>foo</td><td></td></tr></tbody></table>';
62
- const result = (0, renderEditableGradingInstruction_1.renderGradingInstruction)(inputData, onContentChangeMock);
63
- await clickTableMenuButtonWithFocusOnCell(result, 'foo', 'Lisää sarake');
64
- expect(onContentChangeMock).toHaveBeenCalledWith(expectedOutput, '');
65
- });
66
- it('Remove column removes column', async () => {
67
- const inputData = '<table><tbody><tr><td>foo</td><td>bar</td></tr></tbody></table>';
68
- const expectedOutput = '<table><tbody><tr><td>bar</td></tr></tbody></table>';
69
- const result = (0, renderEditableGradingInstruction_1.renderGradingInstruction)(inputData, onContentChangeMock);
70
- await clickTableMenuButtonWithFocusOnCell(result, 'foo', 'Poista sarake');
71
- expect(onContentChangeMock).toHaveBeenCalledWith(expectedOutput, '');
72
- });
73
- it('Insert row adds row', async () => {
74
- const inputData = '<table><tbody><tr><td>foo</td></tr></tbody></table>';
75
- const expectedOutput = '<table><tbody><tr><td>foo</td></tr><tr><td></td></tr></tbody></table>';
76
- const result = (0, renderEditableGradingInstruction_1.renderGradingInstruction)(inputData, onContentChangeMock);
77
- await clickTableMenuButtonWithFocusOnCell(result, 'foo', 'Lisää rivi');
78
- expect(onContentChangeMock).toHaveBeenCalledWith(expectedOutput, '');
79
- });
80
- it('Remove row removes row', async () => {
81
- const inputData = '<table><tbody><tr><td>foo</td></tr><tr><td>bar</td></tr></tbody></table>';
82
- const expectedOutput = '<table><tbody><tr><td>bar</td></tr></tbody></table>';
83
- const result = (0, renderEditableGradingInstruction_1.renderGradingInstruction)(inputData, onContentChangeMock);
84
- await clickTableMenuButtonWithFocusOnCell(result, 'foo', 'Poista rivi');
85
- expect(onContentChangeMock).toHaveBeenCalledWith(expectedOutput, '');
86
- });
87
- it('Full width changes full width class to table', async () => {
88
- const inputData = '<table class="e-width-half"><tbody><tr><td>foo</td></tr></tbody></table>';
89
- const expectedOutput = '<table class="e-width-full"><tbody><tr><td>foo</td></tr></tbody></table>';
90
- const result = (0, renderEditableGradingInstruction_1.renderGradingInstruction)(inputData, onContentChangeMock);
91
- expect(result.queryByText('Puolikas leveys')).not.toBeInTheDocument();
92
- await clickTableMenuButtonWithFocusOnCell(result, 'foo', 'Täysi leveys');
93
- expect(onContentChangeMock).toHaveBeenCalledWith(expectedOutput, '');
94
- });
95
- it('Half width changes half width class to table', async () => {
96
- const inputData = '<table class="e-width-full"><tbody><tr><td>foo</td></tr></tbody></table>';
97
- const expectedOutput = '<table class="e-width-half"><tbody><tr><td>foo</td></tr></tbody></table>';
98
- const result = (0, renderEditableGradingInstruction_1.renderGradingInstruction)(inputData, onContentChangeMock);
99
- expect(result.queryByText('Täysi leveys')).not.toBeInTheDocument();
100
- await clickTableMenuButtonWithFocusOnCell(result, 'foo', 'Puolikas leveys');
101
- expect(onContentChangeMock).toHaveBeenCalledWith(expectedOutput, '');
102
- });
103
- it('Remove borders adds e-table--borderless class to table', async () => {
104
- const inputData = '<table><tbody><tr><td>foo</td></tr></tbody></table>';
105
- const expectedOutput = '<table class="e-table--borderless"><tbody><tr><td>foo</td></tr></tbody></table>';
106
- const result = (0, renderEditableGradingInstruction_1.renderGradingInstruction)(inputData, onContentChangeMock);
107
- expect(result.queryByText('Lisää reunat')).not.toBeInTheDocument();
108
- await clickTableMenuButtonWithFocusOnCell(result, 'foo', 'Poista reunat');
109
- expect(onContentChangeMock).toHaveBeenCalledWith(expectedOutput, '');
110
- });
111
- it('Add borders removes e-table--borderless class from table', async () => {
112
- const inputData = '<table class="e-table--borderless"><tbody><tr><td>foo</td></tr></tbody></table>';
113
- const expectedOutput = '<table><tbody><tr><td>foo</td></tr></tbody></table>';
114
- const result = (0, renderEditableGradingInstruction_1.renderGradingInstruction)(inputData, onContentChangeMock);
115
- expect(result.queryByText('Poista reunat')).not.toBeInTheDocument();
116
- await clickTableMenuButtonWithFocusOnCell(result, 'foo', 'Lisää reunat');
117
- expect(onContentChangeMock).toHaveBeenCalledWith(expectedOutput, '');
118
- });
119
- it('Remove zebra removes class from table', async () => {
120
- const inputData = '<table class="e-table--zebra"><tbody><tr><td>foo</td></tr></tbody></table>';
121
- const expectedOutput = '<table><tbody><tr><td>foo</td></tr></tbody></table>';
122
- const result = (0, renderEditableGradingInstruction_1.renderGradingInstruction)(inputData, onContentChangeMock);
123
- expect(result.queryByText('Lisää raidat')).not.toBeInTheDocument();
124
- await clickTableMenuButtonWithFocusOnCell(result, 'foo', 'Poista raidat');
125
- expect(onContentChangeMock).toHaveBeenCalledWith(expectedOutput, '');
126
- });
127
- it('Add zebra adds e-table--zebra class to table', async () => {
128
- const inputData = '<table><tbody><tr><td>foo</td></tr></tbody></table>';
129
- const expectedOutput = '<table class="e-table--zebra"><tbody><tr><td>foo</td></tr></tbody></table>';
130
- const result = (0, renderEditableGradingInstruction_1.renderGradingInstruction)(inputData, onContentChangeMock);
131
- expect(result.queryByText('Poista raidat')).not.toBeInTheDocument();
132
- await clickTableMenuButtonWithFocusOnCell(result, 'foo', 'Lisää raidat');
133
- expect(onContentChangeMock).toHaveBeenCalledWith(expectedOutput, '');
134
- });
135
- });
136
- });
137
- async function clickTableMenuButtonWithFocusOnCell(result, cellText, buttonText) {
138
- await act(async () => {
139
- await focusOnTablesCell(result, cellText);
140
- await user_event_1.default.click(await result.findByText(buttonText));
141
- });
142
- }
143
- async function focusOnTablesCell(result, text) {
144
- // Replace cell's text with same text
145
- // Hack to get focus on cell without need to mock createRange
146
- (0, util_1.insertText)(await result.findByText(text), text);
147
- }
148
- function mockCreateRange() {
149
- const originalCreateRange = global.window.document.createRange;
150
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
151
- // @ts-expect-error
152
- global.Range = function Range() { };
153
- const createContextualFragment = (html) => {
154
- const div = document.createElement('div');
155
- div.innerHTML = html;
156
- return div.children[0];
157
- };
158
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
159
- // @ts-expect-error
160
- Range.prototype.createContextualFragment = (html) => createContextualFragment(html);
161
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
162
- // @ts-expect-error
163
- global.window.document.createRange = function createRange() {
164
- return {
165
- setEnd: () => { },
166
- setStart: () => { },
167
- getBoundingClientRect: () => ({ right: 0 }),
168
- getClientRects: () => [],
169
- createContextualFragment
170
- };
171
- };
172
- return () => (global.window.document.createRange = originalCreateRange);
173
- }
174
- //# sourceMappingURL=EditableGradingInstruction.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"EditableGradingInstruction.test.js","sourceRoot":"","sources":["../../__tests__/EditableGradingInstruction.test.tsx"],"names":[],"mappings":";;;;;AAAA,kDAAqE;AACrE,6EAAmD;AACnD,+FAAmF;AACnF,uCAAyC;AACzC,qCAAkC;AAElC,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;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7D,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,2 +0,0 @@
1
- import '@testing-library/jest-dom';
2
- //# sourceMappingURL=FormatButton.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"FormatButton.test.d.ts","sourceRoot":"","sources":["../../__tests__/FormatButton.test.tsx"],"names":[],"mappings":"AACA,OAAO,2BAA2B,CAAA"}
@@ -1,94 +0,0 @@
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 act = react_2.act;
14
- describe('FormatButton', () => {
15
- beforeAll(() => {
16
- (0, prosemirror_1.mockCreateRange)();
17
- });
18
- afterEach(() => {
19
- (0, react_2.cleanup)();
20
- });
21
- describe('Italics', () => {
22
- it('Renders italics button', () => {
23
- const props = { markName: 'em', displayName: 'Italic' };
24
- const { button } = renderEditorWithFormatButton(props);
25
- expect(button).toHaveTextContent(props.displayName);
26
- });
27
- it('Toggles button active state when clicked', async () => {
28
- const props = { markName: 'em', displayName: 'Italic' };
29
- const { button } = renderEditorWithFormatButton(props);
30
- expect(button).toHaveStyle('font-weight: normal');
31
- await user_event_1.default.click(button);
32
- expect(button).toHaveStyle('font-weight: bold');
33
- await user_event_1.default.click(button);
34
- expect(button).toHaveStyle('font-weight: normal');
35
- });
36
- it('formats text', async () => {
37
- const props = { markName: 'em', displayName: 'Italic' };
38
- const { button, paragraph } = renderEditorWithFormatButton(props);
39
- await user_event_1.default.click(button);
40
- await act(async () => await (0, prosemirror_1.promisifiedFireEventInput)(paragraph, { target: { innerHTML: 'hello' } }));
41
- expect((0, react_2.within)(paragraph).getByRole('emphasis')).toHaveTextContent('hello');
42
- });
43
- it('em tags are rendered as italic', () => {
44
- const props = { markName: 'em', displayName: 'Italic', innerHtml: '<em>Italic text</em>' };
45
- const { paragraph } = renderEditorWithFormatButton(props);
46
- expect((0, react_2.within)(paragraph).getByRole('emphasis')).toHaveTextContent('Italic text');
47
- });
48
- it('i tags are rendered as italic', () => {
49
- const props = { markName: 'em', displayName: 'Italic', innerHtml: '<i>Italic text</i>' };
50
- const { paragraph } = renderEditorWithFormatButton(props);
51
- expect((0, react_2.within)(paragraph).getByRole('emphasis')).toHaveTextContent('Italic text');
52
- });
53
- });
54
- describe('Bold', () => {
55
- it('Renders bold button', () => {
56
- const props = { markName: 'strong', displayName: 'Bold' };
57
- const { button } = renderEditorWithFormatButton(props);
58
- expect(button).toHaveTextContent(props.displayName);
59
- });
60
- it('Toggles button active state when clicked', async () => {
61
- const props = { markName: 'strong', displayName: 'Bold' };
62
- const { button } = renderEditorWithFormatButton(props);
63
- expect(button).toHaveStyle('font-weight: normal');
64
- await user_event_1.default.click(button);
65
- expect(button).toHaveStyle('font-weight: bold');
66
- await user_event_1.default.click(button);
67
- expect(button).toHaveStyle('font-weight: normal');
68
- });
69
- it('formats text', async () => {
70
- const props = { markName: 'strong', displayName: 'Bold' };
71
- const { button, paragraph } = renderEditorWithFormatButton(props);
72
- await user_event_1.default.click(button);
73
- await act(async () => await (0, prosemirror_1.promisifiedFireEventInput)(paragraph, { target: { innerHTML: 'hello' } }));
74
- expect((0, react_2.within)(paragraph).getByRole('strong')).toHaveTextContent('hello');
75
- });
76
- it('b tags are rendered as bold', () => {
77
- const props = { markName: 'strong', displayName: 'bold', innerHtml: '<b>Bold text</b>' };
78
- const { paragraph } = renderEditorWithFormatButton(props);
79
- expect((0, react_2.within)(paragraph).getByRole('strong')).toHaveTextContent('Bold text');
80
- });
81
- it('strong tags are rendered as bold', () => {
82
- const props = { markName: 'strong', displayName: 'bold', innerHtml: '<strong>Bold text</strong>' };
83
- const { paragraph } = renderEditorWithFormatButton(props);
84
- expect((0, react_2.within)(paragraph).getByRole('strong')).toHaveTextContent('Bold text');
85
- });
86
- });
87
- function renderEditorWithFormatButton(props) {
88
- const { markName, displayName, innerHtml = '' } = props;
89
- const { getByRole } = (0, react_2.render)(react_1.default.createElement(ProseMirrorWrapper_1.default, { innerHtml: innerHtml },
90
- react_1.default.createElement(FormatButton_1.default, { markName: markName, displayName: displayName })));
91
- return { button: getByRole('button'), paragraph: getByRole('paragraph') };
92
- }
93
- });
94
- //# sourceMappingURL=FormatButton.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"FormatButton.test.js","sourceRoot":"","sources":["../../__tests__/FormatButton.test.tsx"],"names":[],"mappings":";;;;;AAAA,kDAAyB;AACzB,qCAAkC;AAClC,kDAAgF;AAChF,oFAA2D;AAC3D,qDAAgF;AAChF,8GAAqF;AACrF,6EAAmD;AAEnD,MAAM,GAAG,GAAG,WAAuD,CAAA;AAEnE,Q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S;YACtC,8BAAC,sBAAY,IAAC,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,GAAI,CAC3C,CACtB,CAAA;QACD,OAAO,EAAE,MAAM,EAAE,SAAS,CAAC,QAAQ,CAAC,EAAE,SAAS,EAAE,SAAS,CAAC,WAAW,CAAC,EAAE,CAAA;IAC3E,CAAC;AACH,CAAC,CAAC,CAAA"}
@@ -1,5 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,9 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,7 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,9 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,9 +0,0 @@
1
- import React from 'react';
2
- declare function AttributeToggleButton({ markType, attributeName, attributeValue, displayName }: {
3
- markType: string;
4
- attributeName: string;
5
- attributeValue: string;
6
- displayName: string;
7
- }): React.JSX.Element;
8
- export default AttributeToggleButton;
9
- //# sourceMappingURL=AttributeToggleButton.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AttributeToggleButton.d.ts","sourceRoot":"","sources":["../../../../src/components/grading-instructions/editor/AttributeToggleButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAA;AAIlD,iBAAS,qBAAqB,CAAC,EAC7B,QAAQ,EACR,aAAa,EACb,cAAc,EACd,WAAW,EACZ,EAAE;IACD,QAAQ,EAAE,MAAM,CAAA;IAChB,aAAa,EAAE,MAAM,CAAA;IACrB,cAAc,EAAE,MAAM,CAAA;IACtB,WAAW,EAAE,MAAM,CAAA;CACpB,qBAuDA;AAED,eAAe,qBAAqB,CAAA"}
@@ -1,53 +0,0 @@
1
- import React, { useEffect, useState } from 'react';
2
- import { useEditorEventCallback, useEditorState } from '@nytimes/react-prosemirror';
3
- import { findAttributesFromCursor } from './util';
4
- function AttributeToggleButton({ markType, attributeName, attributeValue, displayName }) {
5
- const editorState = useEditorState();
6
- const [isActive, setIsActive] = useState(false);
7
- useEffect(() => {
8
- const attributes = findAttributesFromCursor(editorState.tr, markType);
9
- setIsActive(attributes[attributeName] == attributeValue);
10
- }, [editorState]);
11
- const onClick = useEditorEventCallback(view => {
12
- const { state } = view;
13
- const tr = state.tr
14
- //.insertText('paska')
15
- .setNodeAttribute(state.selection.$head.before(), 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', 'b');
16
- view.dispatch(tr);
17
- view.focus();
18
- return true;
19
- });
20
- /*const onClick2 = useEditorEventCallback(view => {
21
- const { state } = view
22
- const node = state.tr.doc.nodeAt(state.tr.selection.from)
23
- if (node) {
24
- const newAttributeValue = node.attrs[attributeName] ? undefined : attributeValue
25
- const tr = state.tr.setNodeAttribute(state.selection.$from.before(), attributeName, newAttributeValue)
26
- view.dispatch(tr)
27
- view.focus()
28
- return true
29
- }
30
- return false
31
- //console.info(state.selection, state.selection.$from, state.selection.$from.parent)
32
- if (state.selection instanceof NodeSelection) {
33
- state.selection.$from.node()
34
- const node = state.tr.doc.nodeAt(state.tr.selection.from)
35
- if (node) {
36
- const mark = node?.marks.find(mark => mark.type.name == markType)
37
- if (mark) {
38
- state.tr.addMark()
39
- const attrs = { ...mark.attrs, [attributeName]: attributeValue }
40
- node.
41
-
42
- mark.addToSet(node.marks)
43
- const newMark = { ...mark, attrs }
44
- newMark.addToSet(node.marks)
45
- }
46
- }
47
- }
48
- //const a = findTagAttributesFromCursor(state.tr, 'localization')
49
- })*/
50
- return (React.createElement("button", { onClick: onClick, style: { fontWeight: isActive ? 'bold' : 'normal' } }, displayName));
51
- }
52
- export default AttributeToggleButton;
53
- //# sourceMappingURL=AttributeToggleButton.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AttributeToggleButton.js","sourceRoot":"","sources":["../../../../src/components/grading-instructions/editor/AttributeToggleButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA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CAAC;AAED,eAAe,qBAAqB,CAAA"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=CurrentElement.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CurrentElement.d.ts","sourceRoot":"","sources":["../../../../src/components/grading-instructions/editor/CurrentElement.tsx"],"names":[],"mappings":""}
@@ -1,8 +0,0 @@
1
- import React from 'react';
2
- function CurrentElement({ currentElement }) {
3
- return (React.createElement("div", null,
4
- props.currentElement.getAttribute('lang'),
5
- " ",
6
- props.currentElement.getAttribute('exam-type')));
7
- }
8
- //# sourceMappingURL=CurrentElement.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CurrentElement.js","sourceRoot":"","sources":["../../../../src/components/grading-instructions/editor/CurrentElement.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,SAAS,cAAc,CAAC,EAAE,cAAc,EAAsC;IAC5E,OAAO,CACL;QACG,KAAK,CAAC,cAAc,CAAC,YAAY,CAAC,MAAM,CAAC;;QAAG,KAAK,CAAC,cAAc,CAAC,YAAY,CAAC,WAAW,CAAC,CACvF,CACP,CAAA;AACH,CAAC"}
@@ -1,7 +0,0 @@
1
- import React from 'react';
2
- export declare function CurrentLocalization({ currentAttributes }: {
3
- currentAttributes: {
4
- [key: string]: string;
5
- };
6
- }): React.JSX.Element;
7
- //# sourceMappingURL=CurrentLocalization.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CurrentLocalization.d.ts","sourceRoot":"","sources":["../../../../src/components/grading-instructions/editor/CurrentLocalization.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,wBAAgB,mBAAmB,CAAC,EAAE,iBAAiB,EAAE,EAAE;IAAE,iBAAiB,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAA;CAAE,qBAsB1G"}
@@ -1,13 +0,0 @@
1
- import React from 'react';
2
- import AttributeToggleButton from './AttributeToggleButton';
3
- export function CurrentLocalization({ currentAttributes }) {
4
- const { lang, examType } = currentAttributes;
5
- console.info(lang, examType);
6
- return (React.createElement("span", { className: "element-target" },
7
- React.createElement("span", null, "Kohdennus:"),
8
- React.createElement(AttributeToggleButton, { markType: "localization", attributeName: "lang", attributeValue: "fi-FI", displayName: "FI" }),
9
- React.createElement(AttributeToggleButton, { markType: "localization", attributeName: "lang", attributeValue: "sv-FI", displayName: "SV" }),
10
- React.createElement(AttributeToggleButton, { markType: "localization", attributeName: "examType", attributeValue: "visually-impaired", displayName: "NV" }),
11
- React.createElement(AttributeToggleButton, { markType: "localization", attributeName: "examType", attributeValue: "hearing-impaired", displayName: "KV" })));
12
- }
13
- //# sourceMappingURL=CurrentLocalization.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CurrentLocalization.js","sourceRoot":"","sources":["../../../../src/components/grading-instructions/editor/CurrentLocalization.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,qBAAqB,MAAM,yBAAyB,CAAA;AAE3D,MAAM,UAAU,mBAAmB,CAAC,EAAE,iBAAiB,EAAoD;IACzG,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,iBAAiB,CAAA;IAC5C,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAA;IAC5B,OAAO,CACL,8BAAM,SAAS,EAAC,gBAAgB;QAC9B,+CAAuB;QACvB,oBAAC,qBAAqB,IAAC,QAAQ,EAAC,cAAc,EAAC,aAAa,EAAC,MAAM,EAAC,cAAc,EAAC,OAAO,EAAC,WAAW,EAAC,IAAI,GAAG;QAC9G,oBAAC,qBAAqB,IAAC,QAAQ,EAAC,cAAc,EAAC,aAAa,EAAC,MAAM,EAAC,cAAc,EAAC,OAAO,EAAC,WAAW,EAAC,IAAI,GAAG;QAC9G,oBAAC,qBAAqB,IACpB,QAAQ,EAAC,cAAc,EACvB,aAAa,EAAC,UAAU,EACxB,cAAc,EAAC,mBAAmB,EAClC,WAAW,EAAC,IAAI,GAChB;QACF,oBAAC,qBAAqB,IACpB,QAAQ,EAAC,cAAc,EACvB,aAAa,EAAC,UAAU,EACxB,cAAc,EAAC,kBAAkB,EACjC,WAAW,EAAC,IAAI,GAChB,CACG,CACR,CAAA;AACH,CAAC"}
@@ -1,6 +0,0 @@
1
- import React from 'react';
2
- export declare function LocalizationButtons({ lang, examType }: {
3
- lang: string;
4
- examType: string;
5
- }): React.JSX.Element;
6
- //# sourceMappingURL=LocalizationButtons.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"LocalizationButtons.d.ts","sourceRoot":"","sources":["../../../../src/components/grading-instructions/editor/LocalizationButtons.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AASzB,wBAAgB,mBAAmB,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,qBAwBzF"}
@@ -1,14 +0,0 @@
1
- import React from 'react';
2
- import AttributeToggleButton from './AttributeToggleButton';
3
- import FormatButton from './FormatButton';
4
- const languageButtons = { 'fi-FI': 'FI', 'sv-FI': 'SV' };
5
- const examTypeButtons = { normal: 'normaali', 'hearing-impaired': 'KV', 'visually-impaired': 'NV' };
6
- export function LocalizationButtons({ lang, examType }) {
7
- //console.info(languageButtons[lang], examTypeButtons[examType])
8
- return (React.createElement("span", { className: "element-target" },
9
- React.createElement("span", null, "Kohdennus: "),
10
- React.createElement(FormatButton, { markName: "localization", displayName: languageButtons[lang], attributes: { lang, examType } }),
11
- languageButtons[lang] && (React.createElement(AttributeToggleButton, { markType: "localization", attributeName: "lang", attributeValue: lang, displayName: languageButtons[lang] })),
12
- examTypeButtons[examType] && (React.createElement(AttributeToggleButton, { markType: "localization", attributeName: "examType", attributeValue: examType, displayName: examTypeButtons[examType] }))));
13
- }
14
- //# sourceMappingURL=LocalizationButtons.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"LocalizationButtons.js","sourceRoot":"","sources":["../../../../src/components/grading-instructions/editor/LocalizationButtons.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,qBAAqB,MAAM,yBAAyB,CAAA;AAC3D,OAAO,YAAY,MAAM,gBAAgB,CAAA;AAEzC,MAAM,eAAe,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAA+B,CAAA;AACrF,MAAM,eAAe,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,kBAAkB,EAAE,IAAI,EAAE,mBAAmB,EAAE,IAAI,EAEhG,CAAA;AAED,MAAM,UAAU,mBAAmB,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAsC;IACxF,gEAAgE;IAChE,OAAO,CACL,8BAAM,SAAS,EAAC,gBAAgB;QAC9B,gDAAwB;QACxB,oBAAC,YAAY,IAAC,QAAQ,EAAC,cAAc,EAAC,WAAW,EAAE,eAAe,CAAC,IAAI,CAAC,EAAE,UAAU,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAI;QAC3G,eAAe,CAAC,IAAI,CAAC,IAAI,CACxB,oBAAC,qBAAqB,IACpB,QAAQ,EAAC,cAAc,EACvB,aAAa,EAAC,MAAM,EACpB,cAAc,EAAE,IAAI,EACpB,WAAW,EAAE,eAAe,CAAC,IAAI,CAAC,GAClC,CACH;QACA,eAAe,CAAC,QAAQ,CAAC,IAAI,CAC5B,oBAAC,qBAAqB,IACpB,QAAQ,EAAC,cAAc,EACvB,aAAa,EAAC,UAAU,EACxB,cAAc,EAAE,QAAQ,EACxB,WAAW,EAAE,eAAe,CAAC,QAAQ,CAAC,GACtC,CACH,CACI,CACR,CAAA;AACH,CAAC"}
@@ -1,3 +0,0 @@
1
- import { MarkSpec } from 'prosemirror-model';
2
- export declare function localization(hideable: boolean): MarkSpec;
3
- //# sourceMappingURL=localizatio.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"localizatio.d.ts","sourceRoot":"","sources":["../../../../src/components/grading-instructions/editor/localizatio.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAElD,wBAAgB,YAAY,CAAC,QAAQ,EAAE,OAAO,GAAG,QAAQ,CAiCxD"}
@@ -1,36 +0,0 @@
1
- export function localization(hideable) {
2
- return {
3
- localization: {
4
- attrs: {
5
- lang: { default: null },
6
- examType: { default: null },
7
- hidden: { default: null }
8
- },
9
- parseDOM: [
10
- {
11
- tag: '[e-localization]',
12
- getAttrs(dom) {
13
- var _a, _b, _c;
14
- return {
15
- lang: (_a = dom.getAttribute('lang')) !== null && _a !== void 0 ? _a : null,
16
- examType: (_b = dom.getAttribute('exam-type')) !== null && _b !== void 0 ? _b : null,
17
- hidden: hideable ? ((_c = dom.getAttribute('hidden')) !== null && _c !== void 0 ? _c : null) : null
18
- };
19
- }
20
- }
21
- ],
22
- toDOM(node) {
23
- return [
24
- 'e:localization',
25
- {
26
- lang: node.attrs.lang,
27
- 'exam-type': node.attrs.examType,
28
- hidden: hideable ? node.attrs.hidden : null
29
- },
30
- 0
31
- ];
32
- }
33
- }
34
- };
35
- }
36
- //# sourceMappingURL=localizatio.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"localizatio.js","sourceRoot":"","sources":["../../../../src/components/grading-instructions/editor/localizatio.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,YAAY,CAAC,QAAiB;IAC5C,OAAO;QACL,YAAY,EAAE;YACZ,KAAK,EAAE;gBACL,IAAI,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;gBACvB,QAAQ,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;gBAC3B,MAAM,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;aAC1B;YACD,QAAQ,EAAE;gBACR;oBACE,GAAG,EAAE,kBAAkB;oBACvB,QAAQ,CAAC,GAAgB;;wBACvB,OAAO;4BACL,IAAI,EAAE,MAAA,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,mCAAI,IAAI;4BACtC,QAAQ,EAAE,MAAA,GAAG,CAAC,YAAY,CAAC,WAAW,CAAC,mCAAI,IAAI;4BAC/C,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,MAAA,GAAG,CAAC,YAAY,CAAC,QAAQ,CAAC,mCAAI,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI;yBAC/D,CAAA;oBACH,CAAC;iBACF;aACF;YACD,KAAK,CAAC,IAAU;gBACd,OAAO;oBACL,gBAAgB;oBAChB;wBACE,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI;wBACrB,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ;wBAChC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI;qBAC5C;oBACD,CAAC;iBACF,CAAA;YACH,CAAC;SACF;KACF,CAAA;AACH,CAAC"}
@@ -1,3 +0,0 @@
1
- import { MarkSpec } from 'prosemirror-model';
2
- export declare function localization(hideable: boolean): MarkSpec;
3
- //# sourceMappingURL=localizationSpan.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"localizationSpan.d.ts","sourceRoot":"","sources":["../../../../src/components/grading-instructions/editor/localizationSpan.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAElD,wBAAgB,YAAY,CAAC,QAAQ,EAAE,OAAO,GAAG,QAAQ,CAiCxD"}