oidc-spa 7.1.5 → 7.1.6

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.
@@ -125,7 +125,7 @@ var trustedFetch_1 = require("./trustedFetch");
125
125
  var getIsOnline_1 = require("../tools/getIsOnline");
126
126
  (0, handleOidcCallback_1.handleOidcCallback)();
127
127
  // NOTE: Replaced at build time
128
- var VERSION = "7.1.5";
128
+ var VERSION = "7.1.6";
129
129
  var globalContext = {
130
130
  prOidcByConfigId: new Map(),
131
131
  hasLogoutBeenCalled: (0, tsafe_1.id)(false),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oidc-spa",
3
- "version": "7.1.5",
3
+ "version": "7.1.6",
4
4
  "description": "Openidconnect client for Single Page Applications",
5
5
  "repository": {
6
6
  "type": "git",
@@ -12,7 +12,6 @@
12
12
  ".": "./index.js",
13
13
  "./mock": "./mock/index.js",
14
14
  "./react": "./react/index.js",
15
- "./react/tools/ClientOnly": "./react/tools/ClientOnly.js",
16
15
  "./mock/react": "./mock/react.js",
17
16
  "./entrypoint": "./entrypoint.js",
18
17
  "./backend": "./backend.js",
@@ -60,7 +59,6 @@
60
59
  "./src/mock/react.tsx",
61
60
  "./src/react/index.ts",
62
61
  "./src/react/react.tsx",
63
- "./src/react/tools/ClientOnly.tsx",
64
62
  "./src/tools/Deferred.ts",
65
63
  "./src/tools/EphemeralSessionStorage.ts",
66
64
  "./src/tools/Evt.ts",
@@ -178,9 +176,6 @@
178
176
  "./react/react.d.ts",
179
177
  "./react/react.js",
180
178
  "./react/react.js.map",
181
- "./react/tools/ClientOnly.d.ts",
182
- "./react/tools/ClientOnly.js",
183
- "./react/tools/ClientOnly.js.map",
184
179
  "./tools/Deferred.d.ts",
185
180
  "./tools/Deferred.js",
186
181
  "./tools/Deferred.js.map",
@@ -1,13 +0,0 @@
1
- /**
2
- * Generic client-only rendering boundary (unrelated to OIDC).
3
- *
4
- * Children are rendered only after hydration on the client.
5
- * During SSR, the optional `fallback` is shown instead.
6
- *
7
- * Provided here for convenience—you can replace it with your own
8
- * implementation or existing tooling if you prefer.
9
- */
10
- export declare function ClientOnly(props: {
11
- children: React.ReactNode;
12
- fallback?: React.ReactNode;
13
- }): import("react/jsx-runtime").JSX.Element;
@@ -1,42 +0,0 @@
1
- "use strict";
2
- var __read = (this && this.__read) || function (o, n) {
3
- var m = typeof Symbol === "function" && o[Symbol.iterator];
4
- if (!m) return o;
5
- var i = m.call(o), r, ar = [], e;
6
- try {
7
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
8
- }
9
- catch (error) { e = { error: error }; }
10
- finally {
11
- try {
12
- if (r && !r.done && (m = i["return"])) m.call(i);
13
- }
14
- finally { if (e) throw e.error; }
15
- }
16
- return ar;
17
- };
18
- Object.defineProperty(exports, "__esModule", { value: true });
19
- exports.ClientOnly = ClientOnly;
20
- var jsx_runtime_1 = require("react/jsx-runtime");
21
- var react_1 = require("react");
22
- /**
23
- * Generic client-only rendering boundary (unrelated to OIDC).
24
- *
25
- * Children are rendered only after hydration on the client.
26
- * During SSR, the optional `fallback` is shown instead.
27
- *
28
- * Provided here for convenience—you can replace it with your own
29
- * implementation or existing tooling if you prefer.
30
- */
31
- function ClientOnly(props) {
32
- var children = props.children, fallback = props.fallback;
33
- var _a = __read((0, react_1.useState)(false), 2), isHydrated = _a[0], setIsHydrated = _a[1];
34
- (0, react_1.useEffect)(function () {
35
- setIsHydrated(true);
36
- }, []);
37
- if (!isHydrated) {
38
- return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: fallback !== null && fallback !== void 0 ? fallback : null });
39
- }
40
- return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: children });
41
- }
42
- //# sourceMappingURL=ClientOnly.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ClientOnly.js","sourceRoot":"","sources":["../../src/react/tools/ClientOnly.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAWA,gCAaC;;AAxBD,+BAA4C;AAE5C;;;;;;;;GAQG;AACH,SAAgB,UAAU,CAAC,KAAgE;IAC/E,IAAA,QAAQ,GAAe,KAAK,SAApB,EAAE,QAAQ,GAAK,KAAK,SAAV,CAAW;IAE/B,IAAA,KAAA,OAA8B,IAAA,gBAAQ,EAAC,KAAK,CAAC,IAAA,EAA5C,UAAU,QAAA,EAAE,aAAa,QAAmB,CAAC;IACpD,IAAA,iBAAS,EAAC;QACN,aAAa,CAAC,IAAI,CAAC,CAAC;IACxB,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,IAAI,CAAC,UAAU,EAAE,CAAC;QACd,OAAO,2DAAG,QAAQ,aAAR,QAAQ,cAAR,QAAQ,GAAI,IAAI,GAAI,CAAC;IACnC,CAAC;IAED,OAAO,2DAAG,QAAQ,GAAI,CAAC;AAC3B,CAAC"}
@@ -1,25 +0,0 @@
1
- import { useState, useEffect } from "react";
2
-
3
- /**
4
- * Generic client-only rendering boundary (unrelated to OIDC).
5
- *
6
- * Children are rendered only after hydration on the client.
7
- * During SSR, the optional `fallback` is shown instead.
8
- *
9
- * Provided here for convenience—you can replace it with your own
10
- * implementation or existing tooling if you prefer.
11
- */
12
- export function ClientOnly(props: { children: React.ReactNode; fallback?: React.ReactNode }) {
13
- const { children, fallback } = props;
14
-
15
- const [isHydrated, setIsHydrated] = useState(false);
16
- useEffect(() => {
17
- setIsHydrated(true);
18
- }, []);
19
-
20
- if (!isHydrated) {
21
- return <>{fallback ?? null}</>;
22
- }
23
-
24
- return <>{children}</>;
25
- }