moi-computer 0.9.1-next.1 → 0.9.1-next.2
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/client/components/ui/button.tsx +1 -1
- package/client/features/home/WorkspacePreview.tsx +43 -30
- package/client/runtime/workspace-theme.ts +7 -0
- package/dist/{chunk-6wx91x8j.js → chunk-87q78504.js} +1 -1
- package/dist/chunk-ek6zde7t.js +10 -0
- package/dist/{chunk-cva7jpt4.js → chunk-n8tq2494.js} +38 -38
- package/dist/chunk-v82nefjq.css +1 -0
- package/dist/{chunk-a7fzp0z0.js → chunk-zcyvyebg.js} +1 -1
- package/dist/index.html +1 -1
- package/lib/themes.ts +4 -4
- package/package.json +1 -1
- package/server/session-config.ts +3 -13
- package/dist/chunk-5c19v3zr.js +0 -10
- package/dist/chunk-sapvd7he.css +0 -1
|
@@ -11,7 +11,7 @@ const buttonVariants = cva(
|
|
|
11
11
|
default:
|
|
12
12
|
'bg-primary text-primary-foreground inset-shadow-[0_0_8px_color-mix(in_oklab,var(--color-white)_20%,transparent)] hover:bg-primary/90 disabled:bg-accent disabled:text-muted-foreground disabled:opacity-100 disabled:shadow-none',
|
|
13
13
|
secondary:
|
|
14
|
-
'bg-accent text-foreground hover:bg-[color-mix(var(--accent),var(--foreground)_3%)] hover:text-accent-foreground',
|
|
14
|
+
'bg-accent text-foreground hover:bg-[color-mix(in_oklch,var(--accent),var(--foreground)_3%)] hover:text-accent-foreground',
|
|
15
15
|
outline: 'bg-background shadow-xs hover:text-accent-foreground hover:shadow-sm',
|
|
16
16
|
ghost: 'hover:bg-accent hover:text-accent-foreground',
|
|
17
17
|
destructive:
|
|
@@ -88,30 +88,36 @@ function useFolderRadiusScale() {
|
|
|
88
88
|
return { ref, horizontalRadiusScale }
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
-
// Bottom-to-top
|
|
92
|
-
//
|
|
93
|
-
const
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
'-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
91
|
+
// Bottom-to-top treatment for up to three applet thumbnails. The frame stays
|
|
92
|
+
// opaque while only the image fades.
|
|
93
|
+
const THUMBNAIL_STYLES = [
|
|
94
|
+
{
|
|
95
|
+
frame: cn(
|
|
96
|
+
'-translate-x-3 translate-y-3 -rotate-6',
|
|
97
|
+
'group-hover:translate-y-2 group-focus-visible:translate-y-2'
|
|
98
|
+
),
|
|
99
|
+
img: 'opacity-40'
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
frame: cn(
|
|
103
|
+
'translate-x-3 translate-y-2 rotate-5',
|
|
104
|
+
'group-hover:translate-y-1 group-focus-visible:translate-y-1'
|
|
105
|
+
),
|
|
106
|
+
img: 'opacity-50'
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
frame: cn(
|
|
110
|
+
'-translate-x-1 translate-y-1 -rotate-2',
|
|
111
|
+
'group-hover:-translate-y-2 group-focus-visible:-translate-y-2'
|
|
112
|
+
),
|
|
113
|
+
img: 'opacity-100'
|
|
114
|
+
}
|
|
115
|
+
] as const
|
|
110
116
|
|
|
111
117
|
export function WorkspacePreview({ workspaceId }: WorkspacePreviewProps) {
|
|
112
118
|
const query = useWorkspacePreview(workspaceId)
|
|
113
119
|
const thumbnails = query.data ? [...query.data.thumbnails].reverse() : []
|
|
114
|
-
const slots =
|
|
120
|
+
const slots = THUMBNAIL_STYLES.slice(THUMBNAIL_STYLES.length - thumbnails.length)
|
|
115
121
|
const firstUserMessage = query.data?.firstUserMessage
|
|
116
122
|
const theme = query.data?.theme
|
|
117
123
|
const { ref, horizontalRadiusScale } = useFolderRadiusScale()
|
|
@@ -156,17 +162,24 @@ export function WorkspacePreview({ workspaceId }: WorkspacePreviewProps) {
|
|
|
156
162
|
</svg>
|
|
157
163
|
|
|
158
164
|
{thumbnails.map((src, index) => (
|
|
159
|
-
<
|
|
160
|
-
key={
|
|
161
|
-
src={src}
|
|
162
|
-
alt=""
|
|
163
|
-
loading="lazy"
|
|
165
|
+
<div
|
|
166
|
+
key={src}
|
|
164
167
|
className={cn(
|
|
165
|
-
'absolute top-[12%] left-[14%]
|
|
166
|
-
'animate-in
|
|
167
|
-
slots[index]
|
|
168
|
+
'absolute top-[12%] left-[14%] w-fit max-w-[72%] overflow-hidden rounded-[calc(var(--radius-2xl)*0.4)] bg-background shadow-xs [corner-shape:superellipse(1.2)]',
|
|
169
|
+
'animate-in duration-300 ease-out fade-in',
|
|
170
|
+
slots[index].frame
|
|
168
171
|
)}
|
|
169
|
-
|
|
172
|
+
>
|
|
173
|
+
<img
|
|
174
|
+
src={src}
|
|
175
|
+
alt=""
|
|
176
|
+
loading="lazy"
|
|
177
|
+
className={cn(
|
|
178
|
+
'block h-auto max-h-32 w-auto max-w-full object-contain',
|
|
179
|
+
slots[index].img
|
|
180
|
+
)}
|
|
181
|
+
/>
|
|
182
|
+
</div>
|
|
170
183
|
))}
|
|
171
184
|
|
|
172
185
|
{thumbnails.length === 0 && firstUserMessage && (
|
|
@@ -177,7 +190,7 @@ export function WorkspacePreview({ workspaceId }: WorkspacePreviewProps) {
|
|
|
177
190
|
className={cn(
|
|
178
191
|
'w-max max-w-40 origin-center rounded-lg bg-card px-3 py-2 font-sans shadow-xs',
|
|
179
192
|
'animate-in transition-transform duration-300 ease-out fade-in',
|
|
180
|
-
|
|
193
|
+
'-translate-x-1 translate-y-1 -rotate-2',
|
|
181
194
|
'group-hover:translate-y-0.5 group-focus-visible:translate-y-0.5'
|
|
182
195
|
)}
|
|
183
196
|
>
|
|
@@ -94,6 +94,10 @@ export function usePreloadWorkspaceFonts() {
|
|
|
94
94
|
const link = document.createElement('link')
|
|
95
95
|
link.id = FONT_PREVIEW_LINK_ID
|
|
96
96
|
link.rel = 'stylesheet'
|
|
97
|
+
// CORS mode makes the sheet's cssRules readable, so thumbnail capture
|
|
98
|
+
// (modern-screenshot) can inline the @font-face rules into its SVG —
|
|
99
|
+
// an SVG rasterized in <img> can't use the page's webfonts otherwise.
|
|
100
|
+
link.crossOrigin = 'anonymous'
|
|
97
101
|
link.href = `https://fonts.googleapis.com/css2?family=${ALL_FONTS_QUERY}&display=swap`
|
|
98
102
|
document.head.appendChild(link)
|
|
99
103
|
|
|
@@ -145,6 +149,9 @@ export function useWorkspaceTheme(theme: WorkspaceLayout['theme']) {
|
|
|
145
149
|
const link = document.createElement('link')
|
|
146
150
|
link.id = FONT_LINK_ID
|
|
147
151
|
link.rel = 'stylesheet'
|
|
152
|
+
// Same CORS requirement as the preview link above: thumbnail capture
|
|
153
|
+
// can only embed @font-face rules from origin-clean stylesheets.
|
|
154
|
+
link.crossOrigin = 'anonymous'
|
|
148
155
|
link.href = url
|
|
149
156
|
document.head.appendChild(link)
|
|
150
157
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Vc as r}from"/chunk-zbeq02yc.js";if(typeof globalThis.structuredClone==="function")globalThis.structuredClone=globalThis.structuredClone.bind(globalThis);async function o(a){let[{mount:t}]=await Promise.all([import("/chunk-
|
|
1
|
+
import{Vc as r}from"/chunk-zbeq02yc.js";if(typeof globalThis.structuredClone==="function")globalThis.structuredClone=globalThis.structuredClone.bind(globalThis);async function o(a){let[{mount:t}]=await Promise.all([import("/chunk-n8tq2494.js"),import("/chunk-cagtq45k.js").then((e)=>e.loadAppConfig())]);t(a)}globalThis.__init=o;
|