react-kggraph 0.0.22 → 0.0.24

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.
Files changed (50) hide show
  1. package/lib/index.es10.js +20 -19
  2. package/lib/index.es14.js +39 -41
  3. package/lib/index.es16.js +20 -20
  4. package/lib/index.es17.js +42 -0
  5. package/lib/index.es18.js +3 -15466
  6. package/lib/index.es19.js +2 -54
  7. package/lib/index.es21.js +15461 -63
  8. package/lib/index.es22.js +53 -39
  9. package/lib/index.es23.js +60 -2
  10. package/lib/index.es24.js +69 -2
  11. package/lib/index.es25.js +2 -2
  12. package/lib/index.es26.js +2 -2
  13. package/lib/index.es27.js +1 -1
  14. package/lib/index.es28.js +1 -1
  15. package/lib/index.es29.js +1 -1
  16. package/lib/index.es3.js +100 -97
  17. package/lib/index.es30.js +1 -1
  18. package/lib/index.es31.js +1 -1
  19. package/lib/index.es32.js +1 -1
  20. package/lib/index.es33.js +2 -2
  21. package/lib/index.es34.js +4 -0
  22. package/lib/index.es35.js +2 -4
  23. package/lib/index.es37.js +66 -0
  24. package/lib/index.es38.js +1049 -0
  25. package/lib/index.es4.js +13 -9
  26. package/lib/index.es42.js +21 -0
  27. package/lib/index.es43.js +43 -0
  28. package/lib/index.es44.js +42 -0
  29. package/lib/index.es45.js +91 -0
  30. package/lib/index.es46.js +58 -0
  31. package/lib/index.es47.js +33 -0
  32. package/lib/index.es49.js +72 -0
  33. package/lib/index.es7.js +305 -305
  34. package/lib/index.es8.js +11 -11
  35. package/lib/src/components/Graph/components/ActionBar/actionList.d.ts +4 -0
  36. package/lib/src/components/Graph/components/KnowledgeCard/components/AudioSection.d.ts +12 -0
  37. package/lib/src/components/Graph/components/KnowledgeCard/components/DocumentSection.d.ts +12 -0
  38. package/lib/src/components/Graph/components/KnowledgeCard/components/ImageSection.d.ts +12 -0
  39. package/lib/src/components/Graph/components/KnowledgeCard/components/ListCard.d.ts +14 -0
  40. package/lib/src/components/Graph/components/KnowledgeCard/components/PropertySection.d.ts +11 -0
  41. package/lib/src/components/Graph/components/KnowledgeCard/components/RelationSection.d.ts +13 -0
  42. package/lib/src/components/Graph/components/KnowledgeCard/components/SourceCard.d.ts +6 -0
  43. package/lib/src/components/Graph/components/KnowledgeCard/components/VideoSection.d.ts +12 -0
  44. package/lib/src/components/Graph/components/KnowledgeCard/data.d.ts +84 -0
  45. package/lib/src/components/Graph/types.d.ts +7 -1
  46. package/lib/src/components/Graph/utils/edge_node_styles.d.ts +1 -0
  47. package/lib/style.css +1 -1
  48. package/package.json +1 -1
  49. package/lib/index.es20.js +0 -62
  50. package/lib/index.es36.js +0 -4
package/lib/index.es10.js CHANGED
@@ -1,8 +1,8 @@
1
- const g = {
1
+ const g = 60, s = {
2
2
  nodeLabelColor: "#000",
3
- nodeLabelFontSize: 18,
3
+ nodeLabelFontSize: 16,
4
4
  edgeLabelColor: "#666",
5
- edgeLabelFontSize: 18,
5
+ edgeLabelFontSize: 16,
6
6
  uriNodeColor: "#f7de63",
7
7
  // 节点类型为uri的节点颜色,默认节点颜色
8
8
  normalNodeColor: "#1890FF",
@@ -16,21 +16,21 @@ const g = {
16
16
  //路径高亮颜色
17
17
  pathNodeColor: "#145AFD"
18
18
  //路径节点颜色-不生效
19
- }, h = ({ elements: c, colors: n = {} }) => {
20
- const e = { ...g, ...n }, l = [], t = 80;
21
- c.map((o) => {
22
- var a, d, i;
23
- !l.includes((a = o == null ? void 0 : o.data) == null ? void 0 : a.type) && ((d = o == null ? void 0 : o.data) != null && d.type) && l.push((i = o.data) == null ? void 0 : i.type);
19
+ }, h = ({ elements: i, colors: c = {} }) => {
20
+ const e = { ...s, ...c }, r = [];
21
+ i.map((o) => {
22
+ var l, a, d;
23
+ !r.includes((l = o == null ? void 0 : o.data) == null ? void 0 : l.type) && ((a = o == null ? void 0 : o.data) != null && a.type) && r.push((d = o.data) == null ? void 0 : d.type);
24
24
  });
25
- const r = [];
26
- r.push({
25
+ const t = [];
26
+ t.push({
27
27
  selector: '[properties-type="uri"]',
28
28
  style: {
29
29
  "background-color": e.uriNodeColor,
30
30
  "background-image": "data(image)",
31
31
  "background-fit": "cover",
32
- width: t,
33
- height: t,
32
+ width: 60,
33
+ height: 60,
34
34
  label: "data(name)",
35
35
  color: e.nodeLabelColor,
36
36
  "text-valign": "bottom",
@@ -39,14 +39,14 @@ const g = {
39
39
  "text-wrap": "ellipsis",
40
40
  "text-overflow-wrap": "anywhere"
41
41
  }
42
- }), r.push({
42
+ }), t.push({
43
43
  selector: '[properties-type!="uri"]',
44
44
  style: {
45
45
  "background-color": e.normalNodeColor,
46
46
  "background-image": "data(image)",
47
47
  "background-fit": "cover",
48
- width: t,
49
- height: t,
48
+ width: 60,
49
+ height: 60,
50
50
  label: "data(name)",
51
51
  color: e.nodeLabelColor,
52
52
  "text-valign": "bottom",
@@ -56,7 +56,7 @@ const g = {
56
56
  "text-overflow-wrap": "anywhere"
57
57
  }
58
58
  });
59
- const s = [
59
+ const n = [
60
60
  {
61
61
  selector: "node",
62
62
  style: {
@@ -184,9 +184,10 @@ const g = {
184
184
  }
185
185
  }
186
186
  ];
187
- return r.concat(s);
187
+ return t.concat(n);
188
188
  };
189
189
  export {
190
- g as defaultColors,
191
- h as edgeNodeStyles
190
+ s as defaultColors,
191
+ h as edgeNodeStyles,
192
+ g as nodeSize
192
193
  };
package/lib/index.es14.js CHANGED
@@ -1,65 +1,63 @@
1
1
  import { jsx as e, jsxs as n } from "react/jsx-runtime";
2
- import { forwardRef as w, useState as C, useImperativeHandle as D } from "react";
3
- import { Select as a, Form as l, Drawer as F, Input as r } from "antd";
4
- const { Option: o } = a, z = w((S, g) => {
5
- const [v, d] = C(!1), [B, x] = C({ style: {}, data: {} }), [s] = l.useForm();
6
- return D(g, () => ({
7
- open: (t) => {
8
- var c, h, i, m, b, y, p, u, f, I;
9
- d(!0), x(t), s.setFieldsValue({
10
- name: (c = t.data) == null ? void 0 : c.name,
11
- type: t.type || "圆形",
12
- color: (h = t.style) == null ? void 0 : h.color,
13
- size: parseInt((i = t.style) == null ? void 0 : i.height) || 30,
14
- borderWidth: parseInt((m = t.style) == null ? void 0 : m.borderWidth) || 2,
15
- borderDash: ((b = t.style) == null ? void 0 : b.borderDash) === [5, 5] ? "是" : "否",
16
- borderColor: (y = t.style) == null ? void 0 : y.borderColor,
17
- textValign: ((p = t.style) == null ? void 0 : p.textValign) || "center",
18
- fontStyle: ((u = t.style) == null ? void 0 : u.fontStyle) || "normal",
19
- fontColor: ((f = t.style) == null ? void 0 : f["font-color"]) || "#000000",
20
- textBackgroundColor: ((I = t.style) == null ? void 0 : I.textBackgroundColor) || "transparent"
2
+ import { forwardRef as D, useState as C, useImperativeHandle as w } from "react";
3
+ import { Select as a, Form as r, Drawer as F, Input as o } from "antd";
4
+ const { Option: t } = a, z = D((S, g) => {
5
+ const [v, s] = C(!1), [V, x] = C({ style: {}, data: {} }), [d] = r.useForm();
6
+ return w(g, () => ({
7
+ open: (l) => {
8
+ var c, h, i, m, b, p, y, u, f, I;
9
+ s(!0), x(l), d.setFieldsValue({
10
+ name: (c = l.data) == null ? void 0 : c.name,
11
+ type: l.type || "圆形",
12
+ color: (h = l.style) == null ? void 0 : h.color,
13
+ size: parseInt((i = l.style) == null ? void 0 : i.height) || 30,
14
+ borderWidth: parseInt((m = l.style) == null ? void 0 : m.borderWidth) || 2,
15
+ borderDash: ((b = l.style) == null ? void 0 : b.borderDash) === [5, 5] ? "是" : "否",
16
+ borderColor: (p = l.style) == null ? void 0 : p.borderColor,
17
+ textValign: ((y = l.style) == null ? void 0 : y.textValign) || "center",
18
+ fontStyle: ((u = l.style) == null ? void 0 : u.fontStyle) || "normal",
19
+ fontColor: ((f = l.style) == null ? void 0 : f["font-color"]) || "#000000",
20
+ textBackgroundColor: ((I = l.style) == null ? void 0 : I.textBackgroundColor) || "transparent"
21
21
  });
22
22
  },
23
- close: () => d(!1)
23
+ close: () => s(!1)
24
24
  })), /* @__PURE__ */ e(
25
25
  F,
26
26
  {
27
27
  title: "节点配置",
28
28
  closable: { "aria-label": "Close Button" },
29
29
  onClose: () => {
30
- d(!1), s.resetFields();
30
+ s(!1), d.resetFields();
31
31
  },
32
32
  open: v,
33
33
  getContainer: !1,
34
34
  width: 360,
35
35
  children: /* @__PURE__ */ n(
36
- l,
36
+ r,
37
37
  {
38
- form: s,
38
+ form: d,
39
39
  layout: "vertical",
40
40
  disabled: !0,
41
41
  children: [
42
- /* @__PURE__ */ e(l.Item, { label: "名称", name: "name", children: /* @__PURE__ */ e(r, {}) }),
43
- /* @__PURE__ */ e(l.Item, { label: "类型", name: "type", children: /* @__PURE__ */ n(a, { children: [
44
- /* @__PURE__ */ e(o, { value: "圆形", children: "圆形" }),
45
- /* @__PURE__ */ e(o, { value: "矩形", children: "矩形" })
42
+ /* @__PURE__ */ e(r.Item, { label: "名称", name: "name", children: /* @__PURE__ */ e(o, {}) }),
43
+ /* @__PURE__ */ e(r.Item, { label: "类型", name: "type", children: /* @__PURE__ */ n(a, { children: [
44
+ /* @__PURE__ */ e(t, { value: "圆形", children: "圆形" }),
45
+ /* @__PURE__ */ e(t, { value: "矩形", children: "矩形" })
46
46
  ] }) }),
47
- /* @__PURE__ */ e(l.Item, { label: "颜色", name: "color", children: /* @__PURE__ */ e(r, { type: "color", style: { width: "100%", height: 32 } }) }),
48
- /* @__PURE__ */ e(l.Item, { label: "大小", name: "size", children: /* @__PURE__ */ e(r, { type: "number" }) }),
49
- /* @__PURE__ */ e(l.Item, { label: "边框宽度", name: "borderWidth", children: /* @__PURE__ */ e(r, { type: "number" }) }),
50
- /* @__PURE__ */ e(l.Item, { label: "边框虚线", name: "borderDash", children: /* @__PURE__ */ n(a, { children: [
51
- /* @__PURE__ */ e(o, { value: "", children: "" }),
52
- /* @__PURE__ */ e(o, { value: "是", children: "是" })
47
+ /* @__PURE__ */ e(r.Item, { label: "大小", name: "size", children: /* @__PURE__ */ e(o, { type: "number" }) }),
48
+ /* @__PURE__ */ e(r.Item, { label: "边框宽度", name: "borderWidth", children: /* @__PURE__ */ e(o, { type: "number" }) }),
49
+ /* @__PURE__ */ e(r.Item, { label: "边框虚线", name: "borderDash", children: /* @__PURE__ */ n(a, { children: [
50
+ /* @__PURE__ */ e(t, { value: "", children: "" }),
51
+ /* @__PURE__ */ e(t, { value: "", children: "" })
53
52
  ] }) }),
54
- /* @__PURE__ */ e(l.Item, { label: "边框颜色", name: "borderColor", children: /* @__PURE__ */ e(r, { type: "color", style: { width: "100%", height: 32 } }) }),
55
- /* @__PURE__ */ e(l.Item, { label: "字体位置", name: "textValign", children: /* @__PURE__ */ n(a, { children: [
56
- /* @__PURE__ */ e(o, { value: "center", children: "居中" }),
57
- /* @__PURE__ */ e(o, { value: "bottom", children: "底部" }),
58
- /* @__PURE__ */ e(o, { value: "top", children: "顶部" })
53
+ /* @__PURE__ */ e(r.Item, { label: "边框颜色", name: "borderColor", children: /* @__PURE__ */ e(o, { type: "color", style: { width: "100%", height: 32 } }) }),
54
+ /* @__PURE__ */ e(r.Item, { label: "字体位置", name: "textValign", children: /* @__PURE__ */ n(a, { children: [
55
+ /* @__PURE__ */ e(t, { value: "center", children: "居中" }),
56
+ /* @__PURE__ */ e(t, { value: "bottom", children: "底部" }),
57
+ /* @__PURE__ */ e(t, { value: "top", children: "顶部" })
59
58
  ] }) }),
60
- /* @__PURE__ */ e(l.Item, { label: "字体样式", name: "fontStyle", children: /* @__PURE__ */ e(r, {}) }),
61
- /* @__PURE__ */ e(l.Item, { label: "字体颜色", name: "fontColor", children: /* @__PURE__ */ e(r, { type: "color", style: { width: "100%", height: 32 } }) }),
62
- /* @__PURE__ */ e(l.Item, { label: "字体背色", name: "textBackgroundColor", children: /* @__PURE__ */ e(r, {}) })
59
+ /* @__PURE__ */ e(r.Item, { label: "字体样式", name: "fontStyle", children: /* @__PURE__ */ e(o, {}) }),
60
+ /* @__PURE__ */ e(r.Item, { label: "字体颜色", name: "fontColor", children: /* @__PURE__ */ e(o, { type: "color", style: { width: "100%", height: 32 } }) })
63
61
  ]
64
62
  }
65
63
  )
package/lib/index.es16.js CHANGED
@@ -1,37 +1,37 @@
1
- import { jsx as n } from "react/jsx-runtime";
2
- import { forwardRef as g, useContext as m, useState as o, useRef as w, useEffect as C, useImperativeHandle as h } from "react";
3
- import { Drawer as x } from "antd";
4
- import { GraphContext as y } from "./index.es15.js";
5
- const F = g((I, l) => {
6
- const { graphInfo: d, knowledgeCardApi: f } = m(y), [t, a] = o(!1), [k, r] = o(!1), [D, c] = o(!1), [v, p] = o({ style: {}, data: {} }), s = w(null);
7
- C(() => {
8
- t && s.current && (s.current.scrollTop = 0);
1
+ import { jsx as a } from "react/jsx-runtime";
2
+ import { forwardRef as u, useContext as g, useState as e, useRef as C, useEffect as w, useImperativeHandle as h } from "react";
3
+ import { Drawer as D } from "antd";
4
+ import { GraphContext as x } from "./index.es15.js";
5
+ import y from "./index.es37.js";
6
+ import { cardDara as I } from "./index.es38.js";
7
+ const K = u((v, l) => {
8
+ const { graphInfo: f, knowledgeCardApi: R } = g(x), [t, o] = e(!1), [d, s] = e(!1), [c, i] = e(!1), [k, p] = e({ style: {}, data: {} }), r = C(null);
9
+ w(() => {
10
+ t && r.current && (r.current.scrollTop = 0);
9
11
  }, [t]), h(l, () => ({
10
- open: (e) => {
11
- a(!0), p(e), i(e);
12
+ open: (n) => {
13
+ o(!0), p(n), m();
12
14
  },
13
- close: () => a(!1)
15
+ close: () => o(!1)
14
16
  }));
15
- const i = async (e) => {
16
- r(!0);
17
- const u = await f({ kgId: d.kgId, uri: e.id });
18
- console.log(44, e), c(u.data), r(!1);
17
+ const m = async (n) => {
18
+ s(!0), i(I.data), s(!1);
19
19
  };
20
- return /* @__PURE__ */ n(
21
- x,
20
+ return /* @__PURE__ */ a(
21
+ D,
22
22
  {
23
23
  title: "知识卡片",
24
24
  onClose: () => {
25
- a(!1);
25
+ o(!1);
26
26
  },
27
27
  open: t,
28
28
  getContainer: !1,
29
29
  className: "knowledge-card-drawer",
30
30
  styles: { body: { padding: "0 20px", overflow: "auto" } },
31
- children: /* @__PURE__ */ n("div", { ref: s, style: { height: "100%" } })
31
+ children: /* @__PURE__ */ a("div", { ref: r, style: { height: "100%" }, children: /* @__PURE__ */ a(y, { detailData: c, drawerInfo: f, loading: d }) })
32
32
  }
33
33
  );
34
34
  });
35
35
  export {
36
- F as default
36
+ K as default
37
37
  };
@@ -0,0 +1,42 @@
1
+ import { getDefaultExportFromCjs as u } from "./index.es18.js";
2
+ import { __module as i } from "./index.es19.js";
3
+ /*!
4
+ Copyright (c) 2018 Jed Watson.
5
+ Licensed under the MIT License (MIT), see
6
+ http://jedwatson.github.io/classnames
7
+ */
8
+ (function(s) {
9
+ (function() {
10
+ var f = {}.hasOwnProperty;
11
+ function e() {
12
+ for (var t = "", r = 0; r < arguments.length; r++) {
13
+ var n = arguments[r];
14
+ n && (t = o(t, a(n)));
15
+ }
16
+ return t;
17
+ }
18
+ function a(t) {
19
+ if (typeof t == "string" || typeof t == "number")
20
+ return t;
21
+ if (typeof t != "object")
22
+ return "";
23
+ if (Array.isArray(t))
24
+ return e.apply(null, t);
25
+ if (t.toString !== Object.prototype.toString && !t.toString.toString().includes("[native code]"))
26
+ return t.toString();
27
+ var r = "";
28
+ for (var n in t)
29
+ f.call(t, n) && t[n] && (r = o(r, n));
30
+ return r;
31
+ }
32
+ function o(t, r) {
33
+ return r ? t ? t + " " + r : t + r : t;
34
+ }
35
+ s.exports ? (e.default = e, s.exports = e) : window.classNames = e;
36
+ })();
37
+ })(i);
38
+ var p = i.exports;
39
+ const m = /* @__PURE__ */ u(p);
40
+ export {
41
+ m as default
42
+ };