@dropins/tools 1.6.0-beta1 → 1.6.0-beta2
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/chunks/icons/Business.js +4 -0
- package/chunks/icons/Business.js.map +1 -0
- package/chunks/icons/List.js +4 -0
- package/chunks/icons/List.js.map +1 -0
- package/chunks/icons/Quote.js +4 -0
- package/chunks/icons/Quote.js.map +1 -0
- package/chunks/icons/Structure.js +4 -0
- package/chunks/icons/Structure.js.map +1 -0
- package/chunks/icons/Team.js +4 -0
- package/chunks/icons/Team.js.map +1 -0
- package/chunks/initializer.js +1 -1
- package/components.js +1 -1
- package/components.js.map +1 -1
- package/fetch-graphql.js +1 -1
- package/fetch-graphql.js.map +1 -1
- package/initializer.js +1 -1
- package/package.json +1 -1
- package/types/elsie/src/components/Pagination/Pagination.d.ts +2 -1
- package/types/elsie/src/components/Pagination/PaginationButton.d.ts +11 -0
- package/types/elsie/src/icons/index.d.ts +29 -24
- package/types/fetch-graphql/src/index.d.ts +83 -5
|
@@ -1,44 +1,49 @@
|
|
|
1
1
|
export { default as Add } from './Add.svg';
|
|
2
|
+
export { default as AddressBook } from './AddressBook.svg';
|
|
2
3
|
export { default as Bulk } from './Bulk.svg';
|
|
3
4
|
export { default as Burger } from './Burger.svg';
|
|
5
|
+
export { default as Business } from './Business.svg';
|
|
6
|
+
export { default as Card } from './Card.svg';
|
|
4
7
|
export { default as Cart } from './Cart.svg';
|
|
5
8
|
export { default as Check } from './Check.svg';
|
|
9
|
+
export { default as CheckWithCircle } from './CheckWithCircle.svg';
|
|
6
10
|
export { default as ChevronDown } from './ChevronDown.svg';
|
|
7
|
-
export { default as ChevronUp } from './ChevronUp.svg';
|
|
8
11
|
export { default as ChevronRight } from './ChevronRight.svg';
|
|
12
|
+
export { default as ChevronUp } from './ChevronUp.svg';
|
|
9
13
|
export { default as Close } from './Close.svg';
|
|
14
|
+
export { default as Coupon } from './Coupon.svg';
|
|
15
|
+
export { default as Date } from './Date.svg';
|
|
16
|
+
export { default as Delivery } from './Delivery.svg';
|
|
17
|
+
export { default as Edit } from './Edit.svg';
|
|
18
|
+
export { default as EmptyBox } from './EmptyBox.svg';
|
|
19
|
+
export { default as Eye } from './Eye.svg';
|
|
20
|
+
export { default as EyeClose } from './EyeClose.svg';
|
|
21
|
+
export { default as Gift } from './Gift.svg';
|
|
22
|
+
export { default as GiftCard } from './GiftCard.svg';
|
|
10
23
|
export { default as Heart } from './Heart.svg';
|
|
24
|
+
export { default as HeartFilled } from './HeartFilled.svg';
|
|
25
|
+
export { default as InfoFilled } from './InfoFilled.svg';
|
|
26
|
+
export { default as List } from './List.svg';
|
|
27
|
+
export { default as Locker } from './Locker.svg';
|
|
11
28
|
export { default as Minus } from './Minus.svg';
|
|
29
|
+
export { default as Order } from './Order.svg';
|
|
30
|
+
export { default as OrderError } from './OrderError.svg';
|
|
31
|
+
export { default as OrderSuccess } from './OrderSuccess.svg';
|
|
32
|
+
export { default as PaymentError } from './PaymentError.svg';
|
|
12
33
|
export { default as Placeholder } from './Placeholder.svg';
|
|
13
34
|
export { default as PlaceholderFilled } from './PlaceholderFilled.svg';
|
|
35
|
+
export { default as Quote } from './Quote.svg';
|
|
14
36
|
export { default as Search } from './Search.svg';
|
|
15
37
|
export { default as SearchFilled } from './SearchFilled.svg';
|
|
16
38
|
export { default as Sort } from './Sort.svg';
|
|
17
39
|
export { default as Star } from './Star.svg';
|
|
18
|
-
export { default as
|
|
40
|
+
export { default as Structure } from './Structure.svg';
|
|
41
|
+
export { default as Team } from './Team.svg';
|
|
42
|
+
export { default as Trash } from './Trash.svg';
|
|
19
43
|
export { default as User } from './User.svg';
|
|
20
|
-
export { default as
|
|
21
|
-
export { default as Locker } from './Locker.svg';
|
|
44
|
+
export { default as View } from './View.svg';
|
|
22
45
|
export { default as Wallet } from './Wallet.svg';
|
|
23
|
-
export { default as
|
|
24
|
-
export { default as Order } from './Order.svg';
|
|
25
|
-
export { default as Delivery } from './Delivery.svg';
|
|
26
|
-
export { default as OrderError } from './OrderError.svg';
|
|
27
|
-
export { default as OrderSuccess } from './OrderSuccess.svg';
|
|
28
|
-
export { default as PaymentError } from './PaymentError.svg';
|
|
29
|
-
export { default as CheckWithCircle } from './CheckWithCircle.svg';
|
|
30
|
-
export { default as WarningWithCircle } from './WarningWithCircle.svg';
|
|
46
|
+
export { default as Warning } from './Warning.svg';
|
|
31
47
|
export { default as WarningFilled } from './WarningFilled.svg';
|
|
32
|
-
export { default as
|
|
33
|
-
export { default as HeartFilled } from './HeartFilled.svg';
|
|
34
|
-
export { default as Trash } from './Trash.svg';
|
|
35
|
-
export { default as Eye } from './Eye.svg';
|
|
36
|
-
export { default as EyeClose } from './EyeClose.svg';
|
|
37
|
-
export { default as Date } from './Date.svg';
|
|
38
|
-
export { default as AddressBook } from './AddressBook.svg';
|
|
39
|
-
export { default as EmptyBox } from './EmptyBox.svg';
|
|
40
|
-
export { default as Coupon } from './Coupon.svg';
|
|
41
|
-
export { default as Gift } from './Gift.svg';
|
|
42
|
-
export { default as GiftCard } from './GiftCard.svg';
|
|
43
|
-
export { default as Edit } from './Edit.svg';
|
|
48
|
+
export { default as WarningWithCircle } from './WarningWithCircle.svg';
|
|
44
49
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -32,15 +32,20 @@ export type AfterHook<T = any> = (requestInit: RequestInit, response: {
|
|
|
32
32
|
data: T;
|
|
33
33
|
};
|
|
34
34
|
declare class FetchGraphQLMesh {
|
|
35
|
-
_endpoint?: string;
|
|
36
|
-
get endpoint(): string | undefined;
|
|
37
|
-
get fetchGraphQlHeaders(): Header;
|
|
35
|
+
protected _endpoint?: string;
|
|
38
36
|
_fetchGraphQlHeaders: Header;
|
|
39
37
|
_beforeHooks: BeforeHook[];
|
|
40
38
|
_afterHooks: AfterHook[];
|
|
39
|
+
get endpoint(): string | undefined;
|
|
40
|
+
get fetchGraphQlHeaders(): Header;
|
|
41
41
|
/**
|
|
42
42
|
* Sets the GraphQL endpoint.
|
|
43
|
-
* @param endpoint - The GraphQL endpoint.
|
|
43
|
+
* @param endpoint - The GraphQL endpoint URL string.
|
|
44
|
+
* @example
|
|
45
|
+
* ```js
|
|
46
|
+
* // Set endpoint as string
|
|
47
|
+
* instance.setEndpoint('https://api.example.com/graphql');
|
|
48
|
+
* ```
|
|
44
49
|
*/
|
|
45
50
|
setEndpoint(endpoint: string): void;
|
|
46
51
|
/**
|
|
@@ -106,6 +111,16 @@ declare class FetchGraphQLMesh {
|
|
|
106
111
|
* ```
|
|
107
112
|
*/
|
|
108
113
|
addAfterHook(hook: AfterHook): void;
|
|
114
|
+
/**
|
|
115
|
+
* Collects all before hooks. Can be overridden by subclasses for inheritance.
|
|
116
|
+
* @protected
|
|
117
|
+
*/
|
|
118
|
+
protected _collectBeforeHooks(): BeforeHook[];
|
|
119
|
+
/**
|
|
120
|
+
* Collects all after hooks. Can be overridden by subclasses for inheritance.
|
|
121
|
+
* @protected
|
|
122
|
+
*/
|
|
123
|
+
protected _collectAfterHooks(): AfterHook[];
|
|
109
124
|
/**
|
|
110
125
|
* Fetches GraphQL data.
|
|
111
126
|
* @param query - The GraphQL query.
|
|
@@ -143,14 +158,75 @@ declare class FetchGraphQLMesh {
|
|
|
143
158
|
}
|
|
144
159
|
/**
|
|
145
160
|
* `FetchGraphQL` is a class that extends `FetchGraphQLMesh`.
|
|
146
|
-
* It provides methods to get the GraphQL endpoint and headers.
|
|
161
|
+
* It provides methods to get the GraphQL endpoint and headers with support for inheritance.
|
|
147
162
|
*
|
|
148
163
|
* @class
|
|
149
164
|
*
|
|
150
165
|
*/
|
|
151
166
|
export declare class FetchGraphQL extends FetchGraphQLMesh {
|
|
167
|
+
private _mode;
|
|
168
|
+
private _source?;
|
|
152
169
|
get endpoint(): string | undefined;
|
|
153
170
|
get fetchGraphQlHeaders(): Header;
|
|
171
|
+
/**
|
|
172
|
+
* Sets the GraphQL endpoint or links to another FetchGraphQL instance.
|
|
173
|
+
* @param endpoint - The GraphQL endpoint URL string, or a FetchGraphQL instance to link to.
|
|
174
|
+
* @example
|
|
175
|
+
* ```js
|
|
176
|
+
* // Set endpoint as string
|
|
177
|
+
* instance.setEndpoint('https://api.example.com/graphql');
|
|
178
|
+
*
|
|
179
|
+
* // Link to another instance
|
|
180
|
+
* const parent = new FetchGraphQL();
|
|
181
|
+
* parent.setEndpoint('https://api.example.com/graphql');
|
|
182
|
+
*
|
|
183
|
+
* const child = new FetchGraphQL();
|
|
184
|
+
* child.setEndpoint(parent); // Links to parent, shares endpoint, headers, and hooks
|
|
185
|
+
* ```
|
|
186
|
+
*/
|
|
187
|
+
setEndpoint(endpoint: string | FetchGraphQL): void;
|
|
188
|
+
/**
|
|
189
|
+
* Sets a GraphQL header. When linked to another instance, this sets the header on the linked instance.
|
|
190
|
+
* @param key - The key of the header.
|
|
191
|
+
* @param value - The value of the header.
|
|
192
|
+
*/
|
|
193
|
+
setFetchGraphQlHeader(key: string, value: string | null): void;
|
|
194
|
+
/**
|
|
195
|
+
* Sets the GraphQL headers. When linked to another instance, this sets the headers on the linked instance.
|
|
196
|
+
* @param header - The header object or a function that returns a header object.
|
|
197
|
+
*/
|
|
198
|
+
setFetchGraphQlHeaders(header: Header | ((prev: Header) => Header)): void;
|
|
199
|
+
/**
|
|
200
|
+
* Removes a specific GraphQL header. When linked to another instance, this removes the header from the linked instance.
|
|
201
|
+
* @param key - The key of the header.
|
|
202
|
+
*/
|
|
203
|
+
removeFetchGraphQlHeader(key: string): void;
|
|
204
|
+
/**
|
|
205
|
+
* Gets the value of a specific GraphQL header. When linked to another instance, this gets the header from the linked instance.
|
|
206
|
+
* @param key - The key of the header.
|
|
207
|
+
* @returns The value of the header, or undefined if not found.
|
|
208
|
+
*/
|
|
209
|
+
getFetchGraphQlHeader(key: string): string | null | undefined;
|
|
210
|
+
/**
|
|
211
|
+
* Adds a before hook. When linked to another instance, this adds the hook to the linked instance.
|
|
212
|
+
* @param hook - The hook function.
|
|
213
|
+
*/
|
|
214
|
+
addBeforeHook(hook: BeforeHook): void;
|
|
215
|
+
/**
|
|
216
|
+
* Adds an after hook. When linked to another instance, this adds the hook to the linked instance.
|
|
217
|
+
* @param hook - The hook function.
|
|
218
|
+
*/
|
|
219
|
+
addAfterHook(hook: AfterHook): void;
|
|
220
|
+
/**
|
|
221
|
+
* Collects all before hooks. When linked, delegates to the linked instance.
|
|
222
|
+
* @protected
|
|
223
|
+
*/
|
|
224
|
+
protected _collectBeforeHooks(): BeforeHook[];
|
|
225
|
+
/**
|
|
226
|
+
* Collects all after hooks. When linked, delegates to the linked instance.
|
|
227
|
+
* @protected
|
|
228
|
+
*/
|
|
229
|
+
protected _collectAfterHooks(): AfterHook[];
|
|
154
230
|
}
|
|
155
231
|
/**
|
|
156
232
|
* Exports several methods from the `mesh` object.
|
|
@@ -162,6 +238,8 @@ export declare class FetchGraphQL extends FetchGraphQLMesh {
|
|
|
162
238
|
* @property {Function} removeFetchGraphQlHeader - Removes a specific GraphQL header.
|
|
163
239
|
* @property {Function} fetchGraphQl - Fetches GraphQL data.
|
|
164
240
|
* @property {Function} getConfig - Gets the configuration.
|
|
241
|
+
* @property {Function} addBeforeHook - Adds a hook executed before the GraphQL call.
|
|
242
|
+
* @property {Function} addAfterHook - Adds a hook executed after the GraphQL call.
|
|
165
243
|
*/
|
|
166
244
|
export declare const setEndpoint: (endpoint: string) => void, setFetchGraphQlHeaders: (header: Header | ((prev: Header) => Header)) => void, setFetchGraphQlHeader: (key: string, value: string | null) => void, getFetchGraphQlHeader: (key: string) => string | null | undefined, removeFetchGraphQlHeader: (key: string) => void, fetchGraphQl: <T = any>(query: string, options?: FetchOptions) => Promise<{
|
|
167
245
|
errors?: FetchQueryError | undefined;
|