@nebularstreams/libmui 2.5.72 → 2.5.74

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.72",
4
+ "version": "2.5.74",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
7
7
  "scripts": {
@@ -1,8 +1,8 @@
1
1
  import {ConfirmPromise} from "./widgets.core";
2
2
 
3
3
  function confirm(text, onAction, onCancel = undefined, optionYes = "YES", optionNo = "NO") {
4
- ConfirmPromise(null, text, [optionNo, optionYes], onCancel)
5
- .then(({idx}) => {
4
+ confirmPromise(text, [optionNo, optionYes], onCancel)
5
+ .then((idx) => {
6
6
  if (idx) onAction(idx); else if (onCancel) onCancel();
7
7
  })
8
8
  .catch(() => {
@@ -1,7 +1,7 @@
1
1
  import m from 'mithril';
2
2
  import {defineWidget, ButtonNew} from "./Basic.js"
3
3
  import {promptName} from "./OverflowUtils"
4
- import {confirmPromise} from "../util/fuckingconfirm"
4
+ import {confirmPromise} from "../util/fuckingconfirm.js"
5
5
 
6
6
  const
7
7
  ThematicWrapper = defineWidget(
@@ -21,12 +21,11 @@ const
21
21
 
22
22
  confirmPromise(
23
23
  "Choose an action for this preset",
24
-
25
24
  onAdd && allowUpdate
26
25
  ? ["DELETE", "RENAME", "UPDATE", "CANCEL"]
27
26
  : ["DELETE", "RENAME", "CANCEL"]
28
27
  )
29
- .then(({idx}) => {
28
+ .then((idx) => {
30
29
 
31
30
  if (idx === 0) {
32
31
  items.splice(index, 1);
@@ -105,7 +104,7 @@ const
105
104
  tabIndex: -1,
106
105
  icon: attrs.icon || "plus",
107
106
  title: attrs.addTitle || "Add a new item",
108
- class: "pad-2 pad-h al-center unitheightsmall transp addbut scaff-left bg-window-lo grows",
107
+ class: "pad-2 pad-h al-center unitheightsmall transp addbut scaff-left bg-window-lo grows" + (items.length ? " some" : " empty"),
109
108
  onClick: (e) => onAdd(e.ctrlKey || e.metaKey),
110
109
  text: items?.length ? "" : addText
111
110
  })