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.
- package/lib/index.es10.js +20 -19
- package/lib/index.es14.js +39 -41
- package/lib/index.es16.js +20 -20
- package/lib/index.es17.js +42 -0
- package/lib/index.es18.js +3 -15466
- package/lib/index.es19.js +2 -54
- package/lib/index.es21.js +15461 -63
- package/lib/index.es22.js +53 -39
- package/lib/index.es23.js +60 -2
- package/lib/index.es24.js +69 -2
- package/lib/index.es25.js +2 -2
- package/lib/index.es26.js +2 -2
- package/lib/index.es27.js +1 -1
- package/lib/index.es28.js +1 -1
- package/lib/index.es29.js +1 -1
- package/lib/index.es3.js +100 -97
- package/lib/index.es30.js +1 -1
- package/lib/index.es31.js +1 -1
- package/lib/index.es32.js +1 -1
- package/lib/index.es33.js +2 -2
- package/lib/index.es34.js +4 -0
- package/lib/index.es35.js +2 -4
- package/lib/index.es37.js +66 -0
- package/lib/index.es38.js +1049 -0
- package/lib/index.es4.js +13 -9
- package/lib/index.es42.js +21 -0
- package/lib/index.es43.js +43 -0
- package/lib/index.es44.js +42 -0
- package/lib/index.es45.js +91 -0
- package/lib/index.es46.js +58 -0
- package/lib/index.es47.js +33 -0
- package/lib/index.es49.js +72 -0
- package/lib/index.es7.js +305 -305
- package/lib/index.es8.js +11 -11
- package/lib/src/components/Graph/components/ActionBar/actionList.d.ts +4 -0
- package/lib/src/components/Graph/components/KnowledgeCard/components/AudioSection.d.ts +12 -0
- package/lib/src/components/Graph/components/KnowledgeCard/components/DocumentSection.d.ts +12 -0
- package/lib/src/components/Graph/components/KnowledgeCard/components/ImageSection.d.ts +12 -0
- package/lib/src/components/Graph/components/KnowledgeCard/components/ListCard.d.ts +14 -0
- package/lib/src/components/Graph/components/KnowledgeCard/components/PropertySection.d.ts +11 -0
- package/lib/src/components/Graph/components/KnowledgeCard/components/RelationSection.d.ts +13 -0
- package/lib/src/components/Graph/components/KnowledgeCard/components/SourceCard.d.ts +6 -0
- package/lib/src/components/Graph/components/KnowledgeCard/components/VideoSection.d.ts +12 -0
- package/lib/src/components/Graph/components/KnowledgeCard/data.d.ts +84 -0
- package/lib/src/components/Graph/types.d.ts +7 -1
- package/lib/src/components/Graph/utils/edge_node_styles.d.ts +1 -0
- package/lib/style.css +1 -1
- package/package.json +1 -1
- package/lib/index.es20.js +0 -62
- 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:
|
|
3
|
+
nodeLabelFontSize: 16,
|
|
4
4
|
edgeLabelColor: "#666",
|
|
5
|
-
edgeLabelFontSize:
|
|
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:
|
|
20
|
-
const e = { ...
|
|
21
|
-
|
|
22
|
-
var a, d
|
|
23
|
-
!
|
|
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
|
|
26
|
-
|
|
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:
|
|
33
|
-
height:
|
|
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
|
-
}),
|
|
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:
|
|
49
|
-
height:
|
|
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
|
|
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
|
|
187
|
+
return t.concat(n);
|
|
188
188
|
};
|
|
189
189
|
export {
|
|
190
|
-
|
|
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
|
|
3
|
-
import { Select as a, Form as
|
|
4
|
-
const { Option:
|
|
5
|
-
const [v,
|
|
6
|
-
return
|
|
7
|
-
open: (
|
|
8
|
-
var c, h, i, m, b,
|
|
9
|
-
|
|
10
|
-
name: (c =
|
|
11
|
-
type:
|
|
12
|
-
color: (h =
|
|
13
|
-
size: parseInt((i =
|
|
14
|
-
borderWidth: parseInt((m =
|
|
15
|
-
borderDash: ((b =
|
|
16
|
-
borderColor: (
|
|
17
|
-
textValign: ((
|
|
18
|
-
fontStyle: ((u =
|
|
19
|
-
fontColor: ((f =
|
|
20
|
-
textBackgroundColor: ((I =
|
|
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: () =>
|
|
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
|
-
|
|
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
|
-
|
|
36
|
+
r,
|
|
37
37
|
{
|
|
38
|
-
form:
|
|
38
|
+
form: d,
|
|
39
39
|
layout: "vertical",
|
|
40
40
|
disabled: !0,
|
|
41
41
|
children: [
|
|
42
|
-
/* @__PURE__ */ e(
|
|
43
|
-
/* @__PURE__ */ e(
|
|
44
|
-
/* @__PURE__ */ e(
|
|
45
|
-
/* @__PURE__ */ e(
|
|
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(
|
|
48
|
-
/* @__PURE__ */ e(
|
|
49
|
-
/* @__PURE__ */ e(
|
|
50
|
-
|
|
51
|
-
/* @__PURE__ */ e(
|
|
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(
|
|
55
|
-
/* @__PURE__ */ e(
|
|
56
|
-
/* @__PURE__ */ e(
|
|
57
|
-
/* @__PURE__ */ e(
|
|
58
|
-
/* @__PURE__ */ e(
|
|
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(
|
|
61
|
-
/* @__PURE__ */ e(
|
|
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
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { Drawer as
|
|
4
|
-
import { GraphContext as
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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: (
|
|
11
|
-
|
|
12
|
+
open: (n) => {
|
|
13
|
+
o(!0), p(n), m();
|
|
12
14
|
},
|
|
13
|
-
close: () =>
|
|
15
|
+
close: () => o(!1)
|
|
14
16
|
}));
|
|
15
|
-
const
|
|
16
|
-
|
|
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__ */
|
|
21
|
-
|
|
20
|
+
return /* @__PURE__ */ a(
|
|
21
|
+
D,
|
|
22
22
|
{
|
|
23
23
|
title: "知识卡片",
|
|
24
24
|
onClose: () => {
|
|
25
|
-
|
|
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__ */
|
|
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
|
-
|
|
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
|
+
};
|