@liforma/client 0.4.5 → 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 +36 -0
- package/README.md +23 -0
- package/dist/next/index.js +23 -4
- 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 +3 -1
- package/dist/next/v2/embed/iframeHost.d.ts.map +1 -1
- package/dist/next/v2/embed/protocol.d.ts +10 -1
- package/dist/next/v2/embed/protocol.d.ts.map +1 -1
- package/dist/next/v2/experience.d.ts +10 -2
- 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/next/v2/types/sessionInteraction.d.ts +30 -0
- package/dist/next/v2/types/sessionInteraction.d.ts.map +1 -1
- package/dist/npm/index.js +23 -4
- 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 +3 -1
- package/dist/npm/v2/embed/iframeHost.d.ts.map +1 -1
- package/dist/npm/v2/embed/protocol.d.ts +10 -1
- package/dist/npm/v2/embed/protocol.d.ts.map +1 -1
- package/dist/npm/v2/experience.d.ts +10 -2
- 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/index.d.ts +1 -1
- package/dist/npm/v2/index.d.ts.map +1 -1
- package/dist/npm/v2/npm.d.ts +1 -1
- package/dist/npm/v2/npm.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/npm/v2/types/sessionInteraction.d.ts +30 -0
- package/dist/npm/v2/types/sessionInteraction.d.ts.map +1 -1
- package/dist/react/component/experienceComponentRuntime.d.ts +1 -0
- package/dist/react/component/experienceComponentRuntime.d.ts.map +1 -1
- package/dist/react/component/experienceComponentTypes.d.ts +8 -0
- package/dist/react/component/experienceComponentTypes.d.ts.map +1 -1
- package/dist/react/index.js +119 -96
- 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 +3 -1
- package/dist/react/v2/embed/iframeHost.d.ts.map +1 -1
- package/dist/react/v2/embed/protocol.d.ts +10 -1
- package/dist/react/v2/embed/protocol.d.ts.map +1 -1
- package/dist/react/v2/experience.d.ts +10 -2
- 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/react/v2/types/sessionInteraction.d.ts +30 -0
- package/dist/react/v2/types/sessionInteraction.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 +11 -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
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
(function(){function e(e){return e===`face`?`liforma-et--fit-face`:e===`medium`?`liforma-et--fit-medium`:``}var t=/(\/avatars\/[^/]+\/)(\d+)(\/)/i,n=/_CH(\.webp)/i,r=/(-)(\d+x\d+)(\.webp)(\?|$)/i;function i(e){let i=e.trim();if(!i)return i;let a=i.replace(t,(e,t,n,r)=>n===`256`?`${t}${n}${r}`:`${t}256${r}`);return a=a.replace(n,`_neutral$1`),a=a.replace(r,(e,t,n,r,i)=>n===`256x256`?`${t}${n}${r}${i}`:`${t}256x256${r}${i}`),a}function a(e){let t=e.avatarImage?.trim()||e.galleryThumb?.avatarImage?.trim()||``;if(!t)return null;let n=e.backgroundImage?.trim()||e.galleryThumb?.backgroundImage?.trim()||``,r=e.foregroundImage?.trim()||e.galleryThumb?.foregroundImage?.trim()||``,a=e.fallbackImage?.trim()||``;return{avatarImage:i(t),...n?{backgroundImage:i(n)}:{},...r?{foregroundImage:i(r)}:{},...a?{fallbackImage:i(a)}:{}}}function o(){if(globalThis.__LIFORMA_STACK===`local`)return!0;if(typeof location>`u`)return!1;try{return new URLSearchParams(location.search).get(`stack`)===`local`}catch{return!1}}var s=`https://player.liforma.ai`,c=`http://localhost:3002`;function l(e){return e.href?.trim()?`anchor`:e.hasClickHandler?`button`:e.experienceId?.trim()?`anchor`:`presentational`}function u(e){let t=e?.trim();return t?t.replace(/\/$/,``):o()?c:s}function d(e){let t=e.experienceId.trim(),n=u(e.playerBaseUrl),r=new URL(`${n}/${encodeURIComponent(t)}`),i=e.returnUrl?.trim();return i&&r.searchParams.set(`returnUrl`,i),r.toString()}function f(e){let t=e.href?.trim();if(t)return t;let n=e.experienceId?.trim();if(!n)return;let r=e.returnUrl?.trim();return!r&&e.useCurrentPageAsReturnUrl&&typeof window<`u`&&(r=window.location.href),d({experienceId:n,...r?{returnUrl:r}:{},playerBaseUrl:e.playerBaseUrl})}function p(){return typeof window>`u`?!1:window.matchMedia(`(hover: none), (pointer: coarse)`).matches}var m=0,h=[];function g(){return p()?4:1/0}function _(){return p()?160:0}function v(){let e=g();for(;m<e&&h.length>0;){let e=h.shift();if(!e||e.cancelled)continue;m+=1,e.start();let t=_();if(t<=0){m=Math.max(0,m-1);continue}window.setTimeout(()=>{m=Math.max(0,m-1),v()},t)}}function y(e){if(!p())return e(),()=>{};let t={start:e,cancelled:!1};return h.push(t),v(),()=>{t.cancelled=!0}}function b(){return p()?`96px 0px`:`280px 0px`}function x(e){let t=e.trim().split(/\s+/)[0]??`0px`,n=Number.parseFloat(t);return Number.isFinite(n)?Math.abs(n):280}function S(e,t){if(typeof window>`u`)return!1;let n=e.getBoundingClientRect();return n.bottom>=-t&&n.top<=window.innerHeight+t}function C(e,t){let{onVisibleChange:n}=t,r=t.rootMargin??b(),i=x(r),a=!1,o=!1,s=null,c=()=>{o||(s?.(),s=y(()=>{s=null,o=!0,n(!0)}))},l=e=>{if(e!==a){if(a=e,e){c();return}s?.(),s=null,n(!1)}};if(typeof IntersectionObserver>`u`)return c(),()=>{s?.(),s=null};let u=new IntersectionObserver(e=>{l(e.some(e=>e.isIntersecting))},{root:null,rootMargin:r,threshold:0});return u.observe(e),S(e,i)&&l(!0),()=>{s?.(),s=null,u.disconnect()}}function w(e,t){let n=()=>t();return e.complete?queueMicrotask(n):(e.addEventListener(`load`,n,{once:!0}),e.addEventListener(`error`,n,{once:!0})),()=>{e.removeEventListener(`load`,n),e.removeEventListener(`error`,n)}}function T(){return typeof window>`u`||window.matchMedia(`(prefers-reduced-motion: reduce)`).matches?!1:window.matchMedia(`(hover: none), (pointer: coarse)`).matches}function E(e,t){return((e.top+e.height/2)/Math.max(t,1)-.5)*2}var D=new Set,O=!1,k=0;function A(){if(k=0,D.size===0||typeof window>`u`)return;let e=window.innerHeight;for(let t of D){if(t.pointerActive?.())continue;let n=t.element.getBoundingClientRect();n.bottom<-64||n.top>e+64||t.onParallax(E(n,e))}}function j(){k===0&&(k=requestAnimationFrame(A))}function M(){O||typeof window>`u`||(O=!0,window.addEventListener(`scroll`,j,{passive:!0}),window.addEventListener(`resize`,j,{passive:!0}))}function N(){D.size>0||!O||typeof window>`u`||(O=!1,k!==0&&(cancelAnimationFrame(k),k=0),window.removeEventListener(`scroll`,j),window.removeEventListener(`resize`,j))}function P(e,t){if(!T())return()=>{};let n={element:e,onParallax:t.onParallax,pointerActive:t.pointerActive};return D.add(n),M(),n.pointerActive?.()||t.onParallax(E(e.getBoundingClientRect(),window.innerHeight)),()=>{D.delete(n),N()}}var F=`.liforma-et {
|
|
2
|
+
--liforma-et-parallax-x: 0;
|
|
3
|
+
--liforma-et-parallax-y: 0;
|
|
4
|
+
--liforma-et-bg-scale: 1;
|
|
5
|
+
--liforma-et-fg-scale: 1;
|
|
6
|
+
--liforma-et-avatar-scale: 1;
|
|
7
|
+
--liforma-et-bg-shift: 0px;
|
|
8
|
+
--liforma-et-fg-shift: 0px;
|
|
9
|
+
--liforma-et-avatar-shift: 0px;
|
|
10
|
+
--liforma-et-reveal-duration: 420ms;
|
|
11
|
+
|
|
12
|
+
box-sizing: border-box;
|
|
13
|
+
position: relative;
|
|
14
|
+
display: block;
|
|
15
|
+
width: 100%;
|
|
16
|
+
height: 100%;
|
|
17
|
+
min-height: 0;
|
|
18
|
+
margin: 0;
|
|
19
|
+
padding: 0;
|
|
20
|
+
border: 0;
|
|
21
|
+
border-radius: 0.65rem;
|
|
22
|
+
overflow: hidden;
|
|
23
|
+
background: #111;
|
|
24
|
+
color: inherit;
|
|
25
|
+
text-decoration: none;
|
|
26
|
+
cursor: inherit;
|
|
27
|
+
-webkit-tap-highlight-color: transparent;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
a.liforma-et,
|
|
31
|
+
button.liforma-et {
|
|
32
|
+
cursor: pointer;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
button.liforma-et {
|
|
36
|
+
font: inherit;
|
|
37
|
+
appearance: none;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.liforma-et__placeholder {
|
|
41
|
+
position: absolute;
|
|
42
|
+
inset: 0;
|
|
43
|
+
z-index: 0;
|
|
44
|
+
background:
|
|
45
|
+
radial-gradient(120% 90% at 50% 0%, rgba(255, 255, 255, 0.06), transparent 58%),
|
|
46
|
+
linear-gradient(180deg, #1a1a1a 0%, #101010 100%);
|
|
47
|
+
opacity: 1;
|
|
48
|
+
transition: opacity var(--liforma-et-reveal-duration) ease;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.liforma-et--revealed .liforma-et__placeholder {
|
|
52
|
+
opacity: 0;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.liforma-et__media {
|
|
56
|
+
opacity: 0;
|
|
57
|
+
transition: opacity var(--liforma-et-reveal-duration) ease;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.liforma-et__media--ready {
|
|
61
|
+
opacity: 1;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.liforma-et__background {
|
|
65
|
+
position: absolute;
|
|
66
|
+
inset: 0;
|
|
67
|
+
z-index: 1;
|
|
68
|
+
width: 100%;
|
|
69
|
+
height: 100%;
|
|
70
|
+
object-fit: cover;
|
|
71
|
+
object-position: center center;
|
|
72
|
+
transform: translate(
|
|
73
|
+
calc(var(--liforma-et-parallax-x) * var(--liforma-et-bg-shift)),
|
|
74
|
+
calc(var(--liforma-et-parallax-y) * var(--liforma-et-bg-shift))
|
|
75
|
+
)
|
|
76
|
+
scale(var(--liforma-et-bg-scale));
|
|
77
|
+
transform-origin: center center;
|
|
78
|
+
transition:
|
|
79
|
+
opacity var(--liforma-et-reveal-duration) ease,
|
|
80
|
+
transform 160ms ease;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.liforma-et__avatar {
|
|
84
|
+
position: relative;
|
|
85
|
+
z-index: 2;
|
|
86
|
+
display: block;
|
|
87
|
+
width: 100%;
|
|
88
|
+
height: 100%;
|
|
89
|
+
object-fit: contain;
|
|
90
|
+
object-position: center bottom;
|
|
91
|
+
transform: scale(var(--liforma-et-avatar-scale))
|
|
92
|
+
translate(
|
|
93
|
+
calc(var(--liforma-et-parallax-x) * var(--liforma-et-avatar-shift)),
|
|
94
|
+
calc(var(--liforma-et-parallax-y) * var(--liforma-et-avatar-shift))
|
|
95
|
+
);
|
|
96
|
+
transform-origin: center center;
|
|
97
|
+
transition:
|
|
98
|
+
opacity var(--liforma-et-reveal-duration) ease,
|
|
99
|
+
transform 160ms ease;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/* Gallery plates are typically square in a square tile — contain vs cover is a no-op
|
|
103
|
+
without a zoom. Scale the whole scene from the upper third so Face matches
|
|
104
|
+
player fit (location + avatar crop together). */
|
|
105
|
+
.liforma-et--fit-face {
|
|
106
|
+
--liforma-et-avatar-scale: 1.85;
|
|
107
|
+
--liforma-et-bg-scale: 1.85;
|
|
108
|
+
--liforma-et-fg-scale: 1.85;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.liforma-et--fit-face .liforma-et__avatar,
|
|
112
|
+
.liforma-et--fit-face .liforma-et__background,
|
|
113
|
+
.liforma-et--fit-face .liforma-et__foreground {
|
|
114
|
+
transform-origin: 50% 18%;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.liforma-et--fit-face .liforma-et__avatar {
|
|
118
|
+
object-fit: cover;
|
|
119
|
+
object-position: 50% 18%;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/* Bust / medium: less zoom than face so upper chest stays in frame (player 3.75H window). */
|
|
123
|
+
.liforma-et--fit-medium {
|
|
124
|
+
--liforma-et-avatar-scale: 1.35;
|
|
125
|
+
--liforma-et-bg-scale: 1.35;
|
|
126
|
+
--liforma-et-fg-scale: 1.35;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.liforma-et--fit-medium .liforma-et__avatar,
|
|
130
|
+
.liforma-et--fit-medium .liforma-et__background,
|
|
131
|
+
.liforma-et--fit-medium .liforma-et__foreground {
|
|
132
|
+
transform-origin: 50% 28%;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.liforma-et--fit-medium .liforma-et__avatar {
|
|
136
|
+
object-fit: cover;
|
|
137
|
+
object-position: 50% 28%;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.liforma-et__foreground {
|
|
141
|
+
position: absolute;
|
|
142
|
+
inset: 0;
|
|
143
|
+
z-index: 3;
|
|
144
|
+
width: 100%;
|
|
145
|
+
height: 100%;
|
|
146
|
+
object-fit: cover;
|
|
147
|
+
object-position: center center;
|
|
148
|
+
pointer-events: none;
|
|
149
|
+
transform: translate(
|
|
150
|
+
calc(var(--liforma-et-parallax-x) * var(--liforma-et-fg-shift) * -1),
|
|
151
|
+
calc(var(--liforma-et-parallax-y) * var(--liforma-et-fg-shift) * -1)
|
|
152
|
+
)
|
|
153
|
+
scale(var(--liforma-et-fg-scale));
|
|
154
|
+
transform-origin: center center;
|
|
155
|
+
transition:
|
|
156
|
+
opacity var(--liforma-et-reveal-duration) ease,
|
|
157
|
+
transform 160ms ease;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.liforma-et--parallax {
|
|
161
|
+
--liforma-et-bg-scale: 1.08;
|
|
162
|
+
--liforma-et-fg-scale: 1.05;
|
|
163
|
+
--liforma-et-avatar-scale: 1.08;
|
|
164
|
+
--liforma-et-bg-shift: 10px;
|
|
165
|
+
--liforma-et-fg-shift: 4px;
|
|
166
|
+
--liforma-et-avatar-shift: 4px;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/* Promote layers only while parallax is active — avoids N compositor surfaces on galleries. */
|
|
170
|
+
.liforma-et--parallax .liforma-et__background,
|
|
171
|
+
.liforma-et--parallax .liforma-et__foreground,
|
|
172
|
+
.liforma-et--parallax .liforma-et__avatar {
|
|
173
|
+
will-change: transform;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.liforma-et--parallax.liforma-et--fit-face {
|
|
177
|
+
--liforma-et-avatar-scale: 1.95;
|
|
178
|
+
--liforma-et-bg-scale: 1.95;
|
|
179
|
+
--liforma-et-fg-scale: 1.95;
|
|
180
|
+
--liforma-et-avatar-shift: 0px;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.liforma-et--parallax.liforma-et--fit-medium {
|
|
184
|
+
--liforma-et-avatar-scale: 1.42;
|
|
185
|
+
--liforma-et-bg-scale: 1.42;
|
|
186
|
+
--liforma-et-fg-scale: 1.42;
|
|
187
|
+
--liforma-et-avatar-shift: 0px;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.liforma-et--scroll-parallax .liforma-et__background,
|
|
191
|
+
.liforma-et--scroll-parallax .liforma-et__foreground,
|
|
192
|
+
.liforma-et--scroll-parallax .liforma-et__avatar {
|
|
193
|
+
transition: opacity var(--liforma-et-reveal-duration) ease;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
@media (prefers-reduced-motion: reduce) {
|
|
197
|
+
.liforma-et {
|
|
198
|
+
--liforma-et-reveal-duration: 0ms;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
.liforma-et--parallax {
|
|
202
|
+
--liforma-et-bg-scale: 1;
|
|
203
|
+
--liforma-et-fg-scale: 1;
|
|
204
|
+
--liforma-et-avatar-scale: 1;
|
|
205
|
+
--liforma-et-bg-shift: 0px;
|
|
206
|
+
--liforma-et-fg-shift: 0px;
|
|
207
|
+
--liforma-et-avatar-shift: 0px;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
.liforma-et--parallax.liforma-et--fit-face {
|
|
211
|
+
--liforma-et-avatar-scale: 1.85;
|
|
212
|
+
--liforma-et-bg-scale: 1.85;
|
|
213
|
+
--liforma-et-fg-scale: 1.85;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
.liforma-et__background,
|
|
217
|
+
.liforma-et__foreground,
|
|
218
|
+
.liforma-et__avatar {
|
|
219
|
+
transition: none;
|
|
220
|
+
}
|
|
221
|
+
}`,I=`liforma-experience-thumbnail`;function L(e){if(e?.trim())try{let t=JSON.parse(e);if(t&&typeof t.avatarImage==`string`)return t}catch{}}var R=class extends HTMLElement{static get observedAttributes(){return[`experience-id`,`gallery-thumb`,`avatar-image`,`background-image`,`foreground-image`,`fallback-image`,`alt`,`href`,`target`,`rel`,`return-url`,`player-base-url`,`parallax`,`fit`,`lazy`]}#e=null;#t=[];#n=!1;#r=!1;#i=!1;#a=!1;#o=0;#s=0;#c=!1;#l=!1;#u=!1;#d=!1;connectedCallback(){this.#m()}disconnectedCallback(){this.#f()}attributeChangedCallback(){this.isConnected&&this.#m()}#f(){for(let e of this.#t)e();this.#t=[],this.#e=null}#p(e,t){if(!this.hasAttribute(e))return t;let n=this.getAttribute(e);return n===null||n===``||n===`true`?!0:n===`false`?!1:t}#m(){this.#f();let t=this.shadowRoot??this.attachShadow({mode:`open`}),n=document.createElement(`style`);n.textContent=F,t.replaceChildren(n);let r=this.getAttribute(`alt`)?.trim()||`Experience`,i=this.getAttribute(`href`),o=this.getAttribute(`experience-id`),s=l({href:i,hasClickHandler:this.hasAttribute(`onclick`)||typeof this.onclick==`function`,experienceId:o}),c=a({galleryThumb:L(this.getAttribute(`gallery-thumb`)),avatarImage:this.getAttribute(`avatar-image`)??void 0,backgroundImage:this.getAttribute(`background-image`)??void 0,foregroundImage:this.getAttribute(`foreground-image`)??void 0,fallbackImage:this.getAttribute(`fallback-image`)??void 0});if(!c)return;let u=this.#p(`parallax`,!0),d=this.getAttribute(`fit`)?.trim(),p=d===`face`||d===`medium`?d:`full`,m=this.#p(`lazy`,!0);this.#n=!m;let h=s===`anchor`&&!i?.trim()&&!!o?.trim(),g=f({href:i??void 0,experienceId:o??void 0,returnUrl:this.getAttribute(`return-url`)??void 0,playerBaseUrl:this.getAttribute(`player-base-url`)??void 0,useCurrentPageAsReturnUrl:h&&!this.getAttribute(`return-url`)?.trim()}),_;if(s===`anchor`&&g){let e=document.createElement(`a`);e.href=g;let t=this.getAttribute(`target`),n=this.getAttribute(`rel`);t&&(e.target=t),n&&(e.rel=n),_=e}else if(s===`button`){let e=document.createElement(`button`);e.type=`button`,_=e}else _=document.createElement(`div`),_.setAttribute(`role`,`img`);_.className=`liforma-et`,_.setAttribute(`aria-label`,r),this.#e=_,t.appendChild(_);let v=()=>{let t=!!c.backgroundImage,n=u&&(this.#r||this.#a),r=this.#n&&(this.#u||this.#l||this.#d);_.className=[`liforma-et`,t?`liforma-et--scene`:``,e(p),n?`liforma-et--parallax`:``,this.#a?`liforma-et--scroll-parallax`:``,this.#n&&!r?`liforma-et--loading`:``,r?`liforma-et--revealed`:``].filter(Boolean).join(` `),_.style.setProperty(`--liforma-et-parallax-x`,String(this.#o)),_.style.setProperty(`--liforma-et-parallax-y`,String(this.#s))},y=document.createElement(`span`);y.className=`liforma-et__placeholder`,y.setAttribute(`aria-hidden`,`true`),_.appendChild(y);let b=()=>{if(!this.#n)return;let e=this.#c&&c.fallbackImage?c.fallbackImage:c.avatarImage;if(c.backgroundImage&&!_.querySelector(`.liforma-et__background`)){let e=document.createElement(`img`);e.className=`liforma-et__background liforma-et__media`,e.alt=``,e.decoding=`async`,e.src=c.backgroundImage,this.#t.push(w(e,()=>{this.#l=!0,e.classList.add(`liforma-et__media--ready`),v()})),_.appendChild(e)}let t=_.querySelector(`.liforma-et__avatar`);if(t||(t=document.createElement(`img`),t.className=`liforma-et__avatar liforma-et__media`,t.alt=``,t.decoding=`async`,t.addEventListener(`error`,()=>{c.fallbackImage&&!this.#c?(this.#c=!0,t.src=c.fallbackImage):(this.#u=!0,v())}),this.#t.push(w(t,()=>{this.#u=!0,t.classList.add(`liforma-et__media--ready`),v()})),_.appendChild(t)),t.src!==e&&(t.src=e),c.foregroundImage&&!_.querySelector(`.liforma-et__foreground`)){let e=document.createElement(`img`);e.className=`liforma-et__foreground liforma-et__media`,e.alt=``,e.decoding=`async`,e.src=c.foregroundImage,this.#t.push(w(e,()=>{this.#d=!0,e.classList.add(`liforma-et__media--ready`),v()})),_.appendChild(e)}v()};if(m?this.#t.push(C(_,{onVisibleChange:e=>{e&&(this.#n=!0,b(),v())}})):b(),u){this.#t.push(P(_,{onParallax:e=>{this.#a=!0,this.#i||(this.#o=e,this.#s=0,v())},pointerActive:()=>this.#i}));let e=e=>{if(this.#a)return;let t=_.getBoundingClientRect();t.width<=0||t.height<=0||(this.#o=((e.clientX-t.left)/t.width-.5)*2,this.#s=((e.clientY-t.top)/t.height-.5)*2,v())},t=e=>{this.#i=!0,e.pointerType===`mouse`&&(this.#r=!0),v()},n=()=>{let e=this.#i;this.#i=!1,this.#r=!1,this.#a&&e?(this.#o=E(_.getBoundingClientRect(),window.innerHeight),this.#s=0):this.#a||(this.#o=0,this.#s=0),v()};_.addEventListener(`pointermove`,e),_.addEventListener(`pointerdown`,t),_.addEventListener(`pointerup`,n),_.addEventListener(`pointercancel`,n),_.addEventListener(`pointerenter`,e=>{e.pointerType===`mouse`&&(this.#r=!0,v())}),_.addEventListener(`pointerleave`,()=>{this.#i||(this.#r=!1,this.#a||(this.#o=0,this.#s=0),v())}),this.#t.push(()=>{_.removeEventListener(`pointermove`,e),_.removeEventListener(`pointerdown`,t),_.removeEventListener(`pointerup`,n),_.removeEventListener(`pointercancel`,n)})}_.addEventListener(`click`,e=>{if(h&&!this.getAttribute(`return-url`)?.trim()){let t=f({experienceId:o??void 0,playerBaseUrl:this.getAttribute(`player-base-url`)??void 0,useCurrentPageAsReturnUrl:!0});t&&e.button===0&&!e.metaKey&&!e.ctrlKey&&!e.shiftKey&&(e.preventDefault(),window.location.assign(t))}}),v()}};customElements.get(I)||customElements.define(I,R),window.LiformaThumbnail={sdkVersion:`v2`,element:R}})();
|
|
222
|
+
//# sourceMappingURL=thumbnail.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"thumbnail.js","names":["#render","#teardown","#cleanup","#root","#boolAttr","#shouldLoad","#hovering","#scrollParallax","#avatarReady","#backgroundReady","#foregroundReady","#parallaxX","#parallaxY","#avatarLoadFailed","#pointerDown"],"sources":["../../../src/thumbnail/types.ts","../../../src/thumbnail/toGalleryThumbUrl.ts","../../../src/shims/localStack.ts","../../../src/thumbnail/hostedLaunchUrl.ts","../../../src/thumbnail/thumbLoadScheduler.ts","../../../src/thumbnail/lazyLoad.ts","../../../src/thumbnail/scrollParallax.ts","../../../src/thumbnail/styles.ts","../../../src/v2/liforma-experience-thumbnail.ts","../../../src/v2/thumbnail-cdn.ts"],"sourcesContent":["/** Catalog-shaped layered gallery preview (CDN URLs). */\nexport type GalleryThumb = {\n\treadonly avatarImage: string;\n\treadonly backgroundImage?: string;\n\treadonly foregroundImage?: string;\n};\n\nexport type ThumbnailInteractionKind = 'anchor' | 'button' | 'presentational';\n\nexport type ResolveThumbnailInteractionInput = {\n\treadonly href?: string | null;\n\treadonly hasClickHandler?: boolean;\n\treadonly experienceId?: string | null;\n};\n\nexport type ThumbnailLayers = {\n\treadonly avatarImage: string;\n\treadonly backgroundImage?: string;\n\treadonly foregroundImage?: string;\n\treadonly fallbackImage?: string;\n};\n\n/** Shared props across Svelte / React / Next (React uses `onClick`). */\nexport type ExperienceThumbnailBaseProps = {\n\treadonly galleryThumb?: GalleryThumb;\n\treadonly avatarImage?: string;\n\treadonly backgroundImage?: string;\n\treadonly foregroundImage?: string;\n\treadonly alt: string;\n\treadonly experienceId?: string;\n\treadonly href?: string;\n\treadonly target?: string;\n\treadonly rel?: string;\n\treadonly returnUrl?: string;\n\treadonly playerBaseUrl?: string;\n\treadonly parallax?: boolean;\n\t/** Same as `<Experience fit>`: `full` (default), `medium`, or `face`. */\n\treadonly fit?: 'full' | 'face' | 'medium';\n\treadonly lazy?: boolean;\n\treadonly className?: string;\n\treadonly fallbackImage?: string;\n};\n\nexport function thumbnailFitClass(fit?: 'full' | 'face' | 'medium'): string {\n\tif (fit === 'face') return 'liforma-et--fit-face';\n\tif (fit === 'medium') return 'liforma-et--fit-medium';\n\treturn '';\n}\n","const AVATAR_TIER_RE = /(\\/avatars\\/[^/]+\\/)(\\d+)(\\/)/i;\nconst AVATAR_CH_PLATE_RE = /_CH(\\.webp)/i;\nconst LOCATION_SIZE_RE = /(-)(\\d+x\\d+)(\\.webp)(\\?|$)/i;\n\n/**\n * Rewrite known Liforma CDN URLs to gallery thumb tiers.\n * Avatars: /{tier}/ → /256/; locations: -{WxH}.webp → -256x256.webp.\n * Unrecognized URLs are returned unchanged.\n */\nexport function toGalleryThumbUrl(url: string): string {\n\tconst raw = url.trim();\n\tif (!raw) return raw;\n\n\tlet next = raw.replace(AVATAR_TIER_RE, (_match, prefix: string, tier: string, slash: string) => {\n\t\tif (tier === '256') return `${prefix}${tier}${slash}`;\n\t\treturn `${prefix}256${slash}`;\n\t});\n\tnext = next.replace(AVATAR_CH_PLATE_RE, '_neutral$1');\n\n\tnext = next.replace(\n\t\tLOCATION_SIZE_RE,\n\t\t(_match, dash: string, size: string, ext: string, end: string) => {\n\t\t\tif (size === '256x256') return `${dash}${size}${ext}${end}`;\n\t\t\treturn `${dash}256x256${ext}${end}`;\n\t\t}\n\t);\n\n\treturn next;\n}\n\nexport function resolveThumbnailLayers(input: {\n\treadonly galleryThumb?: {\n\t\treadonly avatarImage?: string;\n\t\treadonly backgroundImage?: string;\n\t\treadonly foregroundImage?: string;\n\t};\n\treadonly avatarImage?: string;\n\treadonly backgroundImage?: string;\n\treadonly foregroundImage?: string;\n\treadonly fallbackImage?: string;\n}): {\n\treadonly avatarImage: string;\n\treadonly backgroundImage?: string;\n\treadonly foregroundImage?: string;\n\treadonly fallbackImage?: string;\n} | null {\n\tconst avatarSource =\n\t\tinput.avatarImage?.trim() ||\n\t\tinput.galleryThumb?.avatarImage?.trim() ||\n\t\t'';\n\tif (!avatarSource) return null;\n\n\tconst backgroundSource =\n\t\tinput.backgroundImage?.trim() || input.galleryThumb?.backgroundImage?.trim() || '';\n\tconst foregroundSource =\n\t\tinput.foregroundImage?.trim() || input.galleryThumb?.foregroundImage?.trim() || '';\n\tconst fallbackSource = input.fallbackImage?.trim() || '';\n\n\treturn {\n\t\tavatarImage: toGalleryThumbUrl(avatarSource),\n\t\t...(backgroundSource ? { backgroundImage: toGalleryThumbUrl(backgroundSource) } : {}),\n\t\t...(foregroundSource ? { foregroundImage: toGalleryThumbUrl(foregroundSource) } : {}),\n\t\t...(fallbackSource ? { fallbackImage: toGalleryThumbUrl(fallbackSource) } : {})\n\t};\n}\n","/**\n * Opt-in local monorepo stack (api :3001, player :3002).\n * Never inferred from hostname alone — third-party demos run on localhost against production.\n */\nexport function useExplicitLocalStack(): boolean {\n\tif ((globalThis as { __LIFORMA_STACK?: string }).__LIFORMA_STACK === 'local') {\n\t\treturn true;\n\t}\n\n\tif (typeof location === 'undefined') {\n\t\treturn false;\n\t}\n\n\ttry {\n\t\treturn new URLSearchParams(location.search).get('stack') === 'local';\n\t} catch {\n\t\treturn false;\n\t}\n}\n","import { useExplicitLocalStack } from '../shims/localStack';\nimport type { ResolveThumbnailInteractionInput, ThumbnailInteractionKind } from './types';\n\nconst PRODUCTION_PLAYER_ORIGIN = 'https://player.liforma.ai';\nconst LOCAL_PLAYER_ORIGIN = 'http://localhost:3002';\n\n/** Priority: href → click-only → hosted (experienceId) → presentational. */\nexport function resolveThumbnailInteraction(\n\tinput: ResolveThumbnailInteractionInput\n): ThumbnailInteractionKind {\n\tif (input.href?.trim()) return 'anchor';\n\tif (input.hasClickHandler) return 'button';\n\tif (input.experienceId?.trim()) return 'anchor';\n\treturn 'presentational';\n}\n\nexport function resolvePlayerBaseUrl(playerBaseUrl?: string): string {\n\tconst configured = playerBaseUrl?.trim();\n\tif (configured) return configured.replace(/\\/$/, '');\n\n\tif (useExplicitLocalStack()) {\n\t\treturn LOCAL_PLAYER_ORIGIN;\n\t}\n\n\treturn PRODUCTION_PLAYER_ORIGIN;\n}\n\n/**\n * Build hosted player launch URL: `{player}/{experienceId}?returnUrl=…`\n * When `returnUrl` is omitted, callers should assign on click (SSR-safe) or pass an explicit URL.\n */\nexport function buildHostedLaunchUrl(options: {\n\treadonly experienceId: string;\n\treadonly returnUrl?: string;\n\treadonly playerBaseUrl?: string;\n}): string {\n\tconst experienceId = options.experienceId.trim();\n\tconst base = resolvePlayerBaseUrl(options.playerBaseUrl);\n\tconst url = new URL(`${base}/${encodeURIComponent(experienceId)}`);\n\tconst returnUrl = options.returnUrl?.trim();\n\tif (returnUrl) {\n\t\turl.searchParams.set('returnUrl', returnUrl);\n\t}\n\treturn url.toString();\n}\n\n/** Resolve href for anchor mode (app link or hosted launch). */\nexport function resolveThumbnailHref(options: {\n\treadonly href?: string;\n\treadonly experienceId?: string;\n\treadonly returnUrl?: string;\n\treadonly playerBaseUrl?: string;\n\t/** When true and returnUrl omitted, use window.location.href (browser only). */\n\treadonly useCurrentPageAsReturnUrl?: boolean;\n}): string | undefined {\n\tconst href = options.href?.trim();\n\tif (href) return href;\n\n\tconst experienceId = options.experienceId?.trim();\n\tif (!experienceId) return undefined;\n\n\tlet returnUrl = options.returnUrl?.trim();\n\tif (!returnUrl && options.useCurrentPageAsReturnUrl && typeof window !== 'undefined') {\n\t\treturnUrl = window.location.href;\n\t}\n\n\treturn buildHostedLaunchUrl({\n\t\texperienceId,\n\t\t...(returnUrl ? { returnUrl } : {}),\n\t\tplayerBaseUrl: options.playerBaseUrl\n\t});\n}\n","/** Touch / coarse pointers — limit how many thumbs start loading at once. */\nexport const COARSE_THUMB_LOAD_CONCURRENCY = 4;\n/** Delay before a started thumb frees its queue slot for the next card. */\nexport const COARSE_THUMB_LOAD_STAGGER_MS = 160;\n\nexport function prefersCoarsePointer(): boolean {\n\tif (typeof window === 'undefined') return false;\n\treturn window.matchMedia('(hover: none), (pointer: coarse)').matches;\n}\n\ntype QueuedLoad = {\n\treadonly start: () => void;\n\tcancelled: boolean;\n};\n\nlet inflight = 0;\nconst waiting: QueuedLoad[] = [];\n\nfunction maxConcurrent(): number {\n\treturn prefersCoarsePointer() ? COARSE_THUMB_LOAD_CONCURRENCY : Number.POSITIVE_INFINITY;\n}\n\nfunction staggerMs(): number {\n\treturn prefersCoarsePointer() ? COARSE_THUMB_LOAD_STAGGER_MS : 0;\n}\n\nfunction pump(): void {\n\tconst limit = maxConcurrent();\n\twhile (inflight < limit && waiting.length > 0) {\n\t\tconst next = waiting.shift();\n\t\tif (!next || next.cancelled) continue;\n\t\tinflight += 1;\n\t\tnext.start();\n\t\tconst delay = staggerMs();\n\t\tif (delay <= 0) {\n\t\t\tinflight = Math.max(0, inflight - 1);\n\t\t\tcontinue;\n\t\t}\n\t\twindow.setTimeout(() => {\n\t\t\tinflight = Math.max(0, inflight - 1);\n\t\t\tpump();\n\t\t}, delay);\n\t}\n}\n\n/**\n * On coarse pointers, start thumb image loads in small waves so old devices\n * are not hit with dozens of concurrent decodes. Fine pointers start immediately.\n * Returns a cancel function (no-op after start has run).\n */\nexport function scheduleThumbLoad(start: () => void): () => void {\n\tif (!prefersCoarsePointer()) {\n\t\tstart();\n\t\treturn () => {};\n\t}\n\n\tconst item: QueuedLoad = { start, cancelled: false };\n\twaiting.push(item);\n\tpump();\n\n\treturn () => {\n\t\titem.cancelled = true;\n\t};\n}\n\n/** Test helper — clear queue state between vitest cases. */\nexport function resetThumbLoadSchedulerForTests(): void {\n\tinflight = 0;\n\twaiting.length = 0;\n}\n","import { prefersCoarsePointer, scheduleThumbLoad } from './thumbLoadScheduler';\n\nexport type LazyThumbOptions = {\n\treadonly rootMargin?: string;\n\treadonly onVisibleChange: (visible: boolean) => void;\n};\n\n/** Desktop: prefetch earlier. Coarse/touch: tighter margin to cut burst loads. */\nexport function getDefaultLazyRootMargin(): string {\n\treturn prefersCoarsePointer() ? '96px 0px' : '280px 0px';\n}\n\nfunction parseVerticalRootMarginPx(rootMargin: string): number {\n\tconst first = rootMargin.trim().split(/\\s+/)[0] ?? '0px';\n\tconst value = Number.parseFloat(first);\n\treturn Number.isFinite(value) ? Math.abs(value) : 280;\n}\n\nfunction isNearViewport(element: HTMLElement, marginPx: number): boolean {\n\tif (typeof window === 'undefined') return false;\n\tconst rect = element.getBoundingClientRect();\n\treturn rect.bottom >= -marginPx && rect.top <= window.innerHeight + marginPx;\n}\n\n/** Observe the thumb and enable image loads when near the viewport. */\nexport function attachLazyThumb(element: HTMLElement, options: LazyThumbOptions): () => void {\n\tconst { onVisibleChange } = options;\n\tconst rootMargin = options.rootMargin ?? getDefaultLazyRootMargin();\n\tconst marginPx = parseVerticalRootMarginPx(rootMargin);\n\tlet visible = false;\n\tlet loadStarted = false;\n\tlet cancelScheduled: (() => void) | null = null;\n\n\tconst requestLoad = () => {\n\t\tif (loadStarted) return;\n\t\tcancelScheduled?.();\n\t\tcancelScheduled = scheduleThumbLoad(() => {\n\t\t\tcancelScheduled = null;\n\t\t\tloadStarted = true;\n\t\t\tonVisibleChange(true);\n\t\t});\n\t};\n\n\tconst setVisible = (next: boolean) => {\n\t\tif (next === visible) return;\n\t\tvisible = next;\n\t\tif (next) {\n\t\t\trequestLoad();\n\t\t\treturn;\n\t\t}\n\t\t// Keep images once started; only cancel a queued (not-yet-started) load.\n\t\tcancelScheduled?.();\n\t\tcancelScheduled = null;\n\t\tonVisibleChange(false);\n\t};\n\n\tif (typeof IntersectionObserver === 'undefined') {\n\t\trequestLoad();\n\t\treturn () => {\n\t\t\tcancelScheduled?.();\n\t\t\tcancelScheduled = null;\n\t\t};\n\t}\n\n\tconst observer = new IntersectionObserver(\n\t\t(entries) => {\n\t\t\tsetVisible(entries.some((entry) => entry.isIntersecting));\n\t\t},\n\t\t{ root: null, rootMargin, threshold: 0 }\n\t);\n\n\tobserver.observe(element);\n\n\tif (isNearViewport(element, marginPx)) {\n\t\tsetVisible(true);\n\t}\n\n\treturn () => {\n\t\tcancelScheduled?.();\n\t\tcancelScheduled = null;\n\t\tobserver.disconnect();\n\t};\n}\n\nexport function attachImageReady(element: HTMLImageElement, onReady: () => void): () => void {\n\tconst notify = () => onReady();\n\tif (element.complete) {\n\t\tqueueMicrotask(notify);\n\t} else {\n\t\telement.addEventListener('load', notify, { once: true });\n\t\telement.addEventListener('error', notify, { once: true });\n\t}\n\treturn () => {\n\t\telement.removeEventListener('load', notify);\n\t\telement.removeEventListener('error', notify);\n\t};\n}\n","/** Touch devices without hover — drive thumbnail parallax from scroll position. */\nexport function prefersScrollLinkedParallax(): boolean {\n\tif (typeof window === 'undefined') return false;\n\tif (window.matchMedia('(prefers-reduced-motion: reduce)').matches) return false;\n\treturn window.matchMedia('(hover: none), (pointer: coarse)').matches;\n}\n\n/**\n * Map an element's vertical centre in the viewport to horizontal parallax in [-1, 1].\n */\nexport function horizontalParallaxFromViewportY(rect: DOMRect, viewportHeight: number): number {\n\tconst centerY = rect.top + rect.height / 2;\n\tconst t = centerY / Math.max(viewportHeight, 1);\n\treturn (t - 0.5) * 2;\n}\n\nexport type ScrollLinkedParallaxOptions = {\n\treadonly onParallax: (x: number) => void;\n\treadonly pointerActive?: () => boolean;\n};\n\ntype ScrollParallaxSubscriber = {\n\treadonly element: HTMLElement;\n\treadonly onParallax: (x: number) => void;\n\treadonly pointerActive?: () => boolean;\n};\n\nconst subscribers = new Set<ScrollParallaxSubscriber>();\nlet listening = false;\nlet frame = 0;\n\nfunction syncAll(): void {\n\tframe = 0;\n\tif (subscribers.size === 0 || typeof window === 'undefined') return;\n\tconst viewportHeight = window.innerHeight;\n\tfor (const entry of subscribers) {\n\t\tif (entry.pointerActive?.()) continue;\n\t\tconst rect = entry.element.getBoundingClientRect();\n\t\t// Skip off-screen thumbs — avoids N layout reads + framework updates per scroll.\n\t\tif (rect.bottom < -64 || rect.top > viewportHeight + 64) continue;\n\t\tentry.onParallax(horizontalParallaxFromViewportY(rect, viewportHeight));\n\t}\n}\n\nfunction scheduleSync(): void {\n\tif (frame !== 0) return;\n\tframe = requestAnimationFrame(syncAll);\n}\n\nfunction ensureListening(): void {\n\tif (listening || typeof window === 'undefined') return;\n\tlistening = true;\n\twindow.addEventListener('scroll', scheduleSync, { passive: true });\n\twindow.addEventListener('resize', scheduleSync, { passive: true });\n}\n\nfunction stopListeningIfIdle(): void {\n\tif (subscribers.size > 0 || !listening || typeof window === 'undefined') return;\n\tlistening = false;\n\tif (frame !== 0) {\n\t\tcancelAnimationFrame(frame);\n\t\tframe = 0;\n\t}\n\twindow.removeEventListener('scroll', scheduleSync);\n\twindow.removeEventListener('resize', scheduleSync);\n}\n\n/**\n * Subscribe to scroll/resize and update horizontal parallax from viewport Y.\n * Uses one shared window listener for all thumbs (old iPads with large galleries).\n */\nexport function attachScrollLinkedParallax(\n\telement: HTMLElement,\n\toptions: ScrollLinkedParallaxOptions\n): () => void {\n\tif (!prefersScrollLinkedParallax()) return () => {};\n\n\tconst entry: ScrollParallaxSubscriber = {\n\t\telement,\n\t\tonParallax: options.onParallax,\n\t\tpointerActive: options.pointerActive\n\t};\n\tsubscribers.add(entry);\n\tensureListening();\n\n\tif (!entry.pointerActive?.()) {\n\t\toptions.onParallax(\n\t\t\thorizontalParallaxFromViewportY(element.getBoundingClientRect(), window.innerHeight)\n\t\t);\n\t}\n\n\treturn () => {\n\t\tsubscribers.delete(entry);\n\t\tstopListeningIfIdle();\n\t};\n}\n\n/** Test helper — clear shared scroll state between vitest cases. */\nexport function resetScrollLinkedParallaxForTests(): void {\n\tsubscribers.clear();\n\tif (typeof window !== 'undefined' && listening) {\n\t\twindow.removeEventListener('scroll', scheduleSync);\n\t\twindow.removeEventListener('resize', scheduleSync);\n\t}\n\tlistening = false;\n\tif (frame !== 0) {\n\t\tcancelAnimationFrame(frame);\n\t\tframe = 0;\n\t}\n}\n","/** Shared styles for ExperienceThumbnail (class prefix `liforma-et`). */\nexport const EXPERIENCE_THUMBNAIL_CSS = `\n.liforma-et {\n\t--liforma-et-parallax-x: 0;\n\t--liforma-et-parallax-y: 0;\n\t--liforma-et-bg-scale: 1;\n\t--liforma-et-fg-scale: 1;\n\t--liforma-et-avatar-scale: 1;\n\t--liforma-et-bg-shift: 0px;\n\t--liforma-et-fg-shift: 0px;\n\t--liforma-et-avatar-shift: 0px;\n\t--liforma-et-reveal-duration: 420ms;\n\n\tbox-sizing: border-box;\n\tposition: relative;\n\tdisplay: block;\n\twidth: 100%;\n\theight: 100%;\n\tmin-height: 0;\n\tmargin: 0;\n\tpadding: 0;\n\tborder: 0;\n\tborder-radius: 0.65rem;\n\toverflow: hidden;\n\tbackground: #111;\n\tcolor: inherit;\n\ttext-decoration: none;\n\tcursor: inherit;\n\t-webkit-tap-highlight-color: transparent;\n}\n\na.liforma-et,\nbutton.liforma-et {\n\tcursor: pointer;\n}\n\nbutton.liforma-et {\n\tfont: inherit;\n\tappearance: none;\n}\n\n.liforma-et__placeholder {\n\tposition: absolute;\n\tinset: 0;\n\tz-index: 0;\n\tbackground:\n\t\tradial-gradient(120% 90% at 50% 0%, rgba(255, 255, 255, 0.06), transparent 58%),\n\t\tlinear-gradient(180deg, #1a1a1a 0%, #101010 100%);\n\topacity: 1;\n\ttransition: opacity var(--liforma-et-reveal-duration) ease;\n}\n\n.liforma-et--revealed .liforma-et__placeholder {\n\topacity: 0;\n}\n\n.liforma-et__media {\n\topacity: 0;\n\ttransition: opacity var(--liforma-et-reveal-duration) ease;\n}\n\n.liforma-et__media--ready {\n\topacity: 1;\n}\n\n.liforma-et__background {\n\tposition: absolute;\n\tinset: 0;\n\tz-index: 1;\n\twidth: 100%;\n\theight: 100%;\n\tobject-fit: cover;\n\tobject-position: center center;\n\ttransform: translate(\n\t\t\tcalc(var(--liforma-et-parallax-x) * var(--liforma-et-bg-shift)),\n\t\t\tcalc(var(--liforma-et-parallax-y) * var(--liforma-et-bg-shift))\n\t\t)\n\t\tscale(var(--liforma-et-bg-scale));\n\ttransform-origin: center center;\n\ttransition:\n\t\topacity var(--liforma-et-reveal-duration) ease,\n\t\ttransform 160ms ease;\n}\n\n.liforma-et__avatar {\n\tposition: relative;\n\tz-index: 2;\n\tdisplay: block;\n\twidth: 100%;\n\theight: 100%;\n\tobject-fit: contain;\n\tobject-position: center bottom;\n\ttransform: scale(var(--liforma-et-avatar-scale))\n\t\ttranslate(\n\t\t\tcalc(var(--liforma-et-parallax-x) * var(--liforma-et-avatar-shift)),\n\t\t\tcalc(var(--liforma-et-parallax-y) * var(--liforma-et-avatar-shift))\n\t\t);\n\ttransform-origin: center center;\n\ttransition:\n\t\topacity var(--liforma-et-reveal-duration) ease,\n\t\ttransform 160ms ease;\n}\n\n/* Gallery plates are typically square in a square tile — contain vs cover is a no-op\n without a zoom. Scale the whole scene from the upper third so Face matches\n player fit (location + avatar crop together). */\n.liforma-et--fit-face {\n\t--liforma-et-avatar-scale: 1.85;\n\t--liforma-et-bg-scale: 1.85;\n\t--liforma-et-fg-scale: 1.85;\n}\n\n.liforma-et--fit-face .liforma-et__avatar,\n.liforma-et--fit-face .liforma-et__background,\n.liforma-et--fit-face .liforma-et__foreground {\n\ttransform-origin: 50% 18%;\n}\n\n.liforma-et--fit-face .liforma-et__avatar {\n\tobject-fit: cover;\n\tobject-position: 50% 18%;\n}\n\n/* Bust / medium: less zoom than face so upper chest stays in frame (player 3.75H window). */\n.liforma-et--fit-medium {\n\t--liforma-et-avatar-scale: 1.35;\n\t--liforma-et-bg-scale: 1.35;\n\t--liforma-et-fg-scale: 1.35;\n}\n\n.liforma-et--fit-medium .liforma-et__avatar,\n.liforma-et--fit-medium .liforma-et__background,\n.liforma-et--fit-medium .liforma-et__foreground {\n\ttransform-origin: 50% 28%;\n}\n\n.liforma-et--fit-medium .liforma-et__avatar {\n\tobject-fit: cover;\n\tobject-position: 50% 28%;\n}\n\n.liforma-et__foreground {\n\tposition: absolute;\n\tinset: 0;\n\tz-index: 3;\n\twidth: 100%;\n\theight: 100%;\n\tobject-fit: cover;\n\tobject-position: center center;\n\tpointer-events: none;\n\ttransform: translate(\n\t\t\tcalc(var(--liforma-et-parallax-x) * var(--liforma-et-fg-shift) * -1),\n\t\t\tcalc(var(--liforma-et-parallax-y) * var(--liforma-et-fg-shift) * -1)\n\t\t)\n\t\tscale(var(--liforma-et-fg-scale));\n\ttransform-origin: center center;\n\ttransition:\n\t\topacity var(--liforma-et-reveal-duration) ease,\n\t\ttransform 160ms ease;\n}\n\n.liforma-et--parallax {\n\t--liforma-et-bg-scale: 1.08;\n\t--liforma-et-fg-scale: 1.05;\n\t--liforma-et-avatar-scale: 1.08;\n\t--liforma-et-bg-shift: 10px;\n\t--liforma-et-fg-shift: 4px;\n\t--liforma-et-avatar-shift: 4px;\n}\n\n/* Promote layers only while parallax is active — avoids N compositor surfaces on galleries. */\n.liforma-et--parallax .liforma-et__background,\n.liforma-et--parallax .liforma-et__foreground,\n.liforma-et--parallax .liforma-et__avatar {\n\twill-change: transform;\n}\n\n.liforma-et--parallax.liforma-et--fit-face {\n\t--liforma-et-avatar-scale: 1.95;\n\t--liforma-et-bg-scale: 1.95;\n\t--liforma-et-fg-scale: 1.95;\n\t--liforma-et-avatar-shift: 0px;\n}\n\n.liforma-et--parallax.liforma-et--fit-medium {\n\t--liforma-et-avatar-scale: 1.42;\n\t--liforma-et-bg-scale: 1.42;\n\t--liforma-et-fg-scale: 1.42;\n\t--liforma-et-avatar-shift: 0px;\n}\n\n.liforma-et--scroll-parallax .liforma-et__background,\n.liforma-et--scroll-parallax .liforma-et__foreground,\n.liforma-et--scroll-parallax .liforma-et__avatar {\n\ttransition: opacity var(--liforma-et-reveal-duration) ease;\n}\n\n@media (prefers-reduced-motion: reduce) {\n\t.liforma-et {\n\t\t--liforma-et-reveal-duration: 0ms;\n\t}\n\n\t.liforma-et--parallax {\n\t\t--liforma-et-bg-scale: 1;\n\t\t--liforma-et-fg-scale: 1;\n\t\t--liforma-et-avatar-scale: 1;\n\t\t--liforma-et-bg-shift: 0px;\n\t\t--liforma-et-fg-shift: 0px;\n\t\t--liforma-et-avatar-shift: 0px;\n\t}\n\n\t.liforma-et--parallax.liforma-et--fit-face {\n\t\t--liforma-et-avatar-scale: 1.85;\n\t\t--liforma-et-bg-scale: 1.85;\n\t\t--liforma-et-fg-scale: 1.85;\n\t}\n\n\t.liforma-et__background,\n\t.liforma-et__foreground,\n\t.liforma-et__avatar {\n\t\ttransition: none;\n\t}\n}\n`.trim();\n","import {\n\tattachImageReady,\n\tattachLazyThumb,\n\tattachScrollLinkedParallax,\n\tEXPERIENCE_THUMBNAIL_CSS,\n\thorizontalParallaxFromViewportY,\n\tresolveThumbnailHref,\n\tresolveThumbnailInteraction,\n\tresolveThumbnailLayers,\n\tthumbnailFitClass,\n\ttype GalleryThumb\n} from '../thumbnail/index';\n\nconst ELEMENT_NAME = 'liforma-experience-thumbnail';\n\nfunction parseGalleryThumb(raw: string | null): GalleryThumb | undefined {\n\tif (!raw?.trim()) return undefined;\n\ttry {\n\t\tconst parsed = JSON.parse(raw) as GalleryThumb;\n\t\tif (parsed && typeof parsed.avatarImage === 'string') return parsed;\n\t} catch {\n\t\t/* ignore */\n\t}\n\treturn undefined;\n}\n\nclass LiformaExperienceThumbnailElement extends HTMLElement {\n\tstatic get observedAttributes(): string[] {\n\t\treturn [\n\t\t\t'experience-id',\n\t\t\t'gallery-thumb',\n\t\t\t'avatar-image',\n\t\t\t'background-image',\n\t\t\t'foreground-image',\n\t\t\t'fallback-image',\n\t\t\t'alt',\n\t\t\t'href',\n\t\t\t'target',\n\t\t\t'rel',\n\t\t\t'return-url',\n\t\t\t'player-base-url',\n\t\t\t'parallax',\n\t\t\t'fit',\n\t\t\t'lazy'\n\t\t];\n\t}\n\n\t#root: HTMLElement | null = null;\n\t#cleanup: (() => void)[] = [];\n\t#shouldLoad = false;\n\t#hovering = false;\n\t#pointerDown = false;\n\t#scrollParallax = false;\n\t#parallaxX = 0;\n\t#parallaxY = 0;\n\t#avatarLoadFailed = false;\n\t#backgroundReady = false;\n\t#avatarReady = false;\n\t#foregroundReady = false;\n\n\tconnectedCallback(): void {\n\t\tthis.#render();\n\t}\n\n\tdisconnectedCallback(): void {\n\t\tthis.#teardown();\n\t}\n\n\tattributeChangedCallback(): void {\n\t\tif (this.isConnected) this.#render();\n\t}\n\n\t#teardown(): void {\n\t\tfor (const fn of this.#cleanup) fn();\n\t\tthis.#cleanup = [];\n\t\tthis.#root = null;\n\t}\n\n\t#boolAttr(name: string, defaultValue: boolean): boolean {\n\t\tif (!this.hasAttribute(name)) return defaultValue;\n\t\tconst value = this.getAttribute(name);\n\t\tif (value === null || value === '' || value === 'true') return true;\n\t\tif (value === 'false') return false;\n\t\treturn defaultValue;\n\t}\n\n\t#render(): void {\n\t\tthis.#teardown();\n\n\t\tconst shadow = this.shadowRoot ?? this.attachShadow({ mode: 'open' });\n\t\tconst style = document.createElement('style');\n\t\tstyle.textContent = EXPERIENCE_THUMBNAIL_CSS;\n\t\tshadow.replaceChildren(style);\n\n\t\tconst alt = this.getAttribute('alt')?.trim() || 'Experience';\n\t\tconst hrefAttr = this.getAttribute('href');\n\t\tconst experienceId = this.getAttribute('experience-id');\n\t\tconst hasClickHandler = this.hasAttribute('onclick') || typeof this.onclick === 'function';\n\t\tconst interaction = resolveThumbnailInteraction({\n\t\t\thref: hrefAttr,\n\t\t\thasClickHandler,\n\t\t\texperienceId\n\t\t});\n\n\t\tconst layers = resolveThumbnailLayers({\n\t\t\tgalleryThumb: parseGalleryThumb(this.getAttribute('gallery-thumb')),\n\t\t\tavatarImage: this.getAttribute('avatar-image') ?? undefined,\n\t\t\tbackgroundImage: this.getAttribute('background-image') ?? undefined,\n\t\t\tforegroundImage: this.getAttribute('foreground-image') ?? undefined,\n\t\t\tfallbackImage: this.getAttribute('fallback-image') ?? undefined\n\t\t});\n\t\tif (!layers) return;\n\n\t\tconst parallaxEnabled = this.#boolAttr('parallax', true);\n\t\tconst fitAttr = this.getAttribute('fit')?.trim();\n\t\tconst fit = fitAttr === 'face' || fitAttr === 'medium' ? fitAttr : 'full';\n\t\tconst lazy = this.#boolAttr('lazy', true);\n\t\tthis.#shouldLoad = !lazy;\n\n\t\tconst isHostedLaunch =\n\t\t\tinteraction === 'anchor' && !hrefAttr?.trim() && Boolean(experienceId?.trim());\n\t\tconst resolvedHref = resolveThumbnailHref({\n\t\t\thref: hrefAttr ?? undefined,\n\t\t\texperienceId: experienceId ?? undefined,\n\t\t\treturnUrl: this.getAttribute('return-url') ?? undefined,\n\t\t\tplayerBaseUrl: this.getAttribute('player-base-url') ?? undefined,\n\t\t\tuseCurrentPageAsReturnUrl:\n\t\t\t\tisHostedLaunch && !this.getAttribute('return-url')?.trim()\n\t\t});\n\n\t\tlet root: HTMLElement;\n\t\tif (interaction === 'anchor' && resolvedHref) {\n\t\t\tconst a = document.createElement('a');\n\t\t\ta.href = resolvedHref;\n\t\t\tconst target = this.getAttribute('target');\n\t\t\tconst rel = this.getAttribute('rel');\n\t\t\tif (target) a.target = target;\n\t\t\tif (rel) a.rel = rel;\n\t\t\troot = a;\n\t\t} else if (interaction === 'button') {\n\t\t\tconst button = document.createElement('button');\n\t\t\tbutton.type = 'button';\n\t\t\troot = button;\n\t\t} else {\n\t\t\troot = document.createElement('div');\n\t\t\troot.setAttribute('role', 'img');\n\t\t}\n\n\t\troot.className = 'liforma-et';\n\t\troot.setAttribute('aria-label', alt);\n\t\tthis.#root = root;\n\t\tshadow.appendChild(root);\n\n\t\tconst syncClass = () => {\n\t\t\tconst hasScene = Boolean(layers.backgroundImage);\n\t\t\tconst parallaxActive = parallaxEnabled && (this.#hovering || this.#scrollParallax);\n\t\t\t// Fade placeholder as soon as any layer can paint — don't wait for the slowest plate.\n\t\t\tconst reveal =\n\t\t\t\tthis.#shouldLoad &&\n\t\t\t\t(this.#avatarReady || this.#backgroundReady || this.#foregroundReady);\n\t\t\troot.className = [\n\t\t\t\t'liforma-et',\n\t\t\t\thasScene ? 'liforma-et--scene' : '',\n\t\t\t\tthumbnailFitClass(fit),\n\t\t\t\tparallaxActive ? 'liforma-et--parallax' : '',\n\t\t\t\tthis.#scrollParallax ? 'liforma-et--scroll-parallax' : '',\n\t\t\t\tthis.#shouldLoad && !reveal ? 'liforma-et--loading' : '',\n\t\t\t\treveal ? 'liforma-et--revealed' : ''\n\t\t\t]\n\t\t\t\t.filter(Boolean)\n\t\t\t\t.join(' ');\n\t\t\troot.style.setProperty('--liforma-et-parallax-x', String(this.#parallaxX));\n\t\t\troot.style.setProperty('--liforma-et-parallax-y', String(this.#parallaxY));\n\t\t};\n\n\t\tconst placeholder = document.createElement('span');\n\t\tplaceholder.className = 'liforma-et__placeholder';\n\t\tplaceholder.setAttribute('aria-hidden', 'true');\n\t\troot.appendChild(placeholder);\n\n\t\tconst paintImages = () => {\n\t\t\tif (!this.#shouldLoad) return;\n\t\t\tconst avatarSrc =\n\t\t\t\tthis.#avatarLoadFailed && layers.fallbackImage\n\t\t\t\t\t? layers.fallbackImage\n\t\t\t\t\t: layers.avatarImage;\n\n\t\t\tif (layers.backgroundImage && !root.querySelector('.liforma-et__background')) {\n\t\t\t\tconst img = document.createElement('img');\n\t\t\t\timg.className = 'liforma-et__background liforma-et__media';\n\t\t\t\timg.alt = '';\n\t\t\t\timg.decoding = 'async';\n\t\t\t\timg.src = layers.backgroundImage;\n\t\t\t\tthis.#cleanup.push(\n\t\t\t\t\tattachImageReady(img, () => {\n\t\t\t\t\t\tthis.#backgroundReady = true;\n\t\t\t\t\t\timg.classList.add('liforma-et__media--ready');\n\t\t\t\t\t\tsyncClass();\n\t\t\t\t\t})\n\t\t\t\t);\n\t\t\t\troot.appendChild(img);\n\t\t\t}\n\n\t\t\tlet avatar = root.querySelector('.liforma-et__avatar') as HTMLImageElement | null;\n\t\t\tif (!avatar) {\n\t\t\t\tavatar = document.createElement('img');\n\t\t\t\tavatar.className = 'liforma-et__avatar liforma-et__media';\n\t\t\t\tavatar.alt = '';\n\t\t\t\tavatar.decoding = 'async';\n\t\t\t\tavatar.addEventListener('error', () => {\n\t\t\t\t\tif (layers.fallbackImage && !this.#avatarLoadFailed) {\n\t\t\t\t\t\tthis.#avatarLoadFailed = true;\n\t\t\t\t\t\tavatar!.src = layers.fallbackImage;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.#avatarReady = true;\n\t\t\t\t\t\tsyncClass();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tthis.#cleanup.push(\n\t\t\t\t\tattachImageReady(avatar, () => {\n\t\t\t\t\t\tthis.#avatarReady = true;\n\t\t\t\t\t\tavatar!.classList.add('liforma-et__media--ready');\n\t\t\t\t\t\tsyncClass();\n\t\t\t\t\t})\n\t\t\t\t);\n\t\t\t\troot.appendChild(avatar);\n\t\t\t}\n\t\t\tif (avatar.src !== avatarSrc) avatar.src = avatarSrc;\n\n\t\t\tif (layers.foregroundImage && !root.querySelector('.liforma-et__foreground')) {\n\t\t\t\tconst img = document.createElement('img');\n\t\t\t\timg.className = 'liforma-et__foreground liforma-et__media';\n\t\t\t\timg.alt = '';\n\t\t\t\timg.decoding = 'async';\n\t\t\t\timg.src = layers.foregroundImage;\n\t\t\t\tthis.#cleanup.push(\n\t\t\t\t\tattachImageReady(img, () => {\n\t\t\t\t\t\tthis.#foregroundReady = true;\n\t\t\t\t\t\timg.classList.add('liforma-et__media--ready');\n\t\t\t\t\t\tsyncClass();\n\t\t\t\t\t})\n\t\t\t\t);\n\t\t\t\troot.appendChild(img);\n\t\t\t}\n\t\t\tsyncClass();\n\t\t};\n\n\t\tif (lazy) {\n\t\t\tthis.#cleanup.push(\n\t\t\t\tattachLazyThumb(root, {\n\t\t\t\t\tonVisibleChange: (visible) => {\n\t\t\t\t\t\tif (!visible) return;\n\t\t\t\t\t\tthis.#shouldLoad = true;\n\t\t\t\t\t\tpaintImages();\n\t\t\t\t\t\tsyncClass();\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t);\n\t\t} else {\n\t\t\tpaintImages();\n\t\t}\n\n\t\tif (parallaxEnabled) {\n\t\t\tthis.#cleanup.push(\n\t\t\t\tattachScrollLinkedParallax(root, {\n\t\t\t\t\tonParallax: (x) => {\n\t\t\t\t\t\tthis.#scrollParallax = true;\n\t\t\t\t\t\tif (!this.#pointerDown) {\n\t\t\t\t\t\t\tthis.#parallaxX = x;\n\t\t\t\t\t\t\tthis.#parallaxY = 0;\n\t\t\t\t\t\t\tsyncClass();\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tpointerActive: () => this.#pointerDown\n\t\t\t\t})\n\t\t\t);\n\n\t\t\tconst onPointerMove = (event: PointerEvent) => {\n\t\t\t\tif (this.#scrollParallax) return;\n\t\t\t\tconst rect = root.getBoundingClientRect();\n\t\t\t\tif (rect.width <= 0 || rect.height <= 0) return;\n\t\t\t\tthis.#parallaxX = ((event.clientX - rect.left) / rect.width - 0.5) * 2;\n\t\t\t\tthis.#parallaxY = ((event.clientY - rect.top) / rect.height - 0.5) * 2;\n\t\t\t\tsyncClass();\n\t\t\t};\n\t\t\tconst onPointerDown = (event: PointerEvent) => {\n\t\t\t\tthis.#pointerDown = true;\n\t\t\t\tif (event.pointerType === 'mouse') this.#hovering = true;\n\t\t\t\tsyncClass();\n\t\t\t};\n\t\t\tconst onPointerUp = () => {\n\t\t\t\tconst wasDown = this.#pointerDown;\n\t\t\t\tthis.#pointerDown = false;\n\t\t\t\tthis.#hovering = false;\n\t\t\t\tif (this.#scrollParallax && wasDown) {\n\t\t\t\t\tthis.#parallaxX = horizontalParallaxFromViewportY(\n\t\t\t\t\t\troot.getBoundingClientRect(),\n\t\t\t\t\t\twindow.innerHeight\n\t\t\t\t\t);\n\t\t\t\t\tthis.#parallaxY = 0;\n\t\t\t\t} else if (!this.#scrollParallax) {\n\t\t\t\t\tthis.#parallaxX = 0;\n\t\t\t\t\tthis.#parallaxY = 0;\n\t\t\t\t}\n\t\t\t\tsyncClass();\n\t\t\t};\n\t\t\troot.addEventListener('pointermove', onPointerMove);\n\t\t\troot.addEventListener('pointerdown', onPointerDown);\n\t\t\troot.addEventListener('pointerup', onPointerUp);\n\t\t\troot.addEventListener('pointercancel', onPointerUp);\n\t\t\troot.addEventListener('pointerenter', (event: PointerEvent) => {\n\t\t\t\tif (event.pointerType === 'mouse') {\n\t\t\t\t\tthis.#hovering = true;\n\t\t\t\t\tsyncClass();\n\t\t\t\t}\n\t\t\t});\n\t\t\troot.addEventListener('pointerleave', () => {\n\t\t\t\tif (!this.#pointerDown) {\n\t\t\t\t\tthis.#hovering = false;\n\t\t\t\t\tif (!this.#scrollParallax) {\n\t\t\t\t\t\tthis.#parallaxX = 0;\n\t\t\t\t\t\tthis.#parallaxY = 0;\n\t\t\t\t\t}\n\t\t\t\t\tsyncClass();\n\t\t\t\t}\n\t\t\t});\n\t\t\tthis.#cleanup.push(() => {\n\t\t\t\troot.removeEventListener('pointermove', onPointerMove);\n\t\t\t\troot.removeEventListener('pointerdown', onPointerDown);\n\t\t\t\troot.removeEventListener('pointerup', onPointerUp);\n\t\t\t\troot.removeEventListener('pointercancel', onPointerUp);\n\t\t\t});\n\t\t}\n\n\t\troot.addEventListener('click', (event: MouseEvent) => {\n\t\t\tif (isHostedLaunch && !this.getAttribute('return-url')?.trim()) {\n\t\t\t\tconst next = resolveThumbnailHref({\n\t\t\t\t\texperienceId: experienceId ?? undefined,\n\t\t\t\t\tplayerBaseUrl: this.getAttribute('player-base-url') ?? undefined,\n\t\t\t\t\tuseCurrentPageAsReturnUrl: true\n\t\t\t\t});\n\t\t\t\tif (\n\t\t\t\t\tnext &&\n\t\t\t\t\tevent.button === 0 &&\n\t\t\t\t\t!event.metaKey &&\n\t\t\t\t\t!event.ctrlKey &&\n\t\t\t\t\t!event.shiftKey\n\t\t\t\t) {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\twindow.location.assign(next);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tsyncClass();\n\t}\n}\n\nif (!customElements.get(ELEMENT_NAME)) {\n\tcustomElements.define(ELEMENT_NAME, LiformaExperienceThumbnailElement);\n}\n\nexport { LiformaExperienceThumbnailElement };\n","/**\n * Thumbnail-only CDN IIFE — registers `<liforma-experience-thumbnail>` without\n * the session player (`<liforma-experience>`) or widget.\n *\n * Reference the exported class so Rollup keeps the module (customElements.define\n * runs at import time). A bare side-effect import is tree-shaken in lib mode.\n */\nimport { LiformaExperienceThumbnailElement } from './liforma-experience-thumbnail';\n\ndeclare global {\n\tinterface Window {\n\t\tLiformaThumbnail?: {\n\t\t\treadonly sdkVersion: 'v2';\n\t\t\treadonly element: typeof LiformaExperienceThumbnailElement;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D,IAAM,EAAO,EAAqB,CACjC,aAAc,GAAgB,IAAA,GAC9B,cAAe,KAAK,aAAa,iBAAiB,GAAK,IAAA,GACvD,0BAA2B,EAC5B,CAAC,EAEA,GACA,EAAM,SAAW,GACjB,CAAC,EAAM,SACP,CAAC,EAAM,SACP,CAAC,EAAM,WAEP,EAAM,eAAe,EACrB,OAAO,SAAS,OAAO,CAAI,EAE7B,CACD,CAAC,EAED,EAAU,CACX,CACD,EAEK,eAAe,IAAI,CAAY,GACnC,eAAe,OAAO,EAAc,CAAiC,ECrVtE,OAAO,iBAAmB,CACzB,WAAY,KACZ,QAAS,CACV"}
|
|
@@ -57,6 +57,7 @@
|
|
|
57
57
|
mode,
|
|
58
58
|
speechInputMode,
|
|
59
59
|
startButton,
|
|
60
|
+
theme,
|
|
60
61
|
showFeedback,
|
|
61
62
|
closeButton,
|
|
62
63
|
conversationProcessor,
|
|
@@ -72,6 +73,7 @@
|
|
|
72
73
|
returnUrl,
|
|
73
74
|
onReady,
|
|
74
75
|
onStarted,
|
|
76
|
+
onSessionMinted,
|
|
75
77
|
onUserTranscript,
|
|
76
78
|
onUserSpeechStarted,
|
|
77
79
|
onUserSpeechEnded,
|
|
@@ -259,6 +261,10 @@
|
|
|
259
261
|
generation.ready.resolve(event);
|
|
260
262
|
onReady?.(event);
|
|
261
263
|
});
|
|
264
|
+
subscribe(generation, session, 'sessionMinted', (event) => {
|
|
265
|
+
if (generation.destroyed) return;
|
|
266
|
+
onSessionMinted?.(event);
|
|
267
|
+
});
|
|
262
268
|
subscribe(generation, session, 'started', (event) => {
|
|
263
269
|
if (generation.destroyed) return;
|
|
264
270
|
generation.started.resolve(event);
|
|
@@ -382,6 +388,7 @@
|
|
|
382
388
|
container,
|
|
383
389
|
fit: untrack(() => fit),
|
|
384
390
|
startButton: untrack(() => startButton),
|
|
391
|
+
theme: untrack(() => theme),
|
|
385
392
|
showFeedback: untrack(() => showFeedback),
|
|
386
393
|
closeButton: untrack(() => closeButton),
|
|
387
394
|
returnUrl: untrack(() => returnUrl),
|
|
@@ -492,6 +499,10 @@
|
|
|
492
499
|
return withSession((session) => session.conversion(key));
|
|
493
500
|
}
|
|
494
501
|
|
|
502
|
+
export function engage(): Promise<void> {
|
|
503
|
+
return withSession((session) => session.engage());
|
|
504
|
+
}
|
|
505
|
+
|
|
495
506
|
export function end(): Promise<void> {
|
|
496
507
|
return withSession((session) => session.end());
|
|
497
508
|
}
|
|
@@ -18,6 +18,7 @@ declare const Experience: import("svelte").Component<ExperienceProps, {
|
|
|
18
18
|
focusCharacter: (characterId: string) => Promise<void>;
|
|
19
19
|
setFit: (nextFit: NonNullable<ExperienceProps["fit"]>) => Promise<void>;
|
|
20
20
|
conversion: (key: string) => Promise<void>;
|
|
21
|
+
engage: () => Promise<void>;
|
|
21
22
|
end: () => Promise<void>;
|
|
22
23
|
}, "">;
|
|
23
24
|
type Experience = ReturnType<typeof Experience>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as ExperienceThumbnail } from './ExperienceThumbnail.svelte';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@liforma/client",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.8",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Liforma browser SDK — Experience sessions, speech API, and Svelte embed component.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
"publishConfig": {
|
|
16
16
|
"access": "public"
|
|
17
17
|
},
|
|
18
|
+
"sideEffects": false,
|
|
18
19
|
"exports": {
|
|
19
20
|
".": {
|
|
20
21
|
"types": "./dist/npm/v2/npm.d.ts",
|
|
@@ -25,14 +26,31 @@
|
|
|
25
26
|
"import": "./dist/svelte/index.js",
|
|
26
27
|
"svelte": "./dist/svelte/index.js"
|
|
27
28
|
},
|
|
29
|
+
"./svelte/thumbnail": {
|
|
30
|
+
"types": "./dist/svelte/thumbnail.d.ts",
|
|
31
|
+
"import": "./dist/svelte/thumbnail.js",
|
|
32
|
+
"svelte": "./dist/svelte/thumbnail.js"
|
|
33
|
+
},
|
|
34
|
+
"./thumbnail": {
|
|
35
|
+
"types": "./dist/npm/thumbnail/index.d.ts",
|
|
36
|
+
"import": "./dist/npm/thumbnail/index.js"
|
|
37
|
+
},
|
|
28
38
|
"./react": {
|
|
29
39
|
"types": "./dist/react/react/index.d.ts",
|
|
30
40
|
"import": "./dist/react/index.js"
|
|
31
41
|
},
|
|
42
|
+
"./react/thumbnail": {
|
|
43
|
+
"types": "./dist/react/react/thumbnail.d.ts",
|
|
44
|
+
"import": "./dist/react/thumbnail.js"
|
|
45
|
+
},
|
|
32
46
|
"./next": {
|
|
33
47
|
"types": "./dist/next/next/index.d.ts",
|
|
34
48
|
"import": "./dist/next/index.js"
|
|
35
49
|
},
|
|
50
|
+
"./next/thumbnail": {
|
|
51
|
+
"types": "./dist/next/next/thumbnail.d.ts",
|
|
52
|
+
"import": "./dist/next/thumbnail.js"
|
|
53
|
+
},
|
|
36
54
|
"./byo": {
|
|
37
55
|
"types": "./dist/byo/index.d.ts",
|
|
38
56
|
"import": "./dist/byo/index.js"
|
|
@@ -100,8 +118,8 @@
|
|
|
100
118
|
},
|
|
101
119
|
"scripts": {
|
|
102
120
|
"build": "npm run build:v2 && npm run build:npm && npm run build:svelte && npm run build:react && npm run build:next && npm run build:byo && npm run build:elevenlabs && npm run build:openai && npm run build:deepgram && npm run build:google && npm run build:livekit && npm run copy:preview",
|
|
103
|
-
"build:react": "vite build --config vite.config.react.ts && tsc -p tsconfig.react.json",
|
|
104
|
-
"build:next": "vite build --config vite.config.next.ts && tsc -p tsconfig.next.json",
|
|
121
|
+
"build:react": "vite build --config vite.config.react.ts && vite build --config vite.config.react-thumbnail.ts && tsc -p tsconfig.react.json",
|
|
122
|
+
"build:next": "vite build --config vite.config.next.ts && vite build --config vite.config.next-thumbnail.ts && tsc -p tsconfig.next.json",
|
|
105
123
|
"build:byo": "vite build --config vite.config.byo.ts && tsc -p tsconfig.byo.json",
|
|
106
124
|
"build:elevenlabs": "vite build --config vite.config.elevenlabs.ts && tsc -p tsconfig.elevenlabs.json",
|
|
107
125
|
"build:openai": "vite build --config vite.config.openai.ts && tsc -p tsconfig.openai.json",
|
|
@@ -109,8 +127,8 @@
|
|
|
109
127
|
"build:google": "vite build --config vite.config.google.ts && tsc -p tsconfig.google.json",
|
|
110
128
|
"build:livekit": "vite build --config vite.config.livekit.ts && tsc -p tsconfig.livekit.json",
|
|
111
129
|
"copy:preview": "mkdir -p dist/preview && cp preview/v2-embed-test.html dist/preview/ && cp preview/v2-embed-test-redirect.html dist/preview/",
|
|
112
|
-
"build:v2": "vite build --config vite.config.v2.ts",
|
|
113
|
-
"build:npm": "vite build --config vite.config.npm.ts && tsc -p tsconfig.npm.json",
|
|
130
|
+
"build:v2": "vite build --config vite.config.v2.ts && vite build --config vite.config.v2-thumbnail.ts",
|
|
131
|
+
"build:npm": "vite build --config vite.config.npm.ts && vite build --config vite.config.thumbnail.ts && tsc -p tsconfig.npm.json",
|
|
114
132
|
"build:svelte": "svelte-package -i src/svelte -o dist/svelte && vite build --config vite.config.svelte.ts",
|
|
115
133
|
"check:consumer": "svelte-check --workspace test/consumer --tsconfig ./tsconfig.json",
|
|
116
134
|
"test": "vitest run",
|
|
@@ -182,7 +200,7 @@
|
|
|
182
200
|
"deploy:worker:avatar-compose": "node scripts/deploy-avatar-compose-worker.mjs",
|
|
183
201
|
"deploy:worker:experience-thumb": "node scripts/deploy-experience-thumb-worker.mjs",
|
|
184
202
|
"deploy": "npm run build && npm run publish:sdk",
|
|
185
|
-
"verify": "npm run build && node scripts/check-sdk-size.mjs && node scripts/test-embed-protocol.mjs && node scripts/test-manifest-embed-url.mjs && node scripts/test-player-reachability.mjs && node scripts/test-session-endpoint.mjs && node scripts/verify-package.mjs",
|
|
203
|
+
"verify": "npm run build && node scripts/check-sdk-size.mjs && node scripts/verify-thumbnail-light.mjs && node scripts/test-embed-protocol.mjs && node scripts/test-manifest-embed-url.mjs && node scripts/test-player-reachability.mjs && node scripts/test-session-endpoint.mjs && node scripts/verify-package.mjs",
|
|
186
204
|
"preview:test": "npm run build && npm run preview"
|
|
187
205
|
},
|
|
188
206
|
"dependencies": {
|