@duxweb/dvha-core 1.0.31 → 1.0.33
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 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("vue"),O=require("@tanstack/vue-query"),M=require("@vueuse/core"),C=require("axios"),q=require("crypto-js"),W=require("dayjs"),T=require("lodash-es"),k=require("mathjs"),l=require("mime"),E=require("mitt"),L=require("pinia"),D=require("vue3-sfc-loader"),J=require("vue-router"),N=require("../../../hooks/manage.cjs"),V=require("../../../hooks/data.cjs");require("json-2-csv");require("@vee-validate/rules");require("vee-validate");const B=require("../../../hooks/i18n.cjs"),F=require("../../../hooks/json.cjs");require("../../../hooks/json/index.cjs");require("../../../utils/bus.cjs");require("@overlastic/vue");require("clsx");require("colorizr");const Q=require("../../../index.cjs");function i(n){const c=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const o in n)if(o!=="default"){const a=Object.getOwnPropertyDescriptor(n,o);Object.defineProperty(c,o,a.get?a:{enumerable:!0,get:()=>n[o]})}}return c.default=n,Object.freeze(c)}const U=i(y),z=i(O),A=i(M),H=i(T),I=i(k),G=i(L),K=i(J),f=new Map;function X(n){return q.MD5(n).toString().substring(0,10)}function Y(n){const c=V.useClient(),{mergeLocale:o}=B.useI18n(),{config:a}=N.useManage(),v={moduleCache:{vue:U,"@duxweb/dvha-core":Q,"@vueuse/core":A,"@tanstack/vue-query":z,axios:C,crypto:q,mime:l,math:I,mitt:E,"lodash-es":H,pinia:G,dayjs:W,"vue-router":K,...a?.remote?.packages,"static!":function(e,r,t){const s=l.getType(t);if(s?.startsWith("image"))return`data:${s};charset=utf-8;base64,${btoa(e)}`;if(t===".json")return JSON.parse(e);throw new Error(`${t} unable to parse`)}},async handleModule(e,r){if(e!==".vue"){if(e===".json"){const t=await r(),{render:s}=F.useJsonSchema({data:t?.nodes||{},context:t?.data||{}});return()=>y.createVNode(s,null,null)}if(e!==".mjs")return r()}},customBlockHandler(e){if(e.type==="i18n"){const r=JSON.parse(e.content);for(const t in r)o(t,r[t])}},getFile:async e=>{e=g(e,".vue"),e=g(e,".json");const r=await c.request({path:typeof a?.remote?.apiRoutePath=="function"?a?.remote?.apiRoutePath(e):a?.remote?.apiRoutePath||"static",payload:{path:e},method:a?.remote?.apiMethod||"POST"}).then(s=>s?.data).catch(s=>{throw new Error(`${s?.message} ${e}`)});let t=r?.type||".vue";return(r?.type?.endsWith("js")||r?.type?.endsWith("ts")||r?.type?.endsWith("jsx")||r?.type?.endsWith("tsx"))&&(t=".mjs"),{content:r?.content,type:t}},getResource({refPath:e,relPath:r},t){const{moduleCache:s,pathResolve:_,getFile:j}=t,[b,...m]=r.match(/([^!]+!)|[^!]+$/g).reverse(),w=(u,h,p,x)=>m.reduce((R,$)=>s[$](R,h,p,x),u),d=_({refPath:e,relPath:b},t),S=m.join("")+d,P=u=>u.startsWith("@")?!0:!u.includes("/")&&!u.startsWith(".");return{id:S,path:d,async getContent(){if(P(d))throw new Error(`Package ${d} not imported`);const{content:u,type:h}=await j(d);return{getContentData:async p=>w(u,d,h,t),type:h}}}},addStyle(e){const r=X(e);if(f.has(r))return;f.set(r,!0);const t=document.createElement("style");t.textContent=e,t.setAttribute("data-hash",r),document.head.appendChild(t)}};return()=>D.loadModule(`${n}`,{...v})}function g(n,c){const o=new RegExp(`${c}$`);return n.replace(o,"")}exports.sfcLoader=Y;
|
|
@@ -1,59 +1,59 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import { createVNode as
|
|
3
|
-
import * as
|
|
4
|
-
import * as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
1
|
+
import * as W from "vue";
|
|
2
|
+
import { createVNode as M } from "vue";
|
|
3
|
+
import * as b from "@tanstack/vue-query";
|
|
4
|
+
import * as E from "@vueuse/core";
|
|
5
|
+
import k from "axios";
|
|
6
|
+
import y from "crypto-js";
|
|
7
7
|
import J from "dayjs";
|
|
8
|
-
import * as
|
|
9
|
-
import * as
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import * as
|
|
13
|
-
import { loadModule as
|
|
8
|
+
import * as T from "lodash-es";
|
|
9
|
+
import * as L from "mathjs";
|
|
10
|
+
import h from "mime";
|
|
11
|
+
import N from "mitt";
|
|
12
|
+
import * as O from "pinia";
|
|
13
|
+
import { loadModule as _ } from "vue3-sfc-loader";
|
|
14
14
|
import * as q from "vue-router";
|
|
15
|
-
import { useManage as
|
|
16
|
-
import { useClient as
|
|
15
|
+
import { useManage as B } from "../../../hooks/manage.js";
|
|
16
|
+
import { useClient as D } from "../../../hooks/data.js";
|
|
17
17
|
import "json-2-csv";
|
|
18
18
|
import "@vee-validate/rules";
|
|
19
19
|
import "vee-validate";
|
|
20
|
-
import { useI18n as
|
|
21
|
-
import { useJsonSchema as
|
|
20
|
+
import { useI18n as F } from "../../../hooks/i18n.js";
|
|
21
|
+
import { useJsonSchema as V } from "../../../hooks/json.js";
|
|
22
22
|
import "../../../hooks/json/index.js";
|
|
23
23
|
import "../../../utils/bus.js";
|
|
24
24
|
import "@overlastic/vue";
|
|
25
25
|
import "clsx";
|
|
26
26
|
import "colorizr";
|
|
27
|
-
import * as
|
|
27
|
+
import * as A from "../../../index.js";
|
|
28
28
|
const f = /* @__PURE__ */ new Map();
|
|
29
29
|
function H(s) {
|
|
30
|
-
return
|
|
30
|
+
return y.MD5(s).toString().substring(0, 10);
|
|
31
31
|
}
|
|
32
32
|
function ut(s) {
|
|
33
|
-
const c =
|
|
33
|
+
const c = D(), {
|
|
34
34
|
mergeLocale: u
|
|
35
|
-
} =
|
|
35
|
+
} = F(), {
|
|
36
36
|
config: i
|
|
37
|
-
} =
|
|
37
|
+
} = B(), g = {
|
|
38
38
|
moduleCache: {
|
|
39
|
-
vue:
|
|
40
|
-
"@duxweb/dvha-core":
|
|
41
|
-
"@vueuse/core":
|
|
42
|
-
"@tanstack/vue-query":
|
|
43
|
-
axios:
|
|
44
|
-
crypto:
|
|
45
|
-
mime:
|
|
46
|
-
math:
|
|
47
|
-
mitt:
|
|
48
|
-
"lodash-es":
|
|
49
|
-
pinia:
|
|
39
|
+
vue: W,
|
|
40
|
+
"@duxweb/dvha-core": A,
|
|
41
|
+
"@vueuse/core": E,
|
|
42
|
+
"@tanstack/vue-query": b,
|
|
43
|
+
axios: k,
|
|
44
|
+
crypto: y,
|
|
45
|
+
mime: h,
|
|
46
|
+
math: L,
|
|
47
|
+
mitt: N,
|
|
48
|
+
"lodash-es": T,
|
|
49
|
+
pinia: O,
|
|
50
50
|
dayjs: J,
|
|
51
51
|
"vue-router": q,
|
|
52
52
|
...i?.remote?.packages,
|
|
53
53
|
"static!": function(t, r, e) {
|
|
54
|
-
const
|
|
55
|
-
if (
|
|
56
|
-
return `data:${
|
|
54
|
+
const o = h.getType(e);
|
|
55
|
+
if (o?.startsWith("image"))
|
|
56
|
+
return `data:${o};charset=utf-8;base64,${btoa(t)}`;
|
|
57
57
|
if (e === ".json")
|
|
58
58
|
return JSON.parse(t);
|
|
59
59
|
throw new Error(`${e} unable to parse`);
|
|
@@ -63,14 +63,15 @@ function ut(s) {
|
|
|
63
63
|
if (t !== ".vue") {
|
|
64
64
|
if (t === ".json") {
|
|
65
65
|
const e = await r(), {
|
|
66
|
-
render:
|
|
67
|
-
} =
|
|
66
|
+
render: o
|
|
67
|
+
} = V({
|
|
68
68
|
data: e?.nodes || {},
|
|
69
69
|
context: e?.data || {}
|
|
70
70
|
});
|
|
71
|
-
return () =>
|
|
71
|
+
return () => M(o, null, null);
|
|
72
72
|
}
|
|
73
|
-
|
|
73
|
+
if (t !== ".mjs")
|
|
74
|
+
return r();
|
|
74
75
|
}
|
|
75
76
|
},
|
|
76
77
|
customBlockHandler(t) {
|
|
@@ -88,12 +89,13 @@ function ut(s) {
|
|
|
88
89
|
path: t
|
|
89
90
|
},
|
|
90
91
|
method: i?.remote?.apiMethod || "POST"
|
|
91
|
-
}).then((
|
|
92
|
-
throw new Error(`${
|
|
92
|
+
}).then((o) => o?.data).catch((o) => {
|
|
93
|
+
throw new Error(`${o?.message} ${t}`);
|
|
93
94
|
});
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
95
|
+
let e = r?.type || ".vue";
|
|
96
|
+
return (r?.type?.endsWith("js") || r?.type?.endsWith("ts") || r?.type?.endsWith("jsx") || r?.type?.endsWith("tsx")) && (e = ".mjs"), {
|
|
97
|
+
content: r?.content,
|
|
98
|
+
type: e
|
|
97
99
|
};
|
|
98
100
|
},
|
|
99
101
|
getResource({
|
|
@@ -101,25 +103,25 @@ function ut(s) {
|
|
|
101
103
|
relPath: r
|
|
102
104
|
}, e) {
|
|
103
105
|
const {
|
|
104
|
-
moduleCache:
|
|
106
|
+
moduleCache: o,
|
|
105
107
|
pathResolve: v,
|
|
106
108
|
getFile: w
|
|
107
|
-
} = e, [
|
|
109
|
+
} = e, [x, ...p] = r.match(/([^!]+!)|[^!]+$/g).reverse(), j = (n, m, d, P) => p.reduce((S, C) => o[C](S, m, d, P), n), a = v({
|
|
108
110
|
refPath: t,
|
|
109
|
-
relPath:
|
|
110
|
-
}, e),
|
|
111
|
+
relPath: x
|
|
112
|
+
}, e), $ = p.join("") + a, R = (n) => n.startsWith("@") ? !0 : !n.includes("/") && !n.startsWith(".");
|
|
111
113
|
return {
|
|
112
|
-
id:
|
|
113
|
-
path:
|
|
114
|
+
id: $,
|
|
115
|
+
path: a,
|
|
114
116
|
async getContent() {
|
|
115
|
-
if (R(
|
|
116
|
-
throw new Error(`Package ${
|
|
117
|
+
if (R(a))
|
|
118
|
+
throw new Error(`Package ${a} not imported`);
|
|
117
119
|
const {
|
|
118
|
-
|
|
120
|
+
content: n,
|
|
119
121
|
type: m
|
|
120
|
-
} = await w(
|
|
122
|
+
} = await w(a);
|
|
121
123
|
return {
|
|
122
|
-
getContentData: async (
|
|
124
|
+
getContentData: async (d) => j(n, a, m, e),
|
|
123
125
|
type: m
|
|
124
126
|
};
|
|
125
127
|
}
|
|
@@ -134,8 +136,8 @@ function ut(s) {
|
|
|
134
136
|
e.textContent = t, e.setAttribute("data-hash", r), document.head.appendChild(e);
|
|
135
137
|
}
|
|
136
138
|
};
|
|
137
|
-
return () =>
|
|
138
|
-
...
|
|
139
|
+
return () => _(`${s}`, {
|
|
140
|
+
...g
|
|
139
141
|
});
|
|
140
142
|
}
|
|
141
143
|
function l(s, c) {
|