@opentiny/tiny-engine-toolbar-setting 1.0.2-beta.0 → 1.0.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.
Files changed (2) hide show
  1. package/dist/index.js +47 -33
  2. package/package.json +19 -9
package/dist/index.js CHANGED
@@ -1,12 +1,12 @@
1
- import { Popover as v } from "@opentiny/vue";
2
- import { useCanvas as S, useBlock as k, usePage as y, useLayout as B, useModal as h } from "@opentiny/tiny-engine-controller";
3
- import { constants as C } from "@opentiny/tiny-engine-utils";
4
- import { resolveComponent as u, openBlock as x, createElementBlock as A, createVNode as d, withCtx as E, createElementVNode as M } from "vue";
1
+ import { Popover as y } from "@opentiny/vue";
2
+ import { useCanvas as S, useBlock as k, usePage as B, useLayout as h, useModal as C, useNotify as x } from "@opentiny/tiny-engine-controller";
3
+ import { constants as A } from "@opentiny/tiny-engine-utils";
4
+ import { resolveComponent as u, openBlock as E, createElementBlock as N, createVNode as d, withCtx as M, createElementVNode as b } from "vue";
5
5
  const {
6
- PAGE_STATUS: N
7
- } = C, b = {
6
+ PAGE_STATUS: w
7
+ } = A, I = {
8
8
  components: {
9
- TinyPopover: v
9
+ TinyPopover: y
10
10
  },
11
11
  props: {
12
12
  icon: {
@@ -17,20 +17,21 @@ const {
17
17
  setup() {
18
18
  const {
19
19
  pageState: a,
20
- isBlock: t
20
+ isBlock: e
21
21
  } = S(), {
22
22
  getCurrentBlock: o
23
23
  } = k(), {
24
- initCurrentPageData: e,
24
+ initCurrentPageData: t,
25
25
  isChangePageData: c
26
- } = y(), {
26
+ } = B(), {
27
27
  PLUGIN_NAME: p,
28
28
  activePlugin: r,
29
- layoutState: g
30
- } = B(), {
31
- confirm: l,
29
+ layoutState: g,
30
+ isEmptyPage: l
31
+ } = h(), {
32
+ confirm: f,
32
33
  message: _
33
- } = h(), f = () => {
34
+ } = C(), P = () => {
34
35
  r(p.BlockManage).then((n) => {
35
36
  n.openSettingPanel({
36
37
  item: o()
@@ -42,13 +43,13 @@ const {
42
43
  } = a;
43
44
  n.openPageSettingPanel();
44
45
  const s = await n.getPageById(i.id);
45
- e(s);
46
- }, P = () => {
46
+ t(s);
47
+ }, v = () => {
47
48
  var i;
48
49
  const {
49
50
  pageStatus: n
50
51
  } = g;
51
- if (n.state === N.Lock) {
52
+ if (n.state === w.Lock) {
52
53
  const s = ((i = n.data) == null ? void 0 : i.username) || "";
53
54
  _({
54
55
  message: `您点击的页面被${s}锁定,暂时无法编辑,请联系解锁`,
@@ -58,7 +59,7 @@ const {
58
59
  }
59
60
  r(p.AppManage).then((s) => {
60
61
  if (c()) {
61
- l({
62
+ f({
62
63
  title: "提示",
63
64
  message: "当前页面尚未保存,是否要继续切换?",
64
65
  exec: () => {
@@ -71,30 +72,43 @@ const {
71
72
  });
72
73
  };
73
74
  return {
74
- openSetting: () => t() ? f() : P(),
75
- isBlock: t
75
+ openSetting: () => {
76
+ if (l()) {
77
+ x({
78
+ type: "warning",
79
+ message: "请先创建页面"
80
+ });
81
+ return;
82
+ }
83
+ if (e()) {
84
+ P();
85
+ return;
86
+ }
87
+ v();
88
+ },
89
+ isBlock: e
76
90
  };
77
91
  }
78
- }, I = (a, t) => {
92
+ }, L = (a, e) => {
79
93
  const o = a.__vccOpts || a;
80
- for (const [e, c] of t)
81
- o[e] = c;
94
+ for (const [t, c] of e)
95
+ o[t] = c;
82
96
  return o;
83
- }, L = { class: "toolbar-itm-clean" };
84
- function T(a, t, o, e, c, p) {
97
+ }, T = { class: "toolbar-itm-clean" };
98
+ function D(a, e, o, t, c, p) {
85
99
  const r = u("svg-icon"), g = u("tiny-popover");
86
- return x(), A("div", L, [
100
+ return E(), N("div", T, [
87
101
  d(g, {
88
102
  trigger: "hover",
89
103
  "open-delay": 1e3,
90
104
  "popper-class": "toolbar-right-popover",
91
105
  "append-to-body": "",
92
- content: e.isBlock() ? "区块设置" : "页面设置"
106
+ content: t.isBlock() ? "区块设置" : "页面设置"
93
107
  }, {
94
- reference: E(() => [
95
- M("span", {
108
+ reference: M(() => [
109
+ b("span", {
96
110
  class: "icon",
97
- onClick: t[0] || (t[0] = (...l) => e.openSetting && e.openSetting(...l))
111
+ onClick: e[0] || (e[0] = (...l) => t.openSetting && t.openSetting(...l))
98
112
  }, [
99
113
  d(r, { name: o.icon }, null, 8, ["name"])
100
114
  ])
@@ -103,13 +117,13 @@ function T(a, t, o, e, c, p) {
103
117
  }, 8, ["content"])
104
118
  ]);
105
119
  }
106
- const w = /* @__PURE__ */ I(b, [["render", T]]), $ = {
120
+ const G = /* @__PURE__ */ L(I, [["render", D]]), q = {
107
121
  id: "setting",
108
122
  title: "setting",
109
123
  icon: "",
110
124
  align: "right",
111
- component: w
125
+ component: G
112
126
  };
113
127
  export {
114
- $ as default
128
+ q as default
115
129
  };
package/package.json CHANGED
@@ -1,27 +1,37 @@
1
1
  {
2
2
  "name": "@opentiny/tiny-engine-toolbar-setting",
3
- "version": "1.0.2-beta.0",
3
+ "version": "1.0.2",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
- "scripts": {
8
- "build": "vite build"
9
- },
10
7
  "main": "dist/index.js",
11
8
  "module": "dist/index.js",
12
9
  "files": [
13
10
  "dist"
14
11
  ],
12
+ "repository": {
13
+ "type": "git",
14
+ "url": "https://github.com/opentiny/tiny-engine",
15
+ "directory": "packages/toolbars/setting"
16
+ },
17
+ "bugs": {
18
+ "url": "https://github.com/opentiny/tiny-engine/issues"
19
+ },
20
+ "author": "OpenTiny Team",
21
+ "license": "MIT",
22
+ "homepage": "https://opentiny.design/tiny-engine",
15
23
  "dependencies": {
16
- "@opentiny/tiny-engine-controller": "^1.0.1-beta.0",
17
- "@opentiny/tiny-engine-utils": "^1.0.2-beta.0",
18
24
  "@opentiny/vue": "~3.10.0",
19
- "vue": "3.2.45"
25
+ "vue": "3.2.45",
26
+ "@opentiny/tiny-engine-controller": "1.0.2",
27
+ "@opentiny/tiny-engine-utils": "1.0.3"
20
28
  },
21
29
  "devDependencies": {
22
30
  "@vitejs/plugin-vue": "^4.2.3",
23
31
  "@vitejs/plugin-vue-jsx": "^1.3.10",
24
32
  "vite": "^4.3.7"
25
33
  },
26
- "gitHead": "93f1b6980dd79fbaa4ec40be658daac8161b53a6"
27
- }
34
+ "scripts": {
35
+ "build": "vite build"
36
+ }
37
+ }