@opentiny/tiny-engine-toolbar-media 2.4.1 → 2.4.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.
- package/dist/index.js +11 -11
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import "./style.css";
|
|
2
|
-
import { ref as _, computed as B, reactive as X, toRaw as Y, watch as
|
|
2
|
+
import { ref as _, computed as B, reactive as X, toRaw as Y, watch as E, watchEffect as Z, onMounted as $, onUnmounted as ee, resolveComponent as f, createBlock as T, openBlock as v, withCtx as c, createElementVNode as t, createCommentVNode as W, createElementBlock as I, Fragment as te, renderList as ne, normalizeClass as ie, createVNode as g, createTextVNode as D, toDisplayString as r } from "vue";
|
|
3
3
|
import { Switch as oe, Input as ae, Popover as le } from "@opentiny/vue";
|
|
4
4
|
import { IconWebPlus as N } from "@opentiny/vue-icon";
|
|
5
|
-
import { useLayout as V, useCanvas as
|
|
5
|
+
import { useLayout as V, useCanvas as F } from "@opentiny/tiny-engine-meta-register";
|
|
6
6
|
import { ToolbarBase as se } from "@opentiny/tiny-engine-common";
|
|
7
7
|
const de = {
|
|
8
8
|
components: {
|
|
@@ -27,7 +27,7 @@ const de = {
|
|
|
27
27
|
},
|
|
28
28
|
setup(h, { emit: n }) {
|
|
29
29
|
let d = null, i = "", p = "";
|
|
30
|
-
const { layoutState: w } = V(), u = _(!1), b = _(!1), m = _(!1), { getCanvasType: y } =
|
|
30
|
+
const { layoutState: w } = V(), u = _(!1), b = _(!1), m = _(!1), { getCanvasType: y } = F().canvasApi.value, C = _((y == null ? void 0 : y()) === "absolute"), o = B(() => V().getDimension()), x = B(() => o.value.scale * 100), a = X({
|
|
31
31
|
activeIndex: 0,
|
|
32
32
|
guideValue: "",
|
|
33
33
|
width: "",
|
|
@@ -159,7 +159,7 @@ const de = {
|
|
|
159
159
|
}, P = (e) => {
|
|
160
160
|
const l = document.querySelector(".reference-text"), s = l == null ? void 0 : l.contains(e.target);
|
|
161
161
|
l !== e.target && !s && (w.toolbars.visiblePopover = !1);
|
|
162
|
-
}, k = a.media.reduce((e, l, s) => (e[l.view] = { ...Y(l), index: s }, e), {}),
|
|
162
|
+
}, k = a.media.reduce((e, l, s) => (e[l.view] = { ...Y(l), index: s }, e), {}), S = (e) => {
|
|
163
163
|
h.isCanvas ? V().setDimension({
|
|
164
164
|
deviceType: e.view,
|
|
165
165
|
width: e.width,
|
|
@@ -181,10 +181,10 @@ const de = {
|
|
|
181
181
|
{ type: "desktop", min: 992, max: 1200 },
|
|
182
182
|
{ type: "mdx", min: 1200, max: 1920 }
|
|
183
183
|
], G = (e) => {
|
|
184
|
-
var
|
|
184
|
+
var M;
|
|
185
185
|
const l = /^\d+$/;
|
|
186
186
|
String(e).match(l) ? Number(e) < 240 ? a.width = 240 : Number(e) > 1920 ? a.width = 1920 : a.width = e : a.width = i || parseInt(o.value.width, 10);
|
|
187
|
-
const s = Number(a.width), Q = ((
|
|
187
|
+
const s = Number(a.width), Q = ((M = R.find((A) => A.min <= s && s <= A.max)) == null ? void 0 : M.type) || "desktop";
|
|
188
188
|
z(s, Q);
|
|
189
189
|
}, H = (e) => {
|
|
190
190
|
const l = k.mdx, s = /^\d+(\.\d+)?$/;
|
|
@@ -192,10 +192,10 @@ const de = {
|
|
|
192
192
|
scale: Number(a.scaleValue) / 100
|
|
193
193
|
});
|
|
194
194
|
}, J = (e) => {
|
|
195
|
-
const { setCanvasType: l } =
|
|
195
|
+
const { setCanvasType: l } = F().canvasApi.value;
|
|
196
196
|
l(e ? "absolute" : "normal");
|
|
197
197
|
};
|
|
198
|
-
|
|
198
|
+
E(
|
|
199
199
|
() => o.value.deviceType,
|
|
200
200
|
(e) => {
|
|
201
201
|
a.activeIndex = k[e].index, a.readonly = e !== "mdx";
|
|
@@ -203,7 +203,7 @@ const de = {
|
|
|
203
203
|
{ immediate: !0 }
|
|
204
204
|
), Z(() => {
|
|
205
205
|
a.scaleValue = x.value.toFixed(2), p = x.value;
|
|
206
|
-
}),
|
|
206
|
+
}), E(
|
|
207
207
|
() => o.value.width,
|
|
208
208
|
(e) => {
|
|
209
209
|
const l = parseInt(e, 10);
|
|
@@ -215,7 +215,7 @@ const de = {
|
|
|
215
215
|
document.removeEventListener("click", P);
|
|
216
216
|
});
|
|
217
217
|
const K = o.value.deviceType || "desktop";
|
|
218
|
-
return
|
|
218
|
+
return S(k[K]), {
|
|
219
219
|
scale: x,
|
|
220
220
|
state: a,
|
|
221
221
|
active: b,
|
|
@@ -227,7 +227,7 @@ const de = {
|
|
|
227
227
|
hideTips: U,
|
|
228
228
|
timer: d,
|
|
229
229
|
dimension: o,
|
|
230
|
-
setViewPort:
|
|
230
|
+
setViewPort: S,
|
|
231
231
|
showPopover: j,
|
|
232
232
|
hidePopover: q,
|
|
233
233
|
widthChange: G,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opentiny/tiny-engine-toolbar-media",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.2",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -25,11 +25,11 @@
|
|
|
25
25
|
"license": "MIT",
|
|
26
26
|
"homepage": "https://opentiny.design/tiny-engine",
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@opentiny/tiny-engine-common": "2.4.
|
|
29
|
-
"@opentiny/tiny-engine-meta-register": "2.4.
|
|
28
|
+
"@opentiny/tiny-engine-common": "2.4.2",
|
|
29
|
+
"@opentiny/tiny-engine-meta-register": "2.4.2"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@opentiny/tiny-engine-vite-plugin-meta-comments": "2.4.
|
|
32
|
+
"@opentiny/tiny-engine-vite-plugin-meta-comments": "2.4.2",
|
|
33
33
|
"@vitejs/plugin-vue": "^5.1.2",
|
|
34
34
|
"@vitejs/plugin-vue-jsx": "^4.0.1",
|
|
35
35
|
"vite": "^5.4.2"
|
|
@@ -39,5 +39,5 @@
|
|
|
39
39
|
"@opentiny/vue-icon": "^3.20.0",
|
|
40
40
|
"vue": "^3.4.15"
|
|
41
41
|
},
|
|
42
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "3c5679965e80e59a8083fe629086e42b7b5dde36"
|
|
43
43
|
}
|