inspector-ng 0.0.7 → 0.0.9
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/README.md +15 -28
- package/esm2022/lib/checkpoint-search.mjs +50 -0
- package/esm2022/lib/checkpoints.mjs +254 -198
- package/esm2022/lib/inspector.component.mjs +199 -20
- package/esm2022/public-api.mjs +2 -2
- package/fesm2022/inspector-ng.mjs +502 -218
- package/fesm2022/inspector-ng.mjs.map +1 -1
- package/lib/checkpoint-search.d.ts +3 -0
- package/lib/checkpoints.d.ts +46 -46
- package/lib/inspector.component.d.ts +29 -8
- package/package.json +2 -1
- package/public-api.d.ts +1 -1
package/lib/checkpoints.d.ts
CHANGED
|
@@ -1,58 +1,58 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { EnvironmentProviders, InjectionToken } from '@angular/core';
|
|
2
2
|
import { Router } from '@angular/router';
|
|
3
|
-
import {
|
|
3
|
+
import { ActionReducer, Store } from '@ngrx/store';
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
|
-
export
|
|
6
|
-
[key: string]: InspectorCheckpointValue;
|
|
7
|
-
};
|
|
8
|
-
export interface InspectorCheckpointAdapter {
|
|
9
|
-
id: string;
|
|
10
|
-
capture(): InspectorCheckpointValue | Promise<InspectorCheckpointValue>;
|
|
11
|
-
restore(value: InspectorCheckpointValue): void | Promise<void>;
|
|
12
|
-
}
|
|
13
|
-
export interface InspectorCheckpoint {
|
|
5
|
+
export interface InspectorCheckpointRecord {
|
|
14
6
|
version: 1;
|
|
15
7
|
id: string;
|
|
16
8
|
name: string;
|
|
17
|
-
|
|
9
|
+
route: string;
|
|
18
10
|
createdAt: string;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
11
|
+
state: unknown;
|
|
12
|
+
}
|
|
13
|
+
export declare const INSPECTOR_CHECKPOINT_REPOSITORY: InjectionToken<InspectorCheckpointRepository>;
|
|
14
|
+
export declare function inspectorCheckpointMetaReducer<T>(reducer: ActionReducer<T>): ActionReducer<T>;
|
|
15
|
+
export declare abstract class InspectorCheckpointRepository {
|
|
16
|
+
abstract list(): Promise<InspectorCheckpointRecord[]>;
|
|
17
|
+
abstract put(checkpoint: InspectorCheckpointRecord): Promise<void>;
|
|
18
|
+
abstract delete(id: string): Promise<void>;
|
|
19
|
+
}
|
|
20
|
+
export declare class IndexedDbCheckpointRepository extends InspectorCheckpointRepository {
|
|
21
|
+
private readonly platformId;
|
|
22
|
+
private databasePromise;
|
|
23
|
+
constructor(platformId: object);
|
|
24
|
+
list(): Promise<InspectorCheckpointRecord[]>;
|
|
25
|
+
put(checkpoint: InspectorCheckpointRecord): Promise<void>;
|
|
26
|
+
delete(id: string): Promise<void>;
|
|
27
|
+
private database;
|
|
28
|
+
private request;
|
|
29
|
+
private transactionComplete;
|
|
30
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<IndexedDbCheckpointRepository, never>;
|
|
31
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<IndexedDbCheckpointRepository>;
|
|
22
32
|
}
|
|
23
|
-
export
|
|
24
|
-
|
|
33
|
+
export declare class InspectorCheckpointService {
|
|
34
|
+
private readonly repository;
|
|
35
|
+
private readonly store;
|
|
25
36
|
private readonly router;
|
|
26
|
-
readonly
|
|
27
|
-
readonly
|
|
37
|
+
private readonly platformId;
|
|
38
|
+
readonly checkpoints: import("@angular/core").WritableSignal<InspectorCheckpointRecord[]>;
|
|
39
|
+
readonly loading: import("@angular/core").WritableSignal<boolean>;
|
|
40
|
+
readonly busy: import("@angular/core").WritableSignal<boolean>;
|
|
28
41
|
readonly error: import("@angular/core").WritableSignal<string | null>;
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
private readonly remoteLoaders;
|
|
33
|
-
private readonly isBrowser;
|
|
34
|
-
constructor(platformId: object, router: Router);
|
|
35
|
-
register(adapter: InspectorCheckpointAdapter): () => void;
|
|
36
|
-
registerRemoteScope(scope: string, loader: InspectorCheckpointRemoteLoader): () => void;
|
|
37
|
-
save(name?: string): Promise<InspectorCheckpoint | null>;
|
|
42
|
+
constructor(repository: InspectorCheckpointRepository, store: Store | null, router: Router | null, platformId: object);
|
|
43
|
+
load(): Promise<void>;
|
|
44
|
+
save(): Promise<InspectorCheckpointRecord | null>;
|
|
38
45
|
restore(id: string): Promise<boolean>;
|
|
39
|
-
rename(id: string, name: string):
|
|
40
|
-
delete(id: string):
|
|
41
|
-
|
|
42
|
-
private
|
|
43
|
-
private
|
|
44
|
-
private
|
|
45
|
-
private
|
|
46
|
-
private nextAutomaticName;
|
|
47
|
-
private normalizeLegacyNames;
|
|
48
|
-
private isLegacyAutomaticName;
|
|
49
|
-
private createId;
|
|
50
|
-
private sizeOf;
|
|
51
|
-
private isQuotaError;
|
|
46
|
+
rename(id: string, name: string): Promise<boolean>;
|
|
47
|
+
delete(id: string): Promise<boolean>;
|
|
48
|
+
clearError(): void;
|
|
49
|
+
private currentRoute;
|
|
50
|
+
private currentPathname;
|
|
51
|
+
private missingStoreMessage;
|
|
52
|
+
private storageMessage;
|
|
52
53
|
private messageFor;
|
|
53
|
-
|
|
54
|
-
static
|
|
55
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<InspectorCheckpointRegistry>;
|
|
54
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<InspectorCheckpointService, [null, { optional: true; }, { optional: true; }, null]>;
|
|
55
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<InspectorCheckpointService>;
|
|
56
56
|
}
|
|
57
|
-
export declare function provideInspectorCheckpoints():
|
|
58
|
-
export declare function
|
|
57
|
+
export declare function provideInspectorCheckpoints(): EnvironmentProviders;
|
|
58
|
+
export declare function nextAutomaticName(route: string, names: string[]): string;
|
|
@@ -1,19 +1,28 @@
|
|
|
1
1
|
import { ElementRef, OnDestroy } from '@angular/core';
|
|
2
2
|
import { DistanceOverlay, Guide, GuideOrientation, InspectMeasurement, Rect, TextBlockAnnotation, ToolMode } from './types';
|
|
3
|
-
import {
|
|
3
|
+
import { InspectorCheckpointRecord, InspectorCheckpointService } from './checkpoints';
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
5
|
export declare class inspectorComponent implements OnDestroy {
|
|
6
6
|
readonly Math: Math;
|
|
7
7
|
readonly formatValue: (value: number) => number;
|
|
8
8
|
readonly guideHitboxSize = 14;
|
|
9
9
|
readonly overlayRoot: import("@angular/core").Signal<ElementRef<HTMLElement> | undefined>;
|
|
10
|
+
readonly checkpointDialog: import("@angular/core").Signal<ElementRef<HTMLDialogElement> | undefined>;
|
|
11
|
+
readonly checkpointSearch: import("@angular/core").Signal<ElementRef<HTMLInputElement> | undefined>;
|
|
10
12
|
highlightColor: string;
|
|
11
13
|
guideColor: string;
|
|
12
14
|
hoverHighlightEnabled: boolean;
|
|
13
15
|
persistOnReload: boolean;
|
|
14
|
-
readonly
|
|
15
|
-
readonly
|
|
16
|
+
readonly checkpointService: InspectorCheckpointService | null;
|
|
17
|
+
readonly commandBarOpen: import("@angular/core").WritableSignal<boolean>;
|
|
18
|
+
readonly checkpointQuery: import("@angular/core").WritableSignal<string>;
|
|
19
|
+
readonly activeCheckpointIndex: import("@angular/core").WritableSignal<number>;
|
|
16
20
|
readonly editingCheckpointId: import("@angular/core").WritableSignal<string | null>;
|
|
21
|
+
readonly deletingCheckpointId: import("@angular/core").WritableSignal<string | null>;
|
|
22
|
+
readonly renameDraft: import("@angular/core").WritableSignal<string>;
|
|
23
|
+
readonly checkpointToast: import("@angular/core").WritableSignal<string | null>;
|
|
24
|
+
readonly checkpointToastIsError: import("@angular/core").WritableSignal<boolean>;
|
|
25
|
+
readonly filteredCheckpoints: import("@angular/core").Signal<InspectorCheckpointRecord[]>;
|
|
17
26
|
readonly enabled: import("@angular/core").WritableSignal<boolean>;
|
|
18
27
|
readonly toolMode: import("@angular/core").WritableSignal<ToolMode>;
|
|
19
28
|
readonly guideOrientation: import("@angular/core").WritableSignal<GuideOrientation>;
|
|
@@ -35,6 +44,7 @@ export declare class inspectorComponent implements OnDestroy {
|
|
|
35
44
|
private draggingGuideId;
|
|
36
45
|
private selectedElement;
|
|
37
46
|
private hoverElement;
|
|
47
|
+
private toastTimer;
|
|
38
48
|
readonly canUndo: import("@angular/core").Signal<boolean>;
|
|
39
49
|
readonly canRedo: import("@angular/core").Signal<boolean>;
|
|
40
50
|
constructor(platformId: object);
|
|
@@ -44,14 +54,21 @@ export declare class inspectorComponent implements OnDestroy {
|
|
|
44
54
|
setGuideOrientation(orientation: GuideOrientation): void;
|
|
45
55
|
activateGuideOrientation(orientation: GuideOrientation): void;
|
|
46
56
|
toggleTypography(): void;
|
|
47
|
-
toggleCheckpoints(): void;
|
|
48
57
|
disableInspector(): void;
|
|
49
58
|
saveCheckpoint(): Promise<void>;
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
59
|
+
openCheckpointCommandBar(): Promise<void>;
|
|
60
|
+
closeCheckpointCommandBar(): void;
|
|
61
|
+
updateCheckpointQuery(event: Event): void;
|
|
62
|
+
setActiveCheckpoint(index: number): void;
|
|
63
|
+
restoreCheckpoint(checkpoint: InspectorCheckpointRecord): Promise<void>;
|
|
64
|
+
beginRename(checkpoint: InspectorCheckpointRecord, event?: Event): void;
|
|
65
|
+
updateRenameDraft(event: Event): void;
|
|
66
|
+
finishRename(checkpoint: InspectorCheckpointRecord): Promise<void>;
|
|
54
67
|
cancelRename(): void;
|
|
68
|
+
beginDelete(checkpoint: InspectorCheckpointRecord, event?: Event): void;
|
|
69
|
+
cancelDelete(event?: Event): void;
|
|
70
|
+
confirmDelete(checkpoint: InspectorCheckpointRecord, event?: Event): Promise<void>;
|
|
71
|
+
handleCheckpointDialogClick(event: MouseEvent): void;
|
|
55
72
|
clearGuides(): void;
|
|
56
73
|
trackGuide: (_index: number, guide: Guide) => string;
|
|
57
74
|
trackTextBlock: (_index: number, block: TextBlockAnnotation) => string;
|
|
@@ -67,6 +84,10 @@ export declare class inspectorComponent implements OnDestroy {
|
|
|
67
84
|
handleViewportChange(): void;
|
|
68
85
|
private canInspectClick;
|
|
69
86
|
private setInspectorEnabled;
|
|
87
|
+
private handleCommandBarKeydown;
|
|
88
|
+
private clampActiveCheckpoint;
|
|
89
|
+
private scrollActiveCheckpointIntoView;
|
|
90
|
+
private showCheckpointToast;
|
|
70
91
|
private selectElementAtPoint;
|
|
71
92
|
private updateDistanceOverlay;
|
|
72
93
|
private refreshTypographyBlocks;
|
package/package.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "inspector-ng",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.9",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@angular/common": "^17.3.0",
|
|
6
6
|
"@angular/core": "^17.3.0",
|
|
7
7
|
"@angular/router": "^17.3.0",
|
|
8
|
+
"@ngrx/store": "^17.2.0",
|
|
8
9
|
"rxjs": "^7.8.0"
|
|
9
10
|
},
|
|
10
11
|
"dependencies": {
|
package/public-api.d.ts
CHANGED