import "../../../../../node_modules/.pnpm/vue@3.3.4/node_modules/vue/dist/vue.runtime.esm-bundler.mjs";
import { useChartEditStore } from "../../../../store/modules/chartEditStore/chartEditStore.mjs";
import { EditCanvasTypeEnum } from "../../../../store/modules/chartEditStore/chartEditStore.d.mjs";
import { onMounted, onUnmounted } from "../../../../../node_modules/.pnpm/@vue_runtime-core@3.3.4/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.mjs";
const chartEditStore = useChartEditStore();
const useLayout = (fn) => {
  let removeScale = () => {
  };
  onMounted(async () => {
    chartEditStore.setEditCanvas(
      EditCanvasTypeEnum.EDIT_LAYOUT_DOM,
      document.getElementById("go-chart-edit-layout")
    );
    chartEditStore.setEditCanvas(
      EditCanvasTypeEnum.EDIT_CONTENT_DOM,
      document.getElementById("go-chart-edit-content")
    );
    await fn();
    removeScale = chartEditStore.listenerScale();
  });
  onUnmounted(() => {
    chartEditStore.setEditCanvas(EditCanvasTypeEnum.EDIT_LAYOUT_DOM, null);
    chartEditStore.setEditCanvas(EditCanvasTypeEnum.EDIT_CONTENT_DOM, null);
    removeScale();
  });
};
export {
  useLayout
};
