@qodalis/vue-cli 2.0.0-beta.2 → 2.0.0-beta.21

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.js ADDED
@@ -0,0 +1,653 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/index.ts
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
+ Cli: () => Cli,
24
+ CliConfigKey: () => CliConfigKey,
25
+ CliConfigProvider: () => CliConfigProvider,
26
+ CliEngine: () => import_cli4.CliEngine,
27
+ CliInjectionKey: () => CliInjectionKey,
28
+ CliPanel: () => CliPanel,
29
+ CliProvider: () => CliProvider,
30
+ useCli: () => useCli,
31
+ useCliEngine: () => useCliEngine
32
+ });
33
+ module.exports = __toCommonJS(index_exports);
34
+
35
+ // src/Cli.ts
36
+ var import_vue2 = require("vue");
37
+ var import_cli = require("@qodalis/cli");
38
+
39
+ // src/cliInjection.ts
40
+ var CliInjectionKey = /* @__PURE__ */ Symbol("qodalis-cli");
41
+
42
+ // src/CliConfigProvider.ts
43
+ var import_vue = require("vue");
44
+ var CliConfigKey = /* @__PURE__ */ Symbol("qodalis-cli-config");
45
+ var CliConfigProvider = (0, import_vue.defineComponent)({
46
+ name: "CliConfigProvider",
47
+ props: {
48
+ modules: {
49
+ type: Array,
50
+ default: void 0
51
+ },
52
+ processors: {
53
+ type: Array,
54
+ default: void 0
55
+ },
56
+ options: {
57
+ type: Object,
58
+ default: void 0
59
+ },
60
+ services: {
61
+ type: Object,
62
+ default: void 0
63
+ }
64
+ },
65
+ setup(props, { slots }) {
66
+ (0, import_vue.provide)(CliConfigKey, {
67
+ modules: props.modules,
68
+ processors: props.processors,
69
+ options: props.options,
70
+ services: props.services
71
+ });
72
+ return () => slots.default?.();
73
+ }
74
+ });
75
+
76
+ // src/Cli.ts
77
+ var Cli = (0, import_vue2.defineComponent)({
78
+ name: "Cli",
79
+ props: {
80
+ modules: {
81
+ type: Array,
82
+ default: void 0
83
+ },
84
+ processors: {
85
+ type: Array,
86
+ default: void 0
87
+ },
88
+ options: {
89
+ type: Object,
90
+ default: void 0
91
+ },
92
+ services: {
93
+ type: Object,
94
+ default: void 0
95
+ },
96
+ snapshot: {
97
+ type: Object,
98
+ default: void 0
99
+ },
100
+ style: {
101
+ type: Object,
102
+ default: void 0
103
+ },
104
+ class: {
105
+ type: String,
106
+ default: void 0
107
+ }
108
+ },
109
+ emits: ["ready"],
110
+ setup(props, { emit }) {
111
+ const containerRef = (0, import_vue2.ref)(null);
112
+ const ctx = (0, import_vue2.inject)(CliInjectionKey, null);
113
+ const config = (0, import_vue2.inject)(CliConfigKey, null);
114
+ let engine = null;
115
+ if (ctx) {
116
+ return () => null;
117
+ }
118
+ const hostConfig = (0, import_cli.resolveCliHostConfig)(props, config);
119
+ (0, import_vue2.onMounted)(async () => {
120
+ if (!containerRef.value) return;
121
+ engine = (0, import_cli.createCliEngine)(containerRef.value, { ...hostConfig, snapshot: props.snapshot, framework: "Vue" });
122
+ await engine.start();
123
+ emit("ready", engine);
124
+ });
125
+ (0, import_vue2.onBeforeUnmount)(() => {
126
+ engine?.destroy();
127
+ engine = null;
128
+ });
129
+ return () => (0, import_vue2.h)("div", {
130
+ ref: containerRef,
131
+ style: { height: "100%", ...props.style },
132
+ class: props.class
133
+ });
134
+ }
135
+ });
136
+
137
+ // src/CliPanel.ts
138
+ var import_vue3 = require("vue");
139
+ var import_cli2 = require("@qodalis/cli");
140
+ var PANEL_REF_METHODS = [
141
+ "open",
142
+ "collapse",
143
+ "toggleCollapse",
144
+ "hide",
145
+ "unhide",
146
+ "toggleHide",
147
+ "close",
148
+ "maximize",
149
+ "restore",
150
+ "toggleMaximize",
151
+ "resize",
152
+ "setPosition",
153
+ "addTab",
154
+ "closeTab",
155
+ "selectTab",
156
+ "renameTab",
157
+ "splitPane",
158
+ "closePane",
159
+ "getEngine",
160
+ "getState"
161
+ ];
162
+ function icon(svg, className) {
163
+ return (0, import_vue3.h)("svg", { class: className, ...(0, import_cli2.svgAttrs)(svg) }, svg.shapes.map((shape) => (0, import_vue3.h)(shape.tag, shape.attrs)));
164
+ }
165
+ var stop = (e) => e.stopPropagation();
166
+ var CliPanel = (0, import_vue3.defineComponent)({
167
+ name: "CliPanel",
168
+ props: {
169
+ options: { type: Object, default: void 0 },
170
+ modules: { type: Array, default: void 0 },
171
+ processors: { type: Array, default: void 0 },
172
+ services: { type: Object, default: void 0 },
173
+ onClose: { type: Function, default: void 0 },
174
+ collapsed: { type: Boolean, default: void 0 },
175
+ hidden: { type: Boolean, default: void 0 },
176
+ maximized: { type: Boolean, default: void 0 },
177
+ activeTabId: { type: Number, default: void 0 },
178
+ position: { type: String, default: void 0 },
179
+ height: { type: Number, default: void 0 },
180
+ width: { type: Number, default: void 0 },
181
+ style: { type: Object, default: void 0 },
182
+ class: { type: String, default: void 0 }
183
+ },
184
+ emits: [
185
+ "update:collapsed",
186
+ "update:hidden",
187
+ "update:maximized",
188
+ "update:activeTabId",
189
+ "update:position",
190
+ "update:height",
191
+ "update:width",
192
+ "close",
193
+ "tab-added",
194
+ "tab-closed",
195
+ "pane-split",
196
+ "pane-closed"
197
+ ],
198
+ setup(props, { expose, emit }) {
199
+ const config = (0, import_vue3.inject)(CliConfigKey, null);
200
+ const mergedOptions = (0, import_vue3.computed)(() => (0, import_cli2.mergeCliOptions)(props.options, config?.options));
201
+ const hostConfig = (0, import_vue3.computed)(() => (0, import_cli2.resolveCliHostConfig)(props, config));
202
+ const controlled = () => ({
203
+ collapsed: props.collapsed,
204
+ hidden: props.hidden,
205
+ maximized: props.maximized,
206
+ activeTabId: props.activeTabId,
207
+ position: props.position,
208
+ height: props.height,
209
+ width: props.width
210
+ });
211
+ const controller = new import_cli2.CliPanelController({
212
+ config: mergedOptions.value,
213
+ controlled: controlled(),
214
+ callbacks: {
215
+ onCollapsedChange: (v) => emit("update:collapsed", v),
216
+ onHiddenChange: (v) => emit("update:hidden", v),
217
+ onMaximizedChange: (v) => emit("update:maximized", v),
218
+ onActiveTabIdChange: (v) => emit("update:activeTabId", v),
219
+ onPositionChange: (v) => emit("update:position", v),
220
+ onHeightChange: (v) => emit("update:height", v),
221
+ onWidthChange: (v) => emit("update:width", v),
222
+ onClose: () => {
223
+ emit("close");
224
+ props.onClose?.();
225
+ },
226
+ onTabAdded: (e) => emit("tab-added", e),
227
+ onTabClosed: (e) => emit("tab-closed", e),
228
+ onPaneSplit: (e) => emit("pane-split", e),
229
+ onPaneClosed: (e) => emit("pane-closed", e)
230
+ }
231
+ });
232
+ const state = (0, import_vue3.shallowRef)(controller.getSnapshot());
233
+ const unsubscribe = controller.subscribe(() => {
234
+ state.value = controller.getSnapshot();
235
+ });
236
+ (0, import_vue3.watch)(controlled, (values) => controller.setControlled(values));
237
+ (0, import_vue3.watch)(mergedOptions, (options) => controller.setOptions(options));
238
+ const root = (0, import_vue3.shallowRef)(null);
239
+ (0, import_vue3.onMounted)(() => controller.setRootElement(root.value));
240
+ (0, import_vue3.onBeforeUnmount)(() => {
241
+ unsubscribe();
242
+ controller.destroy();
243
+ });
244
+ const exposed = {};
245
+ for (const method of PANEL_REF_METHODS) {
246
+ exposed[method] = controller[method].bind(controller);
247
+ }
248
+ expose(exposed);
249
+ const openDropdown = (e, dropdown) => {
250
+ if (!dropdown) return;
251
+ e.stopPropagation();
252
+ const anchor = e.currentTarget;
253
+ if (dropdown === "services") controller.toggleServicesDropdown(anchor);
254
+ else controller.toggleServersDropdown(anchor);
255
+ };
256
+ const renderHeader = (s) => {
257
+ const indicators = (0, import_cli2.statusIndicators)(s);
258
+ return (0, import_vue3.h)("div", { class: "cli-panel-header" }, [
259
+ (0, import_vue3.h)(
260
+ "div",
261
+ {
262
+ class: "cli-panel-resize-bar",
263
+ onMousedown: (e) => {
264
+ if (!s.resizable) return;
265
+ e.preventDefault();
266
+ controller.startPanelResize(e.clientX, e.clientY);
267
+ }
268
+ },
269
+ [(0, import_vue3.h)("div", { class: "cli-panel-resize-grip" })]
270
+ ),
271
+ (0, import_vue3.h)("div", { class: "cli-panel-header-content" }, [
272
+ (0, import_vue3.h)("p", { class: "cli-panel-title" }, [(0, import_vue3.h)("span", { class: "cli-panel-title-icon" }, [icon(import_cli2.TERMINAL_ICON)]), import_cli2.PANEL_LABELS.title]),
273
+ s.showStatusIndicators ? (0, import_vue3.h)(
274
+ "div",
275
+ { class: "cli-panel-status-indicators" },
276
+ indicators.map(
277
+ (item) => (0, import_vue3.h)(
278
+ "span",
279
+ {
280
+ key: item.key,
281
+ class: (0, import_cli2.joinClasses)("cli-panel-status-item", item.itemClass),
282
+ onClick: item.dropdown ? (e) => openDropdown(e, item.dropdown) : void 0
283
+ },
284
+ [
285
+ item.dotClass ? (0, import_vue3.h)("span", { class: `cli-panel-status-dot ${item.dotClass}` }) : null,
286
+ item.icon ? (0, import_vue3.h)("span", { class: (0, import_cli2.joinClasses)("cli-panel-status-icon", item.iconClass) }, item.icon) : null,
287
+ (0, import_vue3.h)("span", { class: "cli-panel-status-label" }, item.label)
288
+ ]
289
+ )
290
+ )
291
+ ) : null,
292
+ // Compact indicators for left/right positions (CSS controls visibility).
293
+ (0, import_vue3.h)(
294
+ "div",
295
+ { class: "cli-panel-status-indicators-compact" },
296
+ indicators.map(
297
+ (item) => (0, import_vue3.h)(
298
+ "span",
299
+ {
300
+ key: item.key,
301
+ class: (0, import_cli2.joinClasses)("cli-panel-status-compact-item", item.compactClass),
302
+ title: item.title,
303
+ onClick: item.dropdown ? (e) => openDropdown(e, item.dropdown) : void 0
304
+ },
305
+ [
306
+ item.compactDotClass ? (0, import_vue3.h)("span", { class: item.compactDotClass }) : null,
307
+ item.dotClass ? (0, import_vue3.h)("span", { class: `cli-panel-status-dot ${item.dotClass}` }) : null,
308
+ item.icon ? (0, import_vue3.h)("span", { class: (0, import_cli2.joinClasses)("cli-panel-status-icon", item.iconClass) }, item.icon) : null
309
+ ]
310
+ )
311
+ )
312
+ ),
313
+ (0, import_vue3.h)("div", { class: "cli-panel-action-buttons" }, [
314
+ (0, import_vue3.h)("div", { class: "cli-panel-btn-position-wrapper", onClick: stop }, [
315
+ (0, import_vue3.h)(
316
+ "button",
317
+ {
318
+ class: "cli-panel-btn cli-panel-btn-position",
319
+ title: import_cli2.PANEL_LABELS.movePanel,
320
+ onClick: () => controller.togglePositionDropdown()
321
+ },
322
+ [icon((0, import_cli2.positionIcon)(s.position))]
323
+ ),
324
+ s.positionDropdownOpen ? (0, import_vue3.h)(
325
+ "div",
326
+ { class: "cli-panel-position-dropdown" },
327
+ (0, import_cli2.positionOptions)(s).map(
328
+ (opt) => (0, import_vue3.h)(
329
+ "button",
330
+ { key: opt.position, class: opt.className, onClick: () => controller.setPosition(opt.position) },
331
+ [icon((0, import_cli2.positionIcon)(opt.position, 16)), opt.label]
332
+ )
333
+ )
334
+ ) : null
335
+ ]),
336
+ s.hideable ? (0, import_vue3.h)("button", { class: "cli-panel-btn cli-panel-btn-hide", title: import_cli2.PANEL_LABELS.hide, onClick: () => controller.hide() }, [icon(import_cli2.HIDE_ICON)]) : null,
337
+ (0, import_vue3.h)(
338
+ "button",
339
+ {
340
+ class: "cli-panel-btn",
341
+ title: s.maximized ? import_cli2.PANEL_LABELS.restore : import_cli2.PANEL_LABELS.maximize,
342
+ disabled: s.collapsed,
343
+ onClick: () => controller.toggleMaximize()
344
+ },
345
+ [icon(s.maximized ? import_cli2.RESTORE_ICON : import_cli2.MAXIMIZE_ICON)]
346
+ ),
347
+ (0, import_vue3.h)(
348
+ "button",
349
+ {
350
+ class: "cli-panel-btn",
351
+ title: s.collapsed ? import_cli2.PANEL_LABELS.expand : import_cli2.PANEL_LABELS.collapse,
352
+ onClick: () => controller.toggle()
353
+ },
354
+ [icon((0, import_cli2.collapseChevronIcon)(s.position, s.collapsed))]
355
+ ),
356
+ s.closable ? (0, import_vue3.h)("button", { class: "cli-panel-btn cli-panel-btn-close", title: import_cli2.PANEL_LABELS.close, onClick: () => controller.close() }, [icon(import_cli2.CLOSE_ICON)]) : null
357
+ ])
358
+ ]),
359
+ (0, import_vue3.h)("div", { class: (0, import_cli2.glowLineClass)(s) })
360
+ ]);
361
+ };
362
+ const renderTabs = (s) => (0, import_vue3.h)("div", { class: "cli-panel-tabs" }, [
363
+ (0, import_vue3.h)(
364
+ "ul",
365
+ { class: "cli-panel-tab-list" },
366
+ s.tabs.map(
367
+ (tab) => (0, import_vue3.h)(
368
+ "li",
369
+ {
370
+ key: tab.id,
371
+ class: (0, import_cli2.panelTabClass)(s, tab),
372
+ onClick: () => controller.selectTab(tab.id),
373
+ onDblclick: () => controller.startRename(tab.id),
374
+ onContextmenu: (e) => {
375
+ e.preventDefault();
376
+ e.stopPropagation();
377
+ controller.openContextMenu(tab.id, e.clientX, e.clientY);
378
+ }
379
+ },
380
+ tab.isEditing ? [
381
+ (0, import_vue3.h)("input", {
382
+ class: "cli-panel-tab-rename-input",
383
+ type: "text",
384
+ value: tab.title,
385
+ onVnodeMounted: (vnode) => {
386
+ const input = vnode.el;
387
+ input.focus();
388
+ input.select();
389
+ },
390
+ onKeydown: (e) => (0, import_cli2.handleRenameKey)(controller, tab.id, e.key, e.target.value),
391
+ onBlur: (e) => controller.commitRename(tab.id, e.target.value),
392
+ onClick: stop,
393
+ onDblclick: stop
394
+ })
395
+ ] : [
396
+ (0, import_vue3.h)("span", { class: (0, import_cli2.panelTabDotClass)(s, tab) }),
397
+ (0, import_vue3.h)("span", { class: "cli-panel-tab-title" }, tab.title),
398
+ (0, import_vue3.h)(
399
+ "button",
400
+ {
401
+ class: "cli-panel-tab-close-btn",
402
+ title: import_cli2.PANEL_LABELS.closeTab,
403
+ onClick: (e) => {
404
+ e.stopPropagation();
405
+ controller.closeTab(tab.id);
406
+ }
407
+ },
408
+ import_cli2.CLOSE_GLYPH
409
+ )
410
+ ]
411
+ )
412
+ )
413
+ ),
414
+ (0, import_vue3.h)("button", { class: "cli-panel-add-tab", title: import_cli2.PANEL_LABELS.newTerminal, onClick: () => controller.addTab() }, "+")
415
+ ]);
416
+ const renderInstances = (s) => (0, import_vue3.h)(
417
+ "div",
418
+ { class: "cli-panel-instances" },
419
+ s.tabs.map(
420
+ (tab) => (0, import_vue3.h)("div", { key: tab.id, class: "cli-panel-instance", style: { display: tab.id === s.activeTabId ? void 0 : "none" } }, [
421
+ (0, import_vue3.h)(
422
+ "div",
423
+ { class: (0, import_cli2.panesContainerClass)(s) },
424
+ tab.panes.flatMap((pane, i) => [
425
+ i > 0 ? (0, import_vue3.h)(
426
+ "div",
427
+ {
428
+ key: `divider-${pane.id}`,
429
+ class: "cli-panel-pane-divider",
430
+ onMousedown: (e) => {
431
+ e.preventDefault();
432
+ controller.startPaneResize(tab.id, i - 1, e.clientX, (0, import_cli2.panesContainerWidth)(e.target));
433
+ }
434
+ },
435
+ [(0, import_vue3.h)("div", { class: "cli-panel-pane-divider-grip" })]
436
+ ) : null,
437
+ (0, import_vue3.h)(
438
+ "div",
439
+ {
440
+ key: pane.id,
441
+ class: (0, import_cli2.paneClass)(s, tab.id, pane.id),
442
+ style: (0, import_cli2.paneStyle)(pane.widthPercent),
443
+ onClick: () => controller.activatePane(tab.id, pane.id)
444
+ },
445
+ [
446
+ tab.panes.length > 1 ? (0, import_vue3.h)(
447
+ "button",
448
+ {
449
+ class: "cli-panel-pane-close-btn",
450
+ title: import_cli2.PANEL_LABELS.closePane,
451
+ onClick: (e) => {
452
+ e.stopPropagation();
453
+ controller.closePane(pane.id);
454
+ }
455
+ },
456
+ import_cli2.CLOSE_GLYPH
457
+ ) : null,
458
+ (0, import_vue3.h)(Cli, {
459
+ options: mergedOptions.value,
460
+ modules: hostConfig.value.modules,
461
+ processors: hostConfig.value.processors,
462
+ services: hostConfig.value.services,
463
+ snapshot: pane.snapshot,
464
+ style: { height: "100%" },
465
+ onReady: (engine) => controller.registerEngine(tab.id, pane.id, engine)
466
+ })
467
+ ]
468
+ )
469
+ ])
470
+ )
471
+ ])
472
+ )
473
+ );
474
+ const renderContextMenu = (s) => (0, import_vue3.h)(
475
+ "div",
476
+ { class: "cli-panel-context-menu", style: (0, import_cli2.contextMenuStyle)(s), onClick: stop },
477
+ (0, import_cli2.contextMenuItems)(s).flatMap((item) => [
478
+ item.separatorBefore ? (0, import_vue3.h)("div", { class: "cli-panel-context-menu-separator" }) : null,
479
+ (0, import_vue3.h)(
480
+ "button",
481
+ {
482
+ class: (0, import_cli2.joinClasses)("cli-panel-context-menu-item", item.destructive && "destructive"),
483
+ disabled: item.disabled,
484
+ onClick: () => (0, import_cli2.runContextMenuAction)(controller, item.action)
485
+ },
486
+ item.label
487
+ )
488
+ ])
489
+ );
490
+ const renderStatusDropdown = (s) => {
491
+ const dropdown = (0, import_cli2.openStatusDropdown)(s);
492
+ if (!dropdown) return null;
493
+ return (0, import_vue3.h)("div", { class: "cli-panel-services-dropdown", style: dropdown.style, onClick: stop }, [
494
+ (0, import_vue3.h)("div", { class: "cli-panel-services-dropdown-header" }, dropdown.header),
495
+ (0, import_vue3.h)(
496
+ "div",
497
+ { class: "cli-panel-services-dropdown-list" },
498
+ dropdown.rows.map(
499
+ (row) => (0, import_vue3.h)("div", { key: row.key, class: "cli-panel-services-dropdown-item" }, [
500
+ (0, import_vue3.h)("span", { class: row.dotClass }),
501
+ (0, import_vue3.h)("div", { class: "cli-panel-svc-info" }, [
502
+ (0, import_vue3.h)("span", { class: "cli-panel-svc-name" }, row.name),
503
+ row.description ? (0, import_vue3.h)("span", { class: "cli-panel-svc-desc" }, row.description) : null
504
+ ]),
505
+ dropdown.kind === "servers" ? (0, import_vue3.h)("div", { class: "cli-panel-srv-meta" }, [
506
+ (0, import_vue3.h)("span", { class: "cli-panel-svc-status" }, row.status),
507
+ ...row.meta.map((m) => (0, import_vue3.h)("span", { key: m, class: "cli-panel-svc-desc" }, m))
508
+ ]) : (0, import_vue3.h)("span", { class: "cli-panel-svc-status" }, row.status)
509
+ ])
510
+ )
511
+ ),
512
+ dropdown.rows.length === 0 ? (0, import_vue3.h)("div", { class: "cli-panel-services-dropdown-empty" }, dropdown.emptyText) : null
513
+ ]);
514
+ };
515
+ return () => {
516
+ const s = state.value;
517
+ if (!s.visible) return null;
518
+ return (0, import_vue3.h)(import_vue3.Fragment, [
519
+ s.hidden ? (0, import_vue3.h)(
520
+ "button",
521
+ {
522
+ class: "cli-panel-hide-tab",
523
+ "data-position": s.position,
524
+ "data-hide-align": s.hideAlignment,
525
+ style: s.themeStyles,
526
+ title: import_cli2.PANEL_LABELS.showCli,
527
+ onClick: () => controller.unhide()
528
+ },
529
+ [
530
+ icon(import_cli2.HIDE_TAB_TERMINAL_ICON, "cli-panel-hide-tab-icon"),
531
+ (0, import_vue3.h)("span", { class: "cli-panel-hide-tab-label" }, import_cli2.PANEL_LABELS.title),
532
+ icon((0, import_cli2.hideTabChevronIcon)(s.position), "cli-panel-hide-tab-arrow")
533
+ ]
534
+ ) : null,
535
+ (0, import_vue3.h)(
536
+ "div",
537
+ {
538
+ ref: root,
539
+ class: (0, import_cli2.panelWrapperClass)(s, props.class),
540
+ style: { ...(0, import_cli2.panelWrapperStyle)(s), ...props.style },
541
+ "data-position": s.position,
542
+ "data-resizable": String(s.resizable),
543
+ "data-closable": String(s.closable),
544
+ "data-hideable": String(s.hideable)
545
+ },
546
+ [
547
+ renderHeader(s),
548
+ s.initialized ? (0, import_vue3.h)("div", { class: "cli-panel-content", style: s.collapsed ? { display: "none" } : void 0 }, [
549
+ renderTabs(s),
550
+ renderInstances(s)
551
+ ]) : null
552
+ ]
553
+ ),
554
+ s.contextMenu.visible ? renderContextMenu(s) : null,
555
+ renderStatusDropdown(s)
556
+ ]);
557
+ };
558
+ }
559
+ });
560
+
561
+ // src/CliProvider.ts
562
+ var import_vue5 = require("vue");
563
+
564
+ // src/useCliEngine.ts
565
+ var import_vue4 = require("vue");
566
+ var import_cli3 = require("@qodalis/cli");
567
+ function useCliEngine(containerRef, config) {
568
+ const engine = (0, import_vue4.shallowRef)(null);
569
+ (0, import_vue4.onMounted)(async () => {
570
+ if (!containerRef.value) return;
571
+ const e = (0, import_cli3.createCliEngine)(containerRef.value, { ...config, framework: "Vue" });
572
+ await e.start();
573
+ engine.value = e;
574
+ });
575
+ (0, import_vue4.onBeforeUnmount)(() => {
576
+ engine.value?.destroy();
577
+ engine.value = null;
578
+ });
579
+ return engine;
580
+ }
581
+
582
+ // src/CliProvider.ts
583
+ var CliProvider = (0, import_vue5.defineComponent)({
584
+ name: "CliProvider",
585
+ props: {
586
+ modules: {
587
+ type: Array,
588
+ default: void 0
589
+ },
590
+ processors: {
591
+ type: Array,
592
+ default: void 0
593
+ },
594
+ options: {
595
+ type: Object,
596
+ default: void 0
597
+ },
598
+ services: {
599
+ type: Object,
600
+ default: void 0
601
+ },
602
+ style: {
603
+ type: Object,
604
+ default: void 0
605
+ }
606
+ },
607
+ emits: ["ready"],
608
+ setup(props, { slots, emit }) {
609
+ const containerRef = (0, import_vue5.ref)(null);
610
+ const engine = useCliEngine(containerRef, {
611
+ modules: props.modules,
612
+ processors: props.processors,
613
+ options: props.options,
614
+ services: props.services
615
+ });
616
+ (0, import_vue5.provide)(CliInjectionKey, { engine });
617
+ return () => (0, import_vue5.h)("div", { style: { height: "100%" } }, [
618
+ (0, import_vue5.h)("div", {
619
+ ref: containerRef,
620
+ style: { height: "100%", ...props.style }
621
+ }),
622
+ slots.default?.()
623
+ ]);
624
+ }
625
+ });
626
+
627
+ // src/useCli.ts
628
+ var import_vue6 = require("vue");
629
+ function useCli() {
630
+ const ctx = (0, import_vue6.inject)(CliInjectionKey);
631
+ if (!ctx) {
632
+ throw new Error(
633
+ "useCli() must be used inside a <CliProvider> component"
634
+ );
635
+ }
636
+ return ctx;
637
+ }
638
+
639
+ // src/index.ts
640
+ var import_cli4 = require("@qodalis/cli");
641
+ // Annotate the CommonJS export names for ESM import in node:
642
+ 0 && (module.exports = {
643
+ Cli,
644
+ CliConfigKey,
645
+ CliConfigProvider,
646
+ CliEngine,
647
+ CliInjectionKey,
648
+ CliPanel,
649
+ CliProvider,
650
+ useCli,
651
+ useCliEngine
652
+ });
653
+ //# sourceMappingURL=index.js.map