solid-ui 2.4.27-4665661f → 2.4.27-4b2a53e1

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.
Files changed (68) hide show
  1. package/dist/670.solid-ui.min.js +1 -0
  2. package/dist/805.solid-ui.min.js +3 -0
  3. package/dist/805.solid-ui.min.js.LICENSE.txt +58 -0
  4. package/dist/805.solid-ui.min.js.map +1 -0
  5. package/dist/_2b19.solid-ui.js +14 -0
  6. package/dist/_2b19.solid-ui.js.map +1 -0
  7. package/dist/index.html +1 -9
  8. package/dist/{main.js → solid-ui.js} +3118 -19423
  9. package/dist/solid-ui.js.map +1 -0
  10. package/dist/solid-ui.min.js +3 -0
  11. package/dist/solid-ui.min.js.LICENSE.txt +50 -0
  12. package/dist/solid-ui.min.js.map +1 -0
  13. package/dist/vendors-node_modules_jsonld_lib_jsonld_js.solid-ui.js +12134 -0
  14. package/dist/vendors-node_modules_jsonld_lib_jsonld_js.solid-ui.js.map +1 -0
  15. package/lib/acl/access-controller.d.ts +2 -3
  16. package/lib/acl/access-controller.d.ts.map +1 -1
  17. package/lib/acl/access-controller.js +17 -15
  18. package/lib/acl/access-controller.js.map +1 -1
  19. package/lib/acl/access-groups.d.ts.map +1 -1
  20. package/lib/acl/access-groups.js +78 -8
  21. package/lib/acl/access-groups.js.map +1 -1
  22. package/lib/acl/acl-control.d.ts.map +1 -1
  23. package/lib/acl/acl-control.js +10 -11
  24. package/lib/acl/acl-control.js.map +1 -1
  25. package/lib/acl/acl.d.ts +1 -1
  26. package/lib/acl/acl.js +1 -1
  27. package/lib/acl/acl.js.map +1 -1
  28. package/lib/acl/add-agent-buttons.d.ts.map +1 -1
  29. package/lib/acl/add-agent-buttons.js +4 -3
  30. package/lib/acl/add-agent-buttons.js.map +1 -1
  31. package/lib/footer/index.d.ts.map +1 -1
  32. package/lib/footer/index.js +5 -1
  33. package/lib/footer/index.js.map +1 -1
  34. package/lib/header/index.d.ts.map +1 -1
  35. package/lib/header/index.js +41 -20
  36. package/lib/header/index.js.map +1 -1
  37. package/lib/login/login.d.ts.map +1 -1
  38. package/lib/login/login.js +69 -78
  39. package/lib/login/login.js.map +1 -1
  40. package/lib/style.js +60 -2
  41. package/lib/style.js.map +1 -1
  42. package/lib/utils/headerFooterHelpers.d.ts +0 -4
  43. package/lib/utils/headerFooterHelpers.d.ts.map +1 -1
  44. package/lib/utils/headerFooterHelpers.js +0 -27
  45. package/lib/utils/headerFooterHelpers.js.map +1 -1
  46. package/lib/versionInfo.js +5 -5
  47. package/lib/versionInfo.js.map +1 -1
  48. package/lib/widgets/buttons.d.ts.map +1 -1
  49. package/lib/widgets/buttons.js +43 -49
  50. package/lib/widgets/buttons.js.map +1 -1
  51. package/package.json +10 -10
  52. package/dist/main.js.map +0 -1
  53. package/lib/acl/styles.d.ts +0 -90
  54. package/lib/acl/styles.d.ts.map +0 -1
  55. package/lib/acl/styles.js +0 -98
  56. package/lib/acl/styles.js.map +0 -1
  57. package/lib/footer/styleMap.d.ts +0 -8
  58. package/lib/footer/styleMap.d.ts.map +0 -1
  59. package/lib/footer/styleMap.js +0 -15
  60. package/lib/footer/styleMap.js.map +0 -1
  61. package/lib/header/styleMap.d.ts +0 -117
  62. package/lib/header/styleMap.d.ts.map +0 -1
  63. package/lib/header/styleMap.js +0 -139
  64. package/lib/header/styleMap.js.map +0 -1
  65. package/lib/jss/index.d.ts +0 -20
  66. package/lib/jss/index.d.ts.map +0 -1
  67. package/lib/jss/index.js +0 -47
  68. package/lib/jss/index.js.map +0 -1
@@ -24,10 +24,10 @@ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/
24
24
  var _rdflib = require("rdflib");
25
25
  var _solidLogic = require("solid-logic");
26
26
  var debug = _interopRequireWildcard(require("../debug"));
27
+ var style = _interopRequireWildcard(require("../style"));
27
28
  var _log = require("../log");
28
29
  var ns = _interopRequireWildcard(require("../ns.js"));
29
30
  var _signup = require("../signup/signup.js");
30
- var _style = require("../style");
31
31
  var utils = _interopRequireWildcard(require("../utils"));
32
32
  var widgets = _interopRequireWildcard(require("../widgets"));
33
33
  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); }
@@ -100,104 +100,93 @@ function ensureLoadedPreferences(_x) {
100
100
  // used to be logInLoadProfile
101
101
  function _ensureLoadedPreferences() {
102
102
  _ensureLoadedPreferences = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(context) {
103
- var statusArea, progressDisplay, complain, preferencesFile, m2;
103
+ var progressDisplay, preferencesFile, m2;
104
104
  return _regenerator["default"].wrap(function _callee4$(_context4) {
105
105
  while (1) switch (_context4.prev = _context4.next) {
106
106
  case 0:
107
- complain = function _complain(message) {
108
- message = "ensureLoadedPreferences: ".concat(message);
109
- if (statusArea) {
110
- // statusArea.innerHTML = ''
111
- statusArea.appendChild(widgets.errorMessageBlock(context.dom, message));
112
- }
113
- debug.log(message);
114
- // reject(new Error(message))
115
- };
116
107
  if (!context.preferencesFile) {
117
- _context4.next = 3;
108
+ _context4.next = 2;
118
109
  break;
119
110
  }
120
111
  return _context4.abrupt("return", Promise.resolve(context));
121
- case 3:
122
- // already done
123
- statusArea = context.statusArea || context.div || null;
124
- _context4.prev = 4;
125
- _context4.next = 7;
112
+ case 2:
113
+ _context4.prev = 2;
114
+ _context4.next = 5;
126
115
  return ensureLoadedProfile(context);
127
- case 7:
116
+ case 5:
128
117
  context = _context4.sent;
129
- _context4.next = 10;
118
+ _context4.next = 8;
130
119
  return loadPreferences(context.me);
131
- case 10:
120
+ case 8:
132
121
  preferencesFile = _context4.sent;
133
122
  if (progressDisplay) {
134
123
  progressDisplay.parentNode.removeChild(progressDisplay);
135
124
  }
136
125
  context.preferencesFile = preferencesFile;
137
- _context4.next = 51;
126
+ _context4.next = 49;
138
127
  break;
139
- case 15:
140
- _context4.prev = 15;
141
- _context4.t0 = _context4["catch"](4);
128
+ case 13:
129
+ _context4.prev = 13;
130
+ _context4.t0 = _context4["catch"](2);
142
131
  if (!(_context4.t0 instanceof _solidLogic.UnauthorizedError)) {
143
- _context4.next = 22;
132
+ _context4.next = 20;
144
133
  break;
145
134
  }
146
135
  m2 = 'Ooops - you are not authenticated (properly logged in) to for me to read your preference file. Try loggin out and logging in?';
147
136
  (0, _log.alert)(m2);
148
- _context4.next = 51;
137
+ _context4.next = 49;
149
138
  break;
150
- case 22:
139
+ case 20:
151
140
  if (!(_context4.t0 instanceof _solidLogic.CrossOriginForbiddenError)) {
152
- _context4.next = 28;
141
+ _context4.next = 26;
153
142
  break;
154
143
  }
155
144
  m2 = "Unauthorized: Assuming preference file blocked for origin ".concat(window.location.origin);
156
145
  context.preferencesFileError = m2;
157
146
  return _context4.abrupt("return", context);
158
- case 28:
147
+ case 26:
159
148
  if (!(_context4.t0 instanceof _solidLogic.SameOriginForbiddenError)) {
160
- _context4.next = 34;
149
+ _context4.next = 32;
161
150
  break;
162
151
  }
163
152
  m2 = 'You are not authorized to read your preference file. This may be because you are using an untrusted web app.';
164
153
  debug.warn(m2);
165
154
  return _context4.abrupt("return", context);
166
- case 34:
155
+ case 32:
167
156
  if (!(_context4.t0 instanceof _solidLogic.NotEditableError)) {
168
- _context4.next = 40;
157
+ _context4.next = 38;
169
158
  break;
170
159
  }
171
160
  m2 = 'You are not authorized to edit your preference file. This may be because you are using an untrusted web app.';
172
161
  debug.warn(m2);
173
162
  return _context4.abrupt("return", context);
174
- case 40:
163
+ case 38:
175
164
  if (!(_context4.t0 instanceof _solidLogic.WebOperationError)) {
176
- _context4.next = 45;
165
+ _context4.next = 43;
177
166
  break;
178
167
  }
179
168
  m2 = 'You are not authorized to edit your preference file. This may be because you are using an untrusted web app.';
180
169
  debug.warn(m2);
181
- _context4.next = 51;
170
+ _context4.next = 49;
182
171
  break;
183
- case 45:
172
+ case 43:
184
173
  if (!(_context4.t0 instanceof _solidLogic.FetchError)) {
185
- _context4.next = 50;
174
+ _context4.next = 48;
186
175
  break;
187
176
  }
188
177
  m2 = "Strange: Error ".concat(_context4.t0.status, " trying to read your preference file.").concat(_context4.t0.message);
189
178
  (0, _log.alert)(m2);
190
- _context4.next = 51;
179
+ _context4.next = 49;
191
180
  break;
192
- case 50:
181
+ case 48:
193
182
  throw new Error("(via loadPrefs) ".concat(_context4.t0));
194
- case 51:
183
+ case 49:
195
184
  return _context4.abrupt("return", context);
196
- case 52:
185
+ case 50:
197
186
  case "end":
198
187
  return _context4.stop();
199
188
  }
200
- }, _callee4, null, [[4, 15]]);
189
+ }, _callee4, null, [[2, 13]]);
201
190
  }));
202
191
  return _ensureLoadedPreferences.apply(this, arguments);
203
192
  }
@@ -562,21 +551,19 @@ function signInOrSignUpBox(dom, setUserCallback) {
562
551
  var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
563
552
  options = options || {};
564
553
  var signInButtonStyle = options.buttonStyle || getDefaultSignInButtonStyle();
565
-
566
- // @@ TODO Remove the need to cast HTML element to any
567
554
  var box = dom.createElement('div');
568
555
  var magicClassName = 'SolidSignInOrSignUpBox';
569
556
  debug.log('widgets.signInOrSignUpBox');
570
557
  box.setUserCallback = setUserCallback;
571
558
  box.setAttribute('class', magicClassName);
572
- box.style = 'display:flex;'; // @@ fix all typecasts like this
559
+ box.setAttribute('style', 'display:flex;');
573
560
 
574
561
  // Sign in button with PopUP
575
562
  var signInPopUpButton = dom.createElement('input'); // multi
576
563
  box.appendChild(signInPopUpButton);
577
564
  signInPopUpButton.setAttribute('type', 'button');
578
565
  signInPopUpButton.setAttribute('value', 'Log in');
579
- signInPopUpButton.setAttribute('style', "".concat(signInButtonStyle, "background-color: #eef;"));
566
+ signInPopUpButton.setAttribute('style', "".concat(signInButtonStyle, "background-color: #eef;").concat(style.headerBannerLoginInput));
580
567
  _solidLogic.authSession.onLogin(function () {
581
568
  var me = _solidLogic.authn.currentUser();
582
569
  // const sessionInfo = authSession.info
@@ -617,7 +604,7 @@ function signInOrSignUpBox(dom, setUserCallback) {
617
604
  box.appendChild(signupButton);
618
605
  signupButton.setAttribute('type', 'button');
619
606
  signupButton.setAttribute('value', 'Sign Up for Solid');
620
- signupButton.setAttribute('style', "".concat(signInButtonStyle, "background-color: #efe;"));
607
+ signupButton.setAttribute('style', "".concat(signInButtonStyle, "background-color: #efe;").concat(style.headerBannerLoginInput));
621
608
  signupButton.addEventListener('click', function (_event) {
622
609
  var signupMgr = new _signup.Signup();
623
610
  signupMgr.signup().then(function (uri) {
@@ -658,6 +645,8 @@ function renderSignInPopup(dom) {
658
645
  while (1) switch (_context.prev = _context.next) {
659
646
  case 0:
660
647
  _context.prev = 0;
648
+ // clear authorization metadata from store
649
+ _solidLogic.solidLogicSingleton.store.updater.flagAuthorizationMetadata();
661
650
  // Save hash
662
651
  preLoginRedirectHash = new URL(window.location.href).hash;
663
652
  if (preLoginRedirectHash) {
@@ -667,23 +656,23 @@ function renderSignInPopup(dom) {
667
656
  // Login
668
657
  locationUrl = new URL(window.location.href);
669
658
  locationUrl.hash = ''; // remove hash part
670
- _context.next = 8;
659
+ _context.next = 9;
671
660
  return _solidLogic.authSession.login({
672
661
  redirectUrl: locationUrl.href,
673
662
  oidcIssuer: issuerUri
674
663
  });
675
- case 8:
676
- _context.next = 13;
664
+ case 9:
665
+ _context.next = 14;
677
666
  break;
678
- case 10:
679
- _context.prev = 10;
667
+ case 11:
668
+ _context.prev = 11;
680
669
  _context.t0 = _context["catch"](0);
681
670
  (0, _log.alert)(_context.t0.message);
682
- case 13:
671
+ case 14:
683
672
  case "end":
684
673
  return _context.stop();
685
674
  }
686
- }, _callee, null, [[0, 10]]);
675
+ }, _callee, null, [[0, 11]]);
687
676
  }));
688
677
  return function loginToIssuer(_x11) {
689
678
  return _ref.apply(this, arguments);
@@ -835,45 +824,47 @@ _solidLogic.authSession.onLogout( /*#__PURE__*/(0, _asyncToGenerator2["default"]
835
824
  case 0:
836
825
  issuer = window.localStorage.getItem('loginIssuer');
837
826
  if (!issuer) {
838
- _context2.next = 19;
827
+ _context2.next = 20;
839
828
  break;
840
829
  }
841
830
  _context2.prev = 2;
831
+ // clear authorization metadata from store
832
+ _solidLogic.solidLogicSingleton.store.updater.flagAuthorizationMetadata();
842
833
  wellKnownUri = new URL(issuer);
843
834
  wellKnownUri.pathname = '/.well-known/openid-configuration';
844
- _context2.next = 7;
835
+ _context2.next = 8;
845
836
  return fetch(wellKnownUri.toString());
846
- case 7:
837
+ case 8:
847
838
  wellKnownResult = _context2.sent;
848
839
  if (!(wellKnownResult.status === 200)) {
849
- _context2.next = 15;
840
+ _context2.next = 16;
850
841
  break;
851
842
  }
852
- _context2.next = 11;
843
+ _context2.next = 12;
853
844
  return wellKnownResult.json();
854
- case 11:
845
+ case 12:
855
846
  openidConfiguration = _context2.sent;
856
847
  if (!(openidConfiguration && openidConfiguration.end_session_endpoint)) {
857
- _context2.next = 15;
848
+ _context2.next = 16;
858
849
  break;
859
850
  }
860
- _context2.next = 15;
851
+ _context2.next = 16;
861
852
  return fetch(openidConfiguration.end_session_endpoint, {
862
853
  credentials: 'include'
863
854
  });
864
- case 15:
865
- _context2.next = 19;
855
+ case 16:
856
+ _context2.next = 20;
866
857
  break;
867
- case 17:
868
- _context2.prev = 17;
858
+ case 18:
859
+ _context2.prev = 18;
869
860
  _context2.t0 = _context2["catch"](2);
870
- case 19:
871
- window.location.reload();
872
861
  case 20:
862
+ window.location.reload();
863
+ case 21:
873
864
  case "end":
874
865
  return _context2.stop();
875
866
  }
876
- }, _callee2, null, [[2, 17]]);
867
+ }, _callee2, null, [[2, 18]]);
877
868
  })));
878
869
 
879
870
  /**
@@ -1008,12 +999,12 @@ function selectWorkspace(dom, appDetails, callbackWS) {
1008
999
  box.appendChild(dom.createElement('hr')); // @@
1009
1000
 
1010
1001
  var p = box.appendChild(dom.createElement('p'));
1011
- p.style = _style.commentStyle;
1002
+ p.setAttribute('style', style.commentStyle);
1012
1003
  p.textContent = "Where would you like to store the data for the ".concat(noun, "?\n Give the URL of the folder where you would like the data stored.\n It can be anywhere in solid world - this URI is just an idea.");
1013
1004
  // @@ TODO Remove the need to cast baseField to any
1014
1005
  var baseField = box.appendChild(dom.createElement('input'));
1015
1006
  baseField.setAttribute('type', 'text');
1016
- baseField.style = _style.textInputStyle;
1007
+ baseField.setAttribute('style', style.textInputStyle);
1017
1008
  baseField.size = 80; // really a string
1018
1009
  baseField.label = 'base URL';
1019
1010
  baseField.autocomplete = 'on';
@@ -1025,7 +1016,7 @@ function selectWorkspace(dom, appDetails, callbackWS) {
1025
1016
  box.appendChild(dom.createElement('br')); // @@
1026
1017
 
1027
1018
  var button = box.appendChild(dom.createElement('button'));
1028
- button.style = _style.buttonStyle;
1019
+ button.setAttribute('style', style.buttonStyle);
1029
1020
  button.textContent = "Start new ".concat(noun, " at this URI");
1030
1021
  button.addEventListener('click', function (_event) {
1031
1022
  var newBase = baseField.value.replace(' ', '%20'); // do not re-encode in general, as % encodings may exist
@@ -1043,7 +1034,7 @@ function selectWorkspace(dom, appDetails, callbackWS) {
1043
1034
  // Ignore master workspaces
1044
1035
  ns.space('MasterWorkspace'));
1045
1036
  });
1046
- var col1, col2, col3, tr, ws, style, comment;
1037
+ var col1, col2, col3, tr, ws, localStyle, comment;
1047
1038
  var cellStyle = 'height: 3em; margin: 1em; padding: 1em white; border-radius: 0.3em;';
1048
1039
  var deselectedStyle = "".concat(cellStyle, "border: 0px;");
1049
1040
  // const selectedStyle = cellStyle + 'border: 1px solid black;'
@@ -1058,8 +1049,8 @@ function selectWorkspace(dom, appDetails, callbackWS) {
1058
1049
  tr.appendChild(col1);
1059
1050
  }
1060
1051
  col2 = dom.createElement('td');
1061
- style = _solidLogic.solidLogicSingleton.store.anyValue(ws, ns.ui('style'));
1062
- if (!style) {
1052
+ localStyle = _solidLogic.solidLogicSingleton.store.anyValue(ws, ns.ui('style'));
1053
+ if (!localStyle) {
1063
1054
  // Otherwise make up arbitrary colour
1064
1055
  var hash = function hash(x) {
1065
1056
  return x.split('').reduce(function (a, b) {
@@ -1068,9 +1059,9 @@ function selectWorkspace(dom, appDetails, callbackWS) {
1068
1059
  }, 0);
1069
1060
  };
1070
1061
  var bgcolor = "#".concat((hash(ws.uri) & 0xffffff | 0xc0c0c0).toString(16)); // c0c0c0 forces pale
1071
- style = "color: black ; background-color: ".concat(bgcolor, ";");
1062
+ localStyle = "color: black ; background-color: ".concat(bgcolor, ";");
1072
1063
  }
1073
- col2.setAttribute('style', deselectedStyle + style);
1064
+ col2.setAttribute('style', deselectedStyle + localStyle);
1074
1065
  tr.target = ws.uri;
1075
1066
  var label = _solidLogic.solidLogicSingleton.store.any(ws, ns.rdfs('label'));
1076
1067
  if (!label) {
@@ -1090,7 +1081,7 @@ function selectWorkspace(dom, appDetails, callbackWS) {
1090
1081
  comment = comment ? comment.value : 'Use this workspace';
1091
1082
  col2.addEventListener('click', function (_event) {
1092
1083
  col3.textContent = comment ? comment.value : '';
1093
- col3.setAttribute('style', deselectedStyle + style);
1084
+ col3.setAttribute('style', deselectedStyle + localStyle);
1094
1085
  var button = dom.createElement('button');
1095
1086
  button.textContent = 'Continue';
1096
1087
  // button.setAttribute('style', style);