@digabi/exam-engine-core 21.0.3-annoteta-react.0 → 21.0.4-alpha.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/__tests__/annotations.test.d.ts.map +1 -1
- package/dist/__tests__/annotations.test.js +175 -60
- package/dist/__tests__/annotations.test.js.map +1 -1
- package/dist/__tests__/tsconfig.tsbuildinfo +1 -1
- package/dist/components/RenderIf.d.ts.map +1 -1
- package/dist/components/attachments/Attachments.d.ts.map +1 -1
- package/dist/components/attachments/Attachments.js +7 -9
- package/dist/components/attachments/Attachments.js.map +1 -1
- package/dist/components/attachments/QuestionTitle.d.ts.map +1 -1
- package/dist/components/attachments/QuestionTitle.js +6 -4
- package/dist/components/attachments/QuestionTitle.js.map +1 -1
- package/dist/components/context/AnnotationContext.d.ts +4 -5
- package/dist/components/context/AnnotationContext.d.ts.map +1 -1
- package/dist/components/context/AnnotationContext.js.map +1 -1
- package/dist/components/context/AnnotationProvider.d.ts +7 -2
- package/dist/components/context/AnnotationProvider.d.ts.map +1 -1
- package/dist/components/context/AnnotationProvider.js +30 -4
- package/dist/components/context/AnnotationProvider.js.map +1 -1
- package/dist/components/context/GradingInstructionContext.d.ts +9 -0
- package/dist/components/context/GradingInstructionContext.d.ts.map +1 -0
- package/dist/components/context/GradingInstructionContext.js +3 -0
- package/dist/components/context/GradingInstructionContext.js.map +1 -0
- package/dist/components/context/IsInSidebarContext.d.ts +0 -1
- package/dist/components/context/IsInSidebarContext.d.ts.map +1 -1
- package/dist/components/context/ResultsContext.d.ts.map +1 -1
- package/dist/components/context/ResultsContext.js.map +1 -1
- package/dist/components/context/TOCContext.d.ts +0 -1
- package/dist/components/context/TOCContext.d.ts.map +1 -1
- package/dist/components/context/withContext.d.ts.map +1 -1
- package/dist/components/exam/ChoiceAnswer.d.ts.map +1 -1
- package/dist/components/exam/ChoiceAnswer.js +16 -14
- package/dist/components/exam/ChoiceAnswer.js.map +1 -1
- package/dist/components/exam/Exam.d.ts +4 -4
- package/dist/components/exam/Exam.d.ts.map +1 -1
- package/dist/components/exam/Exam.js +0 -2
- package/dist/components/exam/Exam.js.map +1 -1
- package/dist/components/exam/RichTextAnswer.d.ts +1 -1
- package/dist/components/exam/RichTextAnswer.d.ts.map +1 -1
- package/dist/components/exam/TextAnswer.d.ts.map +1 -1
- package/dist/components/exam/TextAnswer.js +6 -4
- package/dist/components/exam/TextAnswer.js.map +1 -1
- package/dist/components/exam/internal/ProgressBar.d.ts.map +1 -1
- package/dist/components/exam/internal/ProgressBar.js +1 -0
- package/dist/components/exam/internal/ProgressBar.js.map +1 -1
- package/dist/components/grading/editAnnotations.d.ts.map +1 -1
- package/dist/components/grading/editAnnotations.js +2 -2
- package/dist/components/grading/editAnnotations.js.map +1 -1
- package/dist/components/grading/examAnnotationUtils.d.ts +0 -1
- package/dist/components/grading/examAnnotationUtils.d.ts.map +1 -1
- package/dist/components/grading/examAnnotationUtils.js +88 -37
- package/dist/components/grading/examAnnotationUtils.js.map +1 -1
- package/dist/components/grading-instructions/EditableGradingInstruction.d.ts +5 -0
- package/dist/components/grading-instructions/EditableGradingInstruction.d.ts.map +1 -0
- package/dist/components/grading-instructions/EditableGradingInstruction.js +25 -0
- package/dist/components/grading-instructions/EditableGradingInstruction.js.map +1 -0
- package/dist/components/grading-instructions/GradingInstructionProvider.d.ts +4 -0
- package/dist/components/grading-instructions/GradingInstructionProvider.d.ts.map +1 -0
- package/dist/components/grading-instructions/GradingInstructionProvider.js +8 -0
- package/dist/components/grading-instructions/GradingInstructionProvider.js.map +1 -0
- package/dist/components/grading-instructions/GradingInstructions.d.ts.map +1 -1
- package/dist/components/grading-instructions/GradingInstructions.js +23 -25
- package/dist/components/grading-instructions/GradingInstructions.js.map +1 -1
- package/dist/components/shared/AnnotatableText.d.ts +5 -0
- package/dist/components/shared/AnnotatableText.d.ts.map +1 -0
- package/dist/components/shared/AnnotatableText.js +25 -0
- package/dist/components/shared/AnnotatableText.js.map +1 -0
- package/dist/components/shared/AnnotationMark.d.ts +9 -0
- package/dist/components/shared/AnnotationMark.d.ts.map +1 -0
- package/dist/components/shared/AnnotationMark.js +14 -0
- package/dist/components/shared/AnnotationMark.js.map +1 -0
- package/dist/components/shared/AnnotationPopup.js +4 -4
- package/dist/components/shared/AnnotationPopup.js.map +1 -1
- package/dist/components/shared/AnswerIndicator.d.ts +1 -1
- package/dist/components/shared/AnswerIndicator.d.ts.map +1 -1
- package/dist/components/shared/AnswerIndicator.js +10 -9
- package/dist/components/shared/AnswerIndicator.js.map +1 -1
- package/dist/components/shared/AnswerLengthInfo.d.ts +1 -1
- package/dist/components/shared/AnswerLengthInfo.d.ts.map +1 -1
- package/dist/components/shared/AttachmentLink.d.ts +1 -1
- package/dist/components/shared/AttachmentLink.d.ts.map +1 -1
- package/dist/components/shared/AttachmentLinks.d.ts +1 -1
- package/dist/components/shared/AttachmentLinks.d.ts.map +1 -1
- package/dist/components/shared/References.d.ts.map +1 -1
- package/dist/components/shared/References.js +1 -0
- package/dist/components/shared/References.js.map +1 -1
- package/dist/components/shared/TOCQuestion.js +1 -1
- package/dist/components/shared/TOCQuestion.js.map +1 -1
- package/dist/components/shared/markText.d.ts +5 -0
- package/dist/components/shared/markText.d.ts.map +1 -0
- package/dist/components/shared/markText.js +72 -0
- package/dist/components/shared/markText.js.map +1 -0
- package/dist/createRenderChildNodes.d.ts.map +1 -1
- package/dist/createRenderChildNodes.js +4 -89
- package/dist/createRenderChildNodes.js.map +1 -1
- package/dist/dom-utils.d.ts +1 -0
- package/dist/dom-utils.d.ts.map +1 -1
- package/dist/dom-utils.js +16 -0
- package/dist/dom-utils.js.map +1 -1
- package/dist/i18n/index.d.ts +1 -2
- package/dist/i18n/index.d.ts.map +1 -1
- package/dist/i18n/index.js.map +1 -1
- package/dist/main-bundle.js +1 -1
- package/dist/main.css +1 -1
- package/dist/store/answers/reducer.d.ts.map +1 -1
- package/dist/store/audio/reducer.d.ts.map +1 -1
- package/dist/store/audio/sagas.d.ts.map +1 -1
- package/dist/store/audio/sagas.js +3 -1
- package/dist/store/audio/sagas.js.map +1 -1
- package/dist/store/cas/reducer.d.ts.map +1 -1
- package/dist/store/index.d.ts +1 -2
- package/dist/store/index.d.ts.map +1 -1
- package/dist/store/listenerMiddleware.d.ts +89 -0
- package/dist/store/listenerMiddleware.d.ts.map +1 -0
- package/dist/store/listenerMiddleware.js +6 -0
- package/dist/store/listenerMiddleware.js.map +1 -0
- package/dist/store/selectors.d.ts +1 -1
- package/dist/types/Score.d.ts +18 -3
- package/dist/types/Score.d.ts.map +1 -1
- package/package.json +4 -4
@@ -1,5 +1,5 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import { ExamComponentProps } from '../../createRenderChildNodes';
|
3
|
-
declare const mkAttachmentLink: (type:
|
3
|
+
declare const mkAttachmentLink: (type: "link" | "plain") => React.FunctionComponent<ExamComponentProps>;
|
4
4
|
export default mkAttachmentLink;
|
5
5
|
//# sourceMappingURL=AttachmentLink.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"AttachmentLink.d.ts","sourceRoot":"","sources":["../../../src/components/shared/AttachmentLink.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAA;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAA;AAOjE,QAAA,MAAM,gBAAgB,SAAU,MAAM,GAAG,OAAO,KAAG,
|
1
|
+
{"version":3,"file":"AttachmentLink.d.ts","sourceRoot":"","sources":["../../../src/components/shared/AttachmentLink.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAA;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAA;AAOjE,QAAA,MAAM,gBAAgB,SAAU,MAAM,GAAG,OAAO,KAAG,KAAK,CAAC,iBAAiB,CAAC,kBAAkB,CAyB5F,CAAA;AAED,eAAe,gBAAgB,CAAA"}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import { ExamComponentProps } from '../../createRenderChildNodes';
|
3
|
-
declare const mkAttachmentLinks: (type:
|
3
|
+
declare const mkAttachmentLinks: (type: "link" | "plain") => React.FunctionComponent<ExamComponentProps>;
|
4
4
|
export default mkAttachmentLinks;
|
5
5
|
//# sourceMappingURL=AttachmentLinks.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"AttachmentLinks.d.ts","sourceRoot":"","sources":["../../../src/components/shared/AttachmentLinks.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAA;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAA;AAOjE,QAAA,MAAM,iBAAiB,SAAU,MAAM,GAAG,OAAO,KAAG,
|
1
|
+
{"version":3,"file":"AttachmentLinks.d.ts","sourceRoot":"","sources":["../../../src/components/shared/AttachmentLinks.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAA;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAA;AAOjE,QAAA,MAAM,iBAAiB,SAAU,MAAM,GAAG,OAAO,KAAG,KAAK,CAAC,iBAAiB,CAAC,kBAAkB,CAmC7F,CAAA;AAgCD,eAAe,iBAAiB,CAAA"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"References.d.ts","sourceRoot":"","sources":["../../../src/components/shared/References.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAA;AACzC,OAAO,EAA0B,kBAAkB,EAAE,MAAM,8BAA8B,CAAA;AAUzF,iBAAS,UAAU,CAAC,MAAM,EAAE,kBAAkB,
|
1
|
+
{"version":3,"file":"References.d.ts","sourceRoot":"","sources":["../../../src/components/shared/References.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAA;AACzC,OAAO,EAA0B,kBAAkB,EAAE,MAAM,8BAA8B,CAAA;AAUzF,iBAAS,UAAU,CAAC,MAAM,EAAE,kBAAkB,4BAwB7C;;AAED,wBAAqC"}
|
@@ -14,6 +14,7 @@ function References(_props) {
|
|
14
14
|
const internalReferences = queryAll(root, 'reference').filter(reference => queryAncestors(reference, 'external-material') == null);
|
15
15
|
return internalReferences.length > 0 ? (React.createElement(SectionElement, { "aria-labelledby": referencesTitleId },
|
16
16
|
React.createElement("h2", { id: referencesTitleId }, t('references.heading')),
|
17
|
+
React.createElement("div", { className: "anchor", id: "references" }),
|
17
18
|
React.createElement("ol", { className: "e-list-data", "data-annotation-anchor": referencesTitleId }, internalReferences.map((reference, i) => {
|
18
19
|
const question = queryAncestors(reference, 'question');
|
19
20
|
const displayNumber = question.getAttribute('display-number');
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"References.js","sourceRoot":"","sources":["../../../src/components/shared/References.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AACzC,OAAO,EAAE,sBAAsB,EAAsB,MAAM,8BAA8B,CAAA;AACzF,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAC1D,OAAO,EAAE,2BAA2B,EAAE,MAAM,kBAAkB,CAAA;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAA;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAA;AAChE,OAAO,SAAS,MAAM,aAAa,CAAA;AACnC,OAAO,cAAc,MAAM,mBAAmB,CAAA;AAE9C,MAAM,gBAAgB,GAAG,sBAAsB,CAAC,EAAE,CAAC,CAAA;AACnD,SAAS,UAAU,CAAC,MAA0B;IAC5C,MAAM,EAAE,IAAI,EAAE,GAAG,UAAU,CAAC,iBAAiB,CAAC,CAAA;IAC9C,MAAM,EAAE,CAAC,EAAE,GAAG,kBAAkB,EAAE,CAAA;IAClC,MAAM,kBAAkB,GAAG,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC,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5 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { NewRenderableAnnotation, RenderableAnnotation } from '../../types/Score';
|
3
|
+
export declare function isExistingAnnotation(annotation: NewRenderableAnnotation | RenderableAnnotation): annotation is RenderableAnnotation;
|
4
|
+
export declare function markText(text: string, annotations: (RenderableAnnotation | NewRenderableAnnotation)[], onClickAnnotation: (e: React.MouseEvent<HTMLElement, MouseEvent>, a: RenderableAnnotation) => void, setNewAnnotationRef: (ref: HTMLElement | undefined) => void): React.ReactNode[];
|
5
|
+
//# sourceMappingURL=markText.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"markText.d.ts","sourceRoot":"","sources":["../../../src/components/shared/markText.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAA;AAOjF,wBAAgB,oBAAoB,CAClC,UAAU,EAAE,uBAAuB,GAAG,oBAAoB,GACzD,UAAU,IAAI,oBAAoB,CAEpC;AAMD,wBAAgB,QAAQ,CACtB,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,CAAC,oBAAoB,GAAG,uBAAuB,CAAC,EAAE,EAC/D,iBAAiB,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,EAAE,UAAU,CAAC,EAAE,CAAC,EAAE,oBAAoB,KAAK,IAAI,EAClG,mBAAmB,EAAE,CAAC,GAAG,EAAE,WAAW,GAAG,SAAS,KAAK,IAAI,qBA4G5D"}
|
@@ -0,0 +1,72 @@
|
|
1
|
+
import * as _ from 'lodash-es';
|
2
|
+
import React from 'react';
|
3
|
+
import { AnnotationMark } from './AnnotationMark';
|
4
|
+
function getKey(annotation) {
|
5
|
+
return isExistingAnnotation(annotation) ? annotation.annotationId + annotation.startIndex : annotation.startIndex;
|
6
|
+
}
|
7
|
+
export function isExistingAnnotation(annotation) {
|
8
|
+
return 'annotationId' in annotation;
|
9
|
+
}
|
10
|
+
function getMarkedText(text, startIndex, length) {
|
11
|
+
return text.substring(startIndex, startIndex + length);
|
12
|
+
}
|
13
|
+
export function markText(text, annotations, onClickAnnotation, setNewAnnotationRef) {
|
14
|
+
var _a;
|
15
|
+
if (annotations.length === 0) {
|
16
|
+
return [text];
|
17
|
+
}
|
18
|
+
annotations.sort((a, b) => a.startIndex - b.startIndex);
|
19
|
+
const [hiddenAnnotations, visibleAnnotations] = _.partition(annotations, a => a.hidden);
|
20
|
+
const nodes = [];
|
21
|
+
hiddenAnnotations.forEach(annotation => {
|
22
|
+
const key = getKey(annotation);
|
23
|
+
nodes.push(React.createElement("mark", { key: key, className: "e-annotation", "data-annotation-id": isExistingAnnotation(annotation) ? annotation.annotationId : '', "data-hidden": "true" }));
|
24
|
+
});
|
25
|
+
let lastIndex = 0;
|
26
|
+
const onlyLeadingSpacesRemoved = text.replace(/^\s+/, ' ');
|
27
|
+
const indentationSize = text.length - onlyLeadingSpacesRemoved.length;
|
28
|
+
const notOverlappingAnnotations = visibleAnnotations.reduce((acc, annotation) => {
|
29
|
+
const overlapsWithAnyVisibleAnnotation = acc.some(a => annotation.startIndex < a.startIndex + a.length &&
|
30
|
+
a.startIndex < annotation.startIndex + annotation.length &&
|
31
|
+
!a.hidden);
|
32
|
+
acc.push({
|
33
|
+
...annotation,
|
34
|
+
hidden: annotation.hidden || overlapsWithAnyVisibleAnnotation
|
35
|
+
});
|
36
|
+
return acc;
|
37
|
+
}, []);
|
38
|
+
for (const annotation of notOverlappingAnnotations) {
|
39
|
+
/* "August 2024 annotation" refers to annotations made on or after 7.8.2024, and on or before x.8.2024.
|
40
|
+
* They use trimmed exam content (textWithoutLineBreaksAndExtraSpaces) for calculating startIndex.
|
41
|
+
* Support for "August 2024 annotations" can be removed at least when S25 exams are held.
|
42
|
+
*
|
43
|
+
* TODO:
|
44
|
+
* When support for Aug 2024 annotations can be removed, just do:
|
45
|
+
* const correctStartIndex = annotation.startIndex
|
46
|
+
* and remove any unused code left behind
|
47
|
+
*/
|
48
|
+
const textWithoutLineBreaksAndExtraSpaces = text.replace(/\n/g, ' ').replace(/\s+/g, ' ');
|
49
|
+
const annotatedTextAugust2024 = getMarkedText(textWithoutLineBreaksAndExtraSpaces, annotation.startIndex, annotation.length);
|
50
|
+
const isAugust2024Annotation = annotatedTextAugust2024 === annotation.selectedText;
|
51
|
+
/**
|
52
|
+
* index difference is defined by how much indentation the text paragraph has in xml,
|
53
|
+
* and by how many line breaks there are before the annotated text.
|
54
|
+
* */
|
55
|
+
const amountOfLineBreaksBeforeAnnotation = ((_a = text.split(annotation.selectedText)[0].match(/\n/g)) === null || _a === void 0 ? void 0 : _a.length) || 0;
|
56
|
+
const startIndexDifference = amountOfLineBreaksBeforeAnnotation * indentationSize;
|
57
|
+
const correctStartIndex = annotation.startIndex + (isAugust2024Annotation ? startIndexDifference : 0);
|
58
|
+
const annotatedTextWithCorrectedStartIndex = getMarkedText(text, correctStartIndex, annotation.length);
|
59
|
+
// Add unmarked text before this mark
|
60
|
+
if (correctStartIndex > lastIndex) {
|
61
|
+
nodes.push(text.substring(lastIndex, correctStartIndex));
|
62
|
+
}
|
63
|
+
// Add marked text
|
64
|
+
const key = getKey(annotation);
|
65
|
+
nodes.push(annotation.hidden ? (React.createElement("mark", { key: key, className: "e-annotation", "data-annotation-id": isExistingAnnotation(annotation) ? annotation.annotationId : '', "data-hidden": "true" })) : (React.createElement(AnnotationMark, { key: key, annotation: annotation, markedText: annotatedTextWithCorrectedStartIndex, onClickAnnotation: onClickAnnotation, setNewAnnotationRef: setNewAnnotationRef })));
|
66
|
+
lastIndex = correctStartIndex + annotation.length;
|
67
|
+
}
|
68
|
+
// Add remaining unmarked text
|
69
|
+
nodes.push(text.substring(lastIndex));
|
70
|
+
return nodes;
|
71
|
+
}
|
72
|
+
//# sourceMappingURL=markText.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"markText.js","sourceRoot":"","sources":["../../../src/components/shared/markText.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AAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,CAAA;IACrC,OAAO,KAAK,CAAA;AACd,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"createRenderChildNodes.d.ts","sourceRoot":"","sources":["../src/createRenderChildNodes.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
1
|
+
{"version":3,"file":"createRenderChildNodes.d.ts","sourceRoot":"","sources":["../src/createRenderChildNodes.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,eAAO,MAAM,gBAAgB,0CAA0C,CAAA;AACvE,eAAO,MAAM,iBAAiB,iCAAiC,CAAA;AAE/D,MAAM,WAAW,kBAAkB;IACjC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,kCAAkC;IAClC,OAAO,EAAE,OAAO,CAAA;IAChB,2EAA2E;IAC3E,gBAAgB,EAAE,gBAAgB,CAAA;CACnC;AAED,0BAAkB,aAAa;IAC7B,UAAU,IAAA;IACV,QAAQ,IAAA;CACT;AAED,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,aAAa,KAAK,KAAK,CAAC,SAAS,EAAE,CAAA;AAE/F,wBAAgB,sBAAsB,CACpC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,aAAa,CAAC,kBAAkB,CAAC,CAAC,GACpE,gBAAgB,CAgDlB"}
|
@@ -1,25 +1,8 @@
|
|
1
|
-
import React
|
2
|
-
import {
|
3
|
-
import {
|
4
|
-
import { mapChildNodes, queryAncestors } from './dom-utils';
|
5
|
-
import { IsInSidebarContext } from './components/context/IsInSidebarContext';
|
1
|
+
import React from 'react';
|
2
|
+
import { getElementPath, mapChildNodes } from './dom-utils';
|
3
|
+
import { AnnotatableText } from './components/shared/AnnotatableText';
|
6
4
|
export const ExamNamespaceURI = 'http://ylioppilastutkinto.fi/exam.xsd';
|
7
5
|
export const XHTMLNamespaceURI = 'http://www.w3.org/1999/xhtml';
|
8
|
-
function getElementPath(element) {
|
9
|
-
var _a, _b, _c;
|
10
|
-
const temp = !element.tagName && Array.from(((_a = element.parentNode) === null || _a === void 0 ? void 0 : _a.childNodes) || []).indexOf(element);
|
11
|
-
const elementIndex = Array.from(((_b = element.parentElement) === null || _b === void 0 ? void 0 : _b.children) || []).indexOf(element);
|
12
|
-
let path = `${element.nodeName}:${elementIndex > 0 ? elementIndex : temp}`;
|
13
|
-
let currentElement = element;
|
14
|
-
while (currentElement.parentElement) {
|
15
|
-
currentElement = currentElement.parentElement;
|
16
|
-
const displayNumber = currentElement.getAttribute('display-number');
|
17
|
-
const index = Number(displayNumber) || Array.from(((_c = currentElement.parentElement) === null || _c === void 0 ? void 0 : _c.children) || []).indexOf(currentElement);
|
18
|
-
const elementId = currentElement.getAttribute('id');
|
19
|
-
path = `${elementId || currentElement.nodeName}:${index} > ${path}`;
|
20
|
-
}
|
21
|
-
return path;
|
22
|
-
}
|
23
6
|
export function createRenderChildNodes(componentMap) {
|
24
7
|
function renderChildNode(node, index, options) {
|
25
8
|
switch (node.nodeType) {
|
@@ -65,76 +48,8 @@ export function createRenderChildNodes(componentMap) {
|
|
65
48
|
return renderChildNodes;
|
66
49
|
}
|
67
50
|
function renderTextNode(node) {
|
68
|
-
|
69
|
-
const annotationContextData = useContext(AnnotationContext);
|
70
|
-
const { isInSidebar } = useContext(IsInSidebarContext);
|
71
|
-
if ((annotationContextData === null || annotationContextData === void 0 ? void 0 : annotationContextData.annotations) === undefined ||
|
72
|
-
((_a = node.textContent) === null || _a === void 0 ? void 0 : _a.trim().length) === 0 ||
|
73
|
-
isInSidebar !== undefined) {
|
74
|
-
return node.textContent;
|
75
|
-
}
|
76
|
-
return (React.createElement(AnnotatableText, { node: node, annotationContextData: annotationContextData, key: getElementPath(node) }));
|
51
|
+
return React.createElement(AnnotatableText, { node: node, key: getElementPath(node) });
|
77
52
|
}
|
78
|
-
const isExamAnnotation = (annotation) => 'annotationId' in annotation;
|
79
|
-
const AnnotatableText = ({ node, annotationContextData }) => {
|
80
|
-
const { annotations, onClickAnnotation, setNewAnnotation, setNewAnnotationRef, newAnnotation } = annotationContextData;
|
81
|
-
const path = getElementPath(node);
|
82
|
-
const newAnnotationForThisNode = (newAnnotation === null || newAnnotation === void 0 ? void 0 : newAnnotation.annotationAnchor) === path ? newAnnotation : null;
|
83
|
-
const thisNodeAnnotations = [
|
84
|
-
...((annotations === null || annotations === void 0 ? void 0 : annotations[path]) || []),
|
85
|
-
...(newAnnotationForThisNode ? [newAnnotationForThisNode] : [])
|
86
|
-
];
|
87
|
-
const mouseUpCallback = (annotation) => {
|
88
|
-
var _a;
|
89
|
-
const displayNumber = ((_a = queryAncestors(node.parentElement, 'question')) === null || _a === void 0 ? void 0 : _a.getAttribute('display-number')) || '';
|
90
|
-
setNewAnnotation({ ...annotation, annotationAnchor: path, displayNumber });
|
91
|
-
};
|
92
|
-
function onMouseDown(e) {
|
93
|
-
const target = e.target;
|
94
|
-
const clickIsInPopup = target.closest('.annotation-popup');
|
95
|
-
if (!clickIsInPopup) {
|
96
|
-
setNewAnnotation(null);
|
97
|
-
}
|
98
|
-
onMouseDownForAnnotation(e, mouseUpCallback);
|
99
|
-
}
|
100
|
-
return (React.createElement("span", { onMouseDown: onMouseDown, className: "e-annotatable", key: path }, (thisNodeAnnotations === null || thisNodeAnnotations === void 0 ? void 0 : thisNodeAnnotations.length) > 0 ? markText(node.textContent, thisNodeAnnotations) : node.textContent));
|
101
|
-
function markText(text, annotations) {
|
102
|
-
if (annotations.length === 0) {
|
103
|
-
return [text];
|
104
|
-
}
|
105
|
-
const nodes = [];
|
106
|
-
let lastIndex = 0;
|
107
|
-
annotations.sort((a, b) => a.startIndex - b.startIndex);
|
108
|
-
for (const annotation of annotations) {
|
109
|
-
if (annotation.startIndex < 0 || annotation.length <= 0) {
|
110
|
-
return [text];
|
111
|
-
}
|
112
|
-
// Add unmarked text before this mark
|
113
|
-
if (annotation.startIndex > lastIndex) {
|
114
|
-
nodes.push(text.substring(lastIndex, annotation.startIndex));
|
115
|
-
}
|
116
|
-
// Add marked text
|
117
|
-
const markedText = text.substring(annotation.startIndex, annotation.startIndex + annotation.length);
|
118
|
-
nodes.push(annotation.hidden ? (React.createElement("mark", { key: annotation.startIndex, className: "e-annotation", "data-annotation-id": isExamAnnotation(annotation) ? annotation.annotationId : '', "data-hidden": "true" })) : (React.createElement(Mark, { key: annotation.startIndex, annotation: annotation, markedText: markedText, onClickAnnotation: onClickAnnotation, setNewAnnotationRef: setNewAnnotationRef })));
|
119
|
-
lastIndex = annotation.startIndex + annotation.length;
|
120
|
-
}
|
121
|
-
// Add remaining unmarked text
|
122
|
-
nodes.push(text.substring(lastIndex));
|
123
|
-
return nodes;
|
124
|
-
}
|
125
|
-
};
|
126
|
-
const Mark = ({ annotation, markedText, onClickAnnotation, setNewAnnotationRef }) => {
|
127
|
-
const markRef = useRef(null);
|
128
|
-
useEffect(() => {
|
129
|
-
console.log('MARK', markRef.current, annotation, isExamAnnotation(annotation));
|
130
|
-
if (markRef.current && !isExamAnnotation(annotation)) {
|
131
|
-
setNewAnnotationRef(markRef.current);
|
132
|
-
}
|
133
|
-
}, []);
|
134
|
-
return (React.createElement("mark", { ref: markRef, className: "e-annotation", "data-annotation-id": isExamAnnotation(annotation) ? annotation.annotationId : '', "data-hidden": "false", onClick: e => (isExamAnnotation(annotation) ? onClickAnnotation(e, annotation) : undefined) },
|
135
|
-
markedText,
|
136
|
-
(annotation === null || annotation === void 0 ? void 0 : annotation.markNumber) && React.createElement("sup", { className: "e-annotation", "data-content": annotation === null || annotation === void 0 ? void 0 : annotation.markNumber })));
|
137
|
-
};
|
138
53
|
function htmlAttributes2props(element, index) {
|
139
54
|
const props = { key: key(element, index) };
|
140
55
|
for (const attribute of element.attributes) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"createRenderChildNodes.js","sourceRoot":"","sources":["../src/createRenderChildNodes.tsx"],"names":[],"mappings":"AAA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,CAAC;AAED,SAAS,oBAAoB,CAAwB,OAAU,EAAE,KAAa;IAC5E,MAAM,KAAK,GAAuB,EAAE,GAAG,EAAE,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC,EAAE,CAAA;IAC9D,KAAK,MAAM,SAAS,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC;QAC3C,MAAM,IAAI,GAAG,SAAS,CAAC,SAAS,KAAK,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAE,SAAS,CAAC,SAAsC,CAAA;QAC9G,KAAK,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC,KAAK,CAAA;IAC/B,CAAC;IACD,OAAO,KAAK,CAAA;AACd,CAAC;AAED,SAAS,GAAG,CAAC,OAAgB,EAAE,KAAa;IAC1C,OAAO,GAAG,OAAO,CAAC,SAAS,IAAI,KAAK,EAAE,CAAA;AACxC,CAAC"}
|
package/dist/dom-utils.d.ts
CHANGED
@@ -15,5 +15,6 @@ export declare function hasSiblingQuestions(answer: Element): boolean | undefine
|
|
15
15
|
export declare function createElement<K extends keyof HTMLElementTagNameMap>(tagName: K, properties?: Record<string, string> | null, ...children: Array<string | ChildNode>): HTMLElementTagNameMap[K];
|
16
16
|
export declare function setProperties(element: HTMLElement, properties?: Record<string, string> | null): void;
|
17
17
|
export declare function useIsElementInViewport(elementType: 'question' | 'section', displayNumber: string): boolean;
|
18
|
+
export declare function getElementPath(element: Element): string;
|
18
19
|
export {};
|
19
20
|
//# sourceMappingURL=dom-utils.d.ts.map
|
package/dist/dom-utils.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"dom-utils.d.ts","sourceRoot":"","sources":["../src/dom-utils.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,IAAI,WAAW,CAAA;AAE5B,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,CAAC,EAAE,QAAQ,GAAG,OAAO,EAAE,CAU/E;AAED,KAAK,QAAQ,GAAG,M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OAAO,EAAE,OAAO,GAAG,MAAM,CAgBvD"}
|
package/dist/dom-utils.js
CHANGED
@@ -145,4 +145,20 @@ export function useIsElementInViewport(elementType, displayNumber) {
|
|
145
145
|
}, [visibleTOCElements]);
|
146
146
|
return isVisible;
|
147
147
|
}
|
148
|
+
export function getElementPath(element) {
|
149
|
+
var _a, _b, _c;
|
150
|
+
const index = !element.tagName && Array.from(((_a = element.parentNode) === null || _a === void 0 ? void 0 : _a.childNodes) || []).indexOf(element);
|
151
|
+
const elementIndex = Array.from(((_b = element.parentElement) === null || _b === void 0 ? void 0 : _b.children) || []).indexOf(element);
|
152
|
+
let path = `${element.nodeName}:${elementIndex > 0 ? elementIndex : index}`;
|
153
|
+
let currentElement = element;
|
154
|
+
while (currentElement.parentElement) {
|
155
|
+
currentElement = currentElement.parentElement;
|
156
|
+
const displayNumber = currentElement.getAttribute('display-number');
|
157
|
+
const index = Number(displayNumber) ||
|
158
|
+
Array.from(((_c = currentElement.parentElement) === null || _c === void 0 ? void 0 : _c.children) || [currentElement]).indexOf(currentElement);
|
159
|
+
const elementId = currentElement.getAttribute('id');
|
160
|
+
path = `${elementId || currentElement.nodeName}:${index} > ${path}`;
|
161
|
+
}
|
162
|
+
return path;
|
163
|
+
}
|
148
164
|
//# sourceMappingURL=dom-utils.js.map
|
package/dist/dom-utils.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"dom-utils.js","sourceRoot":"","sources":["../src/dom-utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,WAAW,CAAA;AAC9B,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAC3D,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAA;AAE5D,MAAM,CAAC,MAAM,IAAI,GAAG,QAAQ,CAAA;AAE5B,MAAM,UAAU,cAAc,CAAC,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AAC,OAAO,IAAI,KAAK,CAAC,IAAI,CAAC,CAAA,MAAA,OAAO,CAAC,UAAU,0CAAE,UAAU,KAAI,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA;IACnG,MAAM,YAAY,GAAG,KAAK,CAAC,IAAI,CAAC,CAAA,MAAA,OAAO,CAAC,aAAa,0CAAE,QAAQ,KAAI,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA;IACvF,IAAI,IAAI,GAAG,GAAG,OAAO,CAAC,QAAQ,IAAI,YAAY,GAAG,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,KAAK,EAAE,CAAA;IAC3E,IAAI,cAAc,GAAG,OAAO,CAAA;IAC5B,OAAO,cAAc,CAAC,aAAa,EAAE,CAAC;QACpC,cAAc,GAAG,cAAc,CAAC,aAAa,CAAA;QAC7C,MAAM,aAAa,GAAG,cAAc,CAAC,YAAY,CAAC,gBAAgB,CAAC,CAAA;QACnE,MAAM,KAAK,GACT,MAAM,CAAC,aAAa,CAAC;YACrB,KAAK,CAAC,IAAI,CAAC,CAAA,MAAA,cAAc,CAAC,aAAa,0CAAE,QAAQ,KAAI,CAAC,cAAc,CAAC,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,CAAA;QAChG,MAAM,SAAS,GAAG,cAAc,CAAC,YAAY,CAAC,IAAI,CAAC,CAAA;QACnD,IAAI,GAAG,GAAG,SAAS,IAAI,cAAc,CAAC,QAAQ,IAAI,KAAK,MAAM,IAAI,EAAE,CAAA;IACrE,CAAC;IAED,OAAO,IAAI,CAAA;AACb,CAAC"}
|
package/dist/i18n/index.d.ts
CHANGED
@@ -4,8 +4,7 @@ declare module 'react-i18next' {
|
|
4
4
|
type ExamEngineI18nResources = {
|
5
5
|
translation: typeof fi_FI;
|
6
6
|
};
|
7
|
-
|
8
|
-
}
|
7
|
+
type Resources = ExamEngineI18nResources;
|
9
8
|
}
|
10
9
|
export declare function initI18n(language: string, examCode?: string, dayCode?: string): typeof i18n;
|
11
10
|
export declare function useExamTranslation(): {
|
package/dist/i18n/index.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/i18n/index.tsx"],"names":[],"mappings":"AAAA,OAAO,IAAI,EAAE,EAAuB,QAAQ,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAUxE,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAgD/B,OAAO,QAAQ,eAAe,CAAC;IAC7B,KAAK,uBAAuB,GAAG;QAAE,WAAW,EAAE,OAAO,KAAK,CAAA;KAAE,CAAA;
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/i18n/index.tsx"],"names":[],"mappings":"AAAA,OAAO,IAAI,EAAE,EAAuB,QAAQ,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAUxE,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAgD/B,OAAO,QAAQ,eAAe,CAAC;IAC7B,KAAK,uBAAuB,GAAG;QAAE,WAAW,EAAE,OAAO,KAAK,CAAA;KAAE,CAAA;IAC5D,KAAK,SAAS,GAAG,uBAAuB,CAAA;CACzC;AAED,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,IAAI,CAwC3F;AAED,wBAAgB,kBAAkB;;;cAGxB,MAAM,GAAG,MAAM,EAAE,YAAY,QAAQ,GAAG,MAAM,GAAG,GAAG,CAAC,OAAO;aAC7D,SAAS;;EAKjB;AAgCD,eAAO,MAAM,cAAc,UAAW,OAAO,IAAI,YAAY,MAAM,WAAS,IAI3E,CAAA;AAED,eAAe,IAAI,CAAA"}
|
package/dist/i18n/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/i18n/index.tsx"],"names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