@octane-xplat/ui 0.7.3 → 0.9.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 +4 -3
- package/dist/native/Button.tsrx.js +1 -1
- package/dist/native/KeyboardAvoiding.mobile.tsrx.js +2 -2
- package/dist/native/Markdown.tsrx.js +233 -0
- package/dist/native/Overlay.tsrx.js +15 -26
- package/dist/native/PinInput.tsrx.js +25 -7
- package/dist/native/Popover.tsrx.js +17 -18
- package/dist/native/Pressable.tsrx.js +4 -1
- package/dist/native/SearchInput.tsrx.js +6 -3
- package/dist/native/Sheet.tsrx.js +22 -37
- package/dist/native/TextArea.tsrx.js +6 -3
- package/dist/native/TextInput.tsrx.js +6 -3
- package/dist/native/VirtualList.tsrx.js +305 -121
- package/dist/native/index.shared.js +7 -5
- package/dist/native/keyboard-inset.mobile.js +5 -5
- package/dist/native/navigation-request.js +26 -0
- package/dist/native/octane-client-build.json +1 -1
- package/dist/native/overlay-lifetime.mobile.js +65 -0
- package/dist/native/pan.tsrx.js +16 -2
- package/dist/native/route-table.js +90 -10
- package/dist/native/route.js +26 -16
- package/dist/native/shared.js +7 -5
- package/dist/native/sheet-service.js +1 -1
- package/dist/native/svg.mobile.js +1 -1
- package/dist/native/text-focus.js +10 -0
- package/dist/native/text-write.js +18 -11
- package/dist/native/toast-anchor.tsrx.js +1 -1
- package/dist/native/ui.js +7 -6
- package/dist/native/vendor/ui-svg/index.android.js +2 -2
- package/dist/native/vendor/ui-svg/index.ios.js +2 -2
- package/dist/native/vendor/ui-svg/{index.common.js → src/index.common.js} +1 -1
- package/dist/native/virtual-list-cell-pool.js +63 -0
- package/dist/web/Button.web.tsrx.js +1 -1
- package/dist/web/KeyboardAvoiding.web.tsrx.js +78 -0
- package/dist/web/Markdown.tsrx.js +98 -0
- package/dist/web/Overlay.web.tsrx.js +81 -32
- package/dist/web/PinInput.web.tsrx.js +24 -10
- package/dist/web/Pressable.web.tsrx.js +169 -53
- package/dist/web/SearchInput.web.tsrx.js +2 -2
- package/dist/web/Sheet.web.tsrx.js +20 -7
- package/dist/web/TextArea.web.tsrx.js +22 -17
- package/dist/web/TextInput.web.tsrx.js +2 -2
- package/dist/web/VirtualList.web.tsrx.js +220 -109
- package/dist/web/WebView.web.tsrx.js +3 -3
- package/dist/web/{index.shared.js → index.shared.web.js} +7 -5
- package/dist/web/modal-focus.web.js +95 -0
- package/dist/web/navigation-request.js +26 -0
- package/dist/web/octane-client-build.json +1 -1
- package/dist/web/pan.web.tsrx.js +27 -10
- package/dist/web/route-table.js +90 -10
- package/dist/web/route.web.js +88 -22
- package/dist/web/sheet-service.web.js +8 -0
- package/dist/web/theme/colorScheme.web.js +31 -4
- package/dist/web/ui.js +8 -6
- package/dist/web/virtual-list-cell-pool.js +63 -0
- package/package.json +21 -19
- package/platforms/android/native-api-usage.json +7 -7
- package/src/CommandPalette.tsrx +1 -0
- package/src/Grid.tsrx +2 -0
- package/src/Icon.macos.tsrx +1 -0
- package/src/KeyboardAvoiding.macos.tsrx +7 -1
- package/src/KeyboardAvoiding.mobile.tsrx +2 -2
- package/src/KeyboardAvoiding.tsrx +15 -0
- package/src/KeyboardAvoiding.web.tsrx +15 -0
- package/src/Markdown.tsrx +121 -0
- package/src/Meter.tsrx +1 -0
- package/src/Overlay.tsrx +15 -30
- package/src/Overlay.web.tsrx +12 -3
- package/src/PinInput.macos.tsrx +20 -6
- package/src/PinInput.mobile.test.ts +107 -0
- package/src/PinInput.tsrx +20 -6
- package/src/PinInput.web.test.tsrx +42 -0
- package/src/PinInput.web.tsrx +20 -6
- package/src/Popover.tsrx +17 -17
- package/src/Pressable.tsrx +1 -1
- package/src/Pressable.web.test.tsrx +36 -0
- package/src/Pressable.web.tsrx +37 -6
- package/src/RouteHost.macos.tsrx +1 -0
- package/src/SearchInput.tsrx +4 -3
- package/src/SearchInput.web.tsrx +1 -1
- package/src/Sheet.tsrx +20 -41
- package/src/Sheet.web.tsrx +9 -1
- package/src/Text.tsrx +2 -0
- package/src/TextArea.tsrx +6 -5
- package/src/TextArea.web.test.tsrx +39 -0
- package/src/TextArea.web.tsrx +7 -5
- package/src/TextInput.tsrx +6 -6
- package/src/TextInput.web.tsrx +1 -1
- package/src/VirtualList.macos.tsrx +93 -6
- package/src/VirtualList.mobile.test.tsrx +232 -0
- package/src/VirtualList.tsrx +285 -81
- package/src/VirtualList.web.tsrx +131 -25
- package/src/WebView.tsrx +1 -0
- package/src/WebView.web.tsrx +3 -0
- package/src/android/BottomNavigationView.android.tsrx +1 -0
- package/src/android/MaterialDialog.android.tsrx +1 -0
- package/src/anim.macos.tsrx +1 -0
- package/src/apply-native-modifiers.native.ts +4 -1
- package/src/child-array.ts +12 -7
- package/src/colorScheme.macos.ts +1 -0
- package/src/controls.macos.tsrx +4 -1
- package/src/data-driver.mobile.test.ts +120 -0
- package/src/data-lifecycle.mobile.test.ts +251 -0
- package/src/escape-props.ts +2 -0
- package/src/grid-auto-placement.ts +54 -12
- package/src/grid-placement.ts +1 -1
- package/src/hosted-unsupported.macos.tsrx +1 -0
- package/src/index.macos.ts +23 -3
- package/src/index.mobile.ts +0 -1
- package/src/index.shared.ts +22 -1
- package/src/index.shared.web.ts +291 -0
- package/src/index.web.ts +1 -1
- package/src/input-readiness.web.test.tsrx +82 -0
- package/src/ios/UITabBar.ios.tsrx +1 -0
- package/src/keyboard-inset.mobile.test.ts +62 -0
- package/src/keyboard-inset.mobile.ts +63 -43
- package/src/layout-shells.macos.tsrx +1 -5
- package/src/macos-extras.macos.tsrx +2 -0
- package/src/modal-focus.web.test.tsrx +63 -0
- package/src/modal-focus.web.ts +162 -0
- package/src/navigation-request.ts +37 -0
- package/src/overlay-lifecycle.mobile.test.ts +316 -0
- package/src/overlay-lifetime.mobile.ts +107 -0
- package/src/pan.mobile.test.tsrx +116 -0
- package/src/pan.tsrx +20 -2
- package/src/pan.web.tsrx +35 -7
- package/src/platformProps.ts +1 -0
- package/src/popover.mobile.test.ts +9 -1
- package/src/pressable-accessibility.mobile.test.ts +30 -0
- package/src/props.ts +163 -3
- package/src/refresh.ts +6 -1
- package/src/refresh.web.test.ts +77 -77
- package/src/route-android.test.ts +162 -0
- package/src/route-history.web.test.ts +80 -0
- package/src/route-navigation.web.test.ts +173 -0
- package/src/route-table.test.ts +188 -9
- package/src/route-table.ts +138 -10
- package/src/route.macos.ts +56 -13
- package/src/route.ts +54 -24
- package/src/route.web.ts +141 -24
- package/src/sheet-detents.ts +5 -3
- package/src/sheet-service.macos.ts +5 -1
- package/src/sheet-service.web.ts +8 -0
- package/src/sheet-snap.test.ts +23 -23
- package/src/sheet-snap.ts +6 -1
- package/src/svg.mobile.ts +9 -3
- package/src/tap-to-blur.ios.ts +48 -32
- package/src/tap-to-blur.mobile.ts +23 -15
- package/src/text-focus.ts +12 -0
- package/src/text-input.mobile.test.ts +89 -0
- package/src/text-write.ts +21 -11
- package/src/theme/colorScheme.linux.ts +2 -4
- package/src/theme/colorScheme.web.ts +51 -4
- package/src/theme/theme-scheme.macos.ts +8 -2
- package/src/theme/tokens.css +1736 -1730
- package/src/translate.macos.ts +4 -1
- package/src/virtual-list-cell-pool.test.ts +53 -0
- package/src/virtual-list-cell-pool.ts +81 -0
- package/src/virtual-list-layout.test.ts +11 -8
- package/src/virtual-list-layout.ts +4 -8
- package/src/windows.linux.ts +7 -2
- package/src/windows.macos.ts +1 -0
- package/types/generated/.tsrx-typegen-manifest.json +13 -3
- package/types/generated/KeyboardAvoiding.d.ts +3 -0
- package/types/generated/KeyboardAvoiding.web.d.ts +2 -0
- package/types/generated/Markdown.d.ts +59 -0
- package/types/generated/TextArea.d.ts +2 -2
- package/types/generated/TextArea.web.d.ts +1 -1
- package/types/generated/TextInput.d.ts +2 -3
- package/types/generated/VirtualList.d.ts +3 -3
- package/types/generated/index.mobile.d.ts +0 -1
- package/types/generated/index.shared.d.ts +6 -3
- package/types/generated/index.shared.web.d.ts +114 -0
- package/types/generated/index.web.d.ts +1 -1
- package/types/generated/modal-focus.web.d.ts +3 -0
- package/types/generated/navigation-request.d.ts +10 -0
- package/types/generated/overlay-lifetime.mobile.d.ts +10 -0
- package/types/generated/props.d.ts +111 -3
- package/types/generated/route-table.d.ts +14 -3
- package/types/generated/svg.mobile.d.ts +2 -2
- package/types/generated/text-focus.d.ts +3 -0
- package/types/generated/text-write.d.ts +3 -1
- package/types/generated/theme/colorScheme.web.d.ts +5 -0
- package/types/generated/virtual-list-cell-pool.d.ts +18 -0
- package/types/index.macos.d.ts +15 -3
- /package/src/vendor/ui-svg/{index.android.ts → src/index.android.ts} +0 -0
- /package/src/vendor/ui-svg/{index.common.ts → src/index.common.ts} +0 -0
- /package/src/vendor/ui-svg/{index.ios.ts → src/index.ios.ts} +0 -0
- /package/src/vendor/ui-svg/{index.ts → src/index.ts} +0 -0
- /package/src/vendor/ui-svg/{typings → src/typings}/SVGKit.d.ts +0 -0
- /package/src/vendor/ui-svg/{typings → src/typings}/android.d.ts +0 -0
- /package/src/vendor/ui-svg/{typings → src/typings}/ios.d.ts +0 -0
- /package/types/generated/vendor/ui-svg/{index.common.d.ts → src/index.common.d.ts} +0 -0
- /package/types/generated/vendor/ui-svg/{index.d.ts → src/index.d.ts} +0 -0
- /package/types/generated/vendor/ui-svg/{index.ios.d.ts → src/index.ios.d.ts} +0 -0
package/README.md
CHANGED
|
@@ -7,10 +7,11 @@
|
|
|
7
7
|
> the NativeScript toolchain (Xcode/JDK + `ns`).
|
|
8
8
|
|
|
9
9
|
Start with the [app creator](../create/README.md) when building a new app with
|
|
10
|
-
an agent.
|
|
11
|
-
|
|
10
|
+
an agent. Xplat's target direction covers web, iOS, Android, macOS, Windows,
|
|
11
|
+
and Linux; this package's established implementations cover web and mobile,
|
|
12
12
|
with a bounded experimental macOS surface. The Windows scaffold has not yet
|
|
13
|
-
been run on Windows, so UI support there remains unverified
|
|
13
|
+
been run on Windows, so UI support there remains unverified; Linux renders
|
|
14
|
+
the DOM surface inside an experimental WebKitGTK host. See [target support](https://octane-xplat.goddardai.org/spec#choose-your-targets).
|
|
14
15
|
|
|
15
16
|
To add the UI package to an existing configured app:
|
|
16
17
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { cx } from "./cx.js";
|
|
2
|
-
import { Pressable } from "./Pressable.tsrx.js";
|
|
3
2
|
import { ActivityIndicator } from "./ActivityIndicator.tsrx.js";
|
|
3
|
+
import { Pressable } from "./Pressable.tsrx.js";
|
|
4
4
|
import { defineUniversalComponent, markWarm, universalComponent, universalPlan, universalProps, universalValue, useBatch, warmChild } from "@nativescript-community/octane";
|
|
5
5
|
//#region src/Button.tsrx
|
|
6
6
|
var __octaneUniversalPlan0 = universalPlan("nativescript", {
|
|
@@ -46,10 +46,10 @@ function useKeyboardInset() {
|
|
|
46
46
|
}
|
|
47
47
|
function useAndroidResize() {
|
|
48
48
|
useEffect(() => {
|
|
49
|
-
const nativeWindow = Application.android?.foregroundActivity?.
|
|
49
|
+
const nativeWindow = Application.android?.foregroundActivity?.getWindow();
|
|
50
50
|
if (!nativeWindow) return;
|
|
51
51
|
const params = android.view.WindowManager.LayoutParams;
|
|
52
|
-
const previous = nativeWindow.
|
|
52
|
+
const previous = nativeWindow.getAttributes().softInputMode;
|
|
53
53
|
const adjusted = previous & ~params.SOFT_INPUT_MASK_ADJUST | params.SOFT_INPUT_ADJUST_RESIZE;
|
|
54
54
|
nativeWindow.setSoftInputMode(adjusted);
|
|
55
55
|
return () => nativeWindow.setSoftInputMode(previous);
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
import { View } from "./View.tsrx.js";
|
|
2
|
+
import { Text } from "./Text.tsrx.js";
|
|
3
|
+
import { Screen } from "./Screen.tsrx.js";
|
|
4
|
+
import { ScrollView } from "./ScrollView.tsrx.js";
|
|
5
|
+
import { defineUniversalComponent, universalChildren, universalComponent, universalPlan, universalProps, universalValue } from "@nativescript-community/octane";
|
|
6
|
+
//#region src/Markdown.tsrx
|
|
7
|
+
var __octaneUniversalPlan0 = universalPlan("nativescript", {
|
|
8
|
+
"kind": "slot",
|
|
9
|
+
"slot": 0
|
|
10
|
+
});
|
|
11
|
+
var __octaneUniversalPlan1 = universalPlan("nativescript", {
|
|
12
|
+
"kind": "slot",
|
|
13
|
+
"slot": 0
|
|
14
|
+
});
|
|
15
|
+
var __octaneUniversalPlan2 = universalPlan("nativescript", {
|
|
16
|
+
"kind": "slot",
|
|
17
|
+
"slot": 0
|
|
18
|
+
});
|
|
19
|
+
var __octaneUniversalPlan3 = universalPlan("nativescript", {
|
|
20
|
+
"kind": "slot",
|
|
21
|
+
"slot": 0
|
|
22
|
+
});
|
|
23
|
+
var __octaneUniversalPlan4 = universalPlan("nativescript", {
|
|
24
|
+
"kind": "slot",
|
|
25
|
+
"slot": 0
|
|
26
|
+
});
|
|
27
|
+
var __octaneUniversalPlan5 = universalPlan("nativescript", {
|
|
28
|
+
"kind": "slot",
|
|
29
|
+
"slot": 0
|
|
30
|
+
});
|
|
31
|
+
var __octaneUniversalPlan6 = universalPlan("nativescript", {
|
|
32
|
+
"kind": "slot",
|
|
33
|
+
"slot": 0
|
|
34
|
+
});
|
|
35
|
+
var __octaneUniversalPlan7 = universalPlan("nativescript", {
|
|
36
|
+
"kind": "slot",
|
|
37
|
+
"slot": 0
|
|
38
|
+
});
|
|
39
|
+
var __octaneUniversalPlan8 = universalPlan("nativescript", {
|
|
40
|
+
"kind": "slot",
|
|
41
|
+
"slot": 0
|
|
42
|
+
});
|
|
43
|
+
var __octaneUniversalPlan9 = universalPlan("nativescript", {
|
|
44
|
+
"kind": "slot",
|
|
45
|
+
"slot": 0
|
|
46
|
+
});
|
|
47
|
+
var __octaneUniversalPlan10 = universalPlan("nativescript", {
|
|
48
|
+
"kind": "slot",
|
|
49
|
+
"slot": 0
|
|
50
|
+
});
|
|
51
|
+
var __octaneUniversalPlan11 = universalPlan("nativescript", {
|
|
52
|
+
"kind": "range",
|
|
53
|
+
"children": [{
|
|
54
|
+
"kind": "slot",
|
|
55
|
+
"slot": 0
|
|
56
|
+
}, {
|
|
57
|
+
"kind": "slot",
|
|
58
|
+
"slot": 1
|
|
59
|
+
}]
|
|
60
|
+
});
|
|
61
|
+
var __octaneUniversalPlan12 = universalPlan("nativescript", {
|
|
62
|
+
"kind": "slot",
|
|
63
|
+
"slot": 0
|
|
64
|
+
});
|
|
65
|
+
var __octaneUniversalPlan13 = universalPlan("nativescript", {
|
|
66
|
+
"kind": "slot",
|
|
67
|
+
"slot": 0
|
|
68
|
+
});
|
|
69
|
+
var __octaneUniversalPlan14 = universalPlan("nativescript", {
|
|
70
|
+
"kind": "slot",
|
|
71
|
+
"slot": 0
|
|
72
|
+
});
|
|
73
|
+
var __octaneUniversalPlan15 = universalPlan("nativescript", {
|
|
74
|
+
"kind": "slot",
|
|
75
|
+
"slot": 0
|
|
76
|
+
});
|
|
77
|
+
var __octaneUniversalPlan16 = universalPlan("nativescript", {
|
|
78
|
+
"kind": "slot",
|
|
79
|
+
"slot": 0
|
|
80
|
+
});
|
|
81
|
+
var __octaneUniversalPlan17 = universalPlan("nativescript", {
|
|
82
|
+
"kind": "slot",
|
|
83
|
+
"slot": 0
|
|
84
|
+
});
|
|
85
|
+
var __octaneUniversalPlan18 = universalPlan("nativescript", {
|
|
86
|
+
"kind": "slot",
|
|
87
|
+
"slot": 0
|
|
88
|
+
});
|
|
89
|
+
var __octaneUniversalPlan19 = universalPlan("nativescript", {
|
|
90
|
+
"kind": "slot",
|
|
91
|
+
"slot": 0
|
|
92
|
+
});
|
|
93
|
+
var headingClass = [
|
|
94
|
+
"text-2xl font-bold",
|
|
95
|
+
"text-xl font-semibold",
|
|
96
|
+
"text-lg font-semibold"
|
|
97
|
+
];
|
|
98
|
+
var Inlines = defineUniversalComponent("nativescript", function Inlines(props) {
|
|
99
|
+
const out = [];
|
|
100
|
+
for (const n of props.nodes ?? []) switch (n.t) {
|
|
101
|
+
case "code":
|
|
102
|
+
out.push(universalValue(__octaneUniversalPlan0, [universalComponent("nativescript", Text, universalProps([[
|
|
103
|
+
"set",
|
|
104
|
+
"style",
|
|
105
|
+
{ fontFamily: "ui-monospace" }
|
|
106
|
+
]], n.text))]));
|
|
107
|
+
break;
|
|
108
|
+
case "bold":
|
|
109
|
+
out.push(universalValue(__octaneUniversalPlan2, [universalComponent("nativescript", Text, universalProps([[
|
|
110
|
+
"set",
|
|
111
|
+
"className",
|
|
112
|
+
"font-bold"
|
|
113
|
+
]], universalChildren("nativescript", () => {
|
|
114
|
+
return universalValue(__octaneUniversalPlan1, [universalComponent("nativescript", Inlines, universalProps([[
|
|
115
|
+
"set",
|
|
116
|
+
"nodes",
|
|
117
|
+
n.children
|
|
118
|
+
]]))]);
|
|
119
|
+
})))]));
|
|
120
|
+
break;
|
|
121
|
+
case "em":
|
|
122
|
+
out.push(universalValue(__octaneUniversalPlan4, [universalComponent("nativescript", Text, universalProps([[
|
|
123
|
+
"set",
|
|
124
|
+
"style",
|
|
125
|
+
{ fontStyle: "italic" }
|
|
126
|
+
]], universalChildren("nativescript", () => {
|
|
127
|
+
return universalValue(__octaneUniversalPlan3, [universalComponent("nativescript", Inlines, universalProps([[
|
|
128
|
+
"set",
|
|
129
|
+
"nodes",
|
|
130
|
+
n.children
|
|
131
|
+
]]))]);
|
|
132
|
+
})))]));
|
|
133
|
+
break;
|
|
134
|
+
case "link":
|
|
135
|
+
out.push(universalValue(__octaneUniversalPlan5, [universalComponent("nativescript", Text, universalProps([[
|
|
136
|
+
"set",
|
|
137
|
+
"style",
|
|
138
|
+
{ textDecorationLine: "underline" }
|
|
139
|
+
]], n.text))]));
|
|
140
|
+
break;
|
|
141
|
+
default: out.push(n.text);
|
|
142
|
+
}
|
|
143
|
+
return out;
|
|
144
|
+
}, { "module": "@nativescript-community/octane" });
|
|
145
|
+
var Markdown = defineUniversalComponent("nativescript", function Markdown(props) {
|
|
146
|
+
return universalValue(__octaneUniversalPlan16, [universalComponent("nativescript", View, universalProps([[
|
|
147
|
+
"set",
|
|
148
|
+
"className",
|
|
149
|
+
"gap-3"
|
|
150
|
+
]], (props.data?.children ?? []).map((node) => {
|
|
151
|
+
switch (node.t) {
|
|
152
|
+
case "h": return universalValue(__octaneUniversalPlan7, [universalComponent("nativescript", Text, universalProps([[
|
|
153
|
+
"set",
|
|
154
|
+
"className",
|
|
155
|
+
headingClass[node.depth - 1] ?? "font-semibold"
|
|
156
|
+
]], universalChildren("nativescript", () => {
|
|
157
|
+
return universalValue(__octaneUniversalPlan6, [universalComponent("nativescript", Inlines, universalProps([[
|
|
158
|
+
"set",
|
|
159
|
+
"nodes",
|
|
160
|
+
node.children
|
|
161
|
+
]]))]);
|
|
162
|
+
})))]);
|
|
163
|
+
case "p": return universalValue(__octaneUniversalPlan9, [universalComponent("nativescript", Text, universalProps([], universalChildren("nativescript", () => {
|
|
164
|
+
return universalValue(__octaneUniversalPlan8, [universalComponent("nativescript", Inlines, universalProps([[
|
|
165
|
+
"set",
|
|
166
|
+
"nodes",
|
|
167
|
+
node.children
|
|
168
|
+
]]))]);
|
|
169
|
+
})))]);
|
|
170
|
+
case "code": return universalValue(__octaneUniversalPlan10, [universalComponent("nativescript", Text, universalProps([[
|
|
171
|
+
"set",
|
|
172
|
+
"className",
|
|
173
|
+
"text-sm"
|
|
174
|
+
], [
|
|
175
|
+
"set",
|
|
176
|
+
"style",
|
|
177
|
+
{ fontFamily: "ui-monospace" }
|
|
178
|
+
]], node.text))]);
|
|
179
|
+
case "list": return node.items.map((item, i) => universalValue(__octaneUniversalPlan12, [universalComponent("nativescript", Text, universalProps([], universalChildren("nativescript", () => {
|
|
180
|
+
return universalValue(__octaneUniversalPlan11, [node.ordered ? `${i + 1}. ` : "• ", universalComponent("nativescript", Inlines, universalProps([[
|
|
181
|
+
"set",
|
|
182
|
+
"nodes",
|
|
183
|
+
item
|
|
184
|
+
]]))]);
|
|
185
|
+
})))]));
|
|
186
|
+
case "quote": return universalValue(__octaneUniversalPlan14, [universalComponent("nativescript", Text, universalProps([[
|
|
187
|
+
"set",
|
|
188
|
+
"className",
|
|
189
|
+
"text-muted"
|
|
190
|
+
], [
|
|
191
|
+
"set",
|
|
192
|
+
"style",
|
|
193
|
+
{ fontStyle: "italic" }
|
|
194
|
+
]], universalChildren("nativescript", () => {
|
|
195
|
+
return universalValue(__octaneUniversalPlan13, [universalComponent("nativescript", Inlines, universalProps([[
|
|
196
|
+
"set",
|
|
197
|
+
"nodes",
|
|
198
|
+
node.children
|
|
199
|
+
]]))]);
|
|
200
|
+
})))]);
|
|
201
|
+
case "hr": return universalValue(__octaneUniversalPlan15, [universalComponent("nativescript", View, universalProps([[
|
|
202
|
+
"set",
|
|
203
|
+
"style",
|
|
204
|
+
{
|
|
205
|
+
height: 1,
|
|
206
|
+
backgroundColor: "var(--color-border)"
|
|
207
|
+
}
|
|
208
|
+
]]))]);
|
|
209
|
+
default: return null;
|
|
210
|
+
}
|
|
211
|
+
})))]);
|
|
212
|
+
}, { "module": "@nativescript-community/octane" });
|
|
213
|
+
var MarkdownScreen = defineUniversalComponent("nativescript", function MarkdownScreen(props) {
|
|
214
|
+
return universalValue(__octaneUniversalPlan19, [universalComponent("nativescript", Screen, universalProps([[
|
|
215
|
+
"set",
|
|
216
|
+
"className",
|
|
217
|
+
"vx-app"
|
|
218
|
+
]], universalChildren("nativescript", () => {
|
|
219
|
+
return universalValue(__octaneUniversalPlan18, [universalComponent("nativescript", ScrollView, universalProps([[
|
|
220
|
+
"set",
|
|
221
|
+
"style",
|
|
222
|
+
{ padding: 16 }
|
|
223
|
+
]], universalChildren("nativescript", () => {
|
|
224
|
+
return universalValue(__octaneUniversalPlan17, [universalComponent("nativescript", Markdown, universalProps([[
|
|
225
|
+
"set",
|
|
226
|
+
"data",
|
|
227
|
+
props.data
|
|
228
|
+
]]))]);
|
|
229
|
+
})))]);
|
|
230
|
+
})))]);
|
|
231
|
+
}, { "module": "@nativescript-community/octane" });
|
|
232
|
+
//#endregion
|
|
233
|
+
export { Markdown, MarkdownScreen };
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import { cx } from "./cx.js";
|
|
2
|
-
import { applyThemeClasses } from "./theme/theme-scheme.js";
|
|
3
2
|
import { rootLayoutFor } from "./root-layout.mobile.js";
|
|
3
|
+
import { applyThemeClasses } from "./theme/theme-scheme.js";
|
|
4
|
+
import { createOverlayLifetime } from "./overlay-lifetime.mobile.js";
|
|
4
5
|
import { createNativeScriptRoot, defineUniversalComponent, hookSlots, universalPlan, universalValue, useEffect, useRef } from "@nativescript-community/octane";
|
|
5
6
|
import { GridLayout, isAndroid, isIOS } from "@nativescript/core";
|
|
6
7
|
//#region src/Overlay.tsrx
|
|
7
|
-
var _hs$ = /* @__PURE__ */ hookSlots(
|
|
8
|
+
var _hs$ = /* @__PURE__ */ hookSlots(5);
|
|
8
9
|
var _h$0 = /* @__PURE__ */ Symbol(_hs$);
|
|
9
10
|
var _h$1 = /* @__PURE__ */ Symbol(_hs$ + 1);
|
|
10
11
|
var _h$2 = /* @__PURE__ */ Symbol(_hs$ + 2);
|
|
11
12
|
var _h$3 = /* @__PURE__ */ Symbol(_hs$ + 3);
|
|
13
|
+
var _h$4 = /* @__PURE__ */ Symbol(_hs$ + 4);
|
|
12
14
|
var __octaneUniversalPlan0 = universalPlan("nativescript", {
|
|
13
15
|
"kind": "range",
|
|
14
16
|
"children": [{
|
|
@@ -33,19 +35,12 @@ var Overlay = defineUniversalComponent("nativescript", function Overlay(props) {
|
|
|
33
35
|
useEffect(() => {
|
|
34
36
|
const current = shown.current;
|
|
35
37
|
if (!props.open) {
|
|
36
|
-
|
|
37
|
-
current.dismissOnClose = false;
|
|
38
|
-
shown.current = null;
|
|
39
|
-
const rl = rootLayout();
|
|
40
|
-
if (rl && rl?.hasChild?.(current.host)) rl.close(current.host).then(() => current.root.unmount?.(), (error) => {
|
|
41
|
-
console.error("[Overlay] close failed", error);
|
|
42
|
-
current.root.unmount?.();
|
|
43
|
-
});
|
|
44
|
-
else current.root.unmount?.();
|
|
38
|
+
current?.lifetime.close();
|
|
45
39
|
return;
|
|
46
40
|
}
|
|
47
41
|
if (current) {
|
|
48
42
|
current.root.render(OverlayBody, { children: props.children });
|
|
43
|
+
current.unbindTheme?.();
|
|
49
44
|
current.unbindTheme = applyThemeClasses(current.host, cx("vx-overlay-host", props.className));
|
|
50
45
|
if (props.style) Object.assign(current.host.style, props.style);
|
|
51
46
|
Object.assign(current.host, isIOS ? props.ios : isAndroid ? props.android : void 0);
|
|
@@ -60,31 +55,24 @@ var Overlay = defineUniversalComponent("nativescript", function Overlay(props) {
|
|
|
60
55
|
if (props.style) Object.assign(host.style, props.style);
|
|
61
56
|
Object.assign(host, isIOS ? props.ios : isAndroid ? props.android : void 0);
|
|
62
57
|
const root = createNativeScriptRoot(host);
|
|
58
|
+
const lifetime = createOverlayLifetime(rl, host, root, "Overlay", (dismissed) => {
|
|
59
|
+
if (shown.current?.host === host) shown.current = null;
|
|
60
|
+
if (dismissed) dismiss.current?.();
|
|
61
|
+
});
|
|
63
62
|
const opened = {
|
|
64
63
|
host,
|
|
65
64
|
root,
|
|
66
|
-
|
|
65
|
+
lifetime,
|
|
67
66
|
unbindTheme
|
|
68
67
|
};
|
|
68
|
+
lifetime.own(() => opened.unbindTheme?.());
|
|
69
69
|
shown.current = opened;
|
|
70
70
|
root.render(OverlayBody, { children: props.children });
|
|
71
|
-
|
|
72
|
-
if (shown.current === opened) shown.current = null;
|
|
73
|
-
opened.unbindTheme?.();
|
|
74
|
-
root.unmount?.();
|
|
75
|
-
if (opened.dismissOnClose) dismiss.current?.();
|
|
76
|
-
});
|
|
77
|
-
const open = () => rl.open(host, props.shadeCover ? { shadeCover: {
|
|
71
|
+
lifetime.open(props.shadeCover ? { shadeCover: {
|
|
78
72
|
opacity: .45,
|
|
79
73
|
color: "#000000",
|
|
80
74
|
tapToClose: true
|
|
81
|
-
} } : {})
|
|
82
|
-
if (shown.current === opened) shown.current = null;
|
|
83
|
-
console.error("[Overlay] open failed", error);
|
|
84
|
-
root.unmount?.();
|
|
85
|
-
});
|
|
86
|
-
if (rl.hasChild?.(host)) rl.close(host).then(open, (error) => console.error("[Overlay] stale host close failed", error));
|
|
87
|
-
else open();
|
|
75
|
+
} } : {});
|
|
88
76
|
}, [
|
|
89
77
|
props.open,
|
|
90
78
|
props.children,
|
|
@@ -94,6 +82,7 @@ var Overlay = defineUniversalComponent("nativescript", function Overlay(props) {
|
|
|
94
82
|
props.ios,
|
|
95
83
|
props.android
|
|
96
84
|
], _h$3);
|
|
85
|
+
useEffect(() => () => shown.current?.lifetime.close(), [], _h$4);
|
|
97
86
|
return universalValue(__octaneUniversalPlan1, [(v) => {
|
|
98
87
|
hostView.current = v;
|
|
99
88
|
}, {
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { cx } from "./cx.js";
|
|
2
2
|
import { applyEscapeProps } from "./escape-props.js";
|
|
3
3
|
import { TextInput } from "./TextInput.tsrx.js";
|
|
4
|
-
import { defineUniversalComponent, hookSlots, universalComponent, universalFor, universalPlan, universalProps, universalValue, useState } from "@nativescript-community/octane";
|
|
4
|
+
import { defineUniversalComponent, hookSlots, universalComponent, universalFor, universalPlan, universalProps, universalValue, useEffect, useRef, useState } from "@nativescript-community/octane";
|
|
5
5
|
//#region src/PinInput.tsrx
|
|
6
|
-
var
|
|
6
|
+
var _hs$ = /* @__PURE__ */ hookSlots(4);
|
|
7
|
+
var _h$0 = /* @__PURE__ */ Symbol(_hs$);
|
|
8
|
+
var _h$1 = /* @__PURE__ */ Symbol(_hs$ + 1);
|
|
9
|
+
var _h$2 = /* @__PURE__ */ Symbol(_hs$ + 2);
|
|
10
|
+
var _h$3 = /* @__PURE__ */ Symbol(_hs$ + 3);
|
|
7
11
|
var __octaneUniversalPlan0 = universalPlan("nativescript", {
|
|
8
12
|
"kind": "slot",
|
|
9
13
|
"slot": 0
|
|
@@ -28,7 +32,15 @@ var PinInput = defineUniversalComponent("nativescript", function PinInput(props)
|
|
|
28
32
|
const [internal, setInternal] = useState("", _h$0);
|
|
29
33
|
const controlled = props.value !== void 0;
|
|
30
34
|
const value = controlled ? props.value : internal;
|
|
31
|
-
const handles = [];
|
|
35
|
+
const handles = useRef([], _h$1);
|
|
36
|
+
const pendingFocus = useRef(null, _h$2);
|
|
37
|
+
useEffect(() => {
|
|
38
|
+
const next = pendingFocus.current;
|
|
39
|
+
if (next !== null && next <= value.length) {
|
|
40
|
+
pendingFocus.current = null;
|
|
41
|
+
handles.current[next]?.focus();
|
|
42
|
+
}
|
|
43
|
+
}, [value], _h$3);
|
|
32
44
|
const setValue = (next) => {
|
|
33
45
|
const clipped = next.slice(0, length);
|
|
34
46
|
if (!controlled) setInternal(clipped);
|
|
@@ -37,10 +49,16 @@ var PinInput = defineUniversalComponent("nativescript", function PinInput(props)
|
|
|
37
49
|
};
|
|
38
50
|
const cellValue = (i) => value[i] ?? "";
|
|
39
51
|
const enter = (i, text) => {
|
|
52
|
+
if (props.disabled || i > value.length) return;
|
|
40
53
|
const ch = text.slice(-1);
|
|
41
|
-
const next = (value.slice(0, i) + ch + value.slice(i + 1)).slice(0, length);
|
|
54
|
+
const next = ch ? (value.slice(0, i) + ch + value.slice(i + 1)).slice(0, length) : value.slice(0, i);
|
|
55
|
+
pendingFocus.current = ch && i < length - 1 ? i + 1 : null;
|
|
42
56
|
setValue(next);
|
|
43
|
-
if (
|
|
57
|
+
if (pendingFocus.current !== null && pendingFocus.current <= value.length) {
|
|
58
|
+
const index = pendingFocus.current;
|
|
59
|
+
pendingFocus.current = null;
|
|
60
|
+
handles.current[index]?.focus();
|
|
61
|
+
}
|
|
44
62
|
};
|
|
45
63
|
return universalValue(__octaneUniversalPlan1, [
|
|
46
64
|
(v) => applyEscapeProps(v, props),
|
|
@@ -67,7 +85,7 @@ var PinInput = defineUniversalComponent("nativescript", function PinInput(props)
|
|
|
67
85
|
[
|
|
68
86
|
"set",
|
|
69
87
|
"editable",
|
|
70
|
-
!props.disabled
|
|
88
|
+
!props.disabled && i <= value.length
|
|
71
89
|
],
|
|
72
90
|
[
|
|
73
91
|
"set",
|
|
@@ -83,7 +101,7 @@ var PinInput = defineUniversalComponent("nativescript", function PinInput(props)
|
|
|
83
101
|
"set",
|
|
84
102
|
"bind",
|
|
85
103
|
(h) => {
|
|
86
|
-
handles[i] = h;
|
|
104
|
+
handles.current[i] = h;
|
|
87
105
|
}
|
|
88
106
|
]
|
|
89
107
|
]))]);
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { cx } from "./cx.js";
|
|
2
|
+
import { rootLayoutFor } from "./root-layout.mobile.js";
|
|
2
3
|
import { applyNativeProps } from "./platformProps.js";
|
|
3
4
|
import { positionPopover } from "./popover-position.js";
|
|
4
5
|
import { applyThemeClasses, useThemeScheme } from "./theme/theme-scheme.js";
|
|
5
|
-
import {
|
|
6
|
+
import { createOverlayLifetime } from "./overlay-lifetime.mobile.js";
|
|
6
7
|
import { createNativeScriptRoot, defineUniversalComponent, hookSlots, universalPlan, universalValue, useEffect, useRef, useState, withSlot } from "@nativescript-community/octane";
|
|
7
8
|
import { GridLayout, Screen, isIOS } from "@nativescript/core";
|
|
8
9
|
//#region src/Popover.tsrx
|
|
9
|
-
var _hs$ = /* @__PURE__ */ hookSlots(
|
|
10
|
+
var _hs$ = /* @__PURE__ */ hookSlots(11);
|
|
10
11
|
var _h$0 = /* @__PURE__ */ Symbol(_hs$);
|
|
11
12
|
var _h$1 = /* @__PURE__ */ Symbol(_hs$ + 1);
|
|
12
13
|
var _h$2 = /* @__PURE__ */ Symbol(_hs$ + 2);
|
|
@@ -16,6 +17,8 @@ var _h$5 = /* @__PURE__ */ Symbol(_hs$ + 5);
|
|
|
16
17
|
var _h$6 = /* @__PURE__ */ Symbol(_hs$ + 6);
|
|
17
18
|
var _h$7 = /* @__PURE__ */ Symbol(_hs$ + 7);
|
|
18
19
|
var _h$8 = /* @__PURE__ */ Symbol(_hs$ + 8);
|
|
20
|
+
var _h$9 = /* @__PURE__ */ Symbol(_hs$ + 9);
|
|
21
|
+
var _h$10 = /* @__PURE__ */ Symbol(_hs$ + 10);
|
|
19
22
|
var __octaneUniversalPlan0 = universalPlan("nativescript", {
|
|
20
23
|
"kind": "host",
|
|
21
24
|
"type": "gridlayout",
|
|
@@ -151,18 +154,12 @@ var PopoverLayer = defineUniversalComponent("nativescript", function PopoverLaye
|
|
|
151
154
|
}, { "module": "@nativescript-community/octane" });
|
|
152
155
|
var Popover = defineUniversalComponent("nativescript", function Popover(props) {
|
|
153
156
|
const shown = useRef(null, _h$7);
|
|
157
|
+
const dismiss = useRef(props.onDismiss, _h$8);
|
|
158
|
+
dismiss.current = props.onDismiss;
|
|
154
159
|
useEffect(() => {
|
|
155
160
|
const cur = shown.current;
|
|
156
161
|
if (!props.open) {
|
|
157
|
-
|
|
158
|
-
shown.current = null;
|
|
159
|
-
cur.unbindTheme?.();
|
|
160
|
-
const owner = cur.host.parent;
|
|
161
|
-
if (owner?.hasChild?.(cur.host)) owner.close(cur.host).then(() => cur.root.unmount?.(), (error) => {
|
|
162
|
-
console.error("[Popover] close failed", error);
|
|
163
|
-
cur.root.unmount?.();
|
|
164
|
-
});
|
|
165
|
-
else cur.root.unmount?.();
|
|
162
|
+
cur?.lifetime.close();
|
|
166
163
|
return;
|
|
167
164
|
}
|
|
168
165
|
const anchor = props.anchor?.current;
|
|
@@ -180,20 +177,21 @@ var Popover = defineUniversalComponent("nativescript", function Popover(props) {
|
|
|
180
177
|
host.horizontalAlignment = "stretch";
|
|
181
178
|
host.verticalAlignment = "stretch";
|
|
182
179
|
const root = createNativeScriptRoot(host);
|
|
180
|
+
const lifetime = createOverlayLifetime(rl, host, root, "Popover", (dismissed) => {
|
|
181
|
+
if (shown.current?.host === host) shown.current = null;
|
|
182
|
+
if (dismissed) dismiss.current?.();
|
|
183
|
+
});
|
|
184
|
+
lifetime.own(unbindTheme);
|
|
183
185
|
shown.current = {
|
|
184
186
|
host,
|
|
185
187
|
root,
|
|
186
|
-
|
|
188
|
+
lifetime
|
|
187
189
|
};
|
|
188
190
|
root.render(PopoverLayer, {
|
|
189
191
|
...props,
|
|
190
192
|
anchorView: anchor
|
|
191
193
|
});
|
|
192
|
-
|
|
193
|
-
if (shown.current?.host === host) shown.current = null;
|
|
194
|
-
console.error("[Popover] open failed", error);
|
|
195
|
-
root.unmount?.();
|
|
196
|
-
});
|
|
194
|
+
lifetime.open();
|
|
197
195
|
}, [
|
|
198
196
|
props.open,
|
|
199
197
|
props.children,
|
|
@@ -201,7 +199,8 @@ var Popover = defineUniversalComponent("nativescript", function Popover(props) {
|
|
|
201
199
|
props.className,
|
|
202
200
|
props.style,
|
|
203
201
|
props.dismissOnOutsideTap
|
|
204
|
-
], _h$
|
|
202
|
+
], _h$9);
|
|
203
|
+
useEffect(() => () => shown.current?.lifetime.close(), [], _h$10);
|
|
205
204
|
return universalValue(__octaneUniversalPlan2, []);
|
|
206
205
|
}, { "module": "@nativescript-community/octane" });
|
|
207
206
|
//#endregion
|
|
@@ -76,7 +76,10 @@ var Pressable = defineUniversalComponent("nativescript", function Pressable(prop
|
|
|
76
76
|
[
|
|
77
77
|
"set",
|
|
78
78
|
"accessibilityState",
|
|
79
|
-
nativeAccessibilityState(
|
|
79
|
+
nativeAccessibilityState({
|
|
80
|
+
...props.accessibilityState,
|
|
81
|
+
disabled: props.disabled || props.accessibilityState?.disabled
|
|
82
|
+
})
|
|
80
83
|
],
|
|
81
84
|
[
|
|
82
85
|
"set",
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { cx } from "./cx.js";
|
|
2
2
|
import { applyEscapeProps } from "./escape-props.js";
|
|
3
3
|
import { Icon } from "./Icon.tsrx.js";
|
|
4
|
-
import { writeText } from "./text-write.js";
|
|
4
|
+
import { isWritingText, writeText } from "./text-write.js";
|
|
5
|
+
import { blurText } from "./text-focus.js";
|
|
5
6
|
import { defineUniversalComponent, hookSlots, markWarm, universalComponent, universalPlan, universalProps, universalValue, useBatch, useEffect, useRef, useState, warmChild } from "@nativescript-community/octane";
|
|
6
7
|
//#region src/SearchInput.tsrx
|
|
7
8
|
var _hs$ = /* @__PURE__ */ hookSlots(3);
|
|
@@ -116,13 +117,15 @@ var SearchInput = defineUniversalComponent("nativescript", markWarm(function Sea
|
|
|
116
117
|
if (!v) return;
|
|
117
118
|
props.bind?.({
|
|
118
119
|
focus: () => v.focus(),
|
|
119
|
-
blur: () =>
|
|
120
|
+
blur: () => blurText(v),
|
|
120
121
|
native: v
|
|
121
122
|
});
|
|
122
123
|
},
|
|
123
124
|
props.placeholder,
|
|
124
125
|
props.editable ?? true,
|
|
125
|
-
(e) =>
|
|
126
|
+
(e) => {
|
|
127
|
+
if (!isWritingText(e.object)) setValue(e.value);
|
|
128
|
+
},
|
|
126
129
|
props.onSubmit,
|
|
127
130
|
props.onFocus,
|
|
128
131
|
props.onBlur,
|
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
import { cx } from "./cx.js";
|
|
2
|
-
import { applyThemeClasses } from "./theme/theme-scheme.js";
|
|
3
2
|
import { rootLayoutFor } from "./root-layout.mobile.js";
|
|
4
3
|
import { attachTapToBlur } from "./tap-to-blur.ios.js";
|
|
4
|
+
import { applyThemeClasses } from "./theme/theme-scheme.js";
|
|
5
|
+
import { createOverlayLifetime } from "./overlay-lifetime.mobile.js";
|
|
5
6
|
import { attachSheetDetents } from "./sheet-detents.js";
|
|
6
7
|
import { bindBottomInsetToKeyboard } from "./keyboard-inset.mobile.js";
|
|
7
8
|
import { createNativeScriptRoot, defineUniversalComponent, hookSlots, universalPlan, universalValue, useEffect, useRef } from "@nativescript-community/octane";
|
|
8
9
|
import { GridLayout, isAndroid, isIOS } from "@nativescript/core";
|
|
9
10
|
//#region src/Sheet.tsrx
|
|
10
|
-
var _hs$ = /* @__PURE__ */ hookSlots(
|
|
11
|
+
var _hs$ = /* @__PURE__ */ hookSlots(5);
|
|
11
12
|
var _h$0 = /* @__PURE__ */ Symbol(_hs$);
|
|
12
13
|
var _h$1 = /* @__PURE__ */ Symbol(_hs$ + 1);
|
|
13
14
|
var _h$2 = /* @__PURE__ */ Symbol(_hs$ + 2);
|
|
15
|
+
var _h$3 = /* @__PURE__ */ Symbol(_hs$ + 3);
|
|
16
|
+
var _h$4 = /* @__PURE__ */ Symbol(_hs$ + 4);
|
|
14
17
|
var __octaneUniversalPlan0 = universalPlan("nativescript", {
|
|
15
18
|
"kind": "range",
|
|
16
19
|
"children": [{
|
|
@@ -29,19 +32,12 @@ var SheetBody = defineUniversalComponent("nativescript", function SheetBody(prop
|
|
|
29
32
|
var Sheet = defineUniversalComponent("nativescript", function Sheet(props) {
|
|
30
33
|
const sentinel = useRef(null, _h$0);
|
|
31
34
|
const shown = useRef(null, _h$1);
|
|
35
|
+
const dismiss = useRef(props.onDismiss, _h$2);
|
|
36
|
+
dismiss.current = props.onDismiss;
|
|
32
37
|
useEffect(() => {
|
|
33
38
|
const cur = shown.current;
|
|
34
39
|
if (!props.open) {
|
|
35
|
-
|
|
36
|
-
shown.current = null;
|
|
37
|
-
cur.programmatic = true;
|
|
38
|
-
cur.unbindTheme?.();
|
|
39
|
-
cur.unbindKeyboard?.();
|
|
40
|
-
cur.root.unmount?.();
|
|
41
|
-
const owner = cur.host.parent;
|
|
42
|
-
if (owner?.hasChild?.(cur.host)) owner.close(cur.host).catch((error) => {
|
|
43
|
-
console.error("[Sheet] close failed", error);
|
|
44
|
-
});
|
|
40
|
+
cur?.lifetime.close();
|
|
45
41
|
return;
|
|
46
42
|
}
|
|
47
43
|
const rl = rootLayoutFor(sentinel.current);
|
|
@@ -57,32 +53,26 @@ var Sheet = defineUniversalComponent("nativescript", function Sheet(props) {
|
|
|
57
53
|
if (props.style) Object.assign(host.style, props.style);
|
|
58
54
|
Object.assign(host, isIOS ? props.ios : isAndroid ? props.android : void 0);
|
|
59
55
|
const root = createNativeScriptRoot(host);
|
|
56
|
+
const lifetime = createOverlayLifetime(rl, host, root, "Sheet", (dismissed) => {
|
|
57
|
+
if (shown.current?.host === host) shown.current = null;
|
|
58
|
+
if (dismissed) dismiss.current?.();
|
|
59
|
+
});
|
|
60
|
+
lifetime.own(unbindTheme);
|
|
60
61
|
const detents = props.detents?.length ? attachSheetDetents(host, props.detents, () => {
|
|
61
62
|
host.parent?.close?.(host)?.catch?.((error) => {
|
|
62
63
|
console.error("[Sheet] close failed", error);
|
|
63
64
|
});
|
|
64
65
|
}) : null;
|
|
65
|
-
|
|
66
|
-
attachTapToBlur(host);
|
|
67
|
-
|
|
66
|
+
lifetime.own(bindBottomInsetToKeyboard(host));
|
|
67
|
+
lifetime.own(attachTapToBlur(host));
|
|
68
|
+
if (detents) lifetime.own(detents.detach);
|
|
69
|
+
shown.current = {
|
|
68
70
|
host,
|
|
69
71
|
root,
|
|
70
|
-
|
|
71
|
-
unbindKeyboard,
|
|
72
|
-
programmatic: false,
|
|
73
|
-
detach: detents?.detach
|
|
72
|
+
lifetime
|
|
74
73
|
};
|
|
75
|
-
shown.current = opened;
|
|
76
74
|
root.render(SheetBody, { children: props.children });
|
|
77
|
-
|
|
78
|
-
if (shown.current === opened) shown.current = null;
|
|
79
|
-
opened.detach?.();
|
|
80
|
-
opened.unbindKeyboard?.();
|
|
81
|
-
opened.unbindTheme?.();
|
|
82
|
-
opened.root.unmount?.();
|
|
83
|
-
if (!opened.programmatic) props.onDismiss?.();
|
|
84
|
-
});
|
|
85
|
-
rl.open(host, {
|
|
75
|
+
lifetime.open({
|
|
86
76
|
...props.shadeCover ?? true ? { shadeCover: {
|
|
87
77
|
opacity: .4,
|
|
88
78
|
tapToClose: true
|
|
@@ -97,13 +87,7 @@ var Sheet = defineUniversalComponent("nativescript", function Sheet(props) {
|
|
|
97
87
|
duration: 200
|
|
98
88
|
}
|
|
99
89
|
} }
|
|
100
|
-
}
|
|
101
|
-
if (shown.current === opened) shown.current = null;
|
|
102
|
-
opened.unbindKeyboard?.();
|
|
103
|
-
opened.unbindTheme?.();
|
|
104
|
-
opened.root.unmount?.();
|
|
105
|
-
console.error("[Sheet] open failed", error);
|
|
106
|
-
});
|
|
90
|
+
}, () => detents?.enter());
|
|
107
91
|
}, [
|
|
108
92
|
props.open,
|
|
109
93
|
props.children,
|
|
@@ -112,7 +96,8 @@ var Sheet = defineUniversalComponent("nativescript", function Sheet(props) {
|
|
|
112
96
|
props.shadeCover,
|
|
113
97
|
props.ios,
|
|
114
98
|
props.android
|
|
115
|
-
], _h$
|
|
99
|
+
], _h$3);
|
|
100
|
+
useEffect(() => () => shown.current?.lifetime.close(), [], _h$4);
|
|
116
101
|
return universalValue(__octaneUniversalPlan1, [(v) => {
|
|
117
102
|
sentinel.current = v;
|
|
118
103
|
}, {
|