@splunk/react-page 8.2.0-beta.1 → 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 +115 -107
- package/CHANGELOG.md +10 -0
- package/baseLayout.d.ts +1 -1
- package/cypress.config.js +3 -1
- package/index.js +40 -32
- package/package.json +8 -8
package/18.js
CHANGED
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
e.r(n);
|
|
62
62
|
// EXPORTS
|
|
63
63
|
e.d(n, {
|
|
64
|
-
default: () => /* binding */
|
|
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/
|
|
78
|
-
const c = require("@babel/runtime/
|
|
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 "
|
|
81
|
-
const s = require("
|
|
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 "
|
|
84
|
-
const v = require("
|
|
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
|
|
93
|
+
const g = require("@splunk/react-ui/Layer");
|
|
88
94
|
// CONCATENATED MODULE: external "@splunk/splunk-utils/url"
|
|
89
|
-
const
|
|
95
|
+
const k = require("@splunk/splunk-utils/url");
|
|
90
96
|
// CONCATENATED MODULE: external "@splunk/themes/SplunkThemeProvider"
|
|
91
|
-
const
|
|
92
|
-
var
|
|
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
|
|
102
|
+
const E = require("@splunk/ui-utils/boolean");
|
|
95
103
|
// CONCATENATED MODULE: external "@splunk/ui-utils/i18n"
|
|
96
|
-
const
|
|
104
|
+
const O = require("@splunk/ui-utils/i18n");
|
|
97
105
|
// CONCATENATED MODULE: external "@splunk/splunk-utils/fetch"
|
|
98
|
-
const
|
|
106
|
+
const q = require("@splunk/splunk-utils/fetch");
|
|
99
107
|
// CONCATENATED MODULE: external "prop-types"
|
|
100
|
-
const
|
|
101
|
-
var
|
|
108
|
+
const C = require("prop-types");
|
|
109
|
+
var x = e.n(C);
|
|
102
110
|
// CONCATENATED MODULE: external "@splunk/react-ui/ScreenReaderContent"
|
|
103
|
-
const
|
|
104
|
-
var
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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
|
|
157
|
-
var
|
|
158
|
-
var H = (0,
|
|
159
|
-
var M =
|
|
160
|
-
var z =
|
|
161
|
-
prisma:
|
|
162
|
-
enterprise:
|
|
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
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
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:
|
|
176
|
-
hideChrome:
|
|
177
|
-
hideSplunkBar:
|
|
178
|
-
AppBarFallback:
|
|
179
|
-
SplunkBarFallback:
|
|
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
|
|
185
|
-
|
|
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
|
-
|
|
212
|
-
|
|
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,
|
|
224
|
+
})).then((0, q.handleResponse)(200))["catch"]((0, q.handleError)((0, O._)("failed to get web features")));
|
|
217
225
|
};
|
|
218
|
-
var
|
|
219
|
-
var
|
|
220
|
-
var e = u()(
|
|
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
|
|
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
|
|
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 ===
|
|
248
|
+
return e.name === $;
|
|
241
249
|
}));
|
|
242
|
-
return i.abrupt("return", (r = (0,
|
|
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
|
|
256
|
-
var
|
|
257
|
-
var
|
|
258
|
-
var
|
|
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
|
|
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
|
-
|
|
276
|
+
ee(n).then((function(n) {
|
|
269
277
|
var t;
|
|
270
278
|
if (n) {
|
|
271
|
-
t =
|
|
279
|
+
t = te;
|
|
272
280
|
} else {
|
|
273
|
-
t = e === "dark" ?
|
|
281
|
+
t = e === "dark" ? re : ne;
|
|
274
282
|
}
|
|
275
|
-
var a = (0,
|
|
283
|
+
var a = (0, k.createStaticURL)(t);
|
|
276
284
|
if (o === "scriptjs") {
|
|
277
|
-
|
|
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
|
|
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
|
|
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
|
|
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 ?
|
|
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
|
/**
|
|
@@ -346,7 +354,7 @@
|
|
|
346
354
|
* @param {string} [options.layout = 'scrolling'] - Set to `fixed` to fix all navigation bars
|
|
347
355
|
* to the edge of the page.
|
|
348
356
|
* @param {Boolean} [options.useGlobalLayerStack = true] - Wraps elements in @splunk/react-ui's LayerStackGlobalProvider.
|
|
349
|
-
* @
|
|
357
|
+
* @param {Boolean} [options.navLayout = 'classic'] - Used to determine layout asset to load. Ex. "classic" or "auto".
|
|
350
358
|
* @param {String} [options.theme = 'light'] - Used to theme UI elements. Ex. "light" or "dark".
|
|
351
359
|
* @param {String} [options.themeFamily = 'enterprise'] - Ex. Theme family to use for UI elements. Ex. "enterprise" or "prisma".
|
|
352
360
|
* @param {String} [options.themeDensity] - Ex. Theme density to use for UI elements. Ex. "compact" or "comfortable".
|
|
@@ -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
|
|
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,
|
|
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
|
|
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
|
-
|
|
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:
|
|
383
|
+
family: h,
|
|
376
384
|
colorScheme: _,
|
|
377
|
-
density: c || (
|
|
385
|
+
density: c || (h === "prisma" ? "compact" : "comfortable")
|
|
378
386
|
};
|
|
379
387
|
var F;
|
|
380
388
|
var A;
|
|
381
|
-
if (
|
|
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 (!
|
|
394
|
+
if (!v) {
|
|
387
395
|
document.body.appendChild(L);
|
|
388
|
-
A = n(
|
|
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 =
|
|
392
|
-
hideSplunkBar:
|
|
399
|
+
var H = ie(L, {
|
|
400
|
+
hideSplunkBar: y,
|
|
393
401
|
hideAppBar: b,
|
|
394
402
|
headerHeight: D,
|
|
395
403
|
AppBarFallback: S,
|
|
396
|
-
SplunkBarFallback:
|
|
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 =
|
|
410
|
+
F = ue(e, n, P, o, T);
|
|
403
411
|
} else {
|
|
404
412
|
document.body.appendChild(P);
|
|
405
|
-
F = n(
|
|
413
|
+
F = n( f().createElement(j(), T, f().createElement(Y, null), f().createElement(N, p)), P);
|
|
406
414
|
}
|
|
407
|
-
|
|
415
|
+
oe(u, B, (function(r) {
|
|
408
416
|
var t;
|
|
409
417
|
if (r) {
|
|
410
|
-
var a =
|
|
418
|
+
var a = le({
|
|
411
419
|
navLayout: B,
|
|
412
|
-
baseOptions:
|
|
420
|
+
baseOptions: p,
|
|
413
421
|
additionalOptions: {
|
|
414
422
|
theme: u,
|
|
415
|
-
themeFamily:
|
|
423
|
+
themeFamily: h
|
|
416
424
|
}
|
|
417
425
|
});
|
|
418
426
|
t = r.create(a).getContainerElement();
|
|
419
|
-
if (
|
|
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 (!
|
|
452
|
+
if (!v) {
|
|
445
453
|
// replace placeholder nav bar with real nav bar
|
|
446
454
|
A.unmount(L);
|
|
447
|
-
var i = document.querySelector(
|
|
448
|
-
var l = (!
|
|
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 =
|
|
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
|
|
476
|
+
/* harmony default export */ const de = ce;
|
|
469
477
|
// CONCATENATED MODULE: ./src/18.jsx
|
|
470
|
-
var
|
|
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
|
|
499
|
-
|
|
506
|
+
*/ function pe(e, n) {
|
|
507
|
+
de(e, se, n);
|
|
500
508
|
}
|
|
501
|
-
/* harmony default export */ const
|
|
509
|
+
/* harmony default export */ const ve = pe;
|
|
502
510
|
module.exports = n;
|
|
503
511
|
/******/})();
|
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,16 @@
|
|
|
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
|
+
|
|
9
|
+
8.2.0 - January 8, 2025
|
|
10
|
+
----------
|
|
11
|
+
New Features:
|
|
12
|
+
* Added a new `options.navLayout` parameter.
|
|
13
|
+
|
|
4
14
|
8.2.0-beta.1 - October 14, 2025
|
|
5
15
|
----------
|
|
6
16
|
* No public API changes.
|
package/baseLayout.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ export default layout;
|
|
|
16
16
|
* @param {string} [options.layout = 'scrolling'] - Set to `fixed` to fix all navigation bars
|
|
17
17
|
* to the edge of the page.
|
|
18
18
|
* @param {Boolean} [options.useGlobalLayerStack = true] - Wraps elements in @splunk/react-ui's LayerStackGlobalProvider.
|
|
19
|
-
* @
|
|
19
|
+
* @param {Boolean} [options.navLayout = 'classic'] - Used to determine layout asset to load. Ex. "classic" or "auto".
|
|
20
20
|
* @param {String} [options.theme = 'light'] - Used to theme UI elements. Ex. "light" or "dark".
|
|
21
21
|
* @param {String} [options.themeFamily = 'enterprise'] - Ex. Theme family to use for UI elements. Ex. "enterprise" or "prisma".
|
|
22
22
|
* @param {String} [options.themeDensity] - Ex. Theme density to use for UI elements. Ex. "compact" or "comfortable".
|
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:
|
|
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 */
|
|
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
|
-
|
|
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
|
|
221
|
-
var
|
|
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
|
|
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 ===
|
|
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
|
|
258
|
-
var
|
|
259
|
-
var
|
|
260
|
-
var
|
|
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
|
|
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
|
-
|
|
278
|
+
ee(n).then((function(n) {
|
|
271
279
|
var t;
|
|
272
280
|
if (n) {
|
|
273
|
-
t =
|
|
281
|
+
t = te;
|
|
274
282
|
} else {
|
|
275
|
-
t = e === "dark" ?
|
|
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
|
|
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
|
|
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
|
|
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
|
/**
|
|
@@ -348,7 +356,7 @@
|
|
|
348
356
|
* @param {string} [options.layout = 'scrolling'] - Set to `fixed` to fix all navigation bars
|
|
349
357
|
* to the edge of the page.
|
|
350
358
|
* @param {Boolean} [options.useGlobalLayerStack = true] - Wraps elements in @splunk/react-ui's LayerStackGlobalProvider.
|
|
351
|
-
* @
|
|
359
|
+
* @param {Boolean} [options.navLayout = 'classic'] - Used to determine layout asset to load. Ex. "classic" or "auto".
|
|
352
360
|
* @param {String} [options.theme = 'light'] - Used to theme UI elements. Ex. "light" or "dark".
|
|
353
361
|
* @param {String} [options.themeFamily = 'enterprise'] - Ex. Theme family to use for UI elements. Ex. "enterprise" or "prisma".
|
|
354
362
|
* @param {String} [options.themeDensity] - Ex. Theme density to use for UI elements. Ex. "compact" or "comfortable".
|
|
@@ -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
|
|
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 =
|
|
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 =
|
|
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
|
-
|
|
417
|
+
oe(l, _, (function(r) {
|
|
410
418
|
var t;
|
|
411
419
|
if (r) {
|
|
412
|
-
var o =
|
|
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(
|
|
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 =
|
|
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
|
|
478
|
+
/* harmony default export */ const de = ce;
|
|
471
479
|
// CONCATENATED MODULE: ./src/index.jsx
|
|
472
|
-
var
|
|
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
|
|
507
|
-
|
|
514
|
+
*/ function pe(e, n) {
|
|
515
|
+
de(e, se, n);
|
|
508
516
|
}
|
|
509
|
-
/* harmony default export */ const
|
|
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.
|
|
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,16 +19,16 @@
|
|
|
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
|
|
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.
|
|
29
|
-
"@splunk/splunk-utils": "^3.
|
|
30
|
-
"@splunk/themes": "^1.
|
|
31
|
-
"@splunk/ui-utils": "^1.
|
|
28
|
+
"@splunk/react-ui": "^5.8.0",
|
|
29
|
+
"@splunk/splunk-utils": "^3.4.0",
|
|
30
|
+
"@splunk/themes": "^1.5.0",
|
|
31
|
+
"@splunk/ui-utils": "^1.12.0",
|
|
32
32
|
"prop-types": "^15.6.2",
|
|
33
33
|
"scriptjs": "^2.5.8"
|
|
34
34
|
},
|
|
@@ -38,9 +38,9 @@
|
|
|
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.
|
|
41
|
+
"@splunk/react-docs": "^1.5.1",
|
|
42
42
|
"@splunk/stylelint-config": "^5.0.0",
|
|
43
|
-
"@splunk/webpack-configs": "^7.0.
|
|
43
|
+
"@splunk/webpack-configs": "^7.0.3",
|
|
44
44
|
"babel-loader": "^8.3.0",
|
|
45
45
|
"babel-plugin-transform-imports": "^2.0.0",
|
|
46
46
|
"cross-env": "^6.0.3",
|