eat-js-sdk 2.1.8 → 2.2.0

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.
@@ -10224,14 +10224,15 @@ create_custom_element(
10224
10224
  );
10225
10225
  var root_1$d = /* @__PURE__ */ from_html(`<p class="p2 text-red-400 mb-3">Student's answer</p>`);
10226
10226
  var root_3$7 = /* @__PURE__ */ from_html(`<span class="w-8 h-8 absolute right-2 top-2.5 flex items-center justify-center" aria-hidden="true"><!></span>`);
10227
- 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>`);
10227
+ var root_2$7 = /* @__PURE__ */ from_html(`<div class="relative"><textarea id="answerText" data-testid="input-long-txa" autocomplete="off" rows="3"></textarea> <!></div>`);
10228
10228
  var root_5$2 = /* @__PURE__ */ from_html(`<span class="w-8 h-8 absolute right-2 top-2.5 flex items-center justify-center" aria-hidden="true"><!></span>`);
10229
- var root_4$1 = /* @__PURE__ */ from_html(`<div class="relative"><input data-testid="input-short-txb" autocomplete="off" placeholder="Type your answer here"/> <!></div>`);
10229
+ var root_4$1 = /* @__PURE__ */ from_html(`<div class="relative"><input data-testid="input-short-txb" autocomplete="off"/> <!></div>`);
10230
10230
  var root$a = /* @__PURE__ */ from_html(`<div class="relative"><!> <!></div>`);
10231
10231
  function TypeInTextField($$anchor, $$props) {
10232
10232
  push($$props, true);
10233
10233
  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);
10234
10234
  let ariaLabel = /* @__PURE__ */ user_derived(() => showStatus() && isCorrect() !== null ? `Submitted response is ${isCorrect() ? "correct" : "incorrect"}` : !value() ? "Answer input: Please type your response" : "Your response is");
10235
+ let typeinPlaceholder = /* @__PURE__ */ user_derived(() => isSkipped() ? "No answer provided" : "Type your answer here");
10235
10236
  const focusHandlers = useTextInputFocus();
10236
10237
  const handleFocus = (e2) => {
10237
10238
  focusHandlers.handleFocus(e2);
@@ -10317,7 +10318,7 @@ function TypeInTextField($$anchor, $$props) {
10317
10318
  append($$anchor2, p);
10318
10319
  };
10319
10320
  if_block(node, ($$render) => {
10320
- if (showStatus() && !isSkipped() && isCorrect() === false) $$render(consequent);
10321
+ if (showStatus() && isCorrect() === false || isSkipped()) $$render(consequent);
10321
10322
  });
10322
10323
  }
10323
10324
  var node_1 = sibling(node, 2);
@@ -10335,8 +10336,8 @@ function TypeInTextField($$anchor, $$props) {
10335
10336
  var span = root_3$7();
10336
10337
  var node_3 = child(span);
10337
10338
  {
10338
- let $0 = /* @__PURE__ */ user_derived(() => Boolean(isCorrect()));
10339
- let $1 = /* @__PURE__ */ user_derived(() => Boolean(isCorrect()) ? "text-green-700" : "text-red-850");
10339
+ let $0 = /* @__PURE__ */ user_derived(() => isSkipped() ? false : Boolean(isCorrect()));
10340
+ let $1 = /* @__PURE__ */ user_derived(() => !isSkipped() && Boolean(isCorrect()) ? "text-green-700" : "text-red-850");
10340
10341
  ResultIcon(node_3, {
10341
10342
  get isCorrect() {
10342
10343
  return get$1($0);
@@ -10350,7 +10351,7 @@ function TypeInTextField($$anchor, $$props) {
10350
10351
  append($$anchor3, span);
10351
10352
  };
10352
10353
  if_block(node_2, ($$render) => {
10353
- if (showStatus() && value() && value().trim() && isCorrect() !== null) $$render(consequent_1);
10354
+ if (showStatus() && value() && value().trim() && isCorrect() !== null || isSkipped()) $$render(consequent_1);
10354
10355
  });
10355
10356
  }
10356
10357
  reset(div_1);
@@ -10359,13 +10360,14 @@ function TypeInTextField($$anchor, $$props) {
10359
10360
  set_class(textarea, 1, `input-long-txa typein-textbox h-32 resize-none
10360
10361
  ${$0 ?? ""}
10361
10362
  ${showStatus() && !isSkipped() && isCorrect() === true ? "border-2 border-green-700 bg-green-400" : ""}
10362
- ${showStatus() && !isSkipped() && isCorrect() === false ? "border-2 border-red-850" : ""}`);
10363
+ ${showStatus() && isCorrect() === false || isSkipped() ? "border-2 border-red-850" : ""}`);
10363
10364
  set_attribute(textarea, "aria-label", get$1(ariaLabel));
10364
10365
  textarea.readOnly = readonly();
10365
10366
  textarea.disabled = disabled();
10367
+ set_attribute(textarea, "placeholder", get$1(typeinPlaceholder));
10366
10368
  },
10367
10369
  [
10368
- () => showStatus() && value() && value().trim() && isCorrect() !== null ? "pr-10" : ""
10370
+ () => showStatus() && value() && value().trim() && isCorrect() !== null || isSkipped() ? "pr-10" : ""
10369
10371
  ]
10370
10372
  );
10371
10373
  event("focus", textarea, handleFocus);
@@ -10386,8 +10388,8 @@ function TypeInTextField($$anchor, $$props) {
10386
10388
  var span_1 = root_5$2();
10387
10389
  var node_5 = child(span_1);
10388
10390
  {
10389
- let $0 = /* @__PURE__ */ user_derived(() => Boolean(isCorrect()));
10390
- let $1 = /* @__PURE__ */ user_derived(() => Boolean(isCorrect()) ? "text-green-700" : "text-red-850");
10391
+ let $0 = /* @__PURE__ */ user_derived(() => isSkipped() ? false : Boolean(isCorrect()));
10392
+ let $1 = /* @__PURE__ */ user_derived(() => !isSkipped() && Boolean(isCorrect()) ? "text-green-700" : "text-red-850");
10391
10393
  ResultIcon(node_5, {
10392
10394
  get isCorrect() {
10393
10395
  return get$1($0);
@@ -10401,15 +10403,16 @@ function TypeInTextField($$anchor, $$props) {
10401
10403
  append($$anchor3, span_1);
10402
10404
  };
10403
10405
  if_block(node_4, ($$render) => {
10404
- if (showStatus() && value() && value().trim() && isCorrect() !== null) $$render(consequent_3);
10406
+ if (showStatus() && value() && value().trim() && isCorrect() !== null || isSkipped()) $$render(consequent_3);
10405
10407
  });
10406
10408
  }
10407
10409
  reset(div_2);
10408
10410
  template_effect(() => {
10409
- 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" : ""}`);
10411
+ 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 || isSkipped() ? "border-2 border-red-850" : ""}`);
10410
10412
  set_attribute(input, "aria-label", get$1(ariaLabel));
10411
10413
  input.readOnly = readonly();
10412
10414
  input.disabled = disabled();
10415
+ set_attribute(input, "placeholder", get$1(typeinPlaceholder));
10413
10416
  });
10414
10417
  event("focus", input, handleFocus);
10415
10418
  event("blur", input, handleBlur);
@@ -11007,7 +11010,7 @@ function TypeInFeedback($$anchor, $$props) {
11007
11010
  }
11008
11011
  return false;
11009
11012
  })());
11010
- const showHasMultipleAnswers = /* @__PURE__ */ user_derived(() => feedbackState().showStatusLine && get$1(hasMultipleAnswers) && (config().variant === "short" || config().variant === "long"));
11013
+ const showHasMultipleAnswers = /* @__PURE__ */ user_derived(() => get$1(hasMultipleAnswers) && config().variant !== "inline" && (feedbackState().isSkipped || feedbackState().showStatusLine));
11011
11014
  const showFeedbackAlert = /* @__PURE__ */ user_derived(() => feedbackState().isFeedbackShown && !feedbackState().isSkipped && config().variant === "inline" && !!feedbackState().resultFeedback?.trim());
11012
11015
  const showInlineComparisonTable = /* @__PURE__ */ user_derived(() => feedbackState().showComparisonTable && config().variant === "inline");
11013
11016
  const feedbackIconType = /* @__PURE__ */ user_derived(() => isInteractiveMode2() && config().variant === "inline" ? "info" : "result");
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "eat-js-sdk",
3
- "version": "2.1.8",
4
- "change version": "2.1.0",
3
+ "version": "2.2.0",
4
+ "change version": "2.2.0",
5
5
  "description": "Authoring tool frontend SDK",
6
6
  "contributors": [
7
7
  {