@splunk/visualizations-shared 28.0.0 → 28.1.0
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/.eslintrc.json +5 -0
- package/Downloader.js +3 -0
- package/Downloader.js.map +2 -2
- package/FileDownloader.js.map +2 -2
- package/Message.js +10 -41
- package/Message.js.map +4 -4
- package/RemoteIcon.js +23 -46
- package/RemoteIcon.js.map +4 -4
- package/RemoteImage.js +21 -42
- package/RemoteImage.js.map +4 -4
- package/SizeAwareWrapper.js +16 -29
- package/SizeAwareWrapper.js.map +3 -3
- package/VisualizationDocPage.js +34 -88
- package/VisualizationDocPage.js.map +4 -4
- package/package.json +10 -10
- package/SizeAwareWrapperDeprecated.js +0 -145
- package/SizeAwareWrapperDeprecated.js.map +0 -7
package/RemoteImage.js
CHANGED
|
@@ -7,7 +7,6 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
7
7
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
8
|
var __getProtoOf = Object.getPrototypeOf;
|
|
9
9
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
11
10
|
var __export = (target, all) => {
|
|
12
11
|
for (var name in all)
|
|
13
12
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -30,7 +29,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
30
29
|
mod
|
|
31
30
|
));
|
|
32
31
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
33
|
-
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
34
32
|
var __async = (__this, __arguments, generator) => {
|
|
35
33
|
return new Promise((resolve, reject) => {
|
|
36
34
|
var fulfilled = (value) => {
|
|
@@ -52,7 +50,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
52
50
|
});
|
|
53
51
|
};
|
|
54
52
|
|
|
55
|
-
// src/RemoteImage.
|
|
53
|
+
// src/RemoteImage.tsx
|
|
56
54
|
var RemoteImage_exports = {};
|
|
57
55
|
__export(RemoteImage_exports, {
|
|
58
56
|
default: () => RemoteImage_default,
|
|
@@ -69,59 +67,50 @@ var defaultImport = __toESM(require("react"));
|
|
|
69
67
|
__reExport(react_exports, require("react"));
|
|
70
68
|
var react_default = "default" in defaultImport ? defaultImport.default : defaultImport;
|
|
71
69
|
|
|
72
|
-
// esm-externals:prop-types
|
|
73
|
-
var prop_types_exports = {};
|
|
74
|
-
__export(prop_types_exports, {
|
|
75
|
-
default: () => prop_types_default
|
|
76
|
-
});
|
|
77
|
-
var defaultImport2 = __toESM(require("prop-types"));
|
|
78
|
-
__reExport(prop_types_exports, require("prop-types"));
|
|
79
|
-
var prop_types_default = "default" in defaultImport2 ? defaultImport2.default : defaultImport2;
|
|
80
|
-
|
|
81
70
|
// esm-externals:styled-components
|
|
82
71
|
var styled_components_exports = {};
|
|
83
72
|
__export(styled_components_exports, {
|
|
84
73
|
default: () => styled_components_default
|
|
85
74
|
});
|
|
86
|
-
var
|
|
75
|
+
var defaultImport2 = __toESM(require("styled-components"));
|
|
87
76
|
__reExport(styled_components_exports, require("styled-components"));
|
|
88
|
-
var styled_components_default = "default" in
|
|
77
|
+
var styled_components_default = "default" in defaultImport2 ? defaultImport2.default : defaultImport2;
|
|
89
78
|
|
|
90
|
-
// esm-externals:lodash
|
|
91
|
-
var
|
|
92
|
-
__export(
|
|
93
|
-
default: () =>
|
|
79
|
+
// esm-externals:lodash
|
|
80
|
+
var lodash_exports = {};
|
|
81
|
+
__export(lodash_exports, {
|
|
82
|
+
default: () => lodash_default
|
|
94
83
|
});
|
|
95
|
-
var
|
|
96
|
-
__reExport(
|
|
97
|
-
var
|
|
84
|
+
var defaultImport3 = __toESM(require("lodash"));
|
|
85
|
+
__reExport(lodash_exports, require("lodash"));
|
|
86
|
+
var lodash_default = "default" in defaultImport3 ? defaultImport3.default : defaultImport3;
|
|
98
87
|
|
|
99
88
|
// esm-externals:@splunk/ui-utils/i18n
|
|
100
89
|
var i18n_exports = {};
|
|
101
90
|
__export(i18n_exports, {
|
|
102
91
|
default: () => i18n_default
|
|
103
92
|
});
|
|
104
|
-
var
|
|
93
|
+
var defaultImport4 = __toESM(require("@splunk/ui-utils/i18n"));
|
|
105
94
|
__reExport(i18n_exports, require("@splunk/ui-utils/i18n"));
|
|
106
|
-
var i18n_default = "default" in
|
|
95
|
+
var i18n_default = "default" in defaultImport4 ? defaultImport4.default : defaultImport4;
|
|
107
96
|
|
|
108
97
|
// esm-externals:@splunk/visualization-context/ImageContext
|
|
109
98
|
var ImageContext_exports = {};
|
|
110
99
|
__export(ImageContext_exports, {
|
|
111
100
|
default: () => ImageContext_default
|
|
112
101
|
});
|
|
113
|
-
var
|
|
102
|
+
var defaultImport5 = __toESM(require("@splunk/visualization-context/ImageContext"));
|
|
114
103
|
__reExport(ImageContext_exports, require("@splunk/visualization-context/ImageContext"));
|
|
115
|
-
var ImageContext_default = "default" in
|
|
104
|
+
var ImageContext_default = "default" in defaultImport5 ? defaultImport5.default : defaultImport5;
|
|
116
105
|
|
|
117
106
|
// esm-externals:lodash/isNumber
|
|
118
107
|
var isNumber_exports = {};
|
|
119
108
|
__export(isNumber_exports, {
|
|
120
109
|
default: () => isNumber_default
|
|
121
110
|
});
|
|
122
|
-
var
|
|
111
|
+
var defaultImport6 = __toESM(require("lodash/isNumber"));
|
|
123
112
|
__reExport(isNumber_exports, require("lodash/isNumber"));
|
|
124
|
-
var isNumber_default = "default" in
|
|
113
|
+
var isNumber_default = "default" in defaultImport6 ? defaultImport6.default : defaultImport6;
|
|
125
114
|
|
|
126
115
|
// src/style.js
|
|
127
116
|
var toPx = (number, defaultNumber = 0) => isNumber_default(number) ? `${number}px` : number || toPx(defaultNumber);
|
|
@@ -136,7 +125,7 @@ var toDimension = ({ width, height }) => {
|
|
|
136
125
|
return css;
|
|
137
126
|
};
|
|
138
127
|
|
|
139
|
-
// src/RemoteImage.
|
|
128
|
+
// src/RemoteImage.tsx
|
|
140
129
|
var isRemoteImage = (src = "") => {
|
|
141
130
|
const [type] = src.split("://");
|
|
142
131
|
return src.indexOf("://") > -1 && type !== "http" && type !== "https";
|
|
@@ -150,7 +139,7 @@ var toImageDimensions = (props) => {
|
|
|
150
139
|
height: auto;
|
|
151
140
|
`;
|
|
152
141
|
}
|
|
153
|
-
return toDimension(
|
|
142
|
+
return toDimension((0, lodash_exports.pick)(props, ["width", "height"]));
|
|
154
143
|
};
|
|
155
144
|
var Image = styled_components_default.img`
|
|
156
145
|
display: block;
|
|
@@ -161,7 +150,7 @@ var RemoteImage = class extends react_exports.PureComponent {
|
|
|
161
150
|
super(props);
|
|
162
151
|
this.state = {
|
|
163
152
|
imageDataURI: null,
|
|
164
|
-
preserveAspectRatio: props.preserveAspectRatio
|
|
153
|
+
preserveAspectRatio: Boolean(props.preserveAspectRatio)
|
|
165
154
|
};
|
|
166
155
|
}
|
|
167
156
|
componentDidMount() {
|
|
@@ -196,7 +185,7 @@ var RemoteImage = class extends react_exports.PureComponent {
|
|
|
196
185
|
if (!imageDataURI) {
|
|
197
186
|
return null;
|
|
198
187
|
}
|
|
199
|
-
return /* @__PURE__ */
|
|
188
|
+
return /* @__PURE__ */ react_exports.createElement(
|
|
200
189
|
Image,
|
|
201
190
|
{
|
|
202
191
|
src: imageDataURI,
|
|
@@ -211,16 +200,6 @@ var RemoteImage = class extends react_exports.PureComponent {
|
|
|
211
200
|
);
|
|
212
201
|
}
|
|
213
202
|
};
|
|
214
|
-
|
|
215
|
-
__publicField(RemoteImage, "propTypes", {
|
|
216
|
-
imageURL: prop_types_default.string,
|
|
217
|
-
width: prop_types_default.oneOfType([prop_types_default.string, prop_types_default.number]),
|
|
218
|
-
height: prop_types_default.oneOfType([prop_types_default.string, prop_types_default.number]),
|
|
219
|
-
preserveAspectRatio: prop_types_default.bool,
|
|
220
|
-
title: prop_types_default.string
|
|
221
|
-
});
|
|
222
|
-
__publicField(RemoteImage, "defaultProps", {
|
|
223
|
-
preserveAspectRatio: false
|
|
224
|
-
});
|
|
203
|
+
RemoteImage.contextType = ImageContext_default;
|
|
225
204
|
var RemoteImage_default = RemoteImage;
|
|
226
205
|
//# sourceMappingURL=RemoteImage.js.map
|
package/RemoteImage.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["src/RemoteImage.
|
|
4
|
-
"sourcesContent": ["import
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": ["defaultImport", "defaultImport", "defaultImport", "defaultImport", "defaultImport"
|
|
3
|
+
"sources": ["src/RemoteImage.tsx", "esm-externals:react", "esm-externals:styled-components", "esm-externals:lodash", "esm-externals:@splunk/ui-utils/i18n", "esm-externals:@splunk/visualization-context/ImageContext", "esm-externals:lodash/isNumber", "src/style.js"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nimport styled from 'styled-components';\nimport { pick } from 'lodash';\nimport { _ } from '@splunk/ui-utils/i18n';\nimport ImageContext from '@splunk/visualization-context/ImageContext';\nimport { toDimension } from './style';\n\n/**\n * check if an image is considered as remote image\n * @param {*} src\n */\nexport const isRemoteImage = (src = '') => {\n const [type] = src.split('://');\n return src.indexOf('://') > -1 && type !== 'http' && type !== 'https';\n};\n\ninterface RemoteImageProps {\n imageURL: string;\n width: number;\n height: number;\n preserveAspectRatio: boolean;\n title: string;\n}\n\ninterface RemoteImageState {\n preserveAspectRatio: boolean;\n imageDataURI: string | null;\n}\n\ninterface ImageProps {\n shouldPreserveAspectRatio: boolean;\n width: number;\n height: number;\n}\n\nconst toImageDimensions = props => {\n if (props.shouldPreserveAspectRatio) {\n return `\n max-width: 100%;\n max-height: 100%;\n width: auto;\n height: auto;\n `;\n }\n return toDimension(pick(props, ['width', 'height']));\n};\n\nconst Image = styled.img<ImageProps>`\n display: block;\n ${props => toImageDimensions(props)};\n`;\n\nclass RemoteImage extends React.PureComponent<RemoteImageProps, RemoteImageState> {\n static readonly contextType: ImageContext = ImageContext;\n\n constructor(props) {\n super(props);\n this.state = {\n imageDataURI: null,\n preserveAspectRatio: Boolean(props.preserveAspectRatio),\n };\n }\n\n componentDidMount() {\n this.getImage(this.props.imageURL);\n }\n\n componentDidUpdate(prevProps) {\n if (prevProps.imageURL !== this.props.imageURL) {\n this.getImage(this.props.imageURL);\n }\n if (prevProps.preserveAspectRatio !== this.props.preserveAspectRatio) {\n // eslint-disable-next-line react/no-did-update-set-state\n this.setState({\n preserveAspectRatio: this.props.preserveAspectRatio,\n });\n }\n }\n\n async getImage(imageURL) {\n const imageRegistry: ImageContext = this.context;\n if (imageRegistry) {\n try {\n const image = await imageRegistry.getByURL(imageURL);\n this.setState({ imageDataURI: image.dataURI });\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error(error);\n }\n }\n }\n\n render() {\n const { imageDataURI } = this.state;\n const { width, height, title } = this.props;\n\n if (!imageDataURI) {\n return null;\n }\n return (\n <Image\n src={imageDataURI}\n shouldPreserveAspectRatio={this.state.preserveAspectRatio}\n width={width}\n height={height}\n alt={_(title)}\n onError={e => {\n (e.target as HTMLImageElement).alt = _('Image not found');\n }}\n />\n );\n }\n}\n\nexport default RemoteImage;\n", "\nimport * as defaultImport from \"react\";\nexport * from \"react\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "\nimport * as defaultImport from \"styled-components\";\nexport * from \"styled-components\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "\nimport * as defaultImport from \"lodash\";\nexport * from \"lodash\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "\nimport * as defaultImport from \"@splunk/ui-utils/i18n\";\nexport * from \"@splunk/ui-utils/i18n\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "\nimport * as defaultImport from \"@splunk/visualization-context/ImageContext\";\nexport * from \"@splunk/visualization-context/ImageContext\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "\nimport * as defaultImport from \"lodash/isNumber\";\nexport * from \"lodash/isNumber\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "import isNumber from 'lodash/isNumber';\n\n/**\n * convert number to px\n * @param {*} number\n */\nexport const toPx = (number, defaultNumber = 0) =>\n isNumber(number) ? `${number}px` : number || toPx(defaultNumber);\n\n/**\n * generate width/height css properties\n * @param {*} param0\n */\nexport const toDimension = ({ width, height }) => {\n let css = '';\n if (width) {\n css = `width: ${toPx(width)};`;\n }\n if (height) {\n // only add a linebreak if width was also set\n css = `${css}${width ? '\\n' : ''}height: ${toPx(height)};`;\n }\n return css;\n};\n\n/**\n * generate margin css property\n */\nexport const arrayToCSSProp = (prop, vals = [0, 0, 0, 0]) => {\n if (Array.isArray(vals)) {\n return `\n ${prop}: ${toPx(vals[0])} ${toPx(vals[1])} ${toPx(vals[2])} ${toPx(vals[3])};\n `;\n }\n\n return `${prop}: ${toPx(vals)};`;\n};\n\n/**\n * generate margin css property\n */\nexport const toMargin = (margins = [0, 0, 0, 0]) => arrayToCSSProp('margin', margins);\n\n/**\n * generate padding css property\n */\nexport const toPadding = (paddings = [0, 0, 0, 0]) => arrayToCSSProp('padding', paddings);\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;AACA,oBAA+B;AAC/B,0BAAc;AACd,IAAO,gBAAS,aAAa,gBAA8B,wBAAU;;;ACHrE;AAAA;AAAA;AAAA;AACA,IAAAA,iBAA+B;AAC/B,sCAAc;AACd,IAAO,4BAAS,aAAaA,iBAA8B,yBAAUA;;;ACHrE;AAAA;AAAA;AAAA;AACA,IAAAC,iBAA+B;AAC/B,2BAAc;AACd,IAAO,iBAAS,aAAaA,i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Q,MAAM,mBAAmB;AAAA,IAC1D;AAAA,EACJ;AAAA,EAEA,oBAAoB;AAChB,SAAK,SAAS,KAAK,MAAM,QAAQ;AAAA,EACrC;AAAA,EAEA,mBAAmB,WAAW;AAC1B,QAAI,UAAU,aAAa,KAAK,MAAM,UAAU;AAC5C,WAAK,SAAS,KAAK,MAAM,QAAQ;AAAA,IACrC;AACA,QAAI,UAAU,wBAAwB,KAAK,MAAM,qBAAqB;AAElE,WAAK,SAAS;AAAA,QACV,qBAAqB,KAAK,MAAM;AAAA,MACpC,CAAC;AAAA,IACL;AAAA,EACJ;AAAA,EAEM,SAAS,UAAU;AAAA;AACrB,YAAM,gBAA8B,KAAK;AACzC,UAAI,eAAe;AACf,YAAI;AACA,gBAAM,QAAQ,MAAM,cAAc,SAAS,QAAQ;AACnD,eAAK,SAAS,EAAE,cAAc,MAAM,QAAQ,CAAC;AAAA,QACjD,SAAS,OAAO;AAEZ,kBAAQ,MAAM,KAAK;AAAA,QACvB;AAAA,MACJ;AAAA,IACJ;AAAA;AAAA,EAEA,SAAS;AACL,UAAM,EAAE,aAAa,IAAI,KAAK;AAC9B,UAAM,EAAE,OAAO,QAAQ,MAAM,IAAI,KAAK;AAEtC,QAAI,CAAC,cAAc;AACf,aAAO;AAAA,IACX;AACA,WACI;AAAA,MAAC;AAAA;AAAA,QACG,KAAK;AAAA,QACL,2BAA2B,KAAK,MAAM;AAAA,QACtC;AAAA,QACA;AAAA,QACA,SAAK,gBAAE,KAAK;AAAA,QACZ,SAAS,OAAK;AACV,UAAC,EAAE,OAA4B,UAAM,gBAAE,iBAAiB;AAAA,QAC5D;AAAA;AAAA,IACJ;AAAA,EAER;AACJ;AA5DM,YACc,cAA4B;AA6DhD,IAAO,sBAAQ;",
|
|
6
|
+
"names": ["defaultImport", "defaultImport", "defaultImport", "defaultImport", "defaultImport"]
|
|
7
7
|
}
|
package/SizeAwareWrapper.js
CHANGED
|
@@ -7,7 +7,6 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
7
7
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
8
|
var __getProtoOf = Object.getPrototypeOf;
|
|
9
9
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
11
10
|
var __export = (target, all) => {
|
|
12
11
|
for (var name in all)
|
|
13
12
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -30,9 +29,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
30
29
|
mod
|
|
31
30
|
));
|
|
32
31
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
33
|
-
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
34
32
|
|
|
35
|
-
// src/SizeAwareWrapper.
|
|
33
|
+
// src/SizeAwareWrapper.tsx
|
|
36
34
|
var SizeAwareWrapper_exports = {};
|
|
37
35
|
__export(SizeAwareWrapper_exports, {
|
|
38
36
|
default: () => SizeAwareWrapper_default
|
|
@@ -48,16 +46,16 @@ var defaultImport = __toESM(require("react"));
|
|
|
48
46
|
__reExport(react_exports, require("react"));
|
|
49
47
|
var react_default = "default" in defaultImport ? defaultImport.default : defaultImport;
|
|
50
48
|
|
|
51
|
-
// esm-externals:
|
|
52
|
-
var
|
|
53
|
-
__export(
|
|
54
|
-
default: () =>
|
|
49
|
+
// esm-externals:lodash
|
|
50
|
+
var lodash_exports = {};
|
|
51
|
+
__export(lodash_exports, {
|
|
52
|
+
default: () => lodash_default
|
|
55
53
|
});
|
|
56
|
-
var defaultImport2 = __toESM(require("
|
|
57
|
-
__reExport(
|
|
58
|
-
var
|
|
54
|
+
var defaultImport2 = __toESM(require("lodash"));
|
|
55
|
+
__reExport(lodash_exports, require("lodash"));
|
|
56
|
+
var lodash_default = "default" in defaultImport2 ? defaultImport2.default : defaultImport2;
|
|
59
57
|
|
|
60
|
-
// src/SizeAwareWrapper.
|
|
58
|
+
// src/SizeAwareWrapper.tsx
|
|
61
59
|
var styles = {
|
|
62
60
|
position: "absolute",
|
|
63
61
|
width: 0,
|
|
@@ -68,16 +66,17 @@ var styles = {
|
|
|
68
66
|
var SizeAwareWrapper = class extends react_exports.PureComponent {
|
|
69
67
|
constructor() {
|
|
70
68
|
super(...arguments);
|
|
71
|
-
|
|
69
|
+
this.getElement = () => {
|
|
72
70
|
const parentElement = this.el && this.el.parentElement;
|
|
73
71
|
return parentElement;
|
|
74
|
-
}
|
|
75
|
-
|
|
72
|
+
};
|
|
73
|
+
this.handleResize = (entries) => {
|
|
74
|
+
const { onResize = lodash_exports.noop } = this.props;
|
|
76
75
|
entries.forEach((entry) => {
|
|
77
76
|
const { width, height } = entry.contentRect;
|
|
78
|
-
|
|
77
|
+
onResize(width, height);
|
|
79
78
|
});
|
|
80
|
-
}
|
|
79
|
+
};
|
|
81
80
|
}
|
|
82
81
|
componentDidMount() {
|
|
83
82
|
const resizableElement = this.getElement();
|
|
@@ -104,7 +103,7 @@ var SizeAwareWrapper = class extends react_exports.PureComponent {
|
|
|
104
103
|
return new ResizeObserver(this.handleResize);
|
|
105
104
|
}
|
|
106
105
|
render() {
|
|
107
|
-
return /* @__PURE__ */
|
|
106
|
+
return /* @__PURE__ */ react_exports.createElement(
|
|
108
107
|
"div",
|
|
109
108
|
{
|
|
110
109
|
key: "resize-detector",
|
|
@@ -116,17 +115,5 @@ var SizeAwareWrapper = class extends react_exports.PureComponent {
|
|
|
116
115
|
);
|
|
117
116
|
}
|
|
118
117
|
};
|
|
119
|
-
SizeAwareWrapper.propTypes = {
|
|
120
|
-
onResize: prop_types_default.func
|
|
121
|
-
// This was to use width and height as props and then check to see if the values have changed inside the handleResize function
|
|
122
|
-
// Some components need a double render to 'settle' and are using this so no check is needed.
|
|
123
|
-
// However until that is fixed unit tests rely on these props so keeping as optional.
|
|
124
|
-
// width: T.arrayOf(T.number, T.string),
|
|
125
|
-
// height: T.arrayOf(T.number, T.string),
|
|
126
|
-
};
|
|
127
|
-
SizeAwareWrapper.defaultProps = {
|
|
128
|
-
onResize: () => {
|
|
129
|
-
}
|
|
130
|
-
};
|
|
131
118
|
var SizeAwareWrapper_default = SizeAwareWrapper;
|
|
132
119
|
//# sourceMappingURL=SizeAwareWrapper.js.map
|
package/SizeAwareWrapper.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["src/SizeAwareWrapper.
|
|
4
|
-
"sourcesContent": ["import
|
|
5
|
-
"mappings": "
|
|
3
|
+
"sources": ["src/SizeAwareWrapper.tsx", "esm-externals:react", "esm-externals:lodash"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nimport { noop } from 'lodash';\n\nconst styles: React.CSSProperties = {\n position: 'absolute',\n width: 0,\n height: 0,\n visibility: 'hidden',\n display: 'none',\n};\n\ninterface SizeAwareWrapperProps {\n onResize: (width: number, height: number) => void;\n // This was to use width and height as props and then check to see if the values have changed inside the handleResize function\n // Some components need a double render to 'settle' and are using this so no check is needed.\n // However until that is fixed unit tests rely on these props so keeping as optional.\n // width?: number | string;\n // height?: number | string;\n}\n\nclass SizeAwareWrapper extends React.PureComponent<SizeAwareWrapperProps, null> {\n ro: ResizeObserver | { observe(): void; unobserve(): void };\n\n el: HTMLDivElement;\n\n componentDidMount() {\n const resizableElement = this.getElement();\n if (resizableElement) {\n this.ro = this.getResizeObserver();\n this.ro.observe(resizableElement);\n }\n }\n\n componentWillUnmount() {\n const resizableElement = this.getElement();\n if (resizableElement && this.ro) {\n this.ro.unobserve(resizableElement);\n }\n }\n\n getElement = () => {\n const parentElement = this.el && this.el.parentElement;\n return parentElement;\n };\n\n getResizeObserver() {\n if (typeof ResizeObserver !== 'function') {\n return {\n observe() {},\n unobserve() {},\n };\n }\n return new ResizeObserver(this.handleResize);\n }\n\n handleResize = entries => {\n const { onResize = noop } = this.props;\n entries.forEach(entry => {\n const { width, height } = entry.contentRect;\n onResize(width, height);\n });\n };\n\n render() {\n return (\n <div\n key=\"resize-detector\"\n style={styles}\n ref={el => {\n this.el = el;\n }}\n />\n );\n }\n}\n\nexport default SizeAwareWrapper;\n", "\nimport * as defaultImport from \"react\";\nexport * from \"react\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "\nimport * as defaultImport from \"lodash\";\nexport * from \"lodash\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;AACA,oBAA+B;AAC/B,0BAAc;AACd,IAAO,gBAAS,aAAa,gBAA8B,wBAAU;;;ACHrE;AAAA;AAAA;AAAA;AACA,IAAAA,iBAA+B;AAC/B,2BAAc;AACd,IAAO,iBAAS,aAAaA,iBAA8B,yBAAUA;;;AFArE,IAAM,SAA8B;AAAA,EAChC,UAAU;AAAA,EACV,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,YAAY;AAAA,EACZ,SAAS;AACb;AAWA,IAAM,mBAAN,cAAqC,4BAA2C;AAAA,EAAhF;AAAA;AAoBI,sBAAa,MAAM;AACf,YAAM,gBAAgB,KAAK,MAAM,KAAK,GAAG;AACzC,aAAO;AAAA,IACX;AAYA,wBAAe,aAAW;AACtB,YAAM,EAAE,WAAW,oBAAK,IAAI,KAAK;AACjC,cAAQ,QAAQ,WAAS;AACrB,cAAM,EAAE,OAAO,OAAO,IAAI,MAAM;AAChC,iBAAS,OAAO,MAAM;AAAA,MAC1B,CAAC;AAAA,IACL;AAAA;AAAA,EApCA,oBAAoB;AAChB,UAAM,mBAAmB,KAAK,WAAW;AACzC,QAAI,kBAAkB;AAClB,WAAK,KAAK,KAAK,kBAAkB;AACjC,WAAK,GAAG,QAAQ,gBAAgB;AAAA,IACpC;AAAA,EACJ;AAAA,EAEA,uBAAuB;AACnB,UAAM,mBAAmB,KAAK,WAAW;AACzC,QAAI,oBAAoB,KAAK,IAAI;AAC7B,WAAK,GAAG,UAAU,gBAAgB;AAAA,IACtC;AAAA,EACJ;AAAA,EAOA,oBAAoB;AAChB,QAAI,OAAO,mBAAmB,YAAY;AACtC,aAAO;AAAA,QACH,UAAU;AAAA,QAAC;AAAA,QACX,YAAY;AAAA,QAAC;AAAA,MACjB;AAAA,IACJ;AACA,WAAO,IAAI,eAAe,KAAK,YAAY;AAAA,EAC/C;AAAA,EAUA,SAAS;AACL,WACI;AAAA,MAAC;AAAA;AAAA,QACG,KAAI;AAAA,QACJ,OAAO;AAAA,QACP,KAAK,QAAM;AACP,eAAK,KAAK;AAAA,QACd;AAAA;AAAA,IACJ;AAAA,EAER;AACJ;AAEA,IAAO,2BAAQ;",
|
|
6
6
|
"names": ["defaultImport"]
|
|
7
7
|
}
|
package/VisualizationDocPage.js
CHANGED
|
@@ -3,7 +3,9 @@ SPLUNK CONFIDENTIAL – Use or disclosure of this material in whole or
|
|
|
3
3
|
in part without a valid written license from Splunk Inc. is PROHIBITED. */
|
|
4
4
|
var __create = Object.create;
|
|
5
5
|
var __defProp = Object.defineProperty;
|
|
6
|
+
var __defProps = Object.defineProperties;
|
|
6
7
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
8
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
7
9
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
10
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
9
11
|
var __getProtoOf = Object.getPrototypeOf;
|
|
@@ -21,6 +23,7 @@ var __spreadValues = (a, b) => {
|
|
|
21
23
|
}
|
|
22
24
|
return a;
|
|
23
25
|
};
|
|
26
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
24
27
|
var __export = (target, all) => {
|
|
25
28
|
for (var name in all)
|
|
26
29
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -43,9 +46,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
43
46
|
mod
|
|
44
47
|
));
|
|
45
48
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
46
|
-
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
47
49
|
|
|
48
|
-
// src/VisualizationDocPage.
|
|
50
|
+
// src/VisualizationDocPage.tsx
|
|
49
51
|
var VisualizationDocPage_exports = {};
|
|
50
52
|
__export(VisualizationDocPage_exports, {
|
|
51
53
|
default: () => VisualizationDocPage_default
|
|
@@ -61,54 +63,45 @@ var defaultImport = __toESM(require("react"));
|
|
|
61
63
|
__reExport(react_exports, require("react"));
|
|
62
64
|
var react_default = "default" in defaultImport ? defaultImport.default : defaultImport;
|
|
63
65
|
|
|
64
|
-
// esm-externals:prop-types
|
|
65
|
-
var prop_types_exports = {};
|
|
66
|
-
__export(prop_types_exports, {
|
|
67
|
-
default: () => prop_types_default
|
|
68
|
-
});
|
|
69
|
-
var defaultImport2 = __toESM(require("prop-types"));
|
|
70
|
-
__reExport(prop_types_exports, require("prop-types"));
|
|
71
|
-
var prop_types_default = "default" in defaultImport2 ? defaultImport2.default : defaultImport2;
|
|
72
|
-
|
|
73
66
|
// esm-externals:lodash
|
|
74
67
|
var lodash_exports = {};
|
|
75
68
|
__export(lodash_exports, {
|
|
76
69
|
default: () => lodash_default
|
|
77
70
|
});
|
|
78
|
-
var
|
|
71
|
+
var defaultImport2 = __toESM(require("lodash"));
|
|
79
72
|
__reExport(lodash_exports, require("lodash"));
|
|
80
|
-
var lodash_default = "default" in
|
|
73
|
+
var lodash_default = "default" in defaultImport2 ? defaultImport2.default : defaultImport2;
|
|
81
74
|
|
|
82
75
|
// esm-externals:@splunk/react-docs/DockingTabBar
|
|
83
76
|
var DockingTabBar_exports = {};
|
|
84
77
|
__export(DockingTabBar_exports, {
|
|
85
78
|
default: () => DockingTabBar_default
|
|
86
79
|
});
|
|
87
|
-
var
|
|
80
|
+
var defaultImport3 = __toESM(require("@splunk/react-docs/DockingTabBar"));
|
|
88
81
|
__reExport(DockingTabBar_exports, require("@splunk/react-docs/DockingTabBar"));
|
|
89
|
-
var DockingTabBar_default = "default" in
|
|
82
|
+
var DockingTabBar_default = "default" in defaultImport3 ? defaultImport3.default : defaultImport3;
|
|
90
83
|
|
|
91
84
|
// esm-externals:@splunk/react-docs/API
|
|
92
85
|
var API_exports = {};
|
|
93
86
|
__export(API_exports, {
|
|
94
87
|
default: () => API_default
|
|
95
88
|
});
|
|
96
|
-
var
|
|
89
|
+
var defaultImport4 = __toESM(require("@splunk/react-docs/API"));
|
|
97
90
|
__reExport(API_exports, require("@splunk/react-docs/API"));
|
|
98
|
-
var API_default = "default" in
|
|
91
|
+
var API_default = "default" in defaultImport4 ? defaultImport4.default : defaultImport4;
|
|
99
92
|
|
|
100
93
|
// src/previewVizMessage.ts
|
|
101
94
|
var previewVizMessage = "\u26A0\uFE0F This is a preview of a new visualization component. Minor updates and bug fixes should be expected.";
|
|
102
95
|
var previewVizMessage_default = previewVizMessage;
|
|
103
96
|
|
|
104
|
-
// src/VisualizationDocPage.
|
|
97
|
+
// src/VisualizationDocPage.tsx
|
|
105
98
|
var _ComponentPage = class _ComponentPage extends react_exports.Component {
|
|
106
|
-
constructor(
|
|
107
|
-
super(
|
|
108
|
-
|
|
99
|
+
constructor(args) {
|
|
100
|
+
super(args);
|
|
101
|
+
this.handleBodyMount = (el) => {
|
|
109
102
|
this.bodyEl = el;
|
|
110
|
-
}
|
|
111
|
-
|
|
103
|
+
};
|
|
104
|
+
this.handleSectionChange = (e, { selectedTabId }) => {
|
|
112
105
|
_ComponentPage.currentSection = selectedTabId;
|
|
113
106
|
this.setState({ activeSection: selectedTabId }, () => {
|
|
114
107
|
const { top } = this.bodyEl.getBoundingClientRect();
|
|
@@ -117,7 +110,7 @@ var _ComponentPage = class _ComponentPage extends react_exports.Component {
|
|
|
117
110
|
window.scroll(0, target);
|
|
118
111
|
}
|
|
119
112
|
});
|
|
120
|
-
}
|
|
113
|
+
};
|
|
121
114
|
this.state = { activeSection: _ComponentPage.currentSection };
|
|
122
115
|
}
|
|
123
116
|
renderBody() {
|
|
@@ -152,20 +145,22 @@ var _ComponentPage = class _ComponentPage extends react_exports.Component {
|
|
|
152
145
|
}
|
|
153
146
|
render() {
|
|
154
147
|
const {
|
|
155
|
-
createComponentURL,
|
|
148
|
+
createComponentURL = lodash_exports.noop,
|
|
156
149
|
conceptsSection,
|
|
157
150
|
overviewSection,
|
|
158
151
|
examplesSection,
|
|
159
152
|
encodingSection,
|
|
160
153
|
eventSection,
|
|
161
154
|
themeSection,
|
|
162
|
-
headerOffset,
|
|
155
|
+
headerOffset = 0,
|
|
163
156
|
sourceURL
|
|
164
157
|
} = this.props;
|
|
165
|
-
|
|
158
|
+
let basePageProps = (0, lodash_exports.pick)(this.props, "dependsOnSplunk", "description", "title");
|
|
166
159
|
if (this.props.status === "preview") {
|
|
167
|
-
basePageProps
|
|
168
|
-
${
|
|
160
|
+
basePageProps = __spreadProps(__spreadValues({}, basePageProps), {
|
|
161
|
+
description: `#### ${previewVizMessage_default}
|
|
162
|
+
${basePageProps.description || ""}`
|
|
163
|
+
});
|
|
169
164
|
}
|
|
170
165
|
let { activeSection } = this.state;
|
|
171
166
|
let body = this.renderBody();
|
|
@@ -173,21 +168,21 @@ var _ComponentPage = class _ComponentPage extends react_exports.Component {
|
|
|
173
168
|
body = examplesSection;
|
|
174
169
|
activeSection = "examples";
|
|
175
170
|
}
|
|
176
|
-
return /* @__PURE__ */
|
|
171
|
+
return /* @__PURE__ */ react_exports.createElement(API_default, __spreadValues({ sourceURL: sourceURL || createComponentURL(window.location.pathname) }, basePageProps), /* @__PURE__ */ react_exports.createElement(
|
|
177
172
|
DockingTabBar_default,
|
|
178
173
|
{
|
|
179
174
|
activeTabId: activeSection,
|
|
180
175
|
offset: headerOffset,
|
|
181
176
|
onChange: this.handleSectionChange
|
|
182
177
|
},
|
|
183
|
-
overviewSection && /* @__PURE__ */
|
|
184
|
-
/* @__PURE__ */
|
|
185
|
-
encodingSection && /* @__PURE__ */
|
|
186
|
-
/* @__PURE__ */
|
|
187
|
-
eventSection && /* @__PURE__ */
|
|
188
|
-
themeSection && /* @__PURE__ */
|
|
189
|
-
conceptsSection && /* @__PURE__ */
|
|
190
|
-
), /* @__PURE__ */
|
|
178
|
+
overviewSection && /* @__PURE__ */ react_exports.createElement(DockingTabBar_exports.Tab, { label: "Overview", tabId: "overview" }),
|
|
179
|
+
/* @__PURE__ */ react_exports.createElement(DockingTabBar_exports.Tab, { label: "Examples", tabId: "examples" }),
|
|
180
|
+
encodingSection && /* @__PURE__ */ react_exports.createElement(DockingTabBar_exports.Tab, { label: "Encoding", tabId: "encoding" }),
|
|
181
|
+
/* @__PURE__ */ react_exports.createElement(DockingTabBar_exports.Tab, { label: "Options", tabId: "option" }),
|
|
182
|
+
eventSection && /* @__PURE__ */ react_exports.createElement(DockingTabBar_exports.Tab, { label: "Events", tabId: "event" }),
|
|
183
|
+
themeSection && /* @__PURE__ */ react_exports.createElement(DockingTabBar_exports.Tab, { label: "Themes", tabId: "theme" }),
|
|
184
|
+
conceptsSection && /* @__PURE__ */ react_exports.createElement(DockingTabBar_exports.Tab, { label: "Concepts", tabId: "concepts" })
|
|
185
|
+
), /* @__PURE__ */ react_exports.createElement(
|
|
191
186
|
"div",
|
|
192
187
|
{
|
|
193
188
|
style: {
|
|
@@ -200,56 +195,7 @@ var _ComponentPage = class _ComponentPage extends react_exports.Component {
|
|
|
200
195
|
));
|
|
201
196
|
}
|
|
202
197
|
};
|
|
203
|
-
|
|
204
|
-
__publicField(_ComponentPage, "propTypes", {
|
|
205
|
-
createComponentURL: prop_types_default.func,
|
|
206
|
-
dependsOnSplunk: prop_types_default.bool,
|
|
207
|
-
/**
|
|
208
|
-
* If status is `preview`, a message is prepended to the description reflecting this visualization is new
|
|
209
|
-
* and minor changes may be made soon.
|
|
210
|
-
*/
|
|
211
|
-
status: prop_types_default.string,
|
|
212
|
-
description: prop_types_default.string,
|
|
213
|
-
/**
|
|
214
|
-
* The "overview" section of the doc page.
|
|
215
|
-
*/
|
|
216
|
-
overviewSection: prop_types_default.node,
|
|
217
|
-
/**
|
|
218
|
-
* The "concepts" section of the doc page.
|
|
219
|
-
*/
|
|
220
|
-
conceptsSection: prop_types_default.node,
|
|
221
|
-
/**
|
|
222
|
-
* The "examples" section of the doc page.
|
|
223
|
-
*/
|
|
224
|
-
examplesSection: prop_types_default.node.isRequired,
|
|
225
|
-
/**
|
|
226
|
-
* The "options" section of the doc page.
|
|
227
|
-
*/
|
|
228
|
-
optionSection: prop_types_default.node.isRequired,
|
|
229
|
-
/**
|
|
230
|
-
* The "encoding" section of the doc page.
|
|
231
|
-
*/
|
|
232
|
-
encodingSection: prop_types_default.node,
|
|
233
|
-
/**
|
|
234
|
-
* The "event" section of the doc page.
|
|
235
|
-
*/
|
|
236
|
-
eventSection: prop_types_default.node,
|
|
237
|
-
/**
|
|
238
|
-
* The "theme" section of the doc page
|
|
239
|
-
*/
|
|
240
|
-
themeSection: prop_types_default.node,
|
|
241
|
-
headerOffset: prop_types_default.number,
|
|
242
|
-
/**
|
|
243
|
-
* Overrides the (otherwise automatically generated) source code url.
|
|
244
|
-
*/
|
|
245
|
-
sourceURL: prop_types_default.string,
|
|
246
|
-
title: prop_types_default.string.isRequired
|
|
247
|
-
});
|
|
248
|
-
__publicField(_ComponentPage, "defaultProps", {
|
|
249
|
-
createComponentURL() {
|
|
250
|
-
},
|
|
251
|
-
headerOffset: 0
|
|
252
|
-
});
|
|
198
|
+
_ComponentPage.currentSection = "overview";
|
|
253
199
|
var ComponentPage = _ComponentPage;
|
|
254
200
|
var VisualizationDocPage_default = ComponentPage;
|
|
255
201
|
//# sourceMappingURL=VisualizationDocPage.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["src/VisualizationDocPage.
|
|
4
|
-
"sourcesContent": ["import
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": ["defaultImport", "defaultImport", "defaultImport"
|
|
3
|
+
"sources": ["src/VisualizationDocPage.tsx", "esm-externals:react", "esm-externals:lodash", "esm-externals:@splunk/react-docs/DockingTabBar", "esm-externals:@splunk/react-docs/API", "src/previewVizMessage.ts"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nimport { noop, pick } from 'lodash';\nimport DockingTabBar, { Tab } from '@splunk/react-docs/DockingTabBar';\nimport APIPage from '@splunk/react-docs/API';\nimport previewVizMessage from './previewVizMessage';\n\ninterface ComponentPageProps {\n createComponentURL: (componentName: string) => string;\n dependsOnSplunk: boolean;\n status: string;\n description: string;\n overviewSection: React.ReactNode;\n conceptsSection: React.ReactNode;\n examplesSection: React.ReactNode;\n optionSection: React.ReactNode;\n encodingSection: React.ReactNode;\n eventSection: React.ReactNode;\n themeSection: React.ReactNode;\n headerOffset: number;\n sourceURL: string;\n title: string;\n}\n\ninterface ComponentPageState {\n activeSection: string;\n}\n\nclass ComponentPage extends React.Component<ComponentPageProps, ComponentPageState> {\n static currentSection = 'overview';\n\n bodyEl: any;\n\n constructor(args) {\n super(args);\n this.state = { activeSection: ComponentPage.currentSection };\n }\n\n handleBodyMount = el => {\n this.bodyEl = el;\n };\n\n handleSectionChange = (e, { selectedTabId }) => {\n ComponentPage.currentSection = selectedTabId;\n this.setState({ activeSection: selectedTabId }, () => {\n // After the new section loads, scroll to the top of the section.\n const { top } = this.bodyEl.getBoundingClientRect();\n if (top < window.scrollY) {\n const target = top + window.scrollY - 90;\n window.scroll(0, target);\n }\n });\n };\n\n renderBody() {\n const {\n encodingSection,\n optionSection,\n overviewSection,\n conceptsSection,\n examplesSection,\n eventSection,\n themeSection,\n } = this.props;\n const { activeSection } = this.state;\n switch (activeSection) {\n case 'concepts':\n return conceptsSection;\n case 'overview':\n return overviewSection;\n case 'examples':\n return examplesSection;\n case 'encoding':\n return encodingSection;\n case 'option':\n return optionSection;\n case 'event':\n return eventSection;\n case 'theme':\n return themeSection;\n default:\n return null;\n }\n }\n\n render() {\n const {\n createComponentURL = noop,\n conceptsSection,\n overviewSection,\n examplesSection,\n encodingSection,\n eventSection,\n themeSection,\n headerOffset = 0,\n sourceURL,\n } = this.props;\n let basePageProps = pick(this.props, 'dependsOnSplunk', 'description', 'title');\n\n if (this.props.status === 'preview') {\n basePageProps = {\n ...basePageProps,\n description: `#### ${previewVizMessage} \\n ${basePageProps.description || ''}`,\n };\n }\n\n let { activeSection } = this.state;\n let body = this.renderBody();\n\n if (!body) {\n body = examplesSection;\n activeSection = 'examples';\n }\n return (\n <APIPage sourceURL={sourceURL || createComponentURL(window.location.pathname)} {...basePageProps}>\n <DockingTabBar\n activeTabId={activeSection}\n offset={headerOffset}\n onChange={this.handleSectionChange}\n >\n {overviewSection && <Tab label=\"Overview\" tabId=\"overview\" />}\n <Tab label=\"Examples\" tabId=\"examples\" />\n {encodingSection && <Tab label=\"Encoding\" tabId=\"encoding\" />}\n <Tab label=\"Options\" tabId=\"option\" />\n {eventSection && <Tab label=\"Events\" tabId=\"event\" />}\n {themeSection && <Tab label=\"Themes\" tabId=\"theme\" />}\n {conceptsSection && <Tab label=\"Concepts\" tabId=\"concepts\" />}\n </DockingTabBar>\n <div\n style={{\n padding: '0 30px 30px',\n marginTop: '20px',\n }}\n ref={this.handleBodyMount}\n >\n {body}\n </div>\n </APIPage>\n );\n }\n}\n\nexport default ComponentPage;\n", "\nimport * as defaultImport from \"react\";\nexport * from \"react\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "\nimport * as defaultImport from \"lodash\";\nexport * from \"lodash\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "\nimport * as defaultImport from \"@splunk/react-docs/DockingTabBar\";\nexport * from \"@splunk/react-docs/DockingTabBar\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "\nimport * as defaultImport from \"@splunk/react-docs/API\";\nexport * from \"@splunk/react-docs/API\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "const previewVizMessage =\n '\u26A0\uFE0F This is a preview of a new visualization component. Minor updates and bug fixes should be expected.';\n\nexport default previewVizMessage;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;AACA,oBAA+B;AAC/B,0BAAc;AACd,IAAO,gBAAS,aAAa,gBAA8B,wBAAU;;;ACHrE;AAAA;AAAA;AAAA;AACA,IAAAA,iBAA+B;AAC/B,2BAAc;AACd,IAAO,iBAAS,aAAaA,iBAA8B,yBAAUA;;;ACHrE;AAAA;AAAA;AAAA;AACA,IAAAC,iBAA+B;AAC/B,kCAAc;AACd,IAAO,wBAAS,aAAaA,iBAA8B,yBAAUA;;;ACHrE;AAAA;AAAA;AAAA;AACA,IAAAC,iBAA+B;AAC/B,wBAAc;AACd,IAAO,cAAS,aAAaA,iBAA8B,yBAAUA;;;ACHrE,IAAM,oBACF;AAEJ,IAAO,4BAAQ;;;ALwBf,IAAM,iBAAN,MAAM,uBAA4B,wBAAkD;AAAA,EAKhF,YAAY,MAAM;AACd,UAAM,IAAI;AAId,2BAAkB,QAAM;AACpB,WAAK,SAAS;AAAA,IAClB;AAEA,+BAAsB,CAAC,GAAG,EAAE,cAAc,MAAM;AAC5C,qBAAc,iBAAiB;AAC/B,WAAK,SAAS,EAAE,eAAe,cAAc,GAAG,MAAM;AAElD,cAAM,EAAE,IAAI,IAAI,KAAK,OAAO,sBAAsB;AAClD,YAAI,MAAM,OAAO,SAAS;AACtB,gBAAM,SAAS,MAAM,OAAO,UAAU;AACtC,iBAAO,OAAO,GAAG,MAAM;AAAA,QAC3B;AAAA,MACJ,CAAC;AAAA,IACL;AAjBI,SAAK,QA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