@moyarich/console-addon-navigation 0.1.0 → 0.2.0

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 CHANGED
@@ -2,12 +2,18 @@
2
2
 
3
3
  Navigate errors and warnings. Jump between visible errors and warnings, or annotated messages when annotations are enabled.
4
4
 
5
+ [Documentation and live examples](https://moyarich.github.io/console/)
6
+
5
7
  ## Install
6
8
 
7
9
  ```bash
8
10
  npm install @moyarich/console @moyarich/console-addon-navigation
9
11
  ```
10
12
 
13
+ Configure the `@moyarich` scope and authenticate with GitHub Packages as described in the [installation guide](../../../README.md#installation).
14
+
15
+ Required peer dependencies: `@moyarich/console-core@^0.2.0`.
16
+
11
17
  ## Quick start
12
18
 
13
19
  ```tsx
@@ -0,0 +1,41 @@
1
+ import { type ConsoleAddon, type ConsoleDataService, type ConsoleViewportService } from "@moyarich/console-core";
2
+ export declare const CONSOLE_NAVIGATION_ADDON_ID = "@moyarich/console-addon-navigation";
3
+ export type ConsoleNavigationKind = "error" | "warning" | "annotated";
4
+ export type ConsoleNavigationDirection = "next" | "previous";
5
+ export type ConsoleNavigationBoundary = "start" | "end" | null;
6
+ export interface ConsoleNavigationState {
7
+ readonly currentTargetId?: string;
8
+ readonly kind?: ConsoleNavigationKind;
9
+ readonly boundary: ConsoleNavigationBoundary;
10
+ }
11
+ export interface ConsoleNavigationController {
12
+ getState(): ConsoleNavigationState;
13
+ subscribe(listener: () => void): () => void;
14
+ jumpToMessage(id: string): boolean;
15
+ navigate(kind: ConsoleNavigationKind, direction: ConsoleNavigationDirection): string | undefined;
16
+ nextError(): string | undefined;
17
+ previousError(): string | undefined;
18
+ nextWarning(): string | undefined;
19
+ previousWarning(): string | undefined;
20
+ nextAnnotated(): string | undefined;
21
+ previousAnnotated(): string | undefined;
22
+ reset(): void;
23
+ }
24
+ export interface ConsoleNavigationAddonOptions {
25
+ keyboardShortcuts?: boolean;
26
+ }
27
+ export interface ConsoleNavigationAddon extends ConsoleAddon {
28
+ readonly controller: ConsoleNavigationController;
29
+ }
30
+ interface ConsoleAnnotationsLookup {
31
+ getAnnotatedMessageIds(): readonly string[];
32
+ }
33
+ export declare const consoleNavigationService: import("@moyarich/console-core").ConsoleServiceToken<ConsoleNavigationController>;
34
+ interface ConsoleNavigationDependencies {
35
+ getData(): ConsoleDataService | undefined;
36
+ getViewport(): ConsoleViewportService | undefined;
37
+ getAnnotations(): ConsoleAnnotationsLookup | undefined;
38
+ }
39
+ export declare function createConsoleNavigationController(dependencies: ConsoleNavigationDependencies): ConsoleNavigationController;
40
+ export declare function createConsoleNavigationAddon(options?: ConsoleNavigationAddonOptions): ConsoleNavigationAddon;
41
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moyarich/console-addon-navigation",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "First-party stable-ID message navigation for @moyarich/console hosts.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -9,10 +9,14 @@
9
9
  "types": "./dist/index.d.ts",
10
10
  "exports": {
11
11
  ".": {
12
- "development": "./src/index.ts",
13
- "types": "./dist/index.d.ts",
14
- "import": "./dist/index.js",
15
- "require": "./dist/index.cjs"
12
+ "import": {
13
+ "types": "./dist/index.d.ts",
14
+ "default": "./dist/index.js"
15
+ },
16
+ "require": {
17
+ "types": "./dist/index.d.cts",
18
+ "default": "./dist/index.cjs"
19
+ }
16
20
  }
17
21
  },
18
22
  "files": [
@@ -22,14 +26,14 @@
22
26
  "registry": "https://npm.pkg.github.com"
23
27
  },
24
28
  "scripts": {
25
- "build": "vite build && tsc -p tsconfig.build.json",
29
+ "build": "vite build && tsc -p tsconfig.build.json && node ../../../scripts/prepare-cjs-types.mjs",
26
30
  "typecheck": "tsc --noEmit"
27
31
  },
28
32
  "peerDependencies": {
29
- "@moyarich/console-core": "^0.1.0"
33
+ "@moyarich/console-core": "^0.2.0"
30
34
  },
31
35
  "devDependencies": {
32
- "@moyarich/console-core": "0.1.0",
36
+ "@moyarich/console-core": "0.2.0",
33
37
  "typescript": "^5.9.2",
34
38
  "vite": "^7.1.5"
35
39
  },
@@ -52,5 +56,8 @@
52
56
  ],
53
57
  "publisher": "moyarich",
54
58
  "author": "Moya Richards",
59
+ "engines": {
60
+ "node": ">=24"
61
+ },
55
62
  "private": false
56
63
  }