@octane-xplat/ui 0.7.1 → 0.7.3
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/CommandPalette.tsrx.js +7 -1
- package/dist/native/Grid.tsrx.js +31 -2
- package/dist/native/Hoverable.mobile.tsrx.js +39 -0
- package/dist/native/Pagination.tsrx.js +15 -12
- package/dist/native/Popover.tsrx.js +18 -7
- package/dist/native/Screen.tsrx.js +1 -1
- package/dist/native/Sheet.tsrx.js +1 -1
- package/dist/native/Slider.tsrx.js +23 -14
- package/dist/native/Text.tsrx.js +16 -0
- package/dist/native/Tooltip.mobile.tsrx.js +39 -0
- package/dist/native/WebView.tsrx.js +17 -2
- package/dist/native/_virtual/_@oxc-project_runtime@0.150.0/helpers/esm/decorate.js +9 -0
- package/dist/native/escape-props.js +2 -0
- package/dist/native/grid-auto-placement.js +83 -0
- package/dist/native/grid-placement.js +20 -0
- package/dist/native/index.shared.js +2 -2
- package/dist/native/octane-client-build.json +1 -1
- package/dist/native/shared.js +2 -2
- package/dist/native/sheet-service.js +1 -1
- package/dist/native/{tap-to-blur.mobile.js → tap-to-blur.ios.js} +20 -32
- package/dist/native/ui.js +2 -2
- package/dist/native/useMeasure.tsrx.js +17 -18
- package/dist/web/index.shared.js +92 -0
- package/dist/web/octane-client-build.json +1 -1
- package/dist/web/ui.js +1 -0
- package/package.json +1 -1
- package/src/CommandPalette.tsrx +7 -1
- package/src/Grid.tsrx +30 -1
- package/src/Pagination.tsrx +6 -4
- package/src/Popover.tsrx +20 -6
- package/src/Screen.tsrx +1 -1
- package/src/Sheet.tsrx +1 -1
- package/src/Slider.tsrx +13 -11
- package/src/Text.tsrx +34 -0
- package/src/WebView.tsrx +19 -10
- package/src/escape-props.ts +11 -1
- package/src/grid-auto-placement.ts +121 -0
- package/src/grid-placement.ts +29 -0
- package/src/index.shared.ts +84 -84
- package/src/index.web.ts +1 -261
- package/src/sheet-service.ts +1 -1
- package/src/tap-to-blur.ios.ts +90 -0
- package/src/tap-to-blur.mobile.ts +12 -94
- package/src/theme/tokens.css +24 -8
- package/src/useMeasure.tsrx +20 -21
- package/types/generated/.tsrx-typegen-manifest.json +10 -1
- package/types/generated/Grid.d.ts +0 -1
- package/types/generated/Hoverable.mobile.d.ts +8 -0
- package/types/generated/Tooltip.mobile.d.ts +7 -0
- package/types/generated/camera-permission.web.d.ts +2 -0
- package/types/generated/escape-props.d.ts +4 -0
- package/types/generated/escape-props.web.d.ts +5 -0
- package/types/generated/grid-auto-placement.d.ts +13 -0
- package/types/generated/grid-placement.d.ts +5 -0
- package/types/generated/index.web.d.ts +1 -111
- package/types/generated/tap-to-blur.ios.d.ts +13 -0
- package/types/generated/tap-to-blur.mobile.d.ts +1 -15
- package/types/generated/text-write.web.d.ts +4 -0
- package/types/generated/toast.d.ts +3 -0
- package/types/generated/toast.web.d.ts +3 -0
- package/dist/native/Hoverable.tsrx.js +0 -139
- package/dist/native/Tooltip.tsrx.js +0 -131
- package/types/generated/theme/colorScheme.web.d.ts +0 -5
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
import { cx } from "./cx.js";
|
|
2
|
-
import { View } from "./View.tsrx.js";
|
|
3
|
-
import { defineUniversalComponent, hookSlots, universalComponent, universalPlan, universalProps, universalValue, useEffect, useRef } from "@nativescript-community/octane";
|
|
4
|
-
//#region src/Hoverable.tsrx
|
|
5
|
-
var _hs$ = /* @__PURE__ */ hookSlots(7);
|
|
6
|
-
var _h$0 = /* @__PURE__ */ Symbol(_hs$);
|
|
7
|
-
var _h$1 = /* @__PURE__ */ Symbol(_hs$ + 1);
|
|
8
|
-
var _h$2 = /* @__PURE__ */ Symbol(_hs$ + 2);
|
|
9
|
-
var _h$3 = /* @__PURE__ */ Symbol(_hs$ + 3);
|
|
10
|
-
var _h$4 = /* @__PURE__ */ Symbol(_hs$ + 4);
|
|
11
|
-
var _h$5 = /* @__PURE__ */ Symbol(_hs$ + 5);
|
|
12
|
-
var _h$6 = /* @__PURE__ */ Symbol(_hs$ + 6);
|
|
13
|
-
var __octaneUniversalPlan0 = universalPlan("nativescript", {
|
|
14
|
-
"kind": "slot",
|
|
15
|
-
"slot": 0
|
|
16
|
-
});
|
|
17
|
-
var __octaneUniversalPlan1 = universalPlan("nativescript", {
|
|
18
|
-
"kind": "slot",
|
|
19
|
-
"slot": 0
|
|
20
|
-
});
|
|
21
|
-
var host = () => globalThis.__xplatAppKit ?? {};
|
|
22
|
-
var HoverablePanel = defineUniversalComponent("nativescript", function HoverablePanel(props) {
|
|
23
|
-
return universalValue(__octaneUniversalPlan0, [universalComponent("nativescript", View, universalProps([[
|
|
24
|
-
"set",
|
|
25
|
-
"className",
|
|
26
|
-
cx("vx-hoverable-card", props.className)
|
|
27
|
-
], [
|
|
28
|
-
"set",
|
|
29
|
-
"style",
|
|
30
|
-
props.style
|
|
31
|
-
]], props.body))]);
|
|
32
|
-
}, { "module": "@nativescript-community/octane" });
|
|
33
|
-
var Hoverable = defineUniversalComponent("nativescript", function Hoverable(props) {
|
|
34
|
-
const anchor = useRef(null, _h$0);
|
|
35
|
-
const popup = useRef(null, _h$1);
|
|
36
|
-
const detachHover = useRef(null, _h$2);
|
|
37
|
-
const detachCardHover = useRef(null, _h$3);
|
|
38
|
-
const openTimer = useRef(null, _h$4);
|
|
39
|
-
const closeTimer = useRef(null, _h$5);
|
|
40
|
-
const clearOpen = () => {
|
|
41
|
-
if (openTimer.current !== null) clearTimeout(openTimer.current);
|
|
42
|
-
openTimer.current = null;
|
|
43
|
-
};
|
|
44
|
-
const clearClose = () => {
|
|
45
|
-
if (closeTimer.current !== null) clearTimeout(closeTimer.current);
|
|
46
|
-
closeTimer.current = null;
|
|
47
|
-
};
|
|
48
|
-
const closeNow = () => {
|
|
49
|
-
clearOpen();
|
|
50
|
-
clearClose();
|
|
51
|
-
detachCardHover.current?.();
|
|
52
|
-
detachCardHover.current = null;
|
|
53
|
-
popup.current?.close();
|
|
54
|
-
popup.current = null;
|
|
55
|
-
};
|
|
56
|
-
const openNow = () => {
|
|
57
|
-
if (popup.current) return;
|
|
58
|
-
const view = anchor.current;
|
|
59
|
-
const show = host().showAnchoredPopup;
|
|
60
|
-
if (!view || typeof show !== "function") return;
|
|
61
|
-
popup.current = show({
|
|
62
|
-
anchor: view,
|
|
63
|
-
placement: props.placement ?? "bottom",
|
|
64
|
-
component: HoverablePanel,
|
|
65
|
-
props: {
|
|
66
|
-
body: props.card,
|
|
67
|
-
className: props.cardClassName,
|
|
68
|
-
style: props.cardStyle
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
if (popup.current?.contentView && typeof host().observeHover === "function") detachCardHover.current = host().observeHover(popup.current.contentView, {
|
|
72
|
-
enter: clearClose,
|
|
73
|
-
exit: scheduleClose
|
|
74
|
-
});
|
|
75
|
-
};
|
|
76
|
-
const startOpen = () => {
|
|
77
|
-
clearClose();
|
|
78
|
-
clearOpen();
|
|
79
|
-
openTimer.current = setTimeout(() => {
|
|
80
|
-
openTimer.current = null;
|
|
81
|
-
openNow();
|
|
82
|
-
}, Math.max(0, props.openDelay ?? 500));
|
|
83
|
-
};
|
|
84
|
-
const scheduleClose = () => {
|
|
85
|
-
clearClose();
|
|
86
|
-
closeTimer.current = setTimeout(() => {
|
|
87
|
-
closeTimer.current = null;
|
|
88
|
-
closeNow();
|
|
89
|
-
}, Math.max(0, props.closeDelay ?? 120));
|
|
90
|
-
};
|
|
91
|
-
const bindAnchor = (view) => {
|
|
92
|
-
if (view && view === anchor.current && detachHover.current) return;
|
|
93
|
-
anchor.current = view;
|
|
94
|
-
detachHover.current?.();
|
|
95
|
-
detachHover.current = null;
|
|
96
|
-
if (!view) return;
|
|
97
|
-
const observe = host().observeHover;
|
|
98
|
-
if (typeof observe !== "function") return;
|
|
99
|
-
detachHover.current = observe(view, {
|
|
100
|
-
enter: startOpen,
|
|
101
|
-
exit: () => {
|
|
102
|
-
clearOpen();
|
|
103
|
-
scheduleClose();
|
|
104
|
-
}
|
|
105
|
-
});
|
|
106
|
-
};
|
|
107
|
-
useEffect(() => () => {
|
|
108
|
-
clearOpen();
|
|
109
|
-
clearClose();
|
|
110
|
-
detachHover.current?.();
|
|
111
|
-
detachCardHover.current?.();
|
|
112
|
-
popup.current?.close();
|
|
113
|
-
popup.current = null;
|
|
114
|
-
}, [], _h$6);
|
|
115
|
-
return universalValue(__octaneUniversalPlan1, [universalComponent("nativescript", View, universalProps([
|
|
116
|
-
[
|
|
117
|
-
"set",
|
|
118
|
-
"id",
|
|
119
|
-
props.id
|
|
120
|
-
],
|
|
121
|
-
[
|
|
122
|
-
"set",
|
|
123
|
-
"className",
|
|
124
|
-
props.className
|
|
125
|
-
],
|
|
126
|
-
[
|
|
127
|
-
"set",
|
|
128
|
-
"style",
|
|
129
|
-
props.style
|
|
130
|
-
],
|
|
131
|
-
[
|
|
132
|
-
"set",
|
|
133
|
-
"bind",
|
|
134
|
-
bindAnchor
|
|
135
|
-
]
|
|
136
|
-
], props.children))]);
|
|
137
|
-
}, { "module": "@nativescript-community/octane" });
|
|
138
|
-
//#endregion
|
|
139
|
-
export { Hoverable };
|
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
import { cx } from "./cx.js";
|
|
2
|
-
import { View } from "./View.tsrx.js";
|
|
3
|
-
import { defineUniversalComponent, hookSlots, universalComponent, universalPlan, universalProps, universalValue, useEffect, useRef } from "@nativescript-community/octane";
|
|
4
|
-
//#region src/Tooltip.tsrx
|
|
5
|
-
var _hs$ = /* @__PURE__ */ hookSlots(6);
|
|
6
|
-
var _h$0 = /* @__PURE__ */ Symbol(_hs$);
|
|
7
|
-
var _h$1 = /* @__PURE__ */ Symbol(_hs$ + 1);
|
|
8
|
-
var _h$2 = /* @__PURE__ */ Symbol(_hs$ + 2);
|
|
9
|
-
var _h$3 = /* @__PURE__ */ Symbol(_hs$ + 3);
|
|
10
|
-
var _h$4 = /* @__PURE__ */ Symbol(_hs$ + 4);
|
|
11
|
-
var _h$5 = /* @__PURE__ */ Symbol(_hs$ + 5);
|
|
12
|
-
var __octaneUniversalPlan0 = universalPlan("nativescript", {
|
|
13
|
-
"kind": "slot",
|
|
14
|
-
"slot": 0
|
|
15
|
-
});
|
|
16
|
-
var __octaneUniversalPlan1 = universalPlan("nativescript", {
|
|
17
|
-
"kind": "slot",
|
|
18
|
-
"slot": 0
|
|
19
|
-
});
|
|
20
|
-
var host = () => globalThis.__xplatAppKit ?? {};
|
|
21
|
-
var TooltipPanel = defineUniversalComponent("nativescript", function TooltipPanel(props) {
|
|
22
|
-
return universalValue(__octaneUniversalPlan0, [universalComponent("nativescript", View, universalProps([[
|
|
23
|
-
"set",
|
|
24
|
-
"className",
|
|
25
|
-
cx("vx-tooltip", props.className)
|
|
26
|
-
], [
|
|
27
|
-
"set",
|
|
28
|
-
"style",
|
|
29
|
-
props.style
|
|
30
|
-
]], props.body))]);
|
|
31
|
-
}, { "module": "@nativescript-community/octane" });
|
|
32
|
-
var Tooltip = defineUniversalComponent("nativescript", function Tooltip(props) {
|
|
33
|
-
const anchor = useRef(null, _h$0);
|
|
34
|
-
const popup = useRef(null, _h$1);
|
|
35
|
-
const detachHover = useRef(null, _h$2);
|
|
36
|
-
const openTimer = useRef(null, _h$3);
|
|
37
|
-
const closeTimer = useRef(null, _h$4);
|
|
38
|
-
const clearOpen = () => {
|
|
39
|
-
if (openTimer.current !== null) clearTimeout(openTimer.current);
|
|
40
|
-
openTimer.current = null;
|
|
41
|
-
};
|
|
42
|
-
const clearClose = () => {
|
|
43
|
-
if (closeTimer.current !== null) clearTimeout(closeTimer.current);
|
|
44
|
-
closeTimer.current = null;
|
|
45
|
-
};
|
|
46
|
-
const closeNow = () => {
|
|
47
|
-
clearOpen();
|
|
48
|
-
clearClose();
|
|
49
|
-
popup.current?.close();
|
|
50
|
-
popup.current = null;
|
|
51
|
-
};
|
|
52
|
-
const openNow = () => {
|
|
53
|
-
if (props.disabled || popup.current) return;
|
|
54
|
-
const view = anchor.current;
|
|
55
|
-
const show = host().showAnchoredPopup;
|
|
56
|
-
if (!view || typeof show !== "function") return;
|
|
57
|
-
popup.current = show({
|
|
58
|
-
anchor: view,
|
|
59
|
-
placement: props.placement ?? "top",
|
|
60
|
-
component: TooltipPanel,
|
|
61
|
-
props: {
|
|
62
|
-
body: props.content,
|
|
63
|
-
className: props.contentClassName,
|
|
64
|
-
style: props.contentStyle
|
|
65
|
-
}
|
|
66
|
-
});
|
|
67
|
-
};
|
|
68
|
-
const startOpen = () => {
|
|
69
|
-
if (props.disabled) return;
|
|
70
|
-
clearClose();
|
|
71
|
-
clearOpen();
|
|
72
|
-
openTimer.current = setTimeout(() => {
|
|
73
|
-
openTimer.current = null;
|
|
74
|
-
openNow();
|
|
75
|
-
}, Math.max(0, props.openDelay ?? 500));
|
|
76
|
-
};
|
|
77
|
-
const scheduleClose = () => {
|
|
78
|
-
clearClose();
|
|
79
|
-
closeTimer.current = setTimeout(() => {
|
|
80
|
-
closeTimer.current = null;
|
|
81
|
-
closeNow();
|
|
82
|
-
}, Math.max(0, props.closeDelay ?? 100));
|
|
83
|
-
};
|
|
84
|
-
const bindAnchor = (view) => {
|
|
85
|
-
if (view && view === anchor.current && detachHover.current) return;
|
|
86
|
-
anchor.current = view;
|
|
87
|
-
detachHover.current?.();
|
|
88
|
-
detachHover.current = null;
|
|
89
|
-
if (!view) return;
|
|
90
|
-
const observe = host().observeHover;
|
|
91
|
-
if (typeof observe !== "function") return;
|
|
92
|
-
detachHover.current = observe(view, {
|
|
93
|
-
enter: startOpen,
|
|
94
|
-
exit: () => {
|
|
95
|
-
clearOpen();
|
|
96
|
-
scheduleClose();
|
|
97
|
-
}
|
|
98
|
-
});
|
|
99
|
-
};
|
|
100
|
-
useEffect(() => () => {
|
|
101
|
-
clearOpen();
|
|
102
|
-
clearClose();
|
|
103
|
-
detachHover.current?.();
|
|
104
|
-
popup.current?.close();
|
|
105
|
-
popup.current = null;
|
|
106
|
-
}, [], _h$5);
|
|
107
|
-
return universalValue(__octaneUniversalPlan1, [universalComponent("nativescript", View, universalProps([
|
|
108
|
-
[
|
|
109
|
-
"set",
|
|
110
|
-
"id",
|
|
111
|
-
props.id
|
|
112
|
-
],
|
|
113
|
-
[
|
|
114
|
-
"set",
|
|
115
|
-
"className",
|
|
116
|
-
props.className
|
|
117
|
-
],
|
|
118
|
-
[
|
|
119
|
-
"set",
|
|
120
|
-
"style",
|
|
121
|
-
props.style
|
|
122
|
-
],
|
|
123
|
-
[
|
|
124
|
-
"set",
|
|
125
|
-
"bind",
|
|
126
|
-
bindAnchor
|
|
127
|
-
]
|
|
128
|
-
], props.trigger))]);
|
|
129
|
-
}, { "module": "@nativescript-community/octane" });
|
|
130
|
-
//#endregion
|
|
131
|
-
export { Tooltip };
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export type { ColorScheme } from '../props.js';
|
|
2
|
-
import type { ColorScheme } from '../props.js';
|
|
3
|
-
export declare function getColorScheme(): ColorScheme;
|
|
4
|
-
export declare function subscribeSystemScheme(cb: () => void): () => void;
|
|
5
|
-
export declare function useColorScheme(): ColorScheme;
|