@@ -0,0 +1,11 @@
+
+import { createIcon } from '@queenjs/icons';
+export const IconAlignC = createIcon(<svg viewBox="0 0 14 14.755">
+ <g transform="translate(-6.5 -5.5)">
+ <rect fill="none" stroke="currentColor" stroke-linejoin="round" width="13" height="6"
+ transform="translate(7 9.755)" />
+ <path fill="none" stroke="currentColor" stroke-linejoin="round" stroke-linecap="round"
+ d="M24,6V19.755"
+ transform="translate(-10.505)" />
+ </g>
+</svg>)
@@ -0,0 +1,10 @@
+export const IconAlignL = createIcon(<svg viewBox="0 0 14.755 14.51">
+ <g transform="translate(-6 -5.5)">
+ <rect fill="none" stroke="currentColor" stroke-linejoin="round" width="11" height="6"
+ transform="translate(9.255 9.755)" />
+ d="M6.5,6V19.51" />
+export const IconAlignR = createIcon(<svg viewBox="0 0 14.755 14.51">
+ <g transform="translate(0.5 0.5)">
+ transform="translate(0 3.755)" />
+ d="M6.5,6V19.51"
+ transform="translate(7.255 -6)" />
@@ -0,0 +1,13 @@
+export const IconClear = createIcon(<svg viewBox="0 0 14.95 14.637">
+ <g transform="translate(-3.976 -5.5)">
+ <rect fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"
+ width="11.658"
+ height="7.359" transform="translate(5.621 12.278)" />
+ <path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"
+ d="M4,8.441H8.883V6h4.185V8.441H17.95v3.836H4Z" transform="translate(0.476)" />
+ <path fill="none" stroke="currentColor" stroke-linecap="round" d="M16,32v3.488"
+ transform="translate(-7.815 -16.043)" />
@@ -0,0 +1,3 @@
+export const IconFloat = createIcon(<svg viewBox="0 0 15.557 15.557"><g transform="translate(-1383.222 -111.222)"><g transform="translate(1377.328 107.645)"><path fill="none" stroke="#666" stroke-linecap="round" fill-rule="evenodd" d="M13.672,16.344a5.672,5.672,0,1,0-4.011-1.661A5.655,5.655,0,0,0,13.672,16.344Z" transform="translate(0 0)"/><path fill="none" stroke="#666" stroke-linecap="round" d="M19.473,36.556a7.8,7.8,0,0,1-11.03,0" transform="translate(-0.286 -20.37)"/></g><line fill="none" stroke="#666" stroke-linecap="round" y1="20" transform="translate(1398.071 126.071) rotate(135)"/></g></svg>)
@@ -0,0 +1,15 @@
+export const IconFloatOff = createIcon(<svg viewBox="0 0 15.557 15.557">
+ <g transform="translate(-1383.222 -111.222)">
+ <g transform="translate(1377.328 107.645)">
+ <path fill="none" stroke="currentColor" stroke-linecap="round" fill-rule="evenodd"
+ d="M13.672,16.344a5.672,5.672,0,1,0-4.011-1.661A5.655,5.655,0,0,0,13.672,16.344Z"
+ transform="translate(0 0)" />
+ <path fill="none" stroke="currentColor" stroke-linecap="round"
+ d="M19.473,36.556a7.8,7.8,0,0,1-11.03,0" transform="translate(-0.286 -20.37)" />
+ <line fill="none" stroke="currentColor" stroke-linecap="round" y1="20"
+ transform="translate(1398.071 126.071) rotate(135)" />
@@ -0,0 +1,12 @@
+export const IconFloatOn = createIcon(<svg viewBox="0 0 12.444 14.471">
+ <g transform="translate(-7.45 -4.5)">
+ d="M19.473,36.556a7.8,7.8,0,0,1-11.03,0"
+ transform="translate(-0.286 -20.37)" />
@@ -0,0 +1,27 @@
+export const IconLayerDown = createIcon(<svg viewBox="0 0 14.469 14.474">
+ <g transform="translate(-1332.776 -243.777)">
+ <g transform="translate(1327.276 238.277)">
+ d="M7.483,6H6V7.507" />
+ d="M7.493,27.5H6v-1.49" transform="translate(0 -12.537)" />
+ d="M6,27.5H7.493V26.012" transform="translate(7.471 -12.537)" />
+ d="M26,6H27.5V7.5" transform="translate(-12.531)" />
+ d="M16.028,6h1.487" transform="translate(-6.283)" />
+ d="M6,16v1.494"
+ transform="translate(0 -6.265)" />
+ d="M30,16v1.121" transform="translate(-15.035 -6.265)" />
+ <path fill="none" stroke="currentColor" stroke-linecap="round" d="M15.992,30h1.5"
+ transform="translate(-6.26 -15.035)" />
+ <path fill="none" stroke="currentColor" stroke-linejoin="round"
+ d="M16162.748,4984.224v4.527h9v-8.966h-4.534" transform="translate(-14825 -4731)" />
@@ -0,0 +1,24 @@
+export const IconLayerUp = createIcon(<svg viewBox="0 0 14.469 14.474">
+ <g transform="translate(-5.5 -5.5)">
+ d="M30,16v.56"
+ transform="translate(-15.035 -6.265)" />
+ <path fill="none" stroke="currentColor" stroke-linecap="round" d="M15.992,30h.75"
+ d="M16162.748,4984.224v4.527h9v-8.966h-9Z" transform="translate(-16152.276 -4969.277)" />
@@ -0,0 +1,8 @@
+export const IconMove = createIcon(<svg viewBox="0 0 19.276 19.276">
+ stroke-width="1.2px"
+ d="M10.153,6.637,12.79,4m0,0,2.637,2.637M12.79,4v8.79m0,0v8.79m0-8.79h8.79m-8.79,0H4m6.153,6.153,2.637,2.637m0,0,2.637-2.637m3.516-8.79,2.637,2.637m0,0-2.637,2.637M6.637,10.153,4,12.79m0,0,2.637,2.637"
+ transform="translate(-3.151 -3.151)" />
+export const IconRotate = createIcon(<svg viewBox="0 0 18.95 18.95">
+ <g transform="translate(-3.4 -3.4)">
+ stroke-width="1.2px" d="M19.688,36.669A8.887,8.887,0,0,1,6.676,34H10.37"
+ transform="translate(-1.488 -16.688)" />
+ stroke-width="1.2px" d="M32,5.664a8.881,8.881,0,0,1,4.138,12.574l-1.794-3.106"
+ transform="translate(-15.575 -0.926)" />
+ d="M4.044,13.762Q4,13.325,4,12.875A8.875,8.875,0,0,1,12.875,4L11.081,7.106" />
@@ -1,2 +1,12 @@
export * from "./components/Icon3D";
+export * from "./components/IconAlignC";
+export * from "./components/IconAlignL";
+export * from "./components/IconAlignR";
+export * from "./components/IconClear";
+export * from "./components/IconFloatOff";
+export * from "./components/IconFloatOn";
+export * from "./components/IconLayerDown";
+export * from "./components/IconLayerUp";
+export * from "./components/IconMove";
+export * from "./components/IconRotate";
@@ -0,0 +1,9 @@
+<svg viewBox="0 0 14 14.755">
+</svg>
+<svg viewBox="0 0 14.755 14.51">
+<svg viewBox="0 0 14.95 14.637">
+<svg viewBox="0 0 15.557 15.557">
+<svg viewBox="0 0 12.444 14.471">
@@ -0,0 +1,25 @@
+<svg viewBox="0 0 14.469 14.474">
@@ -0,0 +1,22 @@
@@ -0,0 +1,6 @@
+<svg viewBox="0 0 19.276 19.276">
+<svg viewBox="0 0 18.95 18.95">
@@ -2,6 +2,7 @@ import { CompToolbars } from "@/modules/editor/objects/Toolbars";
import { css } from "@linaria/core";
import { defineComponent, onMounted, onUnmounted } from "vue";
import { useEditor } from "../../../..";
+import { IconMove, IconRotate } from "@/assets/icons";
export const Transfer = defineComponent({
setup() {
@@ -78,13 +79,13 @@ export const Transfer = defineComponent({
class={transBtnStyle}
onMousedown={(e) => transferCtrl.mousedown(e, "move")}
>
- 偏移
+ <IconMove />
</div>
<div
onMousedown={(e) => transferCtrl.mousedown(e, "rotate")}
- 旋转
+ <IconRotate />
@@ -139,27 +140,29 @@ const resizeStyle = css`
`;
const transformBtnsStyle = css`
- @apply space-x-5px whitespace-nowrap;
+ @apply space-x-10px whitespace-nowrap;
position: absolute;
bottom: 0;
left: 50%;
font-size: 16px;
z-index: 999;
- transform: translate(-50%, 40px);
+ transform: translate(-50%, 50px);
const transBtnStyle = css`
display: inline-block;
- width: 30px;
- height: 30px;
+ width: 36px;
+ height: 36px;
border-radius: 50%;
background-color: #fff;
text-align: center;
- line-height: 30px;
- font-size: 16px;
+ line-height: 36px;
+ font-size: 20px;
+ color: #333;
@apply shadow cursor-move;
&:hover {
+ color: #fff;
background-color: @inf-primary-color;
}
@@ -31,6 +31,7 @@ const iconStyle = css`
background: rgba(0, 0, 0, 0.1);
@@ -1,22 +1,24 @@
import {
- IconArrowLeft,
- IconArrowRight,
- IconAxis,
+ IconAlignC,
+ IconAlignL,
+ IconAlignR,
+ IconClear,
+ IconFloatOff,
+ IconFloatOn,
+ IconLayerDown,
+ IconLayerUp,
+} from "@/assets/icons";
+import {
IconBtnNext,
IconCamera,
- IconClear,
IconCube,
IconDelete,
IconEyeOff,
IconEyeOn,
IconLock,
- IconPlus,
IconRedo,
- IconReduce,
- IconShadow,
- IconShadowOff,
IconUndo,
- IconUnlock,
+ IconUnlock
} from "@queenjs/icons";
import { createTipIcon } from "./create";
@@ -26,11 +28,11 @@ export const TipIcons = {
tips: ["截屏并保存封面"],
}),
Align: createTipIcon({
- icons: [IconArrowLeft, IconAxis, IconArrowRight],
+ icons: [IconAlignL, IconAlignC, IconAlignR],
tips: ["左对齐", "居中", "右对齐"],
Position: createTipIcon({
- icons: [IconShadowOff, IconShadow],
+ icons: [IconFloatOff, IconFloatOn],
tips: ["开启浮动", "关闭浮动"],
Visible: createTipIcon({
@@ -39,7 +41,7 @@ export const TipIcons = {
Lock: createTipIcon({
icons: [IconLock, IconUnlock],
- tips: ["显示", "隐藏"],
+ tips: ["锁定", "未锁定"],
Delete: createTipIcon({
icons: [IconDelete],
@@ -62,11 +64,11 @@ export const TipIcons = {
tips: ["重做"],
LayerUp: createTipIcon({
- icons: [IconPlus],
+ icons: [IconLayerUp],
tips: ["层级上移"],
LayerDown: createTipIcon({
- icons: [IconReduce],
+ icons: [IconLayerDown],
tips: ["层级下移"],
ParentComp: createTipIcon({
@@ -12,12 +12,14 @@ export class HistoryCtrl {
onChange(root: any, type: string, paths: string[], value: any) {
- const action = new Action(
- root,
- `${type}:${paths.join(".")}`,
- cloneDeep(value)
- );
- this.history.record(action);
+ if (this.historyActionDoing) {
+ const action = new Action(
+ root,
+ `${type}:${paths.join(".")}`,
+ cloneDeep(value)
+ );
+ this.history.record(action);
+ }
proxyActions(actNames: string[]) {