@teambit/component 1.0.226 → 1.0.227
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/artifacts/__bit_junit.xml +1 -1
- package/artifacts/preview/teambit_component_component-preview.js +1 -1
- package/artifacts/schema.json +303 -1125
- package/dist/{preview-1712632644937.js → preview-1712719054377.js} +2 -2
- package/package.json +22 -22
- package/tsconfig.json +46 -1
- package/dist/aspect-entry.d.ts +0 -39
- package/dist/aspect-list.d.ts +0 -43
- package/dist/aspect.section.d.ts +0 -13
- package/dist/component-factory.d.ts +0 -149
- package/dist/component-fs.d.ts +0 -34
- package/dist/component-interface.d.ts +0 -22
- package/dist/component-map/component-map.d.ts +0 -63
- package/dist/component-map/index.d.ts +0 -1
- package/dist/component-meta.d.ts +0 -22
- package/dist/component.aspect.d.ts +0 -3
- package/dist/component.composition.d.ts +0 -1
- package/dist/component.d.ts +0 -182
- package/dist/component.graphql.d.ts +0 -83
- package/dist/component.main.runtime.d.ts +0 -75
- package/dist/component.route.d.ts +0 -18
- package/dist/component.ui.runtime.d.ts +0 -104
- package/dist/config.d.ts +0 -18
- package/dist/dependencies/dependencies.d.ts +0 -43
- package/dist/dependencies/index.d.ts +0 -1
- package/dist/exceptions/could-not-find-latest.d.ts +0 -4
- package/dist/exceptions/host-not-found.d.ts +0 -12
- package/dist/exceptions/index.d.ts +0 -4
- package/dist/exceptions/main-file-not-found.d.ts +0 -14
- package/dist/exceptions/nothing-to-snap.d.ts +0 -2
- package/dist/get-component-opts.d.ts +0 -13
- package/dist/hash.d.ts +0 -4
- package/dist/head.d.ts +0 -0
- package/dist/history-graph.d.ts +0 -2
- package/dist/host/component-host-model.d.ts +0 -7
- package/dist/host/index.d.ts +0 -2
- package/dist/host/use-component-host.d.ts +0 -6
- package/dist/index.d.ts +0 -37
- package/dist/on-load.d.ts +0 -0
- package/dist/section/index.d.ts +0 -1
- package/dist/section/section.d.ts +0 -11
- package/dist/show/extensions.fragment.d.ts +0 -13
- package/dist/show/files.fragment.d.ts +0 -14
- package/dist/show/id.fragment.d.ts +0 -13
- package/dist/show/index.d.ts +0 -8
- package/dist/show/main-file.fragment.d.ts +0 -9
- package/dist/show/name.fragment.d.ts +0 -9
- package/dist/show/scope.fragment.d.ts +0 -10
- package/dist/show/show-fragment.d.ts +0 -37
- package/dist/show/show.cmd.d.ts +0 -26
- package/dist/snap/author.d.ts +0 -17
- package/dist/snap/index.d.ts +0 -2
- package/dist/snap/snap.d.ts +0 -56
- package/dist/state.d.ts +0 -65
- package/dist/store.d.ts +0 -3
- package/dist/tag/index.d.ts +0 -1
- package/dist/tag/tag.d.ts +0 -32
- package/dist/tag-map.d.ts +0 -35
- package/dist/ui/aspect-page/aspect-page.d.ts +0 -1
- package/dist/ui/aspect-page/index.d.ts +0 -1
- package/dist/ui/component-error/component-error.d.ts +0 -20
- package/dist/ui/component-error/index.d.ts +0 -1
- package/dist/ui/component-model/component-model.d.ts +0 -186
- package/dist/ui/component-model/index.d.ts +0 -1
- package/dist/ui/component-searcher/component-result.d.ts +0 -16
- package/dist/ui/component-searcher/component-searcher.d.ts +0 -22
- package/dist/ui/component-searcher/index.d.ts +0 -2
- package/dist/ui/component.d.ts +0 -26
- package/dist/ui/context/component-context.d.ts +0 -6
- package/dist/ui/context/component-provider.d.ts +0 -25
- package/dist/ui/context/index.d.ts +0 -3
- package/dist/ui/index.d.ts +0 -12
- package/dist/ui/menu/index.d.ts +0 -3
- package/dist/ui/menu/menu-nav.d.ts +0 -23
- package/dist/ui/menu/menu.d.ts +0 -97
- package/dist/ui/menu/nav-plugin.d.ts +0 -28
- package/dist/ui/top-bar-nav/index.d.ts +0 -1
- package/dist/ui/top-bar-nav/top-bar-nav.d.ts +0 -2
- package/dist/ui/use-component-from-location.d.ts +0 -1
- package/dist/ui/use-component-logs.d.ts +0 -16
- package/dist/ui/use-component-query.d.ts +0 -3
- package/dist/ui/use-component.d.ts +0 -3
- package/dist/ui/use-component.fragments.d.ts +0 -10
- package/dist/ui/use-component.model.d.ts +0 -44
- package/dist/ui/use-component.utils.d.ts +0 -1
package/dist/component.d.ts
DELETED
|
@@ -1,182 +0,0 @@
|
|
|
1
|
-
import { AnyFS } from '@teambit/any-fs';
|
|
2
|
-
import { SemVer } from 'semver';
|
|
3
|
-
import { ComponentID } from '@teambit/component-id';
|
|
4
|
-
import { BuildStatus } from '@teambit/legacy/dist/constants';
|
|
5
|
-
import { ComponentLog } from '@teambit/legacy/dist/scope/models/model-component';
|
|
6
|
-
import type { DependencyList } from '@teambit/dependency-resolver';
|
|
7
|
-
import { ComponentFactory } from './component-factory';
|
|
8
|
-
import ComponentFS from './component-fs';
|
|
9
|
-
import { Config as ComponentConfig } from './config';
|
|
10
|
-
import { Snap } from './snap';
|
|
11
|
-
import { State } from './state';
|
|
12
|
-
import { TagMap } from './tag-map';
|
|
13
|
-
import { Tag } from './tag';
|
|
14
|
-
import { IComponent, RawComponentMetadata } from './component-interface';
|
|
15
|
-
type SnapsIterableOpts = {
|
|
16
|
-
firstParentOnly?: boolean;
|
|
17
|
-
stopFn?: (snap: Snap) => Promise<boolean>;
|
|
18
|
-
};
|
|
19
|
-
export type InvalidComponent = {
|
|
20
|
-
id: ComponentID;
|
|
21
|
-
err: Error;
|
|
22
|
-
};
|
|
23
|
-
/**
|
|
24
|
-
* in-memory representation of a component.
|
|
25
|
-
*/
|
|
26
|
-
export declare class Component implements IComponent {
|
|
27
|
-
/**
|
|
28
|
-
* component ID represented by the `ComponentId` type.
|
|
29
|
-
*/
|
|
30
|
-
readonly id: ComponentID;
|
|
31
|
-
/**
|
|
32
|
-
* head version of the component. can be `null` for new components.
|
|
33
|
-
* if on main, returns the head on main.
|
|
34
|
-
* if on a lane, returns the head on the lane.
|
|
35
|
-
*/
|
|
36
|
-
readonly head: Snap | null;
|
|
37
|
-
/**
|
|
38
|
-
* state of the component.
|
|
39
|
-
*/
|
|
40
|
-
private _state;
|
|
41
|
-
/**
|
|
42
|
-
* tags of the component.
|
|
43
|
-
*/
|
|
44
|
-
readonly tags: TagMap;
|
|
45
|
-
/**
|
|
46
|
-
* the component factory
|
|
47
|
-
*/
|
|
48
|
-
private factory;
|
|
49
|
-
constructor(
|
|
50
|
-
/**
|
|
51
|
-
* component ID represented by the `ComponentId` type.
|
|
52
|
-
*/
|
|
53
|
-
id: ComponentID,
|
|
54
|
-
/**
|
|
55
|
-
* head version of the component. can be `null` for new components.
|
|
56
|
-
* if on main, returns the head on main.
|
|
57
|
-
* if on a lane, returns the head on the lane.
|
|
58
|
-
*/
|
|
59
|
-
head: Snap | null,
|
|
60
|
-
/**
|
|
61
|
-
* state of the component.
|
|
62
|
-
*/
|
|
63
|
-
_state: State,
|
|
64
|
-
/**
|
|
65
|
-
* tags of the component.
|
|
66
|
-
*/
|
|
67
|
-
tags: TagMap,
|
|
68
|
-
/**
|
|
69
|
-
* the component factory
|
|
70
|
-
*/
|
|
71
|
-
factory: ComponentFactory);
|
|
72
|
-
get mainFile(): import("@teambit/legacy/dist/consumer/component/sources").AbstractVinyl;
|
|
73
|
-
get state(): State;
|
|
74
|
-
set state(state: State);
|
|
75
|
-
/**
|
|
76
|
-
* component configuration which is later generated to a component `package.json` and `bit.json`.
|
|
77
|
-
*/
|
|
78
|
-
get config(): ComponentConfig;
|
|
79
|
-
/**
|
|
80
|
-
* in-memory representation of the component current filesystem.
|
|
81
|
-
*/
|
|
82
|
-
get filesystem(): ComponentFS;
|
|
83
|
-
/**
|
|
84
|
-
* build status of the component
|
|
85
|
-
*/
|
|
86
|
-
get buildStatus(): BuildStatus;
|
|
87
|
-
get headTag(): Tag | undefined;
|
|
88
|
-
get latest(): string | undefined;
|
|
89
|
-
/**
|
|
90
|
-
* get aspect data from current state.
|
|
91
|
-
*/
|
|
92
|
-
get(id: string): RawComponentMetadata | undefined;
|
|
93
|
-
getLogs(filter?: {
|
|
94
|
-
type?: string;
|
|
95
|
-
offset?: number;
|
|
96
|
-
limit?: number;
|
|
97
|
-
head?: string;
|
|
98
|
-
sort?: string;
|
|
99
|
-
}): Promise<ComponentLog[]>;
|
|
100
|
-
getDependencies(): DependencyList;
|
|
101
|
-
stringify(): string;
|
|
102
|
-
/**
|
|
103
|
-
* record component changes in the `Scope`.
|
|
104
|
-
*/
|
|
105
|
-
/**
|
|
106
|
-
* display name of the component.
|
|
107
|
-
*/
|
|
108
|
-
get displayName(): string;
|
|
109
|
-
/**
|
|
110
|
-
* tag a component `Snap` with a semantic version. we follow SemVer specs as defined [here](https://semver.org/)).
|
|
111
|
-
*/
|
|
112
|
-
tag(version: SemVer): void;
|
|
113
|
-
/**
|
|
114
|
-
* determines whether this component is modified in the workspace.
|
|
115
|
-
*/
|
|
116
|
-
isModified(): Promise<boolean>;
|
|
117
|
-
/**
|
|
118
|
-
* whether a component is marked as deleted.
|
|
119
|
-
*/
|
|
120
|
-
isDeleted(): boolean;
|
|
121
|
-
/**
|
|
122
|
-
* is component isOutdated
|
|
123
|
-
*/
|
|
124
|
-
isOutdated(): boolean;
|
|
125
|
-
/**
|
|
126
|
-
* determines whether this component is new.
|
|
127
|
-
*/
|
|
128
|
-
isNew(): Promise<boolean>;
|
|
129
|
-
loadState(snapId: string): Promise<State>;
|
|
130
|
-
loadSnap(snapId?: string): Promise<Snap>;
|
|
131
|
-
/**
|
|
132
|
-
* Get iterable which iterate over snap parents lazily
|
|
133
|
-
* @param snapId
|
|
134
|
-
* @param options
|
|
135
|
-
*/
|
|
136
|
-
snapsIterable(snapId?: string, options?: SnapsIterableOpts): AsyncIterable<Snap>;
|
|
137
|
-
/**
|
|
138
|
-
* traverse recursively from the provided snap (or head) upwards until it finds a tag
|
|
139
|
-
* @param snapToStartFrom
|
|
140
|
-
*/
|
|
141
|
-
getClosestTag(snapToStartFrom?: string): Promise<Tag | undefined>;
|
|
142
|
-
/**
|
|
143
|
-
* id.version can be either a tag or a hash.
|
|
144
|
-
* if it's a hash, it may have a tag point to it. if it does, return the tag.
|
|
145
|
-
*/
|
|
146
|
-
getTag(): Tag | undefined;
|
|
147
|
-
/**
|
|
148
|
-
* id.version can be either a tag or a hash.
|
|
149
|
-
* if it's a tag, find the hash it points to.
|
|
150
|
-
*/
|
|
151
|
-
getSnapHash(): string | undefined;
|
|
152
|
-
/**
|
|
153
|
-
* in case a component is new, it returns undefined.
|
|
154
|
-
* otherwise, it returns the Snap object (hash/parents/log) of the current component (according to the version in the id)
|
|
155
|
-
*/
|
|
156
|
-
getCurrentSnap(): Promise<Snap | undefined>;
|
|
157
|
-
/**
|
|
158
|
-
* checkout the component to a different version in its working tree.
|
|
159
|
-
*/
|
|
160
|
-
checkout(version: SemVer): void;
|
|
161
|
-
/**
|
|
162
|
-
* examine difference between two components.
|
|
163
|
-
*/
|
|
164
|
-
/**
|
|
165
|
-
* merge two different components
|
|
166
|
-
*/
|
|
167
|
-
/**
|
|
168
|
-
* write a component to a given file system.
|
|
169
|
-
* @param path root path to write the component
|
|
170
|
-
* @param fs instance of any fs to use.
|
|
171
|
-
*/
|
|
172
|
-
write(path: string, fs?: AnyFS): void;
|
|
173
|
-
/**
|
|
174
|
-
*
|
|
175
|
-
* Check if 2 components are equal
|
|
176
|
-
* @param {Component} component
|
|
177
|
-
* @returns {boolean}
|
|
178
|
-
* @memberof Component
|
|
179
|
-
*/
|
|
180
|
-
equals(component: Component): boolean;
|
|
181
|
-
}
|
|
182
|
-
export {};
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import { ComponentID, ComponentIdObj } from '@teambit/component-id';
|
|
2
|
-
import { ComponentLog } from '@teambit/legacy/dist/scope/models/model-component';
|
|
3
|
-
import { Component } from './component';
|
|
4
|
-
import { ComponentFactory } from './component-factory';
|
|
5
|
-
import { ComponentMain } from './component.main.runtime';
|
|
6
|
-
export declare function componentSchema(componentExtension: ComponentMain): {
|
|
7
|
-
typeDefs: import("graphql").DocumentNode;
|
|
8
|
-
resolvers: {
|
|
9
|
-
JSONObject: import("graphql").GraphQLScalarType;
|
|
10
|
-
Component: {
|
|
11
|
-
id: (component: Component) => ComponentIdObj;
|
|
12
|
-
displayName: (component: Component) => string;
|
|
13
|
-
fs: (component: Component) => string[];
|
|
14
|
-
log: (component: Component) => Promise<{
|
|
15
|
-
date: number;
|
|
16
|
-
email: string;
|
|
17
|
-
username: string | undefined;
|
|
18
|
-
displayName: string;
|
|
19
|
-
id: string;
|
|
20
|
-
hash: string;
|
|
21
|
-
timestamp: Date;
|
|
22
|
-
parents: string[];
|
|
23
|
-
author: import("./snap").Author;
|
|
24
|
-
message: string;
|
|
25
|
-
}>;
|
|
26
|
-
getFile: (component: Component, { path }: {
|
|
27
|
-
path: string;
|
|
28
|
-
}) => string | undefined;
|
|
29
|
-
mainFile: (component: Component) => any;
|
|
30
|
-
headTag: (component: Component) => import(".").TagProps | undefined;
|
|
31
|
-
latest: (component: Component) => string | undefined;
|
|
32
|
-
tags: (component: any) => any;
|
|
33
|
-
aspects: (component: Component, { include }: {
|
|
34
|
-
include?: string[] | undefined;
|
|
35
|
-
}) => import("./component-interface").RawComponentMetadata[];
|
|
36
|
-
elementsUrl: () => undefined;
|
|
37
|
-
logs: (component: Component, filter?: {
|
|
38
|
-
type?: string;
|
|
39
|
-
offset?: number;
|
|
40
|
-
limit?: number;
|
|
41
|
-
head?: string;
|
|
42
|
-
sort?: string;
|
|
43
|
-
takeHeadFromComponent: boolean;
|
|
44
|
-
}) => Promise<{
|
|
45
|
-
id: string;
|
|
46
|
-
message: string;
|
|
47
|
-
username?: string | undefined;
|
|
48
|
-
displayName?: string | undefined;
|
|
49
|
-
email?: string | undefined;
|
|
50
|
-
date?: string | undefined;
|
|
51
|
-
hash: string;
|
|
52
|
-
tag?: string | undefined;
|
|
53
|
-
parents: string[];
|
|
54
|
-
profileImage?: string | undefined;
|
|
55
|
-
onLane?: boolean | undefined;
|
|
56
|
-
}[]>;
|
|
57
|
-
};
|
|
58
|
-
ComponentHost: {
|
|
59
|
-
get: (host: ComponentFactory, { id }: {
|
|
60
|
-
id: string;
|
|
61
|
-
}) => Promise<Component | null | undefined>;
|
|
62
|
-
snaps: (host: ComponentFactory, { id }: {
|
|
63
|
-
id: string;
|
|
64
|
-
}) => Promise<ComponentLog[]>;
|
|
65
|
-
list: (host: ComponentFactory, filter?: {
|
|
66
|
-
offset: number;
|
|
67
|
-
limit: number;
|
|
68
|
-
}) => Promise<Component[]>;
|
|
69
|
-
listInvalid: (host: ComponentFactory) => Promise<{
|
|
70
|
-
id: ComponentID;
|
|
71
|
-
errorName: string;
|
|
72
|
-
errorMessage: string;
|
|
73
|
-
}[]>;
|
|
74
|
-
id: (host: ComponentFactory) => Promise<string>;
|
|
75
|
-
name: (host: ComponentFactory) => Promise<string>;
|
|
76
|
-
};
|
|
77
|
-
Query: {
|
|
78
|
-
getHost: (componentExt: ComponentMain, { id }: {
|
|
79
|
-
id: string;
|
|
80
|
-
}) => ComponentFactory;
|
|
81
|
-
};
|
|
82
|
-
};
|
|
83
|
-
};
|
|
@@ -1,75 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,104 +0,0 @@
|
|
|
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;
|
package/dist/config.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,43 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { Dependencies } from './dependencies';
|
|
@@ -1,14 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
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
DELETED
package/dist/head.d.ts
DELETED
|
File without changes
|
package/dist/history-graph.d.ts
DELETED
package/dist/host/index.d.ts
DELETED
package/dist/index.d.ts
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
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;
|
package/dist/on-load.d.ts
DELETED
|
File without changes
|
package/dist/section/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { Section } from './section';
|