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

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. package/dist/__tests__/editor/Formula.test.js +0 -11
  2. package/dist/__tests__/editor/Formula.test.js.map +1 -1
  3. package/dist/__tests__/editor/ImageUploadButton.test.js +1 -26
  4. package/dist/__tests__/editor/ImageUploadButton.test.js.map +1 -1
  5. package/dist/__tests__/tsconfig.tsbuildinfo +1 -1
  6. package/dist/components/grading-instructions/EditableGradingInstruction.d.ts.map +1 -1
  7. package/dist/components/grading-instructions/EditableGradingInstruction.js +5 -17
  8. package/dist/components/grading-instructions/EditableGradingInstruction.js.map +1 -1
  9. package/dist/components/grading-instructions/editor/schemas/formulaSchema.js +1 -8
  10. package/dist/components/grading-instructions/editor/schemas/formulaSchema.js.map +1 -1
  11. package/dist/components/grading-instructions/editor/schemas/imageSchema.d.ts.map +1 -1
  12. package/dist/components/grading-instructions/editor/schemas/imageSchema.js +4 -18
  13. package/dist/components/grading-instructions/editor/schemas/imageSchema.js.map +1 -1
  14. package/dist/components/grading-instructions/editor/schemas/spanWithNowrapSchema.js +1 -1
  15. package/dist/components/grading-instructions/editor/schemas/spanWithNowrapSchema.js.map +1 -1
  16. package/dist/main-bundle.js +1 -1
  17. package/package.json +2 -2
  18. package/dist/__tests__/editor/spanLang.test.d.ts +0 -2
  19. package/dist/__tests__/editor/spanLang.test.d.ts.map +0 -1
  20. package/dist/__tests__/editor/spanLang.test.js +0 -50
  21. package/dist/__tests__/editor/spanLang.test.js.map +0 -1
  22. package/dist/__tests__/editor/spanWithLang.test.d.ts +0 -2
  23. package/dist/__tests__/editor/spanWithLang.test.d.ts.map +0 -1
  24. package/dist/__tests__/editor/spanWithLang.test.js +0 -38
  25. package/dist/__tests__/editor/spanWithLang.test.js.map +0 -1
  26. package/dist/__tests__/editor/sub.test.d.ts +0 -2
  27. package/dist/__tests__/editor/sub.test.d.ts.map +0 -1
  28. package/dist/__tests__/editor/sub.test.js +0 -62
  29. package/dist/__tests__/editor/sub.test.js.map +0 -1
  30. package/dist/__tests__/editor/subSup.test.d.ts +0 -2
  31. package/dist/__tests__/editor/subSup.test.d.ts.map +0 -1
  32. package/dist/__tests__/editor/subSup.test.js +0 -50
  33. package/dist/__tests__/editor/subSup.test.js.map +0 -1
  34. package/dist/components/grading-instructions/editor/schemas/spanLang.d.ts +0 -3
  35. package/dist/components/grading-instructions/editor/schemas/spanLang.d.ts.map +0 -1
  36. package/dist/components/grading-instructions/editor/schemas/spanLang.js +0 -23
  37. package/dist/components/grading-instructions/editor/schemas/spanLang.js.map +0 -1
  38. package/dist/components/grading-instructions/editor/schemas/spanWithLangSchema.d.ts +0 -3
  39. package/dist/components/grading-instructions/editor/schemas/spanWithLangSchema.d.ts.map +0 -1
  40. package/dist/components/grading-instructions/editor/schemas/spanWithLangSchema.js +0 -19
  41. package/dist/components/grading-instructions/editor/schemas/spanWithLangSchema.js.map +0 -1
  42. package/dist/components/grading-instructions/editor/schemas/subSup.d.ts +0 -3
  43. package/dist/components/grading-instructions/editor/schemas/subSup.d.ts.map +0 -1
  44. package/dist/components/grading-instructions/editor/schemas/subSup.js +0 -23
  45. package/dist/components/grading-instructions/editor/schemas/subSup.js.map +0 -1
  46. package/dist/components/grading-instructions/editor/schemas/subSupSchema.d.ts +0 -3
  47. package/dist/components/grading-instructions/editor/schemas/subSupSchema.d.ts.map +0 -1
  48. package/dist/components/grading-instructions/editor/schemas/subSupSchema.js +0 -23
  49. package/dist/components/grading-instructions/editor/schemas/subSupSchema.js.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digabi/exam-engine-core",
3
- "version": "22.1.6-alpha.4",
3
+ "version": "22.1.7-alpha.1",
4
4
  "main": "dist/main-bundle.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "author": "Matriculation Examination Board, Finland",
@@ -67,5 +67,5 @@
67
67
  "webpack-bundle-analyzer": "^4.1.0",
68
68
  "webpack-cli": "^5.0.2"
69
69
  },
70
- "gitHead": "0b98ee8e01ad6db30c9179bfbdf03463de5cd97e"
70
+ "gitHead": "d01bd5e536f9e89396054911d156a01d3c9fe798"
71
71
  }
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=spanLang.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"spanLang.test.d.ts","sourceRoot":"","sources":["../../../__tests__/editor/spanLang.test.tsx"],"names":[],"mappings":""}
@@ -1,50 +0,0 @@
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 - sub and sup', () => {
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('sub is rendered and returned as expected', async () => {
21
- const inputData = '<p>bar</p><sub>foo</sub>';
22
- const expectedDom = '<p>foo</p><p><sub>foo</sub></p>';
23
- const expectedOutput = '<p>foo</p><p><sub>foo</sub></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('sup is rendered and returned as expected', async () => {
33
- const inputData = '<p>bar</p><sup>foo</sup>';
34
- const expectedDom = '<p>foo</p><p><sup>foo</sup></p>';
35
- const expectedOutput = '<p>foo</p><p><sup>foo</sup></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
- });
45
- function insertText(element, text) {
46
- react_1.fireEvent.input(element, {
47
- target: { innerText: text, innerHTML: text }
48
- });
49
- }
50
- //# sourceMappingURL=spanLang.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"spanLang.test.js","sourceRoot":"","sources":["../../../__tests__/editor/spanLang.test.tsx"],"names":[],"mappings":";;AAAA,kDAAkE;AAClE,sDAAsD;AACtD,gGAAoF;AAEpF,MAAM,GAAG,GAAG,WAAuD,CAAA;AAEnE,QAAQ,CAAC,sBAAsB,EAAE,GAAG,EAAE;IACpC,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,0CAA0C,EAAE,KAAK,IAAI,EAAE;QACxD,MAAM,SAAS,GAAG,0BAA0B,CAAA;QAC5C,MAAM,WAAW,GAAG,iCAAiC,CAAA;QACrD,MAAM,cAAc,GAAG,iCAAiC,CAAA;QACxD,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,CA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
1
- {"version":3,"file":"spanWithLang.test.d.ts","sourceRoot":"","sources":["../../../__tests__/editor/spanWithLang.test.tsx"],"names":[],"mappings":""}
@@ -1,38 +0,0 @@
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 - span with lang attribute', () => {
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('span with lang attribute is rendered and returned as expected', async () => {
21
- const inputData = '<p>bar</p><span lang="en-GB">foo</span>';
22
- const expectedDom = '<p>foo</p><p><span lang="en-GB">foo</span></p>';
23
- const expectedOutput = '<p>foo</p><p><span lang="en-GB">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
- });
33
- function insertText(element, text) {
34
- react_1.fireEvent.input(element, {
35
- target: { innerText: text, innerHTML: text }
36
- });
37
- }
38
- //# sourceMappingURL=spanWithLang.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"spanWithLang.test.js","sourceRoot":"","sources":["../../../__tests__/editor/spanWithLang.test.tsx"],"names":[],"mappings":";;AAAA,kDAAkE;AAClE,sDAAsD;AACtD,gGAAoF;AAEpF,MAAM,GAAG,GAAG,WAAuD,CAAA;AAEnE,QAAQ,CAAC,mCAAmC,EAAE,GAAG,EAAE;IACjD,IAAI,OAA4B,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};
2
- //# sourceMappingURL=sub.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sub.test.d.ts","sourceRoot":"","sources":["../../../__tests__/editor/sub.test.tsx"],"names":[],"mappings":""}
@@ -1,62 +0,0 @@
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 - sub and sup', () => {
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" formula="true" 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=sub.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sub.test.js","sourceRoot":"","sources":["../../../__tests__/editor/sub.test.tsx"],"names":[],"mappings":";;AAAA,kDAAkE;AAClE,sDAAsD;AACtD,gGAAoF;AAEpF,MAAM,GAAG,GAAG,WAAuD,CAAA;AAEnE,QAAQ,CAAC,sBAAsB,EAAE,GAAG,EAAE;IACpC,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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AC,WAAW,CAAC,CAAA;QAC5C,MAAM,CAAC,mBAAmB,CAAC,CAAC,oBAAoB,CAAC,cAAc,EAAE,EAAE,CAAC,CAAA;IACtE,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,mDAAmD,EAAE,KAAK,IAAI,EAAE;QACjE,MAAM,SAAS,GAAG,oDAAoD,CAAA;QACtE,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,WAAW,CAAC,CAAA;QAC5C,MAAM,CAAC,mBAAmB,CAAC,CAAC,oBAAoB,CAAC,cAAc,EAAE,EAAE,CAAC,CAAA;IACtE,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA;AAEF,SAAS,UAAU,CAAC,OAAoB,EAAE,IAAY;IACpD,iBAAS,CAAC,KAAK,CAAC,OAAO,EAAE;QACvB,MAAM,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE;KAC7C,CAAC,CAAA;AACJ,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=subSup.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"subSup.test.d.ts","sourceRoot":"","sources":["../../../__tests__/editor/subSup.test.tsx"],"names":[],"mappings":""}
@@ -1,50 +0,0 @@
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 - sub and sup', () => {
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('sub is rendered and returned as expected', async () => {
21
- const inputData = '<p>bar</p><sub>foo</sub>';
22
- const expectedDom = '<p>foo</p><p><sub>foo</sub></p>';
23
- const expectedOutput = '<p>foo</p><p><sub>foo</sub></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('sup is rendered and returned as expected', async () => {
33
- const inputData = '<p>bar</p><sup>foo</sup>';
34
- const expectedDom = '<p>foo</p><p><sup>foo</sup></p>';
35
- const expectedOutput = '<p>foo</p><p><sup>foo</sup></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
- });
45
- function insertText(element, text) {
46
- react_1.fireEvent.input(element, {
47
- target: { innerText: text, innerHTML: text }
48
- });
49
- }
50
- //# sourceMappingURL=subSup.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"subSup.test.js","sourceRoot":"","sources":["../../../__tests__/editor/subSup.test.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0BAA0B,CAAA;QAC5C,MAAM,WAAW,GAAG,iCAAiC,CAAA;QACrD,MAAM,cAAc,GAAG,iCAAiC,CAAA;QACxD,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,WAAW,CAAC,CAAA;QAC5C,MAAM,CAAC,mBAAmB,CAAC,CAAC,oBAAoB,CAAC,cAAc,EAAE,EAAE,CAAC,CAAA;IACtE,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA;AAEF,SAAS,UAAU,CAAC,OAAoB,EAAE,IAAY;IACpD,iBAAS,CAAC,KAAK,CAAC,OAAO,EAAE;QACvB,MAAM,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE;KAC7C,CAAC,CAAA;AACJ,CAAC"}
@@ -1,3 +0,0 @@
1
- import { MarkSpec } from 'prosemirror-model';
2
- export declare const subSubSchema: MarkSpec;
3
- //# sourceMappingURL=spanLang.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"spanLang.d.ts","sourceRoot":"","sources":["../../../../../src/components/grading-instructions/editor/schemas/spanLang.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAE5C,eAAO,MAAM,YAAY,EAAE,QAqB1B,CAAA"}
@@ -1,23 +0,0 @@
1
- export const subSubSchema = {
2
- sub: {
3
- parseDOM: [
4
- {
5
- tag: 'sub'
6
- }
7
- ],
8
- toDOM() {
9
- return ['sub', 0];
10
- }
11
- },
12
- sup: {
13
- parseDOM: [
14
- {
15
- tag: 'sup'
16
- }
17
- ],
18
- toDOM() {
19
- return ['sup', 0];
20
- }
21
- }
22
- };
23
- //# sourceMappingURL=spanLang.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"spanLang.js","sourceRoot":"","sources":["../../../../../src/components/grading-instructions/editor/schemas/spanLang.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,YAAY,GAAa;IACpC,GAAG,EAAE;QACH,QAAQ,EAAE;YACR;gBACE,GAAG,EAAE,KAAK;aACX;SACF;QACD,KAAK;YACH,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC,CAAA;QACnB,CAAC;KACF;IACD,GAAG,EAAE;QACH,QAAQ,EAAE;YACR;gBACE,GAAG,EAAE,KAAK;aACX;SACF;QACD,KAAK;YACH,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC,CAAA;QACnB,CAAC;KACF;CACF,CAAA"}
@@ -1,3 +0,0 @@
1
- import { MarkSpec } from 'prosemirror-model';
2
- export declare const spanWithLangSchema: MarkSpec;
3
- //# sourceMappingURL=spanWithLangSchema.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"spanWithLangSchema.d.ts","sourceRoot":"","sources":["../../../../../src/components/grading-instructions/editor/schemas/spanWithLangSchema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAQ,MAAM,mBAAmB,CAAA;AAElD,eAAO,MAAM,kBAAkB,EAAE,QAiBhC,CAAA"}
@@ -1,19 +0,0 @@
1
- export const spanWithLangSchema = {
2
- spanWithLang: {
3
- attrs: {
4
- lang: { default: null }
5
- },
6
- parseDOM: [
7
- {
8
- tag: 'span[lang]',
9
- getAttrs(dom) {
10
- return { lang: dom.getAttribute('lang') || null };
11
- }
12
- }
13
- ],
14
- toDOM(node) {
15
- return ['span', { lang: node.attrs.lang }, 0];
16
- }
17
- }
18
- };
19
- //# sourceMappingURL=spanWithLangSchema.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"spanWithLangSchema.js","sourceRoot":"","sources":["../../../../../src/components/grading-instructions/editor/schemas/spanWithLangSchema.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,kBAAkB,GAAa;IAC1C,YAAY,EAAE;QACZ,KAAK,EAAE;YACL,IAAI,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;SACxB;QACD,QAAQ,EAAE;YACR;gBACE,GAAG,EAAE,YAAY;gBACjB,QAAQ,CAAC,GAAgB;oBACvB,OAAO,EAAE,IAAI,EAAE,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,IAAI,IAAI,EAAE,CAAA;gBACnD,CAAC;aACF;SACF;QACD,KAAK,CAAC,IAAU;YACd,OAAO,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,IAAc,EAAE,EAAE,CAAC,CAAC,CAAA;QACzD,CAAC;KACF;CACF,CAAA"}
@@ -1,3 +0,0 @@
1
- import { MarkSpec } from 'prosemirror-model';
2
- export declare const subSubSchema: MarkSpec;
3
- //# sourceMappingURL=subSup.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"subSup.d.ts","sourceRoot":"","sources":["../../../../../src/components/grading-instructions/editor/schemas/subSup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAE5C,eAAO,MAAM,YAAY,EAAE,QAqB1B,CAAA"}
@@ -1,23 +0,0 @@
1
- export const subSubSchema = {
2
- sub: {
3
- parseDOM: [
4
- {
5
- tag: 'sub'
6
- }
7
- ],
8
- toDOM() {
9
- return ['sub', 0];
10
- }
11
- },
12
- sup: {
13
- parseDOM: [
14
- {
15
- tag: 'sup'
16
- }
17
- ],
18
- toDOM() {
19
- return ['sup', 0];
20
- }
21
- }
22
- };
23
- //# sourceMappingURL=subSup.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"subSup.js","sourceRoot":"","sources":["../../../../../src/components/grading-instructions/editor/schemas/subSup.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,YAAY,GAAa;IACpC,GAAG,EAAE;QACH,QAAQ,EAAE;YACR;gBACE,GAAG,EAAE,KAAK;aACX;SACF;QACD,KAAK;YACH,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC,CAAA;QACnB,CAAC;KACF;IACD,GAAG,EAAE;QACH,QAAQ,EAAE;YACR;gBACE,GAAG,EAAE,KAAK;aACX;SACF;QACD,KAAK;YACH,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC,CAAA;QACnB,CAAC;KACF;CACF,CAAA"}
@@ -1,3 +0,0 @@
1
- import { MarkSpec } from 'prosemirror-model';
2
- export declare const subSupSchema: MarkSpec;
3
- //# sourceMappingURL=subSupSchema.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"subSupSchema.d.ts","sourceRoot":"","sources":["../../../../../src/components/grading-instructions/editor/schemas/subSupSchema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAE5C,eAAO,MAAM,YAAY,EAAE,QAqB1B,CAAA"}
@@ -1,23 +0,0 @@
1
- export const subSupSchema = {
2
- sub: {
3
- parseDOM: [
4
- {
5
- tag: 'sub'
6
- }
7
- ],
8
- toDOM() {
9
- return ['sub', 0];
10
- }
11
- },
12
- sup: {
13
- parseDOM: [
14
- {
15
- tag: 'sup'
16
- }
17
- ],
18
- toDOM() {
19
- return ['sup', 0];
20
- }
21
- }
22
- };
23
- //# sourceMappingURL=subSupSchema.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"subSupSchema.js","sourceRoot":"","sources":["../../../../../src/components/grading-instructions/editor/schemas/subSupSchema.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,YAAY,GAAa;IACpC,GAAG,EAAE;QACH,QAAQ,EAAE;YACR;gBACE,GAAG,EAAE,KAAK;aACX;SACF;QACD,KAAK;YACH,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC,CAAA;QACnB,CAAC;KACF;IACD,GAAG,EAAE;QACH,QAAQ,EAAE;YACR;gBACE,GAAG,EAAE,KAAK;aACX;SACF;QACD,KAAK;YACH,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC,CAAA;QACnB,CAAC;KACF;CACF,CAAA"}