@sanity/document-internationalization 0.3.7 → 0.3.8
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/LICENSE +4 -1
- package/README.md +10 -8
- package/package.json +35 -30
- package/CHANGELOG.md +0 -58
package/LICENSE
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
1
3
|
Copyright © 2020 Liam Martens
|
|
4
|
+
Copyright © 2022 Sanity.io
|
|
2
5
|
|
|
3
6
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
4
7
|
|
|
5
8
|
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
6
9
|
|
|
7
|
-
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
10
|
+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
# Document Internationalization Plugin for Sanity.io
|
|
2
2
|
|
|
3
|
-
> **
|
|
4
|
-
>
|
|
5
|
-
> This is the **Sanity Studio V2 version** of Document Internationalization Plugin.
|
|
6
|
-
>
|
|
7
|
-
> For the V3 version, please refer to the [v3-branch](https://github.com/sanity-io/document-internationalization/tree/v3).
|
|
3
|
+
>This is a **Sanity Studio v2** plugin.
|
|
4
|
+
> For the V3 version, please refer to the [v3-branch](https://github.com/sanity-io/document-internationalization).
|
|
8
5
|
|
|
9
6
|
[](https://www.npmjs.com/package/@sanity/document-internationalization)
|
|
10
7
|
|
|
@@ -43,11 +40,16 @@ A good use of field-level translation could be a `person` schema. It could have
|
|
|
43
40
|
|
|
44
41
|
With the [Sanity CLI installed](https://www.sanity.io/docs/getting-started-with-sanity-cli), from the same directory as the Studio run:
|
|
45
42
|
|
|
46
|
-
```
|
|
47
|
-
|
|
43
|
+
```sh
|
|
44
|
+
yarn add @sanity/document-internationalization@studio-v2
|
|
48
45
|
```
|
|
49
46
|
|
|
50
|
-
|
|
47
|
+
Next, add `"@sanity/document-internationalization"` to `sanity.json` plugins array:
|
|
48
|
+
```json
|
|
49
|
+
"plugins": [
|
|
50
|
+
"@sanity/document-internationalization"
|
|
51
|
+
]
|
|
52
|
+
```
|
|
51
53
|
|
|
52
54
|
The plugin is now installed, but you will need to complete the following steps to see the Document Translation UI:
|
|
53
55
|
|
package/package.json
CHANGED
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sanity/document-internationalization",
|
|
3
|
-
"version": "0.3.
|
|
4
|
-
"license": "MIT",
|
|
5
|
-
"engines": {
|
|
6
|
-
"node": ">=14"
|
|
7
|
-
},
|
|
8
|
-
"author": "Sanity.io <hello@sanity.io>",
|
|
3
|
+
"version": "0.3.8",
|
|
9
4
|
"keywords": [
|
|
10
5
|
"sanity",
|
|
11
6
|
"cms",
|
|
@@ -16,19 +11,23 @@
|
|
|
16
11
|
"i18n",
|
|
17
12
|
"localization"
|
|
18
13
|
],
|
|
14
|
+
"bugs": {
|
|
15
|
+
"url": "https://github.com/sanity-io/document-internationalization/issues"
|
|
16
|
+
},
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "git@github.com:sanity-io/document-internationalization"
|
|
20
|
+
},
|
|
21
|
+
"license": "MIT",
|
|
22
|
+
"author": "Sanity.io <hello@sanity.io>",
|
|
19
23
|
"files": [
|
|
20
24
|
"lib/",
|
|
21
25
|
"doc/",
|
|
22
26
|
"config.dist.json",
|
|
23
|
-
"sanity.json"
|
|
27
|
+
"sanity.json",
|
|
28
|
+
"README.md",
|
|
29
|
+
"LICENSE"
|
|
24
30
|
],
|
|
25
|
-
"repository": {
|
|
26
|
-
"type": "git",
|
|
27
|
-
"url": "https://github.com/sanity-io/document-internationalization"
|
|
28
|
-
},
|
|
29
|
-
"bugs": {
|
|
30
|
-
"url": "https://github.com/sanity-io/document-internationalization/issues"
|
|
31
|
-
},
|
|
32
31
|
"scripts": {
|
|
33
32
|
"lint": "npm run eslint -- .",
|
|
34
33
|
"eslint": "eslint --ext=.js,.jsx,.mjs,.ts,.tsx --quiet",
|
|
@@ -52,6 +51,23 @@
|
|
|
52
51
|
"pre-commit": "npm run lint:fix"
|
|
53
52
|
}
|
|
54
53
|
},
|
|
54
|
+
"lint-staged": {
|
|
55
|
+
"src/**/*.{ts,tsx}": [
|
|
56
|
+
"eslint . --quiet --fix"
|
|
57
|
+
]
|
|
58
|
+
},
|
|
59
|
+
"dependencies": {
|
|
60
|
+
"@babel/runtime": "^7.12.5",
|
|
61
|
+
"@cprecioso/country-flag-emoji": "^1.0.0",
|
|
62
|
+
"html-react-parser": "^1.4.12",
|
|
63
|
+
"just-omit": "^2.0.1",
|
|
64
|
+
"just-safe-get": "^4.0.1",
|
|
65
|
+
"just-split": "^3.0.1",
|
|
66
|
+
"pinst": "^2.1.6",
|
|
67
|
+
"react-twemoji": "^0.5.0",
|
|
68
|
+
"regenerator-runtime": "^0.13.7",
|
|
69
|
+
"twemoji": "^14.0.2"
|
|
70
|
+
},
|
|
55
71
|
"devDependencies": {
|
|
56
72
|
"@babel/cli": "^7.12.10",
|
|
57
73
|
"@babel/core": "^7.12.10",
|
|
@@ -61,6 +77,8 @@
|
|
|
61
77
|
"@babel/preset-env": "^7.12.11",
|
|
62
78
|
"@babel/preset-react": "^7.12.10",
|
|
63
79
|
"@babel/preset-typescript": "^7.12.7",
|
|
80
|
+
"@commitlint/cli": "^17.1.2",
|
|
81
|
+
"@commitlint/config-conventional": "^17.1.0",
|
|
64
82
|
"@rollup/plugin-babel": "^5.2.2",
|
|
65
83
|
"@rollup/plugin-commonjs": "^17.0.0",
|
|
66
84
|
"@rollup/plugin-node-resolve": "^11.0.1",
|
|
@@ -73,6 +91,7 @@
|
|
|
73
91
|
"@sanity/icons": "^1.2.5",
|
|
74
92
|
"@sanity/language-filter": "^2.28.0",
|
|
75
93
|
"@sanity/react-hooks": "^2.20.0",
|
|
94
|
+
"@sanity/semantic-release-preset": "^2.0.1",
|
|
76
95
|
"@sanity/state-router": "^2.0.0",
|
|
77
96
|
"@sanity/structure": "^2.20.0",
|
|
78
97
|
"@sanity/types": "^2.19.0",
|
|
@@ -133,21 +152,7 @@
|
|
|
133
152
|
"rxjs": "^6.0.0",
|
|
134
153
|
"styled-components": "^5.0.0"
|
|
135
154
|
},
|
|
136
|
-
"
|
|
137
|
-
"
|
|
138
|
-
"@cprecioso/country-flag-emoji": "^1.0.0",
|
|
139
|
-
"html-react-parser": "^1.4.12",
|
|
140
|
-
"just-omit": "^2.0.1",
|
|
141
|
-
"just-safe-get": "^4.0.1",
|
|
142
|
-
"just-split": "^3.0.1",
|
|
143
|
-
"pinst": "^2.1.6",
|
|
144
|
-
"react-twemoji": "^0.5.0",
|
|
145
|
-
"regenerator-runtime": "^0.13.7",
|
|
146
|
-
"twemoji": "^14.0.2"
|
|
147
|
-
},
|
|
148
|
-
"lint-staged": {
|
|
149
|
-
"src/**/*.{ts,tsx}": [
|
|
150
|
-
"eslint . --quiet --fix"
|
|
151
|
-
]
|
|
155
|
+
"engines": {
|
|
156
|
+
"node": ">=14"
|
|
152
157
|
}
|
|
153
158
|
}
|
package/CHANGELOG.md
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
# CHANGELOG
|
|
2
|
-
|
|
3
|
-
## v0.3.7
|
|
4
|
-
* Fixed issues with translation maintenance
|
|
5
|
-
* Added transaction overview confirmation dialog for better transparency
|
|
6
|
-
|
|
7
|
-
## v0.3.6
|
|
8
|
-
* Updates the internal logic to derive the language from the given field name as opposed to the ID.
|
|
9
|
-
|
|
10
|
-
## v0.3.5
|
|
11
|
-
* Fix how translation draft references are created so that they can be deleted
|
|
12
|
-
|
|
13
|
-
## v0.3.4
|
|
14
|
-
* Updated docs regarding V3 studio
|
|
15
|
-
|
|
16
|
-
## v0.3.3
|
|
17
|
-
* Fixes [#59](https://github.com/sanity-io/document-internationalization/issues/59) - Missing `_weak` field in base reference
|
|
18
|
-
|
|
19
|
-
## v0.1.7
|
|
20
|
-
* For base I18n documents the default "Delete" action will now be replaced with the Delete (incl. translations)" action. The default "Delete" action does not make sense for base documents in any scenario as it results in broken references.
|
|
21
|
-
|
|
22
|
-
## v0.1.6
|
|
23
|
-
* Fixed translation maintenance functionality
|
|
24
|
-
|
|
25
|
-
## v0.1.5
|
|
26
|
-
* Don't override `child` resolver as it is not required anymore. This way it will correctly fallback on the Studio's structure definition
|
|
27
|
-
|
|
28
|
-
## v0.1.4
|
|
29
|
-
* Fixed an issue with filtering `all:part:@sanity/desk-tool/language-select-component`
|
|
30
|
-
|
|
31
|
-
## v0.1.3
|
|
32
|
-
* The plugin will not show the language dropdown anymore for schemas that do not have `i18n` enabled. This version also brings support for the `@sanity/language-filter` plugin for non `i18n` schemas.
|
|
33
|
-
|
|
34
|
-
## v0.1.2
|
|
35
|
-
* Fixed import to `ConfirmDeleteDialog`
|
|
36
|
-
|
|
37
|
-
## v0.1.1
|
|
38
|
-
* [#32](https://github.com/sanity-io/document-internationalization/issues/32) Fixes default and custom flag implementations
|
|
39
|
-
|
|
40
|
-
## v0.1.0
|
|
41
|
-
This is the first stable release for the official document internationalization plugin. A few things have changed since the original plugin. For a migration guide please see [this guide](docs/coming-from-sanity-plugin-intl-input.md).
|
|
42
|
-
|
|
43
|
-
**Breaking Changes**
|
|
44
|
-
- Object level translations are not supported by this plugin anymore. If your project requires this please use the [@sanity/language-filter](https://www.npmjs.com/package/@sanity/language-filter) plugin.
|
|
45
|
-
- `delimiter` is now the default ID structure as opposed to `subpath`. If you are using the legacy plugin with no `idStructure` specified you will need to make sure to configure it explicitly in this version. Coming from the old version you will need to set it to `subpath` to keep your current structure.
|
|
46
|
-
- It is not possible anymore to override the UI messages using plugin configuration.
|
|
47
|
-
- The language configuration has been updated to use an `id` field instead of `name`. This change was made to align with the `@sanity/language-filter` plugin. You will need to update your language configuration if you are coming from the old plugin.
|
|
48
|
-
- The `hard` reference behavior configuration has been renamed to `strong` to be more consistent with Sanity itself.
|
|
49
|
-
- The `__i18n_refs` field will now be a simple array of rerences as opposed to an array of custom objects. They are keyed by their language code for easier querying.
|
|
50
|
-
|
|
51
|
-
**Fixes**
|
|
52
|
-
- Fixed issue with `fixIdStructureMismatchDocuments` maintenance function
|
|
53
|
-
- Fixed a bug with the `fixBaseLanguageMismatch` method as it was not considering the field name configuration
|
|
54
|
-
- [#124](https://github.com/LiamMartens/sanity-plugin-intl-input/issues/124) Updates an internal import to support the minor bump from `@sanity/desk-tool@2.28.0`
|
|
55
|
-
|
|
56
|
-
**Other Changes**
|
|
57
|
-
- Added a slug uniqueness validator for document level translations (`import { isSlugUnique } from '@sanity/document-internationalization/lib/validators`)
|
|
58
|
-
- A maintenance function was created to add base document refs to translated documents
|