@streamscloud/embeddable 17.0.3 → 17.0.5

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.
@@ -22,6 +22,8 @@ $effect(() => {
22
22
  }
23
23
  });
24
24
  const localization = new FeedPlayerLocalization();
25
+ // ── Mode ──
26
+ const isPreview = $derived(settings?.mode === 'preview');
25
27
  // ── Background mode ──
26
28
  const isGlassBackground = $derived(settings?.background === 'glass');
27
29
  const isTransparentBackground = $derived(settings?.background === 'transparent');
@@ -296,13 +298,15 @@ const itemActions = $derived.by(() => {
296
298
  enableAttachments={false}
297
299
  enableControls={showControlsOverlay}
298
300
  autoplay="on-appearance"
299
- on={{
300
- productClick: onProductClick,
301
- productImpression: onProductImpression,
302
- adClick: onAdClick,
303
- adImpression: onAdImpression,
304
- articleReadMore: (id) => on?.articleReadMore?.(id)
305
- }} />
301
+ on={isPreview
302
+ ? {}
303
+ : {
304
+ productClick: onProductClick,
305
+ productImpression: onProductImpression,
306
+ adClick: onAdClick,
307
+ adImpression: onAdImpression,
308
+ articleReadMore: (id) => on?.articleReadMore?.(id)
309
+ }} />
306
310
  </div>
307
311
  {/snippet}
308
312
  </FeedSlider>
@@ -348,22 +352,25 @@ const itemActions = $derived.by(() => {
348
352
  model={currentPostModel}
349
353
  trackingParams={currentTrackingParams}
350
354
  selectedProductId={selectedProductId}
355
+ interactionsDisabled={isPreview}
351
356
  recommendedHandler={recommendedHandler}
352
357
  playlistHandler={playlistHandler}
353
- on={{
354
- tabChange: handleTabChange,
355
- productClick: onProductClick,
356
- productImpression: onProductImpression,
357
- productBuy: on?.productBuy,
358
- productSelect: (id) => {
359
- selectedProductId = id;
360
- handleTabChange('product');
361
- },
362
- adClick: onAdClick,
363
- adImpression: onAdImpression,
364
- articleReadMore: on?.articleReadMore,
365
- postActivate: (id) => buffer?.tryActivateItemById(id)
366
- }} />
358
+ on={isPreview
359
+ ? { tabChange: () => {} }
360
+ : {
361
+ tabChange: handleTabChange,
362
+ productClick: onProductClick,
363
+ productImpression: onProductImpression,
364
+ productBuy: on?.productBuy,
365
+ productSelect: (id) => {
366
+ selectedProductId = id;
367
+ handleTabChange('product');
368
+ },
369
+ adClick: onAdClick,
370
+ adImpression: onAdImpression,
371
+ articleReadMore: on?.articleReadMore,
372
+ postActivate: (id) => buffer?.tryActivateItemById(id)
373
+ }} />
367
374
  </div>
368
375
  {/if}
369
376
  </div>
@@ -455,6 +462,7 @@ const itemActions = $derived.by(() => {
455
462
  min-width: 0;
456
463
  min-height: 0;
457
464
  position: relative;
465
+ padding-top: 0.625rem;
458
466
  padding-bottom: 0.625rem;
459
467
  overflow: hidden;
460
468
  }
@@ -10,11 +10,11 @@ const selectedProduct = $derived.by(() => {
10
10
  }
11
11
  return model.attachments.products.find((p) => p.id === selectedProductId) ?? null;
12
12
  });
13
- let { tabs, activeTabId, model, trackingParams, selectedProductId, recommendedHandler, playlistHandler, on } = $props();
13
+ let { tabs, activeTabId, model, trackingParams, selectedProductId, interactionsDisabled, recommendedHandler, playlistHandler, on } = $props();
14
14
  </script>
15
15
 
16
16
  <div class="sidebar-panel">
17
- <SidebarTabBar tabs={tabs} activeTabId={activeTabId} on={{ tabChange: on.tabChange }} />
17
+ <SidebarTabBar tabs={tabs} activeTabId={activeTabId} disabled={interactionsDisabled} on={{ tabChange: on.tabChange }} />
18
18
 
19
19
  <div class="sidebar-panel__content">
20
20
  {#if activeTabId === 'information'}
@@ -8,6 +8,7 @@ type Props = {
8
8
  model: PostModel;
9
9
  trackingParams: TrackingParams;
10
10
  selectedProductId: string | null;
11
+ interactionsDisabled?: boolean;
11
12
  recommendedHandler?: IFeedPlayerRecommendedHandler;
12
13
  playlistHandler?: IFeedPlayerPlaylistHandler;
13
14
  on: {
@@ -1,8 +1,8 @@
1
- <script lang="ts">let { tabs, activeTabId, on } = $props();
1
+ <script lang="ts">let { tabs, activeTabId, disabled, on } = $props();
2
2
  export {};
3
3
  </script>
4
4
 
5
- <div class="sidebar-tab-bar">
5
+ <div class="sidebar-tab-bar" class:sidebar-tab-bar--disabled={disabled}>
6
6
  {#each tabs as tab (tab.id)}
7
7
  <button type="button" class="sidebar-tab-bar__tab" class:sidebar-tab-bar__tab--active={tab.id === activeTabId} onclick={() => on.tabChange(tab.id)}>
8
8
  {tab.label}
@@ -42,4 +42,8 @@ export {};
42
42
  .sidebar-tab-bar__tab--active {
43
43
  font-weight: 500;
44
44
  color: var(--_sidebar-tab-bar--color-active);
45
+ }
46
+ .sidebar-tab-bar--disabled .sidebar-tab-bar__tab:not(.sidebar-tab-bar__tab--active) {
47
+ pointer-events: none;
48
+ opacity: 0.5;
45
49
  }</style>
@@ -2,6 +2,7 @@ import type { SidebarTab } from './types';
2
2
  type Props = {
3
3
  tabs: SidebarTab[];
4
4
  activeTabId: string;
5
+ disabled?: boolean;
5
6
  on: {
6
7
  tabChange: (id: string) => void;
7
8
  };
@@ -63,4 +63,5 @@ export type FeedPlayerProps = {
63
63
  export type FeedPlayerSettings = {
64
64
  locale?: AppLocaleValue;
65
65
  background?: 'solid' | 'glass' | 'transparent';
66
+ mode?: 'default' | 'preview';
66
67
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@streamscloud/embeddable",
3
- "version": "17.0.3",
3
+ "version": "17.0.5",
4
4
  "author": "StreamsCloud",
5
5
  "repository": {
6
6
  "type": "git",