@vizejs/fresco 0.719.0 → 0.720.0
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/{accessibility-DwzT925M.d.mts → accessibility-D7iuITvU.d.mts} +4 -3
- package/dist/{accessibility-DwzT925M.d.mts.map → accessibility-D7iuITvU.d.mts.map} +1 -1
- package/dist/{app-_QmZ-PoH.d.mts → app-CJh9qfJI.d.mts} +3 -3
- package/dist/{app-_QmZ-PoH.d.mts.map → app-CJh9qfJI.d.mts.map} +1 -1
- package/dist/{app-C_wFlWSV.mjs → app-CjfLCWic.mjs} +110 -16
- package/dist/app-CjfLCWic.mjs.map +1 -0
- package/dist/components/index.d.mts +2 -2
- package/dist/components/index.mjs +2 -2
- package/dist/{components-DzkL-yHj.mjs → components-DgDohiXo.mjs} +348 -79
- package/dist/components-DgDohiXo.mjs.map +1 -0
- package/dist/composables/index.d.mts +1 -1
- package/dist/composables/index.mjs +3 -3
- package/dist/{composables-BJeirPSH.mjs → composables-BxxLIBdJ.mjs} +3 -3
- package/dist/{composables-BJeirPSH.mjs.map → composables-BxxLIBdJ.mjs.map} +1 -1
- package/dist/{index-Ddp2Txtm.d.mts → index-BOV-0YqV.d.mts} +2 -2
- package/dist/{index-Ddp2Txtm.d.mts.map → index-BOV-0YqV.d.mts.map} +1 -1
- package/dist/{index-BCxB_ZLV.d.mts → index-DAhTRsXN.d.mts} +174 -119
- package/dist/index-DAhTRsXN.d.mts.map +1 -0
- package/dist/index.d.mts +6 -6
- package/dist/index.mjs +5 -5
- package/dist/{protocol-DavoeNLn.d.mts → protocol-C1DHP36Z.d.mts} +5 -2
- package/dist/protocol-C1DHP36Z.d.mts.map +1 -0
- package/dist/testing/index.d.mts +4 -2
- package/dist/testing/index.d.mts.map +1 -1
- package/dist/testing/index.mjs +2 -1
- package/dist/testing/index.mjs.map +1 -1
- package/dist/{useBoxMetrics-lF5Myjc7.mjs → useBoxMetrics-BMD1acRU.mjs} +2 -2
- package/dist/{useBoxMetrics-lF5Myjc7.mjs.map → useBoxMetrics-BMD1acRU.mjs.map} +1 -1
- package/package.json +2 -2
- package/dist/app-C_wFlWSV.mjs.map +0 -1
- package/dist/components-DzkL-yHj.mjs.map +0 -1
- package/dist/index-BCxB_ZLV.d.mts.map +0 -1
- package/dist/protocol-DavoeNLn.d.mts.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as FrescoRenderNodeKind, m as FrescoInputEvent } from "./protocol-
|
|
1
|
+
import { C as FrescoRenderNodeKind, m as FrescoInputEvent } from "./protocol-C1DHP36Z.mjs";
|
|
2
2
|
import { InjectionKey, Ref, RendererElement, RendererNode } from "vue";
|
|
3
3
|
import { LayoutResultNapi } from "@vizejs/fresco-native";
|
|
4
4
|
|
|
@@ -95,7 +95,8 @@ interface FrescoElement extends FrescoNode, RendererElement {}
|
|
|
95
95
|
*/
|
|
96
96
|
declare function createRenderer$1(options?: FrescoRendererOptions | (() => void)): import("vue").Renderer<FrescoElement> & {
|
|
97
97
|
/** Return one live host node by its stable identifier. */getNode(id: number): FrescoHostNode | undefined; /** Find one node under the supplied subtree without crossing its boundary. */
|
|
98
|
-
findDescendantById(root: FrescoHostNode, id: number): FrescoHostNode | undefined; /**
|
|
98
|
+
findDescendantById(root: FrescoHostNode, id: number): FrescoHostNode | undefined; /** Find the live host node registered for one logical focus target. */
|
|
99
|
+
findNodeByFocusId(root: FrescoHostNode, focusId: string): FrescoHostNode | undefined; /** Detach and dispose a registered node and every descendant exactly once. */
|
|
99
100
|
destroyRecursively(id: number): boolean;
|
|
100
101
|
/**
|
|
101
102
|
* Return the deepest topmost node under one native-layout coordinate.
|
|
@@ -126,4 +127,4 @@ interface AriaState {
|
|
|
126
127
|
}
|
|
127
128
|
//#endregion
|
|
128
129
|
export { FrescoHostNode as a, FrescoInputEventPhase as c, FrescoNodeUpdateKind as d, FrescoRendererOptions as f, FrescoElement as i, FrescoNode as l, createRenderer$1 as m, AriaState as n, FrescoInputDispatchResult as o, FrescoRoutedInputEvent as p, FrescoDeclaredSize as r, FrescoInputEventHandler as s, AriaRole as t, FrescoNodeLifecycleHooks as u };
|
|
129
|
-
//# sourceMappingURL=accessibility-
|
|
130
|
+
//# sourceMappingURL=accessibility-D7iuITvU.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accessibility-
|
|
1
|
+
{"version":3,"file":"accessibility-D7iuITvU.d.mts","names":[],"sources":["../src/renderer.ts","../src/accessibility.ts"],"mappings":";;;;;;UAmBiB,cAAA;EAMU;EAAA,SAJhB,EAAA;EAMmB;EAAA,SAJnB,IAAA,EAAM,oBAAA;EAMgB;EAAA,SAJtB,KAAA,EAAO,QAAA,CAAS,MAAA;EAJhB;EAAA,SAMA,QAAA,WAAmB,cAAA;EAJb;EAAA,SAMN,MAAA,EAAQ,cAAA;EAJD;EAAA,SAMP,IAAA;AAAA;;UAIM,kBAAA;EANE;EAAA,SAQR,KAAA;EANI;EAAA,SAQJ,MAAM;AAAA;;KAIL,oBAAA;;KAGA,qBAAA;AAHZ;AAAA,UAMiB,sBAAA,eAAqC,gBAAA,GAAmB,gBAAA;;WAE9D,KAAA,EAAO,KAAA;EARc;EAAA,SAUrB,MAAA,EAAQ,cAAA;EAPc;EAAA,SAStB,aAAA,EAAe,cAAA;EATO;EAAA,SAWtB,KAAA,EAAO,qBAAA;EARD;EAAA,SAUN,gBAAA;EAV4B;EAAA,SAY5B,kBAAA;EAZ8D;EAcvE,cAAA;EAViB;EAYjB,eAAA;AAAA;;KAIU,uBAAA,eAAsC,gBAAA,GAAmB,gBAAA,KACnE,KAAA,EAAO,sBAAA,CAAuB,KAAA;;UAIf,yBAAA;EAzBwD;EAAA,SA2B9D,MAAA,EAAQ,cAAc;EAzBf;EAAA,SA2BP,OAAA;EAzBQ;EAAA,SA2BR,gBAAA;EAzBe;EAAA,SA2Bf,kBAAA;AAAA;;UAGM,wBAAA;EAtBf;EAwBA,QAAA,EAAU,IAAA,EAAM,cAAA;EAtBD;EAwBf,QAAA,EAAU,IAAA,EAAM,cAAA,EAAgB,IAAA,EAAM,oBAAA;EApB5B;EAsBV,QAAA,EAAU,IAAA,EAAM,cAAA,EAAgB,QAAA,EAAU,kBAAA,EAAoB,OAAA,EAAS,kBAAA;EAtBtC;EAwBjC,QAAA,EAAU,IAAA,EAAM,cAAA;AAAA;;UAID,qBAAA;EA3Bc;EA6B7B,UAAA;EA9BkC;EAgClC,SAAA,GAAY,wBAAwB;AAAA;;UAIrB,UAAA,SAAmB,YAAA,EAAc,cAAA;EAChD,EAAA;EACA,IAAA,EAAM,oBAAA;EACN,KAAA,EAAO,MAAA;EACP,QAAA,EAAU,UAAA;EACV,MAAA,EAAQ,UAAA;EACR,IAAA;AAAA;;UAIe,aAAA,SAAsB,UAAA,EAAY,eAAe;;;;iBAkPlD,gBAAA,CAAe,OAAA,GAAS,qBAAA,gCAAyC,QAAA,CAAA,aAAA;EAhRhE,+EA2RQ,cAAA;2BAII,cAAA,EAAc,EAAA,WAAe,cAAA,cA3RxC;0BAqSU,cAAA,EAAc,OAAA,WAAoB,cAAA,cAnS5C;;EAAuD;;;;gBAoT7D,cAAA,EAAc,CAAA,UACX,CAAA,UACA,OAAA,WACS,gBAAA,KACjB,cAAA,cA5TW;8BAgUc,gBAAA,EAAgB,QAAA,UAC1B,KAAA,EACT,KAAA,GACN,yBAAA;AAAA;;;;KC7YK,QAAA;;UAwBK,SAAA;EACf,IAAA;EACA,OAAA;EACA,QAAA;EACA,QAAA;EACA,SAAA;EACA,eAAA;EACA,QAAA;EACA,QAAA;EACA,QAAA;EACA,WAAA;EACA,QAAA;EACA,QAAA;EACA,QAAA;AAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as FrescoRenderNodeKind, F as ResizeEvent, N as MouseEvent, P as PasteEvent, j as KeyEvent, m as FrescoInputEvent, n as FocusEvent, t as CompositionEvent } from "./protocol-
|
|
2
|
-
import { a as FrescoHostNode, d as FrescoNodeUpdateKind, r as FrescoDeclaredSize, u as FrescoNodeLifecycleHooks } from "./accessibility-
|
|
1
|
+
import { C as FrescoRenderNodeKind, F as ResizeEvent, N as MouseEvent, P as PasteEvent, j as KeyEvent, m as FrescoInputEvent, n as FocusEvent, t as CompositionEvent } from "./protocol-C1DHP36Z.mjs";
|
|
2
|
+
import { a as FrescoHostNode, d as FrescoNodeUpdateKind, r as FrescoDeclaredSize, u as FrescoNodeLifecycleHooks } from "./accessibility-D7iuITvU.mjs";
|
|
3
3
|
import { Component, Plugin, Ref, VNode } from "vue";
|
|
4
4
|
import { LayoutResultNapi, TerminalInfoNapi } from "@vizejs/fresco-native";
|
|
5
5
|
|
|
@@ -267,4 +267,4 @@ declare function render(root: AppRoot, options?: AppOptions | WritableStreamLike
|
|
|
267
267
|
declare function renderToString(root: AppRoot, options?: RenderToStringOptions): string;
|
|
268
268
|
//#endregion
|
|
269
269
|
export { FrescoTreeInspection as A, FrescoDevtools as C, FrescoDevtoolsSnapshot as D, FrescoDevtoolsRenderMetrics as E, formatFrescoDebugOverlay as M, inspectFrescoTree as N, FrescoLayoutInspection as O, FrescoDebugOverlayOptions as S, FrescoDevtoolsOptions as T, KittyFlagName as _, RenderMetrics as a, kittyModifiers as b, createApp as c, lastKeyEvent as d, lastMouseEvent as f, renderToString as g, render as h, RenderInstance as i, createFrescoDevtools as j, FrescoNodeInspection as k, lastCompositionEvent as l, lastResizeEvent as m, AppOptions as n, RenderOptions as o, lastPasteEvent as p, Instance as r, RenderToStringOptions as s, App$1 as t, lastFocusEvent as u, KittyKeyboardOptions as v, FrescoDevtoolsEvent as w, resolveKittyFlags as x, kittyFlags as y };
|
|
270
|
-
//# sourceMappingURL=app-
|
|
270
|
+
//# sourceMappingURL=app-CJh9qfJI.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-
|
|
1
|
+
{"version":3,"file":"app-CJh9qfJI.d.mts","names":[],"sources":["../src/devtools.ts","../src/kittyKeyboard.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AAkB,KAAA;;;;iBAgb7D,MAAA,CACd,IAAA,EAAM,OAAA,EACN,OAAA,GAAS,UAAA,GAAa,kBAAA,GACrB,cAAA;;;;iBAgCa,cAAA,CAAe,IAAA,EAAM,OAAA,EAAS,OAAA,GAAS,qBAA0B"}
|
|
@@ -86,6 +86,9 @@ function stringValue$1(value) {
|
|
|
86
86
|
function numberValue(value) {
|
|
87
87
|
return typeof value === "number" && Number.isFinite(value) ? value : void 0;
|
|
88
88
|
}
|
|
89
|
+
function integerValue(value) {
|
|
90
|
+
return typeof value === "number" && Number.isInteger(value) && value >= -2147483648 && value <= 2147483647 ? value : void 0;
|
|
91
|
+
}
|
|
89
92
|
function booleanValue(value) {
|
|
90
93
|
return typeof value === "boolean" ? value : void 0;
|
|
91
94
|
}
|
|
@@ -107,6 +110,7 @@ function normalizeFrescoStyle(value) {
|
|
|
107
110
|
const style = {};
|
|
108
111
|
style.display = enumValue(source.display, displays);
|
|
109
112
|
style.position = enumValue(source.position, positions);
|
|
113
|
+
style.zIndex = integerValue(firstValue(source, "zIndex", "z_index"));
|
|
110
114
|
style.top = stringValue$1(source.top);
|
|
111
115
|
style.right = stringValue$1(source.right);
|
|
112
116
|
style.bottom = stringValue$1(source.bottom);
|
|
@@ -780,6 +784,32 @@ function useCursor() {
|
|
|
780
784
|
return { setCursorPosition };
|
|
781
785
|
}
|
|
782
786
|
//#endregion
|
|
787
|
+
//#region src/focusRouting.ts
|
|
788
|
+
/** Find the live host node registered for one logical focus target. */
|
|
789
|
+
function findHostNodeByFocusId(root, focusId) {
|
|
790
|
+
if (root.props.focusId === focusId) return root;
|
|
791
|
+
for (const child of root.children) {
|
|
792
|
+
const match = findHostNodeByFocusId(child, focusId);
|
|
793
|
+
if (match) return match;
|
|
794
|
+
}
|
|
795
|
+
}
|
|
796
|
+
/** Derive the application fallback after focused handlers have had first refusal. */
|
|
797
|
+
function defaultInputAction(input, result, exitOnCtrlC) {
|
|
798
|
+
if (result?.defaultPrevented || input.eventType !== "key") return void 0;
|
|
799
|
+
if (input.key === "tab") return "focus-next";
|
|
800
|
+
if (input.key === "backtab") return "focus-previous";
|
|
801
|
+
if (exitOnCtrlC && input.char === "c" && input.modifiers?.ctrl) return "exit";
|
|
802
|
+
}
|
|
803
|
+
/**
|
|
804
|
+
* Route one normalized terminal packet to the live host node associated with
|
|
805
|
+
* the active logical focus ID.
|
|
806
|
+
*/
|
|
807
|
+
function routeFocusedInput(renderer, root, focusId, input) {
|
|
808
|
+
if (!root || focusId === void 0) return void 0;
|
|
809
|
+
const target = renderer.findNodeByFocusId(root, focusId);
|
|
810
|
+
return target ? renderer.dispatchInput(target.id, input) : void 0;
|
|
811
|
+
}
|
|
812
|
+
//#endregion
|
|
783
813
|
//#region src/layoutMetrics.ts
|
|
784
814
|
let lastRenderLayouts = [];
|
|
785
815
|
/** Replace the layout snapshot exposed by the most recent native render. */
|
|
@@ -806,15 +836,59 @@ function measureElement(node) {
|
|
|
806
836
|
}
|
|
807
837
|
//#endregion
|
|
808
838
|
//#region src/mouseRouting.ts
|
|
839
|
+
/** Create isolated pointer-routing state for one mounted Fresco application. */
|
|
840
|
+
function createMouseRoutingState() {
|
|
841
|
+
return { hoveredTargetId: void 0 };
|
|
842
|
+
}
|
|
843
|
+
const mountedRootStates = /* @__PURE__ */ new WeakMap();
|
|
844
|
+
function stateForMountedRoot(root) {
|
|
845
|
+
const existing = mountedRootStates.get(root);
|
|
846
|
+
if (existing) return existing;
|
|
847
|
+
const state = createMouseRoutingState();
|
|
848
|
+
mountedRootStates.set(root, state);
|
|
849
|
+
return state;
|
|
850
|
+
}
|
|
851
|
+
function pointerTransition(event, kind) {
|
|
852
|
+
return {
|
|
853
|
+
...event,
|
|
854
|
+
kind
|
|
855
|
+
};
|
|
856
|
+
}
|
|
857
|
+
function routePointerTransitions(renderer, target, event, state, publish) {
|
|
858
|
+
if (event.kind !== "moved" && event.kind !== "drag") return;
|
|
859
|
+
const nextTargetId = target?.id;
|
|
860
|
+
if (state.hoveredTargetId === nextTargetId) return;
|
|
861
|
+
const previousTargetId = state.hoveredTargetId;
|
|
862
|
+
state.hoveredTargetId = nextTargetId;
|
|
863
|
+
if (previousTargetId !== void 0) {
|
|
864
|
+
const leave = pointerTransition(event, "leave");
|
|
865
|
+
try {
|
|
866
|
+
renderer.dispatchInput(previousTargetId, leave);
|
|
867
|
+
} finally {
|
|
868
|
+
publish?.(leave);
|
|
869
|
+
}
|
|
870
|
+
}
|
|
871
|
+
if (nextTargetId !== void 0) {
|
|
872
|
+
const enter = pointerTransition(event, "enter");
|
|
873
|
+
try {
|
|
874
|
+
renderer.dispatchInput(nextTargetId, enter);
|
|
875
|
+
} finally {
|
|
876
|
+
publish?.(enter);
|
|
877
|
+
}
|
|
878
|
+
}
|
|
879
|
+
}
|
|
809
880
|
/** Hit-test one normalized mouse packet and route it through the host tree. */
|
|
810
|
-
function routeMouseInput(renderer, root, event, layouts) {
|
|
881
|
+
function routeMouseInput(renderer, root, event, layouts, state, publishTransition) {
|
|
811
882
|
const target = renderer.hitTest(root, event.x, event.y, layouts);
|
|
883
|
+
if (state) routePointerTransitions(renderer, target, event, state, publishTransition);
|
|
812
884
|
if (target) renderer.dispatchInput(target.id, event);
|
|
813
885
|
}
|
|
814
|
-
/** Route
|
|
815
|
-
function routeAndPublishMouseInput(renderer, root, event, layouts, sink) {
|
|
886
|
+
/** Route transitions and the native packet, publishing each even when a handler throws. */
|
|
887
|
+
function routeAndPublishMouseInput(renderer, root, event, layouts, sink, state) {
|
|
816
888
|
try {
|
|
817
|
-
if (root) routeMouseInput(renderer, root, event, layouts)
|
|
889
|
+
if (root) routeMouseInput(renderer, root, event, layouts, state ?? stateForMountedRoot(root), (transition) => {
|
|
890
|
+
sink.value = transition;
|
|
891
|
+
});
|
|
818
892
|
} finally {
|
|
819
893
|
sink.value = event;
|
|
820
894
|
}
|
|
@@ -903,6 +977,13 @@ function clipsDescendants(node) {
|
|
|
903
977
|
const style = normalizeFrescoStyle(node.props.style);
|
|
904
978
|
return clipsOverflow(style?.overflow ?? style?.overflowX ?? style?.overflowY);
|
|
905
979
|
}
|
|
980
|
+
function zIndex(node) {
|
|
981
|
+
const style = node.props.style;
|
|
982
|
+
if (typeof style !== "object" || style === null) return 0;
|
|
983
|
+
const record = style;
|
|
984
|
+
const value = record.zIndex !== void 0 ? record.zIndex : record.z_index;
|
|
985
|
+
return typeof value === "number" && Number.isInteger(value) && value >= -2147483648 && value <= 2147483647 ? value : 0;
|
|
986
|
+
}
|
|
906
987
|
function containsPoint(layout, clip, x, y) {
|
|
907
988
|
return x >= layout.x && x < layout.x + layout.width && y >= layout.y && y < layout.y + layout.height && x >= clip.left && x < clip.right && y >= clip.top && y < clip.bottom;
|
|
908
989
|
}
|
|
@@ -925,7 +1006,17 @@ function hitTest(nodes, root, x, y, layouts) {
|
|
|
925
1006
|
right: clips ? Math.min(ancestorClip.right, layout.x + layout.width) : ancestorClip.right,
|
|
926
1007
|
bottom: clips ? Math.min(ancestorClip.bottom, layout.y + layout.height) : ancestorClip.bottom
|
|
927
1008
|
} : ancestorClip;
|
|
928
|
-
|
|
1009
|
+
if (node.children.some((child) => zIndex(child) !== 0)) {
|
|
1010
|
+
const children = node.children.map((child, index) => ({
|
|
1011
|
+
child,
|
|
1012
|
+
index,
|
|
1013
|
+
zIndex: zIndex(child)
|
|
1014
|
+
})).sort((left, right) => right.zIndex - left.zIndex || right.index - left.index);
|
|
1015
|
+
for (const { child } of children) {
|
|
1016
|
+
const target = visit(child, childClip);
|
|
1017
|
+
if (target) return target;
|
|
1018
|
+
}
|
|
1019
|
+
} else for (let index = node.children.length - 1; index >= 0; index--) {
|
|
929
1020
|
const child = node.children[index];
|
|
930
1021
|
if (!child) continue;
|
|
931
1022
|
const target = visit(child, childClip);
|
|
@@ -1137,6 +1228,10 @@ function createRenderer$1(options = {}) {
|
|
|
1137
1228
|
if (!registered) return void 0;
|
|
1138
1229
|
for (let parent = registered.parent; parent; parent = parent.parent) if (parent === root) return registered;
|
|
1139
1230
|
},
|
|
1231
|
+
/** Find the live host node registered for one logical focus target. */
|
|
1232
|
+
findNodeByFocusId(root, focusId) {
|
|
1233
|
+
return findHostNodeByFocusId(root, focusId);
|
|
1234
|
+
},
|
|
1140
1235
|
/** Detach and dispose a registered node and every descendant exactly once. */
|
|
1141
1236
|
destroyRecursively(id) {
|
|
1142
1237
|
const node = tree.nodes.get(id);
|
|
@@ -1730,21 +1825,21 @@ function createApp(rootComponent, options = {}) {
|
|
|
1730
1825
|
break;
|
|
1731
1826
|
case "paste":
|
|
1732
1827
|
lastPasteEvent.value = normalized;
|
|
1733
|
-
|
|
1828
|
+
return routeFocusedInput(renderer, rootElement, focusManager?.activeId.value, normalized);
|
|
1734
1829
|
case "mouse":
|
|
1735
1830
|
routeAndPublishMouseInput(renderer, rootElement, normalized, getLastRenderLayouts(), lastMouseEvent);
|
|
1736
1831
|
break;
|
|
1737
1832
|
case "focus":
|
|
1738
1833
|
lastFocusEvent.value = normalized;
|
|
1739
|
-
|
|
1834
|
+
return routeFocusedInput(renderer, rootElement, focusManager?.activeId.value, normalized);
|
|
1740
1835
|
case "compositionstart":
|
|
1741
1836
|
case "compositionupdate":
|
|
1742
1837
|
case "compositionend":
|
|
1743
1838
|
lastCompositionEvent.value = normalized;
|
|
1744
|
-
|
|
1839
|
+
return routeFocusedInput(renderer, rootElement, focusManager?.activeId.value, normalized);
|
|
1745
1840
|
case "key":
|
|
1746
1841
|
lastKeyEvent.value = normalized;
|
|
1747
|
-
|
|
1842
|
+
return routeFocusedInput(renderer, rootElement, focusManager?.activeId.value, normalized);
|
|
1748
1843
|
}
|
|
1749
1844
|
}
|
|
1750
1845
|
async function eventLoop() {
|
|
@@ -1758,15 +1853,14 @@ function createApp(rootComponent, options = {}) {
|
|
|
1758
1853
|
n?.clearScreen();
|
|
1759
1854
|
needsRender = true;
|
|
1760
1855
|
}
|
|
1761
|
-
dispatchEvent(event);
|
|
1762
|
-
if (
|
|
1856
|
+
const defaultAction = defaultInputAction(event, dispatchEvent(event), exitOnCtrlC);
|
|
1857
|
+
if (defaultAction === "focus-next") {
|
|
1763
1858
|
focusManager?.focusNext();
|
|
1764
1859
|
needsRender = true;
|
|
1765
|
-
} else if (
|
|
1860
|
+
} else if (defaultAction === "focus-previous") {
|
|
1766
1861
|
focusManager?.focusPrevious();
|
|
1767
1862
|
needsRender = true;
|
|
1768
|
-
}
|
|
1769
|
-
if (exitOnCtrlC && event.eventType === "key" && event.char === "c" && event.modifiers?.ctrl) {
|
|
1863
|
+
} else if (defaultAction === "exit") {
|
|
1770
1864
|
await unmount();
|
|
1771
1865
|
break;
|
|
1772
1866
|
}
|
|
@@ -1854,6 +1948,6 @@ function renderToString(root, options = {}) {
|
|
|
1854
1948
|
return output;
|
|
1855
1949
|
}
|
|
1856
1950
|
//#endregion
|
|
1857
|
-
export { useFocusManager as A, useStdin as C, createFocusManager as D, FOCUS_KEY as E, isScreenReaderEnabledByDefault as F, createAppContext as M, useApp as N, provideFocusScope as O, SCREEN_READER_KEY as P, useStderr as S, useStreamsContext as T, CURSOR_KEY as _, lastMouseEvent as a, STREAMS_KEY as b, render as c, isStaticNode as d, createRenderer$1 as f, updateLastRenderLayouts as g, measureElement as h, lastKeyEvent as i, APP_KEY as j, useFocus as k, renderToString as l, getLastRenderLayout as m, lastCompositionEvent as n, lastPasteEvent as o, treeToRenderNodes as p, lastFocusEvent as r, lastResizeEvent as s, createApp as t, isStaticItemNode as u, createCursorContext as v, useStdout as w, createStreamsContext as x, useCursor as y };
|
|
1951
|
+
export { useFocusManager as A, useStdin as C, createFocusManager as D, FOCUS_KEY as E, isScreenReaderEnabledByDefault as F, treeToScreenReaderString as I, createAppContext as M, useApp as N, provideFocusScope as O, SCREEN_READER_KEY as P, useStderr as S, useStreamsContext as T, CURSOR_KEY as _, lastMouseEvent as a, STREAMS_KEY as b, render as c, isStaticNode as d, createRenderer$1 as f, updateLastRenderLayouts as g, measureElement as h, lastKeyEvent as i, APP_KEY as j, useFocus as k, renderToString as l, getLastRenderLayout as m, lastCompositionEvent as n, lastPasteEvent as o, treeToRenderNodes as p, lastFocusEvent as r, lastResizeEvent as s, createApp as t, isStaticItemNode as u, createCursorContext as v, useStdout as w, createStreamsContext as x, useCursor as y };
|
|
1858
1952
|
|
|
1859
|
-
//# sourceMappingURL=app-
|
|
1953
|
+
//# sourceMappingURL=app-CjfLCWic.mjs.map
|