doxa-maps/library/utils
Doxa Maps 896775903b Share > Embed: three codes for THIS plugin (URL, Iframe, JavaScript), from the tree it is served from (shareable pages P3b)
The Embed tab now offers the plugin's own page (URL), that page in an iframe
(with the sizes), and its own bundle + element (JavaScript), each with one plain
sentence and one Copy button. They embed the plugin whose Share was pressed, even
nested in Plugin Studio, Deep Research or Posterverse.

Where the codes point: a new build-config key shareBaseUrl, baked as
__DOXA_SHARE_BASE__ and overridable per embed (profile-config.shareBaseUrl) or
per page (window.MAP_SHARE_BASE_URL), https only (or a local test server). It is
committed EMPTY: the codes then point at the tree the bundle is served from, so
the stable site gives its own public URLs by construction. embedBaseUrl stays
empty, so the manifest's snippets and a dropped tree are unchanged.

The JavaScript code is the plugin's embed.script from that tree's manifest
(library/utils/publicEmbed.js, fetched once when Embed opens, default
credentials), made absolute, with integrity dropped from our unversioned bundle
URL (a pinned hash would break every partner's embed at the next release). A
plugin that tree does not carry gets a plain note instead of codes that would
404. Share this page stays first; the explanation and the 5 steps stay. English
only (parity debt 19 per locale). The library index lists publicEmbed.js.
2026-10-03 08:10:31 +00:00
..
.gitkeep doxa-maps — portable bundler for embeddable JAMstack maps 2026-09-10 01:53:07 +00:00
apiBaseUrl.js doxa-maps — portable bundler for embeddable JAMstack maps 2026-09-10 01:53:07 +00:00
ClusterHelpers.js consolidate docs into documentation/ and deployment shells into deployment/ 2026-09-21 23:23:23 +00:00
colocation.js P assembly: the widened census, stated neutrally 2026-10-01 05:42:24 +00:00
countries-meta.js Regions: one rollup, ported from theirs, instead of two copies 2026-09-24 04:01:34 +00:00
countryName.js Big Picture speaks Arabic where it was still speaking English: chrome and data labels 2026-09-28 02:01:46 +00:00
DataSourceManager.js Complete app-profiles->plugin-designs sweep across comments/docs; build green; layouts kept at root (load-bearing) 2026-09-17 18:18:19 +00:00
embedBase.js Share > Embed: three codes for THIS plugin (URL, Iframe, JavaScript), from the tree it is served from (shareable pages P3b) 2026-10-03 08:10:31 +00:00
embedScript.js One page loaded the same bundle twice and nothing said so 2026-09-29 00:06:51 +00:00
formatCount.js library/ keeps the reason and drops the speaker: no comment quotes or cites the Driver 2026-09-29 05:26:25 +00:00
geoUtils.js Research tabs read at 15px; the status red is a step brighter 2026-09-17 02:38:38 -05:00
hostElement.js Move four identical bodies into the library 2026-09-29 09:19:04 +00:00
html.js Map popups show data as text: a people-group name or country field can no longer run script 2026-09-26 05:50:24 +00:00
languageLabel.js The packet's generated description, and the language name it prints was index-ordered 2026-09-28 13:56:06 +00:00
languageRequest.js Shell header: a phone bar and a rail-bottom language slot for header-off shells, and a shared language menu that asks the host first 2026-09-30 23:28:52 +00:00
loadPinnedUmd.js Source comments state design history and measurements as facts, without quoting or naming anyone 2026-10-01 00:37:17 +00:00
MSTClusteringUtil.js "MST" clustering draws again: a true spanning tree in under a second instead of a 12-second freeze 2026-09-26 04:38:59 +00:00
NetworkClusteringUtil.js doxa-maps — portable bundler for embeddable JAMstack maps 2026-09-10 01:53:07 +00:00
peopleGroupName.js People-group names: the threshold pinned, no trust without Latin evidence, raw indexing flagged 2026-10-01 06:04:41 +00:00
peopleGroupPoints.js A country map you can drop on one page, without the dashboard around it 2026-09-29 01:38:07 +00:00
publicEmbed.js Share > Embed: three codes for THIS plugin (URL, Iframe, JavaScript), from the tree it is served from (shareable pages P3b) 2026-10-03 08:10:31 +00:00
README.md Host-agnostic share links, token-endpoint chain, dev playground as reusable modules, share/asset gates, validated profile-type vocabulary 2026-09-16 12:10:38 -05:00
scrollport.js Move four identical bodies into the library 2026-09-29 09:19:04 +00:00
viewportScrim.js Land the prayer facet and the scrim helper 2026-09-22 21:50:32 +00:00

library/utils/ — pure JS helpers

No Vue, no Pinia, no Mapbox. Anything reactive is a composable; anything stateful is a store.

File Purpose
apiBaseUrl.js Resolves the API base URL at runtime (window.MAP_APP_API_URL / VITE_API_BASE_URL)
embedBase.js Share/embed URL ladder — the built bundle derives its tree root from its own script url (profileConfig.shareUrl / embedBaseUrl / window.MAP_EMBED_BASE_URL override) so tree-relative <bundle>/<profile>/index.html links work on any host
geoUtils.js Centroid, bounds, validation, GeoJSON helpers
ClusterHelpers.js Shared helpers for the two clustering utilities below
MSTClusteringUtil.js Minimum-spanning-tree clustering for affinity blocks
NetworkClusteringUtil.js Network-line clustering — connect nearby pins with edges
  • No import { ref } from 'vue' and no import mapboxgl in this folder — operate on plain [lng, lat] arrays.
  • Named exports (for tree-shaking), JSDoc on every export.
  • Writing reactive logic or needing Mapbox APIs? That's a composable — move it to ../composables/.