@cccsaurora/clue-ui 1.0.1-dev.70 → 1.0.2-patch.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ActionForm-Sw7D-KOE.js +340 -0
- package/AnnotationDetails-BoX61_IF.js +160 -0
- package/AnnotationPreview-dYinoSA9.js +140 -0
- package/ClueEnrichContext-CvCIPOMC.js +412 -0
- package/FlexOne-BXWFOd1T.js +6 -0
- package/_Map-DXNg_Z-q.js +54 -0
- package/_MapCache-Cu25RRDU.js +129 -0
- package/_Uint8Array-DlJCtTvG.js +102 -0
- package/_baseAssignValue-CUmzp727.js +20 -0
- package/_baseClone-BlMmRXeX.js +208 -0
- package/_baseExtremum-P_0akmCi.js +27 -0
- package/_baseFlatten-CN7vDNEQ.js +72 -0
- package/_baseGet-Dgf6_xCm.js +80 -0
- package/_baseIsEqual-Cpjtfb3Q.js +173 -0
- package/_baseIteratee-CP1bocOX.js +95 -0
- package/_baseSlice-M5RKzt1A.js +10 -0
- package/_baseSum-wEbgNeUs.js +10 -0
- package/_baseUniq-tMFmk80M.js +61 -0
- package/_commonjsHelpers-C6fGbg64.js +6 -0
- package/_createAggregator-B4Cav8ZM.js +53 -0
- package/_getPrototype-CHAFQYL_.js +5 -0
- package/_getTag-BV_UoLYG.js +90 -0
- package/cloneDeep-BPVpFBzJ.js +8 -0
- package/components/AnnotationBody.js +34 -49
- package/components/AnnotationDetailPopover.js +30 -36
- package/components/AnnotationDetails.js +6 -6
- package/components/AnnotationEntry.js +47 -50
- package/components/AnnotationPreview.js +5 -5
- package/components/ClassificationChip.js +23 -44
- package/components/CountBadge.js +26 -31
- package/components/EnrichedCard.js +92 -104
- package/components/EnrichedChip.js +109 -134
- package/components/EnrichedTypography.js +110 -136
- package/components/ErrorBoundary.js +24 -28
- package/components/RetryFailedEnrichments.js +9 -10
- package/components/SourcePicker.js +49 -57
- package/components/actions/ActionForm.js +4 -4
- package/components/actions/ExecutePopover.js +50 -64
- package/components/actions/ResultModal.js +34 -37
- package/components/actions/form/schemaAdapter.js +20 -39
- package/components/display/graph/ExpandMoreButton.js +10 -10
- package/components/display/graph/elements/NodeCard.js +76 -92
- package/components/display/graph/elements/NodeTag.js +13 -15
- package/components/display/graph/index.js +200 -258
- package/components/display/graph/visualizations/Leaf.js +69 -88
- package/components/display/graph/visualizations/cloud/index.js +81 -98
- package/components/display/graph/visualizations/icons/BaseIcon.js +21 -26
- package/components/display/graph/visualizations/icons/BugIcon.js +12 -12
- package/components/display/graph/visualizations/icons/HostIcon.js +12 -12
- package/components/display/graph/visualizations/icons/NetworkIcon.js +12 -12
- package/components/display/graph/visualizations/icons/ProcessIcon.js +12 -12
- package/components/display/graph/visualizations/icons/TargetIcon.js +13 -13
- package/components/display/graph/visualizations/icons/index.js +13 -14
- package/components/display/graph/visualizations/panels/NodePanel.js +8 -10
- package/components/display/graph/visualizations/tree/BundleLine.js +81 -108
- package/components/display/graph/visualizations/tree/Triangle.js +13 -13
- package/components/display/graph/visualizations/tree/index.js +305 -407
- package/components/display/icons/Iconified.js +12 -27
- package/components/display/json/index.js +4 -4
- package/components/display/markdown/DynamicTabs.js +17 -22
- package/components/display/markdown/index.js +5674 -8531
- package/components/display/markdown/markdownPlugins/tabs.js +1 -1
- package/components/enrichment/EnrichPopover.js +47 -55
- package/components/fetchers/Fetcher.js +95 -123
- package/components/fetchers/PreviewModal.js +17 -20
- package/components/fetchers/StatusChip.js +18 -22
- package/components/group/Entry.js +11 -13
- package/components/group/Group.js +10 -13
- package/components/group/GroupControl.js +65 -76
- package/components/stats/QueryStatus.js +28 -37
- package/countBy-DOutsa_w.js +8 -0
- package/data/event.js +4 -6
- package/database/index.js +2 -2
- package/debounce-DryYcbJ4.js +56 -0
- package/get-Bow1vKwx.js +8 -0
- package/groupBy-BheQYl6f.js +8 -0
- package/hooks/ClueActionContext.js +6 -6
- package/hooks/ClueComponentContext.js +23 -29
- package/hooks/ClueConfigProvider.js +12 -14
- package/hooks/ClueDatabaseContext.js +13 -19
- package/hooks/ClueEnrichContext.js +8 -8
- package/hooks/ClueEnrichContextType.d.ts +7 -0
- package/hooks/ClueFetcherContext.js +46 -74
- package/hooks/ClueGroupContext.js +14 -17
- package/hooks/CluePopupContext.js +5 -5
- package/hooks/ClueProvider.js +10 -12
- package/hooks/selectors.js +11 -22
- package/hooks/useAnnotations.js +29 -45
- package/hooks/useClue.js +4 -6
- package/hooks/useClueActions.js +3 -3
- package/hooks/useClueConfig.js +5 -5
- package/hooks/useClueTypeConfig.js +3 -3
- package/hooks/useComparator.js +435 -722
- package/hooks/useErrors.js +18 -22
- package/hooks/useMyHighlights.js +36 -66
- package/hooks/useMyLocalStorage.js +43 -63
- package/iconify-BBckr5AQ.js +1263 -0
- package/icons/Action.js +49 -66
- package/icons/Assessment.js +68 -84
- package/icons/Context.js +61 -75
- package/icons/Opinion.js +65 -77
- package/icons/iconMap.js +2 -2
- package/identity-ByMq8VxU.js +6 -0
- package/index-CnaCBNrd.js +358 -0
- package/index-E7g8cRyW.js +568 -0
- package/index-V7wwd05F.js +975 -0
- package/index-p5_wX7q1.js +11729 -0
- package/index-pQg5VUAZ.js +12734 -0
- package/isEmpty-g47Qir2A.js +21 -0
- package/isNil-CjWwlQS3.js +6 -0
- package/isObject-B53jY8Qg.js +7 -0
- package/isObjectLike-BatpeCIi.js +29 -0
- package/isSymbol-C3_SC0Qp.js +8 -0
- package/last-7CdUxN0r.js +7 -0
- package/main.d.ts +3 -2
- package/main.js +62 -58
- package/package.json +1 -1
- package/sortBy-ITdmD17L.js +79 -0
- package/sumBy-DxJUU2E8.js +8 -0
- package/tabs-CgADNA57.js +195 -0
- package/text/Frequency.js +23 -42
- package/toFinite-BMy6GObD.js +14 -0
- package/toNumber-YVhnnJv4.js +31 -0
- package/types/config.d.ts +4 -1
- package/useClueTypeConfig-CneP98N_.js +2260 -0
- package/utils/chain.js +64 -91
- package/utils/classificationParser.d.ts +8 -8
- package/utils/classificationParser.js +257 -520
- package/utils/constants.js +10 -35
- package/utils/graph.js +45 -72
- package/utils/hashUtil.js +7 -7
- package/utils/line.js +81 -131
- package/utils/loggerUtil.js +3 -5
- package/utils/sessionStorage.js +29 -41
- package/utils/utils.js +9 -9
- package/utils/window.js +10 -21
- package/utils-CD0rFIFU.js +2704 -0
- package/ActionForm-D4ryHO0M.js +0 -436
- package/AnnotationDetails-YAPoqw3R.js +0 -175
- package/AnnotationPreview-DiQDjt9s.js +0 -188
- package/ClueEnrichContext-DIn6g8tw.js +0 -522
- package/FlexOne-BSYAhhtG.js +0 -9
- package/_Map-kgDsDYxq.js +0 -64
- package/_MapCache-DabaaWfq.js +0 -161
- package/_Uint8Array-BlVVH1tp.js +0 -129
- package/_baseAssignValue-CNbcU6Nb.js +0 -25
- package/_baseClone-D3a8Pa4T.js +0 -284
- package/_baseExtremum-B1o1zHjR.js +0 -33
- package/_baseFlatten-D4huXoEI.js +0 -92
- package/_baseGet-BSK_nnoz.js +0 -109
- package/_baseIsEqual-B5xLoweL.js +0 -238
- package/_baseIteratee-p6Nj07-n.js +0 -126
- package/_baseSlice-GAv_YFTT.js +0 -20
- package/_baseSum-D0WC1dN0.js +0 -13
- package/_baseUniq-CpupKWcL.js +0 -89
- package/_commonjsHelpers-CUmg6egw.js +0 -6
- package/_createAggregator-BpVy5xMi.js +0 -63
- package/_getPrototype-D1LAdQKO.js +0 -5
- package/_getTag-D3ToyefI.js +0 -126
- package/cloneDeep-CjP5k9zW.js +0 -8
- package/countBy-C69WslUA.js +0 -14
- package/debounce-bV0h5FC5.js +0 -92
- package/get-D3C3lEU3.js +0 -8
- package/groupBy-DC2oOuBN.js +0 -14
- package/iconify-CXMreGTg.js +0 -1782
- package/identity-CPGTqrE4.js +0 -6
- package/index-BDVjGvMI.js +0 -696
- package/index-BHPT3qoB.js +0 -1172
- package/index-BMxyILVD.js +0 -465
- package/index-BbPn6-Mw.js +0 -15750
- package/index-Dz1kF2MU.js +0 -17654
- package/isEmpty-BQkZubqU.js +0 -29
- package/isNil-CIubwp4T.js +0 -6
- package/isObject-FTY-5JQX.js +0 -7
- package/isObjectLike-OAgjjZye.js +0 -48
- package/isSymbol-Xd2FsJyp.js +0 -8
- package/last-CUCl67Im.js +0 -7
- package/sortBy-B-UKp4GT.js +0 -100
- package/sumBy-MYkDPHZL.js +0 -8
- package/tabs-xGuUGsJd.js +0 -254
- package/toFinite-Bc55msYj.js +0 -16
- package/toNumber-DPxy1FBy.js +0 -39
- package/useClueTypeConfig-CH-nGq6a.js +0 -3184
- package/utils-Dr4wbKBZ.js +0 -4182
package/isEmpty-BQkZubqU.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { i as isArrayLike, a as isBuffer, b as isTypedArray, c as isArguments, g as getTag, d as isPrototype, e as baseKeys } from "./_getTag-D3ToyefI.js";
|
|
2
|
-
import { i as isArray } from "./_Map-kgDsDYxq.js";
|
|
3
|
-
var mapTag = "[object Map]", setTag = "[object Set]";
|
|
4
|
-
var objectProto = Object.prototype;
|
|
5
|
-
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
6
|
-
function isEmpty(value) {
|
|
7
|
-
if (value == null) {
|
|
8
|
-
return true;
|
|
9
|
-
}
|
|
10
|
-
if (isArrayLike(value) && (isArray(value) || typeof value == "string" || typeof value.splice == "function" || isBuffer(value) || isTypedArray(value) || isArguments(value))) {
|
|
11
|
-
return !value.length;
|
|
12
|
-
}
|
|
13
|
-
var tag = getTag(value);
|
|
14
|
-
if (tag == mapTag || tag == setTag) {
|
|
15
|
-
return !value.size;
|
|
16
|
-
}
|
|
17
|
-
if (isPrototype(value)) {
|
|
18
|
-
return !baseKeys(value).length;
|
|
19
|
-
}
|
|
20
|
-
for (var key in value) {
|
|
21
|
-
if (hasOwnProperty.call(value, key)) {
|
|
22
|
-
return false;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
return true;
|
|
26
|
-
}
|
|
27
|
-
export {
|
|
28
|
-
isEmpty as i
|
|
29
|
-
};
|
package/isNil-CIubwp4T.js
DELETED
package/isObject-FTY-5JQX.js
DELETED
package/isObjectLike-OAgjjZye.js
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
|
|
2
|
-
var freeSelf = typeof self == "object" && self && self.Object === Object && self;
|
|
3
|
-
var root = freeGlobal || freeSelf || Function("return this")();
|
|
4
|
-
var Symbol$1 = root.Symbol;
|
|
5
|
-
var objectProto$1 = Object.prototype;
|
|
6
|
-
var hasOwnProperty = objectProto$1.hasOwnProperty;
|
|
7
|
-
var nativeObjectToString$1 = objectProto$1.toString;
|
|
8
|
-
var symToStringTag$1 = Symbol$1 ? Symbol$1.toStringTag : void 0;
|
|
9
|
-
function getRawTag(value) {
|
|
10
|
-
var isOwn = hasOwnProperty.call(value, symToStringTag$1), tag = value[symToStringTag$1];
|
|
11
|
-
try {
|
|
12
|
-
value[symToStringTag$1] = void 0;
|
|
13
|
-
var unmasked = true;
|
|
14
|
-
} catch (e) {
|
|
15
|
-
}
|
|
16
|
-
var result = nativeObjectToString$1.call(value);
|
|
17
|
-
if (unmasked) {
|
|
18
|
-
if (isOwn) {
|
|
19
|
-
value[symToStringTag$1] = tag;
|
|
20
|
-
} else {
|
|
21
|
-
delete value[symToStringTag$1];
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
return result;
|
|
25
|
-
}
|
|
26
|
-
var objectProto = Object.prototype;
|
|
27
|
-
var nativeObjectToString = objectProto.toString;
|
|
28
|
-
function objectToString(value) {
|
|
29
|
-
return nativeObjectToString.call(value);
|
|
30
|
-
}
|
|
31
|
-
var nullTag = "[object Null]", undefinedTag = "[object Undefined]";
|
|
32
|
-
var symToStringTag = Symbol$1 ? Symbol$1.toStringTag : void 0;
|
|
33
|
-
function baseGetTag(value) {
|
|
34
|
-
if (value == null) {
|
|
35
|
-
return value === void 0 ? undefinedTag : nullTag;
|
|
36
|
-
}
|
|
37
|
-
return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value);
|
|
38
|
-
}
|
|
39
|
-
function isObjectLike(value) {
|
|
40
|
-
return value != null && typeof value == "object";
|
|
41
|
-
}
|
|
42
|
-
export {
|
|
43
|
-
Symbol$1 as S,
|
|
44
|
-
baseGetTag as b,
|
|
45
|
-
freeGlobal as f,
|
|
46
|
-
isObjectLike as i,
|
|
47
|
-
root as r
|
|
48
|
-
};
|
package/isSymbol-Xd2FsJyp.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { i as isObjectLike, b as baseGetTag } from "./isObjectLike-OAgjjZye.js";
|
|
2
|
-
var symbolTag = "[object Symbol]";
|
|
3
|
-
function isSymbol(value) {
|
|
4
|
-
return typeof value == "symbol" || isObjectLike(value) && baseGetTag(value) == symbolTag;
|
|
5
|
-
}
|
|
6
|
-
export {
|
|
7
|
-
isSymbol as i
|
|
8
|
-
};
|
package/last-CUCl67Im.js
DELETED
package/sortBy-B-UKp4GT.js
DELETED
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import { b as baseExtremum, a as baseGt, i as isIterateeCall } from "./_baseExtremum-B1o1zHjR.js";
|
|
2
|
-
import { b as baseIteratee } from "./_baseIteratee-p6Nj07-n.js";
|
|
3
|
-
import { s as setToString, o as overRest, b as baseFlatten } from "./_baseFlatten-D4huXoEI.js";
|
|
4
|
-
import { a as arrayMap, b as baseGet } from "./_baseGet-BSK_nnoz.js";
|
|
5
|
-
import { b as baseEach } from "./_createAggregator-BpVy5xMi.js";
|
|
6
|
-
import { i as isArrayLike, f as baseUnary } from "./_getTag-D3ToyefI.js";
|
|
7
|
-
import { i as isSymbol } from "./isSymbol-Xd2FsJyp.js";
|
|
8
|
-
import { i as identity } from "./identity-CPGTqrE4.js";
|
|
9
|
-
import { i as isArray } from "./_Map-kgDsDYxq.js";
|
|
10
|
-
function baseRest(func, start) {
|
|
11
|
-
return setToString(overRest(func, start, identity), func + "");
|
|
12
|
-
}
|
|
13
|
-
function baseMap(collection, iteratee) {
|
|
14
|
-
var index = -1, result = isArrayLike(collection) ? Array(collection.length) : [];
|
|
15
|
-
baseEach(collection, function(value, key, collection2) {
|
|
16
|
-
result[++index] = iteratee(value, key, collection2);
|
|
17
|
-
});
|
|
18
|
-
return result;
|
|
19
|
-
}
|
|
20
|
-
function maxBy(array, iteratee) {
|
|
21
|
-
return array && array.length ? baseExtremum(array, baseIteratee(iteratee), baseGt) : void 0;
|
|
22
|
-
}
|
|
23
|
-
function baseSortBy(array, comparer) {
|
|
24
|
-
var length = array.length;
|
|
25
|
-
array.sort(comparer);
|
|
26
|
-
while (length--) {
|
|
27
|
-
array[length] = array[length].value;
|
|
28
|
-
}
|
|
29
|
-
return array;
|
|
30
|
-
}
|
|
31
|
-
function compareAscending(value, other) {
|
|
32
|
-
if (value !== other) {
|
|
33
|
-
var valIsDefined = value !== void 0, valIsNull = value === null, valIsReflexive = value === value, valIsSymbol = isSymbol(value);
|
|
34
|
-
var othIsDefined = other !== void 0, othIsNull = other === null, othIsReflexive = other === other, othIsSymbol = isSymbol(other);
|
|
35
|
-
if (!othIsNull && !othIsSymbol && !valIsSymbol && value > other || valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol || valIsNull && othIsDefined && othIsReflexive || !valIsDefined && othIsReflexive || !valIsReflexive) {
|
|
36
|
-
return 1;
|
|
37
|
-
}
|
|
38
|
-
if (!valIsNull && !valIsSymbol && !othIsSymbol && value < other || othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol || othIsNull && valIsDefined && valIsReflexive || !othIsDefined && valIsReflexive || !othIsReflexive) {
|
|
39
|
-
return -1;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
return 0;
|
|
43
|
-
}
|
|
44
|
-
function compareMultiple(object, other, orders) {
|
|
45
|
-
var index = -1, objCriteria = object.criteria, othCriteria = other.criteria, length = objCriteria.length, ordersLength = orders.length;
|
|
46
|
-
while (++index < length) {
|
|
47
|
-
var result = compareAscending(objCriteria[index], othCriteria[index]);
|
|
48
|
-
if (result) {
|
|
49
|
-
if (index >= ordersLength) {
|
|
50
|
-
return result;
|
|
51
|
-
}
|
|
52
|
-
var order = orders[index];
|
|
53
|
-
return result * (order == "desc" ? -1 : 1);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
return object.index - other.index;
|
|
57
|
-
}
|
|
58
|
-
function baseOrderBy(collection, iteratees, orders) {
|
|
59
|
-
if (iteratees.length) {
|
|
60
|
-
iteratees = arrayMap(iteratees, function(iteratee) {
|
|
61
|
-
if (isArray(iteratee)) {
|
|
62
|
-
return function(value) {
|
|
63
|
-
return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
return iteratee;
|
|
67
|
-
});
|
|
68
|
-
} else {
|
|
69
|
-
iteratees = [identity];
|
|
70
|
-
}
|
|
71
|
-
var index = -1;
|
|
72
|
-
iteratees = arrayMap(iteratees, baseUnary(baseIteratee));
|
|
73
|
-
var result = baseMap(collection, function(value, key, collection2) {
|
|
74
|
-
var criteria = arrayMap(iteratees, function(iteratee) {
|
|
75
|
-
return iteratee(value);
|
|
76
|
-
});
|
|
77
|
-
return { "criteria": criteria, "index": ++index, "value": value };
|
|
78
|
-
});
|
|
79
|
-
return baseSortBy(result, function(object, other) {
|
|
80
|
-
return compareMultiple(object, other, orders);
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
var sortBy = baseRest(function(collection, iteratees) {
|
|
84
|
-
if (collection == null) {
|
|
85
|
-
return [];
|
|
86
|
-
}
|
|
87
|
-
var length = iteratees.length;
|
|
88
|
-
if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
|
|
89
|
-
iteratees = [];
|
|
90
|
-
} else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
|
|
91
|
-
iteratees = [iteratees[0]];
|
|
92
|
-
}
|
|
93
|
-
return baseOrderBy(collection, baseFlatten(iteratees), []);
|
|
94
|
-
});
|
|
95
|
-
export {
|
|
96
|
-
baseOrderBy as a,
|
|
97
|
-
baseMap as b,
|
|
98
|
-
maxBy as m,
|
|
99
|
-
sortBy as s
|
|
100
|
-
};
|
package/sumBy-MYkDPHZL.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { b as baseIteratee } from "./_baseIteratee-p6Nj07-n.js";
|
|
2
|
-
import { b as baseSum } from "./_baseSum-D0WC1dN0.js";
|
|
3
|
-
function sumBy(array, iteratee) {
|
|
4
|
-
return array && array.length ? baseSum(array, baseIteratee(iteratee)) : 0;
|
|
5
|
-
}
|
|
6
|
-
export {
|
|
7
|
-
sumBy as s
|
|
8
|
-
};
|
package/tabs-xGuUGsJd.js
DELETED
|
@@ -1,254 +0,0 @@
|
|
|
1
|
-
const convert = (
|
|
2
|
-
// Note: overloads in JSDoc can’t yet use different `@template`s.
|
|
3
|
-
/**
|
|
4
|
-
* @type {(
|
|
5
|
-
* (<Condition extends string>(test: Condition) => (node: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & {type: Condition}) &
|
|
6
|
-
* (<Condition extends Props>(test: Condition) => (node: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & Condition) &
|
|
7
|
-
* (<Condition extends TestFunction>(test: Condition) => (node: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & Predicate<Condition, Node>) &
|
|
8
|
-
* ((test?: null | undefined) => (node?: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node) &
|
|
9
|
-
* ((test?: Test) => Check)
|
|
10
|
-
* )}
|
|
11
|
-
*/
|
|
12
|
-
/**
|
|
13
|
-
* @param {Test} [test]
|
|
14
|
-
* @returns {Check}
|
|
15
|
-
*/
|
|
16
|
-
function(test) {
|
|
17
|
-
if (test === null || test === void 0) {
|
|
18
|
-
return ok;
|
|
19
|
-
}
|
|
20
|
-
if (typeof test === "function") {
|
|
21
|
-
return castFactory(test);
|
|
22
|
-
}
|
|
23
|
-
if (typeof test === "object") {
|
|
24
|
-
return Array.isArray(test) ? anyFactory(test) : propsFactory(test);
|
|
25
|
-
}
|
|
26
|
-
if (typeof test === "string") {
|
|
27
|
-
return typeFactory(test);
|
|
28
|
-
}
|
|
29
|
-
throw new Error("Expected function, string, or object as test");
|
|
30
|
-
}
|
|
31
|
-
);
|
|
32
|
-
function anyFactory(tests) {
|
|
33
|
-
const checks = [];
|
|
34
|
-
let index = -1;
|
|
35
|
-
while (++index < tests.length) {
|
|
36
|
-
checks[index] = convert(tests[index]);
|
|
37
|
-
}
|
|
38
|
-
return castFactory(any);
|
|
39
|
-
function any(...parameters) {
|
|
40
|
-
let index2 = -1;
|
|
41
|
-
while (++index2 < checks.length) {
|
|
42
|
-
if (checks[index2].apply(this, parameters)) return true;
|
|
43
|
-
}
|
|
44
|
-
return false;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
function propsFactory(check) {
|
|
48
|
-
const checkAsRecord = (
|
|
49
|
-
/** @type {Record<string, unknown>} */
|
|
50
|
-
check
|
|
51
|
-
);
|
|
52
|
-
return castFactory(all);
|
|
53
|
-
function all(node) {
|
|
54
|
-
const nodeAsRecord = (
|
|
55
|
-
/** @type {Record<string, unknown>} */
|
|
56
|
-
/** @type {unknown} */
|
|
57
|
-
node
|
|
58
|
-
);
|
|
59
|
-
let key;
|
|
60
|
-
for (key in check) {
|
|
61
|
-
if (nodeAsRecord[key] !== checkAsRecord[key]) return false;
|
|
62
|
-
}
|
|
63
|
-
return true;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
function typeFactory(check) {
|
|
67
|
-
return castFactory(type);
|
|
68
|
-
function type(node) {
|
|
69
|
-
return node && node.type === check;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
function castFactory(testFunction) {
|
|
73
|
-
return check;
|
|
74
|
-
function check(value, index, parent) {
|
|
75
|
-
return Boolean(
|
|
76
|
-
looksLikeANode(value) && testFunction.call(
|
|
77
|
-
this,
|
|
78
|
-
value,
|
|
79
|
-
typeof index === "number" ? index : void 0,
|
|
80
|
-
parent || void 0
|
|
81
|
-
)
|
|
82
|
-
);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
function ok() {
|
|
86
|
-
return true;
|
|
87
|
-
}
|
|
88
|
-
function looksLikeANode(value) {
|
|
89
|
-
return value !== null && typeof value === "object" && "type" in value;
|
|
90
|
-
}
|
|
91
|
-
function color(d) {
|
|
92
|
-
return d;
|
|
93
|
-
}
|
|
94
|
-
const empty = [];
|
|
95
|
-
const CONTINUE = true;
|
|
96
|
-
const EXIT = false;
|
|
97
|
-
const SKIP = "skip";
|
|
98
|
-
function visitParents(tree, test, visitor, reverse) {
|
|
99
|
-
let check;
|
|
100
|
-
if (typeof test === "function" && typeof visitor !== "function") {
|
|
101
|
-
reverse = visitor;
|
|
102
|
-
visitor = test;
|
|
103
|
-
} else {
|
|
104
|
-
check = test;
|
|
105
|
-
}
|
|
106
|
-
const is = convert(check);
|
|
107
|
-
const step = reverse ? -1 : 1;
|
|
108
|
-
factory(tree, void 0, [])();
|
|
109
|
-
function factory(node, index, parents) {
|
|
110
|
-
const value = (
|
|
111
|
-
/** @type {Record<string, unknown>} */
|
|
112
|
-
node && typeof node === "object" ? node : {}
|
|
113
|
-
);
|
|
114
|
-
if (typeof value.type === "string") {
|
|
115
|
-
const name = (
|
|
116
|
-
// `hast`
|
|
117
|
-
typeof value.tagName === "string" ? value.tagName : (
|
|
118
|
-
// `xast`
|
|
119
|
-
typeof value.name === "string" ? value.name : void 0
|
|
120
|
-
)
|
|
121
|
-
);
|
|
122
|
-
Object.defineProperty(visit2, "name", {
|
|
123
|
-
value: "node (" + color(node.type + (name ? "<" + name + ">" : "")) + ")"
|
|
124
|
-
});
|
|
125
|
-
}
|
|
126
|
-
return visit2;
|
|
127
|
-
function visit2() {
|
|
128
|
-
let result = empty;
|
|
129
|
-
let subresult;
|
|
130
|
-
let offset;
|
|
131
|
-
let grandparents;
|
|
132
|
-
if (!test || is(node, index, parents[parents.length - 1] || void 0)) {
|
|
133
|
-
result = toResult(visitor(node, parents));
|
|
134
|
-
if (result[0] === EXIT) {
|
|
135
|
-
return result;
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
if ("children" in node && node.children) {
|
|
139
|
-
const nodeAsParent = (
|
|
140
|
-
/** @type {UnistParent} */
|
|
141
|
-
node
|
|
142
|
-
);
|
|
143
|
-
if (nodeAsParent.children && result[0] !== SKIP) {
|
|
144
|
-
offset = (reverse ? nodeAsParent.children.length : -1) + step;
|
|
145
|
-
grandparents = parents.concat(nodeAsParent);
|
|
146
|
-
while (offset > -1 && offset < nodeAsParent.children.length) {
|
|
147
|
-
const child = nodeAsParent.children[offset];
|
|
148
|
-
subresult = factory(child, offset, grandparents)();
|
|
149
|
-
if (subresult[0] === EXIT) {
|
|
150
|
-
return subresult;
|
|
151
|
-
}
|
|
152
|
-
offset = typeof subresult[1] === "number" ? subresult[1] : offset + step;
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
return result;
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
function toResult(value) {
|
|
161
|
-
if (Array.isArray(value)) {
|
|
162
|
-
return value;
|
|
163
|
-
}
|
|
164
|
-
if (typeof value === "number") {
|
|
165
|
-
return [CONTINUE, value];
|
|
166
|
-
}
|
|
167
|
-
return value === null || value === void 0 ? empty : [value];
|
|
168
|
-
}
|
|
169
|
-
function visit(tree, testOrVisitor, visitorOrReverse, maybeReverse) {
|
|
170
|
-
let reverse;
|
|
171
|
-
let test;
|
|
172
|
-
let visitor;
|
|
173
|
-
if (typeof testOrVisitor === "function" && typeof visitorOrReverse !== "function") {
|
|
174
|
-
test = void 0;
|
|
175
|
-
visitor = testOrVisitor;
|
|
176
|
-
reverse = visitorOrReverse;
|
|
177
|
-
} else {
|
|
178
|
-
test = testOrVisitor;
|
|
179
|
-
visitor = visitorOrReverse;
|
|
180
|
-
reverse = maybeReverse;
|
|
181
|
-
}
|
|
182
|
-
visitParents(tree, test, overload, reverse);
|
|
183
|
-
function overload(node, parents) {
|
|
184
|
-
const parent = parents[parents.length - 1];
|
|
185
|
-
const index = parent ? parent.children.indexOf(node) : void 0;
|
|
186
|
-
return visitor(node, index, parent);
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
function findTabs(index, parent) {
|
|
190
|
-
const { children } = parent;
|
|
191
|
-
const tabs = [];
|
|
192
|
-
while (index++ < children.length) {
|
|
193
|
-
const child = children[index];
|
|
194
|
-
if (child && child.type === "code") {
|
|
195
|
-
const metaString = `${child.lang ?? ""} ${child.meta ?? ""}`.trim();
|
|
196
|
-
if (!metaString) break;
|
|
197
|
-
const [tabtitle] = metaString.match(new RegExp(`(?<=tab=("|'))(.*?)(?=("|'))`)) ?? [""];
|
|
198
|
-
if (!tabtitle) {
|
|
199
|
-
console.warn("Failed to parse tab title.");
|
|
200
|
-
break;
|
|
201
|
-
}
|
|
202
|
-
tabs.push({ title: tabtitle, lang: child.lang, value: child.value });
|
|
203
|
-
} else {
|
|
204
|
-
break;
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
return tabs;
|
|
208
|
-
}
|
|
209
|
-
const codeTabs = () => {
|
|
210
|
-
return (tree, file) => {
|
|
211
|
-
visit(tree, "code", (node, index, parent) => {
|
|
212
|
-
const metaString = `${node.lang ?? ""} ${node.meta ?? ""}`.trim();
|
|
213
|
-
if (!metaString) {
|
|
214
|
-
return;
|
|
215
|
-
}
|
|
216
|
-
const [tab] = metaString.match(new RegExp(`(?<=tab=("|'))(.*?)(?=("|'))`)) ?? [""];
|
|
217
|
-
if (!tab && metaString.includes("tab=")) {
|
|
218
|
-
file.message("Invalid tab title", node, "remark-code-title");
|
|
219
|
-
return;
|
|
220
|
-
}
|
|
221
|
-
if (!tab) {
|
|
222
|
-
return;
|
|
223
|
-
}
|
|
224
|
-
const tabs = [{ title: tab, lang: node.lang, value: node.value }, ...findTabs(index, parent)];
|
|
225
|
-
if (tabs.length > 1) {
|
|
226
|
-
const tabsNode = {
|
|
227
|
-
type: "code",
|
|
228
|
-
lang: "tabs",
|
|
229
|
-
value: JSON.stringify(tabs)
|
|
230
|
-
};
|
|
231
|
-
parent.children.splice(index, tabs.length, tabsNode);
|
|
232
|
-
return index + tabs.length - 1;
|
|
233
|
-
} else {
|
|
234
|
-
const titleNode = {
|
|
235
|
-
type: "paragraph",
|
|
236
|
-
data: {
|
|
237
|
-
hName: "div",
|
|
238
|
-
hProperties: {
|
|
239
|
-
"data-remark-code-title": true,
|
|
240
|
-
"data-language": node.lang
|
|
241
|
-
}
|
|
242
|
-
},
|
|
243
|
-
children: [{ type: "text", value: tab }]
|
|
244
|
-
};
|
|
245
|
-
parent.children.splice(index, 0, titleNode);
|
|
246
|
-
return index + 2;
|
|
247
|
-
}
|
|
248
|
-
});
|
|
249
|
-
};
|
|
250
|
-
};
|
|
251
|
-
export {
|
|
252
|
-
codeTabs as c,
|
|
253
|
-
visit as v
|
|
254
|
-
};
|
package/toFinite-Bc55msYj.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { t as toNumber } from "./toNumber-DPxy1FBy.js";
|
|
2
|
-
var INFINITY = 1 / 0, MAX_INTEGER = 17976931348623157e292;
|
|
3
|
-
function toFinite(value) {
|
|
4
|
-
if (!value) {
|
|
5
|
-
return value === 0 ? value : 0;
|
|
6
|
-
}
|
|
7
|
-
value = toNumber(value);
|
|
8
|
-
if (value === INFINITY || value === -INFINITY) {
|
|
9
|
-
var sign = value < 0 ? -1 : 1;
|
|
10
|
-
return sign * MAX_INTEGER;
|
|
11
|
-
}
|
|
12
|
-
return value === value ? value : 0;
|
|
13
|
-
}
|
|
14
|
-
export {
|
|
15
|
-
toFinite as t
|
|
16
|
-
};
|
package/toNumber-DPxy1FBy.js
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { i as isObject } from "./isObject-FTY-5JQX.js";
|
|
2
|
-
import { i as isSymbol } from "./isSymbol-Xd2FsJyp.js";
|
|
3
|
-
var reWhitespace = /\s/;
|
|
4
|
-
function trimmedEndIndex(string) {
|
|
5
|
-
var index = string.length;
|
|
6
|
-
while (index-- && reWhitespace.test(string.charAt(index))) {
|
|
7
|
-
}
|
|
8
|
-
return index;
|
|
9
|
-
}
|
|
10
|
-
var reTrimStart = /^\s+/;
|
|
11
|
-
function baseTrim(string) {
|
|
12
|
-
return string ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, "") : string;
|
|
13
|
-
}
|
|
14
|
-
var NAN = 0 / 0;
|
|
15
|
-
var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
|
|
16
|
-
var reIsBinary = /^0b[01]+$/i;
|
|
17
|
-
var reIsOctal = /^0o[0-7]+$/i;
|
|
18
|
-
var freeParseInt = parseInt;
|
|
19
|
-
function toNumber(value) {
|
|
20
|
-
if (typeof value == "number") {
|
|
21
|
-
return value;
|
|
22
|
-
}
|
|
23
|
-
if (isSymbol(value)) {
|
|
24
|
-
return NAN;
|
|
25
|
-
}
|
|
26
|
-
if (isObject(value)) {
|
|
27
|
-
var other = typeof value.valueOf == "function" ? value.valueOf() : value;
|
|
28
|
-
value = isObject(other) ? other + "" : other;
|
|
29
|
-
}
|
|
30
|
-
if (typeof value != "string") {
|
|
31
|
-
return value === 0 ? value : +value;
|
|
32
|
-
}
|
|
33
|
-
value = baseTrim(value);
|
|
34
|
-
var isBinary = reIsBinary.test(value);
|
|
35
|
-
return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value;
|
|
36
|
-
}
|
|
37
|
-
export {
|
|
38
|
-
toNumber as t
|
|
39
|
-
};
|