diff --git a/src/apps/chat/components/message/ChatMessage.tsx b/src/apps/chat/components/message/ChatMessage.tsx index 18ae1df7e..69bc48104 100644 --- a/src/apps/chat/components/message/ChatMessage.tsx +++ b/src/apps/chat/components/message/ChatMessage.tsx @@ -18,21 +18,23 @@ import SmartToyOutlinedIcon from '@mui/icons-material/SmartToyOutlined'; import TelegramIcon from '@mui/icons-material/Telegram'; import VerticalAlignBottomIcon from '@mui/icons-material/VerticalAlignBottom'; +import { SystemPurposeId, SystemPurposes } from '../../../../data'; + +import { BlocksRenderer, editBlocksSx } from '~/modules/blocks/BlocksRenderer'; +import { useSanityTextDiffs } from '~/modules/blocks/RenderTextDiff'; + import { ChatBestOfIcon } from '~/common/components/icons/ChatBestOfIcon'; import { CloseableMenu } from '~/common/components/CloseableMenu'; import { DMessage } from '~/common/state/store-chats'; import { InlineTextarea } from '~/common/components/InlineTextarea'; import { KeyStroke } from '~/common/components/KeyStroke'; import { Link } from '~/common/components/Link'; -import { SystemPurposeId, SystemPurposes } from '../../../../data'; import { copyToClipboard } from '~/common/util/clipboardUtils'; import { cssRainbowColorKeyframes, themeScalingMap } from '~/common/app.theme'; import { prettyBaseModel } from '~/common/util/modelUtils'; import { useUIPreferencesStore } from '~/common/state/store-ui'; -import { BlocksRenderer, editBlocksSx } from './blocks/BlocksRenderer'; import { useChatShowTextDiff } from '../../store-app-chat'; -import { useSanityTextDiffs } from './blocks/RenderTextDiff'; // Enable the menu on text selection diff --git a/src/apps/draw/TextToImage.tsx b/src/apps/draw/TextToImage.tsx index 58685af19..dffb896e4 100644 --- a/src/apps/draw/TextToImage.tsx +++ b/src/apps/draw/TextToImage.tsx @@ -4,9 +4,9 @@ import { useQuery } from '@tanstack/react-query'; import type { SxProps } from '@mui/joy/styles/types'; import { Box, Card, Skeleton } from '@mui/joy'; -import { ImageBlock } from '../chat/components/message/blocks/blocks'; +import type { ImageBlock } from '~/modules/blocks/blocks'; import { getActiveTextToImageProviderOrThrow, t2iGenerateImageOrThrow } from '~/modules/t2i/t2i.client'; -import { heuristicMarkdownImageReferenceBlocks } from '../chat/components/message/blocks/RenderImage'; +import { heuristicMarkdownImageReferenceBlocks } from '~/modules/blocks/RenderImage'; import type { TextToImageProvider } from '~/common/components/useCapabilities'; import { InlineError } from '~/common/components/InlineError'; diff --git a/src/apps/personas/creator/Creator.tsx b/src/apps/personas/creator/Creator.tsx index a698154c6..dc1c14363 100644 --- a/src/apps/personas/creator/Creator.tsx +++ b/src/apps/personas/creator/Creator.tsx @@ -5,9 +5,8 @@ import AddIcon from '@mui/icons-material/Add'; import ContentCopyIcon from '@mui/icons-material/ContentCopy'; import SettingsAccessibilityIcon from '@mui/icons-material/SettingsAccessibility'; -import { RenderMarkdownMemo } from '../../chat/components/message/blocks/markdown/RenderMarkdown'; - import { LLMChainStep, useLLMChain } from '~/modules/aifn/useLLMChain'; +import { RenderMarkdownMemo } from '~/modules/blocks/markdown/RenderMarkdown'; import { GoodTooltip } from '~/common/components/GoodTooltip'; import { copyToClipboard } from '~/common/util/clipboardUtils'; diff --git a/src/apps/settings-modal/ShortcutsModal.tsx b/src/apps/settings-modal/ShortcutsModal.tsx index 96a499ac0..039d64d39 100644 --- a/src/apps/settings-modal/ShortcutsModal.tsx +++ b/src/apps/settings-modal/ShortcutsModal.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; -import { BlocksRenderer } from '../chat/components/message/blocks/BlocksRenderer'; +import { BlocksRenderer } from '~/modules/blocks/BlocksRenderer'; import { GoodModal } from '~/common/components/GoodModal'; import { platformAwareKeystrokes } from '~/common/components/KeyStroke'; diff --git a/src/modules/aifn/digrams/DiagramsModal.tsx b/src/modules/aifn/digrams/DiagramsModal.tsx index 70ed7c781..a13bf23f1 100644 --- a/src/modules/aifn/digrams/DiagramsModal.tsx +++ b/src/modules/aifn/digrams/DiagramsModal.tsx @@ -8,8 +8,7 @@ import ReplayIcon from '@mui/icons-material/Replay'; import StopOutlinedIcon from '@mui/icons-material/StopOutlined'; import TelegramIcon from '@mui/icons-material/Telegram'; -import { BlocksRenderer } from '../../../apps/chat/components/message/blocks/BlocksRenderer'; - +import { BlocksRenderer } from '~/modules/blocks/BlocksRenderer'; import { llmStreamingChatGenerate } from '~/modules/llms/llm.client'; import { GoodModal } from '~/common/components/GoodModal'; diff --git a/src/apps/chat/components/message/blocks/BlocksRenderer.tsx b/src/modules/blocks/BlocksRenderer.tsx similarity index 98% rename from src/apps/chat/components/message/blocks/BlocksRenderer.tsx rename to src/modules/blocks/BlocksRenderer.tsx index 841e1ccac..85e6de1c2 100644 --- a/src/apps/chat/components/message/blocks/BlocksRenderer.tsx +++ b/src/modules/blocks/BlocksRenderer.tsx @@ -14,7 +14,7 @@ import { RenderHtml } from './RenderHtml'; import { RenderImage } from './RenderImage'; import { RenderLatex } from './RenderLatex'; import { RenderMarkdown, RenderMarkdownMemo } from './markdown/RenderMarkdown'; -import { RenderText } from './RenderText'; +import { RenderChatText } from './RenderChatText'; import { RenderTextDiff } from './RenderTextDiff'; import { areBlocksEqual, Block, parseMessageBlocks } from './blocks'; @@ -193,7 +193,7 @@ export function BlocksRenderer(props: { ? : (props.renderTextAsMarkdown && !fromSystem && !(fromUser && block.content.startsWith('/'))) ? - : ; + : ; }) )} diff --git a/src/apps/chat/components/message/blocks/RenderText.tsx b/src/modules/blocks/RenderChatText.tsx similarity index 85% rename from src/apps/chat/components/message/blocks/RenderText.tsx rename to src/modules/blocks/RenderChatText.tsx index 0bb5a44f6..9cf451a0b 100644 --- a/src/apps/chat/components/message/blocks/RenderText.tsx +++ b/src/modules/blocks/RenderChatText.tsx @@ -3,12 +3,12 @@ import * as React from 'react'; import { Chip, Typography } from '@mui/joy'; import { SxProps } from '@mui/joy/styles/types'; -import { extractChatCommand } from '../../../commands/commands.registry'; +import { extractChatCommand } from '../../apps/chat/commands/commands.registry'; import type { TextBlock } from './blocks'; -export const RenderText = (props: { textBlock: TextBlock; sx?: SxProps; }) => { +export const RenderChatText = (props: { textBlock: TextBlock; sx?: SxProps; }) => { const elements = extractChatCommand(props.textBlock.content); diff --git a/src/apps/chat/components/message/blocks/RenderHtml.tsx b/src/modules/blocks/RenderHtml.tsx similarity index 100% rename from src/apps/chat/components/message/blocks/RenderHtml.tsx rename to src/modules/blocks/RenderHtml.tsx diff --git a/src/apps/chat/components/message/blocks/RenderImage.tsx b/src/modules/blocks/RenderImage.tsx similarity index 100% rename from src/apps/chat/components/message/blocks/RenderImage.tsx rename to src/modules/blocks/RenderImage.tsx diff --git a/src/apps/chat/components/message/blocks/RenderLatex.tsx b/src/modules/blocks/RenderLatex.tsx similarity index 100% rename from src/apps/chat/components/message/blocks/RenderLatex.tsx rename to src/modules/blocks/RenderLatex.tsx diff --git a/src/apps/chat/components/message/blocks/RenderTextDiff.tsx b/src/modules/blocks/RenderTextDiff.tsx similarity index 100% rename from src/apps/chat/components/message/blocks/RenderTextDiff.tsx rename to src/modules/blocks/RenderTextDiff.tsx diff --git a/src/apps/chat/components/message/blocks/blocks.ts b/src/modules/blocks/blocks.ts similarity index 100% rename from src/apps/chat/components/message/blocks/blocks.ts rename to src/modules/blocks/blocks.ts diff --git a/src/apps/chat/components/message/blocks/code/ButtonCodePen.tsx b/src/modules/blocks/code/ButtonCodePen.tsx similarity index 100% rename from src/apps/chat/components/message/blocks/code/ButtonCodePen.tsx rename to src/modules/blocks/code/ButtonCodePen.tsx diff --git a/src/apps/chat/components/message/blocks/code/ButtonJSFiddle.tsx b/src/modules/blocks/code/ButtonJSFiddle.tsx similarity index 100% rename from src/apps/chat/components/message/blocks/code/ButtonJSFiddle.tsx rename to src/modules/blocks/code/ButtonJSFiddle.tsx diff --git a/src/apps/chat/components/message/blocks/code/ButtonStackBlitz.tsx b/src/modules/blocks/code/ButtonStackBlitz.tsx similarity index 100% rename from src/apps/chat/components/message/blocks/code/ButtonStackBlitz.tsx rename to src/modules/blocks/code/ButtonStackBlitz.tsx diff --git a/src/apps/chat/components/message/blocks/code/RenderCode.tsx b/src/modules/blocks/code/RenderCode.tsx similarity index 100% rename from src/apps/chat/components/message/blocks/code/RenderCode.tsx rename to src/modules/blocks/code/RenderCode.tsx diff --git a/src/apps/chat/components/message/blocks/code/RenderCodeMermaid.tsx b/src/modules/blocks/code/RenderCodeMermaid.tsx similarity index 100% rename from src/apps/chat/components/message/blocks/code/RenderCodeMermaid.tsx rename to src/modules/blocks/code/RenderCodeMermaid.tsx diff --git a/src/apps/chat/components/message/blocks/code/codePrism.ts b/src/modules/blocks/code/codePrism.ts similarity index 100% rename from src/apps/chat/components/message/blocks/code/codePrism.ts rename to src/modules/blocks/code/codePrism.ts diff --git a/src/apps/chat/components/message/blocks/markdown/CustomMarkdownRenderer.tsx b/src/modules/blocks/markdown/CustomMarkdownRenderer.tsx similarity index 100% rename from src/apps/chat/components/message/blocks/markdown/CustomMarkdownRenderer.tsx rename to src/modules/blocks/markdown/CustomMarkdownRenderer.tsx diff --git a/src/apps/chat/components/message/blocks/markdown/RenderMarkdown.tsx b/src/modules/blocks/markdown/RenderMarkdown.tsx similarity index 100% rename from src/apps/chat/components/message/blocks/markdown/RenderMarkdown.tsx rename to src/modules/blocks/markdown/RenderMarkdown.tsx