@pallasoft/ps-core-components 2.20.0 → 2.21.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/dist/components/ps-client-only.d.ts +6 -0
- package/dist/components/ps-client-only.js +7 -0
- package/dist/constants/ps-hydration-store.d.ts +5 -0
- package/dist/constants/ps-hydration-store.js +8 -0
- package/dist/esm/components/ps-client-only.js +3 -0
- package/dist/esm/constants/ps-hydration-store.js +5 -0
- package/dist/esm/hooks/use-ps-hydrated.js +3 -0
- package/dist/esm/index.js +2 -0
- package/dist/hooks/use-ps-hydrated.d.ts +1 -0
- package/dist/hooks/use-ps-hydrated.js +7 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/package.json +1 -1
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PsClientOnly = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const use_ps_hydrated_1 = require("../hooks/use-ps-hydrated");
|
|
6
|
+
const PsClientOnly = ({ children, fallback = null }) => (0, use_ps_hydrated_1.usePsHydrated)() ? (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: children() }) : (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: fallback });
|
|
7
|
+
exports.PsClientOnly = PsClientOnly;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { usePsHydrated } from '../hooks/use-ps-hydrated';
|
|
3
|
+
export const PsClientOnly = ({ children, fallback = null }) => usePsHydrated() ? _jsx(_Fragment, { children: children() }) : _jsx(_Fragment, { children: fallback });
|
package/dist/esm/index.js
CHANGED
|
@@ -10,6 +10,7 @@ export * from './components/ps-pallasoft-mark';
|
|
|
10
10
|
export * from './components/ps-pallasoft-sign-in-button';
|
|
11
11
|
export * from './constants/ps-pallasoft-mark-config';
|
|
12
12
|
export * from './components/ps-card';
|
|
13
|
+
export * from './components/ps-client-only';
|
|
13
14
|
export * from './components/ps-draggable-grid';
|
|
14
15
|
export * from './components/ps-empty-state';
|
|
15
16
|
export * from './components/ps-fab';
|
|
@@ -48,6 +49,7 @@ export * from './contexts/ps-layer-context';
|
|
|
48
49
|
export * from './hooks/use-ps-layer-z-index';
|
|
49
50
|
export * from './hooks/use-ps-route-loader-data';
|
|
50
51
|
export * from './hooks/use-ps-element-size';
|
|
52
|
+
export * from './hooks/use-ps-hydrated';
|
|
51
53
|
export * from './hooks/use-ps-viewport';
|
|
52
54
|
export * from './interfaces/ps-component-props';
|
|
53
55
|
export * from './models/ps-element-size';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const usePsHydrated: () => boolean;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.usePsHydrated = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const ps_hydration_store_1 = require("../constants/ps-hydration-store");
|
|
6
|
+
const usePsHydrated = () => (0, react_1.useSyncExternalStore)(ps_hydration_store_1.PsHydrationStore.subscribe, ps_hydration_store_1.PsHydrationStore.clientSnapshot, ps_hydration_store_1.PsHydrationStore.serverSnapshot);
|
|
7
|
+
exports.usePsHydrated = usePsHydrated;
|
package/dist/index.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export * from './components/ps-pallasoft-mark';
|
|
|
10
10
|
export * from './components/ps-pallasoft-sign-in-button';
|
|
11
11
|
export * from './constants/ps-pallasoft-mark-config';
|
|
12
12
|
export * from './components/ps-card';
|
|
13
|
+
export * from './components/ps-client-only';
|
|
13
14
|
export * from './components/ps-draggable-grid';
|
|
14
15
|
export * from './components/ps-empty-state';
|
|
15
16
|
export * from './components/ps-fab';
|
|
@@ -48,6 +49,7 @@ export * from './contexts/ps-layer-context';
|
|
|
48
49
|
export * from './hooks/use-ps-layer-z-index';
|
|
49
50
|
export * from './hooks/use-ps-route-loader-data';
|
|
50
51
|
export * from './hooks/use-ps-element-size';
|
|
52
|
+
export * from './hooks/use-ps-hydrated';
|
|
51
53
|
export * from './hooks/use-ps-viewport';
|
|
52
54
|
export * from './interfaces/ps-component-props';
|
|
53
55
|
export * from './models/ps-element-size';
|
package/dist/index.js
CHANGED
|
@@ -26,6 +26,7 @@ __exportStar(require("./components/ps-pallasoft-mark"), exports);
|
|
|
26
26
|
__exportStar(require("./components/ps-pallasoft-sign-in-button"), exports);
|
|
27
27
|
__exportStar(require("./constants/ps-pallasoft-mark-config"), exports);
|
|
28
28
|
__exportStar(require("./components/ps-card"), exports);
|
|
29
|
+
__exportStar(require("./components/ps-client-only"), exports);
|
|
29
30
|
__exportStar(require("./components/ps-draggable-grid"), exports);
|
|
30
31
|
__exportStar(require("./components/ps-empty-state"), exports);
|
|
31
32
|
__exportStar(require("./components/ps-fab"), exports);
|
|
@@ -64,6 +65,7 @@ __exportStar(require("./contexts/ps-layer-context"), exports);
|
|
|
64
65
|
__exportStar(require("./hooks/use-ps-layer-z-index"), exports);
|
|
65
66
|
__exportStar(require("./hooks/use-ps-route-loader-data"), exports);
|
|
66
67
|
__exportStar(require("./hooks/use-ps-element-size"), exports);
|
|
68
|
+
__exportStar(require("./hooks/use-ps-hydrated"), exports);
|
|
67
69
|
__exportStar(require("./hooks/use-ps-viewport"), exports);
|
|
68
70
|
__exportStar(require("./interfaces/ps-component-props"), exports);
|
|
69
71
|
__exportStar(require("./models/ps-element-size"), exports);
|