@octane-xplat/ui 0.7.2 → 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.
Files changed (219) hide show
  1. package/README.md +4 -3
  2. package/dist/native/Button.tsrx.js +1 -1
  3. package/dist/native/CommandPalette.tsrx.js +7 -1
  4. package/dist/native/Grid.tsrx.js +31 -2
  5. package/dist/native/KeyboardAvoiding.mobile.tsrx.js +2 -2
  6. package/dist/native/Markdown.tsrx.js +233 -0
  7. package/dist/native/Overlay.tsrx.js +15 -26
  8. package/dist/native/Pagination.tsrx.js +15 -12
  9. package/dist/native/PinInput.tsrx.js +25 -7
  10. package/dist/native/Popover.tsrx.js +33 -23
  11. package/dist/native/Pressable.tsrx.js +4 -1
  12. package/dist/native/Screen.tsrx.js +1 -1
  13. package/dist/native/SearchInput.tsrx.js +6 -3
  14. package/dist/native/Sheet.tsrx.js +23 -38
  15. package/dist/native/Slider.tsrx.js +23 -14
  16. package/dist/native/Text.tsrx.js +16 -0
  17. package/dist/native/TextArea.tsrx.js +6 -3
  18. package/dist/native/TextInput.tsrx.js +6 -3
  19. package/dist/native/VirtualList.tsrx.js +305 -121
  20. package/dist/native/WebView.tsrx.js +17 -2
  21. package/dist/native/_virtual/_@oxc-project_runtime@0.150.0/helpers/esm/decorate.js +9 -0
  22. package/dist/native/escape-props.js +2 -0
  23. package/dist/native/grid-auto-placement.js +83 -0
  24. package/dist/native/grid-placement.js +20 -0
  25. package/dist/native/index.shared.js +7 -5
  26. package/dist/native/keyboard-inset.mobile.js +5 -5
  27. package/dist/native/navigation-request.js +26 -0
  28. package/dist/native/octane-client-build.json +1 -1
  29. package/dist/native/overlay-lifetime.mobile.js +65 -0
  30. package/dist/native/pan.tsrx.js +16 -2
  31. package/dist/native/route-table.js +90 -10
  32. package/dist/native/route.js +26 -16
  33. package/dist/native/shared.js +7 -5
  34. package/dist/native/sheet-service.js +2 -2
  35. package/dist/native/svg.mobile.js +1 -1
  36. package/dist/native/{tap-to-blur.mobile.js → tap-to-blur.ios.js} +20 -32
  37. package/dist/native/text-focus.js +10 -0
  38. package/dist/native/text-write.js +18 -11
  39. package/dist/native/toast-anchor.tsrx.js +1 -1
  40. package/dist/native/ui.js +7 -6
  41. package/dist/native/useMeasure.tsrx.js +17 -18
  42. package/dist/native/vendor/ui-svg/index.android.js +2 -2
  43. package/dist/native/vendor/ui-svg/index.ios.js +2 -2
  44. package/dist/native/vendor/ui-svg/{index.common.js → src/index.common.js} +1 -1
  45. package/dist/native/virtual-list-cell-pool.js +63 -0
  46. package/dist/web/Button.web.tsrx.js +1 -1
  47. package/dist/web/KeyboardAvoiding.web.tsrx.js +78 -0
  48. package/dist/web/Markdown.tsrx.js +98 -0
  49. package/dist/web/Overlay.web.tsrx.js +81 -32
  50. package/dist/web/PinInput.web.tsrx.js +24 -10
  51. package/dist/web/Pressable.web.tsrx.js +169 -53
  52. package/dist/web/SearchInput.web.tsrx.js +2 -2
  53. package/dist/web/Sheet.web.tsrx.js +20 -7
  54. package/dist/web/TextArea.web.tsrx.js +22 -17
  55. package/dist/web/TextInput.web.tsrx.js +2 -2
  56. package/dist/web/VirtualList.web.tsrx.js +220 -109
  57. package/dist/web/WebView.web.tsrx.js +3 -3
  58. package/dist/web/{index.shared.js → index.shared.web.js} +7 -5
  59. package/dist/web/modal-focus.web.js +95 -0
  60. package/dist/web/navigation-request.js +26 -0
  61. package/dist/web/octane-client-build.json +1 -1
  62. package/dist/web/pan.web.tsrx.js +27 -10
  63. package/dist/web/route-table.js +90 -10
  64. package/dist/web/route.web.js +88 -22
  65. package/dist/web/sheet-service.web.js +8 -0
  66. package/dist/web/theme/colorScheme.web.js +31 -4
  67. package/dist/web/ui.js +8 -6
  68. package/dist/web/virtual-list-cell-pool.js +63 -0
  69. package/package.json +21 -19
  70. package/platforms/android/native-api-usage.json +7 -7
  71. package/src/CommandPalette.tsrx +8 -1
  72. package/src/Grid.tsrx +32 -1
  73. package/src/Icon.macos.tsrx +1 -0
  74. package/src/KeyboardAvoiding.macos.tsrx +7 -1
  75. package/src/KeyboardAvoiding.mobile.tsrx +2 -2
  76. package/src/KeyboardAvoiding.tsrx +15 -0
  77. package/src/KeyboardAvoiding.web.tsrx +15 -0
  78. package/src/Markdown.tsrx +121 -0
  79. package/src/Meter.tsrx +1 -0
  80. package/src/Overlay.tsrx +15 -30
  81. package/src/Overlay.web.tsrx +12 -3
  82. package/src/Pagination.tsrx +6 -4
  83. package/src/PinInput.macos.tsrx +20 -6
  84. package/src/PinInput.mobile.test.ts +107 -0
  85. package/src/PinInput.tsrx +20 -6
  86. package/src/PinInput.web.test.tsrx +42 -0
  87. package/src/PinInput.web.tsrx +20 -6
  88. package/src/Popover.tsrx +36 -22
  89. package/src/Pressable.tsrx +1 -1
  90. package/src/Pressable.web.test.tsrx +36 -0
  91. package/src/Pressable.web.tsrx +37 -6
  92. package/src/RouteHost.macos.tsrx +1 -0
  93. package/src/Screen.tsrx +1 -1
  94. package/src/SearchInput.tsrx +4 -3
  95. package/src/SearchInput.web.tsrx +1 -1
  96. package/src/Sheet.tsrx +21 -42
  97. package/src/Sheet.web.tsrx +9 -1
  98. package/src/Slider.tsrx +13 -11
  99. package/src/Text.tsrx +36 -0
  100. package/src/TextArea.tsrx +6 -5
  101. package/src/TextArea.web.test.tsrx +39 -0
  102. package/src/TextArea.web.tsrx +7 -5
  103. package/src/TextInput.tsrx +6 -6
  104. package/src/TextInput.web.tsrx +1 -1
  105. package/src/VirtualList.macos.tsrx +93 -6
  106. package/src/VirtualList.mobile.test.tsrx +232 -0
  107. package/src/VirtualList.tsrx +285 -81
  108. package/src/VirtualList.web.tsrx +131 -25
  109. package/src/WebView.tsrx +20 -10
  110. package/src/WebView.web.tsrx +3 -0
  111. package/src/android/BottomNavigationView.android.tsrx +1 -0
  112. package/src/android/MaterialDialog.android.tsrx +1 -0
  113. package/src/anim.macos.tsrx +1 -0
  114. package/src/apply-native-modifiers.native.ts +4 -1
  115. package/src/child-array.ts +12 -7
  116. package/src/colorScheme.macos.ts +1 -0
  117. package/src/controls.macos.tsrx +4 -1
  118. package/src/data-driver.mobile.test.ts +120 -0
  119. package/src/data-lifecycle.mobile.test.ts +251 -0
  120. package/src/escape-props.ts +13 -1
  121. package/src/grid-auto-placement.ts +163 -0
  122. package/src/grid-placement.ts +29 -0
  123. package/src/hosted-unsupported.macos.tsrx +1 -0
  124. package/src/index.macos.ts +23 -3
  125. package/src/index.mobile.ts +0 -1
  126. package/src/index.shared.ts +22 -1
  127. package/src/index.shared.web.ts +291 -0
  128. package/src/index.web.ts +1 -1
  129. package/src/input-readiness.web.test.tsrx +82 -0
  130. package/src/ios/UITabBar.ios.tsrx +1 -0
  131. package/src/keyboard-inset.mobile.test.ts +62 -0
  132. package/src/keyboard-inset.mobile.ts +63 -43
  133. package/src/layout-shells.macos.tsrx +1 -5
  134. package/src/macos-extras.macos.tsrx +2 -0
  135. package/src/modal-focus.web.test.tsrx +63 -0
  136. package/src/modal-focus.web.ts +162 -0
  137. package/src/navigation-request.ts +37 -0
  138. package/src/overlay-lifecycle.mobile.test.ts +316 -0
  139. package/src/overlay-lifetime.mobile.ts +107 -0
  140. package/src/pan.mobile.test.tsrx +116 -0
  141. package/src/pan.tsrx +20 -2
  142. package/src/pan.web.tsrx +35 -7
  143. package/src/platformProps.ts +1 -0
  144. package/src/popover.mobile.test.ts +9 -1
  145. package/src/pressable-accessibility.mobile.test.ts +30 -0
  146. package/src/props.ts +163 -3
  147. package/src/refresh.ts +6 -1
  148. package/src/refresh.web.test.ts +77 -77
  149. package/src/route-android.test.ts +162 -0
  150. package/src/route-history.web.test.ts +80 -0
  151. package/src/route-navigation.web.test.ts +173 -0
  152. package/src/route-table.test.ts +188 -9
  153. package/src/route-table.ts +138 -10
  154. package/src/route.macos.ts +56 -13
  155. package/src/route.ts +54 -24
  156. package/src/route.web.ts +141 -24
  157. package/src/sheet-detents.ts +5 -3
  158. package/src/sheet-service.macos.ts +5 -1
  159. package/src/sheet-service.ts +1 -1
  160. package/src/sheet-service.web.ts +8 -0
  161. package/src/sheet-snap.test.ts +23 -23
  162. package/src/sheet-snap.ts +6 -1
  163. package/src/svg.mobile.ts +9 -3
  164. package/src/tap-to-blur.ios.ts +106 -0
  165. package/src/tap-to-blur.mobile.ts +21 -95
  166. package/src/text-focus.ts +12 -0
  167. package/src/text-input.mobile.test.ts +89 -0
  168. package/src/text-write.ts +21 -11
  169. package/src/theme/colorScheme.linux.ts +2 -4
  170. package/src/theme/colorScheme.web.ts +51 -4
  171. package/src/theme/theme-scheme.macos.ts +8 -2
  172. package/src/theme/tokens.css +1740 -1718
  173. package/src/translate.macos.ts +4 -1
  174. package/src/useMeasure.tsrx +20 -21
  175. package/src/virtual-list-cell-pool.test.ts +53 -0
  176. package/src/virtual-list-cell-pool.ts +81 -0
  177. package/src/virtual-list-layout.test.ts +11 -8
  178. package/src/virtual-list-layout.ts +4 -8
  179. package/src/windows.linux.ts +7 -2
  180. package/src/windows.macos.ts +1 -0
  181. package/types/generated/.tsrx-typegen-manifest.json +16 -3
  182. package/types/generated/Grid.d.ts +0 -1
  183. package/types/generated/KeyboardAvoiding.d.ts +3 -0
  184. package/types/generated/KeyboardAvoiding.web.d.ts +2 -0
  185. package/types/generated/Markdown.d.ts +59 -0
  186. package/types/generated/TextArea.d.ts +2 -2
  187. package/types/generated/TextArea.web.d.ts +1 -1
  188. package/types/generated/TextInput.d.ts +2 -3
  189. package/types/generated/VirtualList.d.ts +3 -3
  190. package/types/generated/escape-props.d.ts +4 -0
  191. package/types/generated/grid-auto-placement.d.ts +13 -0
  192. package/types/generated/grid-placement.d.ts +5 -0
  193. package/types/generated/index.mobile.d.ts +0 -1
  194. package/types/generated/index.shared.d.ts +6 -3
  195. package/types/generated/index.shared.web.d.ts +114 -0
  196. package/types/generated/index.web.d.ts +1 -1
  197. package/types/generated/modal-focus.web.d.ts +3 -0
  198. package/types/generated/navigation-request.d.ts +10 -0
  199. package/types/generated/overlay-lifetime.mobile.d.ts +10 -0
  200. package/types/generated/props.d.ts +111 -3
  201. package/types/generated/route-table.d.ts +14 -3
  202. package/types/generated/svg.mobile.d.ts +2 -2
  203. package/types/generated/tap-to-blur.ios.d.ts +13 -0
  204. package/types/generated/tap-to-blur.mobile.d.ts +1 -15
  205. package/types/generated/text-focus.d.ts +3 -0
  206. package/types/generated/text-write.d.ts +3 -1
  207. package/types/generated/theme/colorScheme.web.d.ts +5 -0
  208. package/types/generated/virtual-list-cell-pool.d.ts +18 -0
  209. package/types/index.macos.d.ts +15 -3
  210. /package/src/vendor/ui-svg/{index.android.ts → src/index.android.ts} +0 -0
  211. /package/src/vendor/ui-svg/{index.common.ts → src/index.common.ts} +0 -0
  212. /package/src/vendor/ui-svg/{index.ios.ts → src/index.ios.ts} +0 -0
  213. /package/src/vendor/ui-svg/{index.ts → src/index.ts} +0 -0
  214. /package/src/vendor/ui-svg/{typings → src/typings}/SVGKit.d.ts +0 -0
  215. /package/src/vendor/ui-svg/{typings → src/typings}/android.d.ts +0 -0
  216. /package/src/vendor/ui-svg/{typings → src/typings}/ios.d.ts +0 -0
  217. /package/types/generated/vendor/ui-svg/{index.common.d.ts → src/index.common.d.ts} +0 -0
  218. /package/types/generated/vendor/ui-svg/{index.d.ts → src/index.d.ts} +0 -0
  219. /package/types/generated/vendor/ui-svg/{index.ios.d.ts → src/index.ios.d.ts} +0 -0
@@ -1,14 +1,16 @@
1
1
  import { cx } from "./cx.js";
2
2
  import { useThemeScheme } from "./theme/theme-scheme.js";
3
- import { bag1, bag2, bag9, child, clone, delegateEvents, drainFrag, hookSlots, ifBlock, markDangerouslySetInnerHTMLChildren, portal, setEventHandler, sibling, snapshotSpread, template, withSlot } from "octane";
4
- import { bindSignalChild, bindSignalHostPropSources, enableSignalBindings } from "octane/internal/client";
3
+ import { isolateModalFocus } from "./modal-focus.web.js";
4
+ import { bag1, bag13, bag2, child, clone, delegateEvents, drainFrag, hookSlots, ifBlock, markDangerouslySetInnerHTMLChildren, portal, queueRefAttach, queueRefDetach, setAriaAttribute, setEventHandler, sibling, snapshotSpread, template, useEffect, useRef, withSlot } from "octane";
5
+ import { bindSignalAttribute, bindSignalChild, bindSignalHostPropSources, enableSignalBindings, replaceRef, setPlainAttribute } from "octane/internal/client";
5
6
  //#region src/Overlay.web.tsrx
6
7
  enableSignalBindings(1, true);
7
8
  delegateEvents(["click"]);
8
9
  var _t$0 = /* @__PURE__ */ template("<div class=\"vx-overlay-shade\"></div>");
9
10
  var _t$1 = /* @__PURE__ */ template("<div><!><div class=\"vx-overlay-content\"></div></div>");
10
11
  var _t$2 = /* @__PURE__ */ template("<!>", 0, 1);
11
- var _h$0 = /* @__PURE__ */ Symbol(/* @__PURE__ */ hookSlots(4));
12
+ var _hs$ = /* @__PURE__ */ hookSlots(5);
13
+ var _h$0 = /* @__PURE__ */ Symbol(_hs$);
12
14
  function __then$2(__props, __s, __extra) {
13
15
  const props = __extra[0];
14
16
  let _b = __s.slots[0];
@@ -22,83 +24,112 @@ function __then$2(__props, __s, __extra) {
22
24
  }
23
25
  var _rm$5 = [
24
26
  "s",
27
+ "f",
25
28
  "e",
26
- "d"
29
+ "r",
30
+ "h",
31
+ "g"
27
32
  ];
28
33
  function __portal$1(__props, __s, __extra) {
29
34
  const dark = __extra[0];
30
- const props = __extra[1];
35
+ const layer = __extra[1];
36
+ const panel = __extra[2];
37
+ const props = __extra[3];
31
38
  let _b = __s.slots[0];
32
39
  if (_b === void 0) {
33
- let _m0, _m1, _m2, _m3, _m4, _m5, _m6;
40
+ let _m0, _m1, _m2, _m3, _m4, _m5, _m6, _m7, _m10;
34
41
  const _root = clone(_t$1);
35
- _m0 = cx("vx-overlay", dark && "dark", props.className);
36
- _m1 = {
42
+ _m0 = layer;
43
+ _m1 = cx("vx-overlay", dark && "dark", props.className);
44
+ _m2 = {
37
45
  ...props.style,
38
46
  position: "fixed",
39
47
  inset: 0
40
48
  };
41
- _m2 = snapshotSpread(props.web);
42
- _m3 = _root;
43
- _m4 = bindSignalHostPropSources(__s, void 0, _root, [
49
+ _m3 = snapshotSpread(props.web);
50
+ _m4 = _root;
51
+ _m5 = bindSignalHostPropSources(__s, void 0, _root, [
44
52
  [
45
53
  false,
46
- "className",
54
+ "ref",
47
55
  _m0
48
56
  ],
49
57
  [
50
58
  false,
51
- "style",
59
+ "className",
52
60
  _m1
53
61
  ],
54
- [true, _m2]
55
- ], "b:843a5624", true);
62
+ [
63
+ false,
64
+ "style",
65
+ _m2
66
+ ],
67
+ [true, _m3]
68
+ ], "b:7f6ad544", true);
56
69
  const _el0 = sibling(child(_root), 1);
57
- _m5 = _el0;
70
+ queueRefAttach(__s, _m7 = panel, _m6 = _el0);
71
+ (__s.cleanups ??= []).push(() => _b && queueRefDetach(_b.h, _b.g));
58
72
  setEventHandler(_el0, "$$click", (event) => event.stopPropagation());
59
73
  markDangerouslySetInnerHTMLChildren(_root);
60
- _m6 = child(_root);
61
- _b = bag9(__s, _root, _m0, _m1, _m2, _m3, _m4, _m5, _m6, null, void 0);
74
+ _m10 = child(_root);
75
+ _b = bag13(__s, _root, _m0, _m1, _m2, _m3, _m4, _m5, _m6, _m7, void 0, void 0, _m10, null, void 0);
62
76
  __s.refFields = _rm$5;
63
77
  } else {
64
78
  {
65
- const _v = cx("vx-overlay", dark && "dark", props.className);
79
+ const _v = layer;
66
80
  if (_b.a !== _v) _b.a = _v;
67
81
  }
82
+ {
83
+ const _v = cx("vx-overlay", dark && "dark", props.className);
84
+ if (_b.b !== _v) _b.b = _v;
85
+ }
68
86
  {
69
87
  const _v = {
70
88
  ...props.style,
71
89
  position: "fixed",
72
90
  inset: 0
73
91
  };
74
- if (_b.b !== _v) _b.b = _v;
92
+ if (_b.c !== _v) _b.c = _v;
75
93
  }
76
- _b.c = snapshotSpread(props.web);
77
- _b.e = bindSignalHostPropSources(__s, _b.e, _b.d, [
94
+ _b.d = snapshotSpread(props.web);
95
+ _b.f = bindSignalHostPropSources(__s, _b.f, _b.e, [
78
96
  [
79
97
  false,
80
- "className",
98
+ "ref",
81
99
  _b.a
82
100
  ],
83
101
  [
84
102
  false,
85
- "style",
103
+ "className",
86
104
  _b.b
87
105
  ],
88
- [true, _b.c]
89
- ], "b:843a5624", true);
90
- setEventHandler(_b.f, "$$click", (event) => event.stopPropagation());
106
+ [
107
+ false,
108
+ "style",
109
+ _b.c
110
+ ],
111
+ [true, _b.d]
112
+ ], "b:7f6ad544", true);
113
+ {
114
+ const _r = panel;
115
+ if (_r !== _b.h) _b.h = replaceRef(__s, _b.h, _r, _b.g);
116
+ }
117
+ setEventHandler(_b.g, "$$click", (event) => event.stopPropagation());
91
118
  }
119
+ _b.i = bindSignalAttribute(__s, _b.i, _b.g, "role", props.shadeCover ? "dialog" : void 0, "b:298552a8", setPlainAttribute);
120
+ _b.j = bindSignalAttribute(__s, _b.j, _b.g, "aria-modal", props.shadeCover ? true : void 0, "b:c758a3c3", setAriaAttribute);
92
121
  {
93
122
  const __ifCondition = props.shadeCover;
94
- ifBlock(__s, 1, _b.d, __ifCondition, __then$2, null, _b.g, __ifCondition ? [props] : void 0);
123
+ ifBlock(__s, 1, _b.e, __ifCondition, __then$2, null, _b.k, __ifCondition ? [props] : void 0);
95
124
  }
96
- _b.j = bindSignalChild(__s, _b.j, 2, _b.f, props.children, "b:f597242e", null, void 0, void 0, void 0, true);
125
+ _b.n = bindSignalChild(__s, _b.n, 2, _b.g, props.children, "b:2c10ad65", null, void 0, void 0, void 0, true);
97
126
  }
98
127
  function __then$0(__props, __s, __extra) {
99
128
  const __block = __s.block;
100
129
  const dark = __extra[0];
101
- const props = __extra[1];
130
+ const layer = __extra[1];
131
+ const panel = __extra[2];
132
+ const props = __extra[3];
102
133
  let _b = __s.slots[0];
103
134
  if (_b === void 0) {
104
135
  let _m0, _m1;
@@ -108,15 +139,33 @@ function __then$0(__props, __s, __extra) {
108
139
  drainFrag(_root, __block.parentNode, __block.endMarker);
109
140
  _b = bag2(__s, null, _m0, _m1);
110
141
  }
111
- portal(__s, 1, document.body, __portal$1, void 0, _b.a, [dark, props], void 0, _b.b);
142
+ portal(__s, 1, document.body, __portal$1, void 0, _b.a, [
143
+ dark,
144
+ layer,
145
+ panel,
146
+ props
147
+ ], void 0, _b.b);
112
148
  }
113
149
  var Overlay = function Overlay(props, __s, __extra) {
114
150
  const __block = __s.block;
115
151
  const dark = withSlot(_h$0, useThemeScheme) === "dark";
152
+ const layer = useRef(null, _hs$ + 1);
153
+ const panel = useRef(null, _hs$ + 2);
154
+ const dismiss = useRef(props.onDismiss, _hs$ + 3);
155
+ dismiss.current = props.onDismiss;
156
+ useEffect(() => {
157
+ if (!props.open || !props.shadeCover || !layer.current || !panel.current) return;
158
+ return isolateModalFocus(layer.current, panel.current, () => dismiss.current?.());
159
+ }, [props.open, props.shadeCover], _hs$ + 4);
116
160
  if (__s.block.pending && !__s.block.crossRenderUpdate) return;
117
161
  {
118
162
  const __ifCondition$ = props.open;
119
- ifBlock(__s, 0, __block.parentNode, __ifCondition$, __then$0, null, __block.endMarker, __ifCondition$ ? [dark, props] : void 0);
163
+ ifBlock(__s, 0, __block.parentNode, __ifCondition$, __then$0, null, __block.endMarker, __ifCondition$ ? [
164
+ dark,
165
+ layer,
166
+ panel,
167
+ props
168
+ ] : void 0);
120
169
  }
121
170
  };
122
171
  //#endregion
@@ -1,11 +1,11 @@
1
1
  import { applyEscapeProps } from "./escape-props.web.js";
2
2
  import { TextInput } from "./TextInput.web.tsrx.js";
3
- import { __s, bag7, clone, createScopedValue, hookSlots, queueRefAttach, queueRefDetach, setStyle, template, useState } from "octane";
3
+ import { __s, bag7, clone, createScopedValue, hookSlots, queueRefAttach, queueRefDetach, setStyle, template, useEffect, useRef, useState } from "octane";
4
4
  import { bindSignalAttribute, bindSignalChild, createElementFromConfig, enableSignalBindings, replaceRef, setPlainAttribute, updateFreshClassName } from "octane/internal/client";
5
5
  //#region src/PinInput.web.tsrx
6
6
  enableSignalBindings(1, true);
7
7
  var _t$0 = /* @__PURE__ */ template("<div role=\"group\"></div>");
8
- var _hs$ = /* @__PURE__ */ hookSlots(1);
8
+ var _hs$ = /* @__PURE__ */ hookSlots(4);
9
9
  var _rm$1 = [
10
10
  "r",
11
11
  "b",
@@ -16,7 +16,15 @@ var PinInput = /* @__PURE__ */ __s(function PinInput(props, __s, __extra) {
16
16
  const [internal, setInternal] = useState("", _hs$ + 0);
17
17
  const controlled = props.value !== void 0;
18
18
  const value = controlled ? props.value : internal;
19
- const handles = [];
19
+ const handles = useRef([], _hs$ + 1);
20
+ const pendingFocus = useRef(null, _hs$ + 2);
21
+ useEffect(() => {
22
+ const next = pendingFocus.current;
23
+ if (next !== null && next <= value.length) {
24
+ pendingFocus.current = null;
25
+ handles.current[next]?.focus();
26
+ }
27
+ }, [value], _hs$ + 3);
20
28
  const setValue = (next) => {
21
29
  const clipped = next.slice(0, length);
22
30
  if (!controlled) setInternal(clipped);
@@ -25,10 +33,16 @@ var PinInput = /* @__PURE__ */ __s(function PinInput(props, __s, __extra) {
25
33
  };
26
34
  const cellValue = (i) => value[i] ?? "";
27
35
  const enter = (i, text) => {
36
+ if (props.disabled || i > value.length) return;
28
37
  const ch = text.slice(-1);
29
- const next = (value.slice(0, i) + ch + value.slice(i + 1)).slice(0, length);
38
+ const next = ch ? (value.slice(0, i) + ch + value.slice(i + 1)).slice(0, length) : value.slice(0, i);
39
+ pendingFocus.current = ch && i < length - 1 ? i + 1 : null;
30
40
  setValue(next);
31
- if (ch && i < length - 1) handles[i + 1]?.focus();
41
+ if (pendingFocus.current !== null && pendingFocus.current <= value.length) {
42
+ const index = pendingFocus.current;
43
+ pendingFocus.current = null;
44
+ handles.current[index]?.focus();
45
+ }
32
46
  };
33
47
  let _b = __s.slots[0];
34
48
  if (_b === void 0) {
@@ -42,7 +56,7 @@ var PinInput = /* @__PURE__ */ __s(function PinInput(props, __s, __extra) {
42
56
  const _r = (e) => applyEscapeProps(e, props);
43
57
  if (_r !== _b.b) _b.b = replaceRef(__s, _b.b, _r, _b.a);
44
58
  }
45
- _b.c = bindSignalAttribute(__s, _b.c, _b.a, "id", props.id, "b:0821d08b", setPlainAttribute);
59
+ _b.c = bindSignalAttribute(__s, _b.c, _b.a, "id", props.id, "b:1e485ce0", setPlainAttribute);
46
60
  _b.d = updateFreshClassName([
47
61
  "vx-pininput",
48
62
  props.disabled ? "vx-pininput--disabled" : void 0,
@@ -55,18 +69,18 @@ var PinInput = /* @__PURE__ */ __s(function PinInput(props, __s, __extra) {
55
69
  _b.e = _v;
56
70
  }
57
71
  }
58
- _b.h = bindSignalChild(__s, _b.h, 1, _b.a, Array.from({ length }, (_, i) => createScopedValue(() => createElementFromConfig("c:5e39db67", TextInput, {
72
+ _b.h = bindSignalChild(__s, _b.h, 1, _b.a, Array.from({ length }, (_, i) => createScopedValue(() => createElementFromConfig("c:7e2411cc", TextInput, {
59
73
  key: i,
60
74
  className: "vx-pininput-cell",
61
75
  keyboardType: "number",
62
76
  secure: props.secure,
63
- editable: !props.disabled,
77
+ editable: !props.disabled && i <= value.length,
64
78
  value: cellValue(i),
65
79
  onChange: (text) => enter(i, text),
66
80
  bind: (h) => {
67
- handles[i] = h;
81
+ handles.current[i] = h;
68
82
  }
69
- }))), "b:308dacfa", null, void 0, void 0, void 0, true);
83
+ }))), "b:d669efd3", null, void 0, void 0, void 0, true);
70
84
  });
71
85
  //#endregion
72
86
  export { PinInput };
@@ -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(2);
10
- var _h$1 = /* @__PURE__ */ Symbol(_hs$ + 1);
9
+ var _hs$ = /* @__PURE__ */ hookSlots(8);
10
+ var _h$4 = /* @__PURE__ */ Symbol(_hs$ + 4);
11
11
  var _rm$1 = [
12
12
  "s",
13
- "u",
14
- "t"
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
- let timer = null;
19
- withSlot(_h$1, usePan, el, props.disabled ? void 0 : props.onPan);
20
- const cancel = () => {
21
- if (timer !== null) {
22
- clearTimeout(timer);
23
- timer = null;
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
- const down = () => {
27
- if (props.disabled || !props.onLongPress) return;
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
- props.onLongPress?.();
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.accessibilityState?.disabled ?? props.disabled ?? void 0;
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 ? void 0 : props.onPress;
65
- _m14 = props.disabled ? void 0 : props.onDoublePress;
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
- _m16 = () => {
109
+ _m20 = () => {
73
110
  if (!props.disabled) props.onPressOut?.();
74
111
  cancel();
75
112
  };
76
- _m17 = () => {
113
+ _m21 = () => {
77
114
  if (!props.disabled) props.onPressOut?.();
78
115
  cancel();
79
116
  };
80
- _m18 = () => {
117
+ _m22 = () => {
81
118
  if (!props.disabled) props.onPressOut?.();
82
119
  cancel();
83
120
  };
84
- _m19 = _root;
85
- _m20 = bindSignalHostPropSources(__s, void 0, _root, [
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
- "onClick",
186
+ "tabIndex",
150
187
  _m13
151
188
  ],
152
189
  [
153
190
  false,
154
- "onDoubleClick",
191
+ "onKeyDown",
155
192
  _m14
156
193
  ],
157
194
  [
158
195
  false,
159
- "onPointerDown",
196
+ "onKeyUp",
160
197
  _m15
161
198
  ],
162
199
  [
163
200
  false,
164
- "onPointerUp",
201
+ "onBlur",
165
202
  _m16
166
203
  ],
167
204
  [
168
205
  false,
169
- "onPointerLeave",
206
+ "onClick",
170
207
  _m17
171
208
  ],
172
209
  [
173
210
  false,
174
- "onPointerCancel",
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:85f49247", true);
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: null,
201
- w: void 0
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.accessibilityState?.disabled ?? props.disabled ?? void 0;
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 ? void 0 : props.onPress;
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 = props.disabled ? void 0 : props.onDoublePress;
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.p !== _v) _b.p = _v;
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.q !== _v) _b.q = _v;
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.r !== _v) _b.r = _v;
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.s !== _v) _b.s = _v;
398
+ if (_b.w !== _v) _b.w = _v;
303
399
  }
304
- _b.u = bindSignalHostPropSources(__s, _b.u, _b.t, [
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
- "onClick",
464
+ "tabIndex",
369
465
  _b.n
370
466
  ],
371
467
  [
372
468
  false,
373
- "onDoubleClick",
469
+ "onKeyDown",
374
470
  _b.o
375
471
  ],
376
472
  [
377
473
  false,
378
- "onPointerDown",
474
+ "onKeyUp",
379
475
  _b.p
380
476
  ],
381
477
  [
382
478
  false,
383
- "onPointerUp",
479
+ "onBlur",
384
480
  _b.q
385
481
  ],
386
482
  [
387
483
  false,
388
- "onPointerLeave",
484
+ "onClick",
389
485
  _b.r
390
486
  ],
391
487
  [
392
488
  false,
393
- "onPointerCancel",
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:85f49247", true);
512
+ ], "b:7e0eb713", true);
397
513
  }
398
- _b.x = bindSignalChild(__s, _b.x, 1, _b.t, props.children, "b:7567c2fe", null, void 0, void 0, void 0, true);
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);