eat-js-sdk 2.5.5 → 2.5.6
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 +274 -165
- package/package.json +1 -1
|
@@ -5461,9 +5461,8 @@ async function getMathJaxSpeechText(html2) {
|
|
|
5461
5461
|
try {
|
|
5462
5462
|
await typesetMathJax(staging);
|
|
5463
5463
|
staging.querySelectorAll("mjx-container").forEach((container) => {
|
|
5464
|
-
const
|
|
5465
|
-
|
|
5466
|
-
container.replaceWith(document.createTextNode(text2));
|
|
5464
|
+
const speechText = container.getAttribute("aria-label") ?? container.querySelector("mjx-assistive-mml")?.textContent?.trim() ?? "";
|
|
5465
|
+
container.replaceWith(document.createTextNode(speechText));
|
|
5467
5466
|
});
|
|
5468
5467
|
return staging.textContent?.trim() ?? "";
|
|
5469
5468
|
} finally {
|
|
@@ -7000,8 +6999,8 @@ function useImageModalSize() {
|
|
|
7000
6999
|
}
|
|
7001
7000
|
var root_4$8 = /* @__PURE__ */ from_html(`<span class="w-6 h-6 flex items-center justify-center"><!></span>`);
|
|
7002
7001
|
var root_5$a = /* @__PURE__ */ from_html(`<span class="w-6 h-6 flex items-center justify-center"><!></span>`);
|
|
7003
|
-
var root_7$
|
|
7004
|
-
var root_6$
|
|
7002
|
+
var root_7$6 = /* @__PURE__ */ from_html(`<span class="sr-only"><!></span>`);
|
|
7003
|
+
var root_6$3 = /* @__PURE__ */ from_html(`<div><!> <span aria-hidden="true"><!></span></div>`);
|
|
7005
7004
|
var root_10$3 = /* @__PURE__ */ from_html(`<span class="w-4 h-4 flex items-center justify-center"><!></span>`);
|
|
7006
7005
|
var root_11$2 = /* @__PURE__ */ from_html(`<span class="w-4 h-4 flex items-center justify-center"><!></span>`);
|
|
7007
7006
|
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>`);
|
|
@@ -7301,11 +7300,11 @@ function MCQImageModal($$anchor, $$props) {
|
|
|
7301
7300
|
return get$1(fullAnswerText);
|
|
7302
7301
|
},
|
|
7303
7302
|
children: ($$anchor4, $$slotProps2) => {
|
|
7304
|
-
var div_6 = root_6$
|
|
7303
|
+
var div_6 = root_6$3();
|
|
7305
7304
|
var node_8 = child(div_6);
|
|
7306
7305
|
{
|
|
7307
7306
|
var consequent_1 = ($$anchor5) => {
|
|
7308
|
-
var span_2 = root_7$
|
|
7307
|
+
var span_2 = root_7$6();
|
|
7309
7308
|
var node_9 = child(span_2);
|
|
7310
7309
|
{
|
|
7311
7310
|
let $02 = /* @__PURE__ */ user_derived(() => get$1(currentOption)?.answer);
|
|
@@ -7634,7 +7633,7 @@ function InteractionSection($$anchor, $$props) {
|
|
|
7634
7633
|
create_custom_element(InteractionSection, { children: {} }, [], [], true);
|
|
7635
7634
|
var root_5$9 = /* @__PURE__ */ from_html(`<div></div>`);
|
|
7636
7635
|
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);
|
|
7637
|
-
var root_7$
|
|
7636
|
+
var root_7$5 = /* @__PURE__ */ from_html(`<div></div>`);
|
|
7638
7637
|
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>`);
|
|
7639
7638
|
function PromptStimulusImageModal($$anchor, $$props) {
|
|
7640
7639
|
push($$props, true);
|
|
@@ -7825,7 +7824,7 @@ function PromptStimulusImageModal($$anchor, $$props) {
|
|
|
7825
7824
|
var node_4 = first_child(fragment_4);
|
|
7826
7825
|
{
|
|
7827
7826
|
var consequent_2 = ($$anchor5) => {
|
|
7828
|
-
var div_7 = root_7$
|
|
7827
|
+
var div_7 = root_7$5();
|
|
7829
7828
|
template_effect(() => set_style(div_7, `height:${get$1(bottomSpacerHeight) ?? ""}px`));
|
|
7830
7829
|
append($$anchor5, div_7);
|
|
7831
7830
|
};
|
|
@@ -8513,9 +8512,9 @@ create_custom_element(
|
|
|
8513
8512
|
var root_4$5 = /* @__PURE__ */ from_html(`<div data-testid="stimulus-txt-ctr"><!></div>`);
|
|
8514
8513
|
var root_5$7 = /* @__PURE__ */ from_html(`<div data-testid="stimulus-img-ctr"><!></div>`);
|
|
8515
8514
|
var root_3$b = /* @__PURE__ */ from_html(`<!> <!>`, 1);
|
|
8516
|
-
var root_7$
|
|
8515
|
+
var root_7$4 = /* @__PURE__ */ from_html(`<div data-testid="stimulus-img-ctr"><!></div>`);
|
|
8517
8516
|
var root_8$6 = /* @__PURE__ */ from_html(`<div data-testid="stimulus-txt-ctr"><!></div>`);
|
|
8518
|
-
var root_6$
|
|
8517
|
+
var root_6$2 = /* @__PURE__ */ from_html(`<!> <!>`, 1);
|
|
8519
8518
|
var root_1$i = /* @__PURE__ */ from_html(`<div class="stimulus-section flex flex-col w-full"><!> <div><!></div></div>`);
|
|
8520
8519
|
function StimulusSection($$anchor, $$props) {
|
|
8521
8520
|
push($$props, true);
|
|
@@ -8664,11 +8663,11 @@ function StimulusSection($$anchor, $$props) {
|
|
|
8664
8663
|
append($$anchor3, fragment_2);
|
|
8665
8664
|
};
|
|
8666
8665
|
var alternate = ($$anchor3) => {
|
|
8667
|
-
var fragment_3 = root_6$
|
|
8666
|
+
var fragment_3 = root_6$2();
|
|
8668
8667
|
var node_7 = first_child(fragment_3);
|
|
8669
8668
|
{
|
|
8670
8669
|
var consequent_4 = ($$anchor4) => {
|
|
8671
|
-
var div_4 = root_7$
|
|
8670
|
+
var div_4 = root_7$4();
|
|
8672
8671
|
let classes_3;
|
|
8673
8672
|
var node_8 = child(div_4);
|
|
8674
8673
|
CommonMedia(node_8, {
|
|
@@ -8753,10 +8752,10 @@ create_custom_element(
|
|
|
8753
8752
|
true
|
|
8754
8753
|
);
|
|
8755
8754
|
var root_8$5 = /* @__PURE__ */ from_html(`<div class="divider my-6"></div>`);
|
|
8756
|
-
var root_13$
|
|
8757
|
-
var root_15$
|
|
8755
|
+
var root_13$4 = /* @__PURE__ */ from_html(`<div class="divider my-6"></div>`);
|
|
8756
|
+
var root_15$2 = /* @__PURE__ */ from_html(`<div aria-live="polite"><!></div>`);
|
|
8758
8757
|
var root_1$h = /* @__PURE__ */ from_html(`<div><!></div>`);
|
|
8759
|
-
var root_16$
|
|
8758
|
+
var root_16$1 = /* @__PURE__ */ from_html(`<div><!></div>`);
|
|
8760
8759
|
var root$f = /* @__PURE__ */ from_html(`<div class="prompt-container"><div><div></div> <!></div></div> <!>`, 1);
|
|
8761
8760
|
function PromptContainer($$anchor, $$props) {
|
|
8762
8761
|
push($$props, true);
|
|
@@ -8954,7 +8953,7 @@ function PromptContainer($$anchor, $$props) {
|
|
|
8954
8953
|
var node_6 = first_child(fragment_10);
|
|
8955
8954
|
{
|
|
8956
8955
|
var consequent_5 = ($$anchor8) => {
|
|
8957
|
-
var div_5 = root_13$
|
|
8956
|
+
var div_5 = root_13$4();
|
|
8958
8957
|
append($$anchor8, div_5);
|
|
8959
8958
|
};
|
|
8960
8959
|
var alternate = ($$anchor8) => {
|
|
@@ -8962,7 +8961,7 @@ function PromptContainer($$anchor, $$props) {
|
|
|
8962
8961
|
var node_7 = first_child(fragment_11);
|
|
8963
8962
|
{
|
|
8964
8963
|
var consequent_6 = ($$anchor9) => {
|
|
8965
|
-
var div_6 = root_15$
|
|
8964
|
+
var div_6 = root_15$2();
|
|
8966
8965
|
var node_8 = child(div_6);
|
|
8967
8966
|
snippet(node_8, () => feedback() ?? noop);
|
|
8968
8967
|
reset(div_6);
|
|
@@ -9055,7 +9054,7 @@ function PromptContainer($$anchor, $$props) {
|
|
|
9055
9054
|
var node_9 = sibling(div_2, 2);
|
|
9056
9055
|
{
|
|
9057
9056
|
var consequent_7 = ($$anchor2) => {
|
|
9058
|
-
var div_7 = root_16$
|
|
9057
|
+
var div_7 = root_16$1();
|
|
9059
9058
|
var node_10 = child(div_7);
|
|
9060
9059
|
StimulusSection(node_10, {
|
|
9061
9060
|
get stimulusData() {
|
|
@@ -9145,12 +9144,12 @@ var root_2$c = /* @__PURE__ */ from_html(`<span> </span>`);
|
|
|
9145
9144
|
var root_3$a = /* @__PURE__ */ from_html(`<span>Missing answer</span>`);
|
|
9146
9145
|
var root_4$4 = /* @__PURE__ */ from_html(`<span class="sr-only"> </span>`);
|
|
9147
9146
|
var root_5$6 = /* @__PURE__ */ from_html(`<span class="sr-only"> </span>`);
|
|
9148
|
-
var root_6$
|
|
9149
|
-
var root_7$
|
|
9147
|
+
var root_6$1 = /* @__PURE__ */ from_html(`<p>Missing answer</p>`);
|
|
9148
|
+
var root_7$3 = /* @__PURE__ */ from_html(`<p class="text-red-400 text-sm font-semibold leading-[1.3] pr-2.5 hidden md:block"> </p>`);
|
|
9150
9149
|
var root_8$4 = /* @__PURE__ */ from_html(`<span aria-hidden="true"><!></span>`);
|
|
9151
9150
|
var root_12$3 = /* @__PURE__ */ from_html(`<span class="w-3 h-2 flex items-center justify-center"><!></span>`);
|
|
9152
9151
|
var root_11$1 = /* @__PURE__ */ from_html(`<span><!></span>`);
|
|
9153
|
-
var root_13$
|
|
9152
|
+
var root_13$3 = /* @__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>`);
|
|
9154
9153
|
var root$e = /* @__PURE__ */ from_html(`<div class="relative"><!> <button><span><span class="flex items-center justify-between w-full"><span class="flex items-center flex-1"><span aria-hidden="true"> </span> <span class="flex flex-col px-3 text-left"><!> <!> <!> <!> <!></span></span> <span class="flex items-center flex-none"><!> <!> <!> <!></span></span></span> <!></button> <!></div>`);
|
|
9155
9154
|
function MCQOption($$anchor, $$props) {
|
|
9156
9155
|
push($$props, true);
|
|
@@ -9354,7 +9353,7 @@ function MCQOption($$anchor, $$props) {
|
|
|
9354
9353
|
var node_7 = child(span_9);
|
|
9355
9354
|
{
|
|
9356
9355
|
var consequent_5 = ($$anchor2) => {
|
|
9357
|
-
var p = root_6$
|
|
9356
|
+
var p = root_6$1();
|
|
9358
9357
|
template_effect(() => set_class(p, 1, `text-green-750 text-sm font-semibold leading-[1.3] hidden md:block
|
|
9359
9358
|
${get$1(totalCorrectAnswers) > 1 ? "pr-2.5" : ""}`));
|
|
9360
9359
|
append($$anchor2, p);
|
|
@@ -9366,7 +9365,7 @@ function MCQOption($$anchor, $$props) {
|
|
|
9366
9365
|
var node_8 = sibling(node_7, 2);
|
|
9367
9366
|
{
|
|
9368
9367
|
var consequent_6 = ($$anchor2) => {
|
|
9369
|
-
var p_1 = root_7$
|
|
9368
|
+
var p_1 = root_7$3();
|
|
9370
9369
|
var text_4 = child(p_1, true);
|
|
9371
9370
|
reset(p_1);
|
|
9372
9371
|
template_effect(() => set_text(text_4, get$1(isInteractiveMode2) ? "Your answer" : get$1(isPreviewMode2) ? "" : "Student's answer"));
|
|
@@ -9446,7 +9445,7 @@ function MCQOption($$anchor, $$props) {
|
|
|
9446
9445
|
var node_14 = sibling(span, 2);
|
|
9447
9446
|
{
|
|
9448
9447
|
var consequent_11 = ($$anchor2) => {
|
|
9449
|
-
var div_2 = root_13$
|
|
9448
|
+
var div_2 = root_13$3();
|
|
9450
9449
|
var img = child(div_2);
|
|
9451
9450
|
reset(div_2);
|
|
9452
9451
|
template_effect(() => {
|
|
@@ -10761,10 +10760,10 @@ const action = (node) => {
|
|
|
10761
10760
|
action.update = n.update;
|
|
10762
10761
|
action.destroy = n.destroy;
|
|
10763
10762
|
var root_1$c = /* @__PURE__ */ from_html(`<label data-testid="qn-number-txt" aria-hidden="true"><span></span> <span> </span></label>`);
|
|
10764
|
-
var root_2$8 = /* @__PURE__ */ from_html(`<div
|
|
10763
|
+
var root_2$8 = /* @__PURE__ */ from_html(`<div><!></div>`);
|
|
10765
10764
|
var root_4$1 = /* @__PURE__ */ from_html(`<div role="textbox" aria-readonly="true" data-testid="ans-sum-corr-txb"><!></div>`);
|
|
10766
10765
|
var root_5$4 = /* @__PURE__ */ from_html(`<textarea rows="1" readonly=""></textarea>`);
|
|
10767
|
-
var root_6
|
|
10766
|
+
var root_6 = /* @__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>`);
|
|
10768
10767
|
var root$a = /* @__PURE__ */ from_html(`<div><!> <!> <!></div>`);
|
|
10769
10768
|
function AnswerDisplay($$anchor, $$props) {
|
|
10770
10769
|
push($$props, true);
|
|
@@ -10931,15 +10930,13 @@ function AnswerDisplay($$anchor, $$props) {
|
|
|
10931
10930
|
template_effect(
|
|
10932
10931
|
($0) => {
|
|
10933
10932
|
set_attribute(div_1, "aria-label", $0);
|
|
10934
|
-
set_attribute(div_1, "aria-labelledby", `textbox-${comparison().id ?? ""}-${questionNumber() - 1}`);
|
|
10935
|
-
set_attribute(div_1, "aria-describedby", `textbox-value-${comparison().id ?? ""}-${questionNumber() - 1}`);
|
|
10936
10933
|
set_class(div_1, 1, `${type() === "correct" ? "ans-sum-corr-txb" : "ans-sum-stud-txb"} ${get$1(textareaClasses) ?? ""}`);
|
|
10937
10934
|
set_attribute(div_1, "data-testid", type() === "correct" ? "ans-sum-corr-txb" : "ans-sum-stud-txb");
|
|
10938
10935
|
set_attribute(div_1, "id", `${type() ?? ""}-${comparison().id ?? ""}-${questionNumber() - 1}`);
|
|
10939
10936
|
set_attribute(div_1, "tabindex", get$1(tabIndex));
|
|
10940
10937
|
},
|
|
10941
10938
|
[
|
|
10942
|
-
() => `${get$1(ariaLabel)} ${useRemoveRichTextHtmlTags(get$1(displayAnswer))}`
|
|
10939
|
+
() => hasMathJax(get$1(displayAnswer)) ? get$1(ariaLabel) : `${get$1(ariaLabel)} ${useRemoveRichTextHtmlTags(get$1(displayAnswer))}`
|
|
10943
10940
|
]
|
|
10944
10941
|
);
|
|
10945
10942
|
append($$anchor2, div_1);
|
|
@@ -10999,7 +10996,7 @@ function AnswerDisplay($$anchor, $$props) {
|
|
|
10999
10996
|
var node_5 = sibling(node_1, 2);
|
|
11000
10997
|
{
|
|
11001
10998
|
var consequent_3 = ($$anchor2) => {
|
|
11002
|
-
var span_2 = root_6
|
|
10999
|
+
var span_2 = root_6();
|
|
11003
11000
|
var node_6 = child(span_2);
|
|
11004
11001
|
{
|
|
11005
11002
|
let $0 = /* @__PURE__ */ user_derived(() => isCorrect() ? "text-green-900" : "text-red-900");
|
|
@@ -11470,7 +11467,7 @@ var root_3$7 = /* @__PURE__ */ from_html(`<p></p>`);
|
|
|
11470
11467
|
var root_8$3 = /* @__PURE__ */ from_html(`<div class="absolute inset-0 bg-transparent z-50"></div>`);
|
|
11471
11468
|
var root_2$6 = /* @__PURE__ */ from_html(`<div class="inline-typein-container mt-6 relative"><!> <div class="divider my-6"></div> <!></div>`);
|
|
11472
11469
|
var root_10$2 = /* @__PURE__ */ from_html(`<div class="mb-4"><!></div>`);
|
|
11473
|
-
var root_13$
|
|
11470
|
+
var root_13$2 = /* @__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>`);
|
|
11474
11471
|
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>`);
|
|
11475
11472
|
var root_9$3 = /* @__PURE__ */ from_html(`<!> <!> <span class="sr-only" aria-live="polite" aria-atomic="true"> </span> <!>`, 1);
|
|
11476
11473
|
function TypeInComponent($$anchor, $$props) {
|
|
@@ -11873,7 +11870,7 @@ function TypeInComponent($$anchor, $$props) {
|
|
|
11873
11870
|
var node_10 = sibling(child(div_3), 2);
|
|
11874
11871
|
{
|
|
11875
11872
|
var consequent_5 = ($$anchor5) => {
|
|
11876
|
-
var div_4 = root_13$
|
|
11873
|
+
var div_4 = root_13$2();
|
|
11877
11874
|
var node_11 = child(div_4);
|
|
11878
11875
|
{
|
|
11879
11876
|
let $02 = /* @__PURE__ */ user_derived(() => get$1(missingAnswerDisplay) ?? "");
|
|
@@ -14485,7 +14482,7 @@ var root_1$9 = /* @__PURE__ */ from_html(`<span class="sr-only"> </span>`);
|
|
|
14485
14482
|
var root_2$5 = /* @__PURE__ */ from_html(`<span class="sr-only"> </span>`);
|
|
14486
14483
|
var root_3$6 = /* @__PURE__ */ from_html(`<span class="text-green-800 preview-icon"><!></span>`);
|
|
14487
14484
|
var root_5$3 = /* @__PURE__ */ from_html(`<span class="text-red-800 preview-icon"><!></span>`);
|
|
14488
|
-
var root_7$
|
|
14485
|
+
var root_7$2 = /* @__PURE__ */ from_html(`<span class="text-green-800"><!></span>`);
|
|
14489
14486
|
var root_9$2 = /* @__PURE__ */ from_html(`<span class="preview-vertical hidden"><!></span>`);
|
|
14490
14487
|
var root$7 = /* @__PURE__ */ from_html(`<button data-item-button=""><!> <span><!></span> <!> <div><span></span> <span class="absolute"><!> <!></span></div></button>`);
|
|
14491
14488
|
function CategoriseItem($$anchor, $$props) {
|
|
@@ -14870,7 +14867,7 @@ function CategoriseItem($$anchor, $$props) {
|
|
|
14870
14867
|
var node_7 = first_child(fragment_1);
|
|
14871
14868
|
{
|
|
14872
14869
|
var consequent_4 = ($$anchor4) => {
|
|
14873
|
-
var span_7 = root_7$
|
|
14870
|
+
var span_7 = root_7$2();
|
|
14874
14871
|
var node_8 = child(span_7);
|
|
14875
14872
|
SvgLoader(node_8, {
|
|
14876
14873
|
svgName: "success",
|
|
@@ -14978,7 +14975,7 @@ create_custom_element(
|
|
|
14978
14975
|
var root_2$4 = /* @__PURE__ */ from_html(`<span class="sr-only"> </span> <!>`, 1);
|
|
14979
14976
|
var root_1$8 = /* @__PURE__ */ from_html(`<button tabindex="0"><!></button>`);
|
|
14980
14977
|
var root_8$2 = /* @__PURE__ */ from_html(`<div class="w-full text-base text-charcoal font-semibold mt-1 mb-2">Missing answers:</div>`);
|
|
14981
|
-
var root_7$
|
|
14978
|
+
var root_7$1 = /* @__PURE__ */ from_html(`<!> <!>`, 1);
|
|
14982
14979
|
var root$6 = /* @__PURE__ */ from_html(`<!> <section><!></section>`, 1);
|
|
14983
14980
|
function CategoriseDndContainer($$anchor, $$props) {
|
|
14984
14981
|
push($$props, true);
|
|
@@ -15362,7 +15359,7 @@ function CategoriseDndContainer($$anchor, $$props) {
|
|
|
15362
15359
|
var node_7 = first_child(fragment_5);
|
|
15363
15360
|
each(node_7, 19, () => get$1(localItems), (item) => `${item.id}-${get$1(dragCounter)}`, ($$anchor4, item, index2) => {
|
|
15364
15361
|
const itemResultType = /* @__PURE__ */ user_derived(() => getItemResultType(get$1(item).isClonedItem && get$1(item).cloneId ? get$1(item).cloneId : get$1(item).id));
|
|
15365
|
-
var fragment_6 = root_7$
|
|
15362
|
+
var fragment_6 = root_7$1();
|
|
15366
15363
|
var node_8 = first_child(fragment_6);
|
|
15367
15364
|
{
|
|
15368
15365
|
var consequent_4 = ($$anchor5) => {
|
|
@@ -18203,17 +18200,19 @@ function useDropdownPosition(config) {
|
|
|
18203
18200
|
}
|
|
18204
18201
|
var root_1$3 = /* @__PURE__ */ from_html(`<div class="absolute inset-0 bg-transparent z-10"></div>`);
|
|
18205
18202
|
var root_2 = /* @__PURE__ */ from_html(`<div class="bg-black bg-opacity-5 h-full flex flex-none justify-center items-center"><div class="inline-txb-lbl font-semibold text-base leading-[19px] text-charcoal px-3 flex items-center" data-testid="inline-txb-lbl" aria-hidden="true"> </div></div>`);
|
|
18206
|
-
var root_3$3 = /* @__PURE__ */ from_html(`<span class="
|
|
18207
|
-
var
|
|
18208
|
-
var
|
|
18209
|
-
var
|
|
18210
|
-
var
|
|
18211
|
-
var
|
|
18212
|
-
var root_14$1 = /* @__PURE__ */ from_html(`<span class="
|
|
18213
|
-
var
|
|
18214
|
-
var
|
|
18215
|
-
var
|
|
18216
|
-
var
|
|
18203
|
+
var root_3$3 = /* @__PURE__ */ from_html(`<span class="truncate mr-2 text-base text-gray-860"> </span>`);
|
|
18204
|
+
var root_5$1 = /* @__PURE__ */ from_html(`<span class="text-green-900 mr-2"><span aria-hidden="true"><!></span> <span class="sr-only">Correct</span></span>`);
|
|
18205
|
+
var root_8$1 = /* @__PURE__ */ from_html(`<span class="text-green-900 mr-2"><span aria-hidden="true"><!></span> <span class="sr-only">Correct</span></span>`);
|
|
18206
|
+
var root_9$1 = /* @__PURE__ */ from_html(`<span class="text-red-900 mr-2"><span aria-hidden="true"><!></span> <span class="sr-only">Incorrect</span></span>`);
|
|
18207
|
+
var root_10$1 = /* @__PURE__ */ from_html(`<span class="flex items-center justify-center text-blue-1000"><span aria-hidden="true"><!></span></span>`);
|
|
18208
|
+
var root_11 = /* @__PURE__ */ from_html(`<span class="flex items-center justify-center text-blue-1000"><span aria-hidden="true"><!></span></span>`);
|
|
18209
|
+
var root_14$1 = /* @__PURE__ */ from_html(`<span class="sr-only"> </span>`);
|
|
18210
|
+
var root_15$1 = /* @__PURE__ */ from_html(`<span class="flex items-center text-green-900" aria-hidden="true"><!></span>`);
|
|
18211
|
+
var root_17$1 = /* @__PURE__ */ from_html(`<span class="flex items-center text-red-900" aria-hidden="true"><!></span>`);
|
|
18212
|
+
var root_19$1 = /* @__PURE__ */ from_html(`<span class="flex items-center text-blue-850" aria-hidden="true"><!></span>`);
|
|
18213
|
+
var root_13$1 = /* @__PURE__ */ from_html(`<li role="option" tabindex="-1"><div class="p-0.5 flex justify-between w-full text-base whitespace-normal"><!> <!> <!></div></li>`);
|
|
18214
|
+
var root_12$1 = /* @__PURE__ */ from_html(`<ul class="drp-list dropdown-menu block" data-testid="drp-list" role="listbox" tabindex="-1"></ul>`);
|
|
18215
|
+
var root$2 = /* @__PURE__ */ from_html(`<span class="dropdown inline-block relative align-middle"><div role="status" aria-live="assertive" aria-atomic="true" class="sr-only"> </div> <span class="sr-only"> </span> <!> <div role="combobox" data-testid="drp-cmb" aria-haspopup="listbox" tabindex="0"><!> <div class="px-4 flex flex-1 min-w-0 align-middle truncate items-center justify-between w-full"><!> <div class="flex items-center"><!> <!></div></div></div> <!></span>`);
|
|
18217
18216
|
function DropdownContainer($$anchor, $$props) {
|
|
18218
18217
|
push($$props, true);
|
|
18219
18218
|
let dropdownId = prop($$props, "dropdownId", 7), dropdownNumber = prop($$props, "dropdownNumber", 7), options = prop($$props, "options", 7), selected = prop($$props, "selected", 7), correctAnswers = prop($$props, "correctAnswers", 23, () => []), isCorrect = prop($$props, "isCorrect", 7, false), isFinished = prop($$props, "isFinished", 7, false), isLocked = prop($$props, "isLocked", 7, false), isDataSaving = prop($$props, "isDataSaving", 7, false), mode = prop($$props, "mode", 7), showFeedback = prop($$props, "showFeedback", 7, false), showNumbering = prop($$props, "showNumbering", 7, true), onselect = prop($$props, "onselect", 7), viewportBuffer = prop($$props, "viewportBuffer", 7, 60);
|
|
@@ -18297,6 +18296,10 @@ function DropdownContainer($$anchor, $$props) {
|
|
|
18297
18296
|
set(isKeyboardNavigation, false);
|
|
18298
18297
|
set(isFirstNavigation, true);
|
|
18299
18298
|
await tick();
|
|
18299
|
+
if (get$1(listRef)) {
|
|
18300
|
+
await typesetMathJax(get$1(listRef));
|
|
18301
|
+
await stampMathAriaLabels(get$1(listRef));
|
|
18302
|
+
}
|
|
18300
18303
|
if (selected() && selected() !== DROPDOWN_INTERACTION.PLACEHOLDER && selected() !== "") {
|
|
18301
18304
|
const currentIndex = get$1(initializedOptions).indexOf(selected());
|
|
18302
18305
|
get$1(state$1).activeIndex = currentIndex >= 0 ? currentIndex : null;
|
|
@@ -18306,6 +18309,7 @@ function DropdownContainer($$anchor, $$props) {
|
|
|
18306
18309
|
if (get$1(listRef) && get$1(state$1).activeIndex !== null) {
|
|
18307
18310
|
await tick();
|
|
18308
18311
|
await dropdownActions.scrollToActive(get$1(listRef), get$1(state$1).activeIndex);
|
|
18312
|
+
await announceActiveOption(get$1(state$1).activeIndex);
|
|
18309
18313
|
}
|
|
18310
18314
|
await tick();
|
|
18311
18315
|
await ensureDropdownVisibility();
|
|
@@ -18369,6 +18373,7 @@ function DropdownContainer($$anchor, $$props) {
|
|
|
18369
18373
|
await tick();
|
|
18370
18374
|
await dropdownActions.scrollToActive(get$1(listRef), get$1(state$1).activeIndex);
|
|
18371
18375
|
}
|
|
18376
|
+
await announceActiveOption(get$1(state$1).activeIndex);
|
|
18372
18377
|
return;
|
|
18373
18378
|
}
|
|
18374
18379
|
}
|
|
@@ -18380,6 +18385,7 @@ function DropdownContainer($$anchor, $$props) {
|
|
|
18380
18385
|
if (get$1(state$1).isOpen && get$1(state$1).activeIndex !== null && get$1(listRef)) {
|
|
18381
18386
|
await tick();
|
|
18382
18387
|
await dropdownActions.scrollToActive(get$1(listRef), get$1(state$1).activeIndex);
|
|
18388
|
+
await announceActiveOption(get$1(state$1).activeIndex);
|
|
18383
18389
|
}
|
|
18384
18390
|
};
|
|
18385
18391
|
const handleMouseEnter = (index2) => {
|
|
@@ -18470,6 +18476,7 @@ function DropdownContainer($$anchor, $$props) {
|
|
|
18470
18476
|
return parts.filter(Boolean).join(", ");
|
|
18471
18477
|
});
|
|
18472
18478
|
const getOptionAriaLabel = (option, index2) => {
|
|
18479
|
+
if (hasMathJax(option)) return void 0;
|
|
18473
18480
|
const optionNum = index2 + 1;
|
|
18474
18481
|
const isSelected = option === get$1(state$1).selected;
|
|
18475
18482
|
const cleanOption = useRemoveRichTextHtmlTags(option);
|
|
@@ -18480,12 +18487,80 @@ function DropdownContainer($$anchor, $$props) {
|
|
|
18480
18487
|
}
|
|
18481
18488
|
return isSelected ? `Selected option ${cleanOption}` : `Option ${optionNum} ${cleanOption}`;
|
|
18482
18489
|
};
|
|
18490
|
+
const getMathOptionPrefix = (option, index2) => {
|
|
18491
|
+
const optionNum = index2 + 1;
|
|
18492
|
+
const isSelected = option === get$1(state$1).selected;
|
|
18493
|
+
if (showFeedback()) {
|
|
18494
|
+
const isCorrectAnswer = correctAnswers().includes(option);
|
|
18495
|
+
const correctness = isCorrectAnswer ? ", correct" : ", incorrect";
|
|
18496
|
+
return isSelected ? `Selected option${correctness}:` : `Option ${optionNum}${correctness}:`;
|
|
18497
|
+
}
|
|
18498
|
+
return isSelected ? "Selected option:" : `Option ${optionNum}:`;
|
|
18499
|
+
};
|
|
18483
18500
|
const isCurrentOption = (index2) => {
|
|
18484
18501
|
return get$1(state$1).isOpen && get$1(isKeyboardNavigation) && get$1(state$1).activeIndex === index2;
|
|
18485
18502
|
};
|
|
18486
18503
|
const shouldShowHover = (index2) => {
|
|
18487
18504
|
return get$1(state$1).isOpen && get$1(hoveredIndex) === index2;
|
|
18488
18505
|
};
|
|
18506
|
+
let srAnnouncement = /* @__PURE__ */ state("");
|
|
18507
|
+
const ANNOUNCEMENT_CLEAR_MS = 1e3;
|
|
18508
|
+
const stampMathAriaLabels = async (list) => {
|
|
18509
|
+
const promises = get$1(initializedOptions).map(async (option, index2) => {
|
|
18510
|
+
if (!hasMathJax(option)) return;
|
|
18511
|
+
const li = list.querySelector(`#${listId}-option-${index2}`);
|
|
18512
|
+
if (!li) return;
|
|
18513
|
+
const prefix = getMathOptionPrefix(option, index2);
|
|
18514
|
+
const existingLabels = [];
|
|
18515
|
+
li.querySelectorAll("mjx-container").forEach((el) => {
|
|
18516
|
+
const label = el.getAttribute("aria-label");
|
|
18517
|
+
if (label) existingLabels.push(label);
|
|
18518
|
+
});
|
|
18519
|
+
if (existingLabels.length > 0) {
|
|
18520
|
+
li.setAttribute("aria-label", [prefix, ...existingLabels].filter(Boolean).join(" "));
|
|
18521
|
+
return;
|
|
18522
|
+
}
|
|
18523
|
+
const speechText = await getMathJaxSpeechText(processMathJax(option));
|
|
18524
|
+
if (speechText) {
|
|
18525
|
+
li.setAttribute("aria-label", [prefix, speechText].filter(Boolean).join(" "));
|
|
18526
|
+
return;
|
|
18527
|
+
}
|
|
18528
|
+
const rawParts = [];
|
|
18529
|
+
li.querySelectorAll("mjx-container").forEach((el) => {
|
|
18530
|
+
const text2 = el.querySelector("mjx-assistive-mml")?.textContent?.trim() ?? "";
|
|
18531
|
+
if (text2) rawParts.push(text2);
|
|
18532
|
+
});
|
|
18533
|
+
if (rawParts.length > 0) {
|
|
18534
|
+
li.setAttribute("aria-label", [prefix, ...rawParts].filter(Boolean).join(" "));
|
|
18535
|
+
}
|
|
18536
|
+
});
|
|
18537
|
+
await Promise.all(promises);
|
|
18538
|
+
};
|
|
18539
|
+
const announceActiveOption = async (index2) => {
|
|
18540
|
+
if (!get$1(listRef) || index2 === null) return;
|
|
18541
|
+
const option = get$1(initializedOptions)[index2];
|
|
18542
|
+
if (!option || !hasMathJax(option)) return;
|
|
18543
|
+
const li = get$1(listRef).querySelector(`[id="${listId}-option-${index2}"]`);
|
|
18544
|
+
if (!li) return;
|
|
18545
|
+
const parts = [];
|
|
18546
|
+
const prefix = getMathOptionPrefix(option, index2);
|
|
18547
|
+
if (prefix) parts.push(prefix);
|
|
18548
|
+
li.querySelectorAll("mjx-container").forEach((el) => {
|
|
18549
|
+
const label = el.getAttribute("aria-label") ?? el.querySelector("mjx-assistive-mml")?.textContent?.trim() ?? "";
|
|
18550
|
+
if (label) parts.push(label);
|
|
18551
|
+
});
|
|
18552
|
+
const text2 = parts.join(" ");
|
|
18553
|
+
if (!text2) return;
|
|
18554
|
+
set(srAnnouncement, "");
|
|
18555
|
+
await tick();
|
|
18556
|
+
set(srAnnouncement, text2, true);
|
|
18557
|
+
setTimeout(
|
|
18558
|
+
() => {
|
|
18559
|
+
set(srAnnouncement, "");
|
|
18560
|
+
},
|
|
18561
|
+
ANNOUNCEMENT_CLEAR_MS
|
|
18562
|
+
);
|
|
18563
|
+
};
|
|
18489
18564
|
var $$exports = {
|
|
18490
18565
|
get dropdownId() {
|
|
18491
18566
|
return dropdownId();
|
|
@@ -18587,51 +18662,72 @@ function DropdownContainer($$anchor, $$props) {
|
|
|
18587
18662
|
}
|
|
18588
18663
|
};
|
|
18589
18664
|
var span = root$2();
|
|
18590
|
-
var
|
|
18591
|
-
var
|
|
18665
|
+
var div = child(span);
|
|
18666
|
+
var text_1 = child(div, true);
|
|
18667
|
+
reset(div);
|
|
18668
|
+
var span_1 = sibling(div, 2);
|
|
18669
|
+
var text_2 = child(span_1, true);
|
|
18592
18670
|
reset(span_1);
|
|
18593
18671
|
var node = sibling(span_1, 2);
|
|
18594
18672
|
{
|
|
18595
18673
|
var consequent = ($$anchor2) => {
|
|
18596
|
-
var
|
|
18597
|
-
append($$anchor2,
|
|
18674
|
+
var div_1 = root_1$3();
|
|
18675
|
+
append($$anchor2, div_1);
|
|
18598
18676
|
};
|
|
18599
18677
|
if_block(node, ($$render) => {
|
|
18600
18678
|
if (isDataSaving()) $$render(consequent);
|
|
18601
18679
|
});
|
|
18602
18680
|
}
|
|
18603
|
-
var
|
|
18604
|
-
|
|
18605
|
-
|
|
18681
|
+
var div_2 = sibling(node, 2);
|
|
18682
|
+
div_2.__keydown = handleKeydown;
|
|
18683
|
+
div_2.__click = () => {
|
|
18606
18684
|
if (isDataSaving() || !get$1(canToggleAccordion)) return;
|
|
18607
18685
|
get$1(state$1).isOpen ? handleCloseMenu() : handleOpenMenu();
|
|
18608
18686
|
};
|
|
18609
|
-
|
|
18610
|
-
var node_1 = child(
|
|
18687
|
+
div_2.__focusout = handleFocusOut;
|
|
18688
|
+
var node_1 = child(div_2);
|
|
18611
18689
|
{
|
|
18612
18690
|
var consequent_1 = ($$anchor2) => {
|
|
18613
|
-
var
|
|
18614
|
-
var
|
|
18615
|
-
var
|
|
18691
|
+
var div_3 = root_2();
|
|
18692
|
+
var div_4 = child(div_3);
|
|
18693
|
+
var text_3 = child(div_4, true);
|
|
18694
|
+
reset(div_4);
|
|
18616
18695
|
reset(div_3);
|
|
18617
|
-
|
|
18618
|
-
|
|
18619
|
-
append($$anchor2, div_2);
|
|
18696
|
+
template_effect(() => set_text(text_3, dropdownNumber()));
|
|
18697
|
+
append($$anchor2, div_3);
|
|
18620
18698
|
};
|
|
18621
18699
|
if_block(node_1, ($$render) => {
|
|
18622
18700
|
if (showNumbering()) $$render(consequent_1);
|
|
18623
18701
|
});
|
|
18624
18702
|
}
|
|
18625
|
-
var
|
|
18626
|
-
var
|
|
18627
|
-
var node_2 = child(span_2);
|
|
18628
|
-
html(node_2, () => get$1(state$1).selected === "" ? DROPDOWN_INTERACTION.PLACEHOLDER : get$1(state$1).selected);
|
|
18629
|
-
reset(span_2);
|
|
18630
|
-
var div_5 = sibling(span_2, 2);
|
|
18631
|
-
var node_3 = child(div_5);
|
|
18703
|
+
var div_5 = sibling(node_1, 2);
|
|
18704
|
+
var node_2 = child(div_5);
|
|
18632
18705
|
{
|
|
18633
18706
|
var consequent_2 = ($$anchor2) => {
|
|
18634
|
-
var
|
|
18707
|
+
var span_2 = root_3$3();
|
|
18708
|
+
var text_4 = child(span_2, true);
|
|
18709
|
+
reset(span_2);
|
|
18710
|
+
template_effect(() => set_text(text_4, DROPDOWN_INTERACTION.PLACEHOLDER));
|
|
18711
|
+
append($$anchor2, span_2);
|
|
18712
|
+
};
|
|
18713
|
+
var alternate = ($$anchor2) => {
|
|
18714
|
+
CommonStringToHtml($$anchor2, {
|
|
18715
|
+
get htmlString() {
|
|
18716
|
+
return get$1(state$1).selected;
|
|
18717
|
+
},
|
|
18718
|
+
otherClass: "truncate mr-2 text-base text-charcoal"
|
|
18719
|
+
});
|
|
18720
|
+
};
|
|
18721
|
+
if_block(node_2, ($$render) => {
|
|
18722
|
+
if (get$1(state$1).selected === DROPDOWN_INTERACTION.PLACEHOLDER || get$1(state$1).selected === "") $$render(consequent_2);
|
|
18723
|
+
else $$render(alternate, false);
|
|
18724
|
+
});
|
|
18725
|
+
}
|
|
18726
|
+
var div_6 = sibling(node_2, 2);
|
|
18727
|
+
var node_3 = child(div_6);
|
|
18728
|
+
{
|
|
18729
|
+
var consequent_3 = ($$anchor2) => {
|
|
18730
|
+
var span_3 = root_5$1();
|
|
18635
18731
|
var span_4 = child(span_3);
|
|
18636
18732
|
var node_4 = child(span_4);
|
|
18637
18733
|
SvgLoader(node_4, { svgName: "successSolid", className: "correct-icon" });
|
|
@@ -18640,16 +18736,16 @@ function DropdownContainer($$anchor, $$props) {
|
|
|
18640
18736
|
reset(span_3);
|
|
18641
18737
|
append($$anchor2, span_3);
|
|
18642
18738
|
};
|
|
18643
|
-
var
|
|
18644
|
-
var
|
|
18645
|
-
var node_5 = first_child(
|
|
18739
|
+
var alternate_2 = ($$anchor2) => {
|
|
18740
|
+
var fragment_1 = comment();
|
|
18741
|
+
var node_5 = first_child(fragment_1);
|
|
18646
18742
|
{
|
|
18647
|
-
var
|
|
18648
|
-
var
|
|
18649
|
-
var node_6 = first_child(
|
|
18743
|
+
var consequent_5 = ($$anchor3) => {
|
|
18744
|
+
var fragment_2 = comment();
|
|
18745
|
+
var node_6 = first_child(fragment_2);
|
|
18650
18746
|
{
|
|
18651
|
-
var
|
|
18652
|
-
var span_5 =
|
|
18747
|
+
var consequent_4 = ($$anchor4) => {
|
|
18748
|
+
var span_5 = root_8$1();
|
|
18653
18749
|
var span_6 = child(span_5);
|
|
18654
18750
|
var node_7 = child(span_6);
|
|
18655
18751
|
SvgLoader(node_7, { svgName: "successSolid", className: "correct-icon" });
|
|
@@ -18658,8 +18754,8 @@ function DropdownContainer($$anchor, $$props) {
|
|
|
18658
18754
|
reset(span_5);
|
|
18659
18755
|
append($$anchor4, span_5);
|
|
18660
18756
|
};
|
|
18661
|
-
var
|
|
18662
|
-
var span_7 =
|
|
18757
|
+
var alternate_1 = ($$anchor4) => {
|
|
18758
|
+
var span_7 = root_9$1();
|
|
18663
18759
|
var span_8 = child(span_7);
|
|
18664
18760
|
var node_8 = child(span_8);
|
|
18665
18761
|
SvgLoader(node_8, { svgName: "errorSolid", className: "incorrect-icon" });
|
|
@@ -18669,31 +18765,31 @@ function DropdownContainer($$anchor, $$props) {
|
|
|
18669
18765
|
append($$anchor4, span_7);
|
|
18670
18766
|
};
|
|
18671
18767
|
if_block(node_6, ($$render) => {
|
|
18672
|
-
if (isCorrect()) $$render(
|
|
18673
|
-
else $$render(
|
|
18768
|
+
if (isCorrect()) $$render(consequent_4);
|
|
18769
|
+
else $$render(alternate_1, false);
|
|
18674
18770
|
});
|
|
18675
18771
|
}
|
|
18676
|
-
append($$anchor3,
|
|
18772
|
+
append($$anchor3, fragment_2);
|
|
18677
18773
|
};
|
|
18678
18774
|
if_block(
|
|
18679
18775
|
node_5,
|
|
18680
18776
|
($$render) => {
|
|
18681
|
-
if (showFeedback() && !get$1(isMissing)) $$render(
|
|
18777
|
+
if (showFeedback() && !get$1(isMissing)) $$render(consequent_5);
|
|
18682
18778
|
},
|
|
18683
18779
|
true
|
|
18684
18780
|
);
|
|
18685
18781
|
}
|
|
18686
|
-
append($$anchor2,
|
|
18782
|
+
append($$anchor2, fragment_1);
|
|
18687
18783
|
};
|
|
18688
18784
|
if_block(node_3, ($$render) => {
|
|
18689
|
-
if (mode() === MODES.PREVIEW) $$render(
|
|
18690
|
-
else $$render(
|
|
18785
|
+
if (mode() === MODES.PREVIEW) $$render(consequent_3);
|
|
18786
|
+
else $$render(alternate_2, false);
|
|
18691
18787
|
});
|
|
18692
18788
|
}
|
|
18693
18789
|
var node_9 = sibling(node_3, 2);
|
|
18694
18790
|
{
|
|
18695
|
-
var
|
|
18696
|
-
var span_9 =
|
|
18791
|
+
var consequent_6 = ($$anchor2) => {
|
|
18792
|
+
var span_9 = root_10$1();
|
|
18697
18793
|
var span_10 = child(span_9);
|
|
18698
18794
|
var node_10 = child(span_10);
|
|
18699
18795
|
SvgLoader(node_10, {
|
|
@@ -18706,8 +18802,8 @@ function DropdownContainer($$anchor, $$props) {
|
|
|
18706
18802
|
reset(span_9);
|
|
18707
18803
|
append($$anchor2, span_9);
|
|
18708
18804
|
};
|
|
18709
|
-
var
|
|
18710
|
-
var span_11 =
|
|
18805
|
+
var alternate_3 = ($$anchor2) => {
|
|
18806
|
+
var span_11 = root_11();
|
|
18711
18807
|
var span_12 = child(span_11);
|
|
18712
18808
|
var node_11 = child(span_12);
|
|
18713
18809
|
SvgLoader(node_11, {
|
|
@@ -18721,36 +18817,49 @@ function DropdownContainer($$anchor, $$props) {
|
|
|
18721
18817
|
append($$anchor2, span_11);
|
|
18722
18818
|
};
|
|
18723
18819
|
if_block(node_9, ($$render) => {
|
|
18724
|
-
if (get$1(state$1).isOpen) $$render(
|
|
18725
|
-
else $$render(
|
|
18820
|
+
if (get$1(state$1).isOpen) $$render(consequent_6);
|
|
18821
|
+
else $$render(alternate_3, false);
|
|
18726
18822
|
});
|
|
18727
18823
|
}
|
|
18824
|
+
reset(div_6);
|
|
18728
18825
|
reset(div_5);
|
|
18729
|
-
reset(
|
|
18730
|
-
|
|
18731
|
-
|
|
18732
|
-
var node_12 = sibling(div_1, 2);
|
|
18826
|
+
reset(div_2);
|
|
18827
|
+
bind_this(div_2, ($$value) => set(buttonRef, $$value), () => get$1(buttonRef));
|
|
18828
|
+
var node_12 = sibling(div_2, 2);
|
|
18733
18829
|
{
|
|
18734
|
-
var
|
|
18735
|
-
var ul =
|
|
18830
|
+
var consequent_11 = ($$anchor2) => {
|
|
18831
|
+
var ul = root_12$1();
|
|
18736
18832
|
each(ul, 21, () => get$1(initializedOptions), index, ($$anchor3, option, index2) => {
|
|
18737
18833
|
const iconType = /* @__PURE__ */ user_derived(() => getOptionIcon(get$1(option)));
|
|
18738
18834
|
const showCurrentOption = /* @__PURE__ */ user_derived(() => isCurrentOption(index2));
|
|
18739
18835
|
const showHoverOption = /* @__PURE__ */ user_derived(() => shouldShowHover(index2));
|
|
18740
18836
|
const optionAriaLabel = /* @__PURE__ */ user_derived(() => getOptionAriaLabel(get$1(option), index2));
|
|
18741
|
-
var
|
|
18742
|
-
|
|
18743
|
-
|
|
18837
|
+
var li_1 = root_13$1();
|
|
18838
|
+
li_1.__mousedown = (e2) => e2.preventDefault();
|
|
18839
|
+
li_1.__click = async (e2) => {
|
|
18744
18840
|
e2.preventDefault();
|
|
18745
18841
|
e2.stopPropagation();
|
|
18746
18842
|
await handleSelect(get$1(option));
|
|
18747
18843
|
};
|
|
18748
|
-
var
|
|
18749
|
-
var node_13 = child(
|
|
18844
|
+
var div_7 = child(li_1);
|
|
18845
|
+
var node_13 = child(div_7);
|
|
18846
|
+
{
|
|
18847
|
+
var consequent_7 = ($$anchor4) => {
|
|
18848
|
+
var span_13 = root_14$1();
|
|
18849
|
+
var text_5 = child(span_13, true);
|
|
18850
|
+
reset(span_13);
|
|
18851
|
+
template_effect(($0) => set_text(text_5, $0), [() => getMathOptionPrefix(get$1(option), index2)]);
|
|
18852
|
+
append($$anchor4, span_13);
|
|
18853
|
+
};
|
|
18854
|
+
if_block(node_13, ($$render) => {
|
|
18855
|
+
if (hasMathJax(get$1(option))) $$render(consequent_7);
|
|
18856
|
+
});
|
|
18857
|
+
}
|
|
18858
|
+
var node_14 = sibling(node_13, 2);
|
|
18750
18859
|
{
|
|
18751
18860
|
let $0 = /* @__PURE__ */ user_derived(() => get$1(showHoverOption) && get$1(canInteract) ? "hover-option" : "");
|
|
18752
18861
|
let $1 = /* @__PURE__ */ user_derived(() => get$1(showCurrentOption) ? "current-option" : "");
|
|
18753
|
-
CommonStringToHtml(
|
|
18862
|
+
CommonStringToHtml(node_14, {
|
|
18754
18863
|
get htmlString() {
|
|
18755
18864
|
return get$1(option);
|
|
18756
18865
|
},
|
|
@@ -18761,75 +18870,75 @@ function DropdownContainer($$anchor, $$props) {
|
|
|
18761
18870
|
}
|
|
18762
18871
|
});
|
|
18763
18872
|
}
|
|
18764
|
-
var
|
|
18873
|
+
var node_15 = sibling(node_14, 2);
|
|
18765
18874
|
{
|
|
18766
|
-
var
|
|
18767
|
-
var
|
|
18768
|
-
var
|
|
18769
|
-
SvgLoader(
|
|
18770
|
-
reset(
|
|
18771
|
-
append($$anchor4,
|
|
18875
|
+
var consequent_8 = ($$anchor4) => {
|
|
18876
|
+
var span_14 = root_15$1();
|
|
18877
|
+
var node_16 = child(span_14);
|
|
18878
|
+
SvgLoader(node_16, { svgName: "successSolid", className: "correct-icon" });
|
|
18879
|
+
reset(span_14);
|
|
18880
|
+
append($$anchor4, span_14);
|
|
18772
18881
|
};
|
|
18773
|
-
var
|
|
18774
|
-
var
|
|
18775
|
-
var
|
|
18882
|
+
var alternate_5 = ($$anchor4) => {
|
|
18883
|
+
var fragment_3 = comment();
|
|
18884
|
+
var node_17 = first_child(fragment_3);
|
|
18776
18885
|
{
|
|
18777
|
-
var
|
|
18778
|
-
var
|
|
18779
|
-
var
|
|
18780
|
-
SvgLoader(
|
|
18781
|
-
reset(
|
|
18782
|
-
append($$anchor5,
|
|
18886
|
+
var consequent_9 = ($$anchor5) => {
|
|
18887
|
+
var span_15 = root_17$1();
|
|
18888
|
+
var node_18 = child(span_15);
|
|
18889
|
+
SvgLoader(node_18, { svgName: "errorSolid", className: "incorrect-icon" });
|
|
18890
|
+
reset(span_15);
|
|
18891
|
+
append($$anchor5, span_15);
|
|
18783
18892
|
};
|
|
18784
|
-
var
|
|
18785
|
-
var
|
|
18786
|
-
var
|
|
18893
|
+
var alternate_4 = ($$anchor5) => {
|
|
18894
|
+
var fragment_4 = comment();
|
|
18895
|
+
var node_19 = first_child(fragment_4);
|
|
18787
18896
|
{
|
|
18788
|
-
var
|
|
18789
|
-
var
|
|
18790
|
-
var
|
|
18791
|
-
SvgLoader(
|
|
18792
|
-
reset(
|
|
18793
|
-
append($$anchor6,
|
|
18897
|
+
var consequent_10 = ($$anchor6) => {
|
|
18898
|
+
var span_16 = root_19$1();
|
|
18899
|
+
var node_20 = child(span_16);
|
|
18900
|
+
SvgLoader(node_20, { svgName: "successSolid", className: "correct-icon" });
|
|
18901
|
+
reset(span_16);
|
|
18902
|
+
append($$anchor6, span_16);
|
|
18794
18903
|
};
|
|
18795
18904
|
if_block(
|
|
18796
|
-
|
|
18905
|
+
node_19,
|
|
18797
18906
|
($$render) => {
|
|
18798
|
-
if (get$1(iconType) === "selected") $$render(
|
|
18907
|
+
if (get$1(iconType) === "selected") $$render(consequent_10);
|
|
18799
18908
|
},
|
|
18800
18909
|
true
|
|
18801
18910
|
);
|
|
18802
18911
|
}
|
|
18803
|
-
append($$anchor5,
|
|
18912
|
+
append($$anchor5, fragment_4);
|
|
18804
18913
|
};
|
|
18805
18914
|
if_block(
|
|
18806
|
-
|
|
18915
|
+
node_17,
|
|
18807
18916
|
($$render) => {
|
|
18808
|
-
if (get$1(iconType) === "incorrect") $$render(
|
|
18809
|
-
else $$render(
|
|
18917
|
+
if (get$1(iconType) === "incorrect") $$render(consequent_9);
|
|
18918
|
+
else $$render(alternate_4, false);
|
|
18810
18919
|
},
|
|
18811
18920
|
true
|
|
18812
18921
|
);
|
|
18813
18922
|
}
|
|
18814
|
-
append($$anchor4,
|
|
18923
|
+
append($$anchor4, fragment_3);
|
|
18815
18924
|
};
|
|
18816
|
-
if_block(
|
|
18817
|
-
if (get$1(iconType) === "correct") $$render(
|
|
18818
|
-
else $$render(
|
|
18925
|
+
if_block(node_15, ($$render) => {
|
|
18926
|
+
if (get$1(iconType) === "correct") $$render(consequent_8);
|
|
18927
|
+
else $$render(alternate_5, false);
|
|
18819
18928
|
});
|
|
18820
18929
|
}
|
|
18821
|
-
reset(
|
|
18822
|
-
reset(
|
|
18930
|
+
reset(div_7);
|
|
18931
|
+
reset(li_1);
|
|
18823
18932
|
template_effect(() => {
|
|
18824
|
-
set_attribute(
|
|
18825
|
-
set_class(
|
|
18933
|
+
set_attribute(li_1, "id", `${listId}-option-${index2}`);
|
|
18934
|
+
set_class(li_1, 1, `dropdown-item flex align-middle items-center w-full
|
|
18826
18935
|
${get$1(canInteract) ? "cursor-pointer" : "cursor-default"}`);
|
|
18827
|
-
set_attribute(
|
|
18828
|
-
set_attribute(
|
|
18936
|
+
set_attribute(li_1, "aria-selected", get$1(option) === get$1(state$1).selected);
|
|
18937
|
+
set_attribute(li_1, "aria-label", get$1(optionAriaLabel));
|
|
18829
18938
|
});
|
|
18830
|
-
event("mouseenter",
|
|
18831
|
-
event("mouseleave",
|
|
18832
|
-
append($$anchor3,
|
|
18939
|
+
event("mouseenter", li_1, () => handleMouseEnter(index2));
|
|
18940
|
+
event("mouseleave", li_1, handleMouseLeave);
|
|
18941
|
+
append($$anchor3, li_1);
|
|
18833
18942
|
});
|
|
18834
18943
|
reset(ul);
|
|
18835
18944
|
bind_this(ul, ($$value) => set(listRef, $$value), () => get$1(listRef));
|
|
@@ -18840,21 +18949,21 @@ function DropdownContainer($$anchor, $$props) {
|
|
|
18840
18949
|
append($$anchor2, ul);
|
|
18841
18950
|
};
|
|
18842
18951
|
if_block(node_12, ($$render) => {
|
|
18843
|
-
if (get$1(state$1).isOpen && get$1(initializedOptions).length > 0) $$render(
|
|
18952
|
+
if (get$1(state$1).isOpen && get$1(initializedOptions).length > 0) $$render(consequent_11);
|
|
18844
18953
|
});
|
|
18845
18954
|
}
|
|
18846
18955
|
reset(span);
|
|
18847
18956
|
bind_this(span, ($$value) => set(containerRef, $$value), () => get$1(containerRef));
|
|
18848
18957
|
template_effect(() => {
|
|
18958
|
+
set_text(text_1, get$1(srAnnouncement));
|
|
18849
18959
|
set_attribute(span_1, "id", labelId);
|
|
18850
|
-
set_text(
|
|
18851
|
-
set_attribute(
|
|
18852
|
-
set_class(
|
|
18853
|
-
set_attribute(
|
|
18854
|
-
set_attribute(
|
|
18855
|
-
set_attribute(
|
|
18856
|
-
set_attribute(
|
|
18857
|
-
set_class(span_2, 1, `truncate mr-2 text-base ${get$1(state$1).selected === DROPDOWN_INTERACTION.PLACEHOLDER || get$1(state$1).selected === "" ? "text-gray-860" : "text-charcoal"}`);
|
|
18960
|
+
set_text(text_2, get$1(ariaLabel));
|
|
18961
|
+
set_attribute(div_2, "id", comboId);
|
|
18962
|
+
set_class(div_2, 1, `drp-cmb ${get$1(containerClasses) ?? ""}`);
|
|
18963
|
+
set_attribute(div_2, "aria-expanded", get$1(state$1).isOpen);
|
|
18964
|
+
set_attribute(div_2, "aria-labelledby", labelId);
|
|
18965
|
+
set_attribute(div_2, "aria-controls", listId);
|
|
18966
|
+
set_attribute(div_2, "aria-activedescendant", get$1(state$1).activeIndex !== null ? `${listId}-option-${get$1(state$1).activeIndex}` : void 0);
|
|
18858
18967
|
});
|
|
18859
18968
|
append($$anchor, span);
|
|
18860
18969
|
return pop($$exports);
|
|
@@ -18882,7 +18991,6 @@ create_custom_element(
|
|
|
18882
18991
|
[],
|
|
18883
18992
|
true
|
|
18884
18993
|
);
|
|
18885
|
-
var root_5$1 = /* @__PURE__ */ from_html(`<span class="dropdown-text text-xl font-semibold leading-12 text-blue-1000"><!></span>`);
|
|
18886
18994
|
var root_1$2 = /* @__PURE__ */ from_html(`<p class="mb-4"></p>`);
|
|
18887
18995
|
var root$1 = /* @__PURE__ */ from_html(`<div class="my-6"></div>`);
|
|
18888
18996
|
function DropdownInteractionContent($$anchor, $$props) {
|
|
@@ -19059,11 +19167,12 @@ function DropdownInteractionContent($$anchor, $$props) {
|
|
|
19059
19167
|
var node_1 = first_child(fragment_2);
|
|
19060
19168
|
{
|
|
19061
19169
|
var consequent_1 = ($$anchor5) => {
|
|
19062
|
-
|
|
19063
|
-
|
|
19064
|
-
|
|
19065
|
-
|
|
19066
|
-
|
|
19170
|
+
CommonStringToHtml($$anchor5, {
|
|
19171
|
+
get htmlString() {
|
|
19172
|
+
return get$1(part).text;
|
|
19173
|
+
},
|
|
19174
|
+
otherClass: "dropdown-text text-xl font-semibold leading-12 text-blue-1000"
|
|
19175
|
+
});
|
|
19067
19176
|
};
|
|
19068
19177
|
if_block(
|
|
19069
19178
|
node_1,
|