solid-panes 4.2.4-test.4 → 4.2.4-test.6
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/dist/dashboard/basicPreferences.js +146 -0
- package/dist/dashboard/dashboardPane.js +67 -0
- package/dist/dashboard/homepage.js +72 -0
- package/dist/home/homePane.js +72 -0
- package/dist/index.js +108 -0
- package/dist/internal/internalPane.js +183 -0
- package/dist/mainPage/footer.js +21 -0
- package/dist/mainPage/header.js +85 -0
- package/dist/mainPage/index.js +24 -0
- package/dist/outline/context.js +18 -0
- package/dist/outline/propertyViews.js +43 -0
- package/dist/outline/viewAsImage.js +14 -0
- package/dist/outline/viewAsMbox.js +21 -0
- package/dist/pad/padPane.js +410 -0
- package/dist/sharing/sharingPane.js +48 -0
- package/dist/solid-panes.js +84 -81
- package/dist/solid-panes.js.map +1 -1
- package/dist/solid-panes.min.js +1 -1
- package/dist/solid-panes.min.js.map +1 -1
- package/dist/tabbed/tabbedPane.js +57 -0
- package/dist/trustedApplications/trustedApplications.dom.js +145 -0
- package/dist/trustedApplications/trustedApplications.utils.js +23 -0
- package/dist/trustedApplications/trustedApplications.view.js +55 -0
- package/dist/versionInfo.js +41 -0
- package/package.json +5 -5
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _solidUi = require("solid-ui");
|
|
8
|
+
/* Tabbed view of anything
|
|
9
|
+
**
|
|
10
|
+
** data-driven
|
|
11
|
+
**
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
const TabbedPane = {
|
|
15
|
+
icon: _solidUi.icons.iconBase + 'noun_688606.svg',
|
|
16
|
+
name: 'tabbed',
|
|
17
|
+
audience: [_solidUi.ns.solid('PowerUser')],
|
|
18
|
+
// Does the subject deserve this pane?
|
|
19
|
+
label: (subject, context) => {
|
|
20
|
+
const kb = context.session.store;
|
|
21
|
+
const typeURIs = kb.findTypeURIs(subject);
|
|
22
|
+
if (_solidUi.ns.meeting('Cluster').uri in typeURIs) {
|
|
23
|
+
return 'Tabbed';
|
|
24
|
+
}
|
|
25
|
+
return null;
|
|
26
|
+
},
|
|
27
|
+
render: (subject, context) => {
|
|
28
|
+
const dom = context.dom;
|
|
29
|
+
const store = context.session.store;
|
|
30
|
+
const div = dom.createElement('div');
|
|
31
|
+
(async () => {
|
|
32
|
+
if (!store.fetcher) {
|
|
33
|
+
throw new Error('Store has no fetcher');
|
|
34
|
+
}
|
|
35
|
+
await store.fetcher.load(subject);
|
|
36
|
+
div.appendChild(_solidUi.tabs.tabWidget({
|
|
37
|
+
dom,
|
|
38
|
+
subject,
|
|
39
|
+
predicate: store.any(subject, _solidUi.ns.meeting('predicate')) || _solidUi.ns.meeting('toolList'),
|
|
40
|
+
ordered: true,
|
|
41
|
+
orientation: store.anyValue(subject, _solidUi.ns.meeting('orientation')) || '0',
|
|
42
|
+
renderMain: (containerDiv, item) => {
|
|
43
|
+
containerDiv.innerHTML = '';
|
|
44
|
+
const table = containerDiv.appendChild(context.dom.createElement('table'));
|
|
45
|
+
context.getOutliner(context.dom).GotoSubject(item, true, null, false, undefined, table);
|
|
46
|
+
},
|
|
47
|
+
renderTab: (containerDiv, item) => {
|
|
48
|
+
const predicate = store.the(subject, _solidUi.ns.meeting('predicate'));
|
|
49
|
+
containerDiv.appendChild(_solidUi.widgets.personTR(context.dom, predicate, item, {}));
|
|
50
|
+
},
|
|
51
|
+
backgroundColor: store.anyValue(subject, _solidUi.ns.ui('backgroundColor')) || '#ddddcc'
|
|
52
|
+
}));
|
|
53
|
+
})();
|
|
54
|
+
return div;
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
var _default = exports.default = TabbedPane;
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.createApplicationTable = createApplicationTable;
|
|
7
|
+
exports.createContainer = createContainer;
|
|
8
|
+
exports.createText = createText;
|
|
9
|
+
var _rdflib = require("rdflib");
|
|
10
|
+
var _solidUi = require("solid-ui");
|
|
11
|
+
var _solidLogic = require("solid-logic");
|
|
12
|
+
var _trustedApplications = require("./trustedApplications.utils");
|
|
13
|
+
function createApplicationTable(subject) {
|
|
14
|
+
const applicationsTable = createElement('table', {
|
|
15
|
+
class: 'results'
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
// creating headers
|
|
19
|
+
const header = createContainer('tr', [createText('th', 'Application URL'), createText('th', 'Access modes'), createText('th', 'Actions')]);
|
|
20
|
+
applicationsTable.appendChild(header);
|
|
21
|
+
|
|
22
|
+
// creating rows
|
|
23
|
+
_solidLogic.store.each(subject, _solidUi.ns.acl('trustedApp'), undefined, undefined).flatMap(app => _solidLogic.store.each(app, _solidUi.ns.acl('origin'), undefined, undefined).map(origin => ({
|
|
24
|
+
appModes: _solidLogic.store.each(app, _solidUi.ns.acl('mode'), undefined, undefined),
|
|
25
|
+
origin: origin
|
|
26
|
+
}))).sort((a, b) => a.origin.value < b.origin.value ? -1 : 1).forEach(({
|
|
27
|
+
appModes,
|
|
28
|
+
origin
|
|
29
|
+
}) => applicationsTable.appendChild(createApplicationEntry(subject, origin, appModes, updateTable)));
|
|
30
|
+
|
|
31
|
+
// adding a row for new applications
|
|
32
|
+
applicationsTable.appendChild(createApplicationEntry(subject, null, [_solidUi.ns.acl('Read')], updateTable));
|
|
33
|
+
return applicationsTable;
|
|
34
|
+
function updateTable() {
|
|
35
|
+
applicationsTable.parentElement.replaceChild(createApplicationTable(subject), applicationsTable);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
function createApplicationEntry(subject, origin, appModes, updateTable) {
|
|
39
|
+
const trustedApplicationState = {
|
|
40
|
+
origin,
|
|
41
|
+
appModes,
|
|
42
|
+
formElements: {
|
|
43
|
+
modes: [],
|
|
44
|
+
origin: undefined
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
return createContainer('tr', [createContainer('td', [createContainer('form', [createElement('input', {
|
|
48
|
+
class: 'textinput',
|
|
49
|
+
placeholder: 'Write new URL here',
|
|
50
|
+
value: origin ? origin.value : ''
|
|
51
|
+
}, {}, element => {
|
|
52
|
+
trustedApplicationState.formElements.origin = element;
|
|
53
|
+
})], {}, {
|
|
54
|
+
submit: addOrEditApplication
|
|
55
|
+
})]), createContainer('td', [createContainer('form', createModesInput(trustedApplicationState), {}, {
|
|
56
|
+
submit: addOrEditApplication
|
|
57
|
+
})]), createContainer('td', [createContainer('form', origin ? [createText('button', 'Update', {
|
|
58
|
+
class: 'controlButton',
|
|
59
|
+
style: 'background: LightGreen;'
|
|
60
|
+
}), createText('button', 'Delete', {
|
|
61
|
+
class: 'controlButton',
|
|
62
|
+
style: 'background: LightCoral;'
|
|
63
|
+
}, {
|
|
64
|
+
click: removeApplication
|
|
65
|
+
})] : [createText('button', 'Add', {
|
|
66
|
+
class: 'controlButton',
|
|
67
|
+
style: 'background: LightGreen;'
|
|
68
|
+
})], {}, {
|
|
69
|
+
submit: addOrEditApplication
|
|
70
|
+
})])]);
|
|
71
|
+
function addOrEditApplication(event) {
|
|
72
|
+
event.preventDefault();
|
|
73
|
+
let origin;
|
|
74
|
+
try {
|
|
75
|
+
origin = (0, _rdflib.sym)(trustedApplicationState.formElements.origin.value);
|
|
76
|
+
} catch (err) {
|
|
77
|
+
return alert('Please provide an application URL you want to trust');
|
|
78
|
+
}
|
|
79
|
+
const modes = trustedApplicationState.formElements.modes.filter(checkbox => checkbox.checked).map(checkbox => checkbox.value);
|
|
80
|
+
const deletions = (0, _trustedApplications.getStatementsToDelete)(trustedApplicationState.origin || origin, subject, _solidLogic.store, _solidUi.ns);
|
|
81
|
+
const additions = (0, _trustedApplications.getStatementsToAdd)(origin, (0, _trustedApplications.generateRandomString)(), modes, subject, _solidUi.ns);
|
|
82
|
+
if (!_solidLogic.store.updater) {
|
|
83
|
+
throw new Error('Store has no updater');
|
|
84
|
+
}
|
|
85
|
+
_solidLogic.store.updater.update(deletions, additions, handleUpdateResponse);
|
|
86
|
+
}
|
|
87
|
+
function removeApplication(event) {
|
|
88
|
+
event.preventDefault();
|
|
89
|
+
let origin;
|
|
90
|
+
try {
|
|
91
|
+
origin = (0, _rdflib.sym)(trustedApplicationState.formElements.origin.value);
|
|
92
|
+
} catch (err) {
|
|
93
|
+
return alert('Please provide an application URL you want to remove trust from');
|
|
94
|
+
}
|
|
95
|
+
const deletions = (0, _trustedApplications.getStatementsToDelete)(origin, subject, _solidLogic.store, _solidUi.ns);
|
|
96
|
+
if (!_solidLogic.store.updater) {
|
|
97
|
+
throw new Error('Store has no updater');
|
|
98
|
+
}
|
|
99
|
+
_solidLogic.store.updater.update(deletions, [], handleUpdateResponse);
|
|
100
|
+
}
|
|
101
|
+
function handleUpdateResponse(uri, success, errorBody) {
|
|
102
|
+
if (success) {
|
|
103
|
+
return updateTable();
|
|
104
|
+
}
|
|
105
|
+
// console.error(uri, errorBody)
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
function createElement(elementName, attributes = {}, eventListeners = {}, onCreated = null) {
|
|
109
|
+
const element = document.createElement(elementName);
|
|
110
|
+
if (onCreated) {
|
|
111
|
+
onCreated(element);
|
|
112
|
+
}
|
|
113
|
+
Object.keys(attributes).forEach(attName => {
|
|
114
|
+
element.setAttribute(attName, attributes[attName]);
|
|
115
|
+
});
|
|
116
|
+
Object.keys(eventListeners).forEach(eventName => {
|
|
117
|
+
element.addEventListener(eventName, eventListeners[eventName]);
|
|
118
|
+
});
|
|
119
|
+
return element;
|
|
120
|
+
}
|
|
121
|
+
function createContainer(elementName, children, attributes = {}, eventListeners = {}, onCreated = null) {
|
|
122
|
+
const element = createElement(elementName, attributes, eventListeners, onCreated);
|
|
123
|
+
children.forEach(child => element.appendChild(child));
|
|
124
|
+
return element;
|
|
125
|
+
}
|
|
126
|
+
function createText(elementName, textContent, attributes = {}, eventListeners = {}, onCreated = null) {
|
|
127
|
+
const element = createElement(elementName, attributes, eventListeners, onCreated);
|
|
128
|
+
element.textContent = textContent;
|
|
129
|
+
return element;
|
|
130
|
+
}
|
|
131
|
+
function createModesInput({
|
|
132
|
+
appModes,
|
|
133
|
+
formElements
|
|
134
|
+
}) {
|
|
135
|
+
return ['Read', 'Write', 'Append', 'Control'].map(mode => {
|
|
136
|
+
const isChecked = appModes.some(appMode => appMode.value === _solidUi.ns.acl(mode).value);
|
|
137
|
+
return createContainer('label', [createElement('input', {
|
|
138
|
+
type: 'checkbox',
|
|
139
|
+
...(isChecked ? {
|
|
140
|
+
checked: ''
|
|
141
|
+
} : {}),
|
|
142
|
+
value: _solidUi.ns.acl(mode).uri
|
|
143
|
+
}, {}, element => formElements.modes.push(element)), createText('span', mode)]);
|
|
144
|
+
});
|
|
145
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.generateRandomString = generateRandomString;
|
|
7
|
+
exports.getStatementsToAdd = getStatementsToAdd;
|
|
8
|
+
exports.getStatementsToDelete = getStatementsToDelete;
|
|
9
|
+
var _rdflib = require("rdflib");
|
|
10
|
+
function getStatementsToDelete(origin, person, kb, ns) {
|
|
11
|
+
const applicationStatements = kb.statementsMatching(null, ns.acl('origin'), origin);
|
|
12
|
+
const statementsToDelete = applicationStatements.reduce((memo, st) => {
|
|
13
|
+
return memo.concat(kb.statementsMatching(person, ns.acl('trustedApp'), st.subject)).concat(kb.statementsMatching(st.subject));
|
|
14
|
+
}, []);
|
|
15
|
+
return statementsToDelete;
|
|
16
|
+
}
|
|
17
|
+
function getStatementsToAdd(origin, nodeName, modes, person, ns) {
|
|
18
|
+
const application = new _rdflib.BlankNode(`bn_${nodeName}`); // NamedNode(`${person.doc().uri}#${nodeName}`)
|
|
19
|
+
return [(0, _rdflib.st)(person, ns.acl('trustedApp'), application, person.doc()), (0, _rdflib.st)(application, ns.acl('origin'), origin, person.doc()), ...modes.map(mode => (0, _rdflib.sym)(mode)).map(mode => (0, _rdflib.st)(application, ns.acl('mode'), mode, person.doc()))];
|
|
20
|
+
}
|
|
21
|
+
function generateRandomString() {
|
|
22
|
+
return Math.random().toString(36).substr(2, 5);
|
|
23
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _solidUi = require("solid-ui");
|
|
8
|
+
var _solidLogic = require("solid-logic");
|
|
9
|
+
var _trustedApplications = require("./trustedApplications.dom");
|
|
10
|
+
const thisColor = '#418d99';
|
|
11
|
+
const trustedApplicationView = {
|
|
12
|
+
global: true,
|
|
13
|
+
icon: `${_solidUi.icons.iconBase}noun_15177.svg`,
|
|
14
|
+
name: 'trustedApplications',
|
|
15
|
+
label: () => null,
|
|
16
|
+
render: (subject, context) => {
|
|
17
|
+
const dom = context.dom;
|
|
18
|
+
const div = dom.createElement('div');
|
|
19
|
+
div.classList.add('trusted-applications-pane');
|
|
20
|
+
div.setAttribute('style', 'border: 0.3em solid ' + thisColor + '; border-radius: 0.5em; padding: 0.7em; margin-top:0.7em;');
|
|
21
|
+
const table = div.appendChild(dom.createElement('table'));
|
|
22
|
+
const main = table.appendChild(dom.createElement('tr'));
|
|
23
|
+
const bottom = table.appendChild(dom.createElement('tr'));
|
|
24
|
+
const statusArea = bottom.appendChild(dom.createElement('div'));
|
|
25
|
+
statusArea.setAttribute('style', 'padding: 0.7em;');
|
|
26
|
+
render(dom, main, statusArea).catch(err => statusArea.appendChild(_solidUi.widgets.errorMessageBlock(dom, err)));
|
|
27
|
+
return div;
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
async function render(dom, main, statusArea) {
|
|
31
|
+
const authContext = await _solidUi.login.ensureLoadedProfile({
|
|
32
|
+
dom,
|
|
33
|
+
div: main,
|
|
34
|
+
statusArea,
|
|
35
|
+
me: null
|
|
36
|
+
});
|
|
37
|
+
const subject = authContext.me;
|
|
38
|
+
const profile = subject.doc();
|
|
39
|
+
if (!_solidLogic.store.updater) {
|
|
40
|
+
throw new Error('Store has no updater');
|
|
41
|
+
}
|
|
42
|
+
const editable = _solidLogic.store.updater.editable(profile.uri, _solidLogic.store);
|
|
43
|
+
main.appendChild((0, _trustedApplications.createText)('h3', 'Manage your trusted applications'));
|
|
44
|
+
if (!editable) {
|
|
45
|
+
main.appendChild(_solidUi.widgets.errorMessageBlock(dom, `Your profile ${subject.doc().uri} is not editable, so we cannot do much here.`));
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
main.appendChild((0, _trustedApplications.createText)('p', 'Here you can manage the applications you trust.'));
|
|
49
|
+
const applicationsTable = (0, _trustedApplications.createApplicationTable)(subject);
|
|
50
|
+
main.appendChild(applicationsTable);
|
|
51
|
+
main.appendChild((0, _trustedApplications.createText)('h4', 'Notes'));
|
|
52
|
+
main.appendChild((0, _trustedApplications.createContainer)('ol', [main.appendChild((0, _trustedApplications.createText)('li', 'Trusted applications will get access to all resources that you have access to.')), main.appendChild((0, _trustedApplications.createText)('li', 'You can limit which modes they have by default.')), main.appendChild((0, _trustedApplications.createText)('li', 'They will not gain more access than you have.'))]));
|
|
53
|
+
main.appendChild((0, _trustedApplications.createText)('p', 'Application URLs must be valid URL. Examples are http://localhost:3000, https://trusted.app, and https://sub.trusted.app.'));
|
|
54
|
+
}
|
|
55
|
+
var _default = exports.default = trustedApplicationView;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _default = exports.default = {
|
|
8
|
+
buildTime: '2026-03-13T13:33:44Z',
|
|
9
|
+
commit: '2d694e9f4e7df87987d422de48258935ec12ab13',
|
|
10
|
+
npmInfo: {
|
|
11
|
+
'solid-panes': '4.2.3',
|
|
12
|
+
npm: '11.11.1',
|
|
13
|
+
node: '22.22.0',
|
|
14
|
+
acorn: '8.15.0',
|
|
15
|
+
ada: '2.9.2',
|
|
16
|
+
amaro: '1.1.4',
|
|
17
|
+
ares: '1.34.6',
|
|
18
|
+
brotli: '1.1.0',
|
|
19
|
+
cjs_module_lexer: '2.1.0',
|
|
20
|
+
cldr: '47.0',
|
|
21
|
+
icu: '77.1',
|
|
22
|
+
llhttp: '9.3.0',
|
|
23
|
+
modules: '127',
|
|
24
|
+
napi: '10',
|
|
25
|
+
nbytes: '0.1.1',
|
|
26
|
+
ncrypto: '0.0.1',
|
|
27
|
+
nghttp2: '1.64.0',
|
|
28
|
+
openssl: '3.5.4',
|
|
29
|
+
simdjson: '3.13.0',
|
|
30
|
+
simdutf: '6.4.2',
|
|
31
|
+
sqlite: '3.50.4',
|
|
32
|
+
tz: '2025b',
|
|
33
|
+
undici: '6.23.0',
|
|
34
|
+
unicode: '16.0',
|
|
35
|
+
uv: '1.51.0',
|
|
36
|
+
uvwasi: '0.0.23',
|
|
37
|
+
v8: '12.4.254.21-node.33',
|
|
38
|
+
zlib: '1.3.1-470d3a2',
|
|
39
|
+
zstd: '1.5.7'
|
|
40
|
+
}
|
|
41
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "solid-panes",
|
|
3
|
-
"version": "4.2.4-test.
|
|
3
|
+
"version": "4.2.4-test.6",
|
|
4
4
|
"description": "Solid-compatible Panes: applets and views for the mashlib and databrowser",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"build": "npm run clean && npm run build-version && npm run typecheck && npm run build-dist && npm run build-js && npm run postbuild-js",
|
|
18
18
|
"build-version": "bash timestamp.sh > src/versionInfo.ts && ./node_modules/.bin/eslint 'src/versionInfo.ts' --fix",
|
|
19
19
|
"build-dist": "webpack --progress",
|
|
20
|
-
"build-js": "babel src --out-dir dist --extensions '.js
|
|
20
|
+
"build-js": "babel src --out-dir dist --extensions '.ts,.js' && tsc --emitDeclarationOnly",
|
|
21
21
|
"postbuild-js": "rm -f dist/versionInfo.d.ts dist/versionInfo.d.ts.map",
|
|
22
22
|
"lint": "eslint",
|
|
23
23
|
"lint-fix": "eslint --fix",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"@solid/better-simple-slideshow": "^0.1.0",
|
|
61
61
|
"activitystreams-pane": "^1.0.1",
|
|
62
62
|
"chat-pane": "^3.0.2",
|
|
63
|
-
"contacts-pane": "^3.1.0-test.
|
|
63
|
+
"contacts-pane": "^3.1.0-test.7",
|
|
64
64
|
"dompurify": "^3.3.1",
|
|
65
65
|
"folder-pane": "^3.0.1",
|
|
66
66
|
"issue-pane": "^3.0.1",
|
|
@@ -68,9 +68,9 @@
|
|
|
68
68
|
"meeting-pane": "^3.0.1",
|
|
69
69
|
"mime-types": "^3.0.2",
|
|
70
70
|
"pane-registry": "^3.0.1",
|
|
71
|
-
"profile-pane": "^3.1.3-test.
|
|
71
|
+
"profile-pane": "^3.1.3-test.7",
|
|
72
72
|
"solid-namespace": "^0.5.4",
|
|
73
|
-
"solid-ui": "^3.0.5-test.
|
|
73
|
+
"solid-ui": "^3.0.5-test.7",
|
|
74
74
|
"source-pane": "^3.0.1"
|
|
75
75
|
},
|
|
76
76
|
"overrides": {
|