eat-js-sdk 2.0.11 → 2.0.12

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.
@@ -1258,7 +1258,7 @@ function Oa(e) {
1258
1258
  const t = Nt(yi, null, !1);
1259
1259
  return Ve(t, ze), t.teardown = e, t;
1260
1260
  }
1261
- function Ae(e) {
1261
+ function Ie(e) {
1262
1262
  xs();
1263
1263
  var t = (
1264
1264
  /** @type {Effect} */
@@ -2066,7 +2066,7 @@ function br(e, t, ...r) {
2066
2066
  }, _r);
2067
2067
  }
2068
2068
  function Ps(e) {
2069
- Ye === null && ca(), Ae(() => {
2069
+ Ye === null && ca(), Ie(() => {
2070
2070
  const t = jt(e);
2071
2071
  if (typeof t == "function") return (
2072
2072
  /** @type {() => void} */
@@ -3978,9 +3978,9 @@ function Oi(e, t) {
3978
3978
  const v = { isModalOpen: !1, modalAriaLabel: "" };
3979
3979
  r(v), s(c)?.close(), i()?.(new CustomEvent("updateModalSettings", { detail: v })), a()?.();
3980
3980
  };
3981
- Ae(() => {
3981
+ Ie(() => {
3982
3982
  s(c) && s(c).open !== s(u) && (s(u) ? s(c).showModal() : s(c).close());
3983
- }), Ae(() => (s(u) ? document.body.style.overflow = "hidden" : document.body.style.overflow = "", () => {
3983
+ }), Ie(() => (s(u) ? document.body.style.overflow = "hidden" : document.body.style.overflow = "", () => {
3984
3984
  document.body.style.overflow = "";
3985
3985
  }));
3986
3986
  var d = {
@@ -4115,7 +4115,7 @@ function vo(e, t) {
4115
4115
  }
4116
4116
  };
4117
4117
  let G = /* @__PURE__ */ I(() => F.container[n()]), P = /* @__PURE__ */ I(() => F.arrow[n()]);
4118
- Ae(() => () => _());
4118
+ Ie(() => () => _());
4119
4119
  var N = {
4120
4120
  show: E,
4121
4121
  hide: M,
@@ -4472,15 +4472,15 @@ function bo(e, t) {
4472
4472
  }, $ = () => {
4473
4473
  r() && s(E) && s(d) && (P(), ie());
4474
4474
  };
4475
- Ae(() => {
4475
+ Ie(() => {
4476
4476
  s(c) && (A(g, "100%"), A(f, 0), A(m, 0), A(E, !1));
4477
4477
  });
4478
4478
  const ie = () => {
4479
4479
  s(v) && A(C, s(v).scrollHeight > s(v).clientHeight);
4480
4480
  };
4481
- Ae(() => {
4481
+ Ie(() => {
4482
4482
  s(h) && s(v) && Qt().then(ie);
4483
- }), Ae(() => {
4483
+ }), Ie(() => {
4484
4484
  i() !== void 0 && s(E) && Qt().then(ie);
4485
4485
  });
4486
4486
  const ae = (j) => {
@@ -4512,16 +4512,16 @@ function bo(e, t) {
4512
4512
  const ve = oe[j.key];
4513
4513
  ve && (ve(), j.preventDefault());
4514
4514
  };
4515
- Ae(() => {
4515
+ Ie(() => {
4516
4516
  r() && s(u) && A(k, ae(s(u)), !0);
4517
- }), Ae(() => {
4517
+ }), Ie(() => {
4518
4518
  r() && !s(M) && Qt().then(() => {
4519
4519
  const ve = window.innerWidth < Ke.MD;
4520
4520
  s(ve ? w : _)?.focus(), A(M, !0);
4521
4521
  });
4522
- }), Ae(() => {
4522
+ }), Ie(() => {
4523
4523
  r() || A(M, !1);
4524
- }), Ae(() => {
4524
+ }), Ie(() => {
4525
4525
  if (typeof window < "u")
4526
4526
  return window.addEventListener("keydown", ye), window.addEventListener("resize", $), () => {
4527
4527
  window.removeEventListener("keydown", ye), window.removeEventListener("resize", $);
@@ -4589,8 +4589,8 @@ function bo(e, t) {
4589
4589
  },
4590
4590
  onclick: H,
4591
4591
  children: (Te, Dt) => {
4592
- var Se = jl(), Ie = O(Se);
4593
- $e(Ie, {
4592
+ var Se = jl(), Ae = O(Se);
4593
+ $e(Ae, {
4594
4594
  svgName: "smallChevronLeft",
4595
4595
  className: "text-primary-emphasis",
4596
4596
  width: 12,
@@ -4613,8 +4613,8 @@ function bo(e, t) {
4613
4613
  },
4614
4614
  onclick: D,
4615
4615
  children: (Te, Dt) => {
4616
- var Se = ql(), Ie = O(Se);
4617
- $e(Ie, {
4616
+ var Se = ql(), Ae = O(Se);
4617
+ $e(Ae, {
4618
4618
  svgName: "smallChevronRight",
4619
4619
  className: "text-primary-emphasis",
4620
4620
  width: 12,
@@ -4636,7 +4636,7 @@ function bo(e, t) {
4636
4636
  return s(h);
4637
4637
  },
4638
4638
  children: (Dt, Se) => {
4639
- var Ie = Ul(), qr = O(Ie), Ar = O(qr);
4639
+ var Ae = Ul(), qr = O(Ae), Ar = O(qr);
4640
4640
  {
4641
4641
  let Ft = /* @__PURE__ */ I(() => s(u)?.answer);
4642
4642
  Wt(Ar, {
@@ -4645,9 +4645,9 @@ function bo(e, t) {
4645
4645
  }
4646
4646
  });
4647
4647
  }
4648
- R(qr), R(Ie), zt(Ie, (Ft) => A(v, Ft), () => s(v)), te(() => {
4649
- K(Ie, "tabindex", s(C) ? 0 : void 0), K(Ie, "aria-label", s(C) ? s(h) : void 0), le(Ie, 1, `break-all text-sm md:text-lg font-semibold text-primary-emphasis ${s(C) ? "hover:text-charcoal hover:underline hover:decoration-2 hover:underline-offset-[25%] focus-visible:bg-yellow-900 focus-visible:outline-none focus-visible:underline focus-visible:decoration-2 focus-visible:underline-offset-[25%] focus-visible:text-charcoal coarse:active:bg-yellow-900" : ""} select-none line-clamp-1`);
4650
- }), L(Dt, Ie);
4648
+ R(qr), R(Ae), zt(Ae, (Ft) => A(v, Ft), () => s(v)), te(() => {
4649
+ K(Ae, "tabindex", s(C) ? 0 : void 0), K(Ae, "aria-label", s(C) ? s(h) : void 0), le(Ae, 1, `break-all text-sm md:text-lg font-semibold text-primary-emphasis ${s(C) ? "hover:text-charcoal hover:underline hover:decoration-2 hover:underline-offset-[25%] focus-visible:bg-yellow-900 focus-visible:outline-none focus-visible:underline focus-visible:decoration-2 focus-visible:underline-offset-[25%] focus-visible:text-charcoal coarse:active:bg-yellow-900" : ""} select-none line-clamp-1`);
4650
+ }), L(Dt, Ae);
4651
4651
  },
4652
4652
  $$slots: { default: !0 }
4653
4653
  });
@@ -4693,8 +4693,8 @@ function bo(e, t) {
4693
4693
  },
4694
4694
  onclick: H,
4695
4695
  children: (Te, Dt) => {
4696
- var Se = Yl(), Ie = O(Se);
4697
- $e(Ie, {
4696
+ var Se = Yl(), Ae = O(Se);
4697
+ $e(Ae, {
4698
4698
  svgName: "smallChevronLeft",
4699
4699
  className: "text-primary-emphasis",
4700
4700
  height: 7.43
@@ -4715,8 +4715,8 @@ function bo(e, t) {
4715
4715
  },
4716
4716
  onclick: D,
4717
4717
  children: (Te, Dt) => {
4718
- var Se = Zl(), Ie = O(Se);
4719
- $e(Ie, {
4718
+ var Se = Zl(), Ae = O(Se);
4719
+ $e(Ae, {
4720
4720
  svgName: "smallChevronRight",
4721
4721
  className: "text-primary-emphasis",
4722
4722
  height: 7.43
@@ -4905,13 +4905,13 @@ function ko(e, t) {
4905
4905
  }, E = (N) => {
4906
4906
  N.detail.isModalOpen || _();
4907
4907
  };
4908
- Ae(() => {
4908
+ Ie(() => {
4909
4909
  r() && s(u)?.complete && Qt().then(() => w());
4910
- }), Ae(() => {
4910
+ }), Ie(() => {
4911
4911
  r() && a() !== void 0 && Qt().then(() => w());
4912
- }), Ae(() => {
4912
+ }), Ie(() => {
4913
4913
  r() && i() && a() ? A(v, `Graphic, ${i()}. ${a()}`) : r() && i() ? A(v, `Graphic, ${i()}`) : r() && a() ? A(v, `Image viewer. ${a()}`) : r() && A(v, "Image viewer");
4914
- }), Ae(() => {
4914
+ }), Ie(() => {
4915
4915
  if (typeof window < "u")
4916
4916
  return window.addEventListener("resize", b), () => {
4917
4917
  window.removeEventListener("resize", b), S && cancelAnimationFrame(S);
@@ -5145,7 +5145,7 @@ function uc(e) {
5145
5145
  A(t, !0);
5146
5146
  });
5147
5147
  };
5148
- return Ae(() => {
5148
+ return Ie(() => {
5149
5149
  n();
5150
5150
  }), {
5151
5151
  get isLoaded() {
@@ -5788,14 +5788,14 @@ function Fi(e, t) {
5788
5788
  {
5789
5789
  var Te = (Se) => {
5790
5790
  Co(Se, {
5791
- children: (Ie, qr) => {
5791
+ children: (Ae, qr) => {
5792
5792
  var Ar = xe(), Ft = ce(Ar);
5793
- br(Ft, () => u() ?? Pe), L(Ie, Ar);
5793
+ br(Ft, () => u() ?? Pe), L(Ae, Ar);
5794
5794
  },
5795
5795
  $$slots: { default: !0 }
5796
5796
  });
5797
5797
  }, Dt = (Se) => {
5798
- var Ie = xe(), qr = ce(Ie);
5798
+ var Ae = xe(), qr = ce(Ae);
5799
5799
  {
5800
5800
  var Ar = (Ft) => {
5801
5801
  var Bn = Ec(), $o = O(Bn);
@@ -5809,7 +5809,7 @@ function Fi(e, t) {
5809
5809
  !0
5810
5810
  );
5811
5811
  }
5812
- L(Se, Ie);
5812
+ L(Se, Ae);
5813
5813
  };
5814
5814
  W(
5815
5815
  zn,
@@ -7324,7 +7324,7 @@ function Fo(e, t) {
7324
7324
  const o = r().hasExistingState?.() ? r().restoreState?.() : r().createInitialState?.();
7325
7325
  if (!o?.data) throw new Error("Failed to initialize TypeIn state");
7326
7326
  let l = /* @__PURE__ */ V(vt(o)), u = /* @__PURE__ */ I(() => Mo(s(l), n())), c = /* @__PURE__ */ I(() => s(u).answers), p = /* @__PURE__ */ I(() => s(u).mode), h = /* @__PURE__ */ I(() => s(p) === fe.INTERACTIVE), d = /* @__PURE__ */ V("");
7327
- Ae(() => {
7327
+ Ie(() => {
7328
7328
  s(d) === "" && A(
7329
7329
  d,
7330
7330
  n().variant === "inline" ? JSON.stringify(s(l).data.inlineInputs) : s(l).data.userInput,
@@ -7343,9 +7343,9 @@ function Fo(e, t) {
7343
7343
  };
7344
7344
  };
7345
7345
  let v = /* @__PURE__ */ I(() => Qc(s(l), n(), g)), C = /* @__PURE__ */ V(""), k = /* @__PURE__ */ V(vt([])), _ = /* @__PURE__ */ V(!1);
7346
- Ae(() => {
7346
+ Ie(() => {
7347
7347
  s(_) || A(C, s(l).data.userInput || "", !0);
7348
- }), Ae(() => {
7348
+ }), Ie(() => {
7349
7349
  s(_) || A(k, [...s(l).data.inlineInputs], !0);
7350
7350
  });
7351
7351
  const w = () => {
@@ -7826,10 +7826,23 @@ const ku = {
7826
7826
  };
7827
7827
  function Su(e, t) {
7828
7828
  pe(t, !0), js(e, ku);
7829
- let r = y(t, "session-id", 7), n = y(t, "item-id", 7), i = y(t, "interactive-mode", 7), a = y(t, "preview-mode", 7), o = /* @__PURE__ */ V(null), l = /* @__PURE__ */ V(null), u = /* @__PURE__ */ V(!0), c = /* @__PURE__ */ V(null), p = /* @__PURE__ */ V(null), h = /* @__PURE__ */ V(null), d = /* @__PURE__ */ V(!1), f = /* @__PURE__ */ I(() => i() === "true" ? fe.INTERACTIVE : a() === "true" ? fe.PREVIEW : fe.SESSION);
7829
+ let r = y(t, "session-id", 7), n = y(t, "item-id", 7), i = y(t, "interactive-mode", 7), a = y(t, "preview-mode", 7);
7830
+ Ie(() => {
7831
+ console.log("InteractionBuilder props:", {
7832
+ sessionId: r(),
7833
+ itemId: n(),
7834
+ interactiveMode: i(),
7835
+ previewMode: a(),
7836
+ mode: s(
7837
+ f
7838
+ // derived value
7839
+ )
7840
+ });
7841
+ });
7842
+ let o = /* @__PURE__ */ V(null), l = /* @__PURE__ */ V(null), u = /* @__PURE__ */ V(!0), c = /* @__PURE__ */ V(null), p = /* @__PURE__ */ V(null), h = /* @__PURE__ */ V(null), d = /* @__PURE__ */ V(!1), f = /* @__PURE__ */ I(() => i() === "true" ? fe.INTERACTIVE : a() === "true" ? fe.PREVIEW : fe.SESSION);
7830
7843
  wl();
7831
7844
  let m = /* @__PURE__ */ I(() => Vr(Li) ? "?skip_user_validation=true" : "");
7832
- Ae(() => {
7845
+ Ie(() => {
7833
7846
  if (s(f) === fe.SESSION && !r()) {
7834
7847
  A(c, "No session ID provided for session mode"), A(u, !1);
7835
7848
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eat-js-sdk",
3
- "version": "2.0.11",
3
+ "version": "2.0.12",
4
4
  "change version": "2.0.0",
5
5
  "description": "Authoring tool frontend SDK",
6
6
  "contributors": [