@opentiny/tiny-engine-toolbar-view-setting 2.3.0 → 2.4.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 +23 -23
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getCurrentInstance as b, onMounted as C, nextTick as y, getCurrentScope as E, onScopeDispose as h, ref as
|
|
1
|
+
import { getCurrentInstance as b, onMounted as C, nextTick as y, getCurrentScope as E, onScopeDispose as h, ref as r, watch as S, computed as T, resolveComponent as M, createBlock as V, openBlock 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;
|
|
@@ -15,21 +15,21 @@ function g(e, n = !0) {
|
|
|
15
15
|
}
|
|
16
16
|
const Q = w ? window : void 0;
|
|
17
17
|
function k(e, n = !1) {
|
|
18
|
-
const t =
|
|
18
|
+
const t = r(), o = () => t.value = !!e();
|
|
19
19
|
return o(), g(o, n), t;
|
|
20
20
|
}
|
|
21
21
|
const L = (e) => {
|
|
22
22
|
const {
|
|
23
23
|
name: n,
|
|
24
24
|
window: t = Q
|
|
25
|
-
} = e, o = k(() => t && "BroadcastChannel" in t), s =
|
|
25
|
+
} = e, o = k(() => t && "BroadcastChannel" in t), s = r(!1), a = r(), u = r(), i = r(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
31
|
i.value = null, a.value = new BroadcastChannel(n), a.value.addEventListener("message", (l) => {
|
|
32
|
-
|
|
32
|
+
u.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,7 +40,7 @@ const L = (e) => {
|
|
|
40
40
|
}), {
|
|
41
41
|
isSupported: o,
|
|
42
42
|
channel: a,
|
|
43
|
-
data:
|
|
43
|
+
data: u,
|
|
44
44
|
post: I,
|
|
45
45
|
close: c,
|
|
46
46
|
error: i,
|
|
@@ -89,20 +89,15 @@ const G = {
|
|
|
89
89
|
j({
|
|
90
90
|
linear: x
|
|
91
91
|
}, G);
|
|
92
|
-
const
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
t[o] = s;
|
|
96
|
-
return t;
|
|
97
|
-
}, { BROADCAST_CHANNEL: U, CANVAS_ROUTER_VIEW_SETTING_VIEW_MODE_KEY: m } = P;
|
|
98
|
-
function F() {
|
|
99
|
-
const e = localStorage.getItem(m);
|
|
92
|
+
const { BROADCAST_CHANNEL: H, CANVAS_ROUTER_VIEW_SETTING_VIEW_MODE_KEY: m } = P;
|
|
93
|
+
function U() {
|
|
94
|
+
const e = localStorage.getItem(m) || "";
|
|
100
95
|
return ["embedded", "standalone"].includes(e) ? e : "embedded";
|
|
101
96
|
}
|
|
102
|
-
function
|
|
97
|
+
function F(e) {
|
|
103
98
|
localStorage.setItem(m, e);
|
|
104
99
|
}
|
|
105
|
-
const
|
|
100
|
+
const K = {
|
|
106
101
|
components: {
|
|
107
102
|
ToolbarBase: N
|
|
108
103
|
},
|
|
@@ -113,8 +108,8 @@ const Y = {
|
|
|
113
108
|
}
|
|
114
109
|
},
|
|
115
110
|
setup() {
|
|
116
|
-
const e =
|
|
117
|
-
|
|
111
|
+
const e = r(U()), { post: n, data: t } = L({ name: H.CanvasRouterViewSetting });
|
|
112
|
+
S(t, () => {
|
|
118
113
|
e.value = t.value;
|
|
119
114
|
});
|
|
120
115
|
const o = [
|
|
@@ -126,29 +121,34 @@ const Y = {
|
|
|
126
121
|
value: "standalone",
|
|
127
122
|
label: "单页视图"
|
|
128
123
|
}
|
|
129
|
-
], s =
|
|
130
|
-
() => o.find(({ value:
|
|
124
|
+
], s = T(
|
|
125
|
+
() => o.find(({ value: u }) => u !== e.value) || o[1]
|
|
131
126
|
);
|
|
132
127
|
return {
|
|
133
128
|
viewModeOptions: o,
|
|
134
129
|
viewMode: e,
|
|
135
130
|
changeViewMode: () => {
|
|
136
|
-
e.value = e.value === o[0].value ? o[1].value : o[0].value,
|
|
131
|
+
e.value = e.value === o[0].value ? o[1].value : o[0].value, F(e.value), n({ viewMode: e.value });
|
|
137
132
|
},
|
|
138
133
|
nextViewMode: s
|
|
139
134
|
};
|
|
140
135
|
}
|
|
136
|
+
}, Y = (e, n) => {
|
|
137
|
+
const t = e.__vccOpts || e;
|
|
138
|
+
for (const [o, s] of n)
|
|
139
|
+
t[o] = s;
|
|
140
|
+
return t;
|
|
141
141
|
};
|
|
142
142
|
function q(e, n, t, o, s, a) {
|
|
143
|
-
const
|
|
144
|
-
return
|
|
143
|
+
const u = M("toolbar-base");
|
|
144
|
+
return B(), V(u, {
|
|
145
145
|
content: `切换到${o.nextViewMode.label}`,
|
|
146
146
|
icon: t.options.icon.default || t.options.icon,
|
|
147
147
|
options: t.options,
|
|
148
148
|
onClickApi: o.changeViewMode
|
|
149
149
|
}, null, 8, ["content", "icon", "options", "onClickApi"]);
|
|
150
150
|
}
|
|
151
|
-
const z = /* @__PURE__ */
|
|
151
|
+
const z = /* @__PURE__ */ Y(K, [["render", q]]), J = {
|
|
152
152
|
id: "engine.toolbars.viewSetting",
|
|
153
153
|
type: "toolbars",
|
|
154
154
|
title: "viewSetting",
|
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.4.0-rc.0",
|
|
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.
|
|
29
|
-
"@opentiny/tiny-engine-utils": "2.
|
|
28
|
+
"@opentiny/tiny-engine-common": "2.4.0-rc.0",
|
|
29
|
+
"@opentiny/tiny-engine-utils": "2.4.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.4.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"
|
|
@@ -39,5 +39,5 @@
|
|
|
39
39
|
"@opentiny/vue": "^3.20.0",
|
|
40
40
|
"vue": "^3.4.15"
|
|
41
41
|
},
|
|
42
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "40df6ee51c80bf918c176f7e8ad97b6b687ddc7b"
|
|
43
43
|
}
|