@octane-xplat/ui 0.1.0 → 0.2.1
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/web/octane-client-build.json +1 -1
- package/dist/web/ui.js +2 -2
- package/dist/web/ui16.js +3 -3
- package/dist/web/ui17.js +4 -4
- package/dist/web/ui18.js +1 -1
- package/dist/web/ui19.js +4 -1
- package/dist/web/ui2.js +2 -2
- package/dist/web/ui4.js +2 -2
- package/dist/web/ui5.js +38 -7
- package/dist/web/ui6.js +5 -5
- package/dist/web/ui7.js +14 -4
- package/dist/web/ui8.js +2 -2
- package/dist/web/ui9.js +4 -4
- package/package.json +15 -5
- package/types/index.d.ts +97 -0
- package/types/props.d.ts +142 -0
package/dist/web/ui.js
CHANGED
|
@@ -15,5 +15,5 @@ import { currentRoute, pushRoute, routeFor, useRoute } from "./ui15.js";
|
|
|
15
15
|
import { Tabs } from "./ui16.js";
|
|
16
16
|
import { Switch } from "./ui17.js";
|
|
17
17
|
import { PlatformBadge } from "./ui18.js";
|
|
18
|
-
import { getStack, registerStack } from "./ui19.js";
|
|
19
|
-
export { View as Column, Image, List, Modal, PlatformBadge, Pressable, Row, Screen, ScrollView, Switch, Tabs, Text, TextInput, View, currentRoute, getColorScheme, getStack, pushRoute, registerStack, routeFor, styled, useAnimation, useColorScheme, useRoute };
|
|
18
|
+
import { getStack, registerStack, stackEntries } from "./ui19.js";
|
|
19
|
+
export { View as Column, Image, List, Modal, PlatformBadge, Pressable, Row, Screen, ScrollView, Switch, Tabs, Text, TextInput, View, currentRoute, getColorScheme, getStack, pushRoute, registerStack, routeFor, stackEntries, styled, useAnimation, useColorScheme, useRoute };
|
package/dist/web/ui16.js
CHANGED
|
@@ -48,7 +48,7 @@ function __item$4(t, __s, __extra) {
|
|
|
48
48
|
props.onSelectedIndexChanged?.(i);
|
|
49
49
|
});
|
|
50
50
|
_b.a = updateFreshClassName(["vx-tab", active === props.tabs.indexOf(t) ? "active" : ""], _b.a, _b.b);
|
|
51
|
-
_b.e = bindSignalChild(__s, _b.e, 1, _b.b, t.title, "b:
|
|
51
|
+
_b.e = bindSignalChild(__s, _b.e, 1, _b.b, t.title, "b:6a83ceed", null, void 0, void 0, void 0, true);
|
|
52
52
|
}
|
|
53
53
|
function __else$2(__props, __s, __extra) {
|
|
54
54
|
const active = __extra[0];
|
|
@@ -66,7 +66,7 @@ function __else$2(__props, __s, __extra) {
|
|
|
66
66
|
_m6 = sibling(_el0, 1);
|
|
67
67
|
_b = bag9(__s, _root, void 0, _m1, void 0, void 0, _m4, _m5, _m6, null, void 0);
|
|
68
68
|
}
|
|
69
|
-
_b.a = bindSignalAttribute(__s, _b.a, _b.b, "id", props.id, "b:
|
|
69
|
+
_b.a = bindSignalAttribute(__s, _b.a, _b.b, "id", props.id, "b:dd012c22", "attr");
|
|
70
70
|
_b.c = updateFreshClassName(["vx-tabs", props.className], _b.c, _b.b);
|
|
71
71
|
{
|
|
72
72
|
const _v = props.style;
|
|
@@ -80,7 +80,7 @@ function __else$2(__props, __s, __extra) {
|
|
|
80
80
|
props,
|
|
81
81
|
setInternal
|
|
82
82
|
], null, _b.f, true);
|
|
83
|
-
_b.j = bindSignalChild(__s, _b.j, 2, _b.g, paneRoute && props.resolveScreen ? props.resolveScreen(paneRoute.name, paneRoute.params) : props.tabs[active]?.render(), "b:
|
|
83
|
+
_b.j = bindSignalChild(__s, _b.j, 2, _b.g, paneRoute && props.resolveScreen ? props.resolveScreen(paneRoute.name, paneRoute.params) : props.tabs[active]?.render(), "b:945751f6", null, void 0, void 0, void 0, true);
|
|
84
84
|
}
|
|
85
85
|
var Tabs = /* @__PURE__ */ __s(function Tabs(props, __s, __extra) {
|
|
86
86
|
const __block = __s.block;
|
package/dist/web/ui17.js
CHANGED
|
@@ -3,21 +3,21 @@ import { bindSignalAttribute, bindSignalChecked, enableSignalBindings, updateFre
|
|
|
3
3
|
//#region src/Switch.web.tsrx
|
|
4
4
|
enableSignalBindings(1, true);
|
|
5
5
|
delegateEvents(["change"]);
|
|
6
|
-
var _t$0 = /* @__PURE__ */ template("<input type=\"checkbox\" data-octane-input=\"i:
|
|
6
|
+
var _t$0 = /* @__PURE__ */ template("<input type=\"checkbox\" data-octane-input=\"i:86e2d28a\"/>");
|
|
7
7
|
var Switch = /* @__PURE__ */ __s(function Switch(props, __s, __extra) {
|
|
8
8
|
let _b = __s.slots[0];
|
|
9
9
|
if (_b === void 0) {
|
|
10
10
|
let _m1, _m4;
|
|
11
11
|
const _root = clone(_t$0);
|
|
12
12
|
_m1 = _root;
|
|
13
|
-
_m4 = bindSignalChecked(__s, void 0, _root, props.checked, "i:
|
|
13
|
+
_m4 = bindSignalChecked(__s, void 0, _root, props.checked, "i:86e2d28a");
|
|
14
14
|
setEventHandler(_root, "$$change", (e) => props.onCheckedChange?.(e.target.checked));
|
|
15
15
|
_b = bag5(__s, _root, void 0, _m1, void 0, void 0, _m4);
|
|
16
16
|
} else {
|
|
17
|
-
_b.e = bindSignalChecked(__s, _b.e, _b.b, props.checked, "i:
|
|
17
|
+
_b.e = bindSignalChecked(__s, _b.e, _b.b, props.checked, "i:86e2d28a");
|
|
18
18
|
setEventHandler(_b.b, "$$change", (e) => props.onCheckedChange?.(e.target.checked));
|
|
19
19
|
}
|
|
20
|
-
_b.a = bindSignalAttribute(__s, _b.a, _b.b, "id", props.id, "b:
|
|
20
|
+
_b.a = bindSignalAttribute(__s, _b.a, _b.b, "id", props.id, "b:c6de5afb", "attr");
|
|
21
21
|
_b.c = updateFreshClassName(["vx-switch", props.className], _b.c, _b.b);
|
|
22
22
|
{
|
|
23
23
|
const _v = props.style;
|
package/dist/web/ui18.js
CHANGED
|
@@ -11,7 +11,7 @@ var PlatformBadge = /* @__PURE__ */ __s(function PlatformBadge(props, __s, __ext
|
|
|
11
11
|
_m1 = _root;
|
|
12
12
|
_b = bag2(__s, _root, void 0, _m1);
|
|
13
13
|
}
|
|
14
|
-
_b.a = bindSignalAttribute(__s, _b.a, _b.b, "class", props.className, "b:
|
|
14
|
+
_b.a = bindSignalAttribute(__s, _b.a, _b.b, "class", props.className, "b:f3cb9a4b", "class");
|
|
15
15
|
});
|
|
16
16
|
//#endregion
|
|
17
17
|
export { PlatformBadge };
|
package/dist/web/ui19.js
CHANGED
|
@@ -2,5 +2,8 @@
|
|
|
2
2
|
/** Web twin — one linear URL stack; named stacks don't apply. */
|
|
3
3
|
function registerStack(_name, _frame) {}
|
|
4
4
|
function getStack(_name) {}
|
|
5
|
+
function stackEntries() {
|
|
6
|
+
return [].values();
|
|
7
|
+
}
|
|
5
8
|
//#endregion
|
|
6
|
-
export { getStack, registerStack };
|
|
9
|
+
export { getStack, registerStack, stackEntries };
|
package/dist/web/ui2.js
CHANGED
|
@@ -90,7 +90,7 @@ var View = /* @__PURE__ */ __s(function View(props, __s, __extra) {
|
|
|
90
90
|
};
|
|
91
91
|
if (_r !== _b.c) _b.c = replaceRef(__s, _b.c, _r, _b.b);
|
|
92
92
|
}
|
|
93
|
-
_b.a = bindSignalAttribute(__s, _b.a, _b.b, "id", props.id, "b:
|
|
93
|
+
_b.a = bindSignalAttribute(__s, _b.a, _b.b, "id", props.id, "b:82d7ce4a", "attr");
|
|
94
94
|
_b.d = updateFreshClassName(["vx-view", props.className], _b.d, _b.b);
|
|
95
95
|
{
|
|
96
96
|
const _v = props.style;
|
|
@@ -99,7 +99,7 @@ var View = /* @__PURE__ */ __s(function View(props, __s, __extra) {
|
|
|
99
99
|
_b.e = _v;
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
|
-
_b.h = bindSignalChild(__s, _b.h, 1, _b.b, props.children, "b:
|
|
102
|
+
_b.h = bindSignalChild(__s, _b.h, 1, _b.b, props.children, "b:f8e3deeb", null, void 0, void 0, void 0, true);
|
|
103
103
|
});
|
|
104
104
|
//#endregion
|
|
105
105
|
export { View };
|
package/dist/web/ui4.js
CHANGED
|
@@ -11,7 +11,7 @@ var Text = /* @__PURE__ */ __s(function Text(props, __s, __extra) {
|
|
|
11
11
|
_m1 = _root;
|
|
12
12
|
_b = bag5(__s, _root, void 0, _m1, void 0, null, void 0);
|
|
13
13
|
}
|
|
14
|
-
_b.a = bindSignalAttribute(__s, _b.a, _b.b, "class", props.className, "b:
|
|
14
|
+
_b.a = bindSignalAttribute(__s, _b.a, _b.b, "class", props.className, "b:14d3594c", "class");
|
|
15
15
|
{
|
|
16
16
|
const _v = props.style;
|
|
17
17
|
if (_b.c !== _v) {
|
|
@@ -19,7 +19,7 @@ var Text = /* @__PURE__ */ __s(function Text(props, __s, __extra) {
|
|
|
19
19
|
_b.c = _v;
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
|
-
_b.f = bindSignalChild(__s, _b.f, 1, _b.b, props.children, "b:
|
|
22
|
+
_b.f = bindSignalChild(__s, _b.f, 1, _b.b, props.children, "b:79e388b8", null, void 0, void 0, void 0, true);
|
|
23
23
|
});
|
|
24
24
|
//#endregion
|
|
25
25
|
export { Text };
|
package/dist/web/ui5.js
CHANGED
|
@@ -2,18 +2,49 @@ import { __s, bag9, clone, delegateEvents, setEventHandler, setStyle, template }
|
|
|
2
2
|
import { bindSignalAttribute, bindSignalChild, enableSignalBindings, updateFreshClassName } from "octane/internal/client";
|
|
3
3
|
//#region src/Pressable.web.tsrx
|
|
4
4
|
enableSignalBindings(1, true);
|
|
5
|
-
delegateEvents([
|
|
5
|
+
delegateEvents([
|
|
6
|
+
"click",
|
|
7
|
+
"pointercancel",
|
|
8
|
+
"pointerdown",
|
|
9
|
+
"pointerleave",
|
|
10
|
+
"pointerup"
|
|
11
|
+
]);
|
|
6
12
|
var _t$0 = /* @__PURE__ */ template("<div></div>");
|
|
7
13
|
var Pressable = /* @__PURE__ */ __s(function Pressable(props, __s, __extra) {
|
|
14
|
+
let timer = null;
|
|
15
|
+
const cancel = () => {
|
|
16
|
+
if (timer !== null) {
|
|
17
|
+
clearTimeout(timer);
|
|
18
|
+
timer = null;
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
const down = () => {
|
|
22
|
+
if (props.disabled || !props.onLongPress) return;
|
|
23
|
+
cancel();
|
|
24
|
+
timer = setTimeout(() => {
|
|
25
|
+
timer = null;
|
|
26
|
+
props.onLongPress?.();
|
|
27
|
+
}, 500);
|
|
28
|
+
};
|
|
8
29
|
let _b = __s.slots[0];
|
|
9
30
|
if (_b === void 0) {
|
|
10
31
|
let _m1;
|
|
11
32
|
const _root = clone(_t$0);
|
|
12
33
|
_m1 = _root;
|
|
13
34
|
setEventHandler(_root, "$$click", props.disabled ? void 0 : props.onPress);
|
|
35
|
+
setEventHandler(_root, "$$pointerdown", down);
|
|
36
|
+
setEventHandler(_root, "$$pointerup", cancel);
|
|
37
|
+
setEventHandler(_root, "$$pointerleave", cancel);
|
|
38
|
+
setEventHandler(_root, "$$pointercancel", cancel);
|
|
14
39
|
_b = bag9(__s, _root, void 0, _m1, void 0, void 0, void 0, void 0, void 0, null, void 0);
|
|
15
|
-
} else
|
|
16
|
-
|
|
40
|
+
} else {
|
|
41
|
+
setEventHandler(_b.b, "$$click", props.disabled ? void 0 : props.onPress);
|
|
42
|
+
setEventHandler(_b.b, "$$pointerdown", down);
|
|
43
|
+
setEventHandler(_b.b, "$$pointerup", cancel);
|
|
44
|
+
setEventHandler(_b.b, "$$pointerleave", cancel);
|
|
45
|
+
setEventHandler(_b.b, "$$pointercancel", cancel);
|
|
46
|
+
}
|
|
47
|
+
_b.a = bindSignalAttribute(__s, _b.a, _b.b, "id", props.id, "b:0d0a69e5", "attr");
|
|
17
48
|
_b.c = updateFreshClassName(["vx-pressable", props.className], _b.c, _b.b);
|
|
18
49
|
{
|
|
19
50
|
const _v = props.style;
|
|
@@ -22,10 +53,10 @@ var Pressable = /* @__PURE__ */ __s(function Pressable(props, __s, __extra) {
|
|
|
22
53
|
_b.d = _v;
|
|
23
54
|
}
|
|
24
55
|
}
|
|
25
|
-
_b.e = bindSignalAttribute(__s, _b.e, _b.b, "role", props.accessibilityRole ?? "button", "b:
|
|
26
|
-
_b.f = bindSignalAttribute(__s, _b.f, _b.b, "aria-label", props.accessibilityLabel, "b:
|
|
27
|
-
_b.g = bindSignalAttribute(__s, _b.g, _b.b, "aria-hidden", props.accessible === false ? true : void 0, "b:
|
|
28
|
-
_b.j = bindSignalChild(__s, _b.j, 1, _b.b, props.children, "b:
|
|
56
|
+
_b.e = bindSignalAttribute(__s, _b.e, _b.b, "role", props.accessibilityRole ?? "button", "b:ab1f73d1", "attr");
|
|
57
|
+
_b.f = bindSignalAttribute(__s, _b.f, _b.b, "aria-label", props.accessibilityLabel, "b:bf6ff2b6", "ariaAttr");
|
|
58
|
+
_b.g = bindSignalAttribute(__s, _b.g, _b.b, "aria-hidden", props.accessible === false ? true : void 0, "b:22b020b5", "ariaAttr");
|
|
59
|
+
_b.j = bindSignalChild(__s, _b.j, 1, _b.b, props.children, "b:7124d4dc", null, void 0, void 0, void 0, true);
|
|
29
60
|
});
|
|
30
61
|
//#endregion
|
|
31
62
|
export { Pressable };
|
package/dist/web/ui6.js
CHANGED
|
@@ -3,21 +3,21 @@ import { bindSignalAttribute, bindSignalValue, enableSignalBindings } from "octa
|
|
|
3
3
|
//#region src/TextInput.web.tsrx
|
|
4
4
|
enableSignalBindings(1, true);
|
|
5
5
|
delegateEvents(["input"]);
|
|
6
|
-
var _t$0 = /* @__PURE__ */ template("<input data-octane-input=\"i:
|
|
6
|
+
var _t$0 = /* @__PURE__ */ template("<input data-octane-input=\"i:ab65f8a8\"/>");
|
|
7
7
|
var TextInput = /* @__PURE__ */ __s(function TextInput(props, __s, __extra) {
|
|
8
8
|
let _b = __s.slots[0];
|
|
9
9
|
if (_b === void 0) {
|
|
10
10
|
let _m1, _m3;
|
|
11
11
|
const _root = clone(_t$0);
|
|
12
12
|
_m1 = _root;
|
|
13
|
-
_m3 = bindSignalValue(__s, void 0, _root, props.value, "i:
|
|
13
|
+
_m3 = bindSignalValue(__s, void 0, _root, props.value, "i:ab65f8a8");
|
|
14
14
|
setEventHandler(_root, "$$input", (e) => props.onChange?.(e.target.value));
|
|
15
15
|
_b = bag5(__s, _root, void 0, _m1, void 0, _m3, void 0);
|
|
16
16
|
} else {
|
|
17
|
-
_b.d = bindSignalValue(__s, _b.d, _b.b, props.value, "i:
|
|
17
|
+
_b.d = bindSignalValue(__s, _b.d, _b.b, props.value, "i:ab65f8a8");
|
|
18
18
|
setEventHandler(_b.b, "$$input", (e) => props.onChange?.(e.target.value));
|
|
19
19
|
}
|
|
20
|
-
_b.a = bindSignalAttribute(__s, _b.a, _b.b, "class", props.className, "b:
|
|
20
|
+
_b.a = bindSignalAttribute(__s, _b.a, _b.b, "class", props.className, "b:f09620ef", "class");
|
|
21
21
|
{
|
|
22
22
|
const _v = props.style;
|
|
23
23
|
if (_b.c !== _v) {
|
|
@@ -25,7 +25,7 @@ var TextInput = /* @__PURE__ */ __s(function TextInput(props, __s, __extra) {
|
|
|
25
25
|
_b.c = _v;
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
|
-
_b.e = bindSignalAttribute(__s, _b.e, _b.b, "placeholder", props.placeholder, "b:
|
|
28
|
+
_b.e = bindSignalAttribute(__s, _b.e, _b.b, "placeholder", props.placeholder ?? props.hint, "b:f03e01a9", "attr");
|
|
29
29
|
});
|
|
30
30
|
//#endregion
|
|
31
31
|
export { TextInput };
|
package/dist/web/ui7.js
CHANGED
|
@@ -17,11 +17,21 @@ function __empty$1(__props, __s, __extra) {
|
|
|
17
17
|
drainFrag(_root, __block.parentNode, __block.endMarker);
|
|
18
18
|
_b = bag4(__s, null, _m0, _m1, null, void 0);
|
|
19
19
|
}
|
|
20
|
-
_b.e = bindSignalChild(__s, _b.e, 1, _b.a, props.renderEmpty?.(), "b:
|
|
20
|
+
_b.e = bindSignalChild(__s, _b.e, 1, _b.a, props.renderEmpty?.(), "b:dbd88467", _b.b, true, void 0, true, void 0);
|
|
21
21
|
}
|
|
22
22
|
function __item$3(item, __s, __extra) {
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
const __block = __s.block;
|
|
24
|
+
const props = __extra[0];
|
|
25
|
+
let _b = __s.slots[0];
|
|
26
|
+
if (_b === void 0) {
|
|
27
|
+
let _m0, _m1;
|
|
28
|
+
const _root = clone(_t$0);
|
|
29
|
+
_m0 = __block.parentNode;
|
|
30
|
+
_m1 = child(_root);
|
|
31
|
+
drainFrag(_root, __block.parentNode, __block.endMarker);
|
|
32
|
+
_b = bag4(__s, null, _m0, _m1, null, void 0);
|
|
33
|
+
}
|
|
34
|
+
_b.e = bindSignalChild(__s, _b.e, 1, _b.a, props.renderItem(item), "b:a4298d20", _b.b, true, void 0, true, void 0);
|
|
25
35
|
}
|
|
26
36
|
var List = /* @__PURE__ */ __s(function List(props, __s, __extra) {
|
|
27
37
|
let _b = __s.slots[0];
|
|
@@ -32,7 +42,7 @@ var List = /* @__PURE__ */ __s(function List(props, __s, __extra) {
|
|
|
32
42
|
_m4 = child(_root);
|
|
33
43
|
_b = bag5(__s, _root, void 0, _m1, void 0, void 0, _m4);
|
|
34
44
|
}
|
|
35
|
-
_b.a = bindSignalAttribute(__s, _b.a, _b.b, "id", props.id, "b:
|
|
45
|
+
_b.a = bindSignalAttribute(__s, _b.a, _b.b, "id", props.id, "b:22ff36f2", "attr");
|
|
36
46
|
_b.c = updateFreshClassName(["vx-list", props.className], _b.c, _b.b);
|
|
37
47
|
{
|
|
38
48
|
const _v = props.style;
|
package/dist/web/ui8.js
CHANGED
|
@@ -11,7 +11,7 @@ var ScrollView = /* @__PURE__ */ __s(function ScrollView(props, __s, __extra) {
|
|
|
11
11
|
_m1 = _root;
|
|
12
12
|
_b = bag6(__s, _root, void 0, _m1, void 0, void 0, null, void 0);
|
|
13
13
|
}
|
|
14
|
-
_b.a = bindSignalAttribute(__s, _b.a, _b.b, "id", props.id, "b:
|
|
14
|
+
_b.a = bindSignalAttribute(__s, _b.a, _b.b, "id", props.id, "b:79e2ec85", "attr");
|
|
15
15
|
_b.c = updateFreshClassName(["vx-scroll", props.className], _b.c, _b.b);
|
|
16
16
|
{
|
|
17
17
|
const _v = {
|
|
@@ -23,7 +23,7 @@ var ScrollView = /* @__PURE__ */ __s(function ScrollView(props, __s, __extra) {
|
|
|
23
23
|
_b.d = _v;
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
-
_b.g = bindSignalChild(__s, _b.g, 1, _b.b, props.children, "b:
|
|
26
|
+
_b.g = bindSignalChild(__s, _b.g, 1, _b.b, props.children, "b:142a2a1c", null, void 0, void 0, void 0, true);
|
|
27
27
|
});
|
|
28
28
|
//#endregion
|
|
29
29
|
export { ScrollView };
|
package/dist/web/ui9.js
CHANGED
|
@@ -11,8 +11,8 @@ var Image = /* @__PURE__ */ __s(function Image(props, __s, __extra) {
|
|
|
11
11
|
_m1 = _root;
|
|
12
12
|
_b = bag6(__s, _root, void 0, _m1, void 0, void 0, void 0, void 0);
|
|
13
13
|
}
|
|
14
|
-
_b.a = bindSignalAttribute(__s, _b.a, _b.b, "id", props.id, "b:
|
|
15
|
-
_b.c = bindSignalAttribute(__s, _b.c, _b.b, "class", props.className, "b:
|
|
14
|
+
_b.a = bindSignalAttribute(__s, _b.a, _b.b, "id", props.id, "b:dac1f500", "attr");
|
|
15
|
+
_b.c = bindSignalAttribute(__s, _b.c, _b.b, "class", props.className, "b:dee59c6d", "class");
|
|
16
16
|
{
|
|
17
17
|
const _v = props.style;
|
|
18
18
|
if (_b.d !== _v) {
|
|
@@ -20,8 +20,8 @@ var Image = /* @__PURE__ */ __s(function Image(props, __s, __extra) {
|
|
|
20
20
|
_b.d = _v;
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
|
-
_b.e = bindSignalAttribute(__s, _b.e, _b.b, "src", props.src, "b:
|
|
24
|
-
_b.f = bindSignalAttribute(__s, _b.f, _b.b, "alt", props.alt, "b:
|
|
23
|
+
_b.e = bindSignalAttribute(__s, _b.e, _b.b, "src", props.src, "b:1951fade", "attr");
|
|
24
|
+
_b.f = bindSignalAttribute(__s, _b.f, _b.b, "alt", props.alt, "b:0b6f5f10", "attr");
|
|
25
25
|
});
|
|
26
26
|
//#endregion
|
|
27
27
|
export { Image };
|
package/package.json
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@octane-xplat/ui",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
7
|
+
"types",
|
|
7
8
|
"src/theme/tokens.css"
|
|
8
9
|
],
|
|
9
10
|
"exports": {
|
|
10
11
|
".": {
|
|
12
|
+
"types": "./types/index.d.ts",
|
|
11
13
|
"web": "./dist/web/ui.js",
|
|
12
14
|
"native": "./dist/native/ui.js",
|
|
13
15
|
"default": "./dist/native/ui.js"
|
|
@@ -16,17 +18,25 @@
|
|
|
16
18
|
},
|
|
17
19
|
"devDependencies": {
|
|
18
20
|
"@nativescript-community/octane": "0.2.1",
|
|
19
|
-
"@octanejs/vite-plugin": "0.1.58",
|
|
20
21
|
"@nativescript/core": "9.1.2",
|
|
22
|
+
"@octanejs/vite-plugin": "0.1.58",
|
|
21
23
|
"octane": "0.4.0",
|
|
22
24
|
"vite": "8.3.0"
|
|
23
25
|
},
|
|
24
26
|
"peerDependencies": {
|
|
25
|
-
"octane": ">=0.1.51 <1",
|
|
26
27
|
"@nativescript-community/octane": ">=0.2.1 <1",
|
|
27
|
-
"@nativescript/core": ">=9.1.0 <10"
|
|
28
|
+
"@nativescript/core": ">=9.1.0 <10",
|
|
29
|
+
"octane": ">=0.1.51 <1"
|
|
30
|
+
},
|
|
31
|
+
"peerDependenciesMeta": {
|
|
32
|
+
"@nativescript-community/octane": {
|
|
33
|
+
"optional": true
|
|
34
|
+
},
|
|
35
|
+
"@nativescript/core": {
|
|
36
|
+
"optional": true
|
|
37
|
+
}
|
|
28
38
|
},
|
|
29
39
|
"scripts": {
|
|
30
|
-
"build": "vite build && vite build --mode native"
|
|
40
|
+
"build": "vite build && vite build --mode native && tsc -p tsconfig.types.json"
|
|
31
41
|
}
|
|
32
42
|
}
|
package/types/index.d.ts
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
// Boundary types for @octane-xplat/ui — the thin shell over the real
|
|
2
|
+
// contract. Every interface lives in `src/props.ts` (imported by both
|
|
3
|
+
// platform leaves and emitted here as `./props`), so the ONLY hand-written
|
|
4
|
+
// part is the mechanical `declare const X: UniversalComponent<XProps>`
|
|
5
|
+
// wrapper — component shapes can't drift from the source. tsrx-tsc can't
|
|
6
|
+
// emit declarations for .tsrx (upstream: tsrx-org/tsrx#136); this file is
|
|
7
|
+
// what `tsc --emitDeclarationOnly` on pure .ts buys us.
|
|
8
|
+
|
|
9
|
+
import type { UniversalComponent } from 'octane/universal';
|
|
10
|
+
import type {
|
|
11
|
+
AnimatedValue,
|
|
12
|
+
ColorScheme,
|
|
13
|
+
ImageProps,
|
|
14
|
+
ListProps,
|
|
15
|
+
ModalProps,
|
|
16
|
+
PlatformBadgeProps,
|
|
17
|
+
PressableProps,
|
|
18
|
+
Route,
|
|
19
|
+
RowProps,
|
|
20
|
+
ScreenProps,
|
|
21
|
+
ScrollViewProps,
|
|
22
|
+
SwitchProps,
|
|
23
|
+
TabSpec,
|
|
24
|
+
TabsProps,
|
|
25
|
+
TextInputProps,
|
|
26
|
+
TextProps,
|
|
27
|
+
ViewProps,
|
|
28
|
+
} from './props';
|
|
29
|
+
|
|
30
|
+
export type {
|
|
31
|
+
AnimatedValue,
|
|
32
|
+
ColorScheme,
|
|
33
|
+
ImageProps,
|
|
34
|
+
ListProps,
|
|
35
|
+
ModalProps,
|
|
36
|
+
PanEvent,
|
|
37
|
+
PlatformBadgeProps,
|
|
38
|
+
PressableProps,
|
|
39
|
+
Route,
|
|
40
|
+
RowProps,
|
|
41
|
+
ScreenProps,
|
|
42
|
+
ScrollViewProps,
|
|
43
|
+
SwipeEvent,
|
|
44
|
+
SwitchProps,
|
|
45
|
+
TabSpec,
|
|
46
|
+
TabsProps,
|
|
47
|
+
TextInputProps,
|
|
48
|
+
TextProps,
|
|
49
|
+
ViewProps,
|
|
50
|
+
} from './props';
|
|
51
|
+
|
|
52
|
+
// ---------- primitives ----------
|
|
53
|
+
|
|
54
|
+
export declare const View: UniversalComponent<ViewProps>;
|
|
55
|
+
/** Column-direction alias of View. */
|
|
56
|
+
export declare const Column: UniversalComponent<ViewProps>;
|
|
57
|
+
export declare const Row: UniversalComponent<RowProps>;
|
|
58
|
+
export declare const Text: UniversalComponent<TextProps>;
|
|
59
|
+
export declare const Pressable: UniversalComponent<PressableProps>;
|
|
60
|
+
export declare const TextInput: UniversalComponent<TextInputProps>;
|
|
61
|
+
export declare const List: UniversalComponent<ListProps>;
|
|
62
|
+
export declare const ScrollView: UniversalComponent<ScrollViewProps>;
|
|
63
|
+
export declare const Image: UniversalComponent<ImageProps>;
|
|
64
|
+
export declare const Screen: UniversalComponent<ScreenProps>;
|
|
65
|
+
export declare const Switch: UniversalComponent<SwitchProps>;
|
|
66
|
+
export declare const PlatformBadge: UniversalComponent<PlatformBadgeProps>;
|
|
67
|
+
|
|
68
|
+
// ---------- overlays / shells ----------
|
|
69
|
+
|
|
70
|
+
export declare const Modal: UniversalComponent<ModalProps>;
|
|
71
|
+
export declare const Tabs: UniversalComponent<TabsProps>;
|
|
72
|
+
|
|
73
|
+
// ---------- stacks (native registry; no-op on web) ----------
|
|
74
|
+
|
|
75
|
+
export declare function registerStack(name: string, frame: any): void;
|
|
76
|
+
export declare function getStack(name: string): any;
|
|
77
|
+
export declare function stackEntries(): IterableIterator<[string, any]>;
|
|
78
|
+
|
|
79
|
+
// ---------- routes (web store; no-op on native) ----------
|
|
80
|
+
|
|
81
|
+
export declare function pushRoute(r: Route): void;
|
|
82
|
+
export declare function routeFor(stack: string): Route | null;
|
|
83
|
+
export declare function currentRoute(): Route | null;
|
|
84
|
+
export declare function useRoute(stack: string): Route | null;
|
|
85
|
+
|
|
86
|
+
// ---------- animation / theme ----------
|
|
87
|
+
|
|
88
|
+
export declare function useAnimation(initial?: number, prop?: string): AnimatedValue;
|
|
89
|
+
export declare function getColorScheme(): ColorScheme;
|
|
90
|
+
export declare function useColorScheme(): ColorScheme;
|
|
91
|
+
|
|
92
|
+
// ---------- styled ----------
|
|
93
|
+
|
|
94
|
+
export declare function styled<P extends { className?: any }, V extends Record<string, any>>(
|
|
95
|
+
Base: (props: P) => any,
|
|
96
|
+
def: { base?: any; variants?: V },
|
|
97
|
+
): UniversalComponent<P & { [K in keyof V]?: boolean }>;
|
package/types/props.d.ts
ADDED
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
/** Shared prop/type contract — the single source of truth for the public
|
|
2
|
+
* API surface. Platform leaves import these types so prop shapes cannot
|
|
3
|
+
* drift across .web/.native, and `tsc --emitDeclarationOnly` emits this
|
|
4
|
+
* file into the published package's boundary types (tsrx can't emit
|
|
5
|
+
* declarations — pure .ts is what escapes that). No imports here:
|
|
6
|
+
* everything must stay dependency-free and platform-agnostic. */
|
|
7
|
+
export interface PanEvent {
|
|
8
|
+
x: number;
|
|
9
|
+
y: number;
|
|
10
|
+
dx: number;
|
|
11
|
+
dy: number;
|
|
12
|
+
vx: number;
|
|
13
|
+
vy: number;
|
|
14
|
+
state: string;
|
|
15
|
+
target: any;
|
|
16
|
+
}
|
|
17
|
+
export interface SwipeEvent {
|
|
18
|
+
direction: number;
|
|
19
|
+
}
|
|
20
|
+
export interface ViewProps {
|
|
21
|
+
className?: any;
|
|
22
|
+
style?: any;
|
|
23
|
+
children?: any;
|
|
24
|
+
id?: string;
|
|
25
|
+
/** `ref` is runtime-reserved on component elements — leaves expose
|
|
26
|
+
* `bind` to reach the native/DOM node. */
|
|
27
|
+
bind?: (el: any) => void;
|
|
28
|
+
onPan?: (e: PanEvent) => void;
|
|
29
|
+
onSwipe?: (e: SwipeEvent) => void;
|
|
30
|
+
}
|
|
31
|
+
export interface RowProps {
|
|
32
|
+
className?: any;
|
|
33
|
+
style?: any;
|
|
34
|
+
children?: any;
|
|
35
|
+
}
|
|
36
|
+
export interface TextProps {
|
|
37
|
+
className?: any;
|
|
38
|
+
style?: any;
|
|
39
|
+
children?: any;
|
|
40
|
+
}
|
|
41
|
+
export interface PressableProps {
|
|
42
|
+
className?: any;
|
|
43
|
+
style?: any;
|
|
44
|
+
children?: any;
|
|
45
|
+
id?: string;
|
|
46
|
+
disabled?: boolean;
|
|
47
|
+
onPress?: () => void;
|
|
48
|
+
/** ~500ms press-and-hold (web: timer over pointerdown/up). */
|
|
49
|
+
onLongPress?: () => void;
|
|
50
|
+
accessible?: boolean;
|
|
51
|
+
accessibilityLabel?: string;
|
|
52
|
+
accessibilityRole?: string;
|
|
53
|
+
}
|
|
54
|
+
export interface TextInputProps {
|
|
55
|
+
className?: any;
|
|
56
|
+
style?: any;
|
|
57
|
+
value?: string;
|
|
58
|
+
placeholder?: string;
|
|
59
|
+
/** NativeScript's term for placeholder — web maps hint → placeholder. */
|
|
60
|
+
hint?: string;
|
|
61
|
+
onChange?: (value: string) => void;
|
|
62
|
+
}
|
|
63
|
+
export interface ListProps {
|
|
64
|
+
className?: any;
|
|
65
|
+
style?: any;
|
|
66
|
+
id?: string;
|
|
67
|
+
items: any[];
|
|
68
|
+
renderItem: (item: any) => any;
|
|
69
|
+
renderEmpty?: () => any;
|
|
70
|
+
}
|
|
71
|
+
export interface ScrollViewProps {
|
|
72
|
+
className?: any;
|
|
73
|
+
style?: any;
|
|
74
|
+
id?: string;
|
|
75
|
+
horizontal?: boolean;
|
|
76
|
+
children?: any;
|
|
77
|
+
}
|
|
78
|
+
export interface ImageProps {
|
|
79
|
+
className?: any;
|
|
80
|
+
style?: any;
|
|
81
|
+
id?: string;
|
|
82
|
+
src: string;
|
|
83
|
+
alt?: string;
|
|
84
|
+
}
|
|
85
|
+
export interface ScreenProps {
|
|
86
|
+
className?: any;
|
|
87
|
+
style?: any;
|
|
88
|
+
children?: any;
|
|
89
|
+
}
|
|
90
|
+
export interface SwitchProps {
|
|
91
|
+
className?: any;
|
|
92
|
+
style?: any;
|
|
93
|
+
id?: string;
|
|
94
|
+
checked?: boolean;
|
|
95
|
+
onCheckedChange?: (checked: boolean) => void;
|
|
96
|
+
}
|
|
97
|
+
export interface PlatformBadgeProps {
|
|
98
|
+
className?: any;
|
|
99
|
+
}
|
|
100
|
+
export interface ModalProps {
|
|
101
|
+
open?: boolean;
|
|
102
|
+
onClose?: () => void;
|
|
103
|
+
fullscreen?: boolean;
|
|
104
|
+
children?: any;
|
|
105
|
+
}
|
|
106
|
+
export interface TabSpec {
|
|
107
|
+
title: string;
|
|
108
|
+
render: () => any;
|
|
109
|
+
/** Named parallel stack — native hosts a Frame per such pane; on web
|
|
110
|
+
* the pane is the route outlet for `stack` (pushed screens render in
|
|
111
|
+
* place). navigate(name, params, {into: spec.stack}) targets it. */
|
|
112
|
+
stack?: string;
|
|
113
|
+
}
|
|
114
|
+
export interface TabsProps {
|
|
115
|
+
className?: any;
|
|
116
|
+
style?: any;
|
|
117
|
+
id?: string;
|
|
118
|
+
tabs: readonly TabSpec[];
|
|
119
|
+
selectedIndex?: number;
|
|
120
|
+
onSelectedIndexChanged?: (index: number) => void;
|
|
121
|
+
/** Renders a pushed route's screen by name (the app owns the table).
|
|
122
|
+
* Web: route outlet. Native: pushes render inside the pane's Frame. */
|
|
123
|
+
resolveScreen?: (name: string, params: Record<string, unknown>) => any;
|
|
124
|
+
}
|
|
125
|
+
export interface Route {
|
|
126
|
+
stack: string;
|
|
127
|
+
name: string;
|
|
128
|
+
params: Record<string, unknown>;
|
|
129
|
+
}
|
|
130
|
+
export interface AnimatedValue {
|
|
131
|
+
readonly value: number;
|
|
132
|
+
bind(el: any): void;
|
|
133
|
+
to(target: number, opts?: {
|
|
134
|
+
duration?: number;
|
|
135
|
+
}): void;
|
|
136
|
+
spring(target: number, opts?: {
|
|
137
|
+
damping?: number;
|
|
138
|
+
stiffness?: number;
|
|
139
|
+
}): void;
|
|
140
|
+
stop(): void;
|
|
141
|
+
}
|
|
142
|
+
export type ColorScheme = 'light' | 'dark';
|