@dongnanyang/deploy-cli 0.11.0 → 0.11.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.
Files changed (2) hide show
  1. package/dist/tui/main.js +21 -1
  2. package/package.json +1 -1
package/dist/tui/main.js CHANGED
@@ -3,7 +3,7 @@ import { n as loadConfig } from "../config-xUl8Oa3T.js";
3
3
  import { t as export_helper_default } from "../export-helper-CIEcxb5I.js";
4
4
  import { i as createDocker, t as checkProjectHealth } from "../health-CZL7Ghs8.js";
5
5
  import { Box, Text, createApp, useApp, useInput } from "@vue-tui/runtime";
6
- import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createTextVNode, createVNode, defineComponent, openBlock, ref, renderList, shallowRef, toDisplayString, watch, withCtx } from "vue";
6
+ import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createTextVNode, createVNode, defineComponent, onScopeDispose, openBlock, ref, renderList, shallowRef, toDisplayString, toValue, watch, withCtx } from "vue";
7
7
  import { ScrollBox } from "@vue-tui/components";
8
8
  //#region src/tui/composables/useKeymap.ts
9
9
  /** 六面板(spec 6.4):键位 1-6 与数组序一一对应 */
@@ -49,9 +49,27 @@ function dispatchKey(event) {
49
49
  if (ch === "?") return { kind: "help" };
50
50
  return null;
51
51
  }
52
+ /** 模态挂载集(R17):任一确认弹窗可见 = 全局键 1-6/q/? 停用(弹窗独占 y/n/enter/escape),防按 3 静默丢弃待确认动作 / 按 q 中途退出 */
53
+ const modalTokens = /* @__PURE__ */ new Set();
54
+ const modalOpen = ref(false);
55
+ /**
56
+ * 模态登记(ConfirmModal 在 visible 时挂闸):期间 useKeymap 全局分发暂停。
57
+ * 按组件实例计数(token 随作用域释放),多弹窗/卸载不残留。
58
+ */
59
+ function useModalGate(visible) {
60
+ const token = {};
61
+ const sync = (open) => {
62
+ if (open) modalTokens.add(token);
63
+ else modalTokens.delete(token);
64
+ modalOpen.value = modalTokens.size > 0;
65
+ };
66
+ watch(() => toValue(visible), sync, { immediate: true });
67
+ onScopeDispose(() => sync(false));
68
+ }
52
69
  /** 键位路由接线:useInput 订阅 → dispatchKey → 回调;组件不碰输入流本体 */
53
70
  function useKeymap(handlers) {
54
71
  useInput((event) => {
72
+ if (modalOpen.value) return;
55
73
  const action = dispatchKey(event);
56
74
  if (action === null) return;
57
75
  if (action.kind === "panel") handlers.onPanel(action.panel);
@@ -65,6 +83,7 @@ function useKeymap(handlers) {
65
83
  * 破坏性动作二次确认弹窗(spec §6.3:down/rm/restart 等 TUI 需确认)。
66
84
  * 只吃 ViewModel(visible/message),动作由父组件在 confirm 事件后执行。
67
85
  * 键位:y/enter 确认、n/escape 取消;不可见时不响应。
86
+ * R17:visible 期间挂模态闸——全局键 1-6/q/? 一并停用(弹窗独占输入)。
68
87
  */
69
88
  const _sfc_main$6 = /*@__PURE__*/ defineComponent({
70
89
  __name: "ConfirmModal",
@@ -83,6 +102,7 @@ const _sfc_main$6 = /*@__PURE__*/ defineComponent({
83
102
  __expose();
84
103
  const props = __props;
85
104
  const emit = __emit;
105
+ useModalGate(() => props.visible);
86
106
  useInput((event) => {
87
107
  if (!props.visible) return;
88
108
  const name = keyName(event);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dongnanyang/deploy-cli",
3
- "version": "0.11.0",
3
+ "version": "0.11.1",
4
4
  "description": "Local CLI TUI for SSH tunnels & deploy scripts",
5
5
  "type": "module",
6
6
  "main": "./dist/api.js",