@dxos/react-ui-table 0.7.5-labs.f5080a1 → 0.7.5-labs.ff2ff30

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.
@@ -1933,7 +1933,9 @@ var TableToolbar = ({ classNames, viewDirty, attendableId, onAction }) => {
1933
1933
  };
1934
1934
 
1935
1935
  // packages/ui/react-ui-table/src/hooks/useTableModel.ts
1936
+ import { effect as effect3 } from "@preact/signals-core";
1936
1937
  import { useEffect as useEffect2, useState as useState3 } from "react";
1938
+ import { useSelectionActions } from "@dxos/react-ui-attention";
1937
1939
  var useTableModel = ({ objects, table, projection, ...props }) => {
1938
1940
  const [model, setModel] = useState3();
1939
1941
  useEffect2(() => {
@@ -1966,6 +1968,23 @@ var useTableModel = ({ objects, table, projection, ...props }) => {
1966
1968
  model,
1967
1969
  objects
1968
1970
  ]);
1971
+ const { select, clear } = useSelectionActions(table?.id);
1972
+ useEffect2(() => {
1973
+ if (!model) {
1974
+ return;
1975
+ }
1976
+ const unsubscribe = effect3(() => {
1977
+ select([
1978
+ ...model.selection.selection.value
1979
+ ]);
1980
+ });
1981
+ return () => {
1982
+ clear();
1983
+ unsubscribe();
1984
+ };
1985
+ }, [
1986
+ model
1987
+ ]);
1969
1988
  return model;
1970
1989
  };
1971
1990
  export {