@splunk/react-ui 5.9.0 → 5.9.1
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/ButtonSimple.js +1 -1
- package/CHANGELOG.md +16 -0
- package/Code.js +177 -170
- package/ColumnLayout.js +69 -45
- package/Dropdown.js +74 -68
- package/LICENSE +1 -1
- package/MIGRATION.md +40 -0
- package/Markdown.js +331 -306
- package/Menu.js +2 -2
- package/Multiselect.js +59 -59
- package/Number.js +236 -242
- package/SimpleTable.d.ts +2 -0
- package/SimpleTable.js +433 -0
- package/SlidingPanels.js +224 -153
- package/SpotLight.d.ts +2 -0
- package/SpotLight.js +687 -0
- package/Table.js +1230 -1233
- package/docker-compose.yml +12 -18
- package/docs-llm/Avatar.md +2 -2
- package/docs-llm/Collapsible Panel.md +11 -57
- package/docs-llm/Column Layout.md +2 -2
- package/docs-llm/Divider.md +33 -0
- package/docs-llm/Message Bar.md +4 -1
- package/docs-llm/Multiselect.md +180 -159
- package/docs-llm/Table.md +7 -7
- package/docs-llm/Typography.md +1 -1
- package/docs-llm/llms.txt +1 -1
- package/package.json +9 -11
- package/test-runner-jest.config.js +4 -53
- package/types/src/CollapsiblePanel/docs/examples/Actions.d.ts +1 -1
- package/types/src/ColumnLayout/ColumnLayout.d.ts +2 -2
- package/types/src/Divider/docs/examples/VerticalWithAlignItems.d.ts +8 -0
- package/types/src/Markdown/Markdown.d.ts +14 -2
- package/types/src/Markdown/renderers/MarkdownTable.d.ts +2 -22
- package/types/src/Markdown/renderers/MarkdownWrapper.d.ts +11 -0
- package/types/src/Markdown/renderers/index.d.ts +3 -1
- package/types/src/Multiselect/Compact.d.ts +4 -0
- package/types/src/Multiselect/Multiselect.d.ts +4 -0
- package/types/src/Multiselect/docs/examples/LoadMoreWithSelectAll.d.ts +9 -0
- package/types/src/SelectBase/SelectBase.d.ts +4 -0
- package/types/src/SimpleTable/Body.d.ts +25 -0
- package/types/src/SimpleTable/Cell.d.ts +20 -0
- package/types/src/SimpleTable/Head.d.ts +20 -0
- package/types/src/SimpleTable/HeadCell.d.ts +20 -0
- package/types/src/SimpleTable/Row.d.ts +20 -0
- package/types/src/SimpleTable/SimpleTable.d.ts +37 -0
- package/types/src/SimpleTable/index.d.ts +3 -0
- package/types/src/SpotLight/SpotLight.d.ts +88 -0
- package/types/src/SpotLight/index.d.ts +2 -0
- package/types/src/Table/Row.d.ts +1 -1
- package/types/src/Table/Table.d.ts +1 -1
- package/types/src/Typography/Typography.d.ts +1 -1
- package/types/src/Multiselect/docs/examples/LoadMoreOnScrollBottom.d.ts +0 -7
package/Code.js
CHANGED
|
@@ -837,11 +837,11 @@
|
|
|
837
837
|
var b = m.inside;
|
|
838
838
|
var h = !!m.lookbehind;
|
|
839
839
|
var v = !!m.greedy;
|
|
840
|
-
var
|
|
840
|
+
var y = m.alias;
|
|
841
841
|
if (v && !m.pattern.global) {
|
|
842
842
|
// Without the global flag, lastIndex won't work
|
|
843
|
-
var
|
|
844
|
-
m.pattern = RegExp(m.pattern.source,
|
|
843
|
+
var E = m.pattern.toString().match(/[imsuy]*$/)[0];
|
|
844
|
+
m.pattern = RegExp(m.pattern.source, E + "g");
|
|
845
845
|
}
|
|
846
846
|
/** @type {RegExp} */ var S = m.pattern || m;
|
|
847
847
|
for (// iterate the token list and keep track of the current token/string position
|
|
@@ -911,7 +911,7 @@
|
|
|
911
911
|
k += L.length;
|
|
912
912
|
}
|
|
913
913
|
p(t, D, T);
|
|
914
|
-
var P = new i(d, b ? s.tokenize(_, b) : _,
|
|
914
|
+
var P = new i(d, b ? s.tokenize(_, b) : _, y, _);
|
|
915
915
|
A = c(t, D, P);
|
|
916
916
|
if (F) {
|
|
917
917
|
c(t, A, F);
|
|
@@ -2283,8 +2283,8 @@
|
|
|
2283
2283
|
var b = t(/<<0>>(?:\s*(?:\?\s*)?<<1>>)*(?:\s*\?)?/.source, [ f, m ]);
|
|
2284
2284
|
var h = t(/[^,()<>[\];=+\-*/%&|^]|<<0>>|<<1>>|<<2>>/.source, [ c, p, m ]);
|
|
2285
2285
|
var v = t(/\(<<0>>+(?:,<<0>>+)+\)/.source, [ h ]);
|
|
2286
|
-
var
|
|
2287
|
-
var
|
|
2286
|
+
var y = t(/(?:<<0>>|<<1>>)(?:\s*(?:\?\s*)?<<2>>)*(?:\s*\?)?/.source, [ v, f, m ]);
|
|
2287
|
+
var E = {
|
|
2288
2288
|
keyword: o,
|
|
2289
2289
|
punctuation: /[<>()?,.:[\]]/
|
|
2290
2290
|
};
|
|
@@ -2310,13 +2310,13 @@
|
|
|
2310
2310
|
// using static System.Math;
|
|
2311
2311
|
pattern: n(/(\busing\s+static\s+)<<0>>(?=\s*;)/.source, [ f ]),
|
|
2312
2312
|
lookbehind: true,
|
|
2313
|
-
inside:
|
|
2313
|
+
inside: E
|
|
2314
2314
|
}, {
|
|
2315
2315
|
// Using alias (type)
|
|
2316
2316
|
// using Project = PC.MyCompany.Project;
|
|
2317
|
-
pattern: n(/(\busing\s+<<0>>\s*=\s*)<<1>>(?=\s*;)/.source, [ d,
|
|
2317
|
+
pattern: n(/(\busing\s+<<0>>\s*=\s*)<<1>>(?=\s*;)/.source, [ d, y ]),
|
|
2318
2318
|
lookbehind: true,
|
|
2319
|
-
inside:
|
|
2319
|
+
inside: E
|
|
2320
2320
|
}, {
|
|
2321
2321
|
// Using alias (alias)
|
|
2322
2322
|
// using Project = PC.MyCompany.Project;
|
|
@@ -2328,14 +2328,14 @@
|
|
|
2328
2328
|
// interface Foo<out A, B>
|
|
2329
2329
|
pattern: n(/(\b<<0>>\s+)<<1>>/.source, [ i, g ]),
|
|
2330
2330
|
lookbehind: true,
|
|
2331
|
-
inside:
|
|
2331
|
+
inside: E
|
|
2332
2332
|
}, {
|
|
2333
2333
|
// Single catch exception declaration
|
|
2334
2334
|
// catch(Foo)
|
|
2335
2335
|
// (things like catch(Foo e) is covered by variable declaration)
|
|
2336
2336
|
pattern: n(/(\bcatch\s*\(\s*)<<0>>/.source, [ f ]),
|
|
2337
2337
|
lookbehind: true,
|
|
2338
|
-
inside:
|
|
2338
|
+
inside: E
|
|
2339
2339
|
}, {
|
|
2340
2340
|
// Name of the type parameter of generic constraints
|
|
2341
2341
|
// where Foo : class
|
|
@@ -2347,12 +2347,12 @@
|
|
|
2347
2347
|
// (things like if(a is Foo b) is covered by variable declaration)
|
|
2348
2348
|
pattern: n(/(\b(?:is(?:\s+not)?|as)\s+)<<0>>/.source, [ b ]),
|
|
2349
2349
|
lookbehind: true,
|
|
2350
|
-
inside:
|
|
2350
|
+
inside: E
|
|
2351
2351
|
}, {
|
|
2352
2352
|
// Variable, field and parameter declaration
|
|
2353
2353
|
// (Foo bar, Bar baz, Foo[,,] bay, Foo<Bar, FooBar<Bar>> bax)
|
|
2354
|
-
pattern: n(/\b<<0>>(?=\s+(?!<<1>>|with\s*\{)<<2>>(?:\s*[=,;:{)\]]|\s+(?:in|when)\b))/.source, [
|
|
2355
|
-
inside:
|
|
2354
|
+
pattern: n(/\b<<0>>(?=\s+(?!<<1>>|with\s*\{)<<2>>(?:\s*[=,;:{)\]]|\s+(?:in|when)\b))/.source, [ y, u, d ]),
|
|
2355
|
+
inside: E
|
|
2356
2356
|
} ],
|
|
2357
2357
|
keyword: o,
|
|
2358
2358
|
// https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/language-specification/lexical-structure#literals
|
|
@@ -2388,21 +2388,21 @@
|
|
|
2388
2388
|
pattern: n(/(\b(?:default|sizeof|typeof)\s*\(\s*(?!\s))(?:[^()\s]|\s(?!\s)|<<0>>)*(?=\s*\))/.source, [ p ]),
|
|
2389
2389
|
lookbehind: true,
|
|
2390
2390
|
alias: "class-name",
|
|
2391
|
-
inside:
|
|
2391
|
+
inside: E
|
|
2392
2392
|
},
|
|
2393
2393
|
"return-type": {
|
|
2394
2394
|
// Foo<Bar> ForBar(); Foo IFoo.Bar() => 0
|
|
2395
2395
|
// int this[int index] => 0; T IReadOnlyList<T>.this[int index] => this[index];
|
|
2396
2396
|
// int Foo => 0; int Foo { get; set } = 0;
|
|
2397
|
-
pattern: n(/<<0>>(?=\s+(?:<<1>>\s*(?:=>|[({]|\.\s*this\s*\[)|this\s*\[))/.source, [
|
|
2398
|
-
inside:
|
|
2397
|
+
pattern: n(/<<0>>(?=\s+(?:<<1>>\s*(?:=>|[({]|\.\s*this\s*\[)|this\s*\[))/.source, [ y, f ]),
|
|
2398
|
+
inside: E,
|
|
2399
2399
|
alias: "class-name"
|
|
2400
2400
|
},
|
|
2401
2401
|
"constructor-invocation": {
|
|
2402
2402
|
// new List<Foo<Bar[]>> { }
|
|
2403
|
-
pattern: n(/(\bnew\s+)<<0>>(?=\s*[[({])/.source, [
|
|
2403
|
+
pattern: n(/(\bnew\s+)<<0>>(?=\s*[[({])/.source, [ y ]),
|
|
2404
2404
|
lookbehind: true,
|
|
2405
|
-
inside:
|
|
2405
|
+
inside: E,
|
|
2406
2406
|
alias: "class-name"
|
|
2407
2407
|
},
|
|
2408
2408
|
/*'explicit-implementation': {
|
|
@@ -2419,7 +2419,7 @@
|
|
|
2419
2419
|
generic: {
|
|
2420
2420
|
pattern: RegExp(c),
|
|
2421
2421
|
alias: "class-name",
|
|
2422
|
-
inside:
|
|
2422
|
+
inside: E
|
|
2423
2423
|
}
|
|
2424
2424
|
}
|
|
2425
2425
|
},
|
|
@@ -2427,7 +2427,7 @@
|
|
|
2427
2427
|
// The list of types inherited or of generic constraints
|
|
2428
2428
|
// class Foo<F> : Bar, IList<FooBar>
|
|
2429
2429
|
// where F : Bar, IList<int>
|
|
2430
|
-
pattern: n(/\b((?:<<0>>\s+<<1>>|record\s+<<1>>\s*<<5>>|where\s+<<2>>)\s*:\s*)(?:<<3>>|<<4>>|<<1>>\s*<<5>>|<<6>>)(?:\s*,\s*(?:<<3>>|<<4>>|<<6>>))*(?=\s*(?:where|[{;]|=>|$))/.source, [ i, g, d,
|
|
2430
|
+
pattern: n(/\b((?:<<0>>\s+<<1>>|record\s+<<1>>\s*<<5>>|where\s+<<2>>)\s*:\s*)(?:<<3>>|<<4>>|<<1>>\s*<<5>>|<<6>>)(?:\s*,\s*(?:<<3>>|<<4>>|<<6>>))*(?=\s*(?:where|[{;]|=>|$))/.source, [ i, g, d, y, o.source, p, /\bnew\s*\(\s*\)/.source ]),
|
|
2431
2431
|
lookbehind: true,
|
|
2432
2432
|
inside: {
|
|
2433
2433
|
"record-arguments": {
|
|
@@ -2438,9 +2438,9 @@
|
|
|
2438
2438
|
},
|
|
2439
2439
|
keyword: o,
|
|
2440
2440
|
"class-name": {
|
|
2441
|
-
pattern: RegExp(
|
|
2441
|
+
pattern: RegExp(y),
|
|
2442
2442
|
greedy: true,
|
|
2443
|
-
inside:
|
|
2443
|
+
inside: E
|
|
2444
2444
|
},
|
|
2445
2445
|
punctuation: /[,()]/
|
|
2446
2446
|
}
|
|
@@ -2741,7 +2741,7 @@
|
|
|
2741
2741
|
n.r(r);
|
|
2742
2742
|
// EXPORTS
|
|
2743
2743
|
n.d(r, {
|
|
2744
|
-
default: () => /* reexport */
|
|
2744
|
+
default: () => /* reexport */ ie
|
|
2745
2745
|
});
|
|
2746
2746
|
// CONCATENATED MODULE: external "react"
|
|
2747
2747
|
const e = require("react");
|
|
@@ -2767,73 +2767,78 @@
|
|
|
2767
2767
|
// CONCATENATED MODULE: external "@splunk/react-ui/useResizeObserver"
|
|
2768
2768
|
const b = require("@splunk/react-ui/useResizeObserver");
|
|
2769
2769
|
var h = n.n(b);
|
|
2770
|
+
// CONCATENATED MODULE: external "@splunk/ui-utils/logger"
|
|
2771
|
+
const v = require("@splunk/ui-utils/logger");
|
|
2770
2772
|
// CONCATENATED MODULE: external "styled-components"
|
|
2771
|
-
const
|
|
2772
|
-
var E = n.n(
|
|
2773
|
+
const y = require("styled-components");
|
|
2774
|
+
var E = n.n(y);
|
|
2773
2775
|
// CONCATENATED MODULE: external "@splunk/themes"
|
|
2774
|
-
const
|
|
2776
|
+
const S = require("@splunk/themes");
|
|
2775
2777
|
// CONCATENATED MODULE: ./src/Code/CodeStyles.ts
|
|
2776
|
-
var
|
|
2777
|
-
var
|
|
2778
|
-
var
|
|
2778
|
+
var A = "lineHeightSpacious";
|
|
2779
|
+
var k = "spacingLarge";
|
|
2780
|
+
var x = E().code.withConfig({
|
|
2779
2781
|
displayName: "CodeStyles__StyledCode",
|
|
2780
2782
|
componentId: "sc-1eq4k68-0"
|
|
2781
|
-
})([ "font-family:", ";position:relative;z-index:1;", ";" ],
|
|
2783
|
+
})([ "font-family:", ";position:relative;z-index:1;", ";" ], S.variables.monoFontFamily, (function(e) {
|
|
2782
2784
|
var t = e.$isPlaintext;
|
|
2783
|
-
return !t && (0,
|
|
2785
|
+
return !t && (0, S.pick)({
|
|
2786
|
+
light: (0, y.css)([ "color:", ";" ], S.variables.syntaxBlack),
|
|
2787
|
+
dark: (0, y.css)([ "color:", ";" ], S.variables.syntaxWhite)
|
|
2788
|
+
});
|
|
2784
2789
|
}));
|
|
2785
|
-
var
|
|
2790
|
+
var T = E().pre.withConfig({
|
|
2786
2791
|
displayName: "CodeStyles__StyledPre",
|
|
2787
2792
|
componentId: "sc-1eq4k68-1"
|
|
2788
|
-
})([ "", ";", ";line-height:", ";position:relative;text-align:left;tab-size:4;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;hyphens:none;overflow-x:auto;&:focus-visible{box-shadow:", ";}", " ", ";" ],
|
|
2793
|
+
})([ "", ";", ";line-height:", ";position:relative;text-align:left;tab-size:4;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;hyphens:none;overflow-x:auto;&:focus-visible{box-shadow:", ";}", " ", ";" ], S.mixins.reset("grid"), S.mixins.typography("monoBody"), S.variables[A], S.variables.focusShadow, (function(e) {
|
|
2789
2794
|
var t = e.$showLineNumbers, n = e.$counterReset;
|
|
2790
|
-
return t && (0,
|
|
2795
|
+
return t && (0, y.css)([ "grid-template-columns:min-content auto;counter-reset:linenumber ", ";" ], n);
|
|
2791
2796
|
}), (function(e) {
|
|
2792
2797
|
var t = e.$containerAppearance;
|
|
2793
|
-
return t === "none" ? (0,
|
|
2794
|
-
|
|
2798
|
+
return t === "none" ? (0, y.css)([ "gap:", ";" ], S.variables.spacingMedium) : (0,
|
|
2799
|
+
y.css)([ "background-color:", ";border-radius:", ";", "{margin:", ";}" ], S.variables.neutral50, S.variables.borderRadius, /* sc-sel */ x, S.variables[k]);
|
|
2795
2800
|
}));
|
|
2796
|
-
var
|
|
2801
|
+
var I = E().span.withConfig({
|
|
2797
2802
|
displayName: "CodeStyles__StyledIndent",
|
|
2798
2803
|
componentId: "sc-1eq4k68-2"
|
|
2799
|
-
})([ "&:not(:last-child){background-image:linear-gradient( to left,", " 1px,transparent 1px,transparent );}" ],
|
|
2800
|
-
var
|
|
2801
|
-
comment:
|
|
2802
|
-
prolog:
|
|
2803
|
-
doctype:
|
|
2804
|
-
cdata:
|
|
2805
|
-
punctuation:
|
|
2806
|
-
property:
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
|
|
2814
|
-
selector:
|
|
2815
|
-
"attr-name":
|
|
2816
|
-
string:
|
|
2817
|
-
char:
|
|
2818
|
-
builtin:
|
|
2819
|
-
inserted:
|
|
2820
|
-
operator:
|
|
2821
|
-
entity:
|
|
2822
|
-
url:
|
|
2823
|
-
atrule:
|
|
2824
|
-
"attr-value":
|
|
2825
|
-
keyword:
|
|
2826
|
-
function:
|
|
2827
|
-
regex:
|
|
2828
|
-
important:
|
|
2829
|
-
variable:
|
|
2804
|
+
})([ "&:not(:last-child){background-image:linear-gradient( to left,", " 1px,transparent 1px,transparent );}" ], S.variables.syntaxGray);
|
|
2805
|
+
var R = {
|
|
2806
|
+
comment: S.variables.syntaxGray,
|
|
2807
|
+
prolog: S.variables.syntaxGray,
|
|
2808
|
+
doctype: S.variables.syntaxGray,
|
|
2809
|
+
cdata: S.variables.syntaxGray,
|
|
2810
|
+
punctuation: S.variables.syntaxGray,
|
|
2811
|
+
property: S.variables.syntaxPurple,
|
|
2812
|
+
constant: S.variables.syntaxPurple,
|
|
2813
|
+
symbol: S.variables.syntaxPurple,
|
|
2814
|
+
deleted: S.variables.syntaxPurple,
|
|
2815
|
+
key: S.variables.syntaxPurple,
|
|
2816
|
+
tag: S.variables.syntaxPurple,
|
|
2817
|
+
boolean: S.variables.syntaxGreen,
|
|
2818
|
+
number: S.variables.syntaxGreen,
|
|
2819
|
+
selector: S.variables.syntaxGreen,
|
|
2820
|
+
"attr-name": S.variables.syntaxGreen,
|
|
2821
|
+
string: S.variables.syntaxGreen,
|
|
2822
|
+
char: S.variables.syntaxGreen,
|
|
2823
|
+
builtin: S.variables.syntaxGreen,
|
|
2824
|
+
inserted: S.variables.syntaxGreen,
|
|
2825
|
+
operator: S.variables.syntaxBrown,
|
|
2826
|
+
entity: S.variables.syntaxBrown,
|
|
2827
|
+
url: S.variables.syntaxBrown,
|
|
2828
|
+
atrule: S.variables.syntaxBlue,
|
|
2829
|
+
"attr-value": S.variables.syntaxBlue,
|
|
2830
|
+
keyword: S.variables.syntaxBlue,
|
|
2831
|
+
function: S.variables.syntaxRed,
|
|
2832
|
+
regex: S.variables.syntaxOrange,
|
|
2833
|
+
important: S.variables.syntaxOrange,
|
|
2834
|
+
variable: S.variables.syntaxOrange
|
|
2830
2835
|
};
|
|
2831
|
-
var
|
|
2836
|
+
var w = E().span.withConfig({
|
|
2832
2837
|
displayName: "CodeStyles__StyledToken",
|
|
2833
2838
|
componentId: "sc-1eq4k68-3"
|
|
2834
2839
|
})([ "color:", ";cursor:", ";opacity:", ";font-style:", ";font-weight:", ";" ], (function(e) {
|
|
2835
2840
|
var t = e.partType;
|
|
2836
|
-
return
|
|
2841
|
+
return R[t];
|
|
2837
2842
|
}), (function(e) {
|
|
2838
2843
|
var t = e.partType;
|
|
2839
2844
|
return t === "entity" ? "help" : null;
|
|
@@ -2845,42 +2850,42 @@
|
|
|
2845
2850
|
return t === "italic" ? "italic" : null;
|
|
2846
2851
|
}), (function(e) {
|
|
2847
2852
|
var t = e.partType;
|
|
2848
|
-
return t === "important" || t === "bold" ?
|
|
2853
|
+
return t === "important" || t === "bold" ? S.variables.fontWeightBold : null;
|
|
2849
2854
|
}));
|
|
2850
2855
|
// CONCATENATED MODULE: ./src/Code/LineHighlightsStyles.ts
|
|
2851
|
-
var
|
|
2856
|
+
var N = E().div.withConfig({
|
|
2852
2857
|
displayName: "LineHighlightsStyles__StyledLineHighlight",
|
|
2853
2858
|
componentId: "sc-1x2b02z-0"
|
|
2854
|
-
})([ "position:absolute;left:0;height:1lh;background:", ";border-left:2px solid ", ";pointer-events:none;line-height:inherit;width:", "px;", ";" ],
|
|
2859
|
+
})([ "position:absolute;left:0;height:1lh;background:", ";border-left:2px solid ", ";pointer-events:none;line-height:inherit;width:", "px;", ";" ], S.variables.notificationColorInfoWeak, S.variables.notificationColorInfo, (function(e) {
|
|
2855
2860
|
var t = e.$width;
|
|
2856
2861
|
return t;
|
|
2857
2862
|
}), (function(e) {
|
|
2858
2863
|
var t = e.$containerAppearance, n = e.$lineNum;
|
|
2859
|
-
return t === "none" ? (0,
|
|
2860
|
-
|
|
2864
|
+
return t === "none" ? (0, y.css)([ "top:calc(", " * ", "em);" ], n - 1, S.variables[A]) : (0,
|
|
2865
|
+
y.css)([ "top:calc( ", " * ", "em + ", " );" ], n - 1, S.variables[A], S.variables[k]);
|
|
2861
2866
|
}));
|
|
2862
2867
|
// CONCATENATED MODULE: ./src/Code/LineHighlights.tsx
|
|
2863
|
-
function
|
|
2864
|
-
return
|
|
2868
|
+
function O(e, t) {
|
|
2869
|
+
return D(e) || C(e, t) || L(e, t) || _();
|
|
2865
2870
|
}
|
|
2866
|
-
function
|
|
2871
|
+
function _() {
|
|
2867
2872
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
2868
2873
|
}
|
|
2869
|
-
function
|
|
2874
|
+
function L(e, t) {
|
|
2870
2875
|
if (e) {
|
|
2871
|
-
if ("string" == typeof e) return
|
|
2876
|
+
if ("string" == typeof e) return F(e, t);
|
|
2872
2877
|
var n = {}.toString.call(e).slice(8, -1);
|
|
2873
|
-
return "Object" === n && e.constructor && (n = e.constructor.name), "Map" === n || "Set" === n ? Array.from(e) : "Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ?
|
|
2878
|
+
return "Object" === n && e.constructor && (n = e.constructor.name), "Map" === n || "Set" === n ? Array.from(e) : "Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? F(e, t) : void 0;
|
|
2874
2879
|
}
|
|
2875
2880
|
}
|
|
2876
|
-
function
|
|
2881
|
+
function F(e, t) {
|
|
2877
2882
|
(null == t || t > e.length) && (t = e.length);
|
|
2878
2883
|
for (var n = 0, r = Array(t); n < t; n++) {
|
|
2879
2884
|
r[n] = e[n];
|
|
2880
2885
|
}
|
|
2881
2886
|
return r;
|
|
2882
2887
|
}
|
|
2883
|
-
function
|
|
2888
|
+
function C(e, t) {
|
|
2884
2889
|
var n = null == e ? null : "undefined" != typeof Symbol && e[Symbol.iterator] || e["@@iterator"];
|
|
2885
2890
|
if (null != n) {
|
|
2886
2891
|
var r, a, s, i, o = [], l = !0, u = !1;
|
|
@@ -2902,21 +2907,21 @@
|
|
|
2902
2907
|
return o;
|
|
2903
2908
|
}
|
|
2904
2909
|
}
|
|
2905
|
-
function
|
|
2910
|
+
function D(e) {
|
|
2906
2911
|
if (Array.isArray(e)) return e;
|
|
2907
2912
|
}
|
|
2908
2913
|
// parseHighlightLines will turn a string like "2,4-5" into an array of ranges like [[2, 2], [4, 5]]
|
|
2909
|
-
var
|
|
2914
|
+
var P = function e(t) {
|
|
2910
2915
|
return t.replace(/\s+/g, "").split(",").filter(Boolean).map((function(e) {
|
|
2911
|
-
var t = e.split("-").map(Number), n =
|
|
2916
|
+
var t = e.split("-").map(Number), n = O(t, 2), r = n[0], a = n[1];
|
|
2912
2917
|
return [ r, a || r ];
|
|
2913
2918
|
}));
|
|
2914
2919
|
};
|
|
2915
2920
|
// Flatten the array of ranges into a single array of line numbers
|
|
2916
2921
|
// example: [[2, 2], [4, 5]] will become [2, 4, 5]
|
|
2917
|
-
var
|
|
2922
|
+
var $ = function e(t) {
|
|
2918
2923
|
var n = t.map((function(e) {
|
|
2919
|
-
var t =
|
|
2924
|
+
var t = O(e, 2), n = t[0], r = t[1];
|
|
2920
2925
|
return Array.from({
|
|
2921
2926
|
length: r - n + 1
|
|
2922
2927
|
}, (function(e, t) {
|
|
@@ -2928,14 +2933,14 @@
|
|
|
2928
2933
|
return Array.from(new Set(n));
|
|
2929
2934
|
// Remove duplicates
|
|
2930
2935
|
};
|
|
2931
|
-
var
|
|
2936
|
+
var U = function e(n) {
|
|
2932
2937
|
var r = n.containerAppearance, a = n.highlight, s = n.width;
|
|
2933
|
-
var i =
|
|
2934
|
-
var o =
|
|
2938
|
+
var i = P(a);
|
|
2939
|
+
var o = $(i);
|
|
2935
2940
|
|
|
2936
2941
|
return t().createElement(t().Fragment, null, o.map((function(e) {
|
|
2937
2942
|
|
|
2938
|
-
return t().createElement(
|
|
2943
|
+
return t().createElement(N, {
|
|
2939
2944
|
key: e,
|
|
2940
2945
|
className: "line-highlight",
|
|
2941
2946
|
"aria-hidden": "true",
|
|
@@ -2945,21 +2950,21 @@
|
|
|
2945
2950
|
});
|
|
2946
2951
|
})));
|
|
2947
2952
|
};
|
|
2948
|
-
/* harmony default export */ const
|
|
2953
|
+
/* harmony default export */ const B = U;
|
|
2949
2954
|
// CONCATENATED MODULE: ./src/Code/LineNumbersStyles.ts
|
|
2950
|
-
var
|
|
2955
|
+
var M = E().span.withConfig({
|
|
2951
2956
|
displayName: "LineNumbersStyles__StyledLineNumberRows",
|
|
2952
2957
|
componentId: "sc-1h4k3dh-0"
|
|
2953
2958
|
})([ "pointer-events:none;user-select:none;", ";& > span{display:block;counter-increment:linenumber;position:relative;z-index:1;&::before{display:block;content:counter(linenumber);color:", ";text-align:right;", "}}" ], (function(e) {
|
|
2954
2959
|
var t = e.$containerAppearance;
|
|
2955
|
-
return t === "none" ? (0,
|
|
2956
|
-
|
|
2957
|
-
}),
|
|
2960
|
+
return t === "none" ? (0, y.css)([ "border-right:1px solid ", ";z-index:1;" ], S.variables.borderColor) : (0,
|
|
2961
|
+
y.css)([ "padding:", ";background-color:", ";" ], S.variables[k], S.variables.neutral200);
|
|
2962
|
+
}), S.variables.contentColorDefault, (function(e) {
|
|
2958
2963
|
var t = e.$containerAppearance;
|
|
2959
|
-
return t === "none" && (0,
|
|
2964
|
+
return t === "none" && (0, y.css)([ "padding-inline-end:", ";" ], S.variables.spacingSmall);
|
|
2960
2965
|
}));
|
|
2961
2966
|
// CONCATENATED MODULE: ./src/Code/LineNumbers.tsx
|
|
2962
|
-
function
|
|
2967
|
+
function G(e) {
|
|
2963
2968
|
var n = e.containerAppearance, r = n === void 0 ? "none" : n, a = e.value, s = a === void 0 ? "" : a;
|
|
2964
2969
|
// Use a regex to see how many lines there are in the value, then output an
|
|
2965
2970
|
// empty span for each line. The numbers themselves are handled by the CSS counter.
|
|
@@ -2974,15 +2979,15 @@
|
|
|
2974
2979
|
});
|
|
2975
2980
|
}));
|
|
2976
2981
|
|
|
2977
|
-
return t().createElement(
|
|
2982
|
+
return t().createElement(M, {
|
|
2978
2983
|
$containerAppearance: r,
|
|
2979
2984
|
"aria-hidden": true
|
|
2980
2985
|
}, l);
|
|
2981
2986
|
}
|
|
2982
|
-
/* harmony default export */ const
|
|
2987
|
+
/* harmony default export */ const j = G;
|
|
2983
2988
|
// EXTERNAL MODULE: ./src/Code/prism/prism.empty
|
|
2984
|
-
var
|
|
2985
|
-
var
|
|
2989
|
+
var H = n(74);
|
|
2990
|
+
var z = n.n(H);
|
|
2986
2991
|
// CONCATENATED MODULE: ./src/utils/updateReactRef.ts
|
|
2987
2992
|
/**
|
|
2988
2993
|
* Updates a React ref. Callback refs and object refs (from `createRef` and `useRef`) are supported.
|
|
@@ -2990,7 +2995,7 @@
|
|
|
2990
2995
|
* @param ref - The React callback or object ref. Can be `null` or `undefined`.
|
|
2991
2996
|
* @param current - The new value of the ref.
|
|
2992
2997
|
*/
|
|
2993
|
-
function
|
|
2998
|
+
function W(e, t) {
|
|
2994
2999
|
if (e) {
|
|
2995
3000
|
if (typeof e === "function") {
|
|
2996
3001
|
e(t);
|
|
@@ -3003,8 +3008,8 @@
|
|
|
3003
3008
|
}
|
|
3004
3009
|
}
|
|
3005
3010
|
// CONCATENATED MODULE: ./src/Code/Code.tsx
|
|
3006
|
-
function
|
|
3007
|
-
return
|
|
3011
|
+
function q() {
|
|
3012
|
+
return q = Object.assign ? Object.assign.bind() : function(e) {
|
|
3008
3013
|
for (var t = 1; t < arguments.length; t++) {
|
|
3009
3014
|
var n = arguments[t];
|
|
3010
3015
|
for (var r in n) {
|
|
@@ -3012,29 +3017,29 @@
|
|
|
3012
3017
|
}
|
|
3013
3018
|
}
|
|
3014
3019
|
return e;
|
|
3015
|
-
},
|
|
3020
|
+
}, q.apply(null, arguments);
|
|
3016
3021
|
}
|
|
3017
3022
|
function Y(e, t) {
|
|
3018
|
-
return
|
|
3023
|
+
return J(e) || V(e, t) || K(e, t) || X();
|
|
3019
3024
|
}
|
|
3020
|
-
function
|
|
3025
|
+
function X() {
|
|
3021
3026
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
3022
3027
|
}
|
|
3023
|
-
function
|
|
3028
|
+
function K(e, t) {
|
|
3024
3029
|
if (e) {
|
|
3025
|
-
if ("string" == typeof e) return
|
|
3030
|
+
if ("string" == typeof e) return Z(e, t);
|
|
3026
3031
|
var n = {}.toString.call(e).slice(8, -1);
|
|
3027
|
-
return "Object" === n && e.constructor && (n = e.constructor.name), "Map" === n || "Set" === n ? Array.from(e) : "Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ?
|
|
3032
|
+
return "Object" === n && e.constructor && (n = e.constructor.name), "Map" === n || "Set" === n ? Array.from(e) : "Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? Z(e, t) : void 0;
|
|
3028
3033
|
}
|
|
3029
3034
|
}
|
|
3030
|
-
function
|
|
3035
|
+
function Z(e, t) {
|
|
3031
3036
|
(null == t || t > e.length) && (t = e.length);
|
|
3032
3037
|
for (var n = 0, r = Array(t); n < t; n++) {
|
|
3033
3038
|
r[n] = e[n];
|
|
3034
3039
|
}
|
|
3035
3040
|
return r;
|
|
3036
3041
|
}
|
|
3037
|
-
function
|
|
3042
|
+
function V(e, t) {
|
|
3038
3043
|
var n = null == e ? null : "undefined" != typeof Symbol && e[Symbol.iterator] || e["@@iterator"];
|
|
3039
3044
|
if (null != n) {
|
|
3040
3045
|
var r, a, s, i, o = [], l = !0, u = !1;
|
|
@@ -3056,12 +3061,12 @@
|
|
|
3056
3061
|
return o;
|
|
3057
3062
|
}
|
|
3058
3063
|
}
|
|
3059
|
-
function
|
|
3064
|
+
function J(e) {
|
|
3060
3065
|
if (Array.isArray(e)) return e;
|
|
3061
3066
|
}
|
|
3062
|
-
function
|
|
3067
|
+
function Q(e, t) {
|
|
3063
3068
|
if (null == e) return {};
|
|
3064
|
-
var n, r, a =
|
|
3069
|
+
var n, r, a = ee(e, t);
|
|
3065
3070
|
if (Object.getOwnPropertySymbols) {
|
|
3066
3071
|
var s = Object.getOwnPropertySymbols(e);
|
|
3067
3072
|
for (r = 0; r < s.length; r++) {
|
|
@@ -3070,7 +3075,7 @@
|
|
|
3070
3075
|
}
|
|
3071
3076
|
return a;
|
|
3072
3077
|
}
|
|
3073
|
-
function
|
|
3078
|
+
function ee(e, t) {
|
|
3074
3079
|
if (null == e) return {};
|
|
3075
3080
|
var n = {};
|
|
3076
3081
|
for (var r in e) {
|
|
@@ -3085,74 +3090,76 @@
|
|
|
3085
3090
|
// auto formatting. The import below points to an empty file which is replaced at build
|
|
3086
3091
|
// time, see ./prism/build-isolated-prism.js for details.
|
|
3087
3092
|
// typed as 'prismjs'
|
|
3088
|
-
var
|
|
3089
|
-
function
|
|
3093
|
+
var te = [ "bash", "c", "clike", "cpp", "cs", "csharp", "css", "html", "javascript", "js", "json", "jsx", "markup", "mathml", "plain", "plaintext", "powershell", "py", "python", "sh", "shell", "splunk-spl", "sql", "svg", "text", "ts", "tsx", "txt", "typescript", "xml", "yaml", "yml" ];
|
|
3094
|
+
function ne(e) {
|
|
3090
3095
|
return [ "plain", "plaintext", "text", "txt" ].includes(e);
|
|
3091
3096
|
}
|
|
3092
|
-
function
|
|
3093
|
-
if (
|
|
3094
|
-
return
|
|
3097
|
+
function re(e, t) {
|
|
3098
|
+
if (ne(t)) {
|
|
3099
|
+
return z().tokenize(e, {});
|
|
3095
3100
|
}
|
|
3096
|
-
return
|
|
3101
|
+
return z().tokenize(e, z().languages[t]);
|
|
3097
3102
|
}
|
|
3098
|
-
var
|
|
3103
|
+
var ae = {
|
|
3099
3104
|
containerAppearance: m().oneOf([ "none", "section" ]),
|
|
3100
3105
|
elementRef: m().oneOfType([ m().func, m().object ]),
|
|
3101
3106
|
indentChars: m().number,
|
|
3102
|
-
language: m().oneOf(
|
|
3103
|
-
languageFallback: m().oneOf(
|
|
3107
|
+
language: m().oneOf(te),
|
|
3108
|
+
languageFallback: m().oneOf(te),
|
|
3104
3109
|
lineHighlights: m().string,
|
|
3105
3110
|
lineNumberStart: m().number,
|
|
3106
3111
|
showIndentGuide: m().bool,
|
|
3107
3112
|
showLineNumbers: m().bool,
|
|
3108
3113
|
value: m().string
|
|
3109
3114
|
};
|
|
3110
|
-
function
|
|
3111
|
-
var r = n.containerAppearance, a = r === void 0 ? "none" : r, i = n.elementRef, l = n.indentChars, c = l === void 0 ? 4 : l, d = n.language, f = n.languageFallback, m = f === void 0 ? "javascript" : f, b = n.lineHighlights,
|
|
3115
|
+
function se(n) {
|
|
3116
|
+
var r = n.containerAppearance, a = r === void 0 ? "none" : r, i = n.elementRef, l = n.indentChars, c = l === void 0 ? 4 : l, d = n.language, f = n.languageFallback, m = f === void 0 ? "javascript" : f, b = n.lineHighlights, y = n.lineNumberStart, E = n.showIndentGuide, S = E === void 0 ? true : E, A = n.showLineNumbers, k = n.value, R = k === void 0 ? "" : k, N = Q(n, [ "containerAppearance", "elementRef", "indentChars", "language", "languageFallback", "lineHighlights", "lineNumberStart", "showIndentGuide", "showLineNumbers", "value" ]);
|
|
3112
3117
|
// @docs-props-type CodePropsBase
|
|
3113
|
-
var
|
|
3114
|
-
var
|
|
3115
|
-
var
|
|
3116
|
-
var
|
|
3117
|
-
|
|
3118
|
-
|
|
3118
|
+
var O = (0, e.useRef)(null);
|
|
3119
|
+
var _ = (0, e.useState)(undefined), L = Y(_, 2), F = L[0], C = L[1];
|
|
3120
|
+
var D = h()(O), P = D.width, $ = D.height;
|
|
3121
|
+
var U = (0, e.useCallback)((function(e) {
|
|
3122
|
+
W(O, e);
|
|
3123
|
+
W(i, e);
|
|
3119
3124
|
}), [ i ]);
|
|
3120
3125
|
(0, e.useEffect)((function() {
|
|
3121
|
-
var e =
|
|
3126
|
+
var e = O.current;
|
|
3122
3127
|
if (e) {
|
|
3123
|
-
var t = e.scrollHeight > Math.round(
|
|
3124
|
-
var n = e.scrollWidth > Math.round(
|
|
3128
|
+
var t = e.scrollHeight > Math.round($);
|
|
3129
|
+
var n = e.scrollWidth > Math.round(P);
|
|
3125
3130
|
var r = t || n;
|
|
3126
|
-
|
|
3131
|
+
C(r ? 0 : undefined);
|
|
3127
3132
|
}
|
|
3128
|
-
}), [
|
|
3129
|
-
var
|
|
3130
|
-
var
|
|
3133
|
+
}), [ O, P, $ ]);
|
|
3134
|
+
var M = p()(" ", c);
|
|
3135
|
+
var G = function e(n) {
|
|
3131
3136
|
var r = Math.floor(n / c);
|
|
3132
3137
|
var a = n % c;
|
|
3133
3138
|
var s = g()(r, (function(e) {
|
|
3134
3139
|
|
|
3135
|
-
return t().createElement(
|
|
3140
|
+
return t().createElement(I, {
|
|
3136
3141
|
key: e.toString()
|
|
3137
|
-
},
|
|
3142
|
+
}, M);
|
|
3138
3143
|
}));
|
|
3139
3144
|
if (a) {
|
|
3140
3145
|
s.push(p()(" ", a));
|
|
3141
3146
|
}
|
|
3142
3147
|
return s;
|
|
3143
3148
|
};
|
|
3144
|
-
var
|
|
3149
|
+
var H = d ? u()(te, d) > -1 : true;
|
|
3145
3150
|
(0, e.useEffect)((function() {
|
|
3146
3151
|
// a fix for SUI-5425, where the Markdown component doesn't pass a valid language in some circumstances
|
|
3147
|
-
if (
|
|
3148
|
-
|
|
3149
|
-
|
|
3150
|
-
|
|
3151
|
-
var
|
|
3152
|
-
var
|
|
3152
|
+
if (d && !H) {
|
|
3153
|
+
(0, v.log)("warn", "Unsupported language ".concat(d, ", falling back to ").concat(m, ". Supported languages are: ").concat(te.join(", ")));
|
|
3154
|
+
}
|
|
3155
|
+
}), [ H, d, m ]);
|
|
3156
|
+
var z = H && d ? d : m;
|
|
3157
|
+
var X = re(R, z);
|
|
3158
|
+
var K = ne(z);
|
|
3159
|
+
var Z = function e(n) {
|
|
3153
3160
|
return s()(n).map((function(n, r) {
|
|
3154
3161
|
if (typeof n === "string") {
|
|
3155
|
-
if (!
|
|
3162
|
+
if (!S) {
|
|
3156
3163
|
return n;
|
|
3157
3164
|
}
|
|
3158
3165
|
var a = n.split("\n");
|
|
@@ -3167,7 +3174,7 @@
|
|
|
3167
3174
|
} else {
|
|
3168
3175
|
a.push( t().createElement("span", {
|
|
3169
3176
|
key: "".concat(r.toString(), ":").concat(n.toString())
|
|
3170
|
-
},
|
|
3177
|
+
}, G(s[1].length)), s[2]);
|
|
3171
3178
|
}
|
|
3172
3179
|
return a;
|
|
3173
3180
|
})));
|
|
@@ -3175,36 +3182,36 @@
|
|
|
3175
3182
|
var s = typeof n.content === "string" ? n.content : e(n.content);
|
|
3176
3183
|
|
|
3177
3184
|
// eslint-disable-next-line react/no-array-index-key
|
|
3178
|
-
return t().createElement(
|
|
3185
|
+
return t().createElement(w, {
|
|
3179
3186
|
"data-part-type": n.type,
|
|
3180
3187
|
partType: n.type,
|
|
3181
3188
|
key: r.toString()
|
|
3182
3189
|
}, s);
|
|
3183
3190
|
}));
|
|
3184
3191
|
};
|
|
3185
|
-
var
|
|
3192
|
+
var V = Z(X);
|
|
3186
3193
|
|
|
3187
|
-
return t().createElement(
|
|
3194
|
+
return t().createElement(T, q({
|
|
3188
3195
|
"data-test": "code",
|
|
3189
|
-
ref:
|
|
3190
|
-
tabIndex:
|
|
3196
|
+
ref: U,
|
|
3197
|
+
tabIndex: F,
|
|
3191
3198
|
$containerAppearance: a,
|
|
3192
|
-
$showLineNumbers:
|
|
3193
|
-
$counterReset:
|
|
3194
|
-
},
|
|
3199
|
+
$showLineNumbers: A,
|
|
3200
|
+
$counterReset: y && y - 1
|
|
3201
|
+
}, N), A && t().createElement(j, {
|
|
3195
3202
|
containerAppearance: a,
|
|
3196
|
-
value:
|
|
3197
|
-
}), t().createElement(
|
|
3198
|
-
className: "language-".concat(
|
|
3199
|
-
$isPlaintext:
|
|
3200
|
-
},
|
|
3203
|
+
value: R
|
|
3204
|
+
}), t().createElement(x, {
|
|
3205
|
+
className: "language-".concat(z),
|
|
3206
|
+
$isPlaintext: K
|
|
3207
|
+
}, V), b && t().createElement(B, {
|
|
3201
3208
|
containerAppearance: a,
|
|
3202
|
-
width:
|
|
3209
|
+
width: P,
|
|
3203
3210
|
highlight: b
|
|
3204
3211
|
}));
|
|
3205
3212
|
}
|
|
3206
|
-
|
|
3207
|
-
/* harmony default export */ const
|
|
3213
|
+
se.propTypes = ae;
|
|
3214
|
+
/* harmony default export */ const ie = se;
|
|
3208
3215
|
}) // CONCATENATED MODULE: ./src/Code/index.ts
|
|
3209
3216
|
();
|
|
3210
3217
|
module.exports = r;
|