UPG100: the composite's pane in view is part of the page address (?pane=)

This commit is contained in:
Doxa Maps 2026-10-03 06:31:14 +00:00
parent c963a2a9fa
commit ce15aba511

View file

@ -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