solid-ui 2.4.23 → 2.4.24
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/main.js +2159 -5039
- package/dist/main.js.map +1 -1
- package/lib/acl/access-controller.js +4 -67
- package/lib/acl/access-controller.js.map +1 -1
- package/lib/acl/access-groups.js +59 -137
- package/lib/acl/access-groups.js.map +1 -1
- package/lib/acl/acl-control.js +14 -54
- package/lib/acl/acl-control.js.map +1 -1
- package/lib/acl/acl.js +32 -107
- package/lib/acl/acl.js.map +1 -1
- package/lib/acl/add-agent-buttons.js +0 -92
- package/lib/acl/add-agent-buttons.js.map +1 -1
- package/lib/acl/index.js +1 -3
- package/lib/acl/index.js.map +1 -1
- package/lib/acl/styles.js +1 -2
- package/lib/acl/styles.js.map +1 -1
- package/lib/chat/bookmarks.js +8 -80
- package/lib/chat/bookmarks.js.map +1 -1
- package/lib/chat/chatLogic.js +109 -180
- package/lib/chat/chatLogic.js.map +1 -1
- package/lib/chat/dateFolder.js +6 -91
- package/lib/chat/dateFolder.js.map +1 -1
- package/lib/chat/infinite.js +33 -185
- package/lib/chat/infinite.js.map +1 -1
- package/lib/chat/message.js +37 -150
- package/lib/chat/message.js.map +1 -1
- package/lib/chat/messageTools.js +23 -96
- package/lib/chat/messageTools.js.map +1 -1
- package/lib/chat/thread.js +33 -91
- package/lib/chat/thread.js.map +1 -1
- package/lib/create/create.js +19 -51
- package/lib/create/create.js.map +1 -1
- package/lib/create/index.js +0 -2
- package/lib/create/index.js.map +1 -1
- package/lib/debug.js +0 -8
- package/lib/debug.js.map +1 -1
- package/lib/folders.js +4 -27
- package/lib/folders.js.map +1 -1
- package/lib/footer/index.js +2 -24
- package/lib/footer/index.js.map +1 -1
- package/lib/footer/styleMap.js.map +1 -1
- package/lib/header/empty-profile.js.map +1 -1
- package/lib/header/index.js +3 -72
- package/lib/header/index.js.map +1 -1
- package/lib/header/styleMap.js +4 -3
- package/lib/header/styleMap.js.map +1 -1
- package/lib/iconBase.js +3 -4
- package/lib/iconBase.js.map +1 -1
- package/lib/index.js +5 -46
- package/lib/index.js.map +1 -1
- package/lib/jss/index.js +3 -9
- package/lib/jss/index.js.map +1 -1
- package/lib/log.js +15 -51
- package/lib/log.js.map +1 -1
- package/lib/login/login.js +74 -303
- package/lib/login/login.js.map +1 -1
- package/lib/matrix/index.js +0 -2
- package/lib/matrix/index.js.map +1 -1
- package/lib/matrix/matrix.js +7 -55
- package/lib/matrix/matrix.js.map +1 -1
- package/lib/media/index.js +0 -2
- package/lib/media/index.js.map +1 -1
- package/lib/media/media-capture.js +13 -33
- package/lib/media/media-capture.js.map +1 -1
- package/lib/messageArea.js +23 -64
- package/lib/messageArea.js.map +1 -1
- package/lib/noun_Camera_1618446_000000.js.map +1 -1
- package/lib/ns.js +5 -7
- package/lib/ns.js.map +1 -1
- package/lib/pad.js +48 -234
- package/lib/pad.js.map +1 -1
- package/lib/participation.js +10 -65
- package/lib/participation.js.map +1 -1
- package/lib/preferences.js +21 -42
- package/lib/preferences.js.map +1 -1
- package/lib/signup/config-default.js +1 -8
- package/lib/signup/config-default.js.map +1 -1
- package/lib/signup/signup.js +6 -13
- package/lib/signup/signup.js.map +1 -1
- package/lib/stories/decorators.js +0 -2
- package/lib/stories/decorators.js.map +1 -1
- package/lib/style.js +8 -5
- package/lib/style.js.map +1 -1
- package/lib/style_multiSelect.js +1 -5
- package/lib/style_multiSelect.js.map +1 -1
- package/lib/table.js +309 -322
- package/lib/table.js.map +1 -1
- package/lib/tabs.js +20 -100
- package/lib/tabs.js.map +1 -1
- package/lib/utils/headerFooterHelpers.js +4 -52
- package/lib/utils/headerFooterHelpers.js.map +1 -1
- package/lib/utils/index.js +41 -135
- package/lib/utils/index.js.map +1 -1
- package/lib/utils/label.js +13 -34
- package/lib/utils/label.js.map +1 -1
- package/lib/versionInfo.js +4 -4
- package/lib/versionInfo.js.map +1 -1
- package/lib/widgets/buttons/iconLinks.js +0 -8
- package/lib/widgets/buttons/iconLinks.js.map +1 -1
- package/lib/widgets/buttons.js +115 -291
- package/lib/widgets/buttons.js.map +1 -1
- package/lib/widgets/dragAndDrop.js +12 -41
- package/lib/widgets/dragAndDrop.js.map +1 -1
- package/lib/widgets/error.js +3 -9
- package/lib/widgets/error.js.map +1 -1
- package/lib/widgets/forms/autocomplete/autocompleteBar.js +8 -71
- package/lib/widgets/forms/autocomplete/autocompleteBar.js.map +1 -1
- package/lib/widgets/forms/autocomplete/autocompleteField.js +13 -65
- package/lib/widgets/forms/autocomplete/autocompleteField.js.map +1 -1
- package/lib/widgets/forms/autocomplete/autocompletePicker.js +15 -107
- package/lib/widgets/forms/autocomplete/autocompletePicker.js.map +1 -1
- package/lib/widgets/forms/autocomplete/language.js +6 -55
- package/lib/widgets/forms/autocomplete/language.js.map +1 -1
- package/lib/widgets/forms/autocomplete/publicData.js +12 -131
- package/lib/widgets/forms/autocomplete/publicData.js.map +1 -1
- package/lib/widgets/forms/basic.js +12 -55
- package/lib/widgets/forms/basic.js.map +1 -1
- package/lib/widgets/forms/comment.js +1 -15
- package/lib/widgets/forms/comment.js.map +1 -1
- package/lib/widgets/forms/fieldFunction.js +3 -16
- package/lib/widgets/forms/fieldFunction.js.map +1 -1
- package/lib/widgets/forms/fieldParams.js +0 -12
- package/lib/widgets/forms/fieldParams.js.map +1 -1
- package/lib/widgets/forms/formStyle.js +1 -14
- package/lib/widgets/forms/formStyle.js.map +1 -1
- package/lib/widgets/forms.js +70 -474
- package/lib/widgets/forms.js.map +1 -1
- package/lib/widgets/index.js +0 -21
- package/lib/widgets/index.js.map +1 -1
- package/lib/widgets/multiSelect.js +48 -171
- package/lib/widgets/multiSelect.js.map +1 -1
- package/lib/widgets/peoplePicker.js +20 -90
- package/lib/widgets/peoplePicker.js.map +1 -1
- package/lib/widgets/widgetHelpers.js +2 -9
- package/lib/widgets/widgetHelpers.js.map +1 -1
- package/package.json +28 -28
package/lib/acl/access-groups.js
CHANGED
|
@@ -1,47 +1,31 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
-
|
|
7
5
|
Object.defineProperty(exports, "__esModule", {
|
|
8
6
|
value: true
|
|
9
7
|
});
|
|
10
8
|
exports.AccessGroups = void 0;
|
|
11
|
-
|
|
12
9
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
13
|
-
|
|
14
10
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
15
|
-
|
|
16
11
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
17
|
-
|
|
18
12
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
19
|
-
|
|
20
13
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
21
|
-
|
|
22
14
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
23
|
-
|
|
24
15
|
var _rdflib = require("rdflib");
|
|
25
|
-
|
|
26
16
|
var _acl = require("./acl");
|
|
27
|
-
|
|
28
17
|
var widgets = _interopRequireWildcard(require("../widgets"));
|
|
29
|
-
|
|
30
18
|
var ns = _interopRequireWildcard(require("../ns"));
|
|
31
|
-
|
|
32
19
|
var _addAgentButtons = require("./add-agent-buttons");
|
|
33
|
-
|
|
34
20
|
var debug = _interopRequireWildcard(require("../debug"));
|
|
35
|
-
|
|
36
21
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
37
|
-
|
|
38
22
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
39
|
-
|
|
40
23
|
/**
|
|
41
24
|
* Contains the [[AccessGroups]]
|
|
42
25
|
* and [[AccessGroupsOptions]] classes
|
|
43
26
|
* @packageDocumentation
|
|
44
27
|
*/
|
|
28
|
+
|
|
45
29
|
var ACL = ns.acl;
|
|
46
30
|
var COLLOQUIAL = {
|
|
47
31
|
13: 'Owners',
|
|
@@ -66,16 +50,17 @@ var EXPLANATION = {
|
|
|
66
50
|
2: 'can add new information but not read any',
|
|
67
51
|
1: 'can read but not change information'
|
|
68
52
|
};
|
|
53
|
+
|
|
69
54
|
/**
|
|
70
55
|
* Type for the options parameter of [[AccessGroups]]
|
|
71
56
|
*/
|
|
72
|
-
|
|
73
57
|
/**
|
|
74
58
|
* Renders the table of Owners, Editors, Posters, Submitters, Viewers
|
|
75
59
|
* for https://github.com/solidos/userguide/blob/main/views/sharing/userguide.md
|
|
76
60
|
*/
|
|
77
61
|
var AccessGroups = /*#__PURE__*/function () {
|
|
78
62
|
// @@ was LiveStore but does not need to be connected to web
|
|
63
|
+
|
|
79
64
|
function AccessGroups(doc, aclDoc, controller, store) {
|
|
80
65
|
var options = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {};
|
|
81
66
|
(0, _classCallCheck2["default"])(this, AccessGroups);
|
|
@@ -97,7 +82,6 @@ var AccessGroups = /*#__PURE__*/function () {
|
|
|
97
82
|
this.rootElement = this.controller.dom.createElement('div');
|
|
98
83
|
this.rootElement.classList.add(this.controller.classes.accessGroupList);
|
|
99
84
|
}
|
|
100
|
-
|
|
101
85
|
(0, _createClass2["default"])(AccessGroups, [{
|
|
102
86
|
key: "store",
|
|
103
87
|
get: function get() {
|
|
@@ -112,38 +96,31 @@ var AccessGroups = /*#__PURE__*/function () {
|
|
|
112
96
|
key: "render",
|
|
113
97
|
value: function render() {
|
|
114
98
|
var _this = this;
|
|
115
|
-
|
|
116
99
|
this.rootElement.innerHTML = '';
|
|
117
100
|
this.renderGroups().forEach(function (group) {
|
|
118
101
|
return _this.rootElement.appendChild(group);
|
|
119
102
|
});
|
|
120
|
-
|
|
121
103
|
if (this.controller.isEditable) {
|
|
122
104
|
this.rootElement.appendChild(this.addAgentButton.render());
|
|
123
105
|
}
|
|
124
|
-
|
|
125
106
|
return this.rootElement;
|
|
126
107
|
}
|
|
127
108
|
}, {
|
|
128
109
|
key: "renderGroups",
|
|
129
110
|
value: function renderGroups() {
|
|
130
111
|
var groupElements = [];
|
|
131
|
-
|
|
132
112
|
for (var comboIndex = 15; comboIndex > 0; comboIndex--) {
|
|
133
113
|
var combo = kToCombo(comboIndex);
|
|
134
|
-
|
|
135
114
|
if (this.controller.isEditable && RECOMMENDED[comboIndex] || this.byCombo[combo]) {
|
|
136
115
|
groupElements.push(this.renderGroup(comboIndex, combo));
|
|
137
116
|
}
|
|
138
117
|
}
|
|
139
|
-
|
|
140
118
|
return groupElements;
|
|
141
119
|
}
|
|
142
120
|
}, {
|
|
143
121
|
key: "renderGroup",
|
|
144
122
|
value: function renderGroup(comboIndex, combo) {
|
|
145
123
|
var _this2 = this;
|
|
146
|
-
|
|
147
124
|
var groupRow = this.controller.dom.createElement('div');
|
|
148
125
|
groupRow.classList.add(this.controller.classes.accessGroupListItem);
|
|
149
126
|
widgets.makeDropTarget(groupRow, function (uris) {
|
|
@@ -163,7 +140,6 @@ var AccessGroups = /*#__PURE__*/function () {
|
|
|
163
140
|
key: "renderGroupElements",
|
|
164
141
|
value: function renderGroupElements(comboIndex, combo) {
|
|
165
142
|
var _this3 = this;
|
|
166
|
-
|
|
167
143
|
var groupNameColumn = this.controller.dom.createElement('div');
|
|
168
144
|
groupNameColumn.classList.add(this.controller.classes.group);
|
|
169
145
|
groupNameColumn.classList.toggle(this.controller.classes["group-".concat(comboIndex)], this.controller.isEditable);
|
|
@@ -175,9 +151,8 @@ var AccessGroups = /*#__PURE__*/function () {
|
|
|
175
151
|
var combos = this.byCombo[combo] || [];
|
|
176
152
|
combos.map(function (_ref) {
|
|
177
153
|
var _ref2 = (0, _slicedToArray2["default"])(_ref, 2),
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
154
|
+
pred = _ref2[0],
|
|
155
|
+
obj = _ref2[1];
|
|
181
156
|
return _this3.renderAgent(groupAgentsTable, combo, pred, obj);
|
|
182
157
|
}).forEach(function (agentElement) {
|
|
183
158
|
return groupAgentsTable.appendChild(agentElement);
|
|
@@ -192,7 +167,6 @@ var AccessGroups = /*#__PURE__*/function () {
|
|
|
192
167
|
key: "renderAgent",
|
|
193
168
|
value: function renderAgent(groupAgentsTable, combo, pred, obj) {
|
|
194
169
|
var _this4 = this;
|
|
195
|
-
|
|
196
170
|
var personRow = widgets.personTR(this.controller.dom, ACL(pred), (0, _rdflib.sym)(obj), this.controller.isEditable ? {
|
|
197
171
|
deleteFunction: function deleteFunction() {
|
|
198
172
|
return _this4.deleteAgent(combo, pred, obj).then(function () {
|
|
@@ -216,19 +190,15 @@ var AccessGroups = /*#__PURE__*/function () {
|
|
|
216
190
|
combos = this.byCombo[combo] || [];
|
|
217
191
|
comboToRemove = combos.find(function (_ref3) {
|
|
218
192
|
var _ref4 = (0, _slicedToArray2["default"])(_ref3, 2),
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
193
|
+
comboPred = _ref4[0],
|
|
194
|
+
comboObj = _ref4[1];
|
|
222
195
|
return comboPred === pred && comboObj === obj;
|
|
223
196
|
});
|
|
224
|
-
|
|
225
197
|
if (comboToRemove) {
|
|
226
198
|
combos.splice(combos.indexOf(comboToRemove), 1);
|
|
227
199
|
}
|
|
228
|
-
|
|
229
200
|
_context.next = 5;
|
|
230
201
|
return this.controller.save();
|
|
231
|
-
|
|
232
202
|
case 5:
|
|
233
203
|
case "end":
|
|
234
204
|
return _context.stop();
|
|
@@ -236,11 +206,9 @@ var AccessGroups = /*#__PURE__*/function () {
|
|
|
236
206
|
}
|
|
237
207
|
}, _callee, this);
|
|
238
208
|
}));
|
|
239
|
-
|
|
240
209
|
function deleteAgent(_x, _x2, _x3) {
|
|
241
210
|
return _deleteAgent.apply(this, arguments);
|
|
242
211
|
}
|
|
243
|
-
|
|
244
212
|
return deleteAgent;
|
|
245
213
|
}()
|
|
246
214
|
}, {
|
|
@@ -253,11 +221,9 @@ var AccessGroups = /*#__PURE__*/function () {
|
|
|
253
221
|
case 0:
|
|
254
222
|
_context2.next = 2;
|
|
255
223
|
return this.handleDroppedUri(uri, kToCombo(1));
|
|
256
|
-
|
|
257
224
|
case 2:
|
|
258
225
|
_context2.next = 4;
|
|
259
226
|
return this.controller.save();
|
|
260
|
-
|
|
261
227
|
case 4:
|
|
262
228
|
case "end":
|
|
263
229
|
return _context2.stop();
|
|
@@ -265,11 +231,9 @@ var AccessGroups = /*#__PURE__*/function () {
|
|
|
265
231
|
}
|
|
266
232
|
}, _callee2, this);
|
|
267
233
|
}));
|
|
268
|
-
|
|
269
234
|
function addNewURI(_x4) {
|
|
270
235
|
return _addNewURI.apply(this, arguments);
|
|
271
236
|
}
|
|
272
|
-
|
|
273
237
|
return addNewURI;
|
|
274
238
|
}()
|
|
275
239
|
}, {
|
|
@@ -277,7 +241,6 @@ var AccessGroups = /*#__PURE__*/function () {
|
|
|
277
241
|
value: function () {
|
|
278
242
|
var _handleDroppedUris = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(uris, combo) {
|
|
279
243
|
var _this5 = this;
|
|
280
|
-
|
|
281
244
|
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
|
282
245
|
while (1) {
|
|
283
246
|
switch (_context3.prev = _context3.next) {
|
|
@@ -287,20 +250,16 @@ var AccessGroups = /*#__PURE__*/function () {
|
|
|
287
250
|
return Promise.all(uris.map(function (uri) {
|
|
288
251
|
return _this5.handleDroppedUri(uri, combo);
|
|
289
252
|
}));
|
|
290
|
-
|
|
291
253
|
case 3:
|
|
292
254
|
_context3.next = 5;
|
|
293
255
|
return this.controller.save();
|
|
294
|
-
|
|
295
256
|
case 5:
|
|
296
257
|
_context3.next = 10;
|
|
297
258
|
break;
|
|
298
|
-
|
|
299
259
|
case 7:
|
|
300
260
|
_context3.prev = 7;
|
|
301
261
|
_context3.t0 = _context3["catch"](0);
|
|
302
262
|
return _context3.abrupt("return", Promise.reject(_context3.t0));
|
|
303
|
-
|
|
304
263
|
case 10:
|
|
305
264
|
case "end":
|
|
306
265
|
return _context3.stop();
|
|
@@ -308,84 +267,65 @@ var AccessGroups = /*#__PURE__*/function () {
|
|
|
308
267
|
}
|
|
309
268
|
}, _callee3, this, [[0, 7]]);
|
|
310
269
|
}));
|
|
311
|
-
|
|
312
270
|
function handleDroppedUris(_x5, _x6) {
|
|
313
271
|
return _handleDroppedUris.apply(this, arguments);
|
|
314
272
|
}
|
|
315
|
-
|
|
316
273
|
return handleDroppedUris;
|
|
317
274
|
}()
|
|
318
275
|
}, {
|
|
319
276
|
key: "handleDroppedUri",
|
|
320
277
|
value: function () {
|
|
321
|
-
var _handleDroppedUri = (0, _asyncToGenerator2["default"])(
|
|
322
|
-
var
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
_context4.next =
|
|
342
|
-
break;
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
debug.log(" Not obvious: looking up dropped thing ".concat(thing));
|
|
346
|
-
_context4.prev = 5;
|
|
347
|
-
_context4.next = 8;
|
|
348
|
-
return (_this$_store = this._store) === null || _this$_store === void 0 ? void 0 : (_this$_store$fetcher = _this$_store.fetcher) === null || _this$_store$fetcher === void 0 ? void 0 : _this$_store$fetcher.load(thing.doc());
|
|
349
|
-
|
|
350
|
-
case 8:
|
|
351
|
-
_context4.next = 15;
|
|
352
|
-
break;
|
|
353
|
-
|
|
354
|
-
case 10:
|
|
355
|
-
_context4.prev = 10;
|
|
356
|
-
_context4.t0 = _context4["catch"](5);
|
|
357
|
-
message = "Ignore error looking up dropped thing: ".concat(_context4.t0);
|
|
358
|
-
debug.error(message);
|
|
359
|
-
return _context4.abrupt("return", Promise.reject(new Error(message)));
|
|
360
|
-
|
|
361
|
-
case 15:
|
|
362
|
-
return _context4.abrupt("return", this.handleDroppedUri(uri, combo, true));
|
|
363
|
-
|
|
364
|
-
case 18:
|
|
365
|
-
if (agent) {
|
|
366
|
-
_context4.next = 22;
|
|
278
|
+
var _handleDroppedUri = (0, _asyncToGenerator2["default"])(function (uri, combo) {
|
|
279
|
+
var _this6 = this;
|
|
280
|
+
var secondAttempt = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
281
|
+
return /*#__PURE__*/_regenerator["default"].mark(function _callee4() {
|
|
282
|
+
var agent, thing, _this6$_store, _this6$_store$fetcher, message, error;
|
|
283
|
+
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
|
284
|
+
while (1) {
|
|
285
|
+
switch (_context4.prev = _context4.next) {
|
|
286
|
+
case 0:
|
|
287
|
+
agent = findAgent(uri, _this6.store); // eg 'agent', 'origin', agentClass'
|
|
288
|
+
thing = (0, _rdflib.sym)(uri);
|
|
289
|
+
if (!(!agent && !secondAttempt)) {
|
|
290
|
+
_context4.next = 17;
|
|
291
|
+
break;
|
|
292
|
+
}
|
|
293
|
+
debug.log(" Not obvious: looking up dropped thing ".concat(thing));
|
|
294
|
+
_context4.prev = 4;
|
|
295
|
+
_context4.next = 7;
|
|
296
|
+
return (_this6$_store = _this6._store) === null || _this6$_store === void 0 ? void 0 : (_this6$_store$fetcher = _this6$_store.fetcher) === null || _this6$_store$fetcher === void 0 ? void 0 : _this6$_store$fetcher.load(thing.doc());
|
|
297
|
+
case 7:
|
|
298
|
+
_context4.next = 14;
|
|
367
299
|
break;
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
300
|
+
case 9:
|
|
301
|
+
_context4.prev = 9;
|
|
302
|
+
_context4.t0 = _context4["catch"](4);
|
|
303
|
+
message = "Ignore error looking up dropped thing: ".concat(_context4.t0);
|
|
304
|
+
debug.error(message);
|
|
305
|
+
return _context4.abrupt("return", Promise.reject(new Error(message)));
|
|
306
|
+
case 14:
|
|
307
|
+
return _context4.abrupt("return", _this6.handleDroppedUri(uri, combo, true));
|
|
308
|
+
case 17:
|
|
309
|
+
if (agent) {
|
|
310
|
+
_context4.next = 21;
|
|
311
|
+
break;
|
|
312
|
+
}
|
|
313
|
+
error = " Error: Drop fails to drop appropriate thing! ".concat(uri);
|
|
314
|
+
debug.error(error);
|
|
315
|
+
return _context4.abrupt("return", Promise.reject(new Error(error)));
|
|
316
|
+
case 21:
|
|
317
|
+
_this6.setACLCombo(combo, uri, agent, _this6.controller.subject);
|
|
318
|
+
case 22:
|
|
319
|
+
case "end":
|
|
320
|
+
return _context4.stop();
|
|
321
|
+
}
|
|
380
322
|
}
|
|
381
|
-
}
|
|
382
|
-
}
|
|
383
|
-
})
|
|
384
|
-
|
|
323
|
+
}, _callee4, null, [[4, 9]]);
|
|
324
|
+
})();
|
|
325
|
+
});
|
|
385
326
|
function handleDroppedUri(_x7, _x8) {
|
|
386
327
|
return _handleDroppedUri.apply(this, arguments);
|
|
387
328
|
}
|
|
388
|
-
|
|
389
329
|
return handleDroppedUri;
|
|
390
330
|
}()
|
|
391
331
|
}, {
|
|
@@ -394,9 +334,7 @@ var AccessGroups = /*#__PURE__*/function () {
|
|
|
394
334
|
if (!(combo in this.byCombo)) {
|
|
395
335
|
this.byCombo[combo] = [];
|
|
396
336
|
}
|
|
397
|
-
|
|
398
337
|
this.removeAgentFromCombos(uri); // Combos are mutually distinct
|
|
399
|
-
|
|
400
338
|
this.byCombo[combo].push([res.pred, res.obj.uri]);
|
|
401
339
|
debug.log("ACL: setting access to ".concat(subject, " by ").concat(res.pred, ": ").concat(res.obj));
|
|
402
340
|
}
|
|
@@ -405,7 +343,6 @@ var AccessGroups = /*#__PURE__*/function () {
|
|
|
405
343
|
value: function removeAgentFromCombos(uri) {
|
|
406
344
|
for (var k = 0; k < 16; k++) {
|
|
407
345
|
var combos = this.byCombo[kToCombo(k)];
|
|
408
|
-
|
|
409
346
|
if (combos) {
|
|
410
347
|
for (var i = 0; i < combos.length; i++) {
|
|
411
348
|
while (i < combos.length && combos[i][1] === uri) {
|
|
@@ -418,54 +355,43 @@ var AccessGroups = /*#__PURE__*/function () {
|
|
|
418
355
|
}]);
|
|
419
356
|
return AccessGroups;
|
|
420
357
|
}();
|
|
421
|
-
|
|
422
358
|
exports.AccessGroups = AccessGroups;
|
|
423
|
-
|
|
424
359
|
function kToCombo(k) {
|
|
425
360
|
var y = ['Read', 'Append', 'Write', 'Control'];
|
|
426
361
|
var combo = [];
|
|
427
|
-
|
|
428
362
|
for (var i = 0; i < 4; i++) {
|
|
429
363
|
if (k & 1 << i) {
|
|
430
364
|
combo.push('http://www.w3.org/ns/auth/acl#' + y[i]);
|
|
431
365
|
}
|
|
432
366
|
}
|
|
433
|
-
|
|
434
367
|
combo.sort();
|
|
435
368
|
return combo.join('\n');
|
|
436
369
|
}
|
|
437
|
-
|
|
438
370
|
function ktToList(k) {
|
|
439
371
|
var list = '';
|
|
440
372
|
var y = ['Read', 'Append', 'Write', 'Control'];
|
|
441
|
-
|
|
442
373
|
for (var i = 0; i < 4; i++) {
|
|
443
374
|
if (k & 1 << i) {
|
|
444
375
|
list += y[i];
|
|
445
376
|
}
|
|
446
377
|
}
|
|
447
|
-
|
|
448
378
|
return list;
|
|
449
379
|
}
|
|
450
|
-
|
|
451
380
|
function findAgent(uri, kb) {
|
|
452
381
|
var obj = (0, _rdflib.sym)(uri);
|
|
453
382
|
var types = kb.findTypeURIs(obj);
|
|
454
|
-
|
|
455
383
|
for (var ty in types) {
|
|
456
384
|
debug.log(' drop object type includes: ' + ty);
|
|
457
|
-
}
|
|
458
|
-
|
|
459
|
-
|
|
385
|
+
}
|
|
386
|
+
// An Origin URI is one like https://fred.github.io eith no trailing slash
|
|
460
387
|
if (uri.startsWith('http') && uri.split('/').length === 3) {
|
|
461
388
|
// there is no third slash
|
|
462
389
|
return {
|
|
463
390
|
pred: 'origin',
|
|
464
391
|
obj: obj
|
|
465
392
|
}; // The only way to know an origin alas
|
|
466
|
-
}
|
|
467
|
-
|
|
468
|
-
|
|
393
|
+
}
|
|
394
|
+
// @@ This is an almighty kludge needed because drag and drop adds extra slashes to origins
|
|
469
395
|
if (uri.startsWith('http') && uri.split('/').length === 4 && uri.endsWith('/')) {
|
|
470
396
|
// there IS third slash
|
|
471
397
|
debug.log('Assuming final slash on dragged origin URI was unintended!');
|
|
@@ -479,7 +405,6 @@ function findAgent(uri, kb) {
|
|
|
479
405
|
pred: 'agent',
|
|
480
406
|
obj: obj
|
|
481
407
|
};
|
|
482
|
-
|
|
483
408
|
if (ns.vcard('Group').uri in types) {
|
|
484
409
|
return {
|
|
485
410
|
pred: 'agentGroup',
|
|
@@ -487,14 +412,14 @@ function findAgent(uri, kb) {
|
|
|
487
412
|
}; // @@ note vcard membership not RDFs
|
|
488
413
|
}
|
|
489
414
|
|
|
490
|
-
if (obj.sameTerm(ns.foaf('Agent')) || obj.sameTerm(ns.acl('AuthenticatedAgent')) ||
|
|
415
|
+
if (obj.sameTerm(ns.foaf('Agent')) || obj.sameTerm(ns.acl('AuthenticatedAgent')) ||
|
|
416
|
+
// AuthenticatedAgent
|
|
491
417
|
obj.sameTerm(ns.rdf('Resource')) || obj.sameTerm(ns.owl('Thing'))) {
|
|
492
418
|
return {
|
|
493
419
|
pred: 'agentClass',
|
|
494
420
|
obj: obj
|
|
495
421
|
};
|
|
496
422
|
}
|
|
497
|
-
|
|
498
423
|
if (ns.vcard('Individual').uri in types || ns.foaf('Person').uri in types || ns.foaf('Agent').uri in types) {
|
|
499
424
|
var pref = kb.any(obj, ns.foaf('preferredURI'));
|
|
500
425
|
if (pref) return {
|
|
@@ -506,21 +431,18 @@ function findAgent(uri, kb) {
|
|
|
506
431
|
obj: obj
|
|
507
432
|
};
|
|
508
433
|
}
|
|
509
|
-
|
|
510
434
|
if (ns.solid('AppProvider').uri in types) {
|
|
511
435
|
return {
|
|
512
436
|
pred: 'origin',
|
|
513
437
|
obj: obj
|
|
514
438
|
};
|
|
515
439
|
}
|
|
516
|
-
|
|
517
440
|
if (ns.solid('AppProviderClass').uri in types) {
|
|
518
441
|
return {
|
|
519
442
|
pred: 'originClass',
|
|
520
443
|
obj: obj
|
|
521
444
|
};
|
|
522
445
|
}
|
|
523
|
-
|
|
524
446
|
debug.log(' Triage fails for ' + uri);
|
|
525
447
|
return null;
|
|
526
448
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"access-groups.js","names":["ACL","ns","acl","COLLOQUIAL","RECOMMENDED","EXPLANATION","AccessGroups","doc","aclDoc","controller","store","options","defaults","_store","aclMap","readACL","byCombo","ACLbyCombination","addAgentButton","AddAgentButtons","rootElement","dom","createElement","classList","add","classes","accessGroupList","innerHTML","renderGroups","forEach","group","appendChild","isEditable","render","groupElements","comboIndex","combo","kToCombo","push","renderGroup","groupRow","accessGroupListItem","widgets","makeDropTarget","uris","handleDroppedUris","then","error","renderStatus","groupColumns","renderGroupElements","column","groupNameColumn","toggle","innerText","ktToList","groupAgentsColumn","groupAgentsTable","combos","map","pred","obj","renderAgent","agentElement","groupDescriptionElement","personRow","personTR","sym","deleteFunction","deleteAgent","removeChild","comboToRemove","find","comboPred","comboObj","splice","indexOf","save","uri","handleDroppedUri","Promise","all","reject","secondAttempt","agent","findAgent","thing","debug","log","fetcher","load","message","Error","setACLCombo","subject","res","removeAgentFromCombos","k","i","length","y","sort","join","list","kb","types","findTypeURIs","ty","startsWith","split","endsWith","slice","vcard","sameTerm","foaf","rdf","owl","pref","any","solid"],"sources":["../../src/acl/access-groups.ts"],"sourcesContent":["/**\n * Contains the [[AccessGroups]]\n * and [[AccessGroupsOptions]] classes\n * @packageDocumentation\n */\n\nimport { NamedNode, sym, Store } from 'rdflib'\nimport { ACLbyCombination, readACL } from './acl'\nimport * as widgets from '../widgets'\nimport * as ns from '../ns'\nimport { AccessController } from './access-controller'\nimport { AgentMapMap, ComboList, PartialAgentTriple } from './types'\nimport { AddAgentButtons } from './add-agent-buttons'\nimport * as debug from '../debug'\n\nconst ACL = ns.acl\n\nconst COLLOQUIAL = {\n 13: 'Owners',\n 9: 'Owners (write locked)',\n 5: 'Editors',\n 3: 'Posters',\n 2: 'Submitters',\n 1: 'Viewers'\n}\n\nconst RECOMMENDED = {\n 13: true,\n 5: true,\n 3: true,\n 2: true,\n 1: true\n}\n\nconst EXPLANATION = {\n 13: 'can read, write, and control sharing.',\n 9: 'can read and control sharing, currently write-locked.',\n 5: 'can read and change information',\n 3: 'can add new information, and read but not change existing information',\n 2: 'can add new information but not read any',\n 1: 'can read but not change information'\n}\n\n/**\n * Type for the options parameter of [[AccessGroups]]\n */\nexport interface AccessGroupsOptions {\n defaults?: boolean\n}\n\n/**\n * Renders the table of Owners, Editors, Posters, Submitters, Viewers\n * for https://github.com/solidos/userguide/blob/main/views/sharing/userguide.md\n */\nexport class AccessGroups {\n private readonly defaults: boolean\n public byCombo: ComboList\n public aclMap: AgentMapMap\n private readonly addAgentButton: AddAgentButtons\n private readonly rootElement: HTMLElement\n private _store: Store // @@ was LiveStore but does not need to be connected to web\n\n constructor (\n private doc: NamedNode,\n private aclDoc: NamedNode,\n public controller: AccessController,\n store: Store, // @@ was LiveStore\n private options: AccessGroupsOptions = {}\n ) {\n this.defaults = options.defaults || false\n this._store = store\n this.aclMap = readACL(doc, aclDoc, store, this.defaults)\n this.byCombo = ACLbyCombination(this.aclMap)\n this.addAgentButton = new AddAgentButtons(this)\n this.rootElement = this.controller.dom.createElement('div')\n this.rootElement.classList.add(this.controller.classes.accessGroupList)\n }\n\n public get store () {\n return this._store\n }\n\n public set store (store) {\n this._store = store\n this.aclMap = readACL(this.doc, this.aclDoc, store, this.defaults)\n this.byCombo = ACLbyCombination(this.aclMap)\n }\n\n public render (): HTMLElement {\n this.rootElement.innerHTML = ''\n this.renderGroups().forEach(group => this.rootElement.appendChild(group))\n if (this.controller.isEditable) {\n this.rootElement.appendChild(this.addAgentButton.render())\n }\n return this.rootElement\n }\n\n private renderGroups (): HTMLElement[] {\n const groupElements: HTMLElement[] = []\n for (let comboIndex = 15; comboIndex > 0; comboIndex--) {\n const combo = kToCombo(comboIndex)\n if ((this.controller.isEditable && RECOMMENDED[comboIndex]) || this.byCombo[combo]) {\n groupElements.push(this.renderGroup(comboIndex, combo))\n }\n }\n return groupElements\n }\n\n private renderGroup (comboIndex: number, combo: string): HTMLElement {\n const groupRow = this.controller.dom.createElement('div')\n groupRow.classList.add(this.controller.classes.accessGroupListItem)\n widgets.makeDropTarget(groupRow, (uris) => this.handleDroppedUris(uris, combo)\n .then(() => this.controller.render())\n .catch(error => this.controller.renderStatus(error)))\n const groupColumns = this.renderGroupElements(comboIndex, combo)\n groupColumns.forEach(column => groupRow.appendChild(column))\n return groupRow\n }\n\n private renderGroupElements (comboIndex, combo): HTMLElement[] {\n const groupNameColumn = this.controller.dom.createElement('div')\n groupNameColumn.classList.add(this.controller.classes.group)\n groupNameColumn.classList.toggle(this.controller.classes[`group-${comboIndex}`], this.controller.isEditable)\n groupNameColumn.innerText = COLLOQUIAL[comboIndex] || ktToList(comboIndex)\n\n const groupAgentsColumn = this.controller.dom.createElement('div')\n groupAgentsColumn.classList.add(this.controller.classes.group)\n groupAgentsColumn.classList.toggle(this.controller.classes[`group-${comboIndex}`], this.controller.isEditable)\n const groupAgentsTable = groupAgentsColumn.appendChild(this.controller.dom.createElement('table'))\n const combos = this.byCombo[combo] || []\n combos\n .map(([pred, obj]) => this.renderAgent(groupAgentsTable, combo, pred, obj))\n .forEach(agentElement => groupAgentsTable.appendChild(agentElement))\n\n const groupDescriptionElement = this.controller.dom.createElement('div')\n groupDescriptionElement.classList.add(this.controller.classes.group)\n groupDescriptionElement.classList.toggle(this.controller.classes[`group-${comboIndex}`], this.controller.isEditable)\n groupDescriptionElement.innerText = EXPLANATION[comboIndex] || 'Unusual combination'\n\n return [groupNameColumn, groupAgentsColumn, groupDescriptionElement]\n }\n\n private renderAgent (groupAgentsTable, combo, pred, obj): HTMLElement {\n const personRow = widgets.personTR(this.controller.dom, ACL(pred), sym(obj), this.controller.isEditable\n ? {\n deleteFunction: () => this.deleteAgent(combo, pred, obj)\n .then(() => groupAgentsTable.removeChild(personRow))\n .catch(error => this.controller.renderStatus(error))\n }\n : {})\n return personRow\n }\n\n private async deleteAgent (combo, pred, obj): Promise<void> {\n const combos = this.byCombo[combo] || []\n const comboToRemove = combos.find(([comboPred, comboObj]) => comboPred === pred && comboObj === obj)\n if (comboToRemove) {\n combos.splice(combos.indexOf(comboToRemove), 1)\n }\n await this.controller.save()\n }\n\n public async addNewURI (uri: string): Promise<void> {\n await this.handleDroppedUri(uri, kToCombo(1))\n await this.controller.save()\n }\n\n private async handleDroppedUris (uris: string[], combo: string): Promise<void> {\n try {\n await Promise.all(uris.map(uri => this.handleDroppedUri(uri, combo)))\n await this.controller.save()\n } catch (error) {\n return Promise.reject(error)\n }\n }\n\n private async handleDroppedUri (uri: string, combo: string, secondAttempt: boolean = false): Promise<void> {\n const agent = findAgent(uri, this.store) // eg 'agent', 'origin', agentClass'\n const thing = sym(uri)\n if (!agent && !secondAttempt) {\n debug.log(` Not obvious: looking up dropped thing ${thing}`)\n try {\n await this._store?.fetcher?.load(thing.doc())\n } catch (error) {\n const message = `Ignore error looking up dropped thing: ${error}`\n debug.error(message)\n return Promise.reject(new Error(message))\n }\n return this.handleDroppedUri(uri, combo, true)\n } else if (!agent) {\n const error = ` Error: Drop fails to drop appropriate thing! ${uri}`\n debug.error(error)\n return Promise.reject(new Error(error))\n }\n this.setACLCombo(combo, uri, agent, this.controller.subject)\n }\n\n private setACLCombo (combo: string, uri: string, res: PartialAgentTriple, subject: NamedNode): void {\n if (!(combo in this.byCombo)) {\n this.byCombo[combo] = []\n }\n this.removeAgentFromCombos(uri) // Combos are mutually distinct\n this.byCombo[combo].push([res.pred, res.obj.uri])\n debug.log(`ACL: setting access to ${subject} by ${res.pred}: ${res.obj}`)\n }\n\n private removeAgentFromCombos (uri: string): void {\n for (let k = 0; k < 16; k++) {\n const combos = this.byCombo[kToCombo(k)]\n if (combos) {\n for (let i = 0; i < combos.length; i++) {\n while (i < combos.length && combos[i][1] === uri) {\n combos.splice(i, 1)\n }\n }\n }\n }\n }\n}\n\nfunction kToCombo (k: number): string {\n const y = ['Read', 'Append', 'Write', 'Control']\n const combo: string[] = []\n for (let i = 0; i < 4; i++) {\n if (k & (1 << i)) {\n combo.push('http://www.w3.org/ns/auth/acl#' + y[i])\n }\n }\n combo.sort()\n return combo.join('\\n')\n}\n\nfunction ktToList (k: number): string {\n let list = ''\n const y = ['Read', 'Append', 'Write', 'Control']\n for (let i = 0; i < 4; i++) {\n if (k & (1 << i)) {\n list += y[i]\n }\n }\n return list\n}\n\nfunction findAgent (uri, kb): PartialAgentTriple | null {\n const obj = sym(uri)\n const types = kb.findTypeURIs(obj)\n for (const ty in types) {\n debug.log(' drop object type includes: ' + ty)\n }\n // An Origin URI is one like https://fred.github.io eith no trailing slash\n if (uri.startsWith('http') && uri.split('/').length === 3) {\n // there is no third slash\n return { pred: 'origin', obj } // The only way to know an origin alas\n }\n // @@ This is an almighty kludge needed because drag and drop adds extra slashes to origins\n if (\n uri.startsWith('http') &&\n uri.split('/').length === 4 &&\n uri.endsWith('/')\n ) {\n // there IS third slash\n debug.log('Assuming final slash on dragged origin URI was unintended!')\n return { pred: 'origin', obj: sym(uri.slice(0, -1)) } // Fix a URI where the drag and drop system has added a spurious slash\n }\n\n if (ns.vcard('WebID').uri in types) return { pred: 'agent', obj }\n\n if (ns.vcard('Group').uri in types) {\n return { pred: 'agentGroup', obj } // @@ note vcard membership not RDFs\n }\n if (\n obj.sameTerm(ns.foaf('Agent')) ||\n obj.sameTerm(ns.acl('AuthenticatedAgent')) || // AuthenticatedAgent\n obj.sameTerm(ns.rdf('Resource')) ||\n obj.sameTerm(ns.owl('Thing'))\n ) {\n return { pred: 'agentClass', obj }\n }\n if (\n ns.vcard('Individual').uri in types ||\n ns.foaf('Person').uri in types ||\n ns.foaf('Agent').uri in types\n ) {\n const pref = kb.any(obj, ns.foaf('preferredURI'))\n if (pref) return { pred: 'agent', obj: sym(pref) }\n return { pred: 'agent', obj }\n }\n if (ns.solid('AppProvider').uri in types) {\n return { pred: 'origin', obj }\n }\n if (ns.solid('AppProviderClass').uri in types) {\n return { pred: 'originClass', obj }\n }\n debug.log(' Triage fails for ' + uri)\n return null\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAMA;;AACA;;AACA;;AACA;;AAGA;;AACA;;;;;;AAbA;AACA;AACA;AACA;AACA;AAWA,IAAMA,GAAG,GAAGC,EAAE,CAACC,GAAf;AAEA,IAAMC,UAAU,GAAG;EACjB,IAAI,QADa;EAEjB,GAAG,uBAFc;EAGjB,GAAG,SAHc;EAIjB,GAAG,SAJc;EAKjB,GAAG,YALc;EAMjB,GAAG;AANc,CAAnB;AASA,IAAMC,WAAW,GAAG;EAClB,IAAI,IADc;EAElB,GAAG,IAFe;EAG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AAP;EACD;;EACD0B,KAAK,CAACC,GAAN,CAAU,0BAA0BV,GAApC;EACA,OAAO,IAAP;AACD"}
|
|
1
|
+
{"version":3,"file":"access-groups.js","names":["ACL","ns","acl","COLLOQUIAL","RECOMMENDED","EXPLANATION","AccessGroups","doc","aclDoc","controller","store","options","defaults","_store","aclMap","readACL","byCombo","ACLbyCombination","addAgentButton","AddAgentButtons","rootElement","dom","createElement","classList","add","classes","accessGroupList","innerHTML","renderGroups","forEach","group","appendChild","isEditable","render","groupElements","comboIndex","combo","kToCombo","push","renderGroup","groupRow","accessGroupListItem","widgets","makeDropTarget","uris","handleDroppedUris","then","error","renderStatus","groupColumns","renderGroupElements","column","groupNameColumn","toggle","innerText","ktToList","groupAgentsColumn","groupAgentsTable","combos","map","pred","obj","renderAgent","agentElement","groupDescriptionElement","personRow","personTR","sym","deleteFunction","deleteAgent","removeChild","comboToRemove","find","comboPred","comboObj","splice","indexOf","save","uri","handleDroppedUri","Promise","all","reject","secondAttempt","agent","findAgent","thing","debug","log","fetcher","load","message","Error","setACLCombo","subject","res","removeAgentFromCombos","k","i","length","y","sort","join","list","kb","types","findTypeURIs","ty","startsWith","split","endsWith","slice","vcard","sameTerm","foaf","rdf","owl","pref","any","solid"],"sources":["../../src/acl/access-groups.ts"],"sourcesContent":["/**\n * Contains the [[AccessGroups]]\n * and [[AccessGroupsOptions]] classes\n * @packageDocumentation\n */\n\nimport { NamedNode, sym, Store } from 'rdflib'\nimport { ACLbyCombination, readACL } from './acl'\nimport * as widgets from '../widgets'\nimport * as ns from '../ns'\nimport { AccessController } from './access-controller'\nimport { AgentMapMap, ComboList, PartialAgentTriple } from './types'\nimport { AddAgentButtons } from './add-agent-buttons'\nimport * as debug from '../debug'\n\nconst ACL = ns.acl\n\nconst COLLOQUIAL = {\n 13: 'Owners',\n 9: 'Owners (write locked)',\n 5: 'Editors',\n 3: 'Posters',\n 2: 'Submitters',\n 1: 'Viewers'\n}\n\nconst RECOMMENDED = {\n 13: true,\n 5: true,\n 3: true,\n 2: true,\n 1: true\n}\n\nconst EXPLANATION = {\n 13: 'can read, write, and control sharing.',\n 9: 'can read and control sharing, currently write-locked.',\n 5: 'can read and change information',\n 3: 'can add new information, and read but not change existing information',\n 2: 'can add new information but not read any',\n 1: 'can read but not change information'\n}\n\n/**\n * Type for the options parameter of [[AccessGroups]]\n */\nexport interface AccessGroupsOptions {\n defaults?: boolean\n}\n\n/**\n * Renders the table of Owners, Editors, Posters, Submitters, Viewers\n * for https://github.com/solidos/userguide/blob/main/views/sharing/userguide.md\n */\nexport class AccessGroups {\n private readonly defaults: boolean\n public byCombo: ComboList\n public aclMap: AgentMapMap\n private readonly addAgentButton: AddAgentButtons\n private readonly rootElement: HTMLElement\n private _store: Store // @@ was LiveStore but does not need to be connected to web\n\n constructor (\n private doc: NamedNode,\n private aclDoc: NamedNode,\n public controller: AccessController,\n store: Store, // @@ was LiveStore\n private options: AccessGroupsOptions = {}\n ) {\n this.defaults = options.defaults || false\n this._store = store\n this.aclMap = readACL(doc, aclDoc, store, this.defaults)\n this.byCombo = ACLbyCombination(this.aclMap)\n this.addAgentButton = new AddAgentButtons(this)\n this.rootElement = this.controller.dom.createElement('div')\n this.rootElement.classList.add(this.controller.classes.accessGroupList)\n }\n\n public get store () {\n return this._store\n }\n\n public set store (store) {\n this._store = store\n this.aclMap = readACL(this.doc, this.aclDoc, store, this.defaults)\n this.byCombo = ACLbyCombination(this.aclMap)\n }\n\n public render (): HTMLElement {\n this.rootElement.innerHTML = ''\n this.renderGroups().forEach(group => this.rootElement.appendChild(group))\n if (this.controller.isEditable) {\n this.rootElement.appendChild(this.addAgentButton.render())\n }\n return this.rootElement\n }\n\n private renderGroups (): HTMLElement[] {\n const groupElements: HTMLElement[] = []\n for (let comboIndex = 15; comboIndex > 0; comboIndex--) {\n const combo = kToCombo(comboIndex)\n if ((this.controller.isEditable && RECOMMENDED[comboIndex]) || this.byCombo[combo]) {\n groupElements.push(this.renderGroup(comboIndex, combo))\n }\n }\n return groupElements\n }\n\n private renderGroup (comboIndex: number, combo: string): HTMLElement {\n const groupRow = this.controller.dom.createElement('div')\n groupRow.classList.add(this.controller.classes.accessGroupListItem)\n widgets.makeDropTarget(groupRow, (uris) => this.handleDroppedUris(uris, combo)\n .then(() => this.controller.render())\n .catch(error => this.controller.renderStatus(error)))\n const groupColumns = this.renderGroupElements(comboIndex, combo)\n groupColumns.forEach(column => groupRow.appendChild(column))\n return groupRow\n }\n\n private renderGroupElements (comboIndex, combo): HTMLElement[] {\n const groupNameColumn = this.controller.dom.createElement('div')\n groupNameColumn.classList.add(this.controller.classes.group)\n groupNameColumn.classList.toggle(this.controller.classes[`group-${comboIndex}`], this.controller.isEditable)\n groupNameColumn.innerText = COLLOQUIAL[comboIndex] || ktToList(comboIndex)\n\n const groupAgentsColumn = this.controller.dom.createElement('div')\n groupAgentsColumn.classList.add(this.controller.classes.group)\n groupAgentsColumn.classList.toggle(this.controller.classes[`group-${comboIndex}`], this.controller.isEditable)\n const groupAgentsTable = groupAgentsColumn.appendChild(this.controller.dom.createElement('table'))\n const combos = this.byCombo[combo] || []\n combos\n .map(([pred, obj]) => this.renderAgent(groupAgentsTable, combo, pred, obj))\n .forEach(agentElement => groupAgentsTable.appendChild(agentElement))\n\n const groupDescriptionElement = this.controller.dom.createElement('div')\n groupDescriptionElement.classList.add(this.controller.classes.group)\n groupDescriptionElement.classList.toggle(this.controller.classes[`group-${comboIndex}`], this.controller.isEditable)\n groupDescriptionElement.innerText = EXPLANATION[comboIndex] || 'Unusual combination'\n\n return [groupNameColumn, groupAgentsColumn, groupDescriptionElement]\n }\n\n private renderAgent (groupAgentsTable, combo, pred, obj): HTMLElement {\n const personRow = widgets.personTR(this.controller.dom, ACL(pred), sym(obj), this.controller.isEditable\n ? {\n deleteFunction: () => this.deleteAgent(combo, pred, obj)\n .then(() => groupAgentsTable.removeChild(personRow))\n .catch(error => this.controller.renderStatus(error))\n }\n : {})\n return personRow\n }\n\n private async deleteAgent (combo, pred, obj): Promise<void> {\n const combos = this.byCombo[combo] || []\n const comboToRemove = combos.find(([comboPred, comboObj]) => comboPred === pred && comboObj === obj)\n if (comboToRemove) {\n combos.splice(combos.indexOf(comboToRemove), 1)\n }\n await this.controller.save()\n }\n\n public async addNewURI (uri: string): Promise<void> {\n await this.handleDroppedUri(uri, kToCombo(1))\n await this.controller.save()\n }\n\n private async handleDroppedUris (uris: string[], combo: string): Promise<void> {\n try {\n await Promise.all(uris.map(uri => this.handleDroppedUri(uri, combo)))\n await this.controller.save()\n } catch (error) {\n return Promise.reject(error)\n }\n }\n\n private async handleDroppedUri (uri: string, combo: string, secondAttempt: boolean = false): Promise<void> {\n const agent = findAgent(uri, this.store) // eg 'agent', 'origin', agentClass'\n const thing = sym(uri)\n if (!agent && !secondAttempt) {\n debug.log(` Not obvious: looking up dropped thing ${thing}`)\n try {\n await this._store?.fetcher?.load(thing.doc())\n } catch (error) {\n const message = `Ignore error looking up dropped thing: ${error}`\n debug.error(message)\n return Promise.reject(new Error(message))\n }\n return this.handleDroppedUri(uri, combo, true)\n } else if (!agent) {\n const error = ` Error: Drop fails to drop appropriate thing! ${uri}`\n debug.error(error)\n return Promise.reject(new Error(error))\n }\n this.setACLCombo(combo, uri, agent, this.controller.subject)\n }\n\n private setACLCombo (combo: string, uri: string, res: PartialAgentTriple, subject: NamedNode): void {\n if (!(combo in this.byCombo)) {\n this.byCombo[combo] = []\n }\n this.removeAgentFromCombos(uri) // Combos are mutually distinct\n this.byCombo[combo].push([res.pred, res.obj.uri])\n debug.log(`ACL: setting access to ${subject} by ${res.pred}: ${res.obj}`)\n }\n\n private removeAgentFromCombos (uri: string): void {\n for (let k = 0; k < 16; k++) {\n const combos = this.byCombo[kToCombo(k)]\n if (combos) {\n for (let i = 0; i < combos.length; i++) {\n while (i < combos.length && combos[i][1] === uri) {\n combos.splice(i, 1)\n }\n }\n }\n }\n }\n}\n\nfunction kToCombo (k: number): string {\n const y = ['Read', 'Append', 'Write', 'Control']\n const combo: string[] = []\n for (let i = 0; i < 4; i++) {\n if (k & (1 << i)) {\n combo.push('http://www.w3.org/ns/auth/acl#' + y[i])\n }\n }\n combo.sort()\n return combo.join('\\n')\n}\n\nfunction ktToList (k: number): string {\n let list = ''\n const y = ['Read', 'Append', 'Write', 'Control']\n for (let i = 0; i < 4; i++) {\n if (k & (1 << i)) {\n list += y[i]\n }\n }\n return list\n}\n\nfunction findAgent (uri, kb): PartialAgentTriple | null {\n const obj = sym(uri)\n const types = kb.findTypeURIs(obj)\n for (const ty in types) {\n debug.log(' drop object type includes: ' + ty)\n }\n // An Origin URI is one like https://fred.github.io eith no trailing slash\n if (uri.startsWith('http') && uri.split('/').length === 3) {\n // there is no third slash\n return { pred: 'origin', obj } // The only way to know an origin alas\n }\n // @@ This is an almighty kludge needed because drag and drop adds extra slashes to origins\n if (\n uri.startsWith('http') &&\n uri.split('/').length === 4 &&\n uri.endsWith('/')\n ) {\n // there IS third slash\n debug.log('Assuming final slash on dragged origin URI was unintended!')\n return { pred: 'origin', obj: sym(uri.slice(0, -1)) } // Fix a URI where the drag and drop system has added a spurious slash\n }\n\n if (ns.vcard('WebID').uri in types) return { pred: 'agent', obj }\n\n if (ns.vcard('Group').uri in types) {\n return { pred: 'agentGroup', obj } // @@ note vcard membership not RDFs\n }\n if (\n obj.sameTerm(ns.foaf('Agent')) ||\n obj.sameTerm(ns.acl('AuthenticatedAgent')) || // AuthenticatedAgent\n obj.sameTerm(ns.rdf('Resource')) ||\n obj.sameTerm(ns.owl('Thing'))\n ) {\n return { pred: 'agentClass', obj }\n }\n if (\n ns.vcard('Individual').uri in types ||\n ns.foaf('Person').uri in types ||\n ns.foaf('Agent').uri in types\n ) {\n const pref = kb.any(obj, ns.foaf('preferredURI'))\n if (pref) return { pred: 'agent', obj: sym(pref) }\n return { pred: 'agent', obj }\n }\n if (ns.solid('AppProvider').uri in types) {\n return { pred: 'origin', obj }\n }\n if (ns.solid('AppProviderClass').uri in types) {\n return { pred: 'originClass', obj }\n }\n debug.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