@inploi/plugin-job-search 3.2.1 → 3.3.0

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.
@@ -35,6 +35,7 @@ declare const getJobSearchResponseSchema: (t: TFunction) => import('valibot').Sc
35
35
  readonly lat: import('valibot').NumberSchema<undefined>;
36
36
  readonly lng: import('valibot').NumberSchema<undefined>;
37
37
  }, undefined>, undefined>, undefined>;
38
+ readonly locale: import('valibot').OptionalSchema<import('valibot').NullableSchema<import('valibot').StringSchema<undefined>, undefined>, undefined>;
38
39
  }, undefined>, import('valibot').TransformAction<{
39
40
  id: number;
40
41
  company_name: string;
@@ -66,6 +67,7 @@ declare const getJobSearchResponseSchema: (t: TFunction) => import('valibot').Sc
66
67
  lat: number;
67
68
  lng: number;
68
69
  } | null | undefined;
70
+ locale?: string | null | undefined;
69
71
  }, {
70
72
  id: number;
71
73
  createdAt: string | null;
@@ -112,6 +114,7 @@ declare const getJobSearchResponseSchema: (t: TFunction) => import('valibot').Sc
112
114
  lat: number;
113
115
  lng: number;
114
116
  } | null | undefined;
117
+ locale?: string | null | undefined;
115
118
  };
116
119
  match: string | null;
117
120
  }>]>, undefined>;
@@ -168,6 +171,7 @@ declare const getJobSearchResponseSchema: (t: TFunction) => import('valibot').Sc
168
171
  lat: number;
169
172
  lng: number;
170
173
  } | null | undefined;
174
+ locale?: string | null | undefined;
171
175
  };
172
176
  match: string | null;
173
177
  }[];
@@ -230,6 +234,7 @@ declare const getJobSearchResponseSchema: (t: TFunction) => import('valibot').Sc
230
234
  lat: number;
231
235
  lng: number;
232
236
  } | null | undefined;
237
+ locale?: string | null | undefined;
233
238
  };
234
239
  match: string | null;
235
240
  }[];
@@ -245,11 +250,13 @@ type GeoSearchApiParams = {
245
250
  } | GeoBounds;
246
251
  export type FiltersPayload = Record<string, string | string[] | GeoSearchApiParams | null | undefined>;
247
252
  export declare const filtersToPayload: (state: JobSearchState) => FiltersPayload;
248
- export declare const getAvailableFilters: ({ rpcClient, state, t, signal, }: {
253
+ export declare const getAvailableFilters: ({ rpcClient, state, t, signal, locale, fallbackLocale, }: {
249
254
  rpcClient: InploiRpcClient;
250
255
  signal?: AbortSignal;
251
256
  state: JobSearchState;
252
257
  t: TFunction;
258
+ locale: string | undefined;
259
+ fallbackLocale: string | undefined;
253
260
  }) => Promise<{
254
261
  [x: string]: {
255
262
  label: string;
@@ -258,13 +265,15 @@ export declare const getAvailableFilters: ({ rpcClient, state, t, signal, }: {
258
265
  }[];
259
266
  }>;
260
267
  export type GetAvailableFiltersResponse = Awaited<ReturnType<typeof getAvailableFilters>>;
261
- export declare const getJobSearchResults: ({ rpcClient, signal, state, page, t, prioritySegment, }: {
268
+ export declare const getJobSearchResults: ({ rpcClient, signal, state, page, t, prioritySegment, locale, fallbackLocale, }: {
262
269
  rpcClient: InploiRpcClient;
263
270
  signal?: AbortSignal;
264
271
  state: JobSearchState;
265
272
  page?: number;
266
273
  t: TFunction;
267
274
  prioritySegment: string | undefined;
275
+ locale: string | undefined;
276
+ fallbackLocale: string | undefined;
268
277
  }) => Promise<{
269
278
  pagination: {
270
279
  total: number;
@@ -318,6 +327,7 @@ export declare const getJobSearchResults: ({ rpcClient, signal, state, page, t,
318
327
  lat: number;
319
328
  lng: number;
320
329
  } | null | undefined;
330
+ locale?: string | null | undefined;
321
331
  };
322
332
  match: string | null;
323
333
  }[];
@@ -353,6 +363,7 @@ declare const getJobSearchMapSchema: (t: TFunction) => import('valibot').SchemaW
353
363
  readonly lat: import('valibot').NumberSchema<undefined>;
354
364
  readonly lng: import('valibot').NumberSchema<undefined>;
355
365
  }, undefined>, undefined>, undefined>;
366
+ readonly locale: import('valibot').OptionalSchema<import('valibot').NullableSchema<import('valibot').StringSchema<undefined>, undefined>, undefined>;
356
367
  }, undefined>, import('valibot').TransformAction<{
357
368
  id: number;
358
369
  company_name: string;
@@ -384,6 +395,7 @@ declare const getJobSearchMapSchema: (t: TFunction) => import('valibot').SchemaW
384
395
  lat: number;
385
396
  lng: number;
386
397
  } | null | undefined;
398
+ locale?: string | null | undefined;
387
399
  }, {
388
400
  id: number;
389
401
  createdAt: string | null;
@@ -430,6 +442,7 @@ declare const getJobSearchMapSchema: (t: TFunction) => import('valibot').SchemaW
430
442
  lat: number;
431
443
  lng: number;
432
444
  } | null | undefined;
445
+ locale?: string | null | undefined;
433
446
  };
434
447
  match: string | null;
435
448
  }>]>, undefined>;
@@ -483,6 +496,7 @@ declare const getJobSearchMapSchema: (t: TFunction) => import('valibot').SchemaW
483
496
  lat: number;
484
497
  lng: number;
485
498
  } | null | undefined;
499
+ locale?: string | null | undefined;
486
500
  };
487
501
  match: string | null;
488
502
  }[];
@@ -536,6 +550,7 @@ declare const getJobSearchMapSchema: (t: TFunction) => import('valibot').SchemaW
536
550
  lat: number;
537
551
  lng: number;
538
552
  } | null | undefined;
553
+ locale?: string | null | undefined;
539
554
  };
540
555
  match: string | null;
541
556
  }[];
@@ -545,12 +560,14 @@ declare const getJobSearchMapSchema: (t: TFunction) => import('valibot').SchemaW
545
560
  }>]>;
546
561
  export type JobSearchMapPayloadInput = InferInput<ReturnType<typeof getJobSearchMapSchema>>;
547
562
  export type JobSearchMapPayloadOutput = InferOutput<ReturnType<typeof getJobSearchMapSchema>>;
548
- export declare const getJobSearchMapResults: ({ rpcClient, signal, state, t, prioritySegment, }: {
563
+ export declare const getJobSearchMapResults: ({ rpcClient, signal, state, t, prioritySegment, locale, fallbackLocale, }: {
549
564
  rpcClient: InploiRpcClient;
550
565
  signal?: AbortSignal;
551
566
  state: JobSearchState;
552
567
  t: TFunction;
553
568
  prioritySegment: string | undefined;
569
+ locale: string | undefined;
570
+ fallbackLocale: string | undefined;
554
571
  }) => Promise<{
555
572
  results: {
556
573
  id: number;
@@ -598,6 +615,7 @@ export declare const getJobSearchMapResults: ({ rpcClient, signal, state, t, pri
598
615
  lat: number;
599
616
  lng: number;
600
617
  } | null | undefined;
618
+ locale?: string | null | undefined;
601
619
  };
602
620
  match: string | null;
603
621
  }[];
@@ -19,7 +19,7 @@ declare const textStyles: {
19
19
  readonly jobHeading: "jobHeading";
20
20
  };
21
21
  type TextStyle = keyof typeof textStyles;
22
- export declare const FILTER_KEYS: readonly ["company_name", "employment_type", "location_type", "pay_type", "pay_currency", "pay_mask", "pay", "pay_min", "pay_max", "title", "industry", "category", "skills", "town", "city", "country", "contract_type", "pay_display"];
22
+ export declare const FILTER_KEYS: readonly ["locale", "company_name", "employment_type", "location_type", "pay_type", "pay_currency", "pay_mask", "pay", "pay_min", "pay_max", "title", "industry", "category", "skills", "town", "city", "country", "contract_type", "pay_display"];
23
23
  export type FilterKey = (typeof FILTER_KEYS)[number];
24
24
  export type CustomDataKey = `custom_data.${string}`;
25
25
  export type FilterProperty = {
@@ -89,6 +89,12 @@ type ColorPaletteConfig = {
89
89
  /** Float between 0 and 2. Acts as a multiplier to the original generated palette. */
90
90
  chroma: number;
91
91
  };
92
+ export interface JobSearchPluginI18nParams {
93
+ /** Only see jobs in this locale */
94
+ locale: string | undefined;
95
+ /** Fallback locale to use if jobs in the preferred locale are not available */
96
+ fallbackLocale: string | undefined;
97
+ }
92
98
  export interface JobSearchPluginParams {
93
99
  /** Used to identify the specific widget you want to render, in case there are multiple instances of the widget on the page.*/
94
100
  widgetId?: string;
@@ -142,8 +148,6 @@ export interface JobSearchPluginParams {
142
148
  initialState: JobSearchState | ((params: Omit<JobSearchPluginParams, 'initialState'>) => JobSearchState);
143
149
  /** Enables searching for jobs by keyword */
144
150
  enableKeywordSearch?: boolean;
145
- /** Translation terms */
146
- terms?: JobSearchTranslationTerms;
147
151
  geolocation?: {
148
152
  enabled: boolean;
149
153
  };
@@ -153,6 +157,9 @@ export interface JobSearchPluginParams {
153
157
  /** Suggestion searches */
154
158
  suggestions: string[];
155
159
  };
160
+ /** Override terms used in the plugin */
161
+ terms?: JobSearchTranslationTerms;
162
+ i18n?: JobSearchPluginI18nParams;
156
163
  /** Provide a plugin instance to enable job alerts. */
157
164
  alerts?: {
158
165
  plugin: ReturnType<typeof jobAlertsPlugin> | Promise<{
@@ -267,6 +274,7 @@ export declare const jobSearchPlugin: () => ({ apiClient, rpcClient, logger, ana
267
274
  lat: number;
268
275
  lng: number;
269
276
  } | null | undefined;
277
+ locale?: string | null | undefined;
270
278
  };
271
279
  match: string | null;
272
280
  }[];
@@ -57,6 +57,7 @@ export declare const JobPayloadSchema: import('valibot').ObjectSchema<{
57
57
  readonly lat: import('valibot').NumberSchema<undefined>;
58
58
  readonly lng: import('valibot').NumberSchema<undefined>;
59
59
  }, undefined>, undefined>, undefined>;
60
+ readonly locale: import('valibot').OptionalSchema<import('valibot').NullableSchema<import('valibot').StringSchema<undefined>, undefined>, undefined>;
60
61
  }, undefined>;
61
62
  export type JobPayloadSchema = InferOutput<typeof JobPayloadSchema>;
62
63
  export declare const getJobSchema: (t: TFunction) => import('valibot').SchemaWithPipe<readonly [import('valibot').ObjectSchema<{
@@ -89,6 +90,7 @@ export declare const getJobSchema: (t: TFunction) => import('valibot').SchemaWit
89
90
  readonly lat: import('valibot').NumberSchema<undefined>;
90
91
  readonly lng: import('valibot').NumberSchema<undefined>;
91
92
  }, undefined>, undefined>, undefined>;
93
+ readonly locale: import('valibot').OptionalSchema<import('valibot').NullableSchema<import('valibot').StringSchema<undefined>, undefined>, undefined>;
92
94
  }, undefined>, import('valibot').TransformAction<{
93
95
  id: number;
94
96
  company_name: string;
@@ -120,6 +122,7 @@ export declare const getJobSchema: (t: TFunction) => import('valibot').SchemaWit
120
122
  lat: number;
121
123
  lng: number;
122
124
  } | null | undefined;
125
+ locale?: string | null | undefined;
123
126
  }, {
124
127
  id: number;
125
128
  createdAt: string | null;
@@ -166,6 +169,7 @@ export declare const getJobSchema: (t: TFunction) => import('valibot').SchemaWit
166
169
  lat: number;
167
170
  lng: number;
168
171
  } | null | undefined;
172
+ locale?: string | null | undefined;
169
173
  };
170
174
  match: string | null;
171
175
  }>]>;
@@ -58,16 +58,16 @@ export declare const TranslationProvider: (props: {
58
58
  };
59
59
  readonly page: "Page";
60
60
  readonly reset: "Reset";
61
- readonly 'employment_type.FULL_TIME': "Full-time";
62
- readonly 'employment_type.PART_TIME': "Part-time";
63
- readonly 'employment_type.CONTRACT': "Contractor";
64
- readonly 'employment_type.TEMPORARY': "Temporary";
65
- readonly 'employment_type.INTERN': "Internship";
66
- readonly 'employment_type.VOLUNTEER': "Volunteer";
67
- readonly 'employment_type.OTHER': "Other";
68
- readonly 'location_type.LOCATION': "On-site";
69
- readonly 'location_type.REMOTE': "Remote";
70
- readonly 'location_type.HYBRID': "Hybrid";
61
+ readonly 'job.employment_type.FULL_TIME': "Full-time";
62
+ readonly 'job.employment_type.PART_TIME': "Part-time";
63
+ readonly 'job.employment_type.CONTRACT': "Contractor";
64
+ readonly 'job.employment_type.TEMPORARY': "Temporary";
65
+ readonly 'job.employment_type.INTERN': "Internship";
66
+ readonly 'job.employment_type.VOLUNTEER': "Volunteer";
67
+ readonly 'job.employment_type.OTHER': "Other";
68
+ readonly 'job.location_type.LOCATION': "On-site";
69
+ readonly 'job.location_type.REMOTE': "Remote";
70
+ readonly 'job.location_type.HYBRID': "Hybrid";
71
71
  }>> | undefined;
72
72
  locale: string | undefined;
73
73
  children?: import('preact').ComponentChildren;
@@ -130,16 +130,16 @@ export declare const TranslationProvider: (props: {
130
130
  };
131
131
  readonly page: "Page";
132
132
  readonly reset: "Reset";
133
- readonly 'employment_type.FULL_TIME': "Full-time";
134
- readonly 'employment_type.PART_TIME': "Part-time";
135
- readonly 'employment_type.CONTRACT': "Contractor";
136
- readonly 'employment_type.TEMPORARY': "Temporary";
137
- readonly 'employment_type.INTERN': "Internship";
138
- readonly 'employment_type.VOLUNTEER': "Volunteer";
139
- readonly 'employment_type.OTHER': "Other";
140
- readonly 'location_type.LOCATION': "On-site";
141
- readonly 'location_type.REMOTE': "Remote";
142
- readonly 'location_type.HYBRID': "Hybrid";
133
+ readonly 'job.employment_type.FULL_TIME': "Full-time";
134
+ readonly 'job.employment_type.PART_TIME': "Part-time";
135
+ readonly 'job.employment_type.CONTRACT': "Contractor";
136
+ readonly 'job.employment_type.TEMPORARY': "Temporary";
137
+ readonly 'job.employment_type.INTERN': "Internship";
138
+ readonly 'job.employment_type.VOLUNTEER': "Volunteer";
139
+ readonly 'job.employment_type.OTHER': "Other";
140
+ readonly 'job.location_type.LOCATION': "On-site";
141
+ readonly 'job.location_type.REMOTE': "Remote";
142
+ readonly 'job.location_type.HYBRID': "Hybrid";
143
143
  } = {
144
144
  readonly type_to_search_jobs: "Type to search jobs";
145
145
  readonly type_to_search: "Type to search";
@@ -199,16 +199,16 @@ export declare const TranslationProvider: (props: {
199
199
  };
200
200
  readonly page: "Page";
201
201
  readonly reset: "Reset";
202
- readonly 'employment_type.FULL_TIME': "Full-time";
203
- readonly 'employment_type.PART_TIME': "Part-time";
204
- readonly 'employment_type.CONTRACT': "Contractor";
205
- readonly 'employment_type.TEMPORARY': "Temporary";
206
- readonly 'employment_type.INTERN': "Internship";
207
- readonly 'employment_type.VOLUNTEER': "Volunteer";
208
- readonly 'employment_type.OTHER': "Other";
209
- readonly 'location_type.LOCATION': "On-site";
210
- readonly 'location_type.REMOTE': "Remote";
211
- readonly 'location_type.HYBRID': "Hybrid";
202
+ readonly 'job.employment_type.FULL_TIME': "Full-time";
203
+ readonly 'job.employment_type.PART_TIME': "Part-time";
204
+ readonly 'job.employment_type.CONTRACT': "Contractor";
205
+ readonly 'job.employment_type.TEMPORARY': "Temporary";
206
+ readonly 'job.employment_type.INTERN': "Internship";
207
+ readonly 'job.employment_type.VOLUNTEER': "Volunteer";
208
+ readonly 'job.employment_type.OTHER': "Other";
209
+ readonly 'job.location_type.LOCATION': "On-site";
210
+ readonly 'job.location_type.REMOTE': "Remote";
211
+ readonly 'job.location_type.HYBRID': "Hybrid";
212
212
  }>() => {
213
213
  t: import('@inploi/i18n/translation').TFn<T>;
214
214
  locale: string | undefined;
@@ -271,16 +271,16 @@ export declare const TranslationProvider: (props: {
271
271
  };
272
272
  readonly page: "Page";
273
273
  readonly reset: "Reset";
274
- readonly 'employment_type.FULL_TIME': "Full-time";
275
- readonly 'employment_type.PART_TIME': "Part-time";
276
- readonly 'employment_type.CONTRACT': "Contractor";
277
- readonly 'employment_type.TEMPORARY': "Temporary";
278
- readonly 'employment_type.INTERN': "Internship";
279
- readonly 'employment_type.VOLUNTEER': "Volunteer";
280
- readonly 'employment_type.OTHER': "Other";
281
- readonly 'location_type.LOCATION': "On-site";
282
- readonly 'location_type.REMOTE': "Remote";
283
- readonly 'location_type.HYBRID': "Hybrid";
274
+ readonly 'job.employment_type.FULL_TIME': "Full-time";
275
+ readonly 'job.employment_type.PART_TIME': "Part-time";
276
+ readonly 'job.employment_type.CONTRACT': "Contractor";
277
+ readonly 'job.employment_type.TEMPORARY': "Temporary";
278
+ readonly 'job.employment_type.INTERN': "Internship";
279
+ readonly 'job.employment_type.VOLUNTEER': "Volunteer";
280
+ readonly 'job.employment_type.OTHER': "Other";
281
+ readonly 'job.location_type.LOCATION': "On-site";
282
+ readonly 'job.location_type.REMOTE': "Remote";
283
+ readonly 'job.location_type.HYBRID': "Hybrid";
284
284
  } = {
285
285
  readonly type_to_search_jobs: "Type to search jobs";
286
286
  readonly type_to_search: "Type to search";
@@ -340,16 +340,16 @@ export declare const TranslationProvider: (props: {
340
340
  };
341
341
  readonly page: "Page";
342
342
  readonly reset: "Reset";
343
- readonly 'employment_type.FULL_TIME': "Full-time";
344
- readonly 'employment_type.PART_TIME': "Part-time";
345
- readonly 'employment_type.CONTRACT': "Contractor";
346
- readonly 'employment_type.TEMPORARY': "Temporary";
347
- readonly 'employment_type.INTERN': "Internship";
348
- readonly 'employment_type.VOLUNTEER': "Volunteer";
349
- readonly 'employment_type.OTHER': "Other";
350
- readonly 'location_type.LOCATION': "On-site";
351
- readonly 'location_type.REMOTE': "Remote";
352
- readonly 'location_type.HYBRID': "Hybrid";
343
+ readonly 'job.employment_type.FULL_TIME': "Full-time";
344
+ readonly 'job.employment_type.PART_TIME': "Part-time";
345
+ readonly 'job.employment_type.CONTRACT': "Contractor";
346
+ readonly 'job.employment_type.TEMPORARY': "Temporary";
347
+ readonly 'job.employment_type.INTERN': "Internship";
348
+ readonly 'job.employment_type.VOLUNTEER': "Volunteer";
349
+ readonly 'job.employment_type.OTHER': "Other";
350
+ readonly 'job.location_type.LOCATION': "On-site";
351
+ readonly 'job.location_type.REMOTE': "Remote";
352
+ readonly 'job.location_type.HYBRID': "Hybrid";
353
353
  }>(options: {
354
354
  overrides: Partial<import('@inploi/i18n/translation').TranslationDict<{
355
355
  readonly type_to_search_jobs: "Type to search jobs";
@@ -410,16 +410,16 @@ export declare const TranslationProvider: (props: {
410
410
  };
411
411
  readonly page: "Page";
412
412
  readonly reset: "Reset";
413
- readonly 'employment_type.FULL_TIME': "Full-time";
414
- readonly 'employment_type.PART_TIME': "Part-time";
415
- readonly 'employment_type.CONTRACT': "Contractor";
416
- readonly 'employment_type.TEMPORARY': "Temporary";
417
- readonly 'employment_type.INTERN': "Internship";
418
- readonly 'employment_type.VOLUNTEER': "Volunteer";
419
- readonly 'employment_type.OTHER': "Other";
420
- readonly 'location_type.LOCATION': "On-site";
421
- readonly 'location_type.REMOTE': "Remote";
422
- readonly 'location_type.HYBRID': "Hybrid";
413
+ readonly 'job.employment_type.FULL_TIME': "Full-time";
414
+ readonly 'job.employment_type.PART_TIME': "Part-time";
415
+ readonly 'job.employment_type.CONTRACT': "Contractor";
416
+ readonly 'job.employment_type.TEMPORARY': "Temporary";
417
+ readonly 'job.employment_type.INTERN': "Internship";
418
+ readonly 'job.employment_type.VOLUNTEER': "Volunteer";
419
+ readonly 'job.employment_type.OTHER': "Other";
420
+ readonly 'job.location_type.LOCATION': "On-site";
421
+ readonly 'job.location_type.REMOTE': "Remote";
422
+ readonly 'job.location_type.HYBRID': "Hybrid";
423
423
  }>>;
424
424
  locale: string | undefined;
425
425
  }) => import('@inploi/i18n/translation').TFn<T>, defaultTerms: {
@@ -481,16 +481,16 @@ export declare const TranslationProvider: (props: {
481
481
  };
482
482
  readonly page: "Page";
483
483
  readonly reset: "Reset";
484
- readonly 'employment_type.FULL_TIME': "Full-time";
485
- readonly 'employment_type.PART_TIME': "Part-time";
486
- readonly 'employment_type.CONTRACT': "Contractor";
487
- readonly 'employment_type.TEMPORARY': "Temporary";
488
- readonly 'employment_type.INTERN': "Internship";
489
- readonly 'employment_type.VOLUNTEER': "Volunteer";
490
- readonly 'employment_type.OTHER': "Other";
491
- readonly 'location_type.LOCATION': "On-site";
492
- readonly 'location_type.REMOTE': "Remote";
493
- readonly 'location_type.HYBRID': "Hybrid";
484
+ readonly 'job.employment_type.FULL_TIME': "Full-time";
485
+ readonly 'job.employment_type.PART_TIME': "Part-time";
486
+ readonly 'job.employment_type.CONTRACT': "Contractor";
487
+ readonly 'job.employment_type.TEMPORARY': "Temporary";
488
+ readonly 'job.employment_type.INTERN': "Internship";
489
+ readonly 'job.employment_type.VOLUNTEER': "Volunteer";
490
+ readonly 'job.employment_type.OTHER': "Other";
491
+ readonly 'job.location_type.LOCATION': "On-site";
492
+ readonly 'job.location_type.REMOTE': "Remote";
493
+ readonly 'job.location_type.HYBRID': "Hybrid";
494
494
  };
495
495
  export type TFunction = ReturnType<typeof useTranslation>['t'];
496
496
  export type JobSearchTranslationTerms = Parameters<typeof TranslationProvider>[0]['terms'];
@@ -1,4 +1,4 @@
1
- import { h as ib, j as rb, u as nb, A as Ju, m as ob, n as sb, y as Km, o as Fs } from "./utils-67863dbf.js";
1
+ import { h as ib, j as rb, u as nb, A as Ju, m as ob, n as sb, y as Km, o as Fs } from "./utils-6f4e34d7.js";
2
2
  import "@inploi/sdk";
3
3
  var q0 = { exports: {} };
4
4
  (function(Lr, oh) {