@skillbuilder/miniapp-simulator 0.2.7 → 0.2.8
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/README.md +18 -1
- package/docs/assets/road-king-controls.png +0 -0
- package/docs/desktop-gesture-design.redoc.xml +96 -0
- package/lib/client-C59iNO5u.mjs +1371 -0
- package/lib/{index-CqClPZVv.mjs → index-BSj1bmle.mjs} +1 -1
- package/lib/index.js +4130 -2739
- package/lib/remote-client.js +2 -2
- package/lib/types/core/simulator.d.ts +2 -0
- package/lib/types/gesture/host-bus.d.ts +27 -2
- package/lib/types/gesture/input-scheduler.d.ts +29 -0
- package/lib/types/gesture/keyboard-panel-view.d.ts +16 -0
- package/lib/types/gesture/keyboard-panel.d.ts +54 -0
- package/lib/types/gesture/plugins/index.d.ts +11 -14
- package/lib/types/gesture/plugins/keyboard-touch.d.ts +4 -0
- package/lib/types/gesture/plugins/multi-touch-hint.d.ts +1 -9
- package/lib/types/gesture/plugins/multi-touch-switch.d.ts +1 -1
- package/lib/types/gesture/plugins/touch-emitter.d.ts +1 -9
- package/lib/types/gesture/plugins/wheel-pinch.d.ts +3 -0
- package/lib/types/gesture/plugins/wheel-scroll.d.ts +1 -1
- package/lib/types/gesture/touch-cursor.d.ts +4 -0
- package/lib/types/gesture/touch-sequence.d.ts +12 -0
- package/lib/types/gesture/types.d.ts +33 -9
- package/lib/types/host/shadow-host.d.ts +14 -4
- package/lib/types/inspector/host-inspector.d.ts +1 -1
- package/lib/types/remote/audit-controller.d.ts +2 -0
- package/lib/types/remote/audit-leave-monitor.d.ts +2 -0
- package/lib/types/remote/client.d.ts +2 -0
- package/lib/types/remote/keyboard-panel-host.d.ts +19 -0
- package/lib/types/remote/protocol.d.ts +24 -1
- package/lib/types/remote/runtime-entry.d.ts +2 -1
- package/lib/types/remote/runtime.d.ts +1 -1
- package/lib/types/types/options.d.ts +4 -0
- package/lib/types/types/renderer.d.ts +8 -0
- package/lib/types/utils/screen-coordinates.d.ts +31 -0
- package/lib/workbench.js +1 -1
- package/package.json +1 -1
- package/lib/client-BjYHK9LR.mjs +0 -1220
package/lib/remote-client.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { R as r, a as O, c as e } from "./client-
|
|
1
|
+
import { R as r, a as O, c as e } from "./client-C59iNO5u.mjs";
|
|
2
2
|
import { B as s, M as _ } from "./options-B34ipLmF.mjs";
|
|
3
|
-
import { M } from "./index-
|
|
3
|
+
import { M } from "./index-BSj1bmle.mjs";
|
|
4
4
|
export {
|
|
5
5
|
s as BusinessLine,
|
|
6
6
|
_ as MINIAPP_SCREENSHOT_ERROR_CODE,
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import type { KeyboardPanelHost } from "../gesture/keyboard-panel";
|
|
1
2
|
import type { MiniAppSimulator as MiniAppSimulatorInterface, MiniAppSimulatorOptions } from "../types";
|
|
2
3
|
export declare function createMiniAppSimulator(options: MiniAppSimulatorOptions): MiniAppSimulatorInterface;
|
|
3
4
|
/** @internal 远程 Runtime 注入服务端托管资源;不属于接入方配置。 */
|
|
4
5
|
export declare function createRuntimeMiniAppSimulator(options: MiniAppSimulatorOptions, runtimeOptions: {
|
|
6
|
+
keyboardPanelHost?: KeyboardPanelHost;
|
|
5
7
|
requestManagerFrameUrl: string;
|
|
6
8
|
gateways?: Record<string, string>;
|
|
7
9
|
businessLine?: string;
|
|
@@ -9,8 +9,11 @@
|
|
|
9
9
|
*
|
|
10
10
|
* Plugin 通过 `install(ctx)` 订阅事件并往 iframe 发协议消息。
|
|
11
11
|
*/
|
|
12
|
+
import type { ScreenRotationDirection } from "../utils/screen-coordinates";
|
|
12
13
|
import type { GestureDispatchInput, GestureDispatchResult, GestureGuestChannel, GestureHostPlugin, GestureSharedState } from "./types";
|
|
13
14
|
export interface GestureHostBusOptions {
|
|
15
|
+
/** 外置横竖屏控件,由已启用桌面控件的宿主提供。 */
|
|
16
|
+
rotateScreen?: (direction: ScreenRotationDirection) => void;
|
|
14
17
|
/** 内容载体元素(iframe 或 webview);仅用于坐标换算与聚焦 */
|
|
15
18
|
element: HTMLElement;
|
|
16
19
|
/** host↔guest 介质通道(发送/回包/聚焦/cursor),由各 ContentHost 注入 */
|
|
@@ -39,12 +42,25 @@ export declare class GestureHostBus {
|
|
|
39
42
|
/** light DOM 移入边界(shadow host),补 Shadow 穿透场景 */
|
|
40
43
|
private readonly hoverEnterTarget;
|
|
41
44
|
private readonly debug;
|
|
45
|
+
private readonly rotateScreen?;
|
|
42
46
|
private readonly rawHandlers;
|
|
43
47
|
private readonly logicHandlers;
|
|
44
48
|
private readonly plugins;
|
|
49
|
+
private readonly pluginSubscriptions;
|
|
45
50
|
/** 跨 plugin 共享状态 */
|
|
46
51
|
readonly state: GestureSharedState;
|
|
52
|
+
private readonly inputScheduler;
|
|
53
|
+
private keyboardCaptureEnabled;
|
|
54
|
+
private keyboardCodes;
|
|
55
|
+
private guestInputPossible;
|
|
56
|
+
private hostFocusIntentAt;
|
|
57
|
+
/** 原生捕获与已提交手势分离,等待 guest 水位时也能接收 move/up。 */
|
|
58
|
+
private physicalPressed;
|
|
59
|
+
private readonly nativePrevention;
|
|
47
60
|
private destroyed;
|
|
61
|
+
private resettingGuest;
|
|
62
|
+
/** 鼠标、滚轮和键盘各自维护序列,这里聚合 guest 可见的所有触点。 */
|
|
63
|
+
private readonly activeTouches;
|
|
48
64
|
/** 当前 mouse 是否正在捕获 mousemove(mousedown 后绑定,mouseup 后解绑) */
|
|
49
65
|
private capturingWindowMove;
|
|
50
66
|
/** 业务 plugin 可临时覆盖 cursor,nul 时回到默认 */
|
|
@@ -72,13 +88,15 @@ export declare class GestureHostBus {
|
|
|
72
88
|
* 或坐标缩放细节。
|
|
73
89
|
*/
|
|
74
90
|
dispatch(input: GestureDispatchInput): Promise<GestureDispatchResult>;
|
|
91
|
+
/** 结束鼠标、键盘等输入源的活动触点,供切页和旋转前调用。 */
|
|
92
|
+
cancelActiveGestures(): void;
|
|
75
93
|
/**
|
|
76
94
|
* 由宿主在 iframe.onload + receiver runtime 注入完成后调用。
|
|
77
|
-
*
|
|
78
|
-
* (如 `selection-disabler`)可通过 `ctx.hook("iframe:ready", ...)` 监听。
|
|
95
|
+
* 需要 receiver 就绪后发送配置的插件订阅 iframe:ready。
|
|
79
96
|
*/
|
|
80
97
|
notifyIframeReady(): void;
|
|
81
98
|
destroy(): void;
|
|
99
|
+
private uninstallPlugin;
|
|
82
100
|
private makeContext;
|
|
83
101
|
private subscribeRaw;
|
|
84
102
|
private subscribeLogic;
|
|
@@ -101,11 +119,18 @@ export declare class GestureHostBus {
|
|
|
101
119
|
* 回退 hoverTrackTarget。contentRoot 在 stageFit 缩放 + flex 布局下 rect 可能偏移/塌缩。
|
|
102
120
|
*/
|
|
103
121
|
private get hoverRegion();
|
|
122
|
+
private guestHasFocus;
|
|
123
|
+
private focusGuest;
|
|
124
|
+
private discardPendingInputs;
|
|
125
|
+
private preventNative;
|
|
104
126
|
private onMouseDown;
|
|
105
127
|
private onMouseMoveDragging;
|
|
106
128
|
private onMouseUp;
|
|
107
129
|
private onWheel;
|
|
130
|
+
private onVisibilityChange;
|
|
108
131
|
private onWindowBlur;
|
|
132
|
+
private onHostFocusIntent;
|
|
133
|
+
private applyGuestMessage;
|
|
109
134
|
/** guest 内表单控件 focus 后,把宿主焦点切到载体,键盘输入才能进小应用 */
|
|
110
135
|
private onGuestInbound;
|
|
111
136
|
private bindCapturingWindowMove;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export declare class GestureInputScheduler {
|
|
2
|
+
private readonly options;
|
|
3
|
+
private tasks;
|
|
4
|
+
private nextOrdinal;
|
|
5
|
+
private nextRequest;
|
|
6
|
+
private request;
|
|
7
|
+
private watermark;
|
|
8
|
+
private running;
|
|
9
|
+
private applyingAt;
|
|
10
|
+
private wake;
|
|
11
|
+
private readonly waiters;
|
|
12
|
+
generation: number;
|
|
13
|
+
constructor(options: {
|
|
14
|
+
needsBarrier: () => boolean;
|
|
15
|
+
sendBarrier: (requestId: number, generation: number) => void;
|
|
16
|
+
onError: (error: unknown) => void;
|
|
17
|
+
});
|
|
18
|
+
time(): number;
|
|
19
|
+
enqueue(run: () => void, issuedAt?: number, fromGuest?: boolean, cleanupOnly?: boolean): () => void;
|
|
20
|
+
acknowledge(requestId: unknown, generation: unknown, issuedAt: unknown): void;
|
|
21
|
+
/** 关闭键盘输入时撤销旧 guest 的确认,保留鼠标释放和滚轮截止点。 */
|
|
22
|
+
endGuestStream(): void;
|
|
23
|
+
cancel(): void;
|
|
24
|
+
/** 等待当前时刻已经生成的输入;未来的长按/滚轮截止点不阻塞调用。 */
|
|
25
|
+
settled(): Promise<void>;
|
|
26
|
+
private hasDueTasks;
|
|
27
|
+
private settle;
|
|
28
|
+
private pump;
|
|
29
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export { keyboardPanelCommandNeedsGameFocus } from "./keyboard-panel";
|
|
2
|
+
import type { KeyboardPanelCommand, KeyboardPanelConnection } from "./keyboard-panel";
|
|
3
|
+
export declare const KEYBOARD_UI_STYLES = "\n [data-mini-app-keyboard-ui],[data-mini-app-keyboard-ui] * {-webkit-user-select:none;user-select:none}\n [data-mini-app-keyboard-ui] button,[data-mini-app-keyboard-ui] select {font:inherit;cursor:pointer;color:inherit;background:#273244;border:1px solid #526078;border-radius:6px;padding:6px 9px}\n [data-mini-app-keyboard-ui] button:focus-visible,[data-mini-app-keyboard-ui] select:focus-visible {outline:2px solid #60a5fa;outline-offset:2px}\n [data-mini-app-keyboard-ui] button:disabled {opacity:.45;cursor:default}\n [data-mini-app-keyboard-ui] [data-mini-app-keyboard-panel] {width:296px;max-width:calc(100vw - 24px);box-sizing:border-box;position:fixed;z-index:2147483000;font:12px/1.5 system-ui,sans-serif;color:#e5e7eb;cursor:default;background:#172033;padding:14px;border:1px solid #526078;border-radius:10px;box-shadow:0 6px 24px #0005;max-height:calc(100vh - 24px);overflow:auto}\n [data-mini-app-keyboard-ui] [data-mini-app-keyboard-panel-handle] {display:flex;align-items:center;justify-content:space-between;gap:12px;cursor:grab;touch-action:none;user-select:none;position:sticky;top:-14px;background:#172033;padding:8px 0;z-index:1}\n [data-mini-app-keyboard-ui] [data-mini-app-keyboard-panel-handle] span {font-size:11px;color:#a6b4c9}\n [data-mini-app-keyboard-ui] [data-key-code] {display:flex;align-items:center;gap:6px;flex-wrap:wrap;margin:10px 0;padding:8px 0;border-bottom:1px solid #334155}\n [data-mini-app-keyboard-ui] [data-key-label] {min-width:34px;font-weight:600}\n [data-mini-app-keyboard-ui] [data-mini-app-keyboard-panel] small {flex:1;color:#a6b4c9;font-size:11px}\n [data-mini-app-keyboard-ui] [data-mini-app-keyboard-panel] p {margin:8px 0;color:#c2cddd;font-size:12px}\n [data-mini-app-keyboard-ui] [data-mapping-notice] {padding:8px;background:#253650;border-radius:6px}\n";
|
|
4
|
+
export interface KeyboardPanelViewOptions {
|
|
5
|
+
root: HTMLElement;
|
|
6
|
+
onCommand: (command: KeyboardPanelCommand) => void;
|
|
7
|
+
/** 当前视图 window 的 client 坐标,跨 iframe 投影由调用者完成。 */
|
|
8
|
+
getAnchor: () => {
|
|
9
|
+
left: number;
|
|
10
|
+
top: number;
|
|
11
|
+
right: number;
|
|
12
|
+
bottom: number;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
/** 面板渲染状态并转发自身焦点内的按键;游戏选区和触点由 gesture plugin 管理。 */
|
|
16
|
+
export declare function createKeyboardPanelView(options: KeyboardPanelViewOptions): KeyboardPanelConnection;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/** 可序列化的键位面板视图;游戏触点和选区状态由 gesture plugin 持有。 */
|
|
2
|
+
export interface KeyboardPanelState {
|
|
3
|
+
open: boolean;
|
|
4
|
+
enabled: boolean;
|
|
5
|
+
available: boolean;
|
|
6
|
+
busy: boolean;
|
|
7
|
+
notice: string;
|
|
8
|
+
bindings: Array<{
|
|
9
|
+
code: string;
|
|
10
|
+
mode: "hold" | "drag";
|
|
11
|
+
isRegion: boolean;
|
|
12
|
+
}>;
|
|
13
|
+
anchor: {
|
|
14
|
+
left: number;
|
|
15
|
+
top: number;
|
|
16
|
+
right: number;
|
|
17
|
+
bottom: number;
|
|
18
|
+
};
|
|
19
|
+
viewport: {
|
|
20
|
+
width: number;
|
|
21
|
+
height: number;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
export type KeyboardPanelCommand = {
|
|
25
|
+
type: "add" | "cancel" | "close" | "outside";
|
|
26
|
+
} | {
|
|
27
|
+
type: "rebind" | "pick" | "remove" | "destination";
|
|
28
|
+
code: string;
|
|
29
|
+
} | {
|
|
30
|
+
type: "mode";
|
|
31
|
+
code: string;
|
|
32
|
+
mode: "hold" | "drag";
|
|
33
|
+
} | {
|
|
34
|
+
type: "enable";
|
|
35
|
+
enabled: boolean;
|
|
36
|
+
issuedAt: number;
|
|
37
|
+
sequence: number;
|
|
38
|
+
} | {
|
|
39
|
+
type: "key";
|
|
40
|
+
eventName: "keydown" | "keyup" | "cancel" | "focusout";
|
|
41
|
+
code: string;
|
|
42
|
+
repeat: boolean;
|
|
43
|
+
issuedAt: number;
|
|
44
|
+
sequence: number;
|
|
45
|
+
};
|
|
46
|
+
export interface KeyboardPanelConnection {
|
|
47
|
+
update(state: KeyboardPanelState): void;
|
|
48
|
+
dispose(): void;
|
|
49
|
+
}
|
|
50
|
+
/** Runtime 的宿主提供序列化通道;本地 SDK 使用同页面板视图。 */
|
|
51
|
+
export interface KeyboardPanelHost {
|
|
52
|
+
mount(onCommand: (command: KeyboardPanelCommand) => void): KeyboardPanelConnection;
|
|
53
|
+
}
|
|
54
|
+
export declare function keyboardPanelCommandNeedsGameFocus(command: KeyboardPanelCommand): boolean;
|
|
@@ -1,18 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* 内置 host 插件按输入互斥与状态依赖排序:
|
|
3
|
+
* wheel-pinch → multi-touch-switch / pinch / rotate → touch-emitter → tap / long-press /
|
|
4
|
+
* double-tap → wheel-scroll → selection-disabler → multi-touch-hint。
|
|
3
5
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* 2. touch-emitter ── 派发 touch 事件(读 state 决定单/双指几何)
|
|
7
|
-
* 3. tap ── 短按 → mini-app:tap(receiver 合成 click)
|
|
8
|
-
* 4. long-press ── 长按 → mini-app:longpress(contextmenu)
|
|
9
|
-
* 5. double-tap ── hook tap → mini-app:dblclick
|
|
10
|
-
* 6. wheel-scroll ── 滚轮 → mini-app:wheel
|
|
11
|
-
* 7. selection-disabler ── iframe body user-select: none
|
|
12
|
-
* 8. multi-touch-hint ── 状态条 + 副触点圆点
|
|
13
|
-
*
|
|
14
|
-
* 注:手指圆点(hover/press 指针)已从 plugin 上移为 gesture 核心内置 `TouchCursor`
|
|
15
|
-
* (见 `../touch-cursor.ts`),由 GestureHostBus 直接持有,圆点显示不再走事件管线。
|
|
6
|
+
* wheel-pinch 在鼠标按下前结束滚轮序列;模式插件在 touch-emitter 之前确定双指基点。
|
|
7
|
+
* TouchCursor 负责单指与悬停,多指提示读取 touch:points 绘制实际触点。
|
|
16
8
|
*/
|
|
17
9
|
export { createTouchEmitterPlugin } from "./touch-emitter";
|
|
18
10
|
export { createMultiTouchSwitchPlugin, createPinchPlugin, createRotatePlugin, } from "./multi-touch-switch";
|
|
@@ -20,8 +12,13 @@ export { createTapPlugin } from "./tap";
|
|
|
20
12
|
export { createLongPressPlugin } from "./long-press";
|
|
21
13
|
export { createDoubleTapPlugin } from "./double-tap";
|
|
22
14
|
export { createWheelScrollPlugin } from "./wheel-scroll";
|
|
15
|
+
export { createWheelPinchPlugin } from "./wheel-pinch";
|
|
23
16
|
export { createSelectionDisablerPlugin } from "./selection-disabler";
|
|
24
17
|
export { createMultiTouchHintPlugin } from "./multi-touch-hint";
|
|
18
|
+
import type { KeyboardPanelHost } from "../keyboard-panel";
|
|
25
19
|
import type { GestureHostPlugin } from "../types";
|
|
26
20
|
/** 一次性生成全套内置 plugin(mode-switch 必须在 touch-emitter 之前注册) */
|
|
27
|
-
export declare function createDefaultHostPlugins(
|
|
21
|
+
export declare function createDefaultHostPlugins(options?: {
|
|
22
|
+
keyboardMapping?: boolean;
|
|
23
|
+
keyboardPanelHost?: KeyboardPanelHost;
|
|
24
|
+
}): GestureHostPlugin[];
|
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* MultiTouchHintPlugin — 双指模式可视化提示。
|
|
3
|
-
*
|
|
4
|
-
* 当任意 MultiTouchSwitch/Pinch/Rotate emit "multitouch:enter" 时:
|
|
5
|
-
* - 顶部加状态条,提示当前模式(mirror / pinch / rotate)
|
|
6
|
-
* - 在副触点位置画一个圆点,随鼠标移动
|
|
7
|
-
*
|
|
8
|
-
* leave 时清掉两者。
|
|
9
|
-
*/
|
|
10
1
|
import type { GestureHostPlugin } from "../types";
|
|
2
|
+
/** 圆点直接读取派发坐标,支持鼠标和触控板。 */
|
|
11
3
|
export declare function createMultiTouchHintPlugin(): GestureHostPlugin;
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
import type { GestureHostPlugin } from "../types";
|
|
13
13
|
/** Shift+拖动 = 镜像双指(经典 hammerjs 风格) */
|
|
14
14
|
export declare function createMultiTouchSwitchPlugin(): GestureHostPlugin;
|
|
15
|
-
/** Alt+拖动 =
|
|
15
|
+
/** Alt / Option+拖动 = 双指围绕固定中心捏合。 */
|
|
16
16
|
export declare function createPinchPlugin(): GestureHostPlugin;
|
|
17
17
|
/** Ctrl+拖动 = 旋转双指(副触点关于 base 旋转 180°) */
|
|
18
18
|
export declare function createRotatePlugin(): GestureHostPlugin;
|
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* TouchEmitterPlugin — 核心 touch 派发器。
|
|
3
|
-
*
|
|
4
|
-
* 监听 PointerSnapshot 的 down/move/up/leave/blur,转换为 `mini-app:touch` 消息发到 iframe。
|
|
5
|
-
* 根据 state.isMultiTouch + state.multiTouchMode 决定派 1 / 2 个触点及其几何算法:
|
|
6
|
-
* - "mirror":副触点 = 主触点关于 base 对称 + MULTI_TOUCH_OFFSET 外推(默认双指)
|
|
7
|
-
* - "pinch":副触点 = 主触点关于 base 真实对称(无偏移,模拟捏合)
|
|
8
|
-
* - "rotate":副触点 = 主触点关于 base 旋转 180°
|
|
9
|
-
*/
|
|
10
1
|
import type { GestureHostPlugin } from "../types";
|
|
2
|
+
/** 鼠标拖拽的单 / 双指触摸;基点由多指模式插件确定。 */
|
|
11
3
|
export declare function createTouchEmitterPlugin(): GestureHostPlugin;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* 本 plugin 监听 overlay 的 wheel 事件,转发到 iframe 内(receiver 端 WheelDispatchPlugin
|
|
6
6
|
* 派发原生 WheelEvent + scrollBy fallback)。
|
|
7
7
|
*
|
|
8
|
-
*
|
|
8
|
+
* Ctrl / Alt + wheel 由 wheel-pinch 处理为双指缩放。
|
|
9
9
|
*/
|
|
10
10
|
import type { GestureHostPlugin } from "../types";
|
|
11
11
|
export declare function createWheelScrollPlugin(): GestureHostPlugin;
|
|
@@ -39,6 +39,8 @@ export declare class TouchCursor {
|
|
|
39
39
|
private destroyed;
|
|
40
40
|
/** DevTools 审查等场景暂时禁止显示/跟随,避免挡住 Elements 选点 */
|
|
41
41
|
private suppressed;
|
|
42
|
+
private multiTouch;
|
|
43
|
+
private inside;
|
|
42
44
|
private visible;
|
|
43
45
|
private pressed;
|
|
44
46
|
private hot;
|
|
@@ -69,6 +71,8 @@ export declare class TouchCursor {
|
|
|
69
71
|
private tickHot;
|
|
70
72
|
/** DevTools 审查 / 权限弹窗 / 元素选取等场景:隐藏圆点并暂停跟随,避免干扰上层交互 */
|
|
71
73
|
setSuppressed(suppressed: boolean): void;
|
|
74
|
+
/** 多指圆点由手势插件按实际触点坐标绘制。 */
|
|
75
|
+
setMultiTouch(active: boolean): void;
|
|
72
76
|
private onMove;
|
|
73
77
|
private onLeave;
|
|
74
78
|
private onDown;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { GestureHostContext, GesturePoint, ModifierKeys, PointerSnapshot } from "./types";
|
|
2
|
+
/** 一段触摸序列;两个输入设备共用 touches / changedTouches 的生命周期。 */
|
|
3
|
+
export declare class TouchSequence {
|
|
4
|
+
private readonly ctx;
|
|
5
|
+
private points;
|
|
6
|
+
private modifiers;
|
|
7
|
+
constructor(ctx: GestureHostContext);
|
|
8
|
+
update(next: GesturePoint[], modifiers: ModifierKeys): void;
|
|
9
|
+
finish(cancel?: boolean): void;
|
|
10
|
+
private send;
|
|
11
|
+
}
|
|
12
|
+
export declare function gesturePoint(element: HTMLElement, snap: PointerSnapshot, identifier: number, x?: number, y?: number): GesturePoint;
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* - host 端 plugin 监听原始事件并 send 给 iframe,receiver 端 plugin 派发对应 DOM 事件
|
|
7
7
|
* - 跨 plugin 通过共享状态 + 逻辑事件 emit/on 协作
|
|
8
8
|
*/
|
|
9
|
+
import type { ScreenRotationDirection } from "../utils/screen-coordinates";
|
|
9
10
|
export interface GesturePoint {
|
|
10
11
|
identifier: number;
|
|
11
12
|
clientX: number;
|
|
@@ -27,7 +28,7 @@ export interface ModifierKeys {
|
|
|
27
28
|
*/
|
|
28
29
|
export interface PointerSnapshot {
|
|
29
30
|
kind: "down" | "move" | "up" | "leave" | "wheel" | "blur";
|
|
30
|
-
/** iframe CSS
|
|
31
|
+
/** iframe CSS 坐标空间(已修正设备缩放与屏幕旋转) */
|
|
31
32
|
iframeX: number;
|
|
32
33
|
iframeY: number;
|
|
33
34
|
/** 宿主视口坐标(用于 overlay 上画 UI) */
|
|
@@ -72,7 +73,7 @@ export interface GestureDispatchResult {
|
|
|
72
73
|
segments?: number;
|
|
73
74
|
durationMs?: number;
|
|
74
75
|
}
|
|
75
|
-
export type GestureBusMessage = TouchMessage | WheelMessage | TapMessage | LongPressMessage | DoubleTapMessage | CursorQueryMessage | SelectionMessage;
|
|
76
|
+
export type GestureBusMessage = TouchMessage | WheelMessage | TapMessage | LongPressMessage | DoubleTapMessage | CursorQueryMessage | SelectionMessage | KeyboardCaptureMessage | InputBarrierMessage;
|
|
76
77
|
export interface TouchMessage {
|
|
77
78
|
type: "mini-app:touch";
|
|
78
79
|
eventName: "touchstart" | "touchmove" | "touchend" | "touchcancel";
|
|
@@ -117,6 +118,17 @@ export interface CursorReplyMessage {
|
|
|
117
118
|
queryId: number;
|
|
118
119
|
cursor: string;
|
|
119
120
|
}
|
|
121
|
+
export interface KeyboardCaptureMessage {
|
|
122
|
+
type: "mini-app:keyboard-capture";
|
|
123
|
+
codes: string[];
|
|
124
|
+
/** 由 host bus 填充;取消/重载后拒绝旧输入。 */
|
|
125
|
+
generation?: number;
|
|
126
|
+
}
|
|
127
|
+
export interface InputBarrierMessage {
|
|
128
|
+
type: "mini-app:input-barrier";
|
|
129
|
+
requestId: number;
|
|
130
|
+
generation: number;
|
|
131
|
+
}
|
|
120
132
|
export interface SelectionMessage {
|
|
121
133
|
type: "mini-app:selection";
|
|
122
134
|
enabled: boolean;
|
|
@@ -145,12 +157,7 @@ export interface GestureGuestChannel {
|
|
|
145
157
|
/** 读 host 视口坐标下 guest 元素的 computed cursor(hot 判定);不支持返回 undefined */
|
|
146
158
|
readCursorAt(hostX: number, hostY: number): string | undefined;
|
|
147
159
|
}
|
|
148
|
-
/**
|
|
149
|
-
* 双指模式下的副触点几何算法。
|
|
150
|
-
* - "mirror":副触点为主触点关于 base 的对称点(再外推固定偏移)—— 经典 shift 双指
|
|
151
|
-
* - "pinch":副触点为主触点关于 base 的真实对称点(无偏移)—— 模拟捏合
|
|
152
|
-
* - "rotate":副触点为主触点关于 base 旋转 180° 后的点 —— 模拟双指旋转
|
|
153
|
-
*/
|
|
160
|
+
/** 双指模式:镜像 / 捏合 / 旋转,触点围绕固定基点对称且初始间距非零。 */
|
|
154
161
|
export type MultiTouchMode = "mirror" | "pinch" | "rotate";
|
|
155
162
|
export interface GestureSharedState {
|
|
156
163
|
/** 鼠标主按键是否处于按下态 */
|
|
@@ -179,8 +186,25 @@ export type RawEventName = PointerSnapshot["kind"];
|
|
|
179
186
|
export type RawEventHandler = (ev: PointerSnapshot) => void;
|
|
180
187
|
export type LogicEventHandler = (...args: unknown[]) => void;
|
|
181
188
|
export interface GestureHostContext {
|
|
189
|
+
/** 取消活动手势后旋转整台设备,保持逻辑视口尺寸;仅启用桌面控件时提供。 */
|
|
190
|
+
rotateScreen?: (direction: ScreenRotationDirection) => void;
|
|
191
|
+
/** 同步恢复 guest 原生键盘焦点,保留当前活动触点。 */
|
|
192
|
+
focusGuest(): void;
|
|
182
193
|
/** 订阅原始指针事件 */
|
|
183
|
-
on(event: RawEventName, handler: RawEventHandler
|
|
194
|
+
on(event: RawEventName, handler: RawEventHandler, options?: {
|
|
195
|
+
/** 在原生事件返回前同步拦截默认行为;语义处理可等待 guest 水位。 */
|
|
196
|
+
preventDefault?: (snapshot: PointerSnapshot) => boolean;
|
|
197
|
+
}): () => void;
|
|
198
|
+
/** 在跨窗口输入水位内执行状态变更。 */
|
|
199
|
+
orderInput(run: () => void, issuedAt?: number, options?: {
|
|
200
|
+
cleanupOnly?: boolean;
|
|
201
|
+
}): void;
|
|
202
|
+
/** 按源输入时间调度可取消的截止点(例如长按)。 */
|
|
203
|
+
scheduleInput(run: () => void, dueAt: number, options?: {
|
|
204
|
+
cleanupOnly?: boolean;
|
|
205
|
+
}): () => void;
|
|
206
|
+
/** 当前提交输入的 epoch 时间;原生回调中返回当前时间。 */
|
|
207
|
+
inputTime(): number;
|
|
184
208
|
/** 跨 plugin 协作:触发逻辑事件 */
|
|
185
209
|
emit(event: string, ...args: unknown[]): void;
|
|
186
210
|
/** 订阅逻辑事件(例如 'tap' / 'longpress' / 'pinch' / 'rotate') */
|
|
@@ -7,11 +7,13 @@
|
|
|
7
7
|
* #shadow-root(shadow=true 时)
|
|
8
8
|
* <style> base reset </style>
|
|
9
9
|
* bounds(.dms-bounds,stageFit 的可用区域 / 默认 bounds)
|
|
10
|
-
* stage(.dms-stage
|
|
10
|
+
* stage(.dms-stage,缩放与旋转后的占位)
|
|
11
|
+
* device(实际设备,包含手机壳与完整内容)
|
|
11
12
|
*
|
|
12
13
|
* shadow=false 时不创建 shadow root,bounds/stage 直接挂在 host 的 light DOM 下,
|
|
13
14
|
* 仅依赖内联样式(手机壳 / 内容层 / 手柄本身就是内联样式,自定义元素自带 :host 样式)。
|
|
14
15
|
*/
|
|
16
|
+
import type { ScreenRotationDirection } from "../utils/screen-coordinates";
|
|
15
17
|
/** 挂载目标:CSS 选择器字符串或 HTMLElement */
|
|
16
18
|
export type MiniAppMountTarget = string | HTMLElement;
|
|
17
19
|
export interface CreateShadowHostOptions {
|
|
@@ -27,20 +29,28 @@ export interface MiniAppShadowHost {
|
|
|
27
29
|
shadowRoot: ShadowRoot | null;
|
|
28
30
|
/** stageFit 的默认可用区域(bounds) */
|
|
29
31
|
bounds: HTMLElement;
|
|
30
|
-
/**
|
|
32
|
+
/** stageFit 缩放的设备占位,旋转时交换宽高 */
|
|
31
33
|
stage: HTMLElement;
|
|
34
|
+
/** 渲染器实际挂载点,逻辑宽高不随屏幕旋转改变 */
|
|
35
|
+
device: HTMLElement;
|
|
32
36
|
/** 宿主侧 overlay(如 toast)应挂载到的根:shadowRoot 或 host */
|
|
33
37
|
overlayRoot: ShadowRoot | HTMLElement;
|
|
34
38
|
/**
|
|
35
|
-
*
|
|
39
|
+
* 评测面板等内容的独立槽位:竖直摆放时在设备右侧,横向摆放时在设备下方。
|
|
36
40
|
*
|
|
37
41
|
* 默认宽度为 0 且不渲染,只有调用 setSidePanelWidth 打开后才占位。
|
|
38
42
|
* 走分栏而非浮层:浮层会直接盖住设备,而审核页把挂载点限制成手机尺寸,
|
|
39
43
|
* 盖住后审核员既看不到小工具也点不到它。
|
|
40
44
|
*/
|
|
41
45
|
sidePanel: HTMLElement;
|
|
42
|
-
/**
|
|
46
|
+
/** 设置竖直摆放时侧栏最小/最大宽度;传 0 收起。bounds 自动让出面板空间。 */
|
|
43
47
|
setSidePanelWidth(width: number, maxWidth?: number): void;
|
|
48
|
+
/** 桌面工具栏的空间只影响宿主布局。 */
|
|
49
|
+
setDesktopControls(enabled: boolean): void;
|
|
50
|
+
/** 整台设备每次按指定方向旋转 90°,四次回到原位,不改变 guest 逻辑尺寸。 */
|
|
51
|
+
rotateScreen(direction: ScreenRotationDirection): void;
|
|
52
|
+
/** 渲染器挂载或逻辑尺寸改变后同步设备占位。 */
|
|
53
|
+
syncDeviceLayout(): void;
|
|
44
54
|
/** 销毁:移除创建的宿主元素 */
|
|
45
55
|
destroy(): void;
|
|
46
56
|
}
|
|
@@ -86,7 +86,7 @@ export declare class HostInspector {
|
|
|
86
86
|
private selectionRect;
|
|
87
87
|
/**
|
|
88
88
|
* 宿主视口坐标 → iframe 内容元素。
|
|
89
|
-
*
|
|
89
|
+
* 与手势模块共用坐标转换,修正设备缩放和旋转。
|
|
90
90
|
* 同源不可访问(跨源 / webview)时返回 null 并降级告警一次。
|
|
91
91
|
*/
|
|
92
92
|
private resolveElement;
|
|
@@ -19,6 +19,8 @@ export interface AuditControllerDeps {
|
|
|
19
19
|
/** Apollo 下发的评测策略原始值;未下发时为 undefined */
|
|
20
20
|
getPolicy(): unknown;
|
|
21
21
|
getInteractionRegions(): readonly HTMLElement[];
|
|
22
|
+
/** 外层键位面板属于审核操作区域,保护离开倒计时而不增加真实输入次数。 */
|
|
23
|
+
isExternalInteractionActive?: () => boolean;
|
|
22
24
|
/** 与当前 Runtime release 绑定的独立插件地址。 */
|
|
23
25
|
auditPluginUrl?: string;
|
|
24
26
|
/** 把评测进度 / 报告以事件推给宿主 */
|
|
@@ -3,6 +3,8 @@ export declare function resolveAutoStopOnLeaveMs(value: unknown): number;
|
|
|
3
3
|
/** 监听稳定的模拟器区域,不进入 guest DOM,也不把 iframe 内部切换当作离开。 */
|
|
4
4
|
export declare function createAuditLeaveMonitor(options: {
|
|
5
5
|
regions: readonly HTMLElement[];
|
|
6
|
+
/** 已验证宿主通道报告的外层面板悬停/焦点;不作为游戏输入证据。 */
|
|
7
|
+
isExternalInside?: () => boolean;
|
|
6
8
|
delayMs: number;
|
|
7
9
|
onCountdown(seconds: number | null): void;
|
|
8
10
|
onTimeout(): void;
|
|
@@ -109,5 +109,7 @@ export interface RemoteMiniAppSimulator {
|
|
|
109
109
|
destroy(reason?: string): void;
|
|
110
110
|
}
|
|
111
111
|
export declare function createRemoteMiniAppSimulator(input: RemoteMiniAppSimulatorOptions): RemoteMiniAppSimulator;
|
|
112
|
+
/** @internal 地址由当前 Runtime entry 经握手端口提供,仅在同一会话内使用。 */
|
|
113
|
+
export declare function resolveRuntimeModuleUrl(ready: RemoteSimulatorReadyMessage, runtimeDocumentUrl: URL): URL;
|
|
112
114
|
/** @internal Exported for deterministic retry tests; not part of the package public entry. */
|
|
113
115
|
export declare function resolveRuntimeUrl(serviceUrls: URL[], loadTiming: RemoteLoadTiming): Promise<URL>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { KeyboardPanelHost, keyboardPanelCommandNeedsGameFocus } from "../gesture/keyboard-panel";
|
|
2
|
+
import type { createKeyboardPanelView } from "../gesture/keyboard-panel-view";
|
|
3
|
+
import type { RemoteKeyboardPanelCommandMessage, RemoteKeyboardPanelPresenceMessage, RemoteKeyboardPanelStateMessage } from "./protocol";
|
|
4
|
+
export type RemoteRuntimeModule = {
|
|
5
|
+
createKeyboardPanelView: typeof createKeyboardPanelView;
|
|
6
|
+
keyboardPanelCommandNeedsGameFocus: typeof keyboardPanelCommandNeedsGameFocus;
|
|
7
|
+
};
|
|
8
|
+
/** Runtime 每个 gesture controller 独立注册;触点和编辑状态始终留在 Runtime。 */
|
|
9
|
+
export declare function createRuntimeKeyboardPanelHost(port: MessagePort, sessionId: string): {
|
|
10
|
+
host: KeyboardPanelHost;
|
|
11
|
+
receive(message: RemoteKeyboardPanelCommandMessage | RemoteKeyboardPanelPresenceMessage): void;
|
|
12
|
+
isActive: () => boolean;
|
|
13
|
+
destroy(): void;
|
|
14
|
+
};
|
|
15
|
+
/** 浮窗挂在 Remote Client 页面,位置、拖动和焦点边界使用外层 viewport。 */
|
|
16
|
+
export declare function createClientKeyboardPanelHost(iframe: HTMLIFrameElement, send: (message: RemoteKeyboardPanelCommandMessage | RemoteKeyboardPanelPresenceMessage) => void, loadRuntimeModule: () => Promise<RemoteRuntimeModule>, onError: (error: unknown) => void): {
|
|
17
|
+
receive(message: RemoteKeyboardPanelStateMessage): void;
|
|
18
|
+
destroy(): void;
|
|
19
|
+
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { BusinessLine } from "../business-line";
|
|
2
|
+
import type { KeyboardPanelCommand, KeyboardPanelState } from "../gesture/keyboard-panel";
|
|
2
3
|
import type { ManagedRequestChunk, ManagedRequestHeaders, ManagedRequestOptions, ManagedRequestResult } from "../runtime/request/request-types";
|
|
3
4
|
import type { MiniAppContentMode, MiniAppFileMap, MiniAppHostApiRequest, MiniAppInspectorSelectionMode, MiniAppLoadFilesOptions, MiniAppLoadZipOptions, MiniAppRedirectOptions, MiniAppSecurityOptions, MiniAppSimulatorOptions, MiniAppSimulatorRoute, MiniAppViewport } from "../types";
|
|
4
5
|
/**
|
|
@@ -14,6 +15,8 @@ export declare const REMOTE_INSPECTOR_PAUSE_RUNTIME_CAPABILITY = "inspectorPause
|
|
|
14
15
|
* 版本不一致会让老 runtime 直接握手失败,而评测是可选能力,缺失只应降级。
|
|
15
16
|
*/
|
|
16
17
|
export declare const REMOTE_AUDIT_CAPABILITY = "audit";
|
|
18
|
+
/** Client 可在外层页面承载 Runtime 的键位编辑浮窗。 */
|
|
19
|
+
export declare const REMOTE_KEYBOARD_PANEL_CAPABILITY = "keyboardPanelPortal";
|
|
17
20
|
export declare const REMOTE_SIMULATOR_CAPABILITIES: string[];
|
|
18
21
|
export type RemoteSimulatorSerializableOptions = Omit<MiniAppSimulatorOptions, "mount" | "appId" | "renderer" | "serviceWorker" | "security" | "jsapi" | "hostApi" | "tracker" | "runtimeLimits" | "onEvent" | "onReady" | "onBeforeLoad" | "onLoad" | "onRenderDone" | "onError" | "onNavigation" | "onConsole" | "onNetwork" | "onDestroy" | "onRouterChange" | "onScreenShot"> & {
|
|
19
22
|
appUrl?: string;
|
|
@@ -39,6 +42,7 @@ export interface RemoteSimulatorConnectMessage {
|
|
|
39
42
|
hostApiStubs: Record<string, {
|
|
40
43
|
toast: string;
|
|
41
44
|
}>;
|
|
45
|
+
clientCapabilities?: string[];
|
|
42
46
|
options: RemoteSimulatorSerializableOptions;
|
|
43
47
|
}
|
|
44
48
|
/** Mars 队列项提供的稳定业务标识;随评测点位进入 APM,不进入被测 guest。 */
|
|
@@ -60,6 +64,8 @@ export interface RemoteSimulatorReadyMessage {
|
|
|
60
64
|
protocolVersion: number;
|
|
61
65
|
runtimeVersion: string;
|
|
62
66
|
capabilities: string[];
|
|
67
|
+
/** 当前 Runtime entry 自身的模块地址,供外层页面复用同一资源。 */
|
|
68
|
+
runtimeModuleUrl?: string;
|
|
63
69
|
}
|
|
64
70
|
export interface RemoteSimulatorRequestMessage {
|
|
65
71
|
type: "request";
|
|
@@ -82,6 +88,23 @@ export interface RemoteSimulatorEventMessage {
|
|
|
82
88
|
event: string;
|
|
83
89
|
payload: unknown;
|
|
84
90
|
}
|
|
91
|
+
export interface RemoteKeyboardPanelStateMessage {
|
|
92
|
+
type: "keyboard-panel-state";
|
|
93
|
+
controllerId: string;
|
|
94
|
+
revision: number;
|
|
95
|
+
/** null 显式销毁该控制器的浮窗;后续状态不能复活它。 */
|
|
96
|
+
state: KeyboardPanelState | null;
|
|
97
|
+
}
|
|
98
|
+
export interface RemoteKeyboardPanelCommandMessage {
|
|
99
|
+
type: "keyboard-panel-command";
|
|
100
|
+
controllerId: string;
|
|
101
|
+
command: KeyboardPanelCommand;
|
|
102
|
+
}
|
|
103
|
+
export interface RemoteKeyboardPanelPresenceMessage {
|
|
104
|
+
type: "keyboard-panel-presence";
|
|
105
|
+
controllerId: string;
|
|
106
|
+
active: boolean;
|
|
107
|
+
}
|
|
85
108
|
/** Runtime 请求宿主执行不可序列化的 hostApi handler。 */
|
|
86
109
|
export interface RemoteHostApiRequestMessage {
|
|
87
110
|
type: "host-api-request";
|
|
@@ -132,7 +155,7 @@ export interface RemoteHostRequestEventMessage {
|
|
|
132
155
|
export type RemoteSimulatorPortMessage = {
|
|
133
156
|
type: "worker-visibility";
|
|
134
157
|
visible: boolean;
|
|
135
|
-
} | RemoteSimulatorReadyMessage | RemoteSimulatorRequestMessage | RemoteSimulatorResponseMessage | RemoteSimulatorEventMessage | RemoteHostApiRequestMessage | RemoteHostApiResponseMessage | RemoteHostRequestMessage | RemoteHostRequestResponseMessage | RemoteHostRequestAbortMessage | RemoteHostRequestEventMessage;
|
|
158
|
+
} | RemoteKeyboardPanelStateMessage | RemoteKeyboardPanelCommandMessage | RemoteKeyboardPanelPresenceMessage | RemoteSimulatorReadyMessage | RemoteSimulatorRequestMessage | RemoteSimulatorResponseMessage | RemoteSimulatorEventMessage | RemoteHostApiRequestMessage | RemoteHostApiResponseMessage | RemoteHostRequestMessage | RemoteHostRequestResponseMessage | RemoteHostRequestAbortMessage | RemoteHostRequestEventMessage;
|
|
136
159
|
export type RemoteSimulatorMethod = "load" | "loadZip" | "loadFiles" | "loadApp" | "unload" | "reload" | "setViewport" | "switchContentMode" | "switchPhoneFrame" | "switchDevice" | "setTouchEmulation" | "permissionSheet.show" | "permissionSheet.hide" | "notePreview.update" | "notePreview.updateUser" | "notePreview.updateAppCard" | "widgetCover.update" | "router.redirectTo" | "router.getRoute" | "inspector.enable" | "inspector.disable" | "inspector.toggle" | "inspector.clear" | "inspector.setSelectionMode" | "inspector.getSelectionMode" | "inspector.getSceneTree" | "inspector.selectByRef" | "capture" | "screenShot" | "setAutoScreenShot" | "hostApi.sync" | "hostApi.emit" | "audit.start" | "audit.stop" | "audit.status" | "audit.report" | "audit.setPolicy" | "destroy";
|
|
137
160
|
export interface RemoteLoadZipArgs {
|
|
138
161
|
buffer: ArrayBuffer;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export { keyboardPanelCommandNeedsGameFocus } from "../gesture/keyboard-panel";
|
|
2
|
+
export { createKeyboardPanelView } from "../gesture/keyboard-panel-view";
|
|
@@ -13,4 +13,4 @@ export interface RemoteRuntimeConfig {
|
|
|
13
13
|
/** 与本 Runtime release 绑定的独立评测插件;仅 Mars 审核会话动态加载。 */
|
|
14
14
|
auditPluginUrl?: string;
|
|
15
15
|
}
|
|
16
|
-
export declare function startRemoteMiniAppSimulatorRuntime(): void;
|
|
16
|
+
export declare function startRemoteMiniAppSimulatorRuntime(runtimeModuleUrl: string): void;
|
|
@@ -487,6 +487,9 @@ export interface MiniAppSimulatorOptions extends MiniAppLifecycleCallbacks {
|
|
|
487
487
|
debug?: boolean;
|
|
488
488
|
/** 开启鼠标→触摸事件模拟,使桌面端鼠标操作还原真机 touch 行为(显示小手光标与触点圆点) */
|
|
489
489
|
touchEmulation?: boolean;
|
|
490
|
+
/** 桌面审核操作面板(区域键位映射与屏幕旋转),默认关闭;Mars Runtime 自动启用。
|
|
491
|
+
* 启用时默认开启 touchEmulation;显式关闭 touchEmulation 时面板一并关闭。 */
|
|
492
|
+
desktopControls?: boolean;
|
|
490
493
|
/** Visual Inspector 运行时能力;游戏暂停代理默认关闭。 */
|
|
491
494
|
visualInspector?: MiniAppVisualInspectorOptions;
|
|
492
495
|
/** 在父级 bounds 内自适应缩放;默认开启,可传 `false` 关闭或 `{ resizeHandle: true }` 启用手动拖拽缩放 */
|
|
@@ -548,6 +551,7 @@ export interface NormalizedMiniAppSimulatorOptions extends Omit<MiniAppSimulator
|
|
|
548
551
|
timeout: number;
|
|
549
552
|
debug: boolean;
|
|
550
553
|
touchEmulation: boolean;
|
|
554
|
+
desktopControls: boolean;
|
|
551
555
|
visualInspector: NormalizedMiniAppVisualInspectorOptions;
|
|
552
556
|
stageFit: false | NormalizedMiniAppStageFitOptions;
|
|
553
557
|
jsapi: NormalizedMiniAppJsApiOptions;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { ScreenRotationDirection } from "../utils/screen-coordinates";
|
|
2
|
+
import type { KeyboardPanelHost } from "../gesture/keyboard-panel";
|
|
1
3
|
import type { InjectionRegistry } from "../injection/registry";
|
|
2
4
|
import type { NotePublishResult, NotePublishViewData } from "../native-ui/note-publish/view-data";
|
|
3
5
|
import type { MiniAppPermissionKind, MiniAppPermissionSheetResult } from "../native-ui/permission-sheet/types";
|
|
@@ -99,6 +101,12 @@ export interface RendererAdapterContext {
|
|
|
99
101
|
debug: boolean;
|
|
100
102
|
/** 是否启用鼠标→触摸事件模拟 */
|
|
101
103
|
touchEmulation?: boolean;
|
|
104
|
+
/** 显示桌面审核操作面板。 */
|
|
105
|
+
desktopControls?: boolean;
|
|
106
|
+
/** Remote Client 承载键位浮窗的内部通道。 */
|
|
107
|
+
keyboardPanelHost?: KeyboardPanelHost;
|
|
108
|
+
/** 整台设备 CSS 按指定方向旋转 90 度,保持 guest 逻辑视口尺寸。 */
|
|
109
|
+
rotateScreen?: (direction: ScreenRotationDirection) => void;
|
|
102
110
|
/** jsapi 注入与 mock 配置 */
|
|
103
111
|
jsapi: NormalizedMiniAppJsApiOptions;
|
|
104
112
|
contentMode: MiniAppContentMode;
|