solid-ui 2.4.26 → 2.4.27-a3872ec1

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/index.html CHANGED
@@ -1,9 +1 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8">
5
- <title>Webpack App</title>
6
- <meta name="viewport" content="width=device-width, initial-scale=1"><script defer src="main.js"></script></head>
7
- <body>
8
- </body>
9
- </html>
1
+ <!doctype html><html><head><meta charset="utf-8"><title>Webpack App</title><meta name="viewport" content="width=device-width,initial-scale=1"><script defer="defer" src="solid-ui.min.js"></script></head><body></body></html>
@@ -1,4 +1,14 @@
1
- /******/ (() => { // webpackBootstrap
1
+ (function webpackUniversalModuleDefinition(root, factory) {
2
+ if(typeof exports === 'object' && typeof module === 'object')
3
+ module.exports = factory();
4
+ else if(typeof define === 'function' && define.amd)
5
+ define([], factory);
6
+ else if(typeof exports === 'object')
7
+ exports["solid-ui"] = factory();
8
+ else
9
+ root["solid-ui"] = factory();
10
+ })(self, () => {
11
+ return /******/ (() => { // webpackBootstrap
2
12
  /******/ var __webpack_modules__ = ({
3
13
 
4
14
  /***/ "./lib/acl/access-controller.js":
@@ -7155,7 +7165,7 @@ function renderSignInPopup(dom) {
7155
7165
  issuerPopupBoxTopMenu.appendChild(issuerPopupBoxCloseButton);
7156
7166
  var loginToIssuer = /*#__PURE__*/function () {
7157
7167
  var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(issuerUri) {
7158
- var preLoginRedirectHash;
7168
+ var preLoginRedirectHash, locationUrl;
7159
7169
  return _regenerator["default"].wrap(function _callee$(_context) {
7160
7170
  while (1) switch (_context.prev = _context.next) {
7161
7171
  case 0:
@@ -7167,23 +7177,25 @@ function renderSignInPopup(dom) {
7167
7177
  }
7168
7178
  window.localStorage.setItem('loginIssuer', issuerUri);
7169
7179
  // Login
7170
- _context.next = 6;
7180
+ locationUrl = new URL(window.location.href);
7181
+ locationUrl.hash = ''; // remove hash part
7182
+ _context.next = 8;
7171
7183
  return _solidLogic.authSession.login({
7172
- redirectUrl: window.location.href,
7184
+ redirectUrl: locationUrl.href,
7173
7185
  oidcIssuer: issuerUri
7174
7186
  });
7175
- case 6:
7176
- _context.next = 11;
7177
- break;
7178
7187
  case 8:
7179
- _context.prev = 8;
7188
+ _context.next = 13;
7189
+ break;
7190
+ case 10:
7191
+ _context.prev = 10;
7180
7192
  _context.t0 = _context["catch"](0);
7181
7193
  (0, _log.alert)(_context.t0.message);
7182
- case 11:
7194
+ case 13:
7183
7195
  case "end":
7184
7196
  return _context.stop();
7185
7197
  }
7186
- }, _callee, null, [[0, 8]]);
7198
+ }, _callee, null, [[0, 10]]);
7187
7199
  }));
7188
7200
  return function loginToIssuer(_x11) {
7189
7201
  return _ref.apply(this, arguments);
@@ -13119,10 +13131,10 @@ Object.defineProperty(exports, "__esModule", ({
13119
13131
  }));
13120
13132
  exports.versionInfo = void 0;
13121
13133
  var versionInfo = {
13122
- buildTime: '2023-02-28T16:35:42Z',
13123
- commit: 'ce13e4428c9204d2f64dbd0bd6237ae08f23ae2b',
13134
+ buildTime: '2023-03-25T18:23:17Z',
13135
+ commit: 'a3872ec19027d2db465bc7151e82d3904afa847b',
13124
13136
  npmInfo: {
13125
- 'solid-ui': '2.4.26',
13137
+ 'solid-ui': '2.4.27',
13126
13138
  npm: '8.19.4',
13127
13139
  node: '16.19.1',
13128
13140
  v8: '9.4.146.26-node.24',
@@ -25557,7 +25569,10 @@ function removeOidcQueryParam(redirectUrl) {
25557
25569
  cleanedUrl.searchParams.delete("code");
25558
25570
  cleanedUrl.searchParams.delete("state");
25559
25571
  cleanedUrl.hash = "";
25560
- return cleanedUrl.toString();
25572
+ if (redirectUrl.includes(`${cleanedUrl.origin}/`)) {
25573
+ return cleanedUrl.href;
25574
+ }
25575
+ return `${cleanedUrl.origin}${cleanedUrl.href.substring(cleanedUrl.origin.length + 1)}`;
25561
25576
  }
25562
25577
  async function clearOidcPersistentStorage() {
25563
25578
  const client = new _inrupt_oidc_client__WEBPACK_IMPORTED_MODULE_0__.OidcClient({
@@ -26225,7 +26240,7 @@ class IssuerConfigFetcher {
26225
26240
  }
26226
26241
  async fetchConfig(issuer) {
26227
26242
  let issuerConfig;
26228
- const openIdConfigUrl = new URL(exports.WELL_KNOWN_OPENID_CONFIG, issuer).href;
26243
+ const openIdConfigUrl = new URL(exports.WELL_KNOWN_OPENID_CONFIG, issuer.endsWith("/") ? issuer : `${issuer}/`).href;
26229
26244
  const issuerConfigRequestBody = await window.fetch(openIdConfigUrl);
26230
26245
  try {
26231
26246
  issuerConfig = processConfig(await issuerConfigRequestBody.json());
@@ -26402,12 +26417,6 @@ class AuthCodeRedirectHandler {
26402
26417
  webId: tokens.webId,
26403
26418
  isLoggedIn: "true",
26404
26419
  }, { secure: true });
26405
- url.searchParams.delete("code");
26406
- await this.storageUtility.setForUser(storedSessionId, {
26407
- redirectUrl: url.toString(),
26408
- }, {
26409
- secure: false,
26410
- });
26411
26420
  const sessionInfo = await this.sessionInfoManager.get(storedSessionId);
26412
26421
  if (!sessionInfo) {
26413
26422
  throw new Error(`Could not retrieve session: [${storedSessionId}].`);
@@ -52249,7 +52258,6 @@ var BlankNode = /*#__PURE__*/function (_Node) {
52249
52258
  function getId(id) {
52250
52259
  if (id) {
52251
52260
  if (typeof id !== 'string') {
52252
- console.log('Bad blank id:', id);
52253
52261
  throw new Error('Bad id argument to new blank node: ' + id);
52254
52262
  }
52255
52263
  if (id.includes('#')) {
@@ -53876,7 +53884,7 @@ var Fetcher = /*#__PURE__*/function () {
53876
53884
  size: 0,
53877
53885
  timeout: 0
53878
53886
  };
53879
- console.log('Fetcher: <' + actualProxyURI + '> Non-HTTP fetch exception: ' + error);
53887
+ // console.log('Fetcher: <' + actualProxyURI + '> Non-HTTP fetch exception: ' + error)
53880
53888
  return _this5.handleError(dummyResponse, docuri, options); // possible credentials retry
53881
53889
  // return this.failFetch(options, 'fetch failed: ' + error, 999, dummyResponse) // Fake status code: fetch exception
53882
53890
 
@@ -53937,25 +53945,21 @@ var Fetcher = /*#__PURE__*/function () {
53937
53945
  if (fetchResponse.ok) {
53938
53946
  userCallback(true, 'OK', fetchResponse);
53939
53947
  } else {
53940
- // console.log('@@@ fetcher.js Should not take this path !!!!!!!!!!!!')
53941
53948
  var oops = 'HTTP error: Status ' + fetchResponse.status + ' (' + fetchResponse.statusText + ')';
53942
53949
  if (fetchResponse.responseText) {
53943
53950
  oops += ' ' + fetchResponse.responseText; // not in 404, dns error, nock failure
53944
53951
  }
53945
53952
 
53946
- console.log(oops + ' fetching ' + uri);
53947
53953
  userCallback(false, oops, fetchResponse);
53948
53954
  }
53949
53955
  } else {
53950
53956
  var _oops = '@@ nowOrWhenFetched: no response object!';
53951
- console.log(_oops);
53952
53957
  userCallback(false, _oops);
53953
53958
  }
53954
53959
  }
53955
53960
  }, function (err) {
53956
53961
  var message = err.message || err.statusText;
53957
53962
  message = 'Failed to load <' + uri + '> ' + message;
53958
- console.log(message);
53959
53963
  if (err.response && err.response.status) {
53960
53964
  message += ' status: ' + err.response.status;
53961
53965
  }
@@ -54194,45 +54198,42 @@ var Fetcher = /*#__PURE__*/function () {
54194
54198
  return fetcher.load(doc);
54195
54199
  case 6:
54196
54200
  response = _context2.sent;
54197
- _context2.next = 29;
54201
+ _context2.next = 26;
54198
54202
  break;
54199
54203
  case 9:
54200
54204
  _context2.prev = 9;
54201
54205
  _context2.t0 = _context2["catch"](3);
54202
54206
  if (!(_context2.t0.response.status === 404)) {
54203
- _context2.next = 27;
54207
+ _context2.next = 25;
54204
54208
  break;
54205
54209
  }
54206
- console.log('createIfNotExists: doc does NOT exist, will create... ' + doc);
54207
- _context2.prev = 13;
54208
- _context2.next = 16;
54210
+ _context2.prev = 12;
54211
+ _context2.next = 15;
54209
54212
  return fetcher.webOperation('PUT', doc.value, {
54210
54213
  data: data,
54211
54214
  contentType: contentType
54212
54215
  });
54213
- case 16:
54216
+ case 15:
54214
54217
  response = _context2.sent;
54215
- _context2.next = 23;
54218
+ _context2.next = 21;
54216
54219
  break;
54217
- case 19:
54218
- _context2.prev = 19;
54219
- _context2.t1 = _context2["catch"](13);
54220
- console.log('createIfNotExists doc FAILED: ' + doc + ': ' + _context2.t1);
54220
+ case 18:
54221
+ _context2.prev = 18;
54222
+ _context2.t1 = _context2["catch"](12);
54221
54223
  throw _context2.t1;
54222
- case 23:
54224
+ case 21:
54223
54225
  delete fetcher.requested[doc.value]; // delete cached 404 error
54224
54226
  // console.log('createIfNotExists doc created ok ' + doc)
54225
54227
  return _context2.abrupt("return", response);
54226
- case 27:
54227
- console.log('createIfNotExists doc load error NOT 404: ' + doc + ': ' + _context2.t0);
54228
+ case 25:
54228
54229
  throw _context2.t0;
54229
- case 29:
54230
+ case 26:
54230
54231
  return _context2.abrupt("return", response);
54231
- case 30:
54232
+ case 27:
54232
54233
  case "end":
54233
54234
  return _context2.stop();
54234
54235
  }
54235
- }, _callee2, this, [[3, 9], [13, 19]]);
54236
+ }, _callee2, this, [[3, 9], [12, 18]]);
54236
54237
  }));
54237
54238
  function createIfNotExists(_x4) {
54238
54239
  return _createIfNotExists.apply(this, arguments);
@@ -54541,7 +54542,8 @@ var Fetcher = /*#__PURE__*/function () {
54541
54542
  }, {
54542
54543
  key: "retryNoCredentials",
54543
54544
  value: function retryNoCredentials(docuri, options) {
54544
- console.log('Fetcher: CORS: RETRYING with NO CREDENTIALS for ' + options.resource);
54545
+ // console.log('Fetcher: CORS: RETRYING with NO CREDENTIALS for ' + options.resource)
54546
+
54545
54547
  options.retriedWithNoCredentials = true; // protect against being called twice
54546
54548
 
54547
54549
  delete this.requested[docuri]; // forget the original request happened
@@ -54586,7 +54588,7 @@ var Fetcher = /*#__PURE__*/function () {
54586
54588
  // Now attempt retry via proxy
54587
54589
  var proxyUri = Fetcher.crossSiteProxy(docuri);
54588
54590
  if (proxyUri && !options.proxyUsed) {
54589
- console.log('web: Direct failed so trying proxy ' + proxyUri);
54591
+ // console.log('web: Direct failed so trying proxy ' + proxyUri)
54590
54592
  return this.redirectToProxy(proxyUri, options);
54591
54593
  }
54592
54594
  }
@@ -54659,7 +54661,7 @@ var Fetcher = /*#__PURE__*/function () {
54659
54661
 
54660
54662
  // Check for masked errors (CORS, etc)
54661
54663
  if (response.status === 0) {
54662
- console.log('Masked error - status 0 for ' + docuri);
54664
+ // console.log('Masked error - status 0 for ' + docuri)
54663
54665
  return this.handleError(response, docuri, options);
54664
54666
  }
54665
54667
  if (response.status >= 400) {
@@ -55546,7 +55548,6 @@ var Formula = /*#__PURE__*/function (_Node) {
55546
55548
  while (todo.length) {
55547
55549
  follow(todo.shift());
55548
55550
  }
55549
- // console.log('' + result.length + ' statements about ' + subject)
55550
55551
  return result;
55551
55552
  }
55552
55553
 
@@ -55703,10 +55704,10 @@ var Formula = /*#__PURE__*/function (_Node) {
55703
55704
  var statementsCopy = this.statements.map(function (ea) {
55704
55705
  return ea.substitute(bindings);
55705
55706
  });
55706
- console.log('Formula subs statmnts:' + statementsCopy);
55707
+ // console.log('Formula subs statmnts:' + statementsCopy)
55707
55708
  var y = new Formula();
55708
55709
  y.addAll(statementsCopy);
55709
- console.log('indexed-form subs formula:' + y);
55710
+ // console.log('indexed-form subs formula:' + y)
55710
55711
  return y;
55711
55712
  }
55712
55713
  }, {
@@ -58518,7 +58519,6 @@ var Node = /*#__PURE__*/function () {
58518
58519
  (0,_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(Node, [{
58519
58520
  key: "substitute",
58520
58521
  value: function substitute(bindings) {
58521
- console.log('@@@ node substitute' + this);
58522
58522
  return this;
58523
58523
  }
58524
58524
 
@@ -62929,7 +62929,7 @@ var Statement = /*#__PURE__*/function () {
62929
62929
  key: "substitute",
62930
62930
  value: function substitute(bindings) {
62931
62931
  var y = new Statement(this.subject.substitute(bindings), this.predicate.substitute(bindings), this.object.substitute(bindings), (0,_default_graph__WEBPACK_IMPORTED_MODULE_3__.isDefaultGraph)(this.graph) ? this.graph : this.graph.substitute(bindings)); // 2016
62932
- console.log('@@@ statement substitute:' + y);
62932
+ // console.log('@@@ statement substitute:' + y)
62933
62933
  return y;
62934
62934
  }
62935
62935
 
@@ -67054,7 +67054,7 @@ var SolidAuthnLogic = /** @class */ (function () {
67054
67054
  */
67055
67055
  SolidAuthnLogic.prototype.checkUser = function (setUserCallback) {
67056
67056
  return __awaiter(this, void 0, void 0, function () {
67057
- var preLoginRedirectHash, postLoginRedirectHash, curUrl, me, webId;
67057
+ var preLoginRedirectHash, redirectUrl, postLoginRedirectHash, curUrl, me, webId;
67058
67058
  return __generator(this, function (_a) {
67059
67059
  switch (_a.label) {
67060
67060
  case 0:
@@ -67066,20 +67066,16 @@ var SolidAuthnLogic = /** @class */ (function () {
67066
67066
  if (document.location.toString() !== url)
67067
67067
  history.replaceState(null, '', url);
67068
67068
  });
67069
- /**
67070
- * Handle a successful authentication redirect
67071
- */
67069
+ redirectUrl = new URL(window.location.href);
67070
+ redirectUrl.hash = '';
67072
67071
  return [4 /*yield*/, this.session
67073
67072
  .handleIncomingRedirect({
67074
67073
  restorePreviousSession: true,
67075
- url: window.location.href
67074
+ url: redirectUrl.href
67076
67075
  })
67077
67076
  // Check to see if a hash was stored in local storage
67078
67077
  ];
67079
67078
  case 1:
67080
- /**
67081
- * Handle a successful authentication redirect
67082
- */
67083
67079
  _a.sent();
67084
67080
  postLoginRedirectHash = window.localStorage.getItem('preLoginRedirectHash');
67085
67081
  if (postLoginRedirectHash) {
@@ -75179,33 +75175,21 @@ class RemoteJWKSet extends _local_js__WEBPACK_IMPORTED_MODULE_3__.LocalJWKSet {
75179
75175
  }
75180
75176
  async reload() {
75181
75177
  if (this._pendingFetch && (0,_runtime_env_js__WEBPACK_IMPORTED_MODULE_1__.isCloudflareWorkers)()) {
75182
- return new Promise((resolve) => {
75183
- const isDone = () => {
75184
- if (this._pendingFetch === undefined) {
75185
- resolve();
75186
- }
75187
- else {
75188
- setTimeout(isDone, 5);
75189
- }
75190
- };
75191
- isDone();
75192
- });
75193
- }
75194
- if (!this._pendingFetch) {
75195
- this._pendingFetch = (0,_runtime_fetch_jwks_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this._url, this._timeoutDuration, this._options)
75196
- .then((json) => {
75197
- if (!(0,_local_js__WEBPACK_IMPORTED_MODULE_3__.isJWKSLike)(json)) {
75198
- throw new _util_errors_js__WEBPACK_IMPORTED_MODULE_2__.JWKSInvalid('JSON Web Key Set malformed');
75199
- }
75200
- this._jwks = { keys: json.keys };
75201
- this._jwksTimestamp = Date.now();
75202
- this._pendingFetch = undefined;
75203
- })
75204
- .catch((err) => {
75205
- this._pendingFetch = undefined;
75206
- throw err;
75207
- });
75178
+ this._pendingFetch = undefined;
75208
75179
  }
75180
+ this._pendingFetch || (this._pendingFetch = (0,_runtime_fetch_jwks_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this._url, this._timeoutDuration, this._options)
75181
+ .then((json) => {
75182
+ if (!(0,_local_js__WEBPACK_IMPORTED_MODULE_3__.isJWKSLike)(json)) {
75183
+ throw new _util_errors_js__WEBPACK_IMPORTED_MODULE_2__.JWKSInvalid('JSON Web Key Set malformed');
75184
+ }
75185
+ this._jwks = { keys: json.keys };
75186
+ this._jwksTimestamp = Date.now();
75187
+ this._pendingFetch = undefined;
75188
+ })
75189
+ .catch((err) => {
75190
+ this._pendingFetch = undefined;
75191
+ throw err;
75192
+ }));
75209
75193
  await this._pendingFetch;
75210
75194
  }
75211
75195
  }
@@ -79232,6 +79216,8 @@ module.exports = JSON.parse('{"application/1d-interleaved-parityfec":{"source":"
79232
79216
  /******/ // This entry module is referenced by other modules so it can't be inlined
79233
79217
  /******/ var __webpack_exports__ = __webpack_require__("./lib/index.js");
79234
79218
  /******/
79219
+ /******/ return __webpack_exports__;
79235
79220
  /******/ })()
79236
79221
  ;
79237
- //# sourceMappingURL=main.js.map
79222
+ });
79223
+ //# sourceMappingURL=solid-ui.js.map