@colixsystems/widget-sdk 0.353.0 → 0.354.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 +5 -1
- package/dist/host.d.ts +8 -0
- package/dist/host.js +2 -0
- package/dist/navigation.cjs +19 -0
- package/dist/navigation.js +17 -0
- package/package.json +1 -1
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.354.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.354.0 (contract 1.290.0)
|
|
97
|
+
|
|
98
|
+
**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
99
|
|
|
96
100
|
### What's new in 0.353.0 (contract 1.290.0)
|
|
97
101
|
|
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
package/dist/navigation.cjs
CHANGED
|
@@ -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,
|
package/dist/navigation.js
CHANGED
|
@@ -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
|
//
|
package/package.json
CHANGED