eat-js-sdk 2.4.3 → 2.5.1
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/interaction-builder.mjs +366 -250
- package/package.json +2 -2
|
@@ -5453,6 +5453,23 @@ async function typesetMathJax(element) {
|
|
|
5453
5453
|
el.setAttribute("tabindex", "-1");
|
|
5454
5454
|
});
|
|
5455
5455
|
}
|
|
5456
|
+
async function getMathJaxSpeechText(html2) {
|
|
5457
|
+
const staging = document.createElement("div");
|
|
5458
|
+
staging.style.cssText = "position:absolute;left:-9999px;width:1px;height:1px;overflow:hidden";
|
|
5459
|
+
staging.innerHTML = html2;
|
|
5460
|
+
document.body.appendChild(staging);
|
|
5461
|
+
try {
|
|
5462
|
+
await typesetMathJax(staging);
|
|
5463
|
+
staging.querySelectorAll("mjx-container").forEach((container) => {
|
|
5464
|
+
const assistive = container.querySelector("mjx-assistive-mml");
|
|
5465
|
+
const text2 = assistive?.textContent?.trim() ?? "";
|
|
5466
|
+
container.replaceWith(document.createTextNode(text2));
|
|
5467
|
+
});
|
|
5468
|
+
return staging.textContent?.trim() ?? "";
|
|
5469
|
+
} finally {
|
|
5470
|
+
if (staging.parentNode) staging.remove();
|
|
5471
|
+
}
|
|
5472
|
+
}
|
|
5456
5473
|
var root_1$o = /* @__PURE__ */ from_html(`<div><!></div>`);
|
|
5457
5474
|
function CommonStringToHtml($$anchor, $$props) {
|
|
5458
5475
|
push($$props, true);
|
|
@@ -6982,12 +6999,12 @@ function useImageModalSize() {
|
|
|
6982
6999
|
};
|
|
6983
7000
|
}
|
|
6984
7001
|
var root_4$8 = /* @__PURE__ */ from_html(`<span class="w-6 h-6 flex items-center justify-center"><!></span>`);
|
|
6985
|
-
var root_5$
|
|
7002
|
+
var root_5$a = /* @__PURE__ */ from_html(`<span class="w-6 h-6 flex items-center justify-center"><!></span>`);
|
|
6986
7003
|
var root_7$7 = /* @__PURE__ */ from_html(`<span class="sr-only"><!></span>`);
|
|
6987
|
-
var root_6$
|
|
7004
|
+
var root_6$4 = /* @__PURE__ */ from_html(`<div><!> <span aria-hidden="true"><!></span></div>`);
|
|
6988
7005
|
var root_10$3 = /* @__PURE__ */ from_html(`<span class="w-4 h-4 flex items-center justify-center"><!></span>`);
|
|
6989
7006
|
var root_11$2 = /* @__PURE__ */ from_html(`<span class="w-4 h-4 flex items-center justify-center"><!></span>`);
|
|
6990
|
-
var root_2$
|
|
7007
|
+
var root_2$f = /* @__PURE__ */ from_html(`<div class="absolute inset-0 m-0"><div class="w-full h-full px-0 md:px-[82px] lg:px-[128px] pt-14 pb-[72px] relative lg:py-24 flex flex-col items-center justify-center"><div aria-live="polite" aria-atomic="true" class="sr-only"><!> <!></div> <div class="w-full h-full flex flex-col md:flex-row md:justify-center items-center justify-between"><div class="md:hidden"></div> <!> <!> <div><div class="flex-shrink-0 flex items-center justify-between py-1 px-2 md:px-4 border-border-minimal border rounded-t-md lg:rounded-t-lg md:gap-4 h-8.5 md:h-fit"><!> <!> <!></div> <div class="rounded-b-md"><img class="mx-auto block rounded-b-md lg:rounded-b-lg object-contain max-w-full max-h-[calc(100vh-168px-34px)] md:max-h-[calc(100vh-128px-54px)] lg:max-h-[calc(100vh-192px-54px)] pointer-events-none"/></div></div> <div class="md:hidden flex justify-center items-center gap-1 flex-shrink-0 h-6 mt-4"><!> <!></div></div></div></div>`);
|
|
6991
7008
|
function MCQImageModal($$anchor, $$props) {
|
|
6992
7009
|
push($$props, true);
|
|
6993
7010
|
let isOpen = prop($$props, "isOpen", 7, false), options = prop($$props, "options", 23, () => []), currentIndex = prop($$props, "currentIndex", 7, 0), modalAriaLabel = prop($$props, "modalAriaLabel", 7, ""), onnavigate = prop($$props, "onnavigate", 7), onclose = prop($$props, "onclose", 7);
|
|
@@ -7193,7 +7210,7 @@ function MCQImageModal($$anchor, $$props) {
|
|
|
7193
7210
|
modalClass: "bg-charcoal/80 backdrop-blur-md pointer-events-none",
|
|
7194
7211
|
dataTestId: "mcq-img-viewer-mdl",
|
|
7195
7212
|
children: ($$anchor3, $$slotProps) => {
|
|
7196
|
-
var div = root_2$
|
|
7213
|
+
var div = root_2$f();
|
|
7197
7214
|
var div_1 = child(div);
|
|
7198
7215
|
var div_2 = child(div_1);
|
|
7199
7216
|
var node_1 = child(div_2);
|
|
@@ -7256,7 +7273,7 @@ function MCQImageModal($$anchor, $$props) {
|
|
|
7256
7273
|
dataTestId: "img-viewer-next",
|
|
7257
7274
|
onclick: navigateNext,
|
|
7258
7275
|
children: ($$anchor4, $$slotProps2) => {
|
|
7259
|
-
var span_1 = root_5$
|
|
7276
|
+
var span_1 = root_5$a();
|
|
7260
7277
|
var node_6 = child(span_1);
|
|
7261
7278
|
SvgLoader(node_6, {
|
|
7262
7279
|
svgName: "smallChevronRight",
|
|
@@ -7284,7 +7301,7 @@ function MCQImageModal($$anchor, $$props) {
|
|
|
7284
7301
|
return get$1(fullAnswerText);
|
|
7285
7302
|
},
|
|
7286
7303
|
children: ($$anchor4, $$slotProps2) => {
|
|
7287
|
-
var div_6 = root_6$
|
|
7304
|
+
var div_6 = root_6$4();
|
|
7288
7305
|
var node_8 = child(div_6);
|
|
7289
7306
|
{
|
|
7290
7307
|
var consequent_1 = ($$anchor5) => {
|
|
@@ -7615,10 +7632,10 @@ function InteractionSection($$anchor, $$props) {
|
|
|
7615
7632
|
return pop($$exports);
|
|
7616
7633
|
}
|
|
7617
7634
|
create_custom_element(InteractionSection, { children: {} }, [], [], true);
|
|
7618
|
-
var root_5$
|
|
7635
|
+
var root_5$9 = /* @__PURE__ */ from_html(`<div></div>`);
|
|
7619
7636
|
var root_4$7 = /* @__PURE__ */ from_html(`<div class="px-4 w-full max-w-[1008px] mx-auto flex-shrink-0 text-center font-semibold text-sm md:text-lg leading-[150%] text-white" aria-hidden="true" data-testid="img-viewer-cap-txt"> </div> <!>`, 1);
|
|
7620
7637
|
var root_7$6 = /* @__PURE__ */ from_html(`<div></div>`);
|
|
7621
|
-
var root_2$
|
|
7638
|
+
var root_2$e = /* @__PURE__ */ from_html(`<div class="absolute inset-0"><div class="w-full h-full flex items-center justify-center pt-14 pb-[72px] lg:py-24"><div aria-live="polite" aria-atomic="true" class="sr-only"> </div> <div class="flex flex-col items-center overflow-y-auto overflow-x-hidden w-full px-0 md:px-6 lg:px-16"><div class="relative bg-white rounded-md md:rounded-lg shadow-sm overflow-hidden flex-shrink-0"><img class="block object-contain w-full h-auto max-w-full mx-auto"/> <!></div> <!></div></div></div>`);
|
|
7622
7639
|
function PromptStimulusImageModal($$anchor, $$props) {
|
|
7623
7640
|
push($$props, true);
|
|
7624
7641
|
let isOpen = prop($$props, "isOpen", 7, false), imageUrl = prop($$props, "imageUrl", 7, ""), altText = prop($$props, "altText", 7, ""), caption = prop($$props, "caption", 7, ""), onclose = prop($$props, "onclose", 7);
|
|
@@ -7752,7 +7769,7 @@ function PromptStimulusImageModal($$anchor, $$props) {
|
|
|
7752
7769
|
dataTestId: "img-viewer-mdl",
|
|
7753
7770
|
onupdateModalSettings: updateModalSettings,
|
|
7754
7771
|
children: ($$anchor3, $$slotProps) => {
|
|
7755
|
-
var div = root_2$
|
|
7772
|
+
var div = root_2$e();
|
|
7756
7773
|
var div_1 = child(div);
|
|
7757
7774
|
var div_2 = child(div_1);
|
|
7758
7775
|
var text2 = child(div_2, true);
|
|
@@ -7789,7 +7806,7 @@ function PromptStimulusImageModal($$anchor, $$props) {
|
|
|
7789
7806
|
var node_3 = sibling(div_5, 2);
|
|
7790
7807
|
{
|
|
7791
7808
|
var consequent = ($$anchor5) => {
|
|
7792
|
-
var div_6 = root_5$
|
|
7809
|
+
var div_6 = root_5$9();
|
|
7793
7810
|
template_effect(() => set_style(div_6, `height:${get$1(bottomSpacerHeight) ?? ""}px`));
|
|
7794
7811
|
append($$anchor5, div_6);
|
|
7795
7812
|
};
|
|
@@ -8272,8 +8289,8 @@ const shouldRenderSection = (section) => section.condition !== false;
|
|
|
8272
8289
|
const getClassString = (classes = []) => classes.join(" ");
|
|
8273
8290
|
const getStyleString = (styles = {}) => Object.entries(styles).map(([k, v]) => `${k}:${v}`).join(";");
|
|
8274
8291
|
var root_4$6 = /* @__PURE__ */ from_html(`<p class="text-lg leading-[22px] text-blue-1000 font-semibold mt-4" data-testid="img-cap-txt"> </p>`);
|
|
8275
|
-
var root_5$
|
|
8276
|
-
var root_2$
|
|
8292
|
+
var root_5$8 = /* @__PURE__ */ from_html(`<div class="mt-6 w-full"><button class="flex items-center font-semibold leading-[1.5] outline-none group w-fit h-11 text-charcoal" aria-controls="long-description-content" aria-labelledby="image-description-label" type="button"><div class="w-6 h-6 flex items-center justify-center mr-2" data-testid="img-desc-txt"><!></div> <div id="image-description-label" class="image-description-accordion group-[.active]:border-b-2">Image Description</div></button> <div id="long-description-content" data-testid="img-desc-txt"><!></div></div>`);
|
|
8293
|
+
var root_2$d = /* @__PURE__ */ from_html(`<div class="flex flex-col justify-center items-center text-center"><div class="flex flex-col items-center"><div class="relative inline-block"><img/> <!></div> <!></div></div> <!>`, 1);
|
|
8277
8294
|
var root_1$j = /* @__PURE__ */ from_html(`<div class="w-full"><!></div>`);
|
|
8278
8295
|
function CommonMedia($$anchor, $$props) {
|
|
8279
8296
|
push($$props, true);
|
|
@@ -8365,7 +8382,7 @@ function CommonMedia($$anchor, $$props) {
|
|
|
8365
8382
|
var node_1 = child(div);
|
|
8366
8383
|
{
|
|
8367
8384
|
var consequent_2 = ($$anchor3) => {
|
|
8368
|
-
var fragment_1 = root_2$
|
|
8385
|
+
var fragment_1 = root_2$d();
|
|
8369
8386
|
var div_1 = first_child(fragment_1);
|
|
8370
8387
|
var div_2 = child(div_1);
|
|
8371
8388
|
var div_3 = child(div_2);
|
|
@@ -8405,7 +8422,7 @@ function CommonMedia($$anchor, $$props) {
|
|
|
8405
8422
|
var node_4 = sibling(div_1, 2);
|
|
8406
8423
|
{
|
|
8407
8424
|
var consequent_1 = ($$anchor4) => {
|
|
8408
|
-
var div_4 = root_5$
|
|
8425
|
+
var div_4 = root_5$8();
|
|
8409
8426
|
var button = child(div_4);
|
|
8410
8427
|
button.__click = toggleLongDescription;
|
|
8411
8428
|
button.__keydown = handleKeyDown;
|
|
@@ -8494,11 +8511,11 @@ create_custom_element(
|
|
|
8494
8511
|
true
|
|
8495
8512
|
);
|
|
8496
8513
|
var root_4$5 = /* @__PURE__ */ from_html(`<div data-testid="stimulus-txt-ctr"><!></div>`);
|
|
8497
|
-
var root_5$
|
|
8514
|
+
var root_5$7 = /* @__PURE__ */ from_html(`<div data-testid="stimulus-img-ctr"><!></div>`);
|
|
8498
8515
|
var root_3$b = /* @__PURE__ */ from_html(`<!> <!>`, 1);
|
|
8499
8516
|
var root_7$5 = /* @__PURE__ */ from_html(`<div data-testid="stimulus-img-ctr"><!></div>`);
|
|
8500
|
-
var root_8$
|
|
8501
|
-
var root_6$
|
|
8517
|
+
var root_8$6 = /* @__PURE__ */ from_html(`<div data-testid="stimulus-txt-ctr"><!></div>`);
|
|
8518
|
+
var root_6$3 = /* @__PURE__ */ from_html(`<!> <!>`, 1);
|
|
8502
8519
|
var root_1$i = /* @__PURE__ */ from_html(`<div class="stimulus-section flex flex-col w-full"><!> <div><!></div></div>`);
|
|
8503
8520
|
function StimulusSection($$anchor, $$props) {
|
|
8504
8521
|
push($$props, true);
|
|
@@ -8612,7 +8629,7 @@ function StimulusSection($$anchor, $$props) {
|
|
|
8612
8629
|
var node_5 = sibling(node_3, 2);
|
|
8613
8630
|
{
|
|
8614
8631
|
var consequent_2 = ($$anchor4) => {
|
|
8615
|
-
var div_3 = root_5$
|
|
8632
|
+
var div_3 = root_5$7();
|
|
8616
8633
|
let classes_2;
|
|
8617
8634
|
var node_6 = child(div_3);
|
|
8618
8635
|
CommonMedia(node_6, {
|
|
@@ -8647,7 +8664,7 @@ function StimulusSection($$anchor, $$props) {
|
|
|
8647
8664
|
append($$anchor3, fragment_2);
|
|
8648
8665
|
};
|
|
8649
8666
|
var alternate = ($$anchor3) => {
|
|
8650
|
-
var fragment_3 = root_6$
|
|
8667
|
+
var fragment_3 = root_6$3();
|
|
8651
8668
|
var node_7 = first_child(fragment_3);
|
|
8652
8669
|
{
|
|
8653
8670
|
var consequent_4 = ($$anchor4) => {
|
|
@@ -8686,7 +8703,7 @@ function StimulusSection($$anchor, $$props) {
|
|
|
8686
8703
|
var node_9 = sibling(node_7, 2);
|
|
8687
8704
|
{
|
|
8688
8705
|
var consequent_5 = ($$anchor4) => {
|
|
8689
|
-
var div_5 = root_8$
|
|
8706
|
+
var div_5 = root_8$6();
|
|
8690
8707
|
var node_10 = child(div_5);
|
|
8691
8708
|
CommonStringToHtml(node_10, {
|
|
8692
8709
|
get htmlString() {
|
|
@@ -8735,7 +8752,7 @@ create_custom_element(
|
|
|
8735
8752
|
[],
|
|
8736
8753
|
true
|
|
8737
8754
|
);
|
|
8738
|
-
var root_8$
|
|
8755
|
+
var root_8$5 = /* @__PURE__ */ from_html(`<div class="divider my-6"></div>`);
|
|
8739
8756
|
var root_13$3 = /* @__PURE__ */ from_html(`<div class="divider my-6"></div>`);
|
|
8740
8757
|
var root_15$1 = /* @__PURE__ */ from_html(`<div aria-live="polite"><!></div>`);
|
|
8741
8758
|
var root_1$h = /* @__PURE__ */ from_html(`<div><!></div>`);
|
|
@@ -8914,7 +8931,7 @@ function PromptContainer($$anchor, $$props) {
|
|
|
8914
8931
|
var node_3 = first_child(fragment_6);
|
|
8915
8932
|
{
|
|
8916
8933
|
var consequent_3 = ($$anchor6) => {
|
|
8917
|
-
var div_4 = root_8$
|
|
8934
|
+
var div_4 = root_8$5();
|
|
8918
8935
|
append($$anchor6, div_4);
|
|
8919
8936
|
};
|
|
8920
8937
|
var alternate_2 = ($$anchor6) => {
|
|
@@ -9124,13 +9141,13 @@ create_custom_element(
|
|
|
9124
9141
|
true
|
|
9125
9142
|
);
|
|
9126
9143
|
var root_1$g = /* @__PURE__ */ from_html(`<div class="sr-only" tabindex="-1"><!></div>`);
|
|
9127
|
-
var root_2$
|
|
9144
|
+
var root_2$c = /* @__PURE__ */ from_html(`<span> </span>`);
|
|
9128
9145
|
var root_3$a = /* @__PURE__ */ from_html(`<span>Missing answer</span>`);
|
|
9129
9146
|
var root_4$4 = /* @__PURE__ */ from_html(`<span class="sr-only"> </span>`);
|
|
9130
|
-
var root_5$
|
|
9131
|
-
var root_6$
|
|
9147
|
+
var root_5$6 = /* @__PURE__ */ from_html(`<span class="sr-only"> </span>`);
|
|
9148
|
+
var root_6$2 = /* @__PURE__ */ from_html(`<p>Missing answer</p>`);
|
|
9132
9149
|
var root_7$4 = /* @__PURE__ */ from_html(`<p class="text-red-400 text-sm font-semibold leading-[1.3] pr-2.5 hidden md:block"> </p>`);
|
|
9133
|
-
var root_8$
|
|
9150
|
+
var root_8$4 = /* @__PURE__ */ from_html(`<span aria-hidden="true"><!></span>`);
|
|
9134
9151
|
var root_12$3 = /* @__PURE__ */ from_html(`<span class="w-3 h-2 flex items-center justify-center"><!></span>`);
|
|
9135
9152
|
var root_11$1 = /* @__PURE__ */ from_html(`<span><!></span>`);
|
|
9136
9153
|
var root_13$2 = /* @__PURE__ */ from_html(`<div class="w-full overflow-hidden bg-white rounded-b-lg flex items-center justify-center relative"><img class="mcq-opt-img min-h-[154px] max-h-[184px] w-auto max-w-full object-contain pointer-events-none" data-testid="mcq-opt-img" loading="lazy"/></div>`);
|
|
@@ -9273,7 +9290,7 @@ function MCQOption($$anchor, $$props) {
|
|
|
9273
9290
|
var node_2 = child(span_4);
|
|
9274
9291
|
{
|
|
9275
9292
|
var consequent_1 = ($$anchor2) => {
|
|
9276
|
-
var span_5 = root_2$
|
|
9293
|
+
var span_5 = root_2$c();
|
|
9277
9294
|
var text_1 = child(span_5, true);
|
|
9278
9295
|
reset(span_5);
|
|
9279
9296
|
template_effect(() => {
|
|
@@ -9322,7 +9339,7 @@ function MCQOption($$anchor, $$props) {
|
|
|
9322
9339
|
var node_6 = sibling(node_5, 2);
|
|
9323
9340
|
{
|
|
9324
9341
|
var consequent_4 = ($$anchor2) => {
|
|
9325
|
-
var span_8 = root_5$
|
|
9342
|
+
var span_8 = root_5$6();
|
|
9326
9343
|
var text_3 = child(span_8, true);
|
|
9327
9344
|
reset(span_8);
|
|
9328
9345
|
template_effect(() => set_text(text_3, get$1(labelSuffix)));
|
|
@@ -9338,7 +9355,7 @@ function MCQOption($$anchor, $$props) {
|
|
|
9338
9355
|
var node_7 = child(span_9);
|
|
9339
9356
|
{
|
|
9340
9357
|
var consequent_5 = ($$anchor2) => {
|
|
9341
|
-
var p = root_6$
|
|
9358
|
+
var p = root_6$2();
|
|
9342
9359
|
template_effect(() => set_class(p, 1, `text-green-750 text-sm font-semibold leading-[1.3] hidden md:block
|
|
9343
9360
|
${get$1(totalCorrectAnswers) > 1 ? "pr-2.5" : ""}`));
|
|
9344
9361
|
append($$anchor2, p);
|
|
@@ -9363,7 +9380,7 @@ function MCQOption($$anchor, $$props) {
|
|
|
9363
9380
|
var node_9 = sibling(node_8, 2);
|
|
9364
9381
|
{
|
|
9365
9382
|
var consequent_8 = ($$anchor2) => {
|
|
9366
|
-
var span_10 = root_8$
|
|
9383
|
+
var span_10 = root_8$4();
|
|
9367
9384
|
var node_10 = child(span_10);
|
|
9368
9385
|
{
|
|
9369
9386
|
var consequent_7 = ($$anchor3) => {
|
|
@@ -9509,7 +9526,7 @@ create_custom_element(
|
|
|
9509
9526
|
[],
|
|
9510
9527
|
true
|
|
9511
9528
|
);
|
|
9512
|
-
var root_2$
|
|
9529
|
+
var root_2$b = /* @__PURE__ */ from_html(`<div class="absolute inset-0 bg-transparent z-50"></div>`);
|
|
9513
9530
|
var root_1$f = /* @__PURE__ */ from_html(`<div><!> <div></div></div>`);
|
|
9514
9531
|
var root_4$3 = /* @__PURE__ */ from_html(`<div class="flex items-center justify-center p-4"><div class="text-gray-500">Loading...</div></div>`);
|
|
9515
9532
|
function MCQInteractionContent($$anchor, $$props) {
|
|
@@ -9569,7 +9586,7 @@ function MCQInteractionContent($$anchor, $$props) {
|
|
|
9569
9586
|
var node_1 = child(div);
|
|
9570
9587
|
{
|
|
9571
9588
|
var consequent = ($$anchor3) => {
|
|
9572
|
-
var div_1 = root_2$
|
|
9589
|
+
var div_1 = root_2$b();
|
|
9573
9590
|
append($$anchor3, div_1);
|
|
9574
9591
|
};
|
|
9575
9592
|
if_block(node_1, ($$render) => {
|
|
@@ -10227,7 +10244,7 @@ function shouldSaveTextAnswer(currentAnswer, latestAnswer, isDataSaving) {
|
|
|
10227
10244
|
return !isDataSaving && hasChanged;
|
|
10228
10245
|
}
|
|
10229
10246
|
var root_1$e = /* @__PURE__ */ from_html(`<label class="inline-txb-lbl absolute left-0 top-0 bottom-0" data-testid="inline-txb-lbl" aria-hidden="true"><span class="absolute inset-0 bg-black opacity-5 rounded-l-lg w-8.5 h-10.5 top-1"></span> <span class="absolute font-semibold text-base leading-[19px] text-charcoal px-3 inline-block pt-[15px]"> </span></label>`);
|
|
10230
|
-
var root_2$
|
|
10247
|
+
var root_2$a = /* @__PURE__ */ from_html(`<span class="w-6 h-6 absolute right-4 top-3.5 flex items-center justify-center" aria-hidden="true"><!></span>`);
|
|
10231
10248
|
var root$c = /* @__PURE__ */ from_html(`<span><!> <input data-testid="input-inline-txb" placeholder="Type your answer here" autocomplete="off"/> <!></span>`);
|
|
10232
10249
|
function TypeInInlineField($$anchor, $$props) {
|
|
10233
10250
|
push($$props, true);
|
|
@@ -10353,7 +10370,7 @@ function TypeInInlineField($$anchor, $$props) {
|
|
|
10353
10370
|
var node_1 = sibling(input, 2);
|
|
10354
10371
|
{
|
|
10355
10372
|
var consequent_1 = ($$anchor2) => {
|
|
10356
|
-
var span_2 = root_2$
|
|
10373
|
+
var span_2 = root_2$a();
|
|
10357
10374
|
var node_2 = child(span_2);
|
|
10358
10375
|
{
|
|
10359
10376
|
let $0 = /* @__PURE__ */ user_derived(() => Boolean(isCorrect()));
|
|
@@ -10406,8 +10423,8 @@ create_custom_element(
|
|
|
10406
10423
|
);
|
|
10407
10424
|
var root_1$d = /* @__PURE__ */ from_html(`<p class="p2 text-red-400 mb-3">Student's answer</p>`);
|
|
10408
10425
|
var root_3$8 = /* @__PURE__ */ from_html(`<span class="w-8 h-8 absolute right-2 top-2.5 flex items-center justify-center" aria-hidden="true"><!></span>`);
|
|
10409
|
-
var root_2$
|
|
10410
|
-
var root_5$
|
|
10426
|
+
var root_2$9 = /* @__PURE__ */ from_html(`<div class="relative"><textarea autocomplete="off" rows="3"></textarea> <!></div>`);
|
|
10427
|
+
var root_5$5 = /* @__PURE__ */ from_html(`<span class="w-8 h-8 absolute right-2 top-2.5 flex items-center justify-center" aria-hidden="true"><!></span>`);
|
|
10411
10428
|
var root_4$2 = /* @__PURE__ */ from_html(`<div class="relative"><input autocomplete="off"/> <!></div>`);
|
|
10412
10429
|
var root$b = /* @__PURE__ */ from_html(`<div class="relative"><!> <!></div>`);
|
|
10413
10430
|
function TypeInTextField($$anchor, $$props) {
|
|
@@ -10551,7 +10568,7 @@ function TypeInTextField($$anchor, $$props) {
|
|
|
10551
10568
|
var node_1 = sibling(node, 2);
|
|
10552
10569
|
{
|
|
10553
10570
|
var consequent_2 = ($$anchor2) => {
|
|
10554
|
-
var div_1 = root_2$
|
|
10571
|
+
var div_1 = root_2$9();
|
|
10555
10572
|
var textarea = child(div_1);
|
|
10556
10573
|
remove_textarea_child(textarea);
|
|
10557
10574
|
textarea.__mousedown = handleMouseDown;
|
|
@@ -10611,7 +10628,7 @@ function TypeInTextField($$anchor, $$props) {
|
|
|
10611
10628
|
var node_4 = sibling(input, 2);
|
|
10612
10629
|
{
|
|
10613
10630
|
var consequent_3 = ($$anchor3) => {
|
|
10614
|
-
var span_1 = root_5$
|
|
10631
|
+
var span_1 = root_5$5();
|
|
10615
10632
|
var node_5 = child(span_1);
|
|
10616
10633
|
{
|
|
10617
10634
|
let $0 = /* @__PURE__ */ user_derived(() => isSkipped() ? false : Boolean(isCorrect()));
|
|
@@ -10745,10 +10762,10 @@ const action = (node) => {
|
|
|
10745
10762
|
action.update = n.update;
|
|
10746
10763
|
action.destroy = n.destroy;
|
|
10747
10764
|
var root_1$c = /* @__PURE__ */ from_html(`<label data-testid="qn-number-txt" aria-hidden="true"><span></span> <span> </span></label>`);
|
|
10748
|
-
var root_2$
|
|
10765
|
+
var root_2$8 = /* @__PURE__ */ from_html(`<div role="textbox" aria-readonly="true"><!></div>`);
|
|
10749
10766
|
var root_4$1 = /* @__PURE__ */ from_html(`<div role="textbox" aria-readonly="true" data-testid="ans-sum-corr-txb"><!></div>`);
|
|
10750
|
-
var root_5$
|
|
10751
|
-
var root_6$
|
|
10767
|
+
var root_5$4 = /* @__PURE__ */ from_html(`<textarea rows="1" readonly=""></textarea>`);
|
|
10768
|
+
var root_6$1 = /* @__PURE__ */ from_html(`<span class="w-6 h-6 absolute right-4 top-[calc(50%+0.375rem)] -translate-y-1/2 flex items-center justify-center"><!></span>`);
|
|
10752
10769
|
var root$a = /* @__PURE__ */ from_html(`<div><!> <!> <!></div>`);
|
|
10753
10770
|
function AnswerDisplay($$anchor, $$props) {
|
|
10754
10771
|
push($$props, true);
|
|
@@ -10903,7 +10920,7 @@ function AnswerDisplay($$anchor, $$props) {
|
|
|
10903
10920
|
var node_1 = sibling(node, 2);
|
|
10904
10921
|
{
|
|
10905
10922
|
var consequent_1 = ($$anchor2) => {
|
|
10906
|
-
var div_1 = root_2$
|
|
10923
|
+
var div_1 = root_2$8();
|
|
10907
10924
|
var node_2 = child(div_1);
|
|
10908
10925
|
CommonStringToHtml(node_2, {
|
|
10909
10926
|
get htmlString() {
|
|
@@ -10951,7 +10968,7 @@ function AnswerDisplay($$anchor, $$props) {
|
|
|
10951
10968
|
append($$anchor3, div_2);
|
|
10952
10969
|
};
|
|
10953
10970
|
var alternate = ($$anchor3) => {
|
|
10954
|
-
var textarea = root_5$
|
|
10971
|
+
var textarea = root_5$4();
|
|
10955
10972
|
remove_textarea_child(textarea);
|
|
10956
10973
|
action$1(textarea, ($$node) => action?.($$node));
|
|
10957
10974
|
template_effect(() => {
|
|
@@ -10983,7 +11000,7 @@ function AnswerDisplay($$anchor, $$props) {
|
|
|
10983
11000
|
var node_5 = sibling(node_1, 2);
|
|
10984
11001
|
{
|
|
10985
11002
|
var consequent_3 = ($$anchor2) => {
|
|
10986
|
-
var span_2 = root_6$
|
|
11003
|
+
var span_2 = root_6$1();
|
|
10987
11004
|
var node_6 = child(span_2);
|
|
10988
11005
|
{
|
|
10989
11006
|
let $0 = /* @__PURE__ */ user_derived(() => isCorrect() ? "text-green-900" : "text-red-900");
|
|
@@ -11264,7 +11281,7 @@ create_custom_element(
|
|
|
11264
11281
|
true
|
|
11265
11282
|
);
|
|
11266
11283
|
var root_1$a = /* @__PURE__ */ from_html(`<div aria-hidden="true" class="flex items-center text-charcoal mt-2" data-testid="info-alt-ans-txt"><!> <span class="p3">There is more than one possible correct answer for this question.</span></div>`);
|
|
11267
|
-
var root_2$
|
|
11284
|
+
var root_2$7 = /* @__PURE__ */ from_html(`<div class="mt-4"><!></div>`);
|
|
11268
11285
|
var root$8 = /* @__PURE__ */ from_html(`<!> <!> <!>`, 1);
|
|
11269
11286
|
function TypeInFeedback($$anchor, $$props) {
|
|
11270
11287
|
push($$props, true);
|
|
@@ -11375,7 +11392,7 @@ function TypeInFeedback($$anchor, $$props) {
|
|
|
11375
11392
|
var node_2 = sibling(node, 2);
|
|
11376
11393
|
{
|
|
11377
11394
|
var consequent_1 = ($$anchor2) => {
|
|
11378
|
-
var div_1 = root_2$
|
|
11395
|
+
var div_1 = root_2$7();
|
|
11379
11396
|
var node_3 = child(div_1);
|
|
11380
11397
|
{
|
|
11381
11398
|
let $0 = /* @__PURE__ */ user_derived(() => feedbackState().isResultCorrect ? "correct" : feedbackState().isSkipped ? "skipped" : "incorrect");
|
|
@@ -11451,12 +11468,12 @@ create_custom_element(
|
|
|
11451
11468
|
true
|
|
11452
11469
|
);
|
|
11453
11470
|
var root_3$7 = /* @__PURE__ */ from_html(`<p></p>`);
|
|
11454
|
-
var root_8$
|
|
11455
|
-
var root_2$
|
|
11471
|
+
var root_8$3 = /* @__PURE__ */ from_html(`<div class="absolute inset-0 bg-transparent z-50"></div>`);
|
|
11472
|
+
var root_2$6 = /* @__PURE__ */ from_html(`<div class="inline-typein-container mt-6 relative"><!> <div class="divider my-6"></div> <!></div>`);
|
|
11456
11473
|
var root_10$2 = /* @__PURE__ */ from_html(`<div class="mb-4"><!></div>`);
|
|
11457
11474
|
var root_13$1 = /* @__PURE__ */ from_html(`<div role="textbox" tabindex="0" aria-readonly="true" aria-labelledby="missing-answer-label" class="typein-textbox typein-textbox-missing border-2 border-green-700 py-[9px] px-4"><!></div>`);
|
|
11458
11475
|
var root_12$2 = /* @__PURE__ */ from_html(`<div class="mt-6"><p id="missing-answer-label" class="p2 text-green-750 mb-3">Missing answer</p> <!></div>`);
|
|
11459
|
-
var root_9$
|
|
11476
|
+
var root_9$3 = /* @__PURE__ */ from_html(`<!> <!> <span class="sr-only" aria-live="polite" aria-atomic="true"> </span> <!>`, 1);
|
|
11460
11477
|
function TypeInComponent($$anchor, $$props) {
|
|
11461
11478
|
push($$props, true);
|
|
11462
11479
|
let api = prop($$props, "api", 7), config = prop($$props, "config", 7), isDataSaving = prop($$props, "isDataSaving", 7, false), onstateChange = prop($$props, "onstateChange", 7);
|
|
@@ -11691,7 +11708,7 @@ function TypeInComponent($$anchor, $$props) {
|
|
|
11691
11708
|
var node = first_child(fragment_1);
|
|
11692
11709
|
{
|
|
11693
11710
|
var consequent_3 = ($$anchor3) => {
|
|
11694
|
-
var div = root_2$
|
|
11711
|
+
var div = root_2$6();
|
|
11695
11712
|
var node_1 = child(div);
|
|
11696
11713
|
each(node_1, 17, () => segments, index, ($$anchor4, segment) => {
|
|
11697
11714
|
var p_1 = root_3$7();
|
|
@@ -11765,7 +11782,7 @@ function TypeInComponent($$anchor, $$props) {
|
|
|
11765
11782
|
var node_5 = sibling(node_1, 4);
|
|
11766
11783
|
{
|
|
11767
11784
|
var consequent_2 = ($$anchor4) => {
|
|
11768
|
-
var div_1 = root_8$
|
|
11785
|
+
var div_1 = root_8$3();
|
|
11769
11786
|
append($$anchor4, div_1);
|
|
11770
11787
|
};
|
|
11771
11788
|
if_block(node_5, ($$render) => {
|
|
@@ -11777,7 +11794,7 @@ function TypeInComponent($$anchor, $$props) {
|
|
|
11777
11794
|
append($$anchor3, div);
|
|
11778
11795
|
};
|
|
11779
11796
|
var alternate_2 = ($$anchor3) => {
|
|
11780
|
-
var fragment_6 = root_9$
|
|
11797
|
+
var fragment_6 = root_9$3();
|
|
11781
11798
|
var node_6 = first_child(fragment_6);
|
|
11782
11799
|
{
|
|
11783
11800
|
var consequent_4 = ($$anchor4) => {
|
|
@@ -14465,15 +14482,16 @@ function isInt(value) {
|
|
|
14465
14482
|
return (x | 0) === x;
|
|
14466
14483
|
})(parseFloat(value));
|
|
14467
14484
|
}
|
|
14468
|
-
var root_1$9 = /* @__PURE__ */ from_html(`<span class="
|
|
14469
|
-
var
|
|
14470
|
-
var
|
|
14471
|
-
var
|
|
14472
|
-
var
|
|
14485
|
+
var root_1$9 = /* @__PURE__ */ from_html(`<span class="sr-only"> </span>`);
|
|
14486
|
+
var root_2$5 = /* @__PURE__ */ from_html(`<span class="sr-only"> </span>`);
|
|
14487
|
+
var root_3$6 = /* @__PURE__ */ from_html(`<span class="text-green-800 preview-icon"><!></span>`);
|
|
14488
|
+
var root_5$3 = /* @__PURE__ */ from_html(`<span class="text-red-800 preview-icon"><!></span>`);
|
|
14489
|
+
var root_7$3 = /* @__PURE__ */ from_html(`<span class="text-green-800"><!></span>`);
|
|
14490
|
+
var root_9$2 = /* @__PURE__ */ from_html(`<span class="preview-vertical hidden"><!></span>`);
|
|
14491
|
+
var root$7 = /* @__PURE__ */ from_html(`<button data-item-button=""><!> <span><!></span> <!> <div><span></span> <span class="absolute"><!> <!></span></div></button>`);
|
|
14473
14492
|
function CategoriseItem($$anchor, $$props) {
|
|
14474
14493
|
push($$props, true);
|
|
14475
14494
|
let itemId = prop($$props, "itemId", 7), itemText = prop($$props, "itemText", 7), containerId = prop($$props, "containerId", 7), mode = prop($$props, "mode", 7), selectedItemId = prop($$props, "selectedItemId", 7, void 0), isLocked = prop($$props, "isLocked", 7, false), isCollapsed = prop($$props, "isCollapsed", 7, false), resultType = prop($$props, "resultType", 7, ""), isCurrentMobileItem = prop($$props, "isCurrentMobileItem", 7, true), isClonedItem = prop($$props, "isClonedItem", 7, false), isConsideredItem = prop($$props, "isConsideredItem", 7, false), activeContainerForKeyboard = prop($$props, "activeContainerForKeyboard", 7, void 0), onclick = prop($$props, "onclick", 7), onfocus = prop($$props, "onfocus", 7), onblur = prop($$props, "onblur", 7), onkeydown = prop($$props, "onkeydown", 7);
|
|
14476
|
-
const ariaWord = useRemoveRichTextHtmlTags(itemText());
|
|
14477
14495
|
const isWordBin = containerId() === CATEGORISE.CONTAINER_WORD_BIN_ID;
|
|
14478
14496
|
let touchStartX = /* @__PURE__ */ state(0);
|
|
14479
14497
|
let touchStartY = /* @__PURE__ */ state(0);
|
|
@@ -14483,18 +14501,27 @@ function CategoriseItem($$anchor, $$props) {
|
|
|
14483
14501
|
const isSelected = /* @__PURE__ */ user_derived(() => selectedItemId() === get$1(cleanItemId));
|
|
14484
14502
|
const hasAnyItemSelected = /* @__PURE__ */ user_derived(() => !!selectedItemId());
|
|
14485
14503
|
const canInteract = /* @__PURE__ */ user_derived(() => !isLocked() && (!resultType() || mode() === MODES.INTERACTIVE));
|
|
14486
|
-
const
|
|
14504
|
+
const ariaPrefix = /* @__PURE__ */ user_derived(() => {
|
|
14487
14505
|
if (resultType() === ANSWER_RESULTS.INCORRECT && isWordBin && !get$1(isSelected)) {
|
|
14488
|
-
return
|
|
14506
|
+
return "Skipped answer:";
|
|
14489
14507
|
}
|
|
14490
14508
|
if ((resultType() === ANSWER_RESULTS.CORRECT || resultType() === ANSWER_RESULTS.INCORRECT) && !get$1(isSelected)) {
|
|
14491
|
-
return
|
|
14509
|
+
return "Student's answer:";
|
|
14492
14510
|
}
|
|
14493
14511
|
if (resultType() === ANSWER_RESULTS.MISSED) {
|
|
14494
|
-
return
|
|
14512
|
+
return "Missing answer:";
|
|
14513
|
+
}
|
|
14514
|
+
return `${get$1(isSelected) ? "Selected option" : "Option"}:`;
|
|
14515
|
+
});
|
|
14516
|
+
const ariaSuffix = /* @__PURE__ */ user_derived(() => {
|
|
14517
|
+
if ((resultType() === ANSWER_RESULTS.CORRECT || resultType() === ANSWER_RESULTS.INCORRECT) && !get$1(isSelected)) {
|
|
14518
|
+
return `(${resultType()})`;
|
|
14495
14519
|
}
|
|
14496
|
-
return
|
|
14520
|
+
return "";
|
|
14497
14521
|
});
|
|
14522
|
+
const itemHasMath = /* @__PURE__ */ user_derived(() => hasMathJax(itemText()));
|
|
14523
|
+
const cleanItemText = /* @__PURE__ */ user_derived(() => useRemoveRichTextHtmlTags(itemText()));
|
|
14524
|
+
const itemAriaLabel = /* @__PURE__ */ user_derived(() => !get$1(itemHasMath) ? [get$1(ariaPrefix), get$1(cleanItemText), get$1(ariaSuffix)].filter(Boolean).join(" ") : void 0);
|
|
14498
14525
|
const handleFocus = (event2) => {
|
|
14499
14526
|
set(lastFocusTime, Date.now(), true);
|
|
14500
14527
|
if (onfocus()) {
|
|
@@ -14561,7 +14588,7 @@ function CategoriseItem($$anchor, $$props) {
|
|
|
14561
14588
|
}
|
|
14562
14589
|
}
|
|
14563
14590
|
};
|
|
14564
|
-
const itemTabIndex = /* @__PURE__ */ user_derived(() =>
|
|
14591
|
+
const itemTabIndex = /* @__PURE__ */ user_derived(() => {
|
|
14565
14592
|
if (get$1(isSelected)) return 0;
|
|
14566
14593
|
if (isCollapsed()) return -1;
|
|
14567
14594
|
if (get$1(hasAnyItemSelected)) return -1;
|
|
@@ -14569,7 +14596,7 @@ function CategoriseItem($$anchor, $$props) {
|
|
|
14569
14596
|
if (isWordBin && isCurrentMobileItem()) return 0;
|
|
14570
14597
|
return -1;
|
|
14571
14598
|
});
|
|
14572
|
-
const buttonClasses = /* @__PURE__ */ user_derived(() =>
|
|
14599
|
+
const buttonClasses = /* @__PURE__ */ user_derived(() => {
|
|
14573
14600
|
const classes = [
|
|
14574
14601
|
"focus-ring",
|
|
14575
14602
|
"flex",
|
|
@@ -14614,24 +14641,24 @@ function CategoriseItem($$anchor, $$props) {
|
|
|
14614
14641
|
}
|
|
14615
14642
|
return classes.join(" ");
|
|
14616
14643
|
});
|
|
14617
|
-
const textClasses = /* @__PURE__ */ user_derived(() =>
|
|
14644
|
+
const textClasses = /* @__PURE__ */ user_derived(() => {
|
|
14618
14645
|
return `text-charcoal text-base pl-3 mr-4 ${get$1(isSelected) ? "text-white" : ""}`;
|
|
14619
14646
|
});
|
|
14620
|
-
const iconContainerClasses = /* @__PURE__ */ user_derived(() =>
|
|
14647
|
+
const iconContainerClasses = /* @__PURE__ */ user_derived(() => {
|
|
14621
14648
|
const base = "group text-blue-1000 h-11 w-11 min-w-[44px] flex items-center justify-center btn-vertical-icon";
|
|
14622
14649
|
if (!get$1(hasAnyItemSelected) && get$1(canInteract) && !get$1(isSelected)) {
|
|
14623
14650
|
return `${base} td:hover:cursor-grab td:hover:text-soft-blue`;
|
|
14624
14651
|
}
|
|
14625
14652
|
return base;
|
|
14626
14653
|
});
|
|
14627
|
-
const iconBgClasses = /* @__PURE__ */ user_derived(() =>
|
|
14654
|
+
const iconBgClasses = /* @__PURE__ */ user_derived(() => {
|
|
14628
14655
|
const base = "w-full h-full relative rounded-lg";
|
|
14629
14656
|
if (!get$1(hasAnyItemSelected) && get$1(canInteract) && !get$1(isSelected)) {
|
|
14630
14657
|
return `${base} td:group-hover:bg-black td:group-hover:opacity-5`;
|
|
14631
14658
|
}
|
|
14632
14659
|
return base;
|
|
14633
14660
|
});
|
|
14634
|
-
const getItemTestId = /* @__PURE__ */ user_derived(() =>
|
|
14661
|
+
const getItemTestId = /* @__PURE__ */ user_derived(() => {
|
|
14635
14662
|
if (mode() === MODES.SESSION || mode() === MODES.INTERACTIVE) {
|
|
14636
14663
|
if (resultType() === ANSWER_RESULTS.INCORRECT && isWordBin && !get$1(isSelected)) {
|
|
14637
14664
|
return "cat-skip-ans-btn";
|
|
@@ -14767,60 +14794,92 @@ function CategoriseItem($$anchor, $$props) {
|
|
|
14767
14794
|
button.__touchmove = handleTouchMove;
|
|
14768
14795
|
button.__touchend = handleTouchEnd;
|
|
14769
14796
|
button.__keydown = handleKeyDown;
|
|
14770
|
-
var
|
|
14771
|
-
var node = child(span);
|
|
14772
|
-
CommonStringToHtml(node, {
|
|
14773
|
-
get htmlString() {
|
|
14774
|
-
return itemText();
|
|
14775
|
-
},
|
|
14776
|
-
otherClass: "inline-block w-full"
|
|
14777
|
-
});
|
|
14778
|
-
reset(span);
|
|
14779
|
-
var div = sibling(span, 2);
|
|
14780
|
-
var span_1 = child(div);
|
|
14781
|
-
var span_2 = sibling(span_1, 2);
|
|
14782
|
-
var node_1 = child(span_2);
|
|
14797
|
+
var node = child(button);
|
|
14783
14798
|
{
|
|
14784
14799
|
var consequent = ($$anchor2) => {
|
|
14785
|
-
var
|
|
14786
|
-
var
|
|
14787
|
-
|
|
14800
|
+
var span = root_1$9();
|
|
14801
|
+
var text2 = child(span, true);
|
|
14802
|
+
reset(span);
|
|
14803
|
+
template_effect(() => set_text(text2, get$1(ariaPrefix)));
|
|
14804
|
+
append($$anchor2, span);
|
|
14805
|
+
};
|
|
14806
|
+
if_block(node, ($$render) => {
|
|
14807
|
+
if (get$1(itemHasMath)) $$render(consequent);
|
|
14808
|
+
});
|
|
14809
|
+
}
|
|
14810
|
+
var span_1 = sibling(node, 2);
|
|
14811
|
+
var node_1 = child(span_1);
|
|
14812
|
+
{
|
|
14813
|
+
let $0 = /* @__PURE__ */ user_derived(() => !get$1(itemHasMath));
|
|
14814
|
+
CommonStringToHtml(node_1, {
|
|
14815
|
+
get htmlString() {
|
|
14816
|
+
return itemText();
|
|
14817
|
+
},
|
|
14818
|
+
otherClass: "inline-block w-full",
|
|
14819
|
+
get ariaHidden() {
|
|
14820
|
+
return get$1($0);
|
|
14821
|
+
}
|
|
14822
|
+
});
|
|
14823
|
+
}
|
|
14824
|
+
reset(span_1);
|
|
14825
|
+
var node_2 = sibling(span_1, 2);
|
|
14826
|
+
{
|
|
14827
|
+
var consequent_1 = ($$anchor2) => {
|
|
14828
|
+
var span_2 = root_2$5();
|
|
14829
|
+
var text_1 = child(span_2, true);
|
|
14830
|
+
reset(span_2);
|
|
14831
|
+
template_effect(() => set_text(text_1, get$1(ariaSuffix)));
|
|
14832
|
+
append($$anchor2, span_2);
|
|
14833
|
+
};
|
|
14834
|
+
if_block(node_2, ($$render) => {
|
|
14835
|
+
if (get$1(itemHasMath) && get$1(ariaSuffix)) $$render(consequent_1);
|
|
14836
|
+
});
|
|
14837
|
+
}
|
|
14838
|
+
var div = sibling(node_2, 2);
|
|
14839
|
+
var span_3 = child(div);
|
|
14840
|
+
var span_4 = sibling(span_3, 2);
|
|
14841
|
+
var node_3 = child(span_4);
|
|
14842
|
+
{
|
|
14843
|
+
var consequent_2 = ($$anchor2) => {
|
|
14844
|
+
var span_5 = root_3$6();
|
|
14845
|
+
var node_4 = child(span_5);
|
|
14846
|
+
SvgLoader(node_4, {
|
|
14788
14847
|
svgName: "successSolid",
|
|
14789
14848
|
className: "correct-icon",
|
|
14790
14849
|
dataTestId: "icon-correct"
|
|
14791
14850
|
});
|
|
14792
|
-
reset(
|
|
14793
|
-
append($$anchor2,
|
|
14851
|
+
reset(span_5);
|
|
14852
|
+
append($$anchor2, span_5);
|
|
14794
14853
|
};
|
|
14795
14854
|
var alternate_2 = ($$anchor2) => {
|
|
14796
14855
|
var fragment = comment();
|
|
14797
|
-
var
|
|
14856
|
+
var node_5 = first_child(fragment);
|
|
14798
14857
|
{
|
|
14799
|
-
var
|
|
14800
|
-
var
|
|
14801
|
-
var
|
|
14802
|
-
SvgLoader(
|
|
14858
|
+
var consequent_3 = ($$anchor3) => {
|
|
14859
|
+
var span_6 = root_5$3();
|
|
14860
|
+
var node_6 = child(span_6);
|
|
14861
|
+
SvgLoader(node_6, {
|
|
14803
14862
|
svgName: "errorSolid",
|
|
14804
14863
|
className: "incorrect-icon",
|
|
14805
14864
|
dataTestId: "icon-incorrect"
|
|
14806
14865
|
});
|
|
14807
|
-
reset(
|
|
14808
|
-
append($$anchor3,
|
|
14866
|
+
reset(span_6);
|
|
14867
|
+
append($$anchor3, span_6);
|
|
14809
14868
|
};
|
|
14810
14869
|
var alternate_1 = ($$anchor3) => {
|
|
14811
14870
|
var fragment_1 = comment();
|
|
14812
|
-
var
|
|
14871
|
+
var node_7 = first_child(fragment_1);
|
|
14813
14872
|
{
|
|
14814
|
-
var
|
|
14815
|
-
var
|
|
14816
|
-
var
|
|
14817
|
-
SvgLoader(
|
|
14873
|
+
var consequent_4 = ($$anchor4) => {
|
|
14874
|
+
var span_7 = root_7$3();
|
|
14875
|
+
var node_8 = child(span_7);
|
|
14876
|
+
SvgLoader(node_8, {
|
|
14818
14877
|
svgName: "success",
|
|
14819
14878
|
className: "missing-correct-icon",
|
|
14820
14879
|
dataTestId: "icon-miss-corr"
|
|
14821
14880
|
});
|
|
14822
|
-
reset(
|
|
14823
|
-
append($$anchor4,
|
|
14881
|
+
reset(span_7);
|
|
14882
|
+
append($$anchor4, span_7);
|
|
14824
14883
|
};
|
|
14825
14884
|
var alternate = ($$anchor4) => {
|
|
14826
14885
|
SvgLoader($$anchor4, {
|
|
@@ -14830,9 +14889,9 @@ function CategoriseItem($$anchor, $$props) {
|
|
|
14830
14889
|
});
|
|
14831
14890
|
};
|
|
14832
14891
|
if_block(
|
|
14833
|
-
|
|
14892
|
+
node_7,
|
|
14834
14893
|
($$render) => {
|
|
14835
|
-
if (resultType() === ANSWER_RESULTS.MISSED) $$render(
|
|
14894
|
+
if (resultType() === ANSWER_RESULTS.MISSED) $$render(consequent_4);
|
|
14836
14895
|
else $$render(alternate, false);
|
|
14837
14896
|
},
|
|
14838
14897
|
true
|
|
@@ -14841,9 +14900,9 @@ function CategoriseItem($$anchor, $$props) {
|
|
|
14841
14900
|
append($$anchor3, fragment_1);
|
|
14842
14901
|
};
|
|
14843
14902
|
if_block(
|
|
14844
|
-
|
|
14903
|
+
node_5,
|
|
14845
14904
|
($$render) => {
|
|
14846
|
-
if (resultType() === ANSWER_RESULTS.INCORRECT && !get$1(isSelected)) $$render(
|
|
14905
|
+
if (resultType() === ANSWER_RESULTS.INCORRECT && !get$1(isSelected)) $$render(consequent_3);
|
|
14847
14906
|
else $$render(alternate_1, false);
|
|
14848
14907
|
},
|
|
14849
14908
|
true
|
|
@@ -14851,53 +14910,42 @@ function CategoriseItem($$anchor, $$props) {
|
|
|
14851
14910
|
}
|
|
14852
14911
|
append($$anchor2, fragment);
|
|
14853
14912
|
};
|
|
14854
|
-
if_block(
|
|
14855
|
-
if (resultType() === ANSWER_RESULTS.CORRECT && !get$1(isSelected)) $$render(
|
|
14913
|
+
if_block(node_3, ($$render) => {
|
|
14914
|
+
if (resultType() === ANSWER_RESULTS.CORRECT && !get$1(isSelected)) $$render(consequent_2);
|
|
14856
14915
|
else $$render(alternate_2, false);
|
|
14857
14916
|
});
|
|
14858
14917
|
}
|
|
14859
|
-
var
|
|
14918
|
+
var node_9 = sibling(node_3, 2);
|
|
14860
14919
|
{
|
|
14861
|
-
var
|
|
14862
|
-
var
|
|
14863
|
-
var
|
|
14864
|
-
SvgLoader(
|
|
14920
|
+
var consequent_5 = ($$anchor2) => {
|
|
14921
|
+
var span_8 = root_9$2();
|
|
14922
|
+
var node_10 = child(span_8);
|
|
14923
|
+
SvgLoader(node_10, {
|
|
14865
14924
|
svgName: "gripVertical",
|
|
14866
14925
|
className: "grip-icon",
|
|
14867
14926
|
dataTestId: "icon-grip"
|
|
14868
14927
|
});
|
|
14869
|
-
reset(
|
|
14870
|
-
append($$anchor2,
|
|
14928
|
+
reset(span_8);
|
|
14929
|
+
append($$anchor2, span_8);
|
|
14871
14930
|
};
|
|
14872
|
-
if_block(
|
|
14873
|
-
if (resultType() === ANSWER_RESULTS.CORRECT || resultType() === ANSWER_RESULTS.INCORRECT) $$render(
|
|
14931
|
+
if_block(node_9, ($$render) => {
|
|
14932
|
+
if (resultType() === ANSWER_RESULTS.CORRECT || resultType() === ANSWER_RESULTS.INCORRECT) $$render(consequent_5);
|
|
14874
14933
|
});
|
|
14875
14934
|
}
|
|
14876
|
-
reset(
|
|
14935
|
+
reset(span_4);
|
|
14877
14936
|
reset(div);
|
|
14878
14937
|
reset(button);
|
|
14879
|
-
template_effect(
|
|
14880
|
-
(
|
|
14881
|
-
|
|
14882
|
-
|
|
14883
|
-
|
|
14884
|
-
|
|
14885
|
-
|
|
14886
|
-
|
|
14887
|
-
|
|
14888
|
-
|
|
14889
|
-
|
|
14890
|
-
},
|
|
14891
|
-
[
|
|
14892
|
-
() => get$1(ariaLabel)(),
|
|
14893
|
-
() => clsx(get$1(buttonClasses)()),
|
|
14894
|
-
() => get$1(getItemTestId)(),
|
|
14895
|
-
() => get$1(itemTabIndex)(),
|
|
14896
|
-
() => clsx(get$1(textClasses)()),
|
|
14897
|
-
() => clsx(get$1(iconContainerClasses)()),
|
|
14898
|
-
() => clsx(get$1(iconBgClasses)())
|
|
14899
|
-
]
|
|
14900
|
-
);
|
|
14938
|
+
template_effect(() => {
|
|
14939
|
+
set_attribute(button, "id", itemId());
|
|
14940
|
+
set_class(button, 1, clsx(get$1(buttonClasses)));
|
|
14941
|
+
set_attribute(button, "data-testid", get$1(getItemTestId));
|
|
14942
|
+
set_attribute(button, "tabindex", get$1(itemTabIndex));
|
|
14943
|
+
button.disabled = isLocked() && !resultType();
|
|
14944
|
+
set_attribute(button, "aria-label", get$1(itemAriaLabel));
|
|
14945
|
+
set_class(span_1, 1, clsx(get$1(textClasses)));
|
|
14946
|
+
set_class(div, 1, clsx(get$1(iconContainerClasses)));
|
|
14947
|
+
set_class(span_3, 1, clsx(get$1(iconBgClasses)));
|
|
14948
|
+
});
|
|
14901
14949
|
event("focus", button, handleFocus);
|
|
14902
14950
|
event("blur", button, handleBlur);
|
|
14903
14951
|
append($$anchor, button);
|
|
@@ -14928,13 +14976,14 @@ create_custom_element(
|
|
|
14928
14976
|
[],
|
|
14929
14977
|
true
|
|
14930
14978
|
);
|
|
14931
|
-
var
|
|
14932
|
-
var
|
|
14933
|
-
var
|
|
14979
|
+
var root_2$4 = /* @__PURE__ */ from_html(`<span class="sr-only"> </span> <!>`, 1);
|
|
14980
|
+
var root_1$8 = /* @__PURE__ */ from_html(`<button tabindex="0"><!></button>`);
|
|
14981
|
+
var root_8$2 = /* @__PURE__ */ from_html(`<div class="w-full text-base text-charcoal font-semibold mt-1 mb-2">Missing answers:</div>`);
|
|
14982
|
+
var root_7$2 = /* @__PURE__ */ from_html(`<!> <!>`, 1);
|
|
14934
14983
|
var root$6 = /* @__PURE__ */ from_html(`<!> <section><!></section>`, 1);
|
|
14935
14984
|
function CategoriseDndContainer($$anchor, $$props) {
|
|
14936
14985
|
push($$props, true);
|
|
14937
|
-
let containerId = prop($$props, "containerId", 7), containerLabel = prop($$props, "containerLabel", 7, ""), containerClass = prop($$props, "containerClass", 7, ""), showButton = prop($$props, "showButton", 7, true), items = prop($$props, "items", 23, () => []), selectedItemId = prop($$props, "selectedItemId", 7, void 0), isLocked = prop($$props, "isLocked", 7, false), isMobile = prop($$props, "isMobile", 7, false), mode = prop($$props, "mode", 7), paddingTop = prop($$props, "paddingTop", 7, 0), dndType = prop($$props, "dndType", 7, "categorise"), activeContainerForKeyboard = prop($$props, "activeContainerForKeyboard", 7, void 0), isCollapsed = prop($$props, "isCollapsed", 7, false), onitemdrop = prop($$props, "onitemdrop", 7), onitemselect = prop($$props, "onitemselect", 7), oncontainerclick = prop($$props, "oncontainerclick", 7), onitemfocus = prop($$props, "onitemfocus", 7), onitemblur = prop($$props, "onitemblur", 7), onitemkeydown = prop($$props, "onitemkeydown", 7), ondraghover = prop($$props, "ondraghover", 7), ondragstart = prop($$props, "ondragstart", 7), children = prop($$props, "children", 7);
|
|
14986
|
+
let containerId = prop($$props, "containerId", 7), containerLabel = prop($$props, "containerLabel", 7, ""), containerLabelHtml = prop($$props, "containerLabelHtml", 7, ""), containerHasMath = prop($$props, "containerHasMath", 7, false), containerIndex = prop($$props, "containerIndex", 7, 0), containerClass = prop($$props, "containerClass", 7, ""), showButton = prop($$props, "showButton", 7, true), items = prop($$props, "items", 23, () => []), selectedItemId = prop($$props, "selectedItemId", 7, void 0), isLocked = prop($$props, "isLocked", 7, false), isMobile = prop($$props, "isMobile", 7, false), mode = prop($$props, "mode", 7), paddingTop = prop($$props, "paddingTop", 7, 0), dndType = prop($$props, "dndType", 7, "categorise"), activeContainerForKeyboard = prop($$props, "activeContainerForKeyboard", 7, void 0), isCollapsed = prop($$props, "isCollapsed", 7, false), onitemdrop = prop($$props, "onitemdrop", 7), onitemselect = prop($$props, "onitemselect", 7), oncontainerclick = prop($$props, "oncontainerclick", 7), onitemfocus = prop($$props, "onitemfocus", 7), onitemblur = prop($$props, "onitemblur", 7), onitemkeydown = prop($$props, "onitemkeydown", 7), ondraghover = prop($$props, "ondraghover", 7), ondragstart = prop($$props, "ondragstart", 7), children = prop($$props, "children", 7);
|
|
14938
14987
|
let considerItemId = /* @__PURE__ */ state(void 0);
|
|
14939
14988
|
let isHoveringDrag = /* @__PURE__ */ state(false);
|
|
14940
14989
|
let dragCounter = /* @__PURE__ */ state(0);
|
|
@@ -15081,6 +15130,27 @@ function CategoriseDndContainer($$anchor, $$props) {
|
|
|
15081
15130
|
containerLabel($$value);
|
|
15082
15131
|
flushSync();
|
|
15083
15132
|
},
|
|
15133
|
+
get containerLabelHtml() {
|
|
15134
|
+
return containerLabelHtml();
|
|
15135
|
+
},
|
|
15136
|
+
set containerLabelHtml($$value = "") {
|
|
15137
|
+
containerLabelHtml($$value);
|
|
15138
|
+
flushSync();
|
|
15139
|
+
},
|
|
15140
|
+
get containerHasMath() {
|
|
15141
|
+
return containerHasMath();
|
|
15142
|
+
},
|
|
15143
|
+
set containerHasMath($$value = false) {
|
|
15144
|
+
containerHasMath($$value);
|
|
15145
|
+
flushSync();
|
|
15146
|
+
},
|
|
15147
|
+
get containerIndex() {
|
|
15148
|
+
return containerIndex();
|
|
15149
|
+
},
|
|
15150
|
+
set containerIndex($$value = 0) {
|
|
15151
|
+
containerIndex($$value);
|
|
15152
|
+
flushSync();
|
|
15153
|
+
},
|
|
15084
15154
|
get containerClass() {
|
|
15085
15155
|
return containerClass();
|
|
15086
15156
|
},
|
|
@@ -15225,17 +15295,39 @@ function CategoriseDndContainer($$anchor, $$props) {
|
|
|
15225
15295
|
var fragment = root$6();
|
|
15226
15296
|
var node = first_child(fragment);
|
|
15227
15297
|
{
|
|
15228
|
-
var
|
|
15298
|
+
var consequent_1 = ($$anchor2) => {
|
|
15229
15299
|
var button = root_1$8();
|
|
15230
15300
|
button.__click = handleContainerClick;
|
|
15301
|
+
var node_1 = child(button);
|
|
15302
|
+
{
|
|
15303
|
+
var consequent = ($$anchor3) => {
|
|
15304
|
+
var fragment_1 = root_2$4();
|
|
15305
|
+
var span = first_child(fragment_1);
|
|
15306
|
+
var text2 = child(span);
|
|
15307
|
+
reset(span);
|
|
15308
|
+
var node_2 = sibling(span, 2);
|
|
15309
|
+
CommonStringToHtml(node_2, {
|
|
15310
|
+
get htmlString() {
|
|
15311
|
+
return containerLabelHtml();
|
|
15312
|
+
},
|
|
15313
|
+
otherClass: "sr-only"
|
|
15314
|
+
});
|
|
15315
|
+
template_effect(() => set_text(text2, `Category ${containerIndex() ?? ""}:`));
|
|
15316
|
+
append($$anchor3, fragment_1);
|
|
15317
|
+
};
|
|
15318
|
+
if_block(node_1, ($$render) => {
|
|
15319
|
+
if (containerHasMath()) $$render(consequent);
|
|
15320
|
+
});
|
|
15321
|
+
}
|
|
15322
|
+
reset(button);
|
|
15231
15323
|
template_effect(() => {
|
|
15232
15324
|
set_class(button, 1, `focus-ring absolute inset-0 bg-transparent rounded-lg z-10 pointer-events-auto focus-visible:border ${containerId() === "container-word-bin" ? "focus-visible:border-gray-400" : "focus-visible:border-gray-800"}`);
|
|
15233
|
-
set_attribute(button, "aria-label", containerLabel());
|
|
15325
|
+
set_attribute(button, "aria-label", !containerHasMath() ? containerLabel() : void 0);
|
|
15234
15326
|
});
|
|
15235
15327
|
append($$anchor2, button);
|
|
15236
15328
|
};
|
|
15237
15329
|
if_block(node, ($$render) => {
|
|
15238
|
-
if (!isLocked() && selectedItemId() && !get$1(isSourceContainer)()) $$render(
|
|
15330
|
+
if (!isLocked() && selectedItemId() && !get$1(isSourceContainer)()) $$render(consequent_1);
|
|
15239
15331
|
});
|
|
15240
15332
|
}
|
|
15241
15333
|
var section = sibling(node, 2);
|
|
@@ -15243,50 +15335,50 @@ function CategoriseDndContainer($$anchor, $$props) {
|
|
|
15243
15335
|
section.__touchstart = handleSectionTouchStart;
|
|
15244
15336
|
section.__touchmove = handleSectionTouchMove;
|
|
15245
15337
|
set_attribute(section, "tabindex", -1);
|
|
15246
|
-
var
|
|
15338
|
+
var node_3 = child(section);
|
|
15247
15339
|
{
|
|
15248
|
-
var
|
|
15249
|
-
var
|
|
15250
|
-
var
|
|
15340
|
+
var consequent_3 = ($$anchor2) => {
|
|
15341
|
+
var fragment_2 = comment();
|
|
15342
|
+
var node_4 = first_child(fragment_2);
|
|
15251
15343
|
{
|
|
15252
|
-
var
|
|
15253
|
-
var
|
|
15254
|
-
var
|
|
15255
|
-
snippet(
|
|
15344
|
+
var consequent_2 = ($$anchor3) => {
|
|
15345
|
+
var fragment_3 = comment();
|
|
15346
|
+
var node_5 = first_child(fragment_3);
|
|
15347
|
+
snippet(node_5, children, () => ({ empty: () => {
|
|
15256
15348
|
} }));
|
|
15257
|
-
append($$anchor3,
|
|
15349
|
+
append($$anchor3, fragment_3);
|
|
15258
15350
|
};
|
|
15259
|
-
if_block(
|
|
15260
|
-
if (children()) $$render(
|
|
15351
|
+
if_block(node_4, ($$render) => {
|
|
15352
|
+
if (children()) $$render(consequent_2);
|
|
15261
15353
|
});
|
|
15262
15354
|
}
|
|
15263
|
-
append($$anchor2,
|
|
15355
|
+
append($$anchor2, fragment_2);
|
|
15264
15356
|
};
|
|
15265
15357
|
var alternate = ($$anchor2) => {
|
|
15266
|
-
var
|
|
15267
|
-
var
|
|
15358
|
+
var fragment_4 = comment();
|
|
15359
|
+
var node_6 = first_child(fragment_4);
|
|
15268
15360
|
{
|
|
15269
|
-
var
|
|
15270
|
-
var
|
|
15271
|
-
var
|
|
15272
|
-
each(
|
|
15361
|
+
var consequent_5 = ($$anchor3) => {
|
|
15362
|
+
var fragment_5 = comment();
|
|
15363
|
+
var node_7 = first_child(fragment_5);
|
|
15364
|
+
each(node_7, 19, () => get$1(localItems), (item) => `${item.id}-${get$1(dragCounter)}`, ($$anchor4, item, index2) => {
|
|
15273
15365
|
const itemResultType = /* @__PURE__ */ user_derived(() => getItemResultType(get$1(item).isClonedItem && get$1(item).cloneId ? get$1(item).cloneId : get$1(item).id));
|
|
15274
|
-
var
|
|
15275
|
-
var
|
|
15366
|
+
var fragment_6 = root_7$2();
|
|
15367
|
+
var node_8 = first_child(fragment_6);
|
|
15276
15368
|
{
|
|
15277
|
-
var
|
|
15278
|
-
var div =
|
|
15369
|
+
var consequent_4 = ($$anchor5) => {
|
|
15370
|
+
var div = root_8$2();
|
|
15279
15371
|
append($$anchor5, div);
|
|
15280
15372
|
};
|
|
15281
|
-
if_block(
|
|
15282
|
-
if (get$1(itemResultType) === ANSWER_RESULTS.MISSED && get$1(index2) === get$1(localItems).findIndex((i) => getItemResultType(i.id) === ANSWER_RESULTS.MISSED)) $$render(
|
|
15373
|
+
if_block(node_8, ($$render) => {
|
|
15374
|
+
if (get$1(itemResultType) === ANSWER_RESULTS.MISSED && get$1(index2) === get$1(localItems).findIndex((i) => getItemResultType(i.id) === ANSWER_RESULTS.MISSED)) $$render(consequent_4);
|
|
15283
15375
|
});
|
|
15284
15376
|
}
|
|
15285
|
-
var
|
|
15377
|
+
var node_9 = sibling(node_8, 2);
|
|
15286
15378
|
{
|
|
15287
15379
|
let $0 = /* @__PURE__ */ user_derived(() => get$1(item).itemText || "");
|
|
15288
15380
|
let $1 = /* @__PURE__ */ user_derived(() => get$1(considerItemId) === get$1(item).id);
|
|
15289
|
-
CategoriseItem(
|
|
15381
|
+
CategoriseItem(node_9, {
|
|
15290
15382
|
get itemId() {
|
|
15291
15383
|
return get$1(item).id;
|
|
15292
15384
|
},
|
|
@@ -15329,22 +15421,22 @@ function CategoriseDndContainer($$anchor, $$props) {
|
|
|
15329
15421
|
onkeydown: (e2) => onitemkeydown()?.(e2, get$1(item).id, get$1(index2))
|
|
15330
15422
|
});
|
|
15331
15423
|
}
|
|
15332
|
-
append($$anchor4,
|
|
15424
|
+
append($$anchor4, fragment_6);
|
|
15333
15425
|
});
|
|
15334
|
-
append($$anchor3,
|
|
15426
|
+
append($$anchor3, fragment_5);
|
|
15335
15427
|
};
|
|
15336
15428
|
if_block(
|
|
15337
|
-
|
|
15429
|
+
node_6,
|
|
15338
15430
|
($$render) => {
|
|
15339
|
-
if (showButton()) $$render(
|
|
15431
|
+
if (showButton()) $$render(consequent_5);
|
|
15340
15432
|
},
|
|
15341
15433
|
true
|
|
15342
15434
|
);
|
|
15343
15435
|
}
|
|
15344
|
-
append($$anchor2,
|
|
15436
|
+
append($$anchor2, fragment_4);
|
|
15345
15437
|
};
|
|
15346
|
-
if_block(
|
|
15347
|
-
if (get$1(isEmpty)) $$render(
|
|
15438
|
+
if_block(node_3, ($$render) => {
|
|
15439
|
+
if (get$1(isEmpty)) $$render(consequent_3);
|
|
15348
15440
|
else $$render(alternate, false);
|
|
15349
15441
|
});
|
|
15350
15442
|
}
|
|
@@ -15367,6 +15459,9 @@ create_custom_element(
|
|
|
15367
15459
|
{
|
|
15368
15460
|
containerId: {},
|
|
15369
15461
|
containerLabel: {},
|
|
15462
|
+
containerLabelHtml: {},
|
|
15463
|
+
containerHasMath: {},
|
|
15464
|
+
containerIndex: {},
|
|
15370
15465
|
containerClass: {},
|
|
15371
15466
|
showButton: {},
|
|
15372
15467
|
items: {},
|
|
@@ -15392,10 +15487,12 @@ create_custom_element(
|
|
|
15392
15487
|
[],
|
|
15393
15488
|
true
|
|
15394
15489
|
);
|
|
15395
|
-
var
|
|
15396
|
-
var
|
|
15397
|
-
var
|
|
15398
|
-
var
|
|
15490
|
+
var root_1$7 = /* @__PURE__ */ from_html(`<span class="sr-only"> </span>`);
|
|
15491
|
+
var root_2$3 = /* @__PURE__ */ from_html(`<span class="sr-only"> </span>`);
|
|
15492
|
+
var root_4 = /* @__PURE__ */ from_svg(`<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24" data-testid="icon-chevron-coll"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"></path></svg>`);
|
|
15493
|
+
var root_5$2 = /* @__PURE__ */ from_svg(`<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24" data-testid="icon-chevron-exp"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 15l7-7 7 7"></path></svg>`);
|
|
15494
|
+
var root_3$5 = /* @__PURE__ */ from_html(`<button type="button" class="focus-ring flex items-center rounded-[32px] p-1.5 text-charcoal text-sm border border-gray-800 bg-gray-50 min-w-[85px] ml-3 whitespace-nowrap active:raw-focus-ring active:bg-black-55"><span class="mx-0.5"> </span> <span class="w-4 h-4 text-inherit flex items-center justify-center"><!></span></button>`);
|
|
15495
|
+
var root$5 = /* @__PURE__ */ from_html(`<div role="group" data-testid="cat-ctr"><div><!> <!> <!> <!></div> <!></div>`);
|
|
15399
15496
|
function CategoriseCategory($$anchor, $$props) {
|
|
15400
15497
|
push($$props, true);
|
|
15401
15498
|
let categoryId = prop($$props, "categoryId", 7), categoryTitle = prop($$props, "categoryTitle", 7), categoryIndex = prop($$props, "categoryIndex", 7, 1), items = prop($$props, "items", 23, () => []), selectedItemId = prop($$props, "selectedItemId", 7, void 0), isLocked = prop($$props, "isLocked", 7, false), isCollapsed = prop($$props, "isCollapsed", 7, false), isDraggingOver = prop($$props, "isDraggingOver", 7, false), dropContainerId = prop($$props, "dropContainerId", 7, void 0), hasAddItemAnimation = prop($$props, "hasAddItemAnimation", 7, false), dragSourceContainerId = prop($$props, "dragSourceContainerId", 7, void 0), mode = prop($$props, "mode", 7), isMobile = prop($$props, "isMobile", 7, false), hasStimulus = prop($$props, "hasStimulus", 7, false), dndType = prop($$props, "dndType", 7, "categorise"), tabindex = prop($$props, "tabindex", 7, 0), activeContainerForKeyboard = prop($$props, "activeContainerForKeyboard", 7, void 0), onitemdrop = prop($$props, "onitemdrop", 7), onitemselect = prop($$props, "onitemselect", 7), oncontainerclick = prop($$props, "oncontainerclick", 7), ontogglecollapse = prop($$props, "ontogglecollapse", 7), onitemfocus = prop($$props, "onitemfocus", 7), onitemblur = prop($$props, "onitemblur", 7), onitemkeydown = prop($$props, "onitemkeydown", 7), onkeydown = prop($$props, "onkeydown", 7), ondraghover = prop($$props, "ondraghover", 7), ondragstart = prop($$props, "ondragstart", 7);
|
|
@@ -15426,7 +15523,8 @@ function CategoriseCategory($$anchor, $$props) {
|
|
|
15426
15523
|
${get$1(effectiveIsCollapsed) && isDraggingOver() && get$1(isNotSourceContainer) ? "!bg-violet-100 md:!bg-white" : ""}
|
|
15427
15524
|
${get$1(effectiveIsCollapsed) && isMobile() ? "rounded-b-lg md:rounded-b-none" : ""}`);
|
|
15428
15525
|
const adjustedTabindex = /* @__PURE__ */ user_derived(tabindex);
|
|
15429
|
-
const
|
|
15526
|
+
const categoryHasMath = /* @__PURE__ */ user_derived(() => hasMathJax(categoryTitle()));
|
|
15527
|
+
const shouldShowAriaLabel = /* @__PURE__ */ user_derived(() => !get$1(categoryHasMath) && (!get$1(hasSelectedItem) || !get$1(isNotSourceContainer)));
|
|
15430
15528
|
const handleToggle = () => {
|
|
15431
15529
|
if (isMobile() && ontogglecollapse()) {
|
|
15432
15530
|
ontogglecollapse()(categoryId());
|
|
@@ -15644,59 +15742,87 @@ function CategoriseCategory($$anchor, $$props) {
|
|
|
15644
15742
|
div.__click = handleContainerClick;
|
|
15645
15743
|
var div_1 = child(div);
|
|
15646
15744
|
var node = child(div_1);
|
|
15647
|
-
|
|
15745
|
+
{
|
|
15746
|
+
var consequent = ($$anchor2) => {
|
|
15747
|
+
var span = root_1$7();
|
|
15748
|
+
var text2 = child(span);
|
|
15749
|
+
reset(span);
|
|
15750
|
+
template_effect(() => set_text(text2, `Category ${categoryIndex() ?? ""}:`));
|
|
15751
|
+
append($$anchor2, span);
|
|
15752
|
+
};
|
|
15753
|
+
if_block(node, ($$render) => {
|
|
15754
|
+
if (get$1(categoryHasMath)) $$render(consequent);
|
|
15755
|
+
});
|
|
15756
|
+
}
|
|
15757
|
+
var node_1 = sibling(node, 2);
|
|
15758
|
+
CommonStringToHtml(node_1, {
|
|
15648
15759
|
get htmlString() {
|
|
15649
15760
|
return categoryTitle();
|
|
15650
15761
|
},
|
|
15651
15762
|
otherClass: "text-base leading-5 !text-gray-900 md:item-heading",
|
|
15652
|
-
ariaHidden
|
|
15763
|
+
get ariaHidden() {
|
|
15764
|
+
return get$1(shouldShowAriaLabel);
|
|
15765
|
+
}
|
|
15653
15766
|
});
|
|
15654
|
-
var
|
|
15767
|
+
var node_2 = sibling(node_1, 2);
|
|
15655
15768
|
{
|
|
15656
15769
|
var consequent_1 = ($$anchor2) => {
|
|
15657
|
-
var
|
|
15770
|
+
var span_1 = root_2$3();
|
|
15771
|
+
var text_1 = child(span_1);
|
|
15772
|
+
reset(span_1);
|
|
15773
|
+
template_effect(() => set_text(text_1, `. ${get$1(getTotalWords) ?? ""} added.`));
|
|
15774
|
+
append($$anchor2, span_1);
|
|
15775
|
+
};
|
|
15776
|
+
if_block(node_2, ($$render) => {
|
|
15777
|
+
if (get$1(categoryHasMath)) $$render(consequent_1);
|
|
15778
|
+
});
|
|
15779
|
+
}
|
|
15780
|
+
var node_3 = sibling(node_2, 2);
|
|
15781
|
+
{
|
|
15782
|
+
var consequent_3 = ($$anchor2) => {
|
|
15783
|
+
var button = root_3$5();
|
|
15658
15784
|
button.__click = handleToggle;
|
|
15659
15785
|
button.__keydown = (e2) => {
|
|
15660
15786
|
if (e2.key === "Enter" || e2.key === " ") {
|
|
15661
15787
|
e2.stopPropagation();
|
|
15662
15788
|
}
|
|
15663
15789
|
};
|
|
15664
|
-
var
|
|
15665
|
-
var
|
|
15666
|
-
reset(
|
|
15667
|
-
var
|
|
15668
|
-
var
|
|
15790
|
+
var span_2 = child(button);
|
|
15791
|
+
var text_2 = child(span_2, true);
|
|
15792
|
+
reset(span_2);
|
|
15793
|
+
var span_3 = sibling(span_2, 2);
|
|
15794
|
+
var node_4 = child(span_3);
|
|
15669
15795
|
{
|
|
15670
|
-
var
|
|
15671
|
-
var svg =
|
|
15796
|
+
var consequent_2 = ($$anchor3) => {
|
|
15797
|
+
var svg = root_4();
|
|
15672
15798
|
append($$anchor3, svg);
|
|
15673
15799
|
};
|
|
15674
15800
|
var alternate = ($$anchor3) => {
|
|
15675
|
-
var svg_1 =
|
|
15801
|
+
var svg_1 = root_5$2();
|
|
15676
15802
|
append($$anchor3, svg_1);
|
|
15677
15803
|
};
|
|
15678
|
-
if_block(
|
|
15679
|
-
if (get$1(effectiveIsCollapsed)) $$render(
|
|
15804
|
+
if_block(node_4, ($$render) => {
|
|
15805
|
+
if (get$1(effectiveIsCollapsed)) $$render(consequent_2);
|
|
15680
15806
|
else $$render(alternate, false);
|
|
15681
15807
|
});
|
|
15682
15808
|
}
|
|
15683
|
-
reset(
|
|
15809
|
+
reset(span_3);
|
|
15684
15810
|
reset(button);
|
|
15685
15811
|
template_effect(() => {
|
|
15686
15812
|
set_attribute(button, "aria-label", get$1(getTotalWords));
|
|
15687
15813
|
set_attribute(button, "tabindex", selectedItemId() ? -1 : 0);
|
|
15688
|
-
set_text(
|
|
15814
|
+
set_text(text_2, get$1(getTotalWords));
|
|
15689
15815
|
});
|
|
15690
15816
|
append($$anchor2, button);
|
|
15691
15817
|
};
|
|
15692
|
-
if_block(
|
|
15693
|
-
if (isMobile()) $$render(
|
|
15818
|
+
if_block(node_3, ($$render) => {
|
|
15819
|
+
if (isMobile()) $$render(consequent_3);
|
|
15694
15820
|
});
|
|
15695
15821
|
}
|
|
15696
15822
|
reset(div_1);
|
|
15697
15823
|
bind_this(div_1, ($$value) => set(titleElement, $$value), () => get$1(titleElement));
|
|
15698
|
-
var
|
|
15699
|
-
key(
|
|
15824
|
+
var node_5 = sibling(div_1, 2);
|
|
15825
|
+
key(node_5, () => `${categoryId()}-${get$1(effectiveIsCollapsed)}-${isMobile()}`, ($$anchor2) => {
|
|
15700
15826
|
{
|
|
15701
15827
|
const children = ($$anchor3) => {
|
|
15702
15828
|
};
|
|
@@ -15710,6 +15836,15 @@ function CategoriseCategory($$anchor, $$props) {
|
|
|
15710
15836
|
get containerLabel() {
|
|
15711
15837
|
return get$1($0);
|
|
15712
15838
|
},
|
|
15839
|
+
get containerLabelHtml() {
|
|
15840
|
+
return categoryTitle();
|
|
15841
|
+
},
|
|
15842
|
+
get containerHasMath() {
|
|
15843
|
+
return get$1(categoryHasMath);
|
|
15844
|
+
},
|
|
15845
|
+
get containerIndex() {
|
|
15846
|
+
return categoryIndex();
|
|
15847
|
+
},
|
|
15713
15848
|
get containerClass() {
|
|
15714
15849
|
return get$1(containerClasses);
|
|
15715
15850
|
},
|
|
@@ -15819,7 +15954,7 @@ create_custom_element(
|
|
|
15819
15954
|
);
|
|
15820
15955
|
var root_1$6 = /* @__PURE__ */ from_html(`<div role="group" tabindex="-1" class="text-base leading-4 text-gray-800 p-5 border border-gray-400 rounded-lg border-dashed
|
|
15821
15956
|
absolute top-12 right-4 left-4 bottom-4 flex items-center justify-center !bg-white md:top-20">Word Bin is empty</div>`);
|
|
15822
|
-
var root_2$
|
|
15957
|
+
var root_2$2 = /* @__PURE__ */ from_html(`<button type="button" class="focus-ring p-2 text-blue-1000 rounded-md w-11 h-11 mt-9 td:hover:bg-black-50 active:bg-black-60 disabled:text-gray-40 disabled:hover:bg-white md:hidden" aria-label="Left"><span class="w-6 h-6 text-inherit flex items-center justify-center"><!></span></button>`);
|
|
15823
15958
|
var root_3$4 = /* @__PURE__ */ from_html(`<button type="button" class="focus-ring p-2 text-blue-1000 rounded-md w-11 h-11 mt-9 td:hover:bg-black-50 active:bg-black-60 disabled:text-gray-40 disabled:hover:bg-white md:hidden" aria-label="Right"><span class="w-6 h-6 text-inherit flex items-center justify-center ml-[3px]"><!></span></button>`);
|
|
15824
15959
|
var root$4 = /* @__PURE__ */ from_html(`<div role="group" data-testid="cat-bin-grp"><div><span class="text-base leading-5 !text-gray-900 font-semibold md:mb-2 md:item-heading" aria-hidden="true">Word Bin </span> <span class="text-base leading-5 !text-gray-900 md:item-heading" aria-hidden="true"> </span></div> <div class="flex items-center justify-between px-4 min-h-[133px] md:min-h-0 md:block md:px-0 md:justify-normal"><!> <!> <!> <!></div></div>`);
|
|
15825
15960
|
function CategoriseWordBin($$anchor, $$props) {
|
|
@@ -16106,7 +16241,7 @@ function CategoriseWordBin($$anchor, $$props) {
|
|
|
16106
16241
|
var node_1 = sibling(node, 2);
|
|
16107
16242
|
{
|
|
16108
16243
|
var consequent_1 = ($$anchor2) => {
|
|
16109
|
-
var button = root_2$
|
|
16244
|
+
var button = root_2$2();
|
|
16110
16245
|
button.__click = () => handleNavigate("left");
|
|
16111
16246
|
button.__keydown = (e2) => {
|
|
16112
16247
|
if (e2.key === "Enter" || e2.key === " ") {
|
|
@@ -16383,11 +16518,11 @@ function CategoriseModal($$anchor, $$props) {
|
|
|
16383
16518
|
}
|
|
16384
16519
|
delegate(["click"]);
|
|
16385
16520
|
create_custom_element(CategoriseModal, { isOpen: {}, onclose: {}, onreset: {} }, [], [], true);
|
|
16386
|
-
var
|
|
16521
|
+
var root_2$1 = /* @__PURE__ */ from_html(`<button aria-label="Reset words" class="group focus-ring flex items-center rounded-lg border-2 border-soft-blue
|
|
16387
16522
|
text-blue-1000 px-3 py-2 absolute right-0 -top-2.5 hover:bg-blue-100" data-testid="cat-reset-btn"><span class="h-6 w-6 flex items-center justify-center"><!></span> <span class="text-base leading-4 font-bold ml-1 group-hover:underline">Reset <span class="hidden md:inline-block">words</span></span></button>`);
|
|
16388
16523
|
var root_1$4 = /* @__PURE__ */ from_html(
|
|
16389
16524
|
`<button type="button" aria-label="Skip to Word Bin" class="flex items-center text-charcoal border-l-6 border-charcoal bg-yellow-1000 py-1.5 pr-3 pl-4 focus-visible:border-charcoal
|
|
16390
|
-
left-[-9999px] z-0 focus-within:left-0 focus-within:right-0 focus-within:top-0 absolute focus-within:z-30 focus-visible:outline-none"><span class="test-base font-semibold underline mr-1">Skip to Word Bin</span> <span class="text-inherit h-6 w-6 flex items-center justify-center"><!></span></button> <div class="w-full relative"><div
|
|
16525
|
+
left-[-9999px] z-0 focus-within:left-0 focus-within:right-0 focus-within:top-0 absolute focus-within:z-30 focus-visible:outline-none"><span class="test-base font-semibold underline mr-1">Skip to Word Bin</span> <span class="text-inherit h-6 w-6 flex items-center justify-center"><!></span></button> <div class="w-full relative"><div role="status" class="sr-only" tabindex="-1"> </div> <div class="mt-7.5 mb-6 relative md:text-center md:mb-8 md:mt-14"><p class="text-base leading-5 !text-gray-900 font-semibold md:item-heading">Categories</p> <!></div> <!> <!> <!></div>`,
|
|
16391
16526
|
1
|
|
16392
16527
|
);
|
|
16393
16528
|
function CategoriseComponent($$anchor, $$props) {
|
|
@@ -16406,7 +16541,6 @@ function CategoriseComponent($$anchor, $$props) {
|
|
|
16406
16541
|
let dragHoverContainerId = /* @__PURE__ */ state(null);
|
|
16407
16542
|
let dragSourceContainerId = /* @__PURE__ */ state(null);
|
|
16408
16543
|
let announcement = /* @__PURE__ */ state("");
|
|
16409
|
-
let announcementIsHtml = /* @__PURE__ */ state(false);
|
|
16410
16544
|
let srDivRef = /* @__PURE__ */ state(void 0);
|
|
16411
16545
|
let skipToWordBinRef = /* @__PURE__ */ state(void 0);
|
|
16412
16546
|
let wordBinRef = /* @__PURE__ */ state(void 0);
|
|
@@ -16466,17 +16600,15 @@ function CategoriseComponent($$anchor, $$props) {
|
|
|
16466
16600
|
onstateChange()(new CustomEvent("statechange", { detail: { state: get$1(interactionState), serialized } }));
|
|
16467
16601
|
}
|
|
16468
16602
|
};
|
|
16469
|
-
const announceToScreenReader = async (message
|
|
16603
|
+
const announceToScreenReader = async (message) => {
|
|
16604
|
+
const containsMath = hasMathJax(message);
|
|
16605
|
+
const speechText = containsMath ? await getMathJaxSpeechText(processMathJax(message)) : message;
|
|
16470
16606
|
set(announcement, "");
|
|
16471
|
-
set(announcementIsHtml, false);
|
|
16472
|
-
await tick();
|
|
16473
|
-
set(announcement, message, true);
|
|
16474
|
-
set(announcementIsHtml, isHtml, true);
|
|
16475
16607
|
await tick();
|
|
16608
|
+
set(announcement, speechText, true);
|
|
16476
16609
|
setTimeout(
|
|
16477
16610
|
() => {
|
|
16478
16611
|
set(announcement, "");
|
|
16479
|
-
set(announcementIsHtml, false);
|
|
16480
16612
|
},
|
|
16481
16613
|
ANNOUNCEMENT_TIMEOUT_MS
|
|
16482
16614
|
);
|
|
@@ -16876,35 +17008,18 @@ function CategoriseComponent($$anchor, $$props) {
|
|
|
16876
17008
|
bind_this(button, ($$value) => set(skipToWordBinRef, $$value), () => get$1(skipToWordBinRef));
|
|
16877
17009
|
var div = sibling(button, 2);
|
|
16878
17010
|
var div_1 = child(div);
|
|
16879
|
-
var
|
|
16880
|
-
{
|
|
16881
|
-
var consequent = ($$anchor3) => {
|
|
16882
|
-
var fragment_2 = comment();
|
|
16883
|
-
var node_2 = first_child(fragment_2);
|
|
16884
|
-
html(node_2, () => get$1(announcement));
|
|
16885
|
-
append($$anchor3, fragment_2);
|
|
16886
|
-
};
|
|
16887
|
-
var alternate = ($$anchor3) => {
|
|
16888
|
-
var text$1 = text();
|
|
16889
|
-
template_effect(() => set_text(text$1, get$1(announcement)));
|
|
16890
|
-
append($$anchor3, text$1);
|
|
16891
|
-
};
|
|
16892
|
-
if_block(node_1, ($$render) => {
|
|
16893
|
-
if (get$1(announcementIsHtml)) $$render(consequent);
|
|
16894
|
-
else $$render(alternate, false);
|
|
16895
|
-
});
|
|
16896
|
-
}
|
|
17011
|
+
var text2 = child(div_1, true);
|
|
16897
17012
|
reset(div_1);
|
|
16898
17013
|
bind_this(div_1, ($$value) => set(srDivRef, $$value), () => get$1(srDivRef));
|
|
16899
17014
|
var div_2 = sibling(div_1, 2);
|
|
16900
|
-
var
|
|
17015
|
+
var node_1 = sibling(child(div_2), 2);
|
|
16901
17016
|
{
|
|
16902
|
-
var
|
|
16903
|
-
var button_1 =
|
|
17017
|
+
var consequent = ($$anchor3) => {
|
|
17018
|
+
var button_1 = root_2$1();
|
|
16904
17019
|
button_1.__click = handleOpenResetModal;
|
|
16905
17020
|
var span_1 = child(button_1);
|
|
16906
|
-
var
|
|
16907
|
-
SvgLoader(
|
|
17021
|
+
var node_2 = child(span_1);
|
|
17022
|
+
SvgLoader(node_2, {
|
|
16908
17023
|
svgName: "switch",
|
|
16909
17024
|
className: "switch-icon",
|
|
16910
17025
|
dataTestId: "icon-switch"
|
|
@@ -16915,22 +17030,22 @@ function CategoriseComponent($$anchor, $$props) {
|
|
|
16915
17030
|
template_effect(() => set_attribute(button_1, "tabindex", get$1(categoryTabIndex)));
|
|
16916
17031
|
append($$anchor3, button_1);
|
|
16917
17032
|
};
|
|
16918
|
-
if_block(
|
|
16919
|
-
if (!get$1(isCompleted) && !get$1(isLocked) && get$1(totalPlacedItems) > 0) $$render(
|
|
17033
|
+
if_block(node_1, ($$render) => {
|
|
17034
|
+
if (!get$1(isCompleted) && !get$1(isLocked) && get$1(totalPlacedItems) > 0) $$render(consequent);
|
|
16920
17035
|
});
|
|
16921
17036
|
}
|
|
16922
17037
|
reset(div_2);
|
|
16923
|
-
var
|
|
17038
|
+
var node_3 = sibling(div_2, 2);
|
|
16924
17039
|
{
|
|
16925
17040
|
let $02 = /* @__PURE__ */ user_derived(() => !!config().stimulus);
|
|
16926
|
-
CategoriseCategoryList(
|
|
17041
|
+
CategoriseCategoryList(node_3, {
|
|
16927
17042
|
get hasStimulus() {
|
|
16928
17043
|
return get$1($02);
|
|
16929
17044
|
},
|
|
16930
17045
|
children: ($$anchor3, $$slotProps) => {
|
|
16931
|
-
var
|
|
16932
|
-
var
|
|
16933
|
-
each(
|
|
17046
|
+
var fragment_2 = comment();
|
|
17047
|
+
var node_4 = first_child(fragment_2);
|
|
17048
|
+
each(node_4, 19, () => config().category_groups, (category) => category.id, ($$anchor4, category, categoryIndex) => {
|
|
16934
17049
|
const categoryItems = /* @__PURE__ */ user_derived(() => getCategoryItemsData(get$1(category).id));
|
|
16935
17050
|
const isCollapsed = /* @__PURE__ */ user_derived(() => !api().isCategoryOpen(get$1(interactionState), get$1(category).id));
|
|
16936
17051
|
{
|
|
@@ -17015,12 +17130,12 @@ function CategoriseComponent($$anchor, $$props) {
|
|
|
17015
17130
|
);
|
|
17016
17131
|
}
|
|
17017
17132
|
});
|
|
17018
|
-
append($$anchor3,
|
|
17133
|
+
append($$anchor3, fragment_2);
|
|
17019
17134
|
},
|
|
17020
17135
|
$$slots: { default: true }
|
|
17021
17136
|
});
|
|
17022
17137
|
}
|
|
17023
|
-
var
|
|
17138
|
+
var node_5 = sibling(node_3, 2);
|
|
17024
17139
|
{
|
|
17025
17140
|
let $02 = /* @__PURE__ */ user_derived(() => get$1(selectedItemId) || void 0);
|
|
17026
17141
|
let $12 = /* @__PURE__ */ user_derived(() => get$1(dragHoverContainerId) === CONTAINER_WORD_BIN_ID2);
|
|
@@ -17028,7 +17143,7 @@ function CategoriseComponent($$anchor, $$props) {
|
|
|
17028
17143
|
let $3 = /* @__PURE__ */ user_derived(() => get$1(dragSourceContainerId) || void 0);
|
|
17029
17144
|
let $4 = /* @__PURE__ */ user_derived(() => get$1(activeContainerForKeyboard) || void 0);
|
|
17030
17145
|
bind_this(
|
|
17031
|
-
CategoriseWordBin(
|
|
17146
|
+
CategoriseWordBin(node_5, {
|
|
17032
17147
|
get containerId() {
|
|
17033
17148
|
return CONTAINER_WORD_BIN_ID2;
|
|
17034
17149
|
},
|
|
@@ -17089,8 +17204,8 @@ function CategoriseComponent($$anchor, $$props) {
|
|
|
17089
17204
|
() => get$1(wordBinRef)
|
|
17090
17205
|
);
|
|
17091
17206
|
}
|
|
17092
|
-
var
|
|
17093
|
-
CategoriseModal(
|
|
17207
|
+
var node_6 = sibling(node_5, 2);
|
|
17208
|
+
CategoriseModal(node_6, {
|
|
17094
17209
|
get isOpen() {
|
|
17095
17210
|
return get$1(isModalOpen);
|
|
17096
17211
|
},
|
|
@@ -17100,6 +17215,7 @@ function CategoriseComponent($$anchor, $$props) {
|
|
|
17100
17215
|
reset(div);
|
|
17101
17216
|
template_effect(() => {
|
|
17102
17217
|
set_attribute(button, "tabindex", get$1(selectedItemId) ? -1 : 0);
|
|
17218
|
+
set_text(text2, get$1(announcement));
|
|
17103
17219
|
set_attribute(div_2, "aria-hidden", get$1(isModalOpen));
|
|
17104
17220
|
});
|
|
17105
17221
|
append($$anchor2, fragment_1);
|