@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":["/home/runner/work/nja-knowledge/nja-knowledge/dist/web/index.js","../../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"],"names":["registerTableGenerator"],"mappings":"AAAA,+iCAAY;AACZ;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,uDAA6B;AAC7B;AACA;ACKA,IAAM,IAAA,kBAAM,MAAA,CAAO,GAAA,CAAI,kBAAkB,CAAA;AAElC,SAAS,oBAAA,CAAqB,MAAA,EAAiC;AACpE,EAAC,UAAA,CAAkD,GAAG,EAAA,EAAI,MAAA;AAC5D;AAFgB,qCAAA,oBAAA,EAAA,sBAAA,CAAA;AAIT,SAAS,oBAAA,CAAA,EAA0C;AACxD,EAAA,MAAM,OAAA,EAAU,UAAA,CAAkD,GAAG,CAAA;AACrE,EAAA,GAAA,CAAI,CAAC,MAAA,EAAQ,MAAM,IAAI,KAAA,CAAM,sDAAsD,CAAA;AACnF,EAAA,OAAO,MAAA;AACT;AAJgB,qCAAA,oBAAA,EAAA,sBAAA,CAAA;ADChB;AACA;AElCA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA,oEACK;AACP,wDAA0B;AAC1B,qCAAgC;AAChC,8BAAkC;AAClC,gDAAwB;AAoElB,+CAAA;AA9DN,IAAM,kBAAA,EAAyC,CAAC,aAAA,EAAe,SAAA,EAAW,UAAU,CAAA;AAgBpF,SAAS,eAAA,CAAgB,MAAA,EAA4F;AACnH,EAAA,MAAM,EAAE,MAAA,EAAQ,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A;AAGlC,UAAA;AACN,QAAA;AACF,QAAA;AACiD,MAAA;AACnD,MAAA;AAIA,IAAA;AAAA,EAAA;AAGN;AAvBwB;A/HsiOxB;AACA;AgI3iOS;AADF;AACL,EAAA;AACF;AAFgB;AhIkjOhB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"/home/runner/work/nja-knowledge/nja-knowledge/dist/web/index.js","sourcesContent":[null,"\"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"]}
|