Add missing editor dependencies and fix build issues

This commit is contained in:
cloudneutral 2025-12-16 12:36:36 +08:00
parent 5d55c135ca
commit 79dcd071bb
11 changed files with 2865 additions and 30 deletions

2
next-env.d.ts vendored
View File

@ -1,6 +1,6 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />
import "./.next/dev/types/routes.d.ts";
import "./.next/types/routes.d.ts";
// NOTE: This file should not be edited
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.

View File

@ -20,14 +20,34 @@
"test:e2e": "playwright test --config tests/e2e/playwright.config.ts"
},
"dependencies": {
"@radix-ui/react-alert-dialog": "^1.1.2",
"@radix-ui/react-dialog": "^1.1.4",
"@radix-ui/react-dropdown-menu": "^2.1.2",
"@radix-ui/react-label": "^2.1.2",
"@radix-ui/react-scroll-area": "^1.1.0",
"@radix-ui/react-select": "^2.1.2",
"@radix-ui/react-separator": "^1.1.0",
"@radix-ui/react-slot": "^1.1.1",
"@radix-ui/react-tabs": "^1.1.1",
"@radix-ui/react-toast": "^1.2.1",
"@radix-ui/react-toggle": "^1.1.0",
"@radix-ui/react-tooltip": "^1.1.5",
"@tiptap/core": "^2.10.2",
"@tiptap/pm": "^2.10.2",
"@tiptap/react": "^2.10.2",
"@tiptap/starter-kit": "^2.10.2",
"class-variance-authority": "^0.7.1",
"dompurify": "^3.2.6",
"gray-matter": "^4.0.3",
"html2canvas": "^1.4.1",
"js-yaml": "^4.1.0",
"jszip": "^3.10.1",
"katex": "^0.16.27",
"lucide-react": "^0.319.0",
"marked": "^16.1.2",
"mermaid": "^11.4.1",
"next": "^16.0.9",
"next-themes": "^0.4.4",
"pdfjs-dist": "^4.2.67",
"prismjs": "^1.30.0",
"prop-types": "^15.8.1",
@ -40,6 +60,7 @@
"react-resizable": "^3.0.4",
"sanitize-html": "^2.13.0",
"swr": "^2.3.0",
"tailwind-merge": "^2.6.0",
"zustand": "^4.5.4"
},
"devDependencies": {
@ -51,6 +72,7 @@
"@testing-library/user-event": "^14.6.1",
"@types/js-yaml": "^4.0.9",
"@types/node": "24.0.3",
"@types/prismjs": "^1.26.3",
"@types/react": "^18.3.26",
"@types/react-grid-layout": "^1.3.5",
"@types/sanitize-html": "^2.16.0",

View File

@ -0,0 +1 @@
[]

View File

@ -0,0 +1 @@
{"providers":[],"services":[]}

View File

@ -0,0 +1 @@
[]

View File

@ -0,0 +1 @@
[]

View File

@ -20,20 +20,23 @@ interface WorkspaceGridProps {
draggableHandle?: string
}
const ReactGridLayout = dynamic<ReactGridLayoutProps>(
const ReactGridLayout = dynamic(
() =>
import('react-grid-layout').then(mod => {
const baseComponent = mod.default
const widthProvider = mod.WidthProvider ?? mod.default?.WidthProvider
const widthProvider = (mod as any).WidthProvider ?? (mod.default as any)?.WidthProvider
if (!widthProvider) {
if (!widthProvider || !baseComponent) {
throw new Error('Unable to load react-grid-layout WidthProvider')
}
return widthProvider(baseComponent)
const WrappedGrid = (widthProvider as any)(baseComponent as any)
const Adapter: React.ComponentType<ReactGridLayoutProps> = props => <WrappedGrid {...props} />
return Adapter as React.ComponentType<ReactGridLayoutProps>
}),
{ ssr: false }
)
) as React.ComponentType<ReactGridLayoutProps>
export function WorkspaceGrid({
layout,

View File

@ -1,3 +1,5 @@
'use client'
import EditorShell from '../../../dashboard/apps/cms-editor/EditorShell'
import { localDraftStore } from '../../../dashboard/apps/cms-editor/storage/local'
import { remoteDraftStore } from '../../../dashboard/apps/cms-editor/storage/remote'

View File

@ -1,11 +1,11 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
/* 导入模板样式与代码高亮主题 */
@import '../styles/templates/xiaohongshu.css';
@import '../styles/code-themes.css';
@tailwind base;
@tailwind components;
@tailwind utilities;
@layer base {
:root {
--background: 0 0% 100%;

View File

@ -18,14 +18,40 @@ export default {
// 主题扩展配置
theme: {
extend: {
// 字体配置
fontFamily: {
sans: ['var(--font-geist-sans)', 'sans-serif'],
mono: ['var(--font-geist-mono)', 'monospace'],
},
// 品牌色彩系统
colors: {
border: 'hsl(var(--border))',
input: 'hsl(var(--input))',
ring: 'hsl(var(--ring))',
background: 'hsl(var(--background))',
foreground: 'hsl(var(--foreground))',
primary: {
DEFAULT: 'hsl(var(--primary))',
foreground: 'hsl(var(--primary-foreground))',
},
secondary: {
DEFAULT: 'hsl(var(--secondary))',
foreground: 'hsl(var(--secondary-foreground))',
},
destructive: {
DEFAULT: 'hsl(var(--destructive))',
foreground: 'hsl(var(--destructive-foreground))',
},
muted: {
DEFAULT: 'hsl(var(--muted))',
foreground: 'hsl(var(--muted-foreground))',
},
accent: {
DEFAULT: 'hsl(var(--accent))',
foreground: 'hsl(var(--accent-foreground))',
},
popover: {
DEFAULT: 'hsl(var(--popover))',
foreground: 'hsl(var(--popover-foreground))',
},
card: {
DEFAULT: 'hsl(var(--card))',
foreground: 'hsl(var(--card-foreground))',
},
brand: {
DEFAULT: '#3366FF', // 主色
light: '#4D7AFF', // 浅色
@ -35,7 +61,12 @@ export default {
navy: '#1E2E55', // 海军蓝
heading: '#2E3A59', // 标题色
},
border: '#D6E0FF',
},
// 字体配置
fontFamily: {
sans: ['var(--font-geist-sans)', 'sans-serif'],
mono: ['var(--font-geist-mono)', 'monospace'],
},
// 自定义阴影

2797
yarn.lock

File diff suppressed because it is too large Load Diff