@opentiny/tiny-engine-toolbar-redoundo 2.2.0 → 2.3.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 +49 -49
- package/dist/style.css +1 -1
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import "./style.css";
|
|
2
|
-
import { Popover as
|
|
3
|
-
import { useHistory as
|
|
2
|
+
import { Popover as w } from "@opentiny/vue";
|
|
3
|
+
import { useHistory as S, useCanvas as h, 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 c, createBlock as x, openBlock as C, withCtx as p, createElementVNode as d, createVNode as a, normalizeClass as u, reactive as H, watch as O, isProxy as N, toRaw as B } from "vue";
|
|
6
|
+
const P = (o, e) => {
|
|
7
|
+
const r = o.__vccOpts || o;
|
|
8
|
+
for (const [s, f] of e)
|
|
9
|
+
r[s] = f;
|
|
10
10
|
return r;
|
|
11
11
|
}, T = {
|
|
12
12
|
components: {
|
|
13
|
-
TinyPopover:
|
|
13
|
+
TinyPopover: w,
|
|
14
14
|
ToolbarBase: k
|
|
15
15
|
},
|
|
16
16
|
props: {
|
|
@@ -20,46 +20,46 @@ const P = (e, o) => {
|
|
|
20
20
|
}
|
|
21
21
|
},
|
|
22
22
|
setup() {
|
|
23
|
-
return
|
|
23
|
+
return S();
|
|
24
24
|
}
|
|
25
25
|
}, j = { class: "redo-undo-wrap" };
|
|
26
|
-
function E(
|
|
27
|
-
const
|
|
28
|
-
return
|
|
29
|
-
default:
|
|
30
|
-
|
|
31
|
-
|
|
26
|
+
function E(o, e, r, s, f, R) {
|
|
27
|
+
const y = c("svg-icon"), m = c("tiny-popover"), v = c("toolbar-base");
|
|
28
|
+
return C(), x(v, { options: r.options }, {
|
|
29
|
+
default: p(() => [
|
|
30
|
+
d("span", j, [
|
|
31
|
+
a(m, {
|
|
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
|
-
reference:
|
|
39
|
-
|
|
40
|
-
class:
|
|
41
|
-
onClick:
|
|
38
|
+
reference: p(() => [
|
|
39
|
+
d("span", {
|
|
40
|
+
class: u(["icon-wrap", "undo", { disabled: !o.historyState.back }]),
|
|
41
|
+
onClick: e[0] || (e[0] = (...i) => o.back && o.back(...i))
|
|
42
42
|
}, [
|
|
43
|
-
|
|
43
|
+
a(y, {
|
|
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
|
+
a(m, {
|
|
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
|
-
reference:
|
|
58
|
-
|
|
59
|
-
class:
|
|
60
|
-
onClick:
|
|
57
|
+
reference: p(() => [
|
|
58
|
+
d("span", {
|
|
59
|
+
class: u(["icon-wrap", "redo", o.historyState.forward ? "" : "disabled"]),
|
|
60
|
+
onClick: e[1] || (e[1] = (...i) => o.forward && o.forward(...i))
|
|
61
61
|
}, [
|
|
62
|
-
|
|
62
|
+
a(y, {
|
|
63
63
|
name: r.options.icon.redo
|
|
64
64
|
}, null, 8, ["name"])
|
|
65
65
|
], 2)
|
|
@@ -71,7 +71,7 @@ function E(e, o, r, a, 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-498c81a6"]]), M = {
|
|
75
75
|
id: "engine.toolbars.redoundo",
|
|
76
76
|
type: "toolbars",
|
|
77
77
|
title: "redoundo",
|
|
@@ -82,49 +82,49 @@ const J = /* @__PURE__ */ P(T, [["render", E], ["__scopeId", "data-v-8dcca061"]]
|
|
|
82
82
|
},
|
|
83
83
|
renderType: "slot"
|
|
84
84
|
}
|
|
85
|
-
}, V = (
|
|
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 = [], b = 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 +
|
|
102
|
-
const { pageState: r, resetCanvasState:
|
|
103
|
-
|
|
97
|
+
}), g = (o) => {
|
|
98
|
+
let e = n.length;
|
|
99
|
+
t.index < e - 1 && (n.splice(t.index + 1), e = n.length), e >= b && n.splice(0, e - b + 1), n.push(V(o)), t.index = n.length - 1;
|
|
100
|
+
}, l = (o, e) => {
|
|
101
|
+
t.index = t.index + o;
|
|
102
|
+
const { pageState: r, resetCanvasState: s } = h();
|
|
103
|
+
s({ ...r, pageSchema: $(n[t.index]) }), typeof e == "boolean" && n.splice(1, 1);
|
|
104
104
|
}, z = () => {
|
|
105
|
-
t.back && (
|
|
105
|
+
t.back && l(-1);
|
|
106
106
|
}, A = () => {
|
|
107
|
-
t.forward && (
|
|
107
|
+
t.forward && l(1);
|
|
108
108
|
}, D = () => {
|
|
109
109
|
n.splice(0), Object.assign(t, {
|
|
110
110
|
index: 0,
|
|
111
111
|
back: !1,
|
|
112
112
|
forward: !1
|
|
113
113
|
});
|
|
114
|
-
}, I = (
|
|
115
|
-
|
|
114
|
+
}, I = (o) => {
|
|
115
|
+
o ? (D(), g(o)) : g(h().getSchema());
|
|
116
116
|
};
|
|
117
117
|
O(
|
|
118
118
|
() => t.index,
|
|
119
|
-
(
|
|
120
|
-
t.back =
|
|
119
|
+
(o) => {
|
|
120
|
+
t.back = o > 0, t.forward = o < n.length - 1;
|
|
121
121
|
}
|
|
122
122
|
);
|
|
123
123
|
const K = () => ({
|
|
124
124
|
historyState: t,
|
|
125
125
|
back: z,
|
|
126
126
|
forward: A,
|
|
127
|
-
go:
|
|
127
|
+
go: l,
|
|
128
128
|
addHistory: I
|
|
129
129
|
}), L = {
|
|
130
130
|
id: "engine.service.history",
|
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.redo-undo-wrap[data-v-
|
|
1
|
+
.redo-undo-wrap[data-v-498c81a6]{display:flex}.redo-undo-wrap[data-v-498c81a6] .icon-wrap{display:inline-flex;align-items:center;justify-content:center;height:32px;width:32px;border-radius:6px}.redo-undo-wrap[data-v-498c81a6] .icon-wrap svg{color:var(--te-toolbars-redoundo-text-color);font-size:20px}.redo-undo-wrap[data-v-498c81a6] .icon-wrap.disabled{cursor:not-allowed}.redo-undo-wrap[data-v-498c81a6] .icon-wrap.disabled svg{color:var(--te-toolbars-redoundo-text-color-disabled)}.redo-undo-wrap[data-v-498c81a6] .icon-wrap:not(.disabled):hover{background:var(--te-toolbars-redoundo-bg-color-active)}.redo-undo-wrap[data-v-498c81a6] .icon-wrap:not(.disabled):hover svg{color:var(--te-toolbars-redoundo-icon-color-hover)}.redo-undo-wrap[data-v-498c81a6] .icon-wrap.redo{margin-left:-5px}:root{--te-toolbars-redoundo-text-color: var(--te-common-text-primary);--te-toolbars-redoundo-text-color-disabled: var(--te-common-text-disabled);--te-toolbars-redoundo-bg-color-active: var(--te-common-bg-prompt);--te-toolbars-redoundo-icon-color-hover: var(--te-common-icon-hover)}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opentiny/tiny-engine-toolbar-redoundo",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -25,18 +25,18 @@
|
|
|
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.3.0",
|
|
29
|
+
"@opentiny/tiny-engine-meta-register": "2.3.0"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@opentiny/tiny-engine-vite-plugin-meta-comments": "2.
|
|
32
|
+
"@opentiny/tiny-engine-vite-plugin-meta-comments": "2.3.0",
|
|
33
33
|
"@vitejs/plugin-vue": "^5.1.2",
|
|
34
34
|
"@vitejs/plugin-vue-jsx": "^4.0.1",
|
|
35
35
|
"vite": "^5.4.2"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
|
-
"@opentiny/vue": "^3.
|
|
38
|
+
"@opentiny/vue": "^3.20.0",
|
|
39
39
|
"vue": "^3.4.15"
|
|
40
40
|
},
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "330c4d2b319d5b5ba6ad64c270c21a7931a2e400"
|
|
42
42
|
}
|