Skip to content
Merged
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
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ Use modern JavaScript modules with `import` statements.
<script type="module">
// Import from CDN (esm.sh, unpkg, or jsdelivr)
import * as $rdf from 'https://esm.sh/rdflib'
import * as SolidLogic from 'https://esm.sh/solid-logic'
import * as UI from 'https://esm.sh/solid-ui'
import * as SolidLogic from 'https://esm.sh/solid-logic@4.0.1'
import * as UI from 'https://esm.sh/solid-ui@3.0.1'

// Get the logged-in user
const webId = SolidLogic.authn.currentUser()
Expand Down Expand Up @@ -196,8 +196,8 @@ Use import maps for cleaner module specifiers:
{
"imports": {
"rdflib": "https://esm.sh/rdflib",
"solid-logic": "https://esm.sh/solid-logic",
"solid-ui": "https://esm.sh/solid-ui"
"solid-logic": "https://esm.sh/solid-logic@4.0.1",
"solid-ui": "https://esm.sh/solid-ui@3.0.1"
}
}
</script>
Expand Down
105 changes: 52 additions & 53 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 8 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "solid-ui",
"version": "3.0.0",
"version": "3.0.1",
"description": "UI library for Solid applications",
"main": "dist/solid-ui.js",
"types": "dist/index.d.ts",
Expand Down Expand Up @@ -68,14 +68,14 @@
"@noble/curves": "^1.9.6",
"@noble/hashes": "^1.8.0",
"escape-html": "^1.0.3",
"mime-types": "^3.0.1",
"mime-types": "^3.0.2",
"pane-registry": "^3.0.0",
"solid-namespace": "^0.5.4",
"uuid": "^11.1.0"
},
"peerDependencies": {
"rdflib": "^2.3.0",
"solid-logic": "^4.0.0"
"solid-logic": "^4.0.1"
},
"devDependencies": {
"@babel/cli": "^7.28.3",
Expand All @@ -84,7 +84,6 @@
"@babel/preset-env": "^7.28.0",
"@babel/preset-typescript": "^7.27.1",
"@babel/runtime": "^7.28.2",
"@eslint/eslintrc": "^3.3.1",
"@eslint/js": "^9.32.0",
"@mdx-js/react": "^3.1.0",
"@storybook/addon-actions": "7.6.20",
Expand All @@ -98,13 +97,13 @@
"@types/jest": "^30.0.0",
"@types/jsdom": "^21.1.7",
"@types/node": "^24.2.0",
"@typescript-eslint/parser": "^8.39.0",
"@typescript-eslint/parser": "^8.48.1",
"babel-jest": "^30.1.2",
"babel-loader": "^10.0.0",
"eslint": "^9.32.0",
"eslint-import-resolver-typescript": "^4.4.4",
"eslint-plugin-import": "^2.32.0",
"eslint-plugin-jest": "^29.0.1",
"eslint-plugin-jest": "^29.2.1",
"eslint-plugin-n": "^17.21.3",
"eslint-plugin-promise": "^7.2.1",
"get-random-values": "^4.0.0",
Expand All @@ -119,12 +118,12 @@
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-is": "^17.0.2",
"solid-logic": "^4.0.0",
"solid-logic": "^4.0.1",
"storybook": "^7.6.20",
"terser-webpack-plugin": "^5.3.14",
"terser-webpack-plugin": "^5.3.15",
"typedoc": "^0.28.9",
"typescript": "^5.9.2",
"webpack": "^5.101.0",
"webpack": "^5.103.0",
"webpack-cli": "^6.0.1"
},
"optionalDependencies": {
Expand Down
68 changes: 68 additions & 0 deletions test/testBundles/test-bundle.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<!DOCTYPE html>
<html>
<head>
<title>Solid-UI ESM with Import Maps</title>
</head>
<body>
<div id="app"></div>

<!-- Define import map for bare specifiers -->
<script type="importmap">
{
"imports": {
"rdflib": "https://esm.sh/rdflib",
"solid-logic": "https://esm.sh/solid-logic@4.0.1",
"solid-ui": "https://esm.sh/solid-ui@3.0.1"
}
}
</script>

<script type="module">
// Use clean bare specifiers
import * as $rdf from 'rdflib'
import * as SolidLogic from 'solid-logic'
import * as UI from 'solid-ui'

const app = document.getElementById('app')

// Create a profile button for logged-in user
async function createUserButton() {
const webId = SolidLogic.authn.currentUser()

if (!webId) {
const loginBtn = UI.widgets.button(
document,
'https://solidproject.org/assets/img/solid-emblem.svg',
'Login',
() => SolidLogic.authn.checkUser()
)
app.appendChild(loginBtn)
return
}

// Fetch user profile
try {
await SolidLogic.store.fetcher.load(webId.doc())
const name = SolidLogic.store.any(
webId,
$rdf.sym('http://xmlns.com/foaf/0.1/name')
)

const profileBtn = UI.widgets.button(
document,
'https://solidproject.org/assets/img/solid-emblem.svg',
name ? name.value : 'My Profile',
() => {
alert(`WebID: ${webId.value}\nName: ${name ? name.value : 'Not set'}`)
}
)
app.appendChild(profileBtn)
} catch (error) {
console.error('Error loading profile:', error)
}
}

createUserButton()
</script>
</body>
</html>
Loading