solid-panes 3.5.28-alpha → 3.5.29-alpha
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/README.md +0 -2
- package/lib/RDFXMLPane.js +6 -8
- package/lib/RDFXMLPane.js.map +1 -1
- package/lib/argument/argumentPane.js +10 -11
- package/lib/argument/argumentPane.js.map +1 -1
- package/lib/attach/attachPane.js +47 -85
- package/lib/attach/attachPane.js.map +1 -1
- package/lib/audio/audioPane.js +11 -36
- package/lib/audio/audioPane.js.map +1 -1
- package/lib/classInstancePane.js +11 -20
- package/lib/classInstancePane.js.map +1 -1
- package/lib/dashboard/basicPreferences.js +3 -53
- package/lib/dashboard/basicPreferences.js.map +1 -1
- package/lib/dashboard/dashboardPane.js +2 -18
- package/lib/dashboard/dashboardPane.js.map +1 -1
- package/lib/dashboard/homepage.js +1 -19
- package/lib/dashboard/homepage.js.map +1 -1
- package/lib/dataContentPane.js +15 -58
- package/lib/dataContentPane.js.map +1 -1
- package/lib/defaultPane.js +13 -21
- package/lib/defaultPane.js.map +1 -1
- package/lib/dokieli/dokieliPane.js +19 -28
- package/lib/dokieli/dokieliPane.js.map +1 -1
- package/lib/dokieli/new.js.map +1 -1
- package/lib/form/pane.js +26 -40
- package/lib/form/pane.js.map +1 -1
- package/lib/home/homePane.js +7 -23
- package/lib/home/homePane.js.map +1 -1
- package/lib/humanReadablePane.js +14 -28
- package/lib/humanReadablePane.js.map +1 -1
- package/lib/imagePane.js +9 -13
- package/lib/imagePane.js.map +1 -1
- package/lib/index.js +4 -18
- package/lib/index.js.map +1 -1
- package/lib/internal/internalPane.js +10 -41
- package/lib/internal/internalPane.js.map +1 -1
- package/lib/mainPage/footer.js +0 -4
- package/lib/mainPage/footer.js.map +1 -1
- package/lib/mainPage/header.js +2 -28
- package/lib/mainPage/header.js.map +1 -1
- package/lib/mainPage/index.js +1 -12
- package/lib/mainPage/index.js.map +1 -1
- package/lib/microblogPane/microblogPane.js +100 -237
- package/lib/microblogPane/microblogPane.js.map +1 -1
- package/lib/n3Pane.js +2 -7
- package/lib/n3Pane.js.map +1 -1
- package/lib/outline/context.js +0 -2
- package/lib/outline/context.js.map +1 -1
- package/lib/outline/licenseOptions.js +9 -25
- package/lib/outline/licenseOptions.js.map +1 -1
- package/lib/outline/manager.js +178 -580
- package/lib/outline/manager.js.map +1 -1
- package/lib/outline/manager.test.js +1 -11
- package/lib/outline/manager.test.js.map +1 -1
- package/lib/outline/outlineIcons.js +30 -25
- package/lib/outline/outlineIcons.js.map +1 -1
- package/lib/outline/propertyViews.js +0 -10
- package/lib/outline/propertyViews.js.map +1 -1
- package/lib/outline/propertyViews.test.js +1 -3
- package/lib/outline/propertyViews.test.js.map +1 -1
- package/lib/outline/queryByExample.js +24 -76
- package/lib/outline/queryByExample.js.map +1 -1
- package/lib/outline/userInput.js +214 -454
- package/lib/outline/userInput.js.map +1 -1
- package/lib/outline/viewAsImage.js +0 -6
- package/lib/outline/viewAsImage.js.map +1 -1
- package/lib/outline/viewAsMbox.js +3 -4
- package/lib/outline/viewAsMbox.js.map +1 -1
- package/lib/pad/padPane.js +45 -93
- package/lib/pad/padPane.js.map +1 -1
- package/lib/playlist/playlistPane.js +3 -20
- package/lib/playlist/playlistPane.js.map +1 -1
- package/lib/profile/editProfile.view.js +7 -24
- package/lib/profile/editProfile.view.js.map +1 -1
- package/lib/profile/profile.dom.js +0 -3
- package/lib/profile/profile.dom.js.map +1 -1
- package/lib/registerPanes.js +29 -27
- package/lib/registerPanes.js.map +1 -1
- package/lib/schedule/formsForSchedule.js.map +1 -1
- package/lib/schedule/schedulePane.js +62 -122
- package/lib/schedule/schedulePane.js.map +1 -1
- package/lib/sharing/sharingPane.js +2 -10
- package/lib/sharing/sharingPane.js.map +1 -1
- package/lib/slideshow/slideshowPane.js +9 -14
- package/lib/slideshow/slideshowPane.js.map +1 -1
- package/lib/socialPane.js +43 -124
- package/lib/socialPane.js.map +1 -1
- package/lib/tabbed/tabbedPane.js +1 -15
- package/lib/tabbed/tabbedPane.js.map +1 -1
- package/lib/tableViewPane.js +4 -7
- package/lib/tableViewPane.js.map +1 -1
- package/lib/test-import-export/common.js +2 -1
- package/lib/test-import-export/common.js.map +1 -1
- package/lib/test-import-export/edit-importer.js +7 -9
- package/lib/test-import-export/edit-importer.js.map +1 -1
- package/lib/transaction/pane.js +31 -90
- package/lib/transaction/pane.js.map +1 -1
- package/lib/transaction/period.js +20 -71
- package/lib/transaction/period.js.map +1 -1
- package/lib/trip/tripPane.js +30 -34
- package/lib/trip/tripPane.js.map +1 -1
- package/lib/trustedApplications/trustedApplications.dom.js +8 -34
- package/lib/trustedApplications/trustedApplications.dom.js.map +1 -1
- package/lib/trustedApplications/trustedApplications.test.js +3 -8
- package/lib/trustedApplications/trustedApplications.test.js.map +1 -1
- package/lib/trustedApplications/trustedApplications.utils.js +0 -10
- package/lib/trustedApplications/trustedApplications.utils.js.map +1 -1
- package/lib/trustedApplications/trustedApplications.view.js +1 -22
- package/lib/trustedApplications/trustedApplications.view.js.map +1 -1
- package/lib/ui/pane.js +22 -28
- package/lib/ui/pane.js.map +1 -1
- package/lib/versionInfo.d.ts +2 -0
- package/lib/versionInfo.d.ts.map +1 -1
- package/lib/versionInfo.js +18 -16
- package/lib/versionInfo.js.map +1 -1
- package/lib/video/videoPane.js +2 -5
- package/lib/video/videoPane.js.map +1 -1
- package/package.json +24 -24
- package/src/versionInfo.ts +18 -16
package/lib/home/homePane.js
CHANGED
|
@@ -1,25 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports["default"] = void 0;
|
|
9
|
-
|
|
10
8
|
var _solidLogic = require("solid-logic");
|
|
11
|
-
|
|
12
9
|
var _solidUi = require("solid-ui");
|
|
13
|
-
|
|
14
|
-
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
15
|
-
|
|
10
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
16
11
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
17
|
-
|
|
18
12
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
19
|
-
|
|
20
13
|
var HomePaneSource = {
|
|
21
14
|
icon: _solidUi.icons.iconBase + 'noun_547570.svg',
|
|
22
15
|
// noun_25830
|
|
16
|
+
|
|
23
17
|
global: true,
|
|
24
18
|
name: 'home',
|
|
25
19
|
// Does the subject deserve an home pane?
|
|
@@ -31,7 +25,6 @@ var HomePaneSource = {
|
|
|
31
25
|
},
|
|
32
26
|
render: function render(subject, context) {
|
|
33
27
|
var dom = context.dom;
|
|
34
|
-
|
|
35
28
|
var showContent = /*#__PURE__*/function () {
|
|
36
29
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
37
30
|
var homePaneContext, creationDiv, creationContext, relevantPanes;
|
|
@@ -54,7 +47,6 @@ var HomePaneSource = {
|
|
|
54
47
|
// Here we know new log in status
|
|
55
48
|
}))
|
|
56
49
|
*/
|
|
57
|
-
|
|
58
50
|
div.appendChild(dom.createElement('h4')).textContent = 'Create new thing somewhere';
|
|
59
51
|
creationDiv = div.appendChild(dom.createElement('div'));
|
|
60
52
|
creationContext = {
|
|
@@ -65,27 +57,23 @@ var HomePaneSource = {
|
|
|
65
57
|
};
|
|
66
58
|
_context.next = 6;
|
|
67
59
|
return _solidUi.login.filterAvailablePanes(context.session.paneRegistry.list);
|
|
68
|
-
|
|
69
60
|
case 6:
|
|
70
61
|
relevantPanes = _context.sent;
|
|
71
|
-
|
|
72
62
|
_solidUi.create.newThingUI(creationContext, context, relevantPanes); // newUI Have to pass panes down
|
|
73
63
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
64
|
+
div.appendChild(dom.createElement('h4')).textContent = 'Private things';
|
|
65
|
+
// TODO: Replace by a common, representative interface
|
|
77
66
|
_solidUi.login.registrationList(homePaneContext, {
|
|
78
67
|
"private": true
|
|
79
68
|
}).then(function (authContext) {
|
|
80
69
|
div.appendChild(dom.createElement('h4')).textContent = 'Public things';
|
|
81
70
|
div.appendChild(dom.createElement('p')).textContent = 'Things in this list are visible to others.';
|
|
82
|
-
|
|
83
71
|
_solidUi.login.registrationList(authContext, {
|
|
84
72
|
"public": true
|
|
85
|
-
}).then(function () {
|
|
73
|
+
}).then(function () {
|
|
74
|
+
// done
|
|
86
75
|
});
|
|
87
76
|
});
|
|
88
|
-
|
|
89
77
|
case 10:
|
|
90
78
|
case "end":
|
|
91
79
|
return _context.stop();
|
|
@@ -93,23 +81,19 @@ var HomePaneSource = {
|
|
|
93
81
|
}
|
|
94
82
|
}, _callee);
|
|
95
83
|
}));
|
|
96
|
-
|
|
97
84
|
return function showContent() {
|
|
98
85
|
return _ref.apply(this, arguments);
|
|
99
86
|
};
|
|
100
87
|
}();
|
|
101
|
-
|
|
102
88
|
var div = dom.createElement('div');
|
|
103
|
-
|
|
104
89
|
var me = _solidLogic.authn.currentUser(); // this will be incorrect if not logged in
|
|
105
90
|
|
|
106
|
-
|
|
107
91
|
showContent();
|
|
108
92
|
return div;
|
|
109
93
|
}
|
|
110
94
|
}; // pane object
|
|
111
|
-
// ends
|
|
112
95
|
|
|
96
|
+
// ends
|
|
113
97
|
var _default = HomePaneSource;
|
|
114
98
|
exports["default"] = _default;
|
|
115
99
|
//# sourceMappingURL=homePane.js.map
|
package/lib/home/homePane.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"homePane.js","names":["HomePaneSource","icon","icons","iconBase","global","name","label","render","subject","context","dom","showContent","homePaneContext","div","statusArea","me","appendChild","createElement","textContent","creationDiv","creationContext","login","filterAvailablePanes","session","paneRegistry","list","relevantPanes","create","newThingUI","registrationList","then","authContext","authn","currentUser"],"sources":["../../src/home/homePane.ts"],"sourcesContent":["/* Home Pane\n **\n ** The home pane is avaiable everywhere and allows a user\n ** to\n ** - keep track of their stuff\n ** - make new things, and possibly\n ** - keep track of accounts and workspaces etc\n **\n */\n\nimport { PaneDefinition } from 'pane-registry'\nimport { NamedNode } from 'rdflib'\nimport { authn } from 'solid-logic'\nimport { create, icons, login } from 'solid-ui'\nimport { CreateContext } from 'solid-ui/lib/create/types'\n\nconst HomePaneSource: PaneDefinition = {\n icon: icons.iconBase + 'noun_547570.svg', // noun_25830\n\n global: true,\n\n name: 'home',\n\n // Does the subject deserve an home pane?\n //\n // yes, always!\n //\n label: function () {\n return 'home'\n },\n\n render: function (subject, context) {\n const dom = context.dom\n const showContent = async function () {\n const homePaneContext = { div: div, dom: dom, statusArea: div, me: me }\n /*\n div.appendChild(dom.createElement('h4')).textContent = 'Login status'\n var loginStatusDiv = div.appendChild(context.dom.createElement('div'))\n // TODO: Find out what the actual type is:\n type UriType = unknown;\n loginStatusDiv.appendChild(UI.login.loginStatusBox(context.dom, () => {\n // Here we know new log in status\n }))\n */\n div.appendChild(dom.createElement('h4')).textContent =\n 'Create new thing somewhere'\n const creationDiv = div.appendChild(dom.createElement('div'))\n const creationContext: CreateContext = {\n div: creationDiv,\n dom: dom,\n statusArea: div,\n me: me\n }\n const relevantPanes = await login.filterAvailablePanes(\n context.session.paneRegistry.list\n )\n create.newThingUI(creationContext, context, relevantPanes) // newUI Have to pass panes down\n\n div.appendChild(dom.createElement('h4')).textContent = 'Private things'\n // TODO: Replace by a common, representative interface\n login\n .registrationList(homePaneContext, { private: true })\n .then(function (authContext) {\n div.appendChild(dom.createElement('h4')).textContent = 'Public things'\n div.appendChild(dom.createElement('p')).textContent =\n 'Things in this list are visible to others.'\n login\n .registrationList(authContext, { public: true })\n .then(function () {\n // done\n })\n })\n }\n\n const div = dom.createElement('div')\n const me: NamedNode = authn.currentUser() as NamedNode // this will be incorrect if not logged in\n\n showContent()\n\n return div\n }\n} // pane object\n\n// ends\nexport default HomePaneSource\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"homePane.js","names":["HomePaneSource","icon","icons","iconBase","global","name","label","render","subject","context","dom","showContent","homePaneContext","div","statusArea","me","appendChild","createElement","textContent","creationDiv","creationContext","login","filterAvailablePanes","session","paneRegistry","list","relevantPanes","create","newThingUI","registrationList","then","authContext","authn","currentUser"],"sources":["../../src/home/homePane.ts"],"sourcesContent":["/* Home Pane\n **\n ** The home pane is avaiable everywhere and allows a user\n ** to\n ** - keep track of their stuff\n ** - make new things, and possibly\n ** - keep track of accounts and workspaces etc\n **\n */\n\nimport { PaneDefinition } from 'pane-registry'\nimport { NamedNode } from 'rdflib'\nimport { authn } from 'solid-logic'\nimport { create, icons, login } from 'solid-ui'\nimport { CreateContext } from 'solid-ui/lib/create/types'\n\nconst HomePaneSource: PaneDefinition = {\n icon: icons.iconBase + 'noun_547570.svg', // noun_25830\n\n global: true,\n\n name: 'home',\n\n // Does the subject deserve an home pane?\n //\n // yes, always!\n //\n label: function () {\n return 'home'\n },\n\n render: function (subject, context) {\n const dom = context.dom\n const showContent = async function () {\n const homePaneContext = { div: div, dom: dom, statusArea: div, me: me }\n /*\n div.appendChild(dom.createElement('h4')).textContent = 'Login status'\n var loginStatusDiv = div.appendChild(context.dom.createElement('div'))\n // TODO: Find out what the actual type is:\n type UriType = unknown;\n loginStatusDiv.appendChild(UI.login.loginStatusBox(context.dom, () => {\n // Here we know new log in status\n }))\n */\n div.appendChild(dom.createElement('h4')).textContent =\n 'Create new thing somewhere'\n const creationDiv = div.appendChild(dom.createElement('div'))\n const creationContext: CreateContext = {\n div: creationDiv,\n dom: dom,\n statusArea: div,\n me: me\n }\n const relevantPanes = await login.filterAvailablePanes(\n context.session.paneRegistry.list\n )\n create.newThingUI(creationContext, context, relevantPanes) // newUI Have to pass panes down\n\n div.appendChild(dom.createElement('h4')).textContent = 'Private things'\n // TODO: Replace by a common, representative interface\n login\n .registrationList(homePaneContext, { private: true })\n .then(function (authContext) {\n div.appendChild(dom.createElement('h4')).textContent = 'Public things'\n div.appendChild(dom.createElement('p')).textContent =\n 'Things in this list are visible to others.'\n login\n .registrationList(authContext, { public: true })\n .then(function () {\n // done\n })\n })\n }\n\n const div = dom.createElement('div')\n const me: NamedNode = authn.currentUser() as NamedNode // this will be incorrect if not logged in\n\n showContent()\n\n return div\n }\n} // pane object\n\n// ends\nexport default HomePaneSource\n"],"mappings":";;;;;;;AAYA;AACA;AAA+C,+CAZ/C;AAAA;AAAA;AAeA,IAAMA,cAA8B,GAAG;EACrCC,IAAI,EAAEC,cAAK,CAACC,QAAQ,GAAG,iBAAiB;EAAE;;EAE1CC,MAAM,EAAE,IAAI;EAEZC,IAAI,EAAE,MAAM;EAEZ;EACA;EACA;EACA;EACAC,KAAK,EAAE,iBAAY;IACjB,OAAO,MAAM;EACf,CAAC;EAEDC,MAAM,EAAE,gBAAUC,OAAO,EAAEC,OAAO,EAAE;IAClC,IAAMC,GAAG,GAAGD,OAAO,CAACC,GAAG;IACvB,IAAMC,WAAW;MAAA,sEAAG;QAAA;QAAA;UAAA;YAAA;cAAA;gBACZC,eAAe,GAAG;kBAAEC,GAAG,EAAEA,GAAG;kBAAEH,GAAG,EAAEA,GAAG;kBAAEI,UAAU,EAAED,GAAG;kBAAEE,EAAE,EAAEA;gBAAG,CAAC;gBACvE;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;gBACMF,GAAG,CAACG,WAAW,CAACN,GAAG,CAACO,aAAa,CAAC,IAAI,CAAC,CAAC,CAACC,WAAW,GAClD,4BAA4B;gBACxBC,WAAW,GAAGN,GAAG,CAACG,WAAW,CAACN,GAAG,CAACO,aAAa,CAAC,KAAK,CAAC,CAAC;gBACvDG,eAA8B,GAAG;kBACrCP,GAAG,EAAEM,WAAW;kBAChBT,GAAG,EAAEA,GAAG;kBACRI,UAAU,EAAED,GAAG;kBACfE,EAAE,EAAEA;gBACN,CAAC;gBAAA;gBAAA,OAC2BM,cAAK,CAACC,oBAAoB,CACpDb,OAAO,CAACc,OAAO,CAACC,YAAY,CAACC,IAAI,CAClC;cAAA;gBAFKC,aAAa;gBAGnBC,eAAM,CAACC,UAAU,CAACR,eAAe,EAAEX,OAAO,EAAEiB,aAAa,CAAC,EAAC;;gBAE3Db,GAAG,CAACG,WAAW,CAACN,GAAG,CAACO,aAAa,CAAC,IAAI,CAAC,CAAC,CAACC,WAAW,GAAG,gBAAgB;gBACvE;gBACAG,cAAK,CACFQ,gBAAgB,CAACjB,eAAe,EAAE;kBAAE,WAAS;gBAAK,CAAC,CAAC,CACpDkB,IAAI,CAAC,UAAUC,WAAW,EAAE;kBAC3BlB,GAAG,CAACG,WAAW,CAACN,GAAG,CAACO,aAAa,CAAC,IAAI,CAAC,CAAC,CAACC,WAAW,GAAG,eAAe;kBACtEL,GAAG,CAACG,WAAW,CAACN,GAAG,CAACO,aAAa,CAAC,GAAG,CAAC,CAAC,CAACC,WAAW,GACjD,4CAA4C;kBAC9CG,cAAK,CACFQ,gBAAgB,CAACE,WAAW,EAAE;oBAAE,UAAQ;kBAAK,CAAC,CAAC,CAC/CD,IAAI,CAAC,YAAY;oBAChB;kBAAA,CACD,CAAC;gBACN,CAAC,CAAC;cAAA;cAAA;gBAAA;YAAA;UAAA;QAAA;MAAA,CACL;MAAA,gBAvCKnB,WAAW;QAAA;MAAA;IAAA,GAuChB;IAED,IAAME,GAAG,GAAGH,GAAG,CAACO,aAAa,CAAC,KAAK,CAAC;IACpC,IAAMF,EAAa,GAAGiB,iBAAK,CAACC,WAAW,EAAe,EAAC;;IAEvDtB,WAAW,EAAE;IAEb,OAAOE,GAAG;EACZ;AACF,CAAC,EAAC;;AAEF;AAAA,eACeb,cAAc;AAAA"}
|
package/lib/humanReadablePane.js
CHANGED
|
@@ -4,29 +4,26 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
|
-
|
|
8
7
|
var _solidUi = require("solid-ui");
|
|
9
|
-
|
|
10
8
|
var _rdflib = require("rdflib");
|
|
11
|
-
|
|
12
9
|
var _marked = require("marked");
|
|
13
|
-
|
|
14
10
|
/* Human-readable Pane
|
|
15
11
|
**
|
|
16
12
|
** This outline pane contains the document contents for an HTML document
|
|
17
13
|
** This is for peeking at a page, because the user might not want to leave the data browser.
|
|
18
14
|
*/
|
|
15
|
+
|
|
19
16
|
var humanReadablePane = {
|
|
20
17
|
icon: _solidUi.icons.originalIconBase + 'tango/22-text-x-generic.png',
|
|
21
18
|
name: 'humanReadable',
|
|
22
19
|
label: function label(subject, context) {
|
|
23
|
-
var kb = context.session.store;
|
|
20
|
+
var kb = context.session.store;
|
|
24
21
|
|
|
25
|
-
|
|
22
|
+
// See also the source pane, which has lower precedence.
|
|
26
23
|
|
|
24
|
+
var allowed = ['text/plain', 'text/html', 'text/markdown', 'application/xhtml+xml', 'image/png', 'image/jpeg', 'application/pdf', 'video/mp4'];
|
|
27
25
|
var hasContentTypeIn = function hasContentTypeIn(kb, x, displayables) {
|
|
28
26
|
var cts = kb.fetcher.getHeader(x, 'content-type');
|
|
29
|
-
|
|
30
27
|
if (cts) {
|
|
31
28
|
for (var j = 0; j < cts.length; j++) {
|
|
32
29
|
for (var k = 0; k < displayables.length; k++) {
|
|
@@ -36,32 +33,26 @@ var humanReadablePane = {
|
|
|
36
33
|
}
|
|
37
34
|
}
|
|
38
35
|
}
|
|
39
|
-
|
|
40
36
|
return false;
|
|
41
|
-
};
|
|
42
|
-
|
|
37
|
+
};
|
|
43
38
|
|
|
39
|
+
// This data could come from a fetch OR from ldp container
|
|
44
40
|
var hasContentTypeIn2 = function hasContentTypeIn2(kb, x, displayables) {
|
|
45
41
|
var t = kb.findTypeURIs(subject);
|
|
46
|
-
|
|
47
42
|
for (var k = 0; k < displayables.length; k++) {
|
|
48
43
|
if (_rdflib.Util.mediaTypeClass(displayables[k]).uri in t) {
|
|
49
44
|
return true;
|
|
50
45
|
}
|
|
51
46
|
}
|
|
52
|
-
|
|
53
47
|
return false;
|
|
54
48
|
};
|
|
55
|
-
|
|
56
49
|
if (!subject.uri) return null; // no bnodes
|
|
57
50
|
|
|
58
51
|
var t = kb.findTypeURIs(subject);
|
|
59
52
|
if (t[_solidUi.ns.link('WebPage').uri]) return 'view';
|
|
60
|
-
|
|
61
53
|
if (hasContentTypeIn(kb, subject, allowed) || hasContentTypeIn2(kb, subject, allowed)) {
|
|
62
54
|
return 'View';
|
|
63
55
|
}
|
|
64
|
-
|
|
65
56
|
return null;
|
|
66
57
|
},
|
|
67
58
|
render: function render(subject, context) {
|
|
@@ -70,31 +61,28 @@ var humanReadablePane = {
|
|
|
70
61
|
var kb = context.session.store;
|
|
71
62
|
var cts = kb.fetcher.getHeader(subject.doc(), 'content-type');
|
|
72
63
|
var ct = cts ? cts[0] : null;
|
|
73
|
-
|
|
74
64
|
if (ct) {
|
|
75
65
|
console.log('humanReadablePane: c-t:' + ct);
|
|
76
66
|
} else {
|
|
77
67
|
console.log('humanReadablePane: unknown content-type?');
|
|
78
|
-
}
|
|
79
|
-
|
|
68
|
+
}
|
|
80
69
|
|
|
70
|
+
// @@ When we can, use CSP to turn off scripts within the iframe
|
|
81
71
|
div.setAttribute('class', 'docView');
|
|
82
72
|
var element = ct === 'text/markdown' ? 'DIV' : 'IFRAME';
|
|
83
|
-
var frame = myDocument.createElement(element);
|
|
73
|
+
var frame = myDocument.createElement(element);
|
|
84
74
|
|
|
75
|
+
// render markdown to html
|
|
85
76
|
var markdownHtml = function markdownHtml() {
|
|
86
77
|
kb.fetcher.webOperation('GET', subject.uri).then(function (response) {
|
|
87
78
|
var markdownText = response.responseText;
|
|
88
79
|
var lines = Math.min(30, markdownText.split(/\n/).length + 5);
|
|
89
|
-
|
|
90
80
|
var res = _marked.marked.parse(markdownText);
|
|
91
|
-
|
|
92
81
|
frame.innerHTML = res;
|
|
93
82
|
frame.setAttribute('class', 'doc');
|
|
94
83
|
frame.setAttribute('style', "border: 1px solid; padding: 1em; height: ".concat(lines, "em; width: 800px; resize: both; overflow: auto;"));
|
|
95
84
|
});
|
|
96
85
|
};
|
|
97
|
-
|
|
98
86
|
if (ct === 'text/markdown') {
|
|
99
87
|
markdownHtml();
|
|
100
88
|
} else if (ct !== 'text/html') {
|
|
@@ -104,25 +92,24 @@ var humanReadablePane = {
|
|
|
104
92
|
}).then(function (blob) {
|
|
105
93
|
var objectURL = URL.createObjectURL(blob);
|
|
106
94
|
frame.setAttribute('src', objectURL); // w640 h480 //
|
|
107
|
-
|
|
108
95
|
frame.setAttribute('class', 'doc');
|
|
109
96
|
frame.setAttribute('style', "border: 1px solid; padding: 1em; height:120em; width:80em; resize: both; overflow: auto;");
|
|
110
97
|
});
|
|
111
98
|
} else {
|
|
112
99
|
frame.setAttribute('src', subject.uri); // allow-same-origin
|
|
113
|
-
|
|
114
100
|
frame.setAttribute('class', 'doc');
|
|
115
101
|
frame.setAttribute('style', 'resize = both; height:120em; width:80em;');
|
|
116
|
-
}
|
|
102
|
+
}
|
|
103
|
+
// @@ Note below - if we set ANY sandbox, then Chrome and Safari won't display it if it is PDF.
|
|
117
104
|
// https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe
|
|
118
105
|
// You can't have any sandbox and allow plugins.
|
|
119
106
|
// We could sandbox only HTML files I suppose.
|
|
120
107
|
// HTML5 bug: https://lists.w3.org/Archives/Public/public-html/2011Jun/0330.html
|
|
108
|
+
|
|
121
109
|
// iframe.setAttribute('sandbox', 'allow-same-origin allow-forms'); // allow-scripts ?? no documents should be static
|
|
110
|
+
|
|
122
111
|
// iframe.setAttribute('height', '480')
|
|
123
112
|
// iframe.setAttribute('width', '640')
|
|
124
|
-
|
|
125
|
-
|
|
126
113
|
var tr = myDocument.createElement('TR');
|
|
127
114
|
tr.appendChild(frame);
|
|
128
115
|
div.appendChild(tr);
|
|
@@ -130,6 +117,5 @@ var humanReadablePane = {
|
|
|
130
117
|
}
|
|
131
118
|
};
|
|
132
119
|
var _default = humanReadablePane; // ends
|
|
133
|
-
|
|
134
120
|
exports["default"] = _default;
|
|
135
121
|
//# sourceMappingURL=humanReadablePane.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"humanReadablePane.js","names":["humanReadablePane","icon","icons","originalIconBase","name","label","subject","context","kb","session","store","allowed","hasContentTypeIn","x","displayables","cts","fetcher","getHeader","j","length","k","indexOf","hasContentTypeIn2","t","findTypeURIs","Util","mediaTypeClass","uri","ns","link","render","myDocument","dom","div","createElement","doc","ct","console","log","setAttribute","element","frame","markdownHtml","webOperation","then","response","markdownText","responseText","lines","Math","min","split","res","marked","parse","innerHTML","_fetch","blob","objectURL","URL","createObjectURL","tr","appendChild"],"sources":["../src/humanReadablePane.js"],"sourcesContent":["/* Human-readable Pane\n **\n ** This outline pane contains the document contents for an HTML document\n ** This is for peeking at a page, because the user might not want to leave the data browser.\n */\nimport { icons, ns } from 'solid-ui'\nimport { Util } from 'rdflib'\nimport { marked } from 'marked'\n\nconst humanReadablePane = {\n icon: icons.originalIconBase + 'tango/22-text-x-generic.png',\n\n name: 'humanReadable',\n\n label: function (subject, context) {\n const kb = context.session.store\n\n // See also the source pane, which has lower precedence.\n\n const allowed = [\n 'text/plain',\n 'text/html',\n 'text/markdown',\n 'application/xhtml+xml',\n 'image/png',\n 'image/jpeg',\n 'application/pdf',\n 'video/mp4'\n ]\n\n const hasContentTypeIn = function (kb, x, displayables) {\n const cts = kb.fetcher.getHeader(x, 'content-type')\n if (cts) {\n for (let j = 0; j < cts.length; j++) {\n for (let k = 0; k < displayables.length; k++) {\n if (cts[j].indexOf(displayables[k]) >= 0) {\n return true\n }\n }\n }\n }\n return false\n }\n\n // This data could come from a fetch OR from ldp container\n const hasContentTypeIn2 = function (kb, x, displayables) {\n const t = kb.findTypeURIs(subject)\n for (let k = 0; k < displayables.length; k++) {\n if (Util.mediaTypeClass(displayables[k]).uri in t) {\n return true\n }\n }\n return false\n }\n\n if (!subject.uri) return null // no bnodes\n\n const t = kb.findTypeURIs(subject)\n if (t[ns.link('WebPage').uri]) return 'view'\n\n if (\n hasContentTypeIn(kb, subject, allowed) ||\n hasContentTypeIn2(kb, subject, allowed)\n ) {\n return 'View'\n }\n\n return null\n },\n\n render: function (subject, context) {\n const myDocument = context.dom\n const div = myDocument.createElement('div')\n const kb = context.session.store\n\n const cts = kb.fetcher.getHeader(subject.doc(), 'content-type')\n const ct = cts ? cts[0] : null\n if (ct) {\n console.log('humanReadablePane: c-t:' + ct)\n } else {\n console.log('humanReadablePane: unknown content-type?')\n }\n\n // @@ When we can, use CSP to turn off scripts within the iframe\n div.setAttribute('class', 'docView')\n const element = ct === 'text/markdown' ? 'DIV' : 'IFRAME'\n const frame = myDocument.createElement(element)\n\n // render markdown to html\n const markdownHtml = function () {\n kb.fetcher.webOperation('GET', subject.uri).then(response => {\n const markdownText = response.responseText\n const lines = Math.min(30, markdownText.split(/\\n/).length + 5)\n const res = marked.parse(markdownText)\n frame.innerHTML = res\n frame.setAttribute('class', 'doc')\n frame.setAttribute('style', `border: 1px solid; padding: 1em; height: ${lines}em; width: 800px; resize: both; overflow: auto;`)\n })\n }\n\n if (ct === 'text/markdown') {\n markdownHtml()\n } else if (ct !== 'text/html') {\n // get with authenticated fetch\n kb.fetcher._fetch(subject.uri)\n .then(function(response) {\n return response.blob()\n })\n .then(function(blob) {\n const objectURL = URL.createObjectURL(blob)\n frame.setAttribute('src', objectURL) // w640 h480 //\n frame.setAttribute('class', 'doc')\n frame.setAttribute('style', `border: 1px solid; padding: 1em; height:120em; width:80em; resize: both; overflow: auto;`)\n })\n } else {\n frame.setAttribute('src', subject.uri) // allow-same-origin\n frame.setAttribute('class', 'doc')\n frame.setAttribute('style', 'resize = both; height:120em; width:80em;')\n }\n // @@ Note below - if we set ANY sandbox, then Chrome and Safari won't display it if it is PDF.\n // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe\n // You can't have any sandbox and allow plugins.\n // We could sandbox only HTML files I suppose.\n // HTML5 bug: https://lists.w3.org/Archives/Public/public-html/2011Jun/0330.html\n\n // iframe.setAttribute('sandbox', 'allow-same-origin allow-forms'); // allow-scripts ?? no documents should be static\n\n // iframe.setAttribute('height', '480')\n // iframe.setAttribute('width', '640')\n const tr = myDocument.createElement('TR')\n tr.appendChild(frame)\n div.appendChild(tr)\n return div\n }\n}\n\nexport default humanReadablePane\n// ends\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"humanReadablePane.js","names":["humanReadablePane","icon","icons","originalIconBase","name","label","subject","context","kb","session","store","allowed","hasContentTypeIn","x","displayables","cts","fetcher","getHeader","j","length","k","indexOf","hasContentTypeIn2","t","findTypeURIs","Util","mediaTypeClass","uri","ns","link","render","myDocument","dom","div","createElement","doc","ct","console","log","setAttribute","element","frame","markdownHtml","webOperation","then","response","markdownText","responseText","lines","Math","min","split","res","marked","parse","innerHTML","_fetch","blob","objectURL","URL","createObjectURL","tr","appendChild"],"sources":["../src/humanReadablePane.js"],"sourcesContent":["/* Human-readable Pane\n **\n ** This outline pane contains the document contents for an HTML document\n ** This is for peeking at a page, because the user might not want to leave the data browser.\n */\nimport { icons, ns } from 'solid-ui'\nimport { Util } from 'rdflib'\nimport { marked } from 'marked'\n\nconst humanReadablePane = {\n icon: icons.originalIconBase + 'tango/22-text-x-generic.png',\n\n name: 'humanReadable',\n\n label: function (subject, context) {\n const kb = context.session.store\n\n // See also the source pane, which has lower precedence.\n\n const allowed = [\n 'text/plain',\n 'text/html',\n 'text/markdown',\n 'application/xhtml+xml',\n 'image/png',\n 'image/jpeg',\n 'application/pdf',\n 'video/mp4'\n ]\n\n const hasContentTypeIn = function (kb, x, displayables) {\n const cts = kb.fetcher.getHeader(x, 'content-type')\n if (cts) {\n for (let j = 0; j < cts.length; j++) {\n for (let k = 0; k < displayables.length; k++) {\n if (cts[j].indexOf(displayables[k]) >= 0) {\n return true\n }\n }\n }\n }\n return false\n }\n\n // This data could come from a fetch OR from ldp container\n const hasContentTypeIn2 = function (kb, x, displayables) {\n const t = kb.findTypeURIs(subject)\n for (let k = 0; k < displayables.length; k++) {\n if (Util.mediaTypeClass(displayables[k]).uri in t) {\n return true\n }\n }\n return false\n }\n\n if (!subject.uri) return null // no bnodes\n\n const t = kb.findTypeURIs(subject)\n if (t[ns.link('WebPage').uri]) return 'view'\n\n if (\n hasContentTypeIn(kb, subject, allowed) ||\n hasContentTypeIn2(kb, subject, allowed)\n ) {\n return 'View'\n }\n\n return null\n },\n\n render: function (subject, context) {\n const myDocument = context.dom\n const div = myDocument.createElement('div')\n const kb = context.session.store\n\n const cts = kb.fetcher.getHeader(subject.doc(), 'content-type')\n const ct = cts ? cts[0] : null\n if (ct) {\n console.log('humanReadablePane: c-t:' + ct)\n } else {\n console.log('humanReadablePane: unknown content-type?')\n }\n\n // @@ When we can, use CSP to turn off scripts within the iframe\n div.setAttribute('class', 'docView')\n const element = ct === 'text/markdown' ? 'DIV' : 'IFRAME'\n const frame = myDocument.createElement(element)\n\n // render markdown to html\n const markdownHtml = function () {\n kb.fetcher.webOperation('GET', subject.uri).then(response => {\n const markdownText = response.responseText\n const lines = Math.min(30, markdownText.split(/\\n/).length + 5)\n const res = marked.parse(markdownText)\n frame.innerHTML = res\n frame.setAttribute('class', 'doc')\n frame.setAttribute('style', `border: 1px solid; padding: 1em; height: ${lines}em; width: 800px; resize: both; overflow: auto;`)\n })\n }\n\n if (ct === 'text/markdown') {\n markdownHtml()\n } else if (ct !== 'text/html') {\n // get with authenticated fetch\n kb.fetcher._fetch(subject.uri)\n .then(function(response) {\n return response.blob()\n })\n .then(function(blob) {\n const objectURL = URL.createObjectURL(blob)\n frame.setAttribute('src', objectURL) // w640 h480 //\n frame.setAttribute('class', 'doc')\n frame.setAttribute('style', `border: 1px solid; padding: 1em; height:120em; width:80em; resize: both; overflow: auto;`)\n })\n } else {\n frame.setAttribute('src', subject.uri) // allow-same-origin\n frame.setAttribute('class', 'doc')\n frame.setAttribute('style', 'resize = both; height:120em; width:80em;')\n }\n // @@ Note below - if we set ANY sandbox, then Chrome and Safari won't display it if it is PDF.\n // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe\n // You can't have any sandbox and allow plugins.\n // We could sandbox only HTML files I suppose.\n // HTML5 bug: https://lists.w3.org/Archives/Public/public-html/2011Jun/0330.html\n\n // iframe.setAttribute('sandbox', 'allow-same-origin allow-forms'); // allow-scripts ?? no documents should be static\n\n // iframe.setAttribute('height', '480')\n // iframe.setAttribute('width', '640')\n const tr = myDocument.createElement('TR')\n tr.appendChild(frame)\n div.appendChild(tr)\n return div\n }\n}\n\nexport default humanReadablePane\n// ends\n"],"mappings":"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"}
|
package/lib/imagePane.js
CHANGED
|
@@ -5,22 +5,20 @@
|
|
|
5
5
|
** This outline pane contains the document contents for an Image document
|
|
6
6
|
*/
|
|
7
7
|
var UI = require('solid-ui');
|
|
8
|
-
|
|
9
8
|
module.exports = {
|
|
10
9
|
icon: UI.icons.originalIconBase + 'tango/22-image-x-generic.png',
|
|
11
10
|
name: 'image',
|
|
12
11
|
label: function label(subject, context) {
|
|
13
12
|
var store = context.session.store;
|
|
14
|
-
|
|
15
13
|
if (!store.anyStatementMatching(subject, UI.ns.rdf('type'), store.sym('http://purl.org/dc/terms/Image'))) {
|
|
16
14
|
// NB: Not dc: namespace!
|
|
17
15
|
return null;
|
|
18
|
-
}
|
|
16
|
+
}
|
|
19
17
|
|
|
18
|
+
// See also the source pane, which has lower precedence.
|
|
20
19
|
|
|
21
20
|
var contentTypeMatch = function contentTypeMatch(store, x, contentTypes) {
|
|
22
21
|
var cts = store.fetcher.getHeader(x, 'content-type');
|
|
23
|
-
|
|
24
22
|
if (cts) {
|
|
25
23
|
for (var j = 0; j < cts.length; j++) {
|
|
26
24
|
for (var k = 0; k < contentTypes.length; k++) {
|
|
@@ -30,16 +28,12 @@ module.exports = {
|
|
|
30
28
|
}
|
|
31
29
|
}
|
|
32
30
|
}
|
|
33
|
-
|
|
34
31
|
return false;
|
|
35
32
|
};
|
|
36
|
-
|
|
37
33
|
var suppressed = ['application/pdf'];
|
|
38
|
-
|
|
39
34
|
if (contentTypeMatch(store, subject, suppressed)) {
|
|
40
35
|
return null;
|
|
41
36
|
}
|
|
42
|
-
|
|
43
37
|
return 'view';
|
|
44
38
|
},
|
|
45
39
|
render: function render(subject, context) {
|
|
@@ -47,8 +41,9 @@ module.exports = {
|
|
|
47
41
|
var store = context.session.store;
|
|
48
42
|
var div = myDocument.createElement('div');
|
|
49
43
|
div.setAttribute('class', 'imageView');
|
|
50
|
-
var img = myDocument.createElement('IMG');
|
|
44
|
+
var img = myDocument.createElement('IMG');
|
|
51
45
|
|
|
46
|
+
// get image with authenticated fetch
|
|
52
47
|
store.fetcher._fetch(subject.uri).then(function (response) {
|
|
53
48
|
return response.blob();
|
|
54
49
|
}).then(function (myBlob) {
|
|
@@ -56,14 +51,15 @@ module.exports = {
|
|
|
56
51
|
img.setAttribute('src', objectURL); // w640 h480 //
|
|
57
52
|
});
|
|
58
53
|
|
|
59
|
-
img.setAttribute('style', 'max-width: 100%; max-height: 100%;');
|
|
54
|
+
img.setAttribute('style', 'max-width: 100%; max-height: 100%;');
|
|
55
|
+
// div.style['max-width'] = '640'
|
|
60
56
|
// div.style['max-height'] = '480'
|
|
61
|
-
|
|
62
57
|
var tr = myDocument.createElement('TR'); // why need tr?
|
|
63
|
-
|
|
64
58
|
tr.appendChild(img);
|
|
65
59
|
div.appendChild(tr);
|
|
66
60
|
return div;
|
|
67
61
|
}
|
|
68
|
-
};
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
// ends
|
|
69
65
|
//# sourceMappingURL=imagePane.js.map
|
package/lib/imagePane.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"imagePane.js","names":["UI","require","module","exports","icon","icons","originalIconBase","name","label","subject","context","store","session","anyStatementMatching","ns","rdf","sym","contentTypeMatch","x","contentTypes","cts","fetcher","getHeader","j","length","k","indexOf","suppressed","render","myDocument","dom","div","createElement","setAttribute","img","_fetch","uri","then","response","blob","myBlob","objectURL","URL","createObjectURL","tr","appendChild"],"sources":["../src/imagePane.js"],"sourcesContent":["/* Image Pane\n **\n ** This outline pane contains the document contents for an Image document\n */\nconst UI = require('solid-ui')\n\nmodule.exports = {\n icon: UI.icons.originalIconBase + 'tango/22-image-x-generic.png',\n\n name: 'image',\n\n label: function (subject, context) {\n const store = context.session.store\n if (\n !store.anyStatementMatching(\n subject,\n UI.ns.rdf('type'),\n store.sym('http://purl.org/dc/terms/Image')\n )\n ) {\n // NB: Not dc: namespace!\n return null\n }\n\n // See also the source pane, which has lower precedence.\n\n const contentTypeMatch = function (store, x, contentTypes) {\n const cts = store.fetcher.getHeader(x, 'content-type')\n if (cts) {\n for (let j = 0; j < cts.length; j++) {\n for (let k = 0; k < contentTypes.length; k++) {\n if (cts[j].indexOf(contentTypes[k]) >= 0) {\n return true\n }\n }\n }\n }\n return false\n }\n\n const suppressed = ['application/pdf']\n if (contentTypeMatch(store, subject, suppressed)) {\n return null\n }\n return 'view'\n },\n\n render: function (subject, context) {\n const myDocument = context.dom\n const store = context.session.store\n const div = myDocument.createElement('div')\n div.setAttribute('class', 'imageView')\n const img = myDocument.createElement('IMG')\n\n // get image with authenticated fetch\n store.fetcher._fetch(subject.uri)\n .then(function(response) {\n return response.blob()\n })\n .then(function(myBlob) {\n const objectURL = URL.createObjectURL(myBlob)\n img.setAttribute('src', objectURL) // w640 h480 //\n })\n\n img.setAttribute('style', 'max-width: 100%; max-height: 100%;')\n // div.style['max-width'] = '640'\n // div.style['max-height'] = '480'\n const tr = myDocument.createElement('TR') // why need tr?\n tr.appendChild(img)\n div.appendChild(tr)\n return div\n }\n}\n\n// ends\n"],"mappings":";;AAAA;AACA;AACA;AACA;AACA,IAAMA,EAAE,GAAGC,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"imagePane.js","names":["UI","require","module","exports","icon","icons","originalIconBase","name","label","subject","context","store","session","anyStatementMatching","ns","rdf","sym","contentTypeMatch","x","contentTypes","cts","fetcher","getHeader","j","length","k","indexOf","suppressed","render","myDocument","dom","div","createElement","setAttribute","img","_fetch","uri","then","response","blob","myBlob","objectURL","URL","createObjectURL","tr","appendChild"],"sources":["../src/imagePane.js"],"sourcesContent":["/* Image Pane\n **\n ** This outline pane contains the document contents for an Image document\n */\nconst UI = require('solid-ui')\n\nmodule.exports = {\n icon: UI.icons.originalIconBase + 'tango/22-image-x-generic.png',\n\n name: 'image',\n\n label: function (subject, context) {\n const store = context.session.store\n if (\n !store.anyStatementMatching(\n subject,\n UI.ns.rdf('type'),\n store.sym('http://purl.org/dc/terms/Image')\n )\n ) {\n // NB: Not dc: namespace!\n return null\n }\n\n // See also the source pane, which has lower precedence.\n\n const contentTypeMatch = function (store, x, contentTypes) {\n const cts = store.fetcher.getHeader(x, 'content-type')\n if (cts) {\n for (let j = 0; j < cts.length; j++) {\n for (let k = 0; k < contentTypes.length; k++) {\n if (cts[j].indexOf(contentTypes[k]) >= 0) {\n return true\n }\n }\n }\n }\n return false\n }\n\n const suppressed = ['application/pdf']\n if (contentTypeMatch(store, subject, suppressed)) {\n return null\n }\n return 'view'\n },\n\n render: function (subject, context) {\n const myDocument = context.dom\n const store = context.session.store\n const div = myDocument.createElement('div')\n div.setAttribute('class', 'imageView')\n const img = myDocument.createElement('IMG')\n\n // get image with authenticated fetch\n store.fetcher._fetch(subject.uri)\n .then(function(response) {\n return response.blob()\n })\n .then(function(myBlob) {\n const objectURL = URL.createObjectURL(myBlob)\n img.setAttribute('src', objectURL) // w640 h480 //\n })\n\n img.setAttribute('style', 'max-width: 100%; max-height: 100%;')\n // div.style['max-width'] = '640'\n // div.style['max-height'] = '480'\n const tr = myDocument.createElement('TR') // why need tr?\n tr.appendChild(img)\n div.appendChild(tr)\n return div\n }\n}\n\n// ends\n"],"mappings":";;AAAA;AACA;AACA;AACA;AACA,IAAMA,EAAE,GAAGC,OAAO,CAAC,UAAU,CAAC;AAE9BC,MAAM,CAACC,OAAO,GAAG;EACfC,IAAI,EAAEJ,EAAE,CAACK,KAAK,CAACC,gBAAgB,GAAG,8BAA8B;EAEhEC,IAAI,EAAE,OAAO;EAEbC,KAAK,EAAE,eAAUC,OAAO,EAAEC,OAAO,EAAE;IACjC,IAAMC,KAAK,GAAGD,OAAO,CAACE,OAAO,CAACD,KAAK;IACnC,IACE,CAACA,KAAK,CAACE,oBAAoB,CACzBJ,OAAO,EACPT,EAAE,CAACc,EAAE,CAACC,GAAG,CAAC,MAAM,CAAC,EACjBJ,KAAK,CAACK,GAAG,CAAC,gCAAgC,CAAC,CAC5C,EACD;MACA;MACA,OAAO,IAAI;IACb;;IAEA;;IAEA,IAAMC,gBAAgB,GAAG,SAAnBA,gBAAgB,CAAaN,KAAK,EAAEO,CAAC,EAAEC,YAAY,EAAE;MACzD,IAAMC,GAAG,GAAGT,KAAK,CAACU,OAAO,CAACC,SAAS,CAACJ,CAAC,EAAE,cAAc,CAAC;MACtD,IAAIE,GAAG,EAAE;QACP,KAAK,IAAIG,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGH,GAAG,CAACI,MAAM,EAAED,CAAC,EAAE,EAAE;UACnC,KAAK,IAAIE,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGN,YAAY,CAACK,MAAM,EAAEC,CAAC,EAAE,EAAE;YAC5C,IAAIL,GAAG,CAACG,CAAC,CAAC,CAACG,OAAO,CAACP,YAAY,CAACM,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE;cACxC,OAAO,IAAI;YACb;UACF;QACF;MACF;MACA,OAAO,KAAK;IACd,CAAC;IAED,IAAME,UAAU,GAAG,CAAC,iBAAiB,CAAC;IACtC,IAAIV,gBAAgB,CAACN,KAAK,EAAEF,OAAO,EAAEkB,UAAU,CAAC,EAAE;MAChD,OAAO,IAAI;IACb;IACA,OAAO,MAAM;EACf,CAAC;EAEDC,MAAM,EAAE,gBAAUnB,OAAO,EAAEC,OAAO,EAAE;IAClC,IAAMmB,UAAU,GAAGnB,OAAO,CAACoB,GAAG;IAC9B,IAAMnB,KAAK,GAAGD,OAAO,CAACE,OAAO,CAACD,KAAK;IACnC,IAAMoB,GAAG,GAAGF,UAAU,CAACG,aAAa,CAAC,KAAK,CAAC;IAC3CD,GAAG,CAACE,YAAY,CAAC,OAAO,EAAE,WAAW,CAAC;IACtC,IAAMC,GAAG,GAAGL,UAAU,CAACG,aAAa,CAAC,KAAK,CAAC;;IAE3C;IACArB,KAAK,CAACU,OAAO,CAACc,MAAM,CAAC1B,OAAO,CAAC2B,GAAG,CAAC,CAC9BC,IAAI,CAAC,UAASC,QAAQ,EAAE;MACvB,OAAOA,QAAQ,CAACC,IAAI,EAAE;IACxB,CAAC,CAAC,CACDF,IAAI,CAAC,UAASG,MAAM,EAAE;MACrB,IAAMC,SAAS,GAAGC,GAAG,CAACC,eAAe,CAACH,MAAM,CAAC;MAC7CN,GAAG,CAACD,YAAY,CAAC,KAAK,EAAEQ,SAAS,CAAC,EAAC;IACrC,CAAC,CAAC;;IAEJP,GAAG,CAACD,YAAY,CAAC,OAAO,EAAE,oCAAoC,CAAC;IAC/D;IACA;IACA,IAAMW,EAAE,GAAGf,UAAU,CAACG,aAAa,CAAC,IAAI,CAAC,EAAC;IAC1CY,EAAE,CAACC,WAAW,CAACX,GAAG,CAAC;IACnBH,GAAG,CAACc,WAAW,CAACD,EAAE,CAAC;IACnB,OAAOb,GAAG;EACZ;AACF,CAAC;;AAED"}
|
package/lib/index.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
@@ -55,31 +54,18 @@ Object.defineProperty(exports, "versionInfo", {
|
|
|
55
54
|
return _versionInfo["default"];
|
|
56
55
|
}
|
|
57
56
|
});
|
|
58
|
-
|
|
59
57
|
var _versionInfo = _interopRequireDefault(require("./versionInfo"));
|
|
60
|
-
|
|
61
58
|
var UI = _interopRequireWildcard(require("solid-ui"));
|
|
62
|
-
|
|
63
59
|
exports.UI = UI;
|
|
64
|
-
|
|
65
60
|
var _solidLogic = require("solid-logic");
|
|
66
|
-
|
|
67
61
|
var _manager = _interopRequireDefault(require("./outline/manager.js"));
|
|
68
|
-
|
|
69
62
|
var _registerPanes = _interopRequireDefault(require("./registerPanes.js"));
|
|
70
|
-
|
|
71
63
|
var _paneRegistry = require("pane-registry");
|
|
72
|
-
|
|
73
64
|
var _context = require("./outline/context");
|
|
74
|
-
|
|
75
65
|
var _mainPage = _interopRequireDefault(require("./mainPage"));
|
|
76
|
-
|
|
77
66
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
78
|
-
|
|
79
67
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
80
|
-
|
|
81
68
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
82
|
-
|
|
83
69
|
/* SOLID PANES
|
|
84
70
|
**
|
|
85
71
|
** Panes are regions of the outline view in which a particular subject is
|
|
@@ -91,6 +77,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "d
|
|
|
91
77
|
** relevant to a given subject, returning null if not.
|
|
92
78
|
** If it is relevant, then it returns a suitable tooltip for a control which selects the pane
|
|
93
79
|
*/
|
|
80
|
+
|
|
94
81
|
function getOutliner(dom) {
|
|
95
82
|
if (!dom.outlineManager) {
|
|
96
83
|
var context = (0, _context.createContext)(dom, {
|
|
@@ -102,17 +89,16 @@ function getOutliner(dom) {
|
|
|
102
89
|
}, _solidLogic.store, _solidLogic.solidLogicSingleton);
|
|
103
90
|
dom.outlineManager = new _manager["default"](context);
|
|
104
91
|
}
|
|
105
|
-
|
|
106
92
|
return dom.outlineManager;
|
|
107
93
|
}
|
|
108
|
-
|
|
109
94
|
if (typeof window !== 'undefined') {
|
|
110
95
|
getOutliner(window.document);
|
|
111
96
|
}
|
|
112
|
-
|
|
113
97
|
(0, _registerPanes["default"])(function (cjsOrEsModule) {
|
|
114
98
|
return (0, _paneRegistry.register)(cjsOrEsModule["default"] || cjsOrEsModule);
|
|
115
|
-
});
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
// This has common outline mode functionality for the default and other other panes
|
|
116
102
|
// A separate outline manager is required per DOM in cases like a browser extension
|
|
117
103
|
// where there are many occurrences of window and of window.document
|
|
118
104
|
// But each DOM should have just one outline manager.
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["getOutliner","dom","outlineManager","context","createContext","list","paneForIcon","paneForPredicate","register","byName","store","solidLogicSingleton","OutlineManager","window","document","registerPanes","cjsOrEsModule","panes"],"sources":["../src/index.ts"],"sourcesContent":["/* SOLID PANES\n **\n ** Panes are regions of the outline view in which a particular subject is\n ** displayed in a particular way.\n ** Different panes about the same subject are typically stacked vertically.\n ** Panes may be used naked or with a pane selection header.\n **\n ** The label() method has two functions: it determines whether the pane is\n ** relevant to a given subject, returning null if not.\n ** If it is relevant, then it returns a suitable tooltip for a control which selects the pane\n */\n\nimport versionInfo from './versionInfo'\nimport * as UI from 'solid-ui'\nimport { LiveStore } from 'rdflib'\nimport { solidLogicSingleton, store } from 'solid-logic'\nimport OutlineManager from './outline/manager.js'\nimport registerPanes from './registerPanes.js'\nimport {\n list,\n paneForIcon,\n paneForPredicate,\n register,\n byName\n} from 'pane-registry'\nimport { createContext } from './outline/context'\nimport initMainPage from './mainPage'\n\nfunction getOutliner (dom) {\n if (!dom.outlineManager) {\n const context = createContext(\n dom,\n { list, paneForIcon, paneForPredicate, register, byName },\n store as LiveStore,\n solidLogicSingleton\n )\n dom.outlineManager = new OutlineManager(context)\n }\n return dom.outlineManager\n}\n\nif (typeof window !== 'undefined') {\n getOutliner(window.document)\n}\n\nregisterPanes((cjsOrEsModule: any) => register(cjsOrEsModule.default || cjsOrEsModule))\n\n// This has common outline mode functionality for the default and other other panes\n// A separate outline manager is required per DOM in cases like a browser extension\n// where there are many occurrences of window and of window.document\n// But each DOM should have just one outline manager.\n\nexport {\n OutlineManager,\n getOutliner,\n UI,\n versionInfo,\n initMainPage,\n list, // from paneRegistry\n paneForIcon, // from paneRegistry\n paneForPredicate, // from paneRegistry\n register, // from paneRegistry\n byName // from paneRegistry\n}\n\n// export for simpler access by non-node scripts\nif (typeof window !== 'undefined') {\n ;(<any>window).panes = {\n getOutliner\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","names":["getOutliner","dom","outlineManager","context","createContext","list","paneForIcon","paneForPredicate","register","byName","store","solidLogicSingleton","OutlineManager","window","document","registerPanes","cjsOrEsModule","panes"],"sources":["../src/index.ts"],"sourcesContent":["/* SOLID PANES\n **\n ** Panes are regions of the outline view in which a particular subject is\n ** displayed in a particular way.\n ** Different panes about the same subject are typically stacked vertically.\n ** Panes may be used naked or with a pane selection header.\n **\n ** The label() method has two functions: it determines whether the pane is\n ** relevant to a given subject, returning null if not.\n ** If it is relevant, then it returns a suitable tooltip for a control which selects the pane\n */\n\nimport versionInfo from './versionInfo'\nimport * as UI from 'solid-ui'\nimport { LiveStore } from 'rdflib'\nimport { solidLogicSingleton, store } from 'solid-logic'\nimport OutlineManager from './outline/manager.js'\nimport registerPanes from './registerPanes.js'\nimport {\n list,\n paneForIcon,\n paneForPredicate,\n register,\n byName\n} from 'pane-registry'\nimport { createContext } from './outline/context'\nimport initMainPage from './mainPage'\n\nfunction getOutliner (dom) {\n if (!dom.outlineManager) {\n const context = createContext(\n dom,\n { list, paneForIcon, paneForPredicate, register, byName },\n store as LiveStore,\n solidLogicSingleton\n )\n dom.outlineManager = new OutlineManager(context)\n }\n return dom.outlineManager\n}\n\nif (typeof window !== 'undefined') {\n getOutliner(window.document)\n}\n\nregisterPanes((cjsOrEsModule: any) => register(cjsOrEsModule.default || cjsOrEsModule))\n\n// This has common outline mode functionality for the default and other other panes\n// A separate outline manager is required per DOM in cases like a browser extension\n// where there are many occurrences of window and of window.document\n// But each DOM should have just one outline manager.\n\nexport {\n OutlineManager,\n getOutliner,\n UI,\n versionInfo,\n initMainPage,\n list, // from paneRegistry\n paneForIcon, // from paneRegistry\n paneForPredicate, // from paneRegistry\n register, // from paneRegistry\n byName // from paneRegistry\n}\n\n// export for simpler access by non-node scripts\nif (typeof window !== 'undefined') {\n ;(<any>window).panes = {\n getOutliner\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYA;AACA;AAA8B;AAE9B;AACA;AACA;AACA;AAOA;AACA;AAAqC;AAAA;AAAA;AA1BrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAkBA,SAASA,WAAW,CAAEC,GAAG,EAAE;EACzB,IAAI,CAACA,GAAG,CAACC,cAAc,EAAE;IACvB,IAAMC,OAAO,GAAG,IAAAC,sBAAa,EAC3BH,GAAG,EACH;MAAEI,IAAI,EAAJA,kBAAI;MAAEC,WAAW,EAAXA,yBAAW;MAAEC,gBAAgB,EAAhBA,8BAAgB;MAAEC,QAAQ,EAARA,sBAAQ;MAAEC,MAAM,EAANA;IAAO,CAAC,EACnDC,iBAAK,EACLC,+BAAmB,CAC1B;IACDV,GAAG,CAACC,cAAc,GAAG,IAAIU,mBAAc,CAACT,OAAO,CAAC;EAClD;EACA,OAAOF,GAAG,CAACC,cAAc;AAC3B;AAEA,IAAI,OAAOW,MAAM,KAAK,WAAW,EAAE;EACjCb,WAAW,CAACa,MAAM,CAACC,QAAQ,CAAC;AAC9B;AAEA,IAAAC,yBAAa,EAAC,UAACC,aAAkB;EAAA,OAAK,IAAAR,sBAAQ,EAACQ,aAAa,WAAQ,IAAIA,aAAa,CAAC;AAAA,EAAC;;AAEvF;AACA;AACA;AACA;;AAeA;AACA,IAAI,OAAOH,MAAM,KAAK,WAAW,EAAE;EACjC;EAAOA,MAAM,CAAEI,KAAK,GAAG;IACrBjB,WAAW,EAAXA;EACF,CAAC;AACH"}
|