@dxos/react-ui-mosaic 0.9.1-staging.ee54ba693a → 0.11.0
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.
- package/dist/lib/chunk-Mosaic.mjs +1024 -0
- package/dist/lib/chunk-Mosaic.mjs.map +1 -0
- package/dist/lib/index.mjs +653 -0
- package/dist/lib/index.mjs.map +1 -0
- package/dist/lib/playwright.mjs +200 -0
- package/dist/lib/playwright.mjs.map +1 -0
- package/dist/lib/testing.mjs +127 -0
- package/dist/lib/testing.mjs.map +1 -0
- package/dist/lib/translations.mjs +11 -0
- package/dist/lib/translations.mjs.map +1 -0
- package/dist/types/src/components/Board/Board.d.ts +7 -27
- package/dist/types/src/components/Board/Board.d.ts.map +1 -1
- package/dist/types/src/components/Board/Board.stories.d.ts.map +1 -1
- package/dist/types/src/components/Board/BoardColumnContext.d.ts +10 -0
- package/dist/types/src/components/Board/BoardColumnContext.d.ts.map +1 -0
- package/dist/types/src/components/Board/BoardContext.d.ts +26 -0
- package/dist/types/src/components/Board/BoardContext.d.ts.map +1 -0
- package/dist/types/src/components/Board/Column.d.ts +2 -7
- package/dist/types/src/components/Board/Column.d.ts.map +1 -1
- package/dist/types/src/components/Board/index.d.ts +2 -0
- package/dist/types/src/components/Board/index.d.ts.map +1 -1
- package/dist/types/src/components/Focus/Focus.d.ts.map +1 -1
- package/dist/types/src/components/Mosaic/Container.d.ts +6 -34
- package/dist/types/src/components/Mosaic/Container.d.ts.map +1 -1
- package/dist/types/src/components/Mosaic/Mosaic.d.ts +10 -15
- package/dist/types/src/components/Mosaic/Mosaic.d.ts.map +1 -1
- package/dist/types/src/components/Mosaic/MosaicContainerContext.d.ts +34 -0
- package/dist/types/src/components/Mosaic/MosaicContainerContext.d.ts.map +1 -0
- package/dist/types/src/components/Mosaic/MosaicTileContext.d.ts +31 -0
- package/dist/types/src/components/Mosaic/MosaicTileContext.d.ts.map +1 -0
- package/dist/types/src/components/Mosaic/Placeholder.d.ts +3 -3
- package/dist/types/src/components/Mosaic/Placeholder.d.ts.map +1 -1
- package/dist/types/src/components/Mosaic/Stack.d.ts +8 -2
- package/dist/types/src/components/Mosaic/Stack.d.ts.map +1 -1
- package/dist/types/src/components/Mosaic/Stack.stories.d.ts.map +1 -1
- package/dist/types/src/components/Mosaic/Tile.d.ts +6 -32
- package/dist/types/src/components/Mosaic/Tile.d.ts.map +1 -1
- package/dist/types/src/components/Mosaic/VirtualStackPagination.stories.d.ts +13 -0
- package/dist/types/src/components/Mosaic/VirtualStackPagination.stories.d.ts.map +1 -0
- package/dist/types/src/components/Mosaic/index.d.ts +0 -1
- package/dist/types/src/components/Mosaic/index.d.ts.map +1 -1
- package/dist/types/src/components/SearchStack/SearchStack.d.ts +1 -1
- package/dist/types/src/components/SearchStack/SearchStack.d.ts.map +1 -1
- package/dist/types/src/hooks/index.d.ts +1 -0
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useDefaultColumnEventHandler.d.ts +2 -2
- package/dist/types/src/hooks/useDefaultColumnEventHandler.d.ts.map +1 -1
- package/dist/types/src/hooks/useEventHandlerAdapter.d.ts +3 -3
- package/dist/types/src/hooks/useEventHandlerAdapter.d.ts.map +1 -1
- package/dist/types/src/hooks/useVirtualizerPagination.d.ts +60 -0
- package/dist/types/src/hooks/useVirtualizerPagination.d.ts.map +1 -0
- package/dist/types/src/hooks/useVirtualizerPagination.test.d.ts +2 -0
- package/dist/types/src/hooks/useVirtualizerPagination.test.d.ts.map +1 -0
- package/dist/types/src/hooks/useVisibleItems.d.ts +2 -2
- package/dist/types/src/hooks/useVisibleItems.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +35 -37
- package/src/components/Board/Board.stories.tsx +7 -6
- package/src/components/Board/Board.tsx +9 -54
- package/src/components/Board/BoardColumnContext.ts +25 -0
- package/src/components/Board/BoardContext.ts +43 -0
- package/src/components/Board/Column.tsx +13 -27
- package/src/components/Board/Item.tsx +2 -2
- package/src/components/Board/index.ts +3 -0
- package/src/components/Mosaic/Container.tsx +31 -53
- package/src/components/Mosaic/DragHandle.tsx +1 -1
- package/src/components/Mosaic/{Mosaic.tsx → Mosaic.ts} +5 -16
- package/src/components/Mosaic/MosaicContainerContext.ts +44 -0
- package/src/components/Mosaic/MosaicTileContext.ts +34 -0
- package/src/components/Mosaic/Placeholder.tsx +7 -8
- package/src/components/Mosaic/ResizeHandle.stories.tsx +4 -4
- package/src/components/Mosaic/ResizeHandle.tsx +2 -2
- package/src/components/Mosaic/Stack.stories.tsx +49 -13
- package/src/components/Mosaic/Stack.tsx +30 -9
- package/src/components/Mosaic/Tile.tsx +33 -33
- package/src/components/Mosaic/VirtualStackPagination.stories.tsx +423 -0
- package/src/components/Mosaic/index.ts +0 -1
- package/src/hooks/index.ts +1 -0
- package/src/hooks/useDefaultColumnEventHandler.ts +2 -2
- package/src/hooks/useEventHandlerAdapter.ts +4 -5
- package/src/hooks/useVirtualizerPagination.test.tsx +105 -0
- package/src/hooks/useVirtualizerPagination.ts +473 -0
- package/src/hooks/useVisibleItems.ts +2 -2
- package/src/playwright/smoke.spec.ts +4 -1
- package/src/testing/DefaultStackTile.tsx +1 -1
- package/src/testing/decorator.tsx +3 -3
- package/dist/lib/browser/chunk-OBVIYZLR.mjs +0 -1119
- package/dist/lib/browser/chunk-OBVIYZLR.mjs.map +0 -7
- package/dist/lib/browser/index.mjs +0 -701
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/playwright/index.mjs +0 -256
- package/dist/lib/browser/playwright/index.mjs.map +0 -7
- package/dist/lib/browser/testing/index.mjs +0 -136
- package/dist/lib/browser/testing/index.mjs.map +0 -7
- package/dist/lib/browser/translations.mjs +0 -18
- package/dist/lib/browser/translations.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-4IEMCMIV.mjs +0 -1121
- package/dist/lib/node-esm/chunk-4IEMCMIV.mjs.map +0 -7
- package/dist/lib/node-esm/index.mjs +0 -702
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/lib/node-esm/playwright/index.mjs +0 -258
- package/dist/lib/node-esm/playwright/index.mjs.map +0 -7
- package/dist/lib/node-esm/testing/index.mjs +0 -137
- package/dist/lib/node-esm/testing/index.mjs.map +0 -7
- package/dist/lib/node-esm/translations.mjs +0 -20
- package/dist/lib/node-esm/translations.mjs.map +0 -7
- package/dist/types/src/components/Mosaic/Root.d.ts +0 -35
- package/dist/types/src/components/Mosaic/Root.d.ts.map +0 -1
- package/dist/types/src/components/Mosaic/types.d.ts +0 -86
- package/dist/types/src/components/Mosaic/types.d.ts.map +0 -1
- package/src/components/Mosaic/Root.tsx +0 -288
- package/src/components/Mosaic/types.ts +0 -94
- /package/src/components/Focus/{Focus.tsx → Focus.ts} +0 -0
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { type ElementDragPayload } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';
|
|
6
|
-
|
|
7
|
-
export type GetId<TData = any> = (data: TData) => string;
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* NOTE: Must implement value equivalence.
|
|
11
|
-
*/
|
|
12
|
-
export type LocationType = string | number;
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Get the source data from the drag payload.
|
|
16
|
-
*/
|
|
17
|
-
export const getSourceData = <TData = any, TLocation = any>(
|
|
18
|
-
source: ElementDragPayload,
|
|
19
|
-
): MosaicTileData<TData, TLocation> | null => {
|
|
20
|
-
return source.data.type === 'tile' ? (source.data as MosaicTileData<TData, TLocation>) : null;
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Draggable item.
|
|
25
|
-
* Tiles may contain arbitrary data (which may not be an ECHO object; e.g., search result).
|
|
26
|
-
*/
|
|
27
|
-
export type MosaicTileData<TData = any, TLocation = any> = {
|
|
28
|
-
type: 'tile';
|
|
29
|
-
containerId: string;
|
|
30
|
-
id: string;
|
|
31
|
-
data: TData;
|
|
32
|
-
location: TLocation;
|
|
33
|
-
bounds?: DOMRect;
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Drop target placeholder.
|
|
38
|
-
*/
|
|
39
|
-
export type MosaicPlaceholderData<TLocation = any> = {
|
|
40
|
-
type: 'placeholder';
|
|
41
|
-
containerId: string;
|
|
42
|
-
location: TLocation;
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* Drop target container.
|
|
47
|
-
*/
|
|
48
|
-
export type MosaicContainerData = {
|
|
49
|
-
type: 'container';
|
|
50
|
-
id: string;
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
export type MosaicData = MosaicTileData | MosaicPlaceholderData | MosaicContainerData;
|
|
54
|
-
|
|
55
|
-
export type MosaicTargetData = MosaicTileData | MosaicPlaceholderData;
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* Handler implemented by drop containers.
|
|
59
|
-
*/
|
|
60
|
-
export interface MosaicEventHandler<TData = any, TObject = any> {
|
|
61
|
-
/**
|
|
62
|
-
* Container identifier.
|
|
63
|
-
*/
|
|
64
|
-
id: string;
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* Determine if the item can be dropped into this container.
|
|
68
|
-
* NOTE: This is continuously called while dragging (doesn't require mouse movement).
|
|
69
|
-
*/
|
|
70
|
-
canDrop?: (props: { source: MosaicTileData<TData> }) => boolean;
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* Called during drag for custom visualization.
|
|
74
|
-
*/
|
|
75
|
-
onDrag?: (props: { source: MosaicTileData<TData>; position: { x: number; y: number } }) => void;
|
|
76
|
-
|
|
77
|
-
/**
|
|
78
|
-
* Insert/rearrange the item at the given location.
|
|
79
|
-
*/
|
|
80
|
-
onDrop?: (props: { source: MosaicTileData<TData>; target?: MosaicData }) => void;
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* Request the object to be dropped.
|
|
84
|
-
* This allows the source container to clone/mutate/swap the object before it is dropped.
|
|
85
|
-
* If the callback returns true, then the callback may decide to remove the item from the source container,
|
|
86
|
-
* completing the transfer.
|
|
87
|
-
*/
|
|
88
|
-
onTake?: (props: { source: MosaicTileData<TData> }, cb: (object: TObject) => Promise<boolean>) => void;
|
|
89
|
-
|
|
90
|
-
/**
|
|
91
|
-
* Dragging ended.
|
|
92
|
-
*/
|
|
93
|
-
onCancel?: () => void;
|
|
94
|
-
}
|
|
File without changes
|