solid-ui 2.4.27-8c4294a2 → 2.4.27-8e7523bf

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/solid-ui.js +2933 -19340
  8. package/dist/solid-ui.js.map +1 -1
  9. package/dist/solid-ui.min.js +1 -1
  10. package/dist/solid-ui.min.js.LICENSE.txt +0 -67
  11. package/dist/solid-ui.min.js.map +1 -1
  12. package/dist/vendors-node_modules_jsonld_lib_jsonld_js.solid-ui.js +12134 -0
  13. package/dist/vendors-node_modules_jsonld_lib_jsonld_js.solid-ui.js.map +1 -0
  14. package/lib/acl/access-controller.d.ts +2 -3
  15. package/lib/acl/access-controller.d.ts.map +1 -1
  16. package/lib/acl/access-controller.js +17 -15
  17. package/lib/acl/access-controller.js.map +1 -1
  18. package/lib/acl/access-groups.d.ts.map +1 -1
  19. package/lib/acl/access-groups.js +78 -8
  20. package/lib/acl/access-groups.js.map +1 -1
  21. package/lib/acl/acl-control.d.ts.map +1 -1
  22. package/lib/acl/acl-control.js +10 -11
  23. package/lib/acl/acl-control.js.map +1 -1
  24. package/lib/acl/acl.d.ts +1 -1
  25. package/lib/acl/acl.js +1 -1
  26. package/lib/acl/acl.js.map +1 -1
  27. package/lib/acl/add-agent-buttons.d.ts.map +1 -1
  28. package/lib/acl/add-agent-buttons.js +4 -3
  29. package/lib/acl/add-agent-buttons.js.map +1 -1
  30. package/lib/footer/index.d.ts.map +1 -1
  31. package/lib/footer/index.js +5 -1
  32. package/lib/footer/index.js.map +1 -1
  33. package/lib/header/index.d.ts.map +1 -1
  34. package/lib/header/index.js +41 -20
  35. package/lib/header/index.js.map +1 -1
  36. package/lib/login/login.d.ts.map +1 -1
  37. package/lib/login/login.js +43 -56
  38. package/lib/login/login.js.map +1 -1
  39. package/lib/style.js +60 -2
  40. package/lib/style.js.map +1 -1
  41. package/lib/utils/headerFooterHelpers.d.ts +0 -4
  42. package/lib/utils/headerFooterHelpers.d.ts.map +1 -1
  43. package/lib/utils/headerFooterHelpers.js +0 -27
  44. package/lib/utils/headerFooterHelpers.js.map +1 -1
  45. package/lib/versionInfo.js +5 -5
  46. package/lib/versionInfo.js.map +1 -1
  47. package/lib/widgets/buttons.d.ts.map +1 -1
  48. package/lib/widgets/buttons.js +43 -49
  49. package/lib/widgets/buttons.js.map +1 -1
  50. package/lib/widgets/forms.js +8 -4
  51. package/lib/widgets/forms.js.map +1 -1
  52. package/package.json +6 -7
  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) {
@@ -1012,12 +999,12 @@ function selectWorkspace(dom, appDetails, callbackWS) {
1012
999
  box.appendChild(dom.createElement('hr')); // @@
1013
1000
 
1014
1001
  var p = box.appendChild(dom.createElement('p'));
1015
- p.style = _style.commentStyle;
1002
+ p.setAttribute('style', style.commentStyle);
1016
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.");
1017
1004
  // @@ TODO Remove the need to cast baseField to any
1018
1005
  var baseField = box.appendChild(dom.createElement('input'));
1019
1006
  baseField.setAttribute('type', 'text');
1020
- baseField.style = _style.textInputStyle;
1007
+ baseField.setAttribute('style', style.textInputStyle);
1021
1008
  baseField.size = 80; // really a string
1022
1009
  baseField.label = 'base URL';
1023
1010
  baseField.autocomplete = 'on';
@@ -1029,7 +1016,7 @@ function selectWorkspace(dom, appDetails, callbackWS) {
1029
1016
  box.appendChild(dom.createElement('br')); // @@
1030
1017
 
1031
1018
  var button = box.appendChild(dom.createElement('button'));
1032
- button.style = _style.buttonStyle;
1019
+ button.setAttribute('style', style.buttonStyle);
1033
1020
  button.textContent = "Start new ".concat(noun, " at this URI");
1034
1021
  button.addEventListener('click', function (_event) {
1035
1022
  var newBase = baseField.value.replace(' ', '%20'); // do not re-encode in general, as % encodings may exist
@@ -1047,7 +1034,7 @@ function selectWorkspace(dom, appDetails, callbackWS) {
1047
1034
  // Ignore master workspaces
1048
1035
  ns.space('MasterWorkspace'));
1049
1036
  });
1050
- var col1, col2, col3, tr, ws, style, comment;
1037
+ var col1, col2, col3, tr, ws, localStyle, comment;
1051
1038
  var cellStyle = 'height: 3em; margin: 1em; padding: 1em white; border-radius: 0.3em;';
1052
1039
  var deselectedStyle = "".concat(cellStyle, "border: 0px;");
1053
1040
  // const selectedStyle = cellStyle + 'border: 1px solid black;'
@@ -1062,8 +1049,8 @@ function selectWorkspace(dom, appDetails, callbackWS) {
1062
1049
  tr.appendChild(col1);
1063
1050
  }
1064
1051
  col2 = dom.createElement('td');
1065
- style = _solidLogic.solidLogicSingleton.store.anyValue(ws, ns.ui('style'));
1066
- if (!style) {
1052
+ localStyle = _solidLogic.solidLogicSingleton.store.anyValue(ws, ns.ui('style'));
1053
+ if (!localStyle) {
1067
1054
  // Otherwise make up arbitrary colour
1068
1055
  var hash = function hash(x) {
1069
1056
  return x.split('').reduce(function (a, b) {
@@ -1072,9 +1059,9 @@ function selectWorkspace(dom, appDetails, callbackWS) {
1072
1059
  }, 0);
1073
1060
  };
1074
1061
  var bgcolor = "#".concat((hash(ws.uri) & 0xffffff | 0xc0c0c0).toString(16)); // c0c0c0 forces pale
1075
- style = "color: black ; background-color: ".concat(bgcolor, ";");
1062
+ localStyle = "color: black ; background-color: ".concat(bgcolor, ";");
1076
1063
  }
1077
- col2.setAttribute('style', deselectedStyle + style);
1064
+ col2.setAttribute('style', deselectedStyle + localStyle);
1078
1065
  tr.target = ws.uri;
1079
1066
  var label = _solidLogic.solidLogicSingleton.store.any(ws, ns.rdfs('label'));
1080
1067
  if (!label) {
@@ -1094,7 +1081,7 @@ function selectWorkspace(dom, appDetails, callbackWS) {
1094
1081
  comment = comment ? comment.value : 'Use this workspace';
1095
1082
  col2.addEventListener('click', function (_event) {
1096
1083
  col3.textContent = comment ? comment.value : '';
1097
- col3.setAttribute('style', deselectedStyle + style);
1084
+ col3.setAttribute('style', deselectedStyle + localStyle);
1098
1085
  var button = dom.createElement('button');
1099
1086
  button.textContent = 'Continue';
1100
1087
  // button.setAttribute('style', style);