moi-computer 0.5.2-next.0 → 0.6.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/client/AGENTS.md +9 -0
- package/client/api/app-ui-keys.ts +4 -0
- package/client/api/workspace-keys.ts +2 -2
- package/client/app/routes/WorkspaceRoute.tsx +8 -28
- package/client/app/shell/SidebarLayout.tsx +1 -1
- package/client/components/shared/Composer.tsx +15 -9
- package/client/components/shared/IconGhost.tsx +130 -0
- package/client/components/ui/dropdown-menu.tsx +2 -5
- package/client/components/ui/popover.tsx +11 -4
- package/client/components/ui/slider.tsx +70 -0
- package/client/components/ui/spinner.tsx +18 -0
- package/client/components/ui/toast.tsx +220 -0
- package/client/components/ui/tooltip.tsx +1 -1
- package/client/features/chat/ChatComposer.tsx +11 -14
- package/client/features/chat/ChatPanel.tsx +15 -14
- package/client/features/chat/ChatPopup.tsx +10 -4
- package/client/features/chat/ChatSelector.tsx +263 -48
- package/client/features/chat/ModelPicker.tsx +295 -121
- package/client/features/chat/TurnView.tsx +1 -1
- package/client/features/chat/api.ts +36 -9
- package/client/features/chat/chat-frames.ts +35 -6
- package/client/features/chat/chat-send.ts +40 -6
- package/client/features/chat/chat-store.ts +52 -40
- package/client/features/chat/model-order.ts +50 -28
- package/client/features/chat/useChat.ts +71 -60
- package/client/features/chat/useSelectedSession.ts +151 -0
- package/client/features/chat/useStickToBottom.ts +3 -3
- package/client/features/home/api.ts +0 -2
- package/client/features/scratchpad/ScratchpadControls.tsx +2 -2
- package/client/features/settings/IconPicker.tsx +2 -2
- package/client/features/settings/WorkspaceSettings.tsx +6 -6
- package/client/features/views/ViewBuilderTab.tsx +3 -4
- package/client/features/views/api.ts +1 -0
- package/client/features/views/useViewBuilderActions.ts +7 -3
- package/client/features/workspace/WorkspaceScreen.tsx +40 -19
- package/client/features/workspace/WorkspaceSkillUpdateBanner.tsx +2 -2
- package/client/features/workspace/WorkspaceTabs.tsx +10 -1
- package/client/index.css +5 -3
- package/client/main.tsx +2 -0
- package/client/runtime/useWorkspaceEvents.ts +1 -0
- package/client/store/ui.ts +13 -3
- package/dist/{chunk-m9qja0nx.js → chunk-0pcdwjkp.js} +1 -1
- package/dist/chunk-55sh4dty.js +2 -0
- package/dist/{chunk-h3evrtyp.js → chunk-9y2zbzqz.js} +1 -1
- package/dist/{chunk-7bzpmtxp.js → chunk-afgbg75t.js} +1 -1
- package/dist/chunk-agtetn7n.css +1 -0
- package/dist/chunk-bv6vrvqf.js +27 -0
- package/dist/chunk-dfs36zgc.js +1 -0
- package/dist/chunk-exj6hr30.js +9 -0
- package/dist/{chunk-v797g6ap.js → chunk-m11ckkxd.js} +1 -1
- package/dist/chunk-n6t40enm.js +1 -0
- package/dist/{chunk-jg6ezptn.js → chunk-rxvx4ta9.js} +3 -3
- package/dist/index.html +1 -1
- package/lib/attachment-note.ts +18 -0
- package/lib/chat-title.ts +6 -0
- package/lib/types.ts +33 -10
- package/package.json +1 -1
- package/server/api.ts +100 -10
- package/server/app-settings.ts +1 -1
- package/server/data-dir.ts +1 -1
- package/server/harness/README.md +6 -0
- package/server/harness/claude-code/adapter.ts +2 -2
- package/server/harness/claude-code/index.ts +7 -1
- package/server/harness/claude-code/models.ts +25 -2
- package/server/harness/claude-code/session-title.ts +106 -0
- package/server/harness/claude-code/session.ts +114 -17
- package/server/harness/claude-code/sessions.ts +35 -4
- package/server/harness/codex/adapter.ts +27 -2
- package/server/harness/codex/client.ts +56 -9
- package/server/harness/codex/index.ts +2 -0
- package/server/harness/codex/session-title.ts +149 -0
- package/server/harness/codex/session.ts +96 -14
- package/server/harness/openclaw/adapter.ts +4 -2
- package/server/harness/openclaw/discovery.ts +2 -0
- package/server/harness/openclaw/session.ts +15 -7
- package/server/harness/session-title.ts +96 -0
- package/server/harness/types.ts +5 -2
- package/server/selected-session.ts +132 -0
- package/server/session-config.ts +146 -0
- package/server/web.ts +15 -1
- package/workspace/.claude/skills/moi-workspace/DESIGN.md +54 -68
- package/workspace/.claude/skills/moi-workspace/SKILL.md +8 -2
- package/dist/chunk-5vaevt8z.js +0 -2
- package/dist/chunk-fhhv99bd.js +0 -1
- package/dist/chunk-h0hk61pm.js +0 -9
- package/dist/chunk-k5sjx9s5.js +0 -1
- package/dist/chunk-rs9nb0fr.js +0 -27
- package/dist/chunk-s7za1qsv.css +0 -1
- package/server/thread-config.ts +0 -124
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { mkdir, rename, rm } from 'node:fs/promises'
|
|
2
|
+
import { join } from 'path'
|
|
3
|
+
|
|
4
|
+
import type { SessionConfig } from '@/lib/types'
|
|
5
|
+
|
|
6
|
+
import { DATA_DIR } from './data-dir'
|
|
7
|
+
|
|
8
|
+
// Per-session model/effort/Fast-mode overrides. Stored OUTSIDE
|
|
9
|
+
// the user's workspace (no repo churn) in ONE global JSON file in moi's data
|
|
10
|
+
// dir, alongside the workspace registry. Keyed by workspace path then sessionId:
|
|
11
|
+
// { "<workspacePath>": { "<sessionId>": { model?, effort?, fastMode? } } }
|
|
12
|
+
// Path (not registry id) is the key so config survives re-registration and lines
|
|
13
|
+
// up with the SDK's path-based session storage.
|
|
14
|
+
|
|
15
|
+
// A patch may clear a field with `null` (vs `undefined`, which leaves it alone).
|
|
16
|
+
export type SessionConfigPatch = {
|
|
17
|
+
model?: string | null
|
|
18
|
+
effort?: string | null
|
|
19
|
+
fastMode?: boolean | null
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
type Store = Record<string, Record<string, SessionConfig>>
|
|
23
|
+
|
|
24
|
+
export const DEFAULT_SESSION_CONFIG_PATH = join(DATA_DIR, 'session-config.json')
|
|
25
|
+
export const LEGACY_SESSION_CONFIG_PATH = join(DATA_DIR, 'thread-config.json')
|
|
26
|
+
|
|
27
|
+
let storePath = DEFAULT_SESSION_CONFIG_PATH
|
|
28
|
+
let legacyStorePath = LEGACY_SESSION_CONFIG_PATH
|
|
29
|
+
|
|
30
|
+
// Test seam: point the store at a scratch file (mirrors registry.setRegistryPath).
|
|
31
|
+
export function setSessionConfigPath(path: string, legacyPath?: string): void {
|
|
32
|
+
storePath = path
|
|
33
|
+
legacyStorePath = legacyPath ?? join(path, '..', 'thread-config.json')
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function clean(cfg: SessionConfig | undefined): SessionConfig {
|
|
37
|
+
const out: SessionConfig = {}
|
|
38
|
+
if (typeof cfg?.model === 'string') out.model = cfg.model
|
|
39
|
+
if (typeof cfg?.effort === 'string') out.effort = cfg.effort
|
|
40
|
+
if (typeof cfg?.fastMode === 'boolean') out.fastMode = cfg.fastMode
|
|
41
|
+
return out
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function isEmpty(cfg: SessionConfig): boolean {
|
|
45
|
+
return cfg.model === undefined && cfg.effort === undefined && cfg.fastMode === undefined
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
async function readStoreFile(path: string): Promise<Store | null> {
|
|
49
|
+
try {
|
|
50
|
+
const parsed = JSON.parse(await Bun.file(path).text())
|
|
51
|
+
return parsed && typeof parsed === 'object' ? (parsed as Store) : {}
|
|
52
|
+
} catch {
|
|
53
|
+
return null
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
async function writeStore(store: Store): Promise<void> {
|
|
58
|
+
await mkdir(join(storePath, '..'), { recursive: true })
|
|
59
|
+
const tmp = `${storePath}.${process.pid}.tmp`
|
|
60
|
+
await Bun.write(tmp, JSON.stringify(store, null, 2))
|
|
61
|
+
await rename(tmp, storePath)
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
async function readStore(): Promise<Store> {
|
|
65
|
+
const current = await readStoreFile(storePath)
|
|
66
|
+
if (current) return current
|
|
67
|
+
|
|
68
|
+
const legacy = await readStoreFile(legacyStorePath)
|
|
69
|
+
if (!legacy) return {}
|
|
70
|
+
await writeStore(legacy)
|
|
71
|
+
await rm(legacyStorePath, { force: true })
|
|
72
|
+
return legacy
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// Serialize read-modify-write so concurrent save/rename calls can't clobber the
|
|
76
|
+
// single shared file (last writer would otherwise drop the other's update).
|
|
77
|
+
let writeChain: Promise<unknown> = Promise.resolve()
|
|
78
|
+
function locked<T>(fn: () => Promise<T>): Promise<T> {
|
|
79
|
+
const run = writeChain.then(fn, fn)
|
|
80
|
+
writeChain = run.catch(() => {})
|
|
81
|
+
return run
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export async function getSessionConfig(
|
|
85
|
+
workspacePath: string,
|
|
86
|
+
sessionId: string
|
|
87
|
+
): Promise<SessionConfig> {
|
|
88
|
+
return locked(async () => {
|
|
89
|
+
const store = await readStore()
|
|
90
|
+
return clean(store[workspacePath]?.[sessionId])
|
|
91
|
+
})
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export async function hasSessionConfig(workspacePath: string, sessionId: string): Promise<boolean> {
|
|
95
|
+
return !isEmpty(await getSessionConfig(workspacePath, sessionId))
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// Merge a patch over the stored config and write it back. `null` clears a field,
|
|
99
|
+
// `undefined` leaves it untouched, and a typed value sets it. An emptied entry
|
|
100
|
+
// is dropped to keep the file tidy. Returns the merged config.
|
|
101
|
+
export async function saveSessionConfig(
|
|
102
|
+
workspacePath: string,
|
|
103
|
+
sessionId: string,
|
|
104
|
+
patch: SessionConfigPatch
|
|
105
|
+
): Promise<SessionConfig> {
|
|
106
|
+
return locked(async () => {
|
|
107
|
+
const store = await readStore()
|
|
108
|
+
const sessions = store[workspacePath] ?? {}
|
|
109
|
+
const next = clean(sessions[sessionId])
|
|
110
|
+
for (const key of ['model', 'effort'] as const) {
|
|
111
|
+
const value = patch[key]
|
|
112
|
+
if (value === undefined) continue
|
|
113
|
+
if (value === null) delete next[key]
|
|
114
|
+
else next[key] = value
|
|
115
|
+
}
|
|
116
|
+
if (patch.fastMode === null) delete next.fastMode
|
|
117
|
+
else if (patch.fastMode !== undefined) next.fastMode = patch.fastMode
|
|
118
|
+
if (isEmpty(next)) delete sessions[sessionId]
|
|
119
|
+
else sessions[sessionId] = next
|
|
120
|
+
if (Object.keys(sessions).length === 0) delete store[workspacePath]
|
|
121
|
+
else store[workspacePath] = sessions
|
|
122
|
+
await writeStore(store)
|
|
123
|
+
return next
|
|
124
|
+
})
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
// Move a session's config from one id to another (temp id → SDK real id on
|
|
128
|
+
// rename). Merges onto whatever the destination already holds (destination wins,
|
|
129
|
+
// so a concurrent write under the real id isn't lost) and removes the source.
|
|
130
|
+
export async function renameSessionConfig(
|
|
131
|
+
workspacePath: string,
|
|
132
|
+
from: string,
|
|
133
|
+
to: string
|
|
134
|
+
): Promise<void> {
|
|
135
|
+
if (from === to) return
|
|
136
|
+
await locked(async () => {
|
|
137
|
+
const store = await readStore()
|
|
138
|
+
const sessions = store[workspacePath]
|
|
139
|
+
const src = clean(sessions?.[from])
|
|
140
|
+
if (isEmpty(src)) return
|
|
141
|
+
sessions![to] = { ...src, ...clean(sessions![to]) }
|
|
142
|
+
delete sessions![from]
|
|
143
|
+
store[workspacePath] = sessions!
|
|
144
|
+
await writeStore(store)
|
|
145
|
+
})
|
|
146
|
+
}
|
package/server/web.ts
CHANGED
|
@@ -5,12 +5,13 @@ import index from '../client/index.html'
|
|
|
5
5
|
import { api } from './api'
|
|
6
6
|
import { PORT } from './constants'
|
|
7
7
|
import { control } from './control'
|
|
8
|
-
import { EVENTS_TOPIC, setEventServer } from './events'
|
|
8
|
+
import { EVENTS_TOPIC, publishEvent, setEventServer } from './events'
|
|
9
9
|
import { killAllWorkers } from './functions'
|
|
10
10
|
import { startScratchpadSweeper } from './scratchpad'
|
|
11
11
|
import { resolveScratchOp } from './scratchpad-relay'
|
|
12
12
|
import { allHarnesses, harnessFor } from './harness/registry'
|
|
13
13
|
import { getWorkspace } from './registry'
|
|
14
|
+
import { saveSelectedSession } from './selected-session'
|
|
14
15
|
import { addClient, broadcastAll, getClientCount, removeClient, sendToClient } from './state'
|
|
15
16
|
import { distShell, prebuilt } from './static'
|
|
16
17
|
import { renderStatus } from './status'
|
|
@@ -29,6 +30,7 @@ function isClientMessage(value: unknown): value is ClientMessage {
|
|
|
29
30
|
optimisticId?: unknown
|
|
30
31
|
model?: unknown
|
|
31
32
|
effort?: unknown
|
|
33
|
+
fastMode?: unknown
|
|
32
34
|
stream?: unknown
|
|
33
35
|
context?: unknown
|
|
34
36
|
attachments?: unknown
|
|
@@ -43,6 +45,7 @@ function isClientMessage(value: unknown): value is ClientMessage {
|
|
|
43
45
|
(v.optimisticId === undefined || typeof v.optimisticId === 'string') &&
|
|
44
46
|
(v.model === undefined || typeof v.model === 'string') &&
|
|
45
47
|
(v.effort === undefined || typeof v.effort === 'string') &&
|
|
48
|
+
(v.fastMode === undefined || typeof v.fastMode === 'boolean') &&
|
|
46
49
|
(v.stream === undefined || typeof v.stream === 'boolean') &&
|
|
47
50
|
(v.context === undefined || isMoiContext(v.context)) &&
|
|
48
51
|
(v.attachments === undefined ||
|
|
@@ -138,6 +141,16 @@ export const app = Bun.serve<WsData>({
|
|
|
138
141
|
if (data.type === 'chat' && (data.content?.trim() || data.attachments?.length)) {
|
|
139
142
|
const workspace = await getWorkspace(data.workspaceId)
|
|
140
143
|
if (!workspace) return
|
|
144
|
+
if (data.isNew) {
|
|
145
|
+
const selection = await saveSelectedSession(workspace.path, data.sessionId, null)
|
|
146
|
+
if (selection.changed) {
|
|
147
|
+
publishEvent({
|
|
148
|
+
type: 'selected-session:updated',
|
|
149
|
+
workspaceId: workspace.id,
|
|
150
|
+
sessionId: selection.sessionId
|
|
151
|
+
})
|
|
152
|
+
}
|
|
153
|
+
}
|
|
141
154
|
// Harnesses ignore fields they don't support (see SendMessageInput);
|
|
142
155
|
// failures surface as error frames from inside the harness.
|
|
143
156
|
void harnessFor(workspace)
|
|
@@ -151,6 +164,7 @@ export const app = Bun.serve<WsData>({
|
|
|
151
164
|
optimisticId: data.optimisticId,
|
|
152
165
|
model: data.model,
|
|
153
166
|
effort: data.effort,
|
|
167
|
+
fastMode: data.fastMode,
|
|
154
168
|
stream: data.stream,
|
|
155
169
|
context: data.context,
|
|
156
170
|
agentId: workspace.agentId
|
|
@@ -5,8 +5,8 @@ precise, and quiet. Applets may be more expressive and information-rich while st
|
|
|
5
5
|
to the workspace around them.
|
|
6
6
|
|
|
7
7
|
This file owns visual direction, layout, states, and interaction design. `SKILL.md` owns file layout,
|
|
8
|
-
imports, styling syntax, and build instructions. The
|
|
9
|
-
|
|
8
|
+
imports, styling syntax, and build instructions. The host owns fonts and semantic color values.
|
|
9
|
+
Widgets and views resolve color tokens in different scopes, described below.
|
|
10
10
|
|
|
11
11
|
## Visual direction
|
|
12
12
|
|
|
@@ -14,10 +14,10 @@ Design around the content and the task. Give every applet a clear first reading,
|
|
|
14
14
|
proportion to its size and purpose. Dense information is welcome when hierarchy and alignment keep
|
|
15
15
|
it easy to scan.
|
|
16
16
|
|
|
17
|
-
An applet may have one expressive focal point: a visualization, strong surface, image,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
An applet may have one expressive focal point: a visualization, strong surface, image, or satisfying
|
|
18
|
+
state change. It is optional. Use it when it helps the content and keep the rest restrained so it
|
|
19
|
+
remains meaningful. Avoid decorative clutter, competing effects, and a different visual system for
|
|
20
|
+
every section.
|
|
21
21
|
|
|
22
22
|
Every visible element must help the user understand useful content, see a real state, or take an
|
|
23
23
|
action. Do not add category eyebrows that repeat the title, readiness badges for an obvious default
|
|
@@ -29,29 +29,46 @@ spacing, or interaction patterns. They do not need to look identical.
|
|
|
29
29
|
|
|
30
30
|
## Color
|
|
31
31
|
|
|
32
|
-
|
|
33
|
-
theme. Views inherit the workspace surface. Semantic colors keep ordinary text, structure, controls,
|
|
34
|
-
and states readable and consistent.
|
|
32
|
+
### Widget surfaces
|
|
35
33
|
|
|
36
|
-
|
|
34
|
+
The host applies the `.dark` class around every widget. Semantic tokens inside a widget therefore
|
|
35
|
+
use dark-mode values regardless of the workspace color preset. The host frame stays transparent, so
|
|
36
|
+
every widget root must cover the full frame with an opaque background.
|
|
37
|
+
|
|
38
|
+
Choose each widget's background deliberately. Prefer an intentional solid color for most widgets,
|
|
39
|
+
using your design judgment to fit the content, purpose, mood, data, status, and surrounding widgets.
|
|
40
|
+
Pair it with a readable foreground and keep the surface consistent through every state. An image or
|
|
41
|
+
visualization may own the surface when it has an opaque fallback.
|
|
42
|
+
|
|
43
|
+
`h-full w-full bg-background text-foreground` is a sensible fallback when no more specific surface
|
|
44
|
+
fits. In the widget scope, it resolves to a dark background with light text.
|
|
45
|
+
|
|
46
|
+
### View surfaces
|
|
47
|
+
|
|
48
|
+
Views are separate pages. Their semantic tokens inherit the workspace theme, so
|
|
49
|
+
`h-full w-full bg-background text-foreground` is a sensible default root.
|
|
50
|
+
|
|
51
|
+
| Context or intent | Tailwind classes | Use |
|
|
37
52
|
| --- | --- | --- |
|
|
38
|
-
|
|
|
39
|
-
|
|
|
40
|
-
|
|
|
53
|
+
| Widget fallback | `bg-background text-foreground` | Dark semantic surface when no content-led color fits |
|
|
54
|
+
| Default view root | `bg-background text-foreground` | The workspace page surface and text |
|
|
55
|
+
| Primary content | `text-foreground` | Content on the default dark widget surface or normal view surface |
|
|
56
|
+
| Secondary content | `text-muted-foreground` | Supporting content on the default dark widget surface or normal view surface |
|
|
41
57
|
| Inset surface | `bg-card text-card-foreground` | A real contained object or raised region inside the applet |
|
|
42
58
|
| Floating surface | `bg-popover text-popover-foreground` | Menus, tooltips, and other floating content |
|
|
43
59
|
| Primary action | `bg-primary text-primary-foreground` | The most important action in a local region |
|
|
44
60
|
| Subdued surface | `bg-muted` | Skeletons, quiet fills, and disabled structure |
|
|
45
|
-
|
|
|
61
|
+
| Control state | `bg-accent text-accent-foreground` | Hover, active, and selected states on interactive controls |
|
|
46
62
|
| Error or danger | `text-destructive` / `bg-destructive` | Errors, destructive actions, and invalid states |
|
|
47
|
-
| Structure | `ring-
|
|
63
|
+
| Structure | `ring-border`, `border-input`, `ring-ring` | Container edges, controls, and visible focus on semantic surfaces |
|
|
48
64
|
|
|
49
|
-
Use lower foreground
|
|
50
|
-
for important labels or values. Keep inset surfaces rare so a widget does not
|
|
51
|
-
cards.
|
|
65
|
+
Use lower opacity from the surface's foreground only for tertiary metadata that remains readable.
|
|
66
|
+
Avoid weak alpha text for important labels or values. Keep inset surfaces rare so a widget does not
|
|
67
|
+
become a stack of cards.
|
|
52
68
|
|
|
53
|
-
Keep container edges subtle. Use `ring-1 ring-border`
|
|
54
|
-
|
|
69
|
+
Keep container edges subtle. Use `ring-1 ring-border` on semantic surfaces and an equally restrained
|
|
70
|
+
outline suited to a custom light or colored surface. Avoid a bare `border` or raw high-contrast
|
|
71
|
+
colors as custom container chrome.
|
|
55
72
|
|
|
56
73
|
Custom color is welcome when it carries identity, data, status, or useful emphasis. On a saturated
|
|
57
74
|
surface, choose an explicit light or dark foreground with strong contrast. Keep state colors
|
|
@@ -64,26 +81,6 @@ gradient only when it encodes information or is essential to the specific conten
|
|
|
64
81
|
Use purple, violet, and fuchsia only when the content, brand, or user preference calls for them.
|
|
65
82
|
Never use a purple gradient as a default creativity or technology cue.
|
|
66
83
|
|
|
67
|
-
### Color starting points
|
|
68
|
-
|
|
69
|
-
These are anchors, not fixed palettes. Tint them or use a single accent.
|
|
70
|
-
|
|
71
|
-
| Content | Useful color families | Typical range |
|
|
72
|
-
| --- | --- | --- |
|
|
73
|
-
| Weather, sky, time | Sky, blue, indigo | 500–700 |
|
|
74
|
-
| Night or dark environments | Indigo, slate | 800–900 |
|
|
75
|
-
| Overcast or neutral data | Slate, zinc, neutral | 500–800 |
|
|
76
|
-
| Nature and health | Emerald, green, teal | 500–700 |
|
|
77
|
-
| Finance and positive movement | Emerald, teal | 600–700 |
|
|
78
|
-
| Music and creative media | Blue, teal, amber, rose | 500–700 |
|
|
79
|
-
| Alerts and urgency | Red, orange | 500–700 |
|
|
80
|
-
| Notes and text | Amber, yellow | 400–600 |
|
|
81
|
-
| Social and communication | Pink, rose | 400–600 |
|
|
82
|
-
| Productivity and systems | Cyan, sky | 500–700 |
|
|
83
|
-
|
|
84
|
-
Use the middle and darker parts of a Tailwind color scale for substantial surfaces, then verify the
|
|
85
|
-
foreground contrast. Brighter values work better as small accents, chart marks, and status signals.
|
|
86
|
-
|
|
87
84
|
## Typography and hierarchy
|
|
88
85
|
|
|
89
86
|
Inherit the workspace font. Use sentence case for headings, labels, actions, and navigation. Use
|
|
@@ -94,9 +91,8 @@ Use a small, consistent type scale. `text-sm` (14 px) is the default for UI text
|
|
|
94
91
|
only for genuinely compact metadata and larger text only for clear headings or one meaningful
|
|
95
92
|
display value. Do not create many label styles with slightly different sizes.
|
|
96
93
|
|
|
97
|
-
Keep text contrast clear
|
|
98
|
-
|
|
99
|
-
read.
|
|
94
|
+
Keep text contrast clear and follow the foreground pairing for the chosen surface. Avoid several
|
|
95
|
+
near-identical text styles that make hierarchy hard to read.
|
|
100
96
|
|
|
101
97
|
Reserve `font-mono` for code, command text, and truly code-like identifiers. Do not use monospace for
|
|
102
98
|
numeric UI values, measurements, percentages, timers, timestamps, prices, counts, or labels. Numbers
|
|
@@ -128,28 +124,18 @@ must not look capsule-shaped.
|
|
|
128
124
|
|
|
129
125
|
## Interaction and motion
|
|
130
126
|
|
|
131
|
-
Widgets
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
Every interactive area must be obvious, keyboard-operable, and large enough to use comfortably.
|
|
136
|
-
Controls need a visible focus state and an accessible name. Use Tabler icons with consistent visual
|
|
137
|
-
weight. Do not rely on color alone, and keep charts understandable with labels, legends, patterns,
|
|
138
|
-
or direct values where needed.
|
|
139
|
-
|
|
140
|
-
Rank motion by purpose:
|
|
141
|
-
|
|
142
|
-
1. Optional entrance motion introduces the applet or a newly revealed region.
|
|
143
|
-
2. Interaction feedback covers hover, active, loading, disabled, and optimistic states.
|
|
144
|
-
3. At most one signature animation may act as the expressive focal point.
|
|
127
|
+
Widgets may include compact controls such as filters, toggles, refresh actions, and links. Keep
|
|
128
|
+
interaction feedback on the control that performs the action. The widget surface stays unchanged on
|
|
129
|
+
hover. Multi-step workflows and deep navigation belong in a view.
|
|
145
130
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
and
|
|
131
|
+
Controls must be obvious, keyboard-operable, and large enough to use comfortably. Give them a
|
|
132
|
+
visible focus state and an accessible name. Use Tabler icons with consistent visual weight. Do not
|
|
133
|
+
rely on color alone, and keep charts understandable with labels, legends, patterns, or direct values
|
|
134
|
+
where needed.
|
|
149
135
|
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
136
|
+
Use short, interruptible motion for meaningful state changes and control feedback. Respect
|
|
137
|
+
reduced-motion preferences and animate transform and opacity where possible. Do not loop decorative
|
|
138
|
+
motion or animate frequently updating numbers. Audio and video must be user-initiated.
|
|
153
139
|
|
|
154
140
|
## States
|
|
155
141
|
|
|
@@ -177,9 +163,9 @@ direct actions while keeping one clear first reading.
|
|
|
177
163
|
|
|
178
164
|
### Frame
|
|
179
165
|
|
|
180
|
-
The host card owns the outer radius, border, shadow, clipping, and elevation.
|
|
181
|
-
|
|
182
|
-
|
|
166
|
+
The host card owns the outer radius, border, shadow, clipping, and elevation. It leaves the inside
|
|
167
|
+
transparent. The widget root fills that rectangle and adds no outer card chrome. Its surface follows
|
|
168
|
+
the color guidance above.
|
|
183
169
|
|
|
184
170
|
Use a column layout when content needs a footer or timestamp, and keep lower-priority information at
|
|
185
171
|
the bottom. Important content needs safe padding from every edge. Use `p-4` as the compact default;
|
|
@@ -261,8 +247,8 @@ Before finishing an applet, confirm:
|
|
|
261
247
|
- Purple appears only for a content, brand, or user reason and never as a default gradient.
|
|
262
248
|
- Type, spacing, density, and expression support the content.
|
|
263
249
|
- Numeric UI values use the default font, with `tabular-nums` when alignment helps.
|
|
264
|
-
- Custom container outlines
|
|
250
|
+
- Custom container outlines suit their surface and stay subtle.
|
|
265
251
|
- The layout handles realistic content and deliberate overflow.
|
|
266
|
-
- Every
|
|
252
|
+
- Every control is necessary, complete, and accessible.
|
|
267
253
|
- The widget or view follows its frame, sizing, and scrolling rules.
|
|
268
254
|
- It feels related to the workspace without copying the quieter host shell.
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: moi-workspace
|
|
3
|
-
description:
|
|
3
|
+
description: >-
|
|
4
|
+
The moi workspace — the web UI the user chats from, extended with agent-authored applets
|
|
5
|
+
(widgets, views) plus theme & config. Read this FIRST in two cases. (a) A message carries a hidden
|
|
6
|
+
moi-context envelope: it was fired from a moi workspace, so you are running inside one even if
|
|
7
|
+
nothing else says so. (b) The user uses moi vocab — workspace, applet, widget, view, scratchpad,
|
|
8
|
+
dashboard, or a `moi` command — or asks to build, edit, customize, or theme the workspace UI or
|
|
9
|
+
its layout.
|
|
4
10
|
---
|
|
5
11
|
|
|
6
12
|
# Workspace
|
|
@@ -402,4 +408,4 @@ This skill is installed with moi (via the CLI or the UI) and can fall behind whe
|
|
|
402
408
|
- **Then** — if you updated, mention it.
|
|
403
409
|
|
|
404
410
|
<!-- moi skill version marker — read by `moi skill` to detect drift; do not edit by hand -->
|
|
405
|
-
<moi-skill version="0.
|
|
411
|
+
<moi-skill version="0.10.0" />
|
package/dist/chunk-5vaevt8z.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{$ as N1,Ca as v0,O as _0,T as L0,U as o,V as r,X as c,Y as n,_ as I0,aa as z0,ba as b0,ca as H1,da as y0,ea as U0,fa as f,ga as N0,ha as G0,ia as J0,ja as D0}from"/chunk-h0hk61pm.js";import{Mc as X0,Nc as A0}from"/chunk-h3evrtyp.js";var D1=A0((t1,h0)=>{h0.exports=globalThis.__esm["react-dom/client"]});var w0=A0((qG,x0)=>{x0.exports=globalThis.__esm["react-dom"]});var E0=new Map;function e1(G,J){if(J)E0.set(G,J);else E0.delete(G)}function GG(G){return E0.get(G)}var V0=X0(_0(),1);var K0=new Set,t=null,H0=!1;function u0(){if(t||H0)return;H0=!0;let G=new WebSocket(v0("/api/workspaces/ws"));G.onopen=()=>{t=G,H0=!1},G.onmessage=(J)=>{try{let K=JSON.parse(J.data);for(let Q of K0)Q(K)}catch{}},G.onclose=()=>{if(t=null,H0=!1,K0.size>0)setTimeout(u0,2000)},G.onerror=()=>{G.close()}}function QG(G){let J=V0.useRef(G);J.current=G,V0.useEffect(()=>{let K=(Q)=>J.current(Q);return K0.add(K),u0(),()=>{if(K0.delete(K),K0.size===0&&t)t.close(),t=null}},[])}var m0=["top","right","bottom","left"];var{min:p,max:S,round:Z0,floor:q0}=Math,x=(G)=>({x:G,y:G}),b1={left:"right",right:"left",bottom:"top",top:"bottom"};function j0(G,J,K){return S(G,p(J,K))}function m(G,J){return typeof G==="function"?G(J):G}function d(G){return G.split("-")[0]}function i(G){return G.split("-")[1]}function Y0(G){return G==="x"?"y":"x"}function T0(G){return G==="y"?"height":"width"}function w(G){let J=G[0];return J==="t"||J==="b"?"y":"x"}function B0(G){return Y0(w(G))}function d0(G,J,K){if(K===void 0)K=!1;let Q=i(G),Z=B0(G),q=T0(Z),U=Z==="x"?Q===(K?"end":"start")?"right":"left":Q==="start"?"bottom":"top";if(J.reference[q]>J.floating[q])U=Q0(U);return[U,Q0(U)]}function c0(G){let J=Q0(G);return[W0(G),J,W0(J)]}function W0(G){return G.includes("start")?G.replace("start","end"):G.replace("end","start")}var g0=["left","right"],p0=["right","left"],y1=["top","bottom"],S1=["bottom","top"];function O1(G,J,K){switch(G){case"top":case"bottom":if(K)return J?p0:g0;return J?g0:p0;case"left":case"right":return J?y1:S1;default:return[]}}function f0(G,J,K,Q){let Z=i(G),q=O1(d(G),K==="start",Q);if(Z){if(q=q.map((U)=>U+"-"+Z),J)q=q.concat(q.map(W0))}return q}function Q0(G){let J=d(G);return b1[J]+G.slice(J.length)}function P1(G){return{top:0,right:0,bottom:0,left:0,...G}}function $0(G){return typeof G!=="number"?P1(G):{top:G,right:G,bottom:G,left:G}}function s(G){let{x:J,y:K,width:Q,height:Z}=G;return{width:Q,height:Z,top:K,left:J,right:J+Q,bottom:K+Z,x:J,y:K}}function r0(G,J,K){let{reference:Q,floating:Z}=G,q=w(J),U=B0(J),N=T0(U),V=d(J),j=q==="y",H=Q.x+Q.width/2-Z.width/2,W=Q.y+Q.height/2-Z.height/2,Y=Q[N]/2-Z[N]/2,X;switch(V){case"top":X={x:H,y:Q.y-Z.height};break;case"bottom":X={x:H,y:Q.y+Q.height};break;case"right":X={x:Q.x+Q.width,y:W};break;case"left":X={x:Q.x-Z.width,y:W};break;default:X={x:Q.x,y:Q.y}}switch(i(J)){case"start":X[U]-=Y*(K&&j?-1:1);break;case"end":X[U]+=Y*(K&&j?-1:1);break}return X}async function n0(G,J){var K;if(J===void 0)J={};let{x:Q,y:Z,platform:q,rects:U,elements:N,strategy:V}=G,{boundary:j="clippingAncestors",rootBoundary:H="viewport",elementContext:W="floating",altBoundary:Y=!1,padding:X=0}=m(J,G),T=$0(X),I=N[Y?W==="floating"?"reference":"floating":W],L=s(await q.getClippingRect({element:((K=await(q.isElement==null?void 0:q.isElement(I)))!=null?K:!0)?I:I.contextElement||await(q.getDocumentElement==null?void 0:q.getDocumentElement(N.floating)),boundary:j,rootBoundary:H,strategy:V})),M=W==="floating"?{x:Q,y:Z,width:U.floating.width,height:U.floating.height}:U.reference,F=await(q.getOffsetParent==null?void 0:q.getOffsetParent(N.floating)),z=await(q.isElement==null?void 0:q.isElement(F))?await(q.getScale==null?void 0:q.getScale(F))||{x:1,y:1}:{x:1,y:1},k=s(q.convertOffsetParentRelativeRectToViewportRelativeRect?await q.convertOffsetParentRelativeRectToViewportRelativeRect({elements:N,rect:M,offsetParent:F,strategy:V}):M);return{top:(L.top-k.top+T.top)/z.y,bottom:(k.bottom-L.bottom+T.bottom)/z.y,left:(L.left-k.left+T.left)/z.x,right:(k.right-L.right+T.right)/z.x}}var R1=50,i0=async(G,J,K)=>{let{placement:Q="bottom",strategy:Z="absolute",middleware:q=[],platform:U}=K,N=U.detectOverflow?U:{...U,detectOverflow:n0},V=await(U.isRTL==null?void 0:U.isRTL(J)),j=await U.getElementRects({reference:G,floating:J,strategy:Z}),{x:H,y:W}=r0(j,Q,V),Y=Q,X=0,T={};for(let B=0;B<q.length;B++){let I=q[B];if(!I)continue;let{name:L,fn:M}=I,{x:F,y:z,data:k,reset:E}=await M({x:H,y:W,initialPlacement:Q,placement:Y,strategy:Z,middlewareData:T,rects:j,platform:N,elements:{reference:G,floating:J}});if(H=F!=null?F:H,W=z!=null?z:W,T[L]={...T[L],...k},E&&X<R1){if(X++,typeof E==="object"){if(E.placement)Y=E.placement;if(E.rects)j=E.rects===!0?await U.getElementRects({reference:G,floating:J,strategy:Z}):E.rects;({x:H,y:W}=r0(j,Y,V))}B=-1}}return{x:H,y:W,placement:Y,strategy:Z,middlewareData:T}},s0=(G)=>({name:"arrow",options:G,async fn(J){let{x:K,y:Q,placement:Z,rects:q,platform:U,elements:N,middlewareData:V}=J,{element:j,padding:H=0}=m(G,J)||{};if(j==null)return{};let W=$0(H),Y={x:K,y:Q},X=B0(Z),T=T0(X),B=await U.getDimensions(j),I=X==="y",L=I?"top":"left",M=I?"bottom":"right",F=I?"clientHeight":"clientWidth",z=q.reference[T]+q.reference[X]-Y[X]-q.floating[T],k=Y[X]-q.reference[X],E=await(U.getOffsetParent==null?void 0:U.getOffsetParent(j)),$=E?E[F]:0;if(!$||!await(U.isElement==null?void 0:U.isElement(E)))$=N.floating[F]||q.floating[T];let O=z/2-k/2,v=$/2-B[T]/2-1,y=p(W[L],v),u=p(W[M],v),A=y,P=$-B[T]-u,D=$/2-B[T]/2+O,g=j0(A,D,P),b=!V.arrow&&i(Z)!=null&&D!==g&&q.reference[T]/2-(D<A?y:u)-B[T]/2<0,R=b?D<A?D-A:D-P:0;return{[X]:Y[X]+R,data:{[X]:g,centerOffset:D-g-R,...b&&{alignmentOffset:R}},reset:b}}});var a0=function(G){if(G===void 0)G={};return{name:"flip",options:G,async fn(J){var K,Q;let{placement:Z,middlewareData:q,rects:U,initialPlacement:N,platform:V,elements:j}=J,{mainAxis:H=!0,crossAxis:W=!0,fallbackPlacements:Y,fallbackStrategy:X="bestFit",fallbackAxisSideDirection:T="none",flipAlignment:B=!0,...I}=m(G,J);if((K=q.arrow)!=null&&K.alignmentOffset)return{};let L=d(Z),M=w(N),F=d(N)===N,z=await(V.isRTL==null?void 0:V.isRTL(j.floating)),k=Y||(F||!B?[Q0(N)]:c0(N)),E=T!=="none";if(!Y&&E)k.push(...f0(N,B,T,z));let $=[N,...k],O=await V.detectOverflow(J,I),v=[],y=((Q=q.flip)==null?void 0:Q.overflows)||[];if(H)v.push(O[L]);if(W){let D=d0(Z,U,z);v.push(O[D[0]],O[D[1]])}if(y=[...y,{placement:Z,overflows:v}],!v.every((D)=>D<=0)){var u,A;let D=(((u=q.flip)==null?void 0:u.index)||0)+1,g=$[D];if(g){if(!(W==="alignment"?M!==w(g):!1)||y.every((_)=>w(_.placement)===M?_.overflows[0]>0:!0))return{data:{index:D,overflows:y},reset:{placement:g}}}let b=(A=y.filter((R)=>R.overflows[0]<=0).sort((R,_)=>R.overflows[1]-_.overflows[1])[0])==null?void 0:A.placement;if(!b)switch(X){case"bestFit":{var P;let R=(P=y.filter((_)=>{if(E){let h=w(_.placement);return h===M||h==="y"}return!0}).map((_)=>[_.placement,_.overflows.filter((h)=>h>0).reduce((h,l)=>h+l,0)]).sort((_,h)=>_[1]-h[1])[0])==null?void 0:P[0];if(R)b=R;break}case"initialPlacement":b=N;break}if(Z!==b)return{reset:{placement:b}}}return{}}}};function l0(G,J){return{top:G.top-J.height,right:G.right-J.width,bottom:G.bottom-J.height,left:G.left-J.width}}function o0(G){return m0.some((J)=>G[J]>=0)}var t0=function(G){if(G===void 0)G={};return{name:"hide",options:G,async fn(J){let{rects:K,platform:Q}=J,{strategy:Z="referenceHidden",...q}=m(G,J);switch(Z){case"referenceHidden":{let U=await Q.detectOverflow(J,{...q,elementContext:"reference"}),N=l0(U,K.reference);return{data:{referenceHiddenOffsets:N,referenceHidden:o0(N)}}}case"escaped":{let U=await Q.detectOverflow(J,{...q,altBoundary:!0}),N=l0(U,K.floating);return{data:{escapedOffsets:N,escaped:o0(N)}}}default:return{}}}}};var e0=new Set(["left","top"]);async function A1(G,J){let{placement:K,platform:Q,elements:Z}=G,q=await(Q.isRTL==null?void 0:Q.isRTL(Z.floating)),U=d(K),N=i(K),V=w(K)==="y",j=e0.has(U)?-1:1,H=q&&V?-1:1,W=m(J,G),{mainAxis:Y,crossAxis:X,alignmentAxis:T}=typeof W==="number"?{mainAxis:W,crossAxis:0,alignmentAxis:null}:{mainAxis:W.mainAxis||0,crossAxis:W.crossAxis||0,alignmentAxis:W.alignmentAxis};if(N&&typeof T==="number")X=N==="end"?T*-1:T;return V?{x:X*H,y:Y*j}:{x:Y*j,y:X*H}}var G1=function(G){if(G===void 0)G=0;return{name:"offset",options:G,async fn(J){var K,Q;let{x:Z,y:q,placement:U,middlewareData:N}=J,V=await A1(J,G);if(U===((K=N.offset)==null?void 0:K.placement)&&(Q=N.arrow)!=null&&Q.alignmentOffset)return{};return{x:Z+V.x,y:q+V.y,data:{...V,placement:U}}}}},J1=function(G){if(G===void 0)G={};return{name:"shift",options:G,async fn(J){let{x:K,y:Q,placement:Z,platform:q}=J,{mainAxis:U=!0,crossAxis:N=!1,limiter:V={fn:(L)=>{let{x:M,y:F}=L;return{x:M,y:F}}},...j}=m(G,J),H={x:K,y:Q},W=await q.detectOverflow(J,j),Y=w(d(Z)),X=Y0(Y),T=H[X],B=H[Y];if(U){let L=X==="y"?"top":"left",M=X==="y"?"bottom":"right",F=T+W[L],z=T-W[M];T=j0(F,T,z)}if(N){let L=Y==="y"?"top":"left",M=Y==="y"?"bottom":"right",F=B+W[L],z=B-W[M];B=j0(F,B,z)}let I=V.fn({...J,[X]:T,[Y]:B});return{...I,data:{x:I.x-K,y:I.y-Q,enabled:{[X]:U,[Y]:N}}}}}},K1=function(G){if(G===void 0)G={};return{options:G,fn(J){let{x:K,y:Q,placement:Z,rects:q,middlewareData:U}=J,{offset:N=0,mainAxis:V=!0,crossAxis:j=!0}=m(G,J),H={x:K,y:Q},W=w(Z),Y=Y0(W),X=H[Y],T=H[W],B=m(N,J),I=typeof B==="number"?{mainAxis:B,crossAxis:0}:{mainAxis:0,crossAxis:0,...B};if(V){let F=Y==="y"?"height":"width",z=q.reference[Y]-q.floating[F]+I.mainAxis,k=q.reference[Y]+q.reference[F]-I.mainAxis;if(X<z)X=z;else if(X>k)X=k}if(j){var L,M;let F=Y==="y"?"width":"height",z=e0.has(d(Z)),k=q.reference[W]-q.floating[F]+(z?((L=U.offset)==null?void 0:L[W])||0:0)+(z?0:I.crossAxis),E=q.reference[W]+q.reference[F]+(z?0:((M=U.offset)==null?void 0:M[W])||0)-(z?I.crossAxis:0);if(T<k)T=k;else if(T>E)T=E}return{[Y]:X,[W]:T}}}},Q1=function(G){if(G===void 0)G={};return{name:"size",options:G,async fn(J){var K,Q;let{placement:Z,rects:q,platform:U,elements:N}=J,{apply:V=()=>{},...j}=m(G,J),H=await U.detectOverflow(J,j),W=d(Z),Y=i(Z),X=w(Z)==="y",{width:T,height:B}=q.floating,I,L;if(W==="top"||W==="bottom")I=W,L=Y===(await(U.isRTL==null?void 0:U.isRTL(N.floating))?"start":"end")?"left":"right";else L=W,I=Y==="end"?"top":"bottom";let M=B-H.top-H.bottom,F=T-H.left-H.right,z=p(B-H[I],M),k=p(T-H[L],F),E=!J.middlewareData.shift,$=z,O=k;if((K=J.middlewareData.shift)!=null&&K.enabled.x)O=F;if((Q=J.middlewareData.shift)!=null&&Q.enabled.y)$=M;if(E&&!Y){let y=S(H.left,0),u=S(H.right,0),A=S(H.top,0),P=S(H.bottom,0);if(X)O=T-2*(y!==0||u!==0?y+u:S(H.left,H.right));else $=B-2*(A!==0||P!==0?A+P:S(H.top,H.bottom))}await V({...J,availableWidth:O,availableHeight:$});let v=await U.getDimensions(N.floating);if(T!==v.width||B!==v.height)return{reset:{rects:!0}};return{}}}};function X1(G){let J=f(G),K=parseFloat(J.width)||0,Q=parseFloat(J.height)||0,Z=n(G),q=Z?G.offsetWidth:K,U=Z?G.offsetHeight:Q,N=Z0(K)!==q||Z0(Q)!==U;if(N)K=q,Q=U;return{width:K,height:Q,$:N}}function S0(G){return!c(G)?G.contextElement:G}function e(G){let J=S0(G);if(!n(J))return x(1);let K=J.getBoundingClientRect(),{width:Q,height:Z,$:q}=X1(J),U=(q?Z0(K.width):K.width)/Q,N=(q?Z0(K.height):K.height)/Z;if(!U||!Number.isFinite(U))U=1;if(!N||!Number.isFinite(N))N=1;return{x:U,y:N}}var h1=x(0);function V1(G){let J=o(G);if(!y0()||!J.visualViewport)return h1;return{x:J.visualViewport.offsetLeft,y:J.visualViewport.offsetTop}}function v1(G,J,K){if(J===void 0)J=!1;if(!K||J&&K!==o(G))return!1;return J}function a(G,J,K,Q){if(J===void 0)J=!1;if(K===void 0)K=!1;let Z=G.getBoundingClientRect(),q=S0(G),U=x(1);if(J)if(Q){if(c(Q))U=e(Q)}else U=e(G);let N=v1(q,K,Q)?V1(q):x(0),V=(Z.left+N.x)/U.x,j=(Z.top+N.y)/U.y,H=Z.width/U.x,W=Z.height/U.y;if(q){let Y=o(q),X=Q&&c(Q)?o(Q):Q,T=Y,B=D0(T);while(B&&Q&&X!==T){let I=e(B),L=B.getBoundingClientRect(),M=f(B),F=L.left+(B.clientLeft+parseFloat(M.paddingLeft))*I.x,z=L.top+(B.clientTop+parseFloat(M.paddingTop))*I.y;V*=I.x,j*=I.y,H*=I.x,W*=I.y,V+=F,j+=z,T=o(B),B=D0(T)}}return s({width:H,height:W,x:V,y:j})}function F0(G,J){let K=N0(G).scrollLeft;if(!J)return a(r(G)).left+K;return J.left+K}function W1(G,J){let K=G.getBoundingClientRect(),Q=K.left+J.scrollLeft-F0(G,K),Z=K.top+J.scrollTop;return{x:Q,y:Z}}function u1(G){let{elements:J,rect:K,offsetParent:Q,strategy:Z}=G,q=Z==="fixed",U=r(Q),N=J?z0(J.floating):!1;if(Q===U||N&&q)return K;let V={scrollLeft:0,scrollTop:0},j=x(1),H=x(0),W=n(Q);if(W||!W&&!q){if(L0(Q)!=="body"||I0(U))V=N0(Q);if(W){let X=a(Q);j=e(Q),H.x=X.x+Q.clientLeft,H.y=X.y+Q.clientTop}}let Y=U&&!W&&!q?W1(U,V):x(0);return{width:K.width*j.x,height:K.height*j.y,x:K.x*j.x-V.scrollLeft*j.x+H.x+Y.x,y:K.y*j.y-V.scrollTop*j.y+H.y+Y.y}}function x1(G){return Array.from(G.getClientRects())}function w1(G){let J=r(G),K=N0(G),Q=G.ownerDocument.body,Z=S(J.scrollWidth,J.clientWidth,Q.scrollWidth,Q.clientWidth),q=S(J.scrollHeight,J.clientHeight,Q.scrollHeight,Q.clientHeight),U=-K.scrollLeft+F0(G),N=-K.scrollTop;if(f(Q).direction==="rtl")U+=S(J.clientWidth,Q.clientWidth)-Z;return{width:Z,height:q,x:U,y:N}}var Z1=25;function g1(G,J){let K=o(G),Q=r(G),Z=K.visualViewport,q=Q.clientWidth,U=Q.clientHeight,N=0,V=0;if(Z){q=Z.width,U=Z.height;let H=y0();if(!H||H&&J==="fixed")N=Z.offsetLeft,V=Z.offsetTop}let j=F0(Q);if(j<=0){let H=Q.ownerDocument,W=H.body,Y=getComputedStyle(W),X=H.compatMode==="CSS1Compat"?parseFloat(Y.marginLeft)+parseFloat(Y.marginRight)||0:0,T=Math.abs(Q.clientWidth-W.clientWidth-X);if(T<=Z1)q-=T}else if(j<=Z1)q+=j;return{width:q,height:U,x:N,y:V}}function p1(G,J){let K=a(G,!0,J==="fixed"),Q=K.top+G.clientTop,Z=K.left+G.clientLeft,q=n(G)?e(G):x(1),U=G.clientWidth*q.x,N=G.clientHeight*q.y,V=Z*q.x,j=Q*q.y;return{width:U,height:N,x:V,y:j}}function q1(G,J,K){let Q;if(J==="viewport")Q=g1(G,K);else if(J==="document")Q=w1(r(G));else if(c(J))Q=p1(J,K);else{let Z=V1(G);Q={x:J.x-Z.x,y:J.y-Z.y,width:J.width,height:J.height}}return s(Q)}function j1(G,J){let K=G0(G);if(K===J||!c(K)||U0(K))return!1;return f(K).position==="fixed"||j1(K,J)}function m1(G,J){let K=J.get(G);if(K)return K;let Q=J0(G,[],!1).filter((N)=>c(N)&&L0(N)!=="body"),Z=null,q=f(G).position==="fixed",U=q?G0(G):G;while(c(U)&&!U0(U)){let N=f(U),V=b0(U);if(!V&&N.position==="fixed")Z=null;if(q?!V&&!Z:!V&&N.position==="static"&&!!Z&&(Z.position==="absolute"||Z.position==="fixed")||I0(U)&&!V&&j1(G,U))Q=Q.filter((H)=>H!==U);else Z=N;U=G0(U)}return J.set(G,Q),Q}function d1(G){let{element:J,boundary:K,rootBoundary:Q,strategy:Z}=G,U=[...K==="clippingAncestors"?z0(J)?[]:m1(J,this._c):[].concat(K),Q],N=q1(J,U[0],Z),V=N.top,j=N.right,H=N.bottom,W=N.left;for(let Y=1;Y<U.length;Y++){let X=q1(J,U[Y],Z);V=S(X.top,V),j=p(X.right,j),H=p(X.bottom,H),W=S(X.left,W)}return{width:j-W,height:H-V,x:W,y:V}}function c1(G){let{width:J,height:K}=X1(G);return{width:J,height:K}}function f1(G,J,K){let Q=n(J),Z=r(J),q=K==="fixed",U=a(G,!0,q,J),N={scrollLeft:0,scrollTop:0},V=x(0);function j(){V.x=F0(Z)}if(Q||!Q&&!q){if(L0(J)!=="body"||I0(Z))N=N0(J);if(Q){let X=a(J,!0,q,J);V.x=X.x+J.clientLeft,V.y=X.y+J.clientTop}else if(Z)j()}if(q&&!Q&&Z)j();let H=Z&&!Q&&!q?W1(Z,N):x(0),W=U.left+N.scrollLeft-V.x-H.x,Y=U.top+N.scrollTop-V.y-H.y;return{x:W,y:Y,width:U.width,height:U.height}}function C0(G){return f(G).position==="static"}function U1(G,J){if(!n(G)||f(G).position==="fixed")return null;if(J)return J(G);let K=G.offsetParent;if(r(G)===K)K=K.ownerDocument.body;return K}function Y1(G,J){let K=o(G);if(z0(G))return K;if(!n(G)){let Z=G0(G);while(Z&&!U0(Z)){if(c(Z)&&!C0(Z))return Z;Z=G0(Z)}return K}let Q=U1(G,J);while(Q&&N1(Q)&&C0(Q))Q=U1(Q,J);if(Q&&U0(Q)&&C0(Q)&&!b0(Q))return K;return Q||H1(G)||K}var r1=async function(G){let J=this.getOffsetParent||Y1,K=this.getDimensions,Q=await K(G.floating);return{reference:f1(G.reference,await J(G.floating),G.strategy),floating:{x:0,y:0,width:Q.width,height:Q.height}}};function l1(G){return f(G).direction==="rtl"}var T1={convertOffsetParentRelativeRectToViewportRelativeRect:u1,getDocumentElement:r,getClippingRect:d1,getOffsetParent:Y1,getElementRects:r1,getClientRects:x1,getDimensions:c1,getScale:e,isElement:c,isRTL:l1};function B1(G,J){return G.x===J.x&&G.y===J.y&&G.width===J.width&&G.height===J.height}function o1(G,J){let K=null,Q,Z=r(G);function q(){var N;clearTimeout(Q),(N=K)==null||N.disconnect(),K=null}function U(N,V){if(N===void 0)N=!1;if(V===void 0)V=1;q();let j=G.getBoundingClientRect(),{left:H,top:W,width:Y,height:X}=j;if(!N)J();if(!Y||!X)return;let T=q0(W),B=q0(Z.clientWidth-(H+Y)),I=q0(Z.clientHeight-(W+X)),L=q0(H),F={rootMargin:-T+"px "+-B+"px "+-I+"px "+-L+"px",threshold:S(0,p(1,V))||1},z=!0;function k(E){let $=E[0].intersectionRatio;if($!==V){if(!z)return U();if(!$)Q=setTimeout(()=>{U(!1,0.0000001)},1000);else U(!1,$)}if($===1&&!B1(j,G.getBoundingClientRect()))U();z=!1}try{K=new IntersectionObserver(k,{...F,root:Z.ownerDocument})}catch(E){K=new IntersectionObserver(k,F)}K.observe(G)}return U(!0),q}function n1(G,J,K,Q){if(Q===void 0)Q={};let{ancestorScroll:Z=!0,ancestorResize:q=!0,elementResize:U=typeof ResizeObserver==="function",layoutShift:N=typeof IntersectionObserver==="function",animationFrame:V=!1}=Q,j=S0(G),H=Z||q?[...j?J0(j):[],...J?J0(J):[]]:[];H.forEach((L)=>{Z&&L.addEventListener("scroll",K,{passive:!0}),q&&L.addEventListener("resize",K)});let W=j&&N?o1(j,K):null,Y=-1,X=null;if(U){if(X=new ResizeObserver((L)=>{let[M]=L;if(M&&M.target===j&&X&&J)X.unobserve(J),cancelAnimationFrame(Y),Y=requestAnimationFrame(()=>{var F;(F=X)==null||F.observe(J)});K()}),j&&!V)X.observe(j);if(J)X.observe(J)}let T,B=V?a(G):null;if(V)I();function I(){let L=a(G);if(B&&!B1(B,L))K();B=L,T=requestAnimationFrame(I)}return K(),()=>{var L;if(H.forEach((M)=>{Z&&M.removeEventListener("scroll",K),q&&M.removeEventListener("resize",K)}),W==null||W(),(L=X)==null||L.disconnect(),X=null,V)cancelAnimationFrame(T)}}var L1=G1;var I1=J1,z1=a0,F1=Q1,M1=t0,O0=s0;var k1=K1,P0=(G,J,K)=>{let Q=new Map,Z={platform:T1,...K},q={...Z.platform,_c:Q};return i0(G,J,{...Z,platform:q})};var C=X0(_0(),1),_1=X0(_0(),1),$1=X0(w0(),1),i1=typeof document<"u",s1=function(){},M0=i1?_1.useLayoutEffect:s1;function k0(G,J){if(G===J)return!0;if(typeof G!==typeof J)return!1;if(typeof G==="function"&&G.toString()===J.toString())return!0;let K,Q,Z;if(G&&J&&typeof G==="object"){if(Array.isArray(G)){if(K=G.length,K!==J.length)return!1;for(Q=K;Q--!==0;)if(!k0(G[Q],J[Q]))return!1;return!0}if(Z=Object.keys(G),K=Z.length,K!==Object.keys(J).length)return!1;for(Q=K;Q--!==0;)if(!{}.hasOwnProperty.call(J,Z[Q]))return!1;for(Q=K;Q--!==0;){let q=Z[Q];if(q==="_owner"&&G.$$typeof)continue;if(!k0(G[q],J[q]))return!1}return!0}return G!==G&&J!==J}function C1(G){if(typeof window>"u")return 1;return(G.ownerDocument.defaultView||window).devicePixelRatio||1}function E1(G,J){let K=C1(G);return Math.round(J*K)/K}function R0(G){let J=C.useRef(G);return M0(()=>{J.current=G}),J}function EG(G){if(G===void 0)G={};let{placement:J="bottom",strategy:K="absolute",middleware:Q=[],platform:Z,elements:{reference:q,floating:U}={},transform:N=!0,whileElementsMounted:V,open:j}=G,[H,W]=C.useState({x:0,y:0,strategy:K,placement:J,middlewareData:{},isPositioned:!1}),[Y,X]=C.useState(Q);if(!k0(Y,Q))X(Q);let[T,B]=C.useState(null),[I,L]=C.useState(null),M=C.useCallback((_)=>{if(_!==E.current)E.current=_,B(_)},[]),F=C.useCallback((_)=>{if(_!==$.current)$.current=_,L(_)},[]),z=q||T,k=U||I,E=C.useRef(null),$=C.useRef(null),O=C.useRef(H),v=V!=null,y=R0(V),u=R0(Z),A=R0(j),P=C.useCallback(()=>{if(!E.current||!$.current)return;let _={placement:J,strategy:K,middleware:Y};if(u.current)_.platform=u.current;P0(E.current,$.current,_).then((h)=>{let l={...h,isPositioned:A.current!==!1};if(D.current&&!k0(O.current,l))O.current=l,$1.flushSync(()=>{W(l)})})},[Y,J,K,u,A]);M0(()=>{if(j===!1&&O.current.isPositioned)O.current.isPositioned=!1,W((_)=>({..._,isPositioned:!1}))},[j]);let D=C.useRef(!1);M0(()=>{return D.current=!0,()=>{D.current=!1}},[]),M0(()=>{if(z)E.current=z;if(k)$.current=k;if(z&&k){if(y.current)return y.current(z,k,P);P()}},[z,k,P,y,v]);let g=C.useMemo(()=>({reference:E,floating:$,setReference:M,setFloating:F}),[M,F]),b=C.useMemo(()=>({reference:z,floating:k}),[z,k]),R=C.useMemo(()=>{let _={position:K,left:0,top:0};if(!b.floating)return _;let h=E1(b.floating,H.x),l=E1(b.floating,H.y);if(N)return{..._,transform:"translate("+h+"px, "+l+"px)",...C1(b.floating)>=1.5&&{willChange:"transform"}};return{position:K,left:h,top:l}},[K,N,b.floating,H.x,H.y]);return C.useMemo(()=>({...H,update:P,refs:g,elements:b,floatingStyles:R}),[H,P,g,b,R])}var a1=(G)=>{function J(K){return{}.hasOwnProperty.call(K,"current")}return{name:"arrow",options:G,fn(K){let{element:Q,padding:Z}=typeof G==="function"?G(K):G;if(Q&&J(Q)){if(Q.current!=null)return O0({element:Q.current,padding:Z}).fn(K);return{}}if(Q)return O0({element:Q,padding:Z}).fn(K);return{}}}},_G=(G,J)=>{let K=L1(G);return{name:K.name,fn:K.fn,options:[G,J]}},$G=(G,J)=>{let K=I1(G);return{name:K.name,fn:K.fn,options:[G,J]}},CG=(G,J)=>{return{fn:k1(G).fn,options:[G,J]}},DG=(G,J)=>{let K=z1(G);return{name:K.name,fn:K.fn,options:[G,J]}},bG=(G,J)=>{let K=F1(G);return{name:K.name,fn:K.fn,options:[G,J]}};var yG=(G,J)=>{let K=M1(G);return{name:K.name,fn:K.fn,options:[G,J]}};var SG=(G,J)=>{let K=a1(G);return{name:K.name,fn:K.fn,options:[G,J]}};
|
|
2
|
-
export{w0 as b,D1 as c,Z0 as d,q0 as e,j0 as f,m as g,d as h,i,T0 as j,w as k,B0 as l,$0 as m,n1 as n,EG as o,_G as p,$G as q,CG as r,DG as s,bG as t,yG as u,SG as v,e1 as w,GG as x,QG as y};
|
package/dist/chunk-fhhv99bd.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Pc as a}from"/chunk-h3evrtyp.js";if(typeof globalThis.structuredClone==="function")globalThis.structuredClone=globalThis.structuredClone.bind(globalThis);async function e(r){let{mount:t}=await import("/chunk-rs9nb0fr.js");t(r)}globalThis.__init=e;
|