mirror of
https://github.com/openswarm-ai/openswarm.git
synced 2026-08-29 03:09:41 +02:00
[eric] tree: group app/components rich-input + element-selection into editor/
This commit is contained in:
+2
-2
@@ -2,7 +2,7 @@ import React, { useState, useRef, useCallback, useEffect } from 'react';
|
||||
import { createPortal } from 'react-dom';
|
||||
import Box from '@mui/material/Box';
|
||||
import Typography from '@mui/material/Typography';
|
||||
import CommandPicker, { CommandPickerItem } from '@/app/components/CommandPicker';
|
||||
import CommandPicker, { CommandPickerItem } from '@/app/components/editor/CommandPicker';
|
||||
import {
|
||||
SKILL_PILL_ATTR,
|
||||
AttachedSkill,
|
||||
@@ -12,7 +12,7 @@ import {
|
||||
detectEditorTrigger,
|
||||
TriggerState,
|
||||
EMPTY_TRIGGER,
|
||||
} from '@/app/components/richEditorUtils';
|
||||
} from '@/app/components/editor/richEditorUtils';
|
||||
import { useAppSelector } from '@/shared/hooks';
|
||||
import { useClaudeTokens } from '@/shared/styles/ThemeContext';
|
||||
|
||||
@@ -51,7 +51,7 @@ import ApprovalBar, { BatchApprovalBar } from './shell/ApprovalBar';
|
||||
import ChatInput, { ChatInputHandle } from './ChatInput';
|
||||
import ContextDrawer from './shell/ContextDrawer';
|
||||
import { ErrorSlime } from '@/app/components/feedback/ErrorSlime';
|
||||
import { ContextPath } from '@/app/components/DirectoryBrowser';
|
||||
import { ContextPath } from '@/app/components/editor/DirectoryBrowser';
|
||||
import { setGlowingBrowserCards, fadeGlowingBrowserCards, clearGlowingBrowserCards } from '@/shared/state/dashboardLayoutSlice';
|
||||
import { useClaudeTokens } from '@/shared/styles/ThemeContext';
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import React, { useState, useRef, useCallback, useEffect, useMemo, forwardRef, useImperativeHandle } from 'react';
|
||||
import { useElementSelection } from '@/app/components/ElementSelectionContext';
|
||||
import { useElementSelection } from '@/app/components/editor/ElementSelectionContext';
|
||||
import { onboardingBus } from '@/app/components/Onboarding/eventBus';
|
||||
import { ContextPath } from '@/app/components/DirectoryBrowser';
|
||||
import { serializeEditorContent, AttachedSkill } from '@/app/components/richEditorUtils';
|
||||
import { ContextPath } from '@/app/components/editor/DirectoryBrowser';
|
||||
import { serializeEditorContent, AttachedSkill } from '@/app/components/editor/richEditorUtils';
|
||||
import { useAppDispatch, useAppSelector } from '@/shared/hooks';
|
||||
import { fetchModes } from '@/shared/state/modesSlice';
|
||||
import { useClaudeTokens } from '@/shared/styles/ThemeContext';
|
||||
@@ -19,7 +19,7 @@ import { ICON_MAP, FALLBACK_MODE_BASE } from './ChatInput/modeConfig';
|
||||
import { AttachedImage, ForcedToolGroup, ChatInputHandle } from './ChatInput/types';
|
||||
|
||||
export type { AttachedImage, ForcedToolGroup, ChatInputHandle };
|
||||
export type { AttachedSkill } from '@/app/components/richEditorUtils';
|
||||
export type { AttachedSkill } from '@/app/components/editor/richEditorUtils';
|
||||
|
||||
interface Props {
|
||||
onSend: (message: string, images?: Array<{ data: string; media_type: string }>, contextPaths?: ContextPath[], forcedTools?: string[], attachedSkills?: Array<{ id: string; name: string; content: string }>, selectedBrowserIds?: string[]) => void;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { useElementSelection, SelectedElement } from '@/app/components/ElementSelectionContext';
|
||||
import { useElementSelection, SelectedElement } from '@/app/components/editor/ElementSelectionContext';
|
||||
import { getClipboardCards, clearClipboard } from '@/shared/dashboardClipboard';
|
||||
|
||||
/** Drains the dashboard clipboard into owner-scoped selected elements. Returns true if it consumed the paste. */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useState, useCallback, useEffect, useMemo } from 'react';
|
||||
import { ContextPath } from '@/app/components/DirectoryBrowser';
|
||||
import { ContextPath } from '@/app/components/editor/DirectoryBrowser';
|
||||
import { API_BASE, getAuthToken } from '@/shared/config';
|
||||
import { ForcedToolGroup } from '../types';
|
||||
import { basename } from '../helpers';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useState, useRef, useCallback, RefObject } from 'react';
|
||||
import { CommandPickerItem } from '@/app/components/CommandPicker';
|
||||
import { useElementSelection } from '@/app/components/ElementSelectionContext';
|
||||
import { CommandPickerItem } from '@/app/components/editor/CommandPicker';
|
||||
import { useElementSelection } from '@/app/components/editor/ElementSelectionContext';
|
||||
import {
|
||||
SKILL_PILL_ATTR,
|
||||
AttachedSkill,
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
detectEditorTrigger,
|
||||
TriggerState,
|
||||
EMPTY_TRIGGER,
|
||||
} from '@/app/components/richEditorUtils';
|
||||
} from '@/app/components/editor/richEditorUtils';
|
||||
import { useAppDispatch } from '@/shared/hooks';
|
||||
import { clearSessionMessages } from '@/shared/state/agentsSlice';
|
||||
import { scheduleDraftSave } from './draftStore';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { SelectedElement } from '@/app/components/ElementSelectionContext';
|
||||
import { SelectedElement } from '@/app/components/editor/ElementSelectionContext';
|
||||
import { getWebview } from '@/shared/browserRegistry';
|
||||
import { ContextPath } from '@/app/components/DirectoryBrowser';
|
||||
import { ContextPath } from '@/app/components/editor/DirectoryBrowser';
|
||||
import { AttachedImage } from './types';
|
||||
import { SendBlock } from './hooks/useContextFiles';
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import React, { RefObject } from 'react';
|
||||
import Box from '@mui/material/Box';
|
||||
import { useElementSelection } from '@/app/components/ElementSelectionContext';
|
||||
import { useElementSelection } from '@/app/components/editor/ElementSelectionContext';
|
||||
import { ClaudeTokens } from '@/shared/styles/claudeTokens';
|
||||
import { ContextRing } from './ContextRing';
|
||||
import { ModeControl } from './ModeControl';
|
||||
|
||||
@@ -7,7 +7,7 @@ import ArrowUpwardIcon from '@mui/icons-material/ArrowUpward';
|
||||
import StopIcon from '@mui/icons-material/Stop';
|
||||
import AttachFileIcon from '@mui/icons-material/AttachFile';
|
||||
import AdsClickIcon from '@mui/icons-material/AdsClick';
|
||||
import { useElementSelection } from '@/app/components/ElementSelectionContext';
|
||||
import { useElementSelection } from '@/app/components/editor/ElementSelectionContext';
|
||||
import { ClaudeTokens } from '@/shared/styles/claudeTokens';
|
||||
|
||||
interface Props {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import { ContextPath } from '@/app/components/DirectoryBrowser';
|
||||
import { ContextPath } from '@/app/components/editor/DirectoryBrowser';
|
||||
|
||||
export interface AttachedImage {
|
||||
data: string;
|
||||
|
||||
@@ -7,9 +7,9 @@ import CloseIcon from '@mui/icons-material/Close';
|
||||
import FolderOpenIcon from '@mui/icons-material/FolderOpen';
|
||||
import InsertDriveFileOutlinedIcon from '@mui/icons-material/InsertDriveFileOutlined';
|
||||
import AdsClickIcon from '@mui/icons-material/AdsClick';
|
||||
import { getToolGroupIcon } from '@/app/components/CommandPicker';
|
||||
import { SelectedElement } from '@/app/components/ElementSelectionContext';
|
||||
import { ContextPath } from '@/app/components/DirectoryBrowser';
|
||||
import { getToolGroupIcon } from '@/app/components/editor/CommandPicker';
|
||||
import { SelectedElement } from '@/app/components/editor/ElementSelectionContext';
|
||||
import { ContextPath } from '@/app/components/editor/DirectoryBrowser';
|
||||
import { ClaudeTokens } from '@/shared/styles/claudeTokens';
|
||||
import { AttachedImage, ForcedToolGroup } from '../types';
|
||||
import { formatTokenCount, pathTail } from '../helpers';
|
||||
|
||||
@@ -3,12 +3,12 @@ import Box from '@mui/material/Box';
|
||||
import Typography from '@mui/material/Typography';
|
||||
import CircularProgress from '@mui/material/CircularProgress';
|
||||
import AttachFileIcon from '@mui/icons-material/AttachFile';
|
||||
import CommandPicker from '@/app/components/CommandPicker';
|
||||
import { useElementSelection } from '@/app/components/ElementSelectionContext';
|
||||
import { SelectedElement } from '@/app/components/ElementSelectionContext';
|
||||
import { ContextPath } from '@/app/components/DirectoryBrowser';
|
||||
import CommandPicker from '@/app/components/editor/CommandPicker';
|
||||
import { useElementSelection } from '@/app/components/editor/ElementSelectionContext';
|
||||
import { SelectedElement } from '@/app/components/editor/ElementSelectionContext';
|
||||
import { ContextPath } from '@/app/components/editor/DirectoryBrowser';
|
||||
import { ClaudeTokens } from '@/shared/styles/claudeTokens';
|
||||
import { TriggerState } from '@/app/components/richEditorUtils';
|
||||
import { TriggerState } from '@/app/components/editor/richEditorUtils';
|
||||
import { AttachedImage, ForcedToolGroup } from '../types';
|
||||
import { SendBlock } from '../hooks/useContextFiles';
|
||||
import { ModelPickerState } from '../hooks/useModelPicker';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import React from 'react';
|
||||
import Box from '@mui/material/Box';
|
||||
import Typography from '@mui/material/Typography';
|
||||
import { ContextPath } from '@/app/components/DirectoryBrowser';
|
||||
import { ContextPath } from '@/app/components/editor/DirectoryBrowser';
|
||||
import { API_BASE, getAuthToken } from '@/shared/config';
|
||||
import { ClaudeTokens } from '@/shared/styles/claudeTokens';
|
||||
import { SendBlock } from '../hooks/useContextFiles';
|
||||
|
||||
@@ -22,7 +22,7 @@ import { AgentMessage } from '@/shared/state/agentsSlice';
|
||||
import { openSettingsModal } from '@/shared/state/settingsSlice';
|
||||
import { useAppDispatch, useAppSelector } from '@/shared/hooks';
|
||||
import { useClaudeTokens } from '@/shared/styles/ThemeContext';
|
||||
import { SKILL_COLOR } from '@/app/components/richEditorUtils';
|
||||
import { SKILL_COLOR } from '@/app/components/editor/richEditorUtils';
|
||||
import PlanPicker from '@/app/components/PlanPicker';
|
||||
import { ErrorSlime } from '@/app/components/feedback/ErrorSlime';
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ import ViewQuiltOutlinedIcon from '@mui/icons-material/ViewQuiltOutlined';
|
||||
import { useAppSelector, useAppDispatch } from '@/shared/hooks';
|
||||
import { useClaudeTokens } from '@/shared/styles/ThemeContext';
|
||||
import { fetchBuiltinTools, fetchTools } from '@/shared/state/toolsSlice';
|
||||
import { getToolGroupIcon } from '@/app/components/CommandPicker';
|
||||
import { getToolGroupIcon } from '@/app/components/editor/CommandPicker';
|
||||
import { fetchOutputs } from '@/shared/state/outputsSlice';
|
||||
import { fetchSkills } from '@/shared/state/skillsSlice';
|
||||
import { fetchModes } from '@/shared/state/modesSlice';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import React from 'react';
|
||||
import SelectionOverlay from '@/app/components/SelectionOverlay';
|
||||
import { ElementSelectionProvider } from '@/app/components/ElementSelectionContext';
|
||||
import { useDomElementSelector } from '@/app/components/useDomElementSelector';
|
||||
import SelectionOverlay from '@/app/components/editor/SelectionOverlay';
|
||||
import { ElementSelectionProvider } from '@/app/components/editor/ElementSelectionContext';
|
||||
import { useDomElementSelector } from '@/app/components/editor/useDomElementSelector';
|
||||
import { useDashboardController } from './hooks/state/useDashboardController';
|
||||
import DashboardCanvas from './canvas/DashboardCanvas';
|
||||
|
||||
|
||||
@@ -14,8 +14,8 @@ import LanguageIcon from '@mui/icons-material/Language';
|
||||
import SearchIcon from '@mui/icons-material/Search';
|
||||
import { motion } from 'framer-motion';
|
||||
import ChatInput from '@/app/pages/AgentChat/ChatInput';
|
||||
import type { ContextPath } from '@/app/components/DirectoryBrowser';
|
||||
import { useElementSelection } from '@/app/components/ElementSelectionContext';
|
||||
import type { ContextPath } from '@/app/components/editor/DirectoryBrowser';
|
||||
import { useElementSelection } from '@/app/components/editor/ElementSelectionContext';
|
||||
import { useClaudeTokens } from '@/shared/styles/ThemeContext';
|
||||
import { useAppDispatch, useAppSelector } from '@/shared/hooks';
|
||||
import { searchHistory, clearHistorySearch } from '@/shared/state/agentsSlice';
|
||||
|
||||
@@ -48,7 +48,7 @@ import { getActionLabel } from '@/shared/browserCommandHandler';
|
||||
import { resolveInput, isGoogleSearch } from '@/shared/resolveUrl';
|
||||
import BrowserAgentOverlay from './BrowserAgentOverlay';
|
||||
import { useOverlayScrollPassthrough } from '../hooks/interaction/useOverlayScrollPassthrough';
|
||||
import { useElementSelection } from '@/app/components/ElementSelectionContext';
|
||||
import { useElementSelection } from '@/app/components/editor/ElementSelectionContext';
|
||||
|
||||
type ResizeDir = 'n' | 's' | 'e' | 'w' | 'ne' | 'nw' | 'se' | 'sw';
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ import {
|
||||
type CardPosition,
|
||||
} from '@/shared/state/dashboardLayoutSlice';
|
||||
import { generateDashboardName } from '@/shared/state/dashboardsSlice';
|
||||
import type { ContextPath } from '@/app/components/DirectoryBrowser';
|
||||
import type { ContextPath } from '@/app/components/editor/DirectoryBrowser';
|
||||
import type { CanvasActions } from '../interaction/useCanvasControls';
|
||||
|
||||
type SpawnOrigin = { x: number; y: number; type?: 'branch' };
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useCallback, useMemo, useRef } from 'react';
|
||||
import { useClaudeTokens } from '@/shared/styles/ThemeContext';
|
||||
import { useElementSelection } from '@/app/components/ElementSelectionContext';
|
||||
import { useElementSelection } from '@/app/components/editor/ElementSelectionContext';
|
||||
import { useCanvasControls } from '../interaction/useCanvasControls';
|
||||
import { useDashboardSelection } from './useDashboardSelection';
|
||||
import { useDashboardSelectors } from './useDashboardSelectors';
|
||||
|
||||
@@ -48,8 +48,8 @@ import FolderOpenIcon from '@mui/icons-material/FolderOpen';
|
||||
import ExtensionIcon from '@mui/icons-material/Extension';
|
||||
import ListSubheader from '@mui/material/ListSubheader';
|
||||
import { useClaudeTokens } from '@/shared/styles/ThemeContext';
|
||||
import DirectoryBrowser from '@/app/components/DirectoryBrowser';
|
||||
import RichPromptEditor from '@/app/components/RichPromptEditor';
|
||||
import DirectoryBrowser from '@/app/components/editor/DirectoryBrowser';
|
||||
import RichPromptEditor from '@/app/components/editor/RichPromptEditor';
|
||||
|
||||
const ICON_MAP: Record<string, React.ReactNode> = {
|
||||
smart_toy: <SmartToyOutlinedIcon sx={{ fontSize: 20 }} />,
|
||||
|
||||
@@ -10,7 +10,7 @@ import { onboardingBus } from '@/app/components/Onboarding/eventBus';
|
||||
import { fetchModels } from '@/shared/state/modelsSlice';
|
||||
import { fetchModes } from '@/shared/state/modesSlice';
|
||||
import { useThemeMode, useClaudeTokens } from '@/shared/styles/ThemeContext';
|
||||
import DirectoryBrowser from '@/app/components/DirectoryBrowser';
|
||||
import DirectoryBrowser from '@/app/components/editor/DirectoryBrowser';
|
||||
import { CommandsContent } from '@/app/pages/Commands/Commands';
|
||||
import GeneralTab from './sections/general/GeneralTab';
|
||||
import ModelsTab from './sections/models/ModelsTab';
|
||||
|
||||
@@ -15,7 +15,7 @@ import { useAppDispatch, useAppSelector } from '@/shared/hooks';
|
||||
import { createDraftSession, removeDraftSession } from '@/shared/state/agentsSlice';
|
||||
import { createSkill } from '@/shared/state/skillsSlice';
|
||||
import AgentChat from '../AgentChat/AgentChat';
|
||||
import { ContextPath } from '@/app/components/DirectoryBrowser';
|
||||
import { ContextPath } from '@/app/components/editor/DirectoryBrowser';
|
||||
import { API_BASE } from '@/shared/config';
|
||||
|
||||
const SKILLS_WORKSPACE_API = `${API_BASE}/skills`;
|
||||
|
||||
@@ -38,7 +38,7 @@ import ViewPreview, { ViewPreviewHandle } from './ViewPreview';
|
||||
import TerminalPanel, { TerminalLine } from './TerminalPanel';
|
||||
import { getDefault } from '@/shared/inputSchemaDefaults';
|
||||
import CodeEditor from './CodeEditor';
|
||||
import { ElementSelectionProvider } from '@/app/components/ElementSelectionContext';
|
||||
import { ElementSelectionProvider } from '@/app/components/editor/ElementSelectionContext';
|
||||
import { captureViewThumbnail } from './captureViewThumbnail';
|
||||
import { API_BASE, getAuthToken } from '@/shared/config';
|
||||
import { onboardingBus } from '@/app/components/Onboarding/eventBus';
|
||||
|
||||
@@ -2,7 +2,7 @@ import React, { useRef, useEffect, useMemo, useCallback, forwardRef, useImperati
|
||||
import Box from '@mui/material/Box';
|
||||
import Typography from '@mui/material/Typography';
|
||||
import { Skeleton } from '@/app/components/feedback/Loading';
|
||||
import { useElementSelection } from '@/app/components/ElementSelectionContext';
|
||||
import { useElementSelection } from '@/app/components/editor/ElementSelectionContext';
|
||||
import { useIframeElementSelector } from './useIframeElementSelector';
|
||||
import { getAuthToken, ensureAuthToken } from '@/shared/config';
|
||||
import { useClaudeTokens } from '@/shared/styles/ThemeContext';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useEffect, useRef, useCallback, RefObject } from 'react';
|
||||
import { SelectedElement, useElementSelection } from '@/app/components/ElementSelectionContext';
|
||||
import { SelectedElement, useElementSelection } from '@/app/components/editor/ElementSelectionContext';
|
||||
|
||||
const OVERLAY_ID = '__clawd-select-overlay__';
|
||||
const LABEL_ID = '__clawd-select-label__';
|
||||
|
||||
Reference in New Issue
Block a user