@opentiny/tiny-engine-toolbar-collaboration 2.0.0-alpha.2 → 2.0.0-alpha.3

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 CHANGED
@@ -1,118 +1,136 @@
1
1
  import "./style.css";
2
- import { reactive as V, watchEffect as h, resolveComponent as _, openBlock as a, createElementBlock as n, createVNode as m, withCtx as c, createElementVNode as o, createBlock as k, createCommentVNode as N, Fragment as g, renderList as v, toDisplayString as d } from "vue";
2
+ import { reactive as N, watchEffect as L, resolveComponent as p, openBlock as n, createBlock as m, withCtx as i, createElementVNode as t, createVNode as g, createCommentVNode as b, createElementBlock as l, Fragment as f, renderList as v, toDisplayString as u } from "vue";
3
3
  import { Popover as x } from "@opentiny/vue";
4
- import { useLayout as L } from "@opentiny/tiny-engine-meta-register";
5
- const S = (r, e) => {
6
- const l = r.__vccOpts || r;
7
- for (const [t, p] of e)
8
- l[t] = p;
9
- return l;
10
- }, w = {
4
+ import { useLayout as S } from "@opentiny/tiny-engine-meta-register";
5
+ import { ToolbarBase as w } from "@opentiny/tiny-engine-common";
6
+ const B = (r, o) => {
7
+ const s = r.__vccOpts || r;
8
+ for (const [e, d] of o)
9
+ s[e] = d;
10
+ return s;
11
+ }, C = {
11
12
  components: {
12
- TinyPopover: x
13
+ TinyPopover: x,
14
+ ToolbarBase: w
15
+ },
16
+ props: {
17
+ options: {
18
+ type: Object,
19
+ default: () => ({})
20
+ }
13
21
  },
14
22
  setup() {
15
- const { layoutState: r } = L(), e = V({
23
+ const { layoutState: r } = S(), o = N({
16
24
  outsideVisible: !1,
17
25
  insideVisible: !1,
18
26
  url: "",
19
27
  userLists: []
20
28
  });
21
- return h(() => {
22
- var t;
23
- e.url = "img/defaultAvator.png", e.userLists = [
29
+ return L(() => {
30
+ var e;
31
+ o.url = "img/defaultAvator.png", o.userLists = [
24
32
  {
25
33
  pageName: "当前页",
26
34
  users: [
27
35
  {
28
36
  userHead: "img/defaultAvator.png",
29
- userName: (t = r.pageStatus.data) == null ? void 0 : t.username,
37
+ userName: (e = r.pageStatus.data) == null ? void 0 : e.username,
30
38
  status: "编辑"
31
39
  }
32
40
  ]
33
41
  }
34
42
  ];
35
43
  }), {
36
- state: e,
44
+ state: o,
37
45
  isSingle: () => !0
38
46
  };
39
47
  }
40
- }, B = { class: "collaboration-container" }, C = { class: "collaborators-list" }, E = { class: "page-name" }, A = ["src"], D = { class: "user-item-name" }, H = { class: "user-item-status" }, P = { class: "icon collaboration-wrap" }, U = { class: "icon-hides" };
41
- function F(r, e, l, t, p, T) {
42
- const b = _("svg-icon"), u = _("tiny-popover");
43
- return a(), n("div", B, [
44
- m(u, {
45
- modelValue: t.state.outsideVisible,
46
- "onUpdate:modelValue": e[1] || (e[1] = (s) => t.state.outsideVisible = s),
47
- trigger: "click",
48
- width: "260",
49
- "append-to-body": "",
50
- "popper-class": "toolbar-right-popover collaborator"
51
- }, {
52
- reference: c(() => [
53
- m(u, {
54
- modelValue: t.state.insideVisible,
55
- "onUpdate:modelValue": e[0] || (e[0] = (s) => t.state.insideVisible = s),
56
- class: "toolbar-right-user",
57
- trigger: "hover",
58
- "open-delay": 1e3,
59
- "popper-class": "collaboration-popover toolbar-right-popover",
48
+ }, E = { class: "collaboration-container" }, T = { class: "collaborators-list" }, A = { class: "page-name" }, D = ["src"], H = { class: "user-item-name" }, O = { class: "user-item-status" }, P = { class: "icon collaboration-wrap" }, j = { class: "icon-hides" }, F = { key: 0 };
49
+ function U(r, o, s, e, d, G) {
50
+ const h = p("svg-icon"), _ = p("tiny-popover"), y = p("toolbar-base");
51
+ return n(), m(y, { options: s.options }, {
52
+ default: i(() => [
53
+ t("span", E, [
54
+ g(_, {
55
+ modelValue: e.state.outsideVisible,
56
+ "onUpdate:modelValue": o[0] || (o[0] = (a) => e.state.outsideVisible = a),
57
+ trigger: "click",
58
+ width: "260",
60
59
  "append-to-body": "",
61
- content: `该项目共有 ${t.state.userLists.length} 位用户在编辑`
60
+ "popper-class": "toolbar-right-popover collaborator"
62
61
  }, {
63
- reference: c(() => [
64
- o("div", P, [
65
- o("span", U, [
66
- t.state.url ? (a(), k(b, {
67
- key: 0,
68
- name: "user"
69
- })) : N("", !0)
70
- ]),
71
- e[2] || (e[2] = o("span", { class: "operate-title" }, "多人协作", -1))
72
- ])
62
+ reference: i(() => [
63
+ g(_, {
64
+ class: "toolbar-right-user",
65
+ trigger: "hover",
66
+ "open-delay": 1e3,
67
+ "popper-class": "collaboration-popover toolbar-right-popover",
68
+ "append-to-body": "",
69
+ content: `该项目共有 ${e.state.userLists.length} 位用户在编辑`
70
+ }, {
71
+ reference: i(() => {
72
+ var a;
73
+ return [
74
+ t("span", P, [
75
+ t("span", j, [
76
+ e.state.url ? (n(), m(h, {
77
+ key: 0,
78
+ name: s.options.icon.default || s.options.icon
79
+ }, null, 8, ["name"])) : b("", !0)
80
+ ]),
81
+ (a = s.options) != null && a.collapsed ? (n(), l("span", F, "多人协作")) : b("", !0)
82
+ ])
83
+ ];
84
+ }),
85
+ _: 1
86
+ }, 8, ["content"])
73
87
  ]),
74
- _: 1
75
- }, 8, ["modelValue", "content"])
76
- ]),
77
- default: c(() => [
78
- o("div", C, [
79
- (a(!0), n(g, null, v(t.state.userLists, (s, f) => (a(), n("div", {
80
- key: f,
81
- class: "collaborators-list-group"
82
- }, [
83
- o("span", E, d(s.pageName), 1),
84
- o("ul", null, [
85
- (a(!0), n(g, null, v(s.users, (i, y) => (a(), n("li", {
86
- key: y,
87
- class: "user-item"
88
+ default: i(() => [
89
+ t("div", T, [
90
+ (n(!0), l(f, null, v(e.state.userLists, (a, V) => (n(), l("div", {
91
+ key: V,
92
+ class: "collaborators-list-group"
88
93
  }, [
89
- o("img", {
90
- class: "user-item-head",
91
- src: i.userHead,
92
- alt: ""
93
- }, null, 8, A),
94
- o("span", D, d(i.userName), 1),
95
- o("span", H, "正在" + d(i.status), 1)
94
+ t("span", A, u(a.pageName), 1),
95
+ t("ul", null, [
96
+ (n(!0), l(f, null, v(a.users, (c, k) => (n(), l("li", {
97
+ key: k,
98
+ class: "user-item"
99
+ }, [
100
+ t("img", {
101
+ class: "user-item-head",
102
+ src: c.userHead,
103
+ alt: ""
104
+ }, null, 8, D),
105
+ t("span", H, u(c.userName), 1),
106
+ t("span", O, "正在" + u(c.status), 1)
107
+ ]))), 128))
108
+ ])
96
109
  ]))), 128))
97
110
  ])
98
- ]))), 128))
99
- ])
100
- ]),
101
- _: 1
102
- }, 8, ["modelValue"])
103
- ]);
111
+ ]),
112
+ _: 1
113
+ }, 8, ["modelValue"])
114
+ ])
115
+ ]),
116
+ _: 1
117
+ }, 8, ["options"]);
104
118
  }
105
- const M = /* @__PURE__ */ S(w, [["render", F], ["__scopeId", "data-v-20a96d06"]]), O = {
119
+ const q = /* @__PURE__ */ B(C, [["render", U], ["__scopeId", "data-v-0cc95123"]]), z = {
106
120
  id: "engine.toolbars.collaboration",
107
121
  type: "toolbars",
108
122
  title: "collaboration",
109
- icon: "",
110
- align: "right",
111
- collapsed: !0
112
- }, J = {
113
- ...O,
114
- entry: M
123
+ options: {
124
+ icon: {
125
+ default: "user"
126
+ },
127
+ renderType: "slot",
128
+ collapsed: !0
129
+ }
130
+ }, W = {
131
+ ...z,
132
+ entry: q
115
133
  };
116
134
  export {
117
- J as default
135
+ W as default
118
136
  };
package/dist/style.css CHANGED
@@ -1 +1 @@
1
- .collaboration-container[data-v-20a96d06] .reference-wrapper{display:flex}.toolbar-right-user[data-v-20a96d06] .reference-wrapper{padding:0!important}.collaborators-list .page-name[data-v-20a96d06]{display:inline-block;width:100%;font-size:14px;padding:12px 20px;color:var(--ti-lowcode-toolbar-breadcrumb-color);line-height:18px;font-weight:600}.collaborators-list .user-item[data-v-20a96d06]{padding:10px 16px;display:flex;align-items:center}.collaborators-list .user-item[data-v-20a96d06]:hover{background:var(--ti-lowcode-toolbar-hover-color)}.collaborators-list .user-item .user-item-head[data-v-20a96d06]{width:26px;height:26px;border-radius:50%}.collaborators-list .user-item .user-item-name[data-v-20a96d06]{font-size:14px;color:var(--ti-lowcode-dialog-font-color);line-height:16px;font-weight:400;margin:0 4px 0 8px}.collaborators-list .user-item .user-item-status[data-v-20a96d06]{font-size:14px}.collaboration-wrap[data-v-20a96d06]{display:flex;align-items:center;cursor:pointer;font-size:12px}.collaboration-wrap .user-head[data-v-20a96d06]{width:16px;height:16px;border-radius:50%;margin-right:8px;z-index:9;border:1px solid var(--ti-lowcode-toolbar-user-img-border-color)}.collaboration-wrap .user-count[data-v-20a96d06]{height:20px;width:20px;color:var(--ti-lowcode-toolbar-icon-color);background-color:var(--ti-lowcode-user-header-bg);border-radius:50%;display:flex;align-items:center;justify-content:center}
1
+ .collaboration-container[data-v-0cc95123] .reference-wrapper{display:flex}.toolbar-right-user[data-v-0cc95123] .reference-wrapper{padding:0!important}.collaborators-list .page-name[data-v-0cc95123]{display:inline-block;width:100%;font-size:14px;padding:12px 20px;color:var(--ti-lowcode-toolbar-breadcrumb-color);line-height:18px;font-weight:600}.collaborators-list .user-item[data-v-0cc95123]{padding:10px 16px;display:flex;align-items:center}.collaborators-list .user-item[data-v-0cc95123]:hover{background:var(--ti-lowcode-toolbar-hover-color)}.collaborators-list .user-item .user-item-head[data-v-0cc95123]{width:26px;height:26px;border-radius:50%}.collaborators-list .user-item .user-item-name[data-v-0cc95123]{font-size:14px;color:var(--ti-lowcode-dialog-font-color);line-height:16px;font-weight:400;margin:0 4px 0 8px}.collaborators-list .user-item .user-item-status[data-v-0cc95123]{font-size:14px}.collaboration-wrap[data-v-0cc95123]{display:flex;align-items:center;cursor:pointer;font-size:12px}.collaboration-wrap .user-head[data-v-0cc95123]{width:16px;height:16px;border-radius:50%;margin-right:8px;z-index:9;border:1px solid var(--ti-lowcode-toolbar-user-img-border-color)}.collaboration-wrap .user-count[data-v-0cc95123]{height:20px;width:20px;color:var(--ti-lowcode-toolbar-icon-color);background-color:var(--ti-lowcode-user-header-bg);border-radius:50%;display:flex;align-items:center;justify-content:center}
package/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "@opentiny/tiny-engine-toolbar-collaboration",
3
- "version": "2.0.0-alpha.2",
3
+ "version": "2.0.0-alpha.3",
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,17 +25,18 @@
24
25
  "license": "MIT",
25
26
  "homepage": "https://opentiny.design/tiny-engine",
26
27
  "dependencies": {
27
- "@opentiny/tiny-engine-meta-register": "2.0.0-alpha.2"
28
+ "@opentiny/tiny-engine-common": "2.0.0-alpha.3",
29
+ "@opentiny/tiny-engine-meta-register": "2.0.0-alpha.3"
28
30
  },
29
31
  "devDependencies": {
30
- "@opentiny/tiny-engine-vite-plugin-meta-comments": "2.0.0-alpha.2",
31
- "@vitejs/plugin-vue": "^4.2.3",
32
- "@vitejs/plugin-vue-jsx": "^3.1.0",
33
- "vite": "^4.3.7"
32
+ "@opentiny/tiny-engine-vite-plugin-meta-comments": "2.0.0-alpha.3",
33
+ "@vitejs/plugin-vue": "^5.1.2",
34
+ "@vitejs/plugin-vue-jsx": "^4.0.1",
35
+ "vite": "^5.4.2"
34
36
  },
35
37
  "peerDependencies": {
36
38
  "@opentiny/vue": "^3.14.0",
37
39
  "vue": "^3.4.15"
38
40
  },
39
- "gitHead": "695ecd00f21aa39965a9ddb02590ae274f92cd8e"
41
+ "gitHead": "20aba1ffa81a1633feec954e3146586193c18f22"
40
42
  }