citadel_cli 1.3.0 → 1.4.1
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 +116 -15
- package/dist/.vite/manifest.json +0 -4
- package/dist/citadel.css +472 -1
- package/dist/citadel.es.js +1103 -1604
- package/dist/citadel.umd.cjs +479 -0
- package/dist/citadel.umd.js +295 -837
- package/dist/components/Citadel/config/defaults.d.ts +6 -2
- package/dist/components/Citadel/config/types.d.ts +12 -4
- package/dist/components/Citadel/hooks/useGlobalShortcut.d.ts +2 -1
- package/dist/components/Citadel/hooks/useSlideAnimation.d.ts +1 -5
- package/dist/components/Citadel/types/command-dsl.d.ts +2 -1
- package/dist/components/Citadel/types/command-results.d.ts +7 -0
- package/dist/components/Citadel/utils/typography.d.ts +0 -1
- package/package.json +10 -6
|
@@ -18,7 +18,7 @@ import { CitadelConfig } from './types';
|
|
|
18
18
|
*
|
|
19
19
|
* @property fontSize - The default font size used by the interface. Default: '0.875rem'.
|
|
20
20
|
*
|
|
21
|
-
* @property initialHeight - The initial CSS height of the interface. Default: '
|
|
21
|
+
* @property initialHeight - The initial CSS height of the interface. Default: '50vh'.
|
|
22
22
|
*
|
|
23
23
|
* @property logLevel - The logging level for the Citadel interface. Default: DEBUG in development, ERROR in production.
|
|
24
24
|
*
|
|
@@ -26,13 +26,17 @@ import { CitadelConfig } from './types';
|
|
|
26
26
|
*
|
|
27
27
|
* @property minHeight - The minimum CSS height of the interface. Default: '200'.
|
|
28
28
|
*
|
|
29
|
-
* @property outputFontSize - The output font size as CSS value
|
|
29
|
+
* @property outputFontSize - The output font size as a CSS value. Default: '0.875rem'.
|
|
30
30
|
*
|
|
31
31
|
* @property resetStateOnHide - When true, hiding the interface (via Escape key or other means) will clear the command input.
|
|
32
32
|
* When false, the interface preserves the last input when hidden. Default: false.
|
|
33
33
|
*
|
|
34
|
+
* @property closeOnEscape - When true, pressing Escape hides the panel in panel mode. Default: true.
|
|
35
|
+
*
|
|
34
36
|
* @property showCitadelKey - The keyboard key that shows the command interface. Default: '.' (period).
|
|
35
37
|
*
|
|
38
|
+
* @property showOnLoad - When true, panel mode starts visible on mount. Default: false.
|
|
39
|
+
*
|
|
36
40
|
* @property storage - Configuration for command history storage. Default: { type: 'localStorage', maxCommands: 100 }.
|
|
37
41
|
*/
|
|
38
42
|
export declare const defaultConfig: CitadelConfig;
|
|
@@ -34,8 +34,7 @@ export interface CitadelConfig {
|
|
|
34
34
|
fontFamily?: string;
|
|
35
35
|
/**
|
|
36
36
|
* The default font size used by the interface.
|
|
37
|
-
* Accepts
|
|
38
|
-
* or a Tailwind text size class (e.g. 'text-sm').
|
|
37
|
+
* Accepts any valid CSS `font-size` value (e.g. '14px', '0.875rem').
|
|
39
38
|
*/
|
|
40
39
|
fontSize?: string;
|
|
41
40
|
/**
|
|
@@ -62,8 +61,7 @@ export interface CitadelConfig {
|
|
|
62
61
|
minHeight?: string;
|
|
63
62
|
/**
|
|
64
63
|
* The font size for command output text.
|
|
65
|
-
* Accepts
|
|
66
|
-
* or a Tailwind text size class (e.g. 'text-sm').
|
|
64
|
+
* Accepts any valid CSS `font-size` value (e.g. '14px', '0.875rem').
|
|
67
65
|
* If omitted, output uses `fontSize`.
|
|
68
66
|
*/
|
|
69
67
|
outputFontSize?: string;
|
|
@@ -71,10 +69,20 @@ export interface CitadelConfig {
|
|
|
71
69
|
* Whether to reset the state when the interface is hidden (via Escape key or other means).
|
|
72
70
|
*/
|
|
73
71
|
resetStateOnHide?: boolean;
|
|
72
|
+
/**
|
|
73
|
+
* Whether to keep Escape from closing the panel in `displayMode: 'panel'`.
|
|
74
|
+
* Defaults to `true`.
|
|
75
|
+
*/
|
|
76
|
+
closeOnEscape?: boolean;
|
|
74
77
|
/**
|
|
75
78
|
* The keyboard key that shows the command interface.
|
|
76
79
|
*/
|
|
77
80
|
showCitadelKey?: string;
|
|
81
|
+
/**
|
|
82
|
+
* Whether to show the panel immediately on mount when `displayMode: 'panel'`.
|
|
83
|
+
* Defaults to `false`.
|
|
84
|
+
*/
|
|
85
|
+
showOnLoad?: boolean;
|
|
78
86
|
/**
|
|
79
87
|
* Presentation mode for rendering the Citadel interface.
|
|
80
88
|
* - 'panel': Renders as an overlay panel anchored to the viewport bottom and toggled via keyboard shortcuts.
|
|
@@ -3,6 +3,7 @@ interface UseGlobalShortcutProps {
|
|
|
3
3
|
onClose: () => void;
|
|
4
4
|
isVisible: boolean;
|
|
5
5
|
showCitadelKey: string;
|
|
6
|
+
closeOnEscape: boolean;
|
|
6
7
|
}
|
|
7
|
-
export declare const useGlobalShortcut: ({ onOpen, onClose, isVisible, showCitadelKey }: UseGlobalShortcutProps) => void;
|
|
8
|
+
export declare const useGlobalShortcut: ({ onOpen, onClose, isVisible, showCitadelKey, closeOnEscape }: UseGlobalShortcutProps) => void;
|
|
8
9
|
export {};
|
|
@@ -3,12 +3,8 @@ interface SlideAnimationOptions {
|
|
|
3
3
|
isClosing: boolean;
|
|
4
4
|
onAnimationComplete?: () => void;
|
|
5
5
|
}
|
|
6
|
+
export declare const PANEL_CLOSE_DURATION_MS = 200;
|
|
6
7
|
export declare const useSlideAnimation: (options: SlideAnimationOptions) => {
|
|
7
|
-
style: {
|
|
8
|
-
opacity: number;
|
|
9
|
-
transform: string;
|
|
10
|
-
transition: string;
|
|
11
|
-
};
|
|
12
8
|
animationClass: string;
|
|
13
9
|
};
|
|
14
10
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CommandRegistry, CommandSegment } from './command-registry';
|
|
2
|
-
import { CommandResult, ErrorCommandResult, ImageCommandResult, JsonCommandResult, TextCommandResult } from './command-results';
|
|
2
|
+
import { BooleanCommandResult, CommandResult, ErrorCommandResult, ImageCommandResult, JsonCommandResult, TextCommandResult } from './command-results';
|
|
3
3
|
export interface CommandExecutionContext<ArgName extends string = string> {
|
|
4
4
|
rawArgs: string[];
|
|
5
5
|
namedArgs: Record<ArgName, string | undefined>;
|
|
@@ -27,6 +27,7 @@ export declare function registerCommand(registry: CommandRegistry, definition: C
|
|
|
27
27
|
export declare function registerCommands(registry: CommandRegistry, definitions: CommandDefinition[]): CommandRegistry;
|
|
28
28
|
export declare function createCommandRegistry(definitions: CommandDefinition[]): CommandRegistry;
|
|
29
29
|
export declare function text(value: string): TextCommandResult;
|
|
30
|
+
export declare function bool(value: boolean, trueText?: string, falseText?: string): BooleanCommandResult;
|
|
30
31
|
export declare function json(value: unknown): JsonCommandResult;
|
|
31
32
|
export declare function image(url: string, altText?: string): ImageCommandResult;
|
|
32
33
|
export declare function error(value: string): ErrorCommandResult;
|
|
@@ -25,6 +25,13 @@ export declare class TextCommandResult extends CommandResult {
|
|
|
25
25
|
constructor(text: string, timestamp?: number);
|
|
26
26
|
render(): React.ReactNode;
|
|
27
27
|
}
|
|
28
|
+
export declare class BooleanCommandResult extends CommandResult {
|
|
29
|
+
readonly value: boolean;
|
|
30
|
+
readonly trueText: string;
|
|
31
|
+
readonly falseText: string;
|
|
32
|
+
constructor(value: boolean, trueText?: string, falseText?: string, timestamp?: number);
|
|
33
|
+
render(): React.ReactNode;
|
|
34
|
+
}
|
|
28
35
|
export declare class ErrorCommandResult extends CommandResult {
|
|
29
36
|
readonly error: string;
|
|
30
37
|
constructor(error: string, timestamp?: number);
|
package/package.json
CHANGED
|
@@ -17,10 +17,11 @@
|
|
|
17
17
|
"type": "git",
|
|
18
18
|
"url": "git+https://github.com/jchilders/citadel_cli.git"
|
|
19
19
|
},
|
|
20
|
-
"version": "1.
|
|
20
|
+
"version": "1.4.1",
|
|
21
21
|
"type": "module",
|
|
22
22
|
"scripts": {
|
|
23
|
-
"build": "tsc && vite build",
|
|
23
|
+
"build": "tsc && vite build && node scripts/sync-package-artifacts.mjs",
|
|
24
|
+
"verify:pack": "node scripts/verify-package-artifacts.mjs",
|
|
24
25
|
"dev": "vite",
|
|
25
26
|
"lint": "eslint .",
|
|
26
27
|
"lint:fix": "eslint . --fix",
|
|
@@ -30,6 +31,11 @@
|
|
|
30
31
|
"test:e2e": "playwright test",
|
|
31
32
|
"test:e2e:ui": "playwright test --ui",
|
|
32
33
|
"coverage": "vitest run --coverage",
|
|
34
|
+
"metrics:build": "node scripts/metrics/collect-build-metrics.mjs",
|
|
35
|
+
"metrics:runtime": "node scripts/metrics/collect-runtime-metrics.mjs",
|
|
36
|
+
"metrics:compare": "node scripts/metrics/compare-metrics.mjs",
|
|
37
|
+
"metrics:all": "node scripts/metrics/run-all-metrics.mjs",
|
|
38
|
+
"metrics:report": "node scripts/metrics/run-all-metrics.mjs --skip-build --skip-runtime",
|
|
33
39
|
"postinstall": "playwright install"
|
|
34
40
|
},
|
|
35
41
|
"exports": {
|
|
@@ -39,7 +45,7 @@
|
|
|
39
45
|
"import": "./dist/citadel.es.js",
|
|
40
46
|
"require": "./dist/citadel.umd.cjs"
|
|
41
47
|
},
|
|
42
|
-
"./styles.css": "./dist/
|
|
48
|
+
"./styles.css": "./dist/citadel.css",
|
|
43
49
|
"./citadel.css": "./dist/citadel.css"
|
|
44
50
|
},
|
|
45
51
|
"types": "./dist/index.d.ts",
|
|
@@ -65,15 +71,13 @@
|
|
|
65
71
|
"@types/react-dom": "^18.2.21",
|
|
66
72
|
"@vitejs/plugin-react": "^4.3.3",
|
|
67
73
|
"@vitest/coverage-v8": "^2.1.6",
|
|
68
|
-
"autoprefixer": "^10.4.20",
|
|
69
74
|
"eslint": "^9.13.0",
|
|
70
75
|
"eslint-plugin-react-hooks": "^5.0.0",
|
|
76
|
+
"eslint-plugin-react-perf": "^3.3.3",
|
|
71
77
|
"eslint-plugin-react-refresh": "^0.4.14",
|
|
72
78
|
"globals": "^15.11.0",
|
|
73
79
|
"jsdom": "^25.0.1",
|
|
74
80
|
"playwright": "^1.49.0",
|
|
75
|
-
"postcss": "^8.4.49",
|
|
76
|
-
"tailwindcss": "^3.4.17",
|
|
77
81
|
"typescript": "^5.4.2",
|
|
78
82
|
"typescript-eslint": "^8.11.0",
|
|
79
83
|
"vite": "^5.1.5",
|