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