Single panel: outline tree with slots, node search with type filter
The outline and blocks are no longer tabs: one panel shows the outline tree, the new-block palette and a search over existing nodes. Outline rows drag to reorder (same snap engine, explicit gap targets), palette blocks and searched nodes drop onto the outline gaps as well as the page. Named slots (x-graph.connections, e.g. a pdp's info-section / 3d-accessories / model) render as groups under their block with allowed types, live counts and a slot-limited insert picker. Drops that fit no plain-children rule resolve to the first accepting slot; existing nodes link via graft tree.link. Adds Api.searchNodes, schema connections helpers, handle-aware controller ops (linkExisting, insertIntoSlot, dropExisting) and mock support for /api/nodes listing and graft links. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
This commit is contained in:
1 parent
a4ed99f13e
commit
33bd5269fd
16 files changed
+852
-110
No files matched your search
@@ -43,8 +43,8 @@ describe('node titles (x-graph.label)', () => {
|
||||
h = await setup()
|
||||
await h.settle()
|
||||
await h.settle()
|
||||
await h.press('Outline')
|
||||
const items = qa('.cms-outline li button')
|
||||
await h.press('Panel')
|
||||
const items = qa('.cms-orow__main')
|
||||
const s1 = items.find((b) => b.textContent!.includes('Welcome'))!
|
||||
expect(s1.querySelector('.cms-outline__type')!.textContent).toBe('Welcome')
|
||||
expect(s1.querySelector('.cms-outline__text')!.textContent).toBe('section')
|
||||
@@ -105,7 +105,7 @@ describe('groups in the UI', () => {
|
||||
it('the palette is grouped by x-graph.group (collapsible), blueprints last', async () => {
|
||||
h = await setup()
|
||||
await h.settle()
|
||||
await h.press('Blocks')
|
||||
await h.press('Panel')
|
||||
await h.settle()
|
||||
await h.settle()
|
||||
const secs = qa('.cms-group-sec')
|
||||
@@ -134,7 +134,7 @@ describe('the block list shows titles and groups straight from /api/types', () =
|
||||
it('seeds every schema from the one types request - no per-type schema fetches for the palette', async () => {
|
||||
h = await setup()
|
||||
await h.settle()
|
||||
await h.press('Blocks')
|
||||
await h.press('Panel')
|
||||
await h.settle()
|
||||
await h.settle()
|
||||
// /api/types carries each type's schema: types that are not on the page are never fetched individually
|
||||
@@ -147,7 +147,7 @@ describe('the block list shows titles and groups straight from /api/types', () =
|
||||
it('palette items show the schema title with the type id underneath (disambiguates look-alikes)', async () => {
|
||||
h = await setup()
|
||||
await h.settle()
|
||||
await h.press('Blocks')
|
||||
await h.press('Panel')
|
||||
await h.settle()
|
||||
const heading = q('.cms-block[data-type="heading"]')
|
||||
expect(heading.querySelector('span')!.textContent).toBe('Heading')
|
||||
@@ -162,7 +162,7 @@ describe('the block list shows titles and groups straight from /api/types', () =
|
||||
await h.settle()
|
||||
expect(h.editor.ctrl.isStaticRoot('page')).toBe(true)
|
||||
expect(h.editor.ctrl.isStaticRoot('heading')).toBe(false)
|
||||
await h.press('Blocks')
|
||||
await h.press('Panel')
|
||||
await h.settle()
|
||||
expect(qa('.cms-block[data-type="page"]')).toHaveLength(0)
|
||||
expect(qa('.cms-group-sec summary').map((s) => s.textContent)).not.toContain('Pages')
|
||||
|
||||
Reference in new issue
Block a user