@streamscloud/kit 0.29.1 → 0.31.0
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/files/app-upload-activity.svelte.d.ts +20 -0
- package/dist/core/files/app-upload-activity.svelte.js +34 -0
- package/dist/core/files/file-types.d.ts +7 -0
- package/dist/core/files/file-types.js +8 -0
- package/dist/core/files/file-validation-rules.d.ts +1 -0
- package/dist/core/files/file-validation-rules.js +32 -38
- package/dist/core/files/index.d.ts +4 -3
- package/dist/core/files/index.js +2 -1
- package/dist/core/files/upload-media-store.svelte.d.ts +39 -9
- package/dist/core/files/upload-media-store.svelte.js +71 -14
- package/dist/core/files/upload-types.d.ts +16 -0
- package/dist/core/media/index.d.ts +2 -0
- package/dist/core/media/index.js +1 -0
- package/dist/core/media/video-probe.d.ts +28 -0
- package/dist/core/media/video-probe.js +82 -0
- package/dist/ui/file-uploader/cmp.file-row.svelte +19 -15
- package/dist/ui/file-uploader/cmp.file-row.svelte.d.ts +9 -8
- package/dist/ui/file-uploader/cmp.file-upload-progress.svelte +10 -31
- package/dist/ui/file-uploader/cmp.file-upload-progress.svelte.d.ts +2 -3
- package/dist/ui/file-uploader/cmp.upload-progress-toaster.svelte +132 -0
- package/dist/ui/file-uploader/cmp.upload-progress-toaster.svelte.d.ts +27 -0
- package/dist/ui/file-uploader/file-type-colors.d.ts +5 -0
- package/dist/ui/file-uploader/file-type-colors.js +11 -1
- package/dist/ui/file-uploader/file-type-stamp.svelte +71 -0
- package/dist/ui/file-uploader/file-type-stamp.svelte.d.ts +8 -0
- package/dist/ui/file-uploader/index.d.ts +3 -1
- package/dist/ui/file-uploader/index.js +2 -1
- package/dist/ui/file-uploader/types.d.ts +16 -0
- package/dist/ui/file-uploader/types.js +1 -0
- package/dist/ui/file-uploader/upload-progress-toaster-localization.d.ts +4 -0
- package/dist/ui/file-uploader/upload-progress-toaster-localization.js +23 -0
- package/dist/ui/navigation/cmp.nav-menu-item.svelte +6 -7
- package/dist/ui/navigation/cmp.nav-menu-item.svelte.d.ts +4 -3
- package/dist/ui/navigation/cmp.nav-rail-item.svelte +7 -8
- package/dist/ui/navigation/cmp.nav-rail-item.svelte.d.ts +5 -4
- package/package.json +1 -1
- package/dist/ui/file-uploader/to-uploading-file.d.ts +0 -9
- package/dist/ui/file-uploader/to-uploading-file.js +0 -24
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<script lang="ts">import { IconSlot } from '../icon';
|
|
2
2
|
const { label, icon, href, active = false, error = false, disabled = false, target, rel, on } = $props();
|
|
3
|
-
const handleClick = () => {
|
|
3
|
+
const handleClick = (event) => {
|
|
4
4
|
if (disabled) {
|
|
5
5
|
return;
|
|
6
6
|
}
|
|
7
|
-
on?.click?.();
|
|
7
|
+
on?.click?.(event);
|
|
8
8
|
};
|
|
9
9
|
</script>
|
|
10
10
|
|
|
@@ -13,18 +13,16 @@ const handleClick = () => {
|
|
|
13
13
|
<span class="nav-rail-item__label">{label}</span>
|
|
14
14
|
{/snippet}
|
|
15
15
|
|
|
16
|
-
{#if href}
|
|
16
|
+
{#if href && !disabled}
|
|
17
17
|
<a
|
|
18
18
|
class="nav-rail-item"
|
|
19
19
|
class:nav-rail-item--active={active}
|
|
20
20
|
class:nav-rail-item--error={error}
|
|
21
|
-
class:nav-rail-item--disabled={disabled}
|
|
22
21
|
href={href}
|
|
23
22
|
target={target}
|
|
24
23
|
rel={rel}
|
|
25
24
|
aria-current={active ? 'page' : undefined}
|
|
26
|
-
|
|
27
|
-
tabindex={disabled ? -1 : undefined}>
|
|
25
|
+
onclick={handleClick}>
|
|
28
26
|
{@render tile()}
|
|
29
27
|
</a>
|
|
30
28
|
{:else}
|
|
@@ -43,8 +41,9 @@ const handleClick = () => {
|
|
|
43
41
|
|
|
44
42
|
<!--
|
|
45
43
|
@component
|
|
46
|
-
NavRailItem — one icon-and-label tile inside a `NavRail`. Renders as `<a>` when `href` is set
|
|
47
|
-
`<button>` otherwise.
|
|
44
|
+
NavRailItem — one icon-and-label tile inside a `NavRail`. Renders as `<a>` when `href` is set and
|
|
45
|
+
enabled, `<button>` otherwise; `on.click` fires in both forms with the `MouseEvent` and the link
|
|
46
|
+
default is left intact. Active state is consumer-controlled (`active` prop). The icon accepts an SVG
|
|
48
47
|
source string or a snippet. Tile dimensions are controlled via the `--sc-kit--nav-rail--item-*`
|
|
49
48
|
CSS variables (settable on the parent rail or any ancestor).
|
|
50
49
|
|
|
@@ -3,7 +3,7 @@ type Props = {
|
|
|
3
3
|
label: string;
|
|
4
4
|
/** Icon — string SVG source, `{ src, color?, size? }` object, or custom snippet. */
|
|
5
5
|
icon: IconProp;
|
|
6
|
-
/** Render as `<a href
|
|
6
|
+
/** Render as `<a href>` — unless `disabled`, which falls back to the button form. `on.click` still fires; `event.preventDefault()` keeps the click from navigating. */
|
|
7
7
|
href?: string;
|
|
8
8
|
/** Highlight as the current section. Consumer-controlled. @default false */
|
|
9
9
|
active?: boolean;
|
|
@@ -15,12 +15,13 @@ type Props = {
|
|
|
15
15
|
/** Anchor rel — only relevant when `href` is set. */
|
|
16
16
|
rel?: string;
|
|
17
17
|
on?: {
|
|
18
|
-
click?: () => void;
|
|
18
|
+
click?: (event: MouseEvent) => void;
|
|
19
19
|
};
|
|
20
20
|
};
|
|
21
21
|
/**
|
|
22
|
-
* NavRailItem — one icon-and-label tile inside a `NavRail`. Renders as `<a>` when `href` is set
|
|
23
|
-
* `<button>` otherwise.
|
|
22
|
+
* NavRailItem — one icon-and-label tile inside a `NavRail`. Renders as `<a>` when `href` is set and
|
|
23
|
+
* enabled, `<button>` otherwise; `on.click` fires in both forms with the `MouseEvent` and the link
|
|
24
|
+
* default is left intact. Active state is consumer-controlled (`active` prop). The icon accepts an SVG
|
|
24
25
|
* source string or a snippet. Tile dimensions are controlled via the `--sc-kit--nav-rail--item-*`
|
|
25
26
|
* CSS variables (settable on the parent rail or any ancestor).
|
|
26
27
|
*
|
package/package.json
CHANGED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { UploadingFile, UploadingFileStatus } from '../../core/files';
|
|
2
|
-
/**
|
|
3
|
-
* Wrap a raw `File` into an `UploadingFile` for ad-hoc rendering with `FileRow` /
|
|
4
|
-
* `FileUploadProgress` (e.g. static read-only file lists, mocks in stories). Defaults to
|
|
5
|
-
* `status: 'success'` and `progress: 1` — i.e. "already complete, just show me". The display
|
|
6
|
-
* components read only `file` / `progress` / `status` / `error`, so the `success` variant's
|
|
7
|
-
* `blobId` / `readUrl` are empty placeholders here — this shim has no backing blob.
|
|
8
|
-
*/
|
|
9
|
-
export declare const toUploadingFile: (file: File, status?: UploadingFileStatus) => UploadingFile;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { Utils } from '../../core/utils';
|
|
2
|
-
import { nanoid } from 'nanoid';
|
|
3
|
-
/**
|
|
4
|
-
* Wrap a raw `File` into an `UploadingFile` for ad-hoc rendering with `FileRow` /
|
|
5
|
-
* `FileUploadProgress` (e.g. static read-only file lists, mocks in stories). Defaults to
|
|
6
|
-
* `status: 'success'` and `progress: 1` — i.e. "already complete, just show me". The display
|
|
7
|
-
* components read only `file` / `progress` / `status` / `error`, so the `success` variant's
|
|
8
|
-
* `blobId` / `readUrl` are empty placeholders here — this shim has no backing blob.
|
|
9
|
-
*/
|
|
10
|
-
export const toUploadingFile = (file, status = 'success') => {
|
|
11
|
-
const base = { id: nanoid(), file };
|
|
12
|
-
switch (status) {
|
|
13
|
-
case 'queued':
|
|
14
|
-
return { ...base, progress: 0, status };
|
|
15
|
-
case 'uploading':
|
|
16
|
-
return { ...base, progress: 0, status };
|
|
17
|
-
case 'success':
|
|
18
|
-
return { ...base, progress: 1, status, blobId: '', readUrl: '' };
|
|
19
|
-
case 'error':
|
|
20
|
-
return { ...base, progress: 0, status, error: '' };
|
|
21
|
-
default:
|
|
22
|
-
return Utils.assertUnreachable(status);
|
|
23
|
-
}
|
|
24
|
-
};
|