solid-ui 3.0.4-822a480 → 3.0.4-8c04218

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.
@@ -1611,6 +1611,96 @@ var _solidLogicSingleton$2 = solid_logic__WEBPACK_IMPORTED_MODULE_3__.solidLogic
1611
1611
  loadAllTypeIndexes = _solidLogicSingleton$2.loadAllTypeIndexes,
1612
1612
  getScopedAppsFromIndex = _solidLogicSingleton$2.getScopedAppsFromIndex,
1613
1613
  deleteTypeIndexRegistration = _solidLogicSingleton$2.deleteTypeIndexRegistration;
1614
+ function formatDynamicError(error, contextLabel) {
1615
+ var e = error;
1616
+ var name = (e === null || e === void 0 ? void 0 : e.name) || 'Error';
1617
+ var status = typeof (e === null || e === void 0 ? void 0 : e.status) === 'number' ? " (HTTP ".concat(e.status, ")") : '';
1618
+ var message = e !== null && e !== void 0 && e.message ? String(e.message) : typeof error === 'string' ? error : 'No additional details provided';
1619
+ return "".concat(contextLabel, ": ").concat(name).concat(status, " - ").concat(message);
1620
+ }
1621
+ function guessPreferencesFileUri(me) {
1622
+ return me.uri.replace('/profile/', '/').replace('/public/', '/').split('/').slice(0, -1).join('/') + '/Settings/Preferences.ttl';
1623
+ }
1624
+ function getMissingPreferencesFileUri(context, err) {
1625
+ var _response;
1626
+ var responseUrl = err === null || err === void 0 || (_response = err.response) === null || _response === void 0 ? void 0 : _response.url;
1627
+ if (typeof responseUrl === 'string' && responseUrl) {
1628
+ return responseUrl;
1629
+ }
1630
+ if (context.me) {
1631
+ var pointer = store.any(context.me, _ns__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .A.space('preferencesFile'), undefined, context.me.doc ? context.me.doc() : undefined);
1632
+ if (pointer !== null && pointer !== void 0 && pointer.uri) {
1633
+ return pointer.uri;
1634
+ }
1635
+ return guessPreferencesFileUri(context.me);
1636
+ }
1637
+ return null;
1638
+ }
1639
+ function createPreferencesFile(_x, _x2) {
1640
+ return _createPreferencesFile.apply(this, arguments);
1641
+ }
1642
+ function _createPreferencesFile() {
1643
+ _createPreferencesFile = (0,_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(/*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().mark(function _callee4(context, uri) {
1644
+ var initialData;
1645
+ return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().wrap(function (_context4) {
1646
+ while (1) switch (_context4.prev = _context4.next) {
1647
+ case 0:
1648
+ if (store.fetcher) {
1649
+ _context4.next = 1;
1650
+ break;
1651
+ }
1652
+ throw new Error('Cannot create preferences file: store has no fetcher');
1653
+ case 1:
1654
+ initialData = '# Preferences file created by solid-ui\n';
1655
+ _context4.next = 2;
1656
+ return store.fetcher.webOperation('PUT', uri, {
1657
+ data: initialData,
1658
+ contentType: 'text/turtle'
1659
+ });
1660
+ case 2:
1661
+ if (context.me) {
1662
+ _context4.next = 3;
1663
+ break;
1664
+ }
1665
+ throw new Error('Cannot reload preferences file: no logged-in WebID');
1666
+ case 3:
1667
+ _context4.next = 4;
1668
+ return loadPreferences(context.me);
1669
+ case 4:
1670
+ context.preferencesFile = _context4.sent;
1671
+ context.preferencesFileError = undefined;
1672
+ case 5:
1673
+ case "end":
1674
+ return _context4.stop();
1675
+ }
1676
+ }, _callee4);
1677
+ }));
1678
+ return _createPreferencesFile.apply(this, arguments);
1679
+ }
1680
+ function offerCreatePreferencesFile(context, uri, baseMessage) {
1681
+ if (context.div && context.dom) {
1682
+ var box = context.dom.createElement('div');
1683
+ box.appendChild(_widgets__WEBPACK_IMPORTED_MODULE_11__/* .errorMessageBlock */ .F(context.dom, "".concat(baseMessage, " Create it now?")));
1684
+ var createButton = context.dom.createElement('button');
1685
+ createButton.textContent = 'Create preferences file';
1686
+ createButton.setAttribute('style', _style__WEBPACK_IMPORTED_MODULE_5__/* .style */ .i.buttonStyle);
1687
+ createButton.addEventListener('click', function () {
1688
+ createButton.disabled = true;
1689
+ createPreferencesFile(context, uri).then(function () {
1690
+ box.appendChild(_widgets__WEBPACK_IMPORTED_MODULE_11__/* .errorMessageBlock */ .F(context.dom, "Preferences file created: ".concat(uri), '#dfd'));
1691
+ })["catch"](function (error) {
1692
+ var message = formatDynamicError(error, 'Failed to create preferences file');
1693
+ box.appendChild(_widgets__WEBPACK_IMPORTED_MODULE_11__/* .errorMessageBlock */ .F(context.dom, message));
1694
+ _debug__WEBPACK_IMPORTED_MODULE_4__/* .error */ .z3(message);
1695
+ createButton.disabled = false;
1696
+ });
1697
+ });
1698
+ box.appendChild(createButton);
1699
+ context.div.appendChild(box);
1700
+ return;
1701
+ }
1702
+ _debug__WEBPACK_IMPORTED_MODULE_4__/* .warn */ .R8("".concat(baseMessage, " You can create it at: ").concat(uri));
1703
+ }
1614
1704
 
1615
1705
  /**
1616
1706
  * Resolves with the logged in user's WebID
@@ -1652,7 +1742,7 @@ function ensureLoggedIn(context) {
1652
1742
  * @param context
1653
1743
  */
1654
1744
  // used to be logInLoadPreferences
1655
- function ensureLoadedPreferences(_x) {
1745
+ function ensureLoadedPreferences(_x3) {
1656
1746
  return _ensureLoadedPreferences.apply(this, arguments);
1657
1747
  }
1658
1748
 
@@ -1665,98 +1755,125 @@ function ensureLoadedPreferences(_x) {
1665
1755
  */
1666
1756
  // used to be logInLoadProfile
1667
1757
  function _ensureLoadedPreferences() {
1668
- _ensureLoadedPreferences = (0,_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(/*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().mark(function _callee4(context) {
1669
- var progressDisplay, preferencesFile, m2, _t4;
1670
- return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().wrap(function (_context4) {
1671
- while (1) switch (_context4.prev = _context4.next) {
1758
+ _ensureLoadedPreferences = (0,_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(/*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().mark(function _callee5(context) {
1759
+ var progressDisplay, preferencesFile, m2, missingPreferencesFileUri, _t4;
1760
+ return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().wrap(function (_context5) {
1761
+ while (1) switch (_context5.prev = _context5.next) {
1672
1762
  case 0:
1673
1763
  if (!context.preferencesFile) {
1674
- _context4.next = 1;
1764
+ _context5.next = 1;
1675
1765
  break;
1676
1766
  }
1677
- return _context4.abrupt("return", Promise.resolve(context));
1767
+ return _context5.abrupt("return", Promise.resolve(context));
1678
1768
  case 1:
1679
- _context4.prev = 1;
1680
- _context4.next = 2;
1769
+ _context5.prev = 1;
1770
+ _context5.next = 2;
1681
1771
  return ensureLoadedProfile(context);
1682
1772
  case 2:
1683
- context = _context4.sent;
1684
- _context4.next = 3;
1685
- return loadPreferences(context.me);
1773
+ context = _context5.sent;
1774
+ if (context.me) {
1775
+ _context5.next = 3;
1776
+ break;
1777
+ }
1778
+ context.preferencesFileError = 'Not logged in, so preferences were not loaded.';
1779
+ _debug__WEBPACK_IMPORTED_MODULE_4__/* .log */ .Rm('not logged in, no preferences loaded');
1780
+ return _context5.abrupt("return", context);
1686
1781
  case 3:
1687
- preferencesFile = _context4.sent;
1782
+ _context5.next = 4;
1783
+ return loadPreferences(context.me);
1784
+ case 4:
1785
+ preferencesFile = _context5.sent;
1688
1786
  if (progressDisplay) {
1689
1787
  progressDisplay.parentNode.removeChild(progressDisplay);
1690
1788
  }
1691
1789
  context.preferencesFile = preferencesFile;
1692
- _context4.next = 11;
1790
+ _context5.next = 13;
1693
1791
  break;
1694
- case 4:
1695
- _context4.prev = 4;
1696
- _t4 = _context4["catch"](1);
1792
+ case 5:
1793
+ _context5.prev = 5;
1794
+ _t4 = _context5["catch"](1);
1697
1795
  if (!(_t4 instanceof solid_logic__WEBPACK_IMPORTED_MODULE_3__.UnauthorizedError)) {
1698
- _context4.next = 5;
1796
+ _context5.next = 6;
1699
1797
  break;
1700
1798
  }
1701
1799
  m2 = 'Oops — you are not authenticated (properly logged in), so SolidOS cannot read your preferences file. Try logging out and then logging back in.';
1800
+ context.preferencesFileError = m2;
1702
1801
  (0,_log__WEBPACK_IMPORTED_MODULE_6__.alert)(m2);
1703
- _context4.next = 11;
1704
- break;
1705
- case 5:
1802
+ return _context5.abrupt("return", context);
1803
+ case 6:
1706
1804
  if (!(_t4 instanceof solid_logic__WEBPACK_IMPORTED_MODULE_3__.CrossOriginForbiddenError)) {
1707
- _context4.next = 6;
1805
+ _context5.next = 7;
1708
1806
  break;
1709
1807
  }
1710
- m2 = "Unauthorized: Assuming preference file blocked for origin ".concat(window.location.origin);
1808
+ m2 = "Blocked by origin: preference file request from ".concat(window.location.origin, " was forbidden. Ensure this app origin is trusted/allowed for your preferences file.");
1711
1809
  context.preferencesFileError = m2;
1712
- return _context4.abrupt("return", context);
1713
- case 6:
1810
+ return _context5.abrupt("return", context);
1811
+ case 7:
1714
1812
  if (!(_t4 instanceof solid_logic__WEBPACK_IMPORTED_MODULE_3__.SameOriginForbiddenError)) {
1715
- _context4.next = 7;
1813
+ _context5.next = 8;
1716
1814
  break;
1717
1815
  }
1718
- m2 = 'You are not authorized to read your preference file. This may be because you are using an untrusted web app.';
1816
+ m2 = 'You are not authorized to read your preference file from this app context.';
1817
+ context.preferencesFileError = m2;
1719
1818
  _debug__WEBPACK_IMPORTED_MODULE_4__/* .warn */ .R8(m2);
1720
- return _context4.abrupt("return", context);
1721
- case 7:
1819
+ return _context5.abrupt("return", context);
1820
+ case 8:
1722
1821
  if (!(_t4 instanceof solid_logic__WEBPACK_IMPORTED_MODULE_3__.NotEditableError)) {
1723
- _context4.next = 8;
1822
+ _context5.next = 9;
1724
1823
  break;
1725
1824
  }
1726
- m2 = 'You are not authorized to edit your preference file. This may be because you are using an untrusted web app.';
1825
+ m2 = 'You are not authorized to edit your preference file from this app context.';
1826
+ context.preferencesFileError = m2;
1727
1827
  _debug__WEBPACK_IMPORTED_MODULE_4__/* .warn */ .R8(m2);
1728
- return _context4.abrupt("return", context);
1729
- case 8:
1828
+ return _context5.abrupt("return", context);
1829
+ case 9:
1730
1830
  if (!(_t4 instanceof solid_logic__WEBPACK_IMPORTED_MODULE_3__.WebOperationError)) {
1731
- _context4.next = 9;
1831
+ _context5.next = 10;
1732
1832
  break;
1733
1833
  }
1734
- m2 = 'You are not authorized to edit your preference file. This may be because you are using an untrusted web app.';
1834
+ m2 = formatDynamicError(_t4, 'Preference file web operation failed');
1835
+ context.preferencesFileError = m2;
1735
1836
  _debug__WEBPACK_IMPORTED_MODULE_4__/* .warn */ .R8(m2);
1736
- _context4.next = 11;
1737
- break;
1738
- case 9:
1837
+ return _context5.abrupt("return", context);
1838
+ case 10:
1739
1839
  if (!(_t4 instanceof solid_logic__WEBPACK_IMPORTED_MODULE_3__.FetchError)) {
1740
- _context4.next = 10;
1840
+ _context5.next = 12;
1741
1841
  break;
1742
1842
  }
1743
- m2 = "Strange: Error ".concat(_t4.status, " trying to read your preference file.").concat(_t4.message);
1744
- (0,_log__WEBPACK_IMPORTED_MODULE_6__.alert)(m2);
1745
- _context4.next = 11;
1746
- break;
1747
- case 10:
1748
- throw new Error("(via loadPrefs) ".concat(_t4));
1843
+ if (!(_t4.status === 404)) {
1844
+ _context5.next = 11;
1845
+ break;
1846
+ }
1847
+ m2 = 'Your preferences file was not found (404). It may not exist yet.';
1848
+ context.preferencesFileError = m2;
1849
+ _debug__WEBPACK_IMPORTED_MODULE_4__/* .warn */ .R8(m2);
1850
+ missingPreferencesFileUri = getMissingPreferencesFileUri(context, _t4);
1851
+ if (missingPreferencesFileUri) {
1852
+ offerCreatePreferencesFile(context, missingPreferencesFileUri, m2);
1853
+ }
1854
+ return _context5.abrupt("return", context);
1749
1855
  case 11:
1750
- return _context4.abrupt("return", context);
1856
+ m2 = formatDynamicError(_t4, 'Error reading your preferences file');
1857
+ context.preferencesFileError = m2;
1858
+ _debug__WEBPACK_IMPORTED_MODULE_4__/* .warn */ .R8(m2);
1859
+ (0,_log__WEBPACK_IMPORTED_MODULE_6__.alert)(m2);
1860
+ return _context5.abrupt("return", context);
1751
1861
  case 12:
1862
+ m2 = formatDynamicError(_t4, 'Unexpected error while loading preferences');
1863
+ context.preferencesFileError = m2;
1864
+ _debug__WEBPACK_IMPORTED_MODULE_4__/* .error */ .z3(m2);
1865
+ return _context5.abrupt("return", context);
1866
+ case 13:
1867
+ return _context5.abrupt("return", context);
1868
+ case 14:
1752
1869
  case "end":
1753
- return _context4.stop();
1870
+ return _context5.stop();
1754
1871
  }
1755
- }, _callee4, null, [[1, 4]]);
1872
+ }, _callee5, null, [[1, 5]]);
1756
1873
  }));
1757
1874
  return _ensureLoadedPreferences.apply(this, arguments);
1758
1875
  }
1759
- function ensureLoadedProfile(_x2) {
1876
+ function ensureLoadedProfile(_x4) {
1760
1877
  return _ensureLoadedProfile.apply(this, arguments);
1761
1878
  }
1762
1879
 
@@ -1766,69 +1883,72 @@ function ensureLoadedProfile(_x2) {
1766
1883
  * leaving the `isPublic` param undefined will bring in community index things, too
1767
1884
  */
1768
1885
  function _ensureLoadedProfile() {
1769
- _ensureLoadedProfile = (0,_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(/*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().mark(function _callee5(context) {
1770
- var logInContext, _t5;
1771
- return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().wrap(function (_context5) {
1772
- while (1) switch (_context5.prev = _context5.next) {
1886
+ _ensureLoadedProfile = (0,_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(/*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().mark(function _callee6(context) {
1887
+ var logInContext, message, _message, _t5;
1888
+ return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().wrap(function (_context6) {
1889
+ while (1) switch (_context6.prev = _context6.next) {
1773
1890
  case 0:
1774
1891
  if (!context.publicProfile) {
1775
- _context5.next = 1;
1892
+ _context6.next = 1;
1776
1893
  break;
1777
1894
  }
1778
- return _context5.abrupt("return", context);
1895
+ return _context6.abrupt("return", context);
1779
1896
  case 1:
1780
- _context5.prev = 1;
1781
- _context5.next = 2;
1897
+ _context6.prev = 1;
1898
+ _context6.next = 2;
1782
1899
  return ensureLoggedIn(context);
1783
1900
  case 2:
1784
- logInContext = _context5.sent;
1901
+ logInContext = _context6.sent;
1785
1902
  if (logInContext.me) {
1786
- _context5.next = 3;
1903
+ _context6.next = 3;
1787
1904
  break;
1788
1905
  }
1789
- throw new Error('Could not log in');
1906
+ message = 'Could not log in; skipping profile load.';
1907
+ _debug__WEBPACK_IMPORTED_MODULE_4__/* .log */ .Rm(message);
1908
+ throw new Error(message);
1790
1909
  case 3:
1791
- _context5.next = 4;
1910
+ _context6.next = 4;
1792
1911
  return loadProfile(logInContext.me);
1793
1912
  case 4:
1794
- context.publicProfile = _context5.sent;
1795
- _context5.next = 6;
1913
+ context.publicProfile = _context6.sent;
1914
+ _context6.next = 6;
1796
1915
  break;
1797
1916
  case 5:
1798
- _context5.prev = 5;
1799
- _t5 = _context5["catch"](1);
1917
+ _context6.prev = 5;
1918
+ _t5 = _context6["catch"](1);
1919
+ _message = formatDynamicError(_t5, 'Unable to load your profile');
1800
1920
  if (context.div && context.dom) {
1801
- context.div.appendChild(_widgets__WEBPACK_IMPORTED_MODULE_11__/* .errorMessageBlock */ .F(context.dom, _t5.message));
1921
+ context.div.appendChild(_widgets__WEBPACK_IMPORTED_MODULE_11__/* .errorMessageBlock */ .F(context.dom, _message));
1802
1922
  }
1803
- throw new Error("Can't log in: ".concat(_t5));
1923
+ throw new Error(_message);
1804
1924
  case 6:
1805
- return _context5.abrupt("return", context);
1925
+ return _context6.abrupt("return", context);
1806
1926
  case 7:
1807
1927
  case "end":
1808
- return _context5.stop();
1928
+ return _context6.stop();
1809
1929
  }
1810
- }, _callee5, null, [[1, 5]]);
1930
+ }, _callee6, null, [[1, 5]]);
1811
1931
  }));
1812
1932
  return _ensureLoadedProfile.apply(this, arguments);
1813
1933
  }
1814
- function findAppInstances(_x3, _x4, _x5) {
1934
+ function findAppInstances(_x5, _x6, _x7) {
1815
1935
  return _findAppInstances.apply(this, arguments);
1816
1936
  }
1817
1937
  function _findAppInstances() {
1818
- _findAppInstances = (0,_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(/*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().mark(function _callee6(context, theClass, isPublic) {
1938
+ _findAppInstances = (0,_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(/*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().mark(function _callee7(context, theClass, isPublic) {
1819
1939
  var items, _t6;
1820
- return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().wrap(function (_context6) {
1821
- while (1) switch (_context6.prev = _context6.next) {
1940
+ return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().wrap(function (_context7) {
1941
+ while (1) switch (_context7.prev = _context7.next) {
1822
1942
  case 0:
1823
1943
  if (!context.me) {
1824
- _context6.next = 2;
1944
+ _context7.next = 2;
1825
1945
  break;
1826
1946
  }
1827
- _context6.next = 1;
1947
+ _context7.next = 1;
1828
1948
  return getScopedAppInstances(theClass, context.me);
1829
1949
  case 1:
1830
- _t6 = _context6.sent;
1831
- _context6.next = 3;
1950
+ _t6 = _context7.sent;
1951
+ _context7.next = 3;
1832
1952
  break;
1833
1953
  case 2:
1834
1954
  _t6 = [];
@@ -1847,12 +1967,12 @@ function _findAppInstances() {
1847
1967
  context.instances = items.map(function (item) {
1848
1968
  return item.instance;
1849
1969
  });
1850
- return _context6.abrupt("return", context);
1970
+ return _context7.abrupt("return", context);
1851
1971
  case 4:
1852
1972
  case "end":
1853
- return _context6.stop();
1973
+ return _context7.stop();
1854
1974
  }
1855
- }, _callee6);
1975
+ }, _callee7);
1856
1976
  }));
1857
1977
  return _findAppInstances.apply(this, arguments);
1858
1978
  }
@@ -1864,14 +1984,14 @@ function scopeLabel(context, scope) {
1864
1984
  /**
1865
1985
  * UI to control registration of instance
1866
1986
  */
1867
- function registrationControl(_x6, _x7, _x8) {
1987
+ function registrationControl(_x8, _x9, _x0) {
1868
1988
  return _registrationControl.apply(this, arguments);
1869
1989
  }
1870
1990
  function _registrationControl() {
1871
- _registrationControl = (0,_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(/*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().mark(function _callee7(context, instance, theClass) {
1991
+ _registrationControl = (0,_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(/*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().mark(function _callee8(context, instance, theClass) {
1872
1992
  var registrationStatements, renderScopeCheckbox, dom, box, me, scopes, msg, tbody, form, _iterator, _step, scope, row, _t7;
1873
- return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().wrap(function (_context7) {
1874
- while (1) switch (_context7.prev = _context7.next) {
1993
+ return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().wrap(function (_context8) {
1994
+ while (1) switch (_context8.prev = _context8.next) {
1875
1995
  case 0:
1876
1996
  renderScopeCheckbox = function _renderScopeCheckbox(scope) {
1877
1997
  var statements = registrationStatements(scope.index);
@@ -1887,7 +2007,7 @@ function _registrationControl() {
1887
2007
  /// / body of registrationControl
1888
2008
  dom = context.dom;
1889
2009
  if (!(!dom || !context.div)) {
1890
- _context7.next = 1;
2010
+ _context8.next = 1;
1891
2011
  break;
1892
2012
  }
1893
2013
  throw new Error('registrationControl: need dom and div');
@@ -1897,22 +2017,22 @@ function _registrationControl() {
1897
2017
  context.me = solid_logic__WEBPACK_IMPORTED_MODULE_3__.authn.currentUser(); // @@
1898
2018
  me = context.me;
1899
2019
  if (me) {
1900
- _context7.next = 2;
2020
+ _context8.next = 2;
1901
2021
  break;
1902
2022
  }
1903
2023
  box.innerHTML = '<p style="margin:2em;">(Log in to save a link to this)</p>';
1904
- return _context7.abrupt("return", context);
2024
+ return _context8.abrupt("return", context);
1905
2025
  case 2:
1906
- _context7.prev = 2;
1907
- _context7.next = 3;
2026
+ _context8.prev = 2;
2027
+ _context8.next = 3;
1908
2028
  return loadAllTypeIndexes(me);
1909
2029
  case 3:
1910
- scopes = _context7.sent;
1911
- _context7.next = 5;
2030
+ scopes = _context8.sent;
2031
+ _context8.next = 5;
1912
2032
  break;
1913
2033
  case 4:
1914
- _context7.prev = 4;
1915
- _t7 = _context7["catch"](2);
2034
+ _context8.prev = 4;
2035
+ _t7 = _context8["catch"](2);
1916
2036
  if (context.div && context.preferencesFileError) {
1917
2037
  msg = '(Lists of stuff not available)';
1918
2038
  context.div.appendChild(dom.createElement('p')).textContent = msg;
@@ -1921,7 +2041,7 @@ function _registrationControl() {
1921
2041
  context.div.appendChild(_widgets__WEBPACK_IMPORTED_MODULE_11__/* .errorMessageBlock */ .F(context.dom, _t7));
1922
2042
  }
1923
2043
  _debug__WEBPACK_IMPORTED_MODULE_4__/* .log */ .Rm(msg);
1924
- return _context7.abrupt("return", context);
2044
+ return _context8.abrupt("return", context);
1925
2045
  case 5:
1926
2046
  box.innerHTML = '<table><tbody></tbody></table>'; // tbody will be inserted anyway
1927
2047
  box.setAttribute('style', 'font-size: 120%; text-align: right; padding: 1em; border: solid gray 0.05em;');
@@ -1939,12 +2059,12 @@ function _registrationControl() {
1939
2059
  } finally {
1940
2060
  _iterator.f();
1941
2061
  }
1942
- return _context7.abrupt("return", context);
2062
+ return _context8.abrupt("return", context);
1943
2063
  case 6:
1944
2064
  case "end":
1945
- return _context7.stop();
2065
+ return _context8.stop();
1946
2066
  }
1947
- }, _callee7, null, [[2, 4]]);
2067
+ }, _callee8, null, [[2, 4]]);
1948
2068
  }));
1949
2069
  return _registrationControl.apply(this, arguments);
1950
2070
  }
@@ -1967,7 +2087,7 @@ function renderScopeHeadingRow(context, store, scope) {
1967
2087
  /**
1968
2088
  * UI to List at all registered things
1969
2089
  */
1970
- function registrationList(_x9, _x0) {
2090
+ function registrationList(_x1, _x10) {
1971
2091
  return _registrationList.apply(this, arguments);
1972
2092
  } // registrationList
1973
2093
 
@@ -1981,10 +2101,10 @@ function registrationList(_x9, _x0) {
1981
2101
  * @returns
1982
2102
  */
1983
2103
  function _registrationList() {
1984
- _registrationList = (0,_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(/*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().mark(function _callee9(context, options) {
2104
+ _registrationList = (0,_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(/*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().mark(function _callee0(context, options) {
1985
2105
  var dom, div, box, scopes, table, tbody, _iterator2, _step2, scope, headingRow, items, _iterator3, _step3, _loop, _t8, _t9;
1986
- return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().wrap(function (_context0) {
1987
- while (1) switch (_context0.prev = _context0.next) {
2106
+ return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().wrap(function (_context1) {
2107
+ while (1) switch (_context1.prev = _context1.next) {
1988
2108
  case 0:
1989
2109
  dom = context.dom;
1990
2110
  div = context.div;
@@ -1992,16 +2112,16 @@ function _registrationList() {
1992
2112
  div.appendChild(box);
1993
2113
  context.me = solid_logic__WEBPACK_IMPORTED_MODULE_3__.authn.currentUser(); // @@
1994
2114
  if (context.me) {
1995
- _context0.next = 1;
2115
+ _context1.next = 1;
1996
2116
  break;
1997
2117
  }
1998
2118
  box.innerHTML = '<p style="margin:2em;">(Log in list your stuff)</p>';
1999
- return _context0.abrupt("return", context);
2119
+ return _context1.abrupt("return", context);
2000
2120
  case 1:
2001
- _context0.next = 2;
2121
+ _context1.next = 2;
2002
2122
  return loadAllTypeIndexes(context.me);
2003
2123
  case 2:
2004
- scopes = _context0.sent;
2124
+ scopes = _context1.sent;
2005
2125
  // includes community indexes
2006
2126
 
2007
2127
  // console.log('@@ registrationList ', scopes)
@@ -2010,47 +2130,47 @@ function _registrationList() {
2010
2130
  table = box.firstChild;
2011
2131
  tbody = table.firstChild;
2012
2132
  _iterator2 = _createForOfIteratorHelper(scopes);
2013
- _context0.prev = 3;
2133
+ _context1.prev = 3;
2014
2134
  _iterator2.s();
2015
2135
  case 4:
2016
2136
  if ((_step2 = _iterator2.n()).done) {
2017
- _context0.next = 13;
2137
+ _context1.next = 13;
2018
2138
  break;
2019
2139
  }
2020
2140
  scope = _step2.value;
2021
2141
  // need some predicate for listing/adding agents
2022
2142
  headingRow = renderScopeHeadingRow(context, store, scope);
2023
2143
  tbody.appendChild(headingRow);
2024
- _context0.next = 5;
2144
+ _context1.next = 5;
2025
2145
  return getScopedAppsFromIndex(scope, options.type || null);
2026
2146
  case 5:
2027
- items = _context0.sent;
2147
+ items = _context1.sent;
2028
2148
  // any class
2029
2149
  if (items.length === 0) headingRow.style.display = 'none';
2030
2150
  // console.log(`registrationList: @@ instance items for class ${options.type || 'undefined' }:`, items)
2031
2151
  _iterator3 = _createForOfIteratorHelper(items);
2032
- _context0.prev = 6;
2152
+ _context1.prev = 6;
2033
2153
  _loop = /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().mark(function _loop() {
2034
2154
  var item, row;
2035
- return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().wrap(function (_context9) {
2036
- while (1) switch (_context9.prev = _context9.next) {
2155
+ return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().wrap(function (_context0) {
2156
+ while (1) switch (_context0.prev = _context0.next) {
2037
2157
  case 0:
2038
2158
  item = _step3.value;
2039
2159
  row = _widgets__WEBPACK_IMPORTED_MODULE_10__/* .personTR */ .Cl(dom, _ns__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .A.solid('instance'), item.instance, {
2040
2160
  deleteFunction: function () {
2041
- var _deleteFunction = (0,_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(/*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().mark(function _callee8() {
2042
- return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().wrap(function (_context8) {
2043
- while (1) switch (_context8.prev = _context8.next) {
2161
+ var _deleteFunction = (0,_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(/*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().mark(function _callee9() {
2162
+ return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().wrap(function (_context9) {
2163
+ while (1) switch (_context9.prev = _context9.next) {
2044
2164
  case 0:
2045
- _context8.next = 1;
2165
+ _context9.next = 1;
2046
2166
  return deleteTypeIndexRegistration(item);
2047
2167
  case 1:
2048
2168
  tbody.removeChild(row);
2049
2169
  case 2:
2050
2170
  case "end":
2051
- return _context8.stop();
2171
+ return _context9.stop();
2052
2172
  }
2053
- }, _callee8);
2173
+ }, _callee9);
2054
2174
  }));
2055
2175
  function deleteFunction() {
2056
2176
  return _deleteFunction.apply(this, arguments);
@@ -2062,52 +2182,52 @@ function _registrationList() {
2062
2182
  tbody.appendChild(row);
2063
2183
  case 1:
2064
2184
  case "end":
2065
- return _context9.stop();
2185
+ return _context0.stop();
2066
2186
  }
2067
2187
  }, _loop);
2068
2188
  });
2069
2189
  _iterator3.s();
2070
2190
  case 7:
2071
2191
  if ((_step3 = _iterator3.n()).done) {
2072
- _context0.next = 9;
2192
+ _context1.next = 9;
2073
2193
  break;
2074
2194
  }
2075
- return _context0.delegateYield(_loop(), "t0", 8);
2195
+ return _context1.delegateYield(_loop(), "t0", 8);
2076
2196
  case 8:
2077
- _context0.next = 7;
2197
+ _context1.next = 7;
2078
2198
  break;
2079
2199
  case 9:
2080
- _context0.next = 11;
2200
+ _context1.next = 11;
2081
2201
  break;
2082
2202
  case 10:
2083
- _context0.prev = 10;
2084
- _t8 = _context0["catch"](6);
2203
+ _context1.prev = 10;
2204
+ _t8 = _context1["catch"](6);
2085
2205
  _iterator3.e(_t8);
2086
2206
  case 11:
2087
- _context0.prev = 11;
2207
+ _context1.prev = 11;
2088
2208
  _iterator3.f();
2089
- return _context0.finish(11);
2209
+ return _context1.finish(11);
2090
2210
  case 12:
2091
- _context0.next = 4;
2211
+ _context1.next = 4;
2092
2212
  break;
2093
2213
  case 13:
2094
- _context0.next = 15;
2214
+ _context1.next = 15;
2095
2215
  break;
2096
2216
  case 14:
2097
- _context0.prev = 14;
2098
- _t9 = _context0["catch"](3);
2217
+ _context1.prev = 14;
2218
+ _t9 = _context1["catch"](3);
2099
2219
  _iterator2.e(_t9);
2100
2220
  case 15:
2101
- _context0.prev = 15;
2221
+ _context1.prev = 15;
2102
2222
  _iterator2.f();
2103
- return _context0.finish(15);
2223
+ return _context1.finish(15);
2104
2224
  case 16:
2105
- return _context0.abrupt("return", context);
2225
+ return _context1.abrupt("return", context);
2106
2226
  case 17:
2107
2227
  case "end":
2108
- return _context0.stop();
2228
+ return _context1.stop();
2109
2229
  }
2110
- }, _callee9, null, [[3, 14, 15, 16], [6, 10, 11, 12]]);
2230
+ }, _callee0, null, [[3, 14, 15, 16], [6, 10, 11, 12]]);
2111
2231
  }));
2112
2232
  return _registrationList.apply(this, arguments);
2113
2233
  }
@@ -2238,7 +2358,7 @@ function renderSignInPopup(dom) {
2238
2358
  }
2239
2359
  }, _callee, null, [[0, 2]]);
2240
2360
  }));
2241
- return function loginToIssuer(_x1) {
2361
+ return function loginToIssuer(_x11) {
2242
2362
  return _ref.apply(this, arguments);
2243
2363
  };
2244
2364
  }();
@@ -2485,7 +2605,7 @@ function selectWorkspace(dom, appDetails, callbackWS) {
2485
2605
  }
2486
2606
  function displayOptions(context) {
2487
2607
  // console.log('displayOptions!', context)
2488
- function makeNewWorkspace(_x10) {
2608
+ function makeNewWorkspace(_x12) {
2489
2609
  return _makeNewWorkspace.apply(this, arguments);
2490
2610
  } // const status = ''
2491
2611
  function _makeNewWorkspace() {
@@ -2721,60 +2841,67 @@ function getUserRoles() {
2721
2841
  * Filters which panes should be available, based on the result of [[getUserRoles]]
2722
2842
  */
2723
2843
  function _getUserRoles() {
2724
- _getUserRoles = (0,_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(/*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().mark(function _callee0() {
2725
- var _yield$ensureLoadedPr, me, preferencesFile, preferencesFileError, _t0;
2726
- return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().wrap(function (_context1) {
2727
- while (1) switch (_context1.prev = _context1.next) {
2844
+ _getUserRoles = (0,_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(/*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().mark(function _callee1() {
2845
+ var _yield$ensureLoadedPr, me, preferencesFile, preferencesFileError, authState, _t0;
2846
+ return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().wrap(function (_context10) {
2847
+ while (1) switch (_context10.prev = _context10.next) {
2728
2848
  case 0:
2729
- _context1.prev = 0;
2730
- _context1.next = 1;
2849
+ _context10.prev = 0;
2850
+ _context10.next = 1;
2731
2851
  return ensureLoadedPreferences({});
2732
2852
  case 1:
2733
- _yield$ensureLoadedPr = _context1.sent;
2853
+ _yield$ensureLoadedPr = _context10.sent;
2734
2854
  me = _yield$ensureLoadedPr.me;
2735
2855
  preferencesFile = _yield$ensureLoadedPr.preferencesFile;
2736
2856
  preferencesFileError = _yield$ensureLoadedPr.preferencesFileError;
2737
- if (!(!preferencesFile || preferencesFileError)) {
2738
- _context1.next = 2;
2857
+ if (!preferencesFileError) {
2858
+ _context10.next = 2;
2739
2859
  break;
2740
2860
  }
2741
2861
  throw new Error(preferencesFileError);
2742
2862
  case 2:
2743
- return _context1.abrupt("return", solid_logic__WEBPACK_IMPORTED_MODULE_3__.solidLogicSingleton.store.each(me, _ns__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .A.rdf('type'), null, preferencesFile.doc()));
2863
+ if (preferencesFile) {
2864
+ _context10.next = 3;
2865
+ break;
2866
+ }
2867
+ authState = me ? "logged in as ".concat(me.value || me.uri) : 'not logged in';
2868
+ throw new Error("Preferences file unavailable (".concat(authState, ")"));
2744
2869
  case 3:
2745
- _context1.prev = 3;
2746
- _t0 = _context1["catch"](0);
2747
- _debug__WEBPACK_IMPORTED_MODULE_4__/* .warn */ .R8('Unable to fetch your preferences - this was the error: ', _t0);
2748
- return _context1.abrupt("return", []);
2870
+ return _context10.abrupt("return", solid_logic__WEBPACK_IMPORTED_MODULE_3__.solidLogicSingleton.store.each(me, _ns__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .A.rdf('type'), null, preferencesFile.doc()));
2749
2871
  case 4:
2872
+ _context10.prev = 4;
2873
+ _t0 = _context10["catch"](0);
2874
+ _debug__WEBPACK_IMPORTED_MODULE_4__/* .warn */ .R8(formatDynamicError(_t0, 'Unable to fetch your preferences'));
2875
+ return _context10.abrupt("return", []);
2876
+ case 5:
2750
2877
  case "end":
2751
- return _context1.stop();
2878
+ return _context10.stop();
2752
2879
  }
2753
- }, _callee0, null, [[0, 3]]);
2880
+ }, _callee1, null, [[0, 4]]);
2754
2881
  }));
2755
2882
  return _getUserRoles.apply(this, arguments);
2756
2883
  }
2757
- function filterAvailablePanes(_x11) {
2884
+ function filterAvailablePanes(_x13) {
2758
2885
  return _filterAvailablePanes.apply(this, arguments);
2759
2886
  }
2760
2887
  function _filterAvailablePanes() {
2761
- _filterAvailablePanes = (0,_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(/*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().mark(function _callee1(panes) {
2888
+ _filterAvailablePanes = (0,_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(/*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().mark(function _callee10(panes) {
2762
2889
  var userRoles;
2763
- return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().wrap(function (_context10) {
2764
- while (1) switch (_context10.prev = _context10.next) {
2890
+ return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().wrap(function (_context11) {
2891
+ while (1) switch (_context11.prev = _context11.next) {
2765
2892
  case 0:
2766
- _context10.next = 1;
2893
+ _context11.next = 1;
2767
2894
  return getUserRoles();
2768
2895
  case 1:
2769
- userRoles = _context10.sent;
2770
- return _context10.abrupt("return", panes.filter(function (pane) {
2896
+ userRoles = _context11.sent;
2897
+ return _context11.abrupt("return", panes.filter(function (pane) {
2771
2898
  return isMatchingAudience(pane, userRoles);
2772
2899
  }));
2773
2900
  case 2:
2774
2901
  case "end":
2775
- return _context10.stop();
2902
+ return _context11.stop();
2776
2903
  }
2777
- }, _callee1);
2904
+ }, _callee10);
2778
2905
  }));
2779
2906
  return _filterAvailablePanes.apply(this, arguments);
2780
2907
  }
@@ -4572,31 +4699,9 @@ _forms_fieldFunction__WEBPACK_IMPORTED_MODULE_4__/* .field */ .ZZ[_ns__WEBPACK_I
4572
4699
  if (!ok) return callbackFunction(ok, body);
4573
4700
  return callbackFunction(ok, body);
4574
4701
  };
4575
- // Create container for label and select
4576
- var outerBox = dom.createElement('div');
4577
- outerBox.setAttribute('class', 'classifierBox');
4578
- // Render label
4579
- var labelDiv = dom.createElement('div');
4580
- labelDiv.setAttribute('class', 'formFieldName classifierBox-label');
4581
- // Use fieldLabel to render ui:label if present
4582
- labelDiv.appendChild((0,_forms_basic__WEBPACK_IMPORTED_MODULE_8__/* .fieldLabel */ .bk)(dom, category, form));
4583
- outerBox.appendChild(labelDiv);
4584
- // Render select
4585
- var selectBox = dom.createElement('div');
4586
- selectBox.setAttribute('class', 'formFieldValue classifierBox-selectBox');
4587
- var selectElement = makeSelectForNestedCategory(dom, kb, subject, category, dataDoc, checkOptions);
4588
- // Set readonly if not editable
4589
- if (selectElement && selectElement.querySelector && selectElement.querySelector('select')) {
4590
- var select = selectElement.querySelector('select');
4591
- if (select && !kb.updater.editable(dataDoc.uri)) {
4592
- select.readOnly = true;
4593
- select.style = _style__WEBPACK_IMPORTED_MODULE_10__/* .style */ .i.textInputStyleUneditable;
4594
- }
4595
- }
4596
- selectBox.appendChild(selectElement);
4597
- outerBox.appendChild(selectBox);
4598
- if (container) container.appendChild(outerBox);
4599
- return outerBox;
4702
+ var box = makeSelectForNestedCategory(dom, kb, subject, category, dataDoc, checkOptions);
4703
+ if (container) container.appendChild(box);
4704
+ return box;
4600
4705
  };
4601
4706
 
4602
4707
  /** Choice field
@@ -18744,7 +18849,7 @@ function tabWidget(options) {
18744
18849
  _getColors2 = (0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(_getColors, 2),
18745
18850
  selectedColor = _getColors2[0],
18746
18851
  color = _getColors2[1];
18747
- var bodyMainStyle = "display: grid; width: auto; height: 100%; border: 0.1em; border-style: solid; border-color: ".concat(selectedColor, "; padding: 1em;");
18852
+ var bodyMainStyle = "flex: 2; width: auto; height: 100%; border: 0.1em; border-style: solid; border-color: ".concat(selectedColor, "; padding: 1em;");
18748
18853
  var rootElement = dom.createElement('div'); // 20200117a
18749
18854
 
18750
18855
  rootElement.setAttribute('style', _style__WEBPACK_IMPORTED_MODULE_9__/* .style */ .i.tabsRootElement);