@manta-eu/react 0.1.1 → 0.1.2

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.
Files changed (410) hide show
  1. package/README.md +2 -5
  2. package/dist/components/breadcrumbs/index.d.ts +26 -0
  3. package/dist/components/breadcrumbs/index.d.ts.map +1 -0
  4. package/dist/components/breadcrumbs/index.js +36 -0
  5. package/dist/components/chip/index.d.ts +14 -0
  6. package/dist/components/chip/index.d.ts.map +1 -0
  7. package/dist/components/chip/index.js +8 -0
  8. package/dist/components/editable-text/index.d.ts +13 -0
  9. package/dist/components/editable-text/index.d.ts.map +1 -0
  10. package/dist/components/editable-text/index.js +61 -0
  11. package/dist/components/explain-fact/ExplainFact.d.ts +16 -0
  12. package/dist/components/explain-fact/ExplainFact.d.ts.map +1 -0
  13. package/dist/components/{rdfox-explain/RDFoxExplain.js → explain-fact/ExplainFact.js} +12 -12
  14. package/dist/components/explain-fact/OutdatedFactNotice.d.ts.map +1 -0
  15. package/dist/components/input/index.d.ts +2 -0
  16. package/dist/components/input/index.d.ts.map +1 -1
  17. package/dist/components/input/index.js +2 -0
  18. package/dist/components/input/input-numeric.d.ts +19 -0
  19. package/dist/components/input/input-numeric.d.ts.map +1 -0
  20. package/dist/components/input/input-numeric.js +85 -0
  21. package/dist/components/input/input-tags.d.ts +17 -0
  22. package/dist/components/input/input-tags.d.ts.map +1 -0
  23. package/dist/components/input/input-tags.js +46 -0
  24. package/dist/components/multi-select/index.d.ts +32 -0
  25. package/dist/components/multi-select/index.d.ts.map +1 -0
  26. package/dist/components/multi-select/index.js +33 -0
  27. package/dist/components/multi-select/toggle-value.d.ts +2 -0
  28. package/dist/components/multi-select/toggle-value.d.ts.map +1 -0
  29. package/dist/components/multi-select/toggle-value.js +3 -0
  30. package/dist/components/sidebar/index.d.ts +4 -1
  31. package/dist/components/sidebar/index.d.ts.map +1 -1
  32. package/dist/components/sidebar/index.js +2 -2
  33. package/dist/components/skeleton/index.js +1 -1
  34. package/dist/components/tool-invocation-card/ExplainFactResultDisplay.d.ts +9 -0
  35. package/dist/components/tool-invocation-card/ExplainFactResultDisplay.d.ts.map +1 -0
  36. package/dist/components/tool-invocation-card/{ExplainRDFoxResultDisplay.js → ExplainFactResultDisplay.js} +3 -3
  37. package/dist/components/tool-invocation-card/ToolOutputRenderer.js +2 -2
  38. package/dist/components/tool-invocation-card/types.d.ts +4 -4
  39. package/dist/components/tool-invocation-card/types.d.ts.map +1 -1
  40. package/dist/components/tool-invocation-card/types.js +2 -2
  41. package/dist/components/tree-multi-select/index.d.ts +1 -1
  42. package/dist/components/tree-multi-select/index.d.ts.map +1 -1
  43. package/dist/components/tree-multi-select/index.js +1 -1
  44. package/dist/components/tree-multi-select/tree-multi-select-rows.d.ts +2 -1
  45. package/dist/components/tree-multi-select/tree-multi-select-rows.d.ts.map +1 -1
  46. package/dist/components/tree-multi-select/tree-multi-select-rows.js +21 -31
  47. package/dist/components/tree-multi-select/tree-multi-select.d.ts +2 -0
  48. package/dist/components/tree-multi-select/tree-multi-select.d.ts.map +1 -1
  49. package/dist/components/tree-multi-select/tree-multi-select.js +21 -8
  50. package/dist/explain-fact/DatalogCode.d.ts.map +1 -0
  51. package/dist/explain-fact/EntityChip.d.ts.map +1 -0
  52. package/dist/explain-fact/EntityChip.js +17 -0
  53. package/dist/explain-fact/ExplainCompactView.d.ts.map +1 -0
  54. package/dist/explain-fact/ExplainFactState.d.ts +7 -0
  55. package/dist/explain-fact/ExplainFactState.d.ts.map +1 -0
  56. package/dist/{rdfox-explain/RDFoxExplainState.js → explain-fact/ExplainFactState.js} +1 -1
  57. package/dist/explain-fact/ExplainFullView.d.ts.map +1 -0
  58. package/dist/explain-fact/ExplainStates.d.ts.map +1 -0
  59. package/dist/explain-fact/ExplainTag.d.ts.map +1 -0
  60. package/dist/explain-fact/FactNotice.d.ts +7 -0
  61. package/dist/explain-fact/FactNotice.d.ts.map +1 -0
  62. package/dist/explain-fact/FactNotice.js +25 -0
  63. package/dist/explain-fact/FactValue.d.ts.map +1 -0
  64. package/dist/explain-fact/NumDot.d.ts.map +1 -0
  65. package/dist/explain-fact/PanelLabel.d.ts.map +1 -0
  66. package/dist/explain-fact/ProofSubjectHeader.d.ts.map +1 -0
  67. package/dist/explain-fact/ProvenanceBadge.d.ts.map +1 -0
  68. package/dist/{rdfox-explain → explain-fact}/ProvenanceBadge.js +2 -1
  69. package/dist/explain-fact/RuleVariableTypes.d.ts.map +1 -0
  70. package/dist/explain-fact/SubstitutedFactNotice.d.ts.map +1 -0
  71. package/dist/explain-fact/ValuePill.d.ts.map +1 -0
  72. package/dist/explain-fact/conclusion/ConclusionCard.d.ts.map +1 -0
  73. package/dist/explain-fact/conclusion/ConclusionSubtitle.d.ts.map +1 -0
  74. package/dist/{rdfox-explain → explain-fact}/conclusion/ConclusionSubtitle.js +3 -1
  75. package/dist/explain-fact/conclusion/index.d.ts.map +1 -0
  76. package/dist/explain-fact/explain-styles.d.ts.map +1 -0
  77. package/dist/explain-fact/fact-token.d.ts.map +1 -0
  78. package/dist/explain-fact/formula-hues.d.ts.map +1 -0
  79. package/dist/{rdfox-explain → explain-fact}/index.d.ts +2 -3
  80. package/dist/explain-fact/index.d.ts.map +1 -0
  81. package/dist/{rdfox-explain → explain-fact}/index.js +2 -3
  82. package/dist/explain-fact/inspector/ExplainInspector.d.ts.map +1 -0
  83. package/dist/explain-fact/inspector/ExplainInspector.js +20 -0
  84. package/dist/explain-fact/inspector/InspectorBindings.d.ts.map +1 -0
  85. package/dist/explain-fact/inspector/InspectorFact.d.ts.map +1 -0
  86. package/dist/explain-fact/inspector/InspectorHeader.d.ts.map +1 -0
  87. package/dist/{rdfox-explain → explain-fact}/inspector/InspectorRule.d.ts +3 -0
  88. package/dist/explain-fact/inspector/InspectorRule.d.ts.map +1 -0
  89. package/dist/{rdfox-explain → explain-fact}/inspector/InspectorRule.js +4 -5
  90. package/dist/explain-fact/inspector/SupportsSection.d.ts.map +1 -0
  91. package/dist/{rdfox-explain → explain-fact}/inspector/SupportsSection.js +2 -1
  92. package/dist/explain-fact/inspector/index.d.ts.map +1 -0
  93. package/dist/explain-fact/proof-tree/ProofFactLabel.d.ts.map +1 -0
  94. package/dist/explain-fact/proof-tree/ProofRowBadge.d.ts.map +1 -0
  95. package/dist/explain-fact/proof-tree/ProofRowContent.d.ts.map +1 -0
  96. package/dist/explain-fact/proof-tree/ProofRowValue.d.ts.map +1 -0
  97. package/dist/explain-fact/proof-tree/ProofTree.d.ts.map +1 -0
  98. package/dist/{rdfox-explain → explain-fact}/proof-tree/ProofTree.js +1 -1
  99. package/dist/explain-fact/proof-tree/ProofTreeFormulaFooter.d.ts.map +1 -0
  100. package/dist/explain-fact/proof-tree/ProofTreeNode.d.ts.map +1 -0
  101. package/dist/explain-fact/proof-tree/SupportsTag.d.ts.map +1 -0
  102. package/dist/explain-fact/proof-tree/SupportsTag.js +6 -0
  103. package/dist/explain-fact/proof-tree/index.d.ts.map +1 -0
  104. package/dist/explain-fact/proof-tree/proof-tree-navigation.d.ts.map +1 -0
  105. package/dist/explain-fact/proof-tree/proof-tree-root-view.d.ts.map +1 -0
  106. package/dist/explain-fact/proof-tree/visible-premises.d.ts.map +1 -0
  107. package/dist/explain-fact/rule-presentation.d.ts.map +1 -0
  108. package/dist/{rdfox-explain → explain-fact}/tree-model.d.ts +18 -9
  109. package/dist/explain-fact/tree-model.d.ts.map +1 -0
  110. package/dist/{rdfox-explain → explain-fact}/tree-model.js +19 -10
  111. package/dist/explain-fact/use-fact-measure.d.ts.map +1 -0
  112. package/dist/globals.css +237 -18
  113. package/dist/hooks/useValidateActionPlan.d.ts.map +1 -1
  114. package/dist/index.d.ts +3 -0
  115. package/dist/index.d.ts.map +1 -1
  116. package/dist/index.js +3 -0
  117. package/dist/ldo-ui.d.ts +1 -1
  118. package/dist/ldo-ui.d.ts.map +1 -1
  119. package/dist/ldo-ui.js +1 -1
  120. package/dist/lib/datastore-route-paths.d.ts +2 -2
  121. package/dist/lib/datastore-route-paths.d.ts.map +1 -1
  122. package/dist/lib/datastore-route-paths.js +2 -2
  123. package/dist/lib/datastore-route-table.d.ts +36 -0
  124. package/dist/lib/datastore-route-table.d.ts.map +1 -0
  125. package/dist/lib/datastore-route-table.js +43 -0
  126. package/dist/lib/datastore-routes.d.ts +1 -1
  127. package/dist/lib/datastore-routes.d.ts.map +1 -1
  128. package/dist/lib/datastore-routes.js +1 -1
  129. package/dist/lib/spa-routes.d.ts +3 -0
  130. package/dist/lib/spa-routes.d.ts.map +1 -0
  131. package/dist/lib/spa-routes.js +5 -0
  132. package/dist/routes/data-explorer/components/Breadcrumbs.d.ts.map +1 -1
  133. package/dist/routes/data-explorer/components/Breadcrumbs.js +5 -5
  134. package/dist/routes/datastores/components/DatastoreFormDialog.d.ts +18 -0
  135. package/dist/routes/datastores/components/DatastoreFormDialog.d.ts.map +1 -0
  136. package/dist/routes/datastores/components/DatastoreFormDialog.js +27 -0
  137. package/dist/routes/datastores/components/DatastoreTableSkeleton.d.ts +2 -0
  138. package/dist/routes/datastores/components/DatastoreTableSkeleton.d.ts.map +1 -0
  139. package/dist/routes/datastores/components/DatastoreTableSkeleton.js +7 -0
  140. package/dist/routes/datastores/components/DatastoresToolbar.d.ts +18 -0
  141. package/dist/routes/datastores/components/DatastoresToolbar.d.ts.map +1 -0
  142. package/dist/routes/datastores/components/DatastoresToolbar.js +29 -0
  143. package/dist/routes/datastores/components/LinkUnlinkedDatastoreDialog.d.ts +14 -0
  144. package/dist/routes/datastores/components/LinkUnlinkedDatastoreDialog.d.ts.map +1 -0
  145. package/dist/routes/datastores/components/LinkUnlinkedDatastoreDialog.js +83 -0
  146. package/dist/routes/datastores/components/RenameDatastoreGroupDialog.d.ts +9 -0
  147. package/dist/routes/datastores/components/RenameDatastoreGroupDialog.d.ts.map +1 -0
  148. package/dist/routes/datastores/components/RenameDatastoreGroupDialog.js +21 -0
  149. package/dist/routes/datastores/components/StatusBadge.d.ts +21 -0
  150. package/dist/routes/datastores/components/StatusBadge.d.ts.map +1 -0
  151. package/dist/routes/datastores/components/StatusBadge.js +49 -0
  152. package/dist/routes/datastores/components/UnlinkedDatastoresPanel.d.ts +20 -0
  153. package/dist/routes/datastores/components/UnlinkedDatastoresPanel.d.ts.map +1 -0
  154. package/dist/routes/datastores/components/UnlinkedDatastoresPanel.js +13 -0
  155. package/dist/routes/datastores/flatten.d.ts +33 -0
  156. package/dist/routes/datastores/flatten.d.ts.map +1 -0
  157. package/dist/routes/datastores/flatten.js +86 -0
  158. package/dist/routes/datastores/hooks/useDatastoreColumns.d.ts +47 -0
  159. package/dist/routes/datastores/hooks/useDatastoreColumns.d.ts.map +1 -0
  160. package/dist/routes/datastores/hooks/useDatastoreColumns.js +165 -0
  161. package/dist/routes/datastores/hooks/useDatastoreTable.d.ts +14 -0
  162. package/dist/routes/datastores/hooks/useDatastoreTable.d.ts.map +1 -0
  163. package/dist/routes/datastores/hooks/useDatastoreTable.js +45 -0
  164. package/dist/routes/datastores/index.d.ts +2 -0
  165. package/dist/routes/datastores/index.d.ts.map +1 -0
  166. package/dist/routes/datastores/index.js +467 -0
  167. package/dist/routes/explain/ExplainEmpty.d.ts +2 -0
  168. package/dist/routes/explain/ExplainEmpty.d.ts.map +1 -0
  169. package/dist/routes/explain/ExplainEmpty.js +8 -0
  170. package/dist/routes/explain/index.d.ts +2 -0
  171. package/dist/routes/explain/index.d.ts.map +1 -0
  172. package/dist/routes/explain/index.js +16 -0
  173. package/dist/routes/explain/url-params.d.ts +9 -0
  174. package/dist/routes/explain/url-params.d.ts.map +1 -0
  175. package/dist/routes/explain/url-params.js +21 -0
  176. package/dist/routes/integrations/components/ConnectionRow.d.ts.map +1 -1
  177. package/dist/routes/integrations/components/ConnectionRow.js +1 -1
  178. package/dist/routes/integrations/connection-view.d.ts.map +1 -1
  179. package/dist/routes/integrations/connection-view.js +17 -1
  180. package/dist/routes/integrations/types.d.ts +2 -1
  181. package/dist/routes/integrations/types.d.ts.map +1 -1
  182. package/dist/routes/rules/components/CreateRuleChatModal.d.ts +10 -0
  183. package/dist/routes/rules/components/CreateRuleChatModal.d.ts.map +1 -0
  184. package/dist/routes/rules/components/CreateRuleChatModal.js +52 -0
  185. package/dist/routes/rules/components/RuleActionabilityBadge.d.ts +8 -0
  186. package/dist/routes/rules/components/RuleActionabilityBadge.d.ts.map +1 -0
  187. package/dist/routes/rules/components/RuleActionabilityBadge.js +18 -0
  188. package/dist/routes/rules/components/RuleAffectedActionPlansSection.d.ts +6 -0
  189. package/dist/routes/rules/components/RuleAffectedActionPlansSection.d.ts.map +1 -0
  190. package/dist/routes/rules/components/RuleAffectedActionPlansSection.js +151 -0
  191. package/dist/routes/rules/components/RuleAst.d.ts +6 -0
  192. package/dist/routes/rules/components/RuleAst.d.ts.map +1 -0
  193. package/dist/routes/rules/components/RuleAst.js +23 -0
  194. package/dist/routes/rules/components/RuleDependentRulesSection.d.ts +6 -0
  195. package/dist/routes/rules/components/RuleDependentRulesSection.d.ts.map +1 -0
  196. package/dist/routes/rules/components/RuleDependentRulesSection.js +16 -0
  197. package/dist/routes/rules/components/RuleDetailsPage.d.ts +14 -0
  198. package/dist/routes/rules/components/RuleDetailsPage.d.ts.map +1 -0
  199. package/dist/routes/rules/components/RuleDetailsPage.js +51 -0
  200. package/dist/routes/rules/components/RuleProducersSection.d.ts +7 -0
  201. package/dist/routes/rules/components/RuleProducersSection.d.ts.map +1 -0
  202. package/dist/routes/rules/components/RuleProducersSection.js +10 -0
  203. package/dist/routes/rules/components/RuleSampleFactsSection.d.ts +7 -0
  204. package/dist/routes/rules/components/RuleSampleFactsSection.d.ts.map +1 -0
  205. package/dist/routes/rules/components/RuleSampleFactsSection.js +70 -0
  206. package/dist/routes/rules/components/RulesOverviewHeaderActions.d.ts +17 -0
  207. package/dist/routes/rules/components/RulesOverviewHeaderActions.d.ts.map +1 -0
  208. package/dist/routes/rules/components/RulesOverviewHeaderActions.js +55 -0
  209. package/dist/routes/rules/components/RulesOverviewPage.d.ts +13 -0
  210. package/dist/routes/rules/components/RulesOverviewPage.d.ts.map +1 -0
  211. package/dist/routes/rules/components/RulesOverviewPage.js +236 -0
  212. package/dist/routes/rules/components/SupportedActionShapesList/SupportedActionShapeDetails.d.ts +7 -0
  213. package/dist/routes/rules/components/SupportedActionShapesList/SupportedActionShapeDetails.d.ts.map +1 -0
  214. package/dist/routes/rules/components/SupportedActionShapesList/SupportedActionShapeDetails.js +47 -0
  215. package/dist/routes/rules/components/SupportedActionShapesList/SupportedActionShapesList.d.ts +8 -0
  216. package/dist/routes/rules/components/SupportedActionShapesList/SupportedActionShapesList.d.ts.map +1 -0
  217. package/dist/routes/rules/components/SupportedActionShapesList/SupportedActionShapesList.js +76 -0
  218. package/dist/routes/rules/components/SupportedActionShapesList/TokenList.d.ts +6 -0
  219. package/dist/routes/rules/components/SupportedActionShapesList/TokenList.d.ts.map +1 -0
  220. package/dist/routes/rules/components/SupportedActionShapesList/TokenList.js +9 -0
  221. package/dist/routes/rules/components/SupportedActionShapesList/index.d.ts +2 -0
  222. package/dist/routes/rules/components/SupportedActionShapesList/index.d.ts.map +1 -0
  223. package/dist/routes/rules/components/SupportedActionShapesList/index.js +1 -0
  224. package/dist/routes/rules/components/SupportedActionShapesList/shacl-shape.d.ts +20 -0
  225. package/dist/routes/rules/components/SupportedActionShapesList/shacl-shape.d.ts.map +1 -0
  226. package/dist/routes/rules/components/SupportedActionShapesList/shacl-shape.js +48 -0
  227. package/dist/routes/rules/components/datalog-editor/BindingsPreview.d.ts +9 -0
  228. package/dist/routes/rules/components/datalog-editor/BindingsPreview.d.ts.map +1 -0
  229. package/dist/routes/rules/components/datalog-editor/BindingsPreview.js +38 -0
  230. package/dist/routes/rules/components/datalog-editor/FactsPreview.d.ts +10 -0
  231. package/dist/routes/rules/components/datalog-editor/FactsPreview.d.ts.map +1 -0
  232. package/dist/routes/rules/components/datalog-editor/FactsPreview.js +43 -0
  233. package/dist/routes/rules/components/datalog-editor/PreviewPanel.d.ts +7 -0
  234. package/dist/routes/rules/components/datalog-editor/PreviewPanel.d.ts.map +1 -0
  235. package/dist/routes/rules/components/datalog-editor/PreviewPanel.js +8 -0
  236. package/dist/routes/rules/components/datalog-editor/QueryResults.d.ts +9 -0
  237. package/dist/routes/rules/components/datalog-editor/QueryResults.d.ts.map +1 -0
  238. package/dist/routes/rules/components/datalog-editor/QueryResults.js +22 -0
  239. package/dist/routes/rules/components/datalog-editor/SparqlQueryPanel.d.ts +11 -0
  240. package/dist/routes/rules/components/datalog-editor/SparqlQueryPanel.d.ts.map +1 -0
  241. package/dist/routes/rules/components/datalog-editor/SparqlQueryPanel.js +21 -0
  242. package/dist/routes/rules/components/rule-producers.d.ts +15 -0
  243. package/dist/routes/rules/components/rule-producers.d.ts.map +1 -0
  244. package/dist/routes/rules/components/rule-producers.js +76 -0
  245. package/dist/routes/rules/components/sample-facts-query.d.ts +9 -0
  246. package/dist/routes/rules/components/sample-facts-query.d.ts.map +1 -0
  247. package/dist/routes/rules/components/sample-facts-query.js +71 -0
  248. package/dist/routes/rules/datalog-editor.d.ts +6 -0
  249. package/dist/routes/rules/datalog-editor.d.ts.map +1 -0
  250. package/dist/routes/rules/datalog-editor.js +7 -0
  251. package/dist/routes/rules/hooks/useRuleFactsPreview.d.ts +53 -0
  252. package/dist/routes/rules/hooks/useRuleFactsPreview.d.ts.map +1 -0
  253. package/dist/routes/rules/hooks/useRuleFactsPreview.js +214 -0
  254. package/dist/routes/rules/hooks/useSparqlQueryExecution.d.ts +14 -0
  255. package/dist/routes/rules/hooks/useSparqlQueryExecution.d.ts.map +1 -0
  256. package/dist/routes/rules/hooks/useSparqlQueryExecution.js +77 -0
  257. package/dist/routes/rules/pages.d.ts +6 -0
  258. package/dist/routes/rules/pages.d.ts.map +1 -0
  259. package/dist/routes/rules/pages.js +7 -0
  260. package/dist/rules/RuleNameLink.d.ts +6 -0
  261. package/dist/rules/RuleNameLink.d.ts.map +1 -0
  262. package/dist/rules/RuleNameLink.js +8 -0
  263. package/package.json +59 -24
  264. package/src/globals.css +5 -0
  265. package/src/themes/manta-dark.css +1 -0
  266. package/src/themes/manta.css +1 -0
  267. package/src/themes/standard.css +1 -0
  268. package/dist/components/rdfox-explain/OutdatedFactNotice.d.ts.map +0 -1
  269. package/dist/components/rdfox-explain/RDFoxExplain.d.ts +0 -16
  270. package/dist/components/rdfox-explain/RDFoxExplain.d.ts.map +0 -1
  271. package/dist/components/tool-invocation-card/ExplainRDFoxResultDisplay.d.ts +0 -9
  272. package/dist/components/tool-invocation-card/ExplainRDFoxResultDisplay.d.ts.map +0 -1
  273. package/dist/lib/test-utils.d.ts +0 -4
  274. package/dist/lib/test-utils.d.ts.map +0 -1
  275. package/dist/lib/test-utils.js +0 -16
  276. package/dist/rdfox-explain/AbsentFactNotice.d.ts +0 -5
  277. package/dist/rdfox-explain/AbsentFactNotice.d.ts.map +0 -1
  278. package/dist/rdfox-explain/AbsentFactNotice.js +0 -6
  279. package/dist/rdfox-explain/DatalogCode.d.ts.map +0 -1
  280. package/dist/rdfox-explain/EntityChip.d.ts.map +0 -1
  281. package/dist/rdfox-explain/EntityChip.js +0 -9
  282. package/dist/rdfox-explain/ExplainCompactView.d.ts.map +0 -1
  283. package/dist/rdfox-explain/ExplainFullView.d.ts.map +0 -1
  284. package/dist/rdfox-explain/ExplainStates.d.ts.map +0 -1
  285. package/dist/rdfox-explain/ExplainTag.d.ts.map +0 -1
  286. package/dist/rdfox-explain/FactValue.d.ts.map +0 -1
  287. package/dist/rdfox-explain/NumDot.d.ts.map +0 -1
  288. package/dist/rdfox-explain/PanelLabel.d.ts.map +0 -1
  289. package/dist/rdfox-explain/ProofSubjectHeader.d.ts.map +0 -1
  290. package/dist/rdfox-explain/ProvenanceBadge.d.ts.map +0 -1
  291. package/dist/rdfox-explain/RDFoxExplainState.d.ts +0 -7
  292. package/dist/rdfox-explain/RDFoxExplainState.d.ts.map +0 -1
  293. package/dist/rdfox-explain/RuleVariableTypes.d.ts.map +0 -1
  294. package/dist/rdfox-explain/StoredFactNotice.d.ts +0 -5
  295. package/dist/rdfox-explain/StoredFactNotice.d.ts.map +0 -1
  296. package/dist/rdfox-explain/StoredFactNotice.js +0 -6
  297. package/dist/rdfox-explain/SubstitutedFactNotice.d.ts.map +0 -1
  298. package/dist/rdfox-explain/ValuePill.d.ts.map +0 -1
  299. package/dist/rdfox-explain/busy-aggregate-fixture.d.ts +0 -7
  300. package/dist/rdfox-explain/busy-aggregate-fixture.d.ts.map +0 -1
  301. package/dist/rdfox-explain/busy-aggregate-fixture.js +0 -6
  302. package/dist/rdfox-explain/conclusion/ConclusionCard.d.ts.map +0 -1
  303. package/dist/rdfox-explain/conclusion/ConclusionSubtitle.d.ts.map +0 -1
  304. package/dist/rdfox-explain/conclusion/index.d.ts.map +0 -1
  305. package/dist/rdfox-explain/explain-styles.d.ts.map +0 -1
  306. package/dist/rdfox-explain/fact-token.d.ts.map +0 -1
  307. package/dist/rdfox-explain/formula-hues.d.ts.map +0 -1
  308. package/dist/rdfox-explain/index.d.ts.map +0 -1
  309. package/dist/rdfox-explain/inspector/ExplainInspector.d.ts.map +0 -1
  310. package/dist/rdfox-explain/inspector/ExplainInspector.js +0 -22
  311. package/dist/rdfox-explain/inspector/InspectorBindings.d.ts.map +0 -1
  312. package/dist/rdfox-explain/inspector/InspectorFact.d.ts.map +0 -1
  313. package/dist/rdfox-explain/inspector/InspectorHeader.d.ts.map +0 -1
  314. package/dist/rdfox-explain/inspector/InspectorRule.d.ts.map +0 -1
  315. package/dist/rdfox-explain/inspector/SupportsSection.d.ts.map +0 -1
  316. package/dist/rdfox-explain/inspector/index.d.ts.map +0 -1
  317. package/dist/rdfox-explain/proof-tree/ProofFactLabel.d.ts.map +0 -1
  318. package/dist/rdfox-explain/proof-tree/ProofRowBadge.d.ts.map +0 -1
  319. package/dist/rdfox-explain/proof-tree/ProofRowContent.d.ts.map +0 -1
  320. package/dist/rdfox-explain/proof-tree/ProofRowValue.d.ts.map +0 -1
  321. package/dist/rdfox-explain/proof-tree/ProofTree.d.ts.map +0 -1
  322. package/dist/rdfox-explain/proof-tree/ProofTreeFormulaFooter.d.ts.map +0 -1
  323. package/dist/rdfox-explain/proof-tree/ProofTreeNode.d.ts.map +0 -1
  324. package/dist/rdfox-explain/proof-tree/SupportsTag.d.ts.map +0 -1
  325. package/dist/rdfox-explain/proof-tree/SupportsTag.js +0 -6
  326. package/dist/rdfox-explain/proof-tree/index.d.ts.map +0 -1
  327. package/dist/rdfox-explain/proof-tree/proof-tree-navigation.d.ts.map +0 -1
  328. package/dist/rdfox-explain/proof-tree/proof-tree-root-view.d.ts.map +0 -1
  329. package/dist/rdfox-explain/proof-tree/visible-premises.d.ts.map +0 -1
  330. package/dist/rdfox-explain/rule-presentation.d.ts.map +0 -1
  331. package/dist/rdfox-explain/tree-model.d.ts.map +0 -1
  332. package/dist/rdfox-explain/use-fact-measure.d.ts.map +0 -1
  333. package/dist/test-support.d.ts +0 -9
  334. package/dist/test-support.d.ts.map +0 -1
  335. package/dist/test-support.js +0 -18
  336. /package/dist/components/{rdfox-explain → explain-fact}/OutdatedFactNotice.d.ts +0 -0
  337. /package/dist/components/{rdfox-explain → explain-fact}/OutdatedFactNotice.js +0 -0
  338. /package/dist/{rdfox-explain → explain-fact}/DatalogCode.d.ts +0 -0
  339. /package/dist/{rdfox-explain → explain-fact}/DatalogCode.js +0 -0
  340. /package/dist/{rdfox-explain → explain-fact}/EntityChip.d.ts +0 -0
  341. /package/dist/{rdfox-explain → explain-fact}/ExplainCompactView.d.ts +0 -0
  342. /package/dist/{rdfox-explain → explain-fact}/ExplainCompactView.js +0 -0
  343. /package/dist/{rdfox-explain → explain-fact}/ExplainFullView.d.ts +0 -0
  344. /package/dist/{rdfox-explain → explain-fact}/ExplainFullView.js +0 -0
  345. /package/dist/{rdfox-explain → explain-fact}/ExplainStates.d.ts +0 -0
  346. /package/dist/{rdfox-explain → explain-fact}/ExplainStates.js +0 -0
  347. /package/dist/{rdfox-explain → explain-fact}/ExplainTag.d.ts +0 -0
  348. /package/dist/{rdfox-explain → explain-fact}/ExplainTag.js +0 -0
  349. /package/dist/{rdfox-explain → explain-fact}/FactValue.d.ts +0 -0
  350. /package/dist/{rdfox-explain → explain-fact}/FactValue.js +0 -0
  351. /package/dist/{rdfox-explain → explain-fact}/NumDot.d.ts +0 -0
  352. /package/dist/{rdfox-explain → explain-fact}/NumDot.js +0 -0
  353. /package/dist/{rdfox-explain → explain-fact}/PanelLabel.d.ts +0 -0
  354. /package/dist/{rdfox-explain → explain-fact}/PanelLabel.js +0 -0
  355. /package/dist/{rdfox-explain → explain-fact}/ProofSubjectHeader.d.ts +0 -0
  356. /package/dist/{rdfox-explain → explain-fact}/ProofSubjectHeader.js +0 -0
  357. /package/dist/{rdfox-explain → explain-fact}/ProvenanceBadge.d.ts +0 -0
  358. /package/dist/{rdfox-explain → explain-fact}/RuleVariableTypes.d.ts +0 -0
  359. /package/dist/{rdfox-explain → explain-fact}/RuleVariableTypes.js +0 -0
  360. /package/dist/{rdfox-explain → explain-fact}/SubstitutedFactNotice.d.ts +0 -0
  361. /package/dist/{rdfox-explain → explain-fact}/SubstitutedFactNotice.js +0 -0
  362. /package/dist/{rdfox-explain → explain-fact}/ValuePill.d.ts +0 -0
  363. /package/dist/{rdfox-explain → explain-fact}/ValuePill.js +0 -0
  364. /package/dist/{rdfox-explain → explain-fact}/conclusion/ConclusionCard.d.ts +0 -0
  365. /package/dist/{rdfox-explain → explain-fact}/conclusion/ConclusionCard.js +0 -0
  366. /package/dist/{rdfox-explain → explain-fact}/conclusion/ConclusionSubtitle.d.ts +0 -0
  367. /package/dist/{rdfox-explain → explain-fact}/conclusion/index.d.ts +0 -0
  368. /package/dist/{rdfox-explain → explain-fact}/conclusion/index.js +0 -0
  369. /package/dist/{rdfox-explain → explain-fact}/explain-styles.d.ts +0 -0
  370. /package/dist/{rdfox-explain → explain-fact}/explain-styles.js +0 -0
  371. /package/dist/{rdfox-explain → explain-fact}/fact-token.d.ts +0 -0
  372. /package/dist/{rdfox-explain → explain-fact}/fact-token.js +0 -0
  373. /package/dist/{rdfox-explain → explain-fact}/formula-hues.d.ts +0 -0
  374. /package/dist/{rdfox-explain → explain-fact}/formula-hues.js +0 -0
  375. /package/dist/{rdfox-explain → explain-fact}/inspector/ExplainInspector.d.ts +0 -0
  376. /package/dist/{rdfox-explain → explain-fact}/inspector/InspectorBindings.d.ts +0 -0
  377. /package/dist/{rdfox-explain → explain-fact}/inspector/InspectorBindings.js +0 -0
  378. /package/dist/{rdfox-explain → explain-fact}/inspector/InspectorFact.d.ts +0 -0
  379. /package/dist/{rdfox-explain → explain-fact}/inspector/InspectorFact.js +0 -0
  380. /package/dist/{rdfox-explain → explain-fact}/inspector/InspectorHeader.d.ts +0 -0
  381. /package/dist/{rdfox-explain → explain-fact}/inspector/InspectorHeader.js +0 -0
  382. /package/dist/{rdfox-explain → explain-fact}/inspector/SupportsSection.d.ts +0 -0
  383. /package/dist/{rdfox-explain → explain-fact}/inspector/index.d.ts +0 -0
  384. /package/dist/{rdfox-explain → explain-fact}/inspector/index.js +0 -0
  385. /package/dist/{rdfox-explain → explain-fact}/proof-tree/ProofFactLabel.d.ts +0 -0
  386. /package/dist/{rdfox-explain → explain-fact}/proof-tree/ProofFactLabel.js +0 -0
  387. /package/dist/{rdfox-explain → explain-fact}/proof-tree/ProofRowBadge.d.ts +0 -0
  388. /package/dist/{rdfox-explain → explain-fact}/proof-tree/ProofRowBadge.js +0 -0
  389. /package/dist/{rdfox-explain → explain-fact}/proof-tree/ProofRowContent.d.ts +0 -0
  390. /package/dist/{rdfox-explain → explain-fact}/proof-tree/ProofRowContent.js +0 -0
  391. /package/dist/{rdfox-explain → explain-fact}/proof-tree/ProofRowValue.d.ts +0 -0
  392. /package/dist/{rdfox-explain → explain-fact}/proof-tree/ProofRowValue.js +0 -0
  393. /package/dist/{rdfox-explain → explain-fact}/proof-tree/ProofTree.d.ts +0 -0
  394. /package/dist/{rdfox-explain → explain-fact}/proof-tree/ProofTreeFormulaFooter.d.ts +0 -0
  395. /package/dist/{rdfox-explain → explain-fact}/proof-tree/ProofTreeFormulaFooter.js +0 -0
  396. /package/dist/{rdfox-explain → explain-fact}/proof-tree/ProofTreeNode.d.ts +0 -0
  397. /package/dist/{rdfox-explain → explain-fact}/proof-tree/ProofTreeNode.js +0 -0
  398. /package/dist/{rdfox-explain → explain-fact}/proof-tree/SupportsTag.d.ts +0 -0
  399. /package/dist/{rdfox-explain → explain-fact}/proof-tree/index.d.ts +0 -0
  400. /package/dist/{rdfox-explain → explain-fact}/proof-tree/index.js +0 -0
  401. /package/dist/{rdfox-explain → explain-fact}/proof-tree/proof-tree-navigation.d.ts +0 -0
  402. /package/dist/{rdfox-explain → explain-fact}/proof-tree/proof-tree-navigation.js +0 -0
  403. /package/dist/{rdfox-explain → explain-fact}/proof-tree/proof-tree-root-view.d.ts +0 -0
  404. /package/dist/{rdfox-explain → explain-fact}/proof-tree/proof-tree-root-view.js +0 -0
  405. /package/dist/{rdfox-explain → explain-fact}/proof-tree/visible-premises.d.ts +0 -0
  406. /package/dist/{rdfox-explain → explain-fact}/proof-tree/visible-premises.js +0 -0
  407. /package/dist/{rdfox-explain → explain-fact}/rule-presentation.d.ts +0 -0
  408. /package/dist/{rdfox-explain → explain-fact}/rule-presentation.js +0 -0
  409. /package/dist/{rdfox-explain → explain-fact}/use-fact-measure.d.ts +0 -0
  410. /package/dist/{rdfox-explain → explain-fact}/use-fact-measure.js +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RulesOverviewPage.d.ts","sourceRoot":"","sources":["../../../../src/routes/rules/components/RulesOverviewPage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAOhD,OAAO,EAAmC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAIxE,OAAO,EAGL,KAAK,uBAAuB,EAC7B,MAAM,sBAAsB,CAAC;AAmE9B,MAAM,MAAM,sBAAsB,GAAG;IACnC,KAAK,EAAE,OAAO,EAAE,CAAC;IACjB,qBAAqB,CAAC,EAAE,SAAS,uBAAuB,EAAE,CAAC;IAC3D,iBAAiB,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChD,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB,CAAC;AAoEF,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,2CA2W9D"}
@@ -0,0 +1,236 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { compactUri } from "@manta-eu/client/shared/rdf-namespaces";
3
+ import { isPresent } from "@manta-eu/lib/present";
4
+ import { useReactTable } from "@tanstack/react-table";
5
+ import { Copy, Eye, FileCode2, Layers, MoreHorizontal, Sparkles } from "lucide-react";
6
+ import { parseAsInteger, parseAsString, parseAsStringEnum, useQueryState } from "nuqs";
7
+ import { useCallback, useEffect, useMemo } from "react";
8
+ import { Link as RouterLink, useLocation, useNavigate } from "react-router";
9
+ import { toast } from "sonner";
10
+ import { useLocalStorage } from "usehooks-ts";
11
+ import { analyzeRuleActionability, } from "./rule-actionability.js";
12
+ import { RuleOwnershipBadge } from "./RuleOwnershipBadge.js";
13
+ import { filterRulesByActionability, filterRulesByQuery, getRuleDisplayName, getRuleDisplayText, getRuleHref, getRuleOwnerName, getRulePreview, getRuleStatus, sortRulesForDisplay, } from "./rules.utils.js";
14
+ import { RuleStatusBadge } from "./RuleStatusBadge.js";
15
+ import { Badge } from "#components/badge/index";
16
+ import { Banner } from "#components/banner/index";
17
+ import { Button } from "#components/button/index";
18
+ import { Dropdown, DropdownContent, DropdownGroup, DropdownItem, DropdownTrigger } from "#components/dropdown/index";
19
+ import { EmptyState } from "#components/empty-state/index";
20
+ import { FilterSection, FilterSheet } from "#components/filter-sheet/index";
21
+ import { Input } from "#components/input/index";
22
+ import { PageBody } from "#components/layouts/page/index";
23
+ import { Loader } from "#components/loader/index";
24
+ import { PaginationBlock } from "#components/pagination/index";
25
+ import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "#components/select/index";
26
+ import { createTableConfig, DataTable, TableColumnRearrangePopover, useTableState } from "#components/table/index";
27
+ import { shouldClampPageIndex, useFittedPagination } from "#hooks/useFittedPagination";
28
+ import { cn } from "#lib/utils";
29
+ const tableKey = "rules-overview-table";
30
+ const rulesTableGeometry = {
31
+ headerRowHeight: 52,
32
+ rowHeight: 60,
33
+ reservedHeight: 58,
34
+ };
35
+ const rulesOverviewExplainerStorageKey = "rules-overview-explainer-dismissed";
36
+ const actionabilityFilterValues = ["all", "automatic", "manual"];
37
+ const parseAsActionabilityFilter = parseAsStringEnum([...actionabilityFilterValues]).withDefault("all");
38
+ const statusFilterValues = ["all", "committed", "new", "modified", "deleted"];
39
+ const parseAsStatusFilter = parseAsStringEnum([...statusFilterValues]).withDefault("all");
40
+ const ruleColumnIds = {
41
+ rule: "rule",
42
+ actionability: "actionability",
43
+ plans: "plans",
44
+ layer: "layer",
45
+ status: "status",
46
+ owner: "owner",
47
+ actions: "actions",
48
+ };
49
+ const defaultColumnOrder = Object.values(ruleColumnIds);
50
+ const defaultSorting = [{ id: ruleColumnIds.layer, desc: true }];
51
+ const ruleColumnLabels = {
52
+ [ruleColumnIds.rule]: "Rule",
53
+ [ruleColumnIds.actionability]: "Type",
54
+ [ruleColumnIds.plans]: "Plans",
55
+ [ruleColumnIds.layer]: "Layer",
56
+ [ruleColumnIds.status]: "Status",
57
+ [ruleColumnIds.owner]: "Owner",
58
+ };
59
+ function RuleActions(props) {
60
+ const { rule, href } = props;
61
+ async function handleCopyRule() {
62
+ try {
63
+ await navigator.clipboard.writeText(getRuleDisplayText(rule));
64
+ toast.success("Rule copied to clipboard");
65
+ }
66
+ catch (err) {
67
+ console.error("Failed to copy rule:", err);
68
+ toast.error("Failed to copy rule");
69
+ }
70
+ }
71
+ return (_jsx("div", { className: "text-right", onClick: (event) => event.stopPropagation(), children: _jsxs(Dropdown, { children: [_jsx(DropdownTrigger, { asChild: true, children: _jsx(Button, { variant: "tertiary", iconOnly: true, icon: MoreHorizontal, "aria-label": "Rule actions" }) }), _jsx(DropdownContent, { align: "end", className: "z-60", children: _jsxs(DropdownGroup, { children: [_jsx(DropdownItem, { asChild: true, children: _jsxs(RouterLink, { to: href, children: [_jsx(Eye, { size: 16 }), "View"] }) }), _jsx(DropdownItem, { icon: _jsx(Copy, { className: "size-4" }), onClick: () => void handleCopyRule(), children: "Copy rule" })] }) })] }) }));
72
+ }
73
+ function ActionabilityBadge(props) {
74
+ const { analysis } = props;
75
+ if (analysis?.isManualActioning) {
76
+ return (_jsxs(Badge, { variant: "secondary", size: "sm", children: [_jsx(FileCode2, {}), "Manual"] }));
77
+ }
78
+ return (_jsxs(Badge, { variant: "info", size: "sm", children: [_jsx(Sparkles, {}), "Automatic"] }));
79
+ }
80
+ export function RulesOverviewPage(props) {
81
+ const { rules, supportedActionShapes, ownerNameByUserId, tabs, isLoading = false, error } = props;
82
+ const navigate = useNavigate();
83
+ const location = useLocation();
84
+ const [isExplainerDismissed, setIsExplainerDismissed] = useLocalStorage(rulesOverviewExplainerStorageKey, false);
85
+ const [searchQuery, setSearchQueryRaw] = useQueryState("search", parseAsString.withDefault(""));
86
+ const [actionabilityFilter, setActionabilityFilterRaw] = useQueryState("type", parseAsActionabilityFilter);
87
+ const [statusFilter, setStatusFilterRaw] = useQueryState("status", parseAsStatusFilter);
88
+ const [pageNumberRaw, setPageNumberRaw] = useQueryState("page", parseAsInteger.withDefault(1));
89
+ const pageIndex = Math.max(0, pageNumberRaw - 1);
90
+ const setPageIndex = useCallback((value) => {
91
+ const nextPageIndex = typeof value === "function" ? value(pageIndex) : value;
92
+ void setPageNumberRaw(Math.max(0, nextPageIndex) + 1);
93
+ }, [pageIndex, setPageNumberRaw]);
94
+ const { containerRef, pageSize } = useFittedPagination({
95
+ ...rulesTableGeometry,
96
+ pageIndex,
97
+ onPageIndexChange: setPageIndex,
98
+ });
99
+ const { sorting, setSorting, columnFilters, setColumnFilters, columnVisibility, setColumnVisibility, columnOrder, setColumnOrder, rowSelection, setRowSelection, } = useTableState(tableKey, defaultSorting, {
100
+ defaultPageSize: pageSize,
101
+ useLocalState: true,
102
+ });
103
+ const actionabilityByRuleIri = useMemo(() => {
104
+ return new Map(rules.map((rule) => [
105
+ rule.ruleIri,
106
+ analyzeRuleActionability(getRuleDisplayText(rule), supportedActionShapes ?? [], rule.namedGraphs),
107
+ ]));
108
+ }, [rules, supportedActionShapes]);
109
+ const manualRulesCount = useMemo(() => rules.filter((rule) => actionabilityByRuleIri.get(rule.ruleIri)?.isManualActioning).length, [actionabilityByRuleIri, rules]);
110
+ const automaticRulesCount = rules.length - manualRulesCount;
111
+ const filteredRules = useMemo(() => {
112
+ const searchFilteredRules = filterRulesByQuery(rules, searchQuery);
113
+ const actionabilityFilteredRules = filterRulesByActionability(searchFilteredRules, actionabilityByRuleIri, actionabilityFilter);
114
+ const statusFilteredRules = statusFilter === "all"
115
+ ? actionabilityFilteredRules
116
+ : actionabilityFilteredRules.filter((rule) => getRuleStatus(rule) === statusFilter);
117
+ return sortRulesForDisplay(statusFilteredRules);
118
+ }, [actionabilityByRuleIri, actionabilityFilter, rules, searchQuery, statusFilter]);
119
+ useEffect(() => {
120
+ if (!isPresent(columnOrder)) {
121
+ setColumnOrder(defaultColumnOrder);
122
+ }
123
+ }, [columnOrder, setColumnOrder]);
124
+ const totalPages = Math.ceil(filteredRules.length / pageSize) || 1;
125
+ useEffect(() => {
126
+ if (shouldClampPageIndex({ isLoading, pageIndex, totalPages })) {
127
+ setPageIndex(totalPages - 1);
128
+ }
129
+ }, [isLoading, pageIndex, setPageIndex, totalPages]);
130
+ const columns = useMemo(() => [
131
+ {
132
+ id: ruleColumnIds.rule,
133
+ accessorFn: (rule) => getRuleDisplayName(rule.ruleIri),
134
+ enableHiding: false,
135
+ header: ruleColumnLabels[ruleColumnIds.rule],
136
+ cell: ({ row }) => {
137
+ const rule = row.original;
138
+ const href = `${getRuleHref(rule)}${location.search}`;
139
+ const label = getRuleDisplayName(rule.ruleIri);
140
+ const compactLabel = compactUri(rule.ruleIri);
141
+ const preview = getRulePreview(rule);
142
+ return (_jsxs("div", { className: "flex min-w-0 flex-col gap-1 text-left", children: [_jsx(RouterLink, { to: href, className: "truncate typography-small-medium hover:text-primary", title: compactLabel, children: label }), _jsx("span", { className: "max-w-xl truncate font-mono typography-caption text-muted-foreground", children: preview })] }));
143
+ },
144
+ },
145
+ {
146
+ id: ruleColumnIds.actionability,
147
+ accessorFn: (rule) => (actionabilityByRuleIri.get(rule.ruleIri)?.isManualActioning ? "manual" : "automatic"),
148
+ header: ruleColumnLabels[ruleColumnIds.actionability],
149
+ cell: ({ row }) => _jsx(ActionabilityBadge, { analysis: actionabilityByRuleIri.get(row.original.ruleIri) }),
150
+ },
151
+ {
152
+ id: ruleColumnIds.plans,
153
+ accessorFn: (rule) => rule.namedGraphs.length,
154
+ header: ruleColumnLabels[ruleColumnIds.plans],
155
+ meta: { type: "number" },
156
+ cell: ({ row }) => {
157
+ const count = row.original.namedGraphs.length;
158
+ return (_jsxs("span", { className: cn("inline-flex items-center gap-1.5", count === 0 && "text-muted-foreground"), children: [_jsx(Layers, { className: "size-3.5" }), count === 0 ? "—" : `${count} ${count === 1 ? "plan" : "plans"}`] }));
159
+ },
160
+ },
161
+ {
162
+ id: ruleColumnIds.layer,
163
+ accessorFn: (rule) => rule.stratumIndex ?? -1,
164
+ header: ruleColumnLabels[ruleColumnIds.layer],
165
+ meta: { type: "number" },
166
+ cell: ({ row }) => _jsx("span", { children: row.original.stratumIndex ?? "—" }),
167
+ },
168
+ {
169
+ id: ruleColumnIds.status,
170
+ accessorFn: (rule) => getRuleStatus(rule),
171
+ header: ruleColumnLabels[ruleColumnIds.status],
172
+ cell: ({ row }) => _jsx(RuleStatusBadge, { status: getRuleStatus(row.original) }),
173
+ },
174
+ {
175
+ id: ruleColumnIds.owner,
176
+ accessorFn: (rule) => getRuleOwnerName(rule, ownerNameByUserId) ?? rule.ownedBy?.type ?? "",
177
+ header: ruleColumnLabels[ruleColumnIds.owner],
178
+ cell: ({ row }) => (_jsx(RuleOwnershipBadge, { ownership: row.original.ownedBy ?? null, ownerName: getRuleOwnerName(row.original, ownerNameByUserId) })),
179
+ },
180
+ {
181
+ id: ruleColumnIds.actions,
182
+ enableHiding: false,
183
+ enableSorting: false,
184
+ cell: ({ row }) => _jsx(RuleActions, { rule: row.original, href: `${getRuleHref(row.original)}${location.search}` }),
185
+ },
186
+ ], [actionabilityByRuleIri, location.search, ownerNameByUserId]);
187
+ const table = useReactTable(createTableConfig({
188
+ data: filteredRules,
189
+ columns,
190
+ pagination: { pageIndex, pageSize },
191
+ setPagination: (updater) => {
192
+ const nextPagination = typeof updater === "function" ? updater({ pageIndex, pageSize }) : updater;
193
+ setPageIndex(nextPagination.pageIndex);
194
+ },
195
+ columnPinning: {
196
+ left: [ruleColumnIds.rule],
197
+ right: [ruleColumnIds.actions],
198
+ },
199
+ sorting,
200
+ setSorting: (updater) => {
201
+ setSorting(typeof updater === "function" ? updater(sorting) : updater);
202
+ setPageIndex(0);
203
+ },
204
+ columnFilters,
205
+ setColumnFilters,
206
+ columnVisibility,
207
+ setColumnVisibility,
208
+ columnOrder,
209
+ setColumnOrder,
210
+ rowSelection,
211
+ setRowSelection,
212
+ }));
213
+ const activeFilterCount = (isPresent(searchQuery) ? 1 : 0) + (actionabilityFilter !== "all" ? 1 : 0) + (statusFilter !== "all" ? 1 : 0);
214
+ function resetFilters() {
215
+ void setSearchQueryRaw("");
216
+ void setActionabilityFilterRaw("all");
217
+ void setStatusFilterRaw("all");
218
+ setPageIndex(0);
219
+ }
220
+ function renderTypeSelect(fullWidth = false) {
221
+ return (_jsxs(Select, { value: actionabilityFilter, onValueChange: (value) => {
222
+ void setActionabilityFilterRaw(value);
223
+ setPageIndex(0);
224
+ }, children: [_jsx(SelectTrigger, { label: "Type", id: fullWidth ? "rules-type-filter-sheet" : "rules-type-filter", hiddenLabel: true, className: fullWidth ? "w-full" : undefined, children: _jsx(SelectValue, {}) }), _jsxs(SelectContent, { children: [_jsxs(SelectItem, { value: "all", children: ["All types (", rules.length, ")"] }), _jsxs(SelectItem, { value: "automatic", children: ["Automatic (", automaticRulesCount, ")"] }), _jsxs(SelectItem, { value: "manual", children: ["Manual (", manualRulesCount, ")"] })] })] }));
225
+ }
226
+ function renderStatusSelect(fullWidth = false) {
227
+ return (_jsxs(Select, { value: statusFilter, onValueChange: (value) => {
228
+ void setStatusFilterRaw(value);
229
+ setPageIndex(0);
230
+ }, children: [_jsx(SelectTrigger, { label: "Status", id: fullWidth ? "rules-status-filter-sheet" : "rules-status-filter", hiddenLabel: true, className: fullWidth ? "w-full" : undefined, children: _jsx(SelectValue, {}) }), _jsxs(SelectContent, { children: [_jsx(SelectItem, { value: "all", children: "All statuses" }), _jsx(SelectItem, { value: "committed", children: "Committed" }), _jsx(SelectItem, { value: "new", children: "New" }), _jsx(SelectItem, { value: "modified", children: "Modified" }), _jsx(SelectItem, { value: "deleted", children: "Deleted" })] })] }));
231
+ }
232
+ return (_jsxs(_Fragment, { children: [_jsx("div", { className: "border-b border-muted-border px-5 py-6 shrink-0", children: _jsxs("div", { className: "flex flex-col gap-6", children: [!isExplainerDismissed && (_jsx(Banner, { type: "muted", size: "loose", label: "What you're looking at.", description: _jsxs("span", { children: ["Rules are the building blocks: each one observes a signal and proposes a single change. They cluster into ", _jsx("span", { className: "typography-caption-semibold text-default-foreground", children: "action plans" }), ", the strategic playbooks that actually run on a cadence. A rule used in many plans is doing a lot of work for you."] }), onClose: () => setIsExplainerDismissed(true) })), _jsxs("div", { className: "flex min-w-0 flex-wrap items-center gap-3", children: [tabs, _jsx(Input, { containerClassName: "min-w-0 flex-1 sm:w-80 sm:max-w-sm sm:flex-none", type: "search", variant: "search", placeholder: "Search rules...", value: searchQuery, onChange: (event) => {
233
+ void setSearchQueryRaw(event.target.value);
234
+ setPageIndex(0);
235
+ } }), _jsx("div", { className: "sm:hidden", children: _jsxs(FilterSheet, { activeCount: activeFilterCount, onReset: resetFilters, children: [_jsx(FilterSection, { title: "Type", children: _jsx("div", { className: "w-full", children: renderTypeSelect(true) }) }), _jsx(FilterSection, { title: "Status", children: _jsx("div", { className: "w-full", children: renderStatusSelect(true) }) })] }) }), _jsxs("div", { className: "hidden sm:contents", children: [_jsx("div", { className: "w-[180px] shrink-0", children: renderTypeSelect() }), _jsx("div", { className: "w-[160px] shrink-0", children: renderStatusSelect() })] }), _jsx("div", { className: "ml-auto hidden shrink-0 sm:block", children: _jsx(TableColumnRearrangePopover, { enableReset: true, table: table, columnLabels: ruleColumnLabels, defaultOrder: defaultColumnOrder }) })] })] }) }), _jsxs(PageBody, { className: "flex min-h-0 flex-col gap-6", children: [error && _jsx(Banner, { label: error }), _jsx("div", { ref: containerRef, className: "min-h-0 flex-1", children: isLoading ? (_jsx("div", { className: "flex h-full min-h-64 items-center justify-center", children: _jsx(Loader, { className: "size-8" }) })) : !isPresent(filteredRules) ? (_jsx(EmptyState, { icon: FileCode2, title: "No rules found", description: searchQuery ? "No rules match the current filters." : "Rules will appear here once they are available." })) : (_jsxs("div", { className: "grid w-full min-h-0 grid-cols-1 gap-6", children: [_jsx("div", { className: "rounded-xl border border-muted-border bg-card overflow-x-auto overflow-y-hidden", children: _jsx(DataTable, { table: table, isLoading: isLoading, isRowClickable: () => true, onRowClick: (row) => void navigate(`${getRuleHref(row.original)}${location.search}`) }) }), _jsx(PaginationBlock, { currentPageIndex: pageIndex, totalPages: totalPages, onPageChange: setPageIndex, showPageSize: true, pageSize: pageSize, totalCount: filteredRules.length })] })) })] })] }));
236
+ }
@@ -0,0 +1,7 @@
1
+ import type { GQLSupportedActionShape } from "@manta-eu/client";
2
+ type SupportedActionShapeDetailsProps = {
3
+ shape: GQLSupportedActionShape | null;
4
+ };
5
+ export declare function SupportedActionShapeDetails(props: SupportedActionShapeDetailsProps): import("react/jsx-runtime").JSX.Element;
6
+ export {};
7
+ //# sourceMappingURL=SupportedActionShapeDetails.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SupportedActionShapeDetails.d.ts","sourceRoot":"","sources":["../../../../../src/routes/rules/components/SupportedActionShapesList/SupportedActionShapeDetails.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAahE,KAAK,gCAAgC,GAAG;IACtC,KAAK,EAAE,uBAAuB,GAAG,IAAI,CAAC;CACvC,CAAC;AAEF,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,gCAAgC,2CA4ElF"}
@@ -0,0 +1,47 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { compactUri } from "@manta-eu/client/shared/rdf-namespaces";
3
+ import { isPresent } from "@manta-eu/lib/present";
4
+ import { buildShaclShapeQuery } from "@manta-eu/rdf-lib/shacl-shape-query";
5
+ import { useMemo } from "react";
6
+ import { match, P } from "ts-pattern";
7
+ import { formatCount, isRequired, parseShaclShapeGraph } from "./shacl-shape.js";
8
+ import { TokenList } from "./TokenList.js";
9
+ import { Graph } from "#components/graph/index";
10
+ import { Loader } from "#components/loader/index";
11
+ import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "#components/table/index";
12
+ import { useSparqlConstruct } from "#ldo-ui";
13
+ export function SupportedActionShapeDetails(props) {
14
+ const { shape } = props;
15
+ const shapeQuery = useMemo(() => (shape ? buildShaclShapeQuery(shape.actionShape) : ""), [shape]);
16
+ const { data: graph, isLoading, error, } = useSparqlConstruct({
17
+ query: shapeQuery,
18
+ queryKey: ["supported-action-shape-shacl", shape?.actionShape],
19
+ enabled: isPresent(shape),
20
+ keepPreviousData: true,
21
+ });
22
+ const summary = useMemo(() => (shape && graph ? parseShaclShapeGraph(graph, shape.actionShape) : null), [graph]);
23
+ return match(shape)
24
+ .with(null, () => _jsx("div", { className: "rounded-lg border border-muted-border bg-background p-4" }))
25
+ .otherwise((currentShape) => (_jsxs("div", { className: "min-w-0 rounded-lg border border-muted-border bg-background", children: [_jsxs("div", { className: "border-b border-muted-border p-4", children: [_jsx("p", { className: "break-all font-mono typography-small-medium", children: compactUri(currentShape.actionShape) }), _jsxs("div", { className: "mt-3 flex flex-wrap gap-2 gap-x-4", children: [summary && _jsx(LabeledTokens, { label: "Target Classes", values: summary.targetClasses.map(compactUri) }), _jsx(LabeledTokens, { label: "RDF Types", values: currentShape.rdfTypes.map(compactUri) }), _jsx(LabeledTokens, { label: "Operations", values: currentShape.operations })] })] }), match({ isLoading, error })
26
+ .with({ isLoading: true }, () => (_jsx("div", { className: "flex h-48 items-center justify-center", children: _jsx(Loader, { className: "size-8" }) })))
27
+ .with({ error: P.nonNullable }, ({ error }) => (_jsxs("div", { className: "p-4", children: [_jsx("p", { className: "typography-body text-error-foreground", children: "Error loading SHACL definition" }), _jsx("p", { className: "typography-small text-muted-foreground", children: error instanceof Error ? error.message : "Failed to load SHACL definition" })] })))
28
+ .otherwise(() => match(summary)
29
+ .with(null, () => (_jsx("div", { className: "p-4", children: _jsx("p", { className: "typography-body text-muted-foreground", children: "No SHACL definition found" }) })))
30
+ .with({ nodeCount: 0 }, () => (_jsx("div", { className: "p-4", children: _jsx("p", { className: "typography-body text-muted-foreground", children: "No SHACL definition found" }) })))
31
+ .otherwise((currentSummary) => (_jsxs("div", { className: "space-y-4 p-4 pt-0", children: [_jsxs("div", { className: "grid gap-3 sm:grid-cols-2", children: [_jsx(MetricBlock, { label: "Nodes", value: currentSummary.nodeCount.toString() }), _jsx(MetricBlock, { label: "Triples", value: currentSummary.tripleCount.toString() })] }), _jsx(PropertyConstraintsTable, { properties: currentSummary.properties }), graph && (_jsxs("div", { className: "overflow-hidden rounded-lg border border-muted-border", children: [_jsx("div", { className: "border-b border-muted-border px-3 py-2 typography-small-medium", children: "Graph" }), _jsx("div", { className: "h-120", children: _jsx(Graph, { graph: graph, fullHeight: true }) })] }))] }))))] })));
32
+ }
33
+ function PropertyConstraintsTable(props) {
34
+ const { properties } = props;
35
+ if (!isPresent(properties)) {
36
+ return _jsx("p", { className: "typography-body text-muted-foreground", children: "No property constraints found" });
37
+ }
38
+ return (_jsxs(Table, { children: [_jsx(TableHeader, { children: _jsxs(TableRow, { children: [_jsx(TableHead, { children: "Property" }), _jsx(TableHead, { children: "Required" }), _jsx(TableHead, { children: "Count" }), _jsx(TableHead, { children: "Value" }), _jsx(TableHead, { children: "Description" })] }) }), _jsx(TableBody, { children: properties.map((property) => (_jsxs(TableRow, { children: [_jsx(TableCell, { className: "whitespace-normal", children: _jsxs("div", { className: "flex min-w-48 flex-col gap-1", children: [property.name && _jsx("span", { className: "typography-small-medium", children: property.name }), _jsx("span", { className: "break-all font-mono typography-small text-muted-foreground", children: compactUri(property.path) })] }) }), _jsx(TableCell, { children: isRequired(property) ? "Yes" : "No" }), _jsx(TableCell, { children: formatCount(property) }), _jsx(TableCell, { className: "whitespace-normal", children: _jsx(TokenList, { values: property.valueTypes.map(compactUri) }) }), _jsx(TableCell, { className: "max-w-64 whitespace-normal text-muted-foreground", children: property.description || "-" })] }, property.nodeId))) })] }));
39
+ }
40
+ function LabeledTokens(props) {
41
+ const { values, label } = props;
42
+ return (_jsxs("div", { className: "space-y-1.5", children: [_jsx("p", { className: "typography-small-medium text-muted-foreground", children: label }), _jsx(TokenList, { values: values })] }));
43
+ }
44
+ function MetricBlock(props) {
45
+ const { label, value } = props;
46
+ return (_jsxs("div", { className: "rounded-lg border border-muted-border bg-muted/40 px-3 py-2", children: [_jsx("p", { className: "typography-small text-muted-foreground", children: label }), _jsx("p", { className: "typography-body-medium", children: value })] }));
47
+ }
@@ -0,0 +1,8 @@
1
+ import type { GQLSupportedActionShape } from "@manta-eu/client";
2
+ export type SupportedActionShapesListProps = {
3
+ actionShapes: GQLSupportedActionShape[];
4
+ isLoading: boolean;
5
+ error?: string | null;
6
+ };
7
+ export declare function SupportedActionShapesList(props: SupportedActionShapesListProps): import("react/jsx-runtime").JSX.Element;
8
+ //# sourceMappingURL=SupportedActionShapesList.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SupportedActionShapesList.d.ts","sourceRoot":"","sources":["../../../../../src/routes/rules/components/SupportedActionShapesList/SupportedActionShapesList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAahE,MAAM,MAAM,8BAA8B,GAAG;IAC3C,YAAY,EAAE,uBAAuB,EAAE,CAAC;IACxC,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB,CAAC;AAmBF,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,8BAA8B,2CAuG9E"}
@@ -0,0 +1,76 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { compactUri } from "@manta-eu/client/shared/rdf-namespaces";
3
+ import { isPresent } from "@manta-eu/lib/present";
4
+ import { useReactTable } from "@tanstack/react-table";
5
+ import { Check } from "lucide-react";
6
+ import { useEffect, useMemo, useState } from "react";
7
+ import { match, P } from "ts-pattern";
8
+ import { SupportedActionShapeDetails } from "./SupportedActionShapeDetails.js";
9
+ import { TokenList } from "./TokenList.js";
10
+ import { Loader } from "#components/loader/index";
11
+ import { ScrollArea } from "#components/scroll-area/index";
12
+ import { createTableConfig, DataTable } from "#components/table/index";
13
+ function OpCheck(props) {
14
+ const { active } = props;
15
+ if (!active) {
16
+ return (_jsx("span", { "aria-label": "Not supported", className: "text-muted-foreground", children: "\u2014" }));
17
+ }
18
+ return _jsx(Check, { className: "size-4 text-default-foreground", "aria-label": "Supported" });
19
+ }
20
+ export function SupportedActionShapesList(props) {
21
+ const { actionShapes, isLoading, error } = props;
22
+ const [selectedShape, setSelectedShape] = useState(actionShapes[0] ?? null);
23
+ const [sorting, setSorting] = useState([]);
24
+ useEffect(() => {
25
+ if (isPresent(actionShapes) && !selectedShape) {
26
+ setSelectedShape(actionShapes[0]);
27
+ }
28
+ }, [actionShapes, selectedShape]);
29
+ const columns = useMemo(() => [
30
+ {
31
+ id: "actionShape",
32
+ accessorFn: (row) => compactUri(row.actionShape),
33
+ header: "Action Shape",
34
+ cell: ({ row }) => (_jsx("span", { title: row.original.actionShape, className: "font-mono typography-small whitespace-normal break-all", children: compactUri(row.original.actionShape) })),
35
+ },
36
+ {
37
+ id: "rdfTypes",
38
+ accessorFn: (row) => row.rdfTypes.map(compactUri).join(","),
39
+ header: "RDF Types",
40
+ cell: ({ row }) => (_jsx("div", { className: "whitespace-normal", children: _jsx(TokenList, { values: row.original.rdfTypes.map(compactUri) }) })),
41
+ },
42
+ {
43
+ id: "create",
44
+ accessorFn: (row) => (row.supportsCreate ? 1 : 0),
45
+ sortingFn: "basic",
46
+ header: "Create",
47
+ cell: ({ row }) => _jsx(OpCheck, { active: row.original.supportsCreate }),
48
+ },
49
+ {
50
+ id: "update",
51
+ accessorFn: (row) => (row.supportsUpdate ? 1 : 0),
52
+ sortingFn: "basic",
53
+ header: "Update",
54
+ cell: ({ row }) => _jsx(OpCheck, { active: row.original.supportsUpdate }),
55
+ },
56
+ {
57
+ id: "delete",
58
+ accessorFn: (row) => (row.supportsDelete ? 1 : 0),
59
+ sortingFn: "basic",
60
+ header: "Delete",
61
+ cell: ({ row }) => _jsx(OpCheck, { active: row.original.supportsDelete }),
62
+ },
63
+ ], []);
64
+ const table = useReactTable(createTableConfig({
65
+ data: actionShapes,
66
+ columns,
67
+ sorting,
68
+ setSorting,
69
+ pagination: { pageIndex: 0, pageSize: isPresent(actionShapes) ? actionShapes.length : 1 },
70
+ }));
71
+ return match({ error, isLoading, actionShapes })
72
+ .with({ error: P.nonNullable }, ({ error }) => (_jsx("div", { className: "flex flex-1 items-center justify-center p-8", children: _jsxs("div", { className: "text-center", children: [_jsx("p", { className: "typography-body text-error-foreground", children: "Error loading action shapes" }), _jsx("p", { className: "typography-small text-muted-foreground", children: error })] }) })))
73
+ .with({ isLoading: true }, () => (_jsx("div", { className: "flex flex-1 items-center justify-center", children: _jsx(Loader, { className: "size-8" }) })))
74
+ .with({ actionShapes: P.when((shapes) => !isPresent(shapes)) }, () => (_jsx("div", { className: "flex flex-1 items-center justify-center p-8", children: _jsx("p", { className: "typography-body text-muted-foreground", children: "No supported action shapes found" }) })))
75
+ .otherwise(() => (_jsx(ScrollArea, { className: "flex-1 h-full min-h-0", children: _jsxs("div", { className: "grid flex-1 min-h-0 grid-cols-1 gap-4 overflow-auto p-4 xl:grid-cols-[minmax(0,1fr)_minmax(420px,0.9fr)]", children: [_jsx("div", { className: "min-w-0", children: _jsx(DataTable, { table: table, onRowClick: (row) => setSelectedShape(row.original), rowClassName: (row) => row.original.actionShape === selectedShape?.actionShape ? "bg-muted/70" : undefined }) }), _jsx(SupportedActionShapeDetails, { shape: selectedShape })] }) })));
76
+ }
@@ -0,0 +1,6 @@
1
+ type TokenListProps = {
2
+ values: string[];
3
+ };
4
+ export declare function TokenList(props: TokenListProps): import("react/jsx-runtime").JSX.Element;
5
+ export {};
6
+ //# sourceMappingURL=TokenList.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TokenList.d.ts","sourceRoot":"","sources":["../../../../../src/routes/rules/components/SupportedActionShapesList/TokenList.tsx"],"names":[],"mappings":"AAGA,KAAK,cAAc,GAAG;IACpB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;AAEF,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,2CAc9C"}
@@ -0,0 +1,9 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { isPresent } from "@manta-eu/lib/present";
3
+ import { Badge } from "#components/badge/index";
4
+ export function TokenList(props) {
5
+ if (!isPresent(props.values)) {
6
+ return _jsx("span", { className: "text-muted-foreground", children: "-" });
7
+ }
8
+ return (_jsx("div", { className: "flex flex-wrap gap-1.5", children: props.values.map((value) => (_jsx(Badge, { size: "sm", variant: "secondary", children: value }, value))) }));
9
+ }
@@ -0,0 +1,2 @@
1
+ export { SupportedActionShapesList, type SupportedActionShapesListProps } from "./SupportedActionShapesList.js";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/routes/rules/components/SupportedActionShapesList/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,KAAK,8BAA8B,EAAE,MAAM,6BAA6B,CAAC"}
@@ -0,0 +1 @@
1
+ export { SupportedActionShapesList } from "./SupportedActionShapesList.js";
@@ -0,0 +1,20 @@
1
+ import type { RdfGraph } from "#ldo-ui";
2
+ export type PropertyConstraint = {
3
+ nodeId: string;
4
+ path: string;
5
+ name?: string;
6
+ description?: string;
7
+ minCount?: string;
8
+ maxCount?: string;
9
+ valueTypes: string[];
10
+ };
11
+ export type ShaclShapeSummary = {
12
+ targetClasses: string[];
13
+ properties: PropertyConstraint[];
14
+ nodeCount: number;
15
+ tripleCount: number;
16
+ };
17
+ export declare function parseShaclShapeGraph(graph: RdfGraph, shapeIri: string): ShaclShapeSummary;
18
+ export declare function isRequired(property: PropertyConstraint): boolean;
19
+ export declare function formatCount(property: PropertyConstraint): string;
20
+ //# sourceMappingURL=shacl-shape.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shacl-shape.d.ts","sourceRoot":"","sources":["../../../../../src/routes/rules/components/SupportedActionShapesList/shacl-shape.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAExC,MAAM,MAAM,kBAAkB,GAAG;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,UAAU,EAAE,kBAAkB,EAAE,CAAC;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,GAAG,iBAAiB,CAWzF;AAED,wBAAgB,UAAU,CAAC,QAAQ,EAAE,kBAAkB,GAAG,OAAO,CAEhE;AAED,wBAAgB,WAAW,CAAC,QAAQ,EAAE,kBAAkB,GAAG,MAAM,CAEhE"}
@@ -0,0 +1,48 @@
1
+ import { compactUri, sh } from "@manta-eu/client/shared/rdf-namespaces";
2
+ export function parseShaclShapeGraph(graph, shapeIri) {
3
+ const propertyNodes = getTerms(graph, shapeIri, sh.property).map((term) => term.value);
4
+ return {
5
+ targetClasses: getTerms(graph, shapeIri, sh.targetClass).map((term) => term.value),
6
+ properties: propertyNodes
7
+ .map((nodeId) => parsePropertyConstraint(graph, nodeId))
8
+ .sort((a, b) => compactUri(a.path).localeCompare(compactUri(b.path))),
9
+ nodeCount: graph.size,
10
+ tripleCount: countTriples(graph),
11
+ };
12
+ }
13
+ export function isRequired(property) {
14
+ return Number(property.minCount ?? 0) > 0;
15
+ }
16
+ export function formatCount(property) {
17
+ return `${property.minCount ?? "0"}..${property.maxCount ?? "*"}`;
18
+ }
19
+ function parsePropertyConstraint(graph, nodeId) {
20
+ return {
21
+ nodeId,
22
+ path: firstTermValue(graph, nodeId, sh.path) ?? nodeId,
23
+ name: firstTermValue(graph, nodeId, sh.name),
24
+ description: firstTermValue(graph, nodeId, sh.description),
25
+ minCount: firstTermValue(graph, nodeId, sh.minCount),
26
+ maxCount: firstTermValue(graph, nodeId, sh.maxCount),
27
+ valueTypes: [
28
+ ...getTerms(graph, nodeId, sh.datatype).map((term) => term.value),
29
+ ...getTerms(graph, nodeId, sh.class).map((term) => term.value),
30
+ ...getTerms(graph, nodeId, sh.node).map((term) => term.value),
31
+ ],
32
+ };
33
+ }
34
+ function getTerms(graph, subject, predicate) {
35
+ return graph.get(subject)?.get(predicate) ?? [];
36
+ }
37
+ function firstTermValue(graph, subject, predicate) {
38
+ return getTerms(graph, subject, predicate)[0]?.value;
39
+ }
40
+ function countTriples(graph) {
41
+ let count = 0;
42
+ for (const predicates of graph.values()) {
43
+ for (const terms of predicates.values()) {
44
+ count += terms.length;
45
+ }
46
+ }
47
+ return count;
48
+ }
@@ -0,0 +1,9 @@
1
+ import { type DatalogRule } from "@manta-eu/datalog-parser";
2
+ import { type ComponentProps } from "react";
3
+ export type BindingsPreviewProps = ComponentProps<"div"> & {
4
+ ast: DatalogRule | null;
5
+ prefixes?: Record<string, string>;
6
+ limit?: number;
7
+ };
8
+ export declare const BindingsPreview: import("react").ForwardRefExoticComponent<Omit<BindingsPreviewProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
9
+ //# sourceMappingURL=BindingsPreview.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BindingsPreview.d.ts","sourceRoot":"","sources":["../../../../../src/routes/rules/components/datalog-editor/BindingsPreview.tsx"],"names":[],"mappings":"AACA,OAAO,EAA6B,KAAK,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAGvF,OAAO,EAAkC,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAM5E,MAAM,MAAM,oBAAoB,GAAG,cAAc,CAAC,KAAK,CAAC,GAAG;IACzD,GAAG,EAAE,WAAW,GAAG,IAAI,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,eAAO,MAAM,eAAe,8HA0F1B,CAAC"}
@@ -0,0 +1,38 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { namespaces } from "@manta-eu/client/shared/rdf-namespaces";
3
+ import { datalogBodyToSparqlSelect } from "@manta-eu/datalog-parser";
4
+ import { isPresent } from "@manta-eu/lib/present";
5
+ import { AlertCircle } from "lucide-react";
6
+ import { forwardRef, useEffect, useMemo } from "react";
7
+ import { useDebounceValue } from "usehooks-ts";
8
+ import { useSparqlQueryExecution } from "../../hooks/useSparqlQueryExecution.js";
9
+ import { Skeleton } from "#components/skeleton/index";
10
+ import { cn } from "#lib/utils";
11
+ export const BindingsPreview = forwardRef(function BindingsPreview(props, ref) {
12
+ const { ast, prefixes = namespaces, limit = 5, className, ...restProps } = props;
13
+ const [debouncedAst] = useDebounceValue(ast, 500);
14
+ const { sparqlQuery, variables } = useMemo(() => {
15
+ if (!debouncedAst || !isPresent(debouncedAst.body)) {
16
+ return { sparqlQuery: null, variables: [] };
17
+ }
18
+ try {
19
+ const result = datalogBodyToSparqlSelect(debouncedAst.body, prefixes);
20
+ return {
21
+ sparqlQuery: `${result.query.trim()}\nLIMIT ${limit}`,
22
+ variables: result.variables || [],
23
+ };
24
+ }
25
+ catch {
26
+ return { sparqlQuery: null, variables: [] };
27
+ }
28
+ }, [debouncedAst, prefixes, limit]);
29
+ const { executeQuery, isLoading, error, results } = useSparqlQueryExecution();
30
+ useEffect(() => {
31
+ if (sparqlQuery) {
32
+ void executeQuery(sparqlQuery);
33
+ }
34
+ }, [sparqlQuery, executeQuery]);
35
+ return (_jsxs("div", { ref: ref, className: cn("border rounded-lg overflow-hidden", className), ...restProps, children: [_jsx("div", { className: "bg-muted/30 px-4 py-2 border-b", children: _jsx("h4", { className: "typography-caption text-muted-foreground", children: "Variable Bindings Preview" }) }), _jsx("div", { className: "p-4", children: !sparqlQuery ? (_jsx("p", { className: "typography-small text-muted-foreground", children: debouncedAst
36
+ ? "Add body formulas to see variable bindings"
37
+ : "Enter a valid rule to see variable bindings" })) : isLoading ? (_jsxs("div", { className: "space-y-3", children: [_jsx(Skeleton, { className: "h-8 w-full" }), _jsx(Skeleton, { className: "h-8 w-3/4" }), _jsx(Skeleton, { className: "h-8 w-5/6" })] })) : error ? (_jsxs("div", { className: "flex items-start gap-2 text-error-foreground", children: [_jsx(AlertCircle, { className: "size-4 mt-0.5 shrink-0" }), _jsx("p", { className: "typography-small", children: error })] })) : results && isPresent(results.bindings) ? (_jsxs("div", { className: "space-y-3", children: [_jsx("div", { className: "flex flex-wrap gap-2 mb-3", children: variables.map((varName) => (_jsxs("div", { className: "px-2 py-1 bg-primary/10 text-primary rounded typography-small", children: ["?", varName] }, varName))) }), _jsx("div", { className: "space-y-2", children: results.bindings.slice(0, limit).map((binding, index) => (_jsx("div", { className: "p-2 bg-muted/20 rounded-md border border-muted", children: _jsx("div", { className: "grid grid-cols-1 gap-1", children: Object.entries(binding).map(([key, value]) => (_jsxs("div", { className: "flex gap-2", children: [_jsxs("span", { className: "typography-small text-muted-foreground", children: ["?", key, ":"] }), _jsx("span", { className: "typography-small font-mono break-all", children: value })] }, key))) }) }, index))) }), results.bindings.length > limit && (_jsxs("p", { className: "typography-small text-muted-foreground text-center", children: ["Showing ", limit, " of ", results.bindings.length, " bindings"] }))] })) : (_jsx("p", { className: "typography-small text-muted-foreground", children: "No bindings found for the current rule" })) })] }));
38
+ });
@@ -0,0 +1,10 @@
1
+ import type { DatalogRule } from "@manta-eu/datalog-parser";
2
+ import { type ComponentProps } from "react";
3
+ export type FactsPreviewProps = ComponentProps<"div"> & {
4
+ rule: string;
5
+ ast: DatalogRule | null;
6
+ prefixes?: Record<string, string>;
7
+ sampleLimit?: number;
8
+ };
9
+ export declare const FactsPreview: import("react").ForwardRefExoticComponent<Omit<FactsPreviewProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
10
+ //# sourceMappingURL=FactsPreview.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FactsPreview.d.ts","sourceRoot":"","sources":["../../../../../src/routes/rules/components/datalog-editor/FactsPreview.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAG5D,OAAO,EAAwB,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AASlE,MAAM,MAAM,iBAAiB,GAAG,cAAc,CAAC,KAAK,CAAC,GAAG;IACtD,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,WAAW,GAAG,IAAI,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAClC,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAeF,eAAO,MAAM,YAAY,2HAiIvB,CAAC"}