@vicinae/api 0.6.2 → 0.7.0
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/README.md +1 -1
- package/bin/run.js +2 -2
- package/dist/api/ai.js +11 -10
- package/dist/api/alert.d.ts +1 -1
- package/dist/api/alert.js +4 -5
- package/dist/api/bus.d.ts +27 -27
- package/dist/api/bus.js +15 -15
- package/dist/api/cache.js +15 -6
- package/dist/api/clipboard.d.ts +2 -2
- package/dist/api/clipboard.js +14 -15
- package/dist/api/color.js +1 -3
- package/dist/api/components/action-pannel.js +2 -2
- package/dist/api/components/actions.d.ts +3 -3
- package/dist/api/components/actions.js +16 -16
- package/dist/api/components/detail.d.ts +1 -1
- package/dist/api/components/detail.js +1 -1
- package/dist/api/components/dropdown.js +3 -3
- package/dist/api/components/empty-view.d.ts +2 -2
- package/dist/api/components/empty-view.js +1 -1
- package/dist/api/components/form.d.ts +2 -2
- package/dist/api/components/form.js +4 -12
- package/dist/api/components/grid.d.ts +4 -4
- package/dist/api/components/grid.js +10 -10
- package/dist/api/components/index.d.ts +7 -7
- package/dist/api/components/list.d.ts +3 -3
- package/dist/api/components/list.js +6 -6
- package/dist/api/components/menu-bar.js +1 -1
- package/dist/api/components/metadata.d.ts +2 -2
- package/dist/api/components/metadata.js +1 -1
- package/dist/api/components/tag.d.ts +3 -3
- package/dist/api/components/tag.js +4 -3
- package/dist/api/context/index.d.ts +1 -1
- package/dist/api/context/navigation-context.js +6 -2
- package/dist/api/context/navigation-provider.d.ts +1 -1
- package/dist/api/context/navigation-provider.js +5 -5
- package/dist/api/controls.js +3 -3
- package/dist/api/environment.js +0 -2
- package/dist/api/hooks/index.d.ts +2 -2
- package/dist/api/hooks/use-imperative-form-handle.d.ts +2 -2
- package/dist/api/hooks/use-imperative-form-handle.js +3 -3
- package/dist/api/hooks.js +4 -2
- package/dist/api/image.d.ts +1 -1
- package/dist/api/image.js +5 -5
- package/dist/api/index.d.ts +19 -19
- package/dist/api/keyboard.js +4 -5
- package/dist/api/local-storage.js +5 -7
- package/dist/api/oauth.d.ts +1 -1
- package/dist/api/oauth.js +23 -20
- package/dist/api/preference.js +2 -2
- package/dist/api/proto/application.js +28 -13
- package/dist/api/proto/clipboard.js +70 -37
- package/dist/api/proto/common.js +5 -1
- package/dist/api/proto/extension.js +104 -49
- package/dist/api/proto/google/protobuf/struct.js +25 -8
- package/dist/api/proto/ipc.js +99 -52
- package/dist/api/proto/manager.js +56 -22
- package/dist/api/proto/oauth.js +32 -14
- package/dist/api/proto/storage.js +66 -28
- package/dist/api/proto/ui.js +233 -124
- package/dist/api/toast.js +46 -21
- package/dist/api/utils.d.ts +1 -1
- package/dist/api/utils.js +16 -12
- package/dist/commands/build/index.js +18 -2
- package/dist/commands/develop/index.js +18 -3
- package/dist/index.d.ts +1 -1
- package/dist/schemas/manifest.js +225 -1
- package/package.json +1 -1
package/dist/api/proto/ui.js
CHANGED
|
@@ -723,8 +723,12 @@ exports.ShowHudRequest = {
|
|
|
723
723
|
fromJSON(object) {
|
|
724
724
|
return {
|
|
725
725
|
text: isSet(object.text) ? globalThis.String(object.text) : "",
|
|
726
|
-
clearRootSearch: isSet(object.clearRootSearch)
|
|
727
|
-
|
|
726
|
+
clearRootSearch: isSet(object.clearRootSearch)
|
|
727
|
+
? globalThis.Boolean(object.clearRootSearch)
|
|
728
|
+
: false,
|
|
729
|
+
popToRoot: isSet(object.popToRoot)
|
|
730
|
+
? popToRootTypeFromJSON(object.popToRoot)
|
|
731
|
+
: 0,
|
|
728
732
|
};
|
|
729
733
|
},
|
|
730
734
|
toJSON(message) {
|
|
@@ -905,11 +909,19 @@ exports.ConfirmAlertRequest = {
|
|
|
905
909
|
fromJSON(object) {
|
|
906
910
|
return {
|
|
907
911
|
title: isSet(object.title) ? globalThis.String(object.title) : "",
|
|
908
|
-
description: isSet(object.description)
|
|
912
|
+
description: isSet(object.description)
|
|
913
|
+
? globalThis.String(object.description)
|
|
914
|
+
: "",
|
|
909
915
|
icon: isSet(object.icon) ? globalThis.String(object.icon) : undefined,
|
|
910
|
-
dismissAction: isSet(object.dismissAction)
|
|
911
|
-
|
|
912
|
-
|
|
916
|
+
dismissAction: isSet(object.dismissAction)
|
|
917
|
+
? exports.ConfirmAlertAction.fromJSON(object.dismissAction)
|
|
918
|
+
: undefined,
|
|
919
|
+
primaryAction: isSet(object.primaryAction)
|
|
920
|
+
? exports.ConfirmAlertAction.fromJSON(object.primaryAction)
|
|
921
|
+
: undefined,
|
|
922
|
+
rememberUserChoice: isSet(object.rememberUserChoice)
|
|
923
|
+
? globalThis.Boolean(object.rememberUserChoice)
|
|
924
|
+
: false,
|
|
913
925
|
handle: isSet(object.handle) ? globalThis.String(object.handle) : "",
|
|
914
926
|
};
|
|
915
927
|
},
|
|
@@ -946,12 +958,14 @@ exports.ConfirmAlertRequest = {
|
|
|
946
958
|
message.title = object.title ?? "";
|
|
947
959
|
message.description = object.description ?? "";
|
|
948
960
|
message.icon = object.icon ?? undefined;
|
|
949
|
-
message.dismissAction =
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
961
|
+
message.dismissAction =
|
|
962
|
+
object.dismissAction !== undefined && object.dismissAction !== null
|
|
963
|
+
? exports.ConfirmAlertAction.fromPartial(object.dismissAction)
|
|
964
|
+
: undefined;
|
|
965
|
+
message.primaryAction =
|
|
966
|
+
object.primaryAction !== undefined && object.primaryAction !== null
|
|
967
|
+
? exports.ConfirmAlertAction.fromPartial(object.primaryAction)
|
|
968
|
+
: undefined;
|
|
955
969
|
message.rememberUserChoice = object.rememberUserChoice ?? false;
|
|
956
970
|
message.handle = object.handle ?? "";
|
|
957
971
|
return message;
|
|
@@ -1002,7 +1016,9 @@ exports.ConfirmAlertAction = {
|
|
|
1002
1016
|
fromJSON(object) {
|
|
1003
1017
|
return {
|
|
1004
1018
|
title: isSet(object.title) ? globalThis.String(object.title) : "",
|
|
1005
|
-
style: isSet(object.style)
|
|
1019
|
+
style: isSet(object.style)
|
|
1020
|
+
? confirmAlertActionStyleFromJSON(object.style)
|
|
1021
|
+
: 0,
|
|
1006
1022
|
};
|
|
1007
1023
|
},
|
|
1008
1024
|
toJSON(message) {
|
|
@@ -1182,19 +1198,39 @@ exports.Request = {
|
|
|
1182
1198
|
},
|
|
1183
1199
|
fromJSON(object) {
|
|
1184
1200
|
return {
|
|
1185
|
-
render: isSet(object.render)
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1201
|
+
render: isSet(object.render)
|
|
1202
|
+
? exports.RenderRequest.fromJSON(object.render)
|
|
1203
|
+
: undefined,
|
|
1204
|
+
showToast: isSet(object.showToast)
|
|
1205
|
+
? exports.ShowToastRequest.fromJSON(object.showToast)
|
|
1206
|
+
: undefined,
|
|
1207
|
+
hideToast: isSet(object.hideToast)
|
|
1208
|
+
? exports.HideToastRequest.fromJSON(object.hideToast)
|
|
1209
|
+
: undefined,
|
|
1210
|
+
updateToast: isSet(object.updateToast)
|
|
1211
|
+
? exports.UpdateToastRequest.fromJSON(object.updateToast)
|
|
1212
|
+
: undefined,
|
|
1213
|
+
pushView: isSet(object.pushView)
|
|
1214
|
+
? exports.PushViewRequest.fromJSON(object.pushView)
|
|
1215
|
+
: undefined,
|
|
1216
|
+
popView: isSet(object.popView)
|
|
1217
|
+
? exports.PopViewRequest.fromJSON(object.popView)
|
|
1218
|
+
: undefined,
|
|
1219
|
+
clearSearch: isSet(object.clearSearch)
|
|
1220
|
+
? exports.ClearSearchBarRequest.fromJSON(object.clearSearch)
|
|
1221
|
+
: undefined,
|
|
1192
1222
|
closeMainWindow: isSet(object.closeMainWindow)
|
|
1193
1223
|
? exports.CloseMainWindowRequest.fromJSON(object.closeMainWindow)
|
|
1194
1224
|
: undefined,
|
|
1195
|
-
showHud: isSet(object.showHud)
|
|
1196
|
-
|
|
1197
|
-
|
|
1225
|
+
showHud: isSet(object.showHud)
|
|
1226
|
+
? exports.ShowHudRequest.fromJSON(object.showHud)
|
|
1227
|
+
: undefined,
|
|
1228
|
+
setSearchText: isSet(object.setSearchText)
|
|
1229
|
+
? exports.SetSearchTextRequest.fromJSON(object.setSearchText)
|
|
1230
|
+
: undefined,
|
|
1231
|
+
confirmAlert: isSet(object.confirmAlert)
|
|
1232
|
+
? exports.ConfirmAlertRequest.fromJSON(object.confirmAlert)
|
|
1233
|
+
: undefined,
|
|
1198
1234
|
getSelectedText: isSet(object.getSelectedText)
|
|
1199
1235
|
? exports.GetSelectedTextRequest.fromJSON(object.getSelectedText)
|
|
1200
1236
|
: undefined,
|
|
@@ -1245,42 +1281,54 @@ exports.Request = {
|
|
|
1245
1281
|
},
|
|
1246
1282
|
fromPartial(object) {
|
|
1247
1283
|
const message = createBaseRequest();
|
|
1248
|
-
message.render =
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
message.
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
message.
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
+
message.render =
|
|
1285
|
+
object.render !== undefined && object.render !== null
|
|
1286
|
+
? exports.RenderRequest.fromPartial(object.render)
|
|
1287
|
+
: undefined;
|
|
1288
|
+
message.showToast =
|
|
1289
|
+
object.showToast !== undefined && object.showToast !== null
|
|
1290
|
+
? exports.ShowToastRequest.fromPartial(object.showToast)
|
|
1291
|
+
: undefined;
|
|
1292
|
+
message.hideToast =
|
|
1293
|
+
object.hideToast !== undefined && object.hideToast !== null
|
|
1294
|
+
? exports.HideToastRequest.fromPartial(object.hideToast)
|
|
1295
|
+
: undefined;
|
|
1296
|
+
message.updateToast =
|
|
1297
|
+
object.updateToast !== undefined && object.updateToast !== null
|
|
1298
|
+
? exports.UpdateToastRequest.fromPartial(object.updateToast)
|
|
1299
|
+
: undefined;
|
|
1300
|
+
message.pushView =
|
|
1301
|
+
object.pushView !== undefined && object.pushView !== null
|
|
1302
|
+
? exports.PushViewRequest.fromPartial(object.pushView)
|
|
1303
|
+
: undefined;
|
|
1304
|
+
message.popView =
|
|
1305
|
+
object.popView !== undefined && object.popView !== null
|
|
1306
|
+
? exports.PopViewRequest.fromPartial(object.popView)
|
|
1307
|
+
: undefined;
|
|
1308
|
+
message.clearSearch =
|
|
1309
|
+
object.clearSearch !== undefined && object.clearSearch !== null
|
|
1310
|
+
? exports.ClearSearchBarRequest.fromPartial(object.clearSearch)
|
|
1311
|
+
: undefined;
|
|
1312
|
+
message.closeMainWindow =
|
|
1313
|
+
object.closeMainWindow !== undefined && object.closeMainWindow !== null
|
|
1314
|
+
? exports.CloseMainWindowRequest.fromPartial(object.closeMainWindow)
|
|
1315
|
+
: undefined;
|
|
1316
|
+
message.showHud =
|
|
1317
|
+
object.showHud !== undefined && object.showHud !== null
|
|
1318
|
+
? exports.ShowHudRequest.fromPartial(object.showHud)
|
|
1319
|
+
: undefined;
|
|
1320
|
+
message.setSearchText =
|
|
1321
|
+
object.setSearchText !== undefined && object.setSearchText !== null
|
|
1322
|
+
? exports.SetSearchTextRequest.fromPartial(object.setSearchText)
|
|
1323
|
+
: undefined;
|
|
1324
|
+
message.confirmAlert =
|
|
1325
|
+
object.confirmAlert !== undefined && object.confirmAlert !== null
|
|
1326
|
+
? exports.ConfirmAlertRequest.fromPartial(object.confirmAlert)
|
|
1327
|
+
: undefined;
|
|
1328
|
+
message.getSelectedText =
|
|
1329
|
+
object.getSelectedText !== undefined && object.getSelectedText !== null
|
|
1330
|
+
? exports.GetSelectedTextRequest.fromPartial(object.getSelectedText)
|
|
1331
|
+
: undefined;
|
|
1284
1332
|
return message;
|
|
1285
1333
|
},
|
|
1286
1334
|
};
|
|
@@ -1441,17 +1489,39 @@ exports.Response = {
|
|
|
1441
1489
|
},
|
|
1442
1490
|
fromJSON(object) {
|
|
1443
1491
|
return {
|
|
1444
|
-
render: isSet(object.render)
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1492
|
+
render: isSet(object.render)
|
|
1493
|
+
? common_1.AckResponse.fromJSON(object.render)
|
|
1494
|
+
: undefined,
|
|
1495
|
+
showToast: isSet(object.showToast)
|
|
1496
|
+
? common_1.AckResponse.fromJSON(object.showToast)
|
|
1497
|
+
: undefined,
|
|
1498
|
+
hideToast: isSet(object.hideToast)
|
|
1499
|
+
? common_1.AckResponse.fromJSON(object.hideToast)
|
|
1500
|
+
: undefined,
|
|
1501
|
+
updateToast: isSet(object.updateToast)
|
|
1502
|
+
? common_1.AckResponse.fromJSON(object.updateToast)
|
|
1503
|
+
: undefined,
|
|
1504
|
+
pushView: isSet(object.pushView)
|
|
1505
|
+
? common_1.AckResponse.fromJSON(object.pushView)
|
|
1506
|
+
: undefined,
|
|
1507
|
+
popView: isSet(object.popView)
|
|
1508
|
+
? common_1.AckResponse.fromJSON(object.popView)
|
|
1509
|
+
: undefined,
|
|
1510
|
+
clearSearch: isSet(object.clearSearch)
|
|
1511
|
+
? common_1.AckResponse.fromJSON(object.clearSearch)
|
|
1512
|
+
: undefined,
|
|
1513
|
+
closeMainWindow: isSet(object.closeMainWindow)
|
|
1514
|
+
? common_1.AckResponse.fromJSON(object.closeMainWindow)
|
|
1515
|
+
: undefined,
|
|
1516
|
+
showHud: isSet(object.showHud)
|
|
1517
|
+
? common_1.AckResponse.fromJSON(object.showHud)
|
|
1518
|
+
: undefined,
|
|
1519
|
+
setSearchText: isSet(object.setSearchText)
|
|
1520
|
+
? common_1.AckResponse.fromJSON(object.setSearchText)
|
|
1521
|
+
: undefined,
|
|
1522
|
+
confirmAlert: isSet(object.confirmAlert)
|
|
1523
|
+
? common_1.AckResponse.fromJSON(object.confirmAlert)
|
|
1524
|
+
: undefined,
|
|
1455
1525
|
getSelectedText: isSet(object.getSelectedText)
|
|
1456
1526
|
? exports.GetSelectedTextResponse.fromJSON(object.getSelectedText)
|
|
1457
1527
|
: undefined,
|
|
@@ -1502,47 +1572,65 @@ exports.Response = {
|
|
|
1502
1572
|
},
|
|
1503
1573
|
fromPartial(object) {
|
|
1504
1574
|
const message = createBaseResponse();
|
|
1505
|
-
message.render =
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
message.
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
message.
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1575
|
+
message.render =
|
|
1576
|
+
object.render !== undefined && object.render !== null
|
|
1577
|
+
? common_1.AckResponse.fromPartial(object.render)
|
|
1578
|
+
: undefined;
|
|
1579
|
+
message.showToast =
|
|
1580
|
+
object.showToast !== undefined && object.showToast !== null
|
|
1581
|
+
? common_1.AckResponse.fromPartial(object.showToast)
|
|
1582
|
+
: undefined;
|
|
1583
|
+
message.hideToast =
|
|
1584
|
+
object.hideToast !== undefined && object.hideToast !== null
|
|
1585
|
+
? common_1.AckResponse.fromPartial(object.hideToast)
|
|
1586
|
+
: undefined;
|
|
1587
|
+
message.updateToast =
|
|
1588
|
+
object.updateToast !== undefined && object.updateToast !== null
|
|
1589
|
+
? common_1.AckResponse.fromPartial(object.updateToast)
|
|
1590
|
+
: undefined;
|
|
1591
|
+
message.pushView =
|
|
1592
|
+
object.pushView !== undefined && object.pushView !== null
|
|
1593
|
+
? common_1.AckResponse.fromPartial(object.pushView)
|
|
1594
|
+
: undefined;
|
|
1595
|
+
message.popView =
|
|
1596
|
+
object.popView !== undefined && object.popView !== null
|
|
1597
|
+
? common_1.AckResponse.fromPartial(object.popView)
|
|
1598
|
+
: undefined;
|
|
1599
|
+
message.clearSearch =
|
|
1600
|
+
object.clearSearch !== undefined && object.clearSearch !== null
|
|
1601
|
+
? common_1.AckResponse.fromPartial(object.clearSearch)
|
|
1602
|
+
: undefined;
|
|
1603
|
+
message.closeMainWindow =
|
|
1604
|
+
object.closeMainWindow !== undefined && object.closeMainWindow !== null
|
|
1605
|
+
? common_1.AckResponse.fromPartial(object.closeMainWindow)
|
|
1606
|
+
: undefined;
|
|
1607
|
+
message.showHud =
|
|
1608
|
+
object.showHud !== undefined && object.showHud !== null
|
|
1609
|
+
? common_1.AckResponse.fromPartial(object.showHud)
|
|
1610
|
+
: undefined;
|
|
1611
|
+
message.setSearchText =
|
|
1612
|
+
object.setSearchText !== undefined && object.setSearchText !== null
|
|
1613
|
+
? common_1.AckResponse.fromPartial(object.setSearchText)
|
|
1614
|
+
: undefined;
|
|
1615
|
+
message.confirmAlert =
|
|
1616
|
+
object.confirmAlert !== undefined && object.confirmAlert !== null
|
|
1617
|
+
? common_1.AckResponse.fromPartial(object.confirmAlert)
|
|
1618
|
+
: undefined;
|
|
1619
|
+
message.getSelectedText =
|
|
1620
|
+
object.getSelectedText !== undefined && object.getSelectedText !== null
|
|
1621
|
+
? exports.GetSelectedTextResponse.fromPartial(object.getSelectedText)
|
|
1622
|
+
: undefined;
|
|
1541
1623
|
return message;
|
|
1542
1624
|
},
|
|
1543
1625
|
};
|
|
1544
1626
|
function createBaseRenderNode() {
|
|
1545
|
-
return {
|
|
1627
|
+
return {
|
|
1628
|
+
type: "",
|
|
1629
|
+
hasDirtyChild: false,
|
|
1630
|
+
hasDirtyProps: false,
|
|
1631
|
+
props: {},
|
|
1632
|
+
children: [],
|
|
1633
|
+
};
|
|
1546
1634
|
}
|
|
1547
1635
|
exports.RenderNode = {
|
|
1548
1636
|
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
@@ -1621,8 +1709,12 @@ exports.RenderNode = {
|
|
|
1621
1709
|
fromJSON(object) {
|
|
1622
1710
|
return {
|
|
1623
1711
|
type: isSet(object.type) ? globalThis.String(object.type) : "",
|
|
1624
|
-
hasDirtyChild: isSet(object.hasDirtyChild)
|
|
1625
|
-
|
|
1712
|
+
hasDirtyChild: isSet(object.hasDirtyChild)
|
|
1713
|
+
? globalThis.Boolean(object.hasDirtyChild)
|
|
1714
|
+
: false,
|
|
1715
|
+
hasDirtyProps: isSet(object.hasDirtyProps)
|
|
1716
|
+
? globalThis.Boolean(object.hasDirtyProps)
|
|
1717
|
+
: false,
|
|
1626
1718
|
props: isObject(object.props)
|
|
1627
1719
|
? Object.entries(object.props).reduce((acc, [key, value]) => {
|
|
1628
1720
|
acc[key] = value;
|
|
@@ -1673,7 +1765,8 @@ exports.RenderNode = {
|
|
|
1673
1765
|
}
|
|
1674
1766
|
return acc;
|
|
1675
1767
|
}, {});
|
|
1676
|
-
message.children =
|
|
1768
|
+
message.children =
|
|
1769
|
+
object.children?.map((e) => exports.RenderNode.fromPartial(e)) || [];
|
|
1677
1770
|
return message;
|
|
1678
1771
|
},
|
|
1679
1772
|
};
|
|
@@ -1858,7 +1951,9 @@ exports.ImageSource = {
|
|
|
1858
1951
|
fromJSON(object) {
|
|
1859
1952
|
return {
|
|
1860
1953
|
raw: isSet(object.raw) ? globalThis.String(object.raw) : undefined,
|
|
1861
|
-
themed: isSet(object.themed)
|
|
1954
|
+
themed: isSet(object.themed)
|
|
1955
|
+
? exports.ThemedImageSource.fromJSON(object.themed)
|
|
1956
|
+
: undefined,
|
|
1862
1957
|
};
|
|
1863
1958
|
},
|
|
1864
1959
|
toJSON(message) {
|
|
@@ -1877,14 +1972,20 @@ exports.ImageSource = {
|
|
|
1877
1972
|
fromPartial(object) {
|
|
1878
1973
|
const message = createBaseImageSource();
|
|
1879
1974
|
message.raw = object.raw ?? undefined;
|
|
1880
|
-
message.themed =
|
|
1881
|
-
|
|
1882
|
-
|
|
1975
|
+
message.themed =
|
|
1976
|
+
object.themed !== undefined && object.themed !== null
|
|
1977
|
+
? exports.ThemedImageSource.fromPartial(object.themed)
|
|
1978
|
+
: undefined;
|
|
1883
1979
|
return message;
|
|
1884
1980
|
},
|
|
1885
1981
|
};
|
|
1886
1982
|
function createBaseImage() {
|
|
1887
|
-
return {
|
|
1983
|
+
return {
|
|
1984
|
+
source: undefined,
|
|
1985
|
+
fallback: undefined,
|
|
1986
|
+
mask: undefined,
|
|
1987
|
+
colorTint: undefined,
|
|
1988
|
+
};
|
|
1888
1989
|
}
|
|
1889
1990
|
exports.Image = {
|
|
1890
1991
|
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
@@ -1947,10 +2048,16 @@ exports.Image = {
|
|
|
1947
2048
|
},
|
|
1948
2049
|
fromJSON(object) {
|
|
1949
2050
|
return {
|
|
1950
|
-
source: isSet(object.source)
|
|
1951
|
-
|
|
2051
|
+
source: isSet(object.source)
|
|
2052
|
+
? exports.ImageSource.fromJSON(object.source)
|
|
2053
|
+
: undefined,
|
|
2054
|
+
fallback: isSet(object.fallback)
|
|
2055
|
+
? exports.ImageSource.fromJSON(object.fallback)
|
|
2056
|
+
: undefined,
|
|
1952
2057
|
mask: isSet(object.mask) ? imageMaskFromJSON(object.mask) : undefined,
|
|
1953
|
-
colorTint: isSet(object.colorTint)
|
|
2058
|
+
colorTint: isSet(object.colorTint)
|
|
2059
|
+
? globalThis.String(object.colorTint)
|
|
2060
|
+
: undefined,
|
|
1954
2061
|
};
|
|
1955
2062
|
},
|
|
1956
2063
|
toJSON(message) {
|
|
@@ -1974,12 +2081,14 @@ exports.Image = {
|
|
|
1974
2081
|
},
|
|
1975
2082
|
fromPartial(object) {
|
|
1976
2083
|
const message = createBaseImage();
|
|
1977
|
-
message.source =
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
2084
|
+
message.source =
|
|
2085
|
+
object.source !== undefined && object.source !== null
|
|
2086
|
+
? exports.ImageSource.fromPartial(object.source)
|
|
2087
|
+
: undefined;
|
|
2088
|
+
message.fallback =
|
|
2089
|
+
object.fallback !== undefined && object.fallback !== null
|
|
2090
|
+
? exports.ImageSource.fromPartial(object.fallback)
|
|
2091
|
+
: undefined;
|
|
1983
2092
|
message.mask = object.mask ?? undefined;
|
|
1984
2093
|
message.colorTint = object.colorTint ?? undefined;
|
|
1985
2094
|
return message;
|
package/dist/api/toast.js
CHANGED
|
@@ -29,17 +29,17 @@ class Toast {
|
|
|
29
29
|
styleMap = {
|
|
30
30
|
[Toast.Style.Success]: ui_1.ToastStyle.Success,
|
|
31
31
|
[Toast.Style.Failure]: ui_1.ToastStyle.Error,
|
|
32
|
-
[Toast.Style.Animated]: ui_1.ToastStyle.Dynamic
|
|
32
|
+
[Toast.Style.Animated]: ui_1.ToastStyle.Dynamic,
|
|
33
33
|
};
|
|
34
34
|
/**
|
|
35
35
|
* Deprecated - Use `showToast` instead
|
|
36
36
|
*/
|
|
37
37
|
constructor(props) {
|
|
38
|
-
this.id = `toast_${(0, crypto_1.randomBytes)(16).toString(
|
|
38
|
+
this.id = `toast_${(0, crypto_1.randomBytes)(16).toString("hex")}`;
|
|
39
39
|
this.options = {
|
|
40
40
|
title: props.title,
|
|
41
41
|
style: props.style ?? Toast.Style.Success,
|
|
42
|
-
message: props.message
|
|
42
|
+
message: props.message,
|
|
43
43
|
};
|
|
44
44
|
if (props.primaryAction) {
|
|
45
45
|
const { onAction } = props.primaryAction;
|
|
@@ -55,28 +55,48 @@ class Toast {
|
|
|
55
55
|
/**
|
|
56
56
|
* The style of a Toast.
|
|
57
57
|
*/
|
|
58
|
-
get style() {
|
|
59
|
-
|
|
58
|
+
get style() {
|
|
59
|
+
return this.options.style;
|
|
60
|
+
}
|
|
61
|
+
set style(style) {
|
|
62
|
+
this.options.style = style;
|
|
63
|
+
}
|
|
60
64
|
/**
|
|
61
65
|
* The title of a Toast. Displayed on the top.
|
|
62
66
|
*/
|
|
63
|
-
get title() {
|
|
64
|
-
|
|
67
|
+
get title() {
|
|
68
|
+
return this.options.title;
|
|
69
|
+
}
|
|
70
|
+
set title(title) {
|
|
71
|
+
this.options.title = title;
|
|
72
|
+
}
|
|
65
73
|
/**
|
|
66
74
|
* An additional message for the Toast. Useful to show more information, e.g. an identifier of a newly created asset.
|
|
67
75
|
*/
|
|
68
|
-
get message() {
|
|
69
|
-
|
|
76
|
+
get message() {
|
|
77
|
+
return this.options.message;
|
|
78
|
+
}
|
|
79
|
+
set message(message) {
|
|
80
|
+
this.options.message = message;
|
|
81
|
+
}
|
|
70
82
|
/**
|
|
71
83
|
* The primary Action the user can take when hovering on the Toast.
|
|
72
84
|
*/
|
|
73
|
-
get primaryAction() {
|
|
74
|
-
|
|
85
|
+
get primaryAction() {
|
|
86
|
+
return this.options.primaryAction;
|
|
87
|
+
}
|
|
88
|
+
set primaryAction(action) {
|
|
89
|
+
this.options.primaryAction = action;
|
|
90
|
+
}
|
|
75
91
|
/**
|
|
76
92
|
* The secondary Action the user can take when hovering on the Toast.
|
|
77
93
|
*/
|
|
78
|
-
get secondaryAction() {
|
|
79
|
-
|
|
94
|
+
get secondaryAction() {
|
|
95
|
+
return this.options.secondaryAction;
|
|
96
|
+
}
|
|
97
|
+
set secondaryAction(action) {
|
|
98
|
+
this.options.secondaryAction = action;
|
|
99
|
+
}
|
|
80
100
|
/**
|
|
81
101
|
* Shows the Toast.
|
|
82
102
|
*
|
|
@@ -91,19 +111,23 @@ class Toast {
|
|
|
91
111
|
if (this.options.primaryAction && this.callbacks.primary) {
|
|
92
112
|
const { title, shortcut } = this.options.primaryAction;
|
|
93
113
|
payload.primaryAction = {
|
|
94
|
-
title,
|
|
114
|
+
title,
|
|
115
|
+
shortcut,
|
|
116
|
+
onAction: this.callbacks.primary,
|
|
95
117
|
};
|
|
96
118
|
}
|
|
97
119
|
if (this.options.secondaryAction && this.callbacks.secondary) {
|
|
98
120
|
const { title, shortcut } = this.options.secondaryAction;
|
|
99
121
|
payload.secondaryAction = {
|
|
100
|
-
title,
|
|
122
|
+
title,
|
|
123
|
+
shortcut,
|
|
124
|
+
onAction: this.callbacks.secondary,
|
|
101
125
|
};
|
|
102
126
|
}
|
|
103
|
-
await bus_1.bus.turboRequest(
|
|
127
|
+
await bus_1.bus.turboRequest("ui.showToast", {
|
|
104
128
|
id: this.id,
|
|
105
129
|
title: payload.title,
|
|
106
|
-
style: this.styleMap[payload.style ?? Toast.Style.Success]
|
|
130
|
+
style: this.styleMap[payload.style ?? Toast.Style.Success],
|
|
107
131
|
});
|
|
108
132
|
}
|
|
109
133
|
/**
|
|
@@ -112,7 +136,7 @@ class Toast {
|
|
|
112
136
|
* @returns A Promise that resolves when toast is hidden.
|
|
113
137
|
*/
|
|
114
138
|
async hide() {
|
|
115
|
-
await bus_1.bus.turboRequest(
|
|
139
|
+
await bus_1.bus.turboRequest("ui.hideToast", { id: this.id });
|
|
116
140
|
}
|
|
117
141
|
update;
|
|
118
142
|
}
|
|
@@ -134,7 +158,9 @@ exports.Toast = Toast;
|
|
|
134
158
|
})(Style = Toast.Style || (Toast.Style = {}));
|
|
135
159
|
})(Toast || (exports.Toast = Toast = {}));
|
|
136
160
|
const showToast = async (init, title = "", message) => {
|
|
137
|
-
const toast = typeof init ===
|
|
161
|
+
const toast = typeof init === "string"
|
|
162
|
+
? new Toast({ style: init, message, title })
|
|
163
|
+
: new Toast(init);
|
|
138
164
|
await toast.show();
|
|
139
165
|
return toast;
|
|
140
166
|
};
|
|
@@ -145,8 +171,7 @@ var PopToRootType;
|
|
|
145
171
|
PopToRootType["Immediate"] = "immediate";
|
|
146
172
|
PopToRootType["Suspended"] = "suspended";
|
|
147
173
|
})(PopToRootType || (exports.PopToRootType = PopToRootType = {}));
|
|
148
|
-
;
|
|
149
174
|
const showHUD = async (title, options) => {
|
|
150
|
-
await bus_1.bus.request(
|
|
175
|
+
await bus_1.bus.request("ui.show-hud", { title, options });
|
|
151
176
|
};
|
|
152
177
|
exports.showHUD = showHUD;
|
package/dist/api/utils.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PathLike } from
|
|
1
|
+
import { PathLike } from "fs";
|
|
2
2
|
export declare const captureException: (exception: unknown) => void;
|
|
3
3
|
export declare const trash: (path: PathLike | PathLike[]) => Promise<void>;
|
|
4
4
|
export declare const open: (target: string, app?: Application | string) => Promise<void>;
|