33 lines
1.2 KiB
JavaScript
33 lines
1.2 KiB
JavaScript
/**
|
|
* pplr-data-maps / index.js — bundle entry (emits pplr-data-maps.js), defines <pplr-data-maps>.
|
|
*
|
|
* The standard ProfileLoader shape (see doxa-simple-map/index.js): the glob captures this
|
|
* folder's one profile, pplr-data-maps.vue; its ten views live in src/views/. The Mapbox RTL
|
|
* text plugin is registered once here: many PG names are Arabic, Urdu or Hebrew.
|
|
*/
|
|
import { defineCustomElement } from 'vue'
|
|
import { createPinia } from 'pinia'
|
|
import ProfileLoader from '@map/ProfileLoader.vue'
|
|
import { createAppI18n } from '@map/i18n/index.js'
|
|
|
|
const profileModules = import.meta.glob('./*.vue')
|
|
|
|
if (typeof window !== 'undefined' && window.mapboxgl?.setRTLTextPlugin) {
|
|
try {
|
|
window.mapboxgl.setRTLTextPlugin(
|
|
'https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-rtl-text/v0.3.0/mapbox-gl-rtl-text.js',
|
|
null, true
|
|
)
|
|
} catch (_) { /* already set this session */ }
|
|
}
|
|
|
|
const El = defineCustomElement(ProfileLoader, {
|
|
configureApp(app) {
|
|
app.use(createPinia())
|
|
const i18n = createAppI18n()
|
|
app.use(i18n)
|
|
app.provide('appI18n', i18n)
|
|
app.provide('profileModules', profileModules)
|
|
}
|
|
})
|
|
if (typeof customElements !== 'undefined' && !customElements.get('pplr-data-maps')) customElements.define('pplr-data-maps', El)
|