@streamscloud/embeddable 2.1.0 → 2.1.1
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/package.json +1 -1
- package/dist/core/continuation-token.d.ts +0 -10
- package/dist/core/continuation-token.js +0 -32
- package/dist/core/cursor-result.d.ts +0 -9
- package/dist/core/cursor-result.js +0 -1
- package/dist/core/data-loaders/cursor-data-loader.svelte.d.ts +0 -14
- package/dist/core/data-loaders/cursor-data-loader.svelte.js +0 -35
- package/dist/core/data-loaders/data-loader.d.ts +0 -4
- package/dist/core/data-loaders/data-loader.js +0 -1
- package/dist/core/data-loaders/index.d.ts +0 -2
- package/dist/core/data-loaders/index.js +0 -1
- package/dist/core/deferred.d.ts +0 -6
- package/dist/core/deferred.js +0 -13
- package/dist/core/enums.d.ts +0 -33
- package/dist/core/enums.js +0 -39
- package/dist/core/graphql.d.ts +0 -1
- package/dist/core/graphql.js +0 -10
- package/dist/core/media/image-helper.d.ts +0 -10
- package/dist/core/media/image-helper.js +0 -30
- package/dist/core/media/images-size-detector.service.d.ts +0 -6
- package/dist/core/media/images-size-detector.service.js +0 -15
- package/dist/core/media/index.d.ts +0 -4
- package/dist/core/media/index.js +0 -4
- package/dist/core/media/media-item-url.service.d.ts +0 -2
- package/dist/core/media/media-item-url.service.js +0 -3
- package/dist/core/media/types.d.ts +0 -13
- package/dist/core/media/types.js +0 -1
- package/dist/core/toastr.d.ts +0 -1
- package/dist/core/toastr.js +0 -26
- package/dist/core/transitions/index.d.ts +0 -1
- package/dist/core/transitions/index.js +0 -1
- package/dist/core/transitions/slide-horizontally.d.ts +0 -7
- package/dist/core/transitions/slide-horizontally.js +0 -55
- package/dist/core/utils/array-helper.d.ts +0 -23
- package/dist/core/utils/array-helper.js +0 -148
- package/dist/core/utils/date-helper.d.ts +0 -29
- package/dist/core/utils/date-helper.js +0 -146
- package/dist/core/utils/dom-helper.d.ts +0 -12
- package/dist/core/utils/dom-helper.js +0 -76
- package/dist/core/utils/html-helper.d.ts +0 -40
- package/dist/core/utils/html-helper.js +0 -97
- package/dist/core/utils/index.d.ts +0 -3
- package/dist/core/utils/index.js +0 -3
- package/dist/core/utils/number-helper.d.ts +0 -6
- package/dist/core/utils/number-helper.js +0 -28
- package/dist/core/utils/string-generator.d.ts +0 -2
- package/dist/core/utils/string-generator.js +0 -15
- package/dist/core/utils/string-helper.d.ts +0 -10
- package/dist/core/utils/string-helper.js +0 -53
- package/dist/core/utils/url-helper.d.ts +0 -3
- package/dist/core/utils/url-helper.js +0 -13
- package/dist/core/utils/utils.d.ts +0 -28
- package/dist/core/utils/utils.js +0 -100
- package/dist/index.d.ts +0 -2
- package/dist/index.js +0 -2
- package/dist/products/price-helper.d.ts +0 -4
- package/dist/products/price-helper.js +0 -47
- package/dist/short-videos/short-video-viewer/cmp.ad.svelte +0 -74
- package/dist/short-videos/short-video-viewer/cmp.ad.svelte.d.ts +0 -7
- package/dist/short-videos/short-video-viewer/cmp.attachments-inline.svelte +0 -70
- package/dist/short-videos/short-video-viewer/cmp.attachments-inline.svelte.d.ts +0 -7
- package/dist/short-videos/short-video-viewer/cmp.attachments.svelte +0 -68
- package/dist/short-videos/short-video-viewer/cmp.attachments.svelte.d.ts +0 -9
- package/dist/short-videos/short-video-viewer/cmp.product.svelte +0 -156
- package/dist/short-videos/short-video-viewer/cmp.product.svelte.d.ts +0 -10
- package/dist/short-videos/short-video-viewer/cmp.short-video-details.svelte +0 -124
- package/dist/short-videos/short-video-viewer/cmp.short-video-details.svelte.d.ts +0 -10
- package/dist/short-videos/short-video-viewer/cmp.short-video-heading.svelte +0 -86
- package/dist/short-videos/short-video-viewer/cmp.short-video-heading.svelte.d.ts +0 -9
- package/dist/short-videos/short-video-viewer/cmp.short-video-viewer.svelte +0 -133
- package/dist/short-videos/short-video-viewer/cmp.short-video-viewer.svelte.d.ts +0 -12
- package/dist/short-videos/short-video-viewer/description.svelte +0 -46
- package/dist/short-videos/short-video-viewer/description.svelte.d.ts +0 -9
- package/dist/short-videos/short-video-viewer/index.d.ts +0 -9
- package/dist/short-videos/short-video-viewer/index.js +0 -6
- package/dist/short-videos/short-video-viewer/mapper.d.ts +0 -3
- package/dist/short-videos/short-video-viewer/mapper.js +0 -56
- package/dist/short-videos/short-video-viewer/operations.generated.d.ts +0 -56
- package/dist/short-videos/short-video-viewer/operations.generated.js +0 -151
- package/dist/short-videos/short-video-viewer/operations.graphql +0 -53
- package/dist/short-videos/short-video-viewer/short-video-attachments-localization.svelte.d.ts +0 -12
- package/dist/short-videos/short-video-viewer/short-video-attachments-localization.svelte.js +0 -10
- package/dist/short-videos/short-video-viewer/short-video-details-localization.svelte.d.ts +0 -13
- package/dist/short-videos/short-video-viewer/short-video-details-localization.svelte.js +0 -10
- package/dist/short-videos/short-video-viewer/short-video-product-localization.svelte.d.ts +0 -7
- package/dist/short-videos/short-video-viewer/short-video-product-localization.svelte.js +0 -11
- package/dist/short-videos/short-video-viewer/short-video-viewer-localization.svelte.d.ts +0 -13
- package/dist/short-videos/short-video-viewer/short-video-viewer-localization.svelte.js +0 -10
- package/dist/short-videos/short-video-viewer/types.d.ts +0 -40
- package/dist/short-videos/short-video-viewer/types.js +0 -1
- package/dist/short-videos/short-video-viewer/ui-manager.svelte.d.ts +0 -12
- package/dist/short-videos/short-video-viewer/ui-manager.svelte.js +0 -26
- package/dist/short-videos/short-videos-player/action-button.svelte +0 -38
- package/dist/short-videos/short-videos-player/action-button.svelte.d.ts +0 -10
- package/dist/short-videos/short-videos-player/cmp.short-videos-player.svelte +0 -91
- package/dist/short-videos/short-videos-player/cmp.short-videos-player.svelte.d.ts +0 -13
- package/dist/short-videos/short-videos-player/controls.svelte +0 -222
- package/dist/short-videos/short-videos-player/controls.svelte.d.ts +0 -15
- package/dist/short-videos/short-videos-player/index.d.ts +0 -31
- package/dist/short-videos/short-videos-player/index.js +0 -40
- package/dist/short-videos/short-videos-player/short-videos-player-localization.svelte.d.ts +0 -8
- package/dist/short-videos/short-videos-player/short-videos-player-localization.svelte.js +0 -6
- package/dist/short-videos/short-videos-player/ui-manager.svelte.d.ts +0 -16
- package/dist/short-videos/short-videos-player/ui-manager.svelte.js +0 -25
- package/dist/streams/layout/cmp.layout.svelte +0 -34
- package/dist/streams/layout/cmp.layout.svelte.d.ts +0 -9
- package/dist/streams/layout/cmp.slot-content.svelte +0 -32
- package/dist/streams/layout/cmp.slot-content.svelte.d.ts +0 -9
- package/dist/streams/layout/cmp.slot.svelte +0 -26
- package/dist/streams/layout/cmp.slot.svelte.d.ts +0 -9
- package/dist/streams/layout/component.d.ts +0 -6
- package/dist/streams/layout/component.js +0 -1
- package/dist/streams/layout/css-values.d.ts +0 -10
- package/dist/streams/layout/css-values.js +0 -1
- package/dist/streams/layout/element-views/cmp.container-stream-element.svelte +0 -16
- package/dist/streams/layout/element-views/cmp.container-stream-element.svelte.d.ts +0 -11
- package/dist/streams/layout/element-views/cmp.image-ref-stream-element.svelte +0 -38
- package/dist/streams/layout/element-views/cmp.image-ref-stream-element.svelte.d.ts +0 -9
- package/dist/streams/layout/element-views/cmp.images-stream-element.svelte +0 -30
- package/dist/streams/layout/element-views/cmp.images-stream-element.svelte.d.ts +0 -9
- package/dist/streams/layout/element-views/cmp.price-stream-element.svelte +0 -97
- package/dist/streams/layout/element-views/cmp.price-stream-element.svelte.d.ts +0 -11
- package/dist/streams/layout/element-views/cmp.short-video-stream-element.svelte +0 -6
- package/dist/streams/layout/element-views/cmp.short-video-stream-element.svelte.d.ts +0 -7
- package/dist/streams/layout/element-views/cmp.spacer-stream-element.svelte +0 -45
- package/dist/streams/layout/element-views/cmp.spacer-stream-element.svelte.d.ts +0 -9
- package/dist/streams/layout/element-views/cmp.stream-element.svelte +0 -60
- package/dist/streams/layout/element-views/cmp.stream-element.svelte.d.ts +0 -13
- package/dist/streams/layout/element-views/cmp.text-ref-stream-element.svelte +0 -23
- package/dist/streams/layout/element-views/cmp.text-ref-stream-element.svelte.d.ts +0 -9
- package/dist/streams/layout/element-views/cmp.text-stream-element.svelte +0 -8
- package/dist/streams/layout/element-views/cmp.text-stream-element.svelte.d.ts +0 -7
- package/dist/streams/layout/element-views/data-by-key-accessor.d.ts +0 -3
- package/dist/streams/layout/element-views/data-by-key-accessor.js +0 -55
- package/dist/streams/layout/element-views/index.d.ts +0 -11
- package/dist/streams/layout/element-views/index.js +0 -9
- package/dist/streams/layout/element-views/price-stream-element-localization.svelte.d.ts +0 -9
- package/dist/streams/layout/element-views/price-stream-element-localization.svelte.js +0 -8
- package/dist/streams/layout/element-views/stream-element-localization.svelte.d.ts +0 -8
- package/dist/streams/layout/element-views/stream-element-localization.svelte.js +0 -6
- package/dist/streams/layout/elements.d.ts +0 -51
- package/dist/streams/layout/elements.js +0 -1
- package/dist/streams/layout/enums.d.ts +0 -45
- package/dist/streams/layout/enums.js +0 -54
- package/dist/streams/layout/index.d.ts +0 -19
- package/dist/streams/layout/index.js +0 -15
- package/dist/streams/layout/layout.d.ts +0 -13
- package/dist/streams/layout/layout.js +0 -1
- package/dist/streams/layout/models/index.d.ts +0 -6
- package/dist/streams/layout/models/index.js +0 -1
- package/dist/streams/layout/models/mapper.d.ts +0 -3
- package/dist/streams/layout/models/mapper.js +0 -62
- package/dist/streams/layout/models/stream-layout-blob-model.d.ts +0 -4
- package/dist/streams/layout/models/stream-layout-blob-model.js +0 -1
- package/dist/streams/layout/models/stream-layout-media-item-model.d.ts +0 -6
- package/dist/streams/layout/models/stream-layout-media-item-model.js +0 -1
- package/dist/streams/layout/models/stream-layout-post-header-model.d.ts +0 -11
- package/dist/streams/layout/models/stream-layout-post-header-model.js +0 -1
- package/dist/streams/layout/models/stream-layout-product-model.d.ts +0 -19
- package/dist/streams/layout/models/stream-layout-product-model.js +0 -1
- package/dist/streams/layout/models/stream-layout-short-video-model.d.ts +0 -31
- package/dist/streams/layout/models/stream-layout-short-video-model.js +0 -1
- package/dist/streams/layout/serializer.d.ts +0 -3
- package/dist/streams/layout/serializer.js +0 -6
- package/dist/streams/layout/slot-data-input.d.ts +0 -14
- package/dist/streams/layout/slot-data-input.js +0 -1
- package/dist/streams/layout/slot-data.d.ts +0 -18
- package/dist/streams/layout/slot-data.js +0 -1
- package/dist/streams/layout/slot.d.ts +0 -16
- package/dist/streams/layout/slot.js +0 -1
- package/dist/streams/layout/styles-transformer.d.ts +0 -13
- package/dist/streams/layout/styles-transformer.js +0 -140
- package/dist/streams/layout/styles.d.ts +0 -43
- package/dist/streams/layout/styles.js +0 -1
- package/dist/streams/layout/type-guards.d.ts +0 -8
- package/dist/streams/layout/type-guards.js +0 -21
- package/dist/streams/stream-page-viewer/cmp.stream-page-viewer.svelte +0 -13
- package/dist/streams/stream-page-viewer/cmp.stream-page-viewer.svelte.d.ts +0 -7
- package/dist/streams/stream-page-viewer/index.d.ts +0 -2
- package/dist/streams/stream-page-viewer/index.js +0 -1
- package/dist/streams/stream-page-viewer/mapper.d.ts +0 -3
- package/dist/streams/stream-page-viewer/mapper.js +0 -22
- package/dist/streams/stream-page-viewer/operations.generated.d.ts +0 -10
- package/dist/streams/stream-page-viewer/operations.generated.js +0 -27
- package/dist/streams/stream-page-viewer/operations.graphql +0 -8
- package/dist/streams/stream-page-viewer/stream-page-viewer-localization.svelte.d.ts +0 -13
- package/dist/streams/stream-page-viewer/stream-page-viewer-localization.svelte.js +0 -10
- package/dist/streams/stream-page-viewer/types.d.ts +0 -18
- package/dist/streams/stream-page-viewer/types.js +0 -1
- package/dist/streams/stream-player/action-button.svelte +0 -38
- package/dist/streams/stream-player/action-button.svelte.d.ts +0 -10
- package/dist/streams/stream-player/cmp.stream-player.svelte +0 -149
- package/dist/streams/stream-player/cmp.stream-player.svelte.d.ts +0 -17
- package/dist/streams/stream-player/controls.svelte +0 -230
- package/dist/streams/stream-player/controls.svelte.d.ts +0 -14
- package/dist/streams/stream-player/index.d.ts +0 -37
- package/dist/streams/stream-player/index.js +0 -50
- package/dist/streams/stream-player/mapper.d.ts +0 -3
- package/dist/streams/stream-player/mapper.js +0 -15
- package/dist/streams/stream-player/operations.generated.d.ts +0 -65
- package/dist/streams/stream-player/operations.generated.js +0 -196
- package/dist/streams/stream-player/operations.graphql +0 -35
- package/dist/streams/stream-player/stream-overview.svelte +0 -239
- package/dist/streams/stream-player/stream-overview.svelte.d.ts +0 -17
- package/dist/streams/stream-player/stream-player-buffer.svelte.d.ts +0 -25
- package/dist/streams/stream-player/stream-player-buffer.svelte.js +0 -84
- package/dist/streams/stream-player/stream-player-localization.svelte.d.ts +0 -12
- package/dist/streams/stream-player/stream-player-localization.svelte.js +0 -10
- package/dist/streams/stream-player/types.d.ts +0 -12
- package/dist/streams/stream-player/types.js +0 -1
- package/dist/streams/stream-player/ui-manager.svelte.d.ts +0 -17
- package/dist/streams/stream-player/ui-manager.svelte.js +0 -26
- package/dist/ui/button/cmp.button.svelte +0 -10
- package/dist/ui/button/cmp.button.svelte.d.ts +0 -16
- package/dist/ui/button/index.d.ts +0 -2
- package/dist/ui/button/index.js +0 -2
- package/dist/ui/button/resources/button-base.svelte +0 -84
- package/dist/ui/button/resources/button-base.svelte.d.ts +0 -13
- package/dist/ui/button/resources/button-theme.svelte +0 -204
- package/dist/ui/button/resources/button-theme.svelte.d.ts +0 -10
- package/dist/ui/button/resources/button-types.d.ts +0 -21
- package/dist/ui/button/resources/button-types.js +0 -23
- package/dist/ui/dynamic-component/cmp.dynamic-component.svelte +0 -5
- package/dist/ui/dynamic-component/cmp.dynamic-component.svelte.d.ts +0 -7
- package/dist/ui/dynamic-component/index.d.ts +0 -2
- package/dist/ui/dynamic-component/index.js +0 -2
- package/dist/ui/dynamic-component/types.svelte.d.ts +0 -11
- package/dist/ui/dynamic-component/types.svelte.js +0 -13
- package/dist/ui/icon/cmp.icon.svelte +0 -113
- package/dist/ui/icon/cmp.icon.svelte.d.ts +0 -8
- package/dist/ui/icon/index.d.ts +0 -2
- package/dist/ui/icon/index.js +0 -2
- package/dist/ui/icon/types.d.ts +0 -9
- package/dist/ui/icon/types.js +0 -10
- package/dist/ui/image/cmp.image-round.svelte +0 -41
- package/dist/ui/image/cmp.image-round.svelte.d.ts +0 -11
- package/dist/ui/image/cmp.image-rounded.svelte +0 -71
- package/dist/ui/image/cmp.image-rounded.svelte.d.ts +0 -11
- package/dist/ui/image/cmp.image-stub.svelte +0 -34
- package/dist/ui/image/cmp.image-stub.svelte.d.ts +0 -18
- package/dist/ui/image/cmp.image.svelte +0 -82
- package/dist/ui/image/cmp.image.svelte.d.ts +0 -13
- package/dist/ui/image/image-state.d.ts +0 -6
- package/dist/ui/image/image-state.js +0 -17
- package/dist/ui/image/index.d.ts +0 -4
- package/dist/ui/image/index.js +0 -4
- package/dist/ui/infinite-scrolling/cmp.infinite-scrolling.svelte +0 -84
- package/dist/ui/infinite-scrolling/cmp.infinite-scrolling.svelte.d.ts +0 -11
- package/dist/ui/infinite-scrolling/index.d.ts +0 -1
- package/dist/ui/infinite-scrolling/index.js +0 -1
- package/dist/ui/line-clamp/cmp.line-clamp.svelte +0 -89
- package/dist/ui/line-clamp/cmp.line-clamp.svelte.d.ts +0 -12
- package/dist/ui/line-clamp/index.d.ts +0 -2
- package/dist/ui/line-clamp/index.js +0 -2
- package/dist/ui/line-clamp/line-clamp-localization.svelte.d.ts +0 -9
- package/dist/ui/line-clamp/line-clamp-localization.svelte.js +0 -15
- package/dist/ui/line-clamp/line-clamp-types.d.ts +0 -3
- package/dist/ui/line-clamp/line-clamp-types.js +0 -1
- package/dist/ui/line-clamp/line-clamp-utils.d.ts +0 -8
- package/dist/ui/line-clamp/line-clamp-utils.js +0 -33
- package/dist/ui/loading/cmp.loading.svelte +0 -97
- package/dist/ui/loading/cmp.loading.svelte.d.ts +0 -9
- package/dist/ui/loading/index.d.ts +0 -1
- package/dist/ui/loading/index.js +0 -1
- package/dist/ui/media-item-view/cmp.media-item-view.svelte +0 -91
- package/dist/ui/media-item-view/cmp.media-item-view.svelte.d.ts +0 -13
- package/dist/ui/media-item-view/index.d.ts +0 -1
- package/dist/ui/media-item-view/index.js +0 -1
- package/dist/ui/media-items-gallery/cmp.media-items-gallery.svelte +0 -278
- package/dist/ui/media-items-gallery/cmp.media-items-gallery.svelte.d.ts +0 -13
- package/dist/ui/media-items-gallery/index.d.ts +0 -1
- package/dist/ui/media-items-gallery/index.js +0 -1
- package/dist/ui/media-items-gallery/types.d.ts +0 -12
- package/dist/ui/media-items-gallery/types.js +0 -35
- package/dist/ui/media-playback/index.d.ts +0 -2
- package/dist/ui/media-playback/index.js +0 -2
- package/dist/ui/media-playback/playback-manager.svelte.d.ts +0 -25
- package/dist/ui/media-playback/playback-manager.svelte.js +0 -62
- package/dist/ui/media-playback/volume-manager.svelte.d.ts +0 -10
- package/dist/ui/media-playback/volume-manager.svelte.js +0 -27
- package/dist/ui/player/cmp.player-slider.svelte +0 -161
- package/dist/ui/player/cmp.player-slider.svelte.d.ts +0 -33
- package/dist/ui/player/index.d.ts +0 -4
- package/dist/ui/player/index.js +0 -3
- package/dist/ui/player/player-buffer.svelte.d.ts +0 -28
- package/dist/ui/player/player-buffer.svelte.js +0 -64
- package/dist/ui/player/prevent-slider-scroll.d.ts +0 -5
- package/dist/ui/player/prevent-slider-scroll.js +0 -11
- package/dist/ui/player/types.d.ts +0 -14
- package/dist/ui/player/types.js +0 -1
- package/dist/ui/progress/cmp.progress.svelte +0 -37
- package/dist/ui/progress/cmp.progress.svelte.d.ts +0 -6
- package/dist/ui/progress/index.d.ts +0 -1
- package/dist/ui/progress/index.js +0 -1
- package/dist/ui/proportional-container/cmp.proportional-container.svelte +0 -39
- package/dist/ui/proportional-container/cmp.proportional-container.svelte.d.ts +0 -8
- package/dist/ui/proportional-container/index.d.ts +0 -1
- package/dist/ui/proportional-container/index.js +0 -1
- package/dist/ui/seek-bar/cmp.seek-bar.svelte +0 -63
- package/dist/ui/seek-bar/cmp.seek-bar.svelte.d.ts +0 -12
- package/dist/ui/seek-bar/index.d.ts +0 -1
- package/dist/ui/seek-bar/index.js +0 -1
- package/dist/ui/shadow-dom/_normalize.scss +0 -350
- package/dist/ui/shadow-dom/_reset.scss +0 -189
- package/dist/ui/shadow-dom/index.d.ts +0 -1
- package/dist/ui/shadow-dom/index.js +0 -1
- package/dist/ui/shadow-dom/shadow-host.d.ts +0 -11
- package/dist/ui/shadow-dom/shadow-host.js +0 -45
- package/dist/ui/spotlight-layout/cmp.spotlight-layout.svelte +0 -120
- package/dist/ui/spotlight-layout/cmp.spotlight-layout.svelte.d.ts +0 -18
- package/dist/ui/spotlight-layout/index.d.ts +0 -1
- package/dist/ui/spotlight-layout/index.js +0 -1
- package/dist/ui/time-ago/cmp.time-ago.svelte +0 -69
- package/dist/ui/time-ago/cmp.time-ago.svelte.d.ts +0 -9
- package/dist/ui/time-ago/index.d.ts +0 -2
- package/dist/ui/time-ago/index.js +0 -1
- package/dist/ui/time-ago/time-ago-localization.svelte.d.ts +0 -21
- package/dist/ui/time-ago/time-ago-localization.svelte.js +0 -39
- package/dist/ui/video/cmp.video.svelte +0 -377
- package/dist/ui/video/cmp.video.svelte.d.ts +0 -24
- package/dist/ui/video/index.d.ts +0 -1
- package/dist/ui/video/index.js +0 -1
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { StreamElementType, ImagesImagesElementMode } from './enums';
|
|
2
|
-
import type { ImageStreamElementStyles, TextStreamElementStyles, ContainerStreamElementStyles, PriceStreamElementStyles } from './styles';
|
|
3
|
-
export type StreamElementModel = ContainerStreamElementModel | ImageRefStreamElementModel | ImagesStreamElementModel | PriceStreamElementModel | SpacerStreamElementModel | ShortVideoStreamElementModel | TextStreamElementModel | TextRefStreamElementModel;
|
|
4
|
-
export type ContainerStreamElementModel = {
|
|
5
|
-
type: StreamElementType.Container;
|
|
6
|
-
id?: string;
|
|
7
|
-
elements: StreamElementModel[];
|
|
8
|
-
customizable: boolean | null;
|
|
9
|
-
styles: ContainerStreamElementStyles | null;
|
|
10
|
-
};
|
|
11
|
-
export type ImagesStreamElementModel = {
|
|
12
|
-
type: StreamElementType.Images;
|
|
13
|
-
id?: string;
|
|
14
|
-
mode: ImagesImagesElementMode;
|
|
15
|
-
};
|
|
16
|
-
export type ImageRefStreamElementModel = {
|
|
17
|
-
type: StreamElementType.ImageRef;
|
|
18
|
-
id?: string;
|
|
19
|
-
key: string;
|
|
20
|
-
styles: ImageStreamElementStyles | null;
|
|
21
|
-
};
|
|
22
|
-
export type PriceStreamElementModel = {
|
|
23
|
-
type: StreamElementType.Price;
|
|
24
|
-
id?: string;
|
|
25
|
-
excludeBeforePrice: boolean | null;
|
|
26
|
-
includeCurrency: boolean | null;
|
|
27
|
-
styles: PriceStreamElementStyles | null;
|
|
28
|
-
};
|
|
29
|
-
export type ShortVideoStreamElementModel = {
|
|
30
|
-
type: StreamElementType.ShortVideo;
|
|
31
|
-
id?: string;
|
|
32
|
-
};
|
|
33
|
-
export type SpacerStreamElementModel = {
|
|
34
|
-
type: StreamElementType.Spacer;
|
|
35
|
-
id?: string;
|
|
36
|
-
value: number | null;
|
|
37
|
-
};
|
|
38
|
-
export type TextStreamElementModel = {
|
|
39
|
-
type: StreamElementType.Text;
|
|
40
|
-
id?: string;
|
|
41
|
-
value: string | null;
|
|
42
|
-
styles: TextStreamElementStyles | null;
|
|
43
|
-
};
|
|
44
|
-
export type TextRefStreamElementModel = {
|
|
45
|
-
type: StreamElementType.TextRef;
|
|
46
|
-
id?: string;
|
|
47
|
-
key: string;
|
|
48
|
-
valueBefore: string | null;
|
|
49
|
-
valueAfter: string | null;
|
|
50
|
-
styles: TextStreamElementStyles | null;
|
|
51
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import { StreamElementType, ImagesImagesElementMode } from './enums';
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
export declare enum StreamComponentDataType {
|
|
2
|
-
Images = "IMAGES",
|
|
3
|
-
ShortVideo = "SHORT_VIDEO",
|
|
4
|
-
Product = "PRODUCT"
|
|
5
|
-
}
|
|
6
|
-
export declare enum StreamElementType {
|
|
7
|
-
Container = "CONTAINER",
|
|
8
|
-
ImageRef = "IMAGE_REF",
|
|
9
|
-
Images = "IMAGES",
|
|
10
|
-
Price = "PRICE",
|
|
11
|
-
Spacer = "SPACER",
|
|
12
|
-
ShortVideo = "SHORT_VIDEO",
|
|
13
|
-
Text = "TEXT",
|
|
14
|
-
TextRef = "TEXT_REF"
|
|
15
|
-
}
|
|
16
|
-
export declare enum ImagesImagesElementMode {
|
|
17
|
-
Single = "SINGLE",
|
|
18
|
-
Gallery = "GALLERY",
|
|
19
|
-
Slider = "SLIDER"
|
|
20
|
-
}
|
|
21
|
-
export declare enum StreamElementStyleMediaFit {
|
|
22
|
-
Cover = "COVER",
|
|
23
|
-
Contain = "CONTAIN"
|
|
24
|
-
}
|
|
25
|
-
export declare enum StreamElementStyleHorizontalAlign {
|
|
26
|
-
Left = "LEFT",
|
|
27
|
-
Center = "CENTER",
|
|
28
|
-
Right = "RIGHT"
|
|
29
|
-
}
|
|
30
|
-
export declare enum StreamElementStyleFontWeight {
|
|
31
|
-
Regular = "REGULAR",
|
|
32
|
-
SemiBold = "SEMI_BOLD",
|
|
33
|
-
Bold = "BOLD"
|
|
34
|
-
}
|
|
35
|
-
export declare enum StreamElementStyleFontFamily {
|
|
36
|
-
System = "SYSTEM"
|
|
37
|
-
}
|
|
38
|
-
export declare enum StreamElementStyleDirection {
|
|
39
|
-
Horizontal = "HORIZONTAL",
|
|
40
|
-
Vertical = "VERTICAL"
|
|
41
|
-
}
|
|
42
|
-
export declare enum StreamCssValueType {
|
|
43
|
-
DDU = "DDU",
|
|
44
|
-
Pct = "PCT"
|
|
45
|
-
}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
export var StreamComponentDataType;
|
|
2
|
-
(function (StreamComponentDataType) {
|
|
3
|
-
StreamComponentDataType["Images"] = "IMAGES";
|
|
4
|
-
StreamComponentDataType["ShortVideo"] = "SHORT_VIDEO";
|
|
5
|
-
StreamComponentDataType["Product"] = "PRODUCT";
|
|
6
|
-
})(StreamComponentDataType || (StreamComponentDataType = {}));
|
|
7
|
-
export var StreamElementType;
|
|
8
|
-
(function (StreamElementType) {
|
|
9
|
-
StreamElementType["Container"] = "CONTAINER";
|
|
10
|
-
StreamElementType["ImageRef"] = "IMAGE_REF";
|
|
11
|
-
StreamElementType["Images"] = "IMAGES";
|
|
12
|
-
StreamElementType["Price"] = "PRICE";
|
|
13
|
-
StreamElementType["Spacer"] = "SPACER";
|
|
14
|
-
StreamElementType["ShortVideo"] = "SHORT_VIDEO";
|
|
15
|
-
StreamElementType["Text"] = "TEXT";
|
|
16
|
-
StreamElementType["TextRef"] = "TEXT_REF";
|
|
17
|
-
})(StreamElementType || (StreamElementType = {}));
|
|
18
|
-
export var ImagesImagesElementMode;
|
|
19
|
-
(function (ImagesImagesElementMode) {
|
|
20
|
-
ImagesImagesElementMode["Single"] = "SINGLE";
|
|
21
|
-
ImagesImagesElementMode["Gallery"] = "GALLERY";
|
|
22
|
-
ImagesImagesElementMode["Slider"] = "SLIDER";
|
|
23
|
-
})(ImagesImagesElementMode || (ImagesImagesElementMode = {}));
|
|
24
|
-
export var StreamElementStyleMediaFit;
|
|
25
|
-
(function (StreamElementStyleMediaFit) {
|
|
26
|
-
StreamElementStyleMediaFit["Cover"] = "COVER";
|
|
27
|
-
StreamElementStyleMediaFit["Contain"] = "CONTAIN";
|
|
28
|
-
})(StreamElementStyleMediaFit || (StreamElementStyleMediaFit = {}));
|
|
29
|
-
export var StreamElementStyleHorizontalAlign;
|
|
30
|
-
(function (StreamElementStyleHorizontalAlign) {
|
|
31
|
-
StreamElementStyleHorizontalAlign["Left"] = "LEFT";
|
|
32
|
-
StreamElementStyleHorizontalAlign["Center"] = "CENTER";
|
|
33
|
-
StreamElementStyleHorizontalAlign["Right"] = "RIGHT";
|
|
34
|
-
})(StreamElementStyleHorizontalAlign || (StreamElementStyleHorizontalAlign = {}));
|
|
35
|
-
export var StreamElementStyleFontWeight;
|
|
36
|
-
(function (StreamElementStyleFontWeight) {
|
|
37
|
-
StreamElementStyleFontWeight["Regular"] = "REGULAR";
|
|
38
|
-
StreamElementStyleFontWeight["SemiBold"] = "SEMI_BOLD";
|
|
39
|
-
StreamElementStyleFontWeight["Bold"] = "BOLD";
|
|
40
|
-
})(StreamElementStyleFontWeight || (StreamElementStyleFontWeight = {}));
|
|
41
|
-
export var StreamElementStyleFontFamily;
|
|
42
|
-
(function (StreamElementStyleFontFamily) {
|
|
43
|
-
StreamElementStyleFontFamily["System"] = "SYSTEM";
|
|
44
|
-
})(StreamElementStyleFontFamily || (StreamElementStyleFontFamily = {}));
|
|
45
|
-
export var StreamElementStyleDirection;
|
|
46
|
-
(function (StreamElementStyleDirection) {
|
|
47
|
-
StreamElementStyleDirection["Horizontal"] = "HORIZONTAL";
|
|
48
|
-
StreamElementStyleDirection["Vertical"] = "VERTICAL";
|
|
49
|
-
})(StreamElementStyleDirection || (StreamElementStyleDirection = {}));
|
|
50
|
-
export var StreamCssValueType;
|
|
51
|
-
(function (StreamCssValueType) {
|
|
52
|
-
StreamCssValueType["DDU"] = "DDU";
|
|
53
|
-
StreamCssValueType["Pct"] = "PCT";
|
|
54
|
-
})(StreamCssValueType || (StreamCssValueType = {}));
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { StreamComponentDataType, StreamElementType } from './enums';
|
|
2
|
-
import type { StreamLayout } from './layout';
|
|
3
|
-
import type { StreamLayoutShortVideoModel } from './models';
|
|
4
|
-
import type { StreamSlot } from './slot';
|
|
5
|
-
import type { ContainerStreamElementStyles, ImageStreamElementStyles, PriceStreamElementStyles, TextStreamElementStyles } from './styles';
|
|
6
|
-
export { default as StreamPageLayout } from './cmp.layout.svelte';
|
|
7
|
-
export { default as StreamLayoutSlot } from './cmp.slot.svelte';
|
|
8
|
-
export { default as StreamLayoutSlotContent } from './cmp.slot-content.svelte';
|
|
9
|
-
export * from './layout';
|
|
10
|
-
export { parseToStreamLayout, stringifyToStreamLayoutInput } from './serializer';
|
|
11
|
-
export declare const getAllowedDataTypesForSlot: (slot: StreamSlot) => StreamComponentDataType[];
|
|
12
|
-
export declare const getSingleShortVideoFromLayout: (layout: StreamLayout) => StreamLayoutShortVideoModel | null;
|
|
13
|
-
export type ElementTypeToStyles = {
|
|
14
|
-
[StreamElementType.Container]: ContainerStreamElementStyles;
|
|
15
|
-
[StreamElementType.Price]: PriceStreamElementStyles;
|
|
16
|
-
[StreamElementType.ImageRef]: ImageStreamElementStyles;
|
|
17
|
-
[StreamElementType.Text]: TextStreamElementStyles;
|
|
18
|
-
[StreamElementType.TextRef]: TextStreamElementStyles;
|
|
19
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { StreamComponentDataType, StreamElementType } from './enums';
|
|
2
|
-
export { default as StreamPageLayout } from './cmp.layout.svelte';
|
|
3
|
-
export { default as StreamLayoutSlot } from './cmp.slot.svelte';
|
|
4
|
-
export { default as StreamLayoutSlotContent } from './cmp.slot-content.svelte';
|
|
5
|
-
export * from './layout';
|
|
6
|
-
export { parseToStreamLayout, stringifyToStreamLayoutInput } from './serializer';
|
|
7
|
-
export const getAllowedDataTypesForSlot = (slot) => {
|
|
8
|
-
return slot.components.flatMap((c) => c.dataType);
|
|
9
|
-
};
|
|
10
|
-
export const getSingleShortVideoFromLayout = (layout) => {
|
|
11
|
-
if (layout.slots.length === 1 && layout.slots[0].data?.type === StreamComponentDataType.ShortVideo && layout.slots[0].data.shortVideo) {
|
|
12
|
-
return layout.slots[0].data.shortVideo;
|
|
13
|
-
}
|
|
14
|
-
return null;
|
|
15
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { StreamSlot, StreamSlotInput, StreamSlotTemplate } from './slot';
|
|
2
|
-
import type { StreamLayoutStyles } from './styles';
|
|
3
|
-
export type StreamLayoutTemplate = {
|
|
4
|
-
styles: StreamLayoutStyles | null;
|
|
5
|
-
slots: StreamSlotTemplate[];
|
|
6
|
-
};
|
|
7
|
-
export type StreamLayoutInput = Omit<StreamLayoutTemplate, 'slots'> & {
|
|
8
|
-
slots: StreamSlotInput[];
|
|
9
|
-
};
|
|
10
|
-
export type StreamLayout = Omit<StreamLayoutTemplate, 'slots'> & {
|
|
11
|
-
id?: string;
|
|
12
|
-
slots: StreamSlot[];
|
|
13
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export { mapToShortVideoViewerModel } from './mapper';
|
|
2
|
-
export type { StreamLayoutBlobModel } from './stream-layout-blob-model';
|
|
3
|
-
export type { StreamLayoutMediaItemModel } from './stream-layout-media-item-model';
|
|
4
|
-
export type { StreamLayoutPostHeaderModel } from './stream-layout-post-header-model';
|
|
5
|
-
export type { StreamLayoutProductModel } from './stream-layout-product-model';
|
|
6
|
-
export type { StreamLayoutShortVideoModel, StreamLayoutShortVideoProductModel, StreamLayoutShortVideoAdModel } from './stream-layout-short-video-model';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { mapToShortVideoViewerModel } from './mapper';
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import type { ShortVideoViewerModel } from '../../../short-videos/short-video-viewer';
|
|
2
|
-
import type { StreamLayoutShortVideoModel } from '../models/stream-layout-short-video-model';
|
|
3
|
-
export declare const mapToShortVideoViewerModel: (model: StreamLayoutShortVideoModel) => ShortVideoViewerModel;
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { MediaType } from '../../../core/enums';
|
|
2
|
-
export const mapToShortVideoViewerModel = (model) => {
|
|
3
|
-
return {
|
|
4
|
-
id: model.id,
|
|
5
|
-
media: model.media.type === MediaType.Image
|
|
6
|
-
? { isImage: true, url: model.media.url }
|
|
7
|
-
: {
|
|
8
|
-
isImage: false,
|
|
9
|
-
url: model.media.url,
|
|
10
|
-
thumbnailUrl: model.media.thumbnailUrl
|
|
11
|
-
},
|
|
12
|
-
text: model.text,
|
|
13
|
-
heading: {
|
|
14
|
-
image: model.header.sourceImage,
|
|
15
|
-
name: model.header.sourceName,
|
|
16
|
-
displayDate: model.header.postDisplayDate,
|
|
17
|
-
viewsCount: model.header.postViewsCount
|
|
18
|
-
},
|
|
19
|
-
ad: model.ad ? mapToAdViewModel(model.ad) : null,
|
|
20
|
-
products: model.products.map(mapToProductCardModel)
|
|
21
|
-
// uncomment if you want to test many products behavior
|
|
22
|
-
/*.flatMap((x) => [
|
|
23
|
-
{ ...x, id: x.id + '1' },
|
|
24
|
-
{ ...x, id: x.id + '2' },
|
|
25
|
-
{ ...x, id: x.id + '3' },
|
|
26
|
-
{ ...x, id: x.id + '4' },
|
|
27
|
-
{ ...x, id: x.id + '5' },
|
|
28
|
-
{ ...x, id: x.id + '6' },
|
|
29
|
-
{ ...x, id: x.id + '7' },
|
|
30
|
-
{ ...x, id: x.id + '8' },
|
|
31
|
-
{ ...x, id: x.id + '9' },
|
|
32
|
-
{ ...x, id: x.id + '10' },
|
|
33
|
-
{ ...x, id: x.id + '11' },
|
|
34
|
-
{ ...x, id: x.id + '12' },
|
|
35
|
-
{ ...x, id: x.id + '13' },
|
|
36
|
-
{ ...x, id: x.id + '14' },
|
|
37
|
-
{ ...x, id: x.id + '15' }
|
|
38
|
-
])*/
|
|
39
|
-
};
|
|
40
|
-
};
|
|
41
|
-
const mapToAdViewModel = (model) => {
|
|
42
|
-
return {
|
|
43
|
-
id: model.id,
|
|
44
|
-
image: model.image,
|
|
45
|
-
title: model.title,
|
|
46
|
-
description: model.description,
|
|
47
|
-
buttonText: model.buttonText,
|
|
48
|
-
buttonUrl: model.buttonUrl,
|
|
49
|
-
openLinkInNewWindow: model.openLinkInNewWindow
|
|
50
|
-
};
|
|
51
|
-
};
|
|
52
|
-
const mapToProductCardModel = (model) => {
|
|
53
|
-
return {
|
|
54
|
-
id: model.id,
|
|
55
|
-
title: model.title,
|
|
56
|
-
image: model.image,
|
|
57
|
-
link: model.link,
|
|
58
|
-
currency: model.currency,
|
|
59
|
-
price: model.price,
|
|
60
|
-
salePrice: model.salePrice
|
|
61
|
-
};
|
|
62
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import { MediaType } from '../../..';
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { PostSourceType } from '$gql/types';
|
|
2
|
-
export type StreamLayoutPostHeaderModel = {
|
|
3
|
-
sourceId: string;
|
|
4
|
-
sourceName: string;
|
|
5
|
-
sourceImage: string;
|
|
6
|
-
sourceHandle: string;
|
|
7
|
-
sourceType: PostSourceType;
|
|
8
|
-
postDisplayDate: string;
|
|
9
|
-
postViewsCount: number;
|
|
10
|
-
sourceIsRemoved: boolean;
|
|
11
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { Currency } from '../../../core/enums';
|
|
2
|
-
export type StreamLayoutProductModel = {
|
|
3
|
-
id: string;
|
|
4
|
-
title: string;
|
|
5
|
-
description: string | null;
|
|
6
|
-
image: string | null;
|
|
7
|
-
link: string | null;
|
|
8
|
-
price: StreamLayoutProductPriceModel;
|
|
9
|
-
};
|
|
10
|
-
type StreamLayoutProductPriceModel = {
|
|
11
|
-
price: number;
|
|
12
|
-
currency: Currency;
|
|
13
|
-
salePrice: number | null;
|
|
14
|
-
currentPriceValue: string;
|
|
15
|
-
beforePriceValue: string | null;
|
|
16
|
-
saveValue: string | null;
|
|
17
|
-
savePercentValue: string | null;
|
|
18
|
-
};
|
|
19
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import type { Currency } from '../../../core/enums';
|
|
2
|
-
import type { StreamLayoutMediaItemModel } from './stream-layout-media-item-model';
|
|
3
|
-
import type { StreamLayoutPostHeaderModel } from './stream-layout-post-header-model';
|
|
4
|
-
export type StreamLayoutShortVideoModel = {
|
|
5
|
-
id: string;
|
|
6
|
-
media: StreamLayoutMediaItemModel;
|
|
7
|
-
text: string | null;
|
|
8
|
-
header: StreamLayoutPostHeaderModel;
|
|
9
|
-
enableSocialInteractions: boolean;
|
|
10
|
-
bookmarksCount: number;
|
|
11
|
-
products: StreamLayoutShortVideoProductModel[];
|
|
12
|
-
ad: StreamLayoutShortVideoAdModel | null;
|
|
13
|
-
};
|
|
14
|
-
export type StreamLayoutShortVideoAdModel = {
|
|
15
|
-
id: string;
|
|
16
|
-
image: string | null;
|
|
17
|
-
title: string;
|
|
18
|
-
description: string | null;
|
|
19
|
-
buttonText: string | null;
|
|
20
|
-
buttonUrl: string | null;
|
|
21
|
-
openLinkInNewWindow: boolean | null;
|
|
22
|
-
};
|
|
23
|
-
export type StreamLayoutShortVideoProductModel = {
|
|
24
|
-
id: string;
|
|
25
|
-
title: string;
|
|
26
|
-
image: string | null;
|
|
27
|
-
link: string | null;
|
|
28
|
-
price: number;
|
|
29
|
-
currency: Currency;
|
|
30
|
-
salePrice: number | null;
|
|
31
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { StreamComponentDataType } from './enums';
|
|
2
|
-
export type StreamSlotDataInput = ImagesStreamSlotDataInput | ProductStreamSlotDataInput | ShortVideoStreamSlotDataInput;
|
|
3
|
-
export interface ImagesStreamSlotDataInput {
|
|
4
|
-
type: StreamComponentDataType.Images;
|
|
5
|
-
ids: string[];
|
|
6
|
-
}
|
|
7
|
-
export interface ProductStreamSlotDataInput {
|
|
8
|
-
type: StreamComponentDataType.Product;
|
|
9
|
-
id: string;
|
|
10
|
-
}
|
|
11
|
-
export interface ShortVideoStreamSlotDataInput {
|
|
12
|
-
type: StreamComponentDataType.ShortVideo;
|
|
13
|
-
id: string;
|
|
14
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import { StreamComponentDataType } from './enums';
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { StreamComponentDataType } from './enums';
|
|
2
|
-
import type { StreamLayoutBlobModel, StreamLayoutProductModel, StreamLayoutShortVideoModel } from './models';
|
|
3
|
-
export type StreamSlotData = ImagesStreamSlotData | ProductStreamSlotData | ShortVideoStreamSlotData;
|
|
4
|
-
export type ImagesStreamSlotData = {
|
|
5
|
-
type: StreamComponentDataType.Images;
|
|
6
|
-
ids: string[];
|
|
7
|
-
items: StreamLayoutBlobModel[];
|
|
8
|
-
};
|
|
9
|
-
export type ProductStreamSlotData = {
|
|
10
|
-
type: StreamComponentDataType.Product;
|
|
11
|
-
id: string;
|
|
12
|
-
product: StreamLayoutProductModel | null;
|
|
13
|
-
};
|
|
14
|
-
export type ShortVideoStreamSlotData = {
|
|
15
|
-
type: StreamComponentDataType.ShortVideo;
|
|
16
|
-
id: string;
|
|
17
|
-
shortVideo: StreamLayoutShortVideoModel | null;
|
|
18
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import { StreamComponentDataType } from './enums';
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { StreamComponent } from './component';
|
|
2
|
-
import type { StreamSlotData } from './slot-data';
|
|
3
|
-
import type { StreamSlotDataInput } from './slot-data-input';
|
|
4
|
-
export type StreamSlotTemplate = {
|
|
5
|
-
top: number;
|
|
6
|
-
left: number;
|
|
7
|
-
width: number;
|
|
8
|
-
height: number;
|
|
9
|
-
components: StreamComponent[];
|
|
10
|
-
};
|
|
11
|
-
export type StreamSlotInput = StreamSlotTemplate & {
|
|
12
|
-
data: StreamSlotDataInput | null;
|
|
13
|
-
};
|
|
14
|
-
export type StreamSlot = StreamSlotTemplate & {
|
|
15
|
-
data: StreamSlotData | null;
|
|
16
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { StreamElementStyleFontFamily, StreamElementStyleFontWeight, StreamElementStyleHorizontalAlign } from './enums';
|
|
2
|
-
import type { ContainerStreamElementStyles, ImageStreamElementStyles, StreamLayoutStyles, TextStreamElementStyles } from './styles';
|
|
3
|
-
export declare const generateStreamLayoutStyles: (styles: StreamLayoutStyles | null) => string;
|
|
4
|
-
export declare const generateContainerStyles: (styles: Partial<ContainerStreamElementStyles> | null) => string;
|
|
5
|
-
export declare const generateTextStyles: (styles: Partial<TextStreamElementStyles> | null) => string;
|
|
6
|
-
export declare const generateImageStyles: (styles: Partial<ImageStreamElementStyles> | null) => string;
|
|
7
|
-
export declare const mapFontFamily: (value: StreamElementStyleFontFamily | null | undefined) => string;
|
|
8
|
-
export declare const mapFontWeight: (value: StreamElementStyleFontWeight | null | undefined) => "normal" | "600" | "500";
|
|
9
|
-
export declare const mapTextAlign: (value: StreamElementStyleHorizontalAlign | null | undefined) => "center" | "left" | "right";
|
|
10
|
-
export declare const mapFlexJustifyContent: (value: StreamElementStyleHorizontalAlign | null | undefined) => "center" | "flex-start" | "flex-end";
|
|
11
|
-
export declare const transformFontSizeValue: (value: number | null | undefined) => string;
|
|
12
|
-
export declare const transformNumericValue: (value: number | null | undefined, fallback?: string) => string;
|
|
13
|
-
export declare const transformColorValue: (value: string | null | undefined) => string;
|
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
import { Utils } from '../../core/utils';
|
|
2
|
-
import { StreamCssValueType, StreamElementStyleDirection, StreamElementStyleFontFamily, StreamElementStyleFontWeight, StreamElementStyleMediaFit, StreamElementStyleHorizontalAlign } from './enums';
|
|
3
|
-
export const generateStreamLayoutStyles = (styles) => {
|
|
4
|
-
if (!styles) {
|
|
5
|
-
return '';
|
|
6
|
-
}
|
|
7
|
-
const values = [`background-color: ${transformColorValue(styles.backgroundColor)};`, `font-family: ${mapFontFamily(styles.fontFamily)};`];
|
|
8
|
-
return values.join('');
|
|
9
|
-
};
|
|
10
|
-
export const generateContainerStyles = (styles) => {
|
|
11
|
-
styles = styles || {};
|
|
12
|
-
const values = [
|
|
13
|
-
'display: flex;',
|
|
14
|
-
'flex-direction: column;',
|
|
15
|
-
`width: ${transformCssValue(styles.width, 'auto')};`,
|
|
16
|
-
`height: ${transformCssValue(styles.height, 'fit-content')};`,
|
|
17
|
-
`aspect-ratio: ${styles.aspectRatio || 'auto'};`,
|
|
18
|
-
`gap: ${transformNumericValue(styles.gap)};`,
|
|
19
|
-
`padding-top: ${transformNumericValue(styles.paddingTop)};`,
|
|
20
|
-
`padding-right: ${transformNumericValue(styles.paddingRight)};`,
|
|
21
|
-
`padding-bottom: ${transformNumericValue(styles.paddingBottom)};`,
|
|
22
|
-
`padding-left: ${transformNumericValue(styles.paddingLeft)};`,
|
|
23
|
-
`background-color: ${transformColorValue(styles.backgroundColor)};`,
|
|
24
|
-
`border-width: ${styles.borderColor ? '1px' : '0'};`,
|
|
25
|
-
`border-radius: ${transformNumericValue(styles.borderRadius)};`,
|
|
26
|
-
`border-color: ${transformColorValue(styles.borderColor)};`,
|
|
27
|
-
`overflow: ${styles.borderRadius ? 'hidden' : 'visible'};`
|
|
28
|
-
];
|
|
29
|
-
if (styles.direction) {
|
|
30
|
-
values.push(`display: flex;`);
|
|
31
|
-
values.push(`flex-direction: ${styles.direction === StreamElementStyleDirection.Horizontal ? 'row' : 'column'};`);
|
|
32
|
-
}
|
|
33
|
-
return values.join('');
|
|
34
|
-
};
|
|
35
|
-
export const generateTextStyles = (styles) => {
|
|
36
|
-
styles = styles || {};
|
|
37
|
-
const values = [
|
|
38
|
-
`font-family: ${mapFontFamily(styles.fontFamily)};`,
|
|
39
|
-
`font-size: ${transformFontSizeValue(styles.fontSize)};`,
|
|
40
|
-
`font-weight: ${mapFontWeight(styles.fontWeight)};`,
|
|
41
|
-
`line-height: ${transformNumericValue(styles.lineHeight, '1.2')};`,
|
|
42
|
-
`text-align: ${mapTextAlign(styles.textAlign)};`,
|
|
43
|
-
`color: ${transformColorValue(styles.color)};`
|
|
44
|
-
];
|
|
45
|
-
return values.join('');
|
|
46
|
-
};
|
|
47
|
-
export const generateImageStyles = (styles) => {
|
|
48
|
-
styles = styles || {};
|
|
49
|
-
const imageStyles = [`object-fit: ${mapMediaFit(styles.mediaFit)};`];
|
|
50
|
-
return imageStyles.join('');
|
|
51
|
-
};
|
|
52
|
-
export const mapFontFamily = (value) => {
|
|
53
|
-
switch (value) {
|
|
54
|
-
case StreamElementStyleFontFamily.System:
|
|
55
|
-
return 'inherit';
|
|
56
|
-
default: {
|
|
57
|
-
return 'inherit';
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
export const mapFontWeight = (value) => {
|
|
62
|
-
switch (value) {
|
|
63
|
-
case StreamElementStyleFontWeight.Bold:
|
|
64
|
-
return '600';
|
|
65
|
-
case StreamElementStyleFontWeight.SemiBold:
|
|
66
|
-
return '500';
|
|
67
|
-
default: {
|
|
68
|
-
return 'normal';
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
};
|
|
72
|
-
export const mapTextAlign = (value) => {
|
|
73
|
-
switch (value) {
|
|
74
|
-
case StreamElementStyleHorizontalAlign.Left:
|
|
75
|
-
return 'left';
|
|
76
|
-
case StreamElementStyleHorizontalAlign.Center:
|
|
77
|
-
return 'center';
|
|
78
|
-
case StreamElementStyleHorizontalAlign.Right:
|
|
79
|
-
return 'right';
|
|
80
|
-
default: {
|
|
81
|
-
return 'left';
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
};
|
|
85
|
-
export const mapFlexJustifyContent = (value) => {
|
|
86
|
-
switch (value) {
|
|
87
|
-
case StreamElementStyleHorizontalAlign.Left:
|
|
88
|
-
return 'flex-start';
|
|
89
|
-
case StreamElementStyleHorizontalAlign.Center:
|
|
90
|
-
return 'center';
|
|
91
|
-
case StreamElementStyleHorizontalAlign.Right:
|
|
92
|
-
return 'flex-end';
|
|
93
|
-
default: {
|
|
94
|
-
return 'flex-start';
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
};
|
|
98
|
-
const mapMediaFit = (value) => {
|
|
99
|
-
switch (value) {
|
|
100
|
-
case StreamElementStyleMediaFit.Cover:
|
|
101
|
-
return 'cover';
|
|
102
|
-
case StreamElementStyleMediaFit.Contain:
|
|
103
|
-
return 'contain';
|
|
104
|
-
default: {
|
|
105
|
-
return 'cover';
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
};
|
|
109
|
-
const transformCssValue = (value, fallback = '0') => {
|
|
110
|
-
if (value === null || value === undefined) {
|
|
111
|
-
return fallback;
|
|
112
|
-
}
|
|
113
|
-
switch (value.type) {
|
|
114
|
-
case StreamCssValueType.DDU:
|
|
115
|
-
return transformNumericValue(value.value, fallback);
|
|
116
|
-
case StreamCssValueType.Pct:
|
|
117
|
-
return `${value.value}%`;
|
|
118
|
-
default:
|
|
119
|
-
Utils.assertUnreachable(value);
|
|
120
|
-
}
|
|
121
|
-
};
|
|
122
|
-
export const transformFontSizeValue = (value) => {
|
|
123
|
-
if (value === null || value === undefined) {
|
|
124
|
-
value = 16;
|
|
125
|
-
}
|
|
126
|
-
return transformNumericValue(value);
|
|
127
|
-
};
|
|
128
|
-
const baseContainerWidth = 400;
|
|
129
|
-
export const transformNumericValue = (value, fallback = '0') => {
|
|
130
|
-
if (value === null || value === undefined) {
|
|
131
|
-
return fallback;
|
|
132
|
-
}
|
|
133
|
-
return `${(value / baseContainerWidth) * 100}cqi`;
|
|
134
|
-
};
|
|
135
|
-
export const transformColorValue = (value) => {
|
|
136
|
-
if (value === null || value === undefined) {
|
|
137
|
-
return 'transparent';
|
|
138
|
-
}
|
|
139
|
-
return value;
|
|
140
|
-
};
|