@pie-element/venn-classification 0.1.1-next.7 → 0.1.1-next.8
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/dist/author/index.d.ts +8 -6
- package/dist/author/index.js +85 -138
- package/dist/author/index.js.map +1 -1
- package/dist/browser/{VennClassification-DtbNF8RE.js → VennClassification-BgmjHIWB.js} +151 -231
- package/dist/browser/VennClassification-BgmjHIWB.js.map +1 -0
- package/dist/browser/author/index.js +3580 -3549
- package/dist/browser/author/index.js.map +1 -1
- package/dist/browser/controller/index.js +1 -1
- package/dist/browser/{controller-jTPoghNQ.js → controller-CmzKcNfc.js} +3 -5
- package/dist/browser/controller-CmzKcNfc.js.map +1 -0
- package/dist/browser/delivery/index.js +86 -30
- package/dist/browser/delivery/index.js.map +1 -1
- package/dist/controller/index.js +2 -4
- package/dist/controller/index.js.map +1 -1
- package/dist/delivery/index.d.ts +2 -32
- package/dist/delivery/index.js +124 -193
- package/dist/delivery/index.js.map +1 -1
- package/dist/index.iife.js +4 -4
- package/dist/index.js +2 -9789
- package/dist/runtime-support.js +5 -5
- package/dist/runtime-support.js.map +1 -1
- package/package.json +2 -4
- package/dist/browser/VennClassification-DtbNF8RE.js.map +0 -1
- package/dist/browser/controller-jTPoghNQ.js.map +0 -1
- package/dist/index.js.map +0 -1
package/dist/delivery/index.d.ts
CHANGED
|
@@ -1,33 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
declare
|
|
3
|
-
_internalSession: any;
|
|
4
|
-
/**
|
|
5
|
-
* The session object the player handed us. A player reads the learner's
|
|
6
|
-
* response back off this object, so every update is written into it as well
|
|
7
|
-
* as into the copy the component renders from.
|
|
8
|
-
*/
|
|
9
|
-
_playerSession: any;
|
|
10
|
-
_model: any;
|
|
11
|
-
_isComplete: () => boolean;
|
|
12
|
-
/**
|
|
13
|
-
* Dispatched a microtask later: on load a player sets the model and then the
|
|
14
|
-
* session in the same task (`element.model = …; element.session = …`), and
|
|
15
|
-
* `complete` can only report a restored placement once the session is here.
|
|
16
|
-
*/
|
|
17
|
-
_dispatchModelSet: () => void;
|
|
18
|
-
_dispatchSessionChanged: () => void;
|
|
19
|
-
set model(m: any);
|
|
20
|
-
get model(): any;
|
|
21
|
-
/**
|
|
22
|
-
* A re-set of the same object is an update, not a no-op: a player sets the
|
|
23
|
-
* session before the model on load and again after it (`element.model = …;
|
|
24
|
-
* element.session = sameObject`), and only that second event can report a
|
|
25
|
-
* restored session as complete. A player that clears the response in place
|
|
26
|
-
* re-sets its object the same way, and the component must re-render it.
|
|
27
|
-
*/
|
|
28
|
-
set session(s: any);
|
|
29
|
-
get session(): any;
|
|
30
|
-
onSessionChange: (updatedSession: any) => void;
|
|
31
|
-
connectedCallback(): void;
|
|
32
|
-
}
|
|
1
|
+
import type { VennModel, VennSession } from '../types.js';
|
|
2
|
+
declare const VennClassificationElement: import("@pie-lib/delivery-events-svelte").DeliveryElementConstructor<VennModel, VennSession>;
|
|
33
3
|
export default VennClassificationElement;
|
package/dist/delivery/index.js
CHANGED
|
@@ -5411,88 +5411,10 @@ function create_custom_element(Component, props_definition, slots, exports, shad
|
|
|
5411
5411
|
return Class;
|
|
5412
5412
|
}
|
|
5413
5413
|
//#endregion
|
|
5414
|
-
//#region ../../shared/player-events/dist/index.js
|
|
5415
|
-
var _e;
|
|
5416
|
-
var _e2;
|
|
5417
|
-
var s$2 = (_e = class e extends CustomEvent {
|
|
5418
|
-
constructor(t, n, r) {
|
|
5419
|
-
super(e.TYPE, {
|
|
5420
|
-
bubbles: !0,
|
|
5421
|
-
composed: !0,
|
|
5422
|
-
detail: {
|
|
5423
|
-
complete: n,
|
|
5424
|
-
component: t,
|
|
5425
|
-
hasModel: r
|
|
5426
|
-
}
|
|
5427
|
-
}), this.component = t, this.complete = n;
|
|
5428
|
-
}
|
|
5429
|
-
}, _e.TYPE = "model-set", _e);
|
|
5430
|
-
var c$2 = (_e2 = class e extends CustomEvent {
|
|
5431
|
-
constructor(t, n) {
|
|
5432
|
-
super(e.TYPE, {
|
|
5433
|
-
bubbles: !0,
|
|
5434
|
-
composed: !0,
|
|
5435
|
-
detail: {
|
|
5436
|
-
complete: n,
|
|
5437
|
-
component: t
|
|
5438
|
-
}
|
|
5439
|
-
}), this.component = t, this.complete = n;
|
|
5440
|
-
}
|
|
5441
|
-
}, _e2.TYPE = "session-changed", _e2);
|
|
5442
|
-
//#endregion
|
|
5443
|
-
//#region ../../lib-svelte/delivery-events/dist/index2.js
|
|
5444
|
-
var t$3 = (e) => {
|
|
5445
|
-
let t = e;
|
|
5446
|
-
return t ? typeof t.onSessionChange == "function" || typeof t.onAudioStarted == "function" || typeof t.onAudioEnded == "function" : !1;
|
|
5447
|
-
};
|
|
5448
|
-
function n$1(e) {
|
|
5449
|
-
if (e.parentElement) return e.parentElement;
|
|
5450
|
-
let t = e.getRootNode();
|
|
5451
|
-
return t instanceof ShadowRoot ? t.host : null;
|
|
5452
|
-
}
|
|
5453
|
-
function r$2(e, r = {}) {
|
|
5454
|
-
let i = r.hostPredicate ?? t$3, a = e;
|
|
5455
|
-
for (; a;) {
|
|
5456
|
-
if (i(a)) return a;
|
|
5457
|
-
a = n$1(a);
|
|
5458
|
-
}
|
|
5459
|
-
return null;
|
|
5460
|
-
}
|
|
5461
|
-
function i(e) {
|
|
5462
|
-
return !!e && typeof e == "object" && !Array.isArray(e);
|
|
5463
|
-
}
|
|
5464
|
-
function a$1(e, t) {
|
|
5465
|
-
if (e === t) return e;
|
|
5466
|
-
if (!i(e) || !i(t) || Object.isFrozen(e) || !Object.isExtensible(e)) return t;
|
|
5467
|
-
try {
|
|
5468
|
-
for (let n of Object.keys(e)) n in t || delete e[n];
|
|
5469
|
-
Object.assign(e, t);
|
|
5470
|
-
} catch {
|
|
5471
|
-
return t;
|
|
5472
|
-
}
|
|
5473
|
-
return e;
|
|
5474
|
-
}
|
|
5475
|
-
var o$1 = {};
|
|
5476
|
-
var s$1 = /* @__PURE__ */ new WeakSet();
|
|
5477
|
-
function c$1(e) {
|
|
5478
|
-
let t = e ?? o$1;
|
|
5479
|
-
if (s$1.has(t)) return;
|
|
5480
|
-
s$1.add(t);
|
|
5481
|
-
let n = e ? `above <${e.tagName.toLowerCase()}>` : "for an update with no source element";
|
|
5482
|
-
console.warn(`[session-bridge] no delivery host ${n}; the session change was not forwarded to the player`);
|
|
5483
|
-
}
|
|
5484
|
-
function l({ sourceEl: t, complete: n, session: i }) {
|
|
5485
|
-
let o = r$2(t);
|
|
5486
|
-
if (!o) return c$1(t), null;
|
|
5487
|
-
if (typeof o.onSessionChange == "function") return o.onSessionChange(i), o;
|
|
5488
|
-
let s = a$1(o.session, i);
|
|
5489
|
-
return s !== o.session && (o.session = s), o.dispatchEvent(new c$2(o.tagName.toLowerCase(), n)), o;
|
|
5490
|
-
}
|
|
5491
|
-
//#endregion
|
|
5492
5414
|
//#region ../../shared/math-rendering-mathjax/dist/index.js
|
|
5493
|
-
var e$
|
|
5494
|
-
function t$
|
|
5495
|
-
return typeof window > "u" || window.MathJax?.typesetPromise ? Promise.resolve() : e$
|
|
5415
|
+
var e$3 = null;
|
|
5416
|
+
function t$3(t) {
|
|
5417
|
+
return typeof window > "u" || window.MathJax?.typesetPromise ? Promise.resolve() : e$3 || (e$3 = new Promise((e, n) => {
|
|
5496
5418
|
let { useSingleDollar: r = !1, accessibility: i = !0, loadFonts: a = !0, srcUrl: o } = t, s = {
|
|
5497
5419
|
loader: { load: i ? ["a11y/assistive-mml"] : [] },
|
|
5498
5420
|
tex: {
|
|
@@ -5527,7 +5449,7 @@ function t$2(t) {
|
|
|
5527
5449
|
}, c.onerror = () => {
|
|
5528
5450
|
n(/* @__PURE__ */ Error("Failed to load MathJax"));
|
|
5529
5451
|
}, document.head.appendChild(c);
|
|
5530
|
-
}), e$
|
|
5452
|
+
}), e$3);
|
|
5531
5453
|
}
|
|
5532
5454
|
function n() {
|
|
5533
5455
|
let e = window.MathJax?.startup?.document;
|
|
@@ -5537,9 +5459,9 @@ function n() {
|
|
|
5537
5459
|
console.warn("[mathjax-renderer] Failed to attach assistive MathML:", e);
|
|
5538
5460
|
}
|
|
5539
5461
|
}
|
|
5540
|
-
function r$
|
|
5462
|
+
function r$2(e = {}) {
|
|
5541
5463
|
return async (r) => {
|
|
5542
|
-
if (await t$
|
|
5464
|
+
if (await t$3(e), !window.MathJax?.typesetPromise) {
|
|
5543
5465
|
console.warn("[mathjax-renderer] MathJax not loaded or missing typesetPromise.");
|
|
5544
5466
|
return;
|
|
5545
5467
|
}
|
|
@@ -5548,26 +5470,26 @@ function r$1(e = {}) {
|
|
|
5548
5470
|
}
|
|
5549
5471
|
var a = null;
|
|
5550
5472
|
function o() {
|
|
5551
|
-
return a || (a = r$
|
|
5473
|
+
return a || (a = r$2({
|
|
5552
5474
|
accessibility: !0,
|
|
5553
5475
|
useSingleDollar: !0
|
|
5554
5476
|
})), a;
|
|
5555
5477
|
}
|
|
5556
|
-
function s() {
|
|
5478
|
+
function s$1() {
|
|
5557
5479
|
if (typeof window > "u") return null;
|
|
5558
5480
|
let e = window["@pie-lib/math-rendering"];
|
|
5559
5481
|
return typeof e?.renderMath == "function" ? e : null;
|
|
5560
5482
|
}
|
|
5561
|
-
var c = async (e) => {
|
|
5483
|
+
var c$1 = async (e) => {
|
|
5562
5484
|
if (typeof window > "u") return;
|
|
5563
5485
|
let t = typeof e == "string", n;
|
|
5564
5486
|
t ? (n = document.createElement("div"), n.innerHTML = e) : n = e || document.body;
|
|
5565
|
-
let r = s();
|
|
5487
|
+
let r = s$1();
|
|
5566
5488
|
return r ? await r.renderMath?.(n) : await o()(n), t ? n.innerHTML : void 0;
|
|
5567
5489
|
};
|
|
5568
5490
|
//#endregion
|
|
5569
5491
|
//#region ../../shared/translator/dist/en.js
|
|
5570
|
-
var e$
|
|
5492
|
+
var e$2 = {
|
|
5571
5493
|
translation: {
|
|
5572
5494
|
categorize: {
|
|
5573
5495
|
limitMaxChoicesPerCategory: "You've reached the limit of {{maxChoicesPerCategory}} responses per area. To add another response, one must first be removed.",
|
|
@@ -5644,8 +5566,7 @@ var e$1 = {
|
|
|
5644
5566
|
listenSilentAlt: "Repeat instructions",
|
|
5645
5567
|
listenPlayingAlt: "Instructions are playing",
|
|
5646
5568
|
printAudio: "Audio:",
|
|
5647
|
-
printTranscript: "Transcript:"
|
|
5648
|
-
printKey: "(key)"
|
|
5569
|
+
printTranscript: "Transcript:"
|
|
5649
5570
|
},
|
|
5650
5571
|
multipleChoice: {
|
|
5651
5572
|
minSelections: "Select at least {{minSelections}}.",
|
|
@@ -5711,7 +5632,7 @@ var e$1 = {
|
|
|
5711
5632
|
};
|
|
5712
5633
|
//#endregion
|
|
5713
5634
|
//#region ../../shared/translator/dist/es.js
|
|
5714
|
-
var e = {
|
|
5635
|
+
var e$1 = {
|
|
5715
5636
|
translation: {
|
|
5716
5637
|
categorize: {
|
|
5717
5638
|
limitMaxChoicesPerCategory: "Has alcanzado el límite de {{maxChoicesPerCategory}} respuestas por área. Para agregar otra respuesta, primero se debe eliminar una respuesta.",
|
|
@@ -5788,8 +5709,7 @@ var e = {
|
|
|
5788
5709
|
listenSilentAlt: "Escuchar. Repetir las instrucciones.",
|
|
5789
5710
|
listenPlayingAlt: "Escuchar. Estas son las instrucciones.",
|
|
5790
5711
|
printAudio: "Audio:",
|
|
5791
|
-
printTranscript: "Transcripción:"
|
|
5792
|
-
printKey: "(clave)"
|
|
5712
|
+
printTranscript: "Transcripción:"
|
|
5793
5713
|
},
|
|
5794
5714
|
multipleChoice: {
|
|
5795
5715
|
minSelections: "Seleccione al menos {{minSelections}}.",
|
|
@@ -7852,8 +7772,8 @@ instance.init({
|
|
|
7852
7772
|
lng: "en",
|
|
7853
7773
|
showSupportNotice: !1,
|
|
7854
7774
|
resources: {
|
|
7855
|
-
en: e$
|
|
7856
|
-
es: e
|
|
7775
|
+
en: e$2,
|
|
7776
|
+
es: e$1
|
|
7857
7777
|
}
|
|
7858
7778
|
});
|
|
7859
7779
|
//#endregion
|
|
@@ -7896,7 +7816,7 @@ var { translator } = {
|
|
|
7896
7816
|
* HTML-escaped: they are circle and tile names, and Svelte escapes what it
|
|
7897
7817
|
* renders.
|
|
7898
7818
|
*/
|
|
7899
|
-
function t(key, language, values = {}) {
|
|
7819
|
+
function t$1(key, language, values = {}) {
|
|
7900
7820
|
return translator.t(`translation:vennClassification:${key}`, {
|
|
7901
7821
|
lng: language,
|
|
7902
7822
|
...values,
|
|
@@ -7916,7 +7836,7 @@ function stripHtml(s) {
|
|
|
7916
7836
|
function tileAccessibleName(tile, language) {
|
|
7917
7837
|
const alt = (tile.imageAlt ?? "").trim();
|
|
7918
7838
|
if ((tile.imageUrl ?? "").trim() && alt) return alt;
|
|
7919
|
-
return stripHtml(tile.label ?? "") || t("tileFallbackName", language);
|
|
7839
|
+
return stripHtml(tile.label ?? "") || t$1("tileFallbackName", language);
|
|
7920
7840
|
}
|
|
7921
7841
|
/**
|
|
7922
7842
|
* A tile button's accessible name: what it is, where it sits, and in `evaluate`
|
|
@@ -7929,9 +7849,9 @@ function tileAccessibleName(tile, language) {
|
|
|
7929
7849
|
* `unanswered`, which "not placed" already says.
|
|
7930
7850
|
*/
|
|
7931
7851
|
function tileStatusName(tile, regionLabel, verdict, language) {
|
|
7932
|
-
const parts = [tileAccessibleName(tile, language), regionLabel === null ? t("tileNotPlaced", language) : t("tileInRegion", language, { region: regionLabel })];
|
|
7933
|
-
if (verdict === "correct") parts.push(t("tileCorrect", language));
|
|
7934
|
-
if (verdict === "incorrect") parts.push(t("tileIncorrect", language));
|
|
7852
|
+
const parts = [tileAccessibleName(tile, language), regionLabel === null ? t$1("tileNotPlaced", language) : t$1("tileInRegion", language, { region: regionLabel })];
|
|
7853
|
+
if (verdict === "correct") parts.push(t$1("tileCorrect", language));
|
|
7854
|
+
if (verdict === "incorrect") parts.push(t$1("tileIncorrect", language));
|
|
7935
7855
|
return parts.join(", ");
|
|
7936
7856
|
}
|
|
7937
7857
|
//#endregion
|
|
@@ -8404,17 +8324,17 @@ function enumerateRegions(circleCount) {
|
|
|
8404
8324
|
*/
|
|
8405
8325
|
function composeRegionLabel(circles, region, language) {
|
|
8406
8326
|
const norm = normalizeRegion(region);
|
|
8407
|
-
const setLabel = (i) => circles[i]?.label ?? t("setNumber", language, { number: i + 1 });
|
|
8327
|
+
const setLabel = (i) => circles[i]?.label ?? t$1("setNumber", language, { number: i + 1 });
|
|
8408
8328
|
const labels = norm.map(setLabel);
|
|
8409
8329
|
if (norm.length === 0) {
|
|
8410
|
-
if (circles.length === 2) return t("regionNeither", language, {
|
|
8330
|
+
if (circles.length === 2) return t$1("regionNeither", language, {
|
|
8411
8331
|
first: setLabel(0),
|
|
8412
8332
|
second: setLabel(1)
|
|
8413
8333
|
});
|
|
8414
|
-
return t("regionNoneOf", language, { sets: circles.map((_, i) => setLabel(i)).join(", ") });
|
|
8334
|
+
return t$1("regionNoneOf", language, { sets: circles.map((_, i) => setLabel(i)).join(", ") });
|
|
8415
8335
|
}
|
|
8416
|
-
if (norm.length === 1) return t("regionOnly", language, { set: labels[0] });
|
|
8417
|
-
return labels.join(t("regionAndSeparator", language));
|
|
8336
|
+
if (norm.length === 1) return t$1("regionOnly", language, { set: labels[0] });
|
|
8337
|
+
return labels.join(t$1("regionAndSeparator", language));
|
|
8418
8338
|
}
|
|
8419
8339
|
/**
|
|
8420
8340
|
* Resolve the label for a region, preferring an author-supplied override from
|
|
@@ -9073,11 +8993,7 @@ function VennClassification($$anchor, $$props) {
|
|
|
9073
8993
|
tileId,
|
|
9074
8994
|
placement
|
|
9075
8995
|
});
|
|
9076
|
-
|
|
9077
|
-
sourceEl: containerEl,
|
|
9078
|
-
session: next,
|
|
9079
|
-
complete: next.completed === true
|
|
9080
|
-
});
|
|
8996
|
+
$$props.onSessionChange?.(next);
|
|
9081
8997
|
}
|
|
9082
8998
|
function findTile(id) {
|
|
9083
8999
|
if (!id) return null;
|
|
@@ -9087,7 +9003,7 @@ function VennClassification($$anchor, $$props) {
|
|
|
9087
9003
|
return get$1(layout)?.regionByKey[key];
|
|
9088
9004
|
}
|
|
9089
9005
|
function targetLabel(key) {
|
|
9090
|
-
return key === "tray" ? t("tray", get$1(language)) : regionByKey(key)?.label ?? t("unknownTarget", get$1(language));
|
|
9006
|
+
return key === "tray" ? t$1("tray", get$1(language)) : regionByKey(key)?.label ?? t$1("unknownTarget", get$1(language));
|
|
9091
9007
|
}
|
|
9092
9008
|
function clearHeld() {
|
|
9093
9009
|
set(heldTileId, null);
|
|
@@ -9108,11 +9024,11 @@ function VennClassification($$anchor, $$props) {
|
|
|
9108
9024
|
const name = tileAccessibleName(tile, get$1(language));
|
|
9109
9025
|
const placement = targetKey === "tray" ? null : targetKey === null ? void 0 : regionByKey(targetKey)?.region;
|
|
9110
9026
|
if (placement === void 0 || isSamePlacement($$props?.session, tile.id, placement)) {
|
|
9111
|
-
announce(t("cancelled", get$1(language)));
|
|
9027
|
+
announce(t$1("cancelled", get$1(language)));
|
|
9112
9028
|
return;
|
|
9113
9029
|
}
|
|
9114
9030
|
commitPlacement(tile.id, placement);
|
|
9115
|
-
announce(placement === null ? t("returnedToTray", get$1(language), { name }) : t("placedIn", get$1(language), {
|
|
9031
|
+
announce(placement === null ? t$1("returnedToTray", get$1(language), { name }) : t$1("placedIn", get$1(language), {
|
|
9116
9032
|
name,
|
|
9117
9033
|
target: targetLabel(targetKey)
|
|
9118
9034
|
}));
|
|
@@ -9129,7 +9045,7 @@ function VennClassification($$anchor, $$props) {
|
|
|
9129
9045
|
y: e.clientY
|
|
9130
9046
|
}, true);
|
|
9131
9047
|
set(hoveredRegionKey, resolveHoverKeyFromPointer(e.clientX, e.clientY), true);
|
|
9132
|
-
announce(t("pickedUp", get$1(language), { name: tileAccessibleName(tile, get$1(language)) }));
|
|
9048
|
+
announce(t$1("pickedUp", get$1(language), { name: tileAccessibleName(tile, get$1(language)) }));
|
|
9133
9049
|
const onMove = (ev) => {
|
|
9134
9050
|
set(dragPos, {
|
|
9135
9051
|
x: ev.clientX,
|
|
@@ -9148,7 +9064,7 @@ function VennClassification($$anchor, $$props) {
|
|
|
9148
9064
|
const onCancel = () => {
|
|
9149
9065
|
detach();
|
|
9150
9066
|
clearHeld();
|
|
9151
|
-
announce(t("cancelled", get$1(language)));
|
|
9067
|
+
announce(t$1("cancelled", get$1(language)));
|
|
9152
9068
|
};
|
|
9153
9069
|
const detach = () => {
|
|
9154
9070
|
window.removeEventListener("pointermove", onMove);
|
|
@@ -9198,7 +9114,7 @@ function VennClassification($$anchor, $$props) {
|
|
|
9198
9114
|
const startKey = placed === null ? get$1(navigableTargets)[0] ?? null : regionKey(placed);
|
|
9199
9115
|
set(heldTileId, tile.id, true);
|
|
9200
9116
|
set(keyboardFocusKey, startKey, true);
|
|
9201
|
-
announce(t("pickedUpWithKeyboard", get$1(language), {
|
|
9117
|
+
announce(t$1("pickedUpWithKeyboard", get$1(language), {
|
|
9202
9118
|
name: tileAccessibleName(tile, get$1(language)),
|
|
9203
9119
|
target: targetLabel(startKey ?? "")
|
|
9204
9120
|
}));
|
|
@@ -9234,7 +9150,7 @@ function VennClassification($$anchor, $$props) {
|
|
|
9234
9150
|
if (e.key === "Escape" && get$1(heldTileId) === tile.id) {
|
|
9235
9151
|
e.preventDefault();
|
|
9236
9152
|
clearHeld();
|
|
9237
|
-
announce(t("cancelled", get$1(language)));
|
|
9153
|
+
announce(t$1("cancelled", get$1(language)));
|
|
9238
9154
|
return;
|
|
9239
9155
|
}
|
|
9240
9156
|
if (get$1(heldTileId) === tile.id && (e.key === "ArrowLeft" || e.key === "ArrowRight" || e.key === "ArrowUp" || e.key === "ArrowDown" || e.key === "Tab")) {
|
|
@@ -9245,7 +9161,7 @@ function VennClassification($$anchor, $$props) {
|
|
|
9245
9161
|
const delta = e.key === "ArrowLeft" || e.key === "ArrowUp" || e.key === "Tab" && e.shiftKey ? -1 : 1;
|
|
9246
9162
|
idx = (idx + delta + get$1(navigableTargets).length) % get$1(navigableTargets).length;
|
|
9247
9163
|
set(keyboardFocusKey, get$1(navigableTargets)[idx], true);
|
|
9248
|
-
announce(t("dropTarget", get$1(language), { target: targetLabel(get$1(keyboardFocusKey)) }));
|
|
9164
|
+
announce(t$1("dropTarget", get$1(language), { target: targetLabel(get$1(keyboardFocusKey)) }));
|
|
9249
9165
|
}
|
|
9250
9166
|
}
|
|
9251
9167
|
/** A keyboard pickup ends when focus leaves the component. */
|
|
@@ -9254,7 +9170,7 @@ function VennClassification($$anchor, $$props) {
|
|
|
9254
9170
|
const next = e.relatedTarget;
|
|
9255
9171
|
if (next && containerEl?.contains(next)) return;
|
|
9256
9172
|
clearHeld();
|
|
9257
|
-
announce(t("cancelled", get$1(language)));
|
|
9173
|
+
announce(t$1("cancelled", get$1(language)));
|
|
9258
9174
|
}
|
|
9259
9175
|
function tileVerdict(id) {
|
|
9260
9176
|
if (!get$1(isEvaluate) || get$1(showCorrect)) return null;
|
|
@@ -9265,7 +9181,7 @@ function VennClassification($$anchor, $$props) {
|
|
|
9265
9181
|
if (!containerEl) return;
|
|
9266
9182
|
const warn = (err) => console.warn("venn-classification: MathJax render failed", err);
|
|
9267
9183
|
try {
|
|
9268
|
-
Promise.resolve(c(containerEl)).catch(warn);
|
|
9184
|
+
Promise.resolve(c$1(containerEl)).catch(warn);
|
|
9269
9185
|
} catch (err) {
|
|
9270
9186
|
warn(err);
|
|
9271
9187
|
}
|
|
@@ -9341,7 +9257,7 @@ function VennClassification($$anchor, $$props) {
|
|
|
9341
9257
|
var consequent_4 = ($$anchor) => {
|
|
9342
9258
|
var div_2 = root_4();
|
|
9343
9259
|
var text_1 = only_child(div_2, true);
|
|
9344
|
-
template_effect(($0) => set_text(text_1, $0), [() => t("unsupportedCircles", get$1(language), {
|
|
9260
|
+
template_effect(($0) => set_text(text_1, $0), [() => t$1("unsupportedCircles", get$1(language), {
|
|
9345
9261
|
count: get$1(circles).length,
|
|
9346
9262
|
supported: SUPPORTED_CIRCLES
|
|
9347
9263
|
})]);
|
|
@@ -9549,7 +9465,7 @@ function VennClassification($$anchor, $$props) {
|
|
|
9549
9465
|
var node_15 = sibling(div_3, 2);
|
|
9550
9466
|
{
|
|
9551
9467
|
let $0 = /* @__PURE__ */ user_derived(() => get$1(hoveredRegionKey) === "tray" || get$1(heldTileId) !== null && get$1(keyboardFocusKey) === "tray");
|
|
9552
|
-
let $1 = /* @__PURE__ */ user_derived(() => t("tray", get$1(language)));
|
|
9468
|
+
let $1 = /* @__PURE__ */ user_derived(() => t$1("tray", get$1(language)));
|
|
9553
9469
|
Tray(node_15, {
|
|
9554
9470
|
get isDropTarget() {
|
|
9555
9471
|
return get$1($0);
|
|
@@ -9707,82 +9623,97 @@ function VennClassification($$anchor, $$props) {
|
|
|
9707
9623
|
delegate(["focusout", "click"]);
|
|
9708
9624
|
create_custom_element(VennClassification, {
|
|
9709
9625
|
model: { type: "Object" },
|
|
9710
|
-
session: { type: "Object" }
|
|
9626
|
+
session: { type: "Object" },
|
|
9627
|
+
onSessionChange: {}
|
|
9711
9628
|
}, [], []);
|
|
9712
9629
|
//#endregion
|
|
9713
|
-
//#region
|
|
9714
|
-
|
|
9715
|
-
|
|
9716
|
-
|
|
9717
|
-
|
|
9718
|
-
|
|
9719
|
-
|
|
9720
|
-
|
|
9721
|
-
|
|
9722
|
-
|
|
9723
|
-
|
|
9724
|
-
|
|
9725
|
-
*/
|
|
9726
|
-
"_playerSession",
|
|
9727
|
-
null
|
|
9728
|
-
);
|
|
9729
|
-
_defineProperty(this, "_model", null);
|
|
9730
|
-
_defineProperty(this, "_isComplete", () => {
|
|
9731
|
-
return isComplete(this._model, this._internalSession);
|
|
9732
|
-
});
|
|
9733
|
-
_defineProperty(
|
|
9734
|
-
this,
|
|
9735
|
-
/**
|
|
9736
|
-
* Dispatched a microtask later: on load a player sets the model and then the
|
|
9737
|
-
* session in the same task (`element.model = …; element.session = …`), and
|
|
9738
|
-
* `complete` can only report a restored placement once the session is here.
|
|
9739
|
-
*/
|
|
9740
|
-
"_dispatchModelSet",
|
|
9741
|
-
() => {
|
|
9742
|
-
queueMicrotask(() => {
|
|
9743
|
-
this.dispatchEvent(new s$2(this.tagName.toLowerCase(), this._isComplete(), this._model !== void 0));
|
|
9744
|
-
});
|
|
9745
|
-
}
|
|
9746
|
-
);
|
|
9747
|
-
_defineProperty(this, "_dispatchSessionChanged", () => {
|
|
9748
|
-
this.dispatchEvent(new c$2(this.tagName.toLowerCase(), this._isComplete()));
|
|
9749
|
-
});
|
|
9750
|
-
_defineProperty(this, "onSessionChange", (updatedSession) => {
|
|
9751
|
-
a$1(this._playerSession, updatedSession);
|
|
9752
|
-
this._internalSession = updatedSession;
|
|
9753
|
-
super.session = updatedSession;
|
|
9754
|
-
this._dispatchSessionChanged();
|
|
9755
|
-
});
|
|
9756
|
-
}
|
|
9757
|
-
set model(m) {
|
|
9758
|
-
this._model = m;
|
|
9759
|
-
super.model = m;
|
|
9760
|
-
this._dispatchModelSet();
|
|
9761
|
-
}
|
|
9762
|
-
get model() {
|
|
9763
|
-
return this._model;
|
|
9630
|
+
//#region ../../lib-svelte/delivery-events/dist/index2.js
|
|
9631
|
+
function e(e) {
|
|
9632
|
+
return !!e && typeof e == "object" && !Array.isArray(e);
|
|
9633
|
+
}
|
|
9634
|
+
function t(t, n) {
|
|
9635
|
+
if (t === n) return t;
|
|
9636
|
+
if (!e(t) || !e(n) || Object.isFrozen(t) || !Object.isExtensible(t)) return n;
|
|
9637
|
+
try {
|
|
9638
|
+
for (let e of Object.keys(t)) e in n || delete t[e];
|
|
9639
|
+
Object.assign(t, n);
|
|
9640
|
+
} catch {
|
|
9641
|
+
return n;
|
|
9764
9642
|
}
|
|
9765
|
-
|
|
9766
|
-
|
|
9767
|
-
|
|
9768
|
-
|
|
9769
|
-
|
|
9770
|
-
|
|
9771
|
-
|
|
9772
|
-
|
|
9773
|
-
|
|
9774
|
-
|
|
9775
|
-
|
|
9776
|
-
|
|
9643
|
+
return t;
|
|
9644
|
+
}
|
|
9645
|
+
//#endregion
|
|
9646
|
+
//#region ../../shared/player-events/dist/index.js
|
|
9647
|
+
var _e;
|
|
9648
|
+
var _e2;
|
|
9649
|
+
var s = (_e = class e extends CustomEvent {
|
|
9650
|
+
constructor(t, n, r) {
|
|
9651
|
+
super(e.TYPE, {
|
|
9652
|
+
bubbles: !0,
|
|
9653
|
+
composed: !0,
|
|
9654
|
+
detail: {
|
|
9655
|
+
complete: n,
|
|
9656
|
+
component: t,
|
|
9657
|
+
hasModel: r
|
|
9658
|
+
}
|
|
9659
|
+
}), this.component = t, this.complete = n;
|
|
9777
9660
|
}
|
|
9778
|
-
|
|
9779
|
-
|
|
9661
|
+
}, _e.TYPE = "model-set", _e);
|
|
9662
|
+
var c = (_e2 = class e extends CustomEvent {
|
|
9663
|
+
constructor(t, n) {
|
|
9664
|
+
super(e.TYPE, {
|
|
9665
|
+
bubbles: !0,
|
|
9666
|
+
composed: !0,
|
|
9667
|
+
detail: {
|
|
9668
|
+
complete: n,
|
|
9669
|
+
component: t
|
|
9670
|
+
}
|
|
9671
|
+
}), this.component = t, this.complete = n;
|
|
9780
9672
|
}
|
|
9781
|
-
|
|
9782
|
-
|
|
9783
|
-
|
|
9673
|
+
}, _e2.TYPE = "session-changed", _e2);
|
|
9674
|
+
//#endregion
|
|
9675
|
+
//#region ../../lib-svelte/delivery-events/dist/index3.js
|
|
9676
|
+
function r(r, i) {
|
|
9677
|
+
let a = r.element;
|
|
9678
|
+
if (!a) throw TypeError("defineDeliveryElement: the component was not compiled with `customElement`");
|
|
9679
|
+
var _e = /* @__PURE__ */ new WeakMap();
|
|
9680
|
+
var _t = /* @__PURE__ */ new WeakMap();
|
|
9681
|
+
class o extends a {
|
|
9682
|
+
constructor() {
|
|
9683
|
+
var _super = (..._args) => (super(..._args), _classPrivateFieldInitSpec(this, _e, void 0), _classPrivateFieldInitSpec(this, _t, void 0), this);
|
|
9684
|
+
_super(), this.onSessionChange = (e) => {
|
|
9685
|
+
this.writeSession(e), this.dispatchSessionChanged();
|
|
9686
|
+
};
|
|
9687
|
+
}
|
|
9688
|
+
set model(e) {
|
|
9689
|
+
_classPrivateFieldSet2(_e, this, e), super.model = e, queueMicrotask(() => {
|
|
9690
|
+
this.dispatchEvent(new s(this.tagName.toLowerCase(), this.isComplete(), _classPrivateFieldGet2(_e, this) !== void 0));
|
|
9691
|
+
});
|
|
9692
|
+
}
|
|
9693
|
+
get model() {
|
|
9694
|
+
return _classPrivateFieldGet2(_e, this);
|
|
9695
|
+
}
|
|
9696
|
+
set session(e) {
|
|
9697
|
+
_classPrivateFieldSet2(_t, this, e), super.session = e, this.dispatchSessionChanged();
|
|
9698
|
+
}
|
|
9699
|
+
get session() {
|
|
9700
|
+
return _classPrivateFieldGet2(_t, this);
|
|
9701
|
+
}
|
|
9702
|
+
isComplete() {
|
|
9703
|
+
return i.isComplete(_classPrivateFieldGet2(_e, this), _classPrivateFieldGet2(_t, this));
|
|
9704
|
+
}
|
|
9705
|
+
writeSession(t$4) {
|
|
9706
|
+
_classPrivateFieldSet2(_t, this, t(_classPrivateFieldGet2(_t, this), t$4)), super.session = t$4;
|
|
9707
|
+
}
|
|
9708
|
+
dispatchSessionChanged() {
|
|
9709
|
+
this.dispatchEvent(new c(this.tagName.toLowerCase(), this.isComplete()));
|
|
9710
|
+
}
|
|
9784
9711
|
}
|
|
9785
|
-
|
|
9712
|
+
return o;
|
|
9713
|
+
}
|
|
9714
|
+
//#endregion
|
|
9715
|
+
//#region src/delivery/index.ts
|
|
9716
|
+
var VennClassificationElement = r(VennClassification, { isComplete });
|
|
9786
9717
|
//#endregion
|
|
9787
9718
|
export { VennClassificationElement as default };
|
|
9788
9719
|
|