@glassly/engine 0.3.5-beta.788 → 0.3.5-beta.795
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/build/engine.d.ts +1 -0
- package/build/engine.d.ts.map +1 -1
- package/build/facades/miniapps.d.ts +2 -0
- package/build/facades/miniapps.d.ts.map +1 -1
- package/build/facades/miniapps.js +2 -0
- package/build/facades/miniapps.js.map +1 -1
- package/build/generated/releaseMetadata.js +3 -3
- package/build/generated/releaseMetadata.js.map +1 -1
- package/build/services/AppRegistry.d.ts +4 -1
- package/build/services/AppRegistry.d.ts.map +1 -1
- package/build/services/AppRegistry.js +16 -2
- package/build/services/AppRegistry.js.map +1 -1
- package/build/services/GlassesTouchInput.d.ts.map +1 -1
- package/build/services/GlassesTouchInput.js +5 -4
- package/build/services/GlassesTouchInput.js.map +1 -1
- package/build/services/LocalMiniappRuntime.d.ts +2 -0
- package/build/services/LocalMiniappRuntime.d.ts.map +1 -1
- package/build/services/LocalMiniappRuntime.js +27 -3
- package/build/services/LocalMiniappRuntime.js.map +1 -1
- package/build/services/manifestActions.d.ts +4 -2
- package/build/services/manifestActions.d.ts.map +1 -1
- package/build/services/manifestActions.js +8 -3
- package/build/services/manifestActions.js.map +1 -1
- package/build/stores/apps.d.ts +6 -0
- package/build/stores/apps.d.ts.map +1 -1
- package/build/stores/apps.js +16 -1
- package/build/stores/apps.js.map +1 -1
- package/build/types/applet.d.ts +3 -1
- package/build/types/applet.d.ts.map +1 -1
- package/build/types/applet.js.map +1 -1
- package/package.json +7 -7
- package/src/facades/miniapps.ts +3 -0
- package/src/generated/releaseMetadata.ts +3 -3
- package/src/services/AppRegistry.ts +18 -3
- package/src/services/GlassesTouchInput.ts +5 -4
- package/src/services/LocalMiniappRuntime.ts +28 -3
- package/src/services/manifestActions.ts +8 -3
- package/src/stores/apps.ts +23 -1
- package/src/types/applet.ts +3 -1
|
@@ -1512,6 +1512,9 @@ class LocalMiniappRuntime {
|
|
|
1512
1512
|
case MiniappRequestType.WIDGET_RESULT:
|
|
1513
1513
|
this.handleWidgetResult(packageName, payload);
|
|
1514
1514
|
break;
|
|
1515
|
+
case MiniappRequestType.WIDGET_EXPANDABLE:
|
|
1516
|
+
this.handleWidgetExpandable(packageName, payload, requestId);
|
|
1517
|
+
break;
|
|
1515
1518
|
case MiniappRequestType.SYSTEM_EXIT:
|
|
1516
1519
|
void this.handleSystemExit(packageName, requestId);
|
|
1517
1520
|
break;
|
|
@@ -5287,6 +5290,9 @@ class LocalMiniappRuntime {
|
|
|
5287
5290
|
const app = this.interopApps().find((a) => a.packageName === packageName);
|
|
5288
5291
|
if (!app)
|
|
5289
5292
|
return false;
|
|
5293
|
+
// Running only for its widget: start() promotes it to a normal run, as opening it on the phone does.
|
|
5294
|
+
if (app.widgetOnly)
|
|
5295
|
+
return useAppStatusStore.getState().start(app, { skipNavigation: true });
|
|
5290
5296
|
if (app.local) {
|
|
5291
5297
|
await miniappLauncher.ensureConnected(packageName);
|
|
5292
5298
|
return true;
|
|
@@ -5340,7 +5346,8 @@ class LocalMiniappRuntime {
|
|
|
5340
5346
|
packageName: app.packageName,
|
|
5341
5347
|
name: app.name,
|
|
5342
5348
|
version: app.version ?? "",
|
|
5343
|
-
running
|
|
5349
|
+
// A provider running only for a placed widget is not a run the wearer started.
|
|
5350
|
+
running: app.running && !app.widgetOnly,
|
|
5344
5351
|
hidden: app.hidden === true,
|
|
5345
5352
|
system: isSystemMiniapp(app),
|
|
5346
5353
|
compatibility,
|
|
@@ -5556,7 +5563,7 @@ class LocalMiniappRuntime {
|
|
|
5556
5563
|
name: widget.name,
|
|
5557
5564
|
sizes: widget.sizes,
|
|
5558
5565
|
defaultSize: widget.defaultSize,
|
|
5559
|
-
expandable: widget.
|
|
5566
|
+
expandable: widget.expandOnTap,
|
|
5560
5567
|
running: app.running,
|
|
5561
5568
|
compatible: app.compatibility?.isCompatible !== false,
|
|
5562
5569
|
});
|
|
@@ -5759,6 +5766,23 @@ class LocalMiniappRuntime {
|
|
|
5759
5766
|
this.sendResult(pending.hostPackageName, pending.hostRequestId, false, undefined, error);
|
|
5760
5767
|
}
|
|
5761
5768
|
}
|
|
5769
|
+
/** Provider: read, or set with `expandable`, whether a tap expands one of its own `EX` widgets. */
|
|
5770
|
+
handleWidgetExpandable(packageName, payload, requestId) {
|
|
5771
|
+
const widgetId = payload.widgetId;
|
|
5772
|
+
const app = this.interopApps().find((a) => a.packageName === packageName);
|
|
5773
|
+
const widget = app && widgetId ? this.declaredWidget(app, widgetId) : undefined;
|
|
5774
|
+
if (!widget?.expandable) {
|
|
5775
|
+
this.sendResult(packageName, requestId, false, undefined, {
|
|
5776
|
+
code: MiniappErrorCode.WIDGET_NOT_FOUND,
|
|
5777
|
+
message: `${packageName} has no widget "${widgetId ?? "(missing widgetId)"}" that lists EX`,
|
|
5778
|
+
});
|
|
5779
|
+
return;
|
|
5780
|
+
}
|
|
5781
|
+
const expandable = typeof payload.expandable === "boolean"
|
|
5782
|
+
? useAppStatusStore.getState().setWidgetExpand(packageName, widget.id, payload.expandable)
|
|
5783
|
+
: widget.expandOnTap;
|
|
5784
|
+
this.sendResult(packageName, requestId, true, { expandable });
|
|
5785
|
+
}
|
|
5762
5786
|
/** Provider → host, one-shot: cache the frame for its view and push it to every host holding the widget. */
|
|
5763
5787
|
handleWidgetUpdate(providerPackageName, payload) {
|
|
5764
5788
|
const widgetId = payload.widgetId;
|
|
@@ -5771,7 +5795,7 @@ class LocalMiniappRuntime {
|
|
|
5771
5795
|
return;
|
|
5772
5796
|
const view = payload.view === "expanded" ? "expanded" : "card";
|
|
5773
5797
|
if (view === "expanded" && !widget.expandable) {
|
|
5774
|
-
console.warn(`${LOG_TAG}: dropping expanded frame from ${providerPackageName}/${widgetId}: not
|
|
5798
|
+
console.warn(`${LOG_TAG}: dropping expanded frame from ${providerPackageName}/${widgetId}: it does not list EX`);
|
|
5775
5799
|
return;
|
|
5776
5800
|
}
|
|
5777
5801
|
const cap = view === "expanded"
|