@splunk/react-page 8.0.0 → 8.1.0
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 +41 -0
- package/18.js +24 -24
- package/CHANGELOG.md +8 -3
- package/Loading.d.ts +19 -0
- package/LoadingStyles.d.ts +7 -0
- package/baseLayout.d.ts +46 -0
- package/index.d.ts +50 -0
- package/index.js +13 -13
- package/package.json +15 -11
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
|
@@ -79,21 +79,21 @@
|
|
|
79
79
|
const c = require("@splunk/themes/SplunkThemeProvider");
|
|
80
80
|
var d = e.n(c);
|
|
81
81
|
// CONCATENATED MODULE: external "styled-components"
|
|
82
|
-
const
|
|
83
|
-
var
|
|
82
|
+
const p = require("styled-components");
|
|
83
|
+
var s = e.n(p);
|
|
84
84
|
// CONCATENATED MODULE: external "@splunk/themes"
|
|
85
85
|
const v = require("@splunk/themes");
|
|
86
86
|
// CONCATENATED MODULE: ./src/LoadingStyles.js
|
|
87
|
-
function
|
|
87
|
+
function f() {
|
|
88
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
|
-
|
|
89
|
+
f = function n() {
|
|
90
90
|
return e;
|
|
91
91
|
};
|
|
92
92
|
return e;
|
|
93
93
|
}
|
|
94
|
-
function
|
|
94
|
+
function m() {
|
|
95
95
|
var e = k([ "\n color: ", ";\n padding-top: 30vh;\n text-align: center;\n min-height: 400px;\n" ]);
|
|
96
|
-
|
|
96
|
+
m = function n() {
|
|
97
97
|
return e;
|
|
98
98
|
};
|
|
99
99
|
return e;
|
|
@@ -135,18 +135,18 @@
|
|
|
135
135
|
}
|
|
136
136
|
var S = 45;
|
|
137
137
|
var w = 34;
|
|
138
|
-
var E = (0,
|
|
139
|
-
var j =
|
|
140
|
-
var C =
|
|
138
|
+
var E = (0, p.keyframes)(g());
|
|
139
|
+
var j = s().div(b(), v.variables.backgroundColorPage);
|
|
140
|
+
var C = s().div(y(), (0, v.pick)({
|
|
141
141
|
prisma: v.variables.backgroundColorSection,
|
|
142
142
|
enterprise: v.variables.gray20
|
|
143
143
|
}), w);
|
|
144
|
-
var
|
|
144
|
+
var x = s().div(h(), (0, v.pick)({
|
|
145
145
|
prisma: v.variables.backgroundColorPopup,
|
|
146
146
|
enterprise: v.variables.gray30
|
|
147
147
|
}), S);
|
|
148
|
-
var
|
|
149
|
-
var B =
|
|
148
|
+
var q = s().div(m(), v.variables.contentColorInverted);
|
|
149
|
+
var B = s().div(f(), E, v.variables.neutral500, (0, v.pick)({
|
|
150
150
|
prisma: v.variables.spacingMedium,
|
|
151
151
|
enterprise: v.variables.spacingSmall
|
|
152
152
|
}));
|
|
@@ -167,9 +167,9 @@
|
|
|
167
167
|
SplunkBarFallback: P().elementType
|
|
168
168
|
};
|
|
169
169
|
function T(e) {
|
|
170
|
-
var n = e.AppBarFallback, r = n === void 0 ?
|
|
170
|
+
var n = e.AppBarFallback, r = n === void 0 ? x : n, t = e.hideAppBar, i = e.hideChrome, o = e.hideSplunkBar, l = e.SplunkBarFallback, u = l === void 0 ? C : l;
|
|
171
171
|
|
|
172
|
-
return a().createElement(j, null, !i && !o && a().createElement(u, null), !i && !t && a().createElement(r, null), a().createElement(
|
|
172
|
+
return a().createElement(j, null, !i && !o && a().createElement(u, null), !i && !t && a().createElement(r, null), a().createElement(q, null, a().createElement(B, null), a().createElement(B, null), a().createElement(B, null), a().createElement(L(), null, (0,
|
|
173
173
|
_._)("Loading"))));
|
|
174
174
|
}
|
|
175
175
|
T.propTypes = A;
|
|
@@ -181,7 +181,7 @@
|
|
|
181
181
|
if (Object.getOwnPropertySymbols) {
|
|
182
182
|
var i = Object.getOwnPropertySymbols(e);
|
|
183
183
|
for (t = 0; t < i.length; t++) {
|
|
184
|
-
r = i[t], n.
|
|
184
|
+
r = i[t], -1 === n.indexOf(r) && {}.propertyIsEnumerable.call(e, r) && (a[r] = e[r]);
|
|
185
185
|
}
|
|
186
186
|
}
|
|
187
187
|
return a;
|
|
@@ -191,7 +191,7 @@
|
|
|
191
191
|
var r = {};
|
|
192
192
|
for (var t in e) {
|
|
193
193
|
if ({}.hasOwnProperty.call(e, t)) {
|
|
194
|
-
if (n.
|
|
194
|
+
if (-1 !== n.indexOf(t)) continue;
|
|
195
195
|
r[t] = e[t];
|
|
196
196
|
}
|
|
197
197
|
}
|
|
@@ -278,7 +278,7 @@
|
|
|
278
278
|
* @param {Boolean} [options.hideSplunkBar = false] - Hides the Splunk bar.
|
|
279
279
|
* @param {string} [options.layout = 'scrolling'] - Set to `fixed` to fix all navigation bars
|
|
280
280
|
* to the edge of the page.
|
|
281
|
-
* @param {Boolean} [options.useGlobalLayerStack = true] - Wraps elements in
|
|
281
|
+
* @param {Boolean} [options.useGlobalLayerStack = true] - Wraps elements in `@splunk/react-ui`'s LayerStackGlobalProvider.
|
|
282
282
|
* @param {String} [options.theme = 'light'] - Used to theme UI elements. Ex. "light" or "dark".
|
|
283
283
|
* @param {String} [options.themeFamily = 'enterprise'] - Ex. Theme family to use for UI elements. Ex. "enterprise" or "prisma".
|
|
284
284
|
* @param {String} [options.themeDensity] - Ex. Theme density to use for UI elements. Ex. "compact" or "comfortable".
|
|
@@ -290,11 +290,11 @@
|
|
|
290
290
|
* @param {function} [options.onLayoutComplete] - A callback function which executes after layout API is fetched and compiled.
|
|
291
291
|
*/ function K(e, n) {
|
|
292
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,
|
|
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, p = r.loader, s = p === void 0 ? "scriptjs" : p, v = M(r, [ "useGlobalLayerStack", "pageTitle", "theme", "themeDensity", "loader" ]);
|
|
294
294
|
if (o) {
|
|
295
295
|
document.title = o;
|
|
296
296
|
}
|
|
297
|
-
var
|
|
297
|
+
var f = v.hideChrome, m = v.themeFamily, h = m === void 0 ? "enterprise" : m, y = v.hideAppBar, b = v.hideSplunkBar, g = v.SplunkBarFallback, k = g === void 0 ? C : g, E = v.AppBarFallback, j = E === void 0 ? x : E, q = v.lazyLoadLayout, B = q === void 0 ? false : q, O = v.onLayoutComplete, P = v.onLayoutStart;
|
|
298
298
|
var F = document.createElement("div");
|
|
299
299
|
var L = document.createElement("div");
|
|
300
300
|
P === null || P === void 0 ? void 0 : P({
|
|
@@ -312,7 +312,7 @@
|
|
|
312
312
|
var z;
|
|
313
313
|
if (B) {
|
|
314
314
|
// render the React app immediately without waiting for layout API
|
|
315
|
-
if (!
|
|
315
|
+
if (!f) {
|
|
316
316
|
document.body.appendChild(L);
|
|
317
317
|
z = n( a().createElement(a().Fragment, null, !b && a().createElement(k, null), !y && a().createElement(j, null)), L);
|
|
318
318
|
// explicitly set height and background of header container to avoid layout and color shift when fallback gets replaced
|
|
@@ -362,11 +362,11 @@
|
|
|
362
362
|
document.body.appendChild(t);
|
|
363
363
|
}
|
|
364
364
|
if (B) {
|
|
365
|
-
if (!
|
|
365
|
+
if (!f) {
|
|
366
366
|
// replace placeholder nav bar with real nav bar
|
|
367
367
|
z.unmount(L);
|
|
368
368
|
var a = document.querySelector(R);
|
|
369
|
-
var o = (!
|
|
369
|
+
var o = (!f && !b ? w : 0) + (!f && !y ? S : 0);
|
|
370
370
|
// set a min-height for basic nav bar components and auto height for any additional components like global banner
|
|
371
371
|
L.style.minHeight = "".concat(o, "px");
|
|
372
372
|
L.style.height = "auto";
|
|
@@ -383,7 +383,7 @@
|
|
|
383
383
|
}), 30);
|
|
384
384
|
}
|
|
385
385
|
}), {
|
|
386
|
-
loader:
|
|
386
|
+
loader: s
|
|
387
387
|
});
|
|
388
388
|
}
|
|
389
389
|
/* harmony default export */ const N = K;
|
|
@@ -408,7 +408,7 @@
|
|
|
408
408
|
* @param {Boolean} [options.hideSplunkBar = false] - Hides the Splunk bar.
|
|
409
409
|
* @param {string} [options.layout = 'scrolling'] - Set to `fixed` to fix all navigation bars
|
|
410
410
|
* to the edge of the page.
|
|
411
|
-
* @param {Boolean} [options.useGlobalLayerStack = true] - Wraps elements in
|
|
411
|
+
* @param {Boolean} [options.useGlobalLayerStack = true] - Wraps elements in `@splunk/react-ui`'s LayerStackGlobalProvider.
|
|
412
412
|
* @param {String} [options.theme = 'light'] - Used to theme UI elements. Ex. "light" or "dark".
|
|
413
413
|
* @param {String} [options.loader = 'scriptjs'] - Configures the loader used for the loading the layout - available loaders are "scriptjs" and "requirejs".
|
|
414
414
|
* Change this only if the default loader does not work for your application.
|
package/CHANGELOG.md
CHANGED
|
@@ -1,17 +1,22 @@
|
|
|
1
1
|
Change Log
|
|
2
2
|
============
|
|
3
3
|
|
|
4
|
+
8.1.0 - September 2, 2025
|
|
5
|
+
----------
|
|
6
|
+
New Features:
|
|
7
|
+
* `react-page` now provides Typescript type defitions (SUI-8002).
|
|
8
|
+
|
|
4
9
|
8.0.0 - June 3, 2025
|
|
5
10
|
----------
|
|
6
11
|
* Includes all changes from `8.0.0-beta` and `8.0.0-rc` releases.
|
|
7
12
|
|
|
8
13
|
8.0.0-rc.2 - May 28, 2025
|
|
9
14
|
----------
|
|
10
|
-
* Release candidate 2
|
|
15
|
+
* Release candidate 2.
|
|
11
16
|
|
|
12
17
|
8.0.0-rc.1 - May 14, 2025
|
|
13
18
|
----------
|
|
14
|
-
* Release candidate 1
|
|
19
|
+
* Release candidate 1.
|
|
15
20
|
|
|
16
21
|
8.0.0-beta.4 - May 7, 2025
|
|
17
22
|
----------
|
|
@@ -28,7 +33,7 @@ New Features:
|
|
|
28
33
|
|
|
29
34
|
8.0.0-beta.2 - March 5, 2025
|
|
30
35
|
----------
|
|
31
|
-
* Public release of `8.0.0-beta.1
|
|
36
|
+
* Public release of `8.0.0-beta.1`.
|
|
32
37
|
|
|
33
38
|
8.0.0-beta.1 - February 20, 2025
|
|
34
39
|
----------
|
package/Loading.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export default Loading;
|
|
2
|
+
declare function Loading({ AppBarFallback, hideAppBar, hideChrome, hideSplunkBar, SplunkBarFallback, }: {
|
|
3
|
+
AppBarFallback?: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
4
|
+
hideAppBar: any;
|
|
5
|
+
hideChrome: any;
|
|
6
|
+
hideSplunkBar: any;
|
|
7
|
+
SplunkBarFallback?: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
8
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
declare namespace Loading {
|
|
10
|
+
export { propTypes };
|
|
11
|
+
}
|
|
12
|
+
declare namespace propTypes {
|
|
13
|
+
let hideAppBar: PropTypes.Requireable<boolean>;
|
|
14
|
+
let hideChrome: PropTypes.Requireable<boolean>;
|
|
15
|
+
let hideSplunkBar: PropTypes.Requireable<boolean>;
|
|
16
|
+
let AppBarFallback: PropTypes.Requireable<PropTypes.ReactComponentLike>;
|
|
17
|
+
let SplunkBarFallback: PropTypes.Requireable<PropTypes.ReactComponentLike>;
|
|
18
|
+
}
|
|
19
|
+
import PropTypes from 'prop-types';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export const Main: import("styled-components").StyledComponent<"div", any, import("@splunk/themes").OptionalThemedProps<import("@splunk/themes").AnyTheme>, never>;
|
|
2
|
+
export const SplunkBar: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
3
|
+
export const AppBar: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
4
|
+
export const AppBody: import("styled-components").StyledComponent<"div", any, import("@splunk/themes").OptionalThemedProps<import("@splunk/themes").AnyTheme>, never>;
|
|
5
|
+
export const Dot: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
6
|
+
export const APPBAR_HEIGHT: 45;
|
|
7
|
+
export const SPLUNKBAR_HEIGHT: 34;
|
package/baseLayout.d.ts
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
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 {element} render - A render function that returns an unmount() function.
|
|
7
|
+
* @param {object} [options]
|
|
8
|
+
* @param {string} [options.pageTitle] - Changes the page title.
|
|
9
|
+
* @param {Boolean} [options.hideAppBar = false] - Hides the app bar.
|
|
10
|
+
* @param {Boolean} [options.hideAppsList = false] - Hides the app list in
|
|
11
|
+
* the Splunk bar.
|
|
12
|
+
* @param {Boolean} [options.hideChrome = false] - Renders only the main content, hiding
|
|
13
|
+
* the Splunk bar, app bar, and footer.
|
|
14
|
+
* @param {Boolean} [options.hideFooter = false] - Hides the footer.
|
|
15
|
+
* @param {Boolean} [options.hideSplunkBar = false] - Hides the Splunk bar.
|
|
16
|
+
* @param {string} [options.layout = 'scrolling'] - Set to `fixed` to fix all navigation bars
|
|
17
|
+
* to the edge of the page.
|
|
18
|
+
* @param {Boolean} [options.useGlobalLayerStack = true] - Wraps elements in `@splunk/react-ui`'s LayerStackGlobalProvider.
|
|
19
|
+
* @param {String} [options.theme = 'light'] - Used to theme UI elements. Ex. "light" or "dark".
|
|
20
|
+
* @param {String} [options.themeFamily = 'enterprise'] - Ex. Theme family to use for UI elements. Ex. "enterprise" or "prisma".
|
|
21
|
+
* @param {String} [options.themeDensity] - Ex. Theme density to use for UI elements. Ex. "compact" or "comfortable".
|
|
22
|
+
* @param {String} [options.loader = 'scriptjs'] - Configures the loader used for the loading the layout - available loaders are "scriptjs" and "requirejs".
|
|
23
|
+
* Change this only if the default loader does not work for your application.
|
|
24
|
+
* @param {Boolean} [options.lazyLoadLayout = false] - Prioritizes loading the React element and lazily fetches and compiles the layout API (navigation bar).
|
|
25
|
+
* @param {element} [options.SplunkBarFallback = SplunkBar] - A React element used as a placeholder for the splunk bar while the navigation bar is loading.
|
|
26
|
+
* @param {element} [options.AppBarFallback = AppBar] - A React element used as a placeholder for the app bar while the navigation bar is loading.
|
|
27
|
+
* @param {function} [options.onLayoutComplete] - A callback function which executes after layout API is fetched and compiled.
|
|
28
|
+
*/
|
|
29
|
+
declare function layout(element: any, render: any, { useGlobalLayerStack, pageTitle, theme, themeDensity, loader, ...layoutAPIOptions }?: {
|
|
30
|
+
pageTitle?: string;
|
|
31
|
+
hideAppBar?: boolean;
|
|
32
|
+
hideAppsList?: boolean;
|
|
33
|
+
hideChrome?: boolean;
|
|
34
|
+
hideFooter?: boolean;
|
|
35
|
+
hideSplunkBar?: boolean;
|
|
36
|
+
layout?: string;
|
|
37
|
+
useGlobalLayerStack?: boolean;
|
|
38
|
+
theme?: string;
|
|
39
|
+
themeFamily?: string;
|
|
40
|
+
themeDensity?: string;
|
|
41
|
+
loader?: string;
|
|
42
|
+
lazyLoadLayout?: boolean;
|
|
43
|
+
SplunkBarFallback?: any;
|
|
44
|
+
AppBarFallback?: any;
|
|
45
|
+
onLayoutComplete?: Function;
|
|
46
|
+
}): void;
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
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.themeFamily = 'enterprise'] - Ex. Theme family to use for UI elements. Ex. "enterprise" or "prisma".
|
|
20
|
+
* @param {String} [options.themeDensity] - Ex. Theme density to use for UI elements. Ex. "compact" or "comfortable".
|
|
21
|
+
* @param {String} [options.loader = 'scriptjs'] - Configures the loader used for the loading the layout - available loaders are "scriptjs" and "requirejs".
|
|
22
|
+
* Change this only if the default loader does not work for your application.
|
|
23
|
+
* @param {Boolean} [options.lazyLoadLayout = false] - Prioritizes loading the React element and lazily fetches and compiles the layout API (navigation bar).
|
|
24
|
+
* @param {element} [options.SplunkBarFallback = SplunkBar] - A React element used as a placeholder for the splunk bar while the navigation bar is loading.
|
|
25
|
+
* @param {element} [options.AppBarFallback = AppBar] - A React element used as a placeholder for the app bar while the navigation bar is loading.
|
|
26
|
+
* @param {function} [options.onLayoutComplete] - A callback function which executes after layout API is fetched and compiled.
|
|
27
|
+
* @param {function} [options.onLayoutStart] - A callback function which executes once the layout starts to render
|
|
28
|
+
*/
|
|
29
|
+
declare function layout(element: any, options?: {
|
|
30
|
+
pageTitle?: string;
|
|
31
|
+
hideAppBar?: boolean;
|
|
32
|
+
hideAppsList?: boolean;
|
|
33
|
+
hideChrome?: boolean;
|
|
34
|
+
hideFooter?: boolean;
|
|
35
|
+
hideSplunkBar?: boolean;
|
|
36
|
+
layout?: string;
|
|
37
|
+
useGlobalLayerStack?: boolean;
|
|
38
|
+
theme?: string;
|
|
39
|
+
themeFamily?: string;
|
|
40
|
+
themeDensity?: string;
|
|
41
|
+
loader?: string;
|
|
42
|
+
lazyLoadLayout?: boolean;
|
|
43
|
+
SplunkBarFallback?: any;
|
|
44
|
+
AppBarFallback?: any;
|
|
45
|
+
onLayoutComplete?: Function;
|
|
46
|
+
onLayoutStart?: Function;
|
|
47
|
+
}): void;
|
|
48
|
+
import { AppBar } from './LoadingStyles';
|
|
49
|
+
import { SplunkBar } from './LoadingStyles';
|
|
50
|
+
export { AppBar, SplunkBar };
|
package/index.js
CHANGED
|
@@ -148,10 +148,10 @@
|
|
|
148
148
|
// CONCATENATED MODULE: external "@splunk/react-ui/Layer"
|
|
149
149
|
const j = require("@splunk/react-ui/Layer");
|
|
150
150
|
// CONCATENATED MODULE: external "@splunk/splunk-utils/url"
|
|
151
|
-
const
|
|
151
|
+
const x = require("@splunk/splunk-utils/url");
|
|
152
152
|
// CONCATENATED MODULE: external "@splunk/themes/SplunkThemeProvider"
|
|
153
|
-
const
|
|
154
|
-
var
|
|
153
|
+
const B = require("@splunk/themes/SplunkThemeProvider");
|
|
154
|
+
var q = e.n(B);
|
|
155
155
|
// CONCATENATED MODULE: external "prop-types"
|
|
156
156
|
const O = require("prop-types");
|
|
157
157
|
var P = e.n(O);
|
|
@@ -183,7 +183,7 @@
|
|
|
183
183
|
if (Object.getOwnPropertySymbols) {
|
|
184
184
|
var i = Object.getOwnPropertySymbols(e);
|
|
185
185
|
for (t = 0; t < i.length; t++) {
|
|
186
|
-
r = i[t], n.
|
|
186
|
+
r = i[t], -1 === n.indexOf(r) && {}.propertyIsEnumerable.call(e, r) && (a[r] = e[r]);
|
|
187
187
|
}
|
|
188
188
|
}
|
|
189
189
|
return a;
|
|
@@ -193,7 +193,7 @@
|
|
|
193
193
|
var r = {};
|
|
194
194
|
for (var t in e) {
|
|
195
195
|
if ({}.hasOwnProperty.call(e, t)) {
|
|
196
|
-
if (n.
|
|
196
|
+
if (-1 !== n.indexOf(t)) continue;
|
|
197
197
|
r[t] = e[t];
|
|
198
198
|
}
|
|
199
199
|
}
|
|
@@ -212,7 +212,7 @@
|
|
|
212
212
|
*/ function R(e, n) {
|
|
213
213
|
var r = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}, t = r.loader, a = t === void 0 ? "scriptjs" : t;
|
|
214
214
|
var i = e === "dark" ? I : G;
|
|
215
|
-
var o = (0,
|
|
215
|
+
var o = (0, x.createStaticURL)(i);
|
|
216
216
|
if (a === "scriptjs") {
|
|
217
217
|
E()(o, (function() {
|
|
218
218
|
// eslint-disable-next-line no-underscore-dangle
|
|
@@ -261,7 +261,7 @@
|
|
|
261
261
|
*/ function N(e, n, r) {
|
|
262
262
|
var t = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
263
263
|
var a = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {};
|
|
264
|
-
var i = t ? w().createElement(j.LayerStackGlobalProvider, null, w().createElement(
|
|
264
|
+
var i = t ? w().createElement(j.LayerStackGlobalProvider, null, w().createElement(q(), a, e)) : w().createElement(q(), a, e);
|
|
265
265
|
return n(i, r);
|
|
266
266
|
}
|
|
267
267
|
/**
|
|
@@ -280,7 +280,7 @@
|
|
|
280
280
|
* @param {Boolean} [options.hideSplunkBar = false] - Hides the Splunk bar.
|
|
281
281
|
* @param {string} [options.layout = 'scrolling'] - Set to `fixed` to fix all navigation bars
|
|
282
282
|
* to the edge of the page.
|
|
283
|
-
* @param {Boolean} [options.useGlobalLayerStack = true] - Wraps elements in
|
|
283
|
+
* @param {Boolean} [options.useGlobalLayerStack = true] - Wraps elements in `@splunk/react-ui`'s LayerStackGlobalProvider.
|
|
284
284
|
* @param {String} [options.theme = 'light'] - Used to theme UI elements. Ex. "light" or "dark".
|
|
285
285
|
* @param {String} [options.themeFamily = 'enterprise'] - Ex. Theme family to use for UI elements. Ex. "enterprise" or "prisma".
|
|
286
286
|
* @param {String} [options.themeDensity] - Ex. Theme density to use for UI elements. Ex. "compact" or "comfortable".
|
|
@@ -296,7 +296,7 @@
|
|
|
296
296
|
if (i) {
|
|
297
297
|
document.title = i;
|
|
298
298
|
}
|
|
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,
|
|
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, x = p.lazyLoadLayout, B = x === void 0 ? false : x, O = p.onLayoutComplete, P = p.onLayoutStart;
|
|
300
300
|
var A = document.createElement("div");
|
|
301
301
|
var F = document.createElement("div");
|
|
302
302
|
P === null || P === void 0 ? void 0 : P({
|
|
@@ -312,7 +312,7 @@
|
|
|
312
312
|
};
|
|
313
313
|
var T;
|
|
314
314
|
var z;
|
|
315
|
-
if (
|
|
315
|
+
if (B) {
|
|
316
316
|
// render the React app immediately without waiting for layout API
|
|
317
317
|
if (!s) {
|
|
318
318
|
document.body.appendChild(F);
|
|
@@ -333,7 +333,7 @@
|
|
|
333
333
|
T = N(e, n, A, a, _);
|
|
334
334
|
} else {
|
|
335
335
|
document.body.appendChild(A);
|
|
336
|
-
T = n( w().createElement(
|
|
336
|
+
T = n( w().createElement(q(), _, w().createElement(H, p)), A);
|
|
337
337
|
}
|
|
338
338
|
R(l, (function(r) {
|
|
339
339
|
var t;
|
|
@@ -363,7 +363,7 @@
|
|
|
363
363
|
t = document.createElement("div");
|
|
364
364
|
document.body.appendChild(t);
|
|
365
365
|
}
|
|
366
|
-
if (
|
|
366
|
+
if (B) {
|
|
367
367
|
if (!s) {
|
|
368
368
|
// replace placeholder nav bar with real nav bar
|
|
369
369
|
z.unmount(F);
|
|
@@ -413,7 +413,7 @@
|
|
|
413
413
|
* @param {Boolean} [options.hideSplunkBar = false] - Hides the Splunk bar.
|
|
414
414
|
* @param {string} [options.layout = 'scrolling'] - Set to `fixed` to fix all navigation bars
|
|
415
415
|
* to the edge of the page.
|
|
416
|
-
* @param {Boolean} [options.useGlobalLayerStack = true] - Wraps elements in
|
|
416
|
+
* @param {Boolean} [options.useGlobalLayerStack = true] - Wraps elements in `@splunk/react-ui`'s LayerStackGlobalProvider.
|
|
417
417
|
* @param {String} [options.theme = 'light'] - Used to theme UI elements. Ex. "light" or "dark".
|
|
418
418
|
* @param {String} [options.themeFamily = 'enterprise'] - Ex. Theme family to use for UI elements. Ex. "enterprise" or "prisma".
|
|
419
419
|
* @param {String} [options.themeDensity] - Ex. Theme density to use for UI elements. Ex. "compact" or "comfortable".
|
package/package.json
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@splunk/react-page",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.1.0",
|
|
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,24 @@
|
|
|
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.
|
|
25
|
-
"@splunk/splunk-utils": "^3.
|
|
26
|
-
"@splunk/themes": "^1.
|
|
27
|
-
"@splunk/ui-utils": "^1.
|
|
28
|
+
"@splunk/react-ui": "^5.3.0",
|
|
29
|
+
"@splunk/splunk-utils": "^3.3.0",
|
|
30
|
+
"@splunk/themes": "^1.2.1",
|
|
31
|
+
"@splunk/ui-utils": "^1.10.0",
|
|
28
32
|
"prop-types": "^15.6.2",
|
|
29
33
|
"scriptjs": "^2.5.8"
|
|
30
34
|
},
|
|
31
35
|
"devDependencies": {
|
|
32
|
-
"@babel/core": "^7.
|
|
33
|
-
"@babel/eslint-parser": "^7.
|
|
36
|
+
"@babel/core": "^7.28.0",
|
|
37
|
+
"@babel/eslint-parser": "^7.28.0",
|
|
34
38
|
"@splunk/babel-preset": "^4.0.0",
|
|
35
39
|
"@splunk/eslint-config": "^5.0.0",
|
|
36
|
-
"@splunk/react-docs": "^1.
|
|
40
|
+
"@splunk/react-docs": "^1.3.0",
|
|
37
41
|
"@splunk/stylelint-config": "^5.0.0",
|
|
38
42
|
"@splunk/webpack-configs": "^7.0.2",
|
|
39
43
|
"babel-loader": "^8.3.0",
|
|
@@ -55,7 +59,7 @@
|
|
|
55
59
|
"stylelint": "^15.11.0",
|
|
56
60
|
"webpack": "^5.88.2",
|
|
57
61
|
"webpack-cli": "^5.1.4",
|
|
58
|
-
"webpack-dev-server": "^
|
|
62
|
+
"webpack-dev-server": "^5.2.2",
|
|
59
63
|
"webpack-merge": "^5.9.0"
|
|
60
64
|
},
|
|
61
65
|
"peerDependencies": {
|