eat-js-sdk 2.0.57 → 2.0.59

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.
@@ -5296,8 +5296,9 @@ const generatePreviewScoringMetadata = (data) => {
5296
5296
  return null;
5297
5297
  };
5298
5298
  const loadSessionData = async (sessionId, mode) => {
5299
- const skipUserValidationStr = get(skipUserValidation) ? "?skip_user_validation=true" : "";
5300
- const { data: session } = await useGet(`sessions/${sessionId}${skipUserValidationStr}`);
5299
+ get(skipUserValidation) ? "?skip_user_validation=true" : "";
5300
+ const includeHtmlTags = "?include=[html_tags]";
5301
+ const { data: session } = await useGet(`sessions/${sessionId}/item${includeHtmlTags}`);
5301
5302
  if (!session) {
5302
5303
  throw new Error(`No session data found for session ID: ${sessionId}`);
5303
5304
  }
@@ -5306,13 +5307,12 @@ const loadSessionData = async (sessionId, mode) => {
5306
5307
  metadata,
5307
5308
  is_finished: isFinished,
5308
5309
  is_locked: isLocked,
5309
- total_correct_answers: totalCorrectAnswers
5310
+ total_correct_answers: totalCorrectAnswers,
5311
+ item
5310
5312
  } = session;
5311
5313
  if (!itemId) {
5312
5314
  throw new Error("No item ID found in session");
5313
5315
  }
5314
- const includeAnswer = `?include=[html_tags${isFinished && isLocked ? ",correct_answer" : ""}]`;
5315
- const { data: item } = await useGet(`items/${itemId}${includeAnswer}`);
5316
5316
  return {
5317
5317
  ...item,
5318
5318
  sessionId,
@@ -15756,7 +15756,7 @@ var root_2$1 = /* @__PURE__ */ from_html(`<button aria-label="Reset words" class
15756
15756
  text-blue-1000 px-3 py-2 absolute right-0 -top-2.5 hover:bg-blue-100"><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>`);
15757
15757
  var root_1$4 = /* @__PURE__ */ from_html(
15758
15758
  `<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
15759
- 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 class="sr-only" role="status" aria-live="polite" aria-atomic="true" 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> <span tabindex="-1" class="sr-only"></span> <!> <!> <!></div>`,
15759
+ 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 class="sr-only" role="status" aria-live="polite" aria-atomic="true" 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>`,
15760
15760
  1
15761
15761
  );
15762
15762
  function CategoriseComponent($$anchor, $$props) {
@@ -15775,7 +15775,6 @@ function CategoriseComponent($$anchor, $$props) {
15775
15775
  let dragHoverContainerId = /* @__PURE__ */ state(null);
15776
15776
  let dragSourceContainerId = /* @__PURE__ */ state(null);
15777
15777
  let announcement = /* @__PURE__ */ state("");
15778
- let srOnlyFocusTrapRef = /* @__PURE__ */ state(void 0);
15779
15778
  let srDivRef = /* @__PURE__ */ state(void 0);
15780
15779
  let skipToWordBinRef = /* @__PURE__ */ state(void 0);
15781
15780
  let wordBinRef = /* @__PURE__ */ state(void 0);
@@ -15990,9 +15989,6 @@ function CategoriseComponent($$anchor, $$props) {
15990
15989
  }
15991
15990
  await playDropAnimation(containerId);
15992
15991
  await tick();
15993
- if (get$1(srOnlyFocusTrapRef)) {
15994
- get$1(srOnlyFocusTrapRef).focus();
15995
- }
15996
15992
  };
15997
15993
  const handleNavigateItem = (direction) => {
15998
15994
  const result = useNavigateItem(
@@ -16267,9 +16263,7 @@ function CategoriseComponent($$anchor, $$props) {
16267
16263
  });
16268
16264
  }
16269
16265
  reset(div_2);
16270
- var span_2 = sibling(div_2, 2);
16271
- bind_this(span_2, ($$value) => set(srOnlyFocusTrapRef, $$value), () => get$1(srOnlyFocusTrapRef));
16272
- var node_3 = sibling(span_2, 2);
16266
+ var node_3 = sibling(div_2, 2);
16273
16267
  {
16274
16268
  let $02 = /* @__PURE__ */ user_derived(() => !!config().stimulus);
16275
16269
  CategoriseCategoryList(node_3, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eat-js-sdk",
3
- "version": "2.0.57",
3
+ "version": "2.0.59",
4
4
  "change version": "2.0.2",
5
5
  "description": "Authoring tool frontend SDK",
6
6
  "contributors": [