phirepass-widgets 0.0.100 → 0.0.102

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 (37) hide show
  1. package/dist/cjs/loader.cjs.js +1 -1
  2. package/dist/cjs/phirepass-rdp.cjs.entry.js +30 -10
  3. package/dist/cjs/phirepass-sftp-client.cjs.entry.js +547 -81
  4. package/dist/cjs/phirepass-terminal.cjs.entry.js +2 -2
  5. package/dist/cjs/phirepass-widgets.cjs.js +1 -1
  6. package/dist/cjs/{protocol-B45sQiET.js → protocol-BcMWzyWp.js} +155 -59
  7. package/dist/collection/common/protocol.js +1 -0
  8. package/dist/collection/components/phirepass-rdp/phirepass-rdp.js +17 -8
  9. package/dist/collection/components/phirepass-rdp/phirepass-rdp.viewport.js +12 -1
  10. package/dist/collection/components/phirepass-sftp-client/phirepass-sftp-client.css +342 -2
  11. package/dist/collection/components/phirepass-sftp-client/phirepass-sftp-client.js +568 -80
  12. package/dist/collection/components/phirepass-terminal/phirepass-terminal.js +1 -1
  13. package/dist/collection/phirepass-channel_bg.wasm +0 -0
  14. package/dist/components/p-Dzyd97Ok.js +1 -0
  15. package/dist/components/phirepass-rdp.js +1 -1
  16. package/dist/components/phirepass-sftp-client.js +1 -1
  17. package/dist/components/phirepass-terminal.js +2 -2
  18. package/dist/esm/loader.js +1 -1
  19. package/dist/esm/phirepass-rdp.entry.js +30 -10
  20. package/dist/esm/phirepass-sftp-client.entry.js +547 -81
  21. package/dist/esm/phirepass-terminal.entry.js +2 -2
  22. package/dist/esm/phirepass-widgets.js +1 -1
  23. package/dist/esm/{protocol-DFhjP92A.js → protocol-Dzyd97Ok.js} +154 -58
  24. package/dist/phirepass-widgets/p-11aedd04.entry.js +1 -0
  25. package/dist/phirepass-widgets/{p-c4a31b26.entry.js → p-16145ab4.entry.js} +2 -2
  26. package/dist/phirepass-widgets/p-57d80137.entry.js +1 -0
  27. package/dist/phirepass-widgets/p-Dzyd97Ok.js +1 -0
  28. package/dist/phirepass-widgets/phirepass-channel_bg.wasm +0 -0
  29. package/dist/phirepass-widgets/phirepass-widgets.esm.js +1 -1
  30. package/dist/types/common/protocol.d.ts +22 -2
  31. package/dist/types/components/phirepass-rdp/phirepass-rdp.viewport.d.ts +11 -1
  32. package/dist/types/components/phirepass-sftp-client/phirepass-sftp-client.d.ts +85 -4
  33. package/package.json +2 -2
  34. package/dist/components/p-DFhjP92A.js +0 -1
  35. package/dist/phirepass-widgets/p-0e9afedb.entry.js +0 -1
  36. package/dist/phirepass-widgets/p-DFhjP92A.js +0 -1
  37. package/dist/phirepass-widgets/p-ee09d805.entry.js +0 -1
@@ -6,7 +6,7 @@ var appGlobals = require('./app-globals-V2Kpy_OQ.js');
6
6
  const defineCustomElements = async (win, options) => {
7
7
  if (typeof window === 'undefined') return undefined;
8
8
  await appGlobals.globalScripts();
9
- return index.bootstrapLazy([["phirepass-rdp.cjs",[[769,"phirepass-rdp",{"serverHost":[1,"server-host"],"serverPort":[2,"server-port"],"allowInsecure":[4,"allow-insecure"],"heartbeatInterval":[2,"heartbeat-interval"],"nodeId":[1,"node-id"],"serviceId":[1,"service-id"],"token":[1],"username":[1],"password":[1],"destination":[1],"scale":[1],"dynamicResize":[4,"dynamic-resize"],"captureKeyboard":[4,"capture-keyboard"],"clipboard":[4],"serverId":[1,"server-id"],"credentialsPrompt":[32],"statusMessage":[32],"toggleFullscreen":[64],"keyboardLockSupported":[64],"focusDesktop":[64],"sendCtrlAltDel":[64],"sendMetaKey":[64]},null,{"nodeId":[{"onNodeIdChange":0}],"serverId":[{"onServerIdChange":0}]}]]],["phirepass-sftp-client.cjs",[[513,"phirepass-sftp-client",{"name":[1],"description":[1],"hideHeader":[4,"hide-header"],"serverHost":[1,"server-host"],"serverPort":[2,"server-port"],"allowInsecure":[4,"allow-insecure"],"heartbeatInterval":[2,"heartbeat-interval"],"nodeId":[1,"node-id"],"serviceId":[1,"service-id"],"token":[1],"serverId":[1,"server-id"],"max":[32],"show_login_screen":[32],"show_login_screen_username":[32],"show_error":[32],"error_message":[32],"show_login_screen_password":[32],"show_navigation":[32],"breadcrumbs":[32],"current_dir":[32],"listing":[32],"show_content":[32],"show_loader":[32],"version":[32],"status":[32],"selected_item":[32],"show_upload_modal":[32],"upload_progress":[32],"upload_file_name":[32],"upload_speed":[32],"upload_finished":[32],"show_download_modal":[32],"download_progress":[32],"download_file_name":[32],"download_speed":[32],"download_finished":[32],"show_delete_modal":[32],"delete_file_name":[32],"delete_loading":[32],"maximize":[64],"minimize":[64]},null,{"nodeId":[{"onNodeIdChange":0}],"serverId":[{"onServerIdChange":0}]}]]],["phirepass-terminal.cjs",[[513,"phirepass-terminal",{"terminalOptions":[16],"serverHost":[1,"server-host"],"serverPort":[2,"server-port"],"allowInsecure":[4,"allow-insecure"],"heartbeatInterval":[2,"heartbeat-interval"],"nodeId":[1,"node-id"],"serviceId":[1,"service-id"],"token":[1],"serverId":[1,"server-id"]},null,{"nodeId":[{"onNodeIdChange":0}],"serverId":[{"onServerIdChange":0}]}]]]], options);
9
+ return index.bootstrapLazy([["phirepass-rdp.cjs",[[769,"phirepass-rdp",{"serverHost":[1,"server-host"],"serverPort":[2,"server-port"],"allowInsecure":[4,"allow-insecure"],"heartbeatInterval":[2,"heartbeat-interval"],"nodeId":[1,"node-id"],"serviceId":[1,"service-id"],"token":[1],"username":[1],"password":[1],"destination":[1],"scale":[1],"dynamicResize":[4,"dynamic-resize"],"captureKeyboard":[4,"capture-keyboard"],"clipboard":[4],"serverId":[1,"server-id"],"credentialsPrompt":[32],"statusMessage":[32],"toggleFullscreen":[64],"keyboardLockSupported":[64],"focusDesktop":[64],"sendCtrlAltDel":[64],"sendMetaKey":[64]},null,{"nodeId":[{"onNodeIdChange":0}],"serverId":[{"onServerIdChange":0}]}]]],["phirepass-sftp-client.cjs",[[513,"phirepass-sftp-client",{"name":[1],"description":[1],"hideHeader":[4,"hide-header"],"serverHost":[1,"server-host"],"serverPort":[2,"server-port"],"allowInsecure":[4,"allow-insecure"],"heartbeatInterval":[2,"heartbeat-interval"],"nodeId":[1,"node-id"],"serviceId":[1,"service-id"],"token":[1],"serverId":[1,"server-id"],"max":[32],"show_login_screen":[32],"show_login_screen_username":[32],"show_error":[32],"error_message":[32],"show_login_screen_password":[32],"show_navigation":[32],"breadcrumbs":[32],"current_dir":[32],"listing":[32],"show_content":[32],"show_loader":[32],"version":[32],"status":[32],"selected_item":[32],"show_upload_modal":[32],"upload_progress":[32],"upload_file_name":[32],"upload_speed":[32],"upload_finished":[32],"show_download_modal":[32],"download_progress":[32],"download_file_name":[32],"download_speed":[32],"download_finished":[32],"show_delete_modal":[32],"delete_file_name":[32],"delete_loading":[32],"delete_is_dir":[32],"delete_recursive":[32],"delete_error":[32],"prompt_kind":[32],"prompt_value":[32],"prompt_error":[32],"prompt_busy":[32],"chmod_target":[32],"chmod_mode":[32],"chmod_error":[32],"chmod_busy":[32],"show_editor":[32],"editor_name":[32],"editor_text":[32],"editor_saved_text":[32],"editor_busy":[32],"editor_error":[32],"editor_confirm_discard":[32],"editor_loaded":[32],"filter":[32],"sort_key":[32],"sort_asc":[32],"maximize":[64],"minimize":[64]},null,{"nodeId":[{"onNodeIdChange":0}],"serverId":[{"onServerIdChange":0}]}]]],["phirepass-terminal.cjs",[[513,"phirepass-terminal",{"terminalOptions":[16],"serverHost":[1,"server-host"],"serverPort":[2,"server-port"],"allowInsecure":[4,"allow-insecure"],"heartbeatInterval":[2,"heartbeat-interval"],"nodeId":[1,"node-id"],"serviceId":[1,"service-id"],"token":[1],"serverId":[1,"server-id"]},null,{"nodeId":[{"onNodeIdChange":0}],"serverId":[{"onServerIdChange":0}]}]]]], options);
10
10
  };
11
11
 
12
12
  exports.setNonce = index.setNonce;
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var index = require('./index-CbZdPuPQ.js');
4
- var protocol = require('./protocol-B45sQiET.js');
4
+ var protocol = require('./protocol-BcMWzyWp.js');
5
5
 
6
6
  /**
7
7
  * RDP's display-control PDU describes a monitor in whole, even pixels within
@@ -91,9 +91,20 @@ class ViewportSync {
91
91
  /**
92
92
  * Starts watching `element`. The current size is reported immediately, so a
93
93
  * widget that was resized while disconnected catches up on reconnect.
94
+ *
95
+ * `openedAt` is the size the session was actually opened at, and passing it
96
+ * is what stops that immediate report from being a resize to the resolution
97
+ * the host is already showing. That redundant request is not free: a
98
+ * display-control PDU makes the host renegotiate capabilities and resend the
99
+ * screen, and arriving moments after the connection sequence it is the worst
100
+ * possible time to ask — the client can end up parsing a bitmap whose
101
+ * declared length no longer matches the stream. Seeded here rather than
102
+ * suppressed at the call site because "what has the host been told" is this
103
+ * class's state; the caller only knows what it asked for at connect.
94
104
  */
95
- observe(element) {
105
+ observe(element, openedAt) {
96
106
  this.disconnect();
107
+ this.reported = openedAt;
97
108
  this.report(measure_desktop_size(element));
98
109
  // Absent under the spec test environment, and on nothing else worth
99
110
  // supporting — a missing observer costs the dynamic resize, not the
@@ -602,10 +613,11 @@ const PhirepassRdp = class {
602
613
  // `start_viewport_sync` correct the size once the client is visible;
603
614
  // sending a size derived from a zero-sized box is how a host ends up
604
615
  // refusing the connection outright.
616
+ let openedAt;
605
617
  if (this.dynamicResize) {
606
- const size = measure_initial_desktop_size(this.el);
607
- if (size) {
608
- builder.withDesktopSize(size);
618
+ openedAt = measure_initial_desktop_size(this.el);
619
+ if (openedAt) {
620
+ builder.withDesktopSize(openedAt);
609
621
  }
610
622
  }
611
623
  try {
@@ -623,9 +635,17 @@ const PhirepassRdp = class {
623
635
  userInteraction.setVisibility(true);
624
636
  this.statusMessage = undefined;
625
637
  this.focus_desktop();
626
- this.start_viewport_sync();
627
638
  void this.sync_keyboard_lock();
628
- const termination = await session.run();
639
+ // Started before the viewport sync, and kept unawaited until after
640
+ // it: `run` drives the stream, and the sync can emit a
641
+ // display-control PDU the moment it is attached. Asking the host to
642
+ // change resolution while the connection sequence is still being
643
+ // parsed is how a fast-path bitmap ends up truncated against its own
644
+ // declared length. Entering `run` first means anything the sync
645
+ // sends lands on a session that is already reading.
646
+ const running = session.run();
647
+ this.start_viewport_sync(openedAt);
648
+ const termination = await running;
629
649
  this.statusMessage = termination.reason();
630
650
  }
631
651
  catch (err) {
@@ -641,12 +661,12 @@ const PhirepassRdp = class {
641
661
  * measurement has to happen after it — measuring earlier reads a hidden,
642
662
  * zero-sized box.
643
663
  */
644
- start_viewport_sync() {
664
+ start_viewport_sync(openedAt) {
645
665
  if (!this.dynamicResize) {
646
666
  return;
647
667
  }
648
668
  this.viewport = new ViewportSync((size) => this.resize_desktop(size));
649
- this.viewport.observe(this.el);
669
+ this.viewport.observe(this.el, openedAt);
650
670
  }
651
671
  stop_viewport_sync() {
652
672
  this.viewport?.disconnect();
@@ -732,7 +752,7 @@ const PhirepassRdp = class {
732
752
  this.request_tunnel();
733
753
  }
734
754
  render() {
735
- return (index.h(index.Host, { key: '9eb8ba7d53d4c9489df71a9da5bae59f348b3d8a' }, index.h("div", { key: '2172cf49625768c585cb5a976f5164d0348e8426', class: "screen", ref: (el) => (this.containerEl = el) }, index.h("slot", { key: '46f7cffae68155552bb5262c94d8fa308dbcb5df' })), this.credentialsPrompt && (index.h("form", { key: '02da607149cf5d444389888bc4dc1422f7ed44bd', class: "prompt", onSubmit: (event) => this.submit_credentials(event) }, index.h("label", { key: '5e560dd128da72280e0711c545335ec3624a7934', htmlFor: "rdp-username" }, "Username"), index.h("input", { key: '3969f84697c0112cb3a7eeab0a2f8238cff7cff5', id: "rdp-username", type: "text", autocomplete: "off", autofocus: true, onInput: (event) => (this.usernameBuffer = event.target.value) }), index.h("label", { key: 'fec51856a4523c8713938cee20b0e0025ff32795', htmlFor: "rdp-password" }, "Password"), index.h("input", { key: 'e4dff2271b1eb7576bff701540f2566d0bbb897d', id: "rdp-password", type: "password", autocomplete: "off", onInput: (event) => (this.passwordBuffer = event.target.value) }), index.h("button", { key: 'b59d8a69c27e065831d815c9f5a7c8a3432594f6', type: "submit" }, "Connect"))), this.statusMessage && !this.credentialsPrompt && (index.h("div", { key: '7439841369456b3d057a3c389cabeca6affa6f98', class: "status" }, this.statusMessage))));
755
+ return (index.h(index.Host, { key: '56354df7bd0d3f01fcd5ff65ca5618ceb6af1b91' }, index.h("div", { key: '446dc83e41a29c3bc2c341a26092ed3581565967', class: "screen", ref: (el) => (this.containerEl = el) }, index.h("slot", { key: '2beafc92d81662dfac5c7b41356f6c6c802643b9' })), this.credentialsPrompt && (index.h("form", { key: 'dcc29b21fba03bb97526ec3d1cf5a1fb51b483e9', class: "prompt", onSubmit: (event) => this.submit_credentials(event) }, index.h("label", { key: 'b5a3e302089b2282aedbdbefd4fb5eaca7c34455', htmlFor: "rdp-username" }, "Username"), index.h("input", { key: '3bd1c902a6bc41bc7e69c16258cac78035a949bd', id: "rdp-username", type: "text", autocomplete: "off", autofocus: true, onInput: (event) => (this.usernameBuffer = event.target.value) }), index.h("label", { key: '2defe12d73b609cbad27c06447c3c3221ff3e5aa', htmlFor: "rdp-password" }, "Password"), index.h("input", { key: '55935891f24f0c1db71a14c42b2fc7a96c0c0ba6', id: "rdp-password", type: "password", autocomplete: "off", onInput: (event) => (this.passwordBuffer = event.target.value) }), index.h("button", { key: '83439c0e8756001c7042fc3b6754889d62a8eada', type: "submit" }, "Connect"))), this.statusMessage && !this.credentialsPrompt && (index.h("div", { key: '294262625f44a3f45d54bcd492875a9b6fd03219', class: "status" }, this.statusMessage))));
736
756
  }
737
757
  static get watchers() { return {
738
758
  "nodeId": [{