solid-ui 2.4.19-6a4efc3e → 2.4.19-72f773b9

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.
Files changed (42) hide show
  1. package/lib/acl/access-groups.d.ts +5 -4
  2. package/lib/acl/access-groups.d.ts.map +1 -1
  3. package/lib/acl/access-groups.js +1 -0
  4. package/lib/acl/access-groups.js.map +1 -1
  5. package/lib/acl/acl-control.d.ts +2 -2
  6. package/lib/acl/acl-control.d.ts.map +1 -1
  7. package/lib/acl/acl-control.js.map +1 -1
  8. package/lib/acl/acl.d.ts +5 -5
  9. package/lib/acl/acl.d.ts.map +1 -1
  10. package/lib/acl/acl.js.map +1 -1
  11. package/lib/footer/index.d.ts +4 -4
  12. package/lib/footer/index.d.ts.map +1 -1
  13. package/lib/footer/index.js.map +1 -1
  14. package/lib/header/styleMap.d.ts +0 -4
  15. package/lib/header/styleMap.d.ts.map +1 -1
  16. package/lib/header/styleMap.js +15 -20
  17. package/lib/header/styleMap.js.map +1 -1
  18. package/lib/login/login.d.ts +4 -1
  19. package/lib/login/login.d.ts.map +1 -1
  20. package/lib/login/login.js +226 -133
  21. package/lib/login/login.js.map +1 -1
  22. package/lib/style.js +3 -3
  23. package/lib/style.js.map +1 -1
  24. package/lib/tabs.d.ts +1 -1
  25. package/lib/tabs.d.ts.map +1 -1
  26. package/lib/tabs.js +11 -3
  27. package/lib/tabs.js.map +1 -1
  28. package/lib/utils/headerFooterHelpers.d.ts +2 -3
  29. package/lib/utils/headerFooterHelpers.d.ts.map +1 -1
  30. package/lib/utils/headerFooterHelpers.js +63 -33
  31. package/lib/utils/headerFooterHelpers.js.map +1 -1
  32. package/lib/versionInfo.js +2 -2
  33. package/lib/versionInfo.js.map +1 -1
  34. package/lib/webpack-bundle.js +438 -275
  35. package/lib/webpack-bundle.js.map +1 -1
  36. package/lib/widgets/forms/basic.d.ts +1 -1
  37. package/lib/widgets/forms/basic.d.ts.map +1 -1
  38. package/lib/widgets/forms/basic.js +8 -6
  39. package/lib/widgets/forms/basic.js.map +1 -1
  40. package/lib/widgets/forms.js +51 -28
  41. package/lib/widgets/forms.js.map +1 -1
  42. package/package.json +1 -5
@@ -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 does not need to be 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);
@@ -7048,17 +7049,17 @@ var styleMap = {
7048
7049
  'header-user-menu__link': {
7049
7050
  background: 'none',
7050
7051
  border: '0',
7051
- color: '#787878',
7052
+ color: 'black',
7052
7053
  cursor: 'pointer',
7053
7054
  display: 'block',
7054
- fontFamily: 'Verdana sans-serif',
7055
+ fontFamily: 'Arial',
7055
7056
  fontSize: '1em',
7056
7057
  textAlign: 'left',
7057
7058
  padding: '1em',
7058
7059
  width: '100%',
7059
7060
  '&:focus, &:hover': {
7060
- // backgroundColor: 'linear-gradient(to right, #7C4DFF 0%, #18A9E6 50%, #01C9EA 100%)'
7061
- backgroundColor: 'rgba(48.6, 30.2, 100, 5%)'
7061
+ backgroundColor: 'linear-gradient(to right, #7C4DFF 0%, #18A9E6 50%, #01C9EA 100%)' // backgroundColor: '#eee'
7062
+
7062
7063
  },
7063
7064
  a: {
7064
7065
  textDecoration: 'none'
@@ -7082,17 +7083,16 @@ var styleMap = {
7082
7083
  'header-user-menu__button': {
7083
7084
  background: 'none',
7084
7085
  border: '0',
7085
- color: '#787878',
7086
+ color: 'black',
7086
7087
  cursor: 'pointer',
7087
7088
  display: 'block',
7088
- fontFamily: 'Verdana sans-serif',
7089
+ fontFamily: 'Arial',
7089
7090
  fontSize: '1em',
7090
7091
  textAlign: 'left',
7091
7092
  padding: '1em',
7092
7093
  width: '100%',
7093
7094
  '&:focus, &:hover': {
7094
- // backgroundColor: 'linear-gradient(to right, #7C4DFF 0%, #18A9E6 50%, #01C9EA 100%)'
7095
- backgroundColor: 'rgba(48.6, 30.2, 100, 5%)'
7095
+ backgroundColor: 'linear-gradient(to right, #7C4DFF 0%, #18A9E6 50%, #01C9EA 100%)'
7096
7096
  }
7097
7097
  },
7098
7098
  'header-user-menu__list': {
@@ -7102,12 +7102,11 @@ var styleMap = {
7102
7102
  },
7103
7103
  'header-user-menu__navigation-menu': {
7104
7104
  background: 'white',
7105
- border: 'solid 1px #C8C8C8',
7105
+ border: 'solid 1px #000000',
7106
7106
  // the color was defined in mashlib as a SASS variable $divider_color
7107
- borderRadius: '0.5rem',
7108
- borderRight: 'solid 1px #C8C8C8',
7107
+ borderRight: '0',
7109
7108
  position: 'absolute',
7110
- right: '0.5em',
7109
+ right: '0',
7111
7110
  top: '60px',
7112
7111
  // defined in mashlib as a SASS variable $icon_size
7113
7112
  width: '200px',
@@ -7117,7 +7116,7 @@ var styleMap = {
7117
7116
  }
7118
7117
  },
7119
7118
  'header-user-menu__list-item': {
7120
- borderBottom: 'solid 1px #D8D8D8',
7119
+ borderBottom: 'solid 1px #000000',
7121
7120
  // the color was defined in mashlib as a SASS variable $divider_color
7122
7121
  '&:last-child': {
7123
7122
  border: '0'
@@ -7133,8 +7132,7 @@ var styleMap = {
7133
7132
  width: '50px'
7134
7133
  },
7135
7134
  'header-banner': {
7136
- border: 'solid 1px #C8C8C8',
7137
- boxShadow: '0px 1px 4px #C8C8C8',
7135
+ boxShadow: '0px 1px 4px #000000',
7138
7136
  // the color was defined in mashlib as a SASS variable $divider_color
7139
7137
  display: 'flex',
7140
7138
  justifyContent: 'space-between',
@@ -7156,16 +7154,14 @@ var styleMap = {
7156
7154
  }
7157
7155
  },
7158
7156
  'header-banner__user-menu': {
7159
- borderLeft: 'solid 1px #C8C8C8',
7157
+ borderLeft: 'solid 1px #000000',
7160
7158
  // the color was defined in mashlib as a SASS variable $divider_color
7161
- marginLeft: 'auto',
7162
- marginRight: '0.5em'
7159
+ marginLeft: 'auto'
7163
7160
  },
7164
7161
  'header-banner__help-menu': {
7165
7162
  borderLeft: 'solid 1px #000000',
7166
7163
  // the color was defined in mashlib as a SASS variable $divider_color
7167
- marginLeft: 'auto',
7168
- marginRight: '0.5em'
7164
+ marginLeft: 'auto'
7169
7165
  },
7170
7166
  'header-banner__icon': {
7171
7167
  backgroundSize: '65px 60px',
@@ -7920,6 +7916,9 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
7920
7916
  * * `containers` An array of nodes of containers of instances
7921
7917
  * * `div` A DOM element where UI can be displayed
7922
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.
7923
7922
  * @packageDocumentation
7924
7923
  */
7925
7924
 
@@ -8339,141 +8338,231 @@ function _findAppInstances() {
8339
8338
  return _findAppInstances.apply(this, arguments);
8340
8339
  }
8341
8340
 
8342
- function registrationControl(context, instance, theClass) {
8343
- 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
+ */
8344
8347
 
8345
- if (!dom || !context.div) {
8346
- return Promise.resolve();
8347
- }
8348
8348
 
8349
- var box = dom.createElement('div');
8350
- context.div.appendChild(box);
8351
- return (0, _solidLogic.ensureTypeIndexes)(context).then(function () {
8352
- 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;
8353
8352
 
8354
- box.setAttribute('style', 'font-size: 120%; text-align: right; padding: 1em; border: solid gray 0.05em;');
8355
- var tbody = box.children[0].children[0];
8356
- 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;
8357
8358
 
8358
- var registrationStatements = function registrationStatements(index) {
8359
- var registrations = _solidLogic.solidLogicSingleton.getRegistrations(instance, theClass);
8359
+ if (!(!dom || !context.div)) {
8360
+ _context7.next = 3;
8361
+ break;
8362
+ }
8360
8363
 
8361
- var reg = registrations.length ? registrations[0] : widgets.newThing(index);
8362
- return [(0, _rdflib.st)(reg, ns.solid('instance'), instance, index), (0, _rdflib.st)(reg, ns.solid('forClass'), theClass, index)];
8363
- };
8364
+ return _context7.abrupt("return", context);
8364
8365
 
8365
- var index, statements;
8366
+ case 3:
8367
+ box = dom.createElement('div');
8368
+ context.div.appendChild(box);
8369
+ context.me = _solidLogic.authn.currentUser(); // @@
8366
8370
 
8367
- if (context.index && context.index["public"] && context.index["public"].length > 0) {
8368
- index = context.index["public"][0];
8369
- statements = registrationStatements(index);
8370
- tbody.children[0].appendChild(widgets.buildCheckBoxForm(context.dom, _solidLogic.solidLogicSingleton.store, "Public link to this ".concat(context.noun), null, statements, form, index));
8371
- }
8371
+ if (context.me) {
8372
+ _context7.next = 9;
8373
+ break;
8374
+ }
8372
8375
 
8373
- if (context.index && context.index["private"] && context.index["private"].length > 0) {
8374
- index = context.index["private"][0];
8375
- statements = registrationStatements(index);
8376
- tbody.children[1].appendChild(widgets.buildCheckBoxForm(context.dom, _solidLogic.solidLogicSingleton.store, "Personal note of this ".concat(context.noun), null, statements, form, index));
8377
- }
8376
+ box.innerHTML = '<p style="margin:2em;">(Log in to save a link to this)</p>';
8377
+ return _context7.abrupt("return", context);
8378
8378
 
8379
- return context;
8380
- }, function (e) {
8381
- var msg;
8379
+ case 9:
8380
+ _context7.prev = 9;
8381
+ _context7.next = 12;
8382
+ return (0, _solidLogic.ensureTypeIndexes)(context);
8382
8383
 
8383
- if (context.div && context.preferencesFileError) {
8384
- msg = '(Preferences not available)';
8385
- context.div.appendChild(dom.createElement('p')).textContent = msg;
8386
- } else if (context.div) {
8387
- msg = "registrationControl: Type indexes not available: ".concat(e);
8388
- context.div.appendChild(widgets.errorMessageBlock(context.dom, e));
8389
- }
8384
+ case 12:
8385
+ context2 = _context7.sent;
8386
+ _context7.next = 19;
8387
+ break;
8390
8388
 
8391
- debug.log(msg);
8392
- })["catch"](function (e) {
8393
- 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
+ }
8394
8400
 
8395
- if (context.div) {
8396
- context.div.appendChild(widgets.errorMessageBlock(context.dom, e));
8397
- }
8401
+ debug.log(msg);
8398
8402
 
8399
- debug.log(msg);
8400
- });
8401
- }
8402
- /**
8403
- * UI to List at all registered things
8404
- */
8403
+ case 19:
8404
+ box.innerHTML = '<table><tbody><tr></tr><tr></tr></tbody></table>'; // tbody will be inserted anyway
8405
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
8406
8409
 
8407
- function registrationList(context, options) {
8408
- var dom = context.dom;
8409
- var div = context.div;
8410
- var box = dom.createElement('div');
8411
- div.appendChild(box);
8412
- return (0, _solidLogic.ensureTypeIndexes)(context).then(function (_indexes) {
8413
- box.innerHTML = '<table><tbody></tbody></table>'; // tbody will be inserted anyway
8414
-
8415
- box.setAttribute('style', 'font-size: 120%; text-align: right; padding: 1em; border: solid #eee 0.5em;');
8416
- var table = box.firstChild;
8417
- var ix = [];
8418
- var sts = [];
8419
- var vs = ['private', 'public'];
8420
- vs.forEach(function (visibility) {
8421
- if (context.index && options[visibility]) {
8422
- ix = ix.concat(context.index[visibility][0]);
8423
- sts = sts.concat(_solidLogic.solidLogicSingleton.store.statementsMatching(undefined, ns.solid('instance'), undefined, context.index[visibility][0]));
8424
- }
8425
- });
8410
+ registrationStatements = function registrationStatements(index) {
8411
+ var registrations = _solidLogic.solidLogicSingleton.getRegistrations(instance, theClass);
8426
8412
 
8427
- var _loop = function _loop(i) {
8428
- 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
+ };
8429
8416
 
8430
- if (options.type) {
8431
- // now check terms:forClass
8432
- if (!_solidLogic.solidLogicSingleton.store.holds(statement.subject, ns.solid('forClass'), options.type, statement.why)) {
8433
- return "continue"; // skip irrelevant ones
8434
- }
8435
- } // 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
+ }
8436
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);
8437
8431
 
8438
- var inst = statement.object;
8439
- table.appendChild(widgets.personTR(dom, ns.solid('instance'), inst, {
8440
- deleteFunction: function deleteFunction(_x) {
8441
- if (!_solidLogic.solidLogicSingleton.store.updater) {
8442
- throw new Error('Cannot delete this, store has no updater');
8443
- }
8432
+ if (context.div) {
8433
+ context.div.appendChild(widgets.errorMessageBlock(context.dom, e));
8434
+ }
8444
8435
 
8445
- _solidLogic.solidLogicSingleton.store.updater.update([statement], [], function (uri, ok, errorBody) {
8446
- if (ok) {
8447
- debug.log("Removed from index: ".concat(statement.subject));
8448
- } else {
8449
- debug.log("Error: Cannot delete ".concat(statement, ": ").concat(errorBody));
8436
+ debug.log(_msg);
8450
8437
  }
8451
- });
8438
+
8439
+ return _context7.abrupt("return", context2);
8440
+
8441
+ case 26:
8442
+ case "end":
8443
+ return _context7.stop();
8452
8444
  }
8453
- }));
8454
- };
8445
+ }
8446
+ }, _callee7, null, [[9, 15]]);
8447
+ }));
8448
+ return _registrationControl.apply(this, arguments);
8449
+ }
8455
8450
 
8456
- for (var i = 0; i < sts.length; i++) {
8457
- var _ret = _loop(i);
8451
+ function registrationList(_x10, _x11) {
8452
+ return _registrationList.apply(this, arguments);
8453
+ }
8458
8454
 
8459
- if (_ret === "continue") continue;
8460
- } // 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
+ }
8461
8472
 
8462
- /*
8463
- //const containers = solidLogicSingleton.store.each(theClass, ns.solid('instanceContainer'));
8464
- if (containers.length) {
8465
- fetcher.load(containers).then(function(xhrs){
8466
- for (const i=0; i<containers.length; i++) {
8467
- const cont = containers[i];
8468
- instances = instances.concat(solidLogicSingleton.store.each(cont, ns.ldp('contains')));
8469
- }
8470
- });
8471
- }
8472
- */
8473
+ box.innerHTML = '<p style="margin:2em;">(Log in list your stuff)</p>';
8474
+ return _context8.abrupt("return", context0);
8473
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
+ });
8474
8492
 
8475
- return context;
8476
- });
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);
8477
8566
  }
8478
8567
 
8479
8568
  function getDefaultSignInButtonStyle() {
@@ -8628,7 +8717,7 @@ function renderSignInPopup(dom) {
8628
8717
  }, _callee, null, [[0, 8]]);
8629
8718
  }));
8630
8719
 
8631
- return function loginToIssuer(_x7) {
8720
+ return function loginToIssuer(_x12) {
8632
8721
  return _ref.apply(this, arguments);
8633
8722
  };
8634
8723
  }();
@@ -8915,7 +9004,7 @@ function selectWorkspace(dom, appDetails, callbackWS) {
8915
9004
 
8916
9005
  function displayOptions(context) {
8917
9006
  // console.log('displayOptions!', context)
8918
- function makeNewWorkspace(_x8) {
9007
+ function makeNewWorkspace(_x13) {
8919
9008
  return _makeNewWorkspace.apply(this, arguments);
8920
9009
  } // const status = ''
8921
9010
 
@@ -9184,77 +9273,77 @@ function getUserRoles() {
9184
9273
 
9185
9274
 
9186
9275
  function _getUserRoles() {
9187
- _getUserRoles = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee7() {
9276
+ _getUserRoles = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee9() {
9188
9277
  var _yield$ensureLoadedPr, me, preferencesFile, preferencesFileError;
9189
9278
 
9190
- return _regenerator["default"].wrap(function _callee7$(_context7) {
9279
+ return _regenerator["default"].wrap(function _callee9$(_context9) {
9191
9280
  while (1) {
9192
- switch (_context7.prev = _context7.next) {
9281
+ switch (_context9.prev = _context9.next) {
9193
9282
  case 0:
9194
- _context7.prev = 0;
9195
- _context7.next = 3;
9283
+ _context9.prev = 0;
9284
+ _context9.next = 3;
9196
9285
  return ensureLoadedPreferences({});
9197
9286
 
9198
9287
  case 3:
9199
- _yield$ensureLoadedPr = _context7.sent;
9288
+ _yield$ensureLoadedPr = _context9.sent;
9200
9289
  me = _yield$ensureLoadedPr.me;
9201
9290
  preferencesFile = _yield$ensureLoadedPr.preferencesFile;
9202
9291
  preferencesFileError = _yield$ensureLoadedPr.preferencesFileError;
9203
9292
 
9204
9293
  if (!(!preferencesFile || preferencesFileError)) {
9205
- _context7.next = 9;
9294
+ _context9.next = 9;
9206
9295
  break;
9207
9296
  }
9208
9297
 
9209
9298
  throw new Error(preferencesFileError);
9210
9299
 
9211
9300
  case 9:
9212
- 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()));
9213
9302
 
9214
9303
  case 12:
9215
- _context7.prev = 12;
9216
- _context7.t0 = _context7["catch"](0);
9217
- 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);
9218
9307
 
9219
9308
  case 15:
9220
- return _context7.abrupt("return", []);
9309
+ return _context9.abrupt("return", []);
9221
9310
 
9222
9311
  case 16:
9223
9312
  case "end":
9224
- return _context7.stop();
9313
+ return _context9.stop();
9225
9314
  }
9226
9315
  }
9227
- }, _callee7, null, [[0, 12]]);
9316
+ }, _callee9, null, [[0, 12]]);
9228
9317
  }));
9229
9318
  return _getUserRoles.apply(this, arguments);
9230
9319
  }
9231
9320
 
9232
- function filterAvailablePanes(_x9) {
9321
+ function filterAvailablePanes(_x14) {
9233
9322
  return _filterAvailablePanes.apply(this, arguments);
9234
9323
  }
9235
9324
 
9236
9325
  function _filterAvailablePanes() {
9237
- _filterAvailablePanes = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee8(panes) {
9326
+ _filterAvailablePanes = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee10(panes) {
9238
9327
  var userRoles;
9239
- return _regenerator["default"].wrap(function _callee8$(_context8) {
9328
+ return _regenerator["default"].wrap(function _callee10$(_context10) {
9240
9329
  while (1) {
9241
- switch (_context8.prev = _context8.next) {
9330
+ switch (_context10.prev = _context10.next) {
9242
9331
  case 0:
9243
- _context8.next = 2;
9332
+ _context10.next = 2;
9244
9333
  return getUserRoles();
9245
9334
 
9246
9335
  case 2:
9247
- userRoles = _context8.sent;
9248
- return _context8.abrupt("return", panes.filter(function (pane) {
9336
+ userRoles = _context10.sent;
9337
+ return _context10.abrupt("return", panes.filter(function (pane) {
9249
9338
  return isMatchingAudience(pane, userRoles);
9250
9339
  }));
9251
9340
 
9252
9341
  case 4:
9253
9342
  case "end":
9254
- return _context8.stop();
9343
+ return _context10.stop();
9255
9344
  }
9256
9345
  }
9257
- }, _callee8);
9346
+ }, _callee10);
9258
9347
  }));
9259
9348
  return _filterAvailablePanes.apply(this, arguments);
9260
9349
  }
@@ -11991,10 +12080,10 @@ var style = {
11991
12080
  checkboxStyle: 'colour: black; font-size: 100%; padding-left: 0.5 em; padding-right: 0.5 em;',
11992
12081
  checkboxInputStyle: 'font-size: 150%; height: 1.2em; width: 1.2em; background-color: #eef; border-radius:0.2em; margin: 0.1em',
11993
12082
  fieldLabelStyle: 'color: #3B5998; text-decoration: none;',
11994
- formSelectSTyle: 'background-color: #eef; padding: 0.5em; border: .05em solid #88c; border-radius:0.2em; font-size: 100%; margin:0.2em;',
11995
- 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;',
11996
12085
  textInputStyleUneditable: // Color difference only
11997
- '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;',
11998
12087
  textInputSize: 20,
11999
12088
  // Default text input size in characters roughly
12000
12089
  buttonStyle: 'background-color: #fff; padding: 0.7em; border: .01em solid white; border-radius:0.2em; font-size: 100%; margin: 0.3em;',
@@ -13960,13 +14049,21 @@ function tabWidget(options) {
13960
14049
  orderedSync();
13961
14050
 
13962
14051
  if (!options.startEmpty && tabContainer.children.length && options.selectedTab) {
13963
- 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) {
13964
14054
  return tab.firstChild;
13965
14055
  }).find(function (tab) {
13966
14056
  return tab.dataset.name === options.selectedTab;
13967
14057
  });
13968
- var tab = selectedTab || tabContainer.children[0].firstChild;
13969
- 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();
13970
14067
  } else if (!options.startEmpty) {
13971
14068
  tabContainer.children[0].firstChild.click(); // Open first tab
13972
14069
  }
@@ -14253,7 +14350,6 @@ function getPod() {
14253
14350
  return (0, _rdflib.sym)(document.location.origin).site();
14254
14351
  }
14255
14352
  /**
14256
- * @ignore exporting this only for the unit test
14257
14353
  */
14258
14354
 
14259
14355
 
@@ -14267,63 +14363,94 @@ function getPodOwner(_x, _x2) {
14267
14363
 
14268
14364
  function _getPodOwner() {
14269
14365
  _getPodOwner = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(pod, store) {
14270
- var podOwner, storageIsListedInPodOwnersProfile;
14366
+ var podOwner, guess;
14271
14367
  return _regenerator["default"].wrap(function _callee$(_context) {
14272
14368
  while (1) {
14273
14369
  switch (_context.prev = _context.next) {
14274
14370
  case 0:
14275
- // @@ TODO: This is given the structure that NSS provides - might need to change for other Pod servers
14276
- podOwner = (0, _rdflib.sym)("".concat(pod.uri, "profile/card#me"));
14277
- _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;
14278
14376
 
14279
- if (!store.fetcher) {
14280
- _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;
14281
14386
  break;
14282
14387
  }
14283
14388
 
14284
- _context.next = 5;
14285
- 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);
14286
14391
 
14287
- case 5:
14288
- _context.next = 8;
14289
- break;
14392
+ case 11:
14393
+ podOwner = store.any(pod, _.ns.solid('owner'), null, pod) || store.any(null, _.ns.space('storage'), pod, pod);
14290
14394
 
14291
- case 7:
14292
- throw new Error('There was a problem loading the Fetcher');
14395
+ if (!podOwner) {
14396
+ _context.next = 25;
14397
+ break;
14398
+ }
14293
14399
 
14294
- case 8:
14295
- _context.next = 13;
14400
+ _context.prev = 13;
14401
+ // @ts-ignore LiveStore always has fetcher
14402
+ store.fetcher.load(podOwner.doc());
14403
+ _context.next = 21;
14296
14404
  break;
14297
14405
 
14298
- case 10:
14299
- _context.prev = 10;
14300
- _context.t0 = _context["catch"](1);
14301
- 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);
14302
14411
 
14303
- case 13:
14304
- if (!podOwner) {
14305
- _context.next = 17;
14306
- 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"));
14307
14415
  }
14308
14416
 
14309
- storageIsListedInPodOwnersProfile = store.holds(podOwner, _.ns.space('storage'), pod, podOwner.doc());
14417
+ return _context.abrupt("return", podOwner);
14418
+
14419
+ case 25:
14420
+ // pod owner 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;
14429
+
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);
14310
14435
 
14311
- if (storageIsListedInPodOwnersProfile) {
14312
- _context.next = 17;
14436
+ case 34:
14437
+ if (!store.holds(guess, _.ns.space('storage'), pod, guess.doc())) {
14438
+ _context.next = 37;
14313
14439
  break;
14314
14440
  }
14315
14441
 
14316
- 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);
14317
14444
 
14318
- case 17:
14319
- return _context.abrupt("return", podOwner);
14445
+ case 37:
14446
+ return _context.abrupt("return", null);
14320
14447
 
14321
- case 18:
14448
+ case 38:
14322
14449
  case "end":
14323
14450
  return _context.stop();
14324
14451
  }
14325
14452
  }
14326
- }, _callee, null, [[1, 10]]);
14453
+ }, _callee, null, [[0, 4], [13, 17], [26, 30]]);
14327
14454
  }));
14328
14455
  return _getPodOwner.apply(this, arguments);
14329
14456
  }
@@ -15172,8 +15299,8 @@ Object.defineProperty(exports, "__esModule", {
15172
15299
  });
15173
15300
  exports["default"] = void 0;
15174
15301
  var _default = {
15175
- buildTime: '2022-03-05T20:27:00Z',
15176
- commit: '6a4efc3e6e6ef7d5451a28169c22154cde525208',
15302
+ buildTime: '2022-03-24T17:40:39Z',
15303
+ commit: '72f773b92ca5a213d24eef43417800de397f5b52',
15177
15304
  npmInfo: {
15178
15305
  'solid-ui': '2.4.19',
15179
15306
  npm: '6.14.16',
@@ -17096,6 +17223,12 @@ Object.defineProperty(exports, "__esModule", {
17096
17223
  value: true
17097
17224
  });
17098
17225
  exports.appendForm = appendForm;
17226
+ Object.defineProperty(exports, "basicField", {
17227
+ enumerable: true,
17228
+ get: function get() {
17229
+ return _basic.basicField;
17230
+ }
17231
+ });
17099
17232
  exports.buildCheckboxForm = buildCheckboxForm;
17100
17233
  exports.editFormButton = editFormButton;
17101
17234
  Object.defineProperty(exports, "field", {
@@ -17104,14 +17237,24 @@ Object.defineProperty(exports, "field", {
17104
17237
  return _fieldFunction.field;
17105
17238
  }
17106
17239
  });
17107
- exports.fieldLabel = fieldLabel;
17240
+ Object.defineProperty(exports, "fieldLabel", {
17241
+ enumerable: true,
17242
+ get: function get() {
17243
+ return _basic.fieldLabel;
17244
+ }
17245
+ });
17108
17246
  Object.defineProperty(exports, "fieldParams", {
17109
17247
  enumerable: true,
17110
17248
  get: function get() {
17111
17249
  return _fieldParams.fieldParams;
17112
17250
  }
17113
17251
  });
17114
- exports.fieldStore = fieldStore;
17252
+ Object.defineProperty(exports, "fieldStore", {
17253
+ enumerable: true,
17254
+ get: function get() {
17255
+ return _basic.fieldStore;
17256
+ }
17257
+ });
17115
17258
  exports.findClosest = findClosest;
17116
17259
  exports.formsFor = formsFor;
17117
17260
  exports.makeDescription = makeDescription;
@@ -17122,6 +17265,12 @@ exports.newButton = newButton;
17122
17265
  exports.newThing = newThing;
17123
17266
  exports.promptForNew = promptForNew;
17124
17267
  exports.propertiesForClass = propertiesForClass;
17268
+ Object.defineProperty(exports, "renderNameValuePair", {
17269
+ enumerable: true,
17270
+ get: function get() {
17271
+ return _basic.renderNameValuePair;
17272
+ }
17273
+ });
17125
17274
  exports.sortByLabel = sortByLabel;
17126
17275
  exports.sortBySequence = sortBySequence;
17127
17276
 
@@ -17994,8 +18143,8 @@ _fieldFunction.field[ns.ui('MultiLineTextField').uri] = function (dom, container
17994
18143
  var left = box.appendChild(dom.createElement('div'));
17995
18144
  left.style.width = style.formFieldNameBoxWidth;
17996
18145
  var right = box.appendChild(dom.createElement('div'));
17997
- left.appendChild(fieldLabel(dom, property, form));
17998
- dataDoc = fieldStore(subject, property, dataDoc);
18146
+ left.appendChild((0, _basic.fieldLabel)(dom, property, form));
18147
+ dataDoc = (0, _basic.fieldStore)(subject, property, dataDoc);
17999
18148
  var text = kb.anyJS(subject, property, null, dataDoc) || '';
18000
18149
  var editable = kb.updater.editable(dataDoc.uri);
18001
18150
  var suppressEmptyUneditable = form && kb.anyJS(form, ns.ui('suppressEmptyUneditable'), null, formDoc);
@@ -18029,7 +18178,7 @@ function booleanField(dom, container, already, subject, form, dataDoc, callbackF
18029
18178
  var lab = kb.any(form, ui('label'));
18030
18179
  if (!lab) lab = utils.label(property, true); // Init capital
18031
18180
 
18032
- dataDoc = fieldStore(subject, property, dataDoc);
18181
+ dataDoc = (0, _basic.fieldStore)(subject, property, dataDoc);
18033
18182
  var state = kb.any(subject, property);
18034
18183
 
18035
18184
  if (state === undefined) {
@@ -18112,7 +18261,7 @@ _fieldFunction.field[ns.ui('Choice').uri] = function (dom, container, already, s
18112
18261
  return box.appendChild((0, _error.errorMessageBlock)(dom, 'No property for Choice: ' + form));
18113
18262
  }
18114
18263
 
18115
- lhs.appendChild(fieldLabel(dom, property, form));
18264
+ lhs.appendChild((0, _basic.fieldLabel)(dom, property, form));
18116
18265
  var from = kb.any(form, ui('from'));
18117
18266
 
18118
18267
  if (!from) {
@@ -18829,7 +18978,7 @@ function makeSelectForNestedCategory(dom, kb, subject, category, dataDoc, callba
18829
18978
 
18830
18979
  function buildCheckboxForm(dom, kb, lab, del, ins, form, dataDoc, tristate) {
18831
18980
  var box = dom.createElement('div');
18832
- var rhs = (0, _basic.renderNameValuePair)(dom, kb, box, form);
18981
+ var rhs = (0, _basic.renderNameValuePair)(dom, kb, box, form, lab);
18833
18982
  var editable = kb.updater.editable(dataDoc.uri);
18834
18983
  var input = dom.createElement('button');
18835
18984
  var colorCarrier = input;
@@ -18928,33 +19077,34 @@ function buildCheckboxForm(dom, kb, lab, del, ins, form, dataDoc, tristate) {
18928
19077
  input.addEventListener('click', boxHandler, false);
18929
19078
  return box;
18930
19079
  }
18931
-
18932
- function fieldLabel(dom, property, form) {
18933
- var lab = kb.any(form, ns.ui('label'));
18934
- if (!lab) lab = utils.label(property, true); // Init capital
18935
-
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
18936
19084
  if (property === undefined) {
18937
- return dom.createTextNode('@@Internal error: undefined property');
19085
+ return dom.createTextNode('@@Internal error: undefined property')
18938
19086
  }
18939
-
18940
- var anchor = dom.createElement('a');
18941
- if (property.uri) anchor.setAttribute('href', property.uri);
18942
- anchor.setAttribute('style', style.fieldLabelStyle); // Not too blue and no underline
18943
-
18944
- anchor.textContent = lab;
18945
- 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
18946
19092
  }
18947
19093
 
18948
- function fieldStore(subject, predicate, def) {
18949
- var sts = kb.statementsMatching(subject, predicate);
18950
- if (sts.length === 0) return def; // can used default as no data yet
18951
-
18952
- if (sts.length > 0 && sts[0].why.uri && kb.updater.editable(sts[0].why.uri)) {
18953
- 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)
18954
19103
  }
18955
-
18956
- return def;
19104
+ return def
18957
19105
  }
19106
+ */
19107
+
18958
19108
  /** Mint local ID using timestamp
18959
19109
  * @param {NamedNode} doc - the document in which the ID is to be generated
18960
19110
  */
@@ -21290,8 +21440,8 @@ var store = _solidLogic.solidLogicSingleton.store;
21290
21440
  /* Style and create a name, value pair
21291
21441
  */
21292
21442
 
21293
- function renderNameValuePair(dom, kb, box, form) {
21294
- 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'))
21295
21445
  box.style.display = 'flex';
21296
21446
  box.style.flexDirection = 'row';
21297
21447
  var lhs = box.appendChild(dom.createElement('div'));
@@ -21301,12 +21451,14 @@ function renderNameValuePair(dom, kb, box, form) {
21301
21451
  lhs.setAttribute('style', _style.formFieldNameBoxStyle);
21302
21452
  rhs.setAttribute('class', 'formFieldValue');
21303
21453
 
21304
- if (!property) {
21454
+ if (label) {
21455
+ lhs.appendChild(dom.createTextNode(label));
21456
+ } else if (kb.any(form, ns.ui('property'))) {
21305
21457
  // Assume more space for error on right
21306
- rhs.appendChild((0, _error.errorMessageBlock)(dom, 'No property given for form field: ' + form));
21307
- lhs.appendChild(dom.createTextNode('???'));
21458
+ lhs.appendChild(fieldLabel(dom, kb.any(form, ns.ui('property')), form));
21308
21459
  } else {
21309
- 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('???'));
21310
21462
  }
21311
21463
 
21312
21464
  return rhs;
@@ -23798,7 +23950,6 @@ e.read=function(t,e,r,n,i){var o,s,a=8*i-n-1,u=(1<<a)-1,c=u>>1,h=-7,l=r?i-1:0,f=
23798
23950
 
23799
23951
  Object.defineProperty(exports, "__esModule", { value: true });
23800
23952
  const oidc_client_ext_1 = __webpack_require__(/*! @inrupt/oidc-client-ext */ "./node_modules/@inrupt/oidc-client-ext/dist/index.es.js");
23801
- const constant_1 = __webpack_require__(/*! ./constant */ "./node_modules/@inrupt/solid-client-authn-browser/dist/constant.js");
23802
23953
  const globalFetch = (request, init) => window.fetch(request, init);
23803
23954
  class ClientAuthentication {
23804
23955
  constructor(loginHandler, redirectHandler, logoutHandler, sessionInfoManager, issuerConfigFetcher) {
@@ -23829,11 +23980,7 @@ class ClientAuthentication {
23829
23980
  this.getAllSessionInfo = async () => {
23830
23981
  return this.sessionInfoManager.getAll();
23831
23982
  };
23832
- this.validateCurrentSession = async () => {
23833
- const currentSessionId = window.localStorage.getItem(constant_1.KEY_CURRENT_SESSION);
23834
- if (currentSessionId === null) {
23835
- return null;
23836
- }
23983
+ this.validateCurrentSession = async (currentSessionId) => {
23837
23984
  const sessionInfo = await this.sessionInfoManager.get(currentSessionId);
23838
23985
  if (sessionInfo === undefined ||
23839
23986
  sessionInfo.clientAppId === undefined ||
@@ -23888,7 +24035,7 @@ async function silentlyAuthenticate(sessionId, clientAuthn, options = {
23888
24035
  inIframe: false,
23889
24036
  }, session) {
23890
24037
  var _a;
23891
- const storedSessionInfo = await clientAuthn.validateCurrentSession();
24038
+ const storedSessionInfo = await clientAuthn.validateCurrentSession(sessionId);
23892
24039
  if (storedSessionInfo !== null) {
23893
24040
  window.localStorage.setItem(constant_1.KEY_CURRENT_URL, window.location.href);
23894
24041
  await clientAuthn.login({
@@ -23933,12 +24080,16 @@ class Session extends events_1.EventEmitter {
23933
24080
  init === null || init === void 0 ? void 0 : init.credentials,
23934
24081
  });
23935
24082
  };
23936
- this.logout = async () => {
24083
+ this.internalLogout = async (emitSignal) => {
24084
+ window.localStorage.removeItem(constant_1.KEY_CURRENT_SESSION);
23937
24085
  await this.clientAuthentication.logout(this.info.sessionId);
23938
24086
  this.info.isLoggedIn = false;
23939
24087
  this.tmpFetchWithCookies = false;
23940
- this.emit("logout");
24088
+ if (emitSignal) {
24089
+ this.emit(solid_client_authn_core_1.EVENTS.LOGOUT);
24090
+ }
23941
24091
  };
24092
+ this.logout = async () => this.internalLogout(true);
23942
24093
  this.handleIncomingRedirect = async (inputOptions = {}) => {
23943
24094
  var _a;
23944
24095
  if (this.info.isLoggedIn) {
@@ -23994,11 +24145,11 @@ class Session extends events_1.EventEmitter {
23994
24145
  this.setSessionInfo(sessionInfo);
23995
24146
  const currentUrl = window.localStorage.getItem(constant_1.KEY_CURRENT_URL);
23996
24147
  if (currentUrl === null) {
23997
- this.emit("login");
24148
+ this.emit(solid_client_authn_core_1.EVENTS.LOGIN);
23998
24149
  }
23999
24150
  else {
24000
24151
  window.localStorage.removeItem(constant_1.KEY_CURRENT_URL);
24001
- this.emit("sessionRestore", currentUrl);
24152
+ this.emit(solid_client_authn_core_1.EVENTS.SESSION_RESTORED, currentUrl);
24002
24153
  }
24003
24154
  }
24004
24155
  else if (options.restorePreviousSession === true) {
@@ -24048,18 +24199,21 @@ class Session extends events_1.EventEmitter {
24048
24199
  this.on("tokenRenewal", () => silentlyAuthenticate(this.info.sessionId, this.clientAuthentication, {
24049
24200
  inIframe: true,
24050
24201
  }, this));
24202
+ this.on(solid_client_authn_core_1.EVENTS.LOGIN, () => window.localStorage.setItem(constant_1.KEY_CURRENT_SESSION, this.info.sessionId));
24203
+ this.on(solid_client_authn_core_1.EVENTS.SESSION_EXPIRED, () => this.internalLogout(false));
24204
+ this.on(solid_client_authn_core_1.EVENTS.ERROR, () => this.internalLogout(false));
24051
24205
  }
24052
24206
  onLogin(callback) {
24053
- this.on("login", callback);
24207
+ this.on(solid_client_authn_core_1.EVENTS.LOGIN, callback);
24054
24208
  }
24055
24209
  onLogout(callback) {
24056
- this.on("logout", callback);
24210
+ this.on(solid_client_authn_core_1.EVENTS.LOGOUT, callback);
24057
24211
  }
24058
24212
  onError(callback) {
24059
24213
  this.on(solid_client_authn_core_1.EVENTS.ERROR, callback);
24060
24214
  }
24061
24215
  onSessionRestore(callback) {
24062
- this.on("sessionRestore", callback);
24216
+ this.on(solid_client_authn_core_1.EVENTS.SESSION_RESTORED, callback);
24063
24217
  }
24064
24218
  onSessionExpiration(callback) {
24065
24219
  this.on(solid_client_authn_core_1.EVENTS.SESSION_EXPIRED, callback);
@@ -24273,7 +24427,11 @@ exports.postRedirectUrlToParent = postRedirectUrlToParent;
24273
24427
 
24274
24428
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
24275
24429
  if (k2 === undefined) k2 = k;
24276
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
24430
+ var desc = Object.getOwnPropertyDescriptor(m, k);
24431
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
24432
+ desc = { enumerable: true, get: function() { return m[k]; } };
24433
+ }
24434
+ Object.defineProperty(o, k2, desc);
24277
24435
  }) : (function(o, m, k, k2) {
24278
24436
  if (k2 === undefined) k2 = k;
24279
24437
  o[k2] = m[k];
@@ -24462,6 +24620,9 @@ function processConfig(config) {
24462
24620
  parsedConfig[issuerConfigKeyMap[key].toKey] = config[key];
24463
24621
  }
24464
24622
  });
24623
+ if (!Array.isArray(parsedConfig.scopesSupported)) {
24624
+ parsedConfig.scopesSupported = ["openid"];
24625
+ }
24465
24626
  return parsedConfig;
24466
24627
  }
24467
24628
  class IssuerConfigFetcher {
@@ -24674,7 +24835,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
24674
24835
  exports.AuthCodeRedirectHandler = exports.DEFAULT_LIFESPAN = void 0;
24675
24836
  const solid_client_authn_core_1 = __webpack_require__(/*! @inrupt/solid-client-authn-core */ "./node_modules/@inrupt/solid-client-authn-core/dist/index.js");
24676
24837
  const oidc_client_ext_1 = __webpack_require__(/*! @inrupt/oidc-client-ext */ "./node_modules/@inrupt/oidc-client-ext/dist/index.es.js");
24677
- const constant_1 = __webpack_require__(/*! ../../../constant */ "./node_modules/@inrupt/solid-client-authn-browser/dist/constant.js");
24678
24838
  exports.DEFAULT_LIFESPAN = 30 * 60 * 1000;
24679
24839
  async function setupResourceServerSession(webId, authenticatedFetch, storageUtility) {
24680
24840
  const webIdAsUrl = new URL(webId);
@@ -24719,23 +24879,24 @@ class AuthCodeRedirectHandler {
24719
24879
  const storedSessionId = (await this.storageUtility.getForUser(oauthState, "sessionId", {
24720
24880
  errorIfNull: true,
24721
24881
  }));
24722
- const isDpop = (await this.storageUtility.getForUser(storedSessionId, "dpop")) ===
24723
- "true";
24724
- const issuer = (await this.storageUtility.getForUser(storedSessionId, "issuer", { errorIfNull: true }));
24725
- window.localStorage.setItem(constant_1.KEY_CURRENT_SESSION, storedSessionId);
24726
- const issuerConfig = await this.issuerConfigFetcher.fetchConfig(issuer);
24882
+ const { issuerConfig, codeVerifier, redirectUrl: storedRedirectIri, dpop: isDpop, } = await (0, solid_client_authn_core_1.loadOidcContextFromStorage)(storedSessionId, this.storageUtility, this.issuerConfigFetcher);
24883
+ if (codeVerifier === undefined) {
24884
+ throw new Error(`The code verifier for session ${storedSessionId} is missing from storage.`);
24885
+ }
24886
+ if (storedRedirectIri === undefined) {
24887
+ throw new Error(`The redirect URL for session ${storedSessionId} is missing from storage.`);
24888
+ }
24727
24889
  const client = await this.clientRegistrar.getClient({ sessionId: storedSessionId }, issuerConfig);
24728
24890
  let tokens;
24729
- const referenceTime = Date.now();
24891
+ const tokenCreatedAt = Date.now();
24730
24892
  if (isDpop) {
24731
- const codeVerifier = (await this.storageUtility.getForUser(storedSessionId, "codeVerifier", { errorIfNull: true }));
24732
- const storedRedirectIri = (await this.storageUtility.getForUser(storedSessionId, "redirectUrl", { errorIfNull: true }));
24733
24893
  tokens = await (0, oidc_client_ext_1.getDpopToken)(issuerConfig, client, {
24734
24894
  grantType: "authorization_code",
24735
24895
  code: url.searchParams.get("code"),
24736
24896
  codeVerifier,
24737
24897
  redirectUrl: storedRedirectIri,
24738
24898
  });
24899
+ window.localStorage.removeItem(`oidc.${oauthState}`);
24739
24900
  }
24740
24901
  else {
24741
24902
  tokens = await (0, oidc_client_ext_1.getBearerToken)(url.toString());
@@ -24776,7 +24937,7 @@ class AuthCodeRedirectHandler {
24776
24937
  return Object.assign(sessionInfo, {
24777
24938
  fetch: authFetch,
24778
24939
  expirationDate: typeof tokens.expiresIn === "number"
24779
- ? referenceTime + tokens.expiresIn * 1000
24940
+ ? tokenCreatedAt + tokens.expiresIn * 1000
24780
24941
  : null,
24781
24942
  });
24782
24943
  }
@@ -25291,10 +25452,13 @@ exports.REFRESH_BEFORE_EXPIRATION_SECONDS = exports.EVENTS = exports.PREFERRED_S
25291
25452
  exports.SOLID_CLIENT_AUTHN_KEY_PREFIX = "solidClientAuthn:";
25292
25453
  exports.PREFERRED_SIGNING_ALG = ["ES256", "RS256"];
25293
25454
  exports.EVENTS = {
25455
+ ERROR: "error",
25456
+ LOGIN: "login",
25457
+ LOGOUT: "logout",
25294
25458
  NEW_REFRESH_TOKEN: "newRefreshToken",
25295
- ERROR: "onError",
25296
25459
  SESSION_EXPIRED: "sessionExpired",
25297
25460
  SESSION_EXTENDED: "sessionExtended",
25461
+ SESSION_RESTORED: "sessionRestore",
25298
25462
  TIMEOUT_SET: "timeoutSet",
25299
25463
  };
25300
25464
  exports.REFRESH_BEFORE_EXPIRATION_SECONDS = 5;
@@ -25485,7 +25649,11 @@ exports.OidcProviderError = OidcProviderError;
25485
25649
 
25486
25650
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
25487
25651
  if (k2 === undefined) k2 = k;
25488
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
25652
+ var desc = Object.getOwnPropertyDescriptor(m, k);
25653
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
25654
+ desc = { enumerable: true, get: function() { return m[k]; } };
25655
+ }
25656
+ Object.defineProperty(o, k2, desc);
25489
25657
  }) : (function(o, m, k, k2) {
25490
25658
  if (k2 === undefined) k2 = k;
25491
25659
  o[k2] = m[k];
@@ -25766,6 +25934,7 @@ async function loadOidcContextFromStorage(sessionId, storageUtility, configFetch
25766
25934
  storageUtility.getForUser(sessionId, "redirectUrl"),
25767
25935
  storageUtility.getForUser(sessionId, "dpop", { errorIfNull: true }),
25768
25936
  ]);
25937
+ await storageUtility.deleteForUser(sessionId, "codeVerifier");
25769
25938
  const issuerConfig = await configFetcher.fetchConfig(issuerIri);
25770
25939
  return {
25771
25940
  codeVerifier,
@@ -39251,7 +39420,7 @@ async function compactDecrypt(jwe, key, options) {
39251
39420
  throw new _util_errors_js__WEBPACK_IMPORTED_MODULE_1__["JWEInvalid"]('Invalid Compact JWE');
39252
39421
  }
39253
39422
  const decrypted = await Object(_flattened_decrypt_js__WEBPACK_IMPORTED_MODULE_0__["flattenedDecrypt"])({
39254
- ciphertext: (ciphertext || undefined),
39423
+ ciphertext,
39255
39424
  iv: (iv || undefined),
39256
39425
  protected: protectedHeader || undefined,
39257
39426
  tag: (tag || undefined),
@@ -39869,6 +40038,12 @@ class GeneralEncrypt {
39869
40038
  const recipient = this._recipients[i];
39870
40039
  const target = {};
39871
40040
  jwe.recipients.push(target);
40041
+ const joseHeader = {
40042
+ ...this._protectedHeader,
40043
+ ...this._unprotectedHeader,
40044
+ ...recipient.unprotectedHeader,
40045
+ };
40046
+ const p2c = joseHeader.alg.startsWith('PBES2') ? 2048 + i : undefined;
39872
40047
  if (i === 0) {
39873
40048
  const flattened = await new _flattened_encrypt_js__WEBPACK_IMPORTED_MODULE_0__["FlattenedEncrypt"](this._plaintext)
39874
40049
  .setAdditionalAuthenticatedData(this._aad)
@@ -39876,6 +40051,7 @@ class GeneralEncrypt {
39876
40051
  .setProtectedHeader(this._protectedHeader)
39877
40052
  .setSharedUnprotectedHeader(this._unprotectedHeader)
39878
40053
  .setUnprotectedHeader(recipient.unprotectedHeader)
40054
+ .setKeyManagementParameters({ p2c })
39879
40055
  .encrypt(recipient.key, {
39880
40056
  ...recipient.options,
39881
40057
  ...options,
@@ -39897,7 +40073,7 @@ class GeneralEncrypt {
39897
40073
  }
39898
40074
  const { encryptedKey, parameters } = await Object(_lib_encrypt_key_management_js__WEBPACK_IMPORTED_MODULE_4__["default"])(((_a = recipient.unprotectedHeader) === null || _a === void 0 ? void 0 : _a.alg) ||
39899
40075
  ((_b = this._protectedHeader) === null || _b === void 0 ? void 0 : _b.alg) ||
39900
- ((_c = this._unprotectedHeader) === null || _c === void 0 ? void 0 : _c.alg), enc, recipient.key, cek);
40076
+ ((_c = this._unprotectedHeader) === null || _c === void 0 ? void 0 : _c.alg), enc, recipient.key, cek, { p2c });
39901
40077
  target.encrypted_key = Object(_runtime_base64url_js__WEBPACK_IMPORTED_MODULE_5__["encode"])(encryptedKey);
39902
40078
  if (recipient.unprotectedHeader || parameters)
39903
40079
  target.header = { ...recipient.unprotectedHeader, ...parameters };
@@ -41559,7 +41735,7 @@ function checkEncCryptoKey(key, alg, ...usages) {
41559
41735
  throw unusable(expected, 'algorithm.length');
41560
41736
  break;
41561
41737
  }
41562
- case 'ECDH-ES':
41738
+ case 'ECDH':
41563
41739
  if (!isAlgorithm(key.algorithm, 'ECDH'))
41564
41740
  throw unusable('ECDH');
41565
41741
  break;
@@ -41638,7 +41814,7 @@ async function decryptKeyManagement(alg, key, encryptedKey, joseHeader) {
41638
41814
  if (!Object(_is_object_js__WEBPACK_IMPORTED_MODULE_9__["default"])(joseHeader.epk))
41639
41815
  throw new _util_errors_js__WEBPACK_IMPORTED_MODULE_5__["JWEInvalid"](`JOSE Header "epk" (Ephemeral Public Key) missing or invalid`);
41640
41816
  if (!_runtime_ecdhes_js__WEBPACK_IMPORTED_MODULE_1__["ecdhAllowed"](key))
41641
- throw new _util_errors_js__WEBPACK_IMPORTED_MODULE_5__["JOSENotSupported"]('ECDH-ES with the provided key is not allowed or not supported by your javascript runtime');
41817
+ throw new _util_errors_js__WEBPACK_IMPORTED_MODULE_5__["JOSENotSupported"]('ECDH with the provided key is not allowed or not supported by your javascript runtime');
41642
41818
  const epk = await Object(_key_import_js__WEBPACK_IMPORTED_MODULE_7__["importJWK"])(joseHeader.epk, alg);
41643
41819
  let partyUInfo;
41644
41820
  let partyVInfo;
@@ -41753,7 +41929,7 @@ async function encryptKeyManagement(alg, enc, key, providedCek, providedParamete
41753
41929
  case 'ECDH-ES+A192KW':
41754
41930
  case 'ECDH-ES+A256KW': {
41755
41931
  if (!_runtime_ecdhes_js__WEBPACK_IMPORTED_MODULE_1__["ecdhAllowed"](key)) {
41756
- throw new _util_errors_js__WEBPACK_IMPORTED_MODULE_6__["JOSENotSupported"]('ECDH-ES with the provided key is not allowed or not supported by your javascript runtime');
41932
+ throw new _util_errors_js__WEBPACK_IMPORTED_MODULE_6__["JOSENotSupported"]('ECDH with the provided key is not allowed or not supported by your javascript runtime');
41757
41933
  }
41758
41934
  const { apu, apv } = providedParameters;
41759
41935
  let { epk: ephemeralKey } = providedParameters;
@@ -42694,15 +42870,12 @@ async function deriveKey(publicKey, privateKey, algorithm, keyLength, apu = new
42694
42870
  if (!Object(_webcrypto_js__WEBPACK_IMPORTED_MODULE_1__["isCryptoKey"])(publicKey)) {
42695
42871
  throw new TypeError(Object(_lib_invalid_key_input_js__WEBPACK_IMPORTED_MODULE_3__["default"])(publicKey, ..._is_key_like_js__WEBPACK_IMPORTED_MODULE_4__["types"]));
42696
42872
  }
42697
- Object(_lib_crypto_key_js__WEBPACK_IMPORTED_MODULE_2__["checkEncCryptoKey"])(publicKey, 'ECDH-ES');
42873
+ Object(_lib_crypto_key_js__WEBPACK_IMPORTED_MODULE_2__["checkEncCryptoKey"])(publicKey, 'ECDH');
42698
42874
  if (!Object(_webcrypto_js__WEBPACK_IMPORTED_MODULE_1__["isCryptoKey"])(privateKey)) {
42699
42875
  throw new TypeError(Object(_lib_invalid_key_input_js__WEBPACK_IMPORTED_MODULE_3__["default"])(privateKey, ..._is_key_like_js__WEBPACK_IMPORTED_MODULE_4__["types"]));
42700
42876
  }
42701
- Object(_lib_crypto_key_js__WEBPACK_IMPORTED_MODULE_2__["checkEncCryptoKey"])(privateKey, 'ECDH-ES', 'deriveBits', 'deriveKey');
42877
+ Object(_lib_crypto_key_js__WEBPACK_IMPORTED_MODULE_2__["checkEncCryptoKey"])(privateKey, 'ECDH', 'deriveBits');
42702
42878
  const value = Object(_lib_buffer_utils_js__WEBPACK_IMPORTED_MODULE_0__["concat"])(Object(_lib_buffer_utils_js__WEBPACK_IMPORTED_MODULE_0__["lengthAndInput"])(_lib_buffer_utils_js__WEBPACK_IMPORTED_MODULE_0__["encoder"].encode(algorithm)), Object(_lib_buffer_utils_js__WEBPACK_IMPORTED_MODULE_0__["lengthAndInput"])(apu), Object(_lib_buffer_utils_js__WEBPACK_IMPORTED_MODULE_0__["lengthAndInput"])(apv), Object(_lib_buffer_utils_js__WEBPACK_IMPORTED_MODULE_0__["uint32be"])(keyLength));
42703
- if (!privateKey.usages.includes('deriveBits')) {
42704
- throw new TypeError('ECDH-ES private key "usages" must include "deriveBits"');
42705
- }
42706
42879
  const sharedSecret = new Uint8Array(await _webcrypto_js__WEBPACK_IMPORTED_MODULE_1__["default"].subtle.deriveBits({
42707
42880
  name: 'ECDH',
42708
42881
  public: publicKey,
@@ -42851,8 +43024,6 @@ function isNodeJs() {
42851
43024
  "use strict";
42852
43025
  __webpack_require__.r(__webpack_exports__);
42853
43026
  /* harmony import */ var _util_errors_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util/errors.js */ "./node_modules/jose/dist/browser/util/errors.js");
42854
- /* harmony import */ var _env_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./env.js */ "./node_modules/jose/dist/browser/runtime/env.js");
42855
-
42856
43027
 
42857
43028
  const fetchJwks = async (url, timeout) => {
42858
43029
  let controller;
@@ -42868,14 +43039,6 @@ const fetchJwks = async (url, timeout) => {
42868
43039
  const response = await fetch(url.href, {
42869
43040
  signal: controller ? controller.signal : undefined,
42870
43041
  redirect: 'manual',
42871
- method: 'GET',
42872
- ...(!Object(_env_js__WEBPACK_IMPORTED_MODULE_1__["isCloudflareWorkers"])()
42873
- ? {
42874
- referrerPolicy: 'no-referrer',
42875
- credentials: 'omit',
42876
- mode: 'cors',
42877
- }
42878
- : undefined),
42879
43042
  }).catch((err) => {
42880
43043
  if (timedOut)
42881
43044
  throw new _util_errors_js__WEBPACK_IMPORTED_MODULE_0__["JWKSTimeout"]();
@@ -43358,7 +43521,7 @@ async function deriveKey(p2s, alg, p2c, key) {
43358
43521
  }
43359
43522
  throw new TypeError('PBKDF2 key "usages" must include "deriveBits" or "deriveKey"');
43360
43523
  }
43361
- const encrypt = async (alg, key, cek, p2c = Math.floor(Math.random() * 2049) + 2048, p2s = Object(_random_js__WEBPACK_IMPORTED_MODULE_0__["default"])(new Uint8Array(16))) => {
43524
+ const encrypt = async (alg, key, cek, p2c = 2048, p2s = Object(_random_js__WEBPACK_IMPORTED_MODULE_0__["default"])(new Uint8Array(16))) => {
43362
43525
  const derived = await deriveKey(p2s, alg, p2c, key);
43363
43526
  const encryptedKey = await Object(_aeskw_js__WEBPACK_IMPORTED_MODULE_3__["wrap"])(alg.slice(-6), derived, cek);
43364
43527
  return { encryptedKey, p2c, p2s: Object(_base64url_js__WEBPACK_IMPORTED_MODULE_2__["encode"])(p2s) };