nexus-shell 0.1.16 โ†’ 0.1.18

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 (2) hide show
  1. package/README.md +89 -190
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,16 +1,63 @@
1
- # Nexus-Shell Framework
1
+ # ๐Ÿš€ Nexus Shell Framework
2
2
 
3
- Nexus-Shell is a professional-grade, library-first frontend framework for building "Workbench" style applications (like VS Code or JupyterLab). Built with **React 19**, **TypeScript**, and **FlexLayout**, it provides a modular foundation for complex, multi-panel web tools.
3
+ [![npm version](https://img.shields.io/npm/v/nexus-shell.svg)](https://www.npmjs.com/package/nexus-shell)
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5
+ [![Build & Deploy Storybook](https://github.com/techmuch/nexus-shell/actions/workflows/deploy-storybook.yml/badge.svg)](https://github.com/techmuch/nexus-shell/actions/workflows/deploy-storybook.yml)
6
+ [![Live Documentation](https://img.shields.io/badge/docs-live--pages-blueviolet)](https://techmuch.github.io/nexus-shell/?path=/docs/introduction--docs)
7
+
8
+ Nexus Shell is a professional-grade, library-first React 19 / TypeScript frontend framework for building multi-panel **"Workbench"** style applications (resembling VS Code, JupyterLab, or specialized dashboard workstations).
9
+
10
+ Instead of building a rigid layout from scratch, Nexus Shell provides a **fully decoupled, registry-driven workspace engine** powered by `flexlayout-react`, allowing tabs, menus, hotkeys, status bars, and custom sidebars to be dynamically declared and contextually composed.
11
+
12
+ ---
13
+
14
+ ## ๐Ÿ“– Live Interactive Documentation
15
+ Explore the live documentation, interactive component playground, prop definitions, and layout compositions at:
16
+ ๐Ÿ‘‰ **[Live Storybook Documentation Site](https://techmuch.github.io/nexus-shell/?path=/docs/introduction--docs)**
17
+
18
+ ---
19
+
20
+ ## ๐ŸŽจ Visual Showcase & Capabilities
21
+
22
+ ### 1. Tabbed Dialogue Mapping Workbench & Workspace
23
+ A flexible workstation that integrates Compendium-style visual argumentation mapping (React Flow canvas) with external node libraries and logic inspectors as drag-and-drop tabs.
24
+ ![Dialogue Mapping Workbench (Dark Theme)](docs/images/dialogue-mapper-library-dark.png)
25
+ *(Above: Dialogue Mapping workspace in Dark Theme showing interactive nodes, custom icons, and Straight connectors)*
26
+
27
+ ### 2. Georgia Tech Theme & Theme-Adaptivity
28
+ Fully responsive styling driven by HSL CSS variables, conforming to WCAG contrast standards.
29
+ ![Dialogue Mapping Workbench (GT Theme)](docs/images/dialogue-mapper-library-light.png)
30
+ *(Above: Light Theme workspace showing responsive menus, active tab headers, and the account widget)*
31
+
32
+ ### 3. Workflow Reviews & Mockup Canvas Overlay
33
+ Draw overlay annotations directly onto child mockups and generate implementation plans dynamically using AI nodes.
34
+ ![Mockup Reviewer Layout](docs/images/mockup-reviewer-layout.png)
35
+ *(Above: A complex Mockup Reviewer workstation running canvas drawing tools and terminal consoles side-by-side)*
36
+
37
+ ### 4. Interactive Storybook Workspace
38
+ Reorganized story taxonomy allowing you to build, test, and preview widgets in isolation or combined.
39
+ ![Storybook Taxonomy](docs/images/media__storybook_layout.png)
40
+
41
+ ---
42
+
43
+ ## ๐Ÿค” Why Choose Nexus Shell?
44
+
45
+ | If you are building... | Nexus Shell provides... |
46
+ | :--- | :--- |
47
+ | **IDE/Workbench Web Apps** | A complete drag-and-drop tab layout engine with splits, resizing, and sidebars (`flexlayout-react` integration). |
48
+ | **Modular Dashboard Interfaces** | Inversion of Control registries (`componentRegistry`, `commandRegistry`, `menuRegistry`) so features register themselves dynamically. |
49
+ | **Complex Geospatial/Tactical Maps** | High-performance maps (`WargameMap`) combining `react-map-gl`, `deck.gl`, and `h3-js` for hexagonal grid overlays and MIL-STD military icons. |
50
+ | **AI Orchestration Workbenches** | State-driven workflow templates, agent nodes, and drawing canvas mockups built with React Flow. |
51
+
52
+ ---
4
53
 
5
54
  ## โœจ Key Features
6
55
 
7
- - **Advanced Tab Docking:** Complete drag-and-drop window management with splits, tabs, and sidebars.
8
- - **Modular Registry System:** Decouple commands, menus, and plugins from the core UI.
9
- - **Persistence:** Automatic workspace restoration via `localStorage`.
10
- - **Command Palette:** `Ctrl+Shift+P` searchable command interface.
11
- - **Theming:** First-class support for Light, Dark, and custom themes (includes a Georgia Tech theme), optimized for high accessibility and reduced eye strain.
12
- - **Accessible Components:** Input fields and buttons follow strict UI/UX guidelines for contrast, sizing, and focus states.
13
- - **Library Ready:** ESM and UMD bundles with full TypeScript type definitions.
56
+ - **Advanced Docking Engine**: Full drag-and-drop tab management (dock, split, float, collapse) out-of-the-box.
57
+ - **Inversion of Control (IoC) Registries**: Add new menu items, hotkeys, or tab contents programmatically from anywhere in your code without touching the layout container.
58
+ - **Zustand State Persistence**: Automatically restores the user's workspace structure, theme preference, and pane configurations across page reloads.
59
+ - **Accessibility & Contrast First**: Built to look beautiful and professional under three default themes (`theme-light`, `theme-dark`, and `theme-gt` for Georgia Tech fans) while satisfying AA/AAA color contrast ratios.
60
+ - **Pre-Integrated Widgets**: A library of reusable layout widgets including terminal consoles, chat panels, tree file explorers, virtualized grids, and hex maps.
14
61
 
15
62
  ---
16
63
 
@@ -24,225 +71,77 @@ npm install nexus-shell
24
71
 
25
72
  ### 2. Basic Setup
26
73
 
27
- In your main entry point (e.g., `App.tsx`):
74
+ In your main entry point (e.g., `main.tsx` or `App.tsx`):
28
75
 
29
76
  ```tsx
77
+ import React from 'react';
78
+ import ReactDOM from 'react-dom/client';
30
79
  import { ShellLayout, initializeShell } from 'nexus-shell';
31
- import 'nexus-shell/style.css';
80
+ import 'nexus-shell/style.css'; // Essential styling properties
32
81
 
33
- // Initialize core shell services
82
+ // Initialize core registries and default welcome workspace
34
83
  initializeShell();
35
84
 
36
85
  export default function App() {
37
86
  return (
38
- <div className="h-screen w-screen">
39
- <ShellLayout />
87
+ <div className="h-screen w-screen bg-background text-foreground">
88
+ <ShellLayout
89
+ title={<div className="font-bold text-lg">My Custom IDE</div>}
90
+ />
40
91
  </div>
41
92
  );
42
93
  }
94
+
95
+ ReactDOM.createRoot(document.getElementById('root')!).render(<App />);
43
96
  ```
44
97
 
45
98
  ---
46
99
 
47
- ## ๐Ÿ— Core Concepts
48
-
49
- ### 1. Registries (The Brains)
50
- Nexus-Shell uses registries to manage global state without component coupling.
100
+ ## ๐Ÿ— Registry-Driven Customization
51
101
 
52
- - **`commandRegistry`**: Register global actions with IDs, labels, and optional keybindings.
53
- - **`menuRegistry`**: Map commands to the top Menu Bar.
54
- - **`pluginRegistry`**: Manage the lifecycle (`activate`/`deactivate`) of modular features.
102
+ Nexus Shell lets you register custom features dynamically:
55
103
 
56
- ### 2. Commands & Menus
104
+ ### Register a Keyboard Shortcut (Command)
57
105
  ```typescript
58
- import { commandRegistry, menuRegistry } from 'nexus-shell';
106
+ import { commandRegistry } from 'nexus-shell';
59
107
 
60
- // Register a command
61
108
  commandRegistry.registerCommand({
62
109
  id: 'my-app.hello',
63
110
  label: 'Say Hello',
64
111
  keybinding: 'Control+L',
65
- execute: () => alert('Hello World!'),
66
- });
67
-
68
- // Add it to the Help menu
69
- menuRegistry.registerMenu('Help', {
70
- id: 'help.hello',
71
- label: 'Say Hello',
72
- commandId: 'my-app.hello',
112
+ execute: () => alert('Hello from Nexus Shell!'),
73
113
  });
74
114
  ```
75
115
 
76
- ### 3. Layout Management
77
- The layout is powered by `flexlayout-react`. You can dynamically add tabs from anywhere in your app:
78
-
79
- ```typescript
80
- import { useLayoutStore } from 'nexus-shell';
81
-
82
- const addMyTab = () => {
83
- useLayoutStore.getState().addTab('my-component', 'My Tab Title');
84
- };
85
- ```
86
-
87
- ---
88
-
89
- ## ๐Ÿ›  Step-by-Step: Creating a Custom Application
90
-
91
- Follow these steps to build a feature-rich application using Nexus-Shell:
92
-
93
- ### Step 1: Initialize the Shell
94
- Call `initializeShell()` before your app renders. This sets up the default "Welcome" tab, core menus, and global keyboard listeners.
95
-
96
- ### Step 2: Define your Components
97
- Create React components that you want to appear as tabs. You must register these in the `factory` of the `ShellLayout` or provide a custom factory.
98
-
99
- ### Step 3: Register Commands and Menus
100
- Define the actions your users can take. By using `commandRegistry`, your actions automatically show up in the **Command Palette** (`Ctrl+Shift+P`) and can be triggered by **Keyboard Shortcuts**.
101
-
102
- ### Step 4: Implement Plugins
103
- For larger apps, encapsulate features into Plugins:
104
- ```typescript
105
- import { IPlugin, commandRegistry } from 'nexus-shell';
106
-
107
- export const MyFeaturePlugin: IPlugin = {
108
- id: 'my-feature',
109
- name: 'My Feature',
110
- activate: () => {
111
- // Register commands, menus, and sidebars here
112
- },
113
- deactivate: () => {
114
- // Cleanup
115
- }
116
- };
117
- ```
118
-
119
- ### Step 5: Choose a Theme
120
- Users can switch themes in the Settings sidebar. You can also set the theme programmatically:
116
+ ### Register a Tab Component
121
117
  ```typescript
122
- import { useThemeStore } from 'nexus-shell';
123
-
124
- useThemeStore.getState().setTheme('gt'); // Go Jackets!
118
+ import { componentRegistry } from 'nexus-shell';
119
+
120
+ componentRegistry.register('my-custom-widget', () => (
121
+ <div className="p-4 bg-card text-card-foreground">
122
+ <h2>Dynamic Custom Tab</h2>
123
+ <p>This tab can be docked anywhere in the workspace!</p>
124
+ </div>
125
+ ));
125
126
  ```
126
127
 
127
128
  ---
128
129
 
129
- ## ๐ŸŽจ Customization API
130
-
131
- Nexus-Shell is highly configurable via props on the `ShellLayout` component. This allows you to repurpose the workbench for different application needs.
132
-
133
- ### 1. Menu Bar Configuration (`menuConfig`)
134
- Define hierarchical menus with nested submenus and commands.
135
- ```tsx
136
- const myMenus = {
137
- 'File': [
138
- { id: 'new', label: 'New File', commandId: 'nexus.new-tab' },
139
- { id: 'recent', label: 'Open Recent', submenu: [
140
- { id: 'r1', label: 'Project Alpha' },
141
- { id: 'r2', label: 'Project Beta' }
142
- ]}
143
- ]
144
- };
145
- ```
146
-
147
- ### 2. Status Bar Widgets (`statusBarConfig`)
148
- Add info widgets to the bottom bar with specific alignments.
149
- ```tsx
150
- const myStatusBar = [
151
- { id: 'info', label: 'System OK', alignment: 'left', icon: Activity },
152
- { id: 'v', label: 'v1.0.0', alignment: 'center' },
153
- { id: 'user', label: 'Admin', alignment: 'right', onClick: () => alert('Admin Clicked') }
154
- ];
155
- ```
156
-
157
- ### 3. Sidebar Panels (`panels`)
158
- Inject custom tools into the left Activity Bar.
159
- ```tsx
160
- const myPanels = [
161
- { id: 'home', label: 'Home', icon: Home, component: MyHomeComponent },
162
- { id: 'db', label: 'Database', icon: Database, component: <DbExplorer /> }
163
- ];
164
- ```
165
-
166
- ### 4. Chat Slash Commands (`slashCommands`)
167
- Extend the chat interface with custom functional commands.
168
- ```tsx
169
- const myChatCommands = [
170
- { command: 'ping', description: 'Test latency', execute: () => console.log('Pong!') },
171
- { command: 'clear', description: 'Reset chat', execute: (args) => resetLogic() }
172
- ];
173
- ```
174
-
175
- ### 5. Search Integration (`SearchWidget`)
176
- A reusable component for implementing project-wide search.
177
- ```tsx
178
- <SearchWidget
179
- placeholder="Filter objects..."
180
- onSearch={(query) => doFilter(query)}
181
- results={filteredResults}
182
- suggestions={['recent-1.txt', 'recent-2.txt']}
183
- onSelect={(result) => openItem(result)}
184
- loading={isSearching}
185
- />
186
- ```
187
-
188
- ### 6. AI Agent Management (`AgentManager`)
189
- A visually rich component for defining and orchestrating LLM agents using React Flow.
190
- ```tsx
191
- <AgentManager
192
- agents={agentList}
193
- onFetchAgents={fetchAgents}
194
- onSaveAgent={saveAgent}
195
- onDeleteAgent={deleteAgent}
196
- title="My Agents"
197
- subtitle="Manage and visually build your custom AI workflows"
198
- />
199
- ```
200
-
201
- ### 7. Geospatial & Wargaming Analytics (`WargameMap`)
202
- A high-performance mapping component combining `react-map-gl`, `deck.gl`, and `milsymbol` for interactive wargaming, modeling, and simulation. Features H3 hex grids, attack vectors, and dynamically generated NATO military icons.
203
- ```tsx
204
- <WargameMap
205
- units={mockUnits}
206
- attacks={mockAttacks}
207
- terrainHexes={terrainHexes}
208
- mapStyle="https://basemaps.cartocdn.com/gl/positron-gl-style/style.json"
209
- />
210
- ```
211
-
212
- **Usage Example:**
213
- ```tsx
214
- <ShellLayout
215
- menuConfig={myMenus}
216
- statusBarConfig={myStatusBar}
217
- panels={myPanels}
218
- slashCommands={myChatCommands}
219
- />
220
- ```
130
+ ## ๐Ÿงช Development & Testing
221
131
 
222
- ---
132
+ ```bash
133
+ # Start Vite App & local Storybook server
134
+ npm run dev:all
223
135
 
224
- ## ๐Ÿ“‚ Project Structure (Library)
136
+ # Build package artifacts (ESM, UMD, CSS, and Types)
137
+ npm run build
225
138
 
226
- ```text
227
- /dist <-- Compiled library artifacts (ESM, UMD, CSS, Types)
228
- /src
229
- /components <-- UI Components (Layout, Widgets)
230
- /core
231
- /registry <-- Registry logic (Commands, Menus, Plugins)
232
- /services <-- State Management (Zustand)
233
- /index.ts <-- Public API Entry Point
139
+ # Run Playwright E2E and Visual Regression tests
140
+ npx playwright test
234
141
  ```
235
142
 
236
143
  ---
237
144
 
238
- ## ๐Ÿงช Development & Testing
239
-
240
- - **Run Dev App:** `npm run dev`
241
- - **Build Library:** `npm run build`
242
- - **Run Tests:** `npx playwright test`
243
-
244
- ---
245
-
246
145
  ## ๐Ÿ“„ License
247
146
 
248
147
  MIT ยฉ [David/TechMuch]
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "nexus-shell",
3
3
  "private": false,
4
- "version": "0.1.16",
4
+ "version": "0.1.18",
5
5
  "type": "module",
6
6
  "main": "./dist/nexus-shell.umd.js",
7
7
  "module": "./dist/nexus-shell.es.js",