@dxos/plugin-deck 0.7.2 → 0.7.3-staging.0905f03

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.
@@ -14,6 +14,7 @@ import {
14
14
  type Layout,
15
15
  indexInPart,
16
16
  partLength,
17
+ LayoutAction,
17
18
  } from '@dxos/app-framework';
18
19
  import { debounce } from '@dxos/async';
19
20
  import { useGraph } from '@dxos/plugin-graph';
@@ -38,10 +39,9 @@ export type PlankProps = {
38
39
  part: LayoutPart;
39
40
  layoutMode: Layout['layoutMode'];
40
41
  order?: number;
41
- last?: boolean;
42
42
  };
43
43
 
44
- export const Plank = memo(({ entry, layoutParts, part, layoutMode, order, last }: PlankProps) => {
44
+ export const Plank = memo(({ entry, layoutParts, part, layoutMode, order }: PlankProps) => {
45
45
  const dispatch = useIntentDispatcher();
46
46
  const coordinate: LayoutCoordinate = useMemo(() => ({ part, entryId: entry?.id ?? UNKNOWN_ID }), [entry?.id, part]);
47
47
  const { popoverAnchorId, scrollIntoView } = useLayout();
@@ -75,8 +75,13 @@ export const Plank = memo(({ entry, layoutParts, part, layoutMode, order, last }
75
75
 
76
76
  useLayoutEffect(() => {
77
77
  if (scrollIntoView === coordinate.entryId) {
78
- rootElement.current?.focus({ preventScroll: true });
79
- layoutMode === 'deck' && rootElement.current?.scrollIntoView({ behavior: 'smooth', inline: 'center' });
78
+ // TODO(wittjosiah): When focused on page load, the focus is always visible.
79
+ // Forcing focus to something smaller than the plank prevents large focus ring in the interim.
80
+ const focusable = rootElement.current?.querySelector('button') || rootElement.current;
81
+ focusable?.focus({ preventScroll: true });
82
+ layoutMode === 'deck' && focusable?.scrollIntoView({ behavior: 'smooth', inline: 'center' });
83
+ // Clear the scroll into view state once it has been actioned.
84
+ void dispatch({ action: LayoutAction.SCROLL_INTO_VIEW, data: { id: undefined } });
80
85
  }
81
86
  }, [coordinate.entryId, scrollIntoView, layoutMode]);
82
87
 
@@ -4,12 +4,7 @@
4
4
 
5
5
  import React from 'react';
6
6
 
7
- import { Status } from '@dxos/react-ui';
8
-
7
+ // TODO(burdon): Show skeleton: https://github.com/dxos/dxos/issues/8259
9
8
  export const PlankLoading = () => {
10
- return (
11
- <div role='none' className='grid place-items-center attention-surface'>
12
- <Status indeterminate aria-label='Initializing' />
13
- </div>
14
- );
9
+ return <div role='none' className='grid place-items-center attention-surface' />;
15
10
  };