@qodalis/react-cli 2.0.0-beta.2 → 2.0.0-beta.20

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/dist/index.mjs ADDED
@@ -0,0 +1,479 @@
1
+ // src/Cli.tsx
2
+ import { useRef as useRef2, useEffect as useEffect2 } from "react";
3
+ import { resolveCliHostConfig } from "@qodalis/cli";
4
+
5
+ // src/CliContext.tsx
6
+ import { createContext, useContext } from "react";
7
+ var CliContext = createContext({ engine: null });
8
+ function useCli() {
9
+ return useContext(CliContext);
10
+ }
11
+
12
+ // src/CliConfigContext.tsx
13
+ import { createContext as createContext2, useContext as useContext2 } from "react";
14
+ import { jsx } from "react/jsx-runtime";
15
+ var CliConfigCtx = createContext2({});
16
+ function useCliConfig() {
17
+ return useContext2(CliConfigCtx);
18
+ }
19
+ function CliConfigProvider({
20
+ modules,
21
+ processors,
22
+ options,
23
+ services,
24
+ children
25
+ }) {
26
+ return /* @__PURE__ */ jsx(CliConfigCtx.Provider, { value: { modules, processors, options, services }, children });
27
+ }
28
+
29
+ // src/useCliEngine.ts
30
+ import { useRef, useEffect, useState } from "react";
31
+ import { createCliEngine } from "@qodalis/cli";
32
+ function useCliEngine(containerRef, config) {
33
+ const [engine, setEngine] = useState(null);
34
+ const engineRef = useRef(null);
35
+ const initTimerRef = useRef(null);
36
+ useEffect(() => {
37
+ if (config?.disabled || !containerRef.current) return;
38
+ const container = containerRef.current;
39
+ initTimerRef.current = setTimeout(() => {
40
+ initTimerRef.current = null;
41
+ if (!container) return;
42
+ const e = createCliEngine(container, { ...config, framework: "React" });
43
+ engineRef.current = e;
44
+ e.start().then(() => setEngine(e));
45
+ }, 0);
46
+ return () => {
47
+ if (initTimerRef.current !== null) {
48
+ clearTimeout(initTimerRef.current);
49
+ initTimerRef.current = null;
50
+ return;
51
+ }
52
+ if (engineRef.current) {
53
+ engineRef.current.destroy();
54
+ engineRef.current = null;
55
+ setEngine(null);
56
+ }
57
+ };
58
+ }, []);
59
+ return engine;
60
+ }
61
+
62
+ // src/Cli.tsx
63
+ import { Fragment, jsx as jsx2 } from "react/jsx-runtime";
64
+ function Cli({
65
+ modules,
66
+ processors,
67
+ options,
68
+ services,
69
+ snapshot,
70
+ onReady,
71
+ style,
72
+ className
73
+ }) {
74
+ const ctx = useCli();
75
+ const config = useCliConfig();
76
+ const containerRef = useRef2(null);
77
+ const hasProvider = !!ctx.engine;
78
+ const standaloneEngine = useCliEngine(containerRef, {
79
+ ...resolveCliHostConfig({ modules, processors, options, services }, config),
80
+ snapshot,
81
+ disabled: hasProvider
82
+ });
83
+ const engine = ctx.engine ?? standaloneEngine;
84
+ useEffect2(() => {
85
+ if (engine && onReady) {
86
+ onReady(engine);
87
+ }
88
+ }, [engine, onReady]);
89
+ if (hasProvider) {
90
+ return /* @__PURE__ */ jsx2(Fragment, {});
91
+ }
92
+ return /* @__PURE__ */ jsx2(
93
+ "div",
94
+ {
95
+ ref: containerRef,
96
+ style: { height: "100%", ...style },
97
+ className
98
+ }
99
+ );
100
+ }
101
+
102
+ // src/CliPanel.tsx
103
+ import React3, { useEffect as useEffect3, useLayoutEffect, useState as useState2, useSyncExternalStore } from "react";
104
+ import {
105
+ CliPanelController,
106
+ CLOSE_GLYPH,
107
+ CLOSE_ICON,
108
+ HIDE_ICON,
109
+ HIDE_TAB_TERMINAL_ICON,
110
+ MAXIMIZE_ICON,
111
+ PANEL_LABELS,
112
+ RESTORE_ICON,
113
+ TERMINAL_ICON,
114
+ collapseChevronIcon,
115
+ contextMenuItems,
116
+ contextMenuStyle,
117
+ glowLineClass,
118
+ handleRenameKey,
119
+ hideTabChevronIcon,
120
+ joinClasses,
121
+ mergeCliOptions,
122
+ openStatusDropdown,
123
+ paneClass,
124
+ paneStyle,
125
+ panelTabClass,
126
+ panelTabDotClass,
127
+ panelWrapperClass,
128
+ panelWrapperStyle,
129
+ panesContainerClass,
130
+ panesContainerWidth,
131
+ positionIcon,
132
+ positionOptions,
133
+ resolveCliHostConfig as resolveCliHostConfig2,
134
+ runContextMenuAction,
135
+ statusIndicators,
136
+ svgAttrs
137
+ } from "@qodalis/cli";
138
+ import { Fragment as Fragment2, jsx as jsx3, jsxs } from "react/jsx-runtime";
139
+ function reactSvgProps(attrs) {
140
+ const props = {};
141
+ for (const [key, value] of Object.entries(attrs)) {
142
+ props[key.replace(/-([a-z])/g, (_, c) => c.toUpperCase())] = value;
143
+ }
144
+ return props;
145
+ }
146
+ function Icon({ icon, className }) {
147
+ return /* @__PURE__ */ jsx3("svg", { className, ...reactSvgProps(svgAttrs(icon)), children: icon.shapes.map((shape, i) => React3.createElement(shape.tag, { key: i, ...reactSvgProps(shape.attrs) })) });
148
+ }
149
+ var focusAndSelect = (input) => {
150
+ if (input && document.activeElement !== input) {
151
+ input.focus();
152
+ input.select();
153
+ }
154
+ };
155
+ var asStyle = (style) => style;
156
+ var CliPanel = React3.forwardRef(function CliPanel2(props, ref) {
157
+ const config = useCliConfig();
158
+ const options = mergeCliOptions(props.options, config.options);
159
+ const { modules, processors, services } = resolveCliHostConfig2(props, config);
160
+ const [controller] = useState2(
161
+ () => new CliPanelController({
162
+ config: options,
163
+ controlled: {
164
+ collapsed: props.collapsed,
165
+ hidden: props.hidden,
166
+ maximized: props.maximized,
167
+ activeTabId: props.activeTabId,
168
+ position: props.position,
169
+ height: props.height,
170
+ width: props.width
171
+ }
172
+ })
173
+ );
174
+ const s = useSyncExternalStore(controller.subscribe, controller.getSnapshot, controller.getSnapshot);
175
+ const [rootElement, setRootElement] = useState2(null);
176
+ useLayoutEffect(() => {
177
+ controller.setCallbacks({
178
+ onCollapsedChange: props.onCollapsedChange,
179
+ onHiddenChange: props.onHiddenChange,
180
+ onMaximizedChange: props.onMaximizedChange,
181
+ onActiveTabIdChange: props.onActiveTabIdChange,
182
+ onPositionChange: props.onPositionChange,
183
+ onHeightChange: props.onHeightChange,
184
+ onWidthChange: props.onWidthChange,
185
+ onClose: props.onClose,
186
+ onTabAdded: props.onTabAdded,
187
+ onTabClosed: props.onTabClosed,
188
+ onPaneSplit: props.onPaneSplit,
189
+ onPaneClosed: props.onPaneClosed
190
+ });
191
+ controller.setControlled({
192
+ collapsed: props.collapsed,
193
+ hidden: props.hidden,
194
+ maximized: props.maximized,
195
+ activeTabId: props.activeTabId,
196
+ position: props.position,
197
+ height: props.height,
198
+ width: props.width
199
+ });
200
+ controller.setOptions(options);
201
+ });
202
+ useEffect3(() => controller.setRootElement(rootElement), [controller, rootElement]);
203
+ useEffect3(() => () => controller.destroy(), [controller]);
204
+ React3.useImperativeHandle(ref, () => controller, [controller]);
205
+ if (!s.visible) return null;
206
+ return /* @__PURE__ */ jsxs(Fragment2, { children: [
207
+ s.hidden && /* @__PURE__ */ jsxs(
208
+ "button",
209
+ {
210
+ className: "cli-panel-hide-tab",
211
+ "data-position": s.position,
212
+ "data-hide-align": s.hideAlignment,
213
+ style: asStyle(s.themeStyles),
214
+ title: PANEL_LABELS.showCli,
215
+ onClick: () => controller.unhide(),
216
+ children: [
217
+ /* @__PURE__ */ jsx3(Icon, { icon: HIDE_TAB_TERMINAL_ICON, className: "cli-panel-hide-tab-icon" }),
218
+ /* @__PURE__ */ jsx3("span", { className: "cli-panel-hide-tab-label", children: PANEL_LABELS.title }),
219
+ /* @__PURE__ */ jsx3(Icon, { icon: hideTabChevronIcon(s.position), className: "cli-panel-hide-tab-arrow" })
220
+ ]
221
+ }
222
+ ),
223
+ /* @__PURE__ */ jsxs(
224
+ "div",
225
+ {
226
+ ref: setRootElement,
227
+ className: panelWrapperClass(s, props.className),
228
+ style: { ...asStyle(panelWrapperStyle(s)), ...props.style },
229
+ "data-position": s.position,
230
+ "data-resizable": String(s.resizable),
231
+ "data-closable": String(s.closable),
232
+ "data-hideable": String(s.hideable),
233
+ children: [
234
+ /* @__PURE__ */ jsx3(PanelHeader, { controller, s }),
235
+ s.initialized && /* @__PURE__ */ jsxs("div", { className: "cli-panel-content", style: s.collapsed ? { display: "none" } : void 0, children: [
236
+ /* @__PURE__ */ jsxs("div", { className: "cli-panel-tabs", children: [
237
+ /* @__PURE__ */ jsx3("ul", { className: "cli-panel-tab-list", children: s.tabs.map((tab) => /* @__PURE__ */ jsx3(
238
+ "li",
239
+ {
240
+ className: panelTabClass(s, tab),
241
+ onClick: () => controller.selectTab(tab.id),
242
+ onDoubleClick: () => controller.startRename(tab.id),
243
+ onContextMenu: (e) => {
244
+ e.preventDefault();
245
+ e.stopPropagation();
246
+ controller.openContextMenu(tab.id, e.clientX, e.clientY);
247
+ },
248
+ children: tab.isEditing ? /* @__PURE__ */ jsx3(
249
+ "input",
250
+ {
251
+ className: "cli-panel-tab-rename-input",
252
+ type: "text",
253
+ defaultValue: tab.title,
254
+ ref: focusAndSelect,
255
+ onKeyDown: (e) => handleRenameKey(controller, tab.id, e.key, e.currentTarget.value),
256
+ onBlur: (e) => controller.commitRename(tab.id, e.target.value),
257
+ onClick: (e) => e.stopPropagation(),
258
+ onDoubleClick: (e) => e.stopPropagation()
259
+ }
260
+ ) : /* @__PURE__ */ jsxs(Fragment2, { children: [
261
+ /* @__PURE__ */ jsx3("span", { className: panelTabDotClass(s, tab) }),
262
+ /* @__PURE__ */ jsx3("span", { className: "cli-panel-tab-title", children: tab.title }),
263
+ /* @__PURE__ */ jsx3(
264
+ "button",
265
+ {
266
+ className: "cli-panel-tab-close-btn",
267
+ title: PANEL_LABELS.closeTab,
268
+ onClick: (e) => {
269
+ e.stopPropagation();
270
+ controller.closeTab(tab.id);
271
+ },
272
+ children: CLOSE_GLYPH
273
+ }
274
+ )
275
+ ] })
276
+ },
277
+ tab.id
278
+ )) }),
279
+ /* @__PURE__ */ jsx3("button", { className: "cli-panel-add-tab", title: PANEL_LABELS.newTerminal, onClick: () => controller.addTab(), children: "+" })
280
+ ] }),
281
+ /* @__PURE__ */ jsx3("div", { className: "cli-panel-instances", children: s.tabs.map((tab) => /* @__PURE__ */ jsx3("div", { className: "cli-panel-instance", style: { display: tab.id === s.activeTabId ? void 0 : "none" }, children: /* @__PURE__ */ jsx3("div", { className: panesContainerClass(s), children: tab.panes.map((pane, i) => /* @__PURE__ */ jsxs(React3.Fragment, { children: [
282
+ i > 0 && /* @__PURE__ */ jsx3(
283
+ "div",
284
+ {
285
+ className: "cli-panel-pane-divider",
286
+ onMouseDown: (e) => {
287
+ e.preventDefault();
288
+ controller.startPaneResize(tab.id, i - 1, e.clientX, panesContainerWidth(e.target));
289
+ },
290
+ children: /* @__PURE__ */ jsx3("div", { className: "cli-panel-pane-divider-grip" })
291
+ }
292
+ ),
293
+ /* @__PURE__ */ jsxs(
294
+ "div",
295
+ {
296
+ className: paneClass(s, tab.id, pane.id),
297
+ style: paneStyle(pane.widthPercent),
298
+ onClick: () => controller.activatePane(tab.id, pane.id),
299
+ children: [
300
+ tab.panes.length > 1 && /* @__PURE__ */ jsx3(
301
+ "button",
302
+ {
303
+ className: "cli-panel-pane-close-btn",
304
+ title: PANEL_LABELS.closePane,
305
+ onClick: (e) => {
306
+ e.stopPropagation();
307
+ controller.closePane(pane.id);
308
+ },
309
+ children: CLOSE_GLYPH
310
+ }
311
+ ),
312
+ /* @__PURE__ */ jsx3(CliContext.Provider, { value: { engine: null }, children: /* @__PURE__ */ jsx3(
313
+ Cli,
314
+ {
315
+ options,
316
+ modules,
317
+ processors,
318
+ services,
319
+ snapshot: pane.snapshot,
320
+ onReady: (engine) => controller.registerEngine(tab.id, pane.id, engine)
321
+ }
322
+ ) })
323
+ ]
324
+ }
325
+ )
326
+ ] }, pane.id)) }) }, tab.id)) })
327
+ ] })
328
+ ]
329
+ }
330
+ ),
331
+ s.contextMenu.visible && /* @__PURE__ */ jsx3("div", { className: "cli-panel-context-menu", style: asStyle(contextMenuStyle(s)), onClick: (e) => e.stopPropagation(), children: contextMenuItems(s).map((item) => /* @__PURE__ */ jsxs(React3.Fragment, { children: [
332
+ item.separatorBefore && /* @__PURE__ */ jsx3("div", { className: "cli-panel-context-menu-separator" }),
333
+ /* @__PURE__ */ jsx3(
334
+ "button",
335
+ {
336
+ className: joinClasses("cli-panel-context-menu-item", item.destructive && "destructive"),
337
+ disabled: item.disabled,
338
+ onClick: () => runContextMenuAction(controller, item.action),
339
+ children: item.label
340
+ }
341
+ )
342
+ ] }, item.action)) }),
343
+ /* @__PURE__ */ jsx3(StatusDropdown, { s })
344
+ ] });
345
+ });
346
+ function StatusDropdown({ s }) {
347
+ const dropdown = openStatusDropdown(s);
348
+ if (!dropdown) return null;
349
+ return /* @__PURE__ */ jsxs("div", { className: "cli-panel-services-dropdown", style: asStyle(dropdown.style), onClick: (e) => e.stopPropagation(), children: [
350
+ /* @__PURE__ */ jsx3("div", { className: "cli-panel-services-dropdown-header", children: dropdown.header }),
351
+ /* @__PURE__ */ jsx3("div", { className: "cli-panel-services-dropdown-list", children: dropdown.rows.map((row) => /* @__PURE__ */ jsxs("div", { className: "cli-panel-services-dropdown-item", children: [
352
+ /* @__PURE__ */ jsx3("span", { className: row.dotClass }),
353
+ /* @__PURE__ */ jsxs("div", { className: "cli-panel-svc-info", children: [
354
+ /* @__PURE__ */ jsx3("span", { className: "cli-panel-svc-name", children: row.name }),
355
+ row.description && /* @__PURE__ */ jsx3("span", { className: "cli-panel-svc-desc", children: row.description })
356
+ ] }),
357
+ dropdown.kind === "servers" ? /* @__PURE__ */ jsxs("div", { className: "cli-panel-srv-meta", children: [
358
+ /* @__PURE__ */ jsx3("span", { className: "cli-panel-svc-status", children: row.status }),
359
+ row.meta.map((m) => /* @__PURE__ */ jsx3("span", { className: "cli-panel-svc-desc", children: m }, m))
360
+ ] }) : /* @__PURE__ */ jsx3("span", { className: "cli-panel-svc-status", children: row.status })
361
+ ] }, row.key)) }),
362
+ dropdown.rows.length === 0 && /* @__PURE__ */ jsx3("div", { className: "cli-panel-services-dropdown-empty", children: dropdown.emptyText })
363
+ ] });
364
+ }
365
+ function PanelHeader({ controller, s }) {
366
+ const indicators = statusIndicators(s);
367
+ const openDropdown = (e, dropdown) => {
368
+ if (!dropdown) return;
369
+ e.stopPropagation();
370
+ if (dropdown === "services") controller.toggleServicesDropdown(e.currentTarget);
371
+ else controller.toggleServersDropdown(e.currentTarget);
372
+ };
373
+ return /* @__PURE__ */ jsxs("div", { className: "cli-panel-header", children: [
374
+ /* @__PURE__ */ jsx3(
375
+ "div",
376
+ {
377
+ className: "cli-panel-resize-bar",
378
+ onMouseDown: (e) => {
379
+ if (!s.resizable) return;
380
+ e.preventDefault();
381
+ controller.startPanelResize(e.clientX, e.clientY);
382
+ },
383
+ children: /* @__PURE__ */ jsx3("div", { className: "cli-panel-resize-grip" })
384
+ }
385
+ ),
386
+ /* @__PURE__ */ jsxs("div", { className: "cli-panel-header-content", children: [
387
+ /* @__PURE__ */ jsxs("p", { className: "cli-panel-title", children: [
388
+ /* @__PURE__ */ jsx3("span", { className: "cli-panel-title-icon", children: /* @__PURE__ */ jsx3(Icon, { icon: TERMINAL_ICON }) }),
389
+ PANEL_LABELS.title
390
+ ] }),
391
+ s.showStatusIndicators && /* @__PURE__ */ jsx3("div", { className: "cli-panel-status-indicators", children: indicators.map((item) => /* @__PURE__ */ jsxs(
392
+ "span",
393
+ {
394
+ className: joinClasses("cli-panel-status-item", item.itemClass),
395
+ onClick: item.dropdown ? (e) => openDropdown(e, item.dropdown) : void 0,
396
+ children: [
397
+ item.dotClass && /* @__PURE__ */ jsx3("span", { className: `cli-panel-status-dot ${item.dotClass}` }),
398
+ item.icon && /* @__PURE__ */ jsx3("span", { className: joinClasses("cli-panel-status-icon", item.iconClass), children: item.icon }),
399
+ /* @__PURE__ */ jsx3("span", { className: "cli-panel-status-label", children: item.label })
400
+ ]
401
+ },
402
+ item.key
403
+ )) }),
404
+ /* @__PURE__ */ jsx3("div", { className: "cli-panel-status-indicators-compact", children: indicators.map((item) => /* @__PURE__ */ jsxs(
405
+ "span",
406
+ {
407
+ className: joinClasses("cli-panel-status-compact-item", item.compactClass),
408
+ title: item.title,
409
+ onClick: item.dropdown ? (e) => openDropdown(e, item.dropdown) : void 0,
410
+ children: [
411
+ item.compactDotClass && /* @__PURE__ */ jsx3("span", { className: item.compactDotClass }),
412
+ item.dotClass && /* @__PURE__ */ jsx3("span", { className: `cli-panel-status-dot ${item.dotClass}` }),
413
+ item.icon && /* @__PURE__ */ jsx3("span", { className: joinClasses("cli-panel-status-icon", item.iconClass), children: item.icon })
414
+ ]
415
+ },
416
+ item.key
417
+ )) }),
418
+ /* @__PURE__ */ jsxs("div", { className: "cli-panel-action-buttons", children: [
419
+ /* @__PURE__ */ jsxs("div", { className: "cli-panel-btn-position-wrapper", onClick: (e) => e.stopPropagation(), children: [
420
+ /* @__PURE__ */ jsx3("button", { className: "cli-panel-btn cli-panel-btn-position", title: PANEL_LABELS.movePanel, onClick: () => controller.togglePositionDropdown(), children: /* @__PURE__ */ jsx3(Icon, { icon: positionIcon(s.position) }) }),
421
+ s.positionDropdownOpen && /* @__PURE__ */ jsx3("div", { className: "cli-panel-position-dropdown", children: positionOptions(s).map((opt) => /* @__PURE__ */ jsxs("button", { className: opt.className, onClick: () => controller.setPosition(opt.position), children: [
422
+ /* @__PURE__ */ jsx3(Icon, { icon: positionIcon(opt.position, 16) }),
423
+ opt.label
424
+ ] }, opt.position)) })
425
+ ] }),
426
+ s.hideable && /* @__PURE__ */ jsx3("button", { className: "cli-panel-btn cli-panel-btn-hide", title: PANEL_LABELS.hide, onClick: () => controller.hide(), children: /* @__PURE__ */ jsx3(Icon, { icon: HIDE_ICON }) }),
427
+ /* @__PURE__ */ jsx3(
428
+ "button",
429
+ {
430
+ className: "cli-panel-btn",
431
+ title: s.maximized ? PANEL_LABELS.restore : PANEL_LABELS.maximize,
432
+ disabled: s.collapsed,
433
+ onClick: () => controller.toggleMaximize(),
434
+ children: /* @__PURE__ */ jsx3(Icon, { icon: s.maximized ? RESTORE_ICON : MAXIMIZE_ICON })
435
+ }
436
+ ),
437
+ /* @__PURE__ */ jsx3("button", { className: "cli-panel-btn", title: s.collapsed ? PANEL_LABELS.expand : PANEL_LABELS.collapse, onClick: () => controller.toggle(), children: /* @__PURE__ */ jsx3(Icon, { icon: collapseChevronIcon(s.position, s.collapsed) }) }),
438
+ s.closable && /* @__PURE__ */ jsx3("button", { className: "cli-panel-btn cli-panel-btn-close", title: PANEL_LABELS.close, onClick: () => controller.close(), children: /* @__PURE__ */ jsx3(Icon, { icon: CLOSE_ICON }) })
439
+ ] })
440
+ ] }),
441
+ /* @__PURE__ */ jsx3("div", { className: glowLineClass(s) })
442
+ ] });
443
+ }
444
+
445
+ // src/CliProvider.tsx
446
+ import { useRef as useRef3 } from "react";
447
+ import { resolveCliHostConfig as resolveCliHostConfig3 } from "@qodalis/cli";
448
+ import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
449
+ function CliProvider({
450
+ modules,
451
+ processors,
452
+ options,
453
+ services,
454
+ children,
455
+ style
456
+ }) {
457
+ const config = useCliConfig();
458
+ const containerRef = useRef3(null);
459
+ const engine = useCliEngine(containerRef, resolveCliHostConfig3({ modules, processors, options, services }, config));
460
+ return /* @__PURE__ */ jsxs2(CliContext.Provider, { value: { engine }, children: [
461
+ /* @__PURE__ */ jsx4("div", { ref: containerRef, style: { height: "100%", ...style } }),
462
+ children
463
+ ] });
464
+ }
465
+
466
+ // src/index.tsx
467
+ import { CliEngine as CliEngine4 } from "@qodalis/cli";
468
+ export {
469
+ Cli,
470
+ CliConfigProvider,
471
+ CliContext,
472
+ CliEngine4 as CliEngine,
473
+ CliPanel,
474
+ CliProvider,
475
+ useCli,
476
+ useCliConfig,
477
+ useCliEngine
478
+ };
479
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/Cli.tsx","../src/CliContext.tsx","../src/CliConfigContext.tsx","../src/useCliEngine.ts","../src/CliPanel.tsx","../src/CliProvider.tsx","../src/index.tsx"],"sourcesContent":["import React, { useRef, useEffect } from 'react';\nimport { ICliCommandProcessor, ICliModule, CliEngineSnapshot } from '@qodalis/cli-core';\nimport { CliEngine, CliEngineOptions, resolveCliHostConfig } from '@qodalis/cli';\nimport { useCli } from './CliContext';\nimport { useCliConfig } from './CliConfigContext';\nimport { useCliEngine } from './useCliEngine';\n\nexport interface CliProps {\n modules?: ICliModule[];\n processors?: ICliCommandProcessor[];\n options?: CliEngineOptions;\n services?: Record<string, any>;\n snapshot?: CliEngineSnapshot;\n onReady?: (engine: CliEngine) => void;\n style?: React.CSSProperties;\n className?: string;\n}\n\nexport function Cli({\n modules,\n processors,\n options,\n services,\n snapshot,\n onReady,\n style,\n className,\n}: CliProps): React.JSX.Element {\n const ctx = useCli();\n const config = useCliConfig();\n const containerRef = useRef<HTMLDivElement>(null);\n const hasProvider = !!ctx.engine;\n\n // Always call the hook (React rules), but disable it when inside a CliProvider.\n const standaloneEngine = useCliEngine(containerRef, {\n ...resolveCliHostConfig({ modules, processors, options, services }, config),\n snapshot,\n disabled: hasProvider,\n });\n\n const engine = ctx.engine ?? standaloneEngine;\n\n useEffect(() => {\n if (engine && onReady) {\n onReady(engine);\n }\n }, [engine, onReady]);\n\n // If inside a CliProvider, render nothing (provider has the terminal div).\n if (hasProvider) {\n return <></>;\n }\n\n return (\n <div\n ref={containerRef}\n style={{ height: '100%', ...style }}\n className={className}\n />\n );\n}\n","import { createContext, useContext } from 'react';\nimport { CliEngine } from '@qodalis/cli';\n\nexport interface CliContextValue {\n engine: CliEngine | null;\n}\n\nexport const CliContext = createContext<CliContextValue>({ engine: null });\n\nexport function useCli(): CliContextValue {\n return useContext(CliContext);\n}\n","import React, { createContext, useContext } from 'react';\nimport { ICliCommandProcessor, ICliModule, CliOptions } from '@qodalis/cli-core';\nimport { CliEngineOptions } from '@qodalis/cli';\n\nexport interface CliConfigValue {\n modules?: ICliModule[];\n processors?: ICliCommandProcessor[];\n options?: CliEngineOptions;\n services?: Record<string, any>;\n}\n\nconst CliConfigCtx = createContext<CliConfigValue>({});\n\nexport function useCliConfig(): CliConfigValue {\n return useContext(CliConfigCtx);\n}\n\nexport interface CliConfigProviderProps extends CliConfigValue {\n children: React.ReactNode;\n}\n\nexport function CliConfigProvider({\n modules,\n processors,\n options,\n services,\n children,\n}: CliConfigProviderProps): React.JSX.Element {\n return (\n <CliConfigCtx.Provider value={{ modules, processors, options, services }}>\n {children}\n </CliConfigCtx.Provider>\n );\n}\n","import { useRef, useEffect, useState, RefObject } from 'react';\nimport { CliEngine, CreateCliEngineConfig, createCliEngine } from '@qodalis/cli';\n\nexport interface UseCliEngineConfig extends Omit<CreateCliEngineConfig, 'framework'> {\n disabled?: boolean;\n}\n\nexport function useCliEngine(\n containerRef: RefObject<HTMLElement | null>,\n config?: UseCliEngineConfig,\n): CliEngine | null {\n const [engine, setEngine] = useState<CliEngine | null>(null);\n const engineRef = useRef<CliEngine | null>(null);\n const initTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n\n useEffect(() => {\n if (config?.disabled || !containerRef.current) return;\n\n // Defer initialization slightly so that StrictMode's immediate\n // unmount (mount → unmount → remount) cancels the first attempt\n // via the cleanup function, while non-StrictMode proceeds normally.\n const container = containerRef.current;\n initTimerRef.current = setTimeout(() => {\n initTimerRef.current = null;\n if (!container) return;\n\n const e = createCliEngine(container, { ...config, framework: 'React' });\n\n engineRef.current = e;\n e.start().then(() => setEngine(e));\n }, 0);\n\n return () => {\n if (initTimerRef.current !== null) {\n clearTimeout(initTimerRef.current);\n initTimerRef.current = null;\n return;\n }\n if (engineRef.current) {\n engineRef.current.destroy();\n engineRef.current = null;\n setEngine(null);\n }\n };\n }, []); // eslint-disable-line react-hooks/exhaustive-deps\n\n return engine;\n}\n","import React, { useEffect, useLayoutEffect, useState, useSyncExternalStore } from 'react';\nimport { ICliCommandProcessor, ICliModule, CliPanelConfig, CliPanelPosition, ICliPanelRef } from '@qodalis/cli-core';\nimport {\n CliEngine,\n CliEngineOptions,\n CliPanelController,\n CliPanelSnapshot,\n CLOSE_GLYPH,\n CLOSE_ICON,\n HIDE_ICON,\n HIDE_TAB_TERMINAL_ICON,\n MAXIMIZE_ICON,\n PANEL_LABELS,\n RESTORE_ICON,\n SvgIcon,\n TERMINAL_ICON,\n collapseChevronIcon,\n contextMenuItems,\n contextMenuStyle,\n glowLineClass,\n handleRenameKey,\n hideTabChevronIcon,\n joinClasses,\n mergeCliOptions,\n openStatusDropdown,\n paneClass,\n paneStyle,\n panelTabClass,\n panelTabDotClass,\n panelWrapperClass,\n panelWrapperStyle,\n panesContainerClass,\n panesContainerWidth,\n positionIcon,\n positionOptions,\n resolveCliHostConfig,\n runContextMenuAction,\n statusIndicators,\n svgAttrs,\n} from '@qodalis/cli';\nimport { Cli } from './Cli';\nimport { CliContext } from './CliContext';\nimport { useCliConfig } from './CliConfigContext';\n\nexport interface CliPanelOptions extends CliEngineOptions, CliPanelConfig {}\n\nexport interface CliPanelProps {\n options?: CliPanelOptions;\n modules?: ICliModule[];\n processors?: ICliCommandProcessor[];\n services?: Record<string, any>;\n onClose?: () => void;\n style?: React.CSSProperties;\n className?: string;\n\n // Bindable properties (controlled mode)\n collapsed?: boolean;\n onCollapsedChange?: (collapsed: boolean) => void;\n hidden?: boolean;\n onHiddenChange?: (hidden: boolean) => void;\n maximized?: boolean;\n onMaximizedChange?: (maximized: boolean) => void;\n activeTabId?: number;\n onActiveTabIdChange?: (tabId: number) => void;\n position?: CliPanelPosition;\n onPositionChange?: (position: CliPanelPosition) => void;\n height?: number;\n onHeightChange?: (height: number) => void;\n width?: number;\n onWidthChange?: (width: number) => void;\n\n // Structural events\n onTabAdded?: (event: { tabId: number }) => void;\n onTabClosed?: (event: { tabId: number }) => void;\n onPaneSplit?: (event: { paneId: number; tabId: number }) => void;\n onPaneClosed?: (event: { paneId: number }) => void;\n}\n\n/* ─── Icons ──────────────────────────────────────────────── */\n\n/** SVG attribute names in React's camelCase spelling. */\nfunction reactSvgProps(attrs: Record<string, string>): Record<string, string> {\n const props: Record<string, string> = {};\n for (const [key, value] of Object.entries(attrs)) {\n props[key.replace(/-([a-z])/g, (_, c: string) => c.toUpperCase())] = value;\n }\n return props;\n}\n\nfunction Icon({ icon, className }: { icon: SvgIcon; className?: string }) {\n return (\n <svg className={className} {...reactSvgProps(svgAttrs(icon))}>\n {icon.shapes.map((shape, i) => React.createElement(shape.tag, { key: i, ...reactSvgProps(shape.attrs) }))}\n </svg>\n );\n}\n\n/** Focus a freshly mounted rename input and select its text. */\nconst focusAndSelect = (input: HTMLInputElement | null) => {\n if (input && document.activeElement !== input) {\n input.focus();\n input.select();\n }\n};\n\nconst asStyle = (style: Record<string, string>) => style as React.CSSProperties;\n\n/* ─── Component ──────────────────────────────────────────── */\n\nexport const CliPanel = React.forwardRef<ICliPanelRef<CliEngine>, CliPanelProps>(function CliPanel(props, ref) {\n const config = useCliConfig();\n const options = mergeCliOptions<CliPanelOptions>(props.options, config.options);\n const { modules, processors, services } = resolveCliHostConfig(props, config);\n\n const [controller] = useState(\n () =>\n new CliPanelController({\n config: options,\n controlled: {\n collapsed: props.collapsed,\n hidden: props.hidden,\n maximized: props.maximized,\n activeTabId: props.activeTabId,\n position: props.position,\n height: props.height,\n width: props.width,\n },\n }),\n );\n const s = useSyncExternalStore(controller.subscribe, controller.getSnapshot, controller.getSnapshot);\n const [rootElement, setRootElement] = useState<HTMLDivElement | null>(null);\n\n // Keep the controller in sync with props before the browser paints.\n useLayoutEffect(() => {\n controller.setCallbacks({\n onCollapsedChange: props.onCollapsedChange,\n onHiddenChange: props.onHiddenChange,\n onMaximizedChange: props.onMaximizedChange,\n onActiveTabIdChange: props.onActiveTabIdChange,\n onPositionChange: props.onPositionChange,\n onHeightChange: props.onHeightChange,\n onWidthChange: props.onWidthChange,\n onClose: props.onClose,\n onTabAdded: props.onTabAdded,\n onTabClosed: props.onTabClosed,\n onPaneSplit: props.onPaneSplit,\n onPaneClosed: props.onPaneClosed,\n });\n controller.setControlled({\n collapsed: props.collapsed,\n hidden: props.hidden,\n maximized: props.maximized,\n activeTabId: props.activeTabId,\n position: props.position,\n height: props.height,\n width: props.width,\n });\n controller.setOptions(options);\n });\n\n useEffect(() => controller.setRootElement(rootElement), [controller, rootElement]);\n useEffect(() => () => controller.destroy(), [controller]);\n React.useImperativeHandle(ref, () => controller, [controller]);\n\n if (!s.visible) return null;\n\n return (\n <>\n {s.hidden && (\n <button\n className=\"cli-panel-hide-tab\"\n data-position={s.position}\n data-hide-align={s.hideAlignment}\n style={asStyle(s.themeStyles)}\n title={PANEL_LABELS.showCli}\n onClick={() => controller.unhide()}\n >\n <Icon icon={HIDE_TAB_TERMINAL_ICON} className=\"cli-panel-hide-tab-icon\" />\n <span className=\"cli-panel-hide-tab-label\">{PANEL_LABELS.title}</span>\n <Icon icon={hideTabChevronIcon(s.position)} className=\"cli-panel-hide-tab-arrow\" />\n </button>\n )}\n <div\n ref={setRootElement}\n className={panelWrapperClass(s, props.className)}\n style={{ ...asStyle(panelWrapperStyle(s)), ...props.style }}\n data-position={s.position}\n data-resizable={String(s.resizable)}\n data-closable={String(s.closable)}\n data-hideable={String(s.hideable)}\n >\n <PanelHeader controller={controller} s={s} />\n {s.initialized && (\n <div className=\"cli-panel-content\" style={s.collapsed ? { display: 'none' } : undefined}>\n <div className=\"cli-panel-tabs\">\n <ul className=\"cli-panel-tab-list\">\n {s.tabs.map((tab) => (\n <li\n key={tab.id}\n className={panelTabClass(s, tab)}\n onClick={() => controller.selectTab(tab.id)}\n onDoubleClick={() => controller.startRename(tab.id)}\n onContextMenu={(e) => {\n e.preventDefault();\n e.stopPropagation();\n controller.openContextMenu(tab.id, e.clientX, e.clientY);\n }}\n >\n {tab.isEditing ? (\n <input\n className=\"cli-panel-tab-rename-input\"\n type=\"text\"\n defaultValue={tab.title}\n ref={focusAndSelect}\n onKeyDown={(e) => handleRenameKey(controller, tab.id, e.key, e.currentTarget.value)}\n onBlur={(e) => controller.commitRename(tab.id, e.target.value)}\n onClick={(e) => e.stopPropagation()}\n onDoubleClick={(e) => e.stopPropagation()}\n />\n ) : (\n <>\n <span className={panelTabDotClass(s, tab)} />\n <span className=\"cli-panel-tab-title\">{tab.title}</span>\n <button\n className=\"cli-panel-tab-close-btn\"\n title={PANEL_LABELS.closeTab}\n onClick={(e) => {\n e.stopPropagation();\n controller.closeTab(tab.id);\n }}\n >\n {CLOSE_GLYPH}\n </button>\n </>\n )}\n </li>\n ))}\n </ul>\n <button className=\"cli-panel-add-tab\" title={PANEL_LABELS.newTerminal} onClick={() => controller.addTab()}>\n +\n </button>\n </div>\n\n <div className=\"cli-panel-instances\">\n {s.tabs.map((tab) => (\n <div key={tab.id} className=\"cli-panel-instance\" style={{ display: tab.id === s.activeTabId ? undefined : 'none' }}>\n <div className={panesContainerClass(s)}>\n {tab.panes.map((pane, i) => (\n <React.Fragment key={pane.id}>\n {i > 0 && (\n <div\n className=\"cli-panel-pane-divider\"\n onMouseDown={(e) => {\n e.preventDefault();\n controller.startPaneResize(tab.id, i - 1, e.clientX, panesContainerWidth(e.target));\n }}\n >\n <div className=\"cli-panel-pane-divider-grip\" />\n </div>\n )}\n <div\n className={paneClass(s, tab.id, pane.id)}\n style={paneStyle(pane.widthPercent)}\n onClick={() => controller.activatePane(tab.id, pane.id)}\n >\n {tab.panes.length > 1 && (\n <button\n className=\"cli-panel-pane-close-btn\"\n title={PANEL_LABELS.closePane}\n onClick={(e) => {\n e.stopPropagation();\n controller.closePane(pane.id);\n }}\n >\n {CLOSE_GLYPH}\n </button>\n )}\n <CliContext.Provider value={{ engine: null }}>\n <Cli\n options={options}\n modules={modules}\n processors={processors}\n services={services}\n snapshot={pane.snapshot}\n onReady={(engine) => controller.registerEngine(tab.id, pane.id, engine)}\n />\n </CliContext.Provider>\n </div>\n </React.Fragment>\n ))}\n </div>\n </div>\n ))}\n </div>\n </div>\n )}\n </div>\n\n {s.contextMenu.visible && (\n <div className=\"cli-panel-context-menu\" style={asStyle(contextMenuStyle(s))} onClick={(e) => e.stopPropagation()}>\n {contextMenuItems(s).map((item) => (\n <React.Fragment key={item.action}>\n {item.separatorBefore && <div className=\"cli-panel-context-menu-separator\" />}\n <button\n className={joinClasses('cli-panel-context-menu-item', item.destructive && 'destructive')}\n disabled={item.disabled}\n onClick={() => runContextMenuAction(controller, item.action)}\n >\n {item.label}\n </button>\n </React.Fragment>\n ))}\n </div>\n )}\n\n <StatusDropdown s={s} />\n </>\n );\n});\n\n/* ─── Services / servers dropdown ────────────────────────── */\n\nfunction StatusDropdown({ s }: { s: CliPanelSnapshot }) {\n const dropdown = openStatusDropdown(s);\n if (!dropdown) return null;\n return (\n <div className=\"cli-panel-services-dropdown\" style={asStyle(dropdown.style)} onClick={(e) => e.stopPropagation()}>\n <div className=\"cli-panel-services-dropdown-header\">{dropdown.header}</div>\n <div className=\"cli-panel-services-dropdown-list\">\n {dropdown.rows.map((row) => (\n <div key={row.key} className=\"cli-panel-services-dropdown-item\">\n <span className={row.dotClass} />\n <div className=\"cli-panel-svc-info\">\n <span className=\"cli-panel-svc-name\">{row.name}</span>\n {row.description && <span className=\"cli-panel-svc-desc\">{row.description}</span>}\n </div>\n {dropdown.kind === 'servers' ? (\n <div className=\"cli-panel-srv-meta\">\n <span className=\"cli-panel-svc-status\">{row.status}</span>\n {row.meta.map((m) => (\n <span key={m} className=\"cli-panel-svc-desc\">\n {m}\n </span>\n ))}\n </div>\n ) : (\n <span className=\"cli-panel-svc-status\">{row.status}</span>\n )}\n </div>\n ))}\n </div>\n {dropdown.rows.length === 0 && <div className=\"cli-panel-services-dropdown-empty\">{dropdown.emptyText}</div>}\n </div>\n );\n}\n\n/* ─── Header ─────────────────────────────────────────────── */\n\nfunction PanelHeader({ controller, s }: { controller: CliPanelController; s: CliPanelSnapshot }) {\n const indicators = statusIndicators(s);\n const openDropdown = (e: React.MouseEvent, dropdown?: 'services' | 'servers') => {\n if (!dropdown) return;\n e.stopPropagation();\n if (dropdown === 'services') controller.toggleServicesDropdown(e.currentTarget);\n else controller.toggleServersDropdown(e.currentTarget);\n };\n\n return (\n <div className=\"cli-panel-header\">\n <div\n className=\"cli-panel-resize-bar\"\n onMouseDown={(e) => {\n if (!s.resizable) return;\n e.preventDefault();\n controller.startPanelResize(e.clientX, e.clientY);\n }}\n >\n <div className=\"cli-panel-resize-grip\" />\n </div>\n <div className=\"cli-panel-header-content\">\n <p className=\"cli-panel-title\">\n <span className=\"cli-panel-title-icon\">\n <Icon icon={TERMINAL_ICON} />\n </span>\n {PANEL_LABELS.title}\n </p>\n\n {s.showStatusIndicators && (\n <div className=\"cli-panel-status-indicators\">\n {indicators.map((item) => (\n <span\n key={item.key}\n className={joinClasses('cli-panel-status-item', item.itemClass)}\n onClick={item.dropdown ? (e) => openDropdown(e, item.dropdown) : undefined}\n >\n {item.dotClass && <span className={`cli-panel-status-dot ${item.dotClass}`} />}\n {item.icon && <span className={joinClasses('cli-panel-status-icon', item.iconClass)}>{item.icon}</span>}\n <span className=\"cli-panel-status-label\">{item.label}</span>\n </span>\n ))}\n </div>\n )}\n\n {/* Compact indicators for left/right positions (CSS controls visibility). */}\n <div className=\"cli-panel-status-indicators-compact\">\n {indicators.map((item) => (\n <span\n key={item.key}\n className={joinClasses('cli-panel-status-compact-item', item.compactClass)}\n title={item.title}\n onClick={item.dropdown ? (e) => openDropdown(e, item.dropdown) : undefined}\n >\n {item.compactDotClass && <span className={item.compactDotClass} />}\n {item.dotClass && <span className={`cli-panel-status-dot ${item.dotClass}`} />}\n {item.icon && <span className={joinClasses('cli-panel-status-icon', item.iconClass)}>{item.icon}</span>}\n </span>\n ))}\n </div>\n\n <div className=\"cli-panel-action-buttons\">\n <div className=\"cli-panel-btn-position-wrapper\" onClick={(e) => e.stopPropagation()}>\n <button className=\"cli-panel-btn cli-panel-btn-position\" title={PANEL_LABELS.movePanel} onClick={() => controller.togglePositionDropdown()}>\n <Icon icon={positionIcon(s.position)} />\n </button>\n {s.positionDropdownOpen && (\n <div className=\"cli-panel-position-dropdown\">\n {positionOptions(s).map((opt) => (\n <button key={opt.position} className={opt.className} onClick={() => controller.setPosition(opt.position)}>\n <Icon icon={positionIcon(opt.position, 16)} />\n {opt.label}\n </button>\n ))}\n </div>\n )}\n </div>\n {s.hideable && (\n <button className=\"cli-panel-btn cli-panel-btn-hide\" title={PANEL_LABELS.hide} onClick={() => controller.hide()}>\n <Icon icon={HIDE_ICON} />\n </button>\n )}\n <button\n className=\"cli-panel-btn\"\n title={s.maximized ? PANEL_LABELS.restore : PANEL_LABELS.maximize}\n disabled={s.collapsed}\n onClick={() => controller.toggleMaximize()}\n >\n <Icon icon={s.maximized ? RESTORE_ICON : MAXIMIZE_ICON} />\n </button>\n <button className=\"cli-panel-btn\" title={s.collapsed ? PANEL_LABELS.expand : PANEL_LABELS.collapse} onClick={() => controller.toggle()}>\n <Icon icon={collapseChevronIcon(s.position, s.collapsed)} />\n </button>\n {s.closable && (\n <button className=\"cli-panel-btn cli-panel-btn-close\" title={PANEL_LABELS.close} onClick={() => controller.close()}>\n <Icon icon={CLOSE_ICON} />\n </button>\n )}\n </div>\n </div>\n <div className={glowLineClass(s)} />\n </div>\n );\n}\n","import React, { useRef } from 'react';\nimport { ICliCommandProcessor, ICliModule } from '@qodalis/cli-core';\nimport { CliEngineOptions, resolveCliHostConfig } from '@qodalis/cli';\nimport { CliContext } from './CliContext';\nimport { useCliConfig } from './CliConfigContext';\nimport { useCliEngine } from './useCliEngine';\n\nexport interface CliProviderProps {\n modules?: ICliModule[];\n processors?: ICliCommandProcessor[];\n options?: CliEngineOptions;\n services?: Record<string, any>;\n children: React.ReactNode;\n style?: React.CSSProperties;\n}\n\nexport function CliProvider({\n modules,\n processors,\n options,\n services,\n children,\n style,\n}: CliProviderProps): React.JSX.Element {\n const config = useCliConfig();\n const containerRef = useRef<HTMLDivElement>(null);\n const engine = useCliEngine(containerRef, resolveCliHostConfig({ modules, processors, options, services }, config));\n\n return (\n <CliContext.Provider value={{ engine }}>\n <div ref={containerRef} style={{ height: '100%', ...style }} />\n {children}\n </CliContext.Provider>\n );\n}\n","export { Cli } from './Cli';\nexport type { CliProps } from './Cli';\nexport { CliPanel } from './CliPanel';\nexport type { CliPanelProps, CliPanelOptions } from './CliPanel';\nexport { CliProvider } from './CliProvider';\nexport type { CliProviderProps } from './CliProvider';\nexport { useCli, CliContext } from './CliContext';\nexport type { CliContextValue } from './CliContext';\nexport { CliConfigProvider, useCliConfig } from './CliConfigContext';\nexport type { CliConfigValue, CliConfigProviderProps } from './CliConfigContext';\nexport { useCliEngine } from './useCliEngine';\nexport type { UseCliEngineConfig } from './useCliEngine';\n\n// Re-export commonly used types from @qodalis/cli for convenience\nexport type { CliEngineOptions } from '@qodalis/cli';\nexport { CliEngine } from '@qodalis/cli';\n"],"mappings":";AAAA,SAAgB,UAAAA,SAAQ,aAAAC,kBAAiB;AAEzC,SAAsC,4BAA4B;;;ACFlE,SAAS,eAAe,kBAAkB;AAOnC,IAAM,aAAa,cAA+B,EAAE,QAAQ,KAAK,CAAC;AAElE,SAAS,SAA0B;AACtC,SAAO,WAAW,UAAU;AAChC;;;ACXA,SAAgB,iBAAAC,gBAAe,cAAAC,mBAAkB;AA6BzC;AAlBR,IAAM,eAAeD,eAA8B,CAAC,CAAC;AAE9C,SAAS,eAA+B;AAC3C,SAAOC,YAAW,YAAY;AAClC;AAMO,SAAS,kBAAkB;AAAA,EAC9B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACJ,GAA8C;AAC1C,SACI,oBAAC,aAAa,UAAb,EAAsB,OAAO,EAAE,SAAS,YAAY,SAAS,SAAS,GAClE,UACL;AAER;;;ACjCA,SAAS,QAAQ,WAAW,gBAA2B;AACvD,SAA2C,uBAAuB;AAM3D,SAAS,aACZ,cACA,QACgB;AAChB,QAAM,CAAC,QAAQ,SAAS,IAAI,SAA2B,IAAI;AAC3D,QAAM,YAAY,OAAyB,IAAI;AAC/C,QAAM,eAAe,OAA6C,IAAI;AAEtE,YAAU,MAAM;AACZ,QAAI,QAAQ,YAAY,CAAC,aAAa,QAAS;AAK/C,UAAM,YAAY,aAAa;AAC/B,iBAAa,UAAU,WAAW,MAAM;AACpC,mBAAa,UAAU;AACvB,UAAI,CAAC,UAAW;AAEhB,YAAM,IAAI,gBAAgB,WAAW,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AAA,EACA;AACJ,GAAwC;AACpC,QAAM,SAAS,aAAa;AAC5B,QAAM,eAAeC,QAAuB,IAAI;AAChD,QAAM,SAAS,aAAa,cAAcC,sBAAqB,EAAE,SAAS,YAAY,SAAS,SAAS,GAAG,MAAM,CAAC;AAElH,SACI,gBAAAF,MAAC,WAAW,UAAX,EAAoB,OAAO,EAAE,OAAO,GACjC;AAAA,oBAAAD,KAAC,SAAI,KAAK,cAAc,OAAO,EAAE,QAAQ,QAAQ,GAAG,MAAM,GAAG;AAAA,IAC5D;AAAA,KACL;AAER;;;ACnBA,SAAS,aAAAI,kBAAiB;","names":["useRef","useEffect","createContext","useContext","jsx","useRef","useEffect","React","useEffect","useState","resolveCliHostConfig","Fragment","jsx","React","CliPanel","resolveCliHostConfig","useState","useEffect","useRef","resolveCliHostConfig","jsx","jsxs","useRef","resolveCliHostConfig","CliEngine"]}
@@ -0,0 +1,52 @@
1
+ {
2
+ "name": "@qodalis/react-cli",
3
+ "version": "2.0.0-beta.20",
4
+ "description": "React wrapper for the @qodalis CLI terminal engine.",
5
+ "author": "Nicolae Lupei, Qodalis Solutions",
6
+ "license": "MIT",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "https://github.com/qodalis-solutions/web-cli"
10
+ },
11
+ "homepage": "https://qodalis.com",
12
+ "keywords": [
13
+ "react",
14
+ "cli",
15
+ "qodalis",
16
+ "terminal",
17
+ "web-terminal",
18
+ "xterm"
19
+ ],
20
+ "main": "./dist/index.js",
21
+ "module": "./dist/index.mjs",
22
+ "types": "./dist/index.d.ts",
23
+ "exports": {
24
+ ".": {
25
+ "types": "./dist/index.d.ts",
26
+ "import": "./dist/index.mjs",
27
+ "require": "./dist/index.js"
28
+ },
29
+ "./styles.css": "./dist/styles.css"
30
+ },
31
+ "files": [
32
+ "dist"
33
+ ],
34
+ "peerDependencies": {
35
+ "react": "^18.0.0 || ^19.0.0",
36
+ "react-dom": "^18.0.0 || ^19.0.0"
37
+ },
38
+ "dependencies": {
39
+ "@qodalis/cli": "workspace:^",
40
+ "@qodalis/cli-core": "workspace:^"
41
+ },
42
+ "devDependencies": {
43
+ "tsup": "^9.0.0",
44
+ "typescript": "^6.0.0",
45
+ "@types/react": "^18.0.0 || ^19.0.0"
46
+ },
47
+ "scripts": {
48
+ "build": "tsup",
49
+ "dev": "tsup --watch"
50
+ },
51
+ "sideEffects": false
52
+ }
@@ -0,0 +1,8 @@
1
+ /* @qodalis/react-cli — all-in-one stylesheet
2
+ *
3
+ * Import this single file instead of manually importing xterm and cli-panel CSS:
4
+ * import '@qodalis/react-cli/styles.css';
5
+ */
6
+
7
+ @import '@xterm/xterm/css/xterm.css';
8
+ @import '@qodalis/cli/assets/cli-panel.css';