@colixsystems/widget-sdk 0.354.0 → 0.355.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 +6 -2
- package/dist/contract.cjs +6 -4
- package/dist/contract.js +6 -4
- package/dist/index.d.ts +4 -0
- package/dist/nested-scroll-props.js +12 -0
- package/dist/primitives.native.js +2 -3
- package/dist/scroll-view.js +3 -3
- package/dist/scrollers.native.js +20 -0
- package/package.json +1 -1
- package/src/contract.js +6 -4
package/README.md
CHANGED
|
@@ -91,7 +91,11 @@ See the design reference for the full architecture: [`docs/architecture/widget-m
|
|
|
91
91
|
|
|
92
92
|
## Status
|
|
93
93
|
|
|
94
|
-
`v0.
|
|
94
|
+
`v0.355.0` — pre-publish. The package surface (types, function names, export paths) is the v1 contract; runtime behaviour for some hooks is stubbed (each hook documents what's wired and what isn't). It is **not yet published to npm**.
|
|
95
|
+
|
|
96
|
+
### What's new in 0.355.0 (contract 1.291.0)
|
|
97
|
+
|
|
98
|
+
**A list scrolls inside a scrolling page on Android.** A vertical `ScrollView`, `FlatList` or `SectionList` from this SDK now sets `nestedScrollEnabled` on native. Without it Android gives every vertical drag to the page, so a list with a fixed or maximum height never moved. Pass `nestedScrollEnabled={false}` to leave the drag to the page. An `inverted` list is left as it was: Android flips it, so it would scroll the page the wrong way; put it in a Fit to screen section. A `@shopify/flash-list` list, or a scroller imported from `react-native`, must set the prop itself. Installed apps pick it up with their next native build.
|
|
95
99
|
|
|
96
100
|
### What's new in 0.354.0 (contract 1.290.0)
|
|
97
101
|
|
|
@@ -3607,7 +3611,7 @@ Also: `useFileSignatures(fileIds)` is now **self-scoped** (the caller's own sign
|
|
|
3607
3611
|
- **`react-native-reanimated`** (`web`/`native`) — declarative animations.
|
|
3608
3612
|
- **`react-native-gesture-handler`** (`web`/`native`) — native-driven touch gestures.
|
|
3609
3613
|
- **`react-native-safe-area-context`** (`web`/`native`) — safe-area insets.
|
|
3610
|
-
- **`@shopify/flash-list`** (`web`/`native`) — high-performance virtualised list.
|
|
3614
|
+
- **`@shopify/flash-list`** (`web`/`native`) — high-performance virtualised list. Pass `nestedScrollEnabled` so it scrolls inside a scrolling page on Android.
|
|
3611
3615
|
- **`react-native-paper`** (`web`/`native`) — Material Design components.
|
|
3612
3616
|
- **`react-native-vector-icons`** (`web`/`native`) — icon font families.
|
|
3613
3617
|
- **`@react-native-community/slider`** (`web`/`native`) — slider input.
|
package/dist/contract.cjs
CHANGED
|
@@ -3638,7 +3638,7 @@ const PRIMITIVES = [
|
|
|
3638
3638
|
{
|
|
3639
3639
|
name: "ScrollView",
|
|
3640
3640
|
description:
|
|
3641
|
-
"Scrollable container. Pass `horizontal` to scroll on the x-axis. On the web, a horizontal row whose content overflows shows mouse users that it scrolls: the edge with more content fades, and hovering shows previous / next arrows that scroll about one view width. Touch screens and the exported app swipe as before, and a row that fits shows nothing. Pass `showsScrollAffordance={false}` only when the widget draws its own arrows. A short set of chips is better wrapped in a `<ChipGroup>` than scrolled. See https://reactnative.dev/docs/scrollview.",
|
|
3641
|
+
"Scrollable container. Pass `horizontal` to scroll on the x-axis. On the web, a horizontal row whose content overflows shows mouse users that it scrolls: the edge with more content fades, and hovering shows previous / next arrows that scroll about one view width. Touch screens and the exported app swipe as before, and a row that fits shows nothing. Pass `showsScrollAffordance={false}` only when the widget draws its own arrows. A short set of chips is better wrapped in a `<ChipGroup>` than scrolled. A vertical `ScrollView`, `FlatList` or `SectionList` from this SDK scrolls inside a scrolling page on Android too: it sets `nestedScrollEnabled` unless it is `inverted` or you pass `false`. One imported from `react-native` does not. See https://reactnative.dev/docs/scrollview.",
|
|
3642
3642
|
rnComponent: "ScrollView",
|
|
3643
3643
|
docsUrl: "https://reactnative.dev/docs/scrollview",
|
|
3644
3644
|
},
|
|
@@ -4999,7 +4999,7 @@ const VETTED_IMPORTS = [
|
|
|
4999
4999
|
platforms: ["web", "native"],
|
|
5000
5000
|
category: "primitive",
|
|
5001
5001
|
description:
|
|
5002
|
-
"Direct RN imports for APIs the SDK hasn't re-exported yet. On web `react-native` is host-resolved to the host's single react-native-web instance (external, shimmed) — NOT aliased at bundle time — so a bundled widget shares the host's RN-web (one StyleSheet/context, no double-instance conflicts). On native Metro resolves the real library.",
|
|
5002
|
+
"Direct RN imports for APIs the SDK hasn't re-exported yet. Take `ScrollView`, `FlatList` and `SectionList` from the SDK: React Native's own do not scroll inside a scrolling page on Android unless you pass `nestedScrollEnabled`. On web `react-native` is host-resolved to the host's single react-native-web instance (external, shimmed) — NOT aliased at bundle time — so a bundled widget shares the host's RN-web (one StyleSheet/context, no double-instance conflicts). On native Metro resolves the real library.",
|
|
5003
5003
|
},
|
|
5004
5004
|
{
|
|
5005
5005
|
specifier: "axios",
|
|
@@ -5146,7 +5146,7 @@ const VETTED_IMPORTS = [
|
|
|
5146
5146
|
platforms: ["web", "native"],
|
|
5147
5147
|
category: "list",
|
|
5148
5148
|
description:
|
|
5149
|
-
"High-performance virtualised list with a FlatList-compatible API. Prefer it over FlatList for long datasets; renders on both platforms.",
|
|
5149
|
+
"High-performance virtualised list with a FlatList-compatible API. Prefer it over FlatList for long datasets; renders on both platforms. Pass `nestedScrollEnabled`, or a vertical one does not scroll inside a scrolling page on Android.",
|
|
5150
5150
|
},
|
|
5151
5151
|
{
|
|
5152
5152
|
specifier: "react-native-paper",
|
|
@@ -7200,7 +7200,9 @@ const CONTRACT = deepFreeze({
|
|
|
7200
7200
|
// 1.290.0: stricter lint (sc-17804) — the app's button colours paint the
|
|
7201
7201
|
// primary `<Button>` only, and a literal `variant` the button does not
|
|
7202
7202
|
// draw is the publish-blocking `button-unknown-variant` finding.
|
|
7203
|
-
|
|
7203
|
+
// 1.291.0: behaviour (sc-18689) — a vertical native `ScrollView`, `FlatList`
|
|
7204
|
+
// or `SectionList` sets `nestedScrollEnabled` unless inverted or the author sets it.
|
|
7205
|
+
version: "1.291.0",
|
|
7204
7206
|
sharedTranslationKeys: SHARED_TRANSLATION_KEYS,
|
|
7205
7207
|
hooks: HOOKS,
|
|
7206
7208
|
primitives: PRIMITIVES,
|
package/dist/contract.js
CHANGED
|
@@ -3633,7 +3633,7 @@ const PRIMITIVES = [
|
|
|
3633
3633
|
{
|
|
3634
3634
|
name: "ScrollView",
|
|
3635
3635
|
description:
|
|
3636
|
-
"Scrollable container. Pass `horizontal` to scroll on the x-axis. On the web, a horizontal row whose content overflows shows mouse users that it scrolls: the edge with more content fades, and hovering shows previous / next arrows that scroll about one view width. Touch screens and the exported app swipe as before, and a row that fits shows nothing. Pass `showsScrollAffordance={false}` only when the widget draws its own arrows. A short set of chips is better wrapped in a `<ChipGroup>` than scrolled. See https://reactnative.dev/docs/scrollview.",
|
|
3636
|
+
"Scrollable container. Pass `horizontal` to scroll on the x-axis. On the web, a horizontal row whose content overflows shows mouse users that it scrolls: the edge with more content fades, and hovering shows previous / next arrows that scroll about one view width. Touch screens and the exported app swipe as before, and a row that fits shows nothing. Pass `showsScrollAffordance={false}` only when the widget draws its own arrows. A short set of chips is better wrapped in a `<ChipGroup>` than scrolled. A vertical `ScrollView`, `FlatList` or `SectionList` from this SDK scrolls inside a scrolling page on Android too: it sets `nestedScrollEnabled` unless it is `inverted` or you pass `false`. One imported from `react-native` does not. See https://reactnative.dev/docs/scrollview.",
|
|
3637
3637
|
rnComponent: "ScrollView",
|
|
3638
3638
|
docsUrl: "https://reactnative.dev/docs/scrollview",
|
|
3639
3639
|
},
|
|
@@ -4994,7 +4994,7 @@ const VETTED_IMPORTS = [
|
|
|
4994
4994
|
platforms: ["web", "native"],
|
|
4995
4995
|
category: "primitive",
|
|
4996
4996
|
description:
|
|
4997
|
-
"Direct RN imports for APIs the SDK hasn't re-exported yet. On web `react-native` is host-resolved to the host's single react-native-web instance (external, shimmed) — NOT aliased at bundle time — so a bundled widget shares the host's RN-web (one StyleSheet/context, no double-instance conflicts). On native Metro resolves the real library.",
|
|
4997
|
+
"Direct RN imports for APIs the SDK hasn't re-exported yet. Take `ScrollView`, `FlatList` and `SectionList` from the SDK: React Native's own do not scroll inside a scrolling page on Android unless you pass `nestedScrollEnabled`. On web `react-native` is host-resolved to the host's single react-native-web instance (external, shimmed) — NOT aliased at bundle time — so a bundled widget shares the host's RN-web (one StyleSheet/context, no double-instance conflicts). On native Metro resolves the real library.",
|
|
4998
4998
|
},
|
|
4999
4999
|
{
|
|
5000
5000
|
specifier: "axios",
|
|
@@ -5141,7 +5141,7 @@ const VETTED_IMPORTS = [
|
|
|
5141
5141
|
platforms: ["web", "native"],
|
|
5142
5142
|
category: "list",
|
|
5143
5143
|
description:
|
|
5144
|
-
"High-performance virtualised list with a FlatList-compatible API. Prefer it over FlatList for long datasets; renders on both platforms.",
|
|
5144
|
+
"High-performance virtualised list with a FlatList-compatible API. Prefer it over FlatList for long datasets; renders on both platforms. Pass `nestedScrollEnabled`, or a vertical one does not scroll inside a scrolling page on Android.",
|
|
5145
5145
|
},
|
|
5146
5146
|
{
|
|
5147
5147
|
specifier: "react-native-paper",
|
|
@@ -7195,7 +7195,9 @@ const CONTRACT = deepFreeze({
|
|
|
7195
7195
|
// 1.290.0: stricter lint (sc-17804) — the app's button colours paint the
|
|
7196
7196
|
// primary `<Button>` only, and a literal `variant` the button does not
|
|
7197
7197
|
// draw is the publish-blocking `button-unknown-variant` finding.
|
|
7198
|
-
|
|
7198
|
+
// 1.291.0: behaviour (sc-18689) — a vertical native `ScrollView`, `FlatList`
|
|
7199
|
+
// or `SectionList` sets `nestedScrollEnabled` unless inverted or the author sets it.
|
|
7200
|
+
version: "1.291.0",
|
|
7199
7201
|
sharedTranslationKeys: SHARED_TRANSLATION_KEYS,
|
|
7200
7202
|
hooks: HOOKS,
|
|
7201
7203
|
primitives: PRIMITIVES,
|
package/dist/index.d.ts
CHANGED
|
@@ -4421,6 +4421,10 @@ export const Image: any;
|
|
|
4421
4421
|
* scroll about one view width. Touch screens and the exported app are
|
|
4422
4422
|
* unchanged; keyboard and shift-wheel scrolling keep working. Pass false
|
|
4423
4423
|
* only when the widget draws its own arrows.
|
|
4424
|
+
*
|
|
4425
|
+
* On native a vertical ScrollView, FlatList or SectionList sets
|
|
4426
|
+
* `nestedScrollEnabled` unless inverted or you pass it, so it scrolls inside a scrolling
|
|
4427
|
+
* page on Android.
|
|
4424
4428
|
*/
|
|
4425
4429
|
export const ScrollView: any;
|
|
4426
4430
|
export const TextInput: any;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// Android gives a vertical drag to the outermost scroller unless the inner one
|
|
2
|
+
// takes part in nested scrolling, so a list inside a scrolling page never moves.
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* A scroller's props with nested scrolling on, unless horizontal, inverted or
|
|
6
|
+
* set by the author. Android flips an inverted list, so what it leaves over
|
|
7
|
+
* would scroll the page the wrong way.
|
|
8
|
+
*/
|
|
9
|
+
export function nestedScrollProps(props) {
|
|
10
|
+
if (props.horizontal || props.inverted || props.nestedScrollEnabled != null) return props;
|
|
11
|
+
return { ...props, nestedScrollEnabled: true };
|
|
12
|
+
}
|
|
@@ -10,14 +10,13 @@ export {
|
|
|
10
10
|
View,
|
|
11
11
|
Pressable,
|
|
12
12
|
Image,
|
|
13
|
-
ScrollView,
|
|
14
|
-
FlatList,
|
|
15
|
-
SectionList,
|
|
16
13
|
ActivityIndicator,
|
|
17
14
|
Switch,
|
|
18
15
|
StyleSheet,
|
|
19
16
|
Linking,
|
|
20
17
|
} from "react-native";
|
|
18
|
+
// sc-18689 — a vertical one nests inside the page on Android.
|
|
19
|
+
export { ScrollView, FlatList, SectionList } from "./scrollers.native.js";
|
|
21
20
|
// sc-9168 — bounded to the device font-scale cap; no web twin (no such setting).
|
|
22
21
|
export { Text, TextInput } from "./bounded-text.native.js";
|
|
23
22
|
|
package/dist/scroll-view.js
CHANGED
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
// scrollbar is hidden reads as cut off. Where the content overflows, the edge
|
|
4
4
|
// with more content fades out, and hovering shows previous / next arrows.
|
|
5
5
|
//
|
|
6
|
-
// Native
|
|
7
|
-
//
|
|
8
|
-
//
|
|
6
|
+
// Native draws no affordance (./scrollers.native.js): a swipe is the native
|
|
7
|
+
// one. Scrolling is the same capability on both hosts; only the input differs.
|
|
8
|
+
// Touch screens on the web are left unchanged.
|
|
9
9
|
|
|
10
10
|
import React from "react";
|
|
11
11
|
import { useHostTheme, useSdkText } from "./hooks.js";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// sc-18689: the native scrollers. No web twin: a browser nests scrolling itself.
|
|
2
|
+
import React from "react";
|
|
3
|
+
import {
|
|
4
|
+
ScrollView as RNScrollView,
|
|
5
|
+
FlatList as RNFlatList,
|
|
6
|
+
SectionList as RNSectionList,
|
|
7
|
+
} from "react-native";
|
|
8
|
+
import { nestedScrollProps } from "./nested-scroll-props.js";
|
|
9
|
+
|
|
10
|
+
function nested(Base, name) {
|
|
11
|
+
const Scroller = React.forwardRef((props, ref) =>
|
|
12
|
+
React.createElement(Base, { ...nestedScrollProps(props), ref }),
|
|
13
|
+
);
|
|
14
|
+
Scroller.displayName = name;
|
|
15
|
+
return Scroller;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export const ScrollView = nested(RNScrollView, "ScrollView");
|
|
19
|
+
export const FlatList = nested(RNFlatList, "FlatList");
|
|
20
|
+
export const SectionList = nested(RNSectionList, "SectionList");
|
package/package.json
CHANGED
package/src/contract.js
CHANGED
|
@@ -3633,7 +3633,7 @@ const PRIMITIVES = [
|
|
|
3633
3633
|
{
|
|
3634
3634
|
name: "ScrollView",
|
|
3635
3635
|
description:
|
|
3636
|
-
"Scrollable container. Pass `horizontal` to scroll on the x-axis. On the web, a horizontal row whose content overflows shows mouse users that it scrolls: the edge with more content fades, and hovering shows previous / next arrows that scroll about one view width. Touch screens and the exported app swipe as before, and a row that fits shows nothing. Pass `showsScrollAffordance={false}` only when the widget draws its own arrows. A short set of chips is better wrapped in a `<ChipGroup>` than scrolled. See https://reactnative.dev/docs/scrollview.",
|
|
3636
|
+
"Scrollable container. Pass `horizontal` to scroll on the x-axis. On the web, a horizontal row whose content overflows shows mouse users that it scrolls: the edge with more content fades, and hovering shows previous / next arrows that scroll about one view width. Touch screens and the exported app swipe as before, and a row that fits shows nothing. Pass `showsScrollAffordance={false}` only when the widget draws its own arrows. A short set of chips is better wrapped in a `<ChipGroup>` than scrolled. A vertical `ScrollView`, `FlatList` or `SectionList` from this SDK scrolls inside a scrolling page on Android too: it sets `nestedScrollEnabled` unless it is `inverted` or you pass `false`. One imported from `react-native` does not. See https://reactnative.dev/docs/scrollview.",
|
|
3637
3637
|
rnComponent: "ScrollView",
|
|
3638
3638
|
docsUrl: "https://reactnative.dev/docs/scrollview",
|
|
3639
3639
|
},
|
|
@@ -4994,7 +4994,7 @@ const VETTED_IMPORTS = [
|
|
|
4994
4994
|
platforms: ["web", "native"],
|
|
4995
4995
|
category: "primitive",
|
|
4996
4996
|
description:
|
|
4997
|
-
"Direct RN imports for APIs the SDK hasn't re-exported yet. On web `react-native` is host-resolved to the host's single react-native-web instance (external, shimmed) — NOT aliased at bundle time — so a bundled widget shares the host's RN-web (one StyleSheet/context, no double-instance conflicts). On native Metro resolves the real library.",
|
|
4997
|
+
"Direct RN imports for APIs the SDK hasn't re-exported yet. Take `ScrollView`, `FlatList` and `SectionList` from the SDK: React Native's own do not scroll inside a scrolling page on Android unless you pass `nestedScrollEnabled`. On web `react-native` is host-resolved to the host's single react-native-web instance (external, shimmed) — NOT aliased at bundle time — so a bundled widget shares the host's RN-web (one StyleSheet/context, no double-instance conflicts). On native Metro resolves the real library.",
|
|
4998
4998
|
},
|
|
4999
4999
|
{
|
|
5000
5000
|
specifier: "axios",
|
|
@@ -5141,7 +5141,7 @@ const VETTED_IMPORTS = [
|
|
|
5141
5141
|
platforms: ["web", "native"],
|
|
5142
5142
|
category: "list",
|
|
5143
5143
|
description:
|
|
5144
|
-
"High-performance virtualised list with a FlatList-compatible API. Prefer it over FlatList for long datasets; renders on both platforms.",
|
|
5144
|
+
"High-performance virtualised list with a FlatList-compatible API. Prefer it over FlatList for long datasets; renders on both platforms. Pass `nestedScrollEnabled`, or a vertical one does not scroll inside a scrolling page on Android.",
|
|
5145
5145
|
},
|
|
5146
5146
|
{
|
|
5147
5147
|
specifier: "react-native-paper",
|
|
@@ -7195,7 +7195,9 @@ const CONTRACT = deepFreeze({
|
|
|
7195
7195
|
// 1.290.0: stricter lint (sc-17804) — the app's button colours paint the
|
|
7196
7196
|
// primary `<Button>` only, and a literal `variant` the button does not
|
|
7197
7197
|
// draw is the publish-blocking `button-unknown-variant` finding.
|
|
7198
|
-
|
|
7198
|
+
// 1.291.0: behaviour (sc-18689) — a vertical native `ScrollView`, `FlatList`
|
|
7199
|
+
// or `SectionList` sets `nestedScrollEnabled` unless inverted or the author sets it.
|
|
7200
|
+
version: "1.291.0",
|
|
7199
7201
|
sharedTranslationKeys: SHARED_TRANSLATION_KEYS,
|
|
7200
7202
|
hooks: HOOKS,
|
|
7201
7203
|
primitives: PRIMITIVES,
|