import { ref } from "vue";

// 跨组件裁剪触发信号：vueFlow 上方面板按钮 ++ 触发，ImageNode watch 后进入裁剪模式
export const cropSignal = ref(0);
// 裁剪模式激活状态：ImageNode 设置，vueFlow 读取以隐藏上方面板
export const cropActive = ref(false);

// 裁剪确认信号：vueFlow 工具条「确定」按钮 ++ 触发，ImageNode watch 后确认裁剪
export const cropConfirmSignal = ref(0);
// 裁剪取消信号：vueFlow 工具条「取消」按钮 ++ 触发，ImageNode watch 后取消裁剪
export const cropCancelSignal = ref(0);
// 裁剪比例共享值：vueFlow 工具条 select 双向绑定，ImageNode 读取用于 Cropper 配置
export const cropProportionValue = ref("free");

// 裁剪比例配置（vueFlow 工具条下拉项 + ImageNode 比例计算共用）
export const proportionOptions = [
  { label: "自由比例", value: "free", ratio: 0 },
  { label: "原图比例", value: "original", ratio: 0 },
  { label: "1:1", value: "1:1", ratio: 1 },
  { label: "4:3", value: "4:3", ratio: 4 / 3 },
  { label: "3:4", value: "3:4", ratio: 3 / 4 },
  { label: "16:9", value: "16:9", ratio: 16 / 9 },
  { label: "9:16", value: "9:16", ratio: 9 / 16 },
];
