A new bundle, plugin-designs/poster-sections, with one profile, Poster Sections. A panel of choices (poster type from the registry at runtime, region or All regions, language, posters per row, start collapsed) drives the library's <dxm-poster-section> elements shown live below it, and Copy embed gives the bundle script plus the exact tags for those choices, with absolute URLs so they work on another site. The bundle also registers <dxm-poster-section>, so a site that loads only poster-sections.js can place the tags. Library: the element takes a columns attribute (posters per row, 1-5), passed to the wall's existing columns prop; absent keeps today's default, so existing importers are unchanged. New catalogue area posterSections in all 11 locales. check:poster-sections (in gates:pre) reads every panel choice back through the element's own attribute reader; its self-test proves a builder that drops columns, drops collapsed, or repeats a region under All regions fails.
24 lines
1 KiB
JavaScript
24 lines
1 KiB
JavaScript
import { defineMapElement } from '@map/elements/defineMapElement.js'
|
|
import { registerPosterSectionElement } from '@map/elements/posterSectionElement.js'
|
|
/**
|
|
* plugin-designs/poster-sections/index.js
|
|
*
|
|
* Bundle entry. Registers TWO tags:
|
|
* - <poster-sections> the Poster Sections page: a panel of choices over the live sections, plus the tag to copy
|
|
* - <dxm-poster-section> the library's poster section element itself, so a website that loads ONLY this script
|
|
* can place the tags the page hands out:
|
|
*
|
|
* <script src="…/dx-maps/poster-sections/poster-sections.js"></script>
|
|
* <dxm-poster-section type="country" scope="africa" locale="ar" columns="3"></dxm-poster-section>
|
|
*/
|
|
const profileModules = import.meta.glob('./*.vue')
|
|
|
|
const PosterSectionsElement = defineMapElement({ profileModules })
|
|
|
|
if (typeof customElements !== 'undefined' && !customElements.get('poster-sections')) {
|
|
customElements.define('poster-sections', PosterSectionsElement)
|
|
}
|
|
|
|
registerPosterSectionElement()
|
|
|
|
export default PosterSectionsElement
|