solid-ui 2.4.27-cc09c445 → 2.4.27-f9084b4c
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 +1 -9
- package/dist/{main.js → solid-ui.js} +198 -92
- package/dist/solid-ui.js.map +1 -0
- package/dist/solid-ui.min.js +3 -0
- package/dist/solid-ui.min.js.LICENSE.txt +117 -0
- package/dist/solid-ui.min.js.map +1 -0
- package/lib/login/login.d.ts.map +1 -1
- package/lib/login/login.js +26 -22
- package/lib/login/login.js.map +1 -1
- package/lib/versionInfo.js +5 -5
- package/lib/versionInfo.js.map +1 -1
- package/lib/widgets/forms.js +3 -3
- package/lib/widgets/forms.js.map +1 -1
- package/package.json +6 -5
- package/dist/main.js.map +0 -1
package/dist/index.html
CHANGED
|
@@ -1,9 +1 @@
|
|
|
1
|
-
<!
|
|
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
|
-
|
|
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 =
|
|
7184
|
+
_context.next = 9;
|
|
7173
7185
|
return _solidLogic.authSession.login({
|
|
7174
7186
|
redirectUrl: locationUrl.href,
|
|
7175
7187
|
oidcIssuer: issuerUri
|
|
7176
7188
|
});
|
|
7177
|
-
case
|
|
7178
|
-
_context.next =
|
|
7189
|
+
case 9:
|
|
7190
|
+
_context.next = 14;
|
|
7179
7191
|
break;
|
|
7180
|
-
case
|
|
7181
|
-
_context.prev =
|
|
7192
|
+
case 11:
|
|
7193
|
+
_context.prev = 11;
|
|
7182
7194
|
_context.t0 = _context["catch"](0);
|
|
7183
7195
|
(0, _log.alert)(_context.t0.message);
|
|
7184
|
-
case
|
|
7196
|
+
case 14:
|
|
7185
7197
|
case "end":
|
|
7186
7198
|
return _context.stop();
|
|
7187
7199
|
}
|
|
7188
|
-
}, _callee, null, [[0,
|
|
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 =
|
|
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 =
|
|
7360
|
+
_context2.next = 8;
|
|
7347
7361
|
return fetch(wellKnownUri.toString());
|
|
7348
|
-
case
|
|
7362
|
+
case 8:
|
|
7349
7363
|
wellKnownResult = _context2.sent;
|
|
7350
7364
|
if (!(wellKnownResult.status === 200)) {
|
|
7351
|
-
_context2.next =
|
|
7365
|
+
_context2.next = 16;
|
|
7352
7366
|
break;
|
|
7353
7367
|
}
|
|
7354
|
-
_context2.next =
|
|
7368
|
+
_context2.next = 12;
|
|
7355
7369
|
return wellKnownResult.json();
|
|
7356
|
-
case
|
|
7370
|
+
case 12:
|
|
7357
7371
|
openidConfiguration = _context2.sent;
|
|
7358
7372
|
if (!(openidConfiguration && openidConfiguration.end_session_endpoint)) {
|
|
7359
|
-
_context2.next =
|
|
7373
|
+
_context2.next = 16;
|
|
7360
7374
|
break;
|
|
7361
7375
|
}
|
|
7362
|
-
_context2.next =
|
|
7376
|
+
_context2.next = 16;
|
|
7363
7377
|
return fetch(openidConfiguration.end_session_endpoint, {
|
|
7364
7378
|
credentials: 'include'
|
|
7365
7379
|
});
|
|
7366
|
-
case
|
|
7367
|
-
_context2.next =
|
|
7380
|
+
case 16:
|
|
7381
|
+
_context2.next = 20;
|
|
7368
7382
|
break;
|
|
7369
|
-
case
|
|
7370
|
-
_context2.prev =
|
|
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,
|
|
7392
|
+
}, _callee2, null, [[2, 18]]);
|
|
7379
7393
|
})));
|
|
7380
7394
|
|
|
7381
7395
|
/**
|
|
@@ -13121,17 +13135,17 @@ Object.defineProperty(exports, "__esModule", ({
|
|
|
13121
13135
|
}));
|
|
13122
13136
|
exports.versionInfo = void 0;
|
|
13123
13137
|
var versionInfo = {
|
|
13124
|
-
buildTime: '2023-
|
|
13125
|
-
commit: '
|
|
13138
|
+
buildTime: '2023-04-06T12:13:32Z',
|
|
13139
|
+
commit: 'f9084b4cf727fd1908e9c9b310c367c4eefa04ab',
|
|
13126
13140
|
npmInfo: {
|
|
13127
13141
|
'solid-ui': '2.4.27',
|
|
13128
13142
|
npm: '8.19.4',
|
|
13129
|
-
node: '16.
|
|
13130
|
-
v8: '9.4.146.26-node.
|
|
13143
|
+
node: '16.20.0',
|
|
13144
|
+
v8: '9.4.146.26-node.26',
|
|
13131
13145
|
uv: '1.43.0',
|
|
13132
13146
|
zlib: '1.2.11',
|
|
13133
13147
|
brotli: '1.0.9',
|
|
13134
|
-
ares: '1.
|
|
13148
|
+
ares: '1.19.0',
|
|
13135
13149
|
modules: '93',
|
|
13136
13150
|
nghttp2: '1.47.0',
|
|
13137
13151
|
napi: '8',
|
|
@@ -15673,7 +15687,7 @@ _fieldFunction.field[ns.ui('Classifier').uri] = function (dom, container, alread
|
|
|
15673
15687
|
** <select id=dropDownSelect>
|
|
15674
15688
|
** <option> ....
|
|
15675
15689
|
** <subForm>
|
|
15676
|
-
** Alternative implementatons
|
|
15690
|
+
** Alternative implementatons could be:
|
|
15677
15691
|
** -- pop-up menu (as here)
|
|
15678
15692
|
** -- radio buttons
|
|
15679
15693
|
** -- auto-complete typing
|
|
@@ -15751,8 +15765,8 @@ _fieldFunction.field[ns.ui('Choice').uri] = function (dom, container, already, s
|
|
|
15751
15765
|
var multiSelect = kb.any(form, ui('multiselect')); // Optional
|
|
15752
15766
|
if (multiSelect) opts.multiSelect = true;
|
|
15753
15767
|
|
|
15754
|
-
//
|
|
15755
|
-
var dataSource = kb.any(form, ui('
|
|
15768
|
+
// by default searches the dataDoc graph or optionally the full store
|
|
15769
|
+
var dataSource = kb.any(form, ui('search-full-store')).length ? null : dataDoc; // optional
|
|
15756
15770
|
|
|
15757
15771
|
var selector;
|
|
15758
15772
|
rhs.refresh = function () {
|
|
@@ -53598,7 +53612,9 @@ var Fetcher = /*#__PURE__*/function () {
|
|
|
53598
53612
|
if (!this._fetch) {
|
|
53599
53613
|
throw new Error('No _fetch function available for Fetcher');
|
|
53600
53614
|
}
|
|
53601
|
-
|
|
53615
|
+
// This is the name of the graph we store all the HTTP metadata in
|
|
53616
|
+
this.appNode = this.store.sym('chrome://TheCurrentSession');
|
|
53617
|
+
// this.appNode = this.store.rdfFactory.blankNode() // Needs to have a URI in tests
|
|
53602
53618
|
this.store.fetcher = this; // Bi-linked
|
|
53603
53619
|
this.requested = {};
|
|
53604
53620
|
this.timeouts = {};
|
|
@@ -54430,17 +54446,19 @@ var Fetcher = /*#__PURE__*/function () {
|
|
|
54430
54446
|
var _this10 = this;
|
|
54431
54447
|
var kb = this.store;
|
|
54432
54448
|
var responseNode = kb.bnode();
|
|
54433
|
-
kb.add(options.req, this.ns.link('response'), responseNode,
|
|
54434
|
-
kb.add(responseNode, this.ns.http('status'), kb.rdfFactory.literal(response.status),
|
|
54435
|
-
kb.add(responseNode, this.ns.http('statusText'), kb.rdfFactory.literal(response.statusText),
|
|
54449
|
+
kb.add(options.req, this.ns.link('response'), responseNode, this.appNode);
|
|
54450
|
+
kb.add(responseNode, this.ns.http('status'), kb.rdfFactory.literal(response.status), this.appNode);
|
|
54451
|
+
kb.add(responseNode, this.ns.http('statusText'), kb.rdfFactory.literal(response.statusText), this.appNode);
|
|
54436
54452
|
|
|
54437
54453
|
// Save the response headers
|
|
54438
54454
|
response.headers.forEach(function (value, header) {
|
|
54439
|
-
kb.add(responseNode, _this10.ns.httph(header), _this10.store.rdfFactory.literal(value),
|
|
54455
|
+
kb.add(responseNode, _this10.ns.httph(header), _this10.store.rdfFactory.literal(value), _this10.appNode);
|
|
54440
54456
|
if (header === 'content-type') {
|
|
54441
|
-
kb.add(options.resource, _this10.ns.rdf('type'), kb.rdfFactory.namedNode(_utils_js__WEBPACK_IMPORTED_MODULE_11__.mediaTypeClass(value).value), responseNode
|
|
54457
|
+
kb.add(options.resource, _this10.ns.rdf('type'), kb.rdfFactory.namedNode(_utils_js__WEBPACK_IMPORTED_MODULE_11__.mediaTypeClass(value).value), _this10.appNode // responseNode
|
|
54458
|
+
);
|
|
54442
54459
|
}
|
|
54443
54460
|
});
|
|
54461
|
+
|
|
54444
54462
|
return responseNode;
|
|
54445
54463
|
}
|
|
54446
54464
|
}, {
|
|
@@ -64239,17 +64257,22 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
64239
64257
|
/* harmony export */ "default": () => (/* binding */ UpdateManager)
|
|
64240
64258
|
/* harmony export */ });
|
|
64241
64259
|
/* 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");
|
|
64242
|
-
/* harmony import */ var
|
|
64243
|
-
/* harmony import */ var
|
|
64244
|
-
/* harmony import */ var
|
|
64245
|
-
/* harmony import */ var
|
|
64246
|
-
/* harmony import */ var
|
|
64247
|
-
/* harmony import */ var
|
|
64248
|
-
/* harmony import */ var
|
|
64249
|
-
/* harmony import */ var
|
|
64250
|
-
/* harmony import */ var
|
|
64251
|
-
/* harmony import */ var
|
|
64252
|
-
/* harmony import */ var
|
|
64260
|
+
/* 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");
|
|
64261
|
+
/* 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");
|
|
64262
|
+
/* 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");
|
|
64263
|
+
/* 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");
|
|
64264
|
+
/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/regenerator */ "./node_modules/@babel/runtime/regenerator/index.js");
|
|
64265
|
+
/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_5__);
|
|
64266
|
+
/* harmony import */ var _store__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./store */ "./node_modules/rdflib/esm/store.js");
|
|
64267
|
+
/* harmony import */ var _uri__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./uri */ "./node_modules/rdflib/esm/uri.js");
|
|
64268
|
+
/* harmony import */ var _fetcher__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./fetcher */ "./node_modules/rdflib/esm/fetcher.js");
|
|
64269
|
+
/* harmony import */ var _namespace__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./namespace */ "./node_modules/rdflib/esm/namespace.js");
|
|
64270
|
+
/* harmony import */ var _serializer__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./serializer */ "./node_modules/rdflib/esm/serializer.js");
|
|
64271
|
+
/* harmony import */ var _utils_terms__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./utils/terms */ "./node_modules/rdflib/esm/utils/terms.js");
|
|
64272
|
+
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./utils-js */ "./node_modules/rdflib/esm/utils-js.js");
|
|
64273
|
+
/* harmony import */ var _utils_termValue__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./utils/termValue */ "./node_modules/rdflib/esm/utils/termValue.js");
|
|
64274
|
+
|
|
64275
|
+
|
|
64253
64276
|
|
|
64254
64277
|
|
|
64255
64278
|
|
|
@@ -64286,35 +64309,35 @@ var UpdateManager = /*#__PURE__*/function () {
|
|
|
64286
64309
|
* @param store - The quadstore to store data and metadata. Created if not passed.
|
|
64287
64310
|
*/
|
|
64288
64311
|
function UpdateManager(store) {
|
|
64289
|
-
(0,
|
|
64290
|
-
(0,
|
|
64291
|
-
(0,
|
|
64292
|
-
(0,
|
|
64293
|
-
(0,
|
|
64294
|
-
(0,
|
|
64295
|
-
store = store || new
|
|
64312
|
+
(0,_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2__["default"])(this, UpdateManager);
|
|
64313
|
+
(0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_4__["default"])(this, "store", void 0);
|
|
64314
|
+
(0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_4__["default"])(this, "ifps", void 0);
|
|
64315
|
+
(0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_4__["default"])(this, "fps", void 0);
|
|
64316
|
+
(0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_4__["default"])(this, "patchControl", void 0);
|
|
64317
|
+
(0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_4__["default"])(this, "ns", void 0);
|
|
64318
|
+
store = store || new _store__WEBPACK_IMPORTED_MODULE_6__["default"]();
|
|
64296
64319
|
if (store.updater) {
|
|
64297
64320
|
throw new Error("You can't have two UpdateManagers for the same store");
|
|
64298
64321
|
}
|
|
64299
64322
|
if (!store.fetcher) {
|
|
64300
|
-
store.fetcher = new
|
|
64323
|
+
store.fetcher = new _fetcher__WEBPACK_IMPORTED_MODULE_7__["default"](store);
|
|
64301
64324
|
}
|
|
64302
64325
|
this.store = store;
|
|
64303
64326
|
store.updater = this;
|
|
64304
64327
|
this.ifps = {};
|
|
64305
64328
|
this.fps = {};
|
|
64306
64329
|
this.ns = {};
|
|
64307
|
-
this.ns.link = (0,
|
|
64308
|
-
this.ns.http = (0,
|
|
64309
|
-
this.ns.httph = (0,
|
|
64310
|
-
this.ns.ldp = (0,
|
|
64311
|
-
this.ns.rdf = (0,
|
|
64312
|
-
this.ns.rdfs = (0,
|
|
64313
|
-
this.ns.rdf = (0,
|
|
64314
|
-
this.ns.owl = (0,
|
|
64330
|
+
this.ns.link = (0,_namespace__WEBPACK_IMPORTED_MODULE_8__["default"])('http://www.w3.org/2007/ont/link#');
|
|
64331
|
+
this.ns.http = (0,_namespace__WEBPACK_IMPORTED_MODULE_8__["default"])('http://www.w3.org/2007/ont/http#');
|
|
64332
|
+
this.ns.httph = (0,_namespace__WEBPACK_IMPORTED_MODULE_8__["default"])('http://www.w3.org/2007/ont/httph#');
|
|
64333
|
+
this.ns.ldp = (0,_namespace__WEBPACK_IMPORTED_MODULE_8__["default"])('http://www.w3.org/ns/ldp#');
|
|
64334
|
+
this.ns.rdf = (0,_namespace__WEBPACK_IMPORTED_MODULE_8__["default"])('http://www.w3.org/1999/02/22-rdf-syntax-ns#');
|
|
64335
|
+
this.ns.rdfs = (0,_namespace__WEBPACK_IMPORTED_MODULE_8__["default"])('http://www.w3.org/2000/01/rdf-schema#');
|
|
64336
|
+
this.ns.rdf = (0,_namespace__WEBPACK_IMPORTED_MODULE_8__["default"])('http://www.w3.org/1999/02/22-rdf-syntax-ns#');
|
|
64337
|
+
this.ns.owl = (0,_namespace__WEBPACK_IMPORTED_MODULE_8__["default"])('http://www.w3.org/2002/07/owl#');
|
|
64315
64338
|
this.patchControl = [];
|
|
64316
64339
|
}
|
|
64317
|
-
(0,
|
|
64340
|
+
(0,_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_3__["default"])(UpdateManager, [{
|
|
64318
64341
|
key: "patchControlFor",
|
|
64319
64342
|
value: function patchControlFor(doc) {
|
|
64320
64343
|
if (!this.patchControl[doc.value]) {
|
|
@@ -64328,13 +64351,87 @@ var UpdateManager = /*#__PURE__*/function () {
|
|
|
64328
64351
|
return uri.slice(0, 4) === 'http';
|
|
64329
64352
|
}
|
|
64330
64353
|
|
|
64354
|
+
/** Remove from the store HTTP authorization metadata
|
|
64355
|
+
* The editble function below relies on copies we have in the store
|
|
64356
|
+
* of the results of previous HTTP transactions. Howver, when
|
|
64357
|
+
* the user logs in, then that data misrepresents what would happen
|
|
64358
|
+
* if the user tried again.
|
|
64359
|
+
*/
|
|
64360
|
+
}, {
|
|
64361
|
+
key: "flagAuthorizationMetadata",
|
|
64362
|
+
value: function flagAuthorizationMetadata() {
|
|
64363
|
+
var kb = this.store;
|
|
64364
|
+
var meta = kb.fetcher.appNode;
|
|
64365
|
+
var requests = kb.statementsMatching(undefined, this.ns.link('requestedURI'), undefined, meta).map(function (st) {
|
|
64366
|
+
return st.subject;
|
|
64367
|
+
});
|
|
64368
|
+
var _iterator = _createForOfIteratorHelper(requests),
|
|
64369
|
+
_step;
|
|
64370
|
+
try {
|
|
64371
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
64372
|
+
var request = _step.value;
|
|
64373
|
+
var _response = kb.any(request, this.ns.link('response'), null, meta);
|
|
64374
|
+
if (_response !== undefined) {
|
|
64375
|
+
// ts
|
|
64376
|
+
this.store.add(_response, this.ns.link('outOfDate'), true, meta); // @@ Boolean is fine - fix types
|
|
64377
|
+
}
|
|
64378
|
+
}
|
|
64379
|
+
} catch (err) {
|
|
64380
|
+
_iterator.e(err);
|
|
64381
|
+
} finally {
|
|
64382
|
+
_iterator.f();
|
|
64383
|
+
}
|
|
64384
|
+
}
|
|
64385
|
+
|
|
64331
64386
|
/**
|
|
64332
64387
|
* Tests whether a file is editable.
|
|
64333
64388
|
* If the file has a specific annotation that it is machine written,
|
|
64334
64389
|
* for safety, it is editable (this doesn't actually check for write access)
|
|
64335
64390
|
* If the file has wac-allow and accept patch headers, those are respected.
|
|
64336
64391
|
* and local write access is determined by those headers.
|
|
64337
|
-
* This version only looks at past HTTP requests,
|
|
64392
|
+
* This async version not only looks at past HTTP requests, it also makes new ones if necessary.
|
|
64393
|
+
*
|
|
64394
|
+
* @returns The method string SPARQL or DAV or
|
|
64395
|
+
* LOCALFILE or false if known, undefined if not known.
|
|
64396
|
+
*/
|
|
64397
|
+
}, {
|
|
64398
|
+
key: "checkEditable",
|
|
64399
|
+
value: function () {
|
|
64400
|
+
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) {
|
|
64401
|
+
var initial, final;
|
|
64402
|
+
return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_5___default().wrap(function _callee$(_context) {
|
|
64403
|
+
while (1) switch (_context.prev = _context.next) {
|
|
64404
|
+
case 0:
|
|
64405
|
+
initial = this.editable(uri, kb);
|
|
64406
|
+
if (!(initial !== undefined)) {
|
|
64407
|
+
_context.next = 3;
|
|
64408
|
+
break;
|
|
64409
|
+
}
|
|
64410
|
+
return _context.abrupt("return", initial);
|
|
64411
|
+
case 3:
|
|
64412
|
+
_context.next = 5;
|
|
64413
|
+
return this.store.fetcher.load(uri);
|
|
64414
|
+
case 5:
|
|
64415
|
+
final = this.editable(uri, kb); // console.log(`Loaded ${uri} just to check editable, result: ${final}.`)
|
|
64416
|
+
return _context.abrupt("return", final);
|
|
64417
|
+
case 7:
|
|
64418
|
+
case "end":
|
|
64419
|
+
return _context.stop();
|
|
64420
|
+
}
|
|
64421
|
+
}, _callee, this);
|
|
64422
|
+
}));
|
|
64423
|
+
function checkEditable(_x, _x2) {
|
|
64424
|
+
return _checkEditable.apply(this, arguments);
|
|
64425
|
+
}
|
|
64426
|
+
return checkEditable;
|
|
64427
|
+
}()
|
|
64428
|
+
/**
|
|
64429
|
+
* Tests whether a file is editable.
|
|
64430
|
+
* If the file has a specific annotation that it is machine written,
|
|
64431
|
+
* for safety, it is editable (this doesn't actually check for write access)
|
|
64432
|
+
* If the file has wac-allow and accept patch headers, those are respected.
|
|
64433
|
+
* and local write access is determined by those headers.
|
|
64434
|
+
* This synchronous version only looks at past HTTP requests, does not make new ones.
|
|
64338
64435
|
*
|
|
64339
64436
|
* @returns The method string SPARQL or DAV or
|
|
64340
64437
|
* LOCALFILE or false if known, undefined if not known.
|
|
@@ -64349,29 +64446,36 @@ var UpdateManager = /*#__PURE__*/function () {
|
|
|
64349
64446
|
if (!kb) {
|
|
64350
64447
|
kb = this.store;
|
|
64351
64448
|
}
|
|
64352
|
-
uri = (0,
|
|
64449
|
+
uri = (0,_utils_termValue__WEBPACK_IMPORTED_MODULE_9__.termValue)(uri);
|
|
64353
64450
|
if (!this.isHttpUri(uri)) {
|
|
64354
|
-
if (
|
|
64451
|
+
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'))) {
|
|
64355
64452
|
return 'LOCALFILE';
|
|
64356
64453
|
}
|
|
64357
64454
|
}
|
|
64358
64455
|
var request;
|
|
64359
64456
|
var definitive = false;
|
|
64457
|
+
var meta = this.store.fetcher.appNode;
|
|
64458
|
+
// const kb = s
|
|
64459
|
+
|
|
64360
64460
|
// @ts-ignore passes a string to kb.each, which expects a term. Should this work?
|
|
64361
|
-
var requests = kb.each(undefined, this.ns.link('requestedURI'), (0,
|
|
64461
|
+
var requests = kb.each(undefined, this.ns.link('requestedURI'), (0,_uri__WEBPACK_IMPORTED_MODULE_10__.docpart)(uri), meta);
|
|
64362
64462
|
var method;
|
|
64363
64463
|
for (var r = 0; r < requests.length; r++) {
|
|
64364
64464
|
request = requests[r];
|
|
64365
64465
|
if (request !== undefined) {
|
|
64366
|
-
var
|
|
64367
|
-
if (
|
|
64368
|
-
|
|
64466
|
+
var _response2 = kb.any(request, this.ns.link('response'), null, meta);
|
|
64467
|
+
if (_response2 !== undefined) {
|
|
64468
|
+
// ts
|
|
64469
|
+
|
|
64470
|
+
var outOfDate = kb.anyJS(_response2, this.ns.link('outOfDate'), null, meta);
|
|
64471
|
+
if (outOfDate) continue;
|
|
64472
|
+
var wacAllow = kb.anyValue(_response2, this.ns.httph('wac-allow'));
|
|
64369
64473
|
if (wacAllow) {
|
|
64370
|
-
var
|
|
64371
|
-
|
|
64474
|
+
var _iterator2 = _createForOfIteratorHelper(wacAllow.split(',')),
|
|
64475
|
+
_step2;
|
|
64372
64476
|
try {
|
|
64373
|
-
for (
|
|
64374
|
-
var bit =
|
|
64477
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
64478
|
+
var bit = _step2.value;
|
|
64375
64479
|
var lr = bit.split('=');
|
|
64376
64480
|
if (lr[0].includes('user') && !lr[1].includes('write') && !lr[1].includes('append')) {
|
|
64377
64481
|
// console.log(' editable? excluded by WAC-Allow: ', wacAllow)
|
|
@@ -64379,12 +64483,12 @@ var UpdateManager = /*#__PURE__*/function () {
|
|
|
64379
64483
|
}
|
|
64380
64484
|
}
|
|
64381
64485
|
} catch (err) {
|
|
64382
|
-
|
|
64486
|
+
_iterator2.e(err);
|
|
64383
64487
|
} finally {
|
|
64384
|
-
|
|
64488
|
+
_iterator2.f();
|
|
64385
64489
|
}
|
|
64386
64490
|
}
|
|
64387
|
-
var acceptPatch = kb.each(
|
|
64491
|
+
var acceptPatch = kb.each(_response2, this.ns.httph('accept-patch'));
|
|
64388
64492
|
if (acceptPatch.length) {
|
|
64389
64493
|
for (var i = 0; i < acceptPatch.length; i++) {
|
|
64390
64494
|
method = acceptPatch[i].value.trim();
|
|
@@ -64392,7 +64496,7 @@ var UpdateManager = /*#__PURE__*/function () {
|
|
|
64392
64496
|
if (method.indexOf('application/sparql-update-single-match') >= 0) return 'SPARQL';
|
|
64393
64497
|
}
|
|
64394
64498
|
}
|
|
64395
|
-
var authorVia = kb.each(
|
|
64499
|
+
var authorVia = kb.each(_response2, this.ns.httph('ms-author-via'));
|
|
64396
64500
|
if (authorVia.length) {
|
|
64397
64501
|
for (var _i = 0; _i < authorVia.length; _i++) {
|
|
64398
64502
|
method = authorVia[_i].value.trim();
|
|
@@ -64407,7 +64511,7 @@ var UpdateManager = /*#__PURE__*/function () {
|
|
|
64407
64511
|
if (!this.isHttpUri(uri)) {
|
|
64408
64512
|
if (!wacAllow) return false;else return 'LOCALFILE';
|
|
64409
64513
|
}
|
|
64410
|
-
var status = kb.each(
|
|
64514
|
+
var status = kb.each(_response2, this.ns.http('status'));
|
|
64411
64515
|
if (status.length) {
|
|
64412
64516
|
for (var _i2 = 0; _i2 < status.length; _i2++) {
|
|
64413
64517
|
// @ts-ignore since statuses should be TFTerms, this should always be false
|
|
@@ -64456,7 +64560,7 @@ var UpdateManager = /*#__PURE__*/function () {
|
|
|
64456
64560
|
key: "statementBnodes",
|
|
64457
64561
|
value: function statementBnodes(st) {
|
|
64458
64562
|
return [st.subject, st.predicate, st.object].filter(function (x) {
|
|
64459
|
-
return (0,
|
|
64563
|
+
return (0,_utils_terms__WEBPACK_IMPORTED_MODULE_11__.isBlankNode)(x);
|
|
64460
64564
|
});
|
|
64461
64565
|
}
|
|
64462
64566
|
|
|
@@ -64851,7 +64955,7 @@ var UpdateManager = /*#__PURE__*/function () {
|
|
|
64851
64955
|
// console.log('Server does not support live updates through Updates-Via :-(')
|
|
64852
64956
|
return false;
|
|
64853
64957
|
}
|
|
64854
|
-
wssURI = (0,
|
|
64958
|
+
wssURI = (0,_uri__WEBPACK_IMPORTED_MODULE_10__.join)(wssURI, doc.value);
|
|
64855
64959
|
var validWssURI = wssURI.replace(/^http:/, 'ws:').replace(/^https:/, 'wss:');
|
|
64856
64960
|
// console.log('Web socket URI ' + wssURI)
|
|
64857
64961
|
|
|
@@ -64991,8 +65095,8 @@ var UpdateManager = /*#__PURE__*/function () {
|
|
|
64991
65095
|
|
|
64992
65096
|
try {
|
|
64993
65097
|
var kb = this.store;
|
|
64994
|
-
var ds = !deletions ? [] : (0,
|
|
64995
|
-
var is = !insertions ? [] : (0,
|
|
65098
|
+
var ds = !deletions ? [] : (0,_utils_terms__WEBPACK_IMPORTED_MODULE_11__.isStore)(deletions) ? deletions.statements : deletions instanceof Array ? deletions : [deletions];
|
|
65099
|
+
var is = !insertions ? [] : (0,_utils_terms__WEBPACK_IMPORTED_MODULE_11__.isStore)(insertions) ? insertions.statements : insertions instanceof Array ? insertions : [insertions];
|
|
64996
65100
|
if (!(ds instanceof Array)) {
|
|
64997
65101
|
throw new Error('Type Error ' + (0,_babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__["default"])(ds) + ': ' + ds);
|
|
64998
65102
|
}
|
|
@@ -65149,7 +65253,7 @@ var UpdateManager = /*#__PURE__*/function () {
|
|
|
65149
65253
|
}
|
|
65150
65254
|
}
|
|
65151
65255
|
} catch (e) {
|
|
65152
|
-
callback(undefined, false, 'Exception in update: ' + e + '\n' +
|
|
65256
|
+
callback(undefined, false, 'Exception in update: ' + e + '\n' + _utils_js__WEBPACK_IMPORTED_MODULE_12__.stackString(e));
|
|
65153
65257
|
}
|
|
65154
65258
|
}
|
|
65155
65259
|
}, {
|
|
@@ -65172,7 +65276,7 @@ var UpdateManager = /*#__PURE__*/function () {
|
|
|
65172
65276
|
// prepare contents of revised document
|
|
65173
65277
|
var newSts = kb.statementsMatching(undefined, undefined, undefined, doc).slice(); // copy!
|
|
65174
65278
|
for (var i = 0; i < ds.length; i++) {
|
|
65175
|
-
|
|
65279
|
+
_utils_js__WEBPACK_IMPORTED_MODULE_12__.RDFArrayRemove(newSts, ds[i]);
|
|
65176
65280
|
}
|
|
65177
65281
|
for (var _i9 = 0; _i9 < is.length; _i9++) {
|
|
65178
65282
|
newSts.push(is[_i9]);
|
|
@@ -65183,7 +65287,7 @@ var UpdateManager = /*#__PURE__*/function () {
|
|
|
65183
65287
|
var candidateTarget = kb.the(response, this.ns.httph('content-location'));
|
|
65184
65288
|
var targetURI;
|
|
65185
65289
|
if (candidateTarget) {
|
|
65186
|
-
targetURI = (0,
|
|
65290
|
+
targetURI = (0,_uri__WEBPACK_IMPORTED_MODULE_10__.join)(candidateTarget.value, targetURI);
|
|
65187
65291
|
}
|
|
65188
65292
|
options.contentType = contentType;
|
|
65189
65293
|
options.noMeta = true;
|
|
@@ -65224,7 +65328,7 @@ var UpdateManager = /*#__PURE__*/function () {
|
|
|
65224
65328
|
var newSts = kb.statementsMatching(undefined, undefined, undefined, doc).slice(); // copy!
|
|
65225
65329
|
|
|
65226
65330
|
for (var i = 0; i < ds.length; i++) {
|
|
65227
|
-
|
|
65331
|
+
_utils_js__WEBPACK_IMPORTED_MODULE_12__.RDFArrayRemove(newSts, ds[i]);
|
|
65228
65332
|
}
|
|
65229
65333
|
for (var _i12 = 0; _i12 < is.length; _i12++) {
|
|
65230
65334
|
newSts.push(is[_i12]);
|
|
@@ -65235,7 +65339,7 @@ var UpdateManager = /*#__PURE__*/function () {
|
|
|
65235
65339
|
throw new Error('Rewriting file: No filename extension: ' + doc.value);
|
|
65236
65340
|
}
|
|
65237
65341
|
var ext = doc.value.slice(dot + 1);
|
|
65238
|
-
var contentType =
|
|
65342
|
+
var contentType = _fetcher__WEBPACK_IMPORTED_MODULE_7__["default"].CONTENT_TYPE_BY_EXT[ext];
|
|
65239
65343
|
if (!contentType) {
|
|
65240
65344
|
throw new Error('File extension .' + ext + ' not supported for data write');
|
|
65241
65345
|
}
|
|
@@ -65268,7 +65372,7 @@ var UpdateManager = /*#__PURE__*/function () {
|
|
|
65268
65372
|
}
|
|
65269
65373
|
|
|
65270
65374
|
// serialize to the appropriate format
|
|
65271
|
-
var sz = (0,
|
|
65375
|
+
var sz = (0,_serializer__WEBPACK_IMPORTED_MODULE_13__["default"])(kb);
|
|
65272
65376
|
sz.suggestNamespaces(kb.namespaces);
|
|
65273
65377
|
sz.setBase(uri);
|
|
65274
65378
|
switch (contentType) {
|
|
@@ -79210,6 +79314,8 @@ module.exports = JSON.parse('{"application/1d-interleaved-parityfec":{"source":"
|
|
|
79210
79314
|
/******/ // This entry module is referenced by other modules so it can't be inlined
|
|
79211
79315
|
/******/ var __webpack_exports__ = __webpack_require__("./lib/index.js");
|
|
79212
79316
|
/******/
|
|
79317
|
+
/******/ return __webpack_exports__;
|
|
79213
79318
|
/******/ })()
|
|
79214
79319
|
;
|
|
79215
|
-
|
|
79320
|
+
});
|
|
79321
|
+
//# sourceMappingURL=solid-ui.js.map
|