@opentiny/tiny-engine-toolbar-redoundo 2.1.0 → 2.2.0-beta.3
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 +46 -44
- 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,11 +2,11 @@ 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
|
|
6
|
-
const P = (
|
|
7
|
-
const r =
|
|
8
|
-
for (const [
|
|
9
|
-
r[
|
|
5
|
+
import { resolveComponent as p, openBlock as x, createBlock as C, withCtx as d, createElementVNode as l, createVNode as i, normalizeClass as b, reactive as H, watch as O, isProxy as N, toRaw as B } from "vue";
|
|
6
|
+
const P = (e, o) => {
|
|
7
|
+
const r = e.__vccOpts || e;
|
|
8
|
+
for (const [a, y] of o)
|
|
9
|
+
r[a] = y;
|
|
10
10
|
return r;
|
|
11
11
|
}, T = {
|
|
12
12
|
components: {
|
|
@@ -23,43 +23,43 @@ const P = (o, e) => {
|
|
|
23
23
|
return w();
|
|
24
24
|
}
|
|
25
25
|
}, j = { class: "redo-undo-wrap" };
|
|
26
|
-
function E(
|
|
27
|
-
const m =
|
|
28
|
-
return x(),
|
|
29
|
-
default:
|
|
30
|
-
|
|
31
|
-
|
|
26
|
+
function E(e, o, r, a, y, R) {
|
|
27
|
+
const m = p("svg-icon"), u = p("tiny-popover"), h = p("toolbar-base");
|
|
28
|
+
return x(), C(h, { options: r.options }, {
|
|
29
|
+
default: d(() => [
|
|
30
|
+
l("span", j, [
|
|
31
|
+
i(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: e.historyState.back ? "撤销" : "没有要撤销的"
|
|
37
37
|
}, {
|
|
38
|
-
reference:
|
|
39
|
-
|
|
40
|
-
class: b(["icon-wrap", "undo", { disabled: !
|
|
41
|
-
onClick:
|
|
38
|
+
reference: d(() => [
|
|
39
|
+
l("span", {
|
|
40
|
+
class: b(["icon-wrap", "undo", { disabled: !e.historyState.back }]),
|
|
41
|
+
onClick: o[0] || (o[0] = (...c) => e.back && e.back(...c))
|
|
42
42
|
}, [
|
|
43
|
-
|
|
43
|
+
i(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
|
-
|
|
50
|
+
i(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: e.historyState.forward ? "恢复" : "没有要恢复的"
|
|
56
56
|
}, {
|
|
57
|
-
reference:
|
|
58
|
-
|
|
59
|
-
class: b(["icon-wrap", "redo",
|
|
60
|
-
onClick:
|
|
57
|
+
reference: d(() => [
|
|
58
|
+
l("span", {
|
|
59
|
+
class: b(["icon-wrap", "redo", e.historyState.forward ? "" : "disabled"]),
|
|
60
|
+
onClick: o[1] || (o[1] = (...c) => e.forward && e.forward(...c))
|
|
61
61
|
}, [
|
|
62
|
-
|
|
62
|
+
i(m, {
|
|
63
63
|
name: r.options.icon.redo
|
|
64
64
|
}, null, 8, ["name"])
|
|
65
65
|
], 2)
|
|
@@ -71,7 +71,7 @@ function E(o, e, r, f, y, R) {
|
|
|
71
71
|
_: 1
|
|
72
72
|
}, 8, ["options"]);
|
|
73
73
|
}
|
|
74
|
-
const J = /* @__PURE__ */ P(T, [["render", E], ["__scopeId", "data-v-
|
|
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,47 +82,49 @@ const J = /* @__PURE__ */ P(T, [["render", E], ["__scopeId", "data-v-dc6af9aa"]]
|
|
|
82
82
|
},
|
|
83
83
|
renderType: "slot"
|
|
84
84
|
}
|
|
85
|
-
}, V = (
|
|
86
|
-
let
|
|
85
|
+
}, V = (e) => (N(e) && (e = B(e)), JSON.stringify(e)), $ = (e) => {
|
|
86
|
+
let o;
|
|
87
87
|
try {
|
|
88
|
-
|
|
88
|
+
o = JSON.parse(e);
|
|
89
89
|
} catch {
|
|
90
|
-
|
|
90
|
+
o = {};
|
|
91
91
|
}
|
|
92
|
-
return
|
|
93
|
-
}, n = [], g = 5, t =
|
|
92
|
+
return o;
|
|
93
|
+
}, n = [], g = 5, t = H({
|
|
94
94
|
index: 0,
|
|
95
95
|
back: !1,
|
|
96
96
|
forward: !1
|
|
97
|
-
}),
|
|
98
|
-
let
|
|
99
|
-
t.index <
|
|
100
|
-
},
|
|
101
|
-
t.index = t.index +
|
|
97
|
+
}), v = (e) => {
|
|
98
|
+
let o = n.length;
|
|
99
|
+
t.index < o - 1 && (n.splice(t.index + 1), o = n.length), o >= g && n.splice(0, o - g + 1), n.push(V(e)), t.index = n.length - 1;
|
|
100
|
+
}, f = (e, o) => {
|
|
101
|
+
t.index = t.index + e;
|
|
102
|
+
const { pageState: r, resetCanvasState: a } = s();
|
|
103
|
+
a({ ...r, pageSchema: $(n[t.index]) }), typeof o == "boolean" && n.splice(1, 1);
|
|
102
104
|
}, z = () => {
|
|
103
|
-
t.back && (
|
|
105
|
+
t.back && (f(-1), s().setSaved(!1));
|
|
104
106
|
}, A = () => {
|
|
105
|
-
t.forward && (
|
|
107
|
+
t.forward && (f(1), s().setSaved(t.index === n.length - 1));
|
|
106
108
|
}, D = () => {
|
|
107
109
|
n.splice(0), Object.assign(t, {
|
|
108
110
|
index: 0,
|
|
109
111
|
back: !1,
|
|
110
112
|
forward: !1
|
|
111
113
|
});
|
|
112
|
-
}, I = (
|
|
113
|
-
|
|
114
|
+
}, I = (e) => {
|
|
115
|
+
e ? (D(), v(e)) : (s().setSaved(!1), v(s().getSchema()));
|
|
114
116
|
};
|
|
115
|
-
|
|
117
|
+
O(
|
|
116
118
|
() => t.index,
|
|
117
|
-
(
|
|
118
|
-
t.back =
|
|
119
|
+
(e) => {
|
|
120
|
+
t.back = e > 0, t.forward = e < n.length - 1;
|
|
119
121
|
}
|
|
120
122
|
);
|
|
121
123
|
const K = () => ({
|
|
122
124
|
historyState: t,
|
|
123
125
|
back: z,
|
|
124
126
|
forward: A,
|
|
125
|
-
go:
|
|
127
|
+
go: f,
|
|
126
128
|
addHistory: I
|
|
127
129
|
}), L = {
|
|
128
130
|
id: "engine.service.history",
|
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.
|
|
3
|
+
"version": "2.2.0-beta.3",
|
|
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.2.0-beta.3",
|
|
29
|
+
"@opentiny/tiny-engine-meta-register": "2.2.0-beta.3"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@opentiny/tiny-engine-vite-plugin-meta-comments": "2.
|
|
32
|
+
"@opentiny/tiny-engine-vite-plugin-meta-comments": "2.2.0-beta.3",
|
|
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": "04459f34e5ebdaca92355f7698cd4fea19f7ef95"
|
|
42
42
|
}
|