import { useEditor } from "@/modules/editor"; import { DesignComp } from "@/modules/editor/objects/DesignTemp/DesignComp"; import { TopToolbarsLeft, TopToolbarsRight, } from "@/modules/editor/objects/Toolbars/topToolbars"; import { useLauncher } from "@/modules/launcher"; import { css, cx } from "@linaria/core"; import { IconPlus, IconReduce } from "@queenjs/icons"; import { InputNumber } from "ant-design-vue"; import { defineUI } from "queenjs"; import { TipIcons } from "../../TipIcons"; import { IconFit } from "@/assets/icons"; import History from "./History"; import SaveOrShare from "../Header/SaveOrShare"; export default defineUI({ setup() { const editor = useEditor(); const { controls, store, actions, helper } = editor; const { editorCtrl } = controls; const launcher = useLauncher(); return () => { const comp = helper.findComp(controls.selectCtrl.gizmo.selectedIds[0]); const toolsLeft = comp ? TopToolbarsLeft.filter((t) => t.getVisible.call(editor, comp)) : []; const toolsRight = comp ? TopToolbarsRight.filter((t) => t.getVisible.call(editor, comp)) : []; const scale = editorCtrl.state.scale; return (
{false && (
{toolsLeft.map((item) => { return ( item.onClick.call(editor, comp as DesignComp) } /> ); })}
{toolsRight.map((item) => { return ( item.onClick.call(editor, comp as DesignComp) } /> ); })}
)}
editorCtrl.autoInScreen()} /> editorCtrl.clickChangeScale(scale - 0.1)} /> editorCtrl.clickChangeScale(scale + 0.1)} /> Math.floor(v * 100) + "%"} onPressEnter={(e: any) => { const newScale = e.target.value.split("%")[0] / 100; editorCtrl.clickChangeScale(newScale); }} />
{/* editorCtrl.moveEditor()} /> */} { launcher.showModal(, { width: "400px", }); }} /> actions.updateThumbnailByScreenshot(true)} />
); }; }, }); const bottomBtnStyles = css` padding: 10px; border-radius: 50%; background-color: #333; @apply shadow; `; const group = css` .ant-input-number, .inficon { transition: all 0.3s ease-in-out; } .inficon { margin-right: -36px; line-height: 0; } .ant-input-number-input { height: 36px; line-height: 36px; text-align: center; } &:hover { .ant-input-number { margin-left: 10px; } .inficon { margin-right: 0; } } `;