@octane-xplat/ui 0.2.0 → 0.3.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/dist/native/octane-client-build.json +1 -1
- package/dist/native/ui.js +40 -19
- package/dist/native/ui10.js +19 -48
- package/dist/native/ui11.js +118 -56
- package/dist/native/ui12.js +114 -16
- package/dist/native/ui13.js +54 -18
- package/dist/native/ui14.js +76 -13
- package/dist/native/ui15.js +128 -18
- package/dist/native/ui16.js +48 -136
- package/dist/native/ui17.js +42 -19
- package/dist/native/ui18.js +50 -9
- package/dist/native/ui19.js +34 -12
- package/dist/native/ui2.js +10 -48
- package/dist/native/ui20.js +17 -0
- package/dist/native/ui21.js +93 -0
- package/dist/native/ui22.js +124 -0
- package/dist/native/ui23.js +103 -0
- package/dist/native/ui24.js +58 -0
- package/dist/native/ui25.js +19 -0
- package/dist/native/ui26.js +27 -0
- package/dist/native/ui27.js +35 -0
- package/dist/native/ui28.js +146 -0
- package/dist/native/ui29.js +28 -0
- package/dist/native/ui3.js +17 -20
- package/dist/native/ui30.js +35 -0
- package/dist/native/ui31.js +39 -0
- package/dist/native/ui32.js +70 -0
- package/dist/native/ui33.js +30 -0
- package/dist/native/ui34.js +10 -0
- package/dist/native/ui35.js +27 -0
- package/dist/native/ui36.js +34 -0
- package/dist/native/ui37.js +17 -0
- package/dist/native/ui38.js +68 -0
- package/dist/native/ui39.js +33 -0
- package/dist/native/ui4.js +21 -48
- package/dist/native/ui40.js +14 -0
- package/dist/native/ui41.js +104 -0
- package/dist/native/ui42.js +148 -0
- package/dist/native/ui43.js +22 -0
- package/dist/native/ui44.js +8 -0
- package/dist/native/ui5.js +70 -27
- package/dist/native/ui6.js +36 -20
- package/dist/native/ui7.js +24 -61
- package/dist/native/ui8.js +16 -18
- package/dist/native/ui9.js +16 -13
- package/dist/web/octane-client-build.json +1 -1
- package/dist/web/ui.js +40 -19
- package/dist/web/ui10.js +187 -31
- package/dist/web/ui11.js +419 -53
- package/dist/web/ui12.js +83 -15
- package/dist/web/ui13.js +107 -19
- package/dist/web/ui14.js +98 -18
- package/dist/web/ui15.js +83 -47
- package/dist/web/ui16.js +100 -93
- package/dist/web/ui17.js +36 -22
- package/dist/web/ui18.js +29 -15
- package/dist/web/ui19.js +9 -7
- package/dist/web/ui2.js +15 -103
- package/dist/web/ui20.js +114 -0
- package/dist/web/ui21.js +82 -0
- package/dist/web/ui22.js +68 -0
- package/dist/web/ui23.js +57 -0
- package/dist/web/ui24.js +16 -0
- package/dist/web/ui25.js +22 -0
- package/dist/web/ui26.js +39 -0
- package/dist/web/ui27.js +127 -0
- package/dist/web/ui28.js +112 -0
- package/dist/web/ui29.js +108 -0
- package/dist/web/ui3.js +19 -27
- package/dist/web/ui30.js +43 -0
- package/dist/web/ui31.js +42 -0
- package/dist/web/ui32.js +77 -0
- package/dist/web/ui33.js +43 -0
- package/dist/web/ui34.js +67 -0
- package/dist/web/ui35.js +9 -0
- package/dist/web/ui36.js +45 -0
- package/dist/web/ui37.js +47 -0
- package/dist/web/ui38.js +17 -0
- package/dist/web/ui39.js +100 -0
- package/dist/web/ui4.js +145 -17
- package/dist/web/ui40.js +41 -0
- package/dist/web/ui41.js +17 -0
- package/dist/web/ui42.js +9 -0
- package/dist/web/ui43.js +22 -0
- package/dist/web/ui44.js +8 -0
- package/dist/web/ui5.js +54 -52
- package/dist/web/ui6.js +43 -16
- package/dist/web/ui7.js +29 -36
- package/dist/web/ui8.js +29 -18
- package/dist/web/ui9.js +24 -16
- package/package.json +14 -3
- package/src/theme/tokens.css +166 -0
- package/types/index.d.ts +108 -1
- package/types/props.d.ts +333 -8
package/dist/native/ui15.js
CHANGED
|
@@ -1,19 +1,129 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
1
|
+
import { cx } from "./ui2.js";
|
|
2
|
+
import { defineUniversalComponent, memo, universalComponent, universalIf, universalPlan, universalProps, universalValue } from "@nativescript-community/octane";
|
|
3
|
+
import { isAndroid, isIOS } from "@nativescript/core";
|
|
4
|
+
//#region src/List.native.tsrx
|
|
5
|
+
var __octaneUniversalPlan0 = universalPlan("nativescript", {
|
|
6
|
+
"kind": "host",
|
|
7
|
+
"type": "gridlayout",
|
|
8
|
+
"children": [{
|
|
9
|
+
"kind": "slot",
|
|
10
|
+
"slot": 0
|
|
11
|
+
}]
|
|
12
|
+
});
|
|
13
|
+
var __octaneUniversalPlan1 = universalPlan("nativescript", {
|
|
14
|
+
"kind": "host",
|
|
15
|
+
"type": "listview",
|
|
16
|
+
"propsSlot": 0
|
|
17
|
+
});
|
|
18
|
+
var __octaneUniversalPlan2 = universalPlan("nativescript", {
|
|
19
|
+
"kind": "slot",
|
|
20
|
+
"slot": 0
|
|
21
|
+
});
|
|
22
|
+
var __octaneUniversalPlan3 = universalPlan("nativescript", {
|
|
23
|
+
"kind": "range",
|
|
24
|
+
"children": [{
|
|
25
|
+
"kind": "slot",
|
|
26
|
+
"slot": 0
|
|
27
|
+
}]
|
|
28
|
+
});
|
|
29
|
+
var __octaneUniversalPlan4 = universalPlan("nativescript", {
|
|
30
|
+
"kind": "slot",
|
|
31
|
+
"slot": 0
|
|
32
|
+
});
|
|
33
|
+
var ListInner = defineUniversalComponent("nativescript", function ListInner(props) {
|
|
34
|
+
const platformProps = Object.assign({}, isIOS ? props.ios : {}, isAndroid ? props.android : {});
|
|
35
|
+
return universalValue(__octaneUniversalPlan1, [universalProps([
|
|
36
|
+
[
|
|
37
|
+
"set",
|
|
38
|
+
"id",
|
|
39
|
+
props.id
|
|
40
|
+
],
|
|
41
|
+
[
|
|
42
|
+
"set",
|
|
43
|
+
"className",
|
|
44
|
+
cx(props.className)
|
|
45
|
+
],
|
|
46
|
+
[
|
|
47
|
+
"set",
|
|
48
|
+
"style",
|
|
49
|
+
props.style
|
|
50
|
+
],
|
|
51
|
+
[
|
|
52
|
+
"set",
|
|
53
|
+
"items",
|
|
54
|
+
props.items
|
|
55
|
+
],
|
|
56
|
+
[
|
|
57
|
+
"set",
|
|
58
|
+
"iosEstimatedRowHeight",
|
|
59
|
+
isIOS ? props.estimatedItemHeight : void 0
|
|
60
|
+
],
|
|
61
|
+
[
|
|
62
|
+
"set",
|
|
63
|
+
"onLoadMoreItems",
|
|
64
|
+
props.onEndReached
|
|
65
|
+
],
|
|
66
|
+
[
|
|
67
|
+
"set",
|
|
68
|
+
"renderItem",
|
|
69
|
+
(item, index) => universalValue(__octaneUniversalPlan0, [props.renderItem(item, index)])
|
|
70
|
+
],
|
|
71
|
+
["spread", platformProps]
|
|
72
|
+
])]);
|
|
73
|
+
}, { "module": "@nativescript-community/octane" });
|
|
74
|
+
var MemoListView = memo(ListInner, (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.android === b.android);
|
|
75
|
+
var List = defineUniversalComponent("nativescript", function List(props) {
|
|
76
|
+
return universalValue(__octaneUniversalPlan4, [universalIf(props.items.length > 0, () => {
|
|
77
|
+
return universalValue(__octaneUniversalPlan2, [universalComponent("nativescript", MemoListView, universalProps([
|
|
78
|
+
[
|
|
79
|
+
"set",
|
|
80
|
+
"id",
|
|
81
|
+
props.id
|
|
82
|
+
],
|
|
83
|
+
[
|
|
84
|
+
"set",
|
|
85
|
+
"items",
|
|
86
|
+
props.items
|
|
87
|
+
],
|
|
88
|
+
[
|
|
89
|
+
"set",
|
|
90
|
+
"className",
|
|
91
|
+
props.className
|
|
92
|
+
],
|
|
93
|
+
[
|
|
94
|
+
"set",
|
|
95
|
+
"style",
|
|
96
|
+
props.style
|
|
97
|
+
],
|
|
98
|
+
[
|
|
99
|
+
"set",
|
|
100
|
+
"renderItem",
|
|
101
|
+
props.renderItem
|
|
102
|
+
],
|
|
103
|
+
[
|
|
104
|
+
"set",
|
|
105
|
+
"estimatedItemHeight",
|
|
106
|
+
props.estimatedItemHeight
|
|
107
|
+
],
|
|
108
|
+
[
|
|
109
|
+
"set",
|
|
110
|
+
"onEndReached",
|
|
111
|
+
props.onEndReached
|
|
112
|
+
],
|
|
113
|
+
[
|
|
114
|
+
"set",
|
|
115
|
+
"ios",
|
|
116
|
+
props.ios
|
|
117
|
+
],
|
|
118
|
+
[
|
|
119
|
+
"set",
|
|
120
|
+
"android",
|
|
121
|
+
props.android
|
|
122
|
+
]
|
|
123
|
+
]))]);
|
|
124
|
+
}, () => {
|
|
125
|
+
return universalValue(__octaneUniversalPlan3, [props.renderEmpty?.()]);
|
|
126
|
+
})]);
|
|
127
|
+
}, { "module": "@nativescript-community/octane" });
|
|
18
128
|
//#endregion
|
|
19
|
-
export {
|
|
129
|
+
export { List };
|
package/dist/native/ui16.js
CHANGED
|
@@ -1,143 +1,55 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
1
|
+
import { cx } from "./ui2.js";
|
|
2
|
+
import { applyEscapeProps } from "./ui3.js";
|
|
3
|
+
import { layoutChildProps } from "./ui4.js";
|
|
4
|
+
import { defineUniversalComponent, universalPlan, universalProps, universalValue } from "@nativescript-community/octane";
|
|
5
|
+
//#region src/ScrollView.native.tsrx
|
|
5
6
|
var __octaneUniversalPlan0 = universalPlan("nativescript", {
|
|
6
|
-
"kind": "
|
|
7
|
+
"kind": "host",
|
|
8
|
+
"type": "scrollview",
|
|
9
|
+
"propsSlot": 0,
|
|
7
10
|
"children": [{
|
|
8
|
-
"kind": "
|
|
9
|
-
"
|
|
11
|
+
"kind": "host",
|
|
12
|
+
"type": "flexboxlayout",
|
|
13
|
+
"bindings": [["flexDirection", 1]],
|
|
14
|
+
"children": [{
|
|
15
|
+
"kind": "slot",
|
|
16
|
+
"slot": 2
|
|
17
|
+
}]
|
|
10
18
|
}]
|
|
11
19
|
});
|
|
12
|
-
var
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
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
|
|
20
|
+
var ScrollView = defineUniversalComponent("nativescript", function ScrollView(props) {
|
|
21
|
+
return universalValue(__octaneUniversalPlan0, [
|
|
22
|
+
universalProps([
|
|
23
|
+
[
|
|
24
|
+
"set",
|
|
25
|
+
"ref",
|
|
26
|
+
(v) => applyEscapeProps(v, props)
|
|
27
|
+
],
|
|
28
|
+
[
|
|
29
|
+
"set",
|
|
30
|
+
"id",
|
|
31
|
+
props.id
|
|
32
|
+
],
|
|
33
|
+
["spread", layoutChildProps(props)],
|
|
34
|
+
[
|
|
35
|
+
"set",
|
|
36
|
+
"className",
|
|
37
|
+
cx(props.className)
|
|
38
|
+
],
|
|
39
|
+
[
|
|
40
|
+
"set",
|
|
41
|
+
"style",
|
|
42
|
+
props.style
|
|
43
|
+
],
|
|
44
|
+
[
|
|
45
|
+
"set",
|
|
46
|
+
"orientation",
|
|
47
|
+
props.horizontal ? "horizontal" : "vertical"
|
|
48
|
+
]
|
|
49
|
+
]),
|
|
50
|
+
props.horizontal ? "row" : "column",
|
|
51
|
+
props.children
|
|
85
52
|
]);
|
|
86
53
|
}, { "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([
|
|
100
|
-
[
|
|
101
|
-
"set",
|
|
102
|
-
"id",
|
|
103
|
-
props.id
|
|
104
|
-
],
|
|
105
|
-
[
|
|
106
|
-
"set",
|
|
107
|
-
"className",
|
|
108
|
-
props.className
|
|
109
|
-
],
|
|
110
|
-
[
|
|
111
|
-
"set",
|
|
112
|
-
"style",
|
|
113
|
-
props.style
|
|
114
|
-
],
|
|
115
|
-
[
|
|
116
|
-
"set",
|
|
117
|
-
"tabs",
|
|
118
|
-
props.tabs
|
|
119
|
-
],
|
|
120
|
-
[
|
|
121
|
-
"set",
|
|
122
|
-
"selectedIndex",
|
|
123
|
-
props.selectedIndex
|
|
124
|
-
],
|
|
125
|
-
[
|
|
126
|
-
"set",
|
|
127
|
-
"onSelectedIndexChanged",
|
|
128
|
-
props.onSelectedIndexChanged
|
|
129
|
-
]
|
|
130
|
-
]))]);
|
|
131
|
-
}, (__wp) => {
|
|
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" });
|
|
142
54
|
//#endregion
|
|
143
|
-
export {
|
|
55
|
+
export { ScrollView };
|
package/dist/native/ui17.js
CHANGED
|
@@ -1,24 +1,47 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { cx } from "./ui2.js";
|
|
2
|
+
import { applyEscapeProps } from "./ui3.js";
|
|
3
|
+
import { layoutChildProps } from "./ui4.js";
|
|
4
|
+
import { defineUniversalComponent, universalPlan, universalProps, universalValue } from "@nativescript-community/octane";
|
|
5
|
+
//#region src/Image.native.tsrx
|
|
3
6
|
var __octaneUniversalPlan0 = universalPlan("nativescript", {
|
|
4
7
|
"kind": "host",
|
|
5
|
-
"type": "
|
|
6
|
-
"
|
|
7
|
-
["id", 0],
|
|
8
|
-
["className", 1],
|
|
9
|
-
["style", 2],
|
|
10
|
-
["checked", 3],
|
|
11
|
-
["onCheckedChange", 4]
|
|
12
|
-
]
|
|
8
|
+
"type": "image",
|
|
9
|
+
"propsSlot": 0
|
|
13
10
|
});
|
|
14
|
-
var
|
|
15
|
-
return universalValue(__octaneUniversalPlan0, [
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
11
|
+
var Image = defineUniversalComponent("nativescript", function Image(props) {
|
|
12
|
+
return universalValue(__octaneUniversalPlan0, [universalProps([
|
|
13
|
+
[
|
|
14
|
+
"set",
|
|
15
|
+
"ref",
|
|
16
|
+
(v) => applyEscapeProps(v, props)
|
|
17
|
+
],
|
|
18
|
+
[
|
|
19
|
+
"set",
|
|
20
|
+
"id",
|
|
21
|
+
props.id
|
|
22
|
+
],
|
|
23
|
+
["spread", layoutChildProps(props)],
|
|
24
|
+
[
|
|
25
|
+
"set",
|
|
26
|
+
"className",
|
|
27
|
+
cx(props.className)
|
|
28
|
+
],
|
|
29
|
+
[
|
|
30
|
+
"set",
|
|
31
|
+
"style",
|
|
32
|
+
props.style
|
|
33
|
+
],
|
|
34
|
+
[
|
|
35
|
+
"set",
|
|
36
|
+
"src",
|
|
37
|
+
props.src
|
|
38
|
+
],
|
|
39
|
+
[
|
|
40
|
+
"set",
|
|
41
|
+
"accessibilityLabel",
|
|
42
|
+
props.alt
|
|
43
|
+
]
|
|
44
|
+
])]);
|
|
22
45
|
}, { "module": "@nativescript-community/octane" });
|
|
23
46
|
//#endregion
|
|
24
|
-
export {
|
|
47
|
+
export { Image };
|
package/dist/native/ui18.js
CHANGED
|
@@ -1,13 +1,54 @@
|
|
|
1
|
-
import { defineUniversalComponent, universalPlan, universalValue } from "@nativescript-community/octane";
|
|
2
|
-
|
|
1
|
+
import { createNativeScriptRoot, defineUniversalComponent, hookSlots, universalPlan, universalValue, useEffect, useRef } from "@nativescript-community/octane";
|
|
2
|
+
import { Frame, GridLayout } from "@nativescript/core";
|
|
3
|
+
//#region src/Modal.native.tsrx
|
|
4
|
+
var _hs$ = /* @__PURE__ */ hookSlots(2);
|
|
5
|
+
var _h$0 = /* @__PURE__ */ Symbol(_hs$);
|
|
6
|
+
var _h$1 = /* @__PURE__ */ Symbol(_hs$ + 1);
|
|
3
7
|
var __octaneUniversalPlan0 = universalPlan("nativescript", {
|
|
4
|
-
"kind": "
|
|
5
|
-
"
|
|
6
|
-
|
|
7
|
-
|
|
8
|
+
"kind": "range",
|
|
9
|
+
"children": [{
|
|
10
|
+
"kind": "slot",
|
|
11
|
+
"slot": 0
|
|
12
|
+
}]
|
|
8
13
|
});
|
|
9
|
-
var
|
|
10
|
-
|
|
14
|
+
var __octaneUniversalPlan1 = universalPlan("nativescript", {
|
|
15
|
+
"kind": "range",
|
|
16
|
+
"children": []
|
|
17
|
+
});
|
|
18
|
+
var Panel = defineUniversalComponent("nativescript", function Panel(props) {
|
|
19
|
+
return universalValue(__octaneUniversalPlan0, [props.children]);
|
|
20
|
+
}, { "module": "@nativescript-community/octane" });
|
|
21
|
+
var Modal = defineUniversalComponent("nativescript", function Modal(props) {
|
|
22
|
+
const shown = useRef(null, _h$0);
|
|
23
|
+
useEffect(() => {
|
|
24
|
+
if (props.open && !shown.current) {
|
|
25
|
+
const presenter = Frame.topmost()?.currentPage ?? Frame.topmost();
|
|
26
|
+
if (!presenter) return;
|
|
27
|
+
const host = new GridLayout();
|
|
28
|
+
const root = createNativeScriptRoot(host);
|
|
29
|
+
shown.current = {
|
|
30
|
+
host,
|
|
31
|
+
root
|
|
32
|
+
};
|
|
33
|
+
if (props.component) root.render(props.component, props.params ?? {});
|
|
34
|
+
else root.render(Panel, { children: props.children });
|
|
35
|
+
const fullscreen = props.presentation ? props.presentation === "fullscreen" : props.fullscreen ?? true;
|
|
36
|
+
presenter.showModal(host, {
|
|
37
|
+
context: {},
|
|
38
|
+
closeCallback: (result) => {
|
|
39
|
+
shown.current = null;
|
|
40
|
+
props.onClose?.(result);
|
|
41
|
+
},
|
|
42
|
+
fullscreen,
|
|
43
|
+
animated: true
|
|
44
|
+
});
|
|
45
|
+
} else if (!props.open && shown.current) {
|
|
46
|
+
const { host } = shown.current;
|
|
47
|
+
shown.current = null;
|
|
48
|
+
host.closeModal();
|
|
49
|
+
}
|
|
50
|
+
}, [props.open], _h$1);
|
|
51
|
+
return universalValue(__octaneUniversalPlan1, []);
|
|
11
52
|
}, { "module": "@nativescript-community/octane" });
|
|
12
53
|
//#endregion
|
|
13
|
-
export {
|
|
54
|
+
export { Modal };
|
package/dist/native/ui19.js
CHANGED
|
@@ -1,13 +1,35 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
|
|
1
|
+
import { createNativeScriptRoot } from "@nativescript-community/octane";
|
|
2
|
+
import { Frame, GridLayout } from "@nativescript/core";
|
|
3
|
+
//#region src/modal-service.native.ts
|
|
4
|
+
/** Open a component in its own NativeScript modal root and resolve on close. */
|
|
5
|
+
var openModal = (Component, params, options = {}) => new Promise((resolve, reject) => {
|
|
6
|
+
const presenter = Frame.topmost()?.currentPage ?? Frame.topmost();
|
|
7
|
+
if (!presenter) {
|
|
8
|
+
reject(/* @__PURE__ */ new Error("Cannot open modal before a NativeScript page is active"));
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
const host = new GridLayout();
|
|
12
|
+
const root = createNativeScriptRoot(host);
|
|
13
|
+
let finished = false;
|
|
14
|
+
const finish = (result) => {
|
|
15
|
+
if (finished) return;
|
|
16
|
+
finished = true;
|
|
17
|
+
root.unmount?.();
|
|
18
|
+
host.removeChildren?.();
|
|
19
|
+
resolve(result);
|
|
20
|
+
};
|
|
21
|
+
const close = (result) => host.closeModal(result);
|
|
22
|
+
root.render(Component, {
|
|
23
|
+
params,
|
|
24
|
+
close
|
|
25
|
+
});
|
|
26
|
+
const fullscreen = options.presentation ? options.presentation === "fullscreen" : options.fullscreen ?? true;
|
|
27
|
+
presenter.showModal(host, {
|
|
28
|
+
context: {},
|
|
29
|
+
closeCallback: finish,
|
|
30
|
+
fullscreen,
|
|
31
|
+
animated: options.animated ?? true
|
|
32
|
+
});
|
|
33
|
+
});
|
|
12
34
|
//#endregion
|
|
13
|
-
export {
|
|
35
|
+
export { openModal };
|
package/dist/native/ui2.js
CHANGED
|
@@ -1,49 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
"
|
|
9
|
-
|
|
10
|
-
["ref", 1],
|
|
11
|
-
["className", 2],
|
|
12
|
-
["style", 3],
|
|
13
|
-
["onPan", 4],
|
|
14
|
-
["onSwipe", 5]
|
|
15
|
-
],
|
|
16
|
-
"children": [{
|
|
17
|
-
"kind": "slot",
|
|
18
|
-
"slot": 6
|
|
19
|
-
}]
|
|
20
|
-
});
|
|
21
|
-
var PAN_STATE = [
|
|
22
|
-
"cancelled",
|
|
23
|
-
"began",
|
|
24
|
-
"moved",
|
|
25
|
-
"ended"
|
|
26
|
-
];
|
|
27
|
-
var View = defineUniversalComponent("nativescript", function View(props) {
|
|
28
|
-
const onPan = useCallback((e) => props.onPan?.({
|
|
29
|
-
x: e.deltaX,
|
|
30
|
-
y: e.deltaY,
|
|
31
|
-
dx: e.deltaX,
|
|
32
|
-
dy: e.deltaY,
|
|
33
|
-
vx: 0,
|
|
34
|
-
vy: 0,
|
|
35
|
-
state: PAN_STATE[e.state] ?? "moved",
|
|
36
|
-
target: e.view ?? e.object
|
|
37
|
-
}), [props.onPan], _h$0);
|
|
38
|
-
return universalValue(__octaneUniversalPlan0, [
|
|
39
|
-
props.id,
|
|
40
|
-
props.bind,
|
|
41
|
-
props.className,
|
|
42
|
-
props.style,
|
|
43
|
-
props.onPan ? onPan : void 0,
|
|
44
|
-
props.onSwipe,
|
|
45
|
-
props.children
|
|
46
|
-
]);
|
|
47
|
-
}, { "module": "@nativescript-community/octane" });
|
|
1
|
+
//#region src/cx.ts
|
|
2
|
+
/** NS `className` splits on ' ' only, and the universal driver applies the
|
|
3
|
+
* prop via `String(value)` — an array would arrive comma-joined and match
|
|
4
|
+
* no class at all. Native leaves normalize through cx() before handing
|
|
5
|
+
* className to an intrinsic. (The DOM renderer already flattens arrays,
|
|
6
|
+
* so web leaves don't need this.) */
|
|
7
|
+
function cx(...parts) {
|
|
8
|
+
return parts.flat(Infinity).filter(Boolean).join(" ");
|
|
9
|
+
}
|
|
48
10
|
//#endregion
|
|
49
|
-
export {
|
|
11
|
+
export { cx };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { hookSlots, useSyncExternalStore } from "@nativescript-community/octane";
|
|
2
|
+
import { Application } from "@nativescript/core";
|
|
3
|
+
//#region src/theme/colorScheme.native.tsrx
|
|
4
|
+
var _h$0 = /* @__PURE__ */ Symbol(/* @__PURE__ */ hookSlots(1));
|
|
5
|
+
function getColorScheme() {
|
|
6
|
+
return Application.primaryWindow?.systemAppearance?.() ?? Application.systemAppearance?.() ?? "light";
|
|
7
|
+
}
|
|
8
|
+
function subscribe(cb) {
|
|
9
|
+
const h = () => cb();
|
|
10
|
+
Application.on("systemAppearanceChanged", h);
|
|
11
|
+
return () => Application.off("systemAppearanceChanged", h);
|
|
12
|
+
}
|
|
13
|
+
function useColorScheme() {
|
|
14
|
+
return useSyncExternalStore(subscribe, getColorScheme, _h$0);
|
|
15
|
+
}
|
|
16
|
+
//#endregion
|
|
17
|
+
export { getColorScheme, useColorScheme };
|