solid-ui 2.4.27-5b3471ff → 2.4.27-8c4294a2

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":
@@ -7160,6 +7170,8 @@ function renderSignInPopup(dom) {
7160
7170
  while (1) switch (_context.prev = _context.next) {
7161
7171
  case 0:
7162
7172
  _context.prev = 0;
7173
+ // clear authorization metadata from store
7174
+ _solidLogic.solidLogicSingleton.store.updater.flagAuthorizationMetadata();
7163
7175
  // Save hash
7164
7176
  preLoginRedirectHash = new URL(window.location.href).hash;
7165
7177
  if (preLoginRedirectHash) {
@@ -7169,23 +7181,23 @@ function renderSignInPopup(dom) {
7169
7181
  // Login
7170
7182
  locationUrl = new URL(window.location.href);
7171
7183
  locationUrl.hash = ''; // remove hash part
7172
- _context.next = 8;
7184
+ _context.next = 9;
7173
7185
  return _solidLogic.authSession.login({
7174
7186
  redirectUrl: locationUrl.href,
7175
7187
  oidcIssuer: issuerUri
7176
7188
  });
7177
- case 8:
7178
- _context.next = 13;
7189
+ case 9:
7190
+ _context.next = 14;
7179
7191
  break;
7180
- case 10:
7181
- _context.prev = 10;
7192
+ case 11:
7193
+ _context.prev = 11;
7182
7194
  _context.t0 = _context["catch"](0);
7183
7195
  (0, _log.alert)(_context.t0.message);
7184
- case 13:
7196
+ case 14:
7185
7197
  case "end":
7186
7198
  return _context.stop();
7187
7199
  }
7188
- }, _callee, null, [[0, 10]]);
7200
+ }, _callee, null, [[0, 11]]);
7189
7201
  }));
7190
7202
  return function loginToIssuer(_x11) {
7191
7203
  return _ref.apply(this, arguments);
@@ -7337,45 +7349,47 @@ _solidLogic.authSession.onLogout( /*#__PURE__*/(0, _asyncToGenerator2["default"]
7337
7349
  case 0:
7338
7350
  issuer = window.localStorage.getItem('loginIssuer');
7339
7351
  if (!issuer) {
7340
- _context2.next = 19;
7352
+ _context2.next = 20;
7341
7353
  break;
7342
7354
  }
7343
7355
  _context2.prev = 2;
7356
+ // clear authorization metadata from store
7357
+ _solidLogic.solidLogicSingleton.store.updater.flagAuthorizationMetadata();
7344
7358
  wellKnownUri = new URL(issuer);
7345
7359
  wellKnownUri.pathname = '/.well-known/openid-configuration';
7346
- _context2.next = 7;
7360
+ _context2.next = 8;
7347
7361
  return fetch(wellKnownUri.toString());
7348
- case 7:
7362
+ case 8:
7349
7363
  wellKnownResult = _context2.sent;
7350
7364
  if (!(wellKnownResult.status === 200)) {
7351
- _context2.next = 15;
7365
+ _context2.next = 16;
7352
7366
  break;
7353
7367
  }
7354
- _context2.next = 11;
7368
+ _context2.next = 12;
7355
7369
  return wellKnownResult.json();
7356
- case 11:
7370
+ case 12:
7357
7371
  openidConfiguration = _context2.sent;
7358
7372
  if (!(openidConfiguration && openidConfiguration.end_session_endpoint)) {
7359
- _context2.next = 15;
7373
+ _context2.next = 16;
7360
7374
  break;
7361
7375
  }
7362
- _context2.next = 15;
7376
+ _context2.next = 16;
7363
7377
  return fetch(openidConfiguration.end_session_endpoint, {
7364
7378
  credentials: 'include'
7365
7379
  });
7366
- case 15:
7367
- _context2.next = 19;
7380
+ case 16:
7381
+ _context2.next = 20;
7368
7382
  break;
7369
- case 17:
7370
- _context2.prev = 17;
7383
+ case 18:
7384
+ _context2.prev = 18;
7371
7385
  _context2.t0 = _context2["catch"](2);
7372
- case 19:
7373
- window.location.reload();
7374
7386
  case 20:
7387
+ window.location.reload();
7388
+ case 21:
7375
7389
  case "end":
7376
7390
  return _context2.stop();
7377
7391
  }
7378
- }, _callee2, null, [[2, 17]]);
7392
+ }, _callee2, null, [[2, 18]]);
7379
7393
  })));
7380
7394
 
7381
7395
  /**
@@ -13121,8 +13135,8 @@ Object.defineProperty(exports, "__esModule", ({
13121
13135
  }));
13122
13136
  exports.versionInfo = void 0;
13123
13137
  var versionInfo = {
13124
- buildTime: '2023-03-17T10:43:05Z',
13125
- commit: '5b3471ff0bc08942d334b9bc9a6992adcb5cdb6b',
13138
+ buildTime: '2023-04-05T15:36:28Z',
13139
+ commit: '8c4294a272f9374c231f6a7ea6c2e6f366dc50d1',
13126
13140
  npmInfo: {
13127
13141
  'solid-ui': '2.4.27',
13128
13142
  npm: '8.19.4',
@@ -53594,7 +53608,9 @@ var Fetcher = /*#__PURE__*/function () {
53594
53608
  if (!this._fetch) {
53595
53609
  throw new Error('No _fetch function available for Fetcher');
53596
53610
  }
53597
- this.appNode = this.store.rdfFactory.blankNode();
53611
+ // This is the name of the graph we store all the HTTP metadata in
53612
+ this.appNode = this.store.sym('chrome://TheCurrentSession');
53613
+ // this.appNode = this.store.rdfFactory.blankNode() // Needs to have a URI in tests
53598
53614
  this.store.fetcher = this; // Bi-linked
53599
53615
  this.requested = {};
53600
53616
  this.timeouts = {};
@@ -54426,17 +54442,19 @@ var Fetcher = /*#__PURE__*/function () {
54426
54442
  var _this10 = this;
54427
54443
  var kb = this.store;
54428
54444
  var responseNode = kb.bnode();
54429
- kb.add(options.req, this.ns.link('response'), responseNode, responseNode);
54430
- kb.add(responseNode, this.ns.http('status'), kb.rdfFactory.literal(response.status), responseNode);
54431
- kb.add(responseNode, this.ns.http('statusText'), kb.rdfFactory.literal(response.statusText), responseNode);
54445
+ kb.add(options.req, this.ns.link('response'), responseNode, this.appNode);
54446
+ kb.add(responseNode, this.ns.http('status'), kb.rdfFactory.literal(response.status), this.appNode);
54447
+ kb.add(responseNode, this.ns.http('statusText'), kb.rdfFactory.literal(response.statusText), this.appNode);
54432
54448
 
54433
54449
  // Save the response headers
54434
54450
  response.headers.forEach(function (value, header) {
54435
- kb.add(responseNode, _this10.ns.httph(header), _this10.store.rdfFactory.literal(value), responseNode);
54451
+ kb.add(responseNode, _this10.ns.httph(header), _this10.store.rdfFactory.literal(value), _this10.appNode);
54436
54452
  if (header === 'content-type') {
54437
- kb.add(options.resource, _this10.ns.rdf('type'), kb.rdfFactory.namedNode(_utils_js__WEBPACK_IMPORTED_MODULE_11__.mediaTypeClass(value).value), responseNode);
54453
+ kb.add(options.resource, _this10.ns.rdf('type'), kb.rdfFactory.namedNode(_utils_js__WEBPACK_IMPORTED_MODULE_11__.mediaTypeClass(value).value), _this10.appNode // responseNode
54454
+ );
54438
54455
  }
54439
54456
  });
54457
+
54440
54458
  return responseNode;
54441
54459
  }
54442
54460
  }, {
@@ -64235,17 +64253,22 @@ __webpack_require__.r(__webpack_exports__);
64235
64253
  /* harmony export */ "default": () => (/* binding */ UpdateManager)
64236
64254
  /* harmony export */ });
64237
64255
  /* harmony import */ var _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "./node_modules/@babel/runtime/helpers/esm/typeof.js");
64238
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js");
64239
- /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js");
64240
- /* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "./node_modules/@babel/runtime/helpers/esm/defineProperty.js");
64241
- /* harmony import */ var _store__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./store */ "./node_modules/rdflib/esm/store.js");
64242
- /* harmony import */ var _uri__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./uri */ "./node_modules/rdflib/esm/uri.js");
64243
- /* harmony import */ var _fetcher__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./fetcher */ "./node_modules/rdflib/esm/fetcher.js");
64244
- /* harmony import */ var _namespace__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./namespace */ "./node_modules/rdflib/esm/namespace.js");
64245
- /* harmony import */ var _serializer__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./serializer */ "./node_modules/rdflib/esm/serializer.js");
64246
- /* harmony import */ var _utils_terms__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./utils/terms */ "./node_modules/rdflib/esm/utils/terms.js");
64247
- /* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./utils-js */ "./node_modules/rdflib/esm/utils-js.js");
64248
- /* harmony import */ var _utils_termValue__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./utils/termValue */ "./node_modules/rdflib/esm/utils/termValue.js");
64256
+ /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js");
64257
+ /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js");
64258
+ /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js");
64259
+ /* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "./node_modules/@babel/runtime/helpers/esm/defineProperty.js");
64260
+ /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/regenerator */ "./node_modules/@babel/runtime/regenerator/index.js");
64261
+ /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_5__);
64262
+ /* harmony import */ var _store__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./store */ "./node_modules/rdflib/esm/store.js");
64263
+ /* harmony import */ var _uri__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./uri */ "./node_modules/rdflib/esm/uri.js");
64264
+ /* harmony import */ var _fetcher__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./fetcher */ "./node_modules/rdflib/esm/fetcher.js");
64265
+ /* harmony import */ var _namespace__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./namespace */ "./node_modules/rdflib/esm/namespace.js");
64266
+ /* harmony import */ var _serializer__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./serializer */ "./node_modules/rdflib/esm/serializer.js");
64267
+ /* harmony import */ var _utils_terms__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./utils/terms */ "./node_modules/rdflib/esm/utils/terms.js");
64268
+ /* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./utils-js */ "./node_modules/rdflib/esm/utils-js.js");
64269
+ /* harmony import */ var _utils_termValue__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./utils/termValue */ "./node_modules/rdflib/esm/utils/termValue.js");
64270
+
64271
+
64249
64272
 
64250
64273
 
64251
64274
 
@@ -64282,35 +64305,35 @@ var UpdateManager = /*#__PURE__*/function () {
64282
64305
  * @param store - The quadstore to store data and metadata. Created if not passed.
64283
64306
  */
64284
64307
  function UpdateManager(store) {
64285
- (0,_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__["default"])(this, UpdateManager);
64286
- (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_3__["default"])(this, "store", void 0);
64287
- (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_3__["default"])(this, "ifps", void 0);
64288
- (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_3__["default"])(this, "fps", void 0);
64289
- (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_3__["default"])(this, "patchControl", void 0);
64290
- (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_3__["default"])(this, "ns", void 0);
64291
- store = store || new _store__WEBPACK_IMPORTED_MODULE_4__["default"]();
64308
+ (0,_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2__["default"])(this, UpdateManager);
64309
+ (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_4__["default"])(this, "store", void 0);
64310
+ (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_4__["default"])(this, "ifps", void 0);
64311
+ (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_4__["default"])(this, "fps", void 0);
64312
+ (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_4__["default"])(this, "patchControl", void 0);
64313
+ (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_4__["default"])(this, "ns", void 0);
64314
+ store = store || new _store__WEBPACK_IMPORTED_MODULE_6__["default"]();
64292
64315
  if (store.updater) {
64293
64316
  throw new Error("You can't have two UpdateManagers for the same store");
64294
64317
  }
64295
64318
  if (!store.fetcher) {
64296
- store.fetcher = new _fetcher__WEBPACK_IMPORTED_MODULE_5__["default"](store);
64319
+ store.fetcher = new _fetcher__WEBPACK_IMPORTED_MODULE_7__["default"](store);
64297
64320
  }
64298
64321
  this.store = store;
64299
64322
  store.updater = this;
64300
64323
  this.ifps = {};
64301
64324
  this.fps = {};
64302
64325
  this.ns = {};
64303
- this.ns.link = (0,_namespace__WEBPACK_IMPORTED_MODULE_6__["default"])('http://www.w3.org/2007/ont/link#');
64304
- this.ns.http = (0,_namespace__WEBPACK_IMPORTED_MODULE_6__["default"])('http://www.w3.org/2007/ont/http#');
64305
- this.ns.httph = (0,_namespace__WEBPACK_IMPORTED_MODULE_6__["default"])('http://www.w3.org/2007/ont/httph#');
64306
- this.ns.ldp = (0,_namespace__WEBPACK_IMPORTED_MODULE_6__["default"])('http://www.w3.org/ns/ldp#');
64307
- this.ns.rdf = (0,_namespace__WEBPACK_IMPORTED_MODULE_6__["default"])('http://www.w3.org/1999/02/22-rdf-syntax-ns#');
64308
- this.ns.rdfs = (0,_namespace__WEBPACK_IMPORTED_MODULE_6__["default"])('http://www.w3.org/2000/01/rdf-schema#');
64309
- this.ns.rdf = (0,_namespace__WEBPACK_IMPORTED_MODULE_6__["default"])('http://www.w3.org/1999/02/22-rdf-syntax-ns#');
64310
- this.ns.owl = (0,_namespace__WEBPACK_IMPORTED_MODULE_6__["default"])('http://www.w3.org/2002/07/owl#');
64326
+ this.ns.link = (0,_namespace__WEBPACK_IMPORTED_MODULE_8__["default"])('http://www.w3.org/2007/ont/link#');
64327
+ this.ns.http = (0,_namespace__WEBPACK_IMPORTED_MODULE_8__["default"])('http://www.w3.org/2007/ont/http#');
64328
+ this.ns.httph = (0,_namespace__WEBPACK_IMPORTED_MODULE_8__["default"])('http://www.w3.org/2007/ont/httph#');
64329
+ this.ns.ldp = (0,_namespace__WEBPACK_IMPORTED_MODULE_8__["default"])('http://www.w3.org/ns/ldp#');
64330
+ this.ns.rdf = (0,_namespace__WEBPACK_IMPORTED_MODULE_8__["default"])('http://www.w3.org/1999/02/22-rdf-syntax-ns#');
64331
+ this.ns.rdfs = (0,_namespace__WEBPACK_IMPORTED_MODULE_8__["default"])('http://www.w3.org/2000/01/rdf-schema#');
64332
+ this.ns.rdf = (0,_namespace__WEBPACK_IMPORTED_MODULE_8__["default"])('http://www.w3.org/1999/02/22-rdf-syntax-ns#');
64333
+ this.ns.owl = (0,_namespace__WEBPACK_IMPORTED_MODULE_8__["default"])('http://www.w3.org/2002/07/owl#');
64311
64334
  this.patchControl = [];
64312
64335
  }
64313
- (0,_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2__["default"])(UpdateManager, [{
64336
+ (0,_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_3__["default"])(UpdateManager, [{
64314
64337
  key: "patchControlFor",
64315
64338
  value: function patchControlFor(doc) {
64316
64339
  if (!this.patchControl[doc.value]) {
@@ -64324,13 +64347,87 @@ var UpdateManager = /*#__PURE__*/function () {
64324
64347
  return uri.slice(0, 4) === 'http';
64325
64348
  }
64326
64349
 
64350
+ /** Remove from the store HTTP authorization metadata
64351
+ * The editble function below relies on copies we have in the store
64352
+ * of the results of previous HTTP transactions. Howver, when
64353
+ * the user logs in, then that data misrepresents what would happen
64354
+ * if the user tried again.
64355
+ */
64356
+ }, {
64357
+ key: "flagAuthorizationMetadata",
64358
+ value: function flagAuthorizationMetadata() {
64359
+ var kb = this.store;
64360
+ var meta = kb.fetcher.appNode;
64361
+ var requests = kb.statementsMatching(undefined, this.ns.link('requestedURI'), undefined, meta).map(function (st) {
64362
+ return st.subject;
64363
+ });
64364
+ var _iterator = _createForOfIteratorHelper(requests),
64365
+ _step;
64366
+ try {
64367
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
64368
+ var request = _step.value;
64369
+ var _response = kb.any(request, this.ns.link('response'), null, meta);
64370
+ if (_response !== undefined) {
64371
+ // ts
64372
+ this.store.add(_response, this.ns.link('outOfDate'), true, meta); // @@ Boolean is fine - fix types
64373
+ }
64374
+ }
64375
+ } catch (err) {
64376
+ _iterator.e(err);
64377
+ } finally {
64378
+ _iterator.f();
64379
+ }
64380
+ }
64381
+
64327
64382
  /**
64328
64383
  * Tests whether a file is editable.
64329
64384
  * If the file has a specific annotation that it is machine written,
64330
64385
  * for safety, it is editable (this doesn't actually check for write access)
64331
64386
  * If the file has wac-allow and accept patch headers, those are respected.
64332
64387
  * and local write access is determined by those headers.
64333
- * This version only looks at past HTTP requests, does not make new ones.
64388
+ * This async version not only looks at past HTTP requests, it also makes new ones if necessary.
64389
+ *
64390
+ * @returns The method string SPARQL or DAV or
64391
+ * LOCALFILE or false if known, undefined if not known.
64392
+ */
64393
+ }, {
64394
+ key: "checkEditable",
64395
+ value: function () {
64396
+ var _checkEditable = (0,_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__["default"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_5___default().mark(function _callee(uri, kb) {
64397
+ var initial, final;
64398
+ return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_5___default().wrap(function _callee$(_context) {
64399
+ while (1) switch (_context.prev = _context.next) {
64400
+ case 0:
64401
+ initial = this.editable(uri, kb);
64402
+ if (!(initial !== undefined)) {
64403
+ _context.next = 3;
64404
+ break;
64405
+ }
64406
+ return _context.abrupt("return", initial);
64407
+ case 3:
64408
+ _context.next = 5;
64409
+ return this.store.fetcher.load(uri);
64410
+ case 5:
64411
+ final = this.editable(uri, kb); // console.log(`Loaded ${uri} just to check editable, result: ${final}.`)
64412
+ return _context.abrupt("return", final);
64413
+ case 7:
64414
+ case "end":
64415
+ return _context.stop();
64416
+ }
64417
+ }, _callee, this);
64418
+ }));
64419
+ function checkEditable(_x, _x2) {
64420
+ return _checkEditable.apply(this, arguments);
64421
+ }
64422
+ return checkEditable;
64423
+ }()
64424
+ /**
64425
+ * Tests whether a file is editable.
64426
+ * If the file has a specific annotation that it is machine written,
64427
+ * for safety, it is editable (this doesn't actually check for write access)
64428
+ * If the file has wac-allow and accept patch headers, those are respected.
64429
+ * and local write access is determined by those headers.
64430
+ * This synchronous version only looks at past HTTP requests, does not make new ones.
64334
64431
  *
64335
64432
  * @returns The method string SPARQL or DAV or
64336
64433
  * LOCALFILE or false if known, undefined if not known.
@@ -64345,29 +64442,36 @@ var UpdateManager = /*#__PURE__*/function () {
64345
64442
  if (!kb) {
64346
64443
  kb = this.store;
64347
64444
  }
64348
- uri = (0,_utils_termValue__WEBPACK_IMPORTED_MODULE_7__.termValue)(uri);
64445
+ uri = (0,_utils_termValue__WEBPACK_IMPORTED_MODULE_9__.termValue)(uri);
64349
64446
  if (!this.isHttpUri(uri)) {
64350
- if (kb.holds(this.store.rdfFactory.namedNode(uri), this.store.rdfFactory.namedNode('http://www.w3.org/1999/02/22-rdf-syntax-ns#type'), this.store.rdfFactory.namedNode('http://www.w3.org/2007/ont/link#MachineEditableDocument'))) {
64447
+ if (this.store.holds(this.store.rdfFactory.namedNode(uri), this.store.rdfFactory.namedNode('http://www.w3.org/1999/02/22-rdf-syntax-ns#type'), this.store.rdfFactory.namedNode('http://www.w3.org/2007/ont/link#MachineEditableDocument'))) {
64351
64448
  return 'LOCALFILE';
64352
64449
  }
64353
64450
  }
64354
64451
  var request;
64355
64452
  var definitive = false;
64453
+ var meta = this.store.fetcher.appNode;
64454
+ // const kb = s
64455
+
64356
64456
  // @ts-ignore passes a string to kb.each, which expects a term. Should this work?
64357
- var requests = kb.each(undefined, this.ns.link('requestedURI'), (0,_uri__WEBPACK_IMPORTED_MODULE_8__.docpart)(uri));
64457
+ var requests = kb.each(undefined, this.ns.link('requestedURI'), (0,_uri__WEBPACK_IMPORTED_MODULE_10__.docpart)(uri), meta);
64358
64458
  var method;
64359
64459
  for (var r = 0; r < requests.length; r++) {
64360
64460
  request = requests[r];
64361
64461
  if (request !== undefined) {
64362
- var response = kb.any(request, this.ns.link('response'));
64363
- if (request !== undefined) {
64364
- var wacAllow = kb.anyValue(response, this.ns.httph('wac-allow'));
64462
+ var _response2 = kb.any(request, this.ns.link('response'), null, meta);
64463
+ if (_response2 !== undefined) {
64464
+ // ts
64465
+
64466
+ var outOfDate = kb.anyJS(_response2, this.ns.link('outOfDate'), null, meta);
64467
+ if (outOfDate) continue;
64468
+ var wacAllow = kb.anyValue(_response2, this.ns.httph('wac-allow'));
64365
64469
  if (wacAllow) {
64366
- var _iterator = _createForOfIteratorHelper(wacAllow.split(',')),
64367
- _step;
64470
+ var _iterator2 = _createForOfIteratorHelper(wacAllow.split(',')),
64471
+ _step2;
64368
64472
  try {
64369
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
64370
- var bit = _step.value;
64473
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
64474
+ var bit = _step2.value;
64371
64475
  var lr = bit.split('=');
64372
64476
  if (lr[0].includes('user') && !lr[1].includes('write') && !lr[1].includes('append')) {
64373
64477
  // console.log(' editable? excluded by WAC-Allow: ', wacAllow)
@@ -64375,12 +64479,12 @@ var UpdateManager = /*#__PURE__*/function () {
64375
64479
  }
64376
64480
  }
64377
64481
  } catch (err) {
64378
- _iterator.e(err);
64482
+ _iterator2.e(err);
64379
64483
  } finally {
64380
- _iterator.f();
64484
+ _iterator2.f();
64381
64485
  }
64382
64486
  }
64383
- var acceptPatch = kb.each(response, this.ns.httph('accept-patch'));
64487
+ var acceptPatch = kb.each(_response2, this.ns.httph('accept-patch'));
64384
64488
  if (acceptPatch.length) {
64385
64489
  for (var i = 0; i < acceptPatch.length; i++) {
64386
64490
  method = acceptPatch[i].value.trim();
@@ -64388,7 +64492,7 @@ var UpdateManager = /*#__PURE__*/function () {
64388
64492
  if (method.indexOf('application/sparql-update-single-match') >= 0) return 'SPARQL';
64389
64493
  }
64390
64494
  }
64391
- var authorVia = kb.each(response, this.ns.httph('ms-author-via'));
64495
+ var authorVia = kb.each(_response2, this.ns.httph('ms-author-via'));
64392
64496
  if (authorVia.length) {
64393
64497
  for (var _i = 0; _i < authorVia.length; _i++) {
64394
64498
  method = authorVia[_i].value.trim();
@@ -64403,7 +64507,7 @@ var UpdateManager = /*#__PURE__*/function () {
64403
64507
  if (!this.isHttpUri(uri)) {
64404
64508
  if (!wacAllow) return false;else return 'LOCALFILE';
64405
64509
  }
64406
- var status = kb.each(response, this.ns.http('status'));
64510
+ var status = kb.each(_response2, this.ns.http('status'));
64407
64511
  if (status.length) {
64408
64512
  for (var _i2 = 0; _i2 < status.length; _i2++) {
64409
64513
  // @ts-ignore since statuses should be TFTerms, this should always be false
@@ -64452,7 +64556,7 @@ var UpdateManager = /*#__PURE__*/function () {
64452
64556
  key: "statementBnodes",
64453
64557
  value: function statementBnodes(st) {
64454
64558
  return [st.subject, st.predicate, st.object].filter(function (x) {
64455
- return (0,_utils_terms__WEBPACK_IMPORTED_MODULE_9__.isBlankNode)(x);
64559
+ return (0,_utils_terms__WEBPACK_IMPORTED_MODULE_11__.isBlankNode)(x);
64456
64560
  });
64457
64561
  }
64458
64562
 
@@ -64847,7 +64951,7 @@ var UpdateManager = /*#__PURE__*/function () {
64847
64951
  // console.log('Server does not support live updates through Updates-Via :-(')
64848
64952
  return false;
64849
64953
  }
64850
- wssURI = (0,_uri__WEBPACK_IMPORTED_MODULE_8__.join)(wssURI, doc.value);
64954
+ wssURI = (0,_uri__WEBPACK_IMPORTED_MODULE_10__.join)(wssURI, doc.value);
64851
64955
  var validWssURI = wssURI.replace(/^http:/, 'ws:').replace(/^https:/, 'wss:');
64852
64956
  // console.log('Web socket URI ' + wssURI)
64853
64957
 
@@ -64987,8 +65091,8 @@ var UpdateManager = /*#__PURE__*/function () {
64987
65091
 
64988
65092
  try {
64989
65093
  var kb = this.store;
64990
- var ds = !deletions ? [] : (0,_utils_terms__WEBPACK_IMPORTED_MODULE_9__.isStore)(deletions) ? deletions.statements : deletions instanceof Array ? deletions : [deletions];
64991
- var is = !insertions ? [] : (0,_utils_terms__WEBPACK_IMPORTED_MODULE_9__.isStore)(insertions) ? insertions.statements : insertions instanceof Array ? insertions : [insertions];
65094
+ var ds = !deletions ? [] : (0,_utils_terms__WEBPACK_IMPORTED_MODULE_11__.isStore)(deletions) ? deletions.statements : deletions instanceof Array ? deletions : [deletions];
65095
+ var is = !insertions ? [] : (0,_utils_terms__WEBPACK_IMPORTED_MODULE_11__.isStore)(insertions) ? insertions.statements : insertions instanceof Array ? insertions : [insertions];
64992
65096
  if (!(ds instanceof Array)) {
64993
65097
  throw new Error('Type Error ' + (0,_babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__["default"])(ds) + ': ' + ds);
64994
65098
  }
@@ -65145,7 +65249,7 @@ var UpdateManager = /*#__PURE__*/function () {
65145
65249
  }
65146
65250
  }
65147
65251
  } catch (e) {
65148
- callback(undefined, false, 'Exception in update: ' + e + '\n' + _utils_js__WEBPACK_IMPORTED_MODULE_10__.stackString(e));
65252
+ callback(undefined, false, 'Exception in update: ' + e + '\n' + _utils_js__WEBPACK_IMPORTED_MODULE_12__.stackString(e));
65149
65253
  }
65150
65254
  }
65151
65255
  }, {
@@ -65168,7 +65272,7 @@ var UpdateManager = /*#__PURE__*/function () {
65168
65272
  // prepare contents of revised document
65169
65273
  var newSts = kb.statementsMatching(undefined, undefined, undefined, doc).slice(); // copy!
65170
65274
  for (var i = 0; i < ds.length; i++) {
65171
- _utils_js__WEBPACK_IMPORTED_MODULE_10__.RDFArrayRemove(newSts, ds[i]);
65275
+ _utils_js__WEBPACK_IMPORTED_MODULE_12__.RDFArrayRemove(newSts, ds[i]);
65172
65276
  }
65173
65277
  for (var _i9 = 0; _i9 < is.length; _i9++) {
65174
65278
  newSts.push(is[_i9]);
@@ -65179,7 +65283,7 @@ var UpdateManager = /*#__PURE__*/function () {
65179
65283
  var candidateTarget = kb.the(response, this.ns.httph('content-location'));
65180
65284
  var targetURI;
65181
65285
  if (candidateTarget) {
65182
- targetURI = (0,_uri__WEBPACK_IMPORTED_MODULE_8__.join)(candidateTarget.value, targetURI);
65286
+ targetURI = (0,_uri__WEBPACK_IMPORTED_MODULE_10__.join)(candidateTarget.value, targetURI);
65183
65287
  }
65184
65288
  options.contentType = contentType;
65185
65289
  options.noMeta = true;
@@ -65220,7 +65324,7 @@ var UpdateManager = /*#__PURE__*/function () {
65220
65324
  var newSts = kb.statementsMatching(undefined, undefined, undefined, doc).slice(); // copy!
65221
65325
 
65222
65326
  for (var i = 0; i < ds.length; i++) {
65223
- _utils_js__WEBPACK_IMPORTED_MODULE_10__.RDFArrayRemove(newSts, ds[i]);
65327
+ _utils_js__WEBPACK_IMPORTED_MODULE_12__.RDFArrayRemove(newSts, ds[i]);
65224
65328
  }
65225
65329
  for (var _i12 = 0; _i12 < is.length; _i12++) {
65226
65330
  newSts.push(is[_i12]);
@@ -65231,7 +65335,7 @@ var UpdateManager = /*#__PURE__*/function () {
65231
65335
  throw new Error('Rewriting file: No filename extension: ' + doc.value);
65232
65336
  }
65233
65337
  var ext = doc.value.slice(dot + 1);
65234
- var contentType = _fetcher__WEBPACK_IMPORTED_MODULE_5__["default"].CONTENT_TYPE_BY_EXT[ext];
65338
+ var contentType = _fetcher__WEBPACK_IMPORTED_MODULE_7__["default"].CONTENT_TYPE_BY_EXT[ext];
65235
65339
  if (!contentType) {
65236
65340
  throw new Error('File extension .' + ext + ' not supported for data write');
65237
65341
  }
@@ -65264,7 +65368,7 @@ var UpdateManager = /*#__PURE__*/function () {
65264
65368
  }
65265
65369
 
65266
65370
  // serialize to the appropriate format
65267
- var sz = (0,_serializer__WEBPACK_IMPORTED_MODULE_11__["default"])(kb);
65371
+ var sz = (0,_serializer__WEBPACK_IMPORTED_MODULE_13__["default"])(kb);
65268
65372
  sz.suggestNamespaces(kb.namespaces);
65269
65373
  sz.setBase(uri);
65270
65374
  switch (contentType) {
@@ -79206,6 +79310,8 @@ module.exports = JSON.parse('{"application/1d-interleaved-parityfec":{"source":"
79206
79310
  /******/ // This entry module is referenced by other modules so it can't be inlined
79207
79311
  /******/ var __webpack_exports__ = __webpack_require__("./lib/index.js");
79208
79312
  /******/
79313
+ /******/ return __webpack_exports__;
79209
79314
  /******/ })()
79210
79315
  ;
79211
- //# sourceMappingURL=main.js.map
79316
+ });
79317
+ //# sourceMappingURL=solid-ui.js.map