@cccsaurora/clue-ui 1.1.3 → 1.2.0-dev.106

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 (178) 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/cloneDeep-CjP5k9zW.js +8 -0
  24. package/components/AnnotationBody.js +49 -35
  25. package/components/AnnotationDetailPopover.js +36 -30
  26. package/components/AnnotationDetails.js +6 -6
  27. package/components/AnnotationEntry.js +50 -47
  28. package/components/AnnotationPreview.js +5 -5
  29. package/components/ClassificationChip.js +44 -23
  30. package/components/CountBadge.js +31 -26
  31. package/components/EnrichedCard.js +110 -97
  32. package/components/EnrichedChip.js +130 -105
  33. package/components/EnrichedTypography.js +133 -107
  34. package/components/ErrorBoundary.js +28 -24
  35. package/components/RetryFailedEnrichments.js +10 -9
  36. package/components/SourcePicker.js +57 -49
  37. package/components/actions/ActionForm.js +4 -4
  38. package/components/actions/ExecutePopover.js +64 -50
  39. package/components/actions/ResultModal.js +5 -5
  40. package/components/actions/form/schemaAdapter.js +39 -23
  41. package/components/display/graph/ExpandMoreButton.js +10 -10
  42. package/components/display/graph/elements/NodeCard.js +111 -91
  43. package/components/display/graph/elements/NodeTag.js +15 -13
  44. package/components/display/graph/index.js +261 -202
  45. package/components/display/graph/visualizations/Leaf.js +88 -69
  46. package/components/display/graph/visualizations/cloud/index.js +98 -81
  47. package/components/display/graph/visualizations/icons/BaseIcon.js +26 -21
  48. package/components/display/graph/visualizations/icons/BugIcon.js +12 -12
  49. package/components/display/graph/visualizations/icons/HostIcon.js +12 -12
  50. package/components/display/graph/visualizations/icons/NetworkIcon.js +12 -12
  51. package/components/display/graph/visualizations/icons/ProcessIcon.js +12 -12
  52. package/components/display/graph/visualizations/icons/TargetIcon.js +13 -13
  53. package/components/display/graph/visualizations/icons/index.js +14 -13
  54. package/components/display/graph/visualizations/panels/NodePanel.js +10 -8
  55. package/components/display/graph/visualizations/tree/BundleLine.js +108 -81
  56. package/components/display/graph/visualizations/tree/Triangle.js +13 -13
  57. package/components/display/graph/visualizations/tree/index.js +407 -305
  58. package/components/display/icons/Iconified.js +27 -12
  59. package/components/display/json/index.js +4 -4
  60. package/components/display/markdown/index.js +8658 -5757
  61. package/components/enrichment/EnrichPopover.js +55 -47
  62. package/components/fetchers/Fetcher.js +123 -95
  63. package/components/fetchers/PreviewModal.js +20 -17
  64. package/components/fetchers/StatusChip.js +21 -17
  65. package/components/group/Entry.js +13 -11
  66. package/components/group/Group.js +13 -10
  67. package/components/group/GroupControl.js +77 -66
  68. package/components/stats/QueryStatus.js +40 -35
  69. package/countBy-C69WslUA.js +14 -0
  70. package/data/event.js +6 -4
  71. package/database/index.js +2 -2
  72. package/debounce-bV0h5FC5.js +92 -0
  73. package/get-D3C3lEU3.js +8 -0
  74. package/groupBy-DC2oOuBN.js +14 -0
  75. package/hooks/ClueActionContext.js +7 -7
  76. package/hooks/ClueComponentContext.js +29 -23
  77. package/hooks/ClueConfigProvider.js +14 -12
  78. package/hooks/ClueDatabaseContext.js +19 -13
  79. package/hooks/ClueEnrichContext.js +8 -8
  80. package/hooks/ClueFetcherContext.js +74 -46
  81. package/hooks/ClueGroupContext.js +17 -14
  82. package/hooks/CluePopupContext.js +5 -5
  83. package/hooks/ClueProvider.js +12 -10
  84. package/hooks/selectors.js +21 -10
  85. package/hooks/useActionResult.js +2 -2
  86. package/hooks/useAnnotations.js +44 -32
  87. package/hooks/useClue.js +6 -4
  88. package/hooks/useClueActions.js +3 -3
  89. package/hooks/useClueConfig.js +6 -4
  90. package/hooks/useClueTypeConfig.js +3 -3
  91. package/hooks/useComparator.js +722 -435
  92. package/hooks/useErrors.js +22 -18
  93. package/hooks/useMyHighlights.js +66 -36
  94. package/hooks/useMyLocalStorage.js +66 -37
  95. package/iconify-CXMreGTg.js +1782 -0
  96. package/icons/Action.js +66 -49
  97. package/icons/Assessment.js +84 -68
  98. package/icons/Context.js +77 -63
  99. package/icons/Opinion.js +77 -65
  100. package/icons/iconMap.js +2 -2
  101. package/identity-CPGTqrE4.js +6 -0
  102. package/index-BDVjGvMI.js +696 -0
  103. package/index-BbPn6-Mw.js +15750 -0
  104. package/index-Bi21Wb23.js +465 -0
  105. package/index-C3lkTD69.js +1172 -0
  106. package/index-CC12Ux-9.js +17654 -0
  107. package/isEmpty-BQkZubqU.js +29 -0
  108. package/isNil-CIubwp4T.js +6 -0
  109. package/isObject-FTY-5JQX.js +7 -0
  110. package/isObjectLike-OAgjjZye.js +48 -0
  111. package/isSymbol-Xd2FsJyp.js +8 -0
  112. package/last-CUCl67Im.js +7 -0
  113. package/main.js +62 -62
  114. package/package.json +1 -1
  115. package/sortBy-B-UKp4GT.js +100 -0
  116. package/sumBy-MYkDPHZL.js +8 -0
  117. package/text/Frequency.js +42 -23
  118. package/toFinite-Bc55msYj.js +16 -0
  119. package/toNumber-DPxy1FBy.js +39 -0
  120. package/useClueTypeConfig-XvGvIw2S.js +3201 -0
  121. package/utils/chain.js +91 -64
  122. package/utils/classificationParser.js +519 -256
  123. package/utils/constants.js +35 -10
  124. package/utils/graph.js +72 -45
  125. package/utils/hashUtil.js +7 -7
  126. package/utils/line.js +131 -81
  127. package/utils/loggerUtil.js +5 -3
  128. package/utils/sessionStorage.js +41 -27
  129. package/utils/time.js +423 -423
  130. package/utils/utils.js +9 -9
  131. package/utils/window.js +21 -10
  132. package/utils-7OtvGnmf.js +200 -0
  133. package/ActionForm-myEAs2UC.js +0 -435
  134. package/AnnotationDetails-BChWwaXw.js +0 -160
  135. package/AnnotationPreview-D060vmy2.js +0 -140
  136. package/ClueEnrichContext-DJNjbXu_.js +0 -418
  137. package/FlexOne-BXWFOd1T.js +0 -6
  138. package/_Map-DXNg_Z-q.js +0 -54
  139. package/_MapCache-Cu25RRDU.js +0 -129
  140. package/_Uint8Array-DlJCtTvG.js +0 -102
  141. package/_baseAssignValue-CUmzp727.js +0 -20
  142. package/_baseClone-BlMmRXeX.js +0 -208
  143. package/_baseExtremum-P_0akmCi.js +0 -27
  144. package/_baseFlatten-CN7vDNEQ.js +0 -72
  145. package/_baseGet-Dgf6_xCm.js +0 -80
  146. package/_baseIsEqual-Cpjtfb3Q.js +0 -173
  147. package/_baseIteratee-CP1bocOX.js +0 -95
  148. package/_baseSlice-M5RKzt1A.js +0 -10
  149. package/_baseSum-wEbgNeUs.js +0 -10
  150. package/_baseUniq-tMFmk80M.js +0 -61
  151. package/_commonjsHelpers-DaMA6jEr.js +0 -8
  152. package/_createAggregator-B4Cav8ZM.js +0 -53
  153. package/_getPrototype-CHAFQYL_.js +0 -5
  154. package/_getTag-BV_UoLYG.js +0 -90
  155. package/cloneDeep-BPVpFBzJ.js +0 -8
  156. package/countBy-DOutsa_w.js +0 -8
  157. package/debounce-DryYcbJ4.js +0 -56
  158. package/get-Bow1vKwx.js +0 -8
  159. package/groupBy-BheQYl6f.js +0 -8
  160. package/iconify-BBckr5AQ.js +0 -1263
  161. package/identity-ByMq8VxU.js +0 -6
  162. package/index-BXxfAxFt.js +0 -12734
  163. package/index-C15OYgRY.js +0 -358
  164. package/index-E7g8cRyW.js +0 -568
  165. package/index-p5_wX7q1.js +0 -11729
  166. package/index-vF6IyBhz.js +0 -975
  167. package/isEmpty-g47Qir2A.js +0 -21
  168. package/isNil-CjWwlQS3.js +0 -6
  169. package/isObject-B53jY8Qg.js +0 -7
  170. package/isObjectLike-BatpeCIi.js +0 -29
  171. package/isSymbol-C3_SC0Qp.js +0 -8
  172. package/last-7CdUxN0r.js +0 -7
  173. package/sortBy-ITdmD17L.js +0 -79
  174. package/sumBy-DxJUU2E8.js +0 -8
  175. package/toFinite-BMy6GObD.js +0 -14
  176. package/toNumber-YVhnnJv4.js +0 -31
  177. package/useClueTypeConfig-DyeBcXQX.js +0 -2214
  178. package/utils-BnmI_6N8.js +0 -130
package/utils/utils.js CHANGED
@@ -1,12 +1,12 @@
1
- import { d as a, b as i, r as p, s as c, t as h } from "../utils-BnmI_6N8.js";
1
+ import { d, b, r, s, t } from "../utils-7OtvGnmf.js";
2
2
  import "./time.js";
3
- import "../_Map-DXNg_Z-q.js";
4
- import "../isEmpty-g47Qir2A.js";
5
- import "../isNil-CjWwlQS3.js";
3
+ import "../_Map-kgDsDYxq.js";
4
+ import "../isEmpty-BQkZubqU.js";
5
+ import "../isNil-CIubwp4T.js";
6
6
  export {
7
- a as delay,
8
- i as filterEnrichments,
9
- p as removeEmpty,
10
- c as searchObject,
11
- h as twitterShort
7
+ d as delay,
8
+ b as filterEnrichments,
9
+ r as removeEmpty,
10
+ s as searchObject,
11
+ t as twitterShort
12
12
  };
package/utils/window.js CHANGED
@@ -1,13 +1,24 @@
1
- const i = (e) => {
2
- typeof window > "u" || window.dispatchEvent(e);
3
- }, d = (e, n, t) => {
4
- typeof window > "u" || window.removeEventListener(e, n, t);
5
- }, o = (e, n, t) => {
6
- if (!(typeof window > "u"))
7
- return window.addEventListener(e, n, t), () => d(e, n, t);
1
+ const safeDispatchEvent = (event) => {
2
+ if (typeof window === "undefined") {
3
+ return;
4
+ }
5
+ window.dispatchEvent(event);
6
+ };
7
+ const safeRemoveEventListener = (type, listener, options) => {
8
+ if (typeof window === "undefined") {
9
+ return;
10
+ }
11
+ window.removeEventListener(type, listener, options);
12
+ };
13
+ const safeAddEventListener = (type, listener, options) => {
14
+ if (typeof window === "undefined") {
15
+ return;
16
+ }
17
+ window.addEventListener(type, listener, options);
18
+ return () => safeRemoveEventListener(type, listener, options);
8
19
  };
9
20
  export {
10
- o as safeAddEventListener,
11
- i as safeDispatchEvent,
12
- d as safeRemoveEventListener
21
+ safeAddEventListener,
22
+ safeDispatchEvent,
23
+ safeRemoveEventListener
13
24
  };
@@ -0,0 +1,200 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
+ import { dayjs } from "./utils/time.js";
5
+ import { i as isArray } from "./_Map-kgDsDYxq.js";
6
+ import { i as isEmpty } from "./isEmpty-BQkZubqU.js";
7
+ import { b as baseIsEqual } from "./_baseIsEqual-B5xLoweL.js";
8
+ import { i as isNil } from "./isNil-CIubwp4T.js";
9
+ import { i as isObjectLike, b as baseGetTag } from "./isObjectLike-OAgjjZye.js";
10
+ import { g as getPrototype } from "./_getPrototype-D1LAdQKO.js";
11
+ import { b as baseUniq } from "./_baseUniq-CpupKWcL.js";
12
+ function isBuffer(obj) {
13
+ return obj && obj.constructor && typeof obj.constructor.isBuffer === "function" && obj.constructor.isBuffer(obj);
14
+ }
15
+ function keyIdentity(key) {
16
+ return key;
17
+ }
18
+ function flatten(target, opts) {
19
+ opts = opts || {};
20
+ const delimiter = opts.delimiter || ".";
21
+ const maxDepth = opts.maxDepth;
22
+ const transformKey = opts.transformKey || keyIdentity;
23
+ const output = {};
24
+ function step(object, prev, currentDepth) {
25
+ currentDepth = currentDepth || 1;
26
+ Object.keys(object).forEach(function(key) {
27
+ const value = object[key];
28
+ const isarray = opts.safe && Array.isArray(value);
29
+ const type = Object.prototype.toString.call(value);
30
+ const isbuffer = isBuffer(value);
31
+ const isobject = type === "[object Object]" || type === "[object Array]";
32
+ const newKey = prev ? prev + delimiter + transformKey(key) : transformKey(key);
33
+ if (!isarray && !isbuffer && isobject && Object.keys(value).length && (!opts.maxDepth || currentDepth < maxDepth)) {
34
+ return step(value, newKey, currentDepth + 1);
35
+ }
36
+ output[newKey] = value;
37
+ });
38
+ }
39
+ step(target);
40
+ return output;
41
+ }
42
+ function unflatten(target, opts) {
43
+ opts = opts || {};
44
+ const delimiter = opts.delimiter || ".";
45
+ const overwrite = opts.overwrite || false;
46
+ const transformKey = opts.transformKey || keyIdentity;
47
+ const result = {};
48
+ const isbuffer = isBuffer(target);
49
+ if (isbuffer || Object.prototype.toString.call(target) !== "[object Object]") {
50
+ return target;
51
+ }
52
+ function getkey(key) {
53
+ const parsedKey = Number(key);
54
+ return isNaN(parsedKey) || key.indexOf(".") !== -1 || opts.object ? key : parsedKey;
55
+ }
56
+ function addKeys(keyPrefix, recipient, target2) {
57
+ return Object.keys(target2).reduce(function(result2, key) {
58
+ result2[keyPrefix + delimiter + key] = target2[key];
59
+ return result2;
60
+ }, recipient);
61
+ }
62
+ function isEmpty2(val) {
63
+ const type = Object.prototype.toString.call(val);
64
+ const isArray2 = type === "[object Array]";
65
+ const isObject = type === "[object Object]";
66
+ if (!val) {
67
+ return true;
68
+ } else if (isArray2) {
69
+ return !val.length;
70
+ } else if (isObject) {
71
+ return !Object.keys(val).length;
72
+ }
73
+ }
74
+ target = Object.keys(target).reduce(function(result2, key) {
75
+ const type = Object.prototype.toString.call(target[key]);
76
+ const isObject = type === "[object Object]" || type === "[object Array]";
77
+ if (!isObject || isEmpty2(target[key])) {
78
+ result2[key] = target[key];
79
+ return result2;
80
+ } else {
81
+ return addKeys(
82
+ key,
83
+ result2,
84
+ flatten(target[key], opts)
85
+ );
86
+ }
87
+ }, {});
88
+ Object.keys(target).forEach(function(key) {
89
+ const split = key.split(delimiter).map(transformKey);
90
+ let key1 = getkey(split.shift());
91
+ let key2 = getkey(split[0]);
92
+ let recipient = result;
93
+ while (key2 !== void 0) {
94
+ if (key1 === "__proto__") {
95
+ return;
96
+ }
97
+ const type = Object.prototype.toString.call(recipient[key1]);
98
+ const isobject = type === "[object Object]" || type === "[object Array]";
99
+ if (!overwrite && !isobject && typeof recipient[key1] !== "undefined") {
100
+ return;
101
+ }
102
+ if (overwrite && !isobject || !overwrite && recipient[key1] == null) {
103
+ recipient[key1] = typeof key2 === "number" && !opts.object ? [] : {};
104
+ }
105
+ recipient = recipient[key1];
106
+ if (split.length > 0) {
107
+ key1 = getkey(split.shift());
108
+ key2 = getkey(split[0]);
109
+ }
110
+ }
111
+ recipient[key1] = unflatten(target[key], opts);
112
+ });
113
+ return result;
114
+ }
115
+ var objectTag = "[object Object]";
116
+ var funcProto = Function.prototype, objectProto = Object.prototype;
117
+ var funcToString = funcProto.toString;
118
+ var hasOwnProperty = objectProto.hasOwnProperty;
119
+ var objectCtorString = funcToString.call(Object);
120
+ function isPlainObject(value) {
121
+ if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
122
+ return false;
123
+ }
124
+ var proto = getPrototype(value);
125
+ if (proto === null) {
126
+ return true;
127
+ }
128
+ var Ctor = hasOwnProperty.call(proto, "constructor") && proto.constructor;
129
+ return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString;
130
+ }
131
+ function isEqual(value, other) {
132
+ return baseIsEqual(value, other);
133
+ }
134
+ function uniqWith(array, comparator) {
135
+ comparator = typeof comparator == "function" ? comparator : void 0;
136
+ return array && array.length ? baseUniq(array, void 0, comparator) : [];
137
+ }
138
+ const twitterShort = (date) => {
139
+ if (!date || date === "?") {
140
+ return "?";
141
+ }
142
+ const now = dayjs();
143
+ const comparedDate = dayjs(date);
144
+ if (comparedDate.isAfter(now)) {
145
+ return now.fromNow();
146
+ }
147
+ return comparedDate.fromNow();
148
+ };
149
+ const delay = (ms, rejectOnCancel = false) => {
150
+ let timerId;
151
+ let onCancel;
152
+ class TimedPromise extends Promise {
153
+ constructor() {
154
+ super(...arguments);
155
+ __publicField(this, "cancel", () => {
156
+ if (rejectOnCancel) {
157
+ onCancel();
158
+ }
159
+ clearTimeout(timerId);
160
+ });
161
+ }
162
+ }
163
+ return new TimedPromise((resolve, reject) => {
164
+ timerId = setTimeout(resolve, ms);
165
+ onCancel = reject;
166
+ });
167
+ };
168
+ const removeEmpty = (obj, aggressive = false) => {
169
+ if (aggressive && isEmpty(obj)) {
170
+ return null;
171
+ } else if (isArray(obj)) {
172
+ return obj;
173
+ }
174
+ return Object.fromEntries(
175
+ Object.entries(obj ?? {}).filter(([__, v]) => !isNil(v)).map(([k, v]) => [k, isPlainObject(v) || isArray(v) ? removeEmpty(v, aggressive) : v]).filter(([__, v]) => !!v)
176
+ );
177
+ };
178
+ const searchObject = (o, query) => {
179
+ try {
180
+ const regex = new RegExp(query, "i");
181
+ return unflatten(
182
+ Object.fromEntries(Object.entries(flatten(o)).filter(([k, v]) => regex.test(k) || regex.test(v))) ?? {}
183
+ );
184
+ } catch {
185
+ return o;
186
+ }
187
+ };
188
+ const filterEnrichments = (failedEnrichments) => {
189
+ return uniqWith(failedEnrichments, isEqual);
190
+ };
191
+ export {
192
+ isPlainObject as a,
193
+ filterEnrichments as b,
194
+ delay as d,
195
+ flatten as f,
196
+ isEqual as i,
197
+ removeEmpty as r,
198
+ searchObject as s,
199
+ twitterShort as t
200
+ };