@inploi/plugin-job-search 8.6.1 → 9.0.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.
Files changed (34) hide show
  1. package/README.md +37 -24
  2. package/cdn/index.js +45 -3105
  3. package/cdn/mapbox-gl.js +51 -0
  4. package/dist/common.geo-transport-CJGUJXTA-aba25ae8.cjs +1 -0
  5. package/dist/common.geo-transport-CJGUJXTA-e1f9b82a.js +37 -0
  6. package/dist/components/combobox.d.ts +2 -2
  7. package/dist/components/geo-search.geocode.d.ts +7 -10
  8. package/dist/components/map.maplibre.d.ts +1 -1
  9. package/dist/components/map.types.d.ts +1 -0
  10. package/dist/index.cjs +2 -2
  11. package/dist/index.js +168 -172
  12. package/dist/job-search-941c04d7.cjs +60 -0
  13. package/dist/{map-style-c988f534.js → job-search-eb64050e.js} +2013 -1964
  14. package/dist/job-search.d.ts +1 -1
  15. package/dist/lib/i18n.d.ts +7 -0
  16. package/dist/lib/map-library-cdn.test.d.ts +1 -0
  17. package/dist/lib/map-style.d.ts +4 -2
  18. package/dist/map-00ee82df.js +300 -0
  19. package/dist/map-109de8da.cjs +2 -0
  20. package/dist/map-attribution-0b24769c.cjs +26 -0
  21. package/dist/map-attribution-96798686.js +141 -0
  22. package/dist/{mapbox-gl-92318326.js → mapbox-gl-0f446975.js} +3505 -3489
  23. package/dist/{mapbox-gl-f5a3f2d4.cjs → mapbox-gl-11152b6e.cjs} +28 -28
  24. package/dist/utils.cjs +1 -1
  25. package/dist/utils.d.ts +1 -1
  26. package/dist/utils.js +11 -12
  27. package/package.json +3 -3
  28. package/dist/lib/maplibre-cdn.d.ts +0 -10
  29. package/dist/map-a092b43f.cjs +0 -2
  30. package/dist/map-attribution-18e2dacf.cjs +0 -26
  31. package/dist/map-attribution-bc77dbf2.js +0 -115
  32. package/dist/map-ddfd39ea.js +0 -254
  33. package/dist/map-style-57bbe0a0.cjs +0 -60
  34. /package/dist/{lib/maplibre-cdn.test.d.ts → components/geo-search.location-input.test.d.ts} +0 -0
package/README.md CHANGED
@@ -1,29 +1,43 @@
1
1
  # @inploi/plugin-job-search
2
2
 
3
+ Location suggestions use `https://maps.inploi.com/places`, limited to the hub's countries. A random id persists
4
+ in sessionStorage for the browser tab (or memory when storage is unavailable), so the Worker's rollout keeps
5
+ each visitor on one search arm. Worker errors, invalid responses and a 2.5-second timeout fall back to the
6
+ existing direct Mapbox geocoder. Exact typed postcodes still rank first. Applying a suggestion or searching
7
+ typed text sends a codes-only outcome to the Worker; query text and location details are never included.
8
+
3
9
  The SDK job-search widget supports an optional map via `JobSearchPluginParams.map`.
4
- Mapbox remains the default renderer during the MapLibre rollout. Enable MapLibre per embed:
10
+ It renders with MapLibre from `maps.inploi.com`, so by default a candidate's browser requests map resources
11
+ from no third party:
5
12
 
6
13
  ```ts
7
14
  map: {
8
15
  enabled: true,
9
- renderer: 'maplibre',
10
- style: 'default',
16
+ style: 'default', // optional
11
17
  }
12
18
  ```
13
19
 
14
- CDN embeds load MapLibre on demand from `maplibre-gl.js` beside the plugin's `cdn/index.js`, so pages on
15
- the Mapbox renderer don't download it. npm builds keep `maplibre-gl` as an external dependency.
20
+ `renderer: 'mapbox'` keeps Mapbox for an embed that sets it explicitly (careers hubs use it for per-company
21
+ rollback); Mapbox code loads only then, with its optional performance telemetry off
22
+ (`performanceMetricsCollection: false`). Its map-load and tile billing events have no opt-out.
23
+ Mapbox's `accessToken` is used only by that renderer, is ignored by MapLibre, and is deprecated for eventual removal.
24
+
25
+ CDN embeds load each map library on demand from a sibling of the plugin's `cdn/index.js`
26
+ (`maplibre-gl.js` or `mapbox-gl.js`), so a page downloads only the renderer it uses. A sibling download that
27
+ fails or takes longer than ten seconds, like a map that fails to start, gets one more attempt before the map shows
28
+ the unavailable notice below. npm builds keep `maplibre-gl` external and load `mapbox-gl` from a lazy chunk.
16
29
 
17
- Enable hosted style ids after `maps.inploi.com` serves the selected style and its tile/glyph resources.
30
+ Use a hosted style id only once `maps.inploi.com` serves it and its tile, glyph and sprite resources.
18
31
  MapLibre needs no access token. A style id resolves to `https://maps.inploi.com/styles/{id}.json`;
19
- omitting `style` selects `default`. HTTPS style URLs are also supported. The legacy Mapbox light-v10
20
- and light-v11 URLs map to `default` and Compass's custom job-page style maps to `compass`; other Mapbox URLs
21
- select `default` and emit a warning.
22
- For new configuration, use `mapbox://` URLs only with the Mapbox renderer. Unsupported style formats throw.
23
- MapLibre falls back once to OpenFreeMap Positron if the initial style or tile source fails before load,
24
- or loading takes longer than ten seconds. Styles hosted at `https://maps.inploi.com` show only the linked
25
- `© OpenStreetMap contributors` credit. OpenFreeMap styles show `© OpenMapTiles` and the OSM credit,
26
- including immediately on fallback. Other styles show de-duplicated source credits,
32
+ omitting `style` selects `default`. Mapbox styles never reach Mapbox: the light-v10 and light-v11 URLs map to
33
+ `default`, outdoors-v12 and streets-v12 to `outdoors` and `streets`, and each client's custom Mapbox style to its
34
+ hosted id (see `MAPBOX_TO_ID`), in either the `mapbox://styles/…` or `https://api.mapbox.com/styles/v1/…` form;
35
+ other Mapbox URLs select `default` and log a warning. Other HTTPS style URLs are used as given.
36
+ If the style or a basemap tile fails before the map first loads, or it takes longer than ten seconds, MapLibre
37
+ retries the same style once. If that fails too, or an unsupported style format is configured, the map is replaced
38
+ by a static `Map unavailable` notice (`role="status"`, term `map_unavailable`) and the job list and search keep
39
+ working. Styles hosted at `https://maps.inploi.com` show only the linked
40
+ `© OpenStreetMap contributors` credit. Other styles show de-duplicated source credits,
27
41
  updated as the style and source metadata load. Source attribution is parsed in an inert document and rebuilt
28
42
  as text and HTTP(S) links only; remote elements and attributes are never copied into the page.
29
43
  OpenStreetMap credit is added if no source provides it.
@@ -39,19 +53,18 @@ permit automatic collapse after five seconds with discoverable licence informati
39
53
  [Protomaps attribution is optional](https://github.com/protomaps/basemaps#licensing-and-attribution-guidelines);
40
54
  its OSM tiles require OSM attribution. [MapLibre's BSD-3 licence](https://github.com/maplibre/maplibre-gl-js/blob/main/LICENSE.txt)
41
55
  requires distribution notices, not an on-map credit.
42
- [OpenFreeMap](https://openfreemap.org/#attribution) makes its own name optional; the
43
- [OpenMapTiles design licence](https://github.com/openmaptiles/openmaptiles/blob/master/LICENSE.md#design-license-cc-by-40)
44
- requires the linked OpenMapTiles credit for its schema-derived maps.
56
+ Styles built on the OpenMapTiles schema carry the linked OpenMapTiles credit
57
+ [its design licence](https://github.com/openmaptiles/openmaptiles/blob/master/LICENSE.md#design-license-cc-by-40)
58
+ requires in their source attribution.
45
59
 
46
- The public `@inploi/plugin-job-search/utils` entry exports `resolveMapStyle`, `MAP_FALLBACK_STYLE`,
47
- and `createMapAttribution(styleUrl)`. Add the latter with `map.addControl(control, 'bottom-right')`
60
+ The public `@inploi/plugin-job-search/utils` entry exports `resolveMapStyle` and
61
+ `createMapAttribution(styleUrl)`. Add the latter with `map.addControl(control, 'bottom-right')`
48
62
  after loading MapLibre's CSS. Call `control.setStyle(styleUrl)` when swapping styles; MapLibre removes
49
63
  its observers, event listeners and scoped stylesheet through the control's `onRemove` lifecycle.
50
- `resolveMapStyle` returns `{ url, unmapped? }`; callers can use `unmapped` to identify a legacy style
51
- that needs migrating. Mapbox's `accessToken` remains supported and is deprecated for eventual removal.
64
+ `resolveMapStyle` returns `{ url, unmapped? }`, and throws for an unsupported format; callers can use
65
+ `unmapped` to identify a legacy style that needs migrating.
52
66
  MapLibre's cooperative-gesture hints use the plugin's `map_gesture_windows`, `map_gesture_mac` and
53
67
  `map_gesture_mobile` terms, so embeds can localise them through `terms`.
54
68
 
55
- For local manual checks, use `?test_renderer=maplibre`. The dev harness uses OpenFreeMap until the
56
- inploi tile service is live. Add `&test_map_style=hosted` to exercise the hosted default style,
57
- including browser tests that intercept `https://maps.inploi.com/**`.
69
+ The dev harness uses the default renderer and hosted default style; browser tests intercept
70
+ `https://maps.inploi.com/**`. For local manual checks of the Mapbox renderer, use `?test_renderer=mapbox`.