@octane-xplat/ui 0.5.0 → 0.6.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 +3 -0
- package/dist/native/Absolute.native.tsrx.js +43 -0
- package/dist/native/Accordion.native.tsrx.js +75 -0
- package/dist/native/ActivityIndicator.native.tsrx.js +35 -0
- package/dist/native/Alert.native.tsrx.js +74 -0
- package/dist/native/Avatar.native.tsrx.js +76 -0
- package/dist/native/AvatarGroup.native.tsrx.js +84 -0
- package/dist/native/Badge.native.tsrx.js +29 -0
- package/dist/native/Banner.native.tsrx.js +80 -0
- package/dist/native/Breadcrumb.native.tsrx.js +66 -0
- package/dist/native/Button.native.tsrx.js +62 -0
- package/dist/native/CameraView.native.tsrx.js +165 -0
- package/dist/native/Card.native.tsrx.js +64 -0
- package/dist/native/Checkbox.native.tsrx.js +58 -0
- package/dist/native/CheckboxGroup.native.tsrx.js +70 -0
- package/dist/native/Chip.native.tsrx.js +83 -0
- package/dist/native/Collapsible.native.tsrx.js +74 -0
- package/dist/native/CommandPalette.native.tsrx.js +143 -0
- package/dist/native/ContextMenu.native.tsrx.js +140 -0
- package/dist/native/Drawer.native.tsrx.js +60 -0
- package/dist/native/DropdownMenu.native.tsrx.js +155 -0
- package/dist/native/Empty.native.tsrx.js +82 -0
- package/dist/native/FieldGroup.native.tsrx.js +39 -0
- package/dist/native/FormField.native.tsrx.js +53 -0
- package/dist/native/{ui8.js → Grid.native.tsrx.js} +19 -8
- package/dist/native/{ui59.js → Heading.native.tsrx.js} +2 -2
- package/dist/native/{ui58.js → Icon.native.tsrx.js} +4 -4
- package/dist/native/{ui29.js → Image.native.tsrx.js} +4 -4
- package/dist/native/InputNumber.native.tsrx.js +146 -0
- package/dist/native/InputRating.native.tsrx.js +74 -0
- package/dist/native/InputTags.native.tsrx.js +131 -0
- package/dist/native/Kbd.native.tsrx.js +29 -0
- package/dist/native/{ui50.js → KeyboardAvoiding.native.tsrx.js} +1 -1
- package/dist/native/{ui17.js → Link.native.tsrx.js} +1 -1
- package/dist/native/{ui55.js → Meter.native.tsrx.js} +2 -2
- package/dist/native/{ui22.js → NavLink.native.tsrx.js} +3 -3
- package/dist/native/NavigationMenu.native.tsrx.js +67 -0
- package/dist/native/{ui35.js → Overlay.native.tsrx.js} +3 -3
- package/dist/native/Pager.native.tsrx.js +282 -0
- package/dist/native/Pagination.native.tsrx.js +107 -0
- package/dist/native/PinInput.native.tsrx.js +94 -0
- package/dist/native/{ui38.js → Popover.native.tsrx.js} +5 -5
- package/dist/native/{ui16.js → Pressable.native.tsrx.js} +20 -14
- package/dist/native/ProgressGroup.native.tsrx.js +66 -0
- package/dist/native/RadioGroup.native.tsrx.js +85 -0
- package/dist/native/{ui15.js → RichText.native.tsrx.js} +15 -22
- package/dist/native/Row.native.tsrx.js +98 -0
- package/dist/native/{ui49.js → SafeArea.native.tsrx.js} +2 -2
- package/dist/native/{ui45.js → Screen.native.tsrx.js} +3 -3
- package/dist/native/{ui26.js → ScrollBox.native.tsrx.js} +1 -1
- package/dist/native/ScrollView.native.tsrx.js +233 -0
- package/dist/native/SearchInput.native.tsrx.js +151 -0
- package/dist/native/SegmentedControl.native.tsrx.js +75 -0
- package/dist/native/Select.native.tsrx.js +202 -0
- package/dist/native/Separator.native.tsrx.js +25 -0
- package/dist/native/{ui63.js → Sheet.native.tsrx.js} +15 -7
- package/dist/native/Skeleton.native.tsrx.js +28 -0
- package/dist/native/Slider.native.tsrx.js +98 -0
- package/dist/native/{ui13.js → Spacer.native.tsrx.js} +2 -2
- package/dist/native/{ui9.js → Stack.native.tsrx.js} +20 -9
- package/dist/native/Stepper.native.tsrx.js +75 -0
- package/dist/native/Switch.native.tsrx.js +33 -0
- package/dist/native/Table.native.tsrx.js +103 -0
- package/dist/native/Tabs.native.tsrx.js +163 -0
- package/dist/native/{ui14.js → Text.native.tsrx.js} +4 -3
- package/dist/native/{ui24.js → TextArea.native.tsrx.js} +17 -16
- package/dist/native/{ui23.js → TextInput.native.tsrx.js} +21 -16
- package/dist/native/Timeline.native.tsrx.js +112 -0
- package/dist/native/Tree.native.tsrx.js +140 -0
- package/dist/native/User.native.tsrx.js +95 -0
- package/dist/native/Video.native.tsrx.js +248 -0
- package/dist/native/View.native.tsrx.js +98 -0
- package/dist/native/WebView.native.tsrx.js +110 -0
- package/dist/native/aliases.native.tsrx.js +38 -0
- package/dist/native/android/BottomNavigationView.android.tsrx.js +171 -0
- package/dist/native/android/CircularProgressIndicator.android.tsrx.js +27 -0
- package/dist/native/{ui51.js → android/DrawerLayout.android.tsrx.js} +5 -7
- package/dist/native/android/MaterialDialog.android.tsrx.js +62 -0
- package/dist/native/android/MaterialSwitch.android.tsrx.js +28 -0
- package/dist/native/android/RecyclerView.android.tsrx.js +248 -0
- package/dist/native/android/SeekBar.android.tsrx.js +34 -0
- package/dist/native/android/index.js +9 -0
- package/dist/native/android/openModal.android.js +39 -0
- package/dist/native/camera-permission.native.js +47 -0
- package/dist/native/child-array.js +15 -0
- package/dist/native/icons.js +25 -0
- package/dist/native/{ui11.js → ios/LiquidGlass.ios.tsrx.js} +4 -4
- package/dist/native/{ui12.js → ios/LiquidGlassContainer.ios.tsrx.js} +4 -4
- package/dist/native/ios/SideDrawer.ios.tsrx.js +64 -0
- package/dist/native/{ui53.js → ios/UIActivityIndicatorView.ios.tsrx.js} +5 -5
- package/dist/native/{ui32.js → ios/UIModal.ios.tsrx.js} +10 -6
- package/dist/native/{ui56.js → ios/UISlider.ios.tsrx.js} +5 -5
- package/dist/native/{ui47.js → ios/UISwitch.ios.tsrx.js} +5 -5
- package/dist/native/ios/UITabBar.ios.tsrx.js +166 -0
- package/dist/native/ios/UITableView.ios.tsrx.js +270 -0
- package/dist/native/ios/index.js +11 -0
- package/dist/native/{ui33.js → ios/openModal.ios.js} +5 -4
- package/dist/native/modal-presenter.native.js +19 -0
- package/dist/native/native/index.js +4 -0
- package/dist/native/octane-client-build.json +1 -1
- package/dist/native/{ui6.js → pan.native.tsrx.js} +9 -69
- package/dist/native/platform.native.js +10 -0
- package/dist/native/refresh-metrics.js +9 -0
- package/dist/native/refresh.native.js +177 -0
- package/dist/native/{ui34.js → root-layout.native.js} +6 -1
- package/dist/native/{ui21.js → route.native.js} +96 -12
- package/dist/native/sheet-detents.native.js +102 -0
- package/dist/native/{ui64.js → sheet-service.native.js} +19 -9
- package/dist/native/sheet-snap.js +35 -0
- package/dist/native/text-write.native.js +27 -0
- package/dist/native/{ui42.js → theme/status-bar-scheme.native.js} +2 -2
- package/dist/{web/ui29.js → native/theme/theme-scheme.js} +2 -2
- package/dist/native/{ui40.js → toast-anchor.native.tsrx.js} +3 -3
- package/dist/native/translate.native.js +11 -0
- package/dist/native/ui.js +93 -55
- package/dist/native/use-back.native.tsrx.js +9 -0
- package/dist/native/{ui52.js → useMeasure.native.tsrx.js} +1 -1
- package/dist/native/video-chrome.native.tsrx.js +365 -0
- package/dist/web/Absolute.web.tsrx.js +47 -0
- package/dist/web/Accordion.web.tsrx.js +85 -0
- package/dist/web/{ui48.js → ActivityIndicator.web.tsrx.js} +1 -1
- package/dist/web/Alert.web.tsrx.js +79 -0
- package/dist/web/Avatar.web.tsrx.js +106 -0
- package/dist/web/AvatarGroup.web.tsrx.js +108 -0
- package/dist/web/Badge.web.tsrx.js +37 -0
- package/dist/web/Banner.web.tsrx.js +79 -0
- package/dist/web/Breadcrumb.web.tsrx.js +135 -0
- package/dist/web/Button.web.tsrx.js +45 -0
- package/dist/web/CameraView.web.tsrx.js +310 -0
- package/dist/web/Card.web.tsrx.js +73 -0
- package/dist/web/Checkbox.web.tsrx.js +89 -0
- package/dist/web/CheckboxGroup.web.tsrx.js +79 -0
- package/dist/web/Chip.web.tsrx.js +64 -0
- package/dist/web/Collapsible.web.tsrx.js +94 -0
- package/dist/web/CommandPalette.web.tsrx.js +125 -0
- package/dist/web/ContextMenu.web.tsrx.js +154 -0
- package/dist/web/{ui45.js → Drawer.web.tsrx.js} +13 -9
- package/dist/web/DropdownMenu.web.tsrx.js +162 -0
- package/dist/web/Empty.web.tsrx.js +89 -0
- package/dist/web/FieldGroup.web.tsrx.js +57 -0
- package/dist/web/FormField.web.tsrx.js +92 -0
- package/dist/web/Grid.web.tsrx.js +65 -0
- package/dist/web/{ui54.js → Heading.web.tsrx.js} +2 -2
- package/dist/web/{ui53.js → Icon.web.tsrx.js} +2 -2
- package/dist/web/{ui25.js → Image.web.tsrx.js} +2 -2
- package/dist/web/InputNumber.web.tsrx.js +99 -0
- package/dist/web/InputRating.web.tsrx.js +72 -0
- package/dist/web/InputTags.web.tsrx.js +122 -0
- package/dist/web/Kbd.web.tsrx.js +37 -0
- package/dist/web/{ui50.js → Meter.web.tsrx.js} +1 -1
- package/dist/web/{ui19.js → NavLink.web.tsrx.js} +1 -1
- package/dist/web/NavigationMenu.web.tsrx.js +118 -0
- package/dist/web/{ui31.js → Overlay.web.tsrx.js} +2 -2
- package/dist/web/Pager.web.tsrx.js +337 -0
- package/dist/web/Pagination.web.tsrx.js +80 -0
- package/dist/web/PinInput.web.tsrx.js +72 -0
- package/dist/web/{ui33.js → Popover.web.tsrx.js} +3 -3
- package/dist/web/{ui15.js → Pressable.web.tsrx.js} +68 -95
- package/dist/web/ProgressGroup.web.tsrx.js +109 -0
- package/dist/web/RadioGroup.web.tsrx.js +69 -0
- package/dist/web/{ui14.js → RichText.web.tsrx.js} +2 -2
- package/dist/web/Row.web.tsrx.js +250 -0
- package/dist/web/{ui43.js → SafeArea.web.tsrx.js} +1 -1
- package/dist/web/{ui39.js → Screen.web.tsrx.js} +1 -1
- package/dist/web/{ui24.js → ScrollBox.web.tsrx.js} +1 -1
- package/dist/web/ScrollView.web.tsrx.js +388 -0
- package/dist/web/SearchInput.web.tsrx.js +137 -0
- package/dist/web/SegmentedControl.web.tsrx.js +75 -0
- package/dist/web/Select.web.tsrx.js +149 -0
- package/dist/web/Separator.web.tsrx.js +42 -0
- package/dist/web/Sheet.web.tsrx.js +81 -0
- package/dist/web/Skeleton.web.tsrx.js +56 -0
- package/dist/web/Slider.web.tsrx.js +97 -0
- package/dist/web/{ui12.js → Spacer.web.tsrx.js} +1 -1
- package/dist/web/Stack.web.tsrx.js +47 -0
- package/dist/web/Stepper.web.tsrx.js +65 -0
- package/dist/web/Switch.web.tsrx.js +59 -0
- package/dist/web/Table.web.tsrx.js +161 -0
- package/dist/web/{ui40.js → Tabs.web.tsrx.js} +33 -16
- package/dist/web/{ui13.js → Text.web.tsrx.js} +18 -50
- package/dist/web/{ui21.js → TextArea.web.tsrx.js} +4 -4
- package/dist/web/{ui20.js → TextInput.web.tsrx.js} +8 -8
- package/dist/web/Timeline.web.tsrx.js +172 -0
- package/dist/web/Tree.web.tsrx.js +146 -0
- package/dist/web/User.web.tsrx.js +116 -0
- package/dist/web/Video.web.tsrx.js +400 -0
- package/dist/web/View.web.tsrx.js +250 -0
- package/dist/web/WebView.web.tsrx.js +235 -0
- package/dist/web/aliases.web.tsrx.js +24 -0
- package/dist/web/{ui36.js → anim.web.tsrx.js} +3 -35
- package/dist/web/child-array.js +15 -0
- package/dist/web/icons.js +25 -0
- package/dist/web/octane-client-build.json +1 -1
- package/dist/web/pan.web.tsrx.js +66 -0
- package/dist/web/platform.web.js +9 -0
- package/dist/web/refresh-metrics.js +9 -0
- package/dist/web/refresh.web.js +133 -0
- package/dist/web/{ui18.js → route.web.js} +14 -2
- package/dist/web/sheet-detents.web.js +103 -0
- package/dist/web/{ui60.js → sheet-service.web.js} +5 -1
- package/dist/web/sheet-snap.js +35 -0
- package/dist/{native/ui31.js → web/theme/theme-scheme.js} +2 -2
- package/dist/web/{ui35.js → toast-anchor.web.tsrx.js} +3 -3
- package/dist/web/transform.web.js +43 -0
- package/dist/web/translate.web.js +13 -0
- package/dist/web/ui.js +91 -53
- package/dist/web/use-back.web.tsrx.js +9 -0
- package/dist/web/video-chrome.web.tsrx.js +207 -0
- package/dist/web/{ui34.js → web/Hoverable.web.tsrx.js} +6 -6
- package/dist/web/web/Tooltip.web.tsrx.js +183 -0
- package/dist/web/web/index.js +3 -0
- package/package.json +30 -3
- package/src/theme/tokens.css +1380 -200
- package/types/android.d.ts +53 -0
- package/types/index.d.ts +32 -17
- package/types/index.native.d.ts +273 -0
- package/types/index.web.d.ts +272 -0
- package/types/ios.d.ts +59 -0
- package/types/native.d.ts +5 -0
- package/types/props.d.ts +930 -40
- package/types/web.d.ts +17 -0
- package/dist/native/ui10.js +0 -32
- package/dist/native/ui25.js +0 -141
- package/dist/native/ui27.js +0 -61
- package/dist/native/ui39.js +0 -103
- package/dist/native/ui4.js +0 -24
- package/dist/native/ui46.js +0 -267
- package/dist/native/ui57.js +0 -19
- package/dist/native/ui60.js +0 -14
- package/dist/native/ui7.js +0 -52
- package/dist/web/ui10.js +0 -46
- package/dist/web/ui11.js +0 -42
- package/dist/web/ui22.js +0 -108
- package/dist/web/ui23.js +0 -96
- package/dist/web/ui26.js +0 -45
- package/dist/web/ui3.js +0 -31
- package/dist/web/ui30.js +0 -34
- package/dist/web/ui41.js +0 -43
- package/dist/web/ui44.js +0 -42
- package/dist/web/ui5.js +0 -168
- package/dist/web/ui51.js +0 -47
- package/dist/web/ui52.js +0 -19
- package/dist/web/ui55.js +0 -17
- package/dist/web/ui59.js +0 -44
- package/dist/web/ui6.js +0 -94
- package/dist/web/ui7.js +0 -62
- package/dist/web/ui8.js +0 -46
- package/dist/web/ui9.js +0 -46
- /package/dist/native/{ui20.js → RouteHost.native.tsrx.js} +0 -0
- /package/dist/native/{ui41.js → anim.native.tsrx.js} +0 -0
- /package/dist/native/{ui2.js → cx.js} +0 -0
- /package/dist/native/{ui3.js → escape-props.native.js} +0 -0
- /package/dist/native/{ui5.js → layout-child.native.js} +0 -0
- /package/dist/native/{ui54.js → meter-math.js} +0 -0
- /package/dist/native/{ui36.js → platformProps.native.js} +0 -0
- /package/dist/native/{ui37.js → popover-position.js} +0 -0
- /package/dist/native/{ui19.js → route-table.js} +0 -0
- /package/dist/native/{ui48.js → safeAreaInsets.native.tsrx.js} +0 -0
- /package/dist/native/{ui18.js → stacks.native.js} +0 -0
- /package/dist/native/{ui61.js → store.js} +0 -0
- /package/dist/native/{ui43.js → styled.native.tsrx.js} +0 -0
- /package/dist/native/{ui28.js → svg.native.js} +0 -0
- /package/dist/native/{ui30.js → theme/colorScheme.native.js} +0 -0
- /package/dist/native/{ui62.js → use-store.native.tsrx.js} +0 -0
- /package/dist/native/{ui44.js → windows.native.js} +0 -0
- /package/dist/web/{ui16.js → Link.web.tsrx.js} +0 -0
- /package/dist/web/{ui28.js → cx.js} +0 -0
- /package/dist/web/{ui2.js → escape-props.web.js} +0 -0
- /package/dist/web/{ui4.js → layout-child.web.js} +0 -0
- /package/dist/web/{ui49.js → meter-math.js} +0 -0
- /package/dist/web/{ui47.js → platformProps.web.js} +0 -0
- /package/dist/web/{ui32.js → popover-position.js} +0 -0
- /package/dist/web/{ui17.js → route-table.js} +0 -0
- /package/dist/web/{ui42.js → safeAreaInsets.web.tsrx.js} +0 -0
- /package/dist/web/{ui56.js → stacks.web.js} +0 -0
- /package/dist/web/{ui57.js → store.js} +0 -0
- /package/dist/web/{ui37.js → styled.web.tsrx.js} +0 -0
- /package/dist/web/{ui27.js → theme/colorScheme.web.js} +0 -0
- /package/dist/web/{ui58.js → use-store.web.tsrx.js} +0 -0
- /package/dist/web/{ui46.js → useMeasure.web.tsrx.js} +0 -0
- /package/dist/web/{ui38.js → windows.web.js} +0 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { getStack, onStackRegistered, stackEntries } from "./
|
|
2
|
-
import { RouteRedirect, buildRoutePath, layoutChain, linkPath, matchUrl } from "./
|
|
3
|
-
import { RouteHost } from "./
|
|
1
|
+
import { getStack, onStackRegistered, stackEntries } from "./stacks.native.js";
|
|
2
|
+
import { RouteRedirect, buildRoutePath, layoutChain, linkPath, matchUrl } from "./route-table.js";
|
|
3
|
+
import { RouteHost } from "./RouteHost.native.tsrx.js";
|
|
4
|
+
import { modalPresenter } from "./modal-presenter.native.js";
|
|
4
5
|
import { createNativeScriptRoot } from "@nativescript-community/octane";
|
|
5
6
|
import { Application, GridLayout, Page } from "@nativescript/core";
|
|
6
7
|
import { hookSlots as hookSlots$1, useSyncExternalStore as useSyncExternalStore$1 } from "octane";
|
|
@@ -34,6 +35,7 @@ var routeLoaders = {};
|
|
|
34
35
|
function registerScreens(table, manifest) {
|
|
35
36
|
screens = table;
|
|
36
37
|
routes = manifest ?? [];
|
|
38
|
+
ensureBackWired();
|
|
37
39
|
}
|
|
38
40
|
/** One-call registration for route-dir apps — screens + URL patterns +
|
|
39
41
|
* layouts all come from deriveRouteManifest. */
|
|
@@ -69,7 +71,11 @@ function warnOnce(key, msg) {
|
|
|
69
71
|
function trackFrame(frame) {
|
|
70
72
|
if (tracked.has(frame)) return;
|
|
71
73
|
tracked.add(frame);
|
|
72
|
-
frame.on("navigatedTo",
|
|
74
|
+
frame.on("navigatedTo", () => {
|
|
75
|
+
const page = frame.currentPage;
|
|
76
|
+
if (page && page.isLoaded === false) page.callLoaded?.();
|
|
77
|
+
emit();
|
|
78
|
+
});
|
|
73
79
|
}
|
|
74
80
|
function resolveStack(stack) {
|
|
75
81
|
const frame = getStack(stack);
|
|
@@ -78,11 +84,83 @@ function resolveStack(stack) {
|
|
|
78
84
|
}
|
|
79
85
|
onStackRegistered((_name, frame) => {
|
|
80
86
|
trackFrame(frame);
|
|
87
|
+
ensureBackWired();
|
|
81
88
|
emit();
|
|
82
89
|
});
|
|
83
90
|
var modalHosts = [];
|
|
84
91
|
var swapTabRoutes = /* @__PURE__ */ new Map();
|
|
85
92
|
var swapTabOrder = [];
|
|
93
|
+
/** App-supplied interceptors, consulted most-recent-first before the
|
|
94
|
+
* framework's default stack pop. Return true to consume the press. */
|
|
95
|
+
var backInterceptors = [];
|
|
96
|
+
var backWired = false;
|
|
97
|
+
/** Register an Android hardware-back interceptor. Interceptors run
|
|
98
|
+
* most-recent-first (so the topmost mounted screen wins) before the
|
|
99
|
+
* framework's default pop; returning true consumes the press. Returns
|
|
100
|
+
* an unsubscribe. iOS has no hardware back — interceptors simply never
|
|
101
|
+
* fire there. */
|
|
102
|
+
function addBackInterceptor(fn) {
|
|
103
|
+
backInterceptors.push(fn);
|
|
104
|
+
return () => {
|
|
105
|
+
const i = backInterceptors.indexOf(fn);
|
|
106
|
+
if (i !== -1) backInterceptors.splice(i, 1);
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
/** Framework-owned default: the newest open modal, then the root stack's
|
|
110
|
+
* pushed page (a root push covers the shell), then the most recently
|
|
111
|
+
* used swap-pane stack, then any registered named stack that can pop.
|
|
112
|
+
* Returns false at the base of everything — the press falls through to
|
|
113
|
+
* the system (app exit). NS's own default pops `Frame.topmost()` — the
|
|
114
|
+
* innermost frame — which is wrong once nested stacks exist, so this
|
|
115
|
+
* ordering is deliberate. */
|
|
116
|
+
function defaultBackPress() {
|
|
117
|
+
const modal = modalHosts[modalHosts.length - 1];
|
|
118
|
+
if (modal) {
|
|
119
|
+
popRoute(modal.route.stack);
|
|
120
|
+
return true;
|
|
121
|
+
}
|
|
122
|
+
if (canGoBack("root")) {
|
|
123
|
+
popRoute("root");
|
|
124
|
+
return true;
|
|
125
|
+
}
|
|
126
|
+
for (const name of [...swapTabOrder].reverse()) if (canGoBack(name)) {
|
|
127
|
+
popRoute(name);
|
|
128
|
+
return true;
|
|
129
|
+
}
|
|
130
|
+
for (const [name] of [...stackEntries()].reverse()) {
|
|
131
|
+
if (name === "root") continue;
|
|
132
|
+
if (canGoBack(name)) {
|
|
133
|
+
popRoute(name);
|
|
134
|
+
return true;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
return false;
|
|
138
|
+
}
|
|
139
|
+
/** Install the Android activityBackPressed listener once. Called from
|
|
140
|
+
* registerScreens and from stack registration, so any app shape that
|
|
141
|
+
* can navigate (screens or stacks registered) is covered without a
|
|
142
|
+
* module-import-time read of Application.android. The subscription is
|
|
143
|
+
* singletoned on the Application object: under vite HMR this module's
|
|
144
|
+
* state resets but the listener must not duplicate — the press handler
|
|
145
|
+
* delegates through a slot so a reloaded module graph swaps in its fresh
|
|
146
|
+
* closures instead of double-popping. */
|
|
147
|
+
function ensureBackWired() {
|
|
148
|
+
if (backWired || !Application.android) return;
|
|
149
|
+
backWired = true;
|
|
150
|
+
const app = Application;
|
|
151
|
+
app.__octaneXplatBackPress = (e) => {
|
|
152
|
+
for (let i = backInterceptors.length - 1; i >= 0; i--) if (backInterceptors[i]()) {
|
|
153
|
+
e.cancel = true;
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
if (defaultBackPress()) e.cancel = true;
|
|
157
|
+
};
|
|
158
|
+
if (app.__octaneXplatBackWired) return;
|
|
159
|
+
app.__octaneXplatBackWired = true;
|
|
160
|
+
Application.android.on(Application.AndroidApplication.activityBackPressedEvent, (e) => {
|
|
161
|
+
app.__octaneXplatBackPress?.(e);
|
|
162
|
+
});
|
|
163
|
+
}
|
|
86
164
|
function presentationFor(name) {
|
|
87
165
|
return routes.find((m) => m.name === name)?.presentation;
|
|
88
166
|
}
|
|
@@ -164,7 +242,7 @@ function commitRoute(r) {
|
|
|
164
242
|
else warnOnce("modal:" + r.name, `modal route '${r.name}' dropped — no loaded presenter Frame.`);
|
|
165
243
|
return;
|
|
166
244
|
}
|
|
167
|
-
if (
|
|
245
|
+
if (r.stack !== "root" && (Application.android || !resolveStack(r.stack))) {
|
|
168
246
|
const entries = swapTabRoutes.get(r.stack) ?? [];
|
|
169
247
|
entries.push({
|
|
170
248
|
...r,
|
|
@@ -236,7 +314,13 @@ function pushModal(frame, r, C) {
|
|
|
236
314
|
modalHosts.splice(i, 1);
|
|
237
315
|
emit();
|
|
238
316
|
};
|
|
239
|
-
const presenter = frame
|
|
317
|
+
const presenter = modalPresenter(frame);
|
|
318
|
+
if (!presenter) {
|
|
319
|
+
warnOnce("modal-presenter:" + r.name, `modal route '${r.name}' dropped — no live presenter. The stack's currentPage is mid-navigation; retry once the transition settles.`);
|
|
320
|
+
entry.dismiss();
|
|
321
|
+
root.unmount?.();
|
|
322
|
+
return;
|
|
323
|
+
}
|
|
240
324
|
try {
|
|
241
325
|
modalHosts.push(entry);
|
|
242
326
|
const params = {
|
|
@@ -276,7 +360,7 @@ function popRoute(stack = "root") {
|
|
|
276
360
|
modal.host.closeModal?.();
|
|
277
361
|
return;
|
|
278
362
|
}
|
|
279
|
-
if (
|
|
363
|
+
if (stack !== "root" && (Application.android || !resolveStack(stack))) {
|
|
280
364
|
const entries = swapTabRoutes.get(stack);
|
|
281
365
|
if (entries?.length) {
|
|
282
366
|
entries.pop();
|
|
@@ -298,7 +382,7 @@ function popRoute(stack = "root") {
|
|
|
298
382
|
}
|
|
299
383
|
/** Route stamped on a stack's current page, or null at its base page. */
|
|
300
384
|
function routeFor(stack) {
|
|
301
|
-
if (
|
|
385
|
+
if (stack !== "root" && (Application.android || !resolveStack(stack))) {
|
|
302
386
|
const entries = swapTabRoutes.get(stack);
|
|
303
387
|
if (entries?.length) return entries[entries.length - 1];
|
|
304
388
|
}
|
|
@@ -325,7 +409,7 @@ function currentRoute() {
|
|
|
325
409
|
}
|
|
326
410
|
/** Named stacks containing routes, including Android's swap-pane stacks. */
|
|
327
411
|
function routeStacks() {
|
|
328
|
-
return
|
|
412
|
+
return [.../* @__PURE__ */ new Set([...swapTabOrder, ...[...stackEntries()].map(([name]) => name)])];
|
|
329
413
|
}
|
|
330
414
|
/** The modal route currently open, if any — parity with the web leaf. */
|
|
331
415
|
function currentModalRoute() {
|
|
@@ -359,8 +443,8 @@ function useRoute(stack) {
|
|
|
359
443
|
* entry) that can be popped. The modal root is also a back affordance. */
|
|
360
444
|
function canGoBack(stack = "root") {
|
|
361
445
|
if (modalHosts[modalHosts.length - 1]?.route.stack === stack) return true;
|
|
362
|
-
if (
|
|
363
|
-
return !!resolveStack(stack)?.
|
|
446
|
+
if (stack !== "root" && (Application.android || !resolveStack(stack))) return !!swapTabRoutes.get(stack)?.length;
|
|
447
|
+
return !!resolveStack(stack)?.backStack?.length;
|
|
364
448
|
}
|
|
365
449
|
function useCanGoBack(stack = "root") {
|
|
366
450
|
return useSyncExternalStore$1((cb) => {
|
|
@@ -380,4 +464,4 @@ var _h$0 = /* @__PURE__ */ Symbol(_hs$);
|
|
|
380
464
|
var _h$1 = /* @__PURE__ */ Symbol(_hs$ + 1);
|
|
381
465
|
var _h$2 = /* @__PURE__ */ Symbol(_hs$ + 2);
|
|
382
466
|
//#endregion
|
|
383
|
-
export { canGoBack, currentModalRoute, currentRoute, hrefFor, layoutsForRoute, popRoute, pushDeepLink, pushRoute, redirect, registerRoutes, registerScreens, routeFor, routeStacks, screenFor, useCanGoBack, useModalRoute, useRoute };
|
|
467
|
+
export { addBackInterceptor, canGoBack, currentModalRoute, currentRoute, hrefFor, layoutsForRoute, popRoute, pushDeepLink, pushRoute, redirect, registerRoutes, registerScreens, routeFor, routeStacks, screenFor, useCanGoBack, useModalRoute, useRoute };
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { detentOffset, normalizeDetents, snapDetentIndex } from "./sheet-snap.js";
|
|
2
|
+
import { FlexboxLayout, Screen } from "@nativescript/core";
|
|
3
|
+
//#region src/sheet-detents.native.ts
|
|
4
|
+
var SNAP_MS = 200;
|
|
5
|
+
/** Drag-to-snap detents on a RootLayout sheet host: a self-drawn grabber
|
|
6
|
+
* strip (top-aligned grid child — the only drag target, so it never
|
|
7
|
+
* fights inner scrolling) drives the host's translateY; the host is
|
|
8
|
+
* sized to the largest detent and parked at the offset for the current
|
|
9
|
+
* one. `closeNow` fires after the dismiss slide-out — the caller decides
|
|
10
|
+
* what closing means (declarative `onDismiss` via RootLayout 'closed',
|
|
11
|
+
* or the `openSheet` resolution).
|
|
12
|
+
*
|
|
13
|
+
* In-window on native: the OS detent presentations
|
|
14
|
+
* (UISheetPresentationController / BottomSheetBehavior via
|
|
15
|
+
* BottomSheetDialogFragment) host a modal VC or a separate dialog
|
|
16
|
+
* window — a different surface contract than the RootLayout child this
|
|
17
|
+
* sheet is (UIModal/MaterialDialog own the modal path), so the snap
|
|
18
|
+
* mechanics are self-drawn and identical to the web leaf. */
|
|
19
|
+
function attachSheetDetents(host, detents, closeNow) {
|
|
20
|
+
const sorted = normalizeDetents(detents);
|
|
21
|
+
if (!sorted.length) return {
|
|
22
|
+
detach: () => {},
|
|
23
|
+
enter: () => {}
|
|
24
|
+
};
|
|
25
|
+
const vh = () => host.parent?.getActualSize?.().height || Screen.mainScreen.heightDIPs;
|
|
26
|
+
const max = sorted[sorted.length - 1];
|
|
27
|
+
let cur = 0;
|
|
28
|
+
host.verticalAlignment = "bottom";
|
|
29
|
+
host.translateY = vh();
|
|
30
|
+
const grabber = new FlexboxLayout();
|
|
31
|
+
grabber.className = "vx-sheet-grabber";
|
|
32
|
+
grabber.verticalAlignment = "top";
|
|
33
|
+
const grip = new FlexboxLayout();
|
|
34
|
+
grip.className = "vx-sheet-grip";
|
|
35
|
+
grabber.addChild(grip);
|
|
36
|
+
host.addChild(grabber);
|
|
37
|
+
let dragging = false;
|
|
38
|
+
let dy0 = 0;
|
|
39
|
+
let ty0 = 0;
|
|
40
|
+
let vy = 0;
|
|
41
|
+
let lastDy = 0;
|
|
42
|
+
let lastT = 0;
|
|
43
|
+
const animateTo = (value, then) => {
|
|
44
|
+
const done = host.animate?.({
|
|
45
|
+
translate: {
|
|
46
|
+
x: 0,
|
|
47
|
+
y: value
|
|
48
|
+
},
|
|
49
|
+
duration: SNAP_MS
|
|
50
|
+
});
|
|
51
|
+
if (!then) return;
|
|
52
|
+
if (done?.then) done.then(() => then());
|
|
53
|
+
else setTimeout(then, SNAP_MS);
|
|
54
|
+
};
|
|
55
|
+
const end = () => {
|
|
56
|
+
if (!dragging) return;
|
|
57
|
+
dragging = false;
|
|
58
|
+
const next = snapDetentIndex(host.translateY, vy, sorted, vh());
|
|
59
|
+
if (next < 0) animateTo(vh(), closeNow);
|
|
60
|
+
else {
|
|
61
|
+
cur = next;
|
|
62
|
+
animateTo(detentOffset(sorted, cur, vh()));
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
const onPan = (e) => {
|
|
66
|
+
if (e.state === 1) {
|
|
67
|
+
dragging = true;
|
|
68
|
+
dy0 = e.deltaY;
|
|
69
|
+
ty0 = host.translateY;
|
|
70
|
+
vy = 0;
|
|
71
|
+
lastDy = e.deltaY;
|
|
72
|
+
lastT = Date.now();
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
if (e.state === 0 || e.state === 3) {
|
|
76
|
+
end();
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
if (!dragging) return;
|
|
80
|
+
const now = Date.now();
|
|
81
|
+
const dt = (now - lastT) / 1e3;
|
|
82
|
+
const inc = e.deltaY - lastDy;
|
|
83
|
+
if (dt > 0) vy = vy * .7 + inc / dt * .3;
|
|
84
|
+
lastDy = e.deltaY;
|
|
85
|
+
lastT = now;
|
|
86
|
+
host.translateY = Math.min(Math.max(ty0 + (e.deltaY - dy0), 0), vh());
|
|
87
|
+
};
|
|
88
|
+
grabber.on("pan", onPan);
|
|
89
|
+
return {
|
|
90
|
+
enter: () => {
|
|
91
|
+
host.height = max * vh();
|
|
92
|
+
host.translateY = vh();
|
|
93
|
+
animateTo(detentOffset(sorted, cur, vh()));
|
|
94
|
+
},
|
|
95
|
+
detach: () => {
|
|
96
|
+
grabber.off("pan", onPan);
|
|
97
|
+
if (grabber.parent === host) host.removeChild?.(grabber);
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
//#endregion
|
|
102
|
+
export { attachSheetDetents };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { applyThemeClasses } from "./
|
|
2
|
-
import { topRootLayout } from "./
|
|
1
|
+
import { applyThemeClasses } from "./theme/theme-scheme.js";
|
|
2
|
+
import { topRootLayout } from "./root-layout.native.js";
|
|
3
|
+
import { attachSheetDetents } from "./sheet-detents.native.js";
|
|
3
4
|
import { createNativeScriptRoot } from "@nativescript-community/octane";
|
|
4
5
|
import { GridLayout } from "@nativescript/core";
|
|
5
6
|
//#region src/sheet-service.native.ts
|
|
@@ -28,25 +29,34 @@ var openSheet = (Component, params, options = {}) => new Promise((resolve) => {
|
|
|
28
29
|
host.horizontalAlignment = "stretch";
|
|
29
30
|
host.verticalAlignment = "bottom";
|
|
30
31
|
const root = createNativeScriptRoot(host);
|
|
32
|
+
const detents = options.detents?.length ? attachSheetDetents(host, options.detents, () => finish()) : null;
|
|
31
33
|
let finished = false;
|
|
32
34
|
const finish = (result) => {
|
|
33
35
|
if (finished) return;
|
|
34
36
|
finished = true;
|
|
35
37
|
active.delete(entry);
|
|
36
38
|
unbindTheme();
|
|
39
|
+
detents?.detach();
|
|
37
40
|
root.unmount?.();
|
|
38
41
|
const owner = host.parent;
|
|
39
|
-
if (owner?.hasChild?.(host)
|
|
40
|
-
|
|
41
|
-
|
|
42
|
+
if (owner?.hasChild?.(host) && !closing) {
|
|
43
|
+
if (owner.getPopupIndex?.(host) === -1) owner.removeChild?.(host);
|
|
44
|
+
else (owner.close?.(host))?.catch((error) => {
|
|
45
|
+
console.error("[openSheet] close failed", error);
|
|
46
|
+
});
|
|
47
|
+
}
|
|
42
48
|
resolve(result);
|
|
43
49
|
};
|
|
50
|
+
let closing = false;
|
|
44
51
|
const entry = {
|
|
45
52
|
host,
|
|
46
53
|
root,
|
|
47
54
|
finish
|
|
48
55
|
};
|
|
49
|
-
host.on("closed", () =>
|
|
56
|
+
host.on("closed", () => {
|
|
57
|
+
closing = true;
|
|
58
|
+
finish();
|
|
59
|
+
});
|
|
50
60
|
root.render(Component, {
|
|
51
61
|
params,
|
|
52
62
|
close: finish
|
|
@@ -57,7 +67,7 @@ var openSheet = (Component, params, options = {}) => new Promise((resolve) => {
|
|
|
57
67
|
opacity: .4,
|
|
58
68
|
tapToClose: true
|
|
59
69
|
} } : {},
|
|
60
|
-
animation: {
|
|
70
|
+
...detents ? {} : { animation: {
|
|
61
71
|
enterFrom: {
|
|
62
72
|
translateY: 400,
|
|
63
73
|
duration: 250
|
|
@@ -66,8 +76,8 @@ var openSheet = (Component, params, options = {}) => new Promise((resolve) => {
|
|
|
66
76
|
translateY: 400,
|
|
67
77
|
duration: 200
|
|
68
78
|
}
|
|
69
|
-
}
|
|
70
|
-
}).catch((error) => {
|
|
79
|
+
} }
|
|
80
|
+
}).then(() => detents?.enter()).catch((error) => {
|
|
71
81
|
console.error("[openSheet] open failed", error);
|
|
72
82
|
finish();
|
|
73
83
|
});
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/** Sorted, filtered, deduped detent fractions. Empty → the caller keeps
|
|
2
|
+
* the content-sized sheet behavior (detents off). */
|
|
3
|
+
function normalizeDetents(input) {
|
|
4
|
+
if (!input?.length) return [];
|
|
5
|
+
return [...new Set(input.filter((d) => d > 0 && d <= 1))].sort((a, b) => a - b);
|
|
6
|
+
}
|
|
7
|
+
/** Resting translateY for a detent: the panel is `max * vh` tall, so the
|
|
8
|
+
* portion below the screen edge is `(max - detent) * vh`. */
|
|
9
|
+
function detentOffset(detents, index, vh) {
|
|
10
|
+
return (detents[detents.length - 1] - detents[index]) * vh;
|
|
11
|
+
}
|
|
12
|
+
/** Snap target for a release at translateY `ty` with vertical velocity
|
|
13
|
+
* `vy` (positive = dragging down). Returns the detent index, or -1 to
|
|
14
|
+
* dismiss: released below half of the smallest detent, or a downward
|
|
15
|
+
* fling while at/below it. */
|
|
16
|
+
function snapDetentIndex(ty, vy, detents, vh) {
|
|
17
|
+
const max = detents[detents.length - 1];
|
|
18
|
+
const frac = Math.min(Math.max(max - ty / vh, 0), 1);
|
|
19
|
+
if (vy > 500) {
|
|
20
|
+
let i = -1;
|
|
21
|
+
while (i + 1 < detents.length && detents[i + 1] < frac - 1e-6) i++;
|
|
22
|
+
return i;
|
|
23
|
+
}
|
|
24
|
+
if (vy < -500) {
|
|
25
|
+
let i = detents.length - 1;
|
|
26
|
+
while (i - 1 >= 0 && detents[i - 1] > frac + 1e-6) i--;
|
|
27
|
+
return i;
|
|
28
|
+
}
|
|
29
|
+
if (frac < detents[0] * .5) return -1;
|
|
30
|
+
let best = 0;
|
|
31
|
+
for (let i = 1; i < detents.length; i++) if (Math.abs(detents[i] - frac) < Math.abs(detents[best] - frac)) best = i;
|
|
32
|
+
return best;
|
|
33
|
+
}
|
|
34
|
+
//#endregion
|
|
35
|
+
export { detentOffset, normalizeDetents, snapDetentIndex };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
//#region src/text-write.native.ts
|
|
2
|
+
/** Controlled `text` write for TextInput/TextArea leaves. The driver's
|
|
3
|
+
* generic prop path writes view.text verbatim; on Android the EditText
|
|
4
|
+
* setText resets the cursor to 0 on every controlled write. Park and
|
|
5
|
+
* restore the selection around the write (clamped to the new length so an
|
|
6
|
+
* append-shrink can't throw). iOS keeps the plain write — UITextField's
|
|
7
|
+
* text setter preserves the selected text range already.
|
|
8
|
+
* Returns without writing when the value already matches — the textChange
|
|
9
|
+
* echo of the user's own typing must not bounce back through setText. */
|
|
10
|
+
function writeText(view, value) {
|
|
11
|
+
const next = value ?? "";
|
|
12
|
+
if (!view || view.text === next) return;
|
|
13
|
+
const et = view.android;
|
|
14
|
+
if (!et) {
|
|
15
|
+
view.text = next;
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
const start = et.getSelectionStart?.() ?? -1;
|
|
19
|
+
const end = et.getSelectionEnd?.() ?? -1;
|
|
20
|
+
view.text = next;
|
|
21
|
+
if (start >= 0) {
|
|
22
|
+
const len = next.length;
|
|
23
|
+
et.setSelection(Math.min(start, len), Math.min(end >= 0 ? end : start, len));
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
//#endregion
|
|
27
|
+
export { writeText };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { getThemeScheme, onThemeSchemeChange } from "./
|
|
1
|
+
import { getThemeScheme, onThemeSchemeChange } from "./theme-scheme.js";
|
|
2
2
|
import { Application, Utils } from "@nativescript/core";
|
|
3
3
|
//#region src/theme/status-bar-scheme.native.ts
|
|
4
4
|
function applyStatusBarScheme() {
|
|
5
5
|
if (Application.android) {
|
|
6
|
-
Utils.setDarkModeHandler?.({ handler: () => getThemeScheme() === "dark" });
|
|
6
|
+
Utils.android.setDarkModeHandler?.({ handler: () => getThemeScheme() === "dark" });
|
|
7
7
|
return;
|
|
8
8
|
}
|
|
9
9
|
const style = getThemeScheme() === "dark" ? "light" : "dark";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { cx } from "../cx.js";
|
|
2
|
+
import { getColorScheme, subscribeSystemScheme } from "./colorScheme.native.js";
|
|
3
3
|
import { hookSlots, useSyncExternalStore } from "octane";
|
|
4
4
|
//#region src/theme/theme-scheme.ts
|
|
5
5
|
var preference = "system";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { applyThemeClasses } from "./
|
|
2
|
-
import { topRootLayout } from "./
|
|
3
|
-
import { Popover } from "./
|
|
1
|
+
import { applyThemeClasses } from "./theme/theme-scheme.js";
|
|
2
|
+
import { topRootLayout } from "./root-layout.native.js";
|
|
3
|
+
import { Popover } from "./Popover.native.tsrx.js";
|
|
4
4
|
import { createNativeScriptRoot, defineUniversalComponent, universalChildren, universalComponent, universalIf, universalPlan, universalProps, universalValue } from "@nativescript-community/octane";
|
|
5
5
|
import { GridLayout, isAndroid, isIOS } from "@nativescript/core";
|
|
6
6
|
//#region src/toast-anchor.native.tsrx
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
//#region src/translate.native.ts
|
|
2
|
+
/** Imperative translate write on a bound view — the gesture seam. NS
|
|
3
|
+
* views carry real translateX/translateY properties (dips), so the write
|
|
4
|
+
* is a direct prop set — synchronous on the UI thread. */
|
|
5
|
+
var setTranslate = (view, x = 0, y = 0) => {
|
|
6
|
+
if (!view) return;
|
|
7
|
+
view.translateX = x;
|
|
8
|
+
view.translateY = y;
|
|
9
|
+
};
|
|
10
|
+
//#endregion
|
|
11
|
+
export { setTranslate };
|
package/dist/native/ui.js
CHANGED
|
@@ -1,55 +1,93 @@
|
|
|
1
|
-
import { View } from "./
|
|
2
|
-
import { Row } from "./
|
|
3
|
-
import { Grid } from "./
|
|
4
|
-
import { Stack } from "./
|
|
5
|
-
import { Absolute } from "./
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import "./
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
49
|
-
import {
|
|
50
|
-
import {
|
|
51
|
-
import {
|
|
52
|
-
import {
|
|
53
|
-
import {
|
|
54
|
-
import {
|
|
55
|
-
|
|
1
|
+
import { View } from "./View.native.tsrx.js";
|
|
2
|
+
import { Row } from "./Row.native.tsrx.js";
|
|
3
|
+
import { Grid } from "./Grid.native.tsrx.js";
|
|
4
|
+
import { Stack } from "./Stack.native.tsrx.js";
|
|
5
|
+
import { Absolute } from "./Absolute.native.tsrx.js";
|
|
6
|
+
import { setTranslate } from "./translate.native.js";
|
|
7
|
+
import { Spacer } from "./Spacer.native.tsrx.js";
|
|
8
|
+
import { Text } from "./Text.native.tsrx.js";
|
|
9
|
+
import { RichText, RichTextSpan } from "./RichText.native.tsrx.js";
|
|
10
|
+
import { Pressable } from "./Pressable.native.tsrx.js";
|
|
11
|
+
import { ActivityIndicator } from "./ActivityIndicator.native.tsrx.js";
|
|
12
|
+
import { Button } from "./Button.native.tsrx.js";
|
|
13
|
+
import { Collapsible } from "./Collapsible.native.tsrx.js";
|
|
14
|
+
import { Accordion } from "./Accordion.native.tsrx.js";
|
|
15
|
+
import { Checkbox } from "./Checkbox.native.tsrx.js";
|
|
16
|
+
import { RadioGroup } from "./RadioGroup.native.tsrx.js";
|
|
17
|
+
import { getColorScheme, useColorScheme } from "./theme/colorScheme.native.js";
|
|
18
|
+
import { applyThemeClasses, getThemePreference, getThemeScheme, onThemeSchemeChange, setThemePreference, themeSchemeClasses, useThemeScheme } from "./theme/theme-scheme.js";
|
|
19
|
+
import { Popover } from "./Popover.native.tsrx.js";
|
|
20
|
+
import { registerIcon, registerIcons } from "./icons.js";
|
|
21
|
+
import { Icon } from "./Icon.native.tsrx.js";
|
|
22
|
+
import { DropdownMenu } from "./DropdownMenu.native.tsrx.js";
|
|
23
|
+
import { ContextMenu } from "./ContextMenu.native.tsrx.js";
|
|
24
|
+
import { Badge } from "./Badge.native.tsrx.js";
|
|
25
|
+
import { Separator } from "./Separator.native.tsrx.js";
|
|
26
|
+
import { Skeleton } from "./Skeleton.native.tsrx.js";
|
|
27
|
+
import { Image } from "./Image.native.tsrx.js";
|
|
28
|
+
import { Avatar } from "./Avatar.native.tsrx.js";
|
|
29
|
+
import { AvatarGroup } from "./AvatarGroup.native.tsrx.js";
|
|
30
|
+
import { FormField } from "./FormField.native.tsrx.js";
|
|
31
|
+
import { FieldGroup } from "./FieldGroup.native.tsrx.js";
|
|
32
|
+
import { TextInput } from "./TextInput.native.tsrx.js";
|
|
33
|
+
import { InputNumber } from "./InputNumber.native.tsrx.js";
|
|
34
|
+
import { PinInput } from "./PinInput.native.tsrx.js";
|
|
35
|
+
import { Select } from "./Select.native.tsrx.js";
|
|
36
|
+
import { Combobox, InputMenu, SelectMenu } from "./aliases.native.tsrx.js";
|
|
37
|
+
import { InputTags } from "./InputTags.native.tsrx.js";
|
|
38
|
+
import { InputRating } from "./InputRating.native.tsrx.js";
|
|
39
|
+
import { CheckboxGroup } from "./CheckboxGroup.native.tsrx.js";
|
|
40
|
+
import { Breadcrumb } from "./Breadcrumb.native.tsrx.js";
|
|
41
|
+
import { Pagination } from "./Pagination.native.tsrx.js";
|
|
42
|
+
import { Stepper } from "./Stepper.native.tsrx.js";
|
|
43
|
+
import { NavigationMenu } from "./NavigationMenu.native.tsrx.js";
|
|
44
|
+
import { Overlay } from "./Overlay.native.tsrx.js";
|
|
45
|
+
import { CommandPalette } from "./CommandPalette.native.tsrx.js";
|
|
46
|
+
import { Table } from "./Table.native.tsrx.js";
|
|
47
|
+
import { Timeline } from "./Timeline.native.tsrx.js";
|
|
48
|
+
import { Tree } from "./Tree.native.tsrx.js";
|
|
49
|
+
import { Alert } from "./Alert.native.tsrx.js";
|
|
50
|
+
import { Card } from "./Card.native.tsrx.js";
|
|
51
|
+
import { Chip } from "./Chip.native.tsrx.js";
|
|
52
|
+
import { Kbd } from "./Kbd.native.tsrx.js";
|
|
53
|
+
import { Empty } from "./Empty.native.tsrx.js";
|
|
54
|
+
import { Banner } from "./Banner.native.tsrx.js";
|
|
55
|
+
import { User } from "./User.native.tsrx.js";
|
|
56
|
+
import { Meter } from "./Meter.native.tsrx.js";
|
|
57
|
+
import { ProgressGroup } from "./ProgressGroup.native.tsrx.js";
|
|
58
|
+
import { Link } from "./Link.native.tsrx.js";
|
|
59
|
+
import { getStack, registerStack, stackEntries } from "./stacks.native.js";
|
|
60
|
+
import { deriveRouteManifest } from "./route-table.js";
|
|
61
|
+
import { addBackInterceptor, canGoBack, currentModalRoute, currentRoute, hrefFor, popRoute, pushDeepLink, pushRoute, redirect, registerRoutes, registerScreens, routeFor, routeStacks, screenFor, useCanGoBack, useModalRoute, useRoute } from "./route.native.js";
|
|
62
|
+
import { NavLink } from "./NavLink.native.tsrx.js";
|
|
63
|
+
import { TextArea } from "./TextArea.native.tsrx.js";
|
|
64
|
+
import { SearchInput } from "./SearchInput.native.tsrx.js";
|
|
65
|
+
import { SegmentedControl } from "./SegmentedControl.native.tsrx.js";
|
|
66
|
+
import { ScrollBox } from "./ScrollBox.native.tsrx.js";
|
|
67
|
+
import { ScrollView } from "./ScrollView.native.tsrx.js";
|
|
68
|
+
import { Pager } from "./Pager.native.tsrx.js";
|
|
69
|
+
import { WebView } from "./WebView.native.tsrx.js";
|
|
70
|
+
import { useMeasure } from "./useMeasure.native.tsrx.js";
|
|
71
|
+
import { Slider } from "./Slider.native.tsrx.js";
|
|
72
|
+
import { Video } from "./Video.native.tsrx.js";
|
|
73
|
+
import { CameraView } from "./CameraView.native.tsrx.js";
|
|
74
|
+
import { showToast } from "./toast-anchor.native.tsrx.js";
|
|
75
|
+
import { useAnimation } from "./anim.native.tsrx.js";
|
|
76
|
+
import "./theme/status-bar-scheme.native.js";
|
|
77
|
+
import { styled } from "./styled.native.tsrx.js";
|
|
78
|
+
import { openWindow } from "./windows.native.js";
|
|
79
|
+
import { Screen } from "./Screen.native.tsrx.js";
|
|
80
|
+
import { Tabs } from "./Tabs.native.tsrx.js";
|
|
81
|
+
import { Switch } from "./Switch.native.tsrx.js";
|
|
82
|
+
import { useSafeAreaInsets } from "./safeAreaInsets.native.tsrx.js";
|
|
83
|
+
import { SafeArea } from "./SafeArea.native.tsrx.js";
|
|
84
|
+
import { KeyboardAvoiding } from "./KeyboardAvoiding.native.tsrx.js";
|
|
85
|
+
import { Drawer } from "./Drawer.native.tsrx.js";
|
|
86
|
+
import { Heading } from "./Heading.native.tsrx.js";
|
|
87
|
+
import { isNative } from "./platform.native.js";
|
|
88
|
+
import { useBackInterceptor } from "./use-back.native.tsrx.js";
|
|
89
|
+
import { createStore } from "./store.js";
|
|
90
|
+
import { useStore } from "./use-store.native.tsrx.js";
|
|
91
|
+
import { Sheet } from "./Sheet.native.tsrx.js";
|
|
92
|
+
import { closeSheet, openSheet } from "./sheet-service.native.js";
|
|
93
|
+
export { Absolute, Accordion, ActivityIndicator, Alert, Avatar, AvatarGroup, Badge, Banner, Breadcrumb, Button, CameraView, Card, Checkbox, CheckboxGroup, Chip, Collapsible, View as Column, Combobox, CommandPalette, ContextMenu, Drawer, DropdownMenu, Empty, FieldGroup, FormField, Grid, Heading, Icon, Image, InputMenu, InputNumber, InputRating, InputTags, Kbd, KeyboardAvoiding, Link, Meter, NavLink, NavigationMenu, Overlay, Pager, Pagination, PinInput, Popover, Pressable, ProgressGroup, RadioGroup, RichText, RichTextSpan, Row, SafeArea, Screen, ScrollBox, ScrollView, SearchInput, SegmentedControl, Select, SelectMenu, Separator, Sheet, Skeleton, Slider, Spacer, Stack, Stepper, Switch, Table, Tabs, Text, TextArea, TextInput, Timeline, Tree, User, Video, View, WebView, addBackInterceptor, applyThemeClasses, canGoBack, closeSheet, createStore, currentModalRoute, currentRoute, deriveRouteManifest, getColorScheme, getStack, getThemePreference, getThemeScheme, hrefFor, isNative, onThemeSchemeChange, openSheet, openWindow, popRoute, pushDeepLink, pushRoute, redirect, registerIcon, registerIcons, registerRoutes, registerScreens, registerStack, routeFor, routeStacks, screenFor, setThemePreference, setTranslate, showToast, stackEntries, styled, themeSchemeClasses, useAnimation, useBackInterceptor, useCanGoBack, useColorScheme, useMeasure, useModalRoute, useRoute, useSafeAreaInsets, useStore, useThemeScheme };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { addBackInterceptor } from "./route.native.js";
|
|
2
|
+
import { hookSlots, useEffect } from "@nativescript-community/octane";
|
|
3
|
+
//#region src/use-back.native.tsrx
|
|
4
|
+
var _h$0 = /* @__PURE__ */ Symbol(/* @__PURE__ */ hookSlots(1));
|
|
5
|
+
function useBackInterceptor(fn) {
|
|
6
|
+
useEffect(() => addBackInterceptor(fn), [fn], _h$0);
|
|
7
|
+
}
|
|
8
|
+
//#endregion
|
|
9
|
+
export { useBackInterceptor };
|
|
@@ -30,7 +30,7 @@ function useMeasure(options = {}) {
|
|
|
30
30
|
}
|
|
31
31
|
const update = () => {
|
|
32
32
|
const next = readBounds(view);
|
|
33
|
-
|
|
33
|
+
setBounds((prev) => prev && next && prev.x === next.x && prev.y === next.y && prev.width === next.width && prev.height === next.height ? prev : next);
|
|
34
34
|
};
|
|
35
35
|
const onLoaded = update;
|
|
36
36
|
view.on?.("loaded", onLoaded);
|