@streamscloud/embeddable 2.6.1 → 2.7.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,5 +1,6 @@
1
1
  <script lang="ts">var _a;
2
2
  import { toPriceRepresentation } from '../../../products/price-helper';
3
+ import { LineClamp } from '../../../ui/line-clamp';
3
4
  import { PriceStreamElementLocalization } from './price-stream-element-localization';
4
5
  import { default as StockElementView } from './cmp.stock-stream-element.svelte';
5
6
  import { mapFlexJustifyContent, mapFontFamily, mapFontWeight, transformColorValue, transformFontSizeValue, transformNumericValue } from '../styles-transformer';
@@ -91,7 +92,9 @@ const stockElementHeight = $derived(elementHeight * 0.23);
91
92
  </div>
92
93
  {/if}
93
94
  {#if model.textAfter}
94
- <div class="price-stream-element__text-after" style={textAfterCustomStyles}>{model.textAfter}</div>
95
+ <div class="price-stream-element__text-after" style={textAfterCustomStyles}>
96
+ <LineClamp value={model.textAfter} maxLines={1} />
97
+ </div>
95
98
  {/if}
96
99
  </div>
97
100
  {#if model.stock}
@@ -115,4 +118,7 @@ const stockElementHeight = $derived(elementHeight * 0.23);
115
118
  height: 100%;
116
119
  flex-direction: column;
117
120
  justify-content: space-between;
121
+ }
122
+ .price-stream-element__price, .price-stream-element__save, .price-stream-element__before-price {
123
+ white-space: nowrap;
118
124
  }</style>
@@ -27,7 +27,7 @@ import { StreamPlayerLocalization } from './stream-player-localization';
27
27
  import { StreamPlayerUiManager } from './ui-manager.svelte';
28
28
  import { AppEventsTracker } from '@streamscloud/streams-analytics-collector';
29
29
  import { onMount } from 'svelte';
30
- let { streamId, graphqlOrigin, localization: localizationInit, on } = $props();
30
+ let { streamId, graphqlOrigin, localization: localizationInit, showStreamsCloudWatermark, on } = $props();
31
31
  const localization = $derived(new StreamPlayerLocalization(localizationInit));
32
32
  let model = $state(null);
33
33
  let buffer = $state.raw(null);
@@ -174,6 +174,13 @@ const onProgress = (pageId, videoId, progress) => {
174
174
  <Loading positionAbsoluteCenter={true} timeout={600} />
175
175
  {/if}
176
176
  <div class="stream-player" style={uiManager.globalCssVariables}>
177
+ {#if showStreamsCloudWatermark}
178
+ <div class="stream-player__watermark">
179
+ <a href="https://streamscloud.com/" tabindex="-1" aria-label="none">
180
+ <img src="/watermark.svg" alt="watermark" />
181
+ </a>
182
+ </div>
183
+ {/if}
177
184
  {#if buffer && model}
178
185
  <SpotlightLayout ratio={9 / 16} on={{ dimensionsChanged: handleDimensionsChanged }}>
179
186
  <div class="stream-player__content" use:contentMounted>
@@ -265,6 +272,11 @@ const onProgress = (pageId, videoId, progress) => {
265
272
  padding: 0;
266
273
  }
267
274
  }
275
+ .stream-player__watermark {
276
+ position: absolute;
277
+ bottom: 5rem;
278
+ left: 20rem;
279
+ }
268
280
  .stream-player__content {
269
281
  width: 100%;
270
282
  height: 100%;
@@ -4,6 +4,7 @@ type Props = {
4
4
  streamId: string;
5
5
  localization: IStreamPlayerLocalization | Locale;
6
6
  graphqlOrigin?: string;
7
+ showStreamsCloudWatermark?: boolean;
7
8
  on?: {
8
9
  closePlayer?: () => void;
9
10
  streamActivated?: (data: {
@@ -27,6 +27,7 @@ export declare const openStreamPlayer: (init: {
27
27
  streamId: string;
28
28
  graphqlOrigin?: string;
29
29
  localization?: IStreamPlayerLocalization | "en" | "no";
30
+ showStreamsCloudWatermark?: boolean;
30
31
  on?: {
31
32
  streamActivated?: (data: {
32
33
  title: string;
@@ -27,7 +27,7 @@ import { mount, unmount } from 'svelte';
27
27
  * ```
28
28
  */
29
29
  export const openStreamPlayer = (init) => {
30
- const { streamId, graphqlOrigin, localization } = init;
30
+ const { streamId, graphqlOrigin, localization, showStreamsCloudWatermark } = init;
31
31
  const shadowHost = new ShadowHost();
32
32
  const mounted = mount(StreamPlayer, {
33
33
  target: shadowHost.shadowRoot,
@@ -35,6 +35,7 @@ export const openStreamPlayer = (init) => {
35
35
  streamId,
36
36
  graphqlOrigin,
37
37
  localization: getLocale(localization),
38
+ showStreamsCloudWatermark,
38
39
  on: {
39
40
  streamActivated: (data) => {
40
41
  AppEventsTracker.setOrganizationId(data.ownerId);
package/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "@streamscloud/embeddable",
3
- "version": "2.6.1",
3
+ "version": "2.7.0",
4
4
  "author": "StreamsCloud",
5
5
  "repository": "https://github.com/StreamsCloud/streamscloud-frontend-packages.git",
6
6
  "type": "module",
7
7
  "scripts": {
8
8
  "dev": "vite dev --port 3010",
9
9
  "build": "svelte-package --tsconfig ./tsconfig.app.json && prettier --write --plugin prettier-plugin-svelte . && eslint --fix .",
10
+ "publish": "npm publish --access public",
10
11
  "pack": "npm run build && npm pack",
11
12
  "preview": "vite preview",
12
13
  "check": "svelte-check --tsconfig ./tsconfig.app.json && tsc -p tsconfig.node.json",