@sanity/workflow-studio 0.25.0 → 0.27.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/CHANGELOG.md +34 -0
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -2
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,39 @@
|
|
|
1
1
|
# @sanity/workflow-studio
|
|
2
2
|
|
|
3
|
+
## 0.27.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 780cf93: **BREAKING:** `ProjectMember.roles` is now `readonly {name: string; title?: string}[]` instead of `readonly string[]`, and `AssigneeStack`'s `roles` prop takes the same records rather than name strings. This affects integrations that build or read `ProjectMember` rows directly, or render `AssigneeStack` themselves. Read `role.name` wherever a role name was read before, and pass role records rather than name strings into `projectMemberRow` and `AssigneeStack`. Until migrated, TypeScript fails at those sites. Integrations using `useProjectMembers` from `@sanity/workflow-sdk` or the Studio plugin's own equivalent get the new shape without changes, because the adapters own the projection.
|
|
8
|
+
|
|
9
|
+
A role now reads as its project title rather than its machine name — `Administrator`, not `administrator` — wherever one is shown: picker role rows, assignee badges, the instance-snapshot pills, and the hover hint naming a collapsed assignee cluster. A square role avatar takes its letters from the title too, so `Blueprints Deployer` reads as `BD` where `blueprints-deployer` could only ever give one letter; its colour still derives from the machine name, so retitling a project role keeps the role's colour. A role whose membership record carries no title — or a title that is only whitespace, which counts as none — and a role named by an assignee that no current member holds, both still read as the machine name. `roleLabel`, `roleLabelFor`, and `memberRoleFor` are exported for callers rendering their own role labels.
|
|
10
|
+
|
|
11
|
+
Both people-pickers now say who a person is, so choosing one no longer requires knowing the org chart. Search matches role names and titles as well as display name and email, so typing a role narrows the list to its holders. Members are also listed by display name rather than in the order the host supplied them, which was the sequence people joined the project — expect the list order to change, and on a large project to become usable. And hovering a row previews the account behind the name — a larger avatar badged with the person's identity provider, their email, and the roles they hold. Marks exist for Google, GitHub, and `saml-`-prefixed deployments; any other provider badges nothing rather than showing an empty circle. That is what tells two members sharing a display name apart, which no role label could. Rows share one tooltip delay group, so the wait to open is paid once and moving along the list swaps the preview rather than waiting again at each row.
|
|
12
|
+
|
|
13
|
+
`MemberAvatar` takes an optional `loginProvider` to badge the provider mark onto its corner. `ProjectMember` gains optional `loginProvider` and `isCurrentUser`; both are populated by the adapters, so integrations using `useProjectMembers` get them without changes.
|
|
14
|
+
|
|
15
|
+
Neither picker ranks or groups its member rows by the roles those members hold, and neither claims who is eligible for an activity. (The roles-and-members picker still lists selectable roles above the members, as it did before.) An activity has no role gate; only an action does, and a manually fired action's `roles` is folded into its `filter` at desugar, so the accepted set is not readable from a deployed definition. A picker has nothing to derive eligibility from, and a ranked list would assert something no engine or Content Lake check backs.
|
|
16
|
+
|
|
17
|
+
Stored values are unchanged. An assignee still persists the machine role name, and titles are display only.
|
|
18
|
+
|
|
19
|
+
**Docs impact:** Update the `@sanity/workflow-components` member-selection reference for the `ProjectMember.roles` and `AssigneeStack` `roles` shapes and the `roleLabel` / `roleLabelFor` / `memberRoleFor` exports (done in this package's README). Any concept or guide page showing a role in Studio UI should show titles rather than machine names, and the assignment guide should state that a picker never restricts or ranks who may be assigned. Add the `ProjectMember.roles` migration to the release notes.
|
|
20
|
+
|
|
21
|
+
### Patch Changes
|
|
22
|
+
|
|
23
|
+
- Updated dependencies [780cf93]
|
|
24
|
+
- Updated dependencies [b7c8bed]
|
|
25
|
+
- @sanity/workflow-engine@0.27.0
|
|
26
|
+
- @sanity/workflow-sdk@0.27.0
|
|
27
|
+
- @sanity/workflow-react@0.27.0
|
|
28
|
+
|
|
29
|
+
## 0.26.0
|
|
30
|
+
|
|
31
|
+
### Patch Changes
|
|
32
|
+
|
|
33
|
+
- @sanity/workflow-engine@0.26.0
|
|
34
|
+
- @sanity/workflow-react@0.26.0
|
|
35
|
+
- @sanity/workflow-sdk@0.26.0
|
|
36
|
+
|
|
3
37
|
## 0.25.0
|
|
4
38
|
|
|
5
39
|
### Patch Changes
|
package/dist/index.cjs
CHANGED
|
@@ -194,11 +194,11 @@ function isRecord(value) {
|
|
|
194
194
|
}
|
|
195
195
|
|
|
196
196
|
function isRole(value) {
|
|
197
|
-
return isRecord(value) && typeof value.name == "string";
|
|
197
|
+
return isRecord(value) && typeof value.name == "string" && (value.title === void 0 || typeof value.title == "string");
|
|
198
198
|
}
|
|
199
199
|
|
|
200
200
|
function isMembership(value) {
|
|
201
|
-
return isRecord(value) && typeof value.id == "string" && (value.isRobot === void 0 || typeof value.isRobot == "boolean") && (value.roles === void 0 || Array.isArray(value.roles) && value.roles.every(isRole));
|
|
201
|
+
return isRecord(value) && typeof value.id == "string" && (value.isRobot === void 0 || typeof value.isRobot == "boolean") && (value.isCurrentUser === void 0 || typeof value.isCurrentUser == "boolean") && (value.roles === void 0 || Array.isArray(value.roles) && value.roles.every(isRole));
|
|
202
202
|
}
|
|
203
203
|
|
|
204
204
|
async function fetchProjectUsers(client, projectId) {
|
package/dist/index.d.cts
CHANGED
|
@@ -39,8 +39,10 @@ export declare interface StudioObserverOptions {
|
|
|
39
39
|
export declare interface StudioProjectMembership {
|
|
40
40
|
readonly id: string;
|
|
41
41
|
readonly isRobot?: boolean;
|
|
42
|
+
readonly isCurrentUser?: boolean;
|
|
42
43
|
readonly roles?: readonly {
|
|
43
44
|
readonly name: string;
|
|
45
|
+
readonly title?: string;
|
|
44
46
|
}[];
|
|
45
47
|
readonly [key: string]: unknown;
|
|
46
48
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -39,8 +39,10 @@ export declare interface StudioObserverOptions {
|
|
|
39
39
|
export declare interface StudioProjectMembership {
|
|
40
40
|
readonly id: string;
|
|
41
41
|
readonly isRobot?: boolean;
|
|
42
|
+
readonly isCurrentUser?: boolean;
|
|
42
43
|
readonly roles?: readonly {
|
|
43
44
|
readonly name: string;
|
|
45
|
+
readonly title?: string;
|
|
44
46
|
}[];
|
|
45
47
|
readonly [key: string]: unknown;
|
|
46
48
|
}
|
package/dist/index.js
CHANGED
|
@@ -202,11 +202,11 @@ function isRecord(value) {
|
|
|
202
202
|
}
|
|
203
203
|
|
|
204
204
|
function isRole(value) {
|
|
205
|
-
return isRecord(value) && typeof value.name == "string";
|
|
205
|
+
return isRecord(value) && typeof value.name == "string" && (value.title === void 0 || typeof value.title == "string");
|
|
206
206
|
}
|
|
207
207
|
|
|
208
208
|
function isMembership(value) {
|
|
209
|
-
return isRecord(value) && typeof value.id == "string" && (value.isRobot === void 0 || typeof value.isRobot == "boolean") && (value.roles === void 0 || Array.isArray(value.roles) && value.roles.every(isRole));
|
|
209
|
+
return isRecord(value) && typeof value.id == "string" && (value.isRobot === void 0 || typeof value.isRobot == "boolean") && (value.isCurrentUser === void 0 || typeof value.isCurrentUser == "boolean") && (value.roles === void 0 || Array.isArray(value.roles) && value.roles.every(isRole));
|
|
210
210
|
}
|
|
211
211
|
|
|
212
212
|
async function fetchProjectUsers(client, projectId) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sanity/workflow-studio",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.27.0",
|
|
4
4
|
"description": "React adapter that drives the @sanity/workflow-engine reactive session in Sanity Studio through the App SDK store.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"sanity",
|
|
@@ -50,17 +50,17 @@
|
|
|
50
50
|
"react-dom": "^19.2.7",
|
|
51
51
|
"sanity": "^6",
|
|
52
52
|
"vitest": "^4.1.8",
|
|
53
|
-
"@sanity/workflow-react": "0.
|
|
54
|
-
"@sanity/workflow-
|
|
55
|
-
"@sanity/workflow-
|
|
53
|
+
"@sanity/workflow-react": "0.27.0",
|
|
54
|
+
"@sanity/workflow-engine": "0.27.0",
|
|
55
|
+
"@sanity/workflow-sdk": "0.27.0"
|
|
56
56
|
},
|
|
57
57
|
"peerDependencies": {
|
|
58
58
|
"@sanity/sdk": "^2.12.0",
|
|
59
59
|
"react": "^19.2.7",
|
|
60
60
|
"sanity": "^6",
|
|
61
|
-
"@sanity/workflow-react": "0.
|
|
62
|
-
"@sanity/workflow-
|
|
63
|
-
"@sanity/workflow-
|
|
61
|
+
"@sanity/workflow-react": "0.27.0",
|
|
62
|
+
"@sanity/workflow-sdk": "0.27.0",
|
|
63
|
+
"@sanity/workflow-engine": "0.27.0"
|
|
64
64
|
},
|
|
65
65
|
"engines": {
|
|
66
66
|
"node": ">=20"
|