@streamscloud/kit 0.1.11 → 0.1.12-1772032209109
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/toastr/index.d.ts +1 -1
- package/dist/core/toastr/toastr.scss +38 -0
- package/dist/core/toastr/toastr.svelte.d.ts +1 -1
- package/dist/core/toastr/toastr.svelte.js +13 -6
- package/dist/core/toastr/types.d.ts +2 -0
- package/dist/ui/cropper/image-editor-dialog/cmp.image-editor-dialog.svelte +8 -7
- package/dist/ui/cropper/image-editor-dialog/index.d.ts +2 -2
- package/dist/ui/cropper/image-editor-dialog/index.js +1 -1
- package/dist/ui/cropper/image-editor-dialog/types.d.ts +11 -3
- package/dist/ui/cropper/img-cropper/cmp.img-cropper.svelte +1 -2
- package/dist/ui/cropper/img-cropper/img-cropper-base-worker.svelte.d.ts +8 -11
- package/dist/ui/cropper/img-cropper/img-cropper-base-worker.svelte.js +19 -7
- package/dist/ui/cropper/img-cropper/img-cropper-utils.d.ts +1 -0
- package/dist/ui/cropper/img-cropper/img-cropper-utils.js +23 -0
- package/dist/ui/cropper/img-cropper/img-cropper-worker.svelte.d.ts +9 -10
- package/dist/ui/cropper/img-cropper/img-cropper.svelte.d.ts +7 -19
- package/dist/ui/cropper/img-cropper/img-cropper.svelte.js +10 -5
- package/dist/ui/cropper/img-cropper/index.d.ts +1 -1
- package/dist/ui/dialog/cmp.dialog-container.svelte +12 -12
- package/dist/ui/dialog/dialog-data.d.ts +2 -0
- package/dist/ui/dialog/dialog-mount.d.ts +1 -1
- package/dist/ui/dialog/dialog-mount.js +2 -2
- package/dist/ui/dialog/dialogs.svelte.d.ts +3 -0
- package/dist/ui/dialog/dialogs.svelte.js +21 -2
- package/dist/ui/dialog/index.d.ts +1 -1
- package/dist/ui/dialog/index.js +1 -1
- package/dist/ui/dialog/types.svelte.d.ts +3 -14
- package/dist/ui/dialog/types.svelte.js +3 -18
- package/dist/ui/form-group/cmp.form-group-label.svelte +25 -0
- package/dist/ui/form-group/cmp.form-group-label.svelte.d.ts +8 -0
- package/dist/ui/form-group/cmp.form-group-note.svelte +16 -0
- package/dist/ui/form-group/cmp.form-group-note.svelte.d.ts +7 -0
- package/dist/ui/form-group/cmp.form-group.svelte +16 -0
- package/dist/ui/form-group/cmp.form-group.svelte.d.ts +8 -0
- package/dist/ui/form-group/index.d.ts +3 -0
- package/dist/ui/form-group/index.js +3 -0
- package/dist/ui/html-block/cmp.html-block.svelte +112 -0
- package/dist/ui/html-block/cmp.html-block.svelte.d.ts +7 -0
- package/dist/ui/html-block/index.d.ts +1 -0
- package/dist/ui/html-block/index.js +1 -0
- package/dist/ui/media-viewer-dialog/cmp.media-viewer-dialog.svelte +50 -0
- package/dist/ui/media-viewer-dialog/cmp.media-viewer-dialog.svelte.d.ts +9 -0
- package/dist/ui/media-viewer-dialog/index.d.ts +13 -0
- package/dist/ui/media-viewer-dialog/index.js +17 -0
- package/dist/ui/media-viewer-dialog/media-viewer-item.svelte +61 -0
- package/dist/ui/media-viewer-dialog/media-viewer-item.svelte.d.ts +7 -0
- package/dist/ui/media-viewer-dialog/types.d.ts +13 -0
- package/dist/ui/media-viewer-dialog/types.js +1 -0
- package/dist/ui/player/carousel/cmp.carousel.svelte +2 -2
- package/dist/ui/player/carousel/cmp.carousel.svelte.d.ts +1 -1
- package/dist/ui/video/cmp.video.svelte +16 -7
- package/package.json +14 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { Dialogs } from './dialogs.svelte';
|
|
2
2
|
export { DialogController } from './dialog-controller';
|
|
3
|
-
export {
|
|
3
|
+
export { DIALOG_SIZES, type DialogPosition, type DialogResult, type DialogSize } from './types.svelte';
|
|
4
4
|
export { default as Dialog } from './cmp.dialog.svelte';
|
|
5
5
|
export { default as DialogButton } from './cmp.dialog-button.svelte';
|
|
6
6
|
export { default as DialogCancelButton } from './cmp.dialog-cancel-button.svelte';
|
package/dist/ui/dialog/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { Dialogs } from './dialogs.svelte';
|
|
2
2
|
export { DialogController } from './dialog-controller';
|
|
3
|
-
export {
|
|
3
|
+
export { DIALOG_SIZES } from './types.svelte';
|
|
4
4
|
export { default as Dialog } from './cmp.dialog.svelte';
|
|
5
5
|
export { default as DialogButton } from './cmp.dialog-button.svelte';
|
|
6
6
|
export { default as DialogCancelButton } from './cmp.dialog-cancel-button.svelte';
|
|
@@ -1,17 +1,6 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
Default = "default",
|
|
5
|
-
Large = "large",
|
|
6
|
-
FullHD = "fullhd",
|
|
7
|
-
Auto = "auto"
|
|
8
|
-
}
|
|
9
|
-
export declare enum DialogPosition {
|
|
10
|
-
Center = "center",
|
|
11
|
-
CenterTop = "center-top",
|
|
12
|
-
FullScreen = "full-screen",
|
|
13
|
-
FullHeight = "full-height"
|
|
14
|
-
}
|
|
1
|
+
export type DialogSize = 'small' | 'medium' | 'default' | 'large' | 'fullhd' | 'auto';
|
|
2
|
+
export type DialogPosition = 'center' | 'center-top' | 'full-screen' | 'full-height';
|
|
3
|
+
export declare const DIALOG_SIZES: readonly DialogSize[];
|
|
15
4
|
export declare class DialogSettings {
|
|
16
5
|
closeOnClickOutside: boolean;
|
|
17
6
|
closeOnEsc: boolean;
|
|
@@ -1,25 +1,10 @@
|
|
|
1
|
-
export
|
|
2
|
-
(function (DialogSize) {
|
|
3
|
-
DialogSize["Small"] = "small";
|
|
4
|
-
DialogSize["Medium"] = "medium";
|
|
5
|
-
DialogSize["Default"] = "default";
|
|
6
|
-
DialogSize["Large"] = "large";
|
|
7
|
-
DialogSize["FullHD"] = "fullhd";
|
|
8
|
-
DialogSize["Auto"] = "auto";
|
|
9
|
-
})(DialogSize || (DialogSize = {}));
|
|
10
|
-
export var DialogPosition;
|
|
11
|
-
(function (DialogPosition) {
|
|
12
|
-
DialogPosition["Center"] = "center";
|
|
13
|
-
DialogPosition["CenterTop"] = "center-top";
|
|
14
|
-
DialogPosition["FullScreen"] = "full-screen";
|
|
15
|
-
DialogPosition["FullHeight"] = "full-height";
|
|
16
|
-
})(DialogPosition || (DialogPosition = {}));
|
|
1
|
+
export const DIALOG_SIZES = ['small', 'medium', 'default', 'large', 'fullhd', 'auto'];
|
|
17
2
|
export class DialogSettings {
|
|
18
3
|
closeOnClickOutside = $state(false);
|
|
19
4
|
closeOnEsc = $state(false);
|
|
20
5
|
nonCancelable = $state(false);
|
|
21
6
|
}
|
|
22
7
|
export class DialogContainerSettings {
|
|
23
|
-
size = $state(
|
|
24
|
-
position = $state(
|
|
8
|
+
size = $state('default');
|
|
9
|
+
position = $state('center-top');
|
|
25
10
|
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<script lang="ts">let { withTooltip = false, children } = $props();
|
|
2
|
+
export {};
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<div class="form-group-label" class:form-group-label--with-tooltip={withTooltip}>
|
|
6
|
+
{@render children()}
|
|
7
|
+
</div>
|
|
8
|
+
|
|
9
|
+
<style>.form-group-label {
|
|
10
|
+
--_form-group--label--font-size: var(--sc-kit--form-group--label--font-size, 0.875rem);
|
|
11
|
+
--_form-group--label--font-weight: var(--sc-kit--form-group--label--font-weight, 400);
|
|
12
|
+
--_form-group--label--color: var(--sc-kit--form-group--label--color);
|
|
13
|
+
--_form-group--label--margin-bottom: var(--sc-kit--form-group--label--margin-bottom, 0.5rem);
|
|
14
|
+
font-size: var(--_form-group--label--font-size);
|
|
15
|
+
padding: 0;
|
|
16
|
+
margin-bottom: var(--_form-group--label--margin-bottom);
|
|
17
|
+
font-weight: var(--_form-group--label--font-weight);
|
|
18
|
+
display: block;
|
|
19
|
+
color: var(--_form-group--label--color);
|
|
20
|
+
}
|
|
21
|
+
.form-group-label--with-tooltip {
|
|
22
|
+
display: flex;
|
|
23
|
+
align-items: center;
|
|
24
|
+
gap: 0.25rem;
|
|
25
|
+
}</style>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<script lang="ts">let { children } = $props();
|
|
2
|
+
export {};
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<div class="form-group-note">
|
|
6
|
+
{@render children()}
|
|
7
|
+
</div>
|
|
8
|
+
|
|
9
|
+
<style>.form-group-note {
|
|
10
|
+
--_form-group--note--font-size: var(--sc-kit--form-group--note--font-size, 0.875rem);
|
|
11
|
+
--_form-group--note--font-weight: var(--sc-kit--form-group--note--font-weight, 300);
|
|
12
|
+
margin-top: 0.5rem;
|
|
13
|
+
color: #9ca3af;
|
|
14
|
+
font-size: var(--_form-group--note--font-size);
|
|
15
|
+
font-weight: var(--_form-group--note--font-weight);
|
|
16
|
+
}</style>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<script lang="ts">let { noMargin = false, children } = $props();
|
|
2
|
+
export {};
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<div class="form-group" class:form-group--no-margin={noMargin}>
|
|
6
|
+
{@render children()}
|
|
7
|
+
</div>
|
|
8
|
+
|
|
9
|
+
<style>.form-group {
|
|
10
|
+
--_form-group--margin-bottom: var(--sc-kit--form-group--margin-bottom, 1.25rem);
|
|
11
|
+
display: block;
|
|
12
|
+
margin-bottom: var(--_form-group--margin-bottom);
|
|
13
|
+
}
|
|
14
|
+
.form-group--no-margin {
|
|
15
|
+
margin-bottom: 0;
|
|
16
|
+
}</style>
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
<script lang="ts">let { children } = $props();
|
|
2
|
+
export {};
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<div class="html-block">
|
|
6
|
+
{@render children()}
|
|
7
|
+
</div>
|
|
8
|
+
|
|
9
|
+
<style>.html-block {
|
|
10
|
+
display: contents;
|
|
11
|
+
word-break: break-word;
|
|
12
|
+
font-size: 0.875em;
|
|
13
|
+
line-height: 1.4;
|
|
14
|
+
font-weight: normal;
|
|
15
|
+
color: light-dark(#2e2e2e, #ffffff);
|
|
16
|
+
}
|
|
17
|
+
.html-block :global(h1) {
|
|
18
|
+
font-size: 1.5em;
|
|
19
|
+
line-height: 1.4;
|
|
20
|
+
font-weight: 600;
|
|
21
|
+
color: light-dark(#2e2e2e, #ffffff);
|
|
22
|
+
}
|
|
23
|
+
.html-block :global(h2) {
|
|
24
|
+
font-size: 1.375em;
|
|
25
|
+
line-height: 1.4;
|
|
26
|
+
font-weight: 600;
|
|
27
|
+
color: light-dark(#2e2e2e, #ffffff);
|
|
28
|
+
}
|
|
29
|
+
.html-block :global(h3) {
|
|
30
|
+
font-size: 1.25em;
|
|
31
|
+
line-height: 1.4;
|
|
32
|
+
font-weight: 600;
|
|
33
|
+
color: light-dark(#2e2e2e, #ffffff);
|
|
34
|
+
}
|
|
35
|
+
.html-block :global(h4) {
|
|
36
|
+
font-size: 1.125em;
|
|
37
|
+
line-height: 1.4;
|
|
38
|
+
font-weight: 500;
|
|
39
|
+
color: light-dark(#2e2e2e, #ffffff);
|
|
40
|
+
}
|
|
41
|
+
.html-block :global(h5) {
|
|
42
|
+
font-size: 1.0625em;
|
|
43
|
+
line-height: 1.4;
|
|
44
|
+
font-weight: 500;
|
|
45
|
+
color: light-dark(#2e2e2e, #ffffff);
|
|
46
|
+
}
|
|
47
|
+
.html-block :global(h6) {
|
|
48
|
+
font-size: 1em;
|
|
49
|
+
line-height: 1.4;
|
|
50
|
+
font-weight: 500;
|
|
51
|
+
color: light-dark(#2e2e2e, #ffffff);
|
|
52
|
+
}
|
|
53
|
+
.html-block :global(a) {
|
|
54
|
+
font-size: 1em;
|
|
55
|
+
line-height: 1.4;
|
|
56
|
+
font-weight: normal;
|
|
57
|
+
color: light-dark(#2e2e2e, #ffffff);
|
|
58
|
+
color: light-dark(#144ab0, #5a8dec);
|
|
59
|
+
}
|
|
60
|
+
.html-block :global(pre) {
|
|
61
|
+
font-family: monospace;
|
|
62
|
+
white-space: pre-wrap;
|
|
63
|
+
margin: 1em 0;
|
|
64
|
+
font-size: 1em;
|
|
65
|
+
line-height: 1;
|
|
66
|
+
font-weight: normal;
|
|
67
|
+
color: light-dark(#2e2e2e, #ffffff);
|
|
68
|
+
}
|
|
69
|
+
.html-block :global(ul) :global(> li),
|
|
70
|
+
.html-block :global(ol) :global(> li) {
|
|
71
|
+
list-style: inherit;
|
|
72
|
+
margin-left: 1em;
|
|
73
|
+
position: relative;
|
|
74
|
+
font-size: 1em;
|
|
75
|
+
line-height: 1.4;
|
|
76
|
+
font-weight: normal;
|
|
77
|
+
color: light-dark(#2e2e2e, #ffffff);
|
|
78
|
+
}
|
|
79
|
+
.html-block :global(ol) {
|
|
80
|
+
list-style-type: decimal;
|
|
81
|
+
}
|
|
82
|
+
.html-block :global(ol) :global(> li > ol) {
|
|
83
|
+
list-style-type: lower-alpha;
|
|
84
|
+
}
|
|
85
|
+
.html-block :global(table) {
|
|
86
|
+
max-width: 100%;
|
|
87
|
+
}
|
|
88
|
+
.html-block :global(table),
|
|
89
|
+
.html-block :global(tbody),
|
|
90
|
+
.html-block :global(thead),
|
|
91
|
+
.html-block :global(tr),
|
|
92
|
+
.html-block :global(th),
|
|
93
|
+
.html-block :global(td) {
|
|
94
|
+
border-width: initial;
|
|
95
|
+
border-style: inherit;
|
|
96
|
+
border-color: inherit;
|
|
97
|
+
}
|
|
98
|
+
.html-block :global(ul:not([style*='list-style-type'])),
|
|
99
|
+
.html-block :global(ul:not([style*='list-style-type']) > li > ul:not([style*='list-style-type'])) {
|
|
100
|
+
list-style-type: none;
|
|
101
|
+
}
|
|
102
|
+
.html-block :global(ul:not([style*='list-style-type']) > li:before),
|
|
103
|
+
.html-block :global(ul:not([style*='list-style-type']) > li > ul:not([style*='list-style-type']) > li:before) {
|
|
104
|
+
content: "-";
|
|
105
|
+
text-indent: -1em;
|
|
106
|
+
position: absolute;
|
|
107
|
+
font-weight: bold;
|
|
108
|
+
}
|
|
109
|
+
.html-block :global(ul[style*='list-style-type'] > li:before),
|
|
110
|
+
.html-block :global(ul > li > ul[style*='list-style-type'] > li:before) {
|
|
111
|
+
content: none;
|
|
112
|
+
}</style>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as HtmlBlock } from './cmp.html-block.svelte';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as HtmlBlock } from './cmp.html-block.svelte';
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
<script lang="ts">import { DialogCloseButton } from '../dialog';
|
|
2
|
+
import { Carousel } from '../player/carousel';
|
|
3
|
+
import { default as MediaViewerItem } from './media-viewer-item.svelte';
|
|
4
|
+
import { untrack } from 'svelte';
|
|
5
|
+
const { controller, data } = $props();
|
|
6
|
+
$effect(() => untrack(() => {
|
|
7
|
+
controller.updateSettings({ closeOnEsc: true, closeOnClickOutside: true });
|
|
8
|
+
controller.updateContainerSettings({ position: 'full-screen' });
|
|
9
|
+
}));
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<div class="media-viewer-dialog" style:--media-viewer-dialog--background--opacity={data.backgroundOpacity}>
|
|
13
|
+
<div class="media-viewer-dialog__close">
|
|
14
|
+
<DialogCloseButton controller={controller} />
|
|
15
|
+
</div>
|
|
16
|
+
|
|
17
|
+
<div class="media-viewer-dialog__content">
|
|
18
|
+
{#if data.items.length === 1}
|
|
19
|
+
<MediaViewerItem item={data.items[0]} />
|
|
20
|
+
{:else}
|
|
21
|
+
<Carousel items={data.items} initialIndex={data.index} mode="arrows-with-counts" on={{ indexChanged: () => {} }}>
|
|
22
|
+
{#snippet children(item)}
|
|
23
|
+
<MediaViewerItem item={item} />
|
|
24
|
+
{/snippet}
|
|
25
|
+
</Carousel>
|
|
26
|
+
{/if}
|
|
27
|
+
</div>
|
|
28
|
+
</div>
|
|
29
|
+
|
|
30
|
+
<style>.media-viewer-dialog {
|
|
31
|
+
--_media-viewer-dialog--background--opacity: var(--media-viewer-dialog--background--opacity, 0.6);
|
|
32
|
+
--sc-kit--dialog-close-button--color: #ffffff;
|
|
33
|
+
display: flex;
|
|
34
|
+
flex-direction: column;
|
|
35
|
+
width: 100%;
|
|
36
|
+
height: 100%;
|
|
37
|
+
background: rgba(0, 0, 0, var(--_media-viewer-dialog--background--opacity));
|
|
38
|
+
position: relative;
|
|
39
|
+
padding: 0.625rem;
|
|
40
|
+
}
|
|
41
|
+
.media-viewer-dialog__close {
|
|
42
|
+
position: absolute;
|
|
43
|
+
top: 0.75rem;
|
|
44
|
+
right: 0.75rem;
|
|
45
|
+
z-index: 10;
|
|
46
|
+
}
|
|
47
|
+
.media-viewer-dialog__content {
|
|
48
|
+
flex: 1;
|
|
49
|
+
min-height: 0;
|
|
50
|
+
}</style>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type DialogController } from '../dialog';
|
|
2
|
+
import type { MediaViewerData } from './types';
|
|
3
|
+
type Props = {
|
|
4
|
+
controller: DialogController;
|
|
5
|
+
data: MediaViewerData;
|
|
6
|
+
};
|
|
7
|
+
declare const Cmp: import("svelte").Component<Props, {}, "">;
|
|
8
|
+
type Cmp = ReturnType<typeof Cmp>;
|
|
9
|
+
export default Cmp;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type DialogResult } from '../dialog';
|
|
2
|
+
import type { MediaViewerData } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Opens a full-screen media viewer dialog for images and videos.
|
|
5
|
+
* Single item renders directly; multiple items display in a carousel with arrow navigation.
|
|
6
|
+
*
|
|
7
|
+
* ### Options
|
|
8
|
+
* - `items` — array of media items to display
|
|
9
|
+
* - `index` — zero-based index of the initially visible item
|
|
10
|
+
* - `backgroundOpacity` — backdrop opacity (default `0.6`)
|
|
11
|
+
*/
|
|
12
|
+
export declare const openMediaViewer: (data: MediaViewerData) => Promise<DialogResult<void>>;
|
|
13
|
+
export type { MediaViewerData, MediaViewerItem, MediaViewerItemType } from './types';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Dialogs } from '../dialog';
|
|
2
|
+
import { default as MediaViewerDialog } from './cmp.media-viewer-dialog.svelte';
|
|
3
|
+
/**
|
|
4
|
+
* Opens a full-screen media viewer dialog for images and videos.
|
|
5
|
+
* Single item renders directly; multiple items display in a carousel with arrow navigation.
|
|
6
|
+
*
|
|
7
|
+
* ### Options
|
|
8
|
+
* - `items` — array of media items to display
|
|
9
|
+
* - `index` — zero-based index of the initially visible item
|
|
10
|
+
* - `backgroundOpacity` — backdrop opacity (default `0.6`)
|
|
11
|
+
*/
|
|
12
|
+
export const openMediaViewer = (data) => {
|
|
13
|
+
return Dialogs.open({
|
|
14
|
+
view: MediaViewerDialog,
|
|
15
|
+
data
|
|
16
|
+
});
|
|
17
|
+
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
<script lang="ts">import { Image } from '../image';
|
|
2
|
+
import { Video } from '../video';
|
|
3
|
+
const { item } = $props();
|
|
4
|
+
let containerWidth = $state(0);
|
|
5
|
+
let containerHeight = $state(0);
|
|
6
|
+
const fittedSize = $derived.by(() => {
|
|
7
|
+
if (containerWidth === 0 || containerHeight === 0) {
|
|
8
|
+
return { width: 0, height: 0 };
|
|
9
|
+
}
|
|
10
|
+
const aspectRatio = item.width / item.height;
|
|
11
|
+
const containerRatio = containerWidth / containerHeight;
|
|
12
|
+
if (aspectRatio > containerRatio) {
|
|
13
|
+
const width = containerWidth;
|
|
14
|
+
const height = width / aspectRatio;
|
|
15
|
+
return { width, height };
|
|
16
|
+
}
|
|
17
|
+
const height = containerHeight;
|
|
18
|
+
const width = height * aspectRatio;
|
|
19
|
+
return { width, height };
|
|
20
|
+
});
|
|
21
|
+
const observeResize = (node) => {
|
|
22
|
+
const observer = new ResizeObserver((entries) => {
|
|
23
|
+
const entry = entries[0];
|
|
24
|
+
if (entry) {
|
|
25
|
+
containerWidth = entry.contentRect.width;
|
|
26
|
+
containerHeight = entry.contentRect.height;
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
observer.observe(node);
|
|
30
|
+
return {
|
|
31
|
+
destroy: () => observer.disconnect()
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
</script>
|
|
35
|
+
|
|
36
|
+
<div class="media-viewer-item" use:observeResize>
|
|
37
|
+
{#if fittedSize.width > 0 && fittedSize.height > 0}
|
|
38
|
+
<div class="media-viewer-item__media" style:width="{fittedSize.width}px" style:height="{fittedSize.height}px">
|
|
39
|
+
{#if item.type === 'image'}
|
|
40
|
+
<Image src={item.url} alt="" />
|
|
41
|
+
{:else}
|
|
42
|
+
<Video src={item.url} poster={item.thumbnailUrl} autoplay="on-appearance" />
|
|
43
|
+
{/if}
|
|
44
|
+
</div>
|
|
45
|
+
{/if}
|
|
46
|
+
</div>
|
|
47
|
+
|
|
48
|
+
<style>.media-viewer-item {
|
|
49
|
+
--sc-kit--image--object-fit: contain;
|
|
50
|
+
--sc-kit--video--media-fit: contain;
|
|
51
|
+
display: flex;
|
|
52
|
+
align-items: center;
|
|
53
|
+
justify-content: center;
|
|
54
|
+
width: 100%;
|
|
55
|
+
height: 100%;
|
|
56
|
+
}
|
|
57
|
+
.media-viewer-item__media {
|
|
58
|
+
flex-shrink: 0;
|
|
59
|
+
overflow: hidden;
|
|
60
|
+
border-radius: 0.375rem;
|
|
61
|
+
}</style>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type MediaViewerItemType = 'image' | 'video';
|
|
2
|
+
export type MediaViewerItem = {
|
|
3
|
+
url: string;
|
|
4
|
+
thumbnailUrl: string | null;
|
|
5
|
+
type: MediaViewerItemType;
|
|
6
|
+
width: number;
|
|
7
|
+
height: number;
|
|
8
|
+
};
|
|
9
|
+
export type MediaViewerData = {
|
|
10
|
+
items: MediaViewerItem[];
|
|
11
|
+
index: number;
|
|
12
|
+
backgroundOpacity?: number;
|
|
13
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -260,7 +260,7 @@ A horizontal slide carousel with infinite looping, touch swipe support, keyboard
|
|
|
260
260
|
### CSS Custom Properties
|
|
261
261
|
| Property | Description | Default |
|
|
262
262
|
|---|---|---|
|
|
263
|
-
| `--sc-kit--carousel--button-color` | Navigation arrow button background | `
|
|
263
|
+
| `--sc-kit--carousel--button-color` | Navigation arrow button background | `rgba(255, 255, 255, 0.2)` |
|
|
264
264
|
| `--sc-kit--carousel--dot-color` | Dot indicator color (fill when active, border when inactive) | `white` |
|
|
265
265
|
| `--sc-kit--carousel--dot-size` | Dot indicator diameter | `0.5rem` |
|
|
266
266
|
| `--sc-kit--carousel--text-color` | Arrow button icon and counter text color | `white` |
|
|
@@ -269,7 +269,7 @@ A horizontal slide carousel with infinite looping, touch swipe support, keyboard
|
|
|
269
269
|
<style>@charset "UTF-8";
|
|
270
270
|
.carousel {
|
|
271
271
|
/* Public API */
|
|
272
|
-
--_carousel--button-color: var(--sc-kit--carousel--button-color,
|
|
272
|
+
--_carousel--button-color: var(--sc-kit--carousel--button-color, rgba(255, 255, 255, 0.2));
|
|
273
273
|
--_carousel--dot-color: var(--sc-kit--carousel--dot-color, #ffffff);
|
|
274
274
|
--_carousel--dot-size: var(--sc-kit--carousel--dot-size, 0.5rem);
|
|
275
275
|
--_carousel--text-color: var(--sc-kit--carousel--text-color, #ffffff);
|
|
@@ -46,7 +46,7 @@ interface $$IsomorphicComponent {
|
|
|
46
46
|
* ### CSS Custom Properties
|
|
47
47
|
* | Property | Description | Default |
|
|
48
48
|
* |---|---|---|
|
|
49
|
-
* | `--sc-kit--carousel--button-color` | Navigation arrow button background | `
|
|
49
|
+
* | `--sc-kit--carousel--button-color` | Navigation arrow button background | `rgba(255, 255, 255, 0.2)` |
|
|
50
50
|
* | `--sc-kit--carousel--dot-color` | Dot indicator color (fill when active, border when inactive) | `white` |
|
|
51
51
|
* | `--sc-kit--carousel--dot-size` | Dot indicator diameter | `0.5rem` |
|
|
52
52
|
* | `--sc-kit--carousel--text-color` | Arrow button icon and counter text color | `white` |
|
|
@@ -8,10 +8,11 @@ import IconSpeaker from '@fluentui/svg-icons/icons/speaker_2_20_regular.svg?raw'
|
|
|
8
8
|
import IconSpeakerMute from '@fluentui/svg-icons/icons/speaker_mute_20_regular.svg?raw';
|
|
9
9
|
import { untrack } from 'svelte';
|
|
10
10
|
import { fade } from 'svelte/transition';
|
|
11
|
-
let { src, poster, id = randomNanoid(), controls =
|
|
11
|
+
let { src, poster, id = randomNanoid(), controls = false, autoplay = false, loop = false, inert = false, allowPreloading = false, hideSpeaker = false, hidePlayButton = false, intersectionContainer, scrubberPosition = 'bottom', on } = $props();
|
|
12
12
|
let video = $state(null);
|
|
13
13
|
let videoContainerRef = $state(null);
|
|
14
14
|
let showControlsOnHover = $state(false);
|
|
15
|
+
let showProgressOnHover = $state(false);
|
|
15
16
|
let isVideoPaused = $state(true);
|
|
16
17
|
let percentageCompleted = $state(0);
|
|
17
18
|
let everActivated = $state(false);
|
|
@@ -246,7 +247,13 @@ const handleSeek = (percent) => {
|
|
|
246
247
|
<img class="video__poster" src={poster} alt="" />
|
|
247
248
|
{/if}
|
|
248
249
|
{#if !controls || !everActivated}
|
|
249
|
-
<div
|
|
250
|
+
<div
|
|
251
|
+
class="video__overlay"
|
|
252
|
+
onclick={togglePlay}
|
|
253
|
+
onkeydown={() => ({})}
|
|
254
|
+
onmouseenter={() => (showControlsOnHover = true)}
|
|
255
|
+
onmouseleave={() => (showControlsOnHover = false)}
|
|
256
|
+
role="none">
|
|
250
257
|
{#if isVideoPaused && !hidePlayButton}
|
|
251
258
|
<button type="button" aria-label="play" class="video__playback-button" onclick={togglePlay} onkeydown={() => ({})}>
|
|
252
259
|
<Icon src={IconPlay} color="white" />
|
|
@@ -256,6 +263,7 @@ const handleSeek = (percent) => {
|
|
|
256
263
|
<Icon src={IconPause} color="white" />
|
|
257
264
|
</button>
|
|
258
265
|
{/if}
|
|
266
|
+
|
|
259
267
|
{#if (showControlsOnHover || MediaVolumeManager.isMuted) && !hideSpeaker}
|
|
260
268
|
<button type="button" aria-label={MediaVolumeManager.isMuted ? 'mute' : 'unmute'} class="video__mute-button" onclick={toggleMute}>
|
|
261
269
|
{#if MediaVolumeManager.isMuted}
|
|
@@ -271,10 +279,10 @@ const handleSeek = (percent) => {
|
|
|
271
279
|
class="video__progress-container"
|
|
272
280
|
class:video__progress-container--top={scrubberPosition === 'top'}
|
|
273
281
|
class:video__progress-container--bottom={scrubberPosition === 'bottom'}
|
|
274
|
-
onmouseenter={() => (
|
|
275
|
-
onmouseleave={() => (
|
|
282
|
+
onmouseenter={() => (showProgressOnHover = true)}
|
|
283
|
+
onmouseleave={() => (showProgressOnHover = false)}
|
|
276
284
|
role="none">
|
|
277
|
-
{#if
|
|
285
|
+
{#if showProgressOnHover || (!showProgressOnHover && isVideoPaused)}
|
|
278
286
|
<div
|
|
279
287
|
class="video__seek-bar"
|
|
280
288
|
transition:fade={{ duration: isVideoPaused ? 0 : 300 }}
|
|
@@ -321,12 +329,12 @@ A full-featured video player with custom overlay controls, play/pause, mute, see
|
|
|
321
329
|
background: var(--_video--background-color);
|
|
322
330
|
}
|
|
323
331
|
.video__playback-button {
|
|
332
|
+
--sc-kit--icon--size: 2.5rem;
|
|
324
333
|
--sc-kit--icon--filter: drop-shadow(1px 1px #000000);
|
|
325
334
|
position: absolute;
|
|
326
335
|
top: 50%;
|
|
327
336
|
left: 50%;
|
|
328
337
|
transform: translate(-50%, -50%);
|
|
329
|
-
font-size: 2em;
|
|
330
338
|
}
|
|
331
339
|
.video__playback-button--pause {
|
|
332
340
|
/* Set 'container-type: inline-size;' to reference container*/
|
|
@@ -337,10 +345,11 @@ A full-featured video player with custom overlay controls, play/pause, mute, see
|
|
|
337
345
|
}
|
|
338
346
|
}
|
|
339
347
|
.video__mute-button {
|
|
348
|
+
--sc-kit--icon--size: 1.25rem;
|
|
349
|
+
--sc-kit--icon--filter: drop-shadow(1px 1px #000000);
|
|
340
350
|
position: absolute;
|
|
341
351
|
top: 0.625em;
|
|
342
352
|
right: 0.625em;
|
|
343
|
-
font-size: 1em;
|
|
344
353
|
z-index: 1;
|
|
345
354
|
}
|
|
346
355
|
.video__poster {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@streamscloud/kit",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.12-1772032209109",
|
|
4
4
|
"author": "StreamsCloud",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
"pack": "npm run build && npm pack",
|
|
18
18
|
"preview": "vite preview",
|
|
19
19
|
"check": "svelte-check --tsconfig ./tsconfig.app.json && tsc -p tsconfig.node.json",
|
|
20
|
+
"check:strict": "svelte-check --tsconfig ./tsconfig.app.json --fail-on-warnings --output machine && eslint . --format codeframe --max-warnings 0 && prettier --check --plugin prettier-plugin-svelte --cache .",
|
|
20
21
|
"lint": "prettier --check --plugin prettier-plugin-svelte . && eslint .",
|
|
21
22
|
"lint-format": "prettier --write --plugin prettier-plugin-svelte . && eslint --fix .",
|
|
22
23
|
"format": "prettier --write --plugin prettier-plugin-svelte ."
|
|
@@ -104,6 +105,10 @@
|
|
|
104
105
|
"types": "./dist/ui/dialog/index.d.ts",
|
|
105
106
|
"svelte": "./dist/ui/dialog/index.js"
|
|
106
107
|
},
|
|
108
|
+
"./ui/form-group": {
|
|
109
|
+
"types": "./dist/ui/form-group/index.d.ts",
|
|
110
|
+
"svelte": "./dist/ui/form-group/index.js"
|
|
111
|
+
},
|
|
107
112
|
"./ui/dropdown": {
|
|
108
113
|
"types": "./dist/ui/dropdown/index.d.ts",
|
|
109
114
|
"svelte": "./dist/ui/dropdown/index.js"
|
|
@@ -112,6 +117,10 @@
|
|
|
112
117
|
"types": "./dist/ui/dynamic-component/index.d.ts",
|
|
113
118
|
"svelte": "./dist/ui/dynamic-component/index.js"
|
|
114
119
|
},
|
|
120
|
+
"./ui/html-block": {
|
|
121
|
+
"types": "./dist/ui/html-block/index.d.ts",
|
|
122
|
+
"svelte": "./dist/ui/html-block/index.js"
|
|
123
|
+
},
|
|
115
124
|
"./ui/icon": {
|
|
116
125
|
"types": "./dist/ui/icon/index.d.ts",
|
|
117
126
|
"svelte": "./dist/ui/icon/index.js"
|
|
@@ -144,6 +153,10 @@
|
|
|
144
153
|
"types": "./dist/ui/media-playback/index.d.ts",
|
|
145
154
|
"svelte": "./dist/ui/media-playback/index.js"
|
|
146
155
|
},
|
|
156
|
+
"./ui/media-viewer-dialog": {
|
|
157
|
+
"types": "./dist/ui/media-viewer-dialog/index.d.ts",
|
|
158
|
+
"svelte": "./dist/ui/media-viewer-dialog/index.js"
|
|
159
|
+
},
|
|
147
160
|
"./ui/player/buttons": {
|
|
148
161
|
"types": "./dist/ui/player/buttons/index.d.ts",
|
|
149
162
|
"svelte": "./dist/ui/player/buttons/index.js"
|