@octane-xplat/ui 0.2.1 → 0.4.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 +46 -0
- package/dist/native/octane-client-build.json +1 -1
- package/dist/native/ui.js +52 -19
- package/dist/native/ui10.js +25 -45
- package/dist/native/ui11.js +52 -57
- package/dist/native/ui12.js +47 -16
- package/dist/native/ui13.js +24 -18
- package/dist/native/ui14.js +117 -12
- package/dist/native/ui15.js +78 -17
- package/dist/native/ui16.js +88 -115
- package/dist/native/ui17.js +29 -19
- package/dist/native/ui18.js +34 -12
- package/dist/native/ui19.js +244 -8
- package/dist/native/ui2.js +10 -48
- package/dist/native/ui20.js +28 -0
- package/dist/native/ui21.js +383 -0
- package/dist/native/ui22.js +36 -0
- package/dist/native/ui23.js +55 -0
- package/dist/native/ui24.js +83 -0
- package/dist/native/ui25.js +141 -0
- package/dist/native/ui26.js +12 -0
- package/dist/native/ui27.js +61 -0
- package/dist/native/ui28.js +40 -0
- package/dist/native/ui29.js +108 -0
- package/dist/native/ui3.js +17 -20
- package/dist/native/ui30.js +18 -0
- package/dist/native/ui31.js +58 -0
- package/dist/native/ui32.js +58 -0
- package/dist/native/ui33.js +38 -0
- package/dist/native/ui34.js +53 -0
- package/dist/native/ui35.js +105 -0
- package/dist/native/ui36.js +10 -0
- package/dist/native/ui37.js +44 -0
- package/dist/native/ui38.js +197 -0
- package/dist/native/ui39.js +105 -0
- package/dist/native/ui4.js +23 -48
- package/dist/native/ui40.js +58 -0
- package/dist/native/ui41.js +19 -0
- package/dist/native/ui42.js +8 -0
- package/dist/native/ui43.js +38 -0
- package/dist/native/ui44.js +267 -0
- package/dist/native/ui45.js +28 -0
- package/dist/native/ui46.js +35 -0
- package/dist/native/ui47.js +41 -0
- package/dist/native/ui48.js +72 -0
- package/dist/native/ui49.js +66 -0
- package/dist/native/ui5.js +37 -34
- package/dist/native/ui50.js +27 -0
- package/dist/native/ui51.js +13 -0
- package/dist/native/ui52.js +92 -0
- package/dist/native/ui53.js +34 -0
- package/dist/native/ui54.js +17 -0
- package/dist/native/ui55.js +156 -0
- package/dist/native/ui56.js +33 -0
- package/dist/native/ui57.js +14 -0
- package/dist/native/ui58.js +22 -0
- package/dist/native/ui59.js +8 -0
- package/dist/native/ui6.js +79 -20
- package/dist/native/ui60.js +108 -0
- package/dist/native/ui61.js +76 -0
- package/dist/native/ui7.js +44 -65
- package/dist/native/ui8.js +25 -17
- package/dist/native/ui9.js +24 -12
- package/dist/web/octane-client-build.json +1 -1
- package/dist/web/ui.js +51 -19
- package/dist/web/ui10.js +33 -30
- package/dist/web/ui11.js +40 -55
- package/dist/web/ui12.js +36 -15
- package/dist/web/ui13.js +212 -20
- package/dist/web/ui14.js +84 -14
- package/dist/web/ui15.js +425 -46
- package/dist/web/ui16.js +12 -93
- package/dist/web/ui17.js +246 -28
- package/dist/web/ui18.js +238 -15
- package/dist/web/ui19.js +36 -8
- package/dist/web/ui2.js +15 -103
- package/dist/web/ui20.js +85 -0
- package/dist/web/ui21.js +111 -0
- package/dist/web/ui22.js +108 -0
- package/dist/web/ui23.js +96 -0
- package/dist/web/ui24.js +32 -0
- package/dist/web/ui25.js +108 -0
- package/dist/web/ui26.js +45 -0
- package/dist/web/ui27.js +16 -0
- package/dist/web/ui28.js +11 -0
- package/dist/web/ui29.js +58 -0
- package/dist/web/ui3.js +30 -27
- package/dist/web/ui30.js +34 -0
- package/dist/web/ui31.js +123 -0
- package/dist/web/ui32.js +44 -0
- package/dist/web/ui33.js +159 -0
- package/dist/web/ui34.js +70 -0
- package/dist/web/ui35.js +57 -0
- package/dist/web/ui36.js +22 -0
- package/dist/web/ui37.js +7 -0
- package/dist/web/ui38.js +38 -0
- package/dist/web/ui39.js +154 -0
- package/dist/web/ui4.js +46 -24
- package/dist/web/ui40.js +43 -0
- package/dist/web/ui41.js +42 -0
- package/dist/web/ui42.js +76 -0
- package/dist/web/ui43.js +42 -0
- package/dist/web/ui44.js +62 -0
- package/dist/web/ui45.js +9 -0
- package/dist/web/ui46.js +45 -0
- package/dist/web/ui47.js +13 -0
- package/dist/web/ui48.js +63 -0
- package/dist/web/ui49.js +47 -0
- package/dist/web/ui5.js +158 -52
- package/dist/web/ui50.js +17 -0
- package/dist/web/ui51.js +149 -0
- package/dist/web/ui52.js +42 -0
- package/dist/web/ui53.js +17 -0
- package/dist/web/ui54.js +9 -0
- package/dist/web/ui55.js +22 -0
- package/dist/web/ui56.js +8 -0
- package/dist/web/ui57.js +44 -0
- package/dist/web/ui58.js +46 -0
- package/dist/web/ui6.js +85 -22
- package/dist/web/ui7.js +46 -41
- package/dist/web/ui8.js +28 -11
- package/dist/web/ui9.js +32 -13
- package/package.json +18 -6
- package/src/theme/tokens.css +444 -47
- package/types/index.d.ts +180 -29
- package/types/props.d.ts +553 -8
package/dist/native/ui15.js
CHANGED
|
@@ -1,19 +1,80 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
import { cx } from "./ui2.js";
|
|
2
|
+
import { applyEscapeProps } from "./ui3.js";
|
|
3
|
+
import { layoutChildProps } from "./ui5.js";
|
|
4
|
+
import { defineUniversalComponent, universalPlan, universalProps, universalValue } from "@nativescript-community/octane";
|
|
5
|
+
//#region src/RichText.native.tsrx
|
|
6
|
+
var __octaneUniversalPlan0 = universalPlan("nativescript", {
|
|
7
|
+
"kind": "host",
|
|
8
|
+
"type": "label",
|
|
9
|
+
"propsSlot": 0,
|
|
10
|
+
"children": [{
|
|
11
|
+
"kind": "host",
|
|
12
|
+
"type": "formattedstring",
|
|
13
|
+
"children": [{
|
|
14
|
+
"kind": "slot",
|
|
15
|
+
"slot": 1
|
|
16
|
+
}]
|
|
17
|
+
}]
|
|
18
|
+
});
|
|
19
|
+
var __octaneUniversalPlan1 = universalPlan("nativescript", {
|
|
20
|
+
"kind": "host",
|
|
21
|
+
"type": "span",
|
|
22
|
+
"propsSlot": 0
|
|
23
|
+
});
|
|
24
|
+
var RichText = defineUniversalComponent("nativescript", function RichText(props) {
|
|
25
|
+
return universalValue(__octaneUniversalPlan0, [universalProps([
|
|
26
|
+
[
|
|
27
|
+
"set",
|
|
28
|
+
"id",
|
|
29
|
+
props.id
|
|
30
|
+
],
|
|
31
|
+
[
|
|
32
|
+
"set",
|
|
33
|
+
"ref",
|
|
34
|
+
(el) => applyEscapeProps(el, props)
|
|
35
|
+
],
|
|
36
|
+
["spread", layoutChildProps(props)],
|
|
37
|
+
[
|
|
38
|
+
"set",
|
|
39
|
+
"className",
|
|
40
|
+
cx("vx-rich-text", props.className)
|
|
41
|
+
],
|
|
42
|
+
[
|
|
43
|
+
"set",
|
|
44
|
+
"style",
|
|
45
|
+
props.style
|
|
46
|
+
],
|
|
47
|
+
[
|
|
48
|
+
"set",
|
|
49
|
+
"whiteSpace",
|
|
50
|
+
"normal"
|
|
51
|
+
]
|
|
52
|
+
]), props.children]);
|
|
53
|
+
}, { "module": "@nativescript-community/octane" });
|
|
54
|
+
function runText(props) {
|
|
55
|
+
if (props.text !== void 0) return props.text;
|
|
56
|
+
if (typeof props.children === "string" || typeof props.children === "number") return String(props.children);
|
|
57
|
+
return "";
|
|
17
58
|
}
|
|
59
|
+
var RichTextSpan = defineUniversalComponent("nativescript", function RichTextSpan(props) {
|
|
60
|
+
return universalValue(__octaneUniversalPlan1, [universalProps([
|
|
61
|
+
[
|
|
62
|
+
"set",
|
|
63
|
+
"text",
|
|
64
|
+
runText(props)
|
|
65
|
+
],
|
|
66
|
+
[
|
|
67
|
+
"set",
|
|
68
|
+
"className",
|
|
69
|
+
cx(props.className)
|
|
70
|
+
],
|
|
71
|
+
["spread", props.style],
|
|
72
|
+
[
|
|
73
|
+
"set",
|
|
74
|
+
"onLinkTap",
|
|
75
|
+
props.onPress
|
|
76
|
+
]
|
|
77
|
+
])]);
|
|
78
|
+
}, { "module": "@nativescript-community/octane" });
|
|
18
79
|
//#endregion
|
|
19
|
-
export {
|
|
80
|
+
export { RichText, RichTextSpan };
|
package/dist/native/ui16.js
CHANGED
|
@@ -1,143 +1,116 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
1
|
+
import { cx } from "./ui2.js";
|
|
2
|
+
import { applyEscapeProps, nativeAccessibilityState } from "./ui3.js";
|
|
3
|
+
import { glassClassOf, glassConfigOf } from "./ui4.js";
|
|
4
|
+
import { layoutChildProps } from "./ui5.js";
|
|
5
|
+
import { defineUniversalComponent, universalPlan, universalProps, universalValue } from "@nativescript-community/octane";
|
|
6
|
+
//#region src/Pressable.native.tsrx
|
|
5
7
|
var __octaneUniversalPlan0 = universalPlan("nativescript", {
|
|
6
|
-
"kind": "
|
|
8
|
+
"kind": "host",
|
|
9
|
+
"type": "flexboxlayout",
|
|
10
|
+
"propsSlot": 0,
|
|
7
11
|
"children": [{
|
|
8
12
|
"kind": "slot",
|
|
9
|
-
"slot":
|
|
13
|
+
"slot": 1
|
|
10
14
|
}]
|
|
11
15
|
});
|
|
12
|
-
var
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
["items", 3],
|
|
20
|
-
["selectedIndex", 4],
|
|
21
|
-
["onSelectedIndexChanged", 5],
|
|
22
|
-
["onLoaded", 6]
|
|
23
|
-
]
|
|
24
|
-
});
|
|
25
|
-
var __octaneUniversalPlan2 = universalPlan("nativescript", {
|
|
26
|
-
"kind": "slot",
|
|
27
|
-
"slot": 0
|
|
28
|
-
});
|
|
29
|
-
var TabPane = defineUniversalComponent("nativescript", function TabPane(props) {
|
|
30
|
-
return universalValue(__octaneUniversalPlan0, [props.render()]);
|
|
31
|
-
}, { "module": "@nativescript-community/octane" });
|
|
32
|
-
var paneRoots = /* @__PURE__ */ new WeakMap();
|
|
33
|
-
var tabsByView = /* @__PURE__ */ new WeakMap();
|
|
34
|
-
var itemsCache = /* @__PURE__ */ new WeakMap();
|
|
35
|
-
function itemsFor(tabs) {
|
|
36
|
-
let items = itemsCache.get(tabs);
|
|
37
|
-
if (items !== void 0) return items;
|
|
38
|
-
items = tabs.map((t) => {
|
|
39
|
-
const item = new TabViewItem();
|
|
40
|
-
item.title = t.title;
|
|
41
|
-
if (t.stack) {
|
|
42
|
-
const frame = new Frame();
|
|
43
|
-
frame.once("loaded", () => {
|
|
44
|
-
frame.navigate({ create: () => {
|
|
45
|
-
const page = new Page();
|
|
46
|
-
page.actionBarHidden = true;
|
|
47
|
-
createNativeScriptRoot(page).render(TabPane, { render: t.render });
|
|
48
|
-
return page;
|
|
49
|
-
} });
|
|
50
|
-
});
|
|
51
|
-
registerStack(t.stack, frame);
|
|
52
|
-
item.view = frame;
|
|
53
|
-
return item;
|
|
54
|
-
}
|
|
55
|
-
const cv = new ContentView();
|
|
56
|
-
tabsByView.set(cv, t.render);
|
|
57
|
-
item.view = cv;
|
|
58
|
-
return item;
|
|
59
|
-
});
|
|
60
|
-
itemsCache.set(tabs, items);
|
|
61
|
-
return items;
|
|
62
|
-
}
|
|
63
|
-
function mountPanes(e) {
|
|
64
|
-
const tv = e.object;
|
|
65
|
-
for (const item of tv.items) {
|
|
66
|
-
const cv = item.view;
|
|
67
|
-
if (!(cv instanceof ContentView) || paneRoots.has(cv)) continue;
|
|
68
|
-
const render = tabsByView.get(cv);
|
|
69
|
-
if (!render) continue;
|
|
70
|
-
const root = createNativeScriptRoot(cv);
|
|
71
|
-
paneRoots.set(cv, root);
|
|
72
|
-
root.render(TabPane, { render });
|
|
73
|
-
}
|
|
74
|
-
console.log("[probe] tabs mounted panes=" + tv.items.length);
|
|
75
|
-
}
|
|
76
|
-
var TabsInner = defineUniversalComponent("nativescript", function TabsInner(props) {
|
|
77
|
-
return universalValue(__octaneUniversalPlan1, [
|
|
78
|
-
props.id,
|
|
79
|
-
props.className,
|
|
80
|
-
props.style,
|
|
81
|
-
itemsFor(props.tabs),
|
|
82
|
-
props.selectedIndex,
|
|
83
|
-
(e) => props.onSelectedIndexChanged?.(e.value),
|
|
84
|
-
mountPanes
|
|
85
|
-
]);
|
|
86
|
-
}, { "module": "@nativescript-community/octane" });
|
|
87
|
-
var MemoTabs = memo(TabsInner, (a, b) => a.tabs === b.tabs && a.selectedIndex === b.selectedIndex);
|
|
88
|
-
var Tabs = defineUniversalComponent("nativescript", markWarm(function Tabs(props) {
|
|
89
|
-
useBatch([], () => {
|
|
90
|
-
warmChild(MemoTabs, {
|
|
91
|
-
id: props.id,
|
|
92
|
-
className: props.className,
|
|
93
|
-
style: props.style,
|
|
94
|
-
tabs: props.tabs,
|
|
95
|
-
selectedIndex: props.selectedIndex,
|
|
96
|
-
onSelectedIndexChanged: props.onSelectedIndexChanged
|
|
97
|
-
});
|
|
98
|
-
});
|
|
99
|
-
return universalValue(__octaneUniversalPlan2, [universalComponent("nativescript", MemoTabs, universalProps([
|
|
16
|
+
var Pressable = defineUniversalComponent("nativescript", function Pressable(props) {
|
|
17
|
+
return universalValue(__octaneUniversalPlan0, [universalProps([
|
|
18
|
+
[
|
|
19
|
+
"set",
|
|
20
|
+
"ref",
|
|
21
|
+
(v) => applyEscapeProps(v, props)
|
|
22
|
+
],
|
|
100
23
|
[
|
|
101
24
|
"set",
|
|
102
25
|
"id",
|
|
103
26
|
props.id
|
|
104
27
|
],
|
|
28
|
+
["spread", layoutChildProps(props)],
|
|
105
29
|
[
|
|
106
30
|
"set",
|
|
107
31
|
"className",
|
|
108
|
-
props.className
|
|
32
|
+
cx("vx-pressable", glassClassOf(props.glass), props.className)
|
|
33
|
+
],
|
|
34
|
+
[
|
|
35
|
+
"set",
|
|
36
|
+
"iosGlassEffect",
|
|
37
|
+
glassConfigOf(props.glass)
|
|
109
38
|
],
|
|
110
39
|
[
|
|
111
40
|
"set",
|
|
112
41
|
"style",
|
|
113
|
-
|
|
42
|
+
{
|
|
43
|
+
...props.style,
|
|
44
|
+
...props.hitSlop ? {
|
|
45
|
+
margin: -props.hitSlop,
|
|
46
|
+
padding: props.hitSlop
|
|
47
|
+
} : {}
|
|
48
|
+
}
|
|
49
|
+
],
|
|
50
|
+
[
|
|
51
|
+
"set",
|
|
52
|
+
"accessible",
|
|
53
|
+
props.accessible
|
|
54
|
+
],
|
|
55
|
+
[
|
|
56
|
+
"set",
|
|
57
|
+
"accessibilityLabel",
|
|
58
|
+
props.accessibilityLabel
|
|
59
|
+
],
|
|
60
|
+
[
|
|
61
|
+
"set",
|
|
62
|
+
"accessibilityRole",
|
|
63
|
+
props.accessibilityRole
|
|
64
|
+
],
|
|
65
|
+
[
|
|
66
|
+
"set",
|
|
67
|
+
"accessibilityHint",
|
|
68
|
+
props.accessibilityHint
|
|
69
|
+
],
|
|
70
|
+
[
|
|
71
|
+
"set",
|
|
72
|
+
"accessibilityValue",
|
|
73
|
+
props.accessibilityValue
|
|
74
|
+
],
|
|
75
|
+
[
|
|
76
|
+
"set",
|
|
77
|
+
"accessibilityState",
|
|
78
|
+
nativeAccessibilityState(props.accessibilityState)
|
|
114
79
|
],
|
|
115
80
|
[
|
|
116
81
|
"set",
|
|
117
|
-
"
|
|
118
|
-
props.
|
|
82
|
+
"accessibilityLiveRegion",
|
|
83
|
+
props.accessibilityLiveRegion
|
|
119
84
|
],
|
|
120
85
|
[
|
|
121
86
|
"set",
|
|
122
|
-
"
|
|
123
|
-
props.
|
|
87
|
+
"ignoreTouchAnimation",
|
|
88
|
+
props.ignoreTouchAnimation
|
|
124
89
|
],
|
|
125
90
|
[
|
|
126
91
|
"set",
|
|
127
|
-
"
|
|
128
|
-
props.
|
|
92
|
+
"onTap",
|
|
93
|
+
props.disabled ? void 0 : props.onPress
|
|
94
|
+
],
|
|
95
|
+
[
|
|
96
|
+
"set",
|
|
97
|
+
"onLongPress",
|
|
98
|
+
props.disabled ? void 0 : props.onLongPress
|
|
99
|
+
],
|
|
100
|
+
[
|
|
101
|
+
"set",
|
|
102
|
+
"onDoubleTap",
|
|
103
|
+
props.disabled ? void 0 : props.onDoublePress
|
|
104
|
+
],
|
|
105
|
+
[
|
|
106
|
+
"set",
|
|
107
|
+
"onTouch",
|
|
108
|
+
props.disabled ? void 0 : (e) => {
|
|
109
|
+
if (e.action === "down") props.onPressIn?.();
|
|
110
|
+
else if (e.action === "up" || e.action === "cancel") props.onPressOut?.();
|
|
111
|
+
}
|
|
129
112
|
]
|
|
130
|
-
])
|
|
131
|
-
},
|
|
132
|
-
const props = __wp;
|
|
133
|
-
warmChild(MemoTabs, {
|
|
134
|
-
id: props.id,
|
|
135
|
-
className: props.className,
|
|
136
|
-
style: props.style,
|
|
137
|
-
tabs: props.tabs,
|
|
138
|
-
selectedIndex: props.selectedIndex,
|
|
139
|
-
onSelectedIndexChanged: props.onSelectedIndexChanged
|
|
140
|
-
});
|
|
141
|
-
}), { "module": "@nativescript-community/octane" });
|
|
113
|
+
]), props.children]);
|
|
114
|
+
}, { "module": "@nativescript-community/octane" });
|
|
142
115
|
//#endregion
|
|
143
|
-
export {
|
|
116
|
+
export { Pressable };
|
package/dist/native/ui17.js
CHANGED
|
@@ -1,24 +1,34 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { Pressable } from "./ui16.js";
|
|
2
|
+
import { defineUniversalComponent, universalChildren, universalComponent, universalPlan, universalProps, universalValue } from "@nativescript-community/octane";
|
|
3
|
+
import { Utils } from "@nativescript/core";
|
|
4
|
+
//#region src/Link.native.tsrx
|
|
3
5
|
var __octaneUniversalPlan0 = universalPlan("nativescript", {
|
|
4
6
|
"kind": "host",
|
|
5
|
-
"type": "
|
|
6
|
-
"
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
["onCheckedChange", 4]
|
|
12
|
-
]
|
|
7
|
+
"type": "flexboxlayout",
|
|
8
|
+
"props": { "flexDirection": "row" },
|
|
9
|
+
"children": [{
|
|
10
|
+
"kind": "slot",
|
|
11
|
+
"slot": 0
|
|
12
|
+
}]
|
|
13
13
|
});
|
|
14
|
-
var
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
14
|
+
var __octaneUniversalPlan1 = universalPlan("nativescript", {
|
|
15
|
+
"kind": "slot",
|
|
16
|
+
"slot": 0
|
|
17
|
+
});
|
|
18
|
+
var Link = defineUniversalComponent("nativescript", function Link(props) {
|
|
19
|
+
return universalValue(__octaneUniversalPlan1, [universalComponent("nativescript", Pressable, universalProps([[
|
|
20
|
+
"set",
|
|
21
|
+
"className",
|
|
22
|
+
props.className
|
|
23
|
+
], [
|
|
24
|
+
"set",
|
|
25
|
+
"onPress",
|
|
26
|
+
() => {
|
|
27
|
+
Utils.openUrl(props.href);
|
|
28
|
+
}
|
|
29
|
+
]], universalChildren("nativescript", () => {
|
|
30
|
+
return universalValue(__octaneUniversalPlan0, [props.children]);
|
|
31
|
+
})))]);
|
|
22
32
|
}, { "module": "@nativescript-community/octane" });
|
|
23
33
|
//#endregion
|
|
24
|
-
export {
|
|
34
|
+
export { Link };
|
package/dist/native/ui18.js
CHANGED
|
@@ -1,13 +1,35 @@
|
|
|
1
|
-
import {
|
|
2
|
-
//#region src/
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
})
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { Application, Frame } from "@nativescript/core";
|
|
2
|
+
//#region src/stacks.native.ts
|
|
3
|
+
/** Named parallel stacks. A shell (Tabs with `stack` on a spec, the app
|
|
4
|
+
* entry's root frame) registers its Frame here; `pushRoute` resolves the
|
|
5
|
+
* target by name. Native-only concept — on web, parallel stacks map to
|
|
6
|
+
* nested routes (one linear URL stack). 'root' needs no registration:
|
|
7
|
+
* unregistered, it resolves to the app's root view when that's a
|
|
8
|
+
* Frame — the standard `Application.run({ create: () => frame })` boot
|
|
9
|
+
* shape. An explicit registerStack('root', frame) overrides it. */
|
|
10
|
+
var stacks = /* @__PURE__ */ new Map();
|
|
11
|
+
var regListeners = /* @__PURE__ */ new Set();
|
|
12
|
+
function registerStack(name, frame) {
|
|
13
|
+
stacks.set(name, frame);
|
|
14
|
+
regListeners.forEach((l) => l(name, frame));
|
|
15
|
+
}
|
|
16
|
+
function getStack(name) {
|
|
17
|
+
const registered = stacks.get(name);
|
|
18
|
+
if (registered) return registered;
|
|
19
|
+
if (name === "root") {
|
|
20
|
+
const rv = Application.getRootView?.();
|
|
21
|
+
if (rv instanceof Frame) return rv;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
/** All registered stacks in registration order — for hardware-back
|
|
25
|
+
* resolution (pop whichever stack is visibly on top). */
|
|
26
|
+
function stackEntries() {
|
|
27
|
+
return stacks.entries();
|
|
28
|
+
}
|
|
29
|
+
/** Internal: route.native attaches frame listeners as stacks appear —
|
|
30
|
+
* named frames can register after a useRoute subscription ran. */
|
|
31
|
+
function onStackRegistered(cb) {
|
|
32
|
+
regListeners.add(cb);
|
|
33
|
+
}
|
|
12
34
|
//#endregion
|
|
13
|
-
export {
|
|
35
|
+
export { getStack, onStackRegistered, registerStack, stackEntries };
|