@nlxai/touchpoint-ui 1.1.8-alpha.4 → 1.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.
@@ -1,2 +1,4 @@
1
1
  import { FC } from 'react';
2
- export declare const RiveAnimation: FC<unknown>;
2
+ export declare const RiveAnimation: FC<{
3
+ restored: boolean;
4
+ }>;
package/lib/index.js CHANGED
@@ -5997,7 +5997,7 @@ var mw = /* @__PURE__ */ Cp(/* @__PURE__ */ Z0([], pw, function(n, e) {
5997
5997
  l = e[o], a = n(l), t.add(a) && r.push(l), o += 1;
5998
5998
  return r;
5999
5999
  })), gw = /* @__PURE__ */ mw(uw);
6000
- const vw = "1.1.8-alpha.4", yw = {
6000
+ const vw = "1.2.0", yw = {
6001
6001
  version: vw
6002
6002
  };
6003
6003
  var wn = typeof globalThis < "u" && globalThis || typeof self < "u" && self || // eslint-disable-next-line no-undef
@@ -26800,7 +26800,7 @@ const EE = (n) => n instanceof HTMLTextAreaElement ? { value: n.value } : n.type
26800
26800
  uri: window.location.pathname,
26801
26801
  fields: e,
26802
26802
  destinations: r,
26803
- actions: n.map((l) => {
26803
+ actions: n.filter((l) => l.description != null).map((l) => {
26804
26804
  const { handler: d, ...h } = l;
26805
26805
  return h;
26806
26806
  })
@@ -26877,13 +26877,9 @@ const EE = (n) => n instanceof HTMLTextAreaElement ? { value: n.value } : n.type
26877
26877
  });
26878
26878
  break;
26879
26879
  case "custom":
26880
- if (t.current.customCommands.has(o.action)) {
26881
- const a = t.current.customCommands.get(
26882
- o.action
26883
- );
26884
- o.payload != null && a(o.payload);
26885
- }
26886
- (e == null ? void 0 : e.custom) != null && (e.automaticContext !== !1 && console.warn(
26880
+ t.current.customCommands.has(o.action) && t.current.customCommands.get(
26881
+ o.action
26882
+ )(o.payload), (e == null ? void 0 : e.custom) != null && (e.automaticContext !== !1 && console.warn(
26887
26883
  "bidirectional.custom is deprecated in automatic context mode. Please use `setCustomBidirectionalCommands` instead."
26888
26884
  ), e.custom(o.action, o.payload));
26889
26885
  break;
@@ -32382,15 +32378,15 @@ function jE(n, e) {
32382
32378
  const t = getComputedStyle(e).getPropertyValue("border-color"), r = e.getContext("2d");
32383
32379
  return r ? (r.fillStyle = t, r.fillRect(0, 0, 1, 1), e.style.display = "none", [...r.getImageData(0, 0, 1, 1).data]) : [0, 0, 0, 255];
32384
32380
  }
32385
- const UE = () => {
32386
- const n = Se.useRef(null), e = Se.useRef(null);
32381
+ const UE = ({ restored: n }) => {
32382
+ const e = Se.useRef(null), t = Se.useRef(null);
32387
32383
  return Se.useEffect(() => {
32388
- const t = e.current, r = n.current;
32389
- if (t == null || r == null)
32384
+ const r = t.current, o = e.current;
32385
+ if (r == null || o == null)
32390
32386
  return;
32391
- const o = new Sh.Rive({
32387
+ const a = new Sh.Rive({
32392
32388
  src: "https://assets.nlx.ai/touchpoint/voice-plus-animation.riv",
32393
- canvas: t,
32389
+ canvas: r,
32394
32390
  autoBind: !0,
32395
32391
  autoplay: !0,
32396
32392
  stateMachines: "State Machine 1",
@@ -32398,26 +32394,26 @@ const UE = () => {
32398
32394
  fit: Sh.Fit.Fill
32399
32395
  }),
32400
32396
  onLoad: () => {
32401
- o.resizeDrawingSurfaceToCanvas();
32402
- const l = o.viewModelInstance;
32403
- if (l != null) {
32404
- const d = l.trigger("run"), h = l.color("color");
32405
- h == null || h.rgba(...jE("var(--accent)", r)), d != null && d.trigger();
32397
+ a.resizeDrawingSurfaceToCanvas();
32398
+ const d = a.viewModelInstance;
32399
+ if (d != null) {
32400
+ const h = d.trigger("run"), m = d.trigger("runNoWave"), g = d.color("color"), T = d.number("voiceInput");
32401
+ T != null && (T.value = 100), g == null || g.rgba(...jE("var(--accent)", o)), n ? m == null || m.trigger() : h == null || h.trigger();
32406
32402
  }
32407
32403
  }
32408
- }), a = () => {
32409
- o.resizeDrawingSurfaceToCanvas();
32404
+ }), l = () => {
32405
+ a.resizeDrawingSurfaceToCanvas();
32410
32406
  };
32411
- return window.addEventListener("resize", a, !1), () => {
32412
- o.cleanup(), window.removeEventListener("resize", a, !1);
32407
+ return window.addEventListener("resize", l, !1), () => {
32408
+ a.cleanup(), window.removeEventListener("resize", l, !1);
32413
32409
  };
32414
- }, []), /* @__PURE__ */ R.jsxs(R.Fragment, { children: [
32415
- /* @__PURE__ */ R.jsx("canvas", { ref: n, width: "1", height: "1" }),
32410
+ }, [n]), /* @__PURE__ */ R.jsxs(R.Fragment, { children: [
32411
+ /* @__PURE__ */ R.jsx("canvas", { ref: e, width: "1", height: "1" }),
32416
32412
  /* @__PURE__ */ R.jsx(
32417
32413
  "canvas",
32418
32414
  {
32419
32415
  className: "pointer-events-none fixed inset-0",
32420
- ref: e,
32416
+ ref: t,
32421
32417
  style: { width: "100%", height: "100%" }
32422
32418
  }
32423
32419
  )
@@ -32573,7 +32569,7 @@ const UE = () => {
32573
32569
  n.embedded ? "" : "fixed z-touchpoint bottom-2 right-2"
32574
32570
  ),
32575
32571
  children: [
32576
- n.animate ? /* @__PURE__ */ R.jsx(UE, {}) : null,
32572
+ n.animate ? /* @__PURE__ */ R.jsx(UE, { restored: t }) : null,
32577
32573
  /* @__PURE__ */ R.jsx(
32578
32574
  D_,
32579
32575
  {