solid-ui 3.0.4-822a480 → 3.0.4-8c04218

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/solid-ui.js CHANGED
@@ -8264,31 +8264,9 @@ field[src_ns.ui('Classifier').uri] = function (dom, container, already, subject,
8264
8264
  if (!ok) return callbackFunction(ok, body);
8265
8265
  return callbackFunction(ok, body);
8266
8266
  };
8267
- // Create container for label and select
8268
- var outerBox = dom.createElement('div');
8269
- outerBox.setAttribute('class', 'classifierBox');
8270
- // Render label
8271
- var labelDiv = dom.createElement('div');
8272
- labelDiv.setAttribute('class', 'formFieldName classifierBox-label');
8273
- // Use fieldLabel to render ui:label if present
8274
- labelDiv.appendChild(fieldLabel(dom, category, form));
8275
- outerBox.appendChild(labelDiv);
8276
- // Render select
8277
- var selectBox = dom.createElement('div');
8278
- selectBox.setAttribute('class', 'formFieldValue classifierBox-selectBox');
8279
- var selectElement = makeSelectForNestedCategory(dom, kb, subject, category, dataDoc, checkOptions);
8280
- // Set readonly if not editable
8281
- if (selectElement && selectElement.querySelector && selectElement.querySelector('select')) {
8282
- var select = selectElement.querySelector('select');
8283
- if (select && !kb.updater.editable(dataDoc.uri)) {
8284
- select.readOnly = true;
8285
- select.style = style.textInputStyleUneditable;
8286
- }
8287
- }
8288
- selectBox.appendChild(selectElement);
8289
- outerBox.appendChild(selectBox);
8290
- if (container) container.appendChild(outerBox);
8291
- return outerBox;
8267
+ var box = makeSelectForNestedCategory(dom, kb, subject, category, dataDoc, checkOptions);
8268
+ if (container) container.appendChild(box);
8269
+ return box;
8292
8270
  };
8293
8271
 
8294
8272
  /** Choice field
@@ -9544,6 +9522,96 @@ var _solidLogicSingleton$2 = external_SolidLogic_.solidLogicSingleton.typeIndex,
9544
9522
  loadAllTypeIndexes = _solidLogicSingleton$2.loadAllTypeIndexes,
9545
9523
  getScopedAppsFromIndex = _solidLogicSingleton$2.getScopedAppsFromIndex,
9546
9524
  deleteTypeIndexRegistration = _solidLogicSingleton$2.deleteTypeIndexRegistration;
9525
+ function formatDynamicError(error, contextLabel) {
9526
+ var e = error;
9527
+ var name = (e === null || e === void 0 ? void 0 : e.name) || 'Error';
9528
+ var status = typeof (e === null || e === void 0 ? void 0 : e.status) === 'number' ? " (HTTP ".concat(e.status, ")") : '';
9529
+ var message = e !== null && e !== void 0 && e.message ? String(e.message) : typeof error === 'string' ? error : 'No additional details provided';
9530
+ return "".concat(contextLabel, ": ").concat(name).concat(status, " - ").concat(message);
9531
+ }
9532
+ function guessPreferencesFileUri(me) {
9533
+ return me.uri.replace('/profile/', '/').replace('/public/', '/').split('/').slice(0, -1).join('/') + '/Settings/Preferences.ttl';
9534
+ }
9535
+ function getMissingPreferencesFileUri(context, err) {
9536
+ var _response;
9537
+ var responseUrl = err === null || err === void 0 || (_response = err.response) === null || _response === void 0 ? void 0 : _response.url;
9538
+ if (typeof responseUrl === 'string' && responseUrl) {
9539
+ return responseUrl;
9540
+ }
9541
+ if (context.me) {
9542
+ var pointer = login_store.any(context.me, src_ns.space('preferencesFile'), undefined, context.me.doc ? context.me.doc() : undefined);
9543
+ if (pointer !== null && pointer !== void 0 && pointer.uri) {
9544
+ return pointer.uri;
9545
+ }
9546
+ return guessPreferencesFileUri(context.me);
9547
+ }
9548
+ return null;
9549
+ }
9550
+ function createPreferencesFile(_x, _x2) {
9551
+ return _createPreferencesFile.apply(this, arguments);
9552
+ }
9553
+ function _createPreferencesFile() {
9554
+ _createPreferencesFile = asyncToGenerator_asyncToGenerator(/*#__PURE__*/regenerator_default().mark(function _callee4(context, uri) {
9555
+ var initialData;
9556
+ return regenerator_default().wrap(function (_context4) {
9557
+ while (1) switch (_context4.prev = _context4.next) {
9558
+ case 0:
9559
+ if (login_store.fetcher) {
9560
+ _context4.next = 1;
9561
+ break;
9562
+ }
9563
+ throw new Error('Cannot create preferences file: store has no fetcher');
9564
+ case 1:
9565
+ initialData = '# Preferences file created by solid-ui\n';
9566
+ _context4.next = 2;
9567
+ return login_store.fetcher.webOperation('PUT', uri, {
9568
+ data: initialData,
9569
+ contentType: 'text/turtle'
9570
+ });
9571
+ case 2:
9572
+ if (context.me) {
9573
+ _context4.next = 3;
9574
+ break;
9575
+ }
9576
+ throw new Error('Cannot reload preferences file: no logged-in WebID');
9577
+ case 3:
9578
+ _context4.next = 4;
9579
+ return loadPreferences(context.me);
9580
+ case 4:
9581
+ context.preferencesFile = _context4.sent;
9582
+ context.preferencesFileError = undefined;
9583
+ case 5:
9584
+ case "end":
9585
+ return _context4.stop();
9586
+ }
9587
+ }, _callee4);
9588
+ }));
9589
+ return _createPreferencesFile.apply(this, arguments);
9590
+ }
9591
+ function offerCreatePreferencesFile(context, uri, baseMessage) {
9592
+ if (context.div && context.dom) {
9593
+ var box = context.dom.createElement('div');
9594
+ box.appendChild(errorMessageBlock(context.dom, "".concat(baseMessage, " Create it now?")));
9595
+ var createButton = context.dom.createElement('button');
9596
+ createButton.textContent = 'Create preferences file';
9597
+ createButton.setAttribute('style', style.buttonStyle);
9598
+ createButton.addEventListener('click', function () {
9599
+ createButton.disabled = true;
9600
+ createPreferencesFile(context, uri).then(function () {
9601
+ box.appendChild(errorMessageBlock(context.dom, "Preferences file created: ".concat(uri), '#dfd'));
9602
+ })["catch"](function (error) {
9603
+ var message = formatDynamicError(error, 'Failed to create preferences file');
9604
+ box.appendChild(errorMessageBlock(context.dom, message));
9605
+ src_debug/* error */.z3(message);
9606
+ createButton.disabled = false;
9607
+ });
9608
+ });
9609
+ box.appendChild(createButton);
9610
+ context.div.appendChild(box);
9611
+ return;
9612
+ }
9613
+ src_debug/* warn */.R8("".concat(baseMessage, " You can create it at: ").concat(uri));
9614
+ }
9547
9615
 
9548
9616
  /**
9549
9617
  * Resolves with the logged in user's WebID
@@ -9585,7 +9653,7 @@ function ensureLoggedIn(context) {
9585
9653
  * @param context
9586
9654
  */
9587
9655
  // used to be logInLoadPreferences
9588
- function ensureLoadedPreferences(_x) {
9656
+ function ensureLoadedPreferences(_x3) {
9589
9657
  return _ensureLoadedPreferences.apply(this, arguments);
9590
9658
  }
9591
9659
 
@@ -9598,98 +9666,125 @@ function ensureLoadedPreferences(_x) {
9598
9666
  */
9599
9667
  // used to be logInLoadProfile
9600
9668
  function _ensureLoadedPreferences() {
9601
- _ensureLoadedPreferences = asyncToGenerator_asyncToGenerator(/*#__PURE__*/regenerator_default().mark(function _callee4(context) {
9602
- var progressDisplay, preferencesFile, m2, _t4;
9603
- return regenerator_default().wrap(function (_context4) {
9604
- while (1) switch (_context4.prev = _context4.next) {
9669
+ _ensureLoadedPreferences = asyncToGenerator_asyncToGenerator(/*#__PURE__*/regenerator_default().mark(function _callee5(context) {
9670
+ var progressDisplay, preferencesFile, m2, missingPreferencesFileUri, _t4;
9671
+ return regenerator_default().wrap(function (_context5) {
9672
+ while (1) switch (_context5.prev = _context5.next) {
9605
9673
  case 0:
9606
9674
  if (!context.preferencesFile) {
9607
- _context4.next = 1;
9675
+ _context5.next = 1;
9608
9676
  break;
9609
9677
  }
9610
- return _context4.abrupt("return", Promise.resolve(context));
9678
+ return _context5.abrupt("return", Promise.resolve(context));
9611
9679
  case 1:
9612
- _context4.prev = 1;
9613
- _context4.next = 2;
9680
+ _context5.prev = 1;
9681
+ _context5.next = 2;
9614
9682
  return ensureLoadedProfile(context);
9615
9683
  case 2:
9616
- context = _context4.sent;
9617
- _context4.next = 3;
9618
- return loadPreferences(context.me);
9684
+ context = _context5.sent;
9685
+ if (context.me) {
9686
+ _context5.next = 3;
9687
+ break;
9688
+ }
9689
+ context.preferencesFileError = 'Not logged in, so preferences were not loaded.';
9690
+ src_debug/* log */.Rm('not logged in, no preferences loaded');
9691
+ return _context5.abrupt("return", context);
9619
9692
  case 3:
9620
- preferencesFile = _context4.sent;
9693
+ _context5.next = 4;
9694
+ return loadPreferences(context.me);
9695
+ case 4:
9696
+ preferencesFile = _context5.sent;
9621
9697
  if (progressDisplay) {
9622
9698
  progressDisplay.parentNode.removeChild(progressDisplay);
9623
9699
  }
9624
9700
  context.preferencesFile = preferencesFile;
9625
- _context4.next = 11;
9701
+ _context5.next = 13;
9626
9702
  break;
9627
- case 4:
9628
- _context4.prev = 4;
9629
- _t4 = _context4["catch"](1);
9703
+ case 5:
9704
+ _context5.prev = 5;
9705
+ _t4 = _context5["catch"](1);
9630
9706
  if (!(_t4 instanceof external_SolidLogic_.UnauthorizedError)) {
9631
- _context4.next = 5;
9707
+ _context5.next = 6;
9632
9708
  break;
9633
9709
  }
9634
9710
  m2 = 'Oops — you are not authenticated (properly logged in), so SolidOS cannot read your preferences file. Try logging out and then logging back in.';
9711
+ context.preferencesFileError = m2;
9635
9712
  log_alert(m2);
9636
- _context4.next = 11;
9637
- break;
9638
- case 5:
9713
+ return _context5.abrupt("return", context);
9714
+ case 6:
9639
9715
  if (!(_t4 instanceof external_SolidLogic_.CrossOriginForbiddenError)) {
9640
- _context4.next = 6;
9716
+ _context5.next = 7;
9641
9717
  break;
9642
9718
  }
9643
- m2 = "Unauthorized: Assuming preference file blocked for origin ".concat(window.location.origin);
9719
+ m2 = "Blocked by origin: preference file request from ".concat(window.location.origin, " was forbidden. Ensure this app origin is trusted/allowed for your preferences file.");
9644
9720
  context.preferencesFileError = m2;
9645
- return _context4.abrupt("return", context);
9646
- case 6:
9721
+ return _context5.abrupt("return", context);
9722
+ case 7:
9647
9723
  if (!(_t4 instanceof external_SolidLogic_.SameOriginForbiddenError)) {
9648
- _context4.next = 7;
9724
+ _context5.next = 8;
9649
9725
  break;
9650
9726
  }
9651
- m2 = 'You are not authorized to read your preference file. This may be because you are using an untrusted web app.';
9727
+ m2 = 'You are not authorized to read your preference file from this app context.';
9728
+ context.preferencesFileError = m2;
9652
9729
  src_debug/* warn */.R8(m2);
9653
- return _context4.abrupt("return", context);
9654
- case 7:
9730
+ return _context5.abrupt("return", context);
9731
+ case 8:
9655
9732
  if (!(_t4 instanceof external_SolidLogic_.NotEditableError)) {
9656
- _context4.next = 8;
9733
+ _context5.next = 9;
9657
9734
  break;
9658
9735
  }
9659
- m2 = 'You are not authorized to edit your preference file. This may be because you are using an untrusted web app.';
9736
+ m2 = 'You are not authorized to edit your preference file from this app context.';
9737
+ context.preferencesFileError = m2;
9660
9738
  src_debug/* warn */.R8(m2);
9661
- return _context4.abrupt("return", context);
9662
- case 8:
9739
+ return _context5.abrupt("return", context);
9740
+ case 9:
9663
9741
  if (!(_t4 instanceof external_SolidLogic_.WebOperationError)) {
9664
- _context4.next = 9;
9742
+ _context5.next = 10;
9665
9743
  break;
9666
9744
  }
9667
- m2 = 'You are not authorized to edit your preference file. This may be because you are using an untrusted web app.';
9745
+ m2 = formatDynamicError(_t4, 'Preference file web operation failed');
9746
+ context.preferencesFileError = m2;
9668
9747
  src_debug/* warn */.R8(m2);
9669
- _context4.next = 11;
9670
- break;
9671
- case 9:
9748
+ return _context5.abrupt("return", context);
9749
+ case 10:
9672
9750
  if (!(_t4 instanceof external_SolidLogic_.FetchError)) {
9673
- _context4.next = 10;
9751
+ _context5.next = 12;
9674
9752
  break;
9675
9753
  }
9676
- m2 = "Strange: Error ".concat(_t4.status, " trying to read your preference file.").concat(_t4.message);
9677
- log_alert(m2);
9678
- _context4.next = 11;
9679
- break;
9680
- case 10:
9681
- throw new Error("(via loadPrefs) ".concat(_t4));
9754
+ if (!(_t4.status === 404)) {
9755
+ _context5.next = 11;
9756
+ break;
9757
+ }
9758
+ m2 = 'Your preferences file was not found (404). It may not exist yet.';
9759
+ context.preferencesFileError = m2;
9760
+ src_debug/* warn */.R8(m2);
9761
+ missingPreferencesFileUri = getMissingPreferencesFileUri(context, _t4);
9762
+ if (missingPreferencesFileUri) {
9763
+ offerCreatePreferencesFile(context, missingPreferencesFileUri, m2);
9764
+ }
9765
+ return _context5.abrupt("return", context);
9682
9766
  case 11:
9683
- return _context4.abrupt("return", context);
9767
+ m2 = formatDynamicError(_t4, 'Error reading your preferences file');
9768
+ context.preferencesFileError = m2;
9769
+ src_debug/* warn */.R8(m2);
9770
+ log_alert(m2);
9771
+ return _context5.abrupt("return", context);
9684
9772
  case 12:
9773
+ m2 = formatDynamicError(_t4, 'Unexpected error while loading preferences');
9774
+ context.preferencesFileError = m2;
9775
+ src_debug/* error */.z3(m2);
9776
+ return _context5.abrupt("return", context);
9777
+ case 13:
9778
+ return _context5.abrupt("return", context);
9779
+ case 14:
9685
9780
  case "end":
9686
- return _context4.stop();
9781
+ return _context5.stop();
9687
9782
  }
9688
- }, _callee4, null, [[1, 4]]);
9783
+ }, _callee5, null, [[1, 5]]);
9689
9784
  }));
9690
9785
  return _ensureLoadedPreferences.apply(this, arguments);
9691
9786
  }
9692
- function ensureLoadedProfile(_x2) {
9787
+ function ensureLoadedProfile(_x4) {
9693
9788
  return _ensureLoadedProfile.apply(this, arguments);
9694
9789
  }
9695
9790
 
@@ -9699,69 +9794,72 @@ function ensureLoadedProfile(_x2) {
9699
9794
  * leaving the `isPublic` param undefined will bring in community index things, too
9700
9795
  */
9701
9796
  function _ensureLoadedProfile() {
9702
- _ensureLoadedProfile = asyncToGenerator_asyncToGenerator(/*#__PURE__*/regenerator_default().mark(function _callee5(context) {
9703
- var logInContext, _t5;
9704
- return regenerator_default().wrap(function (_context5) {
9705
- while (1) switch (_context5.prev = _context5.next) {
9797
+ _ensureLoadedProfile = asyncToGenerator_asyncToGenerator(/*#__PURE__*/regenerator_default().mark(function _callee6(context) {
9798
+ var logInContext, message, _message, _t5;
9799
+ return regenerator_default().wrap(function (_context6) {
9800
+ while (1) switch (_context6.prev = _context6.next) {
9706
9801
  case 0:
9707
9802
  if (!context.publicProfile) {
9708
- _context5.next = 1;
9803
+ _context6.next = 1;
9709
9804
  break;
9710
9805
  }
9711
- return _context5.abrupt("return", context);
9806
+ return _context6.abrupt("return", context);
9712
9807
  case 1:
9713
- _context5.prev = 1;
9714
- _context5.next = 2;
9808
+ _context6.prev = 1;
9809
+ _context6.next = 2;
9715
9810
  return ensureLoggedIn(context);
9716
9811
  case 2:
9717
- logInContext = _context5.sent;
9812
+ logInContext = _context6.sent;
9718
9813
  if (logInContext.me) {
9719
- _context5.next = 3;
9814
+ _context6.next = 3;
9720
9815
  break;
9721
9816
  }
9722
- throw new Error('Could not log in');
9817
+ message = 'Could not log in; skipping profile load.';
9818
+ src_debug/* log */.Rm(message);
9819
+ throw new Error(message);
9723
9820
  case 3:
9724
- _context5.next = 4;
9821
+ _context6.next = 4;
9725
9822
  return loadProfile(logInContext.me);
9726
9823
  case 4:
9727
- context.publicProfile = _context5.sent;
9728
- _context5.next = 6;
9824
+ context.publicProfile = _context6.sent;
9825
+ _context6.next = 6;
9729
9826
  break;
9730
9827
  case 5:
9731
- _context5.prev = 5;
9732
- _t5 = _context5["catch"](1);
9828
+ _context6.prev = 5;
9829
+ _t5 = _context6["catch"](1);
9830
+ _message = formatDynamicError(_t5, 'Unable to load your profile');
9733
9831
  if (context.div && context.dom) {
9734
- context.div.appendChild(errorMessageBlock(context.dom, _t5.message));
9832
+ context.div.appendChild(errorMessageBlock(context.dom, _message));
9735
9833
  }
9736
- throw new Error("Can't log in: ".concat(_t5));
9834
+ throw new Error(_message);
9737
9835
  case 6:
9738
- return _context5.abrupt("return", context);
9836
+ return _context6.abrupt("return", context);
9739
9837
  case 7:
9740
9838
  case "end":
9741
- return _context5.stop();
9839
+ return _context6.stop();
9742
9840
  }
9743
- }, _callee5, null, [[1, 5]]);
9841
+ }, _callee6, null, [[1, 5]]);
9744
9842
  }));
9745
9843
  return _ensureLoadedProfile.apply(this, arguments);
9746
9844
  }
9747
- function findAppInstances(_x3, _x4, _x5) {
9845
+ function findAppInstances(_x5, _x6, _x7) {
9748
9846
  return _findAppInstances.apply(this, arguments);
9749
9847
  }
9750
9848
  function _findAppInstances() {
9751
- _findAppInstances = asyncToGenerator_asyncToGenerator(/*#__PURE__*/regenerator_default().mark(function _callee6(context, theClass, isPublic) {
9849
+ _findAppInstances = asyncToGenerator_asyncToGenerator(/*#__PURE__*/regenerator_default().mark(function _callee7(context, theClass, isPublic) {
9752
9850
  var items, _t6;
9753
- return regenerator_default().wrap(function (_context6) {
9754
- while (1) switch (_context6.prev = _context6.next) {
9851
+ return regenerator_default().wrap(function (_context7) {
9852
+ while (1) switch (_context7.prev = _context7.next) {
9755
9853
  case 0:
9756
9854
  if (!context.me) {
9757
- _context6.next = 2;
9855
+ _context7.next = 2;
9758
9856
  break;
9759
9857
  }
9760
- _context6.next = 1;
9858
+ _context7.next = 1;
9761
9859
  return getScopedAppInstances(theClass, context.me);
9762
9860
  case 1:
9763
- _t6 = _context6.sent;
9764
- _context6.next = 3;
9861
+ _t6 = _context7.sent;
9862
+ _context7.next = 3;
9765
9863
  break;
9766
9864
  case 2:
9767
9865
  _t6 = [];
@@ -9780,12 +9878,12 @@ function _findAppInstances() {
9780
9878
  context.instances = items.map(function (item) {
9781
9879
  return item.instance;
9782
9880
  });
9783
- return _context6.abrupt("return", context);
9881
+ return _context7.abrupt("return", context);
9784
9882
  case 4:
9785
9883
  case "end":
9786
- return _context6.stop();
9884
+ return _context7.stop();
9787
9885
  }
9788
- }, _callee6);
9886
+ }, _callee7);
9789
9887
  }));
9790
9888
  return _findAppInstances.apply(this, arguments);
9791
9889
  }
@@ -9797,14 +9895,14 @@ function scopeLabel(context, scope) {
9797
9895
  /**
9798
9896
  * UI to control registration of instance
9799
9897
  */
9800
- function registrationControl(_x6, _x7, _x8) {
9898
+ function registrationControl(_x8, _x9, _x0) {
9801
9899
  return _registrationControl.apply(this, arguments);
9802
9900
  }
9803
9901
  function _registrationControl() {
9804
- _registrationControl = asyncToGenerator_asyncToGenerator(/*#__PURE__*/regenerator_default().mark(function _callee7(context, instance, theClass) {
9902
+ _registrationControl = asyncToGenerator_asyncToGenerator(/*#__PURE__*/regenerator_default().mark(function _callee8(context, instance, theClass) {
9805
9903
  var registrationStatements, renderScopeCheckbox, dom, box, me, scopes, msg, tbody, form, _iterator, _step, scope, row, _t7;
9806
- return regenerator_default().wrap(function (_context7) {
9807
- while (1) switch (_context7.prev = _context7.next) {
9904
+ return regenerator_default().wrap(function (_context8) {
9905
+ while (1) switch (_context8.prev = _context8.next) {
9808
9906
  case 0:
9809
9907
  renderScopeCheckbox = function _renderScopeCheckbox(scope) {
9810
9908
  var statements = registrationStatements(scope.index);
@@ -9820,7 +9918,7 @@ function _registrationControl() {
9820
9918
  /// / body of registrationControl
9821
9919
  dom = context.dom;
9822
9920
  if (!(!dom || !context.div)) {
9823
- _context7.next = 1;
9921
+ _context8.next = 1;
9824
9922
  break;
9825
9923
  }
9826
9924
  throw new Error('registrationControl: need dom and div');
@@ -9830,22 +9928,22 @@ function _registrationControl() {
9830
9928
  context.me = external_SolidLogic_.authn.currentUser(); // @@
9831
9929
  me = context.me;
9832
9930
  if (me) {
9833
- _context7.next = 2;
9931
+ _context8.next = 2;
9834
9932
  break;
9835
9933
  }
9836
9934
  box.innerHTML = '<p style="margin:2em;">(Log in to save a link to this)</p>';
9837
- return _context7.abrupt("return", context);
9935
+ return _context8.abrupt("return", context);
9838
9936
  case 2:
9839
- _context7.prev = 2;
9840
- _context7.next = 3;
9937
+ _context8.prev = 2;
9938
+ _context8.next = 3;
9841
9939
  return loadAllTypeIndexes(me);
9842
9940
  case 3:
9843
- scopes = _context7.sent;
9844
- _context7.next = 5;
9941
+ scopes = _context8.sent;
9942
+ _context8.next = 5;
9845
9943
  break;
9846
9944
  case 4:
9847
- _context7.prev = 4;
9848
- _t7 = _context7["catch"](2);
9945
+ _context8.prev = 4;
9946
+ _t7 = _context8["catch"](2);
9849
9947
  if (context.div && context.preferencesFileError) {
9850
9948
  msg = '(Lists of stuff not available)';
9851
9949
  context.div.appendChild(dom.createElement('p')).textContent = msg;
@@ -9854,7 +9952,7 @@ function _registrationControl() {
9854
9952
  context.div.appendChild(errorMessageBlock(context.dom, _t7));
9855
9953
  }
9856
9954
  src_debug/* log */.Rm(msg);
9857
- return _context7.abrupt("return", context);
9955
+ return _context8.abrupt("return", context);
9858
9956
  case 5:
9859
9957
  box.innerHTML = '<table><tbody></tbody></table>'; // tbody will be inserted anyway
9860
9958
  box.setAttribute('style', 'font-size: 120%; text-align: right; padding: 1em; border: solid gray 0.05em;');
@@ -9872,12 +9970,12 @@ function _registrationControl() {
9872
9970
  } finally {
9873
9971
  _iterator.f();
9874
9972
  }
9875
- return _context7.abrupt("return", context);
9973
+ return _context8.abrupt("return", context);
9876
9974
  case 6:
9877
9975
  case "end":
9878
- return _context7.stop();
9976
+ return _context8.stop();
9879
9977
  }
9880
- }, _callee7, null, [[2, 4]]);
9978
+ }, _callee8, null, [[2, 4]]);
9881
9979
  }));
9882
9980
  return _registrationControl.apply(this, arguments);
9883
9981
  }
@@ -9900,7 +9998,7 @@ function renderScopeHeadingRow(context, store, scope) {
9900
9998
  /**
9901
9999
  * UI to List at all registered things
9902
10000
  */
9903
- function registrationList(_x9, _x0) {
10001
+ function registrationList(_x1, _x10) {
9904
10002
  return _registrationList.apply(this, arguments);
9905
10003
  } // registrationList
9906
10004
 
@@ -9914,10 +10012,10 @@ function registrationList(_x9, _x0) {
9914
10012
  * @returns
9915
10013
  */
9916
10014
  function _registrationList() {
9917
- _registrationList = asyncToGenerator_asyncToGenerator(/*#__PURE__*/regenerator_default().mark(function _callee9(context, options) {
10015
+ _registrationList = asyncToGenerator_asyncToGenerator(/*#__PURE__*/regenerator_default().mark(function _callee0(context, options) {
9918
10016
  var dom, div, box, scopes, table, tbody, _iterator2, _step2, scope, headingRow, items, _iterator3, _step3, _loop, _t8, _t9;
9919
- return regenerator_default().wrap(function (_context0) {
9920
- while (1) switch (_context0.prev = _context0.next) {
10017
+ return regenerator_default().wrap(function (_context1) {
10018
+ while (1) switch (_context1.prev = _context1.next) {
9921
10019
  case 0:
9922
10020
  dom = context.dom;
9923
10021
  div = context.div;
@@ -9925,16 +10023,16 @@ function _registrationList() {
9925
10023
  div.appendChild(box);
9926
10024
  context.me = external_SolidLogic_.authn.currentUser(); // @@
9927
10025
  if (context.me) {
9928
- _context0.next = 1;
10026
+ _context1.next = 1;
9929
10027
  break;
9930
10028
  }
9931
10029
  box.innerHTML = '<p style="margin:2em;">(Log in list your stuff)</p>';
9932
- return _context0.abrupt("return", context);
10030
+ return _context1.abrupt("return", context);
9933
10031
  case 1:
9934
- _context0.next = 2;
10032
+ _context1.next = 2;
9935
10033
  return loadAllTypeIndexes(context.me);
9936
10034
  case 2:
9937
- scopes = _context0.sent;
10035
+ scopes = _context1.sent;
9938
10036
  // includes community indexes
9939
10037
 
9940
10038
  // console.log('@@ registrationList ', scopes)
@@ -9943,47 +10041,47 @@ function _registrationList() {
9943
10041
  table = box.firstChild;
9944
10042
  tbody = table.firstChild;
9945
10043
  _iterator2 = login_createForOfIteratorHelper(scopes);
9946
- _context0.prev = 3;
10044
+ _context1.prev = 3;
9947
10045
  _iterator2.s();
9948
10046
  case 4:
9949
10047
  if ((_step2 = _iterator2.n()).done) {
9950
- _context0.next = 13;
10048
+ _context1.next = 13;
9951
10049
  break;
9952
10050
  }
9953
10051
  scope = _step2.value;
9954
10052
  // need some predicate for listing/adding agents
9955
10053
  headingRow = renderScopeHeadingRow(context, login_store, scope);
9956
10054
  tbody.appendChild(headingRow);
9957
- _context0.next = 5;
10055
+ _context1.next = 5;
9958
10056
  return getScopedAppsFromIndex(scope, options.type || null);
9959
10057
  case 5:
9960
- items = _context0.sent;
10058
+ items = _context1.sent;
9961
10059
  // any class
9962
10060
  if (items.length === 0) headingRow.style.display = 'none';
9963
10061
  // console.log(`registrationList: @@ instance items for class ${options.type || 'undefined' }:`, items)
9964
10062
  _iterator3 = login_createForOfIteratorHelper(items);
9965
- _context0.prev = 6;
10063
+ _context1.prev = 6;
9966
10064
  _loop = /*#__PURE__*/regenerator_default().mark(function _loop() {
9967
10065
  var item, row;
9968
- return regenerator_default().wrap(function (_context9) {
9969
- while (1) switch (_context9.prev = _context9.next) {
10066
+ return regenerator_default().wrap(function (_context0) {
10067
+ while (1) switch (_context0.prev = _context0.next) {
9970
10068
  case 0:
9971
10069
  item = _step3.value;
9972
10070
  row = personTR(dom, src_ns.solid('instance'), item.instance, {
9973
10071
  deleteFunction: function () {
9974
- var _deleteFunction = asyncToGenerator_asyncToGenerator(/*#__PURE__*/regenerator_default().mark(function _callee8() {
9975
- return regenerator_default().wrap(function (_context8) {
9976
- while (1) switch (_context8.prev = _context8.next) {
10072
+ var _deleteFunction = asyncToGenerator_asyncToGenerator(/*#__PURE__*/regenerator_default().mark(function _callee9() {
10073
+ return regenerator_default().wrap(function (_context9) {
10074
+ while (1) switch (_context9.prev = _context9.next) {
9977
10075
  case 0:
9978
- _context8.next = 1;
10076
+ _context9.next = 1;
9979
10077
  return deleteTypeIndexRegistration(item);
9980
10078
  case 1:
9981
10079
  tbody.removeChild(row);
9982
10080
  case 2:
9983
10081
  case "end":
9984
- return _context8.stop();
10082
+ return _context9.stop();
9985
10083
  }
9986
- }, _callee8);
10084
+ }, _callee9);
9987
10085
  }));
9988
10086
  function deleteFunction() {
9989
10087
  return _deleteFunction.apply(this, arguments);
@@ -9995,52 +10093,52 @@ function _registrationList() {
9995
10093
  tbody.appendChild(row);
9996
10094
  case 1:
9997
10095
  case "end":
9998
- return _context9.stop();
10096
+ return _context0.stop();
9999
10097
  }
10000
10098
  }, _loop);
10001
10099
  });
10002
10100
  _iterator3.s();
10003
10101
  case 7:
10004
10102
  if ((_step3 = _iterator3.n()).done) {
10005
- _context0.next = 9;
10103
+ _context1.next = 9;
10006
10104
  break;
10007
10105
  }
10008
- return _context0.delegateYield(_loop(), "t0", 8);
10106
+ return _context1.delegateYield(_loop(), "t0", 8);
10009
10107
  case 8:
10010
- _context0.next = 7;
10108
+ _context1.next = 7;
10011
10109
  break;
10012
10110
  case 9:
10013
- _context0.next = 11;
10111
+ _context1.next = 11;
10014
10112
  break;
10015
10113
  case 10:
10016
- _context0.prev = 10;
10017
- _t8 = _context0["catch"](6);
10114
+ _context1.prev = 10;
10115
+ _t8 = _context1["catch"](6);
10018
10116
  _iterator3.e(_t8);
10019
10117
  case 11:
10020
- _context0.prev = 11;
10118
+ _context1.prev = 11;
10021
10119
  _iterator3.f();
10022
- return _context0.finish(11);
10120
+ return _context1.finish(11);
10023
10121
  case 12:
10024
- _context0.next = 4;
10122
+ _context1.next = 4;
10025
10123
  break;
10026
10124
  case 13:
10027
- _context0.next = 15;
10125
+ _context1.next = 15;
10028
10126
  break;
10029
10127
  case 14:
10030
- _context0.prev = 14;
10031
- _t9 = _context0["catch"](3);
10128
+ _context1.prev = 14;
10129
+ _t9 = _context1["catch"](3);
10032
10130
  _iterator2.e(_t9);
10033
10131
  case 15:
10034
- _context0.prev = 15;
10132
+ _context1.prev = 15;
10035
10133
  _iterator2.f();
10036
- return _context0.finish(15);
10134
+ return _context1.finish(15);
10037
10135
  case 16:
10038
- return _context0.abrupt("return", context);
10136
+ return _context1.abrupt("return", context);
10039
10137
  case 17:
10040
10138
  case "end":
10041
- return _context0.stop();
10139
+ return _context1.stop();
10042
10140
  }
10043
- }, _callee9, null, [[3, 14, 15, 16], [6, 10, 11, 12]]);
10141
+ }, _callee0, null, [[3, 14, 15, 16], [6, 10, 11, 12]]);
10044
10142
  }));
10045
10143
  return _registrationList.apply(this, arguments);
10046
10144
  }
@@ -10171,7 +10269,7 @@ function renderSignInPopup(dom) {
10171
10269
  }
10172
10270
  }, _callee, null, [[0, 2]]);
10173
10271
  }));
10174
- return function loginToIssuer(_x1) {
10272
+ return function loginToIssuer(_x11) {
10175
10273
  return _ref.apply(this, arguments);
10176
10274
  };
10177
10275
  }();
@@ -10418,7 +10516,7 @@ function selectWorkspace(dom, appDetails, callbackWS) {
10418
10516
  }
10419
10517
  function displayOptions(context) {
10420
10518
  // console.log('displayOptions!', context)
10421
- function makeNewWorkspace(_x10) {
10519
+ function makeNewWorkspace(_x12) {
10422
10520
  return _makeNewWorkspace.apply(this, arguments);
10423
10521
  } // const status = ''
10424
10522
  function _makeNewWorkspace() {
@@ -10654,60 +10752,67 @@ function getUserRoles() {
10654
10752
  * Filters which panes should be available, based on the result of [[getUserRoles]]
10655
10753
  */
10656
10754
  function _getUserRoles() {
10657
- _getUserRoles = asyncToGenerator_asyncToGenerator(/*#__PURE__*/regenerator_default().mark(function _callee0() {
10658
- var _yield$ensureLoadedPr, me, preferencesFile, preferencesFileError, _t0;
10659
- return regenerator_default().wrap(function (_context1) {
10660
- while (1) switch (_context1.prev = _context1.next) {
10755
+ _getUserRoles = asyncToGenerator_asyncToGenerator(/*#__PURE__*/regenerator_default().mark(function _callee1() {
10756
+ var _yield$ensureLoadedPr, me, preferencesFile, preferencesFileError, authState, _t0;
10757
+ return regenerator_default().wrap(function (_context10) {
10758
+ while (1) switch (_context10.prev = _context10.next) {
10661
10759
  case 0:
10662
- _context1.prev = 0;
10663
- _context1.next = 1;
10760
+ _context10.prev = 0;
10761
+ _context10.next = 1;
10664
10762
  return ensureLoadedPreferences({});
10665
10763
  case 1:
10666
- _yield$ensureLoadedPr = _context1.sent;
10764
+ _yield$ensureLoadedPr = _context10.sent;
10667
10765
  me = _yield$ensureLoadedPr.me;
10668
10766
  preferencesFile = _yield$ensureLoadedPr.preferencesFile;
10669
10767
  preferencesFileError = _yield$ensureLoadedPr.preferencesFileError;
10670
- if (!(!preferencesFile || preferencesFileError)) {
10671
- _context1.next = 2;
10768
+ if (!preferencesFileError) {
10769
+ _context10.next = 2;
10672
10770
  break;
10673
10771
  }
10674
10772
  throw new Error(preferencesFileError);
10675
10773
  case 2:
10676
- return _context1.abrupt("return", external_SolidLogic_.solidLogicSingleton.store.each(me, src_ns.rdf('type'), null, preferencesFile.doc()));
10774
+ if (preferencesFile) {
10775
+ _context10.next = 3;
10776
+ break;
10777
+ }
10778
+ authState = me ? "logged in as ".concat(me.value || me.uri) : 'not logged in';
10779
+ throw new Error("Preferences file unavailable (".concat(authState, ")"));
10677
10780
  case 3:
10678
- _context1.prev = 3;
10679
- _t0 = _context1["catch"](0);
10680
- src_debug/* warn */.R8('Unable to fetch your preferences - this was the error: ', _t0);
10681
- return _context1.abrupt("return", []);
10781
+ return _context10.abrupt("return", external_SolidLogic_.solidLogicSingleton.store.each(me, src_ns.rdf('type'), null, preferencesFile.doc()));
10682
10782
  case 4:
10783
+ _context10.prev = 4;
10784
+ _t0 = _context10["catch"](0);
10785
+ src_debug/* warn */.R8(formatDynamicError(_t0, 'Unable to fetch your preferences'));
10786
+ return _context10.abrupt("return", []);
10787
+ case 5:
10683
10788
  case "end":
10684
- return _context1.stop();
10789
+ return _context10.stop();
10685
10790
  }
10686
- }, _callee0, null, [[0, 3]]);
10791
+ }, _callee1, null, [[0, 4]]);
10687
10792
  }));
10688
10793
  return _getUserRoles.apply(this, arguments);
10689
10794
  }
10690
- function filterAvailablePanes(_x11) {
10795
+ function filterAvailablePanes(_x13) {
10691
10796
  return _filterAvailablePanes.apply(this, arguments);
10692
10797
  }
10693
10798
  function _filterAvailablePanes() {
10694
- _filterAvailablePanes = asyncToGenerator_asyncToGenerator(/*#__PURE__*/regenerator_default().mark(function _callee1(panes) {
10799
+ _filterAvailablePanes = asyncToGenerator_asyncToGenerator(/*#__PURE__*/regenerator_default().mark(function _callee10(panes) {
10695
10800
  var userRoles;
10696
- return regenerator_default().wrap(function (_context10) {
10697
- while (1) switch (_context10.prev = _context10.next) {
10801
+ return regenerator_default().wrap(function (_context11) {
10802
+ while (1) switch (_context11.prev = _context11.next) {
10698
10803
  case 0:
10699
- _context10.next = 1;
10804
+ _context11.next = 1;
10700
10805
  return getUserRoles();
10701
10806
  case 1:
10702
- userRoles = _context10.sent;
10703
- return _context10.abrupt("return", panes.filter(function (pane) {
10807
+ userRoles = _context11.sent;
10808
+ return _context11.abrupt("return", panes.filter(function (pane) {
10704
10809
  return isMatchingAudience(pane, userRoles);
10705
10810
  }));
10706
10811
  case 2:
10707
10812
  case "end":
10708
- return _context10.stop();
10813
+ return _context11.stop();
10709
10814
  }
10710
- }, _callee1);
10815
+ }, _callee10);
10711
10816
  }));
10712
10817
  return _filterAvailablePanes.apply(this, arguments);
10713
10818
  }
@@ -24226,7 +24331,7 @@ function tabWidget(options) {
24226
24331
  _getColors2 = _slicedToArray(_getColors, 2),
24227
24332
  selectedColor = _getColors2[0],
24228
24333
  color = _getColors2[1];
24229
- var bodyMainStyle = "display: grid; width: auto; height: 100%; border: 0.1em; border-style: solid; border-color: ".concat(selectedColor, "; padding: 1em;");
24334
+ var bodyMainStyle = "flex: 2; width: auto; height: 100%; border: 0.1em; border-style: solid; border-color: ".concat(selectedColor, "; padding: 1em;");
24230
24335
  var rootElement = dom.createElement('div'); // 20200117a
24231
24336
 
24232
24337
  rootElement.setAttribute('style', style.tabsRootElement);