@colixsystems/widget-sdk 0.143.0 → 0.144.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 +10 -4
- package/dist/contract.cjs +11 -6
- package/dist/contract.js +11 -6
- package/dist/host.d.ts +3 -9
- package/dist/host.js +5 -6
- package/dist/navigation.cjs +9 -32
- package/dist/navigation.js +8 -31
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -71,10 +71,16 @@ See the design reference for the full architecture: [`docs/architecture/widget-m
|
|
|
71
71
|
|
|
72
72
|
## Status
|
|
73
73
|
|
|
74
|
-
`v0.
|
|
74
|
+
`v0.144.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**.
|
|
75
75
|
|
|
76
|
-
### What's new in 0.
|
|
76
|
+
### What's new in 0.144.0 (contract 1.112.0)
|
|
77
77
|
|
|
78
|
+
**The global mobile quick bar is retired — `quickBarMaxItems` and `quickBarCap` leave the contract (sc-7753, REQ-NAV-STRUCTURE / REQ-NAV-LOCAL).** The quick bar was a second global menu bolted to the sidebar: its own per-page flag, its own five-item cap, its own strip on the app's bottom edge. Since sc-7695 a page can carry a bottom navigation bar of its own drawing a saved menu, which is the same strip with an author-chosen list behind it — so the global one was a duplicate shape.
|
|
79
|
+
|
|
80
|
+
- `CONTRACT.themeMenuTypes.sidebar` is now `{ name, summary, maxItems }`. `menuItemCap` is unchanged; `quickBarCap` is **removed** — a page's bottom bar draws the menu the author composed, so there is no global number to state.
|
|
81
|
+
- `resolveFooterTokens` stays exactly as it is. It was never the quick bar's alone: it is the BOTTOM EDGE's token set, and the page's own bottom bar reads it, so a workspace's bottom-edge colours survive the retirement untouched.
|
|
82
|
+
- The sc-7753 backfill turns each workspace's quick-bar pages into a saved menu and points the pages that drew the strip at it BEFORE this ships, so no destination is lost.
|
|
83
|
+
- Host-integration surface only; no author-facing hook, prop or manifest field changed. `CONTRACT.version` → `1.112.0`.
|
|
78
84
|
**A widget can name the screen it is on — `useScreenTitle(title)` + the optional `ctx.screen` slice (sc-7955).** The app header now shows the PAGE title beside the back control on a sub-page, instead of repeating the app brand on every screen. The page's own name is the default, but a page is often about one record, and only the widget has it:
|
|
79
85
|
|
|
80
86
|
```js
|
|
@@ -115,8 +121,8 @@ if (triggeredBy && triggeredBy.type === "app_user") {
|
|
|
115
121
|
|
|
116
122
|
**The app's global navigation is the sidebar alone — `top-bar` and `bottom-tabs` leave `CONTRACT.themeMenuTypes` (sc-7352, REQ-NAV-STRUCTURE).** A top bar is now a PAGE's local bar drawing a saved menu (REQ-NAV-LOCAL, sc-7103): the same tab row the `top-bar` shape used to draw, themed by the same `topBar` tokens (`resolveTopBarTokens` is unchanged), worn by one page under the sidebar. Two "top bars" competing for one word and one token set was the reason.
|
|
117
123
|
|
|
118
|
-
- `normaliseNavigation` resolves a stored `top-bar` or `bottom-tabs` to `sidebar`, so a host never has to guard the value. `menuItemCap` / `quickBarCap` keep their signatures (`quickBarCap("sidebar")` is still 5).
|
|
119
|
-
- The global menu never lived in the shape (it is the pages' `show_in_menu` flags), so a workspace that stored a retired shape already draws the sidebar with the same menu. The sc-7352 backfill deletes the stored key BEFORE the shapes disappear; a bottom-tabs app's phone strip becomes the sidebar's quick bar.
|
|
124
|
+
- `normaliseNavigation` resolves a stored `top-bar` or `bottom-tabs` to `sidebar`, so a host never has to guard the value. `menuItemCap` / `quickBarCap` keep their signatures (`quickBarCap("sidebar")` is still 5). *(`quickBarCap` was removed in 0.142.0.)*
|
|
125
|
+
- The global menu never lived in the shape (it is the pages' `show_in_menu` flags), so a workspace that stored a retired shape already draws the sidebar with the same menu. The sc-7352 backfill deletes the stored key BEFORE the shapes disappear; a bottom-tabs app's phone strip becomes the sidebar's quick bar. *(That strip was itself retired in 0.142.0.)*
|
|
120
126
|
- Host-integration surface only; no author-facing hook, prop or manifest field changed. `CONTRACT.version` → `1.109.0`.
|
|
121
127
|
|
|
122
128
|
### What's new in 0.140.0 (contract 1.108.0)
|
package/dist/contract.cjs
CHANGED
|
@@ -220,16 +220,13 @@ const THEME_WIDGET_STYLES = Object.freeze({
|
|
|
220
220
|
// REQ-NAV-STRUCTURE (sc-7352): the app's GLOBAL navigation has exactly one
|
|
221
221
|
// shape, the sidebar. A top bar is a PAGE's local bar drawing a saved menu
|
|
222
222
|
// (REQ-NAV-LOCAL), themed by the `topBar` tokens, never an app-wide menu shape.
|
|
223
|
-
// `maxItems` is the menu cap (none for a rail)
|
|
224
|
-
// SECONDARY mobile quick bar, which may drop a page because the rail and the
|
|
225
|
-
// drawer still list every one.
|
|
223
|
+
// `maxItems` is the menu cap (none for a rail).
|
|
226
224
|
const THEME_MENU_TYPES = Object.freeze({
|
|
227
225
|
sidebar: Object.freeze({
|
|
228
226
|
name: "Sidebar",
|
|
229
227
|
summary:
|
|
230
|
-
"A persistent left rail on desktop; a hamburger drawer
|
|
228
|
+
"A persistent left rail on desktop; a hamburger drawer on mobile.",
|
|
231
229
|
maxItems: null,
|
|
232
|
-
quickBarMaxItems: 5,
|
|
233
230
|
}),
|
|
234
231
|
});
|
|
235
232
|
const THEME_SPACING_SCALE = Object.freeze({
|
|
@@ -4036,7 +4033,15 @@ const CONTRACT = deepFreeze({
|
|
|
4036
4033
|
// integration identity; this describes the caller, it does not grant
|
|
4037
4034
|
// anything. The same commit adds `properties` to this list, which the
|
|
4038
4035
|
// action-sdk copy had carried since 1.50.0 while this one had not.
|
|
4039
|
-
|
|
4036
|
+
// 1.112.0: BREAKING on the pre-1.0 channel (sc-7753) — `themeMenuTypes`
|
|
4037
|
+
// loses `quickBarMaxItems` and the `quickBarCap` host export goes with
|
|
4038
|
+
// it. The app's global mobile quick bar is retired: it was a SELECTION
|
|
4039
|
+
// over the global menu, and the rail and drawer list every menu page
|
|
4040
|
+
// regardless, so nothing was reachable only through it. The bottom edge
|
|
4041
|
+
// belongs to a PAGE's own bottom navigation bar (`local_nav = BOTTOM_BAR`,
|
|
4042
|
+
// REQ-NAV-LOCAL), chosen per page. `resolveFooterTokens` is unchanged —
|
|
4043
|
+
// it is the bottom edge's token set and the surviving bar reads it.
|
|
4044
|
+
version: "1.112.0",
|
|
4040
4045
|
sharedTranslationKeys: SHARED_TRANSLATION_KEYS,
|
|
4041
4046
|
hooks: HOOKS,
|
|
4042
4047
|
primitives: PRIMITIVES,
|
package/dist/contract.js
CHANGED
|
@@ -220,16 +220,13 @@ const THEME_WIDGET_STYLES = Object.freeze({
|
|
|
220
220
|
// REQ-NAV-STRUCTURE (sc-7352): the app's GLOBAL navigation has exactly one
|
|
221
221
|
// shape, the sidebar. A top bar is a PAGE's local bar drawing a saved menu
|
|
222
222
|
// (REQ-NAV-LOCAL), themed by the `topBar` tokens, never an app-wide menu shape.
|
|
223
|
-
// `maxItems` is the menu cap (none for a rail)
|
|
224
|
-
// SECONDARY mobile quick bar, which may drop a page because the rail and the
|
|
225
|
-
// drawer still list every one.
|
|
223
|
+
// `maxItems` is the menu cap (none for a rail).
|
|
226
224
|
const THEME_MENU_TYPES = Object.freeze({
|
|
227
225
|
sidebar: Object.freeze({
|
|
228
226
|
name: "Sidebar",
|
|
229
227
|
summary:
|
|
230
|
-
"A persistent left rail on desktop; a hamburger drawer
|
|
228
|
+
"A persistent left rail on desktop; a hamburger drawer on mobile.",
|
|
231
229
|
maxItems: null,
|
|
232
|
-
quickBarMaxItems: 5,
|
|
233
230
|
}),
|
|
234
231
|
});
|
|
235
232
|
const THEME_SPACING_SCALE = Object.freeze({
|
|
@@ -4032,7 +4029,15 @@ const CONTRACT = deepFreeze({
|
|
|
4032
4029
|
// integration identity; this describes the caller, it does not grant
|
|
4033
4030
|
// anything. The same commit adds `properties` to this list, which the
|
|
4034
4031
|
// action-sdk copy had carried since 1.50.0 while this one had not.
|
|
4035
|
-
|
|
4032
|
+
// 1.112.0: BREAKING on the pre-1.0 channel (sc-7753) — `themeMenuTypes`
|
|
4033
|
+
// loses `quickBarMaxItems` and the `quickBarCap` host export goes with
|
|
4034
|
+
// it. The app's global mobile quick bar is retired: it was a SELECTION
|
|
4035
|
+
// over the global menu, and the rail and drawer list every menu page
|
|
4036
|
+
// regardless, so nothing was reachable only through it. The bottom edge
|
|
4037
|
+
// belongs to a PAGE's own bottom navigation bar (`local_nav = BOTTOM_BAR`,
|
|
4038
|
+
// REQ-NAV-LOCAL), chosen per page. `resolveFooterTokens` is unchanged —
|
|
4039
|
+
// it is the bottom edge's token set and the surviving bar reads it.
|
|
4040
|
+
version: "1.112.0",
|
|
4036
4041
|
sharedTranslationKeys: SHARED_TRANSLATION_KEYS,
|
|
4037
4042
|
hooks: HOOKS,
|
|
4038
4043
|
primitives: PRIMITIVES,
|
package/dist/host.d.ts
CHANGED
|
@@ -173,15 +173,9 @@ export function normaliseNavigation(navigation: unknown): ResolvedNavigation;
|
|
|
173
173
|
*/
|
|
174
174
|
export function menuItemCap(menuType: string): number | null;
|
|
175
175
|
|
|
176
|
-
/**
|
|
177
|
-
*
|
|
178
|
-
*
|
|
179
|
-
* page: the rail and drawer still list every menu page.
|
|
180
|
-
*/
|
|
181
|
-
export function quickBarCap(menuType: string): number | null;
|
|
182
|
-
|
|
183
|
-
/** The footer strip's resolved tokens. A `null` colour means the host keeps its
|
|
184
|
-
* own default; a `null` `borderColor` means no divider is drawn at all. */
|
|
176
|
+
/** The app's bottom edge — a page's own bottom navigation bar. A `null` colour
|
|
177
|
+
* means the host keeps its own default; a `null` `borderColor` means no
|
|
178
|
+
* divider is drawn at all. */
|
|
185
179
|
export interface FooterTokens {
|
|
186
180
|
backgroundColor: string | null;
|
|
187
181
|
textColor: string | null;
|
package/dist/host.js
CHANGED
|
@@ -55,18 +55,17 @@ export {
|
|
|
55
55
|
// REQ-NAV-STRUCTURE: the navigation resolver both hosts draw their chrome from.
|
|
56
56
|
// `normaliseNavigation` turns a stored `theme_config.navigation` block into the
|
|
57
57
|
// resolved `{ menuType }` — always `sidebar` since sc-7352 retired the other
|
|
58
|
-
// shapes, so a stored value never needs guarding; `menuItemCap`
|
|
59
|
-
//
|
|
60
|
-
//
|
|
61
|
-
//
|
|
62
|
-
// keeps the appearance it has.
|
|
58
|
+
// shapes, so a stored value never needs guarding; `menuItemCap` states the cap.
|
|
59
|
+
// One implementation, so the chrome cannot mean one thing in the Player and
|
|
60
|
+
// another in the Expo export. `resolveFooterTokens` is the BOTTOM EDGE's token
|
|
61
|
+
// set — a page's own bottom navigation bar (REQ-NAV-LOCAL) — falling back to
|
|
62
|
+
// the sidebar's so an untouched workspace keeps the appearance it has.
|
|
63
63
|
// REQ-THEME-14: `resolveSidebarTokens` and `resolveTopBarTokens` are the same
|
|
64
64
|
// idea for the rail and the app bar, whose defaults used to live inline in each
|
|
65
65
|
// host and had already drifted apart.
|
|
66
66
|
export {
|
|
67
67
|
normaliseNavigation,
|
|
68
68
|
menuItemCap,
|
|
69
|
-
quickBarCap,
|
|
70
69
|
resolveFooterTokens,
|
|
71
70
|
resolveSidebarTokens,
|
|
72
71
|
resolveTopBarTokens,
|
package/dist/navigation.cjs
CHANGED
|
@@ -60,7 +60,7 @@ function normaliseNavigation(navigation) {
|
|
|
60
60
|
|
|
61
61
|
/**
|
|
62
62
|
* How many MENU pages the chrome may draw at once, or `null` for no cap. The
|
|
63
|
-
* sidebar has none.
|
|
63
|
+
* sidebar has none.
|
|
64
64
|
*
|
|
65
65
|
* @param {string} menuType — a resolved menu type.
|
|
66
66
|
* @returns {number|null}
|
|
@@ -70,35 +70,12 @@ function menuItemCap(menuType) {
|
|
|
70
70
|
return entry ? entry.maxItems : null;
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
*
|
|
77
|
-
* This cap MAY drop a page, and that is the difference from `menuItemCap`: the
|
|
78
|
-
* rail and the drawer still list every menu page, so the bar is a shortcut
|
|
79
|
-
* rather than the menu. It lived as a constant on one host and a literal on the
|
|
80
|
-
* other before this, which is exactly how the two would have drifted.
|
|
81
|
-
*
|
|
82
|
-
* @param {string} menuType — a resolved menu type.
|
|
83
|
-
* @returns {number|null}
|
|
84
|
-
*/
|
|
85
|
-
function quickBarCap(menuType) {
|
|
86
|
-
const entry = CONTRACT.themeMenuTypes[menuType];
|
|
87
|
-
return entry ? entry.quickBarMaxItems : null;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
// The strip's surface was hard-coded white on BOTH hosts and its items read the
|
|
91
|
-
// sidebar's tokens. `footer` gives the quick bar tokens of its own.
|
|
92
|
-
//
|
|
93
|
-
// Every colour falls back to the sidebar's, so a workspace that never opens the
|
|
94
|
-
// panel keeps exactly the appearance it has today; only an explicit `footer`
|
|
95
|
-
// value moves anything.
|
|
73
|
+
// REQ-NAV-LOCAL: the app's BOTTOM EDGE — the tokens a page's own bottom
|
|
74
|
+
// navigation bar is drawn from. Every colour falls back to the sidebar's, so a
|
|
75
|
+
// workspace that never opens the panel keeps the appearance it has.
|
|
96
76
|
//
|
|
97
|
-
// sc-
|
|
98
|
-
//
|
|
99
|
-
// exactly these values — the Design panel that edits them is named for that
|
|
100
|
-
// bar, since the quick bar is on its way out (sc-7753) and the look outlives
|
|
101
|
-
// it. No key is the bar's alone: two strips, one look.
|
|
77
|
+
// sc-7753: the global quick bar these tokens were introduced for is retired;
|
|
78
|
+
// the bar that reads them now is the page's own (`local_nav = BOTTOM_BAR`).
|
|
102
79
|
function resolveFooterTokens(theme) {
|
|
103
80
|
const config = isPlainObject(theme) ? theme : {};
|
|
104
81
|
const footer = isPlainObject(config.footer) ? config.footer : {};
|
|
@@ -113,8 +90,8 @@ function resolveFooterTokens(theme) {
|
|
|
113
90
|
// colour resolves to the brand primary, which the caller supplies.
|
|
114
91
|
activeColor: pick("activeColor"),
|
|
115
92
|
// REQ-THEME-LOOK: the divider's COLOUR is its switch. Unset draws no line at
|
|
116
|
-
// all — which the native
|
|
117
|
-
// hairline across a tinted
|
|
93
|
+
// all — which the native strip did not honour before this, ruling a
|
|
94
|
+
// hairline across a tinted bar that had asked for none.
|
|
118
95
|
borderColor,
|
|
119
96
|
borderWidth: borderColor ? borderWidthOr(footer.borderWidth, sidebar.borderWidth) : null,
|
|
120
97
|
activeStyle: activeStyle === "accent" ? "accent" : "filled",
|
|
@@ -362,4 +339,4 @@ function borderWidthOr(...values) {
|
|
|
362
339
|
return 1;
|
|
363
340
|
}
|
|
364
341
|
|
|
365
|
-
module.exports = { normaliseNavigation, menuItemCap,
|
|
342
|
+
module.exports = { normaliseNavigation, menuItemCap, resolveFooterTokens, resolveSidebarTokens, resolveTopBarTokens };
|
package/dist/navigation.js
CHANGED
|
@@ -51,7 +51,7 @@ export function normaliseNavigation(navigation) {
|
|
|
51
51
|
|
|
52
52
|
/**
|
|
53
53
|
* How many MENU pages the chrome may draw at once, or `null` for no cap. The
|
|
54
|
-
* sidebar has none.
|
|
54
|
+
* sidebar has none.
|
|
55
55
|
*
|
|
56
56
|
* @param {string} menuType — a resolved menu type.
|
|
57
57
|
* @returns {number|null}
|
|
@@ -61,35 +61,12 @@ export function menuItemCap(menuType) {
|
|
|
61
61
|
return entry ? entry.maxItems : null;
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
*
|
|
68
|
-
* This cap MAY drop a page, and that is the difference from `menuItemCap`: the
|
|
69
|
-
* rail and the drawer still list every menu page, so the bar is a shortcut
|
|
70
|
-
* rather than the menu. It lived as a constant on one host and a literal on the
|
|
71
|
-
* other before this, which is exactly how the two would have drifted.
|
|
72
|
-
*
|
|
73
|
-
* @param {string} menuType — a resolved menu type.
|
|
74
|
-
* @returns {number|null}
|
|
75
|
-
*/
|
|
76
|
-
export function quickBarCap(menuType) {
|
|
77
|
-
const entry = CONTRACT.themeMenuTypes[menuType];
|
|
78
|
-
return entry ? entry.quickBarMaxItems : null;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
// The strip's surface was hard-coded white on BOTH hosts and its items read the
|
|
82
|
-
// sidebar's tokens. `footer` gives the quick bar tokens of its own.
|
|
83
|
-
//
|
|
84
|
-
// Every colour falls back to the sidebar's, so a workspace that never opens the
|
|
85
|
-
// panel keeps exactly the appearance it has today; only an explicit `footer`
|
|
86
|
-
// value moves anything.
|
|
64
|
+
// REQ-NAV-LOCAL: the app's BOTTOM EDGE — the tokens a page's own bottom
|
|
65
|
+
// navigation bar is drawn from. Every colour falls back to the sidebar's, so a
|
|
66
|
+
// workspace that never opens the panel keeps the appearance it has.
|
|
87
67
|
//
|
|
88
|
-
// sc-
|
|
89
|
-
//
|
|
90
|
-
// exactly these values — the Design panel that edits them is named for that
|
|
91
|
-
// bar, since the quick bar is on its way out (sc-7753) and the look outlives
|
|
92
|
-
// it. No key is the bar's alone: two strips, one look.
|
|
68
|
+
// sc-7753: the global quick bar these tokens were introduced for is retired;
|
|
69
|
+
// the bar that reads them now is the page's own (`local_nav = BOTTOM_BAR`).
|
|
93
70
|
export function resolveFooterTokens(theme) {
|
|
94
71
|
const config = isPlainObject(theme) ? theme : {};
|
|
95
72
|
const footer = isPlainObject(config.footer) ? config.footer : {};
|
|
@@ -104,8 +81,8 @@ export function resolveFooterTokens(theme) {
|
|
|
104
81
|
// colour resolves to the brand primary, which the caller supplies.
|
|
105
82
|
activeColor: pick("activeColor"),
|
|
106
83
|
// REQ-THEME-LOOK: the divider's COLOUR is its switch. Unset draws no line at
|
|
107
|
-
// all — which the native
|
|
108
|
-
// hairline across a tinted
|
|
84
|
+
// all — which the native strip did not honour before this, ruling a
|
|
85
|
+
// hairline across a tinted bar that had asked for none.
|
|
109
86
|
borderColor,
|
|
110
87
|
borderWidth: borderColor ? borderWidthOr(footer.borderWidth, sidebar.borderWidth) : null,
|
|
111
88
|
activeStyle: activeStyle === "accent" ? "accent" : "filled",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@colixsystems/widget-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.144.0",
|
|
4
4
|
"description": "Common widget interface for AppStudio. Implements WidgetManifest, WidgetContext, property schema, and helper hooks.",
|
|
5
5
|
"homepage": "https://github.com/Colix-AB/AppStudio",
|
|
6
6
|
"type": "module",
|