@hubspot/ui-extensions 0.11.0 → 0.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/__synced__/remoteComponents.synced.d.ts +85 -354
- package/dist/__synced__/remoteComponents.synced.js +88 -83
- package/dist/__synced__/types/components/index.synced.d.ts +38 -38
- package/dist/__synced__/types/index.synced.d.ts +7 -7
- package/dist/__synced__/types/index.synced.js +1 -9
- package/dist/__synced__/types/shared.synced.d.ts +2 -3
- package/dist/__synced__/utils/remote-component-registry.synced.d.ts +80 -0
- package/dist/__synced__/utils/remote-component-registry.synced.js +64 -0
- package/dist/experimental/testing/internal/constants.d.ts +2 -0
- package/dist/experimental/testing/internal/constants.js +1 -0
- package/dist/experimental/testing/internal/debug.d.ts +8 -0
- package/dist/experimental/testing/internal/debug.js +10 -0
- package/dist/experimental/testing/internal/element.d.ts +11 -0
- package/dist/experimental/testing/internal/element.js +67 -0
- package/dist/experimental/testing/internal/errors.d.ts +44 -0
- package/dist/experimental/testing/internal/errors.js +52 -0
- package/dist/experimental/testing/internal/fragment.d.ts +8 -0
- package/dist/experimental/testing/internal/fragment.js +44 -0
- package/dist/experimental/testing/internal/print.d.ts +6 -0
- package/dist/experimental/testing/internal/print.js +114 -0
- package/dist/experimental/testing/internal/query.d.ts +57 -0
- package/dist/experimental/testing/internal/query.js +231 -0
- package/dist/experimental/testing/internal/root.d.ts +8 -0
- package/dist/experimental/testing/internal/root.js +44 -0
- package/dist/experimental/testing/internal/text.d.ts +9 -0
- package/dist/experimental/testing/internal/text.js +16 -0
- package/dist/experimental/testing/types.d.ts +1 -1
- package/dist/hubspot.d.ts +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/pages/home/index.d.ts +1 -1
- package/dist/pages/home/index.js +1 -1
- package/package.json +10 -5
- package/dist/coreComponents.d.ts +0 -848
- package/dist/coreComponents.js +0 -582
- package/dist/experimental/types.d.ts +0 -240
- package/dist/experimental/types.js +0 -5
- package/dist/types.d.ts +0 -3214
- package/dist/types.js +0 -244
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { HubSpotReactComponent, UnknownComponentProps } from '../../../__synced__/types/shared.synced';
|
|
2
|
+
import type { ElementMatcher, RenderedElementNode } from '../types';
|
|
3
|
+
import type { RenderedParentNodeInternal } from './types-internal';
|
|
4
|
+
/**
|
|
5
|
+
* Finds the first descendant element node that matches the given component.
|
|
6
|
+
*
|
|
7
|
+
* @param parentNode The parent node to search in.
|
|
8
|
+
* @param targetComponent The component to find.
|
|
9
|
+
* @param matcher An optional matcher to filter the elements.
|
|
10
|
+
* @returns The first element node that matches the given component or `null` if no match is found.
|
|
11
|
+
*/
|
|
12
|
+
export declare const maybeFind: <TProps extends UnknownComponentProps>(parentNode: RenderedParentNodeInternal, targetComponent: HubSpotReactComponent<TProps>, matcher?: ElementMatcher<TProps> | undefined) => RenderedElementNode<TProps> | null;
|
|
13
|
+
/**
|
|
14
|
+
* Finds the first descendant element node that matches the given component.
|
|
15
|
+
*
|
|
16
|
+
* @param parentNode The parent node to search in.
|
|
17
|
+
* @param targetComponent The component to find.
|
|
18
|
+
* @param matcher An optional matcher to filter the elements.
|
|
19
|
+
* @returns The first element node that matches the given component.
|
|
20
|
+
*/
|
|
21
|
+
export declare const find: <TProps extends UnknownComponentProps>(parentNode: RenderedParentNodeInternal, targetComponent: HubSpotReactComponent<TProps>, matcher?: ElementMatcher<TProps> | undefined) => RenderedElementNode<TProps>;
|
|
22
|
+
/**
|
|
23
|
+
* Finds all descendant element nodes that match the given component.
|
|
24
|
+
*
|
|
25
|
+
* @param parentNode The parent node to search in.
|
|
26
|
+
* @param targetComponent The component to find.
|
|
27
|
+
* @param matcher An optional matcher to filter the elements.
|
|
28
|
+
* @returns An array of element nodes that match the given component.
|
|
29
|
+
*/
|
|
30
|
+
export declare const findAll: <TProps extends UnknownComponentProps>(parentNode: RenderedParentNodeInternal, targetComponent: HubSpotReactComponent<TProps>, matcher?: ElementMatcher<TProps> | undefined) => RenderedElementNode<TProps>[];
|
|
31
|
+
/**
|
|
32
|
+
* Finds the first direct child element node that matches the given component.
|
|
33
|
+
*
|
|
34
|
+
* @param parentNode The parent node to search in.
|
|
35
|
+
* @param targetComponent The component to find.
|
|
36
|
+
* @param matcher An optional matcher to filter the elements.
|
|
37
|
+
* @returns The first child element node that matches the given component.
|
|
38
|
+
*/
|
|
39
|
+
export declare const findChild: <TProps extends UnknownComponentProps>(parentNode: RenderedParentNodeInternal, targetComponent: HubSpotReactComponent<TProps>, matcher?: ElementMatcher<TProps> | undefined) => RenderedElementNode<TProps>;
|
|
40
|
+
/**
|
|
41
|
+
* Finds the first direct child element node that matches the given component.
|
|
42
|
+
*
|
|
43
|
+
* @param parentNode The parent node to search in.
|
|
44
|
+
* @param targetComponent The component to find.
|
|
45
|
+
* @param matcher An optional matcher to filter the elements.
|
|
46
|
+
* @returns The first child element node that matches the given component.
|
|
47
|
+
*/
|
|
48
|
+
export declare const maybeFindChild: <TProps extends UnknownComponentProps>(parentNode: RenderedParentNodeInternal, targetComponent: HubSpotReactComponent<TProps>, matcher?: ElementMatcher<TProps> | undefined) => RenderedElementNode<TProps> | null;
|
|
49
|
+
/**
|
|
50
|
+
* Finds all direct child element nodes that match the given component.
|
|
51
|
+
*
|
|
52
|
+
* @param parentNode The parent node to search in.
|
|
53
|
+
* @param targetComponent The component to find.
|
|
54
|
+
* @param matcher An optional matcher to filter the elements.
|
|
55
|
+
* @returns An array of child element nodes that match the given component.
|
|
56
|
+
*/
|
|
57
|
+
export declare const findAllChildren: <TProps extends UnknownComponentProps>(parentNode: RenderedParentNodeInternal, targetComponent: HubSpotReactComponent<TProps>, matcher?: ElementMatcher<TProps> | undefined) => RenderedElementNode<TProps>[];
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
import { __hubSpotComponentRegistry } from '../../../__synced__/remoteComponents.synced';
|
|
2
|
+
import { isRenderedElementNode, isRenderedFragmentNode } from '../type-utils';
|
|
3
|
+
import { ComponentNotFoundError, FindInvalidComponentError, InvalidComponentsError, } from './errors';
|
|
4
|
+
/**
|
|
5
|
+
* Checks if the element matches the matcher.
|
|
6
|
+
*
|
|
7
|
+
* @param element The element to check.
|
|
8
|
+
* @param matcher An optional matcher to filter the elements.
|
|
9
|
+
* @returns `true` if the element matches the matcher, `false` otherwise.
|
|
10
|
+
*/
|
|
11
|
+
const checkElementMatches = (element, matcher) => {
|
|
12
|
+
// If no matcher is provided, the element matches
|
|
13
|
+
if (!matcher) {
|
|
14
|
+
return true;
|
|
15
|
+
}
|
|
16
|
+
// Check if the matcher is a predicate function
|
|
17
|
+
if (typeof matcher === 'function') {
|
|
18
|
+
return matcher(element);
|
|
19
|
+
}
|
|
20
|
+
// Check if all the props in the matcher match the props in the element
|
|
21
|
+
return Object.keys(matcher).every((key) => element.props[key] === matcher[key]);
|
|
22
|
+
};
|
|
23
|
+
const addMatchToFindResult = (findResult, match, options) => {
|
|
24
|
+
if (options.findFirstOnly) {
|
|
25
|
+
findResult.match = match;
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
findResult.allMatches.push(match);
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Recursive helper for finding elements in the rendered tree.
|
|
33
|
+
* NOTE: The input `findResult` is mutated in place.
|
|
34
|
+
*
|
|
35
|
+
* @param parentNode The parent node to search in.
|
|
36
|
+
* @param options The options for the find operation.
|
|
37
|
+
* @param findResult The find result to mutate.
|
|
38
|
+
*/
|
|
39
|
+
const findInternalHelper = (parentNode, options, findResult) => {
|
|
40
|
+
const { children } = parentNode;
|
|
41
|
+
const { targetComponent, matcher, findFirstOnly, findDirectChildrenOnly } = options;
|
|
42
|
+
const targetComponentName = __hubSpotComponentRegistry.getComponentName(targetComponent);
|
|
43
|
+
for (const child of children) {
|
|
44
|
+
if (!isRenderedElementNode(child)) {
|
|
45
|
+
// Skip over non-element child nodes (just text nodes)
|
|
46
|
+
continue;
|
|
47
|
+
}
|
|
48
|
+
if (child.name === targetComponentName &&
|
|
49
|
+
checkElementMatches(child, matcher)) {
|
|
50
|
+
// We found a match, so add it to the find result
|
|
51
|
+
addMatchToFindResult(findResult, child, options);
|
|
52
|
+
if (findFirstOnly) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
// We only search in nested children and fragment props if we're not only looking for children
|
|
57
|
+
if (!findDirectChildrenOnly) {
|
|
58
|
+
// Search for the component in the fragment props
|
|
59
|
+
const { props } = child;
|
|
60
|
+
const fragmentProps = __hubSpotComponentRegistry.getComponentFragmentPropNames(child.name);
|
|
61
|
+
for (const fragmentPropName of fragmentProps) {
|
|
62
|
+
const maybeFragment = props[fragmentPropName];
|
|
63
|
+
// NOTE: As part of the conversion process of converting remote nodes to rendered nodes, we
|
|
64
|
+
// create a RenderedFragmentNode for each fragment prop and put that into the props object.
|
|
65
|
+
if (isRenderedFragmentNode(maybeFragment)) {
|
|
66
|
+
findInternalHelper(maybeFragment, options, findResult);
|
|
67
|
+
if (findFirstOnly && findResult.match) {
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
// Search for the component in the child
|
|
73
|
+
findInternalHelper(child, options, findResult);
|
|
74
|
+
if (findFirstOnly && findResult.match) {
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return;
|
|
80
|
+
};
|
|
81
|
+
/**
|
|
82
|
+
* Internal utility that centralizes finding elements in the rendered tree (including error handling).
|
|
83
|
+
*
|
|
84
|
+
* @param parentNode The parent node to search in.
|
|
85
|
+
* @param options The options for the find operation.
|
|
86
|
+
* @returns The find result.
|
|
87
|
+
*/
|
|
88
|
+
const findInternal = (parentNode, options) => {
|
|
89
|
+
const { document } = parentNode;
|
|
90
|
+
const { targetComponent, findMethodName, shouldThrowErrorIfNotFound } = options;
|
|
91
|
+
const targetComponentName = __hubSpotComponentRegistry.getComponentName(targetComponent);
|
|
92
|
+
if (!targetComponentName) {
|
|
93
|
+
throw new FindInvalidComponentError({
|
|
94
|
+
findMethodName,
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
// We always validate the document before running the find operation since the document may
|
|
98
|
+
// have been updated asynchronously in the background.
|
|
99
|
+
if (document.hasInvalidComponentNames()) {
|
|
100
|
+
throw new InvalidComponentsError(document.rootNode);
|
|
101
|
+
}
|
|
102
|
+
// Initialize the find result that will be mutated in place
|
|
103
|
+
const findResult = {
|
|
104
|
+
match: null,
|
|
105
|
+
allMatches: [],
|
|
106
|
+
};
|
|
107
|
+
// Run the internal find helper to recursively search the rendered tree
|
|
108
|
+
findInternalHelper(parentNode, options, findResult);
|
|
109
|
+
if (findResult.match === null && shouldThrowErrorIfNotFound) {
|
|
110
|
+
throw new ComponentNotFoundError({
|
|
111
|
+
findMethodName: options.findMethodName,
|
|
112
|
+
parentNode,
|
|
113
|
+
componentName: targetComponentName,
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
return findResult;
|
|
117
|
+
};
|
|
118
|
+
/**
|
|
119
|
+
* Finds the first descendant element node that matches the given component.
|
|
120
|
+
*
|
|
121
|
+
* @param parentNode The parent node to search in.
|
|
122
|
+
* @param targetComponent The component to find.
|
|
123
|
+
* @param matcher An optional matcher to filter the elements.
|
|
124
|
+
* @returns The first element node that matches the given component or `null` if no match is found.
|
|
125
|
+
*/
|
|
126
|
+
export const maybeFind = (parentNode, targetComponent, matcher) => {
|
|
127
|
+
const { match } = findInternal(parentNode, {
|
|
128
|
+
targetComponent,
|
|
129
|
+
matcher,
|
|
130
|
+
findFirstOnly: true,
|
|
131
|
+
findDirectChildrenOnly: false,
|
|
132
|
+
findMethodName: 'maybeFind',
|
|
133
|
+
shouldThrowErrorIfNotFound: false,
|
|
134
|
+
});
|
|
135
|
+
return match;
|
|
136
|
+
};
|
|
137
|
+
/**
|
|
138
|
+
* Finds the first descendant element node that matches the given component.
|
|
139
|
+
*
|
|
140
|
+
* @param parentNode The parent node to search in.
|
|
141
|
+
* @param targetComponent The component to find.
|
|
142
|
+
* @param matcher An optional matcher to filter the elements.
|
|
143
|
+
* @returns The first element node that matches the given component.
|
|
144
|
+
*/
|
|
145
|
+
export const find = (parentNode, targetComponent, matcher) => {
|
|
146
|
+
const { match } = findInternal(parentNode, {
|
|
147
|
+
targetComponent,
|
|
148
|
+
matcher,
|
|
149
|
+
findFirstOnly: true,
|
|
150
|
+
findDirectChildrenOnly: false,
|
|
151
|
+
findMethodName: 'find',
|
|
152
|
+
shouldThrowErrorIfNotFound: true,
|
|
153
|
+
});
|
|
154
|
+
return match;
|
|
155
|
+
};
|
|
156
|
+
/**
|
|
157
|
+
* Finds all descendant element nodes that match the given component.
|
|
158
|
+
*
|
|
159
|
+
* @param parentNode The parent node to search in.
|
|
160
|
+
* @param targetComponent The component to find.
|
|
161
|
+
* @param matcher An optional matcher to filter the elements.
|
|
162
|
+
* @returns An array of element nodes that match the given component.
|
|
163
|
+
*/
|
|
164
|
+
export const findAll = (parentNode, targetComponent, matcher) => {
|
|
165
|
+
const { allMatches } = findInternal(parentNode, {
|
|
166
|
+
targetComponent,
|
|
167
|
+
matcher,
|
|
168
|
+
findFirstOnly: false,
|
|
169
|
+
findDirectChildrenOnly: false,
|
|
170
|
+
findMethodName: 'findAll',
|
|
171
|
+
shouldThrowErrorIfNotFound: false,
|
|
172
|
+
});
|
|
173
|
+
return allMatches;
|
|
174
|
+
};
|
|
175
|
+
/**
|
|
176
|
+
* Finds the first direct child element node that matches the given component.
|
|
177
|
+
*
|
|
178
|
+
* @param parentNode The parent node to search in.
|
|
179
|
+
* @param targetComponent The component to find.
|
|
180
|
+
* @param matcher An optional matcher to filter the elements.
|
|
181
|
+
* @returns The first child element node that matches the given component.
|
|
182
|
+
*/
|
|
183
|
+
export const findChild = (parentNode, targetComponent, matcher) => {
|
|
184
|
+
const { match } = findInternal(parentNode, {
|
|
185
|
+
targetComponent,
|
|
186
|
+
matcher,
|
|
187
|
+
findFirstOnly: true,
|
|
188
|
+
findDirectChildrenOnly: true,
|
|
189
|
+
findMethodName: 'findChild',
|
|
190
|
+
shouldThrowErrorIfNotFound: true,
|
|
191
|
+
});
|
|
192
|
+
return match;
|
|
193
|
+
};
|
|
194
|
+
/**
|
|
195
|
+
* Finds the first direct child element node that matches the given component.
|
|
196
|
+
*
|
|
197
|
+
* @param parentNode The parent node to search in.
|
|
198
|
+
* @param targetComponent The component to find.
|
|
199
|
+
* @param matcher An optional matcher to filter the elements.
|
|
200
|
+
* @returns The first child element node that matches the given component.
|
|
201
|
+
*/
|
|
202
|
+
export const maybeFindChild = (parentNode, targetComponent, matcher) => {
|
|
203
|
+
const { match } = findInternal(parentNode, {
|
|
204
|
+
targetComponent,
|
|
205
|
+
matcher,
|
|
206
|
+
findFirstOnly: true,
|
|
207
|
+
findDirectChildrenOnly: true,
|
|
208
|
+
findMethodName: 'maybeFindChild',
|
|
209
|
+
shouldThrowErrorIfNotFound: false,
|
|
210
|
+
});
|
|
211
|
+
return match;
|
|
212
|
+
};
|
|
213
|
+
/**
|
|
214
|
+
* Finds all direct child element nodes that match the given component.
|
|
215
|
+
*
|
|
216
|
+
* @param parentNode The parent node to search in.
|
|
217
|
+
* @param targetComponent The component to find.
|
|
218
|
+
* @param matcher An optional matcher to filter the elements.
|
|
219
|
+
* @returns An array of child element nodes that match the given component.
|
|
220
|
+
*/
|
|
221
|
+
export const findAllChildren = (parentNode, targetComponent, matcher) => {
|
|
222
|
+
const { allMatches } = findInternal(parentNode, {
|
|
223
|
+
targetComponent,
|
|
224
|
+
matcher,
|
|
225
|
+
findFirstOnly: false,
|
|
226
|
+
findDirectChildrenOnly: true,
|
|
227
|
+
findMethodName: 'findAllChildren',
|
|
228
|
+
shouldThrowErrorIfNotFound: false,
|
|
229
|
+
});
|
|
230
|
+
return allMatches;
|
|
231
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { RenderedDocumentInternal, RenderedRootNodeInternal } from './types-internal';
|
|
2
|
+
/**
|
|
3
|
+
* Creates a rendered root node.
|
|
4
|
+
*
|
|
5
|
+
* @param document The document that the root belongs to.
|
|
6
|
+
* @returns A rendered root node.
|
|
7
|
+
*/
|
|
8
|
+
export declare const createRootNode: (document: RenderedDocumentInternal) => RenderedRootNodeInternal;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { RenderedNodeType } from '../types';
|
|
2
|
+
import { EMPTY_CHILDREN } from './constants';
|
|
3
|
+
import { debugLog } from './debug';
|
|
4
|
+
import { printNode } from './print';
|
|
5
|
+
import { find, findAll, findAllChildren, findChild, maybeFind, maybeFindChild, } from './query';
|
|
6
|
+
/**
|
|
7
|
+
* Creates a rendered root node.
|
|
8
|
+
*
|
|
9
|
+
* @param document The document that the root belongs to.
|
|
10
|
+
* @returns A rendered root node.
|
|
11
|
+
*/
|
|
12
|
+
export const createRootNode = (document) => {
|
|
13
|
+
const rootNode = {
|
|
14
|
+
nodeType: RenderedNodeType.Root,
|
|
15
|
+
text: null,
|
|
16
|
+
children: EMPTY_CHILDREN,
|
|
17
|
+
document,
|
|
18
|
+
debugLog: (label) => {
|
|
19
|
+
debugLog(rootNode, label);
|
|
20
|
+
},
|
|
21
|
+
find: (targetComponent, matcher) => {
|
|
22
|
+
return find(rootNode, targetComponent, matcher);
|
|
23
|
+
},
|
|
24
|
+
findAll: (targetComponent, matcher) => {
|
|
25
|
+
return findAll(rootNode, targetComponent, matcher);
|
|
26
|
+
},
|
|
27
|
+
findChild: (targetComponent, matcher) => {
|
|
28
|
+
return findChild(rootNode, targetComponent, matcher);
|
|
29
|
+
},
|
|
30
|
+
findAllChildren: (targetComponent, matcher) => {
|
|
31
|
+
return findAllChildren(rootNode, targetComponent, matcher);
|
|
32
|
+
},
|
|
33
|
+
maybeFind: (targetComponent, matcher) => {
|
|
34
|
+
return maybeFind(rootNode, targetComponent, matcher);
|
|
35
|
+
},
|
|
36
|
+
maybeFindChild: (targetComponent, matcher) => {
|
|
37
|
+
return maybeFindChild(rootNode, targetComponent, matcher);
|
|
38
|
+
},
|
|
39
|
+
toString: () => {
|
|
40
|
+
return printNode(rootNode);
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
return rootNode;
|
|
44
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type RemoteRoot, type RemoteText } from '@remote-ui/core';
|
|
2
|
+
import { type RenderedTextNode } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Creates a rendered text node.
|
|
5
|
+
*
|
|
6
|
+
* @param remoteText The remote text node or string to create a text node from.
|
|
7
|
+
* @returns A rendered text node.
|
|
8
|
+
*/
|
|
9
|
+
export declare const createTextNode: (remoteText: RemoteText<RemoteRoot> | string) => RenderedTextNode;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { RenderedNodeType } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Creates a rendered text node.
|
|
4
|
+
*
|
|
5
|
+
* @param remoteText The remote text node or string to create a text node from.
|
|
6
|
+
* @returns A rendered text node.
|
|
7
|
+
*/
|
|
8
|
+
export const createTextNode = (remoteText) => {
|
|
9
|
+
const text = typeof remoteText === 'string' ? remoteText : remoteText.text;
|
|
10
|
+
const textNode = {
|
|
11
|
+
nodeType: RenderedNodeType.Text,
|
|
12
|
+
text,
|
|
13
|
+
toString: () => text,
|
|
14
|
+
};
|
|
15
|
+
return textNode;
|
|
16
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { HubSpotReactComponent, HubSpotReactFragmentProp, UnknownComponentProps } from '../../types';
|
|
1
|
+
import { HubSpotReactComponent, HubSpotReactFragmentProp, UnknownComponentProps } from '../../__synced__/types/shared.synced';
|
|
2
2
|
/**
|
|
3
3
|
* The type of a rendered node.
|
|
4
4
|
*/
|
package/dist/hubspot.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReactElement } from 'react';
|
|
2
|
-
import type { ExtensionPoints, ExtensionPointApi, ServerlessRunnerParams, HubSpotFetchRequestURI, HubSpotFetchOptions } from './types';
|
|
2
|
+
import type { ExtensionPoints, ExtensionPointApi, ServerlessRunnerParams, HubSpotFetchRequestURI, HubSpotFetchOptions } from './__synced__/types/index.synced';
|
|
3
3
|
export declare function extend_V2<ExtensionPointName extends keyof ExtensionPoints>(renderExtensionCallback: (api: ExtensionPointApi<ExtensionPointName>) => ReactElement<any>): any;
|
|
4
4
|
export declare function serverless<T = any>(name: ServerlessRunnerParams['name'], options?: Omit<ServerlessRunnerParams, 'name'>): Promise<T>;
|
|
5
5
|
export declare function fetch(url: HubSpotFetchRequestURI, options?: HubSpotFetchOptions): Promise<Response>;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import './clientTypes';
|
|
2
2
|
export { hubspot } from './hubspot';
|
|
3
3
|
export { logger } from './logger';
|
|
4
|
-
export * from './
|
|
5
|
-
export
|
|
4
|
+
export * from './__synced__/types/index.synced';
|
|
5
|
+
export { Accordion, Alert, AutoGrid, BarChart, Box, Button, ButtonRow, Card, Checkbox, CurrencyInput, DateInput, DescriptionList, DescriptionListItem, Divider, Dropdown, EmptyState, ErrorState, Flex, Form, Heading, Icon, Illustration, Image, Inline, Input, LineChart, Link, List, LoadingButton, LoadingSpinner, Modal, ModalBody, ModalFooter, MultiSelect, NumberInput, Panel, PanelBody, PanelFooter, PanelSection, ProgressBar, RadioButton, SearchInput, Select, Stack, Statistics, StatisticsItem, StatisticsTrend, StatusTag, StepIndicator, StepperInput, Tab, Table, TableBody, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, Tag, Text, TextArea, Textarea, Tile, TimeInput, Toggle, ToggleGroup, Tooltip, } from './__synced__/remoteComponents.synced';
|
package/dist/index.js
CHANGED
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
import './clientTypes';
|
|
3
3
|
export { hubspot } from './hubspot';
|
|
4
4
|
export { logger } from './logger';
|
|
5
|
-
export * from './
|
|
6
|
-
export
|
|
5
|
+
export * from './__synced__/types/index.synced';
|
|
6
|
+
export { Accordion, Alert, AutoGrid, BarChart, Box, Button, ButtonRow, Card, Checkbox, CurrencyInput, DateInput, DescriptionList, DescriptionListItem, Divider, Dropdown, EmptyState, ErrorState, Flex, Form, Heading, Icon, Illustration, Image, Inline, Input, LineChart, Link, List, LoadingButton, LoadingSpinner, Modal, ModalBody, ModalFooter, MultiSelect, NumberInput, Panel, PanelBody, PanelFooter, PanelSection, ProgressBar, RadioButton, SearchInput, Select, Stack, Statistics, StatisticsItem, StatisticsTrend, StatusTag, StepIndicator, StepperInput, Tab, Table, TableBody, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, Tag, Text, TextArea, Textarea, Tile, TimeInput, Toggle, ToggleGroup, Tooltip, } from './__synced__/remoteComponents.synced';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export { HeaderActions, PrimaryHeaderActionButton, SecondaryHeaderActionButton, } from '../../__synced__/appHomeRemoteComponents.synced';
|
package/dist/pages/home/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export { HeaderActions, PrimaryHeaderActionButton, SecondaryHeaderActionButton, } from '../../__synced__/appHomeRemoteComponents.synced';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hubspot/ui-extensions",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
"scripts": {
|
|
9
9
|
"clean": "rm -rf dist/",
|
|
10
10
|
"build": "npm run clean && tsc",
|
|
11
|
+
"check:tsc": "tsc",
|
|
11
12
|
"watch": "npm run clean && tsc --watch",
|
|
12
13
|
"prepare": "npm run build",
|
|
13
14
|
"lint": "echo 'No linter configured for @hubspot/ui-extensions'",
|
|
@@ -29,15 +30,16 @@
|
|
|
29
30
|
},
|
|
30
31
|
"license": "MIT",
|
|
31
32
|
"dependencies": {
|
|
33
|
+
"@remote-ui/core": "2.2.7",
|
|
32
34
|
"@remote-ui/react": "5.0.2",
|
|
33
|
-
"react": "18.
|
|
35
|
+
"react": "18.3.1"
|
|
34
36
|
},
|
|
35
37
|
"engines": {
|
|
36
38
|
"node": ">=16"
|
|
37
39
|
},
|
|
38
40
|
"peerDependencies": {
|
|
39
41
|
"@remote-ui/react": "^5.0.0",
|
|
40
|
-
"react": "
|
|
42
|
+
"react": "18.3.1",
|
|
41
43
|
"typescript": "^5.0.4"
|
|
42
44
|
},
|
|
43
45
|
"peerDependenciesMeta": {
|
|
@@ -58,9 +60,12 @@
|
|
|
58
60
|
"@testing-library/dom": "^10.4.0",
|
|
59
61
|
"@testing-library/react": "^14.1.2",
|
|
60
62
|
"@types/jest": "^29.5.13",
|
|
63
|
+
"@types/node": "^20.11.0",
|
|
64
|
+
"@types/react": "^18.3.1",
|
|
65
|
+
"@types/react-dom": "^18.3.1",
|
|
61
66
|
"jest": "^29.7.0",
|
|
62
67
|
"jest-environment-jsdom": "^29.7.0",
|
|
63
|
-
"react-dom": "
|
|
68
|
+
"react-dom": "18.3.1",
|
|
64
69
|
"react-reconciler": "^0.29.0",
|
|
65
70
|
"ts-jest": "^29.1.1",
|
|
66
71
|
"tsd": "^0.33.0",
|
|
@@ -69,5 +74,5 @@
|
|
|
69
74
|
"tsd": {
|
|
70
75
|
"directory": "src/__tests__/test-d"
|
|
71
76
|
},
|
|
72
|
-
"gitHead": "
|
|
77
|
+
"gitHead": "5a5fb7266fc9f45165f4cc5dc011773beccf5057"
|
|
73
78
|
}
|