@teambit/ui-foundation.ui.side-bar 0.0.491 → 0.0.496

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 (25) hide show
  1. package/__preview-1644176887286.js +1 -0
  2. package/component-tree/component-tree.tsx +19 -16
  3. package/component-tree/component-view/component-view.module.scss +1 -0
  4. package/component-tree/namespace-tree-node/namespace-tree-node.module.scss +5 -0
  5. package/component-tree/namespace-tree-node/namespace-tree-node.tsx +33 -10
  6. package/component-tree/scope-tree-node/scope-tree-node.module.scss +6 -1
  7. package/component-tree/scope-tree-node/scope-tree-node.tsx +37 -9
  8. package/dist/component-tree/component-tree.d.ts +4 -5
  9. package/dist/component-tree/component-tree.js +16 -7
  10. package/dist/component-tree/component-tree.js.map +1 -1
  11. package/dist/component-tree/component-view/component-view.d.ts +1 -0
  12. package/dist/component-tree/component-view/component-view.module.scss +1 -0
  13. package/dist/component-tree/default-tree-node-renderer/default-tree-node-renderer.d.ts +1 -0
  14. package/dist/component-tree/namespace-tree-node/namespace-tree-node.d.ts +4 -2
  15. package/dist/component-tree/namespace-tree-node/namespace-tree-node.js +26 -7
  16. package/dist/component-tree/namespace-tree-node/namespace-tree-node.js.map +1 -1
  17. package/dist/component-tree/namespace-tree-node/namespace-tree-node.module.scss +5 -0
  18. package/dist/component-tree/scope-tree-node/scope-tree-node.d.ts +4 -2
  19. package/dist/component-tree/scope-tree-node/scope-tree-node.js +27 -8
  20. package/dist/component-tree/scope-tree-node/scope-tree-node.js.map +1 -1
  21. package/dist/component-tree/scope-tree-node/scope-tree-node.module.scss +6 -1
  22. package/dist/overview-link/overview-link.d.ts +1 -0
  23. package/package-tar/teambit-ui-foundation.ui.side-bar-0.0.496.tgz +0 -0
  24. package/package.json +8 -7
  25. package/package-tar/teambit-ui-foundation.ui.side-bar-0.0.491.tgz +0 -0
@@ -0,0 +1 @@
1
+
@@ -1,26 +1,33 @@
1
1
  import { ComponentModel } from '@teambit/component';
2
2
  import React, { useMemo } from 'react';
3
- import { TreeContextProvider } from '@teambit/base-ui.graph.tree.tree-context';
3
+ import { useLocation } from '@teambit/base-ui.routing.routing-provider';
4
4
  import { indentStyle } from '@teambit/base-ui.graph.tree.indent';
5
5
  import { inflateToTree, attachPayload } from '@teambit/base-ui.graph.tree.inflate-paths';
6
- import { TreeNodeContext, TreeNodeRenderer } from '@teambit/base-ui.graph.tree.recursive-tree';
7
- import { RootNode } from '@teambit/base-ui.graph.tree.root-node';
6
+ import { Tree, TreeNodeRenderer } from '@teambit/design.ui.tree';
8
7
  import { PayloadType, ScopePayload } from './payload-type';
9
8
  import { DefaultTreeNodeRenderer } from './default-tree-node-renderer';
10
9
 
10
+ const componentIdUrlRegex = '[\\w\\/-]*[\\w-]';
11
+
11
12
  type ComponentTreeProps = {
12
- onSelect?: (id: string, event?: React.MouseEvent) => void;
13
- selected?: string;
14
13
  components: ComponentModel[];
15
14
  TreeNode?: TreeNodeRenderer<PayloadType>;
15
+ isCollapsed?: boolean;
16
16
  };
17
17
 
18
- export function ComponentTree({
19
- components,
20
- onSelect,
21
- selected,
22
- TreeNode = DefaultTreeNodeRenderer,
23
- }: ComponentTreeProps) {
18
+ export function ComponentTree({ components, isCollapsed, TreeNode = DefaultTreeNodeRenderer }: ComponentTreeProps) {
19
+ const { pathname } = useLocation();
20
+
21
+ const activeComponent = useMemo(() => {
22
+ const componentUrlRegex = new RegExp(componentIdUrlRegex);
23
+ const path = pathname?.startsWith('/') ? pathname.substring(1) : pathname;
24
+ const matcher = path.match(componentUrlRegex)?.[0]; // returns just the part that matches the componentId section without /~compositions etc.
25
+ const active = components.find((x) => {
26
+ return matcher && matcher === x.id.fullName;
27
+ });
28
+ return active?.id.toString({ ignoreVersion: true });
29
+ }, [components, pathname]);
30
+
24
31
  const rootNode = useMemo(() => {
25
32
  const tree = inflateToTree<ComponentModel, PayloadType>(components, (c) => c.id.toString({ ignoreVersion: true }));
26
33
 
@@ -33,11 +40,7 @@ export function ComponentTree({
33
40
 
34
41
  return (
35
42
  <div style={indentStyle(1)}>
36
- <TreeNodeContext.Provider value={TreeNode}>
37
- <TreeContextProvider onSelect={onSelect} selected={selected}>
38
- <RootNode node={rootNode} depth={1} />
39
- </TreeContextProvider>
40
- </TreeNodeContext.Provider>
43
+ <Tree TreeNode={TreeNode} activePath={activeComponent} tree={rootNode} isCollapsed={isCollapsed} />
41
44
  </div>
42
45
  );
43
46
  }
@@ -75,6 +75,7 @@
75
75
 
76
76
  .componentEnvTooltip {
77
77
  font-size: var(--bit-p-xs);
78
+ max-width: unset !important; // override tippy's default max-width: 350px
78
79
  .componentEnvTitle {
79
80
  font-size: var(--bit-p-xxs, 12px);
80
81
  color: #c9c3f6;
@@ -11,6 +11,7 @@
11
11
  font-size: inherit;
12
12
  padding-right: 8px;
13
13
  font-size: var(--bit-p-xs);
14
+ cursor: pointer;
14
15
  &:hover {
15
16
  background: var(--bit-bg-heavy, #f6f6f6);
16
17
  }
@@ -27,6 +28,10 @@
27
28
  }
28
29
  }
29
30
 
31
+ .highlighted {
32
+ color: var(--bit-accent-heavy, #5d4aec);
33
+ }
34
+
30
35
  .left {
31
36
  display: flex;
32
37
  align-items: center;
@@ -1,31 +1,54 @@
1
1
  import { Icon } from '@teambit/evangelist.elements.icon';
2
- import { clickable } from '@teambit/legacy/dist/to-eject/css-components/clickable';
3
2
  import classNames from 'classnames';
4
- import React, { useState } from 'react';
3
+ import React, { useState, useEffect, useRef } from 'react';
5
4
  import AnimateHeight from 'react-animate-height';
6
-
7
5
  import { indentClass, indentStyle } from '@teambit/base-ui.graph.tree.indent';
8
- import { TreeNodeProps, TreeLayer } from '@teambit/base-ui.graph.tree.recursive-tree';
6
+ import { useTree, TreeNodeProps, TreeLayer } from '@teambit/design.ui.tree';
9
7
  import { PayloadType } from '../payload-type';
10
8
  import { getName } from '../utils/get-name';
11
9
  import styles from './namespace-tree-node.module.scss';
12
10
 
13
- export function NamespaceTreeNode({ node, depth }: TreeNodeProps<PayloadType>) {
14
- const [collapsed, collapse] = useState(false);
11
+ export type NamespaceTreeNodeProps = {} & TreeNodeProps<PayloadType>;
15
12
 
16
- const displayName = getName(node.id.replace(/\/$/, ''));
13
+ export function NamespaceTreeNode({ node, depth }: NamespaceTreeNodeProps) {
14
+ const { isCollapsed, activePath } = useTree();
15
+ const isActive = activePath?.startsWith(node.id);
16
+
17
+ const initialOpen = isActive || !isCollapsed;
18
+ const [open, toggle] = useState<boolean | void>(initialOpen);
19
+
20
+ const firstRun = useRef(true);
21
+ useEffect(() => {
22
+ const current = firstRun.current;
23
+ if (current) return;
24
+ if (isActive === true) toggle(true);
25
+ }, [isActive]);
17
26
 
27
+ useEffect(() => {
28
+ if (firstRun.current) return;
29
+ toggle(!isCollapsed);
30
+ }, [isCollapsed]);
31
+
32
+ useEffect(() => {
33
+ firstRun.current = false;
34
+ }, []);
35
+
36
+ const displayName = getName(node.id.replace(/\/$/, ''));
37
+ const highlighted = !open && isActive;
18
38
  return (
19
39
  <div>
20
40
  {node.id && (
21
- <div className={classNames(indentClass, clickable, styles.namespace)} onClick={() => collapse(!collapsed)}>
41
+ <div
42
+ className={classNames(indentClass, styles.namespace, highlighted && styles.highlighted)}
43
+ onClick={() => toggle(!open)}
44
+ >
22
45
  <div className={styles.left}>
23
- <Icon className={classNames(styles.arrow, collapsed && styles.collapsed)} of="fat-arrow-down" />
46
+ <Icon className={classNames(styles.arrow, !open && styles.collapsed)} of="fat-arrow-down" />
24
47
  <span className={styles.name}>{displayName}</span>
25
48
  </div>
26
49
  </div>
27
50
  )}
28
- <AnimateHeight height={collapsed ? 0 : 'auto'}>
51
+ <AnimateHeight height={open ? 'auto' : 0}>
29
52
  <div style={indentStyle(depth + 1)} className={classNames(styles.componentTree)}>
30
53
  {node.children && <TreeLayer childNodes={node.children} depth={depth} />}
31
54
  </div>
@@ -1,12 +1,13 @@
1
1
  @import '~@teambit/base-ui.theme.colors/colors.module.scss';
2
2
 
3
- .namespace {
3
+ .scope {
4
4
  position: relative;
5
5
  height: 32px;
6
6
  display: flex;
7
7
  align-items: center;
8
8
  justify-content: space-between;
9
9
  user-select: none;
10
+ cursor: pointer;
10
11
  font-weight: bold;
11
12
  font-size: inherit;
12
13
  padding-right: 8px;
@@ -27,6 +28,10 @@
27
28
  }
28
29
  }
29
30
 
31
+ .highlighted {
32
+ color: var(--bit-accent-heavy, #5d4aec);
33
+ }
34
+
30
35
  .left {
31
36
  display: flex;
32
37
  align-items: center;
@@ -1,31 +1,59 @@
1
1
  import { Icon } from '@teambit/evangelist.elements.icon';
2
- import { clickable } from '@teambit/legacy/dist/to-eject/css-components/clickable';
3
2
  import classNames from 'classnames';
4
- import React, { useState } from 'react';
3
+ import React, { useState, useEffect, useRef } from 'react';
5
4
  import AnimateHeight from 'react-animate-height';
6
5
 
7
- import { indentClass, indentStyle } from '@teambit/base-ui.graph.tree.indent';
8
- import { TreeLayer, TreeNodeProps } from '@teambit/base-ui.graph.tree.recursive-tree';
6
+ import { indentClass, indentStyle, TreeNodeProps, TreeLayer, useTree } from '@teambit/design.ui.tree';
9
7
  import { PayloadType } from '../payload-type';
10
8
  import { getName } from '../utils/get-name';
11
9
  import styles from './scope-tree-node.module.scss';
12
10
 
13
- export function ScopeTreeNode({ node, depth }: TreeNodeProps<PayloadType>) {
14
- const [collapsed, collapse] = useState(false);
11
+ export type ScopeTreeNodeProps = {} & TreeNodeProps<PayloadType>;
12
+
13
+ export function ScopeTreeNode({ node, depth }: ScopeTreeNodeProps) {
14
+ const { isCollapsed, activePath } = useTree();
15
+ const isActive = activePath?.startsWith(node.id);
16
+
17
+ const initialOpen = isActive || !isCollapsed;
18
+
19
+ const [open, toggle] = useState<boolean | void>(initialOpen);
20
+
15
21
  const displayName = getName(node.id.replace(/\/$/, ''));
16
22
 
23
+ const firstRun = useRef(true);
24
+ useEffect(() => {
25
+ const current = firstRun.current;
26
+ if (current) return;
27
+ if (isActive === true) toggle(true);
28
+ }, [isActive]);
29
+
30
+ useEffect(() => {
31
+ const current = firstRun.current;
32
+ if (current) return;
33
+ toggle(!isCollapsed);
34
+ }, [isCollapsed]);
35
+
36
+ useEffect(() => {
37
+ firstRun.current = false;
38
+ }, []);
39
+
40
+ const highlighted = !open && isActive;
41
+
17
42
  return (
18
43
  <div>
19
44
  {node.id && (
20
- <div className={classNames(indentClass, clickable, styles.namespace)} onClick={() => collapse(!collapsed)}>
45
+ <div
46
+ className={classNames(indentClass, styles.scope, highlighted && styles.highlighted)}
47
+ onClick={() => toggle(!open)}
48
+ >
21
49
  <div className={styles.left}>
22
- <Icon className={classNames(styles.arrow, collapsed && styles.collapsed)} of="fat-arrow-down" />
50
+ <Icon className={classNames(styles.arrow, !open && styles.collapsed)} of="fat-arrow-down" />
23
51
  <Icon className={styles.arrow} of="collection-full" />
24
52
  <span className={styles.name}>{displayName}</span>
25
53
  </div>
26
54
  </div>
27
55
  )}
28
- <AnimateHeight height={collapsed ? 0 : 'auto'}>
56
+ <AnimateHeight height={open ? 'auto' : 0}>
29
57
  <div style={indentStyle(depth + 1)} className={classNames(styles.componentTree)}>
30
58
  {node.children && <TreeLayer childNodes={node.children} depth={depth + 1} />}
31
59
  </div>
@@ -1,12 +1,11 @@
1
+ /// <reference types="react" />
1
2
  import { ComponentModel } from '@teambit/component';
2
- import React from 'react';
3
- import { TreeNodeRenderer } from '@teambit/base-ui.graph.tree.recursive-tree';
3
+ import { TreeNodeRenderer } from '@teambit/design.ui.tree';
4
4
  import { PayloadType } from './payload-type';
5
5
  declare type ComponentTreeProps = {
6
- onSelect?: (id: string, event?: React.MouseEvent) => void;
7
- selected?: string;
8
6
  components: ComponentModel[];
9
7
  TreeNode?: TreeNodeRenderer<PayloadType>;
8
+ isCollapsed?: boolean;
10
9
  };
11
- export declare function ComponentTree({ components, onSelect, selected, TreeNode, }: ComponentTreeProps): JSX.Element;
10
+ export declare function ComponentTree({ components, isCollapsed, TreeNode }: ComponentTreeProps): JSX.Element;
12
11
  export {};
@@ -21,14 +21,25 @@ var __importStar = (this && this.__importStar) || function (mod) {
21
21
  Object.defineProperty(exports, "__esModule", { value: true });
22
22
  exports.ComponentTree = void 0;
23
23
  const react_1 = __importStar(require("react"));
24
- const base_ui_graph_tree_tree_context_1 = require("@teambit/base-ui.graph.tree.tree-context");
24
+ const base_ui_routing_routing_provider_1 = require("@teambit/base-ui.routing.routing-provider");
25
25
  const base_ui_graph_tree_indent_1 = require("@teambit/base-ui.graph.tree.indent");
26
26
  const base_ui_graph_tree_inflate_paths_1 = require("@teambit/base-ui.graph.tree.inflate-paths");
27
- const base_ui_graph_tree_recursive_tree_1 = require("@teambit/base-ui.graph.tree.recursive-tree");
28
- const base_ui_graph_tree_root_node_1 = require("@teambit/base-ui.graph.tree.root-node");
27
+ const design_ui_tree_1 = require("@teambit/design.ui.tree");
29
28
  const payload_type_1 = require("./payload-type");
30
29
  const default_tree_node_renderer_1 = require("./default-tree-node-renderer");
31
- function ComponentTree({ components, onSelect, selected, TreeNode = default_tree_node_renderer_1.DefaultTreeNodeRenderer, }) {
30
+ const componentIdUrlRegex = '[\\w\\/-]*[\\w-]';
31
+ function ComponentTree({ components, isCollapsed, TreeNode = default_tree_node_renderer_1.DefaultTreeNodeRenderer }) {
32
+ const { pathname } = (0, base_ui_routing_routing_provider_1.useLocation)();
33
+ const activeComponent = (0, react_1.useMemo)(() => {
34
+ var _a;
35
+ const componentUrlRegex = new RegExp(componentIdUrlRegex);
36
+ const path = (pathname === null || pathname === void 0 ? void 0 : pathname.startsWith('/')) ? pathname.substring(1) : pathname;
37
+ const matcher = (_a = path.match(componentUrlRegex)) === null || _a === void 0 ? void 0 : _a[0]; // returns just the part that matches the componentId section without /~compositions etc.
38
+ const active = components.find((x) => {
39
+ return matcher && matcher === x.id.fullName;
40
+ });
41
+ return active === null || active === void 0 ? void 0 : active.id.toString({ ignoreVersion: true });
42
+ }, [components, pathname]);
32
43
  const rootNode = (0, react_1.useMemo)(() => {
33
44
  const tree = (0, base_ui_graph_tree_inflate_paths_1.inflateToTree)(components, (c) => c.id.toString({ ignoreVersion: true }));
34
45
  const payloadMap = calcPayload(components);
@@ -36,9 +47,7 @@ function ComponentTree({ components, onSelect, selected, TreeNode = default_tree
36
47
  return tree;
37
48
  }, [components]);
38
49
  return (react_1.default.createElement("div", { style: (0, base_ui_graph_tree_indent_1.indentStyle)(1) },
39
- react_1.default.createElement(base_ui_graph_tree_recursive_tree_1.TreeNodeContext.Provider, { value: TreeNode },
40
- react_1.default.createElement(base_ui_graph_tree_tree_context_1.TreeContextProvider, { onSelect: onSelect, selected: selected },
41
- react_1.default.createElement(base_ui_graph_tree_root_node_1.RootNode, { node: rootNode, depth: 1 })))));
50
+ react_1.default.createElement(design_ui_tree_1.Tree, { TreeNode: TreeNode, activePath: activeComponent, tree: rootNode, isCollapsed: isCollapsed })));
42
51
  }
43
52
  exports.ComponentTree = ComponentTree;
44
53
  function calcPayload(components) {
@@ -1 +1 @@
1
- {"version":3,"file":"component-tree.js","sourceRoot":"","sources":["../../component-tree/component-tree.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AACA,+CAAuC;AACvC,8FAA+E;AAC/E,kFAAiE;AACjE,gGAAyF;AACzF,kGAA+F;AAC/F,wFAAiE;AACjE,iDAA2D;AAC3D,6EAAuE;AASvE,SAAgB,aAAa,CAAC,EAC5B,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,QAAQ,GAAG,oDAAuB,GACf;IACnB,MAAM,QAAQ,GAAG,IAAA,eAAO,EAAC,GAAG,EAAE;QAC5B,MAAM,IAAI,GAAG,IAAA,gDAAa,EAA8B,UAAU,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,QAAQ,CAAC,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QAEnH,MAAM,UAAU,GAAG,WAAW,CAAC,UAAU,CAAC,CAAC;QAE3C,IAAA,gDAAa,EAAC,IAAI,EAAE,UAAU,CAAC,CAAC;QAEhC,OAAO,IAAI,CAAC;IACd,CAA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U,CAAC,CAAC;QAE3C,IAAA,gDAAa,EAAC,IAAI,EAAE,UAAU,CAAC,CAAC;QAEhC,OAAO,IAAI,CAAC;IACd,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC;IAEjB,OAAO,CACL,uCAAK,KAAK,EAAE,IAAA,uCAAW,EAAC,CAAC,CAAC;QACxB,8BAAC,qBAAI,IAAC,QAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,eAAe,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,GAAI,CAC/F,CACP,CAAC;AACJ,CAAC;AA5BD,sCA4BC;AAED,SAAS,WAAW,CAAC,UAA4B;IAC/C,MAAM,UAAU,GAAG,IAAI,GAAG,CAAsB,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,QAAQ,CAAC,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IAEpH,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC/E,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,2BAAY,EAAE,CAAC,CAAC,CAAC;IAE1E,OAAO,UAAU,CAAC;AACpB,CAAC"}
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { ComponentTreeSlot } from '@teambit/component-tree';
2
3
  import { TreeNodeProps } from '@teambit/base-ui.graph.tree.recursive-tree';
3
4
  import { PayloadType } from '../payload-type';
@@ -75,6 +75,7 @@
75
75
 
76
76
  .componentEnvTooltip {
77
77
  font-size: var(--bit-p-xs);
78
+ max-width: unset !important; // override tippy's default max-width: 350px
78
79
  .componentEnvTitle {
79
80
  font-size: var(--bit-p-xxs, 12px);
80
81
  color: #c9c3f6;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import type { TreeNodeProps } from '@teambit/base-ui.graph.tree.recursive-tree';
2
3
  import { PayloadType } from '../payload-type';
3
4
  export declare function DefaultTreeNodeRenderer(props: TreeNodeProps<PayloadType>): JSX.Element;
@@ -1,3 +1,5 @@
1
- import { TreeNodeProps } from '@teambit/base-ui.graph.tree.recursive-tree';
1
+ /// <reference types="react" />
2
+ import { TreeNodeProps } from '@teambit/design.ui.tree';
2
3
  import { PayloadType } from '../payload-type';
3
- export declare function NamespaceTreeNode({ node, depth }: TreeNodeProps<PayloadType>): JSX.Element;
4
+ export declare type NamespaceTreeNodeProps = {} & TreeNodeProps<PayloadType>;
5
+ export declare function NamespaceTreeNode({ node, depth }: NamespaceTreeNodeProps): JSX.Element;
@@ -24,24 +24,43 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
24
24
  Object.defineProperty(exports, "__esModule", { value: true });
25
25
  exports.NamespaceTreeNode = void 0;
26
26
  const evangelist_elements_icon_1 = require("@teambit/evangelist.elements.icon");
27
- const clickable_1 = require("@teambit/legacy/dist/to-eject/css-components/clickable");
28
27
  const classnames_1 = __importDefault(require("classnames"));
29
28
  const react_1 = __importStar(require("react"));
30
29
  const react_animate_height_1 = __importDefault(require("react-animate-height"));
31
30
  const base_ui_graph_tree_indent_1 = require("@teambit/base-ui.graph.tree.indent");
32
- const base_ui_graph_tree_recursive_tree_1 = require("@teambit/base-ui.graph.tree.recursive-tree");
31
+ const design_ui_tree_1 = require("@teambit/design.ui.tree");
33
32
  const get_name_1 = require("../utils/get-name");
34
33
  const namespace_tree_node_module_scss_1 = __importDefault(require("./namespace-tree-node.module.scss"));
35
34
  function NamespaceTreeNode({ node, depth }) {
36
- const [collapsed, collapse] = (0, react_1.useState)(false);
35
+ const { isCollapsed, activePath } = (0, design_ui_tree_1.useTree)();
36
+ const isActive = activePath === null || activePath === void 0 ? void 0 : activePath.startsWith(node.id);
37
+ const initialOpen = isActive || !isCollapsed;
38
+ const [open, toggle] = (0, react_1.useState)(initialOpen);
39
+ const firstRun = (0, react_1.useRef)(true);
40
+ (0, react_1.useEffect)(() => {
41
+ const current = firstRun.current;
42
+ if (current)
43
+ return;
44
+ if (isActive === true)
45
+ toggle(true);
46
+ }, [isActive]);
47
+ (0, react_1.useEffect)(() => {
48
+ if (firstRun.current)
49
+ return;
50
+ toggle(!isCollapsed);
51
+ }, [isCollapsed]);
52
+ (0, react_1.useEffect)(() => {
53
+ firstRun.current = false;
54
+ }, []);
37
55
  const displayName = (0, get_name_1.getName)(node.id.replace(/\/$/, ''));
56
+ const highlighted = !open && isActive;
38
57
  return (react_1.default.createElement("div", null,
39
- node.id && (react_1.default.createElement("div", { className: (0, classnames_1.default)(base_ui_graph_tree_indent_1.indentClass, clickable_1.clickable, namespace_tree_node_module_scss_1.default.namespace), onClick: () => collapse(!collapsed) },
58
+ node.id && (react_1.default.createElement("div", { className: (0, classnames_1.default)(base_ui_graph_tree_indent_1.indentClass, namespace_tree_node_module_scss_1.default.namespace, highlighted && namespace_tree_node_module_scss_1.default.highlighted), onClick: () => toggle(!open) },
40
59
  react_1.default.createElement("div", { className: namespace_tree_node_module_scss_1.default.left },
41
- react_1.default.createElement(evangelist_elements_icon_1.Icon, { className: (0, classnames_1.default)(namespace_tree_node_module_scss_1.default.arrow, collapsed && namespace_tree_node_module_scss_1.default.collapsed), of: "fat-arrow-down" }),
60
+ react_1.default.createElement(evangelist_elements_icon_1.Icon, { className: (0, classnames_1.default)(namespace_tree_node_module_scss_1.default.arrow, !open && namespace_tree_node_module_scss_1.default.collapsed), of: "fat-arrow-down" }),
42
61
  react_1.default.createElement("span", { className: namespace_tree_node_module_scss_1.default.name }, displayName)))),
43
- react_1.default.createElement(react_animate_height_1.default, { height: collapsed ? 0 : 'auto' },
44
- react_1.default.createElement("div", { style: (0, base_ui_graph_tree_indent_1.indentStyle)(depth + 1), className: (0, classnames_1.default)(namespace_tree_node_module_scss_1.default.componentTree) }, node.children && react_1.default.createElement(base_ui_graph_tree_recursive_tree_1.TreeLayer, { childNodes: node.children, depth: depth })))));
62
+ react_1.default.createElement(react_animate_height_1.default, { height: open ? 'auto' : 0 },
63
+ react_1.default.createElement("div", { style: (0, base_ui_graph_tree_indent_1.indentStyle)(depth + 1), className: (0, classnames_1.default)(namespace_tree_node_module_scss_1.default.componentTree) }, node.children && react_1.default.createElement(design_ui_tree_1.TreeLayer, { childNodes: node.children, depth: depth })))));
45
64
  }
46
65
  exports.NamespaceTreeNode = NamespaceTreeNode;
47
66
  //# sourceMappingURL=namespace-tree-node.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"namespace-tree-node.js","sourceRoot":"","sources":["../../../component-tree/namespace-tree-node/namespace-tree-node.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gFAAyD;AACzD,sFAAmF;AACnF,4DAAoC;AACpC,+CAAwC;AACxC,gFAAiD;AAEjD,kFAA8E;AAC9E,kGAAsF;AAEtF,gDAA4C;AAC5C,wGAAuD;AAEvD,SAAgB,iBAAiB,CAAC,EAAE,IAAI,EAAE,KAAK,EAA8B;IAC3E,MAAM,CAAC,SAAS,EAAE,QAAQ,CAAC,GAAG,IAAA,gBAAQ,EAAC,KAAK,CAAC,CAAC;IAE9C,MAAM,WAAW,GAAG,IAAA,kBAAO,EAAC,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC;IAExD,OAAO,CACL;QACG,IAAI,CAAC,EAAE,IAAI,CACV,uCAAK,SAAS,EAAE,IAAA,oBAAU,EAAC,uCAAW,EAAE,qBAAS,EAAE,yCAAM,CAAC,SAAS,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,CA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AAC,SAAS,CAAC,EAAE,EAAE,EAAC,gBAAgB,GAAG;gBAC5F,wCAAM,SAAS,EAAE,yCAAM,CAAC,IAAI,IAAG,WAAW,CAAQ,CAC9C,CACF,CACP;QACD,8BAAC,8BAAa,IAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;YACtC,uCAAK,KAAK,EAAE,IAAA,uCAAW,EAAC,KAAK,GAAG,CAAC,CAAC,EAAE,SAAS,EAAE,IAAA,oBAAU,EAAC,yCAAM,CAAC,aAAa,CAAC,IAC5E,IAAI,CAAC,QAAQ,IAAI,8BAAC,0BAAS,IAAC,UAAU,EAAE,IAAI,CAAC,QAAQ,EAAE,KAAK,EAAE,KAAK,GAAI,CACpE,CACQ,CACZ,CACP,CAAC;AACJ,CAAC;AA7CD,8CA6CC"}
@@ -11,6 +11,7 @@
11
11
  font-size: inherit;
12
12
  padding-right: 8px;
13
13
  font-size: var(--bit-p-xs);
14
+ cursor: pointer;
14
15
  &:hover {
15
16
  background: var(--bit-bg-heavy, #f6f6f6);
16
17
  }
@@ -27,6 +28,10 @@
27
28
  }
28
29
  }
29
30
 
31
+ .highlighted {
32
+ color: var(--bit-accent-heavy, #5d4aec);
33
+ }
34
+
30
35
  .left {
31
36
  display: flex;
32
37
  align-items: center;
@@ -1,3 +1,5 @@
1
- import { TreeNodeProps } from '@teambit/base-ui.graph.tree.recursive-tree';
1
+ /// <reference types="react" />
2
+ import { TreeNodeProps } from '@teambit/design.ui.tree';
2
3
  import { PayloadType } from '../payload-type';
3
- export declare function ScopeTreeNode({ node, depth }: TreeNodeProps<PayloadType>): JSX.Element;
4
+ export declare type ScopeTreeNodeProps = {} & TreeNodeProps<PayloadType>;
5
+ export declare function ScopeTreeNode({ node, depth }: ScopeTreeNodeProps): JSX.Element;
@@ -24,25 +24,44 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
24
24
  Object.defineProperty(exports, "__esModule", { value: true });
25
25
  exports.ScopeTreeNode = void 0;
26
26
  const evangelist_elements_icon_1 = require("@teambit/evangelist.elements.icon");
27
- const clickable_1 = require("@teambit/legacy/dist/to-eject/css-components/clickable");
28
27
  const classnames_1 = __importDefault(require("classnames"));
29
28
  const react_1 = __importStar(require("react"));
30
29
  const react_animate_height_1 = __importDefault(require("react-animate-height"));
31
- const base_ui_graph_tree_indent_1 = require("@teambit/base-ui.graph.tree.indent");
32
- const base_ui_graph_tree_recursive_tree_1 = require("@teambit/base-ui.graph.tree.recursive-tree");
30
+ const design_ui_tree_1 = require("@teambit/design.ui.tree");
33
31
  const get_name_1 = require("../utils/get-name");
34
32
  const scope_tree_node_module_scss_1 = __importDefault(require("./scope-tree-node.module.scss"));
35
33
  function ScopeTreeNode({ node, depth }) {
36
- const [collapsed, collapse] = (0, react_1.useState)(false);
34
+ const { isCollapsed, activePath } = (0, design_ui_tree_1.useTree)();
35
+ const isActive = activePath === null || activePath === void 0 ? void 0 : activePath.startsWith(node.id);
36
+ const initialOpen = isActive || !isCollapsed;
37
+ const [open, toggle] = (0, react_1.useState)(initialOpen);
37
38
  const displayName = (0, get_name_1.getName)(node.id.replace(/\/$/, ''));
39
+ const firstRun = (0, react_1.useRef)(true);
40
+ (0, react_1.useEffect)(() => {
41
+ const current = firstRun.current;
42
+ if (current)
43
+ return;
44
+ if (isActive === true)
45
+ toggle(true);
46
+ }, [isActive]);
47
+ (0, react_1.useEffect)(() => {
48
+ const current = firstRun.current;
49
+ if (current)
50
+ return;
51
+ toggle(!isCollapsed);
52
+ }, [isCollapsed]);
53
+ (0, react_1.useEffect)(() => {
54
+ firstRun.current = false;
55
+ }, []);
56
+ const highlighted = !open && isActive;
38
57
  return (react_1.default.createElement("div", null,
39
- node.id && (react_1.default.createElement("div", { className: (0, classnames_1.default)(base_ui_graph_tree_indent_1.indentClass, clickable_1.clickable, scope_tree_node_module_scss_1.default.namespace), onClick: () => collapse(!collapsed) },
58
+ node.id && (react_1.default.createElement("div", { className: (0, classnames_1.default)(design_ui_tree_1.indentClass, scope_tree_node_module_scss_1.default.scope, highlighted && scope_tree_node_module_scss_1.default.highlighted), onClick: () => toggle(!open) },
40
59
  react_1.default.createElement("div", { className: scope_tree_node_module_scss_1.default.left },
41
- react_1.default.createElement(evangelist_elements_icon_1.Icon, { className: (0, classnames_1.default)(scope_tree_node_module_scss_1.default.arrow, collapsed && scope_tree_node_module_scss_1.default.collapsed), of: "fat-arrow-down" }),
60
+ react_1.default.createElement(evangelist_elements_icon_1.Icon, { className: (0, classnames_1.default)(scope_tree_node_module_scss_1.default.arrow, !open && scope_tree_node_module_scss_1.default.collapsed), of: "fat-arrow-down" }),
42
61
  react_1.default.createElement(evangelist_elements_icon_1.Icon, { className: scope_tree_node_module_scss_1.default.arrow, of: "collection-full" }),
43
62
  react_1.default.createElement("span", { className: scope_tree_node_module_scss_1.default.name }, displayName)))),
44
- react_1.default.createElement(react_animate_height_1.default, { height: collapsed ? 0 : 'auto' },
45
- react_1.default.createElement("div", { style: (0, base_ui_graph_tree_indent_1.indentStyle)(depth + 1), className: (0, classnames_1.default)(scope_tree_node_module_scss_1.default.componentTree) }, node.children && react_1.default.createElement(base_ui_graph_tree_recursive_tree_1.TreeLayer, { childNodes: node.children, depth: depth + 1 })))));
63
+ react_1.default.createElement(react_animate_height_1.default, { height: open ? 'auto' : 0 },
64
+ react_1.default.createElement("div", { style: (0, design_ui_tree_1.indentStyle)(depth + 1), className: (0, classnames_1.default)(scope_tree_node_module_scss_1.default.componentTree) }, node.children && react_1.default.createElement(design_ui_tree_1.TreeLayer, { childNodes: node.children, depth: depth + 1 })))));
46
65
  }
47
66
  exports.ScopeTreeNode = ScopeTreeNode;
48
67
  //# sourceMappingURL=scope-tree-node.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"scope-tree-node.js","sourceRoot":"","sources":["../../../component-tree/scope-tree-node/scope-tree-node.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gFAAyD;AACzD,sFAAmF;AACnF,4D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CAAC,GAAI,CACxE,CACQ,CACZ,CACP,CAAC;AACJ,CAAC;AAlDD,sCAkDC"}
@@ -1,12 +1,13 @@
1
1
  @import '~@teambit/base-ui.theme.colors/colors.module.scss';
2
2
 
3
- .namespace {
3
+ .scope {
4
4
  position: relative;
5
5
  height: 32px;
6
6
  display: flex;
7
7
  align-items: center;
8
8
  justify-content: space-between;
9
9
  user-select: none;
10
+ cursor: pointer;
10
11
  font-weight: bold;
11
12
  font-size: inherit;
12
13
  padding-right: 8px;
@@ -27,6 +28,10 @@
27
28
  }
28
29
  }
29
30
 
31
+ .highlighted {
32
+ color: var(--bit-accent-heavy, #5d4aec);
33
+ }
34
+
30
35
  .left {
31
36
  display: flex;
32
37
  align-items: center;
@@ -1 +1,2 @@
1
+ /// <reference types="react" />
1
2
  export declare function OverviewLink(): JSX.Element;
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@teambit/ui-foundation.ui.side-bar",
3
- "version": "0.0.491",
3
+ "version": "0.0.496",
4
4
  "homepage": "https://bit.dev/teambit/ui-foundation/ui/side-bar",
5
5
  "main": "dist/index.js",
6
6
  "componentId": {
7
7
  "scope": "teambit.ui-foundation",
8
8
  "name": "ui/side-bar",
9
- "version": "0.0.491"
9
+ "version": "0.0.496"
10
10
  },
11
11
  "dependencies": {
12
12
  "classnames": "2.2.6",
@@ -14,14 +14,15 @@
14
14
  "core-js": "^3.0.0",
15
15
  "@teambit/base-ui.graph.tree.indent": "1.0.0",
16
16
  "@teambit/base-ui.graph.tree.inflate-paths": "1.0.0",
17
- "@teambit/base-ui.graph.tree.recursive-tree": "1.0.0",
18
- "@teambit/base-ui.graph.tree.root-node": "1.0.0",
19
- "@teambit/base-ui.graph.tree.tree-context": "1.0.0",
17
+ "@teambit/base-ui.routing.routing-provider": "1.0.0",
20
18
  "@teambit/base-ui.routing.nav-link": "1.0.0",
21
- "@teambit/evangelist.elements.icon": "1.0.2",
22
19
  "@teambit/documenter.ui.separator": "4.1.1",
20
+ "@teambit/evangelist.elements.icon": "1.0.2",
21
+ "@teambit/base-ui.graph.tree.recursive-tree": "1.0.0",
23
22
  "@teambit/base-ui.theme.colors": "1.0.0",
24
- "@teambit/component.ui.deprecation-icon": "0.0.491",
23
+ "@teambit/base-ui.graph.tree.tree-context": "1.0.0",
24
+ "@teambit/design.ui.tree": "0.0.5",
25
+ "@teambit/component.ui.deprecation-icon": "0.0.492",
25
26
  "@teambit/design.ui.tooltip": "0.0.352",
26
27
  "@teambit/envs.ui.env-icon": "0.0.485"
27
28
  },