@streamscloud/embeddable 16.0.5 → 16.0.7

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.
@@ -33,4 +33,4 @@ const initHost = (node) => {
33
33
  };
34
34
  </script>
35
35
 
36
- <div class="streams-player-host" use:initHost></div>
36
+ <div class="media-page-host" use:initHost></div>
@@ -1,8 +1,13 @@
1
1
  <script lang="ts">import { CloseOrchestrator } from '../../ui/player/close-orchestrator';
2
2
  import { createShadowRoot } from '../../ui/shadow-dom';
3
+ import { PostsPlayerHostSettings } from './posts-player-host-settings.svelte';
3
4
  import { default as PostsPlayerProxy } from './posts-player-proxy.svelte';
4
- import { mount, unmount } from 'svelte';
5
+ import { mount, unmount, untrack } from 'svelte';
5
6
  let { dataProvider, socialInteractionsHandler, sharingHandler, playerSettings, analyticsHandler, on } = $props();
7
+ const settingsHolder = untrack(() => new PostsPlayerHostSettings(playerSettings));
8
+ $effect(() => {
9
+ settingsHolder.update(playerSettings);
10
+ });
6
11
  const initHost = (node) => {
7
12
  const shadowRoot = createShadowRoot(node);
8
13
  const mounted = mount(PostsPlayerProxy, {
@@ -11,7 +16,7 @@ const initHost = (node) => {
11
16
  dataProvider,
12
17
  socialInteractionsHandler,
13
18
  sharingHandler,
14
- playerSettings,
19
+ playerSettings: settingsHolder,
15
20
  analyticsHandler,
16
21
  closeOrchestrator: new CloseOrchestrator({
17
22
  closeFn: async () => {
@@ -0,0 +1,20 @@
1
+ import type { ThemeValue } from '../../core/theme';
2
+ import type { AppLocaleValue } from '@streamscloud/kit/core/locale';
3
+ export declare class PostsPlayerHostSettings {
4
+ locale: AppLocaleValue | undefined;
5
+ showStreamsCloudWatermark: boolean | undefined;
6
+ disableBackground: boolean | undefined;
7
+ theme: ThemeValue | undefined;
8
+ constructor(init: {
9
+ locale?: AppLocaleValue;
10
+ showStreamsCloudWatermark?: boolean;
11
+ disableBackground?: boolean;
12
+ theme?: ThemeValue;
13
+ } | undefined);
14
+ update: (data: {
15
+ locale?: AppLocaleValue;
16
+ showStreamsCloudWatermark?: boolean;
17
+ disableBackground?: boolean;
18
+ theme?: ThemeValue;
19
+ } | undefined) => void;
20
+ }
@@ -0,0 +1,15 @@
1
+ export class PostsPlayerHostSettings {
2
+ locale = $state();
3
+ showStreamsCloudWatermark = $state();
4
+ disableBackground = $state();
5
+ theme = $state();
6
+ constructor(init) {
7
+ this.update(init);
8
+ }
9
+ update = (data) => {
10
+ this.locale = data?.locale;
11
+ this.showStreamsCloudWatermark = data?.showStreamsCloudWatermark;
12
+ this.disableBackground = data?.disableBackground;
13
+ this.theme = data?.theme;
14
+ };
15
+ }
@@ -93,11 +93,7 @@ const productLinkMounted = (node, productModel) => {
93
93
  {@render slotContent()}
94
94
  </a>
95
95
  {:else}
96
- <button
97
- type="button"
98
- class="stream-slot-content-product-link"
99
- onclick={handleProductClick}
100
- use:productLinkMounted={productModel}>
96
+ <button type="button" class="stream-slot-content-product-link" onclick={handleProductClick} use:productLinkMounted={productModel}>
101
97
  {@render slotContent()}
102
98
  </button>
103
99
  {/if}
@@ -1,8 +1,13 @@
1
1
  <script lang="ts">import { CloseOrchestrator } from '../../ui/player/close-orchestrator';
2
2
  import { createShadowRoot } from '../../ui/shadow-dom';
3
+ import { StreamsPlayerHostSettings } from './streams-player-host-settings.svelte';
3
4
  import { default as StreamsPlayerProxy } from './streams-player-proxy.svelte';
4
- import { mount, unmount } from 'svelte';
5
+ import { mount, unmount, untrack } from 'svelte';
5
6
  let { dataProvider, postSocialInteractionsHandler, sharingHandler, amplificationParameters, playerSettings, analyticsHandler, on } = $props();
7
+ const settingsHolder = untrack(() => new StreamsPlayerHostSettings(playerSettings));
8
+ $effect(() => {
9
+ settingsHolder.update(playerSettings);
10
+ });
6
11
  const initHost = (node) => {
7
12
  const shadowRoot = createShadowRoot(node);
8
13
  const mounted = mount(StreamsPlayerProxy, {
@@ -13,7 +18,7 @@ const initHost = (node) => {
13
18
  sharingHandler,
14
19
  analyticsHandler,
15
20
  amplificationParameters,
16
- playerSettings,
21
+ playerSettings: settingsHolder,
17
22
  closeOrchestrator: new CloseOrchestrator({
18
23
  closeFn: async () => {
19
24
  await unmount(mounted);
@@ -0,0 +1,20 @@
1
+ import type { ThemeValue } from '../../core/theme';
2
+ import type { AppLocaleValue } from '@streamscloud/kit/core/locale';
3
+ export declare class StreamsPlayerHostSettings {
4
+ locale: AppLocaleValue | undefined;
5
+ showStreamsCloudWatermark: boolean | undefined;
6
+ disableBackground: boolean | undefined;
7
+ theme: ThemeValue | undefined;
8
+ constructor(init: {
9
+ locale?: AppLocaleValue;
10
+ showStreamsCloudWatermark?: boolean;
11
+ disableBackground?: boolean;
12
+ theme?: ThemeValue;
13
+ } | undefined);
14
+ update: (data: {
15
+ locale?: AppLocaleValue;
16
+ showStreamsCloudWatermark?: boolean;
17
+ disableBackground?: boolean;
18
+ theme?: ThemeValue;
19
+ } | undefined) => void;
20
+ }
@@ -0,0 +1,15 @@
1
+ export class StreamsPlayerHostSettings {
2
+ locale = $state();
3
+ showStreamsCloudWatermark = $state();
4
+ disableBackground = $state();
5
+ theme = $state();
6
+ constructor(init) {
7
+ this.update(init);
8
+ }
9
+ update = (data) => {
10
+ this.locale = data?.locale;
11
+ this.showStreamsCloudWatermark = data?.showStreamsCloudWatermark;
12
+ this.disableBackground = data?.disableBackground;
13
+ this.theme = data?.theme;
14
+ };
15
+ }
@@ -81,6 +81,7 @@ const styles = $derived.by(() => {
81
81
  --sc-mc-color--text-secondary: light-dark(#6b7280, #d1d5db);
82
82
  --sc-mc-color--text-white: #ffffff;
83
83
  --sc-mc-color--text-white-shadow: 0 1px 0 rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 6px rgba(0, 0, 0, 0.05);
84
+ color: var(--sc-mc-color--text-primary);
84
85
  /* Player brand colors — overridable via --sc-player--{light|dark}--{name} custom properties */
85
86
  --sc-player--background: light-dark(
86
87
  var(--sc-player--light--background, rgb(from var(--sc-mc-color--bg-screen) r g b / 90%)),
@@ -128,10 +129,14 @@ const styles = $derived.by(() => {
128
129
  height: 100%;
129
130
  min-height: 100%;
130
131
  max-height: 100%;
132
+ box-sizing: border-box;
131
133
  container-type: inline-size;
132
134
  display: flex;
133
135
  flex-direction: column;
136
+ font: 400 16px Inter, sans-serif, arial;
137
+ line-height: 1.15;
134
138
  position: relative;
139
+ text-align: initial;
135
140
  }
136
141
  .shadow-root:before {
137
142
  content: "";
@@ -38,6 +38,8 @@
38
38
  --sc-mc-color--text-white: #{colors.$color-white};
39
39
  --sc-mc-color--text-white-shadow: 0 1px 0 rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 6px rgba(0, 0, 0, 0.05);
40
40
 
41
+ color: var(--sc-mc-color--text-primary);
42
+
41
43
  /* Player brand colors — overridable via --sc-player--{light|dark}--{name} custom properties */
42
44
  --sc-player--background: light-dark(
43
45
  var(--sc-player--light--background, rgb(from var(--sc-mc-color--bg-screen) r g b / 90%)),
@@ -10,11 +10,4 @@ export const createShadowRoot = (host) => {
10
10
  };
11
11
  const prepareShadowRootHost = (host) => {
12
12
  host.style.all = 'unset';
13
- host.style.lineHeight = '1.15';
14
- host.style.font = '16px Inter, sans-serif, arial';
15
- host.style.fontWeight = '400';
16
- host.style.margin = '0';
17
- host.style.boxSizing = 'border-box';
18
- host.style.textAlign = 'initial';
19
- host.style.color = 'var(--sc-mc-color--text-primary)';
20
13
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@streamscloud/embeddable",
3
- "version": "16.0.5",
3
+ "version": "16.0.7",
4
4
  "author": "StreamsCloud",
5
5
  "repository": {
6
6
  "type": "git",
@@ -16,6 +16,7 @@
16
16
  "pack": "npm run build && npm pack",
17
17
  "preview": "vite preview",
18
18
  "check": "svelte-check --tsconfig ./tsconfig.app.json && tsc -p tsconfig.node.json",
19
+ "check:strict": "svelte-check --tsconfig ./tsconfig.app.json --fail-on-warnings --output machine && eslint . --format codeframe --max-warnings 0 && prettier --check --plugin prettier-plugin-svelte --cache .",
19
20
  "uad": "graphql-codegen --config codegen.yml && prettier --write src/**/*.generated.ts src/gql/*",
20
21
  "uad-types-only": "graphql-codegen --config codegen.types-only.yml && prettier --write src/gql/*",
21
22
  "lint": "prettier --check --plugin prettier-plugin-svelte . && eslint .",
@@ -133,7 +134,7 @@
133
134
  }
134
135
  },
135
136
  "peerDependencies": {
136
- "@streamscloud/kit": "^0.1.8",
137
+ "@streamscloud/kit": "^0.1.12",
137
138
  "@streamscloud/streams-analytics-collector": "^4.0.1",
138
139
  "svelte": "^5.51.0"
139
140
  },
@@ -149,7 +150,7 @@
149
150
  "@graphql-codegen/typescript": "^5.0.7",
150
151
  "@graphql-codegen/typescript-operations": "^5.0.7",
151
152
  "@graphql-typed-document-node/core": "^3.2.0",
152
- "@streamscloud/kit": "^0.1.8",
153
+ "@streamscloud/kit": "^0.1.12",
153
154
  "@streamscloud/streams-analytics-collector": "^4.0.1",
154
155
  "@sveltejs/package": "^2.5.7",
155
156
  "@sveltejs/vite-plugin-svelte": "^6.2.4",