@splunk/react-page 8.0.0 → 8.2.0-beta.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/index.js CHANGED
@@ -61,147 +61,203 @@
61
61
  e.r(n);
62
62
  // EXPORTS
63
63
  e.d(n, {
64
- AppBar: () => /* reexport */ b,
64
+ AppBar: () => /* reexport */ g,
65
65
  SplunkBar: () => /* reexport */ y,
66
- default: () => /* binding */ W
66
+ default: () => /* binding */ se
67
67
  });
68
68
  // CONCATENATED MODULE: external "react-dom"
69
69
  const r = require("react-dom");
70
- // CONCATENATED MODULE: external "styled-components"
71
- const t = require("styled-components");
70
+ // CONCATENATED MODULE: external "@babel/runtime/helpers/taggedTemplateLiteral"
71
+ const t = require("@babel/runtime/helpers/taggedTemplateLiteral");
72
72
  var a = e.n(t);
73
+ // CONCATENATED MODULE: external "styled-components"
74
+ const o = require("styled-components");
75
+ var i = e.n(o);
73
76
  // CONCATENATED MODULE: external "@splunk/themes"
74
- const i = require("@splunk/themes");
77
+ const l = require("@splunk/themes");
75
78
  // CONCATENATED MODULE: ./src/LoadingStyles.js
76
- function o() {
77
- var e = s([ "\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" ]);
78
- o = function n() {
79
- return e;
80
- };
81
- return e;
82
- }
83
- function l() {
84
- var e = s([ "\n color: ", ";\n padding-top: 30vh;\n text-align: center;\n min-height: 400px;\n" ]);
85
- l = function n() {
86
- return e;
87
- };
88
- return e;
89
- }
90
79
  function u() {
91
- var e = s([ "\n background-color: ", ";\n min-height: ", "px;\n" ]);
80
+ var e = a()([ "\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" ]);
92
81
  u = function n() {
93
82
  return e;
94
83
  };
95
84
  return e;
96
85
  }
97
86
  function c() {
98
- var e = s([ "\n padding: 0;\n background-color: ", ";\n height: ", "px;\n" ]);
87
+ var e = a()([ "\n color: ", ";\n padding-top: 30vh;\n text-align: center;\n min-height: 400px;\n" ]);
99
88
  c = function n() {
100
89
  return e;
101
90
  };
102
91
  return e;
103
92
  }
104
93
  function d() {
105
- var e = s([ "\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" ]);
94
+ var e = a()([ "\n background-color: ", ";\n min-height: ", "px;\n" ]);
106
95
  d = function n() {
107
96
  return e;
108
97
  };
109
98
  return e;
110
99
  }
100
+ function s() {
101
+ var e = a()([ "\n padding: 0;\n background-color: ", ";\n height: ", "px;\n" ]);
102
+ s = function n() {
103
+ return e;
104
+ };
105
+ return e;
106
+ }
111
107
  function p() {
112
- var e = s([ "\n 0% {\n opacity: 0.2;\n }\n\n 20% {\n opacity: 1;\n }\n\n 100% {\n opacity: 0.2;\n }\n" ]);
108
+ var e = a()([ "\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" ]);
113
109
  p = function n() {
114
110
  return e;
115
111
  };
116
112
  return e;
117
113
  }
118
- function s(e, n) {
119
- return n || (n = e.slice(0)), Object.freeze(Object.defineProperties(e, {
120
- raw: {
121
- value: Object.freeze(n)
122
- }
123
- }));
114
+ function v() {
115
+ var e = a()([ "\n 0% {\n opacity: 0.2;\n }\n\n 20% {\n opacity: 1;\n }\n\n 100% {\n opacity: 0.2;\n }\n" ]);
116
+ v = function n() {
117
+ return e;
118
+ };
119
+ return e;
124
120
  }
125
- var v = 45;
121
+ var f = 45;
126
122
  var m = 34;
127
- var f = (0, t.keyframes)(p());
128
- var h = a().div(d(), i.variables.backgroundColorPage);
129
- var y = a().div(c(), (0, i.pick)({
130
- prisma: i.variables.backgroundColorSection,
131
- enterprise: i.variables.gray20
123
+ var h = (0, o.keyframes)(v());
124
+ var b = i().div(p(), l.variables.backgroundColorPage);
125
+ var y = i().div(s(), (0, l.pick)({
126
+ prisma: l.variables.backgroundColorSection,
127
+ enterprise: l.variables.gray20
132
128
  }), m);
133
- var b = a().div(u(), (0, i.pick)({
134
- prisma: i.variables.backgroundColorPopup,
135
- enterprise: i.variables.gray30
136
- }), v);
137
- var g = a().div(l(), i.variables.contentColorInverted);
138
- var k = a().div(o(), f, i.variables.neutral500, (0, i.pick)({
139
- prisma: i.variables.spacingMedium,
140
- enterprise: i.variables.spacingSmall
129
+ var g = i().div(d(), (0, l.pick)({
130
+ prisma: l.variables.backgroundColorPopup,
131
+ enterprise: l.variables.gray30
132
+ }), f);
133
+ var k = i().div(c(), l.variables.contentColorInverted);
134
+ var w = i().div(u(), h, l.variables.neutral500, (0, l.pick)({
135
+ prisma: l.variables.spacingMedium,
136
+ enterprise: l.variables.spacingSmall
141
137
  }));
138
+ // CONCATENATED MODULE: external "@babel/runtime/helpers/objectWithoutProperties"
139
+ const j = require("@babel/runtime/helpers/objectWithoutProperties");
140
+ var S = e.n(j);
141
+ // CONCATENATED MODULE: external "@babel/runtime/helpers/defineProperty"
142
+ const E = require("@babel/runtime/helpers/defineProperty");
143
+ var O = e.n(E);
144
+ // CONCATENATED MODULE: external "@babel/runtime/helpers/asyncToGenerator"
145
+ const q = require("@babel/runtime/helpers/asyncToGenerator");
146
+ var C = e.n(q);
147
+ // CONCATENATED MODULE: external "@babel/runtime/regenerator"
148
+ const x = require("@babel/runtime/regenerator");
149
+ var B = e.n(x);
142
150
  // CONCATENATED MODULE: external "react"
143
- const S = require("react");
144
- var w = e.n(S);
151
+ const P = require("react");
152
+ var L = e.n(P);
145
153
  // CONCATENATED MODULE: external "scriptjs"
146
- const C = require("scriptjs");
147
- var E = e.n(C);
154
+ const _ = require("scriptjs");
155
+ var T = e.n(_);
148
156
  // CONCATENATED MODULE: external "@splunk/react-ui/Layer"
149
- const j = require("@splunk/react-ui/Layer");
157
+ const A = require("@splunk/react-ui/Layer");
150
158
  // CONCATENATED MODULE: external "@splunk/splunk-utils/url"
151
- const B = require("@splunk/splunk-utils/url");
159
+ const F = require("@splunk/splunk-utils/url");
152
160
  // CONCATENATED MODULE: external "@splunk/themes/SplunkThemeProvider"
153
- const q = require("@splunk/themes/SplunkThemeProvider");
154
- var x = e.n(q);
161
+ const D = require("@splunk/themes/SplunkThemeProvider");
162
+ var G = e.n(D);
163
+ // CONCATENATED MODULE: external "@splunk/ui-utils/boolean"
164
+ const H = require("@splunk/ui-utils/boolean");
165
+ // CONCATENATED MODULE: external "@splunk/ui-utils/i18n"
166
+ const M = require("@splunk/ui-utils/i18n");
167
+ // CONCATENATED MODULE: external "@splunk/splunk-utils/fetch"
168
+ const R = require("@splunk/splunk-utils/fetch");
155
169
  // CONCATENATED MODULE: external "prop-types"
156
- const O = require("prop-types");
157
- var P = e.n(O);
170
+ const z = require("prop-types");
171
+ var U = e.n(z);
158
172
  // CONCATENATED MODULE: external "@splunk/react-ui/ScreenReaderContent"
159
- const A = require("@splunk/react-ui/ScreenReaderContent");
160
- var F = e.n(A);
161
- // CONCATENATED MODULE: external "@splunk/ui-utils/i18n"
162
- const L = require("@splunk/ui-utils/i18n");
173
+ const I = require("@splunk/react-ui/ScreenReaderContent");
174
+ var N = e.n(I);
163
175
  // CONCATENATED MODULE: ./src/Loading.jsx
164
- var _ = {
165
- hideAppBar: P().bool,
166
- hideChrome: P().bool,
167
- hideSplunkBar: P().bool,
168
- AppBarFallback: P().elementType,
169
- SplunkBarFallback: P().elementType
176
+ var W = {
177
+ hideAppBar: U().bool,
178
+ hideChrome: U().bool,
179
+ hideSplunkBar: U().bool,
180
+ AppBarFallback: U().elementType,
181
+ SplunkBarFallback: U().elementType
170
182
  };
171
- function T(e) {
172
- var n = e.AppBarFallback, r = n === void 0 ? b : n, t = e.hideAppBar, a = e.hideChrome, i = e.hideSplunkBar, o = e.SplunkBarFallback, l = o === void 0 ? y : o;
183
+ function J(e) {
184
+ var n = e.AppBarFallback, r = n === void 0 ? g : n, t = e.hideAppBar, a = e.hideChrome, o = e.hideSplunkBar, i = e.SplunkBarFallback, l = i === void 0 ? y : i;
173
185
 
174
- return w().createElement(h, null, !a && !i && w().createElement(l, null), !a && !t && w().createElement(r, null), w().createElement(g, null, w().createElement(k, null), w().createElement(k, null), w().createElement(k, null), w().createElement(F(), null, (0,
175
- L._)("Loading"))));
186
+ return L().createElement(b, null, !a && !o && L().createElement(l, null), !a && !t && L().createElement(r, null), L().createElement(k, null, L().createElement(w, null), L().createElement(w, null), L().createElement(w, null), L().createElement(N(), null, (0,
187
+ M._)("Loading"))));
176
188
  }
177
- T.propTypes = _;
178
- /* harmony default export */ const H = T;
189
+ J.propTypes = W;
190
+ /* harmony default export */ const K = J;
179
191
  // CONCATENATED MODULE: ./src/baseLayout.jsx
180
- function M(e, n) {
181
- if (null == e) return {};
182
- var r, t, a = z(e, n);
192
+ function Q(e, n) {
193
+ var r = Object.keys(e);
183
194
  if (Object.getOwnPropertySymbols) {
184
- var i = Object.getOwnPropertySymbols(e);
185
- for (t = 0; t < i.length; t++) {
186
- r = i[t], n.includes(r) || {}.propertyIsEnumerable.call(e, r) && (a[r] = e[r]);
187
- }
195
+ var t = Object.getOwnPropertySymbols(e);
196
+ n && (t = t.filter((function(n) {
197
+ return Object.getOwnPropertyDescriptor(e, n).enumerable;
198
+ }))), r.push.apply(r, t);
188
199
  }
189
- return a;
200
+ return r;
190
201
  }
191
- function z(e, n) {
192
- if (null == e) return {};
193
- var r = {};
194
- for (var t in e) {
195
- if ({}.hasOwnProperty.call(e, t)) {
196
- if (n.includes(t)) continue;
197
- r[t] = e[t];
198
- }
202
+ function V(e) {
203
+ for (var n = 1; n < arguments.length; n++) {
204
+ var r = null != arguments[n] ? arguments[n] : {};
205
+ n % 2 ? Q(Object(r), !0).forEach((function(n) {
206
+ O()(e, n, r[n]);
207
+ })) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : Q(Object(r)).forEach((function(n) {
208
+ Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(r, n));
209
+ }));
199
210
  }
200
- return r;
211
+ return e;
201
212
  }
202
- var G = "build/api/layout.js";
203
- var I = "build/api/layout-dark.js";
204
- var D = 'header[data-view="splunkjs/mvc/headerview"]';
213
+ var X = function e() {
214
+ return fetch((0, F.createRESTURL)("web-features?output_mode=json", {
215
+ app: "-",
216
+ owner: "-",
217
+ sharing: "system"
218
+ })).then((0, R.handleResponse)(200))["catch"]((0, R.handleError)((0, M._)("failed to get web features")));
219
+ };
220
+ var Y = "feature:modern-nav";
221
+ var Z = function() {
222
+ var e = C()( B().mark((function e(n) {
223
+ var r, t;
224
+ var a, o;
225
+ return B().wrap((function e(i) {
226
+ while (1) {
227
+ switch (i.prev = i.next) {
228
+ case 0:
229
+ if (!(n !== "auto")) {
230
+ i.next = 2;
231
+ break;
232
+ }
233
+ return i.abrupt("return", false);
234
+
235
+ case 2:
236
+ i.next = 4;
237
+ return X();
238
+
239
+ case 4:
240
+ a = i.sent;
241
+ o = a.entry.find((function(e) {
242
+ return e.name === Y;
243
+ }));
244
+ 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
+
246
+ case 7:
247
+ case "end":
248
+ return i.stop();
249
+ }
250
+ }
251
+ }), e);
252
+ })));
253
+ return function n(r) {
254
+ return e.apply(this, arguments);
255
+ };
256
+ }();
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"]';
205
261
  /**
206
262
  * Loads the layout from the server, using requirejs if available on the window and scriptjs if not.
207
263
  *
@@ -209,24 +265,31 @@
209
265
  * @param {object} [options]
210
266
  * @param {String} [options.loader = 'scriptjs'] - Configures the loader used for the loading the layout - available loaders are "scriptjs" and "requirejs".
211
267
  * @private
212
- */ function R(e, n) {
213
- var r = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}, t = r.loader, a = t === void 0 ? "scriptjs" : t;
214
- var i = e === "dark" ? I : G;
215
- var o = (0, B.createStaticURL)(i);
216
- if (a === "scriptjs") {
217
- E()(o, (function() {
218
- // eslint-disable-next-line no-underscore-dangle
219
- n(window.__splunk_layout__);
220
- }));
221
- } else if (a === "requirejs") {
222
- if (window.requirejs) {
223
- window.requirejs([ o ], n);
268
+ */ function te(e, n, r) {
269
+ 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) {
271
+ var t;
272
+ if (n) {
273
+ t = ne;
224
274
  } else {
225
- throw new Error('Error in react-page: options.loader = "requirejs" was set but window.requirejs does not exist.');
275
+ t = e === "dark" ? ee : $;
226
276
  }
227
- } else {
228
- throw new Error('Invalid options.loader configuration: must be "scriptjs" or "requirejs".');
229
- }
277
+ var a = (0, F.createStaticURL)(t);
278
+ if (o === "scriptjs") {
279
+ T()(a, (function() {
280
+ // eslint-disable-next-line no-underscore-dangle
281
+ r(window.__splunk_layout__);
282
+ }));
283
+ } else if (o === "requirejs") {
284
+ if (window.requirejs) {
285
+ window.requirejs([ a ], r);
286
+ } else {
287
+ throw new Error('Error in react-page: options.loader = "requirejs" was set but window.requirejs does not exist.');
288
+ }
289
+ } else {
290
+ throw new Error('Invalid options.loader configuration: must be "scriptjs" or "requirejs".');
291
+ }
292
+ }));
230
293
  }
231
294
  /**
232
295
  * Computes the background css of the header container during lazy loading
@@ -234,20 +297,24 @@
234
297
  * @param {HTMLDivElement} headerContainer
235
298
  * @param {object} [options]
236
299
  * @private
237
- */ function U(e) {
300
+ */ function ae(e) {
238
301
  var n = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
239
302
  var r = n.hideSplunkBar, t = n.hideAppBar, a = n.headerHeight;
240
- var i = e.children[0];
241
- var o = i && getComputedStyle(i).backgroundColor;
303
+ var o = e.children[0];
304
+ var i = o && getComputedStyle(o).backgroundColor;
242
305
  if (!(r || t)) {
243
306
  // compute background color to be same as both fallback components
244
- var l = i === null || i === void 0 ? void 0 : i.offsetHeight;
307
+ var l = o === null || o === void 0 ? void 0 : o.offsetHeight;
245
308
  var u = e.children[1];
246
309
  var c = u && getComputedStyle(u).backgroundColor;
247
310
  var d = Math.round(l / a * 100);
248
- return "linear-gradient(\n ".concat(o, " 0%,\n ").concat(o, " ").concat(d, "%,\n ").concat(c, " ").concat(d, "%,\n ").concat(c, " 100%\n )");
311
+ return "linear-gradient(\n ".concat(i, " 0%,\n ").concat(i, " ").concat(d, "%,\n ").concat(c, " ").concat(d, "%,\n ").concat(c, " 100%\n )");
249
312
  }
250
- return o;
313
+ return i;
314
+ }
315
+ function oe(e) {
316
+ var n = e.navLayout, r = e.baseOptions, t = e.additionalOptions;
317
+ return n === "auto" ? V(V({}, r), t) : r;
251
318
  }
252
319
  /**
253
320
  * renders body element and attaches it to container node in DOM
@@ -258,11 +325,11 @@
258
325
  * @param {boolean} useGlobalLayerStack
259
326
  * @param {object} splunkTheme
260
327
  * @private
261
- */ function N(e, n, r) {
328
+ */ function ie(e, n, r) {
262
329
  var t = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
263
330
  var a = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {};
264
- var i = t ? w().createElement(j.LayerStackGlobalProvider, null, w().createElement(x(), a, e)) : w().createElement(x(), a, e);
265
- return n(i, r);
331
+ var o = t ? L().createElement(A.LayerStackGlobalProvider, null, L().createElement(G(), a, e)) : L().createElement(G(), a, e);
332
+ return n(o, r);
266
333
  }
267
334
  /**
268
335
  * Renders a React element into the Layout API.
@@ -281,6 +348,7 @@
281
348
  * @param {string} [options.layout = 'scrolling'] - Set to `fixed` to fix all navigation bars
282
349
  * to the edge of the page.
283
350
  * @param {Boolean} [options.useGlobalLayerStack = true] - Wraps elements in @splunk/react-ui's LayerStackGlobalProvider.
351
+ * @private {Boolean} [options.navLayout = 'classic'] - Used to determine layout asset to load. Ex. "classic" or "auto".
284
352
  * @param {String} [options.theme = 'light'] - Used to theme UI elements. Ex. "light" or "dark".
285
353
  * @param {String} [options.themeFamily = 'enterprise'] - Ex. Theme family to use for UI elements. Ex. "enterprise" or "prisma".
286
354
  * @param {String} [options.themeDensity] - Ex. Theme density to use for UI elements. Ex. "compact" or "comfortable".
@@ -290,56 +358,67 @@
290
358
  * @param {element} [options.SplunkBarFallback = SplunkBar] - A React element used as a placeholder for the splunk bar while the navigation bar is loading.
291
359
  * @param {element} [options.AppBarFallback = AppBar] - A React element used as a placeholder for the app bar while the navigation bar is loading.
292
360
  * @param {function} [options.onLayoutComplete] - A callback function which executes after layout API is fetched and compiled.
293
- */ function J(e, n) {
361
+ */ function le(e, n) {
294
362
  var r = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
295
- var t = r.useGlobalLayerStack, a = t === void 0 ? true : t, i = r.pageTitle, o = r.theme, l = o === void 0 ? "light" : o, u = r.themeDensity, c = r.loader, d = c === void 0 ? "scriptjs" : c, p = M(r, [ "useGlobalLayerStack", "pageTitle", "theme", "themeDensity", "loader" ]);
296
- if (i) {
297
- document.title = i;
363
+ 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
+ if (o) {
365
+ document.title = o;
298
366
  }
299
- var s = p.hideChrome, f = p.themeFamily, h = f === void 0 ? "enterprise" : f, g = p.hideAppBar, k = p.hideSplunkBar, S = p.SplunkBarFallback, C = S === void 0 ? y : S, E = p.AppBarFallback, j = E === void 0 ? b : E, B = p.lazyLoadLayout, q = B === void 0 ? false : B, O = p.onLayoutComplete, P = p.onLayoutStart;
367
+ var p = s.hideChrome, v = s.themeFamily, h = v === void 0 ? "enterprise" : v, b = s.hideAppBar, k = s.hideSplunkBar, w = s.SplunkBarFallback, j = w === void 0 ? y : w, E = s.AppBarFallback, O = E === void 0 ? g : E, q = s.lazyLoadLayout, C = q === void 0 ? false : q, x = s.onLayoutComplete, B = s.onLayoutStart, P = s.navLayout, _ = P === void 0 ? "classic" : P;
368
+ var T = document.createElement("div");
300
369
  var A = document.createElement("div");
301
- var F = document.createElement("div");
302
- P === null || P === void 0 ? void 0 : P({
303
- headerContainer: F,
304
- bodyContainer: A
370
+ B === null || B === void 0 ? void 0 : B({
371
+ headerContainer: A,
372
+ bodyContainer: T
305
373
  });
306
374
  // The "theme" in enterprise used to be "enterprise" instead of "light"...
307
- var L = l === "light" || l === "enterprise" ? "light" : "dark";
308
- var _ = {
375
+ var F = l === "light" || l === "enterprise" ? "light" : "dark";
376
+ var D = {
309
377
  family: h,
310
- colorScheme: L,
378
+ colorScheme: F,
311
379
  density: u || (h === "prisma" ? "compact" : "comfortable")
312
380
  };
313
- var T;
314
- var z;
315
- if (q) {
381
+ var H;
382
+ var M;
383
+ if (s.navLayout === "auto") {
384
+ T.style.flexGrow = "1";
385
+ }
386
+ if (C) {
316
387
  // render the React app immediately without waiting for layout API
317
- if (!s) {
318
- document.body.appendChild(F);
319
- z = n( w().createElement(w().Fragment, null, !k && w().createElement(C, null), !g && w().createElement(j, null)), F);
388
+ if (!p) {
389
+ document.body.appendChild(A);
390
+ M = n( L().createElement(L().Fragment, null, !k && L().createElement(j, null), !b && L().createElement(O, null)), A);
320
391
  // explicitly set height and background of header container to avoid layout and color shift when fallback gets replaced
321
- var G = F.offsetHeight;
322
- var I = U(F, {
392
+ var R = A.offsetHeight;
393
+ var z = ae(A, {
323
394
  hideSplunkBar: k,
324
- hideAppBar: g,
325
- headerHeight: G,
326
- AppBarFallback: j,
327
- SplunkBarFallback: C
395
+ hideAppBar: b,
396
+ headerHeight: R,
397
+ AppBarFallback: O,
398
+ SplunkBarFallback: j
328
399
  });
329
- F.style.height = "".concat(G, "px");
330
- F.style.background = "".concat(I);
400
+ A.style.height = "".concat(R, "px");
401
+ A.style.background = "".concat(z);
331
402
  }
332
- document.body.appendChild(A);
333
- T = N(e, n, A, a, _);
403
+ document.body.appendChild(T);
404
+ H = ie(e, n, T, a, D);
334
405
  } else {
335
- document.body.appendChild(A);
336
- T = n( w().createElement(x(), _, w().createElement(H, p)), A);
406
+ document.body.appendChild(T);
407
+ H = n( L().createElement(G(), D, L().createElement(K, s)), T);
337
408
  }
338
- R(l, (function(r) {
409
+ te(l, _, (function(r) {
339
410
  var t;
340
411
  if (r) {
341
- t = r.create(p).getContainerElement();
342
- if (p.layout === "fixed") {
412
+ var o = oe({
413
+ navLayout: _,
414
+ baseOptions: s,
415
+ additionalOptions: {
416
+ theme: l,
417
+ themeFamily: h
418
+ }
419
+ });
420
+ t = r.create(o).getContainerElement();
421
+ if (s.layout === "fixed") {
343
422
  // the above create method adds flex: 1 0 0
344
423
  // IE 11 disregards 0px shorthand for flex-basis component.
345
424
  // flex-basis 0% is better than 0px because css minification can remove px
@@ -363,34 +442,34 @@
363
442
  t = document.createElement("div");
364
443
  document.body.appendChild(t);
365
444
  }
366
- if (q) {
367
- if (!s) {
445
+ if (C) {
446
+ if (!p) {
368
447
  // replace placeholder nav bar with real nav bar
369
- z.unmount(F);
370
- var i = document.querySelector(D);
371
- var o = (!s && !k ? m : 0) + (!s && !g ? v : 0);
448
+ M.unmount(A);
449
+ var i = document.querySelector(re);
450
+ var u = (!p && !k ? m : 0) + (!p && !b ? f : 0);
372
451
  // set a min-height for basic nav bar components and auto height for any additional components like global banner
373
- F.style.minHeight = "".concat(o, "px");
374
- F.style.height = "auto";
375
- F.appendChild(i);
452
+ A.style.minHeight = "".concat(u, "px");
453
+ A.style.height = "auto";
454
+ A.appendChild(i);
376
455
  }
377
- t.appendChild(A);
378
- O === null || O === void 0 ? void 0 : O();
456
+ t.appendChild(T);
457
+ x === null || x === void 0 ? void 0 : x();
379
458
  } else {
380
459
  setTimeout((function() {
381
- T.unmount(A);
382
- T = N(e, n, A, a, _);
383
- t.appendChild(A);
384
- O === null || O === void 0 ? void 0 : O();
460
+ H.unmount(T);
461
+ H = ie(e, n, T, a, D);
462
+ t.appendChild(T);
463
+ x === null || x === void 0 ? void 0 : x();
385
464
  }), 30);
386
465
  }
387
466
  }), {
388
467
  loader: d
389
468
  });
390
469
  }
391
- /* harmony default export */ const K = J;
470
+ /* harmony default export */ const ue = le;
392
471
  // CONCATENATED MODULE: ./src/index.jsx
393
- var Q = function e(n, t) {
472
+ var ce = function e(n, t) {
394
473
  (0, r.render)(n, t);
395
474
  return {
396
475
  unmount: function e() {
@@ -413,7 +492,7 @@
413
492
  * @param {Boolean} [options.hideSplunkBar = false] - Hides the Splunk bar.
414
493
  * @param {string} [options.layout = 'scrolling'] - Set to `fixed` to fix all navigation bars
415
494
  * to the edge of the page.
416
- * @param {Boolean} [options.useGlobalLayerStack = true] - Wraps elements in @splunk/react-ui's LayerStackGlobalProvider.
495
+ * @param {Boolean} [options.useGlobalLayerStack = true] - Wraps elements in `@splunk/react-ui`'s LayerStackGlobalProvider.
417
496
  * @param {String} [options.theme = 'light'] - Used to theme UI elements. Ex. "light" or "dark".
418
497
  * @param {String} [options.themeFamily = 'enterprise'] - Ex. Theme family to use for UI elements. Ex. "enterprise" or "prisma".
419
498
  * @param {String} [options.themeDensity] - Ex. Theme density to use for UI elements. Ex. "compact" or "comfortable".
@@ -424,9 +503,9 @@
424
503
  * @param {element} [options.AppBarFallback = AppBar] - A React element used as a placeholder for the app bar while the navigation bar is loading.
425
504
  * @param {function} [options.onLayoutComplete] - A callback function which executes after layout API is fetched and compiled.
426
505
  * @param {function} [options.onLayoutStart] - A callback function which executes once the layout starts to render
427
- */ function V(e, n) {
428
- K(e, Q, n);
506
+ */ function de(e, n) {
507
+ ue(e, ce, n);
429
508
  }
430
- /* harmony default export */ const W = V;
509
+ /* harmony default export */ const se = de;
431
510
  module.exports = n;
432
511
  /******/})();
package/package.json CHANGED
@@ -1,11 +1,13 @@
1
1
  {
2
2
  "name": "@splunk/react-page",
3
- "version": "8.0.0",
3
+ "version": "8.2.0-beta.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.",
7
+ "main": "index.js",
8
+ "types": "types/index.d.ts",
7
9
  "scripts": {
8
- "build": "cross-env NODE_ENV=production webpack",
10
+ "build": "cross-env NODE_ENV=production webpack && yarn types:build",
9
11
  "docs": "NODE_ENV=production webpack --config docs.gen.webpack.config.js",
10
12
  "docs:publish": "eval $(splunk-docs-package docs) && artifact-ci publish generic $DOCS_GEN_OUTPUT_NAME $DOCS_GEN_REMOTE_PATH",
11
13
  "docs:publish:external": "eval $(splunk-docs-package docs-external --suffix=public) && artifact-ci publish generic $DOCS_GEN_OUTPUT_NAME $DOCS_GEN_REMOTE_PATH",
@@ -18,22 +20,25 @@
18
20
  "start": "cross-env NODE_ENV=development webpack --watch",
19
21
  "stylelint": "stylelint \"src/**/*.{js,jsx}\" --config stylelint.config.js",
20
22
  "test:cypress": "node src/tests/run-cypress-tests.js 8.0.3",
21
- "test:cypress:ci": "node src/tests/run-cypress-tests.js"
23
+ "test:cypress:ci": "node src/tests/run-cypress-tests.js",
24
+ "types:build": "tsc",
25
+ "types:start": "yarn types:build --watch"
22
26
  },
23
27
  "dependencies": {
24
- "@splunk/react-ui": "^5.0.0",
25
- "@splunk/splunk-utils": "^3.2.0",
26
- "@splunk/themes": "^1.0.0",
27
- "@splunk/ui-utils": "^1.9.0",
28
+ "@splunk/react-ui": "^5.4.0",
29
+ "@splunk/splunk-utils": "^3.3.0",
30
+ "@splunk/themes": "^1.3.0",
31
+ "@splunk/ui-utils": "^1.11.0",
28
32
  "prop-types": "^15.6.2",
29
33
  "scriptjs": "^2.5.8"
30
34
  },
31
35
  "devDependencies": {
32
- "@babel/core": "^7.16.0",
33
- "@babel/eslint-parser": "^7.16.0",
36
+ "@babel/core": "^7.28.0",
37
+ "@babel/eslint-parser": "^7.28.0",
38
+ "@babel/plugin-transform-runtime": "^7.28.3",
34
39
  "@splunk/babel-preset": "^4.0.0",
35
40
  "@splunk/eslint-config": "^5.0.0",
36
- "@splunk/react-docs": "^1.0.0",
41
+ "@splunk/react-docs": "^1.4.0",
37
42
  "@splunk/stylelint-config": "^5.0.0",
38
43
  "@splunk/webpack-configs": "^7.0.2",
39
44
  "babel-loader": "^8.3.0",
@@ -55,7 +60,7 @@
55
60
  "stylelint": "^15.11.0",
56
61
  "webpack": "^5.88.2",
57
62
  "webpack-cli": "^5.1.4",
58
- "webpack-dev-server": "^4.15.1",
63
+ "webpack-dev-server": "^5.2.2",
59
64
  "webpack-merge": "^5.9.0"
60
65
  },
61
66
  "peerDependencies": {