@digabi/exam-engine-core 22.1.6-alpha.0 → 22.1.6-alpha.2
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/__tests__/EditableGradingInstructionLocalization.test.d.ts +2 -0
- package/dist/__tests__/EditableGradingInstructionLocalization.test.d.ts.map +1 -0
- package/dist/__tests__/EditableGradingInstructionLocalization.test.js +75 -0
- package/dist/__tests__/EditableGradingInstructionLocalization.test.js.map +1 -0
- package/dist/__tests__/editor/Table.test.d.ts +2 -0
- package/dist/__tests__/editor/Table.test.d.ts.map +1 -0
- package/dist/__tests__/editor/Table.test.js +172 -0
- package/dist/__tests__/editor/Table.test.js.map +1 -0
- package/dist/__tests__/tsconfig.tsbuildinfo +1 -1
- package/dist/components/Localization.d.ts +5 -0
- package/dist/components/Localization.d.ts.map +1 -0
- package/dist/components/Localization.js +9 -0
- package/dist/components/Localization.js.map +1 -0
- package/dist/components/context/AttachmentContext.d.ts.map +1 -1
- package/dist/components/context/ExamContext.d.ts.map +1 -1
- package/dist/components/context/QuestionContext.d.ts.map +1 -1
- package/dist/components/context/ResultsContext.d.ts.map +1 -1
- package/dist/components/context/SectionContext.d.ts.map +1 -1
- package/dist/components/grading-instructions/EditableGradingInstruction.d.ts.map +1 -1
- package/dist/components/grading-instructions/EditableGradingInstruction.js +9 -6
- package/dist/components/grading-instructions/EditableGradingInstruction.js.map +1 -1
- package/dist/components/grading-instructions/GradingInstruction.d.ts +7 -0
- package/dist/components/grading-instructions/GradingInstruction.d.ts.map +1 -0
- package/dist/components/grading-instructions/GradingInstruction.js +9 -0
- package/dist/components/grading-instructions/GradingInstruction.js.map +1 -0
- package/dist/components/grading-instructions/GradingInstructions.d.ts +1 -1
- package/dist/components/grading-instructions/editor/AttributeToggleButton.d.ts +9 -0
- package/dist/components/grading-instructions/editor/AttributeToggleButton.d.ts.map +1 -0
- package/dist/components/grading-instructions/editor/AttributeToggleButton.js +53 -0
- package/dist/components/grading-instructions/editor/AttributeToggleButton.js.map +1 -0
- package/dist/components/grading-instructions/editor/CurrentElement.d.ts +2 -0
- package/dist/components/grading-instructions/editor/CurrentElement.d.ts.map +1 -0
- package/dist/components/grading-instructions/editor/CurrentElement.js +8 -0
- package/dist/components/grading-instructions/editor/CurrentElement.js.map +1 -0
- package/dist/components/grading-instructions/editor/CurrentLocalization.d.ts +7 -0
- package/dist/components/grading-instructions/editor/CurrentLocalization.d.ts.map +1 -0
- package/dist/components/grading-instructions/editor/CurrentLocalization.js +13 -0
- package/dist/components/grading-instructions/editor/CurrentLocalization.js.map +1 -0
- package/dist/components/grading-instructions/editor/Formula.d.ts +0 -3
- package/dist/components/grading-instructions/editor/Formula.d.ts.map +1 -1
- package/dist/components/grading-instructions/editor/Formula.js +0 -54
- package/dist/components/grading-instructions/editor/Formula.js.map +1 -1
- package/dist/components/grading-instructions/editor/Localization.d.ts +3 -0
- package/dist/components/grading-instructions/editor/Localization.d.ts.map +1 -0
- package/dist/components/grading-instructions/editor/Localization.js +36 -0
- package/dist/components/grading-instructions/editor/Localization.js.map +1 -0
- package/dist/components/grading-instructions/editor/LocalizationButtons.d.ts +6 -0
- package/dist/components/grading-instructions/editor/LocalizationButtons.d.ts.map +1 -0
- package/dist/components/grading-instructions/editor/LocalizationButtons.js +14 -0
- package/dist/components/grading-instructions/editor/LocalizationButtons.js.map +1 -0
- package/dist/components/grading-instructions/editor/Table.d.ts +0 -2
- package/dist/components/grading-instructions/editor/Table.d.ts.map +1 -1
- package/dist/components/grading-instructions/editor/Table.js +1 -42
- package/dist/components/grading-instructions/editor/Table.js.map +1 -1
- package/dist/components/grading-instructions/editor/localizatio.d.ts +3 -0
- package/dist/components/grading-instructions/editor/localizatio.d.ts.map +1 -0
- package/dist/components/grading-instructions/editor/localizatio.js +36 -0
- package/dist/components/grading-instructions/editor/localizatio.js.map +1 -0
- package/dist/components/grading-instructions/editor/localizationSpan.d.ts +3 -0
- package/dist/components/grading-instructions/editor/localizationSpan.d.ts.map +1 -0
- package/dist/components/grading-instructions/editor/localizationSpan.js +36 -0
- package/dist/components/grading-instructions/editor/localizationSpan.js.map +1 -0
- package/dist/components/grading-instructions/editor/schemas/formulaSchema.d.ts +4 -0
- package/dist/components/grading-instructions/editor/schemas/formulaSchema.d.ts.map +1 -0
- package/dist/components/grading-instructions/editor/schemas/formulaSchema.js +55 -0
- package/dist/components/grading-instructions/editor/schemas/formulaSchema.js.map +1 -0
- package/dist/components/grading-instructions/editor/schemas/imageSchema.d.ts +4 -0
- package/dist/components/grading-instructions/editor/schemas/imageSchema.d.ts.map +1 -0
- package/dist/components/grading-instructions/editor/schemas/imageSchema.js +47 -0
- package/dist/components/grading-instructions/editor/schemas/imageSchema.js.map +1 -0
- package/dist/components/grading-instructions/editor/schemas/spanWithNowrapSchema.d.ts +3 -0
- package/dist/components/grading-instructions/editor/schemas/spanWithNowrapSchema.d.ts.map +1 -0
- package/dist/components/grading-instructions/editor/schemas/spanWithNowrapSchema.js +19 -0
- package/dist/components/grading-instructions/editor/schemas/spanWithNowrapSchema.js.map +1 -0
- package/dist/components/grading-instructions/editor/schemas/tableSchema.d.ts +3 -0
- package/dist/components/grading-instructions/editor/schemas/tableSchema.d.ts.map +1 -0
- package/dist/components/grading-instructions/editor/schemas/tableSchema.js +43 -0
- package/dist/components/grading-instructions/editor/schemas/tableSchema.js.map +1 -0
- package/dist/components/grading-instructions/editor/spanWithPath.d.ts +3 -0
- package/dist/components/grading-instructions/editor/spanWithPath.d.ts.map +1 -0
- package/dist/components/grading-instructions/editor/spanWithPath.js +24 -0
- package/dist/components/grading-instructions/editor/spanWithPath.js.map +1 -0
- package/dist/components/grading-instructions/editor/util.d.ts +6 -0
- package/dist/components/grading-instructions/editor/util.d.ts.map +1 -0
- package/dist/components/grading-instructions/editor/util.js +10 -0
- package/dist/components/grading-instructions/editor/util.js.map +1 -0
- package/dist/main-bundle.js +1 -1
- package/dist/main-bundle.js.LICENSE.txt +1 -1
- package/dist/main.css +1 -1
- package/package.json +2 -2
@@ -0,0 +1,36 @@
|
|
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
|
@@ -0,0 +1 @@
|
|
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"}
|
@@ -0,0 +1 @@
|
|
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"}
|
@@ -0,0 +1,36 @@
|
|
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=localizationSpan.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"localizationSpan.js","sourceRoot":"","sources":["../../../../src/components/grading-instructions/editor/localizationSpan.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"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"formulaSchema.d.ts","sourceRoot":"","sources":["../../../../../src/components/grading-instructions/editor/schemas/formulaSchema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAEjE,eAAO,MAAM,aAAa,EAAE,QAgC3B,CAAA;AAED,eAAO,MAAM,mBAAmB,EAAE,QAoBjC,CAAA"}
|
@@ -0,0 +1,55 @@
|
|
1
|
+
export const formulaSchema = {
|
2
|
+
formula: {
|
3
|
+
inline: true,
|
4
|
+
group: 'inline',
|
5
|
+
atom: true,
|
6
|
+
attrs: {
|
7
|
+
latex: {},
|
8
|
+
mode: { default: '' },
|
9
|
+
assistiveTitle: { default: '' }
|
10
|
+
},
|
11
|
+
parseDOM: [
|
12
|
+
{
|
13
|
+
tag: '[data-editor-id=e-formula]',
|
14
|
+
getAttrs(dom) {
|
15
|
+
return {
|
16
|
+
latex: dom.textContent,
|
17
|
+
mode: dom.getAttribute('mode'),
|
18
|
+
assistiveTitle: dom.getAttribute('assistive-title')
|
19
|
+
};
|
20
|
+
}
|
21
|
+
}
|
22
|
+
],
|
23
|
+
toDOM(node) {
|
24
|
+
const container = document.createElement('img');
|
25
|
+
if (node.attrs.latex) {
|
26
|
+
container.setAttribute('alt', node.attrs.latex);
|
27
|
+
container.setAttribute('formula', 'true');
|
28
|
+
container.setAttribute('src', `/math.svg?latex=${encodeURIComponent(node.attrs.latex)}`);
|
29
|
+
}
|
30
|
+
return container;
|
31
|
+
}
|
32
|
+
}
|
33
|
+
};
|
34
|
+
export const formulaOutputSchema = {
|
35
|
+
formula: {
|
36
|
+
...formulaSchema.formula,
|
37
|
+
toDOM(node) {
|
38
|
+
if (!node.attrs.latex) {
|
39
|
+
return '';
|
40
|
+
}
|
41
|
+
const formulaElement = document.createElement('e:formula');
|
42
|
+
if (node.attrs.mode) {
|
43
|
+
formulaElement.setAttribute('mode', node.attrs.mode);
|
44
|
+
}
|
45
|
+
if (node.attrs.assistiveTitle) {
|
46
|
+
formulaElement.setAttribute('assistive-title', node.attrs.assistiveTitle);
|
47
|
+
}
|
48
|
+
formulaElement.textContent = node.attrs.latex;
|
49
|
+
const container = document.createElement('span');
|
50
|
+
container.appendChild(formulaElement);
|
51
|
+
return container.firstElementChild;
|
52
|
+
}
|
53
|
+
}
|
54
|
+
};
|
55
|
+
//# sourceMappingURL=formulaSchema.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"formulaSchema.js","sourceRoot":"","sources":["../../../../../src/components/grading-instructions/editor/schemas/formulaSchema.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,aAAa,GAAa;IACrC,OAAO,EAAE;QACP,MAAM,EAAE,IAAI;QACZ,KAAK,EAAE,QAAQ;QACf,IAAI,EAAE,IAAI;QACV,KAAK,EAAE;YACL,KAAK,EAAE,EAAE;YACT,IAAI,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;YACrB,cAAc,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;SAChC;QACD,QAAQ,EAAE;YACR;gBACE,GAAG,EAAE,4BAA4B;gBACjC,QAAQ,CAAC,GAAgB;oBACvB,OAAO;wBACL,KAAK,EAAE,GAAG,CAAC,WAAW;wBACtB,IAAI,EAAE,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC;wBAC9B,cAAc,EAAE,GAAG,CAAC,YAAY,CAAC,iBAAiB,CAAC;qBACpD,CAAA;gBACH,CAAC;aACF;SACF;QACD,KAAK,CA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O,SAAS,CAAC,iBAAkB,CAAA;QACrC,CAAC;KACF;CACF,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"imageSchema.d.ts","sourceRoot":"","sources":["../../../../../src/components/grading-instructions/editor/schemas/imageSchema.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAK5C,eAAO,MAAM,gBAAgB,sBAAuB,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAM,KAAG,QA6BjF,CAAA;AAIF,eAAO,MAAM,iBAAiB,EAAE,QAY/B,CAAA"}
|
@@ -0,0 +1,47 @@
|
|
1
|
+
import * as _ from 'lodash-es';
|
2
|
+
import { schema as baseSchema } from 'prosemirror-schema-basic';
|
3
|
+
const existingImageNode = baseSchema.spec.nodes.get('image');
|
4
|
+
export const imageInputSchema = (resolveAttachment) => ({
|
5
|
+
...existingImageNode,
|
6
|
+
attrs: {
|
7
|
+
...existingImageNode === null || existingImageNode === void 0 ? void 0 : existingImageNode.attrs,
|
8
|
+
width: { default: null },
|
9
|
+
height: { default: null },
|
10
|
+
class: { default: null },
|
11
|
+
lang: { default: null }
|
12
|
+
},
|
13
|
+
parseDOM: [
|
14
|
+
{
|
15
|
+
tag: '[data-editor-id="e-image"], img',
|
16
|
+
getAttrs(element) {
|
17
|
+
const src = element.getAttribute('src');
|
18
|
+
if (!src || src.startsWith('data:')) {
|
19
|
+
return false;
|
20
|
+
}
|
21
|
+
const attrs = {
|
22
|
+
...Object.fromEntries(Array.from(element.attributes).map(attr => [attr.name, attr.value])),
|
23
|
+
src: resolveAttachment(element.getAttribute('src') || '')
|
24
|
+
};
|
25
|
+
return attrs;
|
26
|
+
}
|
27
|
+
}
|
28
|
+
],
|
29
|
+
toDOM(node) {
|
30
|
+
return ['img', node.attrs];
|
31
|
+
}
|
32
|
+
});
|
33
|
+
const pathToFilename = (path) => path.split('/').pop();
|
34
|
+
export const imageOutputSchema = {
|
35
|
+
toDOM(node) {
|
36
|
+
const attrs = _.pick(node.attrs, ['lang', 'class', 'src']);
|
37
|
+
const filteredAttrs = _.pickBy(attrs, _.isString);
|
38
|
+
const attributes = _.mapValues(filteredAttrs, (value, key) => {
|
39
|
+
if (key === 'src') {
|
40
|
+
return pathToFilename(value);
|
41
|
+
}
|
42
|
+
return value;
|
43
|
+
});
|
44
|
+
return ['e:image', attributes];
|
45
|
+
}
|
46
|
+
};
|
47
|
+
//# sourceMappingURL=imageSchema.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"imageSchema.js","sourceRoot":"","sources":["../../../../../src/components/grading-instructions/editor/schemas/imageSchema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,WAAW,CAAA;AAE9B,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAE/D,MAAM,iBAAiB,GAAG,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;AAE5D,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,iBAA+C,EAAY,EAAE,CAAC,CAAC;IAC9F,GAAG,iBAAiB;IACpB,KAAK,EAAE;QACL,GAAG,iBAAiB,aAAjB,iBAAiB,uBAAjB,iBAAiB,CAAE,KAAK;QAC3B,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;QACxB,MAAM,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;QACzB,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;QACxB,IAAI,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;KACxB;IACD,QAAQ,EAAE;QACR;YACE,GAAG,EAAE,iCAAiC;YACtC,QAAQ,CAAC,OAAO;gBACd,MAAM,GAAG,GAAG,OAAO,CAAC,YAAY,CAAC,KAAK,CAAC,CAAA;gBAEvC,IAAI,CAAC,GAAG,IAAI,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;oBACpC,OAA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
|
|
1
|
+
{"version":3,"file":"spanWithNowrapSchema.d.ts","sourceRoot":"","sources":["../../../../../src/components/grading-instructions/editor/schemas/spanWithNowrapSchema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAElD,eAAO,MAAM,oBAAoB,EAAE,QAiBlC,CAAA"}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
export const spanWithNowrapSchema = {
|
2
|
+
spanWithClass: {
|
3
|
+
attrs: {
|
4
|
+
class: { default: null }
|
5
|
+
},
|
6
|
+
parseDOM: [
|
7
|
+
{
|
8
|
+
tag: 'span[class="e-nowrap"]',
|
9
|
+
getAttrs(dom) {
|
10
|
+
return { class: dom.getAttribute('class') || null };
|
11
|
+
}
|
12
|
+
}
|
13
|
+
],
|
14
|
+
toDOM(node) {
|
15
|
+
return ['span', { class: node.attrs.class }, 0];
|
16
|
+
}
|
17
|
+
}
|
18
|
+
};
|
19
|
+
//# sourceMappingURL=spanWithNowrapSchema.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"spanWithNowrapSchema.js","sourceRoot":"","sources":["../../../../../src/components/grading-instructions/editor/schemas/spanWithNowrapSchema.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,oBAAoB,GAAa;IAC5C,aAAa,EAAE;QACb,KAAK,EAAE;YACL,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;SACzB;QACD,QAAQ,EAAE;YACR;gBACE,GAAG,EAAE,wBAAwB;gBAC7B,QAAQ,CAAC,GAAgB;oBACvB,OAAO,EAAE,KAAK,EAAE,GAAG,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,IAAI,EAAE,CAAA;gBACrD,CAAC;aACF;SACF;QACD,KAAK,CAAC,IAAU;YACd,OAAO,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAe,EAAE,EAAE,CAAC,CAAC,CAAA;QAC3D,CAAC;KACF;CACF,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"tableSchema.d.ts","sourceRoot":"","sources":["../../../../../src/components/grading-instructions/editor/schemas/tableSchema.ts"],"names":[],"mappings":"AACA,OAAO,EAAQ,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAQlD,eAAO,MAAM,WAAW,EAAE,QAmCzB,CAAA"}
|
@@ -0,0 +1,43 @@
|
|
1
|
+
import { tableNodes } from 'prosemirror-tables';
|
2
|
+
const defaultSchema = tableNodes({
|
3
|
+
tableGroup: 'block',
|
4
|
+
cellContent: 'inline*',
|
5
|
+
cellAttributes: { class: { default: '' } }
|
6
|
+
});
|
7
|
+
export const tableSchema = {
|
8
|
+
...defaultSchema,
|
9
|
+
table: {
|
10
|
+
...defaultSchema.table,
|
11
|
+
parseDOM: [
|
12
|
+
{
|
13
|
+
tag: 'table',
|
14
|
+
getAttrs: (dom) => ({ class: dom.getAttribute('class') })
|
15
|
+
}
|
16
|
+
],
|
17
|
+
attrs: { class: { default: '' } },
|
18
|
+
toDOM(node) {
|
19
|
+
const classNames = node.attrs.class || undefined;
|
20
|
+
return [
|
21
|
+
'table',
|
22
|
+
{
|
23
|
+
class: classNames
|
24
|
+
},
|
25
|
+
['tbody', 0]
|
26
|
+
];
|
27
|
+
}
|
28
|
+
},
|
29
|
+
table_cell: {
|
30
|
+
...defaultSchema.table_cell,
|
31
|
+
parseDOM: [
|
32
|
+
{
|
33
|
+
tag: 'td',
|
34
|
+
getAttrs: (dom) => ({ class: dom.getAttribute('class') })
|
35
|
+
}
|
36
|
+
],
|
37
|
+
toDOM(node) {
|
38
|
+
const classNames = node.attrs.class || undefined;
|
39
|
+
return ['td', { class: classNames }, 0];
|
40
|
+
}
|
41
|
+
}
|
42
|
+
};
|
43
|
+
//# sourceMappingURL=tableSchema.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"tableSchema.js","sourceRoot":"","sources":["../../../../../src/components/grading-instructions/editor/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CAAC,CAAA;QACzC,CAAC;KACF;CACF,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"spanWithPath.d.ts","sourceRoot":"","sources":["../../../../src/components/grading-instructions/editor/spanWithPath.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAElD,eAAO,MAAM,cAAc,EAAE,QAqB5B,CAAA"}
|
@@ -0,0 +1,24 @@
|
|
1
|
+
export const spanWithNowrap = {
|
2
|
+
spanWithClass: {
|
3
|
+
attrs: {
|
4
|
+
class: { default: null }
|
5
|
+
},
|
6
|
+
parseDOM: [
|
7
|
+
{
|
8
|
+
tag: 'span[path]',
|
9
|
+
getAttrs(dom) {
|
10
|
+
var _a, _b, _c;
|
11
|
+
return {
|
12
|
+
path: (_a = dom.getAttribute('path')) !== null && _a !== void 0 ? _a : null,
|
13
|
+
lang: (_b = dom.getAttribute('lang')) !== null && _b !== void 0 ? _b : null,
|
14
|
+
examType: (_c = dom.getAttribute('exam-type')) !== null && _c !== void 0 ? _c : null
|
15
|
+
};
|
16
|
+
}
|
17
|
+
}
|
18
|
+
],
|
19
|
+
toDOM(node) {
|
20
|
+
return ['span', { path: node.attrs.path, lang: node.attrs.lang, 'exam-type': node.attrs.examType }, 0];
|
21
|
+
}
|
22
|
+
}
|
23
|
+
};
|
24
|
+
//# sourceMappingURL=spanWithPath.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"spanWithPath.js","sourceRoot":"","sources":["../../../../src/components/grading-instructions/editor/spanWithPath.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,cAAc,GAAa;IACtC,aAAa,EAAE;QACb,KAAK,EAAE;YACL,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;SACzB;QACD,QAAQ,EAAE;YACR;gBACE,GAAG,EAAE,YAAY;gBACjB,QAAQ,CAAC,GAAgB;;oBACvB,OAAO;wBACL,IAAI,EAAE,MAAA,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,mCAAI,IAAI;wBACtC,IAAI,EAAE,MAAA,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,mCAAI,IAAI;wBACtC,QAAQ,EAAE,MAAA,GAAG,CAAC,YAAY,CAAC,WAAW,CAAC,mCAAI,IAAI;qBAChD,CAAA;gBACH,CAAC;aACF;SACF;QACD,KAAK,CAAC,IAAU;YACd,OAAO,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,IAAc,EAAE,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAA;QAClH,CAAC;KACF;CACF,CAAA"}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import { Transaction } from 'prosemirror-state';
|
2
|
+
export declare function findMark(tr: Transaction, markType: string): import("prosemirror-model").Mark | undefined;
|
3
|
+
export declare function findAttributesFromCursor(tr: Transaction, markType: string): {
|
4
|
+
[key: string]: string;
|
5
|
+
};
|
6
|
+
//# sourceMappingURL=util.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../../src/components/grading-instructions/editor/util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAE/C,wBAAgB,QAAQ,CAAC,EAAE,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,gDAIzD;AAED,wBAAgB,wBAAwB,CAAC,EAAE,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,CAGrG"}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
export function findMark(tr, markType) {
|
2
|
+
const node = tr.doc.nodeAt(tr.selection.from);
|
3
|
+
return node === null || node === void 0 ? void 0 : node.marks.find(mark => mark.type.name == markType);
|
4
|
+
}
|
5
|
+
export function findAttributesFromCursor(tr, markType) {
|
6
|
+
var _a;
|
7
|
+
const mark = findMark(tr, markType);
|
8
|
+
return (_a = mark === null || mark === void 0 ? void 0 : mark.attrs) !== null && _a !== void 0 ? _a : {};
|
9
|
+
}
|
10
|
+
//# sourceMappingURL=util.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"util.js","sourceRoot":"","sources":["../../../../src/components/grading-instructions/editor/util.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,QAAQ,CAAC,EAAe,EAAE,QAAgB;IACxD,MAAM,IAAI,GAAG,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,CAAA;IAE7C,OAAO,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,QAAQ,CAAC,CAAA;AAC7D,CAAC;AAED,MAAM,UAAU,wBAAwB,CAAC,EAAe,EAAE,QAAgB;;IACxE,MAAM,IAAI,GAAG,QAAQ,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAA;IACnC,OAAO,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,KAAK,mCAAI,EAAE,CAAA;AAC1B,CAAC"}
|