@nebularstreams/libmui 2.5.77 → 2.5.79

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@nebularstreams/libmui",
3
3
  "description": "Micro UI based on Mithril",
4
- "version": "2.5.77",
4
+ "version": "2.5.79",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
7
7
  "scripts": {
package/src/index.js CHANGED
@@ -28,6 +28,7 @@ import EmptyButton from "./widgets/EmptyButton";
28
28
  import CoolerEmpty from "./widgets/CoolerEmpty";
29
29
  import tainter from "./util/tainter"
30
30
  import {ConfirmPromise} from "./util/widgets.core.js"
31
+ import {makeLocalUrl, makeLocalPath} from "./util/filepath.js"
31
32
 
32
33
  import MainState, {implement as MainStateImplement} from "./app/MainState";
33
34
 
@@ -96,18 +97,20 @@ export {
96
97
  optionsPrompt,
97
98
  Tokenizer,
98
99
 
100
+ MainState,
101
+ MainStateImplement,
102
+
103
+ // micro utils
99
104
  clearModal,
100
105
  clone,
101
106
  confirm,
102
107
  confirmPromise,
103
108
  ConfirmPromise,
104
109
  defineWidget,
110
+ makeLocalPath,
111
+ makeLocalUrl,
105
112
  processImage,
106
113
  popupMessage,
107
114
  startApp,
108
- tainter,
109
-
110
- MainState,
111
- MainStateImplement
112
-
115
+ tainter
113
116
  }
@@ -0,0 +1,10 @@
1
+ const
2
+ AGENT = "Windows NT",
3
+ isWindows = () => navigator.userAgent.indexOf(AGENT) !== -1,
4
+ SEPARATOR_WINDOWS = "\\",
5
+ SEPARATOR_LINUX = "/",
6
+ SEPARATOR = isWindows() ? SEPARATOR_WINDOWS : SEPARATOR_LINUX,
7
+ makeLocalPath = (pathArray) => pathArray.join(SEPARATOR),
8
+ makeLocalUrl = (base, pathArray) => ["file://", ...base.split(SEPARATOR_WINDOWS), ...pathArray].join(SEPARATOR_LINUX);
9
+
10
+ export {makeLocalPath, makeLocalUrl}
@@ -85,7 +85,7 @@ const
85
85
  optionsPrompt(items, index, onAdd, onDelete, undefined, !noUpdate);
86
86
  }
87
87
  } else {
88
- onSelect(item, index, e.metaKey, e.shiftKey);
88
+ onSelect && onSelect(item, index, e.metaKey, e.shiftKey);
89
89
  }
90
90
  }
91
91
  },
@@ -254,7 +254,7 @@ const
254
254
  : whenner.not
255
255
  ? !targetParameters[whenner.key]
256
256
  : !!targetParameters[whenner]
257
- : false;
257
+ : !!targetParameters[whenner.key];
258
258
 
259
259
  },
260
260
 
@@ -288,7 +288,8 @@ const
288
288
  ? targetSource[metaDef.target || targetSource.forTarget]
289
289
  : targetSource;
290
290
 
291
- if ((whenner && !checkWhen(whenner, parameters, auxParameters, targetSource))) {
291
+ // targetSource estaba antes, targetParameters incluye TARGET !!!!
292
+ if ((whenner && !checkWhen(whenner, parameters, auxParameters, targetParameters))) {
292
293
  return [];
293
294
  }
294
295