@shellui/core 0.5.0-alpha.4 → 0.5.0-beta.1
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 +2 -2
- package/schemas/shellui.config.schema.json +33 -0
- package/src/components/ContentView.tsx +1 -1
- package/src/components/ui/alert-dialog.tsx +51 -34
- package/src/components/ui/drawer.tsx +57 -40
- package/src/components/ui/sidebar.tsx +11 -4
- package/src/components/ui/sonner.tsx +20 -2
- package/src/features/alertDialog/DialogContext.tsx +11 -5
- package/src/features/auth/components/AccessPendingView.tsx +1 -1
- package/src/features/auth/components/LoginButton.tsx +3 -3
- package/src/features/auth/components/LoginView.tsx +5 -4
- package/src/features/config/types.ts +31 -0
- package/src/features/layouts/LayoutFallback.tsx +1 -1
- package/src/features/layouts/OverlayShell.tsx +76 -44
- package/src/features/layouts/appbar/AppBarLayout.tsx +473 -291
- package/src/features/layouts/chrome/viewport.ts +66 -0
- package/src/features/layouts/fullscreen/FullscreenLayout.tsx +1 -1
- package/src/features/layouts/sidebar/SidebarInner.tsx +1 -1
- package/src/features/layouts/sidebar/SidebarLayout.tsx +110 -38
- package/src/features/layouts/windows/WindowsLayout.tsx +138 -42
- package/src/features/overlays/ResponsiveModal.tsx +36 -17
- package/src/features/overlays/overlaySize.spec.ts +27 -1
- package/src/features/overlays/overlaySize.ts +73 -18
- package/src/features/overlays/useOverlayReportedSize.ts +5 -4
- package/src/features/settings/SettingsView.tsx +9 -2
- package/src/features/settings/utils/buildSettingsForPropagation.spec.ts +26 -0
- package/src/features/settings/utils/buildSettingsForPropagation.ts +15 -0
- package/src/features/storage/uploads/UploadToastCard.tsx +1 -1
- package/src/features/storage/uploads/UploadToaster.tsx +6 -3
- package/src/features/theme/applyTheme.ts +20 -1
- package/src/i18n/translations/en/common.json +2 -1
- package/src/i18n/translations/fr/common.json +2 -1
- package/src/index.css +168 -12
- package/src/index.html +32 -3
- package/src/index.ts +1 -0
- package/src/routes/components/RouteErrorBoundary.tsx +1 -1
- package/src/routes/components/RouteFallback.tsx +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shellui/core",
|
|
3
|
-
"version": "0.5.0-
|
|
3
|
+
"version": "0.5.0-beta.1",
|
|
4
4
|
"description": "Shellui Core - Core React application runtime",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"type": "module",
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"workbox-routing": "^7.4.0",
|
|
72
72
|
"workbox-strategies": "^7.4.0",
|
|
73
73
|
"workbox-window": "^7.4.0",
|
|
74
|
-
"@shellui/sdk": "0.5.0-
|
|
74
|
+
"@shellui/sdk": "0.5.0-beta.1"
|
|
75
75
|
},
|
|
76
76
|
"peerDependencies": {
|
|
77
77
|
"react": "^18.0.0 || ^19.0.0",
|
|
@@ -69,6 +69,10 @@
|
|
|
69
69
|
"$ref": "#/definitions/StorageConfig",
|
|
70
70
|
"description": "Storage-service connection. Propagated to iframes via SDK settings. Enables Admin → Storage when `url` is set. Settings → Storage (quota) is shown when `url` is set unless `storage.showInSettings` is false."
|
|
71
71
|
},
|
|
72
|
+
"hosting": {
|
|
73
|
+
"$ref": "#/definitions/HostingConfig",
|
|
74
|
+
"description": "Hosting-service connection for `shellui deploy`. Propagated to iframes via SDK settings when `url` is set. Admin → Hosting appears when `url` is set unless `showInAdmin` is false."
|
|
75
|
+
},
|
|
72
76
|
"theme": {
|
|
73
77
|
"$ref": "#/definitions/ThemeRef",
|
|
74
78
|
"description": "Single theme: built-in name, path to a theme JSON/folder, or inline theme object. When set without `themes`, only this theme is available in the selector."
|
|
@@ -352,6 +356,35 @@
|
|
|
352
356
|
"additionalProperties": false,
|
|
353
357
|
"description": "Optional storage-service wiring for the shell and admin panel. When set, admin shows the Storage sidebar (files explorer, statistics, Django admin). Settings → Storage (quota) appears when `url` is set, unless `showInSettings` is false. Shellui will also use this for the SDK file API (`shellui.storage`)."
|
|
354
358
|
},
|
|
359
|
+
"HostingConfig": {
|
|
360
|
+
"type": "object",
|
|
361
|
+
"properties": {
|
|
362
|
+
"url": {
|
|
363
|
+
"type": "string",
|
|
364
|
+
"description": "Base URL of hosting-service (e.g. `http://localhost:8002`)."
|
|
365
|
+
},
|
|
366
|
+
"publicUrl": {
|
|
367
|
+
"type": "string",
|
|
368
|
+
"description": "Optional public base for browsable hosted app URLs when it differs from `url` (e.g. CDN or reverse proxy)."
|
|
369
|
+
},
|
|
370
|
+
"app": {
|
|
371
|
+
"type": "string",
|
|
372
|
+
"deprecated": true,
|
|
373
|
+
"description": "Deprecated. Use `slug` to redeploy to an existing preview site."
|
|
374
|
+
},
|
|
375
|
+
"slug": {
|
|
376
|
+
"type": "string",
|
|
377
|
+
"description": "Optional preview site slug. When set, redeploys to that slug (must belong to your company and user). When omitted, a new slug is created for each deploy."
|
|
378
|
+
},
|
|
379
|
+
"showInAdmin": {
|
|
380
|
+
"type": "boolean",
|
|
381
|
+
"description": "When false, hide Admin → Hosting even if `url` is set. Default: true when `url` is set. Does not affect `shellui deploy`."
|
|
382
|
+
}
|
|
383
|
+
},
|
|
384
|
+
"required": ["url"],
|
|
385
|
+
"additionalProperties": false,
|
|
386
|
+
"description": "Optional hosting-service wiring for `shellui deploy` preview uploads. Preview sites expire after 7 days unless redeployed. Admin shows Hosting when `url` is set, unless `showInAdmin` is false."
|
|
387
|
+
},
|
|
355
388
|
"ThemeRef": {
|
|
356
389
|
"anyOf": [
|
|
357
390
|
{
|
|
@@ -339,7 +339,7 @@ export const ContentView = ({
|
|
|
339
339
|
return (
|
|
340
340
|
<div
|
|
341
341
|
style={{ width: '100%', height: '100%', display: 'flex', position: 'relative' }}
|
|
342
|
-
className="bg-background"
|
|
342
|
+
className="min-h-0 flex-1 bg-background"
|
|
343
343
|
>
|
|
344
344
|
{/* Note: allow-same-origin is required for same-origin iframe content (e.g., Vite dev server, cookies, localStorage).
|
|
345
345
|
While this allows the iframe to remove its own sandboxing, it's acceptable here because the iframe content
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
type HTMLAttributes,
|
|
6
6
|
} from 'react';
|
|
7
7
|
import * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';
|
|
8
|
-
import { cva
|
|
8
|
+
import { cva } from 'class-variance-authority';
|
|
9
9
|
import { cn } from '../../lib/utils';
|
|
10
10
|
import { Z_INDEX } from '../../lib/z-index';
|
|
11
11
|
import { Button, type ButtonProps } from './button';
|
|
@@ -31,43 +31,60 @@ const AlertDialogOverlay = forwardRef<
|
|
|
31
31
|
AlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName;
|
|
32
32
|
|
|
33
33
|
const alertDialogContentVariants = cva(
|
|
34
|
-
'fixed
|
|
35
|
-
{
|
|
36
|
-
variants: {
|
|
37
|
-
size: {
|
|
38
|
-
default: 'max-w-lg',
|
|
39
|
-
sm: 'max-w-sm',
|
|
40
|
-
},
|
|
41
|
-
},
|
|
42
|
-
defaultVariants: {
|
|
43
|
-
size: 'default',
|
|
44
|
-
},
|
|
45
|
-
},
|
|
34
|
+
'fixed flex flex-col gap-4 border bg-background py-6 shadow-lg box-border overflow-hidden rounded-xl sm:rounded-lg',
|
|
46
35
|
);
|
|
47
36
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
37
|
+
const ALERT_DIALOG_MAX_WIDTH: Record<'default' | 'sm', string> = {
|
|
38
|
+
default:
|
|
39
|
+
'min(32rem, calc(100vw - 1.5rem - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)))',
|
|
40
|
+
sm: 'min(24rem, calc(100vw - 1.5rem - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)))',
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
interface AlertDialogContentProps extends ComponentPropsWithoutRef<
|
|
44
|
+
typeof AlertDialogPrimitive.Content
|
|
45
|
+
> {
|
|
46
|
+
size?: 'default' | 'sm' | null;
|
|
47
|
+
}
|
|
52
48
|
|
|
53
49
|
const AlertDialogContent = forwardRef<
|
|
54
50
|
ElementRef<typeof AlertDialogPrimitive.Content>,
|
|
55
51
|
AlertDialogContentProps
|
|
56
|
-
>(({ className, size = 'default', children, style, ...props }, ref) =>
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
<
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
52
|
+
>(({ className, size = 'default', children, style, ...props }, ref) => {
|
|
53
|
+
const resolvedSize: 'default' | 'sm' = size === 'sm' ? 'sm' : 'default';
|
|
54
|
+
return (
|
|
55
|
+
<AlertDialogPortal>
|
|
56
|
+
<AlertDialogOverlay />
|
|
57
|
+
<AlertDialogPrimitive.Content
|
|
58
|
+
ref={ref}
|
|
59
|
+
data-dialog-content
|
|
60
|
+
data-alert-dialog
|
|
61
|
+
className={cn(alertDialogContentVariants(), 'group', className)}
|
|
62
|
+
data-size={resolvedSize}
|
|
63
|
+
style={{
|
|
64
|
+
zIndex: Z_INDEX.ALERT_DIALOG_CONTENT,
|
|
65
|
+
// Exact center — inline beats utility/animation cascade fights
|
|
66
|
+
position: 'fixed',
|
|
67
|
+
top: '50%',
|
|
68
|
+
left: '50%',
|
|
69
|
+
right: 'auto',
|
|
70
|
+
bottom: 'auto',
|
|
71
|
+
transform: 'translate(-50%, -50%)',
|
|
72
|
+
// Content-sized height (never stretch to viewport)
|
|
73
|
+
height: 'auto',
|
|
74
|
+
maxHeight:
|
|
75
|
+
'calc(var(--shellui-app-height, 100dvh) - max(0.75rem, var(--shellui-safe-area-top)) - max(0.75rem, var(--shellui-safe-area-bottom)))',
|
|
76
|
+
width: ALERT_DIALOG_MAX_WIDTH[resolvedSize],
|
|
77
|
+
maxWidth: ALERT_DIALOG_MAX_WIDTH[resolvedSize],
|
|
78
|
+
margin: 0,
|
|
79
|
+
...style,
|
|
80
|
+
}}
|
|
81
|
+
{...props}
|
|
82
|
+
>
|
|
83
|
+
{children}
|
|
84
|
+
</AlertDialogPrimitive.Content>
|
|
85
|
+
</AlertDialogPortal>
|
|
86
|
+
);
|
|
87
|
+
});
|
|
71
88
|
AlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName;
|
|
72
89
|
|
|
73
90
|
const AlertDialogHeader = ({ className, ...props }: HTMLAttributes<HTMLDivElement>) => (
|
|
@@ -95,8 +112,8 @@ AlertDialogMedia.displayName = 'AlertDialogMedia';
|
|
|
95
112
|
const AlertDialogFooter = ({ className, ...props }: HTMLAttributes<HTMLDivElement>) => (
|
|
96
113
|
<div
|
|
97
114
|
className={cn(
|
|
98
|
-
'flex w-full min-w-full flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2',
|
|
99
|
-
'-mb-6 mt-2 border-t border-border bg-muted/50 px-6 py-3 sm:rounded-b-lg',
|
|
115
|
+
'flex w-full min-w-full flex-col-reverse max-sm:gap-2 sm:flex-row sm:justify-end sm:space-x-2',
|
|
116
|
+
'-mb-6 mt-2 border-t border-border bg-muted/50 px-6 py-3 rounded-b-xl sm:rounded-b-lg',
|
|
100
117
|
'[&_button]:h-8 [&_button]:text-xs [&_button]:px-3',
|
|
101
118
|
'group-data-[size=sm]:flex-row group-data-[size=sm]:gap-2',
|
|
102
119
|
'group-data-[size=sm]:[&>*:not(:only-child)]:min-w-0 group-data-[size=sm]:[&>*:not(:only-child)]:flex-1',
|
|
@@ -28,18 +28,25 @@ const Drawer = ({
|
|
|
28
28
|
onOpenChange,
|
|
29
29
|
direction = 'right',
|
|
30
30
|
dismissible = true,
|
|
31
|
+
handleOnly,
|
|
31
32
|
...props
|
|
32
33
|
}: ComponentProps<typeof VaulDrawer.Root> & {
|
|
33
34
|
direction?: DrawerDirection;
|
|
34
|
-
}) =>
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
35
|
+
}) => {
|
|
36
|
+
// Left/right: no Vaul drag handle on large screens — dismiss via × / backdrop / Escape.
|
|
37
|
+
// handleOnly avoids content-drag swipe fighting the iframe. Top/bottom keep swipe chrome.
|
|
38
|
+
const isSide = direction === 'left' || direction === 'right';
|
|
39
|
+
return (
|
|
40
|
+
<VaulDrawer.Root
|
|
41
|
+
open={open}
|
|
42
|
+
onOpenChange={onOpenChange}
|
|
43
|
+
direction={direction}
|
|
44
|
+
dismissible={dismissible}
|
|
45
|
+
handleOnly={handleOnly ?? isSide}
|
|
46
|
+
{...props}
|
|
47
|
+
/>
|
|
48
|
+
);
|
|
49
|
+
};
|
|
43
50
|
Drawer.displayName = 'Drawer';
|
|
44
51
|
|
|
45
52
|
const DrawerTrigger = VaulDrawer.Trigger;
|
|
@@ -76,11 +83,11 @@ DrawerOverlay.displayName = VaulDrawer.Overlay.displayName;
|
|
|
76
83
|
/** Base layout classes per direction — max dimension is applied via style so size prop can override. */
|
|
77
84
|
const drawerContentByDirection: Record<DrawerDirection, string> = {
|
|
78
85
|
bottom:
|
|
79
|
-
'fixed inset-x-0 bottom-0 mt-24 flex h-auto flex-col rounded-t-xl border border-border bg-background',
|
|
80
|
-
top: 'fixed inset-x-0 top-0 mb-24 flex h-auto flex-col rounded-b-xl border border-border bg-background',
|
|
81
|
-
left: 'fixed inset-y-0 left-0 mr-24 flex h-full w-auto flex-col rounded-r-xl border border-border bg-background',
|
|
86
|
+
'fixed inset-x-0 bottom-0 mt-24 flex h-auto flex-col rounded-t-xl border border-border bg-background pb-[var(--shellui-safe-area-bottom)]',
|
|
87
|
+
top: 'fixed inset-x-0 top-0 mb-24 flex h-auto flex-col rounded-b-xl border border-border bg-background pt-[var(--shellui-safe-area-top)]',
|
|
88
|
+
left: 'fixed inset-y-0 left-0 mr-24 flex h-full w-auto flex-col rounded-r-xl border border-border bg-background pl-[var(--shellui-safe-area-left)]',
|
|
82
89
|
right:
|
|
83
|
-
'fixed inset-y-0 right-0 ml-24 flex h-full w-auto flex-col rounded-l-xl border border-border bg-background',
|
|
90
|
+
'fixed inset-y-0 right-0 ml-24 flex h-full w-auto flex-col rounded-l-xl border border-border bg-background pr-[var(--shellui-safe-area-right)]',
|
|
84
91
|
};
|
|
85
92
|
|
|
86
93
|
/** Free-edge resize handle (opposite the anchored side). */
|
|
@@ -249,13 +256,15 @@ const DrawerContent = forwardRef<ComponentRef<typeof VaulDrawer.Content>, Drawer
|
|
|
249
256
|
}, []);
|
|
250
257
|
|
|
251
258
|
const effectiveSize =
|
|
252
|
-
overridePx !== null
|
|
259
|
+
overridePx !== null
|
|
260
|
+
? `${overridePx}px`
|
|
261
|
+
: size?.trim() || (isVertical ? 'calc(var(--shellui-overlay-max-height) * 0.8)' : '80vw');
|
|
253
262
|
const sizeStyle: CSSProperties =
|
|
254
263
|
overridePx !== null
|
|
255
264
|
? isVertical
|
|
256
265
|
? {
|
|
257
266
|
height: effectiveSize,
|
|
258
|
-
maxHeight: `min(${effectiveSize}, calc(
|
|
267
|
+
maxHeight: `min(${effectiveSize}, calc(var(--shellui-overlay-max-height) - ${VIEWPORT_MARGIN}px))`,
|
|
259
268
|
}
|
|
260
269
|
: {
|
|
261
270
|
width: effectiveSize,
|
|
@@ -263,17 +272,15 @@ const DrawerContent = forwardRef<ComponentRef<typeof VaulDrawer.Content>, Drawer
|
|
|
263
272
|
}
|
|
264
273
|
: size === null
|
|
265
274
|
? isVertical
|
|
266
|
-
? { maxHeight: '
|
|
275
|
+
? { maxHeight: 'var(--shellui-overlay-max-height)' }
|
|
267
276
|
: { maxWidth: 'min(90vw, 100%)' }
|
|
268
277
|
: isVertical
|
|
269
|
-
? {
|
|
278
|
+
? {
|
|
279
|
+
height: effectiveSize,
|
|
280
|
+
maxHeight: `min(${effectiveSize}, var(--shellui-overlay-max-height))`,
|
|
281
|
+
}
|
|
270
282
|
: { width: effectiveSize, maxWidth: `min(${effectiveSize}, 100%)` };
|
|
271
283
|
|
|
272
|
-
const sideHandleClass =
|
|
273
|
-
pos === 'left'
|
|
274
|
-
? 'absolute right-2 top-1/2 z-20 my-0 h-[100px] w-1.5 -translate-y-1/2 rounded-full'
|
|
275
|
-
: 'absolute left-2 top-1/2 z-20 my-0 h-[100px] w-1.5 -translate-y-1/2 rounded-full';
|
|
276
|
-
|
|
277
284
|
const resizeHandle = resizeHandleByDirection[pos];
|
|
278
285
|
|
|
279
286
|
return (
|
|
@@ -301,23 +308,25 @@ const DrawerContent = forwardRef<ComponentRef<typeof VaulDrawer.Content>, Drawer
|
|
|
301
308
|
{...props}
|
|
302
309
|
>
|
|
303
310
|
{children}
|
|
304
|
-
{
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
311
|
+
{/* Vaul drag handle only for top/bottom sheets — side panels use × / backdrop. */}
|
|
312
|
+
{showDragHandle && isVertical && (
|
|
313
|
+
<div
|
|
314
|
+
data-drawer-handle-overlay
|
|
315
|
+
className={cn(
|
|
316
|
+
'pointer-events-none absolute inset-x-0 z-20 flex justify-center',
|
|
317
|
+
pos === 'bottom' ? 'top-0 pt-1.5' : 'bottom-0 pb-1.5',
|
|
318
|
+
)}
|
|
319
|
+
>
|
|
320
|
+
{/*
|
|
321
|
+
Single visual pill — Vaul Handle already includes a 44px hitarea.
|
|
322
|
+
Do not add an after: bar (that stacked on Vaul's default #e2e2e4 chrome).
|
|
323
|
+
*/}
|
|
324
|
+
<DrawerHandle className="pointer-events-auto !mt-0" />
|
|
325
|
+
</div>
|
|
326
|
+
)}
|
|
318
327
|
{showCloseButton && (
|
|
319
328
|
<VaulDrawer.Close
|
|
320
|
-
className="absolute right-4 top-4 z-
|
|
329
|
+
className="absolute right-4 top-4 z-30 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"
|
|
321
330
|
aria-label="Close"
|
|
322
331
|
onPointerDown={(e) => e.currentTarget.click()}
|
|
323
332
|
>
|
|
@@ -378,7 +387,7 @@ DrawerHeader.displayName = 'DrawerHeader';
|
|
|
378
387
|
const DrawerFooter = ({ className, ...props }: HTMLAttributes<HTMLDivElement>) => (
|
|
379
388
|
<div
|
|
380
389
|
className={cn(
|
|
381
|
-
'mt-auto flex flex-col-reverse gap-2 border-t border-border px-6
|
|
390
|
+
'mt-auto flex flex-col-reverse gap-2 border-t border-border px-6 pt-4 pb-[max(1rem,var(--shellui-safe-area-bottom))] sm:flex-row sm:justify-end',
|
|
382
391
|
className,
|
|
383
392
|
)}
|
|
384
393
|
{...props}
|
|
@@ -414,14 +423,22 @@ DrawerDescription.displayName = VaulDrawer.Description.displayName;
|
|
|
414
423
|
const DrawerHandle = forwardRef<
|
|
415
424
|
ComponentRef<typeof VaulDrawer.Handle>,
|
|
416
425
|
ComponentPropsWithoutRef<typeof VaulDrawer.Handle>
|
|
417
|
-
>(({ className, ...props }, ref) => (
|
|
426
|
+
>(({ className, style, ...props }, ref) => (
|
|
418
427
|
<VaulDrawer.Handle
|
|
419
428
|
ref={ref}
|
|
420
429
|
data-drawer-handle
|
|
421
430
|
className={cn(
|
|
422
|
-
'
|
|
431
|
+
// !important overrides Vaul's injected `background: #e2e2e4` + 5px height
|
|
432
|
+
'mx-auto mt-1.5 h-[3px] w-8 shrink-0 rounded-full !bg-muted-foreground/70 !opacity-100',
|
|
423
433
|
className,
|
|
424
434
|
)}
|
|
435
|
+
style={{
|
|
436
|
+
// Inline wins over Vaul stylesheet `background` / size when utilities lose the race
|
|
437
|
+
background: 'color-mix(in oklch, var(--muted-foreground) 70%, transparent)',
|
|
438
|
+
height: '3px',
|
|
439
|
+
borderRadius: '9999px',
|
|
440
|
+
...style,
|
|
441
|
+
}}
|
|
425
442
|
{...props}
|
|
426
443
|
/>
|
|
427
444
|
));
|
|
@@ -234,7 +234,9 @@ function SidebarProvider({
|
|
|
234
234
|
} as React.CSSProperties
|
|
235
235
|
}
|
|
236
236
|
className={cn(
|
|
237
|
-
|
|
237
|
+
// #root owns the screen height (see index.html); fill it rather than
|
|
238
|
+
// re-deriving it from a viewport unit.
|
|
239
|
+
'group/sidebar-wrapper flex h-full min-h-0 w-full has-data-[variant=inset]:bg-sidebar',
|
|
238
240
|
className,
|
|
239
241
|
)}
|
|
240
242
|
{...props}
|
|
@@ -306,7 +308,9 @@ function Sidebar({
|
|
|
306
308
|
<SheetTitle>Sidebar</SheetTitle>
|
|
307
309
|
<SheetDescription>Displays the mobile sidebar.</SheetDescription>
|
|
308
310
|
</SheetHeader>
|
|
309
|
-
<div className="flex h-full w-full flex-col">
|
|
311
|
+
<div className="flex h-full min-h-0 w-full flex-col overflow-hidden pt-[var(--shellui-safe-area-top)] pr-[var(--shellui-safe-area-right)] pl-[var(--shellui-safe-area-left)]">
|
|
312
|
+
{children}
|
|
313
|
+
</div>
|
|
310
314
|
</SheetContent>
|
|
311
315
|
</Sheet>
|
|
312
316
|
);
|
|
@@ -336,7 +340,7 @@ function Sidebar({
|
|
|
336
340
|
<div
|
|
337
341
|
data-slot="sidebar-container"
|
|
338
342
|
className={cn(
|
|
339
|
-
'fixed inset-y-0 z-10 hidden h-
|
|
343
|
+
'fixed inset-y-0 z-10 hidden h-[var(--shellui-app-height,100dvh)] w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear group-data-[resizing]/sidebar-wrapper:transition-none md:flex',
|
|
340
344
|
side === 'left'
|
|
341
345
|
? 'left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]'
|
|
342
346
|
: 'right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]',
|
|
@@ -528,7 +532,10 @@ function SidebarFooter({ className, ...props }: React.ComponentProps<'div'>) {
|
|
|
528
532
|
<div
|
|
529
533
|
data-slot="sidebar-footer"
|
|
530
534
|
data-sidebar="footer"
|
|
531
|
-
className={cn(
|
|
535
|
+
className={cn(
|
|
536
|
+
'flex flex-col gap-2 p-2 pb-[max(0.5rem,var(--shellui-safe-area-bottom))]',
|
|
537
|
+
className,
|
|
538
|
+
)}
|
|
532
539
|
{...props}
|
|
533
540
|
/>
|
|
534
541
|
);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { useEffect, type ComponentProps } from 'react';
|
|
2
|
+
import { createPortal } from 'react-dom';
|
|
2
3
|
import { useSettings } from '../../features/settings/hooks/useSettings';
|
|
3
4
|
import { Toaster as Sonner } from 'sonner';
|
|
4
5
|
import { Z_INDEX } from '../../lib/z-index';
|
|
@@ -57,7 +58,9 @@ const Toaster = ({ ...props }: ToasterProps) => {
|
|
|
57
58
|
|
|
58
59
|
useToastButtonPointerFix();
|
|
59
60
|
|
|
60
|
-
|
|
61
|
+
// Portal to body so z-index competes with Radix/Vaul overlays (also on body).
|
|
62
|
+
// Inside #root (position:fixed) the toaster is trapped below portaled modals/drawers.
|
|
63
|
+
return createPortal(
|
|
61
64
|
<Sonner
|
|
62
65
|
position="top-center"
|
|
63
66
|
theme={settings.appearance.colorScheme as 'light' | 'dark' | 'system'}
|
|
@@ -67,6 +70,20 @@ const Toaster = ({ ...props }: ToasterProps) => {
|
|
|
67
70
|
// Re-enable pointer events so toasts stay clickable when a Radix modal is open
|
|
68
71
|
// (Radix sets body.style.pointerEvents = 'none' and only the dialog content gets 'auto')
|
|
69
72
|
pointerEvents: 'auto',
|
|
73
|
+
// Clear the safe-area topbar / notch, then keep a 1rem gap below it
|
|
74
|
+
top: 'calc(var(--shellui-safe-area-top, env(safe-area-inset-top, 0px)) + 1rem)',
|
|
75
|
+
}}
|
|
76
|
+
offset={{
|
|
77
|
+
top: 'calc(var(--shellui-safe-area-top, env(safe-area-inset-top, 0px)) + 1rem)',
|
|
78
|
+
bottom: 'max(1rem, var(--shellui-safe-area-bottom, env(safe-area-inset-bottom, 0px)))',
|
|
79
|
+
left: 'max(1rem, var(--shellui-safe-area-left, env(safe-area-inset-left, 0px)))',
|
|
80
|
+
right: 'max(1rem, var(--shellui-safe-area-right, env(safe-area-inset-right, 0px)))',
|
|
81
|
+
}}
|
|
82
|
+
mobileOffset={{
|
|
83
|
+
top: 'calc(var(--shellui-safe-area-top, env(safe-area-inset-top, 0px)) + 1rem)',
|
|
84
|
+
bottom: 'max(1rem, var(--shellui-safe-area-bottom, env(safe-area-inset-bottom, 0px)))',
|
|
85
|
+
left: 'max(1rem, var(--shellui-safe-area-left, env(safe-area-inset-left, 0px)))',
|
|
86
|
+
right: 'max(1rem, var(--shellui-safe-area-right, env(safe-area-inset-right, 0px)))',
|
|
70
87
|
}}
|
|
71
88
|
toastOptions={{
|
|
72
89
|
classNames: {
|
|
@@ -81,7 +98,8 @@ const Toaster = ({ ...props }: ToasterProps) => {
|
|
|
81
98
|
},
|
|
82
99
|
}}
|
|
83
100
|
{...props}
|
|
84
|
-
|
|
101
|
+
/>,
|
|
102
|
+
document.body,
|
|
85
103
|
);
|
|
86
104
|
};
|
|
87
105
|
|
|
@@ -391,15 +391,21 @@ export const DialogProvider = ({ children }: DialogProviderProps) => {
|
|
|
391
391
|
<AlertDialogPortal>
|
|
392
392
|
<AlertDialogOverlay style={{ zIndex: Z_INDEX.COOKIE_CONSENT_OVERLAY }} />
|
|
393
393
|
<AlertDialogPrimitive.Content
|
|
394
|
-
className="fixed w-[calc(100%-
|
|
394
|
+
className="fixed w-[calc(100%-2rem)] max-w-[520px] rounded-xl border border-border bg-background text-foreground shadow-lg sm:w-full"
|
|
395
395
|
style={{
|
|
396
|
-
|
|
397
|
-
|
|
396
|
+
// Inset from edges + iOS safe-area (home indicator / notch / landscape)
|
|
397
|
+
bottom: 'max(1rem, env(safe-area-inset-bottom, 0px))',
|
|
398
|
+
left: 'max(1rem, env(safe-area-inset-left, 0px))',
|
|
399
|
+
right: 'max(1rem, env(safe-area-inset-right, 0px))',
|
|
400
|
+
top: 'auto',
|
|
401
|
+
maxHeight:
|
|
402
|
+
'calc(var(--shellui-app-height, 100dvh) - max(1rem, var(--shellui-safe-area-top)) - max(1rem, var(--shellui-safe-area-bottom)))',
|
|
398
403
|
zIndex: Z_INDEX.COOKIE_CONSENT_CONTENT,
|
|
399
404
|
backgroundColor: 'var(--background)',
|
|
400
|
-
top: 'auto',
|
|
401
|
-
right: 'auto',
|
|
402
405
|
transform: 'none',
|
|
406
|
+
width:
|
|
407
|
+
'min(520px, calc(100% - max(1rem, env(safe-area-inset-left, 0px)) - max(1rem, env(safe-area-inset-right, 0px))))',
|
|
408
|
+
marginRight: 'auto',
|
|
403
409
|
}}
|
|
404
410
|
data-dialog-content
|
|
405
411
|
data-cookie-consent
|
|
@@ -40,7 +40,7 @@ export const AccessPendingView = ({ message, code, onBackToLogin }: Props) => {
|
|
|
40
40
|
!detailLower.includes('email domain is not authorized');
|
|
41
41
|
|
|
42
42
|
return (
|
|
43
|
-
<main className="flex min-h-full items-center justify-center bg-background
|
|
43
|
+
<main className="shellui-safe-pad flex min-h-full items-center justify-center bg-background [--shellui-safe-pad-y:3rem]">
|
|
44
44
|
<div className="w-full max-w-xl animate-in fade-in-0 slide-in-from-bottom-3 duration-500">
|
|
45
45
|
<section
|
|
46
46
|
className="border border-border bg-card"
|
|
@@ -90,11 +90,11 @@ const variantConfig: Record<
|
|
|
90
90
|
appbar: {
|
|
91
91
|
button: {
|
|
92
92
|
authenticated:
|
|
93
|
-
'size-
|
|
93
|
+
'size-9 rounded-md p-0 justify-center text-sm text-muted-foreground hover:bg-sidebar-accent/50 hover:text-sidebar-foreground',
|
|
94
94
|
loggedOut:
|
|
95
|
-
'h-
|
|
95
|
+
'h-9 max-w-[220px] rounded-md px-3 text-sm text-muted-foreground hover:bg-sidebar-accent/50 hover:text-sidebar-foreground',
|
|
96
96
|
},
|
|
97
|
-
avatar: 'size-
|
|
97
|
+
avatar: 'size-5',
|
|
98
98
|
menu: { width: 'w-[min(16rem,calc(100vw-1.5rem))]', side: 'bottom', align: 'end' },
|
|
99
99
|
showDisplayName: false,
|
|
100
100
|
showCaret: false,
|
|
@@ -435,10 +435,10 @@ export const LoginView = () => {
|
|
|
435
435
|
<iframe
|
|
436
436
|
src={panelUrl}
|
|
437
437
|
title={t('loginPage.brandingIframeTitle')}
|
|
438
|
-
className="h-full
|
|
438
|
+
className="h-full w-full border-0"
|
|
439
439
|
/>
|
|
440
440
|
) : panelImage ? (
|
|
441
|
-
<div className="flex h-full
|
|
441
|
+
<div className="flex h-full w-full items-center justify-center overflow-hidden">
|
|
442
442
|
<img
|
|
443
443
|
src={panelImage}
|
|
444
444
|
alt=""
|
|
@@ -446,7 +446,7 @@ export const LoginView = () => {
|
|
|
446
446
|
/>
|
|
447
447
|
</div>
|
|
448
448
|
) : (
|
|
449
|
-
<div className="flex h-full
|
|
449
|
+
<div className="flex h-full w-full items-start justify-start p-6">
|
|
450
450
|
<AppBrandIcon
|
|
451
451
|
appIcon={config.appIcon}
|
|
452
452
|
title={config.title}
|
|
@@ -459,7 +459,8 @@ export const LoginView = () => {
|
|
|
459
459
|
|
|
460
460
|
<section
|
|
461
461
|
className={cn(
|
|
462
|
-
'relative flex min-h-
|
|
462
|
+
'relative flex min-h-full w-full flex-col',
|
|
463
|
+
isIframeView ? 'px-6 py-6' : 'shellui-safe-pad md:[--shellui-safe-pad-y:2.5rem]',
|
|
463
464
|
!isIframeView && 'md:w-1/2',
|
|
464
465
|
)}
|
|
465
466
|
>
|
|
@@ -187,6 +187,32 @@ export interface StorageConfig {
|
|
|
187
187
|
showInSettings?: boolean;
|
|
188
188
|
}
|
|
189
189
|
|
|
190
|
+
/**
|
|
191
|
+
* Optional hosting-service wiring for `shellui deploy` preview uploads.
|
|
192
|
+
* Preview sites expire after 7 days unless redeployed to the same slug.
|
|
193
|
+
*/
|
|
194
|
+
export interface HostingConfig {
|
|
195
|
+
/** Base URL of hosting-service (e.g. `http://localhost:8002`). */
|
|
196
|
+
url: string;
|
|
197
|
+
/**
|
|
198
|
+
* Optional public base for browsable app URLs when different from `url`
|
|
199
|
+
* (e.g. CDN or path-style gateway). The deploy API returns `urls` when possible.
|
|
200
|
+
*/
|
|
201
|
+
publicUrl?: string;
|
|
202
|
+
/**
|
|
203
|
+
* Optional preview site slug. When set, `shellui deploy` redeploys to this slug
|
|
204
|
+
* (must belong to your company and user). When omitted, each deploy gets a new slug.
|
|
205
|
+
*/
|
|
206
|
+
slug?: string;
|
|
207
|
+
/** @deprecated Use `slug` instead. */
|
|
208
|
+
app?: string;
|
|
209
|
+
/**
|
|
210
|
+
* When false, hide Admin → Hosting even if `url` is set.
|
|
211
|
+
* Default: true when `url` is set. Does not affect `shellui deploy`.
|
|
212
|
+
*/
|
|
213
|
+
showInAdmin?: boolean;
|
|
214
|
+
}
|
|
215
|
+
|
|
190
216
|
/**
|
|
191
217
|
* Custom navigation section for the staff administration panel.
|
|
192
218
|
* Admin app URL remains `backend.adminUrl` / `backend.adminPathname`.
|
|
@@ -248,6 +274,11 @@ export interface ShellUIConfig {
|
|
|
248
274
|
* when `url` is set unless `storage.showInSettings` is false.
|
|
249
275
|
*/
|
|
250
276
|
storage?: StorageConfig;
|
|
277
|
+
/**
|
|
278
|
+
* Hosting-service connection. Propagated to iframes via SDK settings.
|
|
279
|
+
* Enables `shellui deploy` when `url` is set.
|
|
280
|
+
*/
|
|
281
|
+
hosting?: HostingConfig;
|
|
251
282
|
/**
|
|
252
283
|
* Single theme: built-in name, path to a theme JSON/folder, or inline theme object.
|
|
253
284
|
* When set without `themes`, only this theme is available in the selector.
|