@teambit/compositions 0.0.549 → 0.0.555

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.
@@ -4,10 +4,31 @@ export declare type CompositionProps = {
4
4
  displayName?: string;
5
5
  };
6
6
  export declare class Composition {
7
+ /**
8
+ * identifier of the composition
9
+ */
7
10
  readonly identifier: string;
11
+ /**
12
+ * file path in which the composition is contained.
13
+ */
8
14
  readonly filepath?: string | undefined;
15
+ /**
16
+ * set explicit display name
17
+ */
9
18
  private _displayName?;
10
- constructor(identifier: string, filepath?: string | undefined, _displayName?: string | undefined);
19
+ constructor(
20
+ /**
21
+ * identifier of the composition
22
+ */
23
+ identifier: string,
24
+ /**
25
+ * file path in which the composition is contained.
26
+ */
27
+ filepath?: string | undefined,
28
+ /**
29
+ * set explicit display name
30
+ */
31
+ _displayName?: string | undefined);
11
32
  get displayName(): string;
12
33
  toObject(): {
13
34
  identifier: string;
@@ -4,10 +4,17 @@ declare type Options = {
4
4
  menuBarWidgetSlot: CompositionsMenuSlot;
5
5
  };
6
6
  export declare class CompositionsSection implements Section {
7
+ /**
8
+ * simulations ui extension.
9
+ */
7
10
  private compositions;
8
11
  private options;
9
12
  private emptyStateSlot;
10
- constructor(compositions: CompositionsUI, options: Options, emptyStateSlot: EmptyStateSlot);
13
+ constructor(
14
+ /**
15
+ * simulations ui extension.
16
+ */
17
+ compositions: CompositionsUI, options: Options, emptyStateSlot: EmptyStateSlot);
11
18
  navigationLink: {
12
19
  href: string;
13
20
  children: string;
@@ -7,19 +7,74 @@ import { AbstractVinyl } from '@teambit/legacy/dist/consumer/component/sources';
7
7
  import { DevFilesMain } from '@teambit/dev-files';
8
8
  import { Composition } from './composition';
9
9
  export declare type CompositionsConfig = {
10
+ /**
11
+ * glob pattern to detect composition files. This includes all related files, like styles and jsons.
12
+ * @example ['/*.composition?(s).*']
13
+ */
10
14
  compositionFilePattern: string[];
15
+ /**
16
+ * glob pattern to select Preview files. this will only include files matched by compositionFilePattern.
17
+ * @example ['*.{t,j}s', '*.{t,j}sx']
18
+ */
11
19
  compositionPreviewFilePattern: string[];
12
20
  };
21
+ /**
22
+ * the component documentation extension.
23
+ */
13
24
  export declare class CompositionsMain {
25
+ /**
26
+ * Glob pattern to select all composition files
27
+ */
14
28
  private compositionFilePattern;
29
+ /**
30
+ * Glob pattern to select composition preview files
31
+ */
15
32
  private previewFilePattern;
33
+ /**
34
+ * envs extension.
35
+ */
16
36
  private preview;
37
+ /**
38
+ * workspace extension.
39
+ */
17
40
  private workspace;
41
+ /**
42
+ * schema extension.
43
+ */
18
44
  private schema;
19
45
  private devFiles;
20
- constructor(compositionFilePattern: string[], previewFilePattern: string[], preview: PreviewMain, workspace: Workspace, schema: SchemaMain, devFiles: DevFilesMain);
46
+ constructor(
47
+ /**
48
+ * Glob pattern to select all composition files
49
+ */
50
+ compositionFilePattern: string[],
51
+ /**
52
+ * Glob pattern to select composition preview files
53
+ */
54
+ previewFilePattern: string[],
55
+ /**
56
+ * envs extension.
57
+ */
58
+ preview: PreviewMain,
59
+ /**
60
+ * workspace extension.
61
+ */
62
+ workspace: Workspace,
63
+ /**
64
+ * schema extension.
65
+ */
66
+ schema: SchemaMain, devFiles: DevFilesMain);
67
+ /**
68
+ * returns an array of doc file paths for a set of components.
69
+ */
21
70
  getPreviewFiles(components: Component[]): ComponentMap<AbstractVinyl[]>;
71
+ /**
72
+ * get component compositions.
73
+ */
22
74
  getCompositions(component: Component): Composition[];
75
+ /**
76
+ * read composition from the component source code.
77
+ */
23
78
  readCompositions(component: Component): Composition[];
24
79
  onComponentLoad(component: Component): Promise<AspectData>;
25
80
  private computeCompositions;
@@ -1,8 +1,16 @@
1
1
  import { PreviewPreview, RenderingContext, PreviewModule } from '@teambit/preview';
2
2
  export declare class CompositionsPreview {
3
+ /**
4
+ * preview extension.
5
+ */
3
6
  private preview;
4
- constructor(preview: PreviewPreview);
7
+ constructor(
8
+ /**
9
+ * preview extension.
10
+ */
11
+ preview: PreviewPreview);
5
12
  render(componentId: string, modules: PreviewModule, otherPreviewDefs: any, context: RenderingContext): void;
13
+ /** gets relevant information for this preview to render */
6
14
  selectPreviewModel(componentId: string, previewModule: PreviewModule): any;
7
15
  private getActiveComposition;
8
16
  static runtime: import("@teambit/harmony").RuntimeDefinition;
@@ -9,6 +9,9 @@ export declare class CompositionsUI {
9
9
  private menuBarWidgetSlot;
10
10
  private emptyStateSlot;
11
11
  constructor(menuBarWidgetSlot: CompositionsMenuSlot, emptyStateSlot: EmptyStateSlot);
12
+ /**
13
+ * register a new tester empty state. this allows to register a different empty state from each environment for example.
14
+ */
12
15
  registerEmptyState(emptyStateComponent: ComponentType): this;
13
16
  registerMenuWidget(...widget: MenuBarWidget[]): void;
14
17
  static dependencies: import("@teambit/harmony").Aspect[];
@@ -1,10 +1,25 @@
1
1
  import { ComponentModel } from '@teambit/component';
2
2
  import { Composition } from '../composition';
3
3
  export declare type ComponentCompositionProps = {
4
+ /**
5
+ * HTML class
6
+ */
4
7
  className?: string;
8
+ /**
9
+ * component to render.
10
+ */
5
11
  component: ComponentModel;
12
+ /**
13
+ * composition to use for component rendering.
14
+ */
6
15
  composition?: Composition;
16
+ /**
17
+ * Additional query params to append at the end of the *hash*. Changing this property will not reload the composition.
18
+ */
7
19
  queryParams?: string | string[];
20
+ /**
21
+ * skip hot reload
22
+ */
8
23
  hotReload?: boolean;
9
24
  };
10
25
  export declare function ComponentComposition({ component, composition, hotReload, className, queryParams, }: ComponentCompositionProps): JSX.Element;
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@teambit/compositions",
3
- "version": "0.0.549",
3
+ "version": "0.0.555",
4
4
  "homepage": "https://bit.dev/teambit/compositions/compositions",
5
5
  "main": "dist/index.js",
6
6
  "componentId": {
7
7
  "scope": "teambit.compositions",
8
8
  "name": "compositions",
9
- "version": "0.0.549"
9
+ "version": "0.0.555"
10
10
  },
11
11
  "dependencies": {
12
12
  "@teambit/harmony": "0.2.11",
@@ -23,32 +23,32 @@
23
23
  "@teambit/documenter.ui.heading": "4.1.1",
24
24
  "@teambit/documenter.ui.property-table": "4.1.3",
25
25
  "@teambit/evangelist.elements.icon": "1.0.2",
26
- "@teambit/component": "0.0.549",
27
- "@teambit/compositions.model.composition-id": "0.0.459",
28
- "@teambit/graphql": "0.0.549",
29
- "@teambit/cli": "0.0.380",
30
- "@teambit/dev-files": "0.0.549",
31
- "@teambit/preview": "0.0.549",
32
- "@teambit/schema": "0.0.549",
33
- "@teambit/workspace": "0.0.549",
34
- "@teambit/ui-foundation.ui.constants.z-indexes": "0.0.459",
35
- "@teambit/envs": "0.0.549",
36
- "@teambit/compositions.ui.compositions-menu-bar": "0.0.136",
37
- "@teambit/compositions.ui.hooks.use-composition": "0.0.136",
26
+ "@teambit/component": "0.0.555",
27
+ "@teambit/compositions.model.composition-id": "0.0.463",
28
+ "@teambit/graphql": "0.0.555",
29
+ "@teambit/cli": "0.0.386",
30
+ "@teambit/dev-files": "0.0.555",
31
+ "@teambit/preview": "0.0.555",
32
+ "@teambit/schema": "0.0.555",
33
+ "@teambit/workspace": "0.0.555",
34
+ "@teambit/ui-foundation.ui.constants.z-indexes": "0.0.463",
35
+ "@teambit/envs": "0.0.555",
36
+ "@teambit/compositions.ui.compositions-menu-bar": "0.0.140",
37
+ "@teambit/compositions.ui.hooks.use-composition": "0.0.140",
38
38
  "@teambit/design.ui.alert-card": "0.0.13",
39
39
  "@teambit/design.ui.empty-box": "0.0.352",
40
40
  "@teambit/design.ui.input.option-button": "0.0.26",
41
41
  "@teambit/design.ui.separator": "0.0.351",
42
42
  "@teambit/design.ui.surfaces.status-message-card": "0.0.6",
43
- "@teambit/docs.ui.queries.get-docs": "0.0.459",
44
- "@teambit/mdx.ui.mdx-layout": "0.0.463",
45
- "@teambit/panels": "0.0.380",
46
- "@teambit/preview.ui.component-preview": "0.0.459",
47
- "@teambit/ui-foundation.ui.buttons.collapser": "0.0.164",
48
- "@teambit/ui-foundation.ui.hooks.use-is-mobile": "0.0.152",
49
- "@teambit/ui": "0.0.549",
50
- "@teambit/compositions.model.composition-type": "0.0.460",
51
- "@teambit/compositions.ui.composition-card": "0.0.465"
43
+ "@teambit/docs.ui.queries.get-docs": "0.0.463",
44
+ "@teambit/mdx.ui.mdx-layout": "0.0.467",
45
+ "@teambit/panels": "0.0.386",
46
+ "@teambit/preview.ui.component-preview": "0.0.463",
47
+ "@teambit/ui-foundation.ui.buttons.collapser": "0.0.168",
48
+ "@teambit/ui-foundation.ui.hooks.use-is-mobile": "0.0.156",
49
+ "@teambit/ui": "0.0.555",
50
+ "@teambit/compositions.model.composition-type": "0.0.464",
51
+ "@teambit/compositions.ui.composition-card": "0.0.469"
52
52
  },
53
53
  "devDependencies": {
54
54
  "@types/react": "^17.0.8",
@@ -59,10 +59,10 @@
59
59
  "@types/jest": "^26.0.0",
60
60
  "@types/react-dom": "^17.0.5",
61
61
  "@types/node": "12.20.4",
62
- "@teambit/compositions.aspect-docs.compositions": "0.0.101"
62
+ "@teambit/compositions.aspect-docs.compositions": "0.0.105"
63
63
  },
64
64
  "peerDependencies": {
65
- "@teambit/legacy": "1.0.76",
65
+ "@teambit/legacy": "1.0.172",
66
66
  "react-dom": "^16.8.0 || ^17.0.0",
67
67
  "react": "^16.8.0 || ^17.0.0"
68
68
  },
@@ -90,7 +90,7 @@
90
90
  "react": "-"
91
91
  },
92
92
  "peerDependencies": {
93
- "@teambit/legacy": "1.0.76",
93
+ "@teambit/legacy": "1.0.172",
94
94
  "react-dom": "^16.8.0 || ^17.0.0",
95
95
  "react": "^16.8.0 || ^17.0.0"
96
96
  }
package/tsconfig.json CHANGED
@@ -25,7 +25,6 @@
25
25
  "strict": true,
26
26
  "noImplicitAny": false,
27
27
  "rootDir": ".",
28
- "removeComments": true,
29
28
  "preserveConstEnums": true,
30
29
  "resolveJsonModule": true
31
30
  },