@cccsaurora/clue-ui 1.0.4 → 1.1.0-dev.100

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 (201) hide show
  1. package/ActionForm-ByeOzpc4.js +555 -0
  2. package/AnnotationDetails-DknbKDyl.js +175 -0
  3. package/AnnotationPreview-CQwKs8se.js +188 -0
  4. package/ClueEnrichContext-6NJfXpUB.js +536 -0
  5. package/FlexOne-BSYAhhtG.js +9 -0
  6. package/_Map-kgDsDYxq.js +64 -0
  7. package/_MapCache-DabaaWfq.js +161 -0
  8. package/_Uint8Array-BlVVH1tp.js +129 -0
  9. package/_baseAssignValue-CNbcU6Nb.js +25 -0
  10. package/_baseClone-D3a8Pa4T.js +284 -0
  11. package/_baseExtremum-B1o1zHjR.js +33 -0
  12. package/_baseFlatten-D4huXoEI.js +92 -0
  13. package/_baseGet-BSK_nnoz.js +109 -0
  14. package/_baseIsEqual-B5xLoweL.js +238 -0
  15. package/_baseIteratee-p6Nj07-n.js +126 -0
  16. package/_baseSlice-GAv_YFTT.js +20 -0
  17. package/_baseSum-D0WC1dN0.js +13 -0
  18. package/_baseUniq-CpupKWcL.js +89 -0
  19. package/_commonjsHelpers-DWwsNxpa.js +8 -0
  20. package/_createAggregator-BpVy5xMi.js +63 -0
  21. package/_getPrototype-D1LAdQKO.js +5 -0
  22. package/_getTag-D3ToyefI.js +126 -0
  23. package/api/lookup/index.d.ts +1 -1
  24. package/api/lookup/types.d.ts +2 -2
  25. package/api/lookup/types_detection.d.ts +2 -2
  26. package/cloneDeep-CjP5k9zW.js +8 -0
  27. package/components/AnnotationBody.js +49 -34
  28. package/components/AnnotationDetailPopover.js +36 -30
  29. package/components/AnnotationDetails.js +6 -6
  30. package/components/AnnotationEntry.js +50 -47
  31. package/components/AnnotationPreview.js +5 -5
  32. package/components/ClassificationChip.d.ts +2 -1
  33. package/components/ClassificationChip.js +44 -23
  34. package/components/CountBadge.js +31 -26
  35. package/components/EnrichedCard.js +110 -92
  36. package/components/EnrichedChip.js +130 -111
  37. package/components/EnrichedTypography.d.ts +1 -1
  38. package/components/EnrichedTypography.js +133 -112
  39. package/components/ErrorBoundary.js +28 -24
  40. package/components/RetryFailedEnrichments.js +10 -9
  41. package/components/SourcePicker.js +57 -49
  42. package/components/actions/ActionForm.js +4 -4
  43. package/components/actions/ExecutePopover.js +64 -50
  44. package/components/actions/ResultModal.js +12 -41
  45. package/components/actions/form/schemaAdapter.js +40 -20
  46. package/components/display/graph/ExpandMoreButton.js +10 -10
  47. package/components/display/graph/elements/NodeCard.js +114 -76
  48. package/components/display/graph/elements/NodeTag.js +15 -13
  49. package/components/display/graph/index.js +267 -210
  50. package/components/display/graph/visualizations/Leaf.js +88 -69
  51. package/components/display/graph/visualizations/cloud/index.js +98 -81
  52. package/components/display/graph/visualizations/icons/BaseIcon.js +26 -21
  53. package/components/display/graph/visualizations/icons/BugIcon.js +12 -12
  54. package/components/display/graph/visualizations/icons/HostIcon.js +12 -12
  55. package/components/display/graph/visualizations/icons/NetworkIcon.js +12 -12
  56. package/components/display/graph/visualizations/icons/ProcessIcon.js +12 -12
  57. package/components/display/graph/visualizations/icons/TargetIcon.js +13 -13
  58. package/components/display/graph/visualizations/icons/index.js +14 -13
  59. package/components/display/graph/visualizations/panels/NodePanel.js +10 -8
  60. package/components/display/graph/visualizations/tree/BundleLine.js +108 -81
  61. package/components/display/graph/visualizations/tree/Triangle.js +13 -13
  62. package/components/display/graph/visualizations/tree/index.js +407 -305
  63. package/components/display/icons/Iconified.js +27 -12
  64. package/components/display/json/index.js +4 -4
  65. package/components/display/markdown/index.js +8696 -5668
  66. package/components/enrichment/EnrichPopover.js +55 -47
  67. package/components/fetchers/Fetcher.js +123 -95
  68. package/components/fetchers/PreviewModal.js +20 -17
  69. package/components/fetchers/StatusChip.js +21 -18
  70. package/components/group/Entry.js +13 -11
  71. package/components/group/Group.js +13 -10
  72. package/components/group/GroupControl.js +78 -66
  73. package/components/stats/QueryStatus.js +44 -31
  74. package/countBy-C69WslUA.js +14 -0
  75. package/data/event.js +6 -4
  76. package/database/index.js +2 -2
  77. package/debounce-bV0h5FC5.js +92 -0
  78. package/en/translation.json +39 -59
  79. package/fr/translation.json +37 -56
  80. package/get-D3C3lEU3.js +8 -0
  81. package/groupBy-DC2oOuBN.js +14 -0
  82. package/hooks/ClueActionContext.d.ts +26 -0
  83. package/hooks/ClueActionContext.js +8 -7
  84. package/hooks/ClueComponentContext.js +29 -23
  85. package/hooks/ClueConfigProvider.js +14 -12
  86. package/hooks/ClueDatabaseContext.js +19 -13
  87. package/hooks/ClueEnrichContext.js +8 -8
  88. package/hooks/ClueEnrichProps.d.ts +3 -1
  89. package/hooks/ClueFetcherContext.js +74 -46
  90. package/hooks/ClueGroupContext.js +17 -14
  91. package/hooks/CluePopupContext.js +5 -5
  92. package/hooks/ClueProvider.js +12 -10
  93. package/hooks/selectors.d.ts +4 -5
  94. package/hooks/selectors.js +21 -11
  95. package/hooks/useActionResult.d.ts +14 -0
  96. package/hooks/useActionResult.js +5 -0
  97. package/hooks/useAnnotations.js +45 -29
  98. package/hooks/useClue.js +6 -4
  99. package/hooks/useClueActions.d.ts +1 -1
  100. package/hooks/useClueActions.js +3 -3
  101. package/hooks/useClueConfig.d.ts +2 -1
  102. package/hooks/useClueConfig.js +6 -6
  103. package/hooks/useClueTypeConfig.js +3 -3
  104. package/hooks/useComparator.js +722 -435
  105. package/hooks/useErrors.js +22 -18
  106. package/hooks/useMyHighlights.js +66 -36
  107. package/hooks/useMyLocalStorage.d.ts +4 -3
  108. package/hooks/useMyLocalStorage.js +66 -46
  109. package/iconify-CXMreGTg.js +1782 -0
  110. package/icons/Action.js +66 -49
  111. package/icons/Assessment.js +84 -68
  112. package/icons/Context.js +78 -61
  113. package/icons/Opinion.js +77 -65
  114. package/icons/iconMap.js +2 -2
  115. package/identity-CPGTqrE4.js +6 -0
  116. package/index-BDVjGvMI.js +696 -0
  117. package/index-BbPn6-Mw.js +15750 -0
  118. package/index-Bi21Wb23.js +465 -0
  119. package/index-C3lkTD69.js +1172 -0
  120. package/index-CC12Ux-9.js +17654 -0
  121. package/isEmpty-BQkZubqU.js +29 -0
  122. package/isNil-CIubwp4T.js +6 -0
  123. package/isObject-FTY-5JQX.js +7 -0
  124. package/isObjectLike-OAgjjZye.js +48 -0
  125. package/isSymbol-Xd2FsJyp.js +8 -0
  126. package/last-CUCl67Im.js +7 -0
  127. package/main.js +62 -62
  128. package/package.json +3 -3
  129. package/sortBy-B-UKp4GT.js +100 -0
  130. package/sumBy-MYkDPHZL.js +8 -0
  131. package/text/Frequency.js +42 -23
  132. package/toFinite-Bc55msYj.js +16 -0
  133. package/toNumber-DPxy1FBy.js +39 -0
  134. package/types/RunningActionData.d.ts +4 -3
  135. package/types/action.d.ts +10 -1
  136. package/useClueTypeConfig-XvGvIw2S.js +3201 -0
  137. package/utils/chain.js +91 -64
  138. package/utils/classificationParser.js +519 -256
  139. package/utils/constants.js +35 -10
  140. package/utils/graph.js +72 -45
  141. package/utils/hashUtil.js +7 -7
  142. package/utils/line.js +131 -81
  143. package/utils/loggerUtil.d.ts +1 -1
  144. package/utils/loggerUtil.js +6 -4
  145. package/utils/sessionStorage.js +41 -29
  146. package/utils/time.d.ts +3 -0
  147. package/utils/time.js +536 -0
  148. package/utils/utils.js +10 -9
  149. package/utils/window.js +21 -10
  150. package/utils-7OtvGnmf.js +200 -0
  151. package/ActionForm-Sw7D-KOE.js +0 -340
  152. package/AnnotationDetails-BoX61_IF.js +0 -160
  153. package/AnnotationPreview-dYinoSA9.js +0 -140
  154. package/ClueEnrichContext-CvCIPOMC.js +0 -412
  155. package/FlexOne-BXWFOd1T.js +0 -6
  156. package/_Map-DXNg_Z-q.js +0 -54
  157. package/_MapCache-Cu25RRDU.js +0 -129
  158. package/_Uint8Array-DlJCtTvG.js +0 -102
  159. package/_baseAssignValue-CUmzp727.js +0 -20
  160. package/_baseClone-BlMmRXeX.js +0 -208
  161. package/_baseExtremum-P_0akmCi.js +0 -27
  162. package/_baseFlatten-CN7vDNEQ.js +0 -72
  163. package/_baseGet-Dgf6_xCm.js +0 -80
  164. package/_baseIsEqual-Cpjtfb3Q.js +0 -173
  165. package/_baseIteratee-CP1bocOX.js +0 -95
  166. package/_baseSlice-M5RKzt1A.js +0 -10
  167. package/_baseSum-wEbgNeUs.js +0 -10
  168. package/_baseUniq-tMFmk80M.js +0 -61
  169. package/_commonjsHelpers-C6fGbg64.js +0 -6
  170. package/_createAggregator-B4Cav8ZM.js +0 -53
  171. package/_getPrototype-CHAFQYL_.js +0 -5
  172. package/_getTag-BV_UoLYG.js +0 -90
  173. package/cloneDeep-BPVpFBzJ.js +0 -8
  174. package/components/display/markdown/DynamicTabs.d.ts +0 -8
  175. package/components/display/markdown/DynamicTabs.js +0 -21
  176. package/components/display/markdown/markdownPlugins/tabs.d.ts +0 -3
  177. package/components/display/markdown/markdownPlugins/tabs.js +0 -4
  178. package/countBy-DOutsa_w.js +0 -8
  179. package/debounce-DryYcbJ4.js +0 -56
  180. package/get-Bow1vKwx.js +0 -8
  181. package/groupBy-BheQYl6f.js +0 -8
  182. package/iconify-BBckr5AQ.js +0 -1263
  183. package/identity-ByMq8VxU.js +0 -6
  184. package/index-CnaCBNrd.js +0 -358
  185. package/index-E7g8cRyW.js +0 -568
  186. package/index-V7wwd05F.js +0 -975
  187. package/index-p5_wX7q1.js +0 -11729
  188. package/index-pQg5VUAZ.js +0 -12734
  189. package/isEmpty-g47Qir2A.js +0 -21
  190. package/isNil-CjWwlQS3.js +0 -6
  191. package/isObject-B53jY8Qg.js +0 -7
  192. package/isObjectLike-BatpeCIi.js +0 -29
  193. package/isSymbol-C3_SC0Qp.js +0 -8
  194. package/last-7CdUxN0r.js +0 -7
  195. package/sortBy-ITdmD17L.js +0 -79
  196. package/sumBy-DxJUU2E8.js +0 -8
  197. package/tabs-CgADNA57.js +0 -195
  198. package/toFinite-BMy6GObD.js +0 -14
  199. package/toNumber-YVhnnJv4.js +0 -31
  200. package/useClueTypeConfig-CneP98N_.js +0 -2260
  201. package/utils-CD0rFIFU.js +0 -2704
@@ -1,80 +1,65 @@
1
1
  {
2
+ "action.available": "Actions disponibles",
3
+ "action.data": "Données d'Action",
2
4
  "actions.execute": "Execute",
3
5
  "actions.executing": "Executing",
4
6
  "actions.json.hide": "Masquer JSON",
5
7
  "actions.json.show": "Afficher JSON",
6
- "action.data": "Données d'Action",
7
- "action.available": "Actions disponibles",
8
-
8
+ "adminmenu": "Menu d'administration",
9
9
  "adminmenu.config": "Configuration",
10
10
  "adminmenu.users": "Usagers",
11
- "adminmenu": "Menu d'administration",
12
-
13
- "annotation.failed": "Échoué",
14
-
15
11
  "all": "Tout",
16
-
12
+ "annotation.failed": "Échoué",
17
13
  "app.language": "Langage",
18
14
  "app.list.empty": "Aucun résultat",
19
15
  "app.search.fullscreen": "Activer la recherche plein écran",
20
16
  "app.search.shortcut": "Effectuer une recherche",
21
17
  "app.search.starttyping": "Commencez à taper et/ou appuyez sur ENTRER",
22
-
23
18
  "breadcrumb.404": "404",
24
-
25
19
  "cancel": "Cancel",
26
20
  "classification": "Classification",
27
- "close": "Fermer",
28
-
29
21
  "clipboard": "Copier la valeur dans le presse-papiers",
30
22
  "clipboard.failure": "n'a pas pu être copié dans le presse-papiers.",
31
23
  "clipboard.success": "a été copié dans le presse-papiers.",
32
-
24
+ "close": "Fermer",
33
25
  "details.open": "Ouvrir les détails",
34
-
35
26
  "drawer.chat": "Clavardage",
36
27
  "drawer.collapse": "Fermer le Menu",
37
28
  "drawer.dashboard": "Tableau de bord",
38
29
  "drawer.expand": "Ouvrir le Menu",
39
30
  "drawer.help": "Aide",
40
31
  "drawer.home": "Acceuil",
32
+ "drawer.items": "Items",
41
33
  "drawer.items.create": "Créé",
42
34
  "drawer.items.edit": "Modifier",
43
35
  "drawer.items.list": "Liste",
44
- "drawer.items": "Items",
45
- "drawer.mail.inbox.message": "Message",
36
+ "drawer.mail": "Courriel",
46
37
  "drawer.mail.inbox": "Boîte de réception",
38
+ "drawer.mail.inbox.message": "Message",
47
39
  "drawer.mail.sent": "Expédié",
48
40
  "drawer.mail.trash": "Poubelle",
49
- "drawer.mail": "Courriel",
50
-
51
41
  "enrich": "Enrichir",
52
-
53
42
  "error": "Erreur",
54
-
55
- "retry.enrich": "Réessayer les enrichissements qui ont échoué",
56
-
43
+ "graph.no.dataset": "Aucun jeu de données n'a été sélectionné!",
44
+ "graph.node.input.label": "Entrez un ID de nœud et appuyez sur [ctrl + entrée] pour le sélectionner. [ctrl + espace] ouvrira un menu d'auto-complétion.",
45
+ "graph.show.more": "Afficher plus",
46
+ "graph.visualization": "Visualisation",
57
47
  "json.viewer.search.label": "Recherche JSON",
58
-
59
48
  "notification.title": "Notifications",
60
-
61
49
  "page.404.description": "La page que vous recherchez est introuvable ...",
62
50
  "page.404.title": "404: Introuvable",
63
-
64
51
  "page.dashboard.title": "Tableau de bord",
65
-
66
- "page.home.title": "Accueil",
67
52
  "page.home.cache": "Sauter le cache du plugin",
68
53
  "page.home.classification": "Classification",
69
54
  "page.home.includeraw": "Inclure les données brutes",
70
55
  "page.home.timeout": "Personnaliser le délai d'attente",
56
+ "page.home.title": "Accueil",
71
57
  "page.home.types": "Types supportés (un par ligne)",
72
-
73
58
  "page.login.button": "Se connecter",
74
59
  "page.login.password": "Mot de passe",
75
60
  "page.login.username": "Nom d'utilisateur",
76
61
  "page.logout": "Déconnexion de l'utilisateur actuel ... ",
77
-
62
+ "personalization": "Personnalisation",
78
63
  "personalization.autohideappbar": "Masquer la barre supérieure",
79
64
  "personalization.dark": "Mode Sombre",
80
65
  "personalization.minimizebreadcrumbs": "Minimiser fils d'ariane",
@@ -82,53 +67,49 @@
82
67
  "personalization.reset_text": "Réinitialiser les paramètres",
83
68
  "personalization.showbreadcrumbs": "Afficher fils d'ariane",
84
69
  "personalization.sticky": "Barre supérieure collante",
85
- "personalization": "Personnalisation",
86
-
70
+ "query.status.complete": "Terminé",
71
+ "query.status.inprogress": "En cours",
72
+ "query.status.pending": "En attente",
87
73
  "quicksearch.aria": "recherche",
88
74
  "quicksearch.placeholder": "Recherche ...",
89
-
90
75
  "refresh": "Rafraîchir",
91
-
76
+ "retry.enrich": "Réessayer les enrichissements qui ont échoué",
77
+ "route.actions": "Actions",
78
+ "route.actions.action": "Sélectionner une action",
79
+ "route.actions.description": "Exécutez des actions prédéfinies sur les sélecteurs en utilisant le formulaire ci-dessous.",
80
+ "route.actions.submit": "Exécuter l'action",
81
+ "route.actions.type": "Type de sélecteur",
82
+ "route.actions.value": "Valeur du sélecteur",
92
83
  "route.examples": "Exemples de composants",
93
-
94
- "route.help.contributing": "Contribuer",
95
- "route.help.dashboard": "Tableau de bord du plugin",
96
- "route.plugin": "Plugin",
97
- "route.plugin.active": "Actif",
98
- "route.help": "Aide",
99
- "route.help.loading": "Chargement de la documentation",
100
- "route.help.error": "Une erreur s'est produite lors du chargement de la documentation",
101
-
102
84
  "route.fetchers": "Fetchers",
85
+ "route.fetchers.available": "Fetchers disponibles",
86
+ "route.fetchers.description": "Ajoutez un nouveau moteur de recherche à rendre en utilisant le formulaire ci-dessus.",
103
87
  "route.fetchers.fetcher": "Sélectionner un sélecteur",
88
+ "route.fetchers.submit": "Ajouter un fetcher",
89
+ "route.fetchers.title": "Pas d'extrait",
104
90
  "route.fetchers.type": "Type de sélecteur",
105
91
  "route.fetchers.value": "Valeur du sélecteur",
106
- "route.fetchers.title": "Pas d'extrait",
107
- "route.fetchers.description": "Ajoutez un nouveau moteur de recherche à rendre en utilisant le formulaire ci-dessus.",
108
- "route.fetchers.submit": "Ajouter un fetcher",
109
- "route.fetchers.available": "Fetchers disponibles",
110
-
92
+ "route.help": "Aide",
93
+ "route.help.contributing": "Contribuer",
94
+ "route.help.dashboard": "Tableau de bord du plugin",
95
+ "route.help.error": "Une erreur s'est produite lors du chargement de la documentation",
96
+ "route.help.loading": "Chargement de la documentation",
111
97
  "route.home": "Enrichir les données",
112
-
113
98
  "route.login.button.oauth.azure": "Azure",
114
99
  "route.login.button.oauth.keycloak": "Keycloak",
115
-
100
+ "route.plugin": "Plugin",
101
+ "route.plugin.active": "Actif",
102
+ "selected": "sélectionné(s)",
116
103
  "sources": "Sources",
117
104
  "sources.select.all": "Sélectionner toutes les sources",
118
105
  "sources.select.none": "Désélectionner toutes les sources",
119
-
120
106
  "summary.unfound": "Résumé introuvable",
121
-
122
107
  "tooltip.breadcrumbs.max": "Maximiser fils d'ariane",
123
108
  "tooltip.breadcrumbs.min": "Minimiser fils d'ariane",
124
-
125
109
  "type": "Type",
126
-
127
110
  "unknown": "Inconnu",
128
-
129
- "usermenu.logout": "Se déconnecter",
130
111
  "usermenu": "Menu d'utilisateur",
112
+ "usermenu.logout": "Se déconnecter",
131
113
  "usermenu.settings": "Paramètres",
132
-
133
114
  "value": "Valeur"
134
115
  }
@@ -0,0 +1,8 @@
1
+ import { b as baseGet } from "./_baseGet-BSK_nnoz.js";
2
+ function get(object, path, defaultValue) {
3
+ var result = object == null ? void 0 : baseGet(object, path);
4
+ return result === void 0 ? defaultValue : result;
5
+ }
6
+ export {
7
+ get as g
8
+ };
@@ -0,0 +1,14 @@
1
+ import { b as baseAssignValue } from "./_baseAssignValue-CNbcU6Nb.js";
2
+ import { c as createAggregator } from "./_createAggregator-BpVy5xMi.js";
3
+ var objectProto = Object.prototype;
4
+ var hasOwnProperty = objectProto.hasOwnProperty;
5
+ var groupBy = createAggregator(function(result, value, key) {
6
+ if (hasOwnProperty.call(result, key)) {
7
+ result[key].push(value);
8
+ } else {
9
+ baseAssignValue(result, key, [value]);
10
+ }
11
+ });
12
+ export {
13
+ groupBy as g
14
+ };
@@ -33,6 +33,10 @@ export interface ClueActionContextType {
33
33
  * Should the function raise an exception instead of showing the menu if the form is not completed?
34
34
  */
35
35
  skipMenu?: boolean;
36
+ /**
37
+ * Should the result modal be shown?
38
+ */
39
+ skipResultModal?: boolean;
36
40
  /**
37
41
  * Callback for post-execution.
38
42
  * @param result
@@ -43,6 +47,18 @@ export interface ClueActionContextType {
43
47
  * how long should the action have to respond?
44
48
  */
45
49
  timeout?: number;
50
+ /**
51
+ * Should contextual information about the source of the action be included?
52
+ *
53
+ * This information includes:
54
+ * - Exact execution time
55
+ * - Current URL on execution
56
+ */
57
+ includeContext?: boolean;
58
+ /**
59
+ * Additional context information to include on execution. Useful for tight connections between actions and the UI.
60
+ */
61
+ extraContext?: Record<string, any>;
46
62
  }) => Promise<void>;
47
63
  /**
48
64
  * Cancel an action pending user input.
@@ -56,6 +72,12 @@ export interface ClueActionContextType {
56
72
  * @returns the list of results for a given selector
57
73
  */
58
74
  getActionResults: (type: string, value: string, classification?: string) => WithActionData<ActionResult>[];
75
+ /**
76
+ * Get the status of an ongoing action
77
+ * @param actionId The ID of the action to get the status of
78
+ * @param taskId The task id to get the status of
79
+ */
80
+ getActionStatus: (actionId: string, taskId: string) => Promise<WithActionData<ActionResult>>;
59
81
  /**
60
82
  * Is there currently an action executing?
61
83
  */
@@ -71,6 +93,10 @@ export interface ClueActionProps {
71
93
  * What should the default classification be when executing actions?
72
94
  */
73
95
  classification?: string;
96
+ /**
97
+ * Should basic context information (execution time, current url) be included when executing an action?
98
+ */
99
+ includeContext?: boolean;
74
100
  /**
75
101
  * Get an access token for the clue API.
76
102
  *
@@ -1,18 +1,19 @@
1
1
  import "react/jsx-runtime";
2
2
  import "@mui/material";
3
- import "../index-pQg5VUAZ.js";
4
- import "../useClueTypeConfig-CneP98N_.js";
5
- import { a as A, C as d } from "../ActionForm-Sw7D-KOE.js";
6
- import "../components/actions/ResultModal.js";
3
+ import "../index-CC12Ux-9.js";
4
+ import "../useClueTypeConfig-XvGvIw2S.js";
5
+ import { a, C } from "../ActionForm-ByeOzpc4.js";
7
6
  import "../components/display/icons/Iconified.js";
8
7
  import "../components/ErrorBoundary.js";
9
8
  import "../data/event.js";
9
+ import "../utils/time.js";
10
10
  import "../utils/window.js";
11
11
  import "react";
12
- import "../index-E7g8cRyW.js";
12
+ import "../index-BDVjGvMI.js";
13
13
  import "./ClueComponentContext.js";
14
14
  import "./useClue.js";
15
+ import "../isNil-CIubwp4T.js";
15
16
  export {
16
- A as ClueActionContext,
17
- d as ClueActionProvider
17
+ a as ClueActionContext,
18
+ C as ClueActionProvider
18
19
  };
@@ -1,34 +1,40 @@
1
- import { jsx as n } from "react/jsx-runtime";
2
- import { useMemo as m } from "react";
3
- import { useTranslation as l } from "react-i18next";
4
- import { c as i } from "../index-E7g8cRyW.js";
5
- const u = i(null), p = ({
6
- children: t,
7
- ReactJson: o
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { useMemo } from "react";
3
+ import { useTranslation } from "react-i18next";
4
+ import { c as createContext } from "../index-BDVjGvMI.js";
5
+ const ClueComponentContext = createContext(null);
6
+ const ClueComponentI18nProvider = ({
7
+ children,
8
+ ReactJson
8
9
  }) => {
9
- const r = l(), e = m(
10
+ const i18next = useTranslation();
11
+ const context = useMemo(
10
12
  () => ({
11
- ReactJson: o,
12
- i18next: r
13
+ ReactJson,
14
+ i18next
13
15
  }),
14
- [o, r]
16
+ [ReactJson, i18next]
15
17
  );
16
- return /* @__PURE__ */ n(u.Provider, { value: e, children: t });
17
- }, f = ({
18
- children: t,
19
- ReactJson: o,
20
- i18next: r = null
18
+ return /* @__PURE__ */ jsx(ClueComponentContext.Provider, { value: context, children });
19
+ };
20
+ const ClueComponentProvider = ({
21
+ children,
22
+ ReactJson,
23
+ i18next = null
21
24
  }) => {
22
- const e = m(
25
+ const context = useMemo(
23
26
  () => ({
24
- ReactJson: o,
25
- i18next: r
27
+ ReactJson,
28
+ i18next
26
29
  }),
27
- [o, r]
30
+ [ReactJson, i18next]
28
31
  );
29
- return r ? /* @__PURE__ */ n(u.Provider, { value: e, children: t }) : /* @__PURE__ */ n(p, { ReactJson: o, children: t });
32
+ if (!i18next) {
33
+ return /* @__PURE__ */ jsx(ClueComponentI18nProvider, { ReactJson, children });
34
+ }
35
+ return /* @__PURE__ */ jsx(ClueComponentContext.Provider, { value: context, children });
30
36
  };
31
37
  export {
32
- u as ClueComponentContext,
33
- f as ClueComponentProvider
38
+ ClueComponentContext,
39
+ ClueComponentProvider
34
40
  };
@@ -1,21 +1,23 @@
1
- import { jsx as i } from "react/jsx-runtime";
2
- import { createContext as c, useState as u, useMemo as f } from "react";
3
- const l = c(null), g = ({ children: t, config: e }) => {
4
- const [o, n] = u(
5
- e ?? {
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { createContext, useState, useMemo } from "react";
3
+ const ClueConfigContext = createContext(null);
4
+ const ClueConfigProvider = ({ children, config: _config }) => {
5
+ const [config, setConfig] = useState(
6
+ _config ?? {
6
7
  configuration: null,
7
8
  c12nDef: null
8
9
  }
9
- ), r = f(
10
+ );
11
+ const context = useMemo(
10
12
  () => ({
11
- config: o,
12
- setConfig: n
13
+ config,
14
+ setConfig
13
15
  }),
14
- [o, n]
16
+ [config, setConfig]
15
17
  );
16
- return /* @__PURE__ */ i(l.Provider, { value: r, children: t });
18
+ return /* @__PURE__ */ jsx(ClueConfigContext.Provider, { value: context, children });
17
19
  };
18
20
  export {
19
- l as ClueConfigContext,
20
- g as ClueConfigProvider
21
+ ClueConfigContext,
22
+ ClueConfigProvider
21
23
  };
@@ -1,17 +1,23 @@
1
- import { jsx as s } from "react/jsx-runtime";
2
- import { b as u } from "../index-pQg5VUAZ.js";
3
- import { createContext as l, useState as n, useEffect as i } from "react";
4
- const m = l(null), p = ({
5
- children: a,
6
- database: e,
7
- databaseConfig: t
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { b as buildDatabase } from "../index-CC12Ux-9.js";
3
+ import { createContext, useState, useEffect } from "react";
4
+ const ClueDatabaseContext = createContext(null);
5
+ const ClueDatabaseProvider = ({
6
+ children,
7
+ database: _database,
8
+ databaseConfig
8
9
  }) => {
9
- const [o, r] = n();
10
- return i(() => {
11
- e ? r(e) : u(t).then(r);
12
- }, [e, t]), /* @__PURE__ */ s(m.Provider, { value: o, children: a });
10
+ const [database, setDatabase] = useState();
11
+ useEffect(() => {
12
+ if (_database) {
13
+ setDatabase(_database);
14
+ } else {
15
+ buildDatabase(databaseConfig).then(setDatabase);
16
+ }
17
+ }, [_database, databaseConfig]);
18
+ return /* @__PURE__ */ jsx(ClueDatabaseContext.Provider, { value: database, children });
13
19
  };
14
20
  export {
15
- m as ClueDatabaseContext,
16
- p as ClueDatabaseProvider
21
+ ClueDatabaseContext,
22
+ ClueDatabaseProvider
17
23
  };
@@ -1,15 +1,15 @@
1
1
  import "react/jsx-runtime";
2
- import "../iconify-BBckr5AQ.js";
3
- import "../useClueTypeConfig-CneP98N_.js";
2
+ import "../iconify-CXMreGTg.js";
3
+ import "../useClueTypeConfig-XvGvIw2S.js";
4
4
  import "../utils/loggerUtil.js";
5
- import { C as l, a as s } from "../ClueEnrichContext-CvCIPOMC.js";
6
- import "../debounce-DryYcbJ4.js";
7
- import "../groupBy-BheQYl6f.js";
5
+ import { C, a } from "../ClueEnrichContext-6NJfXpUB.js";
6
+ import "../debounce-bV0h5FC5.js";
7
+ import "../groupBy-DC2oOuBN.js";
8
8
  import "react";
9
- import "../index-E7g8cRyW.js";
9
+ import "../index-BDVjGvMI.js";
10
10
  import "./ClueDatabaseContext.js";
11
11
  import "./useClueConfig.js";
12
12
  export {
13
- l as ClueEnrichContext,
14
- s as ClueEnrichProvider
13
+ C as ClueEnrichContext,
14
+ a as ClueEnrichProvider
15
15
  };
@@ -52,12 +52,14 @@ export interface ClueEnrichProps {
52
52
 
53
53
  /**
54
54
  * Add modify the Axios request configuration before the request is sent
55
+ *
55
56
  * @param config The existing axios request config
56
57
  */
57
58
  onNetworkCall?: (config: AxiosRequestConfig) => AxiosRequestConfig;
58
59
 
59
60
  /**
60
- * Modify the list of sources enrichments are requested from before the
61
+ * Modify the list of sources enrichments are requested from before enrichment is requested
62
+ *
61
63
  * @param configuredSources The list of sources configured globally to execute
62
64
  * @param availableSources The full list of available sources in clue
63
65
  * @param selectors The list of selectors about to be enriched
@@ -1,60 +1,88 @@
1
- import { jsx as $ } from "react/jsx-runtime";
2
- import { a as R } from "../useClueTypeConfig-CneP98N_.js";
3
- import { useState as m, useRef as j, useCallback as F, useEffect as d, useMemo as H } from "react";
4
- import { c as J } from "../index-E7g8cRyW.js";
5
- import K from "./useClue.js";
6
- import M from "./useClueConfig.js";
7
- const O = J(null), W = ({
8
- baseURL: f,
9
- children: q,
10
- classification: v,
11
- getToken: s,
12
- onNetworkCall: c
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { a as api } from "../useClueTypeConfig-XvGvIw2S.js";
3
+ import { useState, useRef, useCallback, useEffect, useMemo } from "react";
4
+ import { c as createContext } from "../index-BDVjGvMI.js";
5
+ import useClue from "./useClue.js";
6
+ import useClueConfig from "./useClueConfig.js";
7
+ const ClueFetcherContext = createContext(null);
8
+ const ClueFetcherProvider = ({
9
+ baseURL,
10
+ children,
11
+ classification: _defaultClassification,
12
+ getToken,
13
+ onNetworkCall
13
14
  }) => {
14
- var E, y;
15
- const a = M(), { ready: C } = K(), [o, z] = m(v), [h, A] = m(!1), [p, B] = m({}), i = j({}), u = F(
16
- ({ type: t, value: e, classification: r }) => JSON.stringify({ type: t, value: e, classification: r ?? o }),
17
- [o]
18
- ), D = F(
19
- async (t, e) => {
20
- var r;
21
- if ((r = i.current[t]) != null && r[u(e)])
22
- return i.current[t][u(e)];
15
+ var _a, _b;
16
+ const clueConfig = useClueConfig();
17
+ const { ready } = useClue();
18
+ const [defaultClassification, setDefaultClasification] = useState(_defaultClassification);
19
+ const [fetchCompleted, setFetchCompleted] = useState(false);
20
+ const [fetchers, setFetchers] = useState({});
21
+ const fetchRequests = useRef({});
22
+ const getHashKey = useCallback(
23
+ ({ type, value, classification }) => JSON.stringify({ type, value, classification: classification ?? defaultClassification }),
24
+ [defaultClassification]
25
+ );
26
+ const fetchSelector = useCallback(
27
+ async (fetcherId, selector) => {
28
+ var _a2;
29
+ if ((_a2 = fetchRequests.current[fetcherId]) == null ? void 0 : _a2[getHashKey(selector)]) {
30
+ return fetchRequests.current[fetcherId][getHashKey(selector)];
31
+ }
23
32
  try {
24
- const n = {}, S = s == null ? void 0 : s();
25
- S && (n.Authorization = `Bearer ${S}`);
26
- let l = { baseURL: f, headers: n };
27
- c && (l = c(l));
28
- const x = R.fetchers.post(t, e, l);
29
- return i.current[t] || (i.current[t] = {}), i.current[t][u(e)] = x, await x;
33
+ const headers = {};
34
+ const token = getToken == null ? void 0 : getToken();
35
+ if (token) {
36
+ headers.Authorization = `Bearer ${token}`;
37
+ }
38
+ let requestConfig = { baseURL, headers };
39
+ if (onNetworkCall) {
40
+ requestConfig = onNetworkCall(requestConfig);
41
+ }
42
+ const result = api.fetchers.post(fetcherId, selector, requestConfig);
43
+ if (!fetchRequests.current[fetcherId]) {
44
+ fetchRequests.current[fetcherId] = {};
45
+ }
46
+ fetchRequests.current[fetcherId][getHashKey(selector)] = result;
47
+ return await result;
30
48
  } catch {
31
49
  return null;
32
50
  }
33
51
  },
34
- [f, u, s, c]
52
+ [baseURL, getHashKey, getToken, onNetworkCall]
35
53
  );
36
- d(() => {
37
- var t, e, r, n;
38
- !o && ((e = (t = a.config) == null ? void 0 : t.c12nDef) != null && e.UNRESTRICTED) && z((n = (r = a.config) == null ? void 0 : r.c12nDef) == null ? void 0 : n.UNRESTRICTED);
39
- }, [(y = (E = a.config) == null ? void 0 : E.c12nDef) == null ? void 0 : y.UNRESTRICTED, o]), d(() => {
40
- if (!C)
54
+ useEffect(() => {
55
+ var _a2, _b2, _c, _d;
56
+ if (!defaultClassification && ((_b2 = (_a2 = clueConfig.config) == null ? void 0 : _a2.c12nDef) == null ? void 0 : _b2.UNRESTRICTED)) {
57
+ setDefaultClasification((_d = (_c = clueConfig.config) == null ? void 0 : _c.c12nDef) == null ? void 0 : _d.UNRESTRICTED);
58
+ }
59
+ }, [(_b = (_a = clueConfig.config) == null ? void 0 : _a.c12nDef) == null ? void 0 : _b.UNRESTRICTED, defaultClassification]);
60
+ useEffect(() => {
61
+ if (!ready) {
41
62
  return;
42
- const t = {}, e = s == null ? void 0 : s();
43
- e && (t.Authorization = `Bearer ${e}`);
44
- let r = { baseURL: f, headers: t };
45
- c && (r = c(r)), R.fetchers.get(r).then(B).finally(() => A(!0));
46
- }, [f, C]);
47
- const P = H(
63
+ }
64
+ const headers = {};
65
+ const token = getToken == null ? void 0 : getToken();
66
+ if (token) {
67
+ headers.Authorization = `Bearer ${token}`;
68
+ }
69
+ let requestConfig = { baseURL, headers };
70
+ if (onNetworkCall) {
71
+ requestConfig = onNetworkCall(requestConfig);
72
+ }
73
+ api.fetchers.get(requestConfig).then(setFetchers).finally(() => setFetchCompleted(true));
74
+ }, [baseURL, ready]);
75
+ const context = useMemo(
48
76
  () => ({
49
- fetchSelector: D,
50
- fetchers: p,
51
- fetchCompleted: h
77
+ fetchSelector,
78
+ fetchers,
79
+ fetchCompleted
52
80
  }),
53
- [h, D, p]
81
+ [fetchCompleted, fetchSelector, fetchers]
54
82
  );
55
- return /* @__PURE__ */ $(O.Provider, { value: P, children: q });
83
+ return /* @__PURE__ */ jsx(ClueFetcherContext.Provider, { value: context, children });
56
84
  };
57
85
  export {
58
- O as ClueFetcherContext,
59
- W as ClueFetcherProvider
86
+ ClueFetcherContext,
87
+ ClueFetcherProvider
60
88
  };
@@ -1,20 +1,23 @@
1
- import { jsx as n } from "react/jsx-runtime";
2
- import { useState as a, useMemo as c } from "react";
3
- import { c as m } from "../index-E7g8cRyW.js";
4
- import { useClueEnrichSelector as f } from "./selectors.js";
5
- const C = m(null), G = ({ children: s, type: o, classification: t }) => {
6
- const e = f((l) => l.defaultClassification), [r, u] = a([]), i = c(
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { useState, useMemo } from "react";
3
+ import { c as createContext } from "../index-BDVjGvMI.js";
4
+ import { useClueEnrichSelector } from "./selectors.js";
5
+ const ClueGroupContext = createContext(null);
6
+ const ClueGroupProvider = ({ children, type, classification }) => {
7
+ const defaultClassification = useClueEnrichSelector((ctx) => ctx.defaultClassification);
8
+ const [values, setValues] = useState([]);
9
+ const context = useMemo(
7
10
  () => ({
8
- type: o,
9
- values: r,
10
- setValues: u,
11
- classification: t ?? e
11
+ type,
12
+ values,
13
+ setValues,
14
+ classification: classification ?? defaultClassification
12
15
  }),
13
- [t, e, o, r]
16
+ [classification, defaultClassification, type, values]
14
17
  );
15
- return /* @__PURE__ */ n(C.Provider, { value: i, children: s });
18
+ return /* @__PURE__ */ jsx(ClueGroupContext.Provider, { value: context, children });
16
19
  };
17
20
  export {
18
- C as ClueGroupContext,
19
- G as ClueGroupProvider
21
+ ClueGroupContext,
22
+ ClueGroupProvider
20
23
  };
@@ -1,12 +1,12 @@
1
1
  import "react/jsx-runtime";
2
2
  import "../components/AnnotationDetailPopover.js";
3
- import { C as a, a as P } from "../AnnotationPreview-dYinoSA9.js";
3
+ import { C, a } from "../AnnotationPreview-CQwKs8se.js";
4
4
  import "../data/event.js";
5
5
  import "../utils/window.js";
6
- import "../AnnotationDetails-BoX61_IF.js";
6
+ import "../AnnotationDetails-DknbKDyl.js";
7
7
  import "react";
8
- import "../index-E7g8cRyW.js";
8
+ import "../index-BDVjGvMI.js";
9
9
  export {
10
- a as CluePopupContext,
11
- P as CluePopupProvider
10
+ C as CluePopupContext,
11
+ a as CluePopupProvider
12
12
  };