@splunk/react-page 7.2.0 → 8.0.0-beta.3
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 +424 -0
- package/CHANGELOG.md +18 -2
- package/README.md +10 -0
- package/package.json +8 -8
package/18.js
ADDED
|
@@ -0,0 +1,424 @@
|
|
|
1
|
+
/******/ (() => {
|
|
2
|
+
// webpackBootstrap
|
|
3
|
+
/******/ "use strict";
|
|
4
|
+
/******/ // The require scope
|
|
5
|
+
/******/ var e = {};
|
|
6
|
+
/******/
|
|
7
|
+
/************************************************************************/
|
|
8
|
+
/******/ /* webpack/runtime/compat get default export */
|
|
9
|
+
/******/ (() => {
|
|
10
|
+
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
11
|
+
/******/ e.n = n => {
|
|
12
|
+
/******/ var r = n && n.__esModule ?
|
|
13
|
+
/******/ () => n["default"]
|
|
14
|
+
/******/ : () => n
|
|
15
|
+
/******/;
|
|
16
|
+
e.d(r, {
|
|
17
|
+
a: r
|
|
18
|
+
});
|
|
19
|
+
/******/ return r;
|
|
20
|
+
/******/ };
|
|
21
|
+
/******/ })();
|
|
22
|
+
/******/
|
|
23
|
+
/******/ /* webpack/runtime/define property getters */
|
|
24
|
+
/******/ (() => {
|
|
25
|
+
/******/ // define getter functions for harmony exports
|
|
26
|
+
/******/ e.d = (n, r) => {
|
|
27
|
+
/******/ for (var t in r) {
|
|
28
|
+
/******/ if (e.o(r, t) && !e.o(n, t)) {
|
|
29
|
+
/******/ Object.defineProperty(n, t, {
|
|
30
|
+
enumerable: true,
|
|
31
|
+
get: r[t]
|
|
32
|
+
});
|
|
33
|
+
/******/ }
|
|
34
|
+
/******/ }
|
|
35
|
+
/******/ };
|
|
36
|
+
/******/ })();
|
|
37
|
+
/******/
|
|
38
|
+
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
39
|
+
/******/ (() => {
|
|
40
|
+
/******/ e.o = (e, n) => Object.prototype.hasOwnProperty.call(e, n)
|
|
41
|
+
/******/;
|
|
42
|
+
})();
|
|
43
|
+
/******/
|
|
44
|
+
/******/ /* webpack/runtime/make namespace object */
|
|
45
|
+
/******/ (() => {
|
|
46
|
+
/******/ // define __esModule on exports
|
|
47
|
+
/******/ e.r = e => {
|
|
48
|
+
/******/ if (typeof Symbol !== "undefined" && Symbol.toStringTag) {
|
|
49
|
+
/******/ Object.defineProperty(e, Symbol.toStringTag, {
|
|
50
|
+
value: "Module"
|
|
51
|
+
});
|
|
52
|
+
/******/ }
|
|
53
|
+
/******/ Object.defineProperty(e, "__esModule", {
|
|
54
|
+
value: true
|
|
55
|
+
});
|
|
56
|
+
/******/ };
|
|
57
|
+
/******/ })();
|
|
58
|
+
/******/
|
|
59
|
+
/************************************************************************/ var n = {};
|
|
60
|
+
// ESM COMPAT FLAG
|
|
61
|
+
e.r(n);
|
|
62
|
+
// EXPORTS
|
|
63
|
+
e.d(n, {
|
|
64
|
+
default: () => /* binding */ W
|
|
65
|
+
});
|
|
66
|
+
// CONCATENATED MODULE: external "react-dom/client"
|
|
67
|
+
const r = require("react-dom/client");
|
|
68
|
+
// CONCATENATED MODULE: external "react"
|
|
69
|
+
const t = require("react");
|
|
70
|
+
var a = e.n(t);
|
|
71
|
+
// CONCATENATED MODULE: external "scriptjs"
|
|
72
|
+
const i = require("scriptjs");
|
|
73
|
+
var o = e.n(i);
|
|
74
|
+
// CONCATENATED MODULE: external "@splunk/react-ui/Layer"
|
|
75
|
+
const l = require("@splunk/react-ui/Layer");
|
|
76
|
+
// CONCATENATED MODULE: external "@splunk/splunk-utils/url"
|
|
77
|
+
const u = require("@splunk/splunk-utils/url");
|
|
78
|
+
// CONCATENATED MODULE: external "@splunk/themes/SplunkThemeProvider"
|
|
79
|
+
const c = require("@splunk/themes/SplunkThemeProvider");
|
|
80
|
+
var d = e.n(c);
|
|
81
|
+
// CONCATENATED MODULE: external "styled-components"
|
|
82
|
+
const s = require("styled-components");
|
|
83
|
+
var p = e.n(s);
|
|
84
|
+
// CONCATENATED MODULE: external "@splunk/themes"
|
|
85
|
+
const v = require("@splunk/themes");
|
|
86
|
+
// 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() {
|
|
90
|
+
return e;
|
|
91
|
+
};
|
|
92
|
+
return e;
|
|
93
|
+
}
|
|
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() {
|
|
97
|
+
return e;
|
|
98
|
+
};
|
|
99
|
+
return e;
|
|
100
|
+
}
|
|
101
|
+
function h() {
|
|
102
|
+
var e = k([ "\n background-color: ", ";\n min-height: ", "px;\n" ]);
|
|
103
|
+
h = function n() {
|
|
104
|
+
return e;
|
|
105
|
+
};
|
|
106
|
+
return e;
|
|
107
|
+
}
|
|
108
|
+
function y() {
|
|
109
|
+
var e = k([ "\n padding: 0;\n background-color: ", ";\n height: ", "px;\n" ]);
|
|
110
|
+
y = function n() {
|
|
111
|
+
return e;
|
|
112
|
+
};
|
|
113
|
+
return e;
|
|
114
|
+
}
|
|
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() {
|
|
118
|
+
return e;
|
|
119
|
+
};
|
|
120
|
+
return e;
|
|
121
|
+
}
|
|
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() {
|
|
125
|
+
return e;
|
|
126
|
+
};
|
|
127
|
+
return e;
|
|
128
|
+
}
|
|
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
|
|
152
|
+
}));
|
|
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
|
+
// 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
|
|
168
|
+
};
|
|
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;
|
|
171
|
+
|
|
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"))));
|
|
174
|
+
}
|
|
175
|
+
T.propTypes = A;
|
|
176
|
+
/* harmony default export */ const H = T;
|
|
177
|
+
// CONCATENATED MODULE: ./src/baseLayout.jsx
|
|
178
|
+
function M(e, n) {
|
|
179
|
+
if (null == e) return {};
|
|
180
|
+
var r, t, a = z(e, n);
|
|
181
|
+
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
|
+
}
|
|
186
|
+
}
|
|
187
|
+
return a;
|
|
188
|
+
}
|
|
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
|
+
}
|
|
197
|
+
}
|
|
198
|
+
return r;
|
|
199
|
+
}
|
|
200
|
+
var G = "build/api/layout.js";
|
|
201
|
+
var I = "build/api/layout-dark.js";
|
|
202
|
+
var R = 'header[data-view="splunkjs/mvc/headerview"]';
|
|
203
|
+
/**
|
|
204
|
+
* Loads the layout from the server, using requirejs if available on the window and scriptjs if not.
|
|
205
|
+
*
|
|
206
|
+
* @param {Function} callback - A callback invoked with the layout module once resolved.
|
|
207
|
+
* @param {object} [options]
|
|
208
|
+
* @param {String} [options.loader = 'scriptjs'] - Configures the loader used for the loading the layout - available loaders are "scriptjs" and "requirejs".
|
|
209
|
+
* @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);
|
|
222
|
+
} else {
|
|
223
|
+
throw new Error('Error in react-page: options.loader = "requirejs" was set but window.requirejs does not exist.');
|
|
224
|
+
}
|
|
225
|
+
} else {
|
|
226
|
+
throw new Error('Invalid options.loader configuration: must be "scriptjs" or "requirejs".');
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* Computes the background css of the header container during lazy loading
|
|
231
|
+
*
|
|
232
|
+
* @param {HTMLDivElement} headerContainer
|
|
233
|
+
* @param {object} [options]
|
|
234
|
+
* @private
|
|
235
|
+
*/ function U(e) {
|
|
236
|
+
var n = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
237
|
+
var r = n.hideSplunkBar, t = n.hideAppBar, a = n.headerHeight;
|
|
238
|
+
var i = e.children[0];
|
|
239
|
+
var o = i && getComputedStyle(i).backgroundColor;
|
|
240
|
+
if (!(r || t)) {
|
|
241
|
+
// compute background color to be same as both fallback components
|
|
242
|
+
var l = i === null || i === void 0 ? void 0 : i.offsetHeight;
|
|
243
|
+
var u = e.children[1];
|
|
244
|
+
var c = u && getComputedStyle(u).backgroundColor;
|
|
245
|
+
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 )");
|
|
247
|
+
}
|
|
248
|
+
return o;
|
|
249
|
+
}
|
|
250
|
+
/**
|
|
251
|
+
* renders body element and attaches it to container node in DOM
|
|
252
|
+
*
|
|
253
|
+
* @param {element} element
|
|
254
|
+
* @param {element} render - A render function that returns an unmount() function.
|
|
255
|
+
* @param {HTMLDivElement} container
|
|
256
|
+
* @param {boolean} useGlobalLayerStack
|
|
257
|
+
* @param {object} splunkTheme
|
|
258
|
+
* @private
|
|
259
|
+
*/ function J(e, n, r) {
|
|
260
|
+
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);
|
|
263
|
+
return n(o, r);
|
|
264
|
+
}
|
|
265
|
+
/**
|
|
266
|
+
* Renders a React element into the Layout API.
|
|
267
|
+
* @public
|
|
268
|
+
* @param {element} element - A React element.
|
|
269
|
+
* @param {element} render - A render function that returns an unmount() function.
|
|
270
|
+
* @param {object} [options]
|
|
271
|
+
* @param {string} [options.pageTitle] - Changes the page title.
|
|
272
|
+
* @param {Boolean} [options.hideAppBar = false] - Hides the app bar.
|
|
273
|
+
* @param {Boolean} [options.hideAppsList = false] - Hides the app list in
|
|
274
|
+
* the Splunk bar.
|
|
275
|
+
* @param {Boolean} [options.hideChrome = false] - Renders only the main content, hiding
|
|
276
|
+
* the Splunk bar, app bar, and footer.
|
|
277
|
+
* @param {Boolean} [options.hideFooter = false] - Hides the footer.
|
|
278
|
+
* @param {Boolean} [options.hideSplunkBar = false] - Hides the Splunk bar.
|
|
279
|
+
* @param {string} [options.layout = 'scrolling'] - Set to `fixed` to fix all navigation bars
|
|
280
|
+
* to the edge of the page.
|
|
281
|
+
* @param {Boolean} [options.useGlobalLayerStack = true] - Wraps elements in @splunk/react-ui's LayerStackGlobalProvider.
|
|
282
|
+
* @param {String} [options.theme = 'light'] - Used to theme UI elements. Ex. "light" or "dark".
|
|
283
|
+
* @param {String} [options.themeFamily = 'enterprise'] - Ex. Theme family to use for UI elements. Ex. "enterprise" or "prisma".
|
|
284
|
+
* @param {String} [options.themeDensity] - Ex. Theme density to use for UI elements. Ex. "compact" or "comfortable".
|
|
285
|
+
* @param {String} [options.loader = 'scriptjs'] - Configures the loader used for the loading the layout - available loaders are "scriptjs" and "requirejs".
|
|
286
|
+
* Change this only if the default loader does not work for your application.
|
|
287
|
+
* @param {Boolean} [options.lazyLoadLayout = false] - Prioritizes loading the React element and lazily fetches and compiles the layout API (navigation bar).
|
|
288
|
+
* @param {element} [options.SplunkBarFallback = SplunkBar] - A React element used as a placeholder for the splunk bar while the navigation bar is loading.
|
|
289
|
+
* @param {element} [options.AppBarFallback = AppBar] - A React element used as a placeholder for the app bar while the navigation bar is loading.
|
|
290
|
+
* @param {function} [options.onLayoutComplete] - A callback function which executes after layout API is fetched and compiled.
|
|
291
|
+
*/ function K(e, n) {
|
|
292
|
+
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;
|
|
296
|
+
}
|
|
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");
|
|
299
|
+
var L = document.createElement("div");
|
|
300
|
+
P === null || P === void 0 ? void 0 : P({
|
|
301
|
+
headerContainer: L,
|
|
302
|
+
bodyContainer: F
|
|
303
|
+
});
|
|
304
|
+
// The "theme" in enterprise used to be "enterprise" instead of "light"...
|
|
305
|
+
var _ = u === "light" || u === "enterprise" ? "light" : "dark";
|
|
306
|
+
var A = {
|
|
307
|
+
family: h,
|
|
308
|
+
colorScheme: _,
|
|
309
|
+
density: c || (h === "prisma" ? "compact" : "comfortable")
|
|
310
|
+
};
|
|
311
|
+
var T;
|
|
312
|
+
var z;
|
|
313
|
+
if (B) {
|
|
314
|
+
// render the React app immediately without waiting for layout API
|
|
315
|
+
if (!m) {
|
|
316
|
+
document.body.appendChild(L);
|
|
317
|
+
z = n( a().createElement(a().Fragment, null, !b && a().createElement(k, null), !y && a().createElement(j, null)), L);
|
|
318
|
+
// 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
|
|
326
|
+
});
|
|
327
|
+
L.style.height = "".concat(G, "px");
|
|
328
|
+
L.style.background = "".concat(I);
|
|
329
|
+
}
|
|
330
|
+
document.body.appendChild(F);
|
|
331
|
+
T = J(e, n, F, i, A);
|
|
332
|
+
} else {
|
|
333
|
+
document.body.appendChild(F);
|
|
334
|
+
T = n( a().createElement(d(), A, a().createElement(H, v)), F);
|
|
335
|
+
}
|
|
336
|
+
D(u, (function(r) {
|
|
337
|
+
var t;
|
|
338
|
+
if (r) {
|
|
339
|
+
t = r.create(v).getContainerElement();
|
|
340
|
+
if (v.layout === "fixed") {
|
|
341
|
+
// the above create method adds flex: 1 0 0
|
|
342
|
+
// IE 11 disregards 0px shorthand for flex-basis component.
|
|
343
|
+
// flex-basis 0% is better than 0px because css minification can remove px
|
|
344
|
+
if (!t.style.flex || t.style.flex === "1 0 0px") {
|
|
345
|
+
t.style.flex = "1 0 0%";
|
|
346
|
+
}
|
|
347
|
+
// all elements in the hierarchy must have 'overflow: hidden' for children
|
|
348
|
+
// to support scrolling correctly.
|
|
349
|
+
if (!t.style.overflow) {
|
|
350
|
+
t.style.overflow = "hidden";
|
|
351
|
+
}
|
|
352
|
+
// splunk hijacks the width of the body when printing, so we have to force width to the size
|
|
353
|
+
// of the viewport so that things print at the correct width
|
|
354
|
+
if (!t.style.width) {
|
|
355
|
+
t.style.width = "100vw";
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
} else {
|
|
359
|
+
// eslint-disable-next-line no-console
|
|
360
|
+
console.error("Unable to load layout.");
|
|
361
|
+
t = document.createElement("div");
|
|
362
|
+
document.body.appendChild(t);
|
|
363
|
+
}
|
|
364
|
+
if (B) {
|
|
365
|
+
if (!m) {
|
|
366
|
+
// 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);
|
|
370
|
+
// 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");
|
|
372
|
+
L.style.height = "auto";
|
|
373
|
+
L.appendChild(a);
|
|
374
|
+
}
|
|
375
|
+
t.appendChild(F);
|
|
376
|
+
O === null || O === void 0 ? void 0 : O();
|
|
377
|
+
} else {
|
|
378
|
+
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();
|
|
383
|
+
}), 30);
|
|
384
|
+
}
|
|
385
|
+
}), {
|
|
386
|
+
loader: p
|
|
387
|
+
});
|
|
388
|
+
}
|
|
389
|
+
/* harmony default export */ const N = K;
|
|
390
|
+
// CONCATENATED MODULE: ./src/18.jsx
|
|
391
|
+
var Q = function e(n, t) {
|
|
392
|
+
var a = (0, r.createRoot)(t);
|
|
393
|
+
a.render(n);
|
|
394
|
+
return a;
|
|
395
|
+
};
|
|
396
|
+
/**
|
|
397
|
+
* Renders a React element into the Layout API.
|
|
398
|
+
* @public
|
|
399
|
+
* @param {element} element - A React element.
|
|
400
|
+
* @param {object} [options]
|
|
401
|
+
* @param {string} [options.pageTitle] - Changes the page title.
|
|
402
|
+
* @param {Boolean} [options.hideAppBar = false] - Hides the app bar.
|
|
403
|
+
* @param {Boolean} [options.hideAppsList = false] - Hides the app list in
|
|
404
|
+
* the Splunk bar.
|
|
405
|
+
* @param {Boolean} [options.hideChrome = false] - Renders only the main content, hiding
|
|
406
|
+
* the Splunk bar, app bar, and footer.
|
|
407
|
+
* @param {Boolean} [options.hideFooter = false] - Hides the footer.
|
|
408
|
+
* @param {Boolean} [options.hideSplunkBar = false] - Hides the Splunk bar.
|
|
409
|
+
* @param {string} [options.layout = 'scrolling'] - Set to `fixed` to fix all navigation bars
|
|
410
|
+
* to the edge of the page.
|
|
411
|
+
* @param {Boolean} [options.useGlobalLayerStack = true] - Wraps elements in @splunk/react-ui's LayerStackGlobalProvider.
|
|
412
|
+
* @param {String} [options.theme = 'light'] - Used to theme UI elements. Ex. "light" or "dark".
|
|
413
|
+
* @param {String} [options.loader = 'scriptjs'] - Configures the loader used for the loading the layout - available loaders are "scriptjs" and "requirejs".
|
|
414
|
+
* Change this only if the default loader does not work for your application.
|
|
415
|
+
* @param {Boolean} [options.lazyLoadLayout = false] - Prioritizes loading the React element and lazily fetches and compiles the layout API (navigation bar).
|
|
416
|
+
* @param {element} [options.SplunkBarFallback = SplunkBar] - A React element used as a placeholder for the splunk bar while the navigation bar is loading.
|
|
417
|
+
* @param {element} [options.AppBarFallback = AppBar] - A React element used as a placeholder for the app bar while the navigation bar is loading.
|
|
418
|
+
* @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);
|
|
421
|
+
}
|
|
422
|
+
/* harmony default export */ const W = V;
|
|
423
|
+
module.exports = n;
|
|
424
|
+
/******/})();
|
package/CHANGELOG.md
CHANGED
|
@@ -1,15 +1,31 @@
|
|
|
1
1
|
Change Log
|
|
2
2
|
============
|
|
3
3
|
|
|
4
|
+
8.0.0-beta.3 - April 2, 2025
|
|
5
|
+
----------
|
|
6
|
+
* Includes changes from `7.2.0`.
|
|
7
|
+
|
|
4
8
|
7.2.0 - April 1, 2025
|
|
5
9
|
----------
|
|
6
10
|
New Features:
|
|
7
11
|
* Added support for `themeFamily` and `themeDensity` options (SPL-273100).
|
|
8
12
|
|
|
13
|
+
8.0.0-beta.2 - March 5, 2025
|
|
14
|
+
----------
|
|
15
|
+
* Public release of `8.0.0-beta.1`
|
|
16
|
+
|
|
17
|
+
8.0.0-beta.1 - February 20, 2025
|
|
18
|
+
----------
|
|
19
|
+
New Features:
|
|
20
|
+
* Added support for using the `createRoot` API if the consuming application is using `react-dom@18`.
|
|
21
|
+
|
|
22
|
+
API Changes:
|
|
23
|
+
* `react` and `react-dom` peer dependencies are now `"^16.8.0 || ^17.0.0 || ^18.0.0"`.
|
|
24
|
+
|
|
9
25
|
7.1.0 - July 8, 2024
|
|
10
26
|
----------
|
|
11
27
|
New Features:
|
|
12
|
-
* Added a new `onLayoutStart` callback (SPL-254150).
|
|
28
|
+
* Added a new `onLayoutStart` callback (SPL-254150).
|
|
13
29
|
* `AppBar` and `SplunkBar` default placeholder elements are now exported (SPL-254150).
|
|
14
30
|
|
|
15
31
|
API Changes:
|
|
@@ -17,7 +33,7 @@ API Changes:
|
|
|
17
33
|
|
|
18
34
|
7.0.0 - February 6, 2024
|
|
19
35
|
----------
|
|
20
|
-
API Changes:
|
|
36
|
+
API Changes:
|
|
21
37
|
* `@splunk/splunk-utils` dependency has been updated to `3.0.0`.
|
|
22
38
|
* `3.0.0` no longer supports Search V1 for some endpoints and has had the fallback behavior for older versions of Splunk removed (SUI-5957).
|
|
23
39
|
* `react-page` does not use these endpoints directly but apps leveraging `react-page` and search endpoints should use search V2. See the `@splunk/splunk-utils` CHANGELOG and [Semantic API Versioning](https://docs.splunk.com/Documentation/Splunk/9.1.2/RESTREF/RESTsearch#Semantic_API_versioning) for more details.
|
package/README.md
CHANGED
|
@@ -29,3 +29,13 @@ import MyPage from 'pages/MyPage';
|
|
|
29
29
|
|
|
30
30
|
layout(<MyPage />, { pageTitle: 'A React Page', hideFooter: true, layout: 'fixed' });
|
|
31
31
|
```
|
|
32
|
+
|
|
33
|
+
### React 18
|
|
34
|
+
To use the new [createRoot](https://react.dev/reference/react-dom/client/createRoot#createroot) functionality introducted in React 18, use the `'@splunk/react-page/18'` import instead of `@splunk/react-page`.
|
|
35
|
+
|
|
36
|
+
```js
|
|
37
|
+
import layout from '@splunk/react-page/18';
|
|
38
|
+
import MyPage from 'pages/MyPage';
|
|
39
|
+
|
|
40
|
+
layout(<MyPage />, { pageTitle: 'A React Page', hideFooter: true, layout: 'fixed' });
|
|
41
|
+
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@splunk/react-page",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.0.0-beta.3",
|
|
4
4
|
"description": "Load React components into the latest layout from Splunk Enterprise",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Splunk Inc.",
|
|
@@ -21,9 +21,9 @@
|
|
|
21
21
|
"test:cypress:ci": "node src/tests/run-cypress-tests.js"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@splunk/react-ui": "
|
|
24
|
+
"@splunk/react-ui": "5.0.0-beta.3",
|
|
25
25
|
"@splunk/splunk-utils": "^3.2.0",
|
|
26
|
-
"@splunk/themes": "
|
|
26
|
+
"@splunk/themes": "1.0.0-beta.3",
|
|
27
27
|
"@splunk/ui-utils": "^1.8.0",
|
|
28
28
|
"prop-types": "^15.6.2",
|
|
29
29
|
"scriptjs": "^2.5.8"
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"@babel/eslint-parser": "^7.16.0",
|
|
34
34
|
"@splunk/babel-preset": "^4.0.0",
|
|
35
35
|
"@splunk/eslint-config": "^5.0.0",
|
|
36
|
-
"@splunk/react-docs": "1.0.0-beta.21",
|
|
36
|
+
"@splunk/react-docs": "1.0.0-beta.21.v5.2",
|
|
37
37
|
"@splunk/stylelint-config": "^5.0.0",
|
|
38
38
|
"@splunk/webpack-configs": "^7.0.2",
|
|
39
39
|
"babel-loader": "^8.3.0",
|
|
@@ -49,8 +49,8 @@
|
|
|
49
49
|
"eslint-plugin-react": "^7.36.1",
|
|
50
50
|
"eslint-plugin-react-hooks": "^4.6.2",
|
|
51
51
|
"execa": "^4.0.0",
|
|
52
|
-
"react": "^
|
|
53
|
-
"react-dom": "^
|
|
52
|
+
"react": "^18.2.0",
|
|
53
|
+
"react-dom": "^18.2.0",
|
|
54
54
|
"styled-components": "^5.3.10",
|
|
55
55
|
"stylelint": "^15.11.0",
|
|
56
56
|
"webpack": "^5.88.2",
|
|
@@ -59,8 +59,8 @@
|
|
|
59
59
|
"webpack-merge": "^5.9.0"
|
|
60
60
|
},
|
|
61
61
|
"peerDependencies": {
|
|
62
|
-
"react": "^16.8",
|
|
63
|
-
"react-dom": "^16.8",
|
|
62
|
+
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
|
|
63
|
+
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0",
|
|
64
64
|
"styled-components": "^5.3.10"
|
|
65
65
|
},
|
|
66
66
|
"engines": {
|