solid-ui 2.4.18 → 2.4.19-0533393c

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 (265) hide show
  1. package/LICENSE.md +0 -0
  2. package/README.md +3 -2
  3. package/lib/acl/access-controller.d.ts +0 -0
  4. package/lib/acl/access-controller.d.ts.map +0 -0
  5. package/lib/acl/access-controller.js +0 -0
  6. package/lib/acl/access-controller.js.map +0 -0
  7. package/lib/acl/access-groups.d.ts +5 -4
  8. package/lib/acl/access-groups.d.ts.map +1 -1
  9. package/lib/acl/access-groups.js +1 -0
  10. package/lib/acl/access-groups.js.map +1 -1
  11. package/lib/acl/acl-control.d.ts +2 -2
  12. package/lib/acl/acl-control.d.ts.map +1 -1
  13. package/lib/acl/acl-control.js +0 -0
  14. package/lib/acl/acl-control.js.map +1 -1
  15. package/lib/acl/acl.d.ts +5 -5
  16. package/lib/acl/acl.d.ts.map +1 -1
  17. package/lib/acl/acl.js +2 -4
  18. package/lib/acl/acl.js.map +1 -1
  19. package/lib/acl/add-agent-buttons.d.ts +0 -0
  20. package/lib/acl/add-agent-buttons.d.ts.map +1 -1
  21. package/lib/acl/add-agent-buttons.js +5 -5
  22. package/lib/acl/add-agent-buttons.js.map +1 -1
  23. package/lib/acl/index.d.ts +0 -0
  24. package/lib/acl/index.d.ts.map +0 -0
  25. package/lib/acl/index.js +0 -0
  26. package/lib/acl/index.js.map +0 -0
  27. package/lib/acl/styles.d.ts +0 -0
  28. package/lib/acl/styles.d.ts.map +0 -0
  29. package/lib/acl/styles.js +0 -0
  30. package/lib/acl/styles.js.map +0 -0
  31. package/lib/acl/types.d.ts +0 -0
  32. package/lib/acl/types.d.ts.map +0 -0
  33. package/lib/acl/types.js +0 -0
  34. package/lib/acl/types.js.map +0 -0
  35. package/lib/chat/bookmarks.js +20 -22
  36. package/lib/chat/bookmarks.js.map +1 -1
  37. package/lib/chat/chatLogic.js +13 -15
  38. package/lib/chat/chatLogic.js.map +1 -1
  39. package/lib/chat/dateFolder.js +10 -10
  40. package/lib/chat/dateFolder.js.map +1 -1
  41. package/lib/chat/infinite.js +14 -16
  42. package/lib/chat/infinite.js.map +1 -1
  43. package/lib/chat/message.js +19 -23
  44. package/lib/chat/message.js.map +1 -1
  45. package/lib/chat/messageTools.js +16 -21
  46. package/lib/chat/messageTools.js.map +1 -1
  47. package/lib/chat/thread.js +24 -24
  48. package/lib/chat/thread.js.map +1 -1
  49. package/lib/create/create.d.ts +0 -0
  50. package/lib/create/create.d.ts.map +1 -1
  51. package/lib/create/create.js +9 -9
  52. package/lib/create/create.js.map +1 -1
  53. package/lib/create/index.d.ts +0 -0
  54. package/lib/create/index.d.ts.map +0 -0
  55. package/lib/create/index.js +0 -0
  56. package/lib/create/index.js.map +0 -0
  57. package/lib/create/types.d.ts +0 -0
  58. package/lib/create/types.d.ts.map +0 -0
  59. package/lib/create/types.js +0 -0
  60. package/lib/create/types.js.map +0 -0
  61. package/lib/debug.d.ts +0 -0
  62. package/lib/debug.d.ts.map +0 -0
  63. package/lib/debug.js +0 -0
  64. package/lib/debug.js.map +0 -0
  65. package/lib/folders.js +2 -6
  66. package/lib/folders.js.map +1 -1
  67. package/lib/footer/index.d.ts +4 -4
  68. package/lib/footer/index.d.ts.map +1 -1
  69. package/lib/footer/index.js +4 -4
  70. package/lib/footer/index.js.map +1 -1
  71. package/lib/footer/styleMap.d.ts +0 -0
  72. package/lib/footer/styleMap.d.ts.map +0 -0
  73. package/lib/footer/styleMap.js +0 -0
  74. package/lib/footer/styleMap.js.map +0 -0
  75. package/lib/header/empty-profile.d.ts +0 -0
  76. package/lib/header/empty-profile.d.ts.map +0 -0
  77. package/lib/header/empty-profile.js +0 -0
  78. package/lib/header/empty-profile.js.map +0 -0
  79. package/lib/header/index.d.ts +0 -0
  80. package/lib/header/index.d.ts.map +1 -1
  81. package/lib/header/index.js +11 -8
  82. package/lib/header/index.js.map +1 -1
  83. package/lib/header/styleMap.d.ts +0 -0
  84. package/lib/header/styleMap.d.ts.map +0 -0
  85. package/lib/header/styleMap.js +0 -0
  86. package/lib/header/styleMap.js.map +0 -0
  87. package/lib/iconBase.d.ts +0 -0
  88. package/lib/iconBase.d.ts.map +0 -0
  89. package/lib/iconBase.js +0 -0
  90. package/lib/iconBase.js.map +0 -0
  91. package/lib/icons/solid_logo.d.ts +0 -0
  92. package/lib/icons/solid_logo.d.ts.map +0 -0
  93. package/lib/icons/solid_logo.js +0 -0
  94. package/lib/icons/solid_logo.js.map +0 -0
  95. package/lib/index.d.ts +4 -4
  96. package/lib/index.d.ts.map +1 -1
  97. package/lib/index.js +30 -28
  98. package/lib/index.js.map +1 -1
  99. package/lib/jss/index.d.ts +0 -0
  100. package/lib/jss/index.d.ts.map +0 -0
  101. package/lib/jss/index.js +0 -0
  102. package/lib/jss/index.js.map +0 -0
  103. package/lib/log.d.ts +0 -0
  104. package/lib/log.d.ts.map +0 -0
  105. package/lib/log.js +0 -0
  106. package/lib/log.js.map +0 -0
  107. package/lib/login/login.d.ts +133 -0
  108. package/lib/login/login.d.ts.map +1 -0
  109. package/lib/login/login.js +1508 -0
  110. package/lib/login/login.js.map +1 -0
  111. package/lib/matrix/index.d.ts +0 -0
  112. package/lib/matrix/index.d.ts.map +0 -0
  113. package/lib/matrix/index.js +0 -0
  114. package/lib/matrix/index.js.map +0 -0
  115. package/lib/matrix/matrix.d.ts +0 -0
  116. package/lib/matrix/matrix.d.ts.map +0 -0
  117. package/lib/matrix/matrix.js +2 -2
  118. package/lib/matrix/matrix.js.map +1 -1
  119. package/lib/matrix/types.d.ts +0 -0
  120. package/lib/matrix/types.d.ts.map +0 -0
  121. package/lib/matrix/types.js +0 -0
  122. package/lib/matrix/types.js.map +0 -0
  123. package/lib/media/index.d.ts +0 -0
  124. package/lib/media/index.d.ts.map +0 -0
  125. package/lib/media/index.js +0 -0
  126. package/lib/media/index.js.map +0 -0
  127. package/lib/media/media-capture.d.ts +0 -0
  128. package/lib/media/media-capture.d.ts.map +0 -0
  129. package/lib/media/media-capture.js +0 -0
  130. package/lib/media/media-capture.js.map +0 -0
  131. package/lib/messageArea.js +9 -10
  132. package/lib/messageArea.js.map +1 -1
  133. package/lib/noun_Camera_1618446_000000.js +0 -0
  134. package/lib/noun_Camera_1618446_000000.js.map +0 -0
  135. package/lib/ns.js +0 -0
  136. package/lib/ns.js.map +0 -0
  137. package/lib/pad.d.ts +0 -0
  138. package/lib/pad.d.ts.map +0 -0
  139. package/lib/pad.js +2 -2
  140. package/lib/pad.js.map +1 -1
  141. package/lib/participation.d.ts +0 -0
  142. package/lib/participation.d.ts.map +1 -1
  143. package/lib/participation.js +4 -5
  144. package/lib/participation.js.map +1 -1
  145. package/lib/preferences.js +8 -8
  146. package/lib/preferences.js.map +1 -1
  147. package/lib/{authn → signup}/config-default.js +0 -0
  148. package/lib/signup/config-default.js.map +1 -0
  149. package/lib/{authn → signup}/signup.js +0 -0
  150. package/lib/signup/signup.js.map +1 -0
  151. package/lib/stories/decorators.js +0 -0
  152. package/lib/stories/decorators.js.map +0 -0
  153. package/lib/style.js +3 -3
  154. package/lib/style.js.map +1 -1
  155. package/lib/table.js +2 -3
  156. package/lib/table.js.map +1 -1
  157. package/lib/tabs.d.ts +1 -1
  158. package/lib/tabs.d.ts.map +1 -1
  159. package/lib/tabs.js +14 -6
  160. package/lib/tabs.js.map +1 -1
  161. package/lib/typings.d.js +0 -0
  162. package/lib/typings.d.js.map +0 -0
  163. package/lib/utils/headerFooterHelpers.d.ts +2 -3
  164. package/lib/utils/headerFooterHelpers.d.ts.map +1 -1
  165. package/lib/utils/headerFooterHelpers.js +63 -33
  166. package/lib/utils/headerFooterHelpers.js.map +1 -1
  167. package/lib/utils/index.js +6 -6
  168. package/lib/utils/index.js.map +1 -1
  169. package/lib/utils/label.d.ts +0 -0
  170. package/lib/utils/label.d.ts.map +0 -0
  171. package/lib/utils/label.js +4 -5
  172. package/lib/utils/label.js.map +1 -1
  173. package/lib/versionInfo.d.ts +0 -0
  174. package/lib/versionInfo.d.ts.map +0 -0
  175. package/lib/versionInfo.js +14 -14
  176. package/lib/versionInfo.js.map +1 -1
  177. package/lib/webpack-bundle.js +9094 -25125
  178. package/lib/webpack-bundle.js.map +1 -1
  179. package/lib/widgets/buttons/iconLinks.d.ts +0 -0
  180. package/lib/widgets/buttons/iconLinks.d.ts.map +0 -0
  181. package/lib/widgets/buttons/iconLinks.js +0 -0
  182. package/lib/widgets/buttons/iconLinks.js.map +0 -0
  183. package/lib/widgets/buttons.d.ts +0 -0
  184. package/lib/widgets/buttons.d.ts.map +0 -0
  185. package/lib/widgets/buttons.js +16 -16
  186. package/lib/widgets/buttons.js.map +1 -1
  187. package/lib/widgets/dragAndDrop.js +0 -0
  188. package/lib/widgets/dragAndDrop.js.map +0 -0
  189. package/lib/widgets/error.d.ts +0 -0
  190. package/lib/widgets/error.d.ts.map +0 -0
  191. package/lib/widgets/error.js +0 -0
  192. package/lib/widgets/error.js.map +0 -0
  193. package/lib/widgets/forms/autocomplete/autocompleteBar.d.ts +0 -0
  194. package/lib/widgets/forms/autocomplete/autocompleteBar.d.ts.map +0 -0
  195. package/lib/widgets/forms/autocomplete/autocompleteBar.js +2 -2
  196. package/lib/widgets/forms/autocomplete/autocompleteBar.js.map +1 -1
  197. package/lib/widgets/forms/autocomplete/autocompleteField.d.ts +0 -0
  198. package/lib/widgets/forms/autocomplete/autocompleteField.d.ts.map +0 -0
  199. package/lib/widgets/forms/autocomplete/autocompleteField.js +2 -2
  200. package/lib/widgets/forms/autocomplete/autocompleteField.js.map +1 -1
  201. package/lib/widgets/forms/autocomplete/autocompletePicker.d.ts +0 -0
  202. package/lib/widgets/forms/autocomplete/autocompletePicker.d.ts.map +0 -0
  203. package/lib/widgets/forms/autocomplete/autocompletePicker.js +2 -2
  204. package/lib/widgets/forms/autocomplete/autocompletePicker.js.map +1 -1
  205. package/lib/widgets/forms/autocomplete/language.d.ts +0 -0
  206. package/lib/widgets/forms/autocomplete/language.d.ts.map +1 -1
  207. package/lib/widgets/forms/autocomplete/language.js +7 -10
  208. package/lib/widgets/forms/autocomplete/language.js.map +1 -1
  209. package/lib/widgets/forms/autocomplete/publicData.d.ts +1 -1
  210. package/lib/widgets/forms/autocomplete/publicData.d.ts.map +1 -1
  211. package/lib/widgets/forms/autocomplete/publicData.js +15 -16
  212. package/lib/widgets/forms/autocomplete/publicData.js.map +1 -1
  213. package/lib/widgets/forms/basic.d.ts +2 -2
  214. package/lib/widgets/forms/basic.d.ts.map +1 -1
  215. package/lib/widgets/forms/basic.js +10 -8
  216. package/lib/widgets/forms/basic.js.map +1 -1
  217. package/lib/widgets/forms/comment.d.ts +1 -1
  218. package/lib/widgets/forms/comment.d.ts.map +0 -0
  219. package/lib/widgets/forms/comment.js +3 -3
  220. package/lib/widgets/forms/comment.js.map +1 -1
  221. package/lib/widgets/forms/fieldFunction.d.ts +0 -0
  222. package/lib/widgets/forms/fieldFunction.d.ts.map +0 -0
  223. package/lib/widgets/forms/fieldFunction.js +2 -2
  224. package/lib/widgets/forms/fieldFunction.js.map +1 -1
  225. package/lib/widgets/forms/fieldParams.d.ts +0 -0
  226. package/lib/widgets/forms/fieldParams.d.ts.map +0 -0
  227. package/lib/widgets/forms/fieldParams.js +0 -0
  228. package/lib/widgets/forms/fieldParams.js.map +0 -0
  229. package/lib/widgets/forms/formStyle.d.ts +0 -0
  230. package/lib/widgets/forms/formStyle.d.ts.map +0 -0
  231. package/lib/widgets/forms/formStyle.js +3 -3
  232. package/lib/widgets/forms/formStyle.js.map +1 -1
  233. package/lib/widgets/forms.js +61 -38
  234. package/lib/widgets/forms.js.map +1 -1
  235. package/lib/widgets/index.js +0 -0
  236. package/lib/widgets/index.js.map +0 -0
  237. package/lib/widgets/peoplePicker.js +2 -2
  238. package/lib/widgets/peoplePicker.js.map +1 -1
  239. package/lib/widgets/widgetHelpers.d.ts +0 -0
  240. package/lib/widgets/widgetHelpers.d.ts.map +0 -0
  241. package/lib/widgets/widgetHelpers.js +0 -0
  242. package/lib/widgets/widgetHelpers.js.map +0 -0
  243. package/package.json +13 -9
  244. package/lib/authn/authSession.d.ts +0 -4
  245. package/lib/authn/authSession.d.ts.map +0 -1
  246. package/lib/authn/authSession.js +0 -25
  247. package/lib/authn/authSession.js.map +0 -1
  248. package/lib/authn/authn.d.ts +0 -193
  249. package/lib/authn/authn.d.ts.map +0 -1
  250. package/lib/authn/authn.js +0 -2238
  251. package/lib/authn/authn.js.map +0 -1
  252. package/lib/authn/config-default.js.map +0 -1
  253. package/lib/authn/index.d.ts +0 -35
  254. package/lib/authn/index.d.ts.map +0 -1
  255. package/lib/authn/index.js +0 -44
  256. package/lib/authn/index.js.map +0 -1
  257. package/lib/authn/signup.js.map +0 -1
  258. package/lib/authn/types.d.ts +0 -25
  259. package/lib/authn/types.d.ts.map +0 -1
  260. package/lib/authn/types.js +0 -6
  261. package/lib/authn/types.js.map +0 -1
  262. package/lib/logic.d.ts +0 -8
  263. package/lib/logic.d.ts.map +0 -1
  264. package/lib/logic.js +0 -79
  265. package/lib/logic.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,OAA7E;AAAA;AAAA;AAAA;AAAA;AAAA;AACCC,YAAAA,MADD,GAC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C;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;AAAA;AAAA;AAAA;AAAA;AAAA;AACCS,YAAAA,IADD,GACQC,kBA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CN,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
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
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/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AS,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,WAAW,MAAM,eAAe,CAAA;AACvC,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
@@ -59,16 +59,16 @@ Object.defineProperty(exports, "aclControl", {
59
59
  Object.defineProperty(exports, "authn", {
60
60
  enumerable: true,
61
61
  get: function get() {
62
- return _index2.authn;
62
+ return _solidLogic.authn;
63
63
  }
64
64
  });
65
65
  Object.defineProperty(exports, "create", {
66
66
  enumerable: true,
67
67
  get: function get() {
68
- return _index3.create;
68
+ return _index2.create;
69
69
  }
70
70
  });
71
- exports.dom = void 0;
71
+ exports.dom = exports.createTypes = void 0;
72
72
  Object.defineProperty(exports, "icons", {
73
73
  enumerable: true,
74
74
  get: function get() {
@@ -93,17 +93,17 @@ Object.defineProperty(exports, "initHeader", {
93
93
  return _header.initHeader;
94
94
  }
95
95
  });
96
- exports.log = exports.language = void 0;
96
+ exports.login = exports.log = exports.language = void 0;
97
97
  Object.defineProperty(exports, "matrix", {
98
98
  enumerable: true,
99
99
  get: function get() {
100
- return _index4.matrix;
100
+ return _index3.matrix;
101
101
  }
102
102
  });
103
103
  Object.defineProperty(exports, "media", {
104
104
  enumerable: true,
105
105
  get: function get() {
106
- return _index5.media;
106
+ return _index4.media;
107
107
  }
108
108
  });
109
109
  Object.defineProperty(exports, "messageArea", {
@@ -113,13 +113,13 @@ Object.defineProperty(exports, "messageArea", {
113
113
  }
114
114
  });
115
115
  exports.rdf = exports.preferences = exports.participation = exports.pad = exports.ns = void 0;
116
- Object.defineProperty(exports, "solidLogicSingleton", {
116
+ Object.defineProperty(exports, "store", {
117
117
  enumerable: true,
118
118
  get: function get() {
119
- return _logic.solidLogicSingleton;
119
+ return _solidLogic.store;
120
120
  }
121
121
  });
122
- exports.style = exports.store = void 0;
122
+ exports.style = void 0;
123
123
  Object.defineProperty(exports, "table", {
124
124
  enumerable: true,
125
125
  get: function get() {
@@ -145,9 +145,7 @@ exports.ns = ns;
145
145
 
146
146
  var _index = require("./acl/index");
147
147
 
148
- var _index2 = require("./authn/index");
149
-
150
- var _index3 = require("./create/index");
148
+ var _index2 = require("./create/index");
151
149
 
152
150
  var _iconBase = require("./iconBase");
153
151
 
@@ -159,9 +157,9 @@ var log = _interopRequireWildcard(require("./log"));
159
157
 
160
158
  exports.log = log;
161
159
 
162
- var _index4 = require("./matrix/index");
160
+ var _index3 = require("./matrix/index");
163
161
 
164
- var _index5 = require("./media/index");
162
+ var _index4 = require("./media/index");
165
163
 
166
164
  var _messageArea = require("./messageArea");
167
165
 
@@ -179,8 +177,6 @@ var preferences = _interopRequireWildcard(require("./preferences"));
179
177
 
180
178
  exports.preferences = preferences;
181
179
 
182
- var _logic = require("./logic");
183
-
184
180
  var style = _interopRequireWildcard(require("./style"));
185
181
 
186
182
  exports.style = style;
@@ -195,6 +191,10 @@ var utils = _interopRequireWildcard(require("./utils"));
195
191
 
196
192
  exports.utils = utils;
197
193
 
194
+ var login = _interopRequireWildcard(require("./login/login"));
195
+
196
+ exports.login = login;
197
+
198
198
  var widgets = _interopRequireWildcard(require("./widgets/index"));
199
199
 
200
200
  exports.widgets = widgets;
@@ -205,6 +205,12 @@ var _header = require("./header");
205
205
 
206
206
  var _footer = require("./footer");
207
207
 
208
+ var createTypes = _interopRequireWildcard(require("./create/types"));
209
+
210
+ exports.createTypes = createTypes;
211
+
212
+ var _solidLogic = require("solid-logic");
213
+
208
214
  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
215
 
210
216
  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 +218,6 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
212
218
  // pull in first avoid cross-refs
213
219
  // @ts-ignore
214
220
  // @ts-ignore
215
- // import * as debug from '../debug'
216
- // @ts-ignore
217
- // @ts-ignore
218
221
  // @ts-ignore
219
222
  // @ts-ignore
220
223
  // @ts-ignore
@@ -226,31 +229,30 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
226
229
  var dom = window ? window.document : null; // Idea that UI.dom can be adapted in non-browser environments
227
230
 
228
231
  exports.dom = dom;
229
- var store = _logic.solidLogicSingleton.store;
230
- exports.store = store;
231
232
 
232
233
  if (typeof window !== 'undefined') {
233
234
  ;
234
235
  window.UI = {
236
+ authn: _solidLogic.authn,
237
+ store: _solidLogic.store,
235
238
  ns: ns,
236
239
  rdf: rdf,
237
240
  acl: _index.acl,
238
241
  aclControl: _index.aclControl,
239
- authn: _index2.authn,
240
- create: _index3.create,
242
+ create: _index2.create,
243
+ createTypes: createTypes,
241
244
  dom: dom,
242
245
  icons: _iconBase.icons,
243
246
  language: language,
244
247
  log: log,
245
- matrix: _index4.matrix,
246
- media: _index5.media,
248
+ login: login,
249
+ matrix: _index3.matrix,
250
+ media: _index4.media,
247
251
  messageArea: _messageArea.messageArea,
248
252
  infiniteMessageArea: _infinite.infiniteMessageArea,
249
253
  pad: pad,
250
254
  participation: participation,
251
255
  preferences: preferences,
252
- solidLogicSingleton: _logic.solidLogicSingleton,
253
- store: store,
254
256
  style: style,
255
257
  table: _table.renderTableViewPane,
256
258
  tabs: tabs,
@@ -260,5 +262,5 @@ if (typeof window !== 'undefined') {
260
262
  initHeader: _header.initHeader,
261
263
  initFooter: _footer.initFooter
262
264
  }; // Simpler access by non-node scripts
263
- }
265
+ } // this variables are directly used in the storybook
264
266
  //# 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;AAC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AhBkB;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;;;;AACA;;;;AACA;;;;AACA;;AACA;;AACA;;AACA;;;;AACA;;;;;;AAlC8B;AAC9B;AAIA;AAMA;AAEA;AAEA;AAEA;AAEA;AAEA;AAEA;AAGA;AAUA,IAAMA,GAAG,GAAGC,MAAM,GAAGA,MAAM,CAACC,QAAV,GAAqB,IAAvC,C,CAA4C;;;;AAE5C,IAAI,OAAOD,MAAP,KAAkB,WAAtB,EAAmC;AACjC;AAAOA,EAAAA,MAAN,CAAcE,EAAd,GAAmB;AAClBC,IAAAA,KAAK,EAALA,iBADkB;AAElBC,IAAAA,KAAK,EAALA,iBAFkB;AAGlBC,IAAAA,EAAE,EAAFA,EAHkB;AAIlBC,IAAAA,GAAG,EAAHA,GAJkB;AAKlBC,IAAAA,GAAG,EAAHA,UALkB;AAMlBC,IAAAA,UAAU,EAAVA,iBANkB;AAOlBC,IAAAA,MAAM,EAANA,cAPkB;AAQlBC,IAAAA,WAAW,EAAXA,WARkB;AASlBX,IAAAA,GAAG,EAAHA,GATkB;AAUlBY,IAAAA,KAAK,EAALA,eAVkB;AAWlBC,IAAAA,QAAQ,EAARA,QAXkB;AAYlBC,IAAAA,GAAG,EAAHA,GAZkB;AAalBC,IAAAA,KAAK,EAALA,KAbkB;AAclBC,IAAAA,MAAM,EAANA,cAdkB;AAelBC,IAAAA,KAAK,EAALA,aAfkB;AAgBlBC,IAAAA,WAAW,EAAXA,wBAhBkB;AAiBlBC,IAAAA,mBAAmB,EAAnBA,6BAjBkB;AAkBlBC,IAAAA,GAAG,EAAHA,GAlBkB;AAmBlBC,IAAAA,aAAa,EAAbA,aAnBkB;AAoBlBC,IAAAA,WAAW,EAAXA,WApBkB;AAqBlBC,IAAAA,KAAK,EAALA,KArBkB;AAsBlBC,IAAAA,KAAK,EAALA,0BAtBkB;AAuBlBC,IAAAA,IAAI,EAAJA,IAvBkB;AAwBlBC,IAAAA,KAAK,EAALA,KAxBkB;AAyBlBC,IAAAA,OAAO,EAAPA,OAzBkB;AA0BlBC,IAAAA,WAAW,EAAXA,uBA1BkB;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,133 @@
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
+ * *
21
+ * * Vocabulary: "load" loads a file if it exists;
22
+ * * 'Ensure" CREATES the file if it does not exist (if it can) and then loads it.
23
+ * @packageDocumentation
24
+ */
25
+ import { PaneDefinition } from 'pane-registry';
26
+ import { NamedNode } from 'rdflib';
27
+ import { AppDetails, AuthenticationContext } from 'solid-logic';
28
+ /**
29
+ * Resolves with the logged in user's WebID
30
+ *
31
+ * @param context
32
+ */
33
+ export declare function ensureLoggedIn(context: AuthenticationContext): Promise<AuthenticationContext>;
34
+ /**
35
+ * Loads preference file
36
+ * Do this after having done log in and load profile
37
+ *
38
+ * @private
39
+ *
40
+ * @param context
41
+ */
42
+ export declare function ensureLoadedPreferences(context: AuthenticationContext): Promise<AuthenticationContext>;
43
+ /**
44
+ * Logs the user in and loads their WebID profile document into the store
45
+ *
46
+ * @param context
47
+ *
48
+ * @returns Resolves with the context after login / fetch
49
+ */
50
+ export declare function ensureLoadedProfile(context: AuthenticationContext): Promise<AuthenticationContext>;
51
+ /**
52
+ * Returns promise of context with arrays of symbols
53
+ *
54
+ * 2016-12-11 change to include forClass arc a la
55
+ * https://github.com/solid/solid/blob/main/proposals/data-discovery.md
56
+ */
57
+ export declare function findAppInstances(context: AuthenticationContext, theClass: NamedNode, isPublic?: boolean): Promise<AuthenticationContext>;
58
+ /**
59
+ * UI to control registration of instance
60
+ */
61
+ export declare function registrationControl(context: AuthenticationContext, instance: any, theClass: any): Promise<AuthenticationContext | void>;
62
+ /**
63
+ * UI to List at all registered things
64
+ */
65
+ export declare function registrationList(context0: AuthenticationContext, options: {
66
+ private?: boolean;
67
+ public?: boolean;
68
+ type?: NamedNode;
69
+ }): Promise<AuthenticationContext>;
70
+ export declare function renderSignInPopup(dom: HTMLDocument): void;
71
+ /**
72
+ * Login status box
73
+ *
74
+ * A big sign-up/sign in box or a logout box depending on the state
75
+ *
76
+ * @param dom
77
+ * @param listener
78
+ *
79
+ * @returns
80
+ */
81
+ export declare function loginStatusBox(dom: HTMLDocument, listener?: ((uri: string | null) => void) | null, options?: {
82
+ buttonStyle?: string;
83
+ }): HTMLElement;
84
+ /**
85
+ * Workspace selection etc
86
+ * See https://github.com/solid/userguide/issues/16
87
+ */
88
+ /**
89
+ * Returns a UI object which, if it selects a workspace,
90
+ * will callback(workspace, newBase).
91
+ * See https://github.com/solid/userguide/issues/16 for more info on workspaces.
92
+ *
93
+ * If necessary, will get an account, preference file, etc. In sequence:
94
+ *
95
+ * - If not logged in, log in.
96
+ * - Load preference file
97
+ * - Prompt user for workspaces
98
+ * - Allows the user to just type in a URI by hand
99
+ *
100
+ * Calls back with the workspace and the base URI
101
+ *
102
+ * @param dom
103
+ * @param appDetails
104
+ * @param callbackWS
105
+ */
106
+ export declare function selectWorkspace(dom: HTMLDocument, appDetails: AppDetails, callbackWS: (workspace: string | null, newBase: string) => void): HTMLElement;
107
+ /**
108
+ * Creates a new instance of an app.
109
+ *
110
+ * An instance of an app could be e.g. an issue tracker for a given project,
111
+ * or a chess game, or calendar, or a health/fitness record for a person.
112
+ *
113
+ * Note that this use of the term 'app' refers more to entries in the user's
114
+ * type index than to actual software applications that use the personal data
115
+ * to which these entries point.
116
+ *
117
+ * @param dom
118
+ * @param appDetails
119
+ * @param callback
120
+ *
121
+ * @returns A div with a button in it for making a new app instance
122
+ */
123
+ export declare function newAppInstance(dom: HTMLDocument, appDetails: AppDetails, callback: (workspace: string | null, newBase: string) => void): HTMLElement;
124
+ /**
125
+ * Retrieves whether the currently logged in user is a power user
126
+ * and/or a developer
127
+ */
128
+ export declare function getUserRoles(): Promise<Array<NamedNode>>;
129
+ /**
130
+ * Filters which panes should be available, based on the result of [[getUserRoles]]
131
+ */
132
+ export declare function filterAvailablePanes(panes: Array<PaneDefinition>): Promise<Array<PaneDefinition>>;
133
+ //# sourceMappingURL=login.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"login.d.ts","sourceRoot":"","sources":["../../src/login/login.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,EAAa,SAAS,EAAiB,MAAM,QAAQ,CAAA;AAG5D,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,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