@cccsaurora/clue-ui 1.5.0-dev.477 → 1.5.0-dev.484
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{ActionForm-DIAUGhSr.js → ActionForm-BMIAp7pf.js} +3 -3
- package/{AnnotationDetails-DmrYK0Qc.js → AnnotationDetails-Dmk8kpl3.js} +1 -1
- package/{AnnotationPreview-DAswA7fu.js → AnnotationPreview-CIya3ByE.js} +1 -1
- package/{ClueEnrichContext-B76X-cLH.js → ClueEnrichContext-BqzlMW0c.js} +5 -20
- package/components/AnnotationDetailPopover.js +1 -1
- package/components/AnnotationDetails.js +2 -2
- package/components/AnnotationPreview.js +1 -1
- package/components/EnrichedCard.js +1 -1
- package/components/EnrichedChip.js +2 -2
- package/components/EnrichedTypography.js +2 -2
- package/components/RetryFailedEnrichments.js +1 -1
- package/components/SourcePicker.js +1 -1
- package/components/actions/ActionForm.js +1 -1
- package/components/actions/ExecutePopover.js +1 -1
- package/components/actions/ResultModal.js +1 -1
- package/components/enrichment/EnrichPopover.js +1 -1
- package/components/fetchers/Fetcher.js +1 -1
- package/components/group/GroupControl.js +1 -1
- package/components/stats/QueryStatus.js +1 -1
- package/database/errors.d.ts +11 -0
- package/database/errors.js +18 -0
- package/database/index.js +2 -2
- package/database/replication.js +3 -2
- package/database/types.d.ts +22 -0
- package/hooks/ClueActionContext.js +2 -2
- package/hooks/ClueDatabaseContext.js +1 -1
- package/hooks/ClueEnrichContext.js +3 -2
- package/hooks/ClueEnrichContextType.d.ts +1 -1
- package/hooks/ClueFetcherContext.js +1 -1
- package/hooks/ClueGroupContext.js +1 -1
- package/hooks/CluePopupContext.js +2 -2
- package/hooks/ClueProvider.js +3 -3
- package/hooks/selectors.js +2 -2
- package/hooks/useActionResult.js +1 -1
- package/hooks/useAnnotations.js +2 -2
- package/hooks/useClue.js +1 -1
- package/hooks/useClueActions.js +1 -1
- package/hooks/useClueTypeConfig.d.ts +2 -0
- package/hooks/useClueTypeConfig.js +9 -13
- package/hooks/useErrors.js +1 -1
- package/hooks/useFetcherResult.js +1 -1
- package/icons/Action.js +2 -2
- package/icons/Assessment.js +1 -1
- package/icons/Context.js +1 -1
- package/icons/Opinion.js +1 -1
- package/{index-8lXdRRpV.js → index-CdqmWKik.js} +2 -2
- package/{index-DT_sunCV.js → index-CgvdVEs-.js} +1 -1
- package/{index-CPetQxOc.js → index-Dd7KdsT8.js} +113 -89
- package/main.d.ts +5 -4
- package/main.js +7 -5
- package/package.json +1 -1
- package/{replication-DDxxY_CX.js → replication-Ck5s0Yg-.js} +115 -43
- package/types/lookup.d.ts +10 -1
- package/utils/typeDetection.d.ts +7 -0
- package/utils/typeDetection.js +13 -0
|
@@ -6,8 +6,8 @@ import Iconified from "./components/display/icons/Iconified.js";
|
|
|
6
6
|
import { J as JSONViewer } from "./index-DUEubgWN.js";
|
|
7
7
|
import { ClueComponentContext } from "./hooks/ClueComponentContext.js";
|
|
8
8
|
import { g as getDefaultExportFromCjs } from "./_commonjsHelpers-CUmg6egw.js";
|
|
9
|
-
import { c as requireJsonSchemaTraverse, r as requireFastDeepEqual, a as requireFastUri } from "./index-
|
|
10
|
-
import { a as api } from "./index-
|
|
9
|
+
import { c as requireJsonSchemaTraverse, r as requireFastDeepEqual, a as requireFastUri } from "./index-CdqmWKik.js";
|
|
10
|
+
import { a as api } from "./index-Dd7KdsT8.js";
|
|
11
11
|
import { d as toString } from "./_baseGet-Cmp6FztG.js";
|
|
12
12
|
import { b as baseSlice } from "./_baseSlice-GAv_YFTT.js";
|
|
13
13
|
import { i as isEqual } from "./utils-CEySTPtg.js";
|
|
@@ -16,7 +16,7 @@ import { a as useContextSelector, c as createContext, u as useContext } from "./
|
|
|
16
16
|
import ErrorBoundary from "./components/ErrorBoundary.js";
|
|
17
17
|
import { adaptSchema } from "./components/actions/form/schemaAdapter.js";
|
|
18
18
|
import { I as Icon } from "./iconify-CYJTToEF.js";
|
|
19
|
-
import { C as ClueEnrichContext } from "./ClueEnrichContext-
|
|
19
|
+
import { C as ClueEnrichContext } from "./ClueEnrichContext-BqzlMW0c.js";
|
|
20
20
|
import { ClueFetcherContext } from "./hooks/ClueFetcherContext.js";
|
|
21
21
|
import ClassificationChip from "./components/ClassificationChip.js";
|
|
22
22
|
import Result from "./components/actions/formats/index.js";
|
|
@@ -4,7 +4,7 @@ import { useTheme, Stack, Typography, Tooltip, Box, IconButton, CircularProgress
|
|
|
4
4
|
import Iconified from "./components/display/icons/Iconified.js";
|
|
5
5
|
import { SNACKBAR_EVENT_ID } from "./data/event.js";
|
|
6
6
|
import { ClueComponentContext } from "./hooks/ClueComponentContext.js";
|
|
7
|
-
import { f as useClueEnrichSelector } from "./ActionForm-
|
|
7
|
+
import { f as useClueEnrichSelector } from "./ActionForm-BMIAp7pf.js";
|
|
8
8
|
import useAnnotations from "./hooks/useAnnotations.js";
|
|
9
9
|
import useErrors from "./hooks/useErrors.js";
|
|
10
10
|
import { ICON_MAP } from "./icons/iconMap.js";
|
|
@@ -8,7 +8,7 @@ import { useState, useRef, useCallback, useEffect, useMemo } from "react";
|
|
|
8
8
|
import { c as createContext, a as useContextSelector } from "./index-_gpzM2Px.js";
|
|
9
9
|
import { SHOW_EVENT_ID, HIDE_EVENT_ID } from "./data/event.js";
|
|
10
10
|
import { safeDispatchEvent, safeAddEventListener } from "./utils/window.js";
|
|
11
|
-
import { i as isNull } from "./AnnotationDetails-
|
|
11
|
+
import { i as isNull } from "./AnnotationDetails-Dmk8kpl3.js";
|
|
12
12
|
const CluePopupContext = createContext(null);
|
|
13
13
|
const CluePopupProvider = ({ children }) => {
|
|
14
14
|
const [popupType, setPopupType] = useState(null);
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { a as addAPIProvider } from "./iconify-CYJTToEF.js";
|
|
3
|
-
import { a as api, p as post } from "./index-
|
|
3
|
+
import { a as api, p as post } from "./index-Dd7KdsT8.js";
|
|
4
4
|
import { REPLICATORS } from "./database/globals.js";
|
|
5
5
|
import { clueDebugLogger } from "./utils/loggerUtil.js";
|
|
6
|
+
import { detectType } from "./utils/typeDetection.js";
|
|
6
7
|
import { c as computeStatusId } from "./utils-CEySTPtg.js";
|
|
7
8
|
import { b as baseSlice } from "./_baseSlice-GAv_YFTT.js";
|
|
8
9
|
import { t as toFinite } from "./toFinite-meZTg4Su.js";
|
|
@@ -108,7 +109,7 @@ const ClueEnrichProvider = ({
|
|
|
108
109
|
const [isReady, setIsReady] = useState(ready);
|
|
109
110
|
const runningRequestCount = useRef(0);
|
|
110
111
|
const [sources, setSources] = useState([]);
|
|
111
|
-
const { availableSources, typesDetection, supportedTypes } = useClueTypeConfig(
|
|
112
|
+
const { availableSources, typesDetection, typeDetectors, supportedTypes } = useClueTypeConfig(
|
|
112
113
|
enabled && isReady,
|
|
113
114
|
baseURL,
|
|
114
115
|
debugLogging,
|
|
@@ -523,24 +524,8 @@ const ClueEnrichProvider = ({
|
|
|
523
524
|
await database.selectors.bulkRemove(failedEnrichments);
|
|
524
525
|
}, [database, enabled, enrichQueued, isReady]);
|
|
525
526
|
const guessType = useCallback(
|
|
526
|
-
(value2) =>
|
|
527
|
-
|
|
528
|
-
if (!value2) {
|
|
529
|
-
return null;
|
|
530
|
-
}
|
|
531
|
-
const types = Object.entries(typesDetection);
|
|
532
|
-
const regularCheck = (_a2 = types.find(([_type, _regexp]) => _regexp.exec(value2))) == null ? void 0 : _a2[0];
|
|
533
|
-
if (regularCheck) {
|
|
534
|
-
return regularCheck;
|
|
535
|
-
}
|
|
536
|
-
const lowercased = value2.toLowerCase();
|
|
537
|
-
const lowercaseCheck = (_b2 = types.find(([_type, _regexp]) => _regexp.exec(lowercased))) == null ? void 0 : _b2[0];
|
|
538
|
-
if (lowercaseCheck) {
|
|
539
|
-
return lowercaseCheck;
|
|
540
|
-
}
|
|
541
|
-
return null;
|
|
542
|
-
},
|
|
543
|
-
[typesDetection]
|
|
527
|
+
(value2) => detectType(value2, typeDetectors),
|
|
528
|
+
[typeDetectors]
|
|
544
529
|
);
|
|
545
530
|
const value = useMemo(
|
|
546
531
|
() => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Popover } from "@mui/material";
|
|
3
3
|
import React3__default, { useRef, useState, useEffect } from "react";
|
|
4
|
-
import { A as AnnotationDetails } from "../AnnotationDetails-
|
|
4
|
+
import { A as AnnotationDetails } from "../AnnotationDetails-Dmk8kpl3.js";
|
|
5
5
|
const AnnotationDetailPopover = React3__default.memo(({ anchorEl, enrichRequest, open, onClose, ...otherProps }) => {
|
|
6
6
|
var _a, _b, _c;
|
|
7
7
|
const actionRef = useRef();
|
|
@@ -4,13 +4,13 @@ import "@mui/material";
|
|
|
4
4
|
import "./display/icons/Iconified.js";
|
|
5
5
|
import "../data/event.js";
|
|
6
6
|
import "../hooks/ClueComponentContext.js";
|
|
7
|
-
import "../ActionForm-
|
|
7
|
+
import "../ActionForm-BMIAp7pf.js";
|
|
8
8
|
import "../hooks/useAnnotations.js";
|
|
9
9
|
import "../hooks/useErrors.js";
|
|
10
10
|
import "../icons/iconMap.js";
|
|
11
11
|
import "../utils/window.js";
|
|
12
12
|
import "../groupBy-BVV07EGQ.js";
|
|
13
|
-
import { A } from "../AnnotationDetails-
|
|
13
|
+
import { A } from "../AnnotationDetails-Dmk8kpl3.js";
|
|
14
14
|
import "../uniq-CahZPAwp.js";
|
|
15
15
|
import "react";
|
|
16
16
|
import "../index-_gpzM2Px.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
2
|
import "../iconify-CYJTToEF.js";
|
|
3
3
|
import "@mui/material";
|
|
4
|
-
import { A } from "../AnnotationPreview-
|
|
4
|
+
import { A } from "../AnnotationPreview-CIya3ByE.js";
|
|
5
5
|
import "../hooks/useAnnotations.js";
|
|
6
6
|
import "../utils-CEySTPtg.js";
|
|
7
7
|
import "react";
|
|
@@ -2,7 +2,7 @@ import { jsxs, jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { I as Icon } from "../iconify-CYJTToEF.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-
|
|
5
|
+
import { f as useClueEnrichSelector } from "../ActionForm-BMIAp7pf.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";
|
|
@@ -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-
|
|
7
|
-
import { f as useClueEnrichSelector } from "../ActionForm-
|
|
6
|
+
import { C as CluePopupContext } from "../AnnotationPreview-CIya3ByE.js";
|
|
7
|
+
import { f as useClueEnrichSelector } from "../ActionForm-BMIAp7pf.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";
|
|
@@ -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-
|
|
7
|
-
import { f as useClueEnrichSelector } from "../ActionForm-
|
|
6
|
+
import { C as CluePopupContext } from "../AnnotationPreview-CIya3ByE.js";
|
|
7
|
+
import { f as useClueEnrichSelector } from "../ActionForm-BMIAp7pf.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";
|
|
@@ -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-
|
|
4
|
+
import { f as useClueEnrichSelector } from "../ActionForm-BMIAp7pf.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-
|
|
3
|
+
import { e as useClueComponentSelector, f as useClueEnrichSelector } from "../ActionForm-BMIAp7pf.js";
|
|
4
4
|
import { memo, useState, useEffect } from "react";
|
|
5
5
|
const SourcePicker = () => {
|
|
6
6
|
const { t } = useClueComponentSelector((ctx) => ctx.i18next);
|
|
@@ -5,7 +5,7 @@ import "@mui/material";
|
|
|
5
5
|
import "../display/icons/Iconified.js";
|
|
6
6
|
import "../../index-DUEubgWN.js";
|
|
7
7
|
import "../../hooks/ClueComponentContext.js";
|
|
8
|
-
import { A } from "../../ActionForm-
|
|
8
|
+
import { A } from "../../ActionForm-BMIAp7pf.js";
|
|
9
9
|
import "../../utils-CEySTPtg.js";
|
|
10
10
|
import "react";
|
|
11
11
|
import "../../index-_gpzM2Px.js";
|
|
@@ -3,7 +3,7 @@ import { I as Icon } from "../../iconify-CYJTToEF.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-
|
|
6
|
+
import { d as useClueActionsSelector } from "../../ActionForm-BMIAp7pf.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-CYJTToEF.js";
|
|
3
3
|
import "@mui/material";
|
|
4
4
|
import "../../hooks/ClueComponentContext.js";
|
|
5
|
-
import { R } from "../../ActionForm-
|
|
5
|
+
import { R } from "../../ActionForm-BMIAp7pf.js";
|
|
6
6
|
import "react";
|
|
7
7
|
import "../../index-_gpzM2Px.js";
|
|
8
8
|
import "../ClassificationChip.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-
|
|
3
|
+
import { e as useClueComponentSelector, f as useClueEnrichSelector, c as capitalize } from "../../ActionForm-BMIAp7pf.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 }) => {
|
|
@@ -4,7 +4,7 @@ import { useTheme, Skeleton, Chip, Tooltip, Stack, Typography, LinearProgress, P
|
|
|
4
4
|
import { F as FlexOne } from "../../FlexOne-BSYAhhtG.js";
|
|
5
5
|
import Iconified from "../display/icons/Iconified.js";
|
|
6
6
|
import { ClueComponentContext } from "../../hooks/ClueComponentContext.js";
|
|
7
|
-
import { g as useClueFetcherSelector } from "../../ActionForm-
|
|
7
|
+
import { g as useClueFetcherSelector } from "../../ActionForm-BMIAp7pf.js";
|
|
8
8
|
import React3__default, { useState, useRef, useMemo, useEffect, memo } from "react";
|
|
9
9
|
import { a as useContextSelector } from "../../index-_gpzM2Px.js";
|
|
10
10
|
import { FetcherResultView } from "./FetcherResultView.js";
|
|
@@ -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-
|
|
7
|
+
import { e as useClueComponentSelector, f as useClueEnrichSelector, c as capitalize } from "../../ActionForm-BMIAp7pf.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-
|
|
4
|
+
import { e as useClueComponentSelector, f as useClueEnrichSelector } from "../../ActionForm-BMIAp7pf.js";
|
|
5
5
|
import { useContext, useState, useEffect } from "react";
|
|
6
6
|
const QueryStatus = () => {
|
|
7
7
|
const { t } = useClueComponentSelector((ctx) => ctx.i18next);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A safe description of an HTTP failure from the selector replication stream.
|
|
3
|
+
*
|
|
4
|
+
* The error intentionally contains request metadata only; authorization tokens and response bodies are never included.
|
|
5
|
+
*/
|
|
6
|
+
export declare class ClueReplicationError extends Error {
|
|
7
|
+
readonly status: number;
|
|
8
|
+
readonly url: string;
|
|
9
|
+
readonly collection: string;
|
|
10
|
+
constructor(status: number, url: string, collection: string);
|
|
11
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
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);
|
|
4
|
+
class ClueReplicationError extends Error {
|
|
5
|
+
constructor(status, url, collection) {
|
|
6
|
+
super(`Replication stream for collection "${collection}" failed with HTTP status ${status}`);
|
|
7
|
+
__publicField(this, "status");
|
|
8
|
+
__publicField(this, "url");
|
|
9
|
+
__publicField(this, "collection");
|
|
10
|
+
this.name = "ClueReplicationError";
|
|
11
|
+
this.status = status;
|
|
12
|
+
this.url = url;
|
|
13
|
+
this.collection = collection;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
export {
|
|
17
|
+
ClueReplicationError
|
|
18
|
+
};
|
package/database/index.js
CHANGED
package/database/replication.js
CHANGED
package/database/types.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Annotation, Selector, WithExtra } from 'lib/types/lookup';
|
|
2
2
|
import { RxCollection, RxDatabase, RxDocument } from 'rxdb';
|
|
3
|
+
import { ClueReplicationError } from './errors';
|
|
3
4
|
|
|
4
5
|
|
|
5
6
|
/**
|
|
@@ -66,6 +67,27 @@ export interface DatabaseConfig {
|
|
|
66
67
|
* @returns An access token valid for use with the clue API.
|
|
67
68
|
*/
|
|
68
69
|
getToken?: () => string;
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Handle an HTTP error from the selector replication stream. For an expired-token (401) response,
|
|
73
|
+
* return `true` only after refreshing the token returned by `getToken`; replication resumes when that
|
|
74
|
+
* token is nonempty and differs from the token rejected by the server. Returning `false`, throwing,
|
|
75
|
+
* or leaving the token unchanged stops stream retries for that connection. Other 4xx responses are
|
|
76
|
+
* terminal, while network and 5xx failures retry with exponential backoff regardless of this callback's result.
|
|
77
|
+
*
|
|
78
|
+
* @example
|
|
79
|
+
* ```ts
|
|
80
|
+
* {
|
|
81
|
+
* getToken: () => accessToken,
|
|
82
|
+
* onReplicationError: async error => {
|
|
83
|
+
* if (error.status !== 401) return false;
|
|
84
|
+
* accessToken = await refreshAccessToken();
|
|
85
|
+
* return true;
|
|
86
|
+
* }
|
|
87
|
+
* }
|
|
88
|
+
* ```
|
|
89
|
+
*/
|
|
90
|
+
onReplicationError?: (error: ClueReplicationError) => boolean | Promise<boolean>;
|
|
69
91
|
}
|
|
70
92
|
|
|
71
93
|
export type WithLastUpdated<T> = T & {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
2
|
import "@mui/material";
|
|
3
|
-
import { C, a } from "../ActionForm-
|
|
4
|
-
import "../index-
|
|
3
|
+
import { C, a } from "../ActionForm-BMIAp7pf.js";
|
|
4
|
+
import "../index-Dd7KdsT8.js";
|
|
5
5
|
import "../components/display/icons/Iconified.js";
|
|
6
6
|
import "../components/ErrorBoundary.js";
|
|
7
7
|
import "../data/event.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { b as buildDatabase } from "../index-
|
|
2
|
+
import { b as buildDatabase } from "../index-CdqmWKik.js";
|
|
3
3
|
import { createContext, useState, useRef, useEffect } from "react";
|
|
4
4
|
const ClueDatabaseContext = createContext(null);
|
|
5
5
|
const ClueDatabaseProvider = ({
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
2
|
import "../iconify-CYJTToEF.js";
|
|
3
|
-
import "../index-
|
|
3
|
+
import "../index-Dd7KdsT8.js";
|
|
4
4
|
import "../database/globals.js";
|
|
5
5
|
import "../utils/loggerUtil.js";
|
|
6
|
+
import "../utils/typeDetection.js";
|
|
6
7
|
import "../utils-CEySTPtg.js";
|
|
7
|
-
import { C, a } from "../ClueEnrichContext-
|
|
8
|
+
import { C, a } from "../ClueEnrichContext-BqzlMW0c.js";
|
|
8
9
|
import "../sessionStorage-B68y-wnE.js";
|
|
9
10
|
import "../groupBy-BVV07EGQ.js";
|
|
10
11
|
import "../uniq-CahZPAwp.js";
|
|
@@ -81,7 +81,7 @@ export interface ClueEnrichContextType {
|
|
|
81
81
|
queueEnrich: (type: string, value: string, classification?: string) => Promise<StatusDocument | null>;
|
|
82
82
|
|
|
83
83
|
/**
|
|
84
|
-
*
|
|
84
|
+
* Compiled detection regexes with per-type case sensitivity. Use guessType for priority-aware matching.
|
|
85
85
|
*/
|
|
86
86
|
typesDetection: { [type: string]: RegExp };
|
|
87
87
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { a as api } from "../index-
|
|
2
|
+
import { a as api } from "../index-Dd7KdsT8.js";
|
|
3
3
|
import { SNACKBAR_EVENT_ID } from "../data/event.js";
|
|
4
4
|
import { safeDispatchEvent } from "../utils/window.js";
|
|
5
5
|
import { useState, useRef, useMemo, useCallback, useEffect } from "react";
|
|
@@ -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-
|
|
4
|
+
import { f as useClueEnrichSelector } from "../ActionForm-BMIAp7pf.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-
|
|
3
|
+
import { C, a } from "../AnnotationPreview-CIya3ByE.js";
|
|
4
4
|
import "../data/event.js";
|
|
5
5
|
import "../utils/window.js";
|
|
6
|
-
import "../AnnotationDetails-
|
|
6
|
+
import "../AnnotationDetails-Dmk8kpl3.js";
|
|
7
7
|
import "react";
|
|
8
8
|
import "../index-_gpzM2Px.js";
|
|
9
9
|
export {
|
package/hooks/ClueProvider.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { ClueUIPluginProvider } from "./ClueUIPluginContext.js";
|
|
3
|
-
import { a as ClueActionProvider } from "../ActionForm-
|
|
3
|
+
import { a as ClueActionProvider } from "../ActionForm-BMIAp7pf.js";
|
|
4
4
|
import { ClueComponentProvider } from "./ClueComponentContext.js";
|
|
5
5
|
import { ClueConfigProvider } from "./ClueConfigProvider.js";
|
|
6
6
|
import { ClueDatabaseProvider } from "./ClueDatabaseContext.js";
|
|
7
|
-
import { a as ClueEnrichProvider } from "../ClueEnrichContext-
|
|
7
|
+
import { a as ClueEnrichProvider } from "../ClueEnrichContext-BqzlMW0c.js";
|
|
8
8
|
import { ClueFetcherProvider } from "./ClueFetcherContext.js";
|
|
9
|
-
import { a as CluePopupProvider } from "../AnnotationPreview-
|
|
9
|
+
import { a as CluePopupProvider } from "../AnnotationPreview-CIya3ByE.js";
|
|
10
10
|
const ClueProvider = ({ children, ...props }) => {
|
|
11
11
|
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 }) }) }) }) }) }) }) });
|
|
12
12
|
};
|
package/hooks/selectors.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { d, e, f, g } from "../ActionForm-
|
|
1
|
+
import { d, e, f, g } from "../ActionForm-BMIAp7pf.js";
|
|
2
2
|
import "./ClueComponentContext.js";
|
|
3
|
-
import "../ClueEnrichContext-
|
|
3
|
+
import "../ClueEnrichContext-BqzlMW0c.js";
|
|
4
4
|
import "./ClueFetcherContext.js";
|
|
5
5
|
import "../index-_gpzM2Px.js";
|
|
6
6
|
export {
|
package/hooks/useActionResult.js
CHANGED
package/hooks/useAnnotations.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { u as uniqBy } from "../ClueEnrichContext-
|
|
1
|
+
import { u as uniqBy } from "../ClueEnrichContext-BqzlMW0c.js";
|
|
2
2
|
import { useContext, useMemo, useState, useEffect } from "react";
|
|
3
3
|
import { ClueDatabaseContext } from "./ClueDatabaseContext.js";
|
|
4
|
-
import { f as useClueEnrichSelector } from "../ActionForm-
|
|
4
|
+
import { f as useClueEnrichSelector } from "../ActionForm-BMIAp7pf.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-
|
|
2
|
+
import { C as ClueEnrichContext } from "../ClueEnrichContext-BqzlMW0c.js";
|
|
3
3
|
const useClue = () => {
|
|
4
4
|
return useContext(ClueEnrichContext);
|
|
5
5
|
};
|
package/hooks/useClueActions.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { AxiosRequestConfig } from 'axios';
|
|
2
|
+
import { TypeDetector } from "../utils/typeDetection";
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* Hook to populate and provide the types detection and the available sources.
|
|
@@ -14,6 +15,7 @@ declare const useClueTypeConfig: (ready: boolean, baseURL: string, debugLogging:
|
|
|
14
15
|
typesDetection: {
|
|
15
16
|
[type: string]: RegExp;
|
|
16
17
|
};
|
|
18
|
+
typeDetectors: TypeDetector[];
|
|
17
19
|
supportedTypes: string[];
|
|
18
20
|
};
|
|
19
21
|
export default useClueTypeConfig;
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as api } from "../index-Dd7KdsT8.js";
|
|
2
2
|
import { clueDebugLogger } from "../utils/loggerUtil.js";
|
|
3
|
+
import { compileTypeDetectors } from "../utils/typeDetection.js";
|
|
3
4
|
import { i as isEmpty } from "../isEmpty-BE656RUK.js";
|
|
4
|
-
import { useState, useEffect } from "react";
|
|
5
|
+
import { useState, useMemo, useEffect } from "react";
|
|
5
6
|
import { u as uniq } from "../uniq-CahZPAwp.js";
|
|
6
7
|
const useClueTypeConfig = (ready, baseURL, debugLogging, getToken, onNetworkCall) => {
|
|
7
8
|
const [availableSources, setAvailableSources] = useState([]);
|
|
8
|
-
const [
|
|
9
|
+
const [typeDetectors, setTypeDetectors] = useState([]);
|
|
10
|
+
const typesDetection = useMemo(() => Object.fromEntries(typeDetectors), [typeDetectors]);
|
|
9
11
|
const [supportedTypes, setSupportedTypes] = useState([]);
|
|
10
12
|
useEffect(() => {
|
|
11
13
|
if (!ready) {
|
|
@@ -26,28 +28,22 @@ const useClueTypeConfig = (ready, baseURL, debugLogging, getToken, onNetworkCall
|
|
|
26
28
|
}
|
|
27
29
|
clueDebugLogger("Executing types and type detection lookup", debugLogging);
|
|
28
30
|
const [_typesPerSource, _typesDetections] = await Promise.all([
|
|
29
|
-
get(requestConfig),
|
|
30
|
-
get
|
|
31
|
+
api.lookup.types.get(requestConfig),
|
|
32
|
+
api.v2.lookup.types_detection.get(requestConfig)
|
|
31
33
|
]);
|
|
32
34
|
if (_typesPerSource) {
|
|
33
35
|
setAvailableSources(Object.keys(_typesPerSource));
|
|
34
36
|
setSupportedTypes(uniq(Object.values(_typesPerSource).flat()));
|
|
35
37
|
}
|
|
36
38
|
if (_typesDetections) {
|
|
37
|
-
|
|
38
|
-
Object.entries(_typesDetections).reduce((acc, [key, regex]) => {
|
|
39
|
-
if (regex !== null) {
|
|
40
|
-
acc[key] = new RegExp(regex);
|
|
41
|
-
}
|
|
42
|
-
return acc;
|
|
43
|
-
}, {})
|
|
44
|
-
);
|
|
39
|
+
setTypeDetectors(compileTypeDetectors(_typesDetections));
|
|
45
40
|
}
|
|
46
41
|
})();
|
|
47
42
|
}, [baseURL, ready]);
|
|
48
43
|
return {
|
|
49
44
|
availableSources,
|
|
50
45
|
typesDetection,
|
|
46
|
+
typeDetectors,
|
|
51
47
|
supportedTypes
|
|
52
48
|
};
|
|
53
49
|
};
|
package/hooks/useErrors.js
CHANGED
|
@@ -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-
|
|
3
|
+
import { f as useClueEnrichSelector } from "../ActionForm-BMIAp7pf.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-
|
|
2
|
+
import { b as useClueActions } from "../ActionForm-BMIAp7pf.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-CYJTToEF.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-
|
|
6
|
-
import { b as useClueActions } from "../ActionForm-
|
|
5
|
+
import { C as CluePopupContext } from "../AnnotationPreview-CIya3ByE.js";
|
|
6
|
+
import { b as useClueActions } from "../ActionForm-BMIAp7pf.js";
|
|
7
7
|
import { g as groupBy } from "../groupBy-BVV07EGQ.js";
|
|
8
8
|
import { memo, useRef, useMemo, useEffect } from "react";
|
|
9
9
|
import { a as useContextSelector } from "../index-_gpzM2Px.js";
|
package/icons/Assessment.js
CHANGED
|
@@ -2,7 +2,7 @@ import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { I as Icon } from "../iconify-CYJTToEF.js";
|
|
3
3
|
import { useTheme, Stack, Chip, Divider, Grid, Tooltip } from "@mui/material";
|
|
4
4
|
import CountBadge from "../components/CountBadge.js";
|
|
5
|
-
import { C as CluePopupContext } from "../AnnotationPreview-
|
|
5
|
+
import { C as CluePopupContext } from "../AnnotationPreview-CIya3ByE.js";
|
|
6
6
|
import { g as groupBy } from "../groupBy-BVV07EGQ.js";
|
|
7
7
|
import { l as last } from "../last-CUCl67Im.js";
|
|
8
8
|
import { m as maxBy } from "../maxBy-BjjQmX5t.js";
|
package/icons/Context.js
CHANGED
|
@@ -4,7 +4,7 @@ import { Stack, Divider } from "@mui/material";
|
|
|
4
4
|
import AnnotationEntry from "../components/AnnotationEntry.js";
|
|
5
5
|
import CountBadge from "../components/CountBadge.js";
|
|
6
6
|
import Iconified from "../components/display/icons/Iconified.js";
|
|
7
|
-
import { C as CluePopupContext } from "../AnnotationPreview-
|
|
7
|
+
import { C as CluePopupContext } from "../AnnotationPreview-CIya3ByE.js";
|
|
8
8
|
import { g as groupBy } from "../groupBy-BVV07EGQ.js";
|
|
9
9
|
import { memo, useRef, useMemo, useEffect } from "react";
|
|
10
10
|
import { a as useContextSelector } from "../index-_gpzM2Px.js";
|
package/icons/Opinion.js
CHANGED
|
@@ -2,7 +2,7 @@ import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { I as Icon } from "../iconify-CYJTToEF.js";
|
|
3
3
|
import { useTheme, Stack, Chip, Divider, Grid } from "@mui/material";
|
|
4
4
|
import CountBadge from "../components/CountBadge.js";
|
|
5
|
-
import { C as CluePopupContext } from "../AnnotationPreview-
|
|
5
|
+
import { C as CluePopupContext } from "../AnnotationPreview-CIya3ByE.js";
|
|
6
6
|
import { g as groupBy } from "../groupBy-BVV07EGQ.js";
|
|
7
7
|
import { s as sortBy } from "../sortBy-B8JVsLQY.js";
|
|
8
8
|
import { s as sumBy } from "../sumBy-D-HCzM2i.js";
|