Skip to content

Commit 40a2a46

Browse files
authored
v2.1.0
This PR will integrate HTML5 and basic accessibility elements. We start with the profile-pane
2 parents f235798 + 844d035 commit 40a2a46

File tree

13 files changed

+3126
-1391
lines changed

13 files changed

+3126
-1391
lines changed

package-lock.json

Lines changed: 873 additions & 665 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 27 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mashlib",
3-
"version": "2.0.0",
3+
"version": "2.1.0",
44
"description": "Data mashup library",
55
"main": "dist/mashlib.js",
66
"files": [
@@ -49,35 +49,41 @@
4949
},
5050
"homepage": "https://github.com/solidos/mashlib",
5151
"dependencies": {
52-
"rdflib": "^2.3.3",
53-
"solid-logic": "^4.0.0",
54-
"solid-panes": "^4.0.0",
55-
"solid-ui": "^3.0.0"
52+
"rdflib": "^2.3.5",
53+
"solid-logic": "^4.0.2",
54+
"solid-panes": "^4.1.0",
55+
"solid-ui": "^3.0.4"
56+
},
57+
"overrides": {
58+
"rdflib": "$rdflib",
59+
"solid-logic": "$solid-logic",
60+
"solid-panes": "$solid-panes",
61+
"solid-ui": "$solid-ui"
5662
},
5763
"devDependencies": {
58-
"@babel/cli": "^7.28.0",
59-
"@babel/core": "^7.28.0",
60-
"@babel/plugin-transform-runtime": "^7.28.0",
61-
"@babel/preset-env": "^7.28.0",
62-
"@babel/preset-typescript": "^7.27.1",
63-
"@typescript-eslint/parser": "^8.39.0",
64+
"@babel/cli": "^7.28.6",
65+
"@babel/core": "^7.28.6",
66+
"@babel/plugin-transform-runtime": "^7.28.5",
67+
"@babel/preset-env": "^7.28.6",
68+
"@babel/preset-typescript": "^7.28.5",
69+
"@typescript-eslint/parser": "^8.54.0",
6470
"@webpack-cli/serve": "^3.0.1",
6571
"babel-loader": "^10.0.0",
6672
"bundlesize2": "^0.0.35",
67-
"copy-webpack-plugin": "^13.0.0",
68-
"css-loader": "^7.1.2",
69-
"eslint": "^9.33.0",
73+
"copy-webpack-plugin": "^13.0.1",
74+
"css-loader": "^7.1.3",
75+
"eslint": "^9.39.2",
7076
"file-loader": "^6.2.0",
71-
"globals": "^17.0.0",
72-
"html-webpack-plugin": "^5.6.3",
73-
"mini-css-extract-plugin": "^2.9.4",
77+
"globals": "^17.2.0",
78+
"html-webpack-plugin": "^5.6.6",
79+
"mini-css-extract-plugin": "^2.10.0",
7480
"node-polyfill-webpack-plugin": "^4.1.0",
75-
"terser-webpack-plugin": "^5.3.14",
76-
"typescript": "^5.9.2",
81+
"terser-webpack-plugin": "^5.3.16",
82+
"typescript": "^5.9.3",
7783
"url-loader": "^4.1.1",
78-
"webpack": "^5.101.0",
84+
"webpack": "^5.104.1",
7985
"webpack-cli": "^6.0.1",
80-
"webpack-dev-server": "^5.2.2"
86+
"webpack-dev-server": "^5.2.3"
8187
},
8288
"bundlesize": [
8389
{

src/databrowser.html

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,26 @@
99
})
1010
</script>
1111
</head>
12-
<body id="PageBody">
13-
<!-- solid-panes' OutlineManager injects into this element -->
14-
<header id="PageHeader"></header>
15-
<div class="TabulatorOutline" id="DummyUUID" role="main">
16-
<table id="outline"></table>
17-
<div id="GlobalDashboard"></div>
18-
</div>
19-
<footer id="PageFooter"></footer>
12+
<body id="PageBody">
13+
<a href="#DummyUUID" class="skip-link">Skip to main content</a>
14+
<!-- solid-panes' OutlineManager injects into this element -->
15+
<header id="PageHeader" role="banner"></header>
16+
<main id="mainContent" tabindex="-1">
17+
<div class="TabulatorOutline" id="DummyUUID">
18+
<table id="outline">
19+
<thead>
20+
<tr>
21+
<th id="outlineHeader" scope="col"></th>
22+
<!-- Add more <th> as needed for columns -->
23+
</tr>
24+
</thead>
25+
<tbody>
26+
<!-- Table rows injected by JS -->
27+
</tbody>
28+
</table>
29+
<div id="GlobalDashboard" aria-label="Global Dashboard"></div>
30+
</div>
31+
</main>
32+
<footer id="PageFooter" role="contentinfo"></footer>
2033
</body>
2134
</html>

src/index.ts

Lines changed: 35 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,39 @@ import * as $rdf from 'rdflib'
22
import * as panes from 'solid-panes'
33
import { authn, solidLogicSingleton, authSession, store } from 'solid-logic'
44
import versionInfo from './versionInfo'
5-
import { mashStyle } from './styles/mashlib-style'
65
import './styles/mash.css'
76

87
const global: any = window
98

9+
// Theme Management
10+
const initializeTheme = () => {
11+
const savedTheme = localStorage.getItem('mashlib-theme')
12+
const prefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches
13+
const theme = savedTheme || (prefersDark ? 'dark' : 'light')
14+
15+
if (theme === 'dark') {
16+
document.documentElement.setAttribute('data-theme', 'dark')
17+
} else {
18+
document.documentElement.removeAttribute('data-theme')
19+
}
20+
}
21+
22+
const setTheme = (theme: 'light' | 'dark') => {
23+
if (theme === 'dark') {
24+
document.documentElement.setAttribute('data-theme', 'dark')
25+
} else {
26+
document.documentElement.removeAttribute('data-theme')
27+
}
28+
localStorage.setItem('mashlib-theme', theme)
29+
}
30+
31+
const getTheme = (): 'light' | 'dark' => {
32+
return document.documentElement.getAttribute('data-theme') === 'dark' ? 'dark' : 'light'
33+
}
34+
35+
// Initialize theme on load
36+
initializeTheme()
37+
1038
global.$rdf = $rdf
1139
global.panes = panes
1240
global.SolidLogic = {
@@ -16,15 +44,15 @@ global.SolidLogic = {
1644
solidLogicSingleton
1745
}
1846
global.mashlib = {
19-
versionInfo
47+
versionInfo,
48+
theme: {
49+
set: setTheme,
50+
get: getTheme,
51+
init: initializeTheme
52+
}
2053
}
2154

2255
global.panes.runDataBrowser = function (uri?:string|$rdf.NamedNode|null) {
23-
document.getElementById('PageBody')?.setAttribute('style', mashStyle.dbLayout)
24-
document.getElementById('PageHeader')?.setAttribute('style', mashStyle.dbLayoutHeader)
25-
document.getElementById('PageFooter')?.setAttribute('style', mashStyle.dbLayoutFooter)
26-
document.getElementById('DummyUUID')?.setAttribute('style', mashStyle.dbLayoutContent)
27-
2856
// Set up cross-site proxy
2957
const fetcher: any = $rdf.Fetcher
3058
fetcher.crossSiteProxyTemplate = window.origin + '/xss/?uri={uri}'

0 commit comments

Comments
 (0)