mashlib-jss 0.0.1

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/LICENSE.md ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2016 - present
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,153 @@
1
+ # Solid-compatible data mashup library and Databrowser
2
+
3
+ [![NPM Package](https://img.shields.io/npm/v/mashlib.svg)](https://www.npmjs.com/package/mashlib)
4
+
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/solidos/solid-logic) — core business logic of SolidOS
7
+ - [**pane-registry**](https://github.com/solidos/pane-registry) - an index to hold all loaded solid panes, whether statically or dynamically loaded
8
+ - [**solid-ui**](https://github.com/solidos/solid-ui) — User Interface widgets and utilities for Solid. Building blocks for solid-based apps
9
+ - [**solid-panes**](https://github.com/solidos/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/solidos/solidos/blob/main/documentation/solidos_dependencies.svg).
12
+
13
+ ## Content of README
14
+ ### Intro
15
+ - [Developing mashlib](#developing-mashlib)
16
+ - [Goals](#goals)
17
+ - [Typical uses](#typical-uses)
18
+
19
+ ### Documentation
20
+
21
+ - [Solid-compatible data mashup library and Databrowser](#solid-compatible-data-mashup-library-and-databrowser)
22
+ - [Content of README](#content-of-readme)
23
+ - [Intro](#intro)
24
+ - [Documentation](#documentation)
25
+ - [Developing mashlib](#developing-mashlib)
26
+ - [Goals](#goals)
27
+ - [Typical uses](#typical-uses)
28
+ - [Previous versions of this documentation](#previous-versions-of-this-documentation)
29
+ - [Documentation](#documentation-1)
30
+ - [Different implementations](#different-implementations)
31
+ - [SolidOS Databrowser Webapp](#solidos-databrowser-webapp)
32
+ - [SolidOS Databrowser Frontend](#solidos-databrowser-frontend)
33
+ - [SolidOS Data-Kitchen](#solidos-data-kitchen)
34
+ - [Mashlib global variables and functions](#mashlib-global-variables-and-functions)
35
+ - [Code changes due to moving authn from solid-ui to solid-logic](#code-changes-due-to-moving-authn-from-solid-ui-to-solid-logic)
36
+ - [Solid-ui & Solid-logic related:](#solid-ui--solid-logic-related)
37
+ - [The databrowser hack: upgrading your browser](#the-databrowser-hack-upgrading-your-browser)
38
+
39
+ ## Developing mashlib
40
+
41
+ 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/solidos/solidos#-getting-started-with-the-solidos-code).
42
+
43
+ ## Goals
44
+
45
+ The goals of mashlib overlap with the [SolidOS Goals](https://solidos.solidcommunity.net/Team/docs/SolidOSNorthStar.html).
46
+
47
+ ## Typical uses
48
+
49
+ One major use of mashlib is as a "databrowser" for a personal data store.
50
+
51
+ Mashlib is used in SolidOS and contributes to:
52
+
53
+ - SolidOS Databrowser Frontend - a frontend for Solid Servers like <solidcommunity.net>
54
+ - SolidOS Data-Kitchen - a stand-alone desktop app: <https://github.com/solidos/data-kitchen>
55
+
56
+ mashlib is also used stand-alone as the SolidOS Databrowser Webapp and can be tried out at <https://solidos.github.io/mashlib/dist/browse.html>.
57
+
58
+ mashlib is also used as a library by adding `mashlib.js` (or minified version) directly to your applications. For example:
59
+
60
+ `<script src="https://solidcommunity.net/mashlib.js"></script>`.
61
+
62
+ ## Previous versions of this documentation
63
+
64
+ Check out [SolidOS Pod](https://solidos.solidcommunity.net/Team/docs/solidos.html) for an earlier version of this documentation.
65
+
66
+ # Documentation
67
+
68
+ ## Different implementations
69
+
70
+ ### SolidOS Databrowser Webapp
71
+
72
+ 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.
73
+
74
+ You can see and try out a SolidOS Databrowser Webapp deployment at <https://solidos.github.io/mashlib/dist/browse.html>.
75
+
76
+ `browse.html`serves as a perfect example for Solid WebID authentication and for making use of mashlib functions and variables.
77
+
78
+ To run/test locally we created a script `npm run start`.
79
+
80
+ ### SolidOS Databrowser Frontend
81
+
82
+ 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.
83
+
84
+ More information about the SolidOS Front-end and how to use it visit the [User Guide](https://github.com/solidos/userguide).
85
+
86
+ ### SolidOS Data-Kitchen
87
+
88
+ 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/solidos/data-kitchen).
89
+
90
+ ## Mashlib global variables and functions
91
+
92
+ 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.
93
+
94
+ 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).
95
+
96
+ 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).
97
+
98
+ These are the most important window context/global variables and the sub-repos from which they are exported:
99
+
100
+ - [**solid-logic**](https://github.com/solidos/solid-logic/blob/f606b31382a416ee6188930c3ca05cb4ae73cbda/src/index.ts#L29) exports among others: `SolidLogic`
101
+ - [**pane-registry**](https://github.com/solidos/pane-registry) is exported entirely through the pane-registry variable
102
+ - [**solid-ui**](https://github.com/solidos/solid-ui/blob/c5a8888d6cb61363bc0445be007e3c96de593338/src/index.ts#L79) exports among others: authn, store, rdf, dom under the `UI` variable
103
+ - [**solid-panes**](https://github.com/solidos/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
104
+
105
+ For backward compatibility reasons, there are now different ways to make use of the same variables from mashlib. For example:
106
+
107
+ - to make use of the UI (solid-ui) one can use `UI` BUT NOT `panes.UI` anymore
108
+ - authentication session, part of solid-logic, can be called as `SolidLogic.authSession` BUT NOT `UI.authn.authSession` nor `panes.UI.authn.authSession` anymore
109
+ - the store (from solid-logic) can be used as `SolidLogic.store` BUT NOT `UI.store` nor `panes.UI.store` anymore
110
+ - rdflib NOT entirely acessible as `UI.rdf` or `panes.UI.rdf` anymore but as `$rdf`
111
+ - the currentUser function is called as `SolidLogic.authn.currentUser()` BUT NOT `UI.auth.currentUser()` nor `panes.UI.authn.currentUser()` anymore
112
+
113
+ You can see example usage in the [SolidOS Databrowser Webapp code](https://github.com/solidos/mashlib/blob/main/static/browse.html#L11).
114
+
115
+ ## Code changes due to moving authn from solid-ui to solid-logic
116
+
117
+ One function has been renamed and does not have a backwards-compatible fallback. To make use of the login pop-up, one needs to call the `UI.login.loginStatusBox` function. The old `UI.authn.loginStatusBox` function will no longer work from v1.8.0 onwards.
118
+
119
+ Some packages have been moved and with them some functions too. Here we report on these changes:
120
+
121
+ ### Solid-ui & Solid-logic related:
122
+
123
+ * 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).
124
+ * Some functions in solid-ui which initially were found under `solid-ui/authn` are now under `solid-ui/login`.
125
+ * Three functions were renamed:
126
+ * logInLoadPreferences -> ensureLoadedPreferences
127
+ * logInLoadProfile -> ensureLoadedProfile
128
+ * logIn -> ensureLoggedIn
129
+
130
+ Functions that moved:
131
+
132
+ * `currentUser`, `checkUser`, `saveUser`, `offlineTestID` are now part of `solid-logic/authn/SolidAuthnLogic.ts`-> this is because `authn` itself moved to solid-logic.
133
+ * `setACLUserPublic`, `fetchACLRel` are now part of `solid-logic/src/acl/aclLogic.ts/` and are exported in [index.ts](https://github.com/solidos/solid-logic/blob/f606b31382a416ee6188930c3ca05cb4ae73cbda/src/index.ts#L12).
134
+ * `loadIndex`, `loadTypeIndexes`, `ensureTypeIndexes`, `registerInTypeIndex` and are exported in [index.ts](https://github.com/solidos/solid-logic/blob/f606b31382a416ee6188930c3ca05cb4ae73cbda/src/index.ts#L16).
135
+
136
+ ## The databrowser hack: upgrading your browser
137
+
138
+ 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.
139
+
140
+ How does the data browser work?
141
+
142
+ 1. The user goes with a normal web browser to access some data object (like a to-do list).
143
+ 1. The server sees the browser doesn't understand the data natively.
144
+ 1. The server sends back a little placeholder HTML file, `databrowser.html`, instead of the data.
145
+ 1. The `databrowser.html` file loads the `mashlib.js` Javascript library, which can now understand the data.
146
+ 1. The `mashlib.js` then re-requests the original data, but accepting data formats.
147
+ 1. The server supplies the actual data of the to-do list or whatever it was.
148
+ 1. The `mashlib.js` code provides an editable visualization on the data.
149
+
150
+ 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.
151
+
152
+ 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.
153
+
@@ -0,0 +1,11 @@
1
+ (self["webpackChunkMashlib"] = self["webpackChunkMashlib"] || []).push([[789],{
2
+
3
+ /***/ 7789:
4
+ /***/ (() => {
5
+
6
+ /* (ignored) */
7
+
8
+ /***/ })
9
+
10
+ }]);
11
+ //# sourceMappingURL=789.mashlib.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"789.mashlib.js","mappings":";;;;;AAAA,e","sources":["webpack://Mashlib/ignored|/tmp/mashlib-jss/node_modules/rdf-canonize/lib|rdf-canonize-native"],"sourcesContent":["/* (ignored) */"],"names":[],"sourceRoot":""}
@@ -0,0 +1 @@
1
+ (self.webpackChunkMashlib=self.webpackChunkMashlib||[]).push([[789],{7789:()=>{}}]);