solid-ui 2.4.10-70892833 → 2.4.10-76e137ec

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.
@@ -3247,7 +3247,7 @@ function _loadIndex() {
3247
3247
  case 0:
3248
3248
  _context7.next = 2;
3249
3249
  return _logic.solidLogicSingleton.loadIndexes(context.me, isPublic ? context.publicProfile || null : null, isPublic ? null : context.preferencesFile || null, /*#__PURE__*/function () {
3250
- var _ref3 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee6(err) {
3250
+ var _ref4 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee6(err) {
3251
3251
  return _regenerator["default"].wrap(function _callee6$(_context6) {
3252
3252
  while (1) {
3253
3253
  switch (_context6.prev = _context6.next) {
@@ -3263,7 +3263,7 @@ function _loadIndex() {
3263
3263
  }));
3264
3264
 
3265
3265
  return function (_x21) {
3266
- return _ref3.apply(this, arguments);
3266
+ return _ref4.apply(this, arguments);
3267
3267
  };
3268
3268
  }());
3269
3269
 
@@ -3302,7 +3302,7 @@ function _loadTypeIndexes() {
3302
3302
  case 0:
3303
3303
  _context9.next = 2;
3304
3304
  return _logic.solidLogicSingleton.loadIndexes(context.me, context.publicProfile || null, context.preferencesFile || null, /*#__PURE__*/function () {
3305
- var _ref4 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee8(err) {
3305
+ var _ref5 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee8(err) {
3306
3306
  return _regenerator["default"].wrap(function _callee8$(_context8) {
3307
3307
  while (1) {
3308
3308
  switch (_context8.prev = _context8.next) {
@@ -3318,7 +3318,7 @@ function _loadTypeIndexes() {
3318
3318
  }));
3319
3319
 
3320
3320
  return function (_x22) {
3321
- return _ref4.apply(this, arguments);
3321
+ return _ref5.apply(this, arguments);
3322
3322
  };
3323
3323
  }());
3324
3324
 
@@ -4215,6 +4215,7 @@ function renderSignInPopup(dom) {
4215
4215
  issuerTextInput.setAttribute('type', 'text');
4216
4216
  issuerTextInput.setAttribute('style', 'margin-left: 0 !important; flex: 1; margin-right: 5px !important');
4217
4217
  issuerTextInput.setAttribute('placeholder', 'https://example.com');
4218
+ issuerTextInput.value = localStorage.getItem('loginIssuer') || '';
4218
4219
  var issuerTextGoButton = dom.createElement('button');
4219
4220
  issuerTextGoButton.innerText = 'Go';
4220
4221
  issuerTextGoButton.setAttribute('style', 'margin-top: 12px; margin-bottom: 12px;');
@@ -4236,7 +4237,7 @@ function renderSignInPopup(dom) {
4236
4237
  issuerBottonLabel.innerText = 'Or pick an identity provider from the list below:';
4237
4238
  issuerBottonLabel.setAttribute('style', 'color: #888');
4238
4239
  issuerButtonContainer.appendChild(issuerBottonLabel);
4239
- DEFAULT_ISSUERS.forEach(function (issuerInfo) {
4240
+ getSuggestedIssuers().forEach(function (issuerInfo) {
4240
4241
  var issuerButton = dom.createElement('button');
4241
4242
  issuerButton.innerText = issuerInfo.name;
4242
4243
  issuerButton.setAttribute('style', 'height: 38px; margin-top: 10px');
@@ -4247,6 +4248,40 @@ function renderSignInPopup(dom) {
4247
4248
  });
4248
4249
  issuerPopupBox.appendChild(issuerButtonContainer);
4249
4250
  }
4251
+ /**
4252
+ * @returns - A list of suggested OIDC issuers
4253
+ */
4254
+
4255
+
4256
+ function getSuggestedIssuers() {
4257
+ // Suggest a default list of OIDC issuers
4258
+ var issuers = [].concat(DEFAULT_ISSUERS); // Suggest the current host if not already included
4259
+
4260
+ var _URL = new URL(location.href),
4261
+ host = _URL.host,
4262
+ origin = _URL.origin;
4263
+
4264
+ var hosts = issuers.map(function (_ref2) {
4265
+ var uri = _ref2.uri;
4266
+ return new URL(uri).host;
4267
+ });
4268
+
4269
+ if (!hosts.includes(host) && !hosts.some(function (existing) {
4270
+ return isSubdomainOf(host, existing);
4271
+ })) {
4272
+ issuers.unshift({
4273
+ name: host,
4274
+ uri: origin
4275
+ });
4276
+ }
4277
+
4278
+ return issuers;
4279
+ }
4280
+
4281
+ function isSubdomainOf(subdomain, domain) {
4282
+ var dot = subdomain.length - domain.length - 1;
4283
+ return dot > 0 && subdomain[dot] === '.' && subdomain.endsWith(domain);
4284
+ }
4250
4285
  /**
4251
4286
  * @returns {Promise<string|null>} Resolves with WebID URI or null
4252
4287
  */
@@ -15388,8 +15423,8 @@ Object.defineProperty(exports, "__esModule", {
15388
15423
  });
15389
15424
  exports["default"] = void 0;
15390
15425
  var _default = {
15391
- buildTime: '2021-11-02T17:21:29Z',
15392
- commit: '70892833b31acc752895d446af67b78f30a3842f',
15426
+ buildTime: '2021-11-03T18:22:31Z',
15427
+ commit: '76e137ec813cc826a06184b8c13d654fbee81c03',
15393
15428
  npmInfo: {
15394
15429
  'solid-ui': '2.4.10',
15395
15430
  npm: '6.14.15',