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 CHANGED
@@ -1,5 +1,18 @@
1
1
  # next-tinacms-cloudinary
2
2
 
3
+ ## 3.3.7
4
+
5
+ ## 3.3.6
6
+
7
+ ## 3.3.5
8
+
9
+ ### Patch Changes
10
+
11
+ - 138ceb8c4: Clean up dependencies
12
+ - d9f37ea7e: Ensure the full image resolution URL is persisted
13
+
14
+ ## 3.3.4
15
+
3
16
  ## 3.3.3
4
17
 
5
18
  ## 3.3.2
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
- previewSrc: file.url,
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
@@ -48,7 +48,7 @@ class CloudinaryMediaStore {
48
48
  return publicId.previewSrc;
49
49
  };
50
50
  this.parse = (img) => {
51
- return img.previewSrc;
51
+ return img.src;
52
52
  };
53
53
  }
54
54
  async persist(media) {
package/dist/index.js CHANGED
@@ -51,7 +51,7 @@
51
51
  return publicId.previewSrc;
52
52
  };
53
53
  this.parse = (img) => {
54
- return img.previewSrc;
54
+ return img.src;
55
55
  };
56
56
  }
57
57
  async persist(media) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "next-tinacms-cloudinary",
3
- "version": "3.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
- "watch": "yarn tsup src/index.ts src/handlers.ts --watch --format cjs --dts"
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.55.1",
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.57.1",
40
- "tsup": "4.12.5",
38
+ "tinacms": "0.59.0",
41
39
  "typescript": "^4.3.5"
42
40
  },
43
41
  "peerDependencies": {