@corto-ai/gds-angular 2.1.7-dev.2 → 2.1.7-dev.4

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@corto-ai/gds-angular",
3
- "version": "2.1.7-dev.2",
4
- "devVersion": "2",
3
+ "version": "2.1.7-dev.4",
4
+ "devVersion": "4",
5
5
  "exports": {
6
6
  "./assets/*": "./assets/*",
7
7
  "./package.json": {
@@ -1145,6 +1145,8 @@ type GdsToastConfig = {
1145
1145
  disableTimeOut?: boolean;
1146
1146
  tapToDismiss?: boolean;
1147
1147
  positionClass?: string;
1148
+ /** Show a native notification instead of a toast, when the app supports it. */
1149
+ preferNativeNotification?: boolean;
1148
1150
  };
1149
1151
  type GdsToastGlobalConfig = GdsToastConfig & {
1150
1152
  preventDuplicates?: boolean;
@@ -1163,8 +1165,19 @@ type GdsToastInstance = {
1163
1165
  message: string;
1164
1166
  options: GdsToastConfig;
1165
1167
  };
1168
+ /** Implemented by apps that can surface native (e.g. PWA/OS) notifications instead of an in-app toast. */
1169
+ interface GdsNativeNotificationProvider {
1170
+ canNotify(): boolean;
1171
+ createNotification(params: {
1172
+ title?: string;
1173
+ message: string;
1174
+ }): {
1175
+ onClick: Observable<void>;
1176
+ };
1177
+ }
1166
1178
  declare const GDS_TOASTER_CONFIG: InjectionToken<Required<GdsToastGlobalConfig>>;
1167
1179
  declare const GDS_TOAST_CONTAINER: InjectionToken<Type<unknown>>;
1180
+ declare const GDS_NATIVE_NOTIFICATION_PROVIDER: InjectionToken<GdsNativeNotificationProvider>;
1168
1181
 
1169
1182
  declare class GdsToastComponent {
1170
1183
  #private;
@@ -1186,7 +1199,11 @@ declare class GdsToastComponent {
1186
1199
  }
1187
1200
 
1188
1201
  declare const DEFAULT_CONFIG: Required<GdsToastGlobalConfig>;
1189
- declare const provideToaster: (customOptions?: Partial<GdsToastGlobalConfig>) => EnvironmentProviders;
1202
+ /**
1203
+ * @param nativeNotificationProvider An existing injectable (e.g. a PWA service) that `ToastrService` will use to show a
1204
+ * native notification instead of a toast when `preferNativeNotification` is set and `canNotify()` returns true.
1205
+ */
1206
+ declare const provideToaster: (customOptions?: Partial<GdsToastGlobalConfig>, nativeNotificationProvider?: Type<GdsNativeNotificationProvider>) => EnvironmentProviders;
1190
1207
 
1191
1208
  declare class ToastrService {
1192
1209
  #private;
@@ -1199,6 +1216,12 @@ declare class ToastrService {
1199
1216
  show: (message?: string, title?: string, override?: Partial<GdsToastConfig>) => GdsActiveToast;
1200
1217
  clear: (toastId?: number) => void;
1201
1218
  remove: (toastId: number) => void;
1219
+ /** Updates the content/options of a visible toast in place. No-op if the toast has been removed. */
1220
+ update: (toastId: number, changes: {
1221
+ message?: string;
1222
+ title?: string;
1223
+ options?: Partial<GdsToastConfig>;
1224
+ }) => void;
1202
1225
  triggerAction: (toastId: number, event?: unknown) => void;
1203
1226
  /** Clears the auto-dismiss timer (e.g. while the pointer is over the toast). */
1204
1227
  pauseTimeout: (toastId: number) => void;
@@ -1284,7 +1307,7 @@ declare class TreeViewListItemDirective {
1284
1307
 
1285
1308
  interface GdsUserPromptVM {
1286
1309
  title: string;
1287
- description: string | TemplateRef<unknown>;
1310
+ description: string | (() => string) | TemplateRef<unknown>;
1288
1311
  primaryLabel: string;
1289
1312
  primaryDisabled?: boolean | (() => boolean);
1290
1313
  secondaryLabel: string;
@@ -1296,7 +1319,7 @@ type GdsUserPromptOptions = Partial<Omit<GdsUserPromptVM, 'description' | 'title
1296
1319
 
1297
1320
  declare class GdsUserPromptService {
1298
1321
  #private;
1299
- confirm(description: string | TemplateRef<unknown>, title: string, options?: GdsUserPromptOptions): Observable<boolean>;
1322
+ confirm(description: string | (() => string) | TemplateRef<unknown>, title: string, options?: GdsUserPromptOptions): Observable<boolean>;
1300
1323
  info(description: string, title: string, options?: GdsUserPromptOptions): Observable<boolean>;
1301
1324
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<GdsUserPromptService, never>;
1302
1325
  static ɵprov: _angular_core.ɵɵInjectableDeclaration<any>;
@@ -1678,5 +1701,5 @@ declare class GdsModule {
1678
1701
  static ɵinj: _angular_core.ɵɵInjectorDeclaration<GdsModule>;
1679
1702
  }
1680
1703
 
1681
- export { BrandEnum, CDN_URL, CONTACT_INITIALS_REGEX, DEFAULT_CONFIG, GDS_BRANDS, GDS_EMPTY_STATE_VARIANTS, GDS_TOASTER_CONFIG, GDS_TOAST_CONTAINER, GdsAccountingService, GdsAutoRoundCurrencyDirective, GdsAutofocusDirective, GdsAvatarComponent, GdsBadgeColorType, GdsBadgeComponent, GdsBadgeVariantType, GdsBannerComponent, GdsBoldTextHighlightPipe, GdsBreadcrumbsComponent, GdsBuildOptionConfigPipe, GdsButtonComponent, GdsButtonRadioOptionComponent, GdsChatExpandableListComponent, GdsChatPromptComponent, GdsChatSuggestionComponent, GdsCheckboxComponent, GdsChipColorsMap, GdsChipComponent, GdsCollapsibleAsideLayoutComponent, GdsCompositeOptionPrimaryDirective, GdsCompositeOptionSecondaryDirective, GdsContextMenuHeadingComponent, GdsContextMenuItemComponent, GdsContextMenuItemVariantEnum, GdsContextMenuSwitchComponent, GdsDateInputComponent, GdsDatePipe, GdsDialogBaseDirective, GdsDialogComponent, GdsDialogOverlayComponent, GdsDialogService, GdsDoctypeService, GdsDoctypeToIconPipe, GdsDocumentItemComponent, GdsDrilldownSelectComponent, GdsDropdownComponent, GdsEmptyStateComponent, GdsFeatureBlockComponent, GdsFeedbackButtonComponent, GdsFileUploadComponent, GdsFilenameToIconPipe, GdsFilterChipComponent, GdsFocusOnInitDirective, GdsFormControlComponent, GdsHistoryComponent, GdsIconButtonComponent, GdsIconComponent, GdsIconDoctypeComponent, GdsIconService, GdsInputAutocompleteDirective, GdsItemDisplayComponent, GdsKeyboardNavigationHost, GdsKeyboardNavigationItem, GdsListboxCompositeOptionDirective, GdsListboxDirective, GdsListboxOptionDirective, GdsLoadingCarouselComponent, GdsMapArrayToRadioOptionsPipe, GdsMathFloorPipe, GdsMathMaxPipe, GdsMathMinPipe, GdsMessageInputComponent, GdsModule, GdsNativeInputDirective, GdsNativeTextareaDirective, GdsNavAsideComponent, GdsNavAsideItemComponent, GdsNestedSelectComponent, GdsPageSelectorComponent, GdsProgressBarComponent, GdsRadioComponent, GdsRadioOptionDirective, GdsReferenceComponent, GdsReferenceLinkComponent, GdsRegexFilterDirective, GdsResizedDirective, GdsResizedEvent, GdsResponseComponent, GdsScrollOutOfViewDirective, GdsScrollOutOfViewScrollStatus, GdsScrollOutOfViewService, GdsScrollToBottomDirective, GdsScrollToFirstInvalidDirective, GdsSearchBarComponent, GdsSelectComponent, GdsSelectOnFocusDirective, GdsSidebarItemBodyComponent, GdsSidebarItemComponent, GdsSkeletonLoadingComponent, GdsSliderComponent, GdsSpinnerComponent, GdsSplitButtonComponent, GdsSvgIconPipe, GdsSwitchComponent, GdsTextInputComponent, GdsTextareaComponent, GdsTimelineItemComponent, GdsToastComponent, GdsTooltipComponent, GdsTreeViewListItemComponent, GdsUserPromptService, GdsVirtualScrollListboxDirective, MapperPipe, OnBrandChanged, RoundMode, ToastrService, TreeViewListItemDirective, chipColor, chipSize, chipTypes, chipWidth, formatToISO, gdsButtonSizes, gdsButtonVariants, gdsDropdownPositionsX, gdsDropdownPositionsY, gdsSelectWidths, gdsServices, gdsUserPromptSecondaryTextVariants, getIconsByPrefix, isGdsBrand, ngSelectDropdownPositions, parseLocalizedDate, provideToaster, shortDate, shortDateTime, transformDateFormat, transformDurationToSeconds, transformSecondsToDuration };
1682
- export type { FeatureDescriptionConfigVM, GdsActiveToast, GdsAvatarOrganizationType, GdsAvatarSize, GdsAvatarVariant, GdsBannerState, GdsBrand, GdsBreadCrumbSize, GdsBreadCrumbVM, GdsButtonSharedCssProperties, GdsButtonSharedProperties, GdsButtonSharedSlotProperties, GdsButtonSize, GdsButtonVariant, GdsChipColor, GdsChipColorType, GdsChipSize, GdsChipTypes, GdsChipWidth, GdsContextMenuItemVariantType, GdsDrilldownSelectLayout, GdsDropdownPositionX, GdsDropdownPositionY, GdsEmptyStateSize, GdsEmptyStateVariant, GdsNativeRadioProps, GdsRadioOption, GdsRadioOptionConfig, GdsScrollOutOfViewScrollStatusType, GdsSelectWidth, GdsTimelineConnectorType, GdsToastConfig, GdsToastConfigPayload, GdsToastGlobalConfig, GdsToastInstance, GdsToastStatus, GdsToastType, GdsUserPromptSecondaryTextVariant, HistoryItemVM };
1704
+ export { BrandEnum, CDN_URL, CONTACT_INITIALS_REGEX, DEFAULT_CONFIG, GDS_BRANDS, GDS_EMPTY_STATE_VARIANTS, GDS_NATIVE_NOTIFICATION_PROVIDER, GDS_TOASTER_CONFIG, GDS_TOAST_CONTAINER, GdsAccountingService, GdsAutoRoundCurrencyDirective, GdsAutofocusDirective, GdsAvatarComponent, GdsBadgeColorType, GdsBadgeComponent, GdsBadgeVariantType, GdsBannerComponent, GdsBoldTextHighlightPipe, GdsBreadcrumbsComponent, GdsBuildOptionConfigPipe, GdsButtonComponent, GdsButtonRadioOptionComponent, GdsChatExpandableListComponent, GdsChatPromptComponent, GdsChatSuggestionComponent, GdsCheckboxComponent, GdsChipColorsMap, GdsChipComponent, GdsCollapsibleAsideLayoutComponent, GdsCompositeOptionPrimaryDirective, GdsCompositeOptionSecondaryDirective, GdsContextMenuHeadingComponent, GdsContextMenuItemComponent, GdsContextMenuItemVariantEnum, GdsContextMenuSwitchComponent, GdsDateInputComponent, GdsDatePipe, GdsDialogBaseDirective, GdsDialogComponent, GdsDialogOverlayComponent, GdsDialogService, GdsDoctypeService, GdsDoctypeToIconPipe, GdsDocumentItemComponent, GdsDrilldownSelectComponent, GdsDropdownComponent, GdsEmptyStateComponent, GdsFeatureBlockComponent, GdsFeedbackButtonComponent, GdsFileUploadComponent, GdsFilenameToIconPipe, GdsFilterChipComponent, GdsFocusOnInitDirective, GdsFormControlComponent, GdsHistoryComponent, GdsIconButtonComponent, GdsIconComponent, GdsIconDoctypeComponent, GdsIconService, GdsInputAutocompleteDirective, GdsItemDisplayComponent, GdsKeyboardNavigationHost, GdsKeyboardNavigationItem, GdsListboxCompositeOptionDirective, GdsListboxDirective, GdsListboxOptionDirective, GdsLoadingCarouselComponent, GdsMapArrayToRadioOptionsPipe, GdsMathFloorPipe, GdsMathMaxPipe, GdsMathMinPipe, GdsMessageInputComponent, GdsModule, GdsNativeInputDirective, GdsNativeTextareaDirective, GdsNavAsideComponent, GdsNavAsideItemComponent, GdsNestedSelectComponent, GdsPageSelectorComponent, GdsProgressBarComponent, GdsRadioComponent, GdsRadioOptionDirective, GdsReferenceComponent, GdsReferenceLinkComponent, GdsRegexFilterDirective, GdsResizedDirective, GdsResizedEvent, GdsResponseComponent, GdsScrollOutOfViewDirective, GdsScrollOutOfViewScrollStatus, GdsScrollOutOfViewService, GdsScrollToBottomDirective, GdsScrollToFirstInvalidDirective, GdsSearchBarComponent, GdsSelectComponent, GdsSelectOnFocusDirective, GdsSidebarItemBodyComponent, GdsSidebarItemComponent, GdsSkeletonLoadingComponent, GdsSliderComponent, GdsSpinnerComponent, GdsSplitButtonComponent, GdsSvgIconPipe, GdsSwitchComponent, GdsTextInputComponent, GdsTextareaComponent, GdsTimelineItemComponent, GdsToastComponent, GdsTooltipComponent, GdsTreeViewListItemComponent, GdsUserPromptService, GdsVirtualScrollListboxDirective, MapperPipe, OnBrandChanged, RoundMode, ToastrService, TreeViewListItemDirective, chipColor, chipSize, chipTypes, chipWidth, formatToISO, gdsButtonSizes, gdsButtonVariants, gdsDropdownPositionsX, gdsDropdownPositionsY, gdsSelectWidths, gdsServices, gdsUserPromptSecondaryTextVariants, getIconsByPrefix, isGdsBrand, ngSelectDropdownPositions, parseLocalizedDate, provideToaster, shortDate, shortDateTime, transformDateFormat, transformDurationToSeconds, transformSecondsToDuration };
1705
+ export type { FeatureDescriptionConfigVM, GdsActiveToast, GdsAvatarOrganizationType, GdsAvatarSize, GdsAvatarVariant, GdsBannerState, GdsBrand, GdsBreadCrumbSize, GdsBreadCrumbVM, GdsButtonSharedCssProperties, GdsButtonSharedProperties, GdsButtonSharedSlotProperties, GdsButtonSize, GdsButtonVariant, GdsChipColor, GdsChipColorType, GdsChipSize, GdsChipTypes, GdsChipWidth, GdsContextMenuItemVariantType, GdsDrilldownSelectLayout, GdsDropdownPositionX, GdsDropdownPositionY, GdsEmptyStateSize, GdsEmptyStateVariant, GdsNativeNotificationProvider, GdsNativeRadioProps, GdsRadioOption, GdsRadioOptionConfig, GdsScrollOutOfViewScrollStatusType, GdsSelectWidth, GdsTimelineConnectorType, GdsToastConfig, GdsToastConfigPayload, GdsToastGlobalConfig, GdsToastInstance, GdsToastStatus, GdsToastType, GdsUserPromptSecondaryTextVariant, HistoryItemVM };