@octane-xplat/ui 0.3.0 → 0.5.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 +55 -40
- package/dist/native/ui10.js +20 -11
- package/dist/native/ui11.js +42 -109
- package/dist/native/ui12.js +17 -84
- package/dist/native/ui13.js +11 -41
- package/dist/native/ui14.js +133 -76
- package/dist/native/ui15.js +43 -92
- package/dist/native/ui16.js +106 -45
- package/dist/native/ui17.js +29 -42
- package/dist/native/ui18.js +34 -53
- package/dist/native/ui19.js +246 -32
- package/dist/native/ui20.js +27 -16
- package/dist/native/ui21.js +376 -86
- package/dist/native/ui22.js +26 -114
- package/dist/native/ui23.js +49 -97
- package/dist/native/ui24.js +79 -53
- package/dist/native/ui25.js +138 -16
- package/dist/native/ui26.js +8 -23
- package/dist/native/ui27.js +60 -34
- package/dist/native/ui28.js +36 -142
- package/dist/native/ui29.js +101 -21
- package/dist/native/ui3.js +22 -1
- package/dist/native/ui30.js +14 -31
- package/dist/native/ui31.js +55 -36
- package/dist/native/ui32.js +49 -61
- package/dist/native/ui33.js +36 -28
- package/dist/native/ui34.js +51 -8
- package/dist/native/ui35.js +98 -20
- package/dist/native/ui36.js +9 -33
- package/dist/native/ui37.js +42 -15
- package/dist/native/ui38.js +186 -57
- package/dist/native/ui39.js +96 -26
- package/dist/native/ui4.js +22 -20
- package/dist/native/ui40.js +179 -8
- package/dist/native/ui41.js +52 -98
- package/dist/native/ui42.js +14 -145
- package/dist/native/ui43.js +16 -19
- package/dist/native/ui44.js +6 -6
- package/dist/native/ui45.js +38 -0
- package/dist/native/ui46.js +267 -0
- package/dist/native/ui47.js +28 -0
- package/dist/native/ui48.js +35 -0
- package/dist/native/ui49.js +41 -0
- package/dist/native/ui5.js +37 -77
- package/dist/native/ui50.js +72 -0
- package/dist/native/ui51.js +66 -0
- package/dist/native/ui52.js +64 -0
- package/dist/native/ui53.js +27 -0
- package/dist/native/ui54.js +13 -0
- package/dist/native/ui55.js +92 -0
- package/dist/native/ui56.js +34 -0
- package/dist/native/ui57.js +19 -0
- package/dist/native/ui58.js +156 -0
- package/dist/native/ui59.js +33 -0
- package/dist/native/ui6.js +94 -9
- package/dist/native/ui60.js +14 -0
- package/dist/native/ui61.js +22 -0
- package/dist/native/ui62.js +8 -0
- package/dist/native/ui63.js +108 -0
- package/dist/native/ui64.js +76 -0
- package/dist/native/ui7.js +42 -26
- package/dist/native/ui8.js +22 -12
- package/dist/native/ui9.js +18 -9
- package/dist/web/octane-client-build.json +1 -1
- package/dist/web/ui.js +53 -40
- package/dist/web/ui10.js +33 -186
- package/dist/web/ui11.js +28 -409
- package/dist/web/ui12.js +21 -68
- package/dist/web/ui13.js +265 -96
- package/dist/web/ui14.js +85 -95
- package/dist/web/ui15.js +368 -25
- package/dist/web/ui16.js +13 -101
- package/dist/web/ui17.js +246 -42
- package/dist/web/ui18.js +237 -28
- package/dist/web/ui19.js +36 -10
- package/dist/web/ui20.js +73 -102
- package/dist/web/ui21.js +102 -73
- package/dist/web/ui22.js +95 -55
- package/dist/web/ui23.js +94 -55
- package/dist/web/ui24.js +31 -15
- package/dist/web/ui25.js +105 -19
- package/dist/web/ui26.js +29 -23
- package/dist/web/ui27.js +12 -123
- package/dist/web/ui28.js +9 -110
- package/dist/web/ui29.js +52 -102
- package/dist/web/ui3.js +29 -18
- package/dist/web/ui30.js +32 -41
- package/dist/web/ui31.js +120 -39
- package/dist/web/ui32.js +41 -74
- package/dist/web/ui33.js +148 -32
- package/dist/web/ui34.js +145 -62
- package/dist/web/ui35.js +140 -7
- package/dist/web/ui36.js +86 -41
- package/dist/web/ui37.js +19 -44
- package/dist/web/ui38.js +5 -15
- package/dist/web/ui39.js +24 -86
- package/dist/web/ui4.js +46 -152
- package/dist/web/ui40.js +150 -37
- package/dist/web/ui41.js +36 -10
- package/dist/web/ui42.js +40 -7
- package/dist/web/ui43.js +73 -19
- package/dist/web/ui44.js +40 -6
- package/dist/web/ui45.js +62 -0
- package/dist/web/ui46.js +50 -0
- package/dist/web/ui47.js +9 -0
- package/dist/web/ui48.js +45 -0
- package/dist/web/ui49.js +13 -0
- package/dist/web/ui5.js +131 -27
- package/dist/web/ui50.js +63 -0
- package/dist/web/ui51.js +47 -0
- package/dist/web/ui52.js +19 -0
- package/dist/web/ui53.js +273 -0
- package/dist/web/ui54.js +42 -0
- package/dist/web/ui55.js +17 -0
- package/dist/web/ui56.js +9 -0
- package/dist/web/ui57.js +22 -0
- package/dist/web/ui58.js +8 -0
- package/dist/web/ui59.js +44 -0
- package/dist/web/ui6.js +81 -45
- package/dist/web/ui60.js +46 -0
- package/dist/web/ui7.js +43 -21
- package/dist/web/ui8.js +27 -21
- package/dist/web/ui9.js +29 -18
- package/package.json +17 -4
- package/src/theme/tokens.css +597 -141
- package/types/index.d.ts +112 -58
- package/types/props.d.ts +291 -16
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { cx } from "./ui2.js";
|
|
2
|
+
import { applyNativeProps } from "./ui36.js";
|
|
3
|
+
import { defineUniversalComponent, universalPlan, universalValue } from "@nativescript-community/octane";
|
|
4
|
+
import { AccessibilityRole } from "@nativescript/core";
|
|
5
|
+
//#region src/Heading.native.tsrx
|
|
6
|
+
var __octaneUniversalPlan0 = universalPlan("nativescript", {
|
|
7
|
+
"kind": "host",
|
|
8
|
+
"type": "label",
|
|
9
|
+
"bindings": [
|
|
10
|
+
["id", 0],
|
|
11
|
+
["className", 1],
|
|
12
|
+
["style", 2],
|
|
13
|
+
["accessibilityRole", 3],
|
|
14
|
+
["ref", 4]
|
|
15
|
+
],
|
|
16
|
+
"children": [{
|
|
17
|
+
"kind": "slot",
|
|
18
|
+
"slot": 5
|
|
19
|
+
}]
|
|
20
|
+
});
|
|
21
|
+
var Heading = defineUniversalComponent("nativescript", function Heading(props) {
|
|
22
|
+
const level = props.level ?? 2;
|
|
23
|
+
return universalValue(__octaneUniversalPlan0, [
|
|
24
|
+
props.id,
|
|
25
|
+
cx(`vx-h${level}`, props.className),
|
|
26
|
+
props.style,
|
|
27
|
+
AccessibilityRole.Header,
|
|
28
|
+
(el) => applyNativeProps(el, props),
|
|
29
|
+
props.children
|
|
30
|
+
]);
|
|
31
|
+
}, { "module": "@nativescript-community/octane" });
|
|
32
|
+
//#endregion
|
|
33
|
+
export { Heading };
|
package/dist/native/ui6.js
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import { cx } from "./ui2.js";
|
|
2
2
|
import { applyEscapeProps } from "./ui3.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
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";
|
|
6
|
+
import { Utils } from "@nativescript/core";
|
|
7
|
+
//#region src/View.native.tsrx
|
|
8
|
+
var _hs$ = /* @__PURE__ */ hookSlots(2);
|
|
9
|
+
var _h$0 = /* @__PURE__ */ Symbol(_hs$);
|
|
10
|
+
var _h$1 = /* @__PURE__ */ Symbol(_hs$ + 1);
|
|
6
11
|
var __octaneUniversalPlan0 = universalPlan("nativescript", {
|
|
7
12
|
"kind": "host",
|
|
8
13
|
"type": "flexboxlayout",
|
|
@@ -12,30 +17,110 @@ var __octaneUniversalPlan0 = universalPlan("nativescript", {
|
|
|
12
17
|
"slot": 1
|
|
13
18
|
}]
|
|
14
19
|
});
|
|
15
|
-
var
|
|
20
|
+
var PAN_STATE = [
|
|
21
|
+
"cancelled",
|
|
22
|
+
"began",
|
|
23
|
+
"moved",
|
|
24
|
+
"ended"
|
|
25
|
+
];
|
|
26
|
+
function panVelocity(e, state, trackerRef) {
|
|
27
|
+
const recognizer = e.ios;
|
|
28
|
+
const nativeView = e.view?.nativeViewProtected;
|
|
29
|
+
if (recognizer?.velocityInView && nativeView) {
|
|
30
|
+
const velocity = recognizer.velocityInView(nativeView);
|
|
31
|
+
return {
|
|
32
|
+
vx: velocity.x,
|
|
33
|
+
vy: velocity.y
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
const motionEvent = e.android?.current;
|
|
37
|
+
const velocityTrackerClass = globalThis.android?.view?.VelocityTracker;
|
|
38
|
+
if (!motionEvent || !velocityTrackerClass) return {
|
|
39
|
+
vx: 0,
|
|
40
|
+
vy: 0
|
|
41
|
+
};
|
|
42
|
+
if (state === 1 || !trackerRef.current) {
|
|
43
|
+
trackerRef.current?.recycle?.();
|
|
44
|
+
trackerRef.current = velocityTrackerClass.obtain();
|
|
45
|
+
}
|
|
46
|
+
const tracker = trackerRef.current;
|
|
47
|
+
tracker.addMovement(motionEvent);
|
|
48
|
+
tracker.computeCurrentVelocity(1e3);
|
|
49
|
+
const density = Utils.layout.getDisplayDensity();
|
|
50
|
+
const velocity = {
|
|
51
|
+
vx: tracker.getXVelocity() / density,
|
|
52
|
+
vy: tracker.getYVelocity() / density
|
|
53
|
+
};
|
|
54
|
+
if (state === 0 || state === 3) {
|
|
55
|
+
tracker.recycle?.();
|
|
56
|
+
trackerRef.current = null;
|
|
57
|
+
}
|
|
58
|
+
return velocity;
|
|
59
|
+
}
|
|
60
|
+
var View = defineUniversalComponent("nativescript", function View(props) {
|
|
61
|
+
const velocityTracker = useRef(null, _h$0);
|
|
62
|
+
const onPan = useCallback((e) => {
|
|
63
|
+
const state = PAN_STATE[e.state] ?? "moved";
|
|
64
|
+
const velocity = panVelocity(e, e.state, velocityTracker);
|
|
65
|
+
props.onPan?.({
|
|
66
|
+
x: e.deltaX,
|
|
67
|
+
y: e.deltaY,
|
|
68
|
+
dx: e.deltaX,
|
|
69
|
+
dy: e.deltaY,
|
|
70
|
+
vx: velocity.vx,
|
|
71
|
+
vy: velocity.vy,
|
|
72
|
+
state,
|
|
73
|
+
target: e.view ?? e.object
|
|
74
|
+
});
|
|
75
|
+
}, [props.onPan], _h$1);
|
|
16
76
|
return universalValue(__octaneUniversalPlan0, [universalProps([
|
|
77
|
+
[
|
|
78
|
+
"set",
|
|
79
|
+
"id",
|
|
80
|
+
props.id
|
|
81
|
+
],
|
|
82
|
+
["spread", layoutChildProps(props)],
|
|
17
83
|
[
|
|
18
84
|
"set",
|
|
19
85
|
"ref",
|
|
20
|
-
(v) =>
|
|
86
|
+
(v) => {
|
|
87
|
+
if (v) {
|
|
88
|
+
applyEscapeProps(v, props);
|
|
89
|
+
props.bind?.(v);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
21
92
|
],
|
|
22
93
|
[
|
|
23
94
|
"set",
|
|
24
95
|
"flexDirection",
|
|
25
|
-
"
|
|
96
|
+
"column"
|
|
26
97
|
],
|
|
27
98
|
[
|
|
28
99
|
"set",
|
|
29
100
|
"className",
|
|
30
|
-
cx(props.className)
|
|
101
|
+
cx(glassClassOf(props.glass), props.className)
|
|
31
102
|
],
|
|
32
103
|
[
|
|
33
104
|
"set",
|
|
34
105
|
"style",
|
|
35
106
|
props.style
|
|
36
107
|
],
|
|
37
|
-
[
|
|
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
|
+
]
|
|
38
123
|
]), props.children]);
|
|
39
124
|
}, { "module": "@nativescript-community/octane" });
|
|
40
125
|
//#endregion
|
|
41
|
-
export {
|
|
126
|
+
export { View };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { cx } from "./ui2.js";
|
|
2
|
+
import { defineUniversalComponent, universalPlan, universalValue } from "@nativescript-community/octane";
|
|
3
|
+
//#region src/PlatformBadge.native.tsrx
|
|
4
|
+
var __octaneUniversalPlan0 = universalPlan("nativescript", {
|
|
5
|
+
"kind": "host",
|
|
6
|
+
"type": "label",
|
|
7
|
+
"props": { "text": "ios|android" },
|
|
8
|
+
"bindings": [["className", 0]]
|
|
9
|
+
});
|
|
10
|
+
var PlatformBadge = defineUniversalComponent("nativescript", function PlatformBadge(props) {
|
|
11
|
+
return universalValue(__octaneUniversalPlan0, [cx(props.className)]);
|
|
12
|
+
}, { "module": "@nativescript-community/octane" });
|
|
13
|
+
//#endregion
|
|
14
|
+
export { PlatformBadge };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
//#region src/store.ts
|
|
2
|
+
function createStore(initial) {
|
|
3
|
+
let value = initial;
|
|
4
|
+
const listeners = /* @__PURE__ */ new Set();
|
|
5
|
+
return {
|
|
6
|
+
get: () => value,
|
|
7
|
+
set(next) {
|
|
8
|
+
const v = typeof next === "function" ? next(value) : next;
|
|
9
|
+
if (Object.is(v, value)) return;
|
|
10
|
+
value = v;
|
|
11
|
+
for (const l of [...listeners]) l();
|
|
12
|
+
},
|
|
13
|
+
subscribe(notify) {
|
|
14
|
+
listeners.add(notify);
|
|
15
|
+
return () => {
|
|
16
|
+
listeners.delete(notify);
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
//#endregion
|
|
22
|
+
export { createStore };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { hookSlots, useSyncExternalStore } from "@nativescript-community/octane";
|
|
2
|
+
//#region src/use-store.native.tsrx
|
|
3
|
+
var _h$0 = /* @__PURE__ */ Symbol(/* @__PURE__ */ hookSlots(1));
|
|
4
|
+
function useStore(store, select) {
|
|
5
|
+
return useSyncExternalStore(store.subscribe, select === void 0 ? store.get : () => select(store.get()), _h$0);
|
|
6
|
+
}
|
|
7
|
+
//#endregion
|
|
8
|
+
export { useStore };
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { cx } from "./ui2.js";
|
|
2
|
+
import { applyThemeClasses } from "./ui31.js";
|
|
3
|
+
import { rootLayoutFor } from "./ui34.js";
|
|
4
|
+
import { createNativeScriptRoot, defineUniversalComponent, hookSlots, universalPlan, universalValue, useEffect, useRef } from "@nativescript-community/octane";
|
|
5
|
+
import { GridLayout, isAndroid, isIOS } from "@nativescript/core";
|
|
6
|
+
//#region src/Sheet.native.tsrx
|
|
7
|
+
var _hs$ = /* @__PURE__ */ hookSlots(3);
|
|
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 __octaneUniversalPlan0 = universalPlan("nativescript", {
|
|
12
|
+
"kind": "range",
|
|
13
|
+
"children": [{
|
|
14
|
+
"kind": "slot",
|
|
15
|
+
"slot": 0
|
|
16
|
+
}]
|
|
17
|
+
});
|
|
18
|
+
var __octaneUniversalPlan1 = universalPlan("nativescript", {
|
|
19
|
+
"kind": "host",
|
|
20
|
+
"type": "stacklayout",
|
|
21
|
+
"bindings": [["ref", 0], ["style", 1]]
|
|
22
|
+
});
|
|
23
|
+
var SheetBody = defineUniversalComponent("nativescript", function SheetBody(props) {
|
|
24
|
+
return universalValue(__octaneUniversalPlan0, [props.children]);
|
|
25
|
+
}, { "module": "@nativescript-community/octane" });
|
|
26
|
+
var Sheet = defineUniversalComponent("nativescript", function Sheet(props) {
|
|
27
|
+
const sentinel = useRef(null, _h$0);
|
|
28
|
+
const shown = useRef(null, _h$1);
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
const cur = shown.current;
|
|
31
|
+
if (!props.open) {
|
|
32
|
+
if (!cur) return;
|
|
33
|
+
shown.current = null;
|
|
34
|
+
cur.programmatic = true;
|
|
35
|
+
cur.unbindTheme?.();
|
|
36
|
+
cur.root.unmount?.();
|
|
37
|
+
const owner = cur.host.parent;
|
|
38
|
+
if (owner?.hasChild?.(cur.host)) owner.close(cur.host).catch((error) => {
|
|
39
|
+
console.error("[Sheet] close failed", error);
|
|
40
|
+
});
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
const rl = rootLayoutFor(sentinel.current);
|
|
44
|
+
if (!rl) return;
|
|
45
|
+
if (cur) {
|
|
46
|
+
cur.root.render(SheetBody, { children: props.children });
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
const host = new GridLayout();
|
|
50
|
+
const unbindTheme = applyThemeClasses(host, cx("vx-sheet-host", props.className));
|
|
51
|
+
host.horizontalAlignment = "stretch";
|
|
52
|
+
host.verticalAlignment = "bottom";
|
|
53
|
+
if (props.style) Object.assign(host.style, props.style);
|
|
54
|
+
Object.assign(host, isIOS ? props.ios : isAndroid ? props.android : void 0);
|
|
55
|
+
const root = createNativeScriptRoot(host);
|
|
56
|
+
const opened = {
|
|
57
|
+
host,
|
|
58
|
+
root,
|
|
59
|
+
unbindTheme,
|
|
60
|
+
programmatic: false
|
|
61
|
+
};
|
|
62
|
+
shown.current = opened;
|
|
63
|
+
root.render(SheetBody, { children: props.children });
|
|
64
|
+
host.on("closed", () => {
|
|
65
|
+
if (shown.current === opened) shown.current = null;
|
|
66
|
+
opened.unbindTheme?.();
|
|
67
|
+
opened.root.unmount?.();
|
|
68
|
+
if (!opened.programmatic) props.onDismiss?.();
|
|
69
|
+
});
|
|
70
|
+
rl.open(host, {
|
|
71
|
+
...props.shadeCover ?? true ? { shadeCover: {
|
|
72
|
+
opacity: .4,
|
|
73
|
+
tapToClose: true
|
|
74
|
+
} } : {},
|
|
75
|
+
animation: {
|
|
76
|
+
enterFrom: {
|
|
77
|
+
translateY: 400,
|
|
78
|
+
duration: 250
|
|
79
|
+
},
|
|
80
|
+
exitTo: {
|
|
81
|
+
translateY: 400,
|
|
82
|
+
duration: 200
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}).catch((error) => {
|
|
86
|
+
if (shown.current === opened) shown.current = null;
|
|
87
|
+
opened.unbindTheme?.();
|
|
88
|
+
opened.root.unmount?.();
|
|
89
|
+
console.error("[Sheet] open failed", error);
|
|
90
|
+
});
|
|
91
|
+
}, [
|
|
92
|
+
props.open,
|
|
93
|
+
props.children,
|
|
94
|
+
props.className,
|
|
95
|
+
props.style,
|
|
96
|
+
props.shadeCover,
|
|
97
|
+
props.ios,
|
|
98
|
+
props.android
|
|
99
|
+
], _h$2);
|
|
100
|
+
return universalValue(__octaneUniversalPlan1, [(v) => {
|
|
101
|
+
sentinel.current = v;
|
|
102
|
+
}, {
|
|
103
|
+
width: 0,
|
|
104
|
+
height: 0
|
|
105
|
+
}]);
|
|
106
|
+
}, { "module": "@nativescript-community/octane" });
|
|
107
|
+
//#endregion
|
|
108
|
+
export { Sheet };
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { applyThemeClasses } from "./ui31.js";
|
|
2
|
+
import { topRootLayout } from "./ui34.js";
|
|
3
|
+
import { createNativeScriptRoot } from "@nativescript-community/octane";
|
|
4
|
+
import { GridLayout } from "@nativescript/core";
|
|
5
|
+
//#region src/sheet-service.native.ts
|
|
6
|
+
var active = /* @__PURE__ */ new Set();
|
|
7
|
+
/** The most recently opened sheet's host view — for harness asserts (view
|
|
8
|
+
* identity beats tree search; the owning rootlayout may unload/reload). */
|
|
9
|
+
function sheetHost() {
|
|
10
|
+
return [...active].pop()?.host ?? null;
|
|
11
|
+
}
|
|
12
|
+
/** Close the most recently opened sheet (resolve with `result`). */
|
|
13
|
+
function closeSheet(result) {
|
|
14
|
+
[...active].pop()?.finish(result);
|
|
15
|
+
}
|
|
16
|
+
/** Imperative in-window sheet: a dedicated Octane root on a bottom-docked
|
|
17
|
+
* GridLayout host opened on the CURRENT rootlayout (topRootLayout — the
|
|
18
|
+
* service has no declaring view). Resolves when the sheet closes. */
|
|
19
|
+
var openSheet = (Component, params, options = {}) => new Promise((resolve) => {
|
|
20
|
+
const rl = topRootLayout();
|
|
21
|
+
if (!rl) {
|
|
22
|
+
console.warn("[openSheet] no RootLayout mounted — sheet skipped");
|
|
23
|
+
resolve(void 0);
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
const host = new GridLayout();
|
|
27
|
+
const unbindTheme = applyThemeClasses(host, "vx-sheet-host");
|
|
28
|
+
host.horizontalAlignment = "stretch";
|
|
29
|
+
host.verticalAlignment = "bottom";
|
|
30
|
+
const root = createNativeScriptRoot(host);
|
|
31
|
+
let finished = false;
|
|
32
|
+
const finish = (result) => {
|
|
33
|
+
if (finished) return;
|
|
34
|
+
finished = true;
|
|
35
|
+
active.delete(entry);
|
|
36
|
+
unbindTheme();
|
|
37
|
+
root.unmount?.();
|
|
38
|
+
const owner = host.parent;
|
|
39
|
+
if (owner?.hasChild?.(host)) owner.close(host).catch((error) => {
|
|
40
|
+
console.error("[openSheet] close failed", error);
|
|
41
|
+
});
|
|
42
|
+
resolve(result);
|
|
43
|
+
};
|
|
44
|
+
const entry = {
|
|
45
|
+
host,
|
|
46
|
+
root,
|
|
47
|
+
finish
|
|
48
|
+
};
|
|
49
|
+
host.on("closed", () => finish());
|
|
50
|
+
root.render(Component, {
|
|
51
|
+
params,
|
|
52
|
+
close: finish
|
|
53
|
+
});
|
|
54
|
+
active.add(entry);
|
|
55
|
+
rl.open(host, {
|
|
56
|
+
...options.shadeCover ?? true ? { shadeCover: {
|
|
57
|
+
opacity: .4,
|
|
58
|
+
tapToClose: true
|
|
59
|
+
} } : {},
|
|
60
|
+
animation: {
|
|
61
|
+
enterFrom: {
|
|
62
|
+
translateY: 400,
|
|
63
|
+
duration: 250
|
|
64
|
+
},
|
|
65
|
+
exitTo: {
|
|
66
|
+
translateY: 400,
|
|
67
|
+
duration: 200
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}).catch((error) => {
|
|
71
|
+
console.error("[openSheet] open failed", error);
|
|
72
|
+
finish();
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
//#endregion
|
|
76
|
+
export { closeSheet, openSheet, sheetHost };
|
package/dist/native/ui7.js
CHANGED
|
@@ -1,36 +1,52 @@
|
|
|
1
1
|
import { cx } from "./ui2.js";
|
|
2
2
|
import { applyEscapeProps } from "./ui3.js";
|
|
3
|
-
import {
|
|
4
|
-
|
|
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/Row.native.tsrx
|
|
5
7
|
var __octaneUniversalPlan0 = universalPlan("nativescript", {
|
|
6
8
|
"kind": "host",
|
|
7
|
-
"type": "
|
|
8
|
-
"
|
|
9
|
-
["ref", 0],
|
|
10
|
-
["rows", 1],
|
|
11
|
-
["columns", 2],
|
|
12
|
-
["className", 3],
|
|
13
|
-
["style", 4]
|
|
14
|
-
],
|
|
9
|
+
"type": "flexboxlayout",
|
|
10
|
+
"propsSlot": 0,
|
|
15
11
|
"children": [{
|
|
16
12
|
"kind": "slot",
|
|
17
|
-
"slot":
|
|
13
|
+
"slot": 1
|
|
18
14
|
}]
|
|
19
15
|
});
|
|
20
|
-
var
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
16
|
+
var Row = defineUniversalComponent("nativescript", function Row(props) {
|
|
17
|
+
return universalValue(__octaneUniversalPlan0, [universalProps([
|
|
18
|
+
[
|
|
19
|
+
"set",
|
|
20
|
+
"id",
|
|
21
|
+
props.id
|
|
22
|
+
],
|
|
23
|
+
[
|
|
24
|
+
"set",
|
|
25
|
+
"ref",
|
|
26
|
+
(v) => applyEscapeProps(v, props)
|
|
27
|
+
],
|
|
28
|
+
[
|
|
29
|
+
"set",
|
|
30
|
+
"flexDirection",
|
|
31
|
+
"row"
|
|
32
|
+
],
|
|
33
|
+
[
|
|
34
|
+
"set",
|
|
35
|
+
"iosGlassEffect",
|
|
36
|
+
glassConfigOf(props.glass)
|
|
37
|
+
],
|
|
38
|
+
[
|
|
39
|
+
"set",
|
|
40
|
+
"className",
|
|
41
|
+
cx(glassClassOf(props.glass), props.className)
|
|
42
|
+
],
|
|
43
|
+
[
|
|
44
|
+
"set",
|
|
45
|
+
"style",
|
|
46
|
+
props.style
|
|
47
|
+
],
|
|
48
|
+
["spread", layoutChildProps(props)]
|
|
49
|
+
]), props.children]);
|
|
34
50
|
}, { "module": "@nativescript-community/octane" });
|
|
35
51
|
//#endregion
|
|
36
|
-
export {
|
|
52
|
+
export { Row };
|
package/dist/native/ui8.js
CHANGED
|
@@ -1,31 +1,41 @@
|
|
|
1
1
|
import { cx } from "./ui2.js";
|
|
2
2
|
import { applyEscapeProps } from "./ui3.js";
|
|
3
|
+
import { glassClassOf, glassConfigOf } from "./ui4.js";
|
|
3
4
|
import { defineUniversalComponent, universalPlan, universalValue } from "@nativescript-community/octane";
|
|
4
|
-
//#region src/
|
|
5
|
+
//#region src/Grid.native.tsrx
|
|
5
6
|
var __octaneUniversalPlan0 = universalPlan("nativescript", {
|
|
6
7
|
"kind": "host",
|
|
7
8
|
"type": "gridlayout",
|
|
8
|
-
"props": {
|
|
9
|
-
"rows": "*",
|
|
10
|
-
"columns": "*"
|
|
11
|
-
},
|
|
12
9
|
"bindings": [
|
|
13
|
-
["
|
|
14
|
-
["
|
|
15
|
-
["
|
|
10
|
+
["id", 0],
|
|
11
|
+
["ref", 1],
|
|
12
|
+
["rows", 2],
|
|
13
|
+
["columns", 3],
|
|
14
|
+
["className", 4],
|
|
15
|
+
["style", 5],
|
|
16
|
+
["iosGlassEffect", 6]
|
|
16
17
|
],
|
|
17
18
|
"children": [{
|
|
18
19
|
"kind": "slot",
|
|
19
|
-
"slot":
|
|
20
|
+
"slot": 7
|
|
20
21
|
}]
|
|
21
22
|
});
|
|
22
|
-
var
|
|
23
|
+
var warnedAboutGap = false;
|
|
24
|
+
var Grid = defineUniversalComponent("nativescript", function Grid(props) {
|
|
25
|
+
if (props.gap != null && !warnedAboutGap) {
|
|
26
|
+
warnedAboutGap = true;
|
|
27
|
+
console.warn("[Grid] gap is not supported; use child margins instead.");
|
|
28
|
+
}
|
|
23
29
|
return universalValue(__octaneUniversalPlan0, [
|
|
30
|
+
props.id,
|
|
24
31
|
(view) => applyEscapeProps(view, props),
|
|
25
|
-
|
|
32
|
+
props.rows,
|
|
33
|
+
props.columns,
|
|
34
|
+
cx("vx-grid", glassClassOf(props.glass), props.className),
|
|
26
35
|
props.style,
|
|
36
|
+
glassConfigOf(props.glass),
|
|
27
37
|
props.children
|
|
28
38
|
]);
|
|
29
39
|
}, { "module": "@nativescript-community/octane" });
|
|
30
40
|
//#endregion
|
|
31
|
-
export {
|
|
41
|
+
export { Grid };
|
package/dist/native/ui9.js
CHANGED
|
@@ -1,27 +1,36 @@
|
|
|
1
1
|
import { cx } from "./ui2.js";
|
|
2
2
|
import { applyEscapeProps } from "./ui3.js";
|
|
3
|
+
import { glassClassOf, glassConfigOf } from "./ui4.js";
|
|
3
4
|
import { defineUniversalComponent, universalPlan, universalValue } from "@nativescript-community/octane";
|
|
4
|
-
//#region src/
|
|
5
|
+
//#region src/Stack.native.tsrx
|
|
5
6
|
var __octaneUniversalPlan0 = universalPlan("nativescript", {
|
|
6
7
|
"kind": "host",
|
|
7
|
-
"type": "
|
|
8
|
+
"type": "gridlayout",
|
|
9
|
+
"props": {
|
|
10
|
+
"rows": "*",
|
|
11
|
+
"columns": "*"
|
|
12
|
+
},
|
|
8
13
|
"bindings": [
|
|
9
|
-
["
|
|
10
|
-
["
|
|
11
|
-
["
|
|
14
|
+
["id", 0],
|
|
15
|
+
["ref", 1],
|
|
16
|
+
["iosGlassEffect", 2],
|
|
17
|
+
["className", 3],
|
|
18
|
+
["style", 4]
|
|
12
19
|
],
|
|
13
20
|
"children": [{
|
|
14
21
|
"kind": "slot",
|
|
15
|
-
"slot":
|
|
22
|
+
"slot": 5
|
|
16
23
|
}]
|
|
17
24
|
});
|
|
18
|
-
var
|
|
25
|
+
var Stack = defineUniversalComponent("nativescript", function Stack(props) {
|
|
19
26
|
return universalValue(__octaneUniversalPlan0, [
|
|
27
|
+
props.id,
|
|
20
28
|
(view) => applyEscapeProps(view, props),
|
|
21
|
-
|
|
29
|
+
glassConfigOf(props.glass),
|
|
30
|
+
cx("vx-stack", glassClassOf(props.glass), props.className),
|
|
22
31
|
props.style,
|
|
23
32
|
props.children
|
|
24
33
|
]);
|
|
25
34
|
}, { "module": "@nativescript-community/octane" });
|
|
26
35
|
//#endregion
|
|
27
|
-
export {
|
|
36
|
+
export { Stack };
|