@orthacms/workspaces-admin 0.0.0-reserve.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 (409) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +7 -0
  3. package/dist/index.d.ts +9 -0
  4. package/dist/index.d.ts.map +1 -0
  5. package/dist/index.js +8 -0
  6. package/dist/lib/api/useAddWorkspaceContent/index.d.ts +15 -0
  7. package/dist/lib/api/useAddWorkspaceContent/index.d.ts.map +1 -0
  8. package/dist/lib/api/useAddWorkspaceMember/index.d.ts +14 -0
  9. package/dist/lib/api/useAddWorkspaceMember/index.d.ts.map +1 -0
  10. package/dist/lib/api/useContentTypes/index.d.ts +10 -0
  11. package/dist/lib/api/useContentTypes/index.d.ts.map +1 -0
  12. package/dist/lib/api/useCreateWorkspace/index.d.ts +20 -0
  13. package/dist/lib/api/useCreateWorkspace/index.d.ts.map +1 -0
  14. package/dist/lib/api/useDeleteWorkspace/index.d.ts +13 -0
  15. package/dist/lib/api/useDeleteWorkspace/index.d.ts.map +1 -0
  16. package/dist/lib/api/useRemoveWorkspaceContent/index.d.ts +15 -0
  17. package/dist/lib/api/useRemoveWorkspaceContent/index.d.ts.map +1 -0
  18. package/dist/lib/api/useRemoveWorkspaceMember/index.d.ts +13 -0
  19. package/dist/lib/api/useRemoveWorkspaceMember/index.d.ts.map +1 -0
  20. package/dist/lib/api/useSetWorkspaceStatus/index.d.ts +14 -0
  21. package/dist/lib/api/useSetWorkspaceStatus/index.d.ts.map +1 -0
  22. package/dist/lib/api/useSlugAvailability/index.d.ts +10 -0
  23. package/dist/lib/api/useSlugAvailability/index.d.ts.map +1 -0
  24. package/dist/lib/api/useUpdateWorkspace/index.d.ts +23 -0
  25. package/dist/lib/api/useUpdateWorkspace/index.d.ts.map +1 -0
  26. package/dist/lib/api/useUsersSearch/index.d.ts +17 -0
  27. package/dist/lib/api/useUsersSearch/index.d.ts.map +1 -0
  28. package/dist/lib/api/useWorkspaceContentCount/index.d.ts +8 -0
  29. package/dist/lib/api/useWorkspaceContentCount/index.d.ts.map +1 -0
  30. package/dist/lib/api/useWorkspaceEntryCount/index.d.ts +8 -0
  31. package/dist/lib/api/useWorkspaceEntryCount/index.d.ts.map +1 -0
  32. package/dist/lib/api/useWorkspaces/index.d.ts +30 -0
  33. package/dist/lib/api/useWorkspaces/index.d.ts.map +1 -0
  34. package/dist/lib/application/useAddWorkspaceContent/index.d.ts +9 -0
  35. package/dist/lib/application/useAddWorkspaceContent/index.d.ts.map +1 -0
  36. package/dist/lib/application/useAddWorkspaceContent/index.js +15 -0
  37. package/dist/lib/application/useAddWorkspaceMember/index.d.ts +8 -0
  38. package/dist/lib/application/useAddWorkspaceMember/index.d.ts.map +1 -0
  39. package/dist/lib/application/useAddWorkspaceMember/index.js +14 -0
  40. package/dist/lib/application/useContentTypes/index.d.ts +9 -0
  41. package/dist/lib/application/useContentTypes/index.d.ts.map +1 -0
  42. package/dist/lib/application/useContentTypes/index.js +16 -0
  43. package/dist/lib/application/useCreateWorkspace/index.d.ts +20 -0
  44. package/dist/lib/application/useCreateWorkspace/index.d.ts.map +1 -0
  45. package/dist/lib/application/useCreateWorkspace/index.js +44 -0
  46. package/dist/lib/application/useCreateWorkspaceFlow/index.d.ts +23 -0
  47. package/dist/lib/application/useCreateWorkspaceFlow/index.d.ts.map +1 -0
  48. package/dist/lib/application/useCreateWorkspaceFlow/index.js +81 -0
  49. package/dist/lib/application/useDeleteWorkspace/index.d.ts +13 -0
  50. package/dist/lib/application/useDeleteWorkspace/index.d.ts.map +1 -0
  51. package/dist/lib/application/useDeleteWorkspace/index.js +23 -0
  52. package/dist/lib/application/useRemoveWorkspaceContent/index.d.ts +9 -0
  53. package/dist/lib/application/useRemoveWorkspaceContent/index.d.ts.map +1 -0
  54. package/dist/lib/application/useRemoveWorkspaceContent/index.js +15 -0
  55. package/dist/lib/application/useRemoveWorkspaceMember/index.d.ts +8 -0
  56. package/dist/lib/application/useRemoveWorkspaceMember/index.d.ts.map +1 -0
  57. package/dist/lib/application/useRemoveWorkspaceMember/index.js +14 -0
  58. package/dist/lib/application/useSetWorkspaceStatus/index.d.ts +9 -0
  59. package/dist/lib/application/useSetWorkspaceStatus/index.d.ts.map +1 -0
  60. package/dist/lib/application/useSetWorkspaceStatus/index.js +15 -0
  61. package/dist/lib/application/useSlugAvailability/index.d.ts +18 -0
  62. package/dist/lib/application/useSlugAvailability/index.d.ts.map +1 -0
  63. package/dist/lib/application/useSlugAvailability/index.js +39 -0
  64. package/dist/lib/application/useUpdateWorkspace/index.d.ts +9 -0
  65. package/dist/lib/application/useUpdateWorkspace/index.d.ts.map +1 -0
  66. package/dist/lib/application/useUpdateWorkspace/index.js +15 -0
  67. package/dist/lib/application/useUsersSearch/index.d.ts +18 -0
  68. package/dist/lib/application/useUsersSearch/index.d.ts.map +1 -0
  69. package/dist/lib/application/useUsersSearch/index.js +24 -0
  70. package/dist/lib/application/useWorkspaceContentCount/index.d.ts +8 -0
  71. package/dist/lib/application/useWorkspaceContentCount/index.d.ts.map +1 -0
  72. package/dist/lib/application/useWorkspaceContentCount/index.js +17 -0
  73. package/dist/lib/application/useWorkspaceEntryCount/index.d.ts +8 -0
  74. package/dist/lib/application/useWorkspaceEntryCount/index.d.ts.map +1 -0
  75. package/dist/lib/application/useWorkspaceEntryCount/index.js +17 -0
  76. package/dist/lib/application/useWorkspaces/index.d.ts +5 -0
  77. package/dist/lib/application/useWorkspaces/index.d.ts.map +1 -0
  78. package/dist/lib/application/useWorkspaces/index.js +11 -0
  79. package/dist/lib/components/BlockingConfirmDialog/index.d.ts +41 -0
  80. package/dist/lib/components/BlockingConfirmDialog/index.d.ts.map +1 -0
  81. package/dist/lib/components/ColorSwatchRow/index.d.ts +15 -0
  82. package/dist/lib/components/ColorSwatchRow/index.d.ts.map +1 -0
  83. package/dist/lib/components/CreateWorkspaceWizard/ColorSwatchRow/index.d.ts +15 -0
  84. package/dist/lib/components/CreateWorkspaceWizard/ColorSwatchRow/index.d.ts.map +1 -0
  85. package/dist/lib/components/CreateWorkspaceWizard/ContentStep/ModeTiles/index.d.ts +11 -0
  86. package/dist/lib/components/CreateWorkspaceWizard/ContentStep/ModeTiles/index.d.ts.map +1 -0
  87. package/dist/lib/components/CreateWorkspaceWizard/ContentStep/ResourceSection/index.d.ts +48 -0
  88. package/dist/lib/components/CreateWorkspaceWizard/ContentStep/ResourceSection/index.d.ts.map +1 -0
  89. package/dist/lib/components/CreateWorkspaceWizard/ContentStep/index.d.ts +23 -0
  90. package/dist/lib/components/CreateWorkspaceWizard/ContentStep/index.d.ts.map +1 -0
  91. package/dist/lib/components/CreateWorkspaceWizard/IdentityFields/index.d.ts +17 -0
  92. package/dist/lib/components/CreateWorkspaceWizard/IdentityFields/index.d.ts.map +1 -0
  93. package/dist/lib/components/CreateWorkspaceWizard/MembersStep/MemberRow/index.d.ts +14 -0
  94. package/dist/lib/components/CreateWorkspaceWizard/MembersStep/MemberRow/index.d.ts.map +1 -0
  95. package/dist/lib/components/CreateWorkspaceWizard/MembersStep/MemberTypeahead/index.d.ts +15 -0
  96. package/dist/lib/components/CreateWorkspaceWizard/MembersStep/MemberTypeahead/index.d.ts.map +1 -0
  97. package/dist/lib/components/CreateWorkspaceWizard/MembersStep/index.d.ts +17 -0
  98. package/dist/lib/components/CreateWorkspaceWizard/MembersStep/index.d.ts.map +1 -0
  99. package/dist/lib/components/CreateWorkspaceWizard/Monogram/index.d.ts +17 -0
  100. package/dist/lib/components/CreateWorkspaceWizard/Monogram/index.d.ts.map +1 -0
  101. package/dist/lib/components/CreateWorkspaceWizard/SlugField/index.d.ts +23 -0
  102. package/dist/lib/components/CreateWorkspaceWizard/SlugField/index.d.ts.map +1 -0
  103. package/dist/lib/components/StatusChip/index.d.ts +9 -0
  104. package/dist/lib/components/StatusChip/index.d.ts.map +1 -0
  105. package/dist/lib/components/WorkspaceAvatar/index.d.ts +20 -0
  106. package/dist/lib/components/WorkspaceAvatar/index.d.ts.map +1 -0
  107. package/dist/lib/components/WorkspaceCard/MemberStack/MemberListPopover/index.d.ts +9 -0
  108. package/dist/lib/components/WorkspaceCard/MemberStack/MemberListPopover/index.d.ts.map +1 -0
  109. package/dist/lib/components/WorkspaceCard/MemberStack/index.d.ts +11 -0
  110. package/dist/lib/components/WorkspaceCard/MemberStack/index.d.ts.map +1 -0
  111. package/dist/lib/components/WorkspaceCard/StatusChip/index.d.ts +9 -0
  112. package/dist/lib/components/WorkspaceCard/StatusChip/index.d.ts.map +1 -0
  113. package/dist/lib/components/WorkspaceCard/index.d.ts +15 -0
  114. package/dist/lib/components/WorkspaceCard/index.d.ts.map +1 -0
  115. package/dist/lib/components/WorkspaceCommands/index.d.ts +8 -0
  116. package/dist/lib/components/WorkspaceCommands/index.d.ts.map +1 -0
  117. package/dist/lib/components/WorkspaceContentSettings/AddContentDialog/index.d.ts +26 -0
  118. package/dist/lib/components/WorkspaceContentSettings/AddContentDialog/index.d.ts.map +1 -0
  119. package/dist/lib/components/WorkspaceContentSettings/GrantedContentGroup/index.d.ts +21 -0
  120. package/dist/lib/components/WorkspaceContentSettings/GrantedContentGroup/index.d.ts.map +1 -0
  121. package/dist/lib/components/WorkspaceContentSettings/GrantedContentRow/index.d.ts +26 -0
  122. package/dist/lib/components/WorkspaceContentSettings/GrantedContentRow/index.d.ts.map +1 -0
  123. package/dist/lib/components/WorkspaceContentSettings/RemoveContentDialog/index.d.ts +25 -0
  124. package/dist/lib/components/WorkspaceContentSettings/RemoveContentDialog/index.d.ts.map +1 -0
  125. package/dist/lib/components/WorkspaceContentSettings/index.d.ts +25 -0
  126. package/dist/lib/components/WorkspaceContentSettings/index.d.ts.map +1 -0
  127. package/dist/lib/components/WorkspaceDangerSettings/DeleteWorkspaceDialog/index.d.ts +22 -0
  128. package/dist/lib/components/WorkspaceDangerSettings/DeleteWorkspaceDialog/index.d.ts.map +1 -0
  129. package/dist/lib/components/WorkspaceDangerSettings/index.d.ts +18 -0
  130. package/dist/lib/components/WorkspaceDangerSettings/index.d.ts.map +1 -0
  131. package/dist/lib/components/WorkspaceGeneralSettings/index.d.ts +18 -0
  132. package/dist/lib/components/WorkspaceGeneralSettings/index.d.ts.map +1 -0
  133. package/dist/lib/components/WorkspaceMembersSettings/MemberDirectorySearch/index.d.ts +18 -0
  134. package/dist/lib/components/WorkspaceMembersSettings/MemberDirectorySearch/index.d.ts.map +1 -0
  135. package/dist/lib/components/WorkspaceMembersSettings/MemberListRow/index.d.ts +17 -0
  136. package/dist/lib/components/WorkspaceMembersSettings/MemberListRow/index.d.ts.map +1 -0
  137. package/dist/lib/components/WorkspaceMembersSettings/index.d.ts +16 -0
  138. package/dist/lib/components/WorkspaceMembersSettings/index.d.ts.map +1 -0
  139. package/dist/lib/components/WorkspaceNav/WorkspaceNavButton/index.d.ts +14 -0
  140. package/dist/lib/components/WorkspaceNav/WorkspaceNavButton/index.d.ts.map +1 -0
  141. package/dist/lib/components/WorkspaceNav/WorkspaceSwitcher/index.d.ts +16 -0
  142. package/dist/lib/components/WorkspaceNav/WorkspaceSwitcher/index.d.ts.map +1 -0
  143. package/dist/lib/components/WorkspaceNav/index.d.ts +14 -0
  144. package/dist/lib/components/WorkspaceNav/index.d.ts.map +1 -0
  145. package/dist/lib/components/WorkspaceSettingsRail/index.d.ts +14 -0
  146. package/dist/lib/components/WorkspaceSettingsRail/index.d.ts.map +1 -0
  147. package/dist/lib/components/WorkspaceSettingsTabs/index.d.ts +14 -0
  148. package/dist/lib/components/WorkspaceSettingsTabs/index.d.ts.map +1 -0
  149. package/dist/lib/components/WorkspaceSettingsTopBar/index.d.ts +8 -0
  150. package/dist/lib/components/WorkspaceSettingsTopBar/index.d.ts.map +1 -0
  151. package/dist/lib/components/WorkspaceShell/NewWorkspaceButton/index.d.ts +7 -0
  152. package/dist/lib/components/WorkspaceShell/NewWorkspaceButton/index.d.ts.map +1 -0
  153. package/dist/lib/components/WorkspaceShell/RailTooltip/index.d.ts +22 -0
  154. package/dist/lib/components/WorkspaceShell/RailTooltip/index.d.ts.map +1 -0
  155. package/dist/lib/components/WorkspaceShell/WorkspaceRail/index.d.ts +17 -0
  156. package/dist/lib/components/WorkspaceShell/WorkspaceRail/index.d.ts.map +1 -0
  157. package/dist/lib/components/WorkspaceShell/WorkspaceSidebarButton/index.d.ts +17 -0
  158. package/dist/lib/components/WorkspaceShell/WorkspaceSidebarButton/index.d.ts.map +1 -0
  159. package/dist/lib/components/WorkspaceShell/WorkspaceSwitcher/WorkspaceSwitcherPopover/index.d.ts +26 -0
  160. package/dist/lib/components/WorkspaceShell/WorkspaceSwitcher/WorkspaceSwitcherPopover/index.d.ts.map +1 -0
  161. package/dist/lib/components/WorkspaceShell/WorkspaceSwitcher/index.d.ts +17 -0
  162. package/dist/lib/components/WorkspaceShell/WorkspaceSwitcher/index.d.ts.map +1 -0
  163. package/dist/lib/components/WorkspaceShell/index.d.ts +16 -0
  164. package/dist/lib/components/WorkspaceShell/index.d.ts.map +1 -0
  165. package/dist/lib/components/WorkspaceStats/index.d.ts +9 -0
  166. package/dist/lib/components/WorkspaceStats/index.d.ts.map +1 -0
  167. package/dist/lib/components/WorkspaceToolbar/index.d.ts +22 -0
  168. package/dist/lib/components/WorkspaceToolbar/index.d.ts.map +1 -0
  169. package/dist/lib/components/WorkspacesEmpty/index.d.ts +18 -0
  170. package/dist/lib/components/WorkspacesEmpty/index.d.ts.map +1 -0
  171. package/dist/lib/components/WorkspacesHomePanel/index.d.ts +7 -0
  172. package/dist/lib/components/WorkspacesHomePanel/index.d.ts.map +1 -0
  173. package/dist/lib/components/WorkspacesNavSection/index.d.ts +9 -0
  174. package/dist/lib/components/WorkspacesNavSection/index.d.ts.map +1 -0
  175. package/dist/lib/components/WorkspacesSkeleton/index.d.ts +36 -0
  176. package/dist/lib/components/WorkspacesSkeleton/index.d.ts.map +1 -0
  177. package/dist/lib/components/WorkspacesTable/index.d.ts +12 -0
  178. package/dist/lib/components/WorkspacesTable/index.d.ts.map +1 -0
  179. package/dist/lib/domain/isActiveWorkspace/index.d.ts +9 -0
  180. package/dist/lib/domain/isActiveWorkspace/index.d.ts.map +1 -0
  181. package/dist/lib/domain/isActiveWorkspace/index.js +9 -0
  182. package/dist/lib/domain/permissions/index.d.ts +7 -0
  183. package/dist/lib/domain/permissions/index.d.ts.map +1 -0
  184. package/dist/lib/domain/permissions/index.js +6 -0
  185. package/dist/lib/domain/resourceSelection/index.d.ts +18 -0
  186. package/dist/lib/domain/resourceSelection/index.d.ts.map +1 -0
  187. package/dist/lib/domain/resourceSelection/index.js +49 -0
  188. package/dist/lib/domain/slug/index.d.ts +25 -0
  189. package/dist/lib/domain/slug/index.d.ts.map +1 -0
  190. package/dist/lib/domain/slug/index.js +45 -0
  191. package/dist/lib/domain/types/wizard/index.d.ts +126 -0
  192. package/dist/lib/domain/types/wizard/index.d.ts.map +1 -0
  193. package/dist/lib/domain/types/wizard/index.js +21 -0
  194. package/dist/lib/domain/types/workspace/index.d.ts +42 -0
  195. package/dist/lib/domain/types/workspace/index.d.ts.map +1 -0
  196. package/dist/lib/domain/types/workspace/index.js +1 -0
  197. package/dist/lib/domain/workspaceLimits/index.d.ts +23 -0
  198. package/dist/lib/domain/workspaceLimits/index.d.ts.map +1 -0
  199. package/dist/lib/domain/workspaceLimits/index.js +22 -0
  200. package/dist/lib/hooks/useBasicsSchema/index.d.ts +14 -0
  201. package/dist/lib/hooks/useBasicsSchema/index.d.ts.map +1 -0
  202. package/dist/lib/hooks/useResourceSelection/index.d.ts +21 -0
  203. package/dist/lib/hooks/useResourceSelection/index.d.ts.map +1 -0
  204. package/dist/lib/hooks/useSlug/index.d.ts +28 -0
  205. package/dist/lib/hooks/useSlug/index.d.ts.map +1 -0
  206. package/dist/lib/hooks/useWizard/index.d.ts +57 -0
  207. package/dist/lib/hooks/useWizard/index.d.ts.map +1 -0
  208. package/dist/lib/hooks/useWorkspaceProfileSchema/index.d.ts +13 -0
  209. package/dist/lib/hooks/useWorkspaceProfileSchema/index.d.ts.map +1 -0
  210. package/dist/lib/infrastructure/buildCreateWorkspaceBody/index.d.ts +12 -0
  211. package/dist/lib/infrastructure/buildCreateWorkspaceBody/index.d.ts.map +1 -0
  212. package/dist/lib/infrastructure/buildCreateWorkspaceBody/index.js +27 -0
  213. package/dist/lib/infrastructure/httpWorkspaceGateway/index.d.ts +10 -0
  214. package/dist/lib/infrastructure/httpWorkspaceGateway/index.d.ts.map +1 -0
  215. package/dist/lib/infrastructure/httpWorkspaceGateway/index.js +149 -0
  216. package/dist/lib/infrastructure/isConflict/index.d.ts +8 -0
  217. package/dist/lib/infrastructure/isConflict/index.d.ts.map +1 -0
  218. package/dist/lib/infrastructure/isConflict/index.js +12 -0
  219. package/dist/lib/infrastructure/workspaceGateway/index.d.ts +90 -0
  220. package/dist/lib/infrastructure/workspaceGateway/index.d.ts.map +1 -0
  221. package/dist/lib/infrastructure/workspaceGateway/index.js +1 -0
  222. package/dist/lib/infrastructure/workspaceMapper/index.d.ts +28 -0
  223. package/dist/lib/infrastructure/workspaceMapper/index.d.ts.map +1 -0
  224. package/dist/lib/infrastructure/workspaceMapper/index.js +36 -0
  225. package/dist/lib/pages/CreateWorkspacePage/index.d.ts +7 -0
  226. package/dist/lib/pages/CreateWorkspacePage/index.d.ts.map +1 -0
  227. package/dist/lib/pages/WorkspaceSettingsPage/index.d.ts +12 -0
  228. package/dist/lib/pages/WorkspaceSettingsPage/index.d.ts.map +1 -0
  229. package/dist/lib/pages/WorkspacesPage/index.d.ts +7 -0
  230. package/dist/lib/pages/WorkspacesPage/index.d.ts.map +1 -0
  231. package/dist/lib/presentation/components/BlockingConfirmDialog/index.d.ts +41 -0
  232. package/dist/lib/presentation/components/BlockingConfirmDialog/index.d.ts.map +1 -0
  233. package/dist/lib/presentation/components/BlockingConfirmDialog/index.js +17 -0
  234. package/dist/lib/presentation/components/ColorSwatchRow/index.d.ts +22 -0
  235. package/dist/lib/presentation/components/ColorSwatchRow/index.d.ts.map +1 -0
  236. package/dist/lib/presentation/components/ColorSwatchRow/index.js +70 -0
  237. package/dist/lib/presentation/components/CreateWorkspaceWizard/ContentStep/ModeTiles/index.d.ts +11 -0
  238. package/dist/lib/presentation/components/CreateWorkspaceWizard/ContentStep/ModeTiles/index.d.ts.map +1 -0
  239. package/dist/lib/presentation/components/CreateWorkspaceWizard/ContentStep/ModeTiles/index.js +47 -0
  240. package/dist/lib/presentation/components/CreateWorkspaceWizard/ContentStep/ResourceSection/index.d.ts +48 -0
  241. package/dist/lib/presentation/components/CreateWorkspaceWizard/ContentStep/ResourceSection/index.d.ts.map +1 -0
  242. package/dist/lib/presentation/components/CreateWorkspaceWizard/ContentStep/ResourceSection/index.js +32 -0
  243. package/dist/lib/presentation/components/CreateWorkspaceWizard/ContentStep/index.d.ts +23 -0
  244. package/dist/lib/presentation/components/CreateWorkspaceWizard/ContentStep/index.d.ts.map +1 -0
  245. package/dist/lib/presentation/components/CreateWorkspaceWizard/ContentStep/index.js +128 -0
  246. package/dist/lib/presentation/components/CreateWorkspaceWizard/IdentityFields/index.d.ts +17 -0
  247. package/dist/lib/presentation/components/CreateWorkspaceWizard/IdentityFields/index.d.ts.map +1 -0
  248. package/dist/lib/presentation/components/CreateWorkspaceWizard/IdentityFields/index.js +70 -0
  249. package/dist/lib/presentation/components/CreateWorkspaceWizard/MembersStep/MemberRow/index.d.ts +14 -0
  250. package/dist/lib/presentation/components/CreateWorkspaceWizard/MembersStep/MemberRow/index.d.ts.map +1 -0
  251. package/dist/lib/presentation/components/CreateWorkspaceWizard/MembersStep/MemberRow/index.js +25 -0
  252. package/dist/lib/presentation/components/CreateWorkspaceWizard/MembersStep/MemberTypeahead/index.d.ts +15 -0
  253. package/dist/lib/presentation/components/CreateWorkspaceWizard/MembersStep/MemberTypeahead/index.d.ts.map +1 -0
  254. package/dist/lib/presentation/components/CreateWorkspaceWizard/MembersStep/MemberTypeahead/index.js +112 -0
  255. package/dist/lib/presentation/components/CreateWorkspaceWizard/MembersStep/index.d.ts +17 -0
  256. package/dist/lib/presentation/components/CreateWorkspaceWizard/MembersStep/index.d.ts.map +1 -0
  257. package/dist/lib/presentation/components/CreateWorkspaceWizard/MembersStep/index.js +35 -0
  258. package/dist/lib/presentation/components/CreateWorkspaceWizard/Monogram/index.d.ts +17 -0
  259. package/dist/lib/presentation/components/CreateWorkspaceWizard/Monogram/index.d.ts.map +1 -0
  260. package/dist/lib/presentation/components/CreateWorkspaceWizard/Monogram/index.js +11 -0
  261. package/dist/lib/presentation/components/CreateWorkspaceWizard/SlugField/index.d.ts +23 -0
  262. package/dist/lib/presentation/components/CreateWorkspaceWizard/SlugField/index.d.ts.map +1 -0
  263. package/dist/lib/presentation/components/CreateWorkspaceWizard/SlugField/index.js +68 -0
  264. package/dist/lib/presentation/components/StatusChip/index.d.ts +9 -0
  265. package/dist/lib/presentation/components/StatusChip/index.d.ts.map +1 -0
  266. package/dist/lib/presentation/components/StatusChip/index.js +23 -0
  267. package/dist/lib/presentation/components/WorkspaceAvatar/index.d.ts +20 -0
  268. package/dist/lib/presentation/components/WorkspaceAvatar/index.d.ts.map +1 -0
  269. package/dist/lib/presentation/components/WorkspaceAvatar/index.js +10 -0
  270. package/dist/lib/presentation/components/WorkspaceCommands/index.d.ts +8 -0
  271. package/dist/lib/presentation/components/WorkspaceCommands/index.d.ts.map +1 -0
  272. package/dist/lib/presentation/components/WorkspaceCommands/index.js +34 -0
  273. package/dist/lib/presentation/components/WorkspaceContentSettings/AddContentDialog/index.d.ts +26 -0
  274. package/dist/lib/presentation/components/WorkspaceContentSettings/AddContentDialog/index.d.ts.map +1 -0
  275. package/dist/lib/presentation/components/WorkspaceContentSettings/AddContentDialog/index.js +89 -0
  276. package/dist/lib/presentation/components/WorkspaceContentSettings/GrantedContentGroup/index.d.ts +21 -0
  277. package/dist/lib/presentation/components/WorkspaceContentSettings/GrantedContentGroup/index.d.ts.map +1 -0
  278. package/dist/lib/presentation/components/WorkspaceContentSettings/GrantedContentGroup/index.js +11 -0
  279. package/dist/lib/presentation/components/WorkspaceContentSettings/GrantedContentRow/index.d.ts +26 -0
  280. package/dist/lib/presentation/components/WorkspaceContentSettings/GrantedContentRow/index.d.ts.map +1 -0
  281. package/dist/lib/presentation/components/WorkspaceContentSettings/GrantedContentRow/index.js +31 -0
  282. package/dist/lib/presentation/components/WorkspaceContentSettings/RemoveContentDialog/index.d.ts +25 -0
  283. package/dist/lib/presentation/components/WorkspaceContentSettings/RemoveContentDialog/index.d.ts.map +1 -0
  284. package/dist/lib/presentation/components/WorkspaceContentSettings/RemoveContentDialog/index.js +48 -0
  285. package/dist/lib/presentation/components/WorkspaceContentSettings/index.d.ts +25 -0
  286. package/dist/lib/presentation/components/WorkspaceContentSettings/index.d.ts.map +1 -0
  287. package/dist/lib/presentation/components/WorkspaceContentSettings/index.js +173 -0
  288. package/dist/lib/presentation/components/WorkspaceDangerSettings/DeleteWorkspaceDialog/index.d.ts +22 -0
  289. package/dist/lib/presentation/components/WorkspaceDangerSettings/DeleteWorkspaceDialog/index.d.ts.map +1 -0
  290. package/dist/lib/presentation/components/WorkspaceDangerSettings/DeleteWorkspaceDialog/index.js +52 -0
  291. package/dist/lib/presentation/components/WorkspaceDangerSettings/index.d.ts +18 -0
  292. package/dist/lib/presentation/components/WorkspaceDangerSettings/index.d.ts.map +1 -0
  293. package/dist/lib/presentation/components/WorkspaceDangerSettings/index.js +150 -0
  294. package/dist/lib/presentation/components/WorkspaceGeneralSettings/WorkspaceIdField/index.d.ts +19 -0
  295. package/dist/lib/presentation/components/WorkspaceGeneralSettings/WorkspaceIdField/index.d.ts.map +1 -0
  296. package/dist/lib/presentation/components/WorkspaceGeneralSettings/WorkspaceIdField/index.js +72 -0
  297. package/dist/lib/presentation/components/WorkspaceGeneralSettings/index.d.ts +18 -0
  298. package/dist/lib/presentation/components/WorkspaceGeneralSettings/index.d.ts.map +1 -0
  299. package/dist/lib/presentation/components/WorkspaceGeneralSettings/index.js +131 -0
  300. package/dist/lib/presentation/components/WorkspaceMembersSettings/MemberDirectorySearch/index.d.ts +18 -0
  301. package/dist/lib/presentation/components/WorkspaceMembersSettings/MemberDirectorySearch/index.d.ts.map +1 -0
  302. package/dist/lib/presentation/components/WorkspaceMembersSettings/MemberDirectorySearch/index.js +65 -0
  303. package/dist/lib/presentation/components/WorkspaceMembersSettings/MemberListRow/index.d.ts +17 -0
  304. package/dist/lib/presentation/components/WorkspaceMembersSettings/MemberListRow/index.d.ts.map +1 -0
  305. package/dist/lib/presentation/components/WorkspaceMembersSettings/MemberListRow/index.js +22 -0
  306. package/dist/lib/presentation/components/WorkspaceMembersSettings/index.d.ts +16 -0
  307. package/dist/lib/presentation/components/WorkspaceMembersSettings/index.d.ts.map +1 -0
  308. package/dist/lib/presentation/components/WorkspaceMembersSettings/index.js +127 -0
  309. package/dist/lib/presentation/components/WorkspaceNav/WorkspaceNavButton/index.d.ts +14 -0
  310. package/dist/lib/presentation/components/WorkspaceNav/WorkspaceNavButton/index.d.ts.map +1 -0
  311. package/dist/lib/presentation/components/WorkspaceNav/WorkspaceNavButton/index.js +30 -0
  312. package/dist/lib/presentation/components/WorkspaceNav/WorkspaceSwitcher/index.d.ts +16 -0
  313. package/dist/lib/presentation/components/WorkspaceNav/WorkspaceSwitcher/index.d.ts.map +1 -0
  314. package/dist/lib/presentation/components/WorkspaceNav/WorkspaceSwitcher/index.js +81 -0
  315. package/dist/lib/presentation/components/WorkspaceNav/index.d.ts +14 -0
  316. package/dist/lib/presentation/components/WorkspaceNav/index.d.ts.map +1 -0
  317. package/dist/lib/presentation/components/WorkspaceNav/index.js +51 -0
  318. package/dist/lib/presentation/components/WorkspaceSettingsTabs/index.d.ts +14 -0
  319. package/dist/lib/presentation/components/WorkspaceSettingsTabs/index.d.ts.map +1 -0
  320. package/dist/lib/presentation/components/WorkspaceSettingsTabs/index.js +66 -0
  321. package/dist/lib/presentation/components/WorkspaceSettingsTopBar/index.d.ts +8 -0
  322. package/dist/lib/presentation/components/WorkspaceSettingsTopBar/index.d.ts.map +1 -0
  323. package/dist/lib/presentation/components/WorkspaceSettingsTopBar/index.js +57 -0
  324. package/dist/lib/presentation/components/WorkspaceShell/index.d.ts +16 -0
  325. package/dist/lib/presentation/components/WorkspaceShell/index.d.ts.map +1 -0
  326. package/dist/lib/presentation/components/WorkspaceShell/index.js +100 -0
  327. package/dist/lib/presentation/components/WorkspaceStats/index.d.ts +9 -0
  328. package/dist/lib/presentation/components/WorkspaceStats/index.d.ts.map +1 -0
  329. package/dist/lib/presentation/components/WorkspaceStats/index.js +48 -0
  330. package/dist/lib/presentation/components/WorkspaceToolbar/index.d.ts +22 -0
  331. package/dist/lib/presentation/components/WorkspaceToolbar/index.d.ts.map +1 -0
  332. package/dist/lib/presentation/components/WorkspaceToolbar/index.js +73 -0
  333. package/dist/lib/presentation/components/WorkspacesEmpty/index.d.ts +18 -0
  334. package/dist/lib/presentation/components/WorkspacesEmpty/index.d.ts.map +1 -0
  335. package/dist/lib/presentation/components/WorkspacesEmpty/index.js +42 -0
  336. package/dist/lib/presentation/components/WorkspacesHomePanel/index.d.ts +7 -0
  337. package/dist/lib/presentation/components/WorkspacesHomePanel/index.d.ts.map +1 -0
  338. package/dist/lib/presentation/components/WorkspacesHomePanel/index.js +50 -0
  339. package/dist/lib/presentation/components/WorkspacesNavSection/index.d.ts +15 -0
  340. package/dist/lib/presentation/components/WorkspacesNavSection/index.d.ts.map +1 -0
  341. package/dist/lib/presentation/components/WorkspacesNavSection/index.js +76 -0
  342. package/dist/lib/presentation/components/WorkspacesSkeleton/index.d.ts +49 -0
  343. package/dist/lib/presentation/components/WorkspacesSkeleton/index.d.ts.map +1 -0
  344. package/dist/lib/presentation/components/WorkspacesSkeleton/index.js +94 -0
  345. package/dist/lib/presentation/components/WorkspacesTable/index.d.ts +12 -0
  346. package/dist/lib/presentation/components/WorkspacesTable/index.d.ts.map +1 -0
  347. package/dist/lib/presentation/components/WorkspacesTable/index.js +58 -0
  348. package/dist/lib/presentation/currentWorkspace/index.d.ts +17 -0
  349. package/dist/lib/presentation/currentWorkspace/index.d.ts.map +1 -0
  350. package/dist/lib/presentation/currentWorkspace/index.js +44 -0
  351. package/dist/lib/presentation/hooks/useBasicsSchema/index.d.ts +17 -0
  352. package/dist/lib/presentation/hooks/useBasicsSchema/index.d.ts.map +1 -0
  353. package/dist/lib/presentation/hooks/useBasicsSchema/index.js +71 -0
  354. package/dist/lib/presentation/hooks/useComboboxList/index.d.ts +44 -0
  355. package/dist/lib/presentation/hooks/useComboboxList/index.d.ts.map +1 -0
  356. package/dist/lib/presentation/hooks/useComboboxList/index.js +62 -0
  357. package/dist/lib/presentation/hooks/useRedirectNotice/index.d.ts +24 -0
  358. package/dist/lib/presentation/hooks/useRedirectNotice/index.d.ts.map +1 -0
  359. package/dist/lib/presentation/hooks/useRedirectNotice/index.js +37 -0
  360. package/dist/lib/presentation/hooks/useResourceSelection/index.d.ts +21 -0
  361. package/dist/lib/presentation/hooks/useResourceSelection/index.d.ts.map +1 -0
  362. package/dist/lib/presentation/hooks/useResourceSelection/index.js +16 -0
  363. package/dist/lib/presentation/hooks/useSlug/index.d.ts +28 -0
  364. package/dist/lib/presentation/hooks/useSlug/index.d.ts.map +1 -0
  365. package/dist/lib/presentation/hooks/useSlug/index.js +18 -0
  366. package/dist/lib/presentation/hooks/useWizard/index.d.ts +60 -0
  367. package/dist/lib/presentation/hooks/useWizard/index.d.ts.map +1 -0
  368. package/dist/lib/presentation/hooks/useWizard/index.js +93 -0
  369. package/dist/lib/presentation/hooks/useWorkspaceProfileSchema/index.d.ts +16 -0
  370. package/dist/lib/presentation/hooks/useWorkspaceProfileSchema/index.d.ts.map +1 -0
  371. package/dist/lib/presentation/hooks/useWorkspaceProfileSchema/index.js +53 -0
  372. package/dist/lib/presentation/pages/CreateWorkspacePage/index.d.ts +7 -0
  373. package/dist/lib/presentation/pages/CreateWorkspacePage/index.d.ts.map +1 -0
  374. package/dist/lib/presentation/pages/CreateWorkspacePage/index.js +248 -0
  375. package/dist/lib/presentation/pages/WorkspaceSettingsPage/index.d.ts +12 -0
  376. package/dist/lib/presentation/pages/WorkspaceSettingsPage/index.d.ts.map +1 -0
  377. package/dist/lib/presentation/pages/WorkspaceSettingsPage/index.js +69 -0
  378. package/dist/lib/presentation/pages/WorkspacesPage/index.d.ts +7 -0
  379. package/dist/lib/presentation/pages/WorkspacesPage/index.d.ts.map +1 -0
  380. package/dist/lib/presentation/pages/WorkspacesPage/index.js +112 -0
  381. package/dist/lib/presentation/slots/workspaceSlots/index.d.ts +101 -0
  382. package/dist/lib/presentation/slots/workspaceSlots/index.d.ts.map +1 -0
  383. package/dist/lib/presentation/slots/workspaceSlots/index.js +25 -0
  384. package/dist/lib/presentation/workspacesPlugin/index.d.ts +31 -0
  385. package/dist/lib/presentation/workspacesPlugin/index.d.ts.map +1 -0
  386. package/dist/lib/presentation/workspacesPlugin/index.js +151 -0
  387. package/dist/lib/slots/workspaceSlots/index.d.ts +101 -0
  388. package/dist/lib/slots/workspaceSlots/index.d.ts.map +1 -0
  389. package/dist/lib/types/wizard/index.d.ts +119 -0
  390. package/dist/lib/types/wizard/index.d.ts.map +1 -0
  391. package/dist/lib/types/workspace/index.d.ts +42 -0
  392. package/dist/lib/types/workspace/index.d.ts.map +1 -0
  393. package/dist/lib/utils/buildCreateWorkspaceBody/index.d.ts +12 -0
  394. package/dist/lib/utils/buildCreateWorkspaceBody/index.d.ts.map +1 -0
  395. package/dist/lib/utils/currentWorkspace/index.d.ts +17 -0
  396. package/dist/lib/utils/currentWorkspace/index.d.ts.map +1 -0
  397. package/dist/lib/utils/isActiveWorkspace/index.d.ts +9 -0
  398. package/dist/lib/utils/isActiveWorkspace/index.d.ts.map +1 -0
  399. package/dist/lib/utils/isConflict/index.d.ts +8 -0
  400. package/dist/lib/utils/isConflict/index.d.ts.map +1 -0
  401. package/dist/lib/utils/permissions/index.d.ts +7 -0
  402. package/dist/lib/utils/permissions/index.d.ts.map +1 -0
  403. package/dist/lib/utils/radioGroupKeydown/index.d.ts +15 -0
  404. package/dist/lib/utils/radioGroupKeydown/index.d.ts.map +1 -0
  405. package/dist/lib/utils/resourceSelection/index.d.ts +18 -0
  406. package/dist/lib/utils/resourceSelection/index.d.ts.map +1 -0
  407. package/dist/lib/utils/workspacesPlugin/index.d.ts +31 -0
  408. package/dist/lib/utils/workspacesPlugin/index.d.ts.map +1 -0
  409. package/package.json +48 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Ortha CMS contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,7 @@
1
+ # @orthacms/workspaces-admin
2
+
3
+ Part of [Ortha CMS](https://github.com/ortha-source/ortha-cms).
4
+
5
+ ```sh
6
+ npm install @orthacms/workspaces-admin
7
+ ```
@@ -0,0 +1,9 @@
1
+ export { WorkspacesPlugin } from './lib/presentation/workspacesPlugin';
2
+ export type { WorkspacesAdminPlugin } from './lib/presentation/workspacesPlugin';
3
+ export { useWorkspaces, workspacesKey } from './lib/application/useWorkspaces';
4
+ export { useCreateWorkspace } from './lib/application/useCreateWorkspace';
5
+ export type { Workspace, WorkspaceMember, WorkspaceStatus } from './lib/domain/types/workspace';
6
+ export { WORKSPACE_NAV_SLOT, WORKSPACE_SECTION_SLOT, WORKSPACE_ROUTE_SLOT } from './lib/presentation/slots/workspaceSlots';
7
+ export type { WorkspaceNavItem, WorkspaceSectionItem, WorkspaceRoute } from './lib/presentation/slots/workspaceSlots';
8
+ export { useCurrentWorkspace } from './lib/presentation/currentWorkspace';
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AACvE,YAAY,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AACjF,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAC/E,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAC1E,YAAY,EACR,SAAS,EACT,eAAe,EACf,eAAe,EAClB,MAAM,8BAA8B,CAAC;AAItC,OAAO,EACH,kBAAkB,EAClB,sBAAsB,EACtB,oBAAoB,EACvB,MAAM,yCAAyC,CAAC;AACjD,YAAY,EACR,gBAAgB,EAChB,oBAAoB,EACpB,cAAc,EACjB,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,8 @@
1
+ export { WorkspacesPlugin } from './lib/presentation/workspacesPlugin';
2
+ export { useWorkspaces, workspacesKey } from './lib/application/useWorkspaces';
3
+ export { useCreateWorkspace } from './lib/application/useCreateWorkspace';
4
+ // The workspace shell's extension points. Feature plugins that live inside a
5
+ // workspace (e.g. Content Library) contribute a route plus either a "Workspace"
6
+ // nav entry or a custom sidebar section here.
7
+ export { WORKSPACE_NAV_SLOT, WORKSPACE_SECTION_SLOT, WORKSPACE_ROUTE_SLOT } from './lib/presentation/slots/workspaceSlots';
8
+ export { useCurrentWorkspace } from './lib/presentation/currentWorkspace';
@@ -0,0 +1,15 @@
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
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,14 @@
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
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,10 @@
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
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,20 @@
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
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,13 @@
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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/api/useDeleteWorkspace/index.ts"],"names":[],"mappings":"AAaA;;;;;;;;;;GAUG;AACH,wBAAgB,kBAAkB,oFASjC"}
@@ -0,0 +1,15 @@
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
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,13 @@
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
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,14 @@
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
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,10 @@
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
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,23 @@
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
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,17 @@
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
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * How many entries of content type `slug` a workspace holds. Backs the revoke
3
+ * pre-check: the remove dialog reads it on open to decide whether to block the
4
+ * action. Runs only while `enabled` (i.e. a removal is pending) and isn't
5
+ * cached across opens, so a just-added entry is reflected.
6
+ */
7
+ export declare function useWorkspaceContentCount(workspaceId: string, slug: string | null, enabled: boolean): import("@tanstack/react-query").UseQueryResult<number, Error>;
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/api/useWorkspaceContentCount/index.ts"],"names":[],"mappings":"AAwBA;;;;;GAKG;AACH,wBAAgB,wBAAwB,CACpC,WAAW,EAAE,MAAM,EACnB,IAAI,EAAE,MAAM,GAAG,IAAI,EACnB,OAAO,EAAE,OAAO,iEASnB"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * How many content entries a workspace holds across all its content types.
3
+ * Backs the delete pre-check: the delete dialog reads it on open to decide
4
+ * whether to block deletion. Runs only while `enabled` (a delete is pending) and
5
+ * isn't cached across opens, so a just-removed entry is reflected.
6
+ */
7
+ export declare function useWorkspaceEntryCount(workspaceId: string, enabled: boolean): import("@tanstack/react-query").UseQueryResult<number, Error>;
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/api/useWorkspaceEntryCount/index.ts"],"names":[],"mappings":"AAqBA;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,iEAQ3E"}
@@ -0,0 +1,30 @@
1
+ import type { Workspace } from '../../types/workspace';
2
+ /** A member as `GET /api/workspaces` returns it (presentation fields derived). */
3
+ export interface WorkspaceMemberView {
4
+ id: string;
5
+ name: string | null;
6
+ email: string;
7
+ }
8
+ /** A workspace as `GET /api/workspaces` returns it. */
9
+ export interface WorkspaceView {
10
+ id: string;
11
+ name: string;
12
+ slug: string;
13
+ description: string;
14
+ color: string;
15
+ status: 'active' | 'archived';
16
+ members: WorkspaceMemberView[];
17
+ /** Granted content-type slugs; absent on older responses. */
18
+ content?: string[];
19
+ }
20
+ /**
21
+ * Maps a server workspace view to the admin's `Workspace`, deriving the
22
+ * presentation-only member initials/colors the server doesn't store. Exported
23
+ * so the create mutation maps its response through the same shape.
24
+ */
25
+ export declare function toWorkspace(view: WorkspaceView): Workspace;
26
+ /** Query key for the workspaces list. */
27
+ export declare const workspacesKey: readonly ["workspaces"];
28
+ /** Lists the workspaces the signed-in user can see. */
29
+ export declare function useWorkspaces(): import("@tanstack/react-query").UseQueryResult<NoInfer<Workspace[]>, Error>;
30
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/api/useWorkspaces/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACR,SAAS,EAGZ,MAAM,uBAAuB,CAAC;AAE/B,kFAAkF;AAClF,MAAM,WAAW,mBAAmB;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;CACjB;AAED,uDAAuD;AACvD,MAAM,WAAW,aAAa;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,QAAQ,GAAG,UAAU,CAAC;IAC9B,OAAO,EAAE,mBAAmB,EAAE,CAAC;IAC/B,6DAA6D;IAC7D,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB;AAmBD;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,aAAa,GAAG,SAAS,CAW1D;AAED,yCAAyC;AACzC,eAAO,MAAM,aAAa,yBAA0B,CAAC;AAYrD,uDAAuD;AACvD,wBAAgB,aAAa,gFAK5B"}
@@ -0,0 +1,9 @@
1
+ import type { AddWorkspaceContentInput } from '../../infrastructure/workspaceGateway';
2
+ export type { AddWorkspaceContentInput } from '../../infrastructure/workspaceGateway';
3
+ /**
4
+ * Grants a workspace access to a content type via the gateway (idempotent
5
+ * server-side). Invalidates the workspaces list so the granted slug shows in
6
+ * settings and the Content Library scopes to it.
7
+ */
8
+ export declare function useAddWorkspaceContent(): import("@tanstack/react-query").UseMutationResult<import("../../..").Workspace, Error, AddWorkspaceContentInput, unknown>;
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/application/useAddWorkspaceContent/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,uCAAuC,CAAC;AAGtF,YAAY,EAAE,wBAAwB,EAAE,MAAM,uCAAuC,CAAC;AAEtF;;;;GAIG;AACH,wBAAgB,sBAAsB,8HASrC"}
@@ -0,0 +1,15 @@
1
+ import { useMutation, useQueryClient } from '@tanstack/react-query';
2
+ import { httpWorkspaceGateway } from '../../infrastructure/httpWorkspaceGateway';
3
+ import { workspacesKey } from '../useWorkspaces';
4
+ /**
5
+ * Grants a workspace access to a content type via the gateway (idempotent
6
+ * server-side). Invalidates the workspaces list so the granted slug shows in
7
+ * settings and the Content Library scopes to it.
8
+ */
9
+ export function useAddWorkspaceContent() {
10
+ const queryClient = useQueryClient();
11
+ return useMutation({
12
+ mutationFn: (input) => httpWorkspaceGateway.addContent(input),
13
+ onSuccess: () => queryClient.invalidateQueries({ queryKey: workspacesKey })
14
+ });
15
+ }
@@ -0,0 +1,8 @@
1
+ import type { AddWorkspaceMemberInput } from '../../infrastructure/workspaceGateway';
2
+ export type { AddWorkspaceMemberInput } from '../../infrastructure/workspaceGateway';
3
+ /**
4
+ * Adds an existing user to a workspace via the gateway (idempotent server-side).
5
+ * Invalidates the workspaces list so the member appears in the settings roster.
6
+ */
7
+ export declare function useAddWorkspaceMember(): import("@tanstack/react-query").UseMutationResult<import("../../..").Workspace, Error, AddWorkspaceMemberInput, unknown>;
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/application/useAddWorkspaceMember/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AAGrF,YAAY,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AAErF;;;GAGG;AACH,wBAAgB,qBAAqB,6HASpC"}
@@ -0,0 +1,14 @@
1
+ import { useMutation, useQueryClient } from '@tanstack/react-query';
2
+ import { httpWorkspaceGateway } from '../../infrastructure/httpWorkspaceGateway';
3
+ import { workspacesKey } from '../useWorkspaces';
4
+ /**
5
+ * Adds an existing user to a workspace via the gateway (idempotent server-side).
6
+ * Invalidates the workspaces list so the member appears in the settings roster.
7
+ */
8
+ export function useAddWorkspaceMember() {
9
+ const queryClient = useQueryClient();
10
+ return useMutation({
11
+ mutationFn: (input) => httpWorkspaceGateway.addMember(input),
12
+ onSuccess: () => queryClient.invalidateQueries({ queryKey: workspacesKey })
13
+ });
14
+ }
@@ -0,0 +1,9 @@
1
+ /** Query key for the content-types list. */
2
+ export declare const contentTypesKey: readonly ["content-types"];
3
+ /**
4
+ * Loads every content type (via the gateway) so the content step can split them
5
+ * into collections and pages. Returns the standard TanStack Query result;
6
+ * callers read `data`, `isPending`, and `isError`.
7
+ */
8
+ export declare function useContentTypes(): import("@tanstack/react-query").UseQueryResult<NoInfer<import("../../domain/types/wizard").ContentType[]>, Error>;
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/application/useContentTypes/index.ts"],"names":[],"mappings":"AAGA,4CAA4C;AAC5C,eAAO,MAAM,eAAe,4BAA6B,CAAC;AAE1D;;;;GAIG;AACH,wBAAgB,eAAe,sHAM9B"}
@@ -0,0 +1,16 @@
1
+ import { useQuery } from '@tanstack/react-query';
2
+ import { httpWorkspaceGateway } from '../../infrastructure/httpWorkspaceGateway';
3
+ /** Query key for the content-types list. */
4
+ export const contentTypesKey = ['content-types'];
5
+ /**
6
+ * Loads every content type (via the gateway) so the content step can split them
7
+ * into collections and pages. Returns the standard TanStack Query result;
8
+ * callers read `data`, `isPending`, and `isError`.
9
+ */
10
+ export function useContentTypes() {
11
+ return useQuery({
12
+ queryKey: contentTypesKey,
13
+ queryFn: () => httpWorkspaceGateway.listContentTypes(),
14
+ staleTime: 60_000
15
+ });
16
+ }
@@ -0,0 +1,20 @@
1
+ import type { Workspace, WorkspaceMember } from '../../domain/types/workspace';
2
+ import type { CreateWorkspaceBody } from '../../domain/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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/application/useCreateWorkspace/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAIrE;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAC9B,IAAI,EAAE,mBAAmB,CAAC;IAC1B,OAAO,EAAE,eAAe,CAAC;CAC5B,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,kBAAkB;;GAwCjC"}
@@ -0,0 +1,44 @@
1
+ import { useMutation, useQueryClient } from '@tanstack/react-query';
2
+ import { httpWorkspaceGateway } from '../../infrastructure/httpWorkspaceGateway';
3
+ import { workspacesKey } from '../useWorkspaces';
4
+ /**
5
+ * Creates a workspace and optimistically inserts it at the top of the list, so
6
+ * the new card appears the instant the form is submitted. Rolls back on error
7
+ * and reconciles with the server result on settle.
8
+ */
9
+ export function useCreateWorkspace() {
10
+ const queryClient = useQueryClient();
11
+ return useMutation({
12
+ mutationFn: ({ body }) => httpWorkspaceGateway.create(body),
13
+ onMutate: async ({ body, creator }) => {
14
+ await queryClient.cancelQueries({ queryKey: workspacesKey });
15
+ const previous = queryClient.getQueryData(workspacesKey);
16
+ const optimistic = {
17
+ // A unique id so two same-named creates can't collide on their
18
+ // React key; reconciled away when `onSettled` refetches.
19
+ id: `optimistic_${crypto.randomUUID()}`,
20
+ slug: body.slug,
21
+ name: body.name,
22
+ description: body.description,
23
+ color: body.color,
24
+ status: 'Active',
25
+ members: [creator],
26
+ // Grants are resolved server-side; reconciled when onSettled refetches.
27
+ content: []
28
+ };
29
+ queryClient.setQueryData(workspacesKey, (old = []) => [
30
+ optimistic,
31
+ ...old
32
+ ]);
33
+ return { previous };
34
+ },
35
+ onError: (_error, _input, context) => {
36
+ if (context?.previous) {
37
+ queryClient.setQueryData(workspacesKey, context.previous);
38
+ }
39
+ },
40
+ onSettled: () => {
41
+ queryClient.invalidateQueries({ queryKey: workspacesKey });
42
+ }
43
+ });
44
+ }
@@ -0,0 +1,23 @@
1
+ import type { WizardSnapshot } from '../../domain/types/wizard';
2
+ /** What {@link useCreateWorkspaceFlow} returns. */
3
+ export type CreateWorkspaceFlow = {
4
+ /**
5
+ * Runs the create-workspace use case for a full wizard snapshot: validates
6
+ * the slug through the {@link Slug} value object, derives the creator from
7
+ * the session, POSTs via the create mutation (optimistic insert +
8
+ * invalidation), then toasts and navigates to the list. Errors are caught
9
+ * and surfaced as a toast, so the caller just awaits.
10
+ */
11
+ submit: (snapshot: WizardSnapshot) => Promise<void>;
12
+ /** Whether a submission is currently in flight. */
13
+ submitting: boolean;
14
+ };
15
+ /**
16
+ * The create-workspace use-case hook. Orchestrates the multi-step wizard's
17
+ * submission — slug VO validation → create → toast + navigate — so the wizard
18
+ * page stays layout + fields and owns none of the flow. Availability is enforced
19
+ * by the page's continue gate; the {@link Slug} guard here is the last check
20
+ * before the request.
21
+ */
22
+ export declare function useCreateWorkspaceFlow(): CreateWorkspaceFlow;
23
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/application/useCreateWorkspaceFlow/index.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AA2BhE,mDAAmD;AACnD,MAAM,MAAM,mBAAmB,GAAG;IAC9B;;;;;;OAMG;IACH,MAAM,EAAE,CAAC,QAAQ,EAAE,cAAc,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACpD,mDAAmD;IACnD,UAAU,EAAE,OAAO,CAAC;CACvB,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,sBAAsB,IAAI,mBAAmB,CAkD5D"}
@@ -0,0 +1,81 @@
1
+ import { useCallback } from 'react';
2
+ import { defineMessages, useIntl } from 'react-intl';
3
+ import { useNavigate } from 'react-router-dom';
4
+ import { useAuth } from '@orthacms/identity-admin';
5
+ import { initialsOf } from '@orthacms/utils-admin';
6
+ import { toast } from '@orthacms/design-system';
7
+ import { Slug } from '../../domain/slug';
8
+ import { buildCreateWorkspaceBody } from '../../infrastructure/buildCreateWorkspaceBody';
9
+ import { isConflict } from '../../infrastructure/isConflict';
10
+ import { useCreateWorkspace } from '../useCreateWorkspace';
11
+ /** Toast copy for the create-workspace use case. */
12
+ const messages = defineMessages({
13
+ success: {
14
+ id: 'workspaces.create.success',
15
+ defaultMessage: 'Workspace "{name}" created.'
16
+ },
17
+ error: {
18
+ id: 'workspaces.create.error',
19
+ defaultMessage: 'Could not create workspace. Please try again.'
20
+ },
21
+ conflict: {
22
+ id: 'workspaces.create.errorConflict',
23
+ defaultMessage: 'That slug is already taken. Pick a different one on the Basics step.'
24
+ },
25
+ invalidSlug: {
26
+ id: 'workspaces.create.errorInvalidSlug',
27
+ defaultMessage: 'That slug isn’t valid. Use lowercase letters, numbers, and hyphens only.'
28
+ }
29
+ });
30
+ /**
31
+ * The create-workspace use-case hook. Orchestrates the multi-step wizard's
32
+ * submission — slug VO validation → create → toast + navigate — so the wizard
33
+ * page stays layout + fields and owns none of the flow. Availability is enforced
34
+ * by the page's continue gate; the {@link Slug} guard here is the last check
35
+ * before the request.
36
+ */
37
+ export function useCreateWorkspaceFlow() {
38
+ const intl = useIntl();
39
+ const navigate = useNavigate();
40
+ const auth = useAuth();
41
+ const user = 'user' in auth ? auth.user : undefined;
42
+ const createMutation = useCreateWorkspace();
43
+ const submit = useCallback(async (snapshot) => {
44
+ let slugGuarded = false;
45
+ try {
46
+ // Guard the shape through the domain VO before hitting the API.
47
+ Slug.create(snapshot.data.slug.trim());
48
+ slugGuarded = true;
49
+ const displayName = user?.name ?? user?.email ?? 'You';
50
+ const creator = {
51
+ id: user?.id ?? 'me',
52
+ name: displayName,
53
+ email: user?.email ?? '',
54
+ initials: initialsOf(displayName),
55
+ color: snapshot.data.color
56
+ };
57
+ const created = await createMutation.mutateAsync({
58
+ body: buildCreateWorkspaceBody(snapshot),
59
+ creator
60
+ });
61
+ toast.success(intl.formatMessage(messages.success, { name: created.name }));
62
+ navigate('/workspaces');
63
+ }
64
+ catch (error) {
65
+ // Narrow the outcome rather than collapsing every failure onto
66
+ // "Please try again" — for a taken slug that advice is actively
67
+ // wrong, since retrying can never succeed. `isConflict` is the
68
+ // same 409 narrowing the settings dialogs already use.
69
+ if (!slugGuarded) {
70
+ toast.error(intl.formatMessage(messages.invalidSlug));
71
+ }
72
+ else if (isConflict(error)) {
73
+ toast.error(intl.formatMessage(messages.conflict));
74
+ }
75
+ else {
76
+ toast.error(intl.formatMessage(messages.error));
77
+ }
78
+ }
79
+ }, [user, createMutation, intl, navigate]);
80
+ return { submit, submitting: createMutation.isPending };
81
+ }