@wasto/cms-components 1.5.11 → 1.5.12

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.mts CHANGED
@@ -90,12 +90,71 @@ type MapLocation = {
90
90
  badges?: string[];
91
91
  };
92
92
 
93
+ type AppHeaderSlot = "left" | "center" | "right";
94
+ type AppHeaderLogoElement = {
95
+ id: string;
96
+ type: "logo";
97
+ slot: AppHeaderSlot;
98
+ sourceType: "url" | "media";
99
+ url?: string;
100
+ mediaId?: string;
101
+ };
102
+ type AppHeaderTitleElement = {
103
+ id: string;
104
+ type: "title";
105
+ slot: AppHeaderSlot;
106
+ useScreenTitle?: boolean;
107
+ text?: string;
108
+ };
109
+ type AppHeaderActionElement = {
110
+ id: string;
111
+ type: "action";
112
+ slot: AppHeaderSlot;
113
+ icon: string;
114
+ label?: string;
115
+ action: "navigate" | "back";
116
+ href?: string;
117
+ };
118
+ type AppHeaderElement = AppHeaderLogoElement | AppHeaderTitleElement | AppHeaderActionElement;
119
+ type AppHeaderConfig = {
120
+ elements: AppHeaderElement[];
121
+ };
122
+ /** Actions standard (notifications + profil) pour navbar sans titre. */
123
+ declare const DEFAULT_HEADER_ACTIONS: readonly AppHeaderActionElement[];
124
+ type HeaderProps = {
125
+ readonly options: {
126
+ title?: string;
127
+ headerBackVisible?: boolean;
128
+ };
129
+ readonly route: {
130
+ name: string;
131
+ };
132
+ readonly navigation: {
133
+ canGoBack: () => boolean;
134
+ goBack: () => void;
135
+ };
136
+ /** Flotte au-dessus du contenu (ex. carte) : fond transparent. */
137
+ readonly overlay?: boolean;
138
+ /**
139
+ * Config layout (`header.elements`) — logo / actions.
140
+ * Si fournie (même vide), le fallback titre d’écran ne s’applique pas.
141
+ */
142
+ readonly headerConfig?: AppHeaderConfig | null;
143
+ };
144
+ declare function Header({ options, route, navigation, overlay, headerConfig, }: HeaderProps): ReactNode;
145
+
93
146
  type LocationsMapProps = {
94
147
  fullScreen?: boolean;
95
148
  showFilters?: boolean;
96
- /** Header flottant au-dessus de la carte (titre + cloche + profil). */
149
+ /** Header flottant au-dessus de la carte (même navbar que le layout, sans titre). */
97
150
  overlayHeader?: boolean;
151
+ /**
152
+ * @deprecated Ignoré — la navbar n’affiche plus de titre d’écran.
153
+ * Conservé pour compatibilité des configs CMS existantes.
154
+ */
98
155
  overlayTitle?: string;
156
+ /** Override optionnel ; sinon config du layout via `HeaderConfigProvider`. */
157
+ headerConfig?: AppHeaderConfig | null;
99
158
  };
100
159
 
101
160
  /**
@@ -174,54 +233,6 @@ type SearchProps = {
174
233
  };
175
234
  declare function Search({ searchType, placeholder, }: SearchProps): ReactNode;
176
235
 
177
- type AppHeaderSlot = "left" | "center" | "right";
178
- type AppHeaderLogoElement = {
179
- id: string;
180
- type: "logo";
181
- slot: AppHeaderSlot;
182
- sourceType: "url" | "media";
183
- url?: string;
184
- mediaId?: string;
185
- };
186
- type AppHeaderTitleElement = {
187
- id: string;
188
- type: "title";
189
- slot: AppHeaderSlot;
190
- useScreenTitle?: boolean;
191
- text?: string;
192
- };
193
- type AppHeaderActionElement = {
194
- id: string;
195
- type: "action";
196
- slot: AppHeaderSlot;
197
- icon: string;
198
- label?: string;
199
- action: "navigate" | "back";
200
- href?: string;
201
- };
202
- type AppHeaderElement = AppHeaderLogoElement | AppHeaderTitleElement | AppHeaderActionElement;
203
- type AppHeaderConfig = {
204
- elements: AppHeaderElement[];
205
- };
206
- type HeaderProps = {
207
- readonly options: {
208
- title?: string;
209
- headerBackVisible?: boolean;
210
- };
211
- readonly route: {
212
- name: string;
213
- };
214
- readonly navigation: {
215
- canGoBack: () => boolean;
216
- goBack: () => void;
217
- };
218
- /** Flotte au-dessus du contenu (ex. carte) : fond transparent. */
219
- readonly overlay?: boolean;
220
- /** Config layout (`header.elements`) — logo / titre / actions. */
221
- readonly headerConfig?: AppHeaderConfig | null;
222
- };
223
- declare function Header({ options, route, navigation, overlay, headerConfig, }: HeaderProps): ReactNode;
224
-
225
236
  type BottomTabProps = BottomTabBarProps;
226
237
  declare function BottomTab({ state, descriptors, navigation, }: BottomTabProps): ReactNode;
227
238
 
@@ -390,6 +401,14 @@ type WastoProviderProps = PropsWithChildren & {
390
401
  declare function WastoProvider(props: WastoProviderProps): ReactNode;
391
402
  declare function useWasto(): WastoContextType;
392
403
 
404
+ type HeaderConfigProviderProps = {
405
+ readonly value: AppHeaderConfig | null;
406
+ readonly children: ReactNode;
407
+ };
408
+ declare function HeaderConfigProvider({ value, children, }: HeaderConfigProviderProps): ReactNode;
409
+ /** Config header du layout parent (`null` si hors provider / non défini). */
410
+ declare function useHeaderConfig(): AppHeaderConfig | null;
411
+
393
412
  type City = {
394
413
  id: string;
395
414
  name: string;
@@ -461,6 +480,16 @@ declare function useAppData(): AppDataContextType;
461
480
  /** Safe variant for hooks that may run outside (preview / tests). */
462
481
  declare function useOptionalAppData(): AppDataContextType | null;
463
482
 
483
+ type RegisterExpoPushTokenOptions = {
484
+ deviceId: string;
485
+ registerPushToken: (deviceId: string, token: string) => Promise<unknown>;
486
+ };
487
+ /**
488
+ * Request OS permission, fetch Expo push token, register it on the API.
489
+ * No-op on web, preview, missing peer, missing EAS projectId, or denied permission.
490
+ */
491
+ declare function registerExpoPushToken(options: RegisterExpoPushTokenOptions): Promise<string | null>;
492
+
464
493
  /** Shared Wasto HTTP client wired with optional API error reporting. */
465
494
  declare function useWastoClient(): WastoClient;
466
495
 
@@ -563,4 +592,4 @@ declare function useAppNavigation(): NavigationApi;
563
592
  /** Soft read — returns null when no provider (e.g. isolated component tests). */
564
593
  declare function useOptionalAppNavigation(): NavigationApi | null;
565
594
 
566
- export { type AppDataContextType, type AppHeaderActionElement, type AppHeaderConfig, type AppHeaderElement, type AppHeaderLogoElement, type AppHeaderSlot, type AppHeaderTitleElement, Article, type ArticleDisplayMode, type ArticleProps, BottomTab, type BottomTabProps, Challenge, type ChallengeProps, ChallengeVignette, type ChallengeVignetteProps, Chat, type ChatProps, CollectionCalendar, type CollectionCalendarProps, Columns, type ColumnsColumnCount, type ColumnsProps, ContentInset, type ContentInsetProps, Header, type HeaderProps, Image, type ImageProps, LocationsMap, type LocationsMapProps, MAQUETTE_COLORS, MAQUETTE_RADII, NEXT_EVENTS_DAY_RADIUS, type NavigationApi, NavigationProvider, type NavigationProviderProps, NextCollection, type NextCollectionProps, NotificationsScreen, Page, type PageProps, Paragraph, type PararaphProps, ProfileScreen, RecyclingInfo, type RecyclingInfoProps, type ResolvedTheme, SPACE, SYSTEM_ROUTES, Search, type SearchProps, type SystemRouteKey, type Theme, type ThemeShadowStyle, Title, type TitleLevel, type TitleProps, Vision, type VisionActionCardProps, type VisionCaptureResult, type VisionProps, type VisionSuggestion, type WastoContextType, type WastoErrorContext, WastoProvider, type WastoProviderProps, type WastoSentryConfig, cardStyle, coloredShadow, createMaquetteTheme, groupedSectionStyle, initWastoSentry, isWastoSentryActive, reportError, resolveTheme, softCardStyle, useAppData, useAppNavigation, useOptionalAppData, useOptionalAppNavigation, useWasto, useWastoClient, wrapWithSentry };
595
+ export { type AppDataContextType, type AppHeaderActionElement, type AppHeaderConfig, type AppHeaderElement, type AppHeaderLogoElement, type AppHeaderSlot, type AppHeaderTitleElement, Article, type ArticleDisplayMode, type ArticleProps, BottomTab, type BottomTabProps, Challenge, type ChallengeProps, ChallengeVignette, type ChallengeVignetteProps, Chat, type ChatProps, CollectionCalendar, type CollectionCalendarProps, Columns, type ColumnsColumnCount, type ColumnsProps, ContentInset, type ContentInsetProps, DEFAULT_HEADER_ACTIONS, Header, HeaderConfigProvider, type HeaderConfigProviderProps, type HeaderProps, Image, type ImageProps, LocationsMap, type LocationsMapProps, MAQUETTE_COLORS, MAQUETTE_RADII, NEXT_EVENTS_DAY_RADIUS, type NavigationApi, NavigationProvider, type NavigationProviderProps, NextCollection, type NextCollectionProps, NotificationsScreen, Page, type PageProps, Paragraph, type PararaphProps, ProfileScreen, RecyclingInfo, type RecyclingInfoProps, type RegisterExpoPushTokenOptions, type ResolvedTheme, SPACE, SYSTEM_ROUTES, Search, type SearchProps, type SystemRouteKey, type Theme, type ThemeShadowStyle, Title, type TitleLevel, type TitleProps, Vision, type VisionActionCardProps, type VisionCaptureResult, type VisionProps, type VisionSuggestion, type WastoContextType, type WastoErrorContext, WastoProvider, type WastoProviderProps, type WastoSentryConfig, cardStyle, coloredShadow, createMaquetteTheme, groupedSectionStyle, initWastoSentry, isWastoSentryActive, registerExpoPushToken, reportError, resolveTheme, softCardStyle, useAppData, useAppNavigation, useHeaderConfig, useOptionalAppData, useOptionalAppNavigation, useWasto, useWastoClient, wrapWithSentry };
package/dist/index.d.ts CHANGED
@@ -90,12 +90,71 @@ type MapLocation = {
90
90
  badges?: string[];
91
91
  };
92
92
 
93
+ type AppHeaderSlot = "left" | "center" | "right";
94
+ type AppHeaderLogoElement = {
95
+ id: string;
96
+ type: "logo";
97
+ slot: AppHeaderSlot;
98
+ sourceType: "url" | "media";
99
+ url?: string;
100
+ mediaId?: string;
101
+ };
102
+ type AppHeaderTitleElement = {
103
+ id: string;
104
+ type: "title";
105
+ slot: AppHeaderSlot;
106
+ useScreenTitle?: boolean;
107
+ text?: string;
108
+ };
109
+ type AppHeaderActionElement = {
110
+ id: string;
111
+ type: "action";
112
+ slot: AppHeaderSlot;
113
+ icon: string;
114
+ label?: string;
115
+ action: "navigate" | "back";
116
+ href?: string;
117
+ };
118
+ type AppHeaderElement = AppHeaderLogoElement | AppHeaderTitleElement | AppHeaderActionElement;
119
+ type AppHeaderConfig = {
120
+ elements: AppHeaderElement[];
121
+ };
122
+ /** Actions standard (notifications + profil) pour navbar sans titre. */
123
+ declare const DEFAULT_HEADER_ACTIONS: readonly AppHeaderActionElement[];
124
+ type HeaderProps = {
125
+ readonly options: {
126
+ title?: string;
127
+ headerBackVisible?: boolean;
128
+ };
129
+ readonly route: {
130
+ name: string;
131
+ };
132
+ readonly navigation: {
133
+ canGoBack: () => boolean;
134
+ goBack: () => void;
135
+ };
136
+ /** Flotte au-dessus du contenu (ex. carte) : fond transparent. */
137
+ readonly overlay?: boolean;
138
+ /**
139
+ * Config layout (`header.elements`) — logo / actions.
140
+ * Si fournie (même vide), le fallback titre d’écran ne s’applique pas.
141
+ */
142
+ readonly headerConfig?: AppHeaderConfig | null;
143
+ };
144
+ declare function Header({ options, route, navigation, overlay, headerConfig, }: HeaderProps): ReactNode;
145
+
93
146
  type LocationsMapProps = {
94
147
  fullScreen?: boolean;
95
148
  showFilters?: boolean;
96
- /** Header flottant au-dessus de la carte (titre + cloche + profil). */
149
+ /** Header flottant au-dessus de la carte (même navbar que le layout, sans titre). */
97
150
  overlayHeader?: boolean;
151
+ /**
152
+ * @deprecated Ignoré — la navbar n’affiche plus de titre d’écran.
153
+ * Conservé pour compatibilité des configs CMS existantes.
154
+ */
98
155
  overlayTitle?: string;
156
+ /** Override optionnel ; sinon config du layout via `HeaderConfigProvider`. */
157
+ headerConfig?: AppHeaderConfig | null;
99
158
  };
100
159
 
101
160
  /**
@@ -174,54 +233,6 @@ type SearchProps = {
174
233
  };
175
234
  declare function Search({ searchType, placeholder, }: SearchProps): ReactNode;
176
235
 
177
- type AppHeaderSlot = "left" | "center" | "right";
178
- type AppHeaderLogoElement = {
179
- id: string;
180
- type: "logo";
181
- slot: AppHeaderSlot;
182
- sourceType: "url" | "media";
183
- url?: string;
184
- mediaId?: string;
185
- };
186
- type AppHeaderTitleElement = {
187
- id: string;
188
- type: "title";
189
- slot: AppHeaderSlot;
190
- useScreenTitle?: boolean;
191
- text?: string;
192
- };
193
- type AppHeaderActionElement = {
194
- id: string;
195
- type: "action";
196
- slot: AppHeaderSlot;
197
- icon: string;
198
- label?: string;
199
- action: "navigate" | "back";
200
- href?: string;
201
- };
202
- type AppHeaderElement = AppHeaderLogoElement | AppHeaderTitleElement | AppHeaderActionElement;
203
- type AppHeaderConfig = {
204
- elements: AppHeaderElement[];
205
- };
206
- type HeaderProps = {
207
- readonly options: {
208
- title?: string;
209
- headerBackVisible?: boolean;
210
- };
211
- readonly route: {
212
- name: string;
213
- };
214
- readonly navigation: {
215
- canGoBack: () => boolean;
216
- goBack: () => void;
217
- };
218
- /** Flotte au-dessus du contenu (ex. carte) : fond transparent. */
219
- readonly overlay?: boolean;
220
- /** Config layout (`header.elements`) — logo / titre / actions. */
221
- readonly headerConfig?: AppHeaderConfig | null;
222
- };
223
- declare function Header({ options, route, navigation, overlay, headerConfig, }: HeaderProps): ReactNode;
224
-
225
236
  type BottomTabProps = BottomTabBarProps;
226
237
  declare function BottomTab({ state, descriptors, navigation, }: BottomTabProps): ReactNode;
227
238
 
@@ -390,6 +401,14 @@ type WastoProviderProps = PropsWithChildren & {
390
401
  declare function WastoProvider(props: WastoProviderProps): ReactNode;
391
402
  declare function useWasto(): WastoContextType;
392
403
 
404
+ type HeaderConfigProviderProps = {
405
+ readonly value: AppHeaderConfig | null;
406
+ readonly children: ReactNode;
407
+ };
408
+ declare function HeaderConfigProvider({ value, children, }: HeaderConfigProviderProps): ReactNode;
409
+ /** Config header du layout parent (`null` si hors provider / non défini). */
410
+ declare function useHeaderConfig(): AppHeaderConfig | null;
411
+
393
412
  type City = {
394
413
  id: string;
395
414
  name: string;
@@ -461,6 +480,16 @@ declare function useAppData(): AppDataContextType;
461
480
  /** Safe variant for hooks that may run outside (preview / tests). */
462
481
  declare function useOptionalAppData(): AppDataContextType | null;
463
482
 
483
+ type RegisterExpoPushTokenOptions = {
484
+ deviceId: string;
485
+ registerPushToken: (deviceId: string, token: string) => Promise<unknown>;
486
+ };
487
+ /**
488
+ * Request OS permission, fetch Expo push token, register it on the API.
489
+ * No-op on web, preview, missing peer, missing EAS projectId, or denied permission.
490
+ */
491
+ declare function registerExpoPushToken(options: RegisterExpoPushTokenOptions): Promise<string | null>;
492
+
464
493
  /** Shared Wasto HTTP client wired with optional API error reporting. */
465
494
  declare function useWastoClient(): WastoClient;
466
495
 
@@ -563,4 +592,4 @@ declare function useAppNavigation(): NavigationApi;
563
592
  /** Soft read — returns null when no provider (e.g. isolated component tests). */
564
593
  declare function useOptionalAppNavigation(): NavigationApi | null;
565
594
 
566
- export { type AppDataContextType, type AppHeaderActionElement, type AppHeaderConfig, type AppHeaderElement, type AppHeaderLogoElement, type AppHeaderSlot, type AppHeaderTitleElement, Article, type ArticleDisplayMode, type ArticleProps, BottomTab, type BottomTabProps, Challenge, type ChallengeProps, ChallengeVignette, type ChallengeVignetteProps, Chat, type ChatProps, CollectionCalendar, type CollectionCalendarProps, Columns, type ColumnsColumnCount, type ColumnsProps, ContentInset, type ContentInsetProps, Header, type HeaderProps, Image, type ImageProps, LocationsMap, type LocationsMapProps, MAQUETTE_COLORS, MAQUETTE_RADII, NEXT_EVENTS_DAY_RADIUS, type NavigationApi, NavigationProvider, type NavigationProviderProps, NextCollection, type NextCollectionProps, NotificationsScreen, Page, type PageProps, Paragraph, type PararaphProps, ProfileScreen, RecyclingInfo, type RecyclingInfoProps, type ResolvedTheme, SPACE, SYSTEM_ROUTES, Search, type SearchProps, type SystemRouteKey, type Theme, type ThemeShadowStyle, Title, type TitleLevel, type TitleProps, Vision, type VisionActionCardProps, type VisionCaptureResult, type VisionProps, type VisionSuggestion, type WastoContextType, type WastoErrorContext, WastoProvider, type WastoProviderProps, type WastoSentryConfig, cardStyle, coloredShadow, createMaquetteTheme, groupedSectionStyle, initWastoSentry, isWastoSentryActive, reportError, resolveTheme, softCardStyle, useAppData, useAppNavigation, useOptionalAppData, useOptionalAppNavigation, useWasto, useWastoClient, wrapWithSentry };
595
+ export { type AppDataContextType, type AppHeaderActionElement, type AppHeaderConfig, type AppHeaderElement, type AppHeaderLogoElement, type AppHeaderSlot, type AppHeaderTitleElement, Article, type ArticleDisplayMode, type ArticleProps, BottomTab, type BottomTabProps, Challenge, type ChallengeProps, ChallengeVignette, type ChallengeVignetteProps, Chat, type ChatProps, CollectionCalendar, type CollectionCalendarProps, Columns, type ColumnsColumnCount, type ColumnsProps, ContentInset, type ContentInsetProps, DEFAULT_HEADER_ACTIONS, Header, HeaderConfigProvider, type HeaderConfigProviderProps, type HeaderProps, Image, type ImageProps, LocationsMap, type LocationsMapProps, MAQUETTE_COLORS, MAQUETTE_RADII, NEXT_EVENTS_DAY_RADIUS, type NavigationApi, NavigationProvider, type NavigationProviderProps, NextCollection, type NextCollectionProps, NotificationsScreen, Page, type PageProps, Paragraph, type PararaphProps, ProfileScreen, RecyclingInfo, type RecyclingInfoProps, type RegisterExpoPushTokenOptions, type ResolvedTheme, SPACE, SYSTEM_ROUTES, Search, type SearchProps, type SystemRouteKey, type Theme, type ThemeShadowStyle, Title, type TitleLevel, type TitleProps, Vision, type VisionActionCardProps, type VisionCaptureResult, type VisionProps, type VisionSuggestion, type WastoContextType, type WastoErrorContext, WastoProvider, type WastoProviderProps, type WastoSentryConfig, cardStyle, coloredShadow, createMaquetteTheme, groupedSectionStyle, initWastoSentry, isWastoSentryActive, registerExpoPushToken, reportError, resolveTheme, softCardStyle, useAppData, useAppNavigation, useHeaderConfig, useOptionalAppData, useOptionalAppNavigation, useWasto, useWastoClient, wrapWithSentry };