solid-panes 3.5.27 → 3.5.28-59efa615
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/.babelrc +0 -0
- package/.eslintignore +0 -0
- package/.eslintrc +0 -0
- package/.github/workflows/ci.yml +0 -0
- package/.nvmrc +0 -0
- package/Documentation/VisualLanguage.html +0 -0
- package/Documentation/conventions.md +0 -0
- package/LICENSE.md +0 -0
- package/README.md +0 -2
- package/dev/index.html +0 -0
- package/dev/loader.ts +0 -0
- package/dev/pane/index.ts +0 -0
- package/doc/images/panes-for-classes.epgz +0 -0
- package/doc/images/panes-for-classes.svg +0 -0
- package/jest.config.js +0 -0
- package/jest.setup.ts +0 -0
- package/lib/RDFXMLPane.js +15 -9
- package/lib/RDFXMLPane.js.map +1 -1
- package/lib/argument/argumentPane.js +12 -11
- package/lib/argument/argumentPane.js.map +1 -1
- package/lib/attach/attachPane.js +58 -90
- package/lib/attach/attachPane.js.map +1 -1
- package/lib/audio/audioPane.js +19 -37
- package/lib/audio/audioPane.js.map +1 -1
- package/lib/classInstancePane.js +21 -22
- package/lib/classInstancePane.js.map +1 -1
- package/lib/dashboard/basicPreferences.d.ts +0 -0
- package/lib/dashboard/basicPreferences.d.ts.map +0 -0
- package/lib/dashboard/basicPreferences.js +96 -154
- package/lib/dashboard/basicPreferences.js.map +1 -1
- package/lib/dashboard/dashboardPane.d.ts +0 -0
- package/lib/dashboard/dashboardPane.d.ts.map +0 -0
- package/lib/dashboard/dashboardPane.js +2 -18
- package/lib/dashboard/dashboardPane.js.map +1 -1
- package/lib/dashboard/homepage.d.ts +0 -0
- package/lib/dashboard/homepage.d.ts.map +0 -0
- package/lib/dashboard/homepage.js +27 -49
- package/lib/dashboard/homepage.js.map +1 -1
- package/lib/dataContentPane.js +26 -61
- package/lib/dataContentPane.js.map +1 -1
- package/lib/defaultPane.js +23 -23
- package/lib/defaultPane.js.map +1 -1
- package/lib/dokieli/dokieliPane.js +29 -34
- package/lib/dokieli/dokieliPane.js.map +1 -1
- package/lib/dokieli/new.js +6 -1
- package/lib/dokieli/new.js.map +1 -1
- package/lib/form/pane.js +34 -45
- package/lib/form/pane.js.map +1 -1
- package/lib/global.d.js +0 -0
- package/lib/global.d.js.map +0 -0
- package/lib/home/homePane.d.ts +0 -0
- package/lib/home/homePane.d.ts.map +0 -0
- package/lib/home/homePane.js +49 -67
- 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 +19 -14
- package/lib/imagePane.js.map +1 -1
- package/lib/index.d.ts +0 -0
- package/lib/index.d.ts.map +0 -0
- package/lib/index.js +6 -20
- package/lib/index.js.map +1 -1
- package/lib/internal/internalPane.d.ts +0 -0
- package/lib/internal/internalPane.d.ts.map +0 -0
- package/lib/internal/internalPane.js +10 -41
- package/lib/internal/internalPane.js.map +1 -1
- package/lib/mainPage/footer.d.ts +0 -0
- package/lib/mainPage/footer.d.ts.map +0 -0
- package/lib/mainPage/footer.js +0 -4
- package/lib/mainPage/footer.js.map +1 -1
- package/lib/mainPage/header.d.ts +0 -0
- package/lib/mainPage/header.d.ts.map +0 -0
- package/lib/mainPage/header.js +66 -100
- package/lib/mainPage/header.js.map +1 -1
- package/lib/mainPage/index.d.ts +0 -0
- package/lib/mainPage/index.d.ts.map +0 -0
- package/lib/mainPage/index.js +17 -30
- package/lib/mainPage/index.js.map +1 -1
- package/lib/microblogPane/microblogPane.js +182 -321
- package/lib/microblogPane/microblogPane.js.map +1 -1
- package/lib/n3Pane.js +12 -8
- package/lib/n3Pane.js.map +1 -1
- package/lib/outline/context.d.ts +0 -0
- package/lib/outline/context.d.ts.map +0 -0
- package/lib/outline/context.js +0 -2
- package/lib/outline/context.js.map +1 -1
- package/lib/outline/licenseOptions.js +21 -35
- package/lib/outline/licenseOptions.js.map +1 -1
- package/lib/outline/manager.js +740 -1176
- package/lib/outline/manager.js.map +1 -1
- package/lib/outline/manager.test.js +16 -25
- package/lib/outline/manager.test.js.map +1 -1
- package/lib/outline/outlineIcons.js +39 -26
- package/lib/outline/outlineIcons.js.map +1 -1
- package/lib/outline/propertyViews.d.ts +3 -2
- package/lib/outline/propertyViews.d.ts.map +1 -1
- package/lib/outline/propertyViews.js +7 -15
- package/lib/outline/propertyViews.js.map +1 -1
- package/lib/outline/propertyViews.test.js +7 -7
- package/lib/outline/propertyViews.test.js.map +1 -1
- package/lib/outline/queryByExample.js +28 -80
- package/lib/outline/queryByExample.js.map +1 -1
- package/lib/outline/userInput.js +221 -459
- package/lib/outline/userInput.js.map +1 -1
- package/lib/outline/viewAsImage.d.ts +0 -0
- package/lib/outline/viewAsImage.d.ts.map +0 -0
- package/lib/outline/viewAsImage.js +0 -6
- package/lib/outline/viewAsImage.js.map +1 -1
- package/lib/outline/viewAsMbox.d.ts +0 -0
- package/lib/outline/viewAsMbox.d.ts.map +0 -0
- package/lib/outline/viewAsMbox.js +3 -4
- package/lib/outline/viewAsMbox.js.map +1 -1
- package/lib/pad/padPane.d.ts +0 -0
- package/lib/pad/padPane.d.ts.map +0 -0
- package/lib/pad/padPane.js +45 -93
- package/lib/pad/padPane.js.map +1 -1
- package/lib/playlist/playlistPane.js +11 -21
- package/lib/playlist/playlistPane.js.map +1 -1
- package/lib/profile/editProfile.view.d.ts +0 -0
- package/lib/profile/editProfile.view.d.ts.map +1 -1
- package/lib/profile/editProfile.view.js +22 -23
- package/lib/profile/editProfile.view.js.map +1 -1
- package/lib/profile/profile.dom.d.ts +0 -0
- package/lib/profile/profile.dom.d.ts.map +0 -0
- package/lib/profile/profile.dom.js +0 -3
- package/lib/profile/profile.dom.js.map +1 -1
- package/lib/registerPanes.js +99 -54
- package/lib/registerPanes.js.map +1 -1
- package/lib/schedule/formsForSchedule.js +6 -1
- package/lib/schedule/formsForSchedule.js.map +1 -1
- package/lib/schedule/schedulePane.js +71 -126
- package/lib/schedule/schedulePane.js.map +1 -1
- package/lib/sharing/sharingPane.d.ts +0 -0
- package/lib/sharing/sharingPane.d.ts.map +0 -0
- package/lib/sharing/sharingPane.js +2 -10
- package/lib/sharing/sharingPane.js.map +1 -1
- package/lib/slideshow/slideshowPane.js +21 -21
- package/lib/slideshow/slideshowPane.js.map +1 -1
- package/lib/socialPane.js +58 -135
- package/lib/socialPane.js.map +1 -1
- package/lib/tabbed/tabbedPane.d.ts +0 -0
- package/lib/tabbed/tabbedPane.d.ts.map +0 -0
- package/lib/tabbed/tabbedPane.js +32 -48
- package/lib/tabbed/tabbedPane.js.map +1 -1
- package/lib/tableViewPane.js +15 -9
- package/lib/tableViewPane.js.map +1 -1
- package/lib/test-import-export/common.js +8 -3
- package/lib/test-import-export/common.js.map +1 -1
- package/lib/test-import-export/edit-importer.js +10 -14
- package/lib/test-import-export/edit-importer.js.map +1 -1
- package/lib/test-import-export/testImportExport.js +0 -0
- package/lib/test-import-export/testImportExport.js.map +0 -0
- package/lib/transaction/pane.js +38 -91
- package/lib/transaction/pane.js.map +1 -1
- package/lib/transaction/period.js +27 -71
- package/lib/transaction/period.js.map +1 -1
- package/lib/trip/tripPane.js +38 -35
- package/lib/trip/tripPane.js.map +1 -1
- package/lib/trustedApplications/trustedApplications.dom.d.ts +0 -0
- package/lib/trustedApplications/trustedApplications.dom.d.ts.map +0 -0
- package/lib/trustedApplications/trustedApplications.dom.js +12 -35
- package/lib/trustedApplications/trustedApplications.dom.js.map +1 -1
- package/lib/trustedApplications/trustedApplications.test.js +6 -8
- package/lib/trustedApplications/trustedApplications.test.js.map +1 -1
- package/lib/trustedApplications/trustedApplications.utils.d.ts +0 -0
- package/lib/trustedApplications/trustedApplications.utils.d.ts.map +0 -0
- package/lib/trustedApplications/trustedApplications.utils.js +1 -11
- package/lib/trustedApplications/trustedApplications.utils.js.map +1 -1
- package/lib/trustedApplications/trustedApplications.view.d.ts +0 -0
- package/lib/trustedApplications/trustedApplications.view.d.ts.map +0 -0
- package/lib/trustedApplications/trustedApplications.view.js +38 -61
- package/lib/trustedApplications/trustedApplications.view.js.map +1 -1
- package/lib/types.d.ts +0 -0
- package/lib/types.d.ts.map +0 -0
- package/lib/types.js +0 -0
- package/lib/types.js.map +0 -0
- package/lib/ui/pane.js +30 -29
- package/lib/ui/pane.js.map +1 -1
- package/lib/versionInfo.d.ts +0 -0
- package/lib/versionInfo.d.ts.map +0 -0
- package/lib/versionInfo.js +14 -14
- package/lib/versionInfo.js.map +1 -1
- package/lib/video/videoPane.js +11 -7
- package/lib/video/videoPane.js.map +1 -1
- package/package.json +26 -26
- package/src/RDFXMLPane.js +2 -2
- package/src/argument/argumentPane.js +1 -1
- package/src/argument/argument_icon_v04.jpg +0 -0
- package/src/argument/icon_argument.png +0 -0
- package/src/argument/transparentyingyang.png +0 -0
- package/src/attach/attachPane.js +3 -3
- package/src/attach/tbl-paperclip-128.png +0 -0
- package/src/attach/tbl-paperclip-22.png +0 -0
- package/src/attach/tbl-paperclip-22a.png +0 -0
- package/src/audio/audioPane.js +3 -3
- package/src/chatPreferencesForm.ttl +0 -0
- package/src/classInstancePane.js +3 -3
- package/src/dashboard/basicPreferences.ts +0 -0
- package/src/dashboard/dashboardPane.ts +0 -0
- package/src/dashboard/homepage.ts +0 -0
- package/src/dashboard/languages/codes.html +0 -0
- package/src/dashboard/languages/codes.xml +0 -0
- package/src/dashboard/languages/codes2.txt +0 -0
- package/src/dashboard/languages/foo +0 -0
- package/src/dashboard/languages/foo.ttl +0 -0
- package/src/dashboard/languages/get-language-names.sh +0 -0
- package/src/dashboard/ontologyData.ttl +0 -0
- package/src/dashboard/preferencesFormText.ttl +0 -0
- package/src/dataContentPane.js +3 -4
- package/src/defaultPane.js +3 -3
- package/src/dokieli/Makefile +0 -0
- package/src/dokieli/dokieliPane.js +5 -5
- package/src/dokieli/new.html +0 -0
- package/src/dokieli/new.js +1 -1
- package/src/form/form-22.png +0 -0
- package/src/form/form-b-22.png +0 -0
- package/src/form/form.graffle +0 -0
- package/src/form/form.png +0 -0
- package/src/form/pane.js +2 -2
- package/src/form/psuedocode-notes.txt +0 -0
- package/src/global.d.ts +0 -0
- package/src/home/homePane.ts +0 -0
- package/src/humanReadablePane.js +0 -0
- package/src/imagePane.js +2 -2
- package/src/index.ts +1 -1
- package/src/internal/internalPane.ts +0 -0
- package/src/mainPage/footer.ts +0 -0
- package/src/mainPage/header.ts +0 -0
- package/src/mainPage/index.ts +0 -0
- package/src/meeting/Makefile +0 -0
- package/src/meeting/test/meeting1/Actions/actions.ttl +0 -0
- package/src/meeting/test/meeting1/Actions/config.ttl +0 -0
- package/src/meeting/test/meeting1/Actions/state.ttl +0 -0
- package/src/meeting/test/meeting1/Schedule/details.ttl +0 -0
- package/src/meeting/test/meeting1/Schedule/details.ttl.acl +0 -0
- package/src/meeting/test/meeting1/Schedule/forms.ttl +0 -0
- package/src/meeting/test/meeting1/Schedule/forms.ttl.acl +0 -0
- package/src/meeting/test/meeting1/Schedule/index.html +0 -0
- package/src/meeting/test/meeting1/Schedule/index.html.acl +0 -0
- package/src/meeting/test/meeting1/Schedule/results.ttl +0 -0
- package/src/meeting/test/meeting1/Schedule/results.ttl.acl +0 -0
- package/src/meeting/test/meeting1/SharedNotes/pad.ttl +0 -0
- package/src/meeting/test/meeting1/chat/chat.ttl +0 -0
- package/src/meeting/test/meeting1/details.ttl +0 -0
- package/src/meeting/test/meeting1/pad/pad.ttl +0 -0
- package/src/microblogPane/mbStyle.css +0 -0
- package/src/microblogPane/microblogPane.js +1 -1
- package/src/n3Pane.js +2 -2
- package/src/outline/context.ts +0 -0
- package/src/outline/licenseOptions.js +9 -8
- package/src/outline/manager.js +18 -20
- package/src/outline/manager.test.ts +6 -0
- package/src/outline/outlineIcons.js +4 -2
- package/src/outline/propertyViews.test.ts +7 -1
- package/src/outline/propertyViews.ts +3 -3
- package/src/outline/queryByExample.js +3 -9
- package/src/outline/userInput.js +1 -1
- package/src/outline/viewAsImage.ts +0 -0
- package/src/outline/viewAsMbox.ts +0 -0
- package/src/pad/images/ColourOff.ai +0 -0
- package/src/pad/images/ColourOff.png +0 -0
- package/src/pad/images/ColourOn.ai +0 -0
- package/src/pad/images/ColourOn.png +0 -0
- package/src/pad/padPane.ts +0 -0
- package/src/playlist/playlistPane.js +3 -3
- package/src/profile/editProfile.view.ts +20 -0
- package/src/profile/profile.dom.ts +0 -0
- package/src/profile/profileFormText.ttl +0 -0
- package/src/registerPanes.js +92 -52
- package/src/schedule/Makefile +0 -0
- package/src/schedule/formsForSchedule.js +1 -1
- package/src/schedule/formsForSchedule.ttl +0 -0
- package/src/schedule/schedulePane.js +6 -2
- package/src/sharing/sharingPane.ts +0 -0
- package/src/slideshow/slideshowPane.js +3 -6
- package/src/socialPane.js +4 -5
- package/src/style/tabbedtab.css +0 -0
- package/src/tabbed/tabbedPane.ts +0 -0
- package/src/tableViewPane.js +3 -3
- package/src/test-import-export/common.js +1 -1
- package/src/test-import-export/edit-importer.js +5 -10
- package/src/test-import-export/testImportExport.js +0 -0
- package/src/transaction/068010-3d-transparent-glass-icon-alphanumeric-dollar-sign.png +0 -0
- package/src/transaction/075988-3d-transparent-glass-icon-business-currency-british-pound-sc35.png +0 -0
- package/src/transaction/22-pixel-068010-3d-transparent-glass-icon-alphanumeric-dollar-sign.png +0 -0
- package/src/transaction/pane.js +3 -3
- package/src/transaction/period.js +2 -2
- package/src/transaction/thumbs_075987-3d-transparent-glass-icon-business-creditcard2.png +0 -0
- package/src/transaction/thumbs_075989-3d-transparent-glass-icon-business-currency-cent-sc35.png +0 -0
- package/src/trip/tripPane.js +3 -3
- package/src/trustedApplications/__snapshots__/trustedApplications.test.ts.snap +0 -0
- package/src/trustedApplications/trustedApplications.dom.ts +0 -0
- package/src/trustedApplications/trustedApplications.test.ts +4 -0
- package/src/trustedApplications/trustedApplications.utils.ts +0 -0
- package/src/trustedApplications/trustedApplications.view.ts +0 -0
- package/src/types.ts +0 -0
- package/src/ui/22-builder.png +0 -0
- package/src/ui/builder.graffle +0 -0
- package/src/ui/builder.png +0 -0
- package/src/ui/builder2.png +0 -0
- package/src/ui/pane.js +3 -3
- package/src/versionInfo.ts +14 -14
- package/src/video/videoPane.js +3 -3
- package/timestamp.sh +0 -0
- package/travis/bumpversion.js +0 -0
- package/tsconfig.json +0 -0
- package/typings/raw-loader.d.ts +0 -0
- package/typings/solid-namespace/index.d.ts +0 -0
- package/webpack.config.js +0 -0
|
@@ -4,52 +4,39 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.generateHomepage = generateHomepage;
|
|
7
|
-
|
|
8
7
|
var _rdflib = require("rdflib");
|
|
9
|
-
|
|
10
8
|
var _solidUi = require("solid-ui");
|
|
11
|
-
|
|
12
9
|
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); }
|
|
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 methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), 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
|
function generateHomepage(_x, _x2, _x3) {
|
|
21
14
|
return _generateHomepage.apply(this, arguments);
|
|
22
15
|
}
|
|
23
|
-
|
|
24
16
|
function _generateHomepage() {
|
|
25
17
|
_generateHomepage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(subject, store, fetcher) {
|
|
26
18
|
var ownersProfile, name, wrapper;
|
|
27
19
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
28
|
-
while (1) {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
case 9:
|
|
44
|
-
case "end":
|
|
45
|
-
return _context.stop();
|
|
46
|
-
}
|
|
20
|
+
while (1) switch (_context.prev = _context.next) {
|
|
21
|
+
case 0:
|
|
22
|
+
_context.next = 2;
|
|
23
|
+
return loadProfile(subject, fetcher);
|
|
24
|
+
case 2:
|
|
25
|
+
ownersProfile = _context.sent;
|
|
26
|
+
name = getName(store, ownersProfile);
|
|
27
|
+
wrapper = document.createElement('div');
|
|
28
|
+
wrapper.classList.add('container');
|
|
29
|
+
wrapper.appendChild(createTitle(ownersProfile.uri, name));
|
|
30
|
+
wrapper.appendChild(createDataSection(name));
|
|
31
|
+
return _context.abrupt("return", wrapper);
|
|
32
|
+
case 9:
|
|
33
|
+
case "end":
|
|
34
|
+
return _context.stop();
|
|
47
35
|
}
|
|
48
36
|
}, _callee);
|
|
49
37
|
}));
|
|
50
38
|
return _generateHomepage.apply(this, arguments);
|
|
51
39
|
}
|
|
52
|
-
|
|
53
40
|
function createDataSection(name) {
|
|
54
41
|
var dataSection = document.createElement('section');
|
|
55
42
|
var title = document.createElement('h2');
|
|
@@ -65,7 +52,6 @@ function createDataSection(name) {
|
|
|
65
52
|
listGroup.appendChild(publicDataLink);
|
|
66
53
|
return dataSection;
|
|
67
54
|
}
|
|
68
|
-
|
|
69
55
|
function createTitle(uri, name) {
|
|
70
56
|
var profileLink = document.createElement('a');
|
|
71
57
|
profileLink.href = uri;
|
|
@@ -77,37 +63,29 @@ function createTitle(uri, name) {
|
|
|
77
63
|
title.appendChild(profileLinkPost);
|
|
78
64
|
return title;
|
|
79
65
|
}
|
|
80
|
-
|
|
81
66
|
function loadProfile(_x4, _x5) {
|
|
82
67
|
return _loadProfile.apply(this, arguments);
|
|
83
68
|
}
|
|
84
|
-
|
|
85
69
|
function _loadProfile() {
|
|
86
70
|
_loadProfile = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(subject, fetcher) {
|
|
87
71
|
var pod, webId;
|
|
88
72
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
89
|
-
while (1) {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
case 5:
|
|
102
|
-
case "end":
|
|
103
|
-
return _context2.stop();
|
|
104
|
-
}
|
|
73
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
74
|
+
case 0:
|
|
75
|
+
pod = subject.site().uri; // TODO: This is a hack - we cannot assume that the profile is at this document, but we will live with it for now
|
|
76
|
+
webId = (0, _rdflib.sym)("".concat(pod, "profile/card#me"));
|
|
77
|
+
_context2.next = 4;
|
|
78
|
+
return fetcher.load(webId);
|
|
79
|
+
case 4:
|
|
80
|
+
return _context2.abrupt("return", webId);
|
|
81
|
+
case 5:
|
|
82
|
+
case "end":
|
|
83
|
+
return _context2.stop();
|
|
105
84
|
}
|
|
106
85
|
}, _callee2);
|
|
107
86
|
}));
|
|
108
87
|
return _loadProfile.apply(this, arguments);
|
|
109
88
|
}
|
|
110
|
-
|
|
111
89
|
function getName(store, ownersProfile) {
|
|
112
90
|
return store.anyValue(ownersProfile, _solidUi.ns.vcard('fn'), null, ownersProfile.doc()) || store.anyValue(ownersProfile, _solidUi.ns.foaf('name'), null, ownersProfile.doc()) || new URL(ownersProfile.uri).host.split('.')[0];
|
|
113
91
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"homepage.js","names":["generateHomepage","subject","store","fetcher","loadProfile","ownersProfile","name","getName","wrapper","document","createElement","classList","add","appendChild","createTitle","uri","createDataSection","dataSection","title","innerText","listGroup","publicDataLink","href","window","location","profileLink","profileLinkPost","pod","site","webId","sym","load","anyValue","ns","vcard","doc","foaf","URL","host","split"],"sources":["../../src/dashboard/homepage.ts"],"sourcesContent":["import { Fetcher, IndexedFormula, NamedNode, sym } from 'rdflib'\nimport { ns } from 'solid-ui'\n\nexport async function generateHomepage (\n subject: NamedNode,\n store: IndexedFormula,\n fetcher: Fetcher\n): Promise<HTMLElement> {\n const ownersProfile = await loadProfile(subject, fetcher)\n const name = getName(store, ownersProfile)\n\n const wrapper = document.createElement('div')\n wrapper.classList.add('container')\n wrapper.appendChild(createTitle(ownersProfile.uri, name))\n wrapper.appendChild(createDataSection(name))\n\n return wrapper\n}\n\nfunction createDataSection (name: string): HTMLElement {\n const dataSection = document.createElement('section')\n\n const title = document.createElement('h2')\n title.innerText = 'Data'\n dataSection.appendChild(title)\n\n const listGroup = document.createElement('div')\n listGroup.classList.add('list-group')\n dataSection.appendChild(listGroup)\n\n const publicDataLink = document.createElement('a')\n publicDataLink.classList.add('list-group-item')\n publicDataLink.href = window.document.location.href + 'public/'\n publicDataLink.innerText = `View ${name}'s files`\n listGroup.appendChild(publicDataLink)\n\n return dataSection\n}\n\nfunction createTitle (uri: string, name: string): HTMLElement {\n const profileLink = document.createElement('a')\n profileLink.href = uri\n profileLink.innerText = name\n\n const profileLinkPost = document.createElement('span')\n profileLinkPost.innerText = '\\'s Pod'\n\n const title = document.createElement('h1')\n title.appendChild(profileLink)\n title.appendChild(profileLinkPost)\n\n return title\n}\n\nasync function loadProfile (\n subject: NamedNode,\n fetcher: Fetcher\n): Promise<NamedNode> {\n const pod = subject.site().uri\n // TODO: This is a hack - we cannot assume that the profile is at this document, but we will live with it for now\n const webId = sym(`${pod}profile/card#me`)\n await fetcher.load(webId)\n return webId\n}\n\nfunction getName (store: IndexedFormula, ownersProfile: NamedNode): string {\n return (\n store.anyValue(ownersProfile, ns.vcard('fn'), null, ownersProfile.doc()) ||\n store.anyValue(ownersProfile, ns.foaf('name'), null, ownersProfile.doc()) ||\n new URL(ownersProfile.uri).host.split('.')[0]\n )\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"homepage.js","names":["generateHomepage","subject","store","fetcher","loadProfile","ownersProfile","name","getName","wrapper","document","createElement","classList","add","appendChild","createTitle","uri","createDataSection","dataSection","title","innerText","listGroup","publicDataLink","href","window","location","profileLink","profileLinkPost","pod","site","webId","sym","load","anyValue","ns","vcard","doc","foaf","URL","host","split"],"sources":["../../src/dashboard/homepage.ts"],"sourcesContent":["import { Fetcher, IndexedFormula, NamedNode, sym } from 'rdflib'\nimport { ns } from 'solid-ui'\n\nexport async function generateHomepage (\n subject: NamedNode,\n store: IndexedFormula,\n fetcher: Fetcher\n): Promise<HTMLElement> {\n const ownersProfile = await loadProfile(subject, fetcher)\n const name = getName(store, ownersProfile)\n\n const wrapper = document.createElement('div')\n wrapper.classList.add('container')\n wrapper.appendChild(createTitle(ownersProfile.uri, name))\n wrapper.appendChild(createDataSection(name))\n\n return wrapper\n}\n\nfunction createDataSection (name: string): HTMLElement {\n const dataSection = document.createElement('section')\n\n const title = document.createElement('h2')\n title.innerText = 'Data'\n dataSection.appendChild(title)\n\n const listGroup = document.createElement('div')\n listGroup.classList.add('list-group')\n dataSection.appendChild(listGroup)\n\n const publicDataLink = document.createElement('a')\n publicDataLink.classList.add('list-group-item')\n publicDataLink.href = window.document.location.href + 'public/'\n publicDataLink.innerText = `View ${name}'s files`\n listGroup.appendChild(publicDataLink)\n\n return dataSection\n}\n\nfunction createTitle (uri: string, name: string): HTMLElement {\n const profileLink = document.createElement('a')\n profileLink.href = uri\n profileLink.innerText = name\n\n const profileLinkPost = document.createElement('span')\n profileLinkPost.innerText = '\\'s Pod'\n\n const title = document.createElement('h1')\n title.appendChild(profileLink)\n title.appendChild(profileLinkPost)\n\n return title\n}\n\nasync function loadProfile (\n subject: NamedNode,\n fetcher: Fetcher\n): Promise<NamedNode> {\n const pod = subject.site().uri\n // TODO: This is a hack - we cannot assume that the profile is at this document, but we will live with it for now\n const webId = sym(`${pod}profile/card#me`)\n await fetcher.load(webId)\n return webId\n}\n\nfunction getName (store: IndexedFormula, ownersProfile: NamedNode): string {\n return (\n store.anyValue(ownersProfile, ns.vcard('fn'), null, ownersProfile.doc()) ||\n store.anyValue(ownersProfile, ns.foaf('name'), null, ownersProfile.doc()) ||\n new URL(ownersProfile.uri).host.split('.')[0]\n )\n}\n"],"mappings":";;;;;;AAAA;AACA;AAA6B;AAAA,+CAA7B;AAAA;AAAA;AAAA,SAEsBA,gBAAgB;EAAA;AAAA;AAAA;EAAA,+EAA/B,iBACLC,OAAkB,EAClBC,KAAqB,EACrBC,OAAgB;IAAA;IAAA;MAAA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CAACuB,IAAI,CAACC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AAEjD"}
|
package/lib/dataContentPane.js
CHANGED
|
@@ -1,20 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.dataContentPane = void 0;
|
|
8
|
+
var UI = _interopRequireWildcard(require("solid-ui"));
|
|
9
|
+
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); }
|
|
10
|
+
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; }
|
|
3
11
|
/* Data content Pane
|
|
4
12
|
**
|
|
5
13
|
** This pane shows the content of a particular RDF resource
|
|
6
14
|
** or at least the RDF semantics we attribute to that resource.
|
|
7
15
|
*/
|
|
16
|
+
|
|
8
17
|
// To do: - Only take data from one graph
|
|
9
18
|
// - Only do forwards not backward?
|
|
10
19
|
// - Expand automatically all the way down
|
|
11
20
|
// - original source view? Use ffox view source
|
|
12
|
-
var UI = require('solid-ui');
|
|
13
|
-
|
|
14
|
-
var $rdf = require('rdflib');
|
|
15
21
|
|
|
16
22
|
var ns = UI.ns;
|
|
17
|
-
|
|
23
|
+
var dataContentPane = {
|
|
18
24
|
icon: UI.icons.originalIconBase + 'rdf_flyer.24.gif',
|
|
19
25
|
name: 'dataContents',
|
|
20
26
|
audience: [ns.solid('Developer')],
|
|
@@ -22,62 +28,51 @@ module.exports = {
|
|
|
22
28
|
if ('http://www.w3.org/2007/ont/link#ProtocolEvent' in context.session.store.findTypeURIs(subject)) {
|
|
23
29
|
return null;
|
|
24
30
|
}
|
|
25
|
-
|
|
26
31
|
var n = context.session.store.statementsMatching(undefined, undefined, undefined, subject).length;
|
|
27
32
|
if (n === 0) return null;
|
|
28
33
|
return 'Data (' + n + ')';
|
|
29
34
|
},
|
|
30
|
-
|
|
31
35
|
/*
|
|
32
36
|
shouldGetFocus: function(subject) {
|
|
33
37
|
return store.whether(subject, UI.ns.rdf('type'), UI.ns.link('RDFDocument'))
|
|
34
38
|
},
|
|
35
39
|
*/
|
|
36
40
|
statementsAsTables: function statementsAsTables(sts, context, initialRoots) {
|
|
37
|
-
var myDocument = context.dom;
|
|
38
|
-
|
|
41
|
+
var myDocument = context.dom;
|
|
42
|
+
// const outliner = context.getOutliner(myDocument)
|
|
39
43
|
var rep = myDocument.createElement('table');
|
|
40
44
|
var sz = UI.rdf.Serializer(context.session.store);
|
|
41
45
|
var res = sz.rootSubjects(sts);
|
|
42
46
|
var roots = res.roots;
|
|
43
47
|
var subjects = res.subjects;
|
|
44
48
|
var loopBreakers = res.loopBreakers;
|
|
45
|
-
|
|
46
49
|
for (var x in loopBreakers) {
|
|
47
50
|
console.log('\tdataContentPane: loopbreaker:' + x);
|
|
48
51
|
}
|
|
49
|
-
|
|
50
52
|
var doneBnodes = {}; // For preventing looping
|
|
51
|
-
|
|
52
53
|
var referencedBnodes = {}; // Bnodes which need to be named alas
|
|
53
|
-
// The property tree for a single subject or anonymous node
|
|
54
54
|
|
|
55
|
+
// The property tree for a single subject or anonymous node
|
|
55
56
|
function propertyTree(subject) {
|
|
56
57
|
// print('Proprty tree for '+subject)
|
|
57
58
|
var rep = myDocument.createElement('table');
|
|
58
59
|
var lastPred = null;
|
|
59
60
|
var sts = subjects[sz.toStr(subject)]; // relevant statements
|
|
60
|
-
|
|
61
61
|
if (!sts) {
|
|
62
62
|
// No statements in tree
|
|
63
63
|
rep.appendChild(myDocument.createTextNode('...')); // just empty bnode as object
|
|
64
|
-
|
|
65
64
|
return rep;
|
|
66
65
|
}
|
|
67
|
-
|
|
68
66
|
sts.sort();
|
|
69
67
|
var same = 0;
|
|
70
68
|
var predicateTD; // The cell which holds the predicate
|
|
71
|
-
|
|
72
69
|
for (var i = 0; i < sts.length; i++) {
|
|
73
70
|
var st = sts[i];
|
|
74
71
|
var tr = myDocument.createElement('tr');
|
|
75
|
-
|
|
76
72
|
if (st.predicate.uri !== lastPred) {
|
|
77
73
|
if (lastPred && same > 1) {
|
|
78
74
|
predicateTD.setAttribute('rowspan', '' + same);
|
|
79
75
|
}
|
|
80
|
-
|
|
81
76
|
predicateTD = myDocument.createElement('td');
|
|
82
77
|
predicateTD.setAttribute('class', 'pred');
|
|
83
78
|
var anchor = myDocument.createElement('a');
|
|
@@ -89,22 +84,19 @@ module.exports = {
|
|
|
89
84
|
lastPred = st.predicate.uri;
|
|
90
85
|
same = 0;
|
|
91
86
|
}
|
|
92
|
-
|
|
93
87
|
same++;
|
|
94
88
|
var objectTD = myDocument.createElement('td');
|
|
95
89
|
objectTD.appendChild(objectTree(st.object));
|
|
96
90
|
tr.appendChild(objectTD);
|
|
97
91
|
rep.appendChild(tr);
|
|
98
92
|
}
|
|
99
|
-
|
|
100
93
|
if (lastPred && same > 1) predicateTD.setAttribute('rowspan', '' + same);
|
|
101
94
|
return rep;
|
|
102
|
-
}
|
|
103
|
-
|
|
95
|
+
}
|
|
104
96
|
|
|
97
|
+
// Convert a set of statements into a nested tree of tables
|
|
105
98
|
function objectTree(obj) {
|
|
106
99
|
var res, anchor;
|
|
107
|
-
|
|
108
100
|
switch (obj.termType) {
|
|
109
101
|
case 'NamedNode':
|
|
110
102
|
anchor = myDocument.createElement('a');
|
|
@@ -112,7 +104,6 @@ module.exports = {
|
|
|
112
104
|
anchor.addEventListener('click', UI.widgets.openHrefInOutlineMode, true);
|
|
113
105
|
anchor.appendChild(myDocument.createTextNode(UI.utils.label(obj)));
|
|
114
106
|
return anchor;
|
|
115
|
-
|
|
116
107
|
case 'Literal':
|
|
117
108
|
if (!obj.datatype || !obj.datatype.uri) {
|
|
118
109
|
res = myDocument.createElement('div');
|
|
@@ -123,10 +114,8 @@ module.exports = {
|
|
|
123
114
|
res = myDocument.createElement('div');
|
|
124
115
|
res.setAttribute('class', 'embeddedXHTML');
|
|
125
116
|
res.innerHTML = obj.value; // Try that @@@ beware embedded dangerous code
|
|
126
|
-
|
|
127
117
|
return res;
|
|
128
118
|
}
|
|
129
|
-
|
|
130
119
|
return myDocument.createTextNode(obj.value);
|
|
131
120
|
// placeholder - could be smarter,
|
|
132
121
|
|
|
@@ -135,56 +124,43 @@ module.exports = {
|
|
|
135
124
|
if (obj.toNT() in doneBnodes) {
|
|
136
125
|
// Break infinite recursion
|
|
137
126
|
referencedBnodes[obj.toNT()] = true;
|
|
138
|
-
|
|
139
127
|
var _anchor = myDocument.createElement('a');
|
|
140
|
-
|
|
141
128
|
_anchor.setAttribute('href', '#' + obj.toNT().slice(2));
|
|
142
|
-
|
|
143
129
|
_anchor.setAttribute('class', 'bnodeRef');
|
|
144
|
-
|
|
145
130
|
_anchor.textContent = '*' + obj.toNT().slice(3);
|
|
146
131
|
return _anchor;
|
|
147
132
|
}
|
|
148
|
-
|
|
149
133
|
doneBnodes[obj.toNT()] = true; // Flag to prevent infinite recursion in propertyTree
|
|
150
|
-
|
|
151
134
|
var newTable = propertyTree(obj);
|
|
152
135
|
doneBnodes[obj.toNT()] = newTable; // Track where we mentioned it first
|
|
153
|
-
|
|
154
136
|
if (UI.utils.ancestor(newTable, 'TABLE') && UI.utils.ancestor(newTable, 'TABLE').style.backgroundColor === 'white') {
|
|
155
137
|
newTable.style.backgroundColor = '#eee';
|
|
156
138
|
} else {
|
|
157
139
|
newTable.style.backgroundColor = 'white';
|
|
158
140
|
}
|
|
159
|
-
|
|
160
141
|
return newTable;
|
|
161
142
|
}
|
|
162
|
-
|
|
163
143
|
case 'Collection':
|
|
164
144
|
res = myDocument.createElement('table');
|
|
165
145
|
res.setAttribute('class', 'collectionAsTables');
|
|
166
|
-
|
|
167
146
|
for (var i = 0; i < obj.elements.length; i++) {
|
|
168
147
|
var tr = myDocument.createElement('tr');
|
|
169
148
|
res.appendChild(tr);
|
|
170
149
|
tr.appendChild(objectTree(obj.elements[i]));
|
|
171
150
|
}
|
|
172
|
-
|
|
173
151
|
return res;
|
|
174
|
-
|
|
175
152
|
case 'Graph':
|
|
176
153
|
res = context.session.paneRegistry.byName('dataContents').statementsAsTables(obj.statements, context);
|
|
177
154
|
res.setAttribute('class', 'nestedFormula');
|
|
178
155
|
return res;
|
|
179
|
-
|
|
180
156
|
case 'Variable':
|
|
181
157
|
res = myDocument.createTextNode('?' + obj.uri);
|
|
182
158
|
return res;
|
|
183
159
|
}
|
|
184
|
-
|
|
185
160
|
throw new Error('Unhandled node type: ' + obj.termType);
|
|
186
|
-
}
|
|
161
|
+
}
|
|
187
162
|
|
|
163
|
+
// roots.sort()
|
|
188
164
|
|
|
189
165
|
if (initialRoots) {
|
|
190
166
|
roots = initialRoots.concat(roots.filter(function (x) {
|
|
@@ -192,11 +168,9 @@ module.exports = {
|
|
|
192
168
|
// Max 2
|
|
193
169
|
if (x.sameTerm(initialRoots[i])) return false;
|
|
194
170
|
}
|
|
195
|
-
|
|
196
171
|
return true;
|
|
197
172
|
}));
|
|
198
173
|
}
|
|
199
|
-
|
|
200
174
|
for (var i = 0; i < roots.length; i++) {
|
|
201
175
|
var tr = myDocument.createElement('tr');
|
|
202
176
|
rep.appendChild(tr);
|
|
@@ -205,7 +179,6 @@ module.exports = {
|
|
|
205
179
|
var TDTree = myDocument.createElement('td');
|
|
206
180
|
tr.appendChild(TDTree);
|
|
207
181
|
var root = roots[i];
|
|
208
|
-
|
|
209
182
|
if (root.termType === 'BlankNode') {
|
|
210
183
|
subjectTD.appendChild(myDocument.createTextNode(UI.utils.label(root))); // Don't recurse!
|
|
211
184
|
} else {
|
|
@@ -214,31 +187,27 @@ module.exports = {
|
|
|
214
187
|
|
|
215
188
|
TDTree.appendChild(propertyTree(root));
|
|
216
189
|
}
|
|
217
|
-
|
|
218
190
|
for (var bNT in referencedBnodes) {
|
|
219
191
|
// Add number to refer to
|
|
220
|
-
var table = doneBnodes[bNT];
|
|
221
|
-
|
|
192
|
+
var table = doneBnodes[bNT];
|
|
193
|
+
// let tr = myDocument.createElement('tr')
|
|
222
194
|
var anchor = myDocument.createElement('a');
|
|
223
195
|
anchor.setAttribute('id', bNT.slice(2));
|
|
224
196
|
anchor.setAttribute('class', 'bnodeDef');
|
|
225
197
|
anchor.textContent = bNT.slice(3) + ')';
|
|
226
198
|
table.insertBefore(anchor, table.firstChild);
|
|
227
199
|
}
|
|
228
|
-
|
|
229
200
|
return rep;
|
|
230
201
|
},
|
|
231
202
|
// statementsAsTables
|
|
232
203
|
// View the data in a file in user-friendly way
|
|
233
204
|
render: function render(subject, context) {
|
|
234
205
|
var myDocument = context.dom;
|
|
235
|
-
|
|
236
206
|
function alternativeRendering() {
|
|
237
207
|
var sz = UI.rdf.Serializer(context.session.store);
|
|
238
208
|
var res = sz.rootSubjects(sts);
|
|
239
209
|
var roots = res.roots;
|
|
240
210
|
var p = {};
|
|
241
|
-
|
|
242
211
|
p.render = function (s2) {
|
|
243
212
|
var div = myDocument.createElement('div');
|
|
244
213
|
div.setAttribute('class', 'withinDocumentPane');
|
|
@@ -248,7 +217,6 @@ module.exports = {
|
|
|
248
217
|
});
|
|
249
218
|
return div;
|
|
250
219
|
};
|
|
251
|
-
|
|
252
220
|
for (var i = 0; i < roots.length; i++) {
|
|
253
221
|
var tr = myDocument.createElement('TR');
|
|
254
222
|
var root = roots[i];
|
|
@@ -261,36 +229,33 @@ module.exports = {
|
|
|
261
229
|
});
|
|
262
230
|
}
|
|
263
231
|
}
|
|
264
|
-
|
|
265
232
|
function mainRendering() {
|
|
266
233
|
var initialRoots = []; // Ordering: start with stuff about this doc
|
|
267
|
-
|
|
268
234
|
if (kb.holds(subject, undefined, undefined, subject)) {
|
|
269
235
|
initialRoots.push(subject);
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
|
|
236
|
+
}
|
|
237
|
+
// Then about the primary topic of the document if any
|
|
273
238
|
var ps = kb.any(subject, UI.ns.foaf('primaryTopic'), undefined, subject);
|
|
274
239
|
if (ps) initialRoots.push(ps);
|
|
275
240
|
div.appendChild(context.session.paneRegistry.byName('dataContents').statementsAsTables(sts, context, initialRoots));
|
|
276
241
|
}
|
|
277
|
-
|
|
278
242
|
var outliner = context.getOutliner(myDocument);
|
|
279
243
|
var kb = context.session.store;
|
|
280
244
|
var div = myDocument.createElement('div');
|
|
281
|
-
div.setAttribute('class', 'dataContentPane');
|
|
245
|
+
div.setAttribute('class', 'dataContentPane');
|
|
246
|
+
// Because of smushing etc, this will not be a copy of the original source
|
|
282
247
|
// We could instead either fetch and re-parse the source,
|
|
283
248
|
// or we could keep all the pre-smushed triples.
|
|
284
|
-
|
|
285
249
|
var sts = kb.statementsMatching(undefined, undefined, undefined, subject); // @@ slow with current store!
|
|
286
250
|
|
|
287
|
-
if (
|
|
251
|
+
if (false) {
|
|
252
|
+
// keep code
|
|
288
253
|
alternativeRendering();
|
|
289
254
|
} else {
|
|
290
255
|
mainRendering();
|
|
291
256
|
}
|
|
292
|
-
|
|
293
257
|
return div;
|
|
294
258
|
}
|
|
295
259
|
};
|
|
260
|
+
exports.dataContentPane = dataContentPane;
|
|
296
261
|
//# sourceMappingURL=dataContentPane.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dataContentPane.js","names":["UI","require","$rdf","ns","module","exports","icon","icons","originalIconBase","name","audience","solid","label","subject","context","session","store","findTypeURIs","n","statementsMatching","undefined","length","statementsAsTables","sts","initialRoots","myDocument","dom","rep","createElement","sz","rdf","Serializer","res","rootSubjects","roots","subjects","loopBreakers","x","console","log","doneBnodes","referencedBnodes","propertyTree","lastPred","toStr","appendChild","createTextNode","sort","same","predicateTD","i","st","tr","predicate","uri","setAttribute","anchor","addEventListener","widgets","openHrefInOutlineMode","utils","predicateLabelForXML","objectTD","objectTree","object","obj","termType","datatype","textContent","value","innerHTML","toNT","slice","newTable","ancestor","style","backgroundColor","elements","paneRegistry","byName","statements","Error","concat","filter","sameTerm","subjectTD","TDTree","root","bNT","table","insertBefore","firstChild","render","alternativeRendering","p","s2","div","plist","kb","outliner","appendPropertyTRs","_pred","_inverse","verticalAlign","td","outlineObjectTD","outlineExpand","pane","mainRendering","holds","push","ps","any","foaf","getOutliner","keepThisCodeForLaterButDisableFerossConstantConditionPolice"],"sources":["../src/dataContentPane.js"],"sourcesContent":["/* Data content Pane\n **\n ** This pane shows the content of a particular RDF resource\n ** or at least the RDF semantics we attribute to that resource.\n */\n\n// To do: - Only take data from one graph\n// - Only do forwards not backward?\n// - Expand automatically all the way down\n// - original source view? Use ffox view source\n\nconst UI = require('solid-ui')\nconst $rdf = require('rdflib')\nconst ns = UI.ns\n\nmodule.exports = {\n icon: UI.icons.originalIconBase + 'rdf_flyer.24.gif',\n\n name: 'dataContents',\n\n audience: [ns.solid('Developer')],\n\n label: function (subject, context) {\n if (\n 'http://www.w3.org/2007/ont/link#ProtocolEvent' in\n context.session.store.findTypeURIs(subject)\n ) {\n return null\n }\n const n = context.session.store.statementsMatching(\n undefined,\n undefined,\n undefined,\n subject\n ).length\n if (n === 0) return null\n return 'Data (' + n + ')'\n },\n /*\n shouldGetFocus: function(subject) {\n return store.whether(subject, UI.ns.rdf('type'), UI.ns.link('RDFDocument'))\n },\n*/\n statementsAsTables: function statementsAsTables (sts, context, initialRoots) {\n const myDocument = context.dom\n // const outliner = context.getOutliner(myDocument)\n const rep = myDocument.createElement('table')\n const sz = UI.rdf.Serializer(context.session.store)\n const res = sz.rootSubjects(sts)\n let roots = res.roots\n const subjects = res.subjects\n const loopBreakers = res.loopBreakers\n for (const x in loopBreakers) {\n console.log('\\tdataContentPane: loopbreaker:' + x)\n }\n const doneBnodes = {} // For preventing looping\n const referencedBnodes = {} // Bnodes which need to be named alas\n\n // The property tree for a single subject or anonymous node\n function propertyTree (subject) {\n // print('Proprty tree for '+subject)\n const rep = myDocument.createElement('table')\n let lastPred = null\n const sts = subjects[sz.toStr(subject)] // relevant statements\n if (!sts) {\n // No statements in tree\n rep.appendChild(myDocument.createTextNode('...')) // just empty bnode as object\n return rep\n }\n sts.sort()\n let same = 0\n let predicateTD // The cell which holds the predicate\n for (let i = 0; i < sts.length; i++) {\n const st = sts[i]\n const tr = myDocument.createElement('tr')\n if (st.predicate.uri !== lastPred) {\n if (lastPred && same > 1) {\n predicateTD.setAttribute('rowspan', '' + same)\n }\n predicateTD = myDocument.createElement('td')\n predicateTD.setAttribute('class', 'pred')\n const anchor = myDocument.createElement('a')\n anchor.setAttribute('href', st.predicate.uri)\n anchor.addEventListener(\n 'click',\n UI.widgets.openHrefInOutlineMode,\n true\n )\n anchor.appendChild(\n myDocument.createTextNode(\n UI.utils.predicateLabelForXML(st.predicate)\n )\n )\n predicateTD.appendChild(anchor)\n tr.appendChild(predicateTD)\n lastPred = st.predicate.uri\n same = 0\n }\n same++\n const objectTD = myDocument.createElement('td')\n objectTD.appendChild(objectTree(st.object))\n tr.appendChild(objectTD)\n rep.appendChild(tr)\n }\n if (lastPred && same > 1) predicateTD.setAttribute('rowspan', '' + same)\n return rep\n }\n\n // Convert a set of statements into a nested tree of tables\n function objectTree (obj) {\n let res, anchor\n switch (obj.termType) {\n case 'NamedNode':\n anchor = myDocument.createElement('a')\n anchor.setAttribute('href', obj.uri)\n anchor.addEventListener(\n 'click',\n UI.widgets.openHrefInOutlineMode,\n true\n )\n anchor.appendChild(myDocument.createTextNode(UI.utils.label(obj)))\n return anchor\n\n case 'Literal':\n if (!obj.datatype || !obj.datatype.uri) {\n res = myDocument.createElement('div')\n res.setAttribute('style', 'white-space: pre-wrap;')\n res.textContent = obj.value\n return res\n } else if (\n obj.datatype.uri ===\n 'http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral'\n ) {\n res = myDocument.createElement('div')\n res.setAttribute('class', 'embeddedXHTML')\n res.innerHTML = obj.value // Try that @@@ beware embedded dangerous code\n return res\n }\n return myDocument.createTextNode(obj.value) // placeholder - could be smarter,\n\n case 'BlankNode': {\n if (obj.toNT() in doneBnodes) {\n // Break infinite recursion\n referencedBnodes[obj.toNT()] = true\n const anchor = myDocument.createElement('a')\n anchor.setAttribute('href', '#' + obj.toNT().slice(2))\n anchor.setAttribute('class', 'bnodeRef')\n anchor.textContent = '*' + obj.toNT().slice(3)\n return anchor\n }\n doneBnodes[obj.toNT()] = true // Flag to prevent infinite recursion in propertyTree\n const newTable = propertyTree(obj)\n doneBnodes[obj.toNT()] = newTable // Track where we mentioned it first\n if (\n UI.utils.ancestor(newTable, 'TABLE') &&\n UI.utils.ancestor(newTable, 'TABLE').style.backgroundColor ===\n 'white'\n ) {\n newTable.style.backgroundColor = '#eee'\n } else {\n newTable.style.backgroundColor = 'white'\n }\n return newTable\n }\n case 'Collection':\n res = myDocument.createElement('table')\n res.setAttribute('class', 'collectionAsTables')\n for (let i = 0; i < obj.elements.length; i++) {\n const tr = myDocument.createElement('tr')\n res.appendChild(tr)\n tr.appendChild(objectTree(obj.elements[i]))\n }\n return res\n case 'Graph':\n res = context.session.paneRegistry\n .byName('dataContents')\n .statementsAsTables(obj.statements, context)\n res.setAttribute('class', 'nestedFormula')\n return res\n case 'Variable':\n res = myDocument.createTextNode('?' + obj.uri)\n return res\n }\n throw new Error('Unhandled node type: ' + obj.termType)\n }\n\n // roots.sort()\n\n if (initialRoots) {\n roots = initialRoots.concat(\n roots.filter(function (x) {\n for (let i = 0; i < initialRoots.length; i++) {\n // Max 2\n if (x.sameTerm(initialRoots[i])) return false\n }\n return true\n })\n )\n }\n for (let i = 0; i < roots.length; i++) {\n const tr = myDocument.createElement('tr')\n rep.appendChild(tr)\n const subjectTD = myDocument.createElement('td')\n tr.appendChild(subjectTD)\n const TDTree = myDocument.createElement('td')\n tr.appendChild(TDTree)\n const root = roots[i]\n if (root.termType === 'BlankNode') {\n subjectTD.appendChild(myDocument.createTextNode(UI.utils.label(root))) // Don't recurse!\n } else {\n subjectTD.appendChild(objectTree(root)) // won't have tree\n }\n TDTree.appendChild(propertyTree(root))\n }\n for (const bNT in referencedBnodes) {\n // Add number to refer to\n const table = doneBnodes[bNT]\n // let tr = myDocument.createElement('tr')\n const anchor = myDocument.createElement('a')\n anchor.setAttribute('id', bNT.slice(2))\n anchor.setAttribute('class', 'bnodeDef')\n anchor.textContent = bNT.slice(3) + ')'\n table.insertBefore(anchor, table.firstChild)\n }\n return rep\n }, // statementsAsTables\n // View the data in a file in user-friendly way\n render: function (subject, context) {\n const myDocument = context.dom\n\n function alternativeRendering () {\n const sz = UI.rdf.Serializer(context.session.store)\n const res = sz.rootSubjects(sts)\n const roots = res.roots\n const p = {}\n p.render = function (s2) {\n const div = myDocument.createElement('div')\n div.setAttribute('class', 'withinDocumentPane')\n const plist = kb.statementsMatching(s2, undefined, undefined, subject)\n outliner.appendPropertyTRs(div, plist, false, function (\n _pred,\n _inverse\n ) {\n return true\n })\n return div\n }\n for (let i = 0; i < roots.length; i++) {\n const tr = myDocument.createElement('TR')\n const root = roots[i]\n tr.style.verticalAlign = 'top'\n const td = outliner.outlineObjectTD(root, undefined, tr)\n tr.appendChild(td)\n div.appendChild(tr)\n outliner.outlineExpand(td, root, { pane: p })\n }\n }\n\n function mainRendering () {\n const initialRoots = [] // Ordering: start with stuff about this doc\n if (kb.holds(subject, undefined, undefined, subject)) {\n initialRoots.push(subject)\n }\n // Then about the primary topic of the document if any\n const ps = kb.any(subject, UI.ns.foaf('primaryTopic'), undefined, subject)\n if (ps) initialRoots.push(ps)\n div.appendChild(\n context.session.paneRegistry\n .byName('dataContents')\n .statementsAsTables(sts, context, initialRoots)\n )\n }\n\n const outliner = context.getOutliner(myDocument)\n const kb = context.session.store\n const div = myDocument.createElement('div')\n div.setAttribute('class', 'dataContentPane')\n // Because of smushing etc, this will not be a copy of the original source\n // We could instead either fetch and re-parse the source,\n // or we could keep all the pre-smushed triples.\n const sts = kb.statementsMatching(undefined, undefined, undefined, subject) // @@ slow with current store!\n\n if ($rdf.keepThisCodeForLaterButDisableFerossConstantConditionPolice) {\n alternativeRendering()\n } else {\n mainRendering()\n }\n return div\n }\n}\n"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA,IAAMA,EAAE,GAAGC,OAAO,CAAC,UAAD,CAAlB;;AACA,IAAMC,IAAI,GAAGD,OAAO,CAAC,QAAD,CAApB;;AACA,IAAME,EAAE,GAAGH,EAAE,CAACG,EAAd;AAEAC,MAAM,CAACC,OAAP,GAAiB;EACfC,IAAI,EAAEN,EAAE,CAACO,KAAH,CAASC,gBAAT,GAA4B,kBADnB;EAGfC,IAAI,EAAE,cAHS;EAKfC,QAAQ,EAAE,CAACP,EAAE,CAACQ,KAAH,CAAS,WAAT,CAAD,CALK;EAOfC,KAAK,EAAE,eAAUC,OAAV,EAAmBC,OAAnB,EAA4B;IACjC,IACE,mDACAA,OAAO,CAACC,OAAR,CAAgBC,KAAhB,CAAsBC,YAAtB,CAAmCJ,OAAnC,CAFF,EAGE;MACA,OAAO,IAAP;IACD;;IACD,IAAMK,CAAC,GAAGJ,OAAO,CAACC,OAAR,CAAgBC,KAAhB,CAAsBG,k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AKD;;IAED,IAAM2E,QAAQ,GAAGrF,OAAO,CAACoG,WAAR,CAAoBzF,UAApB,CAAjB;IACA,IAAMyE,EAAE,GAAGpF,OAAO,CAACC,OAAR,CAAgBC,KAA3B;IACA,IAAMgF,GAAG,GAAGvE,UAAU,CAACG,aAAX,CAAyB,KAAzB,CAAZ;IACAoE,GAAG,CAACzC,YAAJ,CAAiB,OAAjB,EAA0B,iBAA1B,EAjDkC,CAkDlC;IACA;IACA;;IACA,IAAMhC,GAAG,GAAG2E,EAAE,CAAC/E,kBAAH,CAAsBC,SAAtB,EAAiCA,SAAjC,EAA4CA,SAA5C,EAAuDP,OAAvD,CAAZ,CArDkC,CAqD0C;;IAE5E,IAAIX,IAAI,CAACiH,2DAAT,EAAsE;MACpEtB,oBAAoB;IACrB,CAFD,MAEO;MACLe,aAAa;IACd;;IACD,OAAOZ,GAAP;EACD;AAjRc,CAAjB"}
|
|
1
|
+
{"version":3,"file":"dataContentPane.js","names":["ns","UI","dataContentPane","icon","icons","originalIconBase","name","audience","solid","label","subject","context","session","store","findTypeURIs","n","statementsMatching","undefined","length","statementsAsTables","sts","initialRoots","myDocument","dom","rep","createElement","sz","rdf","Serializer","res","rootSubjects","roots","subjects","loopBreakers","x","console","log","doneBnodes","referencedBnodes","propertyTree","lastPred","toStr","appendChild","createTextNode","sort","same","predicateTD","i","st","tr","predicate","uri","setAttribute","anchor","addEventListener","widgets","openHrefInOutlineMode","utils","predicateLabelForXML","objectTD","objectTree","object","obj","termType","datatype","textContent","value","innerHTML","toNT","slice","newTable","ancestor","style","backgroundColor","elements","paneRegistry","byName","statements","Error","concat","filter","sameTerm","subjectTD","TDTree","root","bNT","table","insertBefore","firstChild","render","alternativeRendering","p","s2","div","plist","kb","outliner","appendPropertyTRs","_pred","_inverse","verticalAlign","td","outlineObjectTD","outlineExpand","pane","mainRendering","holds","push","ps","any","foaf","getOutliner"],"sources":["../src/dataContentPane.js"],"sourcesContent":["/* Data content Pane\n **\n ** This pane shows the content of a particular RDF resource\n ** or at least the RDF semantics we attribute to that resource.\n */\n\n// To do: - Only take data from one graph\n// - Only do forwards not backward?\n// - Expand automatically all the way down\n// - original source view? Use ffox view source\n\nimport * as UI from 'solid-ui'\nconst ns = UI.ns\n\nexport const dataContentPane = {\n icon: UI.icons.originalIconBase + 'rdf_flyer.24.gif',\n\n name: 'dataContents',\n\n audience: [ns.solid('Developer')],\n\n label: function (subject, context) {\n if (\n 'http://www.w3.org/2007/ont/link#ProtocolEvent' in\n context.session.store.findTypeURIs(subject)\n ) {\n return null\n }\n const n = context.session.store.statementsMatching(\n undefined,\n undefined,\n undefined,\n subject\n ).length\n if (n === 0) return null\n return 'Data (' + n + ')'\n },\n /*\n shouldGetFocus: function(subject) {\n return store.whether(subject, UI.ns.rdf('type'), UI.ns.link('RDFDocument'))\n },\n*/\n statementsAsTables: function statementsAsTables (sts, context, initialRoots) {\n const myDocument = context.dom\n // const outliner = context.getOutliner(myDocument)\n const rep = myDocument.createElement('table')\n const sz = UI.rdf.Serializer(context.session.store)\n const res = sz.rootSubjects(sts)\n let roots = res.roots\n const subjects = res.subjects\n const loopBreakers = res.loopBreakers\n for (const x in loopBreakers) {\n console.log('\\tdataContentPane: loopbreaker:' + x)\n }\n const doneBnodes = {} // For preventing looping\n const referencedBnodes = {} // Bnodes which need to be named alas\n\n // The property tree for a single subject or anonymous node\n function propertyTree (subject) {\n // print('Proprty tree for '+subject)\n const rep = myDocument.createElement('table')\n let lastPred = null\n const sts = subjects[sz.toStr(subject)] // relevant statements\n if (!sts) {\n // No statements in tree\n rep.appendChild(myDocument.createTextNode('...')) // just empty bnode as object\n return rep\n }\n sts.sort()\n let same = 0\n let predicateTD // The cell which holds the predicate\n for (let i = 0; i < sts.length; i++) {\n const st = sts[i]\n const tr = myDocument.createElement('tr')\n if (st.predicate.uri !== lastPred) {\n if (lastPred && same > 1) {\n predicateTD.setAttribute('rowspan', '' + same)\n }\n predicateTD = myDocument.createElement('td')\n predicateTD.setAttribute('class', 'pred')\n const anchor = myDocument.createElement('a')\n anchor.setAttribute('href', st.predicate.uri)\n anchor.addEventListener(\n 'click',\n UI.widgets.openHrefInOutlineMode,\n true\n )\n anchor.appendChild(\n myDocument.createTextNode(\n UI.utils.predicateLabelForXML(st.predicate)\n )\n )\n predicateTD.appendChild(anchor)\n tr.appendChild(predicateTD)\n lastPred = st.predicate.uri\n same = 0\n }\n same++\n const objectTD = myDocument.createElement('td')\n objectTD.appendChild(objectTree(st.object))\n tr.appendChild(objectTD)\n rep.appendChild(tr)\n }\n if (lastPred && same > 1) predicateTD.setAttribute('rowspan', '' + same)\n return rep\n }\n\n // Convert a set of statements into a nested tree of tables\n function objectTree (obj) {\n let res, anchor\n switch (obj.termType) {\n case 'NamedNode':\n anchor = myDocument.createElement('a')\n anchor.setAttribute('href', obj.uri)\n anchor.addEventListener(\n 'click',\n UI.widgets.openHrefInOutlineMode,\n true\n )\n anchor.appendChild(myDocument.createTextNode(UI.utils.label(obj)))\n return anchor\n\n case 'Literal':\n if (!obj.datatype || !obj.datatype.uri) {\n res = myDocument.createElement('div')\n res.setAttribute('style', 'white-space: pre-wrap;')\n res.textContent = obj.value\n return res\n } else if (\n obj.datatype.uri ===\n 'http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral'\n ) {\n res = myDocument.createElement('div')\n res.setAttribute('class', 'embeddedXHTML')\n res.innerHTML = obj.value // Try that @@@ beware embedded dangerous code\n return res\n }\n return myDocument.createTextNode(obj.value) // placeholder - could be smarter,\n\n case 'BlankNode': {\n if (obj.toNT() in doneBnodes) {\n // Break infinite recursion\n referencedBnodes[obj.toNT()] = true\n const anchor = myDocument.createElement('a')\n anchor.setAttribute('href', '#' + obj.toNT().slice(2))\n anchor.setAttribute('class', 'bnodeRef')\n anchor.textContent = '*' + obj.toNT().slice(3)\n return anchor\n }\n doneBnodes[obj.toNT()] = true // Flag to prevent infinite recursion in propertyTree\n const newTable = propertyTree(obj)\n doneBnodes[obj.toNT()] = newTable // Track where we mentioned it first\n if (\n UI.utils.ancestor(newTable, 'TABLE') &&\n UI.utils.ancestor(newTable, 'TABLE').style.backgroundColor ===\n 'white'\n ) {\n newTable.style.backgroundColor = '#eee'\n } else {\n newTable.style.backgroundColor = 'white'\n }\n return newTable\n }\n case 'Collection':\n res = myDocument.createElement('table')\n res.setAttribute('class', 'collectionAsTables')\n for (let i = 0; i < obj.elements.length; i++) {\n const tr = myDocument.createElement('tr')\n res.appendChild(tr)\n tr.appendChild(objectTree(obj.elements[i]))\n }\n return res\n case 'Graph':\n res = context.session.paneRegistry\n .byName('dataContents')\n .statementsAsTables(obj.statements, context)\n res.setAttribute('class', 'nestedFormula')\n return res\n case 'Variable':\n res = myDocument.createTextNode('?' + obj.uri)\n return res\n }\n throw new Error('Unhandled node type: ' + obj.termType)\n }\n\n // roots.sort()\n\n if (initialRoots) {\n roots = initialRoots.concat(\n roots.filter(function (x) {\n for (let i = 0; i < initialRoots.length; i++) {\n // Max 2\n if (x.sameTerm(initialRoots[i])) return false\n }\n return true\n })\n )\n }\n for (let i = 0; i < roots.length; i++) {\n const tr = myDocument.createElement('tr')\n rep.appendChild(tr)\n const subjectTD = myDocument.createElement('td')\n tr.appendChild(subjectTD)\n const TDTree = myDocument.createElement('td')\n tr.appendChild(TDTree)\n const root = roots[i]\n if (root.termType === 'BlankNode') {\n subjectTD.appendChild(myDocument.createTextNode(UI.utils.label(root))) // Don't recurse!\n } else {\n subjectTD.appendChild(objectTree(root)) // won't have tree\n }\n TDTree.appendChild(propertyTree(root))\n }\n for (const bNT in referencedBnodes) {\n // Add number to refer to\n const table = doneBnodes[bNT]\n // let tr = myDocument.createElement('tr')\n const anchor = myDocument.createElement('a')\n anchor.setAttribute('id', bNT.slice(2))\n anchor.setAttribute('class', 'bnodeDef')\n anchor.textContent = bNT.slice(3) + ')'\n table.insertBefore(anchor, table.firstChild)\n }\n return rep\n }, // statementsAsTables\n // View the data in a file in user-friendly way\n render: function (subject, context) {\n const myDocument = context.dom\n\n function alternativeRendering () {\n const sz = UI.rdf.Serializer(context.session.store)\n const res = sz.rootSubjects(sts)\n const roots = res.roots\n const p = {}\n p.render = function (s2) {\n const div = myDocument.createElement('div')\n div.setAttribute('class', 'withinDocumentPane')\n const plist = kb.statementsMatching(s2, undefined, undefined, subject)\n outliner.appendPropertyTRs(div, plist, false, function (\n _pred,\n _inverse\n ) {\n return true\n })\n return div\n }\n for (let i = 0; i < roots.length; i++) {\n const tr = myDocument.createElement('TR')\n const root = roots[i]\n tr.style.verticalAlign = 'top'\n const td = outliner.outlineObjectTD(root, undefined, tr)\n tr.appendChild(td)\n div.appendChild(tr)\n outliner.outlineExpand(td, root, { pane: p })\n }\n }\n\n function mainRendering () {\n const initialRoots = [] // Ordering: start with stuff about this doc\n if (kb.holds(subject, undefined, undefined, subject)) {\n initialRoots.push(subject)\n }\n // Then about the primary topic of the document if any\n const ps = kb.any(subject, UI.ns.foaf('primaryTopic'), undefined, subject)\n if (ps) initialRoots.push(ps)\n div.appendChild(\n context.session.paneRegistry\n .byName('dataContents')\n .statementsAsTables(sts, context, initialRoots)\n )\n }\n\n const outliner = context.getOutliner(myDocument)\n const kb = context.session.store\n const div = myDocument.createElement('div')\n div.setAttribute('class', 'dataContentPane')\n // Because of smushing etc, this will not be a copy of the original source\n // We could instead either fetch and re-parse the source,\n // or we could keep all the pre-smushed triples.\n const sts = kb.statementsMatching(undefined, undefined, undefined, subject) // @@ slow with current store!\n\n if (false) { // keep code\n alternativeRendering()\n } else {\n mainRendering()\n }\n return div\n }\n}\n"],"mappings":";;;;;;;AAWA;AAA8B;AAAA;AAX9B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAGA,IAAMA,EAAE,GAAGC,EAAE,CAACD,EAAE;AAET,IAAME,eAAe,GAAG;EAC7BC,IAAI,EAAEF,EAAE,CAACG,KAAK,CAACC,gBAAgB,GAAG,kBAAkB;EAEpDC,IAAI,EAAE,cAAc;EAEpBC,QAAQ,EAAE,CAACP,EAAE,CAACQ,KA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