solid-ui 2.4.26 → 2.4.27-aa3408d0

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/main.js CHANGED
@@ -7155,7 +7155,7 @@ function renderSignInPopup(dom) {
7155
7155
  issuerPopupBoxTopMenu.appendChild(issuerPopupBoxCloseButton);
7156
7156
  var loginToIssuer = /*#__PURE__*/function () {
7157
7157
  var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(issuerUri) {
7158
- var preLoginRedirectHash;
7158
+ var preLoginRedirectHash, locationUrl;
7159
7159
  return _regenerator["default"].wrap(function _callee$(_context) {
7160
7160
  while (1) switch (_context.prev = _context.next) {
7161
7161
  case 0:
@@ -7167,23 +7167,25 @@ function renderSignInPopup(dom) {
7167
7167
  }
7168
7168
  window.localStorage.setItem('loginIssuer', issuerUri);
7169
7169
  // Login
7170
- _context.next = 6;
7170
+ locationUrl = new URL(window.location.href);
7171
+ locationUrl.hash = ''; // remove hash part
7172
+ _context.next = 8;
7171
7173
  return _solidLogic.authSession.login({
7172
- redirectUrl: window.location.href,
7174
+ redirectUrl: locationUrl.href,
7173
7175
  oidcIssuer: issuerUri
7174
7176
  });
7175
- case 6:
7176
- _context.next = 11;
7177
- break;
7178
7177
  case 8:
7179
- _context.prev = 8;
7178
+ _context.next = 13;
7179
+ break;
7180
+ case 10:
7181
+ _context.prev = 10;
7180
7182
  _context.t0 = _context["catch"](0);
7181
7183
  (0, _log.alert)(_context.t0.message);
7182
- case 11:
7184
+ case 13:
7183
7185
  case "end":
7184
7186
  return _context.stop();
7185
7187
  }
7186
- }, _callee, null, [[0, 8]]);
7188
+ }, _callee, null, [[0, 10]]);
7187
7189
  }));
7188
7190
  return function loginToIssuer(_x11) {
7189
7191
  return _ref.apply(this, arguments);
@@ -13119,10 +13121,10 @@ Object.defineProperty(exports, "__esModule", ({
13119
13121
  }));
13120
13122
  exports.versionInfo = void 0;
13121
13123
  var versionInfo = {
13122
- buildTime: '2023-02-28T16:35:42Z',
13123
- commit: 'ce13e4428c9204d2f64dbd0bd6237ae08f23ae2b',
13124
+ buildTime: '2023-03-24T17:38:10Z',
13125
+ commit: 'aa3408d0e31078205a97797468378f8986e90e2a',
13124
13126
  npmInfo: {
13125
- 'solid-ui': '2.4.26',
13127
+ 'solid-ui': '2.4.27',
13126
13128
  npm: '8.19.4',
13127
13129
  node: '16.19.1',
13128
13130
  v8: '9.4.146.26-node.24',
@@ -15712,11 +15714,11 @@ _fieldFunction.field[ns.ui('Choice').uri] = function (dom, container, already, s
15712
15714
  subForm: subForm,
15713
15715
  disambiguate: false
15714
15716
  };
15715
- function getSelectorOptions() {
15717
+ function getSelectorOptions(dataSource) {
15716
15718
  var possible = [];
15717
15719
  var possibleProperties;
15718
15720
  possible = kb.each(undefined, ns.rdf('type'), uiFrom, formDoc);
15719
- for (var x in findMembersNT(kb, uiFrom, dataDoc)) {
15721
+ for (var x in findMembersNT(kb, uiFrom, dataSource)) {
15720
15722
  possible.push(kb.fromNT(x));
15721
15723
  } // Use rdfs
15722
15724
 
@@ -15748,6 +15750,10 @@ _fieldFunction.field[ns.ui('Choice').uri] = function (dom, container, already, s
15748
15750
 
15749
15751
  var multiSelect = kb.any(form, ui('multiselect')); // Optional
15750
15752
  if (multiSelect) opts.multiSelect = true;
15753
+
15754
+ // options parameters
15755
+ var dataSource = kb.any(form, ui('options'), kb.literal('search-full-store')).length ? null : dataDoc; // optional
15756
+
15751
15757
  var selector;
15752
15758
  rhs.refresh = function () {
15753
15759
  // from ui:property
@@ -15755,7 +15761,7 @@ _fieldFunction.field[ns.ui('Choice').uri] = function (dom, container, already, s
15755
15761
  return object.value;
15756
15762
  });
15757
15763
  // from ui:from + ui:property
15758
- var possibleOptions = getSelectorOptions();
15764
+ var possibleOptions = getSelectorOptions(dataSource);
15759
15765
  possibleOptions.push(selectedOptions);
15760
15766
  possibleOptions = sortByLabel(possibleOptions);
15761
15767
  selector = makeSelectForChoice(dom, rhs, kb, subject, property, possibleOptions, selectedOptions, uiFrom, opts, dataDoc, callbackFunction);
@@ -25557,7 +25563,10 @@ function removeOidcQueryParam(redirectUrl) {
25557
25563
  cleanedUrl.searchParams.delete("code");
25558
25564
  cleanedUrl.searchParams.delete("state");
25559
25565
  cleanedUrl.hash = "";
25560
- return cleanedUrl.toString();
25566
+ if (redirectUrl.includes(`${cleanedUrl.origin}/`)) {
25567
+ return cleanedUrl.href;
25568
+ }
25569
+ return `${cleanedUrl.origin}${cleanedUrl.href.substring(cleanedUrl.origin.length + 1)}`;
25561
25570
  }
25562
25571
  async function clearOidcPersistentStorage() {
25563
25572
  const client = new _inrupt_oidc_client__WEBPACK_IMPORTED_MODULE_0__.OidcClient({
@@ -26225,7 +26234,7 @@ class IssuerConfigFetcher {
26225
26234
  }
26226
26235
  async fetchConfig(issuer) {
26227
26236
  let issuerConfig;
26228
- const openIdConfigUrl = new URL(exports.WELL_KNOWN_OPENID_CONFIG, issuer).href;
26237
+ const openIdConfigUrl = new URL(exports.WELL_KNOWN_OPENID_CONFIG, issuer.endsWith("/") ? issuer : `${issuer}/`).href;
26229
26238
  const issuerConfigRequestBody = await window.fetch(openIdConfigUrl);
26230
26239
  try {
26231
26240
  issuerConfig = processConfig(await issuerConfigRequestBody.json());
@@ -26402,12 +26411,6 @@ class AuthCodeRedirectHandler {
26402
26411
  webId: tokens.webId,
26403
26412
  isLoggedIn: "true",
26404
26413
  }, { secure: true });
26405
- url.searchParams.delete("code");
26406
- await this.storageUtility.setForUser(storedSessionId, {
26407
- redirectUrl: url.toString(),
26408
- }, {
26409
- secure: false,
26410
- });
26411
26414
  const sessionInfo = await this.sessionInfoManager.get(storedSessionId);
26412
26415
  if (!sessionInfo) {
26413
26416
  throw new Error(`Could not retrieve session: [${storedSessionId}].`);
@@ -52249,7 +52252,6 @@ var BlankNode = /*#__PURE__*/function (_Node) {
52249
52252
  function getId(id) {
52250
52253
  if (id) {
52251
52254
  if (typeof id !== 'string') {
52252
- console.log('Bad blank id:', id);
52253
52255
  throw new Error('Bad id argument to new blank node: ' + id);
52254
52256
  }
52255
52257
  if (id.includes('#')) {
@@ -53876,7 +53878,7 @@ var Fetcher = /*#__PURE__*/function () {
53876
53878
  size: 0,
53877
53879
  timeout: 0
53878
53880
  };
53879
- console.log('Fetcher: <' + actualProxyURI + '> Non-HTTP fetch exception: ' + error);
53881
+ // console.log('Fetcher: <' + actualProxyURI + '> Non-HTTP fetch exception: ' + error)
53880
53882
  return _this5.handleError(dummyResponse, docuri, options); // possible credentials retry
53881
53883
  // return this.failFetch(options, 'fetch failed: ' + error, 999, dummyResponse) // Fake status code: fetch exception
53882
53884
 
@@ -53937,25 +53939,21 @@ var Fetcher = /*#__PURE__*/function () {
53937
53939
  if (fetchResponse.ok) {
53938
53940
  userCallback(true, 'OK', fetchResponse);
53939
53941
  } else {
53940
- // console.log('@@@ fetcher.js Should not take this path !!!!!!!!!!!!')
53941
53942
  var oops = 'HTTP error: Status ' + fetchResponse.status + ' (' + fetchResponse.statusText + ')';
53942
53943
  if (fetchResponse.responseText) {
53943
53944
  oops += ' ' + fetchResponse.responseText; // not in 404, dns error, nock failure
53944
53945
  }
53945
53946
 
53946
- console.log(oops + ' fetching ' + uri);
53947
53947
  userCallback(false, oops, fetchResponse);
53948
53948
  }
53949
53949
  } else {
53950
53950
  var _oops = '@@ nowOrWhenFetched: no response object!';
53951
- console.log(_oops);
53952
53951
  userCallback(false, _oops);
53953
53952
  }
53954
53953
  }
53955
53954
  }, function (err) {
53956
53955
  var message = err.message || err.statusText;
53957
53956
  message = 'Failed to load <' + uri + '> ' + message;
53958
- console.log(message);
53959
53957
  if (err.response && err.response.status) {
53960
53958
  message += ' status: ' + err.response.status;
53961
53959
  }
@@ -54194,45 +54192,42 @@ var Fetcher = /*#__PURE__*/function () {
54194
54192
  return fetcher.load(doc);
54195
54193
  case 6:
54196
54194
  response = _context2.sent;
54197
- _context2.next = 29;
54195
+ _context2.next = 26;
54198
54196
  break;
54199
54197
  case 9:
54200
54198
  _context2.prev = 9;
54201
54199
  _context2.t0 = _context2["catch"](3);
54202
54200
  if (!(_context2.t0.response.status === 404)) {
54203
- _context2.next = 27;
54201
+ _context2.next = 25;
54204
54202
  break;
54205
54203
  }
54206
- console.log('createIfNotExists: doc does NOT exist, will create... ' + doc);
54207
- _context2.prev = 13;
54208
- _context2.next = 16;
54204
+ _context2.prev = 12;
54205
+ _context2.next = 15;
54209
54206
  return fetcher.webOperation('PUT', doc.value, {
54210
54207
  data: data,
54211
54208
  contentType: contentType
54212
54209
  });
54213
- case 16:
54210
+ case 15:
54214
54211
  response = _context2.sent;
54215
- _context2.next = 23;
54212
+ _context2.next = 21;
54216
54213
  break;
54217
- case 19:
54218
- _context2.prev = 19;
54219
- _context2.t1 = _context2["catch"](13);
54220
- console.log('createIfNotExists doc FAILED: ' + doc + ': ' + _context2.t1);
54214
+ case 18:
54215
+ _context2.prev = 18;
54216
+ _context2.t1 = _context2["catch"](12);
54221
54217
  throw _context2.t1;
54222
- case 23:
54218
+ case 21:
54223
54219
  delete fetcher.requested[doc.value]; // delete cached 404 error
54224
54220
  // console.log('createIfNotExists doc created ok ' + doc)
54225
54221
  return _context2.abrupt("return", response);
54226
- case 27:
54227
- console.log('createIfNotExists doc load error NOT 404: ' + doc + ': ' + _context2.t0);
54222
+ case 25:
54228
54223
  throw _context2.t0;
54229
- case 29:
54224
+ case 26:
54230
54225
  return _context2.abrupt("return", response);
54231
- case 30:
54226
+ case 27:
54232
54227
  case "end":
54233
54228
  return _context2.stop();
54234
54229
  }
54235
- }, _callee2, this, [[3, 9], [13, 19]]);
54230
+ }, _callee2, this, [[3, 9], [12, 18]]);
54236
54231
  }));
54237
54232
  function createIfNotExists(_x4) {
54238
54233
  return _createIfNotExists.apply(this, arguments);
@@ -54541,7 +54536,8 @@ var Fetcher = /*#__PURE__*/function () {
54541
54536
  }, {
54542
54537
  key: "retryNoCredentials",
54543
54538
  value: function retryNoCredentials(docuri, options) {
54544
- console.log('Fetcher: CORS: RETRYING with NO CREDENTIALS for ' + options.resource);
54539
+ // console.log('Fetcher: CORS: RETRYING with NO CREDENTIALS for ' + options.resource)
54540
+
54545
54541
  options.retriedWithNoCredentials = true; // protect against being called twice
54546
54542
 
54547
54543
  delete this.requested[docuri]; // forget the original request happened
@@ -54586,7 +54582,7 @@ var Fetcher = /*#__PURE__*/function () {
54586
54582
  // Now attempt retry via proxy
54587
54583
  var proxyUri = Fetcher.crossSiteProxy(docuri);
54588
54584
  if (proxyUri && !options.proxyUsed) {
54589
- console.log('web: Direct failed so trying proxy ' + proxyUri);
54585
+ // console.log('web: Direct failed so trying proxy ' + proxyUri)
54590
54586
  return this.redirectToProxy(proxyUri, options);
54591
54587
  }
54592
54588
  }
@@ -54659,7 +54655,7 @@ var Fetcher = /*#__PURE__*/function () {
54659
54655
 
54660
54656
  // Check for masked errors (CORS, etc)
54661
54657
  if (response.status === 0) {
54662
- console.log('Masked error - status 0 for ' + docuri);
54658
+ // console.log('Masked error - status 0 for ' + docuri)
54663
54659
  return this.handleError(response, docuri, options);
54664
54660
  }
54665
54661
  if (response.status >= 400) {
@@ -55546,7 +55542,6 @@ var Formula = /*#__PURE__*/function (_Node) {
55546
55542
  while (todo.length) {
55547
55543
  follow(todo.shift());
55548
55544
  }
55549
- // console.log('' + result.length + ' statements about ' + subject)
55550
55545
  return result;
55551
55546
  }
55552
55547
 
@@ -55703,10 +55698,10 @@ var Formula = /*#__PURE__*/function (_Node) {
55703
55698
  var statementsCopy = this.statements.map(function (ea) {
55704
55699
  return ea.substitute(bindings);
55705
55700
  });
55706
- console.log('Formula subs statmnts:' + statementsCopy);
55701
+ // console.log('Formula subs statmnts:' + statementsCopy)
55707
55702
  var y = new Formula();
55708
55703
  y.addAll(statementsCopy);
55709
- console.log('indexed-form subs formula:' + y);
55704
+ // console.log('indexed-form subs formula:' + y)
55710
55705
  return y;
55711
55706
  }
55712
55707
  }, {
@@ -58518,7 +58513,6 @@ var Node = /*#__PURE__*/function () {
58518
58513
  (0,_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(Node, [{
58519
58514
  key: "substitute",
58520
58515
  value: function substitute(bindings) {
58521
- console.log('@@@ node substitute' + this);
58522
58516
  return this;
58523
58517
  }
58524
58518
 
@@ -62929,7 +62923,7 @@ var Statement = /*#__PURE__*/function () {
62929
62923
  key: "substitute",
62930
62924
  value: function substitute(bindings) {
62931
62925
  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);
62926
+ // console.log('@@@ statement substitute:' + y)
62933
62927
  return y;
62934
62928
  }
62935
62929
 
@@ -67054,7 +67048,7 @@ var SolidAuthnLogic = /** @class */ (function () {
67054
67048
  */
67055
67049
  SolidAuthnLogic.prototype.checkUser = function (setUserCallback) {
67056
67050
  return __awaiter(this, void 0, void 0, function () {
67057
- var preLoginRedirectHash, postLoginRedirectHash, curUrl, me, webId;
67051
+ var preLoginRedirectHash, redirectUrl, postLoginRedirectHash, curUrl, me, webId;
67058
67052
  return __generator(this, function (_a) {
67059
67053
  switch (_a.label) {
67060
67054
  case 0:
@@ -67066,20 +67060,16 @@ var SolidAuthnLogic = /** @class */ (function () {
67066
67060
  if (document.location.toString() !== url)
67067
67061
  history.replaceState(null, '', url);
67068
67062
  });
67069
- /**
67070
- * Handle a successful authentication redirect
67071
- */
67063
+ redirectUrl = new URL(window.location.href);
67064
+ redirectUrl.hash = '';
67072
67065
  return [4 /*yield*/, this.session
67073
67066
  .handleIncomingRedirect({
67074
67067
  restorePreviousSession: true,
67075
- url: window.location.href
67068
+ url: redirectUrl.href
67076
67069
  })
67077
67070
  // Check to see if a hash was stored in local storage
67078
67071
  ];
67079
67072
  case 1:
67080
- /**
67081
- * Handle a successful authentication redirect
67082
- */
67083
67073
  _a.sent();
67084
67074
  postLoginRedirectHash = window.localStorage.getItem('preLoginRedirectHash');
67085
67075
  if (postLoginRedirectHash) {
@@ -75179,33 +75169,21 @@ class RemoteJWKSet extends _local_js__WEBPACK_IMPORTED_MODULE_3__.LocalJWKSet {
75179
75169
  }
75180
75170
  async reload() {
75181
75171
  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
- });
75172
+ this._pendingFetch = undefined;
75208
75173
  }
75174
+ this._pendingFetch || (this._pendingFetch = (0,_runtime_fetch_jwks_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this._url, this._timeoutDuration, this._options)
75175
+ .then((json) => {
75176
+ if (!(0,_local_js__WEBPACK_IMPORTED_MODULE_3__.isJWKSLike)(json)) {
75177
+ throw new _util_errors_js__WEBPACK_IMPORTED_MODULE_2__.JWKSInvalid('JSON Web Key Set malformed');
75178
+ }
75179
+ this._jwks = { keys: json.keys };
75180
+ this._jwksTimestamp = Date.now();
75181
+ this._pendingFetch = undefined;
75182
+ })
75183
+ .catch((err) => {
75184
+ this._pendingFetch = undefined;
75185
+ throw err;
75186
+ }));
75209
75187
  await this._pendingFetch;
75210
75188
  }
75211
75189
  }