@opentiny/tiny-engine-toolbar-setting 2.0.0-alpha.2 → 2.0.0-alpha.4
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 +77 -88
- package/package.json +10 -8
package/dist/index.js
CHANGED
|
@@ -1,135 +1,124 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useCanvas as k, useBlock as B, usePage as h, useLayout as C, useModal as b, useNotify as x } from "@opentiny/tiny-engine-meta-register";
|
|
1
|
+
import { useCanvas as P, useBlock as k, usePage as y, useLayout as S, useModal as B, useNotify as b } from "@opentiny/tiny-engine-meta-register";
|
|
3
2
|
import { constants as A } from "@opentiny/tiny-engine-utils";
|
|
4
|
-
import {
|
|
3
|
+
import { ToolbarBase as C } from "@opentiny/tiny-engine-common";
|
|
4
|
+
import { resolveComponent as v, openBlock as x, createBlock as h } from "vue";
|
|
5
5
|
const {
|
|
6
|
-
PAGE_STATUS:
|
|
7
|
-
} = A,
|
|
6
|
+
PAGE_STATUS: M
|
|
7
|
+
} = A, T = {
|
|
8
8
|
components: {
|
|
9
|
-
|
|
9
|
+
ToolbarBase: C
|
|
10
10
|
},
|
|
11
11
|
props: {
|
|
12
|
-
|
|
13
|
-
type:
|
|
14
|
-
default:
|
|
12
|
+
options: {
|
|
13
|
+
type: Object,
|
|
14
|
+
default: () => ({})
|
|
15
15
|
}
|
|
16
16
|
},
|
|
17
17
|
setup() {
|
|
18
18
|
const {
|
|
19
|
-
pageState:
|
|
20
|
-
isBlock:
|
|
19
|
+
pageState: s,
|
|
20
|
+
isBlock: a
|
|
21
|
+
} = P(), {
|
|
22
|
+
getCurrentBlock: t
|
|
21
23
|
} = k(), {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
isChangePageData: r
|
|
26
|
-
} = h(), {
|
|
24
|
+
initCurrentPageData: n,
|
|
25
|
+
isChangePageData: c
|
|
26
|
+
} = y(), {
|
|
27
27
|
PLUGIN_NAME: p,
|
|
28
|
-
activePlugin:
|
|
29
|
-
layoutState:
|
|
30
|
-
isEmptyPage:
|
|
31
|
-
} =
|
|
32
|
-
confirm:
|
|
33
|
-
message:
|
|
34
|
-
} =
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
item:
|
|
28
|
+
activePlugin: i,
|
|
29
|
+
layoutState: l,
|
|
30
|
+
isEmptyPage: u
|
|
31
|
+
} = S(), {
|
|
32
|
+
confirm: m,
|
|
33
|
+
message: f
|
|
34
|
+
} = B(), d = () => {
|
|
35
|
+
i(p.BlockManage).then((e) => {
|
|
36
|
+
e.openSettingPanel({
|
|
37
|
+
item: t()
|
|
38
38
|
});
|
|
39
39
|
});
|
|
40
|
-
},
|
|
40
|
+
}, g = async (e) => {
|
|
41
41
|
const {
|
|
42
|
-
currentPage:
|
|
43
|
-
} =
|
|
44
|
-
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
},
|
|
48
|
-
var
|
|
42
|
+
currentPage: r
|
|
43
|
+
} = s;
|
|
44
|
+
e.openPageSettingPanel();
|
|
45
|
+
const o = await e.getPageById(r.id);
|
|
46
|
+
n(o);
|
|
47
|
+
}, _ = () => {
|
|
48
|
+
var r;
|
|
49
49
|
const {
|
|
50
|
-
pageStatus:
|
|
51
|
-
} =
|
|
52
|
-
if (
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
message: `您点击的页面被${
|
|
50
|
+
pageStatus: e
|
|
51
|
+
} = l;
|
|
52
|
+
if (e.state === M.Lock) {
|
|
53
|
+
const o = ((r = e.data) == null ? void 0 : r.username) || "";
|
|
54
|
+
f({
|
|
55
|
+
message: `您点击的页面被${o}锁定,暂时无法编辑,请联系解锁`,
|
|
56
56
|
status: "info"
|
|
57
57
|
});
|
|
58
58
|
return;
|
|
59
59
|
}
|
|
60
|
-
|
|
61
|
-
if (
|
|
62
|
-
|
|
60
|
+
i(p.AppManage).then((o) => {
|
|
61
|
+
if (c()) {
|
|
62
|
+
m({
|
|
63
63
|
title: "提示",
|
|
64
64
|
message: "当前页面尚未保存,是否要继续切换?",
|
|
65
65
|
exec: () => {
|
|
66
|
-
|
|
66
|
+
g(o);
|
|
67
67
|
}
|
|
68
68
|
});
|
|
69
69
|
return;
|
|
70
70
|
}
|
|
71
|
-
|
|
71
|
+
g(o);
|
|
72
72
|
});
|
|
73
73
|
};
|
|
74
74
|
return {
|
|
75
75
|
openSetting: () => {
|
|
76
|
-
if (
|
|
77
|
-
|
|
76
|
+
if (u()) {
|
|
77
|
+
b({
|
|
78
78
|
type: "warning",
|
|
79
79
|
message: "请先创建页面"
|
|
80
80
|
});
|
|
81
81
|
return;
|
|
82
82
|
}
|
|
83
|
-
if (
|
|
84
|
-
|
|
83
|
+
if (a()) {
|
|
84
|
+
d();
|
|
85
85
|
return;
|
|
86
86
|
}
|
|
87
|
-
|
|
87
|
+
_();
|
|
88
88
|
},
|
|
89
|
-
isBlock:
|
|
89
|
+
isBlock: a
|
|
90
90
|
};
|
|
91
91
|
}
|
|
92
|
-
},
|
|
93
|
-
const
|
|
94
|
-
for (const [
|
|
95
|
-
|
|
96
|
-
return
|
|
97
|
-
}
|
|
98
|
-
function
|
|
99
|
-
const
|
|
100
|
-
return
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
content: t.isBlock() ? "区块设置" : "页面设置",
|
|
107
|
-
disabled: !0
|
|
108
|
-
}, {
|
|
109
|
-
reference: D(() => [
|
|
110
|
-
f("span", {
|
|
111
|
-
class: "icon-hides",
|
|
112
|
-
onClick: e[0] || (e[0] = (...l) => t.openSetting && t.openSetting(...l))
|
|
113
|
-
}, [
|
|
114
|
-
d(c, { name: o.icon }, null, 8, ["name"])
|
|
115
|
-
]),
|
|
116
|
-
f("span", null, M(t.isBlock() ? "区块设置" : "页面设置"), 1)
|
|
117
|
-
]),
|
|
118
|
-
_: 1
|
|
119
|
-
}, 8, ["content"])
|
|
120
|
-
]);
|
|
92
|
+
}, D = (s, a) => {
|
|
93
|
+
const t = s.__vccOpts || s;
|
|
94
|
+
for (const [n, c] of a)
|
|
95
|
+
t[n] = c;
|
|
96
|
+
return t;
|
|
97
|
+
};
|
|
98
|
+
function E(s, a, t, n, c, p) {
|
|
99
|
+
const i = v("toolbar-base");
|
|
100
|
+
return x(), h(i, {
|
|
101
|
+
content: n.isBlock() ? "区块设置" : "页面设置",
|
|
102
|
+
icon: t.options.icon.default || t.options.icon,
|
|
103
|
+
options: t.options,
|
|
104
|
+
onClickApi: n.openSetting
|
|
105
|
+
}, null, 8, ["content", "icon", "options", "onClickApi"]);
|
|
121
106
|
}
|
|
122
|
-
const
|
|
107
|
+
const I = /* @__PURE__ */ D(T, [["render", E]]), L = {
|
|
123
108
|
id: "engine.toolbars.setting",
|
|
124
109
|
title: "setting",
|
|
125
110
|
type: "toolbars",
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
},
|
|
130
|
-
|
|
131
|
-
|
|
111
|
+
options: {
|
|
112
|
+
icon: {
|
|
113
|
+
default: "setting"
|
|
114
|
+
},
|
|
115
|
+
renderType: "icon",
|
|
116
|
+
collapsed: !0
|
|
117
|
+
}
|
|
118
|
+
}, j = {
|
|
119
|
+
...L,
|
|
120
|
+
entry: I
|
|
132
121
|
};
|
|
133
122
|
export {
|
|
134
|
-
|
|
123
|
+
j as default
|
|
135
124
|
};
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opentiny/tiny-engine-toolbar-setting",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.4",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
7
|
"scripts": {
|
|
8
8
|
"build": "vite build"
|
|
9
9
|
},
|
|
10
|
+
"type": "module",
|
|
10
11
|
"main": "dist/index.js",
|
|
11
12
|
"module": "dist/index.js",
|
|
12
13
|
"files": [
|
|
@@ -24,18 +25,19 @@
|
|
|
24
25
|
"license": "MIT",
|
|
25
26
|
"homepage": "https://opentiny.design/tiny-engine",
|
|
26
27
|
"dependencies": {
|
|
27
|
-
"@opentiny/tiny-engine-
|
|
28
|
-
"@opentiny/tiny-engine-
|
|
28
|
+
"@opentiny/tiny-engine-common": "2.0.0-alpha.4",
|
|
29
|
+
"@opentiny/tiny-engine-meta-register": "2.0.0-alpha.4",
|
|
30
|
+
"@opentiny/tiny-engine-utils": "2.0.0-alpha.4"
|
|
29
31
|
},
|
|
30
32
|
"devDependencies": {
|
|
31
|
-
"@opentiny/tiny-engine-vite-plugin-meta-comments": "2.0.0-alpha.
|
|
32
|
-
"@vitejs/plugin-vue": "^
|
|
33
|
-
"@vitejs/plugin-vue-jsx": "^
|
|
34
|
-
"vite": "^4.
|
|
33
|
+
"@opentiny/tiny-engine-vite-plugin-meta-comments": "2.0.0-alpha.4",
|
|
34
|
+
"@vitejs/plugin-vue": "^5.1.2",
|
|
35
|
+
"@vitejs/plugin-vue-jsx": "^4.0.1",
|
|
36
|
+
"vite": "^5.4.2"
|
|
35
37
|
},
|
|
36
38
|
"peerDependencies": {
|
|
37
39
|
"@opentiny/vue": "^3.14.0",
|
|
38
40
|
"vue": "^3.4.15"
|
|
39
41
|
},
|
|
40
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "14f9f41f9fa6a1b4962d0fcd3083798d842e8ff9"
|
|
41
43
|
}
|