@octane-xplat/ui 0.7.3 → 0.9.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 +4 -3
- package/dist/native/Button.tsrx.js +1 -1
- package/dist/native/KeyboardAvoiding.mobile.tsrx.js +2 -2
- package/dist/native/Markdown.tsrx.js +233 -0
- package/dist/native/Overlay.tsrx.js +15 -26
- package/dist/native/PinInput.tsrx.js +25 -7
- package/dist/native/Popover.tsrx.js +17 -18
- package/dist/native/Pressable.tsrx.js +4 -1
- package/dist/native/SearchInput.tsrx.js +6 -3
- package/dist/native/Sheet.tsrx.js +22 -37
- package/dist/native/TextArea.tsrx.js +6 -3
- package/dist/native/TextInput.tsrx.js +6 -3
- package/dist/native/VirtualList.tsrx.js +305 -121
- package/dist/native/index.shared.js +7 -5
- package/dist/native/keyboard-inset.mobile.js +5 -5
- package/dist/native/navigation-request.js +26 -0
- package/dist/native/octane-client-build.json +1 -1
- package/dist/native/overlay-lifetime.mobile.js +65 -0
- package/dist/native/pan.tsrx.js +16 -2
- package/dist/native/route-table.js +90 -10
- package/dist/native/route.js +26 -16
- package/dist/native/shared.js +7 -5
- package/dist/native/sheet-service.js +1 -1
- package/dist/native/svg.mobile.js +1 -1
- package/dist/native/text-focus.js +10 -0
- package/dist/native/text-write.js +18 -11
- package/dist/native/toast-anchor.tsrx.js +1 -1
- package/dist/native/ui.js +7 -6
- package/dist/native/vendor/ui-svg/index.android.js +2 -2
- package/dist/native/vendor/ui-svg/index.ios.js +2 -2
- package/dist/native/vendor/ui-svg/{index.common.js → src/index.common.js} +1 -1
- package/dist/native/virtual-list-cell-pool.js +63 -0
- package/dist/web/Button.web.tsrx.js +1 -1
- package/dist/web/KeyboardAvoiding.web.tsrx.js +78 -0
- package/dist/web/Markdown.tsrx.js +98 -0
- package/dist/web/Overlay.web.tsrx.js +81 -32
- package/dist/web/PinInput.web.tsrx.js +24 -10
- package/dist/web/Pressable.web.tsrx.js +169 -53
- package/dist/web/SearchInput.web.tsrx.js +2 -2
- package/dist/web/Sheet.web.tsrx.js +20 -7
- package/dist/web/TextArea.web.tsrx.js +22 -17
- package/dist/web/TextInput.web.tsrx.js +2 -2
- package/dist/web/VirtualList.web.tsrx.js +220 -109
- package/dist/web/WebView.web.tsrx.js +3 -3
- package/dist/web/{index.shared.js → index.shared.web.js} +7 -5
- package/dist/web/modal-focus.web.js +95 -0
- package/dist/web/navigation-request.js +26 -0
- package/dist/web/octane-client-build.json +1 -1
- package/dist/web/pan.web.tsrx.js +27 -10
- package/dist/web/route-table.js +90 -10
- package/dist/web/route.web.js +88 -22
- package/dist/web/sheet-service.web.js +8 -0
- package/dist/web/theme/colorScheme.web.js +31 -4
- package/dist/web/ui.js +8 -6
- package/dist/web/virtual-list-cell-pool.js +63 -0
- package/package.json +21 -19
- package/platforms/android/native-api-usage.json +7 -7
- package/src/CommandPalette.tsrx +1 -0
- package/src/Grid.tsrx +2 -0
- package/src/Icon.macos.tsrx +1 -0
- package/src/KeyboardAvoiding.macos.tsrx +7 -1
- package/src/KeyboardAvoiding.mobile.tsrx +2 -2
- package/src/KeyboardAvoiding.tsrx +15 -0
- package/src/KeyboardAvoiding.web.tsrx +15 -0
- package/src/Markdown.tsrx +121 -0
- package/src/Meter.tsrx +1 -0
- package/src/Overlay.tsrx +15 -30
- package/src/Overlay.web.tsrx +12 -3
- package/src/PinInput.macos.tsrx +20 -6
- package/src/PinInput.mobile.test.ts +107 -0
- package/src/PinInput.tsrx +20 -6
- package/src/PinInput.web.test.tsrx +42 -0
- package/src/PinInput.web.tsrx +20 -6
- package/src/Popover.tsrx +17 -17
- package/src/Pressable.tsrx +1 -1
- package/src/Pressable.web.test.tsrx +36 -0
- package/src/Pressable.web.tsrx +37 -6
- package/src/RouteHost.macos.tsrx +1 -0
- package/src/SearchInput.tsrx +4 -3
- package/src/SearchInput.web.tsrx +1 -1
- package/src/Sheet.tsrx +20 -41
- package/src/Sheet.web.tsrx +9 -1
- package/src/Text.tsrx +2 -0
- package/src/TextArea.tsrx +6 -5
- package/src/TextArea.web.test.tsrx +39 -0
- package/src/TextArea.web.tsrx +7 -5
- package/src/TextInput.tsrx +6 -6
- package/src/TextInput.web.tsrx +1 -1
- package/src/VirtualList.macos.tsrx +93 -6
- package/src/VirtualList.mobile.test.tsrx +232 -0
- package/src/VirtualList.tsrx +285 -81
- package/src/VirtualList.web.tsrx +131 -25
- package/src/WebView.tsrx +1 -0
- package/src/WebView.web.tsrx +3 -0
- package/src/android/BottomNavigationView.android.tsrx +1 -0
- package/src/android/MaterialDialog.android.tsrx +1 -0
- package/src/anim.macos.tsrx +1 -0
- package/src/apply-native-modifiers.native.ts +4 -1
- package/src/child-array.ts +12 -7
- package/src/colorScheme.macos.ts +1 -0
- package/src/controls.macos.tsrx +4 -1
- package/src/data-driver.mobile.test.ts +120 -0
- package/src/data-lifecycle.mobile.test.ts +251 -0
- package/src/escape-props.ts +2 -0
- package/src/grid-auto-placement.ts +54 -12
- package/src/grid-placement.ts +1 -1
- package/src/hosted-unsupported.macos.tsrx +1 -0
- package/src/index.macos.ts +23 -3
- package/src/index.mobile.ts +0 -1
- package/src/index.shared.ts +22 -1
- package/src/index.shared.web.ts +291 -0
- package/src/index.web.ts +1 -1
- package/src/input-readiness.web.test.tsrx +82 -0
- package/src/ios/UITabBar.ios.tsrx +1 -0
- package/src/keyboard-inset.mobile.test.ts +62 -0
- package/src/keyboard-inset.mobile.ts +63 -43
- package/src/layout-shells.macos.tsrx +1 -5
- package/src/macos-extras.macos.tsrx +2 -0
- package/src/modal-focus.web.test.tsrx +63 -0
- package/src/modal-focus.web.ts +162 -0
- package/src/navigation-request.ts +37 -0
- package/src/overlay-lifecycle.mobile.test.ts +316 -0
- package/src/overlay-lifetime.mobile.ts +107 -0
- package/src/pan.mobile.test.tsrx +116 -0
- package/src/pan.tsrx +20 -2
- package/src/pan.web.tsrx +35 -7
- package/src/platformProps.ts +1 -0
- package/src/popover.mobile.test.ts +9 -1
- package/src/pressable-accessibility.mobile.test.ts +30 -0
- package/src/props.ts +163 -3
- package/src/refresh.ts +6 -1
- package/src/refresh.web.test.ts +77 -77
- package/src/route-android.test.ts +162 -0
- package/src/route-history.web.test.ts +80 -0
- package/src/route-navigation.web.test.ts +173 -0
- package/src/route-table.test.ts +188 -9
- package/src/route-table.ts +138 -10
- package/src/route.macos.ts +56 -13
- package/src/route.ts +54 -24
- package/src/route.web.ts +141 -24
- package/src/sheet-detents.ts +5 -3
- package/src/sheet-service.macos.ts +5 -1
- package/src/sheet-service.web.ts +8 -0
- package/src/sheet-snap.test.ts +23 -23
- package/src/sheet-snap.ts +6 -1
- package/src/svg.mobile.ts +9 -3
- package/src/tap-to-blur.ios.ts +48 -32
- package/src/tap-to-blur.mobile.ts +23 -15
- package/src/text-focus.ts +12 -0
- package/src/text-input.mobile.test.ts +89 -0
- package/src/text-write.ts +21 -11
- package/src/theme/colorScheme.linux.ts +2 -4
- package/src/theme/colorScheme.web.ts +51 -4
- package/src/theme/theme-scheme.macos.ts +8 -2
- package/src/theme/tokens.css +1736 -1730
- package/src/translate.macos.ts +4 -1
- package/src/virtual-list-cell-pool.test.ts +53 -0
- package/src/virtual-list-cell-pool.ts +81 -0
- package/src/virtual-list-layout.test.ts +11 -8
- package/src/virtual-list-layout.ts +4 -8
- package/src/windows.linux.ts +7 -2
- package/src/windows.macos.ts +1 -0
- package/types/generated/.tsrx-typegen-manifest.json +13 -3
- package/types/generated/KeyboardAvoiding.d.ts +3 -0
- package/types/generated/KeyboardAvoiding.web.d.ts +2 -0
- package/types/generated/Markdown.d.ts +59 -0
- package/types/generated/TextArea.d.ts +2 -2
- package/types/generated/TextArea.web.d.ts +1 -1
- package/types/generated/TextInput.d.ts +2 -3
- package/types/generated/VirtualList.d.ts +3 -3
- package/types/generated/index.mobile.d.ts +0 -1
- package/types/generated/index.shared.d.ts +6 -3
- package/types/generated/index.shared.web.d.ts +114 -0
- package/types/generated/index.web.d.ts +1 -1
- package/types/generated/modal-focus.web.d.ts +3 -0
- package/types/generated/navigation-request.d.ts +10 -0
- package/types/generated/overlay-lifetime.mobile.d.ts +10 -0
- package/types/generated/props.d.ts +111 -3
- package/types/generated/route-table.d.ts +14 -3
- package/types/generated/svg.mobile.d.ts +2 -2
- package/types/generated/text-focus.d.ts +3 -0
- package/types/generated/text-write.d.ts +3 -1
- package/types/generated/theme/colorScheme.web.d.ts +5 -0
- package/types/generated/virtual-list-cell-pool.d.ts +18 -0
- package/types/index.macos.d.ts +15 -3
- /package/src/vendor/ui-svg/{index.android.ts → src/index.android.ts} +0 -0
- /package/src/vendor/ui-svg/{index.common.ts → src/index.common.ts} +0 -0
- /package/src/vendor/ui-svg/{index.ios.ts → src/index.ios.ts} +0 -0
- /package/src/vendor/ui-svg/{index.ts → src/index.ts} +0 -0
- /package/src/vendor/ui-svg/{typings → src/typings}/SVGKit.d.ts +0 -0
- /package/src/vendor/ui-svg/{typings → src/typings}/android.d.ts +0 -0
- /package/src/vendor/ui-svg/{typings → src/typings}/ios.d.ts +0 -0
- /package/types/generated/vendor/ui-svg/{index.common.d.ts → src/index.common.d.ts} +0 -0
- /package/types/generated/vendor/ui-svg/{index.d.ts → src/index.d.ts} +0 -0
- /package/types/generated/vendor/ui-svg/{index.ios.d.ts → src/index.ios.d.ts} +0 -0
|
@@ -1,40 +1,54 @@
|
|
|
1
1
|
import { applyEscapeProps } from "./escape-props.web.js";
|
|
2
2
|
import { layoutChildProps } from "./layout-child.web.js";
|
|
3
3
|
import { usePan } from "./pan.web.tsrx.js";
|
|
4
|
-
import { __s, bagOf, clone, hookSlots, snapshotSpread, template, useRef, withSlot } from "octane";
|
|
5
|
-
import { bindSignalChild, bindSignalHostPropSources, enableSignalBindings } from "octane/internal/client";
|
|
4
|
+
import { __s, bagOf, clone, hookSlots, snapshotSpread, template, useEffect, useRef, withSlot } from "octane";
|
|
5
|
+
import { bindSignalChild, bindSignalHostPropSources, compilerMemoRegion, enableSignalBindings, hookMemoCreate, hookMemoPublishInvariant } from "octane/internal/client";
|
|
6
6
|
//#region src/Pressable.web.tsrx
|
|
7
7
|
enableSignalBindings(1, true);
|
|
8
8
|
var _t$0 = /* @__PURE__ */ template("<div></div>");
|
|
9
|
-
var _hs$ = /* @__PURE__ */ hookSlots(
|
|
10
|
-
var _h$
|
|
9
|
+
var _hs$ = /* @__PURE__ */ hookSlots(8);
|
|
10
|
+
var _h$4 = /* @__PURE__ */ Symbol(_hs$ + 4);
|
|
11
11
|
var _rm$1 = [
|
|
12
12
|
"s",
|
|
13
|
-
"
|
|
14
|
-
"
|
|
13
|
+
"y",
|
|
14
|
+
"x"
|
|
15
15
|
];
|
|
16
16
|
var Pressable = /* @__PURE__ */ __s(function Pressable(props, __s, __extra) {
|
|
17
|
+
const __memoRegion = compilerMemoRegion(__s, _hs$ + 0);
|
|
18
|
+
let __hk = __memoRegion.hooks;
|
|
19
|
+
if (__hk === void 0) __memoRegion.hooks = __hk = hookMemoCreate(2);
|
|
17
20
|
const el = useRef(null, _hs$ + 0);
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
const spacePressed = useRef(false, _hs$ + 1);
|
|
22
|
+
const timer = useRef(null, _hs$ + 2);
|
|
23
|
+
const latest = useRef(props, _hs$ + 3);
|
|
24
|
+
latest.current = props;
|
|
25
|
+
withSlot(_h$4, usePan, el, props.disabled ? void 0 : props.onPan);
|
|
26
|
+
const cancel = __hk[0] ?? hookMemoPublishInvariant(__hk, 0, () => {
|
|
27
|
+
if (timer.current !== null) {
|
|
28
|
+
clearTimeout(timer.current);
|
|
29
|
+
timer.current = null;
|
|
24
30
|
}
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
if (props.disabled
|
|
31
|
+
});
|
|
32
|
+
useEffect(() => {
|
|
33
|
+
if (props.disabled) spacePressed.current = false;
|
|
34
|
+
}, [props.disabled], _hs$ + 5);
|
|
35
|
+
const enabled = !props.disabled && Boolean(props.onLongPress);
|
|
36
|
+
useEffect(() => {
|
|
37
|
+
if (!enabled) cancel();
|
|
38
|
+
}, [enabled], _hs$ + 6);
|
|
39
|
+
useEffect(() => () => cancel(), [], _hs$ + 7);
|
|
40
|
+
const down = __hk[1] ?? hookMemoPublishInvariant(__hk, 1, () => {
|
|
41
|
+
if (latest.current.disabled || !latest.current.onLongPress) return;
|
|
28
42
|
cancel();
|
|
29
|
-
timer = setTimeout(() => {
|
|
30
|
-
timer = null;
|
|
31
|
-
|
|
43
|
+
timer.current = setTimeout(() => {
|
|
44
|
+
timer.current = null;
|
|
45
|
+
if (!latest.current.disabled) latest.current.onLongPress?.();
|
|
32
46
|
}, 500);
|
|
33
|
-
};
|
|
47
|
+
});
|
|
34
48
|
if (__s.block.pending && !__s.block.crossRenderUpdate) return;
|
|
35
49
|
let _b = __s.slots[0];
|
|
36
50
|
if (_b === void 0) {
|
|
37
|
-
let _m0, _m1, _m2, _m3, _m4, _m5, _m6, _m7, _m8, _m9, _m10, _m11, _m12, _m13, _m14, _m15, _m16, _m17, _m18, _m19, _m20;
|
|
51
|
+
let _m0, _m1, _m2, _m3, _m4, _m5, _m6, _m7, _m8, _m9, _m10, _m11, _m12, _m13, _m14, _m15, _m16, _m17, _m18, _m19, _m20, _m21, _m22, _m23, _m24;
|
|
38
52
|
const _root = clone(_t$0);
|
|
39
53
|
_m0 = (e) => {
|
|
40
54
|
el.current = e;
|
|
@@ -56,33 +70,56 @@ var Pressable = /* @__PURE__ */ __s(function Pressable(props, __s, __extra) {
|
|
|
56
70
|
_m5 = props.accessibilityLabel;
|
|
57
71
|
_m6 = props.accessibilityHint;
|
|
58
72
|
_m7 = props.accessibilityValue;
|
|
59
|
-
_m8 = props.
|
|
73
|
+
_m8 = props.disabled || props.accessibilityState?.disabled || void 0;
|
|
60
74
|
_m9 = props.accessibilityState?.selected;
|
|
61
75
|
_m10 = props.accessibilityState?.checked;
|
|
62
76
|
_m11 = props.accessibilityLiveRegion === "none" ? "off" : props.accessibilityLiveRegion;
|
|
63
77
|
_m12 = props.accessible === false ? true : void 0;
|
|
64
|
-
_m13 = props.disabled ?
|
|
65
|
-
_m14 =
|
|
78
|
+
_m13 = props.onPress && !props.disabled && props.accessible !== false ? 0 : -1;
|
|
79
|
+
_m14 = (e) => {
|
|
80
|
+
if (e.target !== e.currentTarget || props.disabled || e.isComposing || !props.onPress) return;
|
|
81
|
+
if (e.key === "Enter") {
|
|
82
|
+
e.preventDefault();
|
|
83
|
+
if (!e.repeat) props.onPress();
|
|
84
|
+
} else if (e.key === " ") {
|
|
85
|
+
e.preventDefault();
|
|
86
|
+
spacePressed.current = true;
|
|
87
|
+
}
|
|
88
|
+
};
|
|
66
89
|
_m15 = (e) => {
|
|
90
|
+
if (e.target !== e.currentTarget || e.key !== " ") return;
|
|
91
|
+
const activate = spacePressed.current;
|
|
92
|
+
spacePressed.current = false;
|
|
93
|
+
if (activate && !props.disabled && props.onPress) {
|
|
94
|
+
e.preventDefault();
|
|
95
|
+
props.onPress();
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
_m16 = () => {
|
|
99
|
+
spacePressed.current = false;
|
|
100
|
+
};
|
|
101
|
+
_m17 = props.disabled ? void 0 : props.onPress;
|
|
102
|
+
_m18 = props.disabled ? void 0 : props.onDoublePress;
|
|
103
|
+
_m19 = (e) => {
|
|
67
104
|
if (!props.disabled) {
|
|
68
105
|
props.onPressIn?.();
|
|
69
106
|
down();
|
|
70
107
|
}
|
|
71
108
|
};
|
|
72
|
-
|
|
109
|
+
_m20 = () => {
|
|
73
110
|
if (!props.disabled) props.onPressOut?.();
|
|
74
111
|
cancel();
|
|
75
112
|
};
|
|
76
|
-
|
|
113
|
+
_m21 = () => {
|
|
77
114
|
if (!props.disabled) props.onPressOut?.();
|
|
78
115
|
cancel();
|
|
79
116
|
};
|
|
80
|
-
|
|
117
|
+
_m22 = () => {
|
|
81
118
|
if (!props.disabled) props.onPressOut?.();
|
|
82
119
|
cancel();
|
|
83
120
|
};
|
|
84
|
-
|
|
85
|
-
|
|
121
|
+
_m23 = _root;
|
|
122
|
+
_m24 = bindSignalHostPropSources(__s, void 0, _root, [
|
|
86
123
|
[
|
|
87
124
|
false,
|
|
88
125
|
"ref",
|
|
@@ -146,35 +183,55 @@ var Pressable = /* @__PURE__ */ __s(function Pressable(props, __s, __extra) {
|
|
|
146
183
|
],
|
|
147
184
|
[
|
|
148
185
|
false,
|
|
149
|
-
"
|
|
186
|
+
"tabIndex",
|
|
150
187
|
_m13
|
|
151
188
|
],
|
|
152
189
|
[
|
|
153
190
|
false,
|
|
154
|
-
"
|
|
191
|
+
"onKeyDown",
|
|
155
192
|
_m14
|
|
156
193
|
],
|
|
157
194
|
[
|
|
158
195
|
false,
|
|
159
|
-
"
|
|
196
|
+
"onKeyUp",
|
|
160
197
|
_m15
|
|
161
198
|
],
|
|
162
199
|
[
|
|
163
200
|
false,
|
|
164
|
-
"
|
|
201
|
+
"onBlur",
|
|
165
202
|
_m16
|
|
166
203
|
],
|
|
167
204
|
[
|
|
168
205
|
false,
|
|
169
|
-
"
|
|
206
|
+
"onClick",
|
|
170
207
|
_m17
|
|
171
208
|
],
|
|
172
209
|
[
|
|
173
210
|
false,
|
|
174
|
-
"
|
|
211
|
+
"onDoubleClick",
|
|
175
212
|
_m18
|
|
213
|
+
],
|
|
214
|
+
[
|
|
215
|
+
false,
|
|
216
|
+
"onPointerDown",
|
|
217
|
+
_m19
|
|
218
|
+
],
|
|
219
|
+
[
|
|
220
|
+
false,
|
|
221
|
+
"onPointerUp",
|
|
222
|
+
_m20
|
|
223
|
+
],
|
|
224
|
+
[
|
|
225
|
+
false,
|
|
226
|
+
"onPointerLeave",
|
|
227
|
+
_m21
|
|
228
|
+
],
|
|
229
|
+
[
|
|
230
|
+
false,
|
|
231
|
+
"onPointerCancel",
|
|
232
|
+
_m22
|
|
176
233
|
]
|
|
177
|
-
], "b:
|
|
234
|
+
], "b:7e0eb713", true);
|
|
178
235
|
_b = bagOf(__s, _root, {
|
|
179
236
|
a: _m0,
|
|
180
237
|
b: _m1,
|
|
@@ -197,8 +254,12 @@ var Pressable = /* @__PURE__ */ __s(function Pressable(props, __s, __extra) {
|
|
|
197
254
|
s: _m18,
|
|
198
255
|
t: _m19,
|
|
199
256
|
u: _m20,
|
|
200
|
-
v:
|
|
201
|
-
w:
|
|
257
|
+
v: _m21,
|
|
258
|
+
w: _m22,
|
|
259
|
+
x: _m23,
|
|
260
|
+
y: _m24,
|
|
261
|
+
z: null,
|
|
262
|
+
A: void 0
|
|
202
263
|
});
|
|
203
264
|
__s.refFields = _rm$1;
|
|
204
265
|
} else {
|
|
@@ -244,7 +305,7 @@ var Pressable = /* @__PURE__ */ __s(function Pressable(props, __s, __extra) {
|
|
|
244
305
|
if (_b.h !== _v) _b.h = _v;
|
|
245
306
|
}
|
|
246
307
|
{
|
|
247
|
-
const _v = props.
|
|
308
|
+
const _v = props.disabled || props.accessibilityState?.disabled || void 0;
|
|
248
309
|
if (_b.i !== _v) _b.i = _v;
|
|
249
310
|
}
|
|
250
311
|
{
|
|
@@ -264,13 +325,48 @@ var Pressable = /* @__PURE__ */ __s(function Pressable(props, __s, __extra) {
|
|
|
264
325
|
if (_b.m !== _v) _b.m = _v;
|
|
265
326
|
}
|
|
266
327
|
{
|
|
267
|
-
const _v = props.disabled ?
|
|
328
|
+
const _v = props.onPress && !props.disabled && props.accessible !== false ? 0 : -1;
|
|
268
329
|
if (_b.n !== _v) _b.n = _v;
|
|
269
330
|
}
|
|
270
331
|
{
|
|
271
|
-
const _v =
|
|
332
|
+
const _v = (e) => {
|
|
333
|
+
if (e.target !== e.currentTarget || props.disabled || e.isComposing || !props.onPress) return;
|
|
334
|
+
if (e.key === "Enter") {
|
|
335
|
+
e.preventDefault();
|
|
336
|
+
if (!e.repeat) props.onPress();
|
|
337
|
+
} else if (e.key === " ") {
|
|
338
|
+
e.preventDefault();
|
|
339
|
+
spacePressed.current = true;
|
|
340
|
+
}
|
|
341
|
+
};
|
|
272
342
|
if (_b.o !== _v) _b.o = _v;
|
|
273
343
|
}
|
|
344
|
+
{
|
|
345
|
+
const _v = (e) => {
|
|
346
|
+
if (e.target !== e.currentTarget || e.key !== " ") return;
|
|
347
|
+
const activate = spacePressed.current;
|
|
348
|
+
spacePressed.current = false;
|
|
349
|
+
if (activate && !props.disabled && props.onPress) {
|
|
350
|
+
e.preventDefault();
|
|
351
|
+
props.onPress();
|
|
352
|
+
}
|
|
353
|
+
};
|
|
354
|
+
if (_b.p !== _v) _b.p = _v;
|
|
355
|
+
}
|
|
356
|
+
{
|
|
357
|
+
const _v = () => {
|
|
358
|
+
spacePressed.current = false;
|
|
359
|
+
};
|
|
360
|
+
if (_b.q !== _v) _b.q = _v;
|
|
361
|
+
}
|
|
362
|
+
{
|
|
363
|
+
const _v = props.disabled ? void 0 : props.onPress;
|
|
364
|
+
if (_b.r !== _v) _b.r = _v;
|
|
365
|
+
}
|
|
366
|
+
{
|
|
367
|
+
const _v = props.disabled ? void 0 : props.onDoublePress;
|
|
368
|
+
if (_b.s !== _v) _b.s = _v;
|
|
369
|
+
}
|
|
274
370
|
{
|
|
275
371
|
const _v = (e) => {
|
|
276
372
|
if (!props.disabled) {
|
|
@@ -278,30 +374,30 @@ var Pressable = /* @__PURE__ */ __s(function Pressable(props, __s, __extra) {
|
|
|
278
374
|
down();
|
|
279
375
|
}
|
|
280
376
|
};
|
|
281
|
-
if (_b.
|
|
377
|
+
if (_b.t !== _v) _b.t = _v;
|
|
282
378
|
}
|
|
283
379
|
{
|
|
284
380
|
const _v = () => {
|
|
285
381
|
if (!props.disabled) props.onPressOut?.();
|
|
286
382
|
cancel();
|
|
287
383
|
};
|
|
288
|
-
if (_b.
|
|
384
|
+
if (_b.u !== _v) _b.u = _v;
|
|
289
385
|
}
|
|
290
386
|
{
|
|
291
387
|
const _v = () => {
|
|
292
388
|
if (!props.disabled) props.onPressOut?.();
|
|
293
389
|
cancel();
|
|
294
390
|
};
|
|
295
|
-
if (_b.
|
|
391
|
+
if (_b.v !== _v) _b.v = _v;
|
|
296
392
|
}
|
|
297
393
|
{
|
|
298
394
|
const _v = () => {
|
|
299
395
|
if (!props.disabled) props.onPressOut?.();
|
|
300
396
|
cancel();
|
|
301
397
|
};
|
|
302
|
-
if (_b.
|
|
398
|
+
if (_b.w !== _v) _b.w = _v;
|
|
303
399
|
}
|
|
304
|
-
_b.
|
|
400
|
+
_b.y = bindSignalHostPropSources(__s, _b.y, _b.x, [
|
|
305
401
|
[
|
|
306
402
|
false,
|
|
307
403
|
"ref",
|
|
@@ -365,37 +461,57 @@ var Pressable = /* @__PURE__ */ __s(function Pressable(props, __s, __extra) {
|
|
|
365
461
|
],
|
|
366
462
|
[
|
|
367
463
|
false,
|
|
368
|
-
"
|
|
464
|
+
"tabIndex",
|
|
369
465
|
_b.n
|
|
370
466
|
],
|
|
371
467
|
[
|
|
372
468
|
false,
|
|
373
|
-
"
|
|
469
|
+
"onKeyDown",
|
|
374
470
|
_b.o
|
|
375
471
|
],
|
|
376
472
|
[
|
|
377
473
|
false,
|
|
378
|
-
"
|
|
474
|
+
"onKeyUp",
|
|
379
475
|
_b.p
|
|
380
476
|
],
|
|
381
477
|
[
|
|
382
478
|
false,
|
|
383
|
-
"
|
|
479
|
+
"onBlur",
|
|
384
480
|
_b.q
|
|
385
481
|
],
|
|
386
482
|
[
|
|
387
483
|
false,
|
|
388
|
-
"
|
|
484
|
+
"onClick",
|
|
389
485
|
_b.r
|
|
390
486
|
],
|
|
391
487
|
[
|
|
392
488
|
false,
|
|
393
|
-
"
|
|
489
|
+
"onDoubleClick",
|
|
394
490
|
_b.s
|
|
491
|
+
],
|
|
492
|
+
[
|
|
493
|
+
false,
|
|
494
|
+
"onPointerDown",
|
|
495
|
+
_b.t
|
|
496
|
+
],
|
|
497
|
+
[
|
|
498
|
+
false,
|
|
499
|
+
"onPointerUp",
|
|
500
|
+
_b.u
|
|
501
|
+
],
|
|
502
|
+
[
|
|
503
|
+
false,
|
|
504
|
+
"onPointerLeave",
|
|
505
|
+
_b.v
|
|
506
|
+
],
|
|
507
|
+
[
|
|
508
|
+
false,
|
|
509
|
+
"onPointerCancel",
|
|
510
|
+
_b.w
|
|
395
511
|
]
|
|
396
|
-
], "b:
|
|
512
|
+
], "b:7e0eb713", true);
|
|
397
513
|
}
|
|
398
|
-
_b.
|
|
514
|
+
_b.B = bindSignalChild(__s, _b.B, 1, _b.x, props.children, "b:ecf772c3", null, void 0, void 0, void 0, true);
|
|
399
515
|
});
|
|
400
516
|
//#endregion
|
|
401
517
|
export { Pressable };
|
|
@@ -77,7 +77,7 @@ var SearchInput = /* @__PURE__ */ __s(function SearchInput(props, __s, __extra)
|
|
|
77
77
|
_m7 = bindSignalValue(__s, void 0, _el0, value, "i:ae1a301c");
|
|
78
78
|
setEventHandler(_el0, "$$input", (e) => setValue(e.target.value));
|
|
79
79
|
setEventHandler(_el0, "$$keydown", (e) => {
|
|
80
|
-
if (e.key === "Enter" && !e.shiftKey) props.onSubmit?.();
|
|
80
|
+
if (e.key === "Enter" && !e.shiftKey && !e.isComposing && e.keyCode !== 229) props.onSubmit?.();
|
|
81
81
|
});
|
|
82
82
|
setEventHandler(_el0, "$$focusin", props.onFocus);
|
|
83
83
|
setEventHandler(_el0, "$$focusout", props.onBlur);
|
|
@@ -103,7 +103,7 @@ var SearchInput = /* @__PURE__ */ __s(function SearchInput(props, __s, __extra)
|
|
|
103
103
|
_b.h = bindSignalValue(__s, _b.h, _b.f, value, "i:ae1a301c");
|
|
104
104
|
setEventHandler(_b.f, "$$input", (e) => setValue(e.target.value));
|
|
105
105
|
setEventHandler(_b.f, "$$keydown", (e) => {
|
|
106
|
-
if (e.key === "Enter" && !e.shiftKey) props.onSubmit?.();
|
|
106
|
+
if (e.key === "Enter" && !e.shiftKey && !e.isComposing && e.keyCode !== 229) props.onSubmit?.();
|
|
107
107
|
});
|
|
108
108
|
setEventHandler(_b.f, "$$focusin", props.onFocus);
|
|
109
109
|
setEventHandler(_b.f, "$$focusout", props.onBlur);
|
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
import { cx } from "./cx.js";
|
|
2
2
|
import { useThemeScheme } from "./theme/theme-scheme.js";
|
|
3
|
+
import { isolateModalFocus } from "./modal-focus.web.js";
|
|
3
4
|
import { normalizeDetents } from "./sheet-snap.js";
|
|
4
5
|
import { attachSheetDetents } from "./sheet-detents.web.js";
|
|
5
6
|
import { bag4, child, clone, createElement, createPortal, createScopedElement, createScopedValue, drainFrag, hookSlots, ifBlock, positionalChildren, template, useEffect, useRef, withSlot } from "octane";
|
|
6
7
|
import { compilerMemoRegion, hookMemoCreate, hookMemoEqual, hookMemoPublish1, textHoleUpdate } from "octane/internal/client";
|
|
7
8
|
//#region src/Sheet.web.tsrx
|
|
8
9
|
var _t$0 = /* @__PURE__ */ template("<!>", 0, 1);
|
|
9
|
-
var _hs$ = /* @__PURE__ */ hookSlots(
|
|
10
|
+
var _hs$ = /* @__PURE__ */ hookSlots(6);
|
|
10
11
|
var _h$0 = /* @__PURE__ */ Symbol(_hs$);
|
|
11
12
|
function __then$0(__props, __s, __extra) {
|
|
12
13
|
const __block = __s.block;
|
|
13
14
|
const dark = __extra[0];
|
|
14
15
|
const detents = __extra[1];
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
const
|
|
16
|
+
const layer = __extra[2];
|
|
17
|
+
const maxDetent = __extra[3];
|
|
18
|
+
const panel = __extra[4];
|
|
19
|
+
const props = __extra[5];
|
|
18
20
|
let _b = __s.slots[0];
|
|
19
21
|
if (_b === void 0) {
|
|
20
22
|
let _m0, _m1;
|
|
@@ -25,7 +27,10 @@ function __then$0(__props, __s, __extra) {
|
|
|
25
27
|
_b = bag4(__s, null, _m0, _m1, null, void 0);
|
|
26
28
|
}
|
|
27
29
|
{
|
|
28
|
-
const _v = /* @__PURE__ */ createPortal(createScopedValue(() => createScopedElement("div", {
|
|
30
|
+
const _v = /* @__PURE__ */ createPortal(createScopedValue(() => createScopedElement("div", {
|
|
31
|
+
ref: layer,
|
|
32
|
+
className: cx("vx-sheet-layer", dark && "dark")
|
|
33
|
+
}, () => positionalChildren([(props.shadeCover ?? true) && createScopedValue(() => createElement("div", {
|
|
29
34
|
className: "vx-sheet-backdrop",
|
|
30
35
|
onClick: props.onDismiss
|
|
31
36
|
})), createScopedValue(() => createScopedElement("div", {
|
|
@@ -33,6 +38,8 @@ function __then$0(__props, __s, __extra) {
|
|
|
33
38
|
panel.current = el;
|
|
34
39
|
},
|
|
35
40
|
className: cx("vx-sheet", detents.length && "vx-sheet-detents", props.className),
|
|
41
|
+
role: props.shadeCover === false ? void 0 : "dialog",
|
|
42
|
+
"aria-modal": props.shadeCover === false ? void 0 : true,
|
|
36
43
|
style: {
|
|
37
44
|
...props.style,
|
|
38
45
|
...detents.length ? {
|
|
@@ -54,8 +61,13 @@ var Sheet = function Sheet(props, __s, __extra) {
|
|
|
54
61
|
let __hkd0;
|
|
55
62
|
const dark = withSlot(_h$0, useThemeScheme) === "dark";
|
|
56
63
|
const panel = useRef(null, _hs$ + 1);
|
|
57
|
-
const
|
|
64
|
+
const layer = useRef(null, _hs$ + 2);
|
|
65
|
+
const dismiss = useRef(props.onDismiss, _hs$ + 3);
|
|
58
66
|
dismiss.current = props.onDismiss;
|
|
67
|
+
useEffect(() => {
|
|
68
|
+
if (!props.open || props.shadeCover === false || !layer.current || !panel.current) return;
|
|
69
|
+
return isolateModalFocus(layer.current, panel.current, () => dismiss.current?.());
|
|
70
|
+
}, [props.open, props.shadeCover], _hs$ + 4);
|
|
59
71
|
const detents = (__hkd0 = props, __hk[0] !== true || !hookMemoEqual(__hk[1], __hkd0) ? hookMemoPublish1(__hk, 0, normalizeDetents(props.detents), __hkd0) : __hk[2]);
|
|
60
72
|
const maxDetent = detents.length ? detents[detents.length - 1] : 0;
|
|
61
73
|
const detentsKey = detents.join(",");
|
|
@@ -64,13 +76,14 @@ var Sheet = function Sheet(props, __s, __extra) {
|
|
|
64
76
|
if (!props.open || !el || !detents.length) return;
|
|
65
77
|
const ctl = attachSheetDetents(el, detents, () => dismiss.current?.());
|
|
66
78
|
return () => ctl.detach();
|
|
67
|
-
}, [props.open, detentsKey], _hs$ +
|
|
79
|
+
}, [props.open, detentsKey], _hs$ + 5);
|
|
68
80
|
if (__s.block.pending && !__s.block.crossRenderUpdate) return;
|
|
69
81
|
{
|
|
70
82
|
const __ifCondition = props.open;
|
|
71
83
|
ifBlock(__s, 0, __block.parentNode, __ifCondition, __then$0, null, __block.endMarker, __ifCondition ? [
|
|
72
84
|
dark,
|
|
73
85
|
detents,
|
|
86
|
+
layer,
|
|
74
87
|
maxDetent,
|
|
75
88
|
panel,
|
|
76
89
|
props
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { applyEscapeProps } from "./escape-props.web.js";
|
|
2
2
|
import { normStyle } from "./layout-child.web.js";
|
|
3
|
-
import { __s,
|
|
3
|
+
import { __s, bag12, clone, delegateEvents, evt2e, evt2u, hookSlots, queueRefAttach, queueRefDetach, setAttribute, setEventHandler, setStyle, template, useLayoutEffect, useRef } from "octane";
|
|
4
4
|
import { bindSignalAttribute, bindSignalValue, enableSignalBindings, replaceRef, setBooleanAttributeIfChanged, setPlainAttribute, updateFreshClassName } from "octane/internal/client";
|
|
5
5
|
//#region src/TextArea.web.tsrx
|
|
6
6
|
enableSignalBindings(1, true);
|
|
@@ -10,8 +10,12 @@ delegateEvents([
|
|
|
10
10
|
"input",
|
|
11
11
|
"keydown"
|
|
12
12
|
]);
|
|
13
|
-
var _t$0 = /* @__PURE__ */ template("<textarea data-octane-input=\"i:
|
|
13
|
+
var _t$0 = /* @__PURE__ */ template("<textarea data-octane-input=\"i:d137a29c\"></textarea>");
|
|
14
14
|
var _hs$ = /* @__PURE__ */ hookSlots(2);
|
|
15
|
+
var __event = (e, fit, props) => {
|
|
16
|
+
fit();
|
|
17
|
+
props.onChange?.(e.target.value);
|
|
18
|
+
};
|
|
15
19
|
var _rm$0 = [
|
|
16
20
|
"r",
|
|
17
21
|
"b",
|
|
@@ -19,7 +23,7 @@ var _rm$0 = [
|
|
|
19
23
|
];
|
|
20
24
|
var TextArea = /* @__PURE__ */ __s(function TextArea(props, __s, __extra) {
|
|
21
25
|
const el = useRef(null, _hs$ + 0);
|
|
22
|
-
|
|
26
|
+
const fit = () => {
|
|
23
27
|
const t = el.current;
|
|
24
28
|
if (!t) return;
|
|
25
29
|
const cs = getComputedStyle(t);
|
|
@@ -35,7 +39,8 @@ var TextArea = /* @__PURE__ */ __s(function TextArea(props, __s, __extra) {
|
|
|
35
39
|
t.style.height = Math.min(need, cap) + "px";
|
|
36
40
|
t.style.overflowY = need > cap ? "auto" : "hidden";
|
|
37
41
|
}
|
|
38
|
-
}
|
|
42
|
+
};
|
|
43
|
+
useLayoutEffect(fit, [
|
|
39
44
|
props.value,
|
|
40
45
|
props.rows,
|
|
41
46
|
props.autoGrow,
|
|
@@ -45,7 +50,7 @@ var TextArea = /* @__PURE__ */ __s(function TextArea(props, __s, __extra) {
|
|
|
45
50
|
], _hs$ + 1);
|
|
46
51
|
let _b = __s.slots[0];
|
|
47
52
|
if (_b === void 0) {
|
|
48
|
-
let _m0, _m1, _m5;
|
|
53
|
+
let _m0, _m1, _m5, _m11;
|
|
49
54
|
const _root = clone(_t$0);
|
|
50
55
|
queueRefAttach(__s, _m1 = (node) => {
|
|
51
56
|
el.current = node;
|
|
@@ -58,14 +63,14 @@ var TextArea = /* @__PURE__ */ __s(function TextArea(props, __s, __extra) {
|
|
|
58
63
|
});
|
|
59
64
|
}, _m0 = _root);
|
|
60
65
|
(__s.cleanups ??= []).push(() => _b && queueRefDetach(_b.b, _b.a));
|
|
61
|
-
_m5 = bindSignalValue(__s, void 0, _root, props.value, "i:
|
|
62
|
-
|
|
66
|
+
_m5 = bindSignalValue(__s, void 0, _root, props.value, "i:d137a29c");
|
|
67
|
+
_m11 = evt2e(_root, "$$input", __event, fit, props);
|
|
63
68
|
setEventHandler(_root, "$$keydown", (e) => {
|
|
64
|
-
if (e.key === "Enter" && (e.ctrlKey || e.metaKey)) props.onSubmit?.();
|
|
69
|
+
if (e.key === "Enter" && (e.ctrlKey || e.metaKey) && !e.isComposing && e.keyCode !== 229) props.onSubmit?.();
|
|
65
70
|
});
|
|
66
71
|
setEventHandler(_root, "$$focusin", props.onFocus);
|
|
67
72
|
setEventHandler(_root, "$$focusout", props.onBlur);
|
|
68
|
-
_b =
|
|
73
|
+
_b = bag12(__s, _root, _m0, _m1, void 0, void 0, void 0, _m5, void 0, void 0, void 0, void 0, void 0, _m11);
|
|
69
74
|
__s.refFields = _rm$0;
|
|
70
75
|
} else {
|
|
71
76
|
{
|
|
@@ -81,15 +86,15 @@ var TextArea = /* @__PURE__ */ __s(function TextArea(props, __s, __extra) {
|
|
|
81
86
|
};
|
|
82
87
|
if (_r !== _b.b) _b.b = replaceRef(__s, _b.b, _r, _b.a);
|
|
83
88
|
}
|
|
84
|
-
_b.f = bindSignalValue(__s, _b.f, _b.a, props.value, "i:
|
|
85
|
-
|
|
89
|
+
_b.f = bindSignalValue(__s, _b.f, _b.a, props.value, "i:d137a29c");
|
|
90
|
+
evt2u(_b.l, __event, fit, props);
|
|
86
91
|
setEventHandler(_b.a, "$$keydown", (e) => {
|
|
87
|
-
if (e.key === "Enter" && (e.ctrlKey || e.metaKey)) props.onSubmit?.();
|
|
92
|
+
if (e.key === "Enter" && (e.ctrlKey || e.metaKey) && !e.isComposing && e.keyCode !== 229) props.onSubmit?.();
|
|
88
93
|
});
|
|
89
94
|
setEventHandler(_b.a, "$$focusin", props.onFocus);
|
|
90
95
|
setEventHandler(_b.a, "$$focusout", props.onBlur);
|
|
91
96
|
}
|
|
92
|
-
_b.c = bindSignalAttribute(__s, _b.c, _b.a, "id", props.id, "b:
|
|
97
|
+
_b.c = bindSignalAttribute(__s, _b.c, _b.a, "id", props.id, "b:3b357831", setPlainAttribute);
|
|
93
98
|
_b.d = updateFreshClassName(["vx-textarea", props.className], _b.d, _b.a);
|
|
94
99
|
{
|
|
95
100
|
const _v = {
|
|
@@ -101,11 +106,11 @@ var TextArea = /* @__PURE__ */ __s(function TextArea(props, __s, __extra) {
|
|
|
101
106
|
_b.e = _v;
|
|
102
107
|
}
|
|
103
108
|
}
|
|
104
|
-
_b.g = bindSignalAttribute(__s, _b.g, _b.a, "inputMode", props.keyboardType === "number" ? "numeric" : props.keyboardType === "phone" ? "tel" : props.keyboardType === "default" ? "text" : props.keyboardType, "b:
|
|
105
|
-
_b.h = bindSignalAttribute(__s, _b.h, _b.a, "enterKeyHint", props.returnKeyType, "b:
|
|
109
|
+
_b.g = bindSignalAttribute(__s, _b.g, _b.a, "inputMode", props.keyboardType === "number" ? "numeric" : props.keyboardType === "phone" ? "tel" : props.keyboardType === "default" ? "text" : props.keyboardType, "b:d8754b83", setPlainAttribute);
|
|
110
|
+
_b.h = bindSignalAttribute(__s, _b.h, _b.a, "enterKeyHint", props.returnKeyType, "b:dd45ab85", setPlainAttribute);
|
|
106
111
|
_b.i = setBooleanAttributeIfChanged(props.editable === false, _b.i, _b.a, "readonly");
|
|
107
|
-
_b.j = bindSignalAttribute(__s, _b.j, _b.a, "placeholder", props.placeholder, "b:
|
|
108
|
-
_b.k = bindSignalAttribute(__s, _b.k, _b.a, "rows", props.rows ?? (props.autoGrow ? 1 : 3), "b:
|
|
112
|
+
_b.j = bindSignalAttribute(__s, _b.j, _b.a, "placeholder", props.placeholder, "b:b273298e", setPlainAttribute);
|
|
113
|
+
_b.k = bindSignalAttribute(__s, _b.k, _b.a, "rows", props.rows ?? (props.autoGrow ? 1 : 3), "b:f589cea6", setAttribute);
|
|
109
114
|
});
|
|
110
115
|
//#endregion
|
|
111
116
|
export { TextArea };
|
|
@@ -36,7 +36,7 @@ var TextInput = /* @__PURE__ */ __s(function TextInput(props, __s, __extra) {
|
|
|
36
36
|
_m5 = bindSignalValue(__s, void 0, _root, props.value, "i:cd4865f9");
|
|
37
37
|
setEventHandler(_root, "$$input", (e) => props.onChange?.(e.target.value));
|
|
38
38
|
setEventHandler(_root, "$$keydown", (e) => {
|
|
39
|
-
if (e.key === "Enter" && !e.shiftKey) props.onSubmit?.();
|
|
39
|
+
if (e.key === "Enter" && !e.shiftKey && !e.isComposing && e.keyCode !== 229) props.onSubmit?.();
|
|
40
40
|
});
|
|
41
41
|
setEventHandler(_root, "$$focusin", props.onFocus);
|
|
42
42
|
setEventHandler(_root, "$$focusout", props.onBlur);
|
|
@@ -58,7 +58,7 @@ var TextInput = /* @__PURE__ */ __s(function TextInput(props, __s, __extra) {
|
|
|
58
58
|
_b.f = bindSignalValue(__s, _b.f, _b.a, props.value, "i:cd4865f9");
|
|
59
59
|
setEventHandler(_b.a, "$$input", (e) => props.onChange?.(e.target.value));
|
|
60
60
|
setEventHandler(_b.a, "$$keydown", (e) => {
|
|
61
|
-
if (e.key === "Enter" && !e.shiftKey) props.onSubmit?.();
|
|
61
|
+
if (e.key === "Enter" && !e.shiftKey && !e.isComposing && e.keyCode !== 229) props.onSubmit?.();
|
|
62
62
|
});
|
|
63
63
|
setEventHandler(_b.a, "$$focusin", props.onFocus);
|
|
64
64
|
setEventHandler(_b.a, "$$focusout", props.onBlur);
|