@opentiny/tiny-engine-toolbar-redoundo 2.0.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +43 -45
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -2,13 +2,13 @@ import "./style.css";
|
|
|
2
2
|
import { Popover as S } from "@opentiny/vue";
|
|
3
3
|
import { useHistory as w, useCanvas as s, HOOK_NAME as _ } from "@opentiny/tiny-engine-meta-register";
|
|
4
4
|
import { ToolbarBase as k } from "@opentiny/tiny-engine-common";
|
|
5
|
-
import { resolveComponent as c, openBlock as x, createBlock as H, withCtx as p, createElementVNode as d, createVNode as a, normalizeClass as b, reactive as O, watch as C, isProxy as N, toRaw as
|
|
6
|
-
const
|
|
7
|
-
const r =
|
|
8
|
-
for (const [f,
|
|
9
|
-
r[f] =
|
|
5
|
+
import { resolveComponent as c, openBlock as x, createBlock as H, withCtx as p, createElementVNode as d, createVNode as a, normalizeClass as b, reactive as O, watch as C, isProxy as N, toRaw as B } from "vue";
|
|
6
|
+
const P = (o, e) => {
|
|
7
|
+
const r = o.__vccOpts || o;
|
|
8
|
+
for (const [f, y] of e)
|
|
9
|
+
r[f] = y;
|
|
10
10
|
return r;
|
|
11
|
-
},
|
|
11
|
+
}, T = {
|
|
12
12
|
components: {
|
|
13
13
|
TinyPopover: S,
|
|
14
14
|
ToolbarBase: k
|
|
@@ -22,44 +22,44 @@ const B = (e, o) => {
|
|
|
22
22
|
setup() {
|
|
23
23
|
return w();
|
|
24
24
|
}
|
|
25
|
-
},
|
|
26
|
-
function
|
|
27
|
-
const
|
|
28
|
-
return x(), H(
|
|
25
|
+
}, j = { class: "redo-undo-wrap" };
|
|
26
|
+
function E(o, e, r, f, y, R) {
|
|
27
|
+
const m = c("svg-icon"), u = c("tiny-popover"), v = c("toolbar-base");
|
|
28
|
+
return x(), H(v, { options: r.options }, {
|
|
29
29
|
default: p(() => [
|
|
30
|
-
d("span",
|
|
31
|
-
a(
|
|
30
|
+
d("span", j, [
|
|
31
|
+
a(u, {
|
|
32
32
|
trigger: "hover",
|
|
33
33
|
"open-delay": 1e3,
|
|
34
34
|
"popper-class": "toolbar-right-popover",
|
|
35
35
|
"append-to-body": "",
|
|
36
|
-
content:
|
|
36
|
+
content: o.historyState.back ? "撤销" : "没有要撤销的"
|
|
37
37
|
}, {
|
|
38
38
|
reference: p(() => [
|
|
39
39
|
d("span", {
|
|
40
|
-
class: b(["icon-wrap", "undo", { disabled: !
|
|
41
|
-
onClick:
|
|
40
|
+
class: b(["icon-wrap", "undo", { disabled: !o.historyState.back }]),
|
|
41
|
+
onClick: e[0] || (e[0] = (...i) => o.back && o.back(...i))
|
|
42
42
|
}, [
|
|
43
|
-
a(
|
|
43
|
+
a(m, {
|
|
44
44
|
name: r.options.icon.undo
|
|
45
45
|
}, null, 8, ["name"])
|
|
46
46
|
], 2)
|
|
47
47
|
]),
|
|
48
48
|
_: 1
|
|
49
49
|
}, 8, ["content"]),
|
|
50
|
-
a(
|
|
50
|
+
a(u, {
|
|
51
51
|
trigger: "hover",
|
|
52
52
|
"open-delay": 1e3,
|
|
53
53
|
"popper-class": "toolbar-right-popover",
|
|
54
54
|
"append-to-body": "",
|
|
55
|
-
content:
|
|
55
|
+
content: o.historyState.forward ? "恢复" : "没有要恢复的"
|
|
56
56
|
}, {
|
|
57
57
|
reference: p(() => [
|
|
58
58
|
d("span", {
|
|
59
|
-
class: b(["icon-wrap", "redo",
|
|
60
|
-
onClick:
|
|
59
|
+
class: b(["icon-wrap", "redo", o.historyState.forward ? "" : "disabled"]),
|
|
60
|
+
onClick: e[1] || (e[1] = (...i) => o.forward && o.forward(...i))
|
|
61
61
|
}, [
|
|
62
|
-
a(
|
|
62
|
+
a(m, {
|
|
63
63
|
name: r.options.icon.redo
|
|
64
64
|
}, null, 8, ["name"])
|
|
65
65
|
], 2)
|
|
@@ -71,7 +71,7 @@ function j(e, o, r, f, u, R) {
|
|
|
71
71
|
_: 1
|
|
72
72
|
}, 8, ["options"]);
|
|
73
73
|
}
|
|
74
|
-
const
|
|
74
|
+
const J = /* @__PURE__ */ P(T, [["render", E], ["__scopeId", "data-v-dc6af9aa"]]), M = {
|
|
75
75
|
id: "engine.toolbars.redoundo",
|
|
76
76
|
type: "toolbars",
|
|
77
77
|
title: "redoundo",
|
|
@@ -82,27 +82,26 @@ const E = /* @__PURE__ */ B(P, [["render", j], ["__scopeId", "data-v-dc6af9aa"]]
|
|
|
82
82
|
},
|
|
83
83
|
renderType: "slot"
|
|
84
84
|
}
|
|
85
|
-
},
|
|
86
|
-
let
|
|
85
|
+
}, V = (o) => (N(o) && (o = B(o)), JSON.stringify(o)), $ = (o) => {
|
|
86
|
+
let e;
|
|
87
87
|
try {
|
|
88
|
-
|
|
88
|
+
e = JSON.parse(o);
|
|
89
89
|
} catch {
|
|
90
|
-
|
|
90
|
+
e = {};
|
|
91
91
|
}
|
|
92
|
-
return
|
|
93
|
-
}, n = [],
|
|
92
|
+
return e;
|
|
93
|
+
}, n = [], g = 5, t = O({
|
|
94
94
|
index: 0,
|
|
95
95
|
back: !1,
|
|
96
96
|
forward: !1
|
|
97
|
-
}),
|
|
98
|
-
let
|
|
99
|
-
t.index <
|
|
100
|
-
}, l = (
|
|
101
|
-
|
|
102
|
-
t.index = t.index + e, (r = s().canvasApi.value) == null || r.setSchema(V(n[t.index])), typeof o == "boolean" && n.splice(1, 1);
|
|
103
|
-
}, $ = () => {
|
|
104
|
-
t.back && (l(-1), s().setSaved(!1));
|
|
97
|
+
}), h = (o) => {
|
|
98
|
+
let e = n.length;
|
|
99
|
+
t.index < e - 1 && (n.splice(t.index + 1), e = n.length), e >= g && n.splice(0, e - g + 1), n.push(V(o)), t.index = n.length - 1;
|
|
100
|
+
}, l = (o, e) => {
|
|
101
|
+
t.index = t.index + o, s().importSchema($(n[t.index])), typeof e == "boolean" && n.splice(1, 1);
|
|
105
102
|
}, z = () => {
|
|
103
|
+
t.back && (l(-1), s().setSaved(!1));
|
|
104
|
+
}, A = () => {
|
|
106
105
|
t.forward && (l(1), s().setSaved(t.index === n.length - 1));
|
|
107
106
|
}, D = () => {
|
|
108
107
|
n.splice(0), Object.assign(t, {
|
|
@@ -110,20 +109,19 @@ const E = /* @__PURE__ */ B(P, [["render", j], ["__scopeId", "data-v-dc6af9aa"]]
|
|
|
110
109
|
back: !1,
|
|
111
110
|
forward: !1
|
|
112
111
|
});
|
|
113
|
-
}, I = (
|
|
114
|
-
|
|
115
|
-
e ? (D(), g(e)) : (s().setSaved(!1), g((o = s().canvasApi.value) == null ? void 0 : o.getSchema()));
|
|
112
|
+
}, I = (o) => {
|
|
113
|
+
o ? (D(), h(o)) : (s().setSaved(!1), h(s().getSchema()));
|
|
116
114
|
};
|
|
117
115
|
C(
|
|
118
116
|
() => t.index,
|
|
119
|
-
(
|
|
120
|
-
t.back =
|
|
117
|
+
(o) => {
|
|
118
|
+
t.back = o > 0, t.forward = o < n.length - 1;
|
|
121
119
|
}
|
|
122
120
|
);
|
|
123
121
|
const K = () => ({
|
|
124
122
|
historyState: t,
|
|
125
|
-
back:
|
|
126
|
-
forward:
|
|
123
|
+
back: z,
|
|
124
|
+
forward: A,
|
|
127
125
|
go: l,
|
|
128
126
|
addHistory: I
|
|
129
127
|
}), L = {
|
|
@@ -134,8 +132,8 @@ const K = () => ({
|
|
|
134
132
|
name: _.useHistory
|
|
135
133
|
}
|
|
136
134
|
}, W = {
|
|
137
|
-
...
|
|
138
|
-
entry:
|
|
135
|
+
...M,
|
|
136
|
+
entry: J,
|
|
139
137
|
metas: [L]
|
|
140
138
|
};
|
|
141
139
|
export {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opentiny/tiny-engine-toolbar-redoundo",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -25,11 +25,11 @@
|
|
|
25
25
|
"license": "MIT",
|
|
26
26
|
"homepage": "https://opentiny.design/tiny-engine",
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@opentiny/tiny-engine-common": "2.
|
|
29
|
-
"@opentiny/tiny-engine-meta-register": "2.
|
|
28
|
+
"@opentiny/tiny-engine-common": "2.1.0",
|
|
29
|
+
"@opentiny/tiny-engine-meta-register": "2.1.0"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@opentiny/tiny-engine-vite-plugin-meta-comments": "2.
|
|
32
|
+
"@opentiny/tiny-engine-vite-plugin-meta-comments": "2.1.0",
|
|
33
33
|
"@vitejs/plugin-vue": "^5.1.2",
|
|
34
34
|
"@vitejs/plugin-vue-jsx": "^4.0.1",
|
|
35
35
|
"vite": "^5.4.2"
|
|
@@ -38,5 +38,5 @@
|
|
|
38
38
|
"@opentiny/vue": "^3.14.0",
|
|
39
39
|
"vue": "^3.4.15"
|
|
40
40
|
},
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "faf3072c75ea5024689972e2a687916e084c156f"
|
|
42
42
|
}
|