moi-computer 0.7.0 → 0.8.1-next.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/README.md +2 -2
- package/client/api/workspace-keys.ts +1 -2
- package/client/app/AppRouter.tsx +10 -3
- package/client/app/routes/HomeRoute.tsx +1 -1
- package/client/app/shell/SidebarLayout.tsx +2 -14
- package/client/components/shared/BottomPanel.tsx +2 -1
- package/client/components/shared/Composer.tsx +20 -7
- package/client/components/shared/PanelHeader.tsx +8 -1
- package/client/components/ui/button.tsx +3 -3
- package/client/components/ui/dialog.tsx +1 -1
- package/client/components/ui/dropdown-menu.tsx +2 -2
- package/client/components/ui/hover-card.tsx +1 -1
- package/client/components/ui/popover.tsx +1 -1
- package/client/components/ui/resizable.tsx +40 -0
- package/client/features/applets/AppletMount.tsx +9 -22
- package/client/features/applets/applet-cache.ts +7 -0
- package/client/features/applets/applet-styles.ts +21 -1
- package/client/features/applets/useApplet.ts +1 -1
- package/client/features/chat/ChatEmptyState.tsx +9 -11
- package/client/features/chat/ChatPanel.tsx +76 -48
- package/client/features/chat/ChatPopup.tsx +16 -2
- package/client/features/chat/ChatPromptBubbles.tsx +6 -8
- package/client/features/chat/ChatSelector.tsx +25 -8
- package/client/features/chat/ModelPicker.tsx +5 -4
- package/client/features/chat/TurnView.tsx +108 -13
- package/client/features/chat/api.ts +1 -18
- package/client/features/chat/chat-send.ts +2 -2
- package/client/features/chat/{ChatComposer.tsx → composer/ChatComposer.tsx} +24 -9
- package/client/features/chat/composer/banners/ChatErrorBanner.tsx +28 -0
- package/client/features/chat/composer/banners/ComposerBanner.tsx +30 -0
- package/client/features/chat/composer/banners/WorkspaceAgentAvailabilityBanner.tsx +91 -0
- package/client/features/{workspace → chat/composer/banners}/WorkspaceSkillUpdateBanner.tsx +9 -7
- package/client/features/chat/composer/useWorkspaceComposerState.tsx +74 -0
- package/client/features/{workspace → chat/composer}/useWorkspaceSkillUpdates.ts +1 -1
- package/client/features/chat/group-turns.ts +46 -28
- package/client/features/chat/interleave-notices.ts +84 -0
- package/client/features/chat/model-order.ts +9 -3
- package/client/features/chat/tool-group/TimelineRow.tsx +23 -11
- package/client/features/chat/tool-group/ToolCallGroup.tsx +38 -3
- package/client/features/chat/tool-group/format.ts +23 -7
- package/client/features/chat/useAppletChatMessage.ts +11 -16
- package/client/features/chat/useChat.ts +3 -7
- package/client/features/dev/ChatStatesPage.tsx +428 -0
- package/client/features/dev/DevIndexPage.tsx +52 -0
- package/client/features/dev/DevRoutes.tsx +6 -3
- package/client/features/dev/HarnessDebugPage.tsx +3 -3
- package/client/features/dev/chat-states-fixtures.ts +744 -0
- package/client/features/home/api.ts +0 -10
- package/client/features/home/workspace-setup/CreateWorkspaceDialog.tsx +21 -64
- package/client/features/home/workspace-setup/ImportWorkspaceDialog.tsx +1 -1
- package/client/features/scratchpad/Scratchpad.tsx +5 -3
- package/client/features/scratchpad/scratch-session.ts +71 -0
- package/client/features/views/ViewBuilderTab.tsx +5 -4
- package/client/features/views/ViewManager.tsx +258 -0
- package/client/features/views/useViewBuilderActions.ts +2 -2
- package/client/features/views/view-residency.ts +77 -0
- package/client/features/widgets/WidgetFrame.tsx +6 -2
- package/client/features/workspace/CustomizePanel.tsx +40 -24
- package/client/features/workspace/WorkspaceLayoutContext.tsx +12 -2
- package/client/features/workspace/WorkspaceScreen.tsx +131 -201
- package/client/features/workspace/WorkspaceSplitLayout.tsx +111 -0
- package/client/features/workspace/WorkspaceTabs.tsx +1 -1
- package/client/features/workspace/api.ts +33 -8
- package/client/features/workspace/useFitsSplitLayout.ts +31 -5
- package/client/index.css +5 -2
- package/client/lib/flags.ts +4 -3
- package/client/runtime/useWorkspaceEvents.ts +18 -1
- package/client/runtime/workspace-theme.ts +29 -10
- package/client/store/ui.ts +5 -1
- package/client/theme.css +96 -6
- package/dist/{chunk-0pcdwjkp.js → chunk-2vaafjp4.js} +1 -1
- package/dist/{chunk-9y2zbzqz.js → chunk-35fq49qa.js} +1 -1
- package/dist/chunk-gny990qx.css +1 -0
- package/dist/chunk-gt7n06ef.js +1 -0
- package/dist/{chunk-rxvx4ta9.js → chunk-kkj86722.js} +75 -75
- package/dist/chunk-n7pga5x3.js +80 -0
- package/dist/chunk-xeyxk7ep.js +10 -0
- package/dist/{chunk-w3tnv51j.js → chunk-xzx7c9hq.js} +1 -1
- package/dist/index.html +1 -1
- package/lib/format.ts +17 -1
- package/lib/themes.ts +123 -51
- package/lib/types.ts +40 -13
- package/lib/workspace-layout.ts +2 -2
- package/package.json +6 -4
- package/server/agent.ts +199 -0
- package/server/api.ts +38 -90
- package/server/bundler/build-applet.ts +7 -4
- package/server/cli.ts +46 -15
- package/server/control.ts +13 -6
- package/server/env-apply.ts +4 -0
- package/server/harness/README.md +28 -12
- package/server/harness/claude-code/auth.ts +54 -0
- package/server/harness/claude-code/index.ts +6 -1
- package/server/harness/codex/adapter.ts +9 -1
- package/server/harness/codex/auth.ts +50 -0
- package/server/harness/codex/index.ts +6 -1
- package/server/harness/codex/session.ts +33 -14
- package/server/harness/openclaw/NOTES.md +518 -187
- package/server/harness/openclaw/adapter.ts +125 -31
- package/server/harness/openclaw/compat.ts +99 -0
- package/server/harness/openclaw/cron-view.ts +78 -0
- package/server/harness/openclaw/discovery.ts +145 -52
- package/server/harness/openclaw/gateway.ts +224 -36
- package/server/harness/openclaw/index.ts +56 -21
- package/server/harness/openclaw/session.ts +971 -55
- package/server/harness/openclaw/strip.ts +87 -15
- package/server/harness/openclaw/thinking.ts +198 -0
- package/server/harness/types.ts +10 -5
- package/server/layout.ts +5 -2
- package/server/moi-scaffold.ts +1 -1
- package/server/registry.ts +0 -20
- package/server/theme.ts +24 -27
- package/workspace/.claude/skills/moi-workspace/DESIGN.md +100 -53
- package/workspace/.claude/skills/moi-workspace/SKILL.md +10 -12
- package/client/features/dev/PixelPainter.tsx +0 -94
- package/client/features/dev/PlaygroundPage.tsx +0 -69
- package/dist/chunk-175bm057.js +0 -27
- package/dist/chunk-55sh4dty.js +0 -2
- package/dist/chunk-afgbg75t.js +0 -50
- package/dist/chunk-agtetn7n.css +0 -1
- package/dist/chunk-dfs36zgc.js +0 -1
- package/dist/chunk-exj6hr30.js +0 -9
- package/dist/chunk-m11ckkxd.js +0 -51
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
import { useLayoutEffect, useRef, useState } from 'react'
|
|
2
2
|
|
|
3
|
+
export type WorkspaceSplitLayoutConstraints = {
|
|
4
|
+
workspaceMinWidth: number
|
|
5
|
+
chatMinWidth: number
|
|
6
|
+
chatMaxWidth: number
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
type SplitLayoutState = WorkspaceSplitLayoutConstraints & {
|
|
10
|
+
fits: boolean
|
|
11
|
+
}
|
|
12
|
+
|
|
3
13
|
function tokenPx(name: string): number {
|
|
4
14
|
const root = document.documentElement
|
|
5
15
|
const raw = getComputedStyle(root).getPropertyValue(name).trim()
|
|
@@ -12,16 +22,22 @@ function tokenPx(name: string): number {
|
|
|
12
22
|
// not oscillate when the chat column appears or disappears.
|
|
13
23
|
export function useFitsSplitLayout<T extends HTMLElement>() {
|
|
14
24
|
const ref = useRef<T>(null)
|
|
15
|
-
const [
|
|
25
|
+
const [state, setState] = useState<SplitLayoutState | null>(null)
|
|
16
26
|
|
|
17
27
|
useLayoutEffect(() => {
|
|
18
28
|
const el = ref.current
|
|
19
29
|
if (!el) return
|
|
20
30
|
|
|
21
31
|
const update = (width: number) => {
|
|
22
|
-
const
|
|
23
|
-
const
|
|
24
|
-
|
|
32
|
+
const workspaceMinWidth = tokenPx('--column-w')
|
|
33
|
+
const chatMinWidth = tokenPx('--chat-min')
|
|
34
|
+
const chatMaxWidth = tokenPx('--chat-max')
|
|
35
|
+
setState({
|
|
36
|
+
fits: width - chatMinWidth >= workspaceMinWidth,
|
|
37
|
+
workspaceMinWidth,
|
|
38
|
+
chatMinWidth,
|
|
39
|
+
chatMaxWidth
|
|
40
|
+
})
|
|
25
41
|
}
|
|
26
42
|
|
|
27
43
|
update(el.getBoundingClientRect().width)
|
|
@@ -33,5 +49,15 @@ export function useFitsSplitLayout<T extends HTMLElement>() {
|
|
|
33
49
|
return () => ro.disconnect()
|
|
34
50
|
}, [])
|
|
35
51
|
|
|
36
|
-
return {
|
|
52
|
+
return {
|
|
53
|
+
ref,
|
|
54
|
+
fits: state?.fits ?? false,
|
|
55
|
+
constraints: state
|
|
56
|
+
? {
|
|
57
|
+
workspaceMinWidth: state.workspaceMinWidth,
|
|
58
|
+
chatMinWidth: state.chatMinWidth,
|
|
59
|
+
chatMaxWidth: state.chatMaxWidth
|
|
60
|
+
}
|
|
61
|
+
: null
|
|
62
|
+
}
|
|
37
63
|
}
|
package/client/index.css
CHANGED
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
@plugin '@tailwindcss/typography';
|
|
13
13
|
|
|
14
14
|
@custom-variant dark (&:is(.dark *));
|
|
15
|
+
@custom-variant dark-or-widget (&:is(.dark *, [data-widget-chrome] *));
|
|
15
16
|
|
|
16
17
|
:root {
|
|
17
18
|
--background: oklch(1 0 0);
|
|
@@ -26,6 +27,7 @@
|
|
|
26
27
|
--muted-foreground: oklch(0.64 0 0);
|
|
27
28
|
--accent: oklch(0 0 0 / 0.07);
|
|
28
29
|
--accent-foreground: var(--foreground);
|
|
30
|
+
--success: oklch(0.527 0.154 150.069);
|
|
29
31
|
--destructive: oklch(0.58 0.22 27);
|
|
30
32
|
--border: oklch(0 0 0 / 0.07);
|
|
31
33
|
--input: oklch(0.922 0 0);
|
|
@@ -41,7 +43,7 @@
|
|
|
41
43
|
sidebar's own widths live in SidebarLayout.tsx.) */
|
|
42
44
|
--page-pad: 2rem; /* padding around the working area */
|
|
43
45
|
--column-w: 40rem; /* grid content width; also the widget area's min before the chat yields */
|
|
44
|
-
--chat-min:
|
|
46
|
+
--chat-min: 320px; /* docked chat min width — narrower than this and it floats */
|
|
45
47
|
--chat-max: 460px; /* docked chat max width on wide screens */
|
|
46
48
|
--chat-max-container: 640px; /* contained ChatPanel: max width of the centered history + composer column */
|
|
47
49
|
}
|
|
@@ -71,13 +73,14 @@
|
|
|
71
73
|
--muted-foreground: oklch(0.708 0 0);
|
|
72
74
|
--accent: oklch(1 0 0 / 0.1);
|
|
73
75
|
--accent-foreground: var(--foreground);
|
|
76
|
+
--success: oklch(0.627 0.194 149.214);
|
|
74
77
|
--destructive: oklch(0.58 0.22 27);
|
|
75
78
|
--border: oklch(1 0 0 / 0.1);
|
|
76
79
|
--input: oklch(0.35 0 0);
|
|
77
80
|
--ring: oklch(0.556 0 0);
|
|
78
81
|
}
|
|
79
82
|
|
|
80
|
-
/*
|
|
83
|
+
/* Theme tokens and texture utilities shared with applet bundles. */
|
|
81
84
|
@import './theme.css';
|
|
82
85
|
|
|
83
86
|
/* Dragged card floats above all others */
|
package/client/lib/flags.ts
CHANGED
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
// per-thread or per-workspace settings. Change one and rebuild the client.
|
|
5
5
|
|
|
6
6
|
// Live token-by-token streaming of assistant responses. When true, the client
|
|
7
|
-
// asks the server to stream partial messages (only honored by providers
|
|
8
|
-
//
|
|
9
|
-
// responses arrive as whole blocks, exactly as
|
|
7
|
+
// asks the server to stream partial messages (only honored by providers whose
|
|
8
|
+
// `/agent` payload reports `supportsStreaming` — Claude Code and OpenClaw;
|
|
9
|
+
// ignored elsewhere). When false, responses arrive as whole blocks, exactly as
|
|
10
|
+
// before streaming existed.
|
|
10
11
|
export const STREAM_RESPONSES = true
|
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
import { useEffect, useRef } from 'react'
|
|
2
2
|
|
|
3
3
|
import { wsUrl } from '@/client/lib/ws-url'
|
|
4
|
-
import type {
|
|
4
|
+
import type {
|
|
5
|
+
AgentLoginState,
|
|
6
|
+
AppSettings,
|
|
7
|
+
HarnessAvailability,
|
|
8
|
+
ViewBuilder,
|
|
9
|
+
ViewInfo,
|
|
10
|
+
WidgetInfo,
|
|
11
|
+
WorkspaceTabId
|
|
12
|
+
} from '@/lib/types'
|
|
5
13
|
|
|
6
14
|
export type WorkspaceEvent =
|
|
7
15
|
| { type: 'widget:updated'; name: string }
|
|
@@ -21,6 +29,15 @@ export type WorkspaceEvent =
|
|
|
21
29
|
| { type: 'workspaces-list:updated' }
|
|
22
30
|
// A workspace's env changed outside the UI — refetch the env view.
|
|
23
31
|
| { type: 'env:updated'; workspaceId: string }
|
|
32
|
+
// The agent backend's availability or login ceremony changed (login landed,
|
|
33
|
+
// ceremony timed out, auth probe flipped). Carries the new state so caches
|
|
34
|
+
// patch without a refetch.
|
|
35
|
+
| {
|
|
36
|
+
type: 'agent:updated'
|
|
37
|
+
workspaceId: string
|
|
38
|
+
availability: HarnessAvailability
|
|
39
|
+
login?: AgentLoginState
|
|
40
|
+
}
|
|
24
41
|
// The Scratchpad canvas for `workspaceId` was saved — open tabs reload from
|
|
25
42
|
// disk. `origin` is the tab that wrote it, so that tab can skip its own echo.
|
|
26
43
|
| { type: 'scratchpad:updated'; workspaceId: string; origin?: string }
|
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
import { useEffect } from 'react'
|
|
2
2
|
import type { CSSProperties } from 'react'
|
|
3
3
|
|
|
4
|
-
import {
|
|
5
|
-
|
|
4
|
+
import {
|
|
5
|
+
COLOR_THEMES,
|
|
6
|
+
DEFAULT_PRIMARY_COLOR,
|
|
7
|
+
DEFAULT_WORKSPACE_THEME,
|
|
8
|
+
FONT_THEMES,
|
|
9
|
+
RADIUS_THEMES,
|
|
10
|
+
THEME_COLOR_TOKENS,
|
|
11
|
+
deriveThemeColors,
|
|
12
|
+
resolveWorkspaceTheme
|
|
13
|
+
} from '@/lib/themes'
|
|
14
|
+
import type { ThemeColorMode, ThemeColorToken } from '@/lib/themes'
|
|
6
15
|
import type { WorkspaceLayout } from '@/lib/types'
|
|
7
16
|
|
|
8
|
-
const FONT_LINK_ID = '
|
|
9
|
-
const FONT_PREVIEW_LINK_ID = '
|
|
17
|
+
const FONT_LINK_ID = 'moi-fonts'
|
|
18
|
+
const FONT_PREVIEW_LINK_ID = 'moi-font-previews'
|
|
10
19
|
const ALL_FONTS_QUERY = Object.values(FONT_THEMES)
|
|
11
20
|
.map(theme => theme.googleFontsQuery)
|
|
12
21
|
.filter(Boolean)
|
|
@@ -18,9 +27,11 @@ const WORKSPACE_FONT_PROPERTIES = [
|
|
|
18
27
|
const WORKSPACE_COLOR_PROPERTIES = THEME_COLOR_TOKENS.map(
|
|
19
28
|
token => [token, themeColorProperty(token)] as const
|
|
20
29
|
)
|
|
30
|
+
const WORKSPACE_RADIUS_PROPERTY = '--radius' as const
|
|
21
31
|
const WORKSPACE_THEME_PROPERTIES = [
|
|
22
32
|
...WORKSPACE_FONT_PROPERTIES.map(([, property]) => property),
|
|
23
|
-
...WORKSPACE_COLOR_PROPERTIES.map(([, property]) => property)
|
|
33
|
+
...WORKSPACE_COLOR_PROPERTIES.map(([, property]) => property),
|
|
34
|
+
WORKSPACE_RADIUS_PROPERTY
|
|
24
35
|
]
|
|
25
36
|
|
|
26
37
|
type WorkspaceThemeStyle = CSSProperties & {
|
|
@@ -32,16 +43,24 @@ function themeColorProperty(token: ThemeColorToken): `--${string}` {
|
|
|
32
43
|
return `--${name}`
|
|
33
44
|
}
|
|
34
45
|
|
|
35
|
-
export function getWorkspaceThemeStyle(
|
|
46
|
+
export function getWorkspaceThemeStyle(
|
|
47
|
+
theme: WorkspaceLayout['theme'],
|
|
48
|
+
colorMode: ThemeColorMode = 'workspace'
|
|
49
|
+
): WorkspaceThemeStyle {
|
|
36
50
|
const style: WorkspaceThemeStyle = {}
|
|
37
|
-
const
|
|
38
|
-
const
|
|
51
|
+
const resolved = resolveWorkspaceTheme(theme)
|
|
52
|
+
const font = FONT_THEMES[resolved.font] ?? FONT_THEMES[DEFAULT_WORKSPACE_THEME.font]
|
|
53
|
+
const color = COLOR_THEMES[resolved.color] ?? COLOR_THEMES[DEFAULT_WORKSPACE_THEME.color]
|
|
54
|
+
const primary = color.primary ?? (colorMode === 'widget' ? DEFAULT_PRIMARY_COLOR : undefined)
|
|
55
|
+
const colors = primary ? deriveThemeColors(primary, colorMode) : undefined
|
|
56
|
+
const radius = RADIUS_THEMES[resolved.radius] ?? RADIUS_THEMES[DEFAULT_WORKSPACE_THEME.radius]
|
|
39
57
|
for (const [token, property] of WORKSPACE_FONT_PROPERTIES) {
|
|
40
58
|
style[property] = font[token]
|
|
41
59
|
}
|
|
42
60
|
for (const [token, property] of WORKSPACE_COLOR_PROPERTIES) {
|
|
43
61
|
style[property] = colors?.[token]
|
|
44
62
|
}
|
|
63
|
+
style[WORKSPACE_RADIUS_PROPERTY] = radius.radius
|
|
45
64
|
return style
|
|
46
65
|
}
|
|
47
66
|
|
|
@@ -86,11 +105,11 @@ function useDocumentWorkspaceThemeStyle(theme: WorkspaceLayout['theme']) {
|
|
|
86
105
|
// Applies the active workspace theme to the document root so the workspace,
|
|
87
106
|
// sidebar, and body-level portals all resolve the same tokens.
|
|
88
107
|
export function useWorkspaceTheme(theme: WorkspaceLayout['theme']) {
|
|
89
|
-
const font = theme
|
|
108
|
+
const { font } = resolveWorkspaceTheme(theme)
|
|
90
109
|
useDocumentWorkspaceThemeStyle(theme)
|
|
91
110
|
|
|
92
111
|
useEffect(() => {
|
|
93
|
-
const config = FONT_THEMES[font] ?? FONT_THEMES.
|
|
112
|
+
const config = FONT_THEMES[font] ?? FONT_THEMES[DEFAULT_WORKSPACE_THEME.font]
|
|
94
113
|
|
|
95
114
|
const existing = document.getElementById(FONT_LINK_ID) as HTMLLinkElement | null
|
|
96
115
|
if (!config.googleFontsQuery) {
|
package/client/store/ui.ts
CHANGED
|
@@ -9,10 +9,12 @@ type UiStore = {
|
|
|
9
9
|
hasSentMessageFromMoi: boolean
|
|
10
10
|
workspaceIdsPendingAnalysis: string[]
|
|
11
11
|
composerDrafts: Record<string, string>
|
|
12
|
+
dockedChatWidth: number
|
|
12
13
|
setDiscoveredWorkspacesOpen: (open: boolean) => void
|
|
13
14
|
markWorkspacePendingAnalysis: (workspaceId: string) => void
|
|
14
15
|
markMessageSentFromMoi: (workspaceId: string) => void
|
|
15
16
|
setComposerDraft: (workspaceId: string, value: string) => void
|
|
17
|
+
setDockedChatWidth: (width: number) => void
|
|
16
18
|
}
|
|
17
19
|
|
|
18
20
|
export const createUiStore = (storage?: StateStorage) =>
|
|
@@ -23,6 +25,7 @@ export const createUiStore = (storage?: StateStorage) =>
|
|
|
23
25
|
hasSentMessageFromMoi: false,
|
|
24
26
|
workspaceIdsPendingAnalysis: [],
|
|
25
27
|
composerDrafts: {},
|
|
28
|
+
dockedChatWidth: 360,
|
|
26
29
|
setDiscoveredWorkspacesOpen: open => set({ discoveredWorkspacesOpen: open }),
|
|
27
30
|
markWorkspacePendingAnalysis: workspaceId =>
|
|
28
31
|
set(state => {
|
|
@@ -46,7 +49,8 @@ export const createUiStore = (storage?: StateStorage) =>
|
|
|
46
49
|
if (value) composerDrafts[workspaceId] = value
|
|
47
50
|
else delete composerDrafts[workspaceId]
|
|
48
51
|
return { composerDrafts }
|
|
49
|
-
})
|
|
52
|
+
}),
|
|
53
|
+
setDockedChatWidth: width => set({ dockedChatWidth: width })
|
|
50
54
|
}),
|
|
51
55
|
storage
|
|
52
56
|
? {
|
package/client/theme.css
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Shared
|
|
3
|
-
* applet bundles (server/bundler/build-applet.ts
|
|
4
|
-
*
|
|
2
|
+
* Shared Tailwind theme and utilities for both the host app (client/index.css)
|
|
3
|
+
* and applet bundles (server/bundler/build-applet.ts inlines this file into the
|
|
4
|
+
* applet's synthetic CSS).
|
|
5
5
|
*
|
|
6
6
|
* The actual CSS variables (`--sans`, `--mono`, `--background`, etc.)
|
|
7
7
|
* are owned by the host and declared on `:root` / `.dark` in
|
|
@@ -13,9 +13,9 @@
|
|
|
13
13
|
* - does NOT emit `--font-sans`, `--color-background`, or their source
|
|
14
14
|
* variables into the output
|
|
15
15
|
*
|
|
16
|
-
* Net effect: applets compile
|
|
17
|
-
*
|
|
18
|
-
*
|
|
16
|
+
* Net effect: the host and applets compile the same semantic theme utilities
|
|
17
|
+
* and texture utilities, then pick up the host's runtime theme without
|
|
18
|
+
* redefining any variable themselves.
|
|
19
19
|
*/
|
|
20
20
|
|
|
21
21
|
@theme inline {
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
--color-muted-foreground: var(--muted-foreground);
|
|
35
35
|
--color-accent: var(--accent);
|
|
36
36
|
--color-accent-foreground: var(--accent-foreground);
|
|
37
|
+
--color-success: var(--success);
|
|
37
38
|
--color-destructive: var(--destructive);
|
|
38
39
|
--color-border: var(--border);
|
|
39
40
|
--color-input: var(--input);
|
|
@@ -67,3 +68,92 @@
|
|
|
67
68
|
0px 0px 0px 1px rgba(0, 0, 0, 0.04), 0px 6px 12px -2px rgba(0, 0, 0, 0.08),
|
|
68
69
|
0px 24px 48px -8px rgba(0, 0, 0, 0.12);
|
|
69
70
|
}
|
|
71
|
+
|
|
72
|
+
/* Texture utilities leave background-color untouched so components keep an
|
|
73
|
+
* opaque semantic base underneath them. */
|
|
74
|
+
|
|
75
|
+
@utility texture-checker {
|
|
76
|
+
background-image: repeating-conic-gradient(
|
|
77
|
+
color-mix(in oklch, var(--primary) 1%, var(--foreground) 1%) 0 25%,
|
|
78
|
+
color-mix(in oklch, var(--primary) 3%, var(--foreground) 3%) 0 50%
|
|
79
|
+
);
|
|
80
|
+
background-position: 0 0;
|
|
81
|
+
background-repeat: repeat;
|
|
82
|
+
background-size: 32px 32px;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
@utility texture-checker-* {
|
|
86
|
+
background-image: repeating-conic-gradient(
|
|
87
|
+
color-mix(in oklch, var(--primary) 1%, var(--foreground) 1%) 0 25%,
|
|
88
|
+
color-mix(in oklch, var(--primary) 3%, var(--foreground) 3%) 0 50%
|
|
89
|
+
);
|
|
90
|
+
background-position: 0 0;
|
|
91
|
+
background-repeat: repeat;
|
|
92
|
+
background-size: --value([length]) --value([length]);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
@utility texture-grid {
|
|
96
|
+
background-image:
|
|
97
|
+
linear-gradient(
|
|
98
|
+
to right,
|
|
99
|
+
color-mix(in oklch, var(--primary) 3%, var(--foreground) 3%) 1px,
|
|
100
|
+
transparent 1px
|
|
101
|
+
),
|
|
102
|
+
linear-gradient(
|
|
103
|
+
to bottom,
|
|
104
|
+
color-mix(in oklch, var(--primary) 3%, var(--foreground) 3%) 1px,
|
|
105
|
+
transparent 1px
|
|
106
|
+
);
|
|
107
|
+
background-position: -12px -12px;
|
|
108
|
+
background-repeat: repeat;
|
|
109
|
+
background-size: 24px 24px;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
@utility texture-noise {
|
|
113
|
+
background-image: url('data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 1 1%22 width=%22160%22 height=%22160%22 color=%22black%22%3E%3Cdefs%3E%3Cfilter id=%22noise%22 x=%220%22 y=%220%22 width=%221%22 height=%221%22 filterUnits=%22userSpaceOnUse%22%3E%3CfeTurbulence type=%22fractalNoise%22 baseFrequency=%22128%22 numOctaves=%2210%22 result=%22turbulence%22/%3E%3CfeColorMatrix in=%22turbulence%22 type=%22luminanceToAlpha%22 result=%22alpha%22/%3E%3CfeComponentTransfer in=%22alpha%22 result=%22threshold%22%3E%3CfeFuncA type=%22linear%22 slope=%222.4%22 intercept=%22-1.12%22/%3E%3C/feComponentTransfer%3E%3CfeFlood flood-color=%22currentColor%22 flood-opacity=%220.1%22 result=%22color%22/%3E%3CfeComposite in=%22color%22 in2=%22threshold%22 operator=%22in%22/%3E%3C/filter%3E%3C/defs%3E%3Crect width=%221%22 height=%221%22 filter=%22url(%23noise)%22/%3E%3C/svg%3E');
|
|
114
|
+
background-blend-mode: hard-light;
|
|
115
|
+
background-position: 0 0;
|
|
116
|
+
background-repeat: repeat;
|
|
117
|
+
background-size: 160px 160px;
|
|
118
|
+
|
|
119
|
+
@variant dark-or-widget {
|
|
120
|
+
background-image: url('data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 1 1%22 width=%22160%22 height=%22160%22 color=%22white%22%3E%3Cdefs%3E%3Cfilter id=%22noise%22 x=%220%22 y=%220%22 width=%221%22 height=%221%22 filterUnits=%22userSpaceOnUse%22%3E%3CfeTurbulence type=%22fractalNoise%22 baseFrequency=%22128%22 numOctaves=%2210%22 result=%22turbulence%22/%3E%3CfeColorMatrix in=%22turbulence%22 type=%22luminanceToAlpha%22 result=%22alpha%22/%3E%3CfeComponentTransfer in=%22alpha%22 result=%22threshold%22%3E%3CfeFuncA type=%22linear%22 slope=%223.2%22 intercept=%22-1.44%22/%3E%3C/feComponentTransfer%3E%3CfeFlood flood-color=%22currentColor%22 flood-opacity=%220.1%22 result=%22color%22/%3E%3CfeComposite in=%22color%22 in2=%22threshold%22 operator=%22in%22/%3E%3C/filter%3E%3C/defs%3E%3Crect width=%221%22 height=%221%22 filter=%22url(%23noise)%22/%3E%3C/svg%3E');
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
@utility texture-gradient-linear {
|
|
125
|
+
background-image: linear-gradient(
|
|
126
|
+
to bottom,
|
|
127
|
+
transparent 25%,
|
|
128
|
+
color-mix(in oklch, var(--primary) 4%, transparent) 80%,
|
|
129
|
+
color-mix(in oklch, var(--primary) 8%, transparent) 100%
|
|
130
|
+
);
|
|
131
|
+
background-position: center;
|
|
132
|
+
background-repeat: no-repeat;
|
|
133
|
+
background-size: cover;
|
|
134
|
+
|
|
135
|
+
@variant dark-or-widget {
|
|
136
|
+
background-image: linear-gradient(
|
|
137
|
+
to bottom,
|
|
138
|
+
transparent 25%,
|
|
139
|
+
color-mix(in oklch, var(--primary) 10%, transparent) 80%,
|
|
140
|
+
color-mix(in oklch, var(--primary) 20%, transparent) 100%
|
|
141
|
+
);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
@utility texture-inset-shadow {
|
|
146
|
+
box-shadow: inset 0 0 32px 24px color-mix(in oklch, var(--primary) 4%, transparent);
|
|
147
|
+
|
|
148
|
+
@variant dark-or-widget {
|
|
149
|
+
box-shadow: inset 0 0 32px 24px color-mix(in oklch, var(--primary) 10%, transparent);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
@media (width < 48rem) {
|
|
153
|
+
box-shadow: inset 0 0 16px 16px color-mix(in oklch, var(--primary) 4%, transparent);
|
|
154
|
+
|
|
155
|
+
@variant dark-or-widget {
|
|
156
|
+
box-shadow: inset 0 0 16px 16px color-mix(in oklch, var(--primary) 10%, transparent);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"/chunk-
|
|
1
|
+
import"/chunk-35fq49qa.js";function t(z,Q){return z[13]=1,z[14]=Q>>8,z[15]=Q&255,z[16]=Q>>8,z[17]=Q&255,z}var e=112,zz=72,Qz=89,Zz=115,p;function Nz(){let z=new Int32Array(256);for(let Q=0;Q<256;Q++){let Z=Q;for(let $=0;$<8;$++)Z=Z&1?3988292384^Z>>>1:Z>>>1;z[Q]=Z}return z}function Iz(z){let Q=-1;if(!p)p=Nz();for(let Z=0;Z<z.length;Z++)Q=p[(Q^z[Z])&255]^Q>>>8;return Q^-1}function Uz(z){let Q=z.length-1;for(let Z=Q;Z>=4;Z--)if(z[Z-4]===9&&z[Z-3]===e&&z[Z-2]===zz&&z[Z-1]===Qz&&z[Z]===Zz)return Z-3;return 0}function $z(z,Q,Z=!1){let $=new Uint8Array(13);Q*=39.3701,$[0]=e,$[1]=zz,$[2]=Qz,$[3]=Zz,$[4]=Q>>>24,$[5]=Q>>>16,$[6]=Q>>>8,$[7]=Q&255,$[8]=$[4],$[9]=$[5],$[10]=$[6],$[11]=$[7],$[12]=1;let Y=Iz($),K=new Uint8Array(4);if(K[0]=Y>>>24,K[1]=Y>>>16,K[2]=Y>>>8,K[3]=Y&255,Z){let X=Uz(z);return z.set($,X),z.set(K,X+13),z}else{let X=new Uint8Array(4);X[0]=0,X[1]=0,X[2]=0,X[3]=9;let J=new Uint8Array(54);return J.set(z,0),J.set(X,33),J.set($,37),J.set(K,50),J}}var Dz="AAlwSFlz",Fz="AAAJcEhZ",Rz="AAAACXBI";function wz(z){let Q=z.indexOf(Dz);if(Q===-1)Q=z.indexOf(Fz);if(Q===-1)Q=z.indexOf(Rz);return Q}var Jz="[modern-screenshot]",D=typeof window<"u",Ez=D&&"Worker"in window,Kz=D&&"atob"in window,Cz=D&&"btoa"in window,x=D?window.navigator?.userAgent:"",Yz=x.includes("Chrome"),S=x.includes("AppleWebKit")&&!Yz,u=x.includes("Firefox"),fz=(z)=>z&&("__CONTEXT__"in z),Tz=(z)=>z.constructor.name==="CSSFontFaceRule",bz=(z)=>z.constructor.name==="CSSImportRule",Sz=(z)=>z.constructor.name==="CSSLayerBlockRule",k=(z)=>z.nodeType===1,f=(z)=>typeof z.className==="object",Xz=(z)=>z.tagName==="image",hz=(z)=>z.tagName==="use",w=(z)=>k(z)&&typeof z.style<"u"&&!f(z),gz=(z)=>z.nodeType===8,vz=(z)=>z.nodeType===3,R=(z)=>z.tagName==="IMG",h=(z)=>z.tagName==="VIDEO",pz=(z)=>z.tagName==="CANVAS",yz=(z)=>z.tagName==="TEXTAREA",mz=(z)=>z.tagName==="INPUT",xz=(z)=>z.tagName==="STYLE",uz=(z)=>z.tagName==="SCRIPT",iz=(z)=>z.tagName==="SELECT",cz=(z)=>z.tagName==="SLOT",dz=(z)=>z.tagName==="IFRAME",az=(...z)=>console.warn(Jz,...z);function lz(z){let Q=z?.createElement?.("canvas");if(Q)Q.height=Q.width=1;return Boolean(Q)&&"toDataURL"in Q&&Boolean(Q.toDataURL("image/webp").includes("image/webp"))}var y=(z)=>z.startsWith("data:");function Gz(z,Q){if(z.match(/^[a-z]+:\/\//i))return z;if(D&&z.match(/^\/\//))return window.location.protocol+z;if(z.match(/^[a-z]+:/i))return z;if(!D)return z;let Z=g().implementation.createHTMLDocument(),$=Z.createElement("base"),Y=Z.createElement("a");if(Z.head.appendChild($),Z.body.appendChild(Y),Q)$.href=Q;return Y.href=z,Y.href}function g(z){return(z&&k(z)?z?.ownerDocument:z)??window.document}var v="http://www.w3.org/2000/svg";function jz(z,Q,Z){let $=g(Z).createElementNS(v,"svg");return $.setAttributeNS(null,"width",z.toString()),$.setAttributeNS(null,"height",Q.toString()),$.setAttributeNS(null,"viewBox",`0 0 ${z} ${Q}`),$}function Vz(z,Q){let Z=new XMLSerializer().serializeToString(z);if(Q)Z=Z.replace(/[\u0000-\u0008\v\f\u000E-\u001F\uD800-\uDFFF\uFFFE\uFFFF]/gu,"");return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(Z)}`}async function sz(z,Q="image/png",Z=1){try{return await new Promise(($,Y)=>{z.toBlob((K)=>{if(K)$(K);else Y(Error("Blob is null"))},Q,Z)})}catch($){if(Kz)return rz(z.toDataURL(Q,Z));throw $}}function rz(z){let[Q,Z]=z.split(","),$=Q.match(/data:(.+);/)?.[1]??void 0,Y=window.atob(Z),K=Y.length,X=new Uint8Array(K);for(let J=0;J<K;J+=1)X[J]=Y.charCodeAt(J);return new Blob([X],{type:$})}function Hz(z,Q){return new Promise((Z,$)=>{let Y=new FileReader;if(Y.onload=()=>Z(Y.result),Y.onerror=()=>$(Y.error),Y.onabort=()=>$(Error(`Failed read blob to ${Q}`)),Q==="dataUrl")Y.readAsDataURL(z);else if(Q==="arrayBuffer")Y.readAsArrayBuffer(z)})}var nz=(z)=>Hz(z,"dataUrl"),oz=(z)=>Hz(z,"arrayBuffer");function F(z,Q){let Z=g(Q).createElement("img");return Z.decoding="sync",Z.loading="eager",Z.src=z,Z}function E(z,Q){return new Promise((Z)=>{let{timeout:$,ownerDocument:Y,onError:K,onWarn:X}=Q??{},J=typeof z==="string"?F(z,g(Y)):z,V=null,j=null;function G(){Z(J),V&&clearTimeout(V),j?.()}if($)V=setTimeout(G,$);if(h(J)){let M=J.currentSrc||J.src;if(!M){if(J.poster)return E(J.poster,Q).then(Z);return G()}if(J.readyState>=2)return G();let B=G,q=(W)=>{X?.("Failed video load",M,W),K?.(W),G()};j=()=>{J.removeEventListener("loadeddata",B),J.removeEventListener("error",q)},J.addEventListener("loadeddata",B,{once:!0}),J.addEventListener("error",q,{once:!0})}else{let M=Xz(J)?J.href.baseVal:J.currentSrc||J.src;if(!M)return G();let B=async()=>{if(R(J)&&"decode"in J)try{await J.decode()}catch(W){X?.("Failed to decode image, trying to render anyway",J.dataset.originalSrc||M,W)}G()},q=(W)=>{X?.("Failed image load",J.dataset.originalSrc||M,W),G()};if(R(J)&&J.complete)return B();j=()=>{J.removeEventListener("load",B),J.removeEventListener("error",q)},J.addEventListener("load",B,{once:!0}),J.addEventListener("error",q,{once:!0})}})}async function tz(z,Q){if(w(z))if(R(z)||h(z))await E(z,Q);else await Promise.all(["img","video"].flatMap((Z)=>{return Array.from(z.querySelectorAll(Z)).map(($)=>E($,Q))}))}var Bz=function(){let Q=0,Z=()=>`0000${(Math.random()*1679616<<0).toString(36)}`.slice(-4);return()=>{return Q+=1,`u${Z()}${Q}`}}();function Mz(z){return z?.split(",").map((Q)=>Q.trim().replace(/"|'/g,"").toLowerCase()).filter(Boolean)}var a=0;function ez(z){let Q=`${Jz}[#${a}]`;return a++,{time:(Z)=>z&&console.time(`${Q} ${Z}`),timeEnd:(Z)=>z&&console.timeEnd(`${Q} ${Z}`),warn:(...Z)=>z&&az(...Z)}}function zQ(z){return{cache:z?"no-cache":"force-cache"}}async function N(z,Q){return fz(z)?z:QQ(z,{...Q,autoDestruct:!0})}async function QQ(z,Q){let{scale:Z=1,workerUrl:$,workerNumber:Y=1}=Q||{},K=Boolean(Q?.debug),X=Q?.features??!0,J=z.ownerDocument??(D?window.document:void 0),V=z.ownerDocument?.defaultView??(D?window:void 0),j=new Map,G={width:0,height:0,quality:1,type:"image/png",scale:Z,backgroundColor:null,style:null,filter:null,maximumCanvasSize:0,timeout:30000,progress:null,debug:K,fetch:{requestInit:zQ(Q?.fetch?.bypassingCache),placeholderImage:"data:image/png;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",bypassingCache:!1,...Q?.fetch},fetchFn:null,font:{},drawImageInterval:100,workerUrl:null,workerNumber:Y,onCloneEachNode:null,onCloneNode:null,onEmbedNode:null,onCreateForeignObjectSvg:null,includeStyleProperties:null,autoDestruct:!1,...Q,__CONTEXT__:!0,log:ez(K),node:z,ownerDocument:J,ownerWindow:V,dpi:Z===1?null:96*Z,svgStyleElement:qz(J),svgDefsElement:J?.createElementNS(v,"defs"),svgStyles:new Map,defaultComputedStyles:new Map,workers:[...Array.from({length:Ez&&$&&Y?Y:0})].map(()=>{try{let q=new Worker($);return q.onmessage=async(W)=>{let{url:H,result:L}=W.data;if(L)j.get(H)?.resolve?.(L);else j.get(H)?.reject?.(Error(`Error receiving message from worker: ${H}`))},q.onmessageerror=(W)=>{let{url:H}=W.data;j.get(H)?.reject?.(Error(`Error receiving message from worker: ${H}`))},q}catch(q){return G.log.warn("Failed to new Worker",q),null}}).filter(Boolean),fontFamilies:new Map,fontCssTexts:new Map,acceptOfImage:`${[lz(J)&&"image/webp","image/svg+xml","image/*","*/*"].filter(Boolean).join(",")};q=0.8`,requests:j,drawImageCount:0,tasks:[],features:X,isEnable:(q)=>{if(q==="restoreScrollPosition")return typeof X==="boolean"?!1:X[q]??!1;if(typeof X==="boolean")return X;return X[q]??!0},shadowRoots:[]};G.log.time("wait until load"),await tz(z,{timeout:G.timeout,onWarn:G.log.warn}),G.log.timeEnd("wait until load");let{width:M,height:B}=ZQ(z,G);return G.width=M,G.height=B,G}function qz(z){if(!z)return;let Q=z.createElement("style"),Z=Q.ownerDocument.createTextNode(`
|
|
2
2
|
.______background-clip--text {
|
|
3
3
|
background-clip: text;
|
|
4
4
|
-webkit-background-clip: text;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
var j=Object.create;var{getPrototypeOf:k,defineProperty:f,getOwnPropertyNames:l}=Object;var m=Object.prototype.hasOwnProperty;function n(a){return this[a]}var o,p,s=(a,b,c)=>{var g=a!=null&&typeof a==="object";if(g){var h=b?o??=new WeakMap:p??=new WeakMap,i=h.get(a);if(i)return i}c=a!=null?j(k(a)):{};let d=b||!a||!a.__esModule?f(c,"default",{value:a,enumerable:!0}):c;for(let e of l(a))if(!m.call(d,e))f(d,e,{get:n.bind(a,e),enumerable:!0});if(g)h.set(a,d);return d};var t=(a,b)=>()=>(b||a((b={exports:{}}).exports,b),b.exports);var q=(a)=>a;function r(a,b){this[a]=q.bind(null,b)}var u=(a,b)=>{for(var c in b)f(a,c,{get:b[c],enumerable:!0,configurable:!0,set:r.bind(b,c)})};var v=((a)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(a,{get:(b,c)=>(typeof require<"u"?require:b)[c]}):a)(function(a){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+a+'" is not supported')});
|
|
2
|
-
export{s as
|
|
2
|
+
export{s as Fc,t as Gc,u as Hc,v as Ic};
|