@solidrt/components 0.0.65 → 0.0.67
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 +1 -1
- package/docs/window.md +1 -1
- package/package.json +2 -2
- package/src/carousel.tsx +5 -0
- package/src/context-menu.tsx +1 -0
- package/src/dismissible.tsx +4 -0
- package/src/editor-field.tsx +4 -2
- package/src/image.tsx +1 -0
- package/src/press.ts +7 -1
- package/src/pressable.tsx +1 -0
- package/src/scroll-view.tsx +4 -0
- package/src/segmented-control.tsx +1 -0
- package/src/slider.tsx +4 -2
- package/src/text.tsx +1 -0
- package/src/view.tsx +1 -0
- package/src/window.tsx +1 -0
package/README.md
CHANGED
|
@@ -195,7 +195,7 @@ function App() {
|
|
|
195
195
|
}
|
|
196
196
|
```
|
|
197
197
|
|
|
198
|
-
The window takes the theme's finish (see Theming) whenever the theme has one; a theme without a finish declares no shader at all. `shader` is the window's own finish, a core window shader declaration forwarded as-is; set, it replaces the theme's, and `shader={null}` opts out of it. A window shader runs past the point snapshots read, so a finish is checked with `
|
|
198
|
+
The window takes the theme's finish (see Theming) whenever the theme has one; a theme without a finish declares no shader at all. `shader` is the window's own finish, a core window shader declaration forwarded as-is; set, it replaces the theme's, and `shader={null}` opts out of it. A window shader runs past the point snapshots read, so a finish is checked with `sol render`, not `get_snapshot`.
|
|
199
199
|
|
|
200
200
|
API: `Window`, `WindowProps` - typed and commented in [src/window.tsx](./src/window.tsx).
|
|
201
201
|
|
package/docs/window.md
CHANGED
|
@@ -14,4 +14,4 @@ function App() {
|
|
|
14
14
|
}
|
|
15
15
|
```
|
|
16
16
|
|
|
17
|
-
The window takes the theme's finish (see Theming) whenever the theme has one; a theme without a finish declares no shader at all. `shader` is the window's own finish, a core window shader declaration forwarded as-is; set, it replaces the theme's, and `shader={null}` opts out of it. A window shader runs past the point snapshots read, so a finish is checked with `
|
|
17
|
+
The window takes the theme's finish (see Theming) whenever the theme has one; a theme without a finish declares no shader at all. `shader` is the window's own finish, a core window shader declaration forwarded as-is; set, it replaces the theme's, and `shader={null}` opts out of it. A window shader runs past the point snapshots read, so a finish is checked with `sol render`, not `get_snapshot`.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solidrt/components",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.67",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"funding": "https://github.com/sponsors/wellawaretech",
|
|
6
6
|
"author": "Antoine van Wel",
|
|
@@ -21,6 +21,6 @@
|
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|
|
23
23
|
"@solidjs/signals": "2.0.0-rc.13",
|
|
24
|
-
"@solidrt/core": "0.0.
|
|
24
|
+
"@solidrt/core": "0.0.67"
|
|
25
25
|
}
|
|
26
26
|
}
|
package/src/carousel.tsx
CHANGED
|
@@ -66,6 +66,11 @@ export function Carousel(props: CarouselProps) {
|
|
|
66
66
|
setDrag(0)
|
|
67
67
|
setDragging(false)
|
|
68
68
|
},
|
|
69
|
+
// The page in view stays: the drag snaps back.
|
|
70
|
+
onSwipeCancel: () => {
|
|
71
|
+
setDrag(0)
|
|
72
|
+
setDragging(false)
|
|
73
|
+
},
|
|
69
74
|
})
|
|
70
75
|
|
|
71
76
|
let split = () => splitTransition(props.transition)
|
package/src/context-menu.tsx
CHANGED
|
@@ -184,6 +184,7 @@ export function ContextMenu(props: ContextMenuProps) {
|
|
|
184
184
|
onPointerDown={handleDown}
|
|
185
185
|
onPointerMove={longPress.handlers.onPointerMove}
|
|
186
186
|
onPointerUp={longPress.handlers.onPointerUp}
|
|
187
|
+
onPointerCancel={longPress.handlers.onPointerCancel}
|
|
187
188
|
{...props.layout}
|
|
188
189
|
>
|
|
189
190
|
{props.children}
|
package/src/dismissible.tsx
CHANGED
package/src/editor-field.tsx
CHANGED
|
@@ -235,7 +235,8 @@ export function EditorField(props: EditorFieldProps) {
|
|
|
235
235
|
}
|
|
236
236
|
}
|
|
237
237
|
|
|
238
|
-
|
|
238
|
+
// A lift or a cancel: the selection drag ends where it is.
|
|
239
|
+
let handleViewportPointerEnd = (e: PointerEvent) => {
|
|
239
240
|
if (dragArmed === e.pointerId) dragArmed = null
|
|
240
241
|
if (dragActive === e.pointerId) {
|
|
241
242
|
arena.release(e.pointerId, dragOwner)
|
|
@@ -523,7 +524,8 @@ export function EditorField(props: EditorFieldProps) {
|
|
|
523
524
|
scrollY={editor.scrollY()}
|
|
524
525
|
onPointerDown={handleViewportPointerDown}
|
|
525
526
|
onPointerMove={handleViewportPointerMove}
|
|
526
|
-
onPointerUp={
|
|
527
|
+
onPointerUp={handleViewportPointerEnd}
|
|
528
|
+
onPointerCancel={handleViewportPointerEnd}
|
|
527
529
|
>
|
|
528
530
|
{showPlaceholder() ? (
|
|
529
531
|
<d-text w={PLACEHOLDER_SHAPE_WIDTH} {...font()} color={theme.color.textMuted} maxLines={1}>
|
package/src/image.tsx
CHANGED
|
@@ -89,6 +89,7 @@ export function Image(props: ImageProps) {
|
|
|
89
89
|
onPointerLeave={props.onPointerLeave}
|
|
90
90
|
onPointerDown={props.onPointerDown}
|
|
91
91
|
onPointerUp={props.onPointerUp}
|
|
92
|
+
onPointerCancel={props.onPointerCancel}
|
|
92
93
|
onPointerMove={props.onPointerMove}
|
|
93
94
|
onWheel={props.onWheel}
|
|
94
95
|
onFocus={props.onFocus}
|
package/src/press.ts
CHANGED
|
@@ -19,6 +19,7 @@ export interface PressOptions {
|
|
|
19
19
|
disabled?: boolean
|
|
20
20
|
onPointerDown?: (e: PointerEvent) => void
|
|
21
21
|
onPointerUp?: (e: PointerEvent) => void
|
|
22
|
+
onPointerCancel?: (e: PointerEvent) => void
|
|
22
23
|
onPointerMove?: (e: PointerEvent) => void
|
|
23
24
|
onPointerEnter?: (e: PointerEvent) => void
|
|
24
25
|
onPointerLeave?: (e: PointerEvent) => void
|
|
@@ -43,7 +44,8 @@ export interface PressOptions {
|
|
|
43
44
|
// when the firing waits for that recognizer to fail (the double-tap
|
|
44
45
|
// window passing) and is dropped when it wins. Enter/leave drive hover
|
|
45
46
|
// alone. Non-primary buttons (right/middle) do not start a press. cancel() is
|
|
46
|
-
// the external-cancel hook; it
|
|
47
|
+
// the external-cancel hook; it and a pointer cancel (the system taking the
|
|
48
|
+
// touch away) end the press without firing. Options are read
|
|
47
49
|
// at event time, so passing a component's reactive props object keeps handler
|
|
48
50
|
// changes live. The host view must attach `ref` for retention bounds; without
|
|
49
51
|
// it every position counts as inside (the up always fires).
|
|
@@ -190,6 +192,10 @@ export function createPress(options: PressOptions) {
|
|
|
190
192
|
}
|
|
191
193
|
options.onPointerUp?.(e)
|
|
192
194
|
},
|
|
195
|
+
onPointerCancel: (e: PointerEvent) => {
|
|
196
|
+
if (active === e.pointerId) cancel()
|
|
197
|
+
options.onPointerCancel?.(e)
|
|
198
|
+
},
|
|
193
199
|
onPointerEnter: (e: PointerEvent) => {
|
|
194
200
|
setHovered(true)
|
|
195
201
|
options.onPointerEnter?.(e)
|
package/src/pressable.tsx
CHANGED
|
@@ -80,6 +80,7 @@ export function Pressable(props: PressableProps) {
|
|
|
80
80
|
onPointerLeave={press.handlers.onPointerLeave}
|
|
81
81
|
onPointerDown={press.handlers.onPointerDown}
|
|
82
82
|
onPointerUp={press.handlers.onPointerUp}
|
|
83
|
+
onPointerCancel={press.handlers.onPointerCancel}
|
|
83
84
|
onPointerMove={press.handlers.onPointerMove}
|
|
84
85
|
onWheel={props.onWheel}
|
|
85
86
|
onFocus={press.handlers.onFocus}
|
package/src/scroll-view.tsx
CHANGED
|
@@ -97,6 +97,8 @@ export function ScrollView(props: ScrollViewProps) {
|
|
|
97
97
|
setFling(true)
|
|
98
98
|
scroll.scrollTo(props.horizontal ? { x: dest } : { y: dest })
|
|
99
99
|
},
|
|
100
|
+
// The content stays where the finger left it: nothing flings.
|
|
101
|
+
onPanCancel: () => setDragging(false),
|
|
100
102
|
})
|
|
101
103
|
// A finger landing (any down, a tap included) holds a moving list where
|
|
102
104
|
// it is: the animated offset, read back from the boxes (window-relative,
|
|
@@ -193,6 +195,7 @@ export function ScrollView(props: ScrollViewProps) {
|
|
|
193
195
|
onPointerLeave={props.onPointerLeave}
|
|
194
196
|
onPointerDown={props.onPointerDown}
|
|
195
197
|
onPointerUp={props.onPointerUp}
|
|
198
|
+
onPointerCancel={props.onPointerCancel}
|
|
196
199
|
onPointerMove={props.onPointerMove}
|
|
197
200
|
onWheel={props.onWheel}
|
|
198
201
|
pointerEvents={props.pointerEvents}
|
|
@@ -221,6 +224,7 @@ export function ScrollView(props: ScrollViewProps) {
|
|
|
221
224
|
onPointerDown={hold}
|
|
222
225
|
onPointerMove={pan.handlers.onPointerMove}
|
|
223
226
|
onPointerUp={pan.handlers.onPointerUp}
|
|
227
|
+
onPointerCancel={pan.handlers.onPointerCancel}
|
|
224
228
|
onWheel={onWheel}
|
|
225
229
|
>
|
|
226
230
|
<view ref={(n: { id: number }) => (content = n)} flexShrink={0} flexDirection={direction()}>
|
|
@@ -208,6 +208,7 @@ export function SegmentedControl<T>(props: SegmentedControlProps<T>) {
|
|
|
208
208
|
onPress: () => select(opt.value),
|
|
209
209
|
onPointerDown: () => setPressedValue(() => opt.value),
|
|
210
210
|
onPointerUp: () => setPressedValue(undefined),
|
|
211
|
+
onPointerCancel: () => setPressedValue(undefined),
|
|
211
212
|
})
|
|
212
213
|
onCleanup(() => segs.delete(opt.value))
|
|
213
214
|
return (
|
package/src/slider.tsx
CHANGED
|
@@ -122,7 +122,8 @@ export function Slider(props: SliderProps) {
|
|
|
122
122
|
if (active !== e.pointerId) return
|
|
123
123
|
setFromLocalX(e.localX)
|
|
124
124
|
}
|
|
125
|
-
|
|
125
|
+
// A lift or a cancel: the drag ends where the thumb is.
|
|
126
|
+
let handleEnd = (e: PointerEvent) => {
|
|
126
127
|
if (active === e.pointerId) endDrag()
|
|
127
128
|
}
|
|
128
129
|
|
|
@@ -161,7 +162,8 @@ export function Slider(props: SliderProps) {
|
|
|
161
162
|
focusable={!props.disabled}
|
|
162
163
|
onPointerDown={handleDown}
|
|
163
164
|
onPointerMove={handleMove}
|
|
164
|
-
onPointerUp={
|
|
165
|
+
onPointerUp={handleEnd}
|
|
166
|
+
onPointerCancel={handleEnd}
|
|
165
167
|
onKeyDown={handleKeyDown}
|
|
166
168
|
>
|
|
167
169
|
{/* Colors fade with the theme; the fill's w and the thumb's x never
|
package/src/text.tsx
CHANGED
|
@@ -68,6 +68,7 @@ export function Text(props: TextProps) {
|
|
|
68
68
|
onPointerLeave={props.onPointerLeave}
|
|
69
69
|
onPointerDown={props.onPointerDown}
|
|
70
70
|
onPointerUp={props.onPointerUp}
|
|
71
|
+
onPointerCancel={props.onPointerCancel}
|
|
71
72
|
onPointerMove={props.onPointerMove}
|
|
72
73
|
onWheel={props.onWheel}
|
|
73
74
|
onFocus={props.onFocus}
|
package/src/view.tsx
CHANGED
|
@@ -40,6 +40,7 @@ export function View(props: ViewProps) {
|
|
|
40
40
|
onPointerLeave={props.onPointerLeave}
|
|
41
41
|
onPointerDown={props.onPointerDown}
|
|
42
42
|
onPointerUp={props.onPointerUp}
|
|
43
|
+
onPointerCancel={props.onPointerCancel}
|
|
43
44
|
onPointerMove={props.onPointerMove}
|
|
44
45
|
onWheel={props.onWheel}
|
|
45
46
|
onFocus={props.onFocus}
|
package/src/window.tsx
CHANGED
|
@@ -45,6 +45,7 @@ export function Window(props: WindowProps) {
|
|
|
45
45
|
onPointerLeave={props.onPointerLeave}
|
|
46
46
|
onPointerDown={props.onPointerDown}
|
|
47
47
|
onPointerUp={props.onPointerUp}
|
|
48
|
+
onPointerCancel={props.onPointerCancel}
|
|
48
49
|
onPointerMove={props.onPointerMove}
|
|
49
50
|
onWheel={props.onWheel}
|
|
50
51
|
onFocus={props.onFocus}
|