@atlaskit/side-navigation 11.1.12 → 11.1.14
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/CHANGELOG.md +16 -0
- package/dist/cjs/common/use-child-ids-effect.js +24 -0
- package/dist/cjs/common/use-child-ids.js +23 -0
- package/dist/cjs/components/Footer/index.js +4 -4
- package/dist/cjs/components/Header/header-container.js +53 -0
- package/dist/cjs/components/Header/index.js +5 -48
- package/dist/cjs/components/NestableNavigationContent/index.js +4 -4
- package/dist/cjs/components/NestingItem/index.js +8 -6
- package/dist/cjs/index.js +33 -18
- package/dist/es2019/common/use-child-ids-effect.js +18 -0
- package/dist/es2019/common/use-child-ids.js +17 -0
- package/dist/es2019/components/Footer/index.js +3 -3
- package/dist/es2019/components/Header/header-container.js +44 -0
- package/dist/es2019/components/Header/index.js +3 -44
- package/dist/es2019/components/NestableNavigationContent/index.js +2 -2
- package/dist/es2019/components/NestingItem/index.js +4 -2
- package/dist/es2019/index.js +15 -1
- package/dist/esm/common/use-child-ids-effect.js +18 -0
- package/dist/esm/common/use-child-ids.js +17 -0
- package/dist/esm/components/Footer/index.js +3 -3
- package/dist/esm/components/Header/header-container.js +46 -0
- package/dist/esm/components/Header/index.js +3 -46
- package/dist/esm/components/NestableNavigationContent/index.js +2 -2
- package/dist/esm/components/NestingItem/index.js +4 -2
- package/dist/esm/index.js +15 -1
- package/dist/types/common/use-child-ids-effect.d.ts +3 -0
- package/dist/types/common/use-child-ids.d.ts +5 -0
- package/dist/types/components/Header/header-container.d.ts +8 -0
- package/dist/types/components/Header/index.d.ts +0 -6
- package/dist/types/index.d.ts +30 -2
- package/dist/types-ts4.5/common/use-child-ids-effect.d.ts +3 -0
- package/dist/types-ts4.5/common/use-child-ids.d.ts +5 -0
- package/dist/types-ts4.5/components/Header/header-container.d.ts +8 -0
- package/dist/types-ts4.5/components/Header/index.d.ts +0 -6
- package/dist/types-ts4.5/index.d.ts +30 -2
- package/package.json +9 -1
- package/dist/cjs/components/Item/index.js +0 -41
- package/dist/cjs/components/NestingItem/hack-for-ert.js +0 -8
- package/dist/cjs/components/index.js +0 -119
- package/dist/cjs/components/utils/hooks.js +0 -38
- package/dist/es2019/components/Item/index.js +0 -5
- package/dist/es2019/components/NestingItem/hack-for-ert.js +0 -2
- package/dist/es2019/components/index.js +0 -11
- package/dist/es2019/components/utils/hooks.js +0 -32
- package/dist/esm/components/Item/index.js +0 -5
- package/dist/esm/components/NestingItem/hack-for-ert.js +0 -2
- package/dist/esm/components/index.js +0 -11
- package/dist/esm/components/utils/hooks.js +0 -32
- package/dist/types/components/Item/index.d.ts +0 -10
- package/dist/types/components/NestingItem/hack-for-ert.d.ts +0 -2
- package/dist/types/components/index.d.ts +0 -22
- package/dist/types/components/utils/hooks.d.ts +0 -5
- package/dist/types-ts4.5/components/Item/index.d.ts +0 -10
- package/dist/types-ts4.5/components/NestingItem/hack-for-ert.d.ts +0 -2
- package/dist/types-ts4.5/components/index.d.ts +0 -22
- package/dist/types-ts4.5/components/utils/hooks.d.ts +0 -5
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { useEffect, useRef } from 'react';
|
|
2
|
-
import { ROOT_ID } from '../NestableNavigationContent';
|
|
3
|
-
export const useChildIds = (currentStackId, committedStack, onUnknownNest) => {
|
|
4
|
-
const childIdsRef = useRef(new Set());
|
|
5
|
-
useEffect(() => {
|
|
6
|
-
// we are holding navigation item IDs in childIdsRef
|
|
7
|
-
// check if the current displayed nav item (currentStackId) is in childIdsRef. if it's not, this means it's undefined
|
|
8
|
-
if (currentStackId === ROOT_ID || !childIdsRef.current.size || childIdsRef.current.has(currentStackId) || !onUnknownNest) {
|
|
9
|
-
return;
|
|
10
|
-
}
|
|
11
|
-
onUnknownNest(committedStack || [currentStackId]);
|
|
12
|
-
}, [currentStackId, committedStack, onUnknownNest]);
|
|
13
|
-
return {
|
|
14
|
-
childIdsRef
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
export const useChildIdsEffect = (childIds, id) => {
|
|
18
|
-
useEffect(() => {
|
|
19
|
-
if (!childIds || !childIds.current) {
|
|
20
|
-
return;
|
|
21
|
-
}
|
|
22
|
-
if (!childIds.current.has(id)) {
|
|
23
|
-
childIds.current.add(id);
|
|
24
|
-
}
|
|
25
|
-
return () => {
|
|
26
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
27
|
-
childIds.current.delete(id);
|
|
28
|
-
};
|
|
29
|
-
// childIds shouldn't change as it's a ref
|
|
30
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
31
|
-
}, [id]);
|
|
32
|
-
};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export { default as ButtonItem } from './button-item';
|
|
2
|
-
export { default as CustomItem } from './custom-item';
|
|
3
|
-
export { default as GoBackItem } from './go-back-item';
|
|
4
|
-
export { default as LinkItem } from './link-item';
|
|
5
|
-
export { default as SkeletonItem } from './skeleton-item';
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export { default as SideNavigation } from './SideNavigation';
|
|
2
|
-
export { Section, HeadingItem, SkeletonHeadingItem } from './Section';
|
|
3
|
-
export { default as NestingItem } from './NestingItem';
|
|
4
|
-
export { default as NavigationContent } from './NavigationContent';
|
|
5
|
-
export { ButtonItem, GoBackItem, LinkItem, CustomItem, SkeletonItem } from './Item';
|
|
6
|
-
export { default as Footer } from './Footer';
|
|
7
|
-
export { default as Header } from './Header';
|
|
8
|
-
export { default as NavigationHeader } from './NavigationHeader';
|
|
9
|
-
export { default as NavigationFooter } from './NavigationFooter';
|
|
10
|
-
export { default as LoadingItems } from './LoadingItems';
|
|
11
|
-
export { default as NestableNavigationContent } from './NestableNavigationContent';
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { useEffect, useRef } from 'react';
|
|
2
|
-
import { ROOT_ID } from '../NestableNavigationContent';
|
|
3
|
-
export var useChildIds = function useChildIds(currentStackId, committedStack, onUnknownNest) {
|
|
4
|
-
var childIdsRef = useRef(new Set());
|
|
5
|
-
useEffect(function () {
|
|
6
|
-
// we are holding navigation item IDs in childIdsRef
|
|
7
|
-
// check if the current displayed nav item (currentStackId) is in childIdsRef. if it's not, this means it's undefined
|
|
8
|
-
if (currentStackId === ROOT_ID || !childIdsRef.current.size || childIdsRef.current.has(currentStackId) || !onUnknownNest) {
|
|
9
|
-
return;
|
|
10
|
-
}
|
|
11
|
-
onUnknownNest(committedStack || [currentStackId]);
|
|
12
|
-
}, [currentStackId, committedStack, onUnknownNest]);
|
|
13
|
-
return {
|
|
14
|
-
childIdsRef: childIdsRef
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
export var useChildIdsEffect = function useChildIdsEffect(childIds, id) {
|
|
18
|
-
useEffect(function () {
|
|
19
|
-
if (!childIds || !childIds.current) {
|
|
20
|
-
return;
|
|
21
|
-
}
|
|
22
|
-
if (!childIds.current.has(id)) {
|
|
23
|
-
childIds.current.add(id);
|
|
24
|
-
}
|
|
25
|
-
return function () {
|
|
26
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
27
|
-
childIds.current.delete(id);
|
|
28
|
-
};
|
|
29
|
-
// childIds shouldn't change as it's a ref
|
|
30
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
31
|
-
}, [id]);
|
|
32
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export { default as ButtonItem } from './button-item';
|
|
2
|
-
export type { ButtonItemProps } from './button-item';
|
|
3
|
-
export { default as CustomItem } from './custom-item';
|
|
4
|
-
export type { CustomItemProps, CustomItemComponentProps } from './custom-item';
|
|
5
|
-
export { default as GoBackItem } from './go-back-item';
|
|
6
|
-
export type { GoBackItemProps } from './go-back-item';
|
|
7
|
-
export { default as LinkItem } from './link-item';
|
|
8
|
-
export type { LinkItemProps } from './link-item';
|
|
9
|
-
export { default as SkeletonItem } from './skeleton-item';
|
|
10
|
-
export type { SkeletonItemProps } from './skeleton-item';
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
export { default as SideNavigation } from './SideNavigation';
|
|
2
|
-
export type { SideNavigationProps } from './SideNavigation';
|
|
3
|
-
export { Section, HeadingItem, SkeletonHeadingItem } from './Section';
|
|
4
|
-
export type { HeadingItemProps, SectionProps, SkeletonHeadingItemProps } from './Section';
|
|
5
|
-
export { default as NestingItem } from './NestingItem';
|
|
6
|
-
export type { NestingItemProps } from './NestingItem';
|
|
7
|
-
export { default as NavigationContent } from './NavigationContent';
|
|
8
|
-
export type { NavigationContentProps } from './NavigationContent';
|
|
9
|
-
export { ButtonItem, GoBackItem, LinkItem, CustomItem, SkeletonItem } from './Item';
|
|
10
|
-
export type { CustomItemComponentProps, CustomItemProps, ButtonItemProps, GoBackItemProps, LinkItemProps, SkeletonItemProps, } from './Item';
|
|
11
|
-
export { default as Footer } from './Footer';
|
|
12
|
-
export type { FooterProps } from './Footer';
|
|
13
|
-
export { default as Header } from './Header';
|
|
14
|
-
export type { HeaderProps } from './Header';
|
|
15
|
-
export { default as NavigationHeader } from './NavigationHeader';
|
|
16
|
-
export type { NavigationHeaderProps } from './NavigationHeader';
|
|
17
|
-
export { default as NavigationFooter } from './NavigationFooter';
|
|
18
|
-
export type { NavigationFooterProps } from './NavigationFooter';
|
|
19
|
-
export { default as LoadingItems } from './LoadingItems';
|
|
20
|
-
export type { LoadingItemsProps } from './LoadingItems';
|
|
21
|
-
export { default as NestableNavigationContent } from './NestableNavigationContent';
|
|
22
|
-
export type { NestableNavigationContentProps } from './NestableNavigationContent';
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { type MutableRefObject } from 'react';
|
|
2
|
-
export declare const useChildIds: (currentStackId: string, committedStack: string[], onUnknownNest?: (stack: string[]) => void) => {
|
|
3
|
-
childIdsRef: MutableRefObject<Set<string>>;
|
|
4
|
-
};
|
|
5
|
-
export declare const useChildIdsEffect: (childIds: MutableRefObject<Set<string>>, id: string) => void;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export { default as ButtonItem } from './button-item';
|
|
2
|
-
export type { ButtonItemProps } from './button-item';
|
|
3
|
-
export { default as CustomItem } from './custom-item';
|
|
4
|
-
export type { CustomItemProps, CustomItemComponentProps } from './custom-item';
|
|
5
|
-
export { default as GoBackItem } from './go-back-item';
|
|
6
|
-
export type { GoBackItemProps } from './go-back-item';
|
|
7
|
-
export { default as LinkItem } from './link-item';
|
|
8
|
-
export type { LinkItemProps } from './link-item';
|
|
9
|
-
export { default as SkeletonItem } from './skeleton-item';
|
|
10
|
-
export type { SkeletonItemProps } from './skeleton-item';
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
export { default as SideNavigation } from './SideNavigation';
|
|
2
|
-
export type { SideNavigationProps } from './SideNavigation';
|
|
3
|
-
export { Section, HeadingItem, SkeletonHeadingItem } from './Section';
|
|
4
|
-
export type { HeadingItemProps, SectionProps, SkeletonHeadingItemProps } from './Section';
|
|
5
|
-
export { default as NestingItem } from './NestingItem';
|
|
6
|
-
export type { NestingItemProps } from './NestingItem';
|
|
7
|
-
export { default as NavigationContent } from './NavigationContent';
|
|
8
|
-
export type { NavigationContentProps } from './NavigationContent';
|
|
9
|
-
export { ButtonItem, GoBackItem, LinkItem, CustomItem, SkeletonItem } from './Item';
|
|
10
|
-
export type { CustomItemComponentProps, CustomItemProps, ButtonItemProps, GoBackItemProps, LinkItemProps, SkeletonItemProps, } from './Item';
|
|
11
|
-
export { default as Footer } from './Footer';
|
|
12
|
-
export type { FooterProps } from './Footer';
|
|
13
|
-
export { default as Header } from './Header';
|
|
14
|
-
export type { HeaderProps } from './Header';
|
|
15
|
-
export { default as NavigationHeader } from './NavigationHeader';
|
|
16
|
-
export type { NavigationHeaderProps } from './NavigationHeader';
|
|
17
|
-
export { default as NavigationFooter } from './NavigationFooter';
|
|
18
|
-
export type { NavigationFooterProps } from './NavigationFooter';
|
|
19
|
-
export { default as LoadingItems } from './LoadingItems';
|
|
20
|
-
export type { LoadingItemsProps } from './LoadingItems';
|
|
21
|
-
export { default as NestableNavigationContent } from './NestableNavigationContent';
|
|
22
|
-
export type { NestableNavigationContentProps } from './NestableNavigationContent';
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { type MutableRefObject } from 'react';
|
|
2
|
-
export declare const useChildIds: (currentStackId: string, committedStack: string[], onUnknownNest?: (stack: string[]) => void) => {
|
|
3
|
-
childIdsRef: MutableRefObject<Set<string>>;
|
|
4
|
-
};
|
|
5
|
-
export declare const useChildIdsEffect: (childIds: MutableRefObject<Set<string>>, id: string) => void;
|