@orthacms/workspaces-admin 0.4.3 → 0.5.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.
Files changed (185) hide show
  1. package/dist/lib/application/useDeleteWorkspace/index.d.ts +1 -1
  2. package/dist/lib/application/useDeleteWorkspace/index.js +1 -1
  3. package/dist/lib/domain/slug/index.spec.d.ts +2 -0
  4. package/dist/lib/domain/slug/index.spec.d.ts.map +1 -0
  5. package/dist/lib/domain/slug/index.spec.js +50 -0
  6. package/dist/lib/presentation/components/WorkspaceMembersSettings/MemberListRow/index.d.ts.map +1 -1
  7. package/dist/lib/presentation/components/WorkspaceMembersSettings/MemberListRow/index.js +1 -1
  8. package/dist/lib/presentation/components/WorkspaceMembersSettings/index.d.ts.map +1 -1
  9. package/dist/lib/presentation/components/WorkspaceMembersSettings/index.js +40 -4
  10. package/dist/lib/presentation/components/WorkspacesEmpty/index.d.ts +1 -1
  11. package/dist/lib/presentation/components/WorkspacesEmpty/index.js +1 -1
  12. package/dist/lib/presentation/components/WorkspacesNavSection/index.d.ts.map +1 -1
  13. package/dist/lib/presentation/components/WorkspacesNavSection/index.js +18 -4
  14. package/dist/lib/presentation/pages/WorkspacesPage/index.d.ts +2 -2
  15. package/dist/lib/presentation/pages/WorkspacesPage/index.js +3 -3
  16. package/dist/lib/presentation/workspacesPlugin/index.d.ts +14 -7
  17. package/dist/lib/presentation/workspacesPlugin/index.d.ts.map +1 -1
  18. package/dist/lib/presentation/workspacesPlugin/index.js +14 -7
  19. package/package.json +6 -6
  20. package/dist/lib/api/useAddWorkspaceContent/index.d.ts +0 -15
  21. package/dist/lib/api/useAddWorkspaceContent/index.d.ts.map +0 -1
  22. package/dist/lib/api/useAddWorkspaceMember/index.d.ts +0 -14
  23. package/dist/lib/api/useAddWorkspaceMember/index.d.ts.map +0 -1
  24. package/dist/lib/api/useContentTypes/index.d.ts +0 -10
  25. package/dist/lib/api/useContentTypes/index.d.ts.map +0 -1
  26. package/dist/lib/api/useCreateWorkspace/index.d.ts +0 -20
  27. package/dist/lib/api/useCreateWorkspace/index.d.ts.map +0 -1
  28. package/dist/lib/api/useDeleteWorkspace/index.d.ts +0 -13
  29. package/dist/lib/api/useDeleteWorkspace/index.d.ts.map +0 -1
  30. package/dist/lib/api/useRemoveWorkspaceContent/index.d.ts +0 -15
  31. package/dist/lib/api/useRemoveWorkspaceContent/index.d.ts.map +0 -1
  32. package/dist/lib/api/useRemoveWorkspaceMember/index.d.ts +0 -13
  33. package/dist/lib/api/useRemoveWorkspaceMember/index.d.ts.map +0 -1
  34. package/dist/lib/api/useSetWorkspaceStatus/index.d.ts +0 -14
  35. package/dist/lib/api/useSetWorkspaceStatus/index.d.ts.map +0 -1
  36. package/dist/lib/api/useSlugAvailability/index.d.ts +0 -10
  37. package/dist/lib/api/useSlugAvailability/index.d.ts.map +0 -1
  38. package/dist/lib/api/useUpdateWorkspace/index.d.ts +0 -23
  39. package/dist/lib/api/useUpdateWorkspace/index.d.ts.map +0 -1
  40. package/dist/lib/api/useUsersSearch/index.d.ts +0 -17
  41. package/dist/lib/api/useUsersSearch/index.d.ts.map +0 -1
  42. package/dist/lib/api/useWorkspaceContentCount/index.d.ts +0 -8
  43. package/dist/lib/api/useWorkspaceContentCount/index.d.ts.map +0 -1
  44. package/dist/lib/api/useWorkspaceEntryCount/index.d.ts +0 -8
  45. package/dist/lib/api/useWorkspaceEntryCount/index.d.ts.map +0 -1
  46. package/dist/lib/api/useWorkspaces/index.d.ts +0 -30
  47. package/dist/lib/api/useWorkspaces/index.d.ts.map +0 -1
  48. package/dist/lib/components/BlockingConfirmDialog/index.d.ts +0 -41
  49. package/dist/lib/components/BlockingConfirmDialog/index.d.ts.map +0 -1
  50. package/dist/lib/components/ColorSwatchRow/index.d.ts +0 -15
  51. package/dist/lib/components/ColorSwatchRow/index.d.ts.map +0 -1
  52. package/dist/lib/components/CreateWorkspaceWizard/ColorSwatchRow/index.d.ts +0 -15
  53. package/dist/lib/components/CreateWorkspaceWizard/ColorSwatchRow/index.d.ts.map +0 -1
  54. package/dist/lib/components/CreateWorkspaceWizard/ContentStep/ModeTiles/index.d.ts +0 -11
  55. package/dist/lib/components/CreateWorkspaceWizard/ContentStep/ModeTiles/index.d.ts.map +0 -1
  56. package/dist/lib/components/CreateWorkspaceWizard/ContentStep/ResourceSection/index.d.ts +0 -48
  57. package/dist/lib/components/CreateWorkspaceWizard/ContentStep/ResourceSection/index.d.ts.map +0 -1
  58. package/dist/lib/components/CreateWorkspaceWizard/ContentStep/index.d.ts +0 -23
  59. package/dist/lib/components/CreateWorkspaceWizard/ContentStep/index.d.ts.map +0 -1
  60. package/dist/lib/components/CreateWorkspaceWizard/IdentityFields/index.d.ts +0 -17
  61. package/dist/lib/components/CreateWorkspaceWizard/IdentityFields/index.d.ts.map +0 -1
  62. package/dist/lib/components/CreateWorkspaceWizard/MembersStep/MemberRow/index.d.ts +0 -14
  63. package/dist/lib/components/CreateWorkspaceWizard/MembersStep/MemberRow/index.d.ts.map +0 -1
  64. package/dist/lib/components/CreateWorkspaceWizard/MembersStep/MemberTypeahead/index.d.ts +0 -15
  65. package/dist/lib/components/CreateWorkspaceWizard/MembersStep/MemberTypeahead/index.d.ts.map +0 -1
  66. package/dist/lib/components/CreateWorkspaceWizard/MembersStep/index.d.ts +0 -17
  67. package/dist/lib/components/CreateWorkspaceWizard/MembersStep/index.d.ts.map +0 -1
  68. package/dist/lib/components/CreateWorkspaceWizard/Monogram/index.d.ts +0 -17
  69. package/dist/lib/components/CreateWorkspaceWizard/Monogram/index.d.ts.map +0 -1
  70. package/dist/lib/components/CreateWorkspaceWizard/SlugField/index.d.ts +0 -23
  71. package/dist/lib/components/CreateWorkspaceWizard/SlugField/index.d.ts.map +0 -1
  72. package/dist/lib/components/StatusChip/index.d.ts +0 -9
  73. package/dist/lib/components/StatusChip/index.d.ts.map +0 -1
  74. package/dist/lib/components/WorkspaceAvatar/index.d.ts +0 -20
  75. package/dist/lib/components/WorkspaceAvatar/index.d.ts.map +0 -1
  76. package/dist/lib/components/WorkspaceCard/MemberStack/MemberListPopover/index.d.ts +0 -9
  77. package/dist/lib/components/WorkspaceCard/MemberStack/MemberListPopover/index.d.ts.map +0 -1
  78. package/dist/lib/components/WorkspaceCard/MemberStack/index.d.ts +0 -11
  79. package/dist/lib/components/WorkspaceCard/MemberStack/index.d.ts.map +0 -1
  80. package/dist/lib/components/WorkspaceCard/StatusChip/index.d.ts +0 -9
  81. package/dist/lib/components/WorkspaceCard/StatusChip/index.d.ts.map +0 -1
  82. package/dist/lib/components/WorkspaceCard/index.d.ts +0 -15
  83. package/dist/lib/components/WorkspaceCard/index.d.ts.map +0 -1
  84. package/dist/lib/components/WorkspaceCommands/index.d.ts +0 -8
  85. package/dist/lib/components/WorkspaceCommands/index.d.ts.map +0 -1
  86. package/dist/lib/components/WorkspaceContentSettings/AddContentDialog/index.d.ts +0 -26
  87. package/dist/lib/components/WorkspaceContentSettings/AddContentDialog/index.d.ts.map +0 -1
  88. package/dist/lib/components/WorkspaceContentSettings/GrantedContentGroup/index.d.ts +0 -21
  89. package/dist/lib/components/WorkspaceContentSettings/GrantedContentGroup/index.d.ts.map +0 -1
  90. package/dist/lib/components/WorkspaceContentSettings/GrantedContentRow/index.d.ts +0 -26
  91. package/dist/lib/components/WorkspaceContentSettings/GrantedContentRow/index.d.ts.map +0 -1
  92. package/dist/lib/components/WorkspaceContentSettings/RemoveContentDialog/index.d.ts +0 -25
  93. package/dist/lib/components/WorkspaceContentSettings/RemoveContentDialog/index.d.ts.map +0 -1
  94. package/dist/lib/components/WorkspaceContentSettings/index.d.ts +0 -25
  95. package/dist/lib/components/WorkspaceContentSettings/index.d.ts.map +0 -1
  96. package/dist/lib/components/WorkspaceDangerSettings/DeleteWorkspaceDialog/index.d.ts +0 -22
  97. package/dist/lib/components/WorkspaceDangerSettings/DeleteWorkspaceDialog/index.d.ts.map +0 -1
  98. package/dist/lib/components/WorkspaceDangerSettings/index.d.ts +0 -18
  99. package/dist/lib/components/WorkspaceDangerSettings/index.d.ts.map +0 -1
  100. package/dist/lib/components/WorkspaceGeneralSettings/index.d.ts +0 -18
  101. package/dist/lib/components/WorkspaceGeneralSettings/index.d.ts.map +0 -1
  102. package/dist/lib/components/WorkspaceMembersSettings/MemberDirectorySearch/index.d.ts +0 -18
  103. package/dist/lib/components/WorkspaceMembersSettings/MemberDirectorySearch/index.d.ts.map +0 -1
  104. package/dist/lib/components/WorkspaceMembersSettings/MemberListRow/index.d.ts +0 -17
  105. package/dist/lib/components/WorkspaceMembersSettings/MemberListRow/index.d.ts.map +0 -1
  106. package/dist/lib/components/WorkspaceMembersSettings/index.d.ts +0 -16
  107. package/dist/lib/components/WorkspaceMembersSettings/index.d.ts.map +0 -1
  108. package/dist/lib/components/WorkspaceNav/WorkspaceNavButton/index.d.ts +0 -14
  109. package/dist/lib/components/WorkspaceNav/WorkspaceNavButton/index.d.ts.map +0 -1
  110. package/dist/lib/components/WorkspaceNav/WorkspaceSwitcher/index.d.ts +0 -16
  111. package/dist/lib/components/WorkspaceNav/WorkspaceSwitcher/index.d.ts.map +0 -1
  112. package/dist/lib/components/WorkspaceNav/index.d.ts +0 -14
  113. package/dist/lib/components/WorkspaceNav/index.d.ts.map +0 -1
  114. package/dist/lib/components/WorkspaceSettingsRail/index.d.ts +0 -14
  115. package/dist/lib/components/WorkspaceSettingsRail/index.d.ts.map +0 -1
  116. package/dist/lib/components/WorkspaceSettingsTabs/index.d.ts +0 -14
  117. package/dist/lib/components/WorkspaceSettingsTabs/index.d.ts.map +0 -1
  118. package/dist/lib/components/WorkspaceSettingsTopBar/index.d.ts +0 -8
  119. package/dist/lib/components/WorkspaceSettingsTopBar/index.d.ts.map +0 -1
  120. package/dist/lib/components/WorkspaceShell/NewWorkspaceButton/index.d.ts +0 -7
  121. package/dist/lib/components/WorkspaceShell/NewWorkspaceButton/index.d.ts.map +0 -1
  122. package/dist/lib/components/WorkspaceShell/RailTooltip/index.d.ts +0 -22
  123. package/dist/lib/components/WorkspaceShell/RailTooltip/index.d.ts.map +0 -1
  124. package/dist/lib/components/WorkspaceShell/WorkspaceRail/index.d.ts +0 -17
  125. package/dist/lib/components/WorkspaceShell/WorkspaceRail/index.d.ts.map +0 -1
  126. package/dist/lib/components/WorkspaceShell/WorkspaceSidebarButton/index.d.ts +0 -17
  127. package/dist/lib/components/WorkspaceShell/WorkspaceSidebarButton/index.d.ts.map +0 -1
  128. package/dist/lib/components/WorkspaceShell/WorkspaceSwitcher/WorkspaceSwitcherPopover/index.d.ts +0 -26
  129. package/dist/lib/components/WorkspaceShell/WorkspaceSwitcher/WorkspaceSwitcherPopover/index.d.ts.map +0 -1
  130. package/dist/lib/components/WorkspaceShell/WorkspaceSwitcher/index.d.ts +0 -17
  131. package/dist/lib/components/WorkspaceShell/WorkspaceSwitcher/index.d.ts.map +0 -1
  132. package/dist/lib/components/WorkspaceShell/index.d.ts +0 -16
  133. package/dist/lib/components/WorkspaceShell/index.d.ts.map +0 -1
  134. package/dist/lib/components/WorkspaceStats/index.d.ts +0 -9
  135. package/dist/lib/components/WorkspaceStats/index.d.ts.map +0 -1
  136. package/dist/lib/components/WorkspaceToolbar/index.d.ts +0 -22
  137. package/dist/lib/components/WorkspaceToolbar/index.d.ts.map +0 -1
  138. package/dist/lib/components/WorkspacesEmpty/index.d.ts +0 -18
  139. package/dist/lib/components/WorkspacesEmpty/index.d.ts.map +0 -1
  140. package/dist/lib/components/WorkspacesHomePanel/index.d.ts +0 -7
  141. package/dist/lib/components/WorkspacesHomePanel/index.d.ts.map +0 -1
  142. package/dist/lib/components/WorkspacesNavSection/index.d.ts +0 -9
  143. package/dist/lib/components/WorkspacesNavSection/index.d.ts.map +0 -1
  144. package/dist/lib/components/WorkspacesSkeleton/index.d.ts +0 -36
  145. package/dist/lib/components/WorkspacesSkeleton/index.d.ts.map +0 -1
  146. package/dist/lib/components/WorkspacesTable/index.d.ts +0 -12
  147. package/dist/lib/components/WorkspacesTable/index.d.ts.map +0 -1
  148. package/dist/lib/hooks/useBasicsSchema/index.d.ts +0 -14
  149. package/dist/lib/hooks/useBasicsSchema/index.d.ts.map +0 -1
  150. package/dist/lib/hooks/useResourceSelection/index.d.ts +0 -21
  151. package/dist/lib/hooks/useResourceSelection/index.d.ts.map +0 -1
  152. package/dist/lib/hooks/useSlug/index.d.ts +0 -28
  153. package/dist/lib/hooks/useSlug/index.d.ts.map +0 -1
  154. package/dist/lib/hooks/useWizard/index.d.ts +0 -57
  155. package/dist/lib/hooks/useWizard/index.d.ts.map +0 -1
  156. package/dist/lib/hooks/useWorkspaceProfileSchema/index.d.ts +0 -13
  157. package/dist/lib/hooks/useWorkspaceProfileSchema/index.d.ts.map +0 -1
  158. package/dist/lib/pages/CreateWorkspacePage/index.d.ts +0 -7
  159. package/dist/lib/pages/CreateWorkspacePage/index.d.ts.map +0 -1
  160. package/dist/lib/pages/WorkspaceSettingsPage/index.d.ts +0 -12
  161. package/dist/lib/pages/WorkspaceSettingsPage/index.d.ts.map +0 -1
  162. package/dist/lib/pages/WorkspacesPage/index.d.ts +0 -7
  163. package/dist/lib/pages/WorkspacesPage/index.d.ts.map +0 -1
  164. package/dist/lib/slots/workspaceSlots/index.d.ts +0 -101
  165. package/dist/lib/slots/workspaceSlots/index.d.ts.map +0 -1
  166. package/dist/lib/types/wizard/index.d.ts +0 -119
  167. package/dist/lib/types/wizard/index.d.ts.map +0 -1
  168. package/dist/lib/types/workspace/index.d.ts +0 -42
  169. package/dist/lib/types/workspace/index.d.ts.map +0 -1
  170. package/dist/lib/utils/buildCreateWorkspaceBody/index.d.ts +0 -12
  171. package/dist/lib/utils/buildCreateWorkspaceBody/index.d.ts.map +0 -1
  172. package/dist/lib/utils/currentWorkspace/index.d.ts +0 -17
  173. package/dist/lib/utils/currentWorkspace/index.d.ts.map +0 -1
  174. package/dist/lib/utils/isActiveWorkspace/index.d.ts +0 -9
  175. package/dist/lib/utils/isActiveWorkspace/index.d.ts.map +0 -1
  176. package/dist/lib/utils/isConflict/index.d.ts +0 -8
  177. package/dist/lib/utils/isConflict/index.d.ts.map +0 -1
  178. package/dist/lib/utils/permissions/index.d.ts +0 -7
  179. package/dist/lib/utils/permissions/index.d.ts.map +0 -1
  180. package/dist/lib/utils/radioGroupKeydown/index.d.ts +0 -15
  181. package/dist/lib/utils/radioGroupKeydown/index.d.ts.map +0 -1
  182. package/dist/lib/utils/resourceSelection/index.d.ts +0 -18
  183. package/dist/lib/utils/resourceSelection/index.d.ts.map +0 -1
  184. package/dist/lib/utils/workspacesPlugin/index.d.ts +0 -31
  185. package/dist/lib/utils/workspacesPlugin/index.d.ts.map +0 -1
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Permanently deletes a workspace via the gateway. On success it invalidates the
3
- * workspaces list so the deleted workspace drops out of the grid; the caller
3
+ * workspaces list so the deleted workspace drops out of the table; the caller
4
4
  * navigates away from the (now-gone) shell route.
5
5
  *
6
6
  * `onSuccess` deliberately does **not** return the `invalidateQueries` promise:
@@ -3,7 +3,7 @@ import { httpWorkspaceGateway } from '../../infrastructure/httpWorkspaceGateway'
3
3
  import { workspacesKey } from '../useWorkspaces';
4
4
  /**
5
5
  * Permanently deletes a workspace via the gateway. On success it invalidates the
6
- * workspaces list so the deleted workspace drops out of the grid; the caller
6
+ * workspaces list so the deleted workspace drops out of the table; the caller
7
7
  * navigates away from the (now-gone) shell route.
8
8
  *
9
9
  * `onSuccess` deliberately does **not** return the `invalidateQueries` promise:
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=index.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.spec.d.ts","sourceRoot":"","sources":["../../../../src/lib/domain/slug/index.spec.ts"],"names":[],"mappings":""}
@@ -0,0 +1,50 @@
1
+ import { describe, expect, it } from 'vitest';
2
+ import { Slug } from './index';
3
+ /**
4
+ * The admin's slug rule. Its whole job is to be **the same rule as the
5
+ * server's**, so the wizard never offers a slug the API then refuses.
6
+ *
7
+ * The source of truth is
8
+ * `packages/workspaces/server/src/lib/workspace/domain/value-objects/slug.ts`
9
+ * (`^[a-z0-9-]+$`, 1–120 characters), pinned by its own
10
+ * `slug.spec.ts`. The admin cannot import the server package — no admin package
11
+ * depends on a server one, and none may start — so the corpus below is that
12
+ * spec's, transcribed deliberately. If the server rule ever moves, this spec is
13
+ * meant to go red rather than let the two drift apart in silence.
14
+ *
15
+ * The cases that actually catch drift are the near-misses. `blog_post` is the
16
+ * one a hand-written client regex most often lets through, because `\w` and most
17
+ * "slugify" helpers treat the underscore as a word character while the server
18
+ * does not; and 120 vs. 121 is a boundary an admin-side copy is free to get off
19
+ * by one, since nothing but this test compares the two numbers.
20
+ */
21
+ describe('Slug (admin mirror of the server rule) [workspaces:I-11]', () => {
22
+ it.each([
23
+ ['lowercase letters', 'marketing'],
24
+ ['letters, digits and hyphens', 'marketing-01'],
25
+ ['a single character', 'a'],
26
+ ['exactly 120 characters', 'a'.repeat(120)]
27
+ ])('accepts %s', (_label, value) => {
28
+ expect(Slug.isValid(value)).toBe(true);
29
+ expect(Slug.create(value).value).toBe(value);
30
+ });
31
+ it.each([
32
+ ['empty', ''],
33
+ ['uppercase', 'Marketing'],
34
+ ['spaces', 'my workspace'],
35
+ ['punctuation', 'oops!'],
36
+ ['underscore', 'blog_post'],
37
+ ['121 characters', 'a'.repeat(121)]
38
+ ])('rejects a %s slug', (_label, value) => {
39
+ expect(Slug.isValid(value)).toBe(false);
40
+ expect(() => Slug.create(value)).toThrow(/Invalid workspace slug/);
41
+ });
42
+ // `isValid` is the field's live feedback and `create` is the last guard
43
+ // before the request; they have to be one decision, not two that agree
44
+ // today. The corpus above already asserts both for every case — this states
45
+ // the relationship the two methods hold by construction.
46
+ it('guards the request with the same answer the field showed', () => {
47
+ expect(() => Slug.create('marketing-01')).not.toThrow();
48
+ expect(() => Slug.create('blog_post')).toThrow();
49
+ });
50
+ });
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/presentation/components/WorkspaceMembersSettings/MemberListRow/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAU1E,uCAAuC;AACvC,MAAM,MAAM,kBAAkB,GAAG;IAC7B,4BAA4B;IAC5B,MAAM,EAAE,eAAe,CAAC;IACxB,kDAAkD;IAClD,SAAS,EAAE,OAAO,CAAC;IACnB,iDAAiD;IACjD,QAAQ,EAAE,MAAM,IAAI,CAAC;CACxB,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,EAC1B,MAAM,EACN,SAAS,EACT,QAAQ,EACX,EAAE,kBAAkB,+BAqCpB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/presentation/components/WorkspaceMembersSettings/MemberListRow/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAU1E,uCAAuC;AACvC,MAAM,MAAM,kBAAkB,GAAG;IAC7B,4BAA4B;IAC5B,MAAM,EAAE,eAAe,CAAC;IACxB,kDAAkD;IAClD,SAAS,EAAE,OAAO,CAAC;IACnB,iDAAiD;IACjD,QAAQ,EAAE,MAAM,IAAI,CAAC;CACxB,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,EAC1B,MAAM,EACN,SAAS,EACT,QAAQ,EACX,EAAE,kBAAkB,+BAwCpB"}
@@ -16,7 +16,7 @@ const messages = defineMessages({
16
16
  */
17
17
  export function MemberListRow({ member, canRemove, onRemove }) {
18
18
  const intl = useIntl();
19
- return (_jsxs("div", { className: "flex items-center gap-3 px-3 py-2", children: [_jsx(WorkspaceAvatar, { className: "size-9 text-xs", initials: member.initials || '—', color: member.color }), _jsxs("div", { className: "flex min-w-0 flex-1 flex-col", children: [_jsx("span", { className: "truncate text-sm font-medium", children: member.name }), _jsx("span", { className: "truncate text-xs text-muted-foreground", children: member.email })] }), canRemove ? (_jsx(Button, { type: "button", variant: "ghost", size: "icon", "data-remove-member": "", onClick: onRemove, "aria-label": intl.formatMessage(messages.remove, {
19
+ return (_jsxs("div", { className: "flex items-center gap-3 px-3 py-2", children: [_jsx(WorkspaceAvatar, { className: "size-9 text-xs", initials: member.initials || '—', color: member.color }), _jsxs("div", { className: "flex min-w-0 flex-1 flex-col", children: [_jsx("span", { className: "truncate text-sm font-medium", children: member.name }), _jsx("span", { className: "truncate text-xs text-muted-foreground", children: member.email })] }), canRemove ? (_jsx(Button, { type: "button", variant: "ghost", size: "icon", "data-remove-member": "", "data-member-id": member.id, onClick: onRemove, "aria-label": intl.formatMessage(messages.remove, {
20
20
  name: member.name
21
21
  }), children: _jsx(X, { className: "size-4" }) })) : null] }));
22
22
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lib/presentation/components/WorkspaceMembersSettings/index.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EACR,SAAS,EAEZ,MAAM,iCAAiC,CAAC;AAwDzC,kDAAkD;AAClD,MAAM,MAAM,6BAA6B,GAAG;IACxC,+CAA+C;IAC/C,SAAS,EAAE,SAAS,CAAC;IACrB,+EAA+E;IAC/E,SAAS,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,EACrC,SAAS,EACT,SAAS,EACZ,EAAE,6BAA6B,+BAqI/B"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lib/presentation/components/WorkspaceMembersSettings/index.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EACR,SAAS,EAEZ,MAAM,iCAAiC,CAAC;AA8DzC,kDAAkD;AAClD,MAAM,MAAM,6BAA6B,GAAG;IACxC,+CAA+C;IAC/C,SAAS,EAAE,SAAS,CAAC;IACrB,+EAA+E;IAC/E,SAAS,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,EACrC,SAAS,EACT,SAAS,EACZ,EAAE,6BAA6B,+BA0K/B"}
@@ -2,6 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useEffect, useRef, useState } from 'react';
3
3
  import { defineMessages, useIntl } from 'react-intl';
4
4
  import { Card, CardContent, CardDescription, CardHeader, CardTitle, ConfirmDialog, Separator, toast } from '@orthacms/design-system';
5
+ import { isConflict } from '../../../infrastructure/isConflict';
5
6
  import { useAddWorkspaceMember } from '../../../application/useAddWorkspaceMember';
6
7
  import { useRemoveWorkspaceMember } from '../../../application/useRemoveWorkspaceMember';
7
8
  import { MemberDirectorySearch } from './MemberDirectorySearch';
@@ -39,6 +40,10 @@ const messages = defineMessages({
39
40
  id: 'workspaces.settings.members.removeError',
40
41
  defaultMessage: 'Couldn’t remove that member. Please try again.'
41
42
  },
43
+ lastMember: {
44
+ id: 'workspaces.settings.members.lastMember',
45
+ defaultMessage: 'A workspace needs at least one member. Add someone else first, or delete the workspace.'
46
+ },
42
47
  confirmTitle: {
43
48
  id: 'workspaces.settings.members.confirmTitle',
44
49
  defaultMessage: 'Remove member?'
@@ -67,6 +72,8 @@ export function WorkspaceMembersSettings({ workspace, canUpdate }) {
67
72
  const rosterLabelRef = useRef(null);
68
73
  // Index whose Remove button focus should land on once the roster re-renders.
69
74
  const focusAfterRemoval = useRef(null);
75
+ // Which row opened the confirm dialog, so a dismissal can hand focus back.
76
+ const dismissedId = useRef(null);
70
77
  // Radix restores focus to the dialog's trigger on close — but the mutation
71
78
  // has just unmounted that trigger along with its row, so focus fell to
72
79
  // <body> and a keyboard user was dropped at the top of the document. Land on
@@ -109,8 +116,16 @@ export function WorkspaceMembersSettings({ workspace, canUpdate }) {
109
116
  focusAfterRemoval.current = Math.max(0, removedIndex);
110
117
  toast.success(intl.formatMessage(messages.removed, { name: member.name }));
111
118
  }
112
- catch {
113
- toast.error(intl.formatMessage(messages.removeError));
119
+ catch (error) {
120
+ // The server answers 409 `LastMemberError` for the one member who
121
+ // cannot go — a workspace with nobody in it is unreachable, so the
122
+ // rule is absolute. "Please try again" is the one thing that will
123
+ // never work here, and it is what every caller got: the catch was
124
+ // blind to the status. Both sibling dialogs in this package already
125
+ // narrow the same 409 (content revoke, workspace delete).
126
+ (isConflict(error) ? toast.warning : toast.error)(intl.formatMessage(isConflict(error)
127
+ ? messages.lastMember
128
+ : messages.removeError));
114
129
  }
115
130
  finally {
116
131
  setPendingRemoval(null);
@@ -118,10 +133,31 @@ export function WorkspaceMembersSettings({ workspace, canUpdate }) {
118
133
  };
119
134
  return (_jsxs(Card, { children: [_jsxs(CardHeader, { children: [_jsx(CardTitle, { asChild: true, children: _jsx("h2", { children: intl.formatMessage(messages.title) }) }), _jsx(CardDescription, { children: intl.formatMessage(messages.description) })] }), _jsxs(CardContent, { className: "flex flex-col gap-4", children: [canUpdate ? (_jsx(MemberDirectorySearch, { excludeIds: excludeIds, onSelect: onSelect, busy: addMember.isPending })) : (_jsx("p", { className: "text-sm text-muted-foreground", children: intl.formatMessage(messages.readOnly) })), _jsxs("div", { className: "flex flex-col gap-1", children: [_jsx("span", { ref: rosterLabelRef, tabIndex: -1, className: "text-sm font-medium focus-visible:outline-none", children: intl.formatMessage(messages.rosterLabel, {
120
135
  count: workspace.members.length
121
- }) }), _jsx("ul", { ref: rosterRef, className: "rounded-xl border", children: workspace.members.map((member, index) => (_jsxs("li", { children: [index > 0 ? _jsx(Separator, {}) : null, _jsx(MemberListRow, { member: member, canRemove: canUpdate, onRemove: () => setPendingRemoval(member) })] }, member.id))) })] })] }), _jsx(ConfirmDialog, { open: pendingRemoval !== null, onOpenChange: (open) => {
136
+ }) }), _jsx("ul", { ref: rosterRef, className: "rounded-xl border", children: workspace.members.map((member, index) => (_jsxs("li", { children: [index > 0 ? _jsx(Separator, {}) : null, _jsx(MemberListRow, { member: member, canRemove: canUpdate, onRemove: () => {
137
+ dismissedId.current = member.id;
138
+ setPendingRemoval(member);
139
+ } })] }, member.id))) })] })] }), _jsx(ConfirmDialog, { open: pendingRemoval !== null, onOpenChange: (open) => {
122
140
  if (!open)
123
141
  setPendingRemoval(null);
124
142
  }, title: intl.formatMessage(messages.confirmTitle), description: intl.formatMessage(messages.confirmBody, {
125
143
  name: pendingRemoval?.name ?? ''
126
- }), confirmLabel: intl.formatMessage(messages.confirmAction), confirmVariant: "destructive", busy: removeMember.isPending, onConfirm: confirmRemoval })] }));
144
+ }), confirmLabel: intl.formatMessage(messages.confirmAction), confirmVariant: "destructive", busy: removeMember.isPending, onConfirm: confirmRemoval, onCloseAutoFocus: (event) => {
145
+ // Radix hands focus back to the `DialogTrigger` it holds in
146
+ // context — and this dialog has none, because it is opened
147
+ // from state rather than wrapped around a trigger. Its
148
+ // default therefore focuses nothing and a keyboard user is
149
+ // dropped on <body>, at the top of the document (WCAG
150
+ // 2.4.3). Aim at the row that opened it.
151
+ //
152
+ // Only on a dismissal: after a successful removal that row
153
+ // is gone, and the effect above has already claimed the
154
+ // slot that replaced it.
155
+ if (focusAfterRemoval.current !== null)
156
+ return;
157
+ const button = rosterRef.current?.querySelector(`[data-remove-member][data-member-id="${dismissedId.current}"]`);
158
+ if (!button)
159
+ return;
160
+ event.preventDefault();
161
+ button.focus();
162
+ } })] }));
127
163
  }
@@ -9,7 +9,7 @@ type WorkspacesEmptyProps = {
9
9
  onCreate: () => void;
10
10
  };
11
11
  /**
12
- * The empty state for the grid. When filters are active it offers to clear
12
+ * The empty state for the table. When filters are active it offers to clear
13
13
  * them; otherwise it invites creating the first workspace — but only when the
14
14
  * user holds `workspaces:create`.
15
15
  */
@@ -30,7 +30,7 @@ const messages = defineMessages({
30
30
  }
31
31
  });
32
32
  /**
33
- * The empty state for the grid. When filters are active it offers to clear
33
+ * The empty state for the table. When filters are active it offers to clear
34
34
  * them; otherwise it invites creating the first workspace — but only when the
35
35
  * user holds `workspaces:create`.
36
36
  */
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lib/presentation/components/WorkspacesNavSection/index.tsx"],"names":[],"mappings":"AA8DA;;;;;;;;;;;;GAYG;AACH,wBAAgB,oBAAoB,uCA6FnC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lib/presentation/components/WorkspacesNavSection/index.tsx"],"names":[],"mappings":"AAkEA;;;;;;;;;;;;GAYG;AACH,wBAAgB,oBAAoB,uCA2HnC"}
@@ -18,6 +18,10 @@ const messages = defineMessages({
18
18
  newWorkspace: {
19
19
  id: 'workspaces.sidebar.newWorkspace',
20
20
  defaultMessage: 'New workspace'
21
+ },
22
+ unavailable: {
23
+ id: 'workspaces.sidebar.unavailable',
24
+ defaultMessage: 'Couldn’t load your workspaces.'
21
25
  }
22
26
  });
23
27
  /** One workspace row: a link to the workspace, active on any of its sub-paths. */
@@ -40,17 +44,27 @@ function WorkspaceNavRow({ workspace }) {
40
44
  */
41
45
  export function WorkspacesNavSection() {
42
46
  const intl = useIntl();
43
- const { data: workspaces } = useWorkspaces();
47
+ const { data: workspaces, isError } = useWorkspaces();
44
48
  const canCreate = useHasPermission(WORKSPACES_CREATE);
45
49
  const active = (workspaces ?? []).filter(isActiveWorkspace);
50
+ const heading = intl.formatMessage(messages.heading);
51
+ const newWorkspace = intl.formatMessage(messages.newWorkspace);
52
+ const createAction = canCreate ? (_jsx(SidebarGroupAction, { asChild: true, title: newWorkspace, children: _jsx(Link, { to: "/workspaces/new", "aria-label": newWorkspace, children: _jsx(Plus, {}) }) })) : null;
53
+ // A failed read must not read as an empty membership. On error `data` is
54
+ // undefined, so every branch below would render exactly what someone who
55
+ // genuinely belongs to no workspace sees — the section vanishing, or a bare
56
+ // heading — and the person is told they have no workspaces when in fact we
57
+ // could not find out. Every other surface reading this query already says
58
+ // so (the page, the home panel, the stats strip, the workspace shell); this
59
+ // one is a nav aid, so it says it in one quiet line rather than an alert.
60
+ if (isError) {
61
+ return (_jsxs(SidebarGroup, { children: [_jsx(SidebarGroupLabel, { children: heading }), createAction, _jsx(SidebarGroupContent, { children: _jsx("p", { className: "px-2 text-xs text-sidebar-foreground", children: intl.formatMessage(messages.unavailable) }) })] }));
62
+ }
46
63
  // Nothing to show and nothing to do → skip the section entirely. With create
47
64
  // permission we still show it (the "+" invites creating the first one).
48
65
  if (active.length === 0 && !canCreate) {
49
66
  return null;
50
67
  }
51
- const heading = intl.formatMessage(messages.heading);
52
- const newWorkspace = intl.formatMessage(messages.newWorkspace);
53
- const createAction = canCreate ? (_jsx(SidebarGroupAction, { asChild: true, title: newWorkspace, children: _jsx(Link, { to: "/workspaces/new", "aria-label": newWorkspace, children: _jsx(Plus, {}) }) })) : null;
54
68
  // Nothing to reveal (create permission but no workspaces yet, and every
55
69
  // moment the list query is still in flight) → a plain heading, no
56
70
  // Collapsible at all. Two reasons, and the second is the load-bearing one:
@@ -1,6 +1,6 @@
1
1
  /**
2
- * The Workspaces management page: a searchable, status-filterable grid of
3
- * workspace cards with a create flow. Rendered at `/workspaces` inside the
2
+ * The Workspaces management page: a searchable, status-filterable **table** of
3
+ * workspaces with a create flow. Rendered at `/workspaces` inside the
4
4
  * authenticated shell.
5
5
  */
6
6
  export declare function WorkspacesPage(): import("react").JSX.Element;
@@ -53,8 +53,8 @@ function matchesSearch(workspace, query) {
53
53
  workspace.description.toLowerCase().includes(needle));
54
54
  }
55
55
  /**
56
- * The Workspaces management page: a searchable, status-filterable grid of
57
- * workspace cards with a create flow. Rendered at `/workspaces` inside the
56
+ * The Workspaces management page: a searchable, status-filterable **table** of
57
+ * workspaces with a create flow. Rendered at `/workspaces` inside the
58
58
  * authenticated shell.
59
59
  */
60
60
  export function WorkspacesPage() {
@@ -80,7 +80,7 @@ export function WorkspacesPage() {
80
80
  // `Active`) so it reveals every workspace — including archived ones the
81
81
  // default view hides — matching the empty-state's "see them all" copy. This
82
82
  // also unsticks the all-archived case, where resetting to `Active` would
83
- // leave the grid empty and the clear button a no-op.
83
+ // leave the table empty and the clear button a no-op.
84
84
  const clearFilters = () => {
85
85
  setSearch('');
86
86
  setStatus('All');
@@ -5,16 +5,23 @@ import type { AdminPlugin } from '@orthacms/bootstrap-admin';
5
5
  */
6
6
  export type WorkspacesAdminPlugin = AdminPlugin;
7
7
  /**
8
- * Creates the admin-side workspaces plugin. It owns two things:
8
+ * Creates the admin-side workspaces plugin. It owns two areas and fills six
9
+ * slots.
9
10
  *
10
11
  * 1. **The workspaces management area** — the private `/workspaces` list and
11
- * `/workspaces/new` create wizard, plus the `Layers` toolbar nav entry
12
- * contributed to the shell's {@link NAVBAR_START_SLOT} at `order: 20`.
12
+ * `/workspaces/new` create wizard, plus the `Layers` entry contributed to
13
+ * {@link SIDEBAR_NAV_SLOT} at `order: 10`.
13
14
  * 2. **The workspace shell** — the `/workspaces/:id/*` layout (left rail +
14
- * switcher) that opens when a workspace card is clicked. The plugin owns the
15
- * rail slots; feature plugins (Content/Media/Insights) contribute their rail
16
- * buttons + routes there. Workspaces itself contributes the last-section
17
- * **Settings** entry + its `/workspaces/:id/settings` page.
15
+ * switcher) that opens when a workspace row is clicked. The plugin owns the
16
+ * rail slots ({@link WORKSPACE_NAV_SLOT}, {@link WORKSPACE_ROUTE_SLOT});
17
+ * feature plugins (Content/Media/Insights) contribute their rail buttons +
18
+ * routes there. Workspaces itself contributes the last-section **Settings**
19
+ * entry + its `/workspaces/:id/settings` page.
20
+ *
21
+ * It also reaches two surfaces outside those areas: the workspace quick-list
22
+ * and switcher in {@link SIDEBAR_SECTION_SLOT}, and the command palette's
23
+ * workspace results in {@link COMMAND_SLOT}, plus the home tiles and panel in
24
+ * {@link HOME_SECTION_SLOT}.
18
25
  *
19
26
  * @example
20
27
  * ```typescript
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/presentation/workspacesPlugin/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAiD7D;;;GAGG;AACH,MAAM,MAAM,qBAAqB,GAAG,WAAW,CAAC;AAEhD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,gBAAgB,IAAI,qBAAqB,CAyHxD"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/presentation/workspacesPlugin/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAiD7D;;;GAGG;AACH,MAAM,MAAM,qBAAqB,GAAG,WAAW,CAAC;AAEhD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,gBAAgB,IAAI,qBAAqB,CAyHxD"}
@@ -23,16 +23,23 @@ const WorkspaceSettingsPage = lazy(() => import('../pages/WorkspaceSettingsPage'
23
23
  default: module.WorkspaceSettingsPage
24
24
  })));
25
25
  /**
26
- * Creates the admin-side workspaces plugin. It owns two things:
26
+ * Creates the admin-side workspaces plugin. It owns two areas and fills six
27
+ * slots.
27
28
  *
28
29
  * 1. **The workspaces management area** — the private `/workspaces` list and
29
- * `/workspaces/new` create wizard, plus the `Layers` toolbar nav entry
30
- * contributed to the shell's {@link NAVBAR_START_SLOT} at `order: 20`.
30
+ * `/workspaces/new` create wizard, plus the `Layers` entry contributed to
31
+ * {@link SIDEBAR_NAV_SLOT} at `order: 10`.
31
32
  * 2. **The workspace shell** — the `/workspaces/:id/*` layout (left rail +
32
- * switcher) that opens when a workspace card is clicked. The plugin owns the
33
- * rail slots; feature plugins (Content/Media/Insights) contribute their rail
34
- * buttons + routes there. Workspaces itself contributes the last-section
35
- * **Settings** entry + its `/workspaces/:id/settings` page.
33
+ * switcher) that opens when a workspace row is clicked. The plugin owns the
34
+ * rail slots ({@link WORKSPACE_NAV_SLOT}, {@link WORKSPACE_ROUTE_SLOT});
35
+ * feature plugins (Content/Media/Insights) contribute their rail buttons +
36
+ * routes there. Workspaces itself contributes the last-section **Settings**
37
+ * entry + its `/workspaces/:id/settings` page.
38
+ *
39
+ * It also reaches two surfaces outside those areas: the workspace quick-list
40
+ * and switcher in {@link SIDEBAR_SECTION_SLOT}, and the command palette's
41
+ * workspace results in {@link COMMAND_SLOT}, plus the home tiles and panel in
42
+ * {@link HOME_SECTION_SLOT}.
36
43
  *
37
44
  * @example
38
45
  * ```typescript
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orthacms/workspaces-admin",
3
- "version": "0.4.3",
3
+ "version": "0.5.0",
4
4
  "description": "@orthacms/workspaces-admin — part of Ortha CMS.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/ortha-source/ortha-cms/tree/main/packages/workspaces/admin",
@@ -25,11 +25,11 @@
25
25
  "dist"
26
26
  ],
27
27
  "dependencies": {
28
- "@orthacms/bootstrap-admin": "^0.4.3",
29
- "@orthacms/design-system": "^0.4.3",
30
- "@orthacms/identity-admin": "^0.4.3",
31
- "@orthacms/shell-admin": "^0.4.3",
32
- "@orthacms/utils-admin": "^0.4.3",
28
+ "@orthacms/bootstrap-admin": "^0.5.0",
29
+ "@orthacms/design-system": "^0.5.0",
30
+ "@orthacms/identity-admin": "^0.5.0",
31
+ "@orthacms/shell-admin": "^0.5.0",
32
+ "@orthacms/utils-admin": "^0.5.0",
33
33
  "@tanstack/react-form": "^1.0.0",
34
34
  "@tanstack/react-query": "^5.0.0",
35
35
  "lucide-react": "^1.17.0",
@@ -1,15 +0,0 @@
1
- import type { Workspace } from '../../types/workspace';
2
- /** Grants a workspace access to one content type. */
3
- export type AddWorkspaceContentInput = {
4
- /** The workspace to grant. */
5
- workspaceId: string;
6
- /** The content-type slug to grant. */
7
- slug: string;
8
- };
9
- /**
10
- * Grants a workspace access to a content type (idempotent server-side).
11
- * Invalidates the workspaces list so the granted slug shows in settings and the
12
- * Content Library scopes to it.
13
- */
14
- export declare function useAddWorkspaceContent(): import("@tanstack/react-query").UseMutationResult<Workspace, Error, AddWorkspaceContentInput, unknown>;
15
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/api/useAddWorkspaceContent/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAOvD,qDAAqD;AACrD,MAAM,MAAM,wBAAwB,GAAG;IACnC,8BAA8B;IAC9B,WAAW,EAAE,MAAM,CAAC;IACpB,sCAAsC;IACtC,IAAI,EAAE,MAAM,CAAC;CAChB,CAAC;AAkBF;;;;GAIG;AACH,wBAAgB,sBAAsB,2GAQrC"}
@@ -1,14 +0,0 @@
1
- import type { Workspace } from '../../types/workspace';
2
- /** Links an existing directory user to a workspace. */
3
- export type AddWorkspaceMemberInput = {
4
- /** The workspace to add the member to. */
5
- workspaceId: string;
6
- /** The directory user id to link. */
7
- userId: string;
8
- };
9
- /**
10
- * Adds an existing user to a workspace (idempotent server-side). Invalidates the
11
- * workspaces list so the member appears in the settings roster.
12
- */
13
- export declare function useAddWorkspaceMember(): import("@tanstack/react-query").UseMutationResult<Workspace, Error, AddWorkspaceMemberInput, unknown>;
14
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/api/useAddWorkspaceMember/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAOvD,uDAAuD;AACvD,MAAM,MAAM,uBAAuB,GAAG;IAClC,0CAA0C;IAC1C,WAAW,EAAE,MAAM,CAAC;IACpB,qCAAqC;IACrC,MAAM,EAAE,MAAM,CAAC;CAClB,CAAC;AAkBF;;;GAGG;AACH,wBAAgB,qBAAqB,0GAQpC"}
@@ -1,10 +0,0 @@
1
- import type { ContentType } from '../../types/wizard';
2
- /** Query key for the content-types list. */
3
- export declare const contentTypesKey: readonly ["content-types"];
4
- /**
5
- * Loads every content type so the content step can split them into collections
6
- * and pages. Returns the standard TanStack Query result; callers read `data`,
7
- * `isPending`, and `isError`.
8
- */
9
- export declare function useContentTypes(): import("@tanstack/react-query").UseQueryResult<NoInfer<ContentType[]>, Error>;
10
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/api/useContentTypes/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEtD,4CAA4C;AAC5C,eAAO,MAAM,eAAe,4BAA6B,CAAC;AAY1D;;;;GAIG;AACH,wBAAgB,eAAe,kFAM9B"}
@@ -1,20 +0,0 @@
1
- import type { Workspace, WorkspaceMember } from '../../types/workspace';
2
- import type { CreateWorkspaceBody } from '../../types/wizard';
3
- /**
4
- * Arguments to the create mutation: the API request body plus the creator. The
5
- * server derives the owner from the session and ignores `creator`; it's kept
6
- * only so the optimistic update can seed a card before the response lands.
7
- */
8
- export type CreateWorkspaceArgs = {
9
- body: CreateWorkspaceBody;
10
- creator: WorkspaceMember;
11
- };
12
- /**
13
- * Creates a workspace and optimistically inserts it at the top of the list, so
14
- * the new card appears the instant the form is submitted. Rolls back on error
15
- * and reconciles with the server result on settle.
16
- */
17
- export declare function useCreateWorkspace(): import("@tanstack/react-query").UseMutationResult<Workspace, Error, CreateWorkspaceArgs, {
18
- previous: Workspace[] | undefined;
19
- }>;
20
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/api/useCreateWorkspace/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAO9D;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAC9B,IAAI,EAAE,mBAAmB,CAAC;IAC1B,OAAO,EAAE,eAAe,CAAC;CAC5B,CAAC;AAiBF;;;;GAIG;AACH,wBAAgB,kBAAkB;;GAuCjC"}
@@ -1,13 +0,0 @@
1
- /**
2
- * Permanently deletes a workspace. On success it invalidates the workspaces
3
- * list so the deleted workspace drops out of the grid; the caller navigates away
4
- * from the (now-gone) shell route.
5
- *
6
- * `onSuccess` deliberately does **not** return the `invalidateQueries` promise:
7
- * awaiting it would delay `mutateAsync` until the list refetches without this
8
- * workspace, so the shell would re-render and flash its "workspace not found"
9
- * state before the caller's `navigate('/workspaces')` runs. Firing the
10
- * invalidation without awaiting lets the caller redirect first.
11
- */
12
- export declare function useDeleteWorkspace(): import("@tanstack/react-query").UseMutationResult<void, Error, string, unknown>;
13
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/api/useDeleteWorkspace/index.ts"],"names":[],"mappings":"AAaA;;;;;;;;;;GAUG;AACH,wBAAgB,kBAAkB,oFASjC"}
@@ -1,15 +0,0 @@
1
- import type { Workspace } from '../../types/workspace';
2
- /** Revokes a workspace's access to one content type. */
3
- export type RemoveWorkspaceContentInput = {
4
- /** The workspace to revoke from. */
5
- workspaceId: string;
6
- /** The content-type slug to revoke. */
7
- slug: string;
8
- };
9
- /**
10
- * Revokes a workspace's access to a content type — only when it's empty
11
- * (a `409` otherwise, surfaced via the thrown {@link ApiError}). Invalidates the
12
- * workspaces list on success.
13
- */
14
- export declare function useRemoveWorkspaceContent(): import("@tanstack/react-query").UseMutationResult<Workspace, Error, RemoveWorkspaceContentInput, unknown>;
15
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/api/useRemoveWorkspaceContent/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAOvD,wDAAwD;AACxD,MAAM,MAAM,2BAA2B,GAAG;IACtC,oCAAoC;IACpC,WAAW,EAAE,MAAM,CAAC;IACpB,uCAAuC;IACvC,IAAI,EAAE,MAAM,CAAC;CAChB,CAAC;AAqBF;;;;GAIG;AACH,wBAAgB,yBAAyB,8GAQxC"}
@@ -1,13 +0,0 @@
1
- /** Removes a member's link to a workspace. */
2
- export type RemoveWorkspaceMemberInput = {
3
- /** The workspace to remove the member from. */
4
- workspaceId: string;
5
- /** The member's user id. */
6
- userId: string;
7
- };
8
- /**
9
- * Removes a member from a workspace (a no-op server-side if they weren't one).
10
- * Invalidates the workspaces list so the roster updates.
11
- */
12
- export declare function useRemoveWorkspaceMember(): import("@tanstack/react-query").UseMutationResult<void, Error, RemoveWorkspaceMemberInput, unknown>;
13
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/api/useRemoveWorkspaceMember/index.ts"],"names":[],"mappings":"AAIA,8CAA8C;AAC9C,MAAM,MAAM,0BAA0B,GAAG;IACrC,+CAA+C;IAC/C,WAAW,EAAE,MAAM,CAAC;IACpB,4BAA4B;IAC5B,MAAM,EAAE,MAAM,CAAC;CAClB,CAAC;AAgBF;;;GAGG;AACH,wBAAgB,wBAAwB,wGAQvC"}
@@ -1,14 +0,0 @@
1
- import type { Workspace, WorkspaceStatus } from '../../types/workspace';
2
- /** The target lifecycle status for a workspace. */
3
- export type SetWorkspaceStatusInput = {
4
- /** The workspace to archive/unarchive. */
5
- id: string;
6
- /** The desired status. */
7
- status: WorkspaceStatus;
8
- };
9
- /**
10
- * Flips a workspace between active and archived. Invalidates the workspaces list
11
- * on success so the shell and grid reflect the new status.
12
- */
13
- export declare function useSetWorkspaceStatus(): import("@tanstack/react-query").UseMutationResult<Workspace, Error, SetWorkspaceStatusInput, unknown>;
14
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/api/useSetWorkspaceStatus/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAOxE,mDAAmD;AACnD,MAAM,MAAM,uBAAuB,GAAG;IAClC,0CAA0C;IAC1C,EAAE,EAAE,MAAM,CAAC;IACX,0BAA0B;IAC1B,MAAM,EAAE,eAAe,CAAC;CAC3B,CAAC;AAqBF;;;GAGG;AACH,wBAAgB,qBAAqB,0GAQpC"}
@@ -1,10 +0,0 @@
1
- import { SlugStatus } from '../../types/wizard';
2
- /**
3
- * Live slug-availability check. Debounces input (300ms), then resolves to
4
- * {@link SlugStatus.Available} / {@link SlugStatus.Taken}. Returns
5
- * {@link SlugStatus.Empty} for blank input, {@link SlugStatus.Invalid} when the
6
- * value breaks the `^[a-z0-9-]+$` pattern, and {@link SlugStatus.Checking} while
7
- * debouncing or fetching.
8
- */
9
- export declare function useSlugAvailability(slug: string): SlugStatus;
10
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/api/useSlugAvailability/index.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAiBhD;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,CAe5D"}
@@ -1,23 +0,0 @@
1
- import type { AvatarColor } from '@ortha-cms/design-system';
2
- import type { Workspace } from '../../types/workspace';
3
- /**
4
- * A partial profile edit: the target workspace id plus any of the editable
5
- * fields. Only the fields present are sent; the server writes just those.
6
- */
7
- export type UpdateWorkspaceInput = {
8
- /** The workspace to edit. */
9
- id: string;
10
- /** New display name. */
11
- name?: string;
12
- /** New description (an empty string clears it). */
13
- description?: string;
14
- /** New accent color. */
15
- color?: AvatarColor;
16
- };
17
- /**
18
- * Edits a workspace's name / description / color. On success it invalidates the
19
- * workspaces list so the shell (which reads the open workspace from that list)
20
- * re-resolves with the new values.
21
- */
22
- export declare function useUpdateWorkspace(): import("@tanstack/react-query").UseMutationResult<Workspace, Error, UpdateWorkspaceInput, unknown>;
23
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/api/useUpdateWorkspace/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAOvD;;;GAGG;AACH,MAAM,MAAM,oBAAoB,GAAG;IAC/B,6BAA6B;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,wBAAwB;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,mDAAmD;IACnD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,wBAAwB;IACxB,KAAK,CAAC,EAAE,WAAW,CAAC;CACvB,CAAC;AAkBF;;;;GAIG;AACH,wBAAgB,kBAAkB,uGAQjC"}
@@ -1,17 +0,0 @@
1
- import type { DirectoryUser } from '../../types/wizard';
2
- /** Result of {@link useUsersSearch}. */
3
- export type UsersSearchResult = {
4
- /** Matching directory users (empty until a debounced query resolves). */
5
- users: DirectoryUser[];
6
- /** Whether a search is currently in flight. */
7
- loading: boolean;
8
- /** Whether the underlying search query failed. */
9
- isError: boolean;
10
- };
11
- /**
12
- * Searches the user directory for the member typeahead. Debounces the query
13
- * (250ms) so each keystroke doesn't fire a request, and only runs once at least
14
- * one character has been typed.
15
- */
16
- export declare function useUsersSearch(query: string): UsersSearchResult;
17
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/api/useUsersSearch/index.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD,wCAAwC;AACxC,MAAM,MAAM,iBAAiB,GAAG;IAC5B,yEAAyE;IACzE,KAAK,EAAE,aAAa,EAAE,CAAC;IACvB,+CAA+C;IAC/C,OAAO,EAAE,OAAO,CAAC;IACjB,kDAAkD;IAClD,OAAO,EAAE,OAAO,CAAC;CACpB,CAAC;AA0CF;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,iBAAiB,CAgB/D"}