@pallasoft/ps-core-components 2.3.1 → 2.5.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-draggable-grid.d.ts +9 -12
- package/dist/components/ps-draggable-grid.js +72 -45
- package/dist/components/ps-navigation-progress.d.ts +3 -2
- package/dist/components/ps-navigation-progress.js +13 -22
- package/dist/components/ps-section-header.js +1 -1
- package/dist/components/ps-skeleton-card.d.ts +4 -0
- package/dist/components/ps-skeleton-card.js +9 -0
- package/dist/components/ps-skeleton-group.d.ts +7 -0
- package/dist/components/ps-skeleton-group.js +6 -0
- package/dist/components/ps-skeleton-list.d.ts +8 -0
- package/dist/components/ps-skeleton-list.js +10 -0
- package/dist/components/ps-skeleton-table.d.ts +7 -0
- package/dist/components/ps-skeleton-table.js +15 -0
- package/dist/components/ps-skeleton-text.d.ts +5 -0
- package/dist/components/ps-skeleton-text.js +12 -0
- package/dist/components/ps-skeleton.d.ts +3 -1
- package/dist/components/ps-skeleton.js +6 -1
- package/dist/constants/ps-draggable-grid.d.ts +17 -0
- package/dist/constants/ps-draggable-grid.js +26 -0
- package/dist/constants/ps-navigation-progress-config.d.ts +5 -0
- package/dist/constants/ps-navigation-progress-config.js +5 -0
- package/dist/constants/ps-skeleton-config.d.ts +3 -0
- package/dist/constants/ps-skeleton-config.js +6 -0
- package/dist/esm/components/ps-accordion.js +5 -0
- package/dist/esm/components/ps-action-tile.js +7 -0
- package/dist/esm/components/ps-audio-spectrum.js +9 -0
- package/dist/esm/components/ps-badge.js +10 -0
- package/dist/esm/components/ps-button.js +16 -0
- package/dist/esm/components/ps-card.js +14 -0
- package/dist/esm/components/ps-draggable-grid.js +80 -0
- package/dist/esm/components/ps-empty-state.js +28 -0
- package/dist/esm/components/ps-fab.js +9 -0
- package/dist/esm/components/ps-infinite-scroll.js +5 -0
- package/dist/esm/components/ps-layer.js +3 -0
- package/dist/esm/components/ps-list-tile.js +11 -0
- package/dist/esm/components/ps-metric-card.js +3 -0
- package/dist/esm/components/ps-navigation-progress.js +21 -0
- package/dist/esm/components/ps-pill.js +10 -0
- package/dist/esm/components/ps-portable-text.js +34 -0
- package/dist/esm/components/ps-reflective-app-shell.js +13 -0
- package/dist/esm/components/ps-section-header.js +2 -0
- package/dist/esm/components/ps-site-header.js +11 -0
- package/dist/esm/components/ps-skeleton-card.js +5 -0
- package/dist/esm/components/ps-skeleton-group.js +2 -0
- package/dist/esm/components/ps-skeleton-list.js +6 -0
- package/dist/esm/components/ps-skeleton-table.js +11 -0
- package/dist/esm/components/ps-skeleton-text.js +8 -0
- package/dist/esm/components/ps-skeleton.js +8 -0
- package/dist/esm/components/ps-spinner.js +12 -0
- package/dist/esm/components/ps-theme-toggle.js +7 -0
- package/dist/esm/components/ps-voice-orb.js +100 -0
- package/dist/esm/constants/ps-draggable-grid.js +23 -0
- package/dist/esm/constants/ps-navigation-progress-config.js +12 -0
- package/dist/esm/constants/ps-skeleton-config.js +3 -0
- package/dist/esm/constants/ps-voice-orb.js +85 -0
- package/dist/esm/contexts/ps-layer-context.js +2 -0
- package/dist/esm/hooks/use-ps-audio-spectrum.js +65 -0
- package/dist/esm/hooks/use-ps-exit-transition.js +29 -0
- package/dist/esm/hooks/use-ps-hide-on-scroll.js +25 -0
- package/dist/esm/hooks/use-ps-invisible-recaptcha.js +90 -0
- package/dist/esm/hooks/use-ps-layer-z-index.js +4 -0
- package/dist/esm/hooks/use-ps-navigation-progress.js +41 -0
- package/dist/esm/hooks/use-ps-route-loader-data.js +12 -0
- package/dist/esm/hooks/use-ps-viewport.js +18 -0
- package/dist/esm/index.js +43 -0
- package/dist/esm/interfaces/ps-component-props.js +1 -0
- package/dist/esm/models/ps-draggable-grid.js +1 -0
- package/dist/esm/models/ps-navigation-progress.js +1 -0
- package/dist/esm/models/ps-recaptcha-pending-request.js +1 -0
- package/dist/esm/models/ps-remix-react-module.js +1 -0
- package/dist/esm/models/ps-voice-orb.js +1 -0
- package/dist/hooks/use-ps-exit-transition.js +0 -1
- package/dist/hooks/use-ps-navigation-progress.d.ts +2 -0
- package/dist/hooks/use-ps-navigation-progress.js +45 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +9 -0
- package/dist/models/ps-draggable-grid.d.ts +19 -0
- package/dist/models/ps-draggable-grid.js +2 -0
- package/dist/models/ps-navigation-progress.d.ts +5 -0
- package/dist/models/ps-navigation-progress.js +2 -0
- package/dist/models/ps-recaptcha-pending-request.d.ts +4 -0
- package/dist/models/ps-recaptcha-pending-request.js +2 -0
- package/dist/models/ps-remix-react-module.d.ts +3 -0
- package/dist/models/ps-remix-react-module.js +2 -0
- package/package.json +11 -3
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
2
|
+
let scriptLoadPromise = null;
|
|
3
|
+
const explicitRenderQuery = 'render=explicit';
|
|
4
|
+
const loadRecaptchaScript = (scriptUrl) => {
|
|
5
|
+
if (scriptLoadPromise)
|
|
6
|
+
return scriptLoadPromise;
|
|
7
|
+
const scriptSrc = `${scriptUrl}?${explicitRenderQuery}`;
|
|
8
|
+
scriptLoadPromise = new Promise((resolve, reject) => {
|
|
9
|
+
const existing = document.querySelector(`script[src="${scriptSrc}"]`);
|
|
10
|
+
if (existing) {
|
|
11
|
+
existing.addEventListener('load', () => resolve());
|
|
12
|
+
existing.addEventListener('error', () => reject(new Error('Failed to load reCAPTCHA')));
|
|
13
|
+
if (window.grecaptcha)
|
|
14
|
+
resolve();
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
const script = document.createElement('script');
|
|
18
|
+
script.src = scriptSrc;
|
|
19
|
+
script.async = true;
|
|
20
|
+
script.defer = true;
|
|
21
|
+
script.onload = () => resolve();
|
|
22
|
+
script.onerror = () => reject(new Error('Failed to load reCAPTCHA'));
|
|
23
|
+
document.head.appendChild(script);
|
|
24
|
+
});
|
|
25
|
+
return scriptLoadPromise;
|
|
26
|
+
};
|
|
27
|
+
export const usePsInvisibleRecaptcha = ({ siteKey, scriptUrl, badgePosition = 'bottomright', }) => {
|
|
28
|
+
const [isReady, setIsReady] = useState(false);
|
|
29
|
+
const widgetIdRef = useRef(null);
|
|
30
|
+
const containerRef = useRef(null);
|
|
31
|
+
const pendingRef = useRef(null);
|
|
32
|
+
useEffect(() => {
|
|
33
|
+
let isMounted = true;
|
|
34
|
+
const container = document.createElement('div');
|
|
35
|
+
container.style.display = 'none';
|
|
36
|
+
document.body.appendChild(container);
|
|
37
|
+
containerRef.current = container;
|
|
38
|
+
loadRecaptchaScript(scriptUrl)
|
|
39
|
+
.then(() => {
|
|
40
|
+
if (!isMounted || !window.grecaptcha)
|
|
41
|
+
return;
|
|
42
|
+
window.grecaptcha.ready(() => {
|
|
43
|
+
if (!isMounted || !window.grecaptcha || !containerRef.current)
|
|
44
|
+
return;
|
|
45
|
+
widgetIdRef.current = window.grecaptcha.render(containerRef.current, {
|
|
46
|
+
'sitekey': siteKey,
|
|
47
|
+
'size': 'invisible',
|
|
48
|
+
'badge': badgePosition,
|
|
49
|
+
'callback': (token) => {
|
|
50
|
+
pendingRef.current?.resolve(token);
|
|
51
|
+
pendingRef.current = null;
|
|
52
|
+
},
|
|
53
|
+
'expired-callback': () => {
|
|
54
|
+
pendingRef.current?.reject(new Error('reCAPTCHA expired'));
|
|
55
|
+
pendingRef.current = null;
|
|
56
|
+
},
|
|
57
|
+
'error-callback': () => {
|
|
58
|
+
pendingRef.current?.reject(new Error('reCAPTCHA verification failed'));
|
|
59
|
+
pendingRef.current = null;
|
|
60
|
+
},
|
|
61
|
+
});
|
|
62
|
+
setIsReady(true);
|
|
63
|
+
});
|
|
64
|
+
})
|
|
65
|
+
.catch(() => {
|
|
66
|
+
if (isMounted)
|
|
67
|
+
setIsReady(false);
|
|
68
|
+
});
|
|
69
|
+
return () => {
|
|
70
|
+
isMounted = false;
|
|
71
|
+
container.remove();
|
|
72
|
+
containerRef.current = null;
|
|
73
|
+
};
|
|
74
|
+
}, [siteKey, scriptUrl, badgePosition]);
|
|
75
|
+
const execute = useCallback(() => {
|
|
76
|
+
return new Promise((resolve, reject) => {
|
|
77
|
+
if (!window.grecaptcha || widgetIdRef.current === null) {
|
|
78
|
+
reject(new Error('reCAPTCHA is not ready yet'));
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
pendingRef.current = { resolve, reject };
|
|
82
|
+
window.grecaptcha.execute(widgetIdRef.current);
|
|
83
|
+
}).finally(() => {
|
|
84
|
+
if (window.grecaptcha && widgetIdRef.current !== null) {
|
|
85
|
+
window.grecaptcha.reset(widgetIdRef.current);
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
}, []);
|
|
89
|
+
return { execute, isReady };
|
|
90
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { useContext } from 'react';
|
|
2
|
+
import { PallasoftZIndexService } from '@pallasoft/ps-design-system';
|
|
3
|
+
import { PsLayerContext } from '../contexts/ps-layer-context';
|
|
4
|
+
export const usePsLayerZIndex = (layer) => PallasoftZIndexService.above(useContext(PsLayerContext), layer);
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { useEffect, useRef, useState } from 'react';
|
|
2
|
+
import { PsNavigationProgressConfig } from '../constants/ps-navigation-progress-config';
|
|
3
|
+
const hidden = { isAnimated: false, isVisible: false, width: 0 };
|
|
4
|
+
export const usePsNavigationProgress = (isLoading) => {
|
|
5
|
+
const [state, setState] = useState(hidden);
|
|
6
|
+
const timers = useRef([]);
|
|
7
|
+
useEffect(() => {
|
|
8
|
+
if (typeof window === 'undefined')
|
|
9
|
+
return;
|
|
10
|
+
const clear = () => {
|
|
11
|
+
timers.current.forEach((timer) => window.clearTimeout(timer));
|
|
12
|
+
timers.current.forEach((timer) => window.clearInterval(timer));
|
|
13
|
+
timers.current = [];
|
|
14
|
+
};
|
|
15
|
+
clear();
|
|
16
|
+
if (isLoading) {
|
|
17
|
+
setState({ isAnimated: false, isVisible: true, width: 0 });
|
|
18
|
+
timers.current.push(window.setTimeout(() => setState({
|
|
19
|
+
isAnimated: true,
|
|
20
|
+
isVisible: true,
|
|
21
|
+
width: PsNavigationProgressConfig.startWidth,
|
|
22
|
+
}), 0), window.setInterval(() => setState((current) => ({
|
|
23
|
+
...current,
|
|
24
|
+
width: current.width +
|
|
25
|
+
(PsNavigationProgressConfig.trickleMax - current.width) *
|
|
26
|
+
PsNavigationProgressConfig.trickleFactor,
|
|
27
|
+
})), PsNavigationProgressConfig.trickleMs));
|
|
28
|
+
return clear;
|
|
29
|
+
}
|
|
30
|
+
setState((current) => current.isVisible
|
|
31
|
+
? {
|
|
32
|
+
isAnimated: true,
|
|
33
|
+
isVisible: true,
|
|
34
|
+
width: PsNavigationProgressConfig.completeWidth,
|
|
35
|
+
}
|
|
36
|
+
: current);
|
|
37
|
+
timers.current.push(window.setTimeout(() => setState((current) => ({ ...current, isVisible: false })), PsNavigationProgressConfig.transitionMs), window.setTimeout(() => setState(hidden), PsNavigationProgressConfig.transitionMs + PsNavigationProgressConfig.fadeMs));
|
|
38
|
+
return clear;
|
|
39
|
+
}, [isLoading]);
|
|
40
|
+
return state;
|
|
41
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export const createPsRouteLoaderDataHook = (routeId) => {
|
|
2
|
+
let cache;
|
|
3
|
+
return () => {
|
|
4
|
+
const { useRouteLoaderData } = require('@remix-run/react');
|
|
5
|
+
const data = useRouteLoaderData(routeId);
|
|
6
|
+
if (data !== undefined)
|
|
7
|
+
cache = data;
|
|
8
|
+
if (cache === undefined)
|
|
9
|
+
throw new Error(`No loader data found for route "${routeId}"`);
|
|
10
|
+
return cache;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
import { PallasoftViewportService, PallasoftViewportTier } from '@pallasoft/ps-design-system';
|
|
3
|
+
export const usePsViewport = (defaultTier = PallasoftViewportTier.Desktop) => {
|
|
4
|
+
const [tier, setTier] = useState(defaultTier);
|
|
5
|
+
useEffect(() => {
|
|
6
|
+
const resolve = () => setTier(PallasoftViewportService.getTier(window.innerWidth));
|
|
7
|
+
resolve();
|
|
8
|
+
const tabletQuery = window.matchMedia(PallasoftViewportService.getTabletQuery());
|
|
9
|
+
const desktopQuery = window.matchMedia(PallasoftViewportService.getDesktopQuery());
|
|
10
|
+
tabletQuery.addEventListener('change', resolve);
|
|
11
|
+
desktopQuery.addEventListener('change', resolve);
|
|
12
|
+
return () => {
|
|
13
|
+
tabletQuery.removeEventListener('change', resolve);
|
|
14
|
+
desktopQuery.removeEventListener('change', resolve);
|
|
15
|
+
};
|
|
16
|
+
}, []);
|
|
17
|
+
return tier;
|
|
18
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export * from './components/ps-layer';
|
|
2
|
+
export * from './components/ps-accordion';
|
|
3
|
+
export * from './components/ps-action-tile';
|
|
4
|
+
export * from './components/ps-audio-spectrum';
|
|
5
|
+
export * from './components/ps-badge';
|
|
6
|
+
export * from './components/ps-button';
|
|
7
|
+
export * from './components/ps-card';
|
|
8
|
+
export * from './components/ps-draggable-grid';
|
|
9
|
+
export * from './components/ps-empty-state';
|
|
10
|
+
export * from './components/ps-fab';
|
|
11
|
+
export * from './components/ps-infinite-scroll';
|
|
12
|
+
export * from './components/ps-list-tile';
|
|
13
|
+
export * from './components/ps-metric-card';
|
|
14
|
+
export * from './components/ps-pill';
|
|
15
|
+
export * from './components/ps-portable-text';
|
|
16
|
+
export * from './components/ps-reflective-app-shell';
|
|
17
|
+
export * from './components/ps-navigation-progress';
|
|
18
|
+
export * from './components/ps-section-header';
|
|
19
|
+
export * from './components/ps-site-header';
|
|
20
|
+
export * from './components/ps-skeleton';
|
|
21
|
+
export * from './components/ps-skeleton-card';
|
|
22
|
+
export * from './components/ps-skeleton-group';
|
|
23
|
+
export * from './components/ps-skeleton-list';
|
|
24
|
+
export * from './components/ps-skeleton-table';
|
|
25
|
+
export * from './components/ps-skeleton-text';
|
|
26
|
+
export * from './components/ps-spinner';
|
|
27
|
+
export * from './components/ps-theme-toggle';
|
|
28
|
+
export * from './components/ps-voice-orb';
|
|
29
|
+
export * from './hooks/use-ps-audio-spectrum';
|
|
30
|
+
export * from './hooks/use-ps-exit-transition';
|
|
31
|
+
export * from './hooks/use-ps-hide-on-scroll';
|
|
32
|
+
export * from './hooks/use-ps-invisible-recaptcha';
|
|
33
|
+
export * from './contexts/ps-layer-context';
|
|
34
|
+
export * from './hooks/use-ps-layer-z-index';
|
|
35
|
+
export * from './hooks/use-ps-route-loader-data';
|
|
36
|
+
export * from './hooks/use-ps-viewport';
|
|
37
|
+
export * from './interfaces/ps-component-props';
|
|
38
|
+
export * from './models/ps-voice-orb';
|
|
39
|
+
export * from './models/ps-navigation-progress';
|
|
40
|
+
export * from './hooks/use-ps-navigation-progress';
|
|
41
|
+
export * from './models/ps-draggable-grid';
|
|
42
|
+
export * from './constants/ps-draggable-grid';
|
|
43
|
+
export * from './constants/ps-navigation-progress-config';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -26,7 +26,6 @@ const usePsExitTransition = (isOpen, durationMs = 180) => {
|
|
|
26
26
|
if (timeoutRef.current)
|
|
27
27
|
clearTimeout(timeoutRef.current);
|
|
28
28
|
};
|
|
29
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
30
29
|
}, [isOpen, durationMs]);
|
|
31
30
|
hasRenderedRef.current = shouldRender;
|
|
32
31
|
return { isClosing, shouldRender };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.usePsNavigationProgress = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const ps_navigation_progress_config_1 = require("../constants/ps-navigation-progress-config");
|
|
6
|
+
const hidden = { isAnimated: false, isVisible: false, width: 0 };
|
|
7
|
+
const usePsNavigationProgress = (isLoading) => {
|
|
8
|
+
const [state, setState] = (0, react_1.useState)(hidden);
|
|
9
|
+
const timers = (0, react_1.useRef)([]);
|
|
10
|
+
(0, react_1.useEffect)(() => {
|
|
11
|
+
if (typeof window === 'undefined')
|
|
12
|
+
return;
|
|
13
|
+
const clear = () => {
|
|
14
|
+
timers.current.forEach((timer) => window.clearTimeout(timer));
|
|
15
|
+
timers.current.forEach((timer) => window.clearInterval(timer));
|
|
16
|
+
timers.current = [];
|
|
17
|
+
};
|
|
18
|
+
clear();
|
|
19
|
+
if (isLoading) {
|
|
20
|
+
setState({ isAnimated: false, isVisible: true, width: 0 });
|
|
21
|
+
timers.current.push(window.setTimeout(() => setState({
|
|
22
|
+
isAnimated: true,
|
|
23
|
+
isVisible: true,
|
|
24
|
+
width: ps_navigation_progress_config_1.PsNavigationProgressConfig.startWidth,
|
|
25
|
+
}), 0), window.setInterval(() => setState((current) => ({
|
|
26
|
+
...current,
|
|
27
|
+
width: current.width +
|
|
28
|
+
(ps_navigation_progress_config_1.PsNavigationProgressConfig.trickleMax - current.width) *
|
|
29
|
+
ps_navigation_progress_config_1.PsNavigationProgressConfig.trickleFactor,
|
|
30
|
+
})), ps_navigation_progress_config_1.PsNavigationProgressConfig.trickleMs));
|
|
31
|
+
return clear;
|
|
32
|
+
}
|
|
33
|
+
setState((current) => current.isVisible
|
|
34
|
+
? {
|
|
35
|
+
isAnimated: true,
|
|
36
|
+
isVisible: true,
|
|
37
|
+
width: ps_navigation_progress_config_1.PsNavigationProgressConfig.completeWidth,
|
|
38
|
+
}
|
|
39
|
+
: current);
|
|
40
|
+
timers.current.push(window.setTimeout(() => setState((current) => ({ ...current, isVisible: false })), ps_navigation_progress_config_1.PsNavigationProgressConfig.transitionMs), window.setTimeout(() => setState(hidden), ps_navigation_progress_config_1.PsNavigationProgressConfig.transitionMs + ps_navigation_progress_config_1.PsNavigationProgressConfig.fadeMs));
|
|
41
|
+
return clear;
|
|
42
|
+
}, [isLoading]);
|
|
43
|
+
return state;
|
|
44
|
+
};
|
|
45
|
+
exports.usePsNavigationProgress = usePsNavigationProgress;
|
package/dist/index.d.ts
CHANGED
|
@@ -18,6 +18,11 @@ export * from './components/ps-navigation-progress';
|
|
|
18
18
|
export * from './components/ps-section-header';
|
|
19
19
|
export * from './components/ps-site-header';
|
|
20
20
|
export * from './components/ps-skeleton';
|
|
21
|
+
export * from './components/ps-skeleton-card';
|
|
22
|
+
export * from './components/ps-skeleton-group';
|
|
23
|
+
export * from './components/ps-skeleton-list';
|
|
24
|
+
export * from './components/ps-skeleton-table';
|
|
25
|
+
export * from './components/ps-skeleton-text';
|
|
21
26
|
export * from './components/ps-spinner';
|
|
22
27
|
export * from './components/ps-theme-toggle';
|
|
23
28
|
export * from './components/ps-voice-orb';
|
|
@@ -31,4 +36,8 @@ export * from './hooks/use-ps-route-loader-data';
|
|
|
31
36
|
export * from './hooks/use-ps-viewport';
|
|
32
37
|
export * from './interfaces/ps-component-props';
|
|
33
38
|
export * from './models/ps-voice-orb';
|
|
39
|
+
export * from './models/ps-navigation-progress';
|
|
40
|
+
export * from './hooks/use-ps-navigation-progress';
|
|
41
|
+
export * from './models/ps-draggable-grid';
|
|
42
|
+
export * from './constants/ps-draggable-grid';
|
|
34
43
|
export * from './constants/ps-navigation-progress-config';
|
package/dist/index.js
CHANGED
|
@@ -34,6 +34,11 @@ __exportStar(require("./components/ps-navigation-progress"), exports);
|
|
|
34
34
|
__exportStar(require("./components/ps-section-header"), exports);
|
|
35
35
|
__exportStar(require("./components/ps-site-header"), exports);
|
|
36
36
|
__exportStar(require("./components/ps-skeleton"), exports);
|
|
37
|
+
__exportStar(require("./components/ps-skeleton-card"), exports);
|
|
38
|
+
__exportStar(require("./components/ps-skeleton-group"), exports);
|
|
39
|
+
__exportStar(require("./components/ps-skeleton-list"), exports);
|
|
40
|
+
__exportStar(require("./components/ps-skeleton-table"), exports);
|
|
41
|
+
__exportStar(require("./components/ps-skeleton-text"), exports);
|
|
37
42
|
__exportStar(require("./components/ps-spinner"), exports);
|
|
38
43
|
__exportStar(require("./components/ps-theme-toggle"), exports);
|
|
39
44
|
__exportStar(require("./components/ps-voice-orb"), exports);
|
|
@@ -47,4 +52,8 @@ __exportStar(require("./hooks/use-ps-route-loader-data"), exports);
|
|
|
47
52
|
__exportStar(require("./hooks/use-ps-viewport"), exports);
|
|
48
53
|
__exportStar(require("./interfaces/ps-component-props"), exports);
|
|
49
54
|
__exportStar(require("./models/ps-voice-orb"), exports);
|
|
55
|
+
__exportStar(require("./models/ps-navigation-progress"), exports);
|
|
56
|
+
__exportStar(require("./hooks/use-ps-navigation-progress"), exports);
|
|
57
|
+
__exportStar(require("./models/ps-draggable-grid"), exports);
|
|
58
|
+
__exportStar(require("./constants/ps-draggable-grid"), exports);
|
|
50
59
|
__exportStar(require("./constants/ps-navigation-progress-config"), exports);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { JSX } from 'react';
|
|
2
|
+
export interface PsDraggableGridItem {
|
|
3
|
+
id: string;
|
|
4
|
+
label: string;
|
|
5
|
+
}
|
|
6
|
+
export interface PsDraggableGridRenderOptions<TItem extends PsDraggableGridItem> {
|
|
7
|
+
handle: JSX.Element;
|
|
8
|
+
index: number;
|
|
9
|
+
isDragging: boolean;
|
|
10
|
+
isOverlay: boolean;
|
|
11
|
+
item: TItem;
|
|
12
|
+
}
|
|
13
|
+
export interface PsDraggableGridProps<TItem extends PsDraggableGridItem> {
|
|
14
|
+
getItemClassName?: (item: TItem) => string;
|
|
15
|
+
items: TItem[];
|
|
16
|
+
onReorder: (items: TItem[]) => void;
|
|
17
|
+
onReorderEnd?: (items: TItem[]) => void;
|
|
18
|
+
renderItem: (options: PsDraggableGridRenderOptions<TItem>) => JSX.Element | null;
|
|
19
|
+
}
|
package/package.json
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pallasoft/ps-core-components",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.5.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
|
+
"module": "./dist/esm/index.js",
|
|
6
7
|
"types": "./dist/index.d.ts",
|
|
8
|
+
"sideEffects": false,
|
|
7
9
|
"exports": {
|
|
8
10
|
".": {
|
|
9
11
|
"types": "./dist/index.d.ts",
|
|
12
|
+
"module": "./dist/esm/index.js",
|
|
10
13
|
"require": "./dist/index.js",
|
|
11
14
|
"default": "./dist/index.js"
|
|
12
15
|
}
|
|
@@ -16,7 +19,7 @@
|
|
|
16
19
|
],
|
|
17
20
|
"scripts": {
|
|
18
21
|
"husky:prepare": "npx husky",
|
|
19
|
-
"build": "tsc",
|
|
22
|
+
"build": "tsc && tsc -p tsconfig.esm.json",
|
|
20
23
|
"setup:graphify": "sh scripts/graphify-setup.sh",
|
|
21
24
|
"update:graphify": "sh scripts/graphify-update.sh",
|
|
22
25
|
"lint": "npm run lint:eslint",
|
|
@@ -28,6 +31,9 @@
|
|
|
28
31
|
"release": "semantic-release"
|
|
29
32
|
},
|
|
30
33
|
"dependencies": {
|
|
34
|
+
"@dnd-kit/core": "^6.3.1",
|
|
35
|
+
"@dnd-kit/sortable": "^10.0.0",
|
|
36
|
+
"@dnd-kit/utilities": "^3.2.2",
|
|
31
37
|
"@pallasoft/ps-design-system": "^1.3.0",
|
|
32
38
|
"@pallasoft/ps-icons": "^1.1.0",
|
|
33
39
|
"@portabletext/react": "^3.2.4",
|
|
@@ -36,7 +42,8 @@
|
|
|
36
42
|
"react-infinite-scroll-component": "^6.1.1"
|
|
37
43
|
},
|
|
38
44
|
"peerDependencies": {
|
|
39
|
-
"react": "^18 || ^19"
|
|
45
|
+
"react": "^18 || ^19",
|
|
46
|
+
"react-dom": "^18 || ^19"
|
|
40
47
|
},
|
|
41
48
|
"devDependencies": {
|
|
42
49
|
"@commitlint/cli": "^20.1.0",
|
|
@@ -50,6 +57,7 @@
|
|
|
50
57
|
"@semantic-release/npm": "^12.0.0",
|
|
51
58
|
"@semantic-release/release-notes-generator": "^14.0.1",
|
|
52
59
|
"@types/react": "^18.3.28",
|
|
60
|
+
"@types/react-dom": "^18.3.7",
|
|
53
61
|
"@typescript-eslint/eslint-plugin": "^8.48.0",
|
|
54
62
|
"@typescript-eslint/parser": "^8.48.0",
|
|
55
63
|
"commitlint": "^20.1.0",
|