@citolab/qti-components 7.27.3 → 7.27.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cdn/index.global.js +1 -1
- package/cdn/index.js +169 -162
- package/custom-elements.json +4216 -1178
- package/dist/base.d.ts +3 -2
- package/dist/base.js +1 -1
- package/dist/{chunk-D6EHVZG2.js → chunk-47XMSJK3.js} +6 -8
- package/dist/chunk-47XMSJK3.js.map +1 -0
- package/dist/{chunk-K7HR6ZAY.js → chunk-CEGI6UUL.js} +8 -3
- package/dist/chunk-CEGI6UUL.js.map +1 -0
- package/dist/{chunk-CSYOTHK2.js → chunk-FK2IVMS3.js} +205 -211
- package/dist/chunk-FK2IVMS3.js.map +1 -0
- package/dist/{chunk-CVB5ISWF.js → chunk-LQZCSHN5.js} +2 -2
- package/dist/{chunk-DGIXWHK3.js → chunk-N7S3GNUP.js} +2 -2
- package/dist/{chunk-WMPG7ULB.js → chunk-SNRBEBO7.js} +4 -4
- package/dist/{chunk-3XXXAWMZ.js → chunk-SUQA7VZJ.js} +263 -7
- package/dist/chunk-SUQA7VZJ.js.map +1 -0
- package/dist/{chunk-RXRKP6P7.js → chunk-TELCVV2J.js} +2 -2
- package/dist/{chunk-PHCCFYNE.js → chunk-YLIYPNMK.js} +994 -2
- package/dist/chunk-YLIYPNMK.js.map +1 -0
- package/dist/{chunk-A7HX4462.js → chunk-Z2SUBRH5.js} +14 -2
- package/dist/{chunk-A7HX4462.js.map → chunk-Z2SUBRH5.js.map} +1 -1
- package/dist/elements.d.ts +67 -2
- package/dist/elements.js +10 -6
- package/dist/index.d.ts +5 -4
- package/dist/index.js +55 -11
- package/dist/interactions.d.ts +2 -2
- package/dist/interactions.js +3 -3
- package/dist/item.js +4 -4
- package/dist/loader.d.ts +2 -1
- package/dist/loader.js +2 -2
- package/dist/processing.d.ts +374 -17
- package/dist/processing.js +42 -2
- package/dist/qti-components-jsx.d.ts +1446 -389
- package/dist/{qti-rule-base-DGhWN-as.d.ts → qti-condition-expression-B1BYmCcq.d.ts} +1 -14
- package/dist/{qti-feedback-BZjWNyxP.d.ts → qti-feedback-ChmXhZuf.d.ts} +1 -1
- package/dist/qti-rule-base-ajOnfGXY.d.ts +16 -0
- package/dist/test.d.ts +2 -1
- package/dist/test.js +6 -6
- package/dist/transformers.js +1 -1
- package/package.json +10 -10
- package/dist/chunk-3XXXAWMZ.js.map +0 -1
- package/dist/chunk-CSYOTHK2.js.map +0 -1
- package/dist/chunk-D6EHVZG2.js.map +0 -1
- package/dist/chunk-K7HR6ZAY.js.map +0 -1
- package/dist/chunk-PHCCFYNE.js.map +0 -1
- /package/dist/{chunk-CVB5ISWF.js.map → chunk-LQZCSHN5.js.map} +0 -0
- /package/dist/{chunk-DGIXWHK3.js.map → chunk-N7S3GNUP.js.map} +0 -0
- /package/dist/{chunk-WMPG7ULB.js.map → chunk-SNRBEBO7.js.map} +0 -0
- /package/dist/{chunk-RXRKP6P7.js.map → chunk-TELCVV2J.js.map} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
o as o2
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-N7S3GNUP.js";
|
|
4
4
|
import {
|
|
5
5
|
A,
|
|
6
6
|
E,
|
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
u,
|
|
30
30
|
v,
|
|
31
31
|
watch
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-Z2SUBRH5.js";
|
|
33
33
|
import {
|
|
34
34
|
__decorateClass
|
|
35
35
|
} from "./chunk-QXBXORM3.js";
|
|
@@ -615,8 +615,8 @@ var [Observable, Subscriber] = (() => {
|
|
|
615
615
|
if (isBrowserContext() && !isDocumentFullyActive(document)) return;
|
|
616
616
|
try {
|
|
617
617
|
teardown();
|
|
618
|
-
} catch (
|
|
619
|
-
reportError(
|
|
618
|
+
} catch (e4) {
|
|
619
|
+
reportError(e4);
|
|
620
620
|
}
|
|
621
621
|
}
|
|
622
622
|
}
|
|
@@ -667,8 +667,8 @@ var [Observable, Subscriber] = (() => {
|
|
|
667
667
|
if (observableState.subscribeCallback) {
|
|
668
668
|
try {
|
|
669
669
|
observableState.subscribeCallback(subscriber);
|
|
670
|
-
} catch (
|
|
671
|
-
subscriber.error(
|
|
670
|
+
} catch (e4) {
|
|
671
|
+
subscriber.error(e4);
|
|
672
672
|
}
|
|
673
673
|
}
|
|
674
674
|
}
|
|
@@ -963,8 +963,8 @@ var [Observable, Subscriber] = (() => {
|
|
|
963
963
|
let mappedValue;
|
|
964
964
|
try {
|
|
965
965
|
mappedValue = mapper(value, idx);
|
|
966
|
-
} catch (
|
|
967
|
-
subscriber.error(
|
|
966
|
+
} catch (e4) {
|
|
967
|
+
subscriber.error(e4);
|
|
968
968
|
return;
|
|
969
969
|
}
|
|
970
970
|
idx += 1;
|
|
@@ -1002,8 +1002,8 @@ var [Observable, Subscriber] = (() => {
|
|
|
1002
1002
|
if (subscribeCallback !== null) {
|
|
1003
1003
|
try {
|
|
1004
1004
|
subscribeCallback();
|
|
1005
|
-
} catch (
|
|
1006
|
-
subscriber.error(
|
|
1005
|
+
} catch (e4) {
|
|
1006
|
+
subscriber.error(e4);
|
|
1007
1007
|
return;
|
|
1008
1008
|
}
|
|
1009
1009
|
}
|
|
@@ -1012,8 +1012,8 @@ var [Observable, Subscriber] = (() => {
|
|
|
1012
1012
|
if (abortCallback !== null) {
|
|
1013
1013
|
abortCallback(subscriber.signal.reason);
|
|
1014
1014
|
}
|
|
1015
|
-
} catch (
|
|
1016
|
-
reportError(
|
|
1015
|
+
} catch (e4) {
|
|
1016
|
+
reportError(e4);
|
|
1017
1017
|
}
|
|
1018
1018
|
};
|
|
1019
1019
|
subscriber.signal.addEventListener("abort", abortCallbackWrapped, { once: true });
|
|
@@ -1022,9 +1022,9 @@ var [Observable, Subscriber] = (() => {
|
|
|
1022
1022
|
if (nextCallback !== null) {
|
|
1023
1023
|
try {
|
|
1024
1024
|
nextCallback(value);
|
|
1025
|
-
} catch (
|
|
1025
|
+
} catch (e4) {
|
|
1026
1026
|
subscriber.signal.removeEventListener("abort", abortCallbackWrapped);
|
|
1027
|
-
subscriber.error(
|
|
1027
|
+
subscriber.error(e4);
|
|
1028
1028
|
return;
|
|
1029
1029
|
}
|
|
1030
1030
|
}
|
|
@@ -1035,8 +1035,8 @@ var [Observable, Subscriber] = (() => {
|
|
|
1035
1035
|
if (errorCallback !== null) {
|
|
1036
1036
|
try {
|
|
1037
1037
|
errorCallback(error);
|
|
1038
|
-
} catch (
|
|
1039
|
-
subscriber.error(
|
|
1038
|
+
} catch (e4) {
|
|
1039
|
+
subscriber.error(e4);
|
|
1040
1040
|
return;
|
|
1041
1041
|
}
|
|
1042
1042
|
}
|
|
@@ -1047,8 +1047,8 @@ var [Observable, Subscriber] = (() => {
|
|
|
1047
1047
|
if (completeCallback !== null) {
|
|
1048
1048
|
try {
|
|
1049
1049
|
completeCallback();
|
|
1050
|
-
} catch (
|
|
1051
|
-
subscriber.error(
|
|
1050
|
+
} catch (e4) {
|
|
1051
|
+
subscriber.error(e4);
|
|
1052
1052
|
return;
|
|
1053
1053
|
}
|
|
1054
1054
|
}
|
|
@@ -1073,8 +1073,8 @@ var [Observable, Subscriber] = (() => {
|
|
|
1073
1073
|
let matches = false;
|
|
1074
1074
|
try {
|
|
1075
1075
|
matches = predicate(value, idx);
|
|
1076
|
-
} catch (
|
|
1077
|
-
subscriber.error(
|
|
1076
|
+
} catch (e4) {
|
|
1077
|
+
subscriber.error(e4);
|
|
1078
1078
|
return;
|
|
1079
1079
|
}
|
|
1080
1080
|
idx += 1;
|
|
@@ -1157,15 +1157,15 @@ var [Observable, Subscriber] = (() => {
|
|
|
1157
1157
|
let mappedResult;
|
|
1158
1158
|
try {
|
|
1159
1159
|
mappedResult = mapper(value, idx);
|
|
1160
|
-
} catch (
|
|
1161
|
-
return subscriber.error(
|
|
1160
|
+
} catch (e4) {
|
|
1161
|
+
return subscriber.error(e4);
|
|
1162
1162
|
}
|
|
1163
1163
|
idx += 1;
|
|
1164
1164
|
let innerObservable;
|
|
1165
1165
|
try {
|
|
1166
1166
|
innerObservable = Observable2.from(mappedResult);
|
|
1167
|
-
} catch (
|
|
1168
|
-
return subscriber.error(
|
|
1167
|
+
} catch (e4) {
|
|
1168
|
+
return subscriber.error(e4);
|
|
1169
1169
|
}
|
|
1170
1170
|
let innerObserver = new InternalObserver({
|
|
1171
1171
|
next(value2) {
|
|
@@ -1226,15 +1226,15 @@ var [Observable, Subscriber] = (() => {
|
|
|
1226
1226
|
let mappedResult;
|
|
1227
1227
|
try {
|
|
1228
1228
|
mappedResult = mapper(value, idx);
|
|
1229
|
-
} catch (
|
|
1230
|
-
return subscriber.error(
|
|
1229
|
+
} catch (e4) {
|
|
1230
|
+
return subscriber.error(e4);
|
|
1231
1231
|
}
|
|
1232
1232
|
idx += 1;
|
|
1233
1233
|
let innerObservable;
|
|
1234
1234
|
try {
|
|
1235
1235
|
innerObservable = Observable2.from(mappedResult);
|
|
1236
|
-
} catch (
|
|
1237
|
-
return subscriber.error(
|
|
1236
|
+
} catch (e4) {
|
|
1237
|
+
return subscriber.error(e4);
|
|
1238
1238
|
}
|
|
1239
1239
|
let innerObserver = new InternalObserver({
|
|
1240
1240
|
next(value2) {
|
|
@@ -1394,9 +1394,9 @@ var [Observable, Subscriber] = (() => {
|
|
|
1394
1394
|
next(value) {
|
|
1395
1395
|
try {
|
|
1396
1396
|
callback(value, idx);
|
|
1397
|
-
} catch (
|
|
1398
|
-
reject(
|
|
1399
|
-
visitorCallbackController.abort(
|
|
1397
|
+
} catch (e4) {
|
|
1398
|
+
reject(e4);
|
|
1399
|
+
visitorCallbackController.abort(e4);
|
|
1400
1400
|
}
|
|
1401
1401
|
idx += 1;
|
|
1402
1402
|
},
|
|
@@ -1432,9 +1432,9 @@ var [Observable, Subscriber] = (() => {
|
|
|
1432
1432
|
let passed = false;
|
|
1433
1433
|
try {
|
|
1434
1434
|
passed = predicate(value, idx);
|
|
1435
|
-
} catch (
|
|
1436
|
-
reject(
|
|
1437
|
-
controller.abort(
|
|
1435
|
+
} catch (e4) {
|
|
1436
|
+
reject(e4);
|
|
1437
|
+
controller.abort(e4);
|
|
1438
1438
|
}
|
|
1439
1439
|
idx += 1;
|
|
1440
1440
|
if (!passed) {
|
|
@@ -1535,9 +1535,9 @@ var [Observable, Subscriber] = (() => {
|
|
|
1535
1535
|
let passed = false;
|
|
1536
1536
|
try {
|
|
1537
1537
|
passed = predicate(value, idx);
|
|
1538
|
-
} catch (
|
|
1539
|
-
reject(
|
|
1540
|
-
controller.abort(
|
|
1538
|
+
} catch (e4) {
|
|
1539
|
+
reject(e4);
|
|
1540
|
+
controller.abort(e4);
|
|
1541
1541
|
}
|
|
1542
1542
|
idx += 1;
|
|
1543
1543
|
if (passed) {
|
|
@@ -1577,9 +1577,9 @@ var [Observable, Subscriber] = (() => {
|
|
|
1577
1577
|
let passed = false;
|
|
1578
1578
|
try {
|
|
1579
1579
|
passed = predicate(value, idx);
|
|
1580
|
-
} catch (
|
|
1581
|
-
reject(
|
|
1582
|
-
controller.abort(
|
|
1580
|
+
} catch (e4) {
|
|
1581
|
+
reject(e4);
|
|
1582
|
+
controller.abort(e4);
|
|
1583
1583
|
}
|
|
1584
1584
|
idx += 1;
|
|
1585
1585
|
if (passed) {
|
|
@@ -1627,9 +1627,9 @@ var [Observable, Subscriber] = (() => {
|
|
|
1627
1627
|
const result = reducer(accumulator, value, idx);
|
|
1628
1628
|
idx++;
|
|
1629
1629
|
accumulator = result;
|
|
1630
|
-
} catch (
|
|
1631
|
-
reject(
|
|
1632
|
-
controller.abort(
|
|
1630
|
+
} catch (e4) {
|
|
1631
|
+
reject(e4);
|
|
1632
|
+
controller.abort(e4);
|
|
1633
1633
|
return;
|
|
1634
1634
|
}
|
|
1635
1635
|
},
|
|
@@ -2077,15 +2077,15 @@ var DragDropCoreMixin = (superClass, draggablesSelector, droppablesSelector, dra
|
|
|
2077
2077
|
console.error("\u274C [Observable DnD] No shadow root found!");
|
|
2078
2078
|
return;
|
|
2079
2079
|
}
|
|
2080
|
-
const pointerDragSub = shadowRoot.when("pointerdown").filter((
|
|
2081
|
-
if (!
|
|
2080
|
+
const pointerDragSub = shadowRoot.when("pointerdown").filter((e4) => {
|
|
2081
|
+
if (!e4.isTrusted) {
|
|
2082
2082
|
return false;
|
|
2083
2083
|
}
|
|
2084
|
-
const target = findDraggableTarget(
|
|
2084
|
+
const target = findDraggableTarget(e4, draggablesSelector);
|
|
2085
2085
|
const hostDisabled = this.disabled || this.readonly;
|
|
2086
2086
|
const targetDisabled = target?.hasAttribute("disabled") || target?.getAttribute("aria-disabled") === "true";
|
|
2087
2087
|
const touchHandledRecently = Date.now() - this.lastTouchStartAt < 50;
|
|
2088
|
-
return target &&
|
|
2088
|
+
return target && e4.isPrimary !== false && e4.button === 0 && !hostDisabled && !targetDisabled && !touchHandledRecently;
|
|
2089
2089
|
}).subscribe((downEvent) => {
|
|
2090
2090
|
this.lastPointerDownAt = Date.now();
|
|
2091
2091
|
const dragTarget = findDraggableTarget(downEvent, draggablesSelector);
|
|
@@ -2142,11 +2142,11 @@ var DragDropCoreMixin = (superClass, draggablesSelector, droppablesSelector, dra
|
|
|
2142
2142
|
}
|
|
2143
2143
|
}, delay);
|
|
2144
2144
|
});
|
|
2145
|
-
const mouseDragSub = shadowRoot.when("mousedown").filter((
|
|
2146
|
-
const target = findDraggableTarget(
|
|
2145
|
+
const mouseDragSub = shadowRoot.when("mousedown").filter((e4) => {
|
|
2146
|
+
const target = findDraggableTarget(e4, draggablesSelector);
|
|
2147
2147
|
const hostDisabled = this.disabled || this.readonly;
|
|
2148
2148
|
const targetDisabled = target?.hasAttribute("disabled") || target?.getAttribute("aria-disabled") === "true";
|
|
2149
|
-
const isLeftButton =
|
|
2149
|
+
const isLeftButton = e4.button === 0;
|
|
2150
2150
|
const pointerHandledRecently = Date.now() - this.lastPointerDownAt < 50;
|
|
2151
2151
|
return target && isLeftButton && !hostDisabled && !targetDisabled && !pointerHandledRecently;
|
|
2152
2152
|
}).subscribe((downEvent) => {
|
|
@@ -2155,13 +2155,21 @@ var DragDropCoreMixin = (superClass, draggablesSelector, droppablesSelector, dra
|
|
|
2155
2155
|
return;
|
|
2156
2156
|
}
|
|
2157
2157
|
downEvent.preventDefault();
|
|
2158
|
-
this.initiateDrag(
|
|
2158
|
+
this.initiateDrag(
|
|
2159
|
+
dragTarget,
|
|
2160
|
+
downEvent.clientX,
|
|
2161
|
+
downEvent.clientY,
|
|
2162
|
+
"mouse",
|
|
2163
|
+
"mouse",
|
|
2164
|
+
void 0,
|
|
2165
|
+
downEvent.isTrusted
|
|
2166
|
+
);
|
|
2159
2167
|
});
|
|
2160
|
-
const touchDragSub = shadowRoot.when("touchstart").filter((
|
|
2161
|
-
const target = findDraggableTarget(
|
|
2168
|
+
const touchDragSub = shadowRoot.when("touchstart").filter((e4) => {
|
|
2169
|
+
const target = findDraggableTarget(e4, draggablesSelector);
|
|
2162
2170
|
const hostDisabled = this.disabled || this.readonly;
|
|
2163
2171
|
const targetDisabled = target?.hasAttribute("disabled") || target?.getAttribute("aria-disabled") === "true";
|
|
2164
|
-
const hasTouchPoint = Boolean(
|
|
2172
|
+
const hasTouchPoint = Boolean(e4.touches?.[0] || e4.changedTouches?.[0]);
|
|
2165
2173
|
const pointerHandledRecently = Date.now() - this.lastPointerDownAt < 50;
|
|
2166
2174
|
return target && hasTouchPoint && !hostDisabled && !targetDisabled && !pointerHandledRecently;
|
|
2167
2175
|
}).subscribe((startEvent) => {
|
|
@@ -2173,7 +2181,15 @@ var DragDropCoreMixin = (superClass, draggablesSelector, droppablesSelector, dra
|
|
|
2173
2181
|
this.lastTouchStartAt = Date.now();
|
|
2174
2182
|
startEvent.preventDefault();
|
|
2175
2183
|
startEvent.stopPropagation();
|
|
2176
|
-
this.initiateDrag(
|
|
2184
|
+
this.initiateDrag(
|
|
2185
|
+
dragTarget,
|
|
2186
|
+
touch.clientX,
|
|
2187
|
+
touch.clientY,
|
|
2188
|
+
"touch",
|
|
2189
|
+
"touch",
|
|
2190
|
+
void 0,
|
|
2191
|
+
startEvent.isTrusted
|
|
2192
|
+
);
|
|
2177
2193
|
});
|
|
2178
2194
|
let keyboardState = {
|
|
2179
2195
|
dragging: false,
|
|
@@ -2182,15 +2198,15 @@ var DragDropCoreMixin = (superClass, draggablesSelector, droppablesSelector, dra
|
|
|
2182
2198
|
dropIndex: 0,
|
|
2183
2199
|
dropElement: null
|
|
2184
2200
|
};
|
|
2185
|
-
const keyboardStream = shadowRoot.when("keydown").subscribe((
|
|
2201
|
+
const keyboardStream = shadowRoot.when("keydown").subscribe((e4) => {
|
|
2186
2202
|
const draggables = this.trackedDraggables.filter((d) => d.style.opacity !== "0");
|
|
2187
2203
|
const dropTargets = [...this.trackedDroppables, ...this.trackedDragContainers];
|
|
2188
2204
|
if (!keyboardState.dragging) {
|
|
2189
|
-
const target = findDraggableTarget(
|
|
2205
|
+
const target = findDraggableTarget(e4, draggablesSelector);
|
|
2190
2206
|
const hostDisabled = this.disabled || this.readonly;
|
|
2191
2207
|
const targetDisabled = target?.hasAttribute("disabled") || target?.getAttribute("aria-disabled") === "true";
|
|
2192
|
-
if (target && ["Space", "Enter"].includes(
|
|
2193
|
-
|
|
2208
|
+
if (target && ["Space", "Enter"].includes(e4.code) && !hostDisabled && !targetDisabled) {
|
|
2209
|
+
e4.preventDefault();
|
|
2194
2210
|
target.setAttribute("data-keyboard-dragging", "true");
|
|
2195
2211
|
keyboardState = {
|
|
2196
2212
|
dragging: true,
|
|
@@ -2201,17 +2217,17 @@ var DragDropCoreMixin = (superClass, draggablesSelector, droppablesSelector, dra
|
|
|
2201
2217
|
};
|
|
2202
2218
|
}
|
|
2203
2219
|
} else {
|
|
2204
|
-
switch (
|
|
2220
|
+
switch (e4.code) {
|
|
2205
2221
|
case "ArrowRight":
|
|
2206
2222
|
case "ArrowDown": {
|
|
2207
|
-
|
|
2223
|
+
e4.preventDefault();
|
|
2208
2224
|
const nextDropIndex = (keyboardState.dropIndex + 1) % dropTargets.length;
|
|
2209
2225
|
keyboardState = { ...keyboardState, dropIndex: nextDropIndex, dropElement: dropTargets[nextDropIndex] };
|
|
2210
2226
|
break;
|
|
2211
2227
|
}
|
|
2212
2228
|
case "ArrowLeft":
|
|
2213
2229
|
case "ArrowUp": {
|
|
2214
|
-
|
|
2230
|
+
e4.preventDefault();
|
|
2215
2231
|
const prevDropIndex = (keyboardState.dropIndex - 1 + dropTargets.length) % dropTargets.length;
|
|
2216
2232
|
keyboardState = { ...keyboardState, dropIndex: prevDropIndex, dropElement: dropTargets[prevDropIndex] };
|
|
2217
2233
|
break;
|
|
@@ -2219,7 +2235,7 @@ var DragDropCoreMixin = (superClass, draggablesSelector, droppablesSelector, dra
|
|
|
2219
2235
|
case "Space":
|
|
2220
2236
|
case "Enter":
|
|
2221
2237
|
case "Tab": {
|
|
2222
|
-
|
|
2238
|
+
e4.preventDefault();
|
|
2223
2239
|
if (keyboardState.dragElement && keyboardState.dropElement) {
|
|
2224
2240
|
const canDrop = this.allowDrop(keyboardState.dragElement, keyboardState.dropElement) || this.trackedDragContainers.includes(keyboardState.dropElement);
|
|
2225
2241
|
if (canDrop) {
|
|
@@ -2240,7 +2256,7 @@ var DragDropCoreMixin = (superClass, draggablesSelector, droppablesSelector, dra
|
|
|
2240
2256
|
break;
|
|
2241
2257
|
}
|
|
2242
2258
|
case "Escape": {
|
|
2243
|
-
|
|
2259
|
+
e4.preventDefault();
|
|
2244
2260
|
this.trackedDraggables.forEach((d) => d.removeAttribute("data-keyboard-dragging"));
|
|
2245
2261
|
keyboardState = {
|
|
2246
2262
|
dragging: false,
|
|
@@ -2315,14 +2331,14 @@ var DragDropCoreMixin = (superClass, draggablesSelector, droppablesSelector, dra
|
|
|
2315
2331
|
if (captureTarget && activePointerId !== void 0 && captureTarget.setPointerCapture) {
|
|
2316
2332
|
captureTarget.setPointerCapture(activePointerId);
|
|
2317
2333
|
}
|
|
2318
|
-
} catch (
|
|
2334
|
+
} catch (e4) {
|
|
2319
2335
|
}
|
|
2320
2336
|
}
|
|
2321
|
-
const preventAllTouch = (
|
|
2322
|
-
if (
|
|
2323
|
-
|
|
2337
|
+
const preventAllTouch = (e4) => {
|
|
2338
|
+
if (e4.cancelable) {
|
|
2339
|
+
e4.preventDefault();
|
|
2324
2340
|
if (eventSource === "pointer") {
|
|
2325
|
-
|
|
2341
|
+
e4.stopPropagation();
|
|
2326
2342
|
}
|
|
2327
2343
|
}
|
|
2328
2344
|
};
|
|
@@ -2346,7 +2362,7 @@ var DragDropCoreMixin = (superClass, draggablesSelector, droppablesSelector, dra
|
|
|
2346
2362
|
if (captureTarget && activePointerId !== void 0 && captureTarget.releasePointerCapture) {
|
|
2347
2363
|
captureTarget.releasePointerCapture(activePointerId);
|
|
2348
2364
|
}
|
|
2349
|
-
} catch (
|
|
2365
|
+
} catch (e4) {
|
|
2350
2366
|
}
|
|
2351
2367
|
}
|
|
2352
2368
|
};
|
|
@@ -2359,55 +2375,55 @@ var DragDropCoreMixin = (superClass, draggablesSelector, droppablesSelector, dra
|
|
|
2359
2375
|
return expected === void 0 || evt.isTrusted === expected;
|
|
2360
2376
|
};
|
|
2361
2377
|
const moveSub = document.when(moveEventName).takeUntil(document.when(upEventName)).subscribe({
|
|
2362
|
-
next: (
|
|
2363
|
-
if (!trustMatchesCurrentDrag(
|
|
2378
|
+
next: (e4) => {
|
|
2379
|
+
if (!trustMatchesCurrentDrag(e4)) {
|
|
2364
2380
|
return;
|
|
2365
2381
|
}
|
|
2366
|
-
|
|
2367
|
-
|
|
2382
|
+
e4.preventDefault();
|
|
2383
|
+
e4.stopPropagation();
|
|
2368
2384
|
if (eventSource === "touch") {
|
|
2369
|
-
const touch =
|
|
2385
|
+
const touch = e4.touches?.[0] || e4.changedTouches?.[0];
|
|
2370
2386
|
if (!touch) return;
|
|
2371
2387
|
this.handleDragMove(touch.clientX, touch.clientY);
|
|
2372
2388
|
return;
|
|
2373
2389
|
}
|
|
2374
2390
|
if (eventSource === "mouse") {
|
|
2375
|
-
const mouseEvent =
|
|
2391
|
+
const mouseEvent = e4;
|
|
2376
2392
|
if (typeof mouseEvent.buttons === "number" && (mouseEvent.buttons & 1) !== 1) {
|
|
2377
2393
|
return;
|
|
2378
2394
|
}
|
|
2379
2395
|
}
|
|
2380
|
-
this.handleDragMove(
|
|
2396
|
+
this.handleDragMove(e4.clientX, e4.clientY);
|
|
2381
2397
|
}
|
|
2382
2398
|
});
|
|
2383
2399
|
const endSub = document.when(upEventName).subscribe({
|
|
2384
|
-
next: (
|
|
2385
|
-
if (!trustMatchesCurrentDrag(
|
|
2400
|
+
next: (e4) => {
|
|
2401
|
+
if (!trustMatchesCurrentDrag(e4)) {
|
|
2386
2402
|
return;
|
|
2387
2403
|
}
|
|
2388
|
-
|
|
2389
|
-
|
|
2404
|
+
e4.preventDefault();
|
|
2405
|
+
e4.stopPropagation();
|
|
2390
2406
|
this.handleDragEnd();
|
|
2391
2407
|
}
|
|
2392
2408
|
});
|
|
2393
2409
|
const cancelSub = eventSource === "touch" ? document.when("touchcancel").subscribe({
|
|
2394
|
-
next: (
|
|
2395
|
-
if (!trustMatchesCurrentDrag(
|
|
2410
|
+
next: (e4) => {
|
|
2411
|
+
if (!trustMatchesCurrentDrag(e4)) {
|
|
2396
2412
|
return;
|
|
2397
2413
|
}
|
|
2398
2414
|
this.handleDragEnd();
|
|
2399
2415
|
}
|
|
2400
2416
|
}) : eventSource === "mouse" ? null : document.when("pointercancel").subscribe({
|
|
2401
|
-
next: (
|
|
2402
|
-
if (!trustMatchesCurrentDrag(
|
|
2417
|
+
next: (e4) => {
|
|
2418
|
+
if (!trustMatchesCurrentDrag(e4)) {
|
|
2403
2419
|
return;
|
|
2404
2420
|
}
|
|
2405
2421
|
this.handleDragEnd();
|
|
2406
2422
|
}
|
|
2407
2423
|
});
|
|
2408
|
-
const escapeSub = document.when("keydown").filter((
|
|
2409
|
-
next: (
|
|
2410
|
-
if (!trustMatchesCurrentDrag(
|
|
2424
|
+
const escapeSub = document.when("keydown").filter((e4) => e4.key === "Escape").subscribe({
|
|
2425
|
+
next: (e4) => {
|
|
2426
|
+
if (!trustMatchesCurrentDrag(e4)) {
|
|
2411
2427
|
return;
|
|
2412
2428
|
}
|
|
2413
2429
|
this.handleDragEnd();
|
|
@@ -2588,7 +2604,7 @@ var DragDropCoreMixin = (superClass, draggablesSelector, droppablesSelector, dra
|
|
|
2588
2604
|
this.subscriptions.forEach((sub) => {
|
|
2589
2605
|
try {
|
|
2590
2606
|
sub.unsubscribe();
|
|
2591
|
-
} catch (
|
|
2607
|
+
} catch (e4) {
|
|
2592
2608
|
}
|
|
2593
2609
|
});
|
|
2594
2610
|
this.subscriptions = [];
|
|
@@ -3302,11 +3318,7 @@ var DragDropSlottedSortableMixin = (superClass, sortableItemSelector = '[qti-dra
|
|
|
3302
3318
|
this.#sourceSlot = containingDroppable;
|
|
3303
3319
|
this.#sortableContext.sortContainer = containingDroppable;
|
|
3304
3320
|
const rect = dragElement.getBoundingClientRect();
|
|
3305
|
-
this.#sortableContext.placeholder = createDropPlaceholder(
|
|
3306
|
-
dragElement,
|
|
3307
|
-
rect,
|
|
3308
|
-
this.sortablePlaceholderConfig
|
|
3309
|
-
);
|
|
3321
|
+
this.#sortableContext.placeholder = createDropPlaceholder(dragElement, rect, this.sortablePlaceholderConfig);
|
|
3310
3322
|
const slotAttr = dragElement.getAttribute("slot");
|
|
3311
3323
|
if (slotAttr) {
|
|
3312
3324
|
this.#sortableContext.placeholder.setAttribute("slot", slotAttr);
|
|
@@ -4286,8 +4298,8 @@ var QtiCustomInteraction = class extends Interaction {
|
|
|
4286
4298
|
} else {
|
|
4287
4299
|
console.error(`Failed to fetch index.html: ${indexResponse.status}`);
|
|
4288
4300
|
}
|
|
4289
|
-
} catch (
|
|
4290
|
-
console.error(`Error fetching index.html: ${
|
|
4301
|
+
} catch (e4) {
|
|
4302
|
+
console.error(`Error fetching index.html: ${e4}`);
|
|
4291
4303
|
}
|
|
4292
4304
|
}
|
|
4293
4305
|
}
|
|
@@ -4318,8 +4330,8 @@ var QtiCustomInteraction = class extends Interaction {
|
|
|
4318
4330
|
if (outerDoc) {
|
|
4319
4331
|
this.#getInnerIFrames(outerDoc, outerIFrames);
|
|
4320
4332
|
}
|
|
4321
|
-
} catch (
|
|
4322
|
-
console.error("Error accessing nested iframe:",
|
|
4333
|
+
} catch (e4) {
|
|
4334
|
+
console.error("Error accessing nested iframe:", e4);
|
|
4323
4335
|
}
|
|
4324
4336
|
}
|
|
4325
4337
|
}
|
|
@@ -4340,8 +4352,8 @@ var QtiCustomInteraction = class extends Interaction {
|
|
|
4340
4352
|
try {
|
|
4341
4353
|
const nestedDoc = iframe.contentDocument || iframe.contentWindow.document;
|
|
4342
4354
|
this.#getInnerIFrames(nestedDoc, iframes);
|
|
4343
|
-
} catch (
|
|
4344
|
-
console.error("Error accessing nested iframe:",
|
|
4355
|
+
} catch (e4) {
|
|
4356
|
+
console.error("Error accessing nested iframe:", e4);
|
|
4345
4357
|
}
|
|
4346
4358
|
} else {
|
|
4347
4359
|
console.warn("Skipped cross-origin iframe:", iframeSrc);
|
|
@@ -4488,7 +4500,7 @@ var QtiCustomInteraction = class extends Interaction {
|
|
|
4488
4500
|
}
|
|
4489
4501
|
return { url, baseUrl };
|
|
4490
4502
|
}
|
|
4491
|
-
} catch (
|
|
4503
|
+
} catch (e4) {
|
|
4492
4504
|
}
|
|
4493
4505
|
}
|
|
4494
4506
|
return { url: "", baseUrl: null };
|
|
@@ -4729,12 +4741,7 @@ var qti_gap_match_interaction_styles_default = i`
|
|
|
4729
4741
|
`;
|
|
4730
4742
|
|
|
4731
4743
|
// ../interactions/gap-match-interaction/src/qti-gap-match-interaction.ts
|
|
4732
|
-
var SlottedBase2 = DragDropSlottedMixin(
|
|
4733
|
-
Interaction,
|
|
4734
|
-
"qti-gap-text",
|
|
4735
|
-
"qti-gap",
|
|
4736
|
-
`slot[part='drags']`
|
|
4737
|
-
);
|
|
4744
|
+
var SlottedBase2 = DragDropSlottedMixin(Interaction, "qti-gap-text", "qti-gap", `slot[part='drags']`);
|
|
4738
4745
|
var QtiGapMatchInteraction = class extends DragDropSlottedSortableMixin(SlottedBase2, '[qti-draggable="true"]') {
|
|
4739
4746
|
static {
|
|
4740
4747
|
this.styles = qti_gap_match_interaction_styles_default;
|
|
@@ -4826,25 +4833,25 @@ var QtiGapMatchInteraction = class extends DragDropSlottedSortableMixin(SlottedB
|
|
|
4826
4833
|
};
|
|
4827
4834
|
|
|
4828
4835
|
// ../../node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/node/directives/repeat.js
|
|
4829
|
-
var u2 = (
|
|
4836
|
+
var u2 = (e4, s, t2) => {
|
|
4830
4837
|
const r2 = /* @__PURE__ */ new Map();
|
|
4831
|
-
for (let l = s; l <= t2; l++) r2.set(
|
|
4838
|
+
for (let l = s; l <= t2; l++) r2.set(e4[l], l);
|
|
4832
4839
|
return r2;
|
|
4833
4840
|
};
|
|
4834
4841
|
var c2 = e2(class extends i3 {
|
|
4835
|
-
constructor(
|
|
4836
|
-
if (super(
|
|
4842
|
+
constructor(e4) {
|
|
4843
|
+
if (super(e4), e4.type !== t.CHILD) throw Error("repeat() can only be used in text expressions");
|
|
4837
4844
|
}
|
|
4838
|
-
dt(
|
|
4845
|
+
dt(e4, s, t2) {
|
|
4839
4846
|
let r2;
|
|
4840
4847
|
void 0 === t2 ? t2 = s : void 0 !== s && (r2 = s);
|
|
4841
|
-
const l = [],
|
|
4848
|
+
const l = [], o5 = [];
|
|
4842
4849
|
let i5 = 0;
|
|
4843
|
-
for (const s2 of
|
|
4844
|
-
return { values:
|
|
4850
|
+
for (const s2 of e4) l[i5] = r2 ? r2(s2, i5) : i5, o5[i5] = t2(s2, i5), i5++;
|
|
4851
|
+
return { values: o5, keys: l };
|
|
4845
4852
|
}
|
|
4846
|
-
render(
|
|
4847
|
-
return this.dt(
|
|
4853
|
+
render(e4, s, t2) {
|
|
4854
|
+
return this.dt(e4, s, t2).values;
|
|
4848
4855
|
}
|
|
4849
4856
|
update(s, [t2, r2, c3]) {
|
|
4850
4857
|
const d = M(s), { values: p2, keys: a } = this.dt(t2, r2, c3);
|
|
@@ -4858,21 +4865,21 @@ var c2 = e2(class extends i3 {
|
|
|
4858
4865
|
else if (h3[x] === a[w]) v2[w] = u(d[x], p2[w]), v(s, v2[w + 1], d[x]), x++, w--;
|
|
4859
4866
|
else if (h3[j] === a[k]) v2[k] = u(d[j], p2[k]), v(s, d[x], d[j]), j--, k++;
|
|
4860
4867
|
else if (void 0 === m && (m = u2(a, k, w), y = u2(h3, x, j)), m.has(h3[x])) if (m.has(h3[j])) {
|
|
4861
|
-
const
|
|
4868
|
+
const e4 = y.get(a[k]), t3 = void 0 !== e4 ? d[e4] : null;
|
|
4862
4869
|
if (null === t3) {
|
|
4863
|
-
const
|
|
4864
|
-
u(
|
|
4865
|
-
} else v2[k] = u(t3, p2[k]), v(s, d[x], t3), d[
|
|
4870
|
+
const e5 = v(s, d[x]);
|
|
4871
|
+
u(e5, p2[k]), v2[k] = e5;
|
|
4872
|
+
} else v2[k] = u(t3, p2[k]), v(s, d[x], t3), d[e4] = null;
|
|
4866
4873
|
k++;
|
|
4867
4874
|
} else h(d[j]), j--;
|
|
4868
4875
|
else h(d[x]), x++;
|
|
4869
4876
|
for (; k <= w; ) {
|
|
4870
|
-
const
|
|
4871
|
-
u(
|
|
4877
|
+
const e4 = v(s, v2[w + 1]);
|
|
4878
|
+
u(e4, p2[k]), v2[k++] = e4;
|
|
4872
4879
|
}
|
|
4873
4880
|
for (; x <= j; ) {
|
|
4874
|
-
const
|
|
4875
|
-
null !==
|
|
4881
|
+
const e4 = d[x++];
|
|
4882
|
+
null !== e4 && h(e4);
|
|
4876
4883
|
}
|
|
4877
4884
|
return this.ut = a, p(s, v2), E;
|
|
4878
4885
|
}
|
|
@@ -5068,8 +5075,8 @@ var QtiGraphicAssociateInteraction = class extends Interaction {
|
|
|
5068
5075
|
y2=${parseInt(this.querySelector(`[identifier=${line.split(" ")[1]}]`).style.top)}
|
|
5069
5076
|
stroke="red"
|
|
5070
5077
|
stroke-width="3"
|
|
5071
|
-
@click=${(
|
|
5072
|
-
|
|
5078
|
+
@click=${(e4) => {
|
|
5079
|
+
e4.stopPropagation();
|
|
5073
5080
|
this._response = this._response.filter((_, i5) => i5 !== index);
|
|
5074
5081
|
this.saveResponse(this.response);
|
|
5075
5082
|
}}
|
|
@@ -5106,9 +5113,9 @@ var QtiGraphicAssociateInteraction = class extends Interaction {
|
|
|
5106
5113
|
</line-container>
|
|
5107
5114
|
<div role="alert" part="message" id="validation-message"></div>`;
|
|
5108
5115
|
}
|
|
5109
|
-
#positionHotspotOnRegister(
|
|
5116
|
+
#positionHotspotOnRegister(e4) {
|
|
5110
5117
|
const img = this.querySelector("img");
|
|
5111
|
-
const hotspot =
|
|
5118
|
+
const hotspot = e4.target;
|
|
5112
5119
|
const coords = hotspot.getAttribute("coords");
|
|
5113
5120
|
const shape = hotspot.getAttribute("shape");
|
|
5114
5121
|
const coordsNumber = coords.split(",").map((s) => parseInt(s));
|
|
@@ -5249,8 +5256,8 @@ var QtiGraphicGapMatchInteraction = class extends DragDropSlottedSortableMixin(S
|
|
|
5249
5256
|
shouldReturnToInventoryOnInventoryDrop() {
|
|
5250
5257
|
return true;
|
|
5251
5258
|
}
|
|
5252
|
-
#positionHotspotOnRegister(
|
|
5253
|
-
const hotspot =
|
|
5259
|
+
#positionHotspotOnRegister(e4) {
|
|
5260
|
+
const hotspot = e4.target;
|
|
5254
5261
|
const coords = hotspot.getAttribute("coords");
|
|
5255
5262
|
const shape = hotspot.getAttribute("shape");
|
|
5256
5263
|
const coordsNumber = coords.split(",").map((s) => parseInt(s));
|
|
@@ -5316,8 +5323,8 @@ var QtiGraphicOrderInteraction = class extends ChoicesMixin(Interaction, "qti-ho
|
|
|
5316
5323
|
<div role="alert" part="message" id="validation-message"></div>
|
|
5317
5324
|
`;
|
|
5318
5325
|
}
|
|
5319
|
-
#setHotspotOrder(
|
|
5320
|
-
const { identifier } =
|
|
5326
|
+
#setHotspotOrder(e4) {
|
|
5327
|
+
const { identifier } = e4.detail;
|
|
5321
5328
|
const hotspot = this._choiceElements.find((el) => el.getAttribute("identifier") === identifier);
|
|
5322
5329
|
if (!hotspot) return;
|
|
5323
5330
|
const maxSelection = this._choiceElements.length;
|
|
@@ -5358,9 +5365,9 @@ var QtiGraphicOrderInteraction = class extends ChoicesMixin(Interaction, "qti-ho
|
|
|
5358
5365
|
}
|
|
5359
5366
|
}
|
|
5360
5367
|
}
|
|
5361
|
-
#positionHotspotOnRegister(
|
|
5368
|
+
#positionHotspotOnRegister(e4) {
|
|
5362
5369
|
const img = this.querySelector("img");
|
|
5363
|
-
const hotspot =
|
|
5370
|
+
const hotspot = e4.target;
|
|
5364
5371
|
const coords = hotspot.getAttribute("coords");
|
|
5365
5372
|
const shape = hotspot.getAttribute("shape");
|
|
5366
5373
|
const coordsNumber = coords.split(",").map((s) => parseInt(s));
|
|
@@ -5423,9 +5430,9 @@ var QtiHotspotInteraction = class extends ChoicesMixin(Interaction, "qti-hotspot
|
|
|
5423
5430
|
}
|
|
5424
5431
|
return this.#imageLoadPromise;
|
|
5425
5432
|
}
|
|
5426
|
-
async #positionHotspotOnRegister(
|
|
5433
|
+
async #positionHotspotOnRegister(e4) {
|
|
5427
5434
|
const img = this.querySelector("img");
|
|
5428
|
-
const hotspot =
|
|
5435
|
+
const hotspot = e4.target;
|
|
5429
5436
|
const coords = hotspot.getAttribute("coords");
|
|
5430
5437
|
const shape = hotspot.getAttribute("shape");
|
|
5431
5438
|
const coordsNumber = coords.split(",").map((s) => parseInt(s));
|
|
@@ -5490,24 +5497,6 @@ __decorateClass([
|
|
|
5490
5497
|
n({ type: String, reflect: true })
|
|
5491
5498
|
], QtiHottextInteraction.prototype, "class", 2);
|
|
5492
5499
|
|
|
5493
|
-
// ../../node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/node/directives/unsafe-html.js
|
|
5494
|
-
var e3 = class extends i3 {
|
|
5495
|
-
constructor(i5) {
|
|
5496
|
-
if (super(i5), this.it = A, i5.type !== t.CHILD) throw Error(this.constructor.directiveName + "() can only be used in child bindings");
|
|
5497
|
-
}
|
|
5498
|
-
render(r2) {
|
|
5499
|
-
if (r2 === A || null == r2) return this._t = void 0, this.it = r2;
|
|
5500
|
-
if (r2 === E) return r2;
|
|
5501
|
-
if ("string" != typeof r2) throw Error(this.constructor.directiveName + "() called with a non-string value");
|
|
5502
|
-
if (r2 === this.it) return this._t;
|
|
5503
|
-
this.it = r2;
|
|
5504
|
-
const s = [r2];
|
|
5505
|
-
return s.raw = s, this._t = { _$litType$: this.constructor.resultType, strings: s, values: [] };
|
|
5506
|
-
}
|
|
5507
|
-
};
|
|
5508
|
-
e3.directiveName = "unsafeHTML", e3.resultType = 1;
|
|
5509
|
-
var o3 = e2(e3);
|
|
5510
|
-
|
|
5511
5500
|
// ../interactions/inline-choice-interaction/src/qti-inline-choice-interaction.styles.ts
|
|
5512
5501
|
var styles2 = i`
|
|
5513
5502
|
:host {
|
|
@@ -5574,7 +5563,7 @@ var QtiInlineChoiceInteraction = class extends Interaction {
|
|
|
5574
5563
|
constructor() {
|
|
5575
5564
|
super();
|
|
5576
5565
|
this.options = [];
|
|
5577
|
-
this.correctOption =
|
|
5566
|
+
this.correctOption = A;
|
|
5578
5567
|
this._dropdownOpen = false;
|
|
5579
5568
|
this._slotObserver = null;
|
|
5580
5569
|
this._menuId = `qti-inline-choice-menu-${inlineChoiceMenuCounter++}`;
|
|
@@ -5662,7 +5651,7 @@ var QtiInlineChoiceInteraction = class extends Interaction {
|
|
|
5662
5651
|
?disabled="${this.disabled}"
|
|
5663
5652
|
data-readonly="${this.readonly ? "true" : "false"}"
|
|
5664
5653
|
>
|
|
5665
|
-
<span part="value">${
|
|
5654
|
+
<span part="value">${selected?.content}</span>
|
|
5666
5655
|
<span part="${this._dropdownOpen ? "dropdown-icon dropdown-icon-open" : "dropdown-icon"}" aria-hidden="true"
|
|
5667
5656
|
>▾</span
|
|
5668
5657
|
>
|
|
@@ -5682,11 +5671,11 @@ var QtiInlineChoiceInteraction = class extends Interaction {
|
|
|
5682
5671
|
aria-selected="${this.options[0]?.selected ? "true" : "false"}"
|
|
5683
5672
|
@click=${() => this.#selectValue("")}
|
|
5684
5673
|
>
|
|
5685
|
-
<span part="option-content">${
|
|
5674
|
+
<span part="option-content">${this.options[0]?.content}</span>
|
|
5686
5675
|
</button>
|
|
5687
5676
|
<slot @slotchange=${this.#onChoicesSlotChange}></slot>
|
|
5688
5677
|
</div>
|
|
5689
|
-
${
|
|
5678
|
+
${this.correctOption}
|
|
5690
5679
|
`;
|
|
5691
5680
|
}
|
|
5692
5681
|
async connectedCallback() {
|
|
@@ -5724,24 +5713,24 @@ var QtiInlineChoiceInteraction = class extends Interaction {
|
|
|
5724
5713
|
#updateOptions() {
|
|
5725
5714
|
const choices = Array.from(this.querySelectorAll("qti-inline-choice"));
|
|
5726
5715
|
const prompt = this.dataset.prompt || this.configContext?.inlineChoicePrompt || "select";
|
|
5727
|
-
const currentlySelectedValue = this.options.find((
|
|
5716
|
+
const currentlySelectedValue = this.options.find((o5) => o5.selected)?.value ?? "";
|
|
5728
5717
|
const nextOptions = [
|
|
5729
5718
|
{
|
|
5730
|
-
|
|
5719
|
+
content: prompt,
|
|
5731
5720
|
value: "",
|
|
5732
5721
|
selected: currentlySelectedValue === ""
|
|
5733
5722
|
},
|
|
5734
5723
|
...choices.map((choice) => {
|
|
5735
5724
|
const value = choice.getAttribute("identifier") ?? "";
|
|
5736
5725
|
return {
|
|
5737
|
-
|
|
5726
|
+
content: Array.from(choice.childNodes).map((node) => node.cloneNode(true)),
|
|
5738
5727
|
value,
|
|
5739
5728
|
selected: value !== "" && value === currentlySelectedValue
|
|
5740
5729
|
};
|
|
5741
5730
|
})
|
|
5742
5731
|
];
|
|
5743
|
-
const hasSelected = nextOptions.some((
|
|
5744
|
-
this.options = hasSelected ? nextOptions : nextOptions.map((
|
|
5732
|
+
const hasSelected = nextOptions.some((o5) => o5.selected);
|
|
5733
|
+
this.options = hasSelected ? nextOptions : nextOptions.map((o5, i5) => ({ ...o5, selected: i5 === 0 }));
|
|
5745
5734
|
this.#syncSlottedChoices();
|
|
5746
5735
|
this.#estimateOptimalWidth();
|
|
5747
5736
|
}
|
|
@@ -5790,15 +5779,19 @@ var QtiInlineChoiceInteraction = class extends Interaction {
|
|
|
5790
5779
|
super.toggleInternalCorrectResponse(show);
|
|
5791
5780
|
const correctResponseValue = this.correctResponse;
|
|
5792
5781
|
if (!show || !correctResponseValue) {
|
|
5793
|
-
this.correctOption =
|
|
5782
|
+
this.correctOption = A;
|
|
5794
5783
|
return;
|
|
5795
5784
|
}
|
|
5796
5785
|
const correctOptionData = this.options.find((option) => correctResponseValue === option.value);
|
|
5797
5786
|
if (!correctOptionData) {
|
|
5798
|
-
this.correctOption =
|
|
5787
|
+
this.correctOption = A;
|
|
5799
5788
|
return;
|
|
5800
5789
|
}
|
|
5801
|
-
this.correctOption = `<span
|
|
5790
|
+
this.correctOption = T`<span
|
|
5791
|
+
part="correct-option"
|
|
5792
|
+
style="border:1px solid var(--qti-correct); border-radius:4px; padding: 2px 4px; margin: 4px; display:inline-block"
|
|
5793
|
+
>${correctOptionData.content}</span
|
|
5794
|
+
>`;
|
|
5802
5795
|
}
|
|
5803
5796
|
#selectValue(value) {
|
|
5804
5797
|
this.options = this.options.map((option) => ({ ...option, selected: option.value === value }));
|
|
@@ -5946,18 +5939,18 @@ var QtiMatchInteraction = class extends DragDropSlottedSortableMixin(SlottedBase
|
|
|
5946
5939
|
this._response = [];
|
|
5947
5940
|
this.responseIdentifier = "";
|
|
5948
5941
|
this.correctOptions = null;
|
|
5949
|
-
this.handleRadioClick = (
|
|
5950
|
-
const radio =
|
|
5942
|
+
this.handleRadioClick = (e4) => {
|
|
5943
|
+
const radio = e4.target;
|
|
5951
5944
|
if (this.lastCheckedRadio === radio) {
|
|
5952
5945
|
radio.checked = false;
|
|
5953
5946
|
this.lastCheckedRadio = null;
|
|
5954
|
-
this.handleRadioChange(
|
|
5947
|
+
this.handleRadioChange(e4);
|
|
5955
5948
|
} else {
|
|
5956
5949
|
this.lastCheckedRadio = radio;
|
|
5957
5950
|
}
|
|
5958
5951
|
};
|
|
5959
|
-
this.handleRadioChange = (
|
|
5960
|
-
const checkbox =
|
|
5952
|
+
this.handleRadioChange = (e4) => {
|
|
5953
|
+
const checkbox = e4.target;
|
|
5961
5954
|
const value = checkbox.value;
|
|
5962
5955
|
const name = checkbox.name;
|
|
5963
5956
|
const type = checkbox.type;
|
|
@@ -6046,11 +6039,11 @@ var QtiMatchInteraction = class extends DragDropSlottedSortableMixin(SlottedBase
|
|
|
6046
6039
|
const match = matches.find((m) => m.target === targetId);
|
|
6047
6040
|
if (match?.source) {
|
|
6048
6041
|
const sourceChoice = this.querySelector(`qti-simple-associable-choice[identifier="${match.source}"]`);
|
|
6049
|
-
const
|
|
6050
|
-
if (
|
|
6042
|
+
const nodes = Array.from(sourceChoice?.childNodes || []).map((n4) => n4.cloneNode(true));
|
|
6043
|
+
if (nodes.length > 0 && !targetChoice.previousElementSibling?.classList.contains("correct-option")) {
|
|
6051
6044
|
const textSpan = document.createElement("span");
|
|
6052
6045
|
textSpan.classList.add("correct-option");
|
|
6053
|
-
|
|
6046
|
+
nodes.forEach((node) => textSpan.appendChild(node));
|
|
6054
6047
|
textSpan.style.border = "1px solid var(--qti-correct)";
|
|
6055
6048
|
textSpan.style.borderRadius = "4px";
|
|
6056
6049
|
textSpan.style.padding = "2px 4px";
|
|
@@ -6106,12 +6099,14 @@ var QtiMatchInteraction = class extends DragDropSlottedSortableMixin(SlottedBase
|
|
|
6106
6099
|
<table part="table">
|
|
6107
6100
|
<tr part="r-header">
|
|
6108
6101
|
<td></td>
|
|
6109
|
-
${this.targetChoices.map(
|
|
6102
|
+
${this.targetChoices.map(
|
|
6103
|
+
(col) => T`<th part="r-header">${Array.from(col.childNodes).map((n4) => n4.cloneNode(true))}</th>`
|
|
6104
|
+
)}
|
|
6110
6105
|
</tr>
|
|
6111
6106
|
|
|
6112
6107
|
${this.sourceChoices.map(
|
|
6113
6108
|
(row) => T`<tr part="row">
|
|
6114
|
-
<td part="c-header">${
|
|
6109
|
+
<td part="c-header">${Array.from(row.childNodes).map((n4) => n4.cloneNode(true))}</td>
|
|
6115
6110
|
${this.targetChoices.map((col) => {
|
|
6116
6111
|
const rowId = row.getAttribute("identifier");
|
|
6117
6112
|
const colId = col.getAttribute("identifier");
|
|
@@ -6135,8 +6130,8 @@ var QtiMatchInteraction = class extends DragDropSlottedSortableMixin(SlottedBase
|
|
|
6135
6130
|
name=${rowId}
|
|
6136
6131
|
value=${value}
|
|
6137
6132
|
.disabled=${disable}
|
|
6138
|
-
@change=${(
|
|
6139
|
-
@click=${(
|
|
6133
|
+
@change=${(e4) => this.handleRadioChange(e4)}
|
|
6134
|
+
@click=${(e4) => row.matchMax === 1 ? this.handleRadioClick(e4) : null}
|
|
6140
6135
|
/>
|
|
6141
6136
|
${type === "checkbox" && checked ? T`
|
|
6142
6137
|
<svg
|
|
@@ -6605,9 +6600,9 @@ var QtiPortableCustomInteraction = class extends Interaction {
|
|
|
6605
6600
|
throw new Error("Require paths must be a JSON object.");
|
|
6606
6601
|
}
|
|
6607
6602
|
this.#parsedRequirePaths = parsedJson;
|
|
6608
|
-
} catch (
|
|
6609
|
-
console.error("Error parsing require paths JSON:",
|
|
6610
|
-
this._errorMessage = `Error parsing require paths JSON: ${
|
|
6603
|
+
} catch (e4) {
|
|
6604
|
+
console.error("Error parsing require paths JSON:", e4);
|
|
6605
|
+
this._errorMessage = `Error parsing require paths JSON: ${e4.message}`;
|
|
6611
6606
|
this.#parsedRequirePaths = {};
|
|
6612
6607
|
}
|
|
6613
6608
|
}
|
|
@@ -6620,9 +6615,9 @@ var QtiPortableCustomInteraction = class extends Interaction {
|
|
|
6620
6615
|
if (this.#parsedRequireShim === null && this.requireShimJson) {
|
|
6621
6616
|
try {
|
|
6622
6617
|
this.#parsedRequireShim = JSON.parse(this.requireShimJson);
|
|
6623
|
-
} catch (
|
|
6624
|
-
console.error("Error parsing require shim JSON:",
|
|
6625
|
-
this._errorMessage = `Error parsing require shim JSON: ${
|
|
6618
|
+
} catch (e4) {
|
|
6619
|
+
console.error("Error parsing require shim JSON:", e4);
|
|
6620
|
+
this._errorMessage = `Error parsing require shim JSON: ${e4.message}`;
|
|
6626
6621
|
this.#parsedRequireShim = {};
|
|
6627
6622
|
}
|
|
6628
6623
|
}
|
|
@@ -8279,26 +8274,26 @@ var QtiPositionObjectStage = class extends i2 {
|
|
|
8279
8274
|
// ../../node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/node/directives/style-map.js
|
|
8280
8275
|
var n2 = "important";
|
|
8281
8276
|
var i4 = " !" + n2;
|
|
8282
|
-
var
|
|
8277
|
+
var o3 = e2(class extends i3 {
|
|
8283
8278
|
constructor(t2) {
|
|
8284
8279
|
if (super(t2), t2.type !== t.ATTRIBUTE || "style" !== t2.name || t2.strings?.length > 2) throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.");
|
|
8285
8280
|
}
|
|
8286
8281
|
render(t2) {
|
|
8287
|
-
return Object.keys(t2).reduce((
|
|
8282
|
+
return Object.keys(t2).reduce((e4, r2) => {
|
|
8288
8283
|
const s = t2[r2];
|
|
8289
|
-
return null == s ?
|
|
8284
|
+
return null == s ? e4 : e4 + `${r2 = r2.includes("-") ? r2 : r2.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g, "-$&").toLowerCase()}:${s};`;
|
|
8290
8285
|
}, "");
|
|
8291
8286
|
}
|
|
8292
|
-
update(
|
|
8293
|
-
const { style: s } =
|
|
8287
|
+
update(e4, [r2]) {
|
|
8288
|
+
const { style: s } = e4.element;
|
|
8294
8289
|
if (void 0 === this.ft) return this.ft = new Set(Object.keys(r2)), this.render(r2);
|
|
8295
8290
|
for (const t2 of this.ft) null == r2[t2] && (this.ft.delete(t2), t2.includes("-") ? s.removeProperty(t2) : s[t2] = null);
|
|
8296
8291
|
for (const t2 in r2) {
|
|
8297
|
-
const
|
|
8298
|
-
if (null !=
|
|
8292
|
+
const e5 = r2[t2];
|
|
8293
|
+
if (null != e5) {
|
|
8299
8294
|
this.ft.add(t2);
|
|
8300
|
-
const r3 = "string" == typeof
|
|
8301
|
-
t2.includes("-") || r3 ? s.setProperty(t2, r3 ?
|
|
8295
|
+
const r3 = "string" == typeof e5 && e5.endsWith(i4);
|
|
8296
|
+
t2.includes("-") || r3 ? s.setProperty(t2, r3 ? e5.slice(0, -11) : e5, r3 ? n2 : "") : s[t2] = e5;
|
|
8302
8297
|
}
|
|
8303
8298
|
}
|
|
8304
8299
|
return E;
|
|
@@ -8431,7 +8426,7 @@ var QtiSelectPointInteraction = class extends Interaction {
|
|
|
8431
8426
|
} else {
|
|
8432
8427
|
areaMapEntries = areaMapping.areaMapEntries;
|
|
8433
8428
|
}
|
|
8434
|
-
this._correctAreas = areaMapEntries.map((
|
|
8429
|
+
this._correctAreas = areaMapEntries.map((e4) => ({ coords: e4.coords, shape: e4.shape }));
|
|
8435
8430
|
}
|
|
8436
8431
|
updated(changedProperties) {
|
|
8437
8432
|
super.updated(changedProperties);
|
|
@@ -8474,7 +8469,7 @@ var QtiSelectPointInteraction = class extends Interaction {
|
|
|
8474
8469
|
return T`
|
|
8475
8470
|
<button
|
|
8476
8471
|
part="point${correctionPart}"
|
|
8477
|
-
style=${
|
|
8472
|
+
style=${o3({
|
|
8478
8473
|
pointerEvents: this.maxChoices === 1 ? "none" : "auto",
|
|
8479
8474
|
position: "absolute",
|
|
8480
8475
|
transform: "translate(-50%, -50%)",
|
|
@@ -8491,8 +8486,8 @@ var QtiSelectPointInteraction = class extends Interaction {
|
|
|
8491
8486
|
})}
|
|
8492
8487
|
aria-label="Remove point at ${point}"
|
|
8493
8488
|
?disabled=${this.disabled}
|
|
8494
|
-
@click=${(
|
|
8495
|
-
|
|
8489
|
+
@click=${(e4) => {
|
|
8490
|
+
e4.stopPropagation();
|
|
8496
8491
|
this.response = (this.response || []).filter((_, i5) => i5 !== index);
|
|
8497
8492
|
this.saveResponse(this.response);
|
|
8498
8493
|
}}
|
|
@@ -8504,7 +8499,7 @@ var QtiSelectPointInteraction = class extends Interaction {
|
|
|
8504
8499
|
this._correctAreas?.filter((area) => area) || [],
|
|
8505
8500
|
(area) => area,
|
|
8506
8501
|
(area, i5) => T`<div
|
|
8507
|
-
style=${
|
|
8502
|
+
style=${o3({
|
|
8508
8503
|
position: "absolute",
|
|
8509
8504
|
pointerEvents: "none",
|
|
8510
8505
|
backgroundColor: "var(--qti-correct)",
|
|
@@ -8740,7 +8735,7 @@ var QtiSliderInteraction = class extends Interaction {
|
|
|
8740
8735
|
}
|
|
8741
8736
|
#onMouseDown(event) {
|
|
8742
8737
|
this.#startDrag(event.pageX);
|
|
8743
|
-
const handleMouseMove = (
|
|
8738
|
+
const handleMouseMove = (e4) => this.#onDrag(e4.pageX);
|
|
8744
8739
|
const handleMouseUp = () => {
|
|
8745
8740
|
document.removeEventListener("mousemove", handleMouseMove);
|
|
8746
8741
|
document.removeEventListener("mouseup", handleMouseUp);
|
|
@@ -8751,7 +8746,7 @@ var QtiSliderInteraction = class extends Interaction {
|
|
|
8751
8746
|
}
|
|
8752
8747
|
#onTouchStart(event) {
|
|
8753
8748
|
this.#startDrag(event.touches[0].pageX);
|
|
8754
|
-
const handleTouchMove = (
|
|
8749
|
+
const handleTouchMove = (e4) => this.#onDrag(e4.touches[0].pageX);
|
|
8755
8750
|
const handleTouchEnd = () => {
|
|
8756
8751
|
document.removeEventListener("touchmove", handleTouchMove);
|
|
8757
8752
|
document.removeEventListener("touchend", handleTouchEnd);
|
|
@@ -8788,27 +8783,27 @@ __decorateClass([
|
|
|
8788
8783
|
], QtiSliderInteraction.prototype, "step", 2);
|
|
8789
8784
|
|
|
8790
8785
|
// ../../node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/node/directives/ref.js
|
|
8791
|
-
var
|
|
8786
|
+
var e3 = () => new h2();
|
|
8792
8787
|
var h2 = class {
|
|
8793
8788
|
};
|
|
8794
|
-
var
|
|
8789
|
+
var o4 = /* @__PURE__ */ new WeakMap();
|
|
8795
8790
|
var n3 = e2(class extends f {
|
|
8796
8791
|
render(i5) {
|
|
8797
8792
|
return A;
|
|
8798
8793
|
}
|
|
8799
8794
|
update(i5, [s]) {
|
|
8800
|
-
const
|
|
8801
|
-
return
|
|
8795
|
+
const e4 = s !== this.G;
|
|
8796
|
+
return e4 && void 0 !== this.G && this.rt(void 0), (e4 || this.lt !== this.ct) && (this.G = s, this.ht = i5.options?.host, this.rt(this.ct = i5.element)), A;
|
|
8802
8797
|
}
|
|
8803
8798
|
rt(t2) {
|
|
8804
8799
|
if (this.isConnected || (t2 = void 0), "function" == typeof this.G) {
|
|
8805
8800
|
const i5 = this.ht ?? globalThis;
|
|
8806
|
-
let s =
|
|
8807
|
-
void 0 === s && (s = /* @__PURE__ */ new WeakMap(),
|
|
8801
|
+
let s = o4.get(i5);
|
|
8802
|
+
void 0 === s && (s = /* @__PURE__ */ new WeakMap(), o4.set(i5, s)), void 0 !== s.get(this.G) && this.G.call(this.ht, void 0), s.set(this.G, t2), void 0 !== t2 && this.G.call(this.ht, t2);
|
|
8808
8803
|
} else this.G.value = t2;
|
|
8809
8804
|
}
|
|
8810
8805
|
get lt() {
|
|
8811
|
-
return "function" == typeof this.G ?
|
|
8806
|
+
return "function" == typeof this.G ? o4.get(this.ht ?? globalThis)?.get(this.G) : this.G?.value;
|
|
8812
8807
|
}
|
|
8813
8808
|
disconnected() {
|
|
8814
8809
|
this.lt === this.ct && this.rt(void 0);
|
|
@@ -8933,7 +8928,7 @@ var qti_text_entry_interaction_styles_default = i`
|
|
|
8933
8928
|
var QtiTextEntryInteraction = class extends Interaction {
|
|
8934
8929
|
constructor() {
|
|
8935
8930
|
super(...arguments);
|
|
8936
|
-
this.inputRef =
|
|
8931
|
+
this.inputRef = e3();
|
|
8937
8932
|
this.response = null;
|
|
8938
8933
|
this._handleValueChange = () => {
|
|
8939
8934
|
this._internals.setFormValue(this.value);
|
|
@@ -9728,7 +9723,6 @@ export {
|
|
|
9728
9723
|
/*! Bundled license information:
|
|
9729
9724
|
|
|
9730
9725
|
lit-html/node/directives/repeat.js:
|
|
9731
|
-
lit-html/node/directives/unsafe-html.js:
|
|
9732
9726
|
(**
|
|
9733
9727
|
* @license
|
|
9734
9728
|
* Copyright 2017 Google LLC
|
|
@@ -9749,4 +9743,4 @@ lit-html/node/directives/ref.js:
|
|
|
9749
9743
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
9750
9744
|
*)
|
|
9751
9745
|
*/
|
|
9752
|
-
//# sourceMappingURL=chunk-
|
|
9746
|
+
//# sourceMappingURL=chunk-FK2IVMS3.js.map
|