@cccsaurora/clue-ui 1.5.0-dev.481 → 1.5.0-dev.485

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 (52) hide show
  1. package/{ActionForm-Bw8N20TK.js → ActionForm-BMIAp7pf.js} +3 -3
  2. package/{AnnotationDetails-CP3LACKv.js → AnnotationDetails-Dmk8kpl3.js} +1 -1
  3. package/{AnnotationPreview-BgiL1Xny.js → AnnotationPreview-CIya3ByE.js} +1 -1
  4. package/{ClueEnrichContext-B76X-cLH.js → ClueEnrichContext-BqzlMW0c.js} +5 -20
  5. package/components/AnnotationDetailPopover.js +1 -1
  6. package/components/AnnotationDetails.js +2 -2
  7. package/components/AnnotationPreview.js +1 -1
  8. package/components/EnrichedCard.js +1 -1
  9. package/components/EnrichedChip.js +2 -2
  10. package/components/EnrichedTypography.js +2 -2
  11. package/components/RetryFailedEnrichments.js +1 -1
  12. package/components/SourcePicker.js +1 -1
  13. package/components/actions/ActionForm.js +1 -1
  14. package/components/actions/ExecutePopover.js +1 -1
  15. package/components/actions/ResultModal.js +1 -1
  16. package/components/enrichment/EnrichPopover.js +1 -1
  17. package/components/fetchers/Fetcher.js +1 -1
  18. package/components/group/GroupControl.js +1 -1
  19. package/components/stats/QueryStatus.js +1 -1
  20. package/database/index.js +2 -2
  21. package/database/replication.js +2 -2
  22. package/hooks/ClueActionContext.js +2 -2
  23. package/hooks/ClueDatabaseContext.js +1 -1
  24. package/hooks/ClueEnrichContext.js +3 -2
  25. package/hooks/ClueEnrichContextType.d.ts +1 -1
  26. package/hooks/ClueFetcherContext.js +1 -1
  27. package/hooks/ClueGroupContext.js +1 -1
  28. package/hooks/CluePopupContext.js +2 -2
  29. package/hooks/ClueProvider.js +3 -3
  30. package/hooks/selectors.js +2 -2
  31. package/hooks/useActionResult.js +1 -1
  32. package/hooks/useAnnotations.js +2 -2
  33. package/hooks/useClue.js +1 -1
  34. package/hooks/useClueActions.js +1 -1
  35. package/hooks/useClueTypeConfig.d.ts +2 -0
  36. package/hooks/useClueTypeConfig.js +9 -13
  37. package/hooks/useErrors.js +1 -1
  38. package/hooks/useFetcherResult.js +1 -1
  39. package/icons/Action.js +2 -2
  40. package/icons/Assessment.js +1 -1
  41. package/icons/Context.js +1 -1
  42. package/icons/Opinion.js +1 -1
  43. package/{index-EUvbYwEJ.js → index-CdqmWKik.js} +2 -2
  44. package/{index-CijTTmTT.js → index-CgvdVEs-.js} +1 -1
  45. package/{index-CPetQxOc.js → index-Dd7KdsT8.js} +113 -89
  46. package/main.d.ts +2 -2
  47. package/main.js +5 -5
  48. package/package.json +1 -1
  49. package/{replication-D4yDBTWp.js → replication-Ck5s0Yg-.js} +1 -1
  50. package/types/lookup.d.ts +10 -1
  51. package/utils/typeDetection.d.ts +7 -0
  52. 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-EUvbYwEJ.js";
10
- import { a as api } from "./index-CPetQxOc.js";
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-B76X-cLH.js";
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-Bw8N20TK.js";
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-CP3LACKv.js";
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-CPetQxOc.js";
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
- var _a2, _b2;
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-CP3LACKv.js";
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-Bw8N20TK.js";
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-CP3LACKv.js";
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-BgiL1Xny.js";
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-Bw8N20TK.js";
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-BgiL1Xny.js";
7
- import { f as useClueEnrichSelector } from "../ActionForm-Bw8N20TK.js";
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-BgiL1Xny.js";
7
- import { f as useClueEnrichSelector } from "../ActionForm-Bw8N20TK.js";
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-Bw8N20TK.js";
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-Bw8N20TK.js";
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-Bw8N20TK.js";
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-Bw8N20TK.js";
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-Bw8N20TK.js";
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-Bw8N20TK.js";
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-Bw8N20TK.js";
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-Bw8N20TK.js";
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-Bw8N20TK.js";
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);
package/database/index.js CHANGED
@@ -1,7 +1,7 @@
1
- import { b } from "../index-EUvbYwEJ.js";
1
+ import { b } from "../index-CdqmWKik.js";
2
2
  import "../utils/constants.js";
3
3
  import "./globals.js";
4
- import "../replication-D4yDBTWp.js";
4
+ import "../replication-Ck5s0Yg-.js";
5
5
  export {
6
6
  b as default
7
7
  };
@@ -1,5 +1,5 @@
1
- import "../index-CPetQxOc.js";
2
- import { aR } from "../replication-D4yDBTWp.js";
1
+ import "../index-Dd7KdsT8.js";
2
+ import { aR } from "../replication-Ck5s0Yg-.js";
3
3
  import "./errors.js";
4
4
  import "./globals.js";
5
5
  import "../last-CUCl67Im.js";
@@ -1,7 +1,7 @@
1
1
  import "react/jsx-runtime";
2
2
  import "@mui/material";
3
- import { C, a } from "../ActionForm-Bw8N20TK.js";
4
- import "../index-CPetQxOc.js";
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-EUvbYwEJ.js";
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-CPetQxOc.js";
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-B76X-cLH.js";
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
- * A set of regexes applications can use for detecting the clue type of a given string
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-CPetQxOc.js";
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-Bw8N20TK.js";
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-BgiL1Xny.js";
3
+ import { C, a } from "../AnnotationPreview-CIya3ByE.js";
4
4
  import "../data/event.js";
5
5
  import "../utils/window.js";
6
- import "../AnnotationDetails-CP3LACKv.js";
6
+ import "../AnnotationDetails-Dmk8kpl3.js";
7
7
  import "react";
8
8
  import "../index-_gpzM2Px.js";
9
9
  export {
@@ -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-Bw8N20TK.js";
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-B76X-cLH.js";
7
+ import { a as ClueEnrichProvider } from "../ClueEnrichContext-BqzlMW0c.js";
8
8
  import { ClueFetcherProvider } from "./ClueFetcherContext.js";
9
- import { a as CluePopupProvider } from "../AnnotationPreview-BgiL1Xny.js";
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
  };
@@ -1,6 +1,6 @@
1
- import { d, e, f, g } from "../ActionForm-Bw8N20TK.js";
1
+ import { d, e, f, g } from "../ActionForm-BMIAp7pf.js";
2
2
  import "./ClueComponentContext.js";
3
- import "../ClueEnrichContext-B76X-cLH.js";
3
+ import "../ClueEnrichContext-BqzlMW0c.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-Bw8N20TK.js";
4
+ import { u } from "../ActionForm-BMIAp7pf.js";
5
5
  export {
6
6
  u as useActionResult
7
7
  };
@@ -1,7 +1,7 @@
1
- import { u as uniqBy } from "../ClueEnrichContext-B76X-cLH.js";
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-Bw8N20TK.js";
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-B76X-cLH.js";
2
+ import { C as ClueEnrichContext } from "../ClueEnrichContext-BqzlMW0c.js";
3
3
  const useClue = () => {
4
4
  return useContext(ClueEnrichContext);
5
5
  };
@@ -1,4 +1,4 @@
1
- import { b } from "../ActionForm-Bw8N20TK.js";
1
+ import { b } from "../ActionForm-BMIAp7pf.js";
2
2
  import "../index-_gpzM2Px.js";
3
3
  export {
4
4
  b as default
@@ -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 { g as get, b as get$1 } from "../index-CPetQxOc.js";
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 [typesDetection, setTypesDetection] = useState({});
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$1(requestConfig)
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
- setTypesDetection(
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
  };
@@ -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-Bw8N20TK.js";
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-Bw8N20TK.js";
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-BgiL1Xny.js";
6
- import { b as useClueActions } from "../ActionForm-Bw8N20TK.js";
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";
@@ -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-BgiL1Xny.js";
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-BgiL1Xny.js";
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-BgiL1Xny.js";
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";
@@ -1,6 +1,6 @@
1
1
  import { d as debounce } from "./sessionStorage-B68y-wnE.js";
2
2
  import { i as isObject } from "./isObject-FTY-5JQX.js";
3
- import { aq as identity, aL as operate, W as createOperatorSubscriber, ax as isFunction, U as computeValue, b0 as truthy, H as assert, a4 as ensureArray, at as isArray, T as compare, V as createExpressionOperator, c as $eq$1, f as $gt$1, h as $gte$1, k as $lt$1, m as $lte$1, p as $ne$1, M as MingoError, ay as isFunction$1, X as createQueryOperator, $ as $all$1, al as getSchemaByObjectPath, aK as objectPathMonad, y as INDEX_MIN, I as INDEX_MAX, a5 as ensureNotFalsy, ag as getFromMapOrCreate, ai as getPrimaryFieldOfPrimaryKey, aS as requestIdleCallbackIfAvailable, B as BehaviorSubject, aG as mergeMap, aa as firstValueFrom, a8 as filter, ab as flatClone$1, a0 as createRxQuery, _ as _getDefaultQuery, aP as queryCollection, aH as newRxError, af as getDefaultRevision, aJ as now, aN as prepareQuery, aM as overwritable, az as isMaybeReadonlyArray, ac as flatCloneDocWithMeta, S as Subject, a_ as toArray, K as categorizeBulkWriteRows, aO as pushAtSortPosition, ak as getQueryMatcher, am as getSortComparator, P as PROMISE_RESOLVE_TRUE, z as PROMISE_RESOLVE_VOID, R as RXDB_VERSION, a6 as ensureRxStorageInstanceParamsAreCorrect, aQ as randomToken, a1 as deepEqual, aT as requestIdlePromiseNoQueue, a as $and$1, b as $elemMatch, d as $eq$2, e as $exists, g as $gt$2, i as $gte$2, j as $in, l as $lt$2, n as $lte$2, o as $mod, q as $ne$2, r as $nin, s as $nor, t as $not$1, u as $or$1, v as $regex, w as $size, x as $type, ar as initOptions, C as Context, Q as Query, b2 as walk, aU as resolve$1, au as isDate, aB as isObject$1, aD as isRegExp, O as cloneDeep, an as has, as as intersection, b1 as unique, aA as isNumber, aC as isOperator, av as isEqual, L as clone$1, aW as runQueryUpdateFunction, ae as getChangedDocumentsSince, aV as runPluginHooks, aX as setProperty, aF as merge, aY as shareReplay, A as RXJS_SHARE_REPLAY_DEFAULTS, aE as map, G as appendToArray, aj as getProperty, aZ as startWith, a3 as distinctUntilChanged, F as addRxPlugin, Y as createRxDatabase, aR as replicateSelectorCollection } from "./replication-D4yDBTWp.js";
3
+ import { aq as identity, aL as operate, W as createOperatorSubscriber, ax as isFunction, U as computeValue, b0 as truthy, H as assert, a4 as ensureArray, at as isArray, T as compare, V as createExpressionOperator, c as $eq$1, f as $gt$1, h as $gte$1, k as $lt$1, m as $lte$1, p as $ne$1, M as MingoError, ay as isFunction$1, X as createQueryOperator, $ as $all$1, al as getSchemaByObjectPath, aK as objectPathMonad, y as INDEX_MIN, I as INDEX_MAX, a5 as ensureNotFalsy, ag as getFromMapOrCreate, ai as getPrimaryFieldOfPrimaryKey, aS as requestIdleCallbackIfAvailable, B as BehaviorSubject, aG as mergeMap, aa as firstValueFrom, a8 as filter, ab as flatClone$1, a0 as createRxQuery, _ as _getDefaultQuery, aP as queryCollection, aH as newRxError, af as getDefaultRevision, aJ as now, aN as prepareQuery, aM as overwritable, az as isMaybeReadonlyArray, ac as flatCloneDocWithMeta, S as Subject, a_ as toArray, K as categorizeBulkWriteRows, aO as pushAtSortPosition, ak as getQueryMatcher, am as getSortComparator, P as PROMISE_RESOLVE_TRUE, z as PROMISE_RESOLVE_VOID, R as RXDB_VERSION, a6 as ensureRxStorageInstanceParamsAreCorrect, aQ as randomToken, a1 as deepEqual, aT as requestIdlePromiseNoQueue, a as $and$1, b as $elemMatch, d as $eq$2, e as $exists, g as $gt$2, i as $gte$2, j as $in, l as $lt$2, n as $lte$2, o as $mod, q as $ne$2, r as $nin, s as $nor, t as $not$1, u as $or$1, v as $regex, w as $size, x as $type, ar as initOptions, C as Context, Q as Query, b2 as walk, aU as resolve$1, au as isDate, aB as isObject$1, aD as isRegExp, O as cloneDeep, an as has, as as intersection, b1 as unique, aA as isNumber, aC as isOperator, av as isEqual, L as clone$1, aW as runQueryUpdateFunction, ae as getChangedDocumentsSince, aV as runPluginHooks, aX as setProperty, aF as merge, aY as shareReplay, A as RXJS_SHARE_REPLAY_DEFAULTS, aE as map, G as appendToArray, aj as getProperty, aZ as startWith, a3 as distinctUntilChanged, F as addRxPlugin, Y as createRxDatabase, aR as replicateSelectorCollection } from "./replication-Ck5s0Yg-.js";
4
4
  import { g as getDefaultExportFromCjs } from "./_commonjsHelpers-CUmg6egw.js";
5
5
  import { REPLICATE } from "./utils/constants.js";
6
6
  import { REPLICATORS } from "./database/globals.js";
@@ -9656,7 +9656,7 @@ const buildDatabase = async (_config = {}) => {
9656
9656
  addRxPlugin(RxDBStatePlugin);
9657
9657
  /* v8 ignore next 10 -- @preserve */
9658
9658
  if (config.devMode) {
9659
- await import("./index-CijTTmTT.js").then((module) => {
9659
+ await import("./index-CgvdVEs-.js").then((module) => {
9660
9660
  addRxPlugin(module.RxDBDevModePlugin);
9661
9661
  if (config.testing) {
9662
9662
  module.disableWarnings();
@@ -1,4 +1,4 @@
1
- import { N as NON_PREMIUM_COLLECTION_LIMIT, E as RxDatabaseBase, D as RxCollectionBase, Z as createRxDocumentConstructor, J as basePrototype, aH as newRxError, az as isMaybeReadonlyArray, al as getSchemaByObjectPath, ad as flattenObject, aj as getProperty, a$ as trimDots, G as appendToArray, ai as getPrimaryFieldOfPrimaryKey, aI as newRxTypeError, ah as getPreviousVersions, aw as isFolderPath, aN as prepareQuery, a9 as findUndefinedPath, a1 as deepEqual, a7 as fillPrimaryKey, ao as hasPremiumFlag, R as RXDB_VERSION, ap as hashStringToNumber, a2 as deepFreeze } from "./replication-D4yDBTWp.js";
1
+ import { N as NON_PREMIUM_COLLECTION_LIMIT, E as RxDatabaseBase, D as RxCollectionBase, Z as createRxDocumentConstructor, J as basePrototype, aH as newRxError, az as isMaybeReadonlyArray, al as getSchemaByObjectPath, ad as flattenObject, aj as getProperty, a$ as trimDots, G as appendToArray, ai as getPrimaryFieldOfPrimaryKey, aI as newRxTypeError, ah as getPreviousVersions, aw as isFolderPath, aN as prepareQuery, a9 as findUndefinedPath, a1 as deepEqual, a7 as fillPrimaryKey, ao as hasPremiumFlag, R as RXDB_VERSION, ap as hashStringToNumber, a2 as deepFreeze } from "./replication-Ck5s0Yg-.js";
2
2
  var ERROR_MESSAGES = {
3
3
  // util.js / config
4
4
  UT1: "given name is no string or empty",
@@ -5,26 +5,26 @@ import { MY_LOCAL_STORAGE_PREFIX, StorageKey } from "./utils/constants.js";
5
5
  import { i as isNil } from "./isNil-CIubwp4T.js";
6
6
  import { g as getDefaultExportFromCjs } from "./_commonjsHelpers-CUmg6egw.js";
7
7
  import { g as getAxiosCache, s as setAxiosCache } from "./sessionStorage-B68y-wnE.js";
8
- const get$a = (actionId, taskId, options = { timeout: null }, config) => {
8
+ const get$b = (actionId, taskId, options = { timeout: null }, config) => {
9
9
  const searchParams = [];
10
10
  if (!isNil(options.timeout)) {
11
11
  searchParams.push(`max_timeout=${options.timeout}`);
12
12
  }
13
13
  return hget(
14
- joinUri(uri$d(), `${actionId.replace(".", "/")}/status/${taskId}`),
14
+ joinUri(uri$g(), `${actionId.replace(".", "/")}/status/${taskId}`),
15
15
  searchParams.length > 0 ? new URLSearchParams(searchParams.join("&")) : null,
16
16
  config
17
17
  );
18
18
  };
19
19
  const status$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
20
20
  __proto__: null,
21
- get: get$a
21
+ get: get$b
22
22
  }, Symbol.toStringTag, { value: "Module" }));
23
- const uri$d = () => {
23
+ const uri$g = () => {
24
24
  return joinUri(uri(), "actions");
25
25
  };
26
- const get$9 = (config) => {
27
- return hget(uri$d(), null, config);
26
+ const get$a = (config) => {
27
+ return hget(uri$g(), null, config);
28
28
  };
29
29
  const post$4 = (actionId, selectors, params, context, options = { timeout: null }, config) => {
30
30
  const searchParams = [];
@@ -44,7 +44,7 @@ const post$4 = (actionId, selectors, params, context, options = { timeout: null
44
44
  payload.context = context ?? null;
45
45
  return hpost(
46
46
  joinUri(
47
- joinUri(uri$d(), "execute"),
47
+ joinUri(uri$g(), "execute"),
48
48
  actionId.replace(".", "/"),
49
49
  searchParams.length > 0 ? new URLSearchParams(searchParams.join("&")) : null
50
50
  ),
@@ -54,83 +54,83 @@ const post$4 = (actionId, selectors, params, context, options = { timeout: null
54
54
  };
55
55
  const actions = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
56
56
  __proto__: null,
57
- get: get$9,
57
+ get: get$a,
58
58
  post: post$4,
59
59
  status: status$1,
60
- uri: uri$d
60
+ uri: uri$g
61
61
  }, Symbol.toStringTag, { value: "Module" }));
62
- const uri$c = (searchParams) => {
63
- return joinUri(uri$b(), "login", searchParams);
62
+ const uri$f = (searchParams) => {
63
+ return joinUri(uri$e(), "login", searchParams);
64
64
  };
65
65
  const post$3 = (body) => {
66
- return hpost(uri$c(), body);
66
+ return hpost(uri$f(), body);
67
67
  };
68
- const get$8 = (search) => {
68
+ const get$9 = (search) => {
69
69
  const nonce = localStorage.getItem(`${MY_LOCAL_STORAGE_PREFIX}.${StorageKey.LOGIN_NONCE}`);
70
70
  if (nonce) {
71
71
  search.set("nonce", JSON.parse(nonce));
72
72
  localStorage.removeItem(`${MY_LOCAL_STORAGE_PREFIX}.${StorageKey.LOGIN_NONCE}`);
73
73
  }
74
- return hget(uri$c(), search);
74
+ return hget(uri$f(), search);
75
75
  };
76
76
  const login = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
77
77
  __proto__: null,
78
- get: get$8,
78
+ get: get$9,
79
79
  post: post$3,
80
- uri: uri$c
80
+ uri: uri$f
81
81
  }, Symbol.toStringTag, { value: "Module" }));
82
- const uri$b = () => {
82
+ const uri$e = () => {
83
83
  return joinUri(uri(), "auth");
84
84
  };
85
85
  const auth = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
86
86
  __proto__: null,
87
87
  login,
88
- uri: uri$b
88
+ uri: uri$e
89
89
  }, Symbol.toStringTag, { value: "Module" }));
90
- const uri$a = () => {
90
+ const uri$d = () => {
91
91
  return joinUri(uri(), "configs");
92
92
  };
93
- const get$7 = (config) => {
94
- return hget(uri$a(), null, config);
93
+ const get$8 = (config) => {
94
+ return hget(uri$d(), null, config);
95
95
  };
96
96
  const configs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
97
97
  __proto__: null,
98
- get: get$7,
99
- uri: uri$a
98
+ get: get$8,
99
+ uri: uri$d
100
100
  }, Symbol.toStringTag, { value: "Module" }));
101
- const get$6 = (fetcherId, taskId, options = { timeout: null }, config) => {
101
+ const get$7 = (fetcherId, taskId, options = { timeout: null }, config) => {
102
102
  const searchParams = [];
103
103
  if (!isNil(options.timeout)) {
104
104
  searchParams.push(`max_timeout=${options.timeout}`);
105
105
  }
106
106
  return hget(
107
- joinUri(uri$d(), `${fetcherId.replace(".", "/")}/status/${taskId}`),
107
+ joinUri(uri$g(), `${fetcherId.replace(".", "/")}/status/${taskId}`),
108
108
  searchParams.length > 0 ? new URLSearchParams(searchParams.join("&")) : null,
109
109
  config
110
110
  );
111
111
  };
112
112
  const status = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
113
113
  __proto__: null,
114
- get: get$6
114
+ get: get$7
115
115
  }, Symbol.toStringTag, { value: "Module" }));
116
- const uri$9 = () => {
116
+ const uri$c = () => {
117
117
  return joinUri(uri(), "fetchers");
118
118
  };
119
- const get$5 = (config) => {
120
- return hget(uri$9(), null, config);
119
+ const get$6 = (config) => {
120
+ return hget(uri$c(), null, config);
121
121
  };
122
122
  const post$2 = (fetcherId, selector, config) => {
123
- return hpost(joinAllUri(uri$9(), fetcherId.replace(".", "/")), selector, config);
123
+ return hpost(joinAllUri(uri$c(), fetcherId.replace(".", "/")), selector, config);
124
124
  };
125
125
  const fetchers = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
126
126
  __proto__: null,
127
- get: get$5,
127
+ get: get$6,
128
128
  post: post$2,
129
129
  status,
130
- uri: uri$9
130
+ uri: uri$c
131
131
  }, Symbol.toStringTag, { value: "Module" }));
132
- const uri$8 = () => {
133
- return joinUri(uri$5(), "enrich");
132
+ const uri$b = () => {
133
+ return joinUri(uri$8(), "enrich");
134
134
  };
135
135
  const post$1 = (bulkData, sources = [], options = { timeout: null, includeRaw: false, noCache: false }, config) => {
136
136
  const searchParams = [];
@@ -150,7 +150,7 @@ const post$1 = (bulkData, sources = [], options = { timeout: null, includeRaw: f
150
150
  searchParams.push("no_cache=true");
151
151
  }
152
152
  return hpost(
153
- joinUri(uri$8(), "", searchParams.length > 0 ? new URLSearchParams(searchParams.join("&")) : null),
153
+ joinUri(uri$b(), "", searchParams.length > 0 ? new URLSearchParams(searchParams.join("&")) : null),
154
154
  bulkData,
155
155
  config
156
156
  );
@@ -158,75 +158,75 @@ const post$1 = (bulkData, sources = [], options = { timeout: null, includeRaw: f
158
158
  const enrich = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
159
159
  __proto__: null,
160
160
  post: post$1,
161
- uri: uri$8
161
+ uri: uri$b
162
162
  }, Symbol.toStringTag, { value: "Module" }));
163
- const uri$7 = () => {
164
- return joinUri(uri$5(), "types");
163
+ const uri$a = () => {
164
+ return joinUri(uri$8(), "types");
165
165
  };
166
- const get$4 = (config) => {
167
- return hget(uri$7(), null, config);
166
+ const get$5 = (config) => {
167
+ return hget(uri$a(), null, config);
168
168
  };
169
169
  const types = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
170
170
  __proto__: null,
171
- get: get$4,
172
- uri: uri$7
171
+ get: get$5,
172
+ uri: uri$a
173
173
  }, Symbol.toStringTag, { value: "Module" }));
174
- const uri$6 = () => {
175
- return joinUri(uri$5(), "types_detection");
174
+ const uri$9 = () => {
175
+ return joinUri(uri$8(), "types_detection");
176
176
  };
177
- const get$3 = (config) => {
178
- return hget(uri$6(), null, config);
177
+ const get$4 = (config) => {
178
+ return hget(uri$9(), null, config);
179
179
  };
180
- const types_detection = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
180
+ const types_detection$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
181
181
  __proto__: null,
182
- get: get$3,
183
- uri: uri$6
182
+ get: get$4,
183
+ uri: uri$9
184
184
  }, Symbol.toStringTag, { value: "Module" }));
185
- const uri$5 = () => {
185
+ const uri$8 = () => {
186
186
  return joinUri(uri(), "lookup");
187
187
  };
188
188
  const lookup = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
189
189
  __proto__: null,
190
190
  enrich,
191
191
  types,
192
- types_detection,
193
- uri: uri$5
192
+ types_detection: types_detection$1,
193
+ uri: uri$8
194
194
  }, Symbol.toStringTag, { value: "Module" }));
195
- const uri$4 = (filter2) => {
196
- return joinUri(uri$2(), filter2 ? "/docs?filter=" + filter2 : "/docs");
195
+ const uri$7 = (filter2) => {
196
+ return joinUri(uri$5(), filter2 ? "/docs?filter=" + filter2 : "/docs");
197
197
  };
198
- const get$2 = (filter2, config) => {
199
- return hget(uri$4(filter2), null, config);
198
+ const get$3 = (filter2, config) => {
199
+ return hget(uri$7(filter2), null, config);
200
200
  };
201
201
  const all_documentation = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
202
202
  __proto__: null,
203
- get: get$2,
204
- uri: uri$4
203
+ get: get$3,
204
+ uri: uri$7
205
205
  }, Symbol.toStringTag, { value: "Module" }));
206
- const uri$3 = (file) => {
207
- return joinAllUri(uri$2(), "docs", file);
206
+ const uri$6 = (file) => {
207
+ return joinAllUri(uri$5(), "docs", file);
208
208
  };
209
- const get$1 = (file, config) => {
210
- return hget(uri$3(file), null, config);
209
+ const get$2 = (file, config) => {
210
+ return hget(uri$6(file), null, config);
211
211
  };
212
212
  const documentation = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
213
213
  __proto__: null,
214
- get: get$1,
215
- uri: uri$3
214
+ get: get$2,
215
+ uri: uri$6
216
216
  }, Symbol.toStringTag, { value: "Module" }));
217
- const uri$2 = () => {
217
+ const uri$5 = () => {
218
218
  return joinUri(uri(), "static");
219
219
  };
220
220
  const _static = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
221
221
  __proto__: null,
222
222
  all_documentation,
223
223
  documentation,
224
- uri: uri$2
224
+ uri: uri$5
225
225
  }, Symbol.toStringTag, { value: "Module" }));
226
- const uri$1 = () => {
226
+ const uri$4 = () => {
227
227
  return joinUri(uri(), "sync");
228
228
  };
229
- const get = (collection, id, timestamp, omitDeleted, config) => {
229
+ const get$1 = (collection, id, timestamp, omitDeleted, config) => {
230
230
  const params = new URLSearchParams();
231
231
  params.set("limit", "250");
232
232
  if (!isNil(id)) {
@@ -238,15 +238,40 @@ const get = (collection, id, timestamp, omitDeleted, config) => {
238
238
  if (!isNil(omitDeleted) && omitDeleted) {
239
239
  params.set("omit_deleted", "true");
240
240
  }
241
- return hget(joinAllUri(uri$1(), collection), params, config);
241
+ return hget(joinAllUri(uri$4(), collection), params, config);
242
242
  };
243
243
  const post = (collection, payload, config) => {
244
- return hpost(joinAllUri(uri$1(), collection), payload, config);
244
+ return hpost(joinAllUri(uri$4(), collection), payload, config);
245
245
  };
246
246
  const sync = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
247
247
  __proto__: null,
248
- get,
248
+ get: get$1,
249
249
  post,
250
+ uri: uri$4
251
+ }, Symbol.toStringTag, { value: "Module" }));
252
+ const uri$3 = () => joinUri(uri$2(), "types_detection");
253
+ const get = (config) => {
254
+ return hget(uri$3(), null, config);
255
+ };
256
+ const types_detection = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
257
+ __proto__: null,
258
+ get,
259
+ uri: uri$3
260
+ }, Symbol.toStringTag, { value: "Module" }));
261
+ const uri$2 = () => {
262
+ return joinUri(uri$1(), "lookup");
263
+ };
264
+ const index = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
265
+ __proto__: null,
266
+ types_detection,
267
+ uri: uri$2
268
+ }, Symbol.toStringTag, { value: "Module" }));
269
+ const uri$1 = () => {
270
+ return "/api/v2";
271
+ };
272
+ const v2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
273
+ __proto__: null,
274
+ lookup: index,
250
275
  uri: uri$1
251
276
  }, Symbol.toStringTag, { value: "Module" }));
252
277
  function bind(fn, thisArg) {
@@ -1469,10 +1494,10 @@ function toFormData$1(obj, formData, options) {
1469
1494
  value = stringifyWithDepthLimit(value, 1);
1470
1495
  } else if (utils$1.isArray(value) && isFlatArray(value) || (utils$1.isFileList(value) || utils$1.endsWith(key, "[]")) && (arr = utils$1.toArray(value))) {
1471
1496
  key = removeBrackets(key);
1472
- arr.forEach(function each(el, index) {
1497
+ arr.forEach(function each(el, index2) {
1473
1498
  !(utils$1.isUndefined(el) || el === null) && formData.append(
1474
1499
  // eslint-disable-next-line no-nested-ternary
1475
- indexes === true ? renderKey([key], index, dots) : indexes === null ? key : key + "[]",
1500
+ indexes === true ? renderKey([key], index2, dots) : indexes === null ? key : key + "[]",
1476
1501
  convertValue(el)
1477
1502
  );
1478
1503
  });
@@ -1754,10 +1779,10 @@ function toURLEncodedForm(data, options) {
1754
1779
  });
1755
1780
  }
1756
1781
  const MAX_DEPTH = DEFAULT_FORM_DATA_MAX_DEPTH;
1757
- function throwIfDepthExceeded(index) {
1758
- if (index > MAX_DEPTH) {
1782
+ function throwIfDepthExceeded(index2) {
1783
+ if (index2 > MAX_DEPTH) {
1759
1784
  throw new AxiosError$1(
1760
- "FormData field is too deeply nested (" + index + " levels). Max depth: " + MAX_DEPTH,
1785
+ "FormData field is too deeply nested (" + index2 + " levels). Max depth: " + MAX_DEPTH,
1761
1786
  AxiosError$1.ERR_FORM_DATA_DEPTH_EXCEEDED
1762
1787
  );
1763
1788
  }
@@ -1785,12 +1810,12 @@ function arrayToObject(arr) {
1785
1810
  return obj;
1786
1811
  }
1787
1812
  function formDataToJSON(formData) {
1788
- function buildPath(path, value, target, index) {
1789
- throwIfDepthExceeded(index);
1790
- let name = path[index++];
1813
+ function buildPath(path, value, target, index2) {
1814
+ throwIfDepthExceeded(index2);
1815
+ let name = path[index2++];
1791
1816
  if (name === "__proto__") return true;
1792
1817
  const isNumericKey = Number.isFinite(+name);
1793
- const isLast = index >= path.length;
1818
+ const isLast = index2 >= path.length;
1794
1819
  name = !name && utils$1.isArray(target) ? target.length : name;
1795
1820
  if (isLast) {
1796
1821
  if (utils$1.hasOwnProp(target, name)) {
@@ -1803,7 +1828,7 @@ function formDataToJSON(formData) {
1803
1828
  if (!utils$1.hasOwnProp(target, name) || !utils$1.isObject(target[name])) {
1804
1829
  target[name] = [];
1805
1830
  }
1806
- const result = buildPath(path, value, target[name], index);
1831
+ const result = buildPath(path, value, target[name], index2);
1807
1832
  if (result && utils$1.isArray(target[name])) {
1808
1833
  target[name] = arrayToObject(target[name]);
1809
1834
  }
@@ -3728,9 +3753,9 @@ let CancelToken$1 = class CancelToken {
3728
3753
  if (!this._listeners) {
3729
3754
  return;
3730
3755
  }
3731
- const index = this._listeners.indexOf(listener);
3732
- if (index !== -1) {
3733
- this._listeners.splice(index, 1);
3756
+ const index2 = this._listeners.indexOf(listener);
3757
+ if (index2 !== -1) {
3758
+ this._listeners.splice(index2, 1);
3734
3759
  }
3735
3760
  }
3736
3761
  toAbortSignal() {
@@ -4301,13 +4326,14 @@ const api = {
4301
4326
  actions,
4302
4327
  fetchers,
4303
4328
  sync,
4304
- _static
4329
+ _static,
4330
+ v2
4305
4331
  };
4306
4332
  const uri = () => {
4307
4333
  return "/api/v1";
4308
4334
  };
4309
4335
  const format = (_uri, baseURL) => {
4310
- const path = _uri.startsWith(uri()) ? _uri : `${uri()}/${_uri.replace(/\/$/, "")}`.replace("//", "/");
4336
+ const path = _uri.startsWith("/api") ? _uri : `${uri()}/${_uri.replace(/\/$/, "")}`.replace("//", "/");
4311
4337
  return baseURL ? baseURL + path : path;
4312
4338
  };
4313
4339
  const joinParams = (_uri, searchParams) => {
@@ -4384,9 +4410,7 @@ const hpost = (_uri, body, config = {}) => {
4384
4410
  };
4385
4411
  export {
4386
4412
  api as a,
4387
- get$3 as b,
4388
- get$4 as g,
4389
4413
  joinAllUri as j,
4390
4414
  post$1 as p,
4391
- uri$1 as u
4415
+ uri$4 as u
4392
4416
  };
package/main.d.ts CHANGED
@@ -2,7 +2,7 @@ import { ClueDatabase, ClueDatabaseCollections, DatabaseConfig, SelectorCollecti
2
2
  import { ActionDefinition, ActionDefinitionsResponse, ActionResult } from "./types/action";
3
3
  import { default as EnrichmentProps } from "./types/EnrichmentProps";
4
4
  import { FetcherDefinition, FetcherDefinitionsResponse, FetcherResult } from "./types/fetcher";
5
- import { Annotation, BulkEnrichRequest, BulkEnrichResponses, Enrichment, EnrichResponse, EnrichResponses, FailedRequest, Selector, TypesDetectionResponse, TypesResponse, WithExtra } from "./types/lookup";
5
+ import { Annotation, BulkEnrichRequest, BulkEnrichResponses, Enrichment, EnrichResponse, EnrichResponses, FailedRequest, Selector, SupportedType, TypesDetectionResponse, TypesDetectionV2Response, TypesResponse, WithExtra } from "./types/lookup";
6
6
  import { ClueResponse } from "./types/network";
7
7
  import { default as RunningActionData } from "./types/RunningActionData";
8
8
  import { default as ActionForm } from './components/actions/ActionForm';
@@ -41,5 +41,5 @@ import { ClueUIPluginDefinition } from './plugins/registry';
41
41
  import { default as FrequencyText } from './text/Frequency';
42
42
 
43
43
  export { ActionForm, AnnotationDetailPopover, AnnotationDetails, AnnotationEntry, AnnotationPreview, AssessmentIcon, buildDatabase, ClueComponentContext, ClueConfigContext, ClueDatabaseContext, ClueEnrichContext, CluePopupContext, ClueProvider, ClueReplicationError, ClueUIPlugin, ContextIcon, CountBadge, EnrichedCard, EnrichedChip, EnrichedTypography, Entry, Fetcher, FrequencyText, Group, GroupControl, OpinionIcon, SNACKBAR_EVENT_ID, SourcePicker, StatusChip, useClue, useClueActions, useClueActionsSelector, useClueConfig, useClueEnrichSelector, useClueFetcherSelector };
44
- export type { ActionDefinition, ActionDefinitionsResponse, ActionResult, Annotation, BulkEnrichRequest, BulkEnrichResponses, ClueConfigContextProps, ClueDatabase, ClueDatabaseCollections, ClueDatabaseContextProps, ClueResponse, ClueUIPluginDefinition, DatabaseConfig, EnrichedCardProps, EnrichedTypographyProps, Enrichment, EnrichmentProps, EnrichResponse, EnrichResponses, FailedRequest, FetcherDefinition, FetcherDefinitionsResponse, FetcherResult, RunningActionData, Selector, SelectorCollection, SelectorCollectionMethods, SelectorDocMethods, SelectorDocType, SelectorDocument, SnackbarEvents, StatusCollection, StatusCollectionMethods, StatusDocMethods, StatusDocType, StatusDocument, TypesDetectionResponse, TypesResponse, WithExtra };
44
+ export type { ActionDefinition, ActionDefinitionsResponse, ActionResult, Annotation, BulkEnrichRequest, BulkEnrichResponses, ClueConfigContextProps, ClueDatabase, ClueDatabaseCollections, ClueDatabaseContextProps, ClueResponse, ClueUIPluginDefinition, DatabaseConfig, EnrichedCardProps, EnrichedTypographyProps, Enrichment, EnrichmentProps, EnrichResponse, EnrichResponses, FailedRequest, FetcherDefinition, FetcherDefinitionsResponse, FetcherResult, RunningActionData, Selector, SelectorCollection, SelectorCollectionMethods, SelectorDocMethods, SelectorDocType, SelectorDocument, SnackbarEvents, StatusCollection, StatusCollectionMethods, StatusDocMethods, StatusDocType, StatusDocument, SupportedType, TypesDetectionResponse, TypesDetectionV2Response, TypesResponse, WithExtra };
45
45
  export type { ClueConfigContextProps as BorealisConfigContextProps, ClueDatabase as BorealisDatabase, ClueDatabaseCollections as BorealisDatabaseCollections, ClueDatabaseContextProps as BorealisDatabaseContextProps, ClueResponse as BorealisResponse };
package/main.js CHANGED
@@ -1,8 +1,8 @@
1
- import { A, b, d, f, g } from "./ActionForm-Bw8N20TK.js";
1
+ import { A, b, d, f, g } from "./ActionForm-BMIAp7pf.js";
2
2
  import { default as default2 } from "./components/AnnotationDetailPopover.js";
3
- import { A as A2 } from "./AnnotationDetails-CP3LACKv.js";
3
+ import { A as A2 } from "./AnnotationDetails-Dmk8kpl3.js";
4
4
  import { default as default3 } from "./components/AnnotationEntry.js";
5
- import { A as A3, C } from "./AnnotationPreview-BgiL1Xny.js";
5
+ import { A as A3, C } from "./AnnotationPreview-CIya3ByE.js";
6
6
  import { default as default4 } from "./components/CountBadge.js";
7
7
  import { default as default5 } from "./components/EnrichedCard.js";
8
8
  import { default as default6 } from "./components/EnrichedChip.js";
@@ -14,12 +14,12 @@ import { default as default11 } from "./components/group/Group.js";
14
14
  import { default as default12 } from "./components/group/GroupControl.js";
15
15
  import { default as default13 } from "./components/SourcePicker.js";
16
16
  import { SNACKBAR_EVENT_ID } from "./data/event.js";
17
- import { b as b2 } from "./index-EUvbYwEJ.js";
17
+ import { b as b2 } from "./index-CdqmWKik.js";
18
18
  import { ClueReplicationError } from "./database/errors.js";
19
19
  import { ClueComponentContext } from "./hooks/ClueComponentContext.js";
20
20
  import { ClueConfigContext } from "./hooks/ClueConfigProvider.js";
21
21
  import { ClueDatabaseContext } from "./hooks/ClueDatabaseContext.js";
22
- import { C as C2 } from "./ClueEnrichContext-B76X-cLH.js";
22
+ import { C as C2 } from "./ClueEnrichContext-BqzlMW0c.js";
23
23
  import { ClueProvider } from "./hooks/ClueProvider.js";
24
24
  import { default as default14 } from "./hooks/useClue.js";
25
25
  import { default as default15 } from "./hooks/useClueConfig.js";
package/package.json CHANGED
@@ -68,7 +68,7 @@
68
68
  },
69
69
  "type": "module",
70
70
  "types": "main.d.ts",
71
- "version": "1.5.0-dev.481",
71
+ "version": "1.5.0-dev.485",
72
72
  "exports": {
73
73
  ".": "./main.js",
74
74
  "./index.css": "./index.css",
@@ -9,7 +9,7 @@ var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read fr
9
9
  var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
10
10
  var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
11
11
  var _hashFn, _keyMap, _unpack, _options, _root, _local, _operators, _iteratees, _yieldedValues, _getNext, _a, _source, _predicate, _projection, _options2, _operators2, _result, _buffer, _compiled, _options3, _condition;
12
- import { a as api, j as joinAllUri, u as uri } from "./index-CPetQxOc.js";
12
+ import { a as api, j as joinAllUri, u as uri } from "./index-Dd7KdsT8.js";
13
13
  import { ClueReplicationError } from "./database/errors.js";
14
14
  import { REPLICATORS } from "./database/globals.js";
15
15
  import { l as last$1 } from "./last-CUCl67Im.js";
package/types/lookup.d.ts CHANGED
@@ -57,6 +57,15 @@ export type EnrichResponses = {
57
57
 
58
58
  export type BulkEnrichResponses = { [type: string]: { [value: string]: EnrichResponses } };
59
59
 
60
- export type TypesDetectionResponse = { [type: string]: string };
60
+ export type TypesDetectionResponse = { [type: string]: string | null };
61
+
62
+ export interface SupportedType {
63
+ regex: string | null;
64
+ case_sensitive: boolean;
65
+ /** Higher values win. Omission defaults to zero; ties use registry insertion order. */
66
+ priority?: number;
67
+ }
68
+
69
+ export type TypesDetectionV2Response = { [type: string]: SupportedType };
61
70
 
62
71
  export type TypesResponse = { [type: string]: string[] };
@@ -0,0 +1,7 @@
1
+ import { TypesDetectionV2Response } from "../types/lookup";
2
+
3
+ export type TypeDetector = [type: string, regex: RegExp];
4
+ /** Compile in descending priority order, retaining registry order for ties. */
5
+ export declare const compileTypeDetectors: (definitions: TypesDetectionV2Response) => TypeDetector[];
6
+ /** Match without altering the input or retrying case-sensitive patterns in lowercase. */
7
+ export declare const detectType: (value: string, detectors: TypeDetector[]) => string | null;
@@ -0,0 +1,13 @@
1
+ const compileTypeDetectors = (definitions) => {
2
+ return Object.entries(definitions).sort(([, left], [, right]) => (right.priority ?? 0) - (left.priority ?? 0)).flatMap(
3
+ ([type, definition]) => definition.regex === null ? [] : [[type, new RegExp(definition.regex, definition.case_sensitive ? "" : "i")]]
4
+ );
5
+ };
6
+ const detectType = (value, detectors) => {
7
+ var _a;
8
+ return value ? ((_a = detectors.find(([, regex]) => regex.test(value))) == null ? void 0 : _a[0]) ?? null : null;
9
+ };
10
+ export {
11
+ compileTypeDetectors,
12
+ detectType
13
+ };