@startupjs-ui/file-input 0.1.3 → 0.1.4
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/CHANGELOG.md +11 -0
- package/files.plugin.js +3 -3
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [0.1.4](https://github.com/startupjs/startupjs-ui/compare/v0.1.3...v0.1.4) (2025-12-29)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **file-input:** fix wrong regexps ([4d9c020](https://github.com/startupjs/startupjs-ui/commit/4d9c020621e67ec6caed8e4a2d1621028fd34a66))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
## [0.1.3](https://github.com/startupjs/startupjs-ui/compare/v0.1.2...v0.1.3) (2025-12-29)
|
|
7
18
|
|
|
8
19
|
**Note:** Version bump only for package @startupjs-ui/file-input
|
package/files.plugin.js
CHANGED
|
@@ -34,7 +34,7 @@ export default createPlugin({
|
|
|
34
34
|
const isVideoRequest = req.url.includes('.mp4') || req.url.includes('.mov') || req.url.includes('.avi')
|
|
35
35
|
// if id has extension, remove it
|
|
36
36
|
// (extension is sometimes added for client libraries to properly handle the file)
|
|
37
|
-
fileId = fileId.replace(
|
|
37
|
+
fileId = fileId.replace(/\.[^.]+$/, '')
|
|
38
38
|
// url might have ?download=true which means we should force download
|
|
39
39
|
const download = (req.query?.download != null)
|
|
40
40
|
const $file = await sub($.files[fileId])
|
|
@@ -209,7 +209,7 @@ export default createPlugin({
|
|
|
209
209
|
})
|
|
210
210
|
.toFormat('jpeg', { quality: 80 })) // Convert to JPEG with 85% quality
|
|
211
211
|
|
|
212
|
-
filename = filename.replace(
|
|
212
|
+
filename = filename.replace(/\.[^.]+$/, '.jpg') // Change extension to .jpg
|
|
213
213
|
mimeType = 'image/jpeg'
|
|
214
214
|
}
|
|
215
215
|
|
|
@@ -224,7 +224,7 @@ export default createPlugin({
|
|
|
224
224
|
|
|
225
225
|
// extract extension from filename
|
|
226
226
|
console.log('meta.filename', meta.filename)
|
|
227
|
-
const extension = meta.filename?.match(
|
|
227
|
+
const extension = meta.filename?.match(/\.([^.]+)$/)?.[1]
|
|
228
228
|
if (extension) meta.extension = extension
|
|
229
229
|
const create = !fileId
|
|
230
230
|
if (!fileId) fileId = $.id()
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@startupjs-ui/file-input",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -41,5 +41,5 @@
|
|
|
41
41
|
"optional": true
|
|
42
42
|
}
|
|
43
43
|
},
|
|
44
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "cf169e0d969ca5dc2d7a07cba0f0f6b26f631a57"
|
|
45
45
|
}
|