@dxos/react-ui-mosaic 0.8.4-main.69d29f4 → 0.8.4-main.9735255
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/browser/{chunk-4VDZJ3HV.mjs → chunk-UMBPEG4F.mjs} +47 -49
- package/dist/lib/browser/chunk-UMBPEG4F.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +1 -1
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs +16 -14
- package/dist/lib/browser/testing/index.mjs.map +3 -3
- package/dist/lib/node-esm/{chunk-KONKDEUD.mjs → chunk-X6GV7SMK.mjs} +47 -49
- package/dist/lib/node-esm/chunk-X6GV7SMK.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +1 -1
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/testing/index.mjs +16 -14
- package/dist/lib/node-esm/testing/index.mjs.map +3 -3
- package/dist/types/src/components/Card/Card.d.ts +2 -1
- package/dist/types/src/components/Card/Card.d.ts.map +1 -1
- package/dist/types/src/components/Focus/Focus.d.ts.map +1 -1
- package/dist/types/src/components/Mosaic/Mosaic.d.ts +8 -1
- package/dist/types/src/components/Mosaic/Mosaic.d.ts.map +1 -1
- package/dist/types/src/components/Scrollable/Scrollable.d.ts +11 -4
- package/dist/types/src/components/Scrollable/Scrollable.d.ts.map +1 -1
- package/dist/types/src/components/Scrollable/Scrollable.stories.d.ts +6 -4
- package/dist/types/src/components/Scrollable/Scrollable.stories.d.ts.map +1 -1
- package/dist/types/src/components/Stack/Stack.d.ts +4 -6
- package/dist/types/src/components/Stack/Stack.d.ts.map +1 -1
- package/dist/types/src/testing/Board.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +22 -22
- package/src/components/Card/Card.tsx +25 -2
- package/src/components/Focus/Focus.tsx +2 -0
- package/src/components/Mosaic/Mosaic.tsx +32 -33
- package/src/components/Scrollable/Scrollable.stories.tsx +34 -8
- package/src/components/Scrollable/Scrollable.tsx +7 -18
- package/src/components/Stack/Stack.stories.tsx +8 -8
- package/src/components/Stack/Stack.tsx +10 -10
- package/src/testing/Board.tsx +11 -11
- package/src/testing/Virtualizer.stories.tsx +3 -3
- package/dist/lib/browser/chunk-4VDZJ3HV.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-KONKDEUD.mjs.map +0 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"src/components/Card/styles.ts":{"bytes":2466,"imports":[],"format":"esm"},"src/translations.ts":{"bytes":1059,"imports":[],"format":"esm"},"src/components/Image/Image.tsx":{"bytes":22239,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true}],"format":"esm"},"src/components/Image/index.ts":{"bytes":464,"imports":[{"path":"src/components/Image/Image.tsx","kind":"import-statement","original":"./Image"}],"format":"esm"},"src/components/Card/Card.tsx":{"bytes":33430,"imports":[{"path":"@radix-ui/react-slot","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"src/translations.ts","kind":"import-statement","original":"../../translations"},{"path":"src/components/Image/index.ts","kind":"import-statement","original":"../Image"},{"path":"src/components/Card/styles.ts","kind":"import-statement","original":"./styles"}],"format":"esm"},"src/components/Card/CardDragPreview.tsx":{"bytes":2399,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"src/components/Card/styles.ts","kind":"import-statement","original":"./styles"}],"format":"esm"},"src/components/Card/index.ts":{"bytes":758,"imports":[{"path":"src/components/Card/styles.ts","kind":"import-statement","original":"./styles"},{"path":"src/components/Card/Card.tsx","kind":"import-statement","original":"./Card"},{"path":"src/components/Card/CardDragPreview.tsx","kind":"import-statement","original":"./CardDragPreview"}],"format":"esm"},"src/components/Focus/styles.ts":{"bytes":2242,"imports":[],"format":"esm"},"src/components/Focus/Focus.tsx":{"bytes":7662,"imports":[{"path":"@fluentui/react-tabster","kind":"import-statement","external":true},{"path":"@radix-ui/react-compose-refs","kind":"import-statement","external":true},{"path":"@radix-ui/react-primitive","kind":"import-statement","external":true},{"path":"@radix-ui/react-slot","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"src/components/Focus/styles.ts","kind":"import-statement","original":"./styles"}],"format":"esm"},"src/components/Focus/index.ts":{"bytes":658,"imports":[{"path":"src/components/Focus/styles.ts","kind":"import-statement","original":"./styles"},{"path":"src/components/Focus/Focus.tsx","kind":"import-statement","original":"./Focus"}],"format":"esm"},"src/components/Layout/Layout.tsx":{"bytes":6547,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true}],"format":"esm"},"src/components/Layout/index.ts":{"bytes":470,"imports":[{"path":"src/components/Layout/Layout.tsx","kind":"import-statement","original":"./Layout"}],"format":"esm"},"src/components/Mosaic/styles.ts":{"bytes":4082,"imports":[],"format":"esm"},"src/components/Mosaic/extension.ts":{"bytes":14399,"imports":[{"path":"@codemirror/state","kind":"import-statement","external":true},{"path":"@codemirror/view","kind":"import-statement","external":true}],"format":"esm"},"src/components/Mosaic/types.ts":{"bytes":3507,"imports":[],"format":"esm"},"src/components/Scrollable/scrollable.css":{"bytes":736,"imports":[]},"src/components/Scrollable/Scrollable.tsx":{"bytes":8533,"imports":[{"path":"overlayscrollbars-react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"overlayscrollbars/styles/overlayscrollbars.css","kind":"import-statement","external":true},{"path":"src/components/Scrollable/scrollable.css","kind":"import-statement","original":"./scrollable.css"}],"format":"esm"},"src/components/Scrollable/index.ts":{"bytes":482,"imports":[{"path":"src/components/Scrollable/Scrollable.tsx","kind":"import-statement","original":"./Scrollable"}],"format":"esm"},"src/hooks/useContainerDebug.tsx":{"bytes":5641,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"react-dom","kind":"import-statement","external":true},{"path":"@dxos/react-ui-syntax-highlighter","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"src/components/index.ts","kind":"import-statement","original":"../components"}],"format":"esm"},"src/hooks/useEventHandlerAdapter.ts":{"bytes":8069,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"src/hooks/useVisibleItems.ts":{"bytes":3168,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"src/hooks/index.ts":{"bytes":714,"imports":[{"path":"src/hooks/useContainerDebug.tsx","kind":"import-statement","original":"./useContainerDebug"},{"path":"src/hooks/useEventHandlerAdapter.ts","kind":"import-statement","original":"./useEventHandlerAdapter"},{"path":"src/hooks/useVisibleItems.ts","kind":"import-statement","original":"./useVisibleItems"}],"format":"esm"},"src/components/Stack/Stack.tsx":{"bytes":17753,"imports":[{"path":"@tanstack/react-virtual","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"src/hooks/index.ts","kind":"import-statement","original":"../../hooks"},{"path":"src/components/Mosaic/index.ts","kind":"import-statement","original":"../Mosaic"},{"path":"src/components/Mosaic/index.ts","kind":"import-statement","original":"../Mosaic"}],"format":"esm"},"src/components/Stack/index.ts":{"bytes":464,"imports":[{"path":"src/components/Stack/Stack.tsx","kind":"import-statement","original":"./Stack"}],"format":"esm"},"src/components/Mosaic/Mosaic.tsx":{"bytes":85928,"imports":[{"path":"@atlaskit/pragmatic-drag-and-drop/combine","kind":"import-statement","external":true},{"path":"@atlaskit/pragmatic-drag-and-drop/element/adapter","kind":"import-statement","external":true},{"path":"@atlaskit/pragmatic-drag-and-drop/element/preserve-offset-on-source","kind":"import-statement","external":true},{"path":"@atlaskit/pragmatic-drag-and-drop/element/set-custom-native-drag-preview","kind":"import-statement","external":true},{"path":"@atlaskit/pragmatic-drag-and-drop-auto-scroll/element","kind":"import-statement","external":true},{"path":"@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge","kind":"import-statement","external":true},{"path":"@atlaskit/pragmatic-drag-and-drop-react-drop-indicator/box","kind":"import-statement","external":true},{"path":"@radix-ui/react-compose-refs","kind":"import-statement","external":true},{"path":"@radix-ui/react-context","kind":"import-statement","external":true},{"path":"@radix-ui/react-primitive","kind":"import-statement","external":true},{"path":"@radix-ui/react-slot","kind":"import-statement","external":true},{"path":"bind-event-listener","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react-dom","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"src/components/Focus/index.ts","kind":"import-statement","original":"../Focus"},{"path":"src/components/Scrollable/index.ts","kind":"import-statement","original":"../Scrollable"},{"path":"src/components/Stack/index.ts","kind":"import-statement","original":"../Stack"}],"format":"esm"},"src/components/Mosaic/index.ts":{"bytes":839,"imports":[{"path":"src/components/Mosaic/styles.ts","kind":"import-statement","original":"./styles"},{"path":"src/components/Mosaic/extension.ts","kind":"import-statement","original":"./extension"},{"path":"src/components/Mosaic/types.ts","kind":"import-statement","original":"./types"},{"path":"src/components/Mosaic/Mosaic.tsx","kind":"import-statement","original":"./Mosaic"}],"format":"esm"},"src/components/index.ts":{"bytes":868,"imports":[{"path":"src/components/Card/index.ts","kind":"import-statement","original":"./Card"},{"path":"src/components/Focus/index.ts","kind":"import-statement","original":"./Focus"},{"path":"src/components/Image/index.ts","kind":"import-statement","original":"./Image"},{"path":"src/components/Layout/index.ts","kind":"import-statement","original":"./Layout"},{"path":"src/components/Mosaic/index.ts","kind":"import-statement","original":"./Mosaic"},{"path":"src/components/Stack/index.ts","kind":"import-statement","original":"./Stack"}],"format":"esm"},"src/index.ts":{"bytes":541,"imports":[{"path":"src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"src/hooks/index.ts","kind":"import-statement","original":"./hooks"}],"format":"esm"},"src/testing/decorator.tsx":{"bytes":1207,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/components/index.ts","kind":"import-statement","original":"../components"}],"format":"esm"},"src/testing/Board.tsx":{"bytes":27496,"imports":[{"path":"@radix-ui/react-compose-refs","kind":"import-statement","external":true},{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-syntax-highlighter","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"src/components/index.ts","kind":"import-statement","original":"../components"},{"path":"src/hooks/index.ts","kind":"import-statement","original":"../hooks"}],"format":"esm"},"src/testing/CardContainer.tsx":{"bytes":7835,"imports":[{"path":"@radix-ui/react-use-controllable-state","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-dnd","kind":"import-statement","external":true}],"format":"esm"},"src/testing/DefaultStackTile.tsx":{"bytes":4268,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-syntax-highlighter","kind":"import-statement","external":true},{"path":"src/components/index.ts","kind":"import-statement","original":"../components"}],"format":"esm"},"src/testing/index.ts":{"bytes":761,"imports":[{"path":"src/testing/decorator.tsx","kind":"import-statement","original":"./decorator"},{"path":"src/testing/Board.tsx","kind":"import-statement","original":"./Board"},{"path":"src/testing/CardContainer.tsx","kind":"import-statement","original":"./CardContainer"},{"path":"src/testing/DefaultStackTile.tsx","kind":"import-statement","original":"./DefaultStackTile"}],"format":"esm"}},"outputs":{"dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":4810},"dist/lib/browser/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-4VDZJ3HV.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true}],"exports":["Card","CardDragPreview","Focus","Image","Layout","Mosaic","Stack","VirtualStack","cardStyles","dropHandler","focusStyles","mosaicStyles","useContainerDebug","useEventHandlerAdapter","useFocus","useMosaic","useMosaicContainer","useMosaicTile","useVisibleItems"],"entryPoint":"src/index.ts","cssBundle":"dist/lib/browser/index.css","inputs":{"src/components/Card/index.ts":{"bytesInOutput":0},"src/components/Card/CardDragPreview.tsx":{"bytesInOutput":492},"src/components/Layout/Layout.tsx":{"bytesInOutput":1395},"src/index.ts":{"bytesInOutput":0}},"bytes":2669},"dist/lib/browser/testing/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":21523},"dist/lib/browser/testing/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-4VDZJ3HV.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@radix-ui/react-compose-refs","kind":"import-statement","external":true},{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-syntax-highlighter","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"@radix-ui/react-use-controllable-state","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-dnd","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-syntax-highlighter","kind":"import-statement","external":true}],"exports":["Board","CardContainer","Debug","DefaultStackTile","IntrinsicCardContainer","PopoverCardContainer","TestColumn","TestItem","withMosaic"],"entryPoint":"src/testing/index.ts","cssBundle":"dist/lib/browser/testing/index.css","inputs":{"src/testing/decorator.tsx":{"bytesInOutput":181},"src/testing/index.ts":{"bytesInOutput":0},"src/testing/Board.tsx":{"bytesInOutput":7130},"src/testing/CardContainer.tsx":{"bytesInOutput":1961},"src/testing/DefaultStackTile.tsx":{"bytesInOutput":1086}},"bytes":10829},"dist/lib/browser/chunk-4VDZJ3HV.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":110852},"dist/lib/browser/chunk-4VDZJ3HV.mjs":{"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"@radix-ui/react-slot","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"@fluentui/react-tabster","kind":"import-statement","external":true},{"path":"@radix-ui/react-compose-refs","kind":"import-statement","external":true},{"path":"@radix-ui/react-primitive","kind":"import-statement","external":true},{"path":"@radix-ui/react-slot","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"@codemirror/state","kind":"import-statement","external":true},{"path":"@codemirror/view","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react-dom","kind":"import-statement","external":true},{"path":"@dxos/react-ui-syntax-highlighter","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"@atlaskit/pragmatic-drag-and-drop/combine","kind":"import-statement","external":true},{"path":"@atlaskit/pragmatic-drag-and-drop/element/adapter","kind":"import-statement","external":true},{"path":"@atlaskit/pragmatic-drag-and-drop/element/preserve-offset-on-source","kind":"import-statement","external":true},{"path":"@atlaskit/pragmatic-drag-and-drop/element/set-custom-native-drag-preview","kind":"import-statement","external":true},{"path":"@atlaskit/pragmatic-drag-and-drop-auto-scroll/element","kind":"import-statement","external":true},{"path":"@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge","kind":"import-statement","external":true},{"path":"@atlaskit/pragmatic-drag-and-drop-react-drop-indicator/box","kind":"import-statement","external":true},{"path":"@radix-ui/react-compose-refs","kind":"import-statement","external":true},{"path":"@radix-ui/react-context","kind":"import-statement","external":true},{"path":"@radix-ui/react-primitive","kind":"import-statement","external":true},{"path":"@radix-ui/react-slot","kind":"import-statement","external":true},{"path":"bind-event-listener","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react-dom","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"overlayscrollbars-react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"overlayscrollbars/styles/overlayscrollbars.css","kind":"import-statement","external":true},{"path":"@tanstack/react-virtual","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true}],"exports":["Card","Focus","Image","Mosaic","Stack","VirtualStack","dropHandler","styles","styles2","styles3","useContainerContext","useContainerDebug","useEventHandlerAdapter","useFocus","useRootContext","useTileContext","useVisibleItems"],"inputs":{"src/components/Card/styles.ts":{"bytesInOutput":695},"src/components/Image/Image.tsx":{"bytesInOutput":4776},"src/components/Card/Card.tsx":{"bytesInOutput":8570},"src/translations.ts":{"bytesInOutput":126},"src/components/Focus/styles.ts":{"bytesInOutput":532},"src/components/Focus/Focus.tsx":{"bytesInOutput":1677},"src/components/Focus/index.ts":{"bytesInOutput":0},"src/components/Mosaic/styles.ts":{"bytesInOutput":1303},"src/components/Mosaic/extension.ts":{"bytesInOutput":3256},"src/hooks/useContainerDebug.tsx":{"bytesInOutput":1322},"src/components/Mosaic/index.ts":{"bytesInOutput":0},"src/components/Mosaic/Mosaic.tsx":{"bytesInOutput":20534},"src/components/Scrollable/Scrollable.tsx":{"bytesInOutput":1806},"src/components/Scrollable/scrollable.css":{"bytesInOutput":0},"src/components/Stack/Stack.tsx":{"bytesInOutput":4183},"src/hooks/useEventHandlerAdapter.ts":{"bytesInOutput":1620},"src/hooks/useVisibleItems.ts":{"bytesInOutput":542}},"bytes":51880},"dist/lib/browser/index.css.map":{"imports":[],"exports":[],"inputs":{},"bytes":1137},"dist/lib/browser/index.css":{"imports":[],"inputs":{"src/components/Scrollable/scrollable.css":{"bytesInOutput":354}},"bytes":439},"dist/lib/browser/testing/index.css.map":{"imports":[],"exports":[],"inputs":{},"bytes":1140},"dist/lib/browser/testing/index.css":{"imports":[],"inputs":{"src/components/Scrollable/scrollable.css":{"bytesInOutput":354}},"bytes":439}}}
|
|
1
|
+
{"inputs":{"src/components/Card/styles.ts":{"bytes":2466,"imports":[],"format":"esm"},"src/translations.ts":{"bytes":1059,"imports":[],"format":"esm"},"src/components/Image/Image.tsx":{"bytes":22239,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true}],"format":"esm"},"src/components/Image/index.ts":{"bytes":464,"imports":[{"path":"src/components/Image/Image.tsx","kind":"import-statement","original":"./Image"}],"format":"esm"},"src/components/Card/Card.tsx":{"bytes":34464,"imports":[{"path":"@radix-ui/react-slot","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"src/translations.ts","kind":"import-statement","original":"../../translations"},{"path":"src/components/Image/index.ts","kind":"import-statement","original":"../Image"},{"path":"src/components/Card/styles.ts","kind":"import-statement","original":"./styles"}],"format":"esm"},"src/components/Card/CardDragPreview.tsx":{"bytes":2399,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"src/components/Card/styles.ts","kind":"import-statement","original":"./styles"}],"format":"esm"},"src/components/Card/index.ts":{"bytes":758,"imports":[{"path":"src/components/Card/styles.ts","kind":"import-statement","original":"./styles"},{"path":"src/components/Card/Card.tsx","kind":"import-statement","original":"./Card"},{"path":"src/components/Card/CardDragPreview.tsx","kind":"import-statement","original":"./CardDragPreview"}],"format":"esm"},"src/components/Focus/styles.ts":{"bytes":2242,"imports":[],"format":"esm"},"src/components/Focus/Focus.tsx":{"bytes":8109,"imports":[{"path":"@fluentui/react-tabster","kind":"import-statement","external":true},{"path":"@radix-ui/react-compose-refs","kind":"import-statement","external":true},{"path":"@radix-ui/react-primitive","kind":"import-statement","external":true},{"path":"@radix-ui/react-slot","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"src/components/Focus/styles.ts","kind":"import-statement","original":"./styles"}],"format":"esm"},"src/components/Focus/index.ts":{"bytes":658,"imports":[{"path":"src/components/Focus/styles.ts","kind":"import-statement","original":"./styles"},{"path":"src/components/Focus/Focus.tsx","kind":"import-statement","original":"./Focus"}],"format":"esm"},"src/components/Layout/Layout.tsx":{"bytes":6547,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true}],"format":"esm"},"src/components/Layout/index.ts":{"bytes":470,"imports":[{"path":"src/components/Layout/Layout.tsx","kind":"import-statement","original":"./Layout"}],"format":"esm"},"src/components/Mosaic/styles.ts":{"bytes":4082,"imports":[],"format":"esm"},"src/components/Mosaic/extension.ts":{"bytes":14399,"imports":[{"path":"@codemirror/state","kind":"import-statement","external":true},{"path":"@codemirror/view","kind":"import-statement","external":true}],"format":"esm"},"src/components/Mosaic/types.ts":{"bytes":3507,"imports":[],"format":"esm"},"src/components/Scrollable/scrollable.css":{"bytes":736,"imports":[]},"src/components/Scrollable/Scrollable.tsx":{"bytes":7659,"imports":[{"path":"overlayscrollbars-react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"overlayscrollbars/styles/overlayscrollbars.css","kind":"import-statement","external":true},{"path":"src/components/Scrollable/scrollable.css","kind":"import-statement","original":"./scrollable.css"}],"format":"esm"},"src/components/Scrollable/index.ts":{"bytes":482,"imports":[{"path":"src/components/Scrollable/Scrollable.tsx","kind":"import-statement","original":"./Scrollable"}],"format":"esm"},"src/hooks/useContainerDebug.tsx":{"bytes":5641,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"react-dom","kind":"import-statement","external":true},{"path":"@dxos/react-ui-syntax-highlighter","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"src/components/index.ts","kind":"import-statement","original":"../components"}],"format":"esm"},"src/hooks/useEventHandlerAdapter.ts":{"bytes":8069,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"src/hooks/useVisibleItems.ts":{"bytes":3168,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"src/hooks/index.ts":{"bytes":714,"imports":[{"path":"src/hooks/useContainerDebug.tsx","kind":"import-statement","original":"./useContainerDebug"},{"path":"src/hooks/useEventHandlerAdapter.ts","kind":"import-statement","original":"./useEventHandlerAdapter"},{"path":"src/hooks/useVisibleItems.ts","kind":"import-statement","original":"./useVisibleItems"}],"format":"esm"},"src/components/Stack/Stack.tsx":{"bytes":17785,"imports":[{"path":"@tanstack/react-virtual","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"src/hooks/index.ts","kind":"import-statement","original":"../../hooks"},{"path":"src/components/Mosaic/index.ts","kind":"import-statement","original":"../Mosaic"},{"path":"src/components/Mosaic/index.ts","kind":"import-statement","original":"../Mosaic"}],"format":"esm"},"src/components/Stack/index.ts":{"bytes":464,"imports":[{"path":"src/components/Stack/Stack.tsx","kind":"import-statement","original":"./Stack"}],"format":"esm"},"src/components/Mosaic/Mosaic.tsx":{"bytes":85824,"imports":[{"path":"@atlaskit/pragmatic-drag-and-drop/combine","kind":"import-statement","external":true},{"path":"@atlaskit/pragmatic-drag-and-drop/element/adapter","kind":"import-statement","external":true},{"path":"@atlaskit/pragmatic-drag-and-drop/element/preserve-offset-on-source","kind":"import-statement","external":true},{"path":"@atlaskit/pragmatic-drag-and-drop/element/set-custom-native-drag-preview","kind":"import-statement","external":true},{"path":"@atlaskit/pragmatic-drag-and-drop-auto-scroll/element","kind":"import-statement","external":true},{"path":"@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge","kind":"import-statement","external":true},{"path":"@atlaskit/pragmatic-drag-and-drop-react-drop-indicator/box","kind":"import-statement","external":true},{"path":"@radix-ui/react-compose-refs","kind":"import-statement","external":true},{"path":"@radix-ui/react-context","kind":"import-statement","external":true},{"path":"@radix-ui/react-primitive","kind":"import-statement","external":true},{"path":"@radix-ui/react-slot","kind":"import-statement","external":true},{"path":"bind-event-listener","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react-dom","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"src/components/Focus/index.ts","kind":"import-statement","original":"../Focus"},{"path":"src/components/Scrollable/index.ts","kind":"import-statement","original":"../Scrollable"},{"path":"src/components/Stack/index.ts","kind":"import-statement","original":"../Stack"}],"format":"esm"},"src/components/Mosaic/index.ts":{"bytes":839,"imports":[{"path":"src/components/Mosaic/styles.ts","kind":"import-statement","original":"./styles"},{"path":"src/components/Mosaic/extension.ts","kind":"import-statement","original":"./extension"},{"path":"src/components/Mosaic/types.ts","kind":"import-statement","original":"./types"},{"path":"src/components/Mosaic/Mosaic.tsx","kind":"import-statement","original":"./Mosaic"}],"format":"esm"},"src/components/index.ts":{"bytes":868,"imports":[{"path":"src/components/Card/index.ts","kind":"import-statement","original":"./Card"},{"path":"src/components/Focus/index.ts","kind":"import-statement","original":"./Focus"},{"path":"src/components/Image/index.ts","kind":"import-statement","original":"./Image"},{"path":"src/components/Layout/index.ts","kind":"import-statement","original":"./Layout"},{"path":"src/components/Mosaic/index.ts","kind":"import-statement","original":"./Mosaic"},{"path":"src/components/Stack/index.ts","kind":"import-statement","original":"./Stack"}],"format":"esm"},"src/index.ts":{"bytes":541,"imports":[{"path":"src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"src/hooks/index.ts","kind":"import-statement","original":"./hooks"}],"format":"esm"},"src/testing/decorator.tsx":{"bytes":1207,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/components/index.ts","kind":"import-statement","original":"../components"}],"format":"esm"},"src/testing/Board.tsx":{"bytes":27666,"imports":[{"path":"@radix-ui/react-compose-refs","kind":"import-statement","external":true},{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-syntax-highlighter","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"src/components/index.ts","kind":"import-statement","original":"../components"},{"path":"src/hooks/index.ts","kind":"import-statement","original":"../hooks"}],"format":"esm"},"src/testing/CardContainer.tsx":{"bytes":7835,"imports":[{"path":"@radix-ui/react-use-controllable-state","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-dnd","kind":"import-statement","external":true}],"format":"esm"},"src/testing/DefaultStackTile.tsx":{"bytes":4268,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-syntax-highlighter","kind":"import-statement","external":true},{"path":"src/components/index.ts","kind":"import-statement","original":"../components"}],"format":"esm"},"src/testing/index.ts":{"bytes":761,"imports":[{"path":"src/testing/decorator.tsx","kind":"import-statement","original":"./decorator"},{"path":"src/testing/Board.tsx","kind":"import-statement","original":"./Board"},{"path":"src/testing/CardContainer.tsx","kind":"import-statement","original":"./CardContainer"},{"path":"src/testing/DefaultStackTile.tsx","kind":"import-statement","original":"./DefaultStackTile"}],"format":"esm"}},"outputs":{"dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":4810},"dist/lib/browser/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-UMBPEG4F.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true}],"exports":["Card","CardDragPreview","Focus","Image","Layout","Mosaic","Stack","VirtualStack","cardStyles","dropHandler","focusStyles","mosaicStyles","useContainerDebug","useEventHandlerAdapter","useFocus","useMosaic","useMosaicContainer","useMosaicTile","useVisibleItems"],"entryPoint":"src/index.ts","cssBundle":"dist/lib/browser/index.css","inputs":{"src/components/Card/index.ts":{"bytesInOutput":0},"src/components/Card/CardDragPreview.tsx":{"bytesInOutput":492},"src/components/Layout/Layout.tsx":{"bytesInOutput":1395},"src/index.ts":{"bytesInOutput":0}},"bytes":2669},"dist/lib/browser/testing/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":21659},"dist/lib/browser/testing/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-UMBPEG4F.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@radix-ui/react-compose-refs","kind":"import-statement","external":true},{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-syntax-highlighter","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"@radix-ui/react-use-controllable-state","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-dnd","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-syntax-highlighter","kind":"import-statement","external":true}],"exports":["Board","CardContainer","Debug","DefaultStackTile","IntrinsicCardContainer","PopoverCardContainer","TestColumn","TestItem","withMosaic"],"entryPoint":"src/testing/index.ts","cssBundle":"dist/lib/browser/testing/index.css","inputs":{"src/testing/decorator.tsx":{"bytesInOutput":181},"src/testing/index.ts":{"bytesInOutput":0},"src/testing/Board.tsx":{"bytesInOutput":7192},"src/testing/CardContainer.tsx":{"bytesInOutput":1961},"src/testing/DefaultStackTile.tsx":{"bytesInOutput":1100}},"bytes":10905},"dist/lib/browser/chunk-UMBPEG4F.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":111159},"dist/lib/browser/chunk-UMBPEG4F.mjs":{"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"@radix-ui/react-slot","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"@fluentui/react-tabster","kind":"import-statement","external":true},{"path":"@radix-ui/react-compose-refs","kind":"import-statement","external":true},{"path":"@radix-ui/react-primitive","kind":"import-statement","external":true},{"path":"@radix-ui/react-slot","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"@codemirror/state","kind":"import-statement","external":true},{"path":"@codemirror/view","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react-dom","kind":"import-statement","external":true},{"path":"@dxos/react-ui-syntax-highlighter","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"@atlaskit/pragmatic-drag-and-drop/combine","kind":"import-statement","external":true},{"path":"@atlaskit/pragmatic-drag-and-drop/element/adapter","kind":"import-statement","external":true},{"path":"@atlaskit/pragmatic-drag-and-drop/element/preserve-offset-on-source","kind":"import-statement","external":true},{"path":"@atlaskit/pragmatic-drag-and-drop/element/set-custom-native-drag-preview","kind":"import-statement","external":true},{"path":"@atlaskit/pragmatic-drag-and-drop-auto-scroll/element","kind":"import-statement","external":true},{"path":"@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge","kind":"import-statement","external":true},{"path":"@atlaskit/pragmatic-drag-and-drop-react-drop-indicator/box","kind":"import-statement","external":true},{"path":"@radix-ui/react-compose-refs","kind":"import-statement","external":true},{"path":"@radix-ui/react-context","kind":"import-statement","external":true},{"path":"@radix-ui/react-primitive","kind":"import-statement","external":true},{"path":"@radix-ui/react-slot","kind":"import-statement","external":true},{"path":"bind-event-listener","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react-dom","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"overlayscrollbars-react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"overlayscrollbars/styles/overlayscrollbars.css","kind":"import-statement","external":true},{"path":"@tanstack/react-virtual","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true}],"exports":["Card","Focus","Image","Mosaic","Stack","VirtualStack","dropHandler","styles","styles2","styles3","useContainerContext","useContainerDebug","useEventHandlerAdapter","useFocus","useRootContext","useTileContext","useVisibleItems"],"inputs":{"src/components/Card/styles.ts":{"bytesInOutput":695},"src/components/Image/Image.tsx":{"bytesInOutput":4776},"src/components/Card/Card.tsx":{"bytesInOutput":8779},"src/translations.ts":{"bytesInOutput":126},"src/components/Focus/styles.ts":{"bytesInOutput":532},"src/components/Focus/Focus.tsx":{"bytesInOutput":1677},"src/components/Focus/index.ts":{"bytesInOutput":0},"src/components/Mosaic/styles.ts":{"bytesInOutput":1303},"src/components/Mosaic/extension.ts":{"bytesInOutput":3256},"src/hooks/useContainerDebug.tsx":{"bytesInOutput":1322},"src/components/Mosaic/index.ts":{"bytesInOutput":0},"src/components/Mosaic/Mosaic.tsx":{"bytesInOutput":20600},"src/components/Scrollable/Scrollable.tsx":{"bytesInOutput":1634},"src/components/Scrollable/scrollable.css":{"bytesInOutput":0},"src/components/Stack/Stack.tsx":{"bytesInOutput":4183},"src/hooks/useEventHandlerAdapter.ts":{"bytesInOutput":1620},"src/hooks/useVisibleItems.ts":{"bytesInOutput":542}},"bytes":51983},"dist/lib/browser/index.css.map":{"imports":[],"exports":[],"inputs":{},"bytes":1137},"dist/lib/browser/index.css":{"imports":[],"inputs":{"src/components/Scrollable/scrollable.css":{"bytesInOutput":354}},"bytes":439},"dist/lib/browser/testing/index.css.map":{"imports":[],"exports":[],"inputs":{},"bytes":1140},"dist/lib/browser/testing/index.css":{"imports":[],"inputs":{"src/components/Scrollable/scrollable.css":{"bytesInOutput":354}},"bytes":439}}}
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
useContainerDebug,
|
|
7
7
|
useEventHandlerAdapter,
|
|
8
8
|
useRootContext
|
|
9
|
-
} from "../chunk-
|
|
9
|
+
} from "../chunk-UMBPEG4F.mjs";
|
|
10
10
|
|
|
11
11
|
// src/testing/decorator.tsx
|
|
12
12
|
import React from "react";
|
|
@@ -17,7 +17,7 @@ var withMosaic = () => {
|
|
|
17
17
|
// src/testing/Board.tsx
|
|
18
18
|
import { useComposedRefs } from "@radix-ui/react-compose-refs";
|
|
19
19
|
import * as Schema from "effect/Schema";
|
|
20
|
-
import React2, { forwardRef, useMemo, useRef } from "react";
|
|
20
|
+
import React2, { forwardRef, useMemo, useRef, useState } from "react";
|
|
21
21
|
import { Obj, Ref, Type } from "@dxos/echo";
|
|
22
22
|
import { ObjectId } from "@dxos/keys";
|
|
23
23
|
import { useObject } from "@dxos/react-client/echo";
|
|
@@ -41,7 +41,7 @@ var TestColumn = Schema.Struct({
|
|
|
41
41
|
}));
|
|
42
42
|
var Root = /* @__PURE__ */ forwardRef(({ id, columns, debug }, forwardedRef) => {
|
|
43
43
|
const [DebugInfo, debugHandler] = useContainerDebug(debug);
|
|
44
|
-
const
|
|
44
|
+
const [viewport, setViewport] = useState(null);
|
|
45
45
|
const eventHandler = useEventHandlerAdapter({
|
|
46
46
|
id,
|
|
47
47
|
items: columns,
|
|
@@ -52,22 +52,22 @@ var Root = /* @__PURE__ */ forwardRef(({ id, columns, debug }, forwardedRef) =>
|
|
|
52
52
|
});
|
|
53
53
|
return /* @__PURE__ */ React2.createElement("div", {
|
|
54
54
|
role: "none",
|
|
55
|
-
className: mx("
|
|
55
|
+
className: mx("plb-2 grid bs-full is-full overflow-hidden", debug && "grid-cols-[1fr_20rem] gap-2"),
|
|
56
56
|
ref: forwardedRef
|
|
57
57
|
}, /* @__PURE__ */ React2.createElement(Focus.Group, {
|
|
58
58
|
asChild: true,
|
|
59
59
|
axis: "horizontal"
|
|
60
60
|
}, /* @__PURE__ */ React2.createElement(Mosaic.Container, {
|
|
61
61
|
asChild: true,
|
|
62
|
-
axis: "horizontal",
|
|
63
62
|
withFocus: true,
|
|
64
|
-
|
|
63
|
+
axis: "horizontal",
|
|
64
|
+
autoScroll: viewport,
|
|
65
65
|
eventHandler,
|
|
66
66
|
debug: debugHandler
|
|
67
67
|
}, /* @__PURE__ */ React2.createElement(Mosaic.Viewport, {
|
|
68
68
|
axis: "horizontal",
|
|
69
69
|
padding: true,
|
|
70
|
-
viewportRef
|
|
70
|
+
viewportRef: setViewport
|
|
71
71
|
}, /* @__PURE__ */ React2.createElement(Mosaic.Stack, {
|
|
72
72
|
axis: "horizontal",
|
|
73
73
|
items: columns,
|
|
@@ -80,7 +80,7 @@ var Column = /* @__PURE__ */ forwardRef(({ classNames, location, data, debug },
|
|
|
80
80
|
const [column, updateColumn] = useObject(data);
|
|
81
81
|
const [DebugInfo, debugHandler] = useContainerDebug(debug);
|
|
82
82
|
const dragHandleRef = useRef(null);
|
|
83
|
-
const
|
|
83
|
+
const [viewport, setViewport] = useState(null);
|
|
84
84
|
const eventHandler = useEventHandlerAdapter({
|
|
85
85
|
id: data.id,
|
|
86
86
|
items: column.items,
|
|
@@ -127,21 +127,23 @@ var Column = /* @__PURE__ */ forwardRef(({ classNames, location, data, debug },
|
|
|
127
127
|
}
|
|
128
128
|
}, /* @__PURE__ */ React2.createElement(Mosaic.Container, {
|
|
129
129
|
asChild: true,
|
|
130
|
-
axis: "vertical",
|
|
131
130
|
withFocus: true,
|
|
132
|
-
|
|
131
|
+
axis: "vertical",
|
|
132
|
+
autoScroll: viewport,
|
|
133
133
|
eventHandler,
|
|
134
134
|
debug: debugHandler
|
|
135
135
|
}, /* @__PURE__ */ React2.createElement(Mosaic.Viewport, {
|
|
136
136
|
axis: "vertical",
|
|
137
137
|
padding: true,
|
|
138
|
-
viewportRef
|
|
138
|
+
viewportRef: setViewport
|
|
139
139
|
}, /* @__PURE__ */ React2.createElement(Mosaic.Stack, {
|
|
140
140
|
axis: "vertical",
|
|
141
141
|
items: column.items,
|
|
142
142
|
getId: (data2) => data2.dxn.toString(),
|
|
143
143
|
Tile: Item
|
|
144
|
-
})))), /* @__PURE__ */ React2.createElement("div",
|
|
144
|
+
})))), /* @__PURE__ */ React2.createElement("div", {
|
|
145
|
+
role: "none"
|
|
146
|
+
}, /* @__PURE__ */ React2.createElement("div", {
|
|
145
147
|
className: "grow flex p-1 justify-center text-xs"
|
|
146
148
|
}, column.items.length), /* @__PURE__ */ React2.createElement(DebugInfo, null)))));
|
|
147
149
|
});
|
|
@@ -268,12 +270,12 @@ var IntrinsicCardContainer = ({ children, defaultSize, size: propSize, onSizeCha
|
|
|
268
270
|
};
|
|
269
271
|
|
|
270
272
|
// src/testing/DefaultStackTile.tsx
|
|
271
|
-
import React4, { useRef as useRef2, useState } from "react";
|
|
273
|
+
import React4, { useRef as useRef2, useState as useState2 } from "react";
|
|
272
274
|
import { Obj as Obj2 } from "@dxos/echo";
|
|
273
275
|
import { Json as Json2 } from "@dxos/react-ui-syntax-highlighter";
|
|
274
276
|
var DefaultStackTile = (props) => {
|
|
275
277
|
const dragHandleRef = useRef2(null);
|
|
276
|
-
const [open, setOpen] =
|
|
278
|
+
const [open, setOpen] = useState2(false);
|
|
277
279
|
return /* @__PURE__ */ React4.createElement(Mosaic.Tile, {
|
|
278
280
|
...props,
|
|
279
281
|
className: "border border-separator rounded-sm font-mono"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/testing/decorator.tsx", "../../../../src/testing/Board.tsx", "../../../../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 { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport * as Schema from 'effect/Schema';\nimport React, { forwardRef, useMemo, useRef } from 'react';\n\nimport { Obj, Ref, Type } from '@dxos/echo';\nimport { ObjectId } from '@dxos/keys';\nimport { useObject } from '@dxos/react-client/echo';\nimport { Tag, type ThemedClassName } from '@dxos/react-ui';\nimport { Json } from '@dxos/react-ui-syntax-highlighter';\nimport { getHashStyles, mx } from '@dxos/ui-theme';\n\nimport {\n Card,\n type CardMenuProps,\n Focus,\n Mosaic,\n type MosaicTileProps,\n type MosiacPlaceholderProps,\n mosaicStyles,\n useMosaic,\n} from '../components';\nimport { useContainerDebug, useEventHandlerAdapter } from '../hooks';\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: 'example.com/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 items: Schema.mutable(Schema.Array(Type.Ref(TestItem))),\n}).pipe(\n Type.object({\n typename: 'example.com/type/Column',\n version: '0.1.0',\n }),\n);\n\nexport interface TestColumn extends Schema.Schema.Type<typeof TestColumn> {}\n\n//\n// Root\n//\n\ntype RootProps = {\n id: string;\n columns: TestColumn[];\n debug?: boolean;\n};\n\nconst Root = forwardRef<HTMLDivElement, RootProps>(({ id, columns, debug }, forwardedRef) => {\n const [DebugInfo, debugHandler] = useContainerDebug(debug);\n const viewportRef = useRef<HTMLElement | null>(null);\n\n const eventHandler = useEventHandlerAdapter({\n id,\n items: columns,\n getId: (data) => data.id,\n get: (data) => data,\n make: (object) => object,\n canDrop: ({ source }) => Obj.instanceOf(TestColumn, source.data),\n });\n\n return (\n <div\n role='none'\n className={mx('p-2 grid bs-full is-full overflow-hidden', debug && 'grid-cols-[1fr_20rem] gap-2')}\n ref={forwardedRef}\n >\n <Focus.Group asChild axis='horizontal'>\n <Mosaic.Container\n asChild\n axis='horizontal'\n withFocus\n autoScroll={viewportRef.current}\n eventHandler={eventHandler}\n debug={debugHandler}\n >\n <Mosaic.Viewport axis='horizontal' padding viewportRef={viewportRef}>\n <Mosaic.Stack axis='horizontal' items={columns} getId={(item) => item.id} Tile={Column} debug={debug} />\n </Mosaic.Viewport>\n </Mosaic.Container>\n </Focus.Group>\n <DebugInfo />\n </div>\n );\n});\n\n//\n// Column\n//\n\ntype ColumnProps = Pick<MosaicTileProps<TestColumn>, 'classNames' | 'location' | 'data' | 'debug'>;\n\nconst Column = forwardRef<HTMLDivElement, ColumnProps>(({ classNames, location, data, debug }, forwardedRef) => {\n const [column, updateColumn] = useObject(data);\n const [DebugInfo, debugHandler] = useContainerDebug(debug);\n const dragHandleRef = useRef<HTMLButtonElement>(null);\n const viewportRef = useRef<HTMLElement | null>(null);\n const eventHandler = useEventHandlerAdapter<Ref.Unknown>({\n id: data.id,\n items: column.items,\n getId: (data) => data.dxn.toString(),\n get: (data) => data.target!,\n make: (object) => Ref.make(object),\n canDrop: ({ source }) => Obj.instanceOf(TestItem, source.data.target),\n onChange: (mutator) => updateColumn((column) => mutator(column.items)),\n });\n\n // Context menu.\n const menuItems = useMemo<NonNullable<CardMenuProps<TestItem>['items']>>(\n () => [\n {\n label: 'Delete',\n onClick: (obj) => {\n updateColumn((column) => {\n const idx = column.items.findIndex((item) => item.target?.id === obj?.id);\n if (idx !== -1) {\n column.items.splice(idx, 1);\n }\n });\n },\n },\n ],\n [updateColumn],\n );\n\n return (\n <Mosaic.Tile asChild dragHandle={dragHandleRef.current} location={location} id={data.id} data={data} debug={debug}>\n <Focus.Group asChild>\n <div\n className={mx(\n 'grid bs-full card-default-width overflow-hidden bg-deckSurface',\n debug ? 'grid-rows-[min-content_1fr_20rem]' : 'grid-rows-[min-content_1fr_min-content]',\n classNames,\n )}\n ref={forwardedRef}\n >\n <Card.Toolbar>\n <Card.DragHandle ref={dragHandleRef} />\n <Card.Title>{column.id}</Card.Title>\n <Card.Menu items={[]} />\n </Card.Toolbar>\n <Card.Context value={{ menuItems }}>\n <Mosaic.Container\n asChild\n axis='vertical'\n withFocus\n autoScroll={viewportRef.current}\n eventHandler={eventHandler}\n debug={debugHandler}\n >\n <Mosaic.Viewport axis='vertical' padding viewportRef={viewportRef}>\n <Mosaic.Stack axis='vertical' items={column.items} getId={(data) => data.dxn.toString()} Tile={Item} />\n </Mosaic.Viewport>\n </Mosaic.Container>\n </Card.Context>\n <div>\n <div className='grow flex p-1 justify-center text-xs'>{column.items.length}</div>\n <DebugInfo />\n </div>\n </div>\n </Focus.Group>\n </Mosaic.Tile>\n );\n});\n\nColumn.displayName = 'Column';\n\n//\n// Item\n//\n\ntype ItemProps = Pick<MosaicTileProps<Ref.Ref<TestItem>>, 'classNames' | 'location' | 'data' | 'debug'>;\n\nconst Item = forwardRef<HTMLDivElement, ItemProps>(({ classNames, data: ref, location, debug }, forwardedRef) => {\n const rootRef = useRef<HTMLDivElement>(null);\n const composedRef = useComposedRefs<HTMLDivElement>(rootRef, forwardedRef);\n const dragHandleRef = useRef<HTMLButtonElement>(null);\n const object = ref.target;\n if (!object) {\n return null;\n }\n\n return (\n <Mosaic.Tile\n asChild\n dragHandle={dragHandleRef.current}\n id={ref.dxn.toString()}\n data={ref}\n location={location}\n debug={debug}\n >\n <Focus.Group asChild>\n <Card.Root classNames={classNames} onClick={() => rootRef.current?.focus()} ref={composedRef}>\n <Card.Toolbar>\n <Card.DragHandle ref={dragHandleRef} />\n <Card.Title>{object.name}</Card.Title>\n <Card.Menu context={object} />\n </Card.Toolbar>\n <Card.Row icon='ph--note--regular' classNames='text-description'>\n {object.description}\n </Card.Row>\n <Card.Row icon='ph--tag--regular'>\n {object.label && (\n <div role='none' className='flex shrink-0 gap-1 text-xs items-center'>\n <Tag palette={getHashStyles(object.label).hue}>{object.label}</Tag>\n </div>\n )}\n </Card.Row>\n </Card.Root>\n </Focus.Group>\n </Mosaic.Tile>\n );\n});\n\nItem.displayName = 'Item';\n\n//\n// Placeholder\n//\n\nconst Placeholder = (props: MosiacPlaceholderProps<number>) => {\n return (\n <Mosaic.Placeholder {...props} classNames={mosaicStyles.placeholder.root}>\n <div\n className={mx(\n 'flex bs-full border border-dashed border-separator rounded-sm',\n mosaicStyles.placeholder.content,\n )}\n />\n </Mosaic.Placeholder>\n );\n};\n\nPlaceholder.displayName = 'Placeholder';\n\n//\n// Debug\n//\n\nexport const Debug = forwardRef<HTMLDivElement, ThemedClassName>(({ classNames }, forwardedRef) => {\n const { containers, dragging } = useMosaic(Debug.displayName!);\n const counter = useRef(0);\n return (\n <Json\n data={{ containers, dragging, count: counter.current++ }}\n classNames={mx('text-xs', classNames)}\n ref={forwardedRef}\n />\n );\n});\n\nDebug.displayName = 'Debug';\n\n//\n// Board\n//\n\nexport const Board = { Root, Column, Item, Placeholder, Debug };\n\nexport type { RootProps, ColumnProps, ItemProps };\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 const CardContainer = ({\n children,\n icon = 'ph--placeholder--regular',\n role,\n}: PropsWithChildren<{ icon?: string; role?: string }>) => {\n switch (role) {\n case 'card--popover':\n return <PopoverCardContainer icon={icon}>{children}</PopoverCardContainer>;\n case 'card--intrinsic':\n default:\n return <IntrinsicCardContainer>{children}</IntrinsicCardContainer>;\n }\n};\n\nconst border = 'relative border border-dashed border-subduedSeparator p-4 rounded-lg overflow-x-auto';\n\n//\n// Popover\n//\n\nexport type PopoverCardContainerProps = PropsWithChildren<{ icon?: string }>;\n\nexport const PopoverCardContainer = ({ children, icon = 'ph--placeholder--regular' }: PopoverCardContainerProps) => {\n return (\n <Popover.Root open>\n <Popover.Content onOpenAutoFocus={(event) => event.preventDefault()}>\n <Popover.Viewport classNames='popover-card-width'>{children}</Popover.Viewport>\n <Popover.Arrow />\n </Popover.Content>\n <Popover.Trigger asChild>\n <Icon icon={icon} size={5} />\n </Popover.Trigger>\n </Popover.Root>\n );\n};\n\n//\n// Intrinsic card container (size constrained by card).\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 className={border} style={sizeStyle(size, 'horizontal')} {...resizeAttributes}>\n {children}\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, { useRef, useState } from 'react';\n\nimport { Obj } from '@dxos/echo';\nimport { Json } from '@dxos/react-ui-syntax-highlighter';\n\nimport { Card, Mosaic, type StackTileComponent } from '../components';\n\nexport const DefaultStackTile: StackTileComponent<Obj.Any> = (props) => {\n const dragHandleRef = useRef<HTMLButtonElement>(null);\n const [open, setOpen] = useState(false);\n return (\n <Mosaic.Tile {...props} className='border border-separator rounded-sm font-mono'>\n <Card.Toolbar>\n <Card.DragHandle ref={dragHandleRef} />\n <Card.Title>{Obj.getLabel(props.data) ?? props.data.id}</Card.Title>\n <Card.Menu\n items={[\n {\n label: open ? 'Hide details' : 'Show details',\n onClick: () => setOpen((open) => !open),\n },\n ]}\n />\n </Card.Toolbar>\n {open && (\n <Card.Row>\n <Json data={props.data} classNames='text-xs' />\n </Card.Row>\n )}\n </Mosaic.Tile>\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,SAASG,uBAAuB;AAChC,YAAYC,YAAY;AACxB,OAAOC,UAASC,YAAYC,SAASC,
|
|
6
|
-
"names": ["React", "withMosaic", "Story", "Mosaic", "Root", "useComposedRefs", "Schema", "React", "forwardRef", "useMemo", "useRef", "Obj", "Ref", "Type", "ObjectId", "useObject", "Tag", "Json", "getHashStyles", "mx", "TestItem", "Struct", "name", "String", "description", "optional", "label", "pipe", "Type", "object", "typename", "version", "TestColumn", "id", "ObjectId", "items", "mutable", "Array", "Ref", "Root", "forwardRef", "columns", "debug", "forwardedRef", "DebugInfo", "debugHandler", "useContainerDebug", "
|
|
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 { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport * as Schema from 'effect/Schema';\nimport React, { forwardRef, useMemo, useRef, useState } from 'react';\n\nimport { Obj, Ref, Type } from '@dxos/echo';\nimport { ObjectId } from '@dxos/keys';\nimport { useObject } from '@dxos/react-client/echo';\nimport { Tag, type ThemedClassName } from '@dxos/react-ui';\nimport { Json } from '@dxos/react-ui-syntax-highlighter';\nimport { getHashStyles, mx } from '@dxos/ui-theme';\n\nimport {\n Card,\n type CardMenuProps,\n Focus,\n Mosaic,\n type MosaicTileProps,\n type MosiacPlaceholderProps,\n mosaicStyles,\n useMosaic,\n} from '../components';\nimport { useContainerDebug, useEventHandlerAdapter } from '../hooks';\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: 'example.com/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 items: Schema.mutable(Schema.Array(Type.Ref(TestItem))),\n}).pipe(\n Type.object({\n typename: 'example.com/type/Column',\n version: '0.1.0',\n }),\n);\n\nexport interface TestColumn extends Schema.Schema.Type<typeof TestColumn> {}\n\n//\n// Root\n//\n\ntype RootProps = {\n id: string;\n columns: TestColumn[];\n debug?: boolean;\n};\n\nconst Root = forwardRef<HTMLDivElement, RootProps>(({ id, columns, debug }, forwardedRef) => {\n const [DebugInfo, debugHandler] = useContainerDebug(debug);\n const [viewport, setViewport] = useState<HTMLElement | null>(null);\n\n const eventHandler = useEventHandlerAdapter({\n id,\n items: columns,\n getId: (data) => data.id,\n get: (data) => data,\n make: (object) => object,\n canDrop: ({ source }) => Obj.instanceOf(TestColumn, source.data),\n });\n\n return (\n <div\n role='none'\n className={mx('plb-2 grid bs-full is-full overflow-hidden', debug && 'grid-cols-[1fr_20rem] gap-2')}\n ref={forwardedRef}\n >\n <Focus.Group asChild axis='horizontal'>\n <Mosaic.Container\n asChild\n withFocus\n axis='horizontal'\n autoScroll={viewport}\n eventHandler={eventHandler}\n debug={debugHandler}\n >\n <Mosaic.Viewport axis='horizontal' padding viewportRef={setViewport}>\n <Mosaic.Stack axis='horizontal' items={columns} getId={(item) => item.id} Tile={Column} debug={debug} />\n </Mosaic.Viewport>\n </Mosaic.Container>\n </Focus.Group>\n <DebugInfo />\n </div>\n );\n});\n\n//\n// Column\n//\n\ntype ColumnProps = Pick<MosaicTileProps<TestColumn>, 'classNames' | 'location' | 'data' | 'debug'>;\n\nconst Column = forwardRef<HTMLDivElement, ColumnProps>(({ classNames, location, data, debug }, forwardedRef) => {\n const [column, updateColumn] = useObject(data);\n const [DebugInfo, debugHandler] = useContainerDebug(debug);\n const dragHandleRef = useRef<HTMLButtonElement>(null);\n const [viewport, setViewport] = useState<HTMLElement | null>(null);\n const eventHandler = useEventHandlerAdapter<Ref.Unknown>({\n id: data.id,\n items: column.items,\n getId: (data) => data.dxn.toString(),\n get: (data) => data.target!,\n make: (object) => Ref.make(object),\n canDrop: ({ source }) => Obj.instanceOf(TestItem, source.data.target),\n onChange: (mutator) => updateColumn((column) => mutator(column.items)),\n });\n\n // Context menu.\n const menuItems = useMemo<NonNullable<CardMenuProps<TestItem>['items']>>(\n () => [\n {\n label: 'Delete',\n onClick: (obj) => {\n updateColumn((column) => {\n const idx = column.items.findIndex((item) => item.target?.id === obj?.id);\n if (idx !== -1) {\n column.items.splice(idx, 1);\n }\n });\n },\n },\n ],\n [updateColumn],\n );\n\n return (\n <Mosaic.Tile asChild dragHandle={dragHandleRef.current} location={location} id={data.id} data={data} debug={debug}>\n <Focus.Group asChild>\n <div\n className={mx(\n 'grid bs-full card-default-width overflow-hidden bg-deckSurface',\n debug ? 'grid-rows-[min-content_1fr_20rem]' : 'grid-rows-[min-content_1fr_min-content]',\n classNames,\n )}\n ref={forwardedRef}\n >\n <Card.Toolbar>\n <Card.DragHandle ref={dragHandleRef} />\n <Card.Title>{column.id}</Card.Title>\n <Card.Menu items={[]} />\n </Card.Toolbar>\n <Card.Context value={{ menuItems }}>\n <Mosaic.Container\n asChild\n withFocus\n axis='vertical'\n autoScroll={viewport}\n eventHandler={eventHandler}\n debug={debugHandler}\n >\n <Mosaic.Viewport axis='vertical' padding viewportRef={setViewport}>\n <Mosaic.Stack axis='vertical' items={column.items} getId={(data) => data.dxn.toString()} Tile={Item} />\n </Mosaic.Viewport>\n </Mosaic.Container>\n </Card.Context>\n <div role='none'>\n <div className='grow flex p-1 justify-center text-xs'>{column.items.length}</div>\n <DebugInfo />\n </div>\n </div>\n </Focus.Group>\n </Mosaic.Tile>\n );\n});\n\nColumn.displayName = 'Column';\n\n//\n// Item\n//\n\ntype ItemProps = Pick<MosaicTileProps<Ref.Ref<TestItem>>, 'classNames' | 'location' | 'data' | 'debug'>;\n\nconst Item = forwardRef<HTMLDivElement, ItemProps>(({ classNames, data: ref, location, debug }, forwardedRef) => {\n const rootRef = useRef<HTMLDivElement>(null);\n const composedRef = useComposedRefs<HTMLDivElement>(rootRef, forwardedRef);\n const dragHandleRef = useRef<HTMLButtonElement>(null);\n const object = ref.target;\n if (!object) {\n return null;\n }\n\n return (\n <Mosaic.Tile\n asChild\n dragHandle={dragHandleRef.current}\n id={ref.dxn.toString()}\n data={ref}\n location={location}\n debug={debug}\n >\n <Focus.Group asChild>\n <Card.Root classNames={classNames} onClick={() => rootRef.current?.focus()} ref={composedRef}>\n <Card.Toolbar>\n <Card.DragHandle ref={dragHandleRef} />\n <Card.Title>{object.name}</Card.Title>\n <Card.Menu context={object} />\n </Card.Toolbar>\n <Card.Row icon='ph--note--regular' classNames='text-description'>\n {object.description}\n </Card.Row>\n <Card.Row icon='ph--tag--regular'>\n {object.label && (\n <div role='none' className='flex shrink-0 gap-1 text-xs items-center'>\n <Tag palette={getHashStyles(object.label).hue}>{object.label}</Tag>\n </div>\n )}\n </Card.Row>\n </Card.Root>\n </Focus.Group>\n </Mosaic.Tile>\n );\n});\n\nItem.displayName = 'Item';\n\n//\n// Placeholder\n//\n\nconst Placeholder = (props: MosiacPlaceholderProps<number>) => {\n return (\n <Mosaic.Placeholder {...props} classNames={mosaicStyles.placeholder.root}>\n <div\n className={mx(\n 'flex bs-full border border-dashed border-separator rounded-sm',\n mosaicStyles.placeholder.content,\n )}\n />\n </Mosaic.Placeholder>\n );\n};\n\nPlaceholder.displayName = 'Placeholder';\n\n//\n// Debug\n//\n\nexport const Debug = forwardRef<HTMLDivElement, ThemedClassName>(({ classNames }, forwardedRef) => {\n const { containers, dragging } = useMosaic(Debug.displayName!);\n const counter = useRef(0);\n return (\n <Json\n data={{ containers, dragging, count: counter.current++ }}\n classNames={mx('text-xs', classNames)}\n ref={forwardedRef}\n />\n );\n});\n\nDebug.displayName = 'Debug';\n\n//\n// Board\n//\n\nexport const Board = { Root, Column, Item, Placeholder, Debug };\n\nexport type { RootProps, ColumnProps, ItemProps };\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 const CardContainer = ({\n children,\n icon = 'ph--placeholder--regular',\n role,\n}: PropsWithChildren<{ icon?: string; role?: string }>) => {\n switch (role) {\n case 'card--popover':\n return <PopoverCardContainer icon={icon}>{children}</PopoverCardContainer>;\n case 'card--intrinsic':\n default:\n return <IntrinsicCardContainer>{children}</IntrinsicCardContainer>;\n }\n};\n\nconst border = 'relative border border-dashed border-subduedSeparator p-4 rounded-lg overflow-x-auto';\n\n//\n// Popover\n//\n\nexport type PopoverCardContainerProps = PropsWithChildren<{ icon?: string }>;\n\nexport const PopoverCardContainer = ({ children, icon = 'ph--placeholder--regular' }: PopoverCardContainerProps) => {\n return (\n <Popover.Root open>\n <Popover.Content onOpenAutoFocus={(event) => event.preventDefault()}>\n <Popover.Viewport classNames='popover-card-width'>{children}</Popover.Viewport>\n <Popover.Arrow />\n </Popover.Content>\n <Popover.Trigger asChild>\n <Icon icon={icon} size={5} />\n </Popover.Trigger>\n </Popover.Root>\n );\n};\n\n//\n// Intrinsic card container (size constrained by card).\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 className={border} style={sizeStyle(size, 'horizontal')} {...resizeAttributes}>\n {children}\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, { useRef, useState } from 'react';\n\nimport { Obj } from '@dxos/echo';\nimport { Json } from '@dxos/react-ui-syntax-highlighter';\n\nimport { Card, Mosaic, type StackTileComponent } from '../components';\n\nexport const DefaultStackTile: StackTileComponent<Obj.Any> = (props) => {\n const dragHandleRef = useRef<HTMLButtonElement>(null);\n const [open, setOpen] = useState(false);\n return (\n <Mosaic.Tile {...props} className='border border-separator rounded-sm font-mono'>\n <Card.Toolbar>\n <Card.DragHandle ref={dragHandleRef} />\n <Card.Title>{Obj.getLabel(props.data) ?? props.data.id}</Card.Title>\n <Card.Menu\n items={[\n {\n label: open ? 'Hide details' : 'Show details',\n onClick: () => setOpen((open) => !open),\n },\n ]}\n />\n </Card.Toolbar>\n {open && (\n <Card.Row>\n <Json data={props.data} classNames='text-xs' />\n </Card.Row>\n )}\n </Mosaic.Tile>\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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I,OAAK,MAAEC,KAAIC,SAAShB,MAAMiB,IAAI,KAAKjB,MAAMiB,KAAKC,EAAE,GACtD,gBAAAZ,OAAA,cAACI,KAAKS,MAAI;IACRC,OAAO;MACL;QACEC,OAAOlB,OAAO,iBAAiB;QAC/BmB,SAAS,MAAMlB,QAAQ,CAACD,UAAS,CAACA,KAAAA;MACpC;;OAILA,QACC,gBAAAG,OAAA,cAACI,KAAKa,KAAG,MACP,gBAAAjB,OAAA,cAACkB,OAAAA;IAAKP,MAAMjB,MAAMiB;IAAMQ,YAAW;;AAK7C;AAEA1B,iBAAiB2B,cAAc;",
|
|
6
|
+
"names": ["React", "withMosaic", "Story", "Mosaic", "Root", "useComposedRefs", "Schema", "React", "forwardRef", "useMemo", "useRef", "useState", "Obj", "Ref", "Type", "ObjectId", "useObject", "Tag", "Json", "getHashStyles", "mx", "TestItem", "Struct", "name", "String", "description", "optional", "label", "pipe", "Type", "object", "typename", "version", "TestColumn", "id", "ObjectId", "items", "mutable", "Array", "Ref", "Root", "forwardRef", "columns", "debug", "forwardedRef", "DebugInfo", "debugHandler", "useContainerDebug", "viewport", "setViewport", "useState", "eventHandler", "useEventHandlerAdapter", "getId", "data", "get", "make", "canDrop", "source", "Obj", "instanceOf", "React", "div", "role", "className", "mx", "ref", "Focus", "Group", "asChild", "axis", "Mosaic", "Container", "withFocus", "autoScroll", "Viewport", "padding", "viewportRef", "Stack", "item", "Tile", "Column", "classNames", "location", "column", "updateColumn", "useObject", "dragHandleRef", "useRef", "dxn", "toString", "target", "onChange", "mutator", "menuItems", "useMemo", "onClick", "obj", "idx", "findIndex", "splice", "dragHandle", "current", "Card", "Toolbar", "DragHandle", "Title", "Menu", "Context", "value", "Item", "length", "displayName", "rootRef", "composedRef", "useComposedRefs", "focus", "context", "Row", "icon", "Tag", "palette", "getHashStyles", "hue", "Placeholder", "props", "mosaicStyles", "placeholder", "root", "content", "Debug", "containers", "dragging", "useMosaic", "counter", "Json", "count", "Board", "useControllableState", "React", "Icon", "Popover", "ResizeHandle", "resizeAttributes", "sizeStyle", "DEFAULT_BLOCK_SIZE", "MIN_BLOCK_SIZE", "CardContainer", "children", "icon", "role", "React", "PopoverCardContainer", "IntrinsicCardContainer", "border", "Popover", "Root", "open", "Content", "onOpenAutoFocus", "event", "preventDefault", "Viewport", "classNames", "Arrow", "Trigger", "asChild", "Icon", "size", "defaultSize", "propSize", "onSizeChange", "setSize", "useControllableState", "prop", "defaultProp", "onChange", "div", "className", "style", "sizeStyle", "resizeAttributes", "ResizeHandle", "side", "fallbackSize", "minSize", "React", "useRef", "useState", "Obj", "Json", "DefaultStackTile", "props", "dragHandleRef", "useRef", "open", "setOpen", "useState", "React", "Mosaic", "Tile", "className", "Card", "Toolbar", "DragHandle", "ref", "Title", "Obj", "getLabel", "data", "id", "Menu", "items", "label", "onClick", "Row", "Json", "classNames", "displayName"]
|
|
7
7
|
}
|
|
@@ -376,11 +376,15 @@ var CardLink = ({ label, href }) => {
|
|
|
376
376
|
icon: "ph--arrow-square-out--regular"
|
|
377
377
|
})));
|
|
378
378
|
};
|
|
379
|
-
var
|
|
379
|
+
var CardIconBlock = ({ classNames, children, role = "none", ...props }) => {
|
|
380
380
|
return /* @__PURE__ */ React2.createElement("div", {
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
381
|
+
...props,
|
|
382
|
+
role,
|
|
383
|
+
className: mx2("grid bs-[var(--rail-item)] is-[var(--rail-item)] place-items-center", classNames)
|
|
384
|
+
}, children);
|
|
385
|
+
};
|
|
386
|
+
var CardIcon = ({ toolbar, ...props }) => {
|
|
387
|
+
return /* @__PURE__ */ React2.createElement(CardIconBlock, null, /* @__PURE__ */ React2.createElement(Icon, {
|
|
384
388
|
...props,
|
|
385
389
|
size: toolbar ? 5 : 4
|
|
386
390
|
}));
|
|
@@ -397,6 +401,7 @@ var Card = {
|
|
|
397
401
|
Close: CardClose,
|
|
398
402
|
Menu: CardMenu,
|
|
399
403
|
Icon: CardIcon,
|
|
404
|
+
IconBlock: CardIconBlock,
|
|
400
405
|
// Content
|
|
401
406
|
Content: CardContent,
|
|
402
407
|
Row: CardRow,
|
|
@@ -648,7 +653,7 @@ import { isTruthy } from "@dxos/util";
|
|
|
648
653
|
|
|
649
654
|
// src/components/Scrollable/Scrollable.tsx
|
|
650
655
|
import { OverlayScrollbarsComponent } from "overlayscrollbars-react";
|
|
651
|
-
import React4, { forwardRef as forwardRef3, useEffect, useMemo, useRef as useRef3 } from "react";
|
|
656
|
+
import React4, { forwardRef as forwardRef3, useEffect, useImperativeHandle, useMemo, useRef as useRef3 } from "react";
|
|
652
657
|
import { mx as mx4 } from "@dxos/ui-theme";
|
|
653
658
|
import "overlayscrollbars/styles/overlayscrollbars.css";
|
|
654
659
|
var defaultOptions = {
|
|
@@ -675,20 +680,13 @@ var Scrollable = /* @__PURE__ */ forwardRef3(({ classNames, axis = "vertical", p
|
|
|
675
680
|
axis,
|
|
676
681
|
optionsProp
|
|
677
682
|
]);
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
if (typeof forwardedRef === "function") {
|
|
682
|
-
forwardedRef(hostElement ?? null);
|
|
683
|
-
} else {
|
|
684
|
-
forwardedRef.current = hostElement ?? null;
|
|
685
|
-
}
|
|
686
|
-
}
|
|
687
|
-
});
|
|
683
|
+
useImperativeHandle(forwardedRef, () => osRef.current?.getElement(), [
|
|
684
|
+
osRef
|
|
685
|
+
]);
|
|
688
686
|
useEffect(() => {
|
|
689
687
|
const instance = osRef.current?.osInstance();
|
|
690
688
|
if (viewportRef) {
|
|
691
|
-
viewportRef
|
|
689
|
+
viewportRef(instance?.elements().viewport ?? null);
|
|
692
690
|
}
|
|
693
691
|
}, [
|
|
694
692
|
osRef,
|
|
@@ -708,7 +706,7 @@ var Scrollable = /* @__PURE__ */ forwardRef3(({ classNames, axis = "vertical", p
|
|
|
708
706
|
]);
|
|
709
707
|
return /* @__PURE__ */ React4.createElement(OverlayScrollbarsComponent, {
|
|
710
708
|
...props,
|
|
711
|
-
className: mx4(padding && axis === "vertical" ? "pli-3" : "pbe-3", classNames),
|
|
709
|
+
className: mx4(padding && (axis === "vertical" ? "pli-3" : "pbe-3"), classNames),
|
|
712
710
|
options,
|
|
713
711
|
events,
|
|
714
712
|
ref: osRef
|
|
@@ -1139,7 +1137,6 @@ var Root = /* @__PURE__ */ forwardRef5(({ classNames, children, asChild, debug }
|
|
|
1139
1137
|
source: sourceData
|
|
1140
1138
|
}, async (object) => {
|
|
1141
1139
|
targetHandler.onDrop?.({
|
|
1142
|
-
// TODO(burdon): Change source!!!
|
|
1143
1140
|
source: {
|
|
1144
1141
|
...sourceData,
|
|
1145
1142
|
data: object
|
|
@@ -1235,25 +1232,17 @@ var Container = /* @__PURE__ */ forwardRef5(({ className, classNames, children,
|
|
|
1235
1232
|
}, 500);
|
|
1236
1233
|
};
|
|
1237
1234
|
return combine(...[
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
})
|
|
1250
|
-
}),
|
|
1251
|
-
bind(autoscrollElement, {
|
|
1252
|
-
type: "scroll",
|
|
1253
|
-
listener: handleScroll
|
|
1254
|
-
}),
|
|
1255
|
-
() => setScrolling(false)
|
|
1256
|
-
],
|
|
1235
|
+
/**
|
|
1236
|
+
* Custom event for dragging cancellation.
|
|
1237
|
+
*/
|
|
1238
|
+
bind(rootRef.current, {
|
|
1239
|
+
type: "dnd:cancel",
|
|
1240
|
+
listener: () => {
|
|
1241
|
+
setState({
|
|
1242
|
+
type: "idle"
|
|
1243
|
+
});
|
|
1244
|
+
}
|
|
1245
|
+
}),
|
|
1257
1246
|
// Target.
|
|
1258
1247
|
dropTargetForElements({
|
|
1259
1248
|
element: rootRef.current,
|
|
@@ -1314,17 +1303,26 @@ var Container = /* @__PURE__ */ forwardRef5(({ className, classNames, children,
|
|
|
1314
1303
|
});
|
|
1315
1304
|
}
|
|
1316
1305
|
}),
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
}
|
|
1326
|
-
|
|
1327
|
-
|
|
1306
|
+
// Autoscroll.
|
|
1307
|
+
// NOTE: When used with Scrollable we get a spurious warning (in dev mode).
|
|
1308
|
+
// "Auto scrolling has been attached to an element that appears not to be scrollable."
|
|
1309
|
+
autoscrollElement && [
|
|
1310
|
+
autoScrollForElements({
|
|
1311
|
+
element: autoscrollElement,
|
|
1312
|
+
// canScroll: ({ element: _ }) => {
|
|
1313
|
+
// return true;
|
|
1314
|
+
// },
|
|
1315
|
+
getAllowedAxis: () => axis,
|
|
1316
|
+
getConfiguration: () => ({
|
|
1317
|
+
maxScrollSpeed: "fast"
|
|
1318
|
+
})
|
|
1319
|
+
}),
|
|
1320
|
+
bind(autoscrollElement, {
|
|
1321
|
+
type: "scroll",
|
|
1322
|
+
listener: handleScroll
|
|
1323
|
+
}),
|
|
1324
|
+
() => setScrolling(false)
|
|
1325
|
+
]
|
|
1328
1326
|
].filter(isTruthy).flatMap((x) => x));
|
|
1329
1327
|
}, [
|
|
1330
1328
|
rootRef,
|
|
@@ -1638,4 +1636,4 @@ export {
|
|
|
1638
1636
|
useTileContext,
|
|
1639
1637
|
Mosaic
|
|
1640
1638
|
};
|
|
1641
|
-
//# sourceMappingURL=chunk-
|
|
1639
|
+
//# sourceMappingURL=chunk-X6GV7SMK.mjs.map
|