@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.
Files changed (67) hide show
  1. package/README.md +1 -1
  2. package/bin/run.js +2 -2
  3. package/dist/api/ai.js +11 -10
  4. package/dist/api/alert.d.ts +1 -1
  5. package/dist/api/alert.js +4 -5
  6. package/dist/api/bus.d.ts +27 -27
  7. package/dist/api/bus.js +15 -15
  8. package/dist/api/cache.js +15 -6
  9. package/dist/api/clipboard.d.ts +2 -2
  10. package/dist/api/clipboard.js +14 -15
  11. package/dist/api/color.js +1 -3
  12. package/dist/api/components/action-pannel.js +2 -2
  13. package/dist/api/components/actions.d.ts +3 -3
  14. package/dist/api/components/actions.js +16 -16
  15. package/dist/api/components/detail.d.ts +1 -1
  16. package/dist/api/components/detail.js +1 -1
  17. package/dist/api/components/dropdown.js +3 -3
  18. package/dist/api/components/empty-view.d.ts +2 -2
  19. package/dist/api/components/empty-view.js +1 -1
  20. package/dist/api/components/form.d.ts +2 -2
  21. package/dist/api/components/form.js +4 -12
  22. package/dist/api/components/grid.d.ts +4 -4
  23. package/dist/api/components/grid.js +10 -10
  24. package/dist/api/components/index.d.ts +7 -7
  25. package/dist/api/components/list.d.ts +3 -3
  26. package/dist/api/components/list.js +6 -6
  27. package/dist/api/components/menu-bar.js +1 -1
  28. package/dist/api/components/metadata.d.ts +2 -2
  29. package/dist/api/components/metadata.js +1 -1
  30. package/dist/api/components/tag.d.ts +3 -3
  31. package/dist/api/components/tag.js +4 -3
  32. package/dist/api/context/index.d.ts +1 -1
  33. package/dist/api/context/navigation-context.js +6 -2
  34. package/dist/api/context/navigation-provider.d.ts +1 -1
  35. package/dist/api/context/navigation-provider.js +5 -5
  36. package/dist/api/controls.js +3 -3
  37. package/dist/api/environment.js +0 -2
  38. package/dist/api/hooks/index.d.ts +2 -2
  39. package/dist/api/hooks/use-imperative-form-handle.d.ts +2 -2
  40. package/dist/api/hooks/use-imperative-form-handle.js +3 -3
  41. package/dist/api/hooks.js +4 -2
  42. package/dist/api/image.d.ts +1 -1
  43. package/dist/api/image.js +5 -5
  44. package/dist/api/index.d.ts +19 -19
  45. package/dist/api/keyboard.js +4 -5
  46. package/dist/api/local-storage.js +5 -7
  47. package/dist/api/oauth.d.ts +1 -1
  48. package/dist/api/oauth.js +23 -20
  49. package/dist/api/preference.js +2 -2
  50. package/dist/api/proto/application.js +28 -13
  51. package/dist/api/proto/clipboard.js +70 -37
  52. package/dist/api/proto/common.js +5 -1
  53. package/dist/api/proto/extension.js +104 -49
  54. package/dist/api/proto/google/protobuf/struct.js +25 -8
  55. package/dist/api/proto/ipc.js +99 -52
  56. package/dist/api/proto/manager.js +56 -22
  57. package/dist/api/proto/oauth.js +32 -14
  58. package/dist/api/proto/storage.js +66 -28
  59. package/dist/api/proto/ui.js +233 -124
  60. package/dist/api/toast.js +46 -21
  61. package/dist/api/utils.d.ts +1 -1
  62. package/dist/api/utils.js +16 -12
  63. package/dist/commands/build/index.js +18 -2
  64. package/dist/commands/develop/index.js +18 -3
  65. package/dist/index.d.ts +1 -1
  66. package/dist/schemas/manifest.js +225 -1
  67. package/package.json +1 -1
@@ -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) ? globalThis.Boolean(object.clearRootSearch) : false,
727
- popToRoot: isSet(object.popToRoot) ? popToRootTypeFromJSON(object.popToRoot) : 0,
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) ? globalThis.String(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) ? exports.ConfirmAlertAction.fromJSON(object.dismissAction) : undefined,
911
- primaryAction: isSet(object.primaryAction) ? exports.ConfirmAlertAction.fromJSON(object.primaryAction) : undefined,
912
- rememberUserChoice: isSet(object.rememberUserChoice) ? globalThis.Boolean(object.rememberUserChoice) : false,
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 = (object.dismissAction !== undefined && object.dismissAction !== null)
950
- ? exports.ConfirmAlertAction.fromPartial(object.dismissAction)
951
- : undefined;
952
- message.primaryAction = (object.primaryAction !== undefined && object.primaryAction !== null)
953
- ? exports.ConfirmAlertAction.fromPartial(object.primaryAction)
954
- : undefined;
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) ? confirmAlertActionStyleFromJSON(object.style) : 0,
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) ? exports.RenderRequest.fromJSON(object.render) : undefined,
1186
- showToast: isSet(object.showToast) ? exports.ShowToastRequest.fromJSON(object.showToast) : undefined,
1187
- hideToast: isSet(object.hideToast) ? exports.HideToastRequest.fromJSON(object.hideToast) : undefined,
1188
- updateToast: isSet(object.updateToast) ? exports.UpdateToastRequest.fromJSON(object.updateToast) : undefined,
1189
- pushView: isSet(object.pushView) ? exports.PushViewRequest.fromJSON(object.pushView) : undefined,
1190
- popView: isSet(object.popView) ? exports.PopViewRequest.fromJSON(object.popView) : undefined,
1191
- clearSearch: isSet(object.clearSearch) ? exports.ClearSearchBarRequest.fromJSON(object.clearSearch) : undefined,
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) ? exports.ShowHudRequest.fromJSON(object.showHud) : undefined,
1196
- setSearchText: isSet(object.setSearchText) ? exports.SetSearchTextRequest.fromJSON(object.setSearchText) : undefined,
1197
- confirmAlert: isSet(object.confirmAlert) ? exports.ConfirmAlertRequest.fromJSON(object.confirmAlert) : undefined,
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 = (object.render !== undefined && object.render !== null)
1249
- ? exports.RenderRequest.fromPartial(object.render)
1250
- : undefined;
1251
- message.showToast = (object.showToast !== undefined && object.showToast !== null)
1252
- ? exports.ShowToastRequest.fromPartial(object.showToast)
1253
- : undefined;
1254
- message.hideToast = (object.hideToast !== undefined && object.hideToast !== null)
1255
- ? exports.HideToastRequest.fromPartial(object.hideToast)
1256
- : undefined;
1257
- message.updateToast = (object.updateToast !== undefined && object.updateToast !== null)
1258
- ? exports.UpdateToastRequest.fromPartial(object.updateToast)
1259
- : undefined;
1260
- message.pushView = (object.pushView !== undefined && object.pushView !== null)
1261
- ? exports.PushViewRequest.fromPartial(object.pushView)
1262
- : undefined;
1263
- message.popView = (object.popView !== undefined && object.popView !== null)
1264
- ? exports.PopViewRequest.fromPartial(object.popView)
1265
- : undefined;
1266
- message.clearSearch = (object.clearSearch !== undefined && object.clearSearch !== null)
1267
- ? exports.ClearSearchBarRequest.fromPartial(object.clearSearch)
1268
- : undefined;
1269
- message.closeMainWindow = (object.closeMainWindow !== undefined && object.closeMainWindow !== null)
1270
- ? exports.CloseMainWindowRequest.fromPartial(object.closeMainWindow)
1271
- : undefined;
1272
- message.showHud = (object.showHud !== undefined && object.showHud !== null)
1273
- ? exports.ShowHudRequest.fromPartial(object.showHud)
1274
- : undefined;
1275
- message.setSearchText = (object.setSearchText !== undefined && object.setSearchText !== null)
1276
- ? exports.SetSearchTextRequest.fromPartial(object.setSearchText)
1277
- : undefined;
1278
- message.confirmAlert = (object.confirmAlert !== undefined && object.confirmAlert !== null)
1279
- ? exports.ConfirmAlertRequest.fromPartial(object.confirmAlert)
1280
- : undefined;
1281
- message.getSelectedText = (object.getSelectedText !== undefined && object.getSelectedText !== null)
1282
- ? exports.GetSelectedTextRequest.fromPartial(object.getSelectedText)
1283
- : undefined;
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) ? common_1.AckResponse.fromJSON(object.render) : undefined,
1445
- showToast: isSet(object.showToast) ? common_1.AckResponse.fromJSON(object.showToast) : undefined,
1446
- hideToast: isSet(object.hideToast) ? common_1.AckResponse.fromJSON(object.hideToast) : undefined,
1447
- updateToast: isSet(object.updateToast) ? common_1.AckResponse.fromJSON(object.updateToast) : undefined,
1448
- pushView: isSet(object.pushView) ? common_1.AckResponse.fromJSON(object.pushView) : undefined,
1449
- popView: isSet(object.popView) ? common_1.AckResponse.fromJSON(object.popView) : undefined,
1450
- clearSearch: isSet(object.clearSearch) ? common_1.AckResponse.fromJSON(object.clearSearch) : undefined,
1451
- closeMainWindow: isSet(object.closeMainWindow) ? common_1.AckResponse.fromJSON(object.closeMainWindow) : undefined,
1452
- showHud: isSet(object.showHud) ? common_1.AckResponse.fromJSON(object.showHud) : undefined,
1453
- setSearchText: isSet(object.setSearchText) ? common_1.AckResponse.fromJSON(object.setSearchText) : undefined,
1454
- confirmAlert: isSet(object.confirmAlert) ? common_1.AckResponse.fromJSON(object.confirmAlert) : undefined,
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 = (object.render !== undefined && object.render !== null)
1506
- ? common_1.AckResponse.fromPartial(object.render)
1507
- : undefined;
1508
- message.showToast = (object.showToast !== undefined && object.showToast !== null)
1509
- ? common_1.AckResponse.fromPartial(object.showToast)
1510
- : undefined;
1511
- message.hideToast = (object.hideToast !== undefined && object.hideToast !== null)
1512
- ? common_1.AckResponse.fromPartial(object.hideToast)
1513
- : undefined;
1514
- message.updateToast = (object.updateToast !== undefined && object.updateToast !== null)
1515
- ? common_1.AckResponse.fromPartial(object.updateToast)
1516
- : undefined;
1517
- message.pushView = (object.pushView !== undefined && object.pushView !== null)
1518
- ? common_1.AckResponse.fromPartial(object.pushView)
1519
- : undefined;
1520
- message.popView = (object.popView !== undefined && object.popView !== null)
1521
- ? common_1.AckResponse.fromPartial(object.popView)
1522
- : undefined;
1523
- message.clearSearch = (object.clearSearch !== undefined && object.clearSearch !== null)
1524
- ? common_1.AckResponse.fromPartial(object.clearSearch)
1525
- : undefined;
1526
- message.closeMainWindow = (object.closeMainWindow !== undefined && object.closeMainWindow !== null)
1527
- ? common_1.AckResponse.fromPartial(object.closeMainWindow)
1528
- : undefined;
1529
- message.showHud = (object.showHud !== undefined && object.showHud !== null)
1530
- ? common_1.AckResponse.fromPartial(object.showHud)
1531
- : undefined;
1532
- message.setSearchText = (object.setSearchText !== undefined && object.setSearchText !== null)
1533
- ? common_1.AckResponse.fromPartial(object.setSearchText)
1534
- : undefined;
1535
- message.confirmAlert = (object.confirmAlert !== undefined && object.confirmAlert !== null)
1536
- ? common_1.AckResponse.fromPartial(object.confirmAlert)
1537
- : undefined;
1538
- message.getSelectedText = (object.getSelectedText !== undefined && object.getSelectedText !== null)
1539
- ? exports.GetSelectedTextResponse.fromPartial(object.getSelectedText)
1540
- : undefined;
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 { type: "", hasDirtyChild: false, hasDirtyProps: false, props: {}, children: [] };
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) ? globalThis.Boolean(object.hasDirtyChild) : false,
1625
- hasDirtyProps: isSet(object.hasDirtyProps) ? globalThis.Boolean(object.hasDirtyProps) : false,
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 = object.children?.map((e) => exports.RenderNode.fromPartial(e)) || [];
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) ? exports.ThemedImageSource.fromJSON(object.themed) : undefined,
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 = (object.themed !== undefined && object.themed !== null)
1881
- ? exports.ThemedImageSource.fromPartial(object.themed)
1882
- : undefined;
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 { source: undefined, fallback: undefined, mask: undefined, colorTint: undefined };
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) ? exports.ImageSource.fromJSON(object.source) : undefined,
1951
- fallback: isSet(object.fallback) ? exports.ImageSource.fromJSON(object.fallback) : undefined,
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) ? globalThis.String(object.colorTint) : undefined,
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 = (object.source !== undefined && object.source !== null)
1978
- ? exports.ImageSource.fromPartial(object.source)
1979
- : undefined;
1980
- message.fallback = (object.fallback !== undefined && object.fallback !== null)
1981
- ? exports.ImageSource.fromPartial(object.fallback)
1982
- : undefined;
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('hex')}`;
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() { return this.options.style; }
59
- set style(style) { this.options.style = style; }
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() { return this.options.title; }
64
- set title(title) { this.options.title = title; }
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() { return this.options.message; }
69
- set message(message) { this.options.message = message; }
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() { return this.options.primaryAction; }
74
- set primaryAction(action) { this.options.primaryAction = action; }
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() { return this.options.secondaryAction; }
79
- set secondaryAction(action) { this.options.secondaryAction = action; }
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, shortcut, onAction: this.callbacks.primary
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, shortcut, onAction: this.callbacks.secondary
122
+ title,
123
+ shortcut,
124
+ onAction: this.callbacks.secondary,
101
125
  };
102
126
  }
103
- await bus_1.bus.turboRequest('ui.showToast', {
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('ui.hideToast', { id: this.id });
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 === 'string' ? new Toast({ style: init, message, title }) : new Toast(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('ui.show-hud', { title, options });
175
+ await bus_1.bus.request("ui.show-hud", { title, options });
151
176
  };
152
177
  exports.showHUD = showHUD;
@@ -1,4 +1,4 @@
1
- import { PathLike } from 'fs';
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>;