@splunk/react-page 5.1.0 → 6.0.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/CHANGELOG.md +26 -0
- package/lib/index.js +39 -43
- package/package.json +10 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,32 @@
|
|
|
1
1
|
Change Log
|
|
2
2
|
============
|
|
3
3
|
|
|
4
|
+
6.0.0 - June 29, 2022
|
|
5
|
+
----------
|
|
6
|
+
API Changes:
|
|
7
|
+
* `loadingThemeOverride` option has been removed and replaced with `theme`.
|
|
8
|
+
* The Layout API now renders the appropriate `SplunkThemeProvider` so you don't have to.
|
|
9
|
+
Notes:
|
|
10
|
+
* The `layout` API can now be themed with a light or dark theme.
|
|
11
|
+
* To determine the user's current theme preference for the layout API, use the `getUserTheme` function available in versions 2.2.0 and above of `@splunk/splunk-utils/themes`.
|
|
12
|
+
|
|
13
|
+
5.2.1 - April 5, 2022
|
|
14
|
+
----------
|
|
15
|
+
API Changes:
|
|
16
|
+
* Pinned `styled-components@5.1.1` to avoid breaking changes introduced in `styled-components@5.2.0`.
|
|
17
|
+
|
|
18
|
+
**`@splunk/react-page` is incompatible with styled-components version(s) `^5.2.0`**.
|
|
19
|
+
|
|
20
|
+
`styled-components@5.2.0` changed how selectors like `& + &` are compiled; [styled-components PR#3236](https://github.com/styled-components/styled-components/pull/3236).
|
|
21
|
+
This breaks styles that worked in previous versions of styled-components; [styled-components issue #3265](https://github.com/styled-components/styled-components/issues/3265).
|
|
22
|
+
|
|
23
|
+
**Until noted otherwise in a future release of `@splunk/react-page` do not use `styled-components@^5.2.0` with` @splunk/react-page`**.
|
|
24
|
+
|
|
25
|
+
5.2.0 - February 23, 2022
|
|
26
|
+
----------
|
|
27
|
+
Notes:
|
|
28
|
+
* Remove IE browser testing from functional tests.
|
|
29
|
+
|
|
4
30
|
5.1.0 - September 8, 2021
|
|
5
31
|
----------
|
|
6
32
|
New Features:
|
package/lib/index.js
CHANGED
|
@@ -82,7 +82,7 @@ module.exports =
|
|
|
82
82
|
/******/
|
|
83
83
|
/******/
|
|
84
84
|
/******/ // Load entry module and return exports
|
|
85
|
-
/******/ return __webpack_require__(__webpack_require__.s =
|
|
85
|
+
/******/ return __webpack_require__(__webpack_require__.s = 11);
|
|
86
86
|
/******/ })
|
|
87
87
|
/************************************************************************/
|
|
88
88
|
/******/ ([
|
|
@@ -113,13 +113,13 @@ module.exports = require("react-dom");
|
|
|
113
113
|
/* 4 */
|
|
114
114
|
/***/ (function(module, exports) {
|
|
115
115
|
|
|
116
|
-
module.exports = require("
|
|
116
|
+
module.exports = require("@splunk/themes/SplunkThemeProvider");
|
|
117
117
|
|
|
118
118
|
/***/ }),
|
|
119
119
|
/* 5 */
|
|
120
120
|
/***/ (function(module, exports) {
|
|
121
121
|
|
|
122
|
-
module.exports = require("
|
|
122
|
+
module.exports = require("prop-types");
|
|
123
123
|
|
|
124
124
|
/***/ }),
|
|
125
125
|
/* 6 */
|
|
@@ -143,22 +143,16 @@ module.exports = require("@splunk/splunk-utils/url");
|
|
|
143
143
|
/* 9 */
|
|
144
144
|
/***/ (function(module, exports) {
|
|
145
145
|
|
|
146
|
-
module.exports = require("@splunk/themes/SplunkThemeProvider");
|
|
147
|
-
|
|
148
|
-
/***/ }),
|
|
149
|
-
/* 10 */
|
|
150
|
-
/***/ (function(module, exports) {
|
|
151
|
-
|
|
152
146
|
module.exports = require("@splunk/react-ui/ScreenReaderContent");
|
|
153
147
|
|
|
154
148
|
/***/ }),
|
|
155
|
-
/*
|
|
149
|
+
/* 10 */
|
|
156
150
|
/***/ (function(module, exports) {
|
|
157
151
|
|
|
158
152
|
module.exports = require("@splunk/ui-utils/i18n");
|
|
159
153
|
|
|
160
154
|
/***/ }),
|
|
161
|
-
/*
|
|
155
|
+
/* 11 */
|
|
162
156
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
163
157
|
|
|
164
158
|
"use strict";
|
|
@@ -183,29 +177,26 @@ var Layer_ = __webpack_require__(7);
|
|
|
183
177
|
var url_ = __webpack_require__(8);
|
|
184
178
|
|
|
185
179
|
// EXTERNAL MODULE: external "@splunk/themes/SplunkThemeProvider"
|
|
186
|
-
var SplunkThemeProvider_ = __webpack_require__(
|
|
180
|
+
var SplunkThemeProvider_ = __webpack_require__(4);
|
|
187
181
|
var SplunkThemeProvider_default = /*#__PURE__*/__webpack_require__.n(SplunkThemeProvider_);
|
|
188
182
|
|
|
189
|
-
// EXTERNAL MODULE: external "@splunk/splunk-utils/themes"
|
|
190
|
-
var themes_ = __webpack_require__(5);
|
|
191
|
-
|
|
192
183
|
// EXTERNAL MODULE: external "prop-types"
|
|
193
|
-
var external_prop_types_ = __webpack_require__(
|
|
184
|
+
var external_prop_types_ = __webpack_require__(5);
|
|
194
185
|
var external_prop_types_default = /*#__PURE__*/__webpack_require__.n(external_prop_types_);
|
|
195
186
|
|
|
196
187
|
// EXTERNAL MODULE: external "@splunk/react-ui/ScreenReaderContent"
|
|
197
|
-
var ScreenReaderContent_ = __webpack_require__(
|
|
188
|
+
var ScreenReaderContent_ = __webpack_require__(9);
|
|
198
189
|
var ScreenReaderContent_default = /*#__PURE__*/__webpack_require__.n(ScreenReaderContent_);
|
|
199
190
|
|
|
200
191
|
// EXTERNAL MODULE: external "@splunk/ui-utils/i18n"
|
|
201
|
-
var i18n_ = __webpack_require__(
|
|
192
|
+
var i18n_ = __webpack_require__(10);
|
|
202
193
|
|
|
203
194
|
// EXTERNAL MODULE: external "styled-components"
|
|
204
195
|
var external_styled_components_ = __webpack_require__(2);
|
|
205
196
|
var external_styled_components_default = /*#__PURE__*/__webpack_require__.n(external_styled_components_);
|
|
206
197
|
|
|
207
198
|
// EXTERNAL MODULE: external "@splunk/themes"
|
|
208
|
-
var
|
|
199
|
+
var themes_ = __webpack_require__(1);
|
|
209
200
|
|
|
210
201
|
// CONCATENATED MODULE: ./src/LoadingStyles.js
|
|
211
202
|
function _templateObject6() {
|
|
@@ -273,19 +264,19 @@ function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(
|
|
|
273
264
|
|
|
274
265
|
|
|
275
266
|
var blink = Object(external_styled_components_["keyframes"])(_templateObject());
|
|
276
|
-
var Main = external_styled_components_default.a.div(_templateObject2(),
|
|
277
|
-
var SplunkBar = external_styled_components_default.a.div(_templateObject3(), Object(
|
|
278
|
-
prisma:
|
|
279
|
-
enterprise:
|
|
267
|
+
var Main = external_styled_components_default.a.div(_templateObject2(), themes_["variables"].backgroundColorPage);
|
|
268
|
+
var SplunkBar = external_styled_components_default.a.div(_templateObject3(), Object(themes_["pick"])({
|
|
269
|
+
prisma: themes_["variables"].backgroundColorSection,
|
|
270
|
+
enterprise: themes_["variables"].gray20
|
|
280
271
|
}));
|
|
281
|
-
var AppBar = external_styled_components_default.a.div(_templateObject4(), Object(
|
|
282
|
-
prisma:
|
|
283
|
-
enterprise:
|
|
272
|
+
var AppBar = external_styled_components_default.a.div(_templateObject4(), Object(themes_["pick"])({
|
|
273
|
+
prisma: themes_["variables"].backgroundColorPopup,
|
|
274
|
+
enterprise: themes_["variables"].gray30
|
|
284
275
|
}));
|
|
285
|
-
var AppBody = external_styled_components_default.a.div(_templateObject5(),
|
|
286
|
-
var Dot = external_styled_components_default.a.div(_templateObject6(), blink,
|
|
287
|
-
prisma:
|
|
288
|
-
enterprise:
|
|
276
|
+
var AppBody = external_styled_components_default.a.div(_templateObject5(), themes_["variables"].contentColorInverted);
|
|
277
|
+
var Dot = external_styled_components_default.a.div(_templateObject6(), blink, themes_["variables"].neutral500, Object(themes_["pick"])({
|
|
278
|
+
prisma: themes_["variables"].spacingMedium,
|
|
279
|
+
enterprise: themes_["variables"].spacingHalf
|
|
289
280
|
}));
|
|
290
281
|
|
|
291
282
|
// CONCATENATED MODULE: ./src/Loading.jsx
|
|
@@ -327,7 +318,8 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
327
318
|
|
|
328
319
|
|
|
329
320
|
|
|
330
|
-
|
|
321
|
+
var LIGHT_LAYOUT = 'build/api/layout.js';
|
|
322
|
+
var DARK_LAYOUT = 'build/api/layout-dark.js';
|
|
331
323
|
/**
|
|
332
324
|
* Loads the layout from the server, using requirejs if available on the window and scriptjs if not.
|
|
333
325
|
*
|
|
@@ -335,8 +327,9 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
335
327
|
* @private
|
|
336
328
|
*/
|
|
337
329
|
|
|
338
|
-
function getLayoutApi(callback) {
|
|
339
|
-
var
|
|
330
|
+
function getLayoutApi(theme, callback) {
|
|
331
|
+
var themedLayout = theme === 'dark' ? DARK_LAYOUT : LIGHT_LAYOUT;
|
|
332
|
+
var url = Object(url_["createStaticURL"])(themedLayout);
|
|
340
333
|
|
|
341
334
|
if (window.requirejs) {
|
|
342
335
|
window.requirejs([url], callback);
|
|
@@ -362,9 +355,8 @@ function getLayoutApi(callback) {
|
|
|
362
355
|
* @param {Boolean} [options.hideSplunkBar = false] - Hides the Splunk bar.
|
|
363
356
|
* @param {string} [options.layout = 'scrolling'] - Set to `fixed` to fix all navigation bars
|
|
364
357
|
* to the edge of the page.
|
|
365
|
-
* @param {string} [options.loadingThemeOverride] - Allows the theme provided by Splunk Enterprise to the loading screen
|
|
366
|
-
* to be overridden with `enterprise` or `enterpriseDark`.
|
|
367
358
|
* @param {Boolean} [options.useGlobalLayerStack = true] - Wraps elements in @splunk/react-ui's LayerStackGlobalProvider.
|
|
359
|
+
* @param {String} [options.theme = 'light'] - Used to theme UI elements. Ex. "light" or "dark".
|
|
368
360
|
*/
|
|
369
361
|
|
|
370
362
|
|
|
@@ -373,20 +365,24 @@ function layout(element) {
|
|
|
373
365
|
|
|
374
366
|
var _ref$useGlobalLayerSt = _ref.useGlobalLayerStack,
|
|
375
367
|
useGlobalLayerStack = _ref$useGlobalLayerSt === void 0 ? true : _ref$useGlobalLayerSt,
|
|
376
|
-
loadingThemeOverride = _ref.loadingThemeOverride,
|
|
377
368
|
pageTitle = _ref.pageTitle,
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
var loadingTheme = Object(themes_["getThemeOptions"])(loadingThemeOverride || Object(themes_["defaultTheme"])());
|
|
369
|
+
_ref$theme = _ref.theme,
|
|
370
|
+
theme = _ref$theme === void 0 ? 'light' : _ref$theme,
|
|
371
|
+
layoutAPIOptions = _objectWithoutProperties(_ref, ["useGlobalLayerStack", "pageTitle", "theme"]);
|
|
382
372
|
|
|
383
373
|
if (pageTitle) {
|
|
384
374
|
document.title = pageTitle;
|
|
385
375
|
}
|
|
386
376
|
|
|
377
|
+
var loadingContainer = document.createElement('div');
|
|
378
|
+
var splunkTheme = {
|
|
379
|
+
family: 'enterprise',
|
|
380
|
+
colorScheme: theme,
|
|
381
|
+
density: 'comfortable'
|
|
382
|
+
};
|
|
387
383
|
document.body.appendChild(loadingContainer);
|
|
388
|
-
Object(external_react_dom_["render"])( /*#__PURE__*/external_react_default.a.createElement(SplunkThemeProvider_default.a,
|
|
389
|
-
getLayoutApi(function (layoutApi) {
|
|
384
|
+
Object(external_react_dom_["render"])( /*#__PURE__*/external_react_default.a.createElement(SplunkThemeProvider_default.a, splunkTheme, /*#__PURE__*/external_react_default.a.createElement(src_Loading, layoutAPIOptions)), loadingContainer);
|
|
385
|
+
getLayoutApi(theme, function (layoutApi) {
|
|
390
386
|
var containerEl;
|
|
391
387
|
|
|
392
388
|
if (layoutApi) {
|
|
@@ -422,7 +418,7 @@ function layout(element) {
|
|
|
422
418
|
setTimeout(function () {
|
|
423
419
|
Object(external_react_dom_["unmountComponentAtNode"])(loadingContainer);
|
|
424
420
|
loadingContainer.parentNode.removeChild(loadingContainer);
|
|
425
|
-
var wrappedElement = useGlobalLayerStack ? /*#__PURE__*/external_react_default.a.createElement(Layer_["LayerStackGlobalProvider"], null, element) : element;
|
|
421
|
+
var wrappedElement = useGlobalLayerStack ? /*#__PURE__*/external_react_default.a.createElement(Layer_["LayerStackGlobalProvider"], null, /*#__PURE__*/external_react_default.a.createElement(SplunkThemeProvider_default.a, splunkTheme, element)) : /*#__PURE__*/external_react_default.a.createElement(SplunkThemeProvider_default.a, splunkTheme, element);
|
|
426
422
|
Object(external_react_dom_["render"])(wrappedElement, containerEl);
|
|
427
423
|
}, 30);
|
|
428
424
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@splunk/react-page",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.0",
|
|
4
4
|
"description": "Load React components into the latest layout from Splunk Enterprise",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -17,13 +17,15 @@
|
|
|
17
17
|
"test:functional:prepare": "node src/tests/helpers/prepare_environment.js 8.0.3",
|
|
18
18
|
"test:functional": "yarn run test:functional:prepare && splunk-wdio-functional-test-runner functional.local.conf.js",
|
|
19
19
|
"test:functional:ci": "yarn run test:functional:prepare && splunk-wdio-functional-test-runner functional.ci.conf.js",
|
|
20
|
-
"test:functional:cloud": "yarn run test:functional:prepare && splunk-wdio-functional-test-runner functional.cloud.conf.js"
|
|
20
|
+
"test:functional:cloud": "yarn run test:functional:prepare && splunk-wdio-functional-test-runner functional.cloud.conf.js",
|
|
21
|
+
"test:cypress": "echo TODO: SUI-3442",
|
|
22
|
+
"test:cypress:ci": "echo TODO: SUI-3442"
|
|
21
23
|
},
|
|
22
24
|
"dependencies": {
|
|
23
|
-
"@splunk/react-ui": "^4.
|
|
24
|
-
"@splunk/splunk-utils": "^2.
|
|
25
|
-
"@splunk/themes": "^0.
|
|
26
|
-
"@splunk/ui-utils": "^1.
|
|
25
|
+
"@splunk/react-ui": "^4.10.0",
|
|
26
|
+
"@splunk/splunk-utils": "^2.2.0",
|
|
27
|
+
"@splunk/themes": "^0.11.0",
|
|
28
|
+
"@splunk/ui-utils": "^1.5.0",
|
|
27
29
|
"prop-types": "^15.6.2",
|
|
28
30
|
"scriptjs": "^2.5.8"
|
|
29
31
|
},
|
|
@@ -49,7 +51,7 @@
|
|
|
49
51
|
"react": "^16.12.0",
|
|
50
52
|
"react-dom": "^16.12.0",
|
|
51
53
|
"style-loader": "^0.23.1",
|
|
52
|
-
"styled-components": "
|
|
54
|
+
"styled-components": "5.1.1",
|
|
53
55
|
"stylelint": "^13.0.0",
|
|
54
56
|
"webpack": "^4.16.2",
|
|
55
57
|
"webpack-cli": "^3.1.0",
|
|
@@ -58,7 +60,7 @@
|
|
|
58
60
|
"peerDependencies": {
|
|
59
61
|
"react": "^16.8",
|
|
60
62
|
"react-dom": "^16.8",
|
|
61
|
-
"styled-components": "
|
|
63
|
+
"styled-components": "5.1.1"
|
|
62
64
|
},
|
|
63
65
|
"engines": {
|
|
64
66
|
"node": ">=6"
|