@teambit/compositions 0.0.551 → 0.0.556
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/composition.d.ts +22 -1
- package/dist/composition.section.d.ts +8 -1
- package/dist/compositions.main.runtime.d.ts +56 -1
- package/dist/compositions.preview.runtime.d.ts +9 -1
- package/dist/compositions.ui.runtime.d.ts +3 -0
- package/dist/ui/composition-preview.d.ts +15 -0
- package/package.json +32 -26
- package/composition.section.tsx +0 -29
- package/composition.ts +0 -44
- package/compositions.aspect.ts +0 -9
- package/compositions.docs.mdx +0 -8
- package/compositions.graphql.ts +0 -32
- package/compositions.main.runtime.ts +0 -164
- package/compositions.module.scss +0 -100
- package/compositions.preview-definition.ts +0 -21
- package/compositions.preview.runtime.ts +0 -67
- package/compositions.tsx +0 -185
- package/compositions.ui.runtime.tsx +0 -53
- package/index.ts +0 -10
- package/package-tar/teambit-compositions-0.0.551.tgz +0 -0
- package/tsconfig.json +0 -35
- package/types/asset.d.ts +0 -29
- package/types/style.d.ts +0 -42
- package/ui/composition-preview.tsx +0 -60
- package/ui/compositions-overview/compositions-overview.module.scss +0 -16
- package/ui/compositions-overview/compositions-overview.tsx +0 -21
- package/ui/compositions-overview/index.ts +0 -1
- package/ui/compositions-panel/compositions-panel.module.scss +0 -119
- package/ui/compositions-panel/compositions-panel.tsx +0 -58
- package/ui/compositions-panel/index.ts +0 -0
- package/ui/compositions-panel-node/compositions-panel-node.module.scss +0 -15
- package/ui/compositions-panel-node/compositions-panel-node.tsx +0 -22
- package/ui/compositions-panel-node/index.ts +0 -1
- package/ui/index.ts +0 -1
- package/ui/use-compositions.tsx +0 -14
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { Icon } from '@teambit/evangelist.elements.icon';
|
|
2
|
-
import classNames from 'classnames';
|
|
3
|
-
import React, { useCallback } from 'react';
|
|
4
|
-
|
|
5
|
-
import { Composition } from '../../composition';
|
|
6
|
-
import styles from './compositions-panel.module.scss';
|
|
7
|
-
|
|
8
|
-
export type CompositionsPanelProps = {
|
|
9
|
-
compositions: Composition[];
|
|
10
|
-
onSelectComposition: (composition: Composition) => void;
|
|
11
|
-
active?: Composition;
|
|
12
|
-
url: string;
|
|
13
|
-
} & React.HTMLAttributes<HTMLUListElement>;
|
|
14
|
-
|
|
15
|
-
export function CompositionsPanel({
|
|
16
|
-
url,
|
|
17
|
-
compositions,
|
|
18
|
-
onSelectComposition: onSelect,
|
|
19
|
-
active,
|
|
20
|
-
className,
|
|
21
|
-
...rest
|
|
22
|
-
}: CompositionsPanelProps) {
|
|
23
|
-
const handleSelect = useCallback(
|
|
24
|
-
(selected: Composition) => {
|
|
25
|
-
onSelect && onSelect(selected);
|
|
26
|
-
},
|
|
27
|
-
[onSelect]
|
|
28
|
-
);
|
|
29
|
-
|
|
30
|
-
return (
|
|
31
|
-
<ul {...rest} className={classNames(className)}>
|
|
32
|
-
{compositions.map((composition) => {
|
|
33
|
-
// TODO - move to composition panel node
|
|
34
|
-
return (
|
|
35
|
-
<li
|
|
36
|
-
key={composition.identifier}
|
|
37
|
-
className={classNames(styles.linkWrapper, composition === active && styles.active)}
|
|
38
|
-
>
|
|
39
|
-
<a className={styles.panelLink} onClick={() => handleSelect(composition)}>
|
|
40
|
-
<span className={styles.box}></span>
|
|
41
|
-
<span className={styles.name}>{composition.displayName}</span>
|
|
42
|
-
</a>
|
|
43
|
-
<div className={styles.right}>
|
|
44
|
-
<a
|
|
45
|
-
className={styles.panelLink}
|
|
46
|
-
target="_blank"
|
|
47
|
-
rel="noopener noreferrer"
|
|
48
|
-
href={`${url}&${composition.identifier}`}
|
|
49
|
-
>
|
|
50
|
-
<Icon className={styles.icon} of="open-tab" />
|
|
51
|
-
</a>
|
|
52
|
-
</div>
|
|
53
|
-
</li>
|
|
54
|
-
);
|
|
55
|
-
})}
|
|
56
|
-
</ul>
|
|
57
|
-
);
|
|
58
|
-
}
|
|
File without changes
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
.linkWrapper {
|
|
2
|
-
background-color: var(--bit-accent-color, #6c5ce7);
|
|
3
|
-
&.active {
|
|
4
|
-
display: flex;
|
|
5
|
-
background-color: var(--bit-accent-color, #6c5ce7);
|
|
6
|
-
height: 40px;
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
.panelLink {
|
|
10
|
-
cursor: pointer;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
.composition {
|
|
14
|
-
width: 200px;
|
|
15
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import classNames from 'classnames';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
|
|
4
|
-
import styles from './compositions-panel-node.module.scss';
|
|
5
|
-
|
|
6
|
-
export type CompositionsPanelNodeProps = {
|
|
7
|
-
name: string;
|
|
8
|
-
onClick: (event: React.MouseEvent<HTMLAnchorElement>) => void;
|
|
9
|
-
isActive: boolean;
|
|
10
|
-
} & React.HTMLAttributes<HTMLLIElement>;
|
|
11
|
-
|
|
12
|
-
export function CompositionsPanelNode({ name, onClick, isActive, ...rest }: CompositionsPanelNodeProps) {
|
|
13
|
-
return (
|
|
14
|
-
<li {...rest}>
|
|
15
|
-
<div className={classNames(styles.linkWrapper, { [styles.active]: isActive })}>
|
|
16
|
-
<a className={styles.panelLink} onClick={onClick}>
|
|
17
|
-
{name}
|
|
18
|
-
</a>
|
|
19
|
-
</div>
|
|
20
|
-
</li>
|
|
21
|
-
);
|
|
22
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './compositions-panel-node';
|
package/ui/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { ComponentComposition } from './composition-preview';
|
package/ui/use-compositions.tsx
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
// import gql from 'graphql-tag';
|
|
2
|
-
// import { ComponentModel } from '../../component';
|
|
3
|
-
// import { Composition } from '../composition';
|
|
4
|
-
// import { useDataQuery } from '../../ui';
|
|
5
|
-
|
|
6
|
-
// const GET_COMPOSITIONS = gql`
|
|
7
|
-
// compositions: {
|
|
8
|
-
|
|
9
|
-
// }
|
|
10
|
-
// `;
|
|
11
|
-
|
|
12
|
-
// export function useCompositions(component: ComponentModel): Composition[] | [] {
|
|
13
|
-
// useDataQuery();
|
|
14
|
-
// }
|