@opentiny/tiny-engine-toolbar-redoundo 2.0.0 → 2.1.0-rc.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/LICENSE +22 -22
- package/dist/index.js +43 -45
- package/dist/style.css +1 -1
- package/package.json +5 -5
package/LICENSE
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2023 - present TinyEngine Authors.
|
|
4
|
-
Copyright (c) 2023 - present Huawei Cloud Computing Technologies Co., Ltd.
|
|
5
|
-
|
|
6
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
8
|
-
in the Software without restriction, including without limitation the rights
|
|
9
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
11
|
-
furnished to do so, subject to the following conditions:
|
|
12
|
-
|
|
13
|
-
The above copyright notice and this permission notice shall be included in all
|
|
14
|
-
copies or substantial portions of the Software.
|
|
15
|
-
|
|
16
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 - present TinyEngine Authors.
|
|
4
|
+
Copyright (c) 2023 - present Huawei Cloud Computing Technologies Co., Ltd.
|
|
5
|
+
|
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
in the Software without restriction, including without limitation the rights
|
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
furnished to do so, subject to the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
SOFTWARE.
|
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-8dcca061"]]), 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/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.redo-undo-wrap[data-v-
|
|
1
|
+
.redo-undo-wrap[data-v-8dcca061]{display:flex}.redo-undo-wrap[data-v-8dcca061] .icon-wrap{display:inline-flex;align-items:center;justify-content:center;height:32px;width:32px;border-radius:6px}.redo-undo-wrap[data-v-8dcca061] .icon-wrap svg{color:var(--ti-lowcode-toolbar-title-color);font-size:20px}.redo-undo-wrap[data-v-8dcca061] .icon-wrap.disabled{cursor:not-allowed}.redo-undo-wrap[data-v-8dcca061] .icon-wrap.disabled svg{color:var(--ti-lowcode-disabled-color)}.redo-undo-wrap[data-v-8dcca061] .icon-wrap:not(.disabled):hover{background:var(--ti-lowcode-toolbar-view-active-bg)}.redo-undo-wrap[data-v-8dcca061] .icon-wrap:not(.disabled):hover svg{color:var(--ti-lowcode-toolbar-active-color)}.redo-undo-wrap[data-v-8dcca061] .icon-wrap.redo{margin-left:-5px}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opentiny/tiny-engine-toolbar-redoundo",
|
|
3
|
-
"version": "2.0.0",
|
|
3
|
+
"version": "2.1.0-rc.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.0.0",
|
|
29
|
-
"@opentiny/tiny-engine-meta-register": "2.0.0"
|
|
28
|
+
"@opentiny/tiny-engine-common": "2.1.0-rc.0",
|
|
29
|
+
"@opentiny/tiny-engine-meta-register": "2.1.0-rc.0"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@opentiny/tiny-engine-vite-plugin-meta-comments": "2.0.0",
|
|
32
|
+
"@opentiny/tiny-engine-vite-plugin-meta-comments": "2.1.0-rc.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": "71a3549d5f1d38d2ed3934ce83b722b11878aa7c"
|
|
42
42
|
}
|