@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.
Files changed (56) hide show
  1. package/README.i18n.yaml +2 -2
  2. package/README.md +5 -2
  3. package/README.zh.md +2 -2
  4. package/lib/client.js +82 -66
  5. package/lib/client.js.map +1 -1
  6. package/lib/index.js +18 -18
  7. package/lib/mobile.js +649 -45
  8. package/lib/mobile.js.map +1 -1
  9. package/lib/types/client/PluginSettingsCard.d.ts +11 -0
  10. package/lib/types/client/PluginSettingsCard.d.ts.map +1 -1
  11. package/lib/types/client/PluginSettingsCard.js +11 -5
  12. package/lib/types/client/RemoteSettingsCard.d.ts +5 -0
  13. package/lib/types/client/RemoteSettingsCard.d.ts.map +1 -1
  14. package/lib/types/client/RemoteSettingsCard.js +7 -0
  15. package/lib/types/client/index.d.ts.map +1 -1
  16. package/lib/types/client/index.js +13 -7
  17. package/lib/types/client/settings-form.d.ts +8 -0
  18. package/lib/types/client/settings-form.d.ts.map +1 -1
  19. package/lib/types/client/settings-form.js +15 -1
  20. package/lib/types/gate.d.ts +4 -9
  21. package/lib/types/gate.d.ts.map +1 -1
  22. package/lib/types/gate.js +5 -32
  23. package/lib/types/loopback.d.ts +25 -0
  24. package/lib/types/loopback.d.ts.map +1 -0
  25. package/lib/types/loopback.js +68 -0
  26. package/lib/types/mobile/markdown.d.ts +26 -0
  27. package/lib/types/mobile/markdown.d.ts.map +1 -0
  28. package/lib/types/mobile/markdown.js +272 -0
  29. package/lib/types/mobile/markdown.test.d.ts +2 -0
  30. package/lib/types/mobile/markdown.test.d.ts.map +1 -0
  31. package/lib/types/mobile/markdown.test.js +67 -0
  32. package/lib/types/mobile/messages.d.ts +14 -0
  33. package/lib/types/mobile/messages.d.ts.map +1 -1
  34. package/lib/types/mobile/messages.js +54 -2
  35. package/lib/types/mobile/messages.test.js +99 -0
  36. package/lib/types/mobile/mobile-styles.d.ts +1 -1
  37. package/lib/types/mobile/mobile-styles.d.ts.map +1 -1
  38. package/lib/types/mobile/mobile-styles.js +167 -0
  39. package/lib/types/mobile/views/ChatView.d.ts.map +1 -1
  40. package/lib/types/mobile/views/ChatView.js +81 -5
  41. package/lib/types/mobile/views/ChatView.test.js +105 -0
  42. package/package.json +1 -1
  43. package/src/client/PluginSettingsCard.tsx +50 -47
  44. package/src/client/RemoteSettingsCard.tsx +8 -0
  45. package/src/client/index.ts +13 -7
  46. package/src/client/settings-card.module.css +9 -0
  47. package/src/client/settings-form.ts +15 -1
  48. package/src/gate.ts +5 -30
  49. package/src/loopback.ts +63 -0
  50. package/src/mobile/markdown.test.ts +77 -0
  51. package/src/mobile/markdown.ts +278 -0
  52. package/src/mobile/messages.test.ts +106 -0
  53. package/src/mobile/messages.ts +66 -2
  54. package/src/mobile/mobile-styles.ts +167 -0
  55. package/src/mobile/views/ChatView.test.tsx +121 -0
  56. 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/gate.ts
487
- /**
488
- * Whether a normalized URL hostname names the local loopback authority.
489
- * Semantics mirror the connection package's internal predicate (localhost,
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
- /** IPv4 127/8 predicate (four decimal octets, first == 127). */
511
- function isIPv4Loopback(v4) {
512
- const parts = v4.split(".");
513
- return parts.length === 4 && parts[0] === "127" && parts.every((part) => /^\d{1,3}$/.test(part) && Number(part) <= 255);
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).