@qontinui/ui-bridge-native 0.6.14 → 0.6.16
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 +17 -0
- package/dist/control/index.js.map +1 -1
- package/dist/control/index.mjs.map +1 -1
- package/dist/core/index.js +42 -0
- package/dist/core/index.js.map +1 -1
- package/dist/core/index.mjs +42 -0
- package/dist/core/index.mjs.map +1 -1
- package/dist/core/registry.d.ts +23 -1
- package/dist/core/registry.d.ts.map +1 -1
- package/dist/core/types.d.ts +66 -2
- package/dist/core/types.d.ts.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +117 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +113 -3
- package/dist/index.mjs.map +1 -1
- package/dist/react/index.d.ts +4 -0
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +117 -2
- package/dist/react/index.js.map +1 -1
- package/dist/react/index.mjs +113 -3
- package/dist/react/index.mjs.map +1 -1
- package/dist/react/routePattern.d.ts +145 -0
- package/dist/react/routePattern.d.ts.map +1 -0
- package/dist/react/useRouteAwareness.d.ts +106 -0
- package/dist/react/useRouteAwareness.d.ts.map +1 -0
- package/dist/server/http-server.d.ts.map +1 -1
- package/dist/server/index.js +1 -1
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +1 -1
- package/dist/server/index.mjs.map +1 -1
- package/dist/transport/DeviceAnnouncer.d.ts +1 -0
- package/dist/transport/DeviceAnnouncer.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/core/index.js
CHANGED
|
@@ -764,6 +764,13 @@ function computeVisibility(state, clip) {
|
|
|
764
764
|
const onScreen = spansOverlap(rect.left, rect.right, clip.left, clip.right) && spansOverlap(rect.top, rect.bottom, clip.top, clip.bottom);
|
|
765
765
|
return onScreen ? { visibility: "visible" } : { visibility: "hidden", visibilityReason: "off-screen" };
|
|
766
766
|
}
|
|
767
|
+
function copyRouteInfo(info) {
|
|
768
|
+
const copy = { ...info };
|
|
769
|
+
if (info.params) copy.params = { ...info.params };
|
|
770
|
+
if (info.queryParams) copy.queryParams = { ...info.queryParams };
|
|
771
|
+
if (info.routeStack) copy.routeStack = [...info.routeStack];
|
|
772
|
+
return copy;
|
|
773
|
+
}
|
|
767
774
|
function inferActions(type, scrollAncestorId) {
|
|
768
775
|
const baseActions = scrollAncestorId ? ["focus", "blur", "scrollIntoView"] : ["focus", "blur"];
|
|
769
776
|
switch (type) {
|
|
@@ -828,6 +835,16 @@ var NativeUIBridgeRegistry = class {
|
|
|
828
835
|
* already installs.
|
|
829
836
|
*/
|
|
830
837
|
this.routeProvider = null;
|
|
838
|
+
/**
|
|
839
|
+
* The route TEMPLATE the app last reported through `useRouteAwareness`
|
|
840
|
+
* (via {@link setRouteInfo}), emitted on every snapshot as `page.route`.
|
|
841
|
+
*
|
|
842
|
+
* Deliberately NOT named `routeInfo`: `createSnapshot`'s parameter of that
|
|
843
|
+
* name is the CONCRETE `{currentRoute, segments, activeTab}` read from the
|
|
844
|
+
* route provider. The two must never be confused — the concrete path is
|
|
845
|
+
* user input, and this slot is the router-asserted template.
|
|
846
|
+
*/
|
|
847
|
+
this.reportedRoute = void 0;
|
|
831
848
|
/**
|
|
832
849
|
* Device pixel ratio used to project `state.layout` (logical dp) into the
|
|
833
850
|
* physical-pixel `bbox` emitted on each snapshot element. Defaults to `1`
|
|
@@ -886,6 +903,22 @@ var NativeUIBridgeRegistry = class {
|
|
|
886
903
|
getRouteProvider() {
|
|
887
904
|
return this.routeProvider;
|
|
888
905
|
}
|
|
906
|
+
/**
|
|
907
|
+
* Set the route info emitted as `page.route` on every snapshot — the
|
|
908
|
+
* router-asserted TEMPLATE, normally reported by `useRouteAwareness`.
|
|
909
|
+
* Pass `undefined` to clear it (the hook does so on unmount), after which
|
|
910
|
+
* snapshots omit `page` again.
|
|
911
|
+
*
|
|
912
|
+
* The value is copied, so a later mutation by the caller cannot alter what
|
|
913
|
+
* is stored or what an already-emitted snapshot holds.
|
|
914
|
+
*/
|
|
915
|
+
setRouteInfo(info) {
|
|
916
|
+
this.reportedRoute = info ? copyRouteInfo(info) : void 0;
|
|
917
|
+
}
|
|
918
|
+
/** Read-only accessor for the reported route info, if any (a copy). */
|
|
919
|
+
getRouteInfo() {
|
|
920
|
+
return this.reportedRoute ? copyRouteInfo(this.reportedRoute) : void 0;
|
|
921
|
+
}
|
|
889
922
|
/**
|
|
890
923
|
* Resolve the snapshot's `activeTab`: an explicit `getActiveTab()` on the
|
|
891
924
|
* route provider wins, otherwise derive it from the Expo Router segments the
|
|
@@ -1726,6 +1759,12 @@ var NativeUIBridgeRegistry = class {
|
|
|
1726
1759
|
// hosts that wire no route provider.
|
|
1727
1760
|
...resolvedRoute.currentRoute ? { route: resolvedRoute.currentRoute } : {},
|
|
1728
1761
|
...resolvedRoute.activeTab ? { activeTab: resolvedRoute.activeTab } : {},
|
|
1762
|
+
// The router-asserted route TEMPLATE, spelled as the web SDK's
|
|
1763
|
+
// `snapshot.page.route`. Emitted on the ONE assembly point both route
|
|
1764
|
+
// branches above share (the explicit-`routeInfo` branch the server's
|
|
1765
|
+
// `getSnapshot` override uses, and the provider fallback). Omitted, not
|
|
1766
|
+
// nulled, when unset — the same convention as the aliases above.
|
|
1767
|
+
...this.reportedRoute ? { page: { route: copyRouteInfo(this.reportedRoute) } } : {},
|
|
1729
1768
|
registration: this.getRegistrationCoverage()
|
|
1730
1769
|
};
|
|
1731
1770
|
if (this.appInfo) {
|
|
@@ -1772,6 +1811,9 @@ var NativeUIBridgeRegistry = class {
|
|
|
1772
1811
|
}
|
|
1773
1812
|
}
|
|
1774
1813
|
}
|
|
1814
|
+
if (this.reportedRoute) {
|
|
1815
|
+
snapshot.page = { route: copyRouteInfo(this.reportedRoute) };
|
|
1816
|
+
}
|
|
1775
1817
|
}
|
|
1776
1818
|
return snapshot;
|
|
1777
1819
|
}
|