next-tinacms-cloudinary 3.3.3 → 3.3.7
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 +13 -0
- package/dist/handlers.js +9 -1
- package/dist/index.es.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +4 -6
package/CHANGELOG.md
CHANGED
package/dist/handlers.js
CHANGED
|
@@ -142,10 +142,18 @@ function cloudinaryToTina(file) {
|
|
|
142
142
|
id: file.public_id,
|
|
143
143
|
filename,
|
|
144
144
|
directory,
|
|
145
|
-
|
|
145
|
+
src: file.url,
|
|
146
|
+
previewSrc: transformCloudinaryImage(file.url, "w_75,h_75,c_fill,q_auto"),
|
|
146
147
|
type: "file"
|
|
147
148
|
};
|
|
148
149
|
}
|
|
150
|
+
function transformCloudinaryImage(url, transformations) {
|
|
151
|
+
const parts = url.split("/image/upload/");
|
|
152
|
+
if (parts.length === 2) {
|
|
153
|
+
return parts[0] + "/image/upload/" + transformations + "/" + parts[1];
|
|
154
|
+
}
|
|
155
|
+
return url;
|
|
156
|
+
}
|
|
149
157
|
// Annotate the CommonJS export names for ESM import in node:
|
|
150
158
|
0 && (module.exports = {
|
|
151
159
|
createMediaHandler,
|
package/dist/index.es.js
CHANGED
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "next-tinacms-cloudinary",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.7",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -17,16 +17,15 @@
|
|
|
17
17
|
]
|
|
18
18
|
},
|
|
19
19
|
"scripts": {
|
|
20
|
-
"build": "yarn tsup src/index.ts src/handlers.ts --format cjs --dts",
|
|
21
20
|
"types": "yarn tsc",
|
|
22
|
-
"
|
|
21
|
+
"build": "echo \"Run `yarn build` from the root of the repository instead\""
|
|
23
22
|
},
|
|
24
23
|
"dependencies": {
|
|
25
24
|
"cloudinary": "^1.25.2",
|
|
26
25
|
"multer": "^1.4.2"
|
|
27
26
|
},
|
|
28
27
|
"devDependencies": {
|
|
29
|
-
"@tinacms/toolkit": "0.
|
|
28
|
+
"@tinacms/toolkit": "0.56.0",
|
|
30
29
|
"@types/crypto-js": "^3.1.47",
|
|
31
30
|
"@types/js-cookie": "^2.2.6",
|
|
32
31
|
"@types/node": "^13.13.1",
|
|
@@ -36,8 +35,7 @@
|
|
|
36
35
|
"react": "16.14.0",
|
|
37
36
|
"react-dom": "16.14.0",
|
|
38
37
|
"styled-components": "^5.2.0",
|
|
39
|
-
"tinacms": "0.
|
|
40
|
-
"tsup": "4.12.5",
|
|
38
|
+
"tinacms": "0.59.0",
|
|
41
39
|
"typescript": "^4.3.5"
|
|
42
40
|
},
|
|
43
41
|
"peerDependencies": {
|