@hoox-sh/hoox-tui 0.3.0 → 0.3.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hoox-sh/hoox-tui",
3
- "version": "0.3.0",
3
+ "version": "0.3.2",
4
4
  "description": "Hoox algorithmic trading terminal operations center — OpenTUI dashboard",
5
5
  "type": "module",
6
6
  "main": "./dist/main.js",
@@ -33,10 +33,8 @@
33
33
  },
34
34
  "dependencies": {
35
35
  "@hoox-sh/hoox-shared": "^1.3.0",
36
- "@opentui-ui/dialog": "^0.1.2",
37
- "@opentui-ui/toast": "^0.0.5",
38
- "@opentui/core": "^0.5.1",
39
- "@opentui/react": "^0.5.1",
36
+ "@opentui/core": "0.5.1",
37
+ "@opentui/react": "0.5.1",
40
38
  "immer": "^11.1.8",
41
39
  "react": "^19.2.6",
42
40
  "smol-toml": "^1.6.1",
package/src/app.tsx CHANGED
@@ -20,7 +20,6 @@
20
20
  */
21
21
  import { useState, useEffect, useCallback } from "react";
22
22
  import { useKeyboard } from "@opentui/react";
23
- import { DialogProvider, useDialog } from "@opentui-ui/dialog/react";
24
23
  import { useServiceStore, useUIStore, Colors } from "@hoox-sh/hoox-shared";
25
24
  import { restoreSession, saveSession } from "@hoox-sh/hoox-shared";
26
25
  import type { ViewId } from "@hoox-sh/hoox-shared";
@@ -42,7 +41,11 @@ import {
42
41
  toastReconnectedMode,
43
42
  } from "./components/ui/connection-toasts";
44
43
  import { getRendererRef } from "./hooks";
45
- import type { DialogHandle } from "./components/ui/dialog";
44
+ import {
45
+ DialogProvider,
46
+ useDialog,
47
+ type DialogHandle,
48
+ } from "./components/ui/dialog";
46
49
  import {
47
50
  getViewFactory,
48
51
  getViewShortcutMap,
@@ -95,19 +98,14 @@ function quitApp(): void {
95
98
  */
96
99
  export function AppRoot({ safeMode = false }: { safeMode?: boolean }) {
97
100
  return (
98
- <DialogProvider
99
- size="medium"
100
- backdropColor={Colors.backdrop}
101
- backdropOpacity={0.35}
102
- >
101
+ <DialogProvider>
103
102
  <AppRootInner safeMode={safeMode} />
104
103
  </DialogProvider>
105
104
  );
106
105
  }
107
106
 
108
107
  function AppRootInner({ safeMode = false }: { safeMode?: boolean }) {
109
- // DialogProvider is required for useDialog; cast to our thin DialogHandle.
110
- const dialog = useDialog() as unknown as DialogHandle;
108
+ const dialog = useDialog();
111
109
  const [restoring, setRestoring] = useState(true);
112
110
  const activeView = useUIStore((s) => s.activeView);
113
111
  const commandPaletteOpen = useUIStore((s) => s.commandPaletteOpen);
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Copyright (c) 2026 HOOX · HOOX · jango-blockchained (hoox-sh)
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ */
5
+
6
+ /** Module-level open count for DialogProvider (avoids React store cycles). */
7
+ let openDialogCount = 0;
8
+
9
+ export function setOpenDialogCount(n: number): void {
10
+ openDialogCount = Math.max(0, n);
11
+ }
12
+
13
+ export function isHooxDialogOpen(): boolean {
14
+ return openDialogCount > 0;
15
+ }