@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.
- package/artifacts/__bit_junit.xml +1 -1
- package/artifacts/preview/teambit_component_component-preview.js +1 -1
- package/artifacts/schema.json +1125 -303
- package/dist/aspect-entry.d.ts +39 -0
- package/dist/aspect-list.d.ts +43 -0
- package/dist/aspect.section.d.ts +13 -0
- package/dist/component-factory.d.ts +150 -0
- package/dist/component-fs.d.ts +34 -0
- package/dist/component-interface.d.ts +22 -0
- package/dist/component-map/component-map.d.ts +63 -0
- package/dist/component-map/index.d.ts +1 -0
- package/dist/component-meta.d.ts +22 -0
- package/dist/component.aspect.d.ts +3 -0
- package/dist/component.composition.d.ts +1 -0
- package/dist/component.d.ts +183 -0
- package/dist/component.graphql.d.ts +83 -0
- package/dist/component.main.runtime.d.ts +75 -0
- package/dist/component.route.d.ts +18 -0
- package/dist/component.ui.runtime.d.ts +104 -0
- package/dist/config.d.ts +18 -0
- package/dist/dependencies/dependencies.d.ts +43 -0
- package/dist/dependencies/index.d.ts +1 -0
- package/dist/exceptions/could-not-find-latest.d.ts +4 -0
- package/dist/exceptions/host-not-found.d.ts +12 -0
- package/dist/exceptions/index.d.ts +4 -0
- package/dist/exceptions/main-file-not-found.d.ts +14 -0
- package/dist/exceptions/nothing-to-snap.d.ts +2 -0
- package/dist/get-component-opts.d.ts +13 -0
- package/dist/hash.d.ts +4 -0
- package/dist/head.d.ts +0 -0
- package/dist/history-graph.d.ts +2 -0
- package/dist/host/component-host-model.d.ts +7 -0
- package/dist/host/index.d.ts +2 -0
- package/dist/host/use-component-host.d.ts +6 -0
- package/dist/index.d.ts +37 -0
- package/dist/on-load.d.ts +0 -0
- package/dist/{preview-1712805335812.js → preview-1712822929999.js} +2 -2
- package/dist/section/index.d.ts +1 -0
- package/dist/section/section.d.ts +11 -0
- package/dist/show/extensions.fragment.d.ts +13 -0
- package/dist/show/files.fragment.d.ts +14 -0
- package/dist/show/id.fragment.d.ts +13 -0
- package/dist/show/index.d.ts +8 -0
- package/dist/show/main-file.fragment.d.ts +9 -0
- package/dist/show/name.fragment.d.ts +9 -0
- package/dist/show/scope.fragment.d.ts +10 -0
- package/dist/show/show-fragment.d.ts +37 -0
- package/dist/show/show.cmd.d.ts +26 -0
- package/dist/snap/author.d.ts +17 -0
- package/dist/snap/index.d.ts +2 -0
- package/dist/snap/snap.d.ts +56 -0
- package/dist/state.d.ts +65 -0
- package/dist/store.d.ts +3 -0
- package/dist/tag/index.d.ts +1 -0
- package/dist/tag/tag.d.ts +32 -0
- package/dist/tag-map.d.ts +35 -0
- package/dist/ui/aspect-page/aspect-page.d.ts +1 -0
- package/dist/ui/aspect-page/index.d.ts +1 -0
- package/dist/ui/component-error/component-error.d.ts +20 -0
- package/dist/ui/component-error/index.d.ts +1 -0
- package/dist/ui/component-model/component-model.d.ts +186 -0
- package/dist/ui/component-model/index.d.ts +1 -0
- package/dist/ui/component-searcher/component-result.d.ts +16 -0
- package/dist/ui/component-searcher/component-searcher.d.ts +22 -0
- package/dist/ui/component-searcher/index.d.ts +2 -0
- package/dist/ui/component.d.ts +26 -0
- package/dist/ui/context/component-context.d.ts +6 -0
- package/dist/ui/context/component-provider.d.ts +25 -0
- package/dist/ui/context/index.d.ts +3 -0
- package/dist/ui/index.d.ts +12 -0
- package/dist/ui/menu/index.d.ts +3 -0
- package/dist/ui/menu/menu-nav.d.ts +23 -0
- package/dist/ui/menu/menu.d.ts +97 -0
- package/dist/ui/menu/nav-plugin.d.ts +28 -0
- package/dist/ui/top-bar-nav/index.d.ts +1 -0
- package/dist/ui/top-bar-nav/top-bar-nav.d.ts +2 -0
- package/dist/ui/use-component-from-location.d.ts +1 -0
- package/dist/ui/use-component-logs.d.ts +16 -0
- package/dist/ui/use-component-query.d.ts +3 -0
- package/dist/ui/use-component.d.ts +3 -0
- package/dist/ui/use-component.fragments.d.ts +10 -0
- package/dist/ui/use-component.model.d.ts +44 -0
- package/dist/ui/use-component.utils.d.ts +1 -0
- package/package.json +20 -20
- package/tsconfig.json +1 -46
package/dist/state.d.ts
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { IssuesList } from '@teambit/component-issues';
|
|
2
|
+
import ComponentFS from './component-fs';
|
|
3
|
+
import { Config } from './config';
|
|
4
|
+
import { AspectList } from './aspect-list';
|
|
5
|
+
export declare class State {
|
|
6
|
+
/**
|
|
7
|
+
* component configuration which is later generated to a component `package.json` and `bit.json`.
|
|
8
|
+
* @deprecated please use `aspects` instead.
|
|
9
|
+
*/
|
|
10
|
+
readonly config: Config;
|
|
11
|
+
/**
|
|
12
|
+
* list of aspects configured on the component.
|
|
13
|
+
*/
|
|
14
|
+
private _aspects;
|
|
15
|
+
/**
|
|
16
|
+
* in-memory representation of the component current filesystem.
|
|
17
|
+
*/
|
|
18
|
+
readonly filesystem: ComponentFS;
|
|
19
|
+
/**
|
|
20
|
+
* dependency graph of the component current. ideally package dependencies would be also placed here.
|
|
21
|
+
*/
|
|
22
|
+
readonly dependencies: any;
|
|
23
|
+
/**
|
|
24
|
+
* instance of legacy consumer component.
|
|
25
|
+
*/
|
|
26
|
+
readonly _consumer: any;
|
|
27
|
+
constructor(
|
|
28
|
+
/**
|
|
29
|
+
* component configuration which is later generated to a component `package.json` and `bit.json`.
|
|
30
|
+
* @deprecated please use `aspects` instead.
|
|
31
|
+
*/
|
|
32
|
+
config: Config,
|
|
33
|
+
/**
|
|
34
|
+
* list of aspects configured on the component.
|
|
35
|
+
*/
|
|
36
|
+
_aspects: AspectList,
|
|
37
|
+
/**
|
|
38
|
+
* in-memory representation of the component current filesystem.
|
|
39
|
+
*/
|
|
40
|
+
filesystem: ComponentFS,
|
|
41
|
+
/**
|
|
42
|
+
* dependency graph of the component current. ideally package dependencies would be also placed here.
|
|
43
|
+
*/
|
|
44
|
+
dependencies: any,
|
|
45
|
+
/**
|
|
46
|
+
* instance of legacy consumer component.
|
|
47
|
+
*/
|
|
48
|
+
_consumer: any);
|
|
49
|
+
/**
|
|
50
|
+
* get the main file of the component.
|
|
51
|
+
*/
|
|
52
|
+
get mainFile(): import("@teambit/legacy/dist/consumer/component/sources").AbstractVinyl;
|
|
53
|
+
/**
|
|
54
|
+
* calculate the hash of this state
|
|
55
|
+
*/
|
|
56
|
+
get hash(): string;
|
|
57
|
+
get issues(): IssuesList;
|
|
58
|
+
/**
|
|
59
|
+
* @deprecated please use `component.isModified`.
|
|
60
|
+
* the way it's implemented here is unreliable and will only work if in the legacy the "isModified" was calculated.
|
|
61
|
+
*/
|
|
62
|
+
get isModified(): boolean;
|
|
63
|
+
get aspects(): AspectList;
|
|
64
|
+
set aspects(aspects: AspectList);
|
|
65
|
+
}
|
package/dist/store.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Tag } from './tag';
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { SemVer } from 'semver';
|
|
2
|
+
export type TagProps = {
|
|
3
|
+
hash: string;
|
|
4
|
+
version: string;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* `Tag` provides a sematic reference to a specific state `Snap` in the working tree.
|
|
8
|
+
*/
|
|
9
|
+
export declare class Tag {
|
|
10
|
+
/**
|
|
11
|
+
* tag hash, can be used to load it by component-factory.getSnap
|
|
12
|
+
*/
|
|
13
|
+
readonly hash: string;
|
|
14
|
+
/**
|
|
15
|
+
* sematic version of the snap.
|
|
16
|
+
*/
|
|
17
|
+
readonly version: SemVer;
|
|
18
|
+
constructor(
|
|
19
|
+
/**
|
|
20
|
+
* tag hash, can be used to load it by component-factory.getSnap
|
|
21
|
+
*/
|
|
22
|
+
hash: string,
|
|
23
|
+
/**
|
|
24
|
+
* sematic version of the snap.
|
|
25
|
+
*/
|
|
26
|
+
version: SemVer);
|
|
27
|
+
/**
|
|
28
|
+
* create a plain tag object.
|
|
29
|
+
*/
|
|
30
|
+
toObject(): TagProps;
|
|
31
|
+
static fromObject(tag: TagProps): Tag;
|
|
32
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { SemVer } from 'semver';
|
|
2
|
+
import { Hash } from './hash';
|
|
3
|
+
import { Tag } from './tag';
|
|
4
|
+
export declare class TagMap extends Map<SemVer, Tag> {
|
|
5
|
+
/**
|
|
6
|
+
* get snap by hash.
|
|
7
|
+
*/
|
|
8
|
+
byHash(hash: Hash): Tag | undefined;
|
|
9
|
+
/**
|
|
10
|
+
* e.g.
|
|
11
|
+
* {
|
|
12
|
+
* alpha: '1.0.0-alpha.5',
|
|
13
|
+
* dev: '2.2.4-dev.37
|
|
14
|
+
* }
|
|
15
|
+
*/
|
|
16
|
+
getPreReleaseLatestTags(): {
|
|
17
|
+
[preRelease: string]: string;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Get a map that map snap hash to tag
|
|
21
|
+
*/
|
|
22
|
+
getHashMap(): Map<Hash, Tag>;
|
|
23
|
+
/**
|
|
24
|
+
* get the latest semver from the tag map.
|
|
25
|
+
*/
|
|
26
|
+
getLatest(): string;
|
|
27
|
+
isEmpty(): boolean;
|
|
28
|
+
/**
|
|
29
|
+
* get an array of all tags.
|
|
30
|
+
*/
|
|
31
|
+
toArray(): Tag[];
|
|
32
|
+
byVersion(version: string): Tag | undefined;
|
|
33
|
+
static fromArray(tags: Tag[]): TagMap;
|
|
34
|
+
static empty(): TagMap;
|
|
35
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function AspectPage(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { AspectPage } from './aspect-page';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export declare class ComponentError {
|
|
2
|
+
/**
|
|
3
|
+
* http status code of error
|
|
4
|
+
*/
|
|
5
|
+
readonly code: number;
|
|
6
|
+
/**
|
|
7
|
+
* error message of the error
|
|
8
|
+
*/
|
|
9
|
+
readonly message?: string | undefined;
|
|
10
|
+
constructor(
|
|
11
|
+
/**
|
|
12
|
+
* http status code of error
|
|
13
|
+
*/
|
|
14
|
+
code: number,
|
|
15
|
+
/**
|
|
16
|
+
* error message of the error
|
|
17
|
+
*/
|
|
18
|
+
message?: string | undefined);
|
|
19
|
+
renderError(): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ComponentError } from './component-error';
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import { Composition, CompositionProps } from '@teambit/compositions';
|
|
2
|
+
import { DeprecationInfo } from '@teambit/deprecation';
|
|
3
|
+
import { Descriptor } from '@teambit/envs';
|
|
4
|
+
import { ComponentID, ComponentIdObj } from '@teambit/component-id';
|
|
5
|
+
import { LegacyComponentLog } from '@teambit/legacy-component-log';
|
|
6
|
+
import { ComponentPreviewSize } from '@teambit/preview';
|
|
7
|
+
import { TagMap } from '../../tag-map';
|
|
8
|
+
import { TagProps } from '../../tag/tag';
|
|
9
|
+
export type ComponentModelProps = {
|
|
10
|
+
id: ComponentIdObj;
|
|
11
|
+
description: string;
|
|
12
|
+
buildStatus?: string;
|
|
13
|
+
server?: ComponentServer;
|
|
14
|
+
displayName: string;
|
|
15
|
+
packageName: string;
|
|
16
|
+
compositions?: CompositionProps[];
|
|
17
|
+
tags?: TagProps[];
|
|
18
|
+
issuesCount?: number;
|
|
19
|
+
status?: any;
|
|
20
|
+
deprecation?: DeprecationInfo;
|
|
21
|
+
env?: Descriptor;
|
|
22
|
+
labels?: string[];
|
|
23
|
+
host?: string;
|
|
24
|
+
latest?: string;
|
|
25
|
+
preview?: ComponentPreview;
|
|
26
|
+
logs?: LegacyComponentLog[];
|
|
27
|
+
size?: ComponentPreviewSize;
|
|
28
|
+
};
|
|
29
|
+
export type ComponentPreview = {
|
|
30
|
+
includesEnvTemplate?: boolean;
|
|
31
|
+
isScaling?: boolean;
|
|
32
|
+
onlyOverview?: boolean;
|
|
33
|
+
legacyHeader?: boolean;
|
|
34
|
+
useNameParam?: boolean;
|
|
35
|
+
skipIncludes?: boolean;
|
|
36
|
+
};
|
|
37
|
+
export type ComponentServer = {
|
|
38
|
+
env: string;
|
|
39
|
+
/**
|
|
40
|
+
* Full dev server url.
|
|
41
|
+
*/
|
|
42
|
+
url?: string;
|
|
43
|
+
/**
|
|
44
|
+
* host of the component server (used mostly by cloud providers for remote scopes)
|
|
45
|
+
*/
|
|
46
|
+
host?: string;
|
|
47
|
+
/**
|
|
48
|
+
* This is used mostly by cloud to proxy requests to the correct scope.
|
|
49
|
+
*/
|
|
50
|
+
basePath?: string;
|
|
51
|
+
};
|
|
52
|
+
export declare class ComponentModel {
|
|
53
|
+
/**
|
|
54
|
+
* id of the component
|
|
55
|
+
*/
|
|
56
|
+
readonly id: ComponentID;
|
|
57
|
+
/**
|
|
58
|
+
* display name of the component.
|
|
59
|
+
*/
|
|
60
|
+
readonly displayName: string;
|
|
61
|
+
/**
|
|
62
|
+
* package name of the component.
|
|
63
|
+
*/
|
|
64
|
+
readonly packageName: string;
|
|
65
|
+
/**
|
|
66
|
+
* the component server.
|
|
67
|
+
*/
|
|
68
|
+
readonly server: ComponentServer | undefined;
|
|
69
|
+
/**
|
|
70
|
+
* array of compositions
|
|
71
|
+
*/
|
|
72
|
+
readonly compositions: Composition[];
|
|
73
|
+
/**
|
|
74
|
+
* tags of the component.
|
|
75
|
+
*/
|
|
76
|
+
readonly tags: TagMap;
|
|
77
|
+
/**
|
|
78
|
+
* component build status
|
|
79
|
+
*/
|
|
80
|
+
readonly buildStatus?: string | undefined;
|
|
81
|
+
/**
|
|
82
|
+
* issues of component.
|
|
83
|
+
*/
|
|
84
|
+
readonly issuesCount?: number | undefined;
|
|
85
|
+
/**
|
|
86
|
+
* status of component.
|
|
87
|
+
*/
|
|
88
|
+
readonly status?: any;
|
|
89
|
+
/**
|
|
90
|
+
* deprecation info of the component.
|
|
91
|
+
*/
|
|
92
|
+
readonly deprecation?: DeprecationInfo | undefined;
|
|
93
|
+
/**
|
|
94
|
+
* env descriptor.
|
|
95
|
+
*/
|
|
96
|
+
readonly environment?: Descriptor | undefined;
|
|
97
|
+
/**
|
|
98
|
+
* description of the component.
|
|
99
|
+
*/
|
|
100
|
+
readonly description: string;
|
|
101
|
+
readonly labels: string[];
|
|
102
|
+
/**
|
|
103
|
+
* host of the component
|
|
104
|
+
*/
|
|
105
|
+
readonly host?: string | undefined;
|
|
106
|
+
/**
|
|
107
|
+
*
|
|
108
|
+
* size preview
|
|
109
|
+
*/
|
|
110
|
+
readonly size?: ComponentPreviewSize | undefined;
|
|
111
|
+
/**
|
|
112
|
+
* latest version of component
|
|
113
|
+
*/
|
|
114
|
+
readonly latest?: string | undefined;
|
|
115
|
+
readonly preview?: ComponentPreview | undefined;
|
|
116
|
+
readonly logs?: LegacyComponentLog[] | undefined;
|
|
117
|
+
constructor(
|
|
118
|
+
/**
|
|
119
|
+
* id of the component
|
|
120
|
+
*/
|
|
121
|
+
id: ComponentID,
|
|
122
|
+
/**
|
|
123
|
+
* display name of the component.
|
|
124
|
+
*/
|
|
125
|
+
displayName: string,
|
|
126
|
+
/**
|
|
127
|
+
* package name of the component.
|
|
128
|
+
*/
|
|
129
|
+
packageName: string,
|
|
130
|
+
/**
|
|
131
|
+
* the component server.
|
|
132
|
+
*/
|
|
133
|
+
server: ComponentServer | undefined,
|
|
134
|
+
/**
|
|
135
|
+
* array of compositions
|
|
136
|
+
*/
|
|
137
|
+
compositions: Composition[],
|
|
138
|
+
/**
|
|
139
|
+
* tags of the component.
|
|
140
|
+
*/
|
|
141
|
+
tags: TagMap,
|
|
142
|
+
/**
|
|
143
|
+
* component build status
|
|
144
|
+
*/
|
|
145
|
+
buildStatus?: string | undefined,
|
|
146
|
+
/**
|
|
147
|
+
* issues of component.
|
|
148
|
+
*/
|
|
149
|
+
issuesCount?: number | undefined,
|
|
150
|
+
/**
|
|
151
|
+
* status of component.
|
|
152
|
+
*/
|
|
153
|
+
status?: any,
|
|
154
|
+
/**
|
|
155
|
+
* deprecation info of the component.
|
|
156
|
+
*/
|
|
157
|
+
deprecation?: DeprecationInfo | undefined,
|
|
158
|
+
/**
|
|
159
|
+
* env descriptor.
|
|
160
|
+
*/
|
|
161
|
+
environment?: Descriptor | undefined,
|
|
162
|
+
/**
|
|
163
|
+
* description of the component.
|
|
164
|
+
*/
|
|
165
|
+
description?: string, labels?: string[],
|
|
166
|
+
/**
|
|
167
|
+
* host of the component
|
|
168
|
+
*/
|
|
169
|
+
host?: string | undefined,
|
|
170
|
+
/**
|
|
171
|
+
*
|
|
172
|
+
* size preview
|
|
173
|
+
*/
|
|
174
|
+
size?: ComponentPreviewSize | undefined,
|
|
175
|
+
/**
|
|
176
|
+
* latest version of component
|
|
177
|
+
*/
|
|
178
|
+
latest?: string | undefined, preview?: ComponentPreview | undefined, logs?: LegacyComponentLog[] | undefined);
|
|
179
|
+
get version(): string;
|
|
180
|
+
/**
|
|
181
|
+
* create an instance of a component from a plain object.
|
|
182
|
+
*/
|
|
183
|
+
static from({ id, server, displayName, compositions, packageName, tags, deprecation, buildStatus, env, status, issuesCount, description, labels, host, latest, preview, size, logs, }: ComponentModelProps): ComponentModel;
|
|
184
|
+
static fromArray(componentsProps: ComponentModelProps[]): ComponentModel[];
|
|
185
|
+
static empty(): ComponentModel;
|
|
186
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ComponentModel, ComponentModelProps } from './component-model';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React, { ComponentType } from 'react';
|
|
2
|
+
import { ComponentModel } from '../component-model';
|
|
3
|
+
export type ComponentPluginProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
4
|
+
component: ComponentModel;
|
|
5
|
+
};
|
|
6
|
+
export type ComponentResultPlugin = {
|
|
7
|
+
key: string;
|
|
8
|
+
start?: ComponentType<ComponentPluginProps>;
|
|
9
|
+
end?: ComponentType<ComponentPluginProps>;
|
|
10
|
+
};
|
|
11
|
+
type ComponentResultProps = {
|
|
12
|
+
component: ComponentModel;
|
|
13
|
+
plugins?: ComponentResultPlugin[];
|
|
14
|
+
};
|
|
15
|
+
export declare function ComponentResult({ component, plugins }: ComponentResultProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { SearchResult, FuzzySearchItem, FuzzySearcher } from '@teambit/explorer.ui.command-bar';
|
|
2
|
+
import type { SearchProvider } from '@teambit/command-bar';
|
|
3
|
+
import { ComponentResultPlugin } from './component-result';
|
|
4
|
+
import { ComponentModel } from '../component-model';
|
|
5
|
+
export type { ComponentResultPlugin };
|
|
6
|
+
type ComponentSearchIdx = {
|
|
7
|
+
name: string;
|
|
8
|
+
displayName: string;
|
|
9
|
+
component: ComponentModel;
|
|
10
|
+
};
|
|
11
|
+
type ComponentSearcherOptions = {
|
|
12
|
+
navigate: (path: string) => void;
|
|
13
|
+
resultPlugins?: ComponentResultPlugin[];
|
|
14
|
+
};
|
|
15
|
+
export declare class ComponentSearcher extends FuzzySearcher<ComponentModel, ComponentSearchIdx> implements SearchProvider {
|
|
16
|
+
options: ComponentSearcherOptions;
|
|
17
|
+
constructor(options: ComponentSearcherOptions);
|
|
18
|
+
updatePlugins(plugins: ComponentResultPlugin[]): void;
|
|
19
|
+
test(term: string): boolean;
|
|
20
|
+
protected toSearchableItem(item: ComponentModel): ComponentSearchIdx;
|
|
21
|
+
protected toSearchResult: ({ item }: FuzzySearchItem<ComponentSearchIdx>) => SearchResult;
|
|
22
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { RouteProps } from 'react-router-dom';
|
|
3
|
+
import type { RouteSlot } from '@teambit/ui-foundation.ui.react-router.slot-router';
|
|
4
|
+
import { SlotRegistry } from '@teambit/harmony';
|
|
5
|
+
import { UseComponentType, Filters } from './use-component';
|
|
6
|
+
import { ComponentModel } from './component-model';
|
|
7
|
+
export type ComponentPageSlot = SlotRegistry<ComponentPageElement[]>;
|
|
8
|
+
export type ComponentPageElement = {
|
|
9
|
+
type: 'before' | 'after';
|
|
10
|
+
content: ReactNode;
|
|
11
|
+
};
|
|
12
|
+
export type ComponentProps = {
|
|
13
|
+
containerSlot?: ComponentPageSlot;
|
|
14
|
+
routeSlot: RouteSlot;
|
|
15
|
+
overriddenRoutes?: RouteProps[];
|
|
16
|
+
host: string;
|
|
17
|
+
onComponentChange?: (activeComponent?: ComponentModel) => void;
|
|
18
|
+
useComponent?: UseComponentType;
|
|
19
|
+
useComponentFilters?: () => Filters;
|
|
20
|
+
path?: string;
|
|
21
|
+
componentIdStr?: string | (() => string | undefined);
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* main UI component of the Component extension.
|
|
25
|
+
*/
|
|
26
|
+
export declare function Component({ routeSlot, overriddenRoutes, containerSlot, host, onComponentChange, componentIdStr, useComponent, path, useComponentFilters, }: ComponentProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { ComponentDescriptor } from '@teambit/component-descriptor';
|
|
3
|
+
import { ComponentModel } from '../component-model';
|
|
4
|
+
export declare const ComponentContext: React.Context<ComponentModel>;
|
|
5
|
+
export declare const ComponentDescriptorContext: React.Context<ComponentDescriptor | undefined>;
|
|
6
|
+
export declare const useComponentDescriptor: () => ComponentDescriptor | undefined;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import type { ComponentDescriptor } from '@teambit/component-descriptor';
|
|
3
|
+
import { ComponentModel } from '../component-model';
|
|
4
|
+
export type ComponentProviderProps = {
|
|
5
|
+
/**
|
|
6
|
+
* component model.
|
|
7
|
+
*/
|
|
8
|
+
component: ComponentModel;
|
|
9
|
+
/**
|
|
10
|
+
* component children.
|
|
11
|
+
*/
|
|
12
|
+
children: ReactNode;
|
|
13
|
+
};
|
|
14
|
+
export declare function ComponentProvider({ component, children }: ComponentProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export type ComponentDescriptorProviderProps = {
|
|
16
|
+
/**
|
|
17
|
+
* component model.
|
|
18
|
+
*/
|
|
19
|
+
componentDescriptor?: ComponentDescriptor;
|
|
20
|
+
/**
|
|
21
|
+
* component children.
|
|
22
|
+
*/
|
|
23
|
+
children: ReactNode;
|
|
24
|
+
};
|
|
25
|
+
export declare function ComponentDescriptorProvider({ componentDescriptor, children }: ComponentDescriptorProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { ComponentContext, ComponentDescriptorContext, useComponentDescriptor } from './component-context';
|
|
2
|
+
export { ComponentProvider, ComponentDescriptorProvider } from './component-provider';
|
|
3
|
+
export type { ComponentProviderProps, ComponentDescriptorProviderProps } from './component-provider';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export { CollapsibleMenuNav, MenuNavProps } from './menu';
|
|
2
|
+
export { Component } from './component';
|
|
3
|
+
export { ConsumeMethodSlot, ComponentMenu, VersionRelatedDropdowns } from './menu';
|
|
4
|
+
export { ComponentModel, ComponentModelProps } from './component-model';
|
|
5
|
+
export { ComponentContext, ComponentProvider } from './context';
|
|
6
|
+
export { TopBarNav } from './top-bar-nav';
|
|
7
|
+
export { useComponent } from './use-component';
|
|
8
|
+
export { componentIdFields, componentOverviewFields, componentFields, componentFieldsWithLogs, COMPONENT_QUERY_LOG_FIELDS, GET_COMPONENT, GET_COMPONENT_WITH_LOGS, } from './use-component.fragments';
|
|
9
|
+
export { useIdFromLocation } from './use-component-from-location';
|
|
10
|
+
export type { LogFilter, Filters, UseComponentOptions, ComponentQueryResult, UseComponentType, ComponentLogs, ComponentLogsResult, } from './use-component.model';
|
|
11
|
+
export { useComponentQuery } from './use-component-query';
|
|
12
|
+
export { useComponentLogs } from './use-component-logs';
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { CollapsibleMenuNav, MenuNavProps } from './menu-nav';
|
|
2
|
+
export { ComponentMenu, VersionRelatedDropdowns, RightSideMenuItem, RightSideMenuSlot } from './menu';
|
|
3
|
+
export type { NavPlugin, OrderedNavigationSlot, ConsumePlugin, ConsumeMethodSlot, ConsumePluginProps, } from './nav-plugin';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { NavPlugin, OrderedNavigationSlot } from './nav-plugin';
|
|
3
|
+
export type MenuNavProps = {
|
|
4
|
+
/**
|
|
5
|
+
* @deprecated
|
|
6
|
+
* use @property navPlugins
|
|
7
|
+
*/
|
|
8
|
+
navigationSlot?: OrderedNavigationSlot;
|
|
9
|
+
/**
|
|
10
|
+
* @deprecated
|
|
11
|
+
* use @property widgetPlugins
|
|
12
|
+
*/
|
|
13
|
+
widgetSlot?: OrderedNavigationSlot;
|
|
14
|
+
navPlugins?: [string, NavPlugin][];
|
|
15
|
+
widgetPlugins?: [string, NavPlugin][];
|
|
16
|
+
/**
|
|
17
|
+
* A className to pass to the secondary nav, i.e dropdown
|
|
18
|
+
*/
|
|
19
|
+
secondaryNavClassName?: string;
|
|
20
|
+
activeTabIndex?: number;
|
|
21
|
+
alwaysShowActiveTab?: boolean;
|
|
22
|
+
} & React.HTMLAttributes<HTMLElement>;
|
|
23
|
+
export declare function CollapsibleMenuNav({ navigationSlot, widgetSlot, navPlugins, widgetPlugins, className, secondaryNavClassName, activeTabIndex, alwaysShowActiveTab, children, }: MenuNavProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
import { SlotRegistry } from '@teambit/harmony';
|
|
3
|
+
import { DropdownComponentVersion, GetActiveTabIndex } from '@teambit/component.ui.version-dropdown';
|
|
4
|
+
import { MenuItemSlot } from '@teambit/ui-foundation.ui.main-dropdown';
|
|
5
|
+
import { LanesModel } from '@teambit/lanes.ui.models.lanes-model';
|
|
6
|
+
import { UseComponentType, Filters } from '../use-component';
|
|
7
|
+
import { OrderedNavigationSlot, ConsumeMethodSlot } from './nav-plugin';
|
|
8
|
+
import { ComponentID } from '../..';
|
|
9
|
+
export type RightSideMenuItem = {
|
|
10
|
+
item: ReactNode;
|
|
11
|
+
order: number;
|
|
12
|
+
};
|
|
13
|
+
export type RightSideMenuSlot = SlotRegistry<RightSideMenuItem[]>;
|
|
14
|
+
export type MenuProps = {
|
|
15
|
+
className?: string;
|
|
16
|
+
/**
|
|
17
|
+
* skip the right side.
|
|
18
|
+
*/
|
|
19
|
+
skipRightSide?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* custom render the right side
|
|
22
|
+
*/
|
|
23
|
+
RightNode?: React.ReactNode;
|
|
24
|
+
/**
|
|
25
|
+
* slot for top bar menu nav items
|
|
26
|
+
*/
|
|
27
|
+
navigationSlot: OrderedNavigationSlot;
|
|
28
|
+
/**
|
|
29
|
+
* right side navigation menu item slot
|
|
30
|
+
*/
|
|
31
|
+
widgetSlot: OrderedNavigationSlot;
|
|
32
|
+
/**
|
|
33
|
+
* right side menu item slot
|
|
34
|
+
*/
|
|
35
|
+
rightSideMenuSlot: RightSideMenuSlot;
|
|
36
|
+
/**
|
|
37
|
+
* workspace or scope
|
|
38
|
+
*/
|
|
39
|
+
host: string;
|
|
40
|
+
/**
|
|
41
|
+
* main dropdown item slot
|
|
42
|
+
*/
|
|
43
|
+
menuItemSlot: MenuItemSlot;
|
|
44
|
+
consumeMethodSlot: ConsumeMethodSlot;
|
|
45
|
+
componentIdStr?: string | (() => string | undefined);
|
|
46
|
+
useComponent?: UseComponentType;
|
|
47
|
+
useComponentFilters?: () => Filters;
|
|
48
|
+
useLanes?: () => {
|
|
49
|
+
loading?: boolean;
|
|
50
|
+
lanesModel?: LanesModel;
|
|
51
|
+
};
|
|
52
|
+
path?: string;
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* top bar menu.
|
|
56
|
+
*/
|
|
57
|
+
export declare function ComponentMenu({ navigationSlot, widgetSlot, className, host, menuItemSlot, consumeMethodSlot, rightSideMenuSlot, componentIdStr, skipRightSide, RightNode, useComponent, path, useComponentFilters, }: MenuProps): import("react/jsx-runtime").JSX.Element;
|
|
58
|
+
export type VersionRelatedDropdownsProps = {
|
|
59
|
+
componentId?: string;
|
|
60
|
+
consumeMethods?: ConsumeMethodSlot;
|
|
61
|
+
componentFilters?: Filters;
|
|
62
|
+
useComponent?: UseComponentVersions;
|
|
63
|
+
className?: string;
|
|
64
|
+
loading?: boolean;
|
|
65
|
+
host: string;
|
|
66
|
+
useLanes?: () => {
|
|
67
|
+
loading?: boolean;
|
|
68
|
+
lanesModel?: LanesModel;
|
|
69
|
+
};
|
|
70
|
+
dropdownOptions?: {
|
|
71
|
+
showVersionDetails?: boolean;
|
|
72
|
+
getActiveTabIndex?: GetActiveTabIndex;
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
export type UseComponentVersionsProps = {
|
|
76
|
+
skip?: boolean;
|
|
77
|
+
id?: string;
|
|
78
|
+
initialLoad?: boolean;
|
|
79
|
+
};
|
|
80
|
+
export type UseComponentVersionProps = {
|
|
81
|
+
skip?: boolean;
|
|
82
|
+
version?: string;
|
|
83
|
+
};
|
|
84
|
+
export type UseComponentVersions = (props?: UseComponentVersionsProps) => UseComponentVersionsResult;
|
|
85
|
+
export type UseComponentVersion = (props?: UseComponentVersionProps) => DropdownComponentVersion | undefined;
|
|
86
|
+
export type UseComponentVersionsResult = {
|
|
87
|
+
tags?: DropdownComponentVersion[];
|
|
88
|
+
snaps?: DropdownComponentVersion[];
|
|
89
|
+
id?: ComponentID;
|
|
90
|
+
packageName?: string;
|
|
91
|
+
latest?: string;
|
|
92
|
+
currentVersion?: string;
|
|
93
|
+
loading?: boolean;
|
|
94
|
+
};
|
|
95
|
+
export declare function defaultLoadVersions(host: string, componentId?: string, componentFilters?: Filters, useComponent?: UseComponentType, loadingFromProps?: boolean): UseComponentVersions;
|
|
96
|
+
export declare const defaultLoadCurrentVersion: (props: VersionRelatedDropdownsProps) => UseComponentVersion;
|
|
97
|
+
export declare function VersionRelatedDropdowns(props: VersionRelatedDropdownsProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { SlotRegistry } from '@teambit/harmony';
|
|
2
|
+
import type { LinkProps } from '@teambit/base-react.navigation.link';
|
|
3
|
+
import type { ConsumeMethod } from '@teambit/ui-foundation.ui.use-box.menu';
|
|
4
|
+
import { LaneModel } from '@teambit/lanes.ui.models.lanes-model';
|
|
5
|
+
import { ComponentID, ComponentModel } from '../..';
|
|
6
|
+
export type NavPluginProps = {
|
|
7
|
+
displayName?: string;
|
|
8
|
+
ignoreQueryParams?: boolean;
|
|
9
|
+
} & LinkProps;
|
|
10
|
+
export type NavPlugin = {
|
|
11
|
+
props: NavPluginProps;
|
|
12
|
+
order?: number;
|
|
13
|
+
};
|
|
14
|
+
export type OrderedNavigationSlot = SlotRegistry<NavPlugin>;
|
|
15
|
+
export type ConsumePluginOptions = {
|
|
16
|
+
viewedLane?: LaneModel;
|
|
17
|
+
hide?: boolean;
|
|
18
|
+
disableInstall?: boolean;
|
|
19
|
+
};
|
|
20
|
+
export type ConsumePluginProps = {
|
|
21
|
+
id: ComponentID;
|
|
22
|
+
packageName: string;
|
|
23
|
+
latest?: string;
|
|
24
|
+
componentModel?: ComponentModel;
|
|
25
|
+
options?: ConsumePluginOptions;
|
|
26
|
+
};
|
|
27
|
+
export type ConsumePlugin = (props: ConsumePluginProps) => ConsumeMethod | undefined;
|
|
28
|
+
export type ConsumeMethodSlot = SlotRegistry<ConsumePlugin[]>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './top-bar-nav';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useIdFromLocation(url?: string, deriveScopeFromSearchParams?: boolean): string | undefined;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ComponentLogsResult, Filters } from './use-component.model';
|
|
2
|
+
export declare function useComponentLogs(componentId: string, host: string, filters?: Filters, skipFromProps?: boolean): ComponentLogsResult;
|
|
3
|
+
export declare function useComponentLogsInit(componentId: string, host: string, filters?: Filters, skip?: boolean): {
|
|
4
|
+
logOffset: number | undefined;
|
|
5
|
+
variables: {
|
|
6
|
+
id: string;
|
|
7
|
+
extensionId: string;
|
|
8
|
+
logOffset: any;
|
|
9
|
+
logLimit: number | undefined;
|
|
10
|
+
logType: string | undefined;
|
|
11
|
+
logHead: string | undefined;
|
|
12
|
+
logSort: string | undefined;
|
|
13
|
+
logTakeHeadFromComponent: boolean | undefined;
|
|
14
|
+
};
|
|
15
|
+
skip: boolean | undefined;
|
|
16
|
+
};
|