@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
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
import { cx } from "../cx.js";
|
|
2
|
+
import { ActivityIndicator } from "../ActivityIndicator.native.tsrx.js";
|
|
3
|
+
import { createPullToRefresh } from "../refresh.native.js";
|
|
4
|
+
import { defineUniversalComponent, hookSlots, memo, universalComponent, universalIf, universalPlan, universalProps, universalValue, useEffect, useRef } from "@nativescript-community/octane";
|
|
5
|
+
import { ScrollView } from "@nativescript/core";
|
|
6
|
+
//#region src/ios/UITableView.ios.tsrx
|
|
7
|
+
var _hs$ = /* @__PURE__ */ hookSlots(7);
|
|
8
|
+
var _h$0 = /* @__PURE__ */ Symbol(_hs$);
|
|
9
|
+
var _h$1 = /* @__PURE__ */ Symbol(_hs$ + 1);
|
|
10
|
+
var _h$2 = /* @__PURE__ */ Symbol(_hs$ + 2);
|
|
11
|
+
var _h$3 = /* @__PURE__ */ Symbol(_hs$ + 3);
|
|
12
|
+
var _h$4 = /* @__PURE__ */ Symbol(_hs$ + 4);
|
|
13
|
+
var _h$5 = /* @__PURE__ */ Symbol(_hs$ + 5);
|
|
14
|
+
var _h$6 = /* @__PURE__ */ Symbol(_hs$ + 6);
|
|
15
|
+
var __octaneUniversalPlan0 = universalPlan("nativescript", {
|
|
16
|
+
"kind": "host",
|
|
17
|
+
"type": "gridlayout",
|
|
18
|
+
"children": [{
|
|
19
|
+
"kind": "slot",
|
|
20
|
+
"slot": 0
|
|
21
|
+
}]
|
|
22
|
+
});
|
|
23
|
+
var __octaneUniversalPlan1 = universalPlan("nativescript", {
|
|
24
|
+
"kind": "host",
|
|
25
|
+
"type": "listview",
|
|
26
|
+
"propsSlot": 0
|
|
27
|
+
});
|
|
28
|
+
var __octaneUniversalPlan2 = universalPlan("nativescript", {
|
|
29
|
+
"kind": "host",
|
|
30
|
+
"type": "gridlayout",
|
|
31
|
+
"bindings": [
|
|
32
|
+
["ref", 0],
|
|
33
|
+
["className", 1],
|
|
34
|
+
["style", 2]
|
|
35
|
+
],
|
|
36
|
+
"children": [{
|
|
37
|
+
"kind": "slot",
|
|
38
|
+
"slot": 3
|
|
39
|
+
}, {
|
|
40
|
+
"kind": "host",
|
|
41
|
+
"type": "flexboxlayout",
|
|
42
|
+
"props": {
|
|
43
|
+
"className": "vx-refresh",
|
|
44
|
+
"verticalAlignment": "top"
|
|
45
|
+
},
|
|
46
|
+
"bindings": [
|
|
47
|
+
["ref", 4],
|
|
48
|
+
["height", 5],
|
|
49
|
+
["translateY", 6]
|
|
50
|
+
],
|
|
51
|
+
"children": [{
|
|
52
|
+
"kind": "slot",
|
|
53
|
+
"slot": 7
|
|
54
|
+
}]
|
|
55
|
+
}]
|
|
56
|
+
});
|
|
57
|
+
var __octaneUniversalPlan3 = universalPlan("nativescript", {
|
|
58
|
+
"kind": "slot",
|
|
59
|
+
"slot": 0
|
|
60
|
+
});
|
|
61
|
+
var __octaneUniversalPlan4 = universalPlan("nativescript", {
|
|
62
|
+
"kind": "slot",
|
|
63
|
+
"slot": 0
|
|
64
|
+
});
|
|
65
|
+
var __octaneUniversalPlan5 = universalPlan("nativescript", {
|
|
66
|
+
"kind": "range",
|
|
67
|
+
"children": [{
|
|
68
|
+
"kind": "slot",
|
|
69
|
+
"slot": 0
|
|
70
|
+
}]
|
|
71
|
+
});
|
|
72
|
+
var __octaneUniversalPlan6 = universalPlan("nativescript", {
|
|
73
|
+
"kind": "slot",
|
|
74
|
+
"slot": 0
|
|
75
|
+
});
|
|
76
|
+
function rejectNestedScrollView(event) {
|
|
77
|
+
let parent = event.object?.parent;
|
|
78
|
+
while (parent) {
|
|
79
|
+
if (parent instanceof ScrollView) throw new Error("[UITableView] cannot be nested inside native ScrollView. Use ScrollBox so the list owns scrolling.");
|
|
80
|
+
parent = parent.parent;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
var UITableViewInner = defineUniversalComponent("nativescript", function UITableViewInner(props) {
|
|
84
|
+
const lv = useRef(null, _h$0);
|
|
85
|
+
useEffect(() => {
|
|
86
|
+
const bag = props.refresh;
|
|
87
|
+
if (!bag || !lv.current) return;
|
|
88
|
+
bag.ctl.current = createPullToRefresh({
|
|
89
|
+
scroller: lv.current,
|
|
90
|
+
indicator: bag.indicator.current,
|
|
91
|
+
isAtTop: () => true,
|
|
92
|
+
cfg: bag.cfg
|
|
93
|
+
});
|
|
94
|
+
return () => {
|
|
95
|
+
bag.ctl.current?.detach();
|
|
96
|
+
bag.ctl.current = null;
|
|
97
|
+
};
|
|
98
|
+
}, [], _h$1);
|
|
99
|
+
return universalValue(__octaneUniversalPlan1, [universalProps([
|
|
100
|
+
[
|
|
101
|
+
"set",
|
|
102
|
+
"ref",
|
|
103
|
+
(v) => {
|
|
104
|
+
lv.current = v;
|
|
105
|
+
}
|
|
106
|
+
],
|
|
107
|
+
[
|
|
108
|
+
"set",
|
|
109
|
+
"id",
|
|
110
|
+
props.id
|
|
111
|
+
],
|
|
112
|
+
[
|
|
113
|
+
"set",
|
|
114
|
+
"className",
|
|
115
|
+
cx(props.className)
|
|
116
|
+
],
|
|
117
|
+
[
|
|
118
|
+
"set",
|
|
119
|
+
"style",
|
|
120
|
+
props.style
|
|
121
|
+
],
|
|
122
|
+
[
|
|
123
|
+
"set",
|
|
124
|
+
"items",
|
|
125
|
+
props.items
|
|
126
|
+
],
|
|
127
|
+
[
|
|
128
|
+
"set",
|
|
129
|
+
"iosEstimatedRowHeight",
|
|
130
|
+
props.estimatedItemHeight
|
|
131
|
+
],
|
|
132
|
+
[
|
|
133
|
+
"set",
|
|
134
|
+
"onLoadMoreItems",
|
|
135
|
+
props.onEndReached
|
|
136
|
+
],
|
|
137
|
+
[
|
|
138
|
+
"set",
|
|
139
|
+
"onLoaded",
|
|
140
|
+
rejectNestedScrollView
|
|
141
|
+
],
|
|
142
|
+
[
|
|
143
|
+
"set",
|
|
144
|
+
"renderItem",
|
|
145
|
+
(item, index) => universalValue(__octaneUniversalPlan0, [props.renderItem(item, index)])
|
|
146
|
+
],
|
|
147
|
+
["spread", props.ios]
|
|
148
|
+
])]);
|
|
149
|
+
}, { "module": "@nativescript-community/octane" });
|
|
150
|
+
var MemoListView = memo(UITableViewInner, (a, b) => a.items === b.items && a.className === b.className && a.style === b.style && a.id === b.id && a.estimatedItemHeight === b.estimatedItemHeight && a.onEndReached === b.onEndReached && a.ios === b.ios && a.refresh === b.refresh);
|
|
151
|
+
var UITableView = defineUniversalComponent("nativescript", function UITableView(props) {
|
|
152
|
+
const refreshCapable = props.onRefresh != null || props.refreshing != null;
|
|
153
|
+
const cfg = useRef({}, _h$2);
|
|
154
|
+
cfg.current = {
|
|
155
|
+
onRefresh: props.onRefresh,
|
|
156
|
+
refreshing: props.refreshing,
|
|
157
|
+
threshold: props.refreshThreshold
|
|
158
|
+
};
|
|
159
|
+
const indicator = useRef(null, _h$3);
|
|
160
|
+
const ctl = useRef(null, _h$4);
|
|
161
|
+
const refresh = useRef({
|
|
162
|
+
cfg,
|
|
163
|
+
indicator,
|
|
164
|
+
ctl
|
|
165
|
+
}, _h$5);
|
|
166
|
+
useEffect(() => {
|
|
167
|
+
ctl.current?.sync();
|
|
168
|
+
}, [props.refreshing], _h$6);
|
|
169
|
+
return universalValue(__octaneUniversalPlan6, [universalIf(props.items.length > 0, () => {
|
|
170
|
+
return universalValue(__octaneUniversalPlan4, [universalIf(refreshCapable, () => {
|
|
171
|
+
return universalValue(__octaneUniversalPlan2, [
|
|
172
|
+
(v) => {
|
|
173
|
+
if (v?.ios) v.ios.clipsToBounds = true;
|
|
174
|
+
},
|
|
175
|
+
cx("vx-refresh-wrap", props.className),
|
|
176
|
+
props.style,
|
|
177
|
+
universalComponent("nativescript", MemoListView, universalProps([
|
|
178
|
+
[
|
|
179
|
+
"set",
|
|
180
|
+
"id",
|
|
181
|
+
props.id
|
|
182
|
+
],
|
|
183
|
+
[
|
|
184
|
+
"set",
|
|
185
|
+
"items",
|
|
186
|
+
props.items
|
|
187
|
+
],
|
|
188
|
+
[
|
|
189
|
+
"set",
|
|
190
|
+
"renderItem",
|
|
191
|
+
props.renderItem
|
|
192
|
+
],
|
|
193
|
+
[
|
|
194
|
+
"set",
|
|
195
|
+
"estimatedItemHeight",
|
|
196
|
+
props.estimatedItemHeight
|
|
197
|
+
],
|
|
198
|
+
[
|
|
199
|
+
"set",
|
|
200
|
+
"onEndReached",
|
|
201
|
+
props.onEndReached
|
|
202
|
+
],
|
|
203
|
+
[
|
|
204
|
+
"set",
|
|
205
|
+
"ios",
|
|
206
|
+
props.ios
|
|
207
|
+
],
|
|
208
|
+
[
|
|
209
|
+
"set",
|
|
210
|
+
"refresh",
|
|
211
|
+
refresh.current
|
|
212
|
+
]
|
|
213
|
+
])),
|
|
214
|
+
(v) => {
|
|
215
|
+
indicator.current = v;
|
|
216
|
+
},
|
|
217
|
+
64,
|
|
218
|
+
-64,
|
|
219
|
+
universalComponent("nativescript", ActivityIndicator, universalProps([]))
|
|
220
|
+
]);
|
|
221
|
+
}, () => {
|
|
222
|
+
return universalValue(__octaneUniversalPlan3, [universalComponent("nativescript", MemoListView, universalProps([
|
|
223
|
+
[
|
|
224
|
+
"set",
|
|
225
|
+
"id",
|
|
226
|
+
props.id
|
|
227
|
+
],
|
|
228
|
+
[
|
|
229
|
+
"set",
|
|
230
|
+
"items",
|
|
231
|
+
props.items
|
|
232
|
+
],
|
|
233
|
+
[
|
|
234
|
+
"set",
|
|
235
|
+
"className",
|
|
236
|
+
props.className
|
|
237
|
+
],
|
|
238
|
+
[
|
|
239
|
+
"set",
|
|
240
|
+
"style",
|
|
241
|
+
props.style
|
|
242
|
+
],
|
|
243
|
+
[
|
|
244
|
+
"set",
|
|
245
|
+
"renderItem",
|
|
246
|
+
props.renderItem
|
|
247
|
+
],
|
|
248
|
+
[
|
|
249
|
+
"set",
|
|
250
|
+
"estimatedItemHeight",
|
|
251
|
+
props.estimatedItemHeight
|
|
252
|
+
],
|
|
253
|
+
[
|
|
254
|
+
"set",
|
|
255
|
+
"onEndReached",
|
|
256
|
+
props.onEndReached
|
|
257
|
+
],
|
|
258
|
+
[
|
|
259
|
+
"set",
|
|
260
|
+
"ios",
|
|
261
|
+
props.ios
|
|
262
|
+
]
|
|
263
|
+
]))]);
|
|
264
|
+
})]);
|
|
265
|
+
}, () => {
|
|
266
|
+
return universalValue(__octaneUniversalPlan5, [props.renderEmpty?.()]);
|
|
267
|
+
})]);
|
|
268
|
+
}, { "module": "@nativescript-community/octane" });
|
|
269
|
+
//#endregion
|
|
270
|
+
export { UITableView };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { UISwitch } from "./UISwitch.ios.tsrx.js";
|
|
2
|
+
import { UISlider } from "./UISlider.ios.tsrx.js";
|
|
3
|
+
import { UIActivityIndicatorView } from "./UIActivityIndicatorView.ios.tsrx.js";
|
|
4
|
+
import { UITableView } from "./UITableView.ios.tsrx.js";
|
|
5
|
+
import { UITabBar } from "./UITabBar.ios.tsrx.js";
|
|
6
|
+
import { UIModal } from "./UIModal.ios.tsrx.js";
|
|
7
|
+
import { openModal } from "./openModal.ios.js";
|
|
8
|
+
import { SideDrawer } from "./SideDrawer.ios.tsrx.js";
|
|
9
|
+
import { LiquidGlass } from "./LiquidGlass.ios.tsrx.js";
|
|
10
|
+
import { LiquidGlassContainer } from "./LiquidGlassContainer.ios.tsrx.js";
|
|
11
|
+
export { LiquidGlass, LiquidGlassContainer, SideDrawer, UIActivityIndicatorView, UIModal, UISlider, UISwitch, UITabBar, UITableView, openModal };
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { applyThemeClasses } from "
|
|
1
|
+
import { applyThemeClasses } from "../theme/theme-scheme.js";
|
|
2
|
+
import { modalPresenter } from "../modal-presenter.native.js";
|
|
2
3
|
import { createNativeScriptRoot } from "@nativescript-community/octane";
|
|
3
4
|
import { Frame, GridLayout } from "@nativescript/core";
|
|
4
|
-
//#region src/
|
|
5
|
+
//#region src/ios/openModal.ios.ts
|
|
5
6
|
/** Open a component in its own NativeScript modal root and resolve on close. */
|
|
6
7
|
var openModal = (Component, params, options = {}) => new Promise((resolve, reject) => {
|
|
7
|
-
const presenter =
|
|
8
|
+
const presenter = modalPresenter(Frame.topmost());
|
|
8
9
|
if (!presenter) {
|
|
9
|
-
reject(/* @__PURE__ */ new Error("
|
|
10
|
+
reject(/* @__PURE__ */ new Error("openModal dropped — no live presenter. The topmost frame has no loaded currentPage (a page mid-navigation), or no frame is active yet."));
|
|
10
11
|
return;
|
|
11
12
|
}
|
|
12
13
|
const host = new GridLayout();
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
//#region src/modal-presenter.native.ts
|
|
2
|
+
/** Resolve the view `showModal` should present from: the frame's current
|
|
3
|
+
* page while it's live, else the frame itself. During push/pop churn
|
|
4
|
+
* `currentPage` can still point at a page that already left the window —
|
|
5
|
+
* presenting on a detached iOS VC silently drops the modal and its
|
|
6
|
+
* closeCallback never runs, hanging `openModal`/`Modal` forever. A page
|
|
7
|
+
* is a valid presenter only while it is loaded and still owned by the
|
|
8
|
+
* frame (`page.frame` is the page's parent link, cleared on detach).
|
|
9
|
+
* Returns null when nothing live can present — callers must surface that
|
|
10
|
+
* rather than presenting blind. `frame` is structural: `Frame.topmost()`
|
|
11
|
+
* types as FrameBase while stack registration hands over Frame. */
|
|
12
|
+
function modalPresenter(frame) {
|
|
13
|
+
if (!frame) return null;
|
|
14
|
+
const page = frame.currentPage;
|
|
15
|
+
if (page && page.isLoaded && page.frame === frame) return page;
|
|
16
|
+
return frame.isLoaded ? frame : null;
|
|
17
|
+
}
|
|
18
|
+
//#endregion
|
|
19
|
+
export { modalPresenter };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { findInRootLayouts, rootLayoutFor, topRootLayout } from "../root-layout.native.js";
|
|
2
|
+
import { layoutsForRoute } from "../route.native.js";
|
|
3
|
+
import { sheetHost } from "../sheet-service.native.js";
|
|
4
|
+
export { findInRootLayouts, layoutsForRoute, rootLayoutFor, sheetHost, topRootLayout };
|
|
@@ -1,22 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { applyEscapeProps } from "./ui3.js";
|
|
3
|
-
import { glassClassOf, glassConfigOf } from "./ui4.js";
|
|
4
|
-
import { layoutChildProps } from "./ui5.js";
|
|
5
|
-
import { defineUniversalComponent, hookSlots, universalPlan, universalProps, universalValue, useCallback, useRef } from "@nativescript-community/octane";
|
|
1
|
+
import { hookSlots, useCallback, useRef } from "@nativescript-community/octane";
|
|
6
2
|
import { Utils } from "@nativescript/core";
|
|
7
|
-
//#region src/
|
|
3
|
+
//#region src/pan.native.tsrx
|
|
8
4
|
var _hs$ = /* @__PURE__ */ hookSlots(2);
|
|
9
5
|
var _h$0 = /* @__PURE__ */ Symbol(_hs$);
|
|
10
6
|
var _h$1 = /* @__PURE__ */ Symbol(_hs$ + 1);
|
|
11
|
-
var __octaneUniversalPlan0 = universalPlan("nativescript", {
|
|
12
|
-
"kind": "host",
|
|
13
|
-
"type": "flexboxlayout",
|
|
14
|
-
"propsSlot": 0,
|
|
15
|
-
"children": [{
|
|
16
|
-
"kind": "slot",
|
|
17
|
-
"slot": 1
|
|
18
|
-
}]
|
|
19
|
-
});
|
|
20
7
|
var PAN_STATE = [
|
|
21
8
|
"cancelled",
|
|
22
9
|
"began",
|
|
@@ -57,12 +44,12 @@ function panVelocity(e, state, trackerRef) {
|
|
|
57
44
|
}
|
|
58
45
|
return velocity;
|
|
59
46
|
}
|
|
60
|
-
|
|
47
|
+
function usePan(cb) {
|
|
61
48
|
const velocityTracker = useRef(null, _h$0);
|
|
62
|
-
const
|
|
49
|
+
const handler = useCallback((e) => {
|
|
63
50
|
const state = PAN_STATE[e.state] ?? "moved";
|
|
64
51
|
const velocity = panVelocity(e, e.state, velocityTracker);
|
|
65
|
-
|
|
52
|
+
cb?.({
|
|
66
53
|
x: e.deltaX,
|
|
67
54
|
y: e.deltaY,
|
|
68
55
|
dx: e.deltaX,
|
|
@@ -72,55 +59,8 @@ var View = defineUniversalComponent("nativescript", function View(props) {
|
|
|
72
59
|
state,
|
|
73
60
|
target: e.view ?? e.object
|
|
74
61
|
});
|
|
75
|
-
}, [
|
|
76
|
-
return
|
|
77
|
-
|
|
78
|
-
"set",
|
|
79
|
-
"id",
|
|
80
|
-
props.id
|
|
81
|
-
],
|
|
82
|
-
["spread", layoutChildProps(props)],
|
|
83
|
-
[
|
|
84
|
-
"set",
|
|
85
|
-
"ref",
|
|
86
|
-
(v) => {
|
|
87
|
-
if (v) {
|
|
88
|
-
applyEscapeProps(v, props);
|
|
89
|
-
props.bind?.(v);
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
],
|
|
93
|
-
[
|
|
94
|
-
"set",
|
|
95
|
-
"flexDirection",
|
|
96
|
-
"column"
|
|
97
|
-
],
|
|
98
|
-
[
|
|
99
|
-
"set",
|
|
100
|
-
"className",
|
|
101
|
-
cx(glassClassOf(props.glass), props.className)
|
|
102
|
-
],
|
|
103
|
-
[
|
|
104
|
-
"set",
|
|
105
|
-
"style",
|
|
106
|
-
props.style
|
|
107
|
-
],
|
|
108
|
-
[
|
|
109
|
-
"set",
|
|
110
|
-
"iosGlassEffect",
|
|
111
|
-
glassConfigOf(props.glass)
|
|
112
|
-
],
|
|
113
|
-
[
|
|
114
|
-
"set",
|
|
115
|
-
"onPan",
|
|
116
|
-
props.onPan ? onPan : void 0
|
|
117
|
-
],
|
|
118
|
-
[
|
|
119
|
-
"set",
|
|
120
|
-
"onSwipe",
|
|
121
|
-
props.onSwipe
|
|
122
|
-
]
|
|
123
|
-
]), props.children]);
|
|
124
|
-
}, { "module": "@nativescript-community/octane" });
|
|
62
|
+
}, [cb], _h$1);
|
|
63
|
+
return cb ? handler : void 0;
|
|
64
|
+
}
|
|
125
65
|
//#endregion
|
|
126
|
-
export {
|
|
66
|
+
export { usePan };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
//#region src/platform.native.ts
|
|
2
|
+
/** Compile-time platform flag — `true` in every NativeScript build.
|
|
3
|
+
* Prefer `.web`/`.native` leaves for real divergence; `isNative` covers
|
|
4
|
+
* the render-time cases (conditional JSX, prop selection) where a whole
|
|
5
|
+
* leaf file is heavier than the difference. For OS-level splits use
|
|
6
|
+
* `.ios`/`.android` leaves or `isIOS`/`isAndroid` from @nativescript/core
|
|
7
|
+
* inside `.native` code. */
|
|
8
|
+
var isNative = true;
|
|
9
|
+
//#endregion
|
|
10
|
+
export { isNative };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
//#region src/refresh-metrics.ts
|
|
2
|
+
/** Finger-travel → content displacement. iOS rubber-band applies ~0.5
|
|
3
|
+
* resistance at small pulls; web/Android drive the same ratio so the
|
|
4
|
+
* affordance reads identically across targets. */
|
|
5
|
+
function dampenPull(dy) {
|
|
6
|
+
return dy * .5;
|
|
7
|
+
}
|
|
8
|
+
//#endregion
|
|
9
|
+
export { dampenPull };
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import { dampenPull } from "./refresh-metrics.js";
|
|
2
|
+
import { isIOS } from "@nativescript/core";
|
|
3
|
+
//#region src/refresh.native.ts
|
|
4
|
+
var PAN_ENDED = /* @__PURE__ */ new Set([0, 3]);
|
|
5
|
+
var DOCK_ANIM_MS = 180;
|
|
6
|
+
function makeInsets(top, left, bottom, right) {
|
|
7
|
+
const make = globalThis.UIEdgeInsetsMake;
|
|
8
|
+
if (make) return make(top, left, bottom, right);
|
|
9
|
+
return {
|
|
10
|
+
top,
|
|
11
|
+
left,
|
|
12
|
+
bottom,
|
|
13
|
+
right
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
/** Pan-driven pull-to-refresh over any NS scrollable (scrollview or
|
|
17
|
+
* listview). Two mechanics, one visual:
|
|
18
|
+
*
|
|
19
|
+
* iOS — UIScrollView's own bounce supplies the content displacement
|
|
20
|
+
* (NS gesture delegates allow simultaneous recognition, so our pan on
|
|
21
|
+
* the scroller observes alongside the scroll pan). The handler reads
|
|
22
|
+
* `contentOffset` for the live gap and docks with
|
|
23
|
+
* `contentInset.top += H` — the exact mechanics UIRefreshControl uses.
|
|
24
|
+
*
|
|
25
|
+
* Android — there is no overscroll; the scroller box itself is
|
|
26
|
+
* translated inside the clipping wrapper while the damped drag
|
|
27
|
+
* accumulates. Docking holds the translate at H. Edge glow is disabled
|
|
28
|
+
* (OVER_SCROLL_NEVER) so no OS chrome leaks into the pixels.
|
|
29
|
+
*
|
|
30
|
+
* Releasing past `threshold` fires `onRefresh` once per pull and holds
|
|
31
|
+
* the docked gap; the controlled `refreshing` prop keeps it docked.
|
|
32
|
+
* A short grace window collapses the dock if `refreshing` never comes —
|
|
33
|
+
* props land a render after `onRefresh` fires. */
|
|
34
|
+
function createPullToRefresh(host) {
|
|
35
|
+
const { scroller, indicator, isAtTop, cfg } = host;
|
|
36
|
+
if (!scroller || !indicator) return {
|
|
37
|
+
sync: () => {},
|
|
38
|
+
detach: () => {}
|
|
39
|
+
};
|
|
40
|
+
let docked = false;
|
|
41
|
+
let pullAcc = 0;
|
|
42
|
+
let prevDy = 0;
|
|
43
|
+
let touching = false;
|
|
44
|
+
let grace = null;
|
|
45
|
+
let baseInsetTop = null;
|
|
46
|
+
let lastTy = NaN;
|
|
47
|
+
const threshold = () => cfg.current.threshold ?? 64;
|
|
48
|
+
/** Resting gap: the strip stays docked while the gesture docked it OR
|
|
49
|
+
* the controlled `refreshing` prop holds it open. */
|
|
50
|
+
const held = () => docked || !!cfg.current.refreshing;
|
|
51
|
+
const iosOverscroll = () => {
|
|
52
|
+
const sv = scroller.ios;
|
|
53
|
+
if (!sv?.contentOffset) return 0;
|
|
54
|
+
return Math.max(0, -(sv.contentOffset.y + sv.contentInset.top));
|
|
55
|
+
};
|
|
56
|
+
const applyReveal = (reveal) => {
|
|
57
|
+
const ty = reveal - 64;
|
|
58
|
+
if (ty !== lastTy) {
|
|
59
|
+
lastTy = ty;
|
|
60
|
+
indicator.translateY = ty;
|
|
61
|
+
if (!isIOS) scroller.translateY = reveal;
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
const settle = (reveal) => {
|
|
65
|
+
lastTy = NaN;
|
|
66
|
+
if (isIOS) animateTo(indicator, reveal - 64);
|
|
67
|
+
else {
|
|
68
|
+
animateTo(scroller, reveal);
|
|
69
|
+
animateTo(indicator, reveal - 64);
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
const setInset = (on) => {
|
|
73
|
+
const sv = scroller.ios;
|
|
74
|
+
if (!sv?.contentInset) return;
|
|
75
|
+
if (on && baseInsetTop == null) baseInsetTop = sv.contentInset.top;
|
|
76
|
+
const next = (baseInsetTop ?? 0) + (on ? 64 : 0);
|
|
77
|
+
if (Math.abs(sv.contentInset.top - next) < .5) return;
|
|
78
|
+
const apply = () => {
|
|
79
|
+
sv.contentInset = makeInsets(next, sv.contentInset.left, sv.contentInset.bottom, sv.contentInset.right);
|
|
80
|
+
};
|
|
81
|
+
const UIView = globalThis.UIView;
|
|
82
|
+
if (UIView?.animateWithDurationAnimations) UIView.animateWithDurationAnimations(DOCK_ANIM_MS / 1e3, apply);
|
|
83
|
+
else apply();
|
|
84
|
+
};
|
|
85
|
+
function animateTo(view, y) {
|
|
86
|
+
view?.animate?.({
|
|
87
|
+
translate: {
|
|
88
|
+
x: 0,
|
|
89
|
+
y
|
|
90
|
+
},
|
|
91
|
+
duration: DOCK_ANIM_MS
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
const dock = () => {
|
|
95
|
+
docked = true;
|
|
96
|
+
pullAcc = 0;
|
|
97
|
+
if (isIOS) setInset(true);
|
|
98
|
+
settle(64);
|
|
99
|
+
};
|
|
100
|
+
const collapse = () => {
|
|
101
|
+
docked = false;
|
|
102
|
+
pullAcc = 0;
|
|
103
|
+
if (isIOS) setInset(false);
|
|
104
|
+
settle(0);
|
|
105
|
+
};
|
|
106
|
+
/** `extra` is pull beyond the held baseline — a release only fires
|
|
107
|
+
* `onRefresh` when the user actually pulled (a resting release inside
|
|
108
|
+
* the dock re-fires nothing). */
|
|
109
|
+
const release = (extra) => {
|
|
110
|
+
const reveal = extra + (held() ? 64 : 0);
|
|
111
|
+
if (extra > 0 && reveal >= threshold()) {
|
|
112
|
+
cfg.current.onRefresh?.();
|
|
113
|
+
dock();
|
|
114
|
+
clearTimeout(grace);
|
|
115
|
+
grace = setTimeout(() => {
|
|
116
|
+
if (!cfg.current.refreshing) collapse();
|
|
117
|
+
}, 350);
|
|
118
|
+
} else if (held()) {
|
|
119
|
+
docked = true;
|
|
120
|
+
pullAcc = 0;
|
|
121
|
+
if (isIOS) setInset(true);
|
|
122
|
+
settle(64);
|
|
123
|
+
} else collapse();
|
|
124
|
+
};
|
|
125
|
+
const onPan = (e) => {
|
|
126
|
+
if (isIOS) {
|
|
127
|
+
const extra = iosOverscroll();
|
|
128
|
+
if (PAN_ENDED.has(e.state)) {
|
|
129
|
+
touching = false;
|
|
130
|
+
release(extra);
|
|
131
|
+
} else {
|
|
132
|
+
touching = true;
|
|
133
|
+
applyReveal(extra + (held() ? 64 : 0));
|
|
134
|
+
}
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
if (e.state === 1) {
|
|
138
|
+
touching = true;
|
|
139
|
+
prevDy = e.deltaY;
|
|
140
|
+
pullAcc = 0;
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
if (PAN_ENDED.has(e.state)) {
|
|
144
|
+
touching = false;
|
|
145
|
+
release(pullAcc);
|
|
146
|
+
pullAcc = 0;
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
const inc = e.deltaY - prevDy;
|
|
150
|
+
prevDy = e.deltaY;
|
|
151
|
+
if (!isAtTop()) return;
|
|
152
|
+
pullAcc = Math.max(0, pullAcc + dampenPull(inc));
|
|
153
|
+
applyReveal(pullAcc + (held() ? 64 : 0));
|
|
154
|
+
};
|
|
155
|
+
scroller.on("pan", onPan);
|
|
156
|
+
if (!isIOS) scroller.android?.setOverScrollMode?.(2);
|
|
157
|
+
return {
|
|
158
|
+
sync: () => {
|
|
159
|
+
if (cfg.current.refreshing) {
|
|
160
|
+
clearTimeout(grace);
|
|
161
|
+
if (!docked && !touching) dock();
|
|
162
|
+
} else if (docked && !touching) collapse();
|
|
163
|
+
},
|
|
164
|
+
detach: () => {
|
|
165
|
+
clearTimeout(grace);
|
|
166
|
+
scroller.off("pan", onPan);
|
|
167
|
+
if (docked) {
|
|
168
|
+
docked = false;
|
|
169
|
+
if (isIOS) setInset(false);
|
|
170
|
+
else scroller.translateY = 0;
|
|
171
|
+
indicator.translateY = -64;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
//#endregion
|
|
177
|
+
export { createPullToRefresh };
|
|
@@ -26,13 +26,18 @@ function rootLayoutFor(view) {
|
|
|
26
26
|
}
|
|
27
27
|
/** Search every registered rootlayout for a view by id — overlays/sheets/
|
|
28
28
|
* toasts land on different rootlayouts depending on which screen's shell
|
|
29
|
-
* mounted last.
|
|
29
|
+
* mounted last. Unloaded subtrees are skipped: a covered page unloads its
|
|
30
|
+
* views (NativeScript detaches their native recognizers while the JS views
|
|
31
|
+
* stay parented), so an unloaded match is a dead twin that can swallow
|
|
32
|
+
* interaction probes — the live view either doesn't exist here yet or sits
|
|
33
|
+
* under a loaded branch. */
|
|
30
34
|
function findInRootLayouts(id) {
|
|
31
35
|
const walk = (view) => {
|
|
32
36
|
if (!view) return null;
|
|
33
37
|
if (view.id === id) return view;
|
|
34
38
|
let hit = null;
|
|
35
39
|
view.eachChildView?.((c) => {
|
|
40
|
+
if (c?.isLoaded === false) return true;
|
|
36
41
|
const found = walk(c);
|
|
37
42
|
if (found) {
|
|
38
43
|
hit = found;
|