@sanity/document-internationalization 0.0.1-beta.1

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.
Files changed (91) hide show
  1. package/LICENSE +7 -0
  2. package/README.md +30 -0
  3. package/config.dist.json +4 -0
  4. package/lib/actions/DeleteWithi18nAction.d.ts +16 -0
  5. package/lib/actions/DuplicateWithi18nAction.d.ts +8 -0
  6. package/lib/actions/PublishWithi18nAction.d.ts +9 -0
  7. package/lib/actions/index.d.ts +8 -0
  8. package/lib/actions/index.js +19549 -0
  9. package/lib/actions/index.js.map +1 -0
  10. package/lib/badges/LanguageBadge.d.ts +5 -0
  11. package/lib/badges/index.d.ts +5 -0
  12. package/lib/badges/index.js +17324 -0
  13. package/lib/badges/index.js.map +1 -0
  14. package/lib/constants/I18nDelimiter.d.ts +1 -0
  15. package/lib/constants/I18nPrefix.d.ts +1 -0
  16. package/lib/constants/IdStructure.d.ts +4 -0
  17. package/lib/constants/LanguageCultures.d.ts +4 -0
  18. package/lib/constants/ReferenceBehavior.d.ts +5 -0
  19. package/lib/constants/UiMessages.d.ts +34 -0
  20. package/lib/constants/index.d.ts +6 -0
  21. package/lib/constants/index.js +736 -0
  22. package/lib/constants/index.js.map +1 -0
  23. package/lib/structure/IDefaultDocumentNodeStructureProps.d.ts +4 -0
  24. package/lib/structure/components/Flag/Flag.d.ts +6 -0
  25. package/lib/structure/components/Flag/allEmojiFlagCodes.d.ts +1 -0
  26. package/lib/structure/components/Flag/index.d.ts +1 -0
  27. package/lib/structure/components/MaintenanceTab/MaintenanceTab.d.ts +2 -0
  28. package/lib/structure/components/MaintenanceTab/index.d.ts +1 -0
  29. package/lib/structure/components/MaintenanceTabResult/MaintenanceTabResult.d.ts +10 -0
  30. package/lib/structure/components/MaintenanceTabResult/index.d.ts +1 -0
  31. package/lib/structure/components/MaintenanceTabTypeSelector/MaintenanceTabTypeSelector.d.ts +8 -0
  32. package/lib/structure/components/MaintenanceTabTypeSelector/index.d.ts +1 -0
  33. package/lib/structure/components/TranslationLink/TranslationLink.d.ts +12 -0
  34. package/lib/structure/components/TranslationLink/index.d.ts +1 -0
  35. package/lib/structure/components/TranslationsComponentFactory/TranslationsComponentFactory.d.ts +5 -0
  36. package/lib/structure/components/TranslationsComponentFactory/index.d.ts +1 -0
  37. package/lib/structure/hooks/index.d.ts +1 -0
  38. package/lib/structure/hooks/useDocumentsInformation.d.ts +20 -0
  39. package/lib/structure/index.d.ts +13 -0
  40. package/lib/structure/index.js +20464 -0
  41. package/lib/structure/index.js.map +1 -0
  42. package/lib/structure/utils/fixBaseDocumentRefs.d.ts +2 -0
  43. package/lib/structure/utils/fixBaseLanguageMismatch.d.ts +2 -0
  44. package/lib/structure/utils/fixIdStructureMismatchDocuments.d.ts +2 -0
  45. package/lib/structure/utils/fixLanguageFields.d.ts +2 -0
  46. package/lib/structure/utils/fixOrphanedDocuments.d.ts +2 -0
  47. package/lib/structure/utils/fixReferenceBehaviorMismatch.d.ts +2 -0
  48. package/lib/structure/utils/fixTranslationRefs.d.ts +2 -0
  49. package/lib/structure/utils/index.d.ts +6 -0
  50. package/lib/types/IEditState.d.ts +5 -0
  51. package/lib/types/ILanguageObject.d.ts +6 -0
  52. package/lib/types/ILanguageQuery.d.ts +10 -0
  53. package/lib/types/IResolverProps.d.ts +9 -0
  54. package/lib/types/ITranslationRef.d.ts +6 -0
  55. package/lib/types/IType.d.ts +38 -0
  56. package/lib/types/IUseDocumentOperationResult.d.ts +11 -0
  57. package/lib/types/TFieldNamesConfig.d.ts +5 -0
  58. package/lib/types/TLanguage.d.ts +2 -0
  59. package/lib/types/TLanguagesOption.d.ts +3 -0
  60. package/lib/types/TSchema.d.ts +6 -0
  61. package/lib/types/Ti18nConfig.d.ts +10 -0
  62. package/lib/types/Ti18nDocument.d.ts +13 -0
  63. package/lib/types/Ti18nSchema.d.ts +5 -0
  64. package/lib/types/index.d.ts +14 -0
  65. package/lib/utils/baseToTop.d.ts +1 -0
  66. package/lib/utils/batch.d.ts +1 -0
  67. package/lib/utils/buildDocId.d.ts +1 -0
  68. package/lib/utils/createSanityReference.d.ts +5 -0
  69. package/lib/utils/getAllSchemas.d.ts +2 -0
  70. package/lib/utils/getBaseIdFromId.d.ts +1 -0
  71. package/lib/utils/getBaseLanguage.d.ts +2 -0
  72. package/lib/utils/getConfig.d.ts +6 -0
  73. package/lib/utils/getFlag.d.ts +2 -0
  74. package/lib/utils/getLanguageFromId.d.ts +1 -0
  75. package/lib/utils/getLanguagesFromOption.d.ts +3 -0
  76. package/lib/utils/getSanityClient.d.ts +1 -0
  77. package/lib/utils/getSchema.d.ts +2 -0
  78. package/lib/utils/getTranslationsForId.d.ts +2 -0
  79. package/lib/utils/index.d.ts +16 -0
  80. package/lib/utils/index.js +18425 -0
  81. package/lib/utils/index.js.map +1 -0
  82. package/lib/utils/makeObjectKey.d.ts +1 -0
  83. package/lib/utils/normalizeLanguageList.d.ts +6 -0
  84. package/lib/utils/serializePath.d.ts +2 -0
  85. package/lib/utils/updateIntlFieldsForDocument.d.ts +2 -0
  86. package/lib/validators/index.d.ts +1 -0
  87. package/lib/validators/index.js +17309 -0
  88. package/lib/validators/index.js.map +1 -0
  89. package/lib/validators/isSlugUnique.d.ts +2 -0
  90. package/package.json +151 -0
  91. package/sanity.json +28 -0
@@ -0,0 +1,2 @@
1
+ import type { UniqueCheckerFn } from '@sanity/types';
2
+ export declare const isSlugUnique: UniqueCheckerFn;
package/package.json ADDED
@@ -0,0 +1,151 @@
1
+ {
2
+ "name": "@sanity/document-internationalization",
3
+ "version": "0.0.1-beta.1",
4
+ "license": "MIT",
5
+ "engines": {
6
+ "node": ">=14"
7
+ },
8
+ "author": "Sanity.io <hello@sanity.io>",
9
+ "keywords": [
10
+ "sanity",
11
+ "cms",
12
+ "headless",
13
+ "realtime",
14
+ "content",
15
+ "sanity-plugin",
16
+ "i18n",
17
+ "localization"
18
+ ],
19
+ "files": [
20
+ "lib/",
21
+ "doc/",
22
+ "config.dist.json",
23
+ "sanity.json"
24
+ ],
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
+ "scripts": {
33
+ "lint": "npm run eslint -- .",
34
+ "eslint": "eslint --ext=.js,.jsx,.mjs,.ts,.tsx --quiet",
35
+ "lint:fix": "eslint . --quiet --fix",
36
+ "stylelint": "stylelint \"**/*.scss\"",
37
+ "stylelint:fix": "stylelint \"**/*.scss\" --fix",
38
+ "build": "run-p build:*",
39
+ "build:type": "tsc -p .",
40
+ "build:badges": "rollup -c src/badges/rollup.config.js",
41
+ "build:structure": "rollup -c src/structure/rollup.config.js",
42
+ "build:actions": "rollup -c src/actions/rollup.config.js",
43
+ "build:constants": "rollup -c src/constants/rollup.config.js",
44
+ "build:utils": "rollup -c src/utils/rollup.config.js",
45
+ "build:validators": "rollup -c src/validators/rollup.config.js",
46
+ "watch": "run-p \"build:* -- -w\"",
47
+ "_postinstall": "husky install",
48
+ "prepublishOnly": "pinst --disable && npm run build",
49
+ "postpublish": "pinst --enable"
50
+ },
51
+ "husky": {
52
+ "hooks": {
53
+ "pre-commit": "npm run lint:fix"
54
+ }
55
+ },
56
+ "devDependencies": {
57
+ "@babel/cli": "^7.12.10",
58
+ "@babel/core": "^7.12.10",
59
+ "@babel/plugin-proposal-class-properties": "^7.12.1",
60
+ "@babel/plugin-proposal-optional-chaining": "^7.12.7",
61
+ "@babel/plugin-transform-runtime": "^7.12.10",
62
+ "@babel/preset-env": "^7.12.11",
63
+ "@babel/preset-react": "^7.12.10",
64
+ "@babel/preset-typescript": "^7.12.7",
65
+ "@rollup/plugin-babel": "^5.2.2",
66
+ "@rollup/plugin-commonjs": "^17.0.0",
67
+ "@rollup/plugin-node-resolve": "^11.0.1",
68
+ "@sanity/base": "^2.20.0",
69
+ "@sanity/check": "^2.0.9",
70
+ "@sanity/client": "^2.19.0",
71
+ "@sanity/desk-tool": "^2.21.0",
72
+ "@sanity/form-builder": "^2.20.0",
73
+ "@sanity/react-hooks": "^2.20.0",
74
+ "@sanity/structure": "^2.20.0",
75
+ "@sanity/types": "^2.19.0",
76
+ "@sanity/ui": "^0.36.10",
77
+ "@types/classnames": "^2.2.11",
78
+ "@types/react": "^17.0.0",
79
+ "@types/react-router": "^5.1.11",
80
+ "@types/react-router-dom": "^5.1.7",
81
+ "@types/resize-observer-browser": "^0.1.5",
82
+ "@typescript-eslint/eslint-plugin": "^5.4.0",
83
+ "@typescript-eslint/parser": "^5.4.0",
84
+ "babel-eslint": "^10.1.0",
85
+ "eslint": "^8.3.0",
86
+ "eslint-config-prettier": "^8.3.0",
87
+ "eslint-config-sanity": "^5.1.0",
88
+ "eslint-import-resolver-webpack": "^0.13.2",
89
+ "eslint-plugin-cypress": "^2.12.1",
90
+ "eslint-plugin-es5": "^1.5.0",
91
+ "eslint-plugin-import": "^2.25.3",
92
+ "eslint-plugin-prettier": "^4.0.0",
93
+ "eslint-plugin-react": "^7.27.1",
94
+ "eslint-plugin-react-hooks": "^4.3.0",
95
+ "husky": "^7.0.0",
96
+ "lerna": "^3.22.1",
97
+ "lint-staged": "^12.1.2",
98
+ "node-sass": "^6.0.0",
99
+ "npm-run-all": "^4.1.5",
100
+ "postcss": "^8.2.10",
101
+ "postcss-scss": "^4.0.2",
102
+ "prettier": "^2.5.0",
103
+ "react": "^16.0.0",
104
+ "react-router": "^5.1.0",
105
+ "react-router-dom": "^5.1.0",
106
+ "rollup": "^2.36.1",
107
+ "rollup-plugin-cleaner": "^1.0.0",
108
+ "rollup-plugin-peer-deps-external": "^2.2.4",
109
+ "rollup-plugin-postcss": "^4.0.2",
110
+ "rollup-plugin-typescript2": "^0.29.0",
111
+ "styled-components": "^5.3.1",
112
+ "stylelint": "^14.1.0",
113
+ "stylelint-config-prettier": "^9.0.3",
114
+ "stylelint-prettier": "^2.0.0",
115
+ "stylelint-scss": "^4.0.0",
116
+ "typescript": "^4.1.3"
117
+ },
118
+ "peerDependencies": {
119
+ "@sanity/base": "^2.0.0",
120
+ "@sanity/desk-tool": "^2.21.0",
121
+ "@sanity/form-builder": "^2.0.0",
122
+ "@sanity/react-hooks": "^2.0.0",
123
+ "@sanity/structure": "^2.0.0",
124
+ "@sanity/ui": "^0.36.12",
125
+ "react": "^17.0.0",
126
+ "react-router": "^5.0.0",
127
+ "react-router-dom": "^5.0.0",
128
+ "styled-components": "^5.0.0"
129
+ },
130
+ "dependencies": {
131
+ "@babel/runtime": "^7.12.5",
132
+ "@cprecioso/country-flag-emoji": "^1.0.0",
133
+ "a11y-react-emoji": "^1.1.3",
134
+ "classnames": "^2.2.6",
135
+ "just-omit": "^2.0.1",
136
+ "just-safe-get": "^4.0.1",
137
+ "just-split": "^3.0.1",
138
+ "moment": "^2.29.1",
139
+ "pinst": "^2.1.6",
140
+ "regenerator-runtime": "^0.13.7",
141
+ "slugify": "^1.4.6"
142
+ },
143
+ "lint-staged": {
144
+ "src/**/*.{ts,tsx}": [
145
+ "eslint . --quiet --fix"
146
+ ],
147
+ "src/**/*.scss": [
148
+ "stylelint \"**/*.scss\" --fix"
149
+ ]
150
+ }
151
+ }
package/sanity.json ADDED
@@ -0,0 +1,28 @@
1
+ {
2
+ "paths": {
3
+ "source": "./src",
4
+ "compiled": "./lib"
5
+ },
6
+ "parts": [
7
+ {
8
+ "implements": "part:@sanity/base/document-badges/resolver",
9
+ "path": "badges/index.js"
10
+ },
11
+ {
12
+ "implements": "part:@sanity/base/document-actions/resolver",
13
+ "path": "actions/index.js"
14
+ },
15
+ {
16
+ "name": "part:@sanity/document-internationalization/languages/loader",
17
+ "description": "User implementable languages loader function"
18
+ },
19
+ {
20
+ "name": "part:@sanity/document-internationalization/languages/should-reload",
21
+ "description": "User implementable function determening whether the languages should be reloaded"
22
+ },
23
+ {
24
+ "name": "part:@sanity/document-internationalization/ui/flags",
25
+ "description": "Part can be implemented to override default flag"
26
+ }
27
+ ]
28
+ }