@splunk/react-page 8.2.0 → 8.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/18.js CHANGED
@@ -61,7 +61,7 @@
61
61
  e.r(n);
62
62
  // EXPORTS
63
63
  e.d(n, {
64
- default: () => /* binding */ se
64
+ default: () => /* binding */ ve
65
65
  });
66
66
  // CONCATENATED MODULE: external "react-dom/client"
67
67
  const r = require("react-dom/client");
@@ -74,115 +74,115 @@
74
74
  // CONCATENATED MODULE: external "@babel/runtime/helpers/asyncToGenerator"
75
75
  const l = require("@babel/runtime/helpers/asyncToGenerator");
76
76
  var u = e.n(l);
77
- // CONCATENATED MODULE: external "@babel/runtime/regenerator"
78
- const c = require("@babel/runtime/regenerator");
77
+ // CONCATENATED MODULE: external "@babel/runtime/helpers/taggedTemplateLiteral"
78
+ const c = require("@babel/runtime/helpers/taggedTemplateLiteral");
79
79
  var d = e.n(c);
80
- // CONCATENATED MODULE: external "react"
81
- const s = require("react");
80
+ // CONCATENATED MODULE: external "@babel/runtime/regenerator"
81
+ const s = require("@babel/runtime/regenerator");
82
82
  var p = e.n(s);
83
- // CONCATENATED MODULE: external "scriptjs"
84
- const v = require("scriptjs");
83
+ // CONCATENATED MODULE: external "react"
84
+ const v = require("react");
85
85
  var f = e.n(v);
86
+ // CONCATENATED MODULE: external "scriptjs"
87
+ const m = require("scriptjs");
88
+ var h = e.n(m);
89
+ // CONCATENATED MODULE: external "styled-components"
90
+ const b = require("styled-components");
91
+ var y = e.n(b);
86
92
  // CONCATENATED MODULE: external "@splunk/react-ui/Layer"
87
- const h = require("@splunk/react-ui/Layer");
93
+ const g = require("@splunk/react-ui/Layer");
88
94
  // CONCATENATED MODULE: external "@splunk/splunk-utils/url"
89
- const m = require("@splunk/splunk-utils/url");
95
+ const k = require("@splunk/splunk-utils/url");
90
96
  // CONCATENATED MODULE: external "@splunk/themes/SplunkThemeProvider"
91
- const b = require("@splunk/themes/SplunkThemeProvider");
92
- var y = e.n(b);
97
+ const w = require("@splunk/themes/SplunkThemeProvider");
98
+ var j = e.n(w);
99
+ // CONCATENATED MODULE: external "@splunk/themes"
100
+ const S = require("@splunk/themes");
93
101
  // CONCATENATED MODULE: external "@splunk/ui-utils/boolean"
94
- const g = require("@splunk/ui-utils/boolean");
102
+ const E = require("@splunk/ui-utils/boolean");
95
103
  // CONCATENATED MODULE: external "@splunk/ui-utils/i18n"
96
- const k = require("@splunk/ui-utils/i18n");
104
+ const O = require("@splunk/ui-utils/i18n");
97
105
  // CONCATENATED MODULE: external "@splunk/splunk-utils/fetch"
98
- const w = require("@splunk/splunk-utils/fetch");
106
+ const q = require("@splunk/splunk-utils/fetch");
99
107
  // CONCATENATED MODULE: external "prop-types"
100
- const j = require("prop-types");
101
- var S = e.n(j);
108
+ const C = require("prop-types");
109
+ var x = e.n(C);
102
110
  // CONCATENATED MODULE: external "@splunk/react-ui/ScreenReaderContent"
103
- const E = require("@splunk/react-ui/ScreenReaderContent");
104
- var O = e.n(E);
105
- // CONCATENATED MODULE: external "@babel/runtime/helpers/taggedTemplateLiteral"
106
- const q = require("@babel/runtime/helpers/taggedTemplateLiteral");
107
- var x = e.n(q);
108
- // CONCATENATED MODULE: external "styled-components"
109
- const C = require("styled-components");
110
- var B = e.n(C);
111
- // CONCATENATED MODULE: external "@splunk/themes"
112
- const P = require("@splunk/themes");
111
+ const B = require("@splunk/react-ui/ScreenReaderContent");
112
+ var P = e.n(B);
113
113
  // CONCATENATED MODULE: ./src/LoadingStyles.js
114
114
  function L() {
115
- var e = x()([ "\n animation-name: ", ";\n animation-duration: 1.4s;\n animation-iteration-count: infinite;\n animation-fill-mode: both;\n background-color: ", ";\n width: 10px;\n height: 10px;\n border-radius: 5px;\n display: inline-block;\n margin-right: ", ";\n\n &:nth-child(2) {\n animation-delay: 0.2s;\n }\n\n &:nth-child(3) {\n animation-delay: 0.4s;\n }\n" ]);
115
+ var e = d()([ "\n animation-name: ", ";\n animation-duration: 1.4s;\n animation-iteration-count: infinite;\n animation-fill-mode: both;\n background-color: ", ";\n width: 10px;\n height: 10px;\n border-radius: 5px;\n display: inline-block;\n margin-right: ", ";\n\n &:nth-child(2) {\n animation-delay: 0.2s;\n }\n\n &:nth-child(3) {\n animation-delay: 0.4s;\n }\n" ]);
116
116
  L = function n() {
117
117
  return e;
118
118
  };
119
119
  return e;
120
120
  }
121
121
  function _() {
122
- var e = x()([ "\n color: ", ";\n padding-top: 30vh;\n text-align: center;\n min-height: 400px;\n" ]);
122
+ var e = d()([ "\n color: ", ";\n padding-top: 30vh;\n text-align: center;\n min-height: 400px;\n" ]);
123
123
  _ = function n() {
124
124
  return e;
125
125
  };
126
126
  return e;
127
127
  }
128
128
  function T() {
129
- var e = x()([ "\n background-color: ", ";\n min-height: ", "px;\n" ]);
129
+ var e = d()([ "\n background-color: ", ";\n min-height: ", "px;\n" ]);
130
130
  T = function n() {
131
131
  return e;
132
132
  };
133
133
  return e;
134
134
  }
135
135
  function F() {
136
- var e = x()([ "\n padding: 0;\n background-color: ", ";\n height: ", "px;\n" ]);
136
+ var e = d()([ "\n padding: 0;\n background-color: ", ";\n height: ", "px;\n" ]);
137
137
  F = function n() {
138
138
  return e;
139
139
  };
140
140
  return e;
141
141
  }
142
142
  function A() {
143
- var e = x()([ "\n background-color: ", ";\n position: fixed;\n opacity: 1;\n z-index: 10000;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n" ]);
143
+ var e = d()([ "\n background-color: ", ";\n position: fixed;\n opacity: 1;\n z-index: 10000;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n" ]);
144
144
  A = function n() {
145
145
  return e;
146
146
  };
147
147
  return e;
148
148
  }
149
149
  function D() {
150
- var e = x()([ "\n 0% {\n opacity: 0.2;\n }\n\n 20% {\n opacity: 1;\n }\n\n 100% {\n opacity: 0.2;\n }\n" ]);
150
+ var e = d()([ "\n 0% {\n opacity: 0.2;\n }\n\n 20% {\n opacity: 1;\n }\n\n 100% {\n opacity: 0.2;\n }\n" ]);
151
151
  D = function n() {
152
152
  return e;
153
153
  };
154
154
  return e;
155
155
  }
156
- var R = 45;
157
- var G = 34;
158
- var H = (0, C.keyframes)(D());
159
- var M = B().div(A(), P.variables.backgroundColorPage);
160
- var z = B().div(F(), (0, P.pick)({
161
- prisma: P.variables.backgroundColorSection,
162
- enterprise: P.variables.gray20
163
- }), G);
164
- var U = B().div(T(), (0, P.pick)({
165
- prisma: P.variables.backgroundColorPopup,
166
- enterprise: P.variables.gray30
156
+ var G = 45;
157
+ var R = 34;
158
+ var H = (0, b.keyframes)(D());
159
+ var M = y().div(A(), S.variables.backgroundColorPage);
160
+ var z = y().div(F(), (0, S.pick)({
161
+ prisma: S.variables.backgroundColorSection,
162
+ enterprise: S.variables.gray20
167
163
  }), R);
168
- var I = B().div(_(), P.variables.contentColorInverted);
169
- var W = B().div(L(), H, P.variables.neutral500, (0, P.pick)({
170
- prisma: P.variables.spacingMedium,
171
- enterprise: P.variables.spacingSmall
164
+ var U = y().div(T(), (0, S.pick)({
165
+ prisma: S.variables.backgroundColorPopup,
166
+ enterprise: S.variables.gray30
167
+ }), G);
168
+ var I = y().div(_(), S.variables.contentColorInverted);
169
+ var W = y().div(L(), H, S.variables.neutral500, (0, S.pick)({
170
+ prisma: S.variables.spacingMedium,
171
+ enterprise: S.variables.spacingSmall
172
172
  }));
173
173
  // CONCATENATED MODULE: ./src/Loading.jsx
174
174
  var J = {
175
- hideAppBar: S().bool,
176
- hideChrome: S().bool,
177
- hideSplunkBar: S().bool,
178
- AppBarFallback: S().elementType,
179
- SplunkBarFallback: S().elementType
175
+ hideAppBar: x().bool,
176
+ hideChrome: x().bool,
177
+ hideSplunkBar: x().bool,
178
+ AppBarFallback: x().elementType,
179
+ SplunkBarFallback: x().elementType
180
180
  };
181
181
  function K(e) {
182
182
  var n = e.AppBarFallback, r = n === void 0 ? U : n, t = e.hideAppBar, a = e.hideChrome, o = e.hideSplunkBar, i = e.SplunkBarFallback, l = i === void 0 ? z : i;
183
183
 
184
- return p().createElement(M, null, !a && !o && p().createElement(l, null), !a && !t && p().createElement(r, null), p().createElement(I, null, p().createElement(W, null), p().createElement(W, null), p().createElement(W, null), p().createElement(O(), null, (0,
185
- k._)("Loading"))));
184
+ return f().createElement(M, null, !a && !o && f().createElement(l, null), !a && !t && f().createElement(r, null), f().createElement(I, null, f().createElement(W, null), f().createElement(W, null), f().createElement(W, null), f().createElement(P(), null, (0,
185
+ O._)("Loading"))));
186
186
  }
187
187
  K.propTypes = J;
188
188
  /* harmony default export */ const N = K;
@@ -208,19 +208,27 @@
208
208
  }
209
209
  return e;
210
210
  }
211
- var X = function e() {
212
- return fetch((0, m.createRESTURL)("web-features?output_mode=json", {
211
+ function X() {
212
+ var e = d()([ "\n body {\n background-color: ", ";\n }\n" ]);
213
+ X = function n() {
214
+ return e;
215
+ };
216
+ return e;
217
+ }
218
+ var Y = (0, b.createGlobalStyle)(X(), S.variables.backgroundColorPage);
219
+ var Z = function e() {
220
+ return fetch((0, k.createRESTURL)("web-features?output_mode=json", {
213
221
  app: "-",
214
222
  owner: "-",
215
223
  sharing: "system"
216
- })).then((0, w.handleResponse)(200))["catch"]((0, w.handleError)((0, k._)("failed to get web features")));
224
+ })).then((0, q.handleResponse)(200))["catch"]((0, q.handleError)((0, O._)("failed to get web features")));
217
225
  };
218
- var Y = "feature:modern-nav";
219
- var Z = function() {
220
- var e = u()( d().mark((function e(n) {
226
+ var $ = "feature:modern-nav";
227
+ var ee = function() {
228
+ var e = u()( p().mark((function e(n) {
221
229
  var r, t;
222
230
  var a, o;
223
- return d().wrap((function e(i) {
231
+ return p().wrap((function e(i) {
224
232
  while (1) {
225
233
  switch (i.prev = i.next) {
226
234
  case 0:
@@ -232,14 +240,14 @@
232
240
 
233
241
  case 2:
234
242
  i.next = 4;
235
- return X();
243
+ return Z();
236
244
 
237
245
  case 4:
238
246
  a = i.sent;
239
247
  o = a.entry.find((function(e) {
240
- return e.name === Y;
248
+ return e.name === $;
241
249
  }));
242
- return i.abrupt("return", (r = (0, g.normalizeBoolean)(o === null || o === void 0 ? void 0 : (t = o.content) === null || t === void 0 ? void 0 : t.enable_nav_vnext)) !== null && r !== void 0 ? r : false);
250
+ return i.abrupt("return", (r = (0, E.normalizeBoolean)(o === null || o === void 0 ? void 0 : (t = o.content) === null || t === void 0 ? void 0 : t.enable_nav_vnext)) !== null && r !== void 0 ? r : false);
243
251
 
244
252
  case 7:
245
253
  case "end":
@@ -252,10 +260,10 @@
252
260
  return e.apply(this, arguments);
253
261
  };
254
262
  }();
255
- var $ = "build/api/layout.js";
256
- var ee = "build/api/layout-dark.js";
257
- var ne = "build/api/layout-modern-nav.js";
258
- var re = 'header[data-view="splunkjs/mvc/headerview"]';
263
+ var ne = "build/api/layout.js";
264
+ var re = "build/api/layout-dark.js";
265
+ var te = "build/api/layout-modern-nav.js";
266
+ var ae = 'header[data-view="splunkjs/mvc/headerview"]';
259
267
  /**
260
268
  * Loads the layout from the server, using requirejs if available on the window and scriptjs if not.
261
269
  *
@@ -263,18 +271,18 @@
263
271
  * @param {object} [options]
264
272
  * @param {String} [options.loader = 'scriptjs'] - Configures the loader used for the loading the layout - available loaders are "scriptjs" and "requirejs".
265
273
  * @private
266
- */ function te(e, n, r) {
274
+ */ function oe(e, n, r) {
267
275
  var t = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}, a = t.loader, o = a === void 0 ? "scriptjs" : a;
268
- Z(n).then((function(n) {
276
+ ee(n).then((function(n) {
269
277
  var t;
270
278
  if (n) {
271
- t = ne;
279
+ t = te;
272
280
  } else {
273
- t = e === "dark" ? ee : $;
281
+ t = e === "dark" ? re : ne;
274
282
  }
275
- var a = (0, m.createStaticURL)(t);
283
+ var a = (0, k.createStaticURL)(t);
276
284
  if (o === "scriptjs") {
277
- f()(a, (function() {
285
+ h()(a, (function() {
278
286
  // eslint-disable-next-line no-underscore-dangle
279
287
  r(window.__splunk_layout__);
280
288
  }));
@@ -295,7 +303,7 @@
295
303
  * @param {HTMLDivElement} headerContainer
296
304
  * @param {object} [options]
297
305
  * @private
298
- */ function ae(e) {
306
+ */ function ie(e) {
299
307
  var n = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
300
308
  var r = n.hideSplunkBar, t = n.hideAppBar, a = n.headerHeight;
301
309
  var o = e.children[0];
@@ -310,7 +318,7 @@
310
318
  }
311
319
  return i;
312
320
  }
313
- function oe(e) {
321
+ function le(e) {
314
322
  var n = e.navLayout, r = e.baseOptions, t = e.additionalOptions;
315
323
  return n === "auto" ? V(V({}, r), t) : r;
316
324
  }
@@ -323,10 +331,10 @@
323
331
  * @param {boolean} useGlobalLayerStack
324
332
  * @param {object} splunkTheme
325
333
  * @private
326
- */ function ie(e, n, r) {
334
+ */ function ue(e, n, r) {
327
335
  var t = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
328
336
  var a = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {};
329
- var o = t ? p().createElement(h.LayerStackGlobalProvider, null, p().createElement(y(), a, e)) : p().createElement(y(), a, e);
337
+ var o = t ? f().createElement(g.LayerStackGlobalProvider, null, f().createElement(j(), a, f().createElement(Y, null), e)) : f().createElement(j(), a, f().createElement(Y, null), e);
330
338
  return n(o, r);
331
339
  }
332
340
  /**
@@ -356,67 +364,67 @@
356
364
  * @param {element} [options.SplunkBarFallback = SplunkBar] - A React element used as a placeholder for the splunk bar while the navigation bar is loading.
357
365
  * @param {element} [options.AppBarFallback = AppBar] - A React element used as a placeholder for the app bar while the navigation bar is loading.
358
366
  * @param {function} [options.onLayoutComplete] - A callback function which executes after layout API is fetched and compiled.
359
- */ function le(e, n) {
367
+ */ function ce(e, n) {
360
368
  var r = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
361
- var t = r.useGlobalLayerStack, o = t === void 0 ? true : t, i = r.pageTitle, l = r.theme, u = l === void 0 ? "light" : l, c = r.themeDensity, d = r.loader, s = d === void 0 ? "scriptjs" : d, v = a()(r, [ "useGlobalLayerStack", "pageTitle", "theme", "themeDensity", "loader" ]);
369
+ var t = r.useGlobalLayerStack, o = t === void 0 ? true : t, i = r.pageTitle, l = r.theme, u = l === void 0 ? "light" : l, c = r.themeDensity, d = r.loader, s = d === void 0 ? "scriptjs" : d, p = a()(r, [ "useGlobalLayerStack", "pageTitle", "theme", "themeDensity", "loader" ]);
362
370
  if (i) {
363
371
  document.title = i;
364
372
  }
365
- var f = v.hideChrome, h = v.themeFamily, m = h === void 0 ? "enterprise" : h, b = v.hideAppBar, g = v.hideSplunkBar, k = v.SplunkBarFallback, w = k === void 0 ? z : k, j = v.AppBarFallback, S = j === void 0 ? U : j, E = v.lazyLoadLayout, O = E === void 0 ? false : E, q = v.onLayoutComplete, x = v.onLayoutStart, C = v.navLayout, B = C === void 0 ? "classic" : C;
373
+ var v = p.hideChrome, m = p.themeFamily, h = m === void 0 ? "enterprise" : m, b = p.hideAppBar, y = p.hideSplunkBar, g = p.SplunkBarFallback, k = g === void 0 ? z : g, w = p.AppBarFallback, S = w === void 0 ? U : w, E = p.lazyLoadLayout, O = E === void 0 ? false : E, q = p.onLayoutComplete, C = p.onLayoutStart, x = p.navLayout, B = x === void 0 ? "classic" : x;
366
374
  var P = document.createElement("div");
367
375
  var L = document.createElement("div");
368
- x === null || x === void 0 ? void 0 : x({
376
+ C === null || C === void 0 ? void 0 : C({
369
377
  headerContainer: L,
370
378
  bodyContainer: P
371
379
  });
372
380
  // The "theme" in enterprise used to be "enterprise" instead of "light"...
373
381
  var _ = u === "light" || u === "enterprise" ? "light" : "dark";
374
382
  var T = {
375
- family: m,
383
+ family: h,
376
384
  colorScheme: _,
377
- density: c || (m === "prisma" ? "compact" : "comfortable")
385
+ density: c || (h === "prisma" ? "compact" : "comfortable")
378
386
  };
379
387
  var F;
380
388
  var A;
381
- if (v.navLayout === "auto") {
389
+ if (p.navLayout === "auto") {
382
390
  P.style.flexGrow = "1";
383
391
  }
384
392
  if (O) {
385
393
  // render the React app immediately without waiting for layout API
386
- if (!f) {
394
+ if (!v) {
387
395
  document.body.appendChild(L);
388
- A = n( p().createElement(p().Fragment, null, !g && p().createElement(w, null), !b && p().createElement(S, null)), L);
396
+ A = n( f().createElement(f().Fragment, null, !y && f().createElement(k, null), !b && f().createElement(S, null)), L);
389
397
  // explicitly set height and background of header container to avoid layout and color shift when fallback gets replaced
390
398
  var D = L.offsetHeight;
391
- var H = ae(L, {
392
- hideSplunkBar: g,
399
+ var H = ie(L, {
400
+ hideSplunkBar: y,
393
401
  hideAppBar: b,
394
402
  headerHeight: D,
395
403
  AppBarFallback: S,
396
- SplunkBarFallback: w
404
+ SplunkBarFallback: k
397
405
  });
398
406
  L.style.height = "".concat(D, "px");
399
407
  L.style.background = "".concat(H);
400
408
  }
401
409
  document.body.appendChild(P);
402
- F = ie(e, n, P, o, T);
410
+ F = ue(e, n, P, o, T);
403
411
  } else {
404
412
  document.body.appendChild(P);
405
- F = n( p().createElement(y(), T, p().createElement(N, v)), P);
413
+ F = n( f().createElement(j(), T, f().createElement(Y, null), f().createElement(N, p)), P);
406
414
  }
407
- te(u, B, (function(r) {
415
+ oe(u, B, (function(r) {
408
416
  var t;
409
417
  if (r) {
410
- var a = oe({
418
+ var a = le({
411
419
  navLayout: B,
412
- baseOptions: v,
420
+ baseOptions: p,
413
421
  additionalOptions: {
414
422
  theme: u,
415
- themeFamily: m
423
+ themeFamily: h
416
424
  }
417
425
  });
418
426
  t = r.create(a).getContainerElement();
419
- if (v.layout === "fixed") {
427
+ if (p.layout === "fixed") {
420
428
  // the above create method adds flex: 1 0 0
421
429
  // IE 11 disregards 0px shorthand for flex-basis component.
422
430
  // flex-basis 0% is better than 0px because css minification can remove px
@@ -441,11 +449,11 @@
441
449
  document.body.appendChild(t);
442
450
  }
443
451
  if (O) {
444
- if (!f) {
452
+ if (!v) {
445
453
  // replace placeholder nav bar with real nav bar
446
454
  A.unmount(L);
447
- var i = document.querySelector(re);
448
- var l = (!f && !g ? G : 0) + (!f && !b ? R : 0);
455
+ var i = document.querySelector(ae);
456
+ var l = (!v && !y ? R : 0) + (!v && !b ? G : 0);
449
457
  // set a min-height for basic nav bar components and auto height for any additional components like global banner
450
458
  L.style.minHeight = "".concat(l, "px");
451
459
  L.style.height = "auto";
@@ -456,7 +464,7 @@
456
464
  } else {
457
465
  setTimeout((function() {
458
466
  F.unmount(P);
459
- F = ie(e, n, P, o, T);
467
+ F = ue(e, n, P, o, T);
460
468
  t.appendChild(P);
461
469
  q === null || q === void 0 ? void 0 : q();
462
470
  }), 30);
@@ -465,9 +473,9 @@
465
473
  loader: s
466
474
  });
467
475
  }
468
- /* harmony default export */ const ue = le;
476
+ /* harmony default export */ const de = ce;
469
477
  // CONCATENATED MODULE: ./src/18.jsx
470
- var ce = function e(n, t) {
478
+ var se = function e(n, t) {
471
479
  var a = (0, r.createRoot)(t);
472
480
  a.render(n);
473
481
  return a;
@@ -495,9 +503,9 @@
495
503
  * @param {element} [options.SplunkBarFallback = SplunkBar] - A React element used as a placeholder for the splunk bar while the navigation bar is loading.
496
504
  * @param {element} [options.AppBarFallback = AppBar] - A React element used as a placeholder for the app bar while the navigation bar is loading.
497
505
  * @param {function} [options.onLayoutComplete] - A callback function which executes after layout API is fetched and compiled.
498
- */ function de(e, n) {
499
- ue(e, ce, n);
506
+ */ function pe(e, n) {
507
+ de(e, se, n);
500
508
  }
501
- /* harmony default export */ const se = de;
509
+ /* harmony default export */ const ve = pe;
502
510
  module.exports = n;
503
511
  /******/})();
package/CHANGELOG.md CHANGED
@@ -1,6 +1,11 @@
1
1
  Change Log
2
2
  ============
3
3
 
4
+ 8.2.1 - February 10, 2026
5
+ ----------
6
+ Bug Fixes:
7
+ * `layout` now sets the page's background color to match the current color scheme (SUI-7503).
8
+
4
9
  8.2.0 - January 8, 2025
5
10
  ----------
6
11
  New Features:
package/cypress.config.js CHANGED
@@ -1,6 +1,8 @@
1
1
  /* eslint-env node */
2
2
  const { defineConfig } = require('cypress');
3
3
 
4
+ const port = process.env.DOCKER_SPLUNK_PORT || 8000;
5
+
4
6
  module.exports = defineConfig({
5
7
  env: {},
6
8
  defaultCommandTimeout: 1000,
@@ -15,7 +17,7 @@ module.exports = defineConfig({
15
17
  }
16
18
  });
17
19
  },
18
- baseUrl: 'http://localhost:8000',
20
+ baseUrl: `http://localhost:${port}`,
19
21
  specPattern: 'src/tests/**.spec.js',
20
22
  },
21
23
  });
package/index.js CHANGED
@@ -63,7 +63,7 @@
63
63
  e.d(n, {
64
64
  AppBar: () => /* reexport */ g,
65
65
  SplunkBar: () => /* reexport */ y,
66
- default: () => /* binding */ se
66
+ default: () => /* binding */ ve
67
67
  });
68
68
  // CONCATENATED MODULE: external "react-dom"
69
69
  const r = require("react-dom");
@@ -210,15 +210,23 @@
210
210
  }
211
211
  return e;
212
212
  }
213
- var X = function e() {
213
+ function X() {
214
+ var e = a()([ "\n body {\n background-color: ", ";\n }\n" ]);
215
+ X = function n() {
216
+ return e;
217
+ };
218
+ return e;
219
+ }
220
+ var Y = (0, o.createGlobalStyle)(X(), l.variables.backgroundColorPage);
221
+ var Z = function e() {
214
222
  return fetch((0, F.createRESTURL)("web-features?output_mode=json", {
215
223
  app: "-",
216
224
  owner: "-",
217
225
  sharing: "system"
218
226
  })).then((0, R.handleResponse)(200))["catch"]((0, R.handleError)((0, M._)("failed to get web features")));
219
227
  };
220
- var Y = "feature:modern-nav";
221
- var Z = function() {
228
+ var $ = "feature:modern-nav";
229
+ var ee = function() {
222
230
  var e = C()( B().mark((function e(n) {
223
231
  var r, t;
224
232
  var a, o;
@@ -234,12 +242,12 @@
234
242
 
235
243
  case 2:
236
244
  i.next = 4;
237
- return X();
245
+ return Z();
238
246
 
239
247
  case 4:
240
248
  a = i.sent;
241
249
  o = a.entry.find((function(e) {
242
- return e.name === Y;
250
+ return e.name === $;
243
251
  }));
244
252
  return i.abrupt("return", (r = (0, H.normalizeBoolean)(o === null || o === void 0 ? void 0 : (t = o.content) === null || t === void 0 ? void 0 : t.enable_nav_vnext)) !== null && r !== void 0 ? r : false);
245
253
 
@@ -254,10 +262,10 @@
254
262
  return e.apply(this, arguments);
255
263
  };
256
264
  }();
257
- var $ = "build/api/layout.js";
258
- var ee = "build/api/layout-dark.js";
259
- var ne = "build/api/layout-modern-nav.js";
260
- var re = 'header[data-view="splunkjs/mvc/headerview"]';
265
+ var ne = "build/api/layout.js";
266
+ var re = "build/api/layout-dark.js";
267
+ var te = "build/api/layout-modern-nav.js";
268
+ var ae = 'header[data-view="splunkjs/mvc/headerview"]';
261
269
  /**
262
270
  * Loads the layout from the server, using requirejs if available on the window and scriptjs if not.
263
271
  *
@@ -265,14 +273,14 @@
265
273
  * @param {object} [options]
266
274
  * @param {String} [options.loader = 'scriptjs'] - Configures the loader used for the loading the layout - available loaders are "scriptjs" and "requirejs".
267
275
  * @private
268
- */ function te(e, n, r) {
276
+ */ function oe(e, n, r) {
269
277
  var t = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}, a = t.loader, o = a === void 0 ? "scriptjs" : a;
270
- Z(n).then((function(n) {
278
+ ee(n).then((function(n) {
271
279
  var t;
272
280
  if (n) {
273
- t = ne;
281
+ t = te;
274
282
  } else {
275
- t = e === "dark" ? ee : $;
283
+ t = e === "dark" ? re : ne;
276
284
  }
277
285
  var a = (0, F.createStaticURL)(t);
278
286
  if (o === "scriptjs") {
@@ -297,7 +305,7 @@
297
305
  * @param {HTMLDivElement} headerContainer
298
306
  * @param {object} [options]
299
307
  * @private
300
- */ function ae(e) {
308
+ */ function ie(e) {
301
309
  var n = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
302
310
  var r = n.hideSplunkBar, t = n.hideAppBar, a = n.headerHeight;
303
311
  var o = e.children[0];
@@ -312,7 +320,7 @@
312
320
  }
313
321
  return i;
314
322
  }
315
- function oe(e) {
323
+ function le(e) {
316
324
  var n = e.navLayout, r = e.baseOptions, t = e.additionalOptions;
317
325
  return n === "auto" ? V(V({}, r), t) : r;
318
326
  }
@@ -325,10 +333,10 @@
325
333
  * @param {boolean} useGlobalLayerStack
326
334
  * @param {object} splunkTheme
327
335
  * @private
328
- */ function ie(e, n, r) {
336
+ */ function ue(e, n, r) {
329
337
  var t = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
330
338
  var a = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {};
331
- var o = t ? L().createElement(A.LayerStackGlobalProvider, null, L().createElement(G(), a, e)) : L().createElement(G(), a, e);
339
+ var o = t ? L().createElement(A.LayerStackGlobalProvider, null, L().createElement(G(), a, L().createElement(Y, null), e)) : L().createElement(G(), a, L().createElement(Y, null), e);
332
340
  return n(o, r);
333
341
  }
334
342
  /**
@@ -358,7 +366,7 @@
358
366
  * @param {element} [options.SplunkBarFallback = SplunkBar] - A React element used as a placeholder for the splunk bar while the navigation bar is loading.
359
367
  * @param {element} [options.AppBarFallback = AppBar] - A React element used as a placeholder for the app bar while the navigation bar is loading.
360
368
  * @param {function} [options.onLayoutComplete] - A callback function which executes after layout API is fetched and compiled.
361
- */ function le(e, n) {
369
+ */ function ce(e, n) {
362
370
  var r = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
363
371
  var t = r.useGlobalLayerStack, a = t === void 0 ? true : t, o = r.pageTitle, i = r.theme, l = i === void 0 ? "light" : i, u = r.themeDensity, c = r.loader, d = c === void 0 ? "scriptjs" : c, s = S()(r, [ "useGlobalLayerStack", "pageTitle", "theme", "themeDensity", "loader" ]);
364
372
  if (o) {
@@ -390,7 +398,7 @@
390
398
  M = n( L().createElement(L().Fragment, null, !k && L().createElement(j, null), !b && L().createElement(O, null)), A);
391
399
  // explicitly set height and background of header container to avoid layout and color shift when fallback gets replaced
392
400
  var R = A.offsetHeight;
393
- var z = ae(A, {
401
+ var z = ie(A, {
394
402
  hideSplunkBar: k,
395
403
  hideAppBar: b,
396
404
  headerHeight: R,
@@ -401,15 +409,15 @@
401
409
  A.style.background = "".concat(z);
402
410
  }
403
411
  document.body.appendChild(T);
404
- H = ie(e, n, T, a, D);
412
+ H = ue(e, n, T, a, D);
405
413
  } else {
406
414
  document.body.appendChild(T);
407
- H = n( L().createElement(G(), D, L().createElement(K, s)), T);
415
+ H = n( L().createElement(G(), D, L().createElement(Y, null), L().createElement(K, s)), T);
408
416
  }
409
- te(l, _, (function(r) {
417
+ oe(l, _, (function(r) {
410
418
  var t;
411
419
  if (r) {
412
- var o = oe({
420
+ var o = le({
413
421
  navLayout: _,
414
422
  baseOptions: s,
415
423
  additionalOptions: {
@@ -446,7 +454,7 @@
446
454
  if (!p) {
447
455
  // replace placeholder nav bar with real nav bar
448
456
  M.unmount(A);
449
- var i = document.querySelector(re);
457
+ var i = document.querySelector(ae);
450
458
  var u = (!p && !k ? m : 0) + (!p && !b ? f : 0);
451
459
  // set a min-height for basic nav bar components and auto height for any additional components like global banner
452
460
  A.style.minHeight = "".concat(u, "px");
@@ -458,7 +466,7 @@
458
466
  } else {
459
467
  setTimeout((function() {
460
468
  H.unmount(T);
461
- H = ie(e, n, T, a, D);
469
+ H = ue(e, n, T, a, D);
462
470
  t.appendChild(T);
463
471
  x === null || x === void 0 ? void 0 : x();
464
472
  }), 30);
@@ -467,9 +475,9 @@
467
475
  loader: d
468
476
  });
469
477
  }
470
- /* harmony default export */ const ue = le;
478
+ /* harmony default export */ const de = ce;
471
479
  // CONCATENATED MODULE: ./src/index.jsx
472
- var ce = function e(n, t) {
480
+ var se = function e(n, t) {
473
481
  (0, r.render)(n, t);
474
482
  return {
475
483
  unmount: function e() {
@@ -503,9 +511,9 @@
503
511
  * @param {element} [options.AppBarFallback = AppBar] - A React element used as a placeholder for the app bar while the navigation bar is loading.
504
512
  * @param {function} [options.onLayoutComplete] - A callback function which executes after layout API is fetched and compiled.
505
513
  * @param {function} [options.onLayoutStart] - A callback function which executes once the layout starts to render
506
- */ function de(e, n) {
507
- ue(e, ce, n);
514
+ */ function pe(e, n) {
515
+ de(e, se, n);
508
516
  }
509
- /* harmony default export */ const se = de;
517
+ /* harmony default export */ const ve = pe;
510
518
  module.exports = n;
511
519
  /******/})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@splunk/react-page",
3
- "version": "8.2.0",
3
+ "version": "8.2.1",
4
4
  "description": "Load React components into the latest layout from Splunk Enterprise",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Splunk Inc.",
@@ -19,15 +19,15 @@
19
19
  "lint:ci": "yarn run eslint:ci && yarn run stylelint",
20
20
  "start": "cross-env NODE_ENV=development webpack --watch",
21
21
  "stylelint": "stylelint \"src/**/*.{js,jsx}\" --config stylelint.config.js",
22
- "test:cypress": "node src/tests/run-cypress-tests.js 8.0.3",
22
+ "test:cypress": "DOCKER_SPLUNK_VERSION=10.0.0 node src/tests/run-cypress-tests.js",
23
23
  "test:cypress:ci": "node src/tests/run-cypress-tests.js",
24
24
  "types:build": "tsc",
25
25
  "types:start": "yarn types:build --watch"
26
26
  },
27
27
  "dependencies": {
28
- "@splunk/react-ui": "^5.7.1",
28
+ "@splunk/react-ui": "^5.8.0",
29
29
  "@splunk/splunk-utils": "^3.4.0",
30
- "@splunk/themes": "^1.4.1",
30
+ "@splunk/themes": "^1.5.0",
31
31
  "@splunk/ui-utils": "^1.12.0",
32
32
  "prop-types": "^15.6.2",
33
33
  "scriptjs": "^2.5.8"
@@ -38,7 +38,7 @@
38
38
  "@babel/plugin-transform-runtime": "^7.28.3",
39
39
  "@splunk/babel-preset": "^4.0.0",
40
40
  "@splunk/eslint-config": "^5.0.0",
41
- "@splunk/react-docs": "^1.4.0",
41
+ "@splunk/react-docs": "^1.5.1",
42
42
  "@splunk/stylelint-config": "^5.0.0",
43
43
  "@splunk/webpack-configs": "^7.0.3",
44
44
  "babel-loader": "^8.3.0",