@opentiny/tiny-engine-toolbar-lang 1.0.4 → 2.0.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 +80 -66
- package/dist/style.css +1 -1
- package/package.json +6 -5
package/dist/index.js
CHANGED
|
@@ -1,67 +1,67 @@
|
|
|
1
1
|
import "./style.css";
|
|
2
|
-
import { getCurrentScope as
|
|
2
|
+
import { getCurrentScope as I, onScopeDispose as b, getCurrentInstance as w, onMounted as N, nextTick as E, ref as r, watch as S, resolveComponent as v, openBlock as P, createBlock as L, withCtx as x, createElementVNode as p, createVNode as B } from "vue";
|
|
3
3
|
import { Popover as T } from "@opentiny/vue";
|
|
4
4
|
import { constants as Q } from "@opentiny/tiny-engine-utils";
|
|
5
|
-
var
|
|
6
|
-
const
|
|
7
|
-
|
|
5
|
+
var _;
|
|
6
|
+
const h = typeof window < "u";
|
|
7
|
+
h && ((_ = window == null ? void 0 : window.navigator) != null && _.userAgent) && /iP(ad|hone|od)/.test(window.navigator.userAgent);
|
|
8
8
|
function k(e) {
|
|
9
9
|
return e;
|
|
10
10
|
}
|
|
11
|
-
function
|
|
12
|
-
return
|
|
11
|
+
function M(e) {
|
|
12
|
+
return I() ? (b(e), !0) : !1;
|
|
13
13
|
}
|
|
14
|
-
function
|
|
15
|
-
|
|
14
|
+
function C(e, n = !0) {
|
|
15
|
+
w() ? N(e) : n ? e() : E(e);
|
|
16
16
|
}
|
|
17
|
-
const
|
|
18
|
-
function
|
|
17
|
+
const A = h ? window : void 0;
|
|
18
|
+
function V(e, n = !1) {
|
|
19
19
|
const t = r(), a = () => t.value = !!e();
|
|
20
|
-
return a(),
|
|
20
|
+
return a(), C(a, n), t;
|
|
21
21
|
}
|
|
22
|
-
const
|
|
22
|
+
const U = (e) => {
|
|
23
23
|
const {
|
|
24
24
|
name: n,
|
|
25
|
-
window: t =
|
|
26
|
-
} = e, a =
|
|
27
|
-
|
|
28
|
-
},
|
|
29
|
-
|
|
25
|
+
window: t = A
|
|
26
|
+
} = e, a = V(() => t && "BroadcastChannel" in t), s = r(!1), o = r(), l = r(), u = r(null), c = (i) => {
|
|
27
|
+
o.value && o.value.postMessage(i);
|
|
28
|
+
}, d = () => {
|
|
29
|
+
o.value && o.value.close(), s.value = !0;
|
|
30
30
|
};
|
|
31
|
-
return a.value &&
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}, { passive: !0 }),
|
|
35
|
-
|
|
36
|
-
}, { passive: !0 }),
|
|
37
|
-
|
|
31
|
+
return a.value && C(() => {
|
|
32
|
+
u.value = null, o.value = new BroadcastChannel(n), o.value.addEventListener("message", (i) => {
|
|
33
|
+
l.value = i.data;
|
|
34
|
+
}, { passive: !0 }), o.value.addEventListener("messageerror", (i) => {
|
|
35
|
+
u.value = i;
|
|
36
|
+
}, { passive: !0 }), o.value.addEventListener("close", () => {
|
|
37
|
+
s.value = !0;
|
|
38
38
|
});
|
|
39
|
-
}),
|
|
40
|
-
|
|
39
|
+
}), M(() => {
|
|
40
|
+
d();
|
|
41
41
|
}), {
|
|
42
42
|
isSupported: a,
|
|
43
|
-
channel:
|
|
44
|
-
data:
|
|
45
|
-
post:
|
|
46
|
-
close:
|
|
47
|
-
error:
|
|
48
|
-
isClosed:
|
|
43
|
+
channel: o,
|
|
44
|
+
data: l,
|
|
45
|
+
post: c,
|
|
46
|
+
close: d,
|
|
47
|
+
error: u,
|
|
48
|
+
isClosed: s
|
|
49
49
|
};
|
|
50
|
-
},
|
|
51
|
-
|
|
52
|
-
var
|
|
50
|
+
}, g = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, f = "__vueuse_ssr_handlers__";
|
|
51
|
+
g[f] = g[f] || {};
|
|
52
|
+
var O;
|
|
53
53
|
(function(e) {
|
|
54
54
|
e.UP = "UP", e.RIGHT = "RIGHT", e.DOWN = "DOWN", e.LEFT = "LEFT", e.NONE = "NONE";
|
|
55
|
-
})(
|
|
56
|
-
var
|
|
55
|
+
})(O || (O = {}));
|
|
56
|
+
var z = Object.defineProperty, m = Object.getOwnPropertySymbols, D = Object.prototype.hasOwnProperty, H = Object.prototype.propertyIsEnumerable, y = (e, n, t) => n in e ? z(e, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[n] = t, R = (e, n) => {
|
|
57
57
|
for (var t in n || (n = {}))
|
|
58
|
-
|
|
59
|
-
if (
|
|
60
|
-
for (var t of
|
|
61
|
-
|
|
58
|
+
D.call(n, t) && y(e, t, n[t]);
|
|
59
|
+
if (m)
|
|
60
|
+
for (var t of m(n))
|
|
61
|
+
H.call(n, t) && y(e, t, n[t]);
|
|
62
62
|
return e;
|
|
63
63
|
};
|
|
64
|
-
const
|
|
64
|
+
const W = {
|
|
65
65
|
easeInSine: [0.12, 0, 0.39, 0],
|
|
66
66
|
easeOutSine: [0.61, 1, 0.88, 1],
|
|
67
67
|
easeInOutSine: [0.37, 0, 0.63, 1],
|
|
@@ -87,13 +87,13 @@ const z = {
|
|
|
87
87
|
easeOutBack: [0.34, 1.56, 0.64, 1],
|
|
88
88
|
easeInOutBack: [0.68, -0.6, 0.32, 1.6]
|
|
89
89
|
};
|
|
90
|
-
|
|
90
|
+
R({
|
|
91
91
|
linear: k
|
|
92
|
-
},
|
|
93
|
-
const
|
|
92
|
+
}, W);
|
|
93
|
+
const j = (e, n) => {
|
|
94
94
|
const t = e.__vccOpts || e;
|
|
95
|
-
for (const [a,
|
|
96
|
-
t[a] =
|
|
95
|
+
for (const [a, s] of n)
|
|
96
|
+
t[a] = s;
|
|
97
97
|
return t;
|
|
98
98
|
}, { BROADCAST_CHANNEL: F } = Q, G = {
|
|
99
99
|
components: {
|
|
@@ -106,11 +106,14 @@ const D = (e, n) => {
|
|
|
106
106
|
}
|
|
107
107
|
},
|
|
108
108
|
setup(e) {
|
|
109
|
-
const n = r("zh_CN"), { post: t, data: a } =
|
|
110
|
-
|
|
109
|
+
const n = r("zh_CN"), { post: t, data: a } = U({ name: e.langChannel });
|
|
110
|
+
S(a, () => {
|
|
111
111
|
n.value = a.value;
|
|
112
112
|
});
|
|
113
|
-
const
|
|
113
|
+
const s = {
|
|
114
|
+
zh_CN: "cn",
|
|
115
|
+
en_US: "en"
|
|
116
|
+
}, o = [
|
|
114
117
|
{
|
|
115
118
|
value: "zh_CN",
|
|
116
119
|
label: "中文"
|
|
@@ -125,37 +128,48 @@ const D = (e, n) => {
|
|
|
125
128
|
langVal: n,
|
|
126
129
|
changeLang: () => {
|
|
127
130
|
n.value = n.value === o[0].value ? o[1].value : o[0].value, t(n.value);
|
|
128
|
-
}
|
|
131
|
+
},
|
|
132
|
+
langSvgIconNameMap: s
|
|
129
133
|
};
|
|
130
134
|
}
|
|
131
|
-
}, K = { class: "icon" };
|
|
132
|
-
function
|
|
133
|
-
const
|
|
134
|
-
return P(),
|
|
135
|
+
}, K = { class: "icon-hides" };
|
|
136
|
+
function q(e, n, t, a, s, o) {
|
|
137
|
+
const l = v("svg-icon"), u = v("tiny-popover");
|
|
138
|
+
return P(), L(u, {
|
|
135
139
|
trigger: "hover",
|
|
136
140
|
"open-delay": 1e3,
|
|
137
141
|
"popper-class": "toolbar-right-popover",
|
|
138
142
|
"append-to-body": "",
|
|
139
|
-
content: "画布中英文切换"
|
|
143
|
+
content: "画布中英文切换",
|
|
144
|
+
disabled: !0
|
|
140
145
|
}, {
|
|
141
146
|
reference: x(() => [
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
+
p("div", {
|
|
148
|
+
onClick: n[0] || (n[0] = (...c) => a.changeLang && a.changeLang(...c))
|
|
149
|
+
}, [
|
|
150
|
+
p("span", K, [
|
|
151
|
+
B(l, {
|
|
152
|
+
name: a.langSvgIconNameMap[a.langVal]
|
|
153
|
+
}, null, 8, ["name"])
|
|
154
|
+
]),
|
|
155
|
+
n[1] || (n[1] = p("span", { class: "operate-title" }, "中英文切换", -1))
|
|
147
156
|
])
|
|
148
157
|
]),
|
|
149
158
|
_: 1
|
|
150
159
|
});
|
|
151
160
|
}
|
|
152
|
-
const
|
|
153
|
-
id: "lang",
|
|
161
|
+
const J = /* @__PURE__ */ j(G, [["render", q], ["__scopeId", "data-v-29565dbb"]]), X = {
|
|
162
|
+
id: "engine.toolbars.lang",
|
|
163
|
+
type: "toolbars",
|
|
154
164
|
title: "lang",
|
|
155
|
-
icon: "",
|
|
156
165
|
align: "right",
|
|
157
|
-
|
|
166
|
+
icon: "",
|
|
167
|
+
collapsed: !0,
|
|
168
|
+
splitLine: !0
|
|
169
|
+
}, ne = {
|
|
170
|
+
...X,
|
|
171
|
+
entry: J
|
|
158
172
|
};
|
|
159
173
|
export {
|
|
160
|
-
|
|
174
|
+
ne as default
|
|
161
175
|
};
|
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.change-lang-box svg[data-v-
|
|
1
|
+
.change-lang-box svg[data-v-29565dbb]{color:var(--ti-lowcode-toolbar-title-color);width:18px;height:18px}.change-lang-box svg[data-v-29565dbb]:hover{opacity:.75}.icon[data-v-29565dbb]{color:var(--ti-lowcode-toolbar-title-color)}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opentiny/tiny-engine-toolbar-lang",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0-alpha.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -24,17 +24,18 @@
|
|
|
24
24
|
"license": "MIT",
|
|
25
25
|
"homepage": "https://opentiny.design/tiny-engine",
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@opentiny/tiny-engine-utils": "
|
|
28
|
-
"@opentiny/vue": "~3.10.0",
|
|
27
|
+
"@opentiny/tiny-engine-utils": "2.0.0-alpha.0",
|
|
29
28
|
"@vueuse/core": "^9.6.0"
|
|
30
29
|
},
|
|
31
30
|
"devDependencies": {
|
|
31
|
+
"@opentiny/tiny-engine-vite-plugin-meta-comments": "2.0.0-alpha.0",
|
|
32
32
|
"@vitejs/plugin-vue": "^4.2.3",
|
|
33
|
-
"@vitejs/plugin-vue-jsx": "^1.
|
|
33
|
+
"@vitejs/plugin-vue-jsx": "^3.1.0",
|
|
34
34
|
"vite": "^4.3.7"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
|
+
"@opentiny/vue": "^3.14.0",
|
|
37
38
|
"vue": "^3.4.15"
|
|
38
39
|
},
|
|
39
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "facaf97a64b792f5c78d4da76b703b2a5394996a"
|
|
40
41
|
}
|