nuxt-ui-elements 0.1.27 → 0.1.29

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": "nuxt-ui-elements",
3
3
  "configKey": "uiElements",
4
- "version": "0.1.27",
4
+ "version": "0.1.29",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
@@ -1,142 +1,146 @@
1
1
  import type { UploaderEvents, UploadFile, UploadOptions, UploadStatus, UploadFn, GetRemoteFileFn, Plugin as UploaderPlugin } from "./types.js";
2
2
  export declare const useUploadManager: <TUploadResult = any>(_options?: UploadOptions) => {
3
- files: import("vue").Ref<{
4
- id: string;
5
- name: string;
6
- size: number;
7
- mimeType: string;
8
- data: {
3
+ files: Readonly<import("vue").Ref<readonly {
4
+ readonly id: string;
5
+ readonly name: string;
6
+ readonly size: number;
7
+ readonly mimeType: string;
8
+ readonly data: {
9
9
  readonly lastModified: number;
10
10
  readonly name: string;
11
11
  readonly webkitRelativePath: string;
12
12
  readonly size: number;
13
13
  readonly type: string;
14
- arrayBuffer: {
14
+ readonly arrayBuffer: {
15
15
  (): Promise<ArrayBuffer>;
16
16
  (): Promise<ArrayBuffer>;
17
17
  };
18
- bytes: {
18
+ readonly bytes: {
19
19
  (): Promise<Uint8Array<ArrayBuffer>>;
20
20
  (): Promise<Uint8Array<ArrayBuffer>>;
21
21
  };
22
- slice: {
22
+ readonly slice: {
23
23
  (start?: number, end?: number, contentType?: string): Blob;
24
24
  (start?: number, end?: number, contentType?: string): Blob;
25
25
  };
26
- stream: {
26
+ readonly stream: {
27
27
  (): ReadableStream<Uint8Array<ArrayBuffer>>;
28
28
  (): ReadableStream<Uint8Array<ArrayBuffer>>;
29
29
  };
30
- text: {
30
+ readonly text: {
31
31
  (): Promise<string>;
32
32
  (): Promise<string>;
33
33
  };
34
34
  } | {
35
35
  readonly size: number;
36
36
  readonly type: string;
37
- arrayBuffer: {
37
+ readonly arrayBuffer: {
38
38
  (): Promise<ArrayBuffer>;
39
39
  (): Promise<ArrayBuffer>;
40
40
  };
41
- bytes: {
41
+ readonly bytes: {
42
42
  (): Promise<Uint8Array<ArrayBuffer>>;
43
43
  (): Promise<Uint8Array<ArrayBuffer>>;
44
44
  };
45
- slice: {
45
+ readonly slice: {
46
46
  (start?: number, end?: number, contentType?: string): Blob;
47
47
  (start?: number, end?: number, contentType?: string): Blob;
48
48
  };
49
- stream: {
49
+ readonly stream: {
50
50
  (): ReadableStream<Uint8Array<ArrayBuffer>>;
51
51
  (): ReadableStream<Uint8Array<ArrayBuffer>>;
52
52
  };
53
- text: {
53
+ readonly text: {
54
54
  (): Promise<string>;
55
55
  (): Promise<string>;
56
56
  };
57
57
  };
58
- status: import("./types.js").FileStatus;
59
- preview?: string | undefined;
60
- progress: {
61
- percentage: number;
58
+ readonly status: import("./types.js").FileStatus;
59
+ readonly preview?: string | undefined;
60
+ readonly progress: {
61
+ readonly percentage: number;
62
62
  };
63
- error?: {
64
- message: string;
65
- details?: unknown;
63
+ readonly error?: {
64
+ readonly message: string;
65
+ readonly details?: Readonly<unknown> | undefined;
66
66
  } | undefined;
67
- uploadResult?: import("vue").UnwrapRef<TUploadResult> | undefined;
68
- isRemote?: boolean | undefined;
69
- remoteUrl?: string | undefined;
70
- meta: Record<string, unknown>;
71
- }[], UploadFile<TUploadResult>[] | {
72
- id: string;
73
- name: string;
74
- size: number;
75
- mimeType: string;
76
- data: {
67
+ readonly uploadResult?: import("vue").DeepReadonly<import("vue").UnwrapRef<TUploadResult>> | undefined;
68
+ readonly isRemote?: boolean | undefined;
69
+ readonly remoteUrl?: string | undefined;
70
+ readonly meta: {
71
+ readonly [x: string]: Readonly<unknown>;
72
+ };
73
+ }[], readonly {
74
+ readonly id: string;
75
+ readonly name: string;
76
+ readonly size: number;
77
+ readonly mimeType: string;
78
+ readonly data: {
77
79
  readonly lastModified: number;
78
80
  readonly name: string;
79
81
  readonly webkitRelativePath: string;
80
82
  readonly size: number;
81
83
  readonly type: string;
82
- arrayBuffer: {
84
+ readonly arrayBuffer: {
83
85
  (): Promise<ArrayBuffer>;
84
86
  (): Promise<ArrayBuffer>;
85
87
  };
86
- bytes: {
88
+ readonly bytes: {
87
89
  (): Promise<Uint8Array<ArrayBuffer>>;
88
90
  (): Promise<Uint8Array<ArrayBuffer>>;
89
91
  };
90
- slice: {
92
+ readonly slice: {
91
93
  (start?: number, end?: number, contentType?: string): Blob;
92
94
  (start?: number, end?: number, contentType?: string): Blob;
93
95
  };
94
- stream: {
96
+ readonly stream: {
95
97
  (): ReadableStream<Uint8Array<ArrayBuffer>>;
96
98
  (): ReadableStream<Uint8Array<ArrayBuffer>>;
97
99
  };
98
- text: {
100
+ readonly text: {
99
101
  (): Promise<string>;
100
102
  (): Promise<string>;
101
103
  };
102
104
  } | {
103
105
  readonly size: number;
104
106
  readonly type: string;
105
- arrayBuffer: {
107
+ readonly arrayBuffer: {
106
108
  (): Promise<ArrayBuffer>;
107
109
  (): Promise<ArrayBuffer>;
108
110
  };
109
- bytes: {
111
+ readonly bytes: {
110
112
  (): Promise<Uint8Array<ArrayBuffer>>;
111
113
  (): Promise<Uint8Array<ArrayBuffer>>;
112
114
  };
113
- slice: {
115
+ readonly slice: {
114
116
  (start?: number, end?: number, contentType?: string): Blob;
115
117
  (start?: number, end?: number, contentType?: string): Blob;
116
118
  };
117
- stream: {
119
+ readonly stream: {
118
120
  (): ReadableStream<Uint8Array<ArrayBuffer>>;
119
121
  (): ReadableStream<Uint8Array<ArrayBuffer>>;
120
122
  };
121
- text: {
123
+ readonly text: {
122
124
  (): Promise<string>;
123
125
  (): Promise<string>;
124
126
  };
125
127
  };
126
- status: import("./types.js").FileStatus;
127
- preview?: string | undefined;
128
- progress: {
129
- percentage: number;
128
+ readonly status: import("./types.js").FileStatus;
129
+ readonly preview?: string | undefined;
130
+ readonly progress: {
131
+ readonly percentage: number;
130
132
  };
131
- error?: {
132
- message: string;
133
- details?: unknown;
133
+ readonly error?: {
134
+ readonly message: string;
135
+ readonly details?: Readonly<unknown> | undefined;
134
136
  } | undefined;
135
- uploadResult?: import("vue").UnwrapRef<TUploadResult> | undefined;
136
- isRemote?: boolean | undefined;
137
- remoteUrl?: string | undefined;
138
- meta: Record<string, unknown>;
139
- }[]>;
137
+ readonly uploadResult?: import("vue").DeepReadonly<import("vue").UnwrapRef<TUploadResult>> | undefined;
138
+ readonly isRemote?: boolean | undefined;
139
+ readonly remoteUrl?: string | undefined;
140
+ readonly meta: {
141
+ readonly [x: string]: Readonly<unknown>;
142
+ };
143
+ }[]>>;
140
144
  totalProgress: import("vue").ComputedRef<number>;
141
145
  addFiles: (newFiles: File[]) => Promise<(UploadFile<any> | null)[]>;
142
146
  addFile: (file: File) => Promise<UploadFile<any> | null>;
@@ -1,5 +1,5 @@
1
1
  import mitt from "mitt";
2
- import { computed, ref } from "vue";
2
+ import { computed, readonly, ref } from "vue";
3
3
  import { ValidatorAllowedFileTypes, ValidatorMaxfileSize, ValidatorMaxFiles } from "./validators/index.js";
4
4
  import { PluginThumbnailGenerator, PluginImageCompressor } from "./plugins/index.js";
5
5
  function getExtension(fullFileName) {
@@ -344,7 +344,7 @@ The LAST storage plugin ("${plugin.id}") will be used for uploads.
344
344
  }
345
345
  return {
346
346
  // State
347
- files,
347
+ files: readonly(files),
348
348
  totalProgress,
349
349
  // Core Methods
350
350
  addFiles,
@@ -1,4 +1,4 @@
1
- type PathHttpHeaders = import("@azure/storage-file-datalake").PathHttpHeaders;
1
+ import { type PathHttpHeaders } from "@azure/storage-file-datalake";
2
2
  export interface AzureDataLakeOptions {
3
3
  /**
4
4
  * Static SAS URL for Azure Data Lake Storage
@@ -42,4 +42,3 @@ export interface AzureUploadResult {
42
42
  blobPath: string;
43
43
  }
44
44
  export declare const PluginAzureDataLake: (options: AzureDataLakeOptions) => import("../../types.js").Plugin<any, Record<string, never>>;
45
- export {};
@@ -1,7 +1,7 @@
1
1
  import { ref } from "vue";
2
+ import { DataLakeDirectoryClient } from "@azure/storage-file-datalake";
2
3
  import { defineUploaderPlugin } from "../../types.js";
3
4
  export const PluginAzureDataLake = defineUploaderPlugin((options) => {
4
- let DataLakeDirectoryClient;
5
5
  const sasURL = ref(options.sasURL || "");
6
6
  let refreshPromise = null;
7
7
  const directoryCheckedCache = /* @__PURE__ */ new Set();
@@ -24,10 +24,6 @@ export const PluginAzureDataLake = defineUploaderPlugin((options) => {
24
24
  }
25
25
  };
26
26
  const getFileClient = async (blobName) => {
27
- if (!DataLakeDirectoryClient) {
28
- const module = await import("@azure/storage-file-datalake");
29
- DataLakeDirectoryClient = module.DataLakeDirectoryClient;
30
- }
31
27
  if (options.getSASUrl && isTokenExpired(sasURL.value)) {
32
28
  if (!refreshPromise) {
33
29
  refreshPromise = options.getSASUrl().then((url) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nuxt-ui-elements",
3
- "version": "0.1.27",
3
+ "version": "0.1.29",
4
4
  "description": "A collection of beautiful, animated UI components for Nuxt applications",
5
5
  "license": "MIT",
6
6
  "repository": "https://github.com/genu/nuxt-ui-elements.git",
@@ -42,7 +42,7 @@
42
42
  "@nuxt/test-utils": "^3.23.0",
43
43
  "@types/culori": "^4.0.1",
44
44
  "@types/node": "latest",
45
- "@vitest/coverage-v8": "^4.0.16",
45
+ "@vitest/coverage-v8": "^4.0.17",
46
46
  "changelogen": "^0.6.2",
47
47
  "eslint": "^9.39.2",
48
48
  "eslint-config-prettier": "10.1.8",
@@ -50,7 +50,7 @@
50
50
  "nuxt": "^4.2.2",
51
51
  "prettier": "^3.7.4",
52
52
  "typescript": "~5.9.3",
53
- "vitest": "^4.0.16",
53
+ "vitest": "^4.0.17",
54
54
  "vue-tsc": "^3.2.2"
55
55
  },
56
56
  "peerDependencies": {