@splunk/react-page 6.1.1 → 6.3.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 +15 -1
- package/cypress.config.js +21 -0
- package/lib/index.js +149 -37
- package/package.json +4 -3
- package/cypress/plugins/index.js +0 -11
- package/cypress.json +0 -10
- /package/cypress/support/{index.js → e2e.js} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,20 @@
|
|
|
1
1
|
Change Log
|
|
2
2
|
============
|
|
3
3
|
|
|
4
|
+
6.3.0 - August 1, 2023
|
|
5
|
+
----------
|
|
6
|
+
New Features:
|
|
7
|
+
* `options.onLayoutComplete` parameter supports a callback function which executes after layout API is fetched and compiled.
|
|
8
|
+
|
|
9
|
+
6.2.0 - July 27, 2023
|
|
10
|
+
----------
|
|
11
|
+
New Features:
|
|
12
|
+
* `options.lazyLoadLayout` parameter has been added to `layout` to allow lazy loading of layout (SPL-241546).
|
|
13
|
+
* `options.splunkBarFallback` and `options.appBarFallback` parameters have been added to `layout` to allow customization of fallback components for the layout (SPL-241546).
|
|
14
|
+
|
|
15
|
+
Notes:
|
|
16
|
+
* An container element has been added to the DOM for the app content to support `lazyLoadLayout`
|
|
17
|
+
|
|
4
18
|
6.1.1 - June 6, 2023
|
|
5
19
|
----------
|
|
6
20
|
API Changes:
|
|
@@ -9,7 +23,7 @@ API Changes:
|
|
|
9
23
|
6.1.0 - May 2, 2023
|
|
10
24
|
----------
|
|
11
25
|
New Features:
|
|
12
|
-
*
|
|
26
|
+
* A new `options.loader` parameter has been added to `layout` to allow `requirejs` to be used instead of `scriptjs` (SUI-5341).
|
|
13
27
|
|
|
14
28
|
Bug Fixes:
|
|
15
29
|
* `layout` will no longer automatically fall back to `requirejs` if `scriptjs` fails to load, reversing the behavior introduced in 6.0.4 (SUI-5341).
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/* eslint-env node */
|
|
2
|
+
const { defineConfig } = require('cypress');
|
|
3
|
+
|
|
4
|
+
module.exports = defineConfig({
|
|
5
|
+
env: {},
|
|
6
|
+
defaultCommandTimeout: 1000,
|
|
7
|
+
fixturesFolder: false,
|
|
8
|
+
video: false,
|
|
9
|
+
videoUploadOnPasses: false,
|
|
10
|
+
e2e: {
|
|
11
|
+
setupNodeEvents(on) {
|
|
12
|
+
on('before:browser:launch', (browser = {}, launchOptions) => {
|
|
13
|
+
if (browser.name === 'chrome') {
|
|
14
|
+
launchOptions.args.push('--disable-gpu');
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
},
|
|
18
|
+
baseUrl: 'http://localhost:8000',
|
|
19
|
+
specPattern: 'src/tests/**.spec.js',
|
|
20
|
+
},
|
|
21
|
+
});
|
package/lib/index.js
CHANGED
|
@@ -107,7 +107,7 @@ module.exports = require("styled-components");
|
|
|
107
107
|
/* 3 */
|
|
108
108
|
/***/ (function(module, exports) {
|
|
109
109
|
|
|
110
|
-
module.exports = require("
|
|
110
|
+
module.exports = require("prop-types");
|
|
111
111
|
|
|
112
112
|
/***/ }),
|
|
113
113
|
/* 4 */
|
|
@@ -119,7 +119,7 @@ module.exports = require("@splunk/themes/SplunkThemeProvider");
|
|
|
119
119
|
/* 5 */
|
|
120
120
|
/***/ (function(module, exports) {
|
|
121
121
|
|
|
122
|
-
module.exports = require("
|
|
122
|
+
module.exports = require("react-dom");
|
|
123
123
|
|
|
124
124
|
/***/ }),
|
|
125
125
|
/* 6 */
|
|
@@ -159,13 +159,13 @@ module.exports = require("@splunk/ui-utils/i18n");
|
|
|
159
159
|
// ESM COMPAT FLAG
|
|
160
160
|
__webpack_require__.r(__webpack_exports__);
|
|
161
161
|
|
|
162
|
+
// EXTERNAL MODULE: external "react-dom"
|
|
163
|
+
var external_react_dom_ = __webpack_require__(5);
|
|
164
|
+
|
|
162
165
|
// EXTERNAL MODULE: external "react"
|
|
163
166
|
var external_react_ = __webpack_require__(0);
|
|
164
167
|
var external_react_default = /*#__PURE__*/__webpack_require__.n(external_react_);
|
|
165
168
|
|
|
166
|
-
// EXTERNAL MODULE: external "react-dom"
|
|
167
|
-
var external_react_dom_ = __webpack_require__(3);
|
|
168
|
-
|
|
169
169
|
// EXTERNAL MODULE: external "scriptjs"
|
|
170
170
|
var external_scriptjs_ = __webpack_require__(6);
|
|
171
171
|
var external_scriptjs_default = /*#__PURE__*/__webpack_require__.n(external_scriptjs_);
|
|
@@ -180,17 +180,6 @@ var url_ = __webpack_require__(8);
|
|
|
180
180
|
var SplunkThemeProvider_ = __webpack_require__(4);
|
|
181
181
|
var SplunkThemeProvider_default = /*#__PURE__*/__webpack_require__.n(SplunkThemeProvider_);
|
|
182
182
|
|
|
183
|
-
// EXTERNAL MODULE: external "prop-types"
|
|
184
|
-
var external_prop_types_ = __webpack_require__(5);
|
|
185
|
-
var external_prop_types_default = /*#__PURE__*/__webpack_require__.n(external_prop_types_);
|
|
186
|
-
|
|
187
|
-
// EXTERNAL MODULE: external "@splunk/react-ui/ScreenReaderContent"
|
|
188
|
-
var ScreenReaderContent_ = __webpack_require__(9);
|
|
189
|
-
var ScreenReaderContent_default = /*#__PURE__*/__webpack_require__.n(ScreenReaderContent_);
|
|
190
|
-
|
|
191
|
-
// EXTERNAL MODULE: external "@splunk/ui-utils/i18n"
|
|
192
|
-
var i18n_ = __webpack_require__(10);
|
|
193
|
-
|
|
194
183
|
// EXTERNAL MODULE: external "styled-components"
|
|
195
184
|
var external_styled_components_ = __webpack_require__(2);
|
|
196
185
|
var external_styled_components_default = /*#__PURE__*/__webpack_require__.n(external_styled_components_);
|
|
@@ -220,7 +209,7 @@ function _templateObject5() {
|
|
|
220
209
|
}
|
|
221
210
|
|
|
222
211
|
function _templateObject4() {
|
|
223
|
-
var data = _taggedTemplateLiteral(["\n background-color: ", ";\n min-height:
|
|
212
|
+
var data = _taggedTemplateLiteral(["\n background-color: ", ";\n min-height: ", "px;\n"]);
|
|
224
213
|
|
|
225
214
|
_templateObject4 = function _templateObject4() {
|
|
226
215
|
return data;
|
|
@@ -230,7 +219,7 @@ function _templateObject4() {
|
|
|
230
219
|
}
|
|
231
220
|
|
|
232
221
|
function _templateObject3() {
|
|
233
|
-
var data = _taggedTemplateLiteral(["\n padding: 0;\n background-color: ", ";\n height:
|
|
222
|
+
var data = _taggedTemplateLiteral(["\n padding: 0;\n background-color: ", ";\n height: ", "px;\n"]);
|
|
234
223
|
|
|
235
224
|
_templateObject3 = function _templateObject3() {
|
|
236
225
|
return data;
|
|
@@ -263,22 +252,35 @@ function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(
|
|
|
263
252
|
|
|
264
253
|
|
|
265
254
|
|
|
255
|
+
var APPBAR_HEIGHT = 45;
|
|
256
|
+
var SPLUNKBAR_HEIGHT = 34;
|
|
266
257
|
var blink = Object(external_styled_components_["keyframes"])(_templateObject());
|
|
267
258
|
var Main = external_styled_components_default.a.div(_templateObject2(), themes_["variables"].backgroundColorPage);
|
|
268
259
|
var SplunkBar = external_styled_components_default.a.div(_templateObject3(), Object(themes_["pick"])({
|
|
269
260
|
prisma: themes_["variables"].backgroundColorSection,
|
|
270
261
|
enterprise: themes_["variables"].gray20
|
|
271
|
-
}));
|
|
262
|
+
}), SPLUNKBAR_HEIGHT);
|
|
272
263
|
var AppBar = external_styled_components_default.a.div(_templateObject4(), Object(themes_["pick"])({
|
|
273
264
|
prisma: themes_["variables"].backgroundColorPopup,
|
|
274
265
|
enterprise: themes_["variables"].gray30
|
|
275
|
-
}));
|
|
266
|
+
}), APPBAR_HEIGHT);
|
|
276
267
|
var AppBody = external_styled_components_default.a.div(_templateObject5(), themes_["variables"].contentColorInverted);
|
|
277
268
|
var Dot = external_styled_components_default.a.div(_templateObject6(), blink, themes_["variables"].neutral500, Object(themes_["pick"])({
|
|
278
269
|
prisma: themes_["variables"].spacingMedium,
|
|
279
270
|
enterprise: themes_["variables"].spacingHalf
|
|
280
271
|
}));
|
|
281
272
|
|
|
273
|
+
// EXTERNAL MODULE: external "prop-types"
|
|
274
|
+
var external_prop_types_ = __webpack_require__(3);
|
|
275
|
+
var external_prop_types_default = /*#__PURE__*/__webpack_require__.n(external_prop_types_);
|
|
276
|
+
|
|
277
|
+
// EXTERNAL MODULE: external "@splunk/react-ui/ScreenReaderContent"
|
|
278
|
+
var ScreenReaderContent_ = __webpack_require__(9);
|
|
279
|
+
var ScreenReaderContent_default = /*#__PURE__*/__webpack_require__.n(ScreenReaderContent_);
|
|
280
|
+
|
|
281
|
+
// EXTERNAL MODULE: external "@splunk/ui-utils/i18n"
|
|
282
|
+
var i18n_ = __webpack_require__(10);
|
|
283
|
+
|
|
282
284
|
// CONCATENATED MODULE: ./src/Loading.jsx
|
|
283
285
|
|
|
284
286
|
|
|
@@ -288,25 +290,31 @@ var Dot = external_styled_components_default.a.div(_templateObject6(), blink, th
|
|
|
288
290
|
var propTypes = {
|
|
289
291
|
hideAppBar: external_prop_types_default.a.bool,
|
|
290
292
|
hideChrome: external_prop_types_default.a.bool,
|
|
291
|
-
hideSplunkBar: external_prop_types_default.a.bool
|
|
293
|
+
hideSplunkBar: external_prop_types_default.a.bool,
|
|
294
|
+
AppBarFallback: external_prop_types_default.a.elementType,
|
|
295
|
+
SplunkBarFallback: external_prop_types_default.a.elementType
|
|
292
296
|
};
|
|
293
297
|
var defaultProps = {
|
|
294
298
|
hideAppBar: false,
|
|
295
299
|
hideChrome: false,
|
|
296
|
-
hideSplunkBar: false
|
|
300
|
+
hideSplunkBar: false,
|
|
301
|
+
AppBarFallback: AppBar,
|
|
302
|
+
SplunkBarFallback: SplunkBar
|
|
297
303
|
};
|
|
298
304
|
|
|
299
305
|
function Loading(_ref) {
|
|
300
306
|
var hideAppBar = _ref.hideAppBar,
|
|
301
307
|
hideChrome = _ref.hideChrome,
|
|
302
|
-
hideSplunkBar = _ref.hideSplunkBar
|
|
303
|
-
|
|
308
|
+
hideSplunkBar = _ref.hideSplunkBar,
|
|
309
|
+
SplunkBarFallback = _ref.SplunkBarFallback,
|
|
310
|
+
AppBarFallback = _ref.AppBarFallback;
|
|
311
|
+
return /*#__PURE__*/external_react_default.a.createElement(Main, null, !hideChrome && !hideSplunkBar && /*#__PURE__*/external_react_default.a.createElement(SplunkBarFallback, null), !hideChrome && !hideAppBar && /*#__PURE__*/external_react_default.a.createElement(AppBarFallback, null), /*#__PURE__*/external_react_default.a.createElement(AppBody, null, /*#__PURE__*/external_react_default.a.createElement(Dot, null), /*#__PURE__*/external_react_default.a.createElement(Dot, null), /*#__PURE__*/external_react_default.a.createElement(Dot, null), /*#__PURE__*/external_react_default.a.createElement(ScreenReaderContent_default.a, null, Object(i18n_["_"])('Loading'))));
|
|
304
312
|
}
|
|
305
313
|
|
|
306
314
|
Loading.propTypes = propTypes;
|
|
307
315
|
Loading.defaultProps = defaultProps;
|
|
308
316
|
/* harmony default export */ var src_Loading = (Loading);
|
|
309
|
-
// CONCATENATED MODULE: ./src/
|
|
317
|
+
// CONCATENATED MODULE: ./src/baseLayout.jsx
|
|
310
318
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
311
319
|
|
|
312
320
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
@@ -320,6 +328,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
320
328
|
|
|
321
329
|
var LIGHT_LAYOUT = 'build/api/layout.js';
|
|
322
330
|
var DARK_LAYOUT = 'build/api/layout-dark.js';
|
|
331
|
+
var HEADER_SELECTOR = 'header[data-view="splunkjs/mvc/headerview"]';
|
|
323
332
|
/**
|
|
324
333
|
* Loads the layout from the server, using requirejs if available on the window and scriptjs if not.
|
|
325
334
|
*
|
|
@@ -352,10 +361,29 @@ function getLayoutApi(theme, callback) {
|
|
|
352
361
|
throw new Error('Invalid options.loader configuration: must be "scriptjs" or "requirejs".');
|
|
353
362
|
}
|
|
354
363
|
}
|
|
364
|
+
/**
|
|
365
|
+
* renders body element and attaches it to container node in DOM
|
|
366
|
+
*
|
|
367
|
+
* @param {element} element
|
|
368
|
+
* @param {element} render - A render function that returns an unmount() function.
|
|
369
|
+
* @param {HTMLDivElement} container
|
|
370
|
+
* @param {boolean} useGlobalLayerStack
|
|
371
|
+
* @param {object} splunkTheme
|
|
372
|
+
* @private
|
|
373
|
+
*/
|
|
374
|
+
|
|
375
|
+
|
|
376
|
+
function renderBody(element, render, container) {
|
|
377
|
+
var useGlobalLayerStack = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
378
|
+
var splunkTheme = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {};
|
|
379
|
+
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);
|
|
380
|
+
return render(wrappedElement, container);
|
|
381
|
+
}
|
|
355
382
|
/**
|
|
356
383
|
* Renders a React element into the Layout API.
|
|
357
384
|
* @public
|
|
358
385
|
* @param {element} element - A React element.
|
|
386
|
+
* @param {element} render - A render function that returns an unmount() function.
|
|
359
387
|
* @param {object} [options]
|
|
360
388
|
* @param {string} [options.pageTitle] - Changes the page title.
|
|
361
389
|
* @param {Boolean} [options.hideAppBar = false] - Hides the app bar.
|
|
@@ -371,11 +399,15 @@ function getLayoutApi(theme, callback) {
|
|
|
371
399
|
* @param {String} [options.theme = 'light'] - Used to theme UI elements. Ex. "light" or "dark".
|
|
372
400
|
* @param {String} [options.loader = 'scriptjs'] - Configures the loader used for the loading the layout - available loaders are "scriptjs" and "requirejs".
|
|
373
401
|
* Change this only if the default loader does not work for your application.
|
|
402
|
+
* @param {Boolean} [options.lazyLoadLayout = false] - Prioritizes loading the React element and lazily fetches and compiles the layout API (navigation bar).
|
|
403
|
+
* @param {element} [options.SplunkBarFallback = SplunkBar] - A React element used as a placeholder for the splunk bar while the navigation bar is loading.
|
|
404
|
+
* @param {element} [options.AppBarFallback = AppBar] - A React element used as a placeholder for the app bar while the navigation bar is loading.
|
|
405
|
+
* @param {function} [options.onLayoutComplete] - A callback function which executes after layout API is fetched and compiled.
|
|
374
406
|
*/
|
|
375
407
|
|
|
376
408
|
|
|
377
|
-
function layout(element) {
|
|
378
|
-
var _ref2 = arguments.length >
|
|
409
|
+
function layout(element, render) {
|
|
410
|
+
var _ref2 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
379
411
|
|
|
380
412
|
var _ref2$useGlobalLayerS = _ref2.useGlobalLayerStack,
|
|
381
413
|
useGlobalLayerStack = _ref2$useGlobalLayerS === void 0 ? true : _ref2$useGlobalLayerS,
|
|
@@ -390,7 +422,18 @@ function layout(element) {
|
|
|
390
422
|
document.title = pageTitle;
|
|
391
423
|
}
|
|
392
424
|
|
|
393
|
-
var
|
|
425
|
+
var hideChrome = layoutAPIOptions.hideChrome,
|
|
426
|
+
hideAppBar = layoutAPIOptions.hideAppBar,
|
|
427
|
+
hideSplunkBar = layoutAPIOptions.hideSplunkBar,
|
|
428
|
+
_layoutAPIOptions$Spl = layoutAPIOptions.SplunkBarFallback,
|
|
429
|
+
SplunkBarFallback = _layoutAPIOptions$Spl === void 0 ? SplunkBar : _layoutAPIOptions$Spl,
|
|
430
|
+
_layoutAPIOptions$App = layoutAPIOptions.AppBarFallback,
|
|
431
|
+
AppBarFallback = _layoutAPIOptions$App === void 0 ? AppBar : _layoutAPIOptions$App,
|
|
432
|
+
_layoutAPIOptions$laz = layoutAPIOptions.lazyLoadLayout,
|
|
433
|
+
lazyLoadLayout = _layoutAPIOptions$laz === void 0 ? false : _layoutAPIOptions$laz,
|
|
434
|
+
onLayoutComplete = layoutAPIOptions.onLayoutComplete;
|
|
435
|
+
var bodyContainer = document.createElement('div');
|
|
436
|
+
var headerContainer = document.createElement('div'); // The "theme" in enterprise used to be "enterprise" instead of "light"...
|
|
394
437
|
|
|
395
438
|
var colorScheme = theme === 'light' || theme === 'enterprise' ? 'light' : 'dark';
|
|
396
439
|
var splunkTheme = {
|
|
@@ -398,8 +441,23 @@ function layout(element) {
|
|
|
398
441
|
colorScheme: colorScheme,
|
|
399
442
|
density: 'comfortable'
|
|
400
443
|
};
|
|
401
|
-
|
|
402
|
-
|
|
444
|
+
var bodyRoot;
|
|
445
|
+
var headerRoot;
|
|
446
|
+
|
|
447
|
+
if (lazyLoadLayout) {
|
|
448
|
+
// render the React app immediately without waiting for layout API
|
|
449
|
+
document.body.appendChild(headerContainer);
|
|
450
|
+
headerRoot = render( /*#__PURE__*/external_react_default.a.createElement(external_react_default.a.Fragment, null, !hideChrome && !hideSplunkBar && /*#__PURE__*/external_react_default.a.createElement(SplunkBarFallback, null), !hideChrome && !hideAppBar && /*#__PURE__*/external_react_default.a.createElement(AppBarFallback, null)), headerContainer); // explicitly set height of header container to avoid layout shift when fallback gets replaced
|
|
451
|
+
|
|
452
|
+
var headerHeight = headerContainer.offsetHeight;
|
|
453
|
+
headerContainer.style.cssText = "height: ".concat(headerHeight, "px");
|
|
454
|
+
document.body.appendChild(bodyContainer);
|
|
455
|
+
bodyRoot = renderBody(element, render, bodyContainer, useGlobalLayerStack, splunkTheme);
|
|
456
|
+
} else {
|
|
457
|
+
document.body.appendChild(bodyContainer);
|
|
458
|
+
bodyRoot = render( /*#__PURE__*/external_react_default.a.createElement(SplunkThemeProvider_default.a, splunkTheme, /*#__PURE__*/external_react_default.a.createElement(src_Loading, layoutAPIOptions)), bodyContainer);
|
|
459
|
+
}
|
|
460
|
+
|
|
403
461
|
getLayoutApi(theme, function (layoutApi) {
|
|
404
462
|
var containerEl;
|
|
405
463
|
|
|
@@ -433,18 +491,72 @@ function layout(element) {
|
|
|
433
491
|
document.body.appendChild(containerEl);
|
|
434
492
|
}
|
|
435
493
|
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
var
|
|
440
|
-
|
|
441
|
-
|
|
494
|
+
if (lazyLoadLayout) {
|
|
495
|
+
// replace placeholder nav bar with real nav bar
|
|
496
|
+
headerRoot.unmount(headerContainer);
|
|
497
|
+
var header = document.querySelector(HEADER_SELECTOR);
|
|
498
|
+
var containerHeight = (!hideChrome && !hideSplunkBar ? SPLUNKBAR_HEIGHT : 0) + (!hideChrome && !hideAppBar ? APPBAR_HEIGHT : 0);
|
|
499
|
+
headerContainer.style.cssText = "height: ".concat(containerHeight, "px");
|
|
500
|
+
headerContainer.appendChild(header);
|
|
501
|
+
containerEl.appendChild(bodyContainer);
|
|
502
|
+
onLayoutComplete === null || onLayoutComplete === void 0 ? void 0 : onLayoutComplete();
|
|
503
|
+
} else {
|
|
504
|
+
setTimeout(function () {
|
|
505
|
+
bodyRoot.unmount(bodyContainer);
|
|
506
|
+
bodyRoot = renderBody(element, render, bodyContainer, useGlobalLayerStack, splunkTheme);
|
|
507
|
+
containerEl.appendChild(bodyContainer);
|
|
508
|
+
onLayoutComplete === null || onLayoutComplete === void 0 ? void 0 : onLayoutComplete();
|
|
509
|
+
}, 30);
|
|
510
|
+
}
|
|
442
511
|
}, {
|
|
443
512
|
loader: loader
|
|
444
513
|
});
|
|
445
514
|
}
|
|
446
515
|
|
|
447
|
-
/* harmony default export */ var
|
|
516
|
+
/* harmony default export */ var baseLayout = (layout);
|
|
517
|
+
// CONCATENATED MODULE: ./src/index.jsx
|
|
518
|
+
|
|
519
|
+
|
|
520
|
+
|
|
521
|
+
var src_renderShim = function renderShim(elementToRender, container) {
|
|
522
|
+
Object(external_react_dom_["render"])(elementToRender, container);
|
|
523
|
+
return {
|
|
524
|
+
unmount: function unmount() {
|
|
525
|
+
return Object(external_react_dom_["unmountComponentAtNode"])(container);
|
|
526
|
+
}
|
|
527
|
+
};
|
|
528
|
+
};
|
|
529
|
+
/**
|
|
530
|
+
* Renders a React element into the Layout API.
|
|
531
|
+
* @public
|
|
532
|
+
* @param {element} element - A React element.
|
|
533
|
+
* @param {object} [options]
|
|
534
|
+
* @param {string} [options.pageTitle] - Changes the page title.
|
|
535
|
+
* @param {Boolean} [options.hideAppBar = false] - Hides the app bar.
|
|
536
|
+
* @param {Boolean} [options.hideAppsList = false] - Hides the app list in
|
|
537
|
+
* the Splunk bar.
|
|
538
|
+
* @param {Boolean} [options.hideChrome = false] - Renders only the main content, hiding
|
|
539
|
+
* the Splunk bar, app bar, and footer.
|
|
540
|
+
* @param {Boolean} [options.hideFooter = false] - Hides the footer.
|
|
541
|
+
* @param {Boolean} [options.hideSplunkBar = false] - Hides the Splunk bar.
|
|
542
|
+
* @param {string} [options.layout = 'scrolling'] - Set to `fixed` to fix all navigation bars
|
|
543
|
+
* to the edge of the page.
|
|
544
|
+
* @param {Boolean} [options.useGlobalLayerStack = true] - Wraps elements in @splunk/react-ui's LayerStackGlobalProvider.
|
|
545
|
+
* @param {String} [options.theme = 'light'] - Used to theme UI elements. Ex. "light" or "dark".
|
|
546
|
+
* @param {String} [options.loader = 'scriptjs'] - Configures the loader used for the loading the layout - available loaders are "scriptjs" and "requirejs".
|
|
547
|
+
* Change this only if the default loader does not work for your application.
|
|
548
|
+
* @param {Boolean} [options.lazyLoadLayout = false] - Prioritizes loading the React element and lazily fetches and compiles the layout API (navigation bar).
|
|
549
|
+
* @param {element} [options.SplunkBarFallback = SplunkBar] - A React element used as a placeholder for the splunk bar while the navigation bar is loading.
|
|
550
|
+
* @param {element} [options.AppBarFallback = AppBar] - A React element used as a placeholder for the app bar while the navigation bar is loading.
|
|
551
|
+
* @param {function} [options.onLayoutComplete] - A callback function which executes after layout API is fetched and compiled.
|
|
552
|
+
*/
|
|
553
|
+
|
|
554
|
+
|
|
555
|
+
function src_layout(element, options) {
|
|
556
|
+
baseLayout(element, src_renderShim, options);
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
/* harmony default export */ var src = __webpack_exports__["default"] = (src_layout);
|
|
448
560
|
|
|
449
561
|
/***/ })
|
|
450
562
|
/******/ ]);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@splunk/react-page",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.3.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",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"test:cypress:ci": "node src/tests/run-cypress-tests.js"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@splunk/react-ui": "^4.
|
|
25
|
+
"@splunk/react-ui": "^4.19.0",
|
|
26
26
|
"@splunk/splunk-utils": "^2.3.4",
|
|
27
27
|
"@splunk/themes": "^0.16.1",
|
|
28
28
|
"@splunk/ui-utils": "^1.6.0",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@babel/core": "^7.2.0",
|
|
34
|
-
"@splunk/babel-preset": "^
|
|
34
|
+
"@splunk/babel-preset": "^4.0.0",
|
|
35
35
|
"@splunk/cicd-tools": "^0.5.0",
|
|
36
36
|
"@splunk/eslint-config": "^4.0.0",
|
|
37
37
|
"@splunk/stylelint-config": "^4.0.0",
|
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
"babel-loader": "^8.0.4",
|
|
41
41
|
"babel-plugin-transform-imports": "^2.0.0",
|
|
42
42
|
"cross-env": "^6.0.3",
|
|
43
|
+
"cypress": "^12.17.1",
|
|
43
44
|
"eslint": "^7.14.0",
|
|
44
45
|
"eslint-config-airbnb": "^18.2.1",
|
|
45
46
|
"eslint-config-prettier": "^6.15.0",
|
package/cypress/plugins/index.js
DELETED
package/cypress.json
DELETED
|
File without changes
|