zyjj-web-sdk 1.1.0 → 1.1.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.
@@ -1,4 +1,4 @@
1
- import { g as E } from "./index-EsacoB5D.js";
1
+ import { g as E } from "./index-oS0LMsZ4.js";
2
2
  function S(T, L) {
3
3
  for (var f = 0; f < L.length; f++) {
4
4
  const h = L[f];
@@ -1,4 +1,4 @@
1
- import { g as So, c as Io } from "./index-EsacoB5D.js";
1
+ import { g as So, c as Io } from "./index-oS0LMsZ4.js";
2
2
  function Lo(pe, Ze) {
3
3
  for (var J = 0; J < Ze.length; J++) {
4
4
  const U = Ze[J];
@@ -1,4 +1,4 @@
1
- import { j as r } from "./index-EsacoB5D.js";
1
+ import { j as r } from "./index-oS0LMsZ4.js";
2
2
  import { Alert as o } from "@arco-design/web-react";
3
3
  function p(t) {
4
4
  var e, n;
@@ -1,5 +1,5 @@
1
- import { j as r } from "./index-EsacoB5D.js";
2
- import { a as o } from "./common-DtnntE_W.js";
1
+ import { j as r } from "./index-oS0LMsZ4.js";
2
+ import { a as o } from "./common-fg-GJh8W.js";
3
3
  import { useState as s, useCallback as f } from "react";
4
4
  import { Space as m } from "@arco-design/web-react";
5
5
  function j(e) {
@@ -7,7 +7,7 @@ function j(e) {
7
7
  if (!i || !e.value)
8
8
  return;
9
9
  let t = {};
10
- typeof e.value == "string" ? (a(e.value), t.url = e.value, t.name = e.value.split("/").pop()) : (t = e.value, a(t.url)), import("./APlayer.min-CZBtOELz.js").then((l) => l.A).then((l) => {
10
+ typeof e.value == "string" ? (a(e.value), t.url = e.value, t.name = e.value.split("/").pop()) : (t = e.value, a(t.url)), import("./APlayer.min-cYakPUtE.js").then((l) => l.A).then((l) => {
11
11
  new l.default({
12
12
  container: i,
13
13
  loop: "none",
@@ -1,6 +1,6 @@
1
- import { j as e } from "./index-EsacoB5D.js";
1
+ import { j as e } from "./index-oS0LMsZ4.js";
2
2
  import { Space as m } from "@arco-design/web-react";
3
- import { I as t } from "./common-DtnntE_W.js";
3
+ import { I as t } from "./common-fg-GJh8W.js";
4
4
  function i(r) {
5
5
  return r.value ? e.jsx(m, { children: e.jsx(t, { src: r.value }) }) : e.jsx(e.Fragment, {});
6
6
  }
@@ -1,6 +1,6 @@
1
- import { j as e } from "./index-EsacoB5D.js";
1
+ import { j as e } from "./index-oS0LMsZ4.js";
2
2
  import { Image as o, Grid as t } from "@arco-design/web-react";
3
- import { I as n } from "./common-DtnntE_W.js";
3
+ import { I as n } from "./common-fg-GJh8W.js";
4
4
  function u(r) {
5
5
  var i;
6
6
  return r.value ? e.jsx(o.PreviewGroup, { infinite: !0, children: e.jsx(t, { cols: 4, colGap: 5, rowGap: 5, children: (i = r.value) == null ? void 0 : i.map((m, a) => e.jsx(t.GridItem, { children: e.jsx(n, { src: m }) }, a)) }) }) : e.jsx(e.Fragment, {});
@@ -1,4 +1,4 @@
1
- import { j as a } from "./index-EsacoB5D.js";
1
+ import { j as a } from "./index-oS0LMsZ4.js";
2
2
  import { Input as n } from "@arco-design/web-react";
3
3
  function r(e) {
4
4
  var t;
@@ -1,4 +1,4 @@
1
- import { j as n } from "./index-EsacoB5D.js";
1
+ import { j as n } from "./index-oS0LMsZ4.js";
2
2
  import { InputNumber as u } from "@arco-design/web-react";
3
3
  function r(t) {
4
4
  var e, a, m;
@@ -1,4 +1,4 @@
1
- import { j as n } from "./index-EsacoB5D.js";
1
+ import { j as n } from "./index-oS0LMsZ4.js";
2
2
  import { Select as l } from "@arco-design/web-react";
3
3
  function i(e) {
4
4
  var a;
@@ -1,7 +1,7 @@
1
- import { j as A } from "./index-EsacoB5D.js";
1
+ import { j as A } from "./index-oS0LMsZ4.js";
2
2
  import z, { useContext as Ce, useState as ae, useEffect as et } from "react";
3
3
  import { Space as tt, Input as nt } from "@arco-design/web-react";
4
- import { S as rt, C as it } from "./common-DtnntE_W.js";
4
+ import { S as rt, C as it } from "./common-fg-GJh8W.js";
5
5
  import { I as ve, _ as Ae, a as De } from "./context-tmjHwBoF.js";
6
6
  function ue(e, n) {
7
7
  var t = Object.keys(e);
@@ -2243,7 +2243,7 @@ function _r(e) {
2243
2243
  function Mr(e) {
2244
2244
  const [n, t] = ae(!1), [i, l] = ae();
2245
2245
  return et(() => {
2246
- import("./index-CBI9A0_q.js").then((o) => {
2246
+ import("./index-4CgKoZea.js").then((o) => {
2247
2247
  l(A.jsx(o.default, { remarkPlugins: [yt, _r], children: e.value }));
2248
2248
  });
2249
2249
  }, [e.value]), A.jsxs("div", { className: "zyjj-lab-markdown", style: { position: "relative" }, children: [e.value ? A.jsxs(tt, { style: { position: "absolute", right: 0, margin: 5, zIndex: 99 }, children: [A.jsx(rt, { noSuccess: !0, onClick: async () => t((o) => !o), icon: n ? A.jsx(X, {}) : A.jsx(Y, {}), tip: n ? "预览" : "编辑" }), A.jsx(it, { value: e.value })] }) : A.jsx(A.Fragment, {}), n ? A.jsx(nt.TextArea, { style: { borderRadius: 5, padding: 10 }, autoSize: !0, value: e.value, onChange: e.onChange }) : A.jsx("div", { style: { padding: 10 }, children: i })] });
@@ -1,4 +1,4 @@
1
- import { j as n } from "./index-EsacoB5D.js";
1
+ import { j as n } from "./index-oS0LMsZ4.js";
2
2
  import { Input as r } from "@arco-design/web-react";
3
3
  function m(e) {
4
4
  var a, t;
@@ -1,4 +1,4 @@
1
- import { j as i, F as x } from "./index-EsacoB5D.js";
1
+ import { j as i, F as x } from "./index-oS0LMsZ4.js";
2
2
  import l, { useContext as O, useState as j, useEffect as g } from "react";
3
3
  import { Upload as y, Button as b, Message as h } from "@arco-design/web-react";
4
4
  import { I as C, _ as w, a as P } from "./context-tmjHwBoF.js";
@@ -24,14 +24,14 @@ function d(n) {
24
24
  return n;
25
25
  }
26
26
  function _(n, o) {
27
- var e = O(C), t = e.prefixCls, r = t === void 0 ? "arco" : t, c = n.spin, a = n.className, s = d(d({
27
+ var e = O(C), t = e.prefixCls, r = t === void 0 ? "arco" : t, a = n.spin, c = n.className, s = d(d({
28
28
  "aria-hidden": !0,
29
29
  focusable: !1,
30
30
  ref: o
31
31
  }, n), {}, {
32
- className: "".concat(a ? a + " " : "").concat(r, "-icon ").concat(r, "-icon-upload")
32
+ className: "".concat(c ? c + " " : "").concat(r, "-icon ").concat(r, "-icon-upload")
33
33
  });
34
- return c && (s.className = "".concat(s.className, " ").concat(r, "-icon-loading")), delete s.spin, delete s.isIcon, /* @__PURE__ */ l.createElement("svg", w({
34
+ return a && (s.className = "".concat(s.className, " ").concat(r, "-icon-loading")), delete s.spin, delete s.isIcon, /* @__PURE__ */ l.createElement("svg", w({
35
35
  fill: "none",
36
36
  stroke: "currentColor",
37
37
  strokeWidth: "4",
@@ -46,18 +46,18 @@ p.defaultProps = {
46
46
  };
47
47
  p.displayName = "IconUpload";
48
48
  function F(n) {
49
- const { value: o, data: e, onChange: t } = n, r = (e == null ? void 0 : e.max_size) || 10 * 1024 * 1024, [c, a] = j([]), s = (u) => {
49
+ const { value: o, data: e, onChange: t } = n, r = (e == null ? void 0 : e.max_size) || 10 * 1024 * 1024, [a, c] = j([]), s = (u) => {
50
50
  console.log("custom upload", u);
51
51
  const { onSuccess: v, file: f } = u;
52
52
  if (f.size > r) {
53
- h.warning(`文件大小超过 ${r / 1024 / 1024}M, 请重新上传!`), a([]);
53
+ h.warning(`文件大小超过 ${r / 1024 / 1024}M, 请重新上传!`), c([]);
54
54
  return;
55
55
  }
56
- t && t(x(f)), v();
56
+ t && t(x(f, e == null ? void 0 : e.no_path)), v();
57
57
  };
58
58
  return g(() => {
59
- a(o ? [{ uid: o.uid, name: o.name }] : []);
60
- }, [o]), i.jsx(y, { accept: e == null ? void 0 : e.accept, fileList: c, onChange: a, onRemove: () => t(void 0), limit: 1, customRequest: s, children: i.jsx(b, { type: "outline", icon: i.jsx(p, {}), children: "点击上传" }) });
59
+ c(o ? [{ uid: o.uid, name: o.name }] : []);
60
+ }, [o]), i.jsx(y, { accept: e == null ? void 0 : e.accept, fileList: a, onChange: c, onRemove: () => t(void 0), limit: 1, customRequest: s, children: i.jsx(b, { type: "outline", icon: i.jsx(p, {}), children: "点击上传" }) });
61
61
  }
62
62
  export {
63
63
  F as default
@@ -1,11 +1,11 @@
1
- import { j as t } from "./index-EsacoB5D.js";
2
- import { a as n } from "./common-DtnntE_W.js";
1
+ import { j as t } from "./index-oS0LMsZ4.js";
2
+ import { a as n } from "./common-fg-GJh8W.js";
3
3
  import { Space as l } from "@arco-design/web-react";
4
4
  import { useCallback as s } from "react";
5
5
  function v(e) {
6
6
  var i;
7
7
  const a = s((o) => {
8
- !o || !e.value || import("./DPlayer.min-BXMg11_u.js").then((r) => r.D).then((r) => {
8
+ !o || !e.value || import("./DPlayer.min-6i8RTupf.js").then((r) => r.D).then((r) => {
9
9
  var u;
10
10
  new r.default({ container: o, screenshot: !0, video: { url: (u = e.value) == null ? void 0 : u.url } });
11
11
  });
@@ -1,4 +1,4 @@
1
- import { j as a, d as W } from "./index-EsacoB5D.js";
1
+ import { j as a, d as W } from "./index-oS0LMsZ4.js";
2
2
  import i, { useContext as f, useState as O, useEffect as F } from "react";
3
3
  import { Tooltip as H, Space as z, Image as T } from "@arco-design/web-react";
4
4
  import { I as p, _ as u, a as d } from "./context-tmjHwBoF.js";
@@ -255,12 +255,12 @@ function J(e, r) {
255
255
  d: "M42 24c0 9.941-8.059 18-18 18S6 33.941 6 24 14.059 6 24 6"
256
256
  }));
257
257
  }
258
- var C = /* @__PURE__ */ i.forwardRef(J);
259
- C.defaultProps = {
258
+ var w = /* @__PURE__ */ i.forwardRef(J);
259
+ w.defaultProps = {
260
260
  isIcon: !0
261
261
  };
262
- C.displayName = "IconLoading";
263
- const w = (e) => {
262
+ w.displayName = "IconLoading";
263
+ const C = (e) => {
264
264
  const [r, n] = O(e.icon), [t, c] = O(e.tip), [l, s] = O(!1);
265
265
  F(() => {
266
266
  n(e.icon);
@@ -270,23 +270,23 @@ const w = (e) => {
270
270
  n(e.icon), c(e.tip);
271
271
  }, 1e3));
272
272
  }, R = () => {
273
- e.onClick && !l && (o("执行中", a.jsx(C, {})), s(!0), e.onClick().then(() => o("成功", a.jsx(j, { style: { color: "green" } }))).catch((m) => o(`${m}`, a.jsx(v, { style: { color: "red" } }))).finally(() => s(!1)));
273
+ e.onClick && !l && (o("执行中", a.jsx(w, {})), s(!0), e.onClick().then(() => o("成功", a.jsx(j, { style: { color: "green" } }))).catch((m) => o(`${m}`, a.jsx(v, { style: { color: "red" } }))).finally(() => s(!1)));
274
274
  };
275
275
  return a.jsx(H, { content: t, children: a.jsx("div", { className: "zyjj-small-icon", onClick: R, children: r }) });
276
- }, ee = (e) => a.jsx(w, { icon: a.jsx(g, {}), tip: "拷贝", onClick: () => navigator.clipboard.writeText(e.value || "") }), M = (e) => a.jsx(w, { icon: a.jsx(b, {}), tip: "新窗口打开", onClick: async () => {
276
+ }, ee = (e) => a.jsx(C, { icon: a.jsx(g, {}), tip: "拷贝", onClick: () => navigator.clipboard.writeText(e.value || "") }), M = (e) => a.jsx(C, { icon: a.jsx(b, {}), tip: "新窗口打开", onClick: async () => {
277
277
  window.open(e.value);
278
- } }), L = (e) => a.jsx(w, { icon: a.jsx(y, {}), tip: "下载", onClick: async () => W(e.value || "") }), te = (e) => {
278
+ } }), L = (e) => a.jsx(C, { icon: a.jsx(y, {}), tip: "下载", onClick: async () => W(e.value || "") }), te = (e) => {
279
279
  const { link: r } = e;
280
280
  return r ? a.jsxs(z, { size: "mini", style: { marginLeft: 5, width: "100%", justifyContent: "center" }, align: "center", direction: "horizontal", children: [a.jsx(L, { value: r }), a.jsx(M, { value: r })] }) : a.jsx(a.Fragment, {});
281
281
  }, ne = (e) => a.jsx(T, { style: { borderRadius: 5 }, referrerPolicy: "no-referrer", width: "100%", src: e.src, previewProps: {
282
282
  actions: [
283
283
  {
284
- getContainer: () => a.jsx(L, { value: e.src }),
284
+ getContainer: () => a.jsx(L, { value: e.src }, "download"),
285
285
  content: a.jsx(a.Fragment, {}),
286
286
  key: "download"
287
287
  },
288
288
  {
289
- getContainer: () => a.jsx(M, { value: e.src }),
289
+ getContainer: () => a.jsx(M, { value: e.src }, "launch"),
290
290
  content: a.jsx(a.Fragment, {}),
291
291
  key: "launch"
292
292
  }
@@ -296,6 +296,6 @@ const w = (e) => {
296
296
  export {
297
297
  ee as C,
298
298
  ne as I,
299
- w as S,
299
+ C as S,
300
300
  te as a
301
301
  };
@@ -1,5 +1,5 @@
1
- import { a as Z, p as ne, r as xn, s as xe, c as Mn, b as ue, d as sn, e as dr, m as R, f as H, g as gr, h as yr, i as cn, j as A, k as ee, n as Ee, l as Qe, o as De, q as xr, t as kr, v as It, u as br } from "./ElementTypeText-BSc-LLC8.js";
2
- import { c as _n, g as wr, j as Ke } from "./index-EsacoB5D.js";
1
+ import { a as Z, p as ne, r as xn, s as xe, c as Mn, b as ue, d as sn, e as dr, m as R, f as H, g as gr, h as yr, i as cn, j as A, k as ee, n as Ee, l as Qe, o as De, q as xr, t as kr, v as It, u as br } from "./ElementTypeText-ByyMD0FT.js";
2
+ import { c as _n, g as wr, j as Ke } from "./index-oS0LMsZ4.js";
3
3
  const Bn = document.createElement("i");
4
4
  function kn(e) {
5
5
  const n = "&" + e + ";";
@@ -1478,13 +1478,16 @@ function ci(e, t, r) {
1478
1478
  const n = e.random || (e.rng || si)();
1479
1479
  return n[6] = n[6] & 15 | 64, n[8] = n[8] & 63 | 128, ii(n);
1480
1480
  }
1481
- const ui = (e) => e >= 1073741824 ? (e / 1073741824).toFixed(2) + " GB" : e >= 1048576 ? (e / 1048576).toFixed(2) + " MB" : e >= 1024 ? (e / 1024).toFixed(2) + " KB" : e + " B", li = (e) => ({
1482
- path: e.path || URL.createObjectURL(e),
1483
- name: e.name,
1484
- ext: e.name.split(".").pop(),
1485
- size: e.size,
1486
- uid: ci()
1487
- }), fi = (e) => new Date(e * 1e3).toISOString().substring(11, 19), di = async () => {
1481
+ const ui = (e) => e >= 1073741824 ? (e / 1073741824).toFixed(2) + " GB" : e >= 1048576 ? (e / 1048576).toFixed(2) + " MB" : e >= 1024 ? (e / 1024).toFixed(2) + " KB" : e + " B", li = (e, t) => {
1482
+ let r = e.path;
1483
+ return (t || !r) && (r = URL.createObjectURL(e)), {
1484
+ path: r,
1485
+ name: e.name,
1486
+ ext: e.name.split(".").pop(),
1487
+ size: e.size,
1488
+ uid: ci()
1489
+ };
1490
+ }, fi = (e) => new Date(e * 1e3).toISOString().substring(11, 19), di = async () => {
1488
1491
  const e = await Hn(), t = e.token;
1489
1492
  return {
1490
1493
  cos: new Vo({
@@ -4063,7 +4066,7 @@ function Rc(e) {
4063
4066
  return d.tp == "input" ? l = _.jsx(Ae, { allowClear: !0, placeholder: f.placeholder }) : d.tp == "custom" && (l = d.ele), _.jsx(ie.Item, { label: d.label, field: d.field, children: l }, d.field);
4064
4067
  }), _.jsx(ie.Item, { children: _.jsx(Fe, { htmlType: "submit", children: "搜索" }) })] }) : null, _.jsx(zo, { loading: n, pagination: s, onChange: (d) => i({ ...s, current: (d == null ? void 0 : d.current) || s.current, pageSize: (d == null ? void 0 : d.pageSize) || s.pageSize }), rowKey: e.id || "id", columns: e.columns, data: t })] });
4065
4068
  }
4066
- const cc = me(() => import("./ElementTypeInput-BRtz62-Y.js")), uc = me(() => import("./ElementTypeSelect-CR0uuJdt.js")), lc = me(() => import("./ElementTypeTextArea-DCG45595.js")), bn = me(() => import("./ElementTypeText-BSc-LLC8.js").then((e) => e.E)), fc = me(() => import("./ElementTypeAudio-cJogWlWH.js")), dc = me(() => import("./ElementTypeUpload-nGLzfZ6G.js")), hc = me(() => import("./ElementTypeNumber-Cfd2x86j.js")), pc = me(() => import("./ElementTypeImageList-vziNxaaS.js")), mc = me(() => import("./ElementTypeImage-7ir4H1-l.js")), yc = me(() => import("./ElementTypeAlert-DIwHRqol.js")), gc = me(() => import("./ElementTypeVideo-BMtgU--n.js")), bc = me(() => import("./ElementTypeNumber-Cfd2x86j.js"));
4069
+ const cc = me(() => import("./ElementTypeInput-Mx1txBsc.js")), uc = me(() => import("./ElementTypeSelect-TTtjEVOj.js")), lc = me(() => import("./ElementTypeTextArea-CE2X9ol7.js")), bn = me(() => import("./ElementTypeText-ByyMD0FT.js").then((e) => e.E)), fc = me(() => import("./ElementTypeAudio-CpOL1JSg.js")), dc = me(() => import("./ElementTypeUpload-O411cbP7.js")), hc = me(() => import("./ElementTypeNumber-Be9gUlCJ.js")), pc = me(() => import("./ElementTypeImageList-DQon_M46.js")), mc = me(() => import("./ElementTypeImage-CK4q6bI7.js")), yc = me(() => import("./ElementTypeAlert-BN8F6PHX.js")), gc = me(() => import("./ElementTypeVideo-D-c4fzS7.js")), bc = me(() => import("./ElementTypeNumber-Be9gUlCJ.js"));
4067
4070
  function Dc(e) {
4068
4071
  const { tp: t, isInput: r, data: n, value: o, onChange: s } = e;
4069
4072
  switch (t) {
package/lib/index.d.ts CHANGED
@@ -62,7 +62,7 @@ export declare const Tool: {
62
62
  renderCopy: (value: string) => import("react/jsx-runtime").JSX.Element;
63
63
  };
64
64
  utils: {
65
- file2ToolParamFile: (file: File) => import("./types/local-task.ts").ToolParamFile;
65
+ file2ToolParamFile: (file: File, no_path?: boolean | undefined) => import("./types/local-task.ts").ToolParamFile;
66
66
  seconds2TimeStr: (seconds: number) => string;
67
67
  getTencentInfo: () => Promise<{
68
68
  cos: import("cos-js-sdk-v5");
package/lib/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { A as s, E as o, L as m, P as n, a as l, S as r, T as t, U as E } from "./index-EsacoB5D.js";
1
+ import { A as s, E as o, L as m, P as n, a as l, S as r, T as t, U as E } from "./index-oS0LMsZ4.js";
2
2
  export {
3
3
  s as Api,
4
4
  o as Enum,