solid-ui 2.4.18-c89d416d → 2.4.18-d0dfe92f

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.
@@ -645,6 +645,7 @@ var EXPLANATION = {
645
645
  * for https://github.com/solid/userguide/blob/main/views/sharing/userguide.md
646
646
  */
647
647
  var AccessGroups = /*#__PURE__*/function () {
648
+ // @@ was LiveStore but doe not need to ne connected to web
648
649
  function AccessGroups(doc, aclDoc, controller, store) {
649
650
  var options = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {};
650
651
  (0, _classCallCheck2["default"])(this, AccessGroups);
@@ -7915,6 +7916,9 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
7915
7916
  * * `containers` An array of nodes of containers of instances
7916
7917
  * * `div` A DOM element where UI can be displayed
7917
7918
  * * `statusArea` A DOM element (opt) progress stuff can be displayed, or error messages
7919
+ * *
7920
+ * * Vocabulary: "load" loads a file if it exists;
7921
+ * * 'Ensure" CREATES the file if it does not exist (if it can) and then loads it.
7918
7922
  * @packageDocumentation
7919
7923
  */
7920
7924
 
@@ -8334,141 +8338,231 @@ function _findAppInstances() {
8334
8338
  return _findAppInstances.apply(this, arguments);
8335
8339
  }
8336
8340
 
8337
- function registrationControl(context, instance, theClass) {
8338
- var dom = context.dom;
8341
+ function registrationControl(_x7, _x8, _x9) {
8342
+ return _registrationControl.apply(this, arguments);
8343
+ }
8344
+ /**
8345
+ * UI to List at all registered things
8346
+ */
8339
8347
 
8340
- if (!dom || !context.div) {
8341
- return Promise.resolve();
8342
- }
8343
8348
 
8344
- var box = dom.createElement('div');
8345
- context.div.appendChild(box);
8346
- return (0, _solidLogic.ensureTypeIndexes)(context).then(function () {
8347
- box.innerHTML = '<table><tbody><tr></tr><tr></tr></tbody></table>'; // tbody will be inserted anyway
8349
+ function _registrationControl() {
8350
+ _registrationControl = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee7(context, instance, theClass) {
8351
+ var dom, box, context2, msg, tbody, form, registrationStatements, index, statements, _msg;
8348
8352
 
8349
- box.setAttribute('style', 'font-size: 120%; text-align: right; padding: 1em; border: solid gray 0.05em;');
8350
- var tbody = box.children[0].children[0];
8351
- var form = new _rdflib.BlankNode(); // @@ say for now
8353
+ return _regenerator["default"].wrap(function _callee7$(_context7) {
8354
+ while (1) {
8355
+ switch (_context7.prev = _context7.next) {
8356
+ case 0:
8357
+ dom = context.dom;
8352
8358
 
8353
- var registrationStatements = function registrationStatements(index) {
8354
- var registrations = _solidLogic.solidLogicSingleton.getRegistrations(instance, theClass);
8359
+ if (!(!dom || !context.div)) {
8360
+ _context7.next = 3;
8361
+ break;
8362
+ }
8355
8363
 
8356
- var reg = registrations.length ? registrations[0] : widgets.newThing(index);
8357
- return [(0, _rdflib.st)(reg, ns.solid('instance'), instance, index), (0, _rdflib.st)(reg, ns.solid('forClass'), theClass, index)];
8358
- };
8364
+ return _context7.abrupt("return", context);
8359
8365
 
8360
- var index, statements;
8366
+ case 3:
8367
+ box = dom.createElement('div');
8368
+ context.div.appendChild(box);
8369
+ context.me = _solidLogic.authn.currentUser(); // @@
8361
8370
 
8362
- if (context.index && context.index["public"] && context.index["public"].length > 0) {
8363
- index = context.index["public"][0];
8364
- statements = registrationStatements(index);
8365
- tbody.children[0].appendChild(widgets.buildCheckBoxForm(context.dom, _solidLogic.solidLogicSingleton.store, "Public link to this ".concat(context.noun), null, statements, form, index));
8366
- }
8371
+ if (context.me) {
8372
+ _context7.next = 9;
8373
+ break;
8374
+ }
8367
8375
 
8368
- if (context.index && context.index["private"] && context.index["private"].length > 0) {
8369
- index = context.index["private"][0];
8370
- statements = registrationStatements(index);
8371
- tbody.children[1].appendChild(widgets.buildCheckBoxForm(context.dom, _solidLogic.solidLogicSingleton.store, "Personal note of this ".concat(context.noun), null, statements, form, index));
8372
- }
8376
+ box.innerHTML = '<p style="margin:2em;">(Log in to save a link to this)</p>';
8377
+ return _context7.abrupt("return", context);
8373
8378
 
8374
- return context;
8375
- }, function (e) {
8376
- var msg;
8379
+ case 9:
8380
+ _context7.prev = 9;
8381
+ _context7.next = 12;
8382
+ return (0, _solidLogic.ensureTypeIndexes)(context);
8377
8383
 
8378
- if (context.div && context.preferencesFileError) {
8379
- msg = '(Preferences not available)';
8380
- context.div.appendChild(dom.createElement('p')).textContent = msg;
8381
- } else if (context.div) {
8382
- msg = "registrationControl: Type indexes not available: ".concat(e);
8383
- context.div.appendChild(widgets.errorMessageBlock(context.dom, e));
8384
- }
8384
+ case 12:
8385
+ context2 = _context7.sent;
8386
+ _context7.next = 19;
8387
+ break;
8385
8388
 
8386
- debug.log(msg);
8387
- })["catch"](function (e) {
8388
- var msg = "registrationControl: Error making panel: ".concat(e);
8389
+ case 15:
8390
+ _context7.prev = 15;
8391
+ _context7.t0 = _context7["catch"](9);
8392
+
8393
+ if (context.div && context.preferencesFileError) {
8394
+ msg = '(Preferences not available)';
8395
+ context.div.appendChild(dom.createElement('p')).textContent = msg;
8396
+ } else if (context.div) {
8397
+ msg = "registrationControl: Type indexes not available: ".concat(_context7.t0);
8398
+ context.div.appendChild(widgets.errorMessageBlock(context.dom, _context7.t0));
8399
+ }
8389
8400
 
8390
- if (context.div) {
8391
- context.div.appendChild(widgets.errorMessageBlock(context.dom, e));
8392
- }
8401
+ debug.log(msg);
8393
8402
 
8394
- debug.log(msg);
8395
- });
8396
- }
8397
- /**
8398
- * UI to List at all registered things
8399
- */
8403
+ case 19:
8404
+ box.innerHTML = '<table><tbody><tr></tr><tr></tr></tbody></table>'; // tbody will be inserted anyway
8400
8405
 
8406
+ box.setAttribute('style', 'font-size: 120%; text-align: right; padding: 1em; border: solid gray 0.05em;');
8407
+ tbody = box.children[0].children[0];
8408
+ form = new _rdflib.BlankNode(); // @@ say for now
8401
8409
 
8402
- function registrationList(context, options) {
8403
- var dom = context.dom;
8404
- var div = context.div;
8405
- var box = dom.createElement('div');
8406
- div.appendChild(box);
8407
- return (0, _solidLogic.ensureTypeIndexes)(context).then(function (_indexes) {
8408
- box.innerHTML = '<table><tbody></tbody></table>'; // tbody will be inserted anyway
8409
-
8410
- box.setAttribute('style', 'font-size: 120%; text-align: right; padding: 1em; border: solid #eee 0.5em;');
8411
- var table = box.firstChild;
8412
- var ix = [];
8413
- var sts = [];
8414
- var vs = ['private', 'public'];
8415
- vs.forEach(function (visibility) {
8416
- if (context.index && options[visibility]) {
8417
- ix = ix.concat(context.index[visibility][0]);
8418
- sts = sts.concat(_solidLogic.solidLogicSingleton.store.statementsMatching(undefined, ns.solid('instance'), undefined, context.index[visibility][0]));
8419
- }
8420
- });
8410
+ registrationStatements = function registrationStatements(index) {
8411
+ var registrations = _solidLogic.solidLogicSingleton.getRegistrations(instance, theClass);
8421
8412
 
8422
- var _loop = function _loop(i) {
8423
- var statement = sts[i];
8413
+ var reg = registrations.length ? registrations[0] : widgets.newThing(index);
8414
+ return [(0, _rdflib.st)(reg, ns.solid('instance'), instance, index), (0, _rdflib.st)(reg, ns.solid('forClass'), theClass, index)];
8415
+ };
8424
8416
 
8425
- if (options.type) {
8426
- // now check terms:forClass
8427
- if (!_solidLogic.solidLogicSingleton.store.holds(statement.subject, ns.solid('forClass'), options.type, statement.why)) {
8428
- return "continue"; // skip irrelevant ones
8429
- }
8430
- } // const cla = statement.subject
8417
+ try {
8418
+ if (context2.index && context2.index["public"] && context2.index["public"].length > 0) {
8419
+ index = context2.index["public"][0];
8420
+ statements = registrationStatements(index);
8421
+ tbody.children[0].appendChild(widgets.buildCheckboxForm(context2.dom, _solidLogic.solidLogicSingleton.store, "Public link to this ".concat(context2.noun), null, statements, form, index));
8422
+ }
8431
8423
 
8424
+ if (context2.index && context2.index["private"] && context2.index["private"].length > 0) {
8425
+ index = context2.index["private"][0];
8426
+ statements = registrationStatements(index);
8427
+ tbody.children[1].appendChild(widgets.buildCheckboxForm(context2.dom, _solidLogic.solidLogicSingleton.store, "Personal note of this ".concat(context2.noun), null, statements, form, index));
8428
+ }
8429
+ } catch (e) {
8430
+ _msg = "registrationControl: Error making panel: ".concat(e);
8432
8431
 
8433
- var inst = statement.object;
8434
- table.appendChild(widgets.personTR(dom, ns.solid('instance'), inst, {
8435
- deleteFunction: function deleteFunction(_x) {
8436
- if (!_solidLogic.solidLogicSingleton.store.updater) {
8437
- throw new Error('Cannot delete this, store has no updater');
8438
- }
8432
+ if (context.div) {
8433
+ context.div.appendChild(widgets.errorMessageBlock(context.dom, e));
8434
+ }
8439
8435
 
8440
- _solidLogic.solidLogicSingleton.store.updater.update([statement], [], function (uri, ok, errorBody) {
8441
- if (ok) {
8442
- debug.log("Removed from index: ".concat(statement.subject));
8443
- } else {
8444
- debug.log("Error: Cannot delete ".concat(statement, ": ").concat(errorBody));
8436
+ debug.log(_msg);
8445
8437
  }
8446
- });
8438
+
8439
+ return _context7.abrupt("return", context2);
8440
+
8441
+ case 26:
8442
+ case "end":
8443
+ return _context7.stop();
8447
8444
  }
8448
- }));
8449
- };
8445
+ }
8446
+ }, _callee7, null, [[9, 15]]);
8447
+ }));
8448
+ return _registrationControl.apply(this, arguments);
8449
+ }
8450
8450
 
8451
- for (var i = 0; i < sts.length; i++) {
8452
- var _ret = _loop(i);
8451
+ function registrationList(_x10, _x11) {
8452
+ return _registrationList.apply(this, arguments);
8453
+ }
8453
8454
 
8454
- if (_ret === "continue") continue;
8455
- } // registrationList
8455
+ function _registrationList() {
8456
+ _registrationList = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee8(context0, options) {
8457
+ var dom, div, box;
8458
+ return _regenerator["default"].wrap(function _callee8$(_context8) {
8459
+ while (1) {
8460
+ switch (_context8.prev = _context8.next) {
8461
+ case 0:
8462
+ dom = context0.dom;
8463
+ div = context0.div;
8464
+ box = dom.createElement('div');
8465
+ div.appendChild(box);
8466
+ context0.me = _solidLogic.authn.currentUser(); // @@
8467
+
8468
+ if (context0.me) {
8469
+ _context8.next = 8;
8470
+ break;
8471
+ }
8456
8472
 
8457
- /*
8458
- //const containers = solidLogicSingleton.store.each(theClass, ns.solid('instanceContainer'));
8459
- if (containers.length) {
8460
- fetcher.load(containers).then(function(xhrs){
8461
- for (const i=0; i<containers.length; i++) {
8462
- const cont = containers[i];
8463
- instances = instances.concat(solidLogicSingleton.store.each(cont, ns.ldp('contains')));
8464
- }
8465
- });
8466
- }
8467
- */
8473
+ box.innerHTML = '<p style="margin:2em;">(Log in list your stuff)</p>';
8474
+ return _context8.abrupt("return", context0);
8468
8475
 
8476
+ case 8:
8477
+ return _context8.abrupt("return", (0, _solidLogic.ensureTypeIndexes)(context0).then(function (context) {
8478
+ box.innerHTML = '<table><tbody></tbody></table>'; // tbody will be inserted anyway
8479
+
8480
+ // tbody will be inserted anyway
8481
+ box.setAttribute('style', 'font-size: 120%; text-align: right; padding: 1em; border: solid #eee 0.5em;');
8482
+ var table = box.firstChild;
8483
+ var ix = [];
8484
+ var sts = [];
8485
+ var vs = ['private', 'public'];
8486
+ vs.forEach(function (visibility) {
8487
+ if (context.index && context.index[visibility].length > 0 && options[visibility]) {
8488
+ ix = ix.concat(context.index[visibility][0]);
8489
+ sts = sts.concat(_solidLogic.solidLogicSingleton.store.statementsMatching(undefined, ns.solid('instance'), undefined, context.index[visibility][0]));
8490
+ }
8491
+ });
8469
8492
 
8470
- return context;
8471
- });
8493
+ var _loop = function _loop(i) {
8494
+ var statement = sts[i];
8495
+
8496
+ if (options.type) {
8497
+ // now check terms:forClass
8498
+ if (!_solidLogic.solidLogicSingleton.store.holds(statement.subject, ns.solid('forClass'), options.type, statement.why)) {
8499
+ return "continue"; // skip irrelevant ones
8500
+ }
8501
+ } // const cla = statement.subject
8502
+
8503
+
8504
+ // const cla = statement.subject
8505
+ var inst = statement.object;
8506
+ table.appendChild(widgets.personTR(dom, ns.solid('instance'), inst, {
8507
+ deleteFunction: function deleteFunction(_x) {
8508
+ if (!_solidLogic.solidLogicSingleton.store.updater) {
8509
+ throw new Error('Cannot delete this, store has no updater');
8510
+ }
8511
+
8512
+ _solidLogic.solidLogicSingleton.store.updater.update([statement], [], function (uri, ok, errorBody) {
8513
+ if (ok) {
8514
+ debug.log("Removed from index: ".concat(statement.subject));
8515
+ } else {
8516
+ debug.log("Error: Cannot delete ".concat(statement, ": ").concat(errorBody));
8517
+ }
8518
+ });
8519
+ }
8520
+ }));
8521
+ };
8522
+
8523
+ for (var i = 0; i < sts.length; i++) {
8524
+ var _ret = _loop(i);
8525
+
8526
+ if (_ret === "continue") continue;
8527
+ } // registrationList
8528
+
8529
+ /*
8530
+ //const containers = solidLogicSingleton.store.each(theClass, ns.solid('instanceContainer'));
8531
+ if (containers.length) {
8532
+ fetcher.load(containers).then(function(xhrs){
8533
+ for (const i=0; i<containers.length; i++) {
8534
+ const cont = containers[i];
8535
+ instances = instances.concat(solidLogicSingleton.store.each(cont, ns.ldp('contains')));
8536
+ }
8537
+ });
8538
+ }
8539
+ */
8540
+
8541
+
8542
+ // registrationList
8543
+
8544
+ /*
8545
+ //const containers = solidLogicSingleton.store.each(theClass, ns.solid('instanceContainer'));
8546
+ if (containers.length) {
8547
+ fetcher.load(containers).then(function(xhrs){
8548
+ for (const i=0; i<containers.length; i++) {
8549
+ const cont = containers[i];
8550
+ instances = instances.concat(solidLogicSingleton.store.each(cont, ns.ldp('contains')));
8551
+ }
8552
+ });
8553
+ }
8554
+ */
8555
+ return context;
8556
+ }));
8557
+
8558
+ case 9:
8559
+ case "end":
8560
+ return _context8.stop();
8561
+ }
8562
+ }
8563
+ }, _callee8);
8564
+ }));
8565
+ return _registrationList.apply(this, arguments);
8472
8566
  }
8473
8567
 
8474
8568
  function getDefaultSignInButtonStyle() {
@@ -8623,7 +8717,7 @@ function renderSignInPopup(dom) {
8623
8717
  }, _callee, null, [[0, 8]]);
8624
8718
  }));
8625
8719
 
8626
- return function loginToIssuer(_x7) {
8720
+ return function loginToIssuer(_x12) {
8627
8721
  return _ref.apply(this, arguments);
8628
8722
  };
8629
8723
  }();
@@ -8910,7 +9004,7 @@ function selectWorkspace(dom, appDetails, callbackWS) {
8910
9004
 
8911
9005
  function displayOptions(context) {
8912
9006
  // console.log('displayOptions!', context)
8913
- function makeNewWorkspace(_x8) {
9007
+ function makeNewWorkspace(_x13) {
8914
9008
  return _makeNewWorkspace.apply(this, arguments);
8915
9009
  } // const status = ''
8916
9010
 
@@ -9179,77 +9273,77 @@ function getUserRoles() {
9179
9273
 
9180
9274
 
9181
9275
  function _getUserRoles() {
9182
- _getUserRoles = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee7() {
9276
+ _getUserRoles = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee9() {
9183
9277
  var _yield$ensureLoadedPr, me, preferencesFile, preferencesFileError;
9184
9278
 
9185
- return _regenerator["default"].wrap(function _callee7$(_context7) {
9279
+ return _regenerator["default"].wrap(function _callee9$(_context9) {
9186
9280
  while (1) {
9187
- switch (_context7.prev = _context7.next) {
9281
+ switch (_context9.prev = _context9.next) {
9188
9282
  case 0:
9189
- _context7.prev = 0;
9190
- _context7.next = 3;
9283
+ _context9.prev = 0;
9284
+ _context9.next = 3;
9191
9285
  return ensureLoadedPreferences({});
9192
9286
 
9193
9287
  case 3:
9194
- _yield$ensureLoadedPr = _context7.sent;
9288
+ _yield$ensureLoadedPr = _context9.sent;
9195
9289
  me = _yield$ensureLoadedPr.me;
9196
9290
  preferencesFile = _yield$ensureLoadedPr.preferencesFile;
9197
9291
  preferencesFileError = _yield$ensureLoadedPr.preferencesFileError;
9198
9292
 
9199
9293
  if (!(!preferencesFile || preferencesFileError)) {
9200
- _context7.next = 9;
9294
+ _context9.next = 9;
9201
9295
  break;
9202
9296
  }
9203
9297
 
9204
9298
  throw new Error(preferencesFileError);
9205
9299
 
9206
9300
  case 9:
9207
- return _context7.abrupt("return", _solidLogic.solidLogicSingleton.store.each(me, ns.rdf('type'), null, preferencesFile.doc()));
9301
+ return _context9.abrupt("return", _solidLogic.solidLogicSingleton.store.each(me, ns.rdf('type'), null, preferencesFile.doc()));
9208
9302
 
9209
9303
  case 12:
9210
- _context7.prev = 12;
9211
- _context7.t0 = _context7["catch"](0);
9212
- debug.warn('Unable to fetch your preferences - this was the error: ', _context7.t0);
9304
+ _context9.prev = 12;
9305
+ _context9.t0 = _context9["catch"](0);
9306
+ debug.warn('Unable to fetch your preferences - this was the error: ', _context9.t0);
9213
9307
 
9214
9308
  case 15:
9215
- return _context7.abrupt("return", []);
9309
+ return _context9.abrupt("return", []);
9216
9310
 
9217
9311
  case 16:
9218
9312
  case "end":
9219
- return _context7.stop();
9313
+ return _context9.stop();
9220
9314
  }
9221
9315
  }
9222
- }, _callee7, null, [[0, 12]]);
9316
+ }, _callee9, null, [[0, 12]]);
9223
9317
  }));
9224
9318
  return _getUserRoles.apply(this, arguments);
9225
9319
  }
9226
9320
 
9227
- function filterAvailablePanes(_x9) {
9321
+ function filterAvailablePanes(_x14) {
9228
9322
  return _filterAvailablePanes.apply(this, arguments);
9229
9323
  }
9230
9324
 
9231
9325
  function _filterAvailablePanes() {
9232
- _filterAvailablePanes = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee8(panes) {
9326
+ _filterAvailablePanes = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee10(panes) {
9233
9327
  var userRoles;
9234
- return _regenerator["default"].wrap(function _callee8$(_context8) {
9328
+ return _regenerator["default"].wrap(function _callee10$(_context10) {
9235
9329
  while (1) {
9236
- switch (_context8.prev = _context8.next) {
9330
+ switch (_context10.prev = _context10.next) {
9237
9331
  case 0:
9238
- _context8.next = 2;
9332
+ _context10.next = 2;
9239
9333
  return getUserRoles();
9240
9334
 
9241
9335
  case 2:
9242
- userRoles = _context8.sent;
9243
- return _context8.abrupt("return", panes.filter(function (pane) {
9336
+ userRoles = _context10.sent;
9337
+ return _context10.abrupt("return", panes.filter(function (pane) {
9244
9338
  return isMatchingAudience(pane, userRoles);
9245
9339
  }));
9246
9340
 
9247
9341
  case 4:
9248
9342
  case "end":
9249
- return _context8.stop();
9343
+ return _context10.stop();
9250
9344
  }
9251
9345
  }
9252
- }, _callee8);
9346
+ }, _callee10);
9253
9347
  }));
9254
9348
  return _filterAvailablePanes.apply(this, arguments);
9255
9349
  }
@@ -11986,10 +12080,10 @@ var style = {
11986
12080
  checkboxStyle: 'colour: black; font-size: 100%; padding-left: 0.5 em; padding-right: 0.5 em;',
11987
12081
  checkboxInputStyle: 'font-size: 150%; height: 1.2em; width: 1.2em; background-color: #eef; border-radius:0.2em; margin: 0.1em',
11988
12082
  fieldLabelStyle: 'color: #3B5998; text-decoration: none;',
11989
- formSelectSTyle: 'background-color: #eef; padding: 0.5em; border: .05em solid #88c; border-radius:0.2em; font-size: 100%; margin:0.2em;',
11990
- textInputStyle: 'background-color: #eef; padding: 0.5em; border: .05em solid #88c; border-radius:0.2em; font-size: 100%; margin:0.2em;',
12083
+ formSelectSTyle: 'background-color: #eef; padding: 0.5em; border: .05em solid #88c; border-radius:0.2em; font-size: 100%; margin:0.4em;',
12084
+ textInputStyle: 'background-color: #eef; padding: 0.5em; border: .05em solid #88c; border-radius:0.2em; font-size: 100%; margin:0.4em;',
11991
12085
  textInputStyleUneditable: // Color difference only
11992
- 'background-color: white; padding: 0.5em; border: .05em solid white; border-radius:0.2em; font-size: 100%; margin:0.2em;',
12086
+ 'background-color: white; padding: 0.5em; border: .05em solid white; border-radius:0.2em; font-size: 100%; margin:0.4em;',
11993
12087
  textInputSize: 20,
11994
12088
  // Default text input size in characters roughly
11995
12089
  buttonStyle: 'background-color: #fff; padding: 0.7em; border: .01em solid white; border-radius:0.2em; font-size: 100%; margin: 0.3em;',
@@ -13955,13 +14049,21 @@ function tabWidget(options) {
13955
14049
  orderedSync();
13956
14050
 
13957
14051
  if (!options.startEmpty && tabContainer.children.length && options.selectedTab) {
13958
- var selectedTab = Array.from(tabContainer.children).map(function (tab) {
14052
+ var selectedTab0 = Array.from(tabContainer.children) // Version left for compatability with ??
14053
+ .map(function (tab) {
13959
14054
  return tab.firstChild;
13960
14055
  }).find(function (tab) {
13961
14056
  return tab.dataset.name === options.selectedTab;
13962
14057
  });
13963
- var tab = selectedTab || tabContainer.children[0].firstChild;
13964
- tab.click();
14058
+ var selectedTabURI = options.selectedTab.uri;
14059
+ var selectedTab1 = Array.from(tabContainer.children) // @ts-ignore
14060
+ .find(function (tab) {
14061
+ return tab.subject && tab.subject.uri && tab.subject.uri === selectedTabURI;
14062
+ });
14063
+ var tab = selectedTab1 || selectedTab0 || tabContainer.children[0];
14064
+ var clickMe = tab.firstChild; // @ts-ignore
14065
+
14066
+ if (clickMe) clickMe.click();
13965
14067
  } else if (!options.startEmpty) {
13966
14068
  tabContainer.children[0].firstChild.click(); // Open first tab
13967
14069
  }
@@ -14248,7 +14350,6 @@ function getPod() {
14248
14350
  return (0, _rdflib.sym)(document.location.origin).site();
14249
14351
  }
14250
14352
  /**
14251
- * @ignore exporting this only for the unit test
14252
14353
  */
14253
14354
 
14254
14355
 
@@ -14262,63 +14363,94 @@ function getPodOwner(_x, _x2) {
14262
14363
 
14263
14364
  function _getPodOwner() {
14264
14365
  _getPodOwner = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(pod, store) {
14265
- var podOwner, storageIsListedInPodOwnersProfile;
14366
+ var podOwner, guess;
14266
14367
  return _regenerator["default"].wrap(function _callee$(_context) {
14267
14368
  while (1) {
14268
14369
  switch (_context.prev = _context.next) {
14269
14370
  case 0:
14270
- // @@ TODO: This is given the structure that NSS provides - might need to change for other Pod servers
14271
- podOwner = (0, _rdflib.sym)("".concat(pod.uri, "profile/card#me"));
14272
- _context.prev = 1;
14371
+ _context.prev = 0;
14372
+ // @ts-ignore LiveStore always has fetcher
14373
+ store.fetcher.load(pod);
14374
+ _context.next = 8;
14375
+ break;
14273
14376
 
14274
- if (!store.fetcher) {
14275
- _context.next = 7;
14377
+ case 4:
14378
+ _context.prev = 4;
14379
+ _context.t0 = _context["catch"](0);
14380
+ console.error('Error loading pod ' + pod + ': ' + _context.t0);
14381
+ return _context.abrupt("return", null);
14382
+
14383
+ case 8:
14384
+ if (store.holds(pod, _.ns.rdf('type'), _.ns.space('Storage'), pod)) {
14385
+ _context.next = 11;
14276
14386
  break;
14277
14387
  }
14278
14388
 
14279
- _context.next = 5;
14280
- return store.fetcher.load(podOwner.doc());
14389
+ console.warn('Pod ' + pod + ' does not declare itself as a space:Storage');
14390
+ return _context.abrupt("return", null);
14281
14391
 
14282
- case 5:
14283
- _context.next = 8;
14284
- break;
14392
+ case 11:
14393
+ podOwner = store.any(pod, _.ns.solid('owner'), null, pod) || store.any(null, _.ns.space('storage'), pod, pod);
14285
14394
 
14286
- case 7:
14287
- throw new Error('There was a problem loading the Fetcher');
14395
+ if (!podOwner) {
14396
+ _context.next = 25;
14397
+ break;
14398
+ }
14288
14399
 
14289
- case 8:
14290
- _context.next = 13;
14400
+ _context.prev = 13;
14401
+ // @ts-ignore LiveStore always has fetcher
14402
+ store.fetcher.load(podOwner.doc());
14403
+ _context.next = 21;
14291
14404
  break;
14292
14405
 
14293
- case 10:
14294
- _context.prev = 10;
14295
- _context.t0 = _context["catch"](1);
14296
- throw new Error('Did NOT find pod owners profile at ' + podOwner);
14406
+ case 17:
14407
+ _context.prev = 17;
14408
+ _context.t1 = _context["catch"](13);
14409
+ console.warn('Unable to load profile of pod owner ' + podOwner);
14410
+ return _context.abrupt("return", null);
14297
14411
 
14298
- case 13:
14299
- if (!podOwner) {
14300
- _context.next = 17;
14301
- break;
14412
+ case 21:
14413
+ if (!store.holds(podOwner, _.ns.space('storage'), pod, podOwner.doc())) {
14414
+ console.warn("Pod owner ".concat(podOwner, " does NOT list pod ").concat(pod, " as their storage"));
14302
14415
  }
14303
14416
 
14304
- storageIsListedInPodOwnersProfile = store.holds(podOwner, _.ns.space('storage'), pod, podOwner.doc());
14417
+ return _context.abrupt("return", podOwner);
14418
+
14419
+ case 25:
14420
+ // pod ownder not declared in pod
14421
+ // @@ TODO: This is given the structure that NSS provides
14422
+ // This is a massive guess. For old pods which don't have owner link
14423
+ guess = (0, _rdflib.sym)("".concat(pod.uri, "profile/card#me"));
14424
+ _context.prev = 26;
14425
+ // @ts-ignore LiveStore always has fetcher
14426
+ store.fetcher.load(guess);
14427
+ _context.next = 34;
14428
+ break;
14305
14429
 
14306
- if (storageIsListedInPodOwnersProfile) {
14307
- _context.next = 17;
14430
+ case 30:
14431
+ _context.prev = 30;
14432
+ _context.t2 = _context["catch"](26);
14433
+ console.error('Ooops. Guessed wrong pod owner webid {$guess} : can\'t load it.');
14434
+ return _context.abrupt("return", null);
14435
+
14436
+ case 34:
14437
+ if (!store.holds(guess, _.ns.space('storage'), pod, guess.doc())) {
14438
+ _context.next = 37;
14308
14439
  break;
14309
14440
  }
14310
14441
 
14311
- throw new Error("** Pod owner ".concat(podOwner, " does NOT list pod ").concat(pod, " as storage"));
14442
+ console.warn('Using guessed pod owner webid but it links back.');
14443
+ return _context.abrupt("return", guess);
14312
14444
 
14313
- case 17:
14314
- return _context.abrupt("return", podOwner);
14445
+ case 37:
14446
+ return _context.abrupt("return", null);
14315
14447
 
14316
- case 18:
14448
+ case 38:
14317
14449
  case "end":
14318
14450
  return _context.stop();
14319
14451
  }
14320
14452
  }
14321
- }, _callee, null, [[1, 10]]);
14453
+ }, _callee, null, [[0, 4], [13, 17], [26, 30]]);
14322
14454
  }));
14323
14455
  return _getPodOwner.apply(this, arguments);
14324
14456
  }
@@ -15167,8 +15299,8 @@ Object.defineProperty(exports, "__esModule", {
15167
15299
  });
15168
15300
  exports["default"] = void 0;
15169
15301
  var _default = {
15170
- buildTime: '2022-03-01T16:32:34Z',
15171
- commit: 'c89d416d05e0e4da563754609e155cfead5d3e29',
15302
+ buildTime: '2022-03-23T16:34:55Z',
15303
+ commit: 'd0dfe92f152c0f930b4bf817069f14679ba8d4e6',
15172
15304
  npmInfo: {
15173
15305
  'solid-ui': '2.4.18',
15174
15306
  npm: '6.14.16',
@@ -17091,6 +17223,12 @@ Object.defineProperty(exports, "__esModule", {
17091
17223
  value: true
17092
17224
  });
17093
17225
  exports.appendForm = appendForm;
17226
+ Object.defineProperty(exports, "basicField", {
17227
+ enumerable: true,
17228
+ get: function get() {
17229
+ return _basic.basicField;
17230
+ }
17231
+ });
17094
17232
  exports.buildCheckboxForm = buildCheckboxForm;
17095
17233
  exports.editFormButton = editFormButton;
17096
17234
  Object.defineProperty(exports, "field", {
@@ -17099,14 +17237,24 @@ Object.defineProperty(exports, "field", {
17099
17237
  return _fieldFunction.field;
17100
17238
  }
17101
17239
  });
17102
- exports.fieldLabel = fieldLabel;
17240
+ Object.defineProperty(exports, "fieldLabel", {
17241
+ enumerable: true,
17242
+ get: function get() {
17243
+ return _basic.fieldLabel;
17244
+ }
17245
+ });
17103
17246
  Object.defineProperty(exports, "fieldParams", {
17104
17247
  enumerable: true,
17105
17248
  get: function get() {
17106
17249
  return _fieldParams.fieldParams;
17107
17250
  }
17108
17251
  });
17109
- exports.fieldStore = fieldStore;
17252
+ Object.defineProperty(exports, "fieldStore", {
17253
+ enumerable: true,
17254
+ get: function get() {
17255
+ return _basic.fieldStore;
17256
+ }
17257
+ });
17110
17258
  exports.findClosest = findClosest;
17111
17259
  exports.formsFor = formsFor;
17112
17260
  exports.makeDescription = makeDescription;
@@ -17117,6 +17265,12 @@ exports.newButton = newButton;
17117
17265
  exports.newThing = newThing;
17118
17266
  exports.promptForNew = promptForNew;
17119
17267
  exports.propertiesForClass = propertiesForClass;
17268
+ Object.defineProperty(exports, "renderNameValuePair", {
17269
+ enumerable: true,
17270
+ get: function get() {
17271
+ return _basic.renderNameValuePair;
17272
+ }
17273
+ });
17120
17274
  exports.sortByLabel = sortByLabel;
17121
17275
  exports.sortBySequence = sortBySequence;
17122
17276
 
@@ -17989,8 +18143,8 @@ _fieldFunction.field[ns.ui('MultiLineTextField').uri] = function (dom, container
17989
18143
  var left = box.appendChild(dom.createElement('div'));
17990
18144
  left.style.width = style.formFieldNameBoxWidth;
17991
18145
  var right = box.appendChild(dom.createElement('div'));
17992
- left.appendChild(fieldLabel(dom, property, form));
17993
- dataDoc = fieldStore(subject, property, dataDoc);
18146
+ left.appendChild((0, _basic.fieldLabel)(dom, property, form));
18147
+ dataDoc = (0, _basic.fieldStore)(subject, property, dataDoc);
17994
18148
  var text = kb.anyJS(subject, property, null, dataDoc) || '';
17995
18149
  var editable = kb.updater.editable(dataDoc.uri);
17996
18150
  var suppressEmptyUneditable = form && kb.anyJS(form, ns.ui('suppressEmptyUneditable'), null, formDoc);
@@ -18024,7 +18178,7 @@ function booleanField(dom, container, already, subject, form, dataDoc, callbackF
18024
18178
  var lab = kb.any(form, ui('label'));
18025
18179
  if (!lab) lab = utils.label(property, true); // Init capital
18026
18180
 
18027
- dataDoc = fieldStore(subject, property, dataDoc);
18181
+ dataDoc = (0, _basic.fieldStore)(subject, property, dataDoc);
18028
18182
  var state = kb.any(subject, property);
18029
18183
 
18030
18184
  if (state === undefined) {
@@ -18107,7 +18261,7 @@ _fieldFunction.field[ns.ui('Choice').uri] = function (dom, container, already, s
18107
18261
  return box.appendChild((0, _error.errorMessageBlock)(dom, 'No property for Choice: ' + form));
18108
18262
  }
18109
18263
 
18110
- lhs.appendChild(fieldLabel(dom, property, form));
18264
+ lhs.appendChild((0, _basic.fieldLabel)(dom, property, form));
18111
18265
  var from = kb.any(form, ui('from'));
18112
18266
 
18113
18267
  if (!from) {
@@ -18824,7 +18978,7 @@ function makeSelectForNestedCategory(dom, kb, subject, category, dataDoc, callba
18824
18978
 
18825
18979
  function buildCheckboxForm(dom, kb, lab, del, ins, form, dataDoc, tristate) {
18826
18980
  var box = dom.createElement('div');
18827
- var rhs = (0, _basic.renderNameValuePair)(dom, kb, box, form);
18981
+ var rhs = (0, _basic.renderNameValuePair)(dom, kb, box, form, lab);
18828
18982
  var editable = kb.updater.editable(dataDoc.uri);
18829
18983
  var input = dom.createElement('button');
18830
18984
  var colorCarrier = input;
@@ -18923,33 +19077,34 @@ function buildCheckboxForm(dom, kb, lab, del, ins, form, dataDoc, tristate) {
18923
19077
  input.addEventListener('click', boxHandler, false);
18924
19078
  return box;
18925
19079
  }
18926
-
18927
- function fieldLabel(dom, property, form) {
18928
- var lab = kb.any(form, ns.ui('label'));
18929
- if (!lab) lab = utils.label(property, true); // Init capital
18930
-
19080
+ /*
19081
+ export function fieldLabel (dom, property, form) {
19082
+ let lab = kb.any(form, ns.ui('label'))
19083
+ if (!lab) lab = utils.label(property, true) // Init capital
18931
19084
  if (property === undefined) {
18932
- return dom.createTextNode('@@Internal error: undefined property');
19085
+ return dom.createTextNode('@@Internal error: undefined property')
18933
19086
  }
18934
-
18935
- var anchor = dom.createElement('a');
18936
- if (property.uri) anchor.setAttribute('href', property.uri);
18937
- anchor.setAttribute('style', style.fieldLabelStyle); // Not too blue and no underline
18938
-
18939
- anchor.textContent = lab;
18940
- return anchor;
19087
+ const anchor = dom.createElement('a')
19088
+ if (property.uri) anchor.setAttribute('href', property.uri)
19089
+ anchor.setAttribute('style', style.fieldLabelStyle) // Not too blue and no underline
19090
+ anchor.textContent = lab
19091
+ return anchor
18941
19092
  }
18942
19093
 
18943
- function fieldStore(subject, predicate, def) {
18944
- var sts = kb.statementsMatching(subject, predicate);
18945
- if (sts.length === 0) return def; // can used default as no data yet
18946
-
18947
- if (sts.length > 0 && sts[0].why.uri && kb.updater.editable(sts[0].why.uri)) {
18948
- return kb.sym(sts[0].why.uri);
19094
+ export function fieldStore (subject, predicate, def) {
19095
+ const sts = kb.statementsMatching(subject, predicate)
19096
+ if (sts.length === 0) return def // can used default as no data yet
19097
+ if (
19098
+ sts.length > 0 &&
19099
+ sts[0].why.uri &&
19100
+ kb.updater.editable(sts[0].why.uri)
19101
+ ) {
19102
+ return kb.sym(sts[0].why.uri)
18949
19103
  }
18950
-
18951
- return def;
19104
+ return def
18952
19105
  }
19106
+ */
19107
+
18953
19108
  /** Mint local ID using timestamp
18954
19109
  * @param {NamedNode} doc - the document in which the ID is to be generated
18955
19110
  */
@@ -21285,8 +21440,8 @@ var store = _solidLogic.solidLogicSingleton.store;
21285
21440
  /* Style and create a name, value pair
21286
21441
  */
21287
21442
 
21288
- function renderNameValuePair(dom, kb, box, form) {
21289
- var property = kb.any(form, ns.ui('property'));
21443
+ function renderNameValuePair(dom, kb, box, form, label) {
21444
+ // const property = kb.any(form, ns.ui('property'))
21290
21445
  box.style.display = 'flex';
21291
21446
  box.style.flexDirection = 'row';
21292
21447
  var lhs = box.appendChild(dom.createElement('div'));
@@ -21296,12 +21451,14 @@ function renderNameValuePair(dom, kb, box, form) {
21296
21451
  lhs.setAttribute('style', _style.formFieldNameBoxStyle);
21297
21452
  rhs.setAttribute('class', 'formFieldValue');
21298
21453
 
21299
- if (!property) {
21454
+ if (label) {
21455
+ lhs.appendChild(dom.createTextNode(label));
21456
+ } else if (kb.any(form, ns.ui('property'))) {
21300
21457
  // Assume more space for error on right
21301
- rhs.appendChild((0, _error.errorMessageBlock)(dom, 'No property given for form field: ' + form));
21302
- lhs.appendChild(dom.createTextNode('???'));
21458
+ lhs.appendChild(fieldLabel(dom, kb.any(form, ns.ui('property')), form));
21303
21459
  } else {
21304
- lhs.appendChild(fieldLabel(dom, property, form));
21460
+ rhs.appendChild((0, _error.errorMessageBlock)(dom, 'No property or label given for form field: ' + form));
21461
+ lhs.appendChild(dom.createTextNode('???'));
21305
21462
  }
21306
21463
 
21307
21464
  return rhs;