@uploadista/vue 0.0.20 → 0.1.0-beta.5

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 (75) hide show
  1. package/dist/components/index.d.mts +2 -2
  2. package/dist/components/index.mjs +1 -1
  3. package/dist/{components-CskPs6sR.css → components-B_L33hsM.css} +33 -33
  4. package/dist/{components-CskPs6sR.css.map → components-B_L33hsM.css.map} +1 -1
  5. package/dist/components-MZ9ETx9c.mjs +2 -0
  6. package/dist/components-MZ9ETx9c.mjs.map +1 -0
  7. package/dist/composables/index.d.mts +1 -1
  8. package/dist/composables/index.mjs +1 -1
  9. package/dist/composables-Dny_9Zrg.mjs +2 -0
  10. package/dist/composables-Dny_9Zrg.mjs.map +1 -0
  11. package/dist/{index-CLOy812P.d.mts → index-6Scxoy1b.d.mts} +412 -408
  12. package/dist/index-6Scxoy1b.d.mts.map +1 -0
  13. package/dist/{index-CDJUpsAf.d.mts → index-BpCRFLJ5.d.mts} +8 -8
  14. package/dist/index-BpCRFLJ5.d.mts.map +1 -0
  15. package/dist/{index-BSlqFF1H.d.mts → index-RY4FPqAk.d.mts} +431 -431
  16. package/dist/index-RY4FPqAk.d.mts.map +1 -0
  17. package/dist/index.d.mts +4 -4
  18. package/dist/index.mjs +1 -1
  19. package/dist/providers/index.d.mts +1 -1
  20. package/dist/providers/index.mjs +1 -1
  21. package/dist/{providers-fqmOwF71.mjs → providers-CjhEBaQV.mjs} +2 -2
  22. package/dist/providers-CjhEBaQV.mjs.map +1 -0
  23. package/dist/useUploadistaClient-WVuo8jYH.mjs.map +1 -1
  24. package/dist/utils/index.d.mts +62 -2
  25. package/dist/utils/index.d.mts.map +1 -0
  26. package/package.json +11 -9
  27. package/src/__tests__/setup.ts +154 -0
  28. package/src/components/FlowUploadList.vue +25 -24
  29. package/src/components/UploadList.vue +3 -6
  30. package/src/components/UploadZone.vue +2 -5
  31. package/src/components/flow/Flow.vue +16 -4
  32. package/src/components/flow/FlowDropZone.vue +4 -2
  33. package/src/components/flow/FlowInput.vue +14 -8
  34. package/src/components/flow/FlowInputDropZone.vue +4 -2
  35. package/src/components/flow/FlowInputPreview.vue +3 -1
  36. package/src/components/flow/FlowProgress.vue +1 -1
  37. package/src/components/flow/FlowStatus.vue +1 -1
  38. package/src/components/flow/useFlowContext.ts +7 -5
  39. package/src/components/index.ts +2 -3
  40. package/src/components/upload/Upload.vue +16 -5
  41. package/src/components/upload/UploadCancel.vue +2 -4
  42. package/src/components/upload/UploadClearCompleted.vue +1 -1
  43. package/src/components/upload/UploadDropZone.vue +7 -7
  44. package/src/components/upload/UploadError.vue +2 -4
  45. package/src/components/upload/UploadItem.vue +8 -6
  46. package/src/components/upload/UploadItems.vue +2 -4
  47. package/src/components/upload/UploadProgress.vue +2 -4
  48. package/src/components/upload/UploadReset.vue +2 -4
  49. package/src/components/upload/UploadRetry.vue +2 -4
  50. package/src/components/upload/UploadStartAll.vue +6 -6
  51. package/src/components/upload/UploadStatus.vue +2 -4
  52. package/src/components/upload/index.ts +21 -25
  53. package/src/composables/eventUtils.test.ts +267 -0
  54. package/src/composables/eventUtils.ts +5 -4
  55. package/src/composables/index.ts +1 -1
  56. package/src/composables/useDragDrop.test.ts +304 -0
  57. package/src/composables/useFlow.ts +6 -2
  58. package/src/composables/useFlowManagerContext.ts +5 -1
  59. package/src/composables/useUploadEvents.ts +1 -4
  60. package/src/composables/useUploadistaClient.test.ts +152 -0
  61. package/src/index.ts +43 -45
  62. package/src/providers/FlowManagerProvider.vue +5 -2
  63. package/src/utils/index.test.ts +396 -0
  64. package/src/utils/is-browser-file.test.ts +45 -0
  65. package/vitest.config.ts +25 -0
  66. package/dist/components-DoBB6sqm.mjs +0 -2
  67. package/dist/components-DoBB6sqm.mjs.map +0 -1
  68. package/dist/composables-BZ2c_WgI.mjs +0 -2
  69. package/dist/composables-BZ2c_WgI.mjs.map +0 -1
  70. package/dist/index-BLNNvTVx.d.mts +0 -62
  71. package/dist/index-BLNNvTVx.d.mts.map +0 -1
  72. package/dist/index-BSlqFF1H.d.mts.map +0 -1
  73. package/dist/index-CDJUpsAf.d.mts.map +0 -1
  74. package/dist/index-CLOy812P.d.mts.map +0 -1
  75. package/dist/providers-fqmOwF71.mjs.map +0 -1
@@ -1,9 +1,17 @@
1
1
  <script setup lang="ts">
2
2
  import type { FlowUploadOptions } from "@uploadista/client-browser";
3
+ import type {
4
+ FlowUploadState,
5
+ FlowUploadStatus,
6
+ InputExecutionState,
7
+ } from "@uploadista/client-core";
3
8
  import type { TypedOutput } from "@uploadista/core/flow";
4
- import { provide, computed, toRefs } from "vue";
5
- import { useFlow, type UseFlowReturn, type FlowInputMetadata } from "../../composables/useFlow";
6
- import type { FlowUploadState, FlowUploadStatus, InputExecutionState } from "@uploadista/client-core";
9
+ import { provide } from "vue";
10
+ import {
11
+ type FlowInputMetadata,
12
+ type UseFlowReturn,
13
+ useFlow,
14
+ } from "../../composables/useFlow";
7
15
 
8
16
  /**
9
17
  * Props for the Flow root component.
@@ -27,7 +35,11 @@ const emit = defineEmits<{
27
35
  /** Called when flow fails */
28
36
  error: [error: Error];
29
37
  /** Called on upload progress */
30
- progress: [uploadId: string, bytesUploaded: number, totalBytes: number | null];
38
+ progress: [
39
+ uploadId: string,
40
+ bytesUploaded: number,
41
+ totalBytes: number | null,
42
+ ];
31
43
  /** Called when flow completes with all outputs */
32
44
  flowComplete: [outputs: TypedOutput[]];
33
45
  /** Called when upload is aborted */
@@ -1,6 +1,6 @@
1
1
  <script setup lang="ts">
2
2
  import { computed, ref } from "vue";
3
- import { useDragDrop, type DragDropState } from "../../composables/useDragDrop";
3
+ import { type DragDropState, useDragDrop } from "../../composables/useDragDrop";
4
4
  import { useFlowContext } from "./useFlowContext";
5
5
 
6
6
  /**
@@ -28,7 +28,9 @@ const dragDrop = useDragDrop({
28
28
  flow.upload(file);
29
29
  }
30
30
  },
31
- accept: props.accept ? props.accept.split(",").map((t) => t.trim()) : undefined,
31
+ accept: props.accept
32
+ ? props.accept.split(",").map((t) => t.trim())
33
+ : undefined,
32
34
  maxFileSize: props.maxFileSize,
33
35
  multiple: false,
34
36
  });
@@ -1,6 +1,10 @@
1
1
  <script setup lang="ts">
2
2
  import { computed, provide } from "vue";
3
- import { useFlowContext, FLOW_INPUT_CONTEXT_KEY, type FlowInputContextValue } from "./useFlowContext";
3
+ import {
4
+ FLOW_INPUT_CONTEXT_KEY,
5
+ type FlowInputContextValue,
6
+ useFlowContext,
7
+ } from "./useFlowContext";
4
8
 
5
9
  /**
6
10
  * Props for FlowInput component.
@@ -15,7 +19,7 @@ const flow = useFlowContext();
15
19
 
16
20
  // Find metadata for this input
17
21
  const metadata = computed(() =>
18
- flow.inputMetadata.value?.find((m) => m.nodeId === props.nodeId)
22
+ flow.inputMetadata.value?.find((m) => m.nodeId === props.nodeId),
19
23
  );
20
24
 
21
25
  // Get current value for this input
@@ -36,12 +40,14 @@ const contextValue: FlowInputContextValue = {
36
40
  return props.nodeId;
37
41
  },
38
42
  get metadata() {
39
- return metadata.value ?? {
40
- nodeId: props.nodeId,
41
- nodeName: "",
42
- nodeDescription: "",
43
- required: false,
44
- };
43
+ return (
44
+ metadata.value ?? {
45
+ nodeId: props.nodeId,
46
+ nodeName: "",
47
+ nodeDescription: "",
48
+ required: false,
49
+ }
50
+ );
45
51
  },
46
52
  get value() {
47
53
  return value.value;
@@ -1,6 +1,6 @@
1
1
  <script setup lang="ts">
2
2
  import { computed, ref } from "vue";
3
- import { useDragDrop, type DragDropState } from "../../composables/useDragDrop";
3
+ import { type DragDropState, useDragDrop } from "../../composables/useDragDrop";
4
4
  import { useFlowInputContext } from "./useFlowContext";
5
5
 
6
6
  // Helper function to check if value is a File (for template use)
@@ -32,7 +32,9 @@ const dragDrop = useDragDrop({
32
32
  input.setValue(file);
33
33
  }
34
34
  },
35
- accept: props.accept ? props.accept.split(",").map((t) => t.trim()) : undefined,
35
+ accept: props.accept
36
+ ? props.accept.split(",").map((t) => t.trim())
37
+ : undefined,
36
38
  maxFileSize: props.maxFileSize,
37
39
  multiple: false,
38
40
  });
@@ -5,7 +5,9 @@ import { useFlowInputContext } from "./useFlowContext";
5
5
  const input = useFlowInputContext();
6
6
 
7
7
  const isFile = computed(() => input.value instanceof File);
8
- const isUrl = computed(() => typeof input.value === "string" && (input.value as string).length > 0);
8
+ const isUrl = computed(
9
+ () => typeof input.value === "string" && (input.value as string).length > 0,
10
+ );
9
11
 
10
12
  const clear = () => {
11
13
  input.setValue(undefined);
@@ -1,6 +1,6 @@
1
1
  <script setup lang="ts">
2
- import { computed } from "vue";
3
2
  import type { FlowUploadStatus } from "@uploadista/client-core";
3
+ import { computed } from "vue";
4
4
  import { useFlowContext } from "./useFlowContext";
5
5
 
6
6
  const flow = useFlowContext();
@@ -1,7 +1,7 @@
1
1
  <script setup lang="ts">
2
- import { computed } from "vue";
3
2
  import type { FlowUploadStatus } from "@uploadista/client-core";
4
3
  import type { TypedOutput } from "@uploadista/core/flow";
4
+ import { computed } from "vue";
5
5
  import { useFlowContext } from "./useFlowContext";
6
6
 
7
7
  const flow = useFlowContext();
@@ -30,11 +30,13 @@ export interface FlowInputContextValue {
30
30
  /** Set the value for this input */
31
31
  setValue: (value: unknown) => void;
32
32
  /** Per-input execution state (if available) */
33
- state: {
34
- status: string;
35
- progress: number;
36
- error: Error | null;
37
- } | undefined;
33
+ state:
34
+ | {
35
+ status: string;
36
+ progress: number;
37
+ error: Error | null;
38
+ }
39
+ | undefined;
38
40
  }
39
41
 
40
42
  /**
@@ -6,11 +6,10 @@
6
6
  */
7
7
 
8
8
  export { default as FlowUploadList } from "./FlowUploadList.vue";
9
- export { default as UploadList } from "./UploadList.vue";
10
- export { default as UploadZone } from "./UploadZone.vue";
11
-
12
9
  // Flow compound components
13
10
  export * from "./flow";
11
+ export { default as UploadList } from "./UploadList.vue";
12
+ export { default as UploadZone } from "./UploadZone.vue";
14
13
 
15
14
  // Upload compound components
16
15
  export * from "./upload";
@@ -1,7 +1,11 @@
1
1
  <script setup lang="ts">
2
2
  import type { UploadFile } from "@uploadista/core/types";
3
- import { provide, computed } from "vue";
4
- import { useMultiUpload, type UploadItem, type MultiUploadState } from "../../composables/useMultiUpload";
3
+ import { computed, provide } from "vue";
4
+ import {
5
+ type MultiUploadState,
6
+ type UploadItem,
7
+ useMultiUpload,
8
+ } from "../../composables/useMultiUpload";
5
9
  import { UPLOAD_CONTEXT_KEY } from "./useUploadContext";
6
10
 
7
11
  /**
@@ -30,11 +34,18 @@ const emit = defineEmits<{
30
34
  /** Called when an upload fails */
31
35
  error: [error: Error, item?: UploadItem];
32
36
  /** Called when all uploads complete (multi mode) */
33
- complete: [results: { successful: UploadItem[]; failed: UploadItem[]; total: number }];
37
+ complete: [
38
+ results: { successful: UploadItem[]; failed: UploadItem[]; total: number },
39
+ ];
34
40
  /** Called when an individual upload starts */
35
41
  uploadStart: [item: UploadItem];
36
42
  /** Called on upload progress */
37
- progress: [item: UploadItem, progress: number, bytesUploaded: number, totalBytes: number | null];
43
+ progress: [
44
+ item: UploadItem,
45
+ progress: number,
46
+ bytesUploaded: number,
47
+ totalBytes: number | null,
48
+ ];
38
49
  }>();
39
50
 
40
51
  const multiUpload = useMultiUpload({
@@ -43,7 +54,7 @@ const multiUpload = useMultiUpload({
43
54
  onUploadStart: (item) => emit("uploadStart", item),
44
55
  onUploadProgress: (item, progress, bytesUploaded, totalBytes) =>
45
56
  emit("progress", item, progress, bytesUploaded, totalBytes),
46
- onUploadSuccess: (item, result) => {
57
+ onUploadSuccess: (_item, result) => {
47
58
  // In single mode, call success directly
48
59
  if (!props.multiple) {
49
60
  emit("success", result);
@@ -1,13 +1,11 @@
1
1
  <script setup lang="ts">
2
2
  import { computed, inject } from "vue";
3
- import { UPLOAD_CONTEXT_KEY } from "./useUploadContext";
4
3
  import type { UploadContextValue } from "./Upload.vue";
4
+ import { UPLOAD_CONTEXT_KEY } from "./useUploadContext";
5
5
 
6
6
  const uploadContext = inject<{ value: UploadContextValue }>(UPLOAD_CONTEXT_KEY);
7
7
  if (!uploadContext) {
8
- throw new Error(
9
- "UploadCancel must be used within an <Upload> component.",
10
- );
8
+ throw new Error("UploadCancel must be used within an <Upload> component.");
11
9
  }
12
10
 
13
11
  const isDisabled = computed(() => !uploadContext.value.state.isUploading);
@@ -1,7 +1,7 @@
1
1
  <script setup lang="ts">
2
2
  import { computed, inject } from "vue";
3
- import { UPLOAD_CONTEXT_KEY } from "./useUploadContext";
4
3
  import type { UploadContextValue } from "./Upload.vue";
4
+ import { UPLOAD_CONTEXT_KEY } from "./useUploadContext";
5
5
 
6
6
  const uploadContext = inject<{ value: UploadContextValue }>(UPLOAD_CONTEXT_KEY);
7
7
  if (!uploadContext) {
@@ -1,8 +1,8 @@
1
1
  <script setup lang="ts">
2
- import { computed, ref, inject } from "vue";
3
- import { useDragDrop, type DragDropState } from "../../composables/useDragDrop";
4
- import { UPLOAD_CONTEXT_KEY } from "./useUploadContext";
2
+ import { computed, inject, ref } from "vue";
3
+ import { type DragDropState, useDragDrop } from "../../composables/useDragDrop";
5
4
  import type { UploadContextValue } from "./Upload.vue";
5
+ import { UPLOAD_CONTEXT_KEY } from "./useUploadContext";
6
6
 
7
7
  /**
8
8
  * Props for UploadDropZone component.
@@ -51,16 +51,16 @@ const props = defineProps<UploadDropZoneProps>();
51
51
 
52
52
  const uploadContext = inject<{ value: UploadContextValue }>(UPLOAD_CONTEXT_KEY);
53
53
  if (!uploadContext) {
54
- throw new Error(
55
- "UploadDropZone must be used within an <Upload> component.",
56
- );
54
+ throw new Error("UploadDropZone must be used within an <Upload> component.");
57
55
  }
58
56
 
59
57
  const inputRef = ref<HTMLInputElement>();
60
58
 
61
59
  const dragDrop = useDragDrop({
62
60
  onFilesReceived: (files) => uploadContext.value.handleFilesReceived(files),
63
- accept: props.accept ? props.accept.split(",").map((t) => t.trim()) : undefined,
61
+ accept: props.accept
62
+ ? props.accept.split(",").map((t) => t.trim())
63
+ : undefined,
64
64
  maxFileSize: props.maxFileSize,
65
65
  maxFiles: uploadContext.value.mode === "multi" ? props.maxFiles : 1,
66
66
  multiple: uploadContext.value.mode === "multi",
@@ -1,8 +1,8 @@
1
1
  <script setup lang="ts">
2
2
  import { computed, inject } from "vue";
3
3
  import type { UploadItem } from "../../composables/useMultiUpload";
4
- import { UPLOAD_CONTEXT_KEY } from "./useUploadContext";
5
4
  import type { UploadContextValue } from "./Upload.vue";
5
+ import { UPLOAD_CONTEXT_KEY } from "./useUploadContext";
6
6
 
7
7
  /**
8
8
  * Slot props for UploadError component.
@@ -20,9 +20,7 @@ export interface UploadErrorSlotProps {
20
20
 
21
21
  const uploadContext = inject<{ value: UploadContextValue }>(UPLOAD_CONTEXT_KEY);
22
22
  if (!uploadContext) {
23
- throw new Error(
24
- "UploadError must be used within an <Upload> component.",
25
- );
23
+ throw new Error("UploadError must be used within an <Upload> component.");
26
24
  }
27
25
 
28
26
  const slotProps = computed<UploadErrorSlotProps>(() => {
@@ -1,7 +1,11 @@
1
1
  <script setup lang="ts">
2
- import { computed, provide, inject } from "vue";
3
- import { UPLOAD_CONTEXT_KEY, UPLOAD_ITEM_CONTEXT_KEY, type UploadItemContextValue } from "./useUploadContext";
2
+ import { computed, inject, provide } from "vue";
4
3
  import type { UploadContextValue } from "./Upload.vue";
4
+ import {
5
+ UPLOAD_CONTEXT_KEY,
6
+ UPLOAD_ITEM_CONTEXT_KEY,
7
+ type UploadItemContextValue,
8
+ } from "./useUploadContext";
5
9
 
6
10
  /**
7
11
  * Props for UploadItem component.
@@ -20,13 +24,11 @@ const props = defineProps<UploadItemProps>();
20
24
 
21
25
  const uploadContext = inject<{ value: UploadContextValue }>(UPLOAD_CONTEXT_KEY);
22
26
  if (!uploadContext) {
23
- throw new Error(
24
- "UploadItem must be used within an <Upload> component.",
25
- );
27
+ throw new Error("UploadItem must be used within an <Upload> component.");
26
28
  }
27
29
 
28
30
  const item = computed(() =>
29
- uploadContext.value.items.find((i) => i.id === props.id)
31
+ uploadContext.value.items.find((i) => i.id === props.id),
30
32
  );
31
33
 
32
34
  const itemContext = computed<UploadItemContextValue | null>(() => {
@@ -1,8 +1,8 @@
1
1
  <script setup lang="ts">
2
2
  import { computed, inject } from "vue";
3
3
  import type { UploadItem } from "../../composables/useMultiUpload";
4
- import { UPLOAD_CONTEXT_KEY } from "./useUploadContext";
5
4
  import type { UploadContextValue } from "./Upload.vue";
5
+ import { UPLOAD_CONTEXT_KEY } from "./useUploadContext";
6
6
 
7
7
  /**
8
8
  * Slot props for UploadItems component.
@@ -18,9 +18,7 @@ export interface UploadItemsSlotProps {
18
18
 
19
19
  const uploadContext = inject<{ value: UploadContextValue }>(UPLOAD_CONTEXT_KEY);
20
20
  if (!uploadContext) {
21
- throw new Error(
22
- "UploadItems must be used within an <Upload> component.",
23
- );
21
+ throw new Error("UploadItems must be used within an <Upload> component.");
24
22
  }
25
23
 
26
24
  const slotProps = computed<UploadItemsSlotProps>(() => ({
@@ -1,7 +1,7 @@
1
1
  <script setup lang="ts">
2
2
  import { computed, inject } from "vue";
3
- import { UPLOAD_CONTEXT_KEY } from "./useUploadContext";
4
3
  import type { UploadContextValue } from "./Upload.vue";
4
+ import { UPLOAD_CONTEXT_KEY } from "./useUploadContext";
5
5
 
6
6
  /**
7
7
  * Slot props for UploadProgress component.
@@ -19,9 +19,7 @@ export interface UploadProgressSlotProps {
19
19
 
20
20
  const uploadContext = inject<{ value: UploadContextValue }>(UPLOAD_CONTEXT_KEY);
21
21
  if (!uploadContext) {
22
- throw new Error(
23
- "UploadProgress must be used within an <Upload> component.",
24
- );
22
+ throw new Error("UploadProgress must be used within an <Upload> component.");
25
23
  }
26
24
 
27
25
  const slotProps = computed<UploadProgressSlotProps>(() => ({
@@ -1,13 +1,11 @@
1
1
  <script setup lang="ts">
2
2
  import { inject } from "vue";
3
- import { UPLOAD_CONTEXT_KEY } from "./useUploadContext";
4
3
  import type { UploadContextValue } from "./Upload.vue";
4
+ import { UPLOAD_CONTEXT_KEY } from "./useUploadContext";
5
5
 
6
6
  const uploadContext = inject<{ value: UploadContextValue }>(UPLOAD_CONTEXT_KEY);
7
7
  if (!uploadContext) {
8
- throw new Error(
9
- "UploadReset must be used within an <Upload> component.",
10
- );
8
+ throw new Error("UploadReset must be used within an <Upload> component.");
11
9
  }
12
10
 
13
11
  const handleClick = () => {
@@ -1,13 +1,11 @@
1
1
  <script setup lang="ts">
2
2
  import { computed, inject } from "vue";
3
- import { UPLOAD_CONTEXT_KEY } from "./useUploadContext";
4
3
  import type { UploadContextValue } from "./Upload.vue";
4
+ import { UPLOAD_CONTEXT_KEY } from "./useUploadContext";
5
5
 
6
6
  const uploadContext = inject<{ value: UploadContextValue }>(UPLOAD_CONTEXT_KEY);
7
7
  if (!uploadContext) {
8
- throw new Error(
9
- "UploadRetry must be used within an <Upload> component.",
10
- );
8
+ throw new Error("UploadRetry must be used within an <Upload> component.");
11
9
  }
12
10
 
13
11
  const isDisabled = computed(() => uploadContext.value.state.failed === 0);
@@ -1,17 +1,17 @@
1
1
  <script setup lang="ts">
2
2
  import { computed, inject } from "vue";
3
- import { UPLOAD_CONTEXT_KEY } from "./useUploadContext";
4
3
  import type { UploadContextValue } from "./Upload.vue";
4
+ import { UPLOAD_CONTEXT_KEY } from "./useUploadContext";
5
5
 
6
6
  const uploadContext = inject<{ value: UploadContextValue }>(UPLOAD_CONTEXT_KEY);
7
7
  if (!uploadContext) {
8
- throw new Error(
9
- "UploadStartAll must be used within an <Upload> component.",
10
- );
8
+ throw new Error("UploadStartAll must be used within an <Upload> component.");
11
9
  }
12
10
 
13
- const idleCount = computed(() =>
14
- uploadContext.value.items.filter((item) => item.state.status === "idle").length,
11
+ const idleCount = computed(
12
+ () =>
13
+ uploadContext.value.items.filter((item) => item.state.status === "idle")
14
+ .length,
15
15
  );
16
16
 
17
17
  const isDisabled = computed(
@@ -1,7 +1,7 @@
1
1
  <script setup lang="ts">
2
2
  import { computed, inject } from "vue";
3
- import { UPLOAD_CONTEXT_KEY } from "./useUploadContext";
4
3
  import type { UploadContextValue } from "./Upload.vue";
4
+ import { UPLOAD_CONTEXT_KEY } from "./useUploadContext";
5
5
 
6
6
  /**
7
7
  * Slot props for UploadStatus component.
@@ -31,9 +31,7 @@ export interface UploadStatusSlotProps {
31
31
 
32
32
  const uploadContext = inject<{ value: UploadContextValue }>(UPLOAD_CONTEXT_KEY);
33
33
  if (!uploadContext) {
34
- throw new Error(
35
- "UploadStatus must be used within an <Upload> component.",
36
- );
34
+ throw new Error("UploadStatus must be used within an <Upload> component.");
37
35
  }
38
36
 
39
37
  const slotProps = computed<UploadStatusSlotProps>(() => {
@@ -57,46 +57,42 @@
57
57
  * ```
58
58
  */
59
59
 
60
+ export type { UploadContextValue, UploadProps } from "./Upload.vue";
60
61
  // Root component
61
62
  export { default as Upload } from "./Upload.vue";
62
- export type { UploadProps, UploadContextValue } from "./Upload.vue";
63
-
63
+ // Action components
64
+ export { default as UploadCancel } from "./UploadCancel.vue";
65
+ export { default as UploadClearCompleted } from "./UploadClearCompleted.vue";
66
+ export type {
67
+ UploadDropZoneProps,
68
+ UploadDropZoneSlotProps,
69
+ } from "./UploadDropZone.vue";
64
70
  // Drop zone
65
71
  export { default as UploadDropZone } from "./UploadDropZone.vue";
66
- export type { UploadDropZoneProps, UploadDropZoneSlotProps } from "./UploadDropZone.vue";
67
-
68
- // Items
69
- export { default as UploadItems } from "./UploadItems.vue";
70
- export type { UploadItemsSlotProps } from "./UploadItems.vue";
71
-
72
+ export type { UploadErrorSlotProps } from "./UploadError.vue";
73
+ // Error
74
+ export { default as UploadError } from "./UploadError.vue";
75
+ export type { UploadItemProps, UploadItemSlotProps } from "./UploadItem.vue";
72
76
  // Item
73
77
  export { default as UploadItem } from "./UploadItem.vue";
74
- export type { UploadItemProps, UploadItemSlotProps } from "./UploadItem.vue";
75
-
78
+ export type { UploadItemsSlotProps } from "./UploadItems.vue";
79
+ // Items
80
+ export { default as UploadItems } from "./UploadItems.vue";
81
+ export type { UploadProgressSlotProps } from "./UploadProgress.vue";
76
82
  // Progress
77
83
  export { default as UploadProgress } from "./UploadProgress.vue";
78
- export type { UploadProgressSlotProps } from "./UploadProgress.vue";
79
-
80
- // Status
81
- export { default as UploadStatus } from "./UploadStatus.vue";
82
- export type { UploadStatusSlotProps } from "./UploadStatus.vue";
83
-
84
- // Error
85
- export { default as UploadError } from "./UploadError.vue";
86
- export type { UploadErrorSlotProps } from "./UploadError.vue";
87
-
88
- // Action components
89
- export { default as UploadCancel } from "./UploadCancel.vue";
90
- export { default as UploadRetry } from "./UploadRetry.vue";
91
84
  export { default as UploadReset } from "./UploadReset.vue";
85
+ export { default as UploadRetry } from "./UploadRetry.vue";
92
86
  export { default as UploadStartAll } from "./UploadStartAll.vue";
93
- export { default as UploadClearCompleted } from "./UploadClearCompleted.vue";
87
+ export type { UploadStatusSlotProps } from "./UploadStatus.vue";
88
+ // Status
89
+ export { default as UploadStatus } from "./UploadStatus.vue";
94
90
 
95
91
  // Context hooks
96
92
  export {
97
93
  UPLOAD_CONTEXT_KEY,
98
94
  UPLOAD_ITEM_CONTEXT_KEY,
95
+ type UploadItemContextValue,
99
96
  useUploadContext,
100
97
  useUploadItemContext,
101
- type UploadItemContextValue,
102
98
  } from "./useUploadContext";