feat(editor): build sidebar + slimmed items panel for standalone editor (#361)
Bring the open-source standalone editor closer to the community editor's v2 sidebar without pulling in any preset/catalog infrastructure. - Add a preset-less Build tab (apps/editor) that mirrors the community Build sidebar: wall, fence, slab, ceiling, roof, stair, elevator, door, window, column, spawn, plus the material-paint panel. Clicking a type activates the raw structure tool drawn with the kind's defaults. - Wire the Build tab into both editor mount points (local + saved scene) and give the left rail proper image icons (Scene/Build/Items/Settings) instead of letter fallbacks. - Gate the ItemsPanel Library/Community/Mine source chips and tag filter rows behind `showSourceFilter` / `showTagFilters` props (default true, so community and external consumers are unchanged). The standalone editor passes both off, leaving plain category tabs + full-width search. Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
7f49efce68
commit
e450d8b474
@@ -1,13 +1,22 @@
|
||||
'use client'
|
||||
|
||||
import { Editor, ItemsPanel } from '@pascal-app/editor'
|
||||
import { Layers, Package, Settings } from 'lucide-react'
|
||||
import { Hammer, Layers, Package, Settings } from 'lucide-react'
|
||||
import Image from 'next/image'
|
||||
import Link from 'next/link'
|
||||
import { BuildTab } from '@/components/build-tab'
|
||||
import {
|
||||
CommunityViewerToolbarLeft,
|
||||
CommunityViewerToolbarRight,
|
||||
} from '@/components/viewer-toolbar'
|
||||
|
||||
// The open-source editor only ships the built-in catalog (no uploaded items),
|
||||
// so the Library/Community/Mine source chips and tag filters add nothing —
|
||||
// drop them and keep the panel to plain categories.
|
||||
function EditorItemsPanel() {
|
||||
return <ItemsPanel showSourceFilter={false} showTagFilters={false} />
|
||||
}
|
||||
|
||||
const SIDEBAR_TABS = [
|
||||
{
|
||||
id: 'site',
|
||||
@@ -15,13 +24,47 @@ const SIDEBAR_TABS = [
|
||||
component: () => null,
|
||||
mobileDefaultSnap: 0.5,
|
||||
mobileIcon: <Layers className="h-5 w-5" />,
|
||||
icon: (
|
||||
<Image
|
||||
alt=""
|
||||
className="h-8 w-8 object-contain"
|
||||
height={32}
|
||||
src="/icons/scene.png"
|
||||
width={32}
|
||||
/>
|
||||
),
|
||||
},
|
||||
{
|
||||
id: 'build',
|
||||
label: 'Build',
|
||||
component: BuildTab,
|
||||
mobileDefaultSnap: 0.5,
|
||||
mobileIcon: <Hammer className="h-5 w-5" />,
|
||||
icon: (
|
||||
<Image
|
||||
alt=""
|
||||
className="h-8 w-8 object-contain"
|
||||
height={32}
|
||||
src="/icons/build.png"
|
||||
width={32}
|
||||
/>
|
||||
),
|
||||
},
|
||||
{
|
||||
id: 'items',
|
||||
label: 'Items',
|
||||
component: ItemsPanel,
|
||||
component: EditorItemsPanel,
|
||||
mobileDefaultSnap: 0.5,
|
||||
mobileIcon: <Package className="h-5 w-5" />,
|
||||
icon: (
|
||||
<Image
|
||||
alt=""
|
||||
className="h-8 w-8 object-contain"
|
||||
height={32}
|
||||
src="/icons/couch.png"
|
||||
width={32}
|
||||
/>
|
||||
),
|
||||
},
|
||||
{
|
||||
id: 'settings',
|
||||
@@ -29,6 +72,15 @@ const SIDEBAR_TABS = [
|
||||
component: () => null,
|
||||
mobileDefaultSnap: 0.5,
|
||||
mobileIcon: <Settings className="h-5 w-5" />,
|
||||
icon: (
|
||||
<Image
|
||||
alt=""
|
||||
className="h-8 w-8 object-contain"
|
||||
height={32}
|
||||
src="/icons/settings.png"
|
||||
width={32}
|
||||
/>
|
||||
),
|
||||
},
|
||||
]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user