@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,94 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import ReactMarkdown from 'react-markdown';
|
|
4
|
+
import remarkGfm from 'remark-gfm';
|
|
5
|
+
import remarkBreaks from 'remark-breaks';
|
|
6
|
+
import styles from '../../Taskforce.module.css';
|
|
7
|
+
import { parseChecklistLines } from '../../utils/checklistMarkdown';
|
|
8
|
+
export const Markdown = ({ children, className, onChecklistToggle, onTaskIdClick }) => {
|
|
9
|
+
if (!children)
|
|
10
|
+
return null;
|
|
11
|
+
const parsedChecklist = parseChecklistLines(children || '');
|
|
12
|
+
let checklistRenderIndex = 0;
|
|
13
|
+
const isTaskListChildren = (nodeChildren) => {
|
|
14
|
+
const childArray = React.Children.toArray(nodeChildren);
|
|
15
|
+
return childArray.some((child) => {
|
|
16
|
+
if (!React.isValidElement(child))
|
|
17
|
+
return false;
|
|
18
|
+
const className = String(child.props?.className || '');
|
|
19
|
+
return className.includes('task-list-item');
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
const taskIdPattern = /\b(task-\d{10,}-[a-z0-9]+)\b/gi;
|
|
23
|
+
const linkifyTaskIds = (node) => {
|
|
24
|
+
if (!onTaskIdClick)
|
|
25
|
+
return node;
|
|
26
|
+
if (typeof node === 'string') {
|
|
27
|
+
const matches = Array.from(node.matchAll(taskIdPattern));
|
|
28
|
+
if (!matches.length)
|
|
29
|
+
return node;
|
|
30
|
+
const output = [];
|
|
31
|
+
let cursor = 0;
|
|
32
|
+
for (let i = 0; i < matches.length; i += 1) {
|
|
33
|
+
const match = matches[i];
|
|
34
|
+
const id = match[1];
|
|
35
|
+
const start = match.index ?? -1;
|
|
36
|
+
if (start < cursor)
|
|
37
|
+
continue;
|
|
38
|
+
if (start > cursor)
|
|
39
|
+
output.push(node.slice(cursor, start));
|
|
40
|
+
output.push(_jsx("button", { type: "button", className: styles.taskIdInlineLink, onClick: (e) => {
|
|
41
|
+
e.preventDefault();
|
|
42
|
+
e.stopPropagation();
|
|
43
|
+
onTaskIdClick(id);
|
|
44
|
+
}, children: id }, `${id}-${start}-${i}`));
|
|
45
|
+
cursor = start + id.length;
|
|
46
|
+
}
|
|
47
|
+
if (cursor < node.length)
|
|
48
|
+
output.push(node.slice(cursor));
|
|
49
|
+
return output;
|
|
50
|
+
}
|
|
51
|
+
if (Array.isArray(node))
|
|
52
|
+
return node.map(linkifyTaskIds);
|
|
53
|
+
if (!React.isValidElement(node))
|
|
54
|
+
return node;
|
|
55
|
+
const type = typeof node.type === 'string' ? node.type : '';
|
|
56
|
+
if (type === 'code' || type === 'pre' || type === 'a')
|
|
57
|
+
return node;
|
|
58
|
+
const childNodes = node.props?.children;
|
|
59
|
+
if (childNodes === undefined)
|
|
60
|
+
return node;
|
|
61
|
+
return React.cloneElement(node, {}, React.Children.map(childNodes, linkifyTaskIds));
|
|
62
|
+
};
|
|
63
|
+
return (_jsx("div", { className: className, children: _jsx(ReactMarkdown, { remarkPlugins: [remarkGfm, remarkBreaks], components: {
|
|
64
|
+
p: ({ children }) => _jsx("p", { children: linkifyTaskIds(children) }),
|
|
65
|
+
ul: ({ children }) => (_jsx("ul", { style: isTaskListChildren(children) ? { paddingLeft: 0 } : undefined, children: children })),
|
|
66
|
+
li: ({ children, className }) => {
|
|
67
|
+
const isTaskListItem = String(className || '').includes('task-list-item');
|
|
68
|
+
return (_jsx("li", { className: className, style: isTaskListItem ? { listStyle: 'none' } : undefined, children: linkifyTaskIds(children) }));
|
|
69
|
+
},
|
|
70
|
+
input: ({ type, checked }) => {
|
|
71
|
+
if (type !== 'checkbox')
|
|
72
|
+
return _jsx("input", { type: type, checked: checked, readOnly: true });
|
|
73
|
+
const currentChecklistItem = parsedChecklist[checklistRenderIndex];
|
|
74
|
+
checklistRenderIndex += 1;
|
|
75
|
+
const isInteractive = Boolean(onChecklistToggle && currentChecklistItem);
|
|
76
|
+
return (_jsx("input", { type: "checkbox", checked: Boolean(checked), readOnly: !isInteractive, onClick: (e) => {
|
|
77
|
+
if (!isInteractive || !currentChecklistItem)
|
|
78
|
+
return;
|
|
79
|
+
e.stopPropagation();
|
|
80
|
+
onChecklistToggle?.(currentChecklistItem.lineIndex, !Boolean(checked));
|
|
81
|
+
}, style: { cursor: isInteractive ? 'pointer' : 'default', marginRight: 8 } }));
|
|
82
|
+
},
|
|
83
|
+
code: ({ children, className, ...props }) => {
|
|
84
|
+
const content = String(children || '').replace(/\n$/, '');
|
|
85
|
+
const hasLanguage = /language-(\w+)/.test(className || '');
|
|
86
|
+
// It's a block if it has a language tag OR if it contains multiple lines
|
|
87
|
+
const isBlock = hasLanguage || content.includes('\n');
|
|
88
|
+
if (isBlock) {
|
|
89
|
+
return (_jsx("pre", { className: styles.codeBlock, children: _jsx("code", { className: className, ...props, children: content }) }));
|
|
90
|
+
}
|
|
91
|
+
return (_jsx("code", { className: styles.inlineCode, ...props, children: content }));
|
|
92
|
+
},
|
|
93
|
+
}, children: children }) }));
|
|
94
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { fireEvent, render, screen } from '@testing-library/react';
|
|
3
|
+
import { describe, it, expect, vi } from 'vitest';
|
|
4
|
+
import { Markdown } from './Markdown';
|
|
5
|
+
describe('Markdown Component', () => {
|
|
6
|
+
it('1.10 Renders basic text', () => {
|
|
7
|
+
render(_jsx(Markdown, { children: "Hello World" }));
|
|
8
|
+
expect(screen.getByText('Hello World')).toBeInTheDocument();
|
|
9
|
+
});
|
|
10
|
+
it('1.11 Renders inline code', () => {
|
|
11
|
+
render(_jsx(Markdown, { children: "`code`" }));
|
|
12
|
+
const code = screen.getByText('code');
|
|
13
|
+
expect(code.tagName).toBe('CODE');
|
|
14
|
+
});
|
|
15
|
+
it('1.12 Renders links', () => {
|
|
16
|
+
render(_jsx(Markdown, { children: "[Link](https://example.com)" }));
|
|
17
|
+
const link = screen.getByRole('link', { name: 'Link' });
|
|
18
|
+
expect(link).toHaveAttribute('href', 'https://example.com');
|
|
19
|
+
});
|
|
20
|
+
it('1.13 Renders GFM checkbox', () => {
|
|
21
|
+
render(_jsx(Markdown, { children: "- [ ] Task" }));
|
|
22
|
+
const checkbox = screen.getByRole('checkbox');
|
|
23
|
+
expect(checkbox).toBeInTheDocument();
|
|
24
|
+
expect(checkbox).not.toBeChecked();
|
|
25
|
+
});
|
|
26
|
+
it('1.14 Renders GFM checked checkbox', () => {
|
|
27
|
+
render(_jsx(Markdown, { children: "- [x] Done" }));
|
|
28
|
+
const checkbox = screen.getByRole('checkbox');
|
|
29
|
+
expect(checkbox).toBeChecked();
|
|
30
|
+
});
|
|
31
|
+
it('1.15 Linkifies task IDs when callback is provided', () => {
|
|
32
|
+
const onTaskIdClick = vi.fn();
|
|
33
|
+
render(_jsx(Markdown, { onTaskIdClick: onTaskIdClick, children: "See task-1771422284342-ummpvmvb7 for details" }));
|
|
34
|
+
const button = screen.getByRole('button', { name: 'task-1771422284342-ummpvmvb7' });
|
|
35
|
+
fireEvent.click(button);
|
|
36
|
+
expect(onTaskIdClick).toHaveBeenCalledWith('task-1771422284342-ummpvmvb7');
|
|
37
|
+
});
|
|
38
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface ModalProps {
|
|
3
|
+
isOpen: boolean;
|
|
4
|
+
onClose: () => void;
|
|
5
|
+
title: React.ReactNode;
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
footer?: React.ReactNode;
|
|
8
|
+
size?: 'sm' | 'md' | 'lg' | 'xl' | 'full';
|
|
9
|
+
theme?: 'light' | 'dark' | 'midnight';
|
|
10
|
+
className?: string;
|
|
11
|
+
draggable?: boolean;
|
|
12
|
+
isSettings?: boolean;
|
|
13
|
+
closeOnOverlayClick?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export declare function Modal({ isOpen, onClose, title, children, footer, size, theme, className, draggable, isSettings, closeOnOverlayClick }: ModalProps): React.ReactPortal | null;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useRef } from 'react';
|
|
3
|
+
import { createPortal } from 'react-dom';
|
|
4
|
+
import { X } from 'lucide-react';
|
|
5
|
+
import styles from './Modal.module.css';
|
|
6
|
+
import { useDraggable } from '../../hooks/useDraggable';
|
|
7
|
+
export function Modal({ isOpen, onClose, title, children, footer, size = 'md', theme = 'dark', className, draggable = false, isSettings = false, closeOnOverlayClick = true }) {
|
|
8
|
+
const overlayRef = useRef(null);
|
|
9
|
+
const { position, isDragging, handleMouseDown, modalRef } = useDraggable();
|
|
10
|
+
// Close on escape
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
const handleKeyDown = (e) => {
|
|
13
|
+
if (e.key === 'Escape' && isOpen) {
|
|
14
|
+
onClose();
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
window.addEventListener('keydown', handleKeyDown);
|
|
18
|
+
return () => window.removeEventListener('keydown', handleKeyDown);
|
|
19
|
+
}, [isOpen, onClose]);
|
|
20
|
+
// Prevent body scroll when open
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
if (isOpen) {
|
|
23
|
+
document.body.style.overflow = 'hidden';
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
document.body.style.overflow = '';
|
|
27
|
+
}
|
|
28
|
+
return () => {
|
|
29
|
+
document.body.style.overflow = '';
|
|
30
|
+
};
|
|
31
|
+
}, [isOpen]);
|
|
32
|
+
if (!isOpen)
|
|
33
|
+
return null;
|
|
34
|
+
// Map size to CSS class
|
|
35
|
+
const sizeClassMap = {
|
|
36
|
+
sm: styles.modalSizeSm,
|
|
37
|
+
md: styles.modalSizeMd,
|
|
38
|
+
lg: styles.modalSizeLg,
|
|
39
|
+
xl: styles.modalSizeXl,
|
|
40
|
+
full: styles.modalSizeFull
|
|
41
|
+
};
|
|
42
|
+
return createPortal(_jsx("div", { className: `${styles.overlay} ${className || ''} ${styles.overlayHighZ}`, ref: overlayRef, onClick: (e) => {
|
|
43
|
+
if (closeOnOverlayClick && e.target === overlayRef.current)
|
|
44
|
+
onClose();
|
|
45
|
+
}, children: _jsxs("div", { ref: modalRef, className: `${styles.modal} ${sizeClassMap[size]} ${draggable ? styles.draggableModal : ''} ${isSettings ? styles.settingsViewModal : ''}`, "data-theme": theme, style: {
|
|
46
|
+
transform: draggable ? `translate(${position.x}px, ${position.y}px)` : undefined,
|
|
47
|
+
transition: isDragging ? 'none' : 'transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease-out'
|
|
48
|
+
}, children: [_jsxs("div", { className: `${styles.header} ${draggable ? styles.draggableHeader : ''}`, onMouseDown: draggable ? handleMouseDown : undefined, style: { cursor: draggable ? (isDragging ? 'grabbing' : 'grab') : 'default' }, children: [_jsx("div", { className: styles.headerTitle, children: title }), _jsx("div", { className: styles.headerActions, children: _jsx("button", { className: styles.headerActionBtn, onClick: onClose, title: "Close", children: _jsx(X, { size: 20 }) }) })] }), _jsx("div", { className: styles.modalContent, children: children }), footer && (_jsx("div", { className: `${styles.formActions} ${styles.modalFooter}`, children: footer }))] }) }), document.body);
|
|
49
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare function MultiSelectFilter({ label, options, selected, onChange, variant }: {
|
|
2
|
+
label: string;
|
|
3
|
+
options: {
|
|
4
|
+
value: string | number;
|
|
5
|
+
label: string;
|
|
6
|
+
}[];
|
|
7
|
+
selected: (string | number)[];
|
|
8
|
+
onChange: (values: (string | number)[]) => void;
|
|
9
|
+
variant?: 'label' | 'value';
|
|
10
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState, useRef, useEffect } from 'react';
|
|
3
|
+
import { ChevronDown } from 'lucide-react';
|
|
4
|
+
import styles from '../../Taskforce.module.css';
|
|
5
|
+
// Helper to correctly pluralize filter labels (e.g., Category -> Categories)
|
|
6
|
+
function pluralize(label) {
|
|
7
|
+
const key = label.charAt(0).toUpperCase() + label.slice(1).toLowerCase();
|
|
8
|
+
const irregulars = {
|
|
9
|
+
'Category': 'Categories',
|
|
10
|
+
'Priority': 'Priorities',
|
|
11
|
+
'Status': 'Statuses',
|
|
12
|
+
};
|
|
13
|
+
if (irregulars[key])
|
|
14
|
+
return irregulars[key];
|
|
15
|
+
// Default: just add 's'
|
|
16
|
+
return `${label}s`;
|
|
17
|
+
}
|
|
18
|
+
export function MultiSelectFilter({ label, options, selected, onChange, variant = 'label' }) {
|
|
19
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
20
|
+
const containerRef = useRef(null);
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
const handleClickOutside = (event) => {
|
|
23
|
+
if (containerRef.current && !containerRef.current.contains(event.target)) {
|
|
24
|
+
setIsOpen(false);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
document.addEventListener('mousedown', handleClickOutside);
|
|
28
|
+
return () => document.removeEventListener('mousedown', handleClickOutside);
|
|
29
|
+
}, []);
|
|
30
|
+
const toggleOption = (value) => {
|
|
31
|
+
if (selected.includes(value)) {
|
|
32
|
+
onChange(selected.filter(v => v !== value));
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
onChange([...selected, value]);
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
const isAllSelected = options.length > 0 && options.every(opt => {
|
|
39
|
+
const val = variant === 'label' ? opt.label : opt.value;
|
|
40
|
+
return selected.includes(val);
|
|
41
|
+
});
|
|
42
|
+
const isNoneSelected = !options.some(opt => {
|
|
43
|
+
const val = variant === 'label' ? opt.label : opt.value;
|
|
44
|
+
return selected.includes(val);
|
|
45
|
+
});
|
|
46
|
+
const toggleAll = () => {
|
|
47
|
+
if (isAllSelected) {
|
|
48
|
+
onChange([]);
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
onChange(options.map(o => variant === 'label' ? o.label : o.value));
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
const visibleSelectedCount = options.filter(opt => {
|
|
55
|
+
const val = variant === 'label' ? opt.label : opt.value;
|
|
56
|
+
return selected.includes(val);
|
|
57
|
+
}).length;
|
|
58
|
+
const plural = pluralize(label);
|
|
59
|
+
const displayText = isAllSelected
|
|
60
|
+
? `All ${plural}`
|
|
61
|
+
: isNoneSelected
|
|
62
|
+
? `No ${plural}`
|
|
63
|
+
: visibleSelectedCount === 1
|
|
64
|
+
? `1 ${label}`
|
|
65
|
+
: `${visibleSelectedCount} ${plural}`;
|
|
66
|
+
return (_jsxs("div", { className: styles.filterContainer, ref: containerRef, children: [_jsxs("button", { className: `${styles.filterButton} ${!isAllSelected ? styles.filterActive : ''}`, onClick: () => setIsOpen(!isOpen), title: `Filter by ${label}`, children: [_jsx("span", { children: displayText }), _jsx(ChevronDown, { size: 14, style: { transform: isOpen ? 'rotate(180deg)' : 'none', transition: 'transform 0.2s', opacity: 0.5 } })] }), isOpen && (_jsxs("div", { className: `${styles.filterDropdown} ${styles.appScrollbar}`, children: [_jsxs("div", { className: styles.filterOption, onClick: toggleAll, children: [_jsx("input", { type: "checkbox", checked: isAllSelected, onChange: () => { } }), _jsx("span", { style: { fontWeight: 600 }, children: "Toggle All" })] }), _jsx("div", { className: styles.filterDivider }), options.map(opt => {
|
|
67
|
+
const val = variant === 'label' ? opt.label : opt.value;
|
|
68
|
+
const isChecked = selected.includes(val);
|
|
69
|
+
return (_jsxs("div", { className: styles.filterOption, onClick: () => toggleOption(val), children: [_jsx("input", { type: "checkbox", checked: isChecked, onChange: () => { } }), _jsx("span", { children: opt.label })] }, opt.value));
|
|
70
|
+
})] }))] }));
|
|
71
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,74 @@
|
|
|
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 { MultiSelectFilter } from './MultiSelectFilter';
|
|
6
|
+
describe('MultiSelectFilter Component', () => {
|
|
7
|
+
const defaultProps = {
|
|
8
|
+
label: 'Category',
|
|
9
|
+
options: [
|
|
10
|
+
{ value: 'General', label: 'General' },
|
|
11
|
+
{ value: 'Backend', label: 'Backend' },
|
|
12
|
+
{ value: 'Frontend', label: 'Frontend' }
|
|
13
|
+
],
|
|
14
|
+
selected: ['General', 'Backend', 'Frontend'], // All selected initially
|
|
15
|
+
onChange: vi.fn(),
|
|
16
|
+
type: 'category'
|
|
17
|
+
};
|
|
18
|
+
const renderComponent = (props = {}) => {
|
|
19
|
+
return render(_jsx(MultiSelectFilter, { ...defaultProps, ...props }));
|
|
20
|
+
};
|
|
21
|
+
it('1.1 Renders correctly with label', () => {
|
|
22
|
+
renderComponent();
|
|
23
|
+
// Should show "All Categories" since all are selected and label is "Category"
|
|
24
|
+
expect(screen.getByText('All Categories')).toBeInTheDocument();
|
|
25
|
+
});
|
|
26
|
+
it('1.2 Opens dropdown on click', async () => {
|
|
27
|
+
const user = userEvent.setup();
|
|
28
|
+
renderComponent();
|
|
29
|
+
const button = screen.getByRole('button');
|
|
30
|
+
await user.click(button);
|
|
31
|
+
// Dropdown content should appear
|
|
32
|
+
expect(screen.getByText('Toggle All')).toBeInTheDocument();
|
|
33
|
+
expect(screen.getByText('General')).toBeInTheDocument();
|
|
34
|
+
expect(screen.getByText('Backend')).toBeInTheDocument();
|
|
35
|
+
});
|
|
36
|
+
it('1.3 Toggle selection', async () => {
|
|
37
|
+
const user = userEvent.setup();
|
|
38
|
+
renderComponent();
|
|
39
|
+
await user.click(screen.getByRole('button')); // Open
|
|
40
|
+
// Click the option div or checkbox? Implementation has onClick on div.
|
|
41
|
+
const backendOption = screen.getByText('Backend');
|
|
42
|
+
await user.click(backendOption);
|
|
43
|
+
// Should call onChange with new array (removing Backend)
|
|
44
|
+
expect(defaultProps.onChange).toHaveBeenCalledWith(['General', 'Frontend']);
|
|
45
|
+
});
|
|
46
|
+
it('1.4 Toggle All', async () => {
|
|
47
|
+
const user = userEvent.setup();
|
|
48
|
+
// Case: Some selected -> Click Toggle All -> Select All
|
|
49
|
+
renderComponent({ selected: ['General'] });
|
|
50
|
+
await user.click(screen.getByRole('button'));
|
|
51
|
+
const toggleAll = screen.getByText('Toggle All');
|
|
52
|
+
await user.click(toggleAll);
|
|
53
|
+
// Should select all
|
|
54
|
+
expect(defaultProps.onChange).toHaveBeenCalledWith(['General', 'Backend', 'Frontend']);
|
|
55
|
+
});
|
|
56
|
+
it('1.5 Shows count when partially selected', () => {
|
|
57
|
+
renderComponent({ selected: ['General', 'Backend'] }); // 2 out of 3
|
|
58
|
+
// Should show "2" or "2 selected" or similar. Implementation check:
|
|
59
|
+
// Text is `selected.length === options.length ? 'All' : selected.length === 0 ? 'None' : pluralize(selected.length, 'Category', 'Categories')`
|
|
60
|
+
// pluralize: `${count} ${count === 1 ? singular : plural}`. But wait, `pluralize` usually returns string "2 Categories".
|
|
61
|
+
// Let's check implementation if needed, but "2 Categories" is expected.
|
|
62
|
+
expect(screen.getByText('2 Categories')).toBeInTheDocument();
|
|
63
|
+
});
|
|
64
|
+
it('1.6 Closes on outside click', async () => {
|
|
65
|
+
const user = userEvent.setup();
|
|
66
|
+
renderComponent();
|
|
67
|
+
await user.click(screen.getByRole('button'));
|
|
68
|
+
expect(screen.getByText('Toggle All')).toBeVisible();
|
|
69
|
+
await user.click(document.body);
|
|
70
|
+
// Expect dropdown to be gone/hidden.
|
|
71
|
+
// Note: checking visibility might require checking if element is removed from DOM.
|
|
72
|
+
expect(screen.queryByText('Toggle All')).not.toBeInTheDocument();
|
|
73
|
+
});
|
|
74
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface TaxonomyOption {
|
|
2
|
+
value: string | number;
|
|
3
|
+
label: string;
|
|
4
|
+
icon?: string;
|
|
5
|
+
color?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface TaxonomyDropdownProps {
|
|
8
|
+
value: string | number;
|
|
9
|
+
options: TaxonomyOption[];
|
|
10
|
+
onChange: (value: string | number) => void;
|
|
11
|
+
placeholder?: string;
|
|
12
|
+
required?: boolean;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
className?: string;
|
|
15
|
+
ariaLabelledBy?: string;
|
|
16
|
+
}
|
|
17
|
+
export declare function TaxonomyDropdown({ value, options, onChange, placeholder, required, disabled, className, ariaLabelledBy }: TaxonomyDropdownProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState, useRef, useEffect } from 'react';
|
|
3
|
+
import * as Icons from 'lucide-react';
|
|
4
|
+
import { ChevronDown, HelpCircle } from 'lucide-react';
|
|
5
|
+
import styles from '../../Taskforce.module.css';
|
|
6
|
+
import { resolveColor } from '../../utils/constants';
|
|
7
|
+
export function TaxonomyDropdown({ value, options, onChange, placeholder = 'Select...', required = false, disabled = false, className = '', ariaLabelledBy }) {
|
|
8
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
9
|
+
const [highlightedIndex, setHighlightedIndex] = useState(-1);
|
|
10
|
+
const dropdownRef = useRef(null);
|
|
11
|
+
const buttonRef = useRef(null);
|
|
12
|
+
// Find the currently selected option
|
|
13
|
+
const selectedOption = options.find(opt => String(opt.value) === String(value));
|
|
14
|
+
// Close dropdown when clicking outside
|
|
15
|
+
useEffect(() => {
|
|
16
|
+
if (!isOpen)
|
|
17
|
+
return;
|
|
18
|
+
const handleClickOutside = (event) => {
|
|
19
|
+
if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
|
|
20
|
+
setIsOpen(false);
|
|
21
|
+
setHighlightedIndex(-1);
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
document.addEventListener('mousedown', handleClickOutside);
|
|
25
|
+
return () => document.removeEventListener('mousedown', handleClickOutside);
|
|
26
|
+
}, [isOpen]);
|
|
27
|
+
// Reset highlighted index when dropdown closes
|
|
28
|
+
useEffect(() => {
|
|
29
|
+
if (!isOpen) {
|
|
30
|
+
setHighlightedIndex(-1);
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
// Set highlighted index to current selection when opening
|
|
34
|
+
const currentIndex = options.findIndex(opt => String(opt.value) === String(value));
|
|
35
|
+
setHighlightedIndex(currentIndex >= 0 ? currentIndex : 0);
|
|
36
|
+
}
|
|
37
|
+
}, [isOpen, options, value]);
|
|
38
|
+
const handleToggle = () => {
|
|
39
|
+
if (!disabled) {
|
|
40
|
+
setIsOpen(!isOpen);
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
const handleSelect = (option) => {
|
|
44
|
+
onChange(option.value);
|
|
45
|
+
setIsOpen(false);
|
|
46
|
+
buttonRef.current?.focus();
|
|
47
|
+
};
|
|
48
|
+
const handleKeyDown = (e) => {
|
|
49
|
+
if (disabled)
|
|
50
|
+
return;
|
|
51
|
+
switch (e.key) {
|
|
52
|
+
case 'Enter':
|
|
53
|
+
case ' ':
|
|
54
|
+
e.preventDefault();
|
|
55
|
+
if (!isOpen) {
|
|
56
|
+
setIsOpen(true);
|
|
57
|
+
}
|
|
58
|
+
else if (highlightedIndex >= 0) {
|
|
59
|
+
handleSelect(options[highlightedIndex]);
|
|
60
|
+
}
|
|
61
|
+
break;
|
|
62
|
+
case 'Escape':
|
|
63
|
+
e.preventDefault();
|
|
64
|
+
setIsOpen(false);
|
|
65
|
+
buttonRef.current?.focus();
|
|
66
|
+
break;
|
|
67
|
+
case 'ArrowDown':
|
|
68
|
+
e.preventDefault();
|
|
69
|
+
if (!isOpen) {
|
|
70
|
+
setIsOpen(true);
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
setHighlightedIndex(prev => prev < options.length - 1 ? prev + 1 : 0);
|
|
74
|
+
}
|
|
75
|
+
break;
|
|
76
|
+
case 'ArrowUp':
|
|
77
|
+
e.preventDefault();
|
|
78
|
+
if (!isOpen) {
|
|
79
|
+
setIsOpen(true);
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
setHighlightedIndex(prev => prev > 0 ? prev - 1 : options.length - 1);
|
|
83
|
+
}
|
|
84
|
+
break;
|
|
85
|
+
case 'Home':
|
|
86
|
+
e.preventDefault();
|
|
87
|
+
if (isOpen) {
|
|
88
|
+
setHighlightedIndex(0);
|
|
89
|
+
}
|
|
90
|
+
break;
|
|
91
|
+
case 'End':
|
|
92
|
+
e.preventDefault();
|
|
93
|
+
if (isOpen) {
|
|
94
|
+
setHighlightedIndex(options.length - 1);
|
|
95
|
+
}
|
|
96
|
+
break;
|
|
97
|
+
case 'Tab':
|
|
98
|
+
// Allow natural tab behavior
|
|
99
|
+
setIsOpen(false);
|
|
100
|
+
break;
|
|
101
|
+
default:
|
|
102
|
+
break;
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
const renderOptionContent = (option) => {
|
|
106
|
+
const IconComp = option.icon && Icons[option.icon]
|
|
107
|
+
? Icons[option.icon]
|
|
108
|
+
: HelpCircle;
|
|
109
|
+
const color = option.color ? resolveColor(option.color) : 'var(--text-secondary)';
|
|
110
|
+
return (_jsxs(_Fragment, { children: [_jsx("span", { className: styles.taxonomyDropdownIcon, style: { color }, children: _jsx(IconComp, { size: 16 }) }), _jsx("span", { className: styles.taxonomyDropdownLabel, children: option.label })] }));
|
|
111
|
+
};
|
|
112
|
+
return (_jsxs("div", { ref: dropdownRef, className: `${styles.taxonomyDropdown} ${className}`, children: [_jsxs("button", { ref: buttonRef, type: "button", className: `${styles.taxonomyDropdownButton} ${isOpen ? styles.taxonomyDropdownOpen : ''}`, onClick: handleToggle, onKeyDown: handleKeyDown, disabled: disabled, role: "combobox", "aria-haspopup": "listbox", "aria-expanded": isOpen, "aria-controls": `taxonomy-listbox-${placeholder.replace(/\s+/g, '-')}`, "aria-labelledby": ariaLabelledBy, style: (() => {
|
|
113
|
+
if (!selectedOption)
|
|
114
|
+
return {};
|
|
115
|
+
const colorVal = selectedOption.color;
|
|
116
|
+
const resolved = resolveColor(colorVal);
|
|
117
|
+
// If it's a CSS variable or missing, use a subtle violet theme for the border/bg
|
|
118
|
+
// but keep the original resolved color for the icon/text
|
|
119
|
+
const isCssVar = !resolved || resolved.startsWith('var(');
|
|
120
|
+
const borderBase = isCssVar ? '#8b5cf6' : resolved;
|
|
121
|
+
const opacityBorder = isCssVar ? '30' : '50';
|
|
122
|
+
const opacityBg = isCssVar ? '05' : '10';
|
|
123
|
+
return {
|
|
124
|
+
'--field-color': resolved || 'var(--text-primary)',
|
|
125
|
+
'--field-border': `${borderBase}${opacityBorder}`,
|
|
126
|
+
'--field-bg': `${borderBase}${opacityBg}`
|
|
127
|
+
};
|
|
128
|
+
})(), children: [_jsx("span", { className: styles.taxonomyDropdownButtonContent, children: selectedOption ? renderOptionContent(selectedOption) : (_jsxs(_Fragment, { children: [_jsx("span", { className: styles.taxonomyDropdownIcon, children: _jsx(HelpCircle, { size: 16 }) }), _jsx("span", { className: styles.taxonomyDropdownLabel, children: placeholder })] })) }), _jsx(ChevronDown, { size: 16, className: `${styles.taxonomyDropdownChevron} ${isOpen ? styles.taxonomyDropdownChevronOpen : ''}` })] }), isOpen && (_jsx("div", { id: `taxonomy-listbox-${placeholder.replace(/\s+/g, '-')}`, className: styles.taxonomyDropdownPanel, role: "listbox", "aria-labelledby": ariaLabelledBy, children: options.map((option, index) => {
|
|
129
|
+
const isSelected = String(option.value) === String(value);
|
|
130
|
+
const isHighlighted = index === highlightedIndex;
|
|
131
|
+
return (_jsx("div", { className: `${styles.taxonomyDropdownOption} ${isSelected ? styles.taxonomyDropdownOptionSelected : ''} ${isHighlighted ? styles.taxonomyDropdownOptionHighlighted : ''}`, role: "option", "aria-selected": isSelected, onClick: () => handleSelect(option), onMouseEnter: () => setHighlightedIndex(index), style: (() => {
|
|
132
|
+
const colorVal = option.color;
|
|
133
|
+
const resolved = resolveColor(colorVal);
|
|
134
|
+
const isCssVar = !resolved || resolved.startsWith('var(');
|
|
135
|
+
const borderBase = isCssVar ? '#8b5cf6' : resolved;
|
|
136
|
+
const opacityBorder = isCssVar ? '20' : '30';
|
|
137
|
+
const opacityBg = isCssVar ? '05' : '10';
|
|
138
|
+
return {
|
|
139
|
+
'--option-color': resolved || 'var(--text-primary)',
|
|
140
|
+
'--option-border': `${borderBase}${opacityBorder}`,
|
|
141
|
+
'--option-bg': `${borderBase}${opacityBg}`
|
|
142
|
+
};
|
|
143
|
+
})(), children: renderOptionContent(option) }, String(option.value)));
|
|
144
|
+
}) }))] }));
|
|
145
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|