@streamscloud/embeddable 3.2.2 → 3.2.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.
- package/dist/core/enums.d.ts +2 -0
- package/dist/core/enums.js +2 -0
- package/dist/core/graphql.d.ts +1 -3
- package/dist/core/graphql.js +3 -12
- package/dist/core/utils/html-helper.d.ts +0 -1
- package/dist/core/utils/html-helper.js +0 -4
- package/dist/products/price-helper.js +1 -1
- package/dist/short-videos/short-video-viewer/cmp.attachments-inline.svelte +1 -1
- package/dist/short-videos/short-video-viewer/cmp.attachments.svelte +2 -2
- package/dist/short-videos/short-video-viewer/cmp.attachments.svelte.d.ts +2 -3
- package/dist/short-videos/short-video-viewer/cmp.product.svelte +1 -1
- package/dist/short-videos/short-video-viewer/cmp.product.svelte.d.ts +2 -3
- package/dist/short-videos/short-video-viewer/cmp.short-video-details.svelte +1 -1
- package/dist/short-videos/short-video-viewer/cmp.short-video-details.svelte.d.ts +2 -3
- package/dist/short-videos/short-video-viewer/cmp.short-video-heading.svelte +2 -6
- package/dist/short-videos/short-video-viewer/cmp.short-video-heading.svelte.d.ts +1 -1
- package/dist/short-videos/short-video-viewer/cmp.short-video-viewer.svelte +1 -1
- package/dist/short-videos/short-video-viewer/cmp.short-video-viewer.svelte.d.ts +2 -3
- package/dist/short-videos/short-video-viewer/description.svelte +0 -5
- package/dist/short-videos/short-video-viewer/description.svelte.d.ts +1 -1
- package/dist/short-videos/short-video-viewer/index.d.ts +2 -4
- package/dist/short-videos/short-video-viewer/index.js +0 -1
- package/dist/short-videos/short-video-viewer/mapper.js +1 -2
- package/dist/short-videos/short-video-viewer/operations.generated.d.ts +0 -1
- package/dist/short-videos/short-video-viewer/operations.generated.js +0 -1
- package/dist/short-videos/short-video-viewer/operations.graphql +0 -1
- package/dist/short-videos/short-video-viewer/{short-video-attachments-localization.d.ts → short-video-attachments-localization.svelte.d.ts} +4 -5
- package/dist/short-videos/short-video-viewer/short-video-attachments-localization.svelte.js +10 -0
- package/dist/short-videos/short-video-viewer/{short-video-details-localization.d.ts → short-video-details-localization.svelte.d.ts} +6 -7
- package/dist/short-videos/short-video-viewer/short-video-details-localization.svelte.js +10 -0
- package/dist/short-videos/short-video-viewer/{short-video-product-localization.d.ts → short-video-product-localization.svelte.d.ts} +1 -2
- package/dist/short-videos/short-video-viewer/short-video-product-localization.svelte.js +11 -0
- package/dist/short-videos/short-video-viewer/short-video-viewer-localization.svelte.d.ts +13 -0
- package/dist/short-videos/short-video-viewer/short-video-viewer-localization.svelte.js +10 -0
- package/dist/short-videos/short-video-viewer/types.d.ts +0 -1
- package/dist/short-videos/short-videos-player/cmp.short-videos-player.svelte +11 -88
- package/dist/short-videos/short-videos-player/cmp.short-videos-player.svelte.d.ts +5 -5
- package/dist/short-videos/short-videos-player/controls.svelte +2 -2
- package/dist/short-videos/short-videos-player/controls.svelte.d.ts +1 -1
- package/dist/short-videos/short-videos-player/index.d.ts +14 -51
- package/dist/short-videos/short-videos-player/index.js +12 -83
- package/dist/short-videos/short-videos-player/short-videos-player-localization.svelte.d.ts +8 -0
- package/dist/short-videos/short-videos-player/short-videos-player-localization.svelte.js +6 -0
- package/dist/streams/layout/cmp.layout.svelte.d.ts +2 -4
- package/dist/streams/layout/cmp.slot-content.svelte +4 -4
- package/dist/streams/layout/cmp.slot-content.svelte.d.ts +1 -2
- package/dist/streams/layout/cmp.slot.svelte.d.ts +2 -7
- package/dist/streams/layout/component.d.ts +0 -2
- package/dist/streams/layout/element-views/cmp.container-stream-element.svelte +1 -1
- package/dist/streams/layout/element-views/cmp.container-stream-element.svelte.d.ts +3 -4
- package/dist/streams/layout/element-views/cmp.image-ref-stream-element.svelte +2 -15
- package/dist/streams/layout/element-views/cmp.image-ref-stream-element.svelte.d.ts +3 -7
- package/dist/streams/layout/element-views/cmp.images-stream-element.svelte +2 -2
- package/dist/streams/layout/element-views/cmp.price-stream-element.svelte +89 -15
- package/dist/streams/layout/element-views/cmp.price-stream-element.svelte.d.ts +4 -5
- package/dist/streams/layout/element-views/cmp.short-video-stream-element.svelte +2 -4
- package/dist/streams/layout/element-views/cmp.short-video-stream-element.svelte.d.ts +0 -3
- package/dist/streams/layout/element-views/cmp.stream-element.svelte +17 -24
- package/dist/streams/layout/element-views/cmp.stream-element.svelte.d.ts +3 -4
- package/dist/streams/layout/element-views/cmp.text-ref-stream-element.svelte.d.ts +2 -2
- package/dist/streams/layout/element-views/cmp.text-stream-element.svelte +2 -6
- package/dist/streams/layout/element-views/cmp.text-stream-element.svelte.d.ts +0 -2
- package/dist/streams/layout/element-views/data-by-key-accessor.d.ts +3 -3
- package/dist/streams/layout/element-views/index.d.ts +11 -16
- package/dist/streams/layout/element-views/index.js +9 -12
- package/dist/streams/layout/element-views/price-stream-element-localization.svelte.d.ts +9 -0
- package/dist/streams/layout/element-views/price-stream-element-localization.svelte.js +8 -0
- package/dist/streams/layout/element-views/stream-element-localization.svelte.d.ts +8 -0
- package/dist/streams/layout/element-views/stream-element-localization.svelte.js +6 -0
- package/dist/streams/layout/elements.d.ts +12 -47
- package/dist/streams/layout/elements.js +1 -1
- package/dist/streams/layout/enums.d.ts +3 -34
- package/dist/streams/layout/enums.js +7 -46
- package/dist/streams/layout/index.d.ts +10 -3
- package/dist/streams/layout/index.js +2 -3
- package/dist/streams/layout/layout.d.ts +1 -2
- package/dist/streams/layout/models/index.d.ts +1 -1
- package/dist/streams/layout/models/mapper.js +1 -2
- package/dist/streams/layout/models/stream-layout-media-item-model.d.ts +1 -1
- package/dist/streams/layout/models/stream-layout-media-item-model.js +1 -1
- package/dist/streams/layout/models/stream-layout-post-header-model.d.ts +1 -1
- package/dist/streams/layout/models/stream-layout-product-model.d.ts +2 -1
- package/dist/streams/layout/models/stream-layout-short-video-model.d.ts +0 -4
- package/dist/streams/layout/serializer.d.ts +3 -0
- package/dist/streams/layout/serializer.js +6 -0
- package/dist/streams/layout/slot.d.ts +0 -2
- package/dist/streams/layout/styles-transformer.d.ts +2 -3
- package/dist/streams/layout/styles-transformer.js +30 -54
- package/dist/streams/layout/styles.d.ts +14 -24
- package/dist/streams/layout/type-guards.d.ts +0 -31
- package/dist/streams/layout/type-guards.js +1 -13
- package/dist/streams/stream-page-viewer/cmp.stream-page-viewer.svelte +2 -4
- package/dist/streams/stream-page-viewer/cmp.stream-page-viewer.svelte.d.ts +0 -3
- package/dist/streams/stream-page-viewer/index.d.ts +0 -1
- package/dist/streams/stream-page-viewer/stream-page-viewer-localization.svelte.d.ts +13 -0
- package/dist/streams/stream-page-viewer/stream-page-viewer-localization.svelte.js +10 -0
- package/dist/streams/stream-player/cmp.stream-player.svelte +7 -47
- package/dist/streams/stream-player/cmp.stream-player.svelte.d.ts +4 -6
- package/dist/streams/stream-player/controls.svelte +3 -46
- package/dist/streams/stream-player/controls.svelte.d.ts +1 -1
- package/dist/streams/stream-player/index.d.ts +4 -6
- package/dist/streams/stream-player/index.js +28 -15
- package/dist/streams/stream-player/operations.generated.d.ts +1 -1
- package/dist/streams/stream-player/operations.generated.js +3 -5
- package/dist/streams/stream-player/operations.graphql +3 -3
- package/dist/streams/stream-player/stream-overview.svelte +2 -2
- package/dist/streams/stream-player/stream-overview.svelte.d.ts +1 -1
- package/dist/streams/stream-player/stream-player-buffer.svelte.js +2 -2
- package/dist/streams/stream-player/stream-player-localization.svelte.d.ts +12 -0
- package/dist/streams/stream-player/stream-player-localization.svelte.js +10 -0
- package/dist/ui/icon/cmp.icon.svelte +26 -13
- package/dist/ui/line-clamp/cmp.line-clamp.svelte +2 -2
- package/dist/ui/line-clamp/cmp.line-clamp.svelte.d.ts +2 -3
- package/dist/ui/line-clamp/index.d.ts +1 -1
- package/dist/ui/line-clamp/index.js +1 -1
- package/dist/ui/line-clamp/{line-clamp-localization.d.ts → line-clamp-localization.svelte.d.ts} +1 -2
- package/dist/ui/line-clamp/line-clamp-localization.svelte.js +15 -0
- package/dist/ui/shadow-dom/shadow-host.d.ts +5 -1
- package/dist/ui/shadow-dom/shadow-host.js +14 -1
- package/dist/ui/time-ago/cmp.time-ago.svelte +1 -1
- package/dist/ui/time-ago/cmp.time-ago.svelte.d.ts +2 -3
- package/dist/ui/time-ago/index.d.ts +1 -1
- package/dist/ui/time-ago/{time-ago-localization.d.ts → time-ago-localization.svelte.d.ts} +1 -2
- package/dist/ui/time-ago/time-ago-localization.svelte.js +39 -0
- package/dist/ui/video/cmp.video.svelte +18 -42
- package/package.json +1 -1
- package/dist/core/analytics.profile-id.d.ts +0 -5
- package/dist/core/analytics.profile-id.js +0 -17
- package/dist/core/document.event-handlers.d.ts +0 -1
- package/dist/core/document.event-handlers.js +0 -5
- package/dist/core/locale.d.ts +0 -6
- package/dist/core/locale.js +0 -24
- package/dist/short-videos/short-video-viewer/short-video-attachments-localization.js +0 -21
- package/dist/short-videos/short-video-viewer/short-video-details-localization.js +0 -17
- package/dist/short-videos/short-video-viewer/short-video-product-localization.js +0 -13
- package/dist/short-videos/short-video-viewer/short-video-viewer-localization.d.ts +0 -14
- package/dist/short-videos/short-video-viewer/short-video-viewer-localization.js +0 -17
- package/dist/short-videos/short-videos-player/operations.generated.d.ts +0 -65
- package/dist/short-videos/short-videos-player/operations.generated.js +0 -194
- package/dist/short-videos/short-videos-player/operations.graphql +0 -8
- package/dist/short-videos/short-videos-player/short-videos-player-localization.d.ts +0 -16
- package/dist/short-videos/short-videos-player/short-videos-player-localization.js +0 -13
- package/dist/short-videos/short-videos-player/types.d.ts +0 -36
- package/dist/short-videos/short-videos-player/types.js +0 -6
- package/dist/streams/layout/element-views/cmp.annotation-stream-element.svelte +0 -16
- package/dist/streams/layout/element-views/cmp.annotation-stream-element.svelte.d.ts +0 -7
- package/dist/streams/layout/element-views/cmp.stock-stream-element.svelte +0 -74
- package/dist/streams/layout/element-views/cmp.stock-stream-element.svelte.d.ts +0 -11
- package/dist/streams/layout/element-views/cmp.web-view-stream-element.svelte +0 -37
- package/dist/streams/layout/element-views/cmp.web-view-stream-element.svelte.d.ts +0 -7
- package/dist/streams/layout/element-views/price-element-view.svelte +0 -168
- package/dist/streams/layout/element-views/price-element-view.svelte.d.ts +0 -15
- package/dist/streams/layout/element-views/price-stream-element-localization.d.ts +0 -13
- package/dist/streams/layout/element-views/price-stream-element-localization.js +0 -21
- package/dist/streams/layout/element-views/short-video-stream-element-localization.d.ts +0 -9
- package/dist/streams/layout/element-views/short-video-stream-element-localization.js +0 -7
- package/dist/streams/layout/element-views/stock-stream-element-localization.d.ts +0 -8
- package/dist/streams/layout/element-views/stock-stream-element-localization.js +0 -26
- package/dist/streams/layout/element-views/stream-element-localization.d.ts +0 -15
- package/dist/streams/layout/element-views/stream-element-localization.js +0 -11
- package/dist/streams/layout/serializer.svelte.d.ts +0 -29
- package/dist/streams/layout/serializer.svelte.js +0 -93
- package/dist/streams/layout/slot-data-ref.d.ts +0 -13
- package/dist/streams/layout/slot-data-ref.js +0 -1
- package/dist/streams/layout/svg-attributes.d.ts +0 -7
- package/dist/streams/layout/svg-attributes.js +0 -8
- package/dist/streams/stream-page-viewer/stream-page-viewer-localization.d.ts +0 -9
- package/dist/streams/stream-page-viewer/stream-page-viewer-localization.js +0 -7
- package/dist/streams/stream-player/stream-player-localization.d.ts +0 -26
- package/dist/streams/stream-player/stream-player-localization.js +0 -31
- package/dist/ui/line-clamp/line-clamp-localization.js +0 -19
- package/dist/ui/swipe-indicator/cmp.swipe-indicator.svelte +0 -125
- package/dist/ui/swipe-indicator/cmp.swipe-indicator.svelte.d.ts +0 -9
- package/dist/ui/swipe-indicator/index.d.ts +0 -2
- package/dist/ui/swipe-indicator/index.js +0 -1
- package/dist/ui/swipe-indicator/swipe-indicator-localization.d.ts +0 -8
- package/dist/ui/swipe-indicator/swipe-indicator-localization.js +0 -13
- package/dist/ui/time-ago/time-ago-localization.js +0 -55
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { type Locale } from '../../../core/locale';
|
|
2
|
-
import type { IShortVideoViewerLocalization } from '../../../short-videos/short-video-viewer';
|
|
3
|
-
export interface IShortVideoStreamElementLocalization {
|
|
4
|
-
shortVideoViewerLocalization?: IShortVideoViewerLocalization | Locale;
|
|
5
|
-
}
|
|
6
|
-
export declare class ShortVideoStreamElementLocalization {
|
|
7
|
-
shortVideoViewerLocalization: IShortVideoViewerLocalization | Locale;
|
|
8
|
-
constructor(init: IShortVideoStreamElementLocalization | Locale);
|
|
9
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { isLocale } from '../../../core/locale';
|
|
2
|
-
export class ShortVideoStreamElementLocalization {
|
|
3
|
-
shortVideoViewerLocalization;
|
|
4
|
-
constructor(init) {
|
|
5
|
-
this.shortVideoViewerLocalization = isLocale(init) ? init : init.shortVideoViewerLocalization || 'en';
|
|
6
|
-
}
|
|
7
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { type Locale } from '../../../core/locale';
|
|
2
|
-
export interface IStockStreamElementLocalization {
|
|
3
|
-
quantity?: (value: number, low: boolean) => string;
|
|
4
|
-
}
|
|
5
|
-
export declare class StockStreamElementLocalization {
|
|
6
|
-
quantity: (value: number, low: boolean) => string;
|
|
7
|
-
constructor(init: IStockStreamElementLocalization | Locale);
|
|
8
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { isLocale } from '../../../core/locale';
|
|
2
|
-
export class StockStreamElementLocalization {
|
|
3
|
-
quantity;
|
|
4
|
-
constructor(init) {
|
|
5
|
-
this.quantity = isLocale(init) ? loc.quantity[init] : init.quantity || loc.quantity.en;
|
|
6
|
-
}
|
|
7
|
-
}
|
|
8
|
-
const loc = {
|
|
9
|
-
quantity: {
|
|
10
|
-
en: (value, low) => {
|
|
11
|
-
if (value === 0) {
|
|
12
|
-
return 'Out of stock';
|
|
13
|
-
}
|
|
14
|
-
const plusMark = low || value < 2 ? '' : '+';
|
|
15
|
-
const unit = value === 1 ? 'pc' : 'pcs';
|
|
16
|
-
return `${value}${plusMark} ${unit} in stock`;
|
|
17
|
-
},
|
|
18
|
-
no: (value, low) => {
|
|
19
|
-
if (value === 0) {
|
|
20
|
-
return 'Ikke på lager';
|
|
21
|
-
}
|
|
22
|
-
const plusMark = low || value < 2 ? '' : '+';
|
|
23
|
-
return `${value}${plusMark} stk. på lager`;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { type Locale } from '../../../core/locale';
|
|
2
|
-
import type { IPriceStreamElementLocalization } from './price-stream-element-localization';
|
|
3
|
-
import type { IShortVideoStreamElementLocalization } from './short-video-stream-element-localization';
|
|
4
|
-
import type { IStockStreamElementLocalization } from './stock-stream-element-localization';
|
|
5
|
-
export interface IStreamElementLocalization {
|
|
6
|
-
priceElementLocalization?: IPriceStreamElementLocalization | Locale;
|
|
7
|
-
stockElementLocalization?: IStockStreamElementLocalization | Locale;
|
|
8
|
-
shortVideoElementLocalization?: IShortVideoStreamElementLocalization | Locale;
|
|
9
|
-
}
|
|
10
|
-
export declare class StreamElementLocalization {
|
|
11
|
-
priceElementLocalization: IPriceStreamElementLocalization | Locale;
|
|
12
|
-
stockElementLocalization: IStockStreamElementLocalization | Locale;
|
|
13
|
-
shortVideoElementLocalization: IShortVideoStreamElementLocalization | Locale;
|
|
14
|
-
constructor(init: IStreamElementLocalization | Locale);
|
|
15
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { isLocale } from '../../../core/locale';
|
|
2
|
-
export class StreamElementLocalization {
|
|
3
|
-
priceElementLocalization;
|
|
4
|
-
stockElementLocalization;
|
|
5
|
-
shortVideoElementLocalization;
|
|
6
|
-
constructor(init) {
|
|
7
|
-
this.priceElementLocalization = isLocale(init) ? init : init.priceElementLocalization || 'en';
|
|
8
|
-
this.stockElementLocalization = isLocale(init) ? init : init.stockElementLocalization || 'en';
|
|
9
|
-
this.shortVideoElementLocalization = isLocale(init) ? init : init.shortVideoElementLocalization || 'en';
|
|
10
|
-
}
|
|
11
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import type { StreamElementModel } from './elements';
|
|
2
|
-
import type { StreamLayout, StreamLayoutTemplate } from './layout';
|
|
3
|
-
export declare const parseToStreamLayout: (value: string) => StreamLayout;
|
|
4
|
-
export declare const parseToStreamLayoutTemplate: (value: string) => StreamLayoutTemplate;
|
|
5
|
-
export declare const stringifyToStreamLayoutInput: (layout: StreamLayout | StreamLayoutTemplate) => string;
|
|
6
|
-
export declare class IdPopulator {
|
|
7
|
-
static populateLayoutIds(layout: {
|
|
8
|
-
$id: string;
|
|
9
|
-
slots: {
|
|
10
|
-
$id: string;
|
|
11
|
-
components: {
|
|
12
|
-
$id: string;
|
|
13
|
-
elements: StreamElementModel[];
|
|
14
|
-
}[];
|
|
15
|
-
}[];
|
|
16
|
-
}): void;
|
|
17
|
-
static populateSlotIds(slot: {
|
|
18
|
-
$id: string;
|
|
19
|
-
components: {
|
|
20
|
-
$id: string;
|
|
21
|
-
elements: StreamElementModel[];
|
|
22
|
-
}[];
|
|
23
|
-
}): void;
|
|
24
|
-
static populateComponentIds(component: {
|
|
25
|
-
$id: string;
|
|
26
|
-
elements: StreamElementModel[];
|
|
27
|
-
}): void;
|
|
28
|
-
static populateElementId(element: StreamElementModel): void;
|
|
29
|
-
}
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import { Utils } from '../../core/utils';
|
|
2
|
-
import { StreamComponentDataType, StreamElementType } from './enums';
|
|
3
|
-
import { nanoid } from 'nanoid';
|
|
4
|
-
export const parseToStreamLayout = (value) => {
|
|
5
|
-
const layout = JSON.parse(value);
|
|
6
|
-
IdPopulator.populateLayoutIds(layout);
|
|
7
|
-
return layout;
|
|
8
|
-
};
|
|
9
|
-
export const parseToStreamLayoutTemplate = (value) => {
|
|
10
|
-
const layout = JSON.parse(value);
|
|
11
|
-
IdPopulator.populateLayoutIds(layout);
|
|
12
|
-
return layout;
|
|
13
|
-
};
|
|
14
|
-
export const stringifyToStreamLayoutInput = (layout) => {
|
|
15
|
-
const clone = structuredClone($state.snapshot(layout));
|
|
16
|
-
// @ts-expect-error - clearing local data before sending to the server - clearing local data before sending to the server
|
|
17
|
-
delete clone.$id;
|
|
18
|
-
if (clone.slots) {
|
|
19
|
-
clone.slots.forEach((slot) => {
|
|
20
|
-
// @ts-expect-error - clearing local data before sending to the server
|
|
21
|
-
delete slot.$id;
|
|
22
|
-
slot.components.forEach((component) => {
|
|
23
|
-
// @ts-expect-error - clearing local data before sending to the server
|
|
24
|
-
delete component.$id;
|
|
25
|
-
component.elements.forEach(removeElementIdRecursive);
|
|
26
|
-
});
|
|
27
|
-
if ('data' in slot && slot.data) {
|
|
28
|
-
const data = slot.data;
|
|
29
|
-
switch (data.type) {
|
|
30
|
-
case StreamComponentDataType.Images:
|
|
31
|
-
// @ts-expect-error - clearing local data before sending to the server
|
|
32
|
-
delete data.items;
|
|
33
|
-
break;
|
|
34
|
-
case StreamComponentDataType.ShortVideo:
|
|
35
|
-
// @ts-expect-error - clearing local data before sending to the server
|
|
36
|
-
delete data.shortVideo;
|
|
37
|
-
break;
|
|
38
|
-
case StreamComponentDataType.Product:
|
|
39
|
-
// @ts-expect-error - clearing local data before sending to the server
|
|
40
|
-
delete data.product;
|
|
41
|
-
break;
|
|
42
|
-
default:
|
|
43
|
-
Utils.assertUnreachable(data);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
return JSON.stringify(clone);
|
|
49
|
-
};
|
|
50
|
-
const removeElementIdRecursive = (element) => {
|
|
51
|
-
// @ts-expect-error - clearing local data before sending to the server
|
|
52
|
-
delete element.$id;
|
|
53
|
-
if (element.type === StreamElementType.Container && Array.isArray(element.elements)) {
|
|
54
|
-
element.elements.forEach(removeElementIdRecursive);
|
|
55
|
-
}
|
|
56
|
-
if (element.type === StreamElementType.ImageRef && Array.isArray(element.annotations)) {
|
|
57
|
-
element.annotations.forEach((annotation) => {
|
|
58
|
-
// @ts-expect-error - clearing local data before sending to the server
|
|
59
|
-
delete annotation.$id;
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
if (element.type === StreamElementType.Price && element.stock) {
|
|
63
|
-
// @ts-expect-error - clearing local data before sending to the server
|
|
64
|
-
delete element.stock.$id;
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
export class IdPopulator {
|
|
68
|
-
static populateLayoutIds(layout) {
|
|
69
|
-
layout.$id = nanoid(10);
|
|
70
|
-
layout.slots.forEach((slot) => IdPopulator.populateSlotIds(slot));
|
|
71
|
-
}
|
|
72
|
-
static populateSlotIds(slot) {
|
|
73
|
-
slot.$id = nanoid(10);
|
|
74
|
-
slot.components.forEach((component) => IdPopulator.populateComponentIds(component));
|
|
75
|
-
}
|
|
76
|
-
static populateComponentIds(component) {
|
|
77
|
-
component.$id = nanoid(10);
|
|
78
|
-
component.elements.forEach((element) => IdPopulator.populateElementId(element));
|
|
79
|
-
}
|
|
80
|
-
static populateElementId(element) {
|
|
81
|
-
element.$id = nanoid(10);
|
|
82
|
-
// Рекурсивно обрабатываем дочерние элементы
|
|
83
|
-
if (element.type === StreamElementType.Container && element.elements) {
|
|
84
|
-
element.elements.forEach((element) => IdPopulator.populateElementId(element));
|
|
85
|
-
}
|
|
86
|
-
if (element.type === StreamElementType.ImageRef && element.annotations) {
|
|
87
|
-
element.annotations.forEach((element) => IdPopulator.populateElementId(element));
|
|
88
|
-
}
|
|
89
|
-
if (element.type === StreamElementType.Price && element.stock) {
|
|
90
|
-
IdPopulator.populateElementId(element.stock);
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { ImagesStreamSlotData, ProductStreamSlotData, ShortVideoStreamSlotData } from './slot-data';
|
|
2
|
-
export type StreamSlotDataRef = Partial<Pick<ImagesStreamSlotData, 'items'>> & Partial<Pick<ProductStreamSlotData, 'product'>> & Partial<Pick<ShortVideoStreamSlotData, 'shortVideo'>>;
|
|
3
|
-
type Prev = [never, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, ...0[]];
|
|
4
|
-
type Join<K, P> = K extends string | number ? (P extends string | number ? `${K}${'' extends P ? '' : '.'}${P}` : never) : never;
|
|
5
|
-
type IsPrimitive<T> = T extends string | number | boolean | null | undefined ? true : false;
|
|
6
|
-
type ExcludeBuiltins<T> = {
|
|
7
|
-
[K in keyof T as K extends keyof any[] ? never : K extends symbol ? never : T[K] extends (...args: any[]) => any ? never : T[K] extends any[] ? never : K]: T[K];
|
|
8
|
-
};
|
|
9
|
-
type Paths<T, D extends number = 4> = [D] extends [never] ? never : T extends object ? {
|
|
10
|
-
[K in keyof ExcludeBuiltins<T>]: K extends string | number ? IsPrimitive<ExcludeBuiltins<T>[K]> extends true ? `${K}` : ExcludeBuiltins<T>[K] extends object | null ? ExcludeBuiltins<T>[K] extends null ? never : Join<K, Paths<ExcludeBuiltins<NonNullable<T[K]>>, Prev[D]>> : never : never;
|
|
11
|
-
}[keyof ExcludeBuiltins<T>] : '';
|
|
12
|
-
export type StreamSlotDataRefPaths = `#${Paths<Required<StreamSlotDataRef>>}`;
|
|
13
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export declare enum SvgAttributes {
|
|
2
|
-
customizableElement = "data-streams--customizable",
|
|
3
|
-
textElementValueType = "data-streams--text--value-type",
|
|
4
|
-
textElementCustomValue = "data-streams--text--custom-value",
|
|
5
|
-
textElementValueBefore = "data-streams--text--value-before",
|
|
6
|
-
textElementValueAfter = "data-streams--text--value-after"
|
|
7
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export var SvgAttributes;
|
|
2
|
-
(function (SvgAttributes) {
|
|
3
|
-
SvgAttributes["customizableElement"] = "data-streams--customizable";
|
|
4
|
-
SvgAttributes["textElementValueType"] = "data-streams--text--value-type";
|
|
5
|
-
SvgAttributes["textElementCustomValue"] = "data-streams--text--custom-value";
|
|
6
|
-
SvgAttributes["textElementValueBefore"] = "data-streams--text--value-before";
|
|
7
|
-
SvgAttributes["textElementValueAfter"] = "data-streams--text--value-after";
|
|
8
|
-
})(SvgAttributes || (SvgAttributes = {}));
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { type Locale } from '../../core/locale';
|
|
2
|
-
import type { IStreamElementLocalization } from '../layout/element-views';
|
|
3
|
-
export interface IStreamPageViewerLocalization {
|
|
4
|
-
elementsLocalization?: IStreamElementLocalization | Locale;
|
|
5
|
-
}
|
|
6
|
-
export declare class StreamPageViewerLocalization {
|
|
7
|
-
elementsLocalization: IStreamElementLocalization | Locale;
|
|
8
|
-
constructor(init: IStreamPageViewerLocalization | Locale);
|
|
9
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { type Locale } from '../../core/locale';
|
|
2
|
-
import type { IShortVideoAttachmentsLocalization, IShortVideoDetailsLocalization, IShortVideoViewerLocalization } from '../../short-videos/short-video-viewer';
|
|
3
|
-
import type { IStreamPageViewerLocalization } from '../stream-page-viewer';
|
|
4
|
-
import type { ISwipeIndicatorLocalization } from '../../ui/swipe-indicator';
|
|
5
|
-
import type { ITimeAgoLocalization } from '../../ui/time-ago';
|
|
6
|
-
export interface IStreamPlayerLocalization {
|
|
7
|
-
streamNotFound?: string;
|
|
8
|
-
pagesCount?: (count: number) => string;
|
|
9
|
-
timeAgoLocalization?: ITimeAgoLocalization | Locale;
|
|
10
|
-
streamPageViewerLocalization?: IStreamPageViewerLocalization | Locale;
|
|
11
|
-
shortVideoAttachmentsLocalization?: IShortVideoAttachmentsLocalization | Locale;
|
|
12
|
-
shortVideoDetailsLocalization?: IShortVideoDetailsLocalization | Locale;
|
|
13
|
-
shortVideoViewerLocalization?: IShortVideoViewerLocalization | Locale;
|
|
14
|
-
swipeIndicatorLocalization?: ISwipeIndicatorLocalization | Locale;
|
|
15
|
-
}
|
|
16
|
-
export declare class StreamPlayerLocalization {
|
|
17
|
-
streamNotFound: string;
|
|
18
|
-
pagesCount: (count: number) => string;
|
|
19
|
-
timeAgoLocalization: ITimeAgoLocalization | Locale;
|
|
20
|
-
streamPageViewerLocalization: IStreamPageViewerLocalization | Locale;
|
|
21
|
-
shortVideoAttachmentsLocalization: IShortVideoAttachmentsLocalization | Locale;
|
|
22
|
-
shortVideoDetailsLocalization: IShortVideoDetailsLocalization | Locale;
|
|
23
|
-
shortVideoViewerLocalization: IShortVideoViewerLocalization | Locale;
|
|
24
|
-
swipeIndicatorLocalization: ISwipeIndicatorLocalization | Locale;
|
|
25
|
-
constructor(init: IStreamPlayerLocalization | Locale);
|
|
26
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { isLocale } from '../../core/locale';
|
|
2
|
-
export class StreamPlayerLocalization {
|
|
3
|
-
streamNotFound;
|
|
4
|
-
pagesCount;
|
|
5
|
-
timeAgoLocalization;
|
|
6
|
-
streamPageViewerLocalization;
|
|
7
|
-
shortVideoAttachmentsLocalization;
|
|
8
|
-
shortVideoDetailsLocalization;
|
|
9
|
-
shortVideoViewerLocalization;
|
|
10
|
-
swipeIndicatorLocalization;
|
|
11
|
-
constructor(init) {
|
|
12
|
-
this.streamNotFound = isLocale(init) ? loc.streamNotFound[init] : init?.streamNotFound || loc.streamNotFound.en;
|
|
13
|
-
this.pagesCount = isLocale(init) ? loc.pagesCount[init] : init?.pagesCount || loc.pagesCount.en;
|
|
14
|
-
this.timeAgoLocalization = isLocale(init) ? init : init.timeAgoLocalization || 'en';
|
|
15
|
-
this.streamPageViewerLocalization = isLocale(init) ? init : init.streamPageViewerLocalization || 'en';
|
|
16
|
-
this.shortVideoAttachmentsLocalization = isLocale(init) ? init : init.shortVideoAttachmentsLocalization || 'en';
|
|
17
|
-
this.shortVideoDetailsLocalization = isLocale(init) ? init : init.shortVideoDetailsLocalization || 'en';
|
|
18
|
-
this.shortVideoViewerLocalization = isLocale(init) ? init : init.shortVideoViewerLocalization || 'en';
|
|
19
|
-
this.swipeIndicatorLocalization = isLocale(init) ? init : init.swipeIndicatorLocalization || 'en';
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
const loc = {
|
|
23
|
-
streamNotFound: {
|
|
24
|
-
en: 'Stream not found',
|
|
25
|
-
no: 'Stream ikke funnet'
|
|
26
|
-
},
|
|
27
|
-
pagesCount: {
|
|
28
|
-
en: (count) => (count === 1 ? '1 page' : `${count} pages`),
|
|
29
|
-
no: (count) => (count === 1 ? '1 side' : `${count} sider`)
|
|
30
|
-
}
|
|
31
|
-
};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { isLocale } from '../../core/locale';
|
|
2
|
-
export class LineClampLocalization {
|
|
3
|
-
showLess;
|
|
4
|
-
showMore;
|
|
5
|
-
constructor(init) {
|
|
6
|
-
this.showLess = isLocale(init) ? loc.showLess[init] : init.showLess || loc.showLess.en;
|
|
7
|
-
this.showMore = isLocale(init) ? loc.showMore[init] : init.showMore || loc.showMore.en;
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
const loc = {
|
|
11
|
-
showLess: {
|
|
12
|
-
en: 'Show less',
|
|
13
|
-
no: 'Vis mindre'
|
|
14
|
-
},
|
|
15
|
-
showMore: {
|
|
16
|
-
en: 'Show more',
|
|
17
|
-
no: 'Vis mer'
|
|
18
|
-
}
|
|
19
|
-
};
|
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
<script lang="ts">import { Icon } from '../icon';
|
|
2
|
-
import { SwipeIndicatorLocalization } from './swipe-indicator-localization';
|
|
3
|
-
import IconArrowUp from '@fluentui/svg-icons/icons/arrow_up_20_regular.svg?raw';
|
|
4
|
-
let { fadeTimeout = 2000, localization: localizationInit } = $props();
|
|
5
|
-
const localization = $derived(new SwipeIndicatorLocalization(localizationInit));
|
|
6
|
-
let isFaded = $state(false);
|
|
7
|
-
const indicatorMounted = (_) => {
|
|
8
|
-
if (fadeTimeout) {
|
|
9
|
-
const timeout = setTimeout(() => {
|
|
10
|
-
isFaded = true;
|
|
11
|
-
}, 3000);
|
|
12
|
-
return {
|
|
13
|
-
destroy() {
|
|
14
|
-
clearTimeout(timeout);
|
|
15
|
-
}
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
</script>
|
|
20
|
-
|
|
21
|
-
<div class="swipe-indicator" class:swipe-indicator--faded={isFaded} use:indicatorMounted>
|
|
22
|
-
<div class="swipe-indicator__icon">
|
|
23
|
-
<Icon src={IconArrowUp} />
|
|
24
|
-
</div>
|
|
25
|
-
<div class="swipe-indicator__text">
|
|
26
|
-
{localization.swipe}
|
|
27
|
-
</div>
|
|
28
|
-
</div>
|
|
29
|
-
|
|
30
|
-
<style>@charset "UTF-8";
|
|
31
|
-
@keyframes fadeIn {
|
|
32
|
-
0% {
|
|
33
|
-
opacity: 1;
|
|
34
|
-
}
|
|
35
|
-
50% {
|
|
36
|
-
opacity: 0.4;
|
|
37
|
-
}
|
|
38
|
-
100% {
|
|
39
|
-
opacity: 1;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
.swipe-indicator {
|
|
43
|
-
--_swipe-indicator--color: var(--swipe-indicator--color, #ffffff);
|
|
44
|
-
--_swipe-indicator--font-size: var(--swipe-indicator--font-size, 1rem);
|
|
45
|
-
--_swipe-indicator--icon-size: var(--swipe-indicator--icon-size, var(--_swipe-indicator--font-size));
|
|
46
|
-
display: flex;
|
|
47
|
-
flex-direction: column;
|
|
48
|
-
align-items: center;
|
|
49
|
-
justify-content: center;
|
|
50
|
-
position: absolute;
|
|
51
|
-
bottom: 1.25rem;
|
|
52
|
-
left: 50%;
|
|
53
|
-
transform: translateX(-50%);
|
|
54
|
-
z-index: 10;
|
|
55
|
-
color: var(--_swipe-indicator--color);
|
|
56
|
-
opacity: 1;
|
|
57
|
-
transition: opacity 2s cubic-bezier(0.4, 0, 0.2, 1);
|
|
58
|
-
}
|
|
59
|
-
.swipe-indicator--faded {
|
|
60
|
-
opacity: 0;
|
|
61
|
-
pointer-events: none;
|
|
62
|
-
}
|
|
63
|
-
.swipe-indicator:before {
|
|
64
|
-
content: "";
|
|
65
|
-
position: absolute;
|
|
66
|
-
inset: 0;
|
|
67
|
-
z-index: 0;
|
|
68
|
-
pointer-events: none;
|
|
69
|
-
border-radius: 50%;
|
|
70
|
-
background: #000;
|
|
71
|
-
filter: blur(12px);
|
|
72
|
-
transform: scale(3);
|
|
73
|
-
}
|
|
74
|
-
.swipe-indicator__icon {
|
|
75
|
-
font-size: var(--_swipe-indicator--icon-size);
|
|
76
|
-
animation: bounce 2.7s cubic-bezier(0.22, 0.61, 0.36, 1) infinite;
|
|
77
|
-
will-change: transform;
|
|
78
|
-
z-index: 1;
|
|
79
|
-
}
|
|
80
|
-
.swipe-indicator__text {
|
|
81
|
-
font-size: var(--_swipe-indicator--font-size);
|
|
82
|
-
z-index: 1;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
@keyframes bounce {
|
|
86
|
-
0%, 100% {
|
|
87
|
-
transform: translateY(0);
|
|
88
|
-
}
|
|
89
|
-
10% {
|
|
90
|
-
transform: translateY(-24px); /* основной прыжок */
|
|
91
|
-
}
|
|
92
|
-
18% {
|
|
93
|
-
transform: translateY(0);
|
|
94
|
-
}
|
|
95
|
-
26% {
|
|
96
|
-
transform: translateY(-12px); /* первый малый отскок */
|
|
97
|
-
}
|
|
98
|
-
34% {
|
|
99
|
-
transform: translateY(0);
|
|
100
|
-
}
|
|
101
|
-
41% {
|
|
102
|
-
transform: translateY(-8px); /* второй малый отскок */
|
|
103
|
-
}
|
|
104
|
-
48% {
|
|
105
|
-
transform: translateY(0);
|
|
106
|
-
}
|
|
107
|
-
54% {
|
|
108
|
-
transform: translateY(-4px); /* третий малый отскок */
|
|
109
|
-
}
|
|
110
|
-
60% {
|
|
111
|
-
transform: translateY(0);
|
|
112
|
-
}
|
|
113
|
-
65% {
|
|
114
|
-
transform: translateY(-2px); /* почти затух */
|
|
115
|
-
}
|
|
116
|
-
70% {
|
|
117
|
-
transform: translateY(0);
|
|
118
|
-
}
|
|
119
|
-
75% {
|
|
120
|
-
transform: translateY(-1px); /* совсем маленький */
|
|
121
|
-
}
|
|
122
|
-
80% {
|
|
123
|
-
transform: translateY(0);
|
|
124
|
-
}
|
|
125
|
-
}</style>
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { Locale } from '../../core/locale';
|
|
2
|
-
import { type ISwipeIndicatorLocalization } from './swipe-indicator-localization';
|
|
3
|
-
type Props = {
|
|
4
|
-
fadeTimeout?: number;
|
|
5
|
-
localization: ISwipeIndicatorLocalization | Locale;
|
|
6
|
-
};
|
|
7
|
-
declare const Cmp: import("svelte").Component<Props, {}, "">;
|
|
8
|
-
type Cmp = ReturnType<typeof Cmp>;
|
|
9
|
-
export default Cmp;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as SwipeIndicator } from './cmp.swipe-indicator.svelte';
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { isLocale } from '../../core/locale';
|
|
2
|
-
export class SwipeIndicatorLocalization {
|
|
3
|
-
swipe;
|
|
4
|
-
constructor(init) {
|
|
5
|
-
this.swipe = isLocale(init) ? loc.swipe[init] : init.swipe || loc.swipe.en;
|
|
6
|
-
}
|
|
7
|
-
}
|
|
8
|
-
const loc = {
|
|
9
|
-
swipe: {
|
|
10
|
-
en: 'Swipe',
|
|
11
|
-
no: 'Sveip'
|
|
12
|
-
}
|
|
13
|
-
};
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { isLocale } from '../../core/locale';
|
|
2
|
-
export class TimeAgoLocalization {
|
|
3
|
-
locale;
|
|
4
|
-
aMinuteAgo;
|
|
5
|
-
anHourAgo;
|
|
6
|
-
justNow;
|
|
7
|
-
at;
|
|
8
|
-
hoursAgo;
|
|
9
|
-
minutesAgo;
|
|
10
|
-
yesterday;
|
|
11
|
-
constructor(init) {
|
|
12
|
-
this.locale = isLocale(init) ? loc.locale[init] : init.locale || loc.locale.en;
|
|
13
|
-
this.aMinuteAgo = isLocale(init) ? loc.aMinuteAgo[init] : init.aMinuteAgo || loc.aMinuteAgo.en;
|
|
14
|
-
this.anHourAgo = isLocale(init) ? loc.anHourAgo[init] : init.anHourAgo || loc.anHourAgo.en;
|
|
15
|
-
this.justNow = isLocale(init) ? loc.justNow[init] : init.justNow || loc.justNow.en;
|
|
16
|
-
this.at = isLocale(init) ? loc.at[init] : init.at || loc.at.en;
|
|
17
|
-
this.hoursAgo = isLocale(init) ? loc.hoursAgo[init] : init.hoursAgo || loc.hoursAgo.en;
|
|
18
|
-
this.minutesAgo = isLocale(init) ? loc.minutesAgo[init] : init.minutesAgo || loc.minutesAgo.en;
|
|
19
|
-
this.yesterday = isLocale(init) ? loc.yesterday[init] : init.yesterday || loc.yesterday.en;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
const loc = {
|
|
23
|
-
locale: {
|
|
24
|
-
en: 'en-US',
|
|
25
|
-
no: 'no-NO'
|
|
26
|
-
},
|
|
27
|
-
aMinuteAgo: {
|
|
28
|
-
en: 'a minute ago',
|
|
29
|
-
no: 'ett minutt siden'
|
|
30
|
-
},
|
|
31
|
-
anHourAgo: {
|
|
32
|
-
en: 'an hour ago',
|
|
33
|
-
no: 'en time siden'
|
|
34
|
-
},
|
|
35
|
-
justNow: {
|
|
36
|
-
en: 'just now',
|
|
37
|
-
no: 'nettopp nå'
|
|
38
|
-
},
|
|
39
|
-
at: {
|
|
40
|
-
en: (date, time) => `${date} at ${time}`,
|
|
41
|
-
no: (date, time) => `${date} kl. ${time}`
|
|
42
|
-
},
|
|
43
|
-
hoursAgo: {
|
|
44
|
-
en: (hours) => `${hours} hours ago`,
|
|
45
|
-
no: (hours) => `${hours} timer siden`
|
|
46
|
-
},
|
|
47
|
-
minutesAgo: {
|
|
48
|
-
en: (minutes) => `${minutes} minutes ago`,
|
|
49
|
-
no: (minutes) => `${minutes} minutter siden`
|
|
50
|
-
},
|
|
51
|
-
yesterday: {
|
|
52
|
-
en: (time) => `Yesterday at ${time}`,
|
|
53
|
-
no: (time) => `I går kl. ${time}`
|
|
54
|
-
}
|
|
55
|
-
};
|