@linxin666/dsh-remote-web-ui 0.1.17 → 0.1.19
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.i18n.yaml +2 -2
- package/README.md +5 -2
- package/README.zh.md +2 -2
- package/lib/client.js +82 -66
- package/lib/client.js.map +1 -1
- package/lib/index.js +18 -18
- package/lib/mobile.js +649 -45
- package/lib/mobile.js.map +1 -1
- package/lib/types/client/PluginSettingsCard.d.ts +11 -0
- package/lib/types/client/PluginSettingsCard.d.ts.map +1 -1
- package/lib/types/client/PluginSettingsCard.js +11 -5
- package/lib/types/client/RemoteSettingsCard.d.ts +5 -0
- package/lib/types/client/RemoteSettingsCard.d.ts.map +1 -1
- package/lib/types/client/RemoteSettingsCard.js +7 -0
- package/lib/types/client/index.d.ts.map +1 -1
- package/lib/types/client/index.js +13 -7
- package/lib/types/client/settings-form.d.ts +8 -0
- package/lib/types/client/settings-form.d.ts.map +1 -1
- package/lib/types/client/settings-form.js +15 -1
- package/lib/types/gate.d.ts +4 -9
- package/lib/types/gate.d.ts.map +1 -1
- package/lib/types/gate.js +5 -32
- package/lib/types/loopback.d.ts +25 -0
- package/lib/types/loopback.d.ts.map +1 -0
- package/lib/types/loopback.js +68 -0
- package/lib/types/mobile/markdown.d.ts +26 -0
- package/lib/types/mobile/markdown.d.ts.map +1 -0
- package/lib/types/mobile/markdown.js +272 -0
- package/lib/types/mobile/markdown.test.d.ts +2 -0
- package/lib/types/mobile/markdown.test.d.ts.map +1 -0
- package/lib/types/mobile/markdown.test.js +67 -0
- package/lib/types/mobile/messages.d.ts +14 -0
- package/lib/types/mobile/messages.d.ts.map +1 -1
- package/lib/types/mobile/messages.js +54 -2
- package/lib/types/mobile/messages.test.js +99 -0
- package/lib/types/mobile/mobile-styles.d.ts +1 -1
- package/lib/types/mobile/mobile-styles.d.ts.map +1 -1
- package/lib/types/mobile/mobile-styles.js +167 -0
- package/lib/types/mobile/views/ChatView.d.ts.map +1 -1
- package/lib/types/mobile/views/ChatView.js +81 -5
- package/lib/types/mobile/views/ChatView.test.js +105 -0
- package/package.json +1 -1
- package/src/client/PluginSettingsCard.tsx +50 -47
- package/src/client/RemoteSettingsCard.tsx +8 -0
- package/src/client/index.ts +13 -7
- package/src/client/settings-card.module.css +9 -0
- package/src/client/settings-form.ts +15 -1
- package/src/gate.ts +5 -30
- package/src/loopback.ts +63 -0
- package/src/mobile/markdown.test.ts +77 -0
- package/src/mobile/markdown.ts +278 -0
- package/src/mobile/messages.test.ts +106 -0
- package/src/mobile/messages.ts +66 -2
- package/src/mobile/mobile-styles.ts +167 -0
- package/src/mobile/views/ChatView.test.tsx +121 -0
- package/src/mobile/views/ChatView.tsx +164 -6
package/lib/index.js
CHANGED
|
@@ -483,20 +483,10 @@ function sameStrings(a, b) {
|
|
|
483
483
|
return a.length === b.length && a.every((value, index) => value === b[index]);
|
|
484
484
|
}
|
|
485
485
|
//#endregion
|
|
486
|
-
//#region src/
|
|
487
|
-
/**
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
* IPv6 loopback, any IPv4 address in 127/8); it is reimplemented here because
|
|
491
|
-
* the connection package no longer exports it — the fence now lives inside
|
|
492
|
-
* the connection plugin, and external host plugins only need the
|
|
493
|
-
* classification, not the whole trust decision.
|
|
494
|
-
* @param hostname - WHATWG URL hostname (IPv6 literals retain brackets).
|
|
495
|
-
* @returns true for localhost, IPv6 loopback, or any IPv4 address in 127/8.
|
|
496
|
-
*/
|
|
497
|
-
function isLoopbackHostname(hostname) {
|
|
498
|
-
if (hostname === "localhost" || hostname === "[::1]") return true;
|
|
499
|
-
const parts = hostname.split(".");
|
|
486
|
+
//#region src/loopback.ts
|
|
487
|
+
/** IPv4 127/8 predicate (four decimal octets, first == 127). */
|
|
488
|
+
function isIPv4Loopback(v4) {
|
|
489
|
+
const parts = v4.split(".");
|
|
500
490
|
return parts.length === 4 && parts[0] === "127" && parts.every((part) => /^\d{1,3}$/.test(part) && Number(part) <= 255);
|
|
501
491
|
}
|
|
502
492
|
/** Whether a socket remote address names the loopback range (127/8, ::1, IPv4-mapped). */
|
|
@@ -507,11 +497,21 @@ function isLoopbackAddress(address) {
|
|
|
507
497
|
if (normalized.startsWith("::ffff:")) return isIPv4Loopback(normalized.slice(7));
|
|
508
498
|
return isIPv4Loopback(normalized);
|
|
509
499
|
}
|
|
510
|
-
/**
|
|
511
|
-
function
|
|
512
|
-
|
|
513
|
-
return
|
|
500
|
+
/** Whether a normalized URL hostname names the loopback authority (localhost, [::1], 127/8). */
|
|
501
|
+
function isLoopbackHostname(hostname) {
|
|
502
|
+
if (hostname === "localhost" || hostname === "[::1]") return true;
|
|
503
|
+
return isIPv4Loopback(hostname);
|
|
514
504
|
}
|
|
505
|
+
//#endregion
|
|
506
|
+
//#region src/gate.ts
|
|
507
|
+
/**
|
|
508
|
+
* Loopback classification for the desktop client. The predicates now live in
|
|
509
|
+
* the shared synced copy (shared/host/loopback.ts, mirrored to ./loopback.ts
|
|
510
|
+
* by scripts/sync-shared.mjs): localhost, IPv6 loopback, and any IPv4 address
|
|
511
|
+
* in 127/8.
|
|
512
|
+
* @param hostname - WHATWG URL hostname (IPv6 literals retain brackets).
|
|
513
|
+
* @returns true for localhost, IPv6 loopback, or any IPv4 address in 127/8.
|
|
514
|
+
*/
|
|
515
515
|
/**
|
|
516
516
|
* Read one cookie value from a Cookie header.
|
|
517
517
|
* @param header - the raw Cookie header value (or undefined).
|