@liforma/client 0.4.6 → 0.4.8
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/CHANGELOG.md +24 -0
- package/README.md +23 -0
- package/dist/next/index.js +18 -2
- package/dist/next/index.js.map +1 -1
- package/dist/next/next/thumbnail.d.ts +5 -0
- package/dist/next/next/thumbnail.d.ts.map +1 -0
- package/dist/next/react/thumbnail.d.ts +4 -0
- package/dist/next/react/thumbnail.d.ts.map +1 -0
- package/dist/next/thumbnail.js +396 -0
- package/dist/next/thumbnail.js.map +1 -0
- package/dist/next/v2/embed/iframeHost.d.ts +1 -0
- package/dist/next/v2/embed/iframeHost.d.ts.map +1 -1
- package/dist/next/v2/embed/protocol.d.ts +6 -0
- package/dist/next/v2/embed/protocol.d.ts.map +1 -1
- package/dist/next/v2/experience.d.ts +3 -0
- package/dist/next/v2/experience.d.ts.map +1 -1
- package/dist/next/v2/experienceEvents.d.ts +2 -0
- package/dist/next/v2/experienceEvents.d.ts.map +1 -1
- package/dist/npm/index.js +18 -2
- package/dist/npm/index.js.map +1 -1
- package/dist/npm/thumbnail/index.js +231 -0
- package/dist/npm/thumbnail/index.js.map +1 -0
- package/dist/npm/v2/embed/iframeHost.d.ts +1 -0
- package/dist/npm/v2/embed/iframeHost.d.ts.map +1 -1
- package/dist/npm/v2/embed/protocol.d.ts +6 -0
- package/dist/npm/v2/embed/protocol.d.ts.map +1 -1
- package/dist/npm/v2/experience.d.ts +3 -0
- package/dist/npm/v2/experience.d.ts.map +1 -1
- package/dist/npm/v2/experienceEvents.d.ts +2 -0
- package/dist/npm/v2/experienceEvents.d.ts.map +1 -1
- package/dist/npm/v2/thumbnail-cdn.d.ts +17 -0
- package/dist/npm/v2/thumbnail-cdn.d.ts.map +1 -0
- package/dist/react/component/experienceComponentTypes.d.ts +3 -0
- package/dist/react/component/experienceComponentTypes.d.ts.map +1 -1
- package/dist/react/index.js +19 -2
- package/dist/react/index.js.map +1 -1
- package/dist/react/react/Experience.d.ts.map +1 -1
- package/dist/react/react/thumbnail.d.ts +4 -0
- package/dist/react/react/thumbnail.d.ts.map +1 -0
- package/dist/react/thumbnail.js +396 -0
- package/dist/react/thumbnail.js.map +1 -0
- package/dist/react/v2/embed/iframeHost.d.ts +1 -0
- package/dist/react/v2/embed/iframeHost.d.ts.map +1 -1
- package/dist/react/v2/embed/protocol.d.ts +6 -0
- package/dist/react/v2/embed/protocol.d.ts.map +1 -1
- package/dist/react/v2/experience.d.ts +3 -0
- package/dist/react/v2/experience.d.ts.map +1 -1
- package/dist/react/v2/experienceEvents.d.ts +2 -0
- package/dist/react/v2/experienceEvents.d.ts.map +1 -1
- package/dist/sdk/v2/client.js +3 -810
- package/dist/sdk/v2/client.js.map +1 -1
- package/dist/sdk/v2/thumbnail.js +222 -0
- package/dist/sdk/v2/thumbnail.js.map +1 -0
- package/dist/svelte/Experience.svelte +9 -0
- package/dist/svelte/Experience.svelte.d.ts +1 -0
- package/dist/svelte/ExperienceThumbnail.svelte +1 -1
- package/dist/svelte/ExperienceThumbnail.svelte.d.ts +1 -1
- package/dist/svelte/thumbnail.d.ts +2 -0
- package/dist/svelte/thumbnail.js +1 -0
- package/package.json +24 -6
package/dist/react/index.js
CHANGED
|
@@ -395,6 +395,7 @@ var te = e(function(e, a) {
|
|
|
395
395
|
focusCharacter: (e) => R.current.withSession((t) => t.focusCharacter(e)),
|
|
396
396
|
setFit: (e) => R.current.withSession((t) => t.setFit(e)),
|
|
397
397
|
conversion: (e) => R.current.withSession((t) => t.conversion(e)),
|
|
398
|
+
engage: () => R.current.withSession((e) => e.engage()),
|
|
398
399
|
end: () => R.current.withSession((e) => e.end())
|
|
399
400
|
}), []), i(() => {
|
|
400
401
|
if (!B || !se.current) return;
|
|
@@ -1787,6 +1788,13 @@ function Mt(e) {
|
|
|
1787
1788
|
}
|
|
1788
1789
|
});
|
|
1789
1790
|
},
|
|
1791
|
+
engage() {
|
|
1792
|
+
return C({
|
|
1793
|
+
type: "engage",
|
|
1794
|
+
schemaVersion: 2,
|
|
1795
|
+
payload: { correlationId: Z() }
|
|
1796
|
+
});
|
|
1797
|
+
},
|
|
1790
1798
|
destroy() {
|
|
1791
1799
|
if (!r) {
|
|
1792
1800
|
r = !0, i && s(!1);
|
|
@@ -1860,6 +1868,7 @@ function Wt() {
|
|
|
1860
1868
|
return {
|
|
1861
1869
|
ready: /* @__PURE__ */ new Set(),
|
|
1862
1870
|
started: /* @__PURE__ */ new Set(),
|
|
1871
|
+
sessionMinted: /* @__PURE__ */ new Set(),
|
|
1863
1872
|
userTranscript: /* @__PURE__ */ new Set(),
|
|
1864
1873
|
userSpeechStarted: /* @__PURE__ */ new Set(),
|
|
1865
1874
|
userSpeechEnded: /* @__PURE__ */ new Set(),
|
|
@@ -2536,6 +2545,7 @@ var An = class e {
|
|
|
2536
2545
|
eventRegistry = Wt();
|
|
2537
2546
|
readyEnvelope = null;
|
|
2538
2547
|
startedEnvelope = null;
|
|
2548
|
+
sessionMintedEnvelope = null;
|
|
2539
2549
|
conversationCache = [];
|
|
2540
2550
|
speech;
|
|
2541
2551
|
constructor(e) {
|
|
@@ -2624,7 +2634,7 @@ var An = class e {
|
|
|
2624
2634
|
}
|
|
2625
2635
|
on(e, t) {
|
|
2626
2636
|
let n = Gt(this.eventRegistry, e, t);
|
|
2627
|
-
return e === "ready" && this.readyEnvelope && queueMicrotask(() => t(this.readyEnvelope)), e === "started" && this.startedEnvelope && queueMicrotask(() => t(this.startedEnvelope)), n;
|
|
2637
|
+
return e === "ready" && this.readyEnvelope && queueMicrotask(() => t(this.readyEnvelope)), e === "started" && this.startedEnvelope && queueMicrotask(() => t(this.startedEnvelope)), e === "sessionMinted" && this.sessionMintedEnvelope && queueMicrotask(() => t(this.sessionMintedEnvelope)), n;
|
|
2628
2638
|
}
|
|
2629
2639
|
async attach(e) {
|
|
2630
2640
|
if (this.closed) throw Error("Session has ended.");
|
|
@@ -2740,7 +2750,9 @@ var An = class e {
|
|
|
2740
2750
|
f.postParentHello();
|
|
2741
2751
|
let g = h?.launch ?? (this.bootstrap.kind === "launch" ? this.bootstrap.launch : null), _ = h?.session ?? (this.bootstrap.kind === "launch" ? this.bootstrap.session : void 0);
|
|
2742
2752
|
if (!g) throw f.destroy(), this.iframeHost === f && (this.iframeHost = null), Error("Session Launch response did not include a launch token.");
|
|
2743
|
-
|
|
2753
|
+
this.launchToken = g;
|
|
2754
|
+
let v = _ ?? (this.bootstrap.kind === "launch" ? this.bootstrap.session : void 0);
|
|
2755
|
+
return v && !this.sessionMintedEnvelope && (this.resolvedSession = v, this.sessionMintedEnvelope = this.emitWrapped("sessionMinted", { session: v })), _ ? (this.resolvedSession = _, this.bootstrap.kind === "launch" && tt(_), f.postLaunch(g, _, {
|
|
2744
2756
|
startButton: e.startButton,
|
|
2745
2757
|
theme: e.theme,
|
|
2746
2758
|
showFeedback: e.showFeedback
|
|
@@ -2786,6 +2798,11 @@ var An = class e {
|
|
|
2786
2798
|
if (!this.iframeHost) throw Error("conversion() requires attach() first.");
|
|
2787
2799
|
await this.iframeHost.conversion(e);
|
|
2788
2800
|
}
|
|
2801
|
+
async engage() {
|
|
2802
|
+
if (this.closed) throw Error("Session has ended.");
|
|
2803
|
+
if (!this.iframeHost) throw Error("engage() requires attach() first.");
|
|
2804
|
+
await this.iframeHost.engage();
|
|
2805
|
+
}
|
|
2789
2806
|
getLastTurn() {
|
|
2790
2807
|
if (this.conversationCache.length === 0) return [];
|
|
2791
2808
|
let e = this.conversationCache[this.conversationCache.length - 1].turnId;
|