# Conflicts: # internal/check-element-bootstrap.mjs # internal/check-provide-shadowing.mjs # library/elements/defineMapElement.js # library/elements/provide-own.js # package.json # plugin-designs/all-people-groups/index.js # plugin-designs/cities-internet/index.js # plugin-designs/country-posters/index.js # plugin-designs/doxa-research-map/index.js # plugin-designs/gospel-internet/index.js # plugin-designs/gospel-resources/index.js # plugin-designs/key-cities/index.js # plugin-designs/my-upg-100-list/index.js # plugin-designs/pplr-data-maps/index.js # plugin-designs/regions-dashboard/index.js # plugin-designs/upg-neighbor/index.js
46 lines
1.8 KiB
JavaScript
46 lines
1.8 KiB
JavaScript
import { defineMapElement } from '@map/elements/defineMapElement.js'
|
|
/**
|
|
* plugin-designs/gospel-resources/index.js — bundle entry for GOSPEL RESOURCES.
|
|
*
|
|
* Registers ONE custom-element tag:
|
|
* <gospel-resources-map profile-config='{"profile":"resources-list"}'></gospel-resources-map>
|
|
*
|
|
* Same shape as country-posters/index.js — folder = bundle, each flat .vue = a
|
|
* profile, `profile` is the FILENAME not the folder. ProfileLoader lives in @map
|
|
* and cannot glob into a bundle folder, so the BUNDLE evaluates the glob and hands
|
|
* the registry over via app.provide('profileModules').
|
|
*
|
|
* NO COLOR STRATEGIES registered here: this bundle currently ships a list profile
|
|
* only. When the map profile lands it will need one, and it goes in src/colors/
|
|
* where the registry auto-discovers it by filename.
|
|
*
|
|
* NO MAPBOX RTL PLUGIN either — nothing here renders a basemap yet. Adding the
|
|
* plugin call before a map exists would be dead code implying a capability the
|
|
* bundle does not have.
|
|
*/
|
|
import { defineMapElement } from '@map/elements/defineMapElement.js'
|
|
|
|
// Evaluated by Vite at build time relative to THIS file, so it captures only this
|
|
// bundle's profiles.
|
|
const profileModules = import.meta.glob('./*.vue')
|
|
|
|
function buildGospelResourcesElement() {
|
|
return defineMapElement({
|
|
profileModules,
|
|
configureApp: (app, { pinia, i18n }) => {
|
|
// Per-instance Pinia + i18n so multiple embeds on one page never bleed state.
|
|
},
|
|
})
|
|
}
|
|
|
|
const GospelResourcesElement = buildGospelResourcesElement()
|
|
|
|
// Guarded: customElements.define() is one-shot per tag per page session, so an
|
|
// IIFE loaded twice would throw without this.
|
|
if (typeof customElements !== 'undefined') {
|
|
if (!customElements.get('gospel-resources-map')) {
|
|
customElements.define('gospel-resources-map', GospelResourcesElement)
|
|
}
|
|
}
|
|
|
|
export default GospelResourcesElement
|