@digabi/exam-engine-core 22.0.4-alpha.0 → 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,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=localizationSpan.js.map
@@ -1 +0,0 @@
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"}
@@ -1,4 +0,0 @@
1
- import { NodeSpec } from 'prosemirror-model';
2
- export declare const imageInputSchema: (resolveAttachment: (filename: string) => string) => NodeSpec;
3
- export declare const imageOutputSchema: NodeSpec;
4
- //# sourceMappingURL=image-schema.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"image-schema.d.ts","sourceRoot":"","sources":["../../../../../src/components/grading-instructions/editor/schemas/image-schema.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"}
@@ -1,47 +0,0 @@
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=image-schema.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"image-schema.js","sourceRoot":"","sources":["../../../../../src/components/grading-instructions/editor/schemas/image-schema.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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,KAAK,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAA;QACjD,MAAM,UAAU,GAAG,CAAC,CAAC,SAAS,CAAC,aAAa,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;YAC3D,IAAI,GAAG,KAAK,KAAK,EAAE,CAAC;gBAClB,OAAO,cAAc,CAAC,KAAK,CAAC,CAAA;YAC9B,CAAC;YACD,OAAO,KAAK,CAAA;QACd,CAAC,CAAC,CAAA;QACF,OAAO,CAAC,SAAS,EAAE,UAAU,CAAC,CAAA;IAChC,CAAC;CACF,CAAA"}
@@ -1,3 +0,0 @@
1
- import { MarkSpec } from 'prosemirror-model';
2
- export declare const spanWithNowrap: MarkSpec;
3
- //# sourceMappingURL=spanWithPath.d.ts.map
@@ -1 +0,0 @@
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"}
@@ -1,24 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,6 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,10 +0,0 @@
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
@@ -1 +0,0 @@
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"}