@idmwx/idmui-gl4 3.3.0 → 3.3.1

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.
@@ -1,4 +1,4 @@
1
- import { l as b } from "./index-7c17ce6e.js";
1
+ import { l as b } from "./index-8edbbd2b.js";
2
2
  function M(e) {
3
3
  return typeof e == "string" && /^data:image\/svg\+xml/i.test(e);
4
4
  }
@@ -1,4 +1,4 @@
1
- import { W as a } from "./chunk-3VYIPD3A-6ed5af38.js";
1
+ import { W as a } from "./chunk-3VYIPD3A-5f9e7fdc.js";
2
2
  async function o(r, t) {
3
3
  let i = await a(r, t), e = new Image();
4
4
  return e.src = i.toDataURL(`image/${t.format}`, t.quality), await e.decode(), e.style.width = `${i.width / t.dpr}px`, e.style.height = `${i.height / t.dpr}px`, e;
@@ -1,4 +1,4 @@
1
- import { W as m } from "./chunk-3VYIPD3A-6ed5af38.js";
1
+ import { W as m } from "./chunk-3VYIPD3A-5f9e7fdc.js";
2
2
  async function a(n, e) {
3
3
  let o = e.type;
4
4
  if (o === "svg") {
@@ -1,6 +1,6 @@
1
- import { m as d } from "./chunk-T4JIPPZO-3411b1c7.js";
2
- import { W as f } from "./chunk-3VYIPD3A-6ed5af38.js";
3
- import "./index-7c17ce6e.js";
1
+ import { m as d } from "./chunk-T4JIPPZO-2dd67b2b.js";
2
+ import { W as f } from "./chunk-3VYIPD3A-5f9e7fdc.js";
3
+ import "./index-8edbbd2b.js";
4
4
  import "axios";
5
5
  import "vuetify";
6
6
  import "vue";
@@ -9587,7 +9587,7 @@ function Jd(t, e, o, i, a, r) {
9587
9587
  ])) : G("", !0),
9588
9588
  ((P = a.hoverPoint) == null ? void 0 : P.type) === "forecast" ? (A(), I("div", Fd, [
9589
9589
  n("label", jd, y(t.$t("weather.wind")) + " : ", 1),
9590
- n("span", null, y(((R = JSON.parse((z = a.hoverPoint) == null ? void 0 : z.wind)) == null ? void 0 : R.kts) ?? "-") + " kts", 1)
9590
+ n("span", null, y(((R = JSON.parse(((z = a.hoverPoint) == null ? void 0 : z.wind) || "{}")) == null ? void 0 : R.kts) ?? "-") + " kts", 1)
9591
9591
  ])) : G("", !0),
9592
9592
  ((S = a.hoverPoint) == null ? void 0 : S.type) === "history" ? (A(), I("div", Bd, [
9593
9593
  n("label", Nd, y(t.$t("weather.wind")) + " : ", 1),
@@ -9599,11 +9599,11 @@ function Jd(t, e, o, i, a, r) {
9599
9599
  ]),
9600
9600
  ((B = a.hoverPoint) == null ? void 0 : B.type) === "history" ? (A(), I("div", Vd, [
9601
9601
  n("label", Xd, y(t.$t("tropical.moveSpeed")) + " : ", 1),
9602
- n("span", null, y(((q = JSON.parse((Q = a.hoverPoint) == null ? void 0 : Q.movement)) == null ? void 0 : q.kts) ?? "-") + " kts", 1)
9602
+ n("span", null, y(((q = JSON.parse(((Q = a.hoverPoint) == null ? void 0 : Q.movement) || "{}")) == null ? void 0 : q.kts) ?? "-") + " kts", 1)
9603
9603
  ])) : G("", !0),
9604
9604
  ((oe = a.hoverPoint) == null ? void 0 : oe.type) === "history" ? (A(), I("div", Od, [
9605
9605
  n("label", Yd, y(t.$t("tropical.moveDir")) + " : ", 1),
9606
- n("span", null, y(((he = JSON.parse((ge = a.hoverPoint) == null ? void 0 : ge.movement)) == null ? void 0 : he.deg) ?? "-") + " °", 1)
9606
+ n("span", null, y(((he = JSON.parse(((ge = a.hoverPoint) == null ? void 0 : ge.movement) || "{}")) == null ? void 0 : he.deg) ?? "-") + " °", 1)
9607
9607
  ])) : G("", !0),
9608
9608
  n("div", Hd, [
9609
9609
  n("label", Ud, y(t.$t("tropical.position")) + " : ", 1),
@@ -17057,52 +17057,52 @@ Pe.capture = async (t, e, o) => {
17057
17057
  if (o !== rr)
17058
17058
  throw new Error("[snapdom.capture] is internal. Use snapdom(...) instead.");
17059
17059
  let i = await ir(t, e), a = { img: async (g, h) => {
17060
- let { toImg: f } = await import("./toImg-128585a5.js");
17060
+ let { toImg: f } = await import("./toImg-aac23f7a.js");
17061
17061
  return f(i, { ...g, ...h || {} });
17062
17062
  }, svg: async (g, h) => {
17063
- let { toSvg: f } = await import("./toImg-128585a5.js");
17063
+ let { toSvg: f } = await import("./toImg-aac23f7a.js");
17064
17064
  return f(i, { ...g, ...h || {} });
17065
17065
  }, canvas: async (g, h) => {
17066
- let { toCanvas: f } = await import("./toCanvas-0d592d94.js");
17066
+ let { toCanvas: f } = await import("./toCanvas-32bca541.js");
17067
17067
  return f(i, { ...g, ...h || {} });
17068
17068
  }, blob: async (g, h) => {
17069
- let { toBlob: f } = await import("./toBlob-33cd4b12.js");
17069
+ let { toBlob: f } = await import("./toBlob-274d5cc6.js");
17070
17070
  return f(i, { ...g, ...h || {} });
17071
17071
  }, png: async (g, h) => {
17072
- let { rasterize: f } = await import("./rasterize-JS5G2XHH-c40e3aed.js");
17072
+ let { rasterize: f } = await import("./rasterize-JS5G2XHH-f2161451.js");
17073
17073
  return f(i, { ...g, ...h || {}, format: "png" });
17074
17074
  }, jpeg: async (g, h) => {
17075
- let { rasterize: f } = await import("./rasterize-JS5G2XHH-c40e3aed.js");
17075
+ let { rasterize: f } = await import("./rasterize-JS5G2XHH-f2161451.js");
17076
17076
  return f(i, { ...g, ...h || {}, format: "jpeg" });
17077
17077
  }, webp: async (g, h) => {
17078
- let { rasterize: f } = await import("./rasterize-JS5G2XHH-c40e3aed.js");
17078
+ let { rasterize: f } = await import("./rasterize-JS5G2XHH-f2161451.js");
17079
17079
  return f(i, { ...g, ...h || {}, format: "webp" });
17080
17080
  }, download: async (g, h) => {
17081
- let { download: f } = await import("./download-8fc67980.js");
17081
+ let { download: f } = await import("./download-107389da.js");
17082
17082
  return f(i, { ...g, ...h || {} });
17083
17083
  } }, r = { ...e, export: { url: i }, exports: { svg: async (g) => {
17084
- let { toSvg: h } = await import("./toImg-128585a5.js");
17084
+ let { toSvg: h } = await import("./toImg-aac23f7a.js");
17085
17085
  return h(i, { ...e, ...g || {}, [qe]: !0 });
17086
17086
  }, canvas: async (g) => {
17087
- let { toCanvas: h } = await import("./toCanvas-0d592d94.js");
17087
+ let { toCanvas: h } = await import("./toCanvas-32bca541.js");
17088
17088
  return h(i, { ...e, ...g || {}, [qe]: !0 });
17089
17089
  }, png: async (g) => {
17090
- let { rasterize: h } = await import("./rasterize-JS5G2XHH-c40e3aed.js");
17090
+ let { rasterize: h } = await import("./rasterize-JS5G2XHH-f2161451.js");
17091
17091
  return h(i, { ...e, ...g || {}, format: "png", [qe]: !0 });
17092
17092
  }, jpeg: async (g) => {
17093
- let { rasterize: h } = await import("./rasterize-JS5G2XHH-c40e3aed.js");
17093
+ let { rasterize: h } = await import("./rasterize-JS5G2XHH-f2161451.js");
17094
17094
  return h(i, { ...e, ...g || {}, format: "jpeg", [qe]: !0 });
17095
17095
  }, jpg: async (g) => {
17096
- let { rasterize: h } = await import("./rasterize-JS5G2XHH-c40e3aed.js");
17096
+ let { rasterize: h } = await import("./rasterize-JS5G2XHH-f2161451.js");
17097
17097
  return h(i, { ...e, ...g || {}, format: "jpeg", [qe]: !0 });
17098
17098
  }, webp: async (g) => {
17099
- let { rasterize: h } = await import("./rasterize-JS5G2XHH-c40e3aed.js");
17099
+ let { rasterize: h } = await import("./rasterize-JS5G2XHH-f2161451.js");
17100
17100
  return h(i, { ...e, ...g || {}, format: "webp", [qe]: !0 });
17101
17101
  }, blob: async (g) => {
17102
- let { toBlob: h } = await import("./toBlob-33cd4b12.js");
17102
+ let { toBlob: h } = await import("./toBlob-274d5cc6.js");
17103
17103
  return h(i, { ...e, ...g || {}, [qe]: !0 });
17104
17104
  }, img: async (g) => {
17105
- let { toImg: h } = await import("./toImg-128585a5.js");
17105
+ let { toImg: h } = await import("./toImg-aac23f7a.js");
17106
17106
  return h(i, { ...e, ...g || {}, [qe]: !0 });
17107
17107
  } } }, l = await Lg("defineExports", r), c = Object.assign({}, ...l.filter((g) => g && typeof g == "object")), s = { ...a, ...c };
17108
17108
  s.jpeg && !s.jpg && (s.jpg = (g, h) => s.jpeg(g, h));
@@ -17317,8 +17317,8 @@ class ef {
17317
17317
  async generateGif() {
17318
17318
  return this.frames.length === 0 ? (console.warn("[GifRecorder] 没有可用的帧"), null) : new Promise((e, o) => {
17319
17319
  const i = window.devicePixelRatio || 1, a = new hr({
17320
- workers: 2,
17321
- quality: 10,
17320
+ workers: 4,
17321
+ quality: 1,
17322
17322
  width: this.captureRect.width * i,
17323
17323
  height: this.captureRect.height * i,
17324
17324
  // 使用 node_modules 中的 worker 文件
@@ -17341,39 +17341,34 @@ class ef {
17341
17341
  try {
17342
17342
  const i = window.devicePixelRatio || 1, a = document.createElement("canvas");
17343
17343
  a.width = this.captureRect.width * i, a.height = this.captureRect.height * i;
17344
- const r = a.getContext("2d");
17345
- if (!r) {
17346
- o(new Error("无法创建 canvas context"));
17347
- return;
17348
- }
17349
- const l = a.captureStream(30);
17350
- let c = "video/webm;codecs=vp9", s = "webm";
17351
- MediaRecorder.isTypeSupported("video/mp4") ? (c = "video/mp4", s = "mp4") : MediaRecorder.isTypeSupported("video/webm;codecs=h264") && (c = "video/webm;codecs=h264", s = "mp4");
17352
- const d = new MediaRecorder(l, {
17353
- mimeType: c,
17354
- videoBitsPerSecond: 25e5
17355
- // 2.5 Mbps
17356
- }), m = [];
17357
- d.ondataavailable = (b) => {
17358
- b.data.size > 0 && m.push(b.data);
17359
- }, d.onstop = () => {
17360
- const b = new Blob(m, { type: c });
17361
- e(b);
17362
- }, d.onerror = (b) => {
17363
- console.error("[GifRecorder] MP4 合成失败:", b), o(b);
17364
- }, d.start();
17365
- let p = 0;
17366
- const u = () => {
17367
- if (p >= this.frames.length) {
17344
+ const r = a.getContext("2d"), l = a.captureStream(0), c = l.getVideoTracks()[0];
17345
+ let s = "video/webm;codecs=vp9", d = "webm";
17346
+ MediaRecorder.isTypeSupported("video/mp4;codecs=h264") ? (s = "video/mp4;codecs=h264", d = "mp4") : MediaRecorder.isTypeSupported("video/mp4") ? (s = "video/mp4", d = "mp4") : MediaRecorder.isTypeSupported("video/webm;codecs=vp9") && (s = "video/webm;codecs=vp9", d = "webm");
17347
+ const m = new MediaRecorder(l, {
17348
+ mimeType: s,
17349
+ videoBitsPerSecond: 8e6
17350
+ // 8 Mbps,确保高清画质
17351
+ }), p = [];
17352
+ m.ondataavailable = (g) => {
17353
+ g.data.size > 0 && p.push(g.data);
17354
+ }, m.onstop = () => {
17355
+ const g = new Blob(p, { type: s });
17356
+ e(g);
17357
+ }, m.onerror = (g) => {
17358
+ console.error("[GifRecorder] MP4 合成失败:", g), o(g);
17359
+ }, m.start();
17360
+ let u = 0;
17361
+ const b = () => {
17362
+ if (u >= this.frames.length) {
17368
17363
  setTimeout(() => {
17369
- d.stop();
17364
+ m.stop();
17370
17365
  }, 100);
17371
17366
  return;
17372
17367
  }
17373
- const b = this.frames[p];
17374
- r.putImageData(b, 0, 0), p++, setTimeout(u, this._frameDelay);
17368
+ const g = this.frames[u];
17369
+ r.putImageData(g, 0, 0), u++, typeof c.requestFrame == "function" && c.requestFrame(), setTimeout(b, this._frameDelay);
17375
17370
  };
17376
- u();
17371
+ b();
17377
17372
  } catch (i) {
17378
17373
  console.error("[GifRecorder] MP4 合成失败:", i), o(i);
17379
17374
  }
@@ -17590,7 +17585,7 @@ const tf = {
17590
17585
  if (o && o.length > 0)
17591
17586
  for (const i of o)
17592
17587
  i.url && (i.url.endsWith(".gif") ? this.gifUrl = i.url : i.url.endsWith(".mp4") && (this.mp4Url = i.url));
17593
- console.log("[BottomBar] 上传成功", this.mp4Url), this.actionStatus = 7;
17588
+ console.log("[BottomBar] 上传成功", this.mp4Url, this.gifUrl), this.actionStatus = 7;
17594
17589
  } catch (e) {
17595
17590
  console.error("[BottomBar] 上传失败:", e);
17596
17591
  }
@@ -17683,7 +17678,7 @@ function hf(t, e, o, i, a, r) {
17683
17678
  ], 6)) : G("", !0)
17684
17679
  ]);
17685
17680
  }
17686
- const pf = /* @__PURE__ */ ie(tf, [["render", hf], ["__scopeId", "data-v-c0291e15"]]);
17681
+ const pf = /* @__PURE__ */ ie(tf, [["render", hf], ["__scopeId", "data-v-23ed7fb6"]]);
17687
17682
  const uf = {
17688
17683
  name: "IdmBottomBar",
17689
17684
  components: { DateTimePicker: ea, IdmCapture: pf },
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { c as n, D as x, L as D, a as T, b as S, M as W, g as f, f as h, P as k, d as y, T as V, V as d, W as u, e as w } from "./index-7c17ce6e.js";
1
+ import { c as n, D as x, L as D, a as T, b as S, M as W, g as f, f as h, P as k, d as y, T as V, V as d, W as u, e as w } from "./index-8edbbd2b.js";
2
2
  import "axios";
3
3
  import "vuetify";
4
4
  import "vue";