Say why a tab could not load instead of painting an empty grey pane
Some checks are pending
build-gate / build (push) Waiting to run
Some checks are pending
build-gate / build (push) Waiting to run
The Simple Research tab rendered as a featureless grey rectangle with no message, no overlay and nothing in the console. It reads as a broken app, and it hid a plain missing-file condition through four separate reports. Two silent failure paths produced it, one layer apart: - doxa-maps-spa swallowed a failed manifest.json fetch. Every tab except Big Picture is composed from that manifest (Big Picture alone is baked), so losing it leaves each tab with no scriptUrl. mountTab then returns early and the pane stays in state 'idle' -- which renders neither the loading hint nor the error hint. The manifest fetch now tries the built tree location as a second candidate and, if every candidate fails, sets a message the pane displays. - StackLayout's per-section catch deliberately left a failed section's host empty so the rest of the stack still renders. Keeping the stack alive was right; leaving the band blank and silent was not. A failed section now shows which element failed and which URL it came from, and still does not abort its siblings. Tree-relative scriptUrls are also resolved against the manifest they came from rather than the current document. The two roots are identical in the built tree and differ elsewhere, which turned every composed tab's bundle into a 404 against a path that exists nowhere. Measured, built tree: research-map-plus-grid mounts both children, 4778px of content, live canvas, zero 4xx -- unchanged. dashboard-plus-grid, stack-demo and research-map-plus-grid all render with a painted canvas and no failure cards. Where the bundles genuinely cannot be reached, the pane now names the element and the URL instead of showing grey.
This commit is contained in:
parent
bca3d58c3e
commit
d97cf9eab5
16 changed files with 135 additions and 35 deletions
|
|
@ -224,7 +224,40 @@ export default defineComponent({
|
|||
host.innerHTML = ''
|
||||
host.appendChild(el)
|
||||
})
|
||||
.catch(() => { /* a failed section leaves its host empty; the rest of the stack still renders */ })
|
||||
// ★ A FAILED SECTION MUST SAY SO (BUG-SIMPLE-RESEARCH-GREY-PANE, Driver reported 4x).
|
||||
// The rest of the stack still renders — that part was always right, and is why this catch
|
||||
// is per-section rather than around the whole loop. What was wrong is that it left the host
|
||||
// EMPTY and silent, so a composite whose children all failed rendered as a blank rectangle
|
||||
// with nothing in the console at this site. MEASURED under the dev server: <research-map-
|
||||
// plus-grid> mounted (count 1) with BOTH children 404 — 794px of pure grey and no message.
|
||||
// An empty band inside a working page is indistinguishable from a broken app, and it hid
|
||||
// this defect through four separate reports.
|
||||
//
|
||||
// The message is deliberately plain text in the host rather than a thrown error: throwing
|
||||
// here would abort the other sections, which is the one behaviour this catch exists to
|
||||
// prevent. Styling stays inline because the host is the consumer's node, not ours.
|
||||
.catch((e) => {
|
||||
const why = (e && e.message) || String(e)
|
||||
console.error('[StackLayout] section "' + sec.key + '" failed to mount <' +
|
||||
sec.element + '>' + (sec.src ? ' from ' + sec.src : '') + ': ' + why)
|
||||
try {
|
||||
host.innerHTML = ''
|
||||
const d = document.createElement('div')
|
||||
d.setAttribute('role', 'status')
|
||||
// overflow-wrap + break-word, because the payload is a URL: a long unbroken path
|
||||
// otherwise runs straight out of the card (measured — it overflowed the 1024px pane).
|
||||
// box-sizing + max-width:100% keep the card inside the host: the host can be narrower
|
||||
// than the message, and without these the margin is ADDED to a 100% width and the text
|
||||
// runs off the pane (measured — the URL escaped the 1024px pane twice before this).
|
||||
d.style.cssText = 'box-sizing:border-box;max-width:100%;' +
|
||||
'padding:16px;font:13px/1.5 ui-monospace,SFMono-Regular,Menlo,monospace;' +
|
||||
'color:#6d766e;background:#fff;border:1px solid #d1d4cd;border-radius:8px;margin:12px 0;' +
|
||||
'overflow-wrap:anywhere;word-break:break-word'
|
||||
d.textContent = 'Could not load <' + sec.element + '>' +
|
||||
(sec.src ? ' from ' + sec.src : '') + ' — ' + why
|
||||
host.appendChild(d)
|
||||
} catch { /* host detached mid-flight: nothing to report into */ }
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
|
|
|
|||
|
|
@ -131,6 +131,15 @@
|
|||
<div v-else-if="t.state === 'error'" class="dms-hint err">
|
||||
Could not load {{ t.label }}.<br><small>{{ t.error }}</small>
|
||||
</div>
|
||||
<!-- ★ THE FOURTH STATE, and the one that used to render NOTHING. A tab whose scriptUrl the
|
||||
manifest never supplied sits in state 'idle' forever: not loading, not errored, just an
|
||||
empty slot — the grey pane the Driver reported four times. Covering it here means a
|
||||
missing manifest now READS as a failure instead of looking like a blank app. -->
|
||||
<div v-else-if="t.state === 'idle' && !t.scriptUrl && manifestError" class="dms-hint err">
|
||||
Could not load {{ t.label }}.<br>
|
||||
<small>{{ manifestError }}</small><br>
|
||||
<small>This tab is composed from manifest.json — build the tree, or serve the built tree, to load it.</small>
|
||||
</div>
|
||||
</template>
|
||||
</section>
|
||||
|
||||
|
|
@ -706,6 +715,14 @@ export default defineComponent({
|
|||
// onSelect's intercept). '' renders nothing; _noticeTimer clears any earlier message's timeout
|
||||
// so two quick clicks don't fight over when it disappears.
|
||||
disabledNotice: '', _noticeTimer: null,
|
||||
// Set when EVERY manifest candidate failed. The manifest carries each tab's scriptUrl, so
|
||||
// without it no src-composed tab can mount; this turns that into a visible pane message
|
||||
// instead of an empty grey rectangle. See loadManifest().
|
||||
manifestError: '',
|
||||
// The DIRECTORY of the manifest that actually answered, with a trailing slash. Tree-relative
|
||||
// scriptUrls are resolved against THIS, not the document — see resolve(). Empty until a
|
||||
// manifest lands, which is exactly when there are no scriptUrls to resolve anyway.
|
||||
manifestBase: '',
|
||||
// i18n locale switcher (reuses app-wrapper-material/languages.js — persisted, offline, no dep).
|
||||
locale: loadLocale(),
|
||||
localeOpen: false,
|
||||
|
|
@ -927,14 +944,55 @@ export default defineComponent({
|
|||
//
|
||||
// Fail-soft by design: any error (no manifest shipped, a file:// drop where fetch is blocked,
|
||||
// malformed JSON) leaves the curated tabs unresolved and Experimental empty rather than throwing.
|
||||
//
|
||||
// ★ FAIL-SOFT IS NOT FAIL-SILENT (BUG-SIMPLE-RESEARCH-GREY-PANE, Driver reported 4x).
|
||||
// Every `src`-composed tab — Simple Research, Regions, every map — gets its `scriptUrl` from
|
||||
// this manifest and from nowhere else. Only tab 1 (Big Picture) is BAKED, so only tab 1 can
|
||||
// paint without it. When this fetch 404'd the old code swallowed it, mountTab() hit
|
||||
// `if (!t.scriptUrl) return`, and the pane stayed in state 'idle' — which renders NEITHER the
|
||||
// loading hint NOR the error hint. The result was a perfectly empty grey pane with no console
|
||||
// error, no overlay, and a correctly-highlighted rail row: it looks exactly like a mount
|
||||
// failure and is actually a missing file. MEASURED under `bun run dev` at
|
||||
// /plugin-designs/doxa-maps-spa/index.html: 404 /plugin-designs/manifest.json, deep element
|
||||
// count 134, <research-map-plus-grid> count 0. The SAME shell on the BUILT tree resolved the
|
||||
// manifest and painted 4778px of content with a live canvas.
|
||||
//
|
||||
// TWO CANDIDATES, because the shell runs in two trees that put the manifest in different
|
||||
// places. The built tree has it beside the bundle folders (resolve() → <base>/manifest.json).
|
||||
// The dev tree serves SOURCE from /plugin-designs/, where no manifest exists — it is a BUILD
|
||||
// ARTIFACT and lives under /public/doxa-maps/. Trying the built-tree path second means a dev
|
||||
// run finds the real manifest instead of going dark, and a production run is unchanged
|
||||
// (candidate 1 answers, candidate 2 is never requested).
|
||||
loadManifest() {
|
||||
const url = this.resolve('manifest.json')
|
||||
try {
|
||||
fetch(url, { credentials: 'omit' })
|
||||
.then(r => (r && r.ok) ? r.json() : null)
|
||||
.then(m => { if (m) this.applyManifest(m) })
|
||||
.catch(() => { /* non-fatal: see pruning note in applyManifest */ })
|
||||
} catch { /* fetch unavailable (non-browser): same fail-soft path */ }
|
||||
const candidates = [this.resolve('manifest.json')]
|
||||
const devFallback = '/public/doxa-maps/manifest.json'
|
||||
if (candidates.indexOf(devFallback) === -1) candidates.push(devFallback)
|
||||
const tried = []
|
||||
const attempt = (i) => {
|
||||
if (i >= candidates.length) {
|
||||
// Every candidate failed. Record it on the tabs so the PANE says so — see mountTab().
|
||||
this.manifestError = 'manifest.json not found (tried ' + tried.join(', ') + ')'
|
||||
console.error('[doxa-maps-spa] ' + this.manifestError +
|
||||
' — every tab except Big Picture is composed from it, so their panes cannot mount.')
|
||||
return
|
||||
}
|
||||
const url = candidates[i]
|
||||
tried.push(url)
|
||||
return fetch(url, { credentials: 'omit' })
|
||||
.then(r => { if (!r || !r.ok) throw new Error(url + ' → HTTP ' + (r ? r.status : '?')); return r.json() })
|
||||
.then(m => {
|
||||
if (!m) throw new Error(url + ' → empty')
|
||||
this.manifestError = ''
|
||||
// Anchor every tree-relative scriptUrl on the directory this manifest came from.
|
||||
// new URL() against location resolves '../' and rooted forms alike, so a caller-
|
||||
// supplied treeBase, a built-tree path and the dev fallback all normalise here.
|
||||
try { this.manifestBase = new URL(url, location.href).href.replace(/[^/]*$/, '') }
|
||||
catch { this.manifestBase = '' }
|
||||
this.applyManifest(m)
|
||||
})
|
||||
.catch(() => attempt(i + 1))
|
||||
}
|
||||
try { attempt(0) } catch { /* fetch unavailable (non-browser): same fail-soft path */ }
|
||||
},
|
||||
// Complete the curated tabs from the manifest, drop any whose bundle this tree does not ship,
|
||||
// then append the discovered Experimental tabs — and finally (re)drive the active tab's mount,
|
||||
|
|
@ -1014,6 +1072,15 @@ export default defineComponent({
|
|||
// trees rather than a dev-only special case.
|
||||
if (/^(https?:)?\/\//.test(raw) || raw.startsWith('/')) return raw
|
||||
const r = raw.replace(/^\.\//, '')
|
||||
// ★ TREE-RELATIVE REFS FOLLOW THE MANIFEST THAT SUPPLIED THEM, not this document.
|
||||
// Every scriptUrl comes out of manifest.json as a tree-relative path ("<bundle>/<bundle>.js"),
|
||||
// so it is only meaningful against the root the MANIFEST was read from. Those two roots are
|
||||
// the same in the built tree and DIFFERENT under the dev server, where the page is served
|
||||
// from /plugin-designs/ while the manifest lives at /public/doxa-maps/. Resolving against the
|
||||
// document there produced 404 /plugin-designs/research-map-plus-grid/research-map-plus-grid.js
|
||||
// — a path that exists nowhere. Anchoring on the manifest's own directory makes one rule
|
||||
// correct for both trees (in the built tree manifestBase === base, so nothing changes).
|
||||
if (this.manifestBase) return this.manifestBase.replace(/\/+$/, '') + '/' + r
|
||||
// Join through exactly one slash: base() normalises to a trailing "/", but a caller-supplied
|
||||
// tree-base may not, and a double slash 404s just as surely as a wrong prefix.
|
||||
if (this.base) return this.base.replace(/\/+$/, '') + '/' + r
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -40,7 +40,7 @@
|
|||
|
||||
<script>window.MAP_APP_API_URL = "https://pray.doxa.life";</script>
|
||||
<!-- Bundle IIFE — registers the <dashboard-plus-grid> custom element. -->
|
||||
<script src="../../dashboard-plus-grid.js" integrity="sha384-hMZAewXoUewwCalkRJkGZAhjx/6cnq2/sB+YQbxfFrolnsxMEV0YwQJxCnS0qYsu" crossorigin="anonymous"></script>
|
||||
<script src="../../dashboard-plus-grid.js" integrity="sha384-zUvuNNWNZdbjdsO1BJ6Wa+0mZ5HE4FEDpRRbWK2DFU52H9kh3zdY2SaQeY6HfeMD" crossorigin="anonymous"></script>
|
||||
|
||||
<script>
|
||||
// Mapbox token resolution — the A3 ladder, in precedence order:
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@
|
|||
|
||||
<script>window.MAP_APP_API_URL = "https://pray.doxa.life";</script>
|
||||
<!-- Bundle IIFE — registers the <dashboard-plus-grid> custom element. -->
|
||||
<script src="../dashboard-plus-grid.js" integrity="sha384-hMZAewXoUewwCalkRJkGZAhjx/6cnq2/sB+YQbxfFrolnsxMEV0YwQJxCnS0qYsu" crossorigin="anonymous"></script>
|
||||
<script src="../dashboard-plus-grid.js" integrity="sha384-zUvuNNWNZdbjdsO1BJ6Wa+0mZ5HE4FEDpRRbWK2DFU52H9kh3zdY2SaQeY6HfeMD" crossorigin="anonymous"></script>
|
||||
|
||||
<script>
|
||||
// Mapbox token resolution — the A3 ladder, in precedence order:
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
|
||||
<script>window.MAP_APP_API_URL = "https://pray.doxa.life";</script>
|
||||
<!-- Bundle IIFE — registers the <doxa-maps-spa> custom element. -->
|
||||
<script src="../../doxa-maps-spa.js" integrity="sha384-xBzg0WFQSdfa9tkQ9X2G6LOg3YURptleajqsly/Jyf+8edDiAgTkW1rUyv8QzFGv" crossorigin="anonymous"></script>
|
||||
<script src="../../doxa-maps-spa.js" integrity="sha384-T+Vb+RHoAB76ZnZ0wbg5KMkKrxBKStUH+Faf9PHc+efE1CZPiiW1NlerC1V8KaU1" crossorigin="anonymous"></script>
|
||||
|
||||
<script>
|
||||
// Mapbox token resolution — the A3 ladder, in precedence order:
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
|
||||
<script>window.MAP_APP_API_URL = "https://pray.doxa.life";</script>
|
||||
<!-- Bundle IIFE — registers the <doxa-maps-spa> custom element. -->
|
||||
<script src="../doxa-maps-spa.js" integrity="sha384-xBzg0WFQSdfa9tkQ9X2G6LOg3YURptleajqsly/Jyf+8edDiAgTkW1rUyv8QzFGv" crossorigin="anonymous"></script>
|
||||
<script src="../doxa-maps-spa.js" integrity="sha384-T+Vb+RHoAB76ZnZ0wbg5KMkKrxBKStUH+Faf9PHc+efE1CZPiiW1NlerC1V8KaU1" crossorigin="anonymous"></script>
|
||||
|
||||
<script>
|
||||
// Mapbox token resolution — the A3 ladder, in precedence order:
|
||||
|
|
|
|||
2
public/doxa-maps/index.html
generated
2
public/doxa-maps/index.html
generated
File diff suppressed because one or more lines are too long
20
public/doxa-maps/manifest.json
generated
20
public/doxa-maps/manifest.json
generated
|
|
@ -193,7 +193,7 @@
|
|||
"bundle": "dashboard-plus-grid",
|
||||
"scriptUrl": "./dashboard-plus-grid/dashboard-plus-grid.js",
|
||||
"output": "doxa-maps/dashboard-plus-grid/dashboard-plus-grid.js",
|
||||
"integrity": "sha384-hMZAewXoUewwCalkRJkGZAhjx/6cnq2/sB+YQbxfFrolnsxMEV0YwQJxCnS0qYsu",
|
||||
"integrity": "sha384-zUvuNNWNZdbjdsO1BJ6Wa+0mZ5HE4FEDpRRbWK2DFU52H9kh3zdY2SaQeY6HfeMD",
|
||||
"elements": [
|
||||
"dashboard-plus-grid"
|
||||
],
|
||||
|
|
@ -213,7 +213,7 @@
|
|||
"scriptUrl": "./dashboard-plus-grid/dashboard-plus-grid.js",
|
||||
"embed": {
|
||||
"iframe": "<iframe src=\"./dashboard-plus-grid/dashboard-plus-grid/index.html?utm_source=YOUR_SOURCE\" width=\"100%\" height=\"600\" style=\"border:none;border-radius:12px;\" allowfullscreen></iframe>",
|
||||
"script": "<script>window.MAP_APP_API_URL=\"https://pray.doxa.life\";</script>\n<script src=\"./dashboard-plus-grid/dashboard-plus-grid.js\" integrity=\"sha384-hMZAewXoUewwCalkRJkGZAhjx/6cnq2/sB+YQbxfFrolnsxMEV0YwQJxCnS0qYsu\" crossorigin=\"anonymous\"></script>\n<dashboard-plus-grid profile-config='{\"profile\":\"dashboard-plus-grid\",\"tk\":\"YOUR_MAPBOX_TOKEN\",\"utmSource\":\"YOUR_SOURCE\",\"assetsBase\":\"YOUR_TREE_URL/assets\"}'></dashboard-plus-grid>"
|
||||
"script": "<script>window.MAP_APP_API_URL=\"https://pray.doxa.life\";</script>\n<script src=\"./dashboard-plus-grid/dashboard-plus-grid.js\" integrity=\"sha384-zUvuNNWNZdbjdsO1BJ6Wa+0mZ5HE4FEDpRRbWK2DFU52H9kh3zdY2SaQeY6HfeMD\" crossorigin=\"anonymous\"></script>\n<dashboard-plus-grid profile-config='{\"profile\":\"dashboard-plus-grid\",\"tk\":\"YOUR_MAPBOX_TOKEN\",\"utmSource\":\"YOUR_SOURCE\",\"assetsBase\":\"YOUR_TREE_URL/assets\"}'></dashboard-plus-grid>"
|
||||
},
|
||||
"instances": [
|
||||
{
|
||||
|
|
@ -280,7 +280,7 @@
|
|||
"bundle": "doxa-maps-spa",
|
||||
"scriptUrl": "./doxa-maps-spa/doxa-maps-spa.js",
|
||||
"output": "doxa-maps/doxa-maps-spa/doxa-maps-spa.js",
|
||||
"integrity": "sha384-xBzg0WFQSdfa9tkQ9X2G6LOg3YURptleajqsly/Jyf+8edDiAgTkW1rUyv8QzFGv",
|
||||
"integrity": "sha384-T+Vb+RHoAB76ZnZ0wbg5KMkKrxBKStUH+Faf9PHc+efE1CZPiiW1NlerC1V8KaU1",
|
||||
"elements": [
|
||||
"doxa-maps-spa"
|
||||
],
|
||||
|
|
@ -304,7 +304,7 @@
|
|||
"scriptUrl": "./doxa-maps-spa/doxa-maps-spa.js",
|
||||
"embed": {
|
||||
"iframe": "<iframe src=\"./doxa-maps-spa/doxa-maps-spa/index.html?utm_source=YOUR_SOURCE\" width=\"100%\" height=\"600\" style=\"border:none;border-radius:12px;\" allowfullscreen></iframe>",
|
||||
"script": "<script>window.MAP_APP_API_URL=\"https://pray.doxa.life\";</script>\n<script src=\"./doxa-maps-spa/doxa-maps-spa.js\" integrity=\"sha384-xBzg0WFQSdfa9tkQ9X2G6LOg3YURptleajqsly/Jyf+8edDiAgTkW1rUyv8QzFGv\" crossorigin=\"anonymous\"></script>\n<doxa-maps-spa profile-config='{\"profile\":\"doxa-maps-spa\",\"tk\":\"YOUR_MAPBOX_TOKEN\",\"utmSource\":\"YOUR_SOURCE\",\"assetsBase\":\"YOUR_TREE_URL/assets\"}'></doxa-maps-spa>"
|
||||
"script": "<script>window.MAP_APP_API_URL=\"https://pray.doxa.life\";</script>\n<script src=\"./doxa-maps-spa/doxa-maps-spa.js\" integrity=\"sha384-T+Vb+RHoAB76ZnZ0wbg5KMkKrxBKStUH+Faf9PHc+efE1CZPiiW1NlerC1V8KaU1\" crossorigin=\"anonymous\"></script>\n<doxa-maps-spa profile-config='{\"profile\":\"doxa-maps-spa\",\"tk\":\"YOUR_MAPBOX_TOKEN\",\"utmSource\":\"YOUR_SOURCE\",\"assetsBase\":\"YOUR_TREE_URL/assets\"}'></doxa-maps-spa>"
|
||||
},
|
||||
"instances": [
|
||||
{
|
||||
|
|
@ -878,7 +878,7 @@
|
|||
"bundle": "research-dashboard",
|
||||
"scriptUrl": "./research-dashboard/research-dashboard.js",
|
||||
"output": "doxa-maps/research-dashboard/research-dashboard.js",
|
||||
"integrity": "sha384-vOGsI0iGbIPRWl0ic35cL7JoPk8KsOh9GrzIWTlUdZwUNA2hUabmDcv1h4pT3G2V",
|
||||
"integrity": "sha384-iS3PX4DbqpmhbOhuy/6w6PffVqdX+8S59w0FB/LSd4EK35EwAZJqek8HJsBJRo0+",
|
||||
"elements": [
|
||||
"research-dashboard-map"
|
||||
],
|
||||
|
|
@ -894,7 +894,7 @@
|
|||
"scriptUrl": "./research-dashboard/research-dashboard.js",
|
||||
"embed": {
|
||||
"iframe": "<iframe src=\"./research-dashboard/research-dashboard/index.html?utm_source=YOUR_SOURCE\" width=\"100%\" height=\"600\" style=\"border:none;border-radius:12px;\" allowfullscreen></iframe>",
|
||||
"script": "<script>window.MAP_APP_API_URL=\"https://pray.doxa.life\";</script>\n<script src=\"./research-dashboard/research-dashboard.js\" integrity=\"sha384-vOGsI0iGbIPRWl0ic35cL7JoPk8KsOh9GrzIWTlUdZwUNA2hUabmDcv1h4pT3G2V\" crossorigin=\"anonymous\"></script>\n<research-dashboard-map profile-config='{\"profile\":\"research-dashboard\",\"tk\":\"YOUR_MAPBOX_TOKEN\",\"utmSource\":\"YOUR_SOURCE\",\"assetsBase\":\"YOUR_TREE_URL/assets\"}'></research-dashboard-map>"
|
||||
"script": "<script>window.MAP_APP_API_URL=\"https://pray.doxa.life\";</script>\n<script src=\"./research-dashboard/research-dashboard.js\" integrity=\"sha384-iS3PX4DbqpmhbOhuy/6w6PffVqdX+8S59w0FB/LSd4EK35EwAZJqek8HJsBJRo0+\" crossorigin=\"anonymous\"></script>\n<research-dashboard-map profile-config='{\"profile\":\"research-dashboard\",\"tk\":\"YOUR_MAPBOX_TOKEN\",\"utmSource\":\"YOUR_SOURCE\",\"assetsBase\":\"YOUR_TREE_URL/assets\"}'></research-dashboard-map>"
|
||||
},
|
||||
"bundle": "research-dashboard"
|
||||
}
|
||||
|
|
@ -904,7 +904,7 @@
|
|||
"bundle": "research-map-plus-grid",
|
||||
"scriptUrl": "./research-map-plus-grid/research-map-plus-grid.js",
|
||||
"output": "doxa-maps/research-map-plus-grid/research-map-plus-grid.js",
|
||||
"integrity": "sha384-Dyh9E7k/YtwVCKP4lulQpWs9+oqKV5LJjxEnJMufru4zAzyZpbHyz0pja7hPwIwS",
|
||||
"integrity": "sha384-W3eI3zepAYbIa1bQfJTtvzU53KWPQEg8g4lVKmp3FtW7kNXOoKE2ny1JDjZ1L+MJ",
|
||||
"elements": [
|
||||
"research-map-plus-grid"
|
||||
],
|
||||
|
|
@ -924,7 +924,7 @@
|
|||
"scriptUrl": "./research-map-plus-grid/research-map-plus-grid.js",
|
||||
"embed": {
|
||||
"iframe": "<iframe src=\"./research-map-plus-grid/research-map-plus-grid/index.html?utm_source=YOUR_SOURCE\" width=\"100%\" height=\"600\" style=\"border:none;border-radius:12px;\" allowfullscreen></iframe>",
|
||||
"script": "<script>window.MAP_APP_API_URL=\"https://pray.doxa.life\";</script>\n<script src=\"./research-map-plus-grid/research-map-plus-grid.js\" integrity=\"sha384-Dyh9E7k/YtwVCKP4lulQpWs9+oqKV5LJjxEnJMufru4zAzyZpbHyz0pja7hPwIwS\" crossorigin=\"anonymous\"></script>\n<research-map-plus-grid profile-config='{\"profile\":\"research-map-plus-grid\",\"tk\":\"YOUR_MAPBOX_TOKEN\",\"utmSource\":\"YOUR_SOURCE\",\"assetsBase\":\"YOUR_TREE_URL/assets\"}'></research-map-plus-grid>"
|
||||
"script": "<script>window.MAP_APP_API_URL=\"https://pray.doxa.life\";</script>\n<script src=\"./research-map-plus-grid/research-map-plus-grid.js\" integrity=\"sha384-W3eI3zepAYbIa1bQfJTtvzU53KWPQEg8g4lVKmp3FtW7kNXOoKE2ny1JDjZ1L+MJ\" crossorigin=\"anonymous\"></script>\n<research-map-plus-grid profile-config='{\"profile\":\"research-map-plus-grid\",\"tk\":\"YOUR_MAPBOX_TOKEN\",\"utmSource\":\"YOUR_SOURCE\",\"assetsBase\":\"YOUR_TREE_URL/assets\"}'></research-map-plus-grid>"
|
||||
},
|
||||
"instances": [
|
||||
{
|
||||
|
|
@ -948,7 +948,7 @@
|
|||
"bundle": "stack-demo",
|
||||
"scriptUrl": "./stack-demo/stack-demo.js",
|
||||
"output": "doxa-maps/stack-demo/stack-demo.js",
|
||||
"integrity": "sha384-Wt5wtm3JMmbuKqXaBDYZ2Mrw3LF/q8LQ14d+qFPi958kH8aPJPAFGMvqHCD6BICy",
|
||||
"integrity": "sha384-GQTUiygn0aS3lHIfW6HIYA1Ko8P2KZr0iUicOp+xDFLNw2gaGmLCZdwa5/cUYeUI",
|
||||
"elements": [
|
||||
"stack-demo"
|
||||
],
|
||||
|
|
@ -968,7 +968,7 @@
|
|||
"scriptUrl": "./stack-demo/stack-demo.js",
|
||||
"embed": {
|
||||
"iframe": "<iframe src=\"./stack-demo/stack-demo/index.html?utm_source=YOUR_SOURCE\" width=\"100%\" height=\"600\" style=\"border:none;border-radius:12px;\" allowfullscreen></iframe>",
|
||||
"script": "<script>window.MAP_APP_API_URL=\"https://pray.doxa.life\";</script>\n<script src=\"./stack-demo/stack-demo.js\" integrity=\"sha384-Wt5wtm3JMmbuKqXaBDYZ2Mrw3LF/q8LQ14d+qFPi958kH8aPJPAFGMvqHCD6BICy\" crossorigin=\"anonymous\"></script>\n<stack-demo profile-config='{\"profile\":\"stack-demo\",\"tk\":\"YOUR_MAPBOX_TOKEN\",\"utmSource\":\"YOUR_SOURCE\",\"assetsBase\":\"YOUR_TREE_URL/assets\"}'></stack-demo>"
|
||||
"script": "<script>window.MAP_APP_API_URL=\"https://pray.doxa.life\";</script>\n<script src=\"./stack-demo/stack-demo.js\" integrity=\"sha384-GQTUiygn0aS3lHIfW6HIYA1Ko8P2KZr0iUicOp+xDFLNw2gaGmLCZdwa5/cUYeUI\" crossorigin=\"anonymous\"></script>\n<stack-demo profile-config='{\"profile\":\"stack-demo\",\"tk\":\"YOUR_MAPBOX_TOKEN\",\"utmSource\":\"YOUR_SOURCE\",\"assetsBase\":\"YOUR_TREE_URL/assets\"}'></stack-demo>"
|
||||
},
|
||||
"instances": [
|
||||
{
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@
|
|||
|
||||
<script>window.MAP_APP_API_URL = "https://pray.doxa.life";</script>
|
||||
<!-- Bundle IIFE — registers the <research-dashboard-map> custom element. -->
|
||||
<script src="../research-dashboard.js" integrity="sha384-vOGsI0iGbIPRWl0ic35cL7JoPk8KsOh9GrzIWTlUdZwUNA2hUabmDcv1h4pT3G2V" crossorigin="anonymous"></script>
|
||||
<script src="../research-dashboard.js" integrity="sha384-iS3PX4DbqpmhbOhuy/6w6PffVqdX+8S59w0FB/LSd4EK35EwAZJqek8HJsBJRo0+" crossorigin="anonymous"></script>
|
||||
|
||||
<script>
|
||||
// Mapbox token resolution — the A3 ladder, in precedence order:
|
||||
|
|
|
|||
|
|
@ -44,4 +44,4 @@
|
|||
.stl ::-webkit-scrollbar-thumb { background:#c4c8c0; border-radius:8px; }
|
||||
.stl ::-webkit-scrollbar-thumb:hover { background:#9aa197; }
|
||||
.stl ::-webkit-scrollbar-corner { background:transparent; }
|
||||
`,Kl=Qn({name:"StackLayout",props:{sections:{type:Array,default:()=>[]},title:{type:String,default:""},maxSectionHeight:{type:String,default:""},minSectionHeight:{type:String,default:""}},setup(){Ll(Bl,"stack-layout")},data(){return{_hosts:{},_mounted:{}}},mounted(){for(const t of this.sections||[])t.element&&this.mountSection(t)},methods:{registerHost(t,e){e&&(this._hosts[t]=e)},sectionStyle(t){const e={},s=t.maxHeight||this.maxSectionHeight,n=t.minHeight||this.minSectionHeight,i=!!(s&&n&&s===n);return s&&(e.maxHeight=s,i||(e.overflow="auto")),n&&(e.minHeight=n),Object.keys(e).length?e:null},hasDefiniteHeight(t){const e=t.maxHeight||this.maxSectionHeight,s=t.minHeight||this.minSectionHeight;return!!(e&&s&&e===s)},mountSection(t){if(this._mounted[t.key])return;this._mounted[t.key]=!0;const e=this._hosts[t.key];e&&Vl(t.src).then(()=>Ul(t.element)).then(()=>{if(!customElements.get(t.element))return;const s=document.createElement(t.element),n=t.attrs||{};for(const i in n){const r=n[i];try{s[i]=r}catch{}try{s.setAttribute(i,r==null?"":String(r))}catch{}}e.innerHTML="",e.appendChild(s)}).catch(()=>{})}}}),Wl={class:"stl"},zl={key:0,class:"stl-top"},ql={class:"stl-brand"},Gl={key:0,class:"stl-title"},Jl={class:"stl-meta"},Yl={class:"stl-stack"},Xl={key:0,class:"stl-sec-head"},Zl={class:"stl-sec-title"},Ql={key:0,class:"stl-sec-sub"},tc={key:2,class:"stl-slot"},ec={class:"stl-tail"};function sc(t,e,s,n,i,r){return ut(),$t("div",Wl,[t.$slots.brand||t.$slots.meta||t.title?(ut(),$t("header",zl,[Xt("span",ql,[ns(t.$slots,"brand")]),t.title?(ut(),$t("b",Gl,Ue(t.title),1)):fs("",!0),Xt("span",Jl,[ns(t.$slots,"meta")])])):fs("",!0),Xt("div",Yl,[(ut(!0),$t(ct,null,xo(t.sections,o=>(ut(),$t("section",{key:o.key,class:ke(["stl-sec",{"stl-sec-fill":t.hasDefiniteHeight(o)}]),style:Le(t.sectionStyle(o))},[o.title?(ut(),$t("div",Xl,[Xt("b",Zl,Ue(o.title),1),o.sub?(ut(),$t("span",Ql,Ue(o.sub),1)):fs("",!0)])):fs("",!0),o.element?(ut(),$t("div",{key:1,class:"stl-host",ref_for:!0,ref:l=>t.registerHost(o.key,l)},null,512)):(ut(),$t("div",tc,[ns(t.$slots,"section-"+o.key)]))],6))),128)),Xt("div",ec,[ns(t.$slots,"default")])])])}const nc=er(Kl,[["render",sc],["styles",[kl]]]),ic=bs&&bs.tagName.toUpperCase()==="SCRIPT"&&bs.src||new URL("research-map-plus-grid.js",document.baseURI).href,sr=t=>String(t||"").trim().replace(/\/+$/,"");function rc(){try{const e=String(ic||"").split(/[?#]/)[0].match(/^(.*)\/([^/]+)\/([^/]+)\.js$/);return!e||e[2]!==e[3]?null:e[1]||null}catch{return null}}function oc(t){if(typeof window<"u"){const e=window.MAP_EMBED_BASE_URL;if(typeof e=="string"&&e.trim())return sr(e)}return sr(rc()||"")}const lc=":host{display:block;width:100%}",nr="88svh",cc=Hl(er({__name:"research-map-plus-grid",setup(t){const e=(()=>{const n=(oc()||"").replace(/\/+$/,""),i="research-map-plus-grid/research-map-plus-grid/index.html";return n?n+"/"+i:i})(),s=[{key:"map",element:"doxa-research-map",src:"../../doxa-research-map/doxa-research-map.js",attrs:{"profile-config":JSON.stringify({profile:"research-map",dataSource:"pray-tools",instanceId:"rmpg-research-map",assetsBase:"../../assets",shareUrl:e})},minHeight:nr,maxHeight:nr},{key:"grid",element:"people-groups-grid",src:"../../people-groups-grid/people-groups-grid.js",attrs:{"show-search":"true","show-filters":"true","show-total":"true"}}];return(n,i)=>(ut(),ls(nc,{sections:s}))}},[["styles",[lc]]]));typeof customElements<"u"&&(customElements.get("research-map-plus-grid")||customElements.define("research-map-plus-grid",cc))})();
|
||||
`,Kl=Qn({name:"StackLayout",props:{sections:{type:Array,default:()=>[]},title:{type:String,default:""},maxSectionHeight:{type:String,default:""},minSectionHeight:{type:String,default:""}},setup(){Ll(Bl,"stack-layout")},data(){return{_hosts:{},_mounted:{}}},mounted(){for(const t of this.sections||[])t.element&&this.mountSection(t)},methods:{registerHost(t,e){e&&(this._hosts[t]=e)},sectionStyle(t){const e={},s=t.maxHeight||this.maxSectionHeight,n=t.minHeight||this.minSectionHeight,i=!!(s&&n&&s===n);return s&&(e.maxHeight=s,i||(e.overflow="auto")),n&&(e.minHeight=n),Object.keys(e).length?e:null},hasDefiniteHeight(t){const e=t.maxHeight||this.maxSectionHeight,s=t.minHeight||this.minSectionHeight;return!!(e&&s&&e===s)},mountSection(t){if(this._mounted[t.key])return;this._mounted[t.key]=!0;const e=this._hosts[t.key];e&&Vl(t.src).then(()=>Ul(t.element)).then(()=>{if(!customElements.get(t.element))return;const s=document.createElement(t.element),n=t.attrs||{};for(const i in n){const r=n[i];try{s[i]=r}catch{}try{s.setAttribute(i,r==null?"":String(r))}catch{}}e.innerHTML="",e.appendChild(s)}).catch(s=>{const n=s&&s.message||String(s);console.error('[StackLayout] section "'+t.key+'" failed to mount <'+t.element+">"+(t.src?" from "+t.src:"")+": "+n);try{e.innerHTML="";const i=document.createElement("div");i.setAttribute("role","status"),i.style.cssText="box-sizing:border-box;max-width:100%;padding:16px;font:13px/1.5 ui-monospace,SFMono-Regular,Menlo,monospace;color:#6d766e;background:#fff;border:1px solid #d1d4cd;border-radius:8px;margin:12px 0;overflow-wrap:anywhere;word-break:break-word",i.textContent="Could not load <"+t.element+">"+(t.src?" from "+t.src:"")+" — "+n,e.appendChild(i)}catch{}})}}}),Wl={class:"stl"},zl={key:0,class:"stl-top"},ql={class:"stl-brand"},Gl={key:0,class:"stl-title"},Jl={class:"stl-meta"},Yl={class:"stl-stack"},Xl={key:0,class:"stl-sec-head"},Zl={class:"stl-sec-title"},Ql={key:0,class:"stl-sec-sub"},tc={key:2,class:"stl-slot"},ec={class:"stl-tail"};function sc(t,e,s,n,i,r){return ut(),$t("div",Wl,[t.$slots.brand||t.$slots.meta||t.title?(ut(),$t("header",zl,[Xt("span",ql,[ns(t.$slots,"brand")]),t.title?(ut(),$t("b",Gl,Ue(t.title),1)):fs("",!0),Xt("span",Jl,[ns(t.$slots,"meta")])])):fs("",!0),Xt("div",Yl,[(ut(!0),$t(ct,null,xo(t.sections,o=>(ut(),$t("section",{key:o.key,class:ke(["stl-sec",{"stl-sec-fill":t.hasDefiniteHeight(o)}]),style:Le(t.sectionStyle(o))},[o.title?(ut(),$t("div",Xl,[Xt("b",Zl,Ue(o.title),1),o.sub?(ut(),$t("span",Ql,Ue(o.sub),1)):fs("",!0)])):fs("",!0),o.element?(ut(),$t("div",{key:1,class:"stl-host",ref_for:!0,ref:l=>t.registerHost(o.key,l)},null,512)):(ut(),$t("div",tc,[ns(t.$slots,"section-"+o.key)]))],6))),128)),Xt("div",ec,[ns(t.$slots,"default")])])])}const nc=er(Kl,[["render",sc],["styles",[kl]]]),ic=bs&&bs.tagName.toUpperCase()==="SCRIPT"&&bs.src||new URL("research-map-plus-grid.js",document.baseURI).href,sr=t=>String(t||"").trim().replace(/\/+$/,"");function rc(){try{const e=String(ic||"").split(/[?#]/)[0].match(/^(.*)\/([^/]+)\/([^/]+)\.js$/);return!e||e[2]!==e[3]?null:e[1]||null}catch{return null}}function oc(t){if(typeof window<"u"){const e=window.MAP_EMBED_BASE_URL;if(typeof e=="string"&&e.trim())return sr(e)}return sr(rc()||"")}const lc=":host{display:block;width:100%}",nr="88svh",cc=Hl(er({__name:"research-map-plus-grid",setup(t){const e=(()=>{const n=(oc()||"").replace(/\/+$/,""),i="research-map-plus-grid/research-map-plus-grid/index.html";return n?n+"/"+i:i})(),s=[{key:"map",element:"doxa-research-map",src:"../../doxa-research-map/doxa-research-map.js",attrs:{"profile-config":JSON.stringify({profile:"research-map",dataSource:"pray-tools",instanceId:"rmpg-research-map",assetsBase:"../../assets",shareUrl:e})},minHeight:nr,maxHeight:nr},{key:"grid",element:"people-groups-grid",src:"../../people-groups-grid/people-groups-grid.js",attrs:{"show-search":"true","show-filters":"true","show-total":"true"}}];return(n,i)=>(ut(),ls(nc,{sections:s}))}},[["styles",[lc]]]));typeof customElements<"u"&&(customElements.get("research-map-plus-grid")||customElements.define("research-map-plus-grid",cc))})();
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@
|
|||
|
||||
<script>window.MAP_APP_API_URL = "https://pray.doxa.life";</script>
|
||||
<!-- Bundle IIFE — registers the <research-map-plus-grid> custom element. -->
|
||||
<script src="../../research-map-plus-grid.js" integrity="sha384-Dyh9E7k/YtwVCKP4lulQpWs9+oqKV5LJjxEnJMufru4zAzyZpbHyz0pja7hPwIwS" crossorigin="anonymous"></script>
|
||||
<script src="../../research-map-plus-grid.js" integrity="sha384-W3eI3zepAYbIa1bQfJTtvzU53KWPQEg8g4lVKmp3FtW7kNXOoKE2ny1JDjZ1L+MJ" crossorigin="anonymous"></script>
|
||||
|
||||
<script>
|
||||
// Mapbox token resolution — the A3 ladder, in precedence order:
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@
|
|||
|
||||
<script>window.MAP_APP_API_URL = "https://pray.doxa.life";</script>
|
||||
<!-- Bundle IIFE — registers the <research-map-plus-grid> custom element. -->
|
||||
<script src="../research-map-plus-grid.js" integrity="sha384-Dyh9E7k/YtwVCKP4lulQpWs9+oqKV5LJjxEnJMufru4zAzyZpbHyz0pja7hPwIwS" crossorigin="anonymous"></script>
|
||||
<script src="../research-map-plus-grid.js" integrity="sha384-W3eI3zepAYbIa1bQfJTtvzU53KWPQEg8g4lVKmp3FtW7kNXOoKE2ny1JDjZ1L+MJ" crossorigin="anonymous"></script>
|
||||
|
||||
<script>
|
||||
// Mapbox token resolution — the A3 ladder, in precedence order:
|
||||
|
|
|
|||
10
public/doxa-maps/stack-demo/stack-demo.js
generated
10
public/doxa-maps/stack-demo/stack-demo.js
generated
File diff suppressed because one or more lines are too long
|
|
@ -37,7 +37,7 @@
|
|||
|
||||
<script>window.MAP_APP_API_URL = "https://pray.doxa.life";</script>
|
||||
<!-- Bundle IIFE — registers the <stack-demo> custom element. -->
|
||||
<script src="../stack-demo.js" integrity="sha384-Wt5wtm3JMmbuKqXaBDYZ2Mrw3LF/q8LQ14d+qFPi958kH8aPJPAFGMvqHCD6BICy" crossorigin="anonymous"></script>
|
||||
<script src="../stack-demo.js" integrity="sha384-GQTUiygn0aS3lHIfW6HIYA1Ko8P2KZr0iUicOp+xDFLNw2gaGmLCZdwa5/cUYeUI" crossorigin="anonymous"></script>
|
||||
|
||||
<script>
|
||||
// Mapbox token resolution — the A3 ladder, in precedence order:
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@
|
|||
|
||||
<script>window.MAP_APP_API_URL = "https://pray.doxa.life";</script>
|
||||
<!-- Bundle IIFE — registers the <stack-demo> custom element. -->
|
||||
<script src="../../stack-demo.js" integrity="sha384-Wt5wtm3JMmbuKqXaBDYZ2Mrw3LF/q8LQ14d+qFPi958kH8aPJPAFGMvqHCD6BICy" crossorigin="anonymous"></script>
|
||||
<script src="../../stack-demo.js" integrity="sha384-GQTUiygn0aS3lHIfW6HIYA1Ko8P2KZr0iUicOp+xDFLNw2gaGmLCZdwa5/cUYeUI" crossorigin="anonymous"></script>
|
||||
|
||||
<script>
|
||||
// Mapbox token resolution — the A3 ladder, in precedence order:
|
||||
|
|
|
|||
Loading…
Reference in a new issue