nuxt-media-library 0.0.52 → 0.0.54

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/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "media-library",
3
3
  "configKey": "mediaLibrary",
4
- "version": "0.0.52",
4
+ "version": "0.0.54",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
@@ -1,33 +1,12 @@
1
1
  <script setup>
2
2
  import { computed, ref, onMounted, watch } from "vue";
3
- import { useMLResourcePolicy } from "../../composables/resourcePolicy/useMLResourcePolicy";
4
3
  import { mediaGrantHeaders } from "../../composables/useMLMediaGrants";
5
4
  const props = defineProps({
6
5
  assetId: { type: String, required: true },
7
6
  manager: { type: Object, required: true }
8
7
  });
9
- const resourcePolicy = useMLResourcePolicy();
10
- const policy = ref(null);
11
- const policyLoading = ref(false);
12
8
  const videoUrl = ref(null);
13
9
  const asset = computed(() => props.manager.selectedAsset.value);
14
- const policyId = computed(
15
- () => asset.value?.resourcePolicyId ?? asset.value?.resource_policy_id ?? null
16
- );
17
- async function loadPolicy() {
18
- if (!policyId.value) {
19
- policy.value = null;
20
- return;
21
- }
22
- policyLoading.value = true;
23
- try {
24
- policy.value = await resourcePolicy.get(policyId.value);
25
- } catch {
26
- policy.value = null;
27
- } finally {
28
- policyLoading.value = false;
29
- }
30
- }
31
10
  async function resolveVideoUrl() {
32
11
  if (!asset.value || asset.value.kind !== "video") {
33
12
  videoUrl.value = null;
@@ -43,17 +22,9 @@ async function resolveVideoUrl() {
43
22
  videoUrl.value = null;
44
23
  }
45
24
  }
46
- onMounted(() => {
47
- loadPolicy();
48
- resolveVideoUrl();
49
- });
50
- watch(policyId, loadPolicy);
25
+ onMounted(resolveVideoUrl);
51
26
  watch(() => props.assetId, resolveVideoUrl);
52
- const showStepper = computed(() => {
53
- if (policyLoading.value) return false;
54
- if (!policy.value) return !policyId.value;
55
- return policy.value.processing_config?.auto_process === false;
56
- });
27
+ const showStepper = computed(() => asset.value?.status === "uploaded");
57
28
  function onComplete() {
58
29
  props.manager.refresh(props.assetId);
59
30
  }
@@ -64,10 +35,8 @@ function onFailed() {
64
35
 
65
36
  <template>
66
37
  <div>
67
- <USkeleton v-if="policyLoading" class="h-40 w-full" />
68
-
69
38
  <MLProcessingStepper
70
- v-else-if="showStepper"
39
+ v-if="showStepper"
71
40
  :asset-id="assetId"
72
41
  :asset-kind="asset?.kind"
73
42
  :download-url="videoUrl"
@@ -39,11 +39,11 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {
39
39
  onFiles?: ((files: File[]) => any) | undefined;
40
40
  onRejected?: ((files: RejectedFile[]) => any) | undefined;
41
41
  }>, {
42
- title: string;
43
42
  variant: "area" | "overlay";
44
43
  compact: boolean;
45
44
  disabled: boolean;
46
45
  multiple: boolean;
46
+ title: string;
47
47
  accept: string;
48
48
  maxSize: number | null;
49
49
  maxFiles: number | null;
@@ -39,11 +39,11 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {
39
39
  onFiles?: ((files: File[]) => any) | undefined;
40
40
  onRejected?: ((files: RejectedFile[]) => any) | undefined;
41
41
  }>, {
42
- title: string;
43
42
  variant: "area" | "overlay";
44
43
  compact: boolean;
45
44
  disabled: boolean;
46
45
  multiple: boolean;
46
+ title: string;
47
47
  accept: string;
48
48
  maxSize: number | null;
49
49
  maxFiles: number | null;
@@ -51,9 +51,10 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
51
51
  "onUpdate:modelValue"?: ((value: string | null) => any) | undefined;
52
52
  "onUpdate:alt"?: ((value: string | undefined) => any) | undefined;
53
53
  }>, {
54
- visibility: "private" | "restricted" | "public";
55
- label: string;
56
54
  disabled: boolean;
55
+ visibility: "private" | "public" | "restricted";
56
+ label: string;
57
+ profile: string | null;
57
58
  accept: readonly string[] | string;
58
59
  maxSize: number | null;
59
60
  required: boolean;
@@ -64,7 +65,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
64
65
  enableTranscription?: boolean;
65
66
  };
66
67
  collectionName: string | null;
67
- profile: string | null;
68
68
  service: string | import("../../index.js").MediaServiceUpload | null;
69
69
  serviceBody: Record<string, unknown> | null;
70
70
  hint: string;
@@ -51,9 +51,10 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
51
51
  "onUpdate:modelValue"?: ((value: string | null) => any) | undefined;
52
52
  "onUpdate:alt"?: ((value: string | undefined) => any) | undefined;
53
53
  }>, {
54
- visibility: "private" | "restricted" | "public";
55
- label: string;
56
54
  disabled: boolean;
55
+ visibility: "private" | "public" | "restricted";
56
+ label: string;
57
+ profile: string | null;
57
58
  accept: readonly string[] | string;
58
59
  maxSize: number | null;
59
60
  required: boolean;
@@ -64,7 +65,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
64
65
  enableTranscription?: boolean;
65
66
  };
66
67
  collectionName: string | null;
67
- profile: string | null;
68
68
  service: string | import("../../index.js").MediaServiceUpload | null;
69
69
  serviceBody: Record<string, unknown> | null;
70
70
  hint: string;
@@ -59,9 +59,10 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
59
59
  "onUpdate:alt"?: ((value: Record<string, string> | undefined) => any) | undefined;
60
60
  "onUpdate:profiles"?: ((profiles: MediaGalleryProfiles) => any) | undefined;
61
61
  }>, {
62
- visibility: "private" | "restricted" | "public";
63
- title: string;
64
62
  disabled: boolean;
63
+ title: string;
64
+ visibility: "private" | "public" | "restricted";
65
+ profile: string | null;
65
66
  accept: readonly string[] | string;
66
67
  max: number | null;
67
68
  maxSize: number | null;
@@ -71,7 +72,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
71
72
  enableTranscription?: boolean;
72
73
  };
73
74
  collectionName: string | null;
74
- profile: string | null;
75
75
  service: string | import("../../index.js").MediaServiceUpload | null;
76
76
  serviceBody: Record<string, unknown> | null;
77
77
  hint: string;
@@ -59,9 +59,10 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
59
59
  "onUpdate:alt"?: ((value: Record<string, string> | undefined) => any) | undefined;
60
60
  "onUpdate:profiles"?: ((profiles: MediaGalleryProfiles) => any) | undefined;
61
61
  }>, {
62
- visibility: "private" | "restricted" | "public";
63
- title: string;
64
62
  disabled: boolean;
63
+ title: string;
64
+ visibility: "private" | "public" | "restricted";
65
+ profile: string | null;
65
66
  accept: readonly string[] | string;
66
67
  max: number | null;
67
68
  maxSize: number | null;
@@ -71,7 +72,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
71
72
  enableTranscription?: boolean;
72
73
  };
73
74
  collectionName: string | null;
74
- profile: string | null;
75
75
  service: string | import("../../index.js").MediaServiceUpload | null;
76
76
  serviceBody: Record<string, unknown> | null;
77
77
  hint: string;
@@ -70,10 +70,11 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
70
70
  "onUpdate:modelValue"?: ((value: string[]) => any) | undefined;
71
71
  "onUpdate:alt"?: ((value: Record<string, string> | undefined) => any) | undefined;
72
72
  }>, {
73
- visibility: "private" | "restricted" | "public";
74
- title: string;
75
73
  disabled: boolean;
76
74
  highlight: ReadonlySet<string> | null;
75
+ title: string;
76
+ visibility: "private" | "public" | "restricted";
77
+ profile: string | null;
77
78
  accept: readonly string[] | string;
78
79
  max: number | null;
79
80
  maxSize: number | null;
@@ -84,7 +85,6 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
84
85
  enableTranscription?: boolean;
85
86
  };
86
87
  collectionName: string | null;
87
- profile: string | null;
88
88
  service: string | import("../../index.js").MediaServiceUpload | null;
89
89
  serviceBody: Record<string, unknown> | null;
90
90
  onAdd: (assetId: string, tag: string | undefined) => void;
@@ -70,10 +70,11 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
70
70
  "onUpdate:modelValue"?: ((value: string[]) => any) | undefined;
71
71
  "onUpdate:alt"?: ((value: Record<string, string> | undefined) => any) | undefined;
72
72
  }>, {
73
- visibility: "private" | "restricted" | "public";
74
- title: string;
75
73
  disabled: boolean;
76
74
  highlight: ReadonlySet<string> | null;
75
+ title: string;
76
+ visibility: "private" | "public" | "restricted";
77
+ profile: string | null;
77
78
  accept: readonly string[] | string;
78
79
  max: number | null;
79
80
  maxSize: number | null;
@@ -84,7 +85,6 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
84
85
  enableTranscription?: boolean;
85
86
  };
86
87
  collectionName: string | null;
87
- profile: string | null;
88
88
  service: string | import("../../index.js").MediaServiceUpload | null;
89
89
  serviceBody: Record<string, unknown> | null;
90
90
  onAdd: (assetId: string, tag: string | undefined) => void;
@@ -40,11 +40,11 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {},
40
40
  asset: AssetDetail | DeliveryAsset | null;
41
41
  src: string | null;
42
42
  progress: number | null;
43
- name: string;
44
- kind: string | null;
45
43
  disabled: boolean;
46
- selected: boolean;
44
+ kind: string | null;
45
+ name: string;
47
46
  phase: ProgressVeilPhase | null;
47
+ selected: boolean;
48
48
  missingAlt: boolean;
49
49
  onOpen: () => void;
50
50
  duration: number | null;
@@ -40,11 +40,11 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {},
40
40
  asset: AssetDetail | DeliveryAsset | null;
41
41
  src: string | null;
42
42
  progress: number | null;
43
- name: string;
44
- kind: string | null;
45
43
  disabled: boolean;
46
- selected: boolean;
44
+ kind: string | null;
45
+ name: string;
47
46
  phase: ProgressVeilPhase | null;
47
+ selected: boolean;
48
48
  missingAlt: boolean;
49
49
  onOpen: () => void;
50
50
  duration: number | null;
@@ -24,9 +24,9 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {},
24
24
  }>, {
25
25
  asset: AssetDetail | DeliveryAsset | null;
26
26
  src: string | null;
27
- name: string;
28
- kind: string | null;
29
27
  disabled: boolean;
28
+ kind: string | null;
29
+ name: string;
30
30
  selected: boolean;
31
31
  meta: string;
32
32
  disabledReason: string;
@@ -24,9 +24,9 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {},
24
24
  }>, {
25
25
  asset: AssetDetail | DeliveryAsset | null;
26
26
  src: string | null;
27
- name: string;
28
- kind: string | null;
29
27
  disabled: boolean;
28
+ kind: string | null;
29
+ name: string;
30
30
  selected: boolean;
31
31
  meta: string;
32
32
  disabledReason: string;
@@ -20,9 +20,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
20
20
  size: string;
21
21
  asset: AssetDetail | DeliveryAsset | null;
22
22
  src: string | null;
23
- name: string;
24
- kind: string | null;
25
23
  disabled: boolean;
24
+ kind: string | null;
25
+ name: string;
26
26
  selected: boolean;
27
27
  date: string;
28
28
  disabledReason: string;
@@ -20,9 +20,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
20
20
  size: string;
21
21
  asset: AssetDetail | DeliveryAsset | null;
22
22
  src: string | null;
23
- name: string;
24
- kind: string | null;
25
23
  disabled: boolean;
24
+ kind: string | null;
25
+ name: string;
26
26
  selected: boolean;
27
27
  date: string;
28
28
  disabledReason: string;
@@ -15,8 +15,8 @@ type __VLS_Props = {
15
15
  };
16
16
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
17
17
  progress: number | null;
18
- label: string;
19
18
  compact: boolean;
19
+ label: string;
20
20
  onCancel: () => void;
21
21
  onRetry: () => void;
22
22
  detail: string;
@@ -15,8 +15,8 @@ type __VLS_Props = {
15
15
  };
16
16
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
17
17
  progress: number | null;
18
- label: string;
19
18
  compact: boolean;
19
+ label: string;
20
20
  onCancel: () => void;
21
21
  onRetry: () => void;
22
22
  detail: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nuxt-media-library",
3
- "version": "0.0.52",
3
+ "version": "0.0.54",
4
4
  "description": "Nuxt module for media library management — chunked uploads, asset previews, and resource policies",
5
5
  "repository": {
6
6
  "type": "git",