@dxos/react-ui-mosaic 0.8.4-main.abd8ff62ef → 0.8.4-main.bc2380dfbc

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/LICENSE +102 -5
  2. package/dist/lib/browser/{chunk-TY4RYZ3H.mjs → chunk-3BMPGIWZ.mjs} +20 -10
  3. package/dist/lib/browser/chunk-3BMPGIWZ.mjs.map +7 -0
  4. package/dist/lib/browser/index.mjs +22 -24
  5. package/dist/lib/browser/index.mjs.map +3 -3
  6. package/dist/lib/browser/meta.json +1 -1
  7. package/dist/lib/browser/playwright/index.mjs +90 -7
  8. package/dist/lib/browser/playwright/index.mjs.map +3 -3
  9. package/dist/lib/browser/testing/index.mjs +1 -4
  10. package/dist/lib/browser/testing/index.mjs.map +2 -2
  11. package/dist/lib/node-esm/{chunk-25RXZ2RH.mjs → chunk-2UCLTU76.mjs} +20 -10
  12. package/dist/lib/node-esm/chunk-2UCLTU76.mjs.map +7 -0
  13. package/dist/lib/node-esm/index.mjs +22 -24
  14. package/dist/lib/node-esm/index.mjs.map +3 -3
  15. package/dist/lib/node-esm/meta.json +1 -1
  16. package/dist/lib/node-esm/playwright/index.mjs +90 -7
  17. package/dist/lib/node-esm/playwright/index.mjs.map +3 -3
  18. package/dist/lib/node-esm/testing/index.mjs +1 -4
  19. package/dist/lib/node-esm/testing/index.mjs.map +2 -2
  20. package/dist/types/src/components/Board/Board.d.ts +1 -1
  21. package/dist/types/src/components/Board/Column.d.ts +3 -3
  22. package/dist/types/src/components/Board/Column.d.ts.map +1 -1
  23. package/dist/types/src/components/Board/Item.d.ts +1 -1
  24. package/dist/types/src/components/Board/Item.d.ts.map +1 -1
  25. package/dist/types/src/components/Mosaic/Container.d.ts +8 -0
  26. package/dist/types/src/components/Mosaic/Container.d.ts.map +1 -1
  27. package/dist/types/src/components/Mosaic/Mosaic.d.ts +1 -0
  28. package/dist/types/src/components/Mosaic/Mosaic.d.ts.map +1 -1
  29. package/dist/types/src/components/Mosaic/Placeholder.d.ts.map +1 -1
  30. package/dist/types/src/components/Mosaic/Stack.d.ts.map +1 -1
  31. package/dist/types/src/components/Mosaic/Tile.d.ts +4 -0
  32. package/dist/types/src/components/Mosaic/Tile.d.ts.map +1 -1
  33. package/dist/types/src/playwright/board-manager.d.ts +12 -2
  34. package/dist/types/src/playwright/board-manager.d.ts.map +1 -1
  35. package/dist/types/src/testing/CardContainer.d.ts.map +1 -1
  36. package/dist/types/tsconfig.tsbuildinfo +1 -1
  37. package/package.json +31 -30
  38. package/src/components/Board/Board.stories.tsx +1 -1
  39. package/src/components/Board/Column.tsx +17 -15
  40. package/src/components/Board/Item.tsx +10 -7
  41. package/src/components/Mosaic/Container.tsx +17 -0
  42. package/src/components/Mosaic/Placeholder.tsx +6 -0
  43. package/src/components/Mosaic/Stack.tsx +5 -1
  44. package/src/components/Mosaic/Tile.tsx +8 -4
  45. package/src/hooks/useContainerDebug.tsx +1 -1
  46. package/src/playwright/board-manager.ts +138 -10
  47. package/src/playwright/smoke.spec.ts +3 -3
  48. package/src/testing/CardContainer.tsx +2 -5
  49. package/dist/lib/browser/chunk-TY4RYZ3H.mjs.map +0 -7
  50. package/dist/lib/node-esm/chunk-25RXZ2RH.mjs.map +0 -7
@@ -1,4 +1,5 @@
1
1
  // src/playwright/board-manager.ts
2
+ import { expect } from "@playwright/test";
2
3
  var BoardManager = class {
3
4
  locator;
4
5
  _page;
@@ -73,19 +74,101 @@ var ItemManager = class {
73
74
  async dragTo(target, offset = {
74
75
  x: 0,
75
76
  y: 0
76
- }) {
77
+ }, edge) {
77
78
  const handle = this.locator.getByTestId("mosaicBoard.cardDragHandle");
78
- const box = await target.boundingBox();
79
- if (box) {
80
- await handle.hover();
81
- await this._page.mouse.down();
82
- await this._page.waitForTimeout(100);
79
+ const handleBox = await handle.boundingBox();
80
+ if (!handleBox) {
81
+ return;
82
+ }
83
+ const targetHandle = await target.elementHandle();
84
+ const box = targetHandle ? await targetHandle.boundingBox() : null;
85
+ if (!targetHandle || !box) {
86
+ return;
87
+ }
88
+ const sourceHandle = await this.locator.elementHandle();
89
+ await handle.hover();
90
+ await this._page.mouse.down();
91
+ await this._page.waitForTimeout(100);
92
+ if (edge) {
93
+ await this._page.mouse.move(handleBox.x + handleBox.width / 2 + 1, handleBox.y + handleBox.height / 2, {
94
+ steps: 1
95
+ });
96
+ await this._page.mouse.move(box.x + box.width / 2, box.y + box.height / 2, {
97
+ steps: 4
98
+ });
99
+ await expect.poll(() => this._page.locator('[data-mosaic-container-state="active"]').count(), {
100
+ timeout: 2e3
101
+ }).toBeGreaterThan(0);
102
+ if (sourceHandle) {
103
+ await this._page.waitForFunction((el) => !el || !el.isConnected, sourceHandle, {
104
+ timeout: 2e3
105
+ });
106
+ }
107
+ const placeholderHandle = await this._adjacentPlaceholder(targetHandle, edge);
108
+ if (placeholderHandle) {
109
+ const phBox = await placeholderHandle.boundingBox();
110
+ if (phBox) {
111
+ const aimX = phBox.x + phBox.width / 2;
112
+ const aimY = phBox.y + Math.max(phBox.height / 2, 1);
113
+ await this._page.mouse.move(aimX, aimY, {
114
+ steps: 4
115
+ });
116
+ const isActive = () => placeholderHandle.evaluate((el) => el.getAttribute("data-mosaic-placeholder-state") === "active");
117
+ if (!await isActive()) {
118
+ const start = Date.now();
119
+ let nudge = 0;
120
+ while (Date.now() - start < 3e3) {
121
+ await this._page.waitForTimeout(100);
122
+ nudge = (nudge + 1) % 4;
123
+ const dx = nudge === 0 || nudge === 2 ? 1 : -1;
124
+ const dy = nudge === 1 || nudge === 2 ? 1 : -1;
125
+ await this._page.mouse.move(aimX + dx, aimY + dy, {
126
+ steps: 1
127
+ });
128
+ if (await isActive()) {
129
+ break;
130
+ }
131
+ }
132
+ await expect.poll(() => placeholderHandle.evaluate((el) => el.getAttribute("data-mosaic-placeholder-state")), {
133
+ timeout: 1e3
134
+ }).toBe("active");
135
+ }
136
+ const expanded = await placeholderHandle.boundingBox();
137
+ if (expanded) {
138
+ await this._page.mouse.move(expanded.x + expanded.width / 2, expanded.y + expanded.height / 2, {
139
+ steps: 2
140
+ });
141
+ }
142
+ }
143
+ }
144
+ } else {
83
145
  await this._page.mouse.move(offset.x + box.x + box.width / 2, offset.y + box.y + box.height / 2, {
84
146
  steps: 4
85
147
  });
86
148
  await this._page.waitForTimeout(100);
87
- await this._page.mouse.up();
88
149
  }
150
+ await this._page.mouse.up();
151
+ }
152
+ /**
153
+ * Find the placeholder element adjacent to `target` on the requested
154
+ * side via DOM walk. Returns `null` if the target has no matching
155
+ * sibling (e.g. when the caller passes a non-tile target).
156
+ */
157
+ async _adjacentPlaceholder(targetHandle, edge) {
158
+ const before = edge === "top" || edge === "left";
159
+ const result = await targetHandle.evaluateHandle((el, beforeArg) => {
160
+ let sibling = beforeArg ? el.previousElementSibling : el.nextElementSibling;
161
+ while (sibling && !sibling.hasAttribute("data-mosaic-placeholder-location")) {
162
+ sibling = beforeArg ? sibling.previousElementSibling : sibling.nextElementSibling;
163
+ }
164
+ return sibling;
165
+ }, before);
166
+ const handle = result.asElement();
167
+ if (!handle) {
168
+ return null;
169
+ }
170
+ const exists = await handle.evaluate((el) => el !== null);
171
+ return exists ? handle : null;
89
172
  }
90
173
  /**
91
174
  * Drag this item to a column's scroll bottom, hold to trigger auto-scroll,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/playwright/board-manager.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport type { Locator, Page } from '@playwright/test';\n\nexport class BoardManager {\n private readonly _page: Page;\n\n constructor(readonly locator: Locator) {\n this._page = locator.page();\n }\n\n columns(): Locator {\n return this.locator.getByTestId('board-column');\n }\n\n column(index: number): ColumnManager {\n return new ColumnManager(this.locator.getByTestId('board-column').nth(index));\n }\n}\n\nexport class ColumnManager {\n private readonly _page: Page;\n\n constructor(readonly locator: Locator) {\n this._page = locator.page();\n }\n\n items(): Locator {\n return this.locator.getByTestId('board-item');\n }\n\n item(index: number): ItemManager {\n return new ItemManager(this.locator.getByTestId('board-item').nth(index));\n }\n\n async addItem(): Promise<void> {\n await this.locator.getByTestId('board-column-add-item').click();\n }\n\n header(): Locator {\n return this.locator.getByTestId('board-column-header');\n }\n\n title(): Locator {\n return this.locator.getByTestId('mosaicBoard.columnTitle');\n }\n\n async dragTo(target: Locator, offset = { x: 0, y: 0 }): Promise<void> {\n const handle = this.header().getByTestId('mosaicBoard.columnDragHandle');\n const handleBox = await handle.boundingBox();\n if (!handleBox) {\n return;\n }\n\n await handle.hover();\n await this._page.mouse.down();\n // Small initial movement to trigger the native drag start.\n await this._page.mouse.move(handleBox.x + handleBox.width / 2 + 1, handleBox.y + handleBox.height / 2, {\n steps: 1,\n });\n // Allow the drag monitor to register and the DOM to settle\n // (the dragged column is removed from visible items, shifting remaining columns).\n await this._page.waitForTimeout(200);\n const box = await target.boundingBox();\n if (box) {\n await this._page.mouse.move(offset.x + box.x + box.width / 2, offset.y + box.y + box.height / 2, { steps: 4 });\n // Allow the drop target to process the hover before releasing.\n await this._page.waitForTimeout(100);\n await this._page.mouse.up();\n }\n }\n}\n\nexport class ItemManager {\n private readonly _page: Page;\n\n constructor(readonly locator: Locator) {\n this._page = locator.page();\n }\n\n title(): Locator {\n return this.locator.getByTestId('mosaicBoard.cardTitle');\n }\n\n async dragTo(target: Locator, offset = { x: 0, y: 0 }): Promise<void> {\n const handle = this.locator.getByTestId('mosaicBoard.cardDragHandle');\n const box = await target.boundingBox();\n if (box) {\n await handle.hover();\n await this._page.mouse.down();\n // Allow the drag monitor to register the grab before moving.\n await this._page.waitForTimeout(100);\n await this._page.mouse.move(offset.x + box.x + box.width / 2, offset.y + box.y + box.height / 2, { steps: 4 });\n // Allow the drop target to process the hover before releasing.\n await this._page.waitForTimeout(100);\n await this._page.mouse.up();\n }\n }\n\n /**\n * Drag this item to a column's scroll bottom, hold to trigger auto-scroll,\n * then wait for the drop target to become visible and drop on it.\n *\n * @param holdTarget - The footer element; mouse is held ~20px above it to trigger auto-scroll.\n * @param dropTarget - The element to drop on once it scrolls into view.\n * @param dropOffset - Offset from the drop target center.\n */\n async dragToEndWithAutoScroll(holdTarget: Locator, dropTarget: Locator, dropOffset = { x: 0, y: 0 }): Promise<void> {\n const handle = this.locator.getByTestId('mosaicBoard.cardDragHandle');\n const holdBox = await holdTarget.boundingBox();\n if (!holdBox) {\n return;\n }\n\n // The hold position is ~20px above the footer to trigger pragmatic auto-scroll.\n const holdX = holdBox.x + holdBox.width / 2;\n const holdY = holdBox.y - 20;\n\n await handle.hover();\n await this._page.mouse.down();\n // Allow the drag monitor to register the grab before moving.\n await this._page.waitForTimeout(100);\n\n // Move to hold position above the footer to trigger auto-scroll.\n await this._page.mouse.move(holdX, holdY, { steps: 4 });\n\n // Hold and nudge mouse periodically to keep auto-scroll active until drop target is visible.\n for (let i = 0; i < 40; i++) {\n // Wait between nudges to give auto-scroll time to advance.\n await this._page.waitForTimeout(200);\n // Small nudge to keep drag events firing (auto-scroll stalls without movement).\n await this._page.mouse.move(holdX + (i % 2), holdY, { steps: 1 });\n\n const dropBox = await dropTarget.boundingBox();\n if (dropBox && dropBox.y + dropBox.height < holdY) {\n // Drop target has scrolled into view. Re-read box so we use current position (scroll may have moved it).\n const finalBox = await dropTarget.boundingBox();\n if (!finalBox) {\n await this._page.mouse.up();\n return;\n }\n\n const dropX = dropOffset.x + finalBox.x + finalBox.width / 2;\n const dropY = dropOffset.y + finalBox.y + finalBox.height / 2;\n await this._page.mouse.move(dropX, dropY, { steps: 8 });\n // Let drop target receive dragOver and settle (headless is faster; needs a moment to register).\n await dropTarget.waitFor({ state: 'visible' });\n await this._page.waitForTimeout(200);\n await this._page.mouse.up();\n return;\n }\n }\n\n // Fallback: drop wherever we are.\n await this._page.mouse.up();\n }\n}\n"],
5
- "mappings": ";AAMO,IAAMA,eAAN,MAAMA;;EACMC;EAEjB,YAAqBC,SAAkB;SAAlBA,UAAAA;AACnB,SAAKD,QAAQC,Q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;AAC1C,UAAMY,QAAQF,QAAQlB,IAAI;AAE1B,UAAMC,OAAOG,MAAK;AAClB,UAAM,KAAKxB,MAAMyB,MAAMC,KAAI;AAE3B,UAAM,KAAK1B,MAAM+B,eAAe,GAAA;AAGhC,UAAM,KAAK/B,MAAMyB,MAAME,KAAKY,OAAOC,OAAO;MAAEV,OAAO;IAAE,CAAA;AAGrD,aAASW,IAAI,GAAGA,IAAI,IAAIA,KAAK;AAE3B,YAAM,KAAKzC,MAAM+B,eAAe,GAAA;AAEhC,YAAM,KAAK/B,MAAMyB,MAAME,KAAKY,QAASE,IAAI,GAAID,OAAO;QAAEV,OAAO;MAAE,CAAA;AAE/D,YAAMY,UAAU,MAAMN,WAAWb,YAAW;AAC5C,UAAImB,WAAWA,QAAQtB,IAAIsB,QAAQb,SAASW,OAAO;AAEjD,cAAMG,WAAW,MAAMP,WAAWb,YAAW;AAC7C,YAAI,CAACoB,UAAU;AACb,gBAAM,KAAK3C,MAAMyB,MAAMQ,GAAE;AACzB;QACF;AAEA,cAAMW,QAAQP,WAAWlB,IAAIwB,SAASxB,IAAIwB,SAASf,QAAQ;AAC3D,cAAMiB,QAAQR,WAAWjB,IAAIuB,SAASvB,IAAIuB,SAASd,SAAS;AAC5D,cAAM,KAAK7B,MAAMyB,MAAME,KAAKiB,OAAOC,OAAO;UAAEf,OAAO;QAAE,CAAA;AAErD,cAAMM,WAAWU,QAAQ;UAAEC,OAAO;QAAU,CAAA;AAC5C,cAAM,KAAK/C,MAAM+B,eAAe,GAAA;AAChC,cAAM,KAAK/B,MAAMyB,MAAMQ,GAAE;AACzB;MACF;IACF;AAGA,UAAM,KAAKjC,MAAMyB,MAAMQ,GAAE;EAC3B;AACF;",
6
- "names": ["BoardManager", "_page", "locator", "page", "columns", "getByTestId", "column", "index", "ColumnManager", "nth", "items", "item", "ItemManager", "addItem", "click", "header", "title", "dragTo", "target", "offset", "x", "y", "handle", "handleBox", "boundingBox", "hover", "mouse", "down", "move", "width", "height", "steps", "waitForTimeout", "box", "up", "dragToEndWithAutoScroll", "holdTarget", "dropTarget", "dropOffset", "holdBox", "holdX", "holdY", "i", "dropBox", "finalBox", "dropX", "dropY", "waitFor", "state"]
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { type Locator, type Page, expect } from '@playwright/test';\n\n/**\n * Edge of the target tile to drop on. Pragmatic-dnd assigns the closest edge\n * based on cursor position; a stale (pre-layout-shift) cursor can land in the\n * wrong half. When `dragTo` is called with an `edge`, the helper waits for the\n * target tile to register the drag, re-measures the target after the\n * placeholder has expanded, repositions the cursor near the requested edge,\n * and confirms via `data-mosaic-tile-edge` before releasing.\n */\nexport type DragEdge = 'top' | 'bottom' | 'left' | 'right';\n\nexport class BoardManager {\n private readonly _page: Page;\n\n constructor(readonly locator: Locator) {\n this._page = locator.page();\n }\n\n columns(): Locator {\n return this.locator.getByTestId('board-column');\n }\n\n column(index: number): ColumnManager {\n return new ColumnManager(this.locator.getByTestId('board-column').nth(index));\n }\n}\n\nexport class ColumnManager {\n private readonly _page: Page;\n\n constructor(readonly locator: Locator) {\n this._page = locator.page();\n }\n\n items(): Locator {\n return this.locator.getByTestId('board-item');\n }\n\n item(index: number): ItemManager {\n return new ItemManager(this.locator.getByTestId('board-item').nth(index));\n }\n\n async addItem(): Promise<void> {\n await this.locator.getByTestId('board-column-add-item').click();\n }\n\n header(): Locator {\n return this.locator.getByTestId('board-column-header');\n }\n\n title(): Locator {\n return this.locator.getByTestId('mosaicBoard.columnTitle');\n }\n\n async dragTo(target: Locator, offset = { x: 0, y: 0 }): Promise<void> {\n const handle = this.header().getByTestId('mosaicBoard.columnDragHandle');\n const handleBox = await handle.boundingBox();\n if (!handleBox) {\n return;\n }\n\n await handle.hover();\n await this._page.mouse.down();\n // Small initial movement to trigger the native drag start.\n await this._page.mouse.move(handleBox.x + handleBox.width / 2 + 1, handleBox.y + handleBox.height / 2, {\n steps: 1,\n });\n // Allow the drag monitor to register and the DOM to settle\n // (the dragged column is removed from visible items, shifting remaining columns).\n await this._page.waitForTimeout(200);\n const box = await target.boundingBox();\n if (box) {\n await this._page.mouse.move(offset.x + box.x + box.width / 2, offset.y + box.y + box.height / 2, { steps: 4 });\n // Allow the drop target to process the hover before releasing.\n await this._page.waitForTimeout(100);\n await this._page.mouse.up();\n }\n }\n}\n\nexport class ItemManager {\n private readonly _page: Page;\n\n constructor(readonly locator: Locator) {\n this._page = locator.page();\n }\n\n title(): Locator {\n return this.locator.getByTestId('mosaicBoard.cardTitle');\n }\n\n async dragTo(target: Locator, offset: { x: number; y: number } = { x: 0, y: 0 }, edge?: DragEdge): Promise<void> {\n const handle = this.locator.getByTestId('mosaicBoard.cardDragHandle');\n const handleBox = await handle.boundingBox();\n if (!handleBox) {\n return;\n }\n\n // Capture stable ElementHandles to source and target before the drag\n // begins. Both `nth(N)` locators shift when `useVisibleItems` filters the\n // source out of its column, so we need raw DOM references that survive\n // the reconciliation.\n const targetHandle = await target.elementHandle();\n const box = targetHandle ? await targetHandle.boundingBox() : null;\n if (!targetHandle || !box) {\n return;\n }\n const sourceHandle = await this.locator.elementHandle();\n\n await handle.hover();\n await this._page.mouse.down();\n // Allow the drag monitor to register the grab before moving.\n await this._page.waitForTimeout(100);\n\n if (edge) {\n // Stage 1: trigger the dragstart. A 1-pixel nudge near the press\n // point primes pragmatic-dnd's HTML5 dragstart, then a long move\n // over the target tile commits the drag past every browser's\n // \"click vs drag\" threshold.\n await this._page.mouse.move(handleBox.x + handleBox.width / 2 + 1, handleBox.y + handleBox.height / 2, {\n steps: 1,\n });\n await this._page.mouse.move(box.x + box.width / 2, box.y + box.height / 2, { steps: 4 });\n\n // Wait for `data-mosaic-container-state=\"active\"` so we know the\n // dragstart has been processed. This alone is *not* enough: pragmatic-\n // dnd's `monitorForElements.onDragStart` (Root.tsx) and the\n // `dropTargetForElements.onDragStart` (Container.tsx) write into\n // independent React state, and only the latter drives the attribute.\n // The former drives `useVisibleItems` filtering, which is what\n // physically reflows the column. So we ALSO wait for the source tile\n // to detach from the DOM — that's the unambiguous signal that the\n // reflow has happened and any cached bbox is stale.\n await expect\n .poll(() => this._page.locator('[data-mosaic-container-state=\"active\"]').count(), { timeout: 2000 })\n .toBeGreaterThan(0);\n if (sourceHandle) {\n await this._page.waitForFunction((el) => !el || !el.isConnected, sourceHandle, { timeout: 2000 });\n }\n\n // Stage 2: walk siblings on the (now reflowed) drag-time DOM and aim\n // at the placeholder representing the requested edge. The Fragment\n // keying on item id keeps the target tile's adjacent placeholder DOM\n // node stable across reconciliation, but its `location` prop and bbox\n // both change once the source is filtered out — measure after the\n // reflow, never before.\n const placeholderHandle = await this._adjacentPlaceholder(targetHandle, edge);\n if (placeholderHandle) {\n const phBox = await placeholderHandle.boundingBox();\n if (phBox) {\n const aimX = phBox.x + phBox.width / 2;\n const aimY = phBox.y + Math.max(phBox.height / 2, 1);\n await this._page.mouse.move(aimX, aimY, { steps: 4 });\n\n // Some browser/CDP combinations need a follow-up nudge to push\n // the dragOver event through — re-aim with a 1px offset and poll.\n const isActive = () =>\n placeholderHandle.evaluate((el) => el.getAttribute('data-mosaic-placeholder-state') === 'active');\n if (!(await isActive())) {\n const start = Date.now();\n let nudge = 0;\n while (Date.now() - start < 3000) {\n await this._page.waitForTimeout(100);\n nudge = (nudge + 1) % 4;\n const dx = nudge === 0 || nudge === 2 ? 1 : -1;\n const dy = nudge === 1 || nudge === 2 ? 1 : -1;\n await this._page.mouse.move(aimX + dx, aimY + dy, { steps: 1 });\n if (await isActive()) {\n break;\n }\n }\n await expect\n .poll(() => placeholderHandle.evaluate((el) => el.getAttribute('data-mosaic-placeholder-state')), {\n timeout: 1000,\n })\n .toBe('active');\n }\n\n // Re-centre on the now-expanded placeholder so the drop lands\n // solidly inside it.\n const expanded = await placeholderHandle.boundingBox();\n if (expanded) {\n await this._page.mouse.move(expanded.x + expanded.width / 2, expanded.y + expanded.height / 2, {\n steps: 2,\n });\n }\n }\n }\n } else {\n // Legacy path: no explicit edge — rely on the offset placement and a\n // small settle delay before releasing.\n await this._page.mouse.move(offset.x + box.x + box.width / 2, offset.y + box.y + box.height / 2, { steps: 4 });\n await this._page.waitForTimeout(100);\n }\n await this._page.mouse.up();\n }\n\n /**\n * Find the placeholder element adjacent to `target` on the requested\n * side via DOM walk. Returns `null` if the target has no matching\n * sibling (e.g. when the caller passes a non-tile target).\n */\n private async _adjacentPlaceholder(\n targetHandle: import('@playwright/test').ElementHandle<Element | SVGElement | HTMLElement>,\n edge: DragEdge,\n ): Promise<import('@playwright/test').ElementHandle<HTMLElement> | null> {\n const before = edge === 'top' || edge === 'left';\n const result = await targetHandle.evaluateHandle((el, beforeArg) => {\n let sibling: Element | null = beforeArg ? el.previousElementSibling : el.nextElementSibling;\n while (sibling && !sibling.hasAttribute('data-mosaic-placeholder-location')) {\n sibling = beforeArg ? sibling.previousElementSibling : sibling.nextElementSibling;\n }\n return sibling as HTMLElement | null;\n }, before);\n const handle = result.asElement() as import('@playwright/test').ElementHandle<HTMLElement> | null;\n if (!handle) {\n return null;\n }\n // `evaluateHandle` returning `null` still produces a non-null JSHandle —\n // verify the underlying element actually exists.\n const exists = await handle.evaluate((el) => el !== null);\n return exists ? handle : null;\n }\n\n /**\n * Drag this item to a column's scroll bottom, hold to trigger auto-scroll,\n * then wait for the drop target to become visible and drop on it.\n *\n * @param holdTarget - The footer element; mouse is held ~20px above it to trigger auto-scroll.\n * @param dropTarget - The element to drop on once it scrolls into view.\n * @param dropOffset - Offset from the drop target center.\n */\n async dragToEndWithAutoScroll(holdTarget: Locator, dropTarget: Locator, dropOffset = { x: 0, y: 0 }): Promise<void> {\n const handle = this.locator.getByTestId('mosaicBoard.cardDragHandle');\n const holdBox = await holdTarget.boundingBox();\n if (!holdBox) {\n return;\n }\n\n // The hold position is ~20px above the footer to trigger pragmatic auto-scroll.\n const holdX = holdBox.x + holdBox.width / 2;\n const holdY = holdBox.y - 20;\n\n await handle.hover();\n await this._page.mouse.down();\n // Allow the drag monitor to register the grab before moving.\n await this._page.waitForTimeout(100);\n\n // Move to hold position above the footer to trigger auto-scroll.\n await this._page.mouse.move(holdX, holdY, { steps: 4 });\n\n // Hold and nudge mouse periodically to keep auto-scroll active until drop target is visible.\n for (let i = 0; i < 40; i++) {\n // Wait between nudges to give auto-scroll time to advance.\n await this._page.waitForTimeout(200);\n // Small nudge to keep drag events firing (auto-scroll stalls without movement).\n await this._page.mouse.move(holdX + (i % 2), holdY, { steps: 1 });\n\n const dropBox = await dropTarget.boundingBox();\n if (dropBox && dropBox.y + dropBox.height < holdY) {\n // Drop target has scrolled into view. Re-read box so we use current position (scroll may have moved it).\n const finalBox = await dropTarget.boundingBox();\n if (!finalBox) {\n await this._page.mouse.up();\n return;\n }\n\n const dropX = dropOffset.x + finalBox.x + finalBox.width / 2;\n const dropY = dropOffset.y + finalBox.y + finalBox.height / 2;\n await this._page.mouse.move(dropX, dropY, { steps: 8 });\n // Let drop target receive dragOver and settle (headless is faster; needs a moment to register).\n await dropTarget.waitFor({ state: 'visible' });\n await this._page.waitForTimeout(200);\n await this._page.mouse.up();\n return;\n }\n }\n\n // Fallback: drop wherever we are.\n await this._page.mouse.up();\n }\n}\n"],
5
+ "mappings": ";AAIA,SAAkCA,cAAc;AAYzC,IAAMC,eAAN,MAAMA;;EACMC;EAEjB,YAAqBC,SAAkB;SAAlBA,UAAAA;AACnB,SAAKD,QAAQC,QAAQC,KAAI;EAC3B;EAEAC,UAAmB;AACjB,WAAO,KAAKF,QAAQG,YAAY,cAAA;EAClC;EAEAC,OAAOC,OAA8B;AACnC,WAAO,IAAIC,cAAc,KAAKN,QAAQG,YAAY,cAAA,EAAgBI,IAAIF,KAAAA,CAAAA;EACxE;AACF;AAEO,IAAMC,gBAAN,MAAMA;;EACMP;EAEjB,YAAqBC,SAAkB;SAAlBA,UAAAA;AACnB,SAAKD,QAAQC,QAAQC,KAAI;EAC3B;EAEAO,QAAiB;AACf,WAAO,KAAKR,QAAQG,YAAY,YAAA;EAClC;EAEAM,KAAKJ,OAA4B;AAC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D,OAAO;IAAE,CAAA;AAGrD,aAASkD,IAAI,GAAGA,IAAI,IAAIA,KAAK;AAE3B,YAAM,KAAKhF,MAAM+B,eAAe,GAAA;AAEhC,YAAM,KAAK/B,MAAMyB,MAAME,KAAKmD,QAASE,IAAI,GAAID,OAAO;QAAEjD,OAAO;MAAE,CAAA;AAE/D,YAAMmD,UAAU,MAAMN,WAAWpD,YAAW;AAC5C,UAAI0D,WAAWA,QAAQ7D,IAAI6D,QAAQpD,SAASkD,OAAO;AAEjD,cAAMG,WAAW,MAAMP,WAAWpD,YAAW;AAC7C,YAAI,CAAC2D,UAAU;AACb,gBAAM,KAAKlF,MAAMyB,MAAMQ,GAAE;AACzB;QACF;AAEA,cAAMkD,QAAQP,WAAWzD,IAAI+D,SAAS/D,IAAI+D,SAAStD,QAAQ;AAC3D,cAAMwD,QAAQR,WAAWxD,IAAI8D,SAAS9D,IAAI8D,SAASrD,SAAS;AAC5D,cAAM,KAAK7B,MAAMyB,MAAME,KAAKwD,OAAOC,OAAO;UAAEtD,OAAO;QAAE,CAAA;AAErD,cAAM6C,WAAWU,QAAQ;UAAEC,OAAO;QAAU,CAAA;AAC5C,cAAM,KAAKtF,MAAM+B,eAAe,GAAA;AAChC,cAAM,KAAK/B,MAAMyB,MAAMQ,GAAE;AACzB;MACF;IACF;AAGA,UAAM,KAAKjC,MAAMyB,MAAMQ,GAAE;EAC3B;AACF;",
6
+ "names": ["expect", "BoardManager", "_page", "locator", "page", "columns", "getByTestId", "column", "index", "ColumnManager", "nth", "items", "item", "ItemManager", "addItem", "click", "header", "title", "dragTo", "target", "offset", "x", "y", "handle", "handleBox", "boundingBox", "hover", "mouse", "down", "move", "width", "height", "steps", "waitForTimeout", "box", "up", "edge", "targetHandle", "elementHandle", "sourceHandle", "poll", "count", "timeout", "toBeGreaterThan", "waitForFunction", "el", "isConnected", "placeholderHandle", "_adjacentPlaceholder", "phBox", "aimX", "aimY", "Math", "max", "isActive", "evaluate", "getAttribute", "start", "Date", "now", "nudge", "dx", "dy", "toBe", "expanded", "before", "result", "evaluateHandle", "beforeArg", "sibling", "previousElementSibling", "nextElementSibling", "hasAttribute", "asElement", "exists", "dragToEndWithAutoScroll", "holdTarget", "dropTarget", "dropOffset", "holdBox", "holdX", "holdY", "i", "dropBox", "finalBox", "dropX", "dropY", "waitFor", "state"]
7
7
  }
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  Focus,
3
3
  Mosaic
4
- } from "../chunk-TY4RYZ3H.mjs";
4
+ } from "../chunk-3BMPGIWZ.mjs";
5
5
 
6
6
  // src/testing/decorator.tsx
7
7
  import React from "react";
@@ -41,7 +41,6 @@ var CardContainer = ({ children, role, icon = "ph--arrow-line-down--regular" })
41
41
  switch (role) {
42
42
  case "popover":
43
43
  return /* @__PURE__ */ React2.createElement("div", {
44
- role: "none",
45
44
  className: "flex justify-center"
46
45
  }, /* @__PURE__ */ React2.createElement(PopoverCardContainer, {
47
46
  icon
@@ -71,12 +70,10 @@ var IntrinsicCardContainer = ({ children, defaultSize, size: propSize, onSizeCha
71
70
  onChange: onSizeChange
72
71
  });
73
72
  return /* @__PURE__ */ React2.createElement("div", {
74
- role: "none",
75
73
  className: "relative p-2 grid overflow-hidden border-2 border-dashed border-green-500 rounded-lg",
76
74
  style: sizeStyle(size, "horizontal"),
77
75
  ...resizeAttributes
78
76
  }, /* @__PURE__ */ React2.createElement("div", {
79
- role: "none",
80
77
  className: "dx-container flex flex-col"
81
78
  }, children), /* @__PURE__ */ React2.createElement(ResizeHandle, {
82
79
  side: "inline-end",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/testing/decorator.tsx", "../../../../src/testing/types.ts", "../../../../src/testing/CardContainer.tsx", "../../../../src/testing/DefaultStackTile.tsx"],
4
- "sourcesContent": ["//\n// Copyright 2026 DXOS.org\n//\n\nimport { type Decorator } from '@storybook/react-vite';\nimport React from 'react';\n\nimport { Mosaic } from '../components';\n\nexport const withMosaic = (): Decorator => {\n return (Story) => (\n <Mosaic.Root>\n <Story />\n </Mosaic.Root>\n );\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { Ref, Type } from '@dxos/echo';\nimport { ObjectId } from '@dxos/keys';\n\n//\n// Test Data\n//\n\nexport const TestItem = Schema.Struct({\n name: Schema.String,\n description: Schema.optional(Schema.String),\n label: Schema.optional(Schema.String),\n}).pipe(\n Type.object({\n typename: 'com.example.type.item',\n version: '0.1.0',\n }),\n);\n\nexport interface TestItem extends Schema.Schema.Type<typeof TestItem> {}\n\nexport const TestColumn = Schema.Struct({\n id: ObjectId,\n name: Schema.String,\n items: Schema.mutable(Schema.Array(Ref.Ref(TestItem))),\n}).pipe(\n Type.object({\n typename: 'com.example.type.column',\n version: '0.1.0',\n }),\n);\n\nexport interface TestColumn extends Schema.Schema.Type<typeof TestColumn> {}\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport React, { type PropsWithChildren } from 'react';\n\nimport { Icon, Popover } from '@dxos/react-ui';\nimport { ResizeHandle, type Size, resizeAttributes, sizeStyle } from '@dxos/react-ui-dnd';\n\nconst DEFAULT_BLOCK_SIZE = 22;\nconst MIN_BLOCK_SIZE = 8;\n\n//\n// Card container.\n//\n\nexport type CardContainerProps = PropsWithChildren<{ role?: 'popover' | 'intrinsic'; icon?: string }>;\n\nexport const CardContainer = ({ children, role, icon = 'ph--arrow-line-down--regular' }: CardContainerProps) => {\n switch (role) {\n case 'popover':\n return (\n <div role='none' className='flex justify-center'>\n <PopoverCardContainer icon={icon}>{children}</PopoverCardContainer>\n </div>\n );\n case 'intrinsic':\n default:\n return <IntrinsicCardContainer>{children}</IntrinsicCardContainer>;\n }\n};\n\n//\n// Popover\n//\n\nexport type PopoverCardContainerProps = PropsWithChildren<{ icon?: string }>;\n\nexport const PopoverCardContainer = ({\n children,\n icon = 'ph--arrow-line-down--regular',\n}: PopoverCardContainerProps) => {\n return (\n <Popover.Root open>\n <Popover.Trigger asChild>\n <Icon icon={icon} />\n </Popover.Trigger>\n <Popover.Portal>\n <Popover.Content onOpenAutoFocus={(event: Event) => event.preventDefault()}>\n <Popover.Viewport classNames='dx-card-popover'>{children}</Popover.Viewport>\n <Popover.Arrow />\n </Popover.Content>\n </Popover.Portal>\n </Popover.Root>\n );\n};\n\n//\n// Intrinsic card container (size constrained by card itself).\n//\n\nexport type IntrinsicCardContainerProps = PropsWithChildren<{\n defaultSize?: Size;\n size?: Size;\n onSizeChange?: (size: Size, commit?: boolean) => void;\n}>;\n\nexport const IntrinsicCardContainer = ({\n children,\n defaultSize,\n size: propSize,\n onSizeChange,\n}: IntrinsicCardContainerProps) => {\n const [size = DEFAULT_BLOCK_SIZE, setSize] = useControllableState<Size>({\n prop: propSize,\n defaultProp: defaultSize,\n onChange: onSizeChange,\n });\n\n return (\n <div\n role='none'\n className='relative p-2 grid overflow-hidden border-2 border-dashed border-green-500 rounded-lg'\n style={sizeStyle(size, 'horizontal')}\n {...resizeAttributes}\n >\n <div role='none' className='dx-container flex flex-col'>\n {children}\n </div>\n <ResizeHandle\n side='inline-end'\n fallbackSize={DEFAULT_BLOCK_SIZE}\n minSize={MIN_BLOCK_SIZE}\n size={size}\n onSizeChange={setSize}\n />\n </div>\n );\n};\n", "//\n// Copyright 2026 DXOS.org\n//\n\nimport React, { useMemo, useRef, useState } from 'react';\n\nimport { Obj } from '@dxos/echo';\nimport { Card, Toolbar } from '@dxos/react-ui';\nimport { Menu, createMenuAction } from '@dxos/react-ui-menu';\nimport { JsonHighlighter } from '@dxos/react-ui-syntax-highlighter';\n\nimport { Focus, Mosaic, type MosaicStackTileComponent } from '../components';\n\nexport const DefaultStackTile: MosaicStackTileComponent<Obj.Any> = (props) => {\n const dragHandleRef = useRef<HTMLButtonElement>(null);\n const [open, setOpen] = useState(false);\n const menuItems = useMemo(\n () => [\n createMenuAction('toggle-details', () => setOpen((prev) => !prev), {\n label: open ? 'Hide details' : 'Show details',\n icon: 'ph--placeholder--regular',\n }),\n ],\n [open],\n );\n\n return (\n <Menu.Root>\n {/*\n * `Mosaic.Tile` sets `aria-current` from `props.current`, which the\n * Slot composition propagates down to `Card.Root`'s div. That's what\n * makes `dx-current` (an `aria-[current=true]:` utility) actually\n * fire here. See `ui-theme/src/css/components/selected.md`.\n */}\n <Mosaic.Tile {...props} asChild>\n <Focus.Item asChild>\n <Card.Root className='dx-current dx-hover'>\n <Card.Toolbar>\n <Card.DragHandle ref={dragHandleRef} />\n <Card.Title>{Obj.getLabel(props.data) ?? props.data.id}</Card.Title>\n <Menu.Trigger asChild disabled={!menuItems?.length}>\n <Toolbar.IconButton iconOnly variant='ghost' icon='ph--dots-three-vertical--regular' label='Menu' />\n </Menu.Trigger>\n <Menu.Content items={menuItems} />\n </Card.Toolbar>\n {open && (\n <Card.Row>\n <JsonHighlighter data={props.data} classNames='text-xs' />\n </Card.Row>\n )}\n </Card.Root>\n </Focus.Item>\n </Mosaic.Tile>\n </Menu.Root>\n );\n};\n\nDefaultStackTile.displayName = 'DefaultStackTile';\n"],
5
- "mappings": ";;;;;;AAKA,OAAOA,WAAW;AAIX,IAAMC,aAAa,MAAA;AACxB,SAAO,CAACC,UACN,sBAAA,cAACC,OAAOC,MAAI,MACV,sBAAA,cAACF,OAAAA,IAAAA,CAAAA;AAGP;;;ACXA,YAAYG,YAAY;AAExB,SAASC,KAAKC,YAAY;AAC1B,SAASC,gBAAgB;AAMlB,IAAMC,WAAkBC,cAAO;EACpCC,MAAaC;EACbC,aAAoBC,gBAAgBF,aAAM;EAC1CG,OAAcD,gBAAgBF,aAAM;AACtC,CAAA,EAAGI,KACDT,KAAKU,OAAO;EACVC,UAAU;EACVC,SAAS;AACX,CAAA,CAAA;AAKK,IAAMC,aAAoBV,cAAO;EACtCW,IAAIb;EACJG,MAAaC;EACbU,OAAcC,eAAeC,aAAMlB,IAAIA,IAAIG,QAAAA,CAAAA,CAAAA;AAC7C,CAAA,EAAGO,KACDT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AACU,QAAQW,YAAU;IAACC,UAAAA;IAASC,SAAQ;IAAQxB,MAAK;IAAmCD,OAAM;OAE7F,gBAAAE,OAAA,cAACC,KAAKuB,SAAO;IAACC,OAAO/B;OAEtBH,QACC,gBAAAS,OAAA,cAACQ,KAAKkB,KAAG,MACP,gBAAA1B,OAAA,cAAC2B,iBAAAA;IAAgBX,MAAM5B,MAAM4B;IAAMY,YAAW;;AAQ9D;AAEAzC,iBAAiB0C,cAAc;",
4
+ "sourcesContent": ["//\n// Copyright 2026 DXOS.org\n//\n\nimport { type Decorator } from '@storybook/react-vite';\nimport React from 'react';\n\nimport { Mosaic } from '../components';\n\nexport const withMosaic = (): Decorator => {\n return (Story) => (\n <Mosaic.Root>\n <Story />\n </Mosaic.Root>\n );\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { Ref, Type } from '@dxos/echo';\nimport { ObjectId } from '@dxos/keys';\n\n//\n// Test Data\n//\n\nexport const TestItem = Schema.Struct({\n name: Schema.String,\n description: Schema.optional(Schema.String),\n label: Schema.optional(Schema.String),\n}).pipe(\n Type.object({\n typename: 'com.example.type.item',\n version: '0.1.0',\n }),\n);\n\nexport interface TestItem extends Schema.Schema.Type<typeof TestItem> {}\n\nexport const TestColumn = Schema.Struct({\n id: ObjectId,\n name: Schema.String,\n items: Schema.mutable(Schema.Array(Ref.Ref(TestItem))),\n}).pipe(\n Type.object({\n typename: 'com.example.type.column',\n version: '0.1.0',\n }),\n);\n\nexport interface TestColumn extends Schema.Schema.Type<typeof TestColumn> {}\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport React, { type PropsWithChildren } from 'react';\n\nimport { Icon, Popover } from '@dxos/react-ui';\nimport { ResizeHandle, type Size, resizeAttributes, sizeStyle } from '@dxos/react-ui-dnd';\n\nconst DEFAULT_BLOCK_SIZE = 22;\nconst MIN_BLOCK_SIZE = 8;\n\n//\n// Card container.\n//\n\nexport type CardContainerProps = PropsWithChildren<{ role?: 'popover' | 'intrinsic'; icon?: string }>;\n\nexport const CardContainer = ({ children, role, icon = 'ph--arrow-line-down--regular' }: CardContainerProps) => {\n switch (role) {\n case 'popover':\n return (\n <div className='flex justify-center'>\n <PopoverCardContainer icon={icon}>{children}</PopoverCardContainer>\n </div>\n );\n case 'intrinsic':\n default:\n return <IntrinsicCardContainer>{children}</IntrinsicCardContainer>;\n }\n};\n\n//\n// Popover\n//\n\nexport type PopoverCardContainerProps = PropsWithChildren<{ icon?: string }>;\n\nexport const PopoverCardContainer = ({\n children,\n icon = 'ph--arrow-line-down--regular',\n}: PopoverCardContainerProps) => {\n return (\n <Popover.Root open>\n <Popover.Trigger asChild>\n <Icon icon={icon} />\n </Popover.Trigger>\n <Popover.Portal>\n <Popover.Content onOpenAutoFocus={(event: Event) => event.preventDefault()}>\n <Popover.Viewport classNames='dx-card-popover'>{children}</Popover.Viewport>\n <Popover.Arrow />\n </Popover.Content>\n </Popover.Portal>\n </Popover.Root>\n );\n};\n\n//\n// Intrinsic card container (size constrained by card itself).\n//\n\nexport type IntrinsicCardContainerProps = PropsWithChildren<{\n defaultSize?: Size;\n size?: Size;\n onSizeChange?: (size: Size, commit?: boolean) => void;\n}>;\n\nexport const IntrinsicCardContainer = ({\n children,\n defaultSize,\n size: propSize,\n onSizeChange,\n}: IntrinsicCardContainerProps) => {\n const [size = DEFAULT_BLOCK_SIZE, setSize] = useControllableState<Size>({\n prop: propSize,\n defaultProp: defaultSize,\n onChange: onSizeChange,\n });\n\n return (\n <div\n className='relative p-2 grid overflow-hidden border-2 border-dashed border-green-500 rounded-lg'\n style={sizeStyle(size, 'horizontal')}\n {...resizeAttributes}\n >\n <div className='dx-container flex flex-col'>{children}</div>\n <ResizeHandle\n side='inline-end'\n fallbackSize={DEFAULT_BLOCK_SIZE}\n minSize={MIN_BLOCK_SIZE}\n size={size}\n onSizeChange={setSize}\n />\n </div>\n );\n};\n", "//\n// Copyright 2026 DXOS.org\n//\n\nimport React, { useMemo, useRef, useState } from 'react';\n\nimport { Obj } from '@dxos/echo';\nimport { Card, Toolbar } from '@dxos/react-ui';\nimport { Menu, createMenuAction } from '@dxos/react-ui-menu';\nimport { JsonHighlighter } from '@dxos/react-ui-syntax-highlighter';\n\nimport { Focus, Mosaic, type MosaicStackTileComponent } from '../components';\n\nexport const DefaultStackTile: MosaicStackTileComponent<Obj.Any> = (props) => {\n const dragHandleRef = useRef<HTMLButtonElement>(null);\n const [open, setOpen] = useState(false);\n const menuItems = useMemo(\n () => [\n createMenuAction('toggle-details', () => setOpen((prev) => !prev), {\n label: open ? 'Hide details' : 'Show details',\n icon: 'ph--placeholder--regular',\n }),\n ],\n [open],\n );\n\n return (\n <Menu.Root>\n {/*\n * `Mosaic.Tile` sets `aria-current` from `props.current`, which the\n * Slot composition propagates down to `Card.Root`'s div. That's what\n * makes `dx-current` (an `aria-[current=true]:` utility) actually\n * fire here. See `ui-theme/src/css/components/selected.md`.\n */}\n <Mosaic.Tile {...props} asChild>\n <Focus.Item asChild>\n <Card.Root className='dx-current dx-hover'>\n <Card.Toolbar>\n <Card.DragHandle ref={dragHandleRef} />\n <Card.Title>{Obj.getLabel(props.data) ?? props.data.id}</Card.Title>\n <Menu.Trigger asChild disabled={!menuItems?.length}>\n <Toolbar.IconButton iconOnly variant='ghost' icon='ph--dots-three-vertical--regular' label='Menu' />\n </Menu.Trigger>\n <Menu.Content items={menuItems} />\n </Card.Toolbar>\n {open && (\n <Card.Row>\n <JsonHighlighter data={props.data} classNames='text-xs' />\n </Card.Row>\n )}\n </Card.Root>\n </Focus.Item>\n </Mosaic.Tile>\n </Menu.Root>\n );\n};\n\nDefaultStackTile.displayName = 'DefaultStackTile';\n"],
5
+ "mappings": ";;;;;;AAKA,OAAOA,WAAW;AAIX,IAAMC,aAAa,MAAA;AACxB,SAAO,CAACC,UACN,sBAAA,cAACC,OAAOC,MAAI,MACV,sBAAA,cAACF,OAAAA,IAAAA,CAAAA;A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AA;KACV,gBAAAL,OAAA,cAACQ,KAAKN,MAAI;IAACO,WAAU;KACnB,gBAAAT,OAAA,cAACQ,KAAKE,SAAO,MACX,gBAAAV,OAAA,cAACQ,KAAKG,YAAU;IAACC,KAAKvB;MACtB,gBAAAW,OAAA,cAACQ,KAAKK,OAAK,MAAEC,IAAIC,SAAS3B,MAAM4B,IAAI,KAAK5B,MAAM4B,KAAKC,EAAE,GACtD,gBAAAjB,OAAA,cAACC,KAAKiB,SAAO;IAACb,SAAAA;IAAQc,UAAU,CAACzB,WAAW0B;KAC1C,gBAAApB,OAAA,cAACU,QAAQW,YAAU;IAACC,UAAAA;IAASC,SAAQ;IAAQxB,MAAK;IAAmCD,OAAM;OAE7F,gBAAAE,OAAA,cAACC,KAAKuB,SAAO;IAACC,OAAO/B;OAEtBH,QACC,gBAAAS,OAAA,cAACQ,KAAKkB,KAAG,MACP,gBAAA1B,OAAA,cAAC2B,iBAAAA;IAAgBX,MAAM5B,MAAM4B;IAAMY,YAAW;;AAQ9D;AAEAzC,iBAAiB0C,cAAc;",
6
6
  "names": ["React", "withMosaic", "Story", "Mosaic", "Root", "Schema", "Ref", "Type", "ObjectId", "TestItem", "Struct", "name", "String", "description", "optional", "label", "pipe", "object", "typename", "version", "TestColumn", "id", "items", "mutable", "Array", "useControllableState", "React", "Icon", "Popover", "ResizeHandle", "resizeAttributes", "sizeStyle", "DEFAULT_BLOCK_SIZE", "MIN_BLOCK_SIZE", "CardContainer", "children", "role", "icon", "div", "className", "PopoverCardContainer", "IntrinsicCardContainer", "Root", "open", "Trigger", "asChild", "Portal", "Content", "onOpenAutoFocus", "event", "preventDefault", "Viewport", "classNames", "Arrow", "defaultSize", "size", "propSize", "onSizeChange", "setSize", "prop", "defaultProp", "onChange", "style", "side", "fallbackSize", "minSize", "React", "useMemo", "useRef", "useState", "Obj", "Card", "Toolbar", "Menu", "createMenuAction", "JsonHighlighter", "DefaultStackTile", "props", "dragHandleRef", "useRef", "open", "setOpen", "useState", "menuItems", "useMemo", "createMenuAction", "prev", "label", "icon", "React", "Menu", "Root", "Mosaic", "Tile", "asChild", "Focus", "Item", "Card", "className", "Toolbar", "DragHandle", "ref", "Title", "Obj", "getLabel", "data", "id", "Trigger", "disabled", "length", "IconButton", "iconOnly", "variant", "Content", "items", "Row", "JsonHighlighter", "classNames", "displayName"]
7
7
  }
@@ -297,7 +297,7 @@ var MOSAIC_CONTAINER_STATE_ATTR = "mosaic-container-state";
297
297
  var MOSAIC_CONTAINER_PLACEHOLDER_WIDTH = "--mosaic-placeholder-width";
298
298
  var MOSAIC_CONTAINER_PLACEHOLDER_HEIGHT = "--mosaic-placeholder-height";
299
299
  var counter = 0;
300
- var MosaicContainer = composable(({ children, eventHandler: eventHandlerProp, orientation = "vertical", asChild, autoScroll: autoscrollElement, withFocus, currentId, onCurrentChange, debug, ...props }, forwardedRef) => {
300
+ var MosaicContainer = composable(({ children, eventHandler: eventHandlerProp, orientation = "vertical", asChild, autoScroll: autoscrollElement, withFocus, currentId, onCurrentChange, selectedIds, onSelectionChange, debug, ...props }, forwardedRef) => {
301
301
  const Comp = asChild ? Slot2 : Primitive2.div;
302
302
  const rootRef = useRef2(null);
303
303
  const composedRef = useComposedRefs2(rootRef, forwardedRef);
@@ -315,6 +315,9 @@ var MosaicContainer = composable(({ children, eventHandler: eventHandlerProp, or
315
315
  const setCurrentId = useCallback2((id) => onCurrentChange?.(id), [
316
316
  onCurrentChange
317
317
  ]);
318
+ const setSelected = useCallback2((id, selected) => onSelectionChange?.(id, selected), [
319
+ onSelectionChange
320
+ ]);
318
321
  const scrollToRef = useRef2(void 0);
319
322
  const registerScrollTo = useCallback2((fn) => {
320
323
  scrollToRef.current = fn;
@@ -471,6 +474,8 @@ var MosaicContainer = composable(({ children, eventHandler: eventHandlerProp, or
471
474
  setActiveLocation,
472
475
  currentId,
473
476
  setCurrentId,
477
+ selectedIds,
478
+ setSelected,
474
479
  registerScrollTo
475
480
  }, /* @__PURE__ */ React2.createElement(Comp, {
476
481
  ...composableProps(props, {
@@ -502,7 +507,7 @@ import { composableProps as composableProps2, slottable } from "@dxos/ui-theme";
502
507
  var MOSAIC_TILE_NAME = "Mosaic.Tile";
503
508
  var [MosaicTileContextProvider, useMosaicTileContext] = createContext3("MosaicTile");
504
509
  var MOSAIC_TILE_STATE_ATTR = "mosaic-tile-state";
505
- var MosaicTile = slottable(({ children, asChild, dragHandle, allowedEdges: allowedEdgesProp, location, id, data: dataProp, draggable: draggableProp, current, debug: _, ...props }, forwardedRef) => {
510
+ var MosaicTile = slottable(({ children, asChild, dragHandle, allowedEdges: allowedEdgesProp, location, id, data: dataProp, draggable: draggableProp, current, selected, debug: _, ...props }, forwardedRef) => {
506
511
  const Comp = asChild ? Slot3 : Primitive3.div;
507
512
  const rootRef = useRef3(null);
508
513
  const composedRef = composeRefs(rootRef, forwardedRef);
@@ -646,11 +651,12 @@ var MosaicTile = slottable(({ children, asChild, dragHandle, allowedEdges: allow
646
651
  "data-object-id": id,
647
652
  [`data-${MOSAIC_TILE_STATE_ATTR}`]: state.type,
648
653
  role: "listitem",
649
- // Pair `current` prop with `aria-current="true"` so the
650
- // `dx-current` utility (which keys off `aria-[current=true]:`)
651
- // actually fires. Without this the prop is purely advisory and
652
- // any `dx-current` styling on the tile would silently no-op.
654
+ // Pair `current` / `selected` props with `aria-current` / `aria-selected`
655
+ // so the `dx-current` / `dx-selected` / `dx-hover` utilities (which key
656
+ // off those attributes) actually fire. Without this the props are purely
657
+ // advisory and the corresponding styling silently no-ops.
653
658
  "aria-current": current ? "true" : void 0,
659
+ "aria-selected": selected ? "true" : void 0,
654
660
  className,
655
661
  ref: composedRef
656
662
  }, children), state.type === "preview" && /* @__PURE__ */ createPortal(/* @__PURE__ */ React3.createElement(Comp, {
@@ -675,6 +681,7 @@ import { mx } from "@dxos/ui-theme";
675
681
  var MOSAIC_PLACEHOLDER_NAME = "Mosaic.Placeholder";
676
682
  var MOSAIC_PLACEHOLDER_ORIENTATION_ATTR = "mosaic-placeholder-orientation";
677
683
  var MOSAIC_PLACEHOLDER_STATE_ATTR = "mosaic-placeholder-state";
684
+ var MOSAIC_PLACEHOLDER_LOCATION_ATTR = "mosaic-placeholder-location";
678
685
  var MosaicPlaceholder = ({ classNames, children, asChild, orientation = "vertical", location }) => {
679
686
  const rootRef = useRef4(null);
680
687
  const Comp = asChild ? Slot4 : Primitive4.div;
@@ -720,6 +727,7 @@ var MosaicPlaceholder = ({ classNames, children, asChild, orientation = "vertica
720
727
  return /* @__PURE__ */ React4.createElement(Comp, {
721
728
  [`data-${MOSAIC_PLACEHOLDER_ORIENTATION_ATTR}`]: orientation,
722
729
  [`data-${MOSAIC_PLACEHOLDER_STATE_ATTR}`]: data.location === activeLocation ? "active" : "idle",
730
+ [`data-${MOSAIC_PLACEHOLDER_LOCATION_ATTR}`]: String(location),
723
731
  role: "none",
724
732
  className: mx("relative", classNames),
725
733
  ref: rootRef
@@ -745,7 +753,7 @@ import { composable as composable2, composableProps as composableProps3, mx as m
745
753
  var __dxlog_file2 = "/__w/dxos/dxos/packages/ui/react-ui-mosaic/src/components/Mosaic/Stack.tsx";
746
754
  var MOSAIC_STACK_NAME = "MosaicStack";
747
755
  var MosaicStackInner = composable2(({ orientation: orientationProp = "vertical", getId, items, scrollIntoView = true, Tile, draggable: draggable2 = true, debug, ...props }, forwardedRef) => {
748
- const { id, orientation = orientationProp, dragging, currentId, registerScrollTo } = useMosaicContainerContext(MOSAIC_STACK_NAME);
756
+ const { id, orientation = orientationProp, dragging, currentId, selectedIds, registerScrollTo } = useMosaicContainerContext(MOSAIC_STACK_NAME);
749
757
  const visibleItems = useVisibleItems({
750
758
  id,
751
759
  items,
@@ -795,6 +803,7 @@ var MosaicStackInner = composable2(({ orientation: orientationProp = "vertical",
795
803
  location: index + 1,
796
804
  draggable: draggable2,
797
805
  current: getId(item) === currentId,
806
+ selected: selectedIds?.has(getId(item)),
798
807
  debug
799
808
  }), draggable2 && /* @__PURE__ */ React5.createElement(InternalPlaceholder, {
800
809
  orientation,
@@ -805,8 +814,8 @@ MosaicStackInner.displayName = MOSAIC_STACK_NAME;
805
814
  var MosaicStack = MosaicStackInner;
806
815
  var MOSAIC_VIRTUAL_STACK_NAME = "MosaicVirtualStack";
807
816
  var MosaicVirtualStackInner = /* @__PURE__ */ forwardRef2(({ orientation = "vertical", getId, items, scrollIntoView = true, Tile, estimateSize, getScrollElement, overscan = 8, gap, onChange, draggable: draggable2 = true, debug, ...props }, forwardedRef) => {
808
- invariant(Tile, void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file2, L: 101, S: void 0, A: ["Tile", ""] });
809
- const { id, dragging, currentId, registerScrollTo } = useMosaicContainerContext(MOSAIC_VIRTUAL_STACK_NAME);
817
+ invariant(Tile, void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file2, L: 102, S: void 0, A: ["Tile", ""] });
818
+ const { id, dragging, currentId, selectedIds, registerScrollTo } = useMosaicContainerContext(MOSAIC_VIRTUAL_STACK_NAME);
810
819
  const visibleItems = useVisibleItems({
811
820
  id,
812
821
  items,
@@ -919,6 +928,7 @@ var MosaicVirtualStackInner = /* @__PURE__ */ forwardRef2(({ orientation = "vert
919
928
  location,
920
929
  draggable: draggable2,
921
930
  current: getId(data) === currentId,
931
+ selected: selectedIds?.has(getId(data)),
922
932
  debug
923
933
  }) : /* @__PURE__ */ React5.createElement(InternalPlaceholder, {
924
934
  orientation,
@@ -961,4 +971,4 @@ export {
961
971
  useMosaicTileContext,
962
972
  Mosaic
963
973
  };
964
- //# sourceMappingURL=chunk-25RXZ2RH.mjs.map
974
+ //# sourceMappingURL=chunk-2UCLTU76.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/hooks/useVisibleItems.ts", "../../../src/components/Focus/Focus.tsx", "../../../src/components/Mosaic/styles.ts", "../../../src/components/Mosaic/types.ts", "../../../src/components/Mosaic/Root.tsx", "../../../src/components/Mosaic/Container.tsx", "../../../src/components/Mosaic/Tile.tsx", "../../../src/components/Mosaic/Placeholder.tsx", "../../../src/components/Mosaic/Stack.tsx", "../../../src/components/Mosaic/Mosaic.tsx"],
4
+ "sourcesContent": ["//\n// Copyright 2026 DXOS.org\n//\n\nimport { useMemo } from 'react';\n\nimport { type GetId, type MosaicTileData } from '../components';\n\nexport type UseVisibleItemsProps<TItem = any> = {\n /** Container id. */\n id: string;\n\n /** Current items. */\n items?: readonly TItem[] | TItem[];\n\n /** Currently dragging item. */\n dragging: MosaicTileData<TItem> | undefined;\n\n /** ID getter */\n getId: GetId<TItem>;\n};\n\n/**\n * Returns items with the dragging item removed.\n */\nexport const useVisibleItems = <TItem = any>({\n id,\n items,\n dragging,\n getId,\n}: UseVisibleItemsProps<TItem>): readonly TItem[] | TItem[] => {\n const visibleItems = useMemo(() => {\n if (!items || !dragging || id !== dragging.containerId) {\n return items ?? [];\n }\n\n const idx = items.findIndex((item) => getId(item) === dragging.id);\n if (idx === -1) {\n return items;\n }\n\n const visibleItems = items.slice();\n visibleItems.splice(idx, 1);\n return visibleItems;\n }, [id, items, dragging, getId]);\n\n return visibleItems;\n};\n", "//\n// Copyright 2026 DXOS.org\n//\n\n// Re-export from @dxos/react-ui.\nexport { Focus, useFocus, type FocusGroupProps, type FocusItemProps } from '@dxos/react-ui';\n", "//\n// Copyright 2026 DXOS.org\n//\n\nimport { type ClassNameValue } from '@dxos/react-ui';\n\nexport const styles = {\n placeholder: {\n root: [\n 'group opacity-0',\n 'group-data-[mosaic-debug=\"true\"]:opacity-100',\n 'group-data-[mosaic-debug=\"true\"]:bg-orange-500',\n 'data-[mosaic-placeholder-state=active]:opacity-100',\n 'data-[mosaic-placeholder-orientation=vertical]:snap-start', // TODO(burdon): Option.\n 'data-[mosaic-placeholder-orientation=vertical]:py-1',\n 'data-[mosaic-placeholder-orientation=vertical]:data-[mosaic-placeholder-state=active]:py-2.5',\n 'data-[mosaic-placeholder-orientation=horizontal]:px-1',\n 'data-[mosaic-placeholder-orientation=horizontal]:data-[mosaic-placeholder-state=active]:px-2.5',\n ],\n content: [\n 'transition-all duration-0',\n // TODO(burdon): Don't animate open if placeholder is the source.\n // TODO(burdon): Flickers when start to drag since source is removed and then the placeholder shows up.\n // - Use absolute positioning?\n // 'group-data-[mosaic-placeholder-state=active]:duration-200',\n 'group-data-[mosaic-placeholder-orientation=vertical]:h-0',\n 'group-data-[mosaic-placeholder-orientation=vertical]:group-data-[mosaic-placeholder-state=active]:h-[var(--mosaic-placeholder-height)]',\n 'group-data-[mosaic-placeholder-orientation=horizontal]:w-0',\n 'group-data-[mosaic-placeholder-orientation=horizontal]:group-data-[mosaic-placeholder-state=active]:w-[var(--mosaic-placeholder-width)]',\n ],\n },\n} satisfies Record<string, Record<string, ClassNameValue>>;\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { type ElementDragPayload } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\n\nexport type GetId<TData = any> = (data: TData) => string;\n\n/**\n * NOTE: Must implement value equivalence.\n */\nexport type LocationType = string | number;\n\n/**\n * Get the source data from the drag payload.\n */\nexport const getSourceData = <TData = any, TLocation = any>(\n source: ElementDragPayload,\n): MosaicTileData<TData, TLocation> | null => {\n return source.data.type === 'tile' ? (source.data as MosaicTileData<TData, TLocation>) : null;\n};\n\n/**\n * Draggable item.\n * Tiles may contain arbitrary data (which may not be an ECHO object; e.g., search result).\n */\nexport type MosaicTileData<TData = any, TLocation = any> = {\n type: 'tile';\n containerId: string;\n id: string;\n data: TData;\n location: TLocation;\n bounds?: DOMRect;\n};\n\n/**\n * Drop target placeholder.\n */\nexport type MosaicPlaceholderData<TLocation = any> = {\n type: 'placeholder';\n containerId: string;\n location: TLocation;\n};\n\n/**\n * Drop target container.\n */\nexport type MosaicContainerData = {\n type: 'container';\n id: string;\n};\n\nexport type MosaicData = MosaicTileData | MosaicPlaceholderData | MosaicContainerData;\n\nexport type MosaicTargetData = MosaicTileData | MosaicPlaceholderData;\n\n/**\n * Handler implemented by drop containers.\n */\nexport interface MosaicEventHandler<TData = any, TObject = any> {\n /**\n * Container identifier.\n */\n id: string;\n\n /**\n * Determine if the item can be dropped into this container.\n * NOTE: This is continuously called while dragging (doesn't require mouse movement).\n */\n canDrop?: (props: { source: MosaicTileData<TData> }) => boolean;\n\n /**\n * Called during drag for custom visualization.\n */\n onDrag?: (props: { source: MosaicTileData<TData>; position: { x: number; y: number } }) => void;\n\n /**\n * Insert/rearrange the item at the given location.\n */\n onDrop?: (props: { source: MosaicTileData<TData>; target?: MosaicData }) => void;\n\n /**\n * Request the object to be dropped.\n * This allows the source container to clone/mutate/swap the object before it is dropped.\n * If the callback returns true, then the callback may decide to remove the item from the source container,\n * completing the transfer.\n */\n onTake?: (props: { source: MosaicTileData<TData> }, cb: (object: TObject) => Promise<boolean>) => void;\n\n /**\n * Dragging ended.\n */\n onCancel?: () => void;\n}\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';\nimport { type ElementDragPayload, monitorForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport { type DragLocationHistory } from '@atlaskit/pragmatic-drag-and-drop/types';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { createContext } from '@radix-ui/react-context';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport { Slot } from '@radix-ui/react-slot';\nimport React, { type PropsWithChildren, forwardRef, useCallback, useEffect, useRef, useState } from 'react';\n\nimport { log } from '@dxos/log';\n\nimport { type MosaicData, type MosaicEventHandler, type MosaicTileData } from './types';\n\n//\n// Context\n//\n\ntype MosaicDraggingSource = {\n data: MosaicTileData;\n handler?: MosaicEventHandler;\n container?: Element;\n};\n\ntype MosaicDraggingTarget = {\n data: MosaicData;\n handler?: MosaicEventHandler;\n};\n\ntype MosaicDraggingState = {\n source: MosaicDraggingSource;\n target?: MosaicDraggingTarget;\n};\n\ntype MosaicRootContextValue = {\n containers: Record<string, MosaicEventHandler>;\n addContainer: (container: MosaicEventHandler) => void;\n removeContainer: (id: string) => void;\n dragging?: MosaicDraggingState;\n};\n\nconst [MosaicRootContextProvider, useMosaicRootContext] = createContext<MosaicRootContextValue>('MosaicRoot');\n\n//\n// Root\n//\n\nconst MOSAIC_ROOT_NAME = 'Mosaic.Root';\n\n// State attribute: [&:has(>_[data-mosaic-debug=true])]\nconst MOSAIC_ROOT_DEBUG_ATTR = 'mosaic-debug';\n\ntype MosaicRootProps = PropsWithChildren<{\n asChild?: boolean;\n debug?: boolean;\n}>;\n\nconst MosaicRoot = forwardRef<HTMLDivElement, MosaicRootProps>(({ children, asChild, debug }, forwardedRef) => {\n const rootRef = useRef<HTMLDivElement>(null);\n const composedRef = useComposedRefs<HTMLDivElement>(rootRef, forwardedRef);\n const Comp = asChild ? Slot : Primitive.div;\n\n const [handlers, setHandlers] = useState<Record<string, MosaicEventHandler>>({});\n const [dragging, setDragging] = useState<MosaicDraggingState | undefined>();\n\n const getSourceHandler = useCallback(\n (source: ElementDragPayload): { data: MosaicTileData; handler?: MosaicEventHandler } => {\n const data = source.data as MosaicTileData;\n return { data, handler: handlers[data.containerId] };\n },\n [handlers],\n );\n\n const getTargetHandler = useCallback(\n (location: DragLocationHistory): { data?: MosaicData; handler?: MosaicEventHandler } => {\n for (const target of location.current.dropTargets) {\n const data = target.data as MosaicData;\n let containerId: string;\n switch (data.type) {\n case 'tile':\n case 'placeholder':\n containerId = data.containerId;\n break;\n case 'container':\n containerId = data.id;\n break;\n }\n\n const handler = handlers[containerId];\n if (handler) {\n return { data, handler };\n }\n }\n\n return {};\n },\n [handlers],\n );\n\n useEffect(() => {\n const handleChange = ({ source, location }: { source: ElementDragPayload; location: DragLocationHistory }) => {\n const { data: sourceData } = getSourceHandler(source);\n const { data: targetData, handler } = getTargetHandler(location);\n setDragging((dragging) => {\n dragging?.target?.handler?.onCancel?.();\n return {\n source: {\n data: sourceData,\n handler: handlers[sourceData.containerId],\n // TODO(burdon): Check id matches.\n container: location.initial.dropTargets.find((target) => target.data.type === 'container')?.element,\n },\n target: targetData && {\n data: targetData,\n handler,\n },\n };\n });\n };\n\n const handleCancel = () => {\n setDragging((dragging) => {\n requestAnimationFrame(() => {\n dragging?.target?.handler?.onCancel?.();\n dragging?.source?.container?.dispatchEvent(new CustomEvent('dnd:cancel', { bubbles: true }));\n });\n\n return undefined;\n });\n };\n\n let noTargetTimeout: NodeJS.Timeout;\n\n // Main controller.\n return combine(\n monitorForElements({\n /**\n * Dragging started within any container.\n */\n onDragStart: ({ source, location }) => {\n log('Root.onDragStart', {\n source: source.data,\n location: location.current.dropTargets.map((target) => target.data),\n });\n\n handleChange({ source, location });\n },\n\n /**\n * Dragging entered a new container.\n */\n onDropTargetChange: ({ source, location }) => {\n clearTimeout(noTargetTimeout);\n log('Root.onDropTargetChange', {\n source: source.data,\n location: location.current.dropTargets.map((target) => target.data),\n });\n\n // Stop dragging if there are no drop targets (or we are cancelling).\n if (location.current.dropTargets.length === 0) {\n noTargetTimeout = setTimeout(() => setDragging(undefined), 1_000);\n } else {\n handleChange({ source, location });\n }\n },\n\n /**\n * Dragging within any container.\n */\n onDrag: ({ source, location }) => {\n const { data } = getSourceHandler(source);\n const { handler } = getTargetHandler(location);\n if (handler) {\n const { clientX: x, clientY: y } = location.current.input;\n handler.onDrag?.({ source: data, position: { x, y } });\n }\n },\n\n /**\n * Dragging ended.\n */\n onDrop: ({ source, location }) => {\n log.info('Root.onDrop', {\n source: source.data,\n location: location.current.dropTargets.map((target) => target.data),\n });\n\n // Get the source container.\n const { data: sourceData, handler: sourceHandler } = getSourceHandler(source);\n if (!sourceHandler) {\n log.warn('invalid source', {\n source: sourceData,\n handlers: Object.keys(handlers),\n });\n return;\n }\n\n // NOTE: When dragging is cancelled (e.g., user presses ESC) onDrop is only called after a subsequent event.\n // NOTE: pDND blocks ESC event propagation while dragging.\n // - ESC only flips internal state.\n // - Completion happens on the next processed input event.\n // - This avoids reentrancy and keeps pointer/keyboard behavior consistent.\n // - We set dragging to undefined in onDropTargetChange after a delay if there are no drop targets.\n try {\n if (location.current.dropTargets.length === 0) {\n log.info('cancelled');\n } else {\n // Get the target container.\n const { data: targetData, handler: targetHandler } = getTargetHandler(location);\n if (!targetHandler) {\n log.warn('invalid target', {\n source: sourceData,\n location,\n handlers: Object.keys(handlers),\n });\n return;\n }\n\n // TODO(burdon): Check object doesn't already exist in the collection.\n if (sourceHandler === targetHandler) {\n targetHandler.onDrop?.({\n source: sourceData,\n target: targetData,\n });\n } else {\n if (!sourceHandler.onTake) {\n log.warn('invalid source', { source: sourceData });\n return;\n }\n\n sourceHandler.onTake?.({ source: sourceData }, async (object) => {\n targetHandler.onDrop?.({\n source: { ...sourceData, data: object },\n target: targetData,\n });\n\n return true;\n });\n }\n }\n } finally {\n handleCancel();\n }\n },\n }),\n );\n }, [handlers, getSourceHandler, getTargetHandler]);\n\n return (\n <MosaicRootContextProvider\n containers={handlers}\n addContainer={(container) =>\n setHandlers((containers) => ({\n ...containers,\n [container.id]: container,\n }))\n }\n removeContainer={(id) =>\n setHandlers((containers) => {\n delete containers[id];\n return { ...containers };\n })\n }\n dragging={dragging}\n >\n <Comp\n className='contents group'\n {...{\n [`data-${MOSAIC_ROOT_DEBUG_ATTR}`]: debug,\n }}\n ref={composedRef}\n >\n {children}\n </Comp>\n </MosaicRootContextProvider>\n );\n});\n\nMosaicRoot.displayName = MOSAIC_ROOT_NAME;\n\nexport { MosaicRoot, useMosaicRootContext };\n\nexport type { MosaicRootProps, MosaicDraggingState };\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { autoScrollForElements } from '@atlaskit/pragmatic-drag-and-drop-auto-scroll/element';\nimport { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';\nimport { dropTargetForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { createContext } from '@radix-ui/react-context';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport { Slot } from '@radix-ui/react-slot';\nimport { bind } from 'bind-event-listener';\nimport React, {\n type CSSProperties,\n type PropsWithChildren,\n type ReactNode,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\n\nimport { type AllowedAxis } from '@dxos/react-ui';\nimport { composable, composableProps } from '@dxos/ui-theme';\nimport { isTruthy } from '@dxos/util';\n\nimport { useFocus } from '../Focus';\nimport { type MosaicDraggingState, useMosaicRootContext } from './Root';\nimport {\n type LocationType,\n type MosaicContainerData,\n type MosaicEventHandler,\n type MosaicTileData,\n getSourceData,\n} from './types';\n\n//\n// Container\n//\n\nconst MOSAIC_CONTAINER_NAME = 'Mosaic.Container';\n\ntype MosaicContainerState = { type: 'idle' } | { type: 'active'; bounds?: DOMRect };\n\ntype MosaicContainerContextValue<TData = any, Location = LocationType> = {\n id: string;\n eventHandler: MosaicEventHandler<TData>;\n orientation?: AllowedAxis;\n dragging?: MosaicDraggingState;\n scrolling?: boolean;\n state: MosaicContainerState;\n\n /** Active drop location. */\n activeLocation?: Location;\n setActiveLocation: (location: Location | undefined) => void;\n\n /** ID of the current (aria-current) item. */\n currentId?: string;\n /** Set the current item by ID. */\n setCurrentId: (id: string | undefined) => void;\n\n /** IDs of selected (aria-selected) items. */\n selectedIds?: ReadonlySet<string>;\n /** Request to set or unset selection on an item by ID. */\n setSelected: (id: string, selected: boolean) => void;\n\n /** Register a scroll-to-item callback (provided by Stack/VirtualStack). */\n registerScrollTo: (fn: ((id: string) => void) | undefined) => void;\n};\n\nconst [MosaicContainerContextProvider, useMosaicContainerContext] =\n createContext<MosaicContainerContextValue>('MosaicContainer');\n\n// State attribute: [&:has(>_[data-mosaic-container-state=active])]\nconst MOSAIC_CONTAINER_STATE_ATTR = 'mosaic-container-state';\n\n// CSS variables: [var(--mosaic-placeholder-xxx)]\nconst MOSAIC_CONTAINER_PLACEHOLDER_WIDTH = '--mosaic-placeholder-width';\nconst MOSAIC_CONTAINER_PLACEHOLDER_HEIGHT = '--mosaic-placeholder-height';\n\nlet counter = 0;\n\ntype MosaicContainerProps = PropsWithChildren<\n Partial<Pick<MosaicContainerContextValue, 'eventHandler' | 'orientation'>> & {\n asChild?: boolean;\n /** Support autoscrolling container when dragging. */\n autoScroll?: HTMLElement | null;\n withFocus?: boolean;\n /** Controlled current-item ID. */\n currentId?: string;\n /** Called when a tile requests to become current. */\n onCurrentChange?: (id: string | undefined) => void;\n /** Controlled set of selected item IDs. */\n selectedIds?: ReadonlySet<string>;\n /** Called when a tile requests to toggle selection. */\n onSelectionChange?: (id: string, selected: boolean) => void;\n debug?: () => ReactNode;\n }\n>;\n\n// TODO(burdon): Make generic.\nconst MosaicContainer = composable<HTMLDivElement, MosaicContainerProps>(\n (\n {\n children,\n eventHandler: eventHandlerProp,\n orientation = 'vertical',\n asChild,\n autoScroll: autoscrollElement,\n withFocus,\n currentId,\n onCurrentChange,\n selectedIds,\n onSelectionChange,\n debug,\n ...props\n },\n forwardedRef,\n ) => {\n const Comp = asChild ? Slot : Primitive.div;\n const rootRef = useRef<HTMLDivElement>(null);\n const composedRef = useComposedRefs<HTMLDivElement>(rootRef, forwardedRef);\n\n // Handler.\n const eventHandler = useMemo(\n () =>\n eventHandlerProp ?? {\n id: `mosaic-container-${counter++}`,\n },\n [eventHandlerProp],\n );\n\n // State.\n const { dragging } = useMosaicRootContext(MOSAIC_CONTAINER_NAME);\n const [state, setState] = useState<MosaicContainerState>({ type: 'idle' });\n const [activeLocation, setActiveLocation] = useState<LocationType | undefined>();\n const [scrolling, setScrolling] = useState(false);\n const setCurrentId = useCallback((id: string | undefined) => onCurrentChange?.(id), [onCurrentChange]);\n const setSelected = useCallback(\n (id: string, selected: boolean) => onSelectionChange?.(id, selected),\n [onSelectionChange],\n );\n\n // Scroll-to-item: Stack/VirtualStack registers its implementation.\n const scrollToRef = useRef<((id: string) => void) | undefined>(undefined);\n const registerScrollTo = useCallback((fn: ((id: string) => void) | undefined) => {\n scrollToRef.current = fn;\n }, []);\n\n // When currentId changes, scroll the matching item into view.\n useEffect(() => {\n if (currentId) {\n scrollToRef.current?.(currentId);\n }\n }, [currentId]);\n\n // Focus container.\n const { setFocus } = useFocus();\n useEffect(() => {\n if (withFocus) {\n setFocus?.(state.type === 'active' ? 'active' : undefined);\n }\n }, [setFocus, withFocus, state]);\n\n // Register handler.\n const { addContainer, removeContainer } = useMosaicRootContext(eventHandler.id);\n useEffect(() => {\n addContainer(eventHandler);\n return () => removeContainer(eventHandler.id);\n }, [eventHandler]);\n\n const data = useMemo<MosaicContainerData>(\n () =>\n ({\n type: 'container',\n id: eventHandler.id,\n }) satisfies MosaicContainerData,\n [eventHandler.id],\n );\n\n useEffect(() => {\n if (!rootRef.current) {\n return;\n }\n\n // Determine if scrolling (pause drag/drop handlers).\n let timeout: ReturnType<typeof setTimeout>;\n const handleScroll = () => {\n setScrolling(true);\n clearTimeout(timeout);\n timeout = setTimeout(() => {\n setScrolling(false);\n }, 500);\n };\n\n return combine(\n ...[\n /**\n * Custom event for dragging cancellation.\n */\n bind(rootRef.current, {\n type: 'dnd:cancel',\n listener: () => {\n setState({ type: 'idle' });\n },\n }),\n\n // Target.\n dropTargetForElements({\n element: rootRef.current,\n getData: () => data,\n\n /**\n * Test if permitted to drop here.\n * NOTE: Contained Tile and Placeholder elements do the same.\n */\n canDrop: ({ source }) => {\n const data = getSourceData(source);\n return (data && eventHandler.canDrop?.({ source: data })) || false;\n },\n\n // TODO(burdon): Provide semantic intent to onDrop.\n // getDropEffect: () => {\n // return 'move';\n // },\n\n /**\n * Dragging started in this container.\n */\n onDragStart: ({ source }) => {\n const sourceData = source.data as MosaicTileData;\n setState({ type: 'active', bounds: sourceData.bounds });\n },\n /**\n * Dragging entered this container.\n */\n onDragEnter: ({ source }) => {\n const sourceData = source.data as MosaicTileData;\n setState({ type: 'active', bounds: sourceData.bounds });\n },\n /**\n * Dragging left this container.\n * NOTE: If the container isn't full-height, then when the dragged item is temporarily removed the container will shrink,\n * triggering `onDragLeave`, which then causes the item to be added and removed continually (flickering).\n */\n onDragLeave: ({ source }) => {\n const sourceData = source.data as MosaicTileData;\n if (sourceData.containerId !== eventHandler.id) {\n setState({ type: 'idle' });\n }\n },\n /**\n * Dropped in this container.\n */\n onDrop: () => {\n setState({ type: 'idle' });\n },\n }),\n\n // Autoscroll.\n // NOTE: When used with Scrollable we get a spurious warning (in dev mode).\n // \"Auto scrolling has been attached to an element that appears not to be scrollable.\"\n autoscrollElement && [\n autoScrollForElements({\n element: autoscrollElement,\n // canScroll: ({ element: _ }) => {\n // return true;\n // },\n getAllowedAxis: () => orientation,\n getConfiguration: () => ({\n maxScrollSpeed: 'fast',\n }),\n }),\n\n bind(autoscrollElement, {\n type: 'scroll',\n listener: handleScroll,\n }),\n\n () => setScrolling(false),\n ],\n ]\n .filter(isTruthy)\n .flatMap((x) => x),\n );\n }, [rootRef, eventHandler, data, autoscrollElement]);\n\n return (\n <MosaicContainerContextProvider\n id={eventHandler.id}\n eventHandler={eventHandler}\n orientation={orientation}\n state={state}\n dragging={state.type === 'active' ? dragging : undefined}\n scrolling={scrolling}\n activeLocation={activeLocation}\n setActiveLocation={setActiveLocation}\n currentId={currentId}\n setCurrentId={setCurrentId}\n selectedIds={selectedIds}\n setSelected={setSelected}\n registerScrollTo={registerScrollTo}\n >\n <Comp\n {...composableProps(props, {\n classNames: 'h-full',\n style: {\n [MOSAIC_CONTAINER_PLACEHOLDER_WIDTH]:\n state.type === 'active' && state.bounds ? `${state.bounds.width}px` : '0px',\n [MOSAIC_CONTAINER_PLACEHOLDER_HEIGHT]:\n state.type === 'active' && state.bounds ? `${state.bounds.height}px` : '0px',\n } as CSSProperties,\n })}\n {...{\n [`data-${MOSAIC_CONTAINER_STATE_ATTR}`]: state.type,\n }}\n ref={composedRef}\n >\n {children}\n </Comp>\n {debug?.()}\n </MosaicContainerContextProvider>\n );\n },\n);\n\nMosaicContainer.displayName = MOSAIC_CONTAINER_NAME;\n\nexport { MosaicContainer, useMosaicContainerContext };\n\nexport type { MosaicContainerProps, MosaicContainerState };\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport {\n type Edge,\n attachClosestEdge,\n extractClosestEdge,\n} from '@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge';\nimport { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';\nimport {\n type ElementDragPayload,\n draggable,\n dropTargetForElements,\n} from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport { preserveOffsetOnSource } from '@atlaskit/pragmatic-drag-and-drop/element/preserve-offset-on-source';\nimport { setCustomNativeDragPreview } from '@atlaskit/pragmatic-drag-and-drop/element/set-custom-native-drag-preview';\nimport { type DropTargetRecord } from '@atlaskit/pragmatic-drag-and-drop/types';\nimport { composeRefs } from '@radix-ui/react-compose-refs';\nimport { createContext } from '@radix-ui/react-context';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport { Slot } from '@radix-ui/react-slot';\nimport React, { type PropsWithChildren, useLayoutEffect, useMemo, useRef, useState } from 'react';\nimport { createPortal } from 'react-dom';\n\nimport { type ThemedClassName } from '@dxos/react-ui';\nimport { composableProps, slottable } from '@dxos/ui-theme';\n\nimport { useMosaicContainerContext } from './Container';\nimport { type LocationType, type MosaicTileData, getSourceData } from './types';\n\n//\n// Tile\n//\n\nconst MOSAIC_TILE_NAME = 'Mosaic.Tile';\n\ntype MosaicTileState =\n | { type: 'idle' }\n | { type: 'preview'; container: HTMLElement; rect: DOMRect }\n | { type: 'dragging' }\n | { type: 'target'; closestEdge: Edge | null };\n\ntype MosaicTileContextValue = {\n state: MosaicTileState;\n};\n\nconst [MosaicTileContextProvider, useMosaicTileContext] = createContext<MosaicTileContextValue>('MosaicTile');\n\n// State attribute: data-[mosaic-tile-state=dragging]\nconst MOSAIC_TILE_STATE_ATTR = 'mosaic-tile-state';\n\ntype MosaicTileProps<TData = any, TLocation = LocationType> = ThemedClassName<\n PropsWithChildren<{\n className?: string;\n dragHandle?: HTMLElement | null;\n allowedEdges?: Edge[];\n id: string;\n data: TData;\n location: TLocation;\n draggable?: boolean;\n /** Whether this tile is the current (aria-current) item. */\n current?: boolean;\n /** Whether this tile is selected (aria-selected). */\n selected?: boolean;\n debug?: boolean;\n }>\n>;\n\nconst MosaicTile = slottable<HTMLDivElement, MosaicTileProps>(\n (\n {\n children,\n asChild,\n dragHandle,\n allowedEdges: allowedEdgesProp,\n location,\n id,\n data: dataProp,\n draggable: draggableProp,\n current,\n selected,\n debug: _,\n ...props\n },\n forwardedRef,\n ) => {\n const Comp = asChild ? Slot : Primitive.div;\n const rootRef = useRef<HTMLDivElement>(null);\n const composedRef = composeRefs<HTMLDivElement>(rootRef, forwardedRef);\n\n // State.\n const {\n id: containerId,\n eventHandler,\n orientation,\n scrolling,\n setActiveLocation,\n } = useMosaicContainerContext(MOSAIC_TILE_NAME);\n const [state, setState] = useState<MosaicTileState>({ type: 'idle' });\n\n const allowedEdges = useMemo<Edge[]>(\n () => allowedEdgesProp || (orientation === 'vertical' ? ['top', 'bottom'] : ['left', 'right']),\n [allowedEdgesProp, orientation],\n );\n\n const data = useMemo<MosaicTileData>(\n () =>\n ({\n type: 'tile',\n id,\n containerId,\n data: dataProp,\n location,\n }) satisfies MosaicTileData,\n [containerId, location, dataProp],\n );\n\n useLayoutEffect(() => {\n const root = rootRef.current;\n if (!draggableProp || !root || !containerId || scrolling) {\n return;\n }\n\n const handleChange = ({ self, source }: { self: DropTargetRecord; source: ElementDragPayload }) => {\n if (source.data.id !== dataProp.id) {\n const closestEdge = extractClosestEdge(self.data);\n const location = data.location + (closestEdge === 'top' || closestEdge === 'left' ? -0.5 : 0.5);\n setActiveLocation(location);\n setState({ type: 'target', closestEdge });\n }\n };\n\n return combine(\n // Source.\n draggable({\n element: root,\n dragHandle: dragHandle && state.type !== 'preview' ? dragHandle : undefined,\n canDrag: () => true,\n getInitialData: () => data,\n onGenerateDragPreview: ({ location, nativeSetDragImage }) => {\n setCustomNativeDragPreview({\n nativeSetDragImage,\n getOffset: preserveOffsetOnSource({\n element: root,\n input: location.current.input,\n }),\n render: ({ container }) => {\n data.bounds = root.getBoundingClientRect();\n setState({\n type: 'preview',\n container,\n rect: root.getBoundingClientRect(),\n });\n return () => setState({ type: 'dragging' });\n },\n });\n },\n\n onDragStart: () => {\n setState({ type: 'dragging' });\n },\n onDrop: () => {\n setState({ type: 'idle' });\n },\n }),\n\n // Target.\n dropTargetForElements({\n element: root,\n getData: ({ input, element }) => attachClosestEdge(data, { input, element, allowedEdges }),\n canDrop: ({ source }) => {\n const data = getSourceData(source);\n return (data && eventHandler.canDrop?.({ source: data })) || false;\n },\n onDragEnter: ({ self, source }) => {\n handleChange({ self, source });\n },\n onDragLeave: () => {\n setState({ type: 'idle' });\n setActiveLocation(undefined);\n },\n onDrag: ({ self, source }) => {\n handleChange({ self, source });\n },\n onDrop: () => {\n setState({ type: 'idle' });\n setActiveLocation(undefined);\n },\n }),\n );\n }, [\n rootRef,\n forwardedRef,\n containerId,\n dragHandle,\n eventHandler,\n data,\n scrolling,\n allowedEdges,\n setActiveLocation,\n ]);\n\n const { className, ...rest } = composableProps(props, { classNames: 'relative outline-none' });\n\n // NOTE: Ensure no gaps between cells (prevent drop indicators flickering).\n // NOTE: Ensure padding doesn't change position of cursor when dragging (no margins).\n return (\n <MosaicTileContextProvider state={state}>\n <Comp\n {...rest}\n {...{\n 'data-object-id': id,\n [`data-${MOSAIC_TILE_STATE_ATTR}`]: state.type,\n }}\n role='listitem'\n // Pair `current` / `selected` props with `aria-current` / `aria-selected`\n // so the `dx-current` / `dx-selected` / `dx-hover` utilities (which key\n // off those attributes) actually fire. Without this the props are purely\n // advisory and the corresponding styling silently no-ops.\n aria-current={current ? 'true' : undefined}\n aria-selected={selected ? 'true' : undefined}\n className={className}\n ref={composedRef}\n >\n {children}\n </Comp>\n\n {/* Dragging preview. */}\n {state.type === 'preview' &&\n createPortal(\n <Comp\n {...{\n // NOTE: Use to control appearance while dragging.\n [`data-${MOSAIC_TILE_STATE_ATTR}`]: state.type,\n }}\n className={className}\n style={{\n width: `${state.rect.width}px`,\n height: `${state.rect.height}px`,\n }}\n >\n {children}\n </Comp>,\n state.container,\n )}\n </MosaicTileContextProvider>\n );\n },\n);\n\nMosaicTile.displayName = MOSAIC_TILE_NAME;\n\nexport { MosaicTile, useMosaicTileContext };\n\nexport type { MosaicTileProps, MosaicTileState };\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport {\n DropIndicator as NaturalDropIndicator,\n type DropIndicatorProps as NaturalDropIndicatorProps,\n} from '@atlaskit/pragmatic-drag-and-drop-react-drop-indicator/box';\nimport { dropTargetForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport { Slot } from '@radix-ui/react-slot';\nimport React, { type PropsWithChildren, useLayoutEffect, useMemo, useRef } from 'react';\n\nimport { type Axis, type ThemedClassName } from '@dxos/react-ui';\nimport { mx } from '@dxos/ui-theme';\n\nimport { useMosaicContainerContext } from './Container';\nimport { useMosaicTileContext } from './Tile';\nimport { type LocationType, type MosaicPlaceholderData, getSourceData } from './types';\n\n//\n// Placeholder\n//\n\nconst MOSAIC_PLACEHOLDER_NAME = 'Mosaic.Placeholder';\n\n// Orientation: data-[mosaic-placeholder-orientation=vertical]\nconst MOSAIC_PLACEHOLDER_ORIENTATION_ATTR = 'mosaic-placeholder-orientation';\n\n// State attribute: data-[mosaic-placeholder-state=active]\nconst MOSAIC_PLACEHOLDER_STATE_ATTR = 'mosaic-placeholder-state';\n\n// Location attribute: data-[mosaic-placeholder-location=0.5]. Identifies the\n// placeholder's slot in its container (0.5, 1.5, 2.5, …) so tests can target\n// a specific gap unambiguously without relying on layout-dependent indices.\nconst MOSAIC_PLACEHOLDER_LOCATION_ATTR = 'mosaic-placeholder-location';\n\ntype MosaicPlaceholderProps<Location = LocationType> = ThemedClassName<\n PropsWithChildren<{\n asChild?: boolean;\n orientation?: Axis;\n location: Location;\n }>\n>;\n\nconst MosaicPlaceholder = <Location extends LocationType = LocationType>({\n classNames,\n children,\n asChild,\n orientation = 'vertical',\n location,\n}: MosaicPlaceholderProps<Location>) => {\n const rootRef = useRef<HTMLDivElement>(null);\n const Comp = asChild ? Slot : Primitive.div;\n const {\n id: containerId,\n eventHandler,\n scrolling,\n activeLocation,\n setActiveLocation,\n } = useMosaicContainerContext(MOSAIC_PLACEHOLDER_NAME);\n const data = useMemo<MosaicPlaceholderData<Location>>(\n () =>\n ({\n type: 'placeholder',\n containerId,\n location,\n }) satisfies MosaicPlaceholderData<Location>,\n [containerId, location],\n );\n\n useLayoutEffect(() => {\n const root = rootRef.current;\n if (!root || scrolling) {\n return;\n }\n\n return dropTargetForElements({\n element: root,\n getData: () => data,\n canDrop: ({ source }) => {\n const data = getSourceData(source);\n return (data && eventHandler.canDrop?.({ source: data })) || false;\n },\n onDragEnter: () => {\n setActiveLocation(data.location);\n },\n onDragLeave: () => {\n setActiveLocation(undefined);\n },\n onDrop: () => {\n setActiveLocation(undefined);\n },\n });\n }, [rootRef, data, scrolling, setActiveLocation]);\n\n return (\n <Comp\n {...{\n [`data-${MOSAIC_PLACEHOLDER_ORIENTATION_ATTR}`]: orientation,\n [`data-${MOSAIC_PLACEHOLDER_STATE_ATTR}`]: data.location === activeLocation ? 'active' : 'idle',\n [`data-${MOSAIC_PLACEHOLDER_LOCATION_ATTR}`]: String(location),\n }}\n role='none'\n className={mx('relative', classNames)}\n ref={rootRef}\n >\n {children}\n </Comp>\n );\n};\n\nMosaicPlaceholder.displayName = MOSAIC_PLACEHOLDER_NAME;\n\n//\n// DropIndicator\n// TODO(burdon): Support DropIndicator or Placeholder variants.\n//\n\nconst DROP_INDICATOR_NAME = 'Mosaic.DropIndicator';\n\ntype MosaicDropIndicatorProps = Omit<NaturalDropIndicatorProps, 'edge'>;\n\nconst MosaicDropIndicator = (props: MosaicDropIndicatorProps) => {\n const { state } = useMosaicTileContext(DROP_INDICATOR_NAME);\n return state.type === 'target' && state.closestEdge ? (\n <NaturalDropIndicator {...props} edge={state.closestEdge} />\n ) : null;\n};\n\nMosaicDropIndicator.displayName = DROP_INDICATOR_NAME;\n\n//\n// Exports\n//\n\nexport { MosaicPlaceholder, MosaicDropIndicator };\n\nexport type { MosaicPlaceholderProps, MosaicDropIndicatorProps };\n", "//\n// Copyright 2026 DXOS.org\n//\n\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { type ReactVirtualizerOptions, useVirtualizer } from '@tanstack/react-virtual';\nimport React, {\n type FC,\n forwardRef,\n Fragment,\n type ReactElement,\n type Ref,\n useCallback,\n useEffect,\n useRef,\n} from 'react';\n\nimport { invariant } from '@dxos/invariant';\nimport { type Axis, type ThemedClassName } from '@dxos/react-ui';\nimport { composable, composableProps, mx } from '@dxos/ui-theme';\n\nimport { useVisibleItems } from '../../hooks';\nimport { useMosaicContainerContext } from './Container';\nimport { MosaicPlaceholder, type MosaicPlaceholderProps } from './Placeholder';\nimport { styles } from './styles';\nimport { type MosaicTileProps } from './Tile';\nimport { type GetId } from './types';\n\n//\n// Mosaic Drag-and-drop\n//\n// Drop targets:\n// - Placeholders exist to allow gaps but prevent deadspace when dragging within a container.\n// - When dragging over a Tile, the placeholder next to the closest edge is activated.\n// - Placeholders expand when active; event handlers are disabled while the container is scrolling.\n//\n// [Container]\n// - [Placeholder 0.5]\n// - [Tile 1 ]\n// - [Placeholder 1.5]\n// - [Tile 2 ]\n// - [Placeholder 2.5]\n// - [Tile 3 ]\n// - [Placeholder 3.5]\n//\n// Implementation Notes\n// - We use [Radix composition](https://www.radix-ui.com/primitives/docs/guides/composition) to factor out composible aspects (e.g., Focus, Mosaic, etc.)\n// - NOTE: Use Slottable only if needed to disambiguate; otherwise a suspected Radix bug causes compositional problems.\n\nconst MOSAIC_STACK_NAME = 'MosaicStack';\n\ntype MosaicStackTileComponent<TData = any> = FC<MosaicTileProps<TData>>;\n\ntype MosaicStackProps<TData = any> = ThemedClassName<\n {\n role?: string;\n orientation?: Axis;\n getId: GetId<TData>;\n items?: readonly TData[];\n scrollIntoView?: boolean;\n Tile: MosaicStackTileComponent<TData>;\n } & Pick<MosaicTileProps<TData>, 'draggable' | 'debug'>\n>;\n\n/**\n * Linear layout of Mosaic tiles.\n * NOTE: This is a low-level component and should be wrapped by a scrollable container.\n */\nconst MosaicStackInner = composable<HTMLDivElement, MosaicStackProps>(\n (\n {\n orientation: orientationProp = 'vertical',\n getId,\n items,\n scrollIntoView = true,\n Tile,\n draggable = true,\n debug,\n ...props\n },\n forwardedRef,\n ) => {\n const {\n id,\n orientation = orientationProp,\n dragging,\n currentId,\n selectedIds,\n registerScrollTo,\n } = useMosaicContainerContext(MOSAIC_STACK_NAME);\n const visibleItems = useVisibleItems({ id, items, dragging: dragging?.source.data, getId });\n invariant(orientation === 'vertical' || orientation === 'horizontal', `Invalid orientation: ${orientation}`);\n\n const rootRef = useRef<HTMLDivElement>(null);\n const scrollToId = useCallback(\n (targetId: string) => {\n if (!scrollIntoView) {\n return;\n }\n\n const el = rootRef.current?.querySelector<HTMLElement>(`[data-object-id=\"${CSS.escape(targetId)}\"]`);\n el?.scrollIntoView({ block: 'nearest', behavior: 'smooth' });\n },\n [scrollIntoView],\n );\n\n useEffect(() => {\n registerScrollTo(scrollToId);\n return () => registerScrollTo(undefined);\n }, [registerScrollTo, scrollToId]);\n\n const composedRef = useComposedRefs(rootRef, forwardedRef);\n return (\n <div\n {...composableProps(props, {\n role: 'list',\n classNames: [\n 'flex',\n orientation === 'horizontal' && 'h-full [&>*]:shrink-0',\n orientation === 'vertical' && 'flex-col',\n ],\n })}\n ref={composedRef}\n >\n {draggable && <InternalPlaceholder orientation={orientation} location={0.5} />}\n {visibleItems?.map((item, index) => (\n <Fragment key={getId(item)}>\n <Tile\n id={getId(item)}\n data={item}\n location={index + 1}\n draggable={draggable}\n current={getId(item) === currentId}\n selected={selectedIds?.has(getId(item))}\n debug={debug}\n />\n {draggable && <InternalPlaceholder orientation={orientation} location={index + 1.5} />}\n </Fragment>\n ))}\n </div>\n );\n },\n);\n\nMosaicStackInner.displayName = MOSAIC_STACK_NAME;\n\nconst MosaicStack = MosaicStackInner as <TData = any>(\n props: MosaicStackProps<TData> & { ref?: Ref<HTMLDivElement> },\n) => ReactElement;\n\n//\n// VirtualStack\n//\n\nconst MOSAIC_VIRTUAL_STACK_NAME = 'MosaicVirtualStack';\n\ntype MosaicVirtualStackProps<TData = any> = MosaicStackProps<TData> &\n Pick<\n ReactVirtualizerOptions<HTMLElement, HTMLDivElement>,\n 'estimateSize' | 'gap' | 'getScrollElement' | 'overscan' | 'onChange'\n >;\n\nconst MosaicVirtualStackInner = forwardRef<HTMLDivElement, MosaicVirtualStackProps>(\n (\n {\n orientation = 'vertical',\n getId,\n items,\n scrollIntoView = true,\n Tile,\n estimateSize,\n getScrollElement,\n overscan = 8,\n gap,\n onChange,\n draggable = true,\n debug,\n ...props\n },\n forwardedRef,\n ) => {\n invariant(Tile);\n const { id, dragging, currentId, selectedIds, registerScrollTo } =\n useMosaicContainerContext(MOSAIC_VIRTUAL_STACK_NAME);\n const visibleItems = useVisibleItems({ id, items, dragging: dragging?.source.data, getId });\n // In draggable mode virtual indices alternate: even=placeholder, odd=tile.\n // Wrap estimateSize so placeholders get 0 (their actual negligible height) and\n // tile slots receive the caller's estimate at the correct tile index.\n // This keeps getTotalSize() stable as items are measured → no scrollbar drift.\n const wrappedEstimateSize = draggable\n ? (index: number) => (index % 2 === 0 ? 0 : estimateSize(Math.floor(index / 2)))\n : estimateSize;\n\n const virtualizer = useVirtualizer({\n // NOTE: When draggable we double the number of items to allow for placeholders.\n count: draggable ? visibleItems.length * 2 + 1 : visibleItems.length,\n estimateSize: wrappedEstimateSize,\n gap,\n // Key measurements by stable item ID so the size cache survives scrolling;\n // without this, measurements are indexed by position and are lost when items reorder.\n getItemKey: draggable\n ? (index) => (index % 2 === 0 ? `ph-${index}` : getId(visibleItems![Math.floor(index / 2)]))\n : (index) => getId(visibleItems![index]),\n getScrollElement,\n overscan,\n onChange,\n });\n\n // Register scroll-to-item via virtualizer index lookup.\n const scrollToId = useCallback(\n (targetId: string) => {\n const itemIndex = visibleItems.findIndex((item) => getId(item) === targetId);\n if (itemIndex >= 0) {\n if (!scrollIntoView) {\n return;\n }\n\n const virtualIndex = draggable ? itemIndex * 2 + 1 : itemIndex;\n virtualizer.scrollToIndex(virtualIndex, { align: 'start', behavior: 'smooth' });\n }\n },\n [visibleItems, getId, draggable, virtualizer, scrollIntoView],\n );\n\n useEffect(() => {\n registerScrollTo(scrollToId);\n return () => registerScrollTo(undefined);\n }, [registerScrollTo, scrollToId]);\n\n const virtualItems = virtualizer.getVirtualItems();\n const getData = (index: number): { data?: any; location: number } => {\n if (draggable) {\n if (index % 2 === 0) {\n return { location: Math.floor(index / 2) + 0.5 };\n } else {\n return { data: visibleItems![Math.floor(index / 2)], location: Math.floor(index / 2) + 1 };\n }\n } else {\n return { data: visibleItems![index], location: index + 1 };\n }\n };\n\n return (\n <div\n {...composableProps(props, {\n role: 'list',\n classNames: [\n // shrink-0 is required: this div sets an explicit height via inline style (getTotalSize).\n // Without it, a parent flex container (e.g. ScrollArea.Viewport) would shrink this div\n // to the viewport height, collapsing the scroll content and causing scrollbar drift.\n 'flex shrink-0',\n orientation === 'horizontal' && 'h-full [&>*]:shrink-0',\n orientation === 'vertical' && 'flex-col',\n ],\n })}\n style={{\n position: 'relative',\n ...(orientation === 'vertical'\n ? {\n width: '100%',\n height: virtualizer.getTotalSize(),\n }\n : {\n width: virtualizer.getTotalSize(),\n height: '100%',\n }),\n }}\n ref={forwardedRef}\n >\n {virtualItems.map(({ key, index, start }) => {\n const { data, location } = getData(index);\n return (\n <div\n key={key}\n data-index={index}\n style={{\n position: 'absolute',\n top: 0,\n left: 0,\n ...(orientation === 'vertical'\n ? {\n width: '100%',\n transform: `translateY(${start}px)`,\n }\n : {\n height: '100%',\n transform: `translateX(${start}px)`,\n }),\n }}\n ref={virtualizer.measureElement}\n >\n {data ? (\n <Tile\n id={getId(data)}\n data={data}\n location={location}\n draggable={draggable}\n current={getId(data) === currentId}\n selected={selectedIds?.has(getId(data))}\n debug={debug}\n />\n ) : (\n <InternalPlaceholder orientation={orientation} location={location} />\n )}\n </div>\n );\n })}\n </div>\n );\n },\n);\n\nMosaicVirtualStackInner.displayName = MOSAIC_VIRTUAL_STACK_NAME;\n\nconst MosaicVirtualStack = MosaicVirtualStackInner as <TData = any>(\n props: MosaicVirtualStackProps<TData> & { ref?: Ref<HTMLDivElement> },\n) => ReactElement;\n(MosaicVirtualStack as any)[Symbol.for('dxos.composable')] = true;\n\n//\n// InternalPlaceholder\n//\n\nconst InternalPlaceholder = (props: MosaicPlaceholderProps<number>) => {\n return (\n <MosaicPlaceholder {...props} classNames={styles.placeholder.root}>\n <div\n className={mx(\n 'flex h-full bg-base-surface border border-dashed border-separator rounded-xs',\n styles.placeholder.content,\n )}\n />\n </MosaicPlaceholder>\n );\n};\n\nInternalPlaceholder.displayName = 'InternalPlaceholder';\n\n//\n// Exports\n//\n\nexport { MosaicStack, MosaicVirtualStack };\n\nexport type { MosaicStackTileComponent, MosaicStackProps, MosaicVirtualStackProps };\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport {\n MosaicContainer,\n type MosaicContainerProps,\n type MosaicContainerState,\n useMosaicContainerContext,\n} from './Container';\nimport {\n MosaicDropIndicator,\n type MosaicDropIndicatorProps,\n MosaicPlaceholder,\n type MosaicPlaceholderProps,\n} from './Placeholder';\nimport { MosaicRoot, type MosaicRootProps, useMosaicRootContext } from './Root';\nimport { MosaicStack, type MosaicStackProps, type MosaicStackTileComponent, MosaicVirtualStack } from './Stack';\nimport { MosaicTile, type MosaicTileProps, type MosaicTileState, useMosaicTileContext } from './Tile';\n\n//\n// Mosaic\n//\n\nexport const Mosaic = {\n Root: MosaicRoot,\n Container: MosaicContainer,\n Tile: MosaicTile,\n Placeholder: MosaicPlaceholder,\n DropIndicator: MosaicDropIndicator,\n Stack: MosaicStack,\n VirtualStack: MosaicVirtualStack,\n};\n\nexport type {\n MosaicRootProps,\n MosaicContainerProps,\n MosaicContainerState,\n MosaicTileProps,\n MosaicTileState,\n MosaicPlaceholderProps,\n MosaicDropIndicatorProps,\n MosaicStackProps,\n MosaicStackTileComponent,\n};\n\nexport {\n useMosaicRootContext as useMosaic,\n useMosaicContainerContext as useMosaicContainer,\n useMosaicTileContext as useMosaicTile,\n};\n"],
5
+ "mappings": ";;;AAIA,SAASA,eAAe;AAqBjB,IAAMC,kBAAkB,CAAc,EAC3CC,IACAC,OACAC,UACAC,MAAK,MACuB;AAC5B,QAAMC,eAAeN,QAAQ,MAAA;AAC3B,QAAI,CAACG,SAAS,CAACC,YAAYF,OAAOE,SAASG,aAAa;AACtD,aAAOJ,SAAS,CAAA;IAClB;AAEA,UAAMK,MAAML,MAAMM,UAAU,CAACC,SAASL,MAAMK,IAAAA,MAAUN,SAASF,EAAE;AACjE,QAAIM,QAAQ,IAAI;AACd,aAAOL;IACT;AAEA,UAAMG,gBAAeH,MAAMQ,MAAK;AAChCL,IAAAA,cAAaM,OAAOJ,KAAK,CAAA;AACzB,WAAOF;EACT,GAAG;IAACJ;IAAIC;IAAOC;IAAUC;GAAM;AAE/B,SAAOC;AACT;;;AC1CA,SAASO,OAAOC,gBAA2D;;;ACCpE,IAAMC,SAAS;EACpBC,aAAa;IACXC,MAAM;MACJ;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;;IAEFC,SAAS;MACP;;;;;MAKA;MACA;MACA;MACA;;EAEJ;AACF;;;ACfO,IAAMC,gBAAgB,CAC3BC,WAAAA;AAEA,SAAOA,OAAOC,KAAKC,SAAS,SAAUF,OAAOC,OAA4C;AAC3F;;;AChBA,SAASE,eAAe;AACxB,SAAkCC,0BAA0B;AAE5D,SAASC,uBAAuB;AAChC,SAASC,qBAAqB;AAC9B,SAASC,iBAAiB;AAC1B,SAASC,YAAY;AACrB,OAAOC,SAAiCC,YAAYC,aAAaC,WAAWC,QAAQC,gBAAgB;AAEpG,SAASC,WAAW;AA+BpB,IAAA,eAAOC;AAGP,IAAA,CAAO,2BAAA,oBAAA,IAAA,cAAA,YAAA;AAMP,IAAMC,mBAAAA;IAQJ,yBAAuC;IACvC,aAAoBZ,2B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AAI7B;cAEEsB;2BACY,aAAaQ;UAE3B,OAAA;UACEN,WAAQ,cAAA,KAAA;YACRO;UACD,QAAA;UACP,WAAA,cAAA,KAAA;QACA9B;MAEC+B;MAEGhD,KAAIG,YAAM6C;cACJA,gBAAAA,OAAAA,cAAAA,MAAAA;MACN5B,IAAAA,MAAUA,IAAAA;MACVrB;MACAuB;MACAC,WAAUC;MACVC,SAAOA,MAAAA,IAAAA,MAAAA;6BAGT,IAAA,MAAA,IAACwB,CAAAA;MAAoBjC;SAAoCI,gBAAAA,OAAAA,cAAAA,qBAAAA;;MAIjE;IAGN,CAAA,CAAA;EAGF8B,CAAAA,CAAAA;AAEA,CAAA;AAGCC,wBAA2BC,cAAW;AAEvC,IAAE,qBAAA;AACF,mBAAA,uBAAsB,IAAA,iBAAA,CAAA,IAAA;0BAKU,CAAA,UAAA;SAAcC,gBAAAA,OAAOC,cAAgB,mBAAA;;IAE7DC,YAAWC,OACT,YAAA;;IAMV,WAAAA,IAAA,gFAAA,OAAA,YAAA,OAAA;EAEAP,CAAAA,CAAAA;AAEA;AACA,oBAAU,cAAA;;;AC3TH,IAAMQ,SAAS;EACpBC,MAAMC;EACNC,WAAWC;EACXC,MAAMC;EACNC,aAAaC;EACbC,eAAeC;EACfC,OAAOC;EACPC,cAAcC;AAChB;",
6
+ "names": ["useMemo", "useVisibleItems", "id", "items", "dragging", "getId", "visibleItems", "containerId", "idx", "findIndex", "item", "slice", "splice", "Focus", "useFocus", "styles", "placeholder", "root", "content", "getSourceData", "source", "data", "type", "combine", "monitorForElements", "useComposedRefs", "createContext", "Primitive", "Slot", "React", "forwardRef", "useCallback", "useEffect", "useRef", "useState", "log", "MosaicRootContextProvider", "MOSAIC_ROOT_DEBUG_ATTR", "rootRef", "forwardedRef", "Comp", "asChild", "setHandlers", "dragging", "setDragging", "getSourceHandler", "source", "data", "handler", "handlers", "target", "containerId", "type", "targetData", "getTargetHandler", "onCancel", "container", "location", "dropTargets", "find", "requestAnimationFrame", "bubbles", "noTargetTimeout", "current", "handleChange", "clientX", "onDrag", "position", "x", "y", "sourceData", "sourceHandler", "warn", "object", "targetHandler", "handleCancel", "removeContainer", "containers", "className", "debug", "ref", "composedRef", "children", "MosaicRoot", "displayName", "autoScrollForElements", "combine", "dropTargetForElements", "useComposedRefs", "createContext", "Primitive", "Slot", "bind", "React", "useCallback", "useEffect", "useMemo", "useRef", "useState", "composable", "composableProps", "isTruthy", "MOSAIC_CONTAINER_NAME", "MosaicContainerContextProvider", "useMosaicContainerContext", "createContext", "MOSAIC_CONTAINER_STATE_ATTR", "MOSAIC_CONTAINER_PLACEHOLDER_WIDTH", "MOSAIC_CONTAINER_PLACEHOLDER_HEIGHT", "counter", "MosaicContainer", "composable", "children", "eventHandler", "eventHandlerProp", "orientation", "asChild", "autoScroll", "autoscrollElement", "withFocus", "currentId", "onCurrentChange", "selectedIds", "onSelectionChange", "debug", "props", "forwardedRef", "Comp", "Slot", "Primitive", "div", "rootRef", "useRef", "composedRef", "useComposedRefs", "useMemo", "id", "dragging", "useMosaicRootContext", "state", "setState", "useState", "type", "activeLocation", "setActiveLocation", "scrolling", "setScrolling", "setCurrentId", "useCallback", "setSelected", "selected", "scrollToRef", "undefined", "registerScrollTo", "fn", "current", "useEffect", "setFocus", "useFocus", "addContainer", "removeContainer", "data", "timeout", "handleScroll", "clearTimeout", "setTimeout", "combine", "bind", "listener", "dropTargetForElements", "element", "getData", "canDrop", "source", "getSourceData", "onDragStart", "sourceData", "bounds", "onDragEnter", "onDragLeave", "containerId", "onDrop", "autoScrollForElements", "getAllowedAxis", "getConfiguration", "maxScrollSpeed", "filter", "isTruthy", "flatMap", "x", "React", "composableProps", "classNames", "style", "width", "height", "ref", "displayName", "attachClosestEdge", "extractClosestEdge", "combine", "draggable", "dropTargetForElements", "preserveOffsetOnSource", "setCustomNativeDragPreview", "composeRefs", "createContext", "Primitive", "Slot", "React", "useLayoutEffect", "useMemo", "useRef", "useState", "createPortal", "composableProps", "slottable", "MOSAIC_TILE_NAME", "MosaicTileContextProvider", "useMosaicTileContext", "createContext", "MOSAIC_TILE_STATE_ATTR", "MosaicTile", "slottable", "children", "asChild", "dragHandle", "allowedEdges", "allowedEdgesProp", "location", "id", "data", "dataProp", "draggable", "draggableProp", "current", "selected", "debug", "_", "props", "forwardedRef", "Comp", "Slot", "Primitive", "div", "rootRef", "useRef", "composedRef", "composeRefs", "containerId", "eventHandler", "orientation", "scrolling", "setActiveLocation", "useMosaicContainerContext", "state", "setState", "useState", "type", "useMemo", "useLayoutEffect", "root", "handleChange", "self", "source", "closestEdge", "extractClosestEdge", "combine", "element", "undefined", "canDrag", "getInitialData", "onGenerateDragPreview", "nativeSetDragImage", "setCustomNativeDragPreview", "getOffset", "preserveOffsetOnSource", "input", "render", "container", "bounds", "getBoundingClientRect", "rect", "onDragStart", "onDrop", "dropTargetForElements", "getData", "attachClosestEdge", "canDrop", "getSourceData", "onDragEnter", "onDragLeave", "onDrag", "className", "rest", "composableProps", "classNames", "React", "role", "aria-current", "aria-selected", "ref", "createPortal", "style", "width", "height", "displayName", "DropIndicator", "NaturalDropIndicator", "dropTargetForElements", "Primitive", "Slot", "React", "useLayoutEffect", "useMemo", "useRef", "mx", "MOSAIC_PLACEHOLDER_NAME", "MOSAIC_PLACEHOLDER_ORIENTATION_ATTR", "MOSAIC_PLACEHOLDER_STATE_ATTR", "MOSAIC_PLACEHOLDER_LOCATION_ATTR", "MosaicPlaceholder", "classNames", "children", "asChild", "orientation", "location", "rootRef", "useRef", "Comp", "Slot", "Primitive", "div", "id", "containerId", "eventHandler", "scrolling", "activeLocation", "setActiveLocation", "useMosaicContainerContext", "data", "useMemo", "type", "useLayoutEffect", "root", "current", "dropTargetForElements", "element", "getData", "canDrop", "source", "getSourceData", "onDragEnter", "onDragLeave", "undefined", "onDrop", "React", "String", "role", "className", "mx", "ref", "displayName", "DROP_INDICATOR_NAME", "MosaicDropIndicator", "props", "state", "useMosaicTileContext", "closestEdge", "NaturalDropIndicator", "edge", "useComposedRefs", "useVirtualizer", "React", "forwardRef", "Fragment", "useCallback", "useEffect", "useRef", "invariant", "composable", "composableProps", "mx", "__dxlog_file", "visibleItems", "useVisibleItems", "draggable", "id", "items", "dragging", "getId", "invariant", "scrollToId", "useCallback", "targetId", "scrollIntoView", "el", "block", "behavior", "useEffect", "registerScrollTo", "composableProps", "React", "orientation", "ref", "Tile", "item", "location", "index", "current", "selected", "selectedIds", "debug", "MosaicStackInner", "useMosaicContainerContext", "MOSAIC_VIRTUAL_STACK_NAME", "count", "gap", "overscan", "onChange", "itemIndex", "virtualizer", "align", "Math", "style", "width", "getTotalSize", "height", "virtualItems", "div", "key", "top", "left", "start", "transform", "data", "InternalPlaceholder", "MosaicVirtualStackInner", "MosaicVirtualStack", "Symbol", "styles", "placeholder", "className", "mx", "Mosaic", "Root", "MosaicRoot", "Container", "MosaicContainer", "Tile", "MosaicTile", "Placeholder", "MosaicPlaceholder", "DropIndicator", "MosaicDropIndicator", "Stack", "MosaicStack", "VirtualStack", "MosaicVirtualStack"]
7
+ }