@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.
- package/LICENSE +21 -0
- package/README.md +7 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8 -0
- package/dist/lib/api/useAddWorkspaceContent/index.d.ts +15 -0
- package/dist/lib/api/useAddWorkspaceContent/index.d.ts.map +1 -0
- package/dist/lib/api/useAddWorkspaceMember/index.d.ts +14 -0
- package/dist/lib/api/useAddWorkspaceMember/index.d.ts.map +1 -0
- package/dist/lib/api/useContentTypes/index.d.ts +10 -0
- package/dist/lib/api/useContentTypes/index.d.ts.map +1 -0
- package/dist/lib/api/useCreateWorkspace/index.d.ts +20 -0
- package/dist/lib/api/useCreateWorkspace/index.d.ts.map +1 -0
- package/dist/lib/api/useDeleteWorkspace/index.d.ts +13 -0
- package/dist/lib/api/useDeleteWorkspace/index.d.ts.map +1 -0
- package/dist/lib/api/useRemoveWorkspaceContent/index.d.ts +15 -0
- package/dist/lib/api/useRemoveWorkspaceContent/index.d.ts.map +1 -0
- package/dist/lib/api/useRemoveWorkspaceMember/index.d.ts +13 -0
- package/dist/lib/api/useRemoveWorkspaceMember/index.d.ts.map +1 -0
- package/dist/lib/api/useSetWorkspaceStatus/index.d.ts +14 -0
- package/dist/lib/api/useSetWorkspaceStatus/index.d.ts.map +1 -0
- package/dist/lib/api/useSlugAvailability/index.d.ts +10 -0
- package/dist/lib/api/useSlugAvailability/index.d.ts.map +1 -0
- package/dist/lib/api/useUpdateWorkspace/index.d.ts +23 -0
- package/dist/lib/api/useUpdateWorkspace/index.d.ts.map +1 -0
- package/dist/lib/api/useUsersSearch/index.d.ts +17 -0
- package/dist/lib/api/useUsersSearch/index.d.ts.map +1 -0
- package/dist/lib/api/useWorkspaceContentCount/index.d.ts +8 -0
- package/dist/lib/api/useWorkspaceContentCount/index.d.ts.map +1 -0
- package/dist/lib/api/useWorkspaceEntryCount/index.d.ts +8 -0
- package/dist/lib/api/useWorkspaceEntryCount/index.d.ts.map +1 -0
- package/dist/lib/api/useWorkspaces/index.d.ts +30 -0
- package/dist/lib/api/useWorkspaces/index.d.ts.map +1 -0
- package/dist/lib/application/useAddWorkspaceContent/index.d.ts +9 -0
- package/dist/lib/application/useAddWorkspaceContent/index.d.ts.map +1 -0
- package/dist/lib/application/useAddWorkspaceContent/index.js +15 -0
- package/dist/lib/application/useAddWorkspaceMember/index.d.ts +8 -0
- package/dist/lib/application/useAddWorkspaceMember/index.d.ts.map +1 -0
- package/dist/lib/application/useAddWorkspaceMember/index.js +14 -0
- package/dist/lib/application/useContentTypes/index.d.ts +9 -0
- package/dist/lib/application/useContentTypes/index.d.ts.map +1 -0
- package/dist/lib/application/useContentTypes/index.js +16 -0
- package/dist/lib/application/useCreateWorkspace/index.d.ts +20 -0
- package/dist/lib/application/useCreateWorkspace/index.d.ts.map +1 -0
- package/dist/lib/application/useCreateWorkspace/index.js +44 -0
- package/dist/lib/application/useCreateWorkspaceFlow/index.d.ts +23 -0
- package/dist/lib/application/useCreateWorkspaceFlow/index.d.ts.map +1 -0
- package/dist/lib/application/useCreateWorkspaceFlow/index.js +81 -0
- package/dist/lib/application/useDeleteWorkspace/index.d.ts +13 -0
- package/dist/lib/application/useDeleteWorkspace/index.d.ts.map +1 -0
- package/dist/lib/application/useDeleteWorkspace/index.js +23 -0
- package/dist/lib/application/useRemoveWorkspaceContent/index.d.ts +9 -0
- package/dist/lib/application/useRemoveWorkspaceContent/index.d.ts.map +1 -0
- package/dist/lib/application/useRemoveWorkspaceContent/index.js +15 -0
- package/dist/lib/application/useRemoveWorkspaceMember/index.d.ts +8 -0
- package/dist/lib/application/useRemoveWorkspaceMember/index.d.ts.map +1 -0
- package/dist/lib/application/useRemoveWorkspaceMember/index.js +14 -0
- package/dist/lib/application/useSetWorkspaceStatus/index.d.ts +9 -0
- package/dist/lib/application/useSetWorkspaceStatus/index.d.ts.map +1 -0
- package/dist/lib/application/useSetWorkspaceStatus/index.js +15 -0
- package/dist/lib/application/useSlugAvailability/index.d.ts +18 -0
- package/dist/lib/application/useSlugAvailability/index.d.ts.map +1 -0
- package/dist/lib/application/useSlugAvailability/index.js +39 -0
- package/dist/lib/application/useUpdateWorkspace/index.d.ts +9 -0
- package/dist/lib/application/useUpdateWorkspace/index.d.ts.map +1 -0
- package/dist/lib/application/useUpdateWorkspace/index.js +15 -0
- package/dist/lib/application/useUsersSearch/index.d.ts +18 -0
- package/dist/lib/application/useUsersSearch/index.d.ts.map +1 -0
- package/dist/lib/application/useUsersSearch/index.js +24 -0
- package/dist/lib/application/useWorkspaceContentCount/index.d.ts +8 -0
- package/dist/lib/application/useWorkspaceContentCount/index.d.ts.map +1 -0
- package/dist/lib/application/useWorkspaceContentCount/index.js +17 -0
- package/dist/lib/application/useWorkspaceEntryCount/index.d.ts +8 -0
- package/dist/lib/application/useWorkspaceEntryCount/index.d.ts.map +1 -0
- package/dist/lib/application/useWorkspaceEntryCount/index.js +17 -0
- package/dist/lib/application/useWorkspaces/index.d.ts +5 -0
- package/dist/lib/application/useWorkspaces/index.d.ts.map +1 -0
- package/dist/lib/application/useWorkspaces/index.js +11 -0
- package/dist/lib/components/BlockingConfirmDialog/index.d.ts +41 -0
- package/dist/lib/components/BlockingConfirmDialog/index.d.ts.map +1 -0
- package/dist/lib/components/ColorSwatchRow/index.d.ts +15 -0
- package/dist/lib/components/ColorSwatchRow/index.d.ts.map +1 -0
- package/dist/lib/components/CreateWorkspaceWizard/ColorSwatchRow/index.d.ts +15 -0
- package/dist/lib/components/CreateWorkspaceWizard/ColorSwatchRow/index.d.ts.map +1 -0
- package/dist/lib/components/CreateWorkspaceWizard/ContentStep/ModeTiles/index.d.ts +11 -0
- package/dist/lib/components/CreateWorkspaceWizard/ContentStep/ModeTiles/index.d.ts.map +1 -0
- package/dist/lib/components/CreateWorkspaceWizard/ContentStep/ResourceSection/index.d.ts +48 -0
- package/dist/lib/components/CreateWorkspaceWizard/ContentStep/ResourceSection/index.d.ts.map +1 -0
- package/dist/lib/components/CreateWorkspaceWizard/ContentStep/index.d.ts +23 -0
- package/dist/lib/components/CreateWorkspaceWizard/ContentStep/index.d.ts.map +1 -0
- package/dist/lib/components/CreateWorkspaceWizard/IdentityFields/index.d.ts +17 -0
- package/dist/lib/components/CreateWorkspaceWizard/IdentityFields/index.d.ts.map +1 -0
- package/dist/lib/components/CreateWorkspaceWizard/MembersStep/MemberRow/index.d.ts +14 -0
- package/dist/lib/components/CreateWorkspaceWizard/MembersStep/MemberRow/index.d.ts.map +1 -0
- package/dist/lib/components/CreateWorkspaceWizard/MembersStep/MemberTypeahead/index.d.ts +15 -0
- package/dist/lib/components/CreateWorkspaceWizard/MembersStep/MemberTypeahead/index.d.ts.map +1 -0
- package/dist/lib/components/CreateWorkspaceWizard/MembersStep/index.d.ts +17 -0
- package/dist/lib/components/CreateWorkspaceWizard/MembersStep/index.d.ts.map +1 -0
- package/dist/lib/components/CreateWorkspaceWizard/Monogram/index.d.ts +17 -0
- package/dist/lib/components/CreateWorkspaceWizard/Monogram/index.d.ts.map +1 -0
- package/dist/lib/components/CreateWorkspaceWizard/SlugField/index.d.ts +23 -0
- package/dist/lib/components/CreateWorkspaceWizard/SlugField/index.d.ts.map +1 -0
- package/dist/lib/components/StatusChip/index.d.ts +9 -0
- package/dist/lib/components/StatusChip/index.d.ts.map +1 -0
- package/dist/lib/components/WorkspaceAvatar/index.d.ts +20 -0
- package/dist/lib/components/WorkspaceAvatar/index.d.ts.map +1 -0
- package/dist/lib/components/WorkspaceCard/MemberStack/MemberListPopover/index.d.ts +9 -0
- package/dist/lib/components/WorkspaceCard/MemberStack/MemberListPopover/index.d.ts.map +1 -0
- package/dist/lib/components/WorkspaceCard/MemberStack/index.d.ts +11 -0
- package/dist/lib/components/WorkspaceCard/MemberStack/index.d.ts.map +1 -0
- package/dist/lib/components/WorkspaceCard/StatusChip/index.d.ts +9 -0
- package/dist/lib/components/WorkspaceCard/StatusChip/index.d.ts.map +1 -0
- package/dist/lib/components/WorkspaceCard/index.d.ts +15 -0
- package/dist/lib/components/WorkspaceCard/index.d.ts.map +1 -0
- package/dist/lib/components/WorkspaceCommands/index.d.ts +8 -0
- package/dist/lib/components/WorkspaceCommands/index.d.ts.map +1 -0
- package/dist/lib/components/WorkspaceContentSettings/AddContentDialog/index.d.ts +26 -0
- package/dist/lib/components/WorkspaceContentSettings/AddContentDialog/index.d.ts.map +1 -0
- package/dist/lib/components/WorkspaceContentSettings/GrantedContentGroup/index.d.ts +21 -0
- package/dist/lib/components/WorkspaceContentSettings/GrantedContentGroup/index.d.ts.map +1 -0
- package/dist/lib/components/WorkspaceContentSettings/GrantedContentRow/index.d.ts +26 -0
- package/dist/lib/components/WorkspaceContentSettings/GrantedContentRow/index.d.ts.map +1 -0
- package/dist/lib/components/WorkspaceContentSettings/RemoveContentDialog/index.d.ts +25 -0
- package/dist/lib/components/WorkspaceContentSettings/RemoveContentDialog/index.d.ts.map +1 -0
- package/dist/lib/components/WorkspaceContentSettings/index.d.ts +25 -0
- package/dist/lib/components/WorkspaceContentSettings/index.d.ts.map +1 -0
- package/dist/lib/components/WorkspaceDangerSettings/DeleteWorkspaceDialog/index.d.ts +22 -0
- package/dist/lib/components/WorkspaceDangerSettings/DeleteWorkspaceDialog/index.d.ts.map +1 -0
- package/dist/lib/components/WorkspaceDangerSettings/index.d.ts +18 -0
- package/dist/lib/components/WorkspaceDangerSettings/index.d.ts.map +1 -0
- package/dist/lib/components/WorkspaceGeneralSettings/index.d.ts +18 -0
- package/dist/lib/components/WorkspaceGeneralSettings/index.d.ts.map +1 -0
- package/dist/lib/components/WorkspaceMembersSettings/MemberDirectorySearch/index.d.ts +18 -0
- package/dist/lib/components/WorkspaceMembersSettings/MemberDirectorySearch/index.d.ts.map +1 -0
- package/dist/lib/components/WorkspaceMembersSettings/MemberListRow/index.d.ts +17 -0
- package/dist/lib/components/WorkspaceMembersSettings/MemberListRow/index.d.ts.map +1 -0
- package/dist/lib/components/WorkspaceMembersSettings/index.d.ts +16 -0
- package/dist/lib/components/WorkspaceMembersSettings/index.d.ts.map +1 -0
- package/dist/lib/components/WorkspaceNav/WorkspaceNavButton/index.d.ts +14 -0
- package/dist/lib/components/WorkspaceNav/WorkspaceNavButton/index.d.ts.map +1 -0
- package/dist/lib/components/WorkspaceNav/WorkspaceSwitcher/index.d.ts +16 -0
- package/dist/lib/components/WorkspaceNav/WorkspaceSwitcher/index.d.ts.map +1 -0
- package/dist/lib/components/WorkspaceNav/index.d.ts +14 -0
- package/dist/lib/components/WorkspaceNav/index.d.ts.map +1 -0
- package/dist/lib/components/WorkspaceSettingsRail/index.d.ts +14 -0
- package/dist/lib/components/WorkspaceSettingsRail/index.d.ts.map +1 -0
- package/dist/lib/components/WorkspaceSettingsTabs/index.d.ts +14 -0
- package/dist/lib/components/WorkspaceSettingsTabs/index.d.ts.map +1 -0
- package/dist/lib/components/WorkspaceSettingsTopBar/index.d.ts +8 -0
- package/dist/lib/components/WorkspaceSettingsTopBar/index.d.ts.map +1 -0
- package/dist/lib/components/WorkspaceShell/NewWorkspaceButton/index.d.ts +7 -0
- package/dist/lib/components/WorkspaceShell/NewWorkspaceButton/index.d.ts.map +1 -0
- package/dist/lib/components/WorkspaceShell/RailTooltip/index.d.ts +22 -0
- package/dist/lib/components/WorkspaceShell/RailTooltip/index.d.ts.map +1 -0
- package/dist/lib/components/WorkspaceShell/WorkspaceRail/index.d.ts +17 -0
- package/dist/lib/components/WorkspaceShell/WorkspaceRail/index.d.ts.map +1 -0
- package/dist/lib/components/WorkspaceShell/WorkspaceSidebarButton/index.d.ts +17 -0
- package/dist/lib/components/WorkspaceShell/WorkspaceSidebarButton/index.d.ts.map +1 -0
- package/dist/lib/components/WorkspaceShell/WorkspaceSwitcher/WorkspaceSwitcherPopover/index.d.ts +26 -0
- package/dist/lib/components/WorkspaceShell/WorkspaceSwitcher/WorkspaceSwitcherPopover/index.d.ts.map +1 -0
- package/dist/lib/components/WorkspaceShell/WorkspaceSwitcher/index.d.ts +17 -0
- package/dist/lib/components/WorkspaceShell/WorkspaceSwitcher/index.d.ts.map +1 -0
- package/dist/lib/components/WorkspaceShell/index.d.ts +16 -0
- package/dist/lib/components/WorkspaceShell/index.d.ts.map +1 -0
- package/dist/lib/components/WorkspaceStats/index.d.ts +9 -0
- package/dist/lib/components/WorkspaceStats/index.d.ts.map +1 -0
- package/dist/lib/components/WorkspaceToolbar/index.d.ts +22 -0
- package/dist/lib/components/WorkspaceToolbar/index.d.ts.map +1 -0
- package/dist/lib/components/WorkspacesEmpty/index.d.ts +18 -0
- package/dist/lib/components/WorkspacesEmpty/index.d.ts.map +1 -0
- package/dist/lib/components/WorkspacesHomePanel/index.d.ts +7 -0
- package/dist/lib/components/WorkspacesHomePanel/index.d.ts.map +1 -0
- package/dist/lib/components/WorkspacesNavSection/index.d.ts +9 -0
- package/dist/lib/components/WorkspacesNavSection/index.d.ts.map +1 -0
- package/dist/lib/components/WorkspacesSkeleton/index.d.ts +36 -0
- package/dist/lib/components/WorkspacesSkeleton/index.d.ts.map +1 -0
- package/dist/lib/components/WorkspacesTable/index.d.ts +12 -0
- package/dist/lib/components/WorkspacesTable/index.d.ts.map +1 -0
- package/dist/lib/domain/isActiveWorkspace/index.d.ts +9 -0
- package/dist/lib/domain/isActiveWorkspace/index.d.ts.map +1 -0
- package/dist/lib/domain/isActiveWorkspace/index.js +9 -0
- package/dist/lib/domain/permissions/index.d.ts +7 -0
- package/dist/lib/domain/permissions/index.d.ts.map +1 -0
- package/dist/lib/domain/permissions/index.js +6 -0
- package/dist/lib/domain/resourceSelection/index.d.ts +18 -0
- package/dist/lib/domain/resourceSelection/index.d.ts.map +1 -0
- package/dist/lib/domain/resourceSelection/index.js +49 -0
- package/dist/lib/domain/slug/index.d.ts +25 -0
- package/dist/lib/domain/slug/index.d.ts.map +1 -0
- package/dist/lib/domain/slug/index.js +45 -0
- package/dist/lib/domain/types/wizard/index.d.ts +126 -0
- package/dist/lib/domain/types/wizard/index.d.ts.map +1 -0
- package/dist/lib/domain/types/wizard/index.js +21 -0
- package/dist/lib/domain/types/workspace/index.d.ts +42 -0
- package/dist/lib/domain/types/workspace/index.d.ts.map +1 -0
- package/dist/lib/domain/types/workspace/index.js +1 -0
- package/dist/lib/domain/workspaceLimits/index.d.ts +23 -0
- package/dist/lib/domain/workspaceLimits/index.d.ts.map +1 -0
- package/dist/lib/domain/workspaceLimits/index.js +22 -0
- package/dist/lib/hooks/useBasicsSchema/index.d.ts +14 -0
- package/dist/lib/hooks/useBasicsSchema/index.d.ts.map +1 -0
- package/dist/lib/hooks/useResourceSelection/index.d.ts +21 -0
- package/dist/lib/hooks/useResourceSelection/index.d.ts.map +1 -0
- package/dist/lib/hooks/useSlug/index.d.ts +28 -0
- package/dist/lib/hooks/useSlug/index.d.ts.map +1 -0
- package/dist/lib/hooks/useWizard/index.d.ts +57 -0
- package/dist/lib/hooks/useWizard/index.d.ts.map +1 -0
- package/dist/lib/hooks/useWorkspaceProfileSchema/index.d.ts +13 -0
- package/dist/lib/hooks/useWorkspaceProfileSchema/index.d.ts.map +1 -0
- package/dist/lib/infrastructure/buildCreateWorkspaceBody/index.d.ts +12 -0
- package/dist/lib/infrastructure/buildCreateWorkspaceBody/index.d.ts.map +1 -0
- package/dist/lib/infrastructure/buildCreateWorkspaceBody/index.js +27 -0
- package/dist/lib/infrastructure/httpWorkspaceGateway/index.d.ts +10 -0
- package/dist/lib/infrastructure/httpWorkspaceGateway/index.d.ts.map +1 -0
- package/dist/lib/infrastructure/httpWorkspaceGateway/index.js +149 -0
- package/dist/lib/infrastructure/isConflict/index.d.ts +8 -0
- package/dist/lib/infrastructure/isConflict/index.d.ts.map +1 -0
- package/dist/lib/infrastructure/isConflict/index.js +12 -0
- package/dist/lib/infrastructure/workspaceGateway/index.d.ts +90 -0
- package/dist/lib/infrastructure/workspaceGateway/index.d.ts.map +1 -0
- package/dist/lib/infrastructure/workspaceGateway/index.js +1 -0
- package/dist/lib/infrastructure/workspaceMapper/index.d.ts +28 -0
- package/dist/lib/infrastructure/workspaceMapper/index.d.ts.map +1 -0
- package/dist/lib/infrastructure/workspaceMapper/index.js +36 -0
- package/dist/lib/pages/CreateWorkspacePage/index.d.ts +7 -0
- package/dist/lib/pages/CreateWorkspacePage/index.d.ts.map +1 -0
- package/dist/lib/pages/WorkspaceSettingsPage/index.d.ts +12 -0
- package/dist/lib/pages/WorkspaceSettingsPage/index.d.ts.map +1 -0
- package/dist/lib/pages/WorkspacesPage/index.d.ts +7 -0
- package/dist/lib/pages/WorkspacesPage/index.d.ts.map +1 -0
- package/dist/lib/presentation/components/BlockingConfirmDialog/index.d.ts +41 -0
- package/dist/lib/presentation/components/BlockingConfirmDialog/index.d.ts.map +1 -0
- package/dist/lib/presentation/components/BlockingConfirmDialog/index.js +17 -0
- package/dist/lib/presentation/components/ColorSwatchRow/index.d.ts +22 -0
- package/dist/lib/presentation/components/ColorSwatchRow/index.d.ts.map +1 -0
- package/dist/lib/presentation/components/ColorSwatchRow/index.js +70 -0
- package/dist/lib/presentation/components/CreateWorkspaceWizard/ContentStep/ModeTiles/index.d.ts +11 -0
- package/dist/lib/presentation/components/CreateWorkspaceWizard/ContentStep/ModeTiles/index.d.ts.map +1 -0
- package/dist/lib/presentation/components/CreateWorkspaceWizard/ContentStep/ModeTiles/index.js +47 -0
- package/dist/lib/presentation/components/CreateWorkspaceWizard/ContentStep/ResourceSection/index.d.ts +48 -0
- package/dist/lib/presentation/components/CreateWorkspaceWizard/ContentStep/ResourceSection/index.d.ts.map +1 -0
- package/dist/lib/presentation/components/CreateWorkspaceWizard/ContentStep/ResourceSection/index.js +32 -0
- package/dist/lib/presentation/components/CreateWorkspaceWizard/ContentStep/index.d.ts +23 -0
- package/dist/lib/presentation/components/CreateWorkspaceWizard/ContentStep/index.d.ts.map +1 -0
- package/dist/lib/presentation/components/CreateWorkspaceWizard/ContentStep/index.js +128 -0
- package/dist/lib/presentation/components/CreateWorkspaceWizard/IdentityFields/index.d.ts +17 -0
- package/dist/lib/presentation/components/CreateWorkspaceWizard/IdentityFields/index.d.ts.map +1 -0
- package/dist/lib/presentation/components/CreateWorkspaceWizard/IdentityFields/index.js +70 -0
- package/dist/lib/presentation/components/CreateWorkspaceWizard/MembersStep/MemberRow/index.d.ts +14 -0
- package/dist/lib/presentation/components/CreateWorkspaceWizard/MembersStep/MemberRow/index.d.ts.map +1 -0
- package/dist/lib/presentation/components/CreateWorkspaceWizard/MembersStep/MemberRow/index.js +25 -0
- package/dist/lib/presentation/components/CreateWorkspaceWizard/MembersStep/MemberTypeahead/index.d.ts +15 -0
- package/dist/lib/presentation/components/CreateWorkspaceWizard/MembersStep/MemberTypeahead/index.d.ts.map +1 -0
- package/dist/lib/presentation/components/CreateWorkspaceWizard/MembersStep/MemberTypeahead/index.js +112 -0
- package/dist/lib/presentation/components/CreateWorkspaceWizard/MembersStep/index.d.ts +17 -0
- package/dist/lib/presentation/components/CreateWorkspaceWizard/MembersStep/index.d.ts.map +1 -0
- package/dist/lib/presentation/components/CreateWorkspaceWizard/MembersStep/index.js +35 -0
- package/dist/lib/presentation/components/CreateWorkspaceWizard/Monogram/index.d.ts +17 -0
- package/dist/lib/presentation/components/CreateWorkspaceWizard/Monogram/index.d.ts.map +1 -0
- package/dist/lib/presentation/components/CreateWorkspaceWizard/Monogram/index.js +11 -0
- package/dist/lib/presentation/components/CreateWorkspaceWizard/SlugField/index.d.ts +23 -0
- package/dist/lib/presentation/components/CreateWorkspaceWizard/SlugField/index.d.ts.map +1 -0
- package/dist/lib/presentation/components/CreateWorkspaceWizard/SlugField/index.js +68 -0
- package/dist/lib/presentation/components/StatusChip/index.d.ts +9 -0
- package/dist/lib/presentation/components/StatusChip/index.d.ts.map +1 -0
- package/dist/lib/presentation/components/StatusChip/index.js +23 -0
- package/dist/lib/presentation/components/WorkspaceAvatar/index.d.ts +20 -0
- package/dist/lib/presentation/components/WorkspaceAvatar/index.d.ts.map +1 -0
- package/dist/lib/presentation/components/WorkspaceAvatar/index.js +10 -0
- package/dist/lib/presentation/components/WorkspaceCommands/index.d.ts +8 -0
- package/dist/lib/presentation/components/WorkspaceCommands/index.d.ts.map +1 -0
- package/dist/lib/presentation/components/WorkspaceCommands/index.js +34 -0
- package/dist/lib/presentation/components/WorkspaceContentSettings/AddContentDialog/index.d.ts +26 -0
- package/dist/lib/presentation/components/WorkspaceContentSettings/AddContentDialog/index.d.ts.map +1 -0
- package/dist/lib/presentation/components/WorkspaceContentSettings/AddContentDialog/index.js +89 -0
- package/dist/lib/presentation/components/WorkspaceContentSettings/GrantedContentGroup/index.d.ts +21 -0
- package/dist/lib/presentation/components/WorkspaceContentSettings/GrantedContentGroup/index.d.ts.map +1 -0
- package/dist/lib/presentation/components/WorkspaceContentSettings/GrantedContentGroup/index.js +11 -0
- package/dist/lib/presentation/components/WorkspaceContentSettings/GrantedContentRow/index.d.ts +26 -0
- package/dist/lib/presentation/components/WorkspaceContentSettings/GrantedContentRow/index.d.ts.map +1 -0
- package/dist/lib/presentation/components/WorkspaceContentSettings/GrantedContentRow/index.js +31 -0
- package/dist/lib/presentation/components/WorkspaceContentSettings/RemoveContentDialog/index.d.ts +25 -0
- package/dist/lib/presentation/components/WorkspaceContentSettings/RemoveContentDialog/index.d.ts.map +1 -0
- package/dist/lib/presentation/components/WorkspaceContentSettings/RemoveContentDialog/index.js +48 -0
- package/dist/lib/presentation/components/WorkspaceContentSettings/index.d.ts +25 -0
- package/dist/lib/presentation/components/WorkspaceContentSettings/index.d.ts.map +1 -0
- package/dist/lib/presentation/components/WorkspaceContentSettings/index.js +173 -0
- package/dist/lib/presentation/components/WorkspaceDangerSettings/DeleteWorkspaceDialog/index.d.ts +22 -0
- package/dist/lib/presentation/components/WorkspaceDangerSettings/DeleteWorkspaceDialog/index.d.ts.map +1 -0
- package/dist/lib/presentation/components/WorkspaceDangerSettings/DeleteWorkspaceDialog/index.js +52 -0
- package/dist/lib/presentation/components/WorkspaceDangerSettings/index.d.ts +18 -0
- package/dist/lib/presentation/components/WorkspaceDangerSettings/index.d.ts.map +1 -0
- package/dist/lib/presentation/components/WorkspaceDangerSettings/index.js +150 -0
- package/dist/lib/presentation/components/WorkspaceGeneralSettings/WorkspaceIdField/index.d.ts +19 -0
- package/dist/lib/presentation/components/WorkspaceGeneralSettings/WorkspaceIdField/index.d.ts.map +1 -0
- package/dist/lib/presentation/components/WorkspaceGeneralSettings/WorkspaceIdField/index.js +72 -0
- package/dist/lib/presentation/components/WorkspaceGeneralSettings/index.d.ts +18 -0
- package/dist/lib/presentation/components/WorkspaceGeneralSettings/index.d.ts.map +1 -0
- package/dist/lib/presentation/components/WorkspaceGeneralSettings/index.js +131 -0
- package/dist/lib/presentation/components/WorkspaceMembersSettings/MemberDirectorySearch/index.d.ts +18 -0
- package/dist/lib/presentation/components/WorkspaceMembersSettings/MemberDirectorySearch/index.d.ts.map +1 -0
- package/dist/lib/presentation/components/WorkspaceMembersSettings/MemberDirectorySearch/index.js +65 -0
- package/dist/lib/presentation/components/WorkspaceMembersSettings/MemberListRow/index.d.ts +17 -0
- package/dist/lib/presentation/components/WorkspaceMembersSettings/MemberListRow/index.d.ts.map +1 -0
- package/dist/lib/presentation/components/WorkspaceMembersSettings/MemberListRow/index.js +22 -0
- package/dist/lib/presentation/components/WorkspaceMembersSettings/index.d.ts +16 -0
- package/dist/lib/presentation/components/WorkspaceMembersSettings/index.d.ts.map +1 -0
- package/dist/lib/presentation/components/WorkspaceMembersSettings/index.js +127 -0
- package/dist/lib/presentation/components/WorkspaceNav/WorkspaceNavButton/index.d.ts +14 -0
- package/dist/lib/presentation/components/WorkspaceNav/WorkspaceNavButton/index.d.ts.map +1 -0
- package/dist/lib/presentation/components/WorkspaceNav/WorkspaceNavButton/index.js +30 -0
- package/dist/lib/presentation/components/WorkspaceNav/WorkspaceSwitcher/index.d.ts +16 -0
- package/dist/lib/presentation/components/WorkspaceNav/WorkspaceSwitcher/index.d.ts.map +1 -0
- package/dist/lib/presentation/components/WorkspaceNav/WorkspaceSwitcher/index.js +81 -0
- package/dist/lib/presentation/components/WorkspaceNav/index.d.ts +14 -0
- package/dist/lib/presentation/components/WorkspaceNav/index.d.ts.map +1 -0
- package/dist/lib/presentation/components/WorkspaceNav/index.js +51 -0
- package/dist/lib/presentation/components/WorkspaceSettingsTabs/index.d.ts +14 -0
- package/dist/lib/presentation/components/WorkspaceSettingsTabs/index.d.ts.map +1 -0
- package/dist/lib/presentation/components/WorkspaceSettingsTabs/index.js +66 -0
- package/dist/lib/presentation/components/WorkspaceSettingsTopBar/index.d.ts +8 -0
- package/dist/lib/presentation/components/WorkspaceSettingsTopBar/index.d.ts.map +1 -0
- package/dist/lib/presentation/components/WorkspaceSettingsTopBar/index.js +57 -0
- package/dist/lib/presentation/components/WorkspaceShell/index.d.ts +16 -0
- package/dist/lib/presentation/components/WorkspaceShell/index.d.ts.map +1 -0
- package/dist/lib/presentation/components/WorkspaceShell/index.js +100 -0
- package/dist/lib/presentation/components/WorkspaceStats/index.d.ts +9 -0
- package/dist/lib/presentation/components/WorkspaceStats/index.d.ts.map +1 -0
- package/dist/lib/presentation/components/WorkspaceStats/index.js +48 -0
- package/dist/lib/presentation/components/WorkspaceToolbar/index.d.ts +22 -0
- package/dist/lib/presentation/components/WorkspaceToolbar/index.d.ts.map +1 -0
- package/dist/lib/presentation/components/WorkspaceToolbar/index.js +73 -0
- package/dist/lib/presentation/components/WorkspacesEmpty/index.d.ts +18 -0
- package/dist/lib/presentation/components/WorkspacesEmpty/index.d.ts.map +1 -0
- package/dist/lib/presentation/components/WorkspacesEmpty/index.js +42 -0
- package/dist/lib/presentation/components/WorkspacesHomePanel/index.d.ts +7 -0
- package/dist/lib/presentation/components/WorkspacesHomePanel/index.d.ts.map +1 -0
- package/dist/lib/presentation/components/WorkspacesHomePanel/index.js +50 -0
- package/dist/lib/presentation/components/WorkspacesNavSection/index.d.ts +15 -0
- package/dist/lib/presentation/components/WorkspacesNavSection/index.d.ts.map +1 -0
- package/dist/lib/presentation/components/WorkspacesNavSection/index.js +76 -0
- package/dist/lib/presentation/components/WorkspacesSkeleton/index.d.ts +49 -0
- package/dist/lib/presentation/components/WorkspacesSkeleton/index.d.ts.map +1 -0
- package/dist/lib/presentation/components/WorkspacesSkeleton/index.js +94 -0
- package/dist/lib/presentation/components/WorkspacesTable/index.d.ts +12 -0
- package/dist/lib/presentation/components/WorkspacesTable/index.d.ts.map +1 -0
- package/dist/lib/presentation/components/WorkspacesTable/index.js +58 -0
- package/dist/lib/presentation/currentWorkspace/index.d.ts +17 -0
- package/dist/lib/presentation/currentWorkspace/index.d.ts.map +1 -0
- package/dist/lib/presentation/currentWorkspace/index.js +44 -0
- package/dist/lib/presentation/hooks/useBasicsSchema/index.d.ts +17 -0
- package/dist/lib/presentation/hooks/useBasicsSchema/index.d.ts.map +1 -0
- package/dist/lib/presentation/hooks/useBasicsSchema/index.js +71 -0
- package/dist/lib/presentation/hooks/useComboboxList/index.d.ts +44 -0
- package/dist/lib/presentation/hooks/useComboboxList/index.d.ts.map +1 -0
- package/dist/lib/presentation/hooks/useComboboxList/index.js +62 -0
- package/dist/lib/presentation/hooks/useRedirectNotice/index.d.ts +24 -0
- package/dist/lib/presentation/hooks/useRedirectNotice/index.d.ts.map +1 -0
- package/dist/lib/presentation/hooks/useRedirectNotice/index.js +37 -0
- package/dist/lib/presentation/hooks/useResourceSelection/index.d.ts +21 -0
- package/dist/lib/presentation/hooks/useResourceSelection/index.d.ts.map +1 -0
- package/dist/lib/presentation/hooks/useResourceSelection/index.js +16 -0
- package/dist/lib/presentation/hooks/useSlug/index.d.ts +28 -0
- package/dist/lib/presentation/hooks/useSlug/index.d.ts.map +1 -0
- package/dist/lib/presentation/hooks/useSlug/index.js +18 -0
- package/dist/lib/presentation/hooks/useWizard/index.d.ts +60 -0
- package/dist/lib/presentation/hooks/useWizard/index.d.ts.map +1 -0
- package/dist/lib/presentation/hooks/useWizard/index.js +93 -0
- package/dist/lib/presentation/hooks/useWorkspaceProfileSchema/index.d.ts +16 -0
- package/dist/lib/presentation/hooks/useWorkspaceProfileSchema/index.d.ts.map +1 -0
- package/dist/lib/presentation/hooks/useWorkspaceProfileSchema/index.js +53 -0
- package/dist/lib/presentation/pages/CreateWorkspacePage/index.d.ts +7 -0
- package/dist/lib/presentation/pages/CreateWorkspacePage/index.d.ts.map +1 -0
- package/dist/lib/presentation/pages/CreateWorkspacePage/index.js +248 -0
- package/dist/lib/presentation/pages/WorkspaceSettingsPage/index.d.ts +12 -0
- package/dist/lib/presentation/pages/WorkspaceSettingsPage/index.d.ts.map +1 -0
- package/dist/lib/presentation/pages/WorkspaceSettingsPage/index.js +69 -0
- package/dist/lib/presentation/pages/WorkspacesPage/index.d.ts +7 -0
- package/dist/lib/presentation/pages/WorkspacesPage/index.d.ts.map +1 -0
- package/dist/lib/presentation/pages/WorkspacesPage/index.js +112 -0
- package/dist/lib/presentation/slots/workspaceSlots/index.d.ts +101 -0
- package/dist/lib/presentation/slots/workspaceSlots/index.d.ts.map +1 -0
- package/dist/lib/presentation/slots/workspaceSlots/index.js +25 -0
- package/dist/lib/presentation/workspacesPlugin/index.d.ts +31 -0
- package/dist/lib/presentation/workspacesPlugin/index.d.ts.map +1 -0
- package/dist/lib/presentation/workspacesPlugin/index.js +151 -0
- package/dist/lib/slots/workspaceSlots/index.d.ts +101 -0
- package/dist/lib/slots/workspaceSlots/index.d.ts.map +1 -0
- package/dist/lib/types/wizard/index.d.ts +119 -0
- package/dist/lib/types/wizard/index.d.ts.map +1 -0
- package/dist/lib/types/workspace/index.d.ts +42 -0
- package/dist/lib/types/workspace/index.d.ts.map +1 -0
- package/dist/lib/utils/buildCreateWorkspaceBody/index.d.ts +12 -0
- package/dist/lib/utils/buildCreateWorkspaceBody/index.d.ts.map +1 -0
- package/dist/lib/utils/currentWorkspace/index.d.ts +17 -0
- package/dist/lib/utils/currentWorkspace/index.d.ts.map +1 -0
- package/dist/lib/utils/isActiveWorkspace/index.d.ts +9 -0
- package/dist/lib/utils/isActiveWorkspace/index.d.ts.map +1 -0
- package/dist/lib/utils/isConflict/index.d.ts +8 -0
- package/dist/lib/utils/isConflict/index.d.ts.map +1 -0
- package/dist/lib/utils/permissions/index.d.ts +7 -0
- package/dist/lib/utils/permissions/index.d.ts.map +1 -0
- package/dist/lib/utils/radioGroupKeydown/index.d.ts +15 -0
- package/dist/lib/utils/radioGroupKeydown/index.d.ts.map +1 -0
- package/dist/lib/utils/resourceSelection/index.d.ts +18 -0
- package/dist/lib/utils/resourceSelection/index.d.ts.map +1 -0
- package/dist/lib/utils/workspacesPlugin/index.d.ts +31 -0
- package/dist/lib/utils/workspacesPlugin/index.d.ts.map +1 -0
- package/package.json +48 -0
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { useMemo } from 'react';
|
|
2
|
+
import { defineMessages, useIntl } from 'react-intl';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
import { DESCRIPTION_MAX, NAME_MAX } from '../../../domain/workspaceLimits';
|
|
5
|
+
/** Validation copy for the settings profile form, co-located with the schema. */
|
|
6
|
+
const messages = defineMessages({
|
|
7
|
+
nameRequired: {
|
|
8
|
+
id: 'workspaces.settings.general.nameRequired',
|
|
9
|
+
defaultMessage: 'Workspace name is required.'
|
|
10
|
+
},
|
|
11
|
+
nameTooLong: {
|
|
12
|
+
id: 'workspaces.settings.general.nameTooLong',
|
|
13
|
+
defaultMessage: 'Name must be at most {max} characters.'
|
|
14
|
+
},
|
|
15
|
+
descriptionTooLong: {
|
|
16
|
+
id: 'workspaces.settings.general.descriptionTooLong',
|
|
17
|
+
defaultMessage: 'Description must be at most {max} characters.'
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
/**
|
|
21
|
+
* Builds the settings General-tab Zod schema with localized messages. Mirrors
|
|
22
|
+
* the server `UpdateWorkspaceDto` through the shared {@link NAME_MAX} /
|
|
23
|
+
* {@link DESCRIPTION_MAX} constants (name required, ≤120; description ≤2000),
|
|
24
|
+
* rather than restating the numbers here — which is how they previously drifted
|
|
25
|
+
* to 100/500 and locked long-named workspaces out of the whole form. The slug is
|
|
26
|
+
* intentionally absent — it's the workspace's immutable URL identifier and isn't
|
|
27
|
+
* editable from settings. Rebuilt when the locale changes so the copy stays in
|
|
28
|
+
* sync with the UI.
|
|
29
|
+
*/
|
|
30
|
+
export function useWorkspaceProfileSchema() {
|
|
31
|
+
const intl = useIntl();
|
|
32
|
+
return useMemo(() => z.object({
|
|
33
|
+
name: z
|
|
34
|
+
.string()
|
|
35
|
+
.trim()
|
|
36
|
+
.min(1, {
|
|
37
|
+
message: intl.formatMessage(messages.nameRequired)
|
|
38
|
+
})
|
|
39
|
+
.max(NAME_MAX, {
|
|
40
|
+
message: intl.formatMessage(messages.nameTooLong, {
|
|
41
|
+
max: NAME_MAX
|
|
42
|
+
})
|
|
43
|
+
}),
|
|
44
|
+
description: z
|
|
45
|
+
.string()
|
|
46
|
+
.trim()
|
|
47
|
+
.max(DESCRIPTION_MAX, {
|
|
48
|
+
message: intl.formatMessage(messages.descriptionTooLong, {
|
|
49
|
+
max: DESCRIPTION_MAX
|
|
50
|
+
})
|
|
51
|
+
})
|
|
52
|
+
}), [intl]);
|
|
53
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Full-page wizard for creating a workspace. Owns navigation and submission;
|
|
3
|
+
* all form state lives in {@link useWizard}, and each step body is
|
|
4
|
+
* presentational. Rendered at `/workspaces/new` inside the authenticated shell.
|
|
5
|
+
*/
|
|
6
|
+
export declare function CreateWorkspacePage(): import("react").JSX.Element;
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lib/presentation/pages/CreateWorkspacePage/index.tsx"],"names":[],"mappings":"AA+JA;;;;GAIG;AACH,wBAAgB,mBAAmB,gCAuVlC"}
|
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useRef } from 'react';
|
|
3
|
+
import { defineMessages, useIntl } from 'react-intl';
|
|
4
|
+
import { Link, Navigate } from 'react-router-dom';
|
|
5
|
+
import { useHasPermission } from '@orthacms/identity-admin';
|
|
6
|
+
import { PageTopBar } from '@orthacms/shell-admin';
|
|
7
|
+
import { ArrowLeft, ArrowRight, Layers } from 'lucide-react';
|
|
8
|
+
import { Button, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Container, ContainerHeader, Spinner, Stepper, WizardFooter, WizardStepCard } from '@orthacms/design-system';
|
|
9
|
+
import { useDocumentTitle } from '@orthacms/utils-admin';
|
|
10
|
+
import { useCreateWorkspaceFlow } from '../../../application/useCreateWorkspaceFlow';
|
|
11
|
+
import { ContentStep } from '../../components/CreateWorkspaceWizard/ContentStep';
|
|
12
|
+
import { IdentityFields } from '../../components/CreateWorkspaceWizard/IdentityFields';
|
|
13
|
+
import { MembersStep } from '../../components/CreateWorkspaceWizard/MembersStep';
|
|
14
|
+
import { useSlug } from '../../hooks/useSlug';
|
|
15
|
+
import { useWizard } from '../../hooks/useWizard';
|
|
16
|
+
import { SlugStatus } from '../../../domain/types/wizard';
|
|
17
|
+
import { EMPTY_SELECTION } from '../../../domain/resourceSelection';
|
|
18
|
+
const messages = defineMessages({
|
|
19
|
+
title: {
|
|
20
|
+
id: 'workspaces.create.title',
|
|
21
|
+
defaultMessage: 'Create workspace'
|
|
22
|
+
},
|
|
23
|
+
subtitle: {
|
|
24
|
+
id: 'workspaces.create.subtitle',
|
|
25
|
+
defaultMessage: 'Set up a new workspace in three short steps. You can change most settings later.'
|
|
26
|
+
},
|
|
27
|
+
back: {
|
|
28
|
+
id: 'workspaces.create.backToWorkspaces',
|
|
29
|
+
defaultMessage: 'Back to workspaces'
|
|
30
|
+
},
|
|
31
|
+
crumbWorkspaces: {
|
|
32
|
+
id: 'workspaces.create.crumbWorkspaces',
|
|
33
|
+
defaultMessage: 'Workspaces'
|
|
34
|
+
},
|
|
35
|
+
// Rail
|
|
36
|
+
stepBasics: {
|
|
37
|
+
id: 'workspaces.create.stepBasics',
|
|
38
|
+
defaultMessage: 'Basics'
|
|
39
|
+
},
|
|
40
|
+
stepBasicsHint: {
|
|
41
|
+
id: 'workspaces.create.stepBasicsHint',
|
|
42
|
+
defaultMessage: 'Name, slug, and description'
|
|
43
|
+
},
|
|
44
|
+
stepMembers: {
|
|
45
|
+
id: 'workspaces.create.stepMembers',
|
|
46
|
+
defaultMessage: 'Members'
|
|
47
|
+
},
|
|
48
|
+
stepMembersHint: {
|
|
49
|
+
id: 'workspaces.create.stepMembersHint',
|
|
50
|
+
defaultMessage: 'Who can access the workspace'
|
|
51
|
+
},
|
|
52
|
+
stepContent: {
|
|
53
|
+
id: 'workspaces.create.stepContent',
|
|
54
|
+
defaultMessage: 'Content'
|
|
55
|
+
},
|
|
56
|
+
stepContentHint: {
|
|
57
|
+
id: 'workspaces.create.stepContentHint',
|
|
58
|
+
defaultMessage: 'Collections and pages'
|
|
59
|
+
},
|
|
60
|
+
summaryJustYou: {
|
|
61
|
+
id: 'workspaces.create.summaryMembers',
|
|
62
|
+
defaultMessage: '{count, plural, one {Just you} other {# people}}'
|
|
63
|
+
},
|
|
64
|
+
summaryAllContent: {
|
|
65
|
+
id: 'workspaces.create.summaryAllContent',
|
|
66
|
+
defaultMessage: 'All content'
|
|
67
|
+
},
|
|
68
|
+
summarySpecificContent: {
|
|
69
|
+
id: 'workspaces.create.summarySpecificContent',
|
|
70
|
+
defaultMessage: '{collections} collections · {pages} pages'
|
|
71
|
+
},
|
|
72
|
+
stepperOptional: {
|
|
73
|
+
id: 'workspaces.create.stepper.optional',
|
|
74
|
+
defaultMessage: 'Optional'
|
|
75
|
+
},
|
|
76
|
+
stepperStepLabel: {
|
|
77
|
+
id: 'workspaces.create.stepper.stepLabel',
|
|
78
|
+
defaultMessage: 'Step {number}: {label}'
|
|
79
|
+
},
|
|
80
|
+
stepAnnouncement: {
|
|
81
|
+
id: 'workspaces.create.stepAnnouncement',
|
|
82
|
+
defaultMessage: 'Step {number} of {total}: {label}.'
|
|
83
|
+
},
|
|
84
|
+
// Step cards
|
|
85
|
+
basicsTitle: {
|
|
86
|
+
id: 'workspaces.create.basicsCardTitle',
|
|
87
|
+
defaultMessage: 'Basics'
|
|
88
|
+
},
|
|
89
|
+
basicsDescription: {
|
|
90
|
+
id: 'workspaces.create.basicsCardDescription',
|
|
91
|
+
defaultMessage: 'Name your workspace and give it an identity.'
|
|
92
|
+
},
|
|
93
|
+
membersTitle: {
|
|
94
|
+
id: 'workspaces.create.membersCardTitle',
|
|
95
|
+
defaultMessage: 'Members'
|
|
96
|
+
},
|
|
97
|
+
membersDescription: {
|
|
98
|
+
id: 'workspaces.create.membersCardDescription',
|
|
99
|
+
defaultMessage: 'Add teammates now, or skip and invite them later. You are the owner.'
|
|
100
|
+
},
|
|
101
|
+
contentTitle: {
|
|
102
|
+
id: 'workspaces.create.contentCardTitle',
|
|
103
|
+
defaultMessage: 'Content access'
|
|
104
|
+
},
|
|
105
|
+
contentDescription: {
|
|
106
|
+
id: 'workspaces.create.contentCardDescription',
|
|
107
|
+
defaultMessage: 'Choose what this workspace can access.'
|
|
108
|
+
},
|
|
109
|
+
// Footer
|
|
110
|
+
basicsHint: {
|
|
111
|
+
id: 'workspaces.create.basicsFooterHint',
|
|
112
|
+
defaultMessage: 'Only a name is required — everything else can change later.'
|
|
113
|
+
},
|
|
114
|
+
continueToMembers: {
|
|
115
|
+
id: 'workspaces.create.continueToMembers',
|
|
116
|
+
defaultMessage: 'Continue to members'
|
|
117
|
+
},
|
|
118
|
+
continueToContent: {
|
|
119
|
+
id: 'workspaces.create.continueToContent',
|
|
120
|
+
defaultMessage: 'Continue to content'
|
|
121
|
+
},
|
|
122
|
+
backLabel: {
|
|
123
|
+
id: 'workspaces.create.back',
|
|
124
|
+
defaultMessage: 'Back'
|
|
125
|
+
},
|
|
126
|
+
skipForNow: {
|
|
127
|
+
id: 'workspaces.create.skipForNow',
|
|
128
|
+
defaultMessage: 'Skip for now'
|
|
129
|
+
},
|
|
130
|
+
skipAndCreate: {
|
|
131
|
+
id: 'workspaces.create.skipAndCreate',
|
|
132
|
+
defaultMessage: 'Skip & create'
|
|
133
|
+
},
|
|
134
|
+
create: {
|
|
135
|
+
id: 'workspaces.create.create',
|
|
136
|
+
defaultMessage: 'Create workspace'
|
|
137
|
+
},
|
|
138
|
+
creating: {
|
|
139
|
+
id: 'workspaces.create.creating',
|
|
140
|
+
defaultMessage: 'Creating…'
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
/**
|
|
144
|
+
* Full-page wizard for creating a workspace. Owns navigation and submission;
|
|
145
|
+
* all form state lives in {@link useWizard}, and each step body is
|
|
146
|
+
* presentational. Rendered at `/workspaces/new` inside the authenticated shell.
|
|
147
|
+
*/
|
|
148
|
+
export function CreateWorkspacePage() {
|
|
149
|
+
const intl = useIntl();
|
|
150
|
+
const stepTitleRef = useRef(null);
|
|
151
|
+
useDocumentTitle(intl.formatMessage(messages.title));
|
|
152
|
+
const canCreate = useHasPermission('workspaces:create');
|
|
153
|
+
const wizard = useWizard();
|
|
154
|
+
const flow = useCreateWorkspaceFlow();
|
|
155
|
+
const slug = useSlug({ data: wizard.data, update: wizard.update });
|
|
156
|
+
// `WizardStepCard` is keyed on the step so the entrance animation replays —
|
|
157
|
+
// which unmounts the button the user just pressed and drops focus to
|
|
158
|
+
// <body>, making every step change restart Tab at the top of the document.
|
|
159
|
+
// Move focus to the new card's heading instead. `previousStep` keeps this to
|
|
160
|
+
// real step *changes*: stealing focus on first paint would be its own bug.
|
|
161
|
+
const previousStep = useRef(wizard.step);
|
|
162
|
+
useEffect(() => {
|
|
163
|
+
if (previousStep.current === wizard.step)
|
|
164
|
+
return;
|
|
165
|
+
previousStep.current = wizard.step;
|
|
166
|
+
stepTitleRef.current?.focus();
|
|
167
|
+
}, [wizard.step]);
|
|
168
|
+
// The server enforces `workspaces:create`; redirect rather than render the
|
|
169
|
+
// wizard for users who can't create one (e.g. deep-linking to
|
|
170
|
+
// `/workspaces/new`). Auth is already resolved here — this route renders
|
|
171
|
+
// inside the shell's `RequireAuth`, so `canCreate` reflects real grants.
|
|
172
|
+
if (!canCreate) {
|
|
173
|
+
return (_jsx(Navigate, { to: "/workspaces", replace: true,
|
|
174
|
+
// Tell the list why it's showing instead of the wizard, so the
|
|
175
|
+
// redirect isn't silent for a screen-reader user.
|
|
176
|
+
state: { redirectNotice: 'create-denied' } }));
|
|
177
|
+
}
|
|
178
|
+
const basicsCanContinue = wizard.basicsValid && slug.status === SlugStatus.Available;
|
|
179
|
+
const contentBlocked = wizard.contentMode === 'specific' &&
|
|
180
|
+
(wizard.ctLoading || wizard.ctError);
|
|
181
|
+
// `useWizard` already falls back to step 1 when the basics are incomplete,
|
|
182
|
+
// so this is defense in depth: submitting without a name/slug can only ever
|
|
183
|
+
// throw inside the `Slug` guard and surface as a generic failure, which
|
|
184
|
+
// reads as "the server refused" when nothing was ever sent.
|
|
185
|
+
const createBlocked = flow.submitting || contentBlocked || !wizard.basicsValid;
|
|
186
|
+
// Submission (slug VO validation → create → toast + navigate) lives in the
|
|
187
|
+
// create use-case hook; the page only assembles the snapshot. "Skip &
|
|
188
|
+
// create" submits an override with empty content without mutating state.
|
|
189
|
+
// Both entry points share the incomplete-basics guard: `WizardFooter`'s Skip
|
|
190
|
+
// takes no disabled state, so refusing here is what stops it submitting a
|
|
191
|
+
// snapshot that can only fail.
|
|
192
|
+
const submitTo = (skip) => {
|
|
193
|
+
if (createBlocked)
|
|
194
|
+
return Promise.resolve();
|
|
195
|
+
return flow.submit(skip
|
|
196
|
+
? {
|
|
197
|
+
...wizard.snapshot,
|
|
198
|
+
contentMode: 'specific',
|
|
199
|
+
collections: EMPTY_SELECTION,
|
|
200
|
+
pages: EMPTY_SELECTION
|
|
201
|
+
}
|
|
202
|
+
: wizard.snapshot);
|
|
203
|
+
};
|
|
204
|
+
const railSteps = [
|
|
205
|
+
{
|
|
206
|
+
label: intl.formatMessage(messages.stepBasics),
|
|
207
|
+
hint: intl.formatMessage(messages.stepBasicsHint),
|
|
208
|
+
summary: wizard.data.name.trim() || undefined
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
label: intl.formatMessage(messages.stepMembers),
|
|
212
|
+
hint: intl.formatMessage(messages.stepMembersHint),
|
|
213
|
+
optional: true,
|
|
214
|
+
summary: intl.formatMessage(messages.summaryJustYou, {
|
|
215
|
+
count: wizard.memberCount
|
|
216
|
+
})
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
label: intl.formatMessage(messages.stepContent),
|
|
220
|
+
hint: intl.formatMessage(messages.stepContentHint),
|
|
221
|
+
optional: true,
|
|
222
|
+
summary: wizard.contentMode === 'all'
|
|
223
|
+
? intl.formatMessage(messages.summaryAllContent)
|
|
224
|
+
: intl.formatMessage(messages.summarySpecificContent, {
|
|
225
|
+
collections: wizard.collectionCount,
|
|
226
|
+
pages: wizard.pageCount
|
|
227
|
+
})
|
|
228
|
+
}
|
|
229
|
+
];
|
|
230
|
+
return (_jsxs(_Fragment, { children: [_jsx(PageTopBar, { icon: Layers, iconClassName: "bg-violet-soft text-violet-soft-foreground", crumbs: [
|
|
231
|
+
{
|
|
232
|
+
key: 'workspaces',
|
|
233
|
+
label: intl.formatMessage(messages.crumbWorkspaces),
|
|
234
|
+
to: '/workspaces'
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
key: 'new',
|
|
238
|
+
label: intl.formatMessage(messages.title)
|
|
239
|
+
}
|
|
240
|
+
] }), _jsxs(Container, { className: "max-w-[920px]", children: [_jsxs(Link, { to: "/workspaces", className: "mb-4 inline-flex items-center gap-1.5 text-sm text-muted-foreground transition-colors hover:text-foreground", children: [_jsx(ArrowLeft, { className: "size-4" }), intl.formatMessage(messages.back)] }), _jsx(ContainerHeader, { title: intl.formatMessage(messages.title), subtitle: intl.formatMessage(messages.subtitle) }), _jsxs("div", { className: "grid gap-8 lg:grid-cols-[244px_1fr]", children: [_jsx("div", { className: "lg:sticky lg:top-6 lg:self-start", children: _jsx(Stepper, { current: wizard.step, maxReached: wizard.maxReached, steps: railSteps, onStepClick: wizard.goStep, optionalLabel: intl.formatMessage(messages.stepperOptional), stepAriaLabel: (step, number) => intl.formatMessage(messages.stepperStepLabel, {
|
|
241
|
+
number,
|
|
242
|
+
label: step.label
|
|
243
|
+
}) }) }), _jsx("span", { role: "status", "aria-live": "polite", className: "sr-only", children: intl.formatMessage(messages.stepAnnouncement, {
|
|
244
|
+
number: wizard.step,
|
|
245
|
+
total: railSteps.length,
|
|
246
|
+
label: railSteps[wizard.step - 1]?.label ?? ''
|
|
247
|
+
}) }), _jsxs(WizardStepCard, { children: [wizard.step === 1 ? (_jsxs(_Fragment, { children: [_jsxs(CardHeader, { children: [_jsx(CardTitle, { asChild: true, children: _jsx("h2", { ref: stepTitleRef, tabIndex: -1, className: "focus-visible:outline-none", children: intl.formatMessage(messages.basicsTitle) }) }), _jsx(CardDescription, { children: intl.formatMessage(messages.basicsDescription) })] }), _jsx(CardContent, { children: _jsx(IdentityFields, { data: wizard.data, update: wizard.update, slug: slug }) }), _jsx(CardFooter, { children: _jsx(WizardFooter, { hint: intl.formatMessage(messages.basicsHint), primary: _jsxs(Button, { type: "button", onClick: () => wizard.goStep(2), disabled: !basicsCanContinue, children: [intl.formatMessage(messages.continueToMembers), _jsx(ArrowRight, {})] }) }) })] })) : null, wizard.step === 2 ? (_jsxs(_Fragment, { children: [_jsxs(CardHeader, { children: [_jsx(CardTitle, { asChild: true, children: _jsx("h2", { ref: stepTitleRef, tabIndex: -1, className: "focus-visible:outline-none", children: intl.formatMessage(messages.membersTitle) }) }), _jsx(CardDescription, { children: intl.formatMessage(messages.membersDescription) })] }), _jsx(CardContent, { children: _jsx(MembersStep, { members: wizard.members, addMember: wizard.addMember, removeMember: wizard.removeMember }) }), _jsx(CardFooter, { children: _jsx(WizardFooter, { onBack: () => wizard.goStep(1), backLabel: intl.formatMessage(messages.backLabel), onSkip: () => wizard.goStep(3), skipLabel: intl.formatMessage(messages.skipForNow), primary: _jsxs(Button, { type: "button", onClick: () => wizard.goStep(3), children: [intl.formatMessage(messages.continueToContent), _jsx(ArrowRight, {})] }) }) })] })) : null, wizard.step === 3 ? (_jsxs(_Fragment, { children: [_jsxs(CardHeader, { children: [_jsx(CardTitle, { asChild: true, children: _jsx("h2", { ref: stepTitleRef, tabIndex: -1, className: "focus-visible:outline-none", children: intl.formatMessage(messages.contentTitle) }) }), _jsx(CardDescription, { children: intl.formatMessage(messages.contentDescription) })] }), _jsx(CardContent, { children: _jsx(ContentStep, { contentMode: wizard.contentMode, setContentMode: wizard.setContentMode, collections: wizard.collections, setCollections: wizard.setCollections, pages: wizard.pages, setPages: wizard.setPages }) }), _jsx(CardFooter, { children: _jsx(WizardFooter, { onBack: () => wizard.goStep(2), backLabel: intl.formatMessage(messages.backLabel), onSkip: () => submitTo(true), skipLabel: intl.formatMessage(messages.skipAndCreate), primary: _jsx(Button, { type: "button", onClick: () => submitTo(false), disabled: createBlocked, children: flow.submitting ? (_jsxs(_Fragment, { children: [_jsx(Spinner, {}), intl.formatMessage(messages.creating)] })) : (intl.formatMessage(messages.create)) }) }) })] })) : null] }, wizard.step)] })] })] }));
|
|
248
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Workspace settings, mounted inside the shell at `/workspaces/:id/settings/*`.
|
|
3
|
+
* A tabbed layout — General, Members, Content, and a Danger zone — each its own
|
|
4
|
+
* nested route under the {@link WorkspaceSettingsTabs} underline tab bar,
|
|
5
|
+
* mirroring the user-detail page. The page width is the shared `Container`.
|
|
6
|
+
*
|
|
7
|
+
* Reads the open workspace from context; edits are gated by `workspaces:update`
|
|
8
|
+
* / `workspaces:delete`, so a viewer sees a read-only page and the Danger
|
|
9
|
+
* section (rail entry + route) only exists when the user can act on it.
|
|
10
|
+
*/
|
|
11
|
+
export declare function WorkspaceSettingsPage(): import("react").JSX.Element;
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lib/presentation/pages/WorkspaceSettingsPage/index.tsx"],"names":[],"mappings":"AAuCA;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,gCAmHpC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { Navigate, Route, Routes } from 'react-router-dom';
|
|
3
|
+
import { defineMessages, useIntl } from 'react-intl';
|
|
4
|
+
import { useHasPermission } from '@orthacms/identity-admin';
|
|
5
|
+
import { Badge, Container } from '@orthacms/design-system';
|
|
6
|
+
import { useCurrentWorkspace } from '../../currentWorkspace';
|
|
7
|
+
import { WorkspaceSettingsTabs } from '../../components/WorkspaceSettingsTabs';
|
|
8
|
+
import { useDocumentTitle } from '@orthacms/utils-admin';
|
|
9
|
+
import { WorkspaceSettingsTopBar } from '../../components/WorkspaceSettingsTopBar';
|
|
10
|
+
import { useRedirectNotice } from '../../hooks/useRedirectNotice';
|
|
11
|
+
import { WorkspaceGeneralSettings } from '../../components/WorkspaceGeneralSettings';
|
|
12
|
+
import { WorkspaceMembersSettings } from '../../components/WorkspaceMembersSettings';
|
|
13
|
+
import { WorkspaceContentSettings } from '../../components/WorkspaceContentSettings';
|
|
14
|
+
import { WorkspaceDangerSettings } from '../../components/WorkspaceDangerSettings';
|
|
15
|
+
/** Intl descriptors for the workspace settings page, co-located here. */
|
|
16
|
+
const messages = defineMessages({
|
|
17
|
+
documentTitle: {
|
|
18
|
+
id: 'workspaces.settings.documentTitle',
|
|
19
|
+
defaultMessage: 'Settings · {name}'
|
|
20
|
+
},
|
|
21
|
+
dangerDenied: {
|
|
22
|
+
id: 'workspaces.settings.dangerDenied',
|
|
23
|
+
defaultMessage: 'You don’t have permission to open the Danger zone, so we brought you to General settings.'
|
|
24
|
+
},
|
|
25
|
+
title: {
|
|
26
|
+
id: 'workspaces.settings.title',
|
|
27
|
+
defaultMessage: 'Settings'
|
|
28
|
+
},
|
|
29
|
+
subtitle: {
|
|
30
|
+
id: 'workspaces.settings.subtitle',
|
|
31
|
+
defaultMessage: 'Manage settings for {workspace}.'
|
|
32
|
+
},
|
|
33
|
+
archivedBadge: {
|
|
34
|
+
id: 'workspaces.settings.archivedBadge',
|
|
35
|
+
defaultMessage: 'Archived'
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
/**
|
|
39
|
+
* Workspace settings, mounted inside the shell at `/workspaces/:id/settings/*`.
|
|
40
|
+
* A tabbed layout — General, Members, Content, and a Danger zone — each its own
|
|
41
|
+
* nested route under the {@link WorkspaceSettingsTabs} underline tab bar,
|
|
42
|
+
* mirroring the user-detail page. The page width is the shared `Container`.
|
|
43
|
+
*
|
|
44
|
+
* Reads the open workspace from context; edits are gated by `workspaces:update`
|
|
45
|
+
* / `workspaces:delete`, so a viewer sees a read-only page and the Danger
|
|
46
|
+
* section (rail entry + route) only exists when the user can act on it.
|
|
47
|
+
*/
|
|
48
|
+
export function WorkspaceSettingsPage() {
|
|
49
|
+
const intl = useIntl();
|
|
50
|
+
const workspace = useCurrentWorkspace();
|
|
51
|
+
const canUpdate = useHasPermission('workspaces:update');
|
|
52
|
+
const canDelete = useHasPermission('workspaces:delete');
|
|
53
|
+
const showDanger = canUpdate || canDelete;
|
|
54
|
+
const redirectNotice = useRedirectNotice();
|
|
55
|
+
useDocumentTitle(intl.formatMessage(messages.documentTitle, { name: workspace.name }));
|
|
56
|
+
return (_jsxs(_Fragment, { children: [_jsx(WorkspaceSettingsTopBar, {}), _jsxs(Container, { className: "space-y-6 py-8", children: [_jsx("span", { role: "status", "aria-live": "polite", className: "sr-only", children: redirectNotice === 'danger-denied'
|
|
57
|
+
? intl.formatMessage(messages.dangerDenied)
|
|
58
|
+
: '' }), _jsxs("div", { children: [_jsxs("div", { className: "flex items-center gap-3", children: [_jsx("h1", { className: "text-2xl font-semibold tracking-[-0.01em]", children: intl.formatMessage(messages.title) }), workspace.status === 'Archived' ? (_jsx(Badge, { variant: "secondary", children: intl.formatMessage(messages.archivedBadge) })) : null] }), _jsx("p", { className: "mt-1 text-muted-foreground", children: intl.formatMessage(messages.subtitle, {
|
|
59
|
+
workspace: workspace.name
|
|
60
|
+
}) })] }), _jsxs("div", { className: "flex flex-col gap-6", children: [_jsx(WorkspaceSettingsTabs, { workspaceId: workspace.id, showDanger: showDanger }), _jsx("div", { className: "min-w-0", children: _jsxs(Routes, { children: [_jsx(Route, { index: true, element: _jsx(Navigate, { to: "general", replace: true }) }), _jsx(Route, { path: "general", element: _jsx(WorkspaceGeneralSettings
|
|
61
|
+
// Re-key on the editable fields so an
|
|
62
|
+
// external change (e.g. another admin's edit
|
|
63
|
+
// arriving via a list refetch) re-baselines
|
|
64
|
+
// the form + color state instead of leaving
|
|
65
|
+
// stale values a Save would overwrite.
|
|
66
|
+
, { workspace: workspace, canUpdate: canUpdate }, `${workspace.id}:${workspace.name}:${workspace.description}:${workspace.color}`) }), _jsx(Route, { path: "members", element: _jsx(WorkspaceMembersSettings, { workspace: workspace, canUpdate: canUpdate }) }), _jsx(Route, { path: "content", element: _jsx(WorkspaceContentSettings, { workspace: workspace, canUpdate: canUpdate }) }), _jsx(Route, { path: "danger", element: showDanger ? (_jsx(WorkspaceDangerSettings, { workspace: workspace, canUpdate: canUpdate, canDelete: canDelete })) : (_jsx(Navigate, { to: "../general", replace: true, state: {
|
|
67
|
+
redirectNotice: 'danger-denied'
|
|
68
|
+
} })) }), _jsx(Route, { path: "*", element: _jsx(Navigate, { to: "general", replace: true }) })] }) })] })] })] }));
|
|
69
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Workspaces management page: a searchable, status-filterable grid of
|
|
3
|
+
* workspace cards with a create flow. Rendered at `/workspaces` inside the
|
|
4
|
+
* authenticated shell.
|
|
5
|
+
*/
|
|
6
|
+
export declare function WorkspacesPage(): import("react").JSX.Element;
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lib/presentation/pages/WorkspacesPage/index.tsx"],"names":[],"mappings":"AAuEA;;;;GAIG;AACH,wBAAgB,cAAc,gCAiI7B"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo, useState } from 'react';
|
|
3
|
+
import { useNavigate } from 'react-router-dom';
|
|
4
|
+
import { defineMessages, useIntl } from 'react-intl';
|
|
5
|
+
import { useHasPermission } from '@orthacms/identity-admin';
|
|
6
|
+
import { PageTopBar } from '@orthacms/shell-admin';
|
|
7
|
+
import { Layers, Plus } from 'lucide-react';
|
|
8
|
+
import { Alert, AlertDescription, Button, Container, ContainerHeader } from '@orthacms/design-system';
|
|
9
|
+
import { useDocumentTitle } from '@orthacms/utils-admin';
|
|
10
|
+
import { useWorkspaces } from '../../../application/useWorkspaces';
|
|
11
|
+
import { WorkspacesTable } from '../../components/WorkspacesTable';
|
|
12
|
+
import { WorkspacesTableSkeleton } from '../../components/WorkspacesSkeleton';
|
|
13
|
+
import { WorkspacesEmpty } from '../../components/WorkspacesEmpty';
|
|
14
|
+
import { WorkspaceToolbar, DEFAULT_STATUS } from '../../components/WorkspaceToolbar';
|
|
15
|
+
import { useRedirectNotice } from '../../hooks/useRedirectNotice';
|
|
16
|
+
/** Intl descriptors for {@link WorkspacesPage}, co-located with the component. */
|
|
17
|
+
const messages = defineMessages({
|
|
18
|
+
createDenied: {
|
|
19
|
+
id: 'workspaces.list.createDenied',
|
|
20
|
+
defaultMessage: 'You don’t have permission to create a workspace, so we brought you back to the workspaces list.'
|
|
21
|
+
},
|
|
22
|
+
title: {
|
|
23
|
+
id: 'workspaces.page.title',
|
|
24
|
+
defaultMessage: 'Workspaces'
|
|
25
|
+
},
|
|
26
|
+
subtitle: {
|
|
27
|
+
id: 'workspaces.page.subtitle',
|
|
28
|
+
defaultMessage: 'Each workspace groups its own content, members, and plugins. Switch in to manage one, or spin up a new one.'
|
|
29
|
+
},
|
|
30
|
+
newWorkspace: {
|
|
31
|
+
id: 'workspaces.page.newWorkspace',
|
|
32
|
+
defaultMessage: 'New workspace'
|
|
33
|
+
},
|
|
34
|
+
error: {
|
|
35
|
+
id: 'workspaces.page.error',
|
|
36
|
+
defaultMessage: 'Couldn’t load workspaces. Please try again.'
|
|
37
|
+
},
|
|
38
|
+
retry: {
|
|
39
|
+
id: 'workspaces.page.retry',
|
|
40
|
+
defaultMessage: 'Retry'
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
/** Matches a workspace against the status filter. */
|
|
44
|
+
function matchesStatus(workspace, status) {
|
|
45
|
+
return status === 'All' || workspace.status === status;
|
|
46
|
+
}
|
|
47
|
+
/** Matches a workspace name or description against the search query. */
|
|
48
|
+
function matchesSearch(workspace, query) {
|
|
49
|
+
const needle = query.trim().toLowerCase();
|
|
50
|
+
if (!needle)
|
|
51
|
+
return true;
|
|
52
|
+
return (workspace.name.toLowerCase().includes(needle) ||
|
|
53
|
+
workspace.description.toLowerCase().includes(needle));
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* The Workspaces management page: a searchable, status-filterable grid of
|
|
57
|
+
* workspace cards with a create flow. Rendered at `/workspaces` inside the
|
|
58
|
+
* authenticated shell.
|
|
59
|
+
*/
|
|
60
|
+
export function WorkspacesPage() {
|
|
61
|
+
const intl = useIntl();
|
|
62
|
+
const navigate = useNavigate();
|
|
63
|
+
const canCreate = useHasPermission('workspaces:create');
|
|
64
|
+
const redirectNotice = useRedirectNotice();
|
|
65
|
+
useDocumentTitle(intl.formatMessage(messages.title));
|
|
66
|
+
const { data: workspaces = [], isLoading, isError, refetch } = useWorkspaces();
|
|
67
|
+
const [search, setSearch] = useState('');
|
|
68
|
+
const [status, setStatus] = useState(DEFAULT_STATUS);
|
|
69
|
+
const openCreate = () => navigate('/workspaces/new');
|
|
70
|
+
const filtered = useMemo(() => workspaces.filter((workspace) => matchesStatus(workspace, status) &&
|
|
71
|
+
matchesSearch(workspace, search)), [workspaces, status, search]);
|
|
72
|
+
// Per-status counts for the filter chips — over the full list, not the
|
|
73
|
+
// current view, so each chip shows how many it would reveal.
|
|
74
|
+
const counts = useMemo(() => ({
|
|
75
|
+
All: workspaces.length,
|
|
76
|
+
Active: workspaces.filter((w) => w.status === 'Active').length,
|
|
77
|
+
Archived: workspaces.filter((w) => w.status === 'Archived').length
|
|
78
|
+
}), [workspaces]);
|
|
79
|
+
// Resets back to the widest view. Clearing lands on `All` (not the default
|
|
80
|
+
// `Active`) so it reveals every workspace — including archived ones the
|
|
81
|
+
// default view hides — matching the empty-state's "see them all" copy. This
|
|
82
|
+
// also unsticks the all-archived case, where resetting to `Active` would
|
|
83
|
+
// leave the grid empty and the clear button a no-op.
|
|
84
|
+
const clearFilters = () => {
|
|
85
|
+
setSearch('');
|
|
86
|
+
setStatus('All');
|
|
87
|
+
};
|
|
88
|
+
return (_jsxs(_Fragment, { children: [_jsx(PageTopBar, { icon: Layers, iconClassName: "bg-violet-soft text-violet-soft-foreground", crumbs: [
|
|
89
|
+
{
|
|
90
|
+
key: 'workspaces',
|
|
91
|
+
label: intl.formatMessage(messages.title)
|
|
92
|
+
}
|
|
93
|
+
] }), _jsxs(Container, { children: [_jsx("span", { role: "status", "aria-live": "polite", className: "sr-only", children: redirectNotice === 'create-denied'
|
|
94
|
+
? intl.formatMessage(messages.createDenied)
|
|
95
|
+
: '' }), _jsx(ContainerHeader, { title: intl.formatMessage(messages.title), subtitle: intl.formatMessage(messages.subtitle), actions: canCreate ? (_jsxs(Button, { onClick: openCreate, children: [_jsx(Plus, {}), intl.formatMessage(messages.newWorkspace)] })) : undefined }), _jsx(WorkspaceToolbar, { search: search, onSearchChange: setSearch, status: status, onStatusChange: setStatus, counts: counts, shown: filtered.length, total: workspaces.length }), isLoading ? (_jsx(WorkspacesTableSkeleton, {})) : isError ? (
|
|
96
|
+
// A failed load gets its own state — never the empty-list
|
|
97
|
+
// "create your first workspace" copy, which would mislead the
|
|
98
|
+
// operator into thinking the account genuinely has none.
|
|
99
|
+
_jsx(Alert, { variant: "destructive", role: "alert", className: "mt-4", children: _jsxs(AlertDescription, { className: "flex flex-wrap items-center justify-between gap-3", children: [_jsx("span", { children: intl.formatMessage(messages.error) }), _jsx(Button, { variant: "outline", size: "sm", className: "shadow-none", onClick: () => refetch(), children: intl.formatMessage(messages.retry) })] }) })) : filtered.length === 0 ? (_jsx(WorkspacesEmpty
|
|
100
|
+
// "No match / clear filters" whenever workspaces exist but
|
|
101
|
+
// the current view hides them all (e.g. a search miss, or
|
|
102
|
+
// the default Active filter with only archived workspaces);
|
|
103
|
+
// the "no workspaces yet / create first" variant is reserved
|
|
104
|
+
// for a genuinely empty list.
|
|
105
|
+
, {
|
|
106
|
+
// "No match / clear filters" whenever workspaces exist but
|
|
107
|
+
// the current view hides them all (e.g. a search miss, or
|
|
108
|
+
// the default Active filter with only archived workspaces);
|
|
109
|
+
// the "no workspaces yet / create first" variant is reserved
|
|
110
|
+
// for a genuinely empty list.
|
|
111
|
+
filtered: workspaces.length > 0, canCreate: canCreate, onClear: clearFilters, onCreate: openCreate })) : (_jsx(WorkspacesTable, { workspaces: filtered }))] })] }));
|
|
112
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import type { ComponentType, ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* A navigation entry in the workspace sidebar's "Workspace" section, rendered
|
|
4
|
+
* as an icon + label row. Unlike the global {@link SidebarItem}, a workspace
|
|
5
|
+
* nav item's `to` is **relative to the current workspace** (e.g. `'media'`,
|
|
6
|
+
* resolved against `/workspaces/:id`) — a contributing plugin never spells out
|
|
7
|
+
* the workspace id. The owning {@link WorkspaceNav} resolves it.
|
|
8
|
+
*/
|
|
9
|
+
export type WorkspaceNavItem = {
|
|
10
|
+
/** react-intl message id for the label. */
|
|
11
|
+
labelId: string;
|
|
12
|
+
/** Fallback label when no translation is available. */
|
|
13
|
+
defaultLabel: string;
|
|
14
|
+
/**
|
|
15
|
+
* Path relative to the workspace base (`/workspaces/:id`), e.g. `'media'`.
|
|
16
|
+
* No leading slash; it is joined onto the active workspace's base path.
|
|
17
|
+
*/
|
|
18
|
+
to: string;
|
|
19
|
+
/** Sort order; lower appears first. */
|
|
20
|
+
order: number;
|
|
21
|
+
/** Leading icon (e.g. a lucide-react icon). */
|
|
22
|
+
icon: ComponentType<{
|
|
23
|
+
className?: string;
|
|
24
|
+
}>;
|
|
25
|
+
/**
|
|
26
|
+
* Optional accent class for the icon (e.g. `text-nav-teal`), applied only
|
|
27
|
+
* while the row is **active** — the rest of the time the icon stays
|
|
28
|
+
* neutral. The `text-nav-*` utilities are tuned for contrast on the dark
|
|
29
|
+
* sidebar. Omit for an always-neutral icon.
|
|
30
|
+
*/
|
|
31
|
+
iconColor?: string;
|
|
32
|
+
/**
|
|
33
|
+
* Optional permission key required to see this entry. When set, the entry
|
|
34
|
+
* is hidden from users whose role doesn't grant it (the UI mirror of the
|
|
35
|
+
* linked route's server-side gate). Omit for an entry visible to every
|
|
36
|
+
* member (the default — the linked page still gates itself).
|
|
37
|
+
*/
|
|
38
|
+
permission?: string;
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* A route mounted **inside** the workspace shell, rendered in the shell's
|
|
42
|
+
* content area alongside the workspace sidebar. Its `path` is relative to the
|
|
43
|
+
* workspace base (`/workspaces/:id`), e.g. `'content/*'`. Pair each route with
|
|
44
|
+
* either a {@link WorkspaceNavItem} (a "Workspace" section entry) or a
|
|
45
|
+
* {@link WorkspaceSectionItem} (a custom section, e.g. the content-type list).
|
|
46
|
+
*/
|
|
47
|
+
export type WorkspaceRoute = {
|
|
48
|
+
/**
|
|
49
|
+
* Path relative to the workspace base, e.g. `'content/*'`. Use a trailing
|
|
50
|
+
* `/*` when the page mounts its own nested routes.
|
|
51
|
+
*/
|
|
52
|
+
path: string;
|
|
53
|
+
/** Element rendered at that path (wrap lazy pages in `<Suspense>`). */
|
|
54
|
+
element: ReactNode;
|
|
55
|
+
/**
|
|
56
|
+
* Sort order used to pick the **default** section — landing on the
|
|
57
|
+
* workspace base (`/workspaces/:id`) redirects to the lowest-order route.
|
|
58
|
+
* Lower wins; omit to sort last. (The Content Library uses the lowest so it
|
|
59
|
+
* is the default landing.)
|
|
60
|
+
*/
|
|
61
|
+
order?: number;
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* A data-driven section in the workspace sidebar (e.g. the "Content" list of
|
|
65
|
+
* the workspace's content types). Unlike the declarative {@link WorkspaceNavItem},
|
|
66
|
+
* a section is an arbitrary component the contributing plugin renders itself —
|
|
67
|
+
* so it can be backed by a query. Rendered above the "Workspace" section.
|
|
68
|
+
*/
|
|
69
|
+
export type WorkspaceSectionItem = {
|
|
70
|
+
/** Stable id (also the React key). */
|
|
71
|
+
id: string;
|
|
72
|
+
/** Sort order; lower appears first. */
|
|
73
|
+
order: number;
|
|
74
|
+
/** The section to render. Receives no props — it reads what it needs. */
|
|
75
|
+
Component: ComponentType;
|
|
76
|
+
};
|
|
77
|
+
/**
|
|
78
|
+
* The "Workspace" section's nav slot — the workspace's utility sections (Media,
|
|
79
|
+
* Insights, Settings), rendered as labeled rows. Any plugin contributes entries
|
|
80
|
+
* via its `slots`; {@link WorkspaceNav} reads it sorted by `order`. (Formerly
|
|
81
|
+
* `WORKSPACE_SIDEBAR_SLOT`.)
|
|
82
|
+
*/
|
|
83
|
+
export declare const WORKSPACE_NAV_SLOT: import("@orthacms/utils-admin").Slot<WorkspaceNavItem>;
|
|
84
|
+
/**
|
|
85
|
+
* The workspace sidebar's custom-section slot — component-rendered regions
|
|
86
|
+
* above the "Workspace" section. A plugin contributes a
|
|
87
|
+
* {@link WorkspaceSectionItem} via its `slots`; {@link WorkspaceNav} renders
|
|
88
|
+
* them sorted by `order`. The Content Library contributes its content-type list
|
|
89
|
+
* here.
|
|
90
|
+
*/
|
|
91
|
+
export declare const WORKSPACE_SECTION_SLOT: import("@orthacms/utils-admin").Slot<WorkspaceSectionItem>;
|
|
92
|
+
/**
|
|
93
|
+
* Workspace route slot — the pages mounted inside the workspace shell. A plugin
|
|
94
|
+
* contributes a {@link WorkspaceRoute} via its `slots`; {@link WorkspaceShell}
|
|
95
|
+
* builds its nested `<Routes>` from them (plus an index redirect to the first
|
|
96
|
+
* route). This is how a feature plugin lives **strictly inside** a workspace: it
|
|
97
|
+
* contributes a route here plus a nav entry or section, and **no** top-level
|
|
98
|
+
* route or sidebar item.
|
|
99
|
+
*/
|
|
100
|
+
export declare const WORKSPACE_ROUTE_SLOT: import("@orthacms/utils-admin").Slot<WorkspaceRoute>;
|
|
101
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lib/presentation/slots/workspaceSlots/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGtD;;;;;;GAMG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC3B,2CAA2C;IAC3C,OAAO,EAAE,MAAM,CAAC;IAChB,uDAAuD;IACvD,YAAY,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,EAAE,EAAE,MAAM,CAAC;IACX,uCAAuC;IACvC,KAAK,EAAE,MAAM,CAAC;IACd,+CAA+C;IAC/C,IAAI,EAAE,aAAa,CAAC;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC5C;;;;;OAKG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;OAKG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,cAAc,GAAG;IACzB;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAC;IACb,uEAAuE;IACvE,OAAO,EAAE,SAAS,CAAC;IACnB;;;;;OAKG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,oBAAoB,GAAG;IAC/B,sCAAsC;IACtC,EAAE,EAAE,MAAM,CAAC;IACX,uCAAuC;IACvC,KAAK,EAAE,MAAM,CAAC;IACd,yEAAyE;IACzE,SAAS,EAAE,aAAa,CAAC;CAC5B,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,wDAAgD,CAAC;AAEhF;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB,4DACsB,CAAC;AAE1D;;;;;;;GAOG;AACH,eAAO,MAAM,oBAAoB,sDACiB,CAAC"}
|