@streamscloud/embeddable 14.0.3 → 14.0.4

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.
@@ -109,14 +109,13 @@ const variables = $derived.by(() => {
109
109
  <div
110
110
  class="attachments-horizontal__item"
111
111
  class:attachments-horizontal__item--single={attachmentsToShow.length === 1}
112
- data-theme={attachment.isAd ? 'default' : 'dark'}
113
112
  onclick={() => handleAttachmentClick(attachment)}
114
113
  onkeydown={() => {}}
115
114
  role="none"
116
115
  bind:this={attachmentElements[attachment.productId ? `product-${attachment.productId}` : `ad-${attachment.adId}`]}
117
116
  data-product-id={attachment.productId || undefined}
118
117
  data-ad-id={attachment.adId || undefined}>
119
- <div class="attachments-card" class:attachments-card--single={attachmentsToShow.length === 1}>
118
+ <div class="attachments-card" class:attachments-card--single={attachmentsToShow.length === 1} class:attachments-card--dark={!attachment.isAd}>
120
119
  <div class="attachments-card__thumb">
121
120
  <ImageRounded src={attachment.image} alt="" noBorders={true} />
122
121
  </div>
@@ -187,17 +186,27 @@ const variables = $derived.by(() => {
187
186
  }
188
187
 
189
188
  .attachments-card {
189
+ --_attachments-card--background-color: #ffffff;
190
+ --_attachments-card--border-color: #f2f2f2;
191
+ --_attachments-card--text--color: #000000;
192
+ --_attachments-card--text--secondary--color: #6b7280;
190
193
  display: grid;
191
194
  grid-template-columns: 2.375rem 1fr;
192
195
  grid-column-gap: 0.75rem;
193
196
  align-items: center;
194
197
  width: 15.625rem;
195
198
  padding: 0.375rem;
196
- background-color: rgb(from var(--sc-mc-color--bg-card) r g b/90%);
197
- color: var(--sc-mc-color--text-primary);
198
- border: 0.0625rem solid var(--sc-mc-color--border-card);
199
+ background-color: rgb(from var(--_attachments-card--background-color) r g b/90%);
200
+ color: var(--_attachments-card--text--color);
201
+ border: 0.0625rem solid var(--_attachments-card--border-color);
199
202
  border-radius: 0.25rem;
200
203
  }
204
+ .attachments-card--dark {
205
+ --_attachments-card--background-color: #000000;
206
+ --_attachments-card--border-color: #000000;
207
+ --_attachments-card--text--color: #ffffff;
208
+ --_attachments-card--text--secondary--color: #d1d5db;
209
+ }
201
210
  .attachments-card--single {
202
211
  width: 100%;
203
212
  }
@@ -222,7 +231,7 @@ const variables = $derived.by(() => {
222
231
  }
223
232
  .attachments-card__extra-info {
224
233
  font-size: 0.625rem;
225
- color: var(--sc-mc-color--text-secondary);
234
+ color: var(--_attachments-card--text--secondary--color);
226
235
  white-space: nowrap;
227
236
  overflow: hidden;
228
237
  text-overflow: ellipsis;
@@ -41,6 +41,8 @@ const variables = $derived.by(() => {
41
41
  }
42
42
  }
43
43
  .post-viewer-heading {
44
+ --_post-viewer-heading-texts--color: #ffffff;
45
+ --_post-viewer-heading--text--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);
44
46
  display: flex;
45
47
  align-items: center;
46
48
  padding: var(--_post-viewer--heading--padding);
@@ -67,8 +69,8 @@ const variables = $derived.by(() => {
67
69
  font-size: 0.75rem;
68
70
  line-height: 0.9375rem;
69
71
  font-weight: 500;
70
- color: var(--sc-mc-color--text-white);
71
- text-shadow: var(--sc-mc-color--text-white-shadow);
72
+ color: var(--_post-viewer-heading-texts--color);
73
+ text-shadow: var(--_post-viewer-heading--text--shadow);
72
74
  text-overflow: ellipsis;
73
75
  width: 100%;
74
76
  white-space: nowrap;
@@ -79,6 +81,6 @@ const variables = $derived.by(() => {
79
81
  font-size: 0.625rem;
80
82
  line-height: 0.75rem;
81
83
  font-weight: 400;
82
- color: var(--sc-mc-color--text-white);
83
- text-shadow: var(--sc-mc-color--text-white-shadow);
84
+ color: var(--_post-viewer-heading-texts--color);
85
+ text-shadow: var(--_post-viewer-heading--text--shadow);
84
86
  }</style>
@@ -46,13 +46,17 @@ let { id, media, locale, autoplay = 'on-appearance', on } = $props();
46
46
  }
47
47
  }
48
48
  .post-media {
49
+ --_post-media--background-color: #ffffff;
49
50
  width: 100%;
50
51
  min-width: 100%;
51
52
  max-width: 100%;
52
53
  height: 100%;
53
54
  min-height: 100%;
54
55
  max-height: 100%;
55
- background-color: rgb(from var(--sc-mc-color--bg-panel) r g b/60%);
56
+ background-color: rgb(from var(--_post-media--background-color) r g b/60%);
57
+ }
58
+ :global([data-theme="dark"]) .post-media {
59
+ --_post-media--background-color: #000000;
56
60
  }
57
61
  .post-media--fit {
58
62
  --video--media-fit: contain;
@@ -45,8 +45,10 @@ const variables = $derived.by(() => {
45
45
  }
46
46
  }
47
47
  .post-viewer-texts {
48
- color: var(--sc-mc-color--text-white);
49
- text-shadow: var(--sc-mc-color--text-white-shadow);
48
+ --_post-viewer-texts--color: #ffffff;
49
+ --_post-viewer-texts--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);
50
+ color: var(--_post-viewer-texts--color);
51
+ text-shadow: var(--_post-viewer-texts--shadow);
50
52
  padding: var(--_post-viewer-texts--padding);
51
53
  display: flex;
52
54
  flex-direction: column;
@@ -1,7 +1,7 @@
1
1
  <script lang="ts">var _a;
2
2
  import { StockStreamElementLocalization } from './stock-stream-element-localization';
3
3
  import { StockStreamElementLevel } from '../enums';
4
- import { mapFlexJustifyContent, transformNumericValue } from '../styles-transformer';
4
+ import { mapFlexJustifyContent, transformNumericValue, transformTextColorValue } from '../styles-transformer';
5
5
  let { model, heightOverrideDdu, locale } = $props();
6
6
  const localization = $derived(new StockStreamElementLocalization(locale));
7
7
  const height = $derived(heightOverrideDdu || ((_a = model.styles) === null || _a === void 0 ? void 0 : _a.height) || 16);
@@ -19,7 +19,8 @@ const dotCustomStyles = $derived.by(() => {
19
19
  return values.join('');
20
20
  });
21
21
  const quantityCustomStyles = $derived.by(() => {
22
- const values = [`font-size: ${transformNumericValue(height * 0.75)};`];
22
+ var _a;
23
+ const values = [`font-size: ${transformNumericValue(height * 0.75)};`, `color: ${transformTextColorValue((_a = model.styles) === null || _a === void 0 ? void 0 : _a.color)};`];
23
24
  return values.join('');
24
25
  });
25
26
  </script>
@@ -12,7 +12,7 @@ import { toPriceRepresentation } from '../../../products/price-helper';
12
12
  import { LineClamp } from '../../../ui/line-clamp';
13
13
  import { PriceStreamElementLocalization } from './price-stream-element-localization';
14
14
  import { default as StockElementView } from './cmp.stock-stream-element.svelte';
15
- import { mapFlexJustifyContent, mapFontFamily, mapFontWeight, transformColorValue, transformFontSizeValue, transformNumericValue } from '../styles-transformer';
15
+ import { mapFlexJustifyContent, mapFontFamily, mapFontWeight, transformTextColorValue, transformBackgroundColorValue, transformFontSizeValue, transformNumericValue } from '../styles-transformer';
16
16
  let { maxElementHeight, model, data, localization, on } = $props();
17
17
  let priceElementRef = $state.raw(null);
18
18
  let priceContainerRef = $state.raw(null);
@@ -62,7 +62,7 @@ const priceCustomStyles = $derived.by(() => {
62
62
  `font-size: ${transformFontSizeValue(priceHeight / lineHeight)};`,
63
63
  `line-height: ${lineHeight};`,
64
64
  `font-weight: ${mapFontWeight((_a = model.styles) === null || _a === void 0 ? void 0 : _a.fontWeight)};`,
65
- `color: ${transformColorValue(data.salePrice ? (_b = model.styles) === null || _b === void 0 ? void 0 : _b.salePriceColor : (_c = model.styles) === null || _c === void 0 ? void 0 : _c.regularPriceColor)};`
65
+ `color: ${transformTextColorValue(data.salePrice ? (_b = model.styles) === null || _b === void 0 ? void 0 : _b.salePriceColor : (_c = model.styles) === null || _c === void 0 ? void 0 : _c.regularPriceColor)};`
66
66
  ];
67
67
  return values.join('');
68
68
  });
@@ -74,8 +74,8 @@ const saveValueCustomStyles = $derived.by(() => {
74
74
  `font-weight: 500;`,
75
75
  `padding: ${transformNumericValue(priceHeight / 8)} ${transformNumericValue(priceHeight / 4)};`,
76
76
  `border-radius: ${transformNumericValue(priceHeight / 8)};`,
77
- `background-color: ${transformColorValue((_a = model.styles) === null || _a === void 0 ? void 0 : _a.saveValueBackgroundColor)};`,
78
- `color: ${transformColorValue((_b = model.styles) === null || _b === void 0 ? void 0 : _b.saveValueColor)};`
77
+ `background-color: ${transformBackgroundColorValue((_a = model.styles) === null || _a === void 0 ? void 0 : _a.saveValueBackgroundColor)};`,
78
+ `color: ${transformTextColorValue((_b = model.styles) === null || _b === void 0 ? void 0 : _b.saveValueColor)};`
79
79
  ];
80
80
  return values.join('');
81
81
  });
@@ -84,7 +84,7 @@ const beforeValueCustomStyles = $derived.by(() => {
84
84
  const values = [
85
85
  `font-size: ${transformFontSizeValue(priceHeight / 5)};`,
86
86
  `font-weight: 500;`,
87
- `color: ${transformColorValue((_a = model.styles) === null || _a === void 0 ? void 0 : _a.beforeValueColor)};`
87
+ `color: ${transformTextColorValue((_a = model.styles) === null || _a === void 0 ? void 0 : _a.beforeValueColor)};`
88
88
  ];
89
89
  return values.join('');
90
90
  });
@@ -13,4 +13,5 @@ export declare const mapTextAlign: (value: StreamElementStyleHorizontalAlign | n
13
13
  export declare const mapFlexJustifyContent: (value: StreamElementStyleHorizontalAlign | null | undefined) => "center" | "flex-start" | "flex-end";
14
14
  export declare const transformFontSizeValue: (value: number | null | undefined) => string;
15
15
  export declare const transformNumericValue: (value: number | null | undefined, fallback?: string) => string;
16
- export declare const transformColorValue: (value: string | null | undefined) => string;
16
+ export declare const transformTextColorValue: (value: string | null | undefined) => string;
17
+ export declare const transformBackgroundColorValue: (value: string | null | undefined) => string;
@@ -4,7 +4,7 @@ export const generateStreamLayoutStyles = (styles) => {
4
4
  if (!styles) {
5
5
  return '';
6
6
  }
7
- const values = [`background-color: ${transformColorValue(styles.backgroundColor)}`, `font-family: ${mapFontFamily(styles.fontFamily)}`];
7
+ const values = [`background-color: ${transformBackgroundColorValue(styles.backgroundColor)}`, `font-family: ${mapFontFamily(styles.fontFamily)}`];
8
8
  return values.join(';');
9
9
  };
10
10
  export const generateContainerStyles = (styles) => {
@@ -20,10 +20,10 @@ export const generateContainerStyles = (styles) => {
20
20
  `padding-right: ${transformNumericValue(styles.paddingRight)}`,
21
21
  `padding-bottom: ${transformNumericValue(styles.paddingBottom)}`,
22
22
  `padding-left: ${transformNumericValue(styles.paddingLeft)}`,
23
- `background-color: ${transformColorValue(styles.backgroundColor)}`,
23
+ `background-color: ${transformBackgroundColorValue(styles.backgroundColor)}`,
24
24
  `border-width: ${styles.borderColor ? '1px' : '0'}`,
25
25
  `border-radius: ${transformNumericValue(styles.borderRadius)}`,
26
- `border-color: ${transformColorValue(styles.borderColor)}`,
26
+ `border-color: ${transformBackgroundColorValue(styles.borderColor)}`,
27
27
  `overflow: ${styles.borderRadius ? 'hidden' : 'visible'}`
28
28
  ];
29
29
  if (styles.direction) {
@@ -49,11 +49,11 @@ export const generateButtonStyles = (styles) => {
49
49
  `padding-right: ${transformNumericValue(styles.paddingRight)}`,
50
50
  `padding-bottom: ${transformNumericValue(styles.paddingBottom)}`,
51
51
  `padding-left: ${transformNumericValue(styles.paddingLeft)}`,
52
- `color: ${transformColorValue(styles.textColor)}`,
53
- `background-color: ${transformColorValue(styles.backgroundColor)}`,
52
+ `color: ${transformTextColorValue(styles.textColor)}`,
53
+ `background-color: ${transformBackgroundColorValue(styles.backgroundColor)}`,
54
54
  `border-width: ${styles.borderColor ? '1px' : '0'}`,
55
55
  `border-radius: ${transformNumericValue(styles.borderRadius)}`,
56
- `border-color: ${transformColorValue(styles.borderColor)}`,
56
+ `border-color: ${transformBackgroundColorValue(styles.borderColor)}`,
57
57
  `overflow: hidden`
58
58
  ];
59
59
  return values.join(';');
@@ -94,7 +94,7 @@ export const generateProductsSliderStyles = (styles) => {
94
94
  `padding-right: ${transformNumericValue(styles.paddingRight)}`,
95
95
  `padding-bottom: ${transformNumericValue(styles.paddingBottom)}`,
96
96
  `padding-left: ${transformNumericValue(styles.paddingLeft)}`,
97
- `background-color: ${transformColorValue(styles.backgroundColor)}`,
97
+ `background-color: ${transformBackgroundColorValue(styles.backgroundColor)}`,
98
98
  `overflow-x: auto`,
99
99
  `overflow-y: hidden`,
100
100
  `scrollbar-width: none`,
@@ -111,7 +111,7 @@ export const generateTextStyles = (styles) => {
111
111
  `font-weight: ${mapFontWeight(styles.fontWeight)}`,
112
112
  `line-height: ${transformNumericValue(styles.lineHeight, '1.2')}`,
113
113
  `text-align: ${mapTextAlign(styles.textAlign)}`,
114
- `color: ${transformColorValue(styles.color)}`
114
+ `color: ${transformTextColorValue(styles.color)}`
115
115
  ];
116
116
  return values.join(';');
117
117
  };
@@ -203,7 +203,13 @@ export const transformNumericValue = (value, fallback = '0') => {
203
203
  }
204
204
  return `${(value / baseContainerWidth) * 100}cqi`;
205
205
  };
206
- export const transformColorValue = (value) => {
206
+ export const transformTextColorValue = (value) => {
207
+ if (value === null || value === undefined) {
208
+ return '#000000';
209
+ }
210
+ return value;
211
+ };
212
+ export const transformBackgroundColorValue = (value) => {
207
213
  if (value === null || value === undefined) {
208
214
  return 'transparent';
209
215
  }
@@ -66,6 +66,7 @@ export type ProductsSliderStreamElementStyles = {
66
66
  export type StockStreamElementStyles = {
67
67
  height?: number | null;
68
68
  horizontalAlign?: StreamElementStyleHorizontalAlign | null;
69
+ color?: string | null;
69
70
  };
70
71
  export type TextStreamElementStyles = {
71
72
  fontSize?: number | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@streamscloud/embeddable",
3
- "version": "14.0.3",
3
+ "version": "14.0.4",
4
4
  "author": "StreamsCloud",
5
5
  "repository": {
6
6
  "type": "git",