mol_view_tree2_lib 1.0.235 → 1.0.237

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/node.d.ts CHANGED
@@ -1084,8 +1084,8 @@ declare namespace $ {
1084
1084
  dir: string;
1085
1085
  }> {
1086
1086
  }
1087
- const $mol_run_spawn: (...args: Parameters<(typeof $node)["child_process"]["spawn"]>) => import("child_process").ChildProcess;
1088
- const $mol_run_spawn_sync: (...args: Parameters<(typeof $node)["child_process"]["spawnSync"]>) => import("child_process").SpawnSyncReturns<string | NonSharedBuffer>;
1087
+ const $mol_run_spawn: (...args: Parameters<(typeof $node)["child_process"]["spawn"]>) => import("node:child_process").ChildProcess;
1088
+ const $mol_run_spawn_sync: (...args: Parameters<(typeof $node)["child_process"]["spawnSync"]>) => import("node:child_process").SpawnSyncReturns<string | NonSharedBuffer>;
1089
1089
  type $mol_run_options = {
1090
1090
  command: readonly string[] | string;
1091
1091
  dir: string;
@@ -1094,10 +1094,10 @@ declare namespace $ {
1094
1094
  };
1095
1095
  class $mol_run extends $mol_object {
1096
1096
  static async_enabled(): boolean;
1097
- static spawn(options: $mol_run_options): import("child_process").SpawnSyncReturns<string | NonSharedBuffer> | $mol_run_error_context;
1097
+ static spawn(options: $mol_run_options): import("node:child_process").SpawnSyncReturns<string | NonSharedBuffer> | $mol_run_error_context;
1098
1098
  static spawn_async({ dir, sync, timeout, command, env }: $mol_run_options & {
1099
1099
  sync?: boolean;
1100
- }): import("child_process").SpawnSyncReturns<string | NonSharedBuffer> | (Promise<$mol_run_error_context> & {
1100
+ }): import("node:child_process").SpawnSyncReturns<string | NonSharedBuffer> | (Promise<$mol_run_error_context> & {
1101
1101
  destructor: () => void;
1102
1102
  });
1103
1103
  static error_message(res?: $mol_run_error_context): string;
@@ -1141,7 +1141,7 @@ declare namespace $ {
1141
1141
  declare namespace $ {
1142
1142
  class $mol_storage_node extends $mol_storage {
1143
1143
  static persisted(): boolean;
1144
- static stats(): import("fs").StatsFs;
1144
+ static stats(): import("node:fs").StatsFs;
1145
1145
  static total(): number;
1146
1146
  static used(): number;
1147
1147
  static free(): number;
package/node.test.js CHANGED
@@ -10776,7 +10776,7 @@ var $;
10776
10776
  })($ || ($ = {}));
10777
10777
 
10778
10778
  ;
10779
- ($.$mol_hotkey) = class $mol_hotkey extends ($.$mol_plugin) {
10779
+ ($.$mol_hotkey2) = class $mol_hotkey2 extends ($.$mol_plugin) {
10780
10780
  keydown(next){
10781
10781
  if(next !== undefined) return next;
10782
10782
  return null;
@@ -10784,20 +10784,11 @@ var $;
10784
10784
  event(){
10785
10785
  return {...(super.event()), "keydown": (next) => (this.keydown(next))};
10786
10786
  }
10787
- key(){
10787
+ action(){
10788
10788
  return {};
10789
10789
  }
10790
- mod_ctrl(){
10791
- return false;
10792
- }
10793
- mod_alt(){
10794
- return false;
10795
- }
10796
- mod_shift(){
10797
- return false;
10798
- }
10799
10790
  };
10800
- ($mol_mem(($.$mol_hotkey.prototype), "keydown"));
10791
+ ($mol_mem(($.$mol_hotkey2.prototype), "keydown"));
10801
10792
 
10802
10793
 
10803
10794
  ;
@@ -10927,27 +10918,71 @@ var $;
10927
10918
  * Plugin which adds handlers for keyboard keys.
10928
10919
  * @see [mol_keyboard_code](../keyboard/code/code.ts)
10929
10920
  */
10930
- class $mol_hotkey extends $.$mol_hotkey {
10931
- key() {
10932
- return super.key();
10933
- }
10921
+ class $mol_hotkey2 extends $.$mol_hotkey2 {
10934
10922
  keydown(event) {
10935
10923
  if (!event)
10936
10924
  return;
10937
10925
  if (event.defaultPrevented)
10938
10926
  return;
10939
- let name = $mol_keyboard_code[event.keyCode];
10940
- if (this.mod_ctrl() !== (event.ctrlKey || event.metaKey))
10941
- return;
10942
- if (this.mod_alt() !== event.altKey)
10943
- return;
10944
- if (this.mod_shift() !== event.shiftKey)
10945
- return;
10946
- const handle = this.key()[name];
10947
- if (handle)
10948
- handle(event);
10927
+ const key = [...new Set([
10928
+ ...(event.ctrlKey || event.metaKey) ? ['ctrl'] : [],
10929
+ ...event.altKey ? ['alt'] : [],
10930
+ ...event.shiftKey ? ['shift'] : [],
10931
+ $mol_keyboard_code[event.keyCode] ?? '?',
10932
+ ])].join('_');
10933
+ this.action()[key]?.(event);
10949
10934
  }
10950
10935
  }
10936
+ $$.$mol_hotkey2 = $mol_hotkey2;
10937
+ })($$ = $.$$ || ($.$$ = {}));
10938
+ })($ || ($ = {}));
10939
+
10940
+ ;
10941
+ ($.$mol_hotkey) = class $mol_hotkey extends ($.$mol_hotkey2) {
10942
+ key(){
10943
+ return {};
10944
+ }
10945
+ mod_ctrl(){
10946
+ return false;
10947
+ }
10948
+ mod_alt(){
10949
+ return false;
10950
+ }
10951
+ mod_shift(){
10952
+ return false;
10953
+ }
10954
+ };
10955
+
10956
+
10957
+ ;
10958
+ "use strict";
10959
+
10960
+
10961
+ ;
10962
+ "use strict";
10963
+ var $;
10964
+ (function ($) {
10965
+ var $$;
10966
+ (function ($$) {
10967
+ /**
10968
+ * Plugin which adds handlers for keyboard keys.
10969
+ * @deprecated Use $mol_hotkey2
10970
+ * @see [mol_keyboard_code](../keyboard/code/code.ts)
10971
+ */
10972
+ class $mol_hotkey extends $.$mol_hotkey {
10973
+ action() {
10974
+ const prefix = [...new Set([
10975
+ ...this.mod_ctrl() ? ['ctrl_'] : [],
10976
+ ...this.mod_alt() ? ['alt_'] : [],
10977
+ ...this.mod_shift() ? ['shift_'] : [],
10978
+ ])].join('');
10979
+ return Object.fromEntries(Object.entries(this.key())
10980
+ .map(([key, val]) => [prefix + key, val]));
10981
+ }
10982
+ }
10983
+ __decorate([
10984
+ $mol_mem
10985
+ ], $mol_hotkey.prototype, "action", null);
10951
10986
  $$.$mol_hotkey = $mol_hotkey;
10952
10987
  })($$ = $.$$ || ($.$$ = {}));
10953
10988
  })($ || ($ = {}));