magtool 1.2.8 → 1.3.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  import r from "moment";
2
2
  import m from "markdown-it";
3
- import * as a from "echarts";
4
- import n from "bignumber.js";
3
+ import * as n from "echarts";
4
+ import a from "bignumber.js";
5
5
  import { d as p } from "./util.js";
6
6
  import { d } from "./directive.js";
7
7
  import w from "./store.js";
@@ -15,7 +15,7 @@ const S = (t, _) => {
15
15
  i = o, t.provide("store", o).use(s);
16
16
  } catch {
17
17
  throw new Error(
18
- "piniaStore error, storeChips must be an Object source from import.meta.globa"
18
+ "piniaStore error, storeChips must be an Object source from import.meta.glob"
19
19
  );
20
20
  }
21
21
  const e = localStorage.getItem("lang");
@@ -29,7 +29,7 @@ const S = (t, _) => {
29
29
  weekdays: "星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),
30
30
  weekdaysShort: "周日_周一_周二_周三_周四_周五_周六".split("_"),
31
31
  weekdaysMin: "日_一_二_三_四_五_六".split("_")
32
- }), window.$m = r, window.$moment = r, window.$md = m, window.$echarts = a, window.$bigNumber = n;
32
+ }), window.$m = r, window.$moment = r, window.$md = m, window.$echarts = n, window.$bigNumber = a;
33
33
  };
34
34
  export {
35
35
  S as default
package/dist/store.js CHANGED
@@ -1,10 +1,13 @@
1
- import { createPinia as a, defineStore as i } from "pinia";
2
- const c = a(), s = (e) => {
3
- const o = {};
4
- Object.keys(e).forEach((t) => {
5
- const n = t.match(/chip\/(\S*).js/)[1];
6
- o[n] = i(n, e[t].default);
7
- }), window.$store = o, window.$pinia = c;
1
+ import { createPinia as i, defineStore as r } from "pinia";
2
+ const a = i(), s = (t) => {
3
+ const e = {};
4
+ return Object.keys(t).forEach((n) => {
5
+ const o = n.match(/chip\/(\S*).js/)[1];
6
+ e[o] = r(o, t[n].default);
7
+ }), window.$store = e, window.$pinia = a, {
8
+ store: e,
9
+ pinia: a
10
+ };
8
11
  };
9
12
  export {
10
13
  s as default
package/dist/util.js CHANGED
@@ -230,10 +230,13 @@ const A = (a) => {
230
230
  i("success", e);
231
231
  }
232
232
  };
233
- const E = (e) => new Promise((r, o) => {
234
- const t = new Image();
235
- t.src = window.$getType(e) === "String" ? e : URL.createObjectURL(e), t.onload = () => r(t), t.onerror = () => o(new Error("Could not load image"));
236
- });
233
+ const E = (e) => {
234
+ if (e)
235
+ return new Promise((r, o) => {
236
+ const t = new Image();
237
+ t.src = window.$getType(e) === "String" ? e : URL.createObjectURL(e), t.onload = () => r(t), t.onerror = () => o(new Error("Could not load image"));
238
+ });
239
+ };
237
240
  window.$loadImage = E;
238
241
  const j = (e) => new Promise((r, o) => {
239
242
  const t = document.createElement("video");
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "magtool",
3
3
  "packageManager": "yarn@4.4.1",
4
- "version": "1.2.8",
4
+ "version": "1.3.0",
5
5
  "author": "matt avis",
6
6
  "main": "./dist/index.js",
7
7
  "module": "./dist/index.js",
@@ -31,7 +31,7 @@
31
31
  "dependencies": {
32
32
  "bignumber.js": "^9.1.2",
33
33
  "echarts": "^5.6.0",
34
- "magtool": "^1.1.2",
34
+ "magtool": "^1.2.8",
35
35
  "markdown-it": "^14.1.0",
36
36
  "moment": "^2.30.1",
37
37
  "pinia": "^3.0.0",