solid-ui 2.4.12-3bba27e0 → 2.4.12-47411c33
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/lib/footer/index.d.ts +20 -0
- package/lib/footer/index.d.ts.map +1 -0
- package/lib/footer/index.js +147 -0
- package/lib/footer/index.js.map +1 -0
- package/lib/footer/styleMap.d.ts +8 -0
- package/lib/footer/styleMap.d.ts.map +1 -0
- package/lib/footer/styleMap.js +15 -0
- package/lib/footer/styleMap.js.map +1 -0
- package/lib/header/index.d.ts +11 -8
- package/lib/header/index.d.ts.map +1 -1
- package/lib/header/index.js +78 -66
- package/lib/header/index.js.map +1 -1
- package/lib/header/styleMap.d.ts +0 -2
- package/lib/header/styleMap.d.ts.map +1 -1
- package/lib/header/styleMap.js +1 -5
- package/lib/header/styleMap.js.map +1 -1
- package/lib/index.d.ts +2 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +10 -1
- package/lib/index.js.map +1 -1
- package/lib/style.js +3 -3
- package/lib/style.js.map +1 -1
- package/lib/{header/headerHelpers.d.ts → utils/headerFooterHelpers.d.ts} +11 -3
- package/lib/utils/headerFooterHelpers.d.ts.map +1 -0
- package/lib/utils/headerFooterHelpers.js +189 -0
- package/lib/utils/headerFooterHelpers.js.map +1 -0
- package/lib/versionInfo.js +5 -5
- package/lib/versionInfo.js.map +1 -1
- package/lib/webpack-bundle.js +473 -190
- package/lib/webpack-bundle.js.map +1 -1
- package/lib/widgets/forms/basic.d.ts.map +1 -1
- package/lib/widgets/forms/basic.js +9 -20
- package/lib/widgets/forms/basic.js.map +1 -1
- package/lib/widgets/forms/fieldParams.d.ts.map +1 -1
- package/lib/widgets/forms/fieldParams.js +5 -3
- package/lib/widgets/forms/fieldParams.js.map +1 -1
- package/lib/widgets/forms.js +6 -8
- package/lib/widgets/forms.js.map +1 -1
- package/package.json +1 -1
- package/lib/header/headerHelpers.d.ts.map +0 -1
- package/lib/header/headerHelpers.js +0 -96
- package/lib/header/headerHelpers.js.map +0 -1
package/lib/webpack-bundle.js
CHANGED
|
@@ -8465,30 +8465,10 @@ function trace() {
|
|
|
8465
8465
|
|
|
8466
8466
|
/***/ }),
|
|
8467
8467
|
|
|
8468
|
-
/***/ "./lib/
|
|
8469
|
-
|
|
8470
|
-
!*** ./lib/
|
|
8471
|
-
|
|
8472
|
-
/*! no static exports found */
|
|
8473
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
8474
|
-
|
|
8475
|
-
"use strict";
|
|
8476
|
-
|
|
8477
|
-
|
|
8478
|
-
Object.defineProperty(exports, "__esModule", {
|
|
8479
|
-
value: true
|
|
8480
|
-
});
|
|
8481
|
-
exports.emptyProfile = void 0;
|
|
8482
|
-
var emptyProfile = "\n<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"26\" height=\"26\" viewBox=\"0 0 26 26\" fill=\"none\">\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M13 25C19.6274 25 25 19.6274 25 13C25 6.37258 19.6274 1 13 1C6.37258 1 1 6.37258 1 13C1 19.6274 6.37258 25 13 25Z\" fill=\"#D8D8D8\" stroke=\"#8B8B8B\"/>\n <mask id=\"mask0\" mask-type=\"alpha\" maskUnits=\"userSpaceOnUse\" x=\"0\" y=\"0\" width=\"26\" height=\"26\">\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M13 25C19.6274 25 25 19.6274 25 13C25 6.37258 19.6274 1 13 1C6.37258 1 1 6.37258 1 13C1 19.6274 6.37258 25 13 25Z\" fill=\"white\" stroke=\"white\"/>\n </mask>\n <g mask=\"url(#mask0)\">\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M17.0468 10.4586C17.0468 14.4979 15.4281 16.9214 12.9999 16.9214C10.5718 16.9214 8.95298 14.4979 8.95298 10.4586C8.95298 6.41931 12.9999 6.41931 12.9999 6.41931C12.9999 6.41931 17.0468 6.41931 17.0468 10.4586ZM4.09668 23.3842C6.52483 17.7293 12.9999 17.7293 12.9999 17.7293C12.9999 17.7293 19.475 17.7293 21.9031 23.3842C21.9031 23.3842 17.8481 25 12.9999 25C8.15169 25 4.09668 23.3842 4.09668 23.3842Z\" fill=\"#8B8B8B\"/>\n </g>\n</svg>";
|
|
8483
|
-
exports.emptyProfile = emptyProfile;
|
|
8484
|
-
//# sourceMappingURL=empty-profile.js.map
|
|
8485
|
-
|
|
8486
|
-
/***/ }),
|
|
8487
|
-
|
|
8488
|
-
/***/ "./lib/header/headerHelpers.js":
|
|
8489
|
-
/*!*************************************!*\
|
|
8490
|
-
!*** ./lib/header/headerHelpers.js ***!
|
|
8491
|
-
\*************************************/
|
|
8468
|
+
/***/ "./lib/footer/index.js":
|
|
8469
|
+
/*!*****************************!*\
|
|
8470
|
+
!*** ./lib/footer/index.js ***!
|
|
8471
|
+
\*****************************/
|
|
8492
8472
|
/*! no static exports found */
|
|
8493
8473
|
/***/ (function(module, exports, __webpack_require__) {
|
|
8494
8474
|
|
|
@@ -8500,95 +8480,192 @@ var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/inte
|
|
|
8500
8480
|
Object.defineProperty(exports, "__esModule", {
|
|
8501
8481
|
value: true
|
|
8502
8482
|
});
|
|
8503
|
-
exports.
|
|
8504
|
-
exports.
|
|
8505
|
-
exports.
|
|
8483
|
+
exports.createControllerInfoBlock = createControllerInfoBlock;
|
|
8484
|
+
exports.initFooter = initFooter;
|
|
8485
|
+
exports.rebuildFooter = rebuildFooter;
|
|
8506
8486
|
|
|
8507
|
-
var
|
|
8487
|
+
var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ "./node_modules/@babel/runtime/regenerator/index.js"));
|
|
8508
8488
|
|
|
8509
|
-
var
|
|
8489
|
+
var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "./node_modules/@babel/runtime/helpers/asyncToGenerator.js"));
|
|
8510
8490
|
|
|
8511
|
-
var
|
|
8491
|
+
var _authn = __webpack_require__(/*! ../authn/authn */ "./lib/authn/authn.js");
|
|
8512
8492
|
|
|
8513
|
-
var
|
|
8493
|
+
var _headerFooterHelpers = __webpack_require__(/*! ../utils/headerFooterHelpers */ "./lib/utils/headerFooterHelpers.js");
|
|
8514
8494
|
|
|
8515
8495
|
/*
|
|
8516
|
-
|
|
8496
|
+
This file was copied from mashlib/src/global/footer.ts file. It is modified to
|
|
8497
|
+
work in solid-ui by adjusting where imported functions are found.
|
|
8517
8498
|
*/
|
|
8499
|
+
var DEFAULT_SOLID_PROJECT_URL = 'https://solidproject.org';
|
|
8500
|
+
var DEFAULT_SOLID_PROJECT_NAME = 'solidproject.org';
|
|
8501
|
+
/*
|
|
8502
|
+
FooterOptions allow for customizing the link and name of the link part of the footer.
|
|
8503
|
+
*/
|
|
8518
8504
|
|
|
8519
8505
|
/**
|
|
8520
|
-
*
|
|
8506
|
+
* Initialize footer component, the footer object returned depends on whether the user is authenticated.
|
|
8507
|
+
* @param store the data store
|
|
8508
|
+
* @returns the footer
|
|
8521
8509
|
*/
|
|
8522
|
-
function
|
|
8523
|
-
return
|
|
8510
|
+
function initFooter(_x, _x2) {
|
|
8511
|
+
return _initFooter.apply(this, arguments);
|
|
8524
8512
|
}
|
|
8525
8513
|
/**
|
|
8526
8514
|
* @ignore exporting this only for the unit test
|
|
8527
8515
|
*/
|
|
8528
8516
|
|
|
8529
8517
|
|
|
8530
|
-
function
|
|
8531
|
-
|
|
8532
|
-
var
|
|
8518
|
+
function _initFooter() {
|
|
8519
|
+
_initFooter = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(store, options) {
|
|
8520
|
+
var footer, pod, podOwner;
|
|
8521
|
+
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
8522
|
+
while (1) {
|
|
8523
|
+
switch (_context2.prev = _context2.next) {
|
|
8524
|
+
case 0:
|
|
8525
|
+
footer = document.getElementById('PageFooter');
|
|
8533
8526
|
|
|
8534
|
-
|
|
8535
|
-
|
|
8527
|
+
if (footer) {
|
|
8528
|
+
_context2.next = 3;
|
|
8529
|
+
break;
|
|
8530
|
+
}
|
|
8536
8531
|
|
|
8537
|
-
|
|
8538
|
-
|
|
8532
|
+
return _context2.abrupt("return");
|
|
8533
|
+
|
|
8534
|
+
case 3:
|
|
8535
|
+
pod = (0, _headerFooterHelpers.getPod)();
|
|
8536
|
+
_context2.next = 6;
|
|
8537
|
+
return (0, _headerFooterHelpers.getPodOwner)(pod, store);
|
|
8538
|
+
|
|
8539
|
+
case 6:
|
|
8540
|
+
podOwner = _context2.sent;
|
|
8541
|
+
rebuildFooter(footer, store, pod, podOwner, options)();
|
|
8542
|
+
|
|
8543
|
+
_authn.authSession.onLogin(rebuildFooter(footer, store, pod, podOwner, options));
|
|
8544
|
+
|
|
8545
|
+
_authn.authSession.onLogout(rebuildFooter(footer, store, pod, podOwner, options));
|
|
8546
|
+
|
|
8547
|
+
case 10:
|
|
8548
|
+
case "end":
|
|
8549
|
+
return _context2.stop();
|
|
8550
|
+
}
|
|
8551
|
+
}
|
|
8552
|
+
}, _callee2);
|
|
8553
|
+
}));
|
|
8554
|
+
return _initFooter.apply(this, arguments);
|
|
8539
8555
|
}
|
|
8540
|
-
/**
|
|
8541
|
-
* @ignore exporting this only for the unit test
|
|
8542
|
-
*/
|
|
8543
8556
|
|
|
8557
|
+
function rebuildFooter(footer, store, pod, podOwner, options) {
|
|
8558
|
+
return /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
|
8559
|
+
var user;
|
|
8560
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
8561
|
+
while (1) {
|
|
8562
|
+
switch (_context.prev = _context.next) {
|
|
8563
|
+
case 0:
|
|
8564
|
+
user = (0, _authn.currentUser)();
|
|
8565
|
+
footer.innerHTML = '';
|
|
8566
|
+
_context.t0 = footer;
|
|
8567
|
+
_context.next = 5;
|
|
8568
|
+
return createControllerInfoBlock(store, user, pod, podOwner, options);
|
|
8569
|
+
|
|
8570
|
+
case 5:
|
|
8571
|
+
_context.t1 = _context.sent;
|
|
8544
8572
|
|
|
8545
|
-
|
|
8546
|
-
|
|
8547
|
-
|
|
8573
|
+
_context.t0.appendChild.call(_context.t0, _context.t1);
|
|
8574
|
+
|
|
8575
|
+
case 7:
|
|
8576
|
+
case "end":
|
|
8577
|
+
return _context.stop();
|
|
8578
|
+
}
|
|
8579
|
+
}
|
|
8580
|
+
}, _callee);
|
|
8581
|
+
}));
|
|
8548
8582
|
}
|
|
8549
8583
|
/**
|
|
8550
8584
|
* @ignore exporting this only for the unit test
|
|
8551
8585
|
*/
|
|
8552
8586
|
|
|
8553
8587
|
|
|
8554
|
-
function
|
|
8555
|
-
var
|
|
8556
|
-
|
|
8557
|
-
|
|
8558
|
-
|
|
8588
|
+
function createControllerInfoBlock(store, user, pod, podOwner, options) {
|
|
8589
|
+
var profileLinkContainer = document.createElement('div');
|
|
8590
|
+
|
|
8591
|
+
if (!pod || !podOwner || user && user.equals(podOwner)) {
|
|
8592
|
+
return profileLinkContainer;
|
|
8593
|
+
}
|
|
8594
|
+
|
|
8595
|
+
(0, _headerFooterHelpers.addStyleClassToElement)(profileLinkContainer, ['footer-pod-info', 'footer'], 'footer');
|
|
8596
|
+
var podLinkPre = document.createElement('span');
|
|
8597
|
+
podLinkPre.innerText = "You're visiting ";
|
|
8598
|
+
var podLink = document.createElement('a');
|
|
8599
|
+
podLink.href = pod.uri;
|
|
8600
|
+
podLink.innerText = 'the Pod';
|
|
8601
|
+
var profileLinkPre = document.createElement('span');
|
|
8602
|
+
profileLinkPre.innerText = ' controlled by ';
|
|
8603
|
+
var profileLink = document.createElement('a');
|
|
8604
|
+
profileLink.href = podOwner.uri;
|
|
8605
|
+
profileLink.innerText = (0, _headerFooterHelpers.getName)(store, podOwner);
|
|
8606
|
+
var solidProjectLinkPre = document.createElement('span');
|
|
8607
|
+
solidProjectLinkPre.innerText = '. For more info, check out ';
|
|
8608
|
+
var solidProjectLink = document.createElement('a');
|
|
8609
|
+
solidProjectLink.href = options && options.solidProjectUrl ? options.solidProjectUrl : DEFAULT_SOLID_PROJECT_URL;
|
|
8610
|
+
solidProjectLink.innerText = options && options.solidProjectName ? options.solidProjectName : DEFAULT_SOLID_PROJECT_NAME;
|
|
8611
|
+
var solidProjectLinkPost = document.createElement('span');
|
|
8612
|
+
solidProjectLinkPost.innerText = '.';
|
|
8613
|
+
profileLinkContainer.appendChild(podLinkPre);
|
|
8614
|
+
profileLinkContainer.appendChild(podLink);
|
|
8615
|
+
profileLinkContainer.appendChild(profileLinkPre);
|
|
8616
|
+
profileLinkContainer.appendChild(profileLink);
|
|
8617
|
+
profileLinkContainer.appendChild(solidProjectLinkPre);
|
|
8618
|
+
profileLinkContainer.appendChild(solidProjectLink);
|
|
8619
|
+
profileLinkContainer.appendChild(solidProjectLinkPost);
|
|
8620
|
+
return profileLinkContainer;
|
|
8621
|
+
}
|
|
8622
|
+
//# sourceMappingURL=index.js.map
|
|
8559
8623
|
|
|
8560
|
-
|
|
8561
|
-
previous = !options.leading ? 0 : Date.now();
|
|
8562
|
-
timeout = null;
|
|
8563
|
-
result = func.apply(context, args);
|
|
8564
|
-
if (!timeout) context = args = null;
|
|
8565
|
-
};
|
|
8624
|
+
/***/ }),
|
|
8566
8625
|
|
|
8567
|
-
|
|
8568
|
-
|
|
8569
|
-
|
|
8570
|
-
|
|
8626
|
+
/***/ "./lib/footer/styleMap.js":
|
|
8627
|
+
/*!********************************!*\
|
|
8628
|
+
!*** ./lib/footer/styleMap.js ***!
|
|
8629
|
+
\********************************/
|
|
8630
|
+
/*! no static exports found */
|
|
8631
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
8571
8632
|
|
|
8572
|
-
|
|
8573
|
-
args = arguments;
|
|
8633
|
+
"use strict";
|
|
8574
8634
|
|
|
8575
|
-
if (remaining <= 0 || remaining > wait) {
|
|
8576
|
-
if (timeout) {
|
|
8577
|
-
clearTimeout(timeout);
|
|
8578
|
-
timeout = null;
|
|
8579
|
-
}
|
|
8580
8635
|
|
|
8581
|
-
|
|
8582
|
-
|
|
8583
|
-
|
|
8584
|
-
|
|
8585
|
-
|
|
8586
|
-
|
|
8636
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8637
|
+
value: true
|
|
8638
|
+
});
|
|
8639
|
+
exports.styleMap = void 0;
|
|
8640
|
+
var styleMap = {
|
|
8641
|
+
footer: {
|
|
8642
|
+
borderTop: 'solid 1px $divider-color',
|
|
8643
|
+
fontSize: '0.9em',
|
|
8644
|
+
padding: '0.5em 1.5em'
|
|
8645
|
+
}
|
|
8646
|
+
};
|
|
8647
|
+
exports.styleMap = styleMap;
|
|
8648
|
+
//# sourceMappingURL=styleMap.js.map
|
|
8587
8649
|
|
|
8588
|
-
|
|
8589
|
-
|
|
8590
|
-
|
|
8591
|
-
|
|
8650
|
+
/***/ }),
|
|
8651
|
+
|
|
8652
|
+
/***/ "./lib/header/empty-profile.js":
|
|
8653
|
+
/*!*************************************!*\
|
|
8654
|
+
!*** ./lib/header/empty-profile.js ***!
|
|
8655
|
+
\*************************************/
|
|
8656
|
+
/*! no static exports found */
|
|
8657
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
8658
|
+
|
|
8659
|
+
"use strict";
|
|
8660
|
+
|
|
8661
|
+
|
|
8662
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8663
|
+
value: true
|
|
8664
|
+
});
|
|
8665
|
+
exports.emptyProfile = void 0;
|
|
8666
|
+
var emptyProfile = "\n<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"26\" height=\"26\" viewBox=\"0 0 26 26\" fill=\"none\">\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M13 25C19.6274 25 25 19.6274 25 13C25 6.37258 19.6274 1 13 1C6.37258 1 1 6.37258 1 13C1 19.6274 6.37258 25 13 25Z\" fill=\"#D8D8D8\" stroke=\"#8B8B8B\"/>\n <mask id=\"mask0\" mask-type=\"alpha\" maskUnits=\"userSpaceOnUse\" x=\"0\" y=\"0\" width=\"26\" height=\"26\">\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M13 25C19.6274 25 25 19.6274 25 13C25 6.37258 19.6274 1 13 1C6.37258 1 1 6.37258 1 13C1 19.6274 6.37258 25 13 25Z\" fill=\"white\" stroke=\"white\"/>\n </mask>\n <g mask=\"url(#mask0)\">\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M17.0468 10.4586C17.0468 14.4979 15.4281 16.9214 12.9999 16.9214C10.5718 16.9214 8.95298 14.4979 8.95298 10.4586C8.95298 6.41931 12.9999 6.41931 12.9999 6.41931C12.9999 6.41931 17.0468 6.41931 17.0468 10.4586ZM4.09668 23.3842C6.52483 17.7293 12.9999 17.7293 12.9999 17.7293C12.9999 17.7293 19.475 17.7293 21.9031 23.3842C21.9031 23.3842 17.8481 25 12.9999 25C8.15169 25 4.09668 23.3842 4.09668 23.3842Z\" fill=\"#8B8B8B\"/>\n </g>\n</svg>";
|
|
8667
|
+
exports.emptyProfile = emptyProfile;
|
|
8668
|
+
//# sourceMappingURL=empty-profile.js.map
|
|
8592
8669
|
|
|
8593
8670
|
/***/ }),
|
|
8594
8671
|
|
|
@@ -8624,7 +8701,7 @@ var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime
|
|
|
8624
8701
|
|
|
8625
8702
|
var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "./node_modules/@babel/runtime/helpers/asyncToGenerator.js"));
|
|
8626
8703
|
|
|
8627
|
-
var
|
|
8704
|
+
var _iconBase = __webpack_require__(/*! ../iconBase */ "./lib/iconBase.js");
|
|
8628
8705
|
|
|
8629
8706
|
var _authn = __webpack_require__(/*! ../authn/authn */ "./lib/authn/authn.js");
|
|
8630
8707
|
|
|
@@ -8632,7 +8709,7 @@ var widgets = _interopRequireWildcard(__webpack_require__(/*! ../widgets */ "./l
|
|
|
8632
8709
|
|
|
8633
8710
|
var _emptyProfile = __webpack_require__(/*! ./empty-profile */ "./lib/header/empty-profile.js");
|
|
8634
8711
|
|
|
8635
|
-
var
|
|
8712
|
+
var _headerFooterHelpers = __webpack_require__(/*! ../utils/headerFooterHelpers */ "./lib/utils/headerFooterHelpers.js");
|
|
8636
8713
|
|
|
8637
8714
|
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); }
|
|
8638
8715
|
|
|
@@ -8645,13 +8722,20 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
8645
8722
|
work in solid-ui by adjusting where imported functions are found.
|
|
8646
8723
|
*/
|
|
8647
8724
|
|
|
8725
|
+
/**
|
|
8726
|
+
* menu icons
|
|
8727
|
+
*/
|
|
8728
|
+
var DEFAULT_HELP_MENU_ICON = _iconBase.icons.iconBase + 'noun_help.svg';
|
|
8729
|
+
var DEFAUL_SOLID_ICON_URL = 'https://solidproject.org/assets/img/solid-emblem.svg';
|
|
8730
|
+
|
|
8648
8731
|
/**
|
|
8649
8732
|
* Initialize header component, the header object returned depends on whether the user is authenticated.
|
|
8650
8733
|
* @param store the data store
|
|
8651
|
-
* @param
|
|
8734
|
+
* @param userMenuList a list of menu items when the user is logged in
|
|
8735
|
+
* @param options allow the header to be customized with a personalized logo, help icon and a help menu list of links or buttons.
|
|
8652
8736
|
* @returns a header for an authenticated user with menu items given or a login screen
|
|
8653
8737
|
*/
|
|
8654
|
-
function initHeader(_x, _x2) {
|
|
8738
|
+
function initHeader(_x, _x2, _x3) {
|
|
8655
8739
|
return _initHeader.apply(this, arguments);
|
|
8656
8740
|
}
|
|
8657
8741
|
/**
|
|
@@ -8660,7 +8744,7 @@ function initHeader(_x, _x2) {
|
|
|
8660
8744
|
|
|
8661
8745
|
|
|
8662
8746
|
function _initHeader() {
|
|
8663
|
-
_initHeader = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(store, options) {
|
|
8747
|
+
_initHeader = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(store, userMenuList, options) {
|
|
8664
8748
|
var header, pod;
|
|
8665
8749
|
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
8666
8750
|
while (1) {
|
|
@@ -8676,12 +8760,12 @@ function _initHeader() {
|
|
|
8676
8760
|
return _context2.abrupt("return");
|
|
8677
8761
|
|
|
8678
8762
|
case 3:
|
|
8679
|
-
pod = (0,
|
|
8680
|
-
rebuildHeader(header, store, pod, options)();
|
|
8763
|
+
pod = (0, _headerFooterHelpers.getPod)();
|
|
8764
|
+
rebuildHeader(header, store, pod, userMenuList, options)();
|
|
8681
8765
|
|
|
8682
|
-
_authn.authSession.onLogout(rebuildHeader(header, store, pod, options));
|
|
8766
|
+
_authn.authSession.onLogout(rebuildHeader(header, store, pod, userMenuList, options));
|
|
8683
8767
|
|
|
8684
|
-
_authn.authSession.onLogin(rebuildHeader(header, store, pod, options));
|
|
8768
|
+
_authn.authSession.onLogin(rebuildHeader(header, store, pod, userMenuList, options));
|
|
8685
8769
|
|
|
8686
8770
|
case 7:
|
|
8687
8771
|
case "end":
|
|
@@ -8693,7 +8777,7 @@ function _initHeader() {
|
|
|
8693
8777
|
return _initHeader.apply(this, arguments);
|
|
8694
8778
|
}
|
|
8695
8779
|
|
|
8696
|
-
function rebuildHeader(header, store, pod, options) {
|
|
8780
|
+
function rebuildHeader(header, store, pod, userMenuList, options) {
|
|
8697
8781
|
return /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
|
8698
8782
|
var user;
|
|
8699
8783
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
@@ -8704,7 +8788,7 @@ function rebuildHeader(header, store, pod, options) {
|
|
|
8704
8788
|
header.innerHTML = '';
|
|
8705
8789
|
_context.t0 = header;
|
|
8706
8790
|
_context.next = 5;
|
|
8707
|
-
return createBanner(store, pod, user, options);
|
|
8791
|
+
return createBanner(store, pod, user, userMenuList, options);
|
|
8708
8792
|
|
|
8709
8793
|
case 5:
|
|
8710
8794
|
_context.t1 = _context.sent;
|
|
@@ -8724,7 +8808,7 @@ function rebuildHeader(header, store, pod, options) {
|
|
|
8724
8808
|
*/
|
|
8725
8809
|
|
|
8726
8810
|
|
|
8727
|
-
function createBanner(
|
|
8811
|
+
function createBanner(_x4, _x5, _x6, _x7, _x8) {
|
|
8728
8812
|
return _createBanner.apply(this, arguments);
|
|
8729
8813
|
}
|
|
8730
8814
|
/**
|
|
@@ -8733,22 +8817,22 @@ function createBanner(_x3, _x4, _x5, _x6) {
|
|
|
8733
8817
|
|
|
8734
8818
|
|
|
8735
8819
|
function _createBanner() {
|
|
8736
|
-
_createBanner = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(store, pod, user, options) {
|
|
8737
|
-
var podLink, image, userMenu,
|
|
8820
|
+
_createBanner = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(store, pod, user, userMenuList, options) {
|
|
8821
|
+
var podLink, image, userMenu, banner, leftSideOfHeader, helpMenu;
|
|
8738
8822
|
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
|
8739
8823
|
while (1) {
|
|
8740
8824
|
switch (_context3.prev = _context3.next) {
|
|
8741
8825
|
case 0:
|
|
8742
8826
|
podLink = document.createElement('a');
|
|
8743
8827
|
podLink.href = pod.uri;
|
|
8744
|
-
(0,
|
|
8828
|
+
(0, _headerFooterHelpers.addStyleClassToElement)(podLink, ['header-banner__link']);
|
|
8745
8829
|
image = document.createElement('img');
|
|
8746
8830
|
|
|
8747
8831
|
if (options) {
|
|
8748
|
-
image.src = options.logo ? options.logo :
|
|
8832
|
+
image.src = options.logo ? options.logo : DEFAUL_SOLID_ICON_URL;
|
|
8749
8833
|
}
|
|
8750
8834
|
|
|
8751
|
-
(0,
|
|
8835
|
+
(0, _headerFooterHelpers.addStyleClassToElement)(image, ['header-banner__icon']);
|
|
8752
8836
|
podLink.appendChild(image);
|
|
8753
8837
|
|
|
8754
8838
|
if (!user) {
|
|
@@ -8757,7 +8841,7 @@ function _createBanner() {
|
|
|
8757
8841
|
}
|
|
8758
8842
|
|
|
8759
8843
|
_context3.next = 10;
|
|
8760
|
-
return createUserMenu(store, user,
|
|
8844
|
+
return createUserMenu(store, user, userMenuList);
|
|
8761
8845
|
|
|
8762
8846
|
case 10:
|
|
8763
8847
|
_context3.t0 = _context3.sent;
|
|
@@ -8769,18 +8853,22 @@ function _createBanner() {
|
|
|
8769
8853
|
|
|
8770
8854
|
case 14:
|
|
8771
8855
|
userMenu = _context3.t0;
|
|
8772
|
-
helpMenu = createHelpMenu();
|
|
8773
8856
|
banner = document.createElement('div');
|
|
8774
|
-
(0,
|
|
8857
|
+
(0, _headerFooterHelpers.addStyleClassToElement)(banner, ['header-banner']);
|
|
8775
8858
|
banner.appendChild(podLink);
|
|
8776
8859
|
leftSideOfHeader = document.createElement('div');
|
|
8777
|
-
(0,
|
|
8860
|
+
(0, _headerFooterHelpers.addStyleClassToElement)(leftSideOfHeader, ['header-banner__right-menu']);
|
|
8778
8861
|
leftSideOfHeader.appendChild(userMenu);
|
|
8779
|
-
|
|
8862
|
+
|
|
8863
|
+
if (options && options.helpMenuList) {
|
|
8864
|
+
helpMenu = createHelpMenu(options, options.helpMenuList);
|
|
8865
|
+
leftSideOfHeader.appendChild(helpMenu);
|
|
8866
|
+
}
|
|
8867
|
+
|
|
8780
8868
|
banner.appendChild(leftSideOfHeader);
|
|
8781
8869
|
return _context3.abrupt("return", banner);
|
|
8782
8870
|
|
|
8783
|
-
case
|
|
8871
|
+
case 24:
|
|
8784
8872
|
case "end":
|
|
8785
8873
|
return _context3.stop();
|
|
8786
8874
|
}
|
|
@@ -8790,29 +8878,36 @@ function _createBanner() {
|
|
|
8790
8878
|
return _createBanner.apply(this, arguments);
|
|
8791
8879
|
}
|
|
8792
8880
|
|
|
8793
|
-
function createHelpMenu() {
|
|
8881
|
+
function createHelpMenu(options, helpMenuItems) {
|
|
8882
|
+
if (!helpMenuItems) return;
|
|
8794
8883
|
var helpMenuList = document.createElement('ul');
|
|
8795
|
-
(0,
|
|
8796
|
-
|
|
8797
|
-
|
|
8884
|
+
(0, _headerFooterHelpers.addStyleClassToElement)(helpMenuList, ['header-user-menu__list']);
|
|
8885
|
+
helpMenuItems.forEach(function (menuItem) {
|
|
8886
|
+
var menuItemType = menuItem.url ? 'url' : 'onclick';
|
|
8887
|
+
|
|
8888
|
+
if (menuItemType === 'url') {
|
|
8889
|
+
helpMenuList.appendChild(createUserMenuItem(createUserMenuLink(menuItem.label, menuItem.url, menuItem.target)));
|
|
8890
|
+
} else {
|
|
8891
|
+
helpMenuList.appendChild(createUserMenuItem(createUserMenuButton(menuItem.label, menuItem.onclick)));
|
|
8892
|
+
}
|
|
8893
|
+
});
|
|
8798
8894
|
var helpMenu = document.createElement('nav');
|
|
8799
|
-
(0,
|
|
8895
|
+
(0, _headerFooterHelpers.addStyleClassToElement)(helpMenu, ['header-user-menu__navigation-menu']);
|
|
8800
8896
|
helpMenu.setAttribute('aria-hidden', 'true');
|
|
8801
8897
|
helpMenu.appendChild(helpMenuList);
|
|
8802
|
-
var helpIcon = _.icons.iconBase + 'noun_144.svg';
|
|
8803
8898
|
var helpMenuContainer = document.createElement('div');
|
|
8804
|
-
(0,
|
|
8805
|
-
(0,
|
|
8899
|
+
(0, _headerFooterHelpers.addStyleClassToElement)(helpMenuContainer, ['header-banner__user-menu']);
|
|
8900
|
+
(0, _headerFooterHelpers.addStyleClassToElement)(helpMenuContainer, ['header-user-menu']);
|
|
8806
8901
|
helpMenuContainer.appendChild(helpMenu);
|
|
8807
8902
|
var helpMenuTrigger = document.createElement('button');
|
|
8808
|
-
(0,
|
|
8903
|
+
(0, _headerFooterHelpers.addStyleClassToElement)(helpMenuTrigger, ['header-user-menu__trigger']);
|
|
8809
8904
|
helpMenuTrigger.type = 'button';
|
|
8810
8905
|
var helpMenuIcon = document.createElement('img');
|
|
8811
|
-
helpMenuIcon.src = helpIcon;
|
|
8812
|
-
(0,
|
|
8906
|
+
helpMenuIcon.src = options && options.helpIcon ? options.helpIcon : _iconBase.icons.iconBase + DEFAULT_HELP_MENU_ICON;
|
|
8907
|
+
(0, _headerFooterHelpers.addStyleClassToElement)(helpMenuIcon, ['header-banner__help-icon']);
|
|
8813
8908
|
helpMenuContainer.appendChild(helpMenuTrigger);
|
|
8814
8909
|
helpMenuTrigger.appendChild(helpMenuIcon);
|
|
8815
|
-
var throttledMenuToggle = (0,
|
|
8910
|
+
var throttledMenuToggle = (0, _headerFooterHelpers.throttle)(function (event) {
|
|
8816
8911
|
return toggleMenu(event, helpMenuTrigger, helpMenu);
|
|
8817
8912
|
}, 50);
|
|
8818
8913
|
helpMenuTrigger.addEventListener('click', throttledMenuToggle);
|
|
@@ -8837,7 +8932,7 @@ function createHelpMenu() {
|
|
|
8837
8932
|
|
|
8838
8933
|
function createLoginSignUpButtons() {
|
|
8839
8934
|
var profileLoginButtonPre = document.createElement('div');
|
|
8840
|
-
(0,
|
|
8935
|
+
(0, _headerFooterHelpers.addStyleClassToElement)(profileLoginButtonPre, ['header-banner__login']);
|
|
8841
8936
|
profileLoginButtonPre.appendChild((0, _authn.loginStatusBox)(document, null, {}));
|
|
8842
8937
|
return profileLoginButtonPre;
|
|
8843
8938
|
}
|
|
@@ -8848,7 +8943,7 @@ function createLoginSignUpButtons() {
|
|
|
8848
8943
|
|
|
8849
8944
|
function createUserMenuButton(label, onClick) {
|
|
8850
8945
|
var button = document.createElement('button');
|
|
8851
|
-
(0,
|
|
8946
|
+
(0, _headerFooterHelpers.addStyleClassToElement)(button, ['header-user-menu__button']);
|
|
8852
8947
|
button.addEventListener('click', onClick);
|
|
8853
8948
|
button.innerText = label;
|
|
8854
8949
|
return button;
|
|
@@ -8860,7 +8955,7 @@ function createUserMenuButton(label, onClick) {
|
|
|
8860
8955
|
|
|
8861
8956
|
function createUserMenuLink(label, href, target) {
|
|
8862
8957
|
var link = document.createElement('a');
|
|
8863
|
-
(0,
|
|
8958
|
+
(0, _headerFooterHelpers.addStyleClassToElement)(link, ['header-user-menu__link']);
|
|
8864
8959
|
link.href = href;
|
|
8865
8960
|
link.innerText = label;
|
|
8866
8961
|
if (target) link.target = target;
|
|
@@ -8871,7 +8966,7 @@ function createUserMenuLink(label, href, target) {
|
|
|
8871
8966
|
*/
|
|
8872
8967
|
|
|
8873
8968
|
|
|
8874
|
-
function createUserMenu(
|
|
8969
|
+
function createUserMenu(_x9, _x10, _x11) {
|
|
8875
8970
|
return _createUserMenu.apply(this, arguments);
|
|
8876
8971
|
}
|
|
8877
8972
|
/**
|
|
@@ -8880,7 +8975,7 @@ function createUserMenu(_x7, _x8, _x9) {
|
|
|
8880
8975
|
|
|
8881
8976
|
|
|
8882
8977
|
function _createUserMenu() {
|
|
8883
|
-
_createUserMenu = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(store, user,
|
|
8978
|
+
_createUserMenu = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(store, user, userMenuList) {
|
|
8884
8979
|
var fetcher, loggedInMenuList, loggedInMenu, loggedInMenuTrigger, profileImg, loggedInMenuContainer, throttledMenuToggle, timer;
|
|
8885
8980
|
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
|
8886
8981
|
while (1) {
|
|
@@ -8898,32 +8993,26 @@ function _createUserMenu() {
|
|
|
8898
8993
|
|
|
8899
8994
|
case 4:
|
|
8900
8995
|
loggedInMenuList = document.createElement('ul');
|
|
8901
|
-
(0,
|
|
8902
|
-
loggedInMenuList.appendChild(createUserMenuItem(createUserMenuLink('Show your profile', user.uri)));
|
|
8996
|
+
(0, _headerFooterHelpers.addStyleClassToElement)(loggedInMenuList, ['header-user-menu__list']);
|
|
8903
8997
|
|
|
8904
|
-
if (
|
|
8905
|
-
|
|
8906
|
-
|
|
8907
|
-
|
|
8908
|
-
|
|
8909
|
-
|
|
8910
|
-
|
|
8911
|
-
|
|
8912
|
-
|
|
8913
|
-
|
|
8914
|
-
});
|
|
8915
|
-
}
|
|
8998
|
+
if (userMenuList) {
|
|
8999
|
+
userMenuList.forEach(function (menuItem) {
|
|
9000
|
+
var menuItemType = menuItem.url ? 'url' : 'onclick';
|
|
9001
|
+
|
|
9002
|
+
if (menuItemType === 'url') {
|
|
9003
|
+
loggedInMenuList.appendChild(createUserMenuItem(createUserMenuLink(menuItem.label, menuItem.url, menuItem.target)));
|
|
9004
|
+
} else {
|
|
9005
|
+
loggedInMenuList.appendChild(createUserMenuItem(createUserMenuButton(menuItem.label, menuItem.onclick)));
|
|
9006
|
+
}
|
|
9007
|
+
});
|
|
8916
9008
|
}
|
|
8917
9009
|
|
|
8918
|
-
loggedInMenuList.appendChild(createUserMenuItem(createUserMenuButton('Log out', function () {
|
|
8919
|
-
return _authn.authSession.logout();
|
|
8920
|
-
})));
|
|
8921
9010
|
loggedInMenu = document.createElement('nav');
|
|
8922
|
-
(0,
|
|
9011
|
+
(0, _headerFooterHelpers.addStyleClassToElement)(loggedInMenu, ['header-user-menu__navigation-menu']);
|
|
8923
9012
|
loggedInMenu.setAttribute('aria-hidden', 'true');
|
|
8924
9013
|
loggedInMenu.appendChild(loggedInMenuList);
|
|
8925
9014
|
loggedInMenuTrigger = document.createElement('button');
|
|
8926
|
-
(0,
|
|
9015
|
+
(0, _headerFooterHelpers.addStyleClassToElement)(loggedInMenuTrigger, ['header-user-menu__trigger']);
|
|
8927
9016
|
loggedInMenuTrigger.type = 'button';
|
|
8928
9017
|
profileImg = getProfileImg(store, user);
|
|
8929
9018
|
|
|
@@ -8934,11 +9023,11 @@ function _createUserMenu() {
|
|
|
8934
9023
|
}
|
|
8935
9024
|
|
|
8936
9025
|
loggedInMenuContainer = document.createElement('div');
|
|
8937
|
-
(0,
|
|
8938
|
-
(0,
|
|
9026
|
+
(0, _headerFooterHelpers.addStyleClassToElement)(loggedInMenuContainer, ['header-banner__user-menu']);
|
|
9027
|
+
(0, _headerFooterHelpers.addStyleClassToElement)(loggedInMenuContainer, ['header-user-menu']);
|
|
8939
9028
|
loggedInMenuContainer.appendChild(loggedInMenuTrigger);
|
|
8940
9029
|
loggedInMenuContainer.appendChild(loggedInMenu);
|
|
8941
|
-
throttledMenuToggle = (0,
|
|
9030
|
+
throttledMenuToggle = (0, _headerFooterHelpers.throttle)(function (event) {
|
|
8942
9031
|
return toggleMenu(event, loggedInMenuTrigger, loggedInMenu);
|
|
8943
9032
|
}, 50);
|
|
8944
9033
|
loggedInMenuTrigger.addEventListener('click', throttledMenuToggle);
|
|
@@ -8956,7 +9045,7 @@ function _createUserMenu() {
|
|
|
8956
9045
|
});
|
|
8957
9046
|
return _context4.abrupt("return", loggedInMenuContainer);
|
|
8958
9047
|
|
|
8959
|
-
case
|
|
9048
|
+
case 27:
|
|
8960
9049
|
case "end":
|
|
8961
9050
|
return _context4.stop();
|
|
8962
9051
|
}
|
|
@@ -8968,7 +9057,7 @@ function _createUserMenu() {
|
|
|
8968
9057
|
|
|
8969
9058
|
function createUserMenuItem(child) {
|
|
8970
9059
|
var menuProfileItem = document.createElement('li');
|
|
8971
|
-
(0,
|
|
9060
|
+
(0, _headerFooterHelpers.addStyleClassToElement)(menuProfileItem, ['header-user-menu__list-item']);
|
|
8972
9061
|
menuProfileItem.appendChild(child);
|
|
8973
9062
|
return menuProfileItem;
|
|
8974
9063
|
}
|
|
@@ -8991,7 +9080,7 @@ function getProfileImg(store, user) {
|
|
|
8991
9080
|
}
|
|
8992
9081
|
|
|
8993
9082
|
var profileImage = document.createElement('div');
|
|
8994
|
-
(0,
|
|
9083
|
+
(0, _headerFooterHelpers.addStyleClassToElement)(profileImage, ['header-user-menu__photo']);
|
|
8995
9084
|
profileImage.style.backgroundImage = "url(\"".concat(profileUrl, "\")");
|
|
8996
9085
|
return profileImage;
|
|
8997
9086
|
}
|
|
@@ -9157,11 +9246,7 @@ var styleMap = {
|
|
|
9157
9246
|
|
|
9158
9247
|
},
|
|
9159
9248
|
'header-banner__help-icon': {
|
|
9160
|
-
|
|
9161
|
-
height: '50px !important',
|
|
9162
|
-
// this is the icon size
|
|
9163
|
-
width: '55px !important' // may just be 65px round($icon-size * 352 / 430);
|
|
9164
|
-
|
|
9249
|
+
width: '28px !important'
|
|
9165
9250
|
}
|
|
9166
9251
|
};
|
|
9167
9252
|
exports.styleMap = styleMap;
|
|
@@ -9320,6 +9405,12 @@ Object.defineProperty(exports, "infiniteMessageArea", {
|
|
|
9320
9405
|
return _infinite.infiniteMessageArea;
|
|
9321
9406
|
}
|
|
9322
9407
|
});
|
|
9408
|
+
Object.defineProperty(exports, "initFooter", {
|
|
9409
|
+
enumerable: true,
|
|
9410
|
+
get: function get() {
|
|
9411
|
+
return _footer.initFooter;
|
|
9412
|
+
}
|
|
9413
|
+
});
|
|
9323
9414
|
Object.defineProperty(exports, "initHeader", {
|
|
9324
9415
|
enumerable: true,
|
|
9325
9416
|
get: function get() {
|
|
@@ -9436,6 +9527,8 @@ var _versionInfo = _interopRequireDefault(__webpack_require__(/*! ./versionInfo
|
|
|
9436
9527
|
|
|
9437
9528
|
var _header = __webpack_require__(/*! ./header */ "./lib/header/index.js");
|
|
9438
9529
|
|
|
9530
|
+
var _footer = __webpack_require__(/*! ./footer */ "./lib/footer/index.js");
|
|
9531
|
+
|
|
9439
9532
|
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); }
|
|
9440
9533
|
|
|
9441
9534
|
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; }
|
|
@@ -9488,7 +9581,8 @@ if (typeof window !== 'undefined') {
|
|
|
9488
9581
|
utils: utils,
|
|
9489
9582
|
widgets: widgets,
|
|
9490
9583
|
versionInfo: _versionInfo["default"],
|
|
9491
|
-
initHeader: _header.initHeader
|
|
9584
|
+
initHeader: _header.initHeader,
|
|
9585
|
+
initFooter: _footer.initFooter
|
|
9492
9586
|
}; // Simpler access by non-node scripts
|
|
9493
9587
|
}
|
|
9494
9588
|
//# sourceMappingURL=index.js.map
|
|
@@ -12439,19 +12533,19 @@ var formFieldNameBoxWidth = '8em'; // The fixed amount to get form fields to lin
|
|
|
12439
12533
|
var style = {
|
|
12440
12534
|
// styleModule
|
|
12441
12535
|
checkboxStyle: 'colour: black; font-size: 100%; padding-left: 0.5 em; padding-right: 0.5 em;',
|
|
12442
|
-
checkboxInputStyle: 'font-size: 150%; height: 1.2em; width: 1.2em; background-color: #eef; margin: 0.1em',
|
|
12536
|
+
checkboxInputStyle: 'font-size: 150%; height: 1.2em; width: 1.2em; background-color: #eef; border-radius:0.2em; margin: 0.1em',
|
|
12443
12537
|
fieldLabelStyle: 'color: #3B5998; text-decoration: none;',
|
|
12444
12538
|
formSelectSTyle: 'background-color: #eef; padding: 0.5em; border: .05em solid #88c; border-radius:0.2em; font-size: 100%; margin:0.2em;',
|
|
12445
12539
|
textInputStyle: 'background-color: #eef; padding: 0.5em; border: .05em solid #88c; border-radius:0.2em; font-size: 100%; margin:0.2em;',
|
|
12446
12540
|
textInputStyleUneditable: // Color difference only
|
|
12447
|
-
'background-color: white; padding: 0.5em; border: .05em solid white; border-radius:0.2em; font-size: 100%; margin:0.2em;
|
|
12541
|
+
'background-color: white; padding: 0.5em; border: .05em solid white; border-radius:0.2em; font-size: 100%; margin:0.2em;',
|
|
12448
12542
|
textInputSize: 20,
|
|
12449
12543
|
// Default text input size in characters roughly
|
|
12450
12544
|
buttonStyle: 'background-color: #fff; padding: 0.7em; border: .01em solid white; border-radius:0.2em; font-size: 100%; margin: 0.3em;',
|
|
12451
12545
|
// 'background-color: #eef;
|
|
12452
12546
|
commentStyle: 'padding: 0.7em; border: none; font-size: 100%; white-space: pre-wrap;',
|
|
12453
12547
|
iconStyle: 'width: 3em; height: 3em; margin: 0.1em; border-radius: 1em;',
|
|
12454
|
-
smallButtonStyle: 'margin: 0.2em; width: 1em; height:1em',
|
|
12548
|
+
smallButtonStyle: 'margin: 0.2em; width: 1em; height:1em;',
|
|
12455
12549
|
classIconStyle: 'width: 3em; height: 3em; margin: 0.1em; border-radius: 0.2em; border: 0.1em solid green; padding: 0.2em; background-color: #efe;',
|
|
12456
12550
|
// combine with buttonStyle
|
|
12457
12551
|
confirmPopupStyle: 'padding: 0.7em; border-radius: 0.2em; border: 0.1em solid orange; background-color: white; box-shadow: 0.5em 0.9em #888;',
|
|
@@ -14626,6 +14720,206 @@ function isLight(x) {
|
|
|
14626
14720
|
|
|
14627
14721
|
/***/ }),
|
|
14628
14722
|
|
|
14723
|
+
/***/ "./lib/utils/headerFooterHelpers.js":
|
|
14724
|
+
/*!******************************************!*\
|
|
14725
|
+
!*** ./lib/utils/headerFooterHelpers.js ***!
|
|
14726
|
+
\******************************************/
|
|
14727
|
+
/*! no static exports found */
|
|
14728
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
14729
|
+
|
|
14730
|
+
"use strict";
|
|
14731
|
+
|
|
14732
|
+
|
|
14733
|
+
var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/@babel/runtime/helpers/interopRequireDefault.js");
|
|
14734
|
+
|
|
14735
|
+
Object.defineProperty(exports, "__esModule", {
|
|
14736
|
+
value: true
|
|
14737
|
+
});
|
|
14738
|
+
exports.addStyleClassToElement = addStyleClassToElement;
|
|
14739
|
+
exports.getName = getName;
|
|
14740
|
+
exports.getPod = getPod;
|
|
14741
|
+
exports.getPodOwner = getPodOwner;
|
|
14742
|
+
exports.throttle = throttle;
|
|
14743
|
+
|
|
14744
|
+
var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ "./node_modules/@babel/runtime/regenerator/index.js"));
|
|
14745
|
+
|
|
14746
|
+
var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "./node_modules/@babel/runtime/helpers/asyncToGenerator.js"));
|
|
14747
|
+
|
|
14748
|
+
var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "./node_modules/@babel/runtime/helpers/defineProperty.js"));
|
|
14749
|
+
|
|
14750
|
+
var _rdflib = __webpack_require__(/*! rdflib */ "./node_modules/rdflib/esm/index.js");
|
|
14751
|
+
|
|
14752
|
+
var _ = __webpack_require__(/*! .. */ "./lib/index.js");
|
|
14753
|
+
|
|
14754
|
+
var _styleMap = __webpack_require__(/*! ../header/styleMap */ "./lib/header/styleMap.js");
|
|
14755
|
+
|
|
14756
|
+
var _styleMap2 = __webpack_require__(/*! ../footer/styleMap */ "./lib/footer/styleMap.js");
|
|
14757
|
+
|
|
14758
|
+
var _jss = __webpack_require__(/*! ../jss */ "./lib/jss/index.js");
|
|
14759
|
+
|
|
14760
|
+
/*
|
|
14761
|
+
Copied from mashlib/src/global/metadata.ts
|
|
14762
|
+
*/
|
|
14763
|
+
|
|
14764
|
+
/**
|
|
14765
|
+
* @internal
|
|
14766
|
+
*/
|
|
14767
|
+
function getStyle(styleClass, type) {
|
|
14768
|
+
if (type && type === 'footer') {
|
|
14769
|
+
return _styleMap2.styleMap[styleClass];
|
|
14770
|
+
} else {
|
|
14771
|
+
return _styleMap.styleMap[styleClass];
|
|
14772
|
+
}
|
|
14773
|
+
}
|
|
14774
|
+
/**
|
|
14775
|
+
* @ignore exporting this only for the unit test
|
|
14776
|
+
*/
|
|
14777
|
+
|
|
14778
|
+
|
|
14779
|
+
function addStyleClassToElement(element, styleClasses, type) {
|
|
14780
|
+
styleClasses.forEach(function (styleClass) {
|
|
14781
|
+
var style = getStyle(styleClass, type);
|
|
14782
|
+
|
|
14783
|
+
var _getClasses = (0, _jss.getClasses)(document.head, (0, _defineProperty2["default"])({}, styleClass, style)),
|
|
14784
|
+
classes = _getClasses.classes;
|
|
14785
|
+
|
|
14786
|
+
element.classList.add(classes[styleClass]);
|
|
14787
|
+
});
|
|
14788
|
+
}
|
|
14789
|
+
/**
|
|
14790
|
+
* @ignore exporting this only for the unit test
|
|
14791
|
+
*/
|
|
14792
|
+
|
|
14793
|
+
|
|
14794
|
+
function getPod() {
|
|
14795
|
+
// @@ TODO: This is given that mashlib runs on NSS - might need to change when we want it to run on other Pod servers
|
|
14796
|
+
return (0, _rdflib.sym)(document.location.origin).site();
|
|
14797
|
+
}
|
|
14798
|
+
/**
|
|
14799
|
+
* @ignore exporting this only for the unit test
|
|
14800
|
+
*/
|
|
14801
|
+
|
|
14802
|
+
|
|
14803
|
+
function getPodOwner(_x, _x2) {
|
|
14804
|
+
return _getPodOwner.apply(this, arguments);
|
|
14805
|
+
}
|
|
14806
|
+
/**
|
|
14807
|
+
* @ignore exporting this only for the unit test
|
|
14808
|
+
*/
|
|
14809
|
+
|
|
14810
|
+
|
|
14811
|
+
function _getPodOwner() {
|
|
14812
|
+
_getPodOwner = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(pod, store) {
|
|
14813
|
+
var podOwner, storageIsListedInPodOwnersProfile;
|
|
14814
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
14815
|
+
while (1) {
|
|
14816
|
+
switch (_context.prev = _context.next) {
|
|
14817
|
+
case 0:
|
|
14818
|
+
// @@ TODO: This is given the structure that NSS provides - might need to change for other Pod servers
|
|
14819
|
+
podOwner = (0, _rdflib.sym)("".concat(pod.uri, "profile/card#me"));
|
|
14820
|
+
_context.prev = 1;
|
|
14821
|
+
|
|
14822
|
+
if (!store.fetcher) {
|
|
14823
|
+
_context.next = 7;
|
|
14824
|
+
break;
|
|
14825
|
+
}
|
|
14826
|
+
|
|
14827
|
+
_context.next = 5;
|
|
14828
|
+
return store.fetcher.load(podOwner.doc());
|
|
14829
|
+
|
|
14830
|
+
case 5:
|
|
14831
|
+
_context.next = 8;
|
|
14832
|
+
break;
|
|
14833
|
+
|
|
14834
|
+
case 7:
|
|
14835
|
+
throw new Error('There was a problem loading the Fetcher');
|
|
14836
|
+
|
|
14837
|
+
case 8:
|
|
14838
|
+
_context.next = 13;
|
|
14839
|
+
break;
|
|
14840
|
+
|
|
14841
|
+
case 10:
|
|
14842
|
+
_context.prev = 10;
|
|
14843
|
+
_context.t0 = _context["catch"](1);
|
|
14844
|
+
throw new Error('Did NOT find pod owners profile at ' + podOwner);
|
|
14845
|
+
|
|
14846
|
+
case 13:
|
|
14847
|
+
if (!podOwner) {
|
|
14848
|
+
_context.next = 17;
|
|
14849
|
+
break;
|
|
14850
|
+
}
|
|
14851
|
+
|
|
14852
|
+
storageIsListedInPodOwnersProfile = store.holds(podOwner, _.ns.space('storage'), pod, podOwner.doc());
|
|
14853
|
+
|
|
14854
|
+
if (storageIsListedInPodOwnersProfile) {
|
|
14855
|
+
_context.next = 17;
|
|
14856
|
+
break;
|
|
14857
|
+
}
|
|
14858
|
+
|
|
14859
|
+
throw new Error("** Pod owner ".concat(podOwner, " does NOT list pod ").concat(pod, " as storage"));
|
|
14860
|
+
|
|
14861
|
+
case 17:
|
|
14862
|
+
return _context.abrupt("return", podOwner);
|
|
14863
|
+
|
|
14864
|
+
case 18:
|
|
14865
|
+
case "end":
|
|
14866
|
+
return _context.stop();
|
|
14867
|
+
}
|
|
14868
|
+
}
|
|
14869
|
+
}, _callee, null, [[1, 10]]);
|
|
14870
|
+
}));
|
|
14871
|
+
return _getPodOwner.apply(this, arguments);
|
|
14872
|
+
}
|
|
14873
|
+
|
|
14874
|
+
function getName(store, user) {
|
|
14875
|
+
return store.anyValue(user, _.ns.vcard('fn'), null, user.doc()) || store.anyValue(user, _.ns.foaf('name'), null, user.doc()) || user.uri;
|
|
14876
|
+
}
|
|
14877
|
+
/**
|
|
14878
|
+
* @ignore exporting this only for the unit test
|
|
14879
|
+
*/
|
|
14880
|
+
|
|
14881
|
+
|
|
14882
|
+
function throttle(func, wait) {
|
|
14883
|
+
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
14884
|
+
var context, args, result;
|
|
14885
|
+
var timeout = null;
|
|
14886
|
+
var previous = 0;
|
|
14887
|
+
|
|
14888
|
+
var later = function later() {
|
|
14889
|
+
previous = !options.leading ? 0 : Date.now();
|
|
14890
|
+
timeout = null;
|
|
14891
|
+
result = func.apply(context, args);
|
|
14892
|
+
if (!timeout) context = args = null;
|
|
14893
|
+
};
|
|
14894
|
+
|
|
14895
|
+
return function () {
|
|
14896
|
+
var now = Date.now();
|
|
14897
|
+
if (!previous && !options.leading) previous = now;
|
|
14898
|
+
var remaining = wait - (now - previous); // @ts-ignore
|
|
14899
|
+
|
|
14900
|
+
context = this;
|
|
14901
|
+
args = arguments;
|
|
14902
|
+
|
|
14903
|
+
if (remaining <= 0 || remaining > wait) {
|
|
14904
|
+
if (timeout) {
|
|
14905
|
+
clearTimeout(timeout);
|
|
14906
|
+
timeout = null;
|
|
14907
|
+
}
|
|
14908
|
+
|
|
14909
|
+
previous = now;
|
|
14910
|
+
result = func.apply(context, args);
|
|
14911
|
+
if (!timeout) context = args = null;
|
|
14912
|
+
} else if (!timeout && options.trailing !== false) {
|
|
14913
|
+
timeout = setTimeout(later, remaining);
|
|
14914
|
+
}
|
|
14915
|
+
|
|
14916
|
+
return result;
|
|
14917
|
+
};
|
|
14918
|
+
}
|
|
14919
|
+
//# sourceMappingURL=headerFooterHelpers.js.map
|
|
14920
|
+
|
|
14921
|
+
/***/ }),
|
|
14922
|
+
|
|
14629
14923
|
/***/ "./lib/utils/index.js":
|
|
14630
14924
|
/*!****************************!*\
|
|
14631
14925
|
!*** ./lib/utils/index.js ***!
|
|
@@ -15422,12 +15716,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
15422
15716
|
});
|
|
15423
15717
|
exports["default"] = void 0;
|
|
15424
15718
|
var _default = {
|
|
15425
|
-
buildTime: '2021-
|
|
15426
|
-
commit: '
|
|
15719
|
+
buildTime: '2021-12-21T15:33:58Z',
|
|
15720
|
+
commit: '47411c331464e4bc3e9b0defe5191bff497cac86',
|
|
15427
15721
|
npmInfo: {
|
|
15428
15722
|
'solid-ui': '2.4.12',
|
|
15429
15723
|
npm: '6.14.15',
|
|
15430
|
-
ares: '1.
|
|
15724
|
+
ares: '1.18.1',
|
|
15431
15725
|
brotli: '1.0.9',
|
|
15432
15726
|
cldr: '39.0',
|
|
15433
15727
|
icu: '69.1',
|
|
@@ -15435,12 +15729,12 @@ var _default = {
|
|
|
15435
15729
|
modules: '83',
|
|
15436
15730
|
napi: '8',
|
|
15437
15731
|
nghttp2: '1.42.0',
|
|
15438
|
-
node: '14.18.
|
|
15732
|
+
node: '14.18.2',
|
|
15439
15733
|
openssl: '1.1.1l',
|
|
15440
15734
|
tz: '2021a',
|
|
15441
15735
|
unicode: '13.0',
|
|
15442
15736
|
uv: '1.42.0',
|
|
15443
|
-
v8: '8.4.371.23-node.
|
|
15737
|
+
v8: '8.4.371.23-node.85',
|
|
15444
15738
|
zlib: '1.2.11'
|
|
15445
15739
|
}
|
|
15446
15740
|
};
|
|
@@ -19075,10 +19369,8 @@ function buildCheckboxForm(dom, kb, lab, del, ins, form, dataDoc, tristate) {
|
|
|
19075
19369
|
var rhs = (0, _basic.renderNameValuePair)(dom, kb, box, form);
|
|
19076
19370
|
var editable = kb.updater.editable(dataDoc.uri);
|
|
19077
19371
|
var input = dom.createElement('button');
|
|
19078
|
-
var colorCarrier = input;
|
|
19079
|
-
|
|
19080
|
-
input.style = style.checkboxInputStyle; // colorCarrier.style = style.checkboxStyle
|
|
19081
|
-
|
|
19372
|
+
var colorCarrier = input;
|
|
19373
|
+
input.style = style.checkboxInputStyle;
|
|
19082
19374
|
rhs.appendChild(input);
|
|
19083
19375
|
|
|
19084
19376
|
function fix(x) {
|
|
@@ -19138,7 +19430,7 @@ function buildCheckboxForm(dom, kb, lab, del, ins, form, dataDoc, tristate) {
|
|
|
19138
19430
|
if (!editable) return box;
|
|
19139
19431
|
|
|
19140
19432
|
var boxHandler = function boxHandler(_e) {
|
|
19141
|
-
colorCarrier.style.color = '#bbb
|
|
19433
|
+
colorCarrier.style.color = '#bbb'; // grey -- not saved yet
|
|
19142
19434
|
|
|
19143
19435
|
var toDelete = input.state === true ? ins : input.state === false ? del : [];
|
|
19144
19436
|
input.newState = input.state === null ? true : input.state === true ? false : tristate ? null : true;
|
|
@@ -19155,11 +19447,11 @@ function buildCheckboxForm(dom, kb, lab, del, ins, form, dataDoc, tristate) {
|
|
|
19155
19447
|
}
|
|
19156
19448
|
}
|
|
19157
19449
|
|
|
19158
|
-
colorCarrier.style.color = '
|
|
19159
|
-
colorCarrier.style.backgroundColor = '#fee
|
|
19450
|
+
colorCarrier.style.color = '#000';
|
|
19451
|
+
colorCarrier.style.backgroundColor = '#fee';
|
|
19160
19452
|
box.appendChild((0, _error.errorMessageBlock)(dom, "Checkbox: Error updating dataDoc from ".concat(input.state, " to ").concat(input.newState, ":\n\n").concat(errorBody)));
|
|
19161
19453
|
} else {
|
|
19162
|
-
colorCarrier.style = '
|
|
19454
|
+
colorCarrier.style.color = '#000';
|
|
19163
19455
|
input.state = input.newState;
|
|
19164
19456
|
input.textContent = {
|
|
19165
19457
|
"true": checkMarkCharacter,
|
|
@@ -21632,33 +21924,22 @@ function basicField(dom, container, already, subject, form, doc, callbackFunctio
|
|
|
21632
21924
|
return box.appendChild((0, _error.errorMessageBlock)(dom, 'Error: No property given for text field: ' + form));
|
|
21633
21925
|
}
|
|
21634
21926
|
|
|
21635
|
-
var rhs = renderNameValuePair(dom, kb, box, form);
|
|
21636
|
-
/*
|
|
21637
|
-
box.style.display = 'flex'
|
|
21638
|
-
box.style.flexDirection = 'row'
|
|
21639
|
-
const lhs = box.appendChild(dom.createElement('div'))
|
|
21640
|
-
lhs.style.width = formFieldNameBoxWidth
|
|
21641
|
-
const rhs = box.appendChild(dom.createElement('div'))
|
|
21642
|
-
lhs.appendChild(fieldLabel(dom, property as NamedNode, form))
|
|
21643
|
-
lhs.setAttribute('class', 'formFieldName')
|
|
21644
|
-
lhs.setAttribute('style', formFieldNameBoxStyle)
|
|
21645
|
-
rhs.setAttribute('class', 'formFieldValue')
|
|
21646
|
-
*/
|
|
21647
|
-
// It can be cleaner to just remove empty fields if you can't edit them anyway
|
|
21927
|
+
var rhs = renderNameValuePair(dom, kb, box, form); // It can be cleaner to just remove empty fields if you can't edit them anyway
|
|
21648
21928
|
|
|
21649
21929
|
var suppressEmptyUneditable = kb.anyJS(form, ns.ui('suppressEmptyUneditable'), null, formDoc);
|
|
21650
21930
|
var uri = (0, _fieldFunction.mostSpecificClassURI)(form);
|
|
21651
21931
|
var params = _fieldParams.fieldParams[uri];
|
|
21652
|
-
if (params === undefined) params = {
|
|
21653
|
-
|
|
21654
|
-
|
|
21932
|
+
if (params === undefined) params = {
|
|
21933
|
+
style: ''
|
|
21934
|
+
}; // non-bottom field types can do this
|
|
21655
21935
|
|
|
21936
|
+
var paramStyle = params.style || '';
|
|
21937
|
+
var style = _style.textInputStyle + paramStyle;
|
|
21656
21938
|
var field = dom.createElement('input');
|
|
21657
|
-
field.style =
|
|
21658
|
-
|
|
21939
|
+
field.style = style;
|
|
21659
21940
|
rhs.appendChild(field);
|
|
21660
21941
|
field.setAttribute('type', params.type ? params.type : 'text');
|
|
21661
|
-
var size = kb.anyJS(form, ns.ui('size')) ||
|
|
21942
|
+
var size = kb.anyJS(form, ns.ui('size')) || _style.textInputSize || 20;
|
|
21662
21943
|
field.setAttribute('size', size);
|
|
21663
21944
|
var maxLength = kb.any(form, ns.ui('maxLength'));
|
|
21664
21945
|
field.setAttribute('maxLength', maxLength ? '' + maxLength : '4096');
|
|
@@ -21687,7 +21968,7 @@ function basicField(dom, container, already, subject, form, doc, callbackFunctio
|
|
|
21687
21968
|
if (!kb.updater.editable(doc.uri)) {
|
|
21688
21969
|
field.readOnly = true // was: disabled. readOnly is better
|
|
21689
21970
|
;
|
|
21690
|
-
field.style = _style.textInputStyleUneditable; // backgroundColor = textInputBackgroundColorUneditable
|
|
21971
|
+
field.style = _style.textInputStyleUneditable + paramStyle; // backgroundColor = textInputBackgroundColorUneditable
|
|
21691
21972
|
|
|
21692
21973
|
if (suppressEmptyUneditable && field.value === '') {
|
|
21693
21974
|
box.style.display = 'none'; // clutter
|
|
@@ -21918,6 +22199,8 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
21918
22199
|
var fieldParams = (_fieldParams = {}, (0, _defineProperty2["default"])(_fieldParams, ns.ui('ColorField').uri, {
|
|
21919
22200
|
size: 9,
|
|
21920
22201
|
type: 'color',
|
|
22202
|
+
style: 'height: 3em;',
|
|
22203
|
+
// around 1.5em is padding
|
|
21921
22204
|
dt: 'color',
|
|
21922
22205
|
pattern: /^\s*#[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]([0-9a-f][0-9a-f])?\s*$/
|
|
21923
22206
|
}), (0, _defineProperty2["default"])(_fieldParams, ns.ui('DateField').uri, {
|
|
@@ -21938,17 +22221,17 @@ var fieldParams = (_fieldParams = {}, (0, _defineProperty2["default"])(_fieldPar
|
|
|
21938
22221
|
pattern: /^\s*([0-2]?[0-9]:[0-5][0-9](:[0-5][0-9])?)\s*$/
|
|
21939
22222
|
}), (0, _defineProperty2["default"])(_fieldParams, ns.ui('IntegerField').uri, {
|
|
21940
22223
|
size: 12,
|
|
21941
|
-
style: 'text-align: right',
|
|
22224
|
+
style: 'text-align: right;',
|
|
21942
22225
|
dt: 'integer',
|
|
21943
22226
|
pattern: /^\s*-?[0-9]+\s*$/
|
|
21944
22227
|
}), (0, _defineProperty2["default"])(_fieldParams, ns.ui('DecimalField').uri, {
|
|
21945
22228
|
size: 12,
|
|
21946
|
-
style: 'text-align: right',
|
|
22229
|
+
style: 'text-align: right;',
|
|
21947
22230
|
dt: 'decimal',
|
|
21948
22231
|
pattern: /^\s*-?[0-9]*(\.[0-9]*)?\s*$/
|
|
21949
22232
|
}), (0, _defineProperty2["default"])(_fieldParams, ns.ui('FloatField').uri, {
|
|
21950
22233
|
size: 12,
|
|
21951
|
-
style: 'text-align: right',
|
|
22234
|
+
style: 'text-align: right;',
|
|
21952
22235
|
dt: 'float',
|
|
21953
22236
|
pattern: /^\s*-?[0-9]*(\.[0-9]*)?((e|E)-?[0-9]*)?\s*$/
|
|
21954
22237
|
}), (0, _defineProperty2["default"])(_fieldParams, ns.ui('SingleLineTextField').uri, {}), (0, _defineProperty2["default"])(_fieldParams, ns.ui('NamedNodeURIField').uri, {
|