@opentiny/tiny-engine-toolbar-view-setting 2.2.0 → 2.3.0-rc.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 +39 -39
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getCurrentInstance as b, onMounted as C, nextTick as y, getCurrentScope as E, onScopeDispose as h, ref as u, resolveComponent as S, createBlock as T, openBlock as M, watch as V, computed as B } from "vue";
|
|
2
2
|
import { ToolbarBase as N } from "@opentiny/tiny-engine-common";
|
|
3
3
|
import { constants as P } from "@opentiny/tiny-engine-utils";
|
|
4
4
|
var d;
|
|
@@ -8,28 +8,28 @@ function x(e) {
|
|
|
8
8
|
return e;
|
|
9
9
|
}
|
|
10
10
|
function A(e) {
|
|
11
|
-
return
|
|
11
|
+
return E() ? (h(e), !0) : !1;
|
|
12
12
|
}
|
|
13
|
-
function g(e,
|
|
14
|
-
|
|
13
|
+
function g(e, n = !0) {
|
|
14
|
+
b() ? C(e) : n ? e() : y(e);
|
|
15
15
|
}
|
|
16
16
|
const Q = w ? window : void 0;
|
|
17
|
-
function k(e,
|
|
18
|
-
const
|
|
19
|
-
return o(), g(o,
|
|
17
|
+
function k(e, n = !1) {
|
|
18
|
+
const t = u(), o = () => t.value = !!e();
|
|
19
|
+
return o(), g(o, n), t;
|
|
20
20
|
}
|
|
21
21
|
const L = (e) => {
|
|
22
22
|
const {
|
|
23
|
-
name:
|
|
24
|
-
window:
|
|
25
|
-
} = e, o = k(() =>
|
|
23
|
+
name: n,
|
|
24
|
+
window: t = Q
|
|
25
|
+
} = e, o = k(() => t && "BroadcastChannel" in t), s = u(!1), a = u(), r = u(), i = u(null), I = (l) => {
|
|
26
26
|
a.value && a.value.postMessage(l);
|
|
27
27
|
}, c = () => {
|
|
28
28
|
a.value && a.value.close(), s.value = !0;
|
|
29
29
|
};
|
|
30
30
|
return o.value && g(() => {
|
|
31
|
-
i.value = null, a.value = new BroadcastChannel(
|
|
32
|
-
|
|
31
|
+
i.value = null, a.value = new BroadcastChannel(n), a.value.addEventListener("message", (l) => {
|
|
32
|
+
r.value = l.data;
|
|
33
33
|
}, { passive: !0 }), a.value.addEventListener("messageerror", (l) => {
|
|
34
34
|
i.value = l;
|
|
35
35
|
}, { passive: !0 }), a.value.addEventListener("close", () => {
|
|
@@ -40,24 +40,24 @@ const L = (e) => {
|
|
|
40
40
|
}), {
|
|
41
41
|
isSupported: o,
|
|
42
42
|
channel: a,
|
|
43
|
-
data:
|
|
44
|
-
post:
|
|
43
|
+
data: r,
|
|
44
|
+
post: I,
|
|
45
45
|
close: c,
|
|
46
46
|
error: i,
|
|
47
47
|
isClosed: s
|
|
48
48
|
};
|
|
49
|
-
}, p = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {},
|
|
50
|
-
p[
|
|
51
|
-
var
|
|
49
|
+
}, p = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, v = "__vueuse_ssr_handlers__";
|
|
50
|
+
p[v] = p[v] || {};
|
|
51
|
+
var f;
|
|
52
52
|
(function(e) {
|
|
53
53
|
e.UP = "UP", e.RIGHT = "RIGHT", e.DOWN = "DOWN", e.LEFT = "LEFT", e.NONE = "NONE";
|
|
54
|
-
})(
|
|
55
|
-
var R = Object.defineProperty, _ = Object.getOwnPropertySymbols, W = Object.prototype.hasOwnProperty, D = Object.prototype.propertyIsEnumerable, O = (e,
|
|
56
|
-
for (var
|
|
57
|
-
W.call(
|
|
54
|
+
})(f || (f = {}));
|
|
55
|
+
var R = Object.defineProperty, _ = Object.getOwnPropertySymbols, W = Object.prototype.hasOwnProperty, D = Object.prototype.propertyIsEnumerable, O = (e, n, t) => n in e ? R(e, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[n] = t, j = (e, n) => {
|
|
56
|
+
for (var t in n || (n = {}))
|
|
57
|
+
W.call(n, t) && O(e, t, n[t]);
|
|
58
58
|
if (_)
|
|
59
|
-
for (var
|
|
60
|
-
D.call(
|
|
59
|
+
for (var t of _(n))
|
|
60
|
+
D.call(n, t) && O(e, t, n[t]);
|
|
61
61
|
return e;
|
|
62
62
|
};
|
|
63
63
|
const G = {
|
|
@@ -89,11 +89,11 @@ const G = {
|
|
|
89
89
|
j({
|
|
90
90
|
linear: x
|
|
91
91
|
}, G);
|
|
92
|
-
const H = (e,
|
|
93
|
-
const
|
|
94
|
-
for (const [o, s] of
|
|
95
|
-
|
|
96
|
-
return
|
|
92
|
+
const H = (e, n) => {
|
|
93
|
+
const t = e.__vccOpts || e;
|
|
94
|
+
for (const [o, s] of n)
|
|
95
|
+
t[o] = s;
|
|
96
|
+
return t;
|
|
97
97
|
}, { BROADCAST_CHANNEL: U, CANVAS_ROUTER_VIEW_SETTING_VIEW_MODE_KEY: m } = P;
|
|
98
98
|
function F() {
|
|
99
99
|
const e = localStorage.getItem(m);
|
|
@@ -113,9 +113,9 @@ const Y = {
|
|
|
113
113
|
}
|
|
114
114
|
},
|
|
115
115
|
setup() {
|
|
116
|
-
const e =
|
|
117
|
-
|
|
118
|
-
e.value =
|
|
116
|
+
const e = u(F()), { post: n, data: t } = L({ name: U.CanvasRouterViewSetting });
|
|
117
|
+
V(t, () => {
|
|
118
|
+
e.value = t.value;
|
|
119
119
|
});
|
|
120
120
|
const o = [
|
|
121
121
|
{
|
|
@@ -126,25 +126,25 @@ const Y = {
|
|
|
126
126
|
value: "standalone",
|
|
127
127
|
label: "单页视图"
|
|
128
128
|
}
|
|
129
|
-
], s =
|
|
130
|
-
() => o.find(({ value:
|
|
129
|
+
], s = B(
|
|
130
|
+
() => o.find(({ value: r }) => r !== e.value) || o[1]
|
|
131
131
|
);
|
|
132
132
|
return {
|
|
133
133
|
viewModeOptions: o,
|
|
134
134
|
viewMode: e,
|
|
135
135
|
changeViewMode: () => {
|
|
136
|
-
e.value = e.value === o[0].value ? o[1].value : o[0].value, K(e.value),
|
|
136
|
+
e.value = e.value === o[0].value ? o[1].value : o[0].value, K(e.value), n({ viewMode: e.value });
|
|
137
137
|
},
|
|
138
138
|
nextViewMode: s
|
|
139
139
|
};
|
|
140
140
|
}
|
|
141
141
|
};
|
|
142
|
-
function q(e,
|
|
143
|
-
const
|
|
144
|
-
return
|
|
142
|
+
function q(e, n, t, o, s, a) {
|
|
143
|
+
const r = S("toolbar-base");
|
|
144
|
+
return M(), T(r, {
|
|
145
145
|
content: `切换到${o.nextViewMode.label}`,
|
|
146
|
-
icon:
|
|
147
|
-
options:
|
|
146
|
+
icon: t.options.icon.default || t.options.icon,
|
|
147
|
+
options: t.options,
|
|
148
148
|
onClickApi: o.changeViewMode
|
|
149
149
|
}, null, 8, ["content", "icon", "options", "onClickApi"]);
|
|
150
150
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opentiny/tiny-engine-toolbar-view-setting",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0-rc.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -25,19 +25,19 @@
|
|
|
25
25
|
"license": "MIT",
|
|
26
26
|
"homepage": "https://opentiny.design/tiny-engine",
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@opentiny/tiny-engine-common": "2.
|
|
29
|
-
"@opentiny/tiny-engine-utils": "2.
|
|
28
|
+
"@opentiny/tiny-engine-common": "2.3.0-rc.0",
|
|
29
|
+
"@opentiny/tiny-engine-utils": "2.3.0-rc.0",
|
|
30
30
|
"@vueuse/core": "^9.6.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@opentiny/tiny-engine-vite-plugin-meta-comments": "2.
|
|
33
|
+
"@opentiny/tiny-engine-vite-plugin-meta-comments": "2.3.0-rc.0",
|
|
34
34
|
"@vitejs/plugin-vue": "^5.1.2",
|
|
35
35
|
"@vitejs/plugin-vue-jsx": "^4.0.1",
|
|
36
36
|
"vite": "^5.4.2"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
|
-
"@opentiny/vue": "^3.
|
|
39
|
+
"@opentiny/vue": "^3.20.0",
|
|
40
40
|
"vue": "^3.4.15"
|
|
41
41
|
},
|
|
42
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "5ea78adea68ea21caaf13ff9f8dcb008a1ad78cc"
|
|
43
43
|
}
|