@pie-element/venn-classification 0.1.1-next.1 → 0.1.1-next.2
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.js +25242 -16259
- package/dist/author/index.js.map +1 -1
- package/dist/browser/{VennClassification-C6roHfLf.js → VennClassification-DtwuotJl.js} +76 -69
- package/dist/browser/{VennClassification-C6roHfLf.js.map → VennClassification-DtwuotJl.js.map} +1 -1
- package/dist/browser/author/index.js +16646 -10743
- package/dist/browser/author/index.js.map +1 -1
- package/dist/browser/delivery/index.js +1 -1
- package/dist/delivery/index.js +15 -8
- package/dist/delivery/index.js.map +1 -1
- package/dist/index.iife.js +4 -4
- package/dist/index.js +15 -8
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -2568,7 +2568,7 @@ function zi({ sourceEl: e, fallbackSelector: t, component: n, complete: r, sessi
|
|
|
2568
2568
|
//#region ../../shared/math-rendering-mathjax/dist/index.js
|
|
2569
2569
|
var Bi = "https://cdn.jsdelivr.net/npm/mathjax@4/tex-chtml.js", Vi = null;
|
|
2570
2570
|
function Hi(e) {
|
|
2571
|
-
return typeof window > "u" || window.MathJax?.
|
|
2571
|
+
return typeof window > "u" || window.MathJax?.typesetPromise ? Promise.resolve() : Vi || (Vi = new Promise((t, n) => {
|
|
2572
2572
|
let { useSingleDollar: r = !1, accessibility: i = !0, loadFonts: a = !0, srcUrl: o } = e, s = {
|
|
2573
2573
|
loader: { load: i ? ["a11y/assistive-mml"] : [] },
|
|
2574
2574
|
tex: {
|
|
@@ -2622,36 +2622,43 @@ function Wi(e = {}) {
|
|
|
2622
2622
|
await window.MathJax.typesetPromise([t]), Ui();
|
|
2623
2623
|
};
|
|
2624
2624
|
}
|
|
2625
|
-
var Gi = null;
|
|
2626
|
-
function
|
|
2627
|
-
return
|
|
2625
|
+
var Gi = "@pie-lib/math-rendering", Ki = null;
|
|
2626
|
+
function qi() {
|
|
2627
|
+
return Ki ||= Wi({
|
|
2628
2628
|
accessibility: !0,
|
|
2629
2629
|
useSingleDollar: !0
|
|
2630
|
-
}),
|
|
2630
|
+
}), Ki;
|
|
2631
2631
|
}
|
|
2632
|
-
|
|
2632
|
+
function Ji() {
|
|
2633
|
+
if (typeof window > "u") return null;
|
|
2634
|
+
let e = window[Gi];
|
|
2635
|
+
return typeof e?.renderMath == "function" ? e : null;
|
|
2636
|
+
}
|
|
2637
|
+
var Yi = async (e) => {
|
|
2633
2638
|
if (typeof window > "u") return;
|
|
2634
2639
|
let t = typeof e == "string", n;
|
|
2635
|
-
|
|
2640
|
+
t ? (n = document.createElement("div"), n.innerHTML = e) : n = e || document.body;
|
|
2641
|
+
let r = Ji();
|
|
2642
|
+
return r ? await r.renderMath?.(n) : await qi()(n), t ? n.innerHTML : void 0;
|
|
2636
2643
|
};
|
|
2637
2644
|
//#endregion
|
|
2638
2645
|
//#region src/delivery/tile-accessible-name.ts
|
|
2639
|
-
function
|
|
2646
|
+
function Xi(e) {
|
|
2640
2647
|
return (e || "").replace(/<[^>]+>/g, " ").replace(/\s+/g, " ").trim();
|
|
2641
2648
|
}
|
|
2642
|
-
function
|
|
2649
|
+
function Zi(e) {
|
|
2643
2650
|
let t = (e.imageAlt ?? "").trim();
|
|
2644
|
-
return (e.imageUrl ?? "").trim() && t ? t :
|
|
2651
|
+
return (e.imageUrl ?? "").trim() && t ? t : Xi(e.label ?? "") || "Tile";
|
|
2645
2652
|
}
|
|
2646
2653
|
//#endregion
|
|
2647
2654
|
//#region src/delivery/Tile.svelte
|
|
2648
|
-
var
|
|
2655
|
+
var Qi = /* @__PURE__ */ Y("<img alt=\"\" class=\"tile-img svelte-1hgaksk\" aria-hidden=\"true\" draggable=\"false\"/>"), $i = /* @__PURE__ */ Y("<span></span>"), ea = /* @__PURE__ */ Y("<span class=\"badge badge-correct svelte-1hgaksk\" aria-hidden=\"true\"><svg viewBox=\"0 0 24 24\" width=\"14\" height=\"14\" fill=\"currentColor\"><path d=\"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z\"></path></svg></span>"), ta = /* @__PURE__ */ Y("<span class=\"badge badge-incorrect svelte-1hgaksk\" aria-hidden=\"true\"><svg viewBox=\"0 0 24 24\" width=\"14\" height=\"14\" fill=\"currentColor\"><path d=\"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z\"></path></svg></span>"), na = /* @__PURE__ */ Y("<button type=\"button\"><span><!> <!></span> <!></button>"), ra = {
|
|
2649
2656
|
hash: "svelte-1hgaksk",
|
|
2650
2657
|
code: ".venn-tile.svelte-1hgaksk {position:relative;display:inline-flex;align-items:center;justify-content:center;min-width:64px;min-height:44px;padding:8px 14px;border:1.5px solid #334155;border-radius:10px;background:#ffffff;color:#0f172a;font-size:14px;font-weight:500;box-shadow:0 1px 2px rgba(15, 23, 42, 0.06);cursor:grab;touch-action:none;user-select:none;transition:box-shadow 120ms ease, transform 120ms ease, background 120ms ease;}.venn-tile.svelte-1hgaksk:focus-visible,\n .venn-tile.focused.svelte-1hgaksk {outline:2px solid #2563eb;outline-offset:2px;}.venn-tile.svelte-1hgaksk:hover:not(:disabled) {background:#f8fafc;}.venn-tile.held.svelte-1hgaksk {cursor:grabbing;box-shadow:0 6px 18px rgba(15, 23, 42, 0.18);transform:translateY(-1px);background:#eef2ff;}.venn-tile.invisible.svelte-1hgaksk {visibility:hidden;}.venn-tile.ghost.svelte-1hgaksk {pointer-events:none;cursor:grabbing;box-shadow:0 10px 24px rgba(15, 23, 42, 0.22);transform:rotate(-1.5deg);background:#ffffff;opacity:0.96;}.venn-tile.correct.svelte-1hgaksk {border-color:#0ea449;}.venn-tile.incorrect.svelte-1hgaksk {border-color:#bf0d00;}.venn-tile.svelte-1hgaksk:disabled {cursor:default;}.tile-body.svelte-1hgaksk {display:inline-flex;flex-direction:row;align-items:center;justify-content:center;gap:8px;pointer-events:none;max-width:220px;}.tile-body-image.svelte-1hgaksk {flex-direction:column;gap:4px;}.tile-img.svelte-1hgaksk {width:40px;height:40px;object-fit:contain;flex-shrink:0;}.tile-label.svelte-1hgaksk {pointer-events:none;text-align:center;line-height:1.25;word-break:break-word;}.tile-label-below.svelte-1hgaksk {font-size:12px;font-weight:600;}.badge.svelte-1hgaksk {position:absolute;top:-8px;right:-8px;width:20px;height:20px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;color:#ffffff;}.badge-correct.svelte-1hgaksk {background:#0ea449;}.badge-incorrect.svelte-1hgaksk {background:#bf0d00;}\n @media (prefers-reduced-motion: reduce) {.venn-tile.svelte-1hgaksk {transition:none;}\n }"
|
|
2651
2658
|
};
|
|
2652
|
-
function
|
|
2653
|
-
Ze(t, !0), oi(e,
|
|
2654
|
-
let n = $(t, "id", 7), r = $(t, "label", 7), i = $(t, "imageUrl", 7), a = $(t, "imageAlt", 7), o = $(t, "correctness", 7, "neutral"), s = $(t, "held", 7, !1), c = $(t, "invisible", 7, !1), l = $(t, "ghost", 7, !1), u = $(t, "disabled", 7, !1), d = $(t, "focused", 7, !1), f = $(t, "onpointerdown", 7), p = $(t, "onkeydown", 7), m = $(t, "onfocus", 7), h = $(t, "onclick", 7), g = /* @__PURE__ */ I(() =>
|
|
2659
|
+
function ia(e, t) {
|
|
2660
|
+
Ze(t, !0), oi(e, ra);
|
|
2661
|
+
let n = $(t, "id", 7), r = $(t, "label", 7), i = $(t, "imageUrl", 7), a = $(t, "imageAlt", 7), o = $(t, "correctness", 7, "neutral"), s = $(t, "held", 7, !1), c = $(t, "invisible", 7, !1), l = $(t, "ghost", 7, !1), u = $(t, "disabled", 7, !1), d = $(t, "focused", 7, !1), f = $(t, "onpointerdown", 7), p = $(t, "onkeydown", 7), m = $(t, "onfocus", 7), h = $(t, "onclick", 7), g = /* @__PURE__ */ I(() => Zi({
|
|
2655
2662
|
label: r(),
|
|
2656
2663
|
imageUrl: i(),
|
|
2657
2664
|
imageAlt: a()
|
|
@@ -2741,19 +2748,19 @@ function na(e, t) {
|
|
|
2741
2748
|
set onclick(e) {
|
|
2742
2749
|
h(e), F();
|
|
2743
2750
|
}
|
|
2744
|
-
}, b =
|
|
2751
|
+
}, b = na();
|
|
2745
2752
|
let x;
|
|
2746
2753
|
var S = B(b);
|
|
2747
2754
|
let C;
|
|
2748
2755
|
var ee = B(S), te = (e) => {
|
|
2749
|
-
var t =
|
|
2756
|
+
var t = Qi();
|
|
2750
2757
|
H(() => Q(t, "src", i())), X(e, t);
|
|
2751
2758
|
};
|
|
2752
2759
|
Z(ee, (e) => {
|
|
2753
2760
|
J(_) && e(te);
|
|
2754
2761
|
});
|
|
2755
2762
|
var w = V(ee, 2), T = (e) => {
|
|
2756
|
-
var t =
|
|
2763
|
+
var t = $i();
|
|
2757
2764
|
let n;
|
|
2758
2765
|
ai(t, r, !0), k(t), H(() => n = fi(t, 1, "tile-label svelte-1hgaksk", null, n, { "tile-label-below": J(_) })), X(e, t);
|
|
2759
2766
|
};
|
|
@@ -2761,9 +2768,9 @@ function na(e, t) {
|
|
|
2761
2768
|
J(v) && e(T);
|
|
2762
2769
|
}), k(S);
|
|
2763
2770
|
var ne = V(S, 2), re = (e) => {
|
|
2764
|
-
X(e,
|
|
2771
|
+
X(e, ea());
|
|
2765
2772
|
}, ie = (e) => {
|
|
2766
|
-
X(e,
|
|
2773
|
+
X(e, ta());
|
|
2767
2774
|
};
|
|
2768
2775
|
return Z(ne, (e) => {
|
|
2769
2776
|
o() === "correct" ? e(re) : o() === "incorrect" && e(ie, 1);
|
|
@@ -2790,7 +2797,7 @@ Cr([
|
|
|
2790
2797
|
"pointerdown",
|
|
2791
2798
|
"keydown",
|
|
2792
2799
|
"click"
|
|
2793
|
-
]), Pi(
|
|
2800
|
+
]), Pi(ia, {
|
|
2794
2801
|
id: {},
|
|
2795
2802
|
label: {},
|
|
2796
2803
|
imageUrl: {},
|
|
@@ -2808,12 +2815,12 @@ Cr([
|
|
|
2808
2815
|
}, [], [], { mode: "open" });
|
|
2809
2816
|
//#endregion
|
|
2810
2817
|
//#region src/delivery/Tray.svelte
|
|
2811
|
-
var
|
|
2818
|
+
var aa = /* @__PURE__ */ Y("<div role=\"region\" data-region-key=\"tray\"><div class=\"tray-label svelte-1ogsh8s\"> </div> <div class=\"tray-items svelte-1ogsh8s\"><!></div></div>"), oa = {
|
|
2812
2819
|
hash: "svelte-1ogsh8s",
|
|
2813
2820
|
code: ".venn-tray.svelte-1ogsh8s {border:1.5px dashed #94a3b8;border-radius:12px;padding:14px 16px;background:#f8fafc;min-height:120px;transition:background 120ms ease, border-color 120ms ease;}.venn-tray.drop-target.svelte-1ogsh8s {background:#e0f2fe;border-color:#0ea5e9;}.venn-tray.focused.svelte-1ogsh8s {outline:2px solid #2563eb;outline-offset:2px;}.tray-label.svelte-1ogsh8s {font-size:12px;font-weight:600;color:#475569;text-transform:uppercase;letter-spacing:0.05em;margin-bottom:8px;}.tray-items.svelte-1ogsh8s {display:flex;flex-wrap:wrap;gap:10px;}\n @media (prefers-reduced-motion: reduce) {.venn-tray.svelte-1ogsh8s {transition:none;}\n }"
|
|
2814
2821
|
};
|
|
2815
|
-
function
|
|
2816
|
-
Ze(t, !0), oi(e,
|
|
2822
|
+
function sa(e, t) {
|
|
2823
|
+
Ze(t, !0), oi(e, oa);
|
|
2817
2824
|
let n = $(t, "isDropTarget", 7, !1), r = $(t, "focused", 7, !1), i = $(t, "label", 7, "Tiles to classify"), a = $(t, "onpointerenter", 7), o = $(t, "onpointerleave", 7), s = $(t, "children", 7);
|
|
2818
2825
|
var c = {
|
|
2819
2826
|
get isDropTarget() {
|
|
@@ -2852,7 +2859,7 @@ function aa(e, t) {
|
|
|
2852
2859
|
set children(e) {
|
|
2853
2860
|
s(e), F();
|
|
2854
2861
|
}
|
|
2855
|
-
}, l =
|
|
2862
|
+
}, l = aa();
|
|
2856
2863
|
let u;
|
|
2857
2864
|
var d = B(l), f = B(d, !0);
|
|
2858
2865
|
k(d);
|
|
@@ -2873,7 +2880,7 @@ function aa(e, t) {
|
|
|
2873
2880
|
o()?.apply(this, e);
|
|
2874
2881
|
}), X(e, l), Qe(c);
|
|
2875
2882
|
}
|
|
2876
|
-
Pi(
|
|
2883
|
+
Pi(sa, {
|
|
2877
2884
|
isDropTarget: {},
|
|
2878
2885
|
focused: {},
|
|
2879
2886
|
label: {},
|
|
@@ -2883,7 +2890,7 @@ Pi(aa, {
|
|
|
2883
2890
|
}, [], [], { mode: "open" });
|
|
2884
2891
|
//#endregion
|
|
2885
2892
|
//#region src/delivery/layout.ts
|
|
2886
|
-
function
|
|
2893
|
+
function ca() {
|
|
2887
2894
|
return {
|
|
2888
2895
|
width: 900,
|
|
2889
2896
|
height: 540,
|
|
@@ -2900,7 +2907,7 @@ function oa() {
|
|
|
2900
2907
|
}]
|
|
2901
2908
|
};
|
|
2902
2909
|
}
|
|
2903
|
-
function
|
|
2910
|
+
function la(e, t) {
|
|
2904
2911
|
return (n, r, i) => {
|
|
2905
2912
|
let a = n % t, o = Math.floor(n / t), s = t * r + (t - 1) * 8;
|
|
2906
2913
|
return {
|
|
@@ -2909,7 +2916,7 @@ function sa(e, t) {
|
|
|
2909
2916
|
};
|
|
2910
2917
|
};
|
|
2911
2918
|
}
|
|
2912
|
-
function
|
|
2919
|
+
function ua(t, i = ca()) {
|
|
2913
2920
|
if (!t.circles || t.circles.length !== 2) throw Error(`buildLayout2Set requires exactly 2 circles (got ${t.circles?.length ?? 0})`);
|
|
2914
2921
|
let [a, o] = i.circles, s = r(2), c = Math.max(a.cy + a.r, o.cy + o.r), l = Math.min(i.height - i.outsideStripHeight, c + i.outsideGap), u = (e, t, n) => (r, i) => {
|
|
2915
2922
|
let a = r - e, o = i - t;
|
|
@@ -2966,7 +2973,7 @@ function ca(t, i = oa()) {
|
|
|
2966
2973
|
label: c,
|
|
2967
2974
|
hitRect: p,
|
|
2968
2975
|
pointInRegion: u,
|
|
2969
|
-
gridSlot:
|
|
2976
|
+
gridSlot: la(m, x)
|
|
2970
2977
|
};
|
|
2971
2978
|
return b[s] = S, S;
|
|
2972
2979
|
}),
|
|
@@ -2974,7 +2981,7 @@ function ca(t, i = oa()) {
|
|
|
2974
2981
|
outsideStripTop: l
|
|
2975
2982
|
};
|
|
2976
2983
|
}
|
|
2977
|
-
function
|
|
2984
|
+
function da(e, t, n) {
|
|
2978
2985
|
for (let r of [
|
|
2979
2986
|
"0,1",
|
|
2980
2987
|
"0",
|
|
@@ -2988,7 +2995,7 @@ function la(e, t, n) {
|
|
|
2988
2995
|
}
|
|
2989
2996
|
//#endregion
|
|
2990
2997
|
//#region src/delivery/dnd.ts
|
|
2991
|
-
function
|
|
2998
|
+
function fa({ model: e, session: n, tileId: r, placement: a }) {
|
|
2992
2999
|
let o = n || {}, s = o.placements ?? {}, c = a === null ? null : t(a), l = {
|
|
2993
3000
|
...s,
|
|
2994
3001
|
[r]: c
|
|
@@ -2998,11 +3005,11 @@ function ua({ model: e, session: n, tileId: r, placement: a }) {
|
|
|
2998
3005
|
};
|
|
2999
3006
|
return u.completed = i(e, u), u;
|
|
3000
3007
|
}
|
|
3001
|
-
function
|
|
3008
|
+
function pa(e, t) {
|
|
3002
3009
|
let n = t?.placements ?? {};
|
|
3003
3010
|
return (e.tiles || []).filter((e) => n[e.id] == null);
|
|
3004
3011
|
}
|
|
3005
|
-
function
|
|
3012
|
+
function ma(e, n) {
|
|
3006
3013
|
let r = n?.placements ?? {}, i = {};
|
|
3007
3014
|
for (let n of e.tiles || []) {
|
|
3008
3015
|
let e = r[n.id];
|
|
@@ -3020,19 +3027,19 @@ new Set([
|
|
|
3020
3027
|
]);
|
|
3021
3028
|
//#endregion
|
|
3022
3029
|
//#region src/delivery/VennClassification.svelte
|
|
3023
|
-
var
|
|
3030
|
+
var ha = /* @__PURE__ */ Y("<div class=\"venn-prompt prose svelte-gkcqor\"></div>"), ga = /* @__PURE__ */ jr("<svg class=\"toggle-icon svelte-gkcqor\" preserveAspectRatio=\"xMinYMin meet\" version=\"1.1\" viewBox=\"-283 359 34 35\" aria-hidden=\"true\"><circle cx=\"-266\" cy=\"375.9\" r=\"14\" fill=\"#bce2ff\"></circle><path d=\"M-280.5,375.9c0-8,6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5s-6.5,14.5-14.5,14.5S-280.5,383.9-280.5,375.9z M-279.5,375.9c0,7.4,6.1,13.5,13.5,13.5c7.4,0,13.5-6.1,13.5-13.5s-6.1-13.5-13.5-13.5C-273.4,362.4-279.5,368.5-279.5,375.9z\" fill=\"#bce2ff\"></path><polygon points=\"-265.4,383.1 -258.6,377.2 -261.2,374.2 -264.3,376.9 -268.9,368.7 -272.4,370.6\" fill=\"#1a9cff\"></polygon></svg>"), _a = /* @__PURE__ */ jr("<svg class=\"toggle-icon svelte-gkcqor\" preserveAspectRatio=\"xMinYMin meet\" version=\"1.1\" viewBox=\"-129.5 127 34 35\" aria-hidden=\"true\"><path style=\"fill: #D0CAC5; stroke: #E6E3E0; stroke-width: 0.75; stroke-miterlimit: 10;\" d=\"M-112.9,160.4c-8.5,0-15.5-6.9-15.5-15.5c0-8.5,6.9-15.5,15.5-15.5s15.5,6.9,15.5,15.5 C-97.4,153.5-104.3,160.4-112.9,160.4z\"></path><path style=\"fill: #B3ABA4; stroke: #CDC7C2; stroke-width: 0.5; stroke-miterlimit: 10;\" d=\"M-113.2,159c-8,0-14.5-6.5-14.5-14.5s6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5S-105.2,159-113.2,159z\"></path><circle cx=\"-114.2\" cy=\"143.5\" r=\"14\" fill=\"white\"></circle><path d=\"M-114.2,158c-8,0-14.5-6.5-14.5-14.5s6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5S-106.2,158-114.2,158z M-114.2,130c-7.4,0-13.5,6.1-13.5,13.5s6.1,13.5,13.5,13.5s13.5-6.1,13.5-13.5S-106.8,130-114.2,130z\" fill=\"#bce2ff\"></path><polygon points=\"-114.8,150.7 -121.6,144.8 -119,141.8 -115.9,144.5 -111.3,136.3 -107.8,138.2\" fill=\"#1a9cff\"></polygon></svg>"), va = /* @__PURE__ */ Y("<button type=\"button\" class=\"toggle-correct svelte-gkcqor\"><!> <span class=\"toggle-label svelte-gkcqor\"> </span></button>"), ya = /* @__PURE__ */ jr("<circle fill=\"rgba(14, 165, 233, 0.12)\"></circle>"), ba = /* @__PURE__ */ jr("<rect x=\"0\" y=\"0\" mask=\"url(#venn-mask-left-only)\"></rect>"), xa = /* @__PURE__ */ jr("<rect x=\"0\" y=\"0\" mask=\"url(#venn-mask-right-only)\"></rect>"), Sa = /* @__PURE__ */ jr("<circle clip-path=\"url(#venn-clip-left)\"></circle>"), Ca = /* @__PURE__ */ jr("<rect x=\"0\" y=\"0\" mask=\"url(#venn-mask-outside)\"></rect>"), wa = /* @__PURE__ */ jr("<circle fill=\"none\" stroke=\"#1e293b\" stroke-width=\"2.5\"></circle>"), Ta = /* @__PURE__ */ jr("<text font-size=\"22\" font-weight=\"600\" fill=\"#0f172a\"> </text>"), Ea = /* @__PURE__ */ Y("<div class=\"region-aria svelte-gkcqor\" role=\"region\"></div>"), Da = /* @__PURE__ */ Y("<div class=\"tile-wrapper svelte-gkcqor\"><!></div>"), Oa = /* @__PURE__ */ Y("<div class=\"drag-ghost svelte-gkcqor\"><!></div>"), ka = /* @__PURE__ */ Y("<div class=\"venn-root svelte-gkcqor\"><!> <!> <div class=\"venn-diagram svelte-gkcqor\"><svg preserveAspectRatio=\"xMidYMid meet\" aria-hidden=\"true\" class=\"svelte-gkcqor\"><defs><mask id=\"venn-mask-left-only\" maskUnits=\"userSpaceOnUse\" x=\"0\" y=\"0\"><rect x=\"0\" y=\"0\" fill=\"black\"></rect><circle fill=\"white\"></circle><circle fill=\"black\"></circle></mask><mask id=\"venn-mask-right-only\" maskUnits=\"userSpaceOnUse\" x=\"0\" y=\"0\"><rect x=\"0\" y=\"0\" fill=\"black\"></rect><circle fill=\"white\"></circle><circle fill=\"black\"></circle></mask><clipPath id=\"venn-clip-left\" clipPathUnits=\"userSpaceOnUse\"><circle></circle></clipPath><mask id=\"venn-mask-outside\" maskUnits=\"userSpaceOnUse\" x=\"0\" y=\"0\"><rect x=\"0\" y=\"0\" fill=\"white\"></rect><circle fill=\"black\"></circle><circle fill=\"black\"></circle></mask></defs><rect x=\"1\" y=\"1\" fill=\"#ffffff\" stroke=\"#cbd5e1\" stroke-width=\"1.5\" rx=\"12\"></rect><!><!><!><!><!><!><!><line x1=\"16\" stroke=\"#cbd5e1\" stroke-width=\"1\" stroke-dasharray=\"4 6\"></line></svg> <div class=\"region-labels svelte-gkcqor\" aria-hidden=\"false\"></div> <div class=\"placed-tiles svelte-gkcqor\"></div></div> <!> <!> <div class=\"sr-only svelte-gkcqor\" aria-live=\"polite\" aria-atomic=\"true\"></div></div>"), Aa = {
|
|
3024
3031
|
hash: "svelte-gkcqor",
|
|
3025
3032
|
code: ".venn-root.svelte-gkcqor {display:flex;flex-direction:column;gap:16px;padding:16px;color:#0f172a;font-family:system-ui, -apple-system, Segoe UI, Roboto, sans-serif;}.venn-prompt.svelte-gkcqor {font-size:16px;line-height:1.5;}.venn-prompt.svelte-gkcqor p {margin:0 0 8px 0;}.toggle-correct.svelte-gkcqor {align-self:center;display:inline-flex;align-items:center;gap:8px;margin:0 0 4px 0;padding:0;background:transparent;border:0;color:inherit;font:inherit;font-size:14px;cursor:pointer;user-select:none;}.toggle-correct.svelte-gkcqor:focus-visible {outline:2px solid #2563eb;outline-offset:2px;border-radius:2px;}.toggle-icon.svelte-gkcqor {width:25px;height:25px;flex-shrink:0;}.toggle-label.svelte-gkcqor {line-height:1.2;}.toggle-correct.svelte-gkcqor:hover .toggle-label:where(.svelte-gkcqor),\n .toggle-correct.svelte-gkcqor:focus-visible .toggle-label:where(.svelte-gkcqor) {text-decoration:underline;}.venn-diagram.svelte-gkcqor {position:relative;width:100%;\n /*\n * Keep the diagram \"smart\" about vertical space: it should not monopolise\n * the viewport and force the tray below the fold.\n * - aspect-ratio preserves the 3:2 geometry the SVG is tuned for\n * - max-width keeps the diagram from dominating wide layouts\n * - max-height (viewport-relative) shrinks it further in short windows\n * so the prompt, toggle, and tray remain in view without scrolling\n * whenever possible. The SVG uses preserveAspectRatio=\"xMidYMid meet\",\n * so when max-height wins the width reduces in lockstep.\n */max-width:720px;aspect-ratio:900 / 540;max-height:min(60vh, 430px);margin:0 auto;}.venn-diagram.svelte-gkcqor svg:where(.svelte-gkcqor) {width:100%;height:100%;display:block;}.placed-tiles.svelte-gkcqor,\n .region-labels.svelte-gkcqor {position:absolute;inset:0;pointer-events:none;}.tile-wrapper.svelte-gkcqor {position:absolute;transform:translate(-50%, -50%);pointer-events:auto;}.region-aria.svelte-gkcqor {position:absolute;width:1px;height:1px;transform:translate(-50%, -50%);opacity:0;pointer-events:none;}.sr-only.svelte-gkcqor {position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border:0;}.drag-ghost.svelte-gkcqor {position:fixed;top:0;left:0;transform:translate(-50%, -50%);pointer-events:none;z-index:1000;}"
|
|
3026
3033
|
};
|
|
3027
|
-
function
|
|
3028
|
-
Ze(t, !0), oi(e,
|
|
3029
|
-
let n = null, r = null, i = null, a = null, o = /* @__PURE__ */ L(!1), s = /* @__PURE__ */ L(null), c = /* @__PURE__ */ L(null), l = /* @__PURE__ */ L(null), u = /* @__PURE__ */ L(null), d =
|
|
3034
|
+
function ja(e, t) {
|
|
3035
|
+
Ze(t, !0), oi(e, Aa);
|
|
3036
|
+
let n = null, r = null, i = null, a = null, o = /* @__PURE__ */ L(!1), s = /* @__PURE__ */ L(null), c = /* @__PURE__ */ L(null), l = /* @__PURE__ */ L(null), u = /* @__PURE__ */ L(null), d = ca(), f = /* @__PURE__ */ I(() => ({
|
|
3030
3037
|
circles: t?.model?.circles ?? [{ label: "Set A" }, { label: "Set B" }],
|
|
3031
3038
|
tiles: t?.model?.tiles ?? [],
|
|
3032
3039
|
regionLabels: t?.model?.regionLabels ?? {},
|
|
3033
3040
|
scoringPolicy: "partialPerTile",
|
|
3034
3041
|
promptEnabled: !0
|
|
3035
|
-
})), p = /* @__PURE__ */ I(() =>
|
|
3042
|
+
})), p = /* @__PURE__ */ I(() => ua(J(f), d)), m = /* @__PURE__ */ I(() => t?.model?.env?.mode === "evaluate"), h = /* @__PURE__ */ I(() => t?.model?.disabled === !0), g = /* @__PURE__ */ I(() => t?.model?.prompt ?? null), _ = /* @__PURE__ */ I(() => S(t?.session, t?.model, J(o))), v = /* @__PURE__ */ I(() => ({ placements: J(_) })), y = /* @__PURE__ */ I(() => ma(J(f), J(v))), b = /* @__PURE__ */ I(() => pa(J(f), J(v))), x = /* @__PURE__ */ I(() => [
|
|
3036
3043
|
"0",
|
|
3037
3044
|
"0,1",
|
|
3038
3045
|
"1",
|
|
@@ -3066,7 +3073,7 @@ function ka(e, t) {
|
|
|
3066
3073
|
};
|
|
3067
3074
|
}
|
|
3068
3075
|
function T(e, r) {
|
|
3069
|
-
let i =
|
|
3076
|
+
let i = fa({
|
|
3070
3077
|
model: J(f),
|
|
3071
3078
|
session: t?.session,
|
|
3072
3079
|
tileId: e,
|
|
@@ -3091,7 +3098,7 @@ function ka(e, t) {
|
|
|
3091
3098
|
t.preventDefault(), t.currentTarget.setPointerCapture?.(t.pointerId), R(s, e.id, !0), R(u, {
|
|
3092
3099
|
x: t.clientX,
|
|
3093
3100
|
y: t.clientY
|
|
3094
|
-
}, !0), R(c, ae(t.clientX, t.clientY), !0), C(`Picked up ${
|
|
3101
|
+
}, !0), R(c, ae(t.clientX, t.clientY), !0), C(`Picked up ${Zi(e)}`);
|
|
3095
3102
|
let n = (e) => {
|
|
3096
3103
|
R(u, {
|
|
3097
3104
|
x: e.clientX,
|
|
@@ -3109,7 +3116,7 @@ function ka(e, t) {
|
|
|
3109
3116
|
return;
|
|
3110
3117
|
}
|
|
3111
3118
|
if (o === "tray") {
|
|
3112
|
-
T(e.id, null), C(`${
|
|
3119
|
+
T(e.id, null), C(`${Zi(e)} returned to tray`);
|
|
3113
3120
|
return;
|
|
3114
3121
|
}
|
|
3115
3122
|
let l = re(o);
|
|
@@ -3117,7 +3124,7 @@ function ka(e, t) {
|
|
|
3117
3124
|
C("Cancelled");
|
|
3118
3125
|
return;
|
|
3119
3126
|
}
|
|
3120
|
-
T(e.id, l.region), C(`${
|
|
3127
|
+
T(e.id, l.region), C(`${Zi(e)} placed in ${l.label}`);
|
|
3121
3128
|
};
|
|
3122
3129
|
window.addEventListener("pointermove", n), window.addEventListener("pointerup", r), window.addEventListener("pointercancel", r);
|
|
3123
3130
|
}
|
|
@@ -3125,7 +3132,7 @@ function ka(e, t) {
|
|
|
3125
3132
|
if (oe(e, t)) return "tray";
|
|
3126
3133
|
let n = w(e, t);
|
|
3127
3134
|
if (!n) return null;
|
|
3128
|
-
let r =
|
|
3135
|
+
let r = da(J(p), n.x, n.y);
|
|
3129
3136
|
return r ? r.key : null;
|
|
3130
3137
|
}
|
|
3131
3138
|
function oe(e, t) {
|
|
@@ -3144,13 +3151,13 @@ function ka(e, t) {
|
|
|
3144
3151
|
return;
|
|
3145
3152
|
}
|
|
3146
3153
|
if (t === "tray") {
|
|
3147
|
-
T(e.id, null), C(`${
|
|
3154
|
+
T(e.id, null), C(`${Zi(e)} returned to tray`);
|
|
3148
3155
|
return;
|
|
3149
3156
|
}
|
|
3150
3157
|
let n = re(t);
|
|
3151
3158
|
if (!n) return;
|
|
3152
|
-
T(e.id, n.region), C(`${
|
|
3153
|
-
} else R(s, e.id, !0), R(l, J(x)[0] ?? null, !0), C(`Picked up ${
|
|
3159
|
+
T(e.id, n.region), C(`${Zi(e)} placed in ${n.label}`);
|
|
3160
|
+
} else R(s, e.id, !0), R(l, J(x)[0] ?? null, !0), C(`Picked up ${Zi(e)}. Use arrow keys to choose a region, then press Enter to commit.`);
|
|
3154
3161
|
return;
|
|
3155
3162
|
}
|
|
3156
3163
|
if (t.key === "Escape" && J(s) === e.id) {
|
|
@@ -3173,7 +3180,7 @@ function ka(e, t) {
|
|
|
3173
3180
|
}
|
|
3174
3181
|
function le() {
|
|
3175
3182
|
if (n) try {
|
|
3176
|
-
|
|
3183
|
+
Yi(n);
|
|
3177
3184
|
} catch (e) {
|
|
3178
3185
|
console.warn("venn-classification: MathJax render failed", e);
|
|
3179
3186
|
}
|
|
@@ -3184,18 +3191,18 @@ function ka(e, t) {
|
|
|
3184
3191
|
J(_), J(f).tiles?.length, pr().then(le);
|
|
3185
3192
|
});
|
|
3186
3193
|
let ue = /* @__PURE__ */ I(() => J(m) ? Object.values(t?.model?.correctness ?? {}).filter((e) => e === "incorrect" || e === "unanswered").length : 0), de = /* @__PURE__ */ I(() => J(s) === null ? J(c) ?? null : J(c) ?? J(l) ?? null), fe = /* @__PURE__ */ I(() => J(de) === "0"), pe = /* @__PURE__ */ I(() => J(de) === "1"), me = /* @__PURE__ */ I(() => J(de) === "0,1"), he = /* @__PURE__ */ I(() => J(de) === ""), ge = "rgba(37, 99, 235, 0.18)", _e = /* @__PURE__ */ I(() => J(s) !== null && J(u) !== null ? ne(J(s)) : null);
|
|
3187
|
-
var ve =
|
|
3188
|
-
var t =
|
|
3194
|
+
var ve = ka(), ye = B(ve), be = (e) => {
|
|
3195
|
+
var t = ha();
|
|
3189
3196
|
ai(t, () => J(g), !0), k(t), X(e, t);
|
|
3190
3197
|
};
|
|
3191
3198
|
Z(ye, (e) => {
|
|
3192
3199
|
J(g) && e(be);
|
|
3193
3200
|
});
|
|
3194
3201
|
var xe = V(ye, 2), Se = (e) => {
|
|
3195
|
-
var t =
|
|
3196
|
-
X(e,
|
|
3202
|
+
var t = va(), n = B(t), r = (e) => {
|
|
3203
|
+
X(e, ga());
|
|
3197
3204
|
}, i = (e) => {
|
|
3198
|
-
X(e,
|
|
3205
|
+
X(e, _a());
|
|
3199
3206
|
};
|
|
3200
3207
|
Z(n, (e) => {
|
|
3201
3208
|
J(o) ? e(r) : e(i, -1);
|
|
@@ -3218,13 +3225,13 @@ function ka(e, t) {
|
|
|
3218
3225
|
k(Ie), k(Te);
|
|
3219
3226
|
var Be = V(Te), E = V(Be);
|
|
3220
3227
|
$r(E, 17, () => d.circles, Yr, (e, t) => {
|
|
3221
|
-
var n =
|
|
3228
|
+
var n = ya();
|
|
3222
3229
|
H(() => {
|
|
3223
3230
|
Q(n, "cx", J(t).cx), Q(n, "cy", J(t).cy), Q(n, "r", J(t).r);
|
|
3224
3231
|
}), X(e, n);
|
|
3225
3232
|
});
|
|
3226
3233
|
var Ve = V(E), D = (e) => {
|
|
3227
|
-
var t =
|
|
3234
|
+
var t = ba();
|
|
3228
3235
|
Q(t, "fill", ge), H(() => {
|
|
3229
3236
|
Q(t, "width", d.width), Q(t, "height", d.height);
|
|
3230
3237
|
}), X(e, t);
|
|
@@ -3233,7 +3240,7 @@ function ka(e, t) {
|
|
|
3233
3240
|
J(fe) && e(D);
|
|
3234
3241
|
});
|
|
3235
3242
|
var O = V(Ve), He = (e) => {
|
|
3236
|
-
var t =
|
|
3243
|
+
var t = xa();
|
|
3237
3244
|
Q(t, "fill", ge), H(() => {
|
|
3238
3245
|
Q(t, "width", d.width), Q(t, "height", d.height);
|
|
3239
3246
|
}), X(e, t);
|
|
@@ -3242,7 +3249,7 @@ function ka(e, t) {
|
|
|
3242
3249
|
J(pe) && e(He);
|
|
3243
3250
|
});
|
|
3244
3251
|
var Ue = V(O), We = (e) => {
|
|
3245
|
-
var t =
|
|
3252
|
+
var t = Sa();
|
|
3246
3253
|
Q(t, "fill", ge), H(() => {
|
|
3247
3254
|
Q(t, "cx", d.circles[1].cx), Q(t, "cy", d.circles[1].cy), Q(t, "r", d.circles[1].r);
|
|
3248
3255
|
}), X(e, t);
|
|
@@ -3251,7 +3258,7 @@ function ka(e, t) {
|
|
|
3251
3258
|
J(me) && e(We);
|
|
3252
3259
|
});
|
|
3253
3260
|
var Ge = V(Ue), Ke = (e) => {
|
|
3254
|
-
var t =
|
|
3261
|
+
var t = Ca();
|
|
3255
3262
|
Q(t, "fill", ge), H(() => {
|
|
3256
3263
|
Q(t, "width", d.width), Q(t, "height", d.height);
|
|
3257
3264
|
}), X(e, t);
|
|
@@ -3261,14 +3268,14 @@ function ka(e, t) {
|
|
|
3261
3268
|
});
|
|
3262
3269
|
var qe = V(Ge);
|
|
3263
3270
|
$r(qe, 17, () => d.circles, Yr, (e, t) => {
|
|
3264
|
-
var n =
|
|
3271
|
+
var n = wa();
|
|
3265
3272
|
H(() => {
|
|
3266
3273
|
Q(n, "cx", J(t).cx), Q(n, "cy", J(t).cy), Q(n, "r", J(t).r);
|
|
3267
3274
|
}), X(e, n);
|
|
3268
3275
|
});
|
|
3269
3276
|
var Je = V(qe);
|
|
3270
3277
|
$r(Je, 17, () => d.circles, Yr, (e, t, n) => {
|
|
3271
|
-
var r =
|
|
3278
|
+
var r = Ta();
|
|
3272
3279
|
Q(r, "text-anchor", n === 0 ? "start" : "end");
|
|
3273
3280
|
var i = B(r, !0);
|
|
3274
3281
|
k(r), H((e, t) => {
|
|
@@ -3280,7 +3287,7 @@ function ka(e, t) {
|
|
|
3280
3287
|
var Ye = V(we, 2);
|
|
3281
3288
|
$r(Ye, 21, () => J(p).regions, Yr, (e, t) => {
|
|
3282
3289
|
let n = /* @__PURE__ */ I(() => ee(J(t).hitRect.x + J(t).hitRect.w / 2, J(t).hitRect.y + J(t).hitRect.h / 2));
|
|
3283
|
-
var r =
|
|
3290
|
+
var r = Ea();
|
|
3284
3291
|
H(() => {
|
|
3285
3292
|
Q(r, "aria-label", J(t).label), Q(r, "data-region-key", J(t).key), mi(r, `left: ${J(n).left ?? ""}%; top: ${J(n).top ?? ""}%;`);
|
|
3286
3293
|
}), X(e, r);
|
|
@@ -3293,10 +3300,10 @@ function ka(e, t) {
|
|
|
3293
3300
|
var t = Mr();
|
|
3294
3301
|
$r(pn(t), 19, i, (e) => e.id, (e, t, n) => {
|
|
3295
3302
|
let r = /* @__PURE__ */ I(() => J(a).gridSlot(J(n), 132, 68)), i = /* @__PURE__ */ I(() => ee(J(r).x, J(r).y));
|
|
3296
|
-
var o =
|
|
3303
|
+
var o = Da(), c = B(o);
|
|
3297
3304
|
{
|
|
3298
3305
|
let e = /* @__PURE__ */ I(() => ce(J(t).id)), n = /* @__PURE__ */ I(() => J(s) === J(t).id), r = /* @__PURE__ */ I(() => J(s) === J(t).id && J(u) !== null);
|
|
3299
|
-
|
|
3306
|
+
ia(c, {
|
|
3300
3307
|
get id() {
|
|
3301
3308
|
return J(t).id;
|
|
3302
3309
|
},
|
|
@@ -3335,7 +3342,7 @@ function ka(e, t) {
|
|
|
3335
3342
|
var Xe = V(Ce, 2);
|
|
3336
3343
|
{
|
|
3337
3344
|
let e = /* @__PURE__ */ I(() => J(c) === "tray" || J(s) !== null && J(l) === "tray");
|
|
3338
|
-
|
|
3345
|
+
sa(Xe, {
|
|
3339
3346
|
get isDropTarget() {
|
|
3340
3347
|
return J(e);
|
|
3341
3348
|
},
|
|
@@ -3345,7 +3352,7 @@ function ka(e, t) {
|
|
|
3345
3352
|
$r(pn(n), 17, () => J(b), (e) => e.id, (e, t) => {
|
|
3346
3353
|
{
|
|
3347
3354
|
let n = /* @__PURE__ */ I(() => J(s) === J(t).id), r = /* @__PURE__ */ I(() => J(s) === J(t).id && J(u) !== null);
|
|
3348
|
-
|
|
3355
|
+
ia(e, {
|
|
3349
3356
|
get id() {
|
|
3350
3357
|
return J(t).id;
|
|
3351
3358
|
},
|
|
@@ -3378,8 +3385,8 @@ function ka(e, t) {
|
|
|
3378
3385
|
});
|
|
3379
3386
|
}
|
|
3380
3387
|
var $e = V(Xe, 2), et = (e) => {
|
|
3381
|
-
var t =
|
|
3382
|
-
|
|
3388
|
+
var t = Oa();
|
|
3389
|
+
ia(B(t), {
|
|
3383
3390
|
get id() {
|
|
3384
3391
|
return J(_e).id;
|
|
3385
3392
|
},
|
|
@@ -3402,11 +3409,11 @@ function ka(e, t) {
|
|
|
3402
3409
|
Q(we, "viewBox", `0 0 ${d.width ?? ""} ${d.height ?? ""}`), Q(Ee, "width", d.width), Q(Ee, "height", d.height), Q(De, "width", d.width), Q(De, "height", d.height), Q(Oe, "cx", d.circles[0].cx), Q(Oe, "cy", d.circles[0].cy), Q(Oe, "r", d.circles[0].r), Q(ke, "cx", d.circles[1].cx), Q(ke, "cy", d.circles[1].cy), Q(ke, "r", d.circles[1].r), Q(Ae, "width", d.width), Q(Ae, "height", d.height), Q(je, "width", d.width), Q(je, "height", d.height), Q(Me, "cx", d.circles[1].cx), Q(Me, "cy", d.circles[1].cy), Q(Me, "r", d.circles[1].r), Q(Ne, "cx", d.circles[0].cx), Q(Ne, "cy", d.circles[0].cy), Q(Ne, "r", d.circles[0].r), Q(Fe, "cx", d.circles[0].cx), Q(Fe, "cy", d.circles[0].cy), Q(Fe, "r", d.circles[0].r), Q(Ie, "width", d.width), Q(Ie, "height", d.height), Q(Le, "width", d.width), Q(Le, "height", d.height), Q(Re, "cx", d.circles[0].cx), Q(Re, "cy", d.circles[0].cy), Q(Re, "r", d.circles[0].r), Q(ze, "cx", d.circles[1].cx), Q(ze, "cy", d.circles[1].cy), Q(ze, "r", d.circles[1].r), Q(Be, "width", d.width - 2), Q(Be, "height", d.height - 2), Q(A, "x2", d.width - 16), Q(A, "y1", J(p).outsideStripTop), Q(A, "y2", J(p).outsideStripTop);
|
|
3403
3410
|
}), X(e, ve), Qe();
|
|
3404
3411
|
}
|
|
3405
|
-
Cr(["click"]), Pi(
|
|
3412
|
+
Cr(["click"]), Pi(ja, {
|
|
3406
3413
|
model: { type: "Object" },
|
|
3407
3414
|
session: { type: "Object" }
|
|
3408
3415
|
}, [], []);
|
|
3409
3416
|
//#endregion
|
|
3410
|
-
export { H as A, Qe as B, Fr as C, Cr as D, Y as E, an as F, Ue as H, R as I, L, B as M, pn as N, Sr as O, V as P, I as R, Wr as S, Mr as T, k as U, Ze as V, $r as _, Pi as a, qr as b, Ei as c, xi as d, bi as f, ai as g, oi as h, Ii as i, En as j, J as k, yi as l, fi as m,
|
|
3417
|
+
export { H as A, Qe as B, Fr as C, Cr as D, Y as E, an as F, Ue as H, R as I, L, B as M, pn as N, Sr as O, V as P, I as R, Wr as S, Mr as T, k as U, Ze as V, $r as _, Pi as a, qr as b, Ei as c, xi as d, bi as f, ai as g, oi as h, Ii as i, En as j, J as k, yi as l, fi as m, Xi as n, $ as o, mi as p, Fi as r, Oi as s, ja as t, Q as u, Yr as v, X as w, Gr as x, Z as y, F as z };
|
|
3411
3418
|
|
|
3412
|
-
//# sourceMappingURL=VennClassification-
|
|
3419
|
+
//# sourceMappingURL=VennClassification-DtwuotJl.js.map
|