@coolon/angular-ui-powerups 16.1.0-alpha.301 → 16.1.0-alpha.302
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/esm2022/lib/components/commands/group/popup-menu/popup-menu-renderer/popup-menu-renderer.component.mjs +5 -2
- package/esm2022/lib/interaction/abstract-interaction-context.mjs +12 -2
- package/esm2022/lib/interaction/activity-cancellation.mjs +25 -0
- package/esm2022/lib/interaction/activity-ref.mjs +3 -2
- package/esm2022/lib/interaction/components/activity-triggers/abstract-activity-trigger.component.mjs +3 -2
- package/esm2022/lib/interaction/directives/interaction-context-trigger-for.directive.mjs +3 -2
- package/esm2022/lib/interaction/exports.mjs +2 -1
- package/esm2022/lib/services/exports.mjs +2 -1
- package/esm2022/lib/services/quiet-rejections.mjs +87 -0
- package/fesm2022/coolon-angular-ui-powerups.mjs +128 -8
- package/fesm2022/coolon-angular-ui-powerups.mjs.map +1 -1
- package/lib/interaction/abstract-interaction-context.d.ts +4 -0
- package/lib/interaction/activity-cancellation.d.ts +13 -0
- package/lib/interaction/exports.d.ts +1 -0
- package/lib/services/exports.d.ts +1 -0
- package/lib/services/quiet-rejections.d.ts +38 -0
- package/package.json +2 -2
|
@@ -12,6 +12,10 @@ export declare abstract class AbstractInteractionContext implements InteractionC
|
|
|
12
12
|
protected abstract createAndLaunchActivity<D, R, E>(activityType: Constructable<Activity<D, R, E>>, data: D, options?: InteractionContext.Options): Promise<R>;
|
|
13
13
|
startActivity<D, R, E>(activityType: Constructable<Activity<D, R, E>>, data?: D, options?: InteractionContext.Options): Promise<R>;
|
|
14
14
|
confirm(confirm: Confirm): Promise<boolean>;
|
|
15
|
+
/**
|
|
16
|
+
* Resolves however the alert closes — OK, Esc, the backdrop, or a teardown such as sign-out: it is
|
|
17
|
+
* only ever acknowledged, so the code after it always runs. A real failure still rejects.
|
|
18
|
+
*/
|
|
15
19
|
alert(alert: Alert): Promise<void>;
|
|
16
20
|
confirmOrReject(confirm: Confirm): Promise<void>;
|
|
17
21
|
/**
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An activity cancelled without an error of its own — Esc, the backdrop, a Cancel button, a teardown —
|
|
3
|
+
* rejects with a handled AbortError (pectin's `Rejection.aborted`): the code awaiting it stops, and
|
|
4
|
+
* nobody sees an error. An activity cancelled with an error rejects with that error, as before.
|
|
5
|
+
*/
|
|
6
|
+
export declare namespace ActivityCancellation {
|
|
7
|
+
/** The reason a plainly cancelled activity rejects with. */
|
|
8
|
+
function reason(): Error;
|
|
9
|
+
/** Whether [rejection] is a plain cancel, rather than a cancel with an error of its own. */
|
|
10
|
+
function isCancellation(rejection: unknown): boolean;
|
|
11
|
+
/** For cancel events, which report a plain cancel as undefined: the event payload for [rejection]. */
|
|
12
|
+
function eventPayload<E>(rejection: unknown): E | undefined;
|
|
13
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ErrorHandler, InjectionToken, Provider } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
/**
|
|
4
|
+
* Keeps handled rejections out of the console, and lets everything else through.
|
|
5
|
+
*
|
|
6
|
+
* A rejection marked handled (pectin's `Rejection`) has already been dealt with — a cancelled dialog,
|
|
7
|
+
* a refused request whose handler showed its message, a transport error the app reported — so the
|
|
8
|
+
* code that awaited it just stops. Without this, each one surfaces as an "Uncaught (in promise)"
|
|
9
|
+
* error. Anything not marked is reported as before, so real bugs stay visible.
|
|
10
|
+
*
|
|
11
|
+
* Works with zone.js, which hands an unhandled rejection to Angular's ErrorHandler wrapped in an Error
|
|
12
|
+
* carrying the original as `rejection`, and without it, where the browser raises an
|
|
13
|
+
* `unhandledrejection` event (and Angular 20's global error listeners forward the raw reason).
|
|
14
|
+
*
|
|
15
|
+
* Turn on `?traceRejections` (or localStorage `aup.traceRejections=true`, or `{trace: true}`) to log
|
|
16
|
+
* the quiet ones with their stack at debug level — for when something stops and the console is silent.
|
|
17
|
+
*/
|
|
18
|
+
export declare function provideQuietRejections(options?: QuietRejections.Options): Provider[];
|
|
19
|
+
export declare namespace QuietRejections {
|
|
20
|
+
interface Options {
|
|
21
|
+
/** Log the quiet rejections at debug level. Defaults to the `traceRejections` flag. */
|
|
22
|
+
trace?: boolean;
|
|
23
|
+
}
|
|
24
|
+
const OPTIONS: InjectionToken<Options>;
|
|
25
|
+
/** What was rejected: zone.js wraps an unhandled rejection in an Error carrying it as `rejection`. */
|
|
26
|
+
function reasonOf(error: unknown): unknown;
|
|
27
|
+
/** Whether the page asked for quiet rejections to be traced. */
|
|
28
|
+
function traceRequested(): boolean;
|
|
29
|
+
/** Without zone.js the browser reports unhandled rejections itself; keep it quiet about handled ones. */
|
|
30
|
+
function listenForUnhandledRejections(): void;
|
|
31
|
+
}
|
|
32
|
+
export declare class QuietRejectionsErrorHandler extends ErrorHandler {
|
|
33
|
+
private readonly trace;
|
|
34
|
+
constructor(options?: QuietRejections.Options);
|
|
35
|
+
handleError(error: unknown): void;
|
|
36
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<QuietRejectionsErrorHandler, [{ optional: true; }]>;
|
|
37
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<QuietRejectionsErrorHandler>;
|
|
38
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coolon/angular-ui-powerups",
|
|
3
|
-
"version": "16.1.0-alpha.
|
|
3
|
+
"version": "16.1.0-alpha.302",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@angular/animations": "^16.2.9",
|
|
6
6
|
"@angular/common": "^16.2.9",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"@angular/platform-browser-dynamic": "^16.2.9",
|
|
13
13
|
"@angular/material-moment-adapter": "^16.2.10",
|
|
14
14
|
"@angular/router": "^16.2.9",
|
|
15
|
-
"@coolon/pectin": "^5.0.0-alpha.
|
|
15
|
+
"@coolon/pectin": "^5.0.0-alpha.144",
|
|
16
16
|
"fast-typescript-memoize": "^1.1.1",
|
|
17
17
|
"lodash-es": "^4.17.21",
|
|
18
18
|
"marked": "4.0.10",
|