@hozo/primitives 0.1.0 → 0.2.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/CHANGELOG.md +15 -0
- package/README.md +7 -2
- package/dist/flat-list.native.d.ts +8 -8
- package/dist/flat-list.native.d.ts.map +1 -1
- package/dist/flat-list.native.js +55 -25
- package/dist/flat-list.native.js.map +1 -1
- package/dist/foundation.native.d.ts +16 -2
- package/dist/foundation.native.d.ts.map +1 -1
- package/dist/foundation.native.js.map +1 -1
- package/dist/index.d.ts +6 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -9
- package/dist/index.js.map +1 -1
- package/dist/index.native.d.ts +1 -0
- package/dist/index.native.d.ts.map +1 -1
- package/dist/index.native.js +1 -0
- package/dist/index.native.js.map +1 -1
- package/dist/presence-context.d.ts +15 -0
- package/dist/presence-context.d.ts.map +1 -0
- package/dist/presence-context.js +11 -0
- package/dist/presence-context.js.map +1 -0
- package/dist/presence.d.ts +12 -0
- package/dist/presence.d.ts.map +1 -0
- package/dist/presence.js +45 -0
- package/dist/presence.js.map +1 -0
- package/dist/presence.native.d.ts +8 -0
- package/dist/presence.native.d.ts.map +1 -0
- package/dist/presence.native.js +66 -0
- package/dist/presence.native.js.map +1 -0
- package/dist/pressable.d.ts +9 -2
- package/dist/pressable.d.ts.map +1 -1
- package/dist/pressable.js +3 -3
- package/dist/pressable.js.map +1 -1
- package/dist/runtime-transition.native.d.ts +16 -1
- package/dist/runtime-transition.native.d.ts.map +1 -1
- package/dist/runtime-transition.native.js +34 -7
- package/dist/runtime-transition.native.js.map +1 -1
- package/dist/text-input.d.ts +319 -3
- package/dist/text-input.d.ts.map +1 -1
- package/dist/text-input.js +4 -3
- package/dist/text-input.js.map +1 -1
- package/dist/view.d.ts +295 -2
- package/dist/view.d.ts.map +1 -1
- package/dist/view.js +3 -3
- package/dist/view.js.map +1 -1
- package/package.json +4 -3
- package/src/flat-list.native.tsx +69 -47
- package/src/foundation.native.tsx +16 -1
- package/src/index.native.ts +2 -0
- package/src/index.ts +209 -219
- package/src/presence-context.ts +27 -0
- package/src/presence.native.tsx +81 -0
- package/src/presence.tsx +55 -0
- package/src/pressable.ts +66 -63
- package/src/runtime-transition.native.tsx +68 -7
- package/src/text-input.ts +74 -72
- package/src/view.ts +42 -36
package/dist/view.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type HozoDomStyle, type ResponderProps } from '@hozo/engine';
|
|
2
|
-
import { type HTMLAttributes, type ReactNode } from 'react';
|
|
2
|
+
import { type HTMLAttributes, type ReactNode, type Ref } from 'react';
|
|
3
3
|
export interface HozoLayoutEvent {
|
|
4
4
|
nativeEvent: {
|
|
5
5
|
layout: {
|
|
@@ -36,7 +36,300 @@ export interface HozoViewProps extends Omit<HTMLAttributes<HTMLDivElement>, 'chi
|
|
|
36
36
|
onLayout?: (event: HozoLayoutEvent) => void;
|
|
37
37
|
collapsable?: boolean;
|
|
38
38
|
'data-hozo-disabled'?: string;
|
|
39
|
+
/**
|
|
40
|
+
* Declared here rather than supplied by `forwardRef`'s return type.
|
|
41
|
+
*
|
|
42
|
+
* React 19 takes `ref` as an ordinary prop, so the component is a plain
|
|
43
|
+
* function and nothing adds `ref` to its props on the way out. A caller's
|
|
44
|
+
* `ref` is accepted because this line says so, which is also why it has to
|
|
45
|
+
* be destructured below: `...props` would otherwise carry it to the `div`.
|
|
46
|
+
*/
|
|
47
|
+
ref?: Ref<HTMLDivElement>;
|
|
39
48
|
}
|
|
40
49
|
/** A measured/responder-aware View for the Web paths that cannot be a plain div. */
|
|
41
|
-
export declare
|
|
50
|
+
export declare function HozoView({ ref: forwardedRef, children, style, testID, nativeID, pointerEvents, accessibilityLabel, accessibilityHint, accessibilityRole, accessibilityState, accessibilityValue, accessibilityLiveRegion, onLayout, collapsable: _collapsable, role, 'aria-disabled': ariaDisabled, 'data-hozo-disabled': dataHozoDisabled, onStartShouldSetResponder, onStartShouldSetResponderCapture, onMoveShouldSetResponder, onMoveShouldSetResponderCapture, onResponderGrant, onResponderStart, onResponderMove, onResponderEnd, onResponderRelease, onResponderReject, onResponderTerminate, onResponderTerminationRequest, ...props }: HozoViewProps): import("react").DetailedReactHTMLElement<{
|
|
51
|
+
dangerouslySetInnerHTML?: {
|
|
52
|
+
__html: string | TrustedHTML;
|
|
53
|
+
} | undefined;
|
|
54
|
+
onCopy?: import("react").ClipboardEventHandler<HTMLDivElement> | undefined;
|
|
55
|
+
onCopyCapture?: import("react").ClipboardEventHandler<HTMLDivElement> | undefined;
|
|
56
|
+
onCut?: import("react").ClipboardEventHandler<HTMLDivElement> | undefined;
|
|
57
|
+
onCutCapture?: import("react").ClipboardEventHandler<HTMLDivElement> | undefined;
|
|
58
|
+
onPaste?: import("react").ClipboardEventHandler<HTMLDivElement> | undefined;
|
|
59
|
+
onPasteCapture?: import("react").ClipboardEventHandler<HTMLDivElement> | undefined;
|
|
60
|
+
onCompositionEnd?: import("react").CompositionEventHandler<HTMLDivElement> | undefined;
|
|
61
|
+
onCompositionEndCapture?: import("react").CompositionEventHandler<HTMLDivElement> | undefined;
|
|
62
|
+
onCompositionStart?: import("react").CompositionEventHandler<HTMLDivElement> | undefined;
|
|
63
|
+
onCompositionStartCapture?: import("react").CompositionEventHandler<HTMLDivElement> | undefined;
|
|
64
|
+
onCompositionUpdate?: import("react").CompositionEventHandler<HTMLDivElement> | undefined;
|
|
65
|
+
onCompositionUpdateCapture?: import("react").CompositionEventHandler<HTMLDivElement> | undefined;
|
|
66
|
+
onFocus?: import("react").FocusEventHandler<HTMLDivElement> | undefined;
|
|
67
|
+
onFocusCapture?: import("react").FocusEventHandler<HTMLDivElement> | undefined;
|
|
68
|
+
onBlur?: import("react").FocusEventHandler<HTMLDivElement> | undefined;
|
|
69
|
+
onBlurCapture?: import("react").FocusEventHandler<HTMLDivElement> | undefined;
|
|
70
|
+
onChange?: import("react").ChangeEventHandler<HTMLDivElement, Element> | undefined;
|
|
71
|
+
onChangeCapture?: import("react").ChangeEventHandler<HTMLDivElement, Element> | undefined;
|
|
72
|
+
onBeforeInput?: import("react").InputEventHandler<HTMLDivElement> | undefined;
|
|
73
|
+
onBeforeInputCapture?: import("react").InputEventHandler<HTMLDivElement> | undefined;
|
|
74
|
+
onInput?: import("react").InputEventHandler<HTMLDivElement> | undefined;
|
|
75
|
+
onInputCapture?: import("react").InputEventHandler<HTMLDivElement> | undefined;
|
|
76
|
+
onReset?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
77
|
+
onResetCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
78
|
+
onSubmit?: import("react").SubmitEventHandler<HTMLDivElement> | undefined;
|
|
79
|
+
onSubmitCapture?: import("react").SubmitEventHandler<HTMLDivElement> | undefined;
|
|
80
|
+
onInvalid?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
81
|
+
onInvalidCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
82
|
+
onLoad?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
83
|
+
onLoadCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
84
|
+
onError?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
85
|
+
onErrorCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
86
|
+
onKeyDown?: import("react").KeyboardEventHandler<HTMLDivElement> | undefined;
|
|
87
|
+
onKeyDownCapture?: import("react").KeyboardEventHandler<HTMLDivElement> | undefined;
|
|
88
|
+
onKeyPress?: import("react").KeyboardEventHandler<HTMLDivElement> | undefined;
|
|
89
|
+
onKeyPressCapture?: import("react").KeyboardEventHandler<HTMLDivElement> | undefined;
|
|
90
|
+
onKeyUp?: import("react").KeyboardEventHandler<HTMLDivElement> | undefined;
|
|
91
|
+
onKeyUpCapture?: import("react").KeyboardEventHandler<HTMLDivElement> | undefined;
|
|
92
|
+
onAbort?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
93
|
+
onAbortCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
94
|
+
onCanPlay?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
95
|
+
onCanPlayCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
96
|
+
onCanPlayThrough?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
97
|
+
onCanPlayThroughCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
98
|
+
onDurationChange?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
99
|
+
onDurationChangeCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
100
|
+
onEmptied?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
101
|
+
onEmptiedCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
102
|
+
onEncrypted?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
103
|
+
onEncryptedCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
104
|
+
onEnded?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
105
|
+
onEndedCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
106
|
+
onLoadedData?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
107
|
+
onLoadedDataCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
108
|
+
onLoadedMetadata?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
109
|
+
onLoadedMetadataCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
110
|
+
onLoadStart?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
111
|
+
onLoadStartCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
112
|
+
onPause?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
113
|
+
onPauseCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
114
|
+
onPlay?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
115
|
+
onPlayCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
116
|
+
onPlaying?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
117
|
+
onPlayingCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
118
|
+
onProgress?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
119
|
+
onProgressCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
120
|
+
onRateChange?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
121
|
+
onRateChangeCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
122
|
+
onSeeked?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
123
|
+
onSeekedCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
124
|
+
onSeeking?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
125
|
+
onSeekingCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
126
|
+
onStalled?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
127
|
+
onStalledCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
128
|
+
onSuspend?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
129
|
+
onSuspendCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
130
|
+
onTimeUpdate?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
131
|
+
onTimeUpdateCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
132
|
+
onVolumeChange?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
133
|
+
onVolumeChangeCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
134
|
+
onWaiting?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
135
|
+
onWaitingCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
136
|
+
onAuxClick?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
137
|
+
onAuxClickCapture?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
138
|
+
onClick?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
139
|
+
onClickCapture?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
140
|
+
onContextMenu?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
141
|
+
onContextMenuCapture?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
142
|
+
onDoubleClick?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
143
|
+
onDoubleClickCapture?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
144
|
+
onDrag?: import("react").DragEventHandler<HTMLDivElement> | undefined;
|
|
145
|
+
onDragCapture?: import("react").DragEventHandler<HTMLDivElement> | undefined;
|
|
146
|
+
onDragEnd?: import("react").DragEventHandler<HTMLDivElement> | undefined;
|
|
147
|
+
onDragEndCapture?: import("react").DragEventHandler<HTMLDivElement> | undefined;
|
|
148
|
+
onDragEnter?: import("react").DragEventHandler<HTMLDivElement> | undefined;
|
|
149
|
+
onDragEnterCapture?: import("react").DragEventHandler<HTMLDivElement> | undefined;
|
|
150
|
+
onDragExit?: import("react").DragEventHandler<HTMLDivElement> | undefined;
|
|
151
|
+
onDragExitCapture?: import("react").DragEventHandler<HTMLDivElement> | undefined;
|
|
152
|
+
onDragLeave?: import("react").DragEventHandler<HTMLDivElement> | undefined;
|
|
153
|
+
onDragLeaveCapture?: import("react").DragEventHandler<HTMLDivElement> | undefined;
|
|
154
|
+
onDragOver?: import("react").DragEventHandler<HTMLDivElement> | undefined;
|
|
155
|
+
onDragOverCapture?: import("react").DragEventHandler<HTMLDivElement> | undefined;
|
|
156
|
+
onDragStart?: import("react").DragEventHandler<HTMLDivElement> | undefined;
|
|
157
|
+
onDragStartCapture?: import("react").DragEventHandler<HTMLDivElement> | undefined;
|
|
158
|
+
onDrop?: import("react").DragEventHandler<HTMLDivElement> | undefined;
|
|
159
|
+
onDropCapture?: import("react").DragEventHandler<HTMLDivElement> | undefined;
|
|
160
|
+
onMouseDown?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
161
|
+
onMouseDownCapture?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
162
|
+
onMouseEnter?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
163
|
+
onMouseLeave?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
164
|
+
onMouseMove?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
165
|
+
onMouseMoveCapture?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
166
|
+
onMouseOut?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
167
|
+
onMouseOutCapture?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
168
|
+
onMouseOver?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
169
|
+
onMouseOverCapture?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
170
|
+
onMouseUp?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
171
|
+
onMouseUpCapture?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
172
|
+
onSelect?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
173
|
+
onSelectCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
174
|
+
onTouchCancel?: import("react").TouchEventHandler<HTMLDivElement> | undefined;
|
|
175
|
+
onTouchCancelCapture?: import("react").TouchEventHandler<HTMLDivElement> | undefined;
|
|
176
|
+
onTouchEnd?: import("react").TouchEventHandler<HTMLDivElement> | undefined;
|
|
177
|
+
onTouchEndCapture?: import("react").TouchEventHandler<HTMLDivElement> | undefined;
|
|
178
|
+
onTouchMove?: import("react").TouchEventHandler<HTMLDivElement> | undefined;
|
|
179
|
+
onTouchMoveCapture?: import("react").TouchEventHandler<HTMLDivElement> | undefined;
|
|
180
|
+
onTouchStart?: import("react").TouchEventHandler<HTMLDivElement> | undefined;
|
|
181
|
+
onTouchStartCapture?: import("react").TouchEventHandler<HTMLDivElement> | undefined;
|
|
182
|
+
onPointerDown?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
183
|
+
onPointerDownCapture?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
184
|
+
onPointerMove?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
185
|
+
onPointerMoveCapture?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
186
|
+
onPointerUp?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
187
|
+
onPointerUpCapture?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
188
|
+
onPointerCancel?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
189
|
+
onPointerCancelCapture?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
190
|
+
onPointerEnter?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
191
|
+
onPointerLeave?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
192
|
+
onPointerOver?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
193
|
+
onPointerOverCapture?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
194
|
+
onPointerOut?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
195
|
+
onPointerOutCapture?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
196
|
+
onGotPointerCapture?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
197
|
+
onGotPointerCaptureCapture?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
198
|
+
onLostPointerCapture?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
199
|
+
onLostPointerCaptureCapture?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
200
|
+
onScroll?: import("react").UIEventHandler<HTMLDivElement> | undefined;
|
|
201
|
+
onScrollCapture?: import("react").UIEventHandler<HTMLDivElement> | undefined;
|
|
202
|
+
onScrollEnd?: import("react").UIEventHandler<HTMLDivElement> | undefined;
|
|
203
|
+
onScrollEndCapture?: import("react").UIEventHandler<HTMLDivElement> | undefined;
|
|
204
|
+
onWheel?: import("react").WheelEventHandler<HTMLDivElement> | undefined;
|
|
205
|
+
onWheelCapture?: import("react").WheelEventHandler<HTMLDivElement> | undefined;
|
|
206
|
+
onAnimationStart?: import("react").AnimationEventHandler<HTMLDivElement> | undefined;
|
|
207
|
+
onAnimationStartCapture?: import("react").AnimationEventHandler<HTMLDivElement> | undefined;
|
|
208
|
+
onAnimationEnd?: import("react").AnimationEventHandler<HTMLDivElement> | undefined;
|
|
209
|
+
onAnimationEndCapture?: import("react").AnimationEventHandler<HTMLDivElement> | undefined;
|
|
210
|
+
onAnimationIteration?: import("react").AnimationEventHandler<HTMLDivElement> | undefined;
|
|
211
|
+
onAnimationIterationCapture?: import("react").AnimationEventHandler<HTMLDivElement> | undefined;
|
|
212
|
+
onToggle?: import("react").ToggleEventHandler<HTMLDivElement> | undefined;
|
|
213
|
+
onBeforeToggle?: import("react").ToggleEventHandler<HTMLDivElement> | undefined;
|
|
214
|
+
onTransitionCancel?: import("react").TransitionEventHandler<HTMLDivElement> | undefined;
|
|
215
|
+
onTransitionCancelCapture?: import("react").TransitionEventHandler<HTMLDivElement> | undefined;
|
|
216
|
+
onTransitionEnd?: import("react").TransitionEventHandler<HTMLDivElement> | undefined;
|
|
217
|
+
onTransitionEndCapture?: import("react").TransitionEventHandler<HTMLDivElement> | undefined;
|
|
218
|
+
onTransitionRun?: import("react").TransitionEventHandler<HTMLDivElement> | undefined;
|
|
219
|
+
onTransitionRunCapture?: import("react").TransitionEventHandler<HTMLDivElement> | undefined;
|
|
220
|
+
onTransitionStart?: import("react").TransitionEventHandler<HTMLDivElement> | undefined;
|
|
221
|
+
onTransitionStartCapture?: import("react").TransitionEventHandler<HTMLDivElement> | undefined;
|
|
222
|
+
"aria-activedescendant"?: string | undefined;
|
|
223
|
+
"aria-atomic"?: ("false" | "true" | boolean) | undefined;
|
|
224
|
+
"aria-autocomplete"?: "none" | "inline" | "list" | "both" | undefined;
|
|
225
|
+
"aria-braillelabel"?: string | undefined;
|
|
226
|
+
"aria-brailleroledescription"?: string | undefined;
|
|
227
|
+
"aria-colcount"?: number | undefined;
|
|
228
|
+
"aria-colindex"?: number | undefined;
|
|
229
|
+
"aria-colindextext"?: string | undefined;
|
|
230
|
+
"aria-colspan"?: number | undefined;
|
|
231
|
+
"aria-controls"?: string | undefined;
|
|
232
|
+
"aria-current"?: boolean | "false" | "true" | "page" | "step" | "location" | "date" | "time" | undefined;
|
|
233
|
+
"aria-describedby"?: string | undefined;
|
|
234
|
+
"aria-details"?: string | undefined;
|
|
235
|
+
"aria-dropeffect"?: "none" | "copy" | "execute" | "link" | "move" | "popup" | undefined;
|
|
236
|
+
"aria-errormessage"?: string | undefined;
|
|
237
|
+
"aria-flowto"?: string | undefined;
|
|
238
|
+
"aria-grabbed"?: ("false" | "true" | boolean) | undefined;
|
|
239
|
+
"aria-haspopup"?: boolean | "false" | "true" | "menu" | "listbox" | "tree" | "grid" | "dialog" | undefined;
|
|
240
|
+
"aria-hidden"?: ("false" | "true" | boolean) | undefined;
|
|
241
|
+
"aria-invalid"?: boolean | "false" | "true" | "grammar" | "spelling" | undefined;
|
|
242
|
+
"aria-keyshortcuts"?: string | undefined;
|
|
243
|
+
"aria-labelledby"?: string | undefined;
|
|
244
|
+
"aria-level"?: number | undefined;
|
|
245
|
+
"aria-modal"?: ("false" | "true" | boolean) | undefined;
|
|
246
|
+
"aria-multiline"?: ("false" | "true" | boolean) | undefined;
|
|
247
|
+
"aria-multiselectable"?: ("false" | "true" | boolean) | undefined;
|
|
248
|
+
"aria-orientation"?: "horizontal" | "vertical" | undefined;
|
|
249
|
+
"aria-owns"?: string | undefined;
|
|
250
|
+
"aria-placeholder"?: string | undefined;
|
|
251
|
+
"aria-posinset"?: number | undefined;
|
|
252
|
+
"aria-pressed"?: boolean | "false" | "mixed" | "true" | undefined;
|
|
253
|
+
"aria-readonly"?: ("false" | "true" | boolean) | undefined;
|
|
254
|
+
"aria-relevant"?: "additions" | "additions removals" | "additions text" | "all" | "removals" | "removals additions" | "removals text" | "text" | "text additions" | "text removals" | undefined;
|
|
255
|
+
"aria-required"?: ("false" | "true" | boolean) | undefined;
|
|
256
|
+
"aria-roledescription"?: string | undefined;
|
|
257
|
+
"aria-rowcount"?: number | undefined;
|
|
258
|
+
"aria-rowindex"?: number | undefined;
|
|
259
|
+
"aria-rowindextext"?: string | undefined;
|
|
260
|
+
"aria-rowspan"?: number | undefined;
|
|
261
|
+
"aria-setsize"?: number | undefined;
|
|
262
|
+
"aria-sort"?: "none" | "ascending" | "descending" | "other" | undefined;
|
|
263
|
+
defaultChecked?: boolean | undefined;
|
|
264
|
+
defaultValue?: string | number | readonly string[] | undefined;
|
|
265
|
+
suppressContentEditableWarning?: boolean | undefined;
|
|
266
|
+
suppressHydrationWarning?: boolean | undefined;
|
|
267
|
+
accessKey?: string | undefined;
|
|
268
|
+
autoCapitalize?: "off" | "none" | "on" | "sentences" | "words" | "characters" | undefined | (string & {});
|
|
269
|
+
autoFocus?: boolean | undefined;
|
|
270
|
+
className?: string | undefined;
|
|
271
|
+
contentEditable?: ("false" | "true" | boolean) | "inherit" | "plaintext-only" | undefined;
|
|
272
|
+
contextMenu?: string | undefined;
|
|
273
|
+
dir?: string | undefined;
|
|
274
|
+
draggable?: ("false" | "true" | boolean) | undefined;
|
|
275
|
+
enterKeyHint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send" | undefined;
|
|
276
|
+
hidden?: boolean | undefined;
|
|
277
|
+
lang?: string | undefined;
|
|
278
|
+
nonce?: string | undefined;
|
|
279
|
+
slot?: string | undefined;
|
|
280
|
+
spellCheck?: ("false" | "true" | boolean) | undefined;
|
|
281
|
+
tabIndex?: number | undefined;
|
|
282
|
+
title?: string | undefined;
|
|
283
|
+
translate?: "yes" | "no" | undefined;
|
|
284
|
+
radioGroup?: string | undefined;
|
|
285
|
+
about?: string | undefined;
|
|
286
|
+
content?: string | undefined;
|
|
287
|
+
datatype?: string | undefined;
|
|
288
|
+
inlist?: any;
|
|
289
|
+
prefix?: string | undefined;
|
|
290
|
+
property?: string | undefined;
|
|
291
|
+
rel?: string | undefined;
|
|
292
|
+
resource?: string | undefined;
|
|
293
|
+
rev?: string | undefined;
|
|
294
|
+
typeof?: string | undefined;
|
|
295
|
+
vocab?: string | undefined;
|
|
296
|
+
autoCorrect?: string | undefined;
|
|
297
|
+
autoSave?: string | undefined;
|
|
298
|
+
color?: string | undefined;
|
|
299
|
+
itemProp?: string | undefined;
|
|
300
|
+
itemScope?: boolean | undefined;
|
|
301
|
+
itemType?: string | undefined;
|
|
302
|
+
itemID?: string | undefined;
|
|
303
|
+
itemRef?: string | undefined;
|
|
304
|
+
results?: number | undefined;
|
|
305
|
+
security?: string | undefined;
|
|
306
|
+
unselectable?: "on" | "off" | undefined;
|
|
307
|
+
popover?: "" | "auto" | "manual" | "hint" | undefined;
|
|
308
|
+
popoverTargetAction?: "toggle" | "show" | "hide" | undefined;
|
|
309
|
+
popoverTarget?: string | undefined;
|
|
310
|
+
inert?: boolean | undefined;
|
|
311
|
+
inputMode?: "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | "search" | undefined;
|
|
312
|
+
is?: string | undefined;
|
|
313
|
+
exportparts?: string | undefined;
|
|
314
|
+
part?: string | undefined;
|
|
315
|
+
ref: (element: HTMLDivElement | null) => void;
|
|
316
|
+
role: string | undefined;
|
|
317
|
+
style: import("react").CSSProperties | undefined;
|
|
318
|
+
'data-testid': string | undefined;
|
|
319
|
+
id: string | undefined;
|
|
320
|
+
'data-hozo-pointer-events': "auto" | "box-none" | "box-only" | "none" | undefined;
|
|
321
|
+
'data-hozo-disabled': string | undefined;
|
|
322
|
+
'aria-disabled': ("false" | "true" | boolean) | undefined;
|
|
323
|
+
'aria-selected': boolean | undefined;
|
|
324
|
+
'aria-checked': "mixed" | boolean | undefined;
|
|
325
|
+
'aria-busy': boolean | undefined;
|
|
326
|
+
'aria-expanded': boolean | undefined;
|
|
327
|
+
'aria-valuemin': number | undefined;
|
|
328
|
+
'aria-valuemax': number | undefined;
|
|
329
|
+
'aria-valuenow': number | undefined;
|
|
330
|
+
'aria-valuetext': string | undefined;
|
|
331
|
+
'aria-live': "assertive" | "polite" | undefined;
|
|
332
|
+
'aria-label': string | undefined;
|
|
333
|
+
'aria-description': string | undefined;
|
|
334
|
+
}, HTMLDivElement>;
|
|
42
335
|
//# sourceMappingURL=view.d.ts.map
|
package/dist/view.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"view.d.ts","sourceRoot":"","sources":["../src/view.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,YAAY,EAEjB,KAAK,cAAc,EAEpB,MAAM,cAAc,CAAA;AACrB,OAAO,
|
|
1
|
+
{"version":3,"file":"view.d.ts","sourceRoot":"","sources":["../src/view.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,YAAY,EAEjB,KAAK,cAAc,EAEpB,MAAM,cAAc,CAAA;AACrB,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,SAAS,EACd,KAAK,GAAG,EAIT,MAAM,OAAO,CAAA;AAEd,MAAM,WAAW,eAAe;IAC9B,WAAW,EAAE;QAAE,MAAM,EAAE;YAAE,CAAC,EAAE,MAAM,CAAC;YAAC,CAAC,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,CAAC;YAAC,MAAM,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,CAAA;CACjF;AAED,MAAM,WAAW,aACf,SAAQ,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,EAChE,cAAc;IAChB,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB,KAAK,CAAC,EAAE,YAAY,CAAA;IACpB,MAAM,CAAC,EAAE,MAAM,CAAA;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E,gBAAgB,EACtC,yBAAyB,EACzB,gCAAgC,EAChC,wBAAwB,EACxB,+BAA+B,EAC/B,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,cAAc,EACd,kBAAkB,EAClB,iBAAiB,EACjB,oBAAoB,EACpB,6BAA6B,EAC7B,GAAG,KAAK,EACT,EAAE,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAKF,cAAc,GAAG,IAAI;;;;;;;;;;;;;;;;;;;mBA0ElC"}
|
package/dist/view.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { hozoDomStyle, useResponderDomProps, } from '@hozo/engine';
|
|
2
|
-
import { createElement,
|
|
2
|
+
import { createElement, useCallback, useEffect, useRef, } from 'react';
|
|
3
3
|
function assignRef(ref, value) {
|
|
4
4
|
if (typeof ref === 'function')
|
|
5
5
|
ref(value);
|
|
@@ -7,7 +7,7 @@ function assignRef(ref, value) {
|
|
|
7
7
|
ref.current = value;
|
|
8
8
|
}
|
|
9
9
|
/** A measured/responder-aware View for the Web paths that cannot be a plain div. */
|
|
10
|
-
export
|
|
10
|
+
export function HozoView({ ref: forwardedRef, children, style, testID, nativeID, pointerEvents, accessibilityLabel, accessibilityHint, accessibilityRole, accessibilityState, accessibilityValue, accessibilityLiveRegion, onLayout, collapsable: _collapsable, role, 'aria-disabled': ariaDisabled, 'data-hozo-disabled': dataHozoDisabled, onStartShouldSetResponder, onStartShouldSetResponderCapture, onMoveShouldSetResponder, onMoveShouldSetResponderCapture, onResponderGrant, onResponderStart, onResponderMove, onResponderEnd, onResponderRelease, onResponderReject, onResponderTerminate, onResponderTerminationRequest, ...props }) {
|
|
11
11
|
const elementRef = useRef(null);
|
|
12
12
|
const layoutCallback = useRef(onLayout);
|
|
13
13
|
layoutCallback.current = onLayout;
|
|
@@ -80,5 +80,5 @@ export const HozoView = forwardRef(function HozoView({ children, style, testID,
|
|
|
80
80
|
'aria-label': accessibilityLabel,
|
|
81
81
|
'aria-description': accessibilityHint,
|
|
82
82
|
}, children);
|
|
83
|
-
}
|
|
83
|
+
}
|
|
84
84
|
//# sourceMappingURL=view.js.map
|
package/dist/view.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"view.js","sourceRoot":"","sources":["../src/view.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,YAAY,EAEZ,oBAAoB,GACrB,MAAM,cAAc,CAAA;AACrB,OAAO,EACL,aAAa,
|
|
1
|
+
{"version":3,"file":"view.js","sourceRoot":"","sources":["../src/view.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,YAAY,EAEZ,oBAAoB,GACrB,MAAM,cAAc,CAAA;AACrB,OAAO,EACL,aAAa,EAIb,WAAW,EACX,SAAS,EACT,MAAM,GACP,MAAM,OAAO,CAAA;AAwCd,SAAS,SAAS,CAAI,GAAuB,EAAE,KAAe;IAC5D,IAAI,OAAO,GAAG,KAAK,UAAU;QAAE,GAAG,CAAC,KAAK,CAAC,CAAA;SACpC,IAAI,GAAG;QAAE,GAAG,CAAC,OAAO,GAAG,KAAK,CAAA;AACnC,CAAC;AAED,oFAAoF;AACpF,MAAM,UAAU,QAAQ,CAAC,EACvB,GAAG,EAAE,YAAY,EACjB,QAAQ,EACR,KAAK,EACL,MAAM,EACN,QAAQ,EACR,aAAa,EACb,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,uBAAuB,EACvB,QAAQ,EACR,WAAW,EAAE,YAAY,EACzB,IAAI,EAC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C9B,WAAW,EAAE,KAAK,EAAE,IAAI;QACxB,eAAe,EAAE,KAAK,EAAE,QAAQ;QAChC,eAAe,EAAE,KAAK,EAAE,GAAG;QAC3B,eAAe,EAAE,KAAK,EAAE,GAAG;QAC3B,eAAe,EAAE,KAAK,EAAE,GAAG;QAC3B,gBAAgB,EAAE,KAAK,EAAE,IAAI;QAC7B,WAAW,EAAE,uBAAuB,KAAK,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,uBAAuB;QACrF,YAAY,EAAE,kBAAkB;QAChC,kBAAkB,EAAE,iBAAiB;KACtC,EACD,QAAQ,CACT,CAAA;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hozo/primitives",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Canonical universal UI primitives for Hozo applications.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react-native",
|
|
@@ -119,6 +119,7 @@
|
|
|
119
119
|
"./package.json": "./package.json"
|
|
120
120
|
},
|
|
121
121
|
"files": [
|
|
122
|
+
"CHANGELOG.md",
|
|
122
123
|
"dist",
|
|
123
124
|
"src",
|
|
124
125
|
"!src/**/*.test.ts",
|
|
@@ -130,8 +131,8 @@
|
|
|
130
131
|
"provenance": true
|
|
131
132
|
},
|
|
132
133
|
"dependencies": {
|
|
133
|
-
"@hozo/behaviors": "^0.
|
|
134
|
-
"@hozo/engine": "^0.
|
|
134
|
+
"@hozo/behaviors": "^0.2.0",
|
|
135
|
+
"@hozo/engine": "^0.2.0"
|
|
135
136
|
},
|
|
136
137
|
"peerDependencies": {
|
|
137
138
|
"react": "^19.0.0",
|
package/src/flat-list.native.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createElement,
|
|
1
|
+
import { createElement, type ReactElement, type Ref, useMemo } from 'react'
|
|
2
2
|
import * as ReactNative from 'react-native'
|
|
3
3
|
|
|
4
4
|
// Its own module rather than part of the index, because the index starts
|
|
@@ -10,27 +10,24 @@ export type HozoFlatListProps<T> = ReactNative.FlatListProps<T>
|
|
|
10
10
|
export type HozoFlatListHandle<T = unknown> = ReactNative.FlatList<T>
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
13
|
+
* Where a cell sits in the collection Android thinks it is in.
|
|
14
14
|
*
|
|
15
|
-
* `AccessibilityNodeInfo.
|
|
16
|
-
*
|
|
17
|
-
* things in it.
|
|
15
|
+
* `AccessibilityNodeInfo.setCollectionItemInfo`, read by
|
|
16
|
+
* `ReactAccessibilityDelegate.kt:107`.
|
|
18
17
|
*
|
|
19
18
|
* Typed here because React Native does not type it. The props are real --
|
|
20
19
|
* `BaseViewConfig.android.js` registers `accessibilityCollection` and
|
|
21
|
-
* `accessibilityCollectionItem` as native props
|
|
22
|
-
* them as tags
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
20
|
+
* `accessibilityCollectionItem` as native props and `BaseViewManager`
|
|
21
|
+
* stores them as tags -- but they appear in no `.d.ts` and in no
|
|
22
|
+
* documentation, so nothing that does not go looking for them will find
|
|
23
|
+
* them. The tracking issue for the capability, facebook/react-native#30977,
|
|
24
|
+
* is closed: the native half shipped and no React Native component was ever
|
|
25
|
+
* wired to it.
|
|
26
|
+
*
|
|
27
|
+
* `AndroidCollection`, the list-level counterpart, was here too. It is gone
|
|
28
|
+
* with the prop that used it; see the note in `HozoFlatList` for what it
|
|
29
|
+
* held and why.
|
|
26
30
|
*/
|
|
27
|
-
interface AndroidCollection {
|
|
28
|
-
itemCount: number
|
|
29
|
-
rowCount: number
|
|
30
|
-
columnCount: number
|
|
31
|
-
hierarchical: boolean
|
|
32
|
-
}
|
|
33
|
-
|
|
34
31
|
interface AndroidCollectionItem {
|
|
35
32
|
rowIndex: number
|
|
36
33
|
columnIndex: number
|
|
@@ -104,28 +101,68 @@ function collectionCell(columns: number) {
|
|
|
104
101
|
}
|
|
105
102
|
}
|
|
106
103
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
104
|
+
/**
|
|
105
|
+
* React Native's `FlatList`, with each cell told where it sits.
|
|
106
|
+
*
|
|
107
|
+
* It used to be told how long it was as well, which is the thing a windowed
|
|
108
|
+
* list cannot say for itself: only the rows near the viewport exist as
|
|
109
|
+
* views, so TalkBack counts those. On the Web the answer is `aria-setsize`.
|
|
110
|
+
* Here it was `accessibilityCollection`, and it is not set any more -- the
|
|
111
|
+
* note below the hooks says why, and what to put back.
|
|
112
|
+
*/
|
|
113
|
+
export function HozoFlatList<T>(
|
|
114
|
+
props: HozoFlatListProps<T> & { ref?: Ref<ReactNative.FlatList<T>> },
|
|
110
115
|
): ReactElement {
|
|
111
|
-
const { data, numColumns, CellRendererComponent, ...rest } = props
|
|
116
|
+
const { data, numColumns, CellRendererComponent, ref: forwardedRef, ...rest } = props
|
|
112
117
|
const android = isAndroid()
|
|
113
118
|
const columns = Math.max(1, Math.floor(numColumns ?? 1))
|
|
114
|
-
const count = data?.length ?? 0
|
|
115
119
|
|
|
116
120
|
// A component identity that only changes when the column count does. A
|
|
117
121
|
// fresh one every render would remount every cell in the list.
|
|
118
122
|
const cell = useMemo(() => collectionCell(columns), [columns])
|
|
119
123
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
124
|
+
// `accessibilityCollection` is not set, and the list no longer says how
|
|
125
|
+
// long it is. It used to, and a device heard it: "Button, In list Hozo
|
|
126
|
+
// native acceptance screen, 3 items".
|
|
127
|
+
//
|
|
128
|
+
// It crashes the app (#512). React Native's own delegate reads the tag
|
|
129
|
+
// this sets, then walks the content view's children reading each one's
|
|
130
|
+
// `accessibility_collection_item`:
|
|
131
|
+
//
|
|
132
|
+
// // ReactScrollViewAccessibilityDelegate.kt
|
|
133
|
+
// :56 view.getTag(R.id.accessibility_collection) as? ReadableMap ?: return
|
|
134
|
+
// :74 nextChild.getTag(R.id.accessibility_collection_item) as ReadableMap
|
|
135
|
+
// :88 nestedNextChild.getTag(R.id.accessibility_collection_item) as? ReadableMap
|
|
136
|
+
//
|
|
137
|
+
// Line 74 is the only one of the four reads in that file with a non-null
|
|
138
|
+
// cast, two lines above a comment describing the null it forbids. Any
|
|
139
|
+
// child without the tag throws `NullPointerException: null cannot be cast
|
|
140
|
+
// to non-null type ReadableMap`, and in a release build that is the
|
|
141
|
+
// process. Still unfixed on `main` and on `0.87-stable`.
|
|
142
|
+
//
|
|
143
|
+
// Not every child can have the tag. `VirtualizedList` pushes its own
|
|
144
|
+
// `<View key={`$spacer-…`} style={…} />` for the windowed-away regions,
|
|
145
|
+
// and a list header, footer or empty component is a plain child too. The
|
|
146
|
+
// spacers are the reason this cannot be narrowed to "lists without a
|
|
147
|
+
// header": any list long enough to window has them.
|
|
148
|
+
//
|
|
149
|
+
// Line 56 returns early when the tag is absent, so not setting it is what
|
|
150
|
+
// makes the rest unreachable. The cells keep their
|
|
151
|
+
// `accessibilityCollectionItem` -- `ReactAccessibilityDelegate.kt:107`
|
|
152
|
+
// reads that one as `as ReadableMap?` and is not part of this -- so
|
|
153
|
+
// restoring the announcement is putting this back:
|
|
154
|
+
//
|
|
155
|
+
// const collection: AndroidCollection | undefined = android
|
|
156
|
+
// ? {
|
|
157
|
+
// itemCount: count,
|
|
158
|
+
// rowCount: Math.ceil(count / columns),
|
|
159
|
+
// columnCount: columns,
|
|
160
|
+
// hierarchical: false,
|
|
161
|
+
// }
|
|
162
|
+
// : undefined
|
|
163
|
+
//
|
|
164
|
+
// and `accessibilityCollection: collection` below, once a React Native
|
|
165
|
+
// with `as?` on line 74 is the floor.
|
|
129
166
|
return createElement(
|
|
130
167
|
ReactNative.FlatList as unknown as never,
|
|
131
168
|
{
|
|
@@ -133,26 +170,11 @@ function HozoFlatListInner<T>(
|
|
|
133
170
|
data,
|
|
134
171
|
numColumns,
|
|
135
172
|
ref: forwardedRef,
|
|
136
|
-
accessibilityCollection: collection,
|
|
137
173
|
// The caller's own cell renderer wins. Composing would put one view
|
|
138
174
|
// inside another and hand the outer one the handlers the inner one
|
|
139
|
-
// needs; deferring means the
|
|
140
|
-
// the per-item position is left unsaid.
|
|
175
|
+
// needs; deferring means only the per-item position is left unsaid.
|
|
141
176
|
CellRendererComponent:
|
|
142
177
|
CellRendererComponent ?? (android ? (cell as unknown as never) : undefined),
|
|
143
178
|
} as never,
|
|
144
179
|
)
|
|
145
180
|
}
|
|
146
|
-
|
|
147
|
-
/**
|
|
148
|
-
* React Native's `FlatList`, told how long it is.
|
|
149
|
-
*
|
|
150
|
-
* A windowed list has a length its accessibility tree does not: only the
|
|
151
|
-
* rows near the viewport exist as views, so TalkBack counts those and
|
|
152
|
-
* announces them. On the Web the answer is `aria-setsize`; here it is
|
|
153
|
-
* `accessibilityCollection`, and neither is something an app should have to
|
|
154
|
-
* write itself when the list already knows.
|
|
155
|
-
*/
|
|
156
|
-
export const HozoFlatList = forwardRef(HozoFlatListInner) as <T>(
|
|
157
|
-
props: HozoFlatListProps<T> & { ref?: Ref<ReactNative.FlatList<T>> },
|
|
158
|
-
) => ReactElement
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { hozoTextChildren } from '@hozo/behaviors'
|
|
2
2
|
import { HozoTextSizeContext } from '@hozo/engine'
|
|
3
|
-
import React, { type ComponentType, type ReactNode } from 'react'
|
|
3
|
+
import React, { type ComponentType, type ReactNode, type Ref } from 'react'
|
|
4
4
|
import {
|
|
5
5
|
type AccessibilityRole,
|
|
6
|
+
type HostInstance,
|
|
6
7
|
Pressable as RNPressable,
|
|
7
8
|
type PressableProps as RNPressableProps,
|
|
8
9
|
Text as RNText,
|
|
@@ -46,6 +47,20 @@ export function Text({ children, style, ...props }: TextProps) {
|
|
|
46
47
|
}
|
|
47
48
|
|
|
48
49
|
export interface PressableProps extends RNPressableProps {
|
|
50
|
+
/**
|
|
51
|
+
* The view this press target lands on.
|
|
52
|
+
*
|
|
53
|
+
* Declared rather than inherited, because React Native's own
|
|
54
|
+
* `PressableProps` does not carry it: the `ref` is on the *component*
|
|
55
|
+
* (`(props: Omit<PressableProps, 'ref'> & { ref?: Ref<PressableInstance> })`),
|
|
56
|
+
* so a wrapper whose props are `PressableProps` rejects one. It is spread
|
|
57
|
+
* through to `RNPressable` below either way -- this only stops TypeScript
|
|
58
|
+
* refusing what already worked.
|
|
59
|
+
*
|
|
60
|
+
* A caller needs it to hand the control to something else: `Dialog`'s
|
|
61
|
+
* `restoreFocusTo` is where this came up (#462).
|
|
62
|
+
*/
|
|
63
|
+
ref?: Ref<HostInstance>
|
|
49
64
|
href?: string
|
|
50
65
|
external?: boolean
|
|
51
66
|
replace?: boolean
|
package/src/index.native.ts
CHANGED
|
@@ -22,3 +22,5 @@ export type { HozoFlatListRenderInfo as FlatListRenderInfo } from './index.ts'
|
|
|
22
22
|
export { HozoFlatList as FlatList, HozoScrollView as ScrollView }
|
|
23
23
|
export type FlatListProps<T> = import('./flat-list.native.tsx').HozoFlatListProps<T>
|
|
24
24
|
export type ScrollViewProps = HozoScrollViewProps
|
|
25
|
+
|
|
26
|
+
export { Presence, type PresenceProps } from './presence.native.tsx'
|