@splunk/visualizations-shared 27.5.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/AsyncStoryDecorator.js +64 -0
- package/AsyncStoryDecorator.js.map +7 -0
- package/Downloader.js +41 -40
- package/Downloader.js.map +2 -2
- package/FileDownloader.js +25 -40
- package/FileDownloader.js.map +2 -2
- package/Message.js +10 -41
- package/Message.js.map +4 -4
- package/RemoteIcon.js +35 -48
- package/RemoteIcon.js.map +4 -4
- package/RemoteImage.js +27 -43
- package/RemoteImage.js.map +4 -4
- package/SanitizeProps.js +1 -0
- package/SanitizeProps.js.map +2 -2
- package/SizeAwareWrapper.js +16 -29
- package/SizeAwareWrapper.js.map +3 -3
- package/VisualizationDocPage.js +34 -88
- package/VisualizationDocPage.js.map +4 -4
- package/colorConstants.js +5 -1
- package/colorConstants.js.map +2 -2
- package/i18n.js +12 -3
- package/i18n.js.map +2 -2
- package/numberUtils.js.map +2 -2
- package/package.json +21 -19
- package/SizeAwareWrapperDeprecated.js +0 -145
- package/SizeAwareWrapperDeprecated.js.map +0 -7
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "Visualizations Shared Files",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
5
5
|
"author": "Splunk",
|
|
6
|
-
"version": "
|
|
6
|
+
"version": "28.1.0",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"build": "viz-build --no-types",
|
|
9
9
|
"build-storybook": "sb build -c .storybook -o .storybook-bundle",
|
|
@@ -18,21 +18,22 @@
|
|
|
18
18
|
"test": "yarn run test:unit && yarn run test:integration",
|
|
19
19
|
"test:ci": "yarn run test:unit:ci",
|
|
20
20
|
"test:integration": "echo integration test",
|
|
21
|
-
"test:unit": "jest src/.*",
|
|
21
|
+
"test:unit": "jest src/.* --transformIgnorePatterns \"node_modules/(?!@splunk/react-docs)/\"",
|
|
22
22
|
"test:unit:ci": "yarn run test:unit",
|
|
23
|
-
"test:unit:watch": "
|
|
23
|
+
"test:unit:watch": "yarn test:unit --watch src/.*",
|
|
24
24
|
"test:visual": "yarn build-storybook --quiet && yarn loki test --reactUri file:./.storybook-bundle",
|
|
25
25
|
"test:visual:ci": "yarn test:visual --requireReference --verboseRenderer",
|
|
26
26
|
"test:visual:update": "yarn loki approve"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@
|
|
30
|
-
"@splunk/
|
|
31
|
-
"@splunk/react-
|
|
32
|
-
"@splunk/
|
|
33
|
-
"@splunk/
|
|
34
|
-
"@splunk/
|
|
35
|
-
"@splunk/visualization-
|
|
29
|
+
"@loki/create-async-callback": "^0.35.1",
|
|
30
|
+
"@splunk/moment": "^0.7.0",
|
|
31
|
+
"@splunk/react-icons": "^5.1.0",
|
|
32
|
+
"@splunk/react-ui": "^5.1.0",
|
|
33
|
+
"@splunk/themes": "^1.2.0",
|
|
34
|
+
"@splunk/ui-utils": "^1.10.0",
|
|
35
|
+
"@splunk/visualization-encoding": "^28.1.0",
|
|
36
|
+
"@splunk/visualization-schemas": "^28.1.0",
|
|
36
37
|
"element-resize-detector": "^1.2.4",
|
|
37
38
|
"lodash": "^4.17.21",
|
|
38
39
|
"numeral": "^2.0.6",
|
|
@@ -40,25 +41,26 @@
|
|
|
40
41
|
"xmlserializer": "^0.6.1"
|
|
41
42
|
},
|
|
42
43
|
"peerDependencies": {
|
|
43
|
-
"@splunk/visualization-context": "^
|
|
44
|
-
"react": "^
|
|
45
|
-
"react-dom": "^
|
|
44
|
+
"@splunk/visualization-context": "^28.1.0",
|
|
45
|
+
"react": "^18.3.1",
|
|
46
|
+
"react-dom": "^18.3.1",
|
|
46
47
|
"styled-components": "^5.3.10"
|
|
47
48
|
},
|
|
48
49
|
"devDependencies": {
|
|
49
|
-
"@splunk/react-docs": "1.
|
|
50
|
-
"@splunk/visualization-build-tools": "^
|
|
51
|
-
"@splunk/visualization-context": "^
|
|
50
|
+
"@splunk/react-docs": "^1.1.0",
|
|
51
|
+
"@splunk/visualization-build-tools": "^28.1.0",
|
|
52
|
+
"@splunk/visualization-context": "^28.1.0",
|
|
52
53
|
"@storybook/addon-actions": "^7.6.20",
|
|
53
54
|
"@storybook/addons": "^7.6.20",
|
|
54
55
|
"@storybook/react": "^7.6.20",
|
|
55
56
|
"@storybook/react-webpack5": "^7.6.20",
|
|
56
|
-
"@testing-library/
|
|
57
|
+
"@testing-library/dom": "^10.4.1",
|
|
58
|
+
"@testing-library/react": "^16.2.0",
|
|
57
59
|
"jest-canvas-mock": "^2.5.2",
|
|
58
60
|
"jest-styled-components": "^7.2.0",
|
|
59
61
|
"loki": "^0.35.1",
|
|
60
|
-
"react": "^
|
|
61
|
-
"react-dom": "^
|
|
62
|
+
"react": "^18.3.1",
|
|
63
|
+
"react-dom": "^18.3.1",
|
|
62
64
|
"styled-components": "^5.3.10",
|
|
63
65
|
"text-encoding": "^0.7.0"
|
|
64
66
|
}
|
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
/* Copyright © 2020 Splunk Inc.
|
|
2
|
-
SPLUNK CONFIDENTIAL – Use or disclosure of this material in whole or
|
|
3
|
-
in part without a valid written license from Splunk Inc. is PROHIBITED. */
|
|
4
|
-
var __create = Object.create;
|
|
5
|
-
var __defProp = Object.defineProperty;
|
|
6
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
7
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
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
|
-
var __export = (target, all) => {
|
|
12
|
-
for (var name in all)
|
|
13
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
14
|
-
};
|
|
15
|
-
var __copyProps = (to, from, except, desc) => {
|
|
16
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
17
|
-
for (let key of __getOwnPropNames(from))
|
|
18
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
19
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
20
|
-
}
|
|
21
|
-
return to;
|
|
22
|
-
};
|
|
23
|
-
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
24
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
25
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
26
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
27
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
28
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
29
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
30
|
-
mod
|
|
31
|
-
));
|
|
32
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
33
|
-
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
34
|
-
|
|
35
|
-
// src/SizeAwareWrapperDeprecated.jsx
|
|
36
|
-
var SizeAwareWrapperDeprecated_exports = {};
|
|
37
|
-
__export(SizeAwareWrapperDeprecated_exports, {
|
|
38
|
-
default: () => SizeAwareWrapperDeprecated_default
|
|
39
|
-
});
|
|
40
|
-
module.exports = __toCommonJS(SizeAwareWrapperDeprecated_exports);
|
|
41
|
-
|
|
42
|
-
// esm-externals:react
|
|
43
|
-
var react_exports = {};
|
|
44
|
-
__export(react_exports, {
|
|
45
|
-
default: () => react_default
|
|
46
|
-
});
|
|
47
|
-
var defaultImport = __toESM(require("react"));
|
|
48
|
-
__reExport(react_exports, require("react"));
|
|
49
|
-
var react_default = "default" in defaultImport ? defaultImport.default : defaultImport;
|
|
50
|
-
|
|
51
|
-
// esm-externals:prop-types
|
|
52
|
-
var prop_types_exports = {};
|
|
53
|
-
__export(prop_types_exports, {
|
|
54
|
-
default: () => prop_types_default
|
|
55
|
-
});
|
|
56
|
-
var defaultImport2 = __toESM(require("prop-types"));
|
|
57
|
-
__reExport(prop_types_exports, require("prop-types"));
|
|
58
|
-
var prop_types_default = "default" in defaultImport2 ? defaultImport2.default : defaultImport2;
|
|
59
|
-
|
|
60
|
-
// src/SizeAwareWrapperDeprecated.jsx
|
|
61
|
-
var styles = {
|
|
62
|
-
position: "absolute",
|
|
63
|
-
width: 0,
|
|
64
|
-
height: 0,
|
|
65
|
-
visibility: "hidden",
|
|
66
|
-
display: "none"
|
|
67
|
-
};
|
|
68
|
-
var SizeAwareWrapperDeprecated = class extends react_exports.PureComponent {
|
|
69
|
-
constructor(props) {
|
|
70
|
-
super(props);
|
|
71
|
-
__publicField(this, "getElement", () => {
|
|
72
|
-
const parentElement = this.el && this.el.parentElement;
|
|
73
|
-
return parentElement;
|
|
74
|
-
});
|
|
75
|
-
__publicField(this, "handleResize", (entries) => {
|
|
76
|
-
entries.forEach((entry) => {
|
|
77
|
-
const { width, height } = entry.contentRect;
|
|
78
|
-
this.animationFrameID = window.requestAnimationFrame(() => {
|
|
79
|
-
this.setState({ width, height });
|
|
80
|
-
});
|
|
81
|
-
});
|
|
82
|
-
});
|
|
83
|
-
__publicField(this, "renderChildren", () => {
|
|
84
|
-
const { width, height } = this.state;
|
|
85
|
-
const { children } = this.props;
|
|
86
|
-
if (width != null && height != null && typeof children === "function") {
|
|
87
|
-
return children({ width, height });
|
|
88
|
-
}
|
|
89
|
-
return null;
|
|
90
|
-
});
|
|
91
|
-
this.state = {
|
|
92
|
-
width: null,
|
|
93
|
-
height: null
|
|
94
|
-
};
|
|
95
|
-
this.animationFrameID = null;
|
|
96
|
-
this.ro = this.getResizeObserver();
|
|
97
|
-
}
|
|
98
|
-
componentDidMount() {
|
|
99
|
-
const resizableElement = this.getElement();
|
|
100
|
-
if (resizableElement) {
|
|
101
|
-
this.ro.observe(resizableElement);
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
componentWillUnmount() {
|
|
105
|
-
const resizableElement = this.getElement();
|
|
106
|
-
if (resizableElement) {
|
|
107
|
-
this.ro.unobserve(resizableElement);
|
|
108
|
-
}
|
|
109
|
-
if (window && this.animationFrameID) {
|
|
110
|
-
window.cancelAnimationFrame(this.animationFrameID);
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
getResizeObserver() {
|
|
114
|
-
if (typeof ResizeObserver !== "function") {
|
|
115
|
-
return {
|
|
116
|
-
observe() {
|
|
117
|
-
},
|
|
118
|
-
unobserve() {
|
|
119
|
-
}
|
|
120
|
-
};
|
|
121
|
-
}
|
|
122
|
-
return new ResizeObserver(this.handleResize);
|
|
123
|
-
}
|
|
124
|
-
render() {
|
|
125
|
-
return /* @__PURE__ */ react_default.createElement(react_default.Fragment, null, /* @__PURE__ */ react_default.createElement(
|
|
126
|
-
"div",
|
|
127
|
-
{
|
|
128
|
-
key: "resize-detector",
|
|
129
|
-
style: styles,
|
|
130
|
-
ref: (el) => {
|
|
131
|
-
this.el = el;
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
), this.renderChildren());
|
|
135
|
-
}
|
|
136
|
-
};
|
|
137
|
-
SizeAwareWrapperDeprecated.propTypes = {
|
|
138
|
-
children: prop_types_default.any
|
|
139
|
-
// eslint-disable-line react/forbid-prop-types
|
|
140
|
-
};
|
|
141
|
-
SizeAwareWrapperDeprecated.defaultProps = {
|
|
142
|
-
children: null
|
|
143
|
-
};
|
|
144
|
-
var SizeAwareWrapperDeprecated_default = SizeAwareWrapperDeprecated;
|
|
145
|
-
//# sourceMappingURL=SizeAwareWrapperDeprecated.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["src/SizeAwareWrapperDeprecated.jsx", "esm-externals:react", "esm-externals:prop-types"],
|
|
4
|
-
"sourcesContent": ["import React, { PureComponent } from 'react';\nimport T from 'prop-types';\n\nconst styles = {\n position: 'absolute',\n width: 0,\n height: 0,\n visibility: 'hidden',\n display: 'none',\n};\n\nclass SizeAwareWrapperDeprecated extends PureComponent {\n constructor(props) {\n super(props);\n this.state = {\n width: null,\n height: null,\n };\n this.animationFrameID = null;\n this.ro = this.getResizeObserver();\n }\n\n componentDidMount() {\n const resizableElement = this.getElement();\n if (resizableElement) {\n this.ro.observe(resizableElement);\n }\n }\n\n componentWillUnmount() {\n const resizableElement = this.getElement();\n if (resizableElement) {\n this.ro.unobserve(resizableElement);\n }\n if (window && this.animationFrameID) {\n window.cancelAnimationFrame(this.animationFrameID);\n }\n }\n\n getElement = () => {\n // it listens on the size of its parent elemnt\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 entries.forEach(entry => {\n const { width, height } = entry.contentRect;\n // use requestAnimationFrame to make sure width/height is updated in time\n this.animationFrameID = window.requestAnimationFrame(() => {\n this.setState({ width, height });\n });\n });\n };\n\n renderChildren = () => {\n // expect children to be a function\n const { width, height } = this.state;\n const { children } = this.props;\n if (width != null && height != null && typeof children === 'function') {\n return children({ width, height });\n }\n return null;\n };\n\n render() {\n return (\n <React.Fragment>\n <div\n key=\"resize-detector\"\n style={styles}\n ref={el => {\n this.el = el;\n }}\n />\n {this.renderChildren()}\n </React.Fragment>\n );\n }\n}\n\nSizeAwareWrapperDeprecated.propTypes = {\n children: T.any, // eslint-disable-line react/forbid-prop-types\n};\n\nSizeAwareWrapperDeprecated.defaultProps = {\n children: null,\n};\n\nexport default SizeAwareWrapperDeprecated;\n", "\nimport * as defaultImport from \"react\";\nexport * from \"react\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "\nimport * as defaultImport from \"prop-types\";\nexport * from \"prop-types\";\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,+BAAc;AACd,IAAO,qBAAS,aAAaA,iBAA8B,yBAAUA;;;AFArE,IAAM,SAAS;AAAA,EACX,UAAU;AAAA,EACV,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,YAAY;AAAA,EACZ,SAAS;AACb;AAEA,IAAM,6BAAN,cAAyC,4BAAc;AAAA,EACnD,YAAY,OAAO;AACf,UAAM,KAAK;AA0Bf,sCAAa,MAAM;AAEf,YAAM,gBAAgB,KAAK,MAAM,KAAK,GAAG;AACzC,aAAO;AAAA,IACX;AAYA,wCAAe,aAAW;AACtB,cAAQ,QAAQ,WAAS;AACrB,cAAM,EAAE,OAAO,OAAO,IAAI,MAAM;AAEhC,aAAK,mBAAmB,OAAO,sBAAsB,MAAM;AACvD,eAAK,SAAS,EAAE,OAAO,OAAO,CAAC;AAAA,QACnC,CAAC;AAAA,MACL,CAAC;AAAA,IACL;AAEA,0CAAiB,MAAM;AAEnB,YAAM,EAAE,OAAO,OAAO,IAAI,KAAK;AAC/B,YAAM,EAAE,SAAS,IAAI,KAAK;AAC1B,UAAI,SAAS,QAAQ,UAAU,QAAQ,OAAO,aAAa,YAAY;AACnE,eAAO,SAAS,EAAE,OAAO,OAAO,CAAC;AAAA,MACrC;AACA,aAAO;AAAA,IACX;AA3DI,SAAK,QAAQ;AAAA,MACT,OAAO;AAAA,MACP,QAAQ;AAAA,IACZ;AACA,SAAK,mBAAmB;AACxB,SAAK,KAAK,KAAK,kBAAkB;AAAA,EACrC;AAAA,EAEA,oBAAoB;AAChB,UAAM,mBAAmB,KAAK,WAAW;AACzC,QAAI,kBAAkB;AAClB,WAAK,GAAG,QAAQ,gBAAgB;AAAA,IACpC;AAAA,EACJ;AAAA,EAEA,uBAAuB;AACnB,UAAM,mBAAmB,KAAK,WAAW;AACzC,QAAI,kBAAkB;AAClB,WAAK,GAAG,UAAU,gBAAgB;AAAA,IACtC;AACA,QAAI,UAAU,KAAK,kBAAkB;AACjC,aAAO,qBAAqB,KAAK,gBAAgB;AAAA,IACrD;AAAA,EACJ;AAAA,EAQA,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,EAsBA,SAAS;AACL,WACI,4CAAC,cAAM,UAAN,MACG;AAAA,MAAC;AAAA;AAAA,QACG,KAAI;AAAA,QACJ,OAAO;AAAA,QACP,KAAK,QAAM;AACP,eAAK,KAAK;AAAA,QACd;AAAA;AAAA,IACJ,GACC,KAAK,eAAe,CACzB;AAAA,EAER;AACJ;AAEA,2BAA2B,YAAY;AAAA,EACnC,UAAU,mBAAE;AAAA;AAChB;AAEA,2BAA2B,eAAe;AAAA,EACtC,UAAU;AACd;AAEA,IAAO,qCAAQ;",
|
|
6
|
-
"names": ["defaultImport"]
|
|
7
|
-
}
|