@shellui/core 0.2.0-beta.3 → 0.2.0-beta.5
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shellui/core",
|
|
3
|
-
"version": "0.2.0-beta.
|
|
3
|
+
"version": "0.2.0-beta.5",
|
|
4
4
|
"description": "ShellUI Core - Core React application runtime",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"type": "module",
|
|
@@ -36,29 +36,29 @@
|
|
|
36
36
|
"author": "ShellUI",
|
|
37
37
|
"license": "MIT",
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@radix-ui/react-collapsible": "^1.1.12",
|
|
40
|
-
"@sentry/react": "^8.0.0",
|
|
41
39
|
"@radix-ui/react-alert-dialog": "^1.1.15",
|
|
40
|
+
"@radix-ui/react-collapsible": "^1.1.12",
|
|
42
41
|
"@radix-ui/react-dialog": "^1.1.15",
|
|
43
42
|
"@radix-ui/react-separator": "^1.1.8",
|
|
44
43
|
"@radix-ui/react-slot": "^1.2.4",
|
|
45
|
-
"@radix-ui/react-tooltip": "^1.
|
|
44
|
+
"@radix-ui/react-tooltip": "^1.2.8",
|
|
45
|
+
"@sentry/react": "^10.39.0",
|
|
46
46
|
"class-variance-authority": "^0.7.1",
|
|
47
47
|
"clsx": "^2.1.1",
|
|
48
|
-
"i18next": "^
|
|
49
|
-
"react-i18next": "^
|
|
50
|
-
"react-router": "^7.
|
|
51
|
-
"roarr": "^7.21.
|
|
48
|
+
"i18next": "^25.8.11",
|
|
49
|
+
"react-i18next": "^16.5.4",
|
|
50
|
+
"react-router": "^7.13.0",
|
|
51
|
+
"roarr": "^7.21.4",
|
|
52
52
|
"sonner": "^2.0.7",
|
|
53
|
-
"tailwind-merge": "^3.
|
|
53
|
+
"tailwind-merge": "^3.5.0",
|
|
54
54
|
"vaul": "^1.1.2",
|
|
55
|
-
"workbox-
|
|
56
|
-
"workbox-
|
|
57
|
-
"workbox-
|
|
58
|
-
"workbox-
|
|
59
|
-
"workbox-
|
|
60
|
-
"workbox-
|
|
61
|
-
"@shellui/sdk": "0.2.0-beta.
|
|
55
|
+
"workbox-cacheable-response": "^7.4.0",
|
|
56
|
+
"workbox-expiration": "^7.4.0",
|
|
57
|
+
"workbox-precaching": "^7.4.0",
|
|
58
|
+
"workbox-routing": "^7.4.0",
|
|
59
|
+
"workbox-strategies": "^7.4.0",
|
|
60
|
+
"workbox-window": "^7.4.0",
|
|
61
|
+
"@shellui/sdk": "0.2.0-beta.5"
|
|
62
62
|
},
|
|
63
63
|
"peerDependencies": {
|
|
64
64
|
"react": "^18.0.0 || ^19.0.0",
|
|
@@ -69,12 +69,12 @@
|
|
|
69
69
|
},
|
|
70
70
|
"devDependencies": {
|
|
71
71
|
"@tailwindcss/typography": "^0.5.19",
|
|
72
|
-
"@types/react": "^19.2.
|
|
72
|
+
"@types/react": "^19.2.14",
|
|
73
73
|
"@types/react-dom": "^19.2.3",
|
|
74
|
-
"react": "^
|
|
75
|
-
"react-dom": "^
|
|
74
|
+
"react": "^19.2.4",
|
|
75
|
+
"react-dom": "^19.2.4",
|
|
76
76
|
"tailwindcss-animate": "^1.0.7",
|
|
77
|
-
"typescript": "^5.
|
|
77
|
+
"typescript": "^5.9.3"
|
|
78
78
|
},
|
|
79
79
|
"scripts": {
|
|
80
80
|
"test": "echo \"No tests specified for @shellui/core\""
|
|
@@ -142,6 +142,7 @@ const AlertDialogAction = forwardRef<
|
|
|
142
142
|
variant={variant}
|
|
143
143
|
size={size}
|
|
144
144
|
className={className}
|
|
145
|
+
onPointerDown={(e) => e.currentTarget.click()}
|
|
145
146
|
{...props}
|
|
146
147
|
/>
|
|
147
148
|
</AlertDialogPrimitive.Action>
|
|
@@ -159,6 +160,7 @@ const AlertDialogCancel = forwardRef<
|
|
|
159
160
|
variant={variant}
|
|
160
161
|
size={size}
|
|
161
162
|
className={className}
|
|
163
|
+
onPointerDown={(e) => e.currentTarget.click()}
|
|
162
164
|
{...props}
|
|
163
165
|
/>
|
|
164
166
|
</AlertDialogPrimitive.Cancel>
|
|
@@ -75,7 +75,10 @@ const DialogContent = forwardRef<ElementRef<typeof DialogPrimitive.Content>, Dia
|
|
|
75
75
|
>
|
|
76
76
|
{children}
|
|
77
77
|
{!hideCloseButton && (
|
|
78
|
-
<DialogPrimitive.Close
|
|
78
|
+
<DialogPrimitive.Close
|
|
79
|
+
onPointerDown={(e) => e.currentTarget.click()}
|
|
80
|
+
className="absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground cursor-pointer"
|
|
81
|
+
>
|
|
79
82
|
<svg
|
|
80
83
|
xmlns="http://www.w3.org/2000/svg"
|
|
81
84
|
width="24"
|
|
@@ -102,6 +102,7 @@ const DrawerContent = forwardRef<ComponentRef<typeof VaulDrawer.Content>, Drawer
|
|
|
102
102
|
<VaulDrawer.Close
|
|
103
103
|
className="absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground cursor-pointer"
|
|
104
104
|
aria-label="Close"
|
|
105
|
+
onPointerDown={(e) => e.currentTarget.click()}
|
|
105
106
|
>
|
|
106
107
|
<svg
|
|
107
108
|
xmlns="http://www.w3.org/2000/svg"
|
|
@@ -1,13 +1,58 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { useEffect, type ComponentProps } from 'react';
|
|
2
2
|
import { useSettings } from '../../features/settings/hooks/useSettings';
|
|
3
3
|
import { Toaster as Sonner } from 'sonner';
|
|
4
4
|
import { Z_INDEX } from '../../lib/z-index';
|
|
5
5
|
|
|
6
6
|
type ToasterProps = ComponentProps<typeof Sonner>;
|
|
7
7
|
|
|
8
|
+
const TOAST_BUTTON_SELECTOR = '[data-close-button], [data-cancel], [data-action]';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Ensures toast action, cancel, and close buttons respond to pointer/touch on iPad
|
|
12
|
+
* and Apple Pencil by triggering click on pointerdown when the browser doesn't
|
|
13
|
+
* fire a subsequent click (e.g. pen/touch).
|
|
14
|
+
*/
|
|
15
|
+
function useToastButtonPointerFix() {
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
const onPointerDown = (e: Event) => {
|
|
18
|
+
const ev = e as PointerEvent;
|
|
19
|
+
// Only trigger programmatic click for touch/pen (iPad etc.); mouse gets native click.
|
|
20
|
+
if (ev.pointerType !== 'touch' && ev.pointerType !== 'pen') return;
|
|
21
|
+
// When a modal is open (e.g. Radix), body has pointer-events: none so the toaster
|
|
22
|
+
// may never receive the event on iPad. Use document capture + elementFromPoint so we
|
|
23
|
+
// still detect touches over the toaster and trigger the button.
|
|
24
|
+
const toaster = document.querySelector('[data-sonner-toaster]');
|
|
25
|
+
if (!toaster) return;
|
|
26
|
+
const elementUnderPoint = document.elementFromPoint(ev.clientX, ev.clientY);
|
|
27
|
+
if (!elementUnderPoint?.isConnected) return;
|
|
28
|
+
const button = (elementUnderPoint as HTMLElement).closest?.(TOAST_BUTTON_SELECTOR);
|
|
29
|
+
if (!button || !toaster.contains(button) || button.getAttribute('data-disabled') === 'true')
|
|
30
|
+
return;
|
|
31
|
+
ev.preventDefault();
|
|
32
|
+
ev.stopImmediatePropagation();
|
|
33
|
+
const clickEvent = new MouseEvent('click', {
|
|
34
|
+
bubbles: true,
|
|
35
|
+
cancelable: true,
|
|
36
|
+
view: ev.view ?? window,
|
|
37
|
+
detail: 1,
|
|
38
|
+
clientX: ev.clientX,
|
|
39
|
+
clientY: ev.clientY,
|
|
40
|
+
screenX: ev.screenX,
|
|
41
|
+
screenY: ev.screenY,
|
|
42
|
+
});
|
|
43
|
+
button.dispatchEvent(clickEvent);
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
document.addEventListener('pointerdown', onPointerDown, true);
|
|
47
|
+
return () => document.removeEventListener('pointerdown', onPointerDown, true);
|
|
48
|
+
}, []);
|
|
49
|
+
}
|
|
50
|
+
|
|
8
51
|
const Toaster = ({ ...props }: ToasterProps) => {
|
|
9
52
|
const { settings } = useSettings();
|
|
10
53
|
|
|
54
|
+
useToastButtonPointerFix();
|
|
55
|
+
|
|
11
56
|
return (
|
|
12
57
|
<Sonner
|
|
13
58
|
position="top-center"
|
|
@@ -24,8 +69,11 @@ const Toaster = ({ ...props }: ToasterProps) => {
|
|
|
24
69
|
toast:
|
|
25
70
|
'group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg',
|
|
26
71
|
description: 'group-[.toast]:text-muted-foreground',
|
|
27
|
-
actionButton:
|
|
28
|
-
|
|
72
|
+
actionButton:
|
|
73
|
+
'group-[.toast]:bg-primary group-[.toast]:text-primary-foreground [touch-action:manipulation]',
|
|
74
|
+
cancelButton:
|
|
75
|
+
'group-[.toast]:bg-muted group-[.toast]:text-muted-foreground [touch-action:manipulation]',
|
|
76
|
+
closeButton: '[touch-action:manipulation]',
|
|
29
77
|
},
|
|
30
78
|
}}
|
|
31
79
|
{...props}
|
package/src/index.css
CHANGED
|
@@ -235,6 +235,12 @@
|
|
|
235
235
|
outline-color: hsl(var(--ring) / 0.5);
|
|
236
236
|
}
|
|
237
237
|
|
|
238
|
+
/* Toaster must receive pointer events when a modal has body pointer-events: none (e.g. Radix).
|
|
239
|
+
* Without this, pointerdown never fires on iPad when a modal is open. */
|
|
240
|
+
[data-sonner-toaster] {
|
|
241
|
+
pointer-events: auto !important;
|
|
242
|
+
}
|
|
243
|
+
|
|
238
244
|
/* Ensure Sonner toasts use theme variables - override Sonner defaults */
|
|
239
245
|
[data-sonner-toast] {
|
|
240
246
|
background-color: hsl(var(--background)) !important;
|