@nocode-factory/sanity-kit 2.64.0-rc.1 → 2.64.0-rc.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/CHANGELOG.md +26 -4
- package/bin/check-lcp.mjs +10 -0
- package/bin/ncf-kit.mjs +20 -4
- package/dist/index.d.ts +4 -3
- package/dist/index.js +7 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/form/choices/options.ts +7 -3
- package/src/version.ts +1 -1
package/package.json
CHANGED
|
@@ -20,14 +20,18 @@ export interface NcfChoiceInputsOptions {
|
|
|
20
20
|
linkType?: string
|
|
21
21
|
/**
|
|
22
22
|
* Repli propre à un emplacement, quand ni l'instance ni les valeurs par défaut ne
|
|
23
|
-
* fixent la valeur : {'champParent.champ': valeur}
|
|
24
|
-
*
|
|
23
|
+
* fixent la valeur : {'champParent.champ': valeur}, ajouté aux replis du kit. Par défaut
|
|
24
|
+
* (convention du starter) : {'secondary.style': 'secondary'}, le bouton « secondary »
|
|
25
|
+
* d'une section est secondaire, comme sur le site (LinkButton defaultStyle).
|
|
25
26
|
*/
|
|
26
27
|
fallbacks?: Record<string, string>
|
|
27
28
|
/** Libellés (interface du kit en anglais par défaut ; le starter les passe en français). */
|
|
28
29
|
labels?: {default?: string; reset?: string; emptyItem?: string}
|
|
29
30
|
}
|
|
30
31
|
|
|
32
|
+
/** Replis du starter NCF : un champ `secondary` (bouton secondaire) est de style secondaire. */
|
|
33
|
+
export const DEFAULT_FALLBACKS: Record<string, string> = {'secondary.style': 'secondary'}
|
|
34
|
+
|
|
31
35
|
export interface ResolvedChoiceInputsOptions {
|
|
32
36
|
colors: Record<string, {value: string}>
|
|
33
37
|
headingLevels: {default: string; sections: Record<string, string>}
|
|
@@ -45,7 +49,7 @@ export function resolveChoiceInputsOptions(input: NcfChoiceInputsOptions = {}):
|
|
|
45
49
|
defaultsType: input.defaultsType ?? DEFAULT_COMPONENT_DEFAULTS_TYPE,
|
|
46
50
|
namespace: input.namespace ?? 'section.',
|
|
47
51
|
linkType: input.linkType ?? 'link',
|
|
48
|
-
fallbacks: input.fallbacks
|
|
52
|
+
fallbacks: {...DEFAULT_FALLBACKS, ...input.fallbacks},
|
|
49
53
|
labels: {
|
|
50
54
|
default: input.labels?.default ?? '(default)',
|
|
51
55
|
reset: input.labels?.reset ?? 'Reset',
|
package/src/version.ts
CHANGED