@carlonicora/nja-knowledge 0.0.1 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +675 -0
- package/README.md +609 -1
- package/dist/api/common/blocknote.text.d.ts +10 -0
- package/dist/api/common/blocknote.text.d.ts.map +1 -0
- package/dist/api/common/blocknote.text.js +28 -0
- package/dist/api/common/blocknote.text.js.map +1 -0
- package/dist/api/common/content.workflow.d.ts +3 -0
- package/dist/api/common/content.workflow.d.ts.map +1 -0
- package/dist/api/common/content.workflow.js +16 -0
- package/dist/api/common/content.workflow.js.map +1 -0
- package/dist/api/common/decorate.d.ts +22 -0
- package/dist/api/common/decorate.d.ts.map +1 -0
- package/dist/api/common/decorate.js +35 -0
- package/dist/api/common/decorate.js.map +1 -0
- package/dist/api/common/translation-patch.dto.d.ts +17 -0
- package/dist/api/common/translation-patch.dto.d.ts.map +1 -0
- package/dist/api/common/translation-patch.dto.js +53 -0
- package/dist/api/common/translation-patch.dto.js.map +1 -0
- package/dist/api/common/translation.merge.d.ts +24 -0
- package/dist/api/common/translation.merge.d.ts.map +1 -0
- package/dist/api/common/translation.merge.js +37 -0
- package/dist/api/common/translation.merge.js.map +1 -0
- package/dist/api/config/knowledge.config.d.ts +12 -0
- package/dist/api/config/knowledge.config.d.ts.map +1 -0
- package/dist/api/config/knowledge.config.js +3 -0
- package/dist/api/config/knowledge.config.js.map +1 -0
- package/dist/api/content/article/article.module.d.ts +8 -0
- package/dist/api/content/article/article.module.d.ts.map +1 -0
- package/dist/api/content/article/article.module.js +53 -0
- package/dist/api/content/article/article.module.js.map +1 -0
- package/dist/api/content/article/controllers/article.controller.d.ts +36 -0
- package/dist/api/content/article/controllers/article.controller.d.ts.map +1 -0
- package/dist/api/content/article/controllers/article.controller.js +425 -0
- package/dist/api/content/article/controllers/article.controller.js.map +1 -0
- package/dist/api/content/article/controllers/article.routes.fixture.d.ts +10 -0
- package/dist/api/content/article/controllers/article.routes.fixture.d.ts.map +1 -0
- package/dist/api/content/article/controllers/article.routes.fixture.js +35 -0
- package/dist/api/content/article/controllers/article.routes.fixture.js.map +1 -0
- package/dist/api/content/article/dtos/article.dto.d.ts +11 -0
- package/dist/api/content/article/dtos/article.dto.d.ts.map +1 -0
- package/dist/api/content/article/dtos/article.dto.js +45 -0
- package/dist/api/content/article/dtos/article.dto.js.map +1 -0
- package/dist/api/content/article/dtos/article.post.dto.d.ts +29 -0
- package/dist/api/content/article/dtos/article.post.dto.d.ts.map +1 -0
- package/dist/api/content/article/dtos/article.post.dto.js +124 -0
- package/dist/api/content/article/dtos/article.post.dto.js.map +1 -0
- package/dist/api/content/article/dtos/article.put.dto.d.ts +29 -0
- package/dist/api/content/article/dtos/article.put.dto.d.ts.map +1 -0
- package/dist/api/content/article/dtos/article.put.dto.js +124 -0
- package/dist/api/content/article/dtos/article.put.dto.js.map +1 -0
- package/dist/api/content/article/dtos/article.relationship.dto.d.ts +69 -0
- package/dist/api/content/article/dtos/article.relationship.dto.d.ts.map +1 -0
- package/dist/api/content/article/dtos/article.relationship.dto.js +141 -0
- package/dist/api/content/article/dtos/article.relationship.dto.js.map +1 -0
- package/dist/api/content/article/entities/article.d.ts +67 -0
- package/dist/api/content/article/entities/article.d.ts.map +1 -0
- package/dist/api/content/article/entities/article.js +74 -0
- package/dist/api/content/article/entities/article.js.map +1 -0
- package/dist/api/content/article/entities/article.meta.d.ts +5 -0
- package/dist/api/content/article/entities/article.meta.d.ts.map +1 -0
- package/dist/api/content/article/entities/article.meta.js +13 -0
- package/dist/api/content/article/entities/article.meta.js.map +1 -0
- package/dist/api/content/article/processors/article.processor.d.ts +43 -0
- package/dist/api/content/article/processors/article.processor.d.ts.map +1 -0
- package/dist/api/content/article/processors/article.processor.js +139 -0
- package/dist/api/content/article/processors/article.processor.js.map +1 -0
- package/dist/api/content/article/repositories/article.repository.d.ts +118 -0
- package/dist/api/content/article/repositories/article.repository.d.ts.map +1 -0
- package/dist/api/content/article/repositories/article.repository.js +215 -0
- package/dist/api/content/article/repositories/article.repository.js.map +1 -0
- package/dist/api/content/article/services/article.service.d.ts +145 -0
- package/dist/api/content/article/services/article.service.d.ts.map +1 -0
- package/dist/api/content/article/services/article.service.js +263 -0
- package/dist/api/content/article/services/article.service.js.map +1 -0
- package/dist/api/content/content-extension/content-access-predicates.d.ts +10 -0
- package/dist/api/content/content-extension/content-access-predicates.d.ts.map +1 -0
- package/dist/api/content/content-extension/content-access-predicates.js +19 -0
- package/dist/api/content/content-extension/content-access-predicates.js.map +1 -0
- package/dist/api/content/content-extension/content-extension.module.d.ts +9 -0
- package/dist/api/content/content-extension/content-extension.module.d.ts.map +1 -0
- package/dist/api/content/content-extension/content-extension.module.js +28 -0
- package/dist/api/content/content-extension/content-extension.module.js.map +1 -0
- package/dist/api/content/content-extension/controllers/content-extension.controller.d.ts +12 -0
- package/dist/api/content/content-extension/controllers/content-extension.controller.d.ts.map +1 -0
- package/dist/api/content/content-extension/controllers/content-extension.controller.js +76 -0
- package/dist/api/content/content-extension/controllers/content-extension.controller.js.map +1 -0
- package/dist/api/content/content-extension/controllers/content-extension.routes.fixture.d.ts +10 -0
- package/dist/api/content/content-extension/controllers/content-extension.routes.fixture.d.ts.map +1 -0
- package/dist/api/content/content-extension/controllers/content-extension.routes.fixture.js +13 -0
- package/dist/api/content/content-extension/controllers/content-extension.routes.fixture.js.map +1 -0
- package/dist/api/content/content-extension/repositories/content-extension.repository.d.ts +47 -0
- package/dist/api/content/content-extension/repositories/content-extension.repository.d.ts.map +1 -0
- package/dist/api/content/content-extension/repositories/content-extension.repository.js +124 -0
- package/dist/api/content/content-extension/repositories/content-extension.repository.js.map +1 -0
- package/dist/api/content/content-extension/services/content-extension.service.d.ts +25 -0
- package/dist/api/content/content-extension/services/content-extension.service.d.ts.map +1 -0
- package/dist/api/content/content-extension/services/content-extension.service.js +62 -0
- package/dist/api/content/content-extension/services/content-extension.service.js.map +1 -0
- package/dist/api/content/discussion/controllers/discussion.controller.d.ts +34 -0
- package/dist/api/content/discussion/controllers/discussion.controller.d.ts.map +1 -0
- package/dist/api/content/discussion/controllers/discussion.controller.js +389 -0
- package/dist/api/content/discussion/controllers/discussion.controller.js.map +1 -0
- package/dist/api/content/discussion/controllers/discussion.routes.fixture.d.ts +10 -0
- package/dist/api/content/discussion/controllers/discussion.routes.fixture.d.ts.map +1 -0
- package/dist/api/content/discussion/controllers/discussion.routes.fixture.js +33 -0
- package/dist/api/content/discussion/controllers/discussion.routes.fixture.js.map +1 -0
- package/dist/api/content/discussion/discussion.module.d.ts +8 -0
- package/dist/api/content/discussion/discussion.module.d.ts.map +1 -0
- package/dist/api/content/discussion/discussion.module.js +55 -0
- package/dist/api/content/discussion/discussion.module.js.map +1 -0
- package/dist/api/content/discussion/dtos/discussion.dto.d.ts +11 -0
- package/dist/api/content/discussion/dtos/discussion.dto.d.ts.map +1 -0
- package/dist/api/content/discussion/dtos/discussion.dto.js +45 -0
- package/dist/api/content/discussion/dtos/discussion.dto.js.map +1 -0
- package/dist/api/content/discussion/dtos/discussion.post.dto.d.ts +29 -0
- package/dist/api/content/discussion/dtos/discussion.post.dto.d.ts.map +1 -0
- package/dist/api/content/discussion/dtos/discussion.post.dto.js +124 -0
- package/dist/api/content/discussion/dtos/discussion.post.dto.js.map +1 -0
- package/dist/api/content/discussion/dtos/discussion.put.dto.d.ts +29 -0
- package/dist/api/content/discussion/dtos/discussion.put.dto.d.ts.map +1 -0
- package/dist/api/content/discussion/dtos/discussion.put.dto.js +124 -0
- package/dist/api/content/discussion/dtos/discussion.put.dto.js.map +1 -0
- package/dist/api/content/discussion/dtos/discussion.relationship.dto.d.ts +35 -0
- package/dist/api/content/discussion/dtos/discussion.relationship.dto.d.ts.map +1 -0
- package/dist/api/content/discussion/dtos/discussion.relationship.dto.js +78 -0
- package/dist/api/content/discussion/dtos/discussion.relationship.dto.js.map +1 -0
- package/dist/api/content/discussion/entities/discussion.d.ts +68 -0
- package/dist/api/content/discussion/entities/discussion.d.ts.map +1 -0
- package/dist/api/content/discussion/entities/discussion.js +75 -0
- package/dist/api/content/discussion/entities/discussion.js.map +1 -0
- package/dist/api/content/discussion/entities/discussion.meta.d.ts +3 -0
- package/dist/api/content/discussion/entities/discussion.meta.d.ts.map +1 -0
- package/dist/api/content/discussion/entities/discussion.meta.js +10 -0
- package/dist/api/content/discussion/entities/discussion.meta.js.map +1 -0
- package/dist/api/content/discussion/processors/discussion.processor.d.ts +43 -0
- package/dist/api/content/discussion/processors/discussion.processor.d.ts.map +1 -0
- package/dist/api/content/discussion/processors/discussion.processor.js +139 -0
- package/dist/api/content/discussion/processors/discussion.processor.js.map +1 -0
- package/dist/api/content/discussion/repositories/discussion.repository.d.ts +136 -0
- package/dist/api/content/discussion/repositories/discussion.repository.d.ts.map +1 -0
- package/dist/api/content/discussion/repositories/discussion.repository.js +261 -0
- package/dist/api/content/discussion/repositories/discussion.repository.js.map +1 -0
- package/dist/api/content/discussion/services/discussion.service.d.ts +162 -0
- package/dist/api/content/discussion/services/discussion.service.d.ts.map +1 -0
- package/dist/api/content/discussion/services/discussion.service.js +319 -0
- package/dist/api/content/discussion/services/discussion.service.js.map +1 -0
- package/dist/api/content/discussion-reply/controllers/discussion-reply.controller.d.ts +19 -0
- package/dist/api/content/discussion-reply/controllers/discussion-reply.controller.d.ts.map +1 -0
- package/dist/api/content/discussion-reply/controllers/discussion-reply.controller.js +144 -0
- package/dist/api/content/discussion-reply/controllers/discussion-reply.controller.js.map +1 -0
- package/dist/api/content/discussion-reply/controllers/discussion-reply.routes.fixture.d.ts +10 -0
- package/dist/api/content/discussion-reply/controllers/discussion-reply.routes.fixture.d.ts.map +1 -0
- package/dist/api/content/discussion-reply/controllers/discussion-reply.routes.fixture.js +17 -0
- package/dist/api/content/discussion-reply/controllers/discussion-reply.routes.fixture.js.map +1 -0
- package/dist/api/content/discussion-reply/discussion-reply.module.d.ts +8 -0
- package/dist/api/content/discussion-reply/discussion-reply.module.d.ts.map +1 -0
- package/dist/api/content/discussion-reply/discussion-reply.module.js +41 -0
- package/dist/api/content/discussion-reply/discussion-reply.module.js.map +1 -0
- package/dist/api/content/discussion-reply/dtos/discussion-reply.dto.d.ts +11 -0
- package/dist/api/content/discussion-reply/dtos/discussion-reply.dto.d.ts.map +1 -0
- package/dist/api/content/discussion-reply/dtos/discussion-reply.dto.js +45 -0
- package/dist/api/content/discussion-reply/dtos/discussion-reply.dto.js.map +1 -0
- package/dist/api/content/discussion-reply/dtos/discussion-reply.post.dto.d.ts +25 -0
- package/dist/api/content/discussion-reply/dtos/discussion-reply.post.dto.d.ts.map +1 -0
- package/dist/api/content/discussion-reply/dtos/discussion-reply.post.dto.js +95 -0
- package/dist/api/content/discussion-reply/dtos/discussion-reply.post.dto.js.map +1 -0
- package/dist/api/content/discussion-reply/dtos/discussion-reply.put.dto.d.ts +25 -0
- package/dist/api/content/discussion-reply/dtos/discussion-reply.put.dto.d.ts.map +1 -0
- package/dist/api/content/discussion-reply/dtos/discussion-reply.put.dto.js +95 -0
- package/dist/api/content/discussion-reply/dtos/discussion-reply.put.dto.js.map +1 -0
- package/dist/api/content/discussion-reply/entities/discussion-reply.d.ts +44 -0
- package/dist/api/content/discussion-reply/entities/discussion-reply.d.ts.map +1 -0
- package/dist/api/content/discussion-reply/entities/discussion-reply.js +45 -0
- package/dist/api/content/discussion-reply/entities/discussion-reply.js.map +1 -0
- package/dist/api/content/discussion-reply/entities/discussion-reply.meta.d.ts +3 -0
- package/dist/api/content/discussion-reply/entities/discussion-reply.meta.d.ts.map +1 -0
- package/dist/api/content/discussion-reply/entities/discussion-reply.meta.js +10 -0
- package/dist/api/content/discussion-reply/entities/discussion-reply.meta.js.map +1 -0
- package/dist/api/content/discussion-reply/repositories/discussion-reply.repository.d.ts +43 -0
- package/dist/api/content/discussion-reply/repositories/discussion-reply.repository.d.ts.map +1 -0
- package/dist/api/content/discussion-reply/repositories/discussion-reply.repository.js +63 -0
- package/dist/api/content/discussion-reply/repositories/discussion-reply.repository.js.map +1 -0
- package/dist/api/content/discussion-reply/services/discussion-reply.service.d.ts +55 -0
- package/dist/api/content/discussion-reply/services/discussion-reply.service.d.ts.map +1 -0
- package/dist/api/content/discussion-reply/services/discussion-reply.service.js +90 -0
- package/dist/api/content/discussion-reply/services/discussion-reply.service.js.map +1 -0
- package/dist/api/content/document/controllers/document.controller.d.ts +36 -0
- package/dist/api/content/document/controllers/document.controller.d.ts.map +1 -0
- package/dist/api/content/document/controllers/document.controller.js +425 -0
- package/dist/api/content/document/controllers/document.controller.js.map +1 -0
- package/dist/api/content/document/controllers/document.routes.fixture.d.ts +10 -0
- package/dist/api/content/document/controllers/document.routes.fixture.d.ts.map +1 -0
- package/dist/api/content/document/controllers/document.routes.fixture.js +35 -0
- package/dist/api/content/document/controllers/document.routes.fixture.js.map +1 -0
- package/dist/api/content/document/document.module.d.ts +8 -0
- package/dist/api/content/document/document.module.d.ts.map +1 -0
- package/dist/api/content/document/document.module.js +54 -0
- package/dist/api/content/document/document.module.js.map +1 -0
- package/dist/api/content/document/dtos/document.dto.d.ts +11 -0
- package/dist/api/content/document/dtos/document.dto.d.ts.map +1 -0
- package/dist/api/content/document/dtos/document.dto.js +45 -0
- package/dist/api/content/document/dtos/document.dto.js.map +1 -0
- package/dist/api/content/document/dtos/document.post.dto.d.ts +29 -0
- package/dist/api/content/document/dtos/document.post.dto.d.ts.map +1 -0
- package/dist/api/content/document/dtos/document.post.dto.js +124 -0
- package/dist/api/content/document/dtos/document.post.dto.js.map +1 -0
- package/dist/api/content/document/dtos/document.put.dto.d.ts +29 -0
- package/dist/api/content/document/dtos/document.put.dto.d.ts.map +1 -0
- package/dist/api/content/document/dtos/document.put.dto.js +124 -0
- package/dist/api/content/document/dtos/document.put.dto.js.map +1 -0
- package/dist/api/content/document/dtos/document.relationship.dto.d.ts +69 -0
- package/dist/api/content/document/dtos/document.relationship.dto.d.ts.map +1 -0
- package/dist/api/content/document/dtos/document.relationship.dto.js +141 -0
- package/dist/api/content/document/dtos/document.relationship.dto.js.map +1 -0
- package/dist/api/content/document/entities/document.d.ts +67 -0
- package/dist/api/content/document/entities/document.d.ts.map +1 -0
- package/dist/api/content/document/entities/document.js +74 -0
- package/dist/api/content/document/entities/document.js.map +1 -0
- package/dist/api/content/document/entities/document.meta.d.ts +5 -0
- package/dist/api/content/document/entities/document.meta.d.ts.map +1 -0
- package/dist/api/content/document/entities/document.meta.js +13 -0
- package/dist/api/content/document/entities/document.meta.js.map +1 -0
- package/dist/api/content/document/processors/document.processor.d.ts +43 -0
- package/dist/api/content/document/processors/document.processor.d.ts.map +1 -0
- package/dist/api/content/document/processors/document.processor.js +139 -0
- package/dist/api/content/document/processors/document.processor.js.map +1 -0
- package/dist/api/content/document/repositories/document.repository.d.ts +118 -0
- package/dist/api/content/document/repositories/document.repository.d.ts.map +1 -0
- package/dist/api/content/document/repositories/document.repository.js +215 -0
- package/dist/api/content/document/repositories/document.repository.js.map +1 -0
- package/dist/api/content/document/services/document.service.d.ts +147 -0
- package/dist/api/content/document/services/document.service.d.ts.map +1 -0
- package/dist/api/content/document/services/document.service.js +280 -0
- package/dist/api/content/document/services/document.service.js.map +1 -0
- package/dist/api/expertise/access/access.cypher.d.ts +66 -0
- package/dist/api/expertise/access/access.cypher.d.ts.map +1 -0
- package/dist/api/expertise/access/access.cypher.js +102 -0
- package/dist/api/expertise/access/access.cypher.js.map +1 -0
- package/dist/api/expertise/access-request/access-request.module.d.ts +10 -0
- package/dist/api/expertise/access-request/access-request.module.d.ts.map +1 -0
- package/dist/api/expertise/access-request/access-request.module.js +39 -0
- package/dist/api/expertise/access-request/access-request.module.js.map +1 -0
- package/dist/api/expertise/access-request/controllers/access-request.controller.d.ts +11 -0
- package/dist/api/expertise/access-request/controllers/access-request.controller.d.ts.map +1 -0
- package/dist/api/expertise/access-request/controllers/access-request.controller.js +51 -0
- package/dist/api/expertise/access-request/controllers/access-request.controller.js.map +1 -0
- package/dist/api/expertise/access-request/controllers/access-request.routes.fixture.d.ts +6 -0
- package/dist/api/expertise/access-request/controllers/access-request.routes.fixture.d.ts.map +1 -0
- package/dist/api/expertise/access-request/controllers/access-request.routes.fixture.js +8 -0
- package/dist/api/expertise/access-request/controllers/access-request.routes.fixture.js.map +1 -0
- package/dist/api/expertise/access-request/entities/access-request.d.ts +21 -0
- package/dist/api/expertise/access-request/entities/access-request.d.ts.map +1 -0
- package/dist/api/expertise/access-request/entities/access-request.js +21 -0
- package/dist/api/expertise/access-request/entities/access-request.js.map +1 -0
- package/dist/api/expertise/access-request/entities/access-request.meta.d.ts +3 -0
- package/dist/api/expertise/access-request/entities/access-request.meta.d.ts.map +1 -0
- package/dist/api/expertise/access-request/entities/access-request.meta.js +10 -0
- package/dist/api/expertise/access-request/entities/access-request.meta.js.map +1 -0
- package/dist/api/expertise/access-request/repositories/access-request-target.repository.d.ts +112 -0
- package/dist/api/expertise/access-request/repositories/access-request-target.repository.d.ts.map +1 -0
- package/dist/api/expertise/access-request/repositories/access-request-target.repository.js +72 -0
- package/dist/api/expertise/access-request/repositories/access-request-target.repository.js.map +1 -0
- package/dist/api/expertise/access-request/repositories/access-request.repository.d.ts +27 -0
- package/dist/api/expertise/access-request/repositories/access-request.repository.d.ts.map +1 -0
- package/dist/api/expertise/access-request/repositories/access-request.repository.js +91 -0
- package/dist/api/expertise/access-request/repositories/access-request.repository.js.map +1 -0
- package/dist/api/expertise/access-request/services/access-request.service.d.ts +14 -0
- package/dist/api/expertise/access-request/services/access-request.service.d.ts.map +1 -0
- package/dist/api/expertise/access-request/services/access-request.service.js +40 -0
- package/dist/api/expertise/access-request/services/access-request.service.js.map +1 -0
- package/dist/api/expertise/cluster/cluster.module.d.ts +8 -0
- package/dist/api/expertise/cluster/cluster.module.d.ts.map +1 -0
- package/dist/api/expertise/cluster/cluster.module.js +37 -0
- package/dist/api/expertise/cluster/cluster.module.js.map +1 -0
- package/dist/api/expertise/cluster/controllers/cluster.controller.d.ts +29 -0
- package/dist/api/expertise/cluster/controllers/cluster.controller.d.ts.map +1 -0
- package/dist/api/expertise/cluster/controllers/cluster.controller.js +345 -0
- package/dist/api/expertise/cluster/controllers/cluster.controller.js.map +1 -0
- package/dist/api/expertise/cluster/controllers/cluster.routes.fixture.d.ts +6 -0
- package/dist/api/expertise/cluster/controllers/cluster.routes.fixture.d.ts.map +1 -0
- package/dist/api/expertise/cluster/controllers/cluster.routes.fixture.js +23 -0
- package/dist/api/expertise/cluster/controllers/cluster.routes.fixture.js.map +1 -0
- package/dist/api/expertise/cluster/dtos/cluster.dto.d.ts +11 -0
- package/dist/api/expertise/cluster/dtos/cluster.dto.d.ts.map +1 -0
- package/dist/api/expertise/cluster/dtos/cluster.dto.js +45 -0
- package/dist/api/expertise/cluster/dtos/cluster.dto.js.map +1 -0
- package/dist/api/expertise/cluster/dtos/cluster.post.dto.d.ts +23 -0
- package/dist/api/expertise/cluster/dtos/cluster.post.dto.d.ts.map +1 -0
- package/dist/api/expertise/cluster/dtos/cluster.post.dto.js +96 -0
- package/dist/api/expertise/cluster/dtos/cluster.post.dto.js.map +1 -0
- package/dist/api/expertise/cluster/dtos/cluster.put.dto.d.ts +23 -0
- package/dist/api/expertise/cluster/dtos/cluster.put.dto.d.ts.map +1 -0
- package/dist/api/expertise/cluster/dtos/cluster.put.dto.js +96 -0
- package/dist/api/expertise/cluster/dtos/cluster.put.dto.js.map +1 -0
- package/dist/api/expertise/cluster/dtos/cluster.relationship.dto.d.ts +103 -0
- package/dist/api/expertise/cluster/dtos/cluster.relationship.dto.d.ts.map +1 -0
- package/dist/api/expertise/cluster/dtos/cluster.relationship.dto.js +204 -0
- package/dist/api/expertise/cluster/dtos/cluster.relationship.dto.js.map +1 -0
- package/dist/api/expertise/cluster/entities/cluster.d.ts +61 -0
- package/dist/api/expertise/cluster/entities/cluster.d.ts.map +1 -0
- package/dist/api/expertise/cluster/entities/cluster.js +72 -0
- package/dist/api/expertise/cluster/entities/cluster.js.map +1 -0
- package/dist/api/expertise/cluster/entities/cluster.meta.d.ts +6 -0
- package/dist/api/expertise/cluster/entities/cluster.meta.d.ts.map +1 -0
- package/dist/api/expertise/cluster/entities/cluster.meta.js +14 -0
- package/dist/api/expertise/cluster/entities/cluster.meta.js.map +1 -0
- package/dist/api/expertise/cluster/repositories/cluster.repository.d.ts +113 -0
- package/dist/api/expertise/cluster/repositories/cluster.repository.d.ts.map +1 -0
- package/dist/api/expertise/cluster/repositories/cluster.repository.js +171 -0
- package/dist/api/expertise/cluster/repositories/cluster.repository.js.map +1 -0
- package/dist/api/expertise/cluster/services/cluster.service.d.ts +105 -0
- package/dist/api/expertise/cluster/services/cluster.service.d.ts.map +1 -0
- package/dist/api/expertise/cluster/services/cluster.service.js +136 -0
- package/dist/api/expertise/cluster/services/cluster.service.js.map +1 -0
- package/dist/api/expertise/community-of-expertise/community-of-expertise.module.d.ts +8 -0
- package/dist/api/expertise/community-of-expertise/community-of-expertise.module.d.ts.map +1 -0
- package/dist/api/expertise/community-of-expertise/community-of-expertise.module.js +44 -0
- package/dist/api/expertise/community-of-expertise/community-of-expertise.module.js.map +1 -0
- package/dist/api/expertise/community-of-expertise/controllers/community-of-expertise.controller.d.ts +30 -0
- package/dist/api/expertise/community-of-expertise/controllers/community-of-expertise.controller.d.ts.map +1 -0
- package/dist/api/expertise/community-of-expertise/controllers/community-of-expertise.controller.js +332 -0
- package/dist/api/expertise/community-of-expertise/controllers/community-of-expertise.controller.js.map +1 -0
- package/dist/api/expertise/community-of-expertise/controllers/community-of-expertise.routes.fixture.d.ts +6 -0
- package/dist/api/expertise/community-of-expertise/controllers/community-of-expertise.routes.fixture.d.ts.map +1 -0
- package/dist/api/expertise/community-of-expertise/controllers/community-of-expertise.routes.fixture.js +26 -0
- package/dist/api/expertise/community-of-expertise/controllers/community-of-expertise.routes.fixture.js.map +1 -0
- package/dist/api/expertise/community-of-expertise/dtos/community-member-role.dto.d.ts +16 -0
- package/dist/api/expertise/community-of-expertise/dtos/community-member-role.dto.d.ts.map +1 -0
- package/dist/api/expertise/community-of-expertise/dtos/community-member-role.dto.js +49 -0
- package/dist/api/expertise/community-of-expertise/dtos/community-member-role.dto.js.map +1 -0
- package/dist/api/expertise/community-of-expertise/dtos/community-of-expertise.dto.d.ts +11 -0
- package/dist/api/expertise/community-of-expertise/dtos/community-of-expertise.dto.d.ts.map +1 -0
- package/dist/api/expertise/community-of-expertise/dtos/community-of-expertise.dto.js +45 -0
- package/dist/api/expertise/community-of-expertise/dtos/community-of-expertise.dto.js.map +1 -0
- package/dist/api/expertise/community-of-expertise/dtos/community-of-expertise.post.dto.d.ts +34 -0
- package/dist/api/expertise/community-of-expertise/dtos/community-of-expertise.post.dto.d.ts.map +1 -0
- package/dist/api/expertise/community-of-expertise/dtos/community-of-expertise.post.dto.js +135 -0
- package/dist/api/expertise/community-of-expertise/dtos/community-of-expertise.post.dto.js.map +1 -0
- package/dist/api/expertise/community-of-expertise/dtos/community-of-expertise.put.dto.d.ts +34 -0
- package/dist/api/expertise/community-of-expertise/dtos/community-of-expertise.put.dto.d.ts.map +1 -0
- package/dist/api/expertise/community-of-expertise/dtos/community-of-expertise.put.dto.js +135 -0
- package/dist/api/expertise/community-of-expertise/dtos/community-of-expertise.put.dto.js.map +1 -0
- package/dist/api/expertise/community-of-expertise/dtos/community-of-expertise.relationship.dto.d.ts +117 -0
- package/dist/api/expertise/community-of-expertise/dtos/community-of-expertise.relationship.dto.d.ts.map +1 -0
- package/dist/api/expertise/community-of-expertise/dtos/community-of-expertise.relationship.dto.js +240 -0
- package/dist/api/expertise/community-of-expertise/dtos/community-of-expertise.relationship.dto.js.map +1 -0
- package/dist/api/expertise/community-of-expertise/entities/community-of-expertise.d.ts +75 -0
- package/dist/api/expertise/community-of-expertise/entities/community-of-expertise.d.ts.map +1 -0
- package/dist/api/expertise/community-of-expertise/entities/community-of-expertise.js +90 -0
- package/dist/api/expertise/community-of-expertise/entities/community-of-expertise.js.map +1 -0
- package/dist/api/expertise/community-of-expertise/entities/community-of-expertise.meta.d.ts +6 -0
- package/dist/api/expertise/community-of-expertise/entities/community-of-expertise.meta.d.ts.map +1 -0
- package/dist/api/expertise/community-of-expertise/entities/community-of-expertise.meta.js +14 -0
- package/dist/api/expertise/community-of-expertise/entities/community-of-expertise.meta.js.map +1 -0
- package/dist/api/expertise/community-of-expertise/repositories/community-of-expertise.repository.d.ts +122 -0
- package/dist/api/expertise/community-of-expertise/repositories/community-of-expertise.repository.d.ts.map +1 -0
- package/dist/api/expertise/community-of-expertise/repositories/community-of-expertise.repository.js +184 -0
- package/dist/api/expertise/community-of-expertise/repositories/community-of-expertise.repository.js.map +1 -0
- package/dist/api/expertise/community-of-expertise/services/community-of-expertise.service.d.ts +107 -0
- package/dist/api/expertise/community-of-expertise/services/community-of-expertise.service.d.ts.map +1 -0
- package/dist/api/expertise/community-of-expertise/services/community-of-expertise.service.js +179 -0
- package/dist/api/expertise/community-of-expertise/services/community-of-expertise.service.js.map +1 -0
- package/dist/api/expertise/skill/controllers/skill.controller.d.ts +34 -0
- package/dist/api/expertise/skill/controllers/skill.controller.d.ts.map +1 -0
- package/dist/api/expertise/skill/controllers/skill.controller.js +357 -0
- package/dist/api/expertise/skill/controllers/skill.controller.js.map +1 -0
- package/dist/api/expertise/skill/controllers/skill.routes.fixture.d.ts +6 -0
- package/dist/api/expertise/skill/controllers/skill.routes.fixture.d.ts.map +1 -0
- package/dist/api/expertise/skill/controllers/skill.routes.fixture.js +24 -0
- package/dist/api/expertise/skill/controllers/skill.routes.fixture.js.map +1 -0
- package/dist/api/expertise/skill/dtos/skill-proficiency.dto.d.ts +14 -0
- package/dist/api/expertise/skill/dtos/skill-proficiency.dto.d.ts.map +1 -0
- package/dist/api/expertise/skill/dtos/skill-proficiency.dto.js +46 -0
- package/dist/api/expertise/skill/dtos/skill-proficiency.dto.js.map +1 -0
- package/dist/api/expertise/skill/dtos/skill-user.relationship.dto.d.ts +22 -0
- package/dist/api/expertise/skill/dtos/skill-user.relationship.dto.d.ts.map +1 -0
- package/dist/api/expertise/skill/dtos/skill-user.relationship.dto.js +54 -0
- package/dist/api/expertise/skill/dtos/skill-user.relationship.dto.js.map +1 -0
- package/dist/api/expertise/skill/dtos/skill.dto.d.ts +11 -0
- package/dist/api/expertise/skill/dtos/skill.dto.d.ts.map +1 -0
- package/dist/api/expertise/skill/dtos/skill.dto.js +45 -0
- package/dist/api/expertise/skill/dtos/skill.dto.js.map +1 -0
- package/dist/api/expertise/skill/dtos/skill.post.dto.d.ts +29 -0
- package/dist/api/expertise/skill/dtos/skill.post.dto.d.ts.map +1 -0
- package/dist/api/expertise/skill/dtos/skill.post.dto.js +115 -0
- package/dist/api/expertise/skill/dtos/skill.post.dto.js.map +1 -0
- package/dist/api/expertise/skill/dtos/skill.put.dto.d.ts +29 -0
- package/dist/api/expertise/skill/dtos/skill.put.dto.d.ts.map +1 -0
- package/dist/api/expertise/skill/dtos/skill.put.dto.js +115 -0
- package/dist/api/expertise/skill/dtos/skill.put.dto.js.map +1 -0
- package/dist/api/expertise/skill/dtos/skill.relationship.dto.d.ts +88 -0
- package/dist/api/expertise/skill/dtos/skill.relationship.dto.d.ts.map +1 -0
- package/dist/api/expertise/skill/dtos/skill.relationship.dto.js +182 -0
- package/dist/api/expertise/skill/dtos/skill.relationship.dto.js.map +1 -0
- package/dist/api/expertise/skill/entities/skill.d.ts +46 -0
- package/dist/api/expertise/skill/entities/skill.d.ts.map +1 -0
- package/dist/api/expertise/skill/entities/skill.js +49 -0
- package/dist/api/expertise/skill/entities/skill.js.map +1 -0
- package/dist/api/expertise/skill/entities/skill.meta.d.ts +3 -0
- package/dist/api/expertise/skill/entities/skill.meta.d.ts.map +1 -0
- package/dist/api/expertise/skill/entities/skill.meta.js +10 -0
- package/dist/api/expertise/skill/entities/skill.meta.js.map +1 -0
- package/dist/api/expertise/skill/repositories/skill.repository.d.ts +59 -0
- package/dist/api/expertise/skill/repositories/skill.repository.d.ts.map +1 -0
- package/dist/api/expertise/skill/repositories/skill.repository.js +109 -0
- package/dist/api/expertise/skill/repositories/skill.repository.js.map +1 -0
- package/dist/api/expertise/skill/services/skill.service.d.ts +95 -0
- package/dist/api/expertise/skill/services/skill.service.d.ts.map +1 -0
- package/dist/api/expertise/skill/services/skill.service.js +155 -0
- package/dist/api/expertise/skill/services/skill.service.js.map +1 -0
- package/dist/api/expertise/skill/skill.module.d.ts +8 -0
- package/dist/api/expertise/skill/skill.module.d.ts.map +1 -0
- package/dist/api/expertise/skill/skill.module.js +37 -0
- package/dist/api/expertise/skill/skill.module.js.map +1 -0
- package/dist/api/expertise/taxonomy/controllers/taxonomy.controller.d.ts +22 -0
- package/dist/api/expertise/taxonomy/controllers/taxonomy.controller.d.ts.map +1 -0
- package/dist/api/expertise/taxonomy/controllers/taxonomy.controller.js +190 -0
- package/dist/api/expertise/taxonomy/controllers/taxonomy.controller.js.map +1 -0
- package/dist/api/expertise/taxonomy/controllers/taxonomy.routes.fixture.d.ts +6 -0
- package/dist/api/expertise/taxonomy/controllers/taxonomy.routes.fixture.d.ts.map +1 -0
- package/dist/api/expertise/taxonomy/controllers/taxonomy.routes.fixture.js +18 -0
- package/dist/api/expertise/taxonomy/controllers/taxonomy.routes.fixture.js.map +1 -0
- package/dist/api/expertise/taxonomy/dtos/taxonomy.dto.d.ts +11 -0
- package/dist/api/expertise/taxonomy/dtos/taxonomy.dto.d.ts.map +1 -0
- package/dist/api/expertise/taxonomy/dtos/taxonomy.dto.js +45 -0
- package/dist/api/expertise/taxonomy/dtos/taxonomy.dto.js.map +1 -0
- package/dist/api/expertise/taxonomy/dtos/taxonomy.post.dto.d.ts +21 -0
- package/dist/api/expertise/taxonomy/dtos/taxonomy.post.dto.d.ts.map +1 -0
- package/dist/api/expertise/taxonomy/dtos/taxonomy.post.dto.js +84 -0
- package/dist/api/expertise/taxonomy/dtos/taxonomy.post.dto.js.map +1 -0
- package/dist/api/expertise/taxonomy/dtos/taxonomy.put.dto.d.ts +21 -0
- package/dist/api/expertise/taxonomy/dtos/taxonomy.put.dto.d.ts.map +1 -0
- package/dist/api/expertise/taxonomy/dtos/taxonomy.put.dto.js +84 -0
- package/dist/api/expertise/taxonomy/dtos/taxonomy.put.dto.js.map +1 -0
- package/dist/api/expertise/taxonomy/entities/taxonomy.d.ts +38 -0
- package/dist/api/expertise/taxonomy/entities/taxonomy.d.ts.map +1 -0
- package/dist/api/expertise/taxonomy/entities/taxonomy.js +43 -0
- package/dist/api/expertise/taxonomy/entities/taxonomy.js.map +1 -0
- package/dist/api/expertise/taxonomy/entities/taxonomy.meta.d.ts +3 -0
- package/dist/api/expertise/taxonomy/entities/taxonomy.meta.d.ts.map +1 -0
- package/dist/api/expertise/taxonomy/entities/taxonomy.meta.js +10 -0
- package/dist/api/expertise/taxonomy/entities/taxonomy.meta.js.map +1 -0
- package/dist/api/expertise/taxonomy/repositories/taxonomy.repository.d.ts +64 -0
- package/dist/api/expertise/taxonomy/repositories/taxonomy.repository.d.ts.map +1 -0
- package/dist/api/expertise/taxonomy/repositories/taxonomy.repository.js +118 -0
- package/dist/api/expertise/taxonomy/repositories/taxonomy.repository.js.map +1 -0
- package/dist/api/expertise/taxonomy/services/taxonomy.service.d.ts +53 -0
- package/dist/api/expertise/taxonomy/services/taxonomy.service.d.ts.map +1 -0
- package/dist/api/expertise/taxonomy/services/taxonomy.service.js +117 -0
- package/dist/api/expertise/taxonomy/services/taxonomy.service.js.map +1 -0
- package/dist/api/expertise/taxonomy/taxonomy.module.d.ts +8 -0
- package/dist/api/expertise/taxonomy/taxonomy.module.d.ts.map +1 -0
- package/dist/api/expertise/taxonomy/taxonomy.module.js +37 -0
- package/dist/api/expertise/taxonomy/taxonomy.module.js.map +1 -0
- package/dist/api/expertise/translations/controllers/expertise-translations.controller.d.ts +14 -0
- package/dist/api/expertise/translations/controllers/expertise-translations.controller.d.ts.map +1 -0
- package/dist/api/expertise/translations/controllers/expertise-translations.controller.js +87 -0
- package/dist/api/expertise/translations/controllers/expertise-translations.controller.js.map +1 -0
- package/dist/api/expertise/translations/controllers/expertise-translations.routes.fixture.d.ts +6 -0
- package/dist/api/expertise/translations/controllers/expertise-translations.routes.fixture.d.ts.map +1 -0
- package/dist/api/expertise/translations/controllers/expertise-translations.routes.fixture.js +9 -0
- package/dist/api/expertise/translations/controllers/expertise-translations.routes.fixture.js.map +1 -0
- package/dist/api/expertise/translations/repositories/cluster-translations.repository.d.ts +61 -0
- package/dist/api/expertise/translations/repositories/cluster-translations.repository.d.ts.map +1 -0
- package/dist/api/expertise/translations/repositories/cluster-translations.repository.js +52 -0
- package/dist/api/expertise/translations/repositories/cluster-translations.repository.js.map +1 -0
- package/dist/api/expertise/translations/repositories/community-of-expertise-translations.repository.d.ts +69 -0
- package/dist/api/expertise/translations/repositories/community-of-expertise-translations.repository.d.ts.map +1 -0
- package/dist/api/expertise/translations/repositories/community-of-expertise-translations.repository.js +48 -0
- package/dist/api/expertise/translations/repositories/community-of-expertise-translations.repository.js.map +1 -0
- package/dist/api/expertise/translations/services/cluster-translations.service.d.ts +55 -0
- package/dist/api/expertise/translations/services/cluster-translations.service.d.ts.map +1 -0
- package/dist/api/expertise/translations/services/cluster-translations.service.js +50 -0
- package/dist/api/expertise/translations/services/cluster-translations.service.js.map +1 -0
- package/dist/api/expertise/translations/services/community-of-expertise-translations.service.d.ts +67 -0
- package/dist/api/expertise/translations/services/community-of-expertise-translations.service.d.ts.map +1 -0
- package/dist/api/expertise/translations/services/community-of-expertise-translations.service.js +50 -0
- package/dist/api/expertise/translations/services/community-of-expertise-translations.service.js.map +1 -0
- package/dist/api/expertise/translations/translations.module.d.ts +11 -0
- package/dist/api/expertise/translations/translations.module.d.ts.map +1 -0
- package/dist/api/expertise/translations/translations.module.js +39 -0
- package/dist/api/expertise/translations/translations.module.js.map +1 -0
- package/dist/api/index.d.ts +97 -0
- package/dist/api/index.d.ts.map +1 -0
- package/dist/api/index.js +184 -0
- package/dist/api/index.js.map +1 -0
- package/dist/api/knowledge.module.d.ts +10 -0
- package/dist/api/knowledge.module.d.ts.map +1 -0
- package/dist/api/knowledge.module.js +93 -0
- package/dist/api/knowledge.module.js.map +1 -0
- package/dist/chunk-EXUPVXK4.mjs +2871 -0
- package/dist/chunk-EXUPVXK4.mjs.map +1 -0
- package/dist/chunk-HEG4DPMD.js +2876 -0
- package/dist/chunk-HEG4DPMD.js.map +1 -0
- package/dist/seed/index.d.ts +4 -0
- package/dist/seed/index.d.ts.map +1 -0
- package/dist/seed/index.js +9 -0
- package/dist/seed/index.js.map +1 -0
- package/dist/seed/knowledge.module.seed.d.ts +12 -0
- package/dist/seed/knowledge.module.seed.d.ts.map +1 -0
- package/dist/seed/knowledge.module.seed.js +44 -0
- package/dist/seed/knowledge.module.seed.js.map +1 -0
- package/dist/shared/content-language.d.ts +10 -0
- package/dist/shared/content-language.d.ts.map +1 -0
- package/dist/shared/content-language.js +5 -0
- package/dist/shared/content-language.js.map +1 -0
- package/dist/shared/content-status.d.ts +7 -0
- package/dist/shared/content-status.d.ts.map +1 -0
- package/dist/shared/content-status.js +5 -0
- package/dist/shared/content-status.js.map +1 -0
- package/dist/shared/index.d.ts +10 -0
- package/dist/shared/index.d.ts.map +1 -0
- package/dist/shared/index.js +32 -0
- package/dist/shared/index.js.map +1 -0
- package/dist/shared/knowledge.endpoints.d.ts +18 -0
- package/dist/shared/knowledge.endpoints.d.ts.map +1 -0
- package/dist/shared/knowledge.endpoints.js +21 -0
- package/dist/shared/knowledge.endpoints.js.map +1 -0
- package/dist/shared/knowledge.module.ids.d.ts +11 -0
- package/dist/shared/knowledge.module.ids.d.ts.map +1 -0
- package/dist/shared/knowledge.module.ids.js +14 -0
- package/dist/shared/knowledge.module.ids.js.map +1 -0
- package/dist/shared/knowledge.queues.d.ts +16 -0
- package/dist/shared/knowledge.queues.d.ts.map +1 -0
- package/dist/shared/knowledge.queues.js +17 -0
- package/dist/shared/knowledge.queues.js.map +1 -0
- package/dist/shared/knowledge.s3.folders.d.ts +5 -0
- package/dist/shared/knowledge.s3.folders.d.ts.map +1 -0
- package/dist/shared/knowledge.s3.folders.js +8 -0
- package/dist/shared/knowledge.s3.folders.js.map +1 -0
- package/dist/shared/role-in-community.d.ts +10 -0
- package/dist/shared/role-in-community.d.ts.map +1 -0
- package/dist/shared/role-in-community.js +15 -0
- package/dist/shared/role-in-community.js.map +1 -0
- package/dist/shared/schemas/graph-creation-event.schema.d.ts +66 -0
- package/dist/shared/schemas/graph-creation-event.schema.d.ts.map +1 -0
- package/dist/shared/schemas/graph-creation-event.schema.js +49 -0
- package/dist/shared/schemas/graph-creation-event.schema.js.map +1 -0
- package/dist/shared/schemas/index.d.ts +2 -0
- package/dist/shared/schemas/index.d.ts.map +1 -0
- package/dist/shared/schemas/index.js +11 -0
- package/dist/shared/schemas/index.js.map +1 -0
- package/dist/shared/skill-level.d.ts +8 -0
- package/dist/shared/skill-level.d.ts.map +1 -0
- package/dist/shared/skill-level.js +10 -0
- package/dist/shared/skill-level.js.map +1 -0
- package/dist/web/common/components/details/ImageHoverCard.d.ts +10 -0
- package/dist/web/common/components/details/ImageHoverCard.d.ts.map +1 -0
- package/dist/web/common/components/translations/TranslationsTab.d.ts +16 -0
- package/dist/web/common/components/translations/TranslationsTab.d.ts.map +1 -0
- package/dist/web/common/data/jsonAttribute.d.ts +49 -0
- package/dist/web/common/data/jsonAttribute.d.ts.map +1 -0
- package/dist/web/common/hooks/useContentLanguage.d.ts +9 -0
- package/dist/web/common/hooks/useContentLanguage.d.ts.map +1 -0
- package/dist/web/common/i18n/translationResolver.d.ts +15 -0
- package/dist/web/common/i18n/translationResolver.d.ts.map +1 -0
- package/dist/web/config/knowledge.modules.d.ts +7 -0
- package/dist/web/config/knowledge.modules.d.ts.map +1 -0
- package/dist/web/config/knowledge.ui.config.d.ts +26 -0
- package/dist/web/config/knowledge.ui.config.d.ts.map +1 -0
- package/dist/web/content/article/ArticleModule.d.ts +4 -0
- package/dist/web/content/article/ArticleModule.d.ts.map +1 -0
- package/dist/web/content/article/components/containers/ArticleContainer.d.ts +2 -0
- package/dist/web/content/article/components/containers/ArticleContainer.d.ts.map +1 -0
- package/dist/web/content/article/components/containers/ArticleListContainer.d.ts +2 -0
- package/dist/web/content/article/components/containers/ArticleListContainer.d.ts.map +1 -0
- package/dist/web/content/article/components/details/ArticleContent.d.ts +7 -0
- package/dist/web/content/article/components/details/ArticleContent.d.ts.map +1 -0
- package/dist/web/content/article/components/forms/ArticleDeleter.d.ts +7 -0
- package/dist/web/content/article/components/forms/ArticleDeleter.d.ts.map +1 -0
- package/dist/web/content/article/components/forms/ArticleEditor.d.ts +14 -0
- package/dist/web/content/article/components/forms/ArticleEditor.d.ts.map +1 -0
- package/dist/web/content/article/components/forms/ArticleMultiSelector.d.ts +14 -0
- package/dist/web/content/article/components/forms/ArticleMultiSelector.d.ts.map +1 -0
- package/dist/web/content/article/components/forms/ArticleSelector.d.ts +12 -0
- package/dist/web/content/article/components/forms/ArticleSelector.d.ts.map +1 -0
- package/dist/web/content/article/components/lists/ArticleList.d.ts +11 -0
- package/dist/web/content/article/components/lists/ArticleList.d.ts.map +1 -0
- package/dist/web/content/article/components/screens/ArticleDetailScreen.d.ts +5 -0
- package/dist/web/content/article/components/screens/ArticleDetailScreen.d.ts.map +1 -0
- package/dist/web/content/article/components/screens/ArticleListScreen.d.ts +2 -0
- package/dist/web/content/article/components/screens/ArticleListScreen.d.ts.map +1 -0
- package/dist/web/content/article/contexts/ArticleContext.d.ts +16 -0
- package/dist/web/content/article/contexts/ArticleContext.d.ts.map +1 -0
- package/dist/web/content/article/data/Article.d.ts +58 -0
- package/dist/web/content/article/data/Article.d.ts.map +1 -0
- package/dist/web/content/article/data/ArticleAliases.d.ts +11 -0
- package/dist/web/content/article/data/ArticleAliases.d.ts.map +1 -0
- package/dist/web/content/article/data/ArticleFields.d.ts +20 -0
- package/dist/web/content/article/data/ArticleFields.d.ts.map +1 -0
- package/dist/web/content/article/data/ArticleInterface.d.ts +37 -0
- package/dist/web/content/article/data/ArticleInterface.d.ts.map +1 -0
- package/dist/web/content/article/data/ArticleService.d.ts +69 -0
- package/dist/web/content/article/data/ArticleService.d.ts.map +1 -0
- package/dist/web/content/article/hooks/useArticleTableStructure.d.ts +5 -0
- package/dist/web/content/article/hooks/useArticleTableStructure.d.ts.map +1 -0
- package/dist/web/content/common/components/ContentStatusBadge.d.ts +6 -0
- package/dist/web/content/common/components/ContentStatusBadge.d.ts.map +1 -0
- package/dist/web/content/common/components/ContentStatusBar.d.ts +18 -0
- package/dist/web/content/common/components/ContentStatusBar.d.ts.map +1 -0
- package/dist/web/content/common/utils/contentStatus.d.ts +7 -0
- package/dist/web/content/common/utils/contentStatus.d.ts.map +1 -0
- package/dist/web/content/common/utils/translationMaps.d.ts +24 -0
- package/dist/web/content/common/utils/translationMaps.d.ts.map +1 -0
- package/dist/web/content/components/forms/ContentFileUpload.d.ts +6 -0
- package/dist/web/content/components/forms/ContentFileUpload.d.ts.map +1 -0
- package/dist/web/content/discussion/DiscussionModule.d.ts +4 -0
- package/dist/web/content/discussion/DiscussionModule.d.ts.map +1 -0
- package/dist/web/content/discussion/components/containers/DiscussionContainer.d.ts +2 -0
- package/dist/web/content/discussion/components/containers/DiscussionContainer.d.ts.map +1 -0
- package/dist/web/content/discussion/components/containers/DiscussionListContainer.d.ts +2 -0
- package/dist/web/content/discussion/components/containers/DiscussionListContainer.d.ts.map +1 -0
- package/dist/web/content/discussion/components/details/DiscussionContent.d.ts +7 -0
- package/dist/web/content/discussion/components/details/DiscussionContent.d.ts.map +1 -0
- package/dist/web/content/discussion/components/forms/DiscussionDeleter.d.ts +7 -0
- package/dist/web/content/discussion/components/forms/DiscussionDeleter.d.ts.map +1 -0
- package/dist/web/content/discussion/components/forms/DiscussionEditor.d.ts +14 -0
- package/dist/web/content/discussion/components/forms/DiscussionEditor.d.ts.map +1 -0
- package/dist/web/content/discussion/components/forms/DiscussionMultiSelector.d.ts +14 -0
- package/dist/web/content/discussion/components/forms/DiscussionMultiSelector.d.ts.map +1 -0
- package/dist/web/content/discussion/components/forms/DiscussionSelector.d.ts +12 -0
- package/dist/web/content/discussion/components/forms/DiscussionSelector.d.ts.map +1 -0
- package/dist/web/content/discussion/components/forms/GenerateArticleButton.d.ts +11 -0
- package/dist/web/content/discussion/components/forms/GenerateArticleButton.d.ts.map +1 -0
- package/dist/web/content/discussion/components/lists/DiscussionList.d.ts +11 -0
- package/dist/web/content/discussion/components/lists/DiscussionList.d.ts.map +1 -0
- package/dist/web/content/discussion/components/screens/DiscussionDetailScreen.d.ts +5 -0
- package/dist/web/content/discussion/components/screens/DiscussionDetailScreen.d.ts.map +1 -0
- package/dist/web/content/discussion/components/screens/DiscussionListScreen.d.ts +2 -0
- package/dist/web/content/discussion/components/screens/DiscussionListScreen.d.ts.map +1 -0
- package/dist/web/content/discussion/contexts/DiscussionContext.d.ts +16 -0
- package/dist/web/content/discussion/contexts/DiscussionContext.d.ts.map +1 -0
- package/dist/web/content/discussion/data/Discussion.d.ts +59 -0
- package/dist/web/content/discussion/data/Discussion.d.ts.map +1 -0
- package/dist/web/content/discussion/data/DiscussionFields.d.ts +20 -0
- package/dist/web/content/discussion/data/DiscussionFields.d.ts.map +1 -0
- package/dist/web/content/discussion/data/DiscussionInterface.d.ts +38 -0
- package/dist/web/content/discussion/data/DiscussionInterface.d.ts.map +1 -0
- package/dist/web/content/discussion/data/DiscussionService.d.ts +82 -0
- package/dist/web/content/discussion/data/DiscussionService.d.ts.map +1 -0
- package/dist/web/content/discussion/hooks/useDiscussionTableStructure.d.ts +5 -0
- package/dist/web/content/discussion/hooks/useDiscussionTableStructure.d.ts.map +1 -0
- package/dist/web/content/discussion-reply/DiscussionReplyModule.d.ts +4 -0
- package/dist/web/content/discussion-reply/DiscussionReplyModule.d.ts.map +1 -0
- package/dist/web/content/discussion-reply/components/DiscussionReplies.d.ts +6 -0
- package/dist/web/content/discussion-reply/components/DiscussionReplies.d.ts.map +1 -0
- package/dist/web/content/discussion-reply/components/DiscussionReplyEditor.d.ts +13 -0
- package/dist/web/content/discussion-reply/components/DiscussionReplyEditor.d.ts.map +1 -0
- package/dist/web/content/discussion-reply/components/DiscussionReplyItem.d.ts +10 -0
- package/dist/web/content/discussion-reply/components/DiscussionReplyItem.d.ts.map +1 -0
- package/dist/web/content/discussion-reply/components/ReplyApproveButton.d.ts +14 -0
- package/dist/web/content/discussion-reply/components/ReplyApproveButton.d.ts.map +1 -0
- package/dist/web/content/discussion-reply/components/containers/DiscussionReplyContainer.d.ts +2 -0
- package/dist/web/content/discussion-reply/components/containers/DiscussionReplyContainer.d.ts.map +1 -0
- package/dist/web/content/discussion-reply/components/containers/DiscussionReplyListContainer.d.ts +2 -0
- package/dist/web/content/discussion-reply/components/containers/DiscussionReplyListContainer.d.ts.map +1 -0
- package/dist/web/content/discussion-reply/components/details/DiscussionReplyContent.d.ts +7 -0
- package/dist/web/content/discussion-reply/components/details/DiscussionReplyContent.d.ts.map +1 -0
- package/dist/web/content/discussion-reply/components/forms/DiscussionReplyDeleter.d.ts +7 -0
- package/dist/web/content/discussion-reply/components/forms/DiscussionReplyDeleter.d.ts.map +1 -0
- package/dist/web/content/discussion-reply/components/forms/DiscussionReplyEditor.d.ts +14 -0
- package/dist/web/content/discussion-reply/components/forms/DiscussionReplyEditor.d.ts.map +1 -0
- package/dist/web/content/discussion-reply/components/forms/DiscussionReplyMultiSelector.d.ts +14 -0
- package/dist/web/content/discussion-reply/components/forms/DiscussionReplyMultiSelector.d.ts.map +1 -0
- package/dist/web/content/discussion-reply/components/forms/DiscussionReplySelector.d.ts +12 -0
- package/dist/web/content/discussion-reply/components/forms/DiscussionReplySelector.d.ts.map +1 -0
- package/dist/web/content/discussion-reply/components/lists/DiscussionReplyList.d.ts +9 -0
- package/dist/web/content/discussion-reply/components/lists/DiscussionReplyList.d.ts.map +1 -0
- package/dist/web/content/discussion-reply/components/screens/DiscussionReplyDetailScreen.d.ts +5 -0
- package/dist/web/content/discussion-reply/components/screens/DiscussionReplyDetailScreen.d.ts.map +1 -0
- package/dist/web/content/discussion-reply/components/screens/DiscussionReplyListScreen.d.ts +2 -0
- package/dist/web/content/discussion-reply/components/screens/DiscussionReplyListScreen.d.ts.map +1 -0
- package/dist/web/content/discussion-reply/contexts/DiscussionReplyContext.d.ts +16 -0
- package/dist/web/content/discussion-reply/contexts/DiscussionReplyContext.d.ts.map +1 -0
- package/dist/web/content/discussion-reply/data/DiscussionReply.d.ts +18 -0
- package/dist/web/content/discussion-reply/data/DiscussionReply.d.ts.map +1 -0
- package/dist/web/content/discussion-reply/data/DiscussionReplyFields.d.ts +10 -0
- package/dist/web/content/discussion-reply/data/DiscussionReplyFields.d.ts.map +1 -0
- package/dist/web/content/discussion-reply/data/DiscussionReplyInterface.d.ts +21 -0
- package/dist/web/content/discussion-reply/data/DiscussionReplyInterface.d.ts.map +1 -0
- package/dist/web/content/discussion-reply/data/DiscussionReplyService.d.ts +36 -0
- package/dist/web/content/discussion-reply/data/DiscussionReplyService.d.ts.map +1 -0
- package/dist/web/content/discussion-reply/hooks/useDiscussionReplyTableStructure.d.ts +5 -0
- package/dist/web/content/discussion-reply/hooks/useDiscussionReplyTableStructure.d.ts.map +1 -0
- package/dist/web/content/document/DocumentModule.d.ts +4 -0
- package/dist/web/content/document/DocumentModule.d.ts.map +1 -0
- package/dist/web/content/document/components/containers/DocumentContainer.d.ts +2 -0
- package/dist/web/content/document/components/containers/DocumentContainer.d.ts.map +1 -0
- package/dist/web/content/document/components/containers/DocumentListContainer.d.ts +2 -0
- package/dist/web/content/document/components/containers/DocumentListContainer.d.ts.map +1 -0
- package/dist/web/content/document/components/details/DocumentContent.d.ts +7 -0
- package/dist/web/content/document/components/details/DocumentContent.d.ts.map +1 -0
- package/dist/web/content/document/components/forms/DocumentDeleter.d.ts +7 -0
- package/dist/web/content/document/components/forms/DocumentDeleter.d.ts.map +1 -0
- package/dist/web/content/document/components/forms/DocumentDownloader.d.ts +11 -0
- package/dist/web/content/document/components/forms/DocumentDownloader.d.ts.map +1 -0
- package/dist/web/content/document/components/forms/DocumentEditor.d.ts +10 -0
- package/dist/web/content/document/components/forms/DocumentEditor.d.ts.map +1 -0
- package/dist/web/content/document/components/forms/DocumentMultiSelector.d.ts +14 -0
- package/dist/web/content/document/components/forms/DocumentMultiSelector.d.ts.map +1 -0
- package/dist/web/content/document/components/forms/DocumentSelector.d.ts +12 -0
- package/dist/web/content/document/components/forms/DocumentSelector.d.ts.map +1 -0
- package/dist/web/content/document/components/forms/DocumentUploadEditor.d.ts +13 -0
- package/dist/web/content/document/components/forms/DocumentUploadEditor.d.ts.map +1 -0
- package/dist/web/content/document/components/lists/DocumentList.d.ts +11 -0
- package/dist/web/content/document/components/lists/DocumentList.d.ts.map +1 -0
- package/dist/web/content/document/components/screens/DocumentDetailScreen.d.ts +5 -0
- package/dist/web/content/document/components/screens/DocumentDetailScreen.d.ts.map +1 -0
- package/dist/web/content/document/components/screens/DocumentListScreen.d.ts +2 -0
- package/dist/web/content/document/components/screens/DocumentListScreen.d.ts.map +1 -0
- package/dist/web/content/document/contexts/DocumentContext.d.ts +16 -0
- package/dist/web/content/document/contexts/DocumentContext.d.ts.map +1 -0
- package/dist/web/content/document/data/Document.d.ts +58 -0
- package/dist/web/content/document/data/Document.d.ts.map +1 -0
- package/dist/web/content/document/data/DocumentAliases.d.ts +11 -0
- package/dist/web/content/document/data/DocumentAliases.d.ts.map +1 -0
- package/dist/web/content/document/data/DocumentFields.d.ts +20 -0
- package/dist/web/content/document/data/DocumentFields.d.ts.map +1 -0
- package/dist/web/content/document/data/DocumentInterface.d.ts +37 -0
- package/dist/web/content/document/data/DocumentInterface.d.ts.map +1 -0
- package/dist/web/content/document/data/DocumentService.d.ts +69 -0
- package/dist/web/content/document/data/DocumentService.d.ts.map +1 -0
- package/dist/web/content/document/hooks/useDocumentTableStructure.d.ts +5 -0
- package/dist/web/content/document/hooks/useDocumentTableStructure.d.ts.map +1 -0
- package/dist/web/content/document/utils/fileExtension.d.ts +2 -0
- package/dist/web/content/document/utils/fileExtension.d.ts.map +1 -0
- package/dist/web/core.d.ts +49 -0
- package/dist/web/core.d.ts.map +1 -0
- package/dist/web/core.js +429 -0
- package/dist/web/core.js.map +1 -0
- package/dist/web/core.mjs +429 -0
- package/dist/web/core.mjs.map +1 -0
- package/dist/web/expertise/access-request/AccessRequestModule.d.ts +11 -0
- package/dist/web/expertise/access-request/AccessRequestModule.d.ts.map +1 -0
- package/dist/web/expertise/access-request/components/containers/AccessRequestListContainer.d.ts +2 -0
- package/dist/web/expertise/access-request/components/containers/AccessRequestListContainer.d.ts.map +1 -0
- package/dist/web/expertise/access-request/components/lists/AccessRequestList.d.ts +4 -0
- package/dist/web/expertise/access-request/components/lists/AccessRequestList.d.ts.map +1 -0
- package/dist/web/expertise/access-request/components/screens/AccessRequestListScreen.d.ts +2 -0
- package/dist/web/expertise/access-request/components/screens/AccessRequestListScreen.d.ts.map +1 -0
- package/dist/web/expertise/access-request/data/AccessRequest.d.ts +24 -0
- package/dist/web/expertise/access-request/data/AccessRequest.d.ts.map +1 -0
- package/dist/web/expertise/access-request/data/AccessRequestInterface.d.ts +16 -0
- package/dist/web/expertise/access-request/data/AccessRequestInterface.d.ts.map +1 -0
- package/dist/web/expertise/access-request/data/AccessRequestService.d.ts +11 -0
- package/dist/web/expertise/access-request/data/AccessRequestService.d.ts.map +1 -0
- package/dist/web/expertise/access-request/hooks/useAccessRequestTableStructure.d.ts +12 -0
- package/dist/web/expertise/access-request/hooks/useAccessRequestTableStructure.d.ts.map +1 -0
- package/dist/web/expertise/cluster/ClusterModule.d.ts +4 -0
- package/dist/web/expertise/cluster/ClusterModule.d.ts.map +1 -0
- package/dist/web/expertise/cluster/components/containers/ClusterContainer.d.ts +2 -0
- package/dist/web/expertise/cluster/components/containers/ClusterContainer.d.ts.map +1 -0
- package/dist/web/expertise/cluster/components/containers/ClusterListContainer.d.ts +3 -0
- package/dist/web/expertise/cluster/components/containers/ClusterListContainer.d.ts.map +1 -0
- package/dist/web/expertise/cluster/components/details/ClusterContent.d.ts +7 -0
- package/dist/web/expertise/cluster/components/details/ClusterContent.d.ts.map +1 -0
- package/dist/web/expertise/cluster/components/forms/AddUserToClusterDialog.d.ts +14 -0
- package/dist/web/expertise/cluster/components/forms/AddUserToClusterDialog.d.ts.map +1 -0
- package/dist/web/expertise/cluster/components/forms/ClusterAccessButtons.d.ts +16 -0
- package/dist/web/expertise/cluster/components/forms/ClusterAccessButtons.d.ts.map +1 -0
- package/dist/web/expertise/cluster/components/forms/ClusterDeleter.d.ts +7 -0
- package/dist/web/expertise/cluster/components/forms/ClusterDeleter.d.ts.map +1 -0
- package/dist/web/expertise/cluster/components/forms/ClusterEditor.d.ts +14 -0
- package/dist/web/expertise/cluster/components/forms/ClusterEditor.d.ts.map +1 -0
- package/dist/web/expertise/cluster/components/forms/ClusterMultiSelector.d.ts +14 -0
- package/dist/web/expertise/cluster/components/forms/ClusterMultiSelector.d.ts.map +1 -0
- package/dist/web/expertise/cluster/components/forms/ClusterParentSelector.d.ts +22 -0
- package/dist/web/expertise/cluster/components/forms/ClusterParentSelector.d.ts.map +1 -0
- package/dist/web/expertise/cluster/components/forms/ClusterSelector.d.ts +12 -0
- package/dist/web/expertise/cluster/components/forms/ClusterSelector.d.ts.map +1 -0
- package/dist/web/expertise/cluster/components/lists/ClusterList.d.ts +9 -0
- package/dist/web/expertise/cluster/components/lists/ClusterList.d.ts.map +1 -0
- package/dist/web/expertise/cluster/components/lists/ClusterMembersList.d.ts +21 -0
- package/dist/web/expertise/cluster/components/lists/ClusterMembersList.d.ts.map +1 -0
- package/dist/web/expertise/cluster/components/lists/ClusterRequestsList.d.ts +10 -0
- package/dist/web/expertise/cluster/components/lists/ClusterRequestsList.d.ts.map +1 -0
- package/dist/web/expertise/cluster/contexts/ClusterContext.d.ts +16 -0
- package/dist/web/expertise/cluster/contexts/ClusterContext.d.ts.map +1 -0
- package/dist/web/expertise/cluster/data/Cluster.d.ts +44 -0
- package/dist/web/expertise/cluster/data/Cluster.d.ts.map +1 -0
- package/dist/web/expertise/cluster/data/ClusterAliases.d.ts +19 -0
- package/dist/web/expertise/cluster/data/ClusterAliases.d.ts.map +1 -0
- package/dist/web/expertise/cluster/data/ClusterFields.d.ts +15 -0
- package/dist/web/expertise/cluster/data/ClusterFields.d.ts.map +1 -0
- package/dist/web/expertise/cluster/data/ClusterInterface.d.ts +24 -0
- package/dist/web/expertise/cluster/data/ClusterInterface.d.ts.map +1 -0
- package/dist/web/expertise/cluster/data/ClusterService.d.ts +77 -0
- package/dist/web/expertise/cluster/data/ClusterService.d.ts.map +1 -0
- package/dist/web/expertise/cluster/hooks/useClusterTableStructure.d.ts +5 -0
- package/dist/web/expertise/cluster/hooks/useClusterTableStructure.d.ts.map +1 -0
- package/dist/web/expertise/common/hooks/useExpertiseUserTableStructure.d.ts +38 -0
- package/dist/web/expertise/common/hooks/useExpertiseUserTableStructure.d.ts.map +1 -0
- package/dist/web/expertise/common/i18n/resolveBlockNoteField.d.ts +14 -0
- package/dist/web/expertise/common/i18n/resolveBlockNoteField.d.ts.map +1 -0
- package/dist/web/expertise/community-of-expertise/CommunityOfExpertiseModule.d.ts +4 -0
- package/dist/web/expertise/community-of-expertise/CommunityOfExpertiseModule.d.ts.map +1 -0
- package/dist/web/expertise/community-of-expertise/components/containers/CommunityOfExpertiseContainer.d.ts +2 -0
- package/dist/web/expertise/community-of-expertise/components/containers/CommunityOfExpertiseContainer.d.ts.map +1 -0
- package/dist/web/expertise/community-of-expertise/components/containers/CommunityOfExpertiseListContainer.d.ts +3 -0
- package/dist/web/expertise/community-of-expertise/components/containers/CommunityOfExpertiseListContainer.d.ts.map +1 -0
- package/dist/web/expertise/community-of-expertise/components/details/CommunityOfExpertiseContent.d.ts +7 -0
- package/dist/web/expertise/community-of-expertise/components/details/CommunityOfExpertiseContent.d.ts.map +1 -0
- package/dist/web/expertise/community-of-expertise/components/forms/AddUserToCommunityDialog.d.ts +15 -0
- package/dist/web/expertise/community-of-expertise/components/forms/AddUserToCommunityDialog.d.ts.map +1 -0
- package/dist/web/expertise/community-of-expertise/components/forms/CommunityAccessButtons.d.ts +16 -0
- package/dist/web/expertise/community-of-expertise/components/forms/CommunityAccessButtons.d.ts.map +1 -0
- package/dist/web/expertise/community-of-expertise/components/forms/CommunityOfExpertiseDeleter.d.ts +7 -0
- package/dist/web/expertise/community-of-expertise/components/forms/CommunityOfExpertiseDeleter.d.ts.map +1 -0
- package/dist/web/expertise/community-of-expertise/components/forms/CommunityOfExpertiseEditor.d.ts +14 -0
- package/dist/web/expertise/community-of-expertise/components/forms/CommunityOfExpertiseEditor.d.ts.map +1 -0
- package/dist/web/expertise/community-of-expertise/components/forms/CommunityOfExpertiseMultiSelector.d.ts +14 -0
- package/dist/web/expertise/community-of-expertise/components/forms/CommunityOfExpertiseMultiSelector.d.ts.map +1 -0
- package/dist/web/expertise/community-of-expertise/components/forms/CommunityOfExpertiseSelector.d.ts +12 -0
- package/dist/web/expertise/community-of-expertise/components/forms/CommunityOfExpertiseSelector.d.ts.map +1 -0
- package/dist/web/expertise/community-of-expertise/components/forms/CommunityParentSelector.d.ts +25 -0
- package/dist/web/expertise/community-of-expertise/components/forms/CommunityParentSelector.d.ts.map +1 -0
- package/dist/web/expertise/community-of-expertise/components/forms/CommunityRoleDropdown.d.ts +13 -0
- package/dist/web/expertise/community-of-expertise/components/forms/CommunityRoleDropdown.d.ts.map +1 -0
- package/dist/web/expertise/community-of-expertise/components/lists/CommunityMembersList.d.ts +19 -0
- package/dist/web/expertise/community-of-expertise/components/lists/CommunityMembersList.d.ts.map +1 -0
- package/dist/web/expertise/community-of-expertise/components/lists/CommunityOfExpertiseList.d.ts +9 -0
- package/dist/web/expertise/community-of-expertise/components/lists/CommunityOfExpertiseList.d.ts.map +1 -0
- package/dist/web/expertise/community-of-expertise/components/lists/CommunityRequestsList.d.ts +10 -0
- package/dist/web/expertise/community-of-expertise/components/lists/CommunityRequestsList.d.ts.map +1 -0
- package/dist/web/expertise/community-of-expertise/components/screens/CommunityOfExpertiseDetailScreen.d.ts +5 -0
- package/dist/web/expertise/community-of-expertise/components/screens/CommunityOfExpertiseDetailScreen.d.ts.map +1 -0
- package/dist/web/expertise/community-of-expertise/components/screens/CommunityOfExpertiseListScreen.d.ts +2 -0
- package/dist/web/expertise/community-of-expertise/components/screens/CommunityOfExpertiseListScreen.d.ts.map +1 -0
- package/dist/web/expertise/community-of-expertise/contexts/CommunityOfExpertiseContext.d.ts +16 -0
- package/dist/web/expertise/community-of-expertise/contexts/CommunityOfExpertiseContext.d.ts.map +1 -0
- package/dist/web/expertise/community-of-expertise/data/CommunityOfExpertise.d.ts +56 -0
- package/dist/web/expertise/community-of-expertise/data/CommunityOfExpertise.d.ts.map +1 -0
- package/dist/web/expertise/community-of-expertise/data/CommunityOfExpertiseAliases.d.ts +19 -0
- package/dist/web/expertise/community-of-expertise/data/CommunityOfExpertiseAliases.d.ts.map +1 -0
- package/dist/web/expertise/community-of-expertise/data/CommunityOfExpertiseFields.d.ts +16 -0
- package/dist/web/expertise/community-of-expertise/data/CommunityOfExpertiseFields.d.ts.map +1 -0
- package/dist/web/expertise/community-of-expertise/data/CommunityOfExpertiseInterface.d.ts +32 -0
- package/dist/web/expertise/community-of-expertise/data/CommunityOfExpertiseInterface.d.ts.map +1 -0
- package/dist/web/expertise/community-of-expertise/data/CommunityOfExpertiseService.d.ts +92 -0
- package/dist/web/expertise/community-of-expertise/data/CommunityOfExpertiseService.d.ts.map +1 -0
- package/dist/web/expertise/community-of-expertise/hooks/useCommunityOfExpertiseTableStructure.d.ts +5 -0
- package/dist/web/expertise/community-of-expertise/hooks/useCommunityOfExpertiseTableStructure.d.ts.map +1 -0
- package/dist/web/expertise/skill/SkillModule.d.ts +4 -0
- package/dist/web/expertise/skill/SkillModule.d.ts.map +1 -0
- package/dist/web/expertise/skill/components/containers/SkillContainer.d.ts +2 -0
- package/dist/web/expertise/skill/components/containers/SkillContainer.d.ts.map +1 -0
- package/dist/web/expertise/skill/components/containers/SkillListContainer.d.ts +2 -0
- package/dist/web/expertise/skill/components/containers/SkillListContainer.d.ts.map +1 -0
- package/dist/web/expertise/skill/components/details/SkillContent.d.ts +8 -0
- package/dist/web/expertise/skill/components/details/SkillContent.d.ts.map +1 -0
- package/dist/web/expertise/skill/components/forms/AddUserToSkillDialog.d.ts +15 -0
- package/dist/web/expertise/skill/components/forms/AddUserToSkillDialog.d.ts.map +1 -0
- package/dist/web/expertise/skill/components/forms/ClaimSkillButton.d.ts +9 -0
- package/dist/web/expertise/skill/components/forms/ClaimSkillButton.d.ts.map +1 -0
- package/dist/web/expertise/skill/components/forms/SkillDeleter.d.ts +7 -0
- package/dist/web/expertise/skill/components/forms/SkillDeleter.d.ts.map +1 -0
- package/dist/web/expertise/skill/components/forms/SkillEditor.d.ts +14 -0
- package/dist/web/expertise/skill/components/forms/SkillEditor.d.ts.map +1 -0
- package/dist/web/expertise/skill/components/forms/SkillMultiSelector.d.ts +14 -0
- package/dist/web/expertise/skill/components/forms/SkillMultiSelector.d.ts.map +1 -0
- package/dist/web/expertise/skill/components/forms/SkillProficiencyDropdown.d.ts +11 -0
- package/dist/web/expertise/skill/components/forms/SkillProficiencyDropdown.d.ts.map +1 -0
- package/dist/web/expertise/skill/components/forms/SkillSelector.d.ts +12 -0
- package/dist/web/expertise/skill/components/forms/SkillSelector.d.ts.map +1 -0
- package/dist/web/expertise/skill/components/lists/SkillList.d.ts +7 -0
- package/dist/web/expertise/skill/components/lists/SkillList.d.ts.map +1 -0
- package/dist/web/expertise/skill/components/screens/SkillDetailScreen.d.ts +5 -0
- package/dist/web/expertise/skill/components/screens/SkillDetailScreen.d.ts.map +1 -0
- package/dist/web/expertise/skill/components/screens/SkillListScreen.d.ts +2 -0
- package/dist/web/expertise/skill/components/screens/SkillListScreen.d.ts.map +1 -0
- package/dist/web/expertise/skill/contexts/SkillContext.d.ts +16 -0
- package/dist/web/expertise/skill/contexts/SkillContext.d.ts.map +1 -0
- package/dist/web/expertise/skill/data/Skill.d.ts +63 -0
- package/dist/web/expertise/skill/data/Skill.d.ts.map +1 -0
- package/dist/web/expertise/skill/data/SkillFields.d.ts +12 -0
- package/dist/web/expertise/skill/data/SkillFields.d.ts.map +1 -0
- package/dist/web/expertise/skill/data/SkillInterface.d.ts +26 -0
- package/dist/web/expertise/skill/data/SkillInterface.d.ts.map +1 -0
- package/dist/web/expertise/skill/data/SkillService.d.ts +64 -0
- package/dist/web/expertise/skill/data/SkillService.d.ts.map +1 -0
- package/dist/web/expertise/skill/hooks/useSkillTableStructure.d.ts +5 -0
- package/dist/web/expertise/skill/hooks/useSkillTableStructure.d.ts.map +1 -0
- package/dist/web/expertise/taxonomy/TaxonomyModule.d.ts +4 -0
- package/dist/web/expertise/taxonomy/TaxonomyModule.d.ts.map +1 -0
- package/dist/web/expertise/taxonomy/components/containers/TaxonomyContainer.d.ts +2 -0
- package/dist/web/expertise/taxonomy/components/containers/TaxonomyContainer.d.ts.map +1 -0
- package/dist/web/expertise/taxonomy/components/containers/TaxonomyListContainer.d.ts +2 -0
- package/dist/web/expertise/taxonomy/components/containers/TaxonomyListContainer.d.ts.map +1 -0
- package/dist/web/expertise/taxonomy/components/details/TaxonomyBadge.d.ts +13 -0
- package/dist/web/expertise/taxonomy/components/details/TaxonomyBadge.d.ts.map +1 -0
- package/dist/web/expertise/taxonomy/components/details/TaxonomyContent.d.ts +7 -0
- package/dist/web/expertise/taxonomy/components/details/TaxonomyContent.d.ts.map +1 -0
- package/dist/web/expertise/taxonomy/components/forms/TaxonomyDeleter.d.ts +7 -0
- package/dist/web/expertise/taxonomy/components/forms/TaxonomyDeleter.d.ts.map +1 -0
- package/dist/web/expertise/taxonomy/components/forms/TaxonomyEditor.d.ts +14 -0
- package/dist/web/expertise/taxonomy/components/forms/TaxonomyEditor.d.ts.map +1 -0
- package/dist/web/expertise/taxonomy/components/forms/TaxonomyMultiSelector.d.ts +14 -0
- package/dist/web/expertise/taxonomy/components/forms/TaxonomyMultiSelector.d.ts.map +1 -0
- package/dist/web/expertise/taxonomy/components/forms/TaxonomySelector.d.ts +12 -0
- package/dist/web/expertise/taxonomy/components/forms/TaxonomySelector.d.ts.map +1 -0
- package/dist/web/expertise/taxonomy/components/lists/TaxonomyBadgesList.d.ts +8 -0
- package/dist/web/expertise/taxonomy/components/lists/TaxonomyBadgesList.d.ts.map +1 -0
- package/dist/web/expertise/taxonomy/components/lists/TaxonomyList.d.ts +11 -0
- package/dist/web/expertise/taxonomy/components/lists/TaxonomyList.d.ts.map +1 -0
- package/dist/web/expertise/taxonomy/components/screens/TaxonomyDetailScreen.d.ts +5 -0
- package/dist/web/expertise/taxonomy/components/screens/TaxonomyDetailScreen.d.ts.map +1 -0
- package/dist/web/expertise/taxonomy/components/screens/TaxonomyListScreen.d.ts +2 -0
- package/dist/web/expertise/taxonomy/components/screens/TaxonomyListScreen.d.ts.map +1 -0
- package/dist/web/expertise/taxonomy/contexts/TaxonomyContext.d.ts +16 -0
- package/dist/web/expertise/taxonomy/contexts/TaxonomyContext.d.ts.map +1 -0
- package/dist/web/expertise/taxonomy/data/Taxonomy.d.ts +34 -0
- package/dist/web/expertise/taxonomy/data/Taxonomy.d.ts.map +1 -0
- package/dist/web/expertise/taxonomy/data/TaxonomyAliases.d.ts +7 -0
- package/dist/web/expertise/taxonomy/data/TaxonomyAliases.d.ts.map +1 -0
- package/dist/web/expertise/taxonomy/data/TaxonomyFields.d.ts +11 -0
- package/dist/web/expertise/taxonomy/data/TaxonomyFields.d.ts.map +1 -0
- package/dist/web/expertise/taxonomy/data/TaxonomyInterface.d.ts +19 -0
- package/dist/web/expertise/taxonomy/data/TaxonomyInterface.d.ts.map +1 -0
- package/dist/web/expertise/taxonomy/data/TaxonomyService.d.ts +42 -0
- package/dist/web/expertise/taxonomy/data/TaxonomyService.d.ts.map +1 -0
- package/dist/web/expertise/taxonomy/hooks/useTaxonomyTableStructure.d.ts +5 -0
- package/dist/web/expertise/taxonomy/hooks/useTaxonomyTableStructure.d.ts.map +1 -0
- package/dist/web/index.d.ts +62 -0
- package/dist/web/index.d.ts.map +1 -0
- package/dist/web/index.js +7295 -0
- package/dist/web/index.js.map +1 -0
- package/dist/web/index.mjs +7293 -0
- package/dist/web/index.mjs.map +1 -0
- package/dist/web/knowledge.registry.d.ts +21 -0
- package/dist/web/knowledge.registry.d.ts.map +1 -0
- package/messages/ar.json +675 -0
- package/messages/en.json +675 -0
- package/messages/es.json +675 -0
- package/messages/fr.json +675 -0
- package/messages/pt.json +675 -0
- package/messages/ru.json +675 -0
- package/package.json +226 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/web/config/knowledge.ui.config.ts","../../src/web/common/components/translations/TranslationsTab.tsx","../../src/web/common/hooks/useContentLanguage.ts","../../src/web/content/article/components/forms/ArticleDeleter.tsx","../../src/web/content/components/forms/ContentFileUpload.tsx","../../src/web/expertise/community-of-expertise/components/forms/CommunityOfExpertiseSelector.tsx","../../src/web/expertise/taxonomy/components/forms/TaxonomyMultiSelector.tsx","../../src/web/content/article/components/forms/ArticleEditor.tsx","../../src/web/content/article/contexts/ArticleContext.tsx","../../src/web/content/common/utils/contentStatus.ts","../../src/web/content/common/components/ContentStatusBadge.tsx","../../src/web/content/article/hooks/useArticleTableStructure.tsx","../../src/web/content/article/components/lists/ArticleList.tsx","../../src/web/content/article/components/containers/ArticleListContainer.tsx","../../src/web/content/article/components/details/ArticleContent.tsx","../../src/web/content/common/components/ContentStatusBar.tsx","../../src/web/content/article/components/containers/ArticleContainer.tsx","../../src/web/content/article/components/forms/ArticleMultiSelector.tsx","../../src/web/content/article/components/screens/ArticleListScreen.tsx","../../src/web/content/article/components/screens/ArticleDetailScreen.tsx","../../src/web/content/discussion/components/forms/DiscussionDeleter.tsx","../../src/web/content/discussion/components/forms/DiscussionEditor.tsx","../../src/web/content/discussion/contexts/DiscussionContext.tsx","../../src/web/content/discussion/hooks/useDiscussionTableStructure.tsx","../../src/web/content/discussion/components/lists/DiscussionList.tsx","../../src/web/content/discussion/components/containers/DiscussionListContainer.tsx","../../src/web/content/discussion-reply/components/DiscussionReplyEditor.tsx","../../src/web/content/discussion-reply/components/ReplyApproveButton.tsx","../../src/web/content/discussion-reply/components/DiscussionReplyItem.tsx","../../src/web/content/discussion-reply/components/DiscussionReplies.tsx","../../src/web/content/discussion/components/details/DiscussionContent.tsx","../../src/web/content/discussion/components/forms/GenerateArticleButton.tsx","../../src/web/content/discussion/components/containers/DiscussionContainer.tsx","../../src/web/content/discussion/components/forms/DiscussionMultiSelector.tsx","../../src/web/content/discussion/components/screens/DiscussionListScreen.tsx","../../src/web/content/discussion/components/screens/DiscussionDetailScreen.tsx","../../src/web/content/discussion-reply/components/forms/DiscussionReplyDeleter.tsx","../../src/web/content/discussion/components/forms/DiscussionSelector.tsx","../../src/web/content/discussion-reply/components/forms/DiscussionReplyEditor.tsx","../../src/web/content/discussion-reply/contexts/DiscussionReplyContext.tsx","../../src/web/content/discussion-reply/hooks/useDiscussionReplyTableStructure.tsx","../../src/web/content/discussion-reply/components/lists/DiscussionReplyList.tsx","../../src/web/content/discussion-reply/components/containers/DiscussionReplyListContainer.tsx","../../src/web/content/discussion-reply/components/details/DiscussionReplyContent.tsx","../../src/web/content/discussion-reply/components/containers/DiscussionReplyContainer.tsx","../../src/web/content/discussion-reply/components/forms/DiscussionReplyMultiSelector.tsx","../../src/web/content/discussion-reply/components/screens/DiscussionReplyListScreen.tsx","../../src/web/content/discussion-reply/components/screens/DiscussionReplyDetailScreen.tsx","../../src/web/content/document/components/forms/DocumentDeleter.tsx","../../src/web/content/document/utils/fileExtension.ts","../../src/web/content/document/components/forms/DocumentUploadEditor.tsx","../../src/web/content/document/components/forms/DocumentEditor.tsx","../../src/web/content/document/contexts/DocumentContext.tsx","../../src/web/content/document/hooks/useDocumentTableStructure.tsx","../../src/web/content/document/components/lists/DocumentList.tsx","../../src/web/content/document/components/containers/DocumentListContainer.tsx","../../src/web/expertise/taxonomy/components/details/TaxonomyBadge.tsx","../../src/web/expertise/taxonomy/components/lists/TaxonomyBadgesList.tsx","../../src/web/content/document/components/details/DocumentContent.tsx","../../src/web/content/document/components/forms/DocumentDownloader.tsx","../../src/web/content/document/components/containers/DocumentContainer.tsx","../../src/web/content/document/components/forms/DocumentMultiSelector.tsx","../../src/web/content/document/components/screens/DocumentListScreen.tsx","../../src/web/content/document/components/screens/DocumentDetailScreen.tsx","../../src/web/expertise/cluster/components/forms/ClusterAccessButtons.tsx","../../src/web/expertise/cluster/components/forms/ClusterDeleter.tsx","../../src/web/expertise/cluster/components/forms/ClusterParentSelector.tsx","../../src/web/expertise/cluster/components/forms/ClusterEditor.tsx","../../src/web/expertise/cluster/contexts/ClusterContext.tsx","../../src/web/expertise/cluster/hooks/useClusterTableStructure.tsx","../../src/web/expertise/cluster/components/lists/ClusterList.tsx","../../src/web/expertise/cluster/components/containers/ClusterListContainer.tsx","../../src/web/expertise/common/i18n/resolveBlockNoteField.ts","../../src/web/expertise/cluster/components/details/ClusterContent.tsx","../../src/web/expertise/common/hooks/useExpertiseUserTableStructure.tsx","../../src/web/expertise/cluster/components/forms/AddUserToClusterDialog.tsx","../../src/web/expertise/cluster/components/lists/ClusterMembersList.tsx","../../src/web/expertise/cluster/components/lists/ClusterRequestsList.tsx","../../src/web/expertise/cluster/components/forms/ClusterSelector.tsx","../../src/web/expertise/community-of-expertise/components/forms/CommunityParentSelector.tsx","../../src/web/expertise/community-of-expertise/components/forms/CommunityOfExpertiseEditor.tsx","../../src/web/common/components/details/ImageHoverCard.tsx","../../src/web/expertise/community-of-expertise/hooks/useCommunityOfExpertiseTableStructure.tsx","../../src/web/expertise/community-of-expertise/components/lists/CommunityOfExpertiseList.tsx","../../src/web/expertise/cluster/components/containers/ClusterContainer.tsx","../../src/web/expertise/cluster/components/forms/ClusterMultiSelector.tsx","../../src/web/expertise/community-of-expertise/components/forms/CommunityAccessButtons.tsx","../../src/web/expertise/community-of-expertise/components/forms/CommunityOfExpertiseDeleter.tsx","../../src/web/expertise/community-of-expertise/contexts/CommunityOfExpertiseContext.tsx","../../src/web/expertise/community-of-expertise/components/containers/CommunityOfExpertiseListContainer.tsx","../../src/web/expertise/community-of-expertise/components/details/CommunityOfExpertiseContent.tsx","../../src/web/expertise/community-of-expertise/components/forms/AddUserToCommunityDialog.tsx","../../src/web/expertise/community-of-expertise/components/forms/CommunityRoleDropdown.tsx","../../src/web/expertise/community-of-expertise/components/lists/CommunityMembersList.tsx","../../src/web/expertise/community-of-expertise/components/lists/CommunityRequestsList.tsx","../../src/web/expertise/taxonomy/components/forms/TaxonomySelector.tsx","../../src/web/expertise/taxonomy/components/forms/TaxonomyEditor.tsx","../../src/web/expertise/taxonomy/hooks/useTaxonomyTableStructure.tsx","../../src/web/expertise/taxonomy/components/lists/TaxonomyList.tsx","../../src/web/expertise/community-of-expertise/components/containers/CommunityOfExpertiseContainer.tsx","../../src/web/expertise/community-of-expertise/components/forms/CommunityOfExpertiseMultiSelector.tsx","../../src/web/expertise/community-of-expertise/components/screens/CommunityOfExpertiseListScreen.tsx","../../src/web/expertise/community-of-expertise/components/screens/CommunityOfExpertiseDetailScreen.tsx","../../src/web/expertise/taxonomy/components/forms/TaxonomyDeleter.tsx","../../src/web/expertise/taxonomy/contexts/TaxonomyContext.tsx","../../src/web/expertise/taxonomy/components/containers/TaxonomyListContainer.tsx","../../src/web/expertise/taxonomy/components/details/TaxonomyContent.tsx","../../src/web/expertise/taxonomy/components/containers/TaxonomyContainer.tsx","../../src/web/expertise/taxonomy/components/screens/TaxonomyListScreen.tsx","../../src/web/expertise/taxonomy/components/screens/TaxonomyDetailScreen.tsx","../../src/web/expertise/skill/components/forms/SkillDeleter.tsx","../../src/web/expertise/skill/components/forms/SkillEditor.tsx","../../src/web/expertise/skill/contexts/SkillContext.tsx","../../src/web/expertise/skill/hooks/useSkillTableStructure.tsx","../../src/web/expertise/skill/components/lists/SkillList.tsx","../../src/web/expertise/skill/components/containers/SkillListContainer.tsx","../../src/web/expertise/skill/components/forms/AddUserToSkillDialog.tsx","../../src/web/expertise/skill/components/forms/ClaimSkillButton.tsx","../../src/web/expertise/skill/components/forms/SkillProficiencyDropdown.tsx","../../src/web/expertise/skill/components/details/SkillContent.tsx","../../src/web/expertise/skill/components/containers/SkillContainer.tsx","../../src/web/expertise/skill/components/forms/SkillMultiSelector.tsx","../../src/web/expertise/skill/components/screens/SkillListScreen.tsx","../../src/web/expertise/skill/components/screens/SkillDetailScreen.tsx","../../src/web/expertise/access-request/hooks/useAccessRequestTableStructure.tsx","../../src/web/expertise/access-request/components/lists/AccessRequestList.tsx","../../src/web/expertise/access-request/components/containers/AccessRequestListContainer.tsx","../../src/web/expertise/access-request/components/screens/AccessRequestListScreen.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ModuleWithPermissions } from \"@carlonicora/nextjs-jsonapi/core\";\nimport type { useTranslations } from \"next-intl\";\nimport type { ReactNode } from \"react\";\nimport type { SkillInterface } from \"../expertise/skill/data/SkillInterface\";\nimport type { TaxonomyInterface } from \"../expertise/taxonomy/data/TaxonomyInterface\";\n\n/** An extra tab for the Skill or Taxonomy container: the same shape as the module tabs those containers build. */\nexport interface KnowledgeTab {\n key: ModuleWithPermissions;\n label: string;\n content: ReactNode;\n}\n\n/** The container's own `useTranslations()` result. */\nexport type KnowledgeTranslate = ReturnType<typeof useTranslations>;\n\nexport interface KnowledgeUiConfig {\n revalidatePaths: (path: string) => Promise<void>;\n /** A hook: the current user's saved language, or undefined to fall back to the UI locale. */\n useUserLanguage: () => string | undefined;\n /** Extra tabs, inserted just before the Translations tab. Called during the container's render. */\n tabs?: {\n skill?: (skill: SkillInterface, t: KnowledgeTranslate) => KnowledgeTab[];\n taxonomy?: (taxonomy: TaxonomyInterface, t: KnowledgeTranslate) => KnowledgeTab[];\n };\n}\n\n// Stored on globalThis so the CommonJS and ESM builds of the package share one configuration.\nconst KEY = Symbol.for(\"nja-knowledge.ui\");\n\nexport function configureKnowledgeUi(config: KnowledgeUiConfig): void {\n (globalThis as unknown as Record<symbol, unknown>)[KEY] = config;\n}\n\nexport function getKnowledgeUiConfig(): KnowledgeUiConfig {\n const config = (globalThis as unknown as Record<symbol, unknown>)[KEY] as KnowledgeUiConfig | undefined;\n if (!config) throw new Error(\"nja-knowledge: configureKnowledgeUi() was not called\");\n return config;\n}\n","\"use client\";\n\nimport { BlockNoteTranslationMap, ScalarTranslationMap, TranslationMap } from \"../../i18n/translationResolver\";\nimport { ContentLanguage } from \"../../../../shared\";\nimport {\n Button,\n errorToast,\n Form,\n FormBlockNote,\n FormInput,\n Tabs,\n TabsContent,\n TabsList,\n TabsTrigger,\n} from \"@carlonicora/nextjs-jsonapi/components\";\nimport { showToast } from \"@carlonicora/nextjs-jsonapi/core\";\nimport { useTranslations } from \"next-intl\";\nimport { useMemo, useState } from \"react\";\nimport { useForm } from \"react-hook-form\";\n\nexport type TranslatableField = \"name\" | \"description\" | \"content\" | \"abstract\" | \"tldr\";\n\n/** Rich-text fields hold a blocks array in memory: the model parsed them, and the model's\n * `createTranslationJsonApi` stringifies them on the way out. This component never converts. */\nconst BLOCK_NOTE_FIELDS: TranslatableField[] = [\"description\", \"content\", \"abstract\"];\n\nexport type TranslationsTabEntity = {\n id: string;\n language?: string;\n translation?: TranslationMap;\n abstractTranslation?: BlockNoteTranslationMap;\n tldrTranslation?: ScalarTranslationMap;\n};\n\nexport type TranslationsTabProps = {\n entity: TranslationsTabEntity;\n fields: TranslatableField[];\n onSave: (language: string, fields: Record<string, unknown>) => Promise<void>;\n};\n\nfunction defaultValueFor(params: { entity: TranslationsTabEntity; field: TranslatableField; language: string }): any {\n const { entity, field, language } = params;\n\n const value =\n field === \"abstract\"\n ? entity.abstractTranslation?.[language]\n : field === \"tldr\"\n ? entity.tldrTranslation?.[language]\n : entity.translation?.[language]?.[field];\n\n if (value === undefined || value === null) return BLOCK_NOTE_FIELDS.includes(field) ? [] : \"\";\n return value;\n}\n\nfunction TranslationsTabPanel({ entity, fields, language, onSave }: TranslationsTabProps & { language: string }) {\n const t = useTranslations();\n const [isSaving, setIsSaving] = useState<boolean>(false);\n\n const defaultValues = useMemo(() => {\n const values: Record<string, any> = { id: entity.id };\n fields.forEach((field) => {\n values[field] = defaultValueFor({ entity, field, language });\n });\n return values;\n }, [entity, fields, language]);\n\n const form = useForm<Record<string, any>>({ defaultValues });\n\n const submit = async (values: Record<string, any>) => {\n setIsSaving(true);\n try {\n const payload: Record<string, unknown> = {};\n fields.forEach((field) => {\n payload[field] = values[field];\n });\n await onSave(language, payload);\n showToast(t(`features.translations.saved`));\n } catch (error) {\n errorToast({ error });\n } finally {\n setIsSaving(false);\n }\n };\n\n return (\n <Form {...form}>\n <form onSubmit={form.handleSubmit(submit)} className=\"flex w-full flex-col gap-y-4\">\n {fields.map((field) =>\n BLOCK_NOTE_FIELDS.includes(field) ? (\n <FormBlockNote\n key={field}\n form={form}\n id={field}\n name={t(`features.translations.fields.${field}.label`)}\n placeholder={t(`features.translations.fields.${field}.placeholder`)}\n type={`translation-${language}-${field}`}\n />\n ) : (\n <FormInput\n key={field}\n form={form}\n id={field}\n name={t(`features.translations.fields.${field}.label`)}\n placeholder={t(`features.translations.fields.${field}.placeholder`)}\n />\n ),\n )}\n <div className=\"flex w-full justify-end\">\n <Button type=\"submit\" disabled={isSaving} data-testid={`translations-save-${language}`}>\n {t(`features.translations.save`)}\n </Button>\n </div>\n </form>\n </Form>\n );\n}\n\nexport default function TranslationsTab({ entity, fields, onSave }: TranslationsTabProps) {\n const t = useTranslations();\n\n const languages = useMemo(\n () => Object.values(ContentLanguage).filter((language) => language !== entity.language),\n [entity.language],\n );\n\n if (languages.length === 0) return null;\n\n return (\n <Tabs defaultValue={languages[0]}>\n <TabsList>\n {languages.map((language) => (\n <TabsTrigger key={language} value={language} data-testid={`translations-tab-${language}`}>\n {t(`common.languages.${language}`)}\n </TabsTrigger>\n ))}\n </TabsList>\n {languages.map((language) => (\n <TabsContent key={language} value={language}>\n <TranslationsTabPanel entity={entity} fields={fields} language={language} onSave={onSave} />\n </TabsContent>\n ))}\n </Tabs>\n );\n}\n","\"use client\";\n\nimport { useLocale } from \"next-intl\";\nimport { getKnowledgeUiConfig } from \"../../config/knowledge.ui.config\";\n\n/**\n * The language stored translations are resolved into.\n *\n * The app's `useUserLanguage` hook returns the current user's saved language;\n * when it is missing (anonymous visitor, or a user who never picked one) the UI\n * locale is the fallback.\n */\nexport function useContentLanguage(): string {\n const language = getKnowledgeUiConfig().useUserLanguage();\n const locale = useLocale();\n\n return language ?? locale;\n}\n","\"use client\";\n\nimport { ArticleInterface } from \"../../data/ArticleInterface\";\nimport { ArticleService } from \"../../data/ArticleService\";\nimport { CommonDeleter } from \"@carlonicora/nextjs-jsonapi/components\";\nimport { usePageUrlGenerator } from \"@carlonicora/nextjs-jsonapi/client\";\n\nimport { useTranslations } from \"next-intl\";\nimport { KnowledgeModules } from \"../../../../knowledge.registry\";\n\ntype ArticleDeleterProps = {\n article: ArticleInterface;\n};\n\nfunction ArticleDeleterInternal({ article }: ArticleDeleterProps) {\n const t = useTranslations();\n const generateUrl = usePageUrlGenerator();\n\n if (!article) return null;\n\n return (\n <CommonDeleter\n type={`articles`}\n deleteFunction={() => ArticleService.delete({ articleId: article.id })}\n redirectTo={KnowledgeModules.Article.pageUrl ? generateUrl({ page: KnowledgeModules.Article }) : undefined}\n />\n );\n}\n\nexport default function ArticleDeleter(props: ArticleDeleterProps) {\n return <ArticleDeleterInternal {...props} />;\n}\n","\"use client\";\n\nimport {\n DropzoneOptions,\n errorToast,\n FileInput,\n FileUploader,\n SectionHeader,\n} from \"@carlonicora/nextjs-jsonapi/components\";\nimport { UploadIcon } from \"lucide-react\";\nimport * as mammoth from \"mammoth\";\nimport { useTranslations } from \"next-intl\";\nimport { getDocument, GlobalWorkerOptions } from \"pdfjs-dist\";\nimport { useEffect, useState } from \"react\";\nimport TurndownService from \"turndown\";\n\nGlobalWorkerOptions.workerSrc = new URL(\"pdfjs-dist/build/pdf.worker.min.mjs\", import.meta.url).toString();\n\ntype ContentFileUploadProps = {\n onMarkdownContent: (markdown: string) => void;\n};\n\nasync function extractTextFromPdf(arrayBuffer: ArrayBuffer): Promise<string> {\n const pdf = await getDocument({ data: arrayBuffer }).promise;\n const pages: string[] = [];\n\n for (let i = 1; i <= pdf.numPages; i++) {\n const page = await pdf.getPage(i);\n const textContent = await page.getTextContent();\n let pageText = \"\";\n\n for (const item of textContent.items) {\n if (!(\"str\" in item)) continue;\n const textItem = item as { str: string; hasEOL: boolean };\n pageText += textItem.str;\n if (textItem.hasEOL) {\n pageText += \"\\n\";\n }\n }\n\n pages.push(pageText.trimEnd());\n }\n\n return pages.join(\"\\n\\n\");\n}\n\nexport default function ContentFileUpload({ onMarkdownContent }: ContentFileUploadProps) {\n const t = useTranslations();\n const [files, setFiles] = useState<File[] | null>([]);\n\n const dropzone = {\n accept: {\n \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\": [\".docx\"],\n \"application/pdf\": [\".pdf\"],\n \"text/plain\": [\".txt\"],\n \"text/markdown\": [\".md\"],\n },\n multiple: false,\n maxSize: 10 * 1024 * 1024,\n } satisfies DropzoneOptions;\n\n useEffect(() => {\n const convertFile = async (inputFile: File) => {\n try {\n const extension = inputFile.name.split(\".\").pop()?.toLowerCase();\n\n if (extension === \"docx\") {\n const arrayBuffer = await inputFile.arrayBuffer();\n const result = await mammoth.convertToHtml({ arrayBuffer });\n const turndownService = new TurndownService();\n const md = turndownService.turndown(result.value);\n onMarkdownContent(md);\n } else if (extension === \"pdf\") {\n const arrayBuffer = await inputFile.arrayBuffer();\n const text = await extractTextFromPdf(arrayBuffer);\n onMarkdownContent(text);\n } else {\n const text = await inputFile.text();\n onMarkdownContent(text);\n }\n } catch (error) {\n errorToast({ title: t(`features.content.import.error`), error });\n }\n };\n\n if (files && files.length > 0) {\n convertFile(files[0]);\n }\n }, [files]);\n\n return (\n <div className=\"flex flex-col gap-y-2\">\n <SectionHeader>{t(`features.content.import.title`)}</SectionHeader>\n <p className=\"text-muted-foreground text-xs\">{t(`features.content.import.description`)}</p>\n <FileUploader\n value={files}\n onValueChange={setFiles}\n dropzoneOptions={dropzone}\n className=\"relative w-full space-y-1\"\n >\n <FileInput className=\"outline-1 outline-dashed\">\n <div className=\"flex w-full flex-col items-center justify-center pt-3 pb-4\">\n <UploadIcon className=\"my-4 h-8 w-8\" />\n <p className=\"text-muted-foreground mb-1 text-center text-sm\">\n <span className=\"font-semibold\">{t(`features.content.import.click_drag`)}</span>\n </p>\n </div>\n </FileInput>\n </FileUploader>\n </div>\n );\n}\n","\"use client\";\n\nimport {\n Command,\n CommandItem,\n CommandList,\n FormFieldWrapper,\n Input,\n Popover,\n PopoverContent,\n PopoverTrigger,\n} from \"@carlonicora/nextjs-jsonapi/components\";\nimport { CommunityOfExpertiseInterface } from \"../../data/CommunityOfExpertiseInterface\";\nimport { CommunityOfExpertiseService } from \"../../data/CommunityOfExpertiseService\";\nimport { DataListRetriever, useDataListRetriever, useDebounce } from \"@carlonicora/nextjs-jsonapi/client\";\n\nimport { CircleX, RefreshCwIcon, SearchIcon, XIcon } from \"lucide-react\";\nimport { useTranslations } from \"next-intl\";\nimport { useCallback, useEffect, useRef, useState } from \"react\";\nimport { KnowledgeModules } from \"../../../../knowledge.registry\";\n\ntype CommunityOfExpertiseSelectorProps = {\n id: string;\n form: any;\n label?: string;\n placeholder?: string;\n onChange?: (communityOfExpertise?: CommunityOfExpertiseInterface) => void;\n isRequired?: boolean;\n};\n\nexport default function CommunityOfExpertiseSelector({\n id,\n form,\n label,\n placeholder,\n onChange,\n isRequired = false,\n}: CommunityOfExpertiseSelectorProps) {\n const t = useTranslations();\n\n const [open, setOpen] = useState<boolean>(false);\n\n const searchTermRef = useRef<string>(\"\");\n const [searchTerm, setSearchTerm] = useState<string>(\"\");\n\n const [isSearching, setIsSearching] = useState<boolean>(false);\n\n const data: DataListRetriever<CommunityOfExpertiseInterface> = useDataListRetriever({\n retriever: (params) => {\n return CommunityOfExpertiseService.findMany(params);\n },\n retrieverParams: {},\n module: KnowledgeModules.CommunityOfExpertise,\n });\n\n const search = useCallback(\n async (searchedTerm: string) => {\n try {\n if (searchedTerm === searchTermRef.current) return;\n setIsSearching(true);\n searchTermRef.current = searchedTerm;\n await data.search(searchedTerm);\n } finally {\n setIsSearching(false);\n }\n },\n [searchTermRef, data],\n );\n\n const updateSearchTerm = useDebounce(search, 500);\n\n useEffect(() => {\n setIsSearching(true);\n updateSearchTerm(searchTerm);\n }, [updateSearchTerm, searchTerm]);\n\n const setCommunityOfExpertise = (communityOfExpertise?: CommunityOfExpertiseInterface) => {\n if (onChange) onChange(communityOfExpertise);\n if (!communityOfExpertise) {\n form.setValue(id, undefined);\n setOpen(false);\n return;\n }\n\n form.setValue(id, { id: communityOfExpertise.id, name: communityOfExpertise.name });\n setOpen(false);\n\n setTimeout(() => {\n setOpen(false);\n }, 0);\n };\n\n return (\n <div className=\"flex w-full flex-col\">\n <FormFieldWrapper form={form} name={id} label={label} isRequired={isRequired}>\n {(field) => (\n <Popover open={open} onOpenChange={setOpen} modal={true}>\n <div className=\"flex w-full flex-row items-center justify-between\">\n <PopoverTrigger className=\"w-full\">\n <div className=\"flex w-full flex-row items-center justify-start rounded-md\">\n {field.value ? (\n <div className=\"bg-input/20 dark:bg-input/30 border-input flex h-7 w-full flex-row items-center justify-start rounded-md border px-2 py-0.5 text-sm md:text-xs/relaxed\">\n <span>{field.value?.name ?? \"\"}</span>\n </div>\n ) : (\n <div className=\"bg-input/20 dark:bg-input/30 border-input text-muted-foreground flex h-7 w-full flex-row items-center justify-start rounded-md border px-2 py-0.5 text-sm md:text-xs/relaxed\">\n {placeholder ??\n t(`ui.search.placeholder`, { type: t(`entities.communityofexpertises`, { count: 1 }) })}\n </div>\n )}\n </div>\n </PopoverTrigger>\n {field.value && (\n <CircleX\n className=\"text-muted hover:text-destructive ms-2 h-4 w-4 shrink-0 cursor-pointer\"\n onClick={() => setCommunityOfExpertise()}\n />\n )}\n </div>\n <PopoverContent align=\"start\" className=\"w-(--anchor-width)\">\n <Command shouldFilter={false}>\n <div className=\"relative mb-2 w-full\">\n <SearchIcon className=\"text-muted-foreground absolute start-2.5 top-2.5 h-4 w-4\" />\n <Input\n placeholder={t(`ui.search.placeholder`, {\n type: t(`entities.communityofexpertises`, { count: 1 }),\n })}\n type=\"text\"\n className=\"w-full ps-8 pe-8\"\n onChange={(e) => setSearchTerm(e.target.value)}\n value={searchTerm}\n />\n {isSearching ? (\n <RefreshCwIcon className=\"text-muted-foreground absolute end-2.5 top-2.5 h-4 w-4 animate-spin\" />\n ) : searchTermRef.current ? (\n <XIcon\n className={`absolute end-2.5 top-2.5 h-4 w-4 ${searchTermRef.current ? \"cursor-pointer\" : \"text-muted-foreground\"}`}\n onClick={() => {\n setSearchTerm(\"\");\n search(\"\");\n }}\n />\n ) : (\n <></>\n )}\n </div>\n <CommandList>\n {data.data &&\n data.data.length > 0 &&\n (data.data as CommunityOfExpertiseInterface[]).map(\n (communityOfExpertise: CommunityOfExpertiseInterface) => (\n <CommandItem\n className=\"hover:bg-muted data-selected:hover:bg-muted cursor-pointer bg-transparent data-selected:bg-transparent\"\n key={communityOfExpertise.id}\n onSelect={() => setCommunityOfExpertise(communityOfExpertise)}\n >\n <span className=\"\">{communityOfExpertise.name}</span>\n </CommandItem>\n ),\n )}\n </CommandList>\n </Command>\n </PopoverContent>\n </Popover>\n )}\n </FormFieldWrapper>\n </div>\n );\n}\n","\"use client\";\n\nimport { TaxonomyInterface } from \"../../data/TaxonomyInterface\";\nimport { TaxonomyService } from \"../../data/TaxonomyService\";\nimport { EntityMultiSelector } from \"@carlonicora/nextjs-jsonapi/components\";\nimport { useTranslations } from \"next-intl\";\nimport { KnowledgeModules } from \"../../../../knowledge.registry\";\n\ntype TaxonomyMultiSelectorProps = {\n id: string;\n form: any;\n currentTaxonomy?: TaxonomyInterface;\n label?: string;\n placeholder?: string;\n onChange?: (taxonomies?: TaxonomyInterface[]) => void;\n maxCount?: number;\n isRequired?: boolean;\n};\n\nexport default function TaxonomyMultiSelector({\n id,\n form,\n currentTaxonomy,\n label,\n placeholder,\n onChange,\n isRequired = false,\n}: TaxonomyMultiSelectorProps) {\n const t = useTranslations();\n\n return (\n <EntityMultiSelector<TaxonomyInterface>\n id={id}\n form={form}\n label={label}\n placeholder={placeholder || t(\"ui.search.button\")}\n emptyText={t(\"ui.search.no_results_generic\")}\n isRequired={isRequired}\n retriever={(params) => TaxonomyService.findMany(params)}\n module={KnowledgeModules.Taxonomy}\n getLabel={(taxonomy) => taxonomy.name}\n excludeId={currentTaxonomy?.id}\n onChange={onChange}\n />\n );\n}\n","\"use client\";\n\nimport { ArticleInput, ArticleInterface } from \"../../data/ArticleInterface\";\nimport { ArticleService } from \"../../data/ArticleService\";\nimport ContentFileUpload from \"../../../components/forms/ContentFileUpload\";\nimport CommunityOfExpertiseSelector from \"../../../../expertise/community-of-expertise/components/forms/CommunityOfExpertiseSelector\";\nimport TaxonomyMultiSelector from \"../../../../expertise/taxonomy/components/forms/TaxonomyMultiSelector\";\nimport { useI18nRouter } from \"@carlonicora/nextjs-jsonapi/client\";\nimport { getKnowledgeUiConfig } from \"../../../../config/knowledge.ui.config\";\nimport { useContentLanguage } from \"../../../../common/hooks/useContentLanguage\";\nimport { ContentLanguage, ContentStatus } from \"../../../../../shared\";\nimport {\n BlockNoteEditorContainer,\n EditorSheet,\n FormBlockNote,\n FormFieldWrapper,\n FormInput,\n FormSelect,\n} from \"@carlonicora/nextjs-jsonapi/components\";\nimport { useCurrentUserContext } from \"@carlonicora/nextjs-jsonapi/contexts\";\nimport { Action, entityObjectSchema } from \"@carlonicora/nextjs-jsonapi/core\";\nimport { zodResolver } from \"@hookform/resolvers/zod\";\nimport { useTranslations } from \"next-intl\";\nimport { ReactNode, useCallback, useMemo, useState } from \"react\";\nimport { useForm } from \"react-hook-form\";\nimport { v4 } from \"uuid\";\nimport { z } from \"zod\";\nimport { KnowledgeModules } from \"../../../../knowledge.registry\";\n\ntype ArticleEditorProps = {\n article?: ArticleInterface;\n propagateChanges?: (article: ArticleInterface) => void;\n trigger?: ReactNode;\n forceShow?: boolean;\n onClose?: () => void;\n dialogOpen?: boolean;\n onDialogOpenChange?: (open: boolean) => void;\n};\n\nfunction ArticleEditorInternal({\n article,\n propagateChanges,\n trigger,\n forceShow,\n onClose,\n dialogOpen,\n onDialogOpenChange,\n}: ArticleEditorProps) {\n const router = useI18nRouter();\n const t = useTranslations();\n const contentLanguage = useContentLanguage();\n const [markdownContent, setMarkdownContent] = useState<string | undefined>(undefined);\n\n const formSchema = useMemo(\n () =>\n z.object({\n id: z.uuidv4(),\n name: z.string().min(1, {\n message: t(`features.article.fields.name.error`),\n }),\n content: z.any(),\n abstract: z.any(),\n tldr: z.string().optional(),\n language: z.string().min(1, {\n message: t(`features.article.fields.language.error`),\n }),\n status: z.string().min(1),\n communityOfExpertise: entityObjectSchema.refine((data) => data.id && data.id.length > 0, {\n message: t(`features.article.relationships.communityofexpertise.error`),\n }),\n taxonomy: z.array(entityObjectSchema).optional(),\n }),\n [t],\n );\n\n const getDefaultValues = useCallback(\n () => ({\n id: article?.id || v4(),\n name: article?.name || \"\",\n content: article?.content || [],\n abstract: article?.abstract || [],\n tldr: article?.tldr || \"\",\n // Spec §5.2: the API stamps the author's language on create; the form seeds it so the\n // author can correct it before saving.\n language: article?.language || contentLanguage,\n status: article?.status || ContentStatus.cluster,\n communityOfExpertise: article?.communityOfExpertise\n ? { id: article.communityOfExpertise.id, name: article.communityOfExpertise.name }\n : undefined,\n taxonomy: article?.taxonomies ? article.taxonomies.map((item) => ({ id: item.id, name: item.name })) : [],\n }),\n [article, contentLanguage],\n );\n\n const form = useForm<z.infer<typeof formSchema>>({\n resolver: zodResolver(formSchema),\n defaultValues: getDefaultValues(),\n });\n\n // BlockNote reports a mount-time change for an empty editor, which would mark the field dirty and\n // trigger the discard dialog on an untouched form. Emptiness comes from `onEmptyChange`; an empty\n // rich-text field never counts as dirty (pattern: wyrdli ClueEditor / a360ai OpportunityEditor).\n const [isAbstractEmpty, setIsAbstractEmpty] = useState<boolean>(\n !article?.abstract || (Array.isArray(article.abstract) && article.abstract.length === 0),\n );\n const [isContentEmpty, setIsContentEmpty] = useState<boolean>(\n !article?.content || (Array.isArray(article.content) && article.content.length === 0),\n );\n const { dirtyFields } = form.formState;\n const isFormDirty = useCallback(() => {\n const dirty: Record<string, unknown> = { ...dirtyFields };\n if (dirty.abstract && isAbstractEmpty) delete dirty.abstract;\n if (dirty.content && isContentEmpty) delete dirty.content;\n return Object.keys(dirty).length > 0;\n }, [dirtyFields, isAbstractEmpty, isContentEmpty]);\n\n const languages = useMemo(\n () => Object.values(ContentLanguage).map((language) => ({ id: language, text: t(`common.languages.${language}`) })),\n [t],\n );\n\n return (\n <EditorSheet\n form={form}\n entityType={t(`entities.articles`, { count: 1 })}\n entityName={article?.name}\n isEdit={!!article}\n module={KnowledgeModules.Article}\n propagateChanges={propagateChanges}\n isFormDirty={isFormDirty}\n size=\"xl\"\n onSubmit={async (values) => {\n const payload: ArticleInput = {\n id: values.id,\n name: values.name,\n content: values.content,\n abstract: values.abstract,\n tldr: values.tldr,\n language: values.language,\n status: values.status,\n communityOfExpertiseId: values.communityOfExpertise?.id,\n taxonomyIds: values.taxonomy ? values.taxonomy.map((item) => item.id) : [],\n };\n\n return article ? await ArticleService.update(payload) : await ArticleService.create(payload);\n }}\n onRevalidate={getKnowledgeUiConfig().revalidatePaths}\n onNavigate={(url) => router.push(url)}\n onReset={() => {\n setIsAbstractEmpty(!article?.abstract || (Array.isArray(article.abstract) && article.abstract.length === 0));\n setIsContentEmpty(!article?.content || (Array.isArray(article.content) && article.content.length === 0));\n setMarkdownContent(undefined);\n return getDefaultValues();\n }}\n onClose={onClose}\n trigger={trigger}\n forceShow={forceShow}\n dialogOpen={dialogOpen}\n onDialogOpenChange={onDialogOpenChange}\n >\n <div className=\"flex w-full flex-row items-stretch gap-x-4\">\n <div className=\"flex w-2/3 flex-col gap-y-4\">\n <FormInput\n form={form}\n id=\"name\"\n name={t(`features.article.fields.name.label`)}\n placeholder={t(`features.article.fields.name.placeholder`)}\n isRequired\n />\n {/*\n `FormBlockNote` has no `markdownContent` pass-through, and the imported file has to be\n parsed by the editor itself (`editor.tryParseMarkdownToBlocks`) — never by app code\n (`references/frontend/06-blocknote.md` rule 6). So the container is used directly and\n writes the blocks straight back into the react-hook-form field.\n */}\n <FormFieldWrapper form={form} name=\"content\" label={t(`features.article.fields.content.label`)}>\n {() => (\n <BlockNoteEditorContainer\n id={`article-content-${form.getValues(\"id\")}`}\n type=\"article\"\n initialContent={article?.content}\n markdownContent={markdownContent}\n onChange={(content: any, isEmpty: boolean) => {\n setIsContentEmpty(isEmpty);\n form.setValue(\"content\", content, { shouldDirty: !isEmpty });\n }}\n placeholder={t(`features.article.fields.content.placeholder`)}\n bordered\n />\n )}\n </FormFieldWrapper>\n <FormBlockNote\n form={form}\n id=\"abstract\"\n name={t(`features.article.fields.abstract.label`)}\n placeholder={t(`features.article.fields.abstract.placeholder`)}\n type=\"article-abstract\"\n onEmptyChange={setIsAbstractEmpty}\n />\n <FormInput\n form={form}\n id=\"tldr\"\n name={t(`features.article.fields.tldr.label`)}\n placeholder={t(`features.article.fields.tldr.placeholder`)}\n />\n </div>\n <div className=\"flex w-1/3 flex-col gap-y-4\">\n <FormSelect\n form={form}\n id=\"language\"\n name={t(`features.article.fields.language.label`)}\n placeholder={t(`features.article.fields.language.placeholder`)}\n values={languages}\n isRequired\n />\n <CommunityOfExpertiseSelector\n id=\"communityOfExpertise\"\n form={form}\n label={t(`features.article.relationships.communityofexpertise.label`)}\n placeholder={t(`features.article.relationships.communityofexpertise.placeholder`)}\n isRequired\n />\n <TaxonomyMultiSelector id=\"taxonomy\" form={form} label={t(`entities.taxonomies`, { count: 2 })} />\n <ContentFileUpload onMarkdownContent={setMarkdownContent} />\n </div>\n </div>\n </EditorSheet>\n );\n}\n\nexport default function ArticleEditor(props: ArticleEditorProps) {\n const { hasPermissionToModule } = useCurrentUserContext();\n const action = props.article ? Action.Update : Action.Create;\n\n if (!hasPermissionToModule({ module: KnowledgeModules.Article, action, data: props.article })) return null;\n\n return <ArticleEditorInternal {...props} />;\n}\n","\"use client\";\n\nimport ArticleDeleter from \"../components/forms/ArticleDeleter\";\nimport ArticleEditor from \"../components/forms/ArticleEditor\";\nimport { ArticleInterface } from \"../data/ArticleInterface\";\nimport { ArticleService } from \"../data/ArticleService\";\nimport { SharedProvider } from \"@carlonicora/nextjs-jsonapi/contexts\";\nimport { usePageUrlGenerator } from \"@carlonicora/nextjs-jsonapi/client\";\nimport { BreadcrumbItemData } from \"@carlonicora/nextjs-jsonapi/core\";\n\nimport { JsonApiHydratedDataInterface, rehydrate } from \"@carlonicora/nextjs-jsonapi/core\";\nimport { useTranslations } from \"next-intl\";\nimport { createContext, ReactNode, useContext, useState } from \"react\";\nimport { KnowledgeModules } from \"../../../knowledge.registry\";\n\ninterface ArticleContextType {\n article: ArticleInterface | undefined;\n setArticle: (value: ArticleInterface | undefined) => void;\n reloadArticle: () => Promise<void>;\n}\n\nconst ArticleContext = createContext<ArticleContextType | undefined>(undefined);\n\ntype ArticleProviderProps = {\n children: ReactNode;\n dehydratedArticle?: JsonApiHydratedDataInterface;\n};\n\nexport const ArticleProvider = ({ children, dehydratedArticle }: ArticleProviderProps) => {\n const generateUrl = usePageUrlGenerator();\n const t = useTranslations();\n\n const [article, setArticle] = useState<ArticleInterface | undefined>(\n dehydratedArticle ? rehydrate<ArticleInterface>(KnowledgeModules.Article, dehydratedArticle) : undefined,\n );\n\n const reloadArticle = async () => {\n if (!article) return;\n\n const freshArticle = await ArticleService.findOne({ id: article.id });\n setArticle(freshArticle);\n };\n\n const breadcrumb = () => {\n const response: BreadcrumbItemData[] = [];\n\n response.push({\n name: t(`entities.articles`, { count: 2 }),\n href: KnowledgeModules.Article.pageUrl ? generateUrl({ page: KnowledgeModules.Article }) : undefined,\n });\n\n if (article)\n response.push({\n name: article.name,\n href: KnowledgeModules.Article.pageUrl\n ? generateUrl({ page: KnowledgeModules.Article, id: article.id })\n : undefined,\n });\n\n return response;\n };\n\n const title = () => {\n const response: any = {\n type: t(`entities.articles`, { count: article ? 1 : 2 }),\n };\n\n const functions: ReactNode[] = [];\n\n if (article) {\n response.element = article.name;\n\n functions.push(<ArticleDeleter key={`ArticleDeleter`} article={article} />);\n functions.push(<ArticleEditor key={`ArticleEditor`} article={article} propagateChanges={setArticle} />);\n } else {\n functions.push(<ArticleEditor key={`ArticleEditor`} />);\n }\n\n if (functions.length > 0) response.functions = functions;\n\n return response;\n };\n\n return (\n <SharedProvider value={{ breadcrumbs: breadcrumb(), title: title() }}>\n <ArticleContext.Provider\n value={{\n article: article,\n setArticle: setArticle,\n reloadArticle: reloadArticle,\n }}\n >\n {children}\n </ArticleContext.Provider>\n </SharedProvider>\n );\n};\n\nexport const useArticleContext = (): ArticleContextType => {\n const context = useContext(ArticleContext);\n if (context === undefined) {\n throw new Error(\"useArticleContext must be used within a ArticleProvider\");\n }\n return context;\n};\n","import { ContentStatus } from \"../../../../shared\";\n\nexport type ContentStatusVariant = \"softGray\" | \"softYellow\" | \"softGreen\";\n\n/**\n * Editorial status → Badge variant (`packages/nextjs-jsonapi/src/shadcnui/ui/badge.tsx`).\n * cluster = not yet proposed, proposed = awaiting a global manager, knowledge = approved.\n */\nexport function contentStatusVariant(status: string | undefined): ContentStatusVariant {\n switch (status) {\n case ContentStatus.proposed:\n return \"softYellow\";\n case ContentStatus.knowledge:\n return \"softGreen\";\n case ContentStatus.cluster:\n default:\n return \"softGray\";\n }\n}\n","\"use client\";\n\nimport { contentStatusVariant } from \"../utils/contentStatus\";\nimport { Badge } from \"@carlonicora/nextjs-jsonapi/components\";\nimport { useTranslations } from \"next-intl\";\n\ntype ContentStatusBadgeProps = {\n status: string;\n};\n\nexport function ContentStatusBadge({ status }: ContentStatusBadgeProps) {\n const t = useTranslations();\n\n return (\n <Badge variant={contentStatusVariant(status)} data-testid=\"content-status-badge\">\n {t(`features.content.status.${status}`)}\n </Badge>\n );\n}\n\nexport default ContentStatusBadge;\n","\"use client\";\n\nimport { ArticleFields } from \"../data/ArticleFields\";\nimport { ArticleInterface } from \"../data/ArticleInterface\";\nimport { resolveField } from \"../../../common/i18n/translationResolver\";\nimport ContentStatusBadge from \"../../common/components/ContentStatusBadge\";\nimport { useContentLanguage } from \"../../../common/hooks/useContentLanguage\";\nimport { cellDate, cellId } from \"@carlonicora/nextjs-jsonapi/components\";\nimport {\n registerTableGenerator,\n TableContent,\n usePageUrlGenerator,\n UseTableStructureHook,\n} from \"@carlonicora/nextjs-jsonapi/client\";\nimport { Link, Tooltip, TooltipContent, TooltipTrigger } from \"@carlonicora/nextjs-jsonapi/components\";\nimport { ColumnDef } from \"@tanstack/react-table\";\nimport { useTranslations } from \"next-intl\";\nimport { useMemo } from \"react\";\nimport { KnowledgeModules } from \"../../../knowledge.registry\";\n\nexport const useArticleTableStructure: UseTableStructureHook<ArticleInterface, ArticleFields> = (params) => {\n const t = useTranslations();\n const generateUrl = usePageUrlGenerator();\n const language = useContentLanguage();\n\n const tableData = useMemo(() => {\n return params.data.map((article: ArticleInterface) => {\n const entry: TableContent<ArticleInterface> = {\n jsonApiData: article,\n };\n entry[ArticleFields.articleId] = article.id;\n params.fields.forEach((field) => {\n entry[field] = article[field as keyof ArticleInterface];\n });\n return entry;\n });\n }, [params.data, params.fields]);\n\n const fieldColumnMap: Partial<Record<ArticleFields, () => any>> = {\n [ArticleFields.articleId]: () =>\n cellId({\n name: \"articleId\",\n checkedIds: params.checkedIds,\n toggleId: params.toggleId,\n }),\n [ArticleFields.name]: () => ({\n id: \"name\",\n accessorKey: \"name\",\n header: t(`features.article.fields.name.label`),\n cell: ({ row }: { row: TableContent<ArticleInterface> }) => {\n const article: ArticleInterface = row.original.jsonApiData;\n // C9: list cells read in the user's language, falling back to the original.\n const name = resolveField({\n original: article.name,\n translation: article.translation,\n field: \"name\",\n language,\n });\n return (\n <Tooltip>\n <TooltipTrigger>\n {KnowledgeModules.Article.pageUrl ? (\n <Link href={generateUrl({ page: KnowledgeModules.Article, id: article.id })}>{name}</Link>\n ) : (\n <span>{name}</span>\n )}\n </TooltipTrigger>\n <TooltipContent>{name}</TooltipContent>\n </Tooltip>\n );\n },\n enableSorting: false,\n enableHiding: false,\n }),\n [ArticleFields.aiStatus]: () => ({\n id: \"aiStatus\",\n accessorKey: \"aiStatus\",\n header: t(`features.article.fields.aiStatus.label`),\n cell: ({ row }: { row: TableContent<ArticleInterface> }) => {\n const article: ArticleInterface = row.original.jsonApiData;\n return <span>{article.aiStatus}</span>;\n },\n enableSorting: false,\n enableHiding: false,\n }),\n [ArticleFields.language]: () => ({\n id: \"language\",\n accessorKey: \"language\",\n header: t(`features.article.fields.language.label`),\n cell: ({ row }: { row: TableContent<ArticleInterface> }) => {\n const article: ArticleInterface = row.original.jsonApiData;\n return <span>{article.language ? t(`common.languages.${article.language}`) : \"\"}</span>;\n },\n enableSorting: false,\n enableHiding: false,\n }),\n [ArticleFields.status]: () => ({\n id: \"status\",\n accessorKey: \"status\",\n header: t(`features.article.fields.status.label`),\n cell: ({ row }: { row: TableContent<ArticleInterface> }) => {\n const article: ArticleInterface = row.original.jsonApiData;\n return <ContentStatusBadge status={article.status} />;\n },\n enableSorting: false,\n enableHiding: false,\n }),\n [ArticleFields.communityOfExpertise]: () => ({\n id: \"communityOfExpertise\",\n accessorKey: \"communityOfExpertise\",\n header: t(`features.article.relationships.communityofexpertise.label`),\n cell: ({ row }: { row: TableContent<ArticleInterface> }) => {\n const article: ArticleInterface = row.original.jsonApiData;\n return <span>{article.communityOfExpertise?.name ?? \"\"}</span>;\n },\n enableSorting: false,\n enableHiding: false,\n }),\n [ArticleFields.author]: () => ({\n id: \"author\",\n accessorKey: \"author\",\n header: t(`features.article.relationships.author.label`),\n cell: ({ row }: { row: TableContent<ArticleInterface> }) => {\n const article: ArticleInterface = row.original.jsonApiData;\n return <span>{article.author?.name ?? \"\"}</span>;\n },\n enableSorting: false,\n enableHiding: false,\n }),\n [ArticleFields.createdAt]: () =>\n cellDate({\n name: \"createdAt\",\n title: t(`common.date.create`),\n }),\n [ArticleFields.updatedAt]: () =>\n cellDate({\n name: \"updatedAt\",\n title: t(`common.date.update`),\n }),\n };\n\n const columns = useMemo(() => {\n return params.fields.map((field) => fieldColumnMap[field]?.()).filter((col) => col !== undefined) as ColumnDef<\n TableContent<ArticleInterface>\n >[];\n }, [params.fields, fieldColumnMap, t, generateUrl]);\n\n return useMemo(() => ({ data: tableData, columns: columns }), [tableData, columns]);\n};\n\nregisterTableGenerator(KnowledgeModules.Article, useArticleTableStructure);\n","\"use client\";\n\nimport ArticleEditor from \"../forms/ArticleEditor\";\nimport { ArticleFields } from \"../../data/ArticleFields\";\nimport { ArticleInterface } from \"../../data/ArticleInterface\";\nimport { ArticleService } from \"../../data/ArticleService\";\nimport \"../../hooks/useArticleTableStructure\";\nimport type { CommunityOfExpertiseInterface } from \"../../../../expertise/community-of-expertise/data/CommunityOfExpertiseInterface\";\nimport type { TaxonomyInterface } from \"../../../../expertise/taxonomy/data/TaxonomyInterface\";\nimport { ContentListTable } from \"@carlonicora/nextjs-jsonapi/components\";\nimport { DataListRetriever, useDataListRetriever } from \"@carlonicora/nextjs-jsonapi/client\";\nimport { useTranslations } from \"next-intl\";\nimport { ReactNode } from \"react\";\nimport { KnowledgeModules } from \"../../../../knowledge.registry\";\n\n// The parent props are hand-added: the generated container renders this list inside a\n// relation tab (`containerTabs.relations`), and the generator does not emit the props\n// that tab passes. Shape copied from ~/Development/wyrdli ClueList.\ntype ArticleListProps = {\n fullWidth?: boolean;\n communityOfExpertise?: CommunityOfExpertiseInterface;\n taxonomy?: TaxonomyInterface;\n};\n\nexport default function ArticleList({ fullWidth, communityOfExpertise, taxonomy }: ArticleListProps) {\n const t = useTranslations();\n\n const data: DataListRetriever<ArticleInterface> = useDataListRetriever({\n module: KnowledgeModules.Article,\n retriever: (params: any) => {\n if (communityOfExpertise)\n return ArticleService.findManyByCommunityOfExpertise({\n ...params,\n communityOfExpertiseId: communityOfExpertise.id,\n });\n if (taxonomy) return ArticleService.findManyByTaxonomy({ ...params, taxonomyId: taxonomy.id });\n return ArticleService.findMany(params);\n },\n retrieverParams: {},\n });\n\n const functions: ReactNode[] = [<ArticleEditor key=\"create-article\" />];\n\n return (\n <ContentListTable\n data={data}\n fields={[\n ArticleFields.name,\n ArticleFields.author,\n ArticleFields.status,\n ArticleFields.communityOfExpertise,\n ArticleFields.updatedAt,\n ]}\n tableGeneratorType={KnowledgeModules.Article}\n functions={functions}\n title={t(`entities.articles`, { count: 2 })}\n fullWidth={fullWidth}\n />\n );\n}\n","\"use client\";\n\nimport ArticleList from \"../lists/ArticleList\";\nimport { RoundPageContainer } from \"@carlonicora/nextjs-jsonapi/components\";\nimport { KnowledgeModules } from \"../../../../knowledge.registry\";\n\nfunction ArticleListContainerInternal() {\n return (\n <RoundPageContainer module={KnowledgeModules.Article} fullWidth>\n <ArticleList fullWidth />\n </RoundPageContainer>\n );\n}\n\nexport default function ArticleListContainer() {\n return <ArticleListContainerInternal />;\n}\n","\"use client\";\n\nimport { resolveField, resolveScalar } from \"../../../../common/i18n/translationResolver\";\nimport { ArticleInterface } from \"../../data/ArticleInterface\";\nimport { useContentLanguage } from \"../../../../common/hooks/useContentLanguage\";\nimport { resolveBlockNoteTranslation } from \"../../../common/utils/translationMaps\";\nimport { AttributeElement, BlockNoteEditorContainer, Card, MicroLabel } from \"@carlonicora/nextjs-jsonapi/components\";\nimport { useTranslations } from \"next-intl\";\n\ntype ArticleContentProps = { article: ArticleInterface };\n\nexport function ArticleContent({ article }: ArticleContentProps) {\n const t = useTranslations();\n const language = useContentLanguage();\n\n // C9: the stored maps win over the original text whenever the reader's language has an entry.\n const name = resolveField({ original: article.name, translation: article.translation, field: \"name\", language });\n const content = resolveField({\n original: article.content,\n translation: article.translation,\n field: \"content\",\n language,\n });\n const abstract = resolveBlockNoteTranslation({\n original: article.abstract,\n translation: article.abstractTranslation,\n language,\n });\n const tldr = resolveScalar({ original: article.tldr, translation: article.tldrTranslation, language });\n\n return (\n <div className=\"flex flex-col gap-y-8\">\n <div className=\"flex flex-col gap-y-3\">\n <MicroLabel as=\"h3\">{t(`features.article.fields.content.label`)}</MicroLabel>\n <Card className=\"flex w-full flex-col p-4\">\n <BlockNoteEditorContainer id={`article-content-${article.id}`} type=\"article\" initialContent={content} />\n </Card>\n </div>\n <div className=\"flex flex-col gap-y-3\">\n <MicroLabel as=\"h3\">{t(`features.article.fields.abstract.label`)}</MicroLabel>\n <Card className=\"flex w-full flex-col p-4\">\n <BlockNoteEditorContainer id={`article-abstract-${article.id}`} type=\"article\" initialContent={abstract} />\n </Card>\n </div>\n <div className=\"flex flex-col gap-y-3\">\n <MicroLabel as=\"h3\">{t(`features.article.sections.details`)}</MicroLabel>\n <div className=\"grid grid-cols-1 gap-4 md:grid-cols-3\">\n {name !== article.name && <AttributeElement title={t(`features.article.fields.name.label`)} value={name} />}\n {tldr && <AttributeElement title={t(`features.article.fields.tldr.label`)} value={tldr} />}\n <AttributeElement title={t(`features.article.fields.aiStatus.label`)} value={article.aiStatus} />\n <AttributeElement\n title={t(`features.article.fields.language.label`)}\n value={article.language ? t(`common.languages.${article.language}`) : \"\"}\n />\n <AttributeElement\n title={t(`features.article.fields.status.label`)}\n value={article.status ? t(`features.content.status.${article.status}`) : \"\"}\n />\n {article.communityOfExpertise && (\n <AttributeElement\n title={t(`features.article.relationships.communityofexpertise.label`)}\n value={article.communityOfExpertise.name}\n />\n )}\n {article.taxonomies && article.taxonomies.length > 0 && (\n <AttributeElement\n title={t(`entities.taxonomies`, { count: 2 })}\n value={article.taxonomies.map((item) => item.name).join(\", \")}\n />\n )}\n {article.editors && article.editors.length > 0 && (\n <AttributeElement\n title={t(`entities.users`, { count: 2 })}\n value={article.editors.map((item) => item.name).join(\", \")}\n />\n )}\n </div>\n </div>\n </div>\n );\n}\n","\"use client\";\n\nimport ContentStatusBadge from \"./ContentStatusBadge\";\nimport { ContentStatus } from \"../../../../shared\";\nimport { Button, errorToast } from \"@carlonicora/nextjs-jsonapi/components\";\nimport { useTranslations } from \"next-intl\";\nimport { useCallback, useState } from \"react\";\n\ntype ContentAction = \"propose\" | \"approve\" | \"reject\";\n\ntype ContentStatusBarProps = {\n status: string;\n propose: () => Promise<unknown>;\n approve: () => Promise<unknown>;\n reject: () => Promise<unknown>;\n onChanged?: (entity: any) => void;\n};\n\nconst NEXT_STATUS: Record<ContentAction, string> = {\n propose: ContentStatus.proposed,\n approve: ContentStatus.knowledge,\n reject: ContentStatus.cluster,\n};\n\n/**\n * Badge plus the editorial workflow controls (spec §5.2).\n *\n * The buttons are shown from the status alone — the API owns the \"who may do this\" rule\n * (C5 predicates), so a user without the right lands on a 403 toast rather than on a\n * client-side guess. Optimistic set with rollback copied from\n * ~/Development/neural-erp .../WarehouseStatusSelect.tsx.\n */\nexport function ContentStatusBar({ status, propose, approve, reject, onChanged }: ContentStatusBarProps) {\n const t = useTranslations();\n const [currentStatus, setCurrentStatus] = useState<string>(status);\n const [isSaving, setIsSaving] = useState<boolean>(false);\n\n const run = useCallback(\n async (action: ContentAction, call: () => Promise<unknown>) => {\n const previousStatus = currentStatus;\n setCurrentStatus(NEXT_STATUS[action]);\n setIsSaving(true);\n\n try {\n const updated = await call();\n onChanged?.(updated);\n } catch (error) {\n setCurrentStatus(previousStatus);\n errorToast({ title: t(`features.content.errors.${action}`), error });\n } finally {\n setIsSaving(false);\n }\n },\n [currentStatus, onChanged, t],\n );\n\n return (\n <div className=\"flex flex-row items-center gap-x-2\">\n <ContentStatusBadge status={currentStatus} />\n {currentStatus === ContentStatus.cluster && (\n <Button\n size=\"sm\"\n variant=\"outline\"\n disabled={isSaving}\n data-testid=\"content-propose\"\n onClick={() => run(\"propose\", propose)}\n >\n {t(`features.content.actions.propose`)}\n </Button>\n )}\n {currentStatus === ContentStatus.proposed && (\n <>\n <Button size=\"sm\" disabled={isSaving} data-testid=\"content-approve\" onClick={() => run(\"approve\", approve)}>\n {t(`features.content.actions.approve`)}\n </Button>\n <Button\n size=\"sm\"\n variant=\"outline\"\n disabled={isSaving}\n data-testid=\"content-reject\"\n onClick={() => run(\"reject\", reject)}\n >\n {t(`features.content.actions.reject`)}\n </Button>\n </>\n )}\n </div>\n );\n}\n\nexport default ContentStatusBar;\n","\"use client\";\n\nimport { ArticleContent } from \"../details/ArticleContent\";\nimport { useArticleContext } from \"../../contexts/ArticleContext\";\nimport { ArticleInterface } from \"../../data/ArticleInterface\";\nimport { ArticleService } from \"../../data/ArticleService\";\nimport TranslationsTab from \"../../../../common/components/translations/TranslationsTab\";\nimport ContentStatusBar from \"../../../common/components/ContentStatusBar\";\nimport { RoundPageContainer, Tab } from \"@carlonicora/nextjs-jsonapi/components\";\nimport { useCurrentUserContext } from \"@carlonicora/nextjs-jsonapi/contexts\";\nimport { Action } from \"@carlonicora/nextjs-jsonapi/core\";\nimport { useTranslations } from \"next-intl\";\nimport { KnowledgeModules } from \"../../../../knowledge.registry\";\n\ntype ArticleContainerProps = {\n article: ArticleInterface;\n setArticle: (value: ArticleInterface | undefined) => void;\n reloadArticle: () => Promise<void>;\n};\n\nfunction ArticleContainerInternal({ article, setArticle, reloadArticle }: ArticleContainerProps) {\n const t = useTranslations();\n\n const tabs: Tab[] = [\n {\n sectionKey: \"details\",\n label: t(`features.article.sections.details`),\n content: <ArticleContent article={article} />,\n },\n {\n sectionKey: \"translations\",\n label: t(`features.translations.title`),\n content: (\n <div data-testid=\"translations-tab\">\n <TranslationsTab\n entity={article}\n fields={[\"name\", \"content\", \"abstract\", \"tldr\"]}\n onSave={async (language, fields) => {\n await ArticleService.patchTranslations({ id: article.id, language, fields });\n await reloadArticle();\n }}\n />\n </div>\n ),\n },\n ];\n\n return (\n <RoundPageContainer\n module={KnowledgeModules.Article}\n id={article.id}\n tabs={tabs}\n header={\n <ContentStatusBar\n status={article.status}\n propose={() => ArticleService.propose({ id: article.id })}\n approve={() => ArticleService.approve({ id: article.id })}\n reject={() => ArticleService.reject({ id: article.id })}\n onChanged={setArticle}\n />\n }\n />\n );\n}\n\nexport default function ArticleContainer() {\n const { hasPermissionToModule } = useCurrentUserContext();\n const { article, setArticle, reloadArticle } = useArticleContext();\n if (!article) return null;\n if (!hasPermissionToModule({ module: KnowledgeModules.Article, action: Action.Read, data: article })) return null;\n return <ArticleContainerInternal article={article} setArticle={setArticle} reloadArticle={reloadArticle} />;\n}\n","\"use client\";\n\nimport { ArticleInterface } from \"../../data/ArticleInterface\";\nimport { ArticleService } from \"../../data/ArticleService\";\nimport { EntityMultiSelector } from \"@carlonicora/nextjs-jsonapi/components\";\nimport { useTranslations } from \"next-intl\";\nimport { KnowledgeModules } from \"../../../../knowledge.registry\";\n\ntype ArticleMultiSelectorProps = {\n id: string;\n form: any;\n currentArticle?: ArticleInterface;\n label?: string;\n placeholder?: string;\n onChange?: (articles?: ArticleInterface[]) => void;\n maxCount?: number;\n isRequired?: boolean;\n};\n\nexport default function ArticleMultiSelector({\n id,\n form,\n currentArticle,\n label,\n placeholder,\n onChange,\n isRequired = false,\n}: ArticleMultiSelectorProps) {\n const t = useTranslations();\n\n return (\n <EntityMultiSelector<ArticleInterface>\n id={id}\n form={form}\n label={label}\n placeholder={placeholder || t(\"ui.search.button\")}\n emptyText={t(\"ui.search.no_results_generic\")}\n isRequired={isRequired}\n retriever={(params) => ArticleService.findMany(params)}\n module={KnowledgeModules.Article}\n getLabel={(article) => article.name}\n excludeId={currentArticle?.id}\n onChange={onChange}\n />\n );\n}\n","\"use client\";\n\nimport { ArticleProvider } from \"../../contexts/ArticleContext\";\nimport ArticleListContainer from \"../containers/ArticleListContainer\";\n\nexport function ArticleListScreen() {\n return (\n <ArticleProvider>\n <ArticleListContainer />\n </ArticleProvider>\n );\n}\n","\"use client\";\n\nimport type { JsonApiHydratedDataInterface } from \"@carlonicora/nextjs-jsonapi/core\";\nimport { ArticleProvider } from \"../../contexts/ArticleContext\";\nimport ArticleContainer from \"../containers/ArticleContainer\";\n\nexport function ArticleDetailScreen({ dehydratedArticle }: { dehydratedArticle: JsonApiHydratedDataInterface }) {\n return (\n <ArticleProvider dehydratedArticle={dehydratedArticle}>\n <ArticleContainer />\n </ArticleProvider>\n );\n}\n","\"use client\";\n\nimport { DiscussionInterface } from \"../../data/DiscussionInterface\";\nimport { DiscussionService } from \"../../data/DiscussionService\";\nimport { CommonDeleter } from \"@carlonicora/nextjs-jsonapi/components\";\nimport { usePageUrlGenerator } from \"@carlonicora/nextjs-jsonapi/client\";\n\nimport { useTranslations } from \"next-intl\";\nimport { KnowledgeModules } from \"../../../../knowledge.registry\";\n\ntype DiscussionDeleterProps = {\n discussion: DiscussionInterface;\n};\n\nfunction DiscussionDeleterInternal({ discussion }: DiscussionDeleterProps) {\n const t = useTranslations();\n const generateUrl = usePageUrlGenerator();\n\n if (!discussion) return null;\n\n return (\n <CommonDeleter\n type={`discussions`}\n deleteFunction={() => DiscussionService.delete({ discussionId: discussion.id })}\n redirectTo={KnowledgeModules.Discussion.pageUrl ? generateUrl({ page: KnowledgeModules.Discussion }) : undefined}\n />\n );\n}\n\nexport default function DiscussionDeleter(props: DiscussionDeleterProps) {\n return <DiscussionDeleterInternal {...props} />;\n}\n","\"use client\";\n\nimport ContentFileUpload from \"../../../components/forms/ContentFileUpload\";\nimport { DiscussionInput, DiscussionInterface } from \"../../data/DiscussionInterface\";\nimport { DiscussionService } from \"../../data/DiscussionService\";\nimport CommunityOfExpertiseSelector from \"../../../../expertise/community-of-expertise/components/forms/CommunityOfExpertiseSelector\";\nimport TaxonomyMultiSelector from \"../../../../expertise/taxonomy/components/forms/TaxonomyMultiSelector\";\nimport { useI18nRouter } from \"@carlonicora/nextjs-jsonapi/client\";\nimport { getKnowledgeUiConfig } from \"../../../../config/knowledge.ui.config\";\nimport { useContentLanguage } from \"../../../../common/hooks/useContentLanguage\";\nimport { ContentLanguage, ContentStatus } from \"../../../../../shared\";\nimport {\n BlockNoteEditorContainer,\n EditorSheet,\n FormBlockNote,\n FormFieldWrapper,\n FormInput,\n FormSelect,\n} from \"@carlonicora/nextjs-jsonapi/components\";\nimport { useCurrentUserContext } from \"@carlonicora/nextjs-jsonapi/contexts\";\nimport { Action, entityObjectSchema } from \"@carlonicora/nextjs-jsonapi/core\";\nimport { zodResolver } from \"@hookform/resolvers/zod\";\nimport { useTranslations } from \"next-intl\";\nimport { ReactNode, useCallback, useMemo, useState } from \"react\";\nimport { useForm } from \"react-hook-form\";\nimport { v4 } from \"uuid\";\nimport { z } from \"zod\";\nimport { KnowledgeModules } from \"../../../../knowledge.registry\";\n\ntype DiscussionEditorProps = {\n discussion?: DiscussionInterface;\n propagateChanges?: (discussion: DiscussionInterface) => void;\n trigger?: ReactNode;\n forceShow?: boolean;\n onClose?: () => void;\n dialogOpen?: boolean;\n onDialogOpenChange?: (open: boolean) => void;\n};\n\nfunction DiscussionEditorInternal({\n discussion,\n propagateChanges,\n trigger,\n forceShow,\n onClose,\n dialogOpen,\n onDialogOpenChange,\n}: DiscussionEditorProps) {\n const router = useI18nRouter();\n const t = useTranslations();\n const contentLanguage = useContentLanguage();\n const [markdownContent, setMarkdownContent] = useState<string | undefined>(undefined);\n\n const formSchema = useMemo(\n () =>\n z.object({\n id: z.uuidv4(),\n name: z.string().min(1, {\n message: t(`features.discussion.fields.name.error`),\n }),\n content: z.any(),\n abstract: z.any(),\n tldr: z.string().optional(),\n language: z.string().min(1, {\n message: t(`features.discussion.fields.language.error`),\n }),\n status: z.string().min(1),\n communityOfExpertise: entityObjectSchema.refine((data) => data.id && data.id.length > 0, {\n message: t(`features.discussion.relationships.communityofexpertise.error`),\n }),\n taxonomy: z.array(entityObjectSchema).optional(),\n }),\n [t],\n );\n\n const getDefaultValues = useCallback(\n () => ({\n id: discussion?.id || v4(),\n name: discussion?.name || \"\",\n content: discussion?.content || [],\n abstract: discussion?.abstract || [],\n tldr: discussion?.tldr || \"\",\n language: discussion?.language || contentLanguage,\n status: discussion?.status || ContentStatus.cluster,\n communityOfExpertise: discussion?.communityOfExpertise\n ? { id: discussion.communityOfExpertise.id, name: discussion.communityOfExpertise.name }\n : undefined,\n taxonomy: discussion?.taxonomies ? discussion.taxonomies.map((item) => ({ id: item.id, name: item.name })) : [],\n }),\n [discussion, contentLanguage],\n );\n\n const form = useForm<z.infer<typeof formSchema>>({\n resolver: zodResolver(formSchema),\n defaultValues: getDefaultValues(),\n });\n\n // BlockNote reports a mount-time change for an empty editor, which would mark the field dirty and\n // trigger the discard dialog on an untouched form. Emptiness comes from `onEmptyChange`; an empty\n // rich-text field never counts as dirty (pattern: wyrdli ClueEditor / a360ai OpportunityEditor).\n const [isAbstractEmpty, setIsAbstractEmpty] = useState<boolean>(\n !discussion?.abstract || (Array.isArray(discussion.abstract) && discussion.abstract.length === 0),\n );\n const [isContentEmpty, setIsContentEmpty] = useState<boolean>(\n !discussion?.content || (Array.isArray(discussion.content) && discussion.content.length === 0),\n );\n const { dirtyFields } = form.formState;\n const isFormDirty = useCallback(() => {\n const dirty: Record<string, unknown> = { ...dirtyFields };\n if (dirty.abstract && isAbstractEmpty) delete dirty.abstract;\n if (dirty.content && isContentEmpty) delete dirty.content;\n return Object.keys(dirty).length > 0;\n }, [dirtyFields, isAbstractEmpty, isContentEmpty]);\n\n const languages = useMemo(\n () => Object.values(ContentLanguage).map((language) => ({ id: language, text: t(`common.languages.${language}`) })),\n [t],\n );\n\n return (\n <EditorSheet\n form={form}\n entityType={t(`entities.discussions`, { count: 1 })}\n entityName={discussion?.name}\n isEdit={!!discussion}\n module={KnowledgeModules.Discussion}\n propagateChanges={propagateChanges}\n isFormDirty={isFormDirty}\n size=\"xl\"\n onSubmit={async (values) => {\n const payload: DiscussionInput = {\n id: values.id,\n name: values.name,\n content: values.content,\n abstract: values.abstract,\n tldr: values.tldr,\n language: values.language,\n status: values.status,\n communityOfExpertiseId: values.communityOfExpertise?.id,\n taxonomyIds: values.taxonomy ? values.taxonomy.map((item) => item.id) : [],\n // `GENERATES` is written by `POST discussions/:id/articles` (spec §5.2), never by the\n // editor — a discussion may generate at most one article.\n };\n\n return discussion ? await DiscussionService.update(payload) : await DiscussionService.create(payload);\n }}\n onRevalidate={getKnowledgeUiConfig().revalidatePaths}\n onNavigate={(url) => router.push(url)}\n onReset={() => {\n setIsAbstractEmpty(\n !discussion?.abstract || (Array.isArray(discussion.abstract) && discussion.abstract.length === 0),\n );\n setIsContentEmpty(\n !discussion?.content || (Array.isArray(discussion.content) && discussion.content.length === 0),\n );\n setMarkdownContent(undefined);\n return getDefaultValues();\n }}\n onClose={onClose}\n trigger={trigger}\n forceShow={forceShow}\n dialogOpen={dialogOpen}\n onDialogOpenChange={onDialogOpenChange}\n >\n <div className=\"flex w-full flex-row items-stretch gap-x-4\">\n <div className=\"flex w-2/3 flex-col gap-y-4\">\n <FormInput\n form={form}\n id=\"name\"\n name={t(`features.discussion.fields.name.label`)}\n placeholder={t(`features.discussion.fields.name.placeholder`)}\n isRequired\n />\n {/*\n `FormBlockNote` has no `markdownContent` pass-through, and an imported file must be\n parsed by the editor itself (`editor.tryParseMarkdownToBlocks`) — never by app code\n (`references/frontend/06-blocknote.md` rule 6). The container therefore writes its\n blocks straight back into the react-hook-form field.\n */}\n <FormFieldWrapper form={form} name=\"content\" label={t(`features.discussion.fields.content.label`)}>\n {() => (\n <BlockNoteEditorContainer\n id={`discussion-content-${form.getValues(\"id\")}`}\n type=\"discussion\"\n initialContent={discussion?.content}\n markdownContent={markdownContent}\n onChange={(content: any, isEmpty: boolean) => {\n setIsContentEmpty(isEmpty);\n form.setValue(\"content\", content, { shouldDirty: !isEmpty });\n }}\n placeholder={t(`features.discussion.fields.content.placeholder`)}\n bordered\n />\n )}\n </FormFieldWrapper>\n <FormBlockNote\n form={form}\n id=\"abstract\"\n name={t(`features.discussion.fields.abstract.label`)}\n placeholder={t(`features.discussion.fields.abstract.placeholder`)}\n type=\"discussion-abstract\"\n onEmptyChange={setIsAbstractEmpty}\n />\n <FormInput\n form={form}\n id=\"tldr\"\n name={t(`features.discussion.fields.tldr.label`)}\n placeholder={t(`features.discussion.fields.tldr.placeholder`)}\n />\n </div>\n <div className=\"flex w-1/3 flex-col gap-y-4\">\n <FormSelect\n form={form}\n id=\"language\"\n name={t(`features.discussion.fields.language.label`)}\n placeholder={t(`features.discussion.fields.language.placeholder`)}\n values={languages}\n isRequired\n />\n <CommunityOfExpertiseSelector\n id=\"communityOfExpertise\"\n form={form}\n label={t(`features.discussion.relationships.communityofexpertise.label`)}\n placeholder={t(`features.discussion.relationships.communityofexpertise.placeholder`)}\n isRequired\n />\n <TaxonomyMultiSelector id=\"taxonomy\" form={form} label={t(`entities.taxonomies`, { count: 2 })} />\n <ContentFileUpload onMarkdownContent={setMarkdownContent} />\n </div>\n </div>\n </EditorSheet>\n );\n}\n\nexport default function DiscussionEditor(props: DiscussionEditorProps) {\n const { hasPermissionToModule } = useCurrentUserContext();\n const action = props.discussion ? Action.Update : Action.Create;\n\n if (!hasPermissionToModule({ module: KnowledgeModules.Discussion, action, data: props.discussion })) return null;\n\n return <DiscussionEditorInternal {...props} />;\n}\n","\"use client\";\n\nimport DiscussionDeleter from \"../components/forms/DiscussionDeleter\";\nimport DiscussionEditor from \"../components/forms/DiscussionEditor\";\nimport { DiscussionInterface } from \"../data/DiscussionInterface\";\nimport { DiscussionService } from \"../data/DiscussionService\";\nimport { SharedProvider } from \"@carlonicora/nextjs-jsonapi/contexts\";\nimport { usePageUrlGenerator } from \"@carlonicora/nextjs-jsonapi/client\";\nimport { BreadcrumbItemData } from \"@carlonicora/nextjs-jsonapi/core\";\n\nimport { JsonApiHydratedDataInterface, rehydrate } from \"@carlonicora/nextjs-jsonapi/core\";\nimport { useTranslations } from \"next-intl\";\nimport { createContext, ReactNode, useContext, useState } from \"react\";\nimport { KnowledgeModules } from \"../../../knowledge.registry\";\n\ninterface DiscussionContextType {\n discussion: DiscussionInterface | undefined;\n setDiscussion: (value: DiscussionInterface | undefined) => void;\n reloadDiscussion: () => Promise<void>;\n}\n\nconst DiscussionContext = createContext<DiscussionContextType | undefined>(undefined);\n\ntype DiscussionProviderProps = {\n children: ReactNode;\n dehydratedDiscussion?: JsonApiHydratedDataInterface;\n};\n\nexport const DiscussionProvider = ({ children, dehydratedDiscussion }: DiscussionProviderProps) => {\n const generateUrl = usePageUrlGenerator();\n const t = useTranslations();\n\n const [discussion, setDiscussion] = useState<DiscussionInterface | undefined>(\n dehydratedDiscussion\n ? rehydrate<DiscussionInterface>(KnowledgeModules.Discussion, dehydratedDiscussion)\n : undefined,\n );\n\n const reloadDiscussion = async () => {\n if (!discussion) return;\n\n const freshDiscussion = await DiscussionService.findOne({ id: discussion.id });\n setDiscussion(freshDiscussion);\n };\n\n const breadcrumb = () => {\n const response: BreadcrumbItemData[] = [];\n\n response.push({\n name: t(`entities.discussions`, { count: 2 }),\n href: KnowledgeModules.Discussion.pageUrl ? generateUrl({ page: KnowledgeModules.Discussion }) : undefined,\n });\n\n if (discussion)\n response.push({\n name: discussion.name,\n href: KnowledgeModules.Discussion.pageUrl\n ? generateUrl({ page: KnowledgeModules.Discussion, id: discussion.id })\n : undefined,\n });\n\n return response;\n };\n\n const title = () => {\n const response: any = {\n type: t(`entities.discussions`, { count: discussion ? 1 : 2 }),\n };\n\n const functions: ReactNode[] = [];\n\n if (discussion) {\n response.element = discussion.name;\n\n functions.push(<DiscussionDeleter key={`DiscussionDeleter`} discussion={discussion} />);\n functions.push(\n <DiscussionEditor key={`DiscussionEditor`} discussion={discussion} propagateChanges={setDiscussion} />,\n );\n } else {\n functions.push(<DiscussionEditor key={`DiscussionEditor`} />);\n }\n\n if (functions.length > 0) response.functions = functions;\n\n return response;\n };\n\n return (\n <SharedProvider value={{ breadcrumbs: breadcrumb(), title: title() }}>\n <DiscussionContext.Provider\n value={{\n discussion: discussion,\n setDiscussion: setDiscussion,\n reloadDiscussion: reloadDiscussion,\n }}\n >\n {children}\n </DiscussionContext.Provider>\n </SharedProvider>\n );\n};\n\nexport const useDiscussionContext = (): DiscussionContextType => {\n const context = useContext(DiscussionContext);\n if (context === undefined) {\n throw new Error(\"useDiscussionContext must be used within a DiscussionProvider\");\n }\n return context;\n};\n","\"use client\";\n\nimport { DiscussionFields } from \"../data/DiscussionFields\";\nimport { DiscussionInterface } from \"../data/DiscussionInterface\";\nimport { resolveField } from \"../../../common/i18n/translationResolver\";\nimport ContentStatusBadge from \"../../common/components/ContentStatusBadge\";\nimport { useContentLanguage } from \"../../../common/hooks/useContentLanguage\";\nimport { cellDate, cellId } from \"@carlonicora/nextjs-jsonapi/components\";\nimport {\n registerTableGenerator,\n TableContent,\n usePageUrlGenerator,\n UseTableStructureHook,\n} from \"@carlonicora/nextjs-jsonapi/client\";\nimport { Link, Tooltip, TooltipContent, TooltipTrigger } from \"@carlonicora/nextjs-jsonapi/components\";\nimport { ColumnDef } from \"@tanstack/react-table\";\nimport { useTranslations } from \"next-intl\";\nimport { useMemo } from \"react\";\nimport { KnowledgeModules } from \"../../../knowledge.registry\";\n\nexport const useDiscussionTableStructure: UseTableStructureHook<DiscussionInterface, DiscussionFields> = (params) => {\n const t = useTranslations();\n const generateUrl = usePageUrlGenerator();\n const language = useContentLanguage();\n\n const tableData = useMemo(() => {\n return params.data.map((discussion: DiscussionInterface) => {\n const entry: TableContent<DiscussionInterface> = {\n jsonApiData: discussion,\n };\n entry[DiscussionFields.discussionId] = discussion.id;\n params.fields.forEach((field) => {\n entry[field] = discussion[field as keyof DiscussionInterface];\n });\n return entry;\n });\n }, [params.data, params.fields]);\n\n const fieldColumnMap: Partial<Record<DiscussionFields, () => any>> = {\n [DiscussionFields.discussionId]: () =>\n cellId({\n name: \"discussionId\",\n checkedIds: params.checkedIds,\n toggleId: params.toggleId,\n }),\n [DiscussionFields.name]: () => ({\n id: \"name\",\n accessorKey: \"name\",\n header: t(`features.discussion.fields.name.label`),\n cell: ({ row }: { row: TableContent<DiscussionInterface> }) => {\n const discussion: DiscussionInterface = row.original.jsonApiData;\n // C9: list cells read in the user's language, falling back to the original.\n const name = resolveField({\n original: discussion.name,\n translation: discussion.translation,\n field: \"name\",\n language,\n });\n return (\n <Tooltip>\n <TooltipTrigger>\n {KnowledgeModules.Discussion.pageUrl ? (\n <Link href={generateUrl({ page: KnowledgeModules.Discussion, id: discussion.id })}>{name}</Link>\n ) : (\n <span>{name}</span>\n )}\n </TooltipTrigger>\n <TooltipContent>{name}</TooltipContent>\n </Tooltip>\n );\n },\n enableSorting: false,\n enableHiding: false,\n }),\n [DiscussionFields.aiStatus]: () => ({\n id: \"aiStatus\",\n accessorKey: \"aiStatus\",\n header: t(`features.discussion.fields.aiStatus.label`),\n cell: ({ row }: { row: TableContent<DiscussionInterface> }) => {\n const discussion: DiscussionInterface = row.original.jsonApiData;\n return <span>{discussion.aiStatus}</span>;\n },\n enableSorting: false,\n enableHiding: false,\n }),\n [DiscussionFields.language]: () => ({\n id: \"language\",\n accessorKey: \"language\",\n header: t(`features.discussion.fields.language.label`),\n cell: ({ row }: { row: TableContent<DiscussionInterface> }) => {\n const discussion: DiscussionInterface = row.original.jsonApiData;\n return <span>{discussion.language ? t(`common.languages.${discussion.language}`) : \"\"}</span>;\n },\n enableSorting: false,\n enableHiding: false,\n }),\n [DiscussionFields.status]: () => ({\n id: \"status\",\n accessorKey: \"status\",\n header: t(`features.discussion.fields.status.label`),\n cell: ({ row }: { row: TableContent<DiscussionInterface> }) => {\n const discussion: DiscussionInterface = row.original.jsonApiData;\n return <ContentStatusBadge status={discussion.status} />;\n },\n enableSorting: false,\n enableHiding: false,\n }),\n [DiscussionFields.communityOfExpertise]: () => ({\n id: \"communityOfExpertise\",\n accessorKey: \"communityOfExpertise\",\n header: t(`features.discussion.relationships.communityofexpertise.label`),\n cell: ({ row }: { row: TableContent<DiscussionInterface> }) => {\n const discussion: DiscussionInterface = row.original.jsonApiData;\n return <span>{discussion.communityOfExpertise?.name ?? \"\"}</span>;\n },\n enableSorting: false,\n enableHiding: false,\n }),\n [DiscussionFields.author]: () => ({\n id: \"author\",\n accessorKey: \"author\",\n header: t(`features.discussion.relationships.author.label`),\n cell: ({ row }: { row: TableContent<DiscussionInterface> }) => {\n const discussion: DiscussionInterface = row.original.jsonApiData;\n return <span>{discussion.author?.name ?? \"\"}</span>;\n },\n enableSorting: false,\n enableHiding: false,\n }),\n [DiscussionFields.createdAt]: () =>\n cellDate({\n name: \"createdAt\",\n title: t(`common.date.create`),\n }),\n [DiscussionFields.updatedAt]: () =>\n cellDate({\n name: \"updatedAt\",\n title: t(`common.date.update`),\n }),\n };\n\n const columns = useMemo(() => {\n return params.fields.map((field) => fieldColumnMap[field]?.()).filter((col) => col !== undefined) as ColumnDef<\n TableContent<DiscussionInterface>\n >[];\n }, [params.fields, fieldColumnMap, t, generateUrl]);\n\n return useMemo(() => ({ data: tableData, columns: columns }), [tableData, columns]);\n};\n\nregisterTableGenerator(KnowledgeModules.Discussion, useDiscussionTableStructure);\n","\"use client\";\n\nimport DiscussionEditor from \"../forms/DiscussionEditor\";\nimport { DiscussionFields } from \"../../data/DiscussionFields\";\nimport { DiscussionInterface } from \"../../data/DiscussionInterface\";\nimport { DiscussionService } from \"../../data/DiscussionService\";\nimport \"../../hooks/useDiscussionTableStructure\";\nimport type { CommunityOfExpertiseInterface } from \"../../../../expertise/community-of-expertise/data/CommunityOfExpertiseInterface\";\nimport type { TaxonomyInterface } from \"../../../../expertise/taxonomy/data/TaxonomyInterface\";\nimport { ContentListTable } from \"@carlonicora/nextjs-jsonapi/components\";\nimport { DataListRetriever, useDataListRetriever } from \"@carlonicora/nextjs-jsonapi/client\";\nimport { useTranslations } from \"next-intl\";\nimport { ReactNode } from \"react\";\nimport { KnowledgeModules } from \"../../../../knowledge.registry\";\n\n// The parent props are hand-added: the generated container renders this list inside a\n// relation tab (`containerTabs.relations`), and the generator does not emit the props\n// that tab passes. Shape copied from ~/Development/wyrdli ClueList.\ntype DiscussionListProps = {\n fullWidth?: boolean;\n communityOfExpertise?: CommunityOfExpertiseInterface;\n taxonomy?: TaxonomyInterface;\n};\n\nexport default function DiscussionList({ fullWidth, communityOfExpertise, taxonomy }: DiscussionListProps) {\n const t = useTranslations();\n\n const data: DataListRetriever<DiscussionInterface> = useDataListRetriever({\n module: KnowledgeModules.Discussion,\n retriever: (params: any) => {\n if (communityOfExpertise)\n return DiscussionService.findManyByCommunityOfExpertise({\n ...params,\n communityOfExpertiseId: communityOfExpertise.id,\n });\n if (taxonomy) return DiscussionService.findManyByTaxonomy({ ...params, taxonomyId: taxonomy.id });\n return DiscussionService.findMany(params);\n },\n retrieverParams: {},\n });\n\n const functions: ReactNode[] = [<DiscussionEditor key=\"create-discussion\" />];\n\n return (\n <ContentListTable\n data={data}\n fields={[\n DiscussionFields.name,\n DiscussionFields.author,\n DiscussionFields.status,\n DiscussionFields.communityOfExpertise,\n DiscussionFields.updatedAt,\n ]}\n tableGeneratorType={KnowledgeModules.Discussion}\n functions={functions}\n title={t(`entities.discussions`, { count: 2 })}\n fullWidth={fullWidth}\n />\n );\n}\n","\"use client\";\n\nimport DiscussionList from \"../lists/DiscussionList\";\nimport { RoundPageContainer } from \"@carlonicora/nextjs-jsonapi/components\";\nimport { KnowledgeModules } from \"../../../../knowledge.registry\";\n\nfunction DiscussionListContainerInternal() {\n return (\n <RoundPageContainer module={KnowledgeModules.Discussion} fullWidth>\n <DiscussionList fullWidth />\n </RoundPageContainer>\n );\n}\n\nexport default function DiscussionListContainer() {\n return <DiscussionListContainerInternal />;\n}\n","\"use client\";\n\nimport { DiscussionReplyInput, DiscussionReplyInterface } from \"../data/DiscussionReplyInterface\";\nimport { DiscussionReplyService } from \"../data/DiscussionReplyService\";\nimport { BlockNoteEditorContainer, Button, errorToast, SectionHeader } from \"@carlonicora/nextjs-jsonapi/components\";\nimport { useTranslations } from \"next-intl\";\nimport { useRef, useState } from \"react\";\nimport { v4 } from \"uuid\";\n\ntype DiscussionReplyEditorProps = {\n discussionId: string;\n onReplyCreated: (reply: DiscussionReplyInterface) => void;\n};\n\n/**\n * The inline composer at the foot of a discussion thread. This is deliberately NOT the generated\n * `components/forms/DiscussionReplyEditor` (an `EditorSheet`): a reply is posted in place, not\n * through a sheet. Ported from the earlier codebase's .../DiscussionReplyEditor.tsx.\n */\nexport default function DiscussionReplyEditor({ discussionId, onReplyCreated }: DiscussionReplyEditorProps) {\n const t = useTranslations();\n const contentRef = useRef<any>(null);\n const [isSubmitting, setIsSubmitting] = useState<boolean>(false);\n const [editorKey, setEditorKey] = useState<number>(0);\n const [hasContent, setHasContent] = useState<boolean>(false);\n\n // Emptiness comes from the editor, never from inspecting the blocks\n // (`references/frontend/06-blocknote.md` rule 5).\n const handleContentChange = (content: any, isEmpty: boolean) => {\n contentRef.current = isEmpty ? null : content;\n setHasContent(!isEmpty);\n };\n\n const handleSubmit = async () => {\n if (!contentRef.current) return;\n\n setIsSubmitting(true);\n try {\n const payload: DiscussionReplyInput = {\n id: v4(),\n content: contentRef.current,\n discussionId,\n };\n\n const newReply = await DiscussionReplyService.create(payload);\n onReplyCreated(newReply);\n\n contentRef.current = null;\n setHasContent(false);\n setEditorKey((previous) => previous + 1);\n } catch (error) {\n errorToast({ title: t(`features.discussionreply.errors.create`), error });\n } finally {\n setIsSubmitting(false);\n }\n };\n\n return (\n <div data-testid=\"reply-editor\" className=\"flex flex-col gap-y-4 rounded-lg border p-4\">\n <SectionHeader>{t(`features.discussionreply.add_reply`)}</SectionHeader>\n\n <BlockNoteEditorContainer\n key={editorKey}\n id={`reply-editor-${discussionId}-${editorKey}`}\n type=\"discussionReply\"\n onChange={handleContentChange}\n placeholder={t(`features.discussionreply.fields.content.placeholder`)}\n bordered\n />\n\n <div className=\"flex justify-end\">\n <Button onClick={handleSubmit} disabled={isSubmitting || !hasContent} data-testid=\"reply-submit\">\n {t(`features.discussionreply.actions.submit`)}\n </Button>\n </div>\n </div>\n );\n}\n","\"use client\";\n\nimport { DiscussionReplyInterface } from \"../data/DiscussionReplyInterface\";\nimport { DiscussionService } from \"../../discussion/data/DiscussionService\";\nimport { Badge, Button, errorToast } from \"@carlonicora/nextjs-jsonapi/components\";\nimport { useTranslations } from \"next-intl\";\nimport { useState } from \"react\";\n\ntype ReplyApproveButtonProps = {\n discussionId: string;\n reply: DiscussionReplyInterface;\n onApproved?: (replyId: string) => void;\n};\n\n/**\n * `PATCH discussions/:id/replies/:replyId/approve` (spec §5.2). The API decides whether the\n * caller may approve (discussion author or CoE manager), so the control is always offered and a\n * refusal arrives as a toast.\n */\nexport default function ReplyApproveButton({ discussionId, reply, onApproved }: ReplyApproveButtonProps) {\n const t = useTranslations();\n const [isApproved, setIsApproved] = useState<boolean>(reply.discussion?.approvedReply === true);\n const [isSaving, setIsSaving] = useState<boolean>(false);\n\n const approve = async () => {\n setIsApproved(true);\n setIsSaving(true);\n try {\n await DiscussionService.approveReply({ id: discussionId, replyId: reply.id });\n onApproved?.(reply.id);\n } catch (error) {\n setIsApproved(false);\n errorToast({ title: t(`features.discussionreply.errors.approve`), error });\n } finally {\n setIsSaving(false);\n }\n };\n\n if (isApproved)\n return (\n <Badge variant=\"softGreen\" data-testid=\"reply-approved-badge\">\n {t(`features.discussionreply.approved`)}\n </Badge>\n );\n\n return (\n <Button size=\"sm\" variant=\"outline\" disabled={isSaving} data-testid=\"reply-approve\" onClick={approve}>\n {t(`features.discussionreply.actions.approve`)}\n </Button>\n );\n}\n","\"use client\";\n\nimport ReplyApproveButton from \"./ReplyApproveButton\";\nimport { DiscussionReplyInterface } from \"../data/DiscussionReplyInterface\";\nimport { DiscussionReplyService } from \"../data/DiscussionReplyService\";\nimport {\n AlertDialog,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogContent,\n AlertDialogDescription,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogTitle,\n AlertDialogTrigger,\n Avatar,\n AvatarFallback,\n AvatarImage,\n BlockNoteEditorContainer,\n Button,\n errorToast,\n} from \"@carlonicora/nextjs-jsonapi/components\";\nimport { useI18nDateFnsLocale } from \"@carlonicora/nextjs-jsonapi/client\";\nimport { useCurrentUserContext } from \"@carlonicora/nextjs-jsonapi/contexts\";\nimport { UserInterface } from \"@carlonicora/nextjs-jsonapi/core\";\nimport { formatDistanceToNow } from \"date-fns\";\nimport { TrashIcon } from \"lucide-react\";\nimport { useTranslations } from \"next-intl\";\nimport { useState } from \"react\";\n\ntype DiscussionReplyItemProps = {\n discussionId: string;\n reply: DiscussionReplyInterface;\n onDelete: (replyId: string) => void;\n onApproved?: (replyId: string) => void;\n};\n\nexport default function DiscussionReplyItem({ discussionId, reply, onDelete, onApproved }: DiscussionReplyItemProps) {\n const t = useTranslations();\n const { currentUser } = useCurrentUserContext<UserInterface>();\n const dateFnsLocale = useI18nDateFnsLocale();\n const [isDeleting, setIsDeleting] = useState<boolean>(false);\n\n const isAuthor = currentUser?.id === reply.author?.id;\n const timeAgo = reply.createdAt\n ? formatDistanceToNow(new Date(reply.createdAt), { addSuffix: true, locale: dateFnsLocale })\n : \"\";\n\n const handleDelete = async () => {\n setIsDeleting(true);\n try {\n await DiscussionReplyService.delete({ discussionReplyId: reply.id });\n onDelete(reply.id);\n } catch (error) {\n errorToast({ title: t(`features.discussionreply.errors.delete`), error });\n } finally {\n setIsDeleting(false);\n }\n };\n\n return (\n <div data-testid=\"reply-item\" className=\"flex gap-4 rounded-lg border p-4\">\n <Avatar data-testid=\"reply-author-avatar\" className=\"h-10 w-10\">\n {reply.author?.avatar && <AvatarImage src={reply.author.avatar} alt={reply.author?.name ?? \"\"} />}\n <AvatarFallback>{reply.author?.name?.charAt(0)?.toUpperCase() ?? \"?\"}</AvatarFallback>\n </Avatar>\n\n <div className=\"min-w-0 flex-1\">\n <div className=\"mb-2 flex items-center justify-between gap-x-2\">\n <div className=\"flex items-center gap-2 text-sm\">\n <span data-testid=\"reply-author-name\" className=\"font-medium\">\n {reply.author?.name ?? t(`features.discussionreply.unknown_author`)}\n </span>\n {timeAgo && (\n <span data-testid=\"reply-timestamp\" className=\"text-muted-foreground\">\n {timeAgo}\n </span>\n )}\n </div>\n\n <div className=\"flex items-center gap-x-2\">\n <ReplyApproveButton discussionId={discussionId} reply={reply} onApproved={onApproved} />\n {isAuthor && (\n <AlertDialog>\n <AlertDialogTrigger\n render={<Button variant=\"ghost\" size=\"sm\" disabled={isDeleting} data-testid=\"reply-delete\" />}\n >\n <TrashIcon className=\"h-4 w-4\" />\n </AlertDialogTrigger>\n <AlertDialogContent>\n <AlertDialogHeader>\n <AlertDialogTitle>{t(`features.discussionreply.actions.delete`)}</AlertDialogTitle>\n <AlertDialogDescription>{t(`features.discussionreply.confirm_delete`)}</AlertDialogDescription>\n </AlertDialogHeader>\n <AlertDialogFooter>\n <AlertDialogCancel>{t(`generic.cancel`)}</AlertDialogCancel>\n <AlertDialogAction onClick={handleDelete}>\n {t(`features.discussionreply.actions.delete`)}\n </AlertDialogAction>\n </AlertDialogFooter>\n </AlertDialogContent>\n </AlertDialog>\n )}\n </div>\n </div>\n\n <div data-testid=\"reply-content\">\n <BlockNoteEditorContainer\n id={`reply-content-${reply.id}`}\n type=\"discussionReply\"\n initialContent={reply.content}\n />\n </div>\n </div>\n </div>\n );\n}\n","\"use client\";\n\nimport DiscussionReplyEditor from \"./DiscussionReplyEditor\";\nimport DiscussionReplyItem from \"./DiscussionReplyItem\";\nimport { DiscussionReplyInterface } from \"../data/DiscussionReplyInterface\";\nimport { DiscussionReplyService } from \"../data/DiscussionReplyService\";\nimport { MicroLabel } from \"@carlonicora/nextjs-jsonapi/components\";\nimport { useTranslations } from \"next-intl\";\nimport { useCallback, useEffect, useState } from \"react\";\n\ntype DiscussionRepliesProps = {\n discussionId: string;\n};\n\nexport default function DiscussionReplies({ discussionId }: DiscussionRepliesProps) {\n const t = useTranslations();\n const [replies, setReplies] = useState<DiscussionReplyInterface[]>([]);\n const [isLoading, setIsLoading] = useState<boolean>(true);\n\n useEffect(() => {\n let cancelled = false;\n\n const loadReplies = async () => {\n setIsLoading(true);\n try {\n const fetched = await DiscussionReplyService.findManyByDiscussion({ discussionId, fetchAll: true });\n if (!cancelled) setReplies(fetched);\n } finally {\n if (!cancelled) setIsLoading(false);\n }\n };\n\n loadReplies();\n return () => {\n cancelled = true;\n };\n }, [discussionId]);\n\n const handleReplyCreated = useCallback((newReply: DiscussionReplyInterface) => {\n setReplies((previous) => [...previous, newReply]);\n }, []);\n\n const handleReplyDeleted = useCallback((replyId: string) => {\n setReplies((previous) => previous.filter((reply) => reply.id !== replyId));\n }, []);\n\n return (\n <div data-testid=\"discussion-replies\" className=\"flex w-full flex-col gap-y-4\">\n <MicroLabel as=\"h3\">{t(`entities.discussionreplies`, { count: replies.length })}</MicroLabel>\n\n {isLoading ? (\n <div className=\"text-muted-foreground text-sm\">{t(`generic.loading`)}</div>\n ) : replies.length === 0 ? (\n <div data-testid=\"no-replies-message\" className=\"text-muted-foreground text-sm\">\n {t(`features.discussionreply.empty`)}\n </div>\n ) : (\n <div className=\"flex flex-col gap-y-4\">\n {replies.map((reply) => (\n <DiscussionReplyItem\n key={reply.id}\n discussionId={discussionId}\n reply={reply}\n onDelete={handleReplyDeleted}\n />\n ))}\n </div>\n )}\n\n <DiscussionReplyEditor discussionId={discussionId} onReplyCreated={handleReplyCreated} />\n </div>\n );\n}\n","\"use client\";\n\nimport { resolveField, resolveScalar } from \"../../../../common/i18n/translationResolver\";\nimport { useContentLanguage } from \"../../../../common/hooks/useContentLanguage\";\nimport { resolveBlockNoteTranslation } from \"../../../common/utils/translationMaps\";\nimport { DiscussionInterface } from \"../../data/DiscussionInterface\";\nimport { AttributeElement, BlockNoteEditorContainer, Card, MicroLabel } from \"@carlonicora/nextjs-jsonapi/components\";\nimport { useTranslations } from \"next-intl\";\n\ntype DiscussionContentProps = { discussion: DiscussionInterface };\n\nexport function DiscussionContent({ discussion }: DiscussionContentProps) {\n const t = useTranslations();\n const language = useContentLanguage();\n\n // C9: the stored maps win over the original text whenever the reader's language has an entry.\n const name = resolveField({\n original: discussion.name,\n translation: discussion.translation,\n field: \"name\",\n language,\n });\n const content = resolveField({\n original: discussion.content,\n translation: discussion.translation,\n field: \"content\",\n language,\n });\n const abstract = resolveBlockNoteTranslation({\n original: discussion.abstract,\n translation: discussion.abstractTranslation,\n language,\n });\n const tldr = resolveScalar({ original: discussion.tldr, translation: discussion.tldrTranslation, language });\n\n return (\n <div className=\"flex flex-col gap-y-8\">\n <div className=\"flex flex-col gap-y-3\">\n <MicroLabel as=\"h3\">{t(`features.discussion.fields.content.label`)}</MicroLabel>\n <Card className=\"flex w-full flex-col p-4\">\n <BlockNoteEditorContainer\n id={`discussion-content-${discussion.id}`}\n type=\"discussion\"\n initialContent={content}\n />\n </Card>\n </div>\n <div className=\"flex flex-col gap-y-3\">\n <MicroLabel as=\"h3\">{t(`features.discussion.fields.abstract.label`)}</MicroLabel>\n <Card className=\"flex w-full flex-col p-4\">\n <BlockNoteEditorContainer\n id={`discussion-abstract-${discussion.id}`}\n type=\"discussion\"\n initialContent={abstract}\n />\n </Card>\n </div>\n <div className=\"flex flex-col gap-y-3\">\n <MicroLabel as=\"h3\">{t(`features.discussion.sections.details`)}</MicroLabel>\n <div className=\"grid grid-cols-1 gap-4 md:grid-cols-3\">\n {name !== discussion.name && (\n <AttributeElement title={t(`features.discussion.fields.name.label`)} value={name} />\n )}\n {tldr && <AttributeElement title={t(`features.discussion.fields.tldr.label`)} value={tldr} />}\n <AttributeElement title={t(`features.discussion.fields.aiStatus.label`)} value={discussion.aiStatus} />\n <AttributeElement\n title={t(`features.discussion.fields.language.label`)}\n value={discussion.language ? t(`common.languages.${discussion.language}`) : \"\"}\n />\n <AttributeElement\n title={t(`features.discussion.fields.status.label`)}\n value={discussion.status ? t(`features.content.status.${discussion.status}`) : \"\"}\n />\n {discussion.communityOfExpertise && (\n <AttributeElement\n title={t(`features.discussion.relationships.communityofexpertise.label`)}\n value={discussion.communityOfExpertise.name}\n />\n )}\n {discussion.taxonomies && discussion.taxonomies.length > 0 && (\n <AttributeElement\n title={t(`entities.taxonomies`, { count: 2 })}\n value={discussion.taxonomies.map((item) => item.name).join(\", \")}\n />\n )}\n {discussion.article && (\n <AttributeElement\n title={t(`features.discussion.relationships.article.label`)}\n value={discussion.article.name}\n />\n )}\n </div>\n </div>\n </div>\n );\n}\n","\"use client\";\n\nimport { DiscussionInterface } from \"../../data/DiscussionInterface\";\nimport { DiscussionService } from \"../../data/DiscussionService\";\nimport { useI18nRouter } from \"@carlonicora/nextjs-jsonapi/client\";\nimport { Button, errorToast } from \"@carlonicora/nextjs-jsonapi/components\";\nimport { usePageUrlGenerator } from \"@carlonicora/nextjs-jsonapi/client\";\nimport { SparklesIcon } from \"lucide-react\";\nimport { useTranslations } from \"next-intl\";\nimport { useState } from \"react\";\nimport { KnowledgeModules } from \"../../../../knowledge.registry\";\n\ntype GenerateArticleButtonProps = {\n discussion: DiscussionInterface;\n};\n\n/**\n * `POST discussions/:id/articles` (spec §5.2). A discussion generates at most one article, so the\n * control disappears once `discussion.article` is set.\n */\nexport default function GenerateArticleButton({ discussion }: GenerateArticleButtonProps) {\n const t = useTranslations();\n const router = useI18nRouter();\n const generateUrl = usePageUrlGenerator();\n const [isGenerating, setIsGenerating] = useState<boolean>(false);\n\n if (discussion.article) return null;\n\n const generate = async () => {\n setIsGenerating(true);\n try {\n const article = await DiscussionService.generateArticle({ id: discussion.id });\n if (KnowledgeModules.Article.pageUrl)\n router.push(generateUrl({ page: KnowledgeModules.Article, id: article.id }));\n } catch (error) {\n errorToast({ title: t(`features.discussion.errors.generate_article`), error });\n } finally {\n setIsGenerating(false);\n }\n };\n\n return (\n <Button size=\"sm\" variant=\"outline\" disabled={isGenerating} data-testid=\"generate-article\" onClick={generate}>\n <SparklesIcon />\n {t(`features.discussion.actions.generate_article`)}\n </Button>\n );\n}\n","\"use client\";\n\nimport TranslationsTab from \"../../../../common/components/translations/TranslationsTab\";\nimport ContentStatusBar from \"../../../common/components/ContentStatusBar\";\nimport DiscussionReplies from \"../../../discussion-reply/components/DiscussionReplies\";\nimport { DiscussionContent } from \"../details/DiscussionContent\";\nimport GenerateArticleButton from \"../forms/GenerateArticleButton\";\nimport { useDiscussionContext } from \"../../contexts/DiscussionContext\";\nimport { DiscussionInterface } from \"../../data/DiscussionInterface\";\nimport { DiscussionService } from \"../../data/DiscussionService\";\nimport { RoundPageContainer, Tab } from \"@carlonicora/nextjs-jsonapi/components\";\nimport { useCurrentUserContext } from \"@carlonicora/nextjs-jsonapi/contexts\";\nimport { Action } from \"@carlonicora/nextjs-jsonapi/core\";\nimport { useTranslations } from \"next-intl\";\nimport { KnowledgeModules } from \"../../../../knowledge.registry\";\n\ntype DiscussionContainerProps = {\n discussion: DiscussionInterface;\n setDiscussion: (value: DiscussionInterface | undefined) => void;\n reloadDiscussion: () => Promise<void>;\n};\n\nfunction DiscussionContainerInternal({ discussion, setDiscussion, reloadDiscussion }: DiscussionContainerProps) {\n const t = useTranslations();\n\n const tabs: Tab[] = [\n {\n sectionKey: \"details\",\n label: t(`features.discussion.sections.details`),\n content: <DiscussionContent discussion={discussion} />,\n },\n {\n key: KnowledgeModules.DiscussionReply,\n sectionKey: \"replies\",\n label: t(`entities.discussionreplies`, { count: 2 }),\n content: <DiscussionReplies discussionId={discussion.id} />,\n },\n {\n sectionKey: \"translations\",\n label: t(`features.translations.title`),\n content: (\n <div data-testid=\"translations-tab\">\n <TranslationsTab\n entity={discussion}\n fields={[\"name\", \"content\", \"abstract\", \"tldr\"]}\n onSave={async (language, fields) => {\n await DiscussionService.patchTranslations({ id: discussion.id, language, fields });\n await reloadDiscussion();\n }}\n />\n </div>\n ),\n },\n ];\n\n return (\n <RoundPageContainer\n module={KnowledgeModules.Discussion}\n id={discussion.id}\n tabs={tabs}\n header={\n <div className=\"flex flex-row items-center gap-x-2\">\n <ContentStatusBar\n status={discussion.status}\n propose={() => DiscussionService.propose({ id: discussion.id })}\n approve={() => DiscussionService.approve({ id: discussion.id })}\n reject={() => DiscussionService.reject({ id: discussion.id })}\n onChanged={setDiscussion}\n />\n <GenerateArticleButton discussion={discussion} />\n </div>\n }\n />\n );\n}\n\nexport default function DiscussionContainer() {\n const { hasPermissionToModule } = useCurrentUserContext();\n const { discussion, setDiscussion, reloadDiscussion } = useDiscussionContext();\n if (!discussion) return null;\n if (!hasPermissionToModule({ module: KnowledgeModules.Discussion, action: Action.Read, data: discussion }))\n return null;\n return (\n <DiscussionContainerInternal\n discussion={discussion}\n setDiscussion={setDiscussion}\n reloadDiscussion={reloadDiscussion}\n />\n );\n}\n","\"use client\";\n\nimport { DiscussionInterface } from \"../../data/DiscussionInterface\";\nimport { DiscussionService } from \"../../data/DiscussionService\";\nimport { EntityMultiSelector } from \"@carlonicora/nextjs-jsonapi/components\";\nimport { useTranslations } from \"next-intl\";\nimport { KnowledgeModules } from \"../../../../knowledge.registry\";\n\ntype DiscussionMultiSelectorProps = {\n id: string;\n form: any;\n currentDiscussion?: DiscussionInterface;\n label?: string;\n placeholder?: string;\n onChange?: (discussions?: DiscussionInterface[]) => void;\n maxCount?: number;\n isRequired?: boolean;\n};\n\nexport default function DiscussionMultiSelector({\n id,\n form,\n currentDiscussion,\n label,\n placeholder,\n onChange,\n isRequired = false,\n}: DiscussionMultiSelectorProps) {\n const t = useTranslations();\n\n return (\n <EntityMultiSelector<DiscussionInterface>\n id={id}\n form={form}\n label={label}\n placeholder={placeholder || t(\"ui.search.button\")}\n emptyText={t(\"ui.search.no_results_generic\")}\n isRequired={isRequired}\n retriever={(params) => DiscussionService.findMany(params)}\n module={KnowledgeModules.Discussion}\n getLabel={(discussion) => discussion.name}\n excludeId={currentDiscussion?.id}\n onChange={onChange}\n />\n );\n}\n","\"use client\";\n\nimport { DiscussionProvider } from \"../../contexts/DiscussionContext\";\nimport DiscussionListContainer from \"../containers/DiscussionListContainer\";\n\nexport function DiscussionListScreen() {\n return (\n <DiscussionProvider>\n <DiscussionListContainer />\n </DiscussionProvider>\n );\n}\n","\"use client\";\n\nimport type { JsonApiHydratedDataInterface } from \"@carlonicora/nextjs-jsonapi/core\";\nimport { DiscussionProvider } from \"../../contexts/DiscussionContext\";\nimport DiscussionContainer from \"../containers/DiscussionContainer\";\n\nexport function DiscussionDetailScreen({\n dehydratedDiscussion,\n}: {\n dehydratedDiscussion: JsonApiHydratedDataInterface;\n}) {\n return (\n <DiscussionProvider dehydratedDiscussion={dehydratedDiscussion}>\n <DiscussionContainer />\n </DiscussionProvider>\n );\n}\n","\"use client\";\n\nimport { DiscussionReplyInterface } from \"../../data/DiscussionReplyInterface\";\nimport { DiscussionReplyService } from \"../../data/DiscussionReplyService\";\nimport { CommonDeleter } from \"@carlonicora/nextjs-jsonapi/components\";\nimport { usePageUrlGenerator } from \"@carlonicora/nextjs-jsonapi/client\";\n\nimport { useTranslations } from \"next-intl\";\nimport { KnowledgeModules } from \"../../../../knowledge.registry\";\n\ntype DiscussionReplyDeleterProps = {\n discussionReply: DiscussionReplyInterface;\n};\n\nfunction DiscussionReplyDeleterInternal({ discussionReply }: DiscussionReplyDeleterProps) {\n const t = useTranslations();\n const generateUrl = usePageUrlGenerator();\n\n if (!discussionReply) return null;\n\n return (\n <CommonDeleter\n // `entities.discussionreplies`, not the endpoint: CommonDeleter feeds `type` to\n // t(`entities.${type}`), and messages/en.json keys these entities without\n // the dashes. The endpoint form raised MISSING_MESSAGE on every render.\n type={`discussionreplies`}\n deleteFunction={() => DiscussionReplyService.delete({ discussionReplyId: discussionReply.id })}\n redirectTo={\n KnowledgeModules.DiscussionReply.pageUrl ? generateUrl({ page: KnowledgeModules.DiscussionReply }) : undefined\n }\n />\n );\n}\n\nexport default function DiscussionReplyDeleter(props: DiscussionReplyDeleterProps) {\n return <DiscussionReplyDeleterInternal {...props} />;\n}\n","\"use client\";\n\nimport {\n Command,\n CommandItem,\n CommandList,\n FormFieldWrapper,\n Input,\n Popover,\n PopoverContent,\n PopoverTrigger,\n} from \"@carlonicora/nextjs-jsonapi/components\";\nimport { DiscussionInterface } from \"../../data/DiscussionInterface\";\nimport { DiscussionService } from \"../../data/DiscussionService\";\nimport { DataListRetriever, useDataListRetriever, useDebounce } from \"@carlonicora/nextjs-jsonapi/client\";\n\nimport { CircleX, RefreshCwIcon, SearchIcon, XIcon } from \"lucide-react\";\nimport { useTranslations } from \"next-intl\";\nimport { useCallback, useEffect, useRef, useState } from \"react\";\nimport { KnowledgeModules } from \"../../../../knowledge.registry\";\n\ntype DiscussionSelectorProps = {\n id: string;\n form: any;\n label?: string;\n placeholder?: string;\n onChange?: (discussion?: DiscussionInterface) => void;\n isRequired?: boolean;\n};\n\nexport default function DiscussionSelector({\n id,\n form,\n label,\n placeholder,\n onChange,\n isRequired = false,\n}: DiscussionSelectorProps) {\n const t = useTranslations();\n\n const [open, setOpen] = useState<boolean>(false);\n\n const searchTermRef = useRef<string>(\"\");\n const [searchTerm, setSearchTerm] = useState<string>(\"\");\n\n const [isSearching, setIsSearching] = useState<boolean>(false);\n\n const data: DataListRetriever<DiscussionInterface> = useDataListRetriever({\n retriever: (params) => {\n return DiscussionService.findMany(params);\n },\n retrieverParams: {},\n module: KnowledgeModules.Discussion,\n });\n\n const search = useCallback(\n async (searchedTerm: string) => {\n try {\n if (searchedTerm === searchTermRef.current) return;\n setIsSearching(true);\n searchTermRef.current = searchedTerm;\n await data.search(searchedTerm);\n } finally {\n setIsSearching(false);\n }\n },\n [searchTermRef, data],\n );\n\n const updateSearchTerm = useDebounce(search, 500);\n\n useEffect(() => {\n setIsSearching(true);\n updateSearchTerm(searchTerm);\n }, [updateSearchTerm, searchTerm]);\n\n const setDiscussion = (discussion?: DiscussionInterface) => {\n if (onChange) onChange(discussion);\n if (!discussion) {\n form.setValue(id, undefined);\n setOpen(false);\n return;\n }\n\n form.setValue(id, { id: discussion.id, name: discussion.name });\n setOpen(false);\n\n setTimeout(() => {\n setOpen(false);\n }, 0);\n };\n\n return (\n <div className=\"flex w-full flex-col\">\n <FormFieldWrapper form={form} name={id} label={label} isRequired={isRequired}>\n {(field) => (\n <Popover open={open} onOpenChange={setOpen} modal={true}>\n <div className=\"flex w-full flex-row items-center justify-between\">\n <PopoverTrigger className=\"w-full\">\n <div className=\"flex w-full flex-row items-center justify-start rounded-md\">\n {field.value ? (\n <div className=\"bg-input/20 dark:bg-input/30 border-input flex h-7 w-full flex-row items-center justify-start rounded-md border px-2 py-0.5 text-sm md:text-xs/relaxed\">\n <span>{field.value?.name ?? \"\"}</span>\n </div>\n ) : (\n <div className=\"bg-input/20 dark:bg-input/30 border-input text-muted-foreground flex h-7 w-full flex-row items-center justify-start rounded-md border px-2 py-0.5 text-sm md:text-xs/relaxed\">\n {placeholder ?? t(`ui.search.placeholder`, { type: t(`entities.discussions`, { count: 1 }) })}\n </div>\n )}\n </div>\n </PopoverTrigger>\n {field.value && (\n <CircleX\n className=\"text-muted hover:text-destructive ms-2 h-4 w-4 shrink-0 cursor-pointer\"\n onClick={() => setDiscussion()}\n />\n )}\n </div>\n <PopoverContent align=\"start\" className=\"w-(--anchor-width)\">\n <Command shouldFilter={false}>\n <div className=\"relative mb-2 w-full\">\n <SearchIcon className=\"text-muted-foreground absolute top-2.5 start-2.5 h-4 w-4\" />\n <Input\n placeholder={t(`ui.search.placeholder`, { type: t(`entities.discussions`, { count: 1 }) })}\n type=\"text\"\n className=\"w-full pe-8 ps-8\"\n onChange={(e) => setSearchTerm(e.target.value)}\n value={searchTerm}\n />\n {isSearching ? (\n <RefreshCwIcon className=\"text-muted-foreground absolute top-2.5 end-2.5 h-4 w-4 animate-spin\" />\n ) : searchTermRef.current ? (\n <XIcon\n className={`absolute top-2.5 end-2.5 h-4 w-4 ${searchTermRef.current ? \"cursor-pointer\" : \"text-muted-foreground\"}`}\n onClick={() => {\n setSearchTerm(\"\");\n search(\"\");\n }}\n />\n ) : (\n <></>\n )}\n </div>\n <CommandList>\n {data.data &&\n data.data.length > 0 &&\n (data.data as DiscussionInterface[]).map((discussion: DiscussionInterface) => (\n <CommandItem\n className=\"hover:bg-muted data-selected:hover:bg-muted cursor-pointer bg-transparent data-selected:bg-transparent\"\n key={discussion.id}\n onSelect={() => setDiscussion(discussion)}\n >\n <span className=\"\">{discussion.name}</span>\n </CommandItem>\n ))}\n </CommandList>\n </Command>\n </PopoverContent>\n </Popover>\n )}\n </FormFieldWrapper>\n </div>\n );\n}\n","\"use client\";\n\nimport { DiscussionReplyInput, DiscussionReplyInterface } from \"../../data/DiscussionReplyInterface\";\nimport { DiscussionReplyService } from \"../../data/DiscussionReplyService\";\nimport DiscussionSelector from \"../../../discussion/components/forms/DiscussionSelector\";\nimport { useI18nRouter } from \"@carlonicora/nextjs-jsonapi/client\";\nimport { getKnowledgeUiConfig } from \"../../../../config/knowledge.ui.config\";\nimport { EditorSheet, FormBlockNote } from \"@carlonicora/nextjs-jsonapi/components\";\nimport { useCurrentUserContext } from \"@carlonicora/nextjs-jsonapi/contexts\";\nimport { Action, entityObjectSchema } from \"@carlonicora/nextjs-jsonapi/core\";\nimport { zodResolver } from \"@hookform/resolvers/zod\";\nimport { useTranslations } from \"next-intl\";\nimport { ReactNode, useCallback, useMemo, useState } from \"react\";\nimport { useForm } from \"react-hook-form\";\nimport { v4 } from \"uuid\";\nimport { z } from \"zod\";\nimport { KnowledgeModules } from \"../../../../knowledge.registry\";\n\ntype DiscussionReplyEditorProps = {\n discussionReply?: DiscussionReplyInterface;\n propagateChanges?: (discussionReply: DiscussionReplyInterface) => void;\n trigger?: ReactNode;\n forceShow?: boolean;\n onClose?: () => void;\n dialogOpen?: boolean;\n onDialogOpenChange?: (open: boolean) => void;\n};\n\nfunction DiscussionReplyEditorInternal({\n discussionReply,\n propagateChanges,\n trigger,\n forceShow,\n onClose,\n dialogOpen,\n onDialogOpenChange,\n}: DiscussionReplyEditorProps) {\n const router = useI18nRouter();\n const t = useTranslations();\n const formSchema = useMemo(\n () =>\n z.object({\n id: z.uuidv4(),\n content: z.any(),\n discussion: entityObjectSchema.refine((data) => data.id && data.id.length > 0, {\n message: t(`features.discussionreply.relationships.discussion.error`),\n }),\n }),\n [t],\n );\n\n const getDefaultValues = useCallback(\n () => ({\n id: discussionReply?.id || v4(),\n content: discussionReply?.content || [],\n discussion: discussionReply?.discussion\n ? { id: discussionReply.discussion.id, name: discussionReply.discussion.name }\n : undefined,\n }),\n [discussionReply],\n );\n\n const form = useForm<z.infer<typeof formSchema>>({\n resolver: zodResolver(formSchema),\n defaultValues: getDefaultValues(),\n });\n\n // BlockNote reports a mount-time change for an empty editor, which would mark the field dirty and\n // trigger the discard dialog on an untouched form. Emptiness comes from `onEmptyChange`; an empty\n // rich-text field never counts as dirty (pattern: wyrdli ClueEditor / a360ai OpportunityEditor).\n const [isContentEmpty, setIsContentEmpty] = useState<boolean>(\n !discussionReply?.content || (Array.isArray(discussionReply.content) && discussionReply.content.length === 0),\n );\n const { dirtyFields } = form.formState;\n const isFormDirty = useCallback(() => {\n const dirty: Record<string, unknown> = { ...dirtyFields };\n if (dirty.content && isContentEmpty) delete dirty.content;\n return Object.keys(dirty).length > 0;\n }, [dirtyFields, isContentEmpty]);\n\n return (\n <EditorSheet\n form={form}\n entityType={t(`entities.discussionreplies`, { count: 1 })}\n entityName={discussionReply?.id}\n isEdit={!!discussionReply}\n module={KnowledgeModules.DiscussionReply}\n propagateChanges={propagateChanges}\n isFormDirty={isFormDirty}\n size=\"md\"\n onSubmit={async (values) => {\n const payload: DiscussionReplyInput = {\n id: values.id,\n content: values.content,\n discussionId: values.discussion?.id,\n // `approvedReply` is written only by PATCH discussions/:id/replies/:replyId/approve.\n };\n\n return discussionReply\n ? await DiscussionReplyService.update(payload)\n : await DiscussionReplyService.create(payload);\n }}\n onRevalidate={getKnowledgeUiConfig().revalidatePaths}\n onNavigate={(url) => router.push(url)}\n onReset={() => {\n setIsContentEmpty(\n !discussionReply?.content || (Array.isArray(discussionReply.content) && discussionReply.content.length === 0),\n );\n return getDefaultValues();\n }}\n onClose={onClose}\n trigger={trigger}\n forceShow={forceShow}\n dialogOpen={dialogOpen}\n onDialogOpenChange={onDialogOpenChange}\n >\n <div className=\"flex w-full flex-col gap-y-4\">\n <FormBlockNote\n form={form}\n id=\"content\"\n name={t(`features.discussionreply.fields.content.label`)}\n placeholder={t(`features.discussionreply.fields.content.placeholder`)}\n type=\"discussionReply\"\n onEmptyChange={setIsContentEmpty}\n />\n <DiscussionSelector\n id=\"discussion\"\n form={form}\n label={t(`features.discussionreply.relationships.discussion.label`)}\n placeholder={t(`features.discussionreply.relationships.discussion.placeholder`)}\n isRequired\n />\n </div>\n </EditorSheet>\n );\n}\n\nexport default function DiscussionReplyEditor(props: DiscussionReplyEditorProps) {\n const { hasPermissionToModule } = useCurrentUserContext();\n const action = props.discussionReply ? Action.Update : Action.Create;\n\n if (!hasPermissionToModule({ module: KnowledgeModules.DiscussionReply, action, data: props.discussionReply }))\n return null;\n\n return <DiscussionReplyEditorInternal {...props} />;\n}\n","\"use client\";\n\nimport DiscussionReplyDeleter from \"../components/forms/DiscussionReplyDeleter\";\nimport DiscussionReplyEditor from \"../components/forms/DiscussionReplyEditor\";\nimport { DiscussionReplyInterface } from \"../data/DiscussionReplyInterface\";\nimport { DiscussionReplyService } from \"../data/DiscussionReplyService\";\nimport { SharedProvider } from \"@carlonicora/nextjs-jsonapi/contexts\";\nimport { usePageUrlGenerator } from \"@carlonicora/nextjs-jsonapi/client\";\nimport { BreadcrumbItemData } from \"@carlonicora/nextjs-jsonapi/core\";\n\nimport { JsonApiHydratedDataInterface, rehydrate } from \"@carlonicora/nextjs-jsonapi/core\";\nimport { useTranslations } from \"next-intl\";\nimport { createContext, ReactNode, useContext, useState } from \"react\";\nimport { KnowledgeModules } from \"../../../knowledge.registry\";\n\ninterface DiscussionReplyContextType {\n discussionReply: DiscussionReplyInterface | undefined;\n setDiscussionReply: (value: DiscussionReplyInterface | undefined) => void;\n reloadDiscussionReply: () => Promise<void>;\n}\n\nconst DiscussionReplyContext = createContext<DiscussionReplyContextType | undefined>(undefined);\n\ntype DiscussionReplyProviderProps = {\n children: ReactNode;\n dehydratedDiscussionReply?: JsonApiHydratedDataInterface;\n};\n\nexport const DiscussionReplyProvider = ({ children, dehydratedDiscussionReply }: DiscussionReplyProviderProps) => {\n const generateUrl = usePageUrlGenerator();\n const t = useTranslations();\n\n const [discussionReply, setDiscussionReply] = useState<DiscussionReplyInterface | undefined>(\n dehydratedDiscussionReply\n ? rehydrate<DiscussionReplyInterface>(KnowledgeModules.DiscussionReply, dehydratedDiscussionReply)\n : undefined,\n );\n\n const reloadDiscussionReply = async () => {\n if (!discussionReply) return;\n\n const freshDiscussionReply = await DiscussionReplyService.findOne({ id: discussionReply.id });\n setDiscussionReply(freshDiscussionReply);\n };\n\n const breadcrumb = () => {\n const response: BreadcrumbItemData[] = [];\n\n response.push({\n name: t(`entities.discussionreplies`, { count: 2 }),\n href: KnowledgeModules.DiscussionReply.pageUrl\n ? generateUrl({ page: KnowledgeModules.DiscussionReply })\n : undefined,\n });\n\n if (discussionReply)\n response.push({\n name: discussionReply.id,\n href: KnowledgeModules.DiscussionReply.pageUrl\n ? generateUrl({ page: KnowledgeModules.DiscussionReply, id: discussionReply.id })\n : undefined,\n });\n\n return response;\n };\n\n const title = () => {\n const response: any = {\n type: t(`entities.discussionreplies`, { count: discussionReply ? 1 : 2 }),\n };\n\n const functions: ReactNode[] = [];\n\n if (discussionReply) {\n functions.push(<DiscussionReplyDeleter key={`DiscussionReplyDeleter`} discussionReply={discussionReply} />);\n functions.push(\n <DiscussionReplyEditor\n key={`DiscussionReplyEditor`}\n discussionReply={discussionReply}\n propagateChanges={setDiscussionReply}\n />,\n );\n } else {\n functions.push(<DiscussionReplyEditor key={`DiscussionReplyEditor`} />);\n }\n\n if (functions.length > 0) response.functions = functions;\n\n return response;\n };\n\n return (\n <SharedProvider value={{ breadcrumbs: breadcrumb(), title: title() }}>\n <DiscussionReplyContext.Provider\n value={{\n discussionReply: discussionReply,\n setDiscussionReply: setDiscussionReply,\n reloadDiscussionReply: reloadDiscussionReply,\n }}\n >\n {children}\n </DiscussionReplyContext.Provider>\n </SharedProvider>\n );\n};\n\nexport const useDiscussionReplyContext = (): DiscussionReplyContextType => {\n const context = useContext(DiscussionReplyContext);\n if (context === undefined) {\n throw new Error(\"useDiscussionReplyContext must be used within a DiscussionReplyProvider\");\n }\n return context;\n};\n","\"use client\";\n\nimport { DiscussionReplyFields } from \"../data/DiscussionReplyFields\";\nimport { DiscussionReplyInterface } from \"../data/DiscussionReplyInterface\";\nimport { cellDate, cellId } from \"@carlonicora/nextjs-jsonapi/components\";\nimport {\n registerTableGenerator,\n TableContent,\n usePageUrlGenerator,\n UseTableStructureHook,\n} from \"@carlonicora/nextjs-jsonapi/client\";\nimport { Link, Tooltip, TooltipContent, TooltipTrigger } from \"@carlonicora/nextjs-jsonapi/components\";\nimport { ColumnDef } from \"@tanstack/react-table\";\nimport { useTranslations } from \"next-intl\";\nimport { useMemo } from \"react\";\nimport { KnowledgeModules } from \"../../../knowledge.registry\";\n\nexport const useDiscussionReplyTableStructure: UseTableStructureHook<\n DiscussionReplyInterface,\n DiscussionReplyFields\n> = (params) => {\n const t = useTranslations();\n const generateUrl = usePageUrlGenerator();\n\n const tableData = useMemo(() => {\n return params.data.map((discussionReply: DiscussionReplyInterface) => {\n const entry: TableContent<DiscussionReplyInterface> = {\n jsonApiData: discussionReply,\n };\n entry[DiscussionReplyFields.discussionReplyId] = discussionReply.id;\n params.fields.forEach((field) => {\n entry[field] = discussionReply[field as keyof DiscussionReplyInterface];\n });\n return entry;\n });\n }, [params.data, params.fields]);\n\n const fieldColumnMap: Partial<Record<DiscussionReplyFields, () => any>> = {\n [DiscussionReplyFields.discussionReplyId]: () =>\n cellId({\n name: \"discussionReplyId\",\n checkedIds: params.checkedIds,\n toggleId: params.toggleId,\n }),\n [DiscussionReplyFields.author]: () => ({\n id: \"author\",\n accessorKey: \"author\",\n header: t(`features.discussionreply.relationships.author.label`),\n cell: ({ row }: { row: TableContent<DiscussionReplyInterface> }) => {\n const discussionReply: DiscussionReplyInterface = row.original.jsonApiData;\n return (\n <Tooltip>\n <TooltipTrigger>\n {KnowledgeModules.DiscussionReply.pageUrl ? (\n <Link href={generateUrl({ page: KnowledgeModules.DiscussionReply, id: discussionReply.id })}>\n {discussionReply.author?.name ?? \"\"}\n </Link>\n ) : (\n <span>{discussionReply.author?.name ?? \"\"}</span>\n )}\n </TooltipTrigger>\n <TooltipContent>{discussionReply.author?.name ?? \"\"}</TooltipContent>\n </Tooltip>\n );\n },\n enableSorting: false,\n enableHiding: false,\n }),\n [DiscussionReplyFields.discussion]: () => ({\n id: \"discussion\",\n accessorKey: \"discussion\",\n header: t(`features.discussionreply.relationships.discussion.label`),\n cell: ({ row }: { row: TableContent<DiscussionReplyInterface> }) => {\n const discussionReply: DiscussionReplyInterface = row.original.jsonApiData;\n return <span>{discussionReply.discussion?.name ?? \"\"}</span>;\n },\n enableSorting: false,\n enableHiding: false,\n }),\n [DiscussionReplyFields.createdAt]: () =>\n cellDate({\n name: \"createdAt\",\n title: t(`common.date.create`),\n }),\n [DiscussionReplyFields.updatedAt]: () =>\n cellDate({\n name: \"updatedAt\",\n title: t(`common.date.update`),\n }),\n };\n\n const columns = useMemo(() => {\n return params.fields.map((field) => fieldColumnMap[field]?.()).filter((col) => col !== undefined) as ColumnDef<\n TableContent<DiscussionReplyInterface>\n >[];\n }, [params.fields, fieldColumnMap, t, generateUrl]);\n\n return useMemo(() => ({ data: tableData, columns: columns }), [tableData, columns]);\n};\n\nregisterTableGenerator(KnowledgeModules.DiscussionReply, useDiscussionReplyTableStructure);\n","\"use client\";\n\nimport DiscussionReplyEditor from \"../forms/DiscussionReplyEditor\";\nimport { DiscussionReplyFields } from \"../../data/DiscussionReplyFields\";\nimport { DiscussionReplyInterface } from \"../../data/DiscussionReplyInterface\";\nimport { DiscussionReplyService } from \"../../data/DiscussionReplyService\";\nimport \"../../hooks/useDiscussionReplyTableStructure\";\nimport type { DiscussionInterface } from \"../../../discussion/data/DiscussionInterface\";\nimport { ContentListTable } from \"@carlonicora/nextjs-jsonapi/components\";\nimport { DataListRetriever, useDataListRetriever } from \"@carlonicora/nextjs-jsonapi/client\";\nimport { useTranslations } from \"next-intl\";\nimport { ReactNode } from \"react\";\nimport { KnowledgeModules } from \"../../../../knowledge.registry\";\n\n// The parent prop is hand-added, matching the other content lists (deviation D8).\ntype DiscussionReplyListProps = {\n fullWidth?: boolean;\n discussion?: DiscussionInterface;\n};\n\nexport default function DiscussionReplyList({ fullWidth, discussion }: DiscussionReplyListProps) {\n const t = useTranslations();\n\n const data: DataListRetriever<DiscussionReplyInterface> = useDataListRetriever({\n module: KnowledgeModules.DiscussionReply,\n retriever: (params: any) => {\n if (discussion) return DiscussionReplyService.findManyByDiscussion({ ...params, discussionId: discussion.id });\n return DiscussionReplyService.findMany(params);\n },\n retrieverParams: {},\n });\n\n const functions: ReactNode[] = [<DiscussionReplyEditor key=\"create-discussion-reply\" />];\n\n return (\n <ContentListTable\n data={data}\n fields={[DiscussionReplyFields.author, DiscussionReplyFields.discussion, DiscussionReplyFields.updatedAt]}\n tableGeneratorType={KnowledgeModules.DiscussionReply}\n functions={functions}\n title={t(`entities.discussionreplies`, { count: 2 })}\n fullWidth={fullWidth}\n />\n );\n}\n","\"use client\";\n\nimport DiscussionReplyList from \"../lists/DiscussionReplyList\";\nimport { RoundPageContainer } from \"@carlonicora/nextjs-jsonapi/components\";\nimport { KnowledgeModules } from \"../../../../knowledge.registry\";\n\nfunction DiscussionReplyListContainerInternal() {\n return (\n <RoundPageContainer module={KnowledgeModules.DiscussionReply} fullWidth>\n <DiscussionReplyList fullWidth />\n </RoundPageContainer>\n );\n}\n\nexport default function DiscussionReplyListContainer() {\n return <DiscussionReplyListContainerInternal />;\n}\n","\"use client\";\n\nimport { resolveField } from \"../../../../common/i18n/translationResolver\";\nimport { useContentLanguage } from \"../../../../common/hooks/useContentLanguage\";\nimport { DiscussionReplyInterface } from \"../../data/DiscussionReplyInterface\";\nimport { AttributeElement, BlockNoteEditorContainer, Card, MicroLabel } from \"@carlonicora/nextjs-jsonapi/components\";\nimport { useTranslations } from \"next-intl\";\n\ntype DiscussionReplyContentProps = { discussionReply: DiscussionReplyInterface };\n\nexport function DiscussionReplyContent({ discussionReply }: DiscussionReplyContentProps) {\n const t = useTranslations();\n const language = useContentLanguage();\n\n const content = resolveField({\n original: discussionReply.content,\n translation: discussionReply.translation,\n field: \"content\",\n language,\n });\n\n return (\n <div className=\"flex flex-col gap-y-8\">\n <div className=\"flex flex-col gap-y-3\">\n <MicroLabel as=\"h3\">{t(`features.discussionreply.fields.content.label`)}</MicroLabel>\n <Card className=\"flex w-full flex-col p-4\">\n <BlockNoteEditorContainer\n id={`discussion-reply-content-${discussionReply.id}`}\n type=\"discussionReply\"\n initialContent={content}\n />\n </Card>\n </div>\n <div className=\"flex flex-col gap-y-3\">\n <MicroLabel as=\"h3\">{t(`features.discussionreply.sections.details`)}</MicroLabel>\n <div className=\"grid grid-cols-1 gap-4 md:grid-cols-3\">\n {discussionReply.author && (\n <AttributeElement\n title={t(`features.discussionreply.relationships.author.label`)}\n value={discussionReply.author.name}\n />\n )}\n {discussionReply.discussion && (\n <AttributeElement\n title={t(`features.discussionreply.relationships.discussion.label`)}\n value={discussionReply.discussion.name}\n />\n )}\n </div>\n </div>\n </div>\n );\n}\n","\"use client\";\n\nimport { DiscussionReplyContent } from \"../details/DiscussionReplyContent\";\nimport { useDiscussionReplyContext } from \"../../contexts/DiscussionReplyContext\";\nimport { DiscussionReplyInterface } from \"../../data/DiscussionReplyInterface\";\nimport { RoundPageContainer, Tab } from \"@carlonicora/nextjs-jsonapi/components\";\nimport { useCurrentUserContext } from \"@carlonicora/nextjs-jsonapi/contexts\";\nimport { Action } from \"@carlonicora/nextjs-jsonapi/core\";\nimport { useTranslations } from \"next-intl\";\nimport { KnowledgeModules } from \"../../../../knowledge.registry\";\n\ntype DiscussionReplyContainerProps = { discussionReply: DiscussionReplyInterface };\n\nfunction DiscussionReplyContainerInternal({ discussionReply }: DiscussionReplyContainerProps) {\n const t = useTranslations();\n\n const tabs: Tab[] = [\n {\n sectionKey: \"details\",\n label: t(`features.discussionreply.sections.details`),\n content: <DiscussionReplyContent discussionReply={discussionReply} />,\n },\n ];\n\n return <RoundPageContainer module={KnowledgeModules.DiscussionReply} id={discussionReply.id} tabs={tabs} />;\n}\n\nexport default function DiscussionReplyContainer() {\n const { hasPermissionToModule } = useCurrentUserContext();\n const { discussionReply } = useDiscussionReplyContext();\n if (!discussionReply) return null;\n if (!hasPermissionToModule({ module: KnowledgeModules.DiscussionReply, action: Action.Read, data: discussionReply }))\n return null;\n return <DiscussionReplyContainerInternal discussionReply={discussionReply} />;\n}\n","\"use client\";\n\nimport { DiscussionReplyInterface } from \"../../data/DiscussionReplyInterface\";\nimport { DiscussionReplyService } from \"../../data/DiscussionReplyService\";\nimport { EntityMultiSelector } from \"@carlonicora/nextjs-jsonapi/components\";\nimport { useTranslations } from \"next-intl\";\nimport { KnowledgeModules } from \"../../../../knowledge.registry\";\n\ntype DiscussionReplyMultiSelectorProps = {\n id: string;\n form: any;\n currentDiscussionReply?: DiscussionReplyInterface;\n label?: string;\n placeholder?: string;\n onChange?: (discussionReplies?: DiscussionReplyInterface[]) => void;\n maxCount?: number;\n isRequired?: boolean;\n};\n\nexport default function DiscussionReplyMultiSelector({\n id,\n form,\n currentDiscussionReply,\n label,\n placeholder,\n onChange,\n isRequired = false,\n}: DiscussionReplyMultiSelectorProps) {\n const t = useTranslations();\n\n return (\n <EntityMultiSelector<DiscussionReplyInterface>\n id={id}\n form={form}\n label={label}\n placeholder={placeholder || t(\"ui.search.button\")}\n emptyText={t(\"ui.search.no_results_generic\")}\n isRequired={isRequired}\n retriever={(params) => DiscussionReplyService.findMany(params)}\n module={KnowledgeModules.DiscussionReply}\n // A reply has no name; the generator fell back to `translation`, which is now a map.\n // Identify a reply by its author, as `displayProp: \"id\"` intended.\n getLabel={(discussionReply) => discussionReply.author?.name ?? discussionReply.id}\n excludeId={currentDiscussionReply?.id}\n onChange={onChange}\n />\n );\n}\n","\"use client\";\n\nimport { DiscussionReplyProvider } from \"../../contexts/DiscussionReplyContext\";\nimport DiscussionReplyListContainer from \"../containers/DiscussionReplyListContainer\";\n\nexport function DiscussionReplyListScreen() {\n return (\n <DiscussionReplyProvider>\n <DiscussionReplyListContainer />\n </DiscussionReplyProvider>\n );\n}\n","\"use client\";\n\nimport type { JsonApiHydratedDataInterface } from \"@carlonicora/nextjs-jsonapi/core\";\nimport { DiscussionReplyProvider } from \"../../contexts/DiscussionReplyContext\";\nimport DiscussionReplyContainer from \"../containers/DiscussionReplyContainer\";\n\nexport function DiscussionReplyDetailScreen({\n dehydratedDiscussionReply,\n}: {\n dehydratedDiscussionReply: JsonApiHydratedDataInterface;\n}) {\n return (\n <DiscussionReplyProvider dehydratedDiscussionReply={dehydratedDiscussionReply}>\n <DiscussionReplyContainer />\n </DiscussionReplyProvider>\n );\n}\n","\"use client\";\n\nimport { DocumentInterface } from \"../../data/DocumentInterface\";\nimport { DocumentService } from \"../../data/DocumentService\";\nimport { CommonDeleter } from \"@carlonicora/nextjs-jsonapi/components\";\nimport { usePageUrlGenerator } from \"@carlonicora/nextjs-jsonapi/client\";\n\nimport { useTranslations } from \"next-intl\";\nimport { KnowledgeModules } from \"../../../../knowledge.registry\";\n\ntype DocumentDeleterProps = {\n document: DocumentInterface;\n};\n\nfunction DocumentDeleterInternal({ document }: DocumentDeleterProps) {\n const t = useTranslations();\n const generateUrl = usePageUrlGenerator();\n\n if (!document) return null;\n\n return (\n <CommonDeleter\n type={`documents`}\n deleteFunction={() => DocumentService.delete({ documentId: document.id })}\n redirectTo={KnowledgeModules.Document.pageUrl ? generateUrl({ page: KnowledgeModules.Document }) : undefined}\n />\n );\n}\n\nexport default function DocumentDeleter(props: DocumentDeleterProps) {\n return <DocumentDeleterInternal {...props} />;\n}\n","export const getFileExtension = (fileType: string): string => {\n switch (fileType) {\n case \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\":\n return \"docx\";\n case \"application/pdf\":\n return \"pdf\";\n case \"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\":\n return \"xlsx\";\n case \"application/vnd.openxmlformats-officedocument.presentationml.presentation\":\n return \"pptx\";\n case \"image/jpeg\":\n return \"jpg\";\n case \"image/png\":\n return \"png\";\n case \"image/gif\":\n return \"gif\";\n case \"image/webp\":\n return \"webp\";\n case \"image/svg+xml\":\n return \"svg\";\n case \"text/plain\":\n return \"txt\";\n case \"text/html\":\n return \"html\";\n case \"text/csv\":\n return \"csv\";\n case \"text/markdown\":\n return \"md\";\n case \"application/rtf\":\n return \"rtf\";\n case \"application/json\":\n return \"json\";\n case \"application/xml\":\n return \"xml\";\n default:\n // Unknown MIME type - return empty to prevent arbitrary extensions\n return \"\";\n }\n};\n","\"use client\";\n\nimport { DocumentInput, DocumentInterface } from \"../../data/DocumentInterface\";\nimport { DocumentService } from \"../../data/DocumentService\";\nimport { getFileExtension } from \"../../utils/fileExtension\";\nimport CommunityOfExpertiseSelector from \"../../../../expertise/community-of-expertise/components/forms/CommunityOfExpertiseSelector\";\nimport TaxonomyMultiSelector from \"../../../../expertise/taxonomy/components/forms/TaxonomyMultiSelector\";\nimport { useI18nRouter } from \"@carlonicora/nextjs-jsonapi/client\";\nimport { getKnowledgeUiConfig } from \"../../../../config/knowledge.ui.config\";\nimport { useContentLanguage } from \"../../../../common/hooks/useContentLanguage\";\nimport { ContentLanguage, ContentStatus } from \"../../../../../shared\";\nimport {\n DropzoneOptions,\n EditorSheet,\n FileInput,\n FileUploader,\n FormBlockNote,\n FormInput,\n FormSelect,\n} from \"@carlonicora/nextjs-jsonapi/components\";\nimport { useCurrentUserContext } from \"@carlonicora/nextjs-jsonapi/contexts\";\nimport { entityObjectSchema, S3Service } from \"@carlonicora/nextjs-jsonapi/core\";\nimport { zodResolver } from \"@hookform/resolvers/zod\";\nimport { UploadIcon } from \"lucide-react\";\nimport { useTranslations } from \"next-intl\";\nimport { ReactNode, useCallback, useEffect, useMemo, useState } from \"react\";\nimport { useForm } from \"react-hook-form\";\nimport { v4 } from \"uuid\";\nimport { z } from \"zod\";\nimport { KnowledgeModules } from \"../../../../knowledge.registry\";\n\nexport type DocumentUploadEditorProps = {\n document?: DocumentInterface;\n propagateChanges?: (document: DocumentInterface) => void;\n trigger?: ReactNode;\n forceShow?: boolean;\n onClose?: () => void;\n dialogOpen?: boolean;\n onDialogOpenChange?: (open: boolean) => void;\n};\n\nexport default function DocumentUploadEditor({\n document,\n propagateChanges,\n trigger,\n forceShow,\n onClose,\n dialogOpen,\n onDialogOpenChange,\n}: DocumentUploadEditorProps) {\n const router = useI18nRouter();\n const t = useTranslations();\n const contentLanguage = useContentLanguage();\n const { company } = useCurrentUserContext();\n const [files, setFiles] = useState<File[] | null>(null);\n const [file, setFile] = useState<File | null>(null);\n\n const formSchema = useMemo(\n () =>\n z.object({\n id: z.uuidv4(),\n name: z.string().min(1, {\n message: t(`features.document.fields.name.error`),\n }),\n url: z.string().optional(),\n abstract: z.any(),\n tldr: z.string().optional(),\n language: z.string().min(1, {\n message: t(`features.document.fields.language.error`),\n }),\n status: z.string().min(1),\n communityOfExpertise: entityObjectSchema.refine((data) => data.id && data.id.length > 0, {\n message: t(`features.document.relationships.communityofexpertise.error`),\n }),\n taxonomy: z.array(entityObjectSchema).optional(),\n }),\n [t],\n );\n\n const getDefaultValues = useCallback(\n () => ({\n id: document?.id || v4(),\n name: document?.name || \"\",\n url: document?.url || \"\",\n abstract: document?.abstract || [],\n tldr: document?.tldr || \"\",\n language: document?.language || contentLanguage,\n status: document?.status || ContentStatus.cluster,\n communityOfExpertise: document?.communityOfExpertise\n ? { id: document.communityOfExpertise.id, name: document.communityOfExpertise.name }\n : undefined,\n taxonomy: document?.taxonomies ? document.taxonomies.map((item) => ({ id: item.id, name: item.name })) : [],\n }),\n [document, contentLanguage],\n );\n\n const form = useForm<z.infer<typeof formSchema>>({\n resolver: zodResolver(formSchema),\n defaultValues: getDefaultValues(),\n });\n\n // BlockNote reports a mount-time change for an empty editor, which would mark the field dirty and\n // trigger the discard dialog on an untouched form. Emptiness comes from `onEmptyChange`; an empty\n // rich-text field never counts as dirty (pattern: wyrdli ClueEditor / a360ai OpportunityEditor).\n const [isAbstractEmpty, setIsAbstractEmpty] = useState<boolean>(\n !document?.abstract || (Array.isArray(document.abstract) && document.abstract.length === 0),\n );\n const { dirtyFields } = form.formState;\n const isFormDirty = useCallback(() => {\n const dirty: Record<string, unknown> = { ...dirtyFields };\n if (dirty.abstract && isAbstractEmpty) delete dirty.abstract;\n return Object.keys(dirty).length > 0 || !!file;\n }, [dirtyFields, isAbstractEmpty, file]);\n\n useEffect(() => {\n if (files && files.length > 0) setFile(files[0]);\n }, [files]);\n\n useEffect(() => {\n if (!file) return;\n if (!form.getValues(\"name\")) {\n form.setValue(\"name\", file.name.split(\".\").slice(0, -1).join(\".\"), { shouldDirty: true });\n }\n }, [file]);\n\n const languages = useMemo(\n () => Object.values(ContentLanguage).map((language) => ({ id: language, text: t(`common.languages.${language}`) })),\n [t],\n );\n\n const dropzone = {\n multiple: false,\n maxFiles: 1,\n maxSize: 100 * 1024 * 1024,\n preventDropOnDocument: false,\n accept: {\n \"application/pdf\": [\".pdf\"],\n \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\": [\".docx\"],\n \"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\": [\".xlsx\"],\n \"application/vnd.openxmlformats-officedocument.presentationml.presentation\": [\".pptx\"],\n \"text/plain\": [\".txt\"],\n \"text/markdown\": [\".md\"],\n \"image/*\": [\".jpg\", \".jpeg\", \".png\", \".gif\", \".webp\"],\n },\n } satisfies DropzoneOptions;\n\n return (\n <EditorSheet\n form={form}\n entityType={t(`entities.documents`, { count: 1 })}\n entityName={document?.name}\n isEdit={!!document}\n module={KnowledgeModules.Document}\n propagateChanges={propagateChanges}\n isFormDirty={isFormDirty}\n size=\"md\"\n onSubmit={async (values) => {\n let url = values.url;\n\n if (file) {\n if (!company) throw new Error(t(`features.document.errors.no_company`));\n const extension = getFileExtension(file.type);\n url = `companies/${company.id}/documents/${values.id}/${values.id}.${Date.now()}.${extension}`;\n\n await S3Service.upload({ key: url, contentType: file.type, file });\n }\n\n if (!url) throw new Error(t(`features.document.errors.no_file`));\n\n const payload: DocumentInput = {\n id: values.id,\n name: values.name,\n url,\n abstract: values.abstract,\n tldr: values.tldr,\n language: values.language,\n status: values.status,\n communityOfExpertiseId: values.communityOfExpertise?.id,\n taxonomyIds: values.taxonomy ? values.taxonomy.map((item) => item.id) : [],\n };\n\n return document ? await DocumentService.update(payload) : await DocumentService.create(payload);\n }}\n onRevalidate={getKnowledgeUiConfig().revalidatePaths}\n onNavigate={(url) => router.push(url)}\n onReset={() => {\n setIsAbstractEmpty(!document?.abstract || (Array.isArray(document.abstract) && document.abstract.length === 0));\n setFile(null);\n setFiles(null);\n return getDefaultValues();\n }}\n onClose={onClose}\n trigger={trigger}\n forceShow={forceShow}\n dialogOpen={dialogOpen}\n onDialogOpenChange={onDialogOpenChange}\n >\n <div className=\"flex w-full flex-col gap-y-4\">\n <FormInput\n form={form}\n id=\"name\"\n name={t(`features.document.fields.name.label`)}\n placeholder={t(`features.document.fields.name.placeholder`)}\n isRequired\n />\n <FileUploader value={files} onValueChange={setFiles} dropzoneOptions={dropzone} className=\"w-full p-4\">\n <FileInput className=\"text-muted-foreground outline-dashed\" data-testid=\"document-file-input\">\n <div className=\"flex w-full flex-col items-center justify-center gap-y-2 p-4\">\n <UploadIcon className=\"my-2 h-8 w-8\" />\n <span className=\"text-muted-foreground w-full text-center text-xs\">\n {file ? file.name : t(`features.document.click_drag`)}\n </span>\n {document && (\n <span className=\"text-muted-foreground w-full text-center text-xs font-semibold\">\n {t(`features.document.re_upload`)}\n </span>\n )}\n </div>\n </FileInput>\n </FileUploader>\n <FormBlockNote\n form={form}\n id=\"abstract\"\n name={t(`features.document.fields.abstract.label`)}\n placeholder={t(`features.document.fields.abstract.placeholder`)}\n type=\"document\"\n onEmptyChange={setIsAbstractEmpty}\n />\n <FormInput\n form={form}\n id=\"tldr\"\n name={t(`features.document.fields.tldr.label`)}\n placeholder={t(`features.document.fields.tldr.placeholder`)}\n />\n <FormSelect\n form={form}\n id=\"language\"\n name={t(`features.document.fields.language.label`)}\n placeholder={t(`features.document.fields.language.placeholder`)}\n values={languages}\n isRequired\n />\n <CommunityOfExpertiseSelector\n id=\"communityOfExpertise\"\n form={form}\n label={t(`features.document.relationships.communityofexpertise.label`)}\n placeholder={t(`features.document.relationships.communityofexpertise.placeholder`)}\n isRequired\n />\n <TaxonomyMultiSelector id=\"taxonomy\" form={form} label={t(`entities.taxonomies`, { count: 2 })} />\n </div>\n </EditorSheet>\n );\n}\n","\"use client\";\n\nimport DocumentUploadEditor, { DocumentUploadEditorProps } from \"./DocumentUploadEditor\";\nimport { useCurrentUserContext } from \"@carlonicora/nextjs-jsonapi/contexts\";\nimport { Action } from \"@carlonicora/nextjs-jsonapi/core\";\nimport { KnowledgeModules } from \"../../../../knowledge.registry\";\n\ntype DocumentEditorProps = DocumentUploadEditorProps;\n\n/**\n * A Document is a file, not a form field: the generated editor's `url` text input is replaced by\n * the presigned upload in `DocumentUploadEditor`. This file keeps the permission gate and the\n * props contract the generated context and list already depend on.\n */\nexport default function DocumentEditor(props: DocumentEditorProps) {\n const { hasPermissionToModule } = useCurrentUserContext();\n const action = props.document ? Action.Update : Action.Create;\n\n if (!hasPermissionToModule({ module: KnowledgeModules.Document, action, data: props.document })) return null;\n\n return <DocumentUploadEditor {...props} />;\n}\n","\"use client\";\n\nimport DocumentDeleter from \"../components/forms/DocumentDeleter\";\nimport DocumentEditor from \"../components/forms/DocumentEditor\";\nimport { DocumentInterface } from \"../data/DocumentInterface\";\nimport { DocumentService } from \"../data/DocumentService\";\nimport { SharedProvider } from \"@carlonicora/nextjs-jsonapi/contexts\";\nimport { usePageUrlGenerator } from \"@carlonicora/nextjs-jsonapi/client\";\nimport { BreadcrumbItemData } from \"@carlonicora/nextjs-jsonapi/core\";\n\nimport { JsonApiHydratedDataInterface, rehydrate } from \"@carlonicora/nextjs-jsonapi/core\";\nimport { useTranslations } from \"next-intl\";\nimport { createContext, ReactNode, useContext, useState } from \"react\";\nimport { KnowledgeModules } from \"../../../knowledge.registry\";\n\ninterface DocumentContextType {\n document: DocumentInterface | undefined;\n setDocument: (value: DocumentInterface | undefined) => void;\n reloadDocument: () => Promise<void>;\n}\n\nconst DocumentContext = createContext<DocumentContextType | undefined>(undefined);\n\ntype DocumentProviderProps = {\n children: ReactNode;\n dehydratedDocument?: JsonApiHydratedDataInterface;\n};\n\nexport const DocumentProvider = ({ children, dehydratedDocument }: DocumentProviderProps) => {\n const generateUrl = usePageUrlGenerator();\n const t = useTranslations();\n\n const [document, setDocument] = useState<DocumentInterface | undefined>(\n dehydratedDocument ? rehydrate<DocumentInterface>(KnowledgeModules.Document, dehydratedDocument) : undefined,\n );\n\n const reloadDocument = async () => {\n if (!document) return;\n\n const freshDocument = await DocumentService.findOne({ id: document.id });\n setDocument(freshDocument);\n };\n\n const breadcrumb = () => {\n const response: BreadcrumbItemData[] = [];\n\n response.push({\n name: t(`entities.documents`, { count: 2 }),\n href: KnowledgeModules.Document.pageUrl ? generateUrl({ page: KnowledgeModules.Document }) : undefined,\n });\n\n if (document)\n response.push({\n name: document.name,\n href: KnowledgeModules.Document.pageUrl\n ? generateUrl({ page: KnowledgeModules.Document, id: document.id })\n : undefined,\n });\n\n return response;\n };\n\n const title = () => {\n const response: any = {\n type: t(`entities.documents`, { count: document ? 1 : 2 }),\n };\n\n const functions: ReactNode[] = [];\n\n if (document) {\n response.element = document.name;\n\n functions.push(<DocumentDeleter key={`DocumentDeleter`} document={document} />);\n functions.push(<DocumentEditor key={`DocumentEditor`} document={document} propagateChanges={setDocument} />);\n } else {\n functions.push(<DocumentEditor key={`DocumentEditor`} />);\n }\n\n if (functions.length > 0) response.functions = functions;\n\n return response;\n };\n\n return (\n <SharedProvider value={{ breadcrumbs: breadcrumb(), title: title() }}>\n <DocumentContext.Provider\n value={{\n document: document,\n setDocument: setDocument,\n reloadDocument: reloadDocument,\n }}\n >\n {children}\n </DocumentContext.Provider>\n </SharedProvider>\n );\n};\n\nexport const useDocumentContext = (): DocumentContextType => {\n const context = useContext(DocumentContext);\n if (context === undefined) {\n throw new Error(\"useDocumentContext must be used within a DocumentProvider\");\n }\n return context;\n};\n","\"use client\";\n\nimport { DocumentFields } from \"../data/DocumentFields\";\nimport { DocumentInterface } from \"../data/DocumentInterface\";\nimport { resolveField } from \"../../../common/i18n/translationResolver\";\nimport ContentStatusBadge from \"../../common/components/ContentStatusBadge\";\nimport { useContentLanguage } from \"../../../common/hooks/useContentLanguage\";\nimport { cellDate, cellId } from \"@carlonicora/nextjs-jsonapi/components\";\nimport {\n registerTableGenerator,\n TableContent,\n usePageUrlGenerator,\n UseTableStructureHook,\n} from \"@carlonicora/nextjs-jsonapi/client\";\nimport { Link, Tooltip, TooltipContent, TooltipTrigger } from \"@carlonicora/nextjs-jsonapi/components\";\nimport { ColumnDef } from \"@tanstack/react-table\";\nimport { useTranslations } from \"next-intl\";\nimport { useMemo } from \"react\";\nimport { KnowledgeModules } from \"../../../knowledge.registry\";\n\nexport const useDocumentTableStructure: UseTableStructureHook<DocumentInterface, DocumentFields> = (params) => {\n const t = useTranslations();\n const generateUrl = usePageUrlGenerator();\n const language = useContentLanguage();\n\n const tableData = useMemo(() => {\n return params.data.map((document: DocumentInterface) => {\n const entry: TableContent<DocumentInterface> = {\n jsonApiData: document,\n };\n entry[DocumentFields.documentId] = document.id;\n params.fields.forEach((field) => {\n entry[field] = document[field as keyof DocumentInterface];\n });\n return entry;\n });\n }, [params.data, params.fields]);\n\n const fieldColumnMap: Partial<Record<DocumentFields, () => any>> = {\n [DocumentFields.documentId]: () =>\n cellId({\n name: \"documentId\",\n checkedIds: params.checkedIds,\n toggleId: params.toggleId,\n }),\n [DocumentFields.name]: () => ({\n id: \"name\",\n accessorKey: \"name\",\n header: t(`features.document.fields.name.label`),\n cell: ({ row }: { row: TableContent<DocumentInterface> }) => {\n const document: DocumentInterface = row.original.jsonApiData;\n // C9: list cells read in the user's language, falling back to the original.\n const name = resolveField({\n original: document.name,\n translation: document.translation,\n field: \"name\",\n language,\n });\n return (\n <Tooltip>\n <TooltipTrigger>\n {KnowledgeModules.Document.pageUrl ? (\n <Link href={generateUrl({ page: KnowledgeModules.Document, id: document.id })}>{name}</Link>\n ) : (\n <span>{name}</span>\n )}\n </TooltipTrigger>\n <TooltipContent>{name}</TooltipContent>\n </Tooltip>\n );\n },\n enableSorting: false,\n enableHiding: false,\n }),\n [DocumentFields.url]: () => ({\n id: \"url\",\n accessorKey: \"url\",\n header: t(`features.document.fields.url.label`),\n cell: ({ row }: { row: TableContent<DocumentInterface> }) => {\n const document: DocumentInterface = row.original.jsonApiData;\n return <span>{document.url}</span>;\n },\n enableSorting: false,\n enableHiding: false,\n }),\n [DocumentFields.aiStatus]: () => ({\n id: \"aiStatus\",\n accessorKey: \"aiStatus\",\n header: t(`features.document.fields.aiStatus.label`),\n cell: ({ row }: { row: TableContent<DocumentInterface> }) => {\n const document: DocumentInterface = row.original.jsonApiData;\n return <span>{document.aiStatus}</span>;\n },\n enableSorting: false,\n enableHiding: false,\n }),\n [DocumentFields.language]: () => ({\n id: \"language\",\n accessorKey: \"language\",\n header: t(`features.document.fields.language.label`),\n cell: ({ row }: { row: TableContent<DocumentInterface> }) => {\n const document: DocumentInterface = row.original.jsonApiData;\n return <span>{document.language ? t(`common.languages.${document.language}`) : \"\"}</span>;\n },\n enableSorting: false,\n enableHiding: false,\n }),\n [DocumentFields.status]: () => ({\n id: \"status\",\n accessorKey: \"status\",\n header: t(`features.document.fields.status.label`),\n cell: ({ row }: { row: TableContent<DocumentInterface> }) => {\n const document: DocumentInterface = row.original.jsonApiData;\n return <ContentStatusBadge status={document.status} />;\n },\n enableSorting: false,\n enableHiding: false,\n }),\n [DocumentFields.communityOfExpertise]: () => ({\n id: \"communityOfExpertise\",\n accessorKey: \"communityOfExpertise\",\n header: t(`features.document.relationships.communityofexpertise.label`),\n cell: ({ row }: { row: TableContent<DocumentInterface> }) => {\n const document: DocumentInterface = row.original.jsonApiData;\n return <span>{document.communityOfExpertise?.name ?? \"\"}</span>;\n },\n enableSorting: false,\n enableHiding: false,\n }),\n [DocumentFields.author]: () => ({\n id: \"author\",\n accessorKey: \"author\",\n header: t(`features.document.relationships.author.label`),\n cell: ({ row }: { row: TableContent<DocumentInterface> }) => {\n const document: DocumentInterface = row.original.jsonApiData;\n return <span>{document.author?.name ?? \"\"}</span>;\n },\n enableSorting: false,\n enableHiding: false,\n }),\n [DocumentFields.createdAt]: () =>\n cellDate({\n name: \"createdAt\",\n title: t(`common.date.create`),\n }),\n [DocumentFields.updatedAt]: () =>\n cellDate({\n name: \"updatedAt\",\n title: t(`common.date.update`),\n }),\n };\n\n const columns = useMemo(() => {\n return params.fields.map((field) => fieldColumnMap[field]?.()).filter((col) => col !== undefined) as ColumnDef<\n TableContent<DocumentInterface>\n >[];\n }, [params.fields, fieldColumnMap, t, generateUrl]);\n\n return useMemo(() => ({ data: tableData, columns: columns }), [tableData, columns]);\n};\n\nregisterTableGenerator(KnowledgeModules.Document, useDocumentTableStructure);\n","\"use client\";\n\nimport DocumentEditor from \"../forms/DocumentEditor\";\nimport { DocumentFields } from \"../../data/DocumentFields\";\nimport { DocumentInterface } from \"../../data/DocumentInterface\";\nimport { DocumentService } from \"../../data/DocumentService\";\nimport \"../../hooks/useDocumentTableStructure\";\nimport type { CommunityOfExpertiseInterface } from \"../../../../expertise/community-of-expertise/data/CommunityOfExpertiseInterface\";\nimport type { TaxonomyInterface } from \"../../../../expertise/taxonomy/data/TaxonomyInterface\";\nimport { ContentListTable } from \"@carlonicora/nextjs-jsonapi/components\";\nimport { DataListRetriever, useDataListRetriever } from \"@carlonicora/nextjs-jsonapi/client\";\nimport { useTranslations } from \"next-intl\";\nimport { ReactNode } from \"react\";\nimport { KnowledgeModules } from \"../../../../knowledge.registry\";\n\n// The parent props are hand-added: the generated container renders this list inside a\n// relation tab (`containerTabs.relations`), and the generator does not emit the props\n// that tab passes. Shape copied from ~/Development/wyrdli ClueList.\ntype DocumentListProps = {\n fullWidth?: boolean;\n communityOfExpertise?: CommunityOfExpertiseInterface;\n taxonomy?: TaxonomyInterface;\n};\n\nexport default function DocumentList({ fullWidth, communityOfExpertise, taxonomy }: DocumentListProps) {\n const t = useTranslations();\n\n const data: DataListRetriever<DocumentInterface> = useDataListRetriever({\n module: KnowledgeModules.Document,\n retriever: (params: any) => {\n if (communityOfExpertise)\n return DocumentService.findManyByCommunityOfExpertise({\n ...params,\n communityOfExpertiseId: communityOfExpertise.id,\n });\n if (taxonomy) return DocumentService.findManyByTaxonomy({ ...params, taxonomyId: taxonomy.id });\n return DocumentService.findMany(params);\n },\n retrieverParams: {},\n });\n\n const functions: ReactNode[] = [<DocumentEditor key=\"create-document\" />];\n\n return (\n <ContentListTable\n data={data}\n fields={[\n DocumentFields.name,\n DocumentFields.author,\n DocumentFields.status,\n DocumentFields.communityOfExpertise,\n DocumentFields.updatedAt,\n ]}\n tableGeneratorType={KnowledgeModules.Document}\n functions={functions}\n title={t(`entities.documents`, { count: 2 })}\n fullWidth={fullWidth}\n />\n );\n}\n","\"use client\";\n\nimport DocumentList from \"../lists/DocumentList\";\nimport { RoundPageContainer } from \"@carlonicora/nextjs-jsonapi/components\";\nimport { KnowledgeModules } from \"../../../../knowledge.registry\";\n\nfunction DocumentListContainerInternal() {\n return (\n <RoundPageContainer module={KnowledgeModules.Document} fullWidth>\n <DocumentList fullWidth />\n </RoundPageContainer>\n );\n}\n\nexport default function DocumentListContainer() {\n return <DocumentListContainerInternal />;\n}\n","\"use client\";\n\nimport { resolveField } from \"../../../../common/i18n/translationResolver\";\nimport { useContentLanguage } from \"../../../../common/hooks/useContentLanguage\";\nimport { TaxonomyInterface } from \"../../data/TaxonomyInterface\";\nimport { usePageUrlGenerator } from \"@carlonicora/nextjs-jsonapi/client\";\nimport { Badge, Link } from \"@carlonicora/nextjs-jsonapi/components\";\nimport { KnowledgeModules } from \"../../../../knowledge.registry\";\n\ntype TaxonomyBadgeProps = {\n taxonomy: TaxonomyInterface;\n};\n\n/**\n * Ported from the earlier codebase's .../TaxonomyBadge.tsx.\n *\n * The backup's `LeafTaxonomy` projection does not exist in this rebuild, so the\n * \"parent - child\" label is built from the taxonomy's own `parent`.\n */\nexport function TaxonomyBadge({ taxonomy }: TaxonomyBadgeProps) {\n const generateUrl = usePageUrlGenerator();\n const language = useContentLanguage();\n\n const name = resolveField({ original: taxonomy.name, translation: taxonomy.translation, field: \"name\", language });\n const parentName = taxonomy.parent\n ? resolveField({\n original: taxonomy.parent.name,\n translation: taxonomy.parent.translation,\n field: \"name\",\n language,\n })\n : undefined;\n\n const badge = <Badge variant=\"secondary\">{parentName ? `${parentName} - ${name}` : name}</Badge>;\n\n return KnowledgeModules.Taxonomy.pageUrl ? (\n <Link href={generateUrl({ page: KnowledgeModules.Taxonomy, id: taxonomy.id })} data-testid=\"taxonomy-badge\">\n {badge}\n </Link>\n ) : (\n <span data-testid=\"taxonomy-badge\">{badge}</span>\n );\n}\n","\"use client\";\n\nimport { TaxonomyBadge } from \"../details/TaxonomyBadge\";\nimport { TaxonomyInterface } from \"../../data/TaxonomyInterface\";\n\ntype TaxonomyBadgesListProps = {\n taxonomies: TaxonomyInterface[];\n};\n\n/** Ported verbatim from the earlier codebase's .../TaxonomyBadgesList.tsx. */\nexport function TaxonomyBadgesList({ taxonomies }: TaxonomyBadgesListProps) {\n return (\n <div className=\"flex w-full flex-wrap gap-2\">\n {taxonomies.map((taxonomy) => (\n <TaxonomyBadge taxonomy={taxonomy} key={taxonomy.id} />\n ))}\n </div>\n );\n}\n","\"use client\";\n\nimport { resolveField, resolveScalar } from \"../../../../common/i18n/translationResolver\";\nimport { useContentLanguage } from \"../../../../common/hooks/useContentLanguage\";\nimport { resolveBlockNoteTranslation } from \"../../../common/utils/translationMaps\";\nimport { DocumentInterface } from \"../../data/DocumentInterface\";\nimport { TaxonomyBadgesList } from \"../../../../expertise/taxonomy/components/lists/TaxonomyBadgesList\";\nimport { AttributeElement, BlockNoteEditorContainer, Card, MicroLabel } from \"@carlonicora/nextjs-jsonapi/components\";\nimport { useTranslations } from \"next-intl\";\n\ntype DocumentContentProps = { document: DocumentInterface };\n\nexport function DocumentContent({ document }: DocumentContentProps) {\n const t = useTranslations();\n const language = useContentLanguage();\n\n // C9: the stored maps win over the original text whenever the reader's language has an entry.\n const name = resolveField({ original: document.name, translation: document.translation, field: \"name\", language });\n const abstract = resolveBlockNoteTranslation({\n original: document.abstract,\n translation: document.abstractTranslation,\n language,\n });\n const tldr = resolveScalar({ original: document.tldr, translation: document.tldrTranslation, language });\n\n return (\n <div className=\"flex flex-col gap-y-8\">\n <div className=\"flex flex-col gap-y-3\">\n <MicroLabel as=\"h3\">{t(`features.document.fields.abstract.label`)}</MicroLabel>\n <Card className=\"flex w-full flex-col p-4\">\n <BlockNoteEditorContainer id={`document-abstract-${document.id}`} type=\"document\" initialContent={abstract} />\n </Card>\n </div>\n <div className=\"flex flex-col gap-y-3\">\n <MicroLabel as=\"h3\">{t(`features.document.sections.details`)}</MicroLabel>\n <div className=\"grid grid-cols-1 gap-4 md:grid-cols-3\">\n {name !== document.name && <AttributeElement title={t(`features.document.fields.name.label`)} value={name} />}\n {tldr && <AttributeElement title={t(`features.document.fields.tldr.label`)} value={tldr} />}\n <AttributeElement title={t(`features.document.fields.aiStatus.label`)} value={document.aiStatus} />\n <AttributeElement\n title={t(`features.document.fields.language.label`)}\n value={document.language ? t(`common.languages.${document.language}`) : \"\"}\n />\n <AttributeElement\n title={t(`features.document.fields.status.label`)}\n value={document.status ? t(`features.content.status.${document.status}`) : \"\"}\n />\n {document.communityOfExpertise && (\n <AttributeElement\n title={t(`features.document.relationships.communityofexpertise.label`)}\n value={document.communityOfExpertise.name}\n />\n )}\n {document.taxonomies && document.taxonomies.length > 0 && (\n <div className=\"flex flex-col gap-y-1\">\n <span className=\"text-muted-foreground text-xs\">{t(`entities.taxonomies`, { count: 2 })}</span>\n {/* Spec §8.3 lists TaxonomyBadge/TaxonomyBadgesList as the way a\n content item shows its tags, and §9.2 TAX-04 asserts the badges\n on a document. A comma-joined string was neither linked nor\n translated through `resolveField`; the badge is both. */}\n <TaxonomyBadgesList taxonomies={document.taxonomies} />\n </div>\n )}\n {document.editors && document.editors.length > 0 && (\n <AttributeElement\n title={t(`entities.users`, { count: 2 })}\n value={document.editors.map((item) => item.name).join(\", \")}\n />\n )}\n </div>\n </div>\n </div>\n );\n}\n","\"use client\";\n\nimport { DocumentInterface } from \"../../data/DocumentInterface\";\nimport { Button, errorToast } from \"@carlonicora/nextjs-jsonapi/components\";\nimport { S3Interface, S3Service } from \"@carlonicora/nextjs-jsonapi/core\";\nimport { DownloadIcon } from \"lucide-react\";\nimport { useTranslations } from \"next-intl\";\nimport { useState } from \"react\";\n\ntype DocumentDownloaderProps = {\n document: DocumentInterface;\n};\n\n/**\n * `url` holds the S3 object key, not a public address, so the link is signed on demand\n * (spec §7) and opened in a new tab.\n */\nexport default function DocumentDownloader({ document }: DocumentDownloaderProps) {\n const t = useTranslations();\n const [isLoading, setIsLoading] = useState<boolean>(false);\n\n const download = async () => {\n setIsLoading(true);\n try {\n const s3: S3Interface = await S3Service.getSignedUrl({ key: document.url });\n window.open(s3.url, \"_blank\", \"noopener,noreferrer\");\n } catch (error) {\n errorToast({ title: t(`features.document.errors.download`), error });\n } finally {\n setIsLoading(false);\n }\n };\n\n if (!document.url) return null;\n\n return (\n <Button\n size=\"sm\"\n variant=\"ghost\"\n className=\"text-muted-foreground\"\n disabled={isLoading}\n data-testid=\"document-download\"\n onClick={download}\n >\n <DownloadIcon />\n {t(`features.document.actions.download`)}\n </Button>\n );\n}\n","\"use client\";\n\nimport ContentStatusBar from \"../../../common/components/ContentStatusBar\";\nimport { DocumentContent } from \"../details/DocumentContent\";\nimport DocumentDownloader from \"../forms/DocumentDownloader\";\nimport { useDocumentContext } from \"../../contexts/DocumentContext\";\nimport { DocumentInterface } from \"../../data/DocumentInterface\";\nimport { DocumentService } from \"../../data/DocumentService\";\nimport TranslationsTab from \"../../../../common/components/translations/TranslationsTab\";\nimport { RoundPageContainer, Tab } from \"@carlonicora/nextjs-jsonapi/components\";\nimport { useCurrentUserContext } from \"@carlonicora/nextjs-jsonapi/contexts\";\nimport { Action } from \"@carlonicora/nextjs-jsonapi/core\";\nimport { useTranslations } from \"next-intl\";\nimport { KnowledgeModules } from \"../../../../knowledge.registry\";\n\ntype DocumentContainerProps = {\n document: DocumentInterface;\n setDocument: (value: DocumentInterface | undefined) => void;\n reloadDocument: () => Promise<void>;\n};\n\nfunction DocumentContainerInternal({ document, setDocument, reloadDocument }: DocumentContainerProps) {\n const t = useTranslations();\n\n const tabs: Tab[] = [\n {\n sectionKey: \"details\",\n label: t(`features.document.sections.details`),\n content: <DocumentContent document={document} />,\n },\n {\n sectionKey: \"translations\",\n label: t(`features.translations.title`),\n content: (\n <div data-testid=\"translations-tab\">\n <TranslationsTab\n entity={document}\n fields={[\"name\", \"abstract\", \"tldr\"]}\n onSave={async (language, fields) => {\n await DocumentService.patchTranslations({ id: document.id, language, fields });\n await reloadDocument();\n }}\n />\n </div>\n ),\n },\n ];\n\n return (\n <RoundPageContainer\n module={KnowledgeModules.Document}\n id={document.id}\n tabs={tabs}\n header={\n <div className=\"flex flex-row items-center gap-x-2\">\n <ContentStatusBar\n status={document.status}\n propose={() => DocumentService.propose({ id: document.id })}\n approve={() => DocumentService.approve({ id: document.id })}\n reject={() => DocumentService.reject({ id: document.id })}\n onChanged={setDocument}\n />\n <DocumentDownloader document={document} />\n </div>\n }\n />\n );\n}\n\nexport default function DocumentContainer() {\n const { hasPermissionToModule } = useCurrentUserContext();\n const { document, setDocument, reloadDocument } = useDocumentContext();\n if (!document) return null;\n if (!hasPermissionToModule({ module: KnowledgeModules.Document, action: Action.Read, data: document })) return null;\n return <DocumentContainerInternal document={document} setDocument={setDocument} reloadDocument={reloadDocument} />;\n}\n","\"use client\";\n\nimport { DocumentInterface } from \"../../data/DocumentInterface\";\nimport { DocumentService } from \"../../data/DocumentService\";\nimport { EntityMultiSelector } from \"@carlonicora/nextjs-jsonapi/components\";\nimport { useTranslations } from \"next-intl\";\nimport { KnowledgeModules } from \"../../../../knowledge.registry\";\n\ntype DocumentMultiSelectorProps = {\n id: string;\n form: any;\n currentDocument?: DocumentInterface;\n label?: string;\n placeholder?: string;\n onChange?: (documents?: DocumentInterface[]) => void;\n maxCount?: number;\n isRequired?: boolean;\n};\n\nexport default function DocumentMultiSelector({\n id,\n form,\n currentDocument,\n label,\n placeholder,\n onChange,\n isRequired = false,\n}: DocumentMultiSelectorProps) {\n const t = useTranslations();\n\n return (\n <EntityMultiSelector<DocumentInterface>\n id={id}\n form={form}\n label={label}\n placeholder={placeholder || t(\"ui.search.button\")}\n emptyText={t(\"ui.search.no_results_generic\")}\n isRequired={isRequired}\n retriever={(params) => DocumentService.findMany(params)}\n module={KnowledgeModules.Document}\n getLabel={(document) => document.name}\n excludeId={currentDocument?.id}\n onChange={onChange}\n />\n );\n}\n","\"use client\";\n\nimport { DocumentProvider } from \"../../contexts/DocumentContext\";\nimport DocumentListContainer from \"../containers/DocumentListContainer\";\n\nexport function DocumentListScreen() {\n return (\n <DocumentProvider>\n <DocumentListContainer />\n </DocumentProvider>\n );\n}\n","\"use client\";\n\nimport type { JsonApiHydratedDataInterface } from \"@carlonicora/nextjs-jsonapi/core\";\nimport { DocumentProvider } from \"../../contexts/DocumentContext\";\nimport DocumentContainer from \"../containers/DocumentContainer\";\n\nexport function DocumentDetailScreen({ dehydratedDocument }: { dehydratedDocument: JsonApiHydratedDataInterface }) {\n return (\n <DocumentProvider dehydratedDocument={dehydratedDocument}>\n <DocumentContainer />\n </DocumentProvider>\n );\n}\n","\"use client\";\n\nimport { ClusterInterface } from \"../../data/ClusterInterface\";\nimport { ClusterService } from \"../../data/ClusterService\";\nimport { Badge, Button, errorToast } from \"@carlonicora/nextjs-jsonapi/components\";\nimport { useCurrentUserContext } from \"@carlonicora/nextjs-jsonapi/contexts\";\nimport { useTranslations } from \"next-intl\";\nimport { useState } from \"react\";\n\ntype ClusterAccessButtonsProps = {\n cluster: ClusterInterface;\n propagateChanges?: (cluster: ClusterInterface) => void;\n size?: \"small\" | \"default\";\n};\n\n/**\n * Join controls for a cluster.\n *\n * Ported from the earlier codebase's .../CommunityOfExpertiseJoinButtons.tsx:\n * the immediate join became an access REQUEST (spec §5.1), so the two states are\n * \"ask to join\" and \"waiting for a manager\", and leaving is out of scope.\n */\nexport default function ClusterAccessButtons({\n cluster,\n propagateChanges,\n size = \"default\",\n}: ClusterAccessButtonsProps) {\n const t = useTranslations();\n const { currentUser } = useCurrentUserContext();\n const [isLoading, setIsLoading] = useState<boolean>(false);\n // Local state, not a re-read, and declared with the other hooks so the early\n // returns below cannot skip it. `reload()` asks the API for the entity by id,\n // and a user who has just asked to JOIN a cluster/community cannot read it yet\n // — the access predicate refuses with 403. Deriving \"pending\" from that read\n // meant the badge never appeared and a SUCCESSFUL request was reported as a\n // failure (\"Could not request access\"). The request is the source of truth;\n // the re-read is best effort.\n const [isPending, setIsPending] = useState<boolean>(cluster.requesters.some((user) => user.id === currentUser?.id));\n\n if (!currentUser) return null;\n\n const isMember =\n cluster.members.some((user) => user.id === currentUser.id) ||\n cluster.managers.some((user) => user.id === currentUser.id);\n\n if (isMember) return null;\n\n const buttonSize = size === \"small\" ? \"sm\" : \"default\";\n\n const reload = async () => {\n if (!propagateChanges) return;\n // Best effort: a requester cannot read the entity it is asking to join.\n try {\n propagateChanges(await ClusterService.findOne({ id: cluster.id }));\n } catch {\n // ignore — the local state above already reflects the write\n }\n };\n\n const requestAccess = async () => {\n setIsLoading(true);\n try {\n await ClusterService.requestAccess({ id: cluster.id });\n setIsPending(true);\n await reload();\n } catch (error) {\n errorToast({ title: t(`features.cluster.access.request_error`), error });\n } finally {\n setIsLoading(false);\n }\n };\n\n const withdrawRequest = async () => {\n setIsLoading(true);\n try {\n await ClusterService.rejectAccess({ id: cluster.id, userId: currentUser.id });\n setIsPending(false);\n await reload();\n } catch (error) {\n errorToast({ title: t(`features.cluster.access.withdraw_error`), error });\n } finally {\n setIsLoading(false);\n }\n };\n\n if (isPending)\n return (\n <div className=\"flex items-center gap-2\">\n <Badge variant=\"softYellow\" data-testid=\"cluster-request-pending\">\n {t(`features.cluster.access.pending`)}\n </Badge>\n <Button variant=\"ghost\" size={buttonSize} onClick={withdrawRequest} disabled={isLoading}>\n {t(`features.cluster.access.withdraw`)}\n </Button>\n </div>\n );\n\n return (\n <Button\n variant=\"outline\"\n size={buttonSize}\n onClick={requestAccess}\n disabled={isLoading}\n data-testid=\"cluster-request-access\"\n >\n {t(`features.cluster.access.request`)}\n </Button>\n );\n}\n","\"use client\";\n\nimport { ClusterInterface } from \"../../data/ClusterInterface\";\nimport { ClusterService } from \"../../data/ClusterService\";\nimport { CommonDeleter } from \"@carlonicora/nextjs-jsonapi/components\";\nimport { usePageUrlGenerator } from \"@carlonicora/nextjs-jsonapi/client\";\n\nimport { useTranslations } from \"next-intl\";\nimport { KnowledgeModules } from \"../../../../knowledge.registry\";\n\ntype ClusterDeleterProps = {\n cluster: ClusterInterface;\n};\n\nfunction ClusterDeleterInternal({ cluster }: ClusterDeleterProps) {\n const t = useTranslations();\n const generateUrl = usePageUrlGenerator();\n\n if (!cluster) return null;\n\n // Spec §5.5 / CLU-06: the Global cluster cannot be deleted — ClusterService.delete\n // answers 400 (\"The Global cluster cannot be deleted\"). Offering a control whose\n // only outcome is an error toast is a dead end, so the trigger is withheld and the\n // API invariant stays the single source of truth.\n if (cluster.isGlobal) return null;\n\n return (\n <CommonDeleter\n type={`clusters`}\n testId=\"cluster-delete\"\n deleteFunction={() => ClusterService.delete({ clusterId: cluster.id })}\n redirectTo={KnowledgeModules.Cluster.pageUrl ? generateUrl({ page: KnowledgeModules.Cluster }) : undefined}\n />\n );\n}\n\nexport default function ClusterDeleter(props: ClusterDeleterProps) {\n return <ClusterDeleterInternal {...props} />;\n}\n","\"use client\";\n\nimport { ClusterInterface } from \"../../data/ClusterInterface\";\nimport { ClusterService } from \"../../data/ClusterService\";\nimport { EntitySelector } from \"@carlonicora/nextjs-jsonapi/components\";\nimport { useTranslations } from \"next-intl\";\nimport { UseFormReturn } from \"react-hook-form\";\nimport { KnowledgeModules } from \"../../../../knowledge.registry\";\n\ntype ClusterParentSelectorProps = {\n form: UseFormReturn<any>;\n id: string;\n label?: string;\n placeholder?: string;\n /** The cluster being edited: it cannot be its own parent. */\n excludeId?: string;\n onChange?: (cluster?: ClusterInterface) => void;\n};\n\n/**\n * Parent picker restricted to the clusters the current user can reach.\n *\n * `ClusterService.findMany` is already access-filtered server side\n * (`AccessCypher.clusterReadable`), so the restriction the UI adds is only the\n * self-exclusion. Wrapper shape copied verbatim from\n * ~/Development/a360ai/apps/web/src/features/proceedings/document-type/components/forms/DocumentTypeSelector.tsx.\n */\nexport default function ClusterParentSelector({\n form,\n id,\n label,\n placeholder,\n excludeId,\n onChange,\n}: ClusterParentSelectorProps) {\n const t = useTranslations();\n\n return (\n <EntitySelector<ClusterInterface>\n id={id}\n form={form}\n module={KnowledgeModules.Cluster}\n retriever={(params) => ClusterService.findMany(params)}\n filterData={(data) => data.filter((cluster) => cluster.id !== excludeId)}\n label={label}\n placeholder={placeholder ?? t(`features.cluster.relationships.parent.placeholder`)}\n onChange={onChange}\n />\n );\n}\n","\"use client\";\n\nimport { ClusterInput, ClusterInterface } from \"../../data/ClusterInterface\";\nimport { ClusterService } from \"../../data/ClusterService\";\nimport ClusterParentSelector from \"./ClusterParentSelector\";\nimport { useI18nRouter } from \"@carlonicora/nextjs-jsonapi/client\";\nimport { getKnowledgeUiConfig } from \"../../../../config/knowledge.ui.config\";\nimport { EditorSheet, FormBlockNote, FormInput } from \"@carlonicora/nextjs-jsonapi/components\";\nimport { useCurrentUserContext } from \"@carlonicora/nextjs-jsonapi/contexts\";\nimport { Action, entityObjectSchema } from \"@carlonicora/nextjs-jsonapi/core\";\nimport { zodResolver } from \"@hookform/resolvers/zod\";\nimport { useTranslations } from \"next-intl\";\nimport { ReactNode, useCallback, useMemo, useState } from \"react\";\nimport { useForm } from \"react-hook-form\";\nimport { v4 } from \"uuid\";\nimport { z } from \"zod\";\nimport { KnowledgeModules } from \"../../../../knowledge.registry\";\n\ntype ClusterEditorProps = {\n cluster?: ClusterInterface;\n propagateChanges?: (cluster: ClusterInterface) => void;\n trigger?: ReactNode;\n forceShow?: boolean;\n onClose?: () => void;\n dialogOpen?: boolean;\n onDialogOpenChange?: (open: boolean) => void;\n};\n\nfunction ClusterEditorInternal({\n cluster,\n propagateChanges,\n trigger,\n forceShow,\n onClose,\n dialogOpen,\n onDialogOpenChange,\n}: ClusterEditorProps) {\n const router = useI18nRouter();\n const t = useTranslations();\n\n const formSchema = useMemo(\n () =>\n z.object({\n id: z.uuidv4(),\n name: z.string().min(1, {\n message: t(`features.cluster.fields.name.error`),\n }),\n description: z.any(),\n parent: entityObjectSchema.optional(),\n }),\n [t],\n );\n\n const getDefaultValues = useCallback(\n () => ({\n id: cluster?.id || v4(),\n name: cluster?.name || \"\",\n description: cluster?.description || [],\n parent: cluster?.parent ? { id: cluster.parent.id, name: cluster.parent.name } : undefined,\n }),\n [cluster],\n );\n\n const form = useForm<z.infer<typeof formSchema>>({\n resolver: zodResolver(formSchema),\n defaultValues: getDefaultValues(),\n });\n\n // BlockNote reports a mount-time change for an empty editor, which would mark the field dirty and\n // trigger the discard dialog on an untouched form. Emptiness comes from `onEmptyChange`; an empty\n // rich-text field never counts as dirty (pattern: wyrdli ClueEditor / a360ai OpportunityEditor).\n const [isDescriptionEmpty, setIsDescriptionEmpty] = useState<boolean>(\n !cluster?.description || (Array.isArray(cluster.description) && cluster.description.length === 0),\n );\n const { dirtyFields } = form.formState;\n const isFormDirty = useCallback(() => {\n const dirty: Record<string, unknown> = { ...dirtyFields };\n if (dirty.description && isDescriptionEmpty) delete dirty.description;\n return Object.keys(dirty).length > 0;\n }, [dirtyFields, isDescriptionEmpty]);\n\n return (\n <EditorSheet\n form={form}\n entityType={t(`entities.clusters`, { count: 1 })}\n entityName={cluster?.name}\n isEdit={!!cluster}\n module={KnowledgeModules.Cluster}\n propagateChanges={propagateChanges}\n isFormDirty={isFormDirty}\n size=\"md\"\n onSubmit={async (values) => {\n const payload: ClusterInput = {\n id: values.id,\n name: values.name,\n description: values.description,\n parentId: values.parent?.id,\n };\n\n return cluster ? await ClusterService.update(payload) : await ClusterService.create(payload);\n }}\n onRevalidate={getKnowledgeUiConfig().revalidatePaths}\n onNavigate={(url) => router.push(url)}\n onReset={() => {\n setIsDescriptionEmpty(\n !cluster?.description || (Array.isArray(cluster.description) && cluster.description.length === 0),\n );\n return getDefaultValues();\n }}\n onClose={onClose}\n trigger={trigger}\n forceShow={forceShow}\n dialogOpen={dialogOpen}\n onDialogOpenChange={onDialogOpenChange}\n >\n <div className=\"flex w-full flex-col gap-y-4\">\n <FormInput\n form={form}\n id=\"name\"\n name={t(`features.cluster.fields.name.label`)}\n placeholder={t(`features.cluster.fields.name.placeholder`)}\n isRequired\n />\n <FormBlockNote\n form={form}\n id=\"description\"\n name={t(`features.cluster.fields.description.label`)}\n placeholder={t(`features.cluster.fields.description.placeholder`)}\n type=\"cluster\"\n onEmptyChange={setIsDescriptionEmpty}\n />\n <ClusterParentSelector\n id=\"parent\"\n form={form}\n excludeId={cluster?.id}\n label={t(`features.cluster.relationships.parent.label`)}\n placeholder={t(`features.cluster.relationships.parent.placeholder`)}\n />\n </div>\n </EditorSheet>\n );\n}\n\nexport default function ClusterEditor(props: ClusterEditorProps) {\n const { hasPermissionToModule } = useCurrentUserContext();\n const action = props.cluster ? Action.Update : Action.Create;\n\n if (!hasPermissionToModule({ module: KnowledgeModules.Cluster, action, data: props.cluster })) return null;\n\n return <ClusterEditorInternal {...props} />;\n}\n","\"use client\";\n\nimport ClusterAccessButtons from \"../components/forms/ClusterAccessButtons\";\nimport ClusterDeleter from \"../components/forms/ClusterDeleter\";\nimport ClusterEditor from \"../components/forms/ClusterEditor\";\nimport { useContentLanguage } from \"../../../common/hooks/useContentLanguage\";\nimport { resolveField } from \"../../../common/i18n/translationResolver\";\nimport { ClusterInterface } from \"../data/ClusterInterface\";\nimport { ClusterService } from \"../data/ClusterService\";\nimport { SharedProvider } from \"@carlonicora/nextjs-jsonapi/contexts\";\nimport { usePageUrlGenerator } from \"@carlonicora/nextjs-jsonapi/client\";\nimport { BreadcrumbItemData } from \"@carlonicora/nextjs-jsonapi/core\";\n\nimport { JsonApiHydratedDataInterface, rehydrate } from \"@carlonicora/nextjs-jsonapi/core\";\nimport { useTranslations } from \"next-intl\";\nimport { createContext, ReactNode, useContext, useState } from \"react\";\nimport { KnowledgeModules } from \"../../../knowledge.registry\";\n\ninterface ClusterContextType {\n cluster: ClusterInterface | undefined;\n setCluster: (value: ClusterInterface | undefined) => void;\n reloadCluster: () => Promise<void>;\n}\n\nconst ClusterContext = createContext<ClusterContextType | undefined>(undefined);\n\ntype ClusterProviderProps = {\n children: ReactNode;\n dehydratedCluster?: JsonApiHydratedDataInterface;\n};\n\nexport const ClusterProvider = ({ children, dehydratedCluster }: ClusterProviderProps) => {\n const generateUrl = usePageUrlGenerator();\n const t = useTranslations();\n const language = useContentLanguage();\n\n const [cluster, setCluster] = useState<ClusterInterface | undefined>(\n dehydratedCluster ? rehydrate<ClusterInterface>(KnowledgeModules.Cluster, dehydratedCluster) : undefined,\n );\n\n const reloadCluster = async () => {\n if (!cluster) return;\n\n const freshCluster = await ClusterService.findOne({ id: cluster.id });\n setCluster(freshCluster);\n };\n\n const breadcrumb = () => {\n const response: BreadcrumbItemData[] = [];\n\n response.push({\n name: t(`entities.clusters`, { count: 2 }),\n href: KnowledgeModules.Cluster.pageUrl ? generateUrl({ page: KnowledgeModules.Cluster }) : undefined,\n });\n\n if (cluster)\n response.push({\n name: cluster.name,\n href: KnowledgeModules.Cluster.pageUrl\n ? generateUrl({ page: KnowledgeModules.Cluster, id: cluster.id })\n : undefined,\n });\n\n return response;\n };\n\n const title = () => {\n const response: any = {\n type: t(`entities.clusters`, { count: cluster ? 1 : 2 }),\n };\n\n const functions: ReactNode[] = [];\n\n if (cluster) {\n // The hero title resolves the stored translation for the reader's language,\n // the same way the list cells and the details body do (C9).\n response.element = resolveField({\n original: cluster.name,\n translation: cluster.translation,\n field: \"name\",\n language,\n });\n\n // Join controls live in the page header so they are reachable from every tab.\n functions.push(\n <ClusterAccessButtons\n key={`ClusterAccessButtons`}\n cluster={cluster}\n propagateChanges={setCluster}\n size=\"small\"\n />,\n );\n functions.push(<ClusterDeleter key={`ClusterDeleter`} cluster={cluster} />);\n functions.push(<ClusterEditor key={`ClusterEditor`} cluster={cluster} propagateChanges={setCluster} />);\n } else {\n functions.push(<ClusterEditor key={`ClusterEditor`} />);\n }\n\n if (functions.length > 0) response.functions = functions;\n\n return response;\n };\n\n return (\n <SharedProvider value={{ breadcrumbs: breadcrumb(), title: title() }}>\n <ClusterContext.Provider\n value={{\n cluster: cluster,\n setCluster: setCluster,\n reloadCluster: reloadCluster,\n }}\n >\n {children}\n </ClusterContext.Provider>\n </SharedProvider>\n );\n};\n\nexport const useClusterContext = (): ClusterContextType => {\n const context = useContext(ClusterContext);\n if (context === undefined) {\n throw new Error(\"useClusterContext must be used within a ClusterProvider\");\n }\n return context;\n};\n","\"use client\";\n\nimport { ClusterFields } from \"../data/ClusterFields\";\nimport { ClusterInterface } from \"../data/ClusterInterface\";\nimport { cellDate, cellId } from \"@carlonicora/nextjs-jsonapi/components\";\nimport {\n registerTableGenerator,\n TableContent,\n usePageUrlGenerator,\n UseTableStructureHook,\n} from \"@carlonicora/nextjs-jsonapi/client\";\nimport { Link, Tooltip, TooltipContent, TooltipTrigger } from \"@carlonicora/nextjs-jsonapi/components\";\nimport { resolveField } from \"../../../common/i18n/translationResolver\";\nimport { useContentLanguage } from \"../../../common/hooks/useContentLanguage\";\nimport { ColumnDef } from \"@tanstack/react-table\";\nimport { useTranslations } from \"next-intl\";\nimport { useMemo } from \"react\";\nimport { KnowledgeModules } from \"../../../knowledge.registry\";\n\nexport const useClusterTableStructure: UseTableStructureHook<ClusterInterface, ClusterFields> = (params) => {\n const t = useTranslations();\n const generateUrl = usePageUrlGenerator();\n const language = useContentLanguage();\n\n const tableData = useMemo(() => {\n return params.data.map((cluster: ClusterInterface) => {\n const entry: TableContent<ClusterInterface> = {\n jsonApiData: cluster,\n };\n entry[ClusterFields.clusterId] = cluster.id;\n params.fields.forEach((field) => {\n entry[field] = cluster[field as keyof ClusterInterface];\n });\n return entry;\n });\n }, [params.data, params.fields]);\n\n const fieldColumnMap: Partial<Record<ClusterFields, () => any>> = {\n [ClusterFields.clusterId]: () =>\n cellId({\n name: \"clusterId\",\n checkedIds: params.checkedIds,\n toggleId: params.toggleId,\n }),\n [ClusterFields.name]: () => ({\n id: \"name\",\n accessorKey: \"name\",\n header: t(`features.cluster.fields.name.label`),\n cell: ({ row }: { row: TableContent<ClusterInterface> }) => {\n const cluster: ClusterInterface = row.original.jsonApiData;\n // Stored translations win over the original text for the reader's language (C9).\n const name = resolveField({\n original: cluster.name,\n translation: cluster.translation,\n field: \"name\",\n language,\n });\n return (\n <Tooltip>\n <TooltipTrigger>\n {KnowledgeModules.Cluster.pageUrl ? (\n <Link href={generateUrl({ page: KnowledgeModules.Cluster, id: cluster.id })}>{name}</Link>\n ) : (\n <span>{name}</span>\n )}\n </TooltipTrigger>\n <TooltipContent>{name}</TooltipContent>\n </Tooltip>\n );\n },\n enableSorting: false,\n enableHiding: false,\n }),\n [ClusterFields.isGlobal]: () => ({\n id: \"isGlobal\",\n accessorKey: \"isGlobal\",\n header: t(`features.cluster.fields.isGlobal.label`),\n cell: ({ row }: { row: TableContent<ClusterInterface> }) => {\n const cluster: ClusterInterface = row.original.jsonApiData;\n return <span>{cluster.isGlobal ? t(`generic.yes`) : t(`generic.no`)}</span>;\n },\n enableSorting: false,\n enableHiding: false,\n }),\n [ClusterFields.parent]: () => ({\n id: \"parent\",\n accessorKey: \"parent\",\n header: t(`features.cluster.relationships.parent.label`),\n cell: ({ row }: { row: TableContent<ClusterInterface> }) => {\n const cluster: ClusterInterface = row.original.jsonApiData;\n return <span>{cluster.parent?.name ?? \"\"}</span>;\n },\n enableSorting: false,\n enableHiding: false,\n }),\n // Row actions supplied by the caller through ContentListTable's `context`\n // (the directory list renders the request-access button here).\n [ClusterFields.actions]: () => ({\n id: \"actions\",\n accessorKey: \"actions\",\n header: \"\",\n cell: ({ row }: { row: TableContent<ClusterInterface> }) => (\n <div className=\"flex justify-end\">{params.context?.renderActions?.(row.original.jsonApiData)}</div>\n ),\n enableSorting: false,\n enableHiding: false,\n }),\n [ClusterFields.createdAt]: () =>\n cellDate({\n name: \"createdAt\",\n title: t(`common.date.create`),\n }),\n [ClusterFields.updatedAt]: () =>\n cellDate({\n name: \"updatedAt\",\n title: t(`common.date.update`),\n }),\n };\n\n const columns = useMemo(() => {\n return params.fields.map((field) => fieldColumnMap[field]?.()).filter((col) => col !== undefined) as ColumnDef<\n TableContent<ClusterInterface>\n >[];\n }, [params.fields, fieldColumnMap, t, generateUrl, language]);\n\n return useMemo(() => ({ data: tableData, columns: columns }), [tableData, columns]);\n};\n\nregisterTableGenerator(KnowledgeModules.Cluster, useClusterTableStructure);\n","\"use client\";\n\nimport ClusterEditor from \"../forms/ClusterEditor\";\nimport { ClusterFields } from \"../../data/ClusterFields\";\nimport { ClusterInterface } from \"../../data/ClusterInterface\";\nimport { ClusterService } from \"../../data/ClusterService\";\nimport \"../../hooks/useClusterTableStructure\";\nimport { ContentListTable } from \"@carlonicora/nextjs-jsonapi/components\";\nimport { DataListRetriever, useDataListRetriever } from \"@carlonicora/nextjs-jsonapi/client\";\nimport { useTranslations } from \"next-intl\";\nimport { ReactNode } from \"react\";\nimport { KnowledgeModules } from \"../../../../knowledge.registry\";\n\n// The parent props are hand-added: the generated container renders this list inside a\n// relation tab (`containerTabs.relations`), and the generator does not emit the props\n// that tab passes. Shape copied from ~/Development/wyrdli ClueList.\ntype ClusterListProps = {\n fullWidth?: boolean;\n parent?: ClusterInterface;\n};\n\nexport default function ClusterList({ fullWidth, parent }: ClusterListProps) {\n const t = useTranslations();\n\n const data: DataListRetriever<ClusterInterface> = useDataListRetriever({\n module: KnowledgeModules.Cluster,\n retriever: (params: any) => {\n if (parent) return ClusterService.findManyByParent({ ...params, parentId: parent.id });\n return ClusterService.findMany(params);\n },\n retrieverParams: {},\n });\n\n const functions: ReactNode[] = [<ClusterEditor key=\"create-cluster\" />];\n\n return (\n <ContentListTable\n data={data}\n fields={[ClusterFields.name, ClusterFields.parent, ClusterFields.updatedAt]}\n tableGeneratorType={KnowledgeModules.Cluster}\n functions={functions}\n title={t(`entities.clusters`, { count: 2 })}\n fullWidth={fullWidth}\n />\n );\n}\n","\"use client\";\n\nimport \"../../hooks/useClusterTableStructure\";\n\nimport ClusterAccessButtons from \"../forms/ClusterAccessButtons\";\nimport ClusterList from \"../lists/ClusterList\";\nimport { ClusterFields } from \"../../data/ClusterFields\";\nimport { ClusterInterface } from \"../../data/ClusterInterface\";\nimport { ClusterService } from \"../../data/ClusterService\";\nimport { DataListRetriever, useDataListRetriever } from \"@carlonicora/nextjs-jsonapi/client\";\nimport { ContentListTable } from \"@carlonicora/nextjs-jsonapi/components\";\nimport { useCurrentUserContext } from \"@carlonicora/nextjs-jsonapi/contexts\";\nimport { getRoleId } from \"@carlonicora/nextjs-jsonapi\";\nimport { useTranslations } from \"next-intl\";\nimport { KnowledgeModules } from \"../../../../knowledge.registry\";\n\n/**\n * Every cluster in the company, access filter off (`GET clusters/directory`),\n * so a user can find and ask to join the ones they cannot see yet.\n */\nfunction ClusterDirectoryList() {\n const t = useTranslations();\n\n const data: DataListRetriever<ClusterInterface> = useDataListRetriever({\n module: KnowledgeModules.Cluster,\n retriever: (params: any) => ClusterService.findDirectory(params),\n retrieverParams: {},\n });\n\n const context = {\n renderActions: (cluster: ClusterInterface) => (\n <ClusterAccessButtons\n cluster={cluster}\n size=\"small\"\n propagateChanges={(updated) => data.setRefreshedElement(updated)}\n />\n ),\n };\n\n return (\n <ContentListTable\n data={data}\n fields={[ClusterFields.name, ClusterFields.parent, ClusterFields.actions]}\n tableGeneratorType={KnowledgeModules.Cluster}\n title={t(`features.cluster.sections.directory`)}\n allowSearch\n context={context}\n />\n );\n}\n\n/**\n * The cluster lists, without page chrome.\n *\n * Mounted once: as the settings rail's Clusters section (tab *content*, a\n * descendant of the rail's shared header). It therefore renders no\n * RoundPageContainer and no title of its own — inside the rail that would nest a\n * second header, breadcrumb bar and title row on top of the settings pane's own.\n *\n * Neither list is `fullWidth`: a settings pane shows the bordered, rounded table\n * card, the way the Employees pane does (the package's `AllUsersListContainer`\n * renders `CompanyUsersList` with no `fullWidth`). A full-bleed table belongs to\n * a page of its own, which this no longer is.\n */\nfunction ClusterListContainerInternal() {\n const { hasRole } = useCurrentUserContext();\n\n // An administrator already sees every cluster in the main list.\n const showDirectory = !hasRole(getRoleId().Administrator) && !hasRole(getRoleId().CompanyAdministrator);\n\n return (\n <div className=\"flex w-full flex-col gap-y-8\">\n <ClusterList />\n {showDirectory && <ClusterDirectoryList />}\n </div>\n );\n}\n\nexport default function ClusterListContainer() {\n return <ClusterListContainerInternal />;\n}\n","import { resolveField, TranslationMap } from \"../../../common/i18n/translationResolver\";\n\n/**\n * Resolves a rich-text field through the stored translations. The model has\n * already parsed translated BlockNote values to blocks, so this is a plain\n * lookup: a translated blocks array wins, anything else falls back to the\n * original blocks.\n */\nexport function resolveBlockNoteField(params: {\n original: any;\n translation: TranslationMap | undefined;\n field: string;\n language: string | undefined;\n}): any {\n const value = resolveField(params);\n return Array.isArray(value) && value.length > 0 ? value : params.original;\n}\n","\"use client\";\n\nimport { resolveField } from \"../../../../common/i18n/translationResolver\";\nimport { resolveBlockNoteField } from \"../../../common/i18n/resolveBlockNoteField\";\nimport { useContentLanguage } from \"../../../../common/hooks/useContentLanguage\";\nimport { ClusterInterface } from \"../../data/ClusterInterface\";\nimport { AttributeElement, BlockNoteEditorContainer, Card, MicroLabel } from \"@carlonicora/nextjs-jsonapi/components\";\nimport { useTranslations } from \"next-intl\";\n\ntype ClusterContentProps = { cluster: ClusterInterface };\n\nexport function ClusterContent({ cluster }: ClusterContentProps) {\n const t = useTranslations();\n const language = useContentLanguage();\n\n // Stored translations win over the original text for the reader's language (C9).\n const description = resolveBlockNoteField({\n original: cluster.description,\n translation: cluster.translation,\n field: \"description\",\n language,\n });\n\n return (\n <div className=\"flex flex-col gap-y-8\">\n <div className=\"flex flex-col gap-y-3\">\n <MicroLabel>{t(`features.cluster.fields.description.label`)}</MicroLabel>\n <Card className=\"flex w-full flex-col p-4\">\n <BlockNoteEditorContainer id={cluster.id} type=\"cluster\" initialContent={description} />\n </Card>\n </div>\n <div className=\"flex flex-col gap-y-3\">\n <MicroLabel>{t(`features.cluster.sections.details`)}</MicroLabel>\n <div className=\"grid grid-cols-1 gap-4 md:grid-cols-3\">\n <AttributeElement\n title={t(`features.cluster.fields.isGlobal.label`)}\n value={cluster.isGlobal ? t(`generic.yes`) : t(`generic.no`)}\n />\n {cluster.parent && (\n <AttributeElement\n title={t(`features.cluster.relationships.parent.label`)}\n value={resolveField({\n original: cluster.parent.name,\n translation: cluster.parent.translation,\n field: \"name\",\n language,\n })}\n />\n )}\n </div>\n </div>\n </div>\n );\n}\n","\"use client\";\n\nimport {\n registerTableGenerator,\n TableContent,\n usePageUrlGenerator,\n UseTableStructureHook,\n} from \"@carlonicora/nextjs-jsonapi/client\";\nimport { Link, UserAvatar } from \"@carlonicora/nextjs-jsonapi/components\";\nimport { ModuleWithPermissions, Modules, UserInterface } from \"@carlonicora/nextjs-jsonapi/core\";\nimport { ColumnDef, Row } from \"@tanstack/react-table\";\nimport { useTranslations } from \"next-intl\";\nimport { ReactNode, useMemo } from \"react\";\n\n/**\n * Column set for the people tables of the expertise domain (cluster members and\n * managers, community members, pending access requests, skill holders).\n *\n * The framework already registers a `users` generator, and Task 10 owns the\n * app-side user feature, so this generator is registered under its OWN name\n * rather than overriding `Modules.User` — otherwise two tasks would fight over\n * the same registry slot. Shape copied verbatim from\n * ~/Development/neural-erp/apps/web/src/features/hr/extended-user/hooks/useUserTableStructure.tsx,\n * with the edge-property column (`meta`) and the row actions driven by\n * `ContentListTable`'s `context`.\n */\nexport enum ExpertiseUserFields {\n userId = \"userId\",\n name = \"name\",\n email = \"email\",\n meta = \"meta\",\n actions = \"actions\",\n}\n\nexport type ExpertiseUserTableContext = {\n /** Header of the edge-property column (community role, skill proficiency). */\n metaHeader?: string;\n /** Cell for the edge-property column. */\n renderMeta?: (user: UserInterface) => ReactNode;\n /** Row actions (approve / reject / remove). */\n renderActions?: (user: UserInterface) => ReactNode;\n};\n\n/**\n * `ContentListTable` only reads `name` and `icon` off `tableGeneratorType`, so a\n * bare descriptor is enough to address this generator without touching the\n * module registry.\n */\nexport const ExpertiseUsersTable = { name: \"expertise-users\" } as unknown as ModuleWithPermissions;\n\nexport const useExpertiseUserTableStructure: UseTableStructureHook<UserInterface, ExpertiseUserFields> = (params) => {\n const t = useTranslations();\n const generateUrl = usePageUrlGenerator();\n\n const tableData = useMemo(() => {\n return params.data.map((user: UserInterface) => {\n const entry: TableContent<UserInterface> = { jsonApiData: user };\n entry[ExpertiseUserFields.userId] = user.id;\n params.fields.forEach((field) => {\n entry[field] = user[field as keyof UserInterface];\n });\n return entry;\n });\n }, [params.data, params.fields]);\n\n const context = (params.context ?? {}) as ExpertiseUserTableContext;\n\n const fieldColumnMap: Partial<Record<ExpertiseUserFields, () => any>> = {\n [ExpertiseUserFields.name]: () => ({\n id: \"name\",\n accessorKey: \"name\",\n header: t(`user.fields.name.label`),\n cell: ({ row }: { row: Row<TableContent<UserInterface>> }) => {\n const user = row.original.jsonApiData as UserInterface;\n return (\n <Link href={generateUrl({ page: Modules.User, id: user.id })} className=\"flex items-center gap-2\">\n <UserAvatar user={user} />\n {user.name}\n </Link>\n );\n },\n enableSorting: false,\n enableHiding: false,\n }),\n [ExpertiseUserFields.email]: () => ({\n id: \"email\",\n accessorKey: \"email\",\n header: t(`common.fields.email.label`),\n cell: ({ row }: { row: Row<TableContent<UserInterface>> }) => <>{row.getValue(\"email\")}</>,\n enableSorting: false,\n enableHiding: false,\n }),\n [ExpertiseUserFields.meta]: () => ({\n id: \"meta\",\n accessorKey: \"meta\",\n header: context.metaHeader ?? \"\",\n cell: ({ row }: { row: Row<TableContent<UserInterface>> }) => (\n <>{context.renderMeta?.(row.original.jsonApiData as UserInterface) ?? null}</>\n ),\n enableSorting: false,\n enableHiding: false,\n }),\n [ExpertiseUserFields.actions]: () => ({\n id: \"actions\",\n accessorKey: \"actions\",\n header: \"\",\n cell: ({ row }: { row: Row<TableContent<UserInterface>> }) => (\n <div className=\"flex justify-end gap-2\">\n {context.renderActions?.(row.original.jsonApiData as UserInterface) ?? null}\n </div>\n ),\n enableSorting: false,\n enableHiding: false,\n }),\n };\n\n const columns = useMemo(() => {\n return params.fields.map((field) => fieldColumnMap[field]?.()).filter((col) => col !== undefined) as ColumnDef<\n TableContent<UserInterface>\n >[];\n }, [params.fields, fieldColumnMap, t, generateUrl]);\n\n return useMemo(() => ({ data: tableData, columns: columns }), [tableData, columns]);\n};\n\nregisterTableGenerator(ExpertiseUsersTable, useExpertiseUserTableStructure);\n","\"use client\";\n\nimport { ClusterService } from \"../../data/ClusterService\";\nimport {\n Button,\n Dialog,\n DialogContent,\n DialogFooter,\n DialogHeader,\n DialogTitle,\n EntitySelector,\n errorToast,\n} from \"@carlonicora/nextjs-jsonapi/components\";\nimport { Modules, UserInterface, UserService } from \"@carlonicora/nextjs-jsonapi/core\";\nimport { useTranslations } from \"next-intl\";\nimport { useState } from \"react\";\nimport { useForm } from \"react-hook-form\";\n\ntype AddUserToClusterDialogProps = {\n clusterId: string;\n /** `members` writes PART_OF, `managers` writes MANAGES. */\n variant: \"members\" | \"managers\";\n existingUserIds: string[];\n onSuccess: () => Promise<void> | void;\n};\n\n/**\n * Copy of `AddUserToCommunityDialog` without the role select: cluster\n * membership carries no role. The picker is the package `EntitySelector`.\n */\nexport function AddUserToClusterDialog({\n clusterId,\n variant,\n existingUserIds,\n onSuccess,\n}: AddUserToClusterDialogProps) {\n const t = useTranslations();\n const [open, setOpen] = useState<boolean>(false);\n const [isSaving, setIsSaving] = useState<boolean>(false);\n\n const form = useForm<{ user?: { id: string; name: string } }>({ defaultValues: { user: undefined } });\n\n const label =\n variant === \"managers\" ? t(`features.cluster.access.add_manager`) : t(`features.cluster.access.add_user`);\n\n const submit = async (values: { user?: { id: string; name: string } }) => {\n if (!values.user) return;\n setIsSaving(true);\n try {\n if (variant === \"managers\") await ClusterService.addManager({ id: clusterId, userId: values.user.id });\n else await ClusterService.addMember({ id: clusterId, userId: values.user.id });\n form.reset({ user: undefined });\n setOpen(false);\n await onSuccess();\n } catch (error) {\n errorToast({ title: t(`features.cluster.access.add_user_failed`), error });\n } finally {\n setIsSaving(false);\n }\n };\n\n return (\n <>\n <Button variant=\"outline\" size=\"sm\" onClick={() => setOpen(true)} data-testid={`cluster-add-${variant}`}>\n {label}\n </Button>\n <Dialog open={open} onOpenChange={setOpen}>\n <DialogContent className=\"flex max-w-md flex-col\">\n <DialogHeader>\n <DialogTitle>{label}</DialogTitle>\n </DialogHeader>\n <form onSubmit={form.handleSubmit(submit)} className=\"flex w-full flex-col gap-y-4\">\n <EntitySelector<UserInterface>\n id=\"user\"\n form={form}\n module={Modules.User}\n retriever={(params) => UserService.findMany(params)}\n filterData={(data) => data.filter((user) => !existingUserIds.includes(user.id))}\n label={t(`features.cluster.relationships.user.label`)}\n placeholder={t(`features.cluster.relationships.user.placeholder`)}\n isRequired\n />\n <DialogFooter>\n <Button type=\"button\" variant=\"outline\" onClick={() => setOpen(false)}>\n {t(`ui.buttons.cancel`)}\n </Button>\n <Button type=\"submit\" disabled={isSaving} data-testid={`cluster-add-${variant}-submit`}>\n {t(`ui.buttons.add`)}\n </Button>\n </DialogFooter>\n </form>\n </DialogContent>\n </Dialog>\n </>\n );\n}\n","\"use client\";\n\nimport \"../../../common/hooks/useExpertiseUserTableStructure\";\n\nimport { ExpertiseUserFields, ExpertiseUsersTable } from \"../../../common/hooks/useExpertiseUserTableStructure\";\nimport { AddUserToClusterDialog } from \"../forms/AddUserToClusterDialog\";\nimport { ClusterInterface } from \"../../data/ClusterInterface\";\nimport { ClusterService } from \"../../data/ClusterService\";\nimport { DataListRetriever, useDataListRetriever } from \"@carlonicora/nextjs-jsonapi/client\";\nimport { Button, ContentListTable, errorToast } from \"@carlonicora/nextjs-jsonapi/components\";\nimport { Modules, UserInterface } from \"@carlonicora/nextjs-jsonapi/core\";\nimport { useTranslations } from \"next-intl\";\nimport { ReactNode, useRef, useState } from \"react\";\n\ntype ClusterMembersListProps = {\n cluster: ClusterInterface;\n /** `members` lists PART_OF, `managers` lists MANAGES. */\n variant?: \"members\" | \"managers\";\n propagateChanges?: (cluster: ClusterInterface) => void;\n};\n\n/**\n * People attached to a cluster.\n *\n * There is no `clusters/:id/users` route in C4 — members, managers and\n * requesters arrive as relationships of the cluster itself — so the retriever\n * reads the rows already on the entity and `ClusterService.findOne` refreshes\n * them after a write. Shape copied from\n * ~/Development/neural-erp/.../LabourCategoryUsersList.tsx (context carries the\n * row actions).\n */\nexport default function ClusterMembersList({\n cluster,\n variant = \"members\",\n propagateChanges,\n}: ClusterMembersListProps) {\n const t = useTranslations();\n\n const pick = (value: ClusterInterface) => (variant === \"managers\" ? value.managers : value.members);\n\n const [users, setUsers] = useState<UserInterface[]>(pick(cluster));\n const usersRef = useRef<UserInterface[]>(users);\n\n const data: DataListRetriever<UserInterface> = useDataListRetriever({\n module: Modules.User,\n retriever: async () => usersRef.current,\n retrieverParams: {},\n });\n\n const reload = async () => {\n const fresh = await ClusterService.findOne({ id: cluster.id });\n // The ref is updated before the refresh so the retriever closure reads the\n // new rows without waiting for React to re-render.\n usersRef.current = pick(fresh);\n setUsers(usersRef.current);\n propagateChanges?.(fresh);\n await data.refresh();\n };\n\n const remove = async (user: UserInterface) => {\n try {\n if (variant === \"managers\") await ClusterService.removeManager({ id: cluster.id, userId: user.id });\n else await ClusterService.removeMember({ id: cluster.id, userId: user.id });\n await reload();\n } catch (error) {\n errorToast({ title: t(`features.cluster.access.remove_error`), error });\n }\n };\n\n const context = {\n renderActions: (user: UserInterface) => (\n <Button variant=\"ghost\" size=\"sm\" onClick={() => remove(user)}>\n {t(`ui.buttons.remove`)}\n </Button>\n ),\n };\n\n const functions: ReactNode[] = [\n <AddUserToClusterDialog\n key=\"add-user\"\n clusterId={cluster.id}\n variant={variant}\n existingUserIds={users.map((user) => user.id)}\n onSuccess={reload}\n />,\n ];\n\n return (\n <ContentListTable\n data={data}\n fields={[ExpertiseUserFields.name, ExpertiseUserFields.email, ExpertiseUserFields.actions]}\n tableGeneratorType={ExpertiseUsersTable}\n title={variant === \"managers\" ? t(`features.cluster.sections.managers`) : t(`features.cluster.sections.members`)}\n functions={functions}\n context={context}\n />\n );\n}\n","\"use client\";\n\nimport \"../../../common/hooks/useExpertiseUserTableStructure\";\n\nimport { ExpertiseUserFields, ExpertiseUsersTable } from \"../../../common/hooks/useExpertiseUserTableStructure\";\nimport { ClusterInterface } from \"../../data/ClusterInterface\";\nimport { ClusterService } from \"../../data/ClusterService\";\nimport { DataListRetriever, useDataListRetriever } from \"@carlonicora/nextjs-jsonapi/client\";\nimport { Button, ContentListTable, errorToast } from \"@carlonicora/nextjs-jsonapi/components\";\nimport { Modules, UserInterface } from \"@carlonicora/nextjs-jsonapi/core\";\nimport { useTranslations } from \"next-intl\";\nimport { useRef, useState } from \"react\";\n\ntype ClusterRequestsListProps = {\n cluster: ClusterInterface;\n propagateChanges?: (cluster: ClusterInterface) => void;\n};\n\n/** Pending `REQUESTED_ACCESS_TO` rows for one cluster, with approve / reject (spec §5.1). */\nexport default function ClusterRequestsList({ cluster, propagateChanges }: ClusterRequestsListProps) {\n const t = useTranslations();\n\n const [requesters, setRequesters] = useState<UserInterface[]>(cluster.requesters);\n const requestersRef = useRef<UserInterface[]>(requesters);\n\n const data: DataListRetriever<UserInterface> = useDataListRetriever({\n module: Modules.User,\n retriever: async () => requestersRef.current,\n retrieverParams: {},\n });\n\n const reload = async () => {\n const fresh = await ClusterService.findOne({ id: cluster.id });\n requestersRef.current = fresh.requesters;\n setRequesters(requestersRef.current);\n propagateChanges?.(fresh);\n await data.refresh();\n };\n\n const approve = async (user: UserInterface) => {\n try {\n await ClusterService.approveAccess({ id: cluster.id, userId: user.id });\n await reload();\n } catch (error) {\n errorToast({ title: t(`features.cluster.access.approve_error`), error });\n }\n };\n\n const reject = async (user: UserInterface) => {\n try {\n await ClusterService.rejectAccess({ id: cluster.id, userId: user.id });\n await reload();\n } catch (error) {\n errorToast({ title: t(`features.cluster.access.reject_error`), error });\n }\n };\n\n const context = {\n renderActions: (user: UserInterface) => (\n <>\n <Button variant=\"outline\" size=\"sm\" data-testid=\"access-request-approve\" onClick={() => approve(user)}>\n {t(`features.accessrequest.actions.approve`)}\n </Button>\n <Button variant=\"ghost\" size=\"sm\" data-testid=\"access-request-reject\" onClick={() => reject(user)}>\n {t(`features.accessrequest.actions.reject`)}\n </Button>\n </>\n ),\n };\n\n return (\n <ContentListTable\n data={data}\n fields={[ExpertiseUserFields.name, ExpertiseUserFields.email, ExpertiseUserFields.actions]}\n tableGeneratorType={ExpertiseUsersTable}\n title={t(`features.cluster.sections.requests`)}\n context={context}\n />\n );\n}\n","\"use client\";\n\nimport {\n Command,\n CommandItem,\n CommandList,\n FormFieldWrapper,\n Input,\n Popover,\n PopoverContent,\n PopoverTrigger,\n} from \"@carlonicora/nextjs-jsonapi/components\";\nimport { ClusterInterface } from \"../../data/ClusterInterface\";\nimport { ClusterService } from \"../../data/ClusterService\";\nimport { DataListRetriever, useDataListRetriever, useDebounce } from \"@carlonicora/nextjs-jsonapi/client\";\n\nimport { CircleX, RefreshCwIcon, SearchIcon, XIcon } from \"lucide-react\";\nimport { useTranslations } from \"next-intl\";\nimport { useCallback, useEffect, useRef, useState } from \"react\";\nimport { KnowledgeModules } from \"../../../../knowledge.registry\";\n\ntype ClusterSelectorProps = {\n id: string;\n form: any;\n label?: string;\n placeholder?: string;\n onChange?: (cluster?: ClusterInterface) => void;\n isRequired?: boolean;\n};\n\nexport default function ClusterSelector({\n id,\n form,\n label,\n placeholder,\n onChange,\n isRequired = false,\n}: ClusterSelectorProps) {\n const t = useTranslations();\n\n const [open, setOpen] = useState<boolean>(false);\n\n const searchTermRef = useRef<string>(\"\");\n const [searchTerm, setSearchTerm] = useState<string>(\"\");\n\n const [isSearching, setIsSearching] = useState<boolean>(false);\n\n const data: DataListRetriever<ClusterInterface> = useDataListRetriever({\n retriever: (params) => {\n return ClusterService.findMany(params);\n },\n retrieverParams: {},\n module: KnowledgeModules.Cluster,\n });\n\n const search = useCallback(\n async (searchedTerm: string) => {\n try {\n if (searchedTerm === searchTermRef.current) return;\n setIsSearching(true);\n searchTermRef.current = searchedTerm;\n await data.search(searchedTerm);\n } finally {\n setIsSearching(false);\n }\n },\n [searchTermRef, data],\n );\n\n const updateSearchTerm = useDebounce(search, 500);\n\n useEffect(() => {\n setIsSearching(true);\n updateSearchTerm(searchTerm);\n }, [updateSearchTerm, searchTerm]);\n\n const setCluster = (cluster?: ClusterInterface) => {\n if (onChange) onChange(cluster);\n if (!cluster) {\n form.setValue(id, undefined);\n setOpen(false);\n return;\n }\n\n form.setValue(id, { id: cluster.id, name: cluster.name });\n setOpen(false);\n\n setTimeout(() => {\n setOpen(false);\n }, 0);\n };\n\n return (\n <div className=\"flex w-full flex-col\">\n <FormFieldWrapper form={form} name={id} label={label} isRequired={isRequired}>\n {(field) => (\n <Popover open={open} onOpenChange={setOpen} modal={true}>\n <div className=\"flex w-full flex-row items-center justify-between\">\n <PopoverTrigger className=\"w-full\">\n <div className=\"flex w-full flex-row items-center justify-start rounded-md\">\n {field.value ? (\n <div className=\"bg-input/20 dark:bg-input/30 border-input flex h-7 w-full flex-row items-center justify-start rounded-md border px-2 py-0.5 text-sm md:text-xs/relaxed\">\n <span>{field.value?.name ?? \"\"}</span>\n </div>\n ) : (\n <div className=\"bg-input/20 dark:bg-input/30 border-input text-muted-foreground flex h-7 w-full flex-row items-center justify-start rounded-md border px-2 py-0.5 text-sm md:text-xs/relaxed\">\n {placeholder ?? t(`ui.search.placeholder`, { type: t(`entities.clusters`, { count: 1 }) })}\n </div>\n )}\n </div>\n </PopoverTrigger>\n {field.value && (\n <CircleX\n className=\"text-muted hover:text-destructive ms-2 h-4 w-4 shrink-0 cursor-pointer\"\n onClick={() => setCluster()}\n />\n )}\n </div>\n <PopoverContent align=\"start\" className=\"w-(--anchor-width)\">\n <Command shouldFilter={false}>\n <div className=\"relative mb-2 w-full\">\n <SearchIcon className=\"text-muted-foreground absolute start-2.5 top-2.5 h-4 w-4\" />\n <Input\n placeholder={t(`ui.search.placeholder`, { type: t(`entities.clusters`, { count: 1 }) })}\n type=\"text\"\n className=\"w-full ps-8 pe-8\"\n onChange={(e) => setSearchTerm(e.target.value)}\n value={searchTerm}\n />\n {isSearching ? (\n <RefreshCwIcon className=\"text-muted-foreground absolute end-2.5 top-2.5 h-4 w-4 animate-spin\" />\n ) : searchTermRef.current ? (\n <XIcon\n className={`absolute end-2.5 top-2.5 h-4 w-4 ${searchTermRef.current ? \"cursor-pointer\" : \"text-muted-foreground\"}`}\n onClick={() => {\n setSearchTerm(\"\");\n search(\"\");\n }}\n />\n ) : (\n <></>\n )}\n </div>\n <CommandList>\n {data.data &&\n data.data.length > 0 &&\n (data.data as ClusterInterface[]).map((cluster: ClusterInterface) => (\n <CommandItem\n className=\"hover:bg-muted data-selected:hover:bg-muted cursor-pointer bg-transparent data-selected:bg-transparent\"\n key={cluster.id}\n onSelect={() => setCluster(cluster)}\n >\n <span className=\"\">{cluster.name}</span>\n </CommandItem>\n ))}\n </CommandList>\n </Command>\n </PopoverContent>\n </Popover>\n )}\n </FormFieldWrapper>\n </div>\n );\n}\n","\"use client\";\n\nimport { ClusterService } from \"../../../cluster/data/ClusterService\";\nimport { CommunityOfExpertiseInterface } from \"../../data/CommunityOfExpertiseInterface\";\nimport { CommunityOfExpertiseService } from \"../../data/CommunityOfExpertiseService\";\nimport { EntitySelector } from \"@carlonicora/nextjs-jsonapi/components\";\nimport { useTranslations } from \"next-intl\";\nimport { useEffect, useState } from \"react\";\nimport { UseFormReturn } from \"react-hook-form\";\nimport { KnowledgeModules } from \"../../../../knowledge.registry\";\n\n/** Depth guard: a cluster tree that deep is a data error, not a hierarchy. */\nconst MAX_CHAIN_DEPTH = 20;\n\n/**\n * `CommunityOfExpertise.cluster` is a required getter and THROWS when the\n * relationship was not included in the response, so a list row has to be read\n * defensively.\n */\nfunction clusterIdOf(community: CommunityOfExpertiseInterface): string | undefined {\n try {\n return community.cluster?.id;\n } catch {\n return undefined;\n }\n}\n\ntype CommunityParentSelectorProps = {\n form: UseFormReturn<any>;\n id: string;\n /** Cluster the community sits in; its ancestor chain bounds the valid parents. */\n clusterId?: string;\n /** The community being edited: it cannot be its own parent. */\n excludeId?: string;\n label?: string;\n placeholder?: string;\n onChange?: (communityOfExpertise?: CommunityOfExpertiseInterface) => void;\n};\n\n/**\n * Parent picker for a community of expertise.\n *\n * Spec §5.5: the parent must sit in a cluster on the ancestor chain of the\n * community's own cluster (the same cluster included). The chain is walked with\n * `ClusterService.findOne` up to the Global cluster and the candidate list is\n * filtered client side. Wrapper shape copied verbatim from\n * ~/Development/a360ai/.../DocumentTypeSelector.tsx.\n */\nexport default function CommunityParentSelector({\n form,\n id,\n clusterId,\n excludeId,\n label,\n placeholder,\n onChange,\n}: CommunityParentSelectorProps) {\n const t = useTranslations();\n const [chain, setChain] = useState<string[] | undefined>(undefined);\n\n useEffect(() => {\n let cancelled = false;\n\n const walk = async () => {\n if (!clusterId) {\n setChain(undefined);\n return;\n }\n\n const ids: string[] = [];\n let current: string | undefined = clusterId;\n\n for (let depth = 0; current && depth < MAX_CHAIN_DEPTH; depth++) {\n ids.push(current);\n const cluster = await ClusterService.findOne({ id: current });\n current = cluster?.parent?.id;\n }\n\n if (!cancelled) setChain(ids);\n };\n\n walk();\n\n return () => {\n cancelled = true;\n };\n }, [clusterId]);\n\n return (\n <EntitySelector<CommunityOfExpertiseInterface>\n id={id}\n form={form}\n module={KnowledgeModules.CommunityOfExpertise}\n retriever={(params) => CommunityOfExpertiseService.findMany(params)}\n filterData={(data) =>\n data.filter((community) => {\n if (community.id === excludeId) return false;\n const candidateCluster = clusterIdOf(community);\n // Unknown cluster: leave the row in and let the backend invariant decide.\n if (chain === undefined || candidateCluster === undefined) return true;\n return chain.includes(candidateCluster);\n })\n }\n label={label}\n placeholder={placeholder ?? t(`features.communityofexpertise.relationships.parent.placeholder`)}\n onChange={onChange}\n />\n );\n}\n","\"use client\";\n\nimport { CommunityOfExpertiseInput, CommunityOfExpertiseInterface } from \"../../data/CommunityOfExpertiseInterface\";\nimport { CommunityOfExpertiseService } from \"../../data/CommunityOfExpertiseService\";\nimport ClusterSelector from \"../../../cluster/components/forms/ClusterSelector\";\nimport CommunityParentSelector from \"./CommunityParentSelector\";\nimport { useI18nRouter } from \"@carlonicora/nextjs-jsonapi/client\";\nimport { getKnowledgeUiConfig } from \"../../../../config/knowledge.ui.config\";\nimport {\n DropzoneOptions,\n EditorSheet,\n FileInput,\n FileUploader,\n FormBlockNote,\n FormInput,\n} from \"@carlonicora/nextjs-jsonapi/components\";\nimport { useCurrentUserContext } from \"@carlonicora/nextjs-jsonapi/contexts\";\nimport { Action, entityObjectSchema, S3Service } from \"@carlonicora/nextjs-jsonapi/core\";\nimport { zodResolver } from \"@hookform/resolvers/zod\";\nimport { UploadIcon } from \"lucide-react\";\nimport Image from \"next/image\";\nimport { useTranslations } from \"next-intl\";\nimport { ReactNode, useCallback, useEffect, useMemo, useState } from \"react\";\nimport { useForm } from \"react-hook-form\";\nimport { v4 } from \"uuid\";\nimport { z } from \"zod\";\nimport { KnowledgeModules } from \"../../../../knowledge.registry\";\n\ntype CommunityOfExpertiseEditorProps = {\n communityOfExpertise?: CommunityOfExpertiseInterface;\n propagateChanges?: (communityOfExpertise: CommunityOfExpertiseInterface) => void;\n trigger?: ReactNode;\n forceShow?: boolean;\n onClose?: () => void;\n dialogOpen?: boolean;\n onDialogOpenChange?: (open: boolean) => void;\n};\n\nfunction CommunityOfExpertiseEditorInternal({\n communityOfExpertise,\n propagateChanges,\n trigger,\n forceShow,\n onClose,\n dialogOpen,\n onDialogOpenChange,\n}: CommunityOfExpertiseEditorProps) {\n const router = useI18nRouter();\n const t = useTranslations();\n const { company } = useCurrentUserContext();\n\n // Image upload: the form holds the S3 key; the file goes to S3 through a presigned PUT on\n // submit (pattern: neural-erp EvidenceEditor / backup CommunityOfExpertiseEditor).\n const [file, setFile] = useState<File | null>(null);\n const [files, setFiles] = useState<File[] | null>(null);\n const [contentType, setContentType] = useState<string | null>(null);\n const [previewUrl, setPreviewUrl] = useState<string | null>(null);\n\n const dropzone = {\n multiple: false,\n maxSize: 100 * 1024 * 1024,\n preventDropOnDocument: false,\n accept: {\n \"image/*\": [\".jpg\", \".jpeg\", \".png\", \".gif\", \".webp\"],\n },\n } satisfies DropzoneOptions;\n\n useEffect(() => {\n if (files && files.length > 0) setFile(files[0]);\n }, [files]);\n\n // Object URL lifecycle for the preview.\n useEffect(() => {\n if (!file) {\n setPreviewUrl(null);\n return;\n }\n const url = URL.createObjectURL(file);\n setPreviewUrl(url);\n return () => URL.revokeObjectURL(url);\n }, [file]);\n\n const formSchema = useMemo(\n () =>\n z.object({\n id: z.uuidv4(),\n name: z.string().min(1, {\n message: t(`features.communityofexpertise.fields.name.error`),\n }),\n description: z.any(),\n image: z.string().optional(),\n cluster: entityObjectSchema.refine((data) => data.id && data.id.length > 0, {\n message: t(`features.communityofexpertise.relationships.cluster.error`),\n }),\n parent: entityObjectSchema.optional(),\n }),\n [t],\n );\n\n const getDefaultValues = useCallback(\n () => ({\n id: communityOfExpertise?.id || v4(),\n name: communityOfExpertise?.name || \"\",\n description: communityOfExpertise?.description || [],\n image: communityOfExpertise?.image || \"\",\n cluster: communityOfExpertise?.cluster\n ? { id: communityOfExpertise.cluster.id, name: communityOfExpertise.cluster.name }\n : undefined,\n parent: communityOfExpertise?.parent\n ? { id: communityOfExpertise.parent.id, name: communityOfExpertise.parent.name }\n : undefined,\n }),\n [communityOfExpertise],\n );\n\n const form = useForm<z.infer<typeof formSchema>>({\n resolver: zodResolver(formSchema),\n defaultValues: getDefaultValues(),\n });\n\n // Generate the S3 key when a file is picked; marking the field dirty enables Save.\n useEffect(() => {\n if (file && company) {\n const id = form.getValues(\"id\");\n const extension = file.type.split(\"/\").pop() ?? \"\";\n const timestamp = new Date().toISOString().replace(/[-:T]/g, \"\").split(\".\")[0];\n form.setValue(\"image\", `companies/${company.id}/communities-of-expertise/${id}/${id}.${timestamp}.${extension}`, {\n shouldDirty: true,\n });\n setContentType(file.type);\n } else {\n setContentType(null);\n }\n }, [file, company]);\n\n // BlockNote reports a mount-time change for an empty editor, which would mark the field dirty and\n // trigger the discard dialog on an untouched form. Emptiness comes from `onEmptyChange`; an empty\n // rich-text field never counts as dirty (pattern: wyrdli ClueEditor / a360ai OpportunityEditor).\n const [isDescriptionEmpty, setIsDescriptionEmpty] = useState<boolean>(\n !communityOfExpertise?.description ||\n (Array.isArray(communityOfExpertise.description) && communityOfExpertise.description.length === 0),\n );\n const { dirtyFields } = form.formState;\n const isFormDirty = useCallback(() => {\n const dirty: Record<string, unknown> = { ...dirtyFields };\n if (dirty.description && isDescriptionEmpty) delete dirty.description;\n return Object.keys(dirty).length > 0;\n }, [dirtyFields, isDescriptionEmpty]);\n\n return (\n <EditorSheet\n form={form}\n entityType={t(`entities.communityofexpertises`, { count: 1 })}\n entityName={communityOfExpertise?.name}\n isEdit={!!communityOfExpertise}\n module={KnowledgeModules.CommunityOfExpertise}\n propagateChanges={propagateChanges}\n isFormDirty={isFormDirty}\n size=\"md\"\n onSubmit={async (values) => {\n if (values.image && contentType && file) {\n await S3Service.upload({ key: values.image, contentType, file, isPublic: true });\n }\n\n const payload: CommunityOfExpertiseInput = {\n id: values.id,\n name: values.name,\n description: values.description,\n // The API returns a resolved URL for `image`; only a freshly picked file sends a new key.\n image: file ? values.image : undefined,\n clusterId: values.cluster?.id,\n parentId: values.parent?.id,\n };\n\n return communityOfExpertise\n ? await CommunityOfExpertiseService.update(payload)\n : await CommunityOfExpertiseService.create(payload);\n }}\n onRevalidate={getKnowledgeUiConfig().revalidatePaths}\n onNavigate={(url) => router.push(url)}\n onReset={() => {\n setFile(null);\n setFiles(null);\n setIsDescriptionEmpty(\n !communityOfExpertise?.description ||\n (Array.isArray(communityOfExpertise.description) && communityOfExpertise.description.length === 0),\n );\n return getDefaultValues();\n }}\n onClose={onClose}\n trigger={trigger}\n forceShow={forceShow}\n dialogOpen={dialogOpen}\n onDialogOpenChange={onDialogOpenChange}\n >\n <div className=\"flex w-full flex-col gap-y-4\">\n <FormInput\n form={form}\n id=\"name\"\n name={t(`features.communityofexpertise.fields.name.label`)}\n placeholder={t(`features.communityofexpertise.fields.name.placeholder`)}\n isRequired\n />\n <FormBlockNote\n form={form}\n id=\"description\"\n name={t(`features.communityofexpertise.fields.description.label`)}\n placeholder={t(`features.communityofexpertise.fields.description.placeholder`)}\n type=\"communityOfExpertise\"\n onEmptyChange={setIsDescriptionEmpty}\n />\n <FileUploader\n value={files}\n onValueChange={setFiles}\n dropzoneOptions={dropzone}\n className=\"h-40 w-40 rounded-full p-0\"\n >\n <FileInput className=\"bg-muted text-muted-foreground flex h-full w-full flex-col items-center justify-center\">\n {previewUrl || communityOfExpertise?.image ? (\n <Image\n src={previewUrl ?? communityOfExpertise?.image ?? \"\"}\n alt={t(`features.communityofexpertise.fields.image.label`)}\n width={200}\n height={200}\n className=\"h-full w-full rounded-full object-cover\"\n />\n ) : (\n <UploadIcon className=\"my-4 h-8 w-8\" />\n )}\n </FileInput>\n </FileUploader>\n <ClusterSelector\n id=\"cluster\"\n form={form}\n label={t(`features.communityofexpertise.relationships.cluster.label`)}\n placeholder={t(`features.communityofexpertise.relationships.cluster.placeholder`)}\n isRequired\n />\n <CommunityParentSelector\n id=\"parent\"\n form={form}\n clusterId={form.watch(\"cluster\")?.id}\n excludeId={communityOfExpertise?.id}\n label={t(`features.communityofexpertise.relationships.parent.label`)}\n placeholder={t(`features.communityofexpertise.relationships.parent.placeholder`)}\n />\n </div>\n </EditorSheet>\n );\n}\n\nexport default function CommunityOfExpertiseEditor(props: CommunityOfExpertiseEditorProps) {\n const { hasPermissionToModule } = useCurrentUserContext();\n const action = props.communityOfExpertise ? Action.Update : Action.Create;\n\n if (\n !hasPermissionToModule({ module: KnowledgeModules.CommunityOfExpertise, action, data: props.communityOfExpertise })\n )\n return null;\n\n return <CommunityOfExpertiseEditorInternal {...props} />;\n}\n","\"use client\";\n\nimport { cn } from \"@carlonicora/nextjs-jsonapi/core\";\nimport { HoverCard, HoverCardContent, HoverCardTrigger } from \"@carlonicora/nextjs-jsonapi/components\";\nimport Image from \"next/image\";\nimport { useState } from \"react\";\n\ntype ImageHoverCardProps = {\n imageSrc?: string;\n altText: string;\n size?: \"xs\" | \"sm\" | \"header\";\n asSpan?: boolean;\n};\n\n/** Ported from the earlier codebase's apps/web/src/features/common/components/details/ImageHoverCard.tsx. */\nexport function ImageHoverCard({ imageSrc, altText, size = \"sm\", asSpan = false }: ImageHoverCardProps) {\n const [orientation, setOrientation] = useState<\"landscape\" | \"portrait\" | null>(null);\n\n if (!imageSrc) return null;\n\n return (\n <HoverCard>\n <HoverCardTrigger\n render={asSpan ? <span /> : undefined}\n className={cn(\n `relative block`,\n size === \"xs\" && \"h-8 w-8\",\n size === \"sm\" && \"h-12 w-12\",\n size === \"header\" && \"h-20 w-full\",\n )}\n >\n <Image src={imageSrc} alt={altText} fill className=\"object-cover\" />\n </HoverCardTrigger>\n <HoverCardContent side=\"bottom\" align=\"end\" sideOffset={8} className=\"w-auto p-1\">\n <Image\n src={imageSrc}\n alt={altText}\n width={560}\n height={560}\n className={\n orientation === \"landscape\"\n ? \"h-auto w-140 rounded\"\n : orientation === \"portrait\"\n ? \"h-140 w-auto rounded\"\n : \"max-h-140 max-w-140 rounded\"\n }\n onLoad={(e) => {\n const img = e.currentTarget;\n setOrientation(img.naturalWidth >= img.naturalHeight ? \"landscape\" : \"portrait\");\n }}\n unoptimized\n />\n </HoverCardContent>\n </HoverCard>\n );\n}\n","\"use client\";\n\nimport { ImageHoverCard } from \"../../../common/components/details/ImageHoverCard\";\nimport { CommunityOfExpertiseFields } from \"../data/CommunityOfExpertiseFields\";\nimport { CommunityOfExpertiseInterface } from \"../data/CommunityOfExpertiseInterface\";\nimport { cellDate, cellId } from \"@carlonicora/nextjs-jsonapi/components\";\nimport {\n registerTableGenerator,\n TableContent,\n usePageUrlGenerator,\n UseTableStructureHook,\n} from \"@carlonicora/nextjs-jsonapi/client\";\nimport { Link, Tooltip, TooltipContent, TooltipTrigger } from \"@carlonicora/nextjs-jsonapi/components\";\nimport { resolveField } from \"../../../common/i18n/translationResolver\";\nimport { useContentLanguage } from \"../../../common/hooks/useContentLanguage\";\nimport { ColumnDef } from \"@tanstack/react-table\";\nimport { useTranslations } from \"next-intl\";\nimport { useMemo } from \"react\";\nimport { KnowledgeModules } from \"../../../knowledge.registry\";\n\nexport const useCommunityOfExpertiseTableStructure: UseTableStructureHook<\n CommunityOfExpertiseInterface,\n CommunityOfExpertiseFields\n> = (params) => {\n const t = useTranslations();\n const generateUrl = usePageUrlGenerator();\n const language = useContentLanguage();\n\n const tableData = useMemo(() => {\n return params.data.map((communityOfExpertise: CommunityOfExpertiseInterface) => {\n const entry: TableContent<CommunityOfExpertiseInterface> = {\n jsonApiData: communityOfExpertise,\n };\n entry[CommunityOfExpertiseFields.communityOfExpertiseId] = communityOfExpertise.id;\n params.fields.forEach((field) => {\n entry[field] = communityOfExpertise[field as keyof CommunityOfExpertiseInterface];\n });\n return entry;\n });\n }, [params.data, params.fields]);\n\n const fieldColumnMap: Partial<Record<CommunityOfExpertiseFields, () => any>> = {\n [CommunityOfExpertiseFields.communityOfExpertiseId]: () =>\n cellId({\n name: \"communityOfExpertiseId\",\n checkedIds: params.checkedIds,\n toggleId: params.toggleId,\n }),\n [CommunityOfExpertiseFields.name]: () => ({\n id: \"name\",\n accessorKey: \"name\",\n header: t(`features.communityofexpertise.fields.name.label`),\n cell: ({ row }: { row: TableContent<CommunityOfExpertiseInterface> }) => {\n const communityOfExpertise: CommunityOfExpertiseInterface = row.original.jsonApiData;\n // Stored translations win over the original text for the reader's language (C9).\n const name = resolveField({\n original: communityOfExpertise.name,\n translation: communityOfExpertise.translation,\n field: \"name\",\n language,\n });\n return (\n <Tooltip>\n <TooltipTrigger>\n {KnowledgeModules.CommunityOfExpertise.pageUrl ? (\n <Link href={generateUrl({ page: KnowledgeModules.CommunityOfExpertise, id: communityOfExpertise.id })}>\n {name}\n </Link>\n ) : (\n <span>{name}</span>\n )}\n </TooltipTrigger>\n <TooltipContent>{name}</TooltipContent>\n </Tooltip>\n );\n },\n enableSorting: false,\n enableHiding: false,\n }),\n [CommunityOfExpertiseFields.image]: () => ({\n id: \"image\",\n accessorKey: \"image\",\n header: t(`features.communityofexpertise.fields.image.label`),\n cell: ({ row }: { row: TableContent<CommunityOfExpertiseInterface> }) => {\n const communityOfExpertise: CommunityOfExpertiseInterface = row.original.jsonApiData;\n return (\n <ImageHoverCard imageSrc={communityOfExpertise.image} altText={communityOfExpertise.name} size=\"xs\" asSpan />\n );\n },\n enableSorting: false,\n enableHiding: false,\n }),\n [CommunityOfExpertiseFields.cluster]: () => ({\n id: \"cluster\",\n accessorKey: \"cluster\",\n header: t(`features.communityofexpertise.relationships.cluster.label`),\n cell: ({ row }: { row: TableContent<CommunityOfExpertiseInterface> }) => {\n const communityOfExpertise: CommunityOfExpertiseInterface = row.original.jsonApiData;\n return <span>{communityOfExpertise.cluster?.name ?? \"\"}</span>;\n },\n enableSorting: false,\n enableHiding: false,\n }),\n // Row actions supplied by the caller through ContentListTable's `context`\n // (the directory list renders the request-access button here).\n [CommunityOfExpertiseFields.actions]: () => ({\n id: \"actions\",\n accessorKey: \"actions\",\n header: \"\",\n cell: ({ row }: { row: TableContent<CommunityOfExpertiseInterface> }) => (\n <div className=\"flex justify-end\">{params.context?.renderActions?.(row.original.jsonApiData)}</div>\n ),\n enableSorting: false,\n enableHiding: false,\n }),\n [CommunityOfExpertiseFields.createdAt]: () =>\n cellDate({\n name: \"createdAt\",\n title: t(`common.date.create`),\n }),\n [CommunityOfExpertiseFields.updatedAt]: () =>\n cellDate({\n name: \"updatedAt\",\n title: t(`common.date.update`),\n }),\n };\n\n const columns = useMemo(() => {\n return params.fields.map((field) => fieldColumnMap[field]?.()).filter((col) => col !== undefined) as ColumnDef<\n TableContent<CommunityOfExpertiseInterface>\n >[];\n }, [params.fields, fieldColumnMap, t, generateUrl, language]);\n\n return useMemo(() => ({ data: tableData, columns: columns }), [tableData, columns]);\n};\n\nregisterTableGenerator(KnowledgeModules.CommunityOfExpertise, useCommunityOfExpertiseTableStructure);\n","\"use client\";\n\nimport CommunityOfExpertiseEditor from \"../forms/CommunityOfExpertiseEditor\";\nimport { CommunityOfExpertiseFields } from \"../../data/CommunityOfExpertiseFields\";\nimport { CommunityOfExpertiseInterface } from \"../../data/CommunityOfExpertiseInterface\";\nimport { CommunityOfExpertiseService } from \"../../data/CommunityOfExpertiseService\";\nimport \"../../hooks/useCommunityOfExpertiseTableStructure\";\nimport type { ClusterInterface } from \"../../../cluster/data/ClusterInterface\";\nimport { ContentListTable } from \"@carlonicora/nextjs-jsonapi/components\";\nimport { DataListRetriever, useDataListRetriever } from \"@carlonicora/nextjs-jsonapi/client\";\nimport { useTranslations } from \"next-intl\";\nimport { ReactNode } from \"react\";\nimport { KnowledgeModules } from \"../../../../knowledge.registry\";\n\n// The parent props are hand-added: the generated container renders this list inside a\n// relation tab (`containerTabs.relations`), and the generator does not emit the props\n// that tab passes. Shape copied from ~/Development/wyrdli ClueList.\ntype CommunityOfExpertiseListProps = {\n fullWidth?: boolean;\n cluster?: ClusterInterface;\n};\n\nexport default function CommunityOfExpertiseList({ fullWidth, cluster }: CommunityOfExpertiseListProps) {\n const t = useTranslations();\n\n const data: DataListRetriever<CommunityOfExpertiseInterface> = useDataListRetriever({\n module: KnowledgeModules.CommunityOfExpertise,\n retriever: (params: any) => {\n if (cluster) return CommunityOfExpertiseService.findManyByCluster({ ...params, clusterId: cluster.id });\n return CommunityOfExpertiseService.findMany(params);\n },\n retrieverParams: {},\n });\n\n const functions: ReactNode[] = [<CommunityOfExpertiseEditor key=\"create-community-of-expertise\" />];\n\n return (\n <ContentListTable\n data={data}\n fields={[\n CommunityOfExpertiseFields.name,\n CommunityOfExpertiseFields.cluster,\n CommunityOfExpertiseFields.updatedAt,\n ]}\n tableGeneratorType={KnowledgeModules.CommunityOfExpertise}\n functions={functions}\n title={t(`entities.communityofexpertises`, { count: 2 })}\n fullWidth={fullWidth}\n />\n );\n}\n","\"use client\";\n\nimport TranslationsTab from \"../../../../common/components/translations/TranslationsTab\";\nimport { ClusterContent } from \"../details/ClusterContent\";\nimport ClusterList from \"../lists/ClusterList\";\nimport ClusterMembersList from \"../lists/ClusterMembersList\";\nimport ClusterRequestsList from \"../lists/ClusterRequestsList\";\nimport { useClusterContext } from \"../../contexts/ClusterContext\";\nimport { ClusterInterface } from \"../../data/ClusterInterface\";\nimport { ClusterService } from \"../../data/ClusterService\";\nimport CommunityOfExpertiseList from \"../../../community-of-expertise/components/lists/CommunityOfExpertiseList\";\nimport { Tab, Tabs, TabsContent, TabsList, TabsTrigger } from \"@carlonicora/nextjs-jsonapi/components\";\nimport { useCurrentUserContext } from \"@carlonicora/nextjs-jsonapi/contexts\";\nimport { Action } from \"@carlonicora/nextjs-jsonapi/core\";\nimport { useTranslations } from \"next-intl\";\nimport { KnowledgeModules } from \"../../../../knowledge.registry\";\n\ntype ClusterContainerProps = {\n cluster: ClusterInterface;\n setCluster: (cluster: ClusterInterface | undefined) => void;\n};\n\n/** Same rule the package uses: `sectionKey`, else the module name, else the label. */\nconst tabValue = (tab: Tab): string => tab.sectionKey ?? tab.key?.name ?? tab.label;\n\nfunction ClusterContainerInternal({ cluster, setCluster }: ClusterContainerProps) {\n const t = useTranslations();\n\n // Tab shape copied from ~/Development/wyrdli/.../ThreatContainer.tsx.\n const tabs: Tab[] = [\n {\n sectionKey: \"details\",\n label: t(`features.cluster.sections.details`),\n content: <ClusterContent cluster={cluster} />,\n },\n {\n key: KnowledgeModules.Cluster,\n label: t(`entities.clusters`, { count: 2 }),\n content: <ClusterList parent={cluster} />,\n },\n {\n key: KnowledgeModules.CommunityOfExpertise,\n label: t(`entities.communityofexpertises`, { count: 2 }),\n content: <CommunityOfExpertiseList cluster={cluster} />,\n },\n {\n sectionKey: \"members\",\n label: t(`features.cluster.sections.members`),\n content: <ClusterMembersList cluster={cluster} variant=\"members\" propagateChanges={setCluster} />,\n },\n {\n sectionKey: \"managers\",\n label: t(`features.cluster.sections.managers`),\n content: <ClusterMembersList cluster={cluster} variant=\"managers\" propagateChanges={setCluster} />,\n },\n {\n sectionKey: \"requests\",\n label: t(`features.cluster.sections.requests`),\n content: <ClusterRequestsList cluster={cluster} propagateChanges={setCluster} />,\n },\n {\n sectionKey: \"translations\",\n label: t(`features.translations.title`),\n contentLabel: <span data-testid=\"translations-tab\">{t(`features.translations.title`)}</span>,\n content: (\n <TranslationsTab\n entity={{ id: cluster.id, translation: cluster.translation }}\n fields={[\"name\", \"description\"]}\n onSave={async (language, fields) => {\n setCluster(await ClusterService.patchTranslations({ id: cluster.id, language, fields }));\n }}\n />\n ),\n },\n ];\n\n // The cluster opens inside the settings rail, which owns the page frame\n // (header, breadcrumb, title). So the tabs render bare, the way a settings\n // pane with tabs does in ~/Development/a360ai\n // AgreementTemplatesAndTypesContainer.tsx — a RoundPageContainer here would\n // stack a second header and title strip inside the pane.\n return (\n <Tabs defaultValue={tabValue(tabs[0])} className=\"flex w-full flex-col\">\n <TabsList className=\"self-start\">\n {tabs.map((tab) => (\n <TabsTrigger key={tabValue(tab)} value={tabValue(tab)}>\n {tab.contentLabel ?? tab.label}\n </TabsTrigger>\n ))}\n </TabsList>\n {tabs.map((tab) => (\n <TabsContent key={tabValue(tab)} value={tabValue(tab)}>\n {tab.content}\n </TabsContent>\n ))}\n </Tabs>\n );\n}\n\nexport default function ClusterContainer() {\n const { hasPermissionToModule } = useCurrentUserContext();\n const { cluster, setCluster } = useClusterContext();\n if (!cluster) return null;\n if (!hasPermissionToModule({ module: KnowledgeModules.Cluster, action: Action.Read, data: cluster })) return null;\n return <ClusterContainerInternal cluster={cluster} setCluster={setCluster} />;\n}\n","\"use client\";\n\nimport { ClusterInterface } from \"../../data/ClusterInterface\";\nimport { ClusterService } from \"../../data/ClusterService\";\nimport { EntityMultiSelector } from \"@carlonicora/nextjs-jsonapi/components\";\nimport { useTranslations } from \"next-intl\";\nimport { KnowledgeModules } from \"../../../../knowledge.registry\";\n\ntype ClusterMultiSelectorProps = {\n id: string;\n form: any;\n currentCluster?: ClusterInterface;\n label?: string;\n placeholder?: string;\n onChange?: (clusters?: ClusterInterface[]) => void;\n maxCount?: number;\n isRequired?: boolean;\n};\n\nexport default function ClusterMultiSelector({\n id,\n form,\n currentCluster,\n label,\n placeholder,\n onChange,\n isRequired = false,\n}: ClusterMultiSelectorProps) {\n const t = useTranslations();\n\n return (\n <EntityMultiSelector<ClusterInterface>\n id={id}\n form={form}\n label={label}\n placeholder={placeholder || t(\"ui.search.button\")}\n emptyText={t(\"ui.search.no_results_generic\")}\n isRequired={isRequired}\n retriever={(params) => ClusterService.findMany(params)}\n module={KnowledgeModules.Cluster}\n getLabel={(cluster) => cluster.name}\n excludeId={currentCluster?.id}\n onChange={onChange}\n />\n );\n}\n","\"use client\";\n\nimport { CommunityOfExpertiseInterface } from \"../../data/CommunityOfExpertiseInterface\";\nimport { CommunityOfExpertiseService } from \"../../data/CommunityOfExpertiseService\";\nimport { Badge, Button, errorToast } from \"@carlonicora/nextjs-jsonapi/components\";\nimport { useCurrentUserContext } from \"@carlonicora/nextjs-jsonapi/contexts\";\nimport { useTranslations } from \"next-intl\";\nimport { useState } from \"react\";\n\ntype CommunityAccessButtonsProps = {\n communityOfExpertise: CommunityOfExpertiseInterface;\n propagateChanges?: (communityOfExpertise: CommunityOfExpertiseInterface) => void;\n size?: \"small\" | \"default\";\n};\n\n/**\n * Join controls for a community of expertise.\n *\n * Ported from the earlier codebase's .../CommunityOfExpertiseJoinButtons.tsx:\n * the immediate join became an access REQUEST (spec §5.1), so the two states are\n * \"ask to join\" and \"waiting for a manager\".\n */\nexport default function CommunityAccessButtons({\n communityOfExpertise,\n propagateChanges,\n size = \"default\",\n}: CommunityAccessButtonsProps) {\n const t = useTranslations();\n const { currentUser } = useCurrentUserContext();\n const [isLoading, setIsLoading] = useState<boolean>(false);\n // Local state, not a re-read, and declared with the other hooks so the early\n // returns below cannot skip it. `reload()` asks the API for the entity by id,\n // and a user who has just asked to JOIN a cluster/community cannot read it yet\n // — the access predicate refuses with 403. Deriving \"pending\" from that read\n // meant the badge never appeared and a SUCCESSFUL request was reported as a\n // failure (\"Could not request access\"). The request is the source of truth;\n // the re-read is best effort.\n const [isPending, setIsPending] = useState<boolean>(\n communityOfExpertise.requesters.some((user) => user.id === currentUser?.id),\n );\n\n if (!currentUser) return null;\n\n const isMember =\n communityOfExpertise.members.some((user) => user.id === currentUser.id) ||\n communityOfExpertise.managers.some((user) => user.id === currentUser.id);\n\n if (isMember) return null;\n\n const buttonSize = size === \"small\" ? \"sm\" : \"default\";\n\n const reload = async () => {\n if (!propagateChanges) return;\n // Best effort: a requester cannot read the entity it is asking to join.\n try {\n propagateChanges(await CommunityOfExpertiseService.findOne({ id: communityOfExpertise.id }));\n } catch {\n // ignore — the local state above already reflects the write\n }\n };\n\n const requestAccess = async () => {\n setIsLoading(true);\n try {\n await CommunityOfExpertiseService.requestAccess({ id: communityOfExpertise.id });\n setIsPending(true);\n await reload();\n } catch (error) {\n errorToast({ title: t(`features.communityofexpertise.access.request_error`), error });\n } finally {\n setIsLoading(false);\n }\n };\n\n const withdrawRequest = async () => {\n setIsLoading(true);\n try {\n await CommunityOfExpertiseService.rejectAccess({ id: communityOfExpertise.id, userId: currentUser.id });\n setIsPending(false);\n await reload();\n } catch (error) {\n errorToast({ title: t(`features.communityofexpertise.access.withdraw_error`), error });\n } finally {\n setIsLoading(false);\n }\n };\n\n if (isPending)\n return (\n <div className=\"flex items-center gap-2\">\n <Badge variant=\"softYellow\" data-testid=\"community-request-pending\">\n {t(`features.communityofexpertise.access.pending`)}\n </Badge>\n <Button variant=\"ghost\" size={buttonSize} onClick={withdrawRequest} disabled={isLoading}>\n {t(`features.communityofexpertise.access.withdraw`)}\n </Button>\n </div>\n );\n\n return (\n <Button\n variant=\"outline\"\n size={buttonSize}\n onClick={requestAccess}\n disabled={isLoading}\n data-testid=\"community-request-access\"\n >\n {t(`features.communityofexpertise.access.request`)}\n </Button>\n );\n}\n","\"use client\";\n\nimport { CommunityOfExpertiseInterface } from \"../../data/CommunityOfExpertiseInterface\";\nimport { CommunityOfExpertiseService } from \"../../data/CommunityOfExpertiseService\";\nimport { CommonDeleter } from \"@carlonicora/nextjs-jsonapi/components\";\nimport { usePageUrlGenerator } from \"@carlonicora/nextjs-jsonapi/client\";\n\nimport { useTranslations } from \"next-intl\";\nimport { KnowledgeModules } from \"../../../../knowledge.registry\";\n\ntype CommunityOfExpertiseDeleterProps = {\n communityOfExpertise: CommunityOfExpertiseInterface;\n};\n\nfunction CommunityOfExpertiseDeleterInternal({ communityOfExpertise }: CommunityOfExpertiseDeleterProps) {\n const t = useTranslations();\n const generateUrl = usePageUrlGenerator();\n\n if (!communityOfExpertise) return null;\n\n return (\n <CommonDeleter\n // `entities.communityofexpertises`, not the endpoint: CommonDeleter feeds `type` to\n // t(`entities.${type}`), and messages/en.json keys these entities without\n // the dashes. The endpoint form raised MISSING_MESSAGE on every render.\n type={`communityofexpertises`}\n deleteFunction={() => CommunityOfExpertiseService.delete({ communityOfExpertiseId: communityOfExpertise.id })}\n redirectTo={\n KnowledgeModules.CommunityOfExpertise.pageUrl\n ? generateUrl({ page: KnowledgeModules.CommunityOfExpertise })\n : undefined\n }\n />\n );\n}\n\nexport default function CommunityOfExpertiseDeleter(props: CommunityOfExpertiseDeleterProps) {\n return <CommunityOfExpertiseDeleterInternal {...props} />;\n}\n","\"use client\";\n\nimport CommunityAccessButtons from \"../components/forms/CommunityAccessButtons\";\nimport CommunityOfExpertiseDeleter from \"../components/forms/CommunityOfExpertiseDeleter\";\nimport CommunityOfExpertiseEditor from \"../components/forms/CommunityOfExpertiseEditor\";\nimport { useContentLanguage } from \"../../../common/hooks/useContentLanguage\";\nimport { resolveField } from \"../../../common/i18n/translationResolver\";\nimport { CommunityOfExpertiseInterface } from \"../data/CommunityOfExpertiseInterface\";\nimport { CommunityOfExpertiseService } from \"../data/CommunityOfExpertiseService\";\nimport { SharedProvider } from \"@carlonicora/nextjs-jsonapi/contexts\";\nimport { usePageUrlGenerator } from \"@carlonicora/nextjs-jsonapi/client\";\nimport { BreadcrumbItemData } from \"@carlonicora/nextjs-jsonapi/core\";\n\nimport { JsonApiHydratedDataInterface, rehydrate } from \"@carlonicora/nextjs-jsonapi/core\";\nimport { useTranslations } from \"next-intl\";\nimport { createContext, ReactNode, useContext, useState } from \"react\";\nimport { KnowledgeModules } from \"../../../knowledge.registry\";\n\ninterface CommunityOfExpertiseContextType {\n communityOfExpertise: CommunityOfExpertiseInterface | undefined;\n setCommunityOfExpertise: (value: CommunityOfExpertiseInterface | undefined) => void;\n reloadCommunityOfExpertise: () => Promise<void>;\n}\n\nconst CommunityOfExpertiseContext = createContext<CommunityOfExpertiseContextType | undefined>(undefined);\n\ntype CommunityOfExpertiseProviderProps = {\n children: ReactNode;\n dehydratedCommunityOfExpertise?: JsonApiHydratedDataInterface;\n};\n\nexport const CommunityOfExpertiseProvider = ({\n children,\n dehydratedCommunityOfExpertise,\n}: CommunityOfExpertiseProviderProps) => {\n const generateUrl = usePageUrlGenerator();\n const t = useTranslations();\n const language = useContentLanguage();\n\n const [communityOfExpertise, setCommunityOfExpertise] = useState<CommunityOfExpertiseInterface | undefined>(\n dehydratedCommunityOfExpertise\n ? rehydrate<CommunityOfExpertiseInterface>(KnowledgeModules.CommunityOfExpertise, dehydratedCommunityOfExpertise)\n : undefined,\n );\n\n const reloadCommunityOfExpertise = async () => {\n if (!communityOfExpertise) return;\n\n const freshCommunityOfExpertise = await CommunityOfExpertiseService.findOne({ id: communityOfExpertise.id });\n setCommunityOfExpertise(freshCommunityOfExpertise);\n };\n\n const breadcrumb = () => {\n const response: BreadcrumbItemData[] = [];\n\n response.push({\n name: t(`entities.communityofexpertises`, { count: 2 }),\n href: KnowledgeModules.CommunityOfExpertise.pageUrl\n ? generateUrl({ page: KnowledgeModules.CommunityOfExpertise })\n : undefined,\n });\n\n if (communityOfExpertise)\n response.push({\n name: communityOfExpertise.name,\n href: KnowledgeModules.CommunityOfExpertise.pageUrl\n ? generateUrl({ page: KnowledgeModules.CommunityOfExpertise, id: communityOfExpertise.id })\n : undefined,\n });\n\n return response;\n };\n\n const title = () => {\n const response: any = {\n type: t(`entities.communityofexpertises`, { count: communityOfExpertise ? 1 : 2 }),\n };\n\n const functions: ReactNode[] = [];\n\n if (communityOfExpertise) {\n // The hero title resolves the stored translation for the reader's language,\n // the same way the list cells and the details body do (C9).\n response.element = resolveField({\n original: communityOfExpertise.name,\n translation: communityOfExpertise.translation,\n field: \"name\",\n language,\n });\n\n // Join controls live in the page header so they are reachable from every tab.\n functions.push(\n <CommunityAccessButtons\n key={`CommunityAccessButtons`}\n communityOfExpertise={communityOfExpertise}\n propagateChanges={setCommunityOfExpertise}\n size=\"small\"\n />,\n );\n functions.push(\n <CommunityOfExpertiseDeleter key={`CommunityOfExpertiseDeleter`} communityOfExpertise={communityOfExpertise} />,\n );\n functions.push(\n <CommunityOfExpertiseEditor\n key={`CommunityOfExpertiseEditor`}\n communityOfExpertise={communityOfExpertise}\n propagateChanges={setCommunityOfExpertise}\n />,\n );\n } else {\n functions.push(<CommunityOfExpertiseEditor key={`CommunityOfExpertiseEditor`} />);\n }\n\n if (functions.length > 0) response.functions = functions;\n\n return response;\n };\n\n return (\n <SharedProvider value={{ breadcrumbs: breadcrumb(), title: title() }}>\n <CommunityOfExpertiseContext.Provider\n value={{\n communityOfExpertise: communityOfExpertise,\n setCommunityOfExpertise: setCommunityOfExpertise,\n reloadCommunityOfExpertise: reloadCommunityOfExpertise,\n }}\n >\n {children}\n </CommunityOfExpertiseContext.Provider>\n </SharedProvider>\n );\n};\n\nexport const useCommunityOfExpertiseContext = (): CommunityOfExpertiseContextType => {\n const context = useContext(CommunityOfExpertiseContext);\n if (context === undefined) {\n throw new Error(\"useCommunityOfExpertiseContext must be used within a CommunityOfExpertiseProvider\");\n }\n return context;\n};\n","\"use client\";\n\nimport \"../../hooks/useCommunityOfExpertiseTableStructure\";\n\nimport CommunityAccessButtons from \"../forms/CommunityAccessButtons\";\nimport CommunityOfExpertiseList from \"../lists/CommunityOfExpertiseList\";\nimport { CommunityOfExpertiseFields } from \"../../data/CommunityOfExpertiseFields\";\nimport { CommunityOfExpertiseInterface } from \"../../data/CommunityOfExpertiseInterface\";\nimport { CommunityOfExpertiseService } from \"../../data/CommunityOfExpertiseService\";\nimport { DataListRetriever, useDataListRetriever } from \"@carlonicora/nextjs-jsonapi/client\";\nimport { ContentListTable, RoundPageContainer } from \"@carlonicora/nextjs-jsonapi/components\";\nimport { useCurrentUserContext } from \"@carlonicora/nextjs-jsonapi/contexts\";\nimport { getRoleId } from \"@carlonicora/nextjs-jsonapi\";\nimport { useTranslations } from \"next-intl\";\nimport { KnowledgeModules } from \"../../../../knowledge.registry\";\n\n/**\n * Every community in the company, access filter off\n * (`GET communities-of-expertise/directory`), so a user can find and ask to join\n * the ones they cannot see yet.\n */\nfunction CommunityOfExpertiseDirectoryList() {\n const t = useTranslations();\n\n const data: DataListRetriever<CommunityOfExpertiseInterface> = useDataListRetriever({\n module: KnowledgeModules.CommunityOfExpertise,\n retriever: (params: any) => CommunityOfExpertiseService.findDirectory(params),\n retrieverParams: {},\n });\n\n const context = {\n renderActions: (communityOfExpertise: CommunityOfExpertiseInterface) => (\n <CommunityAccessButtons\n communityOfExpertise={communityOfExpertise}\n size=\"small\"\n propagateChanges={(updated) => data.setRefreshedElement(updated)}\n />\n ),\n };\n\n return (\n <ContentListTable\n data={data}\n fields={[CommunityOfExpertiseFields.name, CommunityOfExpertiseFields.cluster, CommunityOfExpertiseFields.actions]}\n tableGeneratorType={KnowledgeModules.CommunityOfExpertise}\n title={t(`features.communityofexpertise.sections.directory`)}\n allowSearch\n context={context}\n fullWidth\n />\n );\n}\n\nfunction CommunityOfExpertiseListContainerInternal() {\n const { hasRole } = useCurrentUserContext();\n\n // An administrator already sees every community in the main list.\n const showDirectory = !hasRole(getRoleId().Administrator) && !hasRole(getRoleId().CompanyAdministrator);\n\n return (\n <RoundPageContainer module={KnowledgeModules.CommunityOfExpertise} fullWidth>\n <div className=\"flex w-full flex-col gap-y-8\">\n <CommunityOfExpertiseList fullWidth />\n {showDirectory && <CommunityOfExpertiseDirectoryList />}\n </div>\n </RoundPageContainer>\n );\n}\n\nexport default function CommunityOfExpertiseListContainer() {\n return <CommunityOfExpertiseListContainerInternal />;\n}\n","\"use client\";\n\nimport { ImageHoverCard } from \"../../../../common/components/details/ImageHoverCard\";\nimport { resolveField } from \"../../../../common/i18n/translationResolver\";\nimport { useContentLanguage } from \"../../../../common/hooks/useContentLanguage\";\nimport { resolveBlockNoteField } from \"../../../common/i18n/resolveBlockNoteField\";\nimport { CommunityOfExpertiseInterface } from \"../../data/CommunityOfExpertiseInterface\";\nimport { AttributeElement, BlockNoteEditorContainer, Card, MicroLabel } from \"@carlonicora/nextjs-jsonapi/components\";\nimport { useTranslations } from \"next-intl\";\n\ntype CommunityOfExpertiseContentProps = { communityOfExpertise: CommunityOfExpertiseInterface };\n\nexport function CommunityOfExpertiseContent({ communityOfExpertise }: CommunityOfExpertiseContentProps) {\n const t = useTranslations();\n const language = useContentLanguage();\n\n // Stored translations win over the original text for the reader's language (C9).\n const description = resolveBlockNoteField({\n original: communityOfExpertise.description,\n translation: communityOfExpertise.translation,\n field: \"description\",\n language,\n });\n\n return (\n <div className=\"flex flex-col gap-y-8\">\n <ImageHoverCard imageSrc={communityOfExpertise.image} altText={communityOfExpertise.name} size=\"header\" />\n <div className=\"flex flex-col gap-y-3\">\n <MicroLabel>{t(`features.communityofexpertise.fields.description.label`)}</MicroLabel>\n <Card className=\"flex w-full flex-col p-4\">\n <BlockNoteEditorContainer\n id={communityOfExpertise.id}\n type=\"communityOfExpertise\"\n initialContent={description}\n />\n </Card>\n </div>\n <div className=\"flex flex-col gap-y-3\">\n <MicroLabel>{t(`features.communityofexpertise.sections.details`)}</MicroLabel>\n <div className=\"grid grid-cols-1 gap-4 md:grid-cols-3\">\n {communityOfExpertise.cluster && (\n <AttributeElement\n title={t(`features.communityofexpertise.relationships.cluster.label`)}\n value={resolveField({\n original: communityOfExpertise.cluster.name,\n translation: communityOfExpertise.cluster.translation,\n field: \"name\",\n language,\n })}\n />\n )}\n {communityOfExpertise.parent && (\n <AttributeElement\n title={t(`features.communityofexpertise.relationships.parent.label`)}\n value={resolveField({\n original: communityOfExpertise.parent.name,\n translation: communityOfExpertise.parent.translation,\n field: \"name\",\n language,\n })}\n />\n )}\n </div>\n </div>\n </div>\n );\n}\n","\"use client\";\n\nimport { CommunityOfExpertiseService } from \"../../data/CommunityOfExpertiseService\";\nimport {\n Button,\n Dialog,\n DialogContent,\n DialogFooter,\n DialogHeader,\n DialogTitle,\n EntitySelector,\n errorToast,\n FormFieldWrapper,\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n} from \"@carlonicora/nextjs-jsonapi/components\";\nimport { Modules, UserInterface, UserService } from \"@carlonicora/nextjs-jsonapi/core\";\nimport { RoleInCommunity } from \"../../../../../shared\";\nimport { useTranslations } from \"next-intl\";\nimport { useState } from \"react\";\nimport { useForm } from \"react-hook-form\";\n\ntype AddUserToCommunityDialogProps = {\n communityOfExpertiseId: string;\n existingUserIds: string[];\n onSuccess: () => Promise<void> | void;\n};\n\nconst roles = Object.values(RoleInCommunity);\n\n/**\n * Ported from the earlier codebase's .../AddUserToCommunityDialog.tsx.\n *\n * Deviation: the backup hand-rolled a search popover; 3.5.10 ships\n * `EntitySelector` (C8's single-picker reference), so the picker is the package\n * component and only the role select and the submit are ported.\n */\nexport function AddUserToCommunityDialog({\n communityOfExpertiseId,\n existingUserIds,\n onSuccess,\n}: AddUserToCommunityDialogProps) {\n const t = useTranslations();\n const [open, setOpen] = useState<boolean>(false);\n const [isSaving, setIsSaving] = useState<boolean>(false);\n\n const form = useForm<{ user?: { id: string; name: string }; role: string }>({\n defaultValues: { user: undefined, role: RoleInCommunity.member },\n });\n\n const submit = async (values: { user?: { id: string; name: string }; role: string }) => {\n if (!values.user) return;\n setIsSaving(true);\n try {\n await CommunityOfExpertiseService.addMember({\n id: communityOfExpertiseId,\n userId: values.user.id,\n role: values.role,\n });\n form.reset({ user: undefined, role: RoleInCommunity.member });\n setOpen(false);\n await onSuccess();\n } catch (error) {\n errorToast({ title: t(`features.communityofexpertise.roles.errors.add_user_failed`), error });\n } finally {\n setIsSaving(false);\n }\n };\n\n return (\n <>\n <Button variant=\"outline\" size=\"sm\" onClick={() => setOpen(true)}>\n {t(`features.communityofexpertise.actions.add_user`)}\n </Button>\n <Dialog open={open} onOpenChange={setOpen}>\n <DialogContent className=\"flex max-w-md flex-col\">\n <DialogHeader>\n <DialogTitle>{t(`features.communityofexpertise.actions.add_user`)}</DialogTitle>\n </DialogHeader>\n <form onSubmit={form.handleSubmit(submit)} className=\"flex w-full flex-col gap-y-4\">\n <EntitySelector<UserInterface>\n id=\"user\"\n form={form}\n module={Modules.User}\n retriever={(params) => UserService.findMany(params)}\n filterData={(data) => data.filter((user) => !existingUserIds.includes(user.id))}\n label={t(`features.communityofexpertise.relationships.user.label`)}\n placeholder={t(`features.communityofexpertise.relationships.user.placeholder`)}\n isRequired\n />\n <FormFieldWrapper form={form} name=\"role\" label={t(`features.communityofexpertise.roles.label`)} isRequired>\n {(field) => (\n <Select value={field.value} onValueChange={field.onChange}>\n <SelectTrigger>\n <SelectValue />\n </SelectTrigger>\n <SelectContent className=\"p-1\">\n {roles.map((role) => (\n <SelectItem key={role} value={role}>\n {t(`features.communityofexpertise.roles.values.${role}`)}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n )}\n </FormFieldWrapper>\n <DialogFooter>\n <Button type=\"button\" variant=\"outline\" onClick={() => setOpen(false)}>\n {t(`ui.buttons.cancel`)}\n </Button>\n <Button type=\"submit\" disabled={isSaving}>\n {t(`ui.buttons.add`)}\n </Button>\n </DialogFooter>\n </form>\n </DialogContent>\n </Dialog>\n </>\n );\n}\n","\"use client\";\n\nimport { CommunityOfExpertiseService } from \"../../data/CommunityOfExpertiseService\";\nimport {\n errorToast,\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n} from \"@carlonicora/nextjs-jsonapi/components\";\nimport { isAdminRole, RoleInCommunity } from \"../../../../../shared\";\nimport { useTranslations } from \"next-intl\";\nimport { useState } from \"react\";\n\ntype CommunityRoleDropdownProps = {\n userId: string;\n role: string;\n communityOfExpertiseId: string;\n isEditable: boolean;\n /** Number of sponsors/leaders in the community: the last one cannot be demoted. */\n adminCount: number;\n onChange?: () => Promise<void> | void;\n};\n\nconst roles = Object.values(RoleInCommunity);\n\n/** Ported verbatim from the earlier codebase's .../CommunityRoleDropdown.tsx; the role now travels on the HAS_EXPERTISE edge. */\nexport function CommunityRoleDropdown({\n userId,\n role,\n communityOfExpertiseId,\n isEditable,\n adminCount,\n onChange,\n}: CommunityRoleDropdownProps) {\n const t = useTranslations();\n const [currentRole, setCurrentRole] = useState<string>(role || RoleInCommunity.member);\n\n const isLastAdmin = isAdminRole(currentRole) && adminCount <= 1;\n const translatedRole = t(`features.communityofexpertise.roles.values.${currentRole}`);\n\n if (!isEditable) return <>{translatedRole}</>;\n\n const handleRoleChange = async (newRole: string) => {\n const previousRole = currentRole;\n setCurrentRole(newRole);\n\n try {\n await CommunityOfExpertiseService.updateMemberRole({ id: communityOfExpertiseId, userId, role: newRole });\n await onChange?.();\n } catch (error) {\n setCurrentRole(previousRole);\n errorToast({ title: t(`features.communityofexpertise.roles.errors.update_failed`), error });\n }\n };\n\n return (\n <Select value={currentRole} onValueChange={handleRoleChange} disabled={isLastAdmin}>\n <SelectTrigger size=\"sm\" className=\"w-[140px]\">\n <SelectValue>{translatedRole}</SelectValue>\n </SelectTrigger>\n <SelectContent className=\"p-1\">\n {roles.map((value) => (\n <SelectItem key={value} value={value}>\n {t(`features.communityofexpertise.roles.values.${value}`)}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n );\n}\n","\"use client\";\n\nimport \"../../../common/hooks/useExpertiseUserTableStructure\";\n\nimport { ExpertiseUserFields, ExpertiseUsersTable } from \"../../../common/hooks/useExpertiseUserTableStructure\";\nimport { AddUserToCommunityDialog } from \"../forms/AddUserToCommunityDialog\";\nimport { CommunityRoleDropdown } from \"../forms/CommunityRoleDropdown\";\nimport { CommunityMemberMeta, CommunityOfExpertiseInterface } from \"../../data/CommunityOfExpertiseInterface\";\nimport { CommunityOfExpertiseService } from \"../../data/CommunityOfExpertiseService\";\nimport { DataListRetriever, useDataListRetriever } from \"@carlonicora/nextjs-jsonapi/client\";\nimport { Button, ContentListTable, errorToast } from \"@carlonicora/nextjs-jsonapi/components\";\nimport { Modules, UserInterface } from \"@carlonicora/nextjs-jsonapi/core\";\nimport { isAdminRole } from \"../../../../../shared\";\nimport { useTranslations } from \"next-intl\";\nimport { ReactNode, useRef, useState } from \"react\";\n\ntype CommunityMemberRow = UserInterface & CommunityMemberMeta;\n\ntype CommunityMembersListProps = {\n communityOfExpertise: CommunityOfExpertiseInterface;\n /** `members` lists HAS_EXPERTISE (with its role), `managers` lists MANAGES. */\n variant?: \"members\" | \"managers\";\n propagateChanges?: (communityOfExpertise: CommunityOfExpertiseInterface) => void;\n};\n\n/**\n * People attached to a community of expertise.\n *\n * Rows come off the entity's own relationships (C4 has no\n * `communities-of-expertise/:id/members` read) and are refreshed with\n * `findOne` after a write. Shape copied from\n * ~/Development/neural-erp/.../LabourCategoryUsersList.tsx.\n */\nexport default function CommunityMembersList({\n communityOfExpertise,\n variant = \"members\",\n propagateChanges,\n}: CommunityMembersListProps) {\n const t = useTranslations();\n\n const pick = (value: CommunityOfExpertiseInterface): CommunityMemberRow[] =>\n (variant === \"managers\" ? (value.managers as CommunityMemberRow[]) : value.members) ?? [];\n\n const [users, setUsers] = useState<CommunityMemberRow[]>(pick(communityOfExpertise));\n const usersRef = useRef<CommunityMemberRow[]>(users);\n\n const data: DataListRetriever<UserInterface> = useDataListRetriever({\n module: Modules.User,\n retriever: async () => usersRef.current,\n retrieverParams: {},\n });\n\n const reload = async () => {\n const fresh = await CommunityOfExpertiseService.findOne({ id: communityOfExpertise.id });\n // The ref is updated before the refresh so the retriever closure reads the\n // new rows without waiting for React to re-render.\n usersRef.current = pick(fresh);\n setUsers(usersRef.current);\n propagateChanges?.(fresh);\n await data.refresh();\n };\n\n const remove = async (user: UserInterface) => {\n try {\n if (variant === \"managers\")\n await CommunityOfExpertiseService.removeManager({ id: communityOfExpertise.id, userId: user.id });\n else await CommunityOfExpertiseService.removeMember({ id: communityOfExpertise.id, userId: user.id });\n await reload();\n } catch (error) {\n errorToast({ title: t(`features.communityofexpertise.access.remove_error`), error });\n }\n };\n\n const adminCount = users.filter((user) => isAdminRole(user.role)).length;\n\n const context = {\n metaHeader: t(`features.communityofexpertise.roles.label`),\n renderMeta:\n variant === \"members\"\n ? (user: UserInterface) => (\n <CommunityRoleDropdown\n userId={user.id}\n role={(user as CommunityMemberRow).role}\n communityOfExpertiseId={communityOfExpertise.id}\n isEditable\n adminCount={adminCount}\n onChange={reload}\n />\n )\n : undefined,\n renderActions: (user: UserInterface) => (\n <Button variant=\"ghost\" size=\"sm\" onClick={() => remove(user)}>\n {t(`ui.buttons.remove`)}\n </Button>\n ),\n };\n\n const functions: ReactNode[] =\n variant === \"members\"\n ? [\n <AddUserToCommunityDialog\n key=\"add-user\"\n communityOfExpertiseId={communityOfExpertise.id}\n existingUserIds={users.map((user) => user.id)}\n onSuccess={reload}\n />,\n ]\n : [];\n\n return (\n <ContentListTable\n data={data}\n fields={\n variant === \"members\"\n ? [ExpertiseUserFields.name, ExpertiseUserFields.email, ExpertiseUserFields.meta, ExpertiseUserFields.actions]\n : [ExpertiseUserFields.name, ExpertiseUserFields.email, ExpertiseUserFields.actions]\n }\n tableGeneratorType={ExpertiseUsersTable}\n title={\n variant === \"managers\"\n ? t(`features.communityofexpertise.sections.managers`)\n : t(`features.communityofexpertise.sections.members`)\n }\n functions={functions}\n context={context}\n />\n );\n}\n","\"use client\";\n\nimport \"../../../common/hooks/useExpertiseUserTableStructure\";\n\nimport { ExpertiseUserFields, ExpertiseUsersTable } from \"../../../common/hooks/useExpertiseUserTableStructure\";\nimport { CommunityOfExpertiseInterface } from \"../../data/CommunityOfExpertiseInterface\";\nimport { CommunityOfExpertiseService } from \"../../data/CommunityOfExpertiseService\";\nimport { DataListRetriever, useDataListRetriever } from \"@carlonicora/nextjs-jsonapi/client\";\nimport { Button, ContentListTable, errorToast } from \"@carlonicora/nextjs-jsonapi/components\";\nimport { Modules, UserInterface } from \"@carlonicora/nextjs-jsonapi/core\";\nimport { useTranslations } from \"next-intl\";\nimport { useRef, useState } from \"react\";\n\ntype CommunityRequestsListProps = {\n communityOfExpertise: CommunityOfExpertiseInterface;\n propagateChanges?: (communityOfExpertise: CommunityOfExpertiseInterface) => void;\n};\n\n/** Pending `REQUESTED_ACCESS_TO` rows for one community, with approve / reject (spec §5.1). */\nexport default function CommunityRequestsList({ communityOfExpertise, propagateChanges }: CommunityRequestsListProps) {\n const t = useTranslations();\n\n const [requesters, setRequesters] = useState<UserInterface[]>(communityOfExpertise.requesters);\n const requestersRef = useRef<UserInterface[]>(requesters);\n\n const data: DataListRetriever<UserInterface> = useDataListRetriever({\n module: Modules.User,\n retriever: async () => requestersRef.current,\n retrieverParams: {},\n });\n\n const reload = async () => {\n const fresh = await CommunityOfExpertiseService.findOne({ id: communityOfExpertise.id });\n requestersRef.current = fresh.requesters;\n setRequesters(requestersRef.current);\n propagateChanges?.(fresh);\n await data.refresh();\n };\n\n const approve = async (user: UserInterface) => {\n try {\n await CommunityOfExpertiseService.approveAccess({ id: communityOfExpertise.id, userId: user.id });\n await reload();\n } catch (error) {\n errorToast({ title: t(`features.communityofexpertise.access.approve_error`), error });\n }\n };\n\n const reject = async (user: UserInterface) => {\n try {\n await CommunityOfExpertiseService.rejectAccess({ id: communityOfExpertise.id, userId: user.id });\n await reload();\n } catch (error) {\n errorToast({ title: t(`features.communityofexpertise.access.reject_error`), error });\n }\n };\n\n const context = {\n renderActions: (user: UserInterface) => (\n <>\n <Button variant=\"outline\" size=\"sm\" data-testid=\"access-request-approve\" onClick={() => approve(user)}>\n {t(`features.accessrequest.actions.approve`)}\n </Button>\n <Button variant=\"ghost\" size=\"sm\" data-testid=\"access-request-reject\" onClick={() => reject(user)}>\n {t(`features.accessrequest.actions.reject`)}\n </Button>\n </>\n ),\n };\n\n return (\n <ContentListTable\n data={data}\n fields={[ExpertiseUserFields.name, ExpertiseUserFields.email, ExpertiseUserFields.actions]}\n tableGeneratorType={ExpertiseUsersTable}\n title={t(`features.communityofexpertise.sections.requests`)}\n context={context}\n />\n );\n}\n","\"use client\";\n\nimport {\n Command,\n CommandItem,\n CommandList,\n FormFieldWrapper,\n Input,\n Popover,\n PopoverContent,\n PopoverTrigger,\n} from \"@carlonicora/nextjs-jsonapi/components\";\nimport { TaxonomyInterface } from \"../../data/TaxonomyInterface\";\nimport { TaxonomyService } from \"../../data/TaxonomyService\";\nimport { DataListRetriever, useDataListRetriever, useDebounce } from \"@carlonicora/nextjs-jsonapi/client\";\n\nimport { CircleX, RefreshCwIcon, SearchIcon, XIcon } from \"lucide-react\";\nimport { useTranslations } from \"next-intl\";\nimport { useCallback, useEffect, useRef, useState } from \"react\";\nimport { KnowledgeModules } from \"../../../../knowledge.registry\";\n\ntype TaxonomySelectorProps = {\n id: string;\n form: any;\n label?: string;\n placeholder?: string;\n onChange?: (taxonomy?: TaxonomyInterface) => void;\n isRequired?: boolean;\n};\n\nexport default function TaxonomySelector({\n id,\n form,\n label,\n placeholder,\n onChange,\n isRequired = false,\n}: TaxonomySelectorProps) {\n const t = useTranslations();\n\n const [open, setOpen] = useState<boolean>(false);\n\n const searchTermRef = useRef<string>(\"\");\n const [searchTerm, setSearchTerm] = useState<string>(\"\");\n\n const [isSearching, setIsSearching] = useState<boolean>(false);\n\n const data: DataListRetriever<TaxonomyInterface> = useDataListRetriever({\n retriever: (params) => {\n return TaxonomyService.findMany(params);\n },\n retrieverParams: {},\n module: KnowledgeModules.Taxonomy,\n });\n\n const search = useCallback(\n async (searchedTerm: string) => {\n try {\n if (searchedTerm === searchTermRef.current) return;\n setIsSearching(true);\n searchTermRef.current = searchedTerm;\n await data.search(searchedTerm);\n } finally {\n setIsSearching(false);\n }\n },\n [searchTermRef, data],\n );\n\n const updateSearchTerm = useDebounce(search, 500);\n\n useEffect(() => {\n setIsSearching(true);\n updateSearchTerm(searchTerm);\n }, [updateSearchTerm, searchTerm]);\n\n const setTaxonomy = (taxonomy?: TaxonomyInterface) => {\n if (onChange) onChange(taxonomy);\n if (!taxonomy) {\n form.setValue(id, undefined);\n setOpen(false);\n return;\n }\n\n form.setValue(id, { id: taxonomy.id, name: taxonomy.name });\n setOpen(false);\n\n setTimeout(() => {\n setOpen(false);\n }, 0);\n };\n\n return (\n <div className=\"flex w-full flex-col\">\n <FormFieldWrapper form={form} name={id} label={label} isRequired={isRequired}>\n {(field) => (\n <Popover open={open} onOpenChange={setOpen} modal={true}>\n <div className=\"flex w-full flex-row items-center justify-between\">\n <PopoverTrigger className=\"w-full\">\n <div className=\"flex w-full flex-row items-center justify-start rounded-md\">\n {field.value ? (\n <div className=\"bg-input/20 dark:bg-input/30 border-input flex h-7 w-full flex-row items-center justify-start rounded-md border px-2 py-0.5 text-sm md:text-xs/relaxed\">\n <span>{field.value?.name ?? \"\"}</span>\n </div>\n ) : (\n <div className=\"bg-input/20 dark:bg-input/30 border-input text-muted-foreground flex h-7 w-full flex-row items-center justify-start rounded-md border px-2 py-0.5 text-sm md:text-xs/relaxed\">\n {placeholder ?? t(`ui.search.placeholder`, { type: t(`entities.taxonomies`, { count: 1 }) })}\n </div>\n )}\n </div>\n </PopoverTrigger>\n {field.value && (\n <CircleX\n className=\"text-muted hover:text-destructive ms-2 h-4 w-4 shrink-0 cursor-pointer\"\n onClick={() => setTaxonomy()}\n />\n )}\n </div>\n <PopoverContent align=\"start\" className=\"w-(--anchor-width)\">\n <Command shouldFilter={false}>\n <div className=\"relative mb-2 w-full\">\n <SearchIcon className=\"text-muted-foreground absolute top-2.5 start-2.5 h-4 w-4\" />\n <Input\n placeholder={t(`ui.search.placeholder`, { type: t(`entities.taxonomies`, { count: 1 }) })}\n type=\"text\"\n className=\"w-full pe-8 ps-8\"\n onChange={(e) => setSearchTerm(e.target.value)}\n value={searchTerm}\n />\n {isSearching ? (\n <RefreshCwIcon className=\"text-muted-foreground absolute top-2.5 end-2.5 h-4 w-4 animate-spin\" />\n ) : searchTermRef.current ? (\n <XIcon\n className={`absolute top-2.5 end-2.5 h-4 w-4 ${searchTermRef.current ? \"cursor-pointer\" : \"text-muted-foreground\"}`}\n onClick={() => {\n setSearchTerm(\"\");\n search(\"\");\n }}\n />\n ) : (\n <></>\n )}\n </div>\n <CommandList>\n {data.data &&\n data.data.length > 0 &&\n (data.data as TaxonomyInterface[]).map((taxonomy: TaxonomyInterface) => (\n <CommandItem\n className=\"hover:bg-muted data-selected:hover:bg-muted cursor-pointer bg-transparent data-selected:bg-transparent\"\n key={taxonomy.id}\n onSelect={() => setTaxonomy(taxonomy)}\n >\n <span className=\"\">{taxonomy.name}</span>\n </CommandItem>\n ))}\n </CommandList>\n </Command>\n </PopoverContent>\n </Popover>\n )}\n </FormFieldWrapper>\n </div>\n );\n}\n","\"use client\";\n\nimport { TaxonomyInput, TaxonomyInterface } from \"../../data/TaxonomyInterface\";\nimport { TaxonomyService } from \"../../data/TaxonomyService\";\nimport TaxonomySelector from \"./TaxonomySelector\";\nimport CommunityOfExpertiseSelector from \"../../../community-of-expertise/components/forms/CommunityOfExpertiseSelector\";\nimport { useI18nRouter } from \"@carlonicora/nextjs-jsonapi/client\";\nimport { getKnowledgeUiConfig } from \"../../../../config/knowledge.ui.config\";\nimport { EditorSheet, FormBlockNote, FormInput } from \"@carlonicora/nextjs-jsonapi/components\";\nimport { useCurrentUserContext } from \"@carlonicora/nextjs-jsonapi/contexts\";\nimport { Action, entityObjectSchema } from \"@carlonicora/nextjs-jsonapi/core\";\nimport { zodResolver } from \"@hookform/resolvers/zod\";\nimport { useTranslations } from \"next-intl\";\nimport { ReactNode, useCallback, useMemo, useState } from \"react\";\nimport { useForm } from \"react-hook-form\";\nimport { v4 } from \"uuid\";\nimport { z } from \"zod\";\nimport { KnowledgeModules } from \"../../../../knowledge.registry\";\n\ntype TaxonomyEditorProps = {\n taxonomy?: TaxonomyInterface;\n propagateChanges?: (taxonomy: TaxonomyInterface) => void;\n trigger?: ReactNode;\n forceShow?: boolean;\n onClose?: () => void;\n dialogOpen?: boolean;\n onDialogOpenChange?: (open: boolean) => void;\n};\n\nfunction TaxonomyEditorInternal({\n taxonomy,\n propagateChanges,\n trigger,\n forceShow,\n onClose,\n dialogOpen,\n onDialogOpenChange,\n}: TaxonomyEditorProps) {\n const router = useI18nRouter();\n const t = useTranslations();\n\n const formSchema = useMemo(\n () =>\n z.object({\n id: z.uuidv4(),\n name: z.string().min(1, {\n message: t(`features.taxonomy.fields.name.error`),\n }),\n description: z.any(),\n parent: entityObjectSchema.optional(),\n communityOfExpertise: entityObjectSchema.refine((data) => data.id && data.id.length > 0, {\n message: t(`features.taxonomy.relationships.communityofexpertise.error`),\n }),\n }),\n [t],\n );\n\n const getDefaultValues = useCallback(\n () => ({\n id: taxonomy?.id || v4(),\n name: taxonomy?.name || \"\",\n description: taxonomy?.description || [],\n parent: taxonomy?.parent ? { id: taxonomy.parent.id, name: taxonomy.parent.name } : undefined,\n communityOfExpertise: taxonomy?.communityOfExpertise\n ? { id: taxonomy.communityOfExpertise.id, name: taxonomy.communityOfExpertise.name }\n : undefined,\n }),\n [taxonomy],\n );\n\n const form = useForm<z.infer<typeof formSchema>>({\n resolver: zodResolver(formSchema),\n defaultValues: getDefaultValues(),\n });\n\n // BlockNote reports a mount-time change for an empty editor, which would mark the field dirty and\n // trigger the discard dialog on an untouched form. Emptiness comes from `onEmptyChange`; an empty\n // rich-text field never counts as dirty (pattern: wyrdli ClueEditor / a360ai OpportunityEditor).\n const [isDescriptionEmpty, setIsDescriptionEmpty] = useState<boolean>(\n !taxonomy?.description || (Array.isArray(taxonomy.description) && taxonomy.description.length === 0),\n );\n const { dirtyFields } = form.formState;\n const isFormDirty = useCallback(() => {\n const dirty: Record<string, unknown> = { ...dirtyFields };\n if (dirty.description && isDescriptionEmpty) delete dirty.description;\n return Object.keys(dirty).length > 0;\n }, [dirtyFields, isDescriptionEmpty]);\n\n return (\n <EditorSheet\n form={form}\n entityType={t(`entities.taxonomies`, { count: 1 })}\n entityName={taxonomy?.name}\n isEdit={!!taxonomy}\n module={KnowledgeModules.Taxonomy}\n propagateChanges={propagateChanges}\n isFormDirty={isFormDirty}\n size=\"md\"\n onSubmit={async (values) => {\n const payload: TaxonomyInput = {\n id: values.id,\n name: values.name,\n description: values.description,\n parentId: values.parent?.id,\n communityOfExpertiseId: values.communityOfExpertise?.id,\n };\n\n return taxonomy ? await TaxonomyService.update(payload) : await TaxonomyService.create(payload);\n }}\n onRevalidate={getKnowledgeUiConfig().revalidatePaths}\n onNavigate={(url) => router.push(url)}\n onReset={() => {\n setIsDescriptionEmpty(\n !taxonomy?.description || (Array.isArray(taxonomy.description) && taxonomy.description.length === 0),\n );\n return getDefaultValues();\n }}\n onClose={onClose}\n trigger={trigger}\n forceShow={forceShow}\n dialogOpen={dialogOpen}\n onDialogOpenChange={onDialogOpenChange}\n >\n <div className=\"flex w-full flex-col gap-y-4\">\n <FormInput\n form={form}\n id=\"name\"\n name={t(`features.taxonomy.fields.name.label`)}\n placeholder={t(`features.taxonomy.fields.name.placeholder`)}\n isRequired\n />\n <FormBlockNote\n form={form}\n id=\"description\"\n name={t(`features.taxonomy.fields.description.label`)}\n placeholder={t(`features.taxonomy.fields.description.placeholder`)}\n type=\"taxonomy\"\n onEmptyChange={setIsDescriptionEmpty}\n />\n <TaxonomySelector\n id=\"parent\"\n form={form}\n label={t(`features.taxonomy.relationships.parent.label`)}\n placeholder={t(`features.taxonomy.relationships.parent.placeholder`)}\n />\n <CommunityOfExpertiseSelector\n id=\"communityOfExpertise\"\n form={form}\n label={t(`features.taxonomy.relationships.communityofexpertise.label`)}\n placeholder={t(`features.taxonomy.relationships.communityofexpertise.placeholder`)}\n isRequired\n />\n </div>\n </EditorSheet>\n );\n}\n\nexport default function TaxonomyEditor(props: TaxonomyEditorProps) {\n const { hasPermissionToModule } = useCurrentUserContext();\n const action = props.taxonomy ? Action.Update : Action.Create;\n\n if (!hasPermissionToModule({ module: KnowledgeModules.Taxonomy, action, data: props.taxonomy })) return null;\n\n return <TaxonomyEditorInternal {...props} />;\n}\n","\"use client\";\n\nimport { TaxonomyFields } from \"../data/TaxonomyFields\";\nimport { TaxonomyInterface } from \"../data/TaxonomyInterface\";\nimport { cellDate, cellId } from \"@carlonicora/nextjs-jsonapi/components\";\nimport {\n registerTableGenerator,\n TableContent,\n usePageUrlGenerator,\n UseTableStructureHook,\n} from \"@carlonicora/nextjs-jsonapi/client\";\nimport { Link, Tooltip, TooltipContent, TooltipTrigger } from \"@carlonicora/nextjs-jsonapi/components\";\nimport { resolveField } from \"../../../common/i18n/translationResolver\";\nimport { useContentLanguage } from \"../../../common/hooks/useContentLanguage\";\nimport { ColumnDef } from \"@tanstack/react-table\";\nimport { useTranslations } from \"next-intl\";\nimport { useMemo } from \"react\";\nimport { KnowledgeModules } from \"../../../knowledge.registry\";\n\nexport const useTaxonomyTableStructure: UseTableStructureHook<TaxonomyInterface, TaxonomyFields> = (params) => {\n const t = useTranslations();\n const generateUrl = usePageUrlGenerator();\n const language = useContentLanguage();\n\n const tableData = useMemo(() => {\n return params.data.map((taxonomy: TaxonomyInterface) => {\n const entry: TableContent<TaxonomyInterface> = {\n jsonApiData: taxonomy,\n };\n entry[TaxonomyFields.taxonomyId] = taxonomy.id;\n params.fields.forEach((field) => {\n entry[field] = taxonomy[field as keyof TaxonomyInterface];\n });\n return entry;\n });\n }, [params.data, params.fields]);\n\n const fieldColumnMap: Partial<Record<TaxonomyFields, () => any>> = {\n [TaxonomyFields.taxonomyId]: () =>\n cellId({\n name: \"taxonomyId\",\n checkedIds: params.checkedIds,\n toggleId: params.toggleId,\n }),\n [TaxonomyFields.name]: () => ({\n id: \"name\",\n accessorKey: \"name\",\n header: t(`features.taxonomy.fields.name.label`),\n cell: ({ row }: { row: TableContent<TaxonomyInterface> }) => {\n const taxonomy: TaxonomyInterface = row.original.jsonApiData;\n // Stored translations win over the original text for the reader's language (C9).\n const name = resolveField({\n original: taxonomy.name,\n translation: taxonomy.translation,\n field: \"name\",\n language,\n });\n return (\n <Tooltip>\n <TooltipTrigger>\n {KnowledgeModules.Taxonomy.pageUrl ? (\n <Link href={generateUrl({ page: KnowledgeModules.Taxonomy, id: taxonomy.id })}>{name}</Link>\n ) : (\n <span>{name}</span>\n )}\n </TooltipTrigger>\n <TooltipContent>{name}</TooltipContent>\n </Tooltip>\n );\n },\n enableSorting: false,\n enableHiding: false,\n }),\n [TaxonomyFields.parent]: () => ({\n id: \"parent\",\n accessorKey: \"parent\",\n header: t(`features.taxonomy.relationships.parent.label`),\n cell: ({ row }: { row: TableContent<TaxonomyInterface> }) => {\n const taxonomy: TaxonomyInterface = row.original.jsonApiData;\n return <span>{taxonomy.parent?.name ?? \"\"}</span>;\n },\n enableSorting: false,\n enableHiding: false,\n }),\n [TaxonomyFields.communityOfExpertise]: () => ({\n id: \"communityOfExpertise\",\n accessorKey: \"communityOfExpertise\",\n header: t(`features.taxonomy.relationships.communityofexpertise.label`),\n cell: ({ row }: { row: TableContent<TaxonomyInterface> }) => {\n const taxonomy: TaxonomyInterface = row.original.jsonApiData;\n return <span>{taxonomy.communityOfExpertise?.name ?? \"\"}</span>;\n },\n enableSorting: false,\n enableHiding: false,\n }),\n [TaxonomyFields.createdAt]: () =>\n cellDate({\n name: \"createdAt\",\n title: t(`common.date.create`),\n }),\n [TaxonomyFields.updatedAt]: () =>\n cellDate({\n name: \"updatedAt\",\n title: t(`common.date.update`),\n }),\n };\n\n const columns = useMemo(() => {\n return params.fields.map((field) => fieldColumnMap[field]?.()).filter((col) => col !== undefined) as ColumnDef<\n TableContent<TaxonomyInterface>\n >[];\n }, [params.fields, fieldColumnMap, t, generateUrl, language]);\n\n return useMemo(() => ({ data: tableData, columns: columns }), [tableData, columns]);\n};\n\nregisterTableGenerator(KnowledgeModules.Taxonomy, useTaxonomyTableStructure);\n","\"use client\";\n\nimport TaxonomyEditor from \"../forms/TaxonomyEditor\";\nimport { TaxonomyFields } from \"../../data/TaxonomyFields\";\nimport { TaxonomyInterface } from \"../../data/TaxonomyInterface\";\nimport { TaxonomyService } from \"../../data/TaxonomyService\";\nimport \"../../hooks/useTaxonomyTableStructure\";\nimport type { CommunityOfExpertiseInterface } from \"../../../community-of-expertise/data/CommunityOfExpertiseInterface\";\nimport { ContentListTable } from \"@carlonicora/nextjs-jsonapi/components\";\nimport { DataListRetriever, useDataListRetriever } from \"@carlonicora/nextjs-jsonapi/client\";\nimport { useTranslations } from \"next-intl\";\nimport { ReactNode } from \"react\";\nimport { KnowledgeModules } from \"../../../../knowledge.registry\";\n\n// The parent props are hand-added: the generated container renders this list inside a\n// relation tab (`containerTabs.relations`), and the generator does not emit the props\n// that tab passes. Shape copied from ~/Development/wyrdli ClueList.\ntype TaxonomyListProps = {\n fullWidth?: boolean;\n parent?: TaxonomyInterface;\n communityOfExpertise?: CommunityOfExpertiseInterface;\n};\n\nexport default function TaxonomyList({ fullWidth, parent, communityOfExpertise }: TaxonomyListProps) {\n const t = useTranslations();\n\n const data: DataListRetriever<TaxonomyInterface> = useDataListRetriever({\n module: KnowledgeModules.Taxonomy,\n retriever: (params: any) => {\n if (parent) return TaxonomyService.findManyByParent({ ...params, parentId: parent.id });\n if (communityOfExpertise)\n return TaxonomyService.findManyByCommunityOfExpertise({\n ...params,\n communityOfExpertiseId: communityOfExpertise.id,\n });\n return TaxonomyService.findMany(params);\n },\n retrieverParams: {},\n });\n\n const functions: ReactNode[] = [<TaxonomyEditor key=\"create-taxonomy\" />];\n\n return (\n <ContentListTable\n data={data}\n fields={[TaxonomyFields.name, TaxonomyFields.parent, TaxonomyFields.updatedAt]}\n tableGeneratorType={KnowledgeModules.Taxonomy}\n functions={functions}\n title={t(`entities.taxonomies`, { count: 2 })}\n fullWidth={fullWidth}\n />\n );\n}\n","\"use client\";\n\nimport TranslationsTab from \"../../../../common/components/translations/TranslationsTab\";\nimport ArticleList from \"../../../../content/article/components/lists/ArticleList\";\nimport DiscussionList from \"../../../../content/discussion/components/lists/DiscussionList\";\nimport DocumentList from \"../../../../content/document/components/lists/DocumentList\";\nimport { CommunityOfExpertiseContent } from \"../details/CommunityOfExpertiseContent\";\nimport CommunityMembersList from \"../lists/CommunityMembersList\";\nimport CommunityRequestsList from \"../lists/CommunityRequestsList\";\nimport { useCommunityOfExpertiseContext } from \"../../contexts/CommunityOfExpertiseContext\";\nimport { CommunityOfExpertiseInterface } from \"../../data/CommunityOfExpertiseInterface\";\nimport { CommunityOfExpertiseService } from \"../../data/CommunityOfExpertiseService\";\nimport TaxonomyList from \"../../../taxonomy/components/lists/TaxonomyList\";\nimport { RoundPageContainer, Tab } from \"@carlonicora/nextjs-jsonapi/components\";\nimport { useCurrentUserContext } from \"@carlonicora/nextjs-jsonapi/contexts\";\nimport { Action } from \"@carlonicora/nextjs-jsonapi/core\";\nimport { useTranslations } from \"next-intl\";\nimport { KnowledgeModules } from \"../../../../knowledge.registry\";\n\ntype CommunityOfExpertiseContainerProps = {\n communityOfExpertise: CommunityOfExpertiseInterface;\n setCommunityOfExpertise: (communityOfExpertise: CommunityOfExpertiseInterface | undefined) => void;\n};\n\nfunction CommunityOfExpertiseContainerInternal({\n communityOfExpertise,\n setCommunityOfExpertise,\n}: CommunityOfExpertiseContainerProps) {\n const t = useTranslations();\n\n // Tab shape copied from ~/Development/wyrdli/.../ThreatContainer.tsx.\n const tabs: Tab[] = [\n {\n sectionKey: \"details\",\n label: t(`features.communityofexpertise.sections.details`),\n content: <CommunityOfExpertiseContent communityOfExpertise={communityOfExpertise} />,\n },\n {\n key: KnowledgeModules.Taxonomy,\n label: t(`entities.taxonomies`, { count: 2 }),\n content: <TaxonomyList communityOfExpertise={communityOfExpertise} />,\n },\n {\n key: KnowledgeModules.Document,\n label: t(`entities.documents`, { count: 2 }),\n content: <DocumentList communityOfExpertise={communityOfExpertise} />,\n },\n {\n key: KnowledgeModules.Article,\n label: t(`entities.articles`, { count: 2 }),\n content: <ArticleList communityOfExpertise={communityOfExpertise} />,\n },\n {\n key: KnowledgeModules.Discussion,\n label: t(`entities.discussions`, { count: 2 }),\n content: <DiscussionList communityOfExpertise={communityOfExpertise} />,\n },\n {\n sectionKey: \"members\",\n label: t(`features.communityofexpertise.sections.members`),\n content: (\n <CommunityMembersList\n communityOfExpertise={communityOfExpertise}\n variant=\"members\"\n propagateChanges={setCommunityOfExpertise}\n />\n ),\n },\n {\n sectionKey: \"managers\",\n label: t(`features.communityofexpertise.sections.managers`),\n content: (\n <CommunityMembersList\n communityOfExpertise={communityOfExpertise}\n variant=\"managers\"\n propagateChanges={setCommunityOfExpertise}\n />\n ),\n },\n {\n sectionKey: \"requests\",\n label: t(`features.communityofexpertise.sections.requests`),\n content: (\n <CommunityRequestsList communityOfExpertise={communityOfExpertise} propagateChanges={setCommunityOfExpertise} />\n ),\n },\n {\n sectionKey: \"translations\",\n label: t(`features.translations.title`),\n contentLabel: <span data-testid=\"translations-tab\">{t(`features.translations.title`)}</span>,\n content: (\n <TranslationsTab\n entity={{ id: communityOfExpertise.id, translation: communityOfExpertise.translation }}\n fields={[\"name\", \"description\"]}\n onSave={async (language, fields) => {\n setCommunityOfExpertise(\n await CommunityOfExpertiseService.patchTranslations({ id: communityOfExpertise.id, language, fields }),\n );\n }}\n />\n ),\n },\n ];\n\n return <RoundPageContainer module={KnowledgeModules.CommunityOfExpertise} id={communityOfExpertise.id} tabs={tabs} />;\n}\n\nexport default function CommunityOfExpertiseContainer() {\n const { hasPermissionToModule } = useCurrentUserContext();\n const { communityOfExpertise, setCommunityOfExpertise } = useCommunityOfExpertiseContext();\n if (!communityOfExpertise) return null;\n if (\n !hasPermissionToModule({\n module: KnowledgeModules.CommunityOfExpertise,\n action: Action.Read,\n data: communityOfExpertise,\n })\n )\n return null;\n return (\n <CommunityOfExpertiseContainerInternal\n communityOfExpertise={communityOfExpertise}\n setCommunityOfExpertise={setCommunityOfExpertise}\n />\n );\n}\n","\"use client\";\n\nimport { CommunityOfExpertiseInterface } from \"../../data/CommunityOfExpertiseInterface\";\nimport { CommunityOfExpertiseService } from \"../../data/CommunityOfExpertiseService\";\nimport { EntityMultiSelector } from \"@carlonicora/nextjs-jsonapi/components\";\nimport { useTranslations } from \"next-intl\";\nimport { KnowledgeModules } from \"../../../../knowledge.registry\";\n\ntype CommunityOfExpertiseMultiSelectorProps = {\n id: string;\n form: any;\n currentCommunityOfExpertise?: CommunityOfExpertiseInterface;\n label?: string;\n placeholder?: string;\n onChange?: (communityOfExpertises?: CommunityOfExpertiseInterface[]) => void;\n maxCount?: number;\n isRequired?: boolean;\n};\n\nexport default function CommunityOfExpertiseMultiSelector({\n id,\n form,\n currentCommunityOfExpertise,\n label,\n placeholder,\n onChange,\n isRequired = false,\n}: CommunityOfExpertiseMultiSelectorProps) {\n const t = useTranslations();\n\n return (\n <EntityMultiSelector<CommunityOfExpertiseInterface>\n id={id}\n form={form}\n label={label}\n placeholder={placeholder || t(\"ui.search.button\")}\n emptyText={t(\"ui.search.no_results_generic\")}\n isRequired={isRequired}\n retriever={(params) => CommunityOfExpertiseService.findMany(params)}\n module={KnowledgeModules.CommunityOfExpertise}\n getLabel={(communityOfExpertise) => communityOfExpertise.name}\n excludeId={currentCommunityOfExpertise?.id}\n onChange={onChange}\n />\n );\n}\n","\"use client\";\n\nimport { CommunityOfExpertiseProvider } from \"../../contexts/CommunityOfExpertiseContext\";\nimport CommunityOfExpertiseListContainer from \"../containers/CommunityOfExpertiseListContainer\";\n\nexport function CommunityOfExpertiseListScreen() {\n return (\n <CommunityOfExpertiseProvider>\n <CommunityOfExpertiseListContainer />\n </CommunityOfExpertiseProvider>\n );\n}\n","\"use client\";\n\nimport type { JsonApiHydratedDataInterface } from \"@carlonicora/nextjs-jsonapi/core\";\nimport { CommunityOfExpertiseProvider } from \"../../contexts/CommunityOfExpertiseContext\";\nimport CommunityOfExpertiseContainer from \"../containers/CommunityOfExpertiseContainer\";\n\nexport function CommunityOfExpertiseDetailScreen({\n dehydratedCommunityOfExpertise,\n}: {\n dehydratedCommunityOfExpertise: JsonApiHydratedDataInterface;\n}) {\n return (\n <CommunityOfExpertiseProvider dehydratedCommunityOfExpertise={dehydratedCommunityOfExpertise}>\n <CommunityOfExpertiseContainer />\n </CommunityOfExpertiseProvider>\n );\n}\n","\"use client\";\n\nimport { TaxonomyInterface } from \"../../data/TaxonomyInterface\";\nimport { TaxonomyService } from \"../../data/TaxonomyService\";\nimport { CommonDeleter } from \"@carlonicora/nextjs-jsonapi/components\";\nimport { usePageUrlGenerator } from \"@carlonicora/nextjs-jsonapi/client\";\n\nimport { useTranslations } from \"next-intl\";\nimport { KnowledgeModules } from \"../../../../knowledge.registry\";\n\ntype TaxonomyDeleterProps = {\n taxonomy: TaxonomyInterface;\n};\n\nfunction TaxonomyDeleterInternal({ taxonomy }: TaxonomyDeleterProps) {\n const t = useTranslations();\n const generateUrl = usePageUrlGenerator();\n\n if (!taxonomy) return null;\n\n return (\n <CommonDeleter\n type={`taxonomies`}\n deleteFunction={() => TaxonomyService.delete({ taxonomyId: taxonomy.id })}\n redirectTo={KnowledgeModules.Taxonomy.pageUrl ? generateUrl({ page: KnowledgeModules.Taxonomy }) : undefined}\n />\n );\n}\n\nexport default function TaxonomyDeleter(props: TaxonomyDeleterProps) {\n return <TaxonomyDeleterInternal {...props} />;\n}\n","\"use client\";\n\nimport TaxonomyDeleter from \"../components/forms/TaxonomyDeleter\";\nimport TaxonomyEditor from \"../components/forms/TaxonomyEditor\";\nimport { useContentLanguage } from \"../../../common/hooks/useContentLanguage\";\nimport { resolveField } from \"../../../common/i18n/translationResolver\";\nimport { TaxonomyInterface } from \"../data/TaxonomyInterface\";\nimport { TaxonomyService } from \"../data/TaxonomyService\";\nimport { SharedProvider } from \"@carlonicora/nextjs-jsonapi/contexts\";\nimport { usePageUrlGenerator } from \"@carlonicora/nextjs-jsonapi/client\";\nimport { BreadcrumbItemData } from \"@carlonicora/nextjs-jsonapi/core\";\n\nimport { JsonApiHydratedDataInterface, rehydrate } from \"@carlonicora/nextjs-jsonapi/core\";\nimport { useTranslations } from \"next-intl\";\nimport { createContext, ReactNode, useContext, useState } from \"react\";\nimport { KnowledgeModules } from \"../../../knowledge.registry\";\n\ninterface TaxonomyContextType {\n taxonomy: TaxonomyInterface | undefined;\n setTaxonomy: (value: TaxonomyInterface | undefined) => void;\n reloadTaxonomy: () => Promise<void>;\n}\n\nconst TaxonomyContext = createContext<TaxonomyContextType | undefined>(undefined);\n\ntype TaxonomyProviderProps = {\n children: ReactNode;\n dehydratedTaxonomy?: JsonApiHydratedDataInterface;\n};\n\nexport const TaxonomyProvider = ({ children, dehydratedTaxonomy }: TaxonomyProviderProps) => {\n const generateUrl = usePageUrlGenerator();\n const t = useTranslations();\n const language = useContentLanguage();\n\n const [taxonomy, setTaxonomy] = useState<TaxonomyInterface | undefined>(\n dehydratedTaxonomy ? rehydrate<TaxonomyInterface>(KnowledgeModules.Taxonomy, dehydratedTaxonomy) : undefined,\n );\n\n const reloadTaxonomy = async () => {\n if (!taxonomy) return;\n\n const freshTaxonomy = await TaxonomyService.findOne({ id: taxonomy.id });\n setTaxonomy(freshTaxonomy);\n };\n\n const breadcrumb = () => {\n const response: BreadcrumbItemData[] = [];\n\n response.push({\n name: t(`entities.taxonomies`, { count: 2 }),\n href: KnowledgeModules.Taxonomy.pageUrl ? generateUrl({ page: KnowledgeModules.Taxonomy }) : undefined,\n });\n\n if (taxonomy)\n response.push({\n name: taxonomy.name,\n href: KnowledgeModules.Taxonomy.pageUrl\n ? generateUrl({ page: KnowledgeModules.Taxonomy, id: taxonomy.id })\n : undefined,\n });\n\n return response;\n };\n\n const title = () => {\n const response: any = {\n type: t(`entities.taxonomies`, { count: taxonomy ? 1 : 2 }),\n };\n\n const functions: ReactNode[] = [];\n\n if (taxonomy) {\n // The hero title resolves the stored translation for the reader's language,\n // the same way the list cells and the details body do (C9).\n response.element = resolveField({\n original: taxonomy.name,\n translation: taxonomy.translation,\n field: \"name\",\n language,\n });\n\n functions.push(<TaxonomyDeleter key={`TaxonomyDeleter`} taxonomy={taxonomy} />);\n functions.push(<TaxonomyEditor key={`TaxonomyEditor`} taxonomy={taxonomy} propagateChanges={setTaxonomy} />);\n } else {\n functions.push(<TaxonomyEditor key={`TaxonomyEditor`} />);\n }\n\n if (functions.length > 0) response.functions = functions;\n\n return response;\n };\n\n return (\n <SharedProvider value={{ breadcrumbs: breadcrumb(), title: title() }}>\n <TaxonomyContext.Provider\n value={{\n taxonomy: taxonomy,\n setTaxonomy: setTaxonomy,\n reloadTaxonomy: reloadTaxonomy,\n }}\n >\n {children}\n </TaxonomyContext.Provider>\n </SharedProvider>\n );\n};\n\nexport const useTaxonomyContext = (): TaxonomyContextType => {\n const context = useContext(TaxonomyContext);\n if (context === undefined) {\n throw new Error(\"useTaxonomyContext must be used within a TaxonomyProvider\");\n }\n return context;\n};\n","\"use client\";\n\nimport TaxonomyList from \"../lists/TaxonomyList\";\nimport { RoundPageContainer } from \"@carlonicora/nextjs-jsonapi/components\";\nimport { KnowledgeModules } from \"../../../../knowledge.registry\";\n\nfunction TaxonomyListContainerInternal() {\n return (\n <RoundPageContainer module={KnowledgeModules.Taxonomy} fullWidth>\n <TaxonomyList fullWidth />\n </RoundPageContainer>\n );\n}\n\nexport default function TaxonomyListContainer() {\n return <TaxonomyListContainerInternal />;\n}\n","\"use client\";\n\nimport { resolveField } from \"../../../../common/i18n/translationResolver\";\nimport { useContentLanguage } from \"../../../../common/hooks/useContentLanguage\";\nimport { resolveBlockNoteField } from \"../../../common/i18n/resolveBlockNoteField\";\nimport { TaxonomyInterface } from \"../../data/TaxonomyInterface\";\nimport { AttributeElement, BlockNoteEditorContainer, Card, MicroLabel } from \"@carlonicora/nextjs-jsonapi/components\";\nimport { useTranslations } from \"next-intl\";\n\ntype TaxonomyContentProps = { taxonomy: TaxonomyInterface };\n\nexport function TaxonomyContent({ taxonomy }: TaxonomyContentProps) {\n const t = useTranslations();\n const language = useContentLanguage();\n\n // Stored translations win over the original text for the reader's language (C9).\n const description = resolveBlockNoteField({\n original: taxonomy.description,\n translation: taxonomy.translation,\n field: \"description\",\n language,\n });\n\n return (\n <div className=\"flex flex-col gap-y-8\">\n <div className=\"flex flex-col gap-y-3\">\n <MicroLabel>{t(`features.taxonomy.fields.description.label`)}</MicroLabel>\n <Card className=\"flex w-full flex-col p-4\">\n <BlockNoteEditorContainer id={taxonomy.id} type=\"taxonomy\" initialContent={description} />\n </Card>\n </div>\n <div className=\"flex flex-col gap-y-3\">\n <MicroLabel>{t(`features.taxonomy.sections.details`)}</MicroLabel>\n <div className=\"grid grid-cols-1 gap-4 md:grid-cols-3\">\n {taxonomy.parent && (\n <AttributeElement\n title={t(`features.taxonomy.relationships.parent.label`)}\n value={resolveField({\n original: taxonomy.parent.name,\n translation: taxonomy.parent.translation,\n field: \"name\",\n language,\n })}\n />\n )}\n {taxonomy.communityOfExpertise && (\n <AttributeElement\n title={t(`features.taxonomy.relationships.communityofexpertise.label`)}\n value={resolveField({\n original: taxonomy.communityOfExpertise.name,\n translation: taxonomy.communityOfExpertise.translation,\n field: \"name\",\n language,\n })}\n />\n )}\n </div>\n </div>\n </div>\n );\n}\n","\"use client\";\n\nimport TranslationsTab from \"../../../../common/components/translations/TranslationsTab\";\nimport ArticleList from \"../../../../content/article/components/lists/ArticleList\";\nimport DiscussionList from \"../../../../content/discussion/components/lists/DiscussionList\";\nimport DocumentList from \"../../../../content/document/components/lists/DocumentList\";\nimport { TaxonomyContent } from \"../details/TaxonomyContent\";\nimport TaxonomyList from \"../lists/TaxonomyList\";\nimport { useTaxonomyContext } from \"../../contexts/TaxonomyContext\";\nimport { TaxonomyInterface } from \"../../data/TaxonomyInterface\";\nimport { TaxonomyService } from \"../../data/TaxonomyService\";\nimport { RoundPageContainer, Tab } from \"@carlonicora/nextjs-jsonapi/components\";\nimport { useCurrentUserContext } from \"@carlonicora/nextjs-jsonapi/contexts\";\nimport { Action } from \"@carlonicora/nextjs-jsonapi/core\";\nimport { useTranslations } from \"next-intl\";\nimport { getKnowledgeUiConfig } from \"../../../../config/knowledge.ui.config\";\nimport { KnowledgeModules } from \"../../../../knowledge.registry\";\n\ntype TaxonomyContainerProps = {\n taxonomy: TaxonomyInterface;\n setTaxonomy: (taxonomy: TaxonomyInterface | undefined) => void;\n};\n\nfunction TaxonomyContainerInternal({ taxonomy, setTaxonomy }: TaxonomyContainerProps) {\n const t = useTranslations();\n\n // Tab shape copied from ~/Development/wyrdli/.../ThreatContainer.tsx.\n const tabs: Tab[] = [\n {\n sectionKey: \"details\",\n label: t(`features.taxonomy.sections.details`),\n content: <TaxonomyContent taxonomy={taxonomy} />,\n },\n {\n key: KnowledgeModules.Taxonomy,\n label: t(`entities.taxonomies`, { count: 2 }),\n content: <TaxonomyList parent={taxonomy} />,\n },\n {\n key: KnowledgeModules.Document,\n label: t(`entities.documents`, { count: 2 }),\n content: <DocumentList taxonomy={taxonomy} />,\n },\n {\n key: KnowledgeModules.Article,\n label: t(`entities.articles`, { count: 2 }),\n content: <ArticleList taxonomy={taxonomy} />,\n },\n {\n key: KnowledgeModules.Discussion,\n label: t(`entities.discussions`, { count: 2 }),\n content: <DiscussionList taxonomy={taxonomy} />,\n },\n // Tabs the app adds, just before Translations.\n ...(getKnowledgeUiConfig().tabs?.taxonomy?.(taxonomy, t) ?? []),\n {\n sectionKey: \"translations\",\n label: t(`features.translations.title`),\n contentLabel: <span data-testid=\"translations-tab\">{t(`features.translations.title`)}</span>,\n content: (\n <TranslationsTab\n entity={{ id: taxonomy.id, translation: taxonomy.translation }}\n fields={[\"name\", \"description\"]}\n onSave={async (language, fields) => {\n setTaxonomy(await TaxonomyService.patchTranslations({ id: taxonomy.id, language, fields }));\n }}\n />\n ),\n },\n ];\n\n return <RoundPageContainer module={KnowledgeModules.Taxonomy} id={taxonomy.id} tabs={tabs} />;\n}\n\nexport default function TaxonomyContainer() {\n const { hasPermissionToModule } = useCurrentUserContext();\n const { taxonomy, setTaxonomy } = useTaxonomyContext();\n if (!taxonomy) return null;\n if (!hasPermissionToModule({ module: KnowledgeModules.Taxonomy, action: Action.Read, data: taxonomy })) return null;\n return <TaxonomyContainerInternal taxonomy={taxonomy} setTaxonomy={setTaxonomy} />;\n}\n","\"use client\";\n\nimport { TaxonomyProvider } from \"../../contexts/TaxonomyContext\";\nimport TaxonomyListContainer from \"../containers/TaxonomyListContainer\";\n\nexport function TaxonomyListScreen() {\n return (\n <TaxonomyProvider>\n <TaxonomyListContainer />\n </TaxonomyProvider>\n );\n}\n","\"use client\";\n\nimport type { JsonApiHydratedDataInterface } from \"@carlonicora/nextjs-jsonapi/core\";\nimport { TaxonomyProvider } from \"../../contexts/TaxonomyContext\";\nimport TaxonomyContainer from \"../containers/TaxonomyContainer\";\n\nexport function TaxonomyDetailScreen({ dehydratedTaxonomy }: { dehydratedTaxonomy: JsonApiHydratedDataInterface }) {\n return (\n <TaxonomyProvider dehydratedTaxonomy={dehydratedTaxonomy}>\n <TaxonomyContainer />\n </TaxonomyProvider>\n );\n}\n","\"use client\";\n\nimport { SkillInterface } from \"../../data/SkillInterface\";\nimport { SkillService } from \"../../data/SkillService\";\nimport { CommonDeleter } from \"@carlonicora/nextjs-jsonapi/components\";\nimport { usePageUrlGenerator } from \"@carlonicora/nextjs-jsonapi/client\";\n\nimport { useTranslations } from \"next-intl\";\nimport { KnowledgeModules } from \"../../../../knowledge.registry\";\n\ntype SkillDeleterProps = {\n skill: SkillInterface;\n};\n\nfunction SkillDeleterInternal({ skill }: SkillDeleterProps) {\n const t = useTranslations();\n const generateUrl = usePageUrlGenerator();\n\n if (!skill) return null;\n\n return (\n <CommonDeleter\n type={`skills`}\n deleteFunction={() => SkillService.delete({ skillId: skill.id })}\n redirectTo={\n KnowledgeModules.ExpertiseSkill.pageUrl ? generateUrl({ page: KnowledgeModules.ExpertiseSkill }) : undefined\n }\n />\n );\n}\n\nexport default function SkillDeleter(props: SkillDeleterProps) {\n return <SkillDeleterInternal {...props} />;\n}\n","\"use client\";\n\nimport { SkillInput, SkillInterface } from \"../../data/SkillInterface\";\nimport { SkillService } from \"../../data/SkillService\";\nimport TaxonomyMultiSelector from \"../../../taxonomy/components/forms/TaxonomyMultiSelector\";\nimport { useI18nRouter } from \"@carlonicora/nextjs-jsonapi/client\";\nimport { getKnowledgeUiConfig } from \"../../../../config/knowledge.ui.config\";\nimport { EditorSheet, FormBlockNote, FormInput } from \"@carlonicora/nextjs-jsonapi/components\";\nimport { useCurrentUserContext } from \"@carlonicora/nextjs-jsonapi/contexts\";\nimport { Action, entityObjectSchema } from \"@carlonicora/nextjs-jsonapi/core\";\nimport { zodResolver } from \"@hookform/resolvers/zod\";\nimport { useTranslations } from \"next-intl\";\nimport { ReactNode, useCallback, useMemo, useState } from \"react\";\nimport { useForm } from \"react-hook-form\";\nimport { v4 } from \"uuid\";\nimport { z } from \"zod\";\nimport { KnowledgeModules } from \"../../../../knowledge.registry\";\n\ntype SkillEditorProps = {\n skill?: SkillInterface;\n propagateChanges?: (skill: SkillInterface) => void;\n trigger?: ReactNode;\n forceShow?: boolean;\n onClose?: () => void;\n dialogOpen?: boolean;\n onDialogOpenChange?: (open: boolean) => void;\n};\n\nfunction SkillEditorInternal({\n skill,\n propagateChanges,\n trigger,\n forceShow,\n onClose,\n dialogOpen,\n onDialogOpenChange,\n}: SkillEditorProps) {\n const router = useI18nRouter();\n const t = useTranslations();\n\n const formSchema = useMemo(\n () =>\n z.object({\n id: z.uuidv4(),\n name: z.string().min(1, {\n message: t(`features.skill.fields.name.error`),\n }),\n description: z.any(),\n image: z.string().optional(),\n taxonomy: z.array(entityObjectSchema).optional(),\n }),\n [t],\n );\n\n const getDefaultValues = useCallback(\n () => ({\n id: skill?.id || v4(),\n name: skill?.name || \"\",\n description: skill?.description || [],\n image: skill?.image || \"\",\n taxonomy: skill?.taxonomies ? skill.taxonomies.map((item) => ({ id: item.id, name: item.name })) : [],\n }),\n [skill],\n );\n\n const form = useForm<z.infer<typeof formSchema>>({\n resolver: zodResolver(formSchema),\n defaultValues: getDefaultValues(),\n });\n\n // BlockNote reports a mount-time change for an empty editor, which would mark the field dirty and\n // trigger the discard dialog on an untouched form. Emptiness comes from `onEmptyChange`; an empty\n // rich-text field never counts as dirty (pattern: wyrdli ClueEditor / a360ai OpportunityEditor).\n const [isDescriptionEmpty, setIsDescriptionEmpty] = useState<boolean>(\n !skill?.description || (Array.isArray(skill.description) && skill.description.length === 0),\n );\n const { dirtyFields } = form.formState;\n const isFormDirty = useCallback(() => {\n const dirty: Record<string, unknown> = { ...dirtyFields };\n if (dirty.description && isDescriptionEmpty) delete dirty.description;\n return Object.keys(dirty).length > 0;\n }, [dirtyFields, isDescriptionEmpty]);\n\n return (\n <EditorSheet\n form={form}\n entityType={t(`entities.skills`, { count: 1 })}\n entityName={skill?.name}\n isEdit={!!skill}\n module={KnowledgeModules.ExpertiseSkill}\n propagateChanges={propagateChanges}\n isFormDirty={isFormDirty}\n size=\"md\"\n onSubmit={async (values) => {\n const payload: SkillInput = {\n id: values.id,\n name: values.name,\n description: values.description,\n image: values.image,\n taxonomyIds: values.taxonomy ? values.taxonomy.map((item) => item.id) : [],\n };\n\n return skill ? await SkillService.update(payload) : await SkillService.create(payload);\n }}\n onRevalidate={getKnowledgeUiConfig().revalidatePaths}\n onNavigate={(url) => router.push(url)}\n onReset={() => {\n setIsDescriptionEmpty(\n !skill?.description || (Array.isArray(skill.description) && skill.description.length === 0),\n );\n return getDefaultValues();\n }}\n onClose={onClose}\n trigger={trigger}\n forceShow={forceShow}\n dialogOpen={dialogOpen}\n onDialogOpenChange={onDialogOpenChange}\n >\n <div className=\"flex w-full flex-col gap-y-4\">\n <FormInput\n form={form}\n id=\"name\"\n name={t(`features.skill.fields.name.label`)}\n placeholder={t(`features.skill.fields.name.placeholder`)}\n isRequired\n />\n <FormBlockNote\n form={form}\n id=\"description\"\n name={t(`features.skill.fields.description.label`)}\n placeholder={t(`features.skill.fields.description.placeholder`)}\n type=\"skill\"\n onEmptyChange={setIsDescriptionEmpty}\n />\n <FormInput\n form={form}\n id=\"image\"\n name={t(`features.skill.fields.image.label`)}\n placeholder={t(`features.skill.fields.image.placeholder`)}\n />\n <TaxonomyMultiSelector id=\"taxonomy\" form={form} label={t(`entities.taxonomies`, { count: 2 })} />\n </div>\n </EditorSheet>\n );\n}\n\nexport default function SkillEditor(props: SkillEditorProps) {\n const { hasPermissionToModule } = useCurrentUserContext();\n const action = props.skill ? Action.Update : Action.Create;\n\n if (!hasPermissionToModule({ module: KnowledgeModules.ExpertiseSkill, action, data: props.skill })) return null;\n\n return <SkillEditorInternal {...props} />;\n}\n","\"use client\";\n\nimport SkillDeleter from \"../components/forms/SkillDeleter\";\nimport SkillEditor from \"../components/forms/SkillEditor\";\nimport { useContentLanguage } from \"../../../common/hooks/useContentLanguage\";\nimport { resolveField } from \"../../../common/i18n/translationResolver\";\nimport { SkillInterface } from \"../data/SkillInterface\";\nimport { SkillService } from \"../data/SkillService\";\nimport { SharedProvider } from \"@carlonicora/nextjs-jsonapi/contexts\";\nimport { usePageUrlGenerator } from \"@carlonicora/nextjs-jsonapi/client\";\nimport { BreadcrumbItemData } from \"@carlonicora/nextjs-jsonapi/core\";\n\nimport { JsonApiHydratedDataInterface, rehydrate } from \"@carlonicora/nextjs-jsonapi/core\";\nimport { useTranslations } from \"next-intl\";\nimport { createContext, ReactNode, useContext, useState } from \"react\";\nimport { KnowledgeModules } from \"../../../knowledge.registry\";\n\ninterface SkillContextType {\n skill: SkillInterface | undefined;\n setSkill: (value: SkillInterface | undefined) => void;\n reloadSkill: () => Promise<void>;\n}\n\nconst SkillContext = createContext<SkillContextType | undefined>(undefined);\n\ntype SkillProviderProps = {\n children: ReactNode;\n dehydratedSkill?: JsonApiHydratedDataInterface;\n};\n\nexport const SkillProvider = ({ children, dehydratedSkill }: SkillProviderProps) => {\n const generateUrl = usePageUrlGenerator();\n const t = useTranslations();\n const language = useContentLanguage();\n\n const [skill, setSkill] = useState<SkillInterface | undefined>(\n dehydratedSkill ? rehydrate<SkillInterface>(KnowledgeModules.ExpertiseSkill, dehydratedSkill) : undefined,\n );\n\n const reloadSkill = async () => {\n if (!skill) return;\n\n const freshSkill = await SkillService.findOne({ id: skill.id });\n setSkill(freshSkill);\n };\n\n const breadcrumb = () => {\n const response: BreadcrumbItemData[] = [];\n\n response.push({\n name: t(`entities.skills`, { count: 2 }),\n href: KnowledgeModules.ExpertiseSkill.pageUrl\n ? generateUrl({ page: KnowledgeModules.ExpertiseSkill })\n : undefined,\n });\n\n if (skill)\n response.push({\n name: skill.name,\n href: KnowledgeModules.ExpertiseSkill.pageUrl\n ? generateUrl({ page: KnowledgeModules.ExpertiseSkill, id: skill.id })\n : undefined,\n });\n\n return response;\n };\n\n const title = () => {\n const response: any = {\n type: t(`entities.skills`, { count: skill ? 1 : 2 }),\n };\n\n const functions: ReactNode[] = [];\n\n if (skill) {\n // The hero title resolves the stored translation for the reader's language,\n // the same way the list cells and the details body do (C9).\n response.element = resolveField({\n original: skill.name,\n translation: skill.translation,\n field: \"name\",\n language,\n });\n\n functions.push(<SkillDeleter key={`SkillDeleter`} skill={skill} />);\n functions.push(<SkillEditor key={`SkillEditor`} skill={skill} propagateChanges={setSkill} />);\n } else {\n functions.push(<SkillEditor key={`SkillEditor`} />);\n }\n\n if (functions.length > 0) response.functions = functions;\n\n return response;\n };\n\n return (\n <SharedProvider value={{ breadcrumbs: breadcrumb(), title: title() }}>\n <SkillContext.Provider\n value={{\n skill: skill,\n setSkill: setSkill,\n reloadSkill: reloadSkill,\n }}\n >\n {children}\n </SkillContext.Provider>\n </SharedProvider>\n );\n};\n\nexport const useSkillContext = (): SkillContextType => {\n const context = useContext(SkillContext);\n if (context === undefined) {\n throw new Error(\"useSkillContext must be used within a SkillProvider\");\n }\n return context;\n};\n","\"use client\";\n\nimport { SkillFields } from \"../data/SkillFields\";\nimport { SkillInterface } from \"../data/SkillInterface\";\nimport { cellDate, cellId } from \"@carlonicora/nextjs-jsonapi/components\";\nimport {\n registerTableGenerator,\n TableContent,\n usePageUrlGenerator,\n UseTableStructureHook,\n} from \"@carlonicora/nextjs-jsonapi/client\";\nimport { Link, Tooltip, TooltipContent, TooltipTrigger } from \"@carlonicora/nextjs-jsonapi/components\";\nimport { resolveField } from \"../../../common/i18n/translationResolver\";\nimport { useContentLanguage } from \"../../../common/hooks/useContentLanguage\";\nimport { ColumnDef } from \"@tanstack/react-table\";\nimport { useTranslations } from \"next-intl\";\nimport { useMemo } from \"react\";\nimport { KnowledgeModules } from \"../../../knowledge.registry\";\n\nexport const useSkillTableStructure: UseTableStructureHook<SkillInterface, SkillFields> = (params) => {\n const t = useTranslations();\n const generateUrl = usePageUrlGenerator();\n const language = useContentLanguage();\n\n const tableData = useMemo(() => {\n return params.data.map((skill: SkillInterface) => {\n const entry: TableContent<SkillInterface> = {\n jsonApiData: skill,\n };\n entry[SkillFields.skillId] = skill.id;\n params.fields.forEach((field) => {\n entry[field] = skill[field as keyof SkillInterface];\n });\n return entry;\n });\n }, [params.data, params.fields]);\n\n const fieldColumnMap: Partial<Record<SkillFields, () => any>> = {\n [SkillFields.skillId]: () =>\n cellId({\n name: \"skillId\",\n checkedIds: params.checkedIds,\n toggleId: params.toggleId,\n }),\n [SkillFields.name]: () => ({\n id: \"name\",\n accessorKey: \"name\",\n header: t(`features.skill.fields.name.label`),\n cell: ({ row }: { row: TableContent<SkillInterface> }) => {\n const skill: SkillInterface = row.original.jsonApiData;\n // Stored translations win over the original text for the reader's language (C9).\n const name = resolveField({\n original: skill.name,\n translation: skill.translation,\n field: \"name\",\n language,\n });\n return (\n <Tooltip>\n <TooltipTrigger>\n {KnowledgeModules.ExpertiseSkill.pageUrl ? (\n <Link href={generateUrl({ page: KnowledgeModules.ExpertiseSkill, id: skill.id })}>{name}</Link>\n ) : (\n <span>{name}</span>\n )}\n </TooltipTrigger>\n <TooltipContent>{name}</TooltipContent>\n </Tooltip>\n );\n },\n enableSorting: false,\n enableHiding: false,\n }),\n [SkillFields.image]: () => ({\n id: \"image\",\n accessorKey: \"image\",\n header: t(`features.skill.fields.image.label`),\n cell: ({ row }: { row: TableContent<SkillInterface> }) => {\n const skill: SkillInterface = row.original.jsonApiData;\n return <span>{skill.image}</span>;\n },\n enableSorting: false,\n enableHiding: false,\n }),\n [SkillFields.createdAt]: () =>\n cellDate({\n name: \"createdAt\",\n title: t(`common.date.create`),\n }),\n [SkillFields.updatedAt]: () =>\n cellDate({\n name: \"updatedAt\",\n title: t(`common.date.update`),\n }),\n };\n\n const columns = useMemo(() => {\n return params.fields.map((field) => fieldColumnMap[field]?.()).filter((col) => col !== undefined) as ColumnDef<\n TableContent<SkillInterface>\n >[];\n }, [params.fields, fieldColumnMap, t, generateUrl, language]);\n\n return useMemo(() => ({ data: tableData, columns: columns }), [tableData, columns]);\n};\n\nregisterTableGenerator(KnowledgeModules.ExpertiseSkill, useSkillTableStructure);\n","\"use client\";\n\nimport SkillEditor from \"../forms/SkillEditor\";\nimport { SkillFields } from \"../../data/SkillFields\";\nimport { SkillInterface } from \"../../data/SkillInterface\";\nimport { SkillService } from \"../../data/SkillService\";\nimport \"../../hooks/useSkillTableStructure\";\nimport { ContentListTable } from \"@carlonicora/nextjs-jsonapi/components\";\nimport { DataListRetriever, useDataListRetriever } from \"@carlonicora/nextjs-jsonapi/client\";\nimport { useTranslations } from \"next-intl\";\nimport { ReactNode } from \"react\";\nimport { KnowledgeModules } from \"../../../../knowledge.registry\";\n\ntype SkillListProps = {\n fullWidth?: boolean;\n};\n\nexport default function SkillList({ fullWidth }: SkillListProps) {\n const t = useTranslations();\n\n const data: DataListRetriever<SkillInterface> = useDataListRetriever({\n module: KnowledgeModules.ExpertiseSkill,\n retriever: (params) => SkillService.findMany(params),\n retrieverParams: {},\n });\n\n const functions: ReactNode[] = [<SkillEditor key=\"create-skill\" />];\n\n return (\n <ContentListTable\n data={data}\n fields={[SkillFields.name, SkillFields.taxonomies, SkillFields.updatedAt]}\n tableGeneratorType={KnowledgeModules.ExpertiseSkill}\n functions={functions}\n title={t(`entities.skills`, { count: 2 })}\n fullWidth={fullWidth}\n />\n );\n}\n","\"use client\";\n\nimport SkillList from \"../lists/SkillList\";\nimport { RoundPageContainer } from \"@carlonicora/nextjs-jsonapi/components\";\nimport { KnowledgeModules } from \"../../../../knowledge.registry\";\n\nfunction SkillListContainerInternal() {\n return (\n <RoundPageContainer module={KnowledgeModules.ExpertiseSkill} fullWidth>\n <SkillList fullWidth />\n </RoundPageContainer>\n );\n}\n\nexport default function SkillListContainer() {\n return <SkillListContainerInternal />;\n}\n","\"use client\";\n\nimport { SkillService } from \"../../data/SkillService\";\nimport {\n Button,\n Dialog,\n DialogContent,\n DialogFooter,\n DialogHeader,\n DialogTitle,\n EntitySelector,\n errorToast,\n FormFieldWrapper,\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n} from \"@carlonicora/nextjs-jsonapi/components\";\nimport { Modules, UserInterface, UserService } from \"@carlonicora/nextjs-jsonapi/core\";\nimport { SkillLevel } from \"../../../../../shared\";\nimport { useTranslations } from \"next-intl\";\nimport { useState } from \"react\";\nimport { useForm } from \"react-hook-form\";\n\ntype AddUserToSkillDialogProps = {\n skillId: string;\n existingUserIds: string[];\n onSuccess: () => Promise<void> | void;\n};\n\nconst proficiencies = Object.values(SkillLevel);\n\n/**\n * Ported from the earlier codebase's .../AddUserToSkillDialog.tsx.\n *\n * Deviation: the backup hand-rolled a search popover; 3.5.10 ships\n * `EntitySelector` (C8's single-picker reference), so the picker is the package\n * component and only the proficiency select and the submit are ported.\n */\nexport function AddUserToSkillDialog({ skillId, existingUserIds, onSuccess }: AddUserToSkillDialogProps) {\n const t = useTranslations();\n const [open, setOpen] = useState<boolean>(false);\n const [isSaving, setIsSaving] = useState<boolean>(false);\n\n const form = useForm<{ user?: { id: string; name: string }; proficiency: string }>({\n defaultValues: { user: undefined, proficiency: SkillLevel.aware },\n });\n\n const submit = async (values: { user?: { id: string; name: string }; proficiency: string }) => {\n if (!values.user) return;\n setIsSaving(true);\n try {\n await SkillService.claim({ skillId, userId: values.user.id, proficiency: values.proficiency });\n form.reset({ user: undefined, proficiency: SkillLevel.aware });\n setOpen(false);\n await onSuccess();\n } catch (error) {\n errorToast({ title: t(`features.skill.proficiency.errors.add_user_failed`), error });\n } finally {\n setIsSaving(false);\n }\n };\n\n return (\n <>\n <Button variant=\"outline\" size=\"sm\" onClick={() => setOpen(true)}>\n {t(`features.skill.actions.add_user`)}\n </Button>\n <Dialog open={open} onOpenChange={setOpen}>\n <DialogContent className=\"flex max-w-md flex-col\">\n <DialogHeader>\n <DialogTitle>{t(`features.skill.actions.add_user`)}</DialogTitle>\n </DialogHeader>\n <form onSubmit={form.handleSubmit(submit)} className=\"flex w-full flex-col gap-y-4\">\n <EntitySelector<UserInterface>\n id=\"user\"\n form={form}\n module={Modules.User}\n retriever={(params) => UserService.findMany(params)}\n filterData={(data) => data.filter((user) => !existingUserIds.includes(user.id))}\n label={t(`features.skill.relationships.user.label`)}\n placeholder={t(`features.skill.relationships.user.placeholder`)}\n isRequired\n />\n <FormFieldWrapper form={form} name=\"proficiency\" label={t(`features.skill.proficiency.label`)} isRequired>\n {(field) => (\n <Select value={field.value} onValueChange={field.onChange}>\n <SelectTrigger>\n <SelectValue />\n </SelectTrigger>\n <SelectContent className=\"p-1\">\n {proficiencies.map((proficiency) => (\n <SelectItem key={proficiency} value={proficiency}>\n {t(`features.skill.proficiency.values.${proficiency}`)}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n )}\n </FormFieldWrapper>\n <DialogFooter>\n <Button type=\"button\" variant=\"outline\" onClick={() => setOpen(false)}>\n {t(`ui.buttons.cancel`)}\n </Button>\n <Button type=\"submit\" disabled={isSaving}>\n {t(`ui.buttons.add`)}\n </Button>\n </DialogFooter>\n </form>\n </DialogContent>\n </Dialog>\n </>\n );\n}\n","\"use client\";\n\nimport { SkillInterface } from \"../../data/SkillInterface\";\nimport { SkillService } from \"../../data/SkillService\";\nimport {\n Button,\n Dialog,\n DialogContent,\n DialogFooter,\n DialogHeader,\n DialogTitle,\n errorToast,\n FormFieldWrapper,\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n} from \"@carlonicora/nextjs-jsonapi/components\";\nimport { useCurrentUserContext } from \"@carlonicora/nextjs-jsonapi/contexts\";\nimport { SkillLevel } from \"../../../../../shared\";\nimport { useTranslations } from \"next-intl\";\nimport { useState } from \"react\";\nimport { useForm } from \"react-hook-form\";\n\nconst skillLevels = Object.values(SkillLevel);\n\ntype ClaimSkillButtonProps = {\n skill: SkillInterface;\n onSuccess?: () => Promise<void> | void;\n};\n\n/** Ported verbatim from the earlier codebase's .../ClaimSkillButton.tsx. */\nexport function ClaimSkillButton({ skill, onSuccess }: ClaimSkillButtonProps) {\n const t = useTranslations();\n const { currentUser } = useCurrentUserContext();\n const [open, setOpen] = useState<boolean>(false);\n const [isLoading, setIsLoading] = useState<boolean>(false);\n\n const form = useForm<{ proficiency: string }>({ defaultValues: { proficiency: SkillLevel.skilled } });\n\n const hasClaimedSkill = skill.users.some((user) => user.id === currentUser?.id);\n\n if (!currentUser || hasClaimedSkill) return null;\n\n const submit = async (values: { proficiency: string }) => {\n setIsLoading(true);\n try {\n await SkillService.claim({ skillId: skill.id, userId: currentUser.id, proficiency: values.proficiency });\n setOpen(false);\n await onSuccess?.();\n } catch (error) {\n errorToast({ title: t(`features.skill.actions.claim_error`), error });\n } finally {\n setIsLoading(false);\n }\n };\n\n return (\n <>\n <Button variant=\"outline\" onClick={() => setOpen(true)} data-testid=\"skill-claim\">\n {t(`features.skill.actions.claim`)}\n </Button>\n <Dialog open={open} onOpenChange={setOpen}>\n <DialogContent className=\"flex max-w-md flex-col\">\n <DialogHeader>\n <DialogTitle>{t(`features.skill.actions.claim_skill_title`)}</DialogTitle>\n </DialogHeader>\n <form onSubmit={form.handleSubmit(submit)} className=\"flex w-full flex-col gap-y-4\">\n <p className=\"text-sm\">{t(`features.skill.actions.claim_skill_description`, { name: skill.name })}</p>\n <FormFieldWrapper form={form} name=\"proficiency\" label={t(`features.skill.proficiency.label`)} isRequired>\n {(field) => (\n <Select value={field.value} onValueChange={field.onChange}>\n <SelectTrigger>\n <SelectValue />\n </SelectTrigger>\n <SelectContent className=\"p-1\">\n {skillLevels.map((level) => (\n <SelectItem key={level} value={level}>\n {t(`features.skill.proficiency.values.${level}`)}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n )}\n </FormFieldWrapper>\n <DialogFooter>\n <Button type=\"button\" variant=\"outline\" onClick={() => setOpen(false)}>\n {t(`ui.buttons.cancel`)}\n </Button>\n <Button type=\"submit\" disabled={isLoading}>\n {t(`ui.buttons.confirm`)}\n </Button>\n </DialogFooter>\n </form>\n </DialogContent>\n </Dialog>\n </>\n );\n}\n","\"use client\";\n\nimport { SkillService } from \"../../data/SkillService\";\nimport {\n errorToast,\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n} from \"@carlonicora/nextjs-jsonapi/components\";\nimport { SkillLevel } from \"../../../../../shared\";\nimport { useTranslations } from \"next-intl\";\nimport { useState } from \"react\";\n\ntype SkillProficiencyDropdownProps = {\n userId: string;\n proficiency: string;\n skillId: string;\n isEditable: boolean;\n onChange?: () => Promise<void> | void;\n};\n\nconst proficiencies = Object.values(SkillLevel);\n\n/** Ported verbatim from the earlier codebase's .../SkillProficiencyDropdown.tsx; the level travels on the HAS_SKILL edge. */\nexport function SkillProficiencyDropdown({\n userId,\n proficiency,\n skillId,\n isEditable,\n onChange,\n}: SkillProficiencyDropdownProps) {\n const t = useTranslations();\n const [currentProficiency, setCurrentProficiency] = useState<string>(proficiency || SkillLevel.aware);\n\n const translatedProficiency = t(`features.skill.proficiency.values.${currentProficiency}`);\n\n if (!isEditable) return <>{translatedProficiency}</>;\n\n const handleProficiencyChange = async (newProficiency: string) => {\n const previousProficiency = currentProficiency;\n setCurrentProficiency(newProficiency);\n\n try {\n await SkillService.updateProficiency({ skillId, userId, proficiency: newProficiency });\n await onChange?.();\n } catch (error) {\n setCurrentProficiency(previousProficiency);\n errorToast({ title: t(`features.skill.proficiency.errors.update_failed`), error });\n }\n };\n\n return (\n <Select value={currentProficiency} onValueChange={handleProficiencyChange}>\n <SelectTrigger size=\"sm\" className=\"w-[140px]\">\n <SelectValue>{translatedProficiency}</SelectValue>\n </SelectTrigger>\n <SelectContent className=\"p-1\">\n {proficiencies.map((value) => (\n <SelectItem key={value} value={value}>\n {t(`features.skill.proficiency.values.${value}`)}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n );\n}\n","\"use client\";\n\nimport { useContentLanguage } from \"../../../../common/hooks/useContentLanguage\";\nimport { resolveBlockNoteField } from \"../../../common/i18n/resolveBlockNoteField\";\nimport { AddUserToSkillDialog } from \"../forms/AddUserToSkillDialog\";\nimport { ClaimSkillButton } from \"../forms/ClaimSkillButton\";\nimport { SkillProficiencyDropdown } from \"../forms/SkillProficiencyDropdown\";\nimport { SkillInterface } from \"../../data/SkillInterface\";\nimport { SkillService } from \"../../data/SkillService\";\nimport { TaxonomyBadgesList } from \"../../../taxonomy/components/lists/TaxonomyBadgesList\";\nimport {\n BlockNoteEditorContainer,\n Button,\n Card,\n errorToast,\n MicroLabel,\n UserAvatar,\n} from \"@carlonicora/nextjs-jsonapi/components\";\nimport { useTranslations } from \"next-intl\";\n\ntype SkillContentProps = {\n skill: SkillInterface;\n onChange?: () => Promise<void> | void;\n};\n\nexport function SkillContent({ skill, onChange }: SkillContentProps) {\n const t = useTranslations();\n const language = useContentLanguage();\n\n // Stored translations win over the original text for the reader's language (C9).\n const description = resolveBlockNoteField({\n original: skill.description,\n translation: skill.translation,\n field: \"description\",\n language,\n });\n\n const reload = async () => {\n await onChange?.();\n };\n\n const removeUser = async (userId: string) => {\n try {\n await SkillService.removeUser({ skillId: skill.id, userId });\n await reload();\n } catch (error) {\n errorToast({ title: t(`features.skill.proficiency.errors.remove_failed`), error });\n }\n };\n\n return (\n <div className=\"flex flex-col gap-y-8\">\n <div className=\"flex flex-col gap-y-3\">\n <MicroLabel>{t(`features.skill.fields.description.label`)}</MicroLabel>\n <Card className=\"flex w-full flex-col p-4\">\n <BlockNoteEditorContainer id={skill.id} type=\"skill\" initialContent={description} />\n </Card>\n </div>\n\n {skill.taxonomies.length > 0 && (\n <div className=\"flex flex-col gap-y-3\">\n <MicroLabel>{t(`entities.taxonomies`, { count: 2 })}</MicroLabel>\n <TaxonomyBadgesList taxonomies={skill.taxonomies} />\n </div>\n )}\n\n <div className=\"flex flex-col gap-y-3\">\n <div className=\"flex flex-row items-center justify-between\">\n <MicroLabel>{t(`features.skill.sections.holders`)}</MicroLabel>\n <div className=\"flex flex-row items-center gap-2\">\n <ClaimSkillButton skill={skill} onSuccess={reload} />\n <AddUserToSkillDialog\n skillId={skill.id}\n existingUserIds={skill.users.map((user) => user.id)}\n onSuccess={reload}\n />\n </div>\n </div>\n {skill.users.length === 0 ? (\n <span className=\"text-muted-foreground text-xs\">{t(`generic.empty_list`)}</span>\n ) : (\n <Card className=\"flex w-full flex-col divide-y p-0\">\n {skill.users.map((user) => (\n <div\n key={user.id}\n data-testid={`skill-holder-${user.id}`}\n className=\"flex flex-row items-center justify-between gap-2 p-3\"\n >\n <div className=\"flex flex-row items-center gap-2 text-sm\">\n <UserAvatar user={user} />\n {user.name}\n </div>\n <div className=\"flex flex-row items-center gap-2\">\n <SkillProficiencyDropdown\n userId={user.id}\n proficiency={user.proficiency}\n skillId={skill.id}\n isEditable\n onChange={reload}\n />\n <Button variant=\"ghost\" size=\"sm\" onClick={() => removeUser(user.id)}>\n {t(`ui.buttons.remove`)}\n </Button>\n </div>\n </div>\n ))}\n </Card>\n )}\n </div>\n </div>\n );\n}\n","\"use client\";\n\nimport TranslationsTab from \"../../../../common/components/translations/TranslationsTab\";\nimport { SkillContent } from \"../details/SkillContent\";\nimport { useSkillContext } from \"../../contexts/SkillContext\";\nimport { SkillInterface } from \"../../data/SkillInterface\";\nimport { SkillService } from \"../../data/SkillService\";\nimport { RoundPageContainer, Tab } from \"@carlonicora/nextjs-jsonapi/components\";\nimport { useCurrentUserContext } from \"@carlonicora/nextjs-jsonapi/contexts\";\nimport { Action } from \"@carlonicora/nextjs-jsonapi/core\";\nimport { useTranslations } from \"next-intl\";\nimport { getKnowledgeUiConfig } from \"../../../../config/knowledge.ui.config\";\nimport { KnowledgeModules } from \"../../../../knowledge.registry\";\n\ntype SkillContainerProps = {\n skill: SkillInterface;\n setSkill: (skill: SkillInterface | undefined) => void;\n reloadSkill: () => Promise<void>;\n};\n\nfunction SkillContainerInternal({ skill, setSkill, reloadSkill }: SkillContainerProps) {\n const t = useTranslations();\n\n // Tab shape copied from ~/Development/wyrdli/.../ThreatContainer.tsx.\n const tabs: Tab[] = [\n {\n sectionKey: \"details\",\n label: t(`features.skill.sections.details`),\n content: <SkillContent skill={skill} onChange={reloadSkill} />,\n },\n // Tabs the app adds, just before Translations.\n ...(getKnowledgeUiConfig().tabs?.skill?.(skill, t) ?? []),\n {\n sectionKey: \"translations\",\n label: t(`features.translations.title`),\n contentLabel: <span data-testid=\"translations-tab\">{t(`features.translations.title`)}</span>,\n content: (\n <TranslationsTab\n entity={{ id: skill.id, translation: skill.translation }}\n fields={[\"name\", \"description\"]}\n onSave={async (language, fields) => {\n setSkill(await SkillService.patchTranslations({ id: skill.id, language, fields }));\n }}\n />\n ),\n },\n ];\n\n return <RoundPageContainer module={KnowledgeModules.ExpertiseSkill} id={skill.id} tabs={tabs} />;\n}\n\nexport default function SkillContainer() {\n const { hasPermissionToModule } = useCurrentUserContext();\n const { skill, setSkill, reloadSkill } = useSkillContext();\n if (!skill) return null;\n if (!hasPermissionToModule({ module: KnowledgeModules.ExpertiseSkill, action: Action.Read, data: skill }))\n return null;\n return <SkillContainerInternal skill={skill} setSkill={setSkill} reloadSkill={reloadSkill} />;\n}\n","\"use client\";\n\nimport { SkillInterface } from \"../../data/SkillInterface\";\nimport { SkillService } from \"../../data/SkillService\";\nimport { EntityMultiSelector } from \"@carlonicora/nextjs-jsonapi/components\";\nimport { useTranslations } from \"next-intl\";\nimport { KnowledgeModules } from \"../../../../knowledge.registry\";\n\ntype SkillMultiSelectorProps = {\n id: string;\n form: any;\n currentSkill?: SkillInterface;\n label?: string;\n placeholder?: string;\n onChange?: (skills?: SkillInterface[]) => void;\n maxCount?: number;\n isRequired?: boolean;\n};\n\nexport default function SkillMultiSelector({\n id,\n form,\n currentSkill,\n label,\n placeholder,\n onChange,\n isRequired = false,\n}: SkillMultiSelectorProps) {\n const t = useTranslations();\n\n return (\n <EntityMultiSelector<SkillInterface>\n id={id}\n form={form}\n label={label}\n placeholder={placeholder || t(\"ui.search.button\")}\n emptyText={t(\"ui.search.no_results_generic\")}\n isRequired={isRequired}\n retriever={(params) => SkillService.findMany(params)}\n module={KnowledgeModules.ExpertiseSkill}\n getLabel={(skill) => skill.name}\n excludeId={currentSkill?.id}\n onChange={onChange}\n />\n );\n}\n","\"use client\";\n\nimport { SkillProvider } from \"../../contexts/SkillContext\";\nimport SkillListContainer from \"../containers/SkillListContainer\";\n\nexport function SkillListScreen() {\n return (\n <SkillProvider>\n <SkillListContainer />\n </SkillProvider>\n );\n}\n","\"use client\";\n\nimport type { JsonApiHydratedDataInterface } from \"@carlonicora/nextjs-jsonapi/core\";\nimport { SkillProvider } from \"../../contexts/SkillContext\";\nimport SkillContainer from \"../containers/SkillContainer\";\n\nexport function SkillDetailScreen({ dehydratedSkill }: { dehydratedSkill: JsonApiHydratedDataInterface }) {\n return (\n <SkillProvider dehydratedSkill={dehydratedSkill}>\n <SkillContainer />\n </SkillProvider>\n );\n}\n","\"use client\";\n\nimport { AccessRequestInterface, AccessRequestTarget } from \"../data/AccessRequestInterface\";\nimport {\n registerTableGenerator,\n TableContent,\n usePageUrlGenerator,\n UseTableStructureHook,\n} from \"@carlonicora/nextjs-jsonapi/client\";\nimport { cellDate, Link } from \"@carlonicora/nextjs-jsonapi/components\";\nimport { Modules } from \"@carlonicora/nextjs-jsonapi/core\";\nimport { ColumnDef, Row } from \"@tanstack/react-table\";\nimport { useTranslations } from \"next-intl\";\nimport { useMemo } from \"react\";\nimport { KnowledgeModules } from \"../../../knowledge.registry\";\n\nexport enum AccessRequestFields {\n accessRequestId = \"accessRequestId\",\n userName = \"userName\",\n targetName = \"targetName\",\n targetType = \"targetType\",\n requestedAt = \"requestedAt\",\n actions = \"actions\",\n}\n\nexport const useAccessRequestTableStructure: UseTableStructureHook<AccessRequestInterface, AccessRequestFields> = (\n params,\n) => {\n const t = useTranslations();\n const generateUrl = usePageUrlGenerator();\n\n const tableData = useMemo(() => {\n return params.data.map((accessRequest: AccessRequestInterface) => {\n const entry: TableContent<AccessRequestInterface> = { jsonApiData: accessRequest };\n entry[AccessRequestFields.accessRequestId] = accessRequest.id;\n params.fields.forEach((field) => {\n entry[field] = accessRequest[field as keyof AccessRequestInterface];\n });\n return entry;\n });\n }, [params.data, params.fields]);\n\n const fieldColumnMap: Partial<Record<AccessRequestFields, () => any>> = {\n [AccessRequestFields.userName]: () => ({\n id: \"userName\",\n accessorKey: \"userName\",\n header: t(`features.accessrequest.fields.user.label`),\n cell: ({ row }: { row: Row<TableContent<AccessRequestInterface>> }) => {\n const accessRequest = row.original.jsonApiData as AccessRequestInterface;\n return (\n <Link href={generateUrl({ page: Modules.User, id: accessRequest.userId })}>{accessRequest.userName}</Link>\n );\n },\n enableSorting: false,\n enableHiding: false,\n }),\n [AccessRequestFields.targetName]: () => ({\n id: \"targetName\",\n accessorKey: \"targetName\",\n header: t(`features.accessrequest.fields.target.label`),\n cell: ({ row }: { row: Row<TableContent<AccessRequestInterface>> }) => {\n const accessRequest = row.original.jsonApiData as AccessRequestInterface;\n const page =\n accessRequest.targetType === AccessRequestTarget.cluster\n ? KnowledgeModules.Cluster\n : KnowledgeModules.CommunityOfExpertise;\n return page.pageUrl ? (\n <Link href={generateUrl({ page, id: accessRequest.targetId })}>{accessRequest.targetName}</Link>\n ) : (\n <span>{accessRequest.targetName}</span>\n );\n },\n enableSorting: false,\n enableHiding: false,\n }),\n [AccessRequestFields.targetType]: () => ({\n id: \"targetType\",\n accessorKey: \"targetType\",\n header: t(`features.accessrequest.fields.type.label`),\n cell: ({ row }: { row: Row<TableContent<AccessRequestInterface>> }) => {\n const accessRequest = row.original.jsonApiData as AccessRequestInterface;\n return (\n <span>\n {accessRequest.targetType === AccessRequestTarget.cluster\n ? t(`entities.clusters`, { count: 1 })\n : t(`entities.communityofexpertises`, { count: 1 })}\n </span>\n );\n },\n enableSorting: false,\n enableHiding: false,\n }),\n [AccessRequestFields.requestedAt]: () =>\n cellDate({\n name: \"requestedAt\",\n title: t(`features.accessrequest.fields.requestedAt.label`),\n }),\n [AccessRequestFields.actions]: () => ({\n id: \"actions\",\n accessorKey: \"actions\",\n header: \"\",\n cell: ({ row }: { row: Row<TableContent<AccessRequestInterface>> }) => (\n <div className=\"flex justify-end gap-2\">\n {params.context?.renderActions?.(row.original.jsonApiData as AccessRequestInterface)}\n </div>\n ),\n enableSorting: false,\n enableHiding: false,\n }),\n };\n\n const columns = useMemo(() => {\n return params.fields.map((field) => fieldColumnMap[field]?.()).filter((col) => col !== undefined) as ColumnDef<\n TableContent<AccessRequestInterface>\n >[];\n }, [params.fields, fieldColumnMap, t, generateUrl]);\n\n return useMemo(() => ({ data: tableData, columns: columns }), [tableData, columns]);\n};\n\nregisterTableGenerator(KnowledgeModules.AccessRequest, useAccessRequestTableStructure);\n","\"use client\";\n\nimport \"../../hooks/useAccessRequestTableStructure\";\n\nimport { AccessRequestFields } from \"../../hooks/useAccessRequestTableStructure\";\nimport { AccessRequestInterface, AccessRequestTarget } from \"../../data/AccessRequestInterface\";\nimport { AccessRequestService } from \"../../data/AccessRequestService\";\nimport { ClusterService } from \"../../../cluster/data/ClusterService\";\nimport { CommunityOfExpertiseService } from \"../../../community-of-expertise/data/CommunityOfExpertiseService\";\nimport { DataListRetriever, useDataListRetriever } from \"@carlonicora/nextjs-jsonapi/client\";\nimport { Button, ContentListTable, errorToast } from \"@carlonicora/nextjs-jsonapi/components\";\nimport { useTranslations } from \"next-intl\";\nimport { KnowledgeModules } from \"../../../../knowledge.registry\";\n\n/** Manager inbox: pending requests on every cluster and community the user manages (spec §5.1). */\nexport default function AccessRequestList() {\n const t = useTranslations();\n\n const data: DataListRetriever<AccessRequestInterface> = useDataListRetriever({\n module: KnowledgeModules.AccessRequest,\n retriever: (params: any) => AccessRequestService.findMany(params),\n retrieverParams: {},\n });\n\n const approve = async (accessRequest: AccessRequestInterface) => {\n try {\n if (accessRequest.targetType === AccessRequestTarget.cluster)\n await ClusterService.approveAccess({ id: accessRequest.targetId, userId: accessRequest.userId });\n else\n await CommunityOfExpertiseService.approveAccess({ id: accessRequest.targetId, userId: accessRequest.userId });\n await data.refresh();\n } catch (error) {\n errorToast({ title: t(`features.accessrequest.errors.approve`), error });\n }\n };\n\n const reject = async (accessRequest: AccessRequestInterface) => {\n try {\n if (accessRequest.targetType === AccessRequestTarget.cluster)\n await ClusterService.rejectAccess({ id: accessRequest.targetId, userId: accessRequest.userId });\n else await CommunityOfExpertiseService.rejectAccess({ id: accessRequest.targetId, userId: accessRequest.userId });\n await data.refresh();\n } catch (error) {\n errorToast({ title: t(`features.accessrequest.errors.reject`), error });\n }\n };\n\n const context = {\n renderActions: (accessRequest: AccessRequestInterface) => (\n <>\n <Button variant=\"outline\" size=\"sm\" data-testid=\"access-request-approve\" onClick={() => approve(accessRequest)}>\n {t(`features.accessrequest.actions.approve`)}\n </Button>\n <Button variant=\"ghost\" size=\"sm\" data-testid=\"access-request-reject\" onClick={() => reject(accessRequest)}>\n {t(`features.accessrequest.actions.reject`)}\n </Button>\n </>\n ),\n };\n\n return (\n <ContentListTable\n data={data}\n fields={[\n AccessRequestFields.userName,\n AccessRequestFields.targetName,\n AccessRequestFields.targetType,\n AccessRequestFields.requestedAt,\n AccessRequestFields.actions,\n ]}\n tableGeneratorType={KnowledgeModules.AccessRequest}\n title={t(`features.accessrequest.title`)}\n context={context}\n fullWidth\n />\n );\n}\n","\"use client\";\n\nimport AccessRequestList from \"../lists/AccessRequestList\";\nimport { RoundPageContainer } from \"@carlonicora/nextjs-jsonapi/components\";\nimport { SharedProvider } from \"@carlonicora/nextjs-jsonapi/contexts\";\nimport { usePageUrlGenerator } from \"@carlonicora/nextjs-jsonapi/client\";\nimport { useTranslations } from \"next-intl\";\nimport { KnowledgeModules } from \"../../../../knowledge.registry\";\n\nexport default function AccessRequestListContainer() {\n const t = useTranslations();\n const generateUrl = usePageUrlGenerator();\n\n return (\n <SharedProvider\n value={{\n breadcrumbs: [\n {\n name: t(`features.accessrequest.title`),\n href: KnowledgeModules.AccessRequest.pageUrl\n ? generateUrl({ page: KnowledgeModules.AccessRequest })\n : undefined,\n },\n ],\n title: { type: t(`features.accessrequest.title`) },\n }}\n >\n <RoundPageContainer module={KnowledgeModules.AccessRequest} fullWidth>\n <AccessRequestList />\n </RoundPageContainer>\n </SharedProvider>\n );\n}\n","\"use client\";\n\nimport AccessRequestListContainer from \"../containers/AccessRequestListContainer\";\n\nexport function AccessRequestListScreen() {\n return <AccessRequestListContainer />;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA8BA,IAAM,MAAM,uBAAO,IAAI,kBAAkB;AAElC,SAAS,qBAAqB,QAAiC;AACpE,EAAC,WAAkD,GAAG,IAAI;AAC5D;AAFgB;AAIT,SAAS,uBAA0C;AACxD,QAAM,SAAU,WAAkD,GAAG;AACrE,MAAI,CAAC,OAAQ,OAAM,IAAI,MAAM,sDAAsD;AACnF,SAAO;AACT;AAJgB;;;AChChB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,iBAAiB;AAC1B,SAAS,uBAAuB;AAChC,SAAS,SAAS,gBAAgB;AAClC,SA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0BAA0B;AACxC,SAAO,gBAAAA,OAAC,8BAA2B;AACrC;AAFgB;","names":["useTranslations","jsx","useTranslations","errorToast","useTranslations","useState","jsx","jsxs","useTranslations","useState","errorToast","useTranslations","useEffect","useState","jsx","jsxs","useTranslations","useState","useEffect","useTranslations","jsx","useTranslations","FormBlockNote","FormFieldWrapper","FormInput","useTranslations","useCallback","useMemo","useState","useForm","jsx","jsxs","useTranslations","useState","useMemo","useCallback","useForm","FormInput","FormFieldWrapper","FormBlockNote","usePageUrlGenerator","useTranslations","useState","jsx","usePageUrlGenerator","useTranslations","useState","useTranslations","jsx","useTranslations","usePageUrlGenerator","useTranslations","useMemo","jsx","jsxs","useTranslations","usePageUrlGenerator","useMemo","useDataListRetriever","useTranslations","jsx","useTranslations","useDataListRetriever","jsx","BlockNoteEditorContainer","useTranslations","jsx","jsxs","useTranslations","BlockNoteEditorContainer","Button","errorToast","useTranslations","useCallback","useState","Fragment","jsx","jsxs","useTranslations","useState","useCallback","errorToast","Button","RoundPageContainer","useCurrentUserContext","Action","useTranslations","jsx","useTranslations","RoundPageContainer","useCurrentUserContext","Action","EntityMultiSelector","useTranslations","jsx","useTranslations","EntityMultiSelector","jsx","jsx","CommonDeleter","usePageUrlGenerator","useTranslations","jsx","useTranslations","usePageUrlGenerator","CommonDeleter","useI18nRouter","BlockNoteEditorContainer","EditorSheet","FormBlockNote","FormFieldWrapper","FormInput","FormSelect","useCurrentUserContext","Action","entityObjectSchema","zodResolver","useTranslations","useCallback","useMemo","useState","useForm","v4","z","jsx","jsxs","useI18nRouter","useTranslations","useState","useMemo","z","entityObjectSchema","useCallback","v4","useForm","zodResolver","EditorSheet","FormInput","FormFieldWrapper","BlockNoteEditorContainer","FormBlockNote","FormSelect","useCurrentUserContext","Action","SharedProvider","usePageUrlGenerator","rehydrate","useTranslations","createContext","useContext","useState","jsx","createContext","usePageUrlGenerator","useTranslations","useState","rehydrate","SharedProvider","useContext","cellDate","cellId","registerTableGenerator","usePageUrlGenerator","Link","Tooltip","TooltipContent","TooltipTrigger","useTranslations","useMemo","jsx","jsxs","useTranslations","usePageUrlGenerator","useMemo","cellId","Tooltip","TooltipTrigger","Link","TooltipContent","cellDate","registerTableGenerator","ContentListTable","useDataListRetriever","useTranslations","jsx","useTranslations","useDataListRetriever","ContentListTable","RoundPageContainer","jsx","RoundPageContainer","BlockNoteEditorContainer","Button","errorToast","SectionHeader","useTranslations","useRef","useState","v4","jsx","jsxs","useTranslations","useRef","useState","v4","errorToast","SectionHeader","BlockNoteEditorContainer","Button","Badge","Button","errorToast","useTranslations","useState","jsx","useTranslations","useState","errorToast","Badge","Button","BlockNoteEditorContainer","Button","errorToast","useCurrentUserContext","useTranslations","useState","jsx","jsxs","useTranslations","useCurrentUserContext","useState","errorToast","Button","BlockNoteEditorContainer","MicroLabel","useTranslations","useCallback","useEffect","useState","jsx","jsxs","useTranslations","useState","useEffect","useCallback","MicroLabel","AttributeElement","BlockNoteEditorContainer","Card","MicroLabel","useTranslations","jsx","jsxs","useTranslations","MicroLabel","Card","BlockNoteEditorContainer","AttributeElement","useI18nRouter","Button","errorToast","usePageUrlGenerator","useTranslations","useState","jsx","jsxs","useTranslations","useI18nRouter","usePageUrlGenerator","useState","errorToast","Button","RoundPageContainer","useCurrentUserContext","Action","useTranslations","jsx","jsxs","useTranslations","RoundPageContainer","useCurrentUserContext","Action","EntityMultiSelector","useTranslations","jsx","useTranslations","EntityMultiSelector","jsx","jsx","CommonDeleter","usePageUrlGenerator","useTranslations","jsx","useTranslations","usePageUrlGenerator","CommonDeleter","Command","CommandItem","CommandList","FormFieldWrapper","Input","Popover","PopoverContent","PopoverTrigger","useDataListRetriever","useDebounce","CircleX","RefreshCwIcon","SearchIcon","XIcon","useTranslations","useCallback","useEffect","useRef","useState","Fragment","jsx","jsxs","useTranslations","useState","useRef","useDataListRetriever","useCallback","useDebounce","useEffect","FormFieldWrapper","Popover","PopoverTrigger","CircleX","PopoverContent","Command","SearchIcon","Input","RefreshCwIcon","XIcon","CommandList","CommandItem","useI18nRouter","EditorSheet","FormBlockNote","useCurrentUserContext","Action","entityObjectSchema","zodResolver","useTranslations","useCallback","useMemo","useState","useForm","v4","z","jsx","jsxs","useI18nRouter","useTranslations","useMemo","z","entityObjectSchema","useCallback","v4","useForm","zodResolver","useState","EditorSheet","FormBlockNote","DiscussionReplyEditor","useCurrentUserContext","Action","SharedProvider","usePageUrlGenerator","rehydrate","useTranslations","createContext","useContext","useState","jsx","createContext","usePageUrlGenerator","useTranslations","useState","rehydrate","DiscussionReplyEditor","SharedProvider","useContext","cellDate","cellId","registerTableGenerator","usePageUrlGenerator","Link","Tooltip","TooltipContent","TooltipTrigger","useTranslations","useMemo","jsx","jsxs","useTranslations","usePageUrlGenerator","useMemo","cellId","Tooltip","TooltipTrigger","Link","TooltipContent","cellDate","registerTableGenerator","ContentListTable","useDataListRetriever","useTranslations","jsx","useTranslations","useDataListRetriever","DiscussionReplyEditor","ContentListTable","RoundPageContainer","jsx","RoundPageContainer","AttributeElement","BlockNoteEditorContainer","Card","MicroLabel","useTranslations","jsx","jsxs","useTranslations","MicroLabel","Card","BlockNoteEditorContainer","AttributeElement","RoundPageContainer","useCurrentUserContext","Action","useTranslations","jsx","useTranslations","RoundPageContainer","useCurrentUserContext","Action","EntityMultiSelector","useTranslations","jsx","useTranslations","EntityMultiSelector","jsx","jsx","CommonDeleter","usePageUrlGenerator","useTranslations","jsx","useTranslations","usePageUrlGenerator","CommonDeleter","useI18nRouter","EditorSheet","FileInput","FileUploader","FormBlockNote","FormInput","FormSelect","useCurrentUserContext","entityObjectSchema","zodResolver","UploadIcon","useTranslations","useCallback","useEffect","useMemo","useState","useForm","v4","z","jsx","jsxs","useI18nRouter","useTranslations","useCurrentUserContext","useState","useMemo","z","entityObjectSchema","useCallback","v4","useForm","zodResolver","useEffect","EditorSheet","FormInput","FileUploader","FileInput","UploadIcon","FormBlockNote","FormSelect","useCurrentUserContext","Action","jsx","useCurrentUserContext","Action","SharedProvider","usePageUrlGenerator","rehydrate","useTranslations","createContext","useContext","useState","jsx","createContext","usePageUrlGenerator","useTranslations","useState","rehydrate","SharedProvider","useContext","cellDate","cellId","registerTableGenerator","usePageUrlGenerator","Link","Tooltip","TooltipContent","TooltipTrigger","useTranslations","useMemo","jsx","jsxs","useTranslations","usePageUrlGenerator","useMemo","cellId","Tooltip","TooltipTrigger","Link","TooltipContent","cellDate","registerTableGenerator","ContentListTable","useDataListRetriever","useTranslations","jsx","useTranslations","useDataListRetriever","ContentListTable","RoundPageContainer","jsx","RoundPageContainer","usePageUrlGenerator","Badge","Link","jsx","usePageUrlGenerator","Badge","Link","jsx","AttributeElement","BlockNoteEditorContainer","Card","MicroLabel","useTranslations","jsx","jsxs","useTranslations","MicroLabel","Card","BlockNoteEditorContainer","AttributeElement","Button","errorToast","S3Service","useTranslations","useState","jsx","jsxs","useTranslations","useState","S3Service","errorToast","Button","RoundPageContainer","useCurrentUserContext","Action","useTranslations","jsx","jsxs","useTranslations","RoundPageContainer","useCurrentUserContext","Action","EntityMultiSelector","useTranslations","jsx","useTranslations","EntityMultiSelector","jsx","jsx","Badge","Button","errorToast","useCurrentUserContext","useTranslations","useState","jsx","jsxs","useTranslations","useCurrentUserContext","useState","errorToast","Badge","Button","CommonDeleter","usePageUrlGenerator","useTranslations","jsx","useTranslations","usePageUrlGenerator","CommonDeleter","useTranslations","jsx","useTranslations","useI18nRouter","EditorSheet","FormBlockNote","FormInput","useCurrentUserContext","Action","entityObjectSchema","zodResolver","useTranslations","useCallback","useMemo","useState","useForm","v4","z","jsx","jsxs","useI18nRouter","useTranslations","useMemo","z","entityObjectSchema","useCallback","v4","useForm","zodResolver","useState","EditorSheet","FormInput","FormBlockNote","useCurrentUserContext","Action","SharedProvider","usePageUrlGenerator","rehydrate","useTranslations","createContext","useContext","useState","jsx","createContext","usePageUrlGenerator","useTranslations","useState","rehydrate","SharedProvider","useContext","cellDate","cellId","registerTableGenerator","usePageUrlGenerator","Link","Tooltip","TooltipContent","TooltipTrigger","useTranslations","useMemo","jsx","jsxs","useTranslations","usePageUrlGenerator","useMemo","cellId","Tooltip","TooltipTrigger","Link","TooltipContent","cellDate","registerTableGenerator","ContentListTable","useDataListRetriever","useTranslations","jsx","useTranslations","useDataListRetriever","ContentListTable","useDataListRetriever","ContentListTable","useCurrentUserContext","useTranslations","jsx","jsxs","useTranslations","useDataListRetriever","ContentListTable","useCurrentUserContext","AttributeElement","BlockNoteEditorContainer","Card","MicroLabel","useTranslations","jsx","jsxs","useTranslations","MicroLabel","Card","BlockNoteEditorContainer","AttributeElement","registerTableGenerator","usePageUrlGenerator","Link","useTranslations","useMemo","Fragment","jsx","jsxs","useTranslations","usePageUrlGenerator","useMemo","jsxs","Link","jsx","Fragment","registerTableGenerator","Button","EntitySelector","errorToast","Modules","useTranslations","useState","useForm","Fragment","jsx","jsxs","useTranslations","useState","useForm","errorToast","Button","EntitySelector","Modules","useDataListRetriever","Button","ContentListTable","errorToast","Modules","useTranslations","useRef","useState","jsx","useTranslations","useState","useRef","useDataListRetriever","Modules","errorToast","Button","ContentListTable","useDataListRetriever","Button","ContentListTable","errorToast","Modules","useTranslations","useRef","useState","Fragment","jsx","jsxs","useTranslations","useState","useRef","useDataListRetriever","Modules","errorToast","Button","ContentListTable","Command","CommandItem","CommandList","FormFieldWrapper","Input","Popover","PopoverContent","PopoverTrigger","useDataListRetriever","useDebounce","CircleX","RefreshCwIcon","SearchIcon","XIcon","useTranslations","useCallback","useEffect","useRef","useState","Fragment","jsx","jsxs","useTranslations","useState","useRef","useDataListRetriever","useCallback","useDebounce","useEffect","FormFieldWrapper","Popover","PopoverTrigger","CircleX","PopoverContent","Command","SearchIcon","Input","RefreshCwIcon","XIcon","CommandList","CommandItem","EntitySelector","useTranslations","useEffect","useState","jsx","useTranslations","useState","useEffect","EntitySelector","useI18nRouter","EditorSheet","FileInput","FileUploader","FormBlockNote","FormInput","useCurrentUserContext","Action","entityObjectSchema","S3Service","zodResolver","UploadIcon","useTranslations","useCallback","useEffect","useMemo","useState","useForm","v4","z","jsx","jsxs","useI18nRouter","useTranslations","useCurrentUserContext","useState","useEffect","useMemo","z","entityObjectSchema","useCallback","v4","useForm","zodResolver","EditorSheet","S3Service","FormInput","FormBlockNote","FileUploader","FileInput","UploadIcon","Action","Image","useState","jsx","jsxs","useState","Image","cellDate","cellId","registerTableGenerator","usePageUrlGenerator","Link","Tooltip","TooltipContent","TooltipTrigger","useTranslations","useMemo","jsx","jsxs","useTranslations","usePageUrlGenerator","useMemo","cellId","Tooltip","TooltipTrigger","Link","TooltipContent","cellDate","registerTableGenerator","ContentListTable","useDataListRetriever","useTranslations","jsx","useTranslations","useDataListRetriever","ContentListTable","Tabs","TabsContent","TabsList","TabsTrigger","useCurrentUserContext","Action","useTranslations","jsx","jsxs","useTranslations","Tabs","TabsList","TabsTrigger","TabsContent","useCurrentUserContext","Action","EntityMultiSelector","useTranslations","jsx","useTranslations","EntityMultiSelector","Badge","Button","errorToast","useCurrentUserContext","useTranslations","useState","jsx","jsxs","useTranslations","useCurrentUserContext","useState","errorToast","Badge","Button","CommonDeleter","usePageUrlGenerator","useTranslations","jsx","useTranslations","usePageUrlGenerator","CommonDeleter","SharedProvider","usePageUrlGenerator","rehydrate","useTranslations","createContext","useContext","useState","jsx","createContext","usePageUrlGenerator","useTranslations","useState","rehydrate","SharedProvider","useContext","useDataListRetriever","ContentListTable","RoundPageContainer","useCurrentUserContext","getRoleId","useTranslations","jsx","jsxs","useTranslations","useDataListRetriever","ContentListTable","useCurrentUserContext","getRoleId","RoundPageContainer","AttributeElement","BlockNoteEditorContainer","Card","MicroLabel","useTranslations","jsx","jsxs","useTranslations","MicroLabel","Card","BlockNoteEditorContainer","AttributeElement","Button","Dialog","DialogContent","DialogFooter","DialogHeader","DialogTitle","EntitySelector","errorToast","FormFieldWrapper","Modules","UserService","useTranslations","useState","useForm","Fragment","jsx","jsxs","useTranslations","useState","useForm","errorToast","Button","Dialog","DialogContent","DialogHeader","DialogTitle","EntitySelector","Modules","UserService","FormFieldWrapper","DialogFooter","errorToast","Select","SelectContent","SelectItem","SelectTrigger","SelectValue","useTranslations","useState","Fragment","jsx","jsxs","roles","useTranslations","useState","errorToast","Select","SelectTrigger","SelectValue","SelectContent","SelectItem","useDataListRetriever","Button","ContentListTable","errorToast","Modules","useTranslations","useRef","useState","jsx","useTranslations","useState","useRef","useDataListRetriever","Modules","errorToast","Button","ContentListTable","useDataListRetriever","Button","ContentListTable","errorToast","Modules","useTranslations","useRef","useState","Fragment","jsx","jsxs","useTranslations","useState","useRef","useDataListRetriever","Modules","errorToast","Button","ContentListTable","Command","CommandItem","CommandList","FormFieldWrapper","Input","Popover","PopoverContent","PopoverTrigger","useDataListRetriever","useDebounce","CircleX","RefreshCwIcon","SearchIcon","XIcon","useTranslations","useCallback","useEffect","useRef","useState","Fragment","jsx","jsxs","useTranslations","useState","useRef","useDataListRetriever","useCallback","useDebounce","useEffect","FormFieldWrapper","Popover","PopoverTrigger","CircleX","PopoverContent","Command","SearchIcon","Input","RefreshCwIcon","XIcon","CommandList","CommandItem","useI18nRouter","EditorSheet","FormBlockNote","FormInput","useCurrentUserContext","Action","entityObjectSchema","zodResolver","useTranslations","useCallback","useMemo","useState","useForm","v4","z","jsx","jsxs","useI18nRouter","useTranslations","useMemo","z","entityObjectSchema","useCallback","v4","useForm","zodResolver","useState","EditorSheet","FormInput","FormBlockNote","useCurrentUserContext","Action","cellDate","cellId","registerTableGenerator","usePageUrlGenerator","Link","Tooltip","TooltipContent","TooltipTrigger","useTranslations","useMemo","jsx","jsxs","useTranslations","usePageUrlGenerator","useMemo","cellId","Tooltip","TooltipTrigger","Link","TooltipContent","cellDate","registerTableGenerator","ContentListTable","useDataListRetriever","useTranslations","jsx","useTranslations","useDataListRetriever","ContentListTable","RoundPageContainer","useCurrentUserContext","Action","useTranslations","jsx","useTranslations","RoundPageContainer","useCurrentUserContext","Action","EntityMultiSelector","useTranslations","jsx","useTranslations","EntityMultiSelector","jsx","jsx","CommonDeleter","usePageUrlGenerator","useTranslations","jsx","useTranslations","usePageUrlGenerator","CommonDeleter","SharedProvider","usePageUrlGenerator","rehydrate","useTranslations","createContext","useContext","useState","jsx","createContext","usePageUrlGenerator","useTranslations","useState","rehydrate","SharedProvider","useContext","RoundPageContainer","jsx","RoundPageContainer","AttributeElement","BlockNoteEditorContainer","Card","MicroLabel","useTranslations","jsx","jsxs","useTranslations","MicroLabel","Card","BlockNoteEditorContainer","AttributeElement","RoundPageContainer","useCurrentUserContext","Action","useTranslations","jsx","useTranslations","RoundPageContainer","useCurrentUserContext","Action","jsx","jsx","CommonDeleter","usePageUrlGenerator","useTranslations","jsx","useTranslations","usePageUrlGenerator","CommonDeleter","useI18nRouter","EditorSheet","FormBlockNote","FormInput","useCurrentUserContext","Action","entityObjectSchema","zodResolver","useTranslations","useCallback","useMemo","useState","useForm","v4","z","jsx","jsxs","useI18nRouter","useTranslations","useMemo","z","entityObjectSchema","useCallback","v4","useForm","zodResolver","useState","EditorSheet","FormInput","FormBlockNote","useCurrentUserContext","Action","SharedProvider","usePageUrlGenerator","rehydrate","useTranslations","createContext","useContext","useState","jsx","createContext","usePageUrlGenerator","useTranslations","useState","rehydrate","SharedProvider","useContext","cellDate","cellId","registerTableGenerator","usePageUrlGenerator","Link","Tooltip","TooltipContent","TooltipTrigger","useTranslations","useMemo","jsx","jsxs","useTranslations","usePageUrlGenerator","useMemo","cellId","Tooltip","TooltipTrigger","Link","TooltipContent","cellDate","registerTableGenerator","ContentListTable","useDataListRetriever","useTranslations","jsx","useTranslations","useDataListRetriever","ContentListTable","RoundPageContainer","jsx","RoundPageContainer","Button","Dialog","DialogContent","DialogFooter","DialogHeader","DialogTitle","EntitySelector","errorToast","FormFieldWrapper","Select","SelectContent","SelectItem","SelectTrigger","SelectValue","Modules","UserService","useTranslations","useState","useForm","Fragment","jsx","jsxs","useTranslations","useState","useForm","errorToast","Button","Dialog","DialogContent","DialogHeader","DialogTitle","EntitySelector","Modules","UserService","FormFieldWrapper","Select","SelectTrigger","SelectValue","SelectContent","SelectItem","DialogFooter","Button","Dialog","DialogContent","DialogFooter","DialogHeader","DialogTitle","errorToast","FormFieldWrapper","Select","SelectContent","SelectItem","SelectTrigger","SelectValue","useCurrentUserContext","useTranslations","useState","useForm","Fragment","jsx","jsxs","useTranslations","useCurrentUserContext","useState","useForm","errorToast","Button","Dialog","DialogContent","DialogHeader","DialogTitle","FormFieldWrapper","Select","SelectTrigger","SelectValue","SelectContent","SelectItem","DialogFooter","errorToast","Select","SelectContent","SelectItem","SelectTrigger","SelectValue","useTranslations","useState","Fragment","jsx","jsxs","proficiencies","useTranslations","useState","errorToast","Select","SelectTrigger","SelectValue","SelectContent","SelectItem","BlockNoteEditorContainer","Button","Card","errorToast","MicroLabel","UserAvatar","useTranslations","jsx","jsxs","useTranslations","errorToast","MicroLabel","Card","BlockNoteEditorContainer","UserAvatar","Button","RoundPageContainer","useCurrentUserContext","Action","useTranslations","jsx","useTranslations","RoundPageContainer","useCurrentUserContext","Action","EntityMultiSelector","useTranslations","jsx","useTranslations","EntityMultiSelector","jsx","jsx","registerTableGenerator","usePageUrlGenerator","cellDate","Link","Modules","useTranslations","useMemo","jsx","useTranslations","usePageUrlGenerator","useMemo","jsx","Link","Modules","cellDate","registerTableGenerator","useDataListRetriever","Button","ContentListTable","errorToast","useTranslations","Fragment","jsx","jsxs","useTranslations","useDataListRetriever","errorToast","Button","ContentListTable","RoundPageContainer","SharedProvider","usePageUrlGenerator","useTranslations","jsx","useTranslations","usePageUrlGenerator","SharedProvider","RoundPageContainer","jsx"]}
|