@taskforcehq/taskforce 0.3.168
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/README.md +241 -0
- package/dist/Taskforce.d.ts +3 -0
- package/dist/Taskforce.js +3 -0
- package/dist/Taskforce.module.css +7587 -0
- package/dist/TaskforceCore.CategoryFallback.test.d.ts +1 -0
- package/dist/TaskforceCore.CategoryFallback.test.js +98 -0
- package/dist/TaskforceCore.d.ts +12 -0
- package/dist/TaskforceCore.js +729 -0
- package/dist/TaskforceCore.test.d.ts +1 -0
- package/dist/TaskforceCore.test.js +2132 -0
- package/dist/TaskforceScreenshot.d.ts +11 -0
- package/dist/TaskforceScreenshot.js +113 -0
- package/dist/TaskforceWidget.d.ts +6 -0
- package/dist/TaskforceWidget.js +101 -0
- package/dist/TaskforceWidget.test.d.ts +1 -0
- package/dist/TaskforceWidget.test.js +92 -0
- package/dist/UnsavedChangesRelaxed.test.d.ts +1 -0
- package/dist/UnsavedChangesRelaxed.test.js +16 -0
- package/dist/__tests__/localizationCatalogs.test.d.ts +1 -0
- package/dist/__tests__/localizationCatalogs.test.js +37 -0
- package/dist/__tests__/planParser.test.d.ts +1 -0
- package/dist/__tests__/planParser.test.js +183 -0
- package/dist/__tests__/releaseVersion.test.d.ts +1 -0
- package/dist/__tests__/releaseVersion.test.js +32 -0
- package/dist/__tests__/structuredCommentValidation.test.d.ts +1 -0
- package/dist/__tests__/structuredCommentValidation.test.js +31 -0
- package/dist/__tests__/structuredDocValidation.test.d.ts +1 -0
- package/dist/__tests__/structuredDocValidation.test.js +30 -0
- package/dist/__tests__/templateEngine.test.d.ts +1 -0
- package/dist/__tests__/templateEngine.test.js +150 -0
- package/dist/__tests__/templates.test.d.ts +1 -0
- package/dist/__tests__/templates.test.js +45 -0
- package/dist/__tests__/workflowDocumentFixtures.test.d.ts +1 -0
- package/dist/__tests__/workflowDocumentFixtures.test.js +78 -0
- package/dist/__tests__/workflowExportMatrix.test.d.ts +1 -0
- package/dist/__tests__/workflowExportMatrix.test.js +113 -0
- package/dist/__tests__/workflowExportSnapshots.test.d.ts +1 -0
- package/dist/__tests__/workflowExportSnapshots.test.js +28 -0
- package/dist/__tests__/workflowGeneration.test.d.ts +1 -0
- package/dist/__tests__/workflowGeneration.test.js +12 -0
- package/dist/__tests__/workflowSimulation.test.d.ts +1 -0
- package/dist/__tests__/workflowSimulation.test.js +113 -0
- package/dist/__tests__/workflowV2Policy.test.d.ts +1 -0
- package/dist/__tests__/workflowV2Policy.test.js +80 -0
- package/dist/api.d.ts +30 -0
- package/dist/api.js +85 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +217 -0
- package/dist/compat/priorityCompat.d.ts +2 -0
- package/dist/compat/priorityCompat.js +24 -0
- package/dist/components/features/DocumentGenerateModal.d.ts +9 -0
- package/dist/components/features/DocumentGenerateModal.js +114 -0
- package/dist/components/features/DocumentIndex.d.ts +19 -0
- package/dist/components/features/DocumentIndex.js +51 -0
- package/dist/components/features/DocumentViewer.d.ts +9 -0
- package/dist/components/features/DocumentViewer.js +253 -0
- package/dist/components/features/DocumentWorkspace.d.ts +21 -0
- package/dist/components/features/DocumentWorkspace.js +88 -0
- package/dist/components/features/TaskSettings.d.ts +209 -0
- package/dist/components/features/TaskSettings.js +500 -0
- package/dist/components/features/TaskSettings.test.d.ts +1 -0
- package/dist/components/features/TaskSettings.test.js +308 -0
- package/dist/components/features/settings/CategoryManager.d.ts +19 -0
- package/dist/components/features/settings/CategoryManager.js +113 -0
- package/dist/components/features/settings/TaxonomyEditor.d.ts +8 -0
- package/dist/components/features/settings/TaxonomyEditor.js +98 -0
- package/dist/components/features/settings/TaxonomyManager 2.d.ts +52 -0
- package/dist/components/features/settings/TaxonomyManager 2.js +75 -0
- package/dist/components/features/settings/TaxonomyManager.d.ts +54 -0
- package/dist/components/features/settings/TaxonomyManager.js +77 -0
- package/dist/components/features/settings/TypeManager.d.ts +10 -0
- package/dist/components/features/settings/TypeManager.js +50 -0
- package/dist/components/features/settings/WorkflowEditorPrototype.d.ts +15 -0
- package/dist/components/features/settings/WorkflowEditorPrototype.js +245 -0
- package/dist/components/task/TaskActionHeader.d.ts +20 -0
- package/dist/components/task/TaskActionHeader.js +13 -0
- package/dist/components/task/TaskCard.d.ts +47 -0
- package/dist/components/task/TaskCard.js +326 -0
- package/dist/components/task/TaskCard.test.d.ts +1 -0
- package/dist/components/task/TaskCard.test.js +95 -0
- package/dist/components/task/TaskContextUpload.d.ts +12 -0
- package/dist/components/task/TaskContextUpload.js +393 -0
- package/dist/components/task/TaskContextUpload.test.d.ts +1 -0
- package/dist/components/task/TaskContextUpload.test.js +189 -0
- package/dist/components/task/TaskForm.d.ts +105 -0
- package/dist/components/task/TaskForm.js +241 -0
- package/dist/components/task/TaskForm.test.d.ts +1 -0
- package/dist/components/task/TaskForm.test.js +288 -0
- package/dist/components/task/TaskKanban 2.d.ts +76 -0
- package/dist/components/task/TaskKanban 2.js +1004 -0
- package/dist/components/task/TaskKanban.d.ts +76 -0
- package/dist/components/task/TaskKanban.empty-column-drop.test.d.ts +1 -0
- package/dist/components/task/TaskKanban.empty-column-drop.test.js +66 -0
- package/dist/components/task/TaskKanban.js +1026 -0
- package/dist/components/task/TaskKanban.test.d.ts +1 -0
- package/dist/components/task/TaskKanban.test.js +46 -0
- package/dist/components/task/TaskList.d.ts +74 -0
- package/dist/components/task/TaskList.js +38 -0
- package/dist/components/task/TaskList.test.d.ts +1 -0
- package/dist/components/task/TaskList.test.js +270 -0
- package/dist/components/task/TaskScreenshotSection.d.ts +15 -0
- package/dist/components/task/TaskScreenshotSection.js +22 -0
- package/dist/components/ui/LevelSelector.d.ts +13 -0
- package/dist/components/ui/LevelSelector.js +25 -0
- package/dist/components/ui/LevelSelector.test.d.ts +1 -0
- package/dist/components/ui/LevelSelector.test.js +55 -0
- package/dist/components/ui/Markdown.d.ts +6 -0
- package/dist/components/ui/Markdown.js +94 -0
- package/dist/components/ui/Markdown.test.d.ts +1 -0
- package/dist/components/ui/Markdown.test.js +38 -0
- package/dist/components/ui/Modal.d.ts +16 -0
- package/dist/components/ui/Modal.js +49 -0
- package/dist/components/ui/MultiSelectFilter.d.ts +10 -0
- package/dist/components/ui/MultiSelectFilter.js +71 -0
- package/dist/components/ui/MultiSelectFilter.test.d.ts +1 -0
- package/dist/components/ui/MultiSelectFilter.test.js +74 -0
- package/dist/components/ui/TaxonomyDropdown.d.ts +17 -0
- package/dist/components/ui/TaxonomyDropdown.js +145 -0
- package/dist/components/ui/TaxonomyDropdown.test.d.ts +1 -0
- package/dist/components/ui/TaxonomyDropdown.test.js +130 -0
- package/dist/components/views/StandaloneLayout 2.d.ts +8 -0
- package/dist/components/views/StandaloneLayout 2.js +1660 -0
- package/dist/components/views/StandaloneLayout.d.ts +8 -0
- package/dist/components/views/StandaloneLayout.js +2117 -0
- package/dist/components/views/WidgetView.d.ts +8 -0
- package/dist/components/views/WidgetView.js +221 -0
- package/dist/config/envSchema.d.ts +28 -0
- package/dist/config/envSchema.js +374 -0
- package/dist/config/envSchema.test.d.ts +1 -0
- package/dist/config/envSchema.test.js +97 -0
- package/dist/config/surfaceBase.d.ts +2 -0
- package/dist/config/surfaceBase.js +8 -0
- package/dist/core/BulkUpdateFieldsPreview.test.d.ts +1 -0
- package/dist/core/BulkUpdateFieldsPreview.test.js +62 -0
- package/dist/core/CompletedAt.test.d.ts +1 -0
- package/dist/core/CompletedAt.test.js +44 -0
- package/dist/core/CreatedBy.test.d.ts +1 -0
- package/dist/core/CreatedBy.test.js +60 -0
- package/dist/core/EntitlementsPolicy.test.d.ts +1 -0
- package/dist/core/EntitlementsPolicy.test.js +145 -0
- package/dist/core/InitiativeTemplates.test.d.ts +1 -0
- package/dist/core/InitiativeTemplates.test.js +50 -0
- package/dist/core/ParentLifecycle.test.d.ts +1 -0
- package/dist/core/ParentLifecycle.test.js +98 -0
- package/dist/core/ScheduleFields.test.d.ts +1 -0
- package/dist/core/ScheduleFields.test.js +197 -0
- package/dist/core/SetupState.test.d.ts +1 -0
- package/dist/core/SetupState.test.js +113 -0
- package/dist/core/SystemAdmin.test.d.ts +1 -0
- package/dist/core/SystemAdmin.test.js +295 -0
- package/dist/core/TaskTaxonomyValidation.test.d.ts +1 -0
- package/dist/core/TaskTaxonomyValidation.test.js +64 -0
- package/dist/core/Taskforce.d.ts +1063 -0
- package/dist/core/Taskforce.ids.test.d.ts +1 -0
- package/dist/core/Taskforce.ids.test.js +168 -0
- package/dist/core/Taskforce.js +5981 -0
- package/dist/core/Taskforce.realtimeMutation.test.d.ts +1 -0
- package/dist/core/Taskforce.realtimeMutation.test.js +76 -0
- package/dist/core/WorkspaceDelete.test.d.ts +1 -0
- package/dist/core/WorkspaceDelete.test.js +140 -0
- package/dist/core/WorkspacePermissions.test.d.ts +1 -0
- package/dist/core/WorkspacePermissions.test.js +151 -0
- package/dist/core/WorkspacePlanMode.test.d.ts +1 -0
- package/dist/core/WorkspacePlanMode.test.js +104 -0
- package/dist/hooks/authGuardPolicy.d.ts +26 -0
- package/dist/hooks/authGuardPolicy.js +32 -0
- package/dist/hooks/authGuardPolicy.test.d.ts +1 -0
- package/dist/hooks/authGuardPolicy.test.js +76 -0
- package/dist/hooks/useDraggable.d.ts +12 -0
- package/dist/hooks/useDraggable.js +65 -0
- package/dist/hooks/useRealtimeSync.d.ts +24 -0
- package/dist/hooks/useRealtimeSync.js +275 -0
- package/dist/hooks/useRealtimeSync.test.d.ts +1 -0
- package/dist/hooks/useRealtimeSync.test.js +284 -0
- package/dist/hooks/useSyncOrchestrator.d.ts +164 -0
- package/dist/hooks/useSyncOrchestrator.js +1427 -0
- package/dist/hooks/useSyncOrchestrator.retry-closure.test.d.ts +1 -0
- package/dist/hooks/useSyncOrchestrator.retry-closure.test.js +367 -0
- package/dist/hooks/useTaskforce.d.ts +727 -0
- package/dist/hooks/useTaskforce.js +4396 -0
- package/dist/hooks/useTaskforce.priority-filters.test.d.ts +1 -0
- package/dist/hooks/useTaskforce.priority-filters.test.js +33 -0
- package/dist/hooks/useWorkspaceSyncController.d.ts +80 -0
- package/dist/hooks/useWorkspaceSyncController.js +598 -0
- package/dist/hooks/useWorkspaceSyncController.test.d.ts +1 -0
- package/dist/hooks/useWorkspaceSyncController.test.js +236 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +11 -0
- package/dist/localization/index.d.ts +8 -0
- package/dist/localization/index.js +81 -0
- package/dist/localization/locales/en-US.d.ts +151 -0
- package/dist/localization/locales/en-US.js +150 -0
- package/dist/localization/locales/es-419.d.ts +2 -0
- package/dist/localization/locales/es-419.js +150 -0
- package/dist/localization/locales/pt-BR.d.ts +2 -0
- package/dist/localization/locales/pt-BR.js +150 -0
- package/dist/main.d.ts +1 -0
- package/dist/main.js +33 -0
- package/dist/mcp/optionResolution.d.ts +14 -0
- package/dist/mcp/optionResolution.js +126 -0
- package/dist/mcp/optionResolution.test.d.ts +1 -0
- package/dist/mcp/optionResolution.test.js +39 -0
- package/dist/mcp/server.d.ts +1 -0
- package/dist/mcp/server.js +1793 -0
- package/dist/mcp/structuredCommentValidation.d.ts +6 -0
- package/dist/mcp/structuredCommentValidation.js +56 -0
- package/dist/mcp/structuredDocValidation.d.ts +6 -0
- package/dist/mcp/structuredDocValidation.js +75 -0
- package/dist/migrations/billingSchemaParity.test.d.ts +1 -0
- package/dist/migrations/billingSchemaParity.test.js +46 -0
- package/dist/migrations/clientMigrations.d.ts +9 -0
- package/dist/migrations/clientMigrations.js +74 -0
- package/dist/migrations/flags.d.ts +6 -0
- package/dist/migrations/flags.js +8 -0
- package/dist/migrations/taskMigrations.d.ts +71 -0
- package/dist/migrations/taskMigrations.js +236 -0
- package/dist/migrations/taskMigrations.test.d.ts +1 -0
- package/dist/migrations/taskMigrations.test.js +34 -0
- package/dist/migrations/taskSchemaMigrations.d.ts +11 -0
- package/dist/migrations/taskSchemaMigrations.js +453 -0
- package/dist/plugins/index.d.ts +10 -0
- package/dist/plugins/index.js +10 -0
- package/dist/plugins/vite.d.ts +19 -0
- package/dist/plugins/vite.js +271 -0
- package/dist/public/android-chrome-192x192.png +0 -0
- package/dist/public/android-chrome-512x512.png +0 -0
- package/dist/public/apple-touch-icon.png +0 -0
- package/dist/public/favicon-16x16.png +0 -0
- package/dist/public/favicon-32x32.png +0 -0
- package/dist/public/favicon.ico +0 -0
- package/dist/public/favicon.png +0 -0
- package/dist/public/site.webmanifest +1 -0
- package/dist/public/taskforce.png +0 -0
- package/dist/resources/templates/WORKFLOW_V2_POLICY.md +55 -0
- package/dist/resources/templates/environments/aider.yaml +14 -0
- package/dist/resources/templates/environments/antigravity.yaml +10 -0
- package/dist/resources/templates/environments/claude.yaml +10 -0
- package/dist/resources/templates/environments/cline.yaml +10 -0
- package/dist/resources/templates/environments/codex.yaml +13 -0
- package/dist/resources/templates/environments/copilot.yaml +10 -0
- package/dist/resources/templates/environments/cursor.yaml +9 -0
- package/dist/resources/templates/environments/gemini.yaml +9 -0
- package/dist/resources/templates/environments/windsurf.yaml +10 -0
- package/dist/resources/templates/workflow-sources/README.md +9 -0
- package/dist/resources/templates/workflow-sources/workflowDocs.mjs +520 -0
- package/dist/resources/templates/workflow-sources/workflowEditorOverrides.json +1 -0
- package/dist/resources/templates/workflows/collaborate.yaml +104 -0
- package/dist/resources/templates/workflows/do.yaml +82 -0
- package/dist/resources/templates/workflows/evaluate.yaml +111 -0
- package/dist/resources/templates/workflows/execute.yaml +142 -0
- package/dist/resources/templates/workflows/plan.yaml +112 -0
- package/dist/resources/templates/workflows/review.yaml +109 -0
- package/dist/runtime/capabilities.d.ts +8 -0
- package/dist/runtime/capabilities.js +16 -0
- package/dist/security/virusScan.d.ts +16 -0
- package/dist/security/virusScan.js +83 -0
- package/dist/server/auth.d.ts +51 -0
- package/dist/server/auth.js +266 -0
- package/dist/server/auth.test.d.ts +1 -0
- package/dist/server/auth.test.js +111 -0
- package/dist/server/buildInfo.d.ts +7 -0
- package/dist/server/buildInfo.js +100 -0
- package/dist/server/buildInfo.test.d.ts +1 -0
- package/dist/server/buildInfo.test.js +29 -0
- package/dist/server/cors.d.ts +7 -0
- package/dist/server/cors.js +76 -0
- package/dist/server/cors.test.d.ts +1 -0
- package/dist/server/cors.test.js +71 -0
- package/dist/server/email.d.ts +28 -0
- package/dist/server/email.js +138 -0
- package/dist/server/email.test.d.ts +1 -0
- package/dist/server/email.test.js +113 -0
- package/dist/server/index.cookieProxy.test.d.ts +1 -0
- package/dist/server/index.cookieProxy.test.js +19 -0
- package/dist/server/index.d.ts +17 -0
- package/dist/server/index.js +757 -0
- package/dist/server/index.rateLimit.test.d.ts +1 -0
- package/dist/server/index.rateLimit.test.js +13 -0
- package/dist/server/index.test.d.ts +1 -0
- package/dist/server/index.test.js +19 -0
- package/dist/server/rateLimit.d.ts +29 -0
- package/dist/server/rateLimit.js +99 -0
- package/dist/server/rateLimit.test.d.ts +1 -0
- package/dist/server/rateLimit.test.js +107 -0
- package/dist/server/realtimeSync.auth.test.d.ts +1 -0
- package/dist/server/realtimeSync.auth.test.js +62 -0
- package/dist/server/realtimeSync.replay.test.d.ts +1 -0
- package/dist/server/realtimeSync.replay.test.js +192 -0
- package/dist/server/realtimeSync.workspaceIsolation.test.d.ts +1 -0
- package/dist/server/realtimeSync.workspaceIsolation.test.js +101 -0
- package/dist/server/realtimeSyncWs.d.ts +30 -0
- package/dist/server/realtimeSyncWs.js +257 -0
- package/dist/server/routes.billing.d.ts +15 -0
- package/dist/server/routes.billing.js +991 -0
- package/dist/server/routes.billing.test.d.ts +1 -0
- package/dist/server/routes.billing.test.js +387 -0
- package/dist/server/routes.d.ts +72 -0
- package/dist/server/routes.js +4820 -0
- package/dist/server/routes.sync.d.ts +17 -0
- package/dist/server/routes.sync.integration.test.d.ts +1 -0
- package/dist/server/routes.sync.integration.test.js +470 -0
- package/dist/server/routes.sync.js +1141 -0
- package/dist/server/routes.test.d.ts +1 -0
- package/dist/server/routes.test.js +4945 -0
- package/dist/server/runtimeMode.d.ts +4 -0
- package/dist/server/runtimeMode.js +25 -0
- package/dist/server/runtimeMode.test.d.ts +1 -0
- package/dist/server/runtimeMode.test.js +26 -0
- package/dist/server/securityHeaders.d.ts +3 -0
- package/dist/server/securityHeaders.js +25 -0
- package/dist/server/securityHeaders.test.d.ts +1 -0
- package/dist/server/securityHeaders.test.js +32 -0
- package/dist/server/smtpTransport.d.ts +21 -0
- package/dist/server/smtpTransport.js +11 -0
- package/dist/server/start.d.ts +1 -0
- package/dist/server/start.js +17 -0
- package/dist/services/formatTransformers.d.ts +29 -0
- package/dist/services/formatTransformers.js +56 -0
- package/dist/services/templateEngine.d.ts +46 -0
- package/dist/services/templateEngine.js +148 -0
- package/dist/shared/runtimeContract.d.ts +12 -0
- package/dist/shared/runtimeContract.js +23 -0
- package/dist/shared/runtimeContract.test.d.ts +1 -0
- package/dist/shared/runtimeContract.test.js +23 -0
- package/dist/soak/preflight.cli.d.ts +1 -0
- package/dist/soak/preflight.cli.js +28 -0
- package/dist/soak/preflight.d.ts +26 -0
- package/dist/soak/preflight.js +113 -0
- package/dist/soak/preflight.test.d.ts +1 -0
- package/dist/soak/preflight.test.js +39 -0
- package/dist/soak/syncSoakHarness.d.ts +6 -0
- package/dist/soak/syncSoakHarness.js +10 -0
- package/dist/storage/createDatabaseAdapter.d.ts +2 -0
- package/dist/storage/createDatabaseAdapter.js +9 -0
- package/dist/storage/databaseAdapter.d.ts +22 -0
- package/dist/storage/databaseAdapter.js +1 -0
- package/dist/storage/documentIntegrity.d.ts +28 -0
- package/dist/storage/documentIntegrity.js +103 -0
- package/dist/storage/documentPurge.d.ts +14 -0
- package/dist/storage/documentPurge.js +46 -0
- package/dist/storage/documentRegistry.d.ts +39 -0
- package/dist/storage/documentRegistry.js +115 -0
- package/dist/storage/integritySchedule.d.ts +17 -0
- package/dist/storage/integritySchedule.js +62 -0
- package/dist/storage/objectStorage.d.ts +20 -0
- package/dist/storage/objectStorage.js +15 -0
- package/dist/storage/objectStorageClient.d.ts +18 -0
- package/dist/storage/objectStorageClient.js +301 -0
- package/dist/storage/objectStorageConfig.d.ts +2 -0
- package/dist/storage/objectStorageConfig.js +45 -0
- package/dist/storage/postgresAdapter.d.ts +20 -0
- package/dist/storage/postgresAdapter.js +204 -0
- package/dist/storage/postgresWorker.d.ts +1 -0
- package/dist/storage/postgresWorker.js +110 -0
- package/dist/storage/providerConfig.d.ts +6 -0
- package/dist/storage/providerConfig.js +11 -0
- package/dist/storage/sqliteAdapter.d.ts +14 -0
- package/dist/storage/sqliteAdapter.js +28 -0
- package/dist/storage/taskAssetStore.d.ts +56 -0
- package/dist/storage/taskAssetStore.js +297 -0
- package/dist/sync/cloudSyncApi.d.ts +47 -0
- package/dist/sync/cloudSyncApi.js +138 -0
- package/dist/sync/cloudSyncApi.test.d.ts +1 -0
- package/dist/sync/cloudSyncApi.test.js +54 -0
- package/dist/sync/encryptionService.d.ts +11 -0
- package/dist/sync/encryptionService.js +61 -0
- package/dist/sync/encryptionService.test.d.ts +1 -0
- package/dist/sync/encryptionService.test.js +52 -0
- package/dist/sync/realtimeFeature.d.ts +6 -0
- package/dist/sync/realtimeFeature.js +20 -0
- package/dist/sync/realtimeFeature.test.d.ts +1 -0
- package/dist/sync/realtimeFeature.test.js +30 -0
- package/dist/sync/realtimeReconcile.d.ts +30 -0
- package/dist/sync/realtimeReconcile.js +90 -0
- package/dist/sync/realtimeReconcile.test.d.ts +1 -0
- package/dist/sync/realtimeReconcile.test.js +43 -0
- package/dist/sync/syncService.d.ts +96 -0
- package/dist/sync/syncService.js +423 -0
- package/dist/sync/syncService.test.d.ts +1 -0
- package/dist/sync/syncService.test.js +484 -0
- package/dist/sync/workspaceSyncModel.d.ts +61 -0
- package/dist/sync/workspaceSyncModel.js +136 -0
- package/dist/sync/workspaceSyncModel.test.d.ts +1 -0
- package/dist/sync/workspaceSyncModel.test.js +73 -0
- package/dist/test/setup.d.ts +1 -0
- package/dist/test/setup.js +15 -0
- package/dist/types.d.ts +157 -0
- package/dist/types.js +41 -0
- package/dist/ui/assets/RussoOne-Regular-C3BxZIj7.ttf +0 -0
- package/dist/ui/assets/index-0W5vyCpn.css +1 -0
- package/dist/ui/assets/index-MCZuNNfn.js +23 -0
- package/dist/ui/assets/logo_white_01-0Vx-iIIv.png +0 -0
- package/dist/ui/assets/taskforce-BxLPokNB.png +0 -0
- package/dist/ui/assets/vendor-dnd-BI1K77C1.js +5 -0
- package/dist/ui/assets/vendor-icons-ZFG3SGwo.js +1 -0
- package/dist/ui/assets/vendor-markdown-CKYkQHfj.js +29 -0
- package/dist/ui/assets/vendor-react-DdIDsh7f.js +9 -0
- package/dist/ui/assets/vendor-router-BtiNU7Dl.js +3 -0
- package/dist/ui/branding/logos/logo_black_01.png +0 -0
- package/dist/ui/branding/logos/logo_black_02.png +0 -0
- package/dist/ui/branding/logos/logo_white_01.png +0 -0
- package/dist/ui/branding/logos/logo_white_02.png +0 -0
- package/dist/ui/favicon/android-chrome-192x192.png +0 -0
- package/dist/ui/favicon/android-chrome-512x512.png +0 -0
- package/dist/ui/favicon/apple-touch-icon.png +0 -0
- package/dist/ui/favicon/favicon-16x16.png +0 -0
- package/dist/ui/favicon/favicon-32x32.png +0 -0
- package/dist/ui/favicon/favicon.ico +0 -0
- package/dist/ui/favicon/favicon.png +0 -0
- package/dist/ui/favicon/site.webmanifest +1 -0
- package/dist/ui/fonts/RussoOne-Regular.ttf +0 -0
- package/dist/ui/images/taskforce.png +0 -0
- package/dist/ui/index.html +19 -0
- package/dist/utils/checklistMarkdown.d.ts +9 -0
- package/dist/utils/checklistMarkdown.js +46 -0
- package/dist/utils/constants.d.ts +21 -0
- package/dist/utils/constants.icons.test.d.ts +1 -0
- package/dist/utils/constants.icons.test.js +40 -0
- package/dist/utils/constants.js +100 -0
- package/dist/utils/contextFiles.d.ts +8 -0
- package/dist/utils/contextFiles.js +54 -0
- package/dist/utils/formatting.d.ts +5 -0
- package/dist/utils/formatting.js +30 -0
- package/dist/utils/planParser.d.ts +22 -0
- package/dist/utils/planParser.js +151 -0
- package/dist/utils/taskDragZones.d.ts +8 -0
- package/dist/utils/taskDragZones.js +14 -0
- package/dist/utils/taskDragZones.test.d.ts +1 -0
- package/dist/utils/taskDragZones.test.js +14 -0
- package/dist/utils/taskHierarchy.d.ts +4 -0
- package/dist/utils/taskHierarchy.js +69 -0
- package/dist/utils/taskHierarchy.test.d.ts +1 -0
- package/dist/utils/taskHierarchy.test.js +38 -0
- package/dist/utils/taskParenting.d.ts +3 -0
- package/dist/utils/taskParenting.js +24 -0
- package/dist/utils/taskParenting.test.d.ts +1 -0
- package/dist/utils/taskParenting.test.js +21 -0
- package/dist/utils/taskRelations.d.ts +6 -0
- package/dist/utils/taskRelations.js +24 -0
- package/dist/utils/taskRelations.test.d.ts +1 -0
- package/dist/utils/taskRelations.test.js +34 -0
- package/dist/utils/taskUtils.d.ts +2 -0
- package/dist/utils/taskUtils.js +20 -0
- package/dist/utils/taskforceApiClient.d.ts +7 -0
- package/dist/utils/taskforceApiClient.js +42 -0
- package/dist/utils/workspaceIdentity.d.ts +8 -0
- package/dist/utils/workspaceIdentity.js +47 -0
- package/dist/utils/workspaceIdentity.test.d.ts +1 -0
- package/dist/utils/workspaceIdentity.test.js +32 -0
- package/dist/utils/workspaceLifecycle.d.ts +26 -0
- package/dist/utils/workspaceLifecycle.js +69 -0
- package/dist/utils/workspaceLifecycle.test.d.ts +1 -0
- package/dist/utils/workspaceLifecycle.test.js +64 -0
- package/package.json +133 -0
- package/scripts/check-compat-boundaries.js +48 -0
- package/scripts/check-env.ts +24 -0
- package/scripts/check-localization-strings.mjs +49 -0
- package/scripts/check-runtime-boundaries.mjs +44 -0
- package/scripts/debug-global.mjs +34 -0
- package/scripts/debug-server.mjs +36 -0
- package/scripts/export-sqlite-to-postgres.mjs +125 -0
- package/scripts/generate-env-example.ts +8 -0
- package/scripts/generate-workflow-templates.mjs +134 -0
- package/scripts/mcp-stdio-adapter.mjs +160 -0
- package/scripts/postinstall.js +60 -0
- package/scripts/release-version-lib.mjs +88 -0
- package/scripts/release-version.mjs +72 -0
- package/scripts/run-dev-proxy.sh +49 -0
- package/scripts/run-e2e-realtime.sh +16 -0
- package/scripts/run-smoke.sh +23 -0
- package/scripts/run-soak.sh +29 -0
- package/scripts/test-global.js +143 -0
- package/scripts/update-homebrew-formula.sh +38 -0
- package/src/resources/templates/WORKFLOW_V2_POLICY.md +55 -0
- package/src/resources/templates/environments/aider.yaml +14 -0
- package/src/resources/templates/environments/antigravity.yaml +10 -0
- package/src/resources/templates/environments/claude.yaml +10 -0
- package/src/resources/templates/environments/cline.yaml +10 -0
- package/src/resources/templates/environments/codex.yaml +13 -0
- package/src/resources/templates/environments/copilot.yaml +10 -0
- package/src/resources/templates/environments/cursor.yaml +9 -0
- package/src/resources/templates/environments/gemini.yaml +9 -0
- package/src/resources/templates/environments/windsurf.yaml +10 -0
- package/src/resources/templates/workflow-sources/README.md +9 -0
- package/src/resources/templates/workflow-sources/workflowDocs.mjs +520 -0
- package/src/resources/templates/workflow-sources/workflowEditorOverrides.json +1 -0
- package/src/resources/templates/workflows/collaborate.yaml +104 -0
- package/src/resources/templates/workflows/do.yaml +82 -0
- package/src/resources/templates/workflows/evaluate.yaml +111 -0
- package/src/resources/templates/workflows/execute.yaml +142 -0
- package/src/resources/templates/workflows/plan.yaml +112 -0
- package/src/resources/templates/workflows/review.yaml +109 -0
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { render, screen } from '@testing-library/react';
|
|
3
|
+
import userEvent from '@testing-library/user-event';
|
|
4
|
+
import { describe, it, expect, vi } from 'vitest';
|
|
5
|
+
import { TaskSettings } from './TaskSettings';
|
|
6
|
+
describe('TaskSettings Component', () => {
|
|
7
|
+
// Default mock props
|
|
8
|
+
const defaultSettingsModel = {
|
|
9
|
+
currentTheme: 'dark',
|
|
10
|
+
globalTheme: 'dark',
|
|
11
|
+
themeUseGlobalDefault: false,
|
|
12
|
+
keyShortcut: 'Alt+T',
|
|
13
|
+
jsonBackupEnabled: false,
|
|
14
|
+
globalJsonBackupEnabled: false,
|
|
15
|
+
jsonBackupUseGlobalDefault: false,
|
|
16
|
+
exportWorkflowsPath: '.agent/workflows',
|
|
17
|
+
exportSpecialistsPath: '.agent/specialists',
|
|
18
|
+
exportingResource: null,
|
|
19
|
+
exportResult: null,
|
|
20
|
+
pathSaved: false,
|
|
21
|
+
initialSection: null,
|
|
22
|
+
exportEnvironment: 'antigravity',
|
|
23
|
+
// Mock Callbacks
|
|
24
|
+
onThemeChange: vi.fn(),
|
|
25
|
+
onSaveTheme: vi.fn(),
|
|
26
|
+
onSaveGlobalTheme: vi.fn(),
|
|
27
|
+
onResetProjectToGlobal: vi.fn(),
|
|
28
|
+
onKeyShortcutChange: vi.fn(),
|
|
29
|
+
onJsonBackupEnabledChange: vi.fn(),
|
|
30
|
+
onSaveGlobalJsonBackupEnabled: vi.fn(),
|
|
31
|
+
onSaveSettings: vi.fn(),
|
|
32
|
+
onExportWorkflowsPathChange: vi.fn(),
|
|
33
|
+
onExportSpecialistsPathChange: vi.fn(),
|
|
34
|
+
onExportEnvironmentChange: vi.fn(),
|
|
35
|
+
onExportResources: vi.fn(),
|
|
36
|
+
onShowFolderBrowserChange: vi.fn(),
|
|
37
|
+
onBrowserTargetChange: vi.fn(),
|
|
38
|
+
onFetchFolders: vi.fn(),
|
|
39
|
+
// Category Manager Props
|
|
40
|
+
categories: [
|
|
41
|
+
{ value: 'general', label: 'General', disabled: false },
|
|
42
|
+
{ value: 'backend', label: 'Backend', color: 'red-500', icon: 'Server', path: 'src/backend' }
|
|
43
|
+
],
|
|
44
|
+
pathValidation: {
|
|
45
|
+
'src/backend': { exists: true, isDirectory: true, isFile: false }
|
|
46
|
+
},
|
|
47
|
+
onUpdateCategory: vi.fn(),
|
|
48
|
+
onRemoveCategory: vi.fn(),
|
|
49
|
+
onSaveCategory: vi.fn(),
|
|
50
|
+
onAddPath: vi.fn(),
|
|
51
|
+
onRemovePath: vi.fn(),
|
|
52
|
+
onUpdateCategoryIcon: vi.fn(),
|
|
53
|
+
onUpdateCategoryColor: vi.fn(),
|
|
54
|
+
// Type Manager Props
|
|
55
|
+
types: [
|
|
56
|
+
{ value: 'feature', label: 'Feature' },
|
|
57
|
+
{ value: 'bug', label: 'Bug' }
|
|
58
|
+
],
|
|
59
|
+
onSaveType: vi.fn(),
|
|
60
|
+
onRemoveType: vi.fn(),
|
|
61
|
+
// Taxonomy Props
|
|
62
|
+
taxonomies: [],
|
|
63
|
+
onUpdateTaxonomies: vi.fn(),
|
|
64
|
+
priorities: [
|
|
65
|
+
{ value: 1, label: 'Low', color: 'teal-500', icon: 'ArrowDown' },
|
|
66
|
+
{ value: 2, label: 'Medium', color: 'blue-500', icon: 'Minus' },
|
|
67
|
+
{ value: 3, label: 'High', color: 'amber-500', icon: 'ArrowUp' },
|
|
68
|
+
{ value: 4, label: 'Critical', color: 'red-500', icon: 'AlertTriangle' },
|
|
69
|
+
],
|
|
70
|
+
onUpdatePriorities: vi.fn(),
|
|
71
|
+
approaches: [
|
|
72
|
+
{ value: 'evaluate', label: 'Evaluate', color: 'amber-500', icon: 'Search' },
|
|
73
|
+
{ value: 'collaborate', label: 'Collaborate', color: 'blue-500', icon: 'Users' },
|
|
74
|
+
{ value: 'plan', label: 'Plan', color: 'teal-500', icon: 'FileText' },
|
|
75
|
+
],
|
|
76
|
+
onUpdateApproaches: vi.fn(),
|
|
77
|
+
};
|
|
78
|
+
const defaultProps = {
|
|
79
|
+
settingsModel: defaultSettingsModel,
|
|
80
|
+
onSectionChange: vi.fn()
|
|
81
|
+
};
|
|
82
|
+
const renderComponent = (overrides = {}) => {
|
|
83
|
+
const { settingsModel: settingsModelOverrides = {}, ...rest } = overrides;
|
|
84
|
+
const mergedSettingsModel = {
|
|
85
|
+
...defaultSettingsModel,
|
|
86
|
+
...settingsModelOverrides
|
|
87
|
+
};
|
|
88
|
+
if (Object.prototype.hasOwnProperty.call(overrides, 'initialSection')) {
|
|
89
|
+
mergedSettingsModel.initialSection = overrides.initialSection;
|
|
90
|
+
}
|
|
91
|
+
const props = {
|
|
92
|
+
...defaultProps,
|
|
93
|
+
...rest,
|
|
94
|
+
settingsModel: mergedSettingsModel
|
|
95
|
+
};
|
|
96
|
+
return render(_jsx(TaskSettings, { ...props }));
|
|
97
|
+
};
|
|
98
|
+
it('4.1 Open settings - Renders correctly', () => {
|
|
99
|
+
renderComponent();
|
|
100
|
+
expect(screen.getByText('Project Settings')).toBeInTheDocument();
|
|
101
|
+
expect(screen.getByText('Taxonomies')).toBeInTheDocument();
|
|
102
|
+
});
|
|
103
|
+
it('4.2 Version shown', () => {
|
|
104
|
+
renderComponent();
|
|
105
|
+
expect(screen.getByText(/v\d+\.\d+\.\d+/)).toBeInTheDocument();
|
|
106
|
+
});
|
|
107
|
+
it('4.3 Theme toggle', async () => {
|
|
108
|
+
const user = userEvent.setup();
|
|
109
|
+
renderComponent();
|
|
110
|
+
const lightBtn = screen.getByRole('button', { name: /^light$/i });
|
|
111
|
+
await user.click(lightBtn);
|
|
112
|
+
expect(defaultSettingsModel.onThemeChange).toHaveBeenCalledWith('light');
|
|
113
|
+
expect(defaultSettingsModel.onSaveTheme).toHaveBeenCalledWith('light');
|
|
114
|
+
});
|
|
115
|
+
it('4.4 Theme persists', async () => {
|
|
116
|
+
const user = userEvent.setup();
|
|
117
|
+
// This tests that the callback is invoked, persistence is handled by parent
|
|
118
|
+
renderComponent();
|
|
119
|
+
const midnightBtn = screen.getByRole('button', { name: /^midnight$/i });
|
|
120
|
+
await user.click(midnightBtn);
|
|
121
|
+
expect(defaultSettingsModel.onThemeChange).toHaveBeenCalledWith('midnight');
|
|
122
|
+
expect(defaultSettingsModel.onSaveTheme).toHaveBeenCalledWith('midnight');
|
|
123
|
+
});
|
|
124
|
+
it('4.4b JSON backup toggle updates setting', async () => {
|
|
125
|
+
const user = userEvent.setup();
|
|
126
|
+
renderComponent();
|
|
127
|
+
const backupToggle = screen.getByRole('checkbox', { name: /enable automatic json backup/i });
|
|
128
|
+
await user.click(backupToggle);
|
|
129
|
+
expect(defaultSettingsModel.onJsonBackupEnabledChange).toHaveBeenCalledWith(true);
|
|
130
|
+
});
|
|
131
|
+
// 4.5 Open category manager - It's always visible in the new design
|
|
132
|
+
it('4.5 Categories section is visible', () => {
|
|
133
|
+
renderComponent({ initialSection: 'categories' });
|
|
134
|
+
expect(screen.getAllByText('Categories')[0]).toBeInTheDocument();
|
|
135
|
+
});
|
|
136
|
+
it('4.6 Add category', async () => {
|
|
137
|
+
const user = userEvent.setup();
|
|
138
|
+
renderComponent({ initialSection: 'categories' });
|
|
139
|
+
// Click create button
|
|
140
|
+
const createBtn = screen.getByTitle('Create new category');
|
|
141
|
+
await user.click(createBtn);
|
|
142
|
+
// Type name
|
|
143
|
+
const input = screen.getByPlaceholderText('e.g. Backend, Frontend, API...');
|
|
144
|
+
await user.type(input, 'Frontend');
|
|
145
|
+
// Click Create
|
|
146
|
+
const submitBtn = screen.getByRole('button', { name: 'Create' });
|
|
147
|
+
await user.click(submitBtn);
|
|
148
|
+
expect(defaultSettingsModel.onSaveCategory).toHaveBeenCalledWith('Frontend');
|
|
149
|
+
});
|
|
150
|
+
it('4.7 Rename category', async () => {
|
|
151
|
+
const user = userEvent.setup();
|
|
152
|
+
renderComponent({ initialSection: 'categories' });
|
|
153
|
+
// Select a category (using custom dropdown)
|
|
154
|
+
const dropdown = screen.getByText('Select a category to configure...').closest('button');
|
|
155
|
+
await user.click(dropdown);
|
|
156
|
+
const option = screen.getByText('Backend');
|
|
157
|
+
await user.click(option);
|
|
158
|
+
// Find label input - getByDisplayValue finds both option and input, so we filter
|
|
159
|
+
const elements = screen.getAllByDisplayValue('Backend');
|
|
160
|
+
const labelInput = elements.find(el => el.tagName === 'INPUT');
|
|
161
|
+
if (!labelInput)
|
|
162
|
+
throw new Error('Could not find input with value "Backend"');
|
|
163
|
+
await user.clear(labelInput);
|
|
164
|
+
await user.type(labelInput, 'Backend API');
|
|
165
|
+
await user.tab(); // Trigger blur
|
|
166
|
+
expect(defaultSettingsModel.onUpdateCategory).toHaveBeenCalledWith(expect.objectContaining({ label: 'Backend API' }), 'Backend');
|
|
167
|
+
});
|
|
168
|
+
it('4.8 Delete category', async () => {
|
|
169
|
+
// Mock window.confirm
|
|
170
|
+
vi.spyOn(window, 'confirm').mockImplementation(() => true);
|
|
171
|
+
const user = userEvent.setup();
|
|
172
|
+
renderComponent({ initialSection: 'categories' });
|
|
173
|
+
// Select category
|
|
174
|
+
const dropdown = screen.getByText('Select a category to configure...').closest('button');
|
|
175
|
+
await user.click(dropdown);
|
|
176
|
+
const option = screen.getByText('Backend');
|
|
177
|
+
await user.click(option);
|
|
178
|
+
// Click delete
|
|
179
|
+
const deleteBtn = screen.getByTitle('Delete Category');
|
|
180
|
+
await user.click(deleteBtn);
|
|
181
|
+
expect(defaultSettingsModel.onRemoveCategory).toHaveBeenCalledWith('backend');
|
|
182
|
+
});
|
|
183
|
+
it('4.9 Category icon', async () => {
|
|
184
|
+
const user = userEvent.setup();
|
|
185
|
+
renderComponent({ initialSection: 'categories' });
|
|
186
|
+
// Select category
|
|
187
|
+
const dropdown = screen.getByText('Select a category to configure...').closest('button');
|
|
188
|
+
await user.click(dropdown);
|
|
189
|
+
const option = screen.getByText('Backend');
|
|
190
|
+
await user.click(option);
|
|
191
|
+
// Click an icon (assuming some icons are rendered)
|
|
192
|
+
// We'll just look for one of the icon buttons
|
|
193
|
+
const iconBtn = screen.getByTitle('Bug'); // Assuming Bug is in AVAILABLE_ICONS
|
|
194
|
+
await user.click(iconBtn);
|
|
195
|
+
expect(defaultSettingsModel.onUpdateCategoryIcon).toHaveBeenCalledWith('backend', 'Bug');
|
|
196
|
+
});
|
|
197
|
+
it('4.10 Category color', async () => {
|
|
198
|
+
const user = userEvent.setup();
|
|
199
|
+
renderComponent({ initialSection: 'categories' });
|
|
200
|
+
// Select category
|
|
201
|
+
const dropdown = screen.getByText('Select a category to configure...').closest('button');
|
|
202
|
+
await user.click(dropdown);
|
|
203
|
+
const option = screen.getByText('Backend');
|
|
204
|
+
await user.click(option);
|
|
205
|
+
// Click a color swatch
|
|
206
|
+
const colorBtn = screen.getByTitle('green-500'); // Use color token
|
|
207
|
+
await user.click(colorBtn);
|
|
208
|
+
expect(defaultSettingsModel.onUpdateCategoryColor).toHaveBeenCalledWith('backend', 'green-500');
|
|
209
|
+
});
|
|
210
|
+
it('4.11 Context paths', async () => {
|
|
211
|
+
const user = userEvent.setup();
|
|
212
|
+
renderComponent({ initialSection: 'categories' });
|
|
213
|
+
// Select category
|
|
214
|
+
const dropdown = screen.getByText('Select a category to configure...').closest('button');
|
|
215
|
+
await user.click(dropdown);
|
|
216
|
+
const option = screen.getByText('Backend');
|
|
217
|
+
await user.click(option);
|
|
218
|
+
// Add path
|
|
219
|
+
const input = screen.getByPlaceholderText('Add path (e.g. frontend/src/...)');
|
|
220
|
+
await user.type(input, 'src/api');
|
|
221
|
+
const addBtn = screen.getByTitle('Add path');
|
|
222
|
+
await user.click(addBtn);
|
|
223
|
+
expect(defaultSettingsModel.onAddPath).toHaveBeenCalledWith('backend', 'src/api');
|
|
224
|
+
});
|
|
225
|
+
// 4.12 Open type manager - Always visible
|
|
226
|
+
it('4.12 Task Types section is visible', () => {
|
|
227
|
+
renderComponent({ initialSection: 'types' });
|
|
228
|
+
expect(screen.getAllByText('Task Types')[0]).toBeInTheDocument();
|
|
229
|
+
});
|
|
230
|
+
it('4.13 Add type', async () => {
|
|
231
|
+
const user = userEvent.setup();
|
|
232
|
+
renderComponent({ initialSection: 'types' });
|
|
233
|
+
// Find type section create button (it's the second "Create new..." button effectively, but inside TypeManager)
|
|
234
|
+
// Best to scope by container or find by unique attributes
|
|
235
|
+
const typeDropdown = screen.getByText('Select a type to configure...').closest('button');
|
|
236
|
+
await user.click(typeDropdown);
|
|
237
|
+
// Click create button next to types select
|
|
238
|
+
// We can find it by looking for the button with title "Create new type"
|
|
239
|
+
const createTypeBtn = screen.getByTitle('Create new type');
|
|
240
|
+
await user.click(createTypeBtn);
|
|
241
|
+
const input = screen.getByPlaceholderText('e.g. Bug, Feature, Chore...');
|
|
242
|
+
await user.type(input, 'Refactor');
|
|
243
|
+
const createBtn = screen.getByRole('button', { name: 'Create' });
|
|
244
|
+
await user.click(createBtn);
|
|
245
|
+
expect(defaultSettingsModel.onSaveType).toHaveBeenCalledWith('Refactor');
|
|
246
|
+
});
|
|
247
|
+
it('4.14 Delete type', async () => {
|
|
248
|
+
vi.spyOn(window, 'confirm').mockImplementation(() => true);
|
|
249
|
+
const user = userEvent.setup();
|
|
250
|
+
renderComponent({ initialSection: 'types' });
|
|
251
|
+
const dropdown = screen.getByText('Select a type to configure...').closest('button');
|
|
252
|
+
await user.click(dropdown);
|
|
253
|
+
const option = screen.getByText('Feature');
|
|
254
|
+
await user.click(option);
|
|
255
|
+
const deleteBtn = screen.getByTitle('Delete Type');
|
|
256
|
+
await user.click(deleteBtn);
|
|
257
|
+
expect(defaultSettingsModel.onRemoveType).toHaveBeenCalledWith('feature');
|
|
258
|
+
});
|
|
259
|
+
it('4.15 Export workflows', async () => {
|
|
260
|
+
const user = userEvent.setup();
|
|
261
|
+
renderComponent({ initialSection: 'commands' });
|
|
262
|
+
expect(screen.getByText('Commands')).toBeInTheDocument();
|
|
263
|
+
});
|
|
264
|
+
it('4.16 Export specialists', async () => {
|
|
265
|
+
const user = userEvent.setup();
|
|
266
|
+
renderComponent({ initialSection: 'agents' });
|
|
267
|
+
expect(screen.getByText('Agents')).toBeInTheDocument();
|
|
268
|
+
});
|
|
269
|
+
it('4.17 initialSection navigates to detail view', () => {
|
|
270
|
+
renderComponent({ initialSection: 'categories' });
|
|
271
|
+
// In detail view, Categories is shown in detailTitle
|
|
272
|
+
expect(screen.getByText('Categories')).toBeInTheDocument();
|
|
273
|
+
expect(screen.queryByText('System Taxonomies')).not.toBeInTheDocument();
|
|
274
|
+
});
|
|
275
|
+
it('4.18 documents tab opens and notifies section change', async () => {
|
|
276
|
+
const user = userEvent.setup();
|
|
277
|
+
const onSectionChange = vi.fn();
|
|
278
|
+
renderComponent({ onSectionChange });
|
|
279
|
+
await user.click(screen.getByRole('button', { name: /Documents/i }));
|
|
280
|
+
expect(onSectionChange).toHaveBeenCalledWith('documents');
|
|
281
|
+
});
|
|
282
|
+
it('4.19 document admin controls are not rendered in general tab', () => {
|
|
283
|
+
renderComponent();
|
|
284
|
+
expect(screen.queryByText('Document Storage (Admin)')).not.toBeInTheDocument();
|
|
285
|
+
});
|
|
286
|
+
it('4.20 Documents tab routes cloud system settings to app admin for authenticated users', async () => {
|
|
287
|
+
const fetchMock = vi.fn(async () => ({
|
|
288
|
+
ok: true,
|
|
289
|
+
json: async () => ({ objectStorage: { provider: 'r2' } })
|
|
290
|
+
}));
|
|
291
|
+
vi.stubGlobal('fetch', fetchMock);
|
|
292
|
+
const user = userEvent.setup();
|
|
293
|
+
renderComponent({ settingsModel: { isAuthenticated: true } });
|
|
294
|
+
await user.click(screen.getByRole('button', { name: /Documents/i }));
|
|
295
|
+
expect(await screen.findByDisplayValue('Cloud (R2)')).toBeInTheDocument();
|
|
296
|
+
expect(screen.getByText('Cloud Document Storage')).toBeInTheDocument();
|
|
297
|
+
expect(screen.getByText('System-level cloud storage and integrity controls are managed in App Admin.')).toBeInTheDocument();
|
|
298
|
+
expect(screen.getByRole('button', { name: 'Open App Admin' })).toBeInTheDocument();
|
|
299
|
+
vi.unstubAllGlobals();
|
|
300
|
+
});
|
|
301
|
+
it('4.21 Documents tab hides cloud controls when user is not signed in', async () => {
|
|
302
|
+
const user = userEvent.setup();
|
|
303
|
+
renderComponent({ settingsModel: { isAuthenticated: false } });
|
|
304
|
+
await user.click(screen.getByRole('button', { name: /Documents/i }));
|
|
305
|
+
expect(screen.getByText('Sign in to access cloud document storage controls in App Admin.')).toBeInTheDocument();
|
|
306
|
+
expect(screen.queryByRole('button', { name: 'Open App Admin' })).not.toBeInTheDocument();
|
|
307
|
+
});
|
|
308
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { CategoryConfig } from '../../../types';
|
|
2
|
+
interface CategoryManagerProps {
|
|
3
|
+
categories: CategoryConfig[];
|
|
4
|
+
pathValidation: Record<string, {
|
|
5
|
+
exists: boolean;
|
|
6
|
+
isDirectory: boolean;
|
|
7
|
+
isFile: boolean;
|
|
8
|
+
}>;
|
|
9
|
+
onUpdateCategory: (category: CategoryConfig, oldLabel?: string) => void;
|
|
10
|
+
onRemoveCategory: (value: string) => void;
|
|
11
|
+
onSaveCategory: (newCategory: string) => void;
|
|
12
|
+
onAddPath: (catValue: string, path: string) => void;
|
|
13
|
+
onRemovePath: (catValue: string, path: string) => void;
|
|
14
|
+
onUpdateCategoryIcon: (catValue: string, iconName: string) => void;
|
|
15
|
+
onUpdateCategoryColor: (catValue: string, color: string) => void;
|
|
16
|
+
onBrowseFolders: (catValue: string) => void;
|
|
17
|
+
}
|
|
18
|
+
export declare function CategoryManager(props: CategoryManagerProps): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState, useEffect } from 'react';
|
|
3
|
+
import { Plus, X, FolderOpen, AlertTriangle, Loader2, FileText, Folder, Trash2 } from 'lucide-react';
|
|
4
|
+
import styles from '../../../Taskforce.module.css';
|
|
5
|
+
import { IconMap, AVAILABLE_ICONS, PALETTE_ORDER, resolveColor } from '../../../utils/constants';
|
|
6
|
+
import { TaxonomyDropdown } from '../../ui/TaxonomyDropdown';
|
|
7
|
+
export function CategoryManager(props) {
|
|
8
|
+
const { categories, pathValidation, onUpdateCategory, onRemoveCategory, onSaveCategory, onAddPath, onRemovePath, onUpdateCategoryIcon, onUpdateCategoryColor, onBrowseFolders } = props;
|
|
9
|
+
const [selectedCategoryValue, setSelectedCategoryValue] = useState('');
|
|
10
|
+
const [isCreating, setIsCreating] = useState(false);
|
|
11
|
+
const [newCategoryName, setNewCategoryName] = useState('');
|
|
12
|
+
const [editingLabel, setEditingLabel] = useState('');
|
|
13
|
+
const [newPathInput, setNewPathInput] = useState('');
|
|
14
|
+
// Sync editing label when selection changes
|
|
15
|
+
useEffect(() => {
|
|
16
|
+
const cat = categories.find(c => c.value === selectedCategoryValue);
|
|
17
|
+
if (cat) {
|
|
18
|
+
setEditingLabel(cat.label);
|
|
19
|
+
}
|
|
20
|
+
}, [selectedCategoryValue, categories]);
|
|
21
|
+
const handleSaveNewCategory = () => {
|
|
22
|
+
if (!newCategoryName.trim())
|
|
23
|
+
return;
|
|
24
|
+
onSaveCategory(newCategoryName);
|
|
25
|
+
// We can't immediately select it because we don't know the generated ID easily without return,
|
|
26
|
+
// but typically it's name-based.
|
|
27
|
+
// Ideally we'd select it after creation, but for now we'll just close creation mode
|
|
28
|
+
// and let user select it (or try to predict ID).
|
|
29
|
+
const predictedId = newCategoryName.trim().toLowerCase().replace(/\s+/g, '-');
|
|
30
|
+
setNewCategoryName('');
|
|
31
|
+
setIsCreating(false);
|
|
32
|
+
// Attempt to select the new category in next render if it appears?
|
|
33
|
+
// For simplicity, just reset. User sees it in dropdown.
|
|
34
|
+
setTimeout(() => setSelectedCategoryValue(predictedId), 100);
|
|
35
|
+
};
|
|
36
|
+
const handleRename = (cat) => {
|
|
37
|
+
if (editingLabel && editingLabel !== cat.label) {
|
|
38
|
+
onUpdateCategory({ ...cat, label: editingLabel }, cat.label);
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
const getCategoryPaths = (cat) => {
|
|
42
|
+
const paths = [];
|
|
43
|
+
if (cat.path)
|
|
44
|
+
paths.push(cat.path);
|
|
45
|
+
if (cat.paths && cat.paths.length > 0) {
|
|
46
|
+
for (const p of cat.paths) {
|
|
47
|
+
if (!paths.includes(p))
|
|
48
|
+
paths.push(p);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return paths;
|
|
52
|
+
};
|
|
53
|
+
const selectedCategory = categories.find(c => c.value === selectedCategoryValue);
|
|
54
|
+
return (_jsxs("div", { className: `${styles.configPanel} ${styles.flex1}`, children: [_jsxs("div", { className: `${styles.headerFlex}`, style: { marginBottom: (selectedCategory && !isCreating) || isCreating ? '20px' : '0' }, children: [_jsxs("div", { style: { flex: 1 }, children: [_jsx("label", { id: "category-config-label", className: styles.label, style: { display: 'none' }, children: "Select Category" }), _jsx(TaxonomyDropdown, { value: selectedCategoryValue, options: [
|
|
55
|
+
{ value: "", label: "Select a category to configure...", icon: "HelpCircle", color: "var(--text-secondary)" },
|
|
56
|
+
...categories.map(c => ({
|
|
57
|
+
value: c.value,
|
|
58
|
+
label: `${c.label}${c.disabled ? ' (Disabled)' : ''}`,
|
|
59
|
+
icon: c.icon,
|
|
60
|
+
color: c.color
|
|
61
|
+
}))
|
|
62
|
+
], onChange: (value) => {
|
|
63
|
+
setSelectedCategoryValue(String(value));
|
|
64
|
+
setIsCreating(false);
|
|
65
|
+
}, disabled: isCreating, ariaLabelledBy: "category-config-label" })] }), !isCreating ? (_jsx("button", { type: "button", className: styles.browseBtn, onClick: () => setIsCreating(true), title: "Create new category", children: _jsx(Plus, { size: 18 }) })) : (_jsx("button", { type: "button", className: `${styles.browseBtn} ${styles.cancelBtnRed}`, onClick: () => setIsCreating(false), title: "Cancel creation", children: _jsx(X, { size: 18 }) }))] }), isCreating && (_jsxs("div", { className: `${styles.configItem} ${styles.marginBottom16}`, children: [_jsx("div", { className: `${styles.labelRow} ${styles.marginBottom8}`, children: _jsx("label", { className: styles.settingsLabel, children: "New Category Name" }) }), _jsxs("div", { style: { display: 'flex', gap: '8px' }, children: [_jsx("input", { type: "text", className: styles.input, placeholder: "e.g. Backend, Frontend, API...", value: newCategoryName, onChange: (e) => setNewCategoryName(e.target.value), onKeyDown: (e) => {
|
|
66
|
+
if (e.key === 'Enter')
|
|
67
|
+
handleSaveNewCategory();
|
|
68
|
+
}, autoFocus: true }), _jsx("button", { type: "button", className: styles.saveSettingsBtn, onClick: handleSaveNewCategory, disabled: !newCategoryName.trim(), children: "Create" })] })] })), selectedCategory && !isCreating && (_jsxs("div", { className: styles.flex1, style: { overflowY: 'auto', marginRight: '-8px', paddingRight: '8px' }, children: [_jsx("div", { className: `${styles.configDivider} ${styles.marginBottom20}` }), _jsxs("div", { className: `${styles.configSection} ${styles.marginBottom20}`, children: [_jsxs("div", { className: styles.flexBetween, children: [_jsx("label", { className: `${styles.subLabel} ${styles.subLabelBlock}`, children: "General" }), _jsxs("button", { type: "button", onClick: () => {
|
|
69
|
+
if (confirm(`Delete category "${selectedCategory.label}"?`)) {
|
|
70
|
+
onRemoveCategory(selectedCategory.value);
|
|
71
|
+
setSelectedCategoryValue('');
|
|
72
|
+
}
|
|
73
|
+
}, title: "Delete Category", className: `${styles.destructiveBtn} ${styles.deleteBtnSmall}`, children: [_jsx(Trash2, { size: 14, className: styles.trashIcon }), " Delete"] })] }), _jsxs("div", { className: styles.gridConfig, children: [_jsxs("div", { className: styles.flexColGap4, children: [_jsx("label", { className: `${styles.label} ${styles.inputLabel}`, children: "Label" }), _jsx("input", { className: styles.input, value: editingLabel, onChange: (e) => setEditingLabel(e.target.value), onBlur: () => handleRename(selectedCategory), onKeyDown: (e) => {
|
|
74
|
+
if (e.key === 'Enter') {
|
|
75
|
+
handleRename(selectedCategory);
|
|
76
|
+
e.target.blur();
|
|
77
|
+
}
|
|
78
|
+
} })] }), _jsxs("div", { className: styles.flexColGap4Center, children: [_jsx("label", { className: `${styles.label} ${styles.inputLabel}`, children: "Visible" }), _jsx("input", { type: "checkbox", checked: !selectedCategory.disabled, onChange: () => onUpdateCategory({ ...selectedCategory, disabled: !selectedCategory.disabled }), className: styles.checkboxInput })] })] })] }), _jsx("div", { className: `${styles.configDivider} ${styles.configDividerMargin}` }), _jsxs("div", { className: `${styles.configSection} ${styles.marginBottom20}`, children: [_jsx("label", { className: styles.subLabel, style: { fontSize: '14px', fontWeight: 600, display: 'block', marginBottom: '8px' }, children: "Context Paths" }), _jsx("p", { className: styles.settingsHint, style: { marginBottom: '12px' }, children: "Files in these paths will be included as context for tasks in this category." }), getCategoryPaths(selectedCategory).length > 0 && (_jsx("div", { className: `${styles.pathList} ${styles.pathListMargin}`, children: getCategoryPaths(selectedCategory).map((p, idx) => {
|
|
79
|
+
const validation = pathValidation[p];
|
|
80
|
+
const isValid = validation?.exists;
|
|
81
|
+
const isFile = validation?.isFile;
|
|
82
|
+
return (_jsxs("div", { className: `${styles.pathChip} ${isValid === false ? styles.pathInvalid : isValid ? styles.pathValid : ''}`, children: [isValid === undefined ? (_jsx(Loader2, { size: 12, className: styles.spinner })) : isValid ? (isFile ? _jsx(FileText, { size: 12, className: styles.pathValidIcon }) : _jsx(FolderOpen, { size: 12, className: styles.pathValidIcon })) : (_jsx(AlertTriangle, { size: 12, className: styles.pathInvalidIcon })), _jsx("span", { className: styles.pathText, title: p, children: p }), _jsx("button", { type: "button", className: styles.removePathBtn, onClick: () => onRemovePath(selectedCategory.value, p), title: "Remove path", children: _jsx(X, { size: 10 }) })] }, idx));
|
|
83
|
+
}) })), _jsxs("div", { className: `${styles.pathInputGroup} ${styles.pathInputGroupStretch}`, children: [_jsx("input", { type: "text", className: styles.input, value: newPathInput, onChange: (e) => setNewPathInput(e.target.value), onKeyDown: (e) => {
|
|
84
|
+
if (e.key === 'Enter') {
|
|
85
|
+
e.preventDefault();
|
|
86
|
+
if (newPathInput.trim()) {
|
|
87
|
+
onAddPath(selectedCategory.value, newPathInput.trim());
|
|
88
|
+
setNewPathInput('');
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}, placeholder: "Add path (e.g. frontend/src/...)" }), _jsx("button", { type: "button", className: styles.browseBtn, onClick: () => {
|
|
92
|
+
if (newPathInput.trim()) {
|
|
93
|
+
onAddPath(selectedCategory.value, newPathInput.trim());
|
|
94
|
+
setNewPathInput('');
|
|
95
|
+
}
|
|
96
|
+
}, disabled: !newPathInput.trim(), title: "Add path", children: _jsx(Plus, { size: 18 }) }), _jsx("button", { type: "button", className: styles.browseBtn, onClick: () => onBrowseFolders(selectedCategory.value), title: "Browse folders", children: _jsx(FolderOpen, { size: 16 }) })] })] }), _jsx("div", { className: `${styles.configDivider} ${styles.configDividerMargin}` }), _jsxs("div", { className: styles.configSection, children: [_jsx("label", { className: `${styles.subLabel} ${styles.subLabelBlock} ${styles.subLabelBlock12}`, children: "Visual Style" }), _jsxs("div", { className: styles.categorySubConfig, children: [_jsx("div", { className: styles.colorPickerGrid, children: PALETTE_ORDER.map(colorToken => {
|
|
97
|
+
const resolvedColor = resolveColor(colorToken) || '#000000';
|
|
98
|
+
const isActive = selectedCategory.color === colorToken;
|
|
99
|
+
const IconComp = selectedCategory.icon && IconMap[selectedCategory.icon] ? IconMap[selectedCategory.icon] : Folder;
|
|
100
|
+
return (_jsx("button", { type: "button", className: `${styles.colorSwatch} ${isActive ? styles.colorSwatchActive : ''}`, style: {
|
|
101
|
+
borderColor: isActive ? resolvedColor : undefined,
|
|
102
|
+
'--swatch-color': resolvedColor,
|
|
103
|
+
'--swatch-border-color': `${resolvedColor}80`
|
|
104
|
+
}, onClick: () => onUpdateCategoryColor(selectedCategory.value, colorToken), title: colorToken, children: _jsx(IconComp, { size: 14, style: { color: resolvedColor } }) }, colorToken));
|
|
105
|
+
}) }), _jsx("div", { className: styles.iconGrid, children: AVAILABLE_ICONS.map(iconName => {
|
|
106
|
+
const IconComp = IconMap[iconName];
|
|
107
|
+
return (_jsx("button", { type: "button", className: `${styles.iconPickerBtn} ${selectedCategory.icon === iconName ? styles.iconPickerBtnActive : ''}`, style: selectedCategory.icon === iconName ? {
|
|
108
|
+
borderColor: resolveColor(selectedCategory.color),
|
|
109
|
+
color: resolveColor(selectedCategory.color),
|
|
110
|
+
background: `${resolveColor(selectedCategory.color)}15`
|
|
111
|
+
} : {}, onClick: () => onUpdateCategoryIcon(selectedCategory.value, iconName), title: iconName, children: _jsx(IconComp, { size: 16 }) }, iconName));
|
|
112
|
+
}) })] })] })] })), !selectedCategory && !isCreating && (_jsx("div", { className: styles.emptyStateItalic, style: { border: 'none', background: 'transparent' }, children: "Select a category above to configure settings" }))] }));
|
|
113
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { TaxonomyDefinition } from '../../../types';
|
|
2
|
+
interface TaxonomyEditorProps {
|
|
3
|
+
taxonomy: TaxonomyDefinition;
|
|
4
|
+
onUpdateTaxonomy: (taxonomy: TaxonomyDefinition) => void;
|
|
5
|
+
onRemoveTaxonomy?: (id: string) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare function TaxonomyEditor({ taxonomy, onUpdateTaxonomy, onRemoveTaxonomy }: TaxonomyEditorProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState, useEffect } from 'react';
|
|
3
|
+
import * as Icons from 'lucide-react';
|
|
4
|
+
import { Plus, X, Trash2, Box, Info } from 'lucide-react';
|
|
5
|
+
import styles from '../../../Taskforce.module.css';
|
|
6
|
+
import { IconMap, AVAILABLE_ICONS, PALETTE_ORDER, resolveColor } from '../../../utils/constants';
|
|
7
|
+
import { TaxonomyDropdown } from '../../ui/TaxonomyDropdown';
|
|
8
|
+
export function TaxonomyEditor({ taxonomy, onUpdateTaxonomy, onRemoveTaxonomy }) {
|
|
9
|
+
const [selectedOptionValue, setSelectedOptionValue] = useState('');
|
|
10
|
+
const [isCreatingOption, setIsCreatingOption] = useState(false);
|
|
11
|
+
const [newOptionLabel, setNewOptionLabel] = useState('');
|
|
12
|
+
const [editingLabel, setEditingLabel] = useState(taxonomy.label);
|
|
13
|
+
const [editingOption, setEditingOption] = useState(null);
|
|
14
|
+
// Update internal state when taxonomy changes
|
|
15
|
+
useEffect(() => {
|
|
16
|
+
setEditingLabel(taxonomy.label);
|
|
17
|
+
const opt = taxonomy.options.find(o => String(o.value) === String(selectedOptionValue));
|
|
18
|
+
setEditingOption(opt || null);
|
|
19
|
+
}, [taxonomy, selectedOptionValue]);
|
|
20
|
+
const handleUpdateTaxonomy = (updates) => {
|
|
21
|
+
onUpdateTaxonomy({ ...taxonomy, ...updates });
|
|
22
|
+
};
|
|
23
|
+
const handleAddOption = () => {
|
|
24
|
+
if (!newOptionLabel.trim())
|
|
25
|
+
return;
|
|
26
|
+
const value = newOptionLabel.toLowerCase().trim().replace(/\s+/g, '-');
|
|
27
|
+
if (taxonomy.options.some(o => o.value === value)) {
|
|
28
|
+
alert('Option value already exists');
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
const newOption = {
|
|
32
|
+
value,
|
|
33
|
+
label: newOptionLabel.trim(),
|
|
34
|
+
color: PALETTE_ORDER[taxonomy.options.length % PALETTE_ORDER.length]
|
|
35
|
+
};
|
|
36
|
+
handleUpdateTaxonomy({
|
|
37
|
+
options: [...taxonomy.options, newOption]
|
|
38
|
+
});
|
|
39
|
+
setNewOptionLabel('');
|
|
40
|
+
setIsCreatingOption(false);
|
|
41
|
+
setSelectedOptionValue(value);
|
|
42
|
+
};
|
|
43
|
+
const handleUpdateOption = (optionValue, updates) => {
|
|
44
|
+
handleUpdateTaxonomy({
|
|
45
|
+
options: taxonomy.options.map(o => String(o.value) === String(optionValue) ? { ...o, ...updates } : o)
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
const handleRemoveOption = (optionValue) => {
|
|
49
|
+
if (confirm('Are you sure you want to remove this option?')) {
|
|
50
|
+
handleUpdateTaxonomy({
|
|
51
|
+
options: taxonomy.options.filter(o => String(o.value) !== String(optionValue))
|
|
52
|
+
});
|
|
53
|
+
setSelectedOptionValue('');
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
return (_jsxs("div", { className: styles.categoryManagerContainer, children: [_jsxs("div", { className: `${styles.categoryConfigPanel} ${styles.configPanel} ${styles.marginBottom24}`, children: [_jsxs("div", { className: `${styles.flexBetween} ${styles.marginBottom16}`, children: [_jsx("div", { className: styles.flex1, children: _jsx("label", { className: `${styles.subLabel} ${styles.subLabelBlock} ${styles.marginBottom8}`, children: "Taxonomy Settings" }) }), !taxonomy.isSystem && onRemoveTaxonomy && (_jsxs("button", { type: "button", className: `${styles.destructiveBtn} ${styles.deleteBtnSmall}`, onClick: () => {
|
|
57
|
+
if (confirm(`Delete taxonomy "${taxonomy.label}"? All associated data will be hidden.`)) {
|
|
58
|
+
onRemoveTaxonomy(taxonomy.id);
|
|
59
|
+
}
|
|
60
|
+
}, children: [_jsx(Trash2, { size: 14, className: styles.trashIcon }), " Delete Taxonomy"] }))] }), _jsxs("div", { className: styles.taxonomyGrid, children: [_jsxs("div", { className: styles.settingGroup, style: { margin: 0 }, children: [_jsx("label", { className: `${styles.label} ${styles.inputLabel}`, children: "Display Label" }), _jsx("input", { className: styles.input, value: editingLabel, onChange: (e) => setEditingLabel(e.target.value), onBlur: () => handleUpdateTaxonomy({ label: editingLabel }), disabled: taxonomy.isSystem, placeholder: "e.g. Sprint, Phase..." })] }), _jsxs("div", { className: styles.settingGroup, style: { margin: 0 }, children: [_jsx("label", { className: `${styles.label} ${styles.inputLabel}`, children: "Widget Type" }), _jsxs("select", { className: styles.select, value: taxonomy.widgetType, onChange: (e) => {
|
|
61
|
+
const newType = e.target.value;
|
|
62
|
+
handleUpdateTaxonomy({
|
|
63
|
+
widgetType: newType,
|
|
64
|
+
// Levels are typically single select
|
|
65
|
+
multiSelect: newType === 'level' ? false : taxonomy.multiSelect
|
|
66
|
+
});
|
|
67
|
+
}, children: [_jsx("option", { value: "select", children: "Dropdown (Select Box)" }), _jsx("option", { value: "level", children: "Level Selector (Segmented)" })] })] })] }), _jsxs("div", { className: styles.checkboxRow, children: [_jsxs("label", { className: styles.checkboxLabel, children: [_jsx("input", { type: "checkbox", checked: taxonomy.isRequired, onChange: (e) => handleUpdateTaxonomy({ isRequired: e.target.checked }), className: styles.checkboxSmall }), "Mark as Required"] }), _jsxs("label", { className: `${styles.checkboxLabel} ${taxonomy.widgetType === 'level' ? styles.opacity50 : ''}`, children: [_jsx("input", { type: "checkbox", checked: taxonomy.multiSelect, onChange: (e) => handleUpdateTaxonomy({ multiSelect: e.target.checked }), disabled: taxonomy.widgetType === 'level', className: styles.checkboxSmall }), "Allow Multi-select"] })] })] }), _jsx("div", { className: `${styles.configDivider} ${styles.configDividerMargin24}` }), _jsxs("div", { className: `${styles.configPanel} ${styles.flex1} ${styles.flexCol}`, children: [_jsxs("div", { className: `${styles.headerFlex}`, style: { marginBottom: (editingOption && !isCreatingOption) || isCreatingOption ? '16px' : '0' }, children: [_jsx("div", { style: { flex: 1 }, children: _jsx(TaxonomyDropdown, { value: selectedOptionValue, options: [
|
|
68
|
+
{ value: "", label: "Select an option to configure...", icon: "HelpCircle", color: "var(--text-secondary)" },
|
|
69
|
+
...taxonomy.options.map(o => ({
|
|
70
|
+
value: o.value,
|
|
71
|
+
label: o.label,
|
|
72
|
+
icon: o.icon,
|
|
73
|
+
color: o.color
|
|
74
|
+
}))
|
|
75
|
+
], onChange: (value) => {
|
|
76
|
+
setSelectedOptionValue(value);
|
|
77
|
+
setIsCreatingOption(false);
|
|
78
|
+
}, disabled: isCreatingOption }) }), !isCreatingOption ? (_jsx("button", { type: "button", className: styles.browseBtn, onClick: () => setIsCreatingOption(true), title: "Add Option", children: _jsx(Plus, { size: 18 }) })) : (_jsx("button", { type: "button", onClick: () => setIsCreatingOption(false), title: "Cancel", className: `${styles.browseBtn} ${styles.cancelBtnRed}`, children: _jsx(X, { size: 18 }) }))] }), isCreatingOption && (_jsx("div", { className: `${styles.configItem} ${styles.marginBottom16}`, children: _jsxs("div", { className: styles.flexGap8, children: [_jsx("input", { type: "text", className: styles.input, placeholder: "New option label...", value: newOptionLabel, onChange: (e) => setNewOptionLabel(e.target.value), onKeyDown: (e) => {
|
|
79
|
+
if (e.key === 'Enter')
|
|
80
|
+
handleAddOption();
|
|
81
|
+
}, autoFocus: true }), _jsx("button", { type: "button", className: styles.saveSettingsBtn, onClick: handleAddOption, disabled: !newOptionLabel.trim(), children: "Add Option" })] }) })), editingOption && !isCreatingOption && (_jsxs("div", { className: styles.flex1, children: [_jsx("div", { className: `${styles.configDivider} ${styles.marginBottom20}` }), _jsx("div", { className: `${styles.flexBetweenCenter} ${styles.marginBottom20}`, children: _jsxs("div", { className: `${styles.flexColGap4} ${styles.flex1}`, children: [_jsx("label", { className: `${styles.label} ${styles.inputLabel}`, children: "Option Label" }), _jsxs("div", { className: styles.gridConfig, children: [_jsx("input", { className: styles.input, value: editingOption.label, onChange: (e) => handleUpdateOption(editingOption.value, { label: e.target.value }), placeholder: "Option Label" }), _jsxs("button", { type: "button", className: `${styles.destructiveBtn} ${styles.deleteBtnMedium}`, onClick: () => handleRemoveOption(editingOption.value), title: "Delete Option", children: [_jsx(Trash2, { size: 14, className: styles.trashIcon }), " Delete"] })] })] }) }), _jsx("div", { className: `${styles.configDivider} ${styles.configDividerMargin}` }), _jsxs("div", { className: styles.configSection, children: [_jsx("label", { className: `${styles.label} ${styles.inputLabelBlock}`, children: "Visual Style" }), _jsxs("div", { className: styles.categorySubConfig, children: [_jsx("div", { className: styles.colorPickerGrid, children: PALETTE_ORDER.map(colorToken => {
|
|
82
|
+
const resolvedColor = resolveColor(colorToken) || '#000000';
|
|
83
|
+
const isActive = editingOption.color === colorToken;
|
|
84
|
+
const IconComp = editingOption.icon && Icons[editingOption.icon] ? Icons[editingOption.icon] : Box;
|
|
85
|
+
return (_jsx("button", { type: "button", className: `${styles.colorSwatch} ${isActive ? styles.colorSwatchActive : ''}`, style: {
|
|
86
|
+
borderColor: isActive ? resolvedColor : undefined,
|
|
87
|
+
'--swatch-color': resolvedColor,
|
|
88
|
+
'--swatch-border-color': `${resolvedColor}80`
|
|
89
|
+
}, onClick: () => handleUpdateOption(editingOption.value, { color: colorToken }), title: colorToken, children: _jsx(IconComp, { size: 14, style: { color: resolvedColor } }) }, colorToken));
|
|
90
|
+
}) }), _jsx("div", { className: styles.iconGrid, children: AVAILABLE_ICONS.map(iconName => {
|
|
91
|
+
const IconComp = Icons[iconName] || IconMap[iconName] || Box;
|
|
92
|
+
return (_jsx("button", { type: "button", className: `${styles.iconPickerBtn} ${editingOption.icon === iconName ? styles.iconPickerBtnActive : ''}`, style: editingOption.icon === iconName ? {
|
|
93
|
+
borderColor: resolveColor(editingOption.color),
|
|
94
|
+
color: resolveColor(editingOption.color),
|
|
95
|
+
background: `${resolveColor(editingOption.color)}15`
|
|
96
|
+
} : {}, onClick: () => handleUpdateOption(editingOption.value, { icon: iconName }), title: iconName, children: _jsx(IconComp, { size: 16 }) }, iconName));
|
|
97
|
+
}) })] })] })] })), !editingOption && !isCreatingOption && (_jsxs("div", { className: styles.emptyStateBox, style: { border: 'none', background: 'transparent' }, children: [_jsx(Info, { size: 24, className: styles.emptyStateIcon }), "Select an option above to configure its appearance"] }))] })] }));
|
|
98
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { TaxonomyDefinition, CategoryConfig } from '../../../types';
|
|
2
|
+
interface TaxonomyManagerProps {
|
|
3
|
+
taxonomies: TaxonomyDefinition[];
|
|
4
|
+
onUpdateTaxonomies: (taxonomies: TaxonomyDefinition[]) => void;
|
|
5
|
+
categories: CategoryConfig[];
|
|
6
|
+
pathValidation: Record<string, {
|
|
7
|
+
exists: boolean;
|
|
8
|
+
isDirectory: boolean;
|
|
9
|
+
isFile: boolean;
|
|
10
|
+
}>;
|
|
11
|
+
onUpdateCategory: (category: CategoryConfig, oldLabel?: string) => void;
|
|
12
|
+
onRemoveCategory: (value: string) => void;
|
|
13
|
+
onSaveCategory: (newCategory: string) => void;
|
|
14
|
+
onAddPath: (catValue: string, path: string) => void;
|
|
15
|
+
onRemovePath: (catValue: string, path: string) => void;
|
|
16
|
+
onUpdateCategoryIcon: (catValue: string, iconName: string) => void;
|
|
17
|
+
onUpdateCategoryColor: (catValue: string, color: string) => void;
|
|
18
|
+
onBrowseFolders: (catValue: string) => void;
|
|
19
|
+
types: {
|
|
20
|
+
value: string;
|
|
21
|
+
label: string;
|
|
22
|
+
}[];
|
|
23
|
+
onSaveType: (label: string) => void;
|
|
24
|
+
onRemoveType: (value: string) => void;
|
|
25
|
+
priorities: Array<{
|
|
26
|
+
value: number;
|
|
27
|
+
label: string;
|
|
28
|
+
color?: string;
|
|
29
|
+
icon?: string;
|
|
30
|
+
}>;
|
|
31
|
+
onUpdatePriorities: (priorities: Array<{
|
|
32
|
+
value: number;
|
|
33
|
+
label: string;
|
|
34
|
+
color?: string;
|
|
35
|
+
icon?: string;
|
|
36
|
+
}>) => void;
|
|
37
|
+
approaches: Array<{
|
|
38
|
+
value: string;
|
|
39
|
+
label: string;
|
|
40
|
+
color?: string;
|
|
41
|
+
icon?: string;
|
|
42
|
+
}>;
|
|
43
|
+
onUpdateApproaches: (approaches: Array<{
|
|
44
|
+
value: string;
|
|
45
|
+
label: string;
|
|
46
|
+
color?: string;
|
|
47
|
+
icon?: string;
|
|
48
|
+
}>) => void;
|
|
49
|
+
initialTab?: 'categories' | 'types' | 'priorities' | 'complexities' | 'approaches' | null;
|
|
50
|
+
}
|
|
51
|
+
export declare function TaxonomyManager(props: TaxonomyManagerProps): import("react/jsx-runtime").JSX.Element;
|
|
52
|
+
export {};
|