@nebularstreams/libmui 2.5.48 → 2.5.50
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/dist/libui.esm.js +1 -1
- package/dist/libui.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/index.js +2 -4
- package/src/widgets/CoolContentTicker.js +0 -2
- package/src/widgets/CoolerEmpty.js +37 -0
- package/src/widgets/SelectFileMiniButton.js +0 -25
- package/src/widgets/TemplatedInputWidget.js +9 -4
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -25,12 +25,12 @@ import clone from "./util/util.clone"
|
|
|
25
25
|
import Tokenizer from "./util/util.tokenizer"
|
|
26
26
|
import {CoolContentTicker, CoolGenericTicker, GenericButtonTicker, optionsPrompt} from "./widgets/CoolContentTicker";
|
|
27
27
|
import EmptyButton from "./widgets/EmptyButton";
|
|
28
|
+
import CoolerEmpty from "./widgets/CoolerEmpty";
|
|
28
29
|
import tainter from "./util/tainter"
|
|
29
30
|
|
|
30
31
|
import MainState, {implement} from "./app/MainState";
|
|
31
32
|
|
|
32
33
|
import {
|
|
33
|
-
VideoUploadButton,
|
|
34
34
|
FileSelectButton,
|
|
35
35
|
ImageDataButton,
|
|
36
36
|
ImageSelectButton,
|
|
@@ -45,8 +45,6 @@ import {
|
|
|
45
45
|
|
|
46
46
|
import "./style.js"
|
|
47
47
|
|
|
48
|
-
const MainStateImplement = implement;
|
|
49
|
-
|
|
50
48
|
export {
|
|
51
49
|
Button,
|
|
52
50
|
ButtonChoiceWidget,
|
|
@@ -56,6 +54,7 @@ export {
|
|
|
56
54
|
ColorJoePack,
|
|
57
55
|
ComboPrompt,
|
|
58
56
|
ComboWidget,
|
|
57
|
+
CoolerEmpty,
|
|
59
58
|
Empty,
|
|
60
59
|
EmptyButton,
|
|
61
60
|
Icon,
|
|
@@ -80,7 +79,6 @@ export {
|
|
|
80
79
|
ImageSelectButton,
|
|
81
80
|
ImageProcessButton,
|
|
82
81
|
MediaSelectButton,
|
|
83
|
-
VideoUploadButton,
|
|
84
82
|
|
|
85
83
|
// TemplatedInputWidhet
|
|
86
84
|
TemplatedInputWidget,
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import m from "mithril"
|
|
2
|
+
import {defineWidget, ButtonNew, Empty} from "./Basic.js"
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
function TRANSLATE(message, arr, def) {
|
|
6
|
+
return arr ? arr[message] || (def || message) : (def || message);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const
|
|
10
|
+
CoolerEmpty = {
|
|
11
|
+
oninit: ({attrs}) => {
|
|
12
|
+
attrs.oninit && attrs.oninit()
|
|
13
|
+
},
|
|
14
|
+
view: ({attrs}) => m(Empty, {
|
|
15
|
+
class: attrs.class,
|
|
16
|
+
icon: attrs.icon,
|
|
17
|
+
size: attrs.size || 4
|
|
18
|
+
}, [
|
|
19
|
+
...attrs.header ? [m("h3.pad-2.marg-0", TRANSLATE(attrs.header, attrs.headers))] : [],
|
|
20
|
+
m(".pad-2", TRANSLATE(attrs.message, attrs.messages)),
|
|
21
|
+
...attrs.action ? [
|
|
22
|
+
m(ButtonNew, {
|
|
23
|
+
text: attrs.action.caption,
|
|
24
|
+
class: "accentbutton marg-4 marg-v pad-2 font-150",
|
|
25
|
+
onClick: attrs.action.onclick
|
|
26
|
+
})
|
|
27
|
+
] : [],
|
|
28
|
+
...attrs.actions
|
|
29
|
+
? attrs.actions.map((action) => m(ButtonNew, {
|
|
30
|
+
text: action.caption,
|
|
31
|
+
class: "accentbutton marg-4 marg-v pad-2 font-150",
|
|
32
|
+
onClick: action.onclick
|
|
33
|
+
}))
|
|
34
|
+
: []
|
|
35
|
+
])
|
|
36
|
+
};
|
|
37
|
+
export default CoolerEmpty;
|
|
@@ -120,30 +120,6 @@ const
|
|
|
120
120
|
})
|
|
121
121
|
),
|
|
122
122
|
|
|
123
|
-
VideoUploadButton = defineWidget(
|
|
124
|
-
({attrs}) => m(FileSelectButton, {
|
|
125
|
-
class: attrs.class,
|
|
126
|
-
accept: attrs.accept || ".mp4,.webm",
|
|
127
|
-
icon: attrs.icon || "video",
|
|
128
|
-
iconClass: attrs.iconClass,
|
|
129
|
-
textClass: attrs.textClass,
|
|
130
|
-
text: attrs.text,
|
|
131
|
-
|
|
132
|
-
onFile: (file) => {
|
|
133
|
-
if (file) {
|
|
134
|
-
attrs.entity.saveBlob(file.name, file, "video", undefined, false)
|
|
135
|
-
.then(() => {
|
|
136
|
-
if (attrs.onVideo) {
|
|
137
|
-
attrs.onVideo(attrs.path);
|
|
138
|
-
} else {
|
|
139
|
-
m.redraw();
|
|
140
|
-
}
|
|
141
|
-
})
|
|
142
|
-
.catch((e) => Notification.add(e.message));
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
})
|
|
146
|
-
),
|
|
147
123
|
|
|
148
124
|
ImageProcessButton = defineWidget(
|
|
149
125
|
({attrs}) => m(ImageSelectButton, {
|
|
@@ -185,7 +161,6 @@ const
|
|
|
185
161
|
);
|
|
186
162
|
|
|
187
163
|
export {
|
|
188
|
-
VideoUploadButton,
|
|
189
164
|
FileSelectButton,
|
|
190
165
|
ImageDataButton,
|
|
191
166
|
ImageSelectButton,
|
|
@@ -437,9 +437,13 @@ const
|
|
|
437
437
|
})
|
|
438
438
|
]
|
|
439
439
|
: isText
|
|
440
|
-
?
|
|
441
|
-
|
|
442
|
-
|
|
440
|
+
? metaDef.icon
|
|
441
|
+
? [
|
|
442
|
+
m(Icon, {icon: metaDef.icon, class: metaDef.iconClass}),
|
|
443
|
+
m(".innertext", {class: metaDef.class, title: metaDef.hint}, rawValue)
|
|
444
|
+
] : [
|
|
445
|
+
m(".innertext", {class: metaDef.class, title: metaDef.hint}, rawValue)
|
|
446
|
+
]
|
|
443
447
|
: isWidget
|
|
444
448
|
? [
|
|
445
449
|
m(
|
|
@@ -927,7 +931,7 @@ const
|
|
|
927
931
|
{
|
|
928
932
|
busy, parameters, auxParameters, cardid, size, index,
|
|
929
933
|
titleWidget, parametersTitle, parametersBody, rootUpdate, global, layer,
|
|
930
|
-
tableChildren, cols, onLayerReset, onAction, nofold, bodyClass,
|
|
934
|
+
tableChildren, cols, onLayerReset, onAction, nofold, bodyClass, titleAction,
|
|
931
935
|
AssetButton
|
|
932
936
|
} = attrs;
|
|
933
937
|
|
|
@@ -958,6 +962,7 @@ const
|
|
|
958
962
|
clone: true,
|
|
959
963
|
global, layer,
|
|
960
964
|
AssetButton,
|
|
965
|
+
action: titleAction,
|
|
961
966
|
onAction,
|
|
962
967
|
onchange: (realtime, targetParameters, metaKey, wasDeleted, metaDef) => {
|
|
963
968
|
|