@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.
Files changed (38) hide show
  1. package/dist/core/files/app-upload-activity.svelte.d.ts +20 -0
  2. package/dist/core/files/app-upload-activity.svelte.js +34 -0
  3. package/dist/core/files/file-types.d.ts +7 -0
  4. package/dist/core/files/file-types.js +8 -0
  5. package/dist/core/files/file-validation-rules.d.ts +1 -0
  6. package/dist/core/files/file-validation-rules.js +32 -38
  7. package/dist/core/files/index.d.ts +4 -3
  8. package/dist/core/files/index.js +2 -1
  9. package/dist/core/files/upload-media-store.svelte.d.ts +39 -9
  10. package/dist/core/files/upload-media-store.svelte.js +71 -14
  11. package/dist/core/files/upload-types.d.ts +16 -0
  12. package/dist/core/media/index.d.ts +2 -0
  13. package/dist/core/media/index.js +1 -0
  14. package/dist/core/media/video-probe.d.ts +28 -0
  15. package/dist/core/media/video-probe.js +82 -0
  16. package/dist/ui/file-uploader/cmp.file-row.svelte +19 -15
  17. package/dist/ui/file-uploader/cmp.file-row.svelte.d.ts +9 -8
  18. package/dist/ui/file-uploader/cmp.file-upload-progress.svelte +10 -31
  19. package/dist/ui/file-uploader/cmp.file-upload-progress.svelte.d.ts +2 -3
  20. package/dist/ui/file-uploader/cmp.upload-progress-toaster.svelte +132 -0
  21. package/dist/ui/file-uploader/cmp.upload-progress-toaster.svelte.d.ts +27 -0
  22. package/dist/ui/file-uploader/file-type-colors.d.ts +5 -0
  23. package/dist/ui/file-uploader/file-type-colors.js +11 -1
  24. package/dist/ui/file-uploader/file-type-stamp.svelte +71 -0
  25. package/dist/ui/file-uploader/file-type-stamp.svelte.d.ts +8 -0
  26. package/dist/ui/file-uploader/index.d.ts +3 -1
  27. package/dist/ui/file-uploader/index.js +2 -1
  28. package/dist/ui/file-uploader/types.d.ts +16 -0
  29. package/dist/ui/file-uploader/types.js +1 -0
  30. package/dist/ui/file-uploader/upload-progress-toaster-localization.d.ts +4 -0
  31. package/dist/ui/file-uploader/upload-progress-toaster-localization.js +23 -0
  32. package/dist/ui/navigation/cmp.nav-menu-item.svelte +6 -7
  33. package/dist/ui/navigation/cmp.nav-menu-item.svelte.d.ts +4 -3
  34. package/dist/ui/navigation/cmp.nav-rail-item.svelte +7 -8
  35. package/dist/ui/navigation/cmp.nav-rail-item.svelte.d.ts +5 -4
  36. package/package.json +1 -1
  37. package/dist/ui/file-uploader/to-uploading-file.d.ts +0 -9
  38. 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
- aria-disabled={disabled || undefined}
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. Active state is consumer-controlled (`active` prop). The icon accepts an SVG
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>`. Mutually exclusive with `on.click`. */
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. Active state is consumer-controlled (`active` prop). The icon accepts an SVG
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,6 +1,6 @@
1
1
  {
2
2
  "name": "@streamscloud/kit",
3
- "version": "0.29.1",
3
+ "version": "0.31.0",
4
4
  "author": "StreamsCloud",
5
5
  "repository": {
6
6
  "type": "git",
@@ -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
- };