@box/tree 0.41.7 → 0.41.8
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/esm/index.js
CHANGED
|
@@ -1,23 +1,8 @@
|
|
|
1
|
-
import "
|
|
2
|
-
import "
|
|
3
|
-
import "
|
|
4
|
-
import "react-intl";
|
|
5
|
-
import "@box/blueprint-web-assets/icons/Fill";
|
|
6
|
-
import "./lib/components/expander/messages.js";
|
|
7
|
-
import "react/jsx-runtime";
|
|
8
|
-
import "@box/blueprint-web-assets/tokens/px-tokens";
|
|
9
|
-
import "@box/item-icon";
|
|
10
|
-
import "./lib/components/node-icon/messages.js";
|
|
11
|
-
import "./lib/components/content-node/messages.js";
|
|
12
|
-
import { Error as b } from "./lib/components/error/error.js";
|
|
13
|
-
import "./lib/components/load-more-node/messages.js";
|
|
14
|
-
import "./lib/components/loading-node/messages.js";
|
|
15
|
-
import "@box/blueprint-web-assets/icons/Line";
|
|
16
|
-
import "./lib/components/reload-node/messages.js";
|
|
17
|
-
import { Skeleton as d } from "./lib/components/skeleton/skeleton.js";
|
|
18
|
-
import { Tree as h } from "./lib/tree.js";
|
|
1
|
+
import { Tree as o } from "./lib/tree.js";
|
|
2
|
+
import { Error as f } from "./lib/components/error/error.js";
|
|
3
|
+
import { Skeleton as p } from "./lib/components/skeleton/skeleton.js";
|
|
19
4
|
export {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
5
|
+
o as Tree,
|
|
6
|
+
f as TreeError,
|
|
7
|
+
p as TreeSkeleton
|
|
23
8
|
};
|
|
@@ -3,14 +3,14 @@ import d from "clsx";
|
|
|
3
3
|
import { useRef as f, useMemo as j } from "react";
|
|
4
4
|
import { useIntl as k } from "react-intl";
|
|
5
5
|
import { CONTENT_NODE as A, CONTENT_NODE_LOADING as M } from "../../constants.js";
|
|
6
|
-
import { useIntersectionObserver as S } from "../../hooks/useIntersectionObserver.js";
|
|
7
|
-
import { Expander as G } from "../expander/expander.js";
|
|
8
|
-
import { NodeAvatar as P } from "../node-icon/node-avatar.js";
|
|
9
|
-
import { NodeItemIcon as B } from "../node-icon/node-item-icon.js";
|
|
10
|
-
import { TruncatedTooltipText as F } from "../truncated-tooltip-text/truncated-tooltip-text.js";
|
|
11
6
|
import { s as e } from "../../../../chunks/nodes.module.js";
|
|
12
|
-
import
|
|
7
|
+
import S from "./messages.js";
|
|
13
8
|
import { jsxs as a, jsx as n } from "react/jsx-runtime";
|
|
9
|
+
import { useIntersectionObserver as G } from "../../hooks/useIntersectionObserver.js";
|
|
10
|
+
import { Expander as P } from "../expander/expander.js";
|
|
11
|
+
import { NodeItemIcon as B } from "../node-icon/node-item-icon.js";
|
|
12
|
+
import { NodeAvatar as F } from "../node-icon/node-avatar.js";
|
|
13
|
+
import { TruncatedTooltipText as H } from "../truncated-tooltip-text/truncated-tooltip-text.js";
|
|
14
14
|
import '../../../../styles/content-node.css';const J = "_loader_yqihr_1", K = "_content_yqihr_9", Q = "_title_yqihr_15", U = "_subtitle_yqihr_68", V = "_tooltip_yqihr_84", r = {
|
|
15
15
|
loader: J,
|
|
16
16
|
content: K,
|
|
@@ -46,7 +46,7 @@ function se({
|
|
|
46
46
|
variant: b
|
|
47
47
|
} = t, i = j(() => m({
|
|
48
48
|
onClick: u
|
|
49
|
-
}), [m, u]), w =
|
|
49
|
+
}), [m, u]), w = G(v), x = !c && !_ && C, E = {
|
|
50
50
|
[`data-${A}`]: !0,
|
|
51
51
|
[`data-${M}`]: g
|
|
52
52
|
}, L = /* @__PURE__ */ a("div", {
|
|
@@ -62,10 +62,10 @@ function se({
|
|
|
62
62
|
children: [q && /* @__PURE__ */ n("div", {
|
|
63
63
|
className: d(e.expander, e[`expander-level${p - 1}`], e[`expander-${o}`]),
|
|
64
64
|
children: g ? /* @__PURE__ */ n(D, {
|
|
65
|
-
"aria-label": O.formatMessage(
|
|
65
|
+
"aria-label": O.formatMessage(S.branchContentLoaderLabel),
|
|
66
66
|
className: r.loader,
|
|
67
67
|
size: o === "small" ? "small" : "medium"
|
|
68
|
-
}) : /* @__PURE__ */ n(
|
|
68
|
+
}) : /* @__PURE__ */ n(P, {
|
|
69
69
|
dataTargetId: t != null && t.dataTargetId ? `${t.dataTargetId}:${_ ? "collapse" : "expand"}` : void 0,
|
|
70
70
|
disabled: c,
|
|
71
71
|
expanded: _,
|
|
@@ -77,7 +77,7 @@ function se({
|
|
|
77
77
|
children: [N && b === "content" && /* @__PURE__ */ n(B, {
|
|
78
78
|
iconType: t.iconType,
|
|
79
79
|
size: o
|
|
80
|
-
}), N && b === "user" && /* @__PURE__ */ n(
|
|
80
|
+
}), N && b === "user" && /* @__PURE__ */ n(F, {
|
|
81
81
|
avatarSrc: t.avatarSrc,
|
|
82
82
|
badge: t.badge,
|
|
83
83
|
nodeTitle: s,
|
|
@@ -112,7 +112,7 @@ function se({
|
|
|
112
112
|
return /* @__PURE__ */ n("div", {
|
|
113
113
|
ref: v,
|
|
114
114
|
...E,
|
|
115
|
-
children: w ? R : /* @__PURE__ */ n(
|
|
115
|
+
children: w ? R : /* @__PURE__ */ n(H, {
|
|
116
116
|
subtitleElementRef: $,
|
|
117
117
|
textElementRef: T,
|
|
118
118
|
tooltipContent: /* @__PURE__ */ a("div", {
|
package/dist/esm/lib/tree.js
CHANGED
|
@@ -2,23 +2,18 @@ import { TooltipProvider as L } from "@box/blueprint-web";
|
|
|
2
2
|
import g from "clsx";
|
|
3
3
|
import { useRef as h, useEffect as c, useCallback as w } from "react";
|
|
4
4
|
import S from "react-accessible-treeview";
|
|
5
|
-
import {
|
|
6
|
-
import "react-intl";
|
|
7
|
-
import "@box/blueprint-web-assets/icons/Fill";
|
|
8
|
-
import "@box/blueprint-web-assets/illustrations/Medium";
|
|
9
|
-
import "./components/error/messages.js";
|
|
5
|
+
import { preventDisabledNodeExpanding as p, preventLoadingContentNodeExpanding as v, serviceNodeKeyboardHandler as D, serviceNodeClickHandler as x } from "./utils.js";
|
|
10
6
|
import { jsx as t } from "react/jsx-runtime";
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import { ReloadNode as M } from "./components/reload-node/reload-node.js";
|
|
7
|
+
import { useSelectionInheritance as C } from "./hooks/useSelectionInheritance.js";
|
|
8
|
+
import { ContentNode as M } from "./components/content-node/content-node.js";
|
|
14
9
|
import { ServiceNodeWrapper as m } from "./components/service-node-wrapper/service-node-wrapper.js";
|
|
15
|
-
import "
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
10
|
+
import { LoadMoreNode as R } from "./components/load-more-node/load-more-node.js";
|
|
11
|
+
import { ReloadNode as H } from "./components/reload-node/reload-node.js";
|
|
12
|
+
import { LoadingNode as T } from "./components/loading-node/loading-node.js";
|
|
18
13
|
import '../../styles/tree.css';const _ = "_tree_17956_1", K = {
|
|
19
14
|
tree: _
|
|
20
15
|
};
|
|
21
|
-
function
|
|
16
|
+
function U({
|
|
22
17
|
"aria-label": u,
|
|
23
18
|
size: o = "small",
|
|
24
19
|
data: i,
|
|
@@ -33,14 +28,14 @@ function z({
|
|
|
33
28
|
const s = h(null), {
|
|
34
29
|
selectionInheritors: y,
|
|
35
30
|
getSelectionInheritors: d
|
|
36
|
-
} =
|
|
31
|
+
} = C();
|
|
37
32
|
c(() => {
|
|
38
33
|
const e = s.current;
|
|
39
34
|
return e && (e.addEventListener("keydown", p), e.addEventListener("keydown", v)), () => {
|
|
40
35
|
e && (e.removeEventListener("keydown", p), e.removeEventListener("keydown", v));
|
|
41
36
|
};
|
|
42
37
|
}), c(() => {
|
|
43
|
-
const e = s.current, n =
|
|
38
|
+
const e = s.current, n = D(f), r = x(f);
|
|
44
39
|
return e && (e.addEventListener("keydown", n), e.addEventListener("click", r)), () => {
|
|
45
40
|
e && (e.removeEventListener("keydown", n), e.removeEventListener("click", r));
|
|
46
41
|
};
|
|
@@ -67,7 +62,7 @@ function z({
|
|
|
67
62
|
size: o,
|
|
68
63
|
withIcon: b
|
|
69
64
|
};
|
|
70
|
-
return /* @__PURE__ */ t(
|
|
65
|
+
return /* @__PURE__ */ t(M, {
|
|
71
66
|
...r,
|
|
72
67
|
containsSelection: y.includes(e.element.id)
|
|
73
68
|
});
|
|
@@ -81,7 +76,7 @@ function z({
|
|
|
81
76
|
isDisabled: e.isDisabled,
|
|
82
77
|
parentId: e.element.parent,
|
|
83
78
|
variant: "loadMore",
|
|
84
|
-
children: /* @__PURE__ */ t(
|
|
79
|
+
children: /* @__PURE__ */ t(R, {
|
|
85
80
|
...r
|
|
86
81
|
})
|
|
87
82
|
});
|
|
@@ -95,7 +90,7 @@ function z({
|
|
|
95
90
|
isDisabled: e.isDisabled,
|
|
96
91
|
parentId: e.element.parent,
|
|
97
92
|
variant: "reload",
|
|
98
|
-
children: /* @__PURE__ */ t(
|
|
93
|
+
children: /* @__PURE__ */ t(H, {
|
|
99
94
|
...r
|
|
100
95
|
})
|
|
101
96
|
});
|
|
@@ -108,7 +103,7 @@ function z({
|
|
|
108
103
|
return /* @__PURE__ */ t(m, {
|
|
109
104
|
isDisabled: e.isDisabled,
|
|
110
105
|
variant: "loading",
|
|
111
|
-
children: /* @__PURE__ */ t(
|
|
106
|
+
children: /* @__PURE__ */ t(T, {
|
|
112
107
|
...r
|
|
113
108
|
})
|
|
114
109
|
});
|
|
@@ -122,6 +117,6 @@ function z({
|
|
|
122
117
|
});
|
|
123
118
|
}
|
|
124
119
|
export {
|
|
125
|
-
|
|
126
|
-
|
|
120
|
+
U as Tree,
|
|
121
|
+
U as default
|
|
127
122
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@box/tree",
|
|
3
|
-
"version": "0.41.
|
|
3
|
+
"version": "0.41.8",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@box/blueprint-web": "^7.11.0",
|
|
6
6
|
"@box/blueprint-web-assets": "^4.16.0",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"devDependencies": {
|
|
14
14
|
"@box/blueprint-web": "^10.4.0",
|
|
15
15
|
"@box/blueprint-web-assets": "^4.39.0",
|
|
16
|
-
"@box/item-icon": "^0.
|
|
16
|
+
"@box/item-icon": "^0.9.108",
|
|
17
17
|
"@box/storybook-utils": "^0.9.0",
|
|
18
18
|
"@faker-js/faker": "^8.4.1",
|
|
19
19
|
"react": "^18.3.0",
|