@abcagency/hc-ui-components 1.6.1 → 1.6.2
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/components/HireControlMap.js +2 -1
- package/dist/components/HireControlMap.js.map +1 -1
- package/dist/components/containers/list/list-item/list-item-container.js +2 -0
- package/dist/components/containers/list/list-item/list-item-container.js.map +1 -1
- package/dist/components/modules/list/list-item/list-item.js +4 -3
- package/dist/components/modules/list/list-item/list-item.js.map +1 -1
- package/dist/components/modules/maps/tabs.js +1 -1
- package/dist/components/modules/maps/tabs.js.map +1 -1
- package/dist/contexts/mapListContext.js +2 -1
- package/dist/contexts/mapListContext.js.map +1 -1
- package/dist/node_modules/@algolia/client-common/dist/common.js +541 -0
- package/dist/node_modules/@algolia/client-common/dist/common.js.map +1 -0
- package/dist/node_modules/@algolia/requester-browser-xhr/dist/requester.xhr.js +4 -0
- package/dist/node_modules/@algolia/requester-browser-xhr/dist/requester.xhr.js.map +1 -0
- package/dist/node_modules/algoliasearch/dist/lite/builds/browser.js +272 -0
- package/dist/node_modules/algoliasearch/dist/lite/builds/browser.js.map +1 -0
- package/dist/util/algoliaSearchUtil.js +1 -1
- package/package.json +2 -1
- package/src/components/HireControlMap.js +1 -1
- package/src/components/containers/list/list-item/list-item-container.js +2 -1
- package/src/components/modules/list/list-item/list-item.jsx +3 -2
- package/src/components/modules/maps/tabs.js +1 -1
- package/src/contexts/mapListContext.tsx +4 -0
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
import { createXhrRequester as m } from '../../../../@algolia/requester-browser-xhr/dist/requester.xhr.js';
|
|
2
|
+
import { createNullLogger, createMemoryCache, createFallbackableCache, createTransporter, getAlgoliaAgent, createBrowserLocalStorageCache, shuffle, createAuth } from '../../../../@algolia/client-common/dist/common.js';
|
|
3
|
+
|
|
4
|
+
// lite/builds/browser.ts
|
|
5
|
+
var apiClientVersion = "5.40.0";
|
|
6
|
+
function getDefaultHosts(appId) {
|
|
7
|
+
return [
|
|
8
|
+
{
|
|
9
|
+
url: `${appId}-dsn.algolia.net`,
|
|
10
|
+
accept: "read",
|
|
11
|
+
protocol: "https"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
url: `${appId}.algolia.net`,
|
|
15
|
+
accept: "write",
|
|
16
|
+
protocol: "https"
|
|
17
|
+
}
|
|
18
|
+
].concat(
|
|
19
|
+
shuffle([
|
|
20
|
+
{
|
|
21
|
+
url: `${appId}-1.algolianet.com`,
|
|
22
|
+
accept: "readWrite",
|
|
23
|
+
protocol: "https"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
url: `${appId}-2.algolianet.com`,
|
|
27
|
+
accept: "readWrite",
|
|
28
|
+
protocol: "https"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
url: `${appId}-3.algolianet.com`,
|
|
32
|
+
accept: "readWrite",
|
|
33
|
+
protocol: "https"
|
|
34
|
+
}
|
|
35
|
+
])
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
function createLiteClient({
|
|
39
|
+
appId: appIdOption,
|
|
40
|
+
apiKey: apiKeyOption,
|
|
41
|
+
authMode,
|
|
42
|
+
algoliaAgents,
|
|
43
|
+
...options
|
|
44
|
+
}) {
|
|
45
|
+
const auth = createAuth(appIdOption, apiKeyOption, authMode);
|
|
46
|
+
const transporter = createTransporter({
|
|
47
|
+
hosts: getDefaultHosts(appIdOption),
|
|
48
|
+
...options,
|
|
49
|
+
algoliaAgent: getAlgoliaAgent({
|
|
50
|
+
algoliaAgents,
|
|
51
|
+
client: "Lite",
|
|
52
|
+
version: apiClientVersion
|
|
53
|
+
}),
|
|
54
|
+
baseHeaders: {
|
|
55
|
+
"content-type": "text/plain",
|
|
56
|
+
...auth.headers(),
|
|
57
|
+
...options.baseHeaders
|
|
58
|
+
},
|
|
59
|
+
baseQueryParameters: {
|
|
60
|
+
...auth.queryParameters(),
|
|
61
|
+
...options.baseQueryParameters
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
return {
|
|
65
|
+
transporter,
|
|
66
|
+
/**
|
|
67
|
+
* The `appId` currently in use.
|
|
68
|
+
*/
|
|
69
|
+
appId: appIdOption,
|
|
70
|
+
/**
|
|
71
|
+
* The `apiKey` currently in use.
|
|
72
|
+
*/
|
|
73
|
+
apiKey: apiKeyOption,
|
|
74
|
+
/**
|
|
75
|
+
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
|
|
76
|
+
*/
|
|
77
|
+
clearCache() {
|
|
78
|
+
return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => void 0);
|
|
79
|
+
},
|
|
80
|
+
/**
|
|
81
|
+
* Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
|
|
82
|
+
*/
|
|
83
|
+
get _ua() {
|
|
84
|
+
return transporter.algoliaAgent.value;
|
|
85
|
+
},
|
|
86
|
+
/**
|
|
87
|
+
* Adds a `segment` to the `x-algolia-agent` sent with every requests.
|
|
88
|
+
*
|
|
89
|
+
* @param segment - The algolia agent (user-agent) segment to add.
|
|
90
|
+
* @param version - The version of the agent.
|
|
91
|
+
*/
|
|
92
|
+
addAlgoliaAgent(segment, version) {
|
|
93
|
+
transporter.algoliaAgent.add({ segment, version });
|
|
94
|
+
},
|
|
95
|
+
/**
|
|
96
|
+
* Helper method to switch the API key used to authenticate the requests.
|
|
97
|
+
*
|
|
98
|
+
* @param params - Method params.
|
|
99
|
+
* @param params.apiKey - The new API Key to use.
|
|
100
|
+
*/
|
|
101
|
+
setClientApiKey({ apiKey }) {
|
|
102
|
+
if (!authMode || authMode === "WithinHeaders") {
|
|
103
|
+
transporter.baseHeaders["x-algolia-api-key"] = apiKey;
|
|
104
|
+
} else {
|
|
105
|
+
transporter.baseQueryParameters["x-algolia-api-key"] = apiKey;
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
/**
|
|
109
|
+
* Helper: calls the `search` method but with certainty that we will only request Algolia records (hits) and not facets.
|
|
110
|
+
* Disclaimer: We don't assert that the parameters you pass to this method only contains `hits` requests to prevent impacting search performances, this helper is purely for typing purposes.
|
|
111
|
+
*
|
|
112
|
+
* @summary Search multiple indices for `hits`.
|
|
113
|
+
* @param searchMethodParams - Query requests and strategies. Results will be received in the same order as the queries.
|
|
114
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
115
|
+
*/
|
|
116
|
+
searchForHits(searchMethodParams, requestOptions) {
|
|
117
|
+
return this.search(searchMethodParams, requestOptions);
|
|
118
|
+
},
|
|
119
|
+
/**
|
|
120
|
+
* Helper: calls the `search` method but with certainty that we will only request Algolia facets and not records (hits).
|
|
121
|
+
* Disclaimer: We don't assert that the parameters you pass to this method only contains `facets` requests to prevent impacting search performances, this helper is purely for typing purposes.
|
|
122
|
+
*
|
|
123
|
+
* @summary Search multiple indices for `facets`.
|
|
124
|
+
* @param searchMethodParams - Query requests and strategies. Results will be received in the same order as the queries.
|
|
125
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
126
|
+
*/
|
|
127
|
+
searchForFacets(searchMethodParams, requestOptions) {
|
|
128
|
+
return this.search(searchMethodParams, requestOptions);
|
|
129
|
+
},
|
|
130
|
+
/**
|
|
131
|
+
* This method lets you send requests to the Algolia REST API.
|
|
132
|
+
* @param customPost - The customPost object.
|
|
133
|
+
* @param customPost.path - Path of the endpoint, for example `1/newFeature`.
|
|
134
|
+
* @param customPost.parameters - Query parameters to apply to the current query.
|
|
135
|
+
* @param customPost.body - Parameters to send with the custom request.
|
|
136
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
137
|
+
*/
|
|
138
|
+
customPost({ path, parameters, body }, requestOptions) {
|
|
139
|
+
if (!path) {
|
|
140
|
+
throw new Error("Parameter `path` is required when calling `customPost`.");
|
|
141
|
+
}
|
|
142
|
+
const requestPath = "/{path}".replace("{path}", path);
|
|
143
|
+
const headers = {};
|
|
144
|
+
const queryParameters = parameters ? parameters : {};
|
|
145
|
+
const request = {
|
|
146
|
+
method: "POST",
|
|
147
|
+
path: requestPath,
|
|
148
|
+
queryParameters,
|
|
149
|
+
headers,
|
|
150
|
+
data: body ? body : {}
|
|
151
|
+
};
|
|
152
|
+
return transporter.request(request, requestOptions);
|
|
153
|
+
},
|
|
154
|
+
/**
|
|
155
|
+
* Retrieves recommendations from selected AI models.
|
|
156
|
+
*
|
|
157
|
+
* Required API Key ACLs:
|
|
158
|
+
* - search
|
|
159
|
+
* @param getRecommendationsParams - The getRecommendationsParams object.
|
|
160
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
161
|
+
*/
|
|
162
|
+
getRecommendations(getRecommendationsParams, requestOptions) {
|
|
163
|
+
if (getRecommendationsParams && Array.isArray(getRecommendationsParams)) {
|
|
164
|
+
const newSignatureRequest = {
|
|
165
|
+
requests: getRecommendationsParams
|
|
166
|
+
};
|
|
167
|
+
getRecommendationsParams = newSignatureRequest;
|
|
168
|
+
}
|
|
169
|
+
if (!getRecommendationsParams) {
|
|
170
|
+
throw new Error("Parameter `getRecommendationsParams` is required when calling `getRecommendations`.");
|
|
171
|
+
}
|
|
172
|
+
if (!getRecommendationsParams.requests) {
|
|
173
|
+
throw new Error("Parameter `getRecommendationsParams.requests` is required when calling `getRecommendations`.");
|
|
174
|
+
}
|
|
175
|
+
const requestPath = "/1/indexes/*/recommendations";
|
|
176
|
+
const headers = {};
|
|
177
|
+
const queryParameters = {};
|
|
178
|
+
const request = {
|
|
179
|
+
method: "POST",
|
|
180
|
+
path: requestPath,
|
|
181
|
+
queryParameters,
|
|
182
|
+
headers,
|
|
183
|
+
data: getRecommendationsParams,
|
|
184
|
+
useReadTransporter: true,
|
|
185
|
+
cacheable: true
|
|
186
|
+
};
|
|
187
|
+
return transporter.request(request, requestOptions);
|
|
188
|
+
},
|
|
189
|
+
/**
|
|
190
|
+
* Sends multiple search requests to one or more indices. This can be useful in these cases: - Different indices for different purposes, such as, one index for products, another one for marketing content. - Multiple searches to the same index—for example, with different filters. Use the helper `searchForHits` or `searchForFacets` to get the results in a more convenient format, if you already know the return type you want.
|
|
191
|
+
*
|
|
192
|
+
* Required API Key ACLs:
|
|
193
|
+
* - search
|
|
194
|
+
* @param searchMethodParams - Muli-search request body. Results are returned in the same order as the requests.
|
|
195
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
196
|
+
*/
|
|
197
|
+
search(searchMethodParams, requestOptions) {
|
|
198
|
+
if (searchMethodParams && Array.isArray(searchMethodParams)) {
|
|
199
|
+
const newSignatureRequest = {
|
|
200
|
+
requests: searchMethodParams.map(({ params, ...legacyRequest }) => {
|
|
201
|
+
if (legacyRequest.type === "facet") {
|
|
202
|
+
return {
|
|
203
|
+
...legacyRequest,
|
|
204
|
+
...params,
|
|
205
|
+
type: "facet"
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
return {
|
|
209
|
+
...legacyRequest,
|
|
210
|
+
...params,
|
|
211
|
+
facet: void 0,
|
|
212
|
+
maxFacetHits: void 0,
|
|
213
|
+
facetQuery: void 0
|
|
214
|
+
};
|
|
215
|
+
})
|
|
216
|
+
};
|
|
217
|
+
searchMethodParams = newSignatureRequest;
|
|
218
|
+
}
|
|
219
|
+
if (!searchMethodParams) {
|
|
220
|
+
throw new Error("Parameter `searchMethodParams` is required when calling `search`.");
|
|
221
|
+
}
|
|
222
|
+
if (!searchMethodParams.requests) {
|
|
223
|
+
throw new Error("Parameter `searchMethodParams.requests` is required when calling `search`.");
|
|
224
|
+
}
|
|
225
|
+
const requestPath = "/1/indexes/*/queries";
|
|
226
|
+
const headers = {};
|
|
227
|
+
const queryParameters = {};
|
|
228
|
+
const request = {
|
|
229
|
+
method: "POST",
|
|
230
|
+
path: requestPath,
|
|
231
|
+
queryParameters,
|
|
232
|
+
headers,
|
|
233
|
+
data: searchMethodParams,
|
|
234
|
+
useReadTransporter: true,
|
|
235
|
+
cacheable: true
|
|
236
|
+
};
|
|
237
|
+
return transporter.request(request, requestOptions);
|
|
238
|
+
}
|
|
239
|
+
};
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
// lite/builds/browser.ts
|
|
243
|
+
function liteClient(appId, apiKey, options) {
|
|
244
|
+
if (!appId || typeof appId !== "string") {
|
|
245
|
+
throw new Error("`appId` is missing.");
|
|
246
|
+
}
|
|
247
|
+
if (!apiKey || typeof apiKey !== "string") {
|
|
248
|
+
throw new Error("`apiKey` is missing.");
|
|
249
|
+
}
|
|
250
|
+
return createLiteClient({
|
|
251
|
+
appId,
|
|
252
|
+
apiKey,
|
|
253
|
+
timeouts: {
|
|
254
|
+
connect: 1e3,
|
|
255
|
+
read: 2e3,
|
|
256
|
+
write: 3e4
|
|
257
|
+
},
|
|
258
|
+
logger: createNullLogger(),
|
|
259
|
+
requester: m(),
|
|
260
|
+
algoliaAgents: [{ segment: "Browser" }],
|
|
261
|
+
authMode: "WithinQueryParameters",
|
|
262
|
+
responsesCache: createMemoryCache(),
|
|
263
|
+
requestsCache: createMemoryCache({ serializable: false }),
|
|
264
|
+
hostsCache: createFallbackableCache({
|
|
265
|
+
caches: [createBrowserLocalStorageCache({ key: `${apiClientVersion}-${appId}` }), createMemoryCache()]
|
|
266
|
+
}),
|
|
267
|
+
...options
|
|
268
|
+
});
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
export { apiClientVersion, liteClient };
|
|
272
|
+
//# sourceMappingURL=browser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser.js","sources":["../../../../../../node_modules/algoliasearch/dist/lite/builds/browser.js"],"sourcesContent":["// lite/builds/browser.ts\nimport { createXhrRequester } from \"@algolia/requester-browser-xhr\";\nimport {\n createBrowserLocalStorageCache,\n createFallbackableCache,\n createMemoryCache,\n createNullLogger\n} from \"@algolia/client-common\";\n\n// lite/src/liteClient.ts\nimport { createAuth, createTransporter, getAlgoliaAgent, shuffle } from \"@algolia/client-common\";\nvar apiClientVersion = \"5.40.0\";\nfunction getDefaultHosts(appId) {\n return [\n {\n url: `${appId}-dsn.algolia.net`,\n accept: \"read\",\n protocol: \"https\"\n },\n {\n url: `${appId}.algolia.net`,\n accept: \"write\",\n protocol: \"https\"\n }\n ].concat(\n shuffle([\n {\n url: `${appId}-1.algolianet.com`,\n accept: \"readWrite\",\n protocol: \"https\"\n },\n {\n url: `${appId}-2.algolianet.com`,\n accept: \"readWrite\",\n protocol: \"https\"\n },\n {\n url: `${appId}-3.algolianet.com`,\n accept: \"readWrite\",\n protocol: \"https\"\n }\n ])\n );\n}\nfunction createLiteClient({\n appId: appIdOption,\n apiKey: apiKeyOption,\n authMode,\n algoliaAgents,\n ...options\n}) {\n const auth = createAuth(appIdOption, apiKeyOption, authMode);\n const transporter = createTransporter({\n hosts: getDefaultHosts(appIdOption),\n ...options,\n algoliaAgent: getAlgoliaAgent({\n algoliaAgents,\n client: \"Lite\",\n version: apiClientVersion\n }),\n baseHeaders: {\n \"content-type\": \"text/plain\",\n ...auth.headers(),\n ...options.baseHeaders\n },\n baseQueryParameters: {\n ...auth.queryParameters(),\n ...options.baseQueryParameters\n }\n });\n return {\n transporter,\n /**\n * The `appId` currently in use.\n */\n appId: appIdOption,\n /**\n * The `apiKey` currently in use.\n */\n apiKey: apiKeyOption,\n /**\n * Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.\n */\n clearCache() {\n return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => void 0);\n },\n /**\n * Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.\n */\n get _ua() {\n return transporter.algoliaAgent.value;\n },\n /**\n * Adds a `segment` to the `x-algolia-agent` sent with every requests.\n *\n * @param segment - The algolia agent (user-agent) segment to add.\n * @param version - The version of the agent.\n */\n addAlgoliaAgent(segment, version) {\n transporter.algoliaAgent.add({ segment, version });\n },\n /**\n * Helper method to switch the API key used to authenticate the requests.\n *\n * @param params - Method params.\n * @param params.apiKey - The new API Key to use.\n */\n setClientApiKey({ apiKey }) {\n if (!authMode || authMode === \"WithinHeaders\") {\n transporter.baseHeaders[\"x-algolia-api-key\"] = apiKey;\n } else {\n transporter.baseQueryParameters[\"x-algolia-api-key\"] = apiKey;\n }\n },\n /**\n * Helper: calls the `search` method but with certainty that we will only request Algolia records (hits) and not facets.\n * Disclaimer: We don't assert that the parameters you pass to this method only contains `hits` requests to prevent impacting search performances, this helper is purely for typing purposes.\n *\n * @summary Search multiple indices for `hits`.\n * @param searchMethodParams - Query requests and strategies. Results will be received in the same order as the queries.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n searchForHits(searchMethodParams, requestOptions) {\n return this.search(searchMethodParams, requestOptions);\n },\n /**\n * Helper: calls the `search` method but with certainty that we will only request Algolia facets and not records (hits).\n * Disclaimer: We don't assert that the parameters you pass to this method only contains `facets` requests to prevent impacting search performances, this helper is purely for typing purposes.\n *\n * @summary Search multiple indices for `facets`.\n * @param searchMethodParams - Query requests and strategies. Results will be received in the same order as the queries.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n searchForFacets(searchMethodParams, requestOptions) {\n return this.search(searchMethodParams, requestOptions);\n },\n /**\n * This method lets you send requests to the Algolia REST API.\n * @param customPost - The customPost object.\n * @param customPost.path - Path of the endpoint, for example `1/newFeature`.\n * @param customPost.parameters - Query parameters to apply to the current query.\n * @param customPost.body - Parameters to send with the custom request.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customPost({ path, parameters, body }, requestOptions) {\n if (!path) {\n throw new Error(\"Parameter `path` is required when calling `customPost`.\");\n }\n const requestPath = \"/{path}\".replace(\"{path}\", path);\n const headers = {};\n const queryParameters = parameters ? parameters : {};\n const request = {\n method: \"POST\",\n path: requestPath,\n queryParameters,\n headers,\n data: body ? body : {}\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * Retrieves recommendations from selected AI models.\n *\n * Required API Key ACLs:\n * - search\n * @param getRecommendationsParams - The getRecommendationsParams object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getRecommendations(getRecommendationsParams, requestOptions) {\n if (getRecommendationsParams && Array.isArray(getRecommendationsParams)) {\n const newSignatureRequest = {\n requests: getRecommendationsParams\n };\n getRecommendationsParams = newSignatureRequest;\n }\n if (!getRecommendationsParams) {\n throw new Error(\"Parameter `getRecommendationsParams` is required when calling `getRecommendations`.\");\n }\n if (!getRecommendationsParams.requests) {\n throw new Error(\"Parameter `getRecommendationsParams.requests` is required when calling `getRecommendations`.\");\n }\n const requestPath = \"/1/indexes/*/recommendations\";\n const headers = {};\n const queryParameters = {};\n const request = {\n method: \"POST\",\n path: requestPath,\n queryParameters,\n headers,\n data: getRecommendationsParams,\n useReadTransporter: true,\n cacheable: true\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * Sends multiple search requests to one or more indices. This can be useful in these cases: - Different indices for different purposes, such as, one index for products, another one for marketing content. - Multiple searches to the same index—for example, with different filters. Use the helper `searchForHits` or `searchForFacets` to get the results in a more convenient format, if you already know the return type you want.\n *\n * Required API Key ACLs:\n * - search\n * @param searchMethodParams - Muli-search request body. Results are returned in the same order as the requests.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n search(searchMethodParams, requestOptions) {\n if (searchMethodParams && Array.isArray(searchMethodParams)) {\n const newSignatureRequest = {\n requests: searchMethodParams.map(({ params, ...legacyRequest }) => {\n if (legacyRequest.type === \"facet\") {\n return {\n ...legacyRequest,\n ...params,\n type: \"facet\"\n };\n }\n return {\n ...legacyRequest,\n ...params,\n facet: void 0,\n maxFacetHits: void 0,\n facetQuery: void 0\n };\n })\n };\n searchMethodParams = newSignatureRequest;\n }\n if (!searchMethodParams) {\n throw new Error(\"Parameter `searchMethodParams` is required when calling `search`.\");\n }\n if (!searchMethodParams.requests) {\n throw new Error(\"Parameter `searchMethodParams.requests` is required when calling `search`.\");\n }\n const requestPath = \"/1/indexes/*/queries\";\n const headers = {};\n const queryParameters = {};\n const request = {\n method: \"POST\",\n path: requestPath,\n queryParameters,\n headers,\n data: searchMethodParams,\n useReadTransporter: true,\n cacheable: true\n };\n return transporter.request(request, requestOptions);\n }\n };\n}\n\n// lite/builds/browser.ts\nfunction liteClient(appId, apiKey, options) {\n if (!appId || typeof appId !== \"string\") {\n throw new Error(\"`appId` is missing.\");\n }\n if (!apiKey || typeof apiKey !== \"string\") {\n throw new Error(\"`apiKey` is missing.\");\n }\n return createLiteClient({\n appId,\n apiKey,\n timeouts: {\n connect: 1e3,\n read: 2e3,\n write: 3e4\n },\n logger: createNullLogger(),\n requester: createXhrRequester(),\n algoliaAgents: [{ segment: \"Browser\" }],\n authMode: \"WithinQueryParameters\",\n responsesCache: createMemoryCache(),\n requestsCache: createMemoryCache({ serializable: false }),\n hostsCache: createFallbackableCache({\n caches: [createBrowserLocalStorageCache({ key: `${apiClientVersion}-${appId}` }), createMemoryCache()]\n }),\n ...options\n });\n}\nexport {\n apiClientVersion,\n liteClient\n};\n//# sourceMappingURL=browser.js.map"],"names":["createXhrRequester"],"mappings":";;;AAAA;AAWG,IAAC,gBAAgB,GAAG,SAAS;AAChC,SAAS,eAAe,CAAC,KAAK,EAAE;AAChC,EAAE,OAAO;AACT,IAAI;AACJ,MAAM,GAAG,EAAE,CAAC,EAAE,KAAK,CAAC,gBAAgB,CAAC;AACrC,MAAM,MAAM,EAAE,MAAM;AACpB,MAAM,QAAQ,EAAE,OAAO;AACvB,KAAK;AACL,IAAI;AACJ,MAAM,GAAG,EAAE,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC;AACjC,MAAM,MAAM,EAAE,OAAO;AACrB,MAAM,QAAQ,EAAE,OAAO;AACvB,KAAK;AACL,GAAG,CAAC,MAAM;AACV,IAAI,OAAO,CAAC;AACZ,MAAM;AACN,QAAQ,GAAG,EAAE,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC;AACxC,QAAQ,MAAM,EAAE,WAA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G;AAClB,MAAM,IAAI,EAAE,GAAG;AACf,MAAM,KAAK,EAAE,GAAG;AAChB,KAAK;AACL,IAAI,MAAM,EAAE,gBAAgB,EAAE;AAC9B,IAAI,SAAS,EAAEA,CAAkB,EAAE;AACnC,IAAI,aAAa,EAAE,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC;AAC3C,IAAI,QAAQ,EAAE,uBAAuB;AACrC,IAAI,cAAc,EAAE,iBAAiB,EAAE;AACvC,IAAI,aAAa,EAAE,iBAAiB,CAAC,EAAE,YAAY,EAAE,KAAK,EAAE,CAAC;AAC7D,IAAI,UAAU,EAAE,uBAAuB,CAAC;AACxC,MAAM,MAAM,EAAE,CAAC,8BAA8B,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,gBAAgB,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,iBAAiB,EAAE,CAAC;AAC5G,KAAK,CAAC;AACN,IAAI,GAAG,OAAO;AACd,GAAG,CAAC,CAAC;AACL;;;;","x_google_ignoreList":[0]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { asyncToGenerator as _asyncToGenerator, regeneratorRuntime as _regeneratorRuntime } from '../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
|
-
import { liteClient } from 'algoliasearch/lite';
|
|
2
|
+
import { liteClient } from '../node_modules/algoliasearch/dist/lite/builds/browser.js';
|
|
3
3
|
|
|
4
4
|
var algoliaClient = null;
|
|
5
5
|
var algoliaIndexName = null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abcagency/hc-ui-components",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.2",
|
|
4
4
|
"description": "UI Components for HireControl",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"files": [
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"ajv": "^8.16.0",
|
|
28
28
|
"ajv-keywords": "^5.1.0",
|
|
29
|
+
"algoliasearch": "^5.17.1",
|
|
29
30
|
"fuse.js": "^7.0.0",
|
|
30
31
|
"tailwind-merge": "^2.2.0"
|
|
31
32
|
},
|
|
@@ -59,7 +59,7 @@ const ContextProviders = ({ children, siteConfig, trackEvent, googleMapsApiKey,
|
|
|
59
59
|
secondary={siteConfig.colors.secondary}
|
|
60
60
|
secondaryDark={siteConfig.colors.secondaryDark}
|
|
61
61
|
>
|
|
62
|
-
<MapListProvider siteConfig={siteConfig} {...mapListProps}>
|
|
62
|
+
<MapListProvider siteConfig={siteConfig} googleMapsApiKey={googleMapsApiKey} {...mapListProps}>
|
|
63
63
|
<MapProvider resetFilters={mapListProps.resetFilters} defaultZoomOverride={mapListProps.defaultZoomOverride} localStorageKey={mapListProps.localStorageKey}>
|
|
64
64
|
<PlacesProvider
|
|
65
65
|
placeMappings={siteConfig.pointsOfInterestConfig.placeMappings ?? {}}
|
|
@@ -13,7 +13,7 @@ const ListItemContainer = ({
|
|
|
13
13
|
onItemSelected,
|
|
14
14
|
...props
|
|
15
15
|
}) => {
|
|
16
|
-
const { siteConfig, favorites, handleSettingFavorites, setMobileTab } = useMapList();
|
|
16
|
+
const { siteConfig, googleMapsApiKey, favorites, handleSettingFavorites, setMobileTab } = useMapList();
|
|
17
17
|
const { eventTypes } = useTrackEvent();
|
|
18
18
|
|
|
19
19
|
return (
|
|
@@ -28,6 +28,7 @@ const ListItemContainer = ({
|
|
|
28
28
|
onItemSelected={onItemSelected}
|
|
29
29
|
setMobileTab={setMobileTab}
|
|
30
30
|
siteConfig={siteConfig}
|
|
31
|
+
googleMapsApiKey={googleMapsApiKey}
|
|
31
32
|
favorites={favorites}
|
|
32
33
|
handleSettingFavorites={handleSettingFavorites}
|
|
33
34
|
{...props}
|
|
@@ -19,6 +19,7 @@ const ListItem = forwardRef(
|
|
|
19
19
|
favorites,
|
|
20
20
|
includeFavorite = true,
|
|
21
21
|
siteConfig,
|
|
22
|
+
googleMapsApiKey,
|
|
22
23
|
...props
|
|
23
24
|
},
|
|
24
25
|
ref
|
|
@@ -110,10 +111,10 @@ const ListItem = forwardRef(
|
|
|
110
111
|
}
|
|
111
112
|
</Grid>
|
|
112
113
|
{/* MOBILE ONLY: This map section is visible on mobile and hidden on desktop (md:hc-hidden) */}
|
|
113
|
-
{showMap && item.mapDetails && (
|
|
114
|
+
{showMap && item.mapDetails && googleMapsApiKey && (
|
|
114
115
|
<div onClick={() => { setMobileTab("mapTab"); handleClick(); }} className="md:hc-hidden hc-w-2/5 sm:hc-w-1/3 hc-p-1.5 hc-my-1 hc-bg-uiAccent/5 hc-border hc-border-uiAccent/10 hc-rounded-sm">
|
|
115
116
|
<img
|
|
116
|
-
src={`https://maps.googleapis.com/maps/api/staticmap?scale=2¢er=${item.mapDetails.latitude},${item.mapDetails.longitude}&zoom=10&size=240x180&maptype=roadmap&markers=color:0x${mapPinColor}%7Clabel:•%7C${item.mapDetails.latitude},${item.mapDetails.longitude}&key=${
|
|
117
|
+
src={`https://maps.googleapis.com/maps/api/staticmap?scale=2¢er=${item.mapDetails.latitude},${item.mapDetails.longitude}&zoom=10&size=240x180&maptype=roadmap&markers=color:0x${mapPinColor}%7Clabel:•%7C${item.mapDetails.latitude},${item.mapDetails.longitude}&key=${googleMapsApiKey}`}
|
|
117
118
|
alt={`Map of location for ${item.fields?.position || item.fields?.title || 'job'}`}
|
|
118
119
|
className="hc-w-full hc-h-full hc-object-cover"
|
|
119
120
|
/>
|
|
@@ -67,7 +67,7 @@ const MapTabs = ({
|
|
|
67
67
|
<div className="hc-flex-grow hc-h-[calc(100%-48px)]">
|
|
68
68
|
{/* List Tab Content */}
|
|
69
69
|
<Tabs.Content
|
|
70
|
-
className="hc-h-full hc-
|
|
70
|
+
className="hc-h-full hc-bg-white hc-outline-none"
|
|
71
71
|
value="listTab"
|
|
72
72
|
>
|
|
73
73
|
{list}
|
|
@@ -32,6 +32,7 @@ interface MapListContextProps {
|
|
|
32
32
|
setMobileTab: (tab: string) => void;
|
|
33
33
|
mobileTab: string;
|
|
34
34
|
siteConfig: SiteConfig;
|
|
35
|
+
googleMapsApiKey?: string;
|
|
35
36
|
favorites: number[];
|
|
36
37
|
resetEntityFilter: () => void;
|
|
37
38
|
handleSettingFavorites: (favorites: number[] | null) => void;
|
|
@@ -77,6 +78,7 @@ const getQuery = (localStorageKey: string = ''): string | null => {
|
|
|
77
78
|
interface MapListProviderProps {
|
|
78
79
|
children: ReactNode;
|
|
79
80
|
siteConfig: MapConfig;
|
|
81
|
+
googleMapsApiKey?: string;
|
|
80
82
|
resetFilters: boolean;
|
|
81
83
|
navigateToDetails: (id: number) => void;
|
|
82
84
|
navigateToEasyApply: (id: number) => void;
|
|
@@ -104,6 +106,7 @@ interface MapListProviderProps {
|
|
|
104
106
|
export const MapListProvider: React.FC<MapListProviderProps> = ({
|
|
105
107
|
children,
|
|
106
108
|
siteConfig,
|
|
109
|
+
googleMapsApiKey,
|
|
107
110
|
resetFilters,
|
|
108
111
|
navigateToDetails,
|
|
109
112
|
navigateToEasyApply,
|
|
@@ -378,6 +381,7 @@ export const MapListProvider: React.FC<MapListProviderProps> = ({
|
|
|
378
381
|
setMobileTab,
|
|
379
382
|
mobileTab,
|
|
380
383
|
siteConfig,
|
|
384
|
+
googleMapsApiKey,
|
|
381
385
|
favorites,
|
|
382
386
|
handleSettingFavorites,
|
|
383
387
|
resetEntityFilter,
|