diff --git a/plugin-designs/my-upg-100-list/upg-100-mfe.vue b/plugin-designs/my-upg-100-list/upg-100-mfe.vue index 2471d658d..93fa8e75e 100644 --- a/plugin-designs/my-upg-100-list/upg-100-mfe.vue +++ b/plugin-designs/my-upg-100-list/upg-100-mfe.vue @@ -36,6 +36,7 @@ import { ref, computed, inject, onMounted, onBeforeUnmount } from 'vue' import { useOptionalT } from '@map/composables/useOptionalT.js' import { buildPaneColumn, PANE_GRID_STYLES } from '@map/layouts/pane-wrapper/pane-wrapper.js' +import { urlOwnerOf, ownAddress } from '@map/composables/useViewAddress.js' import { useShadowStyles } from '@map/composables/useShadowStyles.js' import ViewSelect from '@map/components/ViewSelect.vue' import ShareButton from '@map/components/map-controls/ShareButton.vue' @@ -71,6 +72,8 @@ import MapInfoButton from '@map/components/map-controls/MapInfoButton.vue' const t = useOptionalT('') const cfg = inject('profileConfig', ref(null)) +// P2: the pane in view is part of the address (?pane=), written by whoever owns this page (urlOwnerOf). +const owner = () => urlOwnerOf(cfg.value) const tk = inject('mapboxToken', ref('')) const uiStore = inject('uiStore', null) const isDark = computed(() => !!uiStore?.isDark) @@ -150,6 +153,7 @@ const view = computed({ }) let column = null let offScroll = null +let offOwn = null // P2: ownAddress's undo, called on unmount // The mounted custom element per pane id. Kept because a cross-pane action has to reach the // TARGET PANE'S ELEMENT: upg-100-list listens for 'doxa:select-zone' on itself rather than on // window, precisely so two embeds on one page do not cross-talk — which means the shell has to @@ -300,8 +304,9 @@ function onShowOnMap(e) { onMounted(() => { if (!stage.value) return - column = buildPaneColumn(spec.value, { host: stage.value }) + column = buildPaneColumn(spec.value, { host: stage.value, address: { owner } }) if (!column) return + offOwn = ownAddress(stage.value, owner) for (const pane of column.panes) { if (!pane.config) continue const el = paneElement(pane) @@ -330,6 +335,8 @@ onMounted(() => { onBeforeUnmount(() => { window.removeEventListener('doxa-upg-100-list:show-on-map', onShowOnMap) offScroll?.() + offOwn?.() + offOwn = null column?.destroy() column = null // Drop the element references with the column that owned them — holding a detached custom