@opentiny/tiny-engine-toolbar-setting 2.4.0 → 2.5.0-alpha.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 +201 -81
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -1,12 +1,23 @@
|
|
|
1
|
-
import { useCanvas as B, useBlock as
|
|
2
|
-
import { constants as
|
|
3
|
-
import { ToolbarBase as
|
|
4
|
-
import { resolveComponent as
|
|
5
|
-
const {
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { useCanvas as B, useBlock as _, usePage as S, useLayout as k, useModal as y, callEntry as v, useNotify as x } from "@opentiny/tiny-engine-meta-register";
|
|
2
|
+
import { constants as E } from "@opentiny/tiny-engine-utils";
|
|
3
|
+
import { ToolbarBase as A } from "@opentiny/tiny-engine-common";
|
|
4
|
+
import { resolveComponent as h, createBlock as I, openBlock as M } from "vue";
|
|
5
|
+
const C = {
|
|
6
|
+
id: "engine.toolbars.setting",
|
|
7
|
+
title: "setting",
|
|
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 = {
|
|
8
19
|
components: {
|
|
9
|
-
ToolbarBase:
|
|
20
|
+
ToolbarBase: A
|
|
10
21
|
},
|
|
11
22
|
props: {
|
|
12
23
|
options: {
|
|
@@ -16,107 +27,216 @@ const {
|
|
|
16
27
|
},
|
|
17
28
|
setup() {
|
|
18
29
|
const {
|
|
19
|
-
pageState:
|
|
20
|
-
isBlock:
|
|
30
|
+
pageState: n,
|
|
31
|
+
isBlock: o
|
|
21
32
|
} = B(), {
|
|
22
33
|
getCurrentBlock: t
|
|
23
|
-
} =
|
|
24
|
-
initCurrentPageData:
|
|
25
|
-
isChangePageData:
|
|
34
|
+
} = _(), {
|
|
35
|
+
initCurrentPageData: e,
|
|
36
|
+
isChangePageData: a
|
|
37
|
+
} = S(), {
|
|
38
|
+
PLUGIN_NAME: i,
|
|
39
|
+
activePlugin: s,
|
|
40
|
+
layoutState: p,
|
|
41
|
+
isEmptyPage: u
|
|
26
42
|
} = k(), {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
confirm: m,
|
|
33
|
-
message: f
|
|
34
|
-
} = S(), d = () => {
|
|
35
|
-
i(u.BlockManage).then((e) => {
|
|
36
|
-
e.openSettingPanel({
|
|
43
|
+
confirm: l,
|
|
44
|
+
message: m
|
|
45
|
+
} = y(), d = v(() => {
|
|
46
|
+
s(i.BlockManage).then((c) => {
|
|
47
|
+
c.openSettingPanel({
|
|
37
48
|
item: t()
|
|
38
49
|
});
|
|
39
50
|
});
|
|
40
|
-
},
|
|
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) => {
|
|
41
82
|
const {
|
|
42
|
-
currentPage:
|
|
43
|
-
} =
|
|
44
|
-
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
},
|
|
48
|
-
|
|
83
|
+
currentPage: D
|
|
84
|
+
} = n;
|
|
85
|
+
c.openPageSettingPanel();
|
|
86
|
+
const g = await c.getPageById(D.id);
|
|
87
|
+
e(g);
|
|
88
|
+
}, {
|
|
89
|
+
metaData: {
|
|
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;
|
|
49
120
|
const {
|
|
50
|
-
pageStatus:
|
|
51
|
-
} =
|
|
52
|
-
if (
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
message: `您点击的页面被${
|
|
121
|
+
pageStatus: c
|
|
122
|
+
} = p;
|
|
123
|
+
if (c.state === b.Lock) {
|
|
124
|
+
const g = ((D = c.data) == null ? void 0 : D.username) || "";
|
|
125
|
+
m({
|
|
126
|
+
message: `您点击的页面被${g}锁定,暂时无法编辑,请联系解锁`
|
|
56
127
|
});
|
|
57
128
|
return;
|
|
58
129
|
}
|
|
59
|
-
i
|
|
60
|
-
if (
|
|
61
|
-
|
|
130
|
+
s(i.AppManage).then((g) => {
|
|
131
|
+
if (a()) {
|
|
132
|
+
l({
|
|
62
133
|
title: "提示",
|
|
63
134
|
message: "当前页面尚未保存,是否要继续切换?",
|
|
64
135
|
exec: () => {
|
|
65
|
-
|
|
136
|
+
r(g);
|
|
66
137
|
}
|
|
67
138
|
});
|
|
68
139
|
return;
|
|
69
140
|
}
|
|
70
|
-
|
|
141
|
+
r(g);
|
|
71
142
|
});
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
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`
|
|
87
189
|
},
|
|
88
|
-
|
|
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
|
+
});
|
|
217
|
+
return {
|
|
218
|
+
openSetting: P,
|
|
219
|
+
isBlock: o
|
|
89
220
|
};
|
|
90
221
|
}
|
|
91
|
-
},
|
|
92
|
-
const t =
|
|
93
|
-
for (const [
|
|
94
|
-
t[
|
|
222
|
+
}, $ = (n, o) => {
|
|
223
|
+
const t = n.__vccOpts || n;
|
|
224
|
+
for (const [e, a] of o)
|
|
225
|
+
t[e] = a;
|
|
95
226
|
return t;
|
|
96
227
|
};
|
|
97
|
-
function
|
|
98
|
-
const
|
|
99
|
-
return
|
|
100
|
-
content:
|
|
228
|
+
function L(n, o, t, e, a, i) {
|
|
229
|
+
const s = h("toolbar-base");
|
|
230
|
+
return M(), I(s, {
|
|
231
|
+
content: e.isBlock() ? "区块设置" : "页面设置",
|
|
101
232
|
icon: t.options.icon.default || t.options.icon,
|
|
102
233
|
options: t.options,
|
|
103
|
-
onClickApi:
|
|
234
|
+
onClickApi: e.openSetting
|
|
104
235
|
}, null, 8, ["content", "icon", "options", "onClickApi"]);
|
|
105
236
|
}
|
|
106
|
-
const
|
|
107
|
-
|
|
108
|
-
|
|
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
|
|
237
|
+
const N = /* @__PURE__ */ $(T, [["render", L]]), U = {
|
|
238
|
+
...C,
|
|
239
|
+
entry: N
|
|
120
240
|
};
|
|
121
241
|
export {
|
|
122
242
|
U as default
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opentiny/tiny-engine-toolbar-setting",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.5.0-alpha.0",
|
|
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.
|
|
29
|
-
"@opentiny/tiny-engine-meta-register": "2.
|
|
30
|
-
"@opentiny/tiny-engine-utils": "2.
|
|
28
|
+
"@opentiny/tiny-engine-common": "2.5.0-alpha.0",
|
|
29
|
+
"@opentiny/tiny-engine-meta-register": "2.5.0-alpha.0",
|
|
30
|
+
"@opentiny/tiny-engine-utils": "2.5.0-alpha.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@opentiny/tiny-engine-vite-plugin-meta-comments": "2.
|
|
33
|
+
"@opentiny/tiny-engine-vite-plugin-meta-comments": "2.5.0-alpha.0",
|
|
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": "ae59c82734d79f650c9221cb9702714814b099c8"
|
|
43
43
|
}
|