@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,127 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useRef, useState } from 'react';
|
|
3
|
+
import { defineMessages, useIntl } from 'react-intl';
|
|
4
|
+
import { Card, CardContent, CardDescription, CardHeader, CardTitle, ConfirmDialog, Separator, toast } from '@orthacms/design-system';
|
|
5
|
+
import { useAddWorkspaceMember } from '../../../application/useAddWorkspaceMember';
|
|
6
|
+
import { useRemoveWorkspaceMember } from '../../../application/useRemoveWorkspaceMember';
|
|
7
|
+
import { MemberDirectorySearch } from './MemberDirectorySearch';
|
|
8
|
+
import { MemberListRow } from './MemberListRow';
|
|
9
|
+
const messages = defineMessages({
|
|
10
|
+
title: {
|
|
11
|
+
id: 'workspaces.settings.members.title',
|
|
12
|
+
defaultMessage: 'Members'
|
|
13
|
+
},
|
|
14
|
+
description: {
|
|
15
|
+
id: 'workspaces.settings.members.description',
|
|
16
|
+
defaultMessage: 'People with access to this workspace. A member’s permissions come from their global role, not from the workspace.'
|
|
17
|
+
},
|
|
18
|
+
rosterLabel: {
|
|
19
|
+
id: 'workspaces.settings.members.rosterLabel',
|
|
20
|
+
defaultMessage: '{count, plural, one {# member} other {# members}}'
|
|
21
|
+
},
|
|
22
|
+
readOnly: {
|
|
23
|
+
id: 'workspaces.settings.members.readOnly',
|
|
24
|
+
defaultMessage: 'You have read-only access and can’t change members.'
|
|
25
|
+
},
|
|
26
|
+
added: {
|
|
27
|
+
id: 'workspaces.settings.members.added',
|
|
28
|
+
defaultMessage: '{name} was added to the workspace.'
|
|
29
|
+
},
|
|
30
|
+
addError: {
|
|
31
|
+
id: 'workspaces.settings.members.addError',
|
|
32
|
+
defaultMessage: 'Couldn’t add that person. Please try again.'
|
|
33
|
+
},
|
|
34
|
+
removed: {
|
|
35
|
+
id: 'workspaces.settings.members.removed',
|
|
36
|
+
defaultMessage: '{name} was removed from the workspace.'
|
|
37
|
+
},
|
|
38
|
+
removeError: {
|
|
39
|
+
id: 'workspaces.settings.members.removeError',
|
|
40
|
+
defaultMessage: 'Couldn’t remove that member. Please try again.'
|
|
41
|
+
},
|
|
42
|
+
confirmTitle: {
|
|
43
|
+
id: 'workspaces.settings.members.confirmTitle',
|
|
44
|
+
defaultMessage: 'Remove member?'
|
|
45
|
+
},
|
|
46
|
+
confirmBody: {
|
|
47
|
+
id: 'workspaces.settings.members.confirmBody',
|
|
48
|
+
defaultMessage: '{name} will lose access to this workspace. They keep their account and global role, and you can add them back later.'
|
|
49
|
+
},
|
|
50
|
+
confirmAction: {
|
|
51
|
+
id: 'workspaces.settings.members.confirmAction',
|
|
52
|
+
defaultMessage: 'Remove'
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
/**
|
|
56
|
+
* The Members settings tab: assign existing directory users and remove members
|
|
57
|
+
* with a confirmation. Access is purely permission-based — every control is
|
|
58
|
+
* gated on `workspaces:update`, and no member is special; without the permission
|
|
59
|
+
* the roster is read-only.
|
|
60
|
+
*/
|
|
61
|
+
export function WorkspaceMembersSettings({ workspace, canUpdate }) {
|
|
62
|
+
const intl = useIntl();
|
|
63
|
+
const addMember = useAddWorkspaceMember();
|
|
64
|
+
const removeMember = useRemoveWorkspaceMember();
|
|
65
|
+
const [pendingRemoval, setPendingRemoval] = useState(null);
|
|
66
|
+
const rosterRef = useRef(null);
|
|
67
|
+
const rosterLabelRef = useRef(null);
|
|
68
|
+
// Index whose Remove button focus should land on once the roster re-renders.
|
|
69
|
+
const focusAfterRemoval = useRef(null);
|
|
70
|
+
// Radix restores focus to the dialog's trigger on close — but the mutation
|
|
71
|
+
// has just unmounted that trigger along with its row, so focus fell to
|
|
72
|
+
// <body> and a keyboard user was dropped at the top of the document. Land on
|
|
73
|
+
// the row that took its place instead, or the roster heading when the list
|
|
74
|
+
// has emptied.
|
|
75
|
+
useEffect(() => {
|
|
76
|
+
const index = focusAfterRemoval.current;
|
|
77
|
+
if (index === null)
|
|
78
|
+
return;
|
|
79
|
+
focusAfterRemoval.current = null;
|
|
80
|
+
const buttons = rosterRef.current?.querySelectorAll('[data-remove-member]');
|
|
81
|
+
const target = buttons?.length
|
|
82
|
+
? buttons[Math.min(index, buttons.length - 1)]
|
|
83
|
+
: rosterLabelRef.current;
|
|
84
|
+
target?.focus();
|
|
85
|
+
}, [workspace.members]);
|
|
86
|
+
const excludeIds = new Set(workspace.members.map((member) => member.id));
|
|
87
|
+
const onSelect = async (user) => {
|
|
88
|
+
try {
|
|
89
|
+
await addMember.mutateAsync({
|
|
90
|
+
workspaceId: workspace.id,
|
|
91
|
+
userId: user.id
|
|
92
|
+
});
|
|
93
|
+
toast.success(intl.formatMessage(messages.added, { name: user.name }));
|
|
94
|
+
}
|
|
95
|
+
catch {
|
|
96
|
+
toast.error(intl.formatMessage(messages.addError));
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
const confirmRemoval = async () => {
|
|
100
|
+
if (!pendingRemoval)
|
|
101
|
+
return;
|
|
102
|
+
const member = pendingRemoval;
|
|
103
|
+
const removedIndex = workspace.members.findIndex((candidate) => candidate.id === member.id);
|
|
104
|
+
try {
|
|
105
|
+
await removeMember.mutateAsync({
|
|
106
|
+
workspaceId: workspace.id,
|
|
107
|
+
userId: member.id
|
|
108
|
+
});
|
|
109
|
+
focusAfterRemoval.current = Math.max(0, removedIndex);
|
|
110
|
+
toast.success(intl.formatMessage(messages.removed, { name: member.name }));
|
|
111
|
+
}
|
|
112
|
+
catch {
|
|
113
|
+
toast.error(intl.formatMessage(messages.removeError));
|
|
114
|
+
}
|
|
115
|
+
finally {
|
|
116
|
+
setPendingRemoval(null);
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
return (_jsxs(Card, { children: [_jsxs(CardHeader, { children: [_jsx(CardTitle, { asChild: true, children: _jsx("h2", { children: intl.formatMessage(messages.title) }) }), _jsx(CardDescription, { children: intl.formatMessage(messages.description) })] }), _jsxs(CardContent, { className: "flex flex-col gap-4", children: [canUpdate ? (_jsx(MemberDirectorySearch, { excludeIds: excludeIds, onSelect: onSelect, busy: addMember.isPending })) : (_jsx("p", { className: "text-sm text-muted-foreground", children: intl.formatMessage(messages.readOnly) })), _jsxs("div", { className: "flex flex-col gap-1", children: [_jsx("span", { ref: rosterLabelRef, tabIndex: -1, className: "text-sm font-medium focus-visible:outline-none", children: intl.formatMessage(messages.rosterLabel, {
|
|
120
|
+
count: workspace.members.length
|
|
121
|
+
}) }), _jsx("ul", { ref: rosterRef, className: "rounded-xl border", children: workspace.members.map((member, index) => (_jsxs("li", { children: [index > 0 ? _jsx(Separator, {}) : null, _jsx(MemberListRow, { member: member, canRemove: canUpdate, onRemove: () => setPendingRemoval(member) })] }, member.id))) })] })] }), _jsx(ConfirmDialog, { open: pendingRemoval !== null, onOpenChange: (open) => {
|
|
122
|
+
if (!open)
|
|
123
|
+
setPendingRemoval(null);
|
|
124
|
+
}, title: intl.formatMessage(messages.confirmTitle), description: intl.formatMessage(messages.confirmBody, {
|
|
125
|
+
name: pendingRemoval?.name ?? ''
|
|
126
|
+
}), confirmLabel: intl.formatMessage(messages.confirmAction), confirmVariant: "destructive", busy: removeMember.isPending, onConfirm: confirmRemoval })] }));
|
|
127
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { WorkspaceNavItem } from '../../../slots/workspaceSlots';
|
|
2
|
+
type WorkspaceNavButtonProps = {
|
|
3
|
+
/** The workspace nav entry to render. */
|
|
4
|
+
item: WorkspaceNavItem;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* One row in the workspace sidebar's "Workspace" section: an icon + label link.
|
|
8
|
+
* The item's `to` is relative to the workspace, so this resolves it against the
|
|
9
|
+
* active `:id`, derives active state from the current route, and hides itself
|
|
10
|
+
* when the item is permission-gated and the user lacks the permission.
|
|
11
|
+
*/
|
|
12
|
+
export declare function WorkspaceNavButton({ item }: WorkspaceNavButtonProps): import("react").JSX.Element | null;
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/presentation/components/WorkspaceNav/WorkspaceNavButton/index.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEtE,KAAK,uBAAuB,GAAG;IAC3B,yCAAyC;IACzC,IAAI,EAAE,gBAAgB,CAAC;CAC1B,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,IAAI,EAAE,EAAE,uBAAuB,sCA6BnE"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Link, useMatch, useParams } from 'react-router-dom';
|
|
3
|
+
import { useIntl } from 'react-intl';
|
|
4
|
+
import { useHasPermission } from '@orthacms/identity-admin';
|
|
5
|
+
import { SidebarMenuButton, SidebarMenuItem } from '@orthacms/design-system';
|
|
6
|
+
/**
|
|
7
|
+
* One row in the workspace sidebar's "Workspace" section: an icon + label link.
|
|
8
|
+
* The item's `to` is relative to the workspace, so this resolves it against the
|
|
9
|
+
* active `:id`, derives active state from the current route, and hides itself
|
|
10
|
+
* when the item is permission-gated and the user lacks the permission.
|
|
11
|
+
*/
|
|
12
|
+
export function WorkspaceNavButton({ item }) {
|
|
13
|
+
const intl = useIntl();
|
|
14
|
+
const { id } = useParams();
|
|
15
|
+
const to = `/workspaces/${id}/${item.to}`;
|
|
16
|
+
const match = useMatch(`${to}/*`);
|
|
17
|
+
const isActive = Boolean(match);
|
|
18
|
+
const Icon = item.icon;
|
|
19
|
+
const label = intl.formatMessage({
|
|
20
|
+
id: item.labelId,
|
|
21
|
+
defaultMessage: item.defaultLabel
|
|
22
|
+
});
|
|
23
|
+
// Always call the hook (an empty key is never granted) so hook order stays
|
|
24
|
+
// stable; an entry with no `permission` is visible to every member.
|
|
25
|
+
const hasRequired = useHasPermission(item.permission ?? '');
|
|
26
|
+
if (item.permission && !hasRequired) {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
return (_jsx(SidebarMenuItem, { children: _jsx(SidebarMenuButton, { asChild: true, isActive: isActive, tooltip: label, children: _jsxs(Link, { to: to, "aria-current": isActive ? 'page' : undefined, children: [_jsx(Icon, { className: isActive ? item.iconColor : undefined }), _jsx("span", { children: label })] }) }) }));
|
|
30
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Workspace } from '../../../../domain/types/workspace';
|
|
2
|
+
type WorkspaceSwitcherProps = {
|
|
3
|
+
/** The workspace currently open. */
|
|
4
|
+
current: Workspace;
|
|
5
|
+
/** Every workspace the switcher can jump to. */
|
|
6
|
+
workspaces: Workspace[];
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* The workspace sidebar's header control: a full-width row showing the current
|
|
10
|
+
* workspace (avatar + name + "Workspace" label) that opens a popover listing
|
|
11
|
+
* every workspace to jump to, plus a "New workspace" action. Switching
|
|
12
|
+
* navigates to the target's base, which redirects to its first section.
|
|
13
|
+
*/
|
|
14
|
+
export declare function WorkspaceSwitcher({ current, workspaces }: WorkspaceSwitcherProps): import("react").JSX.Element;
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/presentation/components/WorkspaceNav/WorkspaceSwitcher/index.tsx"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oCAAoC,CAAC;AA+BpE,KAAK,sBAAsB,GAAG;IAC1B,oCAAoC;IACpC,OAAO,EAAE,SAAS,CAAC;IACnB,gDAAgD;IAChD,UAAU,EAAE,SAAS,EAAE,CAAC;CAC3B,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,EAC9B,OAAO,EACP,UAAU,EACb,EAAE,sBAAsB,+BA2KxB"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useId, useState } from 'react';
|
|
3
|
+
import { useNavigate } from 'react-router-dom';
|
|
4
|
+
import { defineMessages, useIntl } from 'react-intl';
|
|
5
|
+
import { Check, ChevronsUpDown, Plus } from 'lucide-react';
|
|
6
|
+
import { useHasPermission } from '@orthacms/identity-admin';
|
|
7
|
+
import { Popover, PopoverContent, PopoverTrigger, SidebarMenu, SidebarMenuButton, SidebarMenuItem, cn } from '@orthacms/design-system';
|
|
8
|
+
import { initialsOf } from '@orthacms/utils-admin';
|
|
9
|
+
import { WorkspaceAvatar } from '../../WorkspaceAvatar';
|
|
10
|
+
import { WORKSPACES_CREATE } from '../../../../domain/permissions';
|
|
11
|
+
/** Intl descriptors for the sidebar workspace switcher, co-located here. */
|
|
12
|
+
const messages = defineMessages({
|
|
13
|
+
trigger: {
|
|
14
|
+
id: 'workspaces.switcher.trigger',
|
|
15
|
+
defaultMessage: 'Switch workspace, current: {name}'
|
|
16
|
+
},
|
|
17
|
+
role: {
|
|
18
|
+
id: 'workspaces.switcher.role',
|
|
19
|
+
defaultMessage: 'Workspace'
|
|
20
|
+
},
|
|
21
|
+
currentWorkspace: {
|
|
22
|
+
id: 'workspaces.switcher.currentWorkspace',
|
|
23
|
+
defaultMessage: 'Current workspace'
|
|
24
|
+
},
|
|
25
|
+
heading: {
|
|
26
|
+
id: 'workspaces.switcher.heading',
|
|
27
|
+
defaultMessage: 'Switch workspace'
|
|
28
|
+
},
|
|
29
|
+
sub: {
|
|
30
|
+
id: 'workspaces.switcher.sub',
|
|
31
|
+
defaultMessage: '{count, plural, one {# member} other {# members}} · {status}'
|
|
32
|
+
},
|
|
33
|
+
create: {
|
|
34
|
+
id: 'workspaces.switcher.create',
|
|
35
|
+
defaultMessage: 'New workspace'
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
/**
|
|
39
|
+
* The workspace sidebar's header control: a full-width row showing the current
|
|
40
|
+
* workspace (avatar + name + "Workspace" label) that opens a popover listing
|
|
41
|
+
* every workspace to jump to, plus a "New workspace" action. Switching
|
|
42
|
+
* navigates to the target's base, which redirects to its first section.
|
|
43
|
+
*/
|
|
44
|
+
export function WorkspaceSwitcher({ current, workspaces }) {
|
|
45
|
+
const intl = useIntl();
|
|
46
|
+
const navigate = useNavigate();
|
|
47
|
+
const canCreate = useHasPermission(WORKSPACES_CREATE);
|
|
48
|
+
const [open, setOpen] = useState(false);
|
|
49
|
+
const headingId = useId();
|
|
50
|
+
const go = (path) => {
|
|
51
|
+
setOpen(false);
|
|
52
|
+
navigate(path);
|
|
53
|
+
};
|
|
54
|
+
return (_jsx(SidebarMenu, { children: _jsx(SidebarMenuItem, { children: _jsxs(Popover, { open: open, onOpenChange: setOpen, children: [_jsx(PopoverTrigger, { asChild: true, children: _jsxs(SidebarMenuButton, { size: "lg", "aria-label": intl.formatMessage(messages.trigger, {
|
|
55
|
+
name: current.name
|
|
56
|
+
}), children: [_jsx(WorkspaceAvatar, { initials: initialsOf(current.name), color: current.color, className: "size-8 rounded-lg text-xs" }), _jsxs("span", { className: "flex min-w-0 flex-1 flex-col text-left", children: [_jsx("span", { className: "truncate text-sm font-semibold", children: current.name }), _jsx("span", { className: "truncate text-xs text-sidebar-foreground/70", children: intl.formatMessage(messages.role) })] }), _jsx(ChevronsUpDown, { className: "ml-auto", "aria-hidden": true })] }) }), _jsxs(PopoverContent, { align: "start", "aria-labelledby": headingId,
|
|
57
|
+
// `w-[--radix-popover-trigger-width]` is the Tailwind
|
|
58
|
+
// **v3** spelling: v4 no longer unwraps a bare `--var`
|
|
59
|
+
// in brackets, so it emitted the invalid declaration
|
|
60
|
+
// `width: --radix-popover-trigger-width` — which the
|
|
61
|
+
// browser drops, while tailwind-merge had already
|
|
62
|
+
// removed `PopoverContent`'s default `w-72`. The
|
|
63
|
+
// popover therefore had no width rule at all and grew
|
|
64
|
+
// to whatever the longest workspace name needed. v4
|
|
65
|
+
// wants the `var()` spelled out (every other call site
|
|
66
|
+
// in the repo already does).
|
|
67
|
+
className: "w-[var(--radix-popover-trigger-width)] min-w-64 p-2", children: [_jsx("p", { id: headingId, className: "px-2 py-1.5 text-[11px] font-semibold uppercase tracking-[0.04em] text-muted-foreground", children: intl.formatMessage(messages.heading) }), _jsx("div", { className: "max-h-72 overflow-y-auto", children: workspaces.map((workspace) => {
|
|
68
|
+
const isCurrent = workspace.id === current.id;
|
|
69
|
+
return (_jsxs("button", { type: "button", "aria-current": isCurrent ? 'true' : undefined, onClick: () => go(`/workspaces/${workspace.id}`),
|
|
70
|
+
// `ring-inset`: the row now sits in a
|
|
71
|
+
// clipping scroll container, and an
|
|
72
|
+
// outset focus ring on the first or
|
|
73
|
+
// last row would be drawn outside it
|
|
74
|
+
// and never seen.
|
|
75
|
+
className: cn('flex w-full items-center gap-2.5 rounded-md px-2 py-1.5 text-left transition-colors hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring', isCurrent && 'bg-accent'), children: [_jsx(WorkspaceAvatar, { initials: initialsOf(workspace.name), color: workspace.color, className: "size-7 shrink-0 rounded-md text-[11px]" }), _jsxs("span", { className: "min-w-0 flex-1", children: [_jsx("span", { className: "block truncate text-[13.5px] font-medium", children: workspace.name }), _jsx("span", { className: "block truncate text-xs text-muted-foreground", children: intl.formatMessage(messages.sub, {
|
|
76
|
+
count: workspace.members
|
|
77
|
+
.length,
|
|
78
|
+
status: workspace.status
|
|
79
|
+
}) })] }), isCurrent ? (_jsxs(_Fragment, { children: [_jsx(Check, { "aria-hidden": true, className: "size-4 shrink-0 text-muted-foreground" }), _jsx("span", { className: "sr-only", children: intl.formatMessage(messages.currentWorkspace) })] })) : null] }, workspace.id));
|
|
80
|
+
}) }), canCreate ? (_jsxs(_Fragment, { children: [_jsx("div", { className: "my-1 h-px bg-border" }), _jsxs("button", { type: "button", onClick: () => go('/workspaces/new'), className: "flex w-full items-center gap-2.5 rounded-md px-2 py-1.5 text-left transition-colors hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", children: [_jsx("span", { "aria-hidden": true, className: "flex size-7 shrink-0 items-center justify-center rounded-md bg-secondary text-secondary-foreground", children: _jsx(Plus, { className: "size-4" }) }), _jsx("span", { className: "text-[13.5px] font-medium", children: intl.formatMessage(messages.create) })] })] })) : null] })] }) }) }));
|
|
81
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Workspace } from '../../../domain/types/workspace';
|
|
2
|
+
/**
|
|
3
|
+
* The per-workspace sidebar content, injected into the app sidebar's contextual
|
|
4
|
+
* region by {@link WorkspaceShell} while a workspace is open. It replaces the
|
|
5
|
+
* global nav with: a back link to the top-level app, the workspace switcher, a
|
|
6
|
+
* search trigger, any custom sections (the Content Library's content-type list,
|
|
7
|
+
* from {@link WORKSPACE_SECTION_SLOT}), and the "Workspace" section (Media,
|
|
8
|
+
* Insights, Settings, from {@link WORKSPACE_NAV_SLOT}). The persistent account
|
|
9
|
+
* footer stays below, owned by the shell.
|
|
10
|
+
*/
|
|
11
|
+
export declare function WorkspaceNav({ workspace }: {
|
|
12
|
+
workspace: Workspace;
|
|
13
|
+
}): import("react").JSX.Element;
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lib/presentation/components/WorkspaceNav/index.tsx"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAkBjE;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,EAAE,SAAS,EAAE,EAAE;IAAE,SAAS,EAAE,SAAS,CAAA;CAAE,+BAyEnE"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { Link } from 'react-router-dom';
|
|
3
|
+
import { defineMessages, useIntl } from 'react-intl';
|
|
4
|
+
import { ArrowLeft } from 'lucide-react';
|
|
5
|
+
import { AuthStatus, useAuth } from '@orthacms/identity-admin';
|
|
6
|
+
import { SidebarContent, SidebarGroup, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarMenu, SidebarTrigger } from '@orthacms/design-system';
|
|
7
|
+
import { byOrder } from '@orthacms/utils-admin';
|
|
8
|
+
import { useWorkspaces } from '../../../application/useWorkspaces';
|
|
9
|
+
import { WORKSPACE_NAV_SLOT, WORKSPACE_SECTION_SLOT } from '../../slots/workspaceSlots';
|
|
10
|
+
import { WorkspaceNavButton } from './WorkspaceNavButton';
|
|
11
|
+
import { WorkspaceSwitcher } from './WorkspaceSwitcher';
|
|
12
|
+
/** Intl descriptors for the workspace sidebar nav, co-located here. */
|
|
13
|
+
const messages = defineMessages({
|
|
14
|
+
hideNav: {
|
|
15
|
+
id: 'workspaces.nav.hide',
|
|
16
|
+
defaultMessage: 'Hide navigation'
|
|
17
|
+
},
|
|
18
|
+
back: {
|
|
19
|
+
id: 'workspaces.nav.back',
|
|
20
|
+
defaultMessage: 'Home'
|
|
21
|
+
},
|
|
22
|
+
workspaceGroup: {
|
|
23
|
+
id: 'workspaces.nav.groupLabel',
|
|
24
|
+
defaultMessage: 'Tools'
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
/**
|
|
28
|
+
* The per-workspace sidebar content, injected into the app sidebar's contextual
|
|
29
|
+
* region by {@link WorkspaceShell} while a workspace is open. It replaces the
|
|
30
|
+
* global nav with: a back link to the top-level app, the workspace switcher, a
|
|
31
|
+
* search trigger, any custom sections (the Content Library's content-type list,
|
|
32
|
+
* from {@link WORKSPACE_SECTION_SLOT}), and the "Workspace" section (Media,
|
|
33
|
+
* Insights, Settings, from {@link WORKSPACE_NAV_SLOT}). The persistent account
|
|
34
|
+
* footer stays below, owned by the shell.
|
|
35
|
+
*/
|
|
36
|
+
export function WorkspaceNav({ workspace }) {
|
|
37
|
+
const intl = useIntl();
|
|
38
|
+
const { data: workspaces = [] } = useWorkspaces();
|
|
39
|
+
const sections = byOrder(WORKSPACE_SECTION_SLOT.getItems());
|
|
40
|
+
const navItems = byOrder(WORKSPACE_NAV_SLOT.getItems());
|
|
41
|
+
// Mirror the exact visibility rule `WorkspaceNavButton` applies per row: an
|
|
42
|
+
// item with no `permission` is always visible, one with a `permission` only
|
|
43
|
+
// when the signed-in user holds it. Reading the permission set once lets the
|
|
44
|
+
// group decide whether to render at all, so the "Tools" label never sits
|
|
45
|
+
// over an empty body when every entry is gated out.
|
|
46
|
+
const auth = useAuth();
|
|
47
|
+
const permissions = auth.status === AuthStatus.Authenticated ? auth.user.permissions : [];
|
|
48
|
+
const isVisible = (item) => !item.permission || permissions.includes(item.permission);
|
|
49
|
+
const visibleNavItems = navItems.filter(isVisible);
|
|
50
|
+
return (_jsxs(_Fragment, { children: [_jsxs(SidebarHeader, { className: "gap-2 px-2 pt-2", children: [_jsxs("div", { className: "flex items-center justify-between gap-1", children: [_jsxs(Link, { to: "/", className: "flex items-center gap-2 rounded-md px-2 py-2 text-sm font-medium text-sidebar-foreground/70 transition-colors hover:bg-sidebar-accent hover:text-sidebar-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-sidebar-ring", children: [_jsx(ArrowLeft, { className: "size-4", "aria-hidden": true }), intl.formatMessage(messages.back)] }), _jsx(SidebarTrigger, { label: intl.formatMessage(messages.hideNav), className: "text-sidebar-foreground/70" })] }), _jsx(WorkspaceSwitcher, { current: workspace, workspaces: workspaces })] }), _jsxs(SidebarContent, { children: [sections.map(({ id, Component }) => (_jsx(Component, {}, id))), visibleNavItems.length > 0 ? (_jsxs(SidebarGroup, { children: [_jsx(SidebarGroupLabel, { children: intl.formatMessage(messages.workspaceGroup) }), _jsx(SidebarGroupContent, { children: _jsx("nav", { "aria-label": intl.formatMessage(messages.workspaceGroup), children: _jsx(SidebarMenu, { children: visibleNavItems.map((item) => (_jsx(WorkspaceNavButton, { item: item }, item.to))) }) }) })] })) : null] })] }));
|
|
51
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The settings page's horizontal tab navigation — underline tabs under the
|
|
3
|
+
* page header, mirroring the user-detail tabs. Absolute links
|
|
4
|
+
* (`/workspaces/:id/settings/...`) so active state is unambiguous. The
|
|
5
|
+
* Danger-zone entry is included only when the user can act on it (its route
|
|
6
|
+
* redirects away otherwise), so a read-only viewer never sees a dead link.
|
|
7
|
+
*/
|
|
8
|
+
export declare function WorkspaceSettingsTabs({ workspaceId, showDanger }: {
|
|
9
|
+
/** The open workspace id — the base for every link. */
|
|
10
|
+
workspaceId: string;
|
|
11
|
+
/** Whether to show the Danger-zone entry (update or delete permission). */
|
|
12
|
+
showDanger: boolean;
|
|
13
|
+
}): import("react").JSX.Element;
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lib/presentation/components/WorkspaceSettingsTabs/index.tsx"],"names":[],"mappings":"AA+CA;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,EAClC,WAAW,EACX,UAAU,EACb,EAAE;IACC,uDAAuD;IACvD,WAAW,EAAE,MAAM,CAAC;IACpB,2EAA2E;IAC3E,UAAU,EAAE,OAAO,CAAC;CACvB,+BA2CA"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { NavLink } from 'react-router-dom';
|
|
3
|
+
import { defineMessages, useIntl } from 'react-intl';
|
|
4
|
+
import { FileStack, SlidersHorizontal, TriangleAlert, Users } from 'lucide-react';
|
|
5
|
+
import { TabNav, TabNavLink } from '@orthacms/design-system';
|
|
6
|
+
/** Intl descriptors for {@link WorkspaceSettingsTabs}, co-located here. */
|
|
7
|
+
const messages = defineMessages({
|
|
8
|
+
nav: {
|
|
9
|
+
id: 'workspaces.settings.rail.nav',
|
|
10
|
+
defaultMessage: 'Workspace settings sections'
|
|
11
|
+
},
|
|
12
|
+
general: {
|
|
13
|
+
id: 'workspaces.settings.rail.general',
|
|
14
|
+
defaultMessage: 'General'
|
|
15
|
+
},
|
|
16
|
+
members: {
|
|
17
|
+
id: 'workspaces.settings.rail.members',
|
|
18
|
+
defaultMessage: 'Members'
|
|
19
|
+
},
|
|
20
|
+
content: {
|
|
21
|
+
id: 'workspaces.settings.rail.content',
|
|
22
|
+
defaultMessage: 'Content'
|
|
23
|
+
},
|
|
24
|
+
danger: {
|
|
25
|
+
id: 'workspaces.settings.rail.danger',
|
|
26
|
+
defaultMessage: 'Danger zone'
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
/**
|
|
30
|
+
* The settings page's horizontal tab navigation — underline tabs under the
|
|
31
|
+
* page header, mirroring the user-detail tabs. Absolute links
|
|
32
|
+
* (`/workspaces/:id/settings/...`) so active state is unambiguous. The
|
|
33
|
+
* Danger-zone entry is included only when the user can act on it (its route
|
|
34
|
+
* redirects away otherwise), so a read-only viewer never sees a dead link.
|
|
35
|
+
*/
|
|
36
|
+
export function WorkspaceSettingsTabs({ workspaceId, showDanger }) {
|
|
37
|
+
const intl = useIntl();
|
|
38
|
+
const base = `/workspaces/${workspaceId}/settings`;
|
|
39
|
+
const entries = [
|
|
40
|
+
{
|
|
41
|
+
to: `${base}/general`,
|
|
42
|
+
icon: SlidersHorizontal,
|
|
43
|
+
label: intl.formatMessage(messages.general)
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
to: `${base}/members`,
|
|
47
|
+
icon: Users,
|
|
48
|
+
label: intl.formatMessage(messages.members)
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
to: `${base}/content`,
|
|
52
|
+
icon: FileStack,
|
|
53
|
+
label: intl.formatMessage(messages.content)
|
|
54
|
+
},
|
|
55
|
+
...(showDanger
|
|
56
|
+
? [
|
|
57
|
+
{
|
|
58
|
+
to: `${base}/danger`,
|
|
59
|
+
icon: TriangleAlert,
|
|
60
|
+
label: intl.formatMessage(messages.danger)
|
|
61
|
+
}
|
|
62
|
+
]
|
|
63
|
+
: [])
|
|
64
|
+
];
|
|
65
|
+
return (_jsx(TabNav, { "aria-label": intl.formatMessage(messages.nav), children: entries.map(({ to, icon: Icon, label }) => (_jsx(TabNavLink, { asChild: true, children: _jsxs(NavLink, { to: to, children: [_jsx(Icon, { "aria-hidden": true, className: "size-4 shrink-0" }), label] }) }, to))) }));
|
|
66
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The page-context bar over the workspace settings page: the same `Settings`
|
|
3
|
+
* icon the workspace sidebar nav uses, plus a "Settings › {section}"
|
|
4
|
+
* breadcrumb derived from the active nested route (the tab bar below owns
|
|
5
|
+
* navigation, so the crumbs are plain text).
|
|
6
|
+
*/
|
|
7
|
+
export declare function WorkspaceSettingsTopBar(): import("react").JSX.Element;
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lib/presentation/components/WorkspaceSettingsTopBar/index.tsx"],"names":[],"mappings":"AAqCA;;;;;GAKG;AACH,wBAAgB,uBAAuB,gCAyBtC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useMatch } from 'react-router-dom';
|
|
3
|
+
import { defineMessages, useIntl } from 'react-intl';
|
|
4
|
+
import { Settings } from 'lucide-react';
|
|
5
|
+
import { PageTopBar } from '@orthacms/shell-admin';
|
|
6
|
+
/** Intl descriptors for {@link WorkspaceSettingsTopBar}, co-located here. */
|
|
7
|
+
const messages = defineMessages({
|
|
8
|
+
settings: {
|
|
9
|
+
id: 'workspaces.settings.topbar.settings',
|
|
10
|
+
defaultMessage: 'Settings'
|
|
11
|
+
},
|
|
12
|
+
general: {
|
|
13
|
+
id: 'workspaces.settings.topbar.general',
|
|
14
|
+
defaultMessage: 'General'
|
|
15
|
+
},
|
|
16
|
+
members: {
|
|
17
|
+
id: 'workspaces.settings.topbar.members',
|
|
18
|
+
defaultMessage: 'Members'
|
|
19
|
+
},
|
|
20
|
+
content: {
|
|
21
|
+
id: 'workspaces.settings.topbar.content',
|
|
22
|
+
defaultMessage: 'Content'
|
|
23
|
+
},
|
|
24
|
+
danger: {
|
|
25
|
+
id: 'workspaces.settings.topbar.danger',
|
|
26
|
+
defaultMessage: 'Danger zone'
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
/** Section route segment → its crumb label. */
|
|
30
|
+
const SECTION_MESSAGES = {
|
|
31
|
+
general: messages.general,
|
|
32
|
+
members: messages.members,
|
|
33
|
+
content: messages.content,
|
|
34
|
+
danger: messages.danger
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* The page-context bar over the workspace settings page: the same `Settings`
|
|
38
|
+
* icon the workspace sidebar nav uses, plus a "Settings › {section}"
|
|
39
|
+
* breadcrumb derived from the active nested route (the tab bar below owns
|
|
40
|
+
* navigation, so the crumbs are plain text).
|
|
41
|
+
*/
|
|
42
|
+
export function WorkspaceSettingsTopBar() {
|
|
43
|
+
const intl = useIntl();
|
|
44
|
+
const match = useMatch('/workspaces/:workspaceId/settings/:section');
|
|
45
|
+
const section = match?.params.section;
|
|
46
|
+
const sectionMessage = section ? SECTION_MESSAGES[section] : undefined;
|
|
47
|
+
const crumbs = [
|
|
48
|
+
{ key: 'settings', label: intl.formatMessage(messages.settings) }
|
|
49
|
+
];
|
|
50
|
+
if (sectionMessage) {
|
|
51
|
+
crumbs.push({
|
|
52
|
+
key: section,
|
|
53
|
+
label: intl.formatMessage(sectionMessage)
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
return (_jsx(PageTopBar, { icon: Settings, iconClassName: "bg-violet-soft text-violet-soft-foreground", crumbs: crumbs }));
|
|
57
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The workspace shell — the layout behind `/workspaces/:id/*`. It resolves the
|
|
3
|
+
* `:id` param against the workspaces list, **injects the per-workspace nav into
|
|
4
|
+
* the app sidebar** (via `useSidebarContent`), and renders the content area
|
|
5
|
+
* whose nested `<Routes>` are built from {@link WORKSPACE_ROUTE_SLOT}. Landing
|
|
6
|
+
* on the workspace base redirects to the first section. The resolved workspace
|
|
7
|
+
* is published via {@link CurrentWorkspaceProvider} so inner pages read it
|
|
8
|
+
* without re-fetching.
|
|
9
|
+
*
|
|
10
|
+
* Feature plugins (Content Library, Media Library, Insights) don't mount their
|
|
11
|
+
* own top-level routes — they contribute a route plus a nav entry or section to
|
|
12
|
+
* the slots the sidebar reads, which is what keeps them strictly inside a
|
|
13
|
+
* workspace.
|
|
14
|
+
*/
|
|
15
|
+
export declare function WorkspaceShell(): import("react").JSX.Element;
|
|
16
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lib/presentation/components/WorkspaceShell/index.tsx"],"names":[],"mappings":"AA2EA;;;;;;;;;;;;;GAaG;AACH,wBAAgB,cAAc,gCA2G7B"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Link, Navigate, Route, Routes, useParams } from 'react-router-dom';
|
|
3
|
+
import { defineMessages, useIntl } from 'react-intl';
|
|
4
|
+
import { Lock, TriangleAlert } from 'lucide-react';
|
|
5
|
+
import { Button, Container, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle } from '@orthacms/design-system';
|
|
6
|
+
import { useSidebarContent } from '@orthacms/shell-admin';
|
|
7
|
+
import { useWorkspaces } from '../../../application/useWorkspaces';
|
|
8
|
+
import { CurrentWorkspaceProvider } from '../../currentWorkspace';
|
|
9
|
+
import { WORKSPACE_ROUTE_SLOT } from '../../slots/workspaceSlots';
|
|
10
|
+
import { WorkspaceShellSkeleton } from '../WorkspacesSkeleton';
|
|
11
|
+
import { WorkspaceNav } from '../WorkspaceNav';
|
|
12
|
+
/** Intl descriptors for the shell's error/no-access states, co-located here. */
|
|
13
|
+
const messages = defineMessages({
|
|
14
|
+
noAccessTitle: {
|
|
15
|
+
id: 'workspaces.shell.noAccessTitle',
|
|
16
|
+
defaultMessage: 'You don’t have access to this workspace'
|
|
17
|
+
},
|
|
18
|
+
noAccessBody: {
|
|
19
|
+
id: 'workspaces.shell.noAccessBody',
|
|
20
|
+
defaultMessage: 'You’re not a member of this workspace, or it no longer exists. Ask one of its members to add you.'
|
|
21
|
+
},
|
|
22
|
+
backToWorkspaces: {
|
|
23
|
+
id: 'workspaces.shell.backToWorkspaces',
|
|
24
|
+
defaultMessage: 'Back to workspaces'
|
|
25
|
+
},
|
|
26
|
+
errorTitle: {
|
|
27
|
+
id: 'workspaces.shell.errorTitle',
|
|
28
|
+
defaultMessage: 'Couldn’t load workspaces'
|
|
29
|
+
},
|
|
30
|
+
errorBody: {
|
|
31
|
+
id: 'workspaces.shell.errorBody',
|
|
32
|
+
defaultMessage: 'Something went wrong. Please try again.'
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
/**
|
|
36
|
+
* Centered state used for the shell's no-access / load-error screens. Marked
|
|
37
|
+
* `role="alert"` so a screen reader announces it when the shell swaps it in for
|
|
38
|
+
* the workspace the URL asked for.
|
|
39
|
+
*/
|
|
40
|
+
function ShellMessage({ icon, title, body, action }) {
|
|
41
|
+
return (_jsx(Container, { children: _jsxs(Empty, { className: "mt-10 border", role: "alert", children: [_jsxs(EmptyHeader, { children: [_jsx(EmptyMedia, { variant: "icon", children: icon }), _jsx(EmptyTitle, { children: title }), _jsx(EmptyDescription, { children: body })] }), action ? _jsx(EmptyContent, { children: action }) : null] }) }));
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* The workspace shell — the layout behind `/workspaces/:id/*`. It resolves the
|
|
45
|
+
* `:id` param against the workspaces list, **injects the per-workspace nav into
|
|
46
|
+
* the app sidebar** (via `useSidebarContent`), and renders the content area
|
|
47
|
+
* whose nested `<Routes>` are built from {@link WORKSPACE_ROUTE_SLOT}. Landing
|
|
48
|
+
* on the workspace base redirects to the first section. The resolved workspace
|
|
49
|
+
* is published via {@link CurrentWorkspaceProvider} so inner pages read it
|
|
50
|
+
* without re-fetching.
|
|
51
|
+
*
|
|
52
|
+
* Feature plugins (Content Library, Media Library, Insights) don't mount their
|
|
53
|
+
* own top-level routes — they contribute a route plus a nav entry or section to
|
|
54
|
+
* the slots the sidebar reads, which is what keeps them strictly inside a
|
|
55
|
+
* workspace.
|
|
56
|
+
*/
|
|
57
|
+
export function WorkspaceShell() {
|
|
58
|
+
const intl = useIntl();
|
|
59
|
+
const { id } = useParams();
|
|
60
|
+
const { data: workspaces, isPending, isError } = useWorkspaces();
|
|
61
|
+
const current = workspaces?.find((workspace) => workspace.id === id);
|
|
62
|
+
// Take over the app sidebar's contextual region with this workspace's nav
|
|
63
|
+
// while the shell is mounted; the shell clears it on unmount.
|
|
64
|
+
//
|
|
65
|
+
// `useSidebarContent` stores the *rendered element*, not the render function,
|
|
66
|
+
// so the `workspace` prop captured here is frozen until a dep changes. The
|
|
67
|
+
// deps therefore have to name every field the nav actually renders — keying
|
|
68
|
+
// on the id alone meant renaming, recoloring or archiving a workspace left
|
|
69
|
+
// the switcher showing the old values (including in its `aria-label`) for the
|
|
70
|
+
// rest of the session, while the settings page beside it showed the new ones.
|
|
71
|
+
useSidebarContent(() => (current ? _jsx(WorkspaceNav, { workspace: current }) : null), [
|
|
72
|
+
current?.id,
|
|
73
|
+
current?.name,
|
|
74
|
+
current?.color,
|
|
75
|
+
current?.status,
|
|
76
|
+
current?.members.length
|
|
77
|
+
]);
|
|
78
|
+
if (isPending) {
|
|
79
|
+
return _jsx(WorkspaceShellSkeleton, {});
|
|
80
|
+
}
|
|
81
|
+
if (isError) {
|
|
82
|
+
return (_jsx(ShellMessage, { icon: _jsx(TriangleAlert, {}), title: intl.formatMessage(messages.errorTitle), body: intl.formatMessage(messages.errorBody) }));
|
|
83
|
+
}
|
|
84
|
+
// The list only ever contains workspaces the user is a member of (the
|
|
85
|
+
// server scopes `GET /workspaces` to membership), so an unresolved `:id` is
|
|
86
|
+
// exactly the "no access" case — whether the workspace exists or not. We
|
|
87
|
+
// deliberately don't distinguish the two, matching the API's flat 403.
|
|
88
|
+
if (!current) {
|
|
89
|
+
return (_jsx(ShellMessage, { icon: _jsx(Lock, {}), title: intl.formatMessage(messages.noAccessTitle), body: intl.formatMessage(messages.noAccessBody), action: _jsx(Button, { asChild: true, variant: "outline", className: "shadow-none", children: _jsx(Link, { to: "/workspaces", children: intl.formatMessage(messages.backToWorkspaces) }) }) }));
|
|
90
|
+
}
|
|
91
|
+
const routes = WORKSPACE_ROUTE_SLOT.getItems();
|
|
92
|
+
// The default section is the lowest-order route (the Content Library) —
|
|
93
|
+
// where the workspace base and any unknown sub-path redirect to. Its base
|
|
94
|
+
// segment is the route path without the trailing `/*`.
|
|
95
|
+
const defaultRoute = routes
|
|
96
|
+
.slice()
|
|
97
|
+
.sort((a, b) => (a.order ?? Infinity) - (b.order ?? Infinity))[0];
|
|
98
|
+
const defaultPath = defaultRoute?.path.split('/')[0];
|
|
99
|
+
return (_jsx(CurrentWorkspaceProvider, { workspace: current, children: _jsx("div", { className: "flex h-full flex-col", children: _jsxs(Routes, { children: [defaultPath ? (_jsx(Route, { index: true, element: _jsx(Navigate, { to: defaultPath, replace: true }) })) : null, routes.map((route) => (_jsx(Route, { path: route.path, element: route.element }, route.path))), defaultPath ? (_jsx(Route, { path: "*", element: _jsx(Navigate, { to: defaultPath, replace: true }) })) : null] }) }) }));
|
|
100
|
+
}
|