Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3,406 changes: 1,435 additions & 1,971 deletions package-lock.json

Large diffs are not rendered by default.

13 changes: 9 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,15 @@
},
"homepage": "https://github.com/solidos/mashlib",
"dependencies": {
"rdflib": "^2.3.0",
"solid-logic": "^3.1.1-a44ca66",
"solid-panes": "^3.7.3-f06890f4",
"solid-ui": "^2.6.1-e78cbe5"
"rdflib": "^2.3.5",
"solid-logic": "^4.0.1",
"solid-panes": "^4.0.0-newStyle-5047f5bd",
"solid-ui": "^3.0.1-0dd33a6"
},
"overrides": {
"rdflib": "$rdflib",
"solid-ui": "$solid-ui",
"solid-logic": "$solid-logic"
},
"devDependencies": {
"@babel/cli": "^7.28.0",
Expand Down
17 changes: 12 additions & 5 deletions src/databrowser.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@
<head>
<meta charset="utf-8"/>
<title><%= htmlWebpackPlugin.options.title %></title>
<script>
document.addEventListener('DOMContentLoaded', function() {
panes.runDataBrowser()
})
</script>
</head>
<body id="PageBody">
<!-- solid-panes' OutlineManager injects into this element -->
Expand All @@ -17,5 +12,17 @@
<div id="GlobalDashboard"></div>
</div>
<footer id="PageFooter"></footer>
<script>
// Call runDataBrowser after all scripts load
document.addEventListener('DOMContentLoaded', function() {
console.log('📄 DOMContentLoaded fired, checking for panes...')
if (window.panes && window.panes.runDataBrowser) {
console.log('✅ panes.runDataBrowser found, calling it...')
window.panes.runDataBrowser()
} else {
console.error('❌ panes.runDataBrowser not found on window')
}
})
</script>
</body>
</html>
39 changes: 39 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,45 @@ import { authn, solidLogicSingleton, authSession, store } from 'solid-logic'
import versionInfo from './versionInfo'
import { mashStyle } from './styles/mashlib-style'
import './styles/mash.css'
import * as UI from 'solid-ui'

const global: any = window

// Make UI available globally for solid-ui header theme selector
global.UI = UI

// Auto-detect and set base path for theme loading
if (!global.solid) global.solid = {}
// Find mashlib script tag to determine base path for shared themes
const scripts = Array.from(document.getElementsByTagName('script'))
for (const script of scripts) {
if (script.src && script.src.includes('mashlib')) {
global.solid.basePath = script.src.substring(0, script.src.lastIndexOf('/') + 1)
// eslint-disable-next-line no-console
console.log('🎨 Theme basePath set from mashlib script:', global.solid.basePath)
break
}
}
// Fallback to current location if mashlib script not found
if (!global.solid.basePath) {
const pathname = window.location.pathname
const basePath = pathname.endsWith('/') ? pathname : pathname.substring(0, pathname.lastIndexOf('/') + 1)
global.solid.basePath = window.location.origin + basePath
// eslint-disable-next-line no-console
console.log('🎨 Theme basePath set from current location (fallback):', global.solid.basePath)
}

// Initialize theme system now that basePath is set
const themeLoader = (UI as any).themeLoader
if (themeLoader && typeof themeLoader.init === 'function') {
// eslint-disable-next-line no-console
console.log('🎨 Initializing themeLoader with basePath:', global.solid.basePath)
themeLoader.init().catch((err: Error) => {
// eslint-disable-next-line no-console
console.error('Theme loader init failed:', err)
})
}

global.$rdf = $rdf
global.panes = panes
global.SolidLogic = {
Expand All @@ -20,6 +56,8 @@ global.mashlib = {
}

global.panes.runDataBrowser = function (uri?:string|$rdf.NamedNode|null) {
console.log('🚀 runDataBrowser called', { uri })

document.getElementById('PageBody')?.setAttribute('style', mashStyle.dbLayout)
document.getElementById('PageHeader')?.setAttribute('style', mashStyle.dbLayoutHeader)
document.getElementById('PageFooter')?.setAttribute('style', mashStyle.dbLayoutFooter)
Expand All @@ -42,6 +80,7 @@ global.panes.runDataBrowser = function (uri?:string|$rdf.NamedNode|null) {
// Authenticate the user
authn.checkUser().then(function (_profile: any) {
const mainPage = panes.initMainPage(solidLogicSingleton.store, uri)

return mainPage
})
}
Expand Down
Loading