solid-ui 2.4.18 → 2.4.19-0b203531

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 (267) hide show
  1. package/LICENSE.md +0 -0
  2. package/README.md +3 -2
  3. package/dist/index.html +9 -0
  4. package/{lib/webpack-bundle.js → dist/main.js} +64582 -88230
  5. package/dist/main.js.map +1 -0
  6. package/lib/acl/access-controller.d.ts +0 -0
  7. package/lib/acl/access-controller.d.ts.map +0 -0
  8. package/lib/acl/access-controller.js +0 -0
  9. package/lib/acl/access-controller.js.map +0 -0
  10. package/lib/acl/access-groups.d.ts +0 -0
  11. package/lib/acl/access-groups.d.ts.map +0 -0
  12. package/lib/acl/access-groups.js +0 -0
  13. package/lib/acl/access-groups.js.map +1 -1
  14. package/lib/acl/acl-control.d.ts +0 -0
  15. package/lib/acl/acl-control.d.ts.map +0 -0
  16. package/lib/acl/acl-control.js +0 -0
  17. package/lib/acl/acl-control.js.map +0 -0
  18. package/lib/acl/acl.d.ts +1 -1
  19. package/lib/acl/acl.d.ts.map +1 -1
  20. package/lib/acl/acl.js +2 -4
  21. package/lib/acl/acl.js.map +1 -1
  22. package/lib/acl/add-agent-buttons.d.ts +0 -0
  23. package/lib/acl/add-agent-buttons.d.ts.map +1 -1
  24. package/lib/acl/add-agent-buttons.js +5 -5
  25. package/lib/acl/add-agent-buttons.js.map +1 -1
  26. package/lib/acl/index.d.ts +0 -0
  27. package/lib/acl/index.d.ts.map +0 -0
  28. package/lib/acl/index.js +0 -0
  29. package/lib/acl/index.js.map +0 -0
  30. package/lib/acl/styles.d.ts +0 -0
  31. package/lib/acl/styles.d.ts.map +0 -0
  32. package/lib/acl/styles.js +0 -0
  33. package/lib/acl/styles.js.map +0 -0
  34. package/lib/acl/types.d.ts +0 -0
  35. package/lib/acl/types.d.ts.map +0 -0
  36. package/lib/acl/types.js +0 -0
  37. package/lib/acl/types.js.map +0 -0
  38. package/lib/chat/bookmarks.js +20 -22
  39. package/lib/chat/bookmarks.js.map +1 -1
  40. package/lib/chat/chatLogic.js +13 -15
  41. package/lib/chat/chatLogic.js.map +1 -1
  42. package/lib/chat/dateFolder.js +10 -10
  43. package/lib/chat/dateFolder.js.map +1 -1
  44. package/lib/chat/infinite.js +14 -16
  45. package/lib/chat/infinite.js.map +1 -1
  46. package/lib/chat/message.js +19 -23
  47. package/lib/chat/message.js.map +1 -1
  48. package/lib/chat/messageTools.js +16 -21
  49. package/lib/chat/messageTools.js.map +1 -1
  50. package/lib/chat/thread.js +24 -24
  51. package/lib/chat/thread.js.map +1 -1
  52. package/lib/create/create.d.ts +0 -0
  53. package/lib/create/create.d.ts.map +1 -1
  54. package/lib/create/create.js +9 -9
  55. package/lib/create/create.js.map +1 -1
  56. package/lib/create/index.d.ts +0 -0
  57. package/lib/create/index.d.ts.map +0 -0
  58. package/lib/create/index.js +0 -0
  59. package/lib/create/index.js.map +0 -0
  60. package/lib/create/types.d.ts +0 -0
  61. package/lib/create/types.d.ts.map +0 -0
  62. package/lib/create/types.js +0 -0
  63. package/lib/create/types.js.map +0 -0
  64. package/lib/debug.d.ts +0 -0
  65. package/lib/debug.d.ts.map +0 -0
  66. package/lib/debug.js +0 -0
  67. package/lib/debug.js.map +0 -0
  68. package/lib/folders.js +2 -6
  69. package/lib/folders.js.map +1 -1
  70. package/lib/footer/index.d.ts +0 -0
  71. package/lib/footer/index.d.ts.map +0 -0
  72. package/lib/footer/index.js +4 -4
  73. package/lib/footer/index.js.map +1 -1
  74. package/lib/footer/styleMap.d.ts +0 -0
  75. package/lib/footer/styleMap.d.ts.map +0 -0
  76. package/lib/footer/styleMap.js +0 -0
  77. package/lib/footer/styleMap.js.map +0 -0
  78. package/lib/header/empty-profile.d.ts +0 -0
  79. package/lib/header/empty-profile.d.ts.map +0 -0
  80. package/lib/header/empty-profile.js +0 -0
  81. package/lib/header/empty-profile.js.map +0 -0
  82. package/lib/header/index.d.ts +0 -0
  83. package/lib/header/index.d.ts.map +1 -1
  84. package/lib/header/index.js +11 -8
  85. package/lib/header/index.js.map +1 -1
  86. package/lib/header/styleMap.d.ts +0 -0
  87. package/lib/header/styleMap.d.ts.map +0 -0
  88. package/lib/header/styleMap.js +0 -0
  89. package/lib/header/styleMap.js.map +0 -0
  90. package/lib/iconBase.d.ts +0 -0
  91. package/lib/iconBase.d.ts.map +0 -0
  92. package/lib/iconBase.js +0 -0
  93. package/lib/iconBase.js.map +0 -0
  94. package/lib/icons/solid_logo.d.ts +0 -0
  95. package/lib/icons/solid_logo.d.ts.map +0 -0
  96. package/lib/icons/solid_logo.js +0 -0
  97. package/lib/icons/solid_logo.js.map +0 -0
  98. package/lib/index.d.ts +5 -5
  99. package/lib/index.d.ts.map +1 -1
  100. package/lib/index.js +33 -33
  101. package/lib/index.js.map +1 -1
  102. package/lib/jss/index.d.ts +0 -0
  103. package/lib/jss/index.d.ts.map +0 -0
  104. package/lib/jss/index.js +0 -0
  105. package/lib/jss/index.js.map +0 -0
  106. package/lib/log.d.ts +0 -0
  107. package/lib/log.d.ts.map +0 -0
  108. package/lib/log.js +0 -0
  109. package/lib/log.js.map +0 -0
  110. package/lib/login/login.d.ts +130 -0
  111. package/lib/login/login.d.ts.map +1 -0
  112. package/lib/login/login.js +1415 -0
  113. package/lib/login/login.js.map +1 -0
  114. package/lib/matrix/index.d.ts +0 -0
  115. package/lib/matrix/index.d.ts.map +0 -0
  116. package/lib/matrix/index.js +0 -0
  117. package/lib/matrix/index.js.map +0 -0
  118. package/lib/matrix/matrix.d.ts +0 -0
  119. package/lib/matrix/matrix.d.ts.map +0 -0
  120. package/lib/matrix/matrix.js +2 -2
  121. package/lib/matrix/matrix.js.map +1 -1
  122. package/lib/matrix/types.d.ts +0 -0
  123. package/lib/matrix/types.d.ts.map +0 -0
  124. package/lib/matrix/types.js +0 -0
  125. package/lib/matrix/types.js.map +0 -0
  126. package/lib/media/index.d.ts +0 -0
  127. package/lib/media/index.d.ts.map +0 -0
  128. package/lib/media/index.js +0 -0
  129. package/lib/media/index.js.map +0 -0
  130. package/lib/media/media-capture.d.ts +0 -0
  131. package/lib/media/media-capture.d.ts.map +0 -0
  132. package/lib/media/media-capture.js +0 -0
  133. package/lib/media/media-capture.js.map +1 -1
  134. package/lib/messageArea.js +9 -10
  135. package/lib/messageArea.js.map +1 -1
  136. package/lib/noun_Camera_1618446_000000.js +0 -0
  137. package/lib/noun_Camera_1618446_000000.js.map +0 -0
  138. package/lib/ns.js +0 -0
  139. package/lib/ns.js.map +0 -0
  140. package/lib/pad.d.ts +0 -0
  141. package/lib/pad.d.ts.map +0 -0
  142. package/lib/pad.js +2 -2
  143. package/lib/pad.js.map +1 -1
  144. package/lib/participation.d.ts +0 -0
  145. package/lib/participation.d.ts.map +1 -1
  146. package/lib/participation.js +4 -5
  147. package/lib/participation.js.map +1 -1
  148. package/lib/preferences.js +8 -8
  149. package/lib/preferences.js.map +1 -1
  150. package/lib/{authn → signup}/config-default.js +0 -0
  151. package/lib/signup/config-default.js.map +1 -0
  152. package/lib/{authn → signup}/signup.js +0 -0
  153. package/lib/signup/signup.js.map +1 -0
  154. package/lib/stories/decorators.js +0 -0
  155. package/lib/stories/decorators.js.map +0 -0
  156. package/lib/style.js +0 -0
  157. package/lib/style.js.map +1 -1
  158. package/lib/table.js +2 -3
  159. package/lib/table.js.map +1 -1
  160. package/lib/tabs.d.ts +0 -0
  161. package/lib/tabs.d.ts.map +0 -0
  162. package/lib/tabs.js +3 -3
  163. package/lib/tabs.js.map +1 -1
  164. package/lib/typings.d.js +0 -0
  165. package/lib/typings.d.js.map +0 -0
  166. package/lib/utils/headerFooterHelpers.d.ts +0 -0
  167. package/lib/utils/headerFooterHelpers.d.ts.map +0 -0
  168. package/lib/utils/headerFooterHelpers.js +0 -0
  169. package/lib/utils/headerFooterHelpers.js.map +0 -0
  170. package/lib/utils/index.js +6 -6
  171. package/lib/utils/index.js.map +1 -1
  172. package/lib/utils/label.d.ts +0 -0
  173. package/lib/utils/label.d.ts.map +0 -0
  174. package/lib/utils/label.js +4 -5
  175. package/lib/utils/label.js.map +1 -1
  176. package/lib/versionInfo.d.ts +1 -2
  177. package/lib/versionInfo.d.ts.map +1 -1
  178. package/lib/versionInfo.js +17 -17
  179. package/lib/versionInfo.js.map +1 -1
  180. package/lib/widgets/buttons/iconLinks.d.ts +0 -0
  181. package/lib/widgets/buttons/iconLinks.d.ts.map +0 -0
  182. package/lib/widgets/buttons/iconLinks.js +0 -0
  183. package/lib/widgets/buttons/iconLinks.js.map +0 -0
  184. package/lib/widgets/buttons.d.ts +0 -0
  185. package/lib/widgets/buttons.d.ts.map +0 -0
  186. package/lib/widgets/buttons.js +16 -16
  187. package/lib/widgets/buttons.js.map +1 -1
  188. package/lib/widgets/dragAndDrop.js +0 -0
  189. package/lib/widgets/dragAndDrop.js.map +1 -1
  190. package/lib/widgets/error.d.ts +0 -0
  191. package/lib/widgets/error.d.ts.map +0 -0
  192. package/lib/widgets/error.js +0 -0
  193. package/lib/widgets/error.js.map +0 -0
  194. package/lib/widgets/forms/autocomplete/autocompleteBar.d.ts +0 -0
  195. package/lib/widgets/forms/autocomplete/autocompleteBar.d.ts.map +0 -0
  196. package/lib/widgets/forms/autocomplete/autocompleteBar.js +2 -2
  197. package/lib/widgets/forms/autocomplete/autocompleteBar.js.map +1 -1
  198. package/lib/widgets/forms/autocomplete/autocompleteField.d.ts +0 -0
  199. package/lib/widgets/forms/autocomplete/autocompleteField.d.ts.map +0 -0
  200. package/lib/widgets/forms/autocomplete/autocompleteField.js +2 -2
  201. package/lib/widgets/forms/autocomplete/autocompleteField.js.map +1 -1
  202. package/lib/widgets/forms/autocomplete/autocompletePicker.d.ts +0 -0
  203. package/lib/widgets/forms/autocomplete/autocompletePicker.d.ts.map +0 -0
  204. package/lib/widgets/forms/autocomplete/autocompletePicker.js +2 -2
  205. package/lib/widgets/forms/autocomplete/autocompletePicker.js.map +1 -1
  206. package/lib/widgets/forms/autocomplete/language.d.ts +0 -0
  207. package/lib/widgets/forms/autocomplete/language.d.ts.map +1 -1
  208. package/lib/widgets/forms/autocomplete/language.js +7 -10
  209. package/lib/widgets/forms/autocomplete/language.js.map +1 -1
  210. package/lib/widgets/forms/autocomplete/publicData.d.ts +1 -1
  211. package/lib/widgets/forms/autocomplete/publicData.d.ts.map +1 -1
  212. package/lib/widgets/forms/autocomplete/publicData.js +15 -16
  213. package/lib/widgets/forms/autocomplete/publicData.js.map +1 -1
  214. package/lib/widgets/forms/basic.d.ts +1 -1
  215. package/lib/widgets/forms/basic.d.ts.map +1 -1
  216. package/lib/widgets/forms/basic.js +2 -2
  217. package/lib/widgets/forms/basic.js.map +1 -1
  218. package/lib/widgets/forms/comment.d.ts +1 -1
  219. package/lib/widgets/forms/comment.d.ts.map +0 -0
  220. package/lib/widgets/forms/comment.js +3 -3
  221. package/lib/widgets/forms/comment.js.map +1 -1
  222. package/lib/widgets/forms/fieldFunction.d.ts +0 -0
  223. package/lib/widgets/forms/fieldFunction.d.ts.map +0 -0
  224. package/lib/widgets/forms/fieldFunction.js +2 -2
  225. package/lib/widgets/forms/fieldFunction.js.map +1 -1
  226. package/lib/widgets/forms/fieldParams.d.ts +0 -0
  227. package/lib/widgets/forms/fieldParams.d.ts.map +0 -0
  228. package/lib/widgets/forms/fieldParams.js +0 -0
  229. package/lib/widgets/forms/fieldParams.js.map +0 -0
  230. package/lib/widgets/forms/formStyle.d.ts +0 -0
  231. package/lib/widgets/forms/formStyle.d.ts.map +0 -0
  232. package/lib/widgets/forms/formStyle.js +3 -3
  233. package/lib/widgets/forms/formStyle.js.map +1 -1
  234. package/lib/widgets/forms.js +10 -10
  235. package/lib/widgets/forms.js.map +1 -1
  236. package/lib/widgets/index.js +0 -0
  237. package/lib/widgets/index.js.map +0 -0
  238. package/lib/widgets/peoplePicker.js +2 -2
  239. package/lib/widgets/peoplePicker.js.map +1 -1
  240. package/lib/widgets/widgetHelpers.d.ts +0 -0
  241. package/lib/widgets/widgetHelpers.d.ts.map +0 -0
  242. package/lib/widgets/widgetHelpers.js +0 -0
  243. package/lib/widgets/widgetHelpers.js.map +0 -0
  244. package/package.json +47 -45
  245. package/lib/authn/authSession.d.ts +0 -4
  246. package/lib/authn/authSession.d.ts.map +0 -1
  247. package/lib/authn/authSession.js +0 -25
  248. package/lib/authn/authSession.js.map +0 -1
  249. package/lib/authn/authn.d.ts +0 -193
  250. package/lib/authn/authn.d.ts.map +0 -1
  251. package/lib/authn/authn.js +0 -2238
  252. package/lib/authn/authn.js.map +0 -1
  253. package/lib/authn/config-default.js.map +0 -1
  254. package/lib/authn/index.d.ts +0 -35
  255. package/lib/authn/index.d.ts.map +0 -1
  256. package/lib/authn/index.js +0 -44
  257. package/lib/authn/index.js.map +0 -1
  258. package/lib/authn/signup.js.map +0 -1
  259. package/lib/authn/types.d.ts +0 -25
  260. package/lib/authn/types.d.ts.map +0 -1
  261. package/lib/authn/types.js +0 -6
  262. package/lib/authn/types.js.map +0 -1
  263. package/lib/logic.d.ts +0 -8
  264. package/lib/logic.d.ts.map +0 -1
  265. package/lib/logic.js +0 -79
  266. package/lib/logic.js.map +0 -1
  267. package/lib/webpack-bundle.js.map +0 -1
@@ -22,9 +22,11 @@ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"))
22
22
 
23
23
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
24
24
 
25
- var _iconBase = require("../iconBase");
25
+ var _index = require("../index");
26
26
 
27
- var _authn = require("../authn/authn");
27
+ var _solidLogic = require("solid-logic");
28
+
29
+ var _login = require("../login/login");
28
30
 
29
31
  var widgets = _interopRequireWildcard(require("../widgets"));
30
32
 
@@ -42,11 +44,12 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
42
44
  This file was copied from mashlib/src/global/header.ts file. It is modified to
43
45
  work in solid-ui by adjusting where imported functions are found.
44
46
  */
47
+ // import { loginStatusBox, authSession, currentUser } from '../authn/authn'
45
48
 
46
49
  /**
47
50
  * menu icons
48
51
  */
49
- var DEFAULT_HELP_MENU_ICON = _iconBase.icons.iconBase + 'noun_help.svg';
52
+ var DEFAULT_HELP_MENU_ICON = _index.icons.iconBase + 'noun_help.svg';
50
53
  var DEFAUL_SOLID_ICON_URL = 'https://solidproject.org/assets/img/solid-emblem.svg';
51
54
 
52
55
  /**
@@ -84,9 +87,9 @@ function _initHeader() {
84
87
  pod = (0, _headerFooterHelpers.getPod)();
85
88
  rebuildHeader(header, store, pod, userMenuList, options)();
86
89
 
87
- _authn.authSession.onLogout(rebuildHeader(header, store, pod, userMenuList, options));
90
+ _solidLogic.authSession.onLogout(rebuildHeader(header, store, pod, userMenuList, options));
88
91
 
89
- _authn.authSession.onLogin(rebuildHeader(header, store, pod, userMenuList, options));
92
+ _solidLogic.authSession.onLogin(rebuildHeader(header, store, pod, userMenuList, options));
90
93
 
91
94
  case 7:
92
95
  case "end":
@@ -105,7 +108,7 @@ function rebuildHeader(header, store, pod, userMenuList, options) {
105
108
  while (1) {
106
109
  switch (_context.prev = _context.next) {
107
110
  case 0:
108
- user = (0, _authn.currentUser)();
111
+ user = _solidLogic.authn.currentUser();
109
112
  header.innerHTML = '';
110
113
  _context.t0 = header;
111
114
  _context.next = 5;
@@ -224,7 +227,7 @@ function createHelpMenu(options, helpMenuItems) {
224
227
  (0, _headerFooterHelpers.addStyleClassToElement)(helpMenuTrigger, ['header-user-menu__trigger']);
225
228
  helpMenuTrigger.type = 'button';
226
229
  var helpMenuIcon = document.createElement('img');
227
- helpMenuIcon.src = options && options.helpIcon ? options.helpIcon : _iconBase.icons.iconBase + DEFAULT_HELP_MENU_ICON;
230
+ helpMenuIcon.src = options && options.helpIcon ? options.helpIcon : _index.icons.iconBase + DEFAULT_HELP_MENU_ICON;
228
231
  (0, _headerFooterHelpers.addStyleClassToElement)(helpMenuIcon, ['header-banner__help-icon']);
229
232
  helpMenuContainer.appendChild(helpMenuTrigger);
230
233
  helpMenuTrigger.appendChild(helpMenuIcon);
@@ -254,7 +257,7 @@ function createHelpMenu(options, helpMenuItems) {
254
257
  function createLoginSignUpButtons() {
255
258
  var profileLoginButtonPre = document.createElement('div');
256
259
  (0, _headerFooterHelpers.addStyleClassToElement)(profileLoginButtonPre, ['header-banner__login']);
257
- profileLoginButtonPre.appendChild((0, _authn.loginStatusBox)(document, null, {}));
260
+ profileLoginButtonPre.appendChild((0, _login.loginStatusBox)(document, null, {}));
258
261
  return profileLoginButtonPre;
259
262
  }
260
263
  /**
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/header/index.ts"],"names":["DEFAULT_HELP_MENU_ICON","icons","iconBase","DEFAUL_SOLID_ICON_URL","initHeader","store","userMenuList","options","header","document","getElementById","pod","rebuildHeader","authSession","onLogout","onLogin","user","innerHTML","createBanner","appendChild","podLink","createElement","href","uri","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","event","toggleMenu","addEventListener","timer","setTimeout","clearTimeout","profileLoginButtonPre","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"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAMA;;AACA;;AACA;;AACA;;AACA;;;;;;AAVA;;AACA;AACA;AACA;AACA;;AAQA;AACA;AACA;AACA,IAAMA,sBAAsB,GAAGC,gBAAMC,QAAN,GAAiB,eAAhD;AACA,IAAMC,qBAAqB,GAAG,sDAA9B;;AAyBA;AACA;AACA;AACA;AACA;AACA;AACA;SACsBC,U;;;AAWtB;AACA;AACA;;;;8FAbO,kBAA2BC,KAA3B,EAAkDC,YAAlD,EAA6EC,OAA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,YAAL,CAAkB,aAAlB,EAAiCqC,UAAU,CAACI,QAAX,EAAjC;AACD","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 '../iconBase'\nimport { 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 = 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"],"file":"index.js"}
1
+ {"version":3,"sources":["../../src/header/index.ts"],"names":["DEFAULT_HELP_MENU_ICON","icons","iconBase","DEFAUL_SOLID_ICON_URL","initHeader","store","userMenuList","options","header","document","getElementById","pod","rebuildHeader","authSession","onLogout","onLogin","user","authn","currentUser","innerHTML","createBanner","appendChild","podLink","createElement","href","uri","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","event","toggleMenu","addEventListener","timer","setTimeout","clearTimeout","profileLoginButtonPre","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"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAMA;;AACA;;AACA;;AAEA;;AACA;;AACA;;;;;;AAZA;;AACA;AACA;AACA;AACA;AAKA;;AAKA;AACA;AACA;AACA,IAAMA,sBAAsB,GAAGC,aAAMC,QAAN,GAAiB,eAAhD;AACA,IAAMC,qBAAqB,GAAG,sDAA9B;;AAyBA;AACA;AACA;AACA;AACA;AACA;AACA;SACsBC,U;;;AAWtB;AACA;AACA;;;;8FAbO,kBAA2BC,KAA3B,EAAkDC,YAAlD,EAA6EC,OAA7E;AAAA;AAAA;AAAA;AAAA;AAAA;AACCC,YAAAA,MADD,GACUC,QAAQ,CAACC,cAAT,CAAwB,YAAxB,CADV;;AAAA,gBAEAF,MAFA;AAAA;AAAA;AAAA;;AAAA;;AAAA;AAMCG,YAAAA,GAND,GAMO,kCANP;AAOLC,YAAAA,aAAa,CAACJ,MAAD,EAASH,KAAT,EAAgBM,GAAhB,EAAqBL,YAArB,EAAmCC,OAAnC,CAAb;;AACAM,oCAAYC,QAAZ,CAAqBF,aAAa,CAACJ,MAAD,EAASH,KAAT,EAAgBM,GAAhB,EAAqBL,YAArB,EAAmCC,OAAnC,CAAlC;;AACAM,oCAAYE,OAAZ,CAAoBH,aAAa,CAACJ,MAAD,EAASH,KAAT,EAAgBM,GAAhB,EAAqBL,YAArB,EAAmCC,OAAnC,CAAjC;;AATK;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,G;;;;AAcA,SAASK,aAAT,CAAwBJ,MAAxB,EAA6CH,KAA7C,EAAoEM,GAApE,EAAoFL,YAApF,EAA+GC,OAA/G,EAAwI;AAC7I,oGAAO;AAA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;AACAA,EAAAA,YAAY,CAACC,KAAb,CAAmBC,eAAnB,iBAA4CN,UAA5C;AACA,SAAOI,YAAP;AACD;AAED;AACA;AACA;;;AACA,SAASxB,UAAT,CAAqBD,KAArB,EAAmC4B,OAAnC,EAA+DC,IAA/D,EAAwF;AACtF,MAAMC,UAAU,GAAGF,OAAO,CAACG,YAAR,CAAqB,eAArB,MAA0C,MAA7D;AACA,MAAMC,MAAM,GAAGhC,KAAK,CAACJ,IAAN,KAAe,WAA9B;AACA,MAAMqC,KAAK,GAAGjC,KAAK,CAACJ,IAAN,KAAe,UAA7B;;AACA,MAAKkC,UAAU,IAAIE,MAAf,IAA2B,CAACF,UAAD,IAAeG,KAA9C,EAAsD;AACpD;AACD;;AACDL,EAAAA,OAAO,CAACnC,YAAR,CAAqB,eAArB,EAAsC,CAAC,CAACqC,UAAF,EAAcI,QAAd,EAAtC;AACAL,EAAAA,IAAI,CAACpC,YAAL,CAAkB,aAAlB,EAAiCqC,UAAU,CAACI,QAAX,EAAjC;AACD","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"],"file":"index.js"}
File without changes
File without changes
File without changes
File without changes
package/lib/iconBase.d.ts CHANGED
File without changes
File without changes
package/lib/iconBase.js CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/lib/index.d.ts CHANGED
@@ -10,7 +10,6 @@
10
10
  import * as rdf from 'rdflib';
11
11
  import * as ns from './ns';
12
12
  import { acl, aclControl } from './acl/index';
13
- import { authn } from './authn/index';
14
13
  import { create } from './create/index';
15
14
  import { icons } from './iconBase';
16
15
  import * as language from './widgets/forms/autocomplete/language';
@@ -22,16 +21,17 @@ import { infiniteMessageArea } from './chat/infinite';
22
21
  import * as pad from './pad';
23
22
  import * as participation from './participation';
24
23
  import * as preferences from './preferences';
25
- import { solidLogicSingleton } from './logic';
26
24
  import * as style from './style';
27
25
  import { renderTableViewPane as table } from './table';
28
26
  import * as tabs from './tabs';
29
27
  import * as utils from './utils';
28
+ import * as login from './login/login';
30
29
  import * as widgets from './widgets/index';
31
- import versionInfo from './versionInfo';
30
+ import { versionInfo } from './versionInfo';
32
31
  import { initHeader } from './header';
33
32
  import { initFooter } from './footer';
33
+ import * as createTypes from './create/types';
34
+ import { authn, store } from 'solid-logic';
34
35
  declare const dom: Document | null;
35
- declare const store: rdf.LiveStore;
36
- export { ns, rdf, acl, aclControl, authn, create, dom, icons, language, log, matrix, media, messageArea, infiniteMessageArea, pad, participation, preferences, solidLogicSingleton, store, style, table, tabs, utils, widgets, versionInfo, initHeader, initFooter };
36
+ export { authn, store, ns, rdf, acl, aclControl, create, createTypes, dom, icons, language, log, login, matrix, media, messageArea, infiniteMessageArea, pad, participation, preferences, style, table, tabs, utils, widgets, versionInfo, initHeader, initFooter };
37
37
  //# sour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AAK,MAAM,SAAS,CAAA;AAEhC,OAAO,EAAE,mBAAmB,IAAI,KAAK,EAAE,MAAM,SAAS,CAAA;AACtD,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAA;AAE9B,OAAO,KAAK,KAAK,MAAM,SAAS,CAAA;AAChC,OAAO,KAAK,KAAK,MAAM,eAAe,CAAA;AACtC,OAAO,KAAK,OAAO,MAAM,iBAAiB,CAAA;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AACrC,OAAO,KAAK,WAAW,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAE1C,QAAA,MAAM,GAAG,iBAAkC,CAAA;AAoC3C,OAAO,EACL,KAAK,EACL,KAAK,EACL,EAAE,EACF,GAAG,EACH,GAAG,EACH,UAAU,EACV,MAAM,EACN,WAAW,EACX,GAAG,EACH,KAAK,EACL,QAAQ,EACR,GAAG,EACH,KAAK,EACL,MAAM,EACN,KAAK,EACL,WAAW,EACX,mBAAmB,EACnB,GAAG,EACH,aAAa,EACb,WAAW,EACX,KAAK,EACL,KAAK,EACL,IAAI,EACJ,KAAK,EACL,OAAO,EACP,WAAW,EACX,UAAU,EACV,UAAU,EACX,CAAA"}
package/lib/index.js CHANGED
@@ -37,8 +37,6 @@ https://github.com/solid/solid
37
37
  */
38
38
  // REMOVE @ts-ignore as you migrate files to TypeScript
39
39
 
40
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
41
-
42
40
  var _typeof = require("@babel/runtime/helpers/typeof");
43
41
 
44
42
  Object.defineProperty(exports, "__esModule", {
@@ -59,16 +57,16 @@ Object.defineProperty(exports, "aclControl", {
59
57
  Object.defineProperty(exports, "authn", {
60
58
  enumerable: true,
61
59
  get: function get() {
62
- return _index2.authn;
60
+ return _solidLogic.authn;
63
61
  }
64
62
  });
65
63
  Object.defineProperty(exports, "create", {
66
64
  enumerable: true,
67
65
  get: function get() {
68
- return _index3.create;
66
+ return _index2.create;
69
67
  }
70
68
  });
71
- exports.dom = void 0;
69
+ exports.dom = exports.createTypes = void 0;
72
70
  Object.defineProperty(exports, "icons", {
73
71
  enumerable: true,
74
72
  get: function get() {
@@ -93,17 +91,17 @@ Object.defineProperty(exports, "initHeader", {
93
91
  return _header.initHeader;
94
92
  }
95
93
  });
96
- exports.log = exports.language = void 0;
94
+ exports.login = exports.log = exports.language = void 0;
97
95
  Object.defineProperty(exports, "matrix", {
98
96
  enumerable: true,
99
97
  get: function get() {
100
- return _index4.matrix;
98
+ return _index3.matrix;
101
99
  }
102
100
  });
103
101
  Object.defineProperty(exports, "media", {
104
102
  enumerable: true,
105
103
  get: function get() {
106
- return _index5.media;
104
+ return _index4.media;
107
105
  }
108
106
  });
109
107
  Object.defineProperty(exports, "messageArea", {
@@ -113,13 +111,13 @@ Object.defineProperty(exports, "messageArea", {
113
111
  }
114
112
  });
115
113
  exports.rdf = exports.preferences = exports.participation = exports.pad = exports.ns = void 0;
116
- Object.defineProperty(exports, "solidLogicSingleton", {
114
+ Object.defineProperty(exports, "store", {
117
115
  enumerable: true,
118
116
  get: function get() {
119
- return _logic.solidLogicSingleton;
117
+ return _solidLogic.store;
120
118
  }
121
119
  });
122
- exports.style = exports.store = void 0;
120
+ exports.style = void 0;
123
121
  Object.defineProperty(exports, "table", {
124
122
  enumerable: true,
125
123
  get: function get() {
@@ -130,7 +128,7 @@ exports.utils = exports.tabs = void 0;
130
128
  Object.defineProperty(exports, "versionInfo", {
131
129
  enumerable: true,
132
130
  get: function get() {
133
- return _versionInfo["default"];
131
+ return _versionInfo.versionInfo;
134
132
  }
135
133
  });
136
134
  exports.widgets = void 0;
@@ -145,9 +143,7 @@ exports.ns = ns;
145
143
 
146
144
  var _index = require("./acl/index");
147
145
 
148
- var _index2 = require("./authn/index");
149
-
150
- var _index3 = require("./create/index");
146
+ var _index2 = require("./create/index");
151
147
 
152
148
  var _iconBase = require("./iconBase");
153
149
 
@@ -159,9 +155,9 @@ var log = _interopRequireWildcard(require("./log"));
159
155
 
160
156
  exports.log = log;
161
157
 
162
- var _index4 = require("./matrix/index");
158
+ var _index3 = require("./matrix/index");
163
159
 
164
- var _index5 = require("./media/index");
160
+ var _index4 = require("./media/index");
165
161
 
166
162
  var _messageArea = require("./messageArea");
167
163
 
@@ -179,8 +175,6 @@ var preferences = _interopRequireWildcard(require("./preferences"));
179
175
 
180
176
  exports.preferences = preferences;
181
177
 
182
- var _logic = require("./logic");
183
-
184
178
  var style = _interopRequireWildcard(require("./style"));
185
179
 
186
180
  exports.style = style;
@@ -195,16 +189,26 @@ var utils = _interopRequireWildcard(require("./utils"));
195
189
 
196
190
  exports.utils = utils;
197
191
 
192
+ var login = _interopRequireWildcard(require("./login/login"));
193
+
194
+ exports.login = login;
195
+
198
196
  var widgets = _interopRequireWildcard(require("./widgets/index"));
199
197
 
200
198
  exports.widgets = widgets;
201
199
 
202
- var _versionInfo = _interopRequireDefault(require("./versionInfo"));
200
+ var _versionInfo = require("./versionInfo");
203
201
 
204
202
  var _header = require("./header");
205
203
 
206
204
  var _footer = require("./footer");
207
205
 
206
+ var createTypes = _interopRequireWildcard(require("./create/types"));
207
+
208
+ exports.createTypes = createTypes;
209
+
210
+ var _solidLogic = require("solid-logic");
211
+
208
212
  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); }
209
213
 
210
214
  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; }
@@ -212,9 +216,6 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
212
216
  // pull in first avoid cross-refs
213
217
  // @ts-ignore
214
218
  // @ts-ignore
215
- // import * as debug from '../debug'
216
- // @ts-ignore
217
- // @ts-ignore
218
219
  // @ts-ignore
219
220
  // @ts-ignore
220
221
  // @ts-ignore
@@ -226,39 +227,38 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
226
227
  var dom = window ? window.document : null; // Idea that UI.dom can be adapted in non-browser environments
227
228
 
228
229
  exports.dom = dom;
229
- var store = _logic.solidLogicSingleton.store;
230
- exports.store = store;
231
230
 
232
231
  if (typeof window !== 'undefined') {
233
232
  ;
234
233
  window.UI = {
234
+ authn: _solidLogic.authn,
235
+ store: _solidLogic.store,
235
236
  ns: ns,
236
237
  rdf: rdf,
237
238
  acl: _index.acl,
238
239
  aclControl: _index.aclControl,
239
- authn: _index2.authn,
240
- create: _index3.create,
240
+ create: _index2.create,
241
+ createTypes: createTypes,
241
242
  dom: dom,
242
243
  icons: _iconBase.icons,
243
244
  language: language,
244
245
  log: log,
245
- matrix: _index4.matrix,
246
- media: _index5.media,
246
+ login: login,
247
+ matrix: _index3.matrix,
248
+ media: _index4.media,
247
249
  messageArea: _messageArea.messageArea,
248
250
  infiniteMessageArea: _infinite.infiniteMessageArea,
249
251
  pad: pad,
250
252
  participation: participation,
251
253
  preferences: preferences,
252
- solidLogicSingleton: _logic.solidLogicSingleton,
253
- store: store,
254
254
  style: style,
255
255
  table: _table.renderTableViewPane,
256
256
  tabs: tabs,
257
257
  utils: utils,
258
258
  widgets: widgets,
259
- versionInfo: _versionInfo["default"],
259
+ versionInfo: _versionInfo.versionInfo,
260
260
  initHeader: _header.initHeader,
261
261
  initFooter: _footer.initFooter
262
262
  }; // Simpler access by non-node scripts
263
- }
263
+ } // this variables are directly used in the storybook
264
264
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"names":["dom","window","document","store","solidLogicSingleton","UI","ns","rdf","acl","aclControl","authn","create","icons","language","log","matrix","media","messageArea","infiniteMessageArea","pad","participation","preferences","style","table","tabs","utils","widgets","versionInfo","initHeader","initFooter"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA;;;;AAEA;;;;AACA;;AACA;;AACA;;AAIA;;AACA;;;;AACA;;;;AACA;;AACA;;AAEA;;AAEA;;AAEA;;;;AAEA;;;;AAEA;;;;AAEA;;AAEA;;;;AAEA;;AACA;;;;AAEA;;;;AACA;;;;AACA;;AACA;;AACA;;;;;;AApC8B;AAC9B;AAKA;AACA;AACA;AAMA;AAEA;AAEA;AAEA;AAEA;AAEA;AAEA;AAEA;AAGA;AAOA,IAAMA,GAAG,GAAGC,MAAM,GAAGA,MAAM,CAACC,QAAV,GAAqB,IAAvC,C,CAA4C;;;AAC5C,IAAMC,KAAK,GAAGC,2BAAoBD,KAAlC;;;AAEA,IAAI,OAAOF,MAAP,KAAkB,WAAtB,EAAmC;AACjC;AAAOA,EAAAA,MAAN,CAAcI,EAAd,GAAmB;AAClBC,IAAAA,EAAE,EAAFA,EADkB;AAElBC,IAAAA,GAAG,EAAHA,GAFkB;AAGlBC,IAAAA,GAAG,EAAHA,UAHkB;AAIlBC,IAAAA,UAAU,EAAVA,iBAJkB;AAKlBC,IAAAA,KAAK,EAALA,aALkB;AAMlBC,IAAAA,MAAM,EAANA,cANkB;AAOlBX,IAAAA,GAAG,EAAHA,GAPkB;AAQlBY,IAAAA,KAAK,EAALA,eARkB;AASlBC,IAAAA,QAAQ,EAARA,QATkB;AAUlBC,IAAAA,GAAG,EAAHA,GAVkB;AAWlBC,IAAAA,MAAM,EAANA,cAXkB;AAYlBC,IAAAA,KAAK,EAALA,aAZkB;AAalBC,IAAAA,WAAW,EAAXA,wBAbkB;AAclBC,IAAAA,mBAAmB,EAAnBA,6BAdkB;AAelBC,IAAAA,GAAG,EAAHA,GAfkB;AAgBlBC,IAAAA,aAAa,EAAbA,aAhBkB;AAiBlBC,IAAAA,WAAW,EAAXA,WAjBkB;AAkBlBjB,IAAAA,mBAAmB,EAAnBA,0BAlBkB;AAmBlBD,IAAAA,KAAK,EAALA,KAnBkB;AAoBlBmB,IAAAA,KAAK,EAALA,KApBkB;AAqBlBC,IAAAA,KAAK,EAALA,0BArBkB;AAsBlBC,IAAAA,IAAI,EAAJA,IAtBkB;AAuBlBC,IAAAA,KAAK,EAALA,KAvBkB;AAwBlBC,IAAAA,OAAO,EAAPA,OAxBkB;AAyBlBC,IAAAA,WAAW,EAAXA,uBAzBkB;AA0BlBC,IAAAA,UAAU,EAAVA,kBA1BkB;AA2BlBC,IAAAA,UAAU,EAAVA;AA3BkB,GAAnB,CADgC,CA6B/B;AACH","sourcesContent":["/*\nThe MIT License (MIT)\n\nCopyright (c) 2015-2016 Solid\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\nIf you would like to know more about the solid Solid project, please see\nhttps://github.com/solid/solid\n*/\n'use strict'\n/**\n * Provides a Solid client helper object (which exposes various static modules).\n * @module solidUi.js\n * @main solidUi.js\n */\n\n/**\n * @class SolidUi\n * @static\n */\n\n// REMOVE @ts-ignore as you migrate files to TypeScript\nimport * as rdf from 'rdflib' // pull in first avoid cross-refs\n// @ts-ignore\nimport * as ns from './ns'\nimport { acl, aclControl } from './acl/index'\nimport { authn } from './authn/index'\nimport { create } from './create/index'\n// @ts-ignore\n// import * as debug from '../debug'\n// @ts-ignore\nimport { icons } from './iconBase'\nimport * as language from './widgets/forms/autocomplete/language'\nimport * as log from './log'\nimport { matrix } from './matrix/index'\nimport { media } from './media/index'\n// @ts-ignore\nimport { messageArea } from './messageArea'\n// @ts-ignore\nimport { infiniteMessageArea } from './chat/infinite'\n// @ts-ignore\nimport * as pad from './pad'\n// @ts-ignore\nimport * as participation from './participation'\n// @ts-ignore\nimport * as preferences from './preferences'\n// @ts-ignore\nimport { solidLogicSingleton } from './logic'\n// @ts-ignore\nimport * as style from './style'\n// @ts-ignore\nimport { renderTableViewPane as table } from './table'\nimport * as tabs from './tabs'\n// @ts-ignore\nimport * as utils from './utils'\nimport * as widgets from './widgets/index'\nimport versionInfo from './versionInfo'\nimport { initHeader } from './header'\nimport { initFooter } from './footer'\n\nconst dom = window ? window.document : null // Idea that UI.dom can be adapted in non-browser environments\nconst store = solidLogicSingleton.store\n\nif (typeof window !== 'undefined') {\n ;(<any>window).UI = {\n ns,\n rdf,\n acl,\n aclControl,\n authn,\n create,\n dom,\n icons,\n language,\n log,\n matrix,\n media,\n messageArea,\n infiniteMessageArea,\n pad,\n participation,\n preferences,\n solidLogicSingleton,\n store,\n style,\n table,\n tabs,\n utils,\n widgets,\n versionInfo,\n initHeader,\n initFooter\n } // Simpler access by non-node scripts\n}\n\nexport {\n ns,\n rdf,\n acl,\n aclControl,\n authn,\n create,\n dom,\n icons,\n language,\n log,\n matrix,\n media,\n messageArea,\n infiniteMessageArea,\n pad,\n participation,\n preferences,\n solidLogicSingleton,\n store,\n style,\n table,\n tabs,\n utils,\n widgets,\n versionInfo,\n initHeader,\n initFooter\n}\n"],"file":"index.js"}
1
+ {"version":3,"sources":["../src/index.ts"],"names":["dom","window","document","UI","authn","store","ns","rdf","acl","aclControl","create","createTypes","icons","language","log","login","matrix","media","messageArea","infiniteMessageArea","pad","participation","preferences","style","table","tabs","utils","widgets","versionInfo","initHeader","initFooter"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA;;;;AAEA;;;;AACA;;AACA;;AAEA;;AACA;;;;AACA;;;;AACA;;AACA;;AAEA;;AAEA;;AAEA;;;;AAEA;;;;AAEA;;;;AAEA;;;;AAEA;;AACA;;;;AAEA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AA,WAAW,EAAXA,wBA1BkB;AA2BlBC,IAAAA,UAAU,EAAVA,kBA3BkB;AA4BlBC,IAAAA,UAAU,EAAVA;AA5BkB,GAAnB,CADgC,CA8B/B;AACH,C,CAED","sourcesContent":["/*\nThe MIT License (MIT)\n\nCopyright (c) 2015-2016 Solid\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\nIf you would like to know more about the solid Solid project, please see\nhttps://github.com/solid/solid\n*/\n'use strict'\n/**\n * Provides a Solid client helper object (which exposes various static modules).\n * @module solidUi.js\n * @main solidUi.js\n */\n\n/**\n * @class SolidUi\n * @static\n */\n\n// REMOVE @ts-ignore as you migrate files to TypeScript\nimport * as rdf from 'rdflib' // pull in first avoid cross-refs\n// @ts-ignore\nimport * as ns from './ns'\nimport { acl, aclControl } from './acl/index'\nimport { create } from './create/index'\n// @ts-ignore\nimport { icons } from './iconBase'\nimport * as language from './widgets/forms/autocomplete/language'\nimport * as log from './log'\nimport { matrix } from './matrix/index'\nimport { media } from './media/index'\n// @ts-ignore\nimport { messageArea } from './messageArea'\n// @ts-ignore\nimport { infiniteMessageArea } from './chat/infinite'\n// @ts-ignore\nimport * as pad from './pad'\n// @ts-ignore\nimport * as participation from './participation'\n// @ts-ignore\nimport * as preferences from './preferences'\n// @ts-ignore\nimport * as style from './style'\n// @ts-ignore\nimport { renderTableViewPane as table } from './table'\nimport * as tabs from './tabs'\n// @ts-ignore\nimport * as utils from './utils'\nimport * as login from './login/login'\nimport * as widgets from './widgets/index'\nimport { versionInfo } from './versionInfo'\nimport { initHeader } from './header'\nimport { initFooter } from './footer'\nimport * as createTypes from './create/types'\nimport { authn, store } from 'solid-logic'\n\nconst dom = window ? window.document : null // Idea that UI.dom can be adapted in non-browser environments\n\nif (typeof window !== 'undefined') {\n ;(<any>window).UI = {\n authn,\n store,\n ns,\n rdf,\n acl,\n aclControl,\n create,\n createTypes,\n dom,\n icons,\n language,\n log,\n login,\n matrix,\n media,\n messageArea,\n infiniteMessageArea,\n pad,\n participation,\n preferences,\n style,\n table,\n tabs,\n utils,\n widgets,\n versionInfo,\n initHeader,\n initFooter\n } // Simpler access by non-node scripts\n}\n\n// this variables are directly used in the storybook\nexport {\n authn,\n store,\n ns,\n rdf,\n acl,\n aclControl,\n create,\n createTypes,\n dom,\n icons,\n language,\n log,\n login,\n matrix,\n media,\n messageArea,\n infiniteMessageArea,\n pad,\n participation,\n preferences,\n style,\n table,\n tabs,\n utils,\n widgets,\n versionInfo,\n initHeader,\n initFooter\n}\n"],"file":"index.js"}
File without changes
File without changes
package/lib/jss/index.js CHANGED
File without changes
File without changes
package/lib/log.d.ts CHANGED
File without changes
package/lib/log.d.ts.map CHANGED
File without changes
package/lib/log.js CHANGED
File without changes
package/lib/log.js.map CHANGED
File without changes
@@ -0,0 +1,130 @@
1
+ /**
2
+ * Signing in, signing up, profile and preferences reloading
3
+ * Type index management
4
+ *
5
+ * Many functions in this module take a context object which
6
+ * holds various RDF symbols, add to it, and return a promise of it.
7
+ *
8
+ * * `me` RDF symbol for the user's WebID
9
+ * * `publicProfile` The user's public profile, iff loaded
10
+ * * `preferencesFile` The user's personal preference file, iff loaded
11
+ * * `index.public` The user's public type index file
12
+ * * `index.private` The user's private type index file
13
+ *
14
+ * Not RDF symbols:
15
+ * * `noun` A string in english for the type of thing -- like "address book"
16
+ * * `instance` An array of nodes which are existing instances
17
+ * * `containers` An array of nodes of containers of instances
18
+ * * `div` A DOM element where UI can be displayed
19
+ * * `statusArea` A DOM element (opt) progress stuff can be displayed, or error messages
20
+ * @packageDocumentation
21
+ */
22
+ import { PaneDefinition } from 'pane-registry';
23
+ import { NamedNode } from 'rdflib';
24
+ import { AppDetails, AuthenticationContext } from 'solid-logic';
25
+ /**
26
+ * Resolves with the logged in user's WebID
27
+ *
28
+ * @param context
29
+ */
30
+ export declare function ensureLoggedIn(context: AuthenticationContext): Promise<AuthenticationContext>;
31
+ /**
32
+ * Loads preference file
33
+ * Do this after having done log in and load profile
34
+ *
35
+ * @private
36
+ *
37
+ * @param context
38
+ */
39
+ export declare function ensureLoadedPreferences(context: AuthenticationContext): Promise<AuthenticationContext>;
40
+ /**
41
+ * Logs the user in and loads their WebID profile document into the store
42
+ *
43
+ * @param context
44
+ *
45
+ * @returns Resolves with the context after login / fetch
46
+ */
47
+ export declare function ensureLoadedProfile(context: AuthenticationContext): Promise<AuthenticationContext>;
48
+ /**
49
+ * Returns promise of context with arrays of symbols
50
+ *
51
+ * 2016-12-11 change to include forClass arc a la
52
+ * https://github.com/solid/solid/blob/main/proposals/data-discovery.md
53
+ */
54
+ export declare function findAppInstances(context: AuthenticationContext, theClass: NamedNode, isPublic?: boolean): Promise<AuthenticationContext>;
55
+ /**
56
+ * UI to control registration of instance
57
+ */
58
+ export declare function registrationControl(context: AuthenticationContext, instance: any, theClass: any): Promise<AuthenticationContext | void>;
59
+ /**
60
+ * UI to List at all registered things
61
+ */
62
+ export declare function registrationList(context: AuthenticationContext, options: {
63
+ private?: boolean;
64
+ public?: boolean;
65
+ type?: NamedNode;
66
+ }): Promise<AuthenticationContext>;
67
+ export declare function renderSignInPopup(dom: HTMLDocument): void;
68
+ /**
69
+ * Login status box
70
+ *
71
+ * A big sign-up/sign in box or a logout box depending on the state
72
+ *
73
+ * @param dom
74
+ * @param listener
75
+ *
76
+ * @returns
77
+ */
78
+ export declare function loginStatusBox(dom: HTMLDocument, listener?: ((uri: string | null) => void) | null, options?: {
79
+ buttonStyle?: string;
80
+ }): HTMLElement;
81
+ /**
82
+ * Workspace selection etc
83
+ * See https://github.com/solid/userguide/issues/16
84
+ */
85
+ /**
86
+ * Returns a UI object which, if it selects a workspace,
87
+ * will callback(workspace, newBase).
88
+ * See https://github.com/solid/userguide/issues/16 for more info on workspaces.
89
+ *
90
+ * If necessary, will get an account, preference file, etc. In sequence:
91
+ *
92
+ * - If not logged in, log in.
93
+ * - Load preference file
94
+ * - Prompt user for workspaces
95
+ * - Allows the user to just type in a URI by hand
96
+ *
97
+ * Calls back with the workspace and the base URI
98
+ *
99
+ * @param dom
100
+ * @param appDetails
101
+ * @param callbackWS
102
+ */
103
+ export declare function selectWorkspace(dom: HTMLDocument, appDetails: AppDetails, callbackWS: (workspace: string | null, newBase: string) => void): HTMLElement;
104
+ /**
105
+ * Creates a new instance of an app.
106
+ *
107
+ * An instance of an app could be e.g. an issue tracker for a given project,
108
+ * or a chess game, or calendar, or a health/fitness record for a person.
109
+ *
110
+ * Note that this use of the term 'app' refers more to entries in the user's
111
+ * type index than to actual software applications that use the personal data
112
+ * to which these entries point.
113
+ *
114
+ * @param dom
115
+ * @param appDetails
116
+ * @param callback
117
+ *
118
+ * @returns A div with a button in it for making a new app instance
119
+ */
120
+ export declare function newAppInstance(dom: HTMLDocument, appDetails: AppDetails, callback: (workspace: string | null, newBase: string) => void): HTMLElement;
121
+ /**
122
+ * Retrieves whether the currently logged in user is a power user
123
+ * and/or a developer
124
+ */
125
+ export declare function getUserRoles(): Promise<Array<NamedNode>>;
126
+ /**
127
+ * Filters which panes should be available, based on the result of [[getUserRoles]]
128
+ */
129
+ export declare function filterAvailablePanes(panes: Array<PaneDefinition>): Promise<Array<PaneDefinition>>;
130
+ //# sourceMappingURL=login.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"login.d.ts","sourceRoot":"","sources":["../../src/login/login.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,EAA6B,SAAS,EAAiB,MAAM,QAAQ,CAAA;AAG5E,OAAO,EAAE,UAAU,EAAE,qBAAqB,EAAgN,MAAM,aAAa,CAAA;AAS7Q;;;;IAII;AAEJ,wBAAgB,cAAc,CAAE,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAwB9F;AAED;;;;;;;GAOG;AAEH,wBAAsB,uBAAuB,CAAE,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,qBAAqB,CAAC,CA2D7G;AAED;;;;;;GAMG;AAEH,wBAAsB,mBAAmB,CAAE,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAmBzG;AAED;;;;;IAKI;AACJ,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,qBAAqB,EAC9B,QAAQ,EAAE,SAAS,EACnB,QAAQ,CAAC,EAAE,OAAO,GACjB,OAAO,CAAC,qBAAqB,CAAC,CAqEhC;AAED;;IAEI;AACJ,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,qBAAqB,EAC9B,QAAQ,KAAA,EACR,QAAQ,KAAA,GACP,OAAO,CAAC,qBAAqB,GAAG,IAAI,CAAC,CAgFvC;AAED;;IAEI;AACJ,wBAAgB,gBAAgB,CAAE,OAAO,EAAE,qBAAqB,EAAE,OAAO,EAAE;IACxE,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,IAAI,CAAC,EAAE,SAAS,CAAA;CACjB,GAAG,OAAO,CAAC,qBAAqB,CAAC,CA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