@colixsystems/widget-sdk 0.57.0 → 0.58.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
@@ -52,7 +52,11 @@ See the design reference for the full architecture: [`docs/architecture/widget-m
52
52
 
53
53
  ## Status
54
54
 
55
- `v0.57.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**.
55
+ `v0.58.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**.
56
+
57
+ ### What's new in 0.58.0
58
+
59
+ **Filter the directory by group (sc-2964).** `useDirectory(query?)` and `useUsers(query?)` gain an optional `group_id` on the query object (`{ q?, role?, is_active?, group_id?, limit?, offset? }`). Pass the `id` of a `useGroups()` row to list only that group's members — pair it with a group picker to build "members of group X". A `group_id` from another tenant or a non-existent one returns an empty roster, never a cross-tenant member. The `DirectoryQuery` / `UsersQuery` types add `group_id?: string`; existing callers pass no `group_id` and see the full roster. No scope, manifest field, import, or hook signature changed — `CONTRACT` is unchanged; the query flows verbatim through the injected `@colixsystems/directory-client` on both the web Player and the native Expo export.
56
60
 
57
61
  ### What's new in 0.57.0
58
62
 
@@ -454,6 +458,7 @@ A widget that works but looks unfinished is only half done. `useTheme()` is the
454
458
 
455
459
  - **Pull spacing and corners from tokens.** Use `theme.spacing` (`xs / sm / md / lg / xl`) for a consistent padding and gap rhythm, and `theme.radii` (`sm / md / lg / pill`) for corners. Don't hardcode raw pixel values.
456
460
  - **Build a hierarchy.** A clear title (large, bold, `colors.onSurface`), body text, and muted captions in `colors.onSurfaceMuted` — three weights, not one flat size. Reserve `colors.primary` (with `colors.onPrimary` for text on it) for the single most important action or metric.
461
+ - **Set the theme font on every `Text`.** React Native `Text` does not inherit `fontFamily` from a parent, so a text element that omits it falls back to the system font and ignores the workspace's configured font. Put `theme.typography.fontFamily` on every text style (a shared `StyleSheet` built from `theme` keeps it in one place) and size text with `theme.typography.sizes`.
457
462
  - **Contain and elevate.** Wrap a logical unit in a surface: `colors.surface` + padding + `radii.md` + a `colors.border` hairline or a subtle shadow. Use the status roles (`danger / success / warning / info`) for state.
458
463
  - **Respond to touch.** Give every `Pressable` a pressed state via the function-style `style={({ pressed }) => [base, pressed && { opacity: 0.7 }]}`.
459
464
  - **Use icons for clarity.** Pair a `lucide-react-native` icon with its label at a consistent size, coloured from the theme.
package/dist/hooks.js CHANGED
@@ -2221,8 +2221,10 @@ function toDirectoryError(err) {
2221
2221
  * users is NOT part of this surface; the directory is read-only here (see
2222
2222
  * useUsers for administration).
2223
2223
  *
2224
- * `query` is an optional `{ q?, role?, is_active?, limit?, offset? }`
2225
- * object passed through verbatim. The hook re-fetches whenever
2224
+ * `query` is an optional `{ q?, role?, is_active?, group_id?, limit?, offset? }`
2225
+ * object passed through verbatim. `group_id` (the `id` of a `useGroups()` row)
2226
+ * restricts the roster to that group's members — pair it with a group picker to
2227
+ * build "members of group X". The hook re-fetches whenever
2226
2228
  * `JSON.stringify(query)` changes and exposes `refetch` for on-demand
2227
2229
  * reloads (e.g. a chat roster refresh).
2228
2230
  *
@@ -2300,8 +2302,10 @@ export function useDirectory(query) {
2300
2302
  * invite, deactivate, reactivate}` — `list` resolves to the `{ data, meta }`
2301
2303
  * envelope VERBATIM, so we unwrap `res.data` (default `[]`). User rows are
2302
2304
  * snake_case (`id`, `name`, `email`, `role`, `is_active`, …) and bodies
2303
- * (e.g. `{ email, name, group_ids? }`) pass through verbatim. The list
2304
- * refetches whenever `JSON.stringify(query)` changes; the imperative methods
2305
+ * (e.g. `{ email, name, group_ids? }`) pass through verbatim. `query` is an
2306
+ * optional `{ q?, role?, is_active?, group_id?, limit?, offset? }`; `group_id`
2307
+ * (the `id` of a `useGroups()` row) narrows the list to that group's members.
2308
+ * The list refetches whenever `JSON.stringify(query)` changes; the imperative methods
2305
2309
  * reject with a `DirectoryError`. Reads require the `users.read:*` scope;
2306
2310
  * mutations additionally require `users.write:*`. The host's signed
2307
2311
  * `X-Widget-Scopes` header + a tenant-scoped SystemAcl `users.read` /
package/dist/index.d.ts CHANGED
@@ -585,6 +585,11 @@ export interface DirectoryQuery {
585
585
  role?: "USER" | "INTEGRATION" | "ALL";
586
586
  /** Filter by active state (snake_case on the wire). */
587
587
  is_active?: boolean;
588
+ /**
589
+ * Restrict the roster to members of one app-user group — the `id` of a
590
+ * `useGroups()` row. Pair with a group picker to build "members of group X".
591
+ */
592
+ group_id?: string;
588
593
  limit?: number;
589
594
  offset?: number;
590
595
  }
@@ -1082,6 +1087,8 @@ export interface UsersQuery {
1082
1087
  q?: string;
1083
1088
  role?: "USER" | "INTEGRATION" | "ALL";
1084
1089
  is_active?: boolean;
1090
+ /** Restrict to members of one app-user group — the `id` of a `useGroups()` row. */
1091
+ group_id?: string;
1085
1092
  limit?: number;
1086
1093
  offset?: number;
1087
1094
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@colixsystems/widget-sdk",
3
- "version": "0.57.0",
3
+ "version": "0.58.0",
4
4
  "description": "Common widget interface for AppStudio. Implements WidgetManifest, WidgetContext, property schema, and helper hooks.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",