@opentiny/tiny-engine-toolbar-setting 2.4.0 → 2.5.0-alpha.1

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.
Files changed (2) hide show
  1. package/dist/index.js +201 -81
  2. package/package.json +6 -6
package/dist/index.js CHANGED
@@ -1,12 +1,23 @@
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 = {
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: C
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: s,
20
- isBlock: a
30
+ pageState: n,
31
+ isBlock: o
21
32
  } = B(), {
22
33
  getCurrentBlock: t
23
- } = P(), {
24
- initCurrentPageData: n,
25
- isChangePageData: c
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
- 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({
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
- }, p = async (e) => {
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: r
43
- } = s;
44
- e.openPageSettingPanel();
45
- const o = await e.getPageById(r.id);
46
- n(o);
47
- }, _ = () => {
48
- var r;
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: 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}锁定,暂时无法编辑,请联系解锁`
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(u.AppManage).then((o) => {
60
- if (c()) {
61
- m({
130
+ s(i.AppManage).then((g) => {
131
+ if (a()) {
132
+ l({
62
133
  title: "提示",
63
134
  message: "当前页面尚未保存,是否要继续切换?",
64
135
  exec: () => {
65
- p(o);
136
+ r(g);
66
137
  }
67
138
  });
68
139
  return;
69
140
  }
70
- p(o);
141
+ r(g);
71
142
  });
72
- };
73
- return {
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
- _();
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
- isBlock: a
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
- }, T = (s, a) => {
92
- const t = s.__vccOpts || s;
93
- for (const [n, c] of a)
94
- t[n] = c;
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 D(s, a, t, n, c, u) {
98
- const i = E("toolbar-base");
99
- return x(), v(i, {
100
- content: n.isBlock() ? "区块设置" : "页面设置",
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: n.openSetting
234
+ onClickApi: e.openSetting
104
235
  }, null, 8, ["content", "icon", "options", "onClickApi"]);
105
236
  }
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
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.4.0",
3
+ "version": "2.5.0-alpha.1",
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.4.0",
29
- "@opentiny/tiny-engine-meta-register": "2.4.0",
30
- "@opentiny/tiny-engine-utils": "2.4.0"
28
+ "@opentiny/tiny-engine-common": "2.5.0-alpha.1",
29
+ "@opentiny/tiny-engine-meta-register": "2.5.0-alpha.1",
30
+ "@opentiny/tiny-engine-utils": "2.5.0-alpha.1"
31
31
  },
32
32
  "devDependencies": {
33
- "@opentiny/tiny-engine-vite-plugin-meta-comments": "2.4.0",
33
+ "@opentiny/tiny-engine-vite-plugin-meta-comments": "2.5.0-alpha.1",
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": "477aa411da11a4f95712e3e5c251d97cae23f4ad"
42
+ "gitHead": "018ca6054f72ee559f0d3ca4dfcbeef4fb411e01"
43
43
  }