@opentiny/tiny-engine-toolbar-setting 2.5.0-alpha.0 → 2.5.0-alpha.2
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 +81 -201
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -1,23 +1,12 @@
|
|
|
1
|
-
import { useCanvas as B, useBlock as
|
|
2
|
-
import { constants as
|
|
3
|
-
import { ToolbarBase as
|
|
4
|
-
import { resolveComponent as
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
type: "toolbars",
|
|
9
|
-
options: {
|
|
10
|
-
icon: {
|
|
11
|
-
default: "setting"
|
|
12
|
-
},
|
|
13
|
-
renderType: "icon",
|
|
14
|
-
collapsed: !0
|
|
15
|
-
}
|
|
16
|
-
}, {
|
|
17
|
-
PAGE_STATUS: b
|
|
18
|
-
} = E, T = {
|
|
1
|
+
import { useCanvas as B, useBlock as P, usePage as k, useLayout as y, useModal as S, useNotify as b } from "@opentiny/tiny-engine-meta-register";
|
|
2
|
+
import { constants as A } from "@opentiny/tiny-engine-utils";
|
|
3
|
+
import { ToolbarBase as C } from "@opentiny/tiny-engine-common";
|
|
4
|
+
import { resolveComponent as E, createBlock as v, openBlock as x } from "vue";
|
|
5
|
+
const {
|
|
6
|
+
PAGE_STATUS: h
|
|
7
|
+
} = A, M = {
|
|
19
8
|
components: {
|
|
20
|
-
ToolbarBase:
|
|
9
|
+
ToolbarBase: C
|
|
21
10
|
},
|
|
22
11
|
props: {
|
|
23
12
|
options: {
|
|
@@ -27,216 +16,107 @@ const C = {
|
|
|
27
16
|
},
|
|
28
17
|
setup() {
|
|
29
18
|
const {
|
|
30
|
-
pageState:
|
|
31
|
-
isBlock:
|
|
19
|
+
pageState: s,
|
|
20
|
+
isBlock: a
|
|
32
21
|
} = B(), {
|
|
33
22
|
getCurrentBlock: t
|
|
34
|
-
} =
|
|
35
|
-
initCurrentPageData:
|
|
36
|
-
isChangePageData:
|
|
37
|
-
} = S(), {
|
|
38
|
-
PLUGIN_NAME: i,
|
|
39
|
-
activePlugin: s,
|
|
40
|
-
layoutState: p,
|
|
41
|
-
isEmptyPage: u
|
|
23
|
+
} = P(), {
|
|
24
|
+
initCurrentPageData: n,
|
|
25
|
+
isChangePageData: c
|
|
42
26
|
} = k(), {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
27
|
+
PLUGIN_NAME: u,
|
|
28
|
+
activePlugin: i,
|
|
29
|
+
layoutState: g,
|
|
30
|
+
isEmptyPage: l
|
|
31
|
+
} = y(), {
|
|
32
|
+
confirm: m,
|
|
33
|
+
message: f
|
|
34
|
+
} = S(), d = () => {
|
|
35
|
+
i(u.BlockManage).then((e) => {
|
|
36
|
+
e.openSettingPanel({
|
|
48
37
|
item: t()
|
|
49
38
|
});
|
|
50
39
|
});
|
|
51
|
-
}, {
|
|
52
|
-
metaData: {
|
|
53
|
-
id: `${C.id}.openBlockSetting`
|
|
54
|
-
},
|
|
55
|
-
ctx: () => ({
|
|
56
|
-
pageState: n,
|
|
57
|
-
isBlock: o,
|
|
58
|
-
getCurrentBlock: t,
|
|
59
|
-
initCurrentPageData: e,
|
|
60
|
-
isChangePageData: a,
|
|
61
|
-
PLUGIN_NAME: i,
|
|
62
|
-
activePlugin: s,
|
|
63
|
-
layoutState: p,
|
|
64
|
-
isEmptyPage: u,
|
|
65
|
-
confirm: l,
|
|
66
|
-
message: m,
|
|
67
|
-
openBlockSetting: d,
|
|
68
|
-
openPageAndInit: r,
|
|
69
|
-
openPageSetting: f,
|
|
70
|
-
openSetting: P,
|
|
71
|
-
useCanvas: B,
|
|
72
|
-
useLayout: k,
|
|
73
|
-
useBlock: _,
|
|
74
|
-
usePage: S,
|
|
75
|
-
useModal: y,
|
|
76
|
-
useNotify: x,
|
|
77
|
-
constants: E,
|
|
78
|
-
ToolbarBase: A,
|
|
79
|
-
PAGE_STATUS: b
|
|
80
|
-
})
|
|
81
|
-
}), r = v(async (c) => {
|
|
40
|
+
}, p = async (e) => {
|
|
82
41
|
const {
|
|
83
|
-
currentPage:
|
|
84
|
-
} =
|
|
85
|
-
|
|
86
|
-
const
|
|
87
|
-
|
|
88
|
-
}, {
|
|
89
|
-
|
|
90
|
-
id: `${C.id}.openPageAndInit`
|
|
91
|
-
},
|
|
92
|
-
ctx: () => ({
|
|
93
|
-
pageState: n,
|
|
94
|
-
isBlock: o,
|
|
95
|
-
getCurrentBlock: t,
|
|
96
|
-
initCurrentPageData: e,
|
|
97
|
-
isChangePageData: a,
|
|
98
|
-
PLUGIN_NAME: i,
|
|
99
|
-
activePlugin: s,
|
|
100
|
-
layoutState: p,
|
|
101
|
-
isEmptyPage: u,
|
|
102
|
-
confirm: l,
|
|
103
|
-
message: m,
|
|
104
|
-
openBlockSetting: d,
|
|
105
|
-
openPageAndInit: r,
|
|
106
|
-
openPageSetting: f,
|
|
107
|
-
openSetting: P,
|
|
108
|
-
useCanvas: B,
|
|
109
|
-
useLayout: k,
|
|
110
|
-
useBlock: _,
|
|
111
|
-
usePage: S,
|
|
112
|
-
useModal: y,
|
|
113
|
-
useNotify: x,
|
|
114
|
-
constants: E,
|
|
115
|
-
ToolbarBase: A,
|
|
116
|
-
PAGE_STATUS: b
|
|
117
|
-
})
|
|
118
|
-
}), f = v(() => {
|
|
119
|
-
var D;
|
|
42
|
+
currentPage: r
|
|
43
|
+
} = s;
|
|
44
|
+
e.openPageSettingPanel();
|
|
45
|
+
const o = await e.getPageById(r.id);
|
|
46
|
+
n(o);
|
|
47
|
+
}, _ = () => {
|
|
48
|
+
var r;
|
|
120
49
|
const {
|
|
121
|
-
pageStatus:
|
|
122
|
-
} =
|
|
123
|
-
if (
|
|
124
|
-
const
|
|
125
|
-
|
|
126
|
-
message: `您点击的页面被${
|
|
50
|
+
pageStatus: e
|
|
51
|
+
} = g;
|
|
52
|
+
if (e.state === h.Lock) {
|
|
53
|
+
const o = ((r = e.data) == null ? void 0 : r.username) || "";
|
|
54
|
+
f({
|
|
55
|
+
message: `您点击的页面被${o}锁定,暂时无法编辑,请联系解锁`
|
|
127
56
|
});
|
|
128
57
|
return;
|
|
129
58
|
}
|
|
130
|
-
|
|
131
|
-
if (
|
|
132
|
-
|
|
59
|
+
i(u.AppManage).then((o) => {
|
|
60
|
+
if (c()) {
|
|
61
|
+
m({
|
|
133
62
|
title: "提示",
|
|
134
63
|
message: "当前页面尚未保存,是否要继续切换?",
|
|
135
64
|
exec: () => {
|
|
136
|
-
|
|
65
|
+
p(o);
|
|
137
66
|
}
|
|
138
67
|
});
|
|
139
68
|
return;
|
|
140
69
|
}
|
|
141
|
-
|
|
70
|
+
p(o);
|
|
142
71
|
});
|
|
143
|
-
}
|
|
144
|
-
metaData: {
|
|
145
|
-
id: `${C.id}.openPageSetting`
|
|
146
|
-
},
|
|
147
|
-
ctx: () => ({
|
|
148
|
-
pageState: n,
|
|
149
|
-
isBlock: o,
|
|
150
|
-
getCurrentBlock: t,
|
|
151
|
-
initCurrentPageData: e,
|
|
152
|
-
isChangePageData: a,
|
|
153
|
-
PLUGIN_NAME: i,
|
|
154
|
-
activePlugin: s,
|
|
155
|
-
layoutState: p,
|
|
156
|
-
isEmptyPage: u,
|
|
157
|
-
confirm: l,
|
|
158
|
-
message: m,
|
|
159
|
-
openBlockSetting: d,
|
|
160
|
-
openPageAndInit: r,
|
|
161
|
-
openPageSetting: f,
|
|
162
|
-
openSetting: P,
|
|
163
|
-
useCanvas: B,
|
|
164
|
-
useLayout: k,
|
|
165
|
-
useBlock: _,
|
|
166
|
-
usePage: S,
|
|
167
|
-
useModal: y,
|
|
168
|
-
useNotify: x,
|
|
169
|
-
constants: E,
|
|
170
|
-
ToolbarBase: A,
|
|
171
|
-
PAGE_STATUS: b
|
|
172
|
-
})
|
|
173
|
-
}), P = v(() => {
|
|
174
|
-
if (u()) {
|
|
175
|
-
x({
|
|
176
|
-
type: "warning",
|
|
177
|
-
message: "请先创建页面"
|
|
178
|
-
});
|
|
179
|
-
return;
|
|
180
|
-
}
|
|
181
|
-
if (o()) {
|
|
182
|
-
d();
|
|
183
|
-
return;
|
|
184
|
-
}
|
|
185
|
-
f();
|
|
186
|
-
}, {
|
|
187
|
-
metaData: {
|
|
188
|
-
id: `${C.id}.openSetting`
|
|
189
|
-
},
|
|
190
|
-
ctx: () => ({
|
|
191
|
-
pageState: n,
|
|
192
|
-
isBlock: o,
|
|
193
|
-
getCurrentBlock: t,
|
|
194
|
-
initCurrentPageData: e,
|
|
195
|
-
isChangePageData: a,
|
|
196
|
-
PLUGIN_NAME: i,
|
|
197
|
-
activePlugin: s,
|
|
198
|
-
layoutState: p,
|
|
199
|
-
isEmptyPage: u,
|
|
200
|
-
confirm: l,
|
|
201
|
-
message: m,
|
|
202
|
-
openBlockSetting: d,
|
|
203
|
-
openPageAndInit: r,
|
|
204
|
-
openPageSetting: f,
|
|
205
|
-
openSetting: P,
|
|
206
|
-
useCanvas: B,
|
|
207
|
-
useLayout: k,
|
|
208
|
-
useBlock: _,
|
|
209
|
-
usePage: S,
|
|
210
|
-
useModal: y,
|
|
211
|
-
useNotify: x,
|
|
212
|
-
constants: E,
|
|
213
|
-
ToolbarBase: A,
|
|
214
|
-
PAGE_STATUS: b
|
|
215
|
-
})
|
|
216
|
-
});
|
|
72
|
+
};
|
|
217
73
|
return {
|
|
218
|
-
openSetting:
|
|
219
|
-
|
|
74
|
+
openSetting: () => {
|
|
75
|
+
if (l()) {
|
|
76
|
+
b({
|
|
77
|
+
type: "warning",
|
|
78
|
+
message: "请先创建页面"
|
|
79
|
+
});
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
if (a()) {
|
|
83
|
+
d();
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
_();
|
|
87
|
+
},
|
|
88
|
+
isBlock: a
|
|
220
89
|
};
|
|
221
90
|
}
|
|
222
|
-
},
|
|
223
|
-
const t =
|
|
224
|
-
for (const [
|
|
225
|
-
t[
|
|
91
|
+
}, T = (s, a) => {
|
|
92
|
+
const t = s.__vccOpts || s;
|
|
93
|
+
for (const [n, c] of a)
|
|
94
|
+
t[n] = c;
|
|
226
95
|
return t;
|
|
227
96
|
};
|
|
228
|
-
function
|
|
229
|
-
const
|
|
230
|
-
return
|
|
231
|
-
content:
|
|
97
|
+
function D(s, a, t, n, c, u) {
|
|
98
|
+
const i = E("toolbar-base");
|
|
99
|
+
return x(), v(i, {
|
|
100
|
+
content: n.isBlock() ? "区块设置" : "页面设置",
|
|
232
101
|
icon: t.options.icon.default || t.options.icon,
|
|
233
102
|
options: t.options,
|
|
234
|
-
onClickApi:
|
|
103
|
+
onClickApi: n.openSetting
|
|
235
104
|
}, null, 8, ["content", "icon", "options", "onClickApi"]);
|
|
236
105
|
}
|
|
237
|
-
const
|
|
238
|
-
|
|
239
|
-
|
|
106
|
+
const I = /* @__PURE__ */ T(M, [["render", D]]), L = {
|
|
107
|
+
id: "engine.toolbars.setting",
|
|
108
|
+
title: "setting",
|
|
109
|
+
type: "toolbars",
|
|
110
|
+
options: {
|
|
111
|
+
icon: {
|
|
112
|
+
default: "setting"
|
|
113
|
+
},
|
|
114
|
+
renderType: "icon",
|
|
115
|
+
collapsed: !0
|
|
116
|
+
}
|
|
117
|
+
}, U = {
|
|
118
|
+
...L,
|
|
119
|
+
entry: I
|
|
240
120
|
};
|
|
241
121
|
export {
|
|
242
122
|
U as default
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opentiny/tiny-engine-toolbar-setting",
|
|
3
|
-
"version": "2.5.0-alpha.
|
|
3
|
+
"version": "2.5.0-alpha.2",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -25,12 +25,12 @@
|
|
|
25
25
|
"license": "MIT",
|
|
26
26
|
"homepage": "https://opentiny.design/tiny-engine",
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@opentiny/tiny-engine-common": "2.5.0-alpha.
|
|
29
|
-
"@opentiny/tiny-engine-meta-register": "2.5.0-alpha.
|
|
30
|
-
"@opentiny/tiny-engine-utils": "2.5.0-alpha.
|
|
28
|
+
"@opentiny/tiny-engine-common": "2.5.0-alpha.2",
|
|
29
|
+
"@opentiny/tiny-engine-meta-register": "2.5.0-alpha.2",
|
|
30
|
+
"@opentiny/tiny-engine-utils": "2.5.0-alpha.2"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@opentiny/tiny-engine-vite-plugin-meta-comments": "2.5.0-alpha.
|
|
33
|
+
"@opentiny/tiny-engine-vite-plugin-meta-comments": "2.5.0-alpha.2",
|
|
34
34
|
"@vitejs/plugin-vue": "^5.1.2",
|
|
35
35
|
"@vitejs/plugin-vue-jsx": "^4.0.1",
|
|
36
36
|
"vite": "^5.4.2"
|
|
@@ -39,5 +39,5 @@
|
|
|
39
39
|
"@opentiny/vue": "^3.20.0",
|
|
40
40
|
"vue": "^3.4.15"
|
|
41
41
|
},
|
|
42
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "f5707c379397bffc9a63c50c695f3ee3340ad0c6"
|
|
43
43
|
}
|