@colixsystems/widget-sdk 0.233.0 → 0.234.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/contract.cjs +4 -1
- package/dist/contract.js +4 -1
- package/dist/host.d.ts +5 -3
- package/dist/navigation.cjs +8 -4
- package/dist/navigation.js +8 -4
- package/package.json +1 -1
- package/src/contract.js +4 -1
package/README.md
CHANGED
|
@@ -84,7 +84,11 @@ See the design reference for the full architecture: [`docs/architecture/widget-m
|
|
|
84
84
|
|
|
85
85
|
## Status
|
|
86
86
|
|
|
87
|
-
`v0.
|
|
87
|
+
`v0.234.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**.
|
|
88
|
+
|
|
89
|
+
### What's new in 0.234.0 (contract 1.189.0)
|
|
90
|
+
|
|
91
|
+
**The space around a bottom bar's tabs is the author's (host side only).** `resolveFooterTokens` from `@colixsystems/widget-sdk/host` now also resolves `padding`, 0–12px with a default of 4: the bar is its 40px tabs plus that space above and below, so 48px by default (it was a fixed 56) and 40px at zero. A floating bar's `itemRadius` follows the curve one padding in. `FOOTER_SIZES.padding` carries the bound. Nothing a widget imports changes.
|
|
88
92
|
|
|
89
93
|
### What's new in 0.233.0 (contract 1.188.0)
|
|
90
94
|
|
package/dist/contract.cjs
CHANGED
|
@@ -6046,7 +6046,10 @@ const CONTRACT = deepFreeze({
|
|
|
6046
6046
|
// `FOOTER_HOME_LINE_CLEARANCE_PX`. No widget-facing surface changes.
|
|
6047
6047
|
// 1.188.0: additive (sc-11692) — `resolveFooterTokens` gains `glass` (a
|
|
6048
6048
|
// floating bar is frosted unless `footer.glass` is false) and `glassTint`.
|
|
6049
|
-
|
|
6049
|
+
// 1.189.0: additive (sc-11703) — `resolveFooterTokens` gains `padding`,
|
|
6050
|
+
// the space around a bottom bar's tabs (0–12, default 4); `FOOTER_SIZES`
|
|
6051
|
+
// gains its bound.
|
|
6052
|
+
version: "1.189.0",
|
|
6050
6053
|
sharedTranslationKeys: SHARED_TRANSLATION_KEYS,
|
|
6051
6054
|
hooks: HOOKS,
|
|
6052
6055
|
primitives: PRIMITIVES,
|
package/dist/contract.js
CHANGED
|
@@ -6042,7 +6042,10 @@ const CONTRACT = deepFreeze({
|
|
|
6042
6042
|
// `FOOTER_HOME_LINE_CLEARANCE_PX`. No widget-facing surface changes.
|
|
6043
6043
|
// 1.188.0: additive (sc-11692) — `resolveFooterTokens` gains `glass` (a
|
|
6044
6044
|
// floating bar is frosted unless `footer.glass` is false) and `glassTint`.
|
|
6045
|
-
|
|
6045
|
+
// 1.189.0: additive (sc-11703) — `resolveFooterTokens` gains `padding`,
|
|
6046
|
+
// the space around a bottom bar's tabs (0–12, default 4); `FOOTER_SIZES`
|
|
6047
|
+
// gains its bound.
|
|
6048
|
+
version: "1.189.0",
|
|
6046
6049
|
sharedTranslationKeys: SHARED_TRANSLATION_KEYS,
|
|
6047
6050
|
hooks: HOOKS,
|
|
6048
6051
|
primitives: PRIMITIVES,
|
package/dist/host.d.ts
CHANGED
|
@@ -275,9 +275,11 @@ export interface FooterTokens {
|
|
|
275
275
|
shape: "floating" | "docked";
|
|
276
276
|
/** A floating bar's corner radius, px (0–40). */
|
|
277
277
|
radius: number;
|
|
278
|
-
/** A tab's corner radius, px: a floating bar's curve one
|
|
278
|
+
/** A tab's corner radius, px: a floating bar's curve one padding in
|
|
279
279
|
* (min 6) for a filled tab; 6 for an accent tab or a docked bar. */
|
|
280
280
|
itemRadius: number;
|
|
281
|
+
/** sc-11703: the space around the tabs, px (0–12, default 4). */
|
|
282
|
+
padding: number;
|
|
281
283
|
/** A floating bar's distance from the screen's sides, px (0–48). */
|
|
282
284
|
sideMargin: number;
|
|
283
285
|
/** Space below the tabs, px (0–32), on top of the system's clearance. */
|
|
@@ -286,14 +288,14 @@ export interface FooterTokens {
|
|
|
286
288
|
|
|
287
289
|
/** sc-11678: each bar measurement's upper bound and default, px (min 0). */
|
|
288
290
|
export const FOOTER_SIZES: Readonly<
|
|
289
|
-
Record<"radius" | "sideMargin" | "bottomSpacing", Readonly<{ max: number; fallback: number }>>
|
|
291
|
+
Record<"radius" | "sideMargin" | "bottomSpacing" | "padding", Readonly<{ max: number; fallback: number }>>
|
|
290
292
|
>;
|
|
291
293
|
|
|
292
294
|
/** sc-11678: one bar measurement clamped onto its `FOOTER_SIZES` range, or
|
|
293
295
|
* `undefined` when the value is not a finite number. */
|
|
294
296
|
export function clampFooterSize(
|
|
295
297
|
value: unknown,
|
|
296
|
-
key: "radius" | "sideMargin" | "bottomSpacing",
|
|
298
|
+
key: "radius" | "sideMargin" | "bottomSpacing" | "padding",
|
|
297
299
|
): number | undefined;
|
|
298
300
|
|
|
299
301
|
/** sc-11678: the part of the iOS bottom inset a bar keeps clear (the home
|
package/dist/navigation.cjs
CHANGED
|
@@ -87,7 +87,7 @@ function menuItemCap(menuType) {
|
|
|
87
87
|
// `backgroundColor`, `textColor`, `tabActiveBackgroundColor`,
|
|
88
88
|
// `tabActiveTextColor`, `borderColor`, `borderWidth`, `activeStyle`,
|
|
89
89
|
// `tabLayout`, (sc-11678) `shape`, `radius`, `sideMargin`, `bottomSpacing`
|
|
90
|
-
// and (sc-
|
|
90
|
+
// (sc-11692) `glass` and (sc-11703) `padding`.
|
|
91
91
|
function resolveFooterTokens(theme) {
|
|
92
92
|
const config = isPlainObject(theme) ? theme : {};
|
|
93
93
|
const footer = isPlainObject(config.footer) ? config.footer : {};
|
|
@@ -106,6 +106,7 @@ function resolveFooterTokens(theme) {
|
|
|
106
106
|
const divider = borderWidth > 0;
|
|
107
107
|
const floats = footer.shape !== "docked";
|
|
108
108
|
const radius = footerSizeOr(footer, "radius");
|
|
109
|
+
const padding = footerSizeOr(footer, "padding");
|
|
109
110
|
const backgroundColor = hexOr(footer.backgroundColor, DEFAULT_FOOTER_SURFACE);
|
|
110
111
|
// sc-11692: frosted unless switched off; only a floating bar has a page
|
|
111
112
|
// behind it to frost.
|
|
@@ -141,11 +142,12 @@ function resolveFooterTokens(theme) {
|
|
|
141
142
|
// sc-11678: unset floats, so every app gets the rounded, inset bar.
|
|
142
143
|
shape: floats ? "floating" : "docked",
|
|
143
144
|
radius,
|
|
144
|
-
// A filled tab follows a floating bar's curve one
|
|
145
|
-
//
|
|
145
|
+
// A filled tab follows a floating bar's curve one padding in, never
|
|
146
|
+
// sharper than the docked 6px chip. An accent tab paints no surface,
|
|
146
147
|
// and a curved top edge would bend its marker into an arc.
|
|
147
148
|
itemRadius:
|
|
148
|
-
floats && !accent ? Math.max(DOCKED_TAB_RADIUS, radius -
|
|
149
|
+
floats && !accent ? Math.max(DOCKED_TAB_RADIUS, radius - padding) : DOCKED_TAB_RADIUS,
|
|
150
|
+
padding,
|
|
149
151
|
sideMargin: footerSizeOr(footer, "sideMargin"),
|
|
150
152
|
bottomSpacing: footerSizeOr(footer, "bottomSpacing"),
|
|
151
153
|
};
|
|
@@ -157,6 +159,8 @@ const FOOTER_SIZES = Object.freeze({
|
|
|
157
159
|
radius: Object.freeze({ max: 40, fallback: 28 }),
|
|
158
160
|
sideMargin: Object.freeze({ max: 48, fallback: 12 }),
|
|
159
161
|
bottomSpacing: Object.freeze({ max: 32, fallback: 8 }),
|
|
162
|
+
// sc-11703: the space around the tabs; 4 makes a 48pt bar (40pt tabs).
|
|
163
|
+
padding: Object.freeze({ max: 12, fallback: 4 }),
|
|
160
164
|
});
|
|
161
165
|
const DOCKED_TAB_RADIUS = 6;
|
|
162
166
|
|
package/dist/navigation.js
CHANGED
|
@@ -78,7 +78,7 @@ export function menuItemCap(menuType) {
|
|
|
78
78
|
// `backgroundColor`, `textColor`, `tabActiveBackgroundColor`,
|
|
79
79
|
// `tabActiveTextColor`, `borderColor`, `borderWidth`, `activeStyle`,
|
|
80
80
|
// `tabLayout`, (sc-11678) `shape`, `radius`, `sideMargin`, `bottomSpacing`
|
|
81
|
-
// and (sc-
|
|
81
|
+
// (sc-11692) `glass` and (sc-11703) `padding`.
|
|
82
82
|
export function resolveFooterTokens(theme) {
|
|
83
83
|
const config = isPlainObject(theme) ? theme : {};
|
|
84
84
|
const footer = isPlainObject(config.footer) ? config.footer : {};
|
|
@@ -97,6 +97,7 @@ export function resolveFooterTokens(theme) {
|
|
|
97
97
|
const divider = borderWidth > 0;
|
|
98
98
|
const floats = footer.shape !== "docked";
|
|
99
99
|
const radius = footerSizeOr(footer, "radius");
|
|
100
|
+
const padding = footerSizeOr(footer, "padding");
|
|
100
101
|
const backgroundColor = hexOr(footer.backgroundColor, DEFAULT_FOOTER_SURFACE);
|
|
101
102
|
// sc-11692: frosted unless switched off; only a floating bar has a page
|
|
102
103
|
// behind it to frost.
|
|
@@ -132,11 +133,12 @@ export function resolveFooterTokens(theme) {
|
|
|
132
133
|
// sc-11678: unset floats, so every app gets the rounded, inset bar.
|
|
133
134
|
shape: floats ? "floating" : "docked",
|
|
134
135
|
radius,
|
|
135
|
-
// A filled tab follows a floating bar's curve one
|
|
136
|
-
//
|
|
136
|
+
// A filled tab follows a floating bar's curve one padding in, never
|
|
137
|
+
// sharper than the docked 6px chip. An accent tab paints no surface,
|
|
137
138
|
// and a curved top edge would bend its marker into an arc.
|
|
138
139
|
itemRadius:
|
|
139
|
-
floats && !accent ? Math.max(DOCKED_TAB_RADIUS, radius -
|
|
140
|
+
floats && !accent ? Math.max(DOCKED_TAB_RADIUS, radius - padding) : DOCKED_TAB_RADIUS,
|
|
141
|
+
padding,
|
|
140
142
|
sideMargin: footerSizeOr(footer, "sideMargin"),
|
|
141
143
|
bottomSpacing: footerSizeOr(footer, "bottomSpacing"),
|
|
142
144
|
};
|
|
@@ -148,6 +150,8 @@ export const FOOTER_SIZES = Object.freeze({
|
|
|
148
150
|
radius: Object.freeze({ max: 40, fallback: 28 }),
|
|
149
151
|
sideMargin: Object.freeze({ max: 48, fallback: 12 }),
|
|
150
152
|
bottomSpacing: Object.freeze({ max: 32, fallback: 8 }),
|
|
153
|
+
// sc-11703: the space around the tabs; 4 makes a 48pt bar (40pt tabs).
|
|
154
|
+
padding: Object.freeze({ max: 12, fallback: 4 }),
|
|
151
155
|
});
|
|
152
156
|
const DOCKED_TAB_RADIUS = 6;
|
|
153
157
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@colixsystems/widget-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.234.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",
|
package/src/contract.js
CHANGED
|
@@ -6042,7 +6042,10 @@ const CONTRACT = deepFreeze({
|
|
|
6042
6042
|
// `FOOTER_HOME_LINE_CLEARANCE_PX`. No widget-facing surface changes.
|
|
6043
6043
|
// 1.188.0: additive (sc-11692) — `resolveFooterTokens` gains `glass` (a
|
|
6044
6044
|
// floating bar is frosted unless `footer.glass` is false) and `glassTint`.
|
|
6045
|
-
|
|
6045
|
+
// 1.189.0: additive (sc-11703) — `resolveFooterTokens` gains `padding`,
|
|
6046
|
+
// the space around a bottom bar's tabs (0–12, default 4); `FOOTER_SIZES`
|
|
6047
|
+
// gains its bound.
|
|
6048
|
+
version: "1.189.0",
|
|
6046
6049
|
sharedTranslationKeys: SHARED_TRANSLATION_KEYS,
|
|
6047
6050
|
hooks: HOOKS,
|
|
6048
6051
|
primitives: PRIMITIVES,
|