doxa-maps/library/components/map-controls
doxa-maps-88655c70 79353ca66e One page, one map token — and the nested search bar comes back
"the element gets the tk to the element itself and does not need to only
gatekeep that to one component only — all components in a plugin can share
that tk" (Driver, 2026-09-23).

Inside ONE element that was already true: ProfileLoader provides
'mapboxToken' and eleven components inject it. The gate is the ELEMENT
BOUNDARY — every custom element mounts its own app with its own
ProfileLoader, which re-derives the token from its own profile-config, so a
composite that nests a real map hands the child nothing.

THE EXISTING FALLBACK COULD NOT FIRE. The ladder already read
window.MAP_TOKEN. MEASURED: that global IS set on the composite leaf and
the child still had no search bar — because the ladder lives in a
computed() and window.MAP_TOKEN is a plain global, not a reactive source.
The composite leaf FETCHES its token, so the computed resolved '' first,
cached, and never re-ran. useSharedMapToken makes it a ref that updates on
publish, and assignments to window.MAP_TOKEN are adopted through an
accessor, so already-generated pages keep working untouched. Storage lives
on window and changes travel as an event: each bundle is its own IIFE, so a
module-level ref is NOT shared between a composite and the bundle it nests.

THAT WAS NECESSARY AND NOT SUFFICIENT, which only measuring showed. With
the token shared and reactive the bar was STILL absent. Real cause:
GeocoderComponent's onMounted hit `typeof MapboxGeocoder === 'undefined'`
and RETURNED SILENTLY — no throw, no console error, no DOM. MapboxGeocoder
is "preloaded via index.html", true for a LEAF and false for a COMPOSITE
leaf, which generate-tree classifies as token-free while it goes on to nest
a real map. Measured, mapbox-gl-geocoder references per page: research-map
leaf 2, research-map-plus-grid leaf 0.

So the script is now fetched on demand when a host did not preload it,
reusing the exact shape the maplibre path already had (one loader, two
callers) and pinned to the same v5.0.0 the leaves preload. It resolves on
error as well as load, so a blocked CDN leaves the map usable and the bar
absent rather than hanging. This fixes every already-generated page without
regenerating any of them.

MEASURED on the built tree:
  leaf mapbox     search@56    legend@104
  leaf maplibre   search@NONE  legend@58    (unchanged: maplibre stays bar-free)
  composite       search@56    legend@104   (was NONE)

library/ reaches every bundle, so all 22 rebuilt: 22/22, 7/7 pre, 18/18
post, and a browser sweep of five StackLayout consumers plus all seven
studio dashboards.
2026-09-24 01:14:37 +00:00
..
FullscreenButton.vue doxa-maps — portable bundler for embeddable JAMstack maps 2026-09-10 01:53:07 +00:00
GeocoderComponent.vue One page, one map token — and the nested search bar comes back 2026-09-24 01:14:37 +00:00
HamburgerButton.vue doxa-maps — portable bundler for embeddable JAMstack maps 2026-09-10 01:53:07 +00:00
HelpButton.vue doxa-maps — portable bundler for embeddable JAMstack maps 2026-09-10 01:53:07 +00:00
index.js doxa-maps — portable bundler for embeddable JAMstack maps 2026-09-10 01:53:07 +00:00
LocationButton.vue doxa-maps — portable bundler for embeddable JAMstack maps 2026-09-10 01:53:07 +00:00
MapControlButton.vue give every map control an accessible name 2026-09-21 13:02:56 +00:00
MapControlMenu.vue Share menu opens at natural height in a page header (no scrollbar) 2026-09-23 23:47:28 +00:00
MapToolbar.vue MapControlMenu: one menu for every map control — inside the map, top and height of the toolbar column, on its inner side, RTL-aware, phone and desktop; the share button is its first consumer 2026-09-16 22:46:21 -05:00
README.md consolidate docs into documentation/ and deployment shells into deployment/ 2026-09-21 23:23:23 +00:00
ShareButton.vue Share menu shows the whole embed snippet, with no scrollbar 2026-09-23 19:01:14 +00:00
ThemeToggleButton.vue doxa-maps — portable bundler for embeddable JAMstack maps 2026-09-10 01:53:07 +00:00
ZoomInButton.vue Session work: strobe fix, grid layout, stacked tree legend, selection camera, chip bounding, asset inheritance, gates 2026-09-20 04:49:25 +00:00
ZoomOutButton.vue Session work: strobe fix, grid layout, stacked tree legend, selection camera, chip bounding, asset inheritance, gates 2026-09-20 04:49:25 +00:00

library/components/map-controls/ — toolbar buttons

Each file is a single, focused button or input that mounts inside the map's control area. Replaces the older monolithic MapControlsComponent.vue.

  MapToolbar.vue  (container)
   ├─ ZoomInButton · ZoomOutButton · LocationButton
   ├─ FullscreenButton · HamburgerButton · ThemeToggleButton
   ├─ HelpButton · ShareButton
   └─ GeocoderComponent   (all built on MapControlButton.vue)
  • Every button takes a size prop (sm | md | lg) and follows the MapControlButton shape.
  • Click handlers go through inject('mapStore') or getMap() — never a captured Mapbox instance.
  • To add one: copy ZoomInButton.vue and register it in MapToolbar.vue.

Full conventions + catalog: ../../../documentation/architecture/components.md.