mashlib 1.7.22 → 1.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +90 -43
- package/dist/databrowser.html +1 -1
- package/dist/mash.css +974 -241
- package/dist/mash.css.map +1 -1
- package/dist/mashlib.js +47 -16
- package/dist/mashlib.js.map +1 -1
- package/dist/mashlib.min.js +4 -4
- package/dist/mashlib.min.js.map +1 -1
- package/package.json +1 -3
package/README.md
CHANGED
|
@@ -1,43 +1,110 @@
|
|
|
1
|
-
# Solid-compatible data mashup library and
|
|
1
|
+
# Solid-compatible data mashup library and Databrowser
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/mashlib)
|
|
4
4
|
|
|
5
|
-
The mashlib (`mashlib.js`) is a solid-compatible code library of application-level functionality for the world of Solid.
|
|
6
|
-
|
|
5
|
+
The mashlib library (`mashlib.js`) is a solid-compatible code library of application-level functionality for the world of Solid. It compiles all of the following repositories into what we know as `mashlib.js`:
|
|
6
|
+
- [**solid-logic**](https://github.com/solid/solid-logic) — core business logic of SolidOS
|
|
7
|
+
- [**pane-registry**](https://github.com/solid/pane-registry) - an index to hold all loaded solid panes, whether statically or dynamically loaded
|
|
8
|
+
- [**solid-ui**](https://github.com/solid/solid-ui) — User Interface widgets and utilities for Solid. Building blocks for solid-based apps
|
|
9
|
+
- [**solid-panes**](https://github.com/solid/solid-panes) — a set of core solid-compatible panes based on solid-ui.
|
|
10
|
+
|
|
11
|
+
A colorful dependency tree can be seen [here](https://github.com/solid/solidos/blob/main/documentation/solidos_dependencies.svg).
|
|
12
|
+
|
|
13
|
+
## Developing mashlib
|
|
14
|
+
|
|
15
|
+
As part of the SolidOS stack, mashlib can be developed locally by setting up the SolidOS code. Read more about that on the [SolidOS Readme](https://github.com/solid/solidos#-getting-started-with-the-solidos-code).
|
|
7
16
|
|
|
8
17
|
## Goals
|
|
9
18
|
|
|
10
|
-
|
|
19
|
+
The goals of mashlib overlap with the [SolidOS Goals](https://solidos.solidcommunity.net/Team/docs/SolidOSNorthStar.html).
|
|
20
|
+
|
|
21
|
+
## Typical uses
|
|
11
22
|
|
|
12
|
-
|
|
23
|
+
One major use of mashlib is as a "databrowser" for a personal data store.
|
|
13
24
|
|
|
14
|
-
|
|
25
|
+
Mashlib is used in SolidOS and contributes to:
|
|
15
26
|
|
|
16
|
-
-
|
|
27
|
+
- SolidOS Databrowser Frontend - a frontend for Solid Servers like <solidcommunity.net>
|
|
28
|
+
- SolidOS Data-Kitchen - a stand-alone desktop app: <https://github.com/solid/data-kitchen>
|
|
17
29
|
|
|
18
|
-
|
|
30
|
+
mashlib is also used stand-alone as the SolidOS Databrowser Webapp and can be tried out at <https://solid.github.io/mashlib/dist/browse.html>.
|
|
19
31
|
|
|
20
|
-
|
|
32
|
+
mashlib is also used as a library by adding `mashlib.js` (or minified version) directly to your applications. For example:
|
|
21
33
|
|
|
22
|
-
|
|
34
|
+
`<script src="https://solidcommunity.net/mashlib.js"></script>`.
|
|
23
35
|
|
|
24
|
-
|
|
36
|
+
## Previous versions of this documentation
|
|
25
37
|
|
|
26
|
-
|
|
38
|
+
Check out [SolidOS Pod](https://solidos.solidcommunity.net/Team/docs/solidos.html) for an earlier version of this documentation.
|
|
27
39
|
|
|
28
|
-
|
|
40
|
+
# Documentation
|
|
29
41
|
|
|
42
|
+
## Different implementations
|
|
30
43
|
|
|
31
|
-
|
|
44
|
+
### SolidOS Databrowser Webapp
|
|
45
|
+
|
|
46
|
+
The `static/browse.html` page is compiled one to one into the `dist` (output) folder of mashlib and makes mashlib available stand-alone as the SolidOS Databrowser Webapp.
|
|
47
|
+
|
|
48
|
+
You can see and try out a SolidOS Databrowser Webapp deployment at <https://solid.github.io/mashlib/dist/browse.html>.
|
|
49
|
+
|
|
50
|
+
`browse.html`serves as a perfect example for Solid WebID authentication and for making use of mashlib functions and variables.
|
|
51
|
+
|
|
52
|
+
### SolidOS Databrowser Frontend
|
|
53
|
+
|
|
54
|
+
The `src/databrowser.html`page is compiled into the SolidOS Databrowser Frontend which is displayed for each WebID on [solidcommunity.net](https://solidcommunity.net/). This is the case because the [solidcommunity.net](https://solidcommunity.net/) Solid Server is configured with SolidOS as its front-end.
|
|
55
|
+
|
|
56
|
+
More information about the SolidOS Front-end and how to use it visit the [User Guide](https://github.com/solid/userguide).
|
|
57
|
+
|
|
58
|
+
### SolidOS Data-Kitchen
|
|
59
|
+
|
|
60
|
+
SolidOS Data-Kitchen uses `mashlib.js`as a direct import in its source code. Visit the code at [SolidOS Data-Kitchen GitHub](https://github.com/solid/data-kitchen).
|
|
61
|
+
|
|
62
|
+
## Mashlib global variables and functions
|
|
63
|
+
|
|
64
|
+
If one wants to use mashlib as a direct import (as a package dependency or script import), one needs to know which global variables and functions are available.
|
|
65
|
+
|
|
66
|
+
The availability of these global variables depends on how the sub-modules are imported and exported and on where the variables are instantiated. For a basic theoretical read, please see [this resource](https://www.javatpoint.com/javascript-global-variable).
|
|
67
|
+
|
|
68
|
+
What does `global` mean in mashlib? We mean the `global object` which depends on different environments. In mashlib, for now, we use the `window` context which means these variables will not work if directly used in non-window contexts such as `Node.js` environments. (This does not mean you cannot use mashlib in `Node.js` environments; just import it through `npm`). At some point, we will switch this to the [`globalThis`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/globalThis).
|
|
32
69
|
|
|
33
|
-
|
|
34
|
-
The mashlib has been used before, originally in various apps, in specific data interactions in different
|
|
35
|
-
domains. It has been used in a **browser extension** (in Firefox and later Chrome) to add data-handling
|
|
36
|
-
capacity as native to the browser itself. Several (personal) data stores will serve this HTML view as a
|
|
37
|
-
sort of poor person's data browser extension, which loads the library and then tries to work as though
|
|
38
|
-
the browser had been extended to understand data.
|
|
70
|
+
These are the most important window context/global variables and the sub-repos from which they are exported:
|
|
39
71
|
|
|
40
|
-
|
|
72
|
+
- [**solid-logic**](https://github.com/solid/solid-logic/blob/f606b31382a416ee6188930c3ca05cb4ae73cbda/src/index.ts#L29) exports among others: `solidLogicSingleton`, `authn`, `authSession`, `store`, `chat`, `profile`
|
|
73
|
+
- [**pane-registry**](https://github.com/solid/pane-registry) is exported entirely through the pane-registry variable
|
|
74
|
+
- [**solid-ui**](https://github.com/solid/solid-ui/blob/c5a8888d6cb61363bc0445be007e3c96de593338/src/index.ts#L79) exports among others: authn, store, rdf, dom under the `UI` variable
|
|
75
|
+
- [**solid-panes**](https://github.com/solid/solid-panes/blob/033f48f8987364cb131455b13e8b0637da95a5ab/src/index.ts#L53) exports getOutliner and the entire solid-ui through the `UI` variable, and solid-panes itself can be used through the `panes` variable
|
|
76
|
+
|
|
77
|
+
For backward compatibility reasons, there are now different ways to make use of the same variables from mashlib. For example:
|
|
78
|
+
|
|
79
|
+
- to make use of the UI (solid-ui) one can use `UI` or `panes.UI`
|
|
80
|
+
- authentication session, part of solid-logic, can be called as `authSession` or `UI.authn.authSession` or `panes.UI.authn.authSession`
|
|
81
|
+
- the store (from solid-logic) can be used as `store` or `UI.store` or `panes.UI.store`
|
|
82
|
+
- rdflib is entirely acessible as `UI.rdf` or `panes.UI.rdf`
|
|
83
|
+
- the currentUser function is called as `authn.currentUser()` or `UI.auth.currentUser()` or `panes.UI.authn.currentUser()`
|
|
84
|
+
- to make use of the login pop-up, one needs to call the `UI.login.loginStatusBox` function
|
|
85
|
+
|
|
86
|
+
You can see example usage in the [SolidOS Databrowser Webapp code](https://github.com/solid/mashlib/blob/main/static/browse.html#L11).
|
|
87
|
+
|
|
88
|
+
## Code changes due to moving authn from solid-ui to solid-logic
|
|
89
|
+
|
|
90
|
+
Some packages have been moved and with them some functions too. Here we report on these changes:
|
|
91
|
+
|
|
92
|
+
### Solid-ui & Solid-logic related:
|
|
93
|
+
|
|
94
|
+
* There is no more `authn` as you might have known it in solid-ui pre mashlib version 1.7.18 (solid-ui 2.4.16).
|
|
95
|
+
* Some functions in solid-ui which initially were found under `solid-ui/authn` are now under `solid-ui/login`.
|
|
96
|
+
* Two functions were renamed:
|
|
97
|
+
* logInLoadPreferences -> ensureLoadedPreferences
|
|
98
|
+
* logInLoadProfile -> ensureLoadedProfile
|
|
99
|
+
* logIn -> ensureLoggedIn
|
|
100
|
+
|
|
101
|
+
Functions that moved:
|
|
102
|
+
|
|
103
|
+
* `currentUser`, `checkUser`, `saveUser`, `offlineTestID` are now part of `solid-logic/authn/SolidAuthnLogic.ts`-> this is because `authn` itself moved to solid-logic.
|
|
104
|
+
* `setACLUserPublic`, `fetchACLRel` are not part of `solid-logic/src/acl/aclLogic.ts/` and are exported in [index.ts](https://github.com/solid/solid-logic/blob/f606b31382a416ee6188930c3ca05cb4ae73cbda/src/index.ts#L12).
|
|
105
|
+
* `loadIndex`, `loadTypeIndexes`, `ensureTypeIndexes`, `registerInTypeIndex` and are exported in [index.ts](https://github.com/solid/solid-logic/blob/f606b31382a416ee6188930c3ca05cb4ae73cbda/src/index.ts#L16).
|
|
106
|
+
|
|
107
|
+
## The databrowser hack: upgrading your browser
|
|
41
108
|
|
|
42
109
|
This refers to a specific way in which the mashlib is deployed for users who at first only have a conventional web browser - a hypertext browser not a data browser. It is a hack -- in the original computing sense of a crafty, though not beautiful, little thing which gets the job done.
|
|
43
110
|
|
|
@@ -51,27 +118,7 @@ How does the data browser work?
|
|
|
51
118
|
1. The server supplies the actual data of the to-do list or whatever it was.
|
|
52
119
|
1. The `mashlib.js` code provides an editable visualization on the data.
|
|
53
120
|
|
|
54
|
-
The mashlib
|
|
55
|
-
|
|
56
|
-
A major limitation of their data browser hack is that current web browsers are made to distrust any code loaded from one domain that uses data from another domain. This makes it hard, strangely complicated, and sometimes impossible to do some things.
|
|
57
|
-
|
|
58
|
-
## History: Why "Mashlib"?
|
|
59
|
-
|
|
60
|
-
What is a data mashup? [A mashup](https://en.wikipedia.org/wiki/Mashup_%28web_application_hybrid%29)
|
|
61
|
-
is a web page which is built out of data coming from more than one source.
|
|
62
|
-
|
|
63
|
-
Mashups are important because they are fun and because fundamentally, the value
|
|
64
|
-
of data is much greater when data of one source is combined with linked data from another, because that is where you can get extra insights.
|
|
65
|
-
[My TED talk on open data examples](https://www.ted.com/talks/tim_berners_lee_the_year_open_data_went_worldwide#t-81407)
|
|
66
|
-
has some examples.
|
|
67
|
-
Data mashups were all the rage back 2012-2017, although the browser's [Same Origin Policy](https://en.wikipedia.org/wiki/Same-origin_policy) in many cases makes them hard to do or impossible in a web app, as the data access is blocked by the browser code.
|
|
121
|
+
The mashlib part of SolidOS Databrowser Frontend is *read-write;* that is, the user is allowed to edit data and create new things. It is *live,* in that often the databrowser subscribed (using a websocket) for any changes which other users make, so users' screens are synchronized.
|
|
68
122
|
|
|
69
|
-
|
|
123
|
+
A major limitation of this data browser hack is that current web browsers are made to distrust any code loaded from one domain that uses data from another domain. This makes it hard, strangely complicated, and sometimes impossible to do some things.
|
|
70
124
|
|
|
71
|
-
Progressively, the mashlib evolved to allow types of data for personal information management (contacts, etc) and social (chat, shared documents, issue tracking, music, photos) and also as a file browser for a Solid-compatible personal data store (files, folders, and sharing). Now, the mashlib is a general-purpose tool for doing all kinds of useful things.
|
|
72
|
-
|
|
73
|
-
It is an extensible platform, and is never finished. Do help!
|
|
74
|
-
|
|
75
|
-
## Local development
|
|
76
|
-
|
|
77
|
-
As part of the SolidOS stack, mashlib can be developed locally by setting up the SolidOS code. Read more about that on the [SolidOS Readme](https://github.com/solid/solidos#-getting-started-with-the-solidos-code).
|
package/dist/databrowser.html
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
<!doctype html><html><head><meta charset="utf-8"/><title>SolidOS Web App</title><script>document.addEventListener('DOMContentLoaded', function() {
|
|
2
2
|
panes.runDataBrowser()
|
|
3
|
-
})</script><link href="/mash.css" rel="stylesheet"></head><body
|
|
3
|
+
})</script><link href="/mash.css" rel="stylesheet"></head><body id="PageBody"><header id="PageHeader"></header><div class="TabulatorOutline" id="DummyUUID" role="main"><table id="outline"></table><div id="GlobalDashboard"></div></div><footer id="PageFooter"></footer><script src="/mashlib.min.js"></script></body></html>
|