dsh-mobile 0.5.2 → 0.5.4
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/CHANGELOG.md +22 -0
- package/CONTRIBUTORS.md +10 -6
- package/README.en.md +22 -6
- package/README.md +22 -6
- package/SECURITY.md +1 -1
- package/THIRD_PARTY_NOTICES.md +1 -1
- package/cordis.patch.yml +6 -0
- package/docs/README.md +1 -0
- package/docs/SLOW_CONNECTIONS.en.md +77 -0
- package/docs/SLOW_CONNECTIONS.md +77 -0
- package/lib/client.js +129 -7
- package/lib/client.js.map +1 -1
- package/lib/index.d.mts +147 -122
- package/lib/index.mjs +529 -215
- package/lib/index.mjs.map +1 -1
- package/lib/mobile-layout.js +134 -2
- package/lib/mobile-layout.js.map +1 -1
- package/node_modules/dsh-mobile-question-fixes/lib/client.js +78 -0
- package/node_modules/dsh-mobile-question-fixes/lib/client.js.map +1 -0
- package/node_modules/dsh-mobile-question-fixes/lib/index.mjs +14 -0
- package/node_modules/dsh-mobile-question-fixes/lib/index.mjs.map +1 -0
- package/node_modules/dsh-mobile-question-fixes/package.json +25 -0
- package/package.json +19 -4
- package/packages/question-fixes/lib/client.js +78 -0
- package/packages/question-fixes/lib/client.js.map +1 -0
- package/packages/question-fixes/lib/index.mjs +14 -0
- package/packages/question-fixes/lib/index.mjs.map +1 -0
- package/packages/question-fixes/package.json +25 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-mobile",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.4",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "DeepSeek Harness 移动端适配与安全访问插件,支持局域网、远程连接、Android App 和手机浏览器。",
|
|
6
6
|
"type": "module",
|
|
@@ -30,6 +30,8 @@
|
|
|
30
30
|
"bin/dsh-mobile-funnel-win32-x64.exe",
|
|
31
31
|
"bin/dsh-mobile-funnel-linux-x64",
|
|
32
32
|
"bin/dsh-mobile-funnel-linux-arm64",
|
|
33
|
+
"packages/question-fixes/package.json",
|
|
34
|
+
"packages/question-fixes/lib/**",
|
|
33
35
|
"cordis.patch.yml",
|
|
34
36
|
"README.md",
|
|
35
37
|
"README.en.md",
|
|
@@ -45,6 +47,8 @@
|
|
|
45
47
|
"docs/ATTACH_EXISTING_FRPS.en.md",
|
|
46
48
|
"docs/SELF_HOSTED_ORIGIN.md",
|
|
47
49
|
"docs/SELF_HOSTED_ORIGIN.en.md",
|
|
50
|
+
"docs/SLOW_CONNECTIONS.md",
|
|
51
|
+
"docs/SLOW_CONNECTIONS.en.md",
|
|
48
52
|
"LICENSE",
|
|
49
53
|
"FUNNEL_THIRD_PARTY_LICENSES.txt",
|
|
50
54
|
"SECURITY.md",
|
|
@@ -71,6 +75,11 @@
|
|
|
71
75
|
"check:mobile-release": "node ./scripts/check-mobile-release.mjs",
|
|
72
76
|
"check:dsh-compatibility": "node ./scripts/check-dsh-compatibility.mjs",
|
|
73
77
|
"smoke:dsh-boot": "node ./scripts/smoke-dsh-mobile-boot.mjs",
|
|
78
|
+
"smoke:question-fixes": "node ./scripts/smoke-question-fixes.mjs",
|
|
79
|
+
"smoke:native-layout": "node ./scripts/smoke-native-mobile-layout.mjs",
|
|
80
|
+
"smoke:voice-session": "node ./scripts/smoke-voice-session.mjs",
|
|
81
|
+
"smoke:composer-keyboard": "node ./scripts/smoke-composer-keyboard.mjs",
|
|
82
|
+
"smoke:browser-auth-cookies": "node ./scripts/smoke-browser-auth-cookies.mjs",
|
|
74
83
|
"check:release-tag": "node ./scripts/check-release-version.mjs --tag-env",
|
|
75
84
|
"check:version": "node ./scripts/check-release-version.mjs",
|
|
76
85
|
"clean": "node ./scripts/clean.mjs",
|
|
@@ -144,9 +153,14 @@
|
|
|
144
153
|
"dependencies": {
|
|
145
154
|
"@deepseek-ai/schemastery": "^3.18.1",
|
|
146
155
|
"bonjour-service": "1.4.4",
|
|
156
|
+
"dsh-mobile-question-fixes": "file:packages/question-fixes",
|
|
147
157
|
"qrcode": "^1.5.4",
|
|
148
|
-
"selfsigned": "^5.5.0"
|
|
158
|
+
"selfsigned": "^5.5.0",
|
|
159
|
+
"ws": "8.22.0"
|
|
149
160
|
},
|
|
161
|
+
"bundledDependencies": [
|
|
162
|
+
"dsh-mobile-question-fixes"
|
|
163
|
+
],
|
|
150
164
|
"devDependencies": {
|
|
151
165
|
"@deepseek-ai/cordis": "4.0.4",
|
|
152
166
|
"@deepseek-ai/cordis-plugin-include": "1.0.9",
|
|
@@ -167,13 +181,14 @@
|
|
|
167
181
|
"@types/node": "^26.5.1",
|
|
168
182
|
"@types/qrcode": "^1.5.5",
|
|
169
183
|
"@types/react": "~18.3.1",
|
|
184
|
+
"@types/ws": "8.18.2",
|
|
170
185
|
"core-js": "^3.50.0",
|
|
171
186
|
"js-yaml": "^4.3.2",
|
|
172
187
|
"playwright": "1.63.0",
|
|
173
188
|
"react": "^18.2.0",
|
|
174
|
-
"tsdown": "^0.
|
|
189
|
+
"tsdown": "^0.23.0",
|
|
175
190
|
"typescript": "^7.0.2",
|
|
176
|
-
"vitest": "^
|
|
191
|
+
"vitest": "^5.0.2"
|
|
177
192
|
},
|
|
178
193
|
"directories": {
|
|
179
194
|
"lib": "lib",
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
window.__ModuleLoader__.load({
|
|
2
|
+
id: "dsh-mobile-question-fixes",
|
|
3
|
+
factory: (require) => {
|
|
4
|
+
var module = { exports: {} };
|
|
5
|
+
var exports = module.exports;
|
|
6
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
7
|
+
//#region packages/question-fixes/src/client.ts
|
|
8
|
+
/** Local, reversible layout and touch-keyboard fixes for DSH question cards. */
|
|
9
|
+
const QUESTION_FIX_CSS = `
|
|
10
|
+
[data-question-key] > section:has(> [data-question-scroll]) {
|
|
11
|
+
overflow-x: hidden !important;
|
|
12
|
+
overflow-y: auto !important;
|
|
13
|
+
overscroll-behavior: contain;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
[data-question-key] > section > [data-question-scroll] {
|
|
17
|
+
flex: 0 0 auto !important;
|
|
18
|
+
max-height: none !important;
|
|
19
|
+
overflow: visible !important;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
[data-question-key] > section:has(> header button[aria-expanded="false"]) > header h2 {
|
|
23
|
+
display: -webkit-box;
|
|
24
|
+
-webkit-box-orient: vertical;
|
|
25
|
+
-webkit-line-clamp: 2;
|
|
26
|
+
overflow: hidden;
|
|
27
|
+
}
|
|
28
|
+
`;
|
|
29
|
+
/**
|
|
30
|
+
* Whether an editable question answer should keep the browser's Enter newline.
|
|
31
|
+
* @param event - the keyboard event received before DSH's submit handler.
|
|
32
|
+
* @param context - the App keyboard state or browser touch hint.
|
|
33
|
+
* @returns True for an unmodified Enter outside IME composition on touch devices.
|
|
34
|
+
*/
|
|
35
|
+
function questionEnterUsesNewline(event, context) {
|
|
36
|
+
return (context.nativeBridge ? context.nativeState?.imeVisible === true && context.nativeState.noHardwareKeyboard === true : context.touchPrimary) && event.key === "Enter" && !event.defaultPrevented && !event.isComposing && event.keyCode !== 229 && !event.shiftKey && !event.ctrlKey && !event.altKey && !event.metaKey;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Add scoped card styles and preserve touch Enter's native editing action.
|
|
40
|
+
* Card height, typography, composer placement and draft ownership remain in DSH.
|
|
41
|
+
* @returns A disposer that restores the existing card without reloading it.
|
|
42
|
+
*/
|
|
43
|
+
function installQuestionFixes() {
|
|
44
|
+
const style = document.createElement("style");
|
|
45
|
+
style.dataset.plugin = "dsh-mobile-question-fixes";
|
|
46
|
+
style.textContent = QUESTION_FIX_CSS;
|
|
47
|
+
document.head.append(style);
|
|
48
|
+
const touchPrimary = window.matchMedia("(hover: none), (pointer: coarse)");
|
|
49
|
+
const onKeyDown = (event) => {
|
|
50
|
+
if (!questionEnterUsesNewline(event, {
|
|
51
|
+
touchPrimary: touchPrimary.matches,
|
|
52
|
+
nativeBridge: window.__DSH_MOBILE_NATIVE__ !== void 0,
|
|
53
|
+
nativeState: window.__DSH_MOBILE_KEYBOARD_STATE__ ?? null
|
|
54
|
+
})) return;
|
|
55
|
+
const answer = event.target;
|
|
56
|
+
if (!(answer instanceof HTMLTextAreaElement) || answer.disabled || answer.readOnly || answer.closest("[data-question-key]") === null) return;
|
|
57
|
+
event.stopPropagation();
|
|
58
|
+
};
|
|
59
|
+
document.addEventListener("keydown", onKeyDown, true);
|
|
60
|
+
return () => {
|
|
61
|
+
document.removeEventListener("keydown", onKeyDown, true);
|
|
62
|
+
style.remove();
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
/** Register the browser effect controlled by the bundle component's switch. */
|
|
66
|
+
function apply(ctx) {
|
|
67
|
+
ctx.effect(() => installQuestionFixes());
|
|
68
|
+
}
|
|
69
|
+
//#endregion
|
|
70
|
+
exports.QUESTION_FIX_CSS = QUESTION_FIX_CSS;
|
|
71
|
+
exports.apply = apply;
|
|
72
|
+
exports.installQuestionFixes = installQuestionFixes;
|
|
73
|
+
exports.questionEnterUsesNewline = questionEnterUsesNewline;
|
|
74
|
+
return module.exports;
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","names":[],"sources":["../src/client.ts"],"sourcesContent":["/** Local, reversible layout and touch-keyboard fixes for DSH question cards. */\nexport const QUESTION_FIX_CSS = `\n[data-question-key] > section:has(> [data-question-scroll]) {\n overflow-x: hidden !important;\n overflow-y: auto !important;\n overscroll-behavior: contain;\n}\n\n[data-question-key] > section > [data-question-scroll] {\n flex: 0 0 auto !important;\n max-height: none !important;\n overflow: visible !important;\n}\n\n[data-question-key] > section:has(> header button[aria-expanded=\"false\"]) > header h2 {\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 2;\n overflow: hidden;\n}\n`\n\n/** Keyboard facts required to preserve upstream shortcuts and IME composition. */\nexport interface QuestionEnterEvent {\n readonly key: string\n readonly keyCode: number\n readonly defaultPrevented: boolean\n readonly isComposing: boolean\n readonly shiftKey: boolean\n readonly ctrlKey: boolean\n readonly altKey: boolean\n readonly metaKey: boolean\n}\n\n/** App keyboard facts take precedence over a browser's pointer hint. */\nexport interface QuestionKeyboardContext {\n readonly touchPrimary: boolean\n readonly nativeBridge: boolean\n readonly nativeState?: { readonly imeVisible: boolean; readonly noHardwareKeyboard: boolean } | null\n}\n\n/**\n * Whether an editable question answer should keep the browser's Enter newline.\n * @param event - the keyboard event received before DSH's submit handler.\n * @param context - the App keyboard state or browser touch hint.\n * @returns True for an unmodified Enter outside IME composition on touch devices.\n */\nexport function questionEnterUsesNewline(event: QuestionEnterEvent, context: QuestionKeyboardContext): boolean {\n const keyboardAllowsNewline = context.nativeBridge\n ? context.nativeState?.imeVisible === true && context.nativeState.noHardwareKeyboard === true\n : context.touchPrimary\n return keyboardAllowsNewline && event.key === 'Enter' && !event.defaultPrevented\n && !event.isComposing && event.keyCode !== 229\n && !event.shiftKey && !event.ctrlKey && !event.altKey && !event.metaKey\n}\n\n/**\n * Add scoped card styles and preserve touch Enter's native editing action.\n * Card height, typography, composer placement and draft ownership remain in DSH.\n * @returns A disposer that restores the existing card without reloading it.\n */\nexport function installQuestionFixes(): () => void {\n const style = document.createElement('style')\n style.dataset.plugin = 'dsh-mobile-question-fixes'\n style.textContent = QUESTION_FIX_CSS\n document.head.append(style)\n const touchPrimary = window.matchMedia('(hover: none), (pointer: coarse)')\n const onKeyDown = (event: KeyboardEvent): void => {\n if (!questionEnterUsesNewline(event, {\n touchPrimary: touchPrimary.matches,\n nativeBridge: window.__DSH_MOBILE_NATIVE__ !== undefined,\n nativeState: window.__DSH_MOBILE_KEYBOARD_STATE__ ?? null,\n })) return\n const answer = event.target\n if (!(answer instanceof HTMLTextAreaElement) || answer.disabled || answer.readOnly\n || answer.closest('[data-question-key]') === null) return\n // DSH submits on keydown. Leave the textarea's default action and input event\n // intact so React receives the newline as an ordinary edit.\n event.stopPropagation()\n }\n document.addEventListener('keydown', onKeyDown, true)\n return () => {\n document.removeEventListener('keydown', onKeyDown, true)\n style.remove()\n }\n}\n\n/** Register the browser effect controlled by the bundle component's switch. */\nexport function apply(ctx: { effect(effect: () => void | (() => void)): void }): void {\n ctx.effect(() => installQuestionFixes())\n}\n"],"mappings":";;;;;;;;EACA,MAAa,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;EA8ChC,SAAgB,yBAAyB,OAA2B,SAA2C;GAI7G,QAH8B,QAAQ,eAClC,QAAQ,aAAa,eAAe,QAAQ,QAAQ,YAAY,uBAAuB,OACvF,QAAQ,iBACoB,MAAM,QAAQ,WAAW,CAAC,MAAM,oBAC3D,CAAC,MAAM,eAAe,MAAM,YAAY,OACxC,CAAC,MAAM,YAAY,CAAC,MAAM,WAAW,CAAC,MAAM,UAAU,CAAC,MAAM;EACpE;;;;;;EAOA,SAAgB,uBAAmC;GACjD,MAAM,QAAQ,SAAS,cAAc,OAAO;GAC5C,MAAM,QAAQ,SAAS;GACvB,MAAM,cAAc;GACpB,SAAS,KAAK,OAAO,KAAK;GAC1B,MAAM,eAAe,OAAO,WAAW,kCAAkC;GACzE,MAAM,aAAa,UAA+B;IAChD,IAAI,CAAC,yBAAyB,OAAO;KACnC,cAAc,aAAa;KAC3B,cAAc,OAAO,0BAA0B,KAAA;KAC/C,aAAa,OAAO,iCAAiC;IACvD,CAAC,GAAG;IACJ,MAAM,SAAS,MAAM;IACrB,IAAI,EAAE,kBAAkB,wBAAwB,OAAO,YAAY,OAAO,YACrE,OAAO,QAAQ,qBAAqB,MAAM,MAAM;IAGrD,MAAM,gBAAgB;GACxB;GACA,SAAS,iBAAiB,WAAW,WAAW,IAAI;GACpD,aAAa;IACX,SAAS,oBAAoB,WAAW,WAAW,IAAI;IACvD,MAAM,OAAO;GACf;EACF;;EAGA,SAAgB,MAAM,KAAgE;GACpF,IAAI,aAAa,qBAAqB,CAAC;EACzC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
//#region packages/question-fixes/src/index.ts
|
|
2
|
+
/**
|
|
3
|
+
* Question-card fixes, node half.
|
|
4
|
+
*
|
|
5
|
+
* A pure UI plugin: this empty apply exists so the plugin appears in the Loader
|
|
6
|
+
* and gets its own component row with its own toggle. The browser half ships as
|
|
7
|
+
* `exports["./client"]`, discovered through the `dsh.client` declaration in this
|
|
8
|
+
* package's manifest. All behaviour lives in `src/client.ts`.
|
|
9
|
+
*/
|
|
10
|
+
function apply() {}
|
|
11
|
+
//#endregion
|
|
12
|
+
export { apply };
|
|
13
|
+
|
|
14
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["/**\n * Question-card fixes, node half.\n *\n * A pure UI plugin: this empty apply exists so the plugin appears in the Loader\n * and gets its own component row with its own toggle. The browser half ships as\n * `exports[\"./client\"]`, discovered through the `dsh.client` declaration in this\n * package's manifest. All behaviour lives in `src/client.ts`.\n */\nexport function apply(): void {}\n"],"mappings":";;;;;;;;;AAQA,SAAgB,QAAc,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "dsh-mobile-question-fixes",
|
|
3
|
+
"version": "0.5.4",
|
|
4
|
+
"private": true,
|
|
5
|
+
"description": "Scoped question-card scrolling and touch-keyboard fixes for DSH Web.",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"default": "./lib/index.mjs"
|
|
10
|
+
},
|
|
11
|
+
"./client": {
|
|
12
|
+
"default": "./lib/client.js"
|
|
13
|
+
},
|
|
14
|
+
"./package.json": "./package.json"
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"lib"
|
|
18
|
+
],
|
|
19
|
+
"dsh": {
|
|
20
|
+
"client": {
|
|
21
|
+
"platform": "web",
|
|
22
|
+
"immediately": true
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|