@nocode-factory/sanity-kit 2.50.0 → 2.51.0

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 CHANGED
@@ -45,7 +45,7 @@ export declare const NODE_FIELD_TYPE = "ncfNodeField";
45
45
  export declare const COLUMN_TYPE = "ncfColumn";
46
46
  export declare const ANNOTATION_TYPE = "ncfAnnotation";
47
47
  /** Types déclarés par le kit : à masquer de la structure du Studio hôte. */
48
- export declare const NCF_HIDDEN_TYPES: readonly ["ncfBoardLayout", "ncfTranslationTodo", "ncfAssetMeta"];
48
+ export declare const NCF_HIDDEN_TYPES: readonly ["ncfBoardLayout", "ncfTranslationTodo", "ncfAssetMeta", "ncfComponentMeta"];
49
49
  export declare const kitSchemaTypes: ({
50
50
  name: "ncfBoardLayout";
51
51
  title: string;
@@ -416,6 +416,73 @@ export declare const kitSchemaTypes: ({
416
416
  title: string;
417
417
  };
418
418
  };
419
+ } | {
420
+ name: "ncfComponentMeta";
421
+ title: string;
422
+ type: "document";
423
+ fields: ({
424
+ name: "groups";
425
+ title: string;
426
+ type: "array";
427
+ of: {
428
+ type: string;
429
+ }[];
430
+ } | {
431
+ name: "components";
432
+ title: string;
433
+ type: "array";
434
+ of: {
435
+ type: string;
436
+ }[];
437
+ } | {
438
+ name: "updatedBy";
439
+ title: string;
440
+ type: "string";
441
+ readOnly: true;
442
+ })[];
443
+ preview: {
444
+ prepare: () => {
445
+ title: string;
446
+ };
447
+ };
448
+ } | {
449
+ name: "ncfComponentGroup";
450
+ title: string;
451
+ type: "object";
452
+ fields: ({
453
+ name: "id";
454
+ title: string;
455
+ type: "string";
456
+ } | {
457
+ name: "name";
458
+ title: string;
459
+ type: "string";
460
+ })[];
461
+ preview: {
462
+ select: {
463
+ title: string;
464
+ subtitle: string;
465
+ };
466
+ };
467
+ } | {
468
+ name: "ncfComponentEntry";
469
+ title: string;
470
+ type: "object";
471
+ fields: ({
472
+ name: "name";
473
+ title: string;
474
+ type: "string";
475
+ } | {
476
+ name: "group";
477
+ title: string;
478
+ type: "string";
479
+ })[];
480
+ preview: {
481
+ select: {
482
+ title: string;
483
+ subtitle: string;
484
+ };
485
+ };
419
486
  })[];
420
487
  /** Vrai pour les types techniques du kit. */
421
488
  export declare const isKitType: (typeName: string) => boolean;
@@ -813,6 +880,42 @@ interface AssetMetaState {
813
880
  * débouncée. À appeler UNE fois (outil Assets) : deux instances s'écraseraient.
814
881
  */
815
882
  export declare function useAssetMeta(): AssetMetaState;
883
+ interface ComponentGroup {
884
+ id: string;
885
+ name: string;
886
+ }
887
+ /** Entrée d'organisation d'un composant, repérée par son TYPE. */
888
+ interface ComponentEntry {
889
+ /** Type du composant (ex. `section.hero`). */
890
+ type: string;
891
+ /** Nom marketing personnalisé (sinon le titre du schéma). */
892
+ name?: string;
893
+ /** Id du groupe, ou absent (non groupé). */
894
+ group?: string;
895
+ }
896
+ /** Map type -> nom personnalisé (ignore les vides). */
897
+ export declare function nameMap(entries: readonly ComponentEntry[]): Map<string, string>;
898
+ /** Map type -> id de groupe (ignore les vides). */
899
+ export declare function groupMap(entries: readonly ComponentEntry[]): Map<string, string>;
900
+ /** Applique le nom marketing au `title` d'un composant (garde `name`/type). */
901
+ export declare function withCustomNames(blocks: readonly BlockTypeInfo[], names: Map<string, string>): BlockTypeInfo[];
902
+ interface ComponentGrouping {
903
+ /** Groupes dans l'ordre déclaré, avec leurs composants (dans l'ordre d'entrée). */
904
+ grouped: {
905
+ group: ComponentGroup;
906
+ blocks: BlockTypeInfo[];
907
+ }[];
908
+ /** Composants sans groupe. */
909
+ ungrouped: BlockTypeInfo[];
910
+ }
911
+ /** Répartit les composants par groupe (ordre des groupes préservé). */
912
+ export declare function groupComponents(blocks: readonly BlockTypeInfo[], groupOf: Map<string, string>, groups: readonly ComponentGroup[]): ComponentGrouping;
913
+ /**
914
+ * Noms marketing des composants (type -> nom), en LECTURE SEULE et en direct.
915
+ * Pour les surfaces hors onglet (ex. l'input du page builder qui réécrit les
916
+ * libellés du menu d'insertion) : pas d'écriture, donc pas de provider unique.
917
+ */
918
+ export declare function useComponentNames(): Map<string, string>;
816
919
  /**
817
920
  * Les projections sont préfixées `ncf` pour ne jamais entrer en collision avec
818
921
  * un champ du client, quel que soit son schéma.
@@ -1295,7 +1398,7 @@ export declare function ActorName(props: {
1295
1398
  * quelle version. Recopiée de `package.json` par `npm version` (scripts/sync-version.mjs) ; un test
1296
1399
  * le vérifie.
1297
1400
  */
1298
- export declare const KIT_VERSION = "2.50.0";
1401
+ export declare const KIT_VERSION = "2.51.0";
1299
1402
  /**
1300
1403
  * Données de la page proposées comme colonnes.
1301
1404
  *
@@ -1792,5 +1895,5 @@ export declare const NCF_DESIGN_SYSTEM_TOOL = "ncf-design-system";
1792
1895
  export declare const NCF_ASSETS_TOOL = "ncf-assets";
1793
1896
  export declare const NCF_TOOL_NAMES: readonly ["ncf-pages", "ncf-components", "ncf-history", "ncf-design-system", "ncf-assets"];
1794
1897
  export declare const ncfKit: import("sanity").Plugin<NcfKitConfig>;
1795
- export { type AddColumnInput, type Annotation, type AnnotationsState, type AssetAssignment, type AssetDoc, type AssetFolder, type AssetMetaState, type AssetSortKey, type AssetTypeFilter, type AssetUsageFilter, type BlockOccurrence, type BlockTypeInfo, type BoardEdge, type BoardGraph, type BoardLayoutState, type BoardNode, CONTENT_SCAN_LIMIT as OCCURRENCE_SCAN_LIMIT, type Change, type ChangeKind, CodeEditorInput, CodeEmbedInput, type CodeEmbedTypeOptions, type CodeLanguage, type CollectedLinks, type ColorBy, type ColorOptions, type ConfigIssue, type CrossLanguageReport, DEFAULT_COMPONENT_DEFAULTS_TYPE, type DeriveOptions, type FolderSelection, type GroupBy, type GroupOptions, type HistoryDetail, type HistoryEvent, type IssueLevel, type KitContextValue, type KitUpdate, type LayoutMode, type MainDocumentRoute, type MergedDoc, type NcfBoardTag, type NcfComponentPreviewConfig, type NcfDocumentColumn, type NcfEnvironment, type NcfHistoryConfig, type NcfI18nConfig, type NcfInternalField, type NcfInternalFieldOption, type NcfKitConfig, type NcfPageTypeConfig, type NcfPageTypeInput, type NcfToolName, type NcfToolsConfig, type NodeLayout, type NodePosition, type OccurrenceInput, type OccurrencePage, type OccurrencesState, type PageBuilderResolution, type PageContent, type PageContentsState, type PageDoc, type PageFilters, type PageRow, type PageStatus, type PagesState, type PathInput, type Positioned, type PresentationOptions, type PreviewGrant, type PreviewPerspective, type PreviewTargetState, type ProjectStatus, type Registration, type ResolvedComponentPreview, type ResolvedDocumentColumn, type ResolvedHistory, type ResolvedI18n, type ResolvedKitConfig, type ResolvedPageType, type RowColor, type RowGroup, type SchemaFieldLike, type SchemaTypeLike, type SectionLayout, type SectionMapNode, type SectionOrder, type SectionsMapOptions, type Segment, type SiteRoutesRegistry, type SortDirection, type SortKey, type ThumbnailInput, type VersionedDoc, codeEditorInput, componentDefaultsMainDocument, componentDefaultsMainDocuments, defaultsFieldName, defineCodeEmbedType, defineComponentDefaults, fixCrossLanguageReferences, pageTypesFromSiteRoutes, requiredUnlessDefault, requiredUnlessDefaultFor, withSameLanguageReferences };
1898
+ export { type AddColumnInput, type Annotation, type AnnotationsState, type AssetAssignment, type AssetDoc, type AssetFolder, type AssetMetaState, type AssetSortKey, type AssetTypeFilter, type AssetUsageFilter, type BlockOccurrence, type BlockTypeInfo, type BoardEdge, type BoardGraph, type BoardLayoutState, type BoardNode, CONTENT_SCAN_LIMIT as OCCURRENCE_SCAN_LIMIT, type Change, type ChangeKind, CodeEditorInput, CodeEmbedInput, type CodeEmbedTypeOptions, type CodeLanguage, type CollectedLinks, type ColorBy, type ColorOptions, type ComponentEntry, type ComponentGroup, type ComponentGrouping, type ConfigIssue, type CrossLanguageReport, DEFAULT_COMPONENT_DEFAULTS_TYPE, type DeriveOptions, type FolderSelection, type GroupBy, type GroupOptions, type HistoryDetail, type HistoryEvent, type IssueLevel, type KitContextValue, type KitUpdate, type LayoutMode, type MainDocumentRoute, type MergedDoc, type NcfBoardTag, type NcfComponentPreviewConfig, type NcfDocumentColumn, type NcfEnvironment, type NcfHistoryConfig, type NcfI18nConfig, type NcfInternalField, type NcfInternalFieldOption, type NcfKitConfig, type NcfPageTypeConfig, type NcfPageTypeInput, type NcfToolName, type NcfToolsConfig, type NodeLayout, type NodePosition, type OccurrenceInput, type OccurrencePage, type OccurrencesState, type PageBuilderResolution, type PageContent, type PageContentsState, type PageDoc, type PageFilters, type PageRow, type PageStatus, type PagesState, type PathInput, type Positioned, type PresentationOptions, type PreviewGrant, type PreviewPerspective, type PreviewTargetState, type ProjectStatus, type Registration, type ResolvedComponentPreview, type ResolvedDocumentColumn, type ResolvedHistory, type ResolvedI18n, type ResolvedKitConfig, type ResolvedPageType, type RowColor, type RowGroup, type SchemaFieldLike, type SchemaTypeLike, type SectionLayout, type SectionMapNode, type SectionOrder, type SectionsMapOptions, type Segment, type SiteRoutesRegistry, type SortDirection, type SortKey, type ThumbnailInput, type VersionedDoc, codeEditorInput, componentDefaultsMainDocument, componentDefaultsMainDocuments, defaultsFieldName, defineCodeEmbedType, defineComponentDefaults, fixCrossLanguageReferences, pageTypesFromSiteRoutes, requiredUnlessDefault, requiredUnlessDefaultFor, withSameLanguageReferences };
1796
1899
  //# sourceMappingURL=index.d.ts.map