@cuby-ui/core 0.0.479 → 0.0.481

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.
Files changed (36) hide show
  1. package/esm2022/index.mjs +2 -1
  2. package/esm2022/interceptors/error-handler.interceptor.mjs +6 -2
  3. package/esm2022/interfaces/error-notification-service.mjs +2 -0
  4. package/esm2022/interfaces/error-stategy.mjs +2 -0
  5. package/esm2022/interfaces/index.mjs +3 -1
  6. package/esm2022/operators/handle-error.mjs +12 -0
  7. package/esm2022/operators/index.mjs +2 -0
  8. package/esm2022/providers/error-handler.options.mjs +2 -0
  9. package/esm2022/providers/error-handler.provider.mjs +23 -0
  10. package/esm2022/providers/index.mjs +2 -1
  11. package/esm2022/services/error-resolver-factory.service.mjs +75 -0
  12. package/esm2022/services/global-handler-error.service.mjs +26 -0
  13. package/esm2022/services/index.mjs +2 -1
  14. package/esm2022/tokens/error-notification-service.mjs +15 -0
  15. package/esm2022/tokens/error-translation-prefix.mjs +6 -0
  16. package/esm2022/tokens/index.mjs +3 -1
  17. package/esm2022/widgets/ui/index.mjs +2 -1
  18. package/fesm2022/cuby-ui-core.mjs +150 -6
  19. package/fesm2022/cuby-ui-core.mjs.map +1 -1
  20. package/index.d.ts +1 -0
  21. package/interfaces/error-notification-service.d.ts +3 -0
  22. package/interfaces/error-stategy.d.ts +3 -0
  23. package/interfaces/index.d.ts +2 -0
  24. package/operators/handle-error.d.ts +2 -0
  25. package/operators/index.d.ts +1 -0
  26. package/package.json +4 -4
  27. package/providers/error-handler.options.d.ts +6 -0
  28. package/providers/error-handler.provider.d.ts +3 -0
  29. package/providers/index.d.ts +2 -0
  30. package/services/error-resolver-factory.service.d.ts +10 -0
  31. package/services/global-handler-error.service.d.ts +10 -0
  32. package/services/index.d.ts +1 -0
  33. package/tokens/error-notification-service.d.ts +3 -0
  34. package/tokens/error-translation-prefix.d.ts +2 -0
  35. package/tokens/index.d.ts +2 -0
  36. package/widgets/ui/index.d.ts +1 -0
package/index.d.ts CHANGED
@@ -8,3 +8,4 @@ export * from './types';
8
8
  export * from './utils';
9
9
  export * from './providers';
10
10
  export * from './widgets';
11
+ export * from './operators';
@@ -0,0 +1,3 @@
1
+ export interface CuiErrorNotificationService {
2
+ showError(message: string, options?: Record<string, unknown>): void;
3
+ }
@@ -0,0 +1,3 @@
1
+ export interface ErrorStrategy {
2
+ getMessage(error: unknown): string;
3
+ }
@@ -1,3 +1,5 @@
1
1
  export * from './context-menu-item';
2
2
  export * from './image';
3
3
  export * from './option';
4
+ export * from './error-stategy';
5
+ export * from './error-notification-service';
@@ -0,0 +1,2 @@
1
+ import type { OperatorFunction } from 'rxjs';
2
+ export declare function handleError<T, R>(handler: (error: unknown) => R, useDefaultError?: boolean): OperatorFunction<T, R | T>;
@@ -0,0 +1 @@
1
+ export { handleError } from './handle-error';
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@cuby-ui/core",
3
- "version": "0.0.479",
3
+ "version": "0.0.481",
4
4
  "peerDependencies": {
5
5
  "@angular/common": ">=18.0.0",
6
6
  "@angular/core": ">=18.0.0",
7
7
  "@angular/elements": ">=18.0.0",
8
8
  "@angular/forms": ">=18.0.0",
9
- "@cuby-ui/api": "^0.0.479",
10
- "@cuby-ui/cdk": "^0.0.479",
11
- "@cuby-ui/icons": "^0.0.479",
9
+ "@cuby-ui/api": "^0.0.481",
10
+ "@cuby-ui/cdk": "^0.0.481",
11
+ "@cuby-ui/icons": "^0.0.481",
12
12
  "@editorjs/editorjs": "2.29.1",
13
13
  "@editorjs/header": "^2.8.1",
14
14
  "@editorjs/list": "^1.9.0",
@@ -0,0 +1,6 @@
1
+ import type { Type } from '@angular/core';
2
+ import type { CuiErrorNotificationService } from '../interfaces/error-notification-service';
3
+ export interface CuiErrorHandlerProviderConfig {
4
+ readonly errorNotificationService?: Type<CuiErrorNotificationService>;
5
+ readonly translationPrefix?: string;
6
+ }
@@ -0,0 +1,3 @@
1
+ import { type Provider } from '@angular/core';
2
+ import type { CuiErrorHandlerProviderConfig } from './error-handler.options';
3
+ export declare function provideCuiErrorHandler({ errorNotificationService, translationPrefix }?: CuiErrorHandlerProviderConfig): Provider[];
@@ -1,2 +1,4 @@
1
1
  export { CuiAuthConfig, CuiAuthPlatform, CuiAuthService } from './auth.options';
2
2
  export { provideCuiAuth } from './auth.provider';
3
+ export { CuiErrorHandlerProviderConfig } from './error-handler.options';
4
+ export { provideCuiErrorHandler } from './error-handler.provider';
@@ -0,0 +1,10 @@
1
+ import type { ErrorStrategy } from '../interfaces';
2
+ import * as i0 from "@angular/core";
3
+ export declare class CuiErrorResolverFactory {
4
+ private readonly nullErrorStrategy;
5
+ private readonly httpErrorStrategy;
6
+ private readonly defaultErrorStrategy;
7
+ getErrorStrategy(error: unknown): ErrorStrategy;
8
+ static ɵfac: i0.ɵɵFactoryDeclaration<CuiErrorResolverFactory, never>;
9
+ static ɵprov: i0.ɵɵInjectableDeclaration<CuiErrorResolverFactory>;
10
+ }
@@ -0,0 +1,10 @@
1
+ import type { ErrorHandler } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ export declare class CuiGlobalErrorHandler implements ErrorHandler {
4
+ private readonly errorNotificationService;
5
+ private readonly cuiErrorResolverFactory;
6
+ handleError(error: unknown): void;
7
+ private getErrorMessage;
8
+ static ɵfac: i0.ɵɵFactoryDeclaration<CuiGlobalErrorHandler, never>;
9
+ static ɵprov: i0.ɵɵInjectableDeclaration<CuiGlobalErrorHandler>;
10
+ }
@@ -6,3 +6,4 @@ export * from './loader.service';
6
6
  export * from './visual-viewport.service';
7
7
  export * from './auth.service';
8
8
  export * from './token.options';
9
+ export * from './global-handler-error.service';
@@ -0,0 +1,3 @@
1
+ import { InjectionToken } from '@angular/core';
2
+ import type { CuiErrorNotificationService } from '../interfaces/error-notification-service';
3
+ export declare const CUI_ERROR_NOTIFICATION_SERVICE: InjectionToken<CuiErrorNotificationService>;
@@ -0,0 +1,2 @@
1
+ import { InjectionToken } from '@angular/core';
2
+ export declare const CUI_ERROR_TRANSLATION_PREFIX: InjectionToken<string>;
package/tokens/index.d.ts CHANGED
@@ -1,3 +1,5 @@
1
1
  export * from './animations-speed';
2
2
  export * from './reduced-motion';
3
3
  export * from './viewport';
4
+ export * from './error-notification-service';
5
+ export * from './error-translation-prefix';
@@ -26,3 +26,4 @@ export * from './resources-block';
26
26
  export * from './utility-info-readonly';
27
27
  export * from './inserted';
28
28
  export * from './instruction-readonly-info';
29
+ export * from './button-change-theme';