doxa-maps/library/composables
Doxa Maps 07eb74c33c Move four identical bodies into the library
From the fleet census: 620 function bodies indexed across 29 plugin trees,
16 identical in two or more. These are the four cheapest — none closes over
anything beyond its own parameters, so each is a file move plus an import
rather than a new dependency to thread.

hostElement resolves the custom element a component is mounted inside, one
hop out through the shadow root. It was identical in three plugins, and it
is the piece worth sharing for a reason other than line count: every plugin
ships through defineCustomElement, a composite nests two shadow roots, and
code that forgets the hop operates on the wrong node while looking correct.
A document-level query for a node inside a shadow root returns null on a
working build, which reads as a broken feature rather than a wrong query.
Three copies were three chances to write that.

findScrollportAncestor walks up to the nearest ancestor that actually
scrolls, crossing shadow boundaries on the way — parentElement stops at a
root, so a plugin in a custom element would otherwise find no scrollport and
conclude the page does not scroll.

findNodeInTree and buildFlatLegendMatchExpr join useLegendMapBridge, which
already holds four functions from the same seam. They sit at module level
rather than inside the factory because they close over nothing: a pure
function hidden in a closure can only be reached by constructing the whole
bridge.

Call sites keep their old names through a one-line local binding, so no
call changed and the diff is the declaration plus an import.

Rebuild-and-compare, all five affected bundles, before -> after:
  regions-dashboard   1,098,469 -> 1,098,479   +10
  country-posters     1,484,053 -> 1,484,028   -25
  doxa-research-map   1,354,051 -> 1,354,061   +10
  dashboard-plus-grid   915,660 ->   915,644   -16
  big-picture           366,907 ->   366,719  -188
  net -209, and country-posters gains 25 bytes against the 1.5 MB ceiling.
Every behaviour-bearing token counted, not set-compared, and unchanged in
all three map bundles: regions-fill, peoplePraying, engagementStatus,
adoptionStatus, overflowY, scrollHeight, getRootNode, _flat_filter, religion.

Owners cleared their own files first: regions for regions-list.vue, upg100
for countries-map.vue. check:selection-kinds, check:legend-matches-source,
check:legend-data-contract, check:packet-variants, check:no-dead-library and
check:no-cross-plugin-imports all pass.
2026-09-29 09:19:04 +00:00
..
legends Move four identical bodies into the library 2026-09-29 09:19:04 +00:00
poster The poster's legend was painted over the map, unless you ask otherwise 2026-09-29 00:59:14 +00:00
.gitkeep doxa-maps — portable bundler for embeddable JAMstack maps 2026-09-10 01:53:07 +00:00
host-token-url.js A composite embedded bare dropped tokenUrl, and passed because a ProfileLoader sat above it 2026-09-28 15:52:47 +00:00
joinBase.js The country link went to the people group; four links broke on a missing slash 2026-09-28 21:59:29 +00:00
printInPlace.js A print frame is kept until it has printed: its 60 s clock starts at load, not at creation 2026-09-29 08:11:49 +00:00
retryableAsyncComponent.js library/ keeps the reason and drops the speaker: no comment quotes or cites the Driver 2026-09-29 05:26:25 +00:00
useAvatarGenerator.js Keep the prayer yellow to the prayer palette; other palettes keep their orange 2026-09-16 21:21:07 -05:00
useCardSurface.js The prayer-progress cards become shared components too 2026-09-27 04:14:31 +00:00
useCountryOutline.js Comments state their findings instead of citing files outside the repo 2026-09-29 03:46:37 +00:00
useCsvExport.js library/ keeps the reason and drops the speaker: no comment quotes or cites the Driver 2026-09-29 05:26:25 +00:00
useDashboardData.js The research dashboard asked the API for English, then translated half of it 2026-09-28 22:25:31 +00:00
useDashboardLayout.js library/ keeps the reason and drops the speaker: no comment quotes or cites the Driver 2026-09-29 05:26:25 +00:00
useDashboardSearch.js library/ keeps the reason and drops the speaker: no comment quotes or cites the Driver 2026-09-29 05:26:25 +00:00
useDocumentFont.js library/ keeps the reason and drops the speaker: no comment quotes or cites the Driver 2026-09-29 05:26:25 +00:00
useEdgeScrollAffordance.js doxa-maps — portable bundler for embeddable JAMstack maps 2026-09-10 01:53:07 +00:00
useFacetAggregation.js Kit 4c-1: the counting half, and the bucket that said "Other" in every locale 2026-09-27 04:14:13 +00:00
useGeocoderSearch.js Brand-neutral shared VerticalTabsLayout with lazy nested-element hosting; fix cap-5 prayer tab leaf path; neutralize library identifiers; add Forgejo CI build-gate workflow 2026-09-19 17:24:30 +00:00
useHostedHelp.js A map's own ? can ask its host for help: HelpButton and useHostedHelp send doxa:help 2026-09-29 02:35:35 +00:00
useHostTokenUrl.js A composite embedded bare dropped tokenUrl, and passed because a ProfileLoader sat above it 2026-09-28 15:52:47 +00:00
useMapAttribution.js Escape the two popup URLs and the packet photo URL 2026-09-29 05:26:27 +00:00
useMapClustering.js useMapClustering: no console.log in shipped bundles 2026-09-28 02:01:47 +00:00
useMapData.js The prayer map's legends see the pins it draws 2026-09-27 02:17:35 +00:00
useMapEvents.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
useMapFly.js library/ keeps the reason and drops the speaker: no comment quotes or cites the Driver 2026-09-29 05:26:25 +00:00
useMapInstance.js library/ keeps the reason and drops the speaker: no comment quotes or cites the Driver 2026-09-29 05:26:25 +00:00
useMapLayers.js The interactive maps fetch the web-sized boundaries 2026-09-27 03:25:59 +00:00
useMapProvider.js library/ keeps the reason and drops the speaker: no comment quotes or cites the Driver 2026-09-29 05:26:25 +00:00
useMapTheme.js Research map: religion joins prayer, adoption and engagement on the night look; only people, regions and languages are monochrome day 2026-09-16 21:01:37 -05:00
useOptionalT.js A host without i18n picks the same plural form an installed i18n would, in every language 2026-09-29 05:26:26 +00:00
usePosterPrints.js Serve the packet text at print time instead of bundling all 11 languages 2026-09-29 08:33:44 +00:00
usePplrInstance.js library/ keeps the reason and drops the speaker: no comment quotes or cites the Driver 2026-09-29 05:26:25 +00:00
usePrayedLocally.js Public builds carry zero platform surface + copy-embed on staging 2026-09-16 05:13:44 +00:00
usePrayerStatistics.js doxa-maps — portable bundler for embeddable JAMstack maps 2026-09-10 01:53:07 +00:00
useScreenGate.js A desktop-only composite blocks on a phone too: the phone rule is a composable its root can call 2026-09-29 09:18:55 +00:00
useSearch.js Religion families follow the reader; the value they filter on does not 2026-09-27 01:57:23 +00:00
useSelectedPin.js engineFor(map): build markers, popups and poster maps with the map's OWN engine 2026-09-25 18:38:17 +00:00
useSelectionBus.js library/ keeps the reason and drops the speaker: no comment quotes or cites the Driver 2026-09-29 05:26:25 +00:00
useSelectionCamera.js library/ keeps the reason and drops the speaker: no comment quotes or cites the Driver 2026-09-29 05:26:25 +00:00
useSentence.js Prove the sentence helper against a real t(), instead of claiming it 2026-09-29 05:26:25 +00:00
useShadowStyles.js Every shadow root honours prefers-reduced-motion 2026-09-27 05:05:04 +00:00
useShareableView.js A shared link reads a list separated by , or |, so partner links already published keep working 2026-09-27 19:10:08 +00:00
useSharedMapToken.js library/ keeps the reason and drops the speaker: no comment quotes or cites the Driver 2026-09-29 05:26:25 +00:00
useTextHighlight.js Two plugins built the same search highlighter; now there is one 2026-09-27 01:16:50 +00:00