import { Transforms } from "slate";
import { Slate } from "@makeswift/controls";
import { getBlocksInSelection } from "../selectors";
function clearBlockKeyForDevice(editor, deviceId, key) {
  const rootElements = getBlocksInSelection(editor);
  for (const [node, path] of rootElements) {
    if (Slate.isBlock(node)) {
      const deviceOverrides = node[key] ?? [];
      Transforms.setNodes(
        editor,
        {
          [key]: deviceOverrides.filter((v) => v.deviceId !== deviceId)
        },
        { at: path }
      );
    }
  }
}
export {
  clearBlockKeyForDevice
};
//# sourceMappingURL=clearBlockKeyForDevice.js.map