@cccsaurora/clue-ui 1.3.0-dev.339 → 1.3.0-dev.346

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 (72) hide show
  1. package/{ActionForm-irs9q3xm.js → ActionForm-bztRjYJE.js} +6 -6
  2. package/{AnnotationDetails-TaLlFe0h.js → AnnotationDetails-DXTY4rxn.js} +2 -2
  3. package/{AnnotationPreview-CC_9H0lC.js → AnnotationPreview-BLO29hn_.js} +2 -2
  4. package/{ClueEnrichContext-NZpr831K.js → ClueEnrichContext-fItpTzAE.js} +2 -2
  5. package/ClueUIPlugin-0udQl--U.js +452 -0
  6. package/{_baseFlatten-D3wtzJ86.js → _baseFlatten-B3PW43Vk.js} +1 -1
  7. package/_baseRest-Ca0ktDG8.js +8 -0
  8. package/{_baseUniq-BqxNeJD9.js → _baseUniq-Bx6CWGDV.js} +1 -0
  9. package/components/AnnotationDetailPopover.js +1 -1
  10. package/components/AnnotationDetails.js +3 -3
  11. package/components/AnnotationEntry.js +1 -1
  12. package/components/AnnotationPreview.js +2 -2
  13. package/components/ClassificationChip.d.ts +1 -1
  14. package/components/EnrichedCard.d.ts +1 -1
  15. package/components/EnrichedCard.js +2 -2
  16. package/components/EnrichedChip.d.ts +1 -1
  17. package/components/EnrichedChip.js +2 -2
  18. package/components/EnrichedTypography.d.ts +1 -1
  19. package/components/EnrichedTypography.js +2 -2
  20. package/components/ErrorBoundary.d.ts +1 -1
  21. package/components/RetryFailedEnrichments.js +1 -1
  22. package/components/SourcePicker.js +1 -1
  23. package/components/actions/ActionForm.js +3 -3
  24. package/components/actions/ExecutePopover.js +1 -1
  25. package/components/actions/ResultModal.js +1 -1
  26. package/components/actions/formats/index.js +13 -12
  27. package/components/display/graph/elements/NodeCard.js +3 -3
  28. package/components/display/graph/index.js +1 -1
  29. package/components/display/json/index.js +2 -2
  30. package/components/enrichment/EnrichPopover.js +1 -1
  31. package/components/fetchers/Fetcher.js +10 -9
  32. package/components/fetchers/FetcherResultView.d.ts +4 -0
  33. package/components/fetchers/FetcherResultView.js +27 -0
  34. package/components/fetchers/PreviewModal.js +2 -1
  35. package/components/group/Entry.js +1 -1
  36. package/components/group/GroupControl.js +1 -1
  37. package/components/stats/QueryStatus.js +1 -1
  38. package/en/translation.json +1 -0
  39. package/fr/translation.json +1 -0
  40. package/hooks/ClueActionContext.js +1 -1
  41. package/hooks/ClueEnrichContext.js +3 -3
  42. package/hooks/ClueGroupContext.js +1 -1
  43. package/hooks/CluePopupContext.js +2 -2
  44. package/hooks/ClueProvider.d.ts +2 -1
  45. package/hooks/ClueProvider.js +56 -4
  46. package/hooks/selectors.js +2 -2
  47. package/hooks/useActionResult.js +1 -1
  48. package/hooks/useAnnotations.js +2 -2
  49. package/hooks/useClue.js +1 -1
  50. package/hooks/useClueActions.js +1 -1
  51. package/hooks/useClueTypeConfig.js +2 -2
  52. package/hooks/useErrors.js +1 -1
  53. package/hooks/useFetcherResult.js +1 -1
  54. package/icons/Action.js +2 -2
  55. package/icons/Assessment.js +2 -2
  56. package/icons/Context.js +1 -1
  57. package/icons/Opinion.js +2 -2
  58. package/{index-CIj4pr7O.js → index-BF4c1XBg.js} +1 -1
  59. package/index-BJm74d7l.js +25 -0
  60. package/index-BdAUKhOk.js +25 -0
  61. package/index-D4mEq9G4.js +26 -0
  62. package/index-DP0SQqVY.js +25 -0
  63. package/index-Kt3RwkVk.js +22 -0
  64. package/main.d.ts +3 -1
  65. package/main.js +4 -6
  66. package/package.json +2 -1
  67. package/{sortBy-Tf6pz1tg.js → sortBy-Bjn6Gl0J.js} +2 -4
  68. package/store-Dslbt6yE.js +2108 -0
  69. package/{useClueTypeConfig-CnMg5Ny8.js → useClueTypeConfig-D2OeF2ug.js} +1 -1
  70. package/utils/chain.js +1 -1
  71. package/utils/utils.js +2 -2
  72. package/{utils-Du3XxQAT.js → utils-Dp6a9Q5X.js} +1 -1
@@ -2,7 +2,7 @@ import { jsxs, jsx } from "react/jsx-runtime";
2
2
  import { I as Icon } from "../iconify-DJxl6dC-.js";
3
3
  import { useTheme, Card, CardHeader, Stack, CircularProgress, Divider, CardContent, Grid, Chip, Typography, Tooltip, Box } from "@mui/material";
4
4
  import { ClueComponentContext } from "../hooks/ClueComponentContext.js";
5
- import { f as useClueEnrichSelector } from "../ActionForm-irs9q3xm.js";
5
+ import { f as useClueEnrichSelector } from "../ActionForm-bztRjYJE.js";
6
6
  import useAnnotations from "../hooks/useAnnotations.js";
7
7
  import useErrors from "../hooks/useErrors.js";
8
8
  import AssessmentIcon from "../icons/Assessment.js";
@@ -10,7 +10,7 @@ import ContextIcon from "../icons/Context.js";
10
10
  import OpinionIcon from "../icons/Opinion.js";
11
11
  import { ICON_MAP } from "../icons/iconMap.js";
12
12
  import FrequencyText from "../text/Frequency.js";
13
- import { u as uniq } from "../useClueTypeConfig-CnMg5Ny8.js";
13
+ import { u as uniq } from "../useClueTypeConfig-D2OeF2ug.js";
14
14
  import { memo, useState, useMemo, useCallback } from "react";
15
15
  import { a as useContextSelector } from "../index-_gpzM2Px.js";
16
16
  import AnnotationEntry from "./AnnotationEntry.js";
@@ -3,7 +3,7 @@ import { default as React } from 'react';
3
3
 
4
4
  declare const _default: React.NamedExoticComponent<EnrichmentProps & import('@mui/material').ChipOwnProps & import('@mui/material/OverridableComponent').CommonProps & Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
5
5
  ref?: React.Ref<HTMLDivElement>;
6
- }, "disabled" | "icon" | "color" | "style" | "size" | "children" | "variant" | "classes" | "className" | "sx" | "label" | "tabIndex" | "onDelete" | "avatar" | "clickable" | "deleteIcon" | "skipFocusWhenDisabled"> & {
6
+ }, "children" | "label" | "style" | "className" | "tabIndex" | "color" | "classes" | "sx" | "variant" | "size" | "icon" | "disabled" | "onDelete" | "avatar" | "clickable" | "deleteIcon" | "skipFocusWhenDisabled"> & {
7
7
  component?: React.ElementType;
8
8
  }>;
9
9
  export default _default;
@@ -3,8 +3,8 @@ import { Chip, Tooltip, Box, Stack, CircularProgress } from "@mui/material";
3
3
  import Iconified from "./display/icons/Iconified.js";
4
4
  import { ClueComponentContext } from "../hooks/ClueComponentContext.js";
5
5
  import { ClueGroupContext } from "../hooks/ClueGroupContext.js";
6
- import { C as CluePopupContext } from "../AnnotationPreview-CC_9H0lC.js";
7
- import { f as useClueEnrichSelector } from "../ActionForm-irs9q3xm.js";
6
+ import { C as CluePopupContext } from "../AnnotationPreview-BLO29hn_.js";
7
+ import { f as useClueEnrichSelector } from "../ActionForm-bztRjYJE.js";
8
8
  import useAnnotations from "../hooks/useAnnotations.js";
9
9
  import ActionIcon from "../icons/Action.js";
10
10
  import AssessmentIcon from "../icons/Assessment.js";
@@ -10,7 +10,7 @@ export interface EnrichedTypographyProps extends EnrichmentProps {
10
10
  }
11
11
  declare const _default: import('react').NamedExoticComponent<EnrichedTypographyProps & import('@mui/material').TypographyOwnProps & import('@mui/material/OverridableComponent').CommonProps & Omit<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
12
12
  ref?: import('react').Ref<HTMLSpanElement>;
13
- }, "fontSize" | "color" | "style" | "left" | "right" | "bottom" | "top" | "flex" | "position" | "border" | "padding" | "children" | "variant" | "classes" | "className" | "margin" | "sx" | "p" | "boxShadow" | "fontWeight" | "zIndex" | "alignContent" | "alignItems" | "alignSelf" | "boxSizing" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontStyle" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "letterSpacing" | "lineHeight" | "marginBlockEnd" | "marginBlockStart" | "marginBottom" | "marginInlineEnd" | "marginInlineStart" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "order" | "paddingBlockEnd" | "paddingBlockStart" | "paddingBottom" | "paddingInlineEnd" | "paddingInlineStart" | "paddingLeft" | "paddingRight" | "paddingTop" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "visibility" | "whiteSpace" | "width" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "marginBlock" | "marginInline" | "overflow" | "paddingBlock" | "paddingInline" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "typography" | "displayPrint" | "align" | "noWrap" | "gutterBottom" | "paragraph" | "variantMapping"> & {
13
+ }, "children" | "p" | "style" | "className" | "color" | "height" | "width" | "align" | "classes" | "sx" | "variant" | "border" | "boxShadow" | "fontWeight" | "zIndex" | "alignContent" | "alignItems" | "alignSelf" | "bottom" | "boxSizing" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "lineHeight" | "marginBlockEnd" | "marginBlockStart" | "marginBottom" | "marginInlineEnd" | "marginInlineStart" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "order" | "paddingBlockEnd" | "paddingBlockStart" | "paddingBottom" | "paddingInlineEnd" | "paddingInlineStart" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "top" | "visibility" | "whiteSpace" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "marginBlock" | "marginInline" | "overflow" | "padding" | "paddingBlock" | "paddingInline" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "typography" | "displayPrint" | "noWrap" | "gutterBottom" | "paragraph" | "variantMapping"> & {
14
14
  component?: React.ElementType;
15
15
  }>;
16
16
  export default _default;
@@ -3,8 +3,8 @@ import { useTheme, Stack, CircularProgress, Tooltip, IconButton } from "@mui/mat
3
3
  import Iconified from "./display/icons/Iconified.js";
4
4
  import { ClueComponentContext } from "../hooks/ClueComponentContext.js";
5
5
  import { ClueGroupContext } from "../hooks/ClueGroupContext.js";
6
- import { C as CluePopupContext } from "../AnnotationPreview-CC_9H0lC.js";
7
- import { f as useClueEnrichSelector } from "../ActionForm-irs9q3xm.js";
6
+ import { C as CluePopupContext } from "../AnnotationPreview-BLO29hn_.js";
7
+ import { f as useClueEnrichSelector } from "../ActionForm-bztRjYJE.js";
8
8
  import useAnnotations from "../hooks/useAnnotations.js";
9
9
  import ActionIcon from "../icons/Action.js";
10
10
  import AssessmentIcon from "../icons/Assessment.js";
@@ -10,6 +10,6 @@ declare class ErrorBoundary extends React.Component<PropsWithChildren<{}>, {
10
10
  error: any;
11
11
  };
12
12
  componentDidCatch(error: Error): void;
13
- render(): string | number | boolean | import("react/jsx-runtime").JSX.Element | Iterable<React.ReactNode>;
13
+ render(): string | number | boolean | Iterable<React.ReactNode> | import("react/jsx-runtime").JSX.Element;
14
14
  }
15
15
  export default ErrorBoundary;
@@ -1,7 +1,7 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { Button } from "@mui/material";
3
3
  import { ClueComponentContext } from "../hooks/ClueComponentContext.js";
4
- import { f as useClueEnrichSelector } from "../ActionForm-irs9q3xm.js";
4
+ import { f as useClueEnrichSelector } from "../ActionForm-bztRjYJE.js";
5
5
  import { a as useContextSelector } from "../index-_gpzM2Px.js";
6
6
  const RetryFailedEnrichments = () => {
7
7
  const enrichFailedEnrichments = useClueEnrichSelector((ctx) => ctx.enrichFailedEnrichments);
@@ -1,6 +1,6 @@
1
1
  import { jsxs, Fragment, jsx } from "react/jsx-runtime";
2
2
  import { Button, Popover, TextField, Divider, Stack, FormControlLabel, Checkbox } from "@mui/material";
3
- import { e as useClueComponentSelector, f as useClueEnrichSelector } from "../ActionForm-irs9q3xm.js";
3
+ import { e as useClueComponentSelector, f as useClueEnrichSelector } from "../ActionForm-bztRjYJE.js";
4
4
  import { memo, useState, useEffect } from "react";
5
5
  const SourcePicker = () => {
6
6
  const { t } = useClueComponentSelector((ctx) => ctx.i18next);
@@ -3,10 +3,10 @@ import "@jsonforms/material-renderers";
3
3
  import "@jsonforms/react";
4
4
  import "@mui/material";
5
5
  import "../display/icons/Iconified.js";
6
- import "../../index-CIj4pr7O.js";
6
+ import "../../index-BF4c1XBg.js";
7
7
  import "../../hooks/ClueComponentContext.js";
8
- import { A } from "../../ActionForm-irs9q3xm.js";
9
- import "../../utils-Du3XxQAT.js";
8
+ import { A } from "../../ActionForm-bztRjYJE.js";
9
+ import "../../utils-Dp6a9Q5X.js";
10
10
  import "react";
11
11
  import "../../index-_gpzM2Px.js";
12
12
  import "../ErrorBoundary.js";
@@ -3,7 +3,7 @@ import { I as Icon } from "../../iconify-DJxl6dC-.js";
3
3
  import { useTheme, Tooltip, IconButton, CircularProgress, Button, Popover, Paper, Stack, Typography, Box, Divider } from "@mui/material";
4
4
  import Iconified from "../display/icons/Iconified.js";
5
5
  import { ClueComponentContext } from "../../hooks/ClueComponentContext.js";
6
- import { d as useClueActionsSelector } from "../../ActionForm-irs9q3xm.js";
6
+ import { d as useClueActionsSelector } from "../../ActionForm-bztRjYJE.js";
7
7
  import useClueConfig from "../../hooks/useClueConfig.js";
8
8
  import { isAccessible } from "../../utils/classificationParser.js";
9
9
  import { useState, useRef, useMemo, useEffect } from "react";
@@ -2,7 +2,7 @@ import "react/jsx-runtime";
2
2
  import "../../iconify-DJxl6dC-.js";
3
3
  import "@mui/material";
4
4
  import "../../hooks/ClueComponentContext.js";
5
- import { R } from "../../ActionForm-irs9q3xm.js";
5
+ import { R } from "../../ActionForm-bztRjYJE.js";
6
6
  import "react";
7
7
  import "../../index-_gpzM2Px.js";
8
8
  import "../ClassificationChip.js";
@@ -1,20 +1,21 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
2
  import { Stack } from "@mui/material";
3
- import { J as JSONViewer } from "../../../index-CIj4pr7O.js";
3
+ import { J as JSONViewer } from "../../../index-BF4c1XBg.js";
4
4
  import Markdown from "../../display/markdown/index.js";
5
- import FileResult from "./FileResult.js";
5
+ import { useTranslation } from "react-i18next";
6
+ import { u as usePluginStore, c as clueUIPluginStore } from "../../../store-Dslbt6yE.js";
6
7
  const Result = ({ result }) => {
7
- if (result.format === "markdown") {
8
- return /* @__PURE__ */ jsx(Markdown, { md: result.output });
9
- }
10
- if (result.format === "json") {
11
- return /* @__PURE__ */ jsx(JSONViewer, { data: result.output, collapse: true, forceCompact: true });
12
- }
13
- if (result.format === "file") {
14
- return /* @__PURE__ */ jsx(FileResult, { result });
8
+ const pluginStore = usePluginStore();
9
+ const { t } = useTranslation();
10
+ const plugin = clueUIPluginStore.getPlugin(result.format, "action", result.actionId);
11
+ if (plugin) {
12
+ const component = pluginStore.executeFunction(`${plugin}.actionResult`, { result });
13
+ if (component) {
14
+ return component;
15
+ }
15
16
  }
16
17
  return /* @__PURE__ */ jsxs(Stack, { sx: { overflowY: "auto" }, children: [
17
- /* @__PURE__ */ jsx(Markdown, { md: "`" + result.format + "` is not recognized as a format in this application." }),
18
+ /* @__PURE__ */ jsx(Markdown, { md: t("format.not.recognized", { format: result.format }) }),
18
19
  /* @__PURE__ */ jsx(JSONViewer, { data: result, collapse: true, forceCompact: true })
19
20
  ] });
20
21
  };
@@ -1,15 +1,15 @@
1
1
  import { jsxs, jsx, Fragment } from "react/jsx-runtime";
2
2
  import { Stack, Typography, Card, CardContent, Divider, Collapse } from "@mui/material";
3
- import { b as isPlainObject, a as flatten$1 } from "../../../../utils-Du3XxQAT.js";
3
+ import { b as isPlainObject, a as flatten$1 } from "../../../../utils-Dp6a9Q5X.js";
4
4
  import { cssImportant } from "../../../../utils/graph.js";
5
5
  import { b as baseGet, c as castPath, t as toKey, a as arrayMap } from "../../../../_baseGet-DKnGz1D3.js";
6
6
  import { c as copyObject, g as getAllKeysIn, b as baseClone } from "../../../../_baseClone-BUfES2sT.js";
7
7
  import { l as last } from "../../../../last-CUCl67Im.js";
8
8
  import { b as baseSlice } from "../../../../_baseSlice-GAv_YFTT.js";
9
- import { b as baseFlatten, s as setToString, o as overRest } from "../../../../_baseFlatten-D3wtzJ86.js";
9
+ import { b as baseFlatten, s as setToString, o as overRest } from "../../../../_baseFlatten-B3PW43Vk.js";
10
10
  import { useState, useEffect, useCallback, Fragment as Fragment$1 } from "react";
11
11
  import Iconified from "../../icons/Iconified.js";
12
- import { J as JSONViewer } from "../../../../index-CIj4pr7O.js";
12
+ import { J as JSONViewer } from "../../../../index-BF4c1XBg.js";
13
13
  import Markdown from "../../markdown/index.js";
14
14
  import ExpandMoreButton from "../ExpandMoreButton.js";
15
15
  import NodeTag from "./NodeTag.js";
@@ -1,7 +1,7 @@
1
1
  import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
2
  import { useMemo, useRef, useState, useEffect, useCallback, createElement } from "react";
3
3
  import { useTheme, lighten, darken, Stack, Card, Typography, Autocomplete, TextField, FormControl, InputLabel, Select, MenuItem, alpha, IconButton, Collapse } from "@mui/material";
4
- import { p as parseEvent } from "../../../index-CIj4pr7O.js";
4
+ import { p as parseEvent } from "../../../index-BF4c1XBg.js";
5
5
  import { z as zoom, i as identity, s as select, t as transform, p as pointer } from "../../../index-CVUD9o3t.js";
6
6
  import { ClueComponentContext } from "../../../hooks/ClueComponentContext.js";
7
7
  import useComparator from "../../../hooks/useComparator.js";
@@ -1,7 +1,7 @@
1
1
  import "react/jsx-runtime";
2
2
  import "@mui/material";
3
- import { J } from "../../../index-CIj4pr7O.js";
4
- import "../../../utils-Du3XxQAT.js";
3
+ import { J } from "../../../index-BF4c1XBg.js";
4
+ import "../../../utils-Dp6a9Q5X.js";
5
5
  import "../../../hooks/ClueComponentContext.js";
6
6
  import "../../../hooks/useMyLocalStorage.js";
7
7
  import "../../../utils/constants.js";
@@ -1,6 +1,6 @@
1
1
  import { jsxs, Fragment, jsx } from "react/jsx-runtime";
2
2
  import { useTheme, Tooltip, IconButton, CircularProgress, Button, Popover, Paper, Stack, Box, Typography, Divider } from "@mui/material";
3
- import { e as useClueComponentSelector, f as useClueEnrichSelector, c as capitalize } from "../../ActionForm-irs9q3xm.js";
3
+ import { e as useClueComponentSelector, f as useClueEnrichSelector, c as capitalize } from "../../ActionForm-bztRjYJE.js";
4
4
  import { useState, useRef, useCallback, useEffect } from "react";
5
5
  import Iconified from "../display/icons/Iconified.js";
6
6
  const EnrichPopover = ({ show = false, size = "small", selector }) => {
@@ -1,15 +1,13 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { I as Icon } from "../../iconify-DJxl6dC-.js";
3
- import { useTheme, Skeleton, Chip, Tooltip, Stack, Typography, LinearProgress, Paper, Box, IconButton } from "@mui/material";
3
+ import { useTheme, Skeleton, Chip, Tooltip, Stack, Typography, LinearProgress, Paper, IconButton } from "@mui/material";
4
4
  import { F as FlexOne } from "../../FlexOne-BSYAhhtG.js";
5
5
  import Iconified from "../display/icons/Iconified.js";
6
- import { J as JSONViewer } from "../../index-CIj4pr7O.js";
7
6
  import { ClueComponentContext } from "../../hooks/ClueComponentContext.js";
8
- import { g as useClueFetcherSelector } from "../../ActionForm-irs9q3xm.js";
7
+ import { g as useClueFetcherSelector } from "../../ActionForm-bztRjYJE.js";
9
8
  import React__default, { useState, useRef, useMemo, useEffect, memo } from "react";
10
9
  import { a as useContextSelector } from "../../index-_gpzM2Px.js";
11
- import Graph from "../display/graph/index.js";
12
- import Markdown from "../display/markdown/index.js";
10
+ import { FetcherResultView } from "./FetcherResultView.js";
13
11
  import PreviewModal from "./PreviewModal.js";
14
12
  import StatusChip from "./StatusChip.js";
15
13
  const Fetcher = React__default.memo(
@@ -72,6 +70,12 @@ const Fetcher = React__default.memo(
72
70
  }
73
71
  })();
74
72
  }, [classification, fetchSelector, fetcherId, t, type, value]);
73
+ const resultAdditionalProps = useMemo(() => {
74
+ if ((result == null ? void 0 : result.outcome) === "success" && result.format === "image") {
75
+ return { onClick: () => setShowPreview(true), ...imageProps };
76
+ }
77
+ return { result };
78
+ }, [imageProps, result]);
75
79
  if (fetchCompleted) {
76
80
  if (!fetcherId) {
77
81
  console.warn("Missing fetcher Id. Component will not render.");
@@ -165,10 +169,7 @@ const Fetcher = React__default.memo(
165
169
  },
166
170
  children: [
167
171
  result.outcome === "failure" && /* @__PURE__ */ jsx("code", { style: { color: theme.palette.error.main }, children: /* @__PURE__ */ jsx("pre", { style: { marginTop: 0, marginBottom: 0 }, children: result.error }) }),
168
- result.format === "markdown" && /* @__PURE__ */ jsx(Markdown, { md: result.data }),
169
- result.format === "image" && /* @__PURE__ */ jsx("img", { src: result.data.image, alt: result.data.alt, ...imageProps, onClick: () => setShowPreview(true) }),
170
- result.format === "json" && /* @__PURE__ */ jsx(Box, { sx: { ".react-json-view": { backgroundColor: "transparent !important" } }, children: /* @__PURE__ */ jsx(JSONViewer, { data: result.data }) }),
171
- result.format === "graph" && /* @__PURE__ */ jsx(Graph, { graph: result.data, sx: { minHeight: "600px" } }),
172
+ /* @__PURE__ */ jsx(FetcherResultView, { result, ...resultAdditionalProps }),
172
173
  /* @__PURE__ */ jsx(FlexOne, {}),
173
174
  /* @__PURE__ */ jsxs(
174
175
  Stack,
@@ -0,0 +1,4 @@
1
+ import { FC } from 'react';
2
+ import { RenderFetcherResultProps } from '../../../plugins/ClueUIPlugin';
3
+
4
+ export declare const FetcherResultView: FC<RenderFetcherResultProps>;
@@ -0,0 +1,27 @@
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import { Stack } from "@mui/material";
3
+ import { J as JSONViewer } from "../../index-BF4c1XBg.js";
4
+ import Markdown from "../display/markdown/index.js";
5
+ import { useTranslation } from "react-i18next";
6
+ import { u as usePluginStore, c as clueUIPluginStore } from "../../store-Dslbt6yE.js";
7
+ const FetcherResultView = ({ result, ...props }) => {
8
+ const pluginStore = usePluginStore();
9
+ const { t } = useTranslation();
10
+ const availablePlugins = clueUIPluginStore.getPlugin(result.format, "fetcher");
11
+ if (availablePlugins.length > 0) {
12
+ const plugin = availablePlugins.at(0);
13
+ if (plugin) {
14
+ const component = pluginStore.executeFunction(`${plugin}.fetcherResult`, { result, ...props });
15
+ if (component) {
16
+ return component;
17
+ }
18
+ }
19
+ }
20
+ return /* @__PURE__ */ jsxs(Stack, { sx: { overflowY: "auto" }, children: [
21
+ /* @__PURE__ */ jsx(Markdown, { md: t("format.not.recognized", { format: result.format }) }),
22
+ /* @__PURE__ */ jsx(JSONViewer, { data: result, collapse: true, forceCompact: true })
23
+ ] });
24
+ };
25
+ export {
26
+ FetcherResultView
27
+ };
@@ -1,6 +1,7 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { Modal, Paper } from "@mui/material";
3
3
  import { memo } from "react";
4
+ import { FetcherResultView } from "./FetcherResultView.js";
4
5
  const PreviewModal = ({ result, onClose, open = false, ...otherProps }) => {
5
6
  return /* @__PURE__ */ jsx(
6
7
  Modal,
@@ -12,7 +13,7 @@ const PreviewModal = ({ result, onClose, open = false, ...otherProps }) => {
12
13
  ],
13
14
  onClose,
14
15
  ...otherProps,
15
- children: /* @__PURE__ */ jsx(Paper, { sx: { maxHeight: "90%", maxWidth: "90%", p: 2, overflow: "auto" }, children: (result == null ? void 0 : result.format) === "image" && /* @__PURE__ */ jsx("img", { src: result.data.image, alt: result.data.alt, style: { maxWidth: "100%" } }) })
16
+ children: /* @__PURE__ */ jsx(Paper, { sx: { maxHeight: "90%", maxWidth: "90%", p: 2, overflow: "auto" }, children: /* @__PURE__ */ jsx(FetcherResultView, { result }) })
16
17
  }
17
18
  );
18
19
  };
@@ -1,5 +1,5 @@
1
1
  import { ClueGroupContext } from "../../hooks/ClueGroupContext.js";
2
- import { i as isEqual } from "../../utils-Du3XxQAT.js";
2
+ import { i as isEqual } from "../../utils-Dp6a9Q5X.js";
3
3
  import { memo, useEffect } from "react";
4
4
  import { a as useContextSelector } from "../../index-_gpzM2Px.js";
5
5
  const Entry = ({ children, entry, selected = false }) => {
@@ -4,7 +4,7 @@ import { F as FlexOne } from "../../FlexOne-BSYAhhtG.js";
4
4
  import Iconified from "../display/icons/Iconified.js";
5
5
  import { SNACKBAR_EVENT_ID } from "../../data/event.js";
6
6
  import { ClueGroupContext } from "../../hooks/ClueGroupContext.js";
7
- import { e as useClueComponentSelector, f as useClueEnrichSelector, c as capitalize } from "../../ActionForm-irs9q3xm.js";
7
+ import { e as useClueComponentSelector, f as useClueEnrichSelector, c as capitalize } from "../../ActionForm-bztRjYJE.js";
8
8
  import { safeDispatchEvent } from "../../utils/window.js";
9
9
  import { useState, useMemo, useCallback } from "react";
10
10
  import { a as useContextSelector } from "../../index-_gpzM2Px.js";
@@ -1,7 +1,7 @@
1
1
  import { jsxs } from "react/jsx-runtime";
2
2
  import { Stack, Typography } from "@mui/material";
3
3
  import { ClueDatabaseContext } from "../../hooks/ClueDatabaseContext.js";
4
- import { e as useClueComponentSelector, f as useClueEnrichSelector } from "../../ActionForm-irs9q3xm.js";
4
+ import { e as useClueComponentSelector, f as useClueEnrichSelector } from "../../ActionForm-bztRjYJE.js";
5
5
  import { useContext, useState, useEffect } from "react";
6
6
  const QueryStatus = () => {
7
7
  const { t } = useClueComponentSelector((ctx) => ctx.i18next);
@@ -52,6 +52,7 @@
52
52
  "enrich": "Enrich",
53
53
  "error": "Error",
54
54
  "error.unexpected": "An unexpected error occurred",
55
+ "format.not.recognized": "Unable to display result. No available plugins to display returned format: `{{format}}`.",
55
56
  "graph.no.dataset": "No dataset has been selected!",
56
57
  "graph.node.input.label": "Enter a node ID, and press [ctrl + enter] to select it. [ctrl + space] will open an autocomplete menu.",
57
58
  "graph.show.more": "show more",
@@ -52,6 +52,7 @@
52
52
  "enrich": "Enrichir",
53
53
  "error": "Erreur",
54
54
  "error.unexpected": "Une erreur inattendue s'est produite",
55
+ "format.not.recognized": "Impossible d'afficher le résultat. Aucun plugin disponible pour afficher le format renvoyé : `{{format}}`.",
55
56
  "graph.no.dataset": "Aucun jeu de données n'a été sélectionné!",
56
57
  "graph.node.input.label": "Entrez un ID de nœud et appuyez sur [ctrl + entrée] pour le sélectionner. [ctrl + espace] ouvrira un menu d'auto-complétion.",
57
58
  "graph.show.more": "Afficher plus",
@@ -1,6 +1,6 @@
1
1
  import "react/jsx-runtime";
2
2
  import "@mui/material";
3
- import { C, a } from "../ActionForm-irs9q3xm.js";
3
+ import { C, a } from "../ActionForm-bztRjYJE.js";
4
4
  import "../index-CmQM2DaO.js";
5
5
  import "../components/display/icons/Iconified.js";
6
6
  import "../components/ErrorBoundary.js";
@@ -3,15 +3,15 @@ import "../iconify-DJxl6dC-.js";
3
3
  import "../index-CmQM2DaO.js";
4
4
  import "../database/globals.js";
5
5
  import "../utils/loggerUtil.js";
6
- import { C, a } from "../ClueEnrichContext-NZpr831K.js";
6
+ import { C, a } from "../ClueEnrichContext-fItpTzAE.js";
7
7
  import "../sessionStorage-Dbmo2Exe.js";
8
8
  import "../groupBy-CXx1vslF.js";
9
- import "../useClueTypeConfig-CnMg5Ny8.js";
9
+ import "../useClueTypeConfig-D2OeF2ug.js";
10
10
  import "react";
11
11
  import "../index-_gpzM2Px.js";
12
12
  import "./ClueDatabaseContext.js";
13
13
  import "./useClueConfig.js";
14
- import "../_baseUniq-BqxNeJD9.js";
14
+ import "../_baseUniq-Bx6CWGDV.js";
15
15
  export {
16
16
  C as ClueEnrichContext,
17
17
  a as ClueEnrichProvider
@@ -1,7 +1,7 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { useState, useMemo } from "react";
3
3
  import { c as createContext } from "../index-_gpzM2Px.js";
4
- import { f as useClueEnrichSelector } from "../ActionForm-irs9q3xm.js";
4
+ import { f as useClueEnrichSelector } from "../ActionForm-bztRjYJE.js";
5
5
  const ClueGroupContext = createContext(null);
6
6
  const ClueGroupProvider = ({ children, type, classification }) => {
7
7
  const defaultClassification = useClueEnrichSelector((ctx) => ctx.defaultClassification);
@@ -1,9 +1,9 @@
1
1
  import "react/jsx-runtime";
2
2
  import "../components/AnnotationDetailPopover.js";
3
- import { C, a } from "../AnnotationPreview-CC_9H0lC.js";
3
+ import { C, a } from "../AnnotationPreview-BLO29hn_.js";
4
4
  import "../data/event.js";
5
5
  import "../utils/window.js";
6
- import "../AnnotationDetails-TaLlFe0h.js";
6
+ import "../AnnotationDetails-DXTY4rxn.js";
7
7
  import "react";
8
8
  import "../index-_gpzM2Px.js";
9
9
  export {
@@ -1,3 +1,4 @@
1
+ import { ClueUIPluginProviderProps } from 'components/app/providers/ClueUIPluginProvider';
1
2
  import { FC, PropsWithChildren } from 'react';
2
3
  import { ClueActionProps } from './ClueActionContext';
3
4
  import { ClueComponentContextType } from './ClueComponentContext';
@@ -5,5 +6,5 @@ import { ClueConfigContextProps } from './ClueConfigProvider';
5
6
  import { ClueDatabaseContextProps } from './ClueDatabaseContext';
6
7
  import { ClueEnrichProps } from './ClueEnrichProps';
7
8
 
8
- declare const ClueProvider: FC<PropsWithChildren<ClueEnrichProps & ClueActionProps & ClueComponentContextType & ClueDatabaseContextProps & ClueConfigContextProps>>;
9
+ declare const ClueProvider: FC<PropsWithChildren<ClueEnrichProps & ClueActionProps & ClueComponentContextType & ClueDatabaseContextProps & ClueConfigContextProps & ClueUIPluginProviderProps>>;
9
10
  export { ClueProvider };
@@ -1,13 +1,65 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
1
4
  import { jsx } from "react/jsx-runtime";
2
- import { a as ClueActionProvider } from "../ActionForm-irs9q3xm.js";
5
+ import { useEffect } from "react";
6
+ import { P as PluginProvider, c as clueUIPluginStore } from "../store-Dslbt6yE.js";
7
+ import { a as ClueActionProvider } from "../ActionForm-bztRjYJE.js";
3
8
  import { ClueComponentProvider } from "./ClueComponentContext.js";
4
9
  import { ClueConfigProvider } from "./ClueConfigProvider.js";
5
10
  import { ClueDatabaseProvider } from "./ClueDatabaseContext.js";
6
- import { a as ClueEnrichProvider } from "../ClueEnrichContext-NZpr831K.js";
11
+ import { a as ClueEnrichProvider } from "../ClueEnrichContext-fItpTzAE.js";
7
12
  import { ClueFetcherProvider } from "./ClueFetcherContext.js";
8
- import { a as CluePopupProvider } from "../AnnotationPreview-CC_9H0lC.js";
13
+ import { a as CluePopupProvider } from "../AnnotationPreview-BLO29hn_.js";
14
+ class ClueUIPluginsRegistry {
15
+ constructor() {
16
+ __publicField(this, "_plugins", [
17
+ // { name: 'TestPlugin', id: 'none', loadPlugin: () => import('./test') },
18
+ { name: "MarkdownPlugin", id: "markdown", loadPlugin: () => import("../index-BdAUKhOk.js") },
19
+ { name: "ImagePlugin", id: "image", loadPlugin: () => import("../index-D4mEq9G4.js") },
20
+ { name: "JSONPlugin", id: "json", loadPlugin: () => import("../index-BJm74d7l.js") },
21
+ { name: "GraphPlugin", id: "graph", loadPlugin: () => import("../index-DP0SQqVY.js") },
22
+ { name: "FilePlugin", id: "file", loadPlugin: () => import("../index-Kt3RwkVk.js") }
23
+ ]);
24
+ }
25
+ getPlugins() {
26
+ return this._plugins;
27
+ }
28
+ }
29
+ const ClueUIPluginProvider = ({
30
+ plugins,
31
+ excludePlugins,
32
+ excludeBuiltInPlugins,
33
+ children
34
+ }) => {
35
+ useEffect(() => {
36
+ const loadPlugins = async () => {
37
+ if (plugins && Array.isArray(plugins)) {
38
+ for (const pluginDef of plugins) {
39
+ if (!(excludePlugins == null ? void 0 : excludePlugins.includes(pluginDef.id))) {
40
+ const pluginModule = await pluginDef.loadPlugin();
41
+ const plugin = new pluginModule.default();
42
+ clueUIPluginStore.install(plugin);
43
+ }
44
+ }
45
+ }
46
+ if (!excludeBuiltInPlugins) {
47
+ const builtInPlugins = new ClueUIPluginsRegistry().getPlugins();
48
+ for (const pluginDef of builtInPlugins) {
49
+ if (!(excludePlugins == null ? void 0 : excludePlugins.includes(pluginDef.id))) {
50
+ const pluginModule = await pluginDef.loadPlugin();
51
+ const plugin = new pluginModule.default();
52
+ clueUIPluginStore.install(plugin);
53
+ }
54
+ }
55
+ }
56
+ };
57
+ loadPlugins();
58
+ }, [excludeBuiltInPlugins, excludePlugins, plugins]);
59
+ return /* @__PURE__ */ jsx(PluginProvider, { pluginStore: clueUIPluginStore.pluginStore, children });
60
+ };
9
61
  const ClueProvider = ({ children, ...props }) => {
10
- return /* @__PURE__ */ jsx(ClueComponentProvider, { ...props, children: /* @__PURE__ */ jsx(ClueConfigProvider, { config: props.config, children: /* @__PURE__ */ jsx(ClueDatabaseProvider, { ...props, children: /* @__PURE__ */ jsx(ClueEnrichProvider, { ...props, children: /* @__PURE__ */ jsx(ClueFetcherProvider, { ...props, children: /* @__PURE__ */ jsx(ClueActionProvider, { ...props, children: /* @__PURE__ */ jsx(CluePopupProvider, { children }) }) }) }) }) }) });
62
+ return /* @__PURE__ */ jsx(ClueComponentProvider, { ...props, children: /* @__PURE__ */ jsx(ClueConfigProvider, { config: props.config, children: /* @__PURE__ */ jsx(ClueDatabaseProvider, { ...props, children: /* @__PURE__ */ jsx(ClueUIPluginProvider, { ...props, children: /* @__PURE__ */ jsx(ClueEnrichProvider, { ...props, children: /* @__PURE__ */ jsx(ClueFetcherProvider, { ...props, children: /* @__PURE__ */ jsx(ClueActionProvider, { ...props, children: /* @__PURE__ */ jsx(CluePopupProvider, { children }) }) }) }) }) }) }) });
11
63
  };
12
64
  export {
13
65
  ClueProvider
@@ -1,6 +1,6 @@
1
- import { d, e, f, g } from "../ActionForm-irs9q3xm.js";
1
+ import { d, e, f, g } from "../ActionForm-bztRjYJE.js";
2
2
  import "./ClueComponentContext.js";
3
- import "../ClueEnrichContext-NZpr831K.js";
3
+ import "../ClueEnrichContext-fItpTzAE.js";
4
4
  import "./ClueFetcherContext.js";
5
5
  import "../index-_gpzM2Px.js";
6
6
  export {
@@ -1,7 +1,7 @@
1
1
  import "react";
2
2
  import "../index-_gpzM2Px.js";
3
3
  import "./ClueComponentContext.js";
4
- import { u } from "../ActionForm-irs9q3xm.js";
4
+ import { u } from "../ActionForm-bztRjYJE.js";
5
5
  export {
6
6
  u as useActionResult
7
7
  };
@@ -1,7 +1,7 @@
1
- import { u as uniqBy } from "../ClueEnrichContext-NZpr831K.js";
1
+ import { u as uniqBy } from "../ClueEnrichContext-fItpTzAE.js";
2
2
  import { useContext, useMemo, useState, useEffect } from "react";
3
3
  import { ClueDatabaseContext } from "./ClueDatabaseContext.js";
4
- import { f as useClueEnrichSelector } from "../ActionForm-irs9q3xm.js";
4
+ import { f as useClueEnrichSelector } from "../ActionForm-bztRjYJE.js";
5
5
  const useAnnotations = (type, value, _classification, { skipEnrichment } = { skipEnrichment: false }) => {
6
6
  var _a;
7
7
  const database = useContext(ClueDatabaseContext);
package/hooks/useClue.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { u as useContext } from "../index-_gpzM2Px.js";
2
- import { C as ClueEnrichContext } from "../ClueEnrichContext-NZpr831K.js";
2
+ import { C as ClueEnrichContext } from "../ClueEnrichContext-fItpTzAE.js";
3
3
  const useClue = () => {
4
4
  return useContext(ClueEnrichContext);
5
5
  };
@@ -1,4 +1,4 @@
1
- import { b } from "../ActionForm-irs9q3xm.js";
1
+ import { b } from "../ActionForm-bztRjYJE.js";
2
2
  import "../index-_gpzM2Px.js";
3
3
  export {
4
4
  b as default
@@ -1,8 +1,8 @@
1
1
  import "../index-CmQM2DaO.js";
2
2
  import "../utils/loggerUtil.js";
3
- import "../_baseUniq-BqxNeJD9.js";
3
+ import "../_baseUniq-Bx6CWGDV.js";
4
4
  import "react";
5
- import { a } from "../useClueTypeConfig-CnMg5Ny8.js";
5
+ import { a } from "../useClueTypeConfig-D2OeF2ug.js";
6
6
  export {
7
7
  a as default
8
8
  };
@@ -1,6 +1,6 @@
1
1
  import { useContext, useState, useEffect } from "react";
2
2
  import { ClueDatabaseContext } from "./ClueDatabaseContext.js";
3
- import { f as useClueEnrichSelector } from "../ActionForm-irs9q3xm.js";
3
+ import { f as useClueEnrichSelector } from "../ActionForm-bztRjYJE.js";
4
4
  const useErrors = (value) => {
5
5
  const database = useContext(ClueDatabaseContext);
6
6
  const ready = useClueEnrichSelector((ctx) => ctx.ready);
@@ -1,5 +1,5 @@
1
1
  import { useState, useRef, useMemo, useEffect } from "react";
2
- import { b as useClueActions } from "../ActionForm-irs9q3xm.js";
2
+ import { b as useClueActions } from "../ActionForm-bztRjYJE.js";
3
3
  const useActionResult = (resultWithData, interval = 2e3) => {
4
4
  const [result, setResult] = useState(resultWithData);
5
5
  const timeoutRef = useRef(null);
package/icons/Action.js CHANGED
@@ -2,8 +2,8 @@ import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { I as Icon } from "../iconify-DJxl6dC-.js";
3
3
  import { useTheme, Stack, Divider, Typography } from "@mui/material";
4
4
  import CountBadge from "../components/CountBadge.js";
5
- import { C as CluePopupContext } from "../AnnotationPreview-CC_9H0lC.js";
6
- import { b as useClueActions } from "../ActionForm-irs9q3xm.js";
5
+ import { C as CluePopupContext } from "../AnnotationPreview-BLO29hn_.js";
6
+ import { b as useClueActions } from "../ActionForm-bztRjYJE.js";
7
7
  import { g as groupBy } from "../groupBy-CXx1vslF.js";
8
8
  import { memo, useRef, useMemo, useEffect } from "react";
9
9
  import { a as useContextSelector } from "../index-_gpzM2Px.js";