eat-js-sdk 2.2.6 → 2.2.7
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 +13 -16
- package/package.json +1 -1
|
@@ -10240,15 +10240,14 @@ create_custom_element(
|
|
|
10240
10240
|
);
|
|
10241
10241
|
var root_1$d = /* @__PURE__ */ from_html(`<p class="p2 text-red-400 mb-3">Student's answer</p>`);
|
|
10242
10242
|
var root_3$9 = /* @__PURE__ */ from_html(`<span class="w-8 h-8 absolute right-2 top-2.5 flex items-center justify-center" aria-hidden="true"><!></span>`);
|
|
10243
|
-
var root_2$7 = /* @__PURE__ */ from_html(`<div class="relative"><textarea id="answerText" data-testid="input-long-txa" autocomplete="off" rows="3"></textarea> <!></div>`);
|
|
10243
|
+
var root_2$7 = /* @__PURE__ */ from_html(`<div class="relative"><textarea id="answerText" data-testid="input-long-txa" placeholder="Type your answer here" autocomplete="off" rows="3"></textarea> <!></div>`);
|
|
10244
10244
|
var root_5$3 = /* @__PURE__ */ from_html(`<span class="w-8 h-8 absolute right-2 top-2.5 flex items-center justify-center" aria-hidden="true"><!></span>`);
|
|
10245
|
-
var root_4$1 = /* @__PURE__ */ from_html(`<div class="relative"><input data-testid="input-short-txb" autocomplete="off"/> <!></div>`);
|
|
10245
|
+
var root_4$1 = /* @__PURE__ */ from_html(`<div class="relative"><input data-testid="input-short-txb" autocomplete="off" placeholder="Type your answer here"/> <!></div>`);
|
|
10246
10246
|
var root$b = /* @__PURE__ */ from_html(`<div class="relative"><!> <!></div>`);
|
|
10247
10247
|
function TypeInTextField($$anchor, $$props) {
|
|
10248
10248
|
push($$props, true);
|
|
10249
10249
|
let value = prop($$props, "value", 15), variant = prop($$props, "variant", 7), readonly = prop($$props, "readonly", 7, false), disabled = prop($$props, "disabled", 7, false), showStatus = prop($$props, "showStatus", 7, false), isCorrect = prop($$props, "isCorrect", 7, null), isSkipped = prop($$props, "isSkipped", 7, false), onBlur = prop($$props, "onBlur", 7);
|
|
10250
10250
|
let ariaLabel = /* @__PURE__ */ user_derived(() => showStatus() && isCorrect() !== null ? `Submitted response is ${isCorrect() ? "correct" : "incorrect"}` : !value() ? "Answer input: Please type your response" : "Your response is");
|
|
10251
|
-
let typeinPlaceholder = /* @__PURE__ */ user_derived(() => isSkipped() ? "No answer provided" : "Type your answer here");
|
|
10252
10251
|
const focusHandlers = useTextInputFocus();
|
|
10253
10252
|
const handleFocus = (e2) => {
|
|
10254
10253
|
focusHandlers.handleFocus(e2);
|
|
@@ -10334,7 +10333,7 @@ function TypeInTextField($$anchor, $$props) {
|
|
|
10334
10333
|
append($$anchor2, p);
|
|
10335
10334
|
};
|
|
10336
10335
|
if_block(node, ($$render) => {
|
|
10337
|
-
if (showStatus() && isCorrect() === false
|
|
10336
|
+
if (showStatus() && !isSkipped() && isCorrect() === false) $$render(consequent);
|
|
10338
10337
|
});
|
|
10339
10338
|
}
|
|
10340
10339
|
var node_1 = sibling(node, 2);
|
|
@@ -10352,8 +10351,8 @@ function TypeInTextField($$anchor, $$props) {
|
|
|
10352
10351
|
var span = root_3$9();
|
|
10353
10352
|
var node_3 = child(span);
|
|
10354
10353
|
{
|
|
10355
|
-
let $0 = /* @__PURE__ */ user_derived(() =>
|
|
10356
|
-
let $1 = /* @__PURE__ */ user_derived(() =>
|
|
10354
|
+
let $0 = /* @__PURE__ */ user_derived(() => Boolean(isCorrect()));
|
|
10355
|
+
let $1 = /* @__PURE__ */ user_derived(() => Boolean(isCorrect()) ? "text-green-700" : "text-red-850");
|
|
10357
10356
|
ResultIcon(node_3, {
|
|
10358
10357
|
get isCorrect() {
|
|
10359
10358
|
return get$1($0);
|
|
@@ -10367,7 +10366,7 @@ function TypeInTextField($$anchor, $$props) {
|
|
|
10367
10366
|
append($$anchor3, span);
|
|
10368
10367
|
};
|
|
10369
10368
|
if_block(node_2, ($$render) => {
|
|
10370
|
-
if (showStatus() && value() && value().trim() && isCorrect() !== null
|
|
10369
|
+
if (showStatus() && value() && value().trim() && isCorrect() !== null) $$render(consequent_1);
|
|
10371
10370
|
});
|
|
10372
10371
|
}
|
|
10373
10372
|
reset(div_1);
|
|
@@ -10376,14 +10375,13 @@ function TypeInTextField($$anchor, $$props) {
|
|
|
10376
10375
|
set_class(textarea, 1, `input-long-txa typein-textbox h-32 resize-none
|
|
10377
10376
|
${$0 ?? ""}
|
|
10378
10377
|
${showStatus() && !isSkipped() && isCorrect() === true ? "border-2 border-green-700 bg-green-400" : ""}
|
|
10379
|
-
${showStatus() && isCorrect() === false
|
|
10378
|
+
${showStatus() && !isSkipped() && isCorrect() === false ? "border-2 border-red-850" : ""}`);
|
|
10380
10379
|
set_attribute(textarea, "aria-label", get$1(ariaLabel));
|
|
10381
10380
|
textarea.readOnly = readonly();
|
|
10382
10381
|
textarea.disabled = disabled();
|
|
10383
|
-
set_attribute(textarea, "placeholder", get$1(typeinPlaceholder));
|
|
10384
10382
|
},
|
|
10385
10383
|
[
|
|
10386
|
-
() => showStatus() && value() && value().trim() && isCorrect() !== null
|
|
10384
|
+
() => showStatus() && value() && value().trim() && isCorrect() !== null ? "pr-10" : ""
|
|
10387
10385
|
]
|
|
10388
10386
|
);
|
|
10389
10387
|
event("focus", textarea, handleFocus);
|
|
@@ -10404,8 +10402,8 @@ function TypeInTextField($$anchor, $$props) {
|
|
|
10404
10402
|
var span_1 = root_5$3();
|
|
10405
10403
|
var node_5 = child(span_1);
|
|
10406
10404
|
{
|
|
10407
|
-
let $0 = /* @__PURE__ */ user_derived(() =>
|
|
10408
|
-
let $1 = /* @__PURE__ */ user_derived(() =>
|
|
10405
|
+
let $0 = /* @__PURE__ */ user_derived(() => Boolean(isCorrect()));
|
|
10406
|
+
let $1 = /* @__PURE__ */ user_derived(() => Boolean(isCorrect()) ? "text-green-700" : "text-red-850");
|
|
10409
10407
|
ResultIcon(node_5, {
|
|
10410
10408
|
get isCorrect() {
|
|
10411
10409
|
return get$1($0);
|
|
@@ -10419,16 +10417,15 @@ function TypeInTextField($$anchor, $$props) {
|
|
|
10419
10417
|
append($$anchor3, span_1);
|
|
10420
10418
|
};
|
|
10421
10419
|
if_block(node_4, ($$render) => {
|
|
10422
|
-
if (showStatus() && value() && value().trim() && isCorrect() !== null
|
|
10420
|
+
if (showStatus() && value() && value().trim() && isCorrect() !== null) $$render(consequent_3);
|
|
10423
10421
|
});
|
|
10424
10422
|
}
|
|
10425
10423
|
reset(div_2);
|
|
10426
10424
|
template_effect(() => {
|
|
10427
|
-
set_class(input, 1, `input-short-txb typein-textbox typein-input ${showStatus() && !isSkipped() && isCorrect() === true ? "border-2 border-green-700 bg-green-400" : ""} ${showStatus() && isCorrect() === false
|
|
10425
|
+
set_class(input, 1, `input-short-txb typein-textbox typein-input ${showStatus() && !isSkipped() && isCorrect() === true ? "border-2 border-green-700 bg-green-400" : ""} ${showStatus() && !isSkipped() && isCorrect() === false ? "border-2 border-red-850" : ""}`);
|
|
10428
10426
|
set_attribute(input, "aria-label", get$1(ariaLabel));
|
|
10429
10427
|
input.readOnly = readonly();
|
|
10430
10428
|
input.disabled = disabled();
|
|
10431
|
-
set_attribute(input, "placeholder", get$1(typeinPlaceholder));
|
|
10432
10429
|
});
|
|
10433
10430
|
event("focus", input, handleFocus);
|
|
10434
10431
|
event("blur", input, handleBlur);
|
|
@@ -11026,7 +11023,7 @@ function TypeInFeedback($$anchor, $$props) {
|
|
|
11026
11023
|
}
|
|
11027
11024
|
return false;
|
|
11028
11025
|
})());
|
|
11029
|
-
const showHasMultipleAnswers = /* @__PURE__ */ user_derived(() => get$1(hasMultipleAnswers) && config().variant
|
|
11026
|
+
const showHasMultipleAnswers = /* @__PURE__ */ user_derived(() => feedbackState().showStatusLine && get$1(hasMultipleAnswers) && (config().variant === "short" || config().variant === "long"));
|
|
11030
11027
|
const showFeedbackAlert = /* @__PURE__ */ user_derived(() => feedbackState().isFeedbackShown && !feedbackState().isSkipped && config().variant === "inline" && !!feedbackState().resultFeedback?.trim());
|
|
11031
11028
|
const showInlineComparisonTable = /* @__PURE__ */ user_derived(() => feedbackState().showComparisonTable && config().variant === "inline");
|
|
11032
11029
|
const feedbackIconType = /* @__PURE__ */ user_derived(() => isInteractiveMode2() && config().variant === "inline" ? "info" : "result");
|