solid-ui 2.4.22-72c4afee → 2.4.22-805cc91c
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 +23 -58
- package/dist/main.js +7230 -6603
- package/dist/main.js.map +1 -1
- package/lib/acl/access-controller.js.map +1 -1
- package/lib/acl/access-groups.js.map +1 -1
- package/lib/acl/acl-control.js.map +1 -1
- package/lib/acl/acl.js.map +1 -1
- package/lib/acl/add-agent-buttons.js +0 -1
- package/lib/acl/add-agent-buttons.js.map +1 -1
- package/lib/acl/index.js.map +1 -1
- package/lib/acl/styles.js.map +1 -1
- package/lib/acl/types.js.map +1 -1
- package/lib/chat/bookmarks.js +2 -4
- package/lib/chat/bookmarks.js.map +1 -1
- package/lib/chat/chatLogic.js.map +1 -1
- package/lib/chat/dateFolder.js.map +1 -1
- package/lib/chat/infinite.js.map +1 -1
- package/lib/chat/message.js.map +1 -1
- package/lib/chat/messageTools.js.map +1 -1
- package/lib/chat/thread.js.map +1 -1
- package/lib/create/create.js.map +1 -1
- package/lib/create/index.js.map +1 -1
- package/lib/create/types.js.map +1 -1
- package/lib/debug.js.map +1 -1
- package/lib/folders.js.map +1 -1
- 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.map +1 -1
- package/lib/header/styleMap.js.map +1 -1
- package/lib/iconBase.js +3 -2
- package/lib/iconBase.js.map +1 -1
- package/lib/icons/solid_logo.js.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/jss/index.js.map +1 -1
- package/lib/log.js.map +1 -1
- package/lib/login/login.d.ts +9 -8
- package/lib/login/login.d.ts.map +1 -1
- package/lib/login/login.js +290 -342
- package/lib/login/login.js.map +1 -1
- package/lib/matrix/index.js.map +1 -1
- package/lib/matrix/matrix.js.map +1 -1
- package/lib/matrix/types.js.map +1 -1
- package/lib/media/index.js.map +1 -1
- package/lib/media/media-capture.js.map +1 -1
- package/lib/messageArea.js.map +1 -1
- package/lib/noun_Camera_1618446_000000.js.map +1 -1
- package/lib/ns.js.map +1 -1
- package/lib/pad.js.map +1 -1
- package/lib/participation.js.map +1 -1
- package/lib/preferences.js.map +1 -1
- package/lib/signup/config-default.js.map +1 -1
- package/lib/signup/signup.js.map +1 -1
- package/lib/stories/decorators.js.map +1 -1
- package/lib/style.js.map +1 -1
- package/lib/style_multiSelect.js +67 -0
- package/lib/style_multiSelect.js.map +1 -0
- package/lib/table.js.map +1 -1
- package/lib/tabs.d.ts +1 -1
- package/lib/tabs.d.ts.map +1 -1
- package/lib/tabs.js +34 -21
- package/lib/tabs.js.map +1 -1
- package/lib/typings.d.js.map +1 -1
- package/lib/utils/headerFooterHelpers.js.map +1 -1
- package/lib/utils/index.js.map +1 -1
- package/lib/utils/label.js +1 -1
- package/lib/utils/label.js.map +1 -1
- package/lib/versionInfo.d.ts +9 -9
- package/lib/versionInfo.js +14 -14
- package/lib/versionInfo.js.map +1 -1
- package/lib/widgets/buttons/iconLinks.js.map +1 -1
- package/lib/widgets/buttons.d.ts.map +1 -1
- package/lib/widgets/buttons.js +2 -0
- package/lib/widgets/buttons.js.map +1 -1
- package/lib/widgets/dragAndDrop.js.map +1 -1
- package/lib/widgets/error.d.ts +0 -12
- package/lib/widgets/error.d.ts.map +1 -1
- package/lib/widgets/error.js +5 -0
- package/lib/widgets/error.js.map +1 -1
- package/lib/widgets/forms/autocomplete/autocompleteBar.js.map +1 -1
- package/lib/widgets/forms/autocomplete/autocompleteField.js.map +1 -1
- package/lib/widgets/forms/autocomplete/autocompletePicker.js.map +1 -1
- package/lib/widgets/forms/autocomplete/language.js.map +1 -1
- package/lib/widgets/forms/autocomplete/publicData.js.map +1 -1
- package/lib/widgets/forms/basic.js.map +1 -1
- package/lib/widgets/forms/comment.js.map +1 -1
- package/lib/widgets/forms/fieldFunction.js.map +1 -1
- package/lib/widgets/forms/fieldParams.js.map +1 -1
- package/lib/widgets/forms/formStyle.js.map +1 -1
- package/lib/widgets/forms.js +443 -189
- package/lib/widgets/forms.js.map +1 -1
- package/lib/widgets/index.js.map +1 -1
- package/lib/widgets/multiSelect.js +784 -0
- package/lib/widgets/multiSelect.js.map +1 -0
- package/lib/widgets/peoplePicker.js.map +1 -1
- package/lib/widgets/widgetHelpers.js.map +1 -1
- package/package.json +11 -7
package/lib/login/login.js
CHANGED
|
@@ -17,7 +17,9 @@ exports.loginStatusBox = loginStatusBox;
|
|
|
17
17
|
exports.newAppInstance = newAppInstance;
|
|
18
18
|
exports.registrationControl = registrationControl;
|
|
19
19
|
exports.registrationList = registrationList;
|
|
20
|
+
exports.renderScopeHeadingRow = renderScopeHeadingRow;
|
|
20
21
|
exports.renderSignInPopup = renderSignInPopup;
|
|
22
|
+
exports.scopeLabel = scopeLabel;
|
|
21
23
|
exports.selectWorkspace = selectWorkspace;
|
|
22
24
|
|
|
23
25
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
@@ -38,7 +40,7 @@ var _signup = require("../signup/signup.js");
|
|
|
38
40
|
|
|
39
41
|
var _style = require("../style");
|
|
40
42
|
|
|
41
|
-
var
|
|
43
|
+
var utils = _interopRequireWildcard(require("../utils"));
|
|
42
44
|
|
|
43
45
|
var widgets = _interopRequireWildcard(require("../widgets"));
|
|
44
46
|
|
|
@@ -46,39 +48,29 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
46
48
|
|
|
47
49
|
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; }
|
|
48
50
|
|
|
49
|
-
|
|
51
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
50
52
|
|
|
51
|
-
|
|
52
|
-
* Signing in, signing up, profile and preferences reloading
|
|
53
|
-
* Type index management
|
|
54
|
-
*
|
|
55
|
-
* Many functions in this module take a context object which
|
|
56
|
-
* holds various RDF symbols, add to it, and return a promise of it.
|
|
57
|
-
*
|
|
58
|
-
* * `me` RDF symbol for the user's WebID
|
|
59
|
-
* * `publicProfile` The user's public profile, iff loaded
|
|
60
|
-
* * `preferencesFile` The user's personal preference file, iff loaded
|
|
61
|
-
* * `index.public` The user's public type index file
|
|
62
|
-
* * `index.private` The user's private type index file
|
|
63
|
-
*
|
|
64
|
-
* Not RDF symbols:
|
|
65
|
-
* * `noun` A string in english for the type of thing -- like "address book"
|
|
66
|
-
* * `instance` An array of nodes which are existing instances
|
|
67
|
-
* * `containers` An array of nodes of containers of instances
|
|
68
|
-
* * `div` A DOM element where UI can be displayed
|
|
69
|
-
* * `statusArea` A DOM element (opt) progress stuff can be displayed, or error messages
|
|
70
|
-
* *
|
|
71
|
-
* * Vocabulary: "load" loads a file if it exists;
|
|
72
|
-
* * 'Ensure" CREATES the file if it does not exist (if it can) and then loads it.
|
|
73
|
-
* @packageDocumentation
|
|
74
|
-
*/
|
|
53
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
75
54
|
|
|
55
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
56
|
+
|
|
57
|
+
var store = _solidLogic.solidLogicSingleton.store;
|
|
58
|
+
var _solidLogicSingleton$ = _solidLogic.solidLogicSingleton.profile,
|
|
59
|
+
loadPreferences = _solidLogicSingleton$.loadPreferences,
|
|
60
|
+
loadProfile = _solidLogicSingleton$.loadProfile;
|
|
61
|
+
var _solidLogicSingleton$2 = _solidLogic.solidLogicSingleton.typeIndex,
|
|
62
|
+
getScopedAppInstances = _solidLogicSingleton$2.getScopedAppInstances,
|
|
63
|
+
getRegistrations = _solidLogicSingleton$2.getRegistrations,
|
|
64
|
+
loadAllTypeIndexes = _solidLogicSingleton$2.loadAllTypeIndexes,
|
|
65
|
+
getScopedAppsFromIndex = _solidLogicSingleton$2.getScopedAppsFromIndex,
|
|
66
|
+
deleteTypeIndexRegistration = _solidLogicSingleton$2.deleteTypeIndexRegistration;
|
|
76
67
|
/**
|
|
77
68
|
* Resolves with the logged in user's WebID
|
|
78
69
|
*
|
|
79
70
|
* @param context
|
|
80
71
|
*/
|
|
81
72
|
// used to be logIn
|
|
73
|
+
|
|
82
74
|
function ensureLoggedIn(context) {
|
|
83
75
|
var me = _solidLogic.authn.currentUser();
|
|
84
76
|
|
|
@@ -120,7 +112,7 @@ function ensureLoggedIn(context) {
|
|
|
120
112
|
// used to be logInLoadPreferences
|
|
121
113
|
|
|
122
114
|
|
|
123
|
-
function ensureLoadedPreferences(
|
|
115
|
+
function ensureLoadedPreferences(_x) {
|
|
124
116
|
return _ensureLoadedPreferences.apply(this, arguments);
|
|
125
117
|
}
|
|
126
118
|
/**
|
|
@@ -168,7 +160,7 @@ function _ensureLoadedPreferences() {
|
|
|
168
160
|
case 7:
|
|
169
161
|
context = _context4.sent;
|
|
170
162
|
_context4.next = 10;
|
|
171
|
-
return
|
|
163
|
+
return loadPreferences(context.me);
|
|
172
164
|
|
|
173
165
|
case 10:
|
|
174
166
|
preferencesFile = _context4.sent;
|
|
@@ -178,7 +170,7 @@ function _ensureLoadedPreferences() {
|
|
|
178
170
|
}
|
|
179
171
|
|
|
180
172
|
context.preferencesFile = preferencesFile;
|
|
181
|
-
_context4.next =
|
|
173
|
+
_context4.next = 51;
|
|
182
174
|
break;
|
|
183
175
|
|
|
184
176
|
case 15:
|
|
@@ -192,7 +184,7 @@ function _ensureLoadedPreferences() {
|
|
|
192
184
|
|
|
193
185
|
m2 = 'Ooops - you are not authenticated (properly logged in) to for me to read your preference file. Try loggin out and logging in?';
|
|
194
186
|
(0, _log.alert)(m2);
|
|
195
|
-
_context4.next =
|
|
187
|
+
_context4.next = 51;
|
|
196
188
|
break;
|
|
197
189
|
|
|
198
190
|
case 22:
|
|
@@ -207,57 +199,53 @@ function _ensureLoadedPreferences() {
|
|
|
207
199
|
|
|
208
200
|
case 28:
|
|
209
201
|
if (!(_context4.t0 instanceof _solidLogic.SameOriginForbiddenError)) {
|
|
210
|
-
_context4.next =
|
|
202
|
+
_context4.next = 34;
|
|
211
203
|
break;
|
|
212
204
|
}
|
|
213
205
|
|
|
214
206
|
m2 = 'You are not authorized to read your preference file. This may be because you are using an untrusted web app.';
|
|
215
207
|
debug.warn(m2);
|
|
216
|
-
_context4.
|
|
217
|
-
break;
|
|
208
|
+
return _context4.abrupt("return", context);
|
|
218
209
|
|
|
219
|
-
case
|
|
220
|
-
if (!(_context4.t0 instanceof _solidLogic.
|
|
221
|
-
_context4.next =
|
|
210
|
+
case 34:
|
|
211
|
+
if (!(_context4.t0 instanceof _solidLogic.NotEditableError)) {
|
|
212
|
+
_context4.next = 40;
|
|
222
213
|
break;
|
|
223
214
|
}
|
|
224
215
|
|
|
225
|
-
|
|
226
|
-
|
|
216
|
+
m2 = 'You are not authorized to edit your preference file. This may be because you are using an untrusted web app.';
|
|
217
|
+
debug.warn(m2);
|
|
218
|
+
return _context4.abrupt("return", context);
|
|
219
|
+
|
|
220
|
+
case 40:
|
|
221
|
+
if (!(_context4.t0 instanceof _solidLogic.WebOperationError)) {
|
|
222
|
+
_context4.next = 45;
|
|
227
223
|
break;
|
|
228
224
|
}
|
|
229
225
|
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
_context4.next = 40;
|
|
234
|
-
break;
|
|
235
|
-
|
|
236
|
-
case 39:
|
|
237
|
-
throw new Error("User declined to create a preference file at ".concat(_context4.t0.preferencesFile || '(?)'));
|
|
238
|
-
|
|
239
|
-
case 40:
|
|
240
|
-
_context4.next = 48;
|
|
226
|
+
m2 = 'You are not authorized to edit your preference file. This may be because you are using an untrusted web app.';
|
|
227
|
+
debug.warn(m2);
|
|
228
|
+
_context4.next = 51;
|
|
241
229
|
break;
|
|
242
230
|
|
|
243
|
-
case
|
|
231
|
+
case 45:
|
|
244
232
|
if (!(_context4.t0 instanceof _solidLogic.FetchError)) {
|
|
245
|
-
_context4.next =
|
|
233
|
+
_context4.next = 50;
|
|
246
234
|
break;
|
|
247
235
|
}
|
|
248
236
|
|
|
249
237
|
m2 = "Strange: Error ".concat(_context4.t0.status, " trying to read your preference file.").concat(_context4.t0.message);
|
|
250
238
|
(0, _log.alert)(m2);
|
|
251
|
-
_context4.next =
|
|
239
|
+
_context4.next = 51;
|
|
252
240
|
break;
|
|
253
241
|
|
|
254
|
-
case
|
|
242
|
+
case 50:
|
|
255
243
|
throw new Error("(via loadPrefs) ".concat(_context4.t0));
|
|
256
244
|
|
|
257
|
-
case
|
|
245
|
+
case 51:
|
|
258
246
|
return _context4.abrupt("return", context);
|
|
259
247
|
|
|
260
|
-
case
|
|
248
|
+
case 52:
|
|
261
249
|
case "end":
|
|
262
250
|
return _context4.stop();
|
|
263
251
|
}
|
|
@@ -267,15 +255,14 @@ function _ensureLoadedPreferences() {
|
|
|
267
255
|
return _ensureLoadedPreferences.apply(this, arguments);
|
|
268
256
|
}
|
|
269
257
|
|
|
270
|
-
function ensureLoadedProfile(
|
|
258
|
+
function ensureLoadedProfile(_x2) {
|
|
271
259
|
return _ensureLoadedProfile.apply(this, arguments);
|
|
272
260
|
}
|
|
273
261
|
/**
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
*/
|
|
262
|
+
* Returns promise of context with arrays of symbols
|
|
263
|
+
*
|
|
264
|
+
* leaving the `isPublic` param undefined will bring in community index things, too
|
|
265
|
+
*/
|
|
279
266
|
|
|
280
267
|
|
|
281
268
|
function _ensureLoadedProfile() {
|
|
@@ -309,7 +296,7 @@ function _ensureLoadedProfile() {
|
|
|
309
296
|
|
|
310
297
|
case 8:
|
|
311
298
|
_context5.next = 10;
|
|
312
|
-
return
|
|
299
|
+
return loadProfile(logInContext.me);
|
|
313
300
|
|
|
314
301
|
case 10:
|
|
315
302
|
context.publicProfile = _context5.sent;
|
|
@@ -339,210 +326,138 @@ function _ensureLoadedProfile() {
|
|
|
339
326
|
return _ensureLoadedProfile.apply(this, arguments);
|
|
340
327
|
}
|
|
341
328
|
|
|
342
|
-
function findAppInstances(_x4, _x5
|
|
329
|
+
function findAppInstances(_x3, _x4, _x5) {
|
|
343
330
|
return _findAppInstances.apply(this, arguments);
|
|
344
331
|
}
|
|
345
|
-
/**
|
|
346
|
-
* UI to control registration of instance
|
|
347
|
-
*/
|
|
348
|
-
|
|
349
332
|
|
|
350
333
|
function _findAppInstances() {
|
|
351
334
|
_findAppInstances = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee6(context, theClass, isPublic) {
|
|
352
|
-
var
|
|
335
|
+
var items;
|
|
353
336
|
return _regenerator["default"].wrap(function _callee6$(_context6) {
|
|
354
337
|
while (1) {
|
|
355
338
|
switch (_context6.prev = _context6.next) {
|
|
356
339
|
case 0:
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
};
|
|
360
|
-
|
|
361
|
-
if (!(isPublic === undefined)) {
|
|
362
|
-
_context6.next = 7;
|
|
340
|
+
if (!context.me) {
|
|
341
|
+
_context6.next = 6;
|
|
363
342
|
break;
|
|
364
343
|
}
|
|
365
344
|
|
|
366
|
-
_context6.next =
|
|
367
|
-
return
|
|
345
|
+
_context6.next = 3;
|
|
346
|
+
return getScopedAppInstances(theClass, context.me);
|
|
368
347
|
|
|
369
|
-
case
|
|
370
|
-
_context6.
|
|
371
|
-
|
|
348
|
+
case 3:
|
|
349
|
+
_context6.t0 = _context6.sent;
|
|
350
|
+
_context6.next = 7;
|
|
351
|
+
break;
|
|
372
352
|
|
|
373
353
|
case 6:
|
|
374
|
-
|
|
354
|
+
_context6.t0 = [];
|
|
375
355
|
|
|
376
356
|
case 7:
|
|
377
|
-
|
|
378
|
-
_context6.next = 10;
|
|
379
|
-
return isPublic ? ensureLoadedProfile(context) : ensureLoadedPreferences(context);
|
|
380
|
-
|
|
381
|
-
case 10:
|
|
382
|
-
_context6.next = 15;
|
|
383
|
-
break;
|
|
384
|
-
|
|
385
|
-
case 12:
|
|
386
|
-
_context6.prev = 12;
|
|
387
|
-
_context6.t0 = _context6["catch"](7);
|
|
388
|
-
widgets.complain(context, "loadIndex: login and load problem ".concat(_context6.t0));
|
|
357
|
+
items = _context6.t0;
|
|
389
358
|
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
break;
|
|
400
|
-
|
|
401
|
-
case 21:
|
|
402
|
-
_context6.prev = 21;
|
|
403
|
-
_context6.t1 = _context6["catch"](16);
|
|
404
|
-
debug.error(_context6.t1);
|
|
405
|
-
|
|
406
|
-
case 24:
|
|
407
|
-
index = context.index;
|
|
408
|
-
thisIndex = index[visibility];
|
|
409
|
-
registrations = thisIndex.map(function (ix) {
|
|
410
|
-
return _solidLogic.solidLogicSingleton.store.each(undefined, ns.solid('forClass'), theClass, ix);
|
|
411
|
-
}).reduce(function (acc, curr) {
|
|
412
|
-
return acc.concat(curr);
|
|
413
|
-
}, []);
|
|
414
|
-
instances = registrations.map(function (reg) {
|
|
415
|
-
return _solidLogic.solidLogicSingleton.store.each(reg, ns.solid('instance'));
|
|
416
|
-
}).reduce(function (acc, curr) {
|
|
417
|
-
return acc.concat(curr);
|
|
418
|
-
}, []);
|
|
419
|
-
containers = registrations.map(function (reg) {
|
|
420
|
-
return _solidLogic.solidLogicSingleton.store.each(reg, ns.solid('instanceContainer'));
|
|
421
|
-
}).reduce(function (acc, curr) {
|
|
422
|
-
return acc.concat(curr);
|
|
423
|
-
}, []);
|
|
424
|
-
context.instances = context.instances || [];
|
|
425
|
-
context.instances = unique(context.instances.concat(instances));
|
|
426
|
-
context.containers = context.containers || [];
|
|
427
|
-
context.containers = unique(context.containers.concat(containers));
|
|
428
|
-
|
|
429
|
-
if (containers.length) {
|
|
430
|
-
_context6.next = 35;
|
|
431
|
-
break;
|
|
432
|
-
}
|
|
433
|
-
|
|
434
|
-
return _context6.abrupt("return", context);
|
|
435
|
-
|
|
436
|
-
case 35:
|
|
437
|
-
_context6.prev = 35;
|
|
438
|
-
_context6.next = 38;
|
|
439
|
-
return _solidLogic.solidLogicSingleton.load(containers);
|
|
440
|
-
|
|
441
|
-
case 38:
|
|
442
|
-
_context6.next = 45;
|
|
443
|
-
break;
|
|
444
|
-
|
|
445
|
-
case 40:
|
|
446
|
-
_context6.prev = 40;
|
|
447
|
-
_context6.t2 = _context6["catch"](35);
|
|
448
|
-
e = new Error("[FAI] Unable to load containers".concat(_context6.t2));
|
|
449
|
-
debug.log(e); // complain
|
|
450
|
-
|
|
451
|
-
widgets.complain(context, "Error looking for ".concat(_index.utils.label(theClass), ": ").concat(_context6.t2)); // but then ignore it
|
|
452
|
-
// throw new Error(e)
|
|
453
|
-
|
|
454
|
-
case 45:
|
|
455
|
-
i = 0;
|
|
456
|
-
|
|
457
|
-
case 46:
|
|
458
|
-
if (!(i < containers.length)) {
|
|
459
|
-
_context6.next = 56;
|
|
460
|
-
break;
|
|
359
|
+
if (isPublic === true) {
|
|
360
|
+
// old API - not recommended!
|
|
361
|
+
items = items.filter(function (item) {
|
|
362
|
+
return item.scope.label === 'public';
|
|
363
|
+
});
|
|
364
|
+
} else if (isPublic === false) {
|
|
365
|
+
items = items.filter(function (item) {
|
|
366
|
+
return item.scope.label === 'private';
|
|
367
|
+
});
|
|
461
368
|
}
|
|
462
369
|
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
_context6.next = 51;
|
|
466
|
-
return _solidLogic.solidLogicSingleton.getContainerMembers(cont.value);
|
|
467
|
-
|
|
468
|
-
case 51:
|
|
469
|
-
_context6.t4 = _context6.sent.map(function (uri) {
|
|
470
|
-
return _solidLogic.solidLogicSingleton.store.sym(uri);
|
|
370
|
+
context.instances = items.map(function (item) {
|
|
371
|
+
return item.instance;
|
|
471
372
|
});
|
|
472
|
-
context.instances = _context6.t3.concat.call(_context6.t3, _context6.t4);
|
|
473
|
-
|
|
474
|
-
case 53:
|
|
475
|
-
i++;
|
|
476
|
-
_context6.next = 46;
|
|
477
|
-
break;
|
|
478
|
-
|
|
479
|
-
case 56:
|
|
480
373
|
return _context6.abrupt("return", context);
|
|
481
374
|
|
|
482
|
-
case
|
|
375
|
+
case 11:
|
|
483
376
|
case "end":
|
|
484
377
|
return _context6.stop();
|
|
485
378
|
}
|
|
486
379
|
}
|
|
487
|
-
}, _callee6
|
|
380
|
+
}, _callee6);
|
|
488
381
|
}));
|
|
489
382
|
return _findAppInstances.apply(this, arguments);
|
|
490
383
|
}
|
|
491
384
|
|
|
492
|
-
function
|
|
493
|
-
|
|
385
|
+
function scopeLabel(context, scope) {
|
|
386
|
+
var mine = context.me && context.me.sameTerm(scope.agent);
|
|
387
|
+
var name = mine ? '' : utils.label(scope.agent) + ' ';
|
|
388
|
+
return "".concat(name).concat(scope.label);
|
|
494
389
|
}
|
|
495
390
|
/**
|
|
496
|
-
* UI to
|
|
391
|
+
* UI to control registration of instance
|
|
497
392
|
*/
|
|
498
393
|
|
|
499
394
|
|
|
395
|
+
function registrationControl(_x6, _x7, _x8) {
|
|
396
|
+
return _registrationControl.apply(this, arguments);
|
|
397
|
+
}
|
|
398
|
+
|
|
500
399
|
function _registrationControl() {
|
|
501
400
|
_registrationControl = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee7(context, instance, theClass) {
|
|
502
|
-
var dom, box,
|
|
401
|
+
var registrationStatements, renderScopeCheckbox, dom, box, me, scopes, msg, tbody, form, _iterator, _step, scope, row;
|
|
503
402
|
|
|
504
403
|
return _regenerator["default"].wrap(function _callee7$(_context7) {
|
|
505
404
|
while (1) {
|
|
506
405
|
switch (_context7.prev = _context7.next) {
|
|
507
406
|
case 0:
|
|
407
|
+
renderScopeCheckbox = function _renderScopeCheckbox(scope) {
|
|
408
|
+
var statements = registrationStatements(scope.index);
|
|
409
|
+
var name = scopeLabel(context, scope);
|
|
410
|
+
var label = "".concat(name, " link to this ").concat(context.noun);
|
|
411
|
+
return widgets.buildCheckboxForm(context.dom, _solidLogic.solidLogicSingleton.store, label, null, statements, form, scope.index);
|
|
412
|
+
};
|
|
413
|
+
|
|
414
|
+
registrationStatements = function _registrationStatemen(index) {
|
|
415
|
+
var registrations = getRegistrations(instance, theClass);
|
|
416
|
+
var reg = registrations.length ? registrations[0] : widgets.newThing(index);
|
|
417
|
+
return [(0, _rdflib.st)(reg, ns.solid('instance'), instance, index), (0, _rdflib.st)(reg, ns.solid('forClass'), theClass, index)];
|
|
418
|
+
};
|
|
419
|
+
|
|
420
|
+
/// / body of registrationControl
|
|
508
421
|
dom = context.dom;
|
|
509
422
|
|
|
510
423
|
if (!(!dom || !context.div)) {
|
|
511
|
-
_context7.next =
|
|
424
|
+
_context7.next = 5;
|
|
512
425
|
break;
|
|
513
426
|
}
|
|
514
427
|
|
|
515
|
-
|
|
428
|
+
throw new Error('registrationControl: need dom and div');
|
|
516
429
|
|
|
517
|
-
case
|
|
430
|
+
case 5:
|
|
518
431
|
box = dom.createElement('div');
|
|
519
432
|
context.div.appendChild(box);
|
|
520
433
|
context.me = _solidLogic.authn.currentUser(); // @@
|
|
521
434
|
|
|
522
|
-
|
|
523
|
-
|
|
435
|
+
me = context.me;
|
|
436
|
+
|
|
437
|
+
if (me) {
|
|
438
|
+
_context7.next = 12;
|
|
524
439
|
break;
|
|
525
440
|
}
|
|
526
441
|
|
|
527
442
|
box.innerHTML = '<p style="margin:2em;">(Log in to save a link to this)</p>';
|
|
528
443
|
return _context7.abrupt("return", context);
|
|
529
444
|
|
|
530
|
-
case 9:
|
|
531
|
-
_context7.prev = 9;
|
|
532
|
-
_context7.next = 12;
|
|
533
|
-
return (0, _solidLogic.ensureTypeIndexes)(context);
|
|
534
|
-
|
|
535
445
|
case 12:
|
|
536
|
-
|
|
537
|
-
_context7.next =
|
|
538
|
-
|
|
446
|
+
_context7.prev = 12;
|
|
447
|
+
_context7.next = 15;
|
|
448
|
+
return loadAllTypeIndexes(me);
|
|
539
449
|
|
|
540
450
|
case 15:
|
|
541
|
-
|
|
542
|
-
_context7.
|
|
451
|
+
scopes = _context7.sent;
|
|
452
|
+
_context7.next = 23;
|
|
453
|
+
break;
|
|
454
|
+
|
|
455
|
+
case 18:
|
|
456
|
+
_context7.prev = 18;
|
|
457
|
+
_context7.t0 = _context7["catch"](12);
|
|
543
458
|
|
|
544
459
|
if (context.div && context.preferencesFileError) {
|
|
545
|
-
msg = '(
|
|
460
|
+
msg = '(Lists of stuff not available)';
|
|
546
461
|
context.div.appendChild(dom.createElement('p')).textContent = msg;
|
|
547
462
|
} else if (context.div) {
|
|
548
463
|
msg = "registrationControl: Type indexes not available: ".concat(_context7.t0);
|
|
@@ -550,168 +465,201 @@ function _registrationControl() {
|
|
|
550
465
|
}
|
|
551
466
|
|
|
552
467
|
debug.log(msg);
|
|
468
|
+
return _context7.abrupt("return", context);
|
|
553
469
|
|
|
554
|
-
case
|
|
555
|
-
box.innerHTML = '<table><tbody
|
|
470
|
+
case 23:
|
|
471
|
+
box.innerHTML = '<table><tbody></tbody></table>'; // tbody will be inserted anyway
|
|
556
472
|
|
|
557
473
|
box.setAttribute('style', 'font-size: 120%; text-align: right; padding: 1em; border: solid gray 0.05em;');
|
|
558
474
|
tbody = box.children[0].children[0];
|
|
559
475
|
form = new _rdflib.BlankNode(); // @@ say for now
|
|
560
476
|
|
|
561
|
-
|
|
562
|
-
var registrations = _solidLogic.solidLogicSingleton.getRegistrations(instance, theClass);
|
|
563
|
-
|
|
564
|
-
var reg = registrations.length ? registrations[0] : widgets.newThing(index);
|
|
565
|
-
return [(0, _rdflib.st)(reg, ns.solid('instance'), instance, index), (0, _rdflib.st)(reg, ns.solid('forClass'), theClass, index)];
|
|
566
|
-
};
|
|
477
|
+
_iterator = _createForOfIteratorHelper(scopes);
|
|
567
478
|
|
|
568
479
|
try {
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
}
|
|
574
|
-
|
|
575
|
-
if (context2.index && context2.index["private"] && context2.index["private"].length > 0) {
|
|
576
|
-
index = context2.index["private"][0];
|
|
577
|
-
statements = registrationStatements(index);
|
|
578
|
-
tbody.children[1].appendChild(widgets.buildCheckboxForm(context2.dom, _solidLogic.solidLogicSingleton.store, "Personal note of this ".concat(context2.noun), null, statements, form, index));
|
|
480
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
481
|
+
scope = _step.value;
|
|
482
|
+
row = tbody.appendChild(dom.createElement('tr'));
|
|
483
|
+
row.appendChild(renderScopeCheckbox(scope)); // @@ index
|
|
579
484
|
}
|
|
580
|
-
} catch (
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
context.div.appendChild(widgets.errorMessageBlock(context.dom, e));
|
|
585
|
-
}
|
|
586
|
-
|
|
587
|
-
debug.log(_msg);
|
|
485
|
+
} catch (err) {
|
|
486
|
+
_iterator.e(err);
|
|
487
|
+
} finally {
|
|
488
|
+
_iterator.f();
|
|
588
489
|
}
|
|
589
490
|
|
|
590
|
-
return _context7.abrupt("return",
|
|
491
|
+
return _context7.abrupt("return", context);
|
|
591
492
|
|
|
592
|
-
case
|
|
493
|
+
case 30:
|
|
593
494
|
case "end":
|
|
594
495
|
return _context7.stop();
|
|
595
496
|
}
|
|
596
497
|
}
|
|
597
|
-
}, _callee7, null, [[
|
|
498
|
+
}, _callee7, null, [[12, 18]]);
|
|
598
499
|
}));
|
|
599
500
|
return _registrationControl.apply(this, arguments);
|
|
600
501
|
}
|
|
601
502
|
|
|
602
|
-
function
|
|
603
|
-
|
|
503
|
+
function renderScopeHeadingRow(context, store, scope) {
|
|
504
|
+
var backgroundColor = {
|
|
505
|
+
"private": '#fee',
|
|
506
|
+
"public": '#efe'
|
|
507
|
+
};
|
|
508
|
+
var dom = context.dom;
|
|
509
|
+
var name = scopeLabel(context, scope);
|
|
510
|
+
var row = dom.createElement('tr');
|
|
511
|
+
var cell = row.appendChild(dom.createElement('td'));
|
|
512
|
+
cell.setAttribute('colspan', '3');
|
|
513
|
+
cell.style.backgoundColor = backgroundColor[scope.label] || 'white';
|
|
514
|
+
var header = cell.appendChild(dom.createElement('h3'));
|
|
515
|
+
header.textContent = name + ' links';
|
|
516
|
+
header.style.textAlign = 'left';
|
|
517
|
+
return row;
|
|
604
518
|
}
|
|
519
|
+
/**
|
|
520
|
+
* UI to List at all registered things
|
|
521
|
+
*/
|
|
522
|
+
|
|
523
|
+
|
|
524
|
+
function registrationList(_x9, _x10) {
|
|
525
|
+
return _registrationList.apply(this, arguments);
|
|
526
|
+
} // registrationList
|
|
527
|
+
|
|
605
528
|
|
|
606
529
|
function _registrationList() {
|
|
607
|
-
_registrationList = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
|
608
|
-
var dom, div, box;
|
|
609
|
-
|
|
530
|
+
_registrationList = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee9(context, options) {
|
|
531
|
+
var dom, div, box, scopes, table, tbody, _iterator2, _step2, scope, headingRow, items, _iterator3, _step3, _loop;
|
|
532
|
+
|
|
533
|
+
return _regenerator["default"].wrap(function _callee9$(_context9) {
|
|
610
534
|
while (1) {
|
|
611
|
-
switch (
|
|
535
|
+
switch (_context9.prev = _context9.next) {
|
|
612
536
|
case 0:
|
|
613
|
-
dom =
|
|
614
|
-
div =
|
|
537
|
+
dom = context.dom;
|
|
538
|
+
div = context.div;
|
|
615
539
|
box = dom.createElement('div');
|
|
616
540
|
div.appendChild(box);
|
|
617
|
-
|
|
541
|
+
context.me = _solidLogic.authn.currentUser(); // @@
|
|
618
542
|
|
|
619
|
-
if (
|
|
620
|
-
|
|
543
|
+
if (context.me) {
|
|
544
|
+
_context9.next = 8;
|
|
621
545
|
break;
|
|
622
546
|
}
|
|
623
547
|
|
|
624
548
|
box.innerHTML = '<p style="margin:2em;">(Log in list your stuff)</p>';
|
|
625
|
-
return
|
|
549
|
+
return _context9.abrupt("return", context);
|
|
626
550
|
|
|
627
551
|
case 8:
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
// tbody will be inserted anyway
|
|
632
|
-
box.setAttribute('style', 'font-size: 120%; text-align: right; padding: 1em; border: solid #eee 0.5em;');
|
|
633
|
-
var table = box.firstChild;
|
|
634
|
-
var ix = [];
|
|
635
|
-
var sts = [];
|
|
636
|
-
var vs = ['private', 'public'];
|
|
637
|
-
vs.forEach(function (visibility) {
|
|
638
|
-
if (context.index && context.index[visibility].length > 0 && options[visibility]) {
|
|
639
|
-
ix = ix.concat(context.index[visibility][0]);
|
|
640
|
-
sts = sts.concat(_solidLogic.solidLogicSingleton.store.statementsMatching(undefined, ns.solid('instance'), undefined, context.index[visibility][0]));
|
|
641
|
-
}
|
|
642
|
-
});
|
|
552
|
+
_context9.next = 10;
|
|
553
|
+
return loadAllTypeIndexes(context.me);
|
|
643
554
|
|
|
644
|
-
|
|
645
|
-
|
|
555
|
+
case 10:
|
|
556
|
+
scopes = _context9.sent;
|
|
557
|
+
// includes community indexes
|
|
558
|
+
// console.log('@@ registrationList ', scopes)
|
|
559
|
+
box.innerHTML = '<table><tbody></tbody></table>'; // tbody will be inserted anyway
|
|
560
|
+
|
|
561
|
+
box.setAttribute('style', 'font-size: 120%; text-align: right; padding: 1em; border: solid #eee 0.5em;');
|
|
562
|
+
table = box.firstChild;
|
|
563
|
+
tbody = table.firstChild;
|
|
564
|
+
_iterator2 = _createForOfIteratorHelper(scopes);
|
|
565
|
+
_context9.prev = 16;
|
|
566
|
+
|
|
567
|
+
_iterator2.s();
|
|
568
|
+
|
|
569
|
+
case 18:
|
|
570
|
+
if ((_step2 = _iterator2.n()).done) {
|
|
571
|
+
_context9.next = 30;
|
|
572
|
+
break;
|
|
573
|
+
}
|
|
646
574
|
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
575
|
+
scope = _step2.value;
|
|
576
|
+
// need some predicate for listing/adding agents
|
|
577
|
+
headingRow = renderScopeHeadingRow(context, store, scope);
|
|
578
|
+
tbody.appendChild(headingRow);
|
|
579
|
+
_context9.next = 24;
|
|
580
|
+
return getScopedAppsFromIndex(scope, options.type || null);
|
|
653
581
|
|
|
582
|
+
case 24:
|
|
583
|
+
items = _context9.sent;
|
|
584
|
+
// any class
|
|
585
|
+
if (items.length === 0) headingRow.style.display = 'none'; // console.log(`registrationList: @@ instance items for class ${options.type || 'undefined' }:`, items)
|
|
654
586
|
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
587
|
+
_iterator3 = _createForOfIteratorHelper(items);
|
|
588
|
+
|
|
589
|
+
try {
|
|
590
|
+
_loop = function _loop() {
|
|
591
|
+
var item = _step3.value;
|
|
592
|
+
var row = widgets.personTR(dom, ns.solid('instance'), item.instance, {
|
|
593
|
+
deleteFunction: function () {
|
|
594
|
+
var _deleteFunction = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee8() {
|
|
595
|
+
return _regenerator["default"].wrap(function _callee8$(_context8) {
|
|
596
|
+
while (1) {
|
|
597
|
+
switch (_context8.prev = _context8.next) {
|
|
598
|
+
case 0:
|
|
599
|
+
_context8.next = 2;
|
|
600
|
+
return deleteTypeIndexRegistration(item);
|
|
601
|
+
|
|
602
|
+
case 2:
|
|
603
|
+
tbody.removeChild(row);
|
|
604
|
+
|
|
605
|
+
case 3:
|
|
606
|
+
case "end":
|
|
607
|
+
return _context8.stop();
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
}, _callee8);
|
|
611
|
+
}));
|
|
612
|
+
|
|
613
|
+
function deleteFunction() {
|
|
614
|
+
return _deleteFunction.apply(this, arguments);
|
|
661
615
|
}
|
|
662
616
|
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
}
|
|
669
|
-
});
|
|
670
|
-
}
|
|
671
|
-
}));
|
|
617
|
+
return deleteFunction;
|
|
618
|
+
}()
|
|
619
|
+
});
|
|
620
|
+
row.children[0].style.paddingLeft = '3em';
|
|
621
|
+
tbody.appendChild(row);
|
|
672
622
|
};
|
|
673
623
|
|
|
674
|
-
for (
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
if (containers.length) {
|
|
683
|
-
fetcher.load(containers).then(function(xhrs){
|
|
684
|
-
for (const i=0; i<containers.length; i++) {
|
|
685
|
-
const cont = containers[i];
|
|
686
|
-
instances = instances.concat(solidLogicSingleton.store.each(cont, ns.ldp('contains')));
|
|
687
|
-
}
|
|
688
|
-
});
|
|
689
|
-
}
|
|
690
|
-
*/
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
// registrationList
|
|
694
|
-
|
|
695
|
-
/*
|
|
696
|
-
//const containers = solidLogicSingleton.store.each(theClass, ns.solid('instanceContainer'));
|
|
697
|
-
if (containers.length) {
|
|
698
|
-
fetcher.load(containers).then(function(xhrs){
|
|
699
|
-
for (const i=0; i<containers.length; i++) {
|
|
700
|
-
const cont = containers[i];
|
|
701
|
-
instances = instances.concat(solidLogicSingleton.store.each(cont, ns.ldp('contains')));
|
|
702
|
-
}
|
|
703
|
-
});
|
|
704
|
-
}
|
|
705
|
-
*/
|
|
706
|
-
return context;
|
|
707
|
-
}));
|
|
624
|
+
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
625
|
+
_loop();
|
|
626
|
+
}
|
|
627
|
+
} catch (err) {
|
|
628
|
+
_iterator3.e(err);
|
|
629
|
+
} finally {
|
|
630
|
+
_iterator3.f();
|
|
631
|
+
}
|
|
708
632
|
|
|
709
|
-
case
|
|
633
|
+
case 28:
|
|
634
|
+
_context9.next = 18;
|
|
635
|
+
break;
|
|
636
|
+
|
|
637
|
+
case 30:
|
|
638
|
+
_context9.next = 35;
|
|
639
|
+
break;
|
|
640
|
+
|
|
641
|
+
case 32:
|
|
642
|
+
_context9.prev = 32;
|
|
643
|
+
_context9.t0 = _context9["catch"](16);
|
|
644
|
+
|
|
645
|
+
_iterator2.e(_context9.t0);
|
|
646
|
+
|
|
647
|
+
case 35:
|
|
648
|
+
_context9.prev = 35;
|
|
649
|
+
|
|
650
|
+
_iterator2.f();
|
|
651
|
+
|
|
652
|
+
return _context9.finish(35);
|
|
653
|
+
|
|
654
|
+
case 38:
|
|
655
|
+
return _context9.abrupt("return", context);
|
|
656
|
+
|
|
657
|
+
case 39:
|
|
710
658
|
case "end":
|
|
711
|
-
return
|
|
659
|
+
return _context9.stop();
|
|
712
660
|
}
|
|
713
661
|
}
|
|
714
|
-
},
|
|
662
|
+
}, _callee9, null, [[16, 32, 35, 38]]);
|
|
715
663
|
}));
|
|
716
664
|
return _registrationList.apply(this, arguments);
|
|
717
665
|
}
|
|
@@ -868,7 +816,7 @@ function renderSignInPopup(dom) {
|
|
|
868
816
|
}, _callee, null, [[0, 8]]);
|
|
869
817
|
}));
|
|
870
818
|
|
|
871
|
-
return function loginToIssuer(
|
|
819
|
+
return function loginToIssuer(_x11) {
|
|
872
820
|
return _ref.apply(this, arguments);
|
|
873
821
|
};
|
|
874
822
|
}();
|
|
@@ -1155,7 +1103,7 @@ function selectWorkspace(dom, appDetails, callbackWS) {
|
|
|
1155
1103
|
|
|
1156
1104
|
function displayOptions(context) {
|
|
1157
1105
|
// console.log('displayOptions!', context)
|
|
1158
|
-
function makeNewWorkspace(
|
|
1106
|
+
function makeNewWorkspace(_x12) {
|
|
1159
1107
|
return _makeNewWorkspace.apply(this, arguments);
|
|
1160
1108
|
} // const status = ''
|
|
1161
1109
|
|
|
@@ -1424,77 +1372,77 @@ function getUserRoles() {
|
|
|
1424
1372
|
|
|
1425
1373
|
|
|
1426
1374
|
function _getUserRoles() {
|
|
1427
|
-
_getUserRoles = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
|
1375
|
+
_getUserRoles = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee10() {
|
|
1428
1376
|
var _yield$ensureLoadedPr, me, preferencesFile, preferencesFileError;
|
|
1429
1377
|
|
|
1430
|
-
return _regenerator["default"].wrap(function
|
|
1378
|
+
return _regenerator["default"].wrap(function _callee10$(_context10) {
|
|
1431
1379
|
while (1) {
|
|
1432
|
-
switch (
|
|
1380
|
+
switch (_context10.prev = _context10.next) {
|
|
1433
1381
|
case 0:
|
|
1434
|
-
|
|
1435
|
-
|
|
1382
|
+
_context10.prev = 0;
|
|
1383
|
+
_context10.next = 3;
|
|
1436
1384
|
return ensureLoadedPreferences({});
|
|
1437
1385
|
|
|
1438
1386
|
case 3:
|
|
1439
|
-
_yield$ensureLoadedPr =
|
|
1387
|
+
_yield$ensureLoadedPr = _context10.sent;
|
|
1440
1388
|
me = _yield$ensureLoadedPr.me;
|
|
1441
1389
|
preferencesFile = _yield$ensureLoadedPr.preferencesFile;
|
|
1442
1390
|
preferencesFileError = _yield$ensureLoadedPr.preferencesFileError;
|
|
1443
1391
|
|
|
1444
1392
|
if (!(!preferencesFile || preferencesFileError)) {
|
|
1445
|
-
|
|
1393
|
+
_context10.next = 9;
|
|
1446
1394
|
break;
|
|
1447
1395
|
}
|
|
1448
1396
|
|
|
1449
1397
|
throw new Error(preferencesFileError);
|
|
1450
1398
|
|
|
1451
1399
|
case 9:
|
|
1452
|
-
return
|
|
1400
|
+
return _context10.abrupt("return", _solidLogic.solidLogicSingleton.store.each(me, ns.rdf('type'), null, preferencesFile.doc()));
|
|
1453
1401
|
|
|
1454
1402
|
case 12:
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
debug.warn('Unable to fetch your preferences - this was the error: ',
|
|
1403
|
+
_context10.prev = 12;
|
|
1404
|
+
_context10.t0 = _context10["catch"](0);
|
|
1405
|
+
debug.warn('Unable to fetch your preferences - this was the error: ', _context10.t0);
|
|
1458
1406
|
|
|
1459
1407
|
case 15:
|
|
1460
|
-
return
|
|
1408
|
+
return _context10.abrupt("return", []);
|
|
1461
1409
|
|
|
1462
1410
|
case 16:
|
|
1463
1411
|
case "end":
|
|
1464
|
-
return
|
|
1412
|
+
return _context10.stop();
|
|
1465
1413
|
}
|
|
1466
1414
|
}
|
|
1467
|
-
},
|
|
1415
|
+
}, _callee10, null, [[0, 12]]);
|
|
1468
1416
|
}));
|
|
1469
1417
|
return _getUserRoles.apply(this, arguments);
|
|
1470
1418
|
}
|
|
1471
1419
|
|
|
1472
|
-
function filterAvailablePanes(
|
|
1420
|
+
function filterAvailablePanes(_x13) {
|
|
1473
1421
|
return _filterAvailablePanes.apply(this, arguments);
|
|
1474
1422
|
}
|
|
1475
1423
|
|
|
1476
1424
|
function _filterAvailablePanes() {
|
|
1477
|
-
_filterAvailablePanes = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
|
1425
|
+
_filterAvailablePanes = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee11(panes) {
|
|
1478
1426
|
var userRoles;
|
|
1479
|
-
return _regenerator["default"].wrap(function
|
|
1427
|
+
return _regenerator["default"].wrap(function _callee11$(_context11) {
|
|
1480
1428
|
while (1) {
|
|
1481
|
-
switch (
|
|
1429
|
+
switch (_context11.prev = _context11.next) {
|
|
1482
1430
|
case 0:
|
|
1483
|
-
|
|
1431
|
+
_context11.next = 2;
|
|
1484
1432
|
return getUserRoles();
|
|
1485
1433
|
|
|
1486
1434
|
case 2:
|
|
1487
|
-
userRoles =
|
|
1488
|
-
return
|
|
1435
|
+
userRoles = _context11.sent;
|
|
1436
|
+
return _context11.abrupt("return", panes.filter(function (pane) {
|
|
1489
1437
|
return isMatchingAudience(pane, userRoles);
|
|
1490
1438
|
}));
|
|
1491
1439
|
|
|
1492
1440
|
case 4:
|
|
1493
1441
|
case "end":
|
|
1494
|
-
return
|
|
1442
|
+
return _context11.stop();
|
|
1495
1443
|
}
|
|
1496
1444
|
}
|
|
1497
|
-
},
|
|
1445
|
+
}, _callee11);
|
|
1498
1446
|
}));
|
|
1499
1447
|
return _filterAvailablePanes.apply(this, arguments);
|
|
1500
1448
|
}
|