@nocode-factory/sanity-kit 2.48.1 → 2.48.2
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/dist/index.d.ts +1 -1
- package/dist/index.js +10 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +9 -3
- package/src/version.ts +1 -1
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -42,6 +42,8 @@ export const NCF_TOOL_NAMES = [
|
|
|
42
42
|
* pas le Studio de démarrer : l'onglet concerné affiche le détail à corriger.
|
|
43
43
|
*/
|
|
44
44
|
import {createOverrideInput} from './form/OverrideInput'
|
|
45
|
+
import {KitProvider} from './context/KitContext'
|
|
46
|
+
import type {ConfigIssue} from './config/types'
|
|
45
47
|
import {RemoveFromSiteAction, createRemoveFromSite} from './actions/RemoveFromSite'
|
|
46
48
|
import {createSlugUrlInput, isSlugInput} from './form/SlugUrlInput'
|
|
47
49
|
import {withTranslationTodo} from './form/TranslationTodoInput'
|
|
@@ -53,11 +55,15 @@ import {withTranslationDelete} from './actions/DeleteTranslations'
|
|
|
53
55
|
import {withTranslationRedirects} from './actions/TranslationRedirects'
|
|
54
56
|
|
|
55
57
|
/** Champs du formulaire : adresse sous le Slug d'une page, pastille sur les sections. */
|
|
56
|
-
function createKitInput(config: Parameters<typeof createOverrideInput>[0]): ComponentType<InputProps> {
|
|
58
|
+
function createKitInput(config: Parameters<typeof createOverrideInput>[0], issues: ConfigIssue[]): ComponentType<InputProps> {
|
|
57
59
|
const Override = createOverrideInput(config)
|
|
58
60
|
const SlugUrl = createSlugUrlInput(config)
|
|
59
61
|
function KitInput(props: InputProps) {
|
|
60
|
-
|
|
62
|
+
// Configuration du kit fournie au formulaire : les champs du kit (ex. JSON-LD,
|
|
63
|
+
// useKitConfig) la lisent comme les outils. Sans elle : « useKitContext must be
|
|
64
|
+
// called inside a tool ».
|
|
65
|
+
const children = isSlugInput(props) ? createElement(SlugUrl, props) : createElement(Override, props)
|
|
66
|
+
return createElement(KitProvider, {config, issues, children})
|
|
61
67
|
}
|
|
62
68
|
// Traductions : pastille « À traduire » sur les champs modifiés dans la version principale.
|
|
63
69
|
// Vue « Published » : « Switch to Drafts to edit » au survol d'un champ.
|
|
@@ -200,7 +206,7 @@ export const ncfKit = definePlugin<NcfKitConfig>((options) => {
|
|
|
200
206
|
// la valeur par défaut du composant ; survol = « Réinitialiser ». Sous le champ
|
|
201
207
|
// Slug d'une page : son adresse complète en ligne (Copier, Ouvrir).
|
|
202
208
|
form: {
|
|
203
|
-
components: {input: createKitInput(config)},
|
|
209
|
+
components: {input: createKitInput(config, issues)},
|
|
204
210
|
},
|
|
205
211
|
}
|
|
206
212
|
})
|
package/src/version.ts
CHANGED