@citolab/qti-components 7.27.4 → 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 +139 -136
- package/custom-elements.json +2 -2
- package/dist/{chunk-3HJE3KRM.js → chunk-47XMSJK3.js} +3 -3
- package/dist/{chunk-UKPCQKPF.js → chunk-CEGI6UUL.js} +7 -2
- package/dist/chunk-CEGI6UUL.js.map +1 -0
- package/dist/{chunk-XYTJOQRZ.js → chunk-FK2IVMS3.js} +183 -196
- package/dist/chunk-FK2IVMS3.js.map +1 -0
- package/dist/{chunk-424AWLRU.js → chunk-SNRBEBO7.js} +2 -2
- package/dist/{chunk-FFESMKSD.js → chunk-SUQA7VZJ.js} +2 -2
- package/dist/{chunk-SX63OCDZ.js → chunk-TELCVV2J.js} +2 -2
- package/dist/elements.js +2 -2
- package/dist/index.js +6 -6
- package/dist/interactions.d.ts +2 -2
- package/dist/interactions.js +1 -1
- package/dist/item.js +2 -2
- package/dist/loader.js +2 -2
- package/dist/test.js +3 -3
- package/dist/transformers.js +1 -1
- package/package.json +5 -5
- package/dist/chunk-UKPCQKPF.js.map +0 -1
- package/dist/chunk-XYTJOQRZ.js.map +0 -1
- /package/dist/{chunk-3HJE3KRM.js.map → chunk-47XMSJK3.js.map} +0 -0
- /package/dist/{chunk-424AWLRU.js.map → chunk-SNRBEBO7.js.map} +0 -0
- /package/dist/{chunk-FFESMKSD.js.map → chunk-SUQA7VZJ.js.map} +0 -0
- /package/dist/{chunk-SX63OCDZ.js.map → chunk-TELCVV2J.js.map} +0 -0
|
@@ -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) => {
|
|
@@ -2165,11 +2165,11 @@ var DragDropCoreMixin = (superClass, draggablesSelector, droppablesSelector, dra
|
|
|
2165
2165
|
downEvent.isTrusted
|
|
2166
2166
|
);
|
|
2167
2167
|
});
|
|
2168
|
-
const touchDragSub = shadowRoot.when("touchstart").filter((
|
|
2169
|
-
const target = findDraggableTarget(
|
|
2168
|
+
const touchDragSub = shadowRoot.when("touchstart").filter((e4) => {
|
|
2169
|
+
const target = findDraggableTarget(e4, draggablesSelector);
|
|
2170
2170
|
const hostDisabled = this.disabled || this.readonly;
|
|
2171
2171
|
const targetDisabled = target?.hasAttribute("disabled") || target?.getAttribute("aria-disabled") === "true";
|
|
2172
|
-
const hasTouchPoint = Boolean(
|
|
2172
|
+
const hasTouchPoint = Boolean(e4.touches?.[0] || e4.changedTouches?.[0]);
|
|
2173
2173
|
const pointerHandledRecently = Date.now() - this.lastPointerDownAt < 50;
|
|
2174
2174
|
return target && hasTouchPoint && !hostDisabled && !targetDisabled && !pointerHandledRecently;
|
|
2175
2175
|
}).subscribe((startEvent) => {
|
|
@@ -2198,15 +2198,15 @@ var DragDropCoreMixin = (superClass, draggablesSelector, droppablesSelector, dra
|
|
|
2198
2198
|
dropIndex: 0,
|
|
2199
2199
|
dropElement: null
|
|
2200
2200
|
};
|
|
2201
|
-
const keyboardStream = shadowRoot.when("keydown").subscribe((
|
|
2201
|
+
const keyboardStream = shadowRoot.when("keydown").subscribe((e4) => {
|
|
2202
2202
|
const draggables = this.trackedDraggables.filter((d) => d.style.opacity !== "0");
|
|
2203
2203
|
const dropTargets = [...this.trackedDroppables, ...this.trackedDragContainers];
|
|
2204
2204
|
if (!keyboardState.dragging) {
|
|
2205
|
-
const target = findDraggableTarget(
|
|
2205
|
+
const target = findDraggableTarget(e4, draggablesSelector);
|
|
2206
2206
|
const hostDisabled = this.disabled || this.readonly;
|
|
2207
2207
|
const targetDisabled = target?.hasAttribute("disabled") || target?.getAttribute("aria-disabled") === "true";
|
|
2208
|
-
if (target && ["Space", "Enter"].includes(
|
|
2209
|
-
|
|
2208
|
+
if (target && ["Space", "Enter"].includes(e4.code) && !hostDisabled && !targetDisabled) {
|
|
2209
|
+
e4.preventDefault();
|
|
2210
2210
|
target.setAttribute("data-keyboard-dragging", "true");
|
|
2211
2211
|
keyboardState = {
|
|
2212
2212
|
dragging: true,
|
|
@@ -2217,17 +2217,17 @@ var DragDropCoreMixin = (superClass, draggablesSelector, droppablesSelector, dra
|
|
|
2217
2217
|
};
|
|
2218
2218
|
}
|
|
2219
2219
|
} else {
|
|
2220
|
-
switch (
|
|
2220
|
+
switch (e4.code) {
|
|
2221
2221
|
case "ArrowRight":
|
|
2222
2222
|
case "ArrowDown": {
|
|
2223
|
-
|
|
2223
|
+
e4.preventDefault();
|
|
2224
2224
|
const nextDropIndex = (keyboardState.dropIndex + 1) % dropTargets.length;
|
|
2225
2225
|
keyboardState = { ...keyboardState, dropIndex: nextDropIndex, dropElement: dropTargets[nextDropIndex] };
|
|
2226
2226
|
break;
|
|
2227
2227
|
}
|
|
2228
2228
|
case "ArrowLeft":
|
|
2229
2229
|
case "ArrowUp": {
|
|
2230
|
-
|
|
2230
|
+
e4.preventDefault();
|
|
2231
2231
|
const prevDropIndex = (keyboardState.dropIndex - 1 + dropTargets.length) % dropTargets.length;
|
|
2232
2232
|
keyboardState = { ...keyboardState, dropIndex: prevDropIndex, dropElement: dropTargets[prevDropIndex] };
|
|
2233
2233
|
break;
|
|
@@ -2235,7 +2235,7 @@ var DragDropCoreMixin = (superClass, draggablesSelector, droppablesSelector, dra
|
|
|
2235
2235
|
case "Space":
|
|
2236
2236
|
case "Enter":
|
|
2237
2237
|
case "Tab": {
|
|
2238
|
-
|
|
2238
|
+
e4.preventDefault();
|
|
2239
2239
|
if (keyboardState.dragElement && keyboardState.dropElement) {
|
|
2240
2240
|
const canDrop = this.allowDrop(keyboardState.dragElement, keyboardState.dropElement) || this.trackedDragContainers.includes(keyboardState.dropElement);
|
|
2241
2241
|
if (canDrop) {
|
|
@@ -2256,7 +2256,7 @@ var DragDropCoreMixin = (superClass, draggablesSelector, droppablesSelector, dra
|
|
|
2256
2256
|
break;
|
|
2257
2257
|
}
|
|
2258
2258
|
case "Escape": {
|
|
2259
|
-
|
|
2259
|
+
e4.preventDefault();
|
|
2260
2260
|
this.trackedDraggables.forEach((d) => d.removeAttribute("data-keyboard-dragging"));
|
|
2261
2261
|
keyboardState = {
|
|
2262
2262
|
dragging: false,
|
|
@@ -2331,14 +2331,14 @@ var DragDropCoreMixin = (superClass, draggablesSelector, droppablesSelector, dra
|
|
|
2331
2331
|
if (captureTarget && activePointerId !== void 0 && captureTarget.setPointerCapture) {
|
|
2332
2332
|
captureTarget.setPointerCapture(activePointerId);
|
|
2333
2333
|
}
|
|
2334
|
-
} catch (
|
|
2334
|
+
} catch (e4) {
|
|
2335
2335
|
}
|
|
2336
2336
|
}
|
|
2337
|
-
const preventAllTouch = (
|
|
2338
|
-
if (
|
|
2339
|
-
|
|
2337
|
+
const preventAllTouch = (e4) => {
|
|
2338
|
+
if (e4.cancelable) {
|
|
2339
|
+
e4.preventDefault();
|
|
2340
2340
|
if (eventSource === "pointer") {
|
|
2341
|
-
|
|
2341
|
+
e4.stopPropagation();
|
|
2342
2342
|
}
|
|
2343
2343
|
}
|
|
2344
2344
|
};
|
|
@@ -2362,7 +2362,7 @@ var DragDropCoreMixin = (superClass, draggablesSelector, droppablesSelector, dra
|
|
|
2362
2362
|
if (captureTarget && activePointerId !== void 0 && captureTarget.releasePointerCapture) {
|
|
2363
2363
|
captureTarget.releasePointerCapture(activePointerId);
|
|
2364
2364
|
}
|
|
2365
|
-
} catch (
|
|
2365
|
+
} catch (e4) {
|
|
2366
2366
|
}
|
|
2367
2367
|
}
|
|
2368
2368
|
};
|
|
@@ -2375,55 +2375,55 @@ var DragDropCoreMixin = (superClass, draggablesSelector, droppablesSelector, dra
|
|
|
2375
2375
|
return expected === void 0 || evt.isTrusted === expected;
|
|
2376
2376
|
};
|
|
2377
2377
|
const moveSub = document.when(moveEventName).takeUntil(document.when(upEventName)).subscribe({
|
|
2378
|
-
next: (
|
|
2379
|
-
if (!trustMatchesCurrentDrag(
|
|
2378
|
+
next: (e4) => {
|
|
2379
|
+
if (!trustMatchesCurrentDrag(e4)) {
|
|
2380
2380
|
return;
|
|
2381
2381
|
}
|
|
2382
|
-
|
|
2383
|
-
|
|
2382
|
+
e4.preventDefault();
|
|
2383
|
+
e4.stopPropagation();
|
|
2384
2384
|
if (eventSource === "touch") {
|
|
2385
|
-
const touch =
|
|
2385
|
+
const touch = e4.touches?.[0] || e4.changedTouches?.[0];
|
|
2386
2386
|
if (!touch) return;
|
|
2387
2387
|
this.handleDragMove(touch.clientX, touch.clientY);
|
|
2388
2388
|
return;
|
|
2389
2389
|
}
|
|
2390
2390
|
if (eventSource === "mouse") {
|
|
2391
|
-
const mouseEvent =
|
|
2391
|
+
const mouseEvent = e4;
|
|
2392
2392
|
if (typeof mouseEvent.buttons === "number" && (mouseEvent.buttons & 1) !== 1) {
|
|
2393
2393
|
return;
|
|
2394
2394
|
}
|
|
2395
2395
|
}
|
|
2396
|
-
this.handleDragMove(
|
|
2396
|
+
this.handleDragMove(e4.clientX, e4.clientY);
|
|
2397
2397
|
}
|
|
2398
2398
|
});
|
|
2399
2399
|
const endSub = document.when(upEventName).subscribe({
|
|
2400
|
-
next: (
|
|
2401
|
-
if (!trustMatchesCurrentDrag(
|
|
2400
|
+
next: (e4) => {
|
|
2401
|
+
if (!trustMatchesCurrentDrag(e4)) {
|
|
2402
2402
|
return;
|
|
2403
2403
|
}
|
|
2404
|
-
|
|
2405
|
-
|
|
2404
|
+
e4.preventDefault();
|
|
2405
|
+
e4.stopPropagation();
|
|
2406
2406
|
this.handleDragEnd();
|
|
2407
2407
|
}
|
|
2408
2408
|
});
|
|
2409
2409
|
const cancelSub = eventSource === "touch" ? document.when("touchcancel").subscribe({
|
|
2410
|
-
next: (
|
|
2411
|
-
if (!trustMatchesCurrentDrag(
|
|
2410
|
+
next: (e4) => {
|
|
2411
|
+
if (!trustMatchesCurrentDrag(e4)) {
|
|
2412
2412
|
return;
|
|
2413
2413
|
}
|
|
2414
2414
|
this.handleDragEnd();
|
|
2415
2415
|
}
|
|
2416
2416
|
}) : eventSource === "mouse" ? null : document.when("pointercancel").subscribe({
|
|
2417
|
-
next: (
|
|
2418
|
-
if (!trustMatchesCurrentDrag(
|
|
2417
|
+
next: (e4) => {
|
|
2418
|
+
if (!trustMatchesCurrentDrag(e4)) {
|
|
2419
2419
|
return;
|
|
2420
2420
|
}
|
|
2421
2421
|
this.handleDragEnd();
|
|
2422
2422
|
}
|
|
2423
2423
|
});
|
|
2424
|
-
const escapeSub = document.when("keydown").filter((
|
|
2425
|
-
next: (
|
|
2426
|
-
if (!trustMatchesCurrentDrag(
|
|
2424
|
+
const escapeSub = document.when("keydown").filter((e4) => e4.key === "Escape").subscribe({
|
|
2425
|
+
next: (e4) => {
|
|
2426
|
+
if (!trustMatchesCurrentDrag(e4)) {
|
|
2427
2427
|
return;
|
|
2428
2428
|
}
|
|
2429
2429
|
this.handleDragEnd();
|
|
@@ -2604,7 +2604,7 @@ var DragDropCoreMixin = (superClass, draggablesSelector, droppablesSelector, dra
|
|
|
2604
2604
|
this.subscriptions.forEach((sub) => {
|
|
2605
2605
|
try {
|
|
2606
2606
|
sub.unsubscribe();
|
|
2607
|
-
} catch (
|
|
2607
|
+
} catch (e4) {
|
|
2608
2608
|
}
|
|
2609
2609
|
});
|
|
2610
2610
|
this.subscriptions = [];
|
|
@@ -4298,8 +4298,8 @@ var QtiCustomInteraction = class extends Interaction {
|
|
|
4298
4298
|
} else {
|
|
4299
4299
|
console.error(`Failed to fetch index.html: ${indexResponse.status}`);
|
|
4300
4300
|
}
|
|
4301
|
-
} catch (
|
|
4302
|
-
console.error(`Error fetching index.html: ${
|
|
4301
|
+
} catch (e4) {
|
|
4302
|
+
console.error(`Error fetching index.html: ${e4}`);
|
|
4303
4303
|
}
|
|
4304
4304
|
}
|
|
4305
4305
|
}
|
|
@@ -4330,8 +4330,8 @@ var QtiCustomInteraction = class extends Interaction {
|
|
|
4330
4330
|
if (outerDoc) {
|
|
4331
4331
|
this.#getInnerIFrames(outerDoc, outerIFrames);
|
|
4332
4332
|
}
|
|
4333
|
-
} catch (
|
|
4334
|
-
console.error("Error accessing nested iframe:",
|
|
4333
|
+
} catch (e4) {
|
|
4334
|
+
console.error("Error accessing nested iframe:", e4);
|
|
4335
4335
|
}
|
|
4336
4336
|
}
|
|
4337
4337
|
}
|
|
@@ -4352,8 +4352,8 @@ var QtiCustomInteraction = class extends Interaction {
|
|
|
4352
4352
|
try {
|
|
4353
4353
|
const nestedDoc = iframe.contentDocument || iframe.contentWindow.document;
|
|
4354
4354
|
this.#getInnerIFrames(nestedDoc, iframes);
|
|
4355
|
-
} catch (
|
|
4356
|
-
console.error("Error accessing nested iframe:",
|
|
4355
|
+
} catch (e4) {
|
|
4356
|
+
console.error("Error accessing nested iframe:", e4);
|
|
4357
4357
|
}
|
|
4358
4358
|
} else {
|
|
4359
4359
|
console.warn("Skipped cross-origin iframe:", iframeSrc);
|
|
@@ -4500,7 +4500,7 @@ var QtiCustomInteraction = class extends Interaction {
|
|
|
4500
4500
|
}
|
|
4501
4501
|
return { url, baseUrl };
|
|
4502
4502
|
}
|
|
4503
|
-
} catch (
|
|
4503
|
+
} catch (e4) {
|
|
4504
4504
|
}
|
|
4505
4505
|
}
|
|
4506
4506
|
return { url: "", baseUrl: null };
|
|
@@ -4833,25 +4833,25 @@ var QtiGapMatchInteraction = class extends DragDropSlottedSortableMixin(SlottedB
|
|
|
4833
4833
|
};
|
|
4834
4834
|
|
|
4835
4835
|
// ../../node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/node/directives/repeat.js
|
|
4836
|
-
var u2 = (
|
|
4836
|
+
var u2 = (e4, s, t2) => {
|
|
4837
4837
|
const r2 = /* @__PURE__ */ new Map();
|
|
4838
|
-
for (let l = s; l <= t2; l++) r2.set(
|
|
4838
|
+
for (let l = s; l <= t2; l++) r2.set(e4[l], l);
|
|
4839
4839
|
return r2;
|
|
4840
4840
|
};
|
|
4841
4841
|
var c2 = e2(class extends i3 {
|
|
4842
|
-
constructor(
|
|
4843
|
-
if (super(
|
|
4842
|
+
constructor(e4) {
|
|
4843
|
+
if (super(e4), e4.type !== t.CHILD) throw Error("repeat() can only be used in text expressions");
|
|
4844
4844
|
}
|
|
4845
|
-
dt(
|
|
4845
|
+
dt(e4, s, t2) {
|
|
4846
4846
|
let r2;
|
|
4847
4847
|
void 0 === t2 ? t2 = s : void 0 !== s && (r2 = s);
|
|
4848
|
-
const l = [],
|
|
4848
|
+
const l = [], o5 = [];
|
|
4849
4849
|
let i5 = 0;
|
|
4850
|
-
for (const s2 of
|
|
4851
|
-
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 };
|
|
4852
4852
|
}
|
|
4853
|
-
render(
|
|
4854
|
-
return this.dt(
|
|
4853
|
+
render(e4, s, t2) {
|
|
4854
|
+
return this.dt(e4, s, t2).values;
|
|
4855
4855
|
}
|
|
4856
4856
|
update(s, [t2, r2, c3]) {
|
|
4857
4857
|
const d = M(s), { values: p2, keys: a } = this.dt(t2, r2, c3);
|
|
@@ -4865,21 +4865,21 @@ var c2 = e2(class extends i3 {
|
|
|
4865
4865
|
else if (h3[x] === a[w]) v2[w] = u(d[x], p2[w]), v(s, v2[w + 1], d[x]), x++, w--;
|
|
4866
4866
|
else if (h3[j] === a[k]) v2[k] = u(d[j], p2[k]), v(s, d[x], d[j]), j--, k++;
|
|
4867
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])) {
|
|
4868
|
-
const
|
|
4868
|
+
const e4 = y.get(a[k]), t3 = void 0 !== e4 ? d[e4] : null;
|
|
4869
4869
|
if (null === t3) {
|
|
4870
|
-
const
|
|
4871
|
-
u(
|
|
4872
|
-
} 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;
|
|
4873
4873
|
k++;
|
|
4874
4874
|
} else h(d[j]), j--;
|
|
4875
4875
|
else h(d[x]), x++;
|
|
4876
4876
|
for (; k <= w; ) {
|
|
4877
|
-
const
|
|
4878
|
-
u(
|
|
4877
|
+
const e4 = v(s, v2[w + 1]);
|
|
4878
|
+
u(e4, p2[k]), v2[k++] = e4;
|
|
4879
4879
|
}
|
|
4880
4880
|
for (; x <= j; ) {
|
|
4881
|
-
const
|
|
4882
|
-
null !==
|
|
4881
|
+
const e4 = d[x++];
|
|
4882
|
+
null !== e4 && h(e4);
|
|
4883
4883
|
}
|
|
4884
4884
|
return this.ut = a, p(s, v2), E;
|
|
4885
4885
|
}
|
|
@@ -5075,8 +5075,8 @@ var QtiGraphicAssociateInteraction = class extends Interaction {
|
|
|
5075
5075
|
y2=${parseInt(this.querySelector(`[identifier=${line.split(" ")[1]}]`).style.top)}
|
|
5076
5076
|
stroke="red"
|
|
5077
5077
|
stroke-width="3"
|
|
5078
|
-
@click=${(
|
|
5079
|
-
|
|
5078
|
+
@click=${(e4) => {
|
|
5079
|
+
e4.stopPropagation();
|
|
5080
5080
|
this._response = this._response.filter((_, i5) => i5 !== index);
|
|
5081
5081
|
this.saveResponse(this.response);
|
|
5082
5082
|
}}
|
|
@@ -5113,9 +5113,9 @@ var QtiGraphicAssociateInteraction = class extends Interaction {
|
|
|
5113
5113
|
</line-container>
|
|
5114
5114
|
<div role="alert" part="message" id="validation-message"></div>`;
|
|
5115
5115
|
}
|
|
5116
|
-
#positionHotspotOnRegister(
|
|
5116
|
+
#positionHotspotOnRegister(e4) {
|
|
5117
5117
|
const img = this.querySelector("img");
|
|
5118
|
-
const hotspot =
|
|
5118
|
+
const hotspot = e4.target;
|
|
5119
5119
|
const coords = hotspot.getAttribute("coords");
|
|
5120
5120
|
const shape = hotspot.getAttribute("shape");
|
|
5121
5121
|
const coordsNumber = coords.split(",").map((s) => parseInt(s));
|
|
@@ -5256,8 +5256,8 @@ var QtiGraphicGapMatchInteraction = class extends DragDropSlottedSortableMixin(S
|
|
|
5256
5256
|
shouldReturnToInventoryOnInventoryDrop() {
|
|
5257
5257
|
return true;
|
|
5258
5258
|
}
|
|
5259
|
-
#positionHotspotOnRegister(
|
|
5260
|
-
const hotspot =
|
|
5259
|
+
#positionHotspotOnRegister(e4) {
|
|
5260
|
+
const hotspot = e4.target;
|
|
5261
5261
|
const coords = hotspot.getAttribute("coords");
|
|
5262
5262
|
const shape = hotspot.getAttribute("shape");
|
|
5263
5263
|
const coordsNumber = coords.split(",").map((s) => parseInt(s));
|
|
@@ -5323,8 +5323,8 @@ var QtiGraphicOrderInteraction = class extends ChoicesMixin(Interaction, "qti-ho
|
|
|
5323
5323
|
<div role="alert" part="message" id="validation-message"></div>
|
|
5324
5324
|
`;
|
|
5325
5325
|
}
|
|
5326
|
-
#setHotspotOrder(
|
|
5327
|
-
const { identifier } =
|
|
5326
|
+
#setHotspotOrder(e4) {
|
|
5327
|
+
const { identifier } = e4.detail;
|
|
5328
5328
|
const hotspot = this._choiceElements.find((el) => el.getAttribute("identifier") === identifier);
|
|
5329
5329
|
if (!hotspot) return;
|
|
5330
5330
|
const maxSelection = this._choiceElements.length;
|
|
@@ -5365,9 +5365,9 @@ var QtiGraphicOrderInteraction = class extends ChoicesMixin(Interaction, "qti-ho
|
|
|
5365
5365
|
}
|
|
5366
5366
|
}
|
|
5367
5367
|
}
|
|
5368
|
-
#positionHotspotOnRegister(
|
|
5368
|
+
#positionHotspotOnRegister(e4) {
|
|
5369
5369
|
const img = this.querySelector("img");
|
|
5370
|
-
const hotspot =
|
|
5370
|
+
const hotspot = e4.target;
|
|
5371
5371
|
const coords = hotspot.getAttribute("coords");
|
|
5372
5372
|
const shape = hotspot.getAttribute("shape");
|
|
5373
5373
|
const coordsNumber = coords.split(",").map((s) => parseInt(s));
|
|
@@ -5430,9 +5430,9 @@ var QtiHotspotInteraction = class extends ChoicesMixin(Interaction, "qti-hotspot
|
|
|
5430
5430
|
}
|
|
5431
5431
|
return this.#imageLoadPromise;
|
|
5432
5432
|
}
|
|
5433
|
-
async #positionHotspotOnRegister(
|
|
5433
|
+
async #positionHotspotOnRegister(e4) {
|
|
5434
5434
|
const img = this.querySelector("img");
|
|
5435
|
-
const hotspot =
|
|
5435
|
+
const hotspot = e4.target;
|
|
5436
5436
|
const coords = hotspot.getAttribute("coords");
|
|
5437
5437
|
const shape = hotspot.getAttribute("shape");
|
|
5438
5438
|
const coordsNumber = coords.split(",").map((s) => parseInt(s));
|
|
@@ -5497,24 +5497,6 @@ __decorateClass([
|
|
|
5497
5497
|
n({ type: String, reflect: true })
|
|
5498
5498
|
], QtiHottextInteraction.prototype, "class", 2);
|
|
5499
5499
|
|
|
5500
|
-
// ../../node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/node/directives/unsafe-html.js
|
|
5501
|
-
var e3 = class extends i3 {
|
|
5502
|
-
constructor(i5) {
|
|
5503
|
-
if (super(i5), this.it = A, i5.type !== t.CHILD) throw Error(this.constructor.directiveName + "() can only be used in child bindings");
|
|
5504
|
-
}
|
|
5505
|
-
render(r2) {
|
|
5506
|
-
if (r2 === A || null == r2) return this._t = void 0, this.it = r2;
|
|
5507
|
-
if (r2 === E) return r2;
|
|
5508
|
-
if ("string" != typeof r2) throw Error(this.constructor.directiveName + "() called with a non-string value");
|
|
5509
|
-
if (r2 === this.it) return this._t;
|
|
5510
|
-
this.it = r2;
|
|
5511
|
-
const s = [r2];
|
|
5512
|
-
return s.raw = s, this._t = { _$litType$: this.constructor.resultType, strings: s, values: [] };
|
|
5513
|
-
}
|
|
5514
|
-
};
|
|
5515
|
-
e3.directiveName = "unsafeHTML", e3.resultType = 1;
|
|
5516
|
-
var o3 = e2(e3);
|
|
5517
|
-
|
|
5518
5500
|
// ../interactions/inline-choice-interaction/src/qti-inline-choice-interaction.styles.ts
|
|
5519
5501
|
var styles2 = i`
|
|
5520
5502
|
:host {
|
|
@@ -5581,7 +5563,7 @@ var QtiInlineChoiceInteraction = class extends Interaction {
|
|
|
5581
5563
|
constructor() {
|
|
5582
5564
|
super();
|
|
5583
5565
|
this.options = [];
|
|
5584
|
-
this.correctOption =
|
|
5566
|
+
this.correctOption = A;
|
|
5585
5567
|
this._dropdownOpen = false;
|
|
5586
5568
|
this._slotObserver = null;
|
|
5587
5569
|
this._menuId = `qti-inline-choice-menu-${inlineChoiceMenuCounter++}`;
|
|
@@ -5669,7 +5651,7 @@ var QtiInlineChoiceInteraction = class extends Interaction {
|
|
|
5669
5651
|
?disabled="${this.disabled}"
|
|
5670
5652
|
data-readonly="${this.readonly ? "true" : "false"}"
|
|
5671
5653
|
>
|
|
5672
|
-
<span part="value">${
|
|
5654
|
+
<span part="value">${selected?.content}</span>
|
|
5673
5655
|
<span part="${this._dropdownOpen ? "dropdown-icon dropdown-icon-open" : "dropdown-icon"}" aria-hidden="true"
|
|
5674
5656
|
>▾</span
|
|
5675
5657
|
>
|
|
@@ -5689,11 +5671,11 @@ var QtiInlineChoiceInteraction = class extends Interaction {
|
|
|
5689
5671
|
aria-selected="${this.options[0]?.selected ? "true" : "false"}"
|
|
5690
5672
|
@click=${() => this.#selectValue("")}
|
|
5691
5673
|
>
|
|
5692
|
-
<span part="option-content">${
|
|
5674
|
+
<span part="option-content">${this.options[0]?.content}</span>
|
|
5693
5675
|
</button>
|
|
5694
5676
|
<slot @slotchange=${this.#onChoicesSlotChange}></slot>
|
|
5695
5677
|
</div>
|
|
5696
|
-
${
|
|
5678
|
+
${this.correctOption}
|
|
5697
5679
|
`;
|
|
5698
5680
|
}
|
|
5699
5681
|
async connectedCallback() {
|
|
@@ -5731,24 +5713,24 @@ var QtiInlineChoiceInteraction = class extends Interaction {
|
|
|
5731
5713
|
#updateOptions() {
|
|
5732
5714
|
const choices = Array.from(this.querySelectorAll("qti-inline-choice"));
|
|
5733
5715
|
const prompt = this.dataset.prompt || this.configContext?.inlineChoicePrompt || "select";
|
|
5734
|
-
const currentlySelectedValue = this.options.find((
|
|
5716
|
+
const currentlySelectedValue = this.options.find((o5) => o5.selected)?.value ?? "";
|
|
5735
5717
|
const nextOptions = [
|
|
5736
5718
|
{
|
|
5737
|
-
|
|
5719
|
+
content: prompt,
|
|
5738
5720
|
value: "",
|
|
5739
5721
|
selected: currentlySelectedValue === ""
|
|
5740
5722
|
},
|
|
5741
5723
|
...choices.map((choice) => {
|
|
5742
5724
|
const value = choice.getAttribute("identifier") ?? "";
|
|
5743
5725
|
return {
|
|
5744
|
-
|
|
5726
|
+
content: Array.from(choice.childNodes).map((node) => node.cloneNode(true)),
|
|
5745
5727
|
value,
|
|
5746
5728
|
selected: value !== "" && value === currentlySelectedValue
|
|
5747
5729
|
};
|
|
5748
5730
|
})
|
|
5749
5731
|
];
|
|
5750
|
-
const hasSelected = nextOptions.some((
|
|
5751
|
-
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 }));
|
|
5752
5734
|
this.#syncSlottedChoices();
|
|
5753
5735
|
this.#estimateOptimalWidth();
|
|
5754
5736
|
}
|
|
@@ -5797,15 +5779,19 @@ var QtiInlineChoiceInteraction = class extends Interaction {
|
|
|
5797
5779
|
super.toggleInternalCorrectResponse(show);
|
|
5798
5780
|
const correctResponseValue = this.correctResponse;
|
|
5799
5781
|
if (!show || !correctResponseValue) {
|
|
5800
|
-
this.correctOption =
|
|
5782
|
+
this.correctOption = A;
|
|
5801
5783
|
return;
|
|
5802
5784
|
}
|
|
5803
5785
|
const correctOptionData = this.options.find((option) => correctResponseValue === option.value);
|
|
5804
5786
|
if (!correctOptionData) {
|
|
5805
|
-
this.correctOption =
|
|
5787
|
+
this.correctOption = A;
|
|
5806
5788
|
return;
|
|
5807
5789
|
}
|
|
5808
|
-
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
|
+
>`;
|
|
5809
5795
|
}
|
|
5810
5796
|
#selectValue(value) {
|
|
5811
5797
|
this.options = this.options.map((option) => ({ ...option, selected: option.value === value }));
|
|
@@ -5953,18 +5939,18 @@ var QtiMatchInteraction = class extends DragDropSlottedSortableMixin(SlottedBase
|
|
|
5953
5939
|
this._response = [];
|
|
5954
5940
|
this.responseIdentifier = "";
|
|
5955
5941
|
this.correctOptions = null;
|
|
5956
|
-
this.handleRadioClick = (
|
|
5957
|
-
const radio =
|
|
5942
|
+
this.handleRadioClick = (e4) => {
|
|
5943
|
+
const radio = e4.target;
|
|
5958
5944
|
if (this.lastCheckedRadio === radio) {
|
|
5959
5945
|
radio.checked = false;
|
|
5960
5946
|
this.lastCheckedRadio = null;
|
|
5961
|
-
this.handleRadioChange(
|
|
5947
|
+
this.handleRadioChange(e4);
|
|
5962
5948
|
} else {
|
|
5963
5949
|
this.lastCheckedRadio = radio;
|
|
5964
5950
|
}
|
|
5965
5951
|
};
|
|
5966
|
-
this.handleRadioChange = (
|
|
5967
|
-
const checkbox =
|
|
5952
|
+
this.handleRadioChange = (e4) => {
|
|
5953
|
+
const checkbox = e4.target;
|
|
5968
5954
|
const value = checkbox.value;
|
|
5969
5955
|
const name = checkbox.name;
|
|
5970
5956
|
const type = checkbox.type;
|
|
@@ -6053,11 +6039,11 @@ var QtiMatchInteraction = class extends DragDropSlottedSortableMixin(SlottedBase
|
|
|
6053
6039
|
const match = matches.find((m) => m.target === targetId);
|
|
6054
6040
|
if (match?.source) {
|
|
6055
6041
|
const sourceChoice = this.querySelector(`qti-simple-associable-choice[identifier="${match.source}"]`);
|
|
6056
|
-
const
|
|
6057
|
-
if (
|
|
6042
|
+
const nodes = Array.from(sourceChoice?.childNodes || []).map((n4) => n4.cloneNode(true));
|
|
6043
|
+
if (nodes.length > 0 && !targetChoice.previousElementSibling?.classList.contains("correct-option")) {
|
|
6058
6044
|
const textSpan = document.createElement("span");
|
|
6059
6045
|
textSpan.classList.add("correct-option");
|
|
6060
|
-
|
|
6046
|
+
nodes.forEach((node) => textSpan.appendChild(node));
|
|
6061
6047
|
textSpan.style.border = "1px solid var(--qti-correct)";
|
|
6062
6048
|
textSpan.style.borderRadius = "4px";
|
|
6063
6049
|
textSpan.style.padding = "2px 4px";
|
|
@@ -6113,12 +6099,14 @@ var QtiMatchInteraction = class extends DragDropSlottedSortableMixin(SlottedBase
|
|
|
6113
6099
|
<table part="table">
|
|
6114
6100
|
<tr part="r-header">
|
|
6115
6101
|
<td></td>
|
|
6116
|
-
${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
|
+
)}
|
|
6117
6105
|
</tr>
|
|
6118
6106
|
|
|
6119
6107
|
${this.sourceChoices.map(
|
|
6120
6108
|
(row) => T`<tr part="row">
|
|
6121
|
-
<td part="c-header">${
|
|
6109
|
+
<td part="c-header">${Array.from(row.childNodes).map((n4) => n4.cloneNode(true))}</td>
|
|
6122
6110
|
${this.targetChoices.map((col) => {
|
|
6123
6111
|
const rowId = row.getAttribute("identifier");
|
|
6124
6112
|
const colId = col.getAttribute("identifier");
|
|
@@ -6142,8 +6130,8 @@ var QtiMatchInteraction = class extends DragDropSlottedSortableMixin(SlottedBase
|
|
|
6142
6130
|
name=${rowId}
|
|
6143
6131
|
value=${value}
|
|
6144
6132
|
.disabled=${disable}
|
|
6145
|
-
@change=${(
|
|
6146
|
-
@click=${(
|
|
6133
|
+
@change=${(e4) => this.handleRadioChange(e4)}
|
|
6134
|
+
@click=${(e4) => row.matchMax === 1 ? this.handleRadioClick(e4) : null}
|
|
6147
6135
|
/>
|
|
6148
6136
|
${type === "checkbox" && checked ? T`
|
|
6149
6137
|
<svg
|
|
@@ -6612,9 +6600,9 @@ var QtiPortableCustomInteraction = class extends Interaction {
|
|
|
6612
6600
|
throw new Error("Require paths must be a JSON object.");
|
|
6613
6601
|
}
|
|
6614
6602
|
this.#parsedRequirePaths = parsedJson;
|
|
6615
|
-
} catch (
|
|
6616
|
-
console.error("Error parsing require paths JSON:",
|
|
6617
|
-
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}`;
|
|
6618
6606
|
this.#parsedRequirePaths = {};
|
|
6619
6607
|
}
|
|
6620
6608
|
}
|
|
@@ -6627,9 +6615,9 @@ var QtiPortableCustomInteraction = class extends Interaction {
|
|
|
6627
6615
|
if (this.#parsedRequireShim === null && this.requireShimJson) {
|
|
6628
6616
|
try {
|
|
6629
6617
|
this.#parsedRequireShim = JSON.parse(this.requireShimJson);
|
|
6630
|
-
} catch (
|
|
6631
|
-
console.error("Error parsing require shim JSON:",
|
|
6632
|
-
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}`;
|
|
6633
6621
|
this.#parsedRequireShim = {};
|
|
6634
6622
|
}
|
|
6635
6623
|
}
|
|
@@ -8286,26 +8274,26 @@ var QtiPositionObjectStage = class extends i2 {
|
|
|
8286
8274
|
// ../../node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/node/directives/style-map.js
|
|
8287
8275
|
var n2 = "important";
|
|
8288
8276
|
var i4 = " !" + n2;
|
|
8289
|
-
var
|
|
8277
|
+
var o3 = e2(class extends i3 {
|
|
8290
8278
|
constructor(t2) {
|
|
8291
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.");
|
|
8292
8280
|
}
|
|
8293
8281
|
render(t2) {
|
|
8294
|
-
return Object.keys(t2).reduce((
|
|
8282
|
+
return Object.keys(t2).reduce((e4, r2) => {
|
|
8295
8283
|
const s = t2[r2];
|
|
8296
|
-
return null == s ?
|
|
8284
|
+
return null == s ? e4 : e4 + `${r2 = r2.includes("-") ? r2 : r2.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g, "-$&").toLowerCase()}:${s};`;
|
|
8297
8285
|
}, "");
|
|
8298
8286
|
}
|
|
8299
|
-
update(
|
|
8300
|
-
const { style: s } =
|
|
8287
|
+
update(e4, [r2]) {
|
|
8288
|
+
const { style: s } = e4.element;
|
|
8301
8289
|
if (void 0 === this.ft) return this.ft = new Set(Object.keys(r2)), this.render(r2);
|
|
8302
8290
|
for (const t2 of this.ft) null == r2[t2] && (this.ft.delete(t2), t2.includes("-") ? s.removeProperty(t2) : s[t2] = null);
|
|
8303
8291
|
for (const t2 in r2) {
|
|
8304
|
-
const
|
|
8305
|
-
if (null !=
|
|
8292
|
+
const e5 = r2[t2];
|
|
8293
|
+
if (null != e5) {
|
|
8306
8294
|
this.ft.add(t2);
|
|
8307
|
-
const r3 = "string" == typeof
|
|
8308
|
-
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;
|
|
8309
8297
|
}
|
|
8310
8298
|
}
|
|
8311
8299
|
return E;
|
|
@@ -8438,7 +8426,7 @@ var QtiSelectPointInteraction = class extends Interaction {
|
|
|
8438
8426
|
} else {
|
|
8439
8427
|
areaMapEntries = areaMapping.areaMapEntries;
|
|
8440
8428
|
}
|
|
8441
|
-
this._correctAreas = areaMapEntries.map((
|
|
8429
|
+
this._correctAreas = areaMapEntries.map((e4) => ({ coords: e4.coords, shape: e4.shape }));
|
|
8442
8430
|
}
|
|
8443
8431
|
updated(changedProperties) {
|
|
8444
8432
|
super.updated(changedProperties);
|
|
@@ -8481,7 +8469,7 @@ var QtiSelectPointInteraction = class extends Interaction {
|
|
|
8481
8469
|
return T`
|
|
8482
8470
|
<button
|
|
8483
8471
|
part="point${correctionPart}"
|
|
8484
|
-
style=${
|
|
8472
|
+
style=${o3({
|
|
8485
8473
|
pointerEvents: this.maxChoices === 1 ? "none" : "auto",
|
|
8486
8474
|
position: "absolute",
|
|
8487
8475
|
transform: "translate(-50%, -50%)",
|
|
@@ -8498,8 +8486,8 @@ var QtiSelectPointInteraction = class extends Interaction {
|
|
|
8498
8486
|
})}
|
|
8499
8487
|
aria-label="Remove point at ${point}"
|
|
8500
8488
|
?disabled=${this.disabled}
|
|
8501
|
-
@click=${(
|
|
8502
|
-
|
|
8489
|
+
@click=${(e4) => {
|
|
8490
|
+
e4.stopPropagation();
|
|
8503
8491
|
this.response = (this.response || []).filter((_, i5) => i5 !== index);
|
|
8504
8492
|
this.saveResponse(this.response);
|
|
8505
8493
|
}}
|
|
@@ -8511,7 +8499,7 @@ var QtiSelectPointInteraction = class extends Interaction {
|
|
|
8511
8499
|
this._correctAreas?.filter((area) => area) || [],
|
|
8512
8500
|
(area) => area,
|
|
8513
8501
|
(area, i5) => T`<div
|
|
8514
|
-
style=${
|
|
8502
|
+
style=${o3({
|
|
8515
8503
|
position: "absolute",
|
|
8516
8504
|
pointerEvents: "none",
|
|
8517
8505
|
backgroundColor: "var(--qti-correct)",
|
|
@@ -8747,7 +8735,7 @@ var QtiSliderInteraction = class extends Interaction {
|
|
|
8747
8735
|
}
|
|
8748
8736
|
#onMouseDown(event) {
|
|
8749
8737
|
this.#startDrag(event.pageX);
|
|
8750
|
-
const handleMouseMove = (
|
|
8738
|
+
const handleMouseMove = (e4) => this.#onDrag(e4.pageX);
|
|
8751
8739
|
const handleMouseUp = () => {
|
|
8752
8740
|
document.removeEventListener("mousemove", handleMouseMove);
|
|
8753
8741
|
document.removeEventListener("mouseup", handleMouseUp);
|
|
@@ -8758,7 +8746,7 @@ var QtiSliderInteraction = class extends Interaction {
|
|
|
8758
8746
|
}
|
|
8759
8747
|
#onTouchStart(event) {
|
|
8760
8748
|
this.#startDrag(event.touches[0].pageX);
|
|
8761
|
-
const handleTouchMove = (
|
|
8749
|
+
const handleTouchMove = (e4) => this.#onDrag(e4.touches[0].pageX);
|
|
8762
8750
|
const handleTouchEnd = () => {
|
|
8763
8751
|
document.removeEventListener("touchmove", handleTouchMove);
|
|
8764
8752
|
document.removeEventListener("touchend", handleTouchEnd);
|
|
@@ -8795,27 +8783,27 @@ __decorateClass([
|
|
|
8795
8783
|
], QtiSliderInteraction.prototype, "step", 2);
|
|
8796
8784
|
|
|
8797
8785
|
// ../../node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/node/directives/ref.js
|
|
8798
|
-
var
|
|
8786
|
+
var e3 = () => new h2();
|
|
8799
8787
|
var h2 = class {
|
|
8800
8788
|
};
|
|
8801
|
-
var
|
|
8789
|
+
var o4 = /* @__PURE__ */ new WeakMap();
|
|
8802
8790
|
var n3 = e2(class extends f {
|
|
8803
8791
|
render(i5) {
|
|
8804
8792
|
return A;
|
|
8805
8793
|
}
|
|
8806
8794
|
update(i5, [s]) {
|
|
8807
|
-
const
|
|
8808
|
-
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;
|
|
8809
8797
|
}
|
|
8810
8798
|
rt(t2) {
|
|
8811
8799
|
if (this.isConnected || (t2 = void 0), "function" == typeof this.G) {
|
|
8812
8800
|
const i5 = this.ht ?? globalThis;
|
|
8813
|
-
let s =
|
|
8814
|
-
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);
|
|
8815
8803
|
} else this.G.value = t2;
|
|
8816
8804
|
}
|
|
8817
8805
|
get lt() {
|
|
8818
|
-
return "function" == typeof this.G ?
|
|
8806
|
+
return "function" == typeof this.G ? o4.get(this.ht ?? globalThis)?.get(this.G) : this.G?.value;
|
|
8819
8807
|
}
|
|
8820
8808
|
disconnected() {
|
|
8821
8809
|
this.lt === this.ct && this.rt(void 0);
|
|
@@ -8940,7 +8928,7 @@ var qti_text_entry_interaction_styles_default = i`
|
|
|
8940
8928
|
var QtiTextEntryInteraction = class extends Interaction {
|
|
8941
8929
|
constructor() {
|
|
8942
8930
|
super(...arguments);
|
|
8943
|
-
this.inputRef =
|
|
8931
|
+
this.inputRef = e3();
|
|
8944
8932
|
this.response = null;
|
|
8945
8933
|
this._handleValueChange = () => {
|
|
8946
8934
|
this._internals.setFormValue(this.value);
|
|
@@ -9735,7 +9723,6 @@ export {
|
|
|
9735
9723
|
/*! Bundled license information:
|
|
9736
9724
|
|
|
9737
9725
|
lit-html/node/directives/repeat.js:
|
|
9738
|
-
lit-html/node/directives/unsafe-html.js:
|
|
9739
9726
|
(**
|
|
9740
9727
|
* @license
|
|
9741
9728
|
* Copyright 2017 Google LLC
|
|
@@ -9756,4 +9743,4 @@ lit-html/node/directives/ref.js:
|
|
|
9756
9743
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
9757
9744
|
*)
|
|
9758
9745
|
*/
|
|
9759
|
-
//# sourceMappingURL=chunk-
|
|
9746
|
+
//# sourceMappingURL=chunk-FK2IVMS3.js.map
|