@colixsystems/widget-sdk 0.353.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 CHANGED
@@ -91,7 +91,15 @@ See the design reference for the full architecture: [`docs/architecture/widget-m
91
91
 
92
92
  ## Status
93
93
 
94
- `v0.353.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**.
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.
99
+
100
+ ### What's new in 0.354.0 (contract 1.290.0)
101
+
102
+ **Host only: the bottom bar's label threshold.** `@colixsystems/widget-sdk/host` exports `BOTTOM_BAR_LABEL_MIN_ITEM_WIDTH` (`{ inline: 88, stacked: 56 }`) and `bottomBarLabelMinItemWidth(tabLayout)`, the narrowest slot, in px, in which a bottom-bar tab keeps its label. The web Player and the native export both read it, so a stacked bar of five tabs shows its labels on a phone on both. The contract is unchanged, and nothing changes for widget authors.
95
103
 
96
104
  ### What's new in 0.353.0 (contract 1.290.0)
97
105
 
@@ -3603,7 +3611,7 @@ Also: `useFileSignatures(fileIds)` is now **self-scoped** (the caller's own sign
3603
3611
  - **`react-native-reanimated`** (`web`/`native`) — declarative animations.
3604
3612
  - **`react-native-gesture-handler`** (`web`/`native`) — native-driven touch gestures.
3605
3613
  - **`react-native-safe-area-context`** (`web`/`native`) — safe-area insets.
3606
- - **`@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.
3607
3615
  - **`react-native-paper`** (`web`/`native`) — Material Design components.
3608
3616
  - **`react-native-vector-icons`** (`web`/`native`) — icon font families.
3609
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
- version: "1.290.0",
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
- version: "1.290.0",
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/host.d.ts CHANGED
@@ -358,6 +358,14 @@ export function clampFooterSize(
358
358
  * line's band), px. Android's inset is cleared whole. */
359
359
  export const FOOTER_HOME_LINE_CLEARANCE_PX: number;
360
360
 
361
+ /** sc-17803: the narrowest bottom-tab slot, px, that keeps its label, per
362
+ * `tabLayout`. Narrower, an icon-bearing tab shows its glyph alone. */
363
+ export const BOTTOM_BAR_LABEL_MIN_ITEM_WIDTH: Readonly<Record<"inline" | "stacked", number>>;
364
+
365
+ /** sc-17803: `BOTTOM_BAR_LABEL_MIN_ITEM_WIDTH` for a resolved `tabLayout`;
366
+ * anything but `"stacked"` reads as inline. */
367
+ export function bottomBarLabelMinItemWidth(tabLayout: string): number;
368
+
361
369
  /**
362
370
  * Resolves the footer strip's tokens from a whole `theme_config`. It reads
363
371
  * `theme.footer` and NOTHING else (sc-8033): the colours used to fall back to
package/dist/host.js CHANGED
@@ -103,6 +103,8 @@ export {
103
103
  FOOTER_SIZES,
104
104
  clampFooterSize,
105
105
  FOOTER_HOME_LINE_CLEARANCE_PX,
106
+ BOTTOM_BAR_LABEL_MIN_ITEM_WIDTH,
107
+ bottomBarLabelMinItemWidth,
106
108
  resolveSidebarTokens,
107
109
  resolveTopStripeLayout,
108
110
  resolveTopBarTokens,
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;
@@ -179,6 +179,23 @@ function footerSizeOr(footer, key) {
179
179
  // Android's inset is its navigation bar, so there the whole inset is cleared.
180
180
  const FOOTER_HOME_LINE_CLEARANCE_PX = 14;
181
181
 
182
+ // sc-3026, sc-17803: the narrowest slot, px, a bottom tab keeps its label in;
183
+ // narrower, an icon-bearing tab shows its glyph alone. A stacked label sits
184
+ // under its glyph, so five stacked tabs fit a 320pt phone's floating bar.
185
+ const BOTTOM_BAR_LABEL_MIN_ITEM_WIDTH = Object.freeze({ inline: 88, stacked: 56 });
186
+
187
+ /**
188
+ * The label threshold for a resolved footer `tabLayout`; unknown reads inline.
189
+ *
190
+ * @param {string} tabLayout — `resolveFooterTokens(theme).tabLayout`.
191
+ * @returns {number} px each tab needs for its label to show.
192
+ */
193
+ function bottomBarLabelMinItemWidth(tabLayout) {
194
+ return tabLayout === "stacked"
195
+ ? BOTTOM_BAR_LABEL_MIN_ITEM_WIDTH.stacked
196
+ : BOTTOM_BAR_LABEL_MIN_ITEM_WIDTH.inline;
197
+ }
198
+
182
199
  // REQ-THEME-14 — the rail's and the app bar's tokens, resolved once for both
183
200
  // hosts.
184
201
  //
@@ -1048,6 +1065,8 @@ module.exports = {
1048
1065
  FOOTER_SIZES,
1049
1066
  clampFooterSize,
1050
1067
  FOOTER_HOME_LINE_CLEARANCE_PX,
1068
+ BOTTOM_BAR_LABEL_MIN_ITEM_WIDTH,
1069
+ bottomBarLabelMinItemWidth,
1051
1070
  resolveSidebarTokens,
1052
1071
  TOP_STRIPE_SLOTS,
1053
1072
  TOP_STRIPE_ALWAYS_SHOWN_SLOTS,
@@ -174,6 +174,23 @@ function footerSizeOr(footer, key) {
174
174
  // Android's inset is its navigation bar, so there the whole inset is cleared.
175
175
  export const FOOTER_HOME_LINE_CLEARANCE_PX = 14;
176
176
 
177
+ // sc-3026, sc-17803: the narrowest slot, px, a bottom tab keeps its label in;
178
+ // narrower, an icon-bearing tab shows its glyph alone. A stacked label sits
179
+ // under its glyph, so five stacked tabs fit a 320pt phone's floating bar.
180
+ export const BOTTOM_BAR_LABEL_MIN_ITEM_WIDTH = Object.freeze({ inline: 88, stacked: 56 });
181
+
182
+ /**
183
+ * The label threshold for a resolved footer `tabLayout`; unknown reads inline.
184
+ *
185
+ * @param {string} tabLayout — `resolveFooterTokens(theme).tabLayout`.
186
+ * @returns {number} px each tab needs for its label to show.
187
+ */
188
+ export function bottomBarLabelMinItemWidth(tabLayout) {
189
+ return tabLayout === "stacked"
190
+ ? BOTTOM_BAR_LABEL_MIN_ITEM_WIDTH.stacked
191
+ : BOTTOM_BAR_LABEL_MIN_ITEM_WIDTH.inline;
192
+ }
193
+
177
194
  // REQ-THEME-14 — the rail's and the app bar's tokens, resolved once for both
178
195
  // hosts.
179
196
  //
@@ -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
 
@@ -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 re-exports React Native's ScrollView as is (./primitives.native.js):
7
- // a swipe is the native affordance. Scrolling is the same capability on both
8
- // hosts; only the input differs. Touch screens on the web are left unchanged.
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@colixsystems/widget-sdk",
3
- "version": "0.353.0",
3
+ "version": "0.355.0",
4
4
  "description": "Common widget interface for AppStudio. Implements WidgetManifest, WidgetContext, property schema, and helper hooks.",
5
5
  "repository": {
6
6
  "type": "git",
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
- version: "1.290.0",
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,