solid-ui 2.4.23 → 2.4.24

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 (136) hide show
  1. package/dist/main.js +2159 -5039
  2. package/dist/main.js.map +1 -1
  3. package/lib/acl/access-controller.js +4 -67
  4. package/lib/acl/access-controller.js.map +1 -1
  5. package/lib/acl/access-groups.js +59 -137
  6. package/lib/acl/access-groups.js.map +1 -1
  7. package/lib/acl/acl-control.js +14 -54
  8. package/lib/acl/acl-control.js.map +1 -1
  9. package/lib/acl/acl.js +32 -107
  10. package/lib/acl/acl.js.map +1 -1
  11. package/lib/acl/add-agent-buttons.js +0 -92
  12. package/lib/acl/add-agent-buttons.js.map +1 -1
  13. package/lib/acl/index.js +1 -3
  14. package/lib/acl/index.js.map +1 -1
  15. package/lib/acl/styles.js +1 -2
  16. package/lib/acl/styles.js.map +1 -1
  17. package/lib/chat/bookmarks.js +8 -80
  18. package/lib/chat/bookmarks.js.map +1 -1
  19. package/lib/chat/chatLogic.js +109 -180
  20. package/lib/chat/chatLogic.js.map +1 -1
  21. package/lib/chat/dateFolder.js +6 -91
  22. package/lib/chat/dateFolder.js.map +1 -1
  23. package/lib/chat/infinite.js +33 -185
  24. package/lib/chat/infinite.js.map +1 -1
  25. package/lib/chat/message.js +37 -150
  26. package/lib/chat/message.js.map +1 -1
  27. package/lib/chat/messageTools.js +23 -96
  28. package/lib/chat/messageTools.js.map +1 -1
  29. package/lib/chat/thread.js +33 -91
  30. package/lib/chat/thread.js.map +1 -1
  31. package/lib/create/create.js +19 -51
  32. package/lib/create/create.js.map +1 -1
  33. package/lib/create/index.js +0 -2
  34. package/lib/create/index.js.map +1 -1
  35. package/lib/debug.js +0 -8
  36. package/lib/debug.js.map +1 -1
  37. package/lib/folders.js +4 -27
  38. package/lib/folders.js.map +1 -1
  39. package/lib/footer/index.js +2 -24
  40. package/lib/footer/index.js.map +1 -1
  41. package/lib/footer/styleMap.js.map +1 -1
  42. package/lib/header/empty-profile.js.map +1 -1
  43. package/lib/header/index.js +3 -72
  44. package/lib/header/index.js.map +1 -1
  45. package/lib/header/styleMap.js +4 -3
  46. package/lib/header/styleMap.js.map +1 -1
  47. package/lib/iconBase.js +3 -4
  48. package/lib/iconBase.js.map +1 -1
  49. package/lib/index.js +5 -46
  50. package/lib/index.js.map +1 -1
  51. package/lib/jss/index.js +3 -9
  52. package/lib/jss/index.js.map +1 -1
  53. package/lib/log.js +15 -51
  54. package/lib/log.js.map +1 -1
  55. package/lib/login/login.js +74 -303
  56. package/lib/login/login.js.map +1 -1
  57. package/lib/matrix/index.js +0 -2
  58. package/lib/matrix/index.js.map +1 -1
  59. package/lib/matrix/matrix.js +7 -55
  60. package/lib/matrix/matrix.js.map +1 -1
  61. package/lib/media/index.js +0 -2
  62. package/lib/media/index.js.map +1 -1
  63. package/lib/media/media-capture.js +13 -33
  64. package/lib/media/media-capture.js.map +1 -1
  65. package/lib/messageArea.js +23 -64
  66. package/lib/messageArea.js.map +1 -1
  67. package/lib/noun_Camera_1618446_000000.js.map +1 -1
  68. package/lib/ns.js +5 -7
  69. package/lib/ns.js.map +1 -1
  70. package/lib/pad.js +48 -234
  71. package/lib/pad.js.map +1 -1
  72. package/lib/participation.js +10 -65
  73. package/lib/participation.js.map +1 -1
  74. package/lib/preferences.js +21 -42
  75. package/lib/preferences.js.map +1 -1
  76. package/lib/signup/config-default.js +1 -8
  77. package/lib/signup/config-default.js.map +1 -1
  78. package/lib/signup/signup.js +6 -13
  79. package/lib/signup/signup.js.map +1 -1
  80. package/lib/stories/decorators.js +0 -2
  81. package/lib/stories/decorators.js.map +1 -1
  82. package/lib/style.js +8 -5
  83. package/lib/style.js.map +1 -1
  84. package/lib/style_multiSelect.js +1 -5
  85. package/lib/style_multiSelect.js.map +1 -1
  86. package/lib/table.js +309 -322
  87. package/lib/table.js.map +1 -1
  88. package/lib/tabs.js +20 -100
  89. package/lib/tabs.js.map +1 -1
  90. package/lib/utils/headerFooterHelpers.js +4 -52
  91. package/lib/utils/headerFooterHelpers.js.map +1 -1
  92. package/lib/utils/index.js +41 -135
  93. package/lib/utils/index.js.map +1 -1
  94. package/lib/utils/label.js +13 -34
  95. package/lib/utils/label.js.map +1 -1
  96. package/lib/versionInfo.js +4 -4
  97. package/lib/versionInfo.js.map +1 -1
  98. package/lib/widgets/buttons/iconLinks.js +0 -8
  99. package/lib/widgets/buttons/iconLinks.js.map +1 -1
  100. package/lib/widgets/buttons.js +115 -291
  101. package/lib/widgets/buttons.js.map +1 -1
  102. package/lib/widgets/dragAndDrop.js +12 -41
  103. package/lib/widgets/dragAndDrop.js.map +1 -1
  104. package/lib/widgets/error.js +3 -9
  105. package/lib/widgets/error.js.map +1 -1
  106. package/lib/widgets/forms/autocomplete/autocompleteBar.js +8 -71
  107. package/lib/widgets/forms/autocomplete/autocompleteBar.js.map +1 -1
  108. package/lib/widgets/forms/autocomplete/autocompleteField.js +13 -65
  109. package/lib/widgets/forms/autocomplete/autocompleteField.js.map +1 -1
  110. package/lib/widgets/forms/autocomplete/autocompletePicker.js +15 -107
  111. package/lib/widgets/forms/autocomplete/autocompletePicker.js.map +1 -1
  112. package/lib/widgets/forms/autocomplete/language.js +6 -55
  113. package/lib/widgets/forms/autocomplete/language.js.map +1 -1
  114. package/lib/widgets/forms/autocomplete/publicData.js +12 -131
  115. package/lib/widgets/forms/autocomplete/publicData.js.map +1 -1
  116. package/lib/widgets/forms/basic.js +12 -55
  117. package/lib/widgets/forms/basic.js.map +1 -1
  118. package/lib/widgets/forms/comment.js +1 -15
  119. package/lib/widgets/forms/comment.js.map +1 -1
  120. package/lib/widgets/forms/fieldFunction.js +3 -16
  121. package/lib/widgets/forms/fieldFunction.js.map +1 -1
  122. package/lib/widgets/forms/fieldParams.js +0 -12
  123. package/lib/widgets/forms/fieldParams.js.map +1 -1
  124. package/lib/widgets/forms/formStyle.js +1 -14
  125. package/lib/widgets/forms/formStyle.js.map +1 -1
  126. package/lib/widgets/forms.js +70 -474
  127. package/lib/widgets/forms.js.map +1 -1
  128. package/lib/widgets/index.js +0 -21
  129. package/lib/widgets/index.js.map +1 -1
  130. package/lib/widgets/multiSelect.js +48 -171
  131. package/lib/widgets/multiSelect.js.map +1 -1
  132. package/lib/widgets/peoplePicker.js +20 -90
  133. package/lib/widgets/peoplePicker.js.map +1 -1
  134. package/lib/widgets/widgetHelpers.js +2 -9
  135. package/lib/widgets/widgetHelpers.js.map +1 -1
  136. package/package.json +28 -28
@@ -1,9 +1,7 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  var _typeof = require("@babel/runtime/helpers/typeof");
6
-
7
5
  Object.defineProperty(exports, "__esModule", {
8
6
  value: true
9
7
  });
@@ -17,33 +15,22 @@ exports.createUserMenuLink = createUserMenuLink;
17
15
  exports.getProfileImg = getProfileImg;
18
16
  exports.initHeader = initHeader;
19
17
  exports.rebuildHeader = rebuildHeader;
20
-
21
18
  var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
22
-
23
19
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
24
-
25
20
  var _index = require("../index");
26
-
27
21
  var _solidLogic = require("solid-logic");
28
-
29
22
  var _login = require("../login/login");
30
-
31
23
  var widgets = _interopRequireWildcard(require("../widgets"));
32
-
33
24
  var _emptyProfile = require("./empty-profile");
34
-
35
25
  var _headerFooterHelpers = require("../utils/headerFooterHelpers");
36
-
37
26
  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); }
38
-
39
27
  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; }
40
-
41
28
  /* global EventListenerOrEventListenerObject */
42
-
43
29
  /*
44
30
  This file was copied from mashlib/src/global/header.ts file. It is modified to
45
31
  work in solid-ui by adjusting where imported functions are found.
46
32
  */
33
+
47
34
  // import { loginStatusBox, authSession, currentUser } from '../authn/authn'
48
35
 
49
36
  /**
@@ -51,7 +38,6 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
51
38
  */
52
39
  var DEFAULT_HELP_MENU_ICON = _index.icons.iconBase + 'noun_help.svg';
53
40
  var DEFAUL_SOLID_ICON_URL = 'https://solidproject.org/assets/img/solid-emblem.svg';
54
-
55
41
  /**
56
42
  * Initialize header component, the header object returned depends on whether the user is authenticated.
57
43
  * @param store the data store
@@ -65,8 +51,6 @@ function initHeader(_x, _x2, _x3) {
65
51
  /**
66
52
  * @ignore exporting this only for the unit test
67
53
  */
68
-
69
-
70
54
  function _initHeader() {
71
55
  _initHeader = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(store, userMenuList, options) {
72
56
  var header, pod;
@@ -75,22 +59,16 @@ function _initHeader() {
75
59
  switch (_context2.prev = _context2.next) {
76
60
  case 0:
77
61
  header = document.getElementById('PageHeader');
78
-
79
62
  if (header) {
80
63
  _context2.next = 3;
81
64
  break;
82
65
  }
83
-
84
66
  return _context2.abrupt("return");
85
-
86
67
  case 3:
87
68
  pod = (0, _headerFooterHelpers.getPod)();
88
69
  rebuildHeader(header, store, pod, userMenuList, options)();
89
-
90
70
  _solidLogic.authSession.onLogout(rebuildHeader(header, store, pod, userMenuList, options));
91
-
92
71
  _solidLogic.authSession.onLogin(rebuildHeader(header, store, pod, userMenuList, options));
93
-
94
72
  case 7:
95
73
  case "end":
96
74
  return _context2.stop();
@@ -100,7 +78,6 @@ function _initHeader() {
100
78
  }));
101
79
  return _initHeader.apply(this, arguments);
102
80
  }
103
-
104
81
  function rebuildHeader(header, store, pod, userMenuList, options) {
105
82
  return /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
106
83
  var user;
@@ -113,12 +90,9 @@ function rebuildHeader(header, store, pod, userMenuList, options) {
113
90
  _context.t0 = header;
114
91
  _context.next = 5;
115
92
  return createBanner(store, pod, user, userMenuList, options);
116
-
117
93
  case 5:
118
94
  _context.t1 = _context.sent;
119
-
120
95
  _context.t0.appendChild.call(_context.t0, _context.t1);
121
-
122
96
  case 7:
123
97
  case "end":
124
98
  return _context.stop();
@@ -130,16 +104,12 @@ function rebuildHeader(header, store, pod, userMenuList, options) {
130
104
  /**
131
105
  * @ignore exporting this only for the unit test
132
106
  */
133
-
134
-
135
107
  function createBanner(_x4, _x5, _x6, _x7, _x8) {
136
108
  return _createBanner.apply(this, arguments);
137
109
  }
138
110
  /**
139
111
  * @ignore exporting this only for the unit test
140
112
  */
141
-
142
-
143
113
  function _createBanner() {
144
114
  _createBanner = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(store, pod, user, userMenuList, options) {
145
115
  var podLink, image, userMenu, banner, leftSideOfHeader, helpMenu;
@@ -151,30 +121,23 @@ function _createBanner() {
151
121
  podLink.href = pod.uri;
152
122
  (0, _headerFooterHelpers.addStyleClassToElement)(podLink, ['header-banner__link']);
153
123
  image = document.createElement('img');
154
-
155
124
  if (options) {
156
125
  image.src = options.logo ? options.logo : DEFAUL_SOLID_ICON_URL;
157
126
  }
158
-
159
127
  (0, _headerFooterHelpers.addStyleClassToElement)(image, ['header-banner__icon']);
160
128
  podLink.appendChild(image);
161
-
162
129
  if (!user) {
163
130
  _context3.next = 13;
164
131
  break;
165
132
  }
166
-
167
133
  _context3.next = 10;
168
134
  return createUserMenu(store, user, userMenuList);
169
-
170
135
  case 10:
171
136
  _context3.t0 = _context3.sent;
172
137
  _context3.next = 14;
173
138
  break;
174
-
175
139
  case 13:
176
140
  _context3.t0 = createLoginSignUpButtons();
177
-
178
141
  case 14:
179
142
  userMenu = _context3.t0;
180
143
  banner = document.createElement('div');
@@ -183,15 +146,12 @@ function _createBanner() {
183
146
  leftSideOfHeader = document.createElement('div');
184
147
  (0, _headerFooterHelpers.addStyleClassToElement)(leftSideOfHeader, ['header-banner__right-menu']);
185
148
  leftSideOfHeader.appendChild(userMenu);
186
-
187
149
  if (options && options.helpMenuList) {
188
150
  helpMenu = createHelpMenu(options, options.helpMenuList);
189
151
  leftSideOfHeader.appendChild(helpMenu);
190
152
  }
191
-
192
153
  banner.appendChild(leftSideOfHeader);
193
154
  return _context3.abrupt("return", banner);
194
-
195
155
  case 24:
196
156
  case "end":
197
157
  return _context3.stop();
@@ -201,14 +161,12 @@ function _createBanner() {
201
161
  }));
202
162
  return _createBanner.apply(this, arguments);
203
163
  }
204
-
205
164
  function createHelpMenu(options, helpMenuItems) {
206
165
  if (!helpMenuItems) return;
207
166
  var helpMenuList = document.createElement('ul');
208
167
  (0, _headerFooterHelpers.addStyleClassToElement)(helpMenuList, ['header-user-menu__list']);
209
168
  helpMenuItems.forEach(function (menuItem) {
210
169
  var menuItemType = menuItem.url ? 'url' : 'onclick';
211
-
212
170
  if (menuItemType === 'url') {
213
171
  helpMenuList.appendChild(createUserMenuItem(createUserMenuLink(menuItem.label, menuItem.url, menuItem.target)));
214
172
  } else {
@@ -252,8 +210,6 @@ function createHelpMenu(options, helpMenuItems) {
252
210
  /**
253
211
  * @ignore exporting this only for the unit test
254
212
  */
255
-
256
-
257
213
  function createLoginSignUpButtons() {
258
214
  var profileLoginButtonPre = document.createElement('div');
259
215
  (0, _headerFooterHelpers.addStyleClassToElement)(profileLoginButtonPre, ['header-banner__login']);
@@ -263,8 +219,6 @@ function createLoginSignUpButtons() {
263
219
  /**
264
220
  * @ignore exporting this only for the unit test
265
221
  */
266
-
267
-
268
222
  function createUserMenuButton(label, onClick) {
269
223
  var button = document.createElement('button');
270
224
  (0, _headerFooterHelpers.addStyleClassToElement)(button, ['header-user-menu__button']);
@@ -275,8 +229,6 @@ function createUserMenuButton(label, onClick) {
275
229
  /**
276
230
  * @ignore exporting this only for the unit test
277
231
  */
278
-
279
-
280
232
  function createUserMenuLink(label, href, target) {
281
233
  var link = document.createElement('a');
282
234
  (0, _headerFooterHelpers.addStyleClassToElement)(link, ['header-user-menu__link']);
@@ -285,19 +237,16 @@ function createUserMenuLink(label, href, target) {
285
237
  if (target) link.target = target;
286
238
  return link;
287
239
  }
240
+
288
241
  /**
289
242
  * @ignore exporting this only for the unit test
290
243
  */
291
-
292
-
293
244
  function createUserMenu(_x9, _x10, _x11) {
294
245
  return _createUserMenu.apply(this, arguments);
295
246
  }
296
247
  /**
297
248
  * @ignore exporting this only for the unit test
298
249
  */
299
-
300
-
301
250
  function _createUserMenu() {
302
251
  _createUserMenu = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(store, user, userMenuList) {
303
252
  var fetcher, loggedInMenuList, loggedInMenu, loggedInMenuTrigger, profileImg, loggedInMenuContainer, throttledMenuToggle, timer;
@@ -306,23 +255,18 @@ function _createUserMenu() {
306
255
  switch (_context4.prev = _context4.next) {
307
256
  case 0:
308
257
  fetcher = store.fetcher;
309
-
310
258
  if (!fetcher) {
311
259
  _context4.next = 4;
312
260
  break;
313
261
  }
314
-
315
262
  _context4.next = 4;
316
263
  return fetcher.load(user);
317
-
318
264
  case 4:
319
265
  loggedInMenuList = document.createElement('ul');
320
266
  (0, _headerFooterHelpers.addStyleClassToElement)(loggedInMenuList, ['header-user-menu__list']);
321
-
322
267
  if (userMenuList) {
323
268
  userMenuList.forEach(function (menuItem) {
324
269
  var menuItemType = menuItem.url ? 'url' : 'onclick';
325
-
326
270
  if (menuItemType === 'url') {
327
271
  loggedInMenuList.appendChild(createUserMenuItem(createUserMenuLink(menuItem.label, menuItem.url, menuItem.target)));
328
272
  } else {
@@ -330,7 +274,6 @@ function _createUserMenu() {
330
274
  }
331
275
  });
332
276
  }
333
-
334
277
  loggedInMenu = document.createElement('nav');
335
278
  (0, _headerFooterHelpers.addStyleClassToElement)(loggedInMenu, ['header-user-menu__navigation-menu']);
336
279
  loggedInMenu.setAttribute('aria-hidden', 'true');
@@ -339,13 +282,11 @@ function _createUserMenu() {
339
282
  (0, _headerFooterHelpers.addStyleClassToElement)(loggedInMenuTrigger, ['header-user-menu__trigger']);
340
283
  loggedInMenuTrigger.type = 'button';
341
284
  profileImg = getProfileImg(store, user);
342
-
343
285
  if (typeof profileImg === 'string') {
344
286
  loggedInMenuTrigger.innerHTML = profileImg;
345
287
  } else {
346
288
  loggedInMenuTrigger.appendChild(profileImg);
347
289
  }
348
-
349
290
  loggedInMenuContainer = document.createElement('div');
350
291
  (0, _headerFooterHelpers.addStyleClassToElement)(loggedInMenuContainer, ['header-banner__user-menu']);
351
292
  (0, _headerFooterHelpers.addStyleClassToElement)(loggedInMenuContainer, ['header-user-menu']);
@@ -368,7 +309,6 @@ function _createUserMenu() {
368
309
  }, 200);
369
310
  });
370
311
  return _context4.abrupt("return", loggedInMenuContainer);
371
-
372
312
  case 27:
373
313
  case "end":
374
314
  return _context4.stop();
@@ -378,7 +318,6 @@ function _createUserMenu() {
378
318
  }));
379
319
  return _createUserMenu.apply(this, arguments);
380
320
  }
381
-
382
321
  function createUserMenuItem(child) {
383
322
  var menuProfileItem = document.createElement('li');
384
323
  (0, _headerFooterHelpers.addStyleClassToElement)(menuProfileItem, ['header-user-menu__list-item']);
@@ -388,40 +327,32 @@ function createUserMenuItem(child) {
388
327
  /**
389
328
  * @ignore exporting this only for the unit test
390
329
  */
391
-
392
-
393
330
  function getProfileImg(store, user) {
394
331
  var profileUrl = null;
395
-
396
332
  try {
397
333
  profileUrl = widgets.findImage(user);
398
-
399
334
  if (!profileUrl) {
400
335
  return _emptyProfile.emptyProfile;
401
336
  }
402
337
  } catch (_unused) {
403
338
  return _emptyProfile.emptyProfile;
404
339
  }
405
-
406
340
  var profileImage = document.createElement('div');
407
341
  (0, _headerFooterHelpers.addStyleClassToElement)(profileImage, ['header-user-menu__photo']);
408
342
  profileImage.style.backgroundImage = "url(".concat(profileUrl, ")");
409
343
  return profileImage;
410
344
  }
345
+
411
346
  /**
412
347
  * @internal
413
348
  */
414
-
415
-
416
349
  function toggleMenu(event, trigger, menu) {
417
350
  var isExpanded = trigger.getAttribute('aria-expanded') === 'true';
418
351
  var expand = event.type === 'mouseover';
419
352
  var close = event.type === 'mouseout';
420
-
421
353
  if (isExpanded && expand || !isExpanded && close) {
422
354
  return;
423
355
  }
424
-
425
356
  trigger.setAttribute('aria-expanded', (!isExpanded).toString());
426
357
  menu.setAttribute('aria-hidden', isExpanded.toString());
427
358
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["DEFAULT_HELP_MENU_ICON","icons","iconBase","DEFAUL_SOLID_ICON_URL","initHeader","store","userMenuList","options","header","document","getElementById","pod","getPod","rebuildHeader","authSession","onLogout","onLogin","user","authn","currentUser","innerHTML","createBanner","appendChild","podLink","createElement","href","uri","addStyleClassToElement","image","src","logo","createUserMenu","createLoginSignUpButtons","userMenu","banner","leftSideOfHeader","helpMenuList","helpMenu","createHelpMenu","helpMenuItems","forEach","menuItem","menuItemType","url","createUserMenuItem","createUserMenuLink","label","target","createUserMenuButton","onclick","setAttribute","helpMenuContainer","helpMenuTrigger","type","helpMenuIcon","helpIcon","throttledMenuToggle","throttle","event","toggleMenu","addEventListener","timer","setTimeout","clearTimeout","profileLoginButtonPre","loginStatusBox","onClick","button","innerText","link","fetcher","load","loggedInMenuList","loggedInMenu","loggedInMenuTrigger","profileImg","getProfileImg","loggedInMenuContainer","child","menuProfileItem","profileUrl","widgets","findImage","emptyProfile","profileImage","style","backgroundImage","trigger","menu","isExpanded","getAttribute","expand","close","toString"],"sources":["../../src/header/index.ts"],"sourcesContent":["/* global EventListenerOrEventListenerObject */\n/*\n This file was copied from mashlib/src/global/header.ts file. It is modified to\n work in solid-ui by adjusting where imported functions are found.\n */\nimport { IndexedFormula, NamedNode } from 'rdflib'\nimport { icons } from '../index'\nimport { authn, authSession } from 'solid-logic'\nimport { loginStatusBox } from '../login/login'\n// import { loginStatusBox, authSession, currentUser } from '../authn/authn'\nimport * as widgets from '../widgets'\nimport { emptyProfile } from './empty-profile'\nimport { addStyleClassToElement, getPod, throttle } from '../utils/headerFooterHelpers'\n\n/**\n * menu icons\n*/\nconst DEFAULT_HELP_MENU_ICON = icons.iconBase + 'noun_help.svg'\nconst DEFAUL_SOLID_ICON_URL = 'https://solidproject.org/assets/img/solid-emblem.svg'\n\nexport type MenuItemLink = {\n label: string,\n url: string,\n target?: string\n}\n\nexport type MenuItemButton = {\n label: string,\n onclick: () => void\n}\n\nexport type MenuItems = MenuItemLink | MenuItemButton\n\n/*\n HeaderOptions allow for customizing the logo and menu list. If a logo is not provided the default\n is solid. Menulist will always show a link to logout and to the users profile.\n */\nexport type HeaderOptions = {\n logo?: string,\n helpIcon?: string,\n helpMenuList?: MenuItems[]\n}\n\n/**\n * Initialize header component, the header object returned depends on whether the user is authenticated.\n * @param store the data store\n * @param userMenuList a list of menu items when the user is logged in\n * @param options allow the header to be customized with a personalized logo, help icon and a help menu list of links or buttons.\n * @returns a header for an authenticated user with menu items given or a login screen\n */\nexport async function initHeader (store: IndexedFormula, userMenuList: MenuItems[], options?: HeaderOptions) {\n const header = document.getElementById('PageHeader')\n if (!header) {\n return\n }\n\n const pod = getPod()\n rebuildHeader(header, store, pod, userMenuList, options)()\n authSession.onLogout(rebuildHeader(header, store, pod, userMenuList, options))\n authSession.onLogin(rebuildHeader(header, store, pod, userMenuList, options))\n}\n/**\n * @ignore exporting this only for the unit test\n */\nexport function rebuildHeader (header: HTMLElement, store: IndexedFormula, pod: NamedNode, userMenuList: MenuItems[], options?: HeaderOptions) {\n return async () => {\n const user = authn.currentUser()\n header.innerHTML = ''\n header.appendChild(await createBanner(store, pod, user, userMenuList, options))\n }\n}\n/**\n * @ignore exporting this only for the unit test\n */\nexport async function createBanner (store: IndexedFormula, pod: NamedNode, user: NamedNode | null, userMenuList: MenuItems[], options?: HeaderOptions): Promise<HTMLElement> {\n const podLink = document.createElement('a')\n podLink.href = pod.uri\n addStyleClassToElement(podLink, ['header-banner__link'])\n const image = document.createElement('img')\n if (options) {\n image.src = options.logo ? options.logo : DEFAUL_SOLID_ICON_URL\n }\n addStyleClassToElement(image, ['header-banner__icon'])\n podLink.appendChild(image)\n\n const userMenu = user\n ? await createUserMenu(store, user, userMenuList)\n : createLoginSignUpButtons()\n\n const banner = document.createElement('div')\n addStyleClassToElement(banner, ['header-banner'])\n banner.appendChild(podLink)\n\n const leftSideOfHeader = document.createElement('div')\n addStyleClassToElement(leftSideOfHeader, ['header-banner__right-menu'])\n leftSideOfHeader.appendChild(userMenu)\n\n if (options && options.helpMenuList) {\n const helpMenu = createHelpMenu(options, options.helpMenuList)\n leftSideOfHeader.appendChild(helpMenu as HTMLDivElement)\n }\n\n banner.appendChild(leftSideOfHeader)\n\n return banner\n}\n/**\n * @ignore exporting this only for the unit test\n */\nexport function createHelpMenu (options: HeaderOptions, helpMenuItems: MenuItems[]) {\n if (!helpMenuItems) return\n const helpMenuList = document.createElement('ul')\n addStyleClassToElement(helpMenuList, ['header-user-menu__list'])\n helpMenuItems.forEach(function (menuItem) {\n const menuItemType: string = (menuItem as MenuItemLink).url ? 'url' : 'onclick'\n if (menuItemType === 'url') {\n helpMenuList.appendChild(createUserMenuItem(createUserMenuLink(menuItem.label, (menuItem as MenuItemLink).url, (menuItem as MenuItemLink).target)))\n } else {\n helpMenuList.appendChild(createUserMenuItem(createUserMenuButton(menuItem.label, (menuItem as MenuItemButton).onclick)))\n }\n })\n\n const helpMenu = document.createElement('nav')\n\n addStyleClassToElement(helpMenu, ['header-user-menu__navigation-menu'])\n helpMenu.setAttribute('aria-hidden', 'true')\n helpMenu.appendChild(helpMenuList)\n\n const helpMenuContainer = document.createElement('div')\n addStyleClassToElement(helpMenuContainer, ['header-banner__user-menu'])\n addStyleClassToElement(helpMenuContainer, ['header-user-menu'])\n helpMenuContainer.appendChild(helpMenu)\n\n const helpMenuTrigger = document.createElement('button')\n addStyleClassToElement(helpMenuTrigger, ['header-user-menu__trigger'])\n helpMenuTrigger.type = 'button'\n\n const helpMenuIcon = document.createElement('img')\n helpMenuIcon.src = (options && options.helpIcon) ? options.helpIcon : icons.iconBase + DEFAULT_HELP_MENU_ICON\n addStyleClassToElement(helpMenuIcon, ['header-banner__help-icon'])\n helpMenuContainer.appendChild(helpMenuTrigger)\n helpMenuTrigger.appendChild(helpMenuIcon)\n\n const throttledMenuToggle = throttle((event: Event) => toggleMenu(event, helpMenuTrigger, helpMenu), 50)\n helpMenuTrigger.addEventListener('click', throttledMenuToggle)\n let timer = setTimeout(() => null, 0)\n helpMenuContainer.addEventListener('mouseover', event => {\n clearTimeout(timer)\n throttledMenuToggle(event)\n })\n helpMenuContainer.addEventListener('mouseout', event => {\n timer = setTimeout(() => throttledMenuToggle(event), 200)\n })\n\n return helpMenuContainer\n}\n/**\n * @ignore exporting this only for the unit test\n */\nexport function createLoginSignUpButtons () {\n const profileLoginButtonPre = document.createElement('div')\n addStyleClassToElement(profileLoginButtonPre, ['header-banner__login'])\n profileLoginButtonPre.appendChild(loginStatusBox(document, null, {}))\n return profileLoginButtonPre\n}\n/**\n * @ignore exporting this only for the unit test\n */\nexport function createUserMenuButton (label: string, onClick: EventListenerOrEventListenerObject): HTMLElement {\n const button = document.createElement('button')\n addStyleClassToElement(button, ['header-user-menu__button'])\n button.addEventListener('click', onClick)\n button.innerText = label\n return button\n}\n/**\n * @ignore exporting this only for the unit test\n */\nexport function createUserMenuLink (label: string, href: string, target?: string): HTMLElement {\n const link = document.createElement('a')\n addStyleClassToElement(link, ['header-user-menu__link'])\n link.href = href\n link.innerText = label\n if (target) link.target = target\n return link\n}\n\n/**\n * @ignore exporting this only for the unit test\n */\nexport async function createUserMenu (store: IndexedFormula, user: NamedNode, userMenuList: MenuItems[]): Promise<HTMLElement> {\n const fetcher = (<any>store).fetcher\n if (fetcher) {\n // Making sure that Profile is loaded before building menu\n await fetcher.load(user)\n }\n\n const loggedInMenuList = document.createElement('ul')\n addStyleClassToElement(loggedInMenuList, ['header-user-menu__list'])\n if (userMenuList) {\n userMenuList.forEach(function (menuItem) {\n const menuItemType: string = (menuItem as MenuItemLink).url ? 'url' : 'onclick'\n if (menuItemType === 'url') {\n loggedInMenuList.appendChild(createUserMenuItem(createUserMenuLink(menuItem.label, (menuItem as MenuItemLink).url, (menuItem as MenuItemLink).target)))\n } else {\n loggedInMenuList.appendChild(createUserMenuItem(createUserMenuButton(menuItem.label, (menuItem as MenuItemButton).onclick)))\n }\n })\n }\n const loggedInMenu = document.createElement('nav')\n\n addStyleClassToElement(loggedInMenu, ['header-user-menu__navigation-menu'])\n loggedInMenu.setAttribute('aria-hidden', 'true')\n loggedInMenu.appendChild(loggedInMenuList)\n\n const loggedInMenuTrigger = document.createElement('button')\n addStyleClassToElement(loggedInMenuTrigger, ['header-user-menu__trigger'])\n loggedInMenuTrigger.type = 'button'\n const profileImg = getProfileImg(store, user)\n if (typeof profileImg === 'string') {\n loggedInMenuTrigger.innerHTML = profileImg\n } else {\n loggedInMenuTrigger.appendChild(profileImg)\n }\n\n const loggedInMenuContainer = document.createElement('div')\n addStyleClassToElement(loggedInMenuContainer, ['header-banner__user-menu'])\n addStyleClassToElement(loggedInMenuContainer, ['header-user-menu'])\n loggedInMenuContainer.appendChild(loggedInMenuTrigger)\n loggedInMenuContainer.appendChild(loggedInMenu)\n\n const throttledMenuToggle = throttle((event: Event) => toggleMenu(event, loggedInMenuTrigger, loggedInMenu), 50)\n loggedInMenuTrigger.addEventListener('click', throttledMenuToggle)\n let timer = setTimeout(() => null, 0)\n loggedInMenuContainer.addEventListener('mouseover', event => {\n clearTimeout(timer)\n throttledMenuToggle(event)\n })\n loggedInMenuContainer.addEventListener('mouseout', event => {\n timer = setTimeout(() => throttledMenuToggle(event), 200)\n })\n\n return loggedInMenuContainer\n}\n\n/**\n * @ignore exporting this only for the unit test\n */\nexport function createUserMenuItem (child: HTMLElement): HTMLElement {\n const menuProfileItem = document.createElement('li')\n addStyleClassToElement(menuProfileItem, ['header-user-menu__list-item'])\n menuProfileItem.appendChild(child)\n return menuProfileItem\n}\n/**\n * @ignore exporting this only for the unit test\n */\nexport function getProfileImg (store: IndexedFormula, user: NamedNode): string | HTMLElement {\n let profileUrl = null\n try {\n profileUrl = widgets.findImage(user)\n if (!profileUrl) {\n return emptyProfile\n }\n } catch {\n return emptyProfile\n }\n\n const profileImage = document.createElement('div')\n addStyleClassToElement(profileImage, ['header-user-menu__photo'])\n profileImage.style.backgroundImage = `url(${profileUrl})`\n return profileImage\n}\n\n/**\n * @internal\n */\nfunction toggleMenu (event: Event, trigger: HTMLButtonElement, menu: HTMLElement): void {\n const isExpanded = trigger.getAttribute('aria-expanded') === 'true'\n const expand = event.type === 'mouseover'\n const close = event.type === 'mouseout'\n if ((isExpanded && expand) || (!isExpanded && close)) {\n return\n }\n trigger.setAttribute('aria-expanded', (!isExpanded).toString())\n menu.setAttribute('aria-hidden', isExpanded.toString())\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAMA;;AACA;;AACA;;AAEA;;AACA;;AACA;;;;;;AAZA;;AACA;AACA;AACA;AACA;AAKA;;AAKA;AACA;AACA;AACA,IAAMA,sBAAsB,GAAGC,YAAA,CAAMC,QAAN,GAAiB,eAAhD;AACA,IAAMC,qBAAqB,GAAG,sDAA9B;;AAyBA;AACA;AACA;AACA;AACA;AACA;AACA;SACsBC,U;;;AAWtB;AACA;AACA;;;;8FAbO,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ELP_MENU_ICON","icons","iconBase","DEFAUL_SOLID_ICON_URL","initHeader","store","userMenuList","options","header","document","getElementById","pod","getPod","rebuildHeader","authSession","onLogout","onLogin","user","authn","currentUser","innerHTML","createBanner","appendChild","podLink","createElement","href","uri","addStyleClassToElement","image","src","logo","createUserMenu","createLoginSignUpButtons","userMenu","banner","leftSideOfHeader","helpMenuList","helpMenu","createHelpMenu","helpMenuItems","forEach","menuItem","menuItemType","url","createUserMenuItem","createUserMenuLink","label","target","createUserMenuButton","onclick","setAttribute","helpMenuContainer","helpMenuTrigger","type","helpMenuIcon","helpIcon","throttledMenuToggle","throttle","event","toggleMenu","addEventListener","timer","setTimeout","clearTimeout","profileLoginButtonPre","loginStatusBox","onClick","button","innerText","link","fetcher","load","loggedInMenuList","loggedInMenu","loggedInMenuTrigger","profileImg","getProfileImg","loggedInMenuContainer","child","menuProfileItem","profileUrl","widgets","findImage","emptyProfile","profileImage","style","backgroundImage","trigger","menu","isExpanded","getAttribute","expand","close","toString"],"sources":["../../src/header/index.ts"],"sourcesContent":["/* global EventListenerOrEventListenerObject */\n/*\n This file was copied from mashlib/src/global/header.ts file. It is modified to\n work in solid-ui by adjusting where imported functions are found.\n */\nimport { IndexedFormula, NamedNode } from 'rdflib'\nimport { icons } from '../index'\nimport { authn, authSession } from 'solid-logic'\nimport { loginStatusBox } from '../login/login'\n// import { loginStatusBox, authSession, currentUser } from '../authn/authn'\nimport * as widgets from '../widgets'\nimport { emptyProfile } from './empty-profile'\nimport { addStyleClassToElement, getPod, throttle } from '../utils/headerFooterHelpers'\n\n/**\n * menu icons\n*/\nconst DEFAULT_HELP_MENU_ICON = icons.iconBase + 'noun_help.svg'\nconst DEFAUL_SOLID_ICON_URL = 'https://solidproject.org/assets/img/solid-emblem.svg'\n\nexport type MenuItemLink = {\n label: string,\n url: string,\n target?: string\n}\n\nexport type MenuItemButton = {\n label: string,\n onclick: () => void\n}\n\nexport type MenuItems = MenuItemLink | MenuItemButton\n\n/*\n HeaderOptions allow for customizing the logo and menu list. If a logo is not provided the default\n is solid. Menulist will always show a link to logout and to the users profile.\n */\nexport type HeaderOptions = {\n logo?: string,\n helpIcon?: string,\n helpMenuList?: MenuItems[]\n}\n\n/**\n * Initialize header component, the header object returned depends on whether the user is authenticated.\n * @param store the data store\n * @param userMenuList a list of menu items when the user is logged in\n * @param options allow the header to be customized with a personalized logo, help icon and a help menu list of links or buttons.\n * @returns a header for an authenticated user with menu items given or a login screen\n */\nexport async function initHeader (store: IndexedFormula, userMenuList: MenuItems[], options?: HeaderOptions) {\n const header = document.getElementById('PageHeader')\n if (!header) {\n return\n }\n\n const pod = getPod()\n rebuildHeader(header, store, pod, userMenuList, options)()\n authSession.onLogout(rebuildHeader(header, store, pod, userMenuList, options))\n authSession.onLogin(rebuildHeader(header, store, pod, userMenuList, options))\n}\n/**\n * @ignore exporting this only for the unit test\n */\nexport function rebuildHeader (header: HTMLElement, store: IndexedFormula, pod: NamedNode, userMenuList: MenuItems[], options?: HeaderOptions) {\n return async () => {\n const user = authn.currentUser()\n header.innerHTML = ''\n header.appendChild(await createBanner(store, pod, user, userMenuList, options))\n }\n}\n/**\n * @ignore exporting this only for the unit test\n */\nexport async function createBanner (store: IndexedFormula, pod: NamedNode, user: NamedNode | null, userMenuList: MenuItems[], options?: HeaderOptions): Promise<HTMLElement> {\n const podLink = document.createElement('a')\n podLink.href = pod.uri\n addStyleClassToElement(podLink, ['header-banner__link'])\n const image = document.createElement('img')\n if (options) {\n image.src = options.logo ? options.logo : DEFAUL_SOLID_ICON_URL\n }\n addStyleClassToElement(image, ['header-banner__icon'])\n podLink.appendChild(image)\n\n const userMenu = user\n ? await createUserMenu(store, user, userMenuList)\n : createLoginSignUpButtons()\n\n const banner = document.createElement('div')\n addStyleClassToElement(banner, ['header-banner'])\n banner.appendChild(podLink)\n\n const leftSideOfHeader = document.createElement('div')\n addStyleClassToElement(leftSideOfHeader, ['header-banner__right-menu'])\n leftSideOfHeader.appendChild(userMenu)\n\n if (options && options.helpMenuList) {\n const helpMenu = createHelpMenu(options, options.helpMenuList)\n leftSideOfHeader.appendChild(helpMenu as HTMLDivElement)\n }\n\n banner.appendChild(leftSideOfHeader)\n\n return banner\n}\n/**\n * @ignore exporting this only for the unit test\n */\nexport function createHelpMenu (options: HeaderOptions, helpMenuItems: MenuItems[]) {\n if (!helpMenuItems) return\n const helpMenuList = document.createElement('ul')\n addStyleClassToElement(helpMenuList, ['header-user-menu__list'])\n helpMenuItems.forEach(function (menuItem) {\n const menuItemType: string = (menuItem as MenuItemLink).url ? 'url' : 'onclick'\n if (menuItemType === 'url') {\n helpMenuList.appendChild(createUserMenuItem(createUserMenuLink(menuItem.label, (menuItem as MenuItemLink).url, (menuItem as MenuItemLink).target)))\n } else {\n helpMenuList.appendChild(createUserMenuItem(createUserMenuButton(menuItem.label, (menuItem as MenuItemButton).onclick)))\n }\n })\n\n const helpMenu = document.createElement('nav')\n\n addStyleClassToElement(helpMenu, ['header-user-menu__navigation-menu'])\n helpMenu.setAttribute('aria-hidden', 'true')\n helpMenu.appendChild(helpMenuList)\n\n const helpMenuContainer = document.createElement('div')\n addStyleClassToElement(helpMenuContainer, ['header-banner__user-menu'])\n addStyleClassToElement(helpMenuContainer, ['header-user-menu'])\n helpMenuContainer.appendChild(helpMenu)\n\n const helpMenuTrigger = document.createElement('button')\n addStyleClassToElement(helpMenuTrigger, ['header-user-menu__trigger'])\n helpMenuTrigger.type = 'button'\n\n const helpMenuIcon = document.createElement('img')\n helpMenuIcon.src = (options && options.helpIcon) ? options.helpIcon : icons.iconBase + DEFAULT_HELP_MENU_ICON\n addStyleClassToElement(helpMenuIcon, ['header-banner__help-icon'])\n helpMenuContainer.appendChild(helpMenuTrigger)\n helpMenuTrigger.appendChild(helpMenuIcon)\n\n const throttledMenuToggle = throttle((event: Event) => toggleMenu(event, helpMenuTrigger, helpMenu), 50)\n helpMenuTrigger.addEventListener('click', throttledMenuToggle)\n let timer = setTimeout(() => null, 0)\n helpMenuContainer.addEventListener('mouseover', event => {\n clearTimeout(timer)\n throttledMenuToggle(event)\n })\n helpMenuContainer.addEventListener('mouseout', event => {\n timer = setTimeout(() => throttledMenuToggle(event), 200)\n })\n\n return helpMenuContainer\n}\n/**\n * @ignore exporting this only for the unit test\n */\nexport function createLoginSignUpButtons () {\n const profileLoginButtonPre = document.createElement('div')\n addStyleClassToElement(profileLoginButtonPre, ['header-banner__login'])\n profileLoginButtonPre.appendChild(loginStatusBox(document, null, {}))\n return profileLoginButtonPre\n}\n/**\n * @ignore exporting this only for the unit test\n */\nexport function createUserMenuButton (label: string, onClick: EventListenerOrEventListenerObject): HTMLElement {\n const button = document.createElement('button')\n addStyleClassToElement(button, ['header-user-menu__button'])\n button.addEventListener('click', onClick)\n button.innerText = label\n return button\n}\n/**\n * @ignore exporting this only for the unit test\n */\nexport function createUserMenuLink (label: string, href: string, target?: string): HTMLElement {\n const link = document.createElement('a')\n addStyleClassToElement(link, ['header-user-menu__link'])\n link.href = href\n link.innerText = label\n if (target) link.target = target\n return link\n}\n\n/**\n * @ignore exporting this only for the unit test\n */\nexport async function createUserMenu (store: IndexedFormula, user: NamedNode, userMenuList: MenuItems[]): Promise<HTMLElement> {\n const fetcher = (<any>store).fetcher\n if (fetcher) {\n // Making sure that Profile is loaded before building menu\n await fetcher.load(user)\n }\n\n const loggedInMenuList = document.createElement('ul')\n addStyleClassToElement(loggedInMenuList, ['header-user-menu__list'])\n if (userMenuList) {\n userMenuList.forEach(function (menuItem) {\n const menuItemType: string = (menuItem as MenuItemLink).url ? 'url' : 'onclick'\n if (menuItemType === 'url') {\n loggedInMenuList.appendChild(createUserMenuItem(createUserMenuLink(menuItem.label, (menuItem as MenuItemLink).url, (menuItem as MenuItemLink).target)))\n } else {\n loggedInMenuList.appendChild(createUserMenuItem(createUserMenuButton(menuItem.label, (menuItem as MenuItemButton).onclick)))\n }\n })\n }\n const loggedInMenu = document.createElement('nav')\n\n addStyleClassToElement(loggedInMenu, ['header-user-menu__navigation-menu'])\n loggedInMenu.setAttribute('aria-hidden', 'true')\n loggedInMenu.appendChild(loggedInMenuList)\n\n const loggedInMenuTrigger = document.createElement('button')\n addStyleClassToElement(loggedInMenuTrigger, ['header-user-menu__trigger'])\n loggedInMenuTrigger.type = 'button'\n const profileImg = getProfileImg(store, user)\n if (typeof profileImg === 'string') {\n loggedInMenuTrigger.innerHTML = profileImg\n } else {\n loggedInMenuTrigger.appendChild(profileImg)\n }\n\n const loggedInMenuContainer = document.createElement('div')\n addStyleClassToElement(loggedInMenuContainer, ['header-banner__user-menu'])\n addStyleClassToElement(loggedInMenuContainer, ['header-user-menu'])\n loggedInMenuContainer.appendChild(loggedInMenuTrigger)\n loggedInMenuContainer.appendChild(loggedInMenu)\n\n const throttledMenuToggle = throttle((event: Event) => toggleMenu(event, loggedInMenuTrigger, loggedInMenu), 50)\n loggedInMenuTrigger.addEventListener('click', throttledMenuToggle)\n let timer = setTimeout(() => null, 0)\n loggedInMenuContainer.addEventListener('mouseover', event => {\n clearTimeout(timer)\n throttledMenuToggle(event)\n })\n loggedInMenuContainer.addEventListener('mouseout', event => {\n timer = setTimeout(() => throttledMenuToggle(event), 200)\n })\n\n return loggedInMenuContainer\n}\n\n/**\n * @ignore exporting this only for the unit test\n */\nexport function createUserMenuItem (child: HTMLElement): HTMLElement {\n const menuProfileItem = document.createElement('li')\n addStyleClassToElement(menuProfileItem, ['header-user-menu__list-item'])\n menuProfileItem.appendChild(child)\n return menuProfileItem\n}\n/**\n * @ignore exporting this only for the unit test\n */\nexport function getProfileImg (store: IndexedFormula, user: NamedNode): string | HTMLElement {\n let profileUrl = null\n try {\n profileUrl = widgets.findImage(user)\n if (!profileUrl) {\n return emptyProfile\n }\n } catch {\n return emptyProfile\n }\n\n const profileImage = document.createElement('div')\n addStyleClassToElement(profileImage, ['header-user-menu__photo'])\n profileImage.style.backgroundImage = `url(${profileUrl})`\n return profileImage\n}\n\n/**\n * @internal\n */\nfunction toggleMenu (event: Event, trigger: HTMLButtonElement, menu: HTMLElement): void {\n const isExpanded = trigger.getAttribute('aria-expanded') === 'true'\n const expand = event.type === 'mouseover'\n const close = event.type === 'mouseout'\n if ((isExpanded && expand) || (!isExpanded && close)) {\n return\n }\n trigger.setAttribute('aria-expanded', (!isExpanded).toString())\n menu.setAttribute('aria-hidden', isExpanded.toString())\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAMA;AACA;AACA;AAEA;AACA;AACA;AAAuF;AAAA;AAZvF;AACA;AACA;AACA;AACA;;AAKA;;AAKA;AACA;AACA;AACA,IAAMA,sBAAsB,GAAGC,YAAK,CAACC,QAAQ,GAAG,eAAe;AAC/D,IAAMC,qBAAqB,GAAG,sDAAsD;AAyBpF;AACA;AACA;AACA;AACA;AACA;AACA;AANA,SAOsBC,UAAU;EAAA;AAAA;AAWhC;AACA;AACA;AAFA;EAAA,4FAXO,kBAA2BC,KAAqB,EAAEC,YAAyB,EAAEC,OAAuB;IAAA;IAAA;MAAA;QAAA;UAAA;YACnGC,MAAM,GAAGC,QAAQ,CAACC,cAAc,CAAC,YAAY,CAAC;YAAA,IAC/CF,MAAM;cAAA;cAAA;YAAA;YAAA;UAAA;YAILG,GAAG,GAAG,IAAAC,2BAAM,GAAE;YACpBC,aAAa,CAACL,MAAM,EAAEH,KAAK,EAAEM,GAAG,EAAEL,YAAY,EAAEC,OAAO,CAAC,EAAE;YAC1DO,uBAAW,CAACC,QAAQ,CAACF,aAAa,CAACL,MAAM,EAAEH,KAAK,EAAEM,GAAG,EAAEL,YAAY,EAAEC,OAAO,CAAC,CAAC;YAC9EO,uBAAW,CAACE,OAAO,CAACH,aAAa,CAACL,MAAM,EAAEH,KAAK,EAAEM,GAAG,EAAEL,YAAY,EAAEC,OAAO,CAAC,CAAC;UAAA;UAAA;YAAA;QAAA;MAAA;IAAA;EAAA,CAC9E;EAAA;AAAA;AAIM,SAASM,aAAa,CAAEL,MAAmB,EAAEH,KAAqB,EAAEM,GAAc,EAAEL,YAAyB,EAAEC,OAAuB,EAAE;EAC7I,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,iBAAUN,UAAU,MAAG;EACzD,OAAOI,YAAY;AACrB;;AAEA;AACA;AACA;AACA,SAASzB,UAAU,CAAED,KAAY,EAAE6B,OAA0B,EAAEC,IAAiB,EAAQ;EACtF,IAAMC,UAAU,GAAGF,OAAO,CAACG,YAAY,CAAC,eAAe,CAAC,KAAK,MAAM;EACnE,IAAMC,MAAM,GAAGjC,KAAK,CAACL,IAAI,KAAK,WAAW;EACzC,IAAMuC,KAAK,GAAGlC,KAAK,CAACL,IAAI,KAAK,UAAU;EACvC,IAAKoC,UAAU,IAAIE,MAAM,IAAM,CAACF,UAAU,IAAIG,KAAM,EAAE;IACpD;EACF;EACAL,OAAO,CAACrC,YAAY,CAAC,eAAe,EAAE,CAAC,CAACuC,UAAU,EAAEI,QAAQ,EAAE,CAAC;EAC/DL,IAAI,CAACtC,YAAY,CAAC,aAAa,EAAEuC,UAAU,CAACI,QAAQ,EAAE,CAAC;AACzD"}
@@ -18,9 +18,10 @@ var styleMap = {
18
18
  padding: '1em',
19
19
  width: '100%',
20
20
  '&:focus, &:hover': {
21
- backgroundColor: 'linear-gradient(to right, #7C4DFF 0%, #18A9E6 50%, #01C9EA 100%)' // backgroundColor: '#eee'
22
-
21
+ backgroundColor: 'linear-gradient(to right, #7C4DFF 0%, #18A9E6 50%, #01C9EA 100%)'
22
+ // backgroundColor: '#eee'
23
23
  },
24
+
24
25
  a: {
25
26
  textDecoration: 'none'
26
27
  }
@@ -128,8 +129,8 @@ var styleMap = {
128
129
  height: '60px !important',
129
130
  // this is the icon size
130
131
  width: '65px !important' // may just be 65px round($icon-size * 352 / 322);
131
-
132
132
  },
133
+
133
134
  'header-banner__help-icon': {
134
135
  width: '28px !important'
135
136
  }
@@ -1 +1 @@
1
- {"version":3,"file":"styleMap.js","names":["styleMap","background","border","color","cursor","display","fontFamily","fontSize","textAlign","padding","width","backgroundColor","a","textDecoration","height","img","borderRadius","listStyle","margin","borderRight","position","right","top","borderBottom","backgroundPosition","backgroundRepeat","backgroundSize","boxShadow","justifyContent","marginBottom","marginLeft","input","borderLeft"],"sources":["../../src/header/styleMap.ts"],"sourcesContent":["export const styleMap = {\n 'header-user-menu': {\n },\n 'header-user-menu__link': {\n background: 'none',\n border: '0',\n color: 'black',\n cursor: 'pointer',\n display: 'block',\n fontFamily: 'Arial',\n fontSize: '1em',\n textAlign: 'left',\n padding: '1em',\n width: '100%',\n '&:focus, &:hover': {\n backgroundColor: 'linear-gradient(to right, #7C4DFF 0%, #18A9E6 50%, #01C9EA 100%)'\n // backgroundColor: '#eee'\n },\n a: {\n textDecoration: 'none'\n }\n },\n 'header-user-menu__trigger': {\n background: 'none',\n border: '0',\n cursor: 'pointer',\n width: '60px', // defined in mashlib as a SASS variable $icon_size\n height: '60px', // defined in mashlib as a SASS variable $icon_size\n img: {\n borderRadius: '50%',\n height: '56px', // defined in mashlib as a SASS variable $icon_size - 4px\n width: '56px'\n }\n },\n 'header-user-menu__button': {\n background: 'none',\n border: '0',\n color: 'black',\n cursor: 'pointer',\n display: 'block',\n fontFamily: 'Arial',\n fontSize: '1em',\n textAlign: 'left',\n padding: '1em',\n width: '100%',\n '&:focus, &:hover': {\n backgroundColor: 'linear-gradient(to right, #7C4DFF 0%, #18A9E6 50%, #01C9EA 100%)'\n }\n },\n 'header-user-menu__list': {\n listStyle: 'none',\n margin: '0',\n padding: '0'\n },\n 'header-user-menu__navigation-menu': {\n background: 'white',\n border: 'solid 1px #000000', // the color was defined in mashlib as a SASS variable $divider_color\n borderRight: '0',\n position: 'absolute',\n right: '0',\n top: '60px', // defined in mashlib as a SASS variable $icon_size\n width: '200px',\n 'z-index': '1',\n '&[aria-hidden = true]': {\n display: 'none'\n }\n },\n 'header-user-menu__list-item': {\n borderBottom: 'solid 1px #000000', // the color was defined in mashlib as a SASS variable $divider_color\n '&:last-child': {\n border: '0'\n }\n },\n 'header-user-menu__photo': {\n borderRadius: '50%',\n backgroundPosition: 'center',\n backgroundRepeat: 'no-repeat',\n backgroundSize: 'cover',\n height: '50px', // $icon-size - $image-margin * 2 image-margin was 5px in mashlib and icon size 60px\n width: '50px'\n },\n 'header-banner': {\n boxShadow: '0px 1px 4px #000000', // the color was defined in mashlib as a SASS variable $divider_color\n display: 'flex',\n justifyContent: 'space-between',\n padding: '0 1.5em',\n marginBottom: '4px'\n },\n 'header-banner__link': {\n display: 'block'\n },\n 'header-banner__right-menu': {\n display: 'flex'\n },\n 'header-banner__login': {\n marginLeft: 'auto',\n input: {\n // hacks to override the default style of login and signup button from solid-ui\n margin: '0.75em 0 0.75em 0.5em !important',\n padding: '0.5em !important'\n }\n },\n 'header-banner__user-menu': {\n borderLeft: 'solid 1px #000000', // the color was defined in mashlib as a SASS variable $divider_color\n marginLeft: 'auto'\n },\n 'header-banner__help-menu': {\n borderLeft: 'solid 1px #000000', // the color was defined in mashlib as a SASS variable $divider_color\n marginLeft: 'auto'\n },\n 'header-banner__icon': {\n backgroundSize: '65px 60px',\n height: '60px !important', // this is the icon size\n width: '65px !important' // may just be 65px round($icon-size * 352 / 322);\n },\n 'header-banner__help-icon': {\n width: '28px !important'\n }\n}\n"],"mappings":";;;;;;AAAO,IAAMA,QAAQ,GAAG;EACtB,oBAAoB,EADE;EAGtB,0BAA0B;IACxBC,UAAU,EAAE,MADY;IAExBC,MAAM,EAAE,GAFgB;IAGxBC,KAAK,EAAE,OAHiB;IAIxBC,MAAM,EAAE,SAJgB;IAKxBC,OAAO,EAAE,OALe;IAMxBC,UAAU,EAAE,OANY;IAOxBC,QAAQ,EAAE,KAPc;IAQxBC,SAAS,EAAE,MARa;IASxBC,OAAO,EAAE,KATe;IAUxBC,KAAK,EAAE,MAViB;IAWxB,oBAAoB;MAClBC,eAAe,EAAE,kEADC,CAElB;;IAFkB,CAXI;IAexBC,CAAC,EAAE;MACDC,cAAc,EAAE;IADf;EAfqB,CAHJ;EAsBtB,6BAA6B;IAC3BZ,UAAU,EAAE,MADe;IAE3BC,MAAM,EAAE,GAFmB;IAG3BE,MAAM,EAAE,SAHmB;IAI3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EAAE,qBADI;IACmB;IAClCtB,OAAO,EAAE,MAFM;IAGfuB,cAAc,EAAE,eAHD;IAIfnB,OAAO,EAAE,SAJM;IAKfoB,YAAY,EAAE;EALC,CAjFK;EAwFtB,uBAAuB;IACrBxB,OAAO,EAAE;EADY,CAxFD;EA2FtB,6BAA6B;IAC3BA,OAAO,EAAE;EADkB,CA3FP;EA8FtB,wBAAwB;IACtByB,UAAU,EAAE,MADU;IAEtBC,KAAK,EAAE;MACL;MACAb,MAAM,EAAE,kCAFH;MAGLT,OAAO,EAAE;IAHJ;EAFe,CA9FF;EAsGtB,4BAA4B;IAC1BuB,UAAU,EAAE,mBADc;IACO;IACjCF,UAAU,EAAE;EAFc,CAtGN;EA0GtB,4BAA4B;IAC1BE,UAAU,EAAE,mBADc;IACO;IACjCF,UAAU,EAAE;EAFc,CA1GN;EA8GtB,uBAAuB;IACrBJ,cAAc,EAAE,WADK;IAErBZ,MAAM,EAAE,iBAFa;IAEM;IAC3BJ,KAAK,EAAE,iBAHc,CAGI;;EAHJ,CA9GD;EAmHtB,4BAA4B;IAC1BA,KAAK,EAAE;EADmB;AAnHN,CAAjB"}
1
+ {"version":3,"file":"styleMap.js","names":["styleMap","background","border","color","cursor","display","fontFamily","fontSize","textAlign","padding","width","backgroundColor","a","textDecoration","height","img","borderRadius","listStyle","margin","borderRight","position","right","top","borderBottom","backgroundPosition","backgroundRepeat","backgroundSize","boxShadow","justifyContent","marginBottom","marginLeft","input","borderLeft"],"sources":["../../src/header/styleMap.ts"],"sourcesContent":["export const styleMap = {\n 'header-user-menu': {\n },\n 'header-user-menu__link': {\n background: 'none',\n border: '0',\n color: 'black',\n cursor: 'pointer',\n display: 'block',\n fontFamily: 'Arial',\n fontSize: '1em',\n textAlign: 'left',\n padding: '1em',\n width: '100%',\n '&:focus, &:hover': {\n backgroundColor: 'linear-gradient(to right, #7C4DFF 0%, #18A9E6 50%, #01C9EA 100%)'\n // backgroundColor: '#eee'\n },\n a: {\n textDecoration: 'none'\n }\n },\n 'header-user-menu__trigger': {\n background: 'none',\n border: '0',\n cursor: 'pointer',\n width: '60px', // defined in mashlib as a SASS variable $icon_size\n height: '60px', // defined in mashlib as a SASS variable $icon_size\n img: {\n borderRadius: '50%',\n height: '56px', // defined in mashlib as a SASS variable $icon_size - 4px\n width: '56px'\n }\n },\n 'header-user-menu__button': {\n background: 'none',\n border: '0',\n color: 'black',\n cursor: 'pointer',\n display: 'block',\n fontFamily: 'Arial',\n fontSize: '1em',\n textAlign: 'left',\n padding: '1em',\n width: '100%',\n '&:focus, &:hover': {\n backgroundColor: 'linear-gradient(to right, #7C4DFF 0%, #18A9E6 50%, #01C9EA 100%)'\n }\n },\n 'header-user-menu__list': {\n listStyle: 'none',\n margin: '0',\n padding: '0'\n },\n 'header-user-menu__navigation-menu': {\n background: 'white',\n border: 'solid 1px #000000', // the color was defined in mashlib as a SASS variable $divider_color\n borderRight: '0',\n position: 'absolute',\n right: '0',\n top: '60px', // defined in mashlib as a SASS variable $icon_size\n width: '200px',\n 'z-index': '1',\n '&[aria-hidden = true]': {\n display: 'none'\n }\n },\n 'header-user-menu__list-item': {\n borderBottom: 'solid 1px #000000', // the color was defined in mashlib as a SASS variable $divider_color\n '&:last-child': {\n border: '0'\n }\n },\n 'header-user-menu__photo': {\n borderRadius: '50%',\n backgroundPosition: 'center',\n backgroundRepeat: 'no-repeat',\n backgroundSize: 'cover',\n height: '50px', // $icon-size - $image-margin * 2 image-margin was 5px in mashlib and icon size 60px\n width: '50px'\n },\n 'header-banner': {\n boxShadow: '0px 1px 4px #000000', // the color was defined in mashlib as a SASS variable $divider_color\n display: 'flex',\n justifyContent: 'space-between',\n padding: '0 1.5em',\n marginBottom: '4px'\n },\n 'header-banner__link': {\n display: 'block'\n },\n 'header-banner__right-menu': {\n display: 'flex'\n },\n 'header-banner__login': {\n marginLeft: 'auto',\n input: {\n // hacks to override the default style of login and signup button from solid-ui\n margin: '0.75em 0 0.75em 0.5em !important',\n padding: '0.5em !important'\n }\n },\n 'header-banner__user-menu': {\n borderLeft: 'solid 1px #000000', // the color was defined in mashlib as a SASS variable $divider_color\n marginLeft: 'auto'\n },\n 'header-banner__help-menu': {\n borderLeft: 'solid 1px #000000', // the color was defined in mashlib as a SASS variable $divider_color\n marginLeft: 'auto'\n },\n 'header-banner__icon': {\n backgroundSize: '65px 60px',\n height: '60px !important', // this is the icon size\n width: '65px !important' // may just be 65px round($icon-size * 352 / 322);\n },\n 'header-banner__help-icon': {\n width: '28px !important'\n }\n}\n"],"mappings":";;;;;;AAAO,IAAMA,QAAQ,GAAG;EACtB,kBAAkB,EAAE,CACpB,CAAC;EACD,wBAAwB,EAAE;IACxBC,UAAU,EAAE,MAAM;IAClBC,MAAM,EAAE,GAAG;IACXC,KAAK,EAAE,OAAO;IACdC,MAAM,EAAE,SAAS;IACjBC,OAAO,EAAE,OAAO;IAChBC,UAAU,EAAE,OAAO;IACnBC,QAAQ,EAAE,KAAK;IACfC,SAAS,EAAE,MAAM;IACjBC,OAAO,EAAE,KAAK;IACdC,KAAK,EAAE,MAAM;IACb,kBAAkB,EAAE;MAClBC,eAAe,EAAE;MACjB;IACF,CAAC;;IACDC,CAAC,EAAE;MACDC,cAAc,EAAE;IAClB;EACF,CAAC;EACD,2BAA2B,EAAE;IAC3BZ,UAAU,EAAE,MAAM;IAClBC,MAAM,EAAE,GAAG;IACXE,MAAM,EAAE,SAAS;IACjBM,KAAK,EAAE,MAAM;IAAE;IACfI,MAAM,EAAE,MAAM;IAAE;IAChBC,GAAG,EAAE;MACHC,YAAY,EAAE,KAAK;MACnBF,MAAM,EAAE,MAAM;MAAE;MAChBJ,KAAK,EAAE;IACT;EACF,CAAC;EACD,0BAA0B,EAAE;IAC1BT,UAAU,EAAE,MAAM;IAClBC,MAAM,EAAE,GAAG;IACXC,KAAK,EAAE,OAAO;IACdC,MAAM,EAAE,SAAS;IACjBC,OAAO,EAAE,OAAO;IAChBC,UAAU,EAAE,OAAO;IACnBC,QAAQ,EAAE,KAAK;IAC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AC1BuB,UAAU,EAAE,mBAAmB;IAAE;IACjCF,UAAU,EAAE;EACd,CAAC;EACD,0BAA0B,EAAE;IAC1BE,UAAU,EAAE,mBAAmB;IAAE;IACjCF,UAAU,EAAE;EACd,CAAC;EACD,qBAAqB,EAAE;IACrBJ,cAAc,EAAE,WAAW;IAC3BZ,MAAM,EAAE,iBAAiB;IAAE;IAC3BJ,KAAK,EAAE,iBAAiB,CAAC;EAC3B,CAAC;;EACD,0BAA0B,EAAE;IAC1BA,KAAK,EAAE;EACT;AACF,CAAC;AAAA"}
package/lib/iconBase.js CHANGED
@@ -4,9 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.originalIconBase = exports.icons = exports.iconBase = void 0;
7
-
8
7
  var _debug = require("./debug");
9
-
10
8
  // Works in FF extension - what about browserify??
11
9
  // 2021-04-08 Convert to TS
12
10
 
@@ -21,8 +19,8 @@ var _debug = require("./debug");
21
19
  * You can also use it if you want to just run a mashlib whhich takes its
22
20
  * icons seved by other than github.
23
21
  */
24
-
25
22
  /* eslint-disable multiline-ternary */
23
+
26
24
  // Do not export. Always us this module to find the icons, as they vary
27
25
  var iconsOnGithub = 'https://solidos.github.io/solid-ui/src'; // changed org 2022-05
28
26
 
@@ -40,8 +38,9 @@ var icons = module.scriptURI // Firefox extension
40
38
  originalIconBase: iconsOnGithub + '/originalIcons/'
41
39
  };
42
40
  exports.icons = icons;
43
- (0, _debug.log)(' icons.iconBase is set to : ' + icons.iconBase); // allow tests etc named-import this directly from this module
41
+ (0, _debug.log)(' icons.iconBase is set to : ' + icons.iconBase);
44
42
 
43
+ // allow tests etc named-import this directly from this module
45
44
  var iconBase = icons.iconBase;
46
45
  exports.iconBase = iconBase;
47
46
  var originalIconBase = icons.originalIconBase;
@@ -1 +1 @@
1
- {"version":3,"file":"iconBase.js","names":["iconsOnGithub","icons","module","scriptURI","iconBase","slice","lastIndexOf","originalIconBase","$SolidTestEnvironment","log"],"sources":["../src/iconBase.ts"],"sourcesContent":["// Works in FF extension - what about browserify??\n// 2021-04-08 Convert to TS\n\n/* The Firefox case is left for historical record, as we don't currenly\n * have a FF extension for mashlib, but we could. This is sthepoint to\n * hack the place it can find its icons internally\n *\n * The $SolidTestEnvironment is important and is used for\n * example when testing on localhost to specify a place the icons be found\n * in your test set up.\n *\n * You can also use it if you want to just run a mashlib whhich takes its\n * icons seved by other than github.\n */\n/* eslint-disable multiline-ternary */\n\nimport { log } from './debug'\n\ndeclare let $SolidTestEnvironment\n\n// Do not export. Always us this module to find the icons, as they vary\nconst iconsOnGithub = 'https://solidos.github.io/solid-ui/src' // changed org 2022-05\n\nexport const icons = (module as any).scriptURI // Firefox extension\n ? {\n iconBase:\n (module as any).scriptURI.slice(0, (module as any).scriptURI.lastIndexOf('/')) + '/icons/',\n originalIconBase:\n (module as any).scriptURI.slice(0, (module as any).scriptURI.lastIndexOf('/')) +\n '/originalIcons/'\n }\n : typeof $SolidTestEnvironment !== 'undefined' && $SolidTestEnvironment.iconBase // Test environemnt\n ? {\n iconBase: $SolidTestEnvironment.iconBase,\n originalIconBase: $SolidTestEnvironment.originalIconBase\n }\n : {\n // Normal case:\n iconBase: iconsOnGithub + '/icons/',\n originalIconBase: iconsOnGithub + '/originalIcons/'\n }\n\nlog(' icons.iconBase is set to : ' + icons.iconBase)\n\n// allow tests etc named-import this directly from this module\nexport const iconBase = icons.iconBase\nexport const originalIconBase = icons.originalIconBase\n"],"mappings":";;;;;;;AAgBA;;AAhBA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA;AAMA;AACA,IAAMA,aAAa,GAAG,wCAAtB,C,CAA+D;;AAExD,IAAMC,KAAK,GAAIC,MAAD,CAAgBC,SAAhB,CAA0B;AAA1B,EACjB;EACEC,QAAQ,EACLF,MAAD,CAAgBC,SAAhB,CAA0BE,KAA1B,CAAgC,CAAhC,EAAoCH,MAAD,CAAgBC,SAAhB,CAA0BG,WAA1B,CAAsC,GAAtC,CAAnC,IAAiF,SAFrF;EAGEC,gBAAgB,EACbL,MAAD,CAAgBC,SAAhB,CAA0BE,KAA1B,CAAgC,CAAhC,EAAoCH,MAAD,CAAgBC,SAAhB,CAA0BG,WAA1B,CAAsC,GAAtC,CAAnC,IACA;AALJ,CADiB,GAQjB,OAAOE,qBAAP,KAAiC,WAAjC,IAAgDA,qBAAqB,CAACJ,QAAtE,CAA+E;AAA/E,EACE;EACEA,QAAQ,EAAEI,qBAAqB,CAACJ,QADlC;EAEEG,gBAAgB,EAAEC,qBAAqB,CAACD;AAF1C,CADF,GAKE;EACA;EACEH,QAAQ,EAAEJ,aAAa,GAAG,SAF5B;EAGEO,gBAAgB,EAAEP,aAAa,GAAG;AAHpC,CAbC;;AAmBP,IAAAS,UAAA,EAAI,mCAAmCR,KAAK,CAACG,QAA7C,E,CAEA;;AACO,IAAMA,QAAQ,GAAGH,KAAK,CAACG,QAAvB;;AACA,IAAMG,gBAAgB,GAAGN,KAAK,CAACM,gBAA/B"}
1
+ {"version":3,"file":"iconBase.js","names":["iconsOnGithub","icons","module","scriptURI","iconBase","slice","lastIndexOf","originalIconBase","$SolidTestEnvironment","log"],"sources":["../src/iconBase.ts"],"sourcesContent":["// Works in FF extension - what about browserify??\n// 2021-04-08 Convert to TS\n\n/* The Firefox case is left for historical record, as we don't currenly\n * have a FF extension for mashlib, but we could. This is sthepoint to\n * hack the place it can find its icons internally\n *\n * The $SolidTestEnvironment is important and is used for\n * example when testing on localhost to specify a place the icons be found\n * in your test set up.\n *\n * You can also use it if you want to just run a mashlib whhich takes its\n * icons seved by other than github.\n */\n/* eslint-disable multiline-ternary */\n\nimport { log } from './debug'\n\ndeclare let $SolidTestEnvironment\n\n// Do not export. Always us this module to find the icons, as they vary\nconst iconsOnGithub = 'https://solidos.github.io/solid-ui/src' // changed org 2022-05\n\nexport const icons = (module as any).scriptURI // Firefox extension\n ? {\n iconBase:\n (module as any).scriptURI.slice(0, (module as any).scriptURI.lastIndexOf('/')) + '/icons/',\n originalIconBase:\n (module as any).scriptURI.slice(0, (module as any).scriptURI.lastIndexOf('/')) +\n '/originalIcons/'\n }\n : typeof $SolidTestEnvironment !== 'undefined' && $SolidTestEnvironment.iconBase // Test environemnt\n ? {\n iconBase: $SolidTestEnvironment.iconBase,\n originalIconBase: $SolidTestEnvironment.originalIconBase\n }\n : {\n // Normal case:\n iconBase: iconsOnGithub + '/icons/',\n originalIconBase: iconsOnGithub + '/originalIcons/'\n }\n\nlog(' icons.iconBase is set to : ' + icons.iconBase)\n\n// allow tests etc named-import this directly from this module\nexport const iconBase = icons.iconBase\nexport const originalIconBase = icons.originalIconBase\n"],"mappings":";;;;;;AAgBA;AAhBA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAMA;AACA,IAAMA,aAAa,GAAG,wCAAwC,EAAC;;AAExD,IAAMC,KAAK,GAAIC,MAAM,CAASC,SAAS,CAAC;AAAA,EAC3C;EACEC,QAAQ,EACLF,MAAM,CAASC,SAAS,CAACE,KAAK,CAAC,CAAC,EAAGH,MAAM,CAASC,SAAS,CAACG,WAAW,CAAC,GAAG,CAAC,CAAC,GAAG,SAAS;EAC5FC,gBAAgB,EACbL,MAAM,CAASC,SAAS,CAACE,KAAK,CAAC,CAAC,EAAGH,MAAM,CAASC,SAAS,CAACG,WAAW,CAAC,GAAG,CAAC,CAAC,GAC9E;AACJ,CAAC,GACD,OAAOE,qBAAqB,KAAK,WAAW,IAAIA,qBAAqB,CAACJ,QAAQ,CAAC;AAAA,EAC7E;EACEA,QAAQ,EAAEI,qBAAqB,CAACJ,QAAQ;EACxCG,gBAAgB,EAAEC,qBAAqB,CAACD;AAC1C,CAAC,GACD;EACA;EACEH,QAAQ,EAAEJ,aAAa,GAAG,SAAS;EACnCO,gBAAgB,EAAEP,aAAa,GAAG;AACpC,CAAC;AAAA;AAEP,IAAAS,UAAG,EAAC,gCAAgC,GAAGR,KAAK,CAACG,QAAQ,CAAC;;AAEtD;AACO,IAAMA,QAAQ,GAAGH,KAAK,CAACG,QAAQ;AAAA;AAC/B,IAAMG,gBAAgB,GAAGN,KAAK,CAACM,gBAAgB;AAAA"}