sanity-plugin-asset-source-unsplash 1.0.7-beta.1 → 1.0.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/README.md +9 -13
- package/package.json +31 -31
- package/v2-incompatible.js +2 -2
package/README.md
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
> For the v2 version, please refer to the [v2-branch](https://github.com/sanity-io/sanity-plugin-asset-source-unsplash/tree/studio-v2).
|
|
5
5
|
|
|
6
6
|
## What is it?
|
|
7
|
+
|
|
7
8
|
Search for photos on Unsplash and add them to your project right inside Sanity Studio.
|
|
8
9
|
|
|
9
10
|

|
|
@@ -21,13 +22,11 @@ or
|
|
|
21
22
|
Add it as a plugin in sanity.config.ts (or .js):
|
|
22
23
|
|
|
23
24
|
```js
|
|
24
|
-
import { unsplashImageAsset } from
|
|
25
|
+
import { unsplashImageAsset } from 'sanity-plugin-asset-source-unsplash'
|
|
25
26
|
|
|
26
27
|
export default defineConfig({
|
|
27
28
|
// ...
|
|
28
|
-
plugins: [
|
|
29
|
-
unsplashImageAsset(),
|
|
30
|
-
]
|
|
29
|
+
plugins: [unsplashImageAsset()],
|
|
31
30
|
})
|
|
32
31
|
```
|
|
33
32
|
|
|
@@ -39,19 +38,17 @@ If you need to configure when Unsplash should be available as an asset source, f
|
|
|
39
38
|
`form.image.assetSources`:
|
|
40
39
|
|
|
41
40
|
```js
|
|
42
|
-
import { unsplashImageAsset, unsplashAssetSource } from
|
|
41
|
+
import { unsplashImageAsset, unsplashAssetSource } from 'sanity-plugin-asset-source-unsplash'
|
|
43
42
|
|
|
44
43
|
export default defineConfig({
|
|
45
44
|
// ...
|
|
46
|
-
plugins: [
|
|
47
|
-
unsplashImageAsset(),
|
|
48
|
-
],
|
|
45
|
+
plugins: [unsplashImageAsset()],
|
|
49
46
|
form: {
|
|
50
47
|
image: {
|
|
51
|
-
assetSources: (previousAssetSources, {schema}) => {
|
|
48
|
+
assetSources: (previousAssetSources, { schema }) => {
|
|
52
49
|
if (schema.name === 'movie-image') {
|
|
53
50
|
// remove unsplash from movie-image types
|
|
54
|
-
return previousAssetSources.filter(assetSource => assetSource !== unsplashAssetSource)
|
|
51
|
+
return previousAssetSources.filter((assetSource) => assetSource !== unsplashAssetSource)
|
|
55
52
|
}
|
|
56
53
|
return previousAssetSources
|
|
57
54
|
},
|
|
@@ -122,7 +119,6 @@ export default defineConfig({
|
|
|
122
119
|
"accepted_tos": true
|
|
123
120
|
}
|
|
124
121
|
}
|
|
125
|
-
|
|
126
122
|
```
|
|
127
123
|
|
|
128
124
|
## Example resulting asset document
|
|
@@ -223,8 +219,8 @@ export default defineConfig({
|
|
|
223
219
|
|
|
224
220
|
## Futher reading
|
|
225
221
|
|
|
226
|
-
|
|
227
|
-
|
|
222
|
+
- https://unsplash.com/documentation
|
|
223
|
+
- https://www.sanity.io/docs/custom-asset-sources
|
|
228
224
|
|
|
229
225
|
## License
|
|
230
226
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sanity-plugin-asset-source-unsplash",
|
|
3
|
-
"version": "1.0.7
|
|
3
|
+
"version": "1.0.7",
|
|
4
4
|
"description": "Use images from Unsplash.com in your Sanity Studio",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"sanity",
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
".": {
|
|
26
26
|
"types": "./lib/index.d.ts",
|
|
27
27
|
"source": "./src/index.ts",
|
|
28
|
-
"import": "./lib/index.esm.js",
|
|
29
28
|
"require": "./lib/index.js",
|
|
29
|
+
"import": "./lib/index.esm.js",
|
|
30
30
|
"default": "./lib/index.esm.js"
|
|
31
31
|
},
|
|
32
32
|
"./package.json": "./package.json"
|
|
@@ -36,26 +36,26 @@
|
|
|
36
36
|
"source": "./src/index.ts",
|
|
37
37
|
"types": "./lib/index.d.ts",
|
|
38
38
|
"files": [
|
|
39
|
+
"src",
|
|
39
40
|
"lib",
|
|
40
41
|
"sanity.json",
|
|
41
|
-
"src",
|
|
42
42
|
"v2-incompatible.js"
|
|
43
43
|
],
|
|
44
44
|
"scripts": {
|
|
45
|
-
"clean": "rimraf lib",
|
|
46
|
-
"lint": "eslint .",
|
|
47
45
|
"prebuild": "npm run clean && plugin-kit verify-package --silent && pkg-utils",
|
|
48
46
|
"build": "run-s clean && plugin-kit verify-package --silent && pkg-utils build --strict && pkg-utils --strict",
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"test": "echo 'no tests for now'",
|
|
47
|
+
"clean": "rimraf lib",
|
|
48
|
+
"compile": "tsc --noEmit",
|
|
52
49
|
"deploy-docs": "ts-node tools/gh-pages-publish",
|
|
53
|
-
"
|
|
50
|
+
"format": "prettier --write --cache --ignore-unknown .",
|
|
51
|
+
"link-watch": "plugin-kit link-watch",
|
|
52
|
+
"lint": "eslint .",
|
|
54
53
|
"precommit": "lint-staged",
|
|
55
|
-
"compile": "tsc --noEmit",
|
|
56
|
-
"prepublishOnly": "run-s build",
|
|
57
54
|
"prepare": "husky install",
|
|
58
|
-
"
|
|
55
|
+
"prepublishOnly": "run-s build",
|
|
56
|
+
"report-coverage": "cat ./coverage/lcov.info | coveralls",
|
|
57
|
+
"test": "echo 'no tests for now'",
|
|
58
|
+
"watch": "pkg-utils watch --strict"
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
61
|
"@sanity/incompatible-plugin": "^1.0.0",
|
|
@@ -65,44 +65,44 @@
|
|
|
65
65
|
"rxjs": "^7.0.0"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
|
-
"@commitlint/cli": "^17.
|
|
69
|
-
"@commitlint/config-conventional": "^17.
|
|
70
|
-
"@sanity/pkg-utils": "^2.
|
|
71
|
-
"@sanity/plugin-kit": "^3.1.
|
|
72
|
-
"@sanity/semantic-release-preset": "^4.
|
|
73
|
-
"@types/node": "^
|
|
74
|
-
"@types/react": "^18.
|
|
68
|
+
"@commitlint/cli": "^17.6.3",
|
|
69
|
+
"@commitlint/config-conventional": "^17.6.3",
|
|
70
|
+
"@sanity/pkg-utils": "^2.2.16",
|
|
71
|
+
"@sanity/plugin-kit": "^3.1.7",
|
|
72
|
+
"@sanity/semantic-release-preset": "^4.1.1",
|
|
73
|
+
"@types/node": "^20.2.3",
|
|
74
|
+
"@types/react": "^18.2.6",
|
|
75
75
|
"@types/react-dom": "^18",
|
|
76
76
|
"@types/styled-components": "^5.1.26",
|
|
77
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
78
|
-
"@typescript-eslint/parser": "^5.
|
|
77
|
+
"@typescript-eslint/eslint-plugin": "^5.59.7",
|
|
78
|
+
"@typescript-eslint/parser": "^5.59.7",
|
|
79
79
|
"colors": "^1.4.0",
|
|
80
80
|
"coveralls": "^3.1.1",
|
|
81
81
|
"cross-env": "^7.0.3",
|
|
82
|
-
"eslint": "^8.
|
|
83
|
-
"eslint-config-prettier": "^8.
|
|
82
|
+
"eslint": "^8.41.0",
|
|
83
|
+
"eslint-config-prettier": "^8.8.0",
|
|
84
84
|
"eslint-config-sanity": "^6.0.0",
|
|
85
85
|
"eslint-plugin-prettier": "^4.2.1",
|
|
86
|
-
"eslint-plugin-react": "^7.32.
|
|
86
|
+
"eslint-plugin-react": "^7.32.2",
|
|
87
87
|
"eslint-plugin-react-hooks": "^4.6.0",
|
|
88
88
|
"husky": "^8.0.3",
|
|
89
|
-
"lint-staged": "^13.
|
|
89
|
+
"lint-staged": "^13.2.2",
|
|
90
90
|
"npm-run-all": "^4.1.5",
|
|
91
|
-
"prettier": "^2.8.
|
|
92
|
-
"prettier-plugin-packagejson": "^2.3
|
|
91
|
+
"prettier": "^2.8.8",
|
|
92
|
+
"prettier-plugin-packagejson": "^2.4.3",
|
|
93
93
|
"prompt": "^1.3.0",
|
|
94
94
|
"react": "^18.2.0",
|
|
95
95
|
"react-dom": "^18.2.0",
|
|
96
96
|
"react-is": "^18.2.0",
|
|
97
97
|
"replace-in-file": "^6.3.5",
|
|
98
|
-
"rimraf": "^5.0.
|
|
99
|
-
"sanity": "^3.
|
|
98
|
+
"rimraf": "^5.0.1",
|
|
99
|
+
"sanity": "^3.11.1",
|
|
100
100
|
"shelljs": "^0.8.5",
|
|
101
|
-
"styled-components": "^5.3.
|
|
101
|
+
"styled-components": "^5.3.10",
|
|
102
102
|
"ts-node": "^10.9.1",
|
|
103
103
|
"tslint-config-prettier": "^1.18.0",
|
|
104
104
|
"tslint-config-standard": "^9.0.0",
|
|
105
|
-
"typescript": "^5.0.
|
|
105
|
+
"typescript": "^5.0.4"
|
|
106
106
|
},
|
|
107
107
|
"peerDependencies": {
|
|
108
108
|
"react": "^18",
|
package/v2-incompatible.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const {showIncompatiblePluginDialog} = require('@sanity/incompatible-plugin')
|
|
2
|
-
const {name, version, sanityExchangeUrl} = require('./package.json')
|
|
1
|
+
const { showIncompatiblePluginDialog } = require('@sanity/incompatible-plugin')
|
|
2
|
+
const { name, version, sanityExchangeUrl } = require('./package.json')
|
|
3
3
|
|
|
4
4
|
export default showIncompatiblePluginDialog({
|
|
5
5
|
name: name,
|