Skip to content

Commit 81bf659

Browse files
committed
code improvements after authn move
1 parent 4a01612 commit 81bf659

32 files changed

Lines changed: 151 additions & 104 deletions

Documentation/form-examples/test-form.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ window.$rdf = UI.rdf
77
document.addEventListener('DOMContentLoaded', async function () {
88
/// ///////////////////////////////////////////
99

10-
var kb = UI.store
10+
var kb = UI.solidLogicLib.store
1111

1212
kb.updater.editable = // uri => true // Force modifyable UX // @@@
1313
function (uri) {

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,14 @@ document.body.appendChild(myButton)
3939
Or a chat widget:
4040
```js
4141
const chatChannel = 'https://example-user.inrupt.net/public/example-chat/index.ttl#this'
42-
const chat = UI.infiniteMessageArea(document, UI.store, UI.rdf.namedNode(chatChannel))
42+
const chat = UI.infiniteMessageArea(document, store, UI.rdf.namedNode(chatChannel))
4343
document.body.appendChild(chat)
4444
```
4545

4646
Or a full ACL Control Box:
4747
```js
4848
const exampleFolder = 'https://example-user.inrupt.net/public/public-control/'
49-
const aclControlBox = UI.aclControl.ACLControlBox5(UI.rdf.namedNode(exampleFolder), { dom: document }, '', UI.store)
49+
const aclControlBox = UI.aclControl.ACLControlBox5(UI.rdf.namedNode(exampleFolder), { dom: document }, '', store)
5050
document.body.appendChild(aclControlBox)
5151
```
5252

examples/header/index.html

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
<meta charset='UTF-8'>
66
<title>solid-ui UI.widgets.header examples page</title>
77
<script type="text/javascript" src="../../lib/webpack-bundle.js"></script>
8-
<script type="text/javascript" src="../../lib/authn/authn.js"></script>
9-
<script>
8+
<script type="text/javascript" src="../../lib/index.js"></script> <script>
109
const $ = document.querySelector.bind(document)
1110
function showSource(widgetName) {
1211
$(`#viewSource-${widgetName}`).innerHTML = $(`#script-${widgetName}`).innerText
@@ -25,11 +24,11 @@ <h2 id="header"><a href="#header">Header</a>
2524
<div id="webId"></div>
2625
<div id="loginBanner"></div>
2726
<script>
28-
loginBanner.appendChild(authn.loginStatusBox(document, null, {}));
27+
loginBanner.appendChild(UI.login.loginStatusBox(document, null, {}));
2928

3029
async function finishLogin() {
31-
await authn.authSession.handleIncomingRedirect();
32-
const session = authn.authSession;
30+
await UI.solidLogicLib.authSession.handleIncomingRedirect();
31+
const session = UI.solidLogicLib.authSession;
3332
if (session.info.isLoggedIn) {
3433
// Update the page with the status.
3534
webId.innerHTML = "Logged in as: " + authn.currentUser().uri;
@@ -82,7 +81,7 @@ <h2 id="header"><a href="#header">Header</a>
8281
window.addEventListener('DOMContentLoaded', async () => {
8382
try {
8483
options = { menuList: [{ label: "Testing Button", onclick: () => { alert('hello') } }, { label: "Testing Link", url: 'https://reflectechblog.wordpress.com/' }] }
85-
await UI.initHeader(UI.store, options)
84+
await UI.initHeader(UI.solidLogicLib.store, options)
8685
} catch (error) {
8786
window.alert(`Error loading header. You need to have a div with id = PageHeader on your page.`)
8887
}

examples/matrix/test-matrix.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ window.$rdf = UI.rdf
66
document.addEventListener('DOMContentLoaded', function () {
77
/// ///////////////////////////////////////////
88

9-
var kb = UI.store
9+
var kb = UI.solidLogicLib.store
1010
var dom = document
1111

1212
var ICAL = $rdf.Namespace('http://www.w3.org/2002/12/cal/ical#')

package-lock.json

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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
"path-browserify": "^1.0.1",
6565
"postcss-flexbugs-fixes": "^5.0.2",
6666
"rdflib": "^2.2.17",
67-
"solid-logic": "github:solid/solid-logic#tryMoveAuth",
67+
"solid-logic": "^1.3.13-2e3e7417",
6868
"solid-namespace": "^0.5.2",
6969
"stream-browserify": "^3.0.0",
7070
"uuid": "^8.3.2"

src/chat/bookmarks.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ import * as rdf from 'rdflib' // pull in first avoid cross-refs
1313
import * as style from '../style'
1414
import * as utils from '../utils'
1515
import * as widgets from '../widgets'
16-
import { authn, store } from 'solid-logic'
16+
import { store, registerInTypeIndex, authn } from 'solid-logic'
1717
import { findAppInstances } from '../login/login'
1818

19-
const UI = { icons, ns, media, pad, rdf, store, style, utils, widgets }
19+
const UI = { icons, ns, media, pad, rdf, style, utils, widgets }
2020
const $rdf = UI.rdf
2121

2222
const BOOK = $rdf.Namespace('http://www.w3.org/2002/01/bookmark#')
@@ -115,7 +115,7 @@ export async function findBookmarkDocument (userContext) {
115115
alert.error("Can't make fresh bookmark file:" + e)
116116
return userContext
117117
}
118-
await authn.registerInTypeIndex(
118+
await registerInTypeIndex(
119119
userContext,
120120
newBookmarkFile,
121121
theClass,

src/chat/chatLogic.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
import * as debug from '../debug'
77
import { DateFolder } from './dateFolder'
8-
import { store, authn } from '../logic'
8+
import { store, authn } from 'solid-logic'
99
import * as ns from '../ns'
1010
import * as $rdf from 'rdflib' // pull in first avoid cross-refs
1111
import * as utils from '../utils'

src/chat/class-version-dropped-infinte.wasjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// import { authn } from '../authn/index'
66
import * as debug from '../debug'
77
import { icons } from '../iconBase'
8-
import { store } from '../logic'
8+
import { store } from 'solid-logic'
99
// import { media } from '../media/index'
1010
import * as ns from '../ns'
1111
// import * as pad from '../pad'
@@ -21,7 +21,7 @@ import * as widgets from '../widgets'
2121

2222
const dom = window.document
2323

24-
// const UI = { authn, icons, ns, media, pad, $rdf, store, style, utils, widgets }
24+
// const UI = { authn, icons, ns, media, pad, $rdf, style, utils, widgets }
2525

2626
export function desktopNotification (str) {
2727
// Let's check if the browser supports notifications

src/folders.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55

66
import * as debug from './debug'
77
import { icons } from './iconBase'
8-
import { store } from 'solid-logic'
8+
import { solidLogicSingleton } from 'solid-logic'
99
import * as ns from './ns'
1010
import * as rdf from 'rdflib' // pull in first avoid cross-refs
1111
import * as style from './style'
1212
import * as widgets from './widgets'
1313

14-
const UI = { icons, ns, rdf, store, style, widgets }
14+
const UI = { icons, ns, rdf, style, widgets }
1515

1616
export function deleteRecursive (kb, folder) {
1717
// eslint-disable-next-line promise/param-names
@@ -75,7 +75,7 @@ function forAllFiles (folder, kb, action) {
7575
*/
7676
/* global document */
7777
export function deleteFolder (folder, store, dom) {
78-
store = store || UI.store
78+
store = store || solidLogicSingleton.store
7979
if (typeof docuent !== 'undefined') {
8080
dom = dom || document
8181
}

0 commit comments

Comments
 (0)