@teambit/component 1.0.228 → 1.0.229

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 (85) hide show
  1. package/artifacts/__bit_junit.xml +1 -1
  2. package/artifacts/preview/teambit_component_component-preview.js +1 -1
  3. package/artifacts/schema.json +1125 -303
  4. package/dist/aspect-entry.d.ts +39 -0
  5. package/dist/aspect-list.d.ts +43 -0
  6. package/dist/aspect.section.d.ts +13 -0
  7. package/dist/component-factory.d.ts +150 -0
  8. package/dist/component-fs.d.ts +34 -0
  9. package/dist/component-interface.d.ts +22 -0
  10. package/dist/component-map/component-map.d.ts +63 -0
  11. package/dist/component-map/index.d.ts +1 -0
  12. package/dist/component-meta.d.ts +22 -0
  13. package/dist/component.aspect.d.ts +3 -0
  14. package/dist/component.composition.d.ts +1 -0
  15. package/dist/component.d.ts +183 -0
  16. package/dist/component.graphql.d.ts +83 -0
  17. package/dist/component.main.runtime.d.ts +75 -0
  18. package/dist/component.route.d.ts +18 -0
  19. package/dist/component.ui.runtime.d.ts +104 -0
  20. package/dist/config.d.ts +18 -0
  21. package/dist/dependencies/dependencies.d.ts +43 -0
  22. package/dist/dependencies/index.d.ts +1 -0
  23. package/dist/exceptions/could-not-find-latest.d.ts +4 -0
  24. package/dist/exceptions/host-not-found.d.ts +12 -0
  25. package/dist/exceptions/index.d.ts +4 -0
  26. package/dist/exceptions/main-file-not-found.d.ts +14 -0
  27. package/dist/exceptions/nothing-to-snap.d.ts +2 -0
  28. package/dist/get-component-opts.d.ts +13 -0
  29. package/dist/hash.d.ts +4 -0
  30. package/dist/head.d.ts +0 -0
  31. package/dist/history-graph.d.ts +2 -0
  32. package/dist/host/component-host-model.d.ts +7 -0
  33. package/dist/host/index.d.ts +2 -0
  34. package/dist/host/use-component-host.d.ts +6 -0
  35. package/dist/index.d.ts +37 -0
  36. package/dist/on-load.d.ts +0 -0
  37. package/dist/{preview-1712805335812.js → preview-1712822929999.js} +2 -2
  38. package/dist/section/index.d.ts +1 -0
  39. package/dist/section/section.d.ts +11 -0
  40. package/dist/show/extensions.fragment.d.ts +13 -0
  41. package/dist/show/files.fragment.d.ts +14 -0
  42. package/dist/show/id.fragment.d.ts +13 -0
  43. package/dist/show/index.d.ts +8 -0
  44. package/dist/show/main-file.fragment.d.ts +9 -0
  45. package/dist/show/name.fragment.d.ts +9 -0
  46. package/dist/show/scope.fragment.d.ts +10 -0
  47. package/dist/show/show-fragment.d.ts +37 -0
  48. package/dist/show/show.cmd.d.ts +26 -0
  49. package/dist/snap/author.d.ts +17 -0
  50. package/dist/snap/index.d.ts +2 -0
  51. package/dist/snap/snap.d.ts +56 -0
  52. package/dist/state.d.ts +65 -0
  53. package/dist/store.d.ts +3 -0
  54. package/dist/tag/index.d.ts +1 -0
  55. package/dist/tag/tag.d.ts +32 -0
  56. package/dist/tag-map.d.ts +35 -0
  57. package/dist/ui/aspect-page/aspect-page.d.ts +1 -0
  58. package/dist/ui/aspect-page/index.d.ts +1 -0
  59. package/dist/ui/component-error/component-error.d.ts +20 -0
  60. package/dist/ui/component-error/index.d.ts +1 -0
  61. package/dist/ui/component-model/component-model.d.ts +186 -0
  62. package/dist/ui/component-model/index.d.ts +1 -0
  63. package/dist/ui/component-searcher/component-result.d.ts +16 -0
  64. package/dist/ui/component-searcher/component-searcher.d.ts +22 -0
  65. package/dist/ui/component-searcher/index.d.ts +2 -0
  66. package/dist/ui/component.d.ts +26 -0
  67. package/dist/ui/context/component-context.d.ts +6 -0
  68. package/dist/ui/context/component-provider.d.ts +25 -0
  69. package/dist/ui/context/index.d.ts +3 -0
  70. package/dist/ui/index.d.ts +12 -0
  71. package/dist/ui/menu/index.d.ts +3 -0
  72. package/dist/ui/menu/menu-nav.d.ts +23 -0
  73. package/dist/ui/menu/menu.d.ts +97 -0
  74. package/dist/ui/menu/nav-plugin.d.ts +28 -0
  75. package/dist/ui/top-bar-nav/index.d.ts +1 -0
  76. package/dist/ui/top-bar-nav/top-bar-nav.d.ts +2 -0
  77. package/dist/ui/use-component-from-location.d.ts +1 -0
  78. package/dist/ui/use-component-logs.d.ts +16 -0
  79. package/dist/ui/use-component-query.d.ts +3 -0
  80. package/dist/ui/use-component.d.ts +3 -0
  81. package/dist/ui/use-component.fragments.d.ts +10 -0
  82. package/dist/ui/use-component.model.d.ts +44 -0
  83. package/dist/ui/use-component.utils.d.ts +1 -0
  84. package/package.json +20 -20
  85. package/tsconfig.json +1 -46
@@ -0,0 +1,75 @@
1
+ import { CLIMain } from '@teambit/cli';
2
+ import { ExpressMain, Route } from '@teambit/express';
3
+ import { GraphqlMain } from '@teambit/graphql';
4
+ import { SlotRegistry } from '@teambit/harmony';
5
+ import { ComponentID } from '@teambit/component-id';
6
+ import { ExtensionDataList } from '@teambit/legacy/dist/consumer/config';
7
+ import { ComponentFactory } from './component-factory';
8
+ import { AspectList } from './aspect-list';
9
+ import { AspectEntry } from './aspect-entry';
10
+ import { ShowFragment } from './show';
11
+ import { RegisteredComponentRoute } from '.';
12
+ export type ComponentHostSlot = SlotRegistry<ComponentFactory>;
13
+ export type ShowFragmentSlot = SlotRegistry<ShowFragment[]>;
14
+ export declare class ComponentMain {
15
+ /**
16
+ * slot for component hosts to register.
17
+ */
18
+ private hostSlot;
19
+ /**
20
+ * Express Extension
21
+ */
22
+ private express;
23
+ private showFragmentSlot;
24
+ constructor(
25
+ /**
26
+ * slot for component hosts to register.
27
+ */
28
+ hostSlot: ComponentHostSlot,
29
+ /**
30
+ * Express Extension
31
+ */
32
+ express: ExpressMain, showFragmentSlot: ShowFragmentSlot);
33
+ /**
34
+ * register a new component host.
35
+ */
36
+ registerHost(host: ComponentFactory): this;
37
+ /**
38
+ * important! avoid using this method.
39
+ * seems like this method was written to work around a very specific case when the ComponentID of the aspects are
40
+ * not available. in case of new components, to get the ComponentID, the workspace-aspect is needed to get the
41
+ * default-scope. when this method is called from the scope, there is no way to get the real component-id.
42
+ * instead, this method asks for the "scope", which when called by the scope-aspect is the current scope-name.
43
+ * it may or may not be the real scope-name of the aspect.
44
+ * to fix this possibly incorrect scope-name, the `workspace.resolveScopeAspectListIds()` checks whether the
45
+ * scope-name is the same as scope.name, and if so, resolve it to the correct scope-name.
46
+ */
47
+ createAspectListFromLegacy(legacyExtensionDataList: ExtensionDataList): AspectList;
48
+ createAspectListFromEntries(entries: AspectEntry[]): AspectList;
49
+ registerRoute(routes: RegisteredComponentRoute[]): this;
50
+ /**
51
+ * set the prior host.
52
+ */
53
+ setHostPriority(id: string): this;
54
+ /**
55
+ * get component host by extension ID.
56
+ */
57
+ getHost(id?: string): ComponentFactory;
58
+ getHostIfExist(id?: string): ComponentFactory | undefined;
59
+ getRoute(id: ComponentID, routeName: string): string;
60
+ /**
61
+ * get the prior host.
62
+ */
63
+ private getPriorHost;
64
+ getShowFragments(): ShowFragment[];
65
+ isHost(name: string): boolean;
66
+ /**
67
+ * register a show fragment to display further information in the `bit show` command.
68
+ */
69
+ registerShowFragments(showFragments: ShowFragment[]): this;
70
+ private _priorHost;
71
+ static slots: (((registerFn: () => string) => SlotRegistry<Route[]>) | ((registerFn: () => string) => SlotRegistry<ComponentFactory>) | ((registerFn: () => string) => SlotRegistry<ShowFragment[]>))[];
72
+ static runtime: import("@teambit/harmony").RuntimeDefinition;
73
+ static dependencies: import("@teambit/harmony").Aspect[];
74
+ static provider([graphql, express, cli]: [GraphqlMain, ExpressMain, CLIMain], config: any, [hostSlot, showFragmentSlot]: [ComponentHostSlot, ShowFragmentSlot]): Promise<ComponentMain>;
75
+ }
@@ -0,0 +1,18 @@
1
+ import { NextFunction, Request, Response, Route } from '@teambit/express';
2
+ import { ComponentMain } from './component.main.runtime';
3
+ export type RegisteredComponentRoute = Route & {
4
+ resolveComponent?: boolean;
5
+ };
6
+ export type ComponentUrlParams = {
7
+ componentId: string;
8
+ };
9
+ export declare class ComponentRoute implements Route {
10
+ private registerRoute;
11
+ private componentExtension;
12
+ constructor(registerRoute: RegisteredComponentRoute, componentExtension: ComponentMain);
13
+ dynamicRouteRegex: string;
14
+ readonly route: string;
15
+ get componentMiddlewares(): ((req: Request<ComponentUrlParams>, res: Response, next: NextFunction) => Promise<void>)[];
16
+ method: string;
17
+ middlewares: ((req: Request<ComponentUrlParams>, res: Response, next: NextFunction) => Promise<void>)[];
18
+ }
@@ -0,0 +1,104 @@
1
+ /// <reference types="lodash" />
2
+ import type { RouteProps } from 'react-router-dom';
3
+ import type { LinkProps } from '@teambit/base-react.navigation.link';
4
+ import { CommandBarUI } from '@teambit/command-bar';
5
+ import { SlotRegistry } from '@teambit/harmony';
6
+ import { PubsubUI } from '@teambit/pubsub';
7
+ import { ReactRouterUI } from '@teambit/react-router';
8
+ import { MenuItem, MenuItemSlot } from '@teambit/ui-foundation.ui.main-dropdown';
9
+ import type { NavigationSlot, RouteSlot } from '@teambit/ui-foundation.ui.react-router.slot-router';
10
+ import { ComponentModel } from './ui';
11
+ import { ComponentPageElement, ComponentPageSlot } from './ui/component';
12
+ import { ComponentResultPlugin } from './ui/component-searcher';
13
+ import { ConsumeMethodSlot, ConsumePlugin, NavPlugin, OrderedNavigationSlot, RightSideMenuItem, RightSideMenuSlot } from './ui/menu';
14
+ import { GetComponentsOptions } from './get-component-opts';
15
+ export type ComponentSearchResultSlot = SlotRegistry<ComponentResultPlugin[]>;
16
+ export type ComponentUIConfig = {
17
+ commandBar: boolean;
18
+ };
19
+ export type Server = {
20
+ env: string;
21
+ url: string;
22
+ };
23
+ export type ComponentMeta = {
24
+ id: string;
25
+ };
26
+ export declare class ComponentUI {
27
+ /**
28
+ * Pubsub aspects
29
+ */
30
+ private pubsub;
31
+ private routeSlot;
32
+ private navSlot;
33
+ readonly consumeMethodSlot: ConsumeMethodSlot;
34
+ /**
35
+ * slot for registering a new widget to the menu.
36
+ */
37
+ private widgetSlot;
38
+ /**
39
+ * slot for registering the right section of the menu
40
+ */
41
+ private rightSideMenuSlot;
42
+ private menuItemSlot;
43
+ private pageItemSlot;
44
+ private componentSearchResultSlot;
45
+ private commandBarUI;
46
+ readonly routePath = "/*";
47
+ private componentSearcher;
48
+ constructor(
49
+ /**
50
+ * Pubsub aspects
51
+ */
52
+ pubsub: PubsubUI, routeSlot: RouteSlot, navSlot: OrderedNavigationSlot, consumeMethodSlot: ConsumeMethodSlot,
53
+ /**
54
+ * slot for registering a new widget to the menu.
55
+ */
56
+ widgetSlot: OrderedNavigationSlot,
57
+ /**
58
+ * slot for registering the right section of the menu
59
+ */
60
+ rightSideMenuSlot: RightSideMenuSlot, menuItemSlot: MenuItemSlot, pageItemSlot: ComponentPageSlot, componentSearchResultSlot: ComponentSearchResultSlot, commandBarUI: CommandBarUI, reactRouterUi: ReactRouterUI);
61
+ get routes(): [string, RouteProps[]][];
62
+ /**
63
+ * the current visible component
64
+ */
65
+ private activeComponent?;
66
+ formatToInstallableVersion(version: string): string;
67
+ private copyNpmId;
68
+ /**
69
+ * key bindings used by component aspect
70
+ */
71
+ private keyBindings;
72
+ private menuItems;
73
+ private bitMethod;
74
+ registerPubSub(): void;
75
+ handleComponentChange: (activeComponent?: ComponentModel) => void;
76
+ getComponentUI(host: string, options?: GetComponentsOptions): import("react/jsx-runtime").JSX.Element;
77
+ getMenu(host: string, options?: GetComponentsOptions): import("react/jsx-runtime").JSX.Element;
78
+ listMenuItems(): import("lodash").Dictionary<MenuItem[]>;
79
+ registerRoute(routes: RouteProps[] | RouteProps): this;
80
+ registerNavigation(nav: LinkProps, order?: number): void;
81
+ registerConsumeMethod(...consumeMethods: ConsumePlugin[]): void;
82
+ registerWidget(widget: LinkProps, order?: number): void;
83
+ registerRightSideMenuItem(...rightSideMenuItem: RightSideMenuItem[]): void;
84
+ registerMenuItem: (menuItems: MenuItem[]) => void;
85
+ registerPageItem: (...items: ComponentPageElement[]) => void;
86
+ /** register widgets to the components listed in the command bar */
87
+ registerSearchResultWidget: (...items: ComponentResultPlugin[]) => void;
88
+ updateComponents: (components: ComponentModel[]) => void;
89
+ static dependencies: import("@teambit/harmony").Aspect[];
90
+ static runtime: import("@teambit/harmony").RuntimeDefinition;
91
+ static slots: (((registerFn: () => string) => SlotRegistry<RouteProps>) | ((registerFn: () => string) => SlotRegistry<NavigationSlot>) | ((registerFn: () => string) => SlotRegistry<MenuItemSlot>) | ((registerFn: () => string) => SlotRegistry<NavPlugin>) | ((registerFn: () => string) => SlotRegistry<ConsumeMethodSlot>) | ((registerFn: () => string) => SlotRegistry<ComponentPageSlot>) | ((registerFn: () => string) => SlotRegistry<ComponentSearchResultSlot>) | ((registerFn: () => string) => SlotRegistry<RightSideMenuSlot>))[];
92
+ static defaultConfig: ComponentUIConfig;
93
+ static provider([pubsub, commandBarUI, reactRouterUI]: [PubsubUI, CommandBarUI, ReactRouterUI], config: ComponentUIConfig, [routeSlot, navSlot, consumeMethodSlot, widgetSlot, menuItemSlot, pageSlot, componentSearchResultSlot, rightSideMenuSlot,]: [
94
+ RouteSlot,
95
+ OrderedNavigationSlot,
96
+ ConsumeMethodSlot,
97
+ OrderedNavigationSlot,
98
+ MenuItemSlot,
99
+ ComponentPageSlot,
100
+ ComponentSearchResultSlot,
101
+ RightSideMenuSlot
102
+ ]): Promise<ComponentUI>;
103
+ }
104
+ export default ComponentUI;
@@ -0,0 +1,18 @@
1
+ import { ExtensionDataList } from '@teambit/legacy/dist/consumer/config/extension-data';
2
+ import { PathLinuxRelative, PathOsBasedRelative } from '@teambit/legacy/dist/utils/path';
3
+ /**
4
+ * in-memory representation of the component configuration.
5
+ */
6
+ export declare class Config {
7
+ private consumerComponent;
8
+ constructor(consumerComponent: any);
9
+ /**
10
+ * component main file
11
+ * when loaded from the workspace, it's PathOsBasedRelative. otherwise, PathLinuxRelative.
12
+ */
13
+ get main(): PathLinuxRelative | PathOsBasedRelative;
14
+ /**
15
+ * configured extensions
16
+ */
17
+ get extensions(): ExtensionDataList;
18
+ }
@@ -0,0 +1,43 @@
1
+ import { ComponentID } from '@teambit/component-id';
2
+ export declare class DependencyId extends ComponentID {
3
+ }
4
+ export declare class Dependency {
5
+ id: DependencyId;
6
+ constructor(id: DependencyId);
7
+ }
8
+ export declare class PackageDependency extends Dependency {
9
+ }
10
+ export declare class ComponentDependency extends Dependency {
11
+ }
12
+ export declare class DependencyList extends Array<Dependency> {
13
+ /**
14
+ * Get only package dependencies
15
+ *
16
+ * @readonly
17
+ * @memberof DependencyList
18
+ */
19
+ get packages(): PackageDependency[];
20
+ get components(): ComponentDependency[];
21
+ static fromArray(dependencies: Dependency[]): DependencyList;
22
+ }
23
+ export declare class Dependencies {
24
+ runtime: DependencyList;
25
+ dev: DependencyList;
26
+ peer: DependencyList;
27
+ constructor(runtime: DependencyList, dev: DependencyList, peer: DependencyList);
28
+ private getByEnvironment;
29
+ /**
30
+ * Get dependencies needed for development environnement such as runtime, dev and peer
31
+ *
32
+ * @returns {DependencyList}
33
+ * @memberof Dependencies
34
+ */
35
+ computeDev(): DependencyList;
36
+ /**
37
+ * Get dependencies needed for runtime environnement such as runtime and peer
38
+ *
39
+ * @returns {DependencyList}
40
+ * @memberof Dependencies
41
+ */
42
+ computeRuntime(): DependencyList;
43
+ }
@@ -0,0 +1 @@
1
+ export { Dependencies } from './dependencies';
@@ -0,0 +1,4 @@
1
+ export declare class CouldNotFindLatest extends Error {
2
+ constructor(semverArray: string[]);
3
+ report(): string;
4
+ }
@@ -0,0 +1,12 @@
1
+ export declare class HostNotFound extends Error {
2
+ /**
3
+ * name of the host.
4
+ */
5
+ private hostName;
6
+ constructor(
7
+ /**
8
+ * name of the host.
9
+ */
10
+ hostName: string);
11
+ toString(): string;
12
+ }
@@ -0,0 +1,4 @@
1
+ export { default as NothingToSnap } from './nothing-to-snap';
2
+ export { HostNotFound } from './host-not-found';
3
+ export { CouldNotFindLatest } from './could-not-find-latest';
4
+ export { MainFileNotFound } from './main-file-not-found';
@@ -0,0 +1,14 @@
1
+ import { ComponentID } from '@teambit/component-id';
2
+ export declare class MainFileNotFound extends Error {
3
+ /**
4
+ * name of the host.
5
+ */
6
+ readonly id: ComponentID;
7
+ readonly mainFile: string;
8
+ constructor(
9
+ /**
10
+ * name of the host.
11
+ */
12
+ id: ComponentID, mainFile: string);
13
+ toString(): string;
14
+ }
@@ -0,0 +1,2 @@
1
+ export default class NothingToSnap extends Error {
2
+ }
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import { RouteProps } from 'react-router-dom';
3
+ import type { UseComponentType, Filters } from './ui/use-component';
4
+ export type GetComponentsOptions = {
5
+ useComponent?: UseComponentType;
6
+ componentId?: string | (() => string | undefined);
7
+ useComponentFilters?: () => Filters;
8
+ path?: string;
9
+ skipRightSide?: boolean;
10
+ RightNode?: React.ReactNode;
11
+ className?: string;
12
+ routes?: RouteProps[];
13
+ };
package/dist/hash.d.ts ADDED
@@ -0,0 +1,4 @@
1
+ /**
2
+ * type for representing content-addressable filesystem hashes.
3
+ */
4
+ export type Hash = string;
package/dist/head.d.ts ADDED
File without changes
@@ -0,0 +1,2 @@
1
+ export default class HistoryGraph {
2
+ }
@@ -0,0 +1,7 @@
1
+ import { ComponentModel } from '../ui';
2
+ export declare class ComponentHostModel {
3
+ readonly name: string;
4
+ readonly components: ComponentModel[];
5
+ constructor(name: string, components: ComponentModel[]);
6
+ static from(data: any): ComponentHostModel;
7
+ }
@@ -0,0 +1,2 @@
1
+ export { useComponentHost } from './use-component-host';
2
+ export * from './component-host-model';
@@ -0,0 +1,6 @@
1
+ import { ComponentHostModel } from './component-host-model';
2
+ export declare function useComponentHost(): {
3
+ host?: undefined;
4
+ } | {
5
+ host: ComponentHostModel;
6
+ };
@@ -0,0 +1,37 @@
1
+ import { ComponentAspect } from './component.aspect';
2
+ export type { GetComponentsOptions } from './get-component-opts';
3
+ export type { UseComponentType } from './ui/use-component';
4
+ export { useComponentHost } from './host';
5
+ export { Component, InvalidComponent } from './component';
6
+ export { ComponentID } from '@teambit/component-id';
7
+ export { default as ComponentFS } from './component-fs';
8
+ export type { Config as ComponentConfig } from './config';
9
+ export type { ComponentFactory, ResolveAspectsOptions, FilterAspectsOptions, LoadAspectsOptions, } from './component-factory';
10
+ export type { AspectList } from './aspect-list';
11
+ export { AspectEntry, AspectData, ResolveComponentIdFunc } from './aspect-entry';
12
+ export { Snap, SnapProps } from './snap/snap';
13
+ export type { Author } from './snap/author';
14
+ export { Tag, TagProps } from './tag/tag';
15
+ export type { IComponent } from './component-interface';
16
+ export { State } from './state';
17
+ export type { Hash } from './hash';
18
+ export { TagMap } from './tag-map';
19
+ export { ComponentMap } from './component-map';
20
+ export type { ComponentMain } from './component.main.runtime';
21
+ export type { ComponentUI } from './component.ui.runtime';
22
+ export type { Section } from './section';
23
+ export { ComponentContext, ComponentDescriptorContext, useComponentDescriptor } from './ui/context/component-context';
24
+ export type { ComponentProviderProps, ComponentDescriptorProviderProps } from './ui/context';
25
+ export { ComponentProvider, ComponentDescriptorProvider } from './ui/context';
26
+ export { componentFields, componentIdFields, componentOverviewFields } from './ui';
27
+ export type { NavPlugin, ConsumePlugin, MenuNavProps } from './ui/menu';
28
+ export { CollapsibleMenuNav, ComponentMenu, VersionRelatedDropdowns } from './ui/menu';
29
+ export type { RegisteredComponentRoute, ComponentUrlParams } from './component.route';
30
+ export type { ComponentModelProps } from './ui/component-model';
31
+ export { ComponentModel } from './ui/component-model';
32
+ export { TopBarNav } from './ui/top-bar-nav';
33
+ export type { ShowFragment, ShowRow, ShowJSONRow } from './show';
34
+ export { Config } from './config';
35
+ export { useComponent, useIdFromLocation, useComponentLogs, ComponentLogsResult, Filters } from './ui';
36
+ export { ComponentAspect };
37
+ export default ComponentAspect;
File without changes
@@ -1,5 +1,5 @@
1
- import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.component_component@1.0.228/dist/component.composition.js';
2
- import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.component_component@1.0.228/dist/component.docs.mdx';
1
+ import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.component_component@1.0.229/dist/component.composition.js';
2
+ import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.component_component@1.0.229/dist/component.docs.mdx';
3
3
 
4
4
  export const compositions = [compositions_0];
5
5
  export const overview = [overview_0];
@@ -0,0 +1 @@
1
+ export { Section } from './section';
@@ -0,0 +1,11 @@
1
+ import type { LinkProps } from '@teambit/base-react.navigation.link';
2
+ import { RouteProps } from 'react-router-dom';
3
+ export interface Section {
4
+ route: RouteProps;
5
+ navigationLink: LinkProps;
6
+ /**
7
+ * text to be used in the mobile res dropdown
8
+ */
9
+ displayName?: string;
10
+ order?: number;
11
+ }
@@ -0,0 +1,13 @@
1
+ import { ShowFragment } from './show-fragment';
2
+ import { Component } from '../component';
3
+ export declare class ExtensionsFragment implements ShowFragment {
4
+ private renderList;
5
+ renderRow(component: Component): Promise<{
6
+ title: string;
7
+ content: string;
8
+ }>;
9
+ json(component: Component): Promise<{
10
+ title: string;
11
+ json: any;
12
+ }>;
13
+ }
@@ -0,0 +1,14 @@
1
+ import { ShowFragment } from './show-fragment';
2
+ import { Component } from '../component';
3
+ export declare class FilesFragment implements ShowFragment {
4
+ renderRow(component: Component): Promise<{
5
+ title: string;
6
+ content: string;
7
+ }>;
8
+ json(component: Component): Promise<{
9
+ title: string;
10
+ json: string[];
11
+ }>;
12
+ private getRelativePaths;
13
+ weight: number;
14
+ }
@@ -0,0 +1,13 @@
1
+ import { ShowFragment } from './show-fragment';
2
+ import { Component } from '../component';
3
+ export declare class IDFragment implements ShowFragment {
4
+ renderRow(component: Component): Promise<{
5
+ title: string;
6
+ content: string;
7
+ }>;
8
+ json(component: Component): Promise<{
9
+ title: string;
10
+ json: string;
11
+ }>;
12
+ weight: number;
13
+ }
@@ -0,0 +1,8 @@
1
+ export { ShowFragment, ShowRow, JSONRow as ShowJSONRow } from './show-fragment';
2
+ export { ShowCmd } from './show.cmd';
3
+ export { MainFileFragment } from './main-file.fragment';
4
+ export { NameFragment } from './name.fragment';
5
+ export { IDFragment } from './id.fragment';
6
+ export { ScopeFragment } from './scope.fragment';
7
+ export { FilesFragment } from './files.fragment';
8
+ export { ExtensionsFragment } from './extensions.fragment';
@@ -0,0 +1,9 @@
1
+ import { ShowFragment } from './show-fragment';
2
+ import { Component } from '../component';
3
+ export declare class MainFileFragment implements ShowFragment {
4
+ renderRow(component: Component): Promise<{
5
+ title: string;
6
+ content: any;
7
+ }>;
8
+ weight: number;
9
+ }
@@ -0,0 +1,9 @@
1
+ import { ShowFragment } from './show-fragment';
2
+ import { Component } from '../component';
3
+ export declare class NameFragment implements ShowFragment {
4
+ renderRow(component: Component): Promise<{
5
+ title: string;
6
+ content: string;
7
+ }>;
8
+ weight: number;
9
+ }
@@ -0,0 +1,10 @@
1
+ import { ShowFragment } from './show-fragment';
2
+ import { Component } from '../component';
3
+ export declare class ScopeFragment implements ShowFragment {
4
+ renderRow(component: Component): Promise<{
5
+ title: string;
6
+ content: string;
7
+ }>;
8
+ getRow(): void;
9
+ weight: number;
10
+ }
@@ -0,0 +1,37 @@
1
+ import { Component } from '../component';
2
+ export interface ShowFragment {
3
+ /**
4
+ * render a row into the `show` CLI.
5
+ */
6
+ renderRow(component: Component): Promise<ShowRow>;
7
+ /**
8
+ * return a json output.
9
+ */
10
+ json?(component: Component): Promise<JSONRow>;
11
+ /**
12
+ * weight is used to determine the position of the fragment
13
+ * within the `show` table.
14
+ */
15
+ weight?: number;
16
+ }
17
+ export interface JSONRow {
18
+ /**
19
+ * name of the field.
20
+ */
21
+ title: string;
22
+ /**
23
+ * json content.
24
+ * TODO: change this from any to a more structured type (e.g. Serializable).
25
+ */
26
+ json: any;
27
+ }
28
+ export interface ShowRow {
29
+ /**
30
+ * title of the fragment
31
+ */
32
+ title: string;
33
+ /**
34
+ * content to render within the fragment.
35
+ */
36
+ content: string;
37
+ }
@@ -0,0 +1,26 @@
1
+ import { Command, CommandOptions } from '@teambit/cli';
2
+ import { ComponentMain } from '../component.main.runtime';
3
+ export declare class ShowCmd implements Command {
4
+ private component;
5
+ name: string;
6
+ description: string;
7
+ alias: string;
8
+ group: string;
9
+ arguments: {
10
+ name: string;
11
+ description: string;
12
+ }[];
13
+ options: CommandOptions;
14
+ constructor(component: ComponentMain);
15
+ private getComponent;
16
+ useLegacy(id: string, json?: boolean, remote?: boolean, compare?: boolean): Promise<string>;
17
+ report([idStr]: [string], { legacy, remote, compare }: {
18
+ legacy: boolean;
19
+ remote: boolean;
20
+ compare: boolean;
21
+ }): Promise<string>;
22
+ json([idStr]: [string], { remote, legacy }: {
23
+ remote: boolean;
24
+ legacy: boolean;
25
+ }): Promise<any>;
26
+ }
@@ -0,0 +1,17 @@
1
+ /**
2
+ * author type.
3
+ */
4
+ export type Author = {
5
+ /**
6
+ * author full name (for example: "Ran Mizrahi")
7
+ */
8
+ displayName: string;
9
+ /**
10
+ * author username (for example: "ranm8")
11
+ */
12
+ name?: string;
13
+ /**
14
+ * author email in a proper format (e.g. "ran@bit.dev")
15
+ */
16
+ email: string;
17
+ };
@@ -0,0 +1,2 @@
1
+ export { Author } from './author';
2
+ export { Snap, SnapProps } from './snap';
@@ -0,0 +1,56 @@
1
+ import { Author } from './author';
2
+ export type SnapProps = {
3
+ hash: string;
4
+ timestamp: string;
5
+ parents: string[];
6
+ author: Author;
7
+ message: string;
8
+ };
9
+ /**
10
+ * `Snap` represents a sealed state of the component in the working tree.
11
+ */
12
+ export declare class Snap {
13
+ /**
14
+ * hash of the snap.
15
+ */
16
+ readonly hash: string;
17
+ /**
18
+ * date time of the snap.
19
+ */
20
+ readonly timestamp: Date;
21
+ /**
22
+ * parent snap
23
+ */
24
+ readonly parents: string[];
25
+ /**
26
+ * author of the component `Snap`.
27
+ */
28
+ readonly author: Author;
29
+ /**
30
+ * message added by the `Snap` author.
31
+ */
32
+ readonly message: string;
33
+ constructor(
34
+ /**
35
+ * hash of the snap.
36
+ */
37
+ hash: string,
38
+ /**
39
+ * date time of the snap.
40
+ */
41
+ timestamp: Date,
42
+ /**
43
+ * parent snap
44
+ */
45
+ parents: string[],
46
+ /**
47
+ * author of the component `Snap`.
48
+ */
49
+ author: Author,
50
+ /**
51
+ * message added by the `Snap` author.
52
+ */
53
+ message: string);
54
+ static fromObject(snapObject: SnapProps): Snap;
55
+ toObject(): SnapProps;
56
+ }