solid-ui 3.1.3-6 → 3.1.3-7

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 (440) hide show
  1. package/dist/_virtual/~icons/lucide/chevron-down.cjs.js +1 -1
  2. package/dist/_virtual/~icons/lucide/chevron-down.esm.js +1 -0
  3. package/dist/_virtual/~icons/lucide/circle-user.cjs.js +1 -1
  4. package/dist/_virtual/~icons/lucide/circle-user.esm.js +1 -0
  5. package/dist/_virtual/~icons/lucide/log-in.cjs.js +1 -1
  6. package/dist/_virtual/~icons/lucide/log-in.esm.js +1 -0
  7. package/dist/_virtual/~icons/lucide/log-out.cjs.js +1 -1
  8. package/dist/_virtual/~icons/lucide/log-out.esm.js +1 -0
  9. package/dist/_virtual/~icons/lucide/user.cjs.js +1 -1
  10. package/dist/_virtual/~icons/lucide/user.esm.js +1 -0
  11. package/dist/_virtual/~icons/lucide/x.cjs.js +1 -1
  12. package/dist/_virtual/~icons/lucide/x.esm.js +1 -0
  13. package/dist/_virtual/~icons/svg-spinners/180-ring.cjs.js +1 -1
  14. package/dist/_virtual/~icons/svg-spinners/180-ring.esm.js +1 -0
  15. package/dist/acl/access-controller.cjs.js +1 -1
  16. package/dist/acl/access-controller.cjs.js.map +1 -1
  17. package/dist/acl/access-controller.esm.js.map +1 -1
  18. package/dist/acl/access-groups.cjs.js.map +1 -1
  19. package/dist/acl/access-groups.esm.js.map +1 -1
  20. package/dist/acl/acl-control.cjs.js +1 -1
  21. package/dist/acl/acl-control.cjs.js.map +1 -1
  22. package/dist/acl/acl-control.esm.js +1 -1
  23. package/dist/acl/acl-control.esm.js.map +1 -1
  24. package/dist/acl/acl.cjs.js.map +1 -1
  25. package/dist/acl/acl.esm.js.map +1 -1
  26. package/dist/acl/add-agent-buttons.cjs.js.map +1 -1
  27. package/dist/acl/add-agent-buttons.esm.js.map +1 -1
  28. package/dist/chat/bookmarks.cjs.js +1 -1
  29. package/dist/chat/bookmarks.cjs.js.map +1 -1
  30. package/dist/chat/bookmarks.esm.js +1 -1
  31. package/dist/chat/bookmarks.esm.js.map +1 -1
  32. package/dist/chat/chatLogic.cjs.js.map +1 -1
  33. package/dist/chat/chatLogic.esm.js.map +1 -1
  34. package/dist/chat/dateFolder.cjs.js +1 -1
  35. package/dist/chat/dateFolder.cjs.js.map +1 -1
  36. package/dist/chat/dateFolder.esm.js +1 -1
  37. package/dist/chat/dateFolder.esm.js.map +1 -1
  38. package/dist/chat/infinite.cjs.js +1 -1
  39. package/dist/chat/infinite.cjs.js.map +1 -1
  40. package/dist/chat/infinite.esm.js +1 -1
  41. package/dist/chat/infinite.esm.js.map +1 -1
  42. package/dist/chat/keys.cjs.js +1 -1
  43. package/dist/chat/keys.cjs.js.map +1 -1
  44. package/dist/chat/keys.esm.js +1 -1
  45. package/dist/chat/keys.esm.js.map +1 -1
  46. package/dist/chat/message.cjs.js +1 -1
  47. package/dist/chat/message.cjs.js.map +1 -1
  48. package/dist/chat/message.esm.js +24 -24
  49. package/dist/chat/message.esm.js.map +1 -1
  50. package/dist/chat/messageTools.cjs.js.map +1 -1
  51. package/dist/chat/messageTools.esm.js.map +1 -1
  52. package/dist/chat/signature.cjs.js +1 -1
  53. package/dist/chat/signature.cjs.js.map +1 -1
  54. package/dist/chat/signature.esm.js +1 -1
  55. package/dist/chunks/{DialogProvider-DphduSXG.js → DialogProvider-Bt65G0Tk.js} +4 -4
  56. package/dist/chunks/DialogProvider-Bt65G0Tk.js.map +1 -0
  57. package/dist/chunks/{account-CFhrB0LO.js → account-BZ2rYQhV.js} +12 -12
  58. package/dist/chunks/account-BZ2rYQhV.js.map +1 -0
  59. package/dist/chunks/{auth-Cpf3HYqF.js → auth-RHyQ2iIl.js} +10 -10
  60. package/dist/chunks/{auth-Cpf3HYqF.js.map → auth-RHyQ2iIl.js.map} +1 -1
  61. package/dist/chunks/{avatar-D281qln0.js → avatar-Jx8xm2Op.js} +5 -5
  62. package/dist/chunks/avatar-Jx8xm2Op.js.map +1 -0
  63. package/dist/chunks/{button-DbKYu6-r.js → button-0s0lZdxm.js} +2 -2
  64. package/dist/chunks/{button-DbKYu6-r.js.map → button-0s0lZdxm.js.map} +1 -1
  65. package/dist/chunks/chunk.K442ELDU-TtQSV9g1.js +1516 -0
  66. package/dist/chunks/chunk.K442ELDU-TtQSV9g1.js.map +1 -0
  67. package/dist/chunks/combobox-Cxi8xUMn.js +473 -0
  68. package/dist/chunks/combobox-Cxi8xUMn.js.map +1 -0
  69. package/dist/chunks/{combobox-option-Ck0mu4Gc.js → combobox-option-DiR3VpyT.js} +2 -2
  70. package/dist/chunks/{combobox-option-Ck0mu4Gc.js.map → combobox-option-DiR3VpyT.js.map} +1 -1
  71. package/dist/chunks/{components-BlEGdx4i.js → components-C1LEhsaK.js} +5 -9
  72. package/dist/chunks/components-C1LEhsaK.js.map +1 -0
  73. package/dist/chunks/{context-DJ_8r7Oc.js → context-uE5jJlS0.js} +2 -2
  74. package/dist/chunks/{context-DJ_8r7Oc.js.map → context-uE5jJlS0.js.map} +1 -1
  75. package/dist/chunks/decorators-BiCkPd_3.js.map +1 -1
  76. package/dist/chunks/{dialog-DlBtmOm6.js → dialog-BAzrHJ8w.js} +6 -6
  77. package/dist/chunks/dialog-BAzrHJ8w.js.map +1 -0
  78. package/dist/chunks/{dialog-content-CMeH_BD7.js → dialog-content-fdJrkCyB.js} +2 -2
  79. package/dist/chunks/{dialog-content-CMeH_BD7.js.map → dialog-content-fdJrkCyB.js.map} +1 -1
  80. package/dist/chunks/{dialog-footer-D0zzIMlx.js → dialog-footer-Bs_p2Nn9.js} +2 -2
  81. package/dist/chunks/{dialog-footer-D0zzIMlx.js.map → dialog-footer-Bs_p2Nn9.js.map} +1 -1
  82. package/dist/chunks/{dialog-header-DeC1iiLD.js → dialog-header-CWIAAoDo.js} +2 -2
  83. package/dist/chunks/{dialog-header-DeC1iiLD.js.map → dialog-header-CWIAAoDo.js.map} +1 -1
  84. package/dist/chunks/{dialogs-root-BcUcRuAt.js → dialogs-root-Cv932Aqm.js} +3 -3
  85. package/dist/chunks/{dialogs-root-BcUcRuAt.js.map → dialogs-root-Cv932Aqm.js.map} +1 -1
  86. package/dist/chunks/{footer-Bxe4WPgl.js → footer-D64T6XLO.js} +3 -3
  87. package/dist/chunks/{footer-Bxe4WPgl.js.map → footer-D64T6XLO.js.map} +1 -1
  88. package/dist/chunks/{guard-Da3znlJI.js → guard-CjUBGVDk.js} +4 -4
  89. package/dist/chunks/{guard-Da3znlJI.js.map → guard-CjUBGVDk.js.map} +1 -1
  90. package/dist/chunks/{header-Bqd2CEK3.js → header-COBaJDdB.js} +4 -4
  91. package/dist/chunks/{header-Bqd2CEK3.js.map → header-COBaJDdB.js.map} +1 -1
  92. package/dist/chunks/{headerFooterHelpers-5LYv-0Rt.js → headerFooterHelpers-7O_ln1QD.js} +2 -2
  93. package/dist/chunks/{headerFooterHelpers-5LYv-0Rt.js.map → headerFooterHelpers-7O_ln1QD.js.map} +1 -1
  94. package/dist/chunks/{input-Bkzi4zSV.js → input-BF224Jid.js} +2 -2
  95. package/dist/chunks/{input-Bkzi4zSV.js.map → input-BF224Jid.js.map} +1 -1
  96. package/dist/chunks/{jsonld-DZG2v1pE.js → jsonld-DRZuoyoU.js} +54 -54
  97. package/dist/chunks/{jsonld-DZG2v1pE.js.map → jsonld-DRZuoyoU.js.map} +1 -1
  98. package/dist/chunks/lit-C4H1jI4q.js.map +1 -1
  99. package/dist/chunks/{login-button-C603hM0G.js → login-button-DPeMi00d.js} +5 -5
  100. package/dist/chunks/{login-button-C603hM0G.js.map → login-button-DPeMi00d.js.map} +1 -1
  101. package/dist/chunks/{logout-button-Cxzpq-C3.js → logout-button-CbiLE7jO.js} +5 -5
  102. package/dist/chunks/{logout-button-Cxzpq-C3.js.map → logout-button-CbiLE7jO.js.map} +1 -1
  103. package/dist/chunks/{menu-aQiqq1ET.js → menu-DNcuV-1J.js} +183 -1693
  104. package/dist/chunks/menu-DNcuV-1J.js.map +1 -0
  105. package/dist/chunks/{menu-item-DBy4o-M4.js → menu-item-Ck0l-uEI.js} +2 -2
  106. package/dist/chunks/{menu-item-DBy4o-M4.js.map → menu-item-Ck0l-uEI.js.map} +1 -1
  107. package/dist/chunks/photo-capture-tiBsdSbA.js.map +1 -1
  108. package/dist/chunks/{provider-DZmdgerD.js → provider-C4eSzopG.js} +5 -5
  109. package/dist/chunks/{provider-DZmdgerD.js.map → provider-C4eSzopG.js.map} +1 -1
  110. package/dist/chunks/{select-wczAzbZF.js → select-D8dW53pr.js} +2 -2
  111. package/dist/chunks/{select-wczAzbZF.js.map → select-D8dW53pr.js.map} +1 -1
  112. package/dist/chunks/{select-option-hd_d1RNj.js → select-option-B-6ULCpQ.js} +2 -2
  113. package/dist/chunks/{select-option-hd_d1RNj.js.map → select-option-B-6ULCpQ.js.map} +1 -1
  114. package/dist/chunks/{signup-button-CsRaOUI4.js → signup-button-BfIxbpwa.js} +5 -5
  115. package/dist/chunks/{signup-button-CsRaOUI4.js.map → signup-button-BfIxbpwa.js.map} +1 -1
  116. package/dist/chunks/{solid-logic.esm-7q6hmfIF.js → solid-logic.esm-T70qfHAr.js} +2521 -2504
  117. package/dist/chunks/solid-logic.esm-T70qfHAr.js.map +1 -0
  118. package/dist/chunks/{src-BOU-JwWx.js → src-Bx4GAnWq.js} +16 -16
  119. package/dist/chunks/{src-BOU-JwWx.js.map → src-Bx4GAnWq.js.map} +1 -1
  120. package/dist/components/account/Account.cjs.js +1 -1
  121. package/dist/components/account/Account.cjs.js.map +1 -1
  122. package/dist/components/account/Account.esm.js +1 -1
  123. package/dist/components/account/Account.styles.cjs.js +1 -1
  124. package/dist/components/account/Account.styles.cjs.js.map +1 -1
  125. package/dist/components/account/Account.styles.esm.js +1 -1
  126. package/dist/components/account/Account.styles.esm.js.map +1 -1
  127. package/dist/components/account/index.cjs.js +1 -1
  128. package/dist/components/account/index.esm.js +1 -1
  129. package/dist/components/account.js +1 -1
  130. package/dist/components/avatar/Avatar.cjs.js +1 -1
  131. package/dist/components/avatar/Avatar.cjs.js.map +1 -1
  132. package/dist/components/avatar/Avatar.esm.js +1 -1
  133. package/dist/components/avatar/Avatar.styles.cjs.js +1 -1
  134. package/dist/components/avatar/Avatar.styles.cjs.js.map +1 -1
  135. package/dist/components/avatar/Avatar.styles.esm.js +1 -1
  136. package/dist/components/avatar/Avatar.styles.esm.js.map +1 -1
  137. package/dist/components/avatar/index.cjs.js +1 -1
  138. package/dist/components/avatar/index.esm.js +1 -1
  139. package/dist/components/avatar.js +1 -1
  140. package/dist/components/button/Button.cjs.js +1 -1
  141. package/dist/components/button/Button.cjs.js.map +1 -1
  142. package/dist/components/button/Button.esm.js +1 -1
  143. package/dist/components/button/Button.esm.js.map +1 -1
  144. package/dist/components/button/index.cjs.js +1 -1
  145. package/dist/components/button/index.esm.js +3 -3
  146. package/dist/components/button.js +1 -1
  147. package/dist/components/combobox/Combobox.cjs.js +57 -25
  148. package/dist/components/combobox/Combobox.cjs.js.map +1 -1
  149. package/dist/components/combobox/Combobox.d.ts +22 -3
  150. package/dist/components/combobox/Combobox.d.ts.map +1 -1
  151. package/dist/components/combobox/Combobox.esm.js +220 -101
  152. package/dist/components/combobox/Combobox.esm.js.map +1 -1
  153. package/dist/components/combobox/Combobox.styles.cjs.js +1 -1
  154. package/dist/components/combobox/Combobox.styles.cjs.js.map +1 -1
  155. package/dist/components/combobox/Combobox.styles.esm.js +1 -1
  156. package/dist/components/combobox/Combobox.styles.esm.js.map +1 -1
  157. package/dist/components/combobox/index.cjs.js +1 -1
  158. package/dist/components/combobox/index.esm.js +1 -1
  159. package/dist/components/combobox-option/ComboboxOption.cjs.js +1 -1
  160. package/dist/components/combobox-option/ComboboxOption.cjs.js.map +1 -1
  161. package/dist/components/combobox-option/ComboboxOption.esm.js +1 -1
  162. package/dist/components/combobox-option/index.cjs.js +1 -1
  163. package/dist/components/combobox-option/index.esm.js +1 -1
  164. package/dist/components/combobox-option.js +1 -1
  165. package/dist/components/combobox.js +1 -1
  166. package/dist/components/dialog/Dialog.cjs.js +2 -2
  167. package/dist/components/dialog/Dialog.cjs.js.map +1 -1
  168. package/dist/components/dialog/Dialog.d.ts.map +1 -1
  169. package/dist/components/dialog/Dialog.esm.js +2 -2
  170. package/dist/components/dialog/Dialog.esm.js.map +1 -1
  171. package/dist/components/dialog/index.cjs.js +1 -1
  172. package/dist/components/dialog/index.esm.js +1 -1
  173. package/dist/components/dialog-content/DialogContent.cjs.js +1 -1
  174. package/dist/components/dialog-content/DialogContent.cjs.js.map +1 -1
  175. package/dist/components/dialog-content/DialogContent.esm.js +1 -1
  176. package/dist/components/dialog-content/DialogContent.esm.js.map +1 -1
  177. package/dist/components/dialog-content/index.cjs.js +1 -1
  178. package/dist/components/dialog-content/index.esm.js +1 -1
  179. package/dist/components/dialog-content.js +1 -1
  180. package/dist/components/dialog-footer/DialogFooter.cjs.js +1 -1
  181. package/dist/components/dialog-footer/DialogFooter.cjs.js.map +1 -1
  182. package/dist/components/dialog-footer/DialogFooter.esm.js +1 -1
  183. package/dist/components/dialog-footer/DialogFooter.esm.js.map +1 -1
  184. package/dist/components/dialog-footer/index.cjs.js +1 -1
  185. package/dist/components/dialog-footer/index.esm.js +1 -1
  186. package/dist/components/dialog-footer.js +1 -1
  187. package/dist/components/dialog-header/DialogHeader.cjs.js +1 -1
  188. package/dist/components/dialog-header/DialogHeader.cjs.js.map +1 -1
  189. package/dist/components/dialog-header/DialogHeader.esm.js +1 -1
  190. package/dist/components/dialog-header/DialogHeader.esm.js.map +1 -1
  191. package/dist/components/dialog-header/index.cjs.js +1 -1
  192. package/dist/components/dialog-header/index.esm.js +1 -1
  193. package/dist/components/dialog-header.js +1 -1
  194. package/dist/components/dialog-provider/DialogProvider.cjs.js +1 -1
  195. package/dist/components/dialog-provider/DialogProvider.cjs.js.map +1 -1
  196. package/dist/components/dialog-provider/DialogProvider.esm.js +2 -2
  197. package/dist/components/dialog-provider/DialogProvider.esm.js.map +1 -1
  198. package/dist/components/dialog-provider/index.cjs.js +1 -1
  199. package/dist/components/dialog-provider/index.esm.js +1 -1
  200. package/dist/components/dialog-provider.js +1 -1
  201. package/dist/components/dialog.js +1 -1
  202. package/dist/components/dialogs-root/DialogsRoot.cjs.js +1 -1
  203. package/dist/components/dialogs-root/DialogsRoot.cjs.js.map +1 -1
  204. package/dist/components/dialogs-root/DialogsRoot.esm.js +1 -1
  205. package/dist/components/dialogs-root/index.cjs.js +1 -1
  206. package/dist/components/dialogs-root/index.esm.js +1 -1
  207. package/dist/components/dialogs-root.js +1 -1
  208. package/dist/components/footer.js +1 -1
  209. package/dist/components/guard/Guard.cjs.js +1 -1
  210. package/dist/components/guard/Guard.cjs.js.map +1 -1
  211. package/dist/components/guard/Guard.esm.js +1 -1
  212. package/dist/components/guard/index.cjs.js +1 -1
  213. package/dist/components/guard/index.esm.js +1 -1
  214. package/dist/components/guard.js +1 -1
  215. package/dist/components/header.js +1 -1
  216. package/dist/components/input/Input.cjs.js +1 -1
  217. package/dist/components/input/Input.cjs.js.map +1 -1
  218. package/dist/components/input/Input.esm.js +1 -1
  219. package/dist/components/input/index.cjs.js +1 -1
  220. package/dist/components/input/index.esm.js +1 -1
  221. package/dist/components/input.js +1 -1
  222. package/dist/components/login-button/LoginButton.cjs.js +1 -1
  223. package/dist/components/login-button/LoginButton.cjs.js.map +1 -1
  224. package/dist/components/login-button/LoginButton.esm.js +1 -1
  225. package/dist/components/login-button/index.cjs.js +1 -1
  226. package/dist/components/login-button/index.esm.js +1 -1
  227. package/dist/components/login-button.js +1 -1
  228. package/dist/components/login-modal/LoginModal.cjs.js +1 -1
  229. package/dist/components/login-modal/LoginModal.cjs.js.map +1 -1
  230. package/dist/components/login-modal/LoginModal.esm.js +1 -1
  231. package/dist/components/login-modal/index.cjs.js +1 -1
  232. package/dist/components/login-modal/index.esm.js +1 -1
  233. package/dist/components/login-modal.js +1 -1
  234. package/dist/components/logout-button/LogoutButton.cjs.js +1 -1
  235. package/dist/components/logout-button/LogoutButton.cjs.js.map +1 -1
  236. package/dist/components/logout-button/LogoutButton.esm.js +1 -1
  237. package/dist/components/logout-button/index.cjs.js +1 -1
  238. package/dist/components/logout-button/index.esm.js +1 -1
  239. package/dist/components/logout-button.js +1 -1
  240. package/dist/components/menu/Menu.cjs.js +1 -1
  241. package/dist/components/menu/Menu.cjs.js.map +1 -1
  242. package/dist/components/menu/Menu.esm.js +1 -1
  243. package/dist/components/menu/Menu.esm.js.map +1 -1
  244. package/dist/components/menu/index.cjs.js +1 -1
  245. package/dist/components/menu/index.esm.js +1 -1
  246. package/dist/components/menu-item/MenuItem.cjs.js +1 -1
  247. package/dist/components/menu-item/MenuItem.cjs.js.map +1 -1
  248. package/dist/components/menu-item/MenuItem.esm.js +1 -1
  249. package/dist/components/menu-item/index.cjs.js +1 -1
  250. package/dist/components/menu-item/index.esm.js +1 -1
  251. package/dist/components/menu-item.js +1 -1
  252. package/dist/components/menu.js +1 -1
  253. package/dist/components/provider/Provider.cjs.js +1 -1
  254. package/dist/components/provider/Provider.cjs.js.map +1 -1
  255. package/dist/components/provider/Provider.esm.js +1 -1
  256. package/dist/components/provider/index.cjs.js +1 -1
  257. package/dist/components/provider/index.esm.js +1 -1
  258. package/dist/components/provider.js +1 -1
  259. package/dist/components/select/Select.cjs.js +1 -1
  260. package/dist/components/select/Select.cjs.js.map +1 -1
  261. package/dist/components/select/Select.esm.js +1 -1
  262. package/dist/components/select/Select.esm.js.map +1 -1
  263. package/dist/components/select/index.cjs.js +1 -1
  264. package/dist/components/select/index.esm.js +1 -1
  265. package/dist/components/select-option/SelectOption.cjs.js +1 -1
  266. package/dist/components/select-option/SelectOption.cjs.js.map +1 -1
  267. package/dist/components/select-option/SelectOption.esm.js +1 -1
  268. package/dist/components/select-option/index.cjs.js +1 -1
  269. package/dist/components/select-option/index.esm.js +1 -1
  270. package/dist/components/select-option.js +1 -1
  271. package/dist/components/select.js +1 -1
  272. package/dist/components/signup-button/SignupButton.cjs.js +1 -1
  273. package/dist/components/signup-button/SignupButton.cjs.js.map +1 -1
  274. package/dist/components/signup-button/SignupButton.esm.js +1 -1
  275. package/dist/components/signup-button/index.cjs.js +1 -1
  276. package/dist/components/signup-button/index.esm.js +1 -1
  277. package/dist/components/signup-button.js +1 -1
  278. package/dist/components.js +23 -23
  279. package/dist/create/create.cjs.js.map +1 -1
  280. package/dist/create/create.esm.js.map +1 -1
  281. package/dist/create/index.cjs.js.map +1 -1
  282. package/dist/footer/index.cjs.js +1 -1
  283. package/dist/footer/index.esm.js +1 -1
  284. package/dist/header/index.cjs.js +1 -1
  285. package/dist/header/index.cjs.js.map +1 -1
  286. package/dist/header/index.esm.js +1 -1
  287. package/dist/header/index.esm.js.map +1 -1
  288. package/dist/index.js +5 -5
  289. package/dist/lib/auth/SolidAuth.cjs.js.map +1 -1
  290. package/dist/lib/auth/SolidAuth.esm.js.map +1 -1
  291. package/dist/lib/auth/context.cjs.js.map +1 -1
  292. package/dist/lib/auth/index.cjs.js +1 -1
  293. package/dist/lib/auth/index.esm.js +5 -4
  294. package/dist/lib/components/ids.cjs.js.map +1 -1
  295. package/dist/lib/components/ids.esm.js.map +1 -1
  296. package/dist/lib/components/index.cjs.js +1 -1
  297. package/dist/lib/components/index.esm.js +6 -5
  298. package/dist/lib/components/traits/DialogTrait.cjs.js.map +1 -1
  299. package/dist/lib/components/traits/DialogTrait.esm.js.map +1 -1
  300. package/dist/lib/components/traits/InputTrait.cjs.js +1 -1
  301. package/dist/lib/components/traits/InputTrait.cjs.js.map +1 -1
  302. package/dist/lib/components/traits/InputTrait.d.ts +1 -0
  303. package/dist/lib/components/traits/InputTrait.d.ts.map +1 -1
  304. package/dist/lib/components/traits/InputTrait.esm.js +3 -2
  305. package/dist/lib/components/traits/InputTrait.esm.js.map +1 -1
  306. package/dist/lib/components/traits/index.cjs.js +1 -1
  307. package/dist/lib/components/traits/index.esm.js +3 -2
  308. package/dist/lib/components/web-component/WebComponent.cjs.js +1 -1
  309. package/dist/lib/components/web-component/WebComponent.cjs.js.map +1 -1
  310. package/dist/lib/components/web-component/WebComponent.d.ts.map +1 -1
  311. package/dist/lib/components/web-component/WebComponent.esm.js +1 -6
  312. package/dist/lib/components/web-component/WebComponent.esm.js.map +1 -1
  313. package/dist/lib/components/web-component/WebComponent.styles.cjs.js.map +1 -1
  314. package/dist/lib/components/web-component/WebComponent.styles.esm.js.map +1 -1
  315. package/dist/lib/components/web-component/index.cjs.js +1 -1
  316. package/dist/lib/components/web-component/index.esm.js +2 -1
  317. package/dist/lib/dialogs/context.cjs.js.map +1 -1
  318. package/dist/lib/dialogs/index.cjs.js +1 -1
  319. package/dist/lib/dialogs/index.esm.js +6 -5
  320. package/dist/lib/log.cjs.js +1 -1
  321. package/dist/lib/log.cjs.js.map +1 -1
  322. package/dist/lib/log.esm.js +1 -1
  323. package/dist/lib/log.esm.js.map +1 -1
  324. package/dist/lib/messageArea.cjs.js.map +1 -1
  325. package/dist/lib/messageArea.esm.js.map +1 -1
  326. package/dist/lib/ns.cjs.js.map +1 -1
  327. package/dist/lib/pad.cjs.js +1 -1
  328. package/dist/lib/pad.cjs.js.map +1 -1
  329. package/dist/lib/pad.esm.js +1 -1
  330. package/dist/lib/pad.esm.js.map +1 -1
  331. package/dist/lib/participation.cjs.js.map +1 -1
  332. package/dist/lib/participation.esm.js.map +1 -1
  333. package/dist/lib/preferences.cjs.js +1 -1
  334. package/dist/lib/preferences.cjs.js.map +1 -1
  335. package/dist/lib/preferences.esm.js +1 -1
  336. package/dist/lib/preferences.esm.js.map +1 -1
  337. package/dist/lib/table.cjs.js.map +1 -1
  338. package/dist/lib/table.esm.js.map +1 -1
  339. package/dist/lib/tabs.cjs.js +1 -1
  340. package/dist/lib/tabs.cjs.js.map +1 -1
  341. package/dist/lib/tabs.esm.js +1 -1
  342. package/dist/lib/tabs.esm.js.map +1 -1
  343. package/dist/loader.js +5 -5
  344. package/dist/login/login.cjs.js +1 -1
  345. package/dist/login/login.cjs.js.map +1 -1
  346. package/dist/login/login.esm.js +1 -1
  347. package/dist/login/login.esm.js.map +1 -1
  348. package/dist/matrix/index.cjs.js.map +1 -1
  349. package/dist/matrix/matrix.cjs.js.map +1 -1
  350. package/dist/matrix/matrix.esm.js.map +1 -1
  351. package/dist/media/media-capture.cjs.js.map +1 -1
  352. package/dist/media/media-capture.esm.js.map +1 -1
  353. package/dist/signup/signup.cjs.js.map +1 -1
  354. package/dist/signup/signup.esm.js.map +1 -1
  355. package/dist/solid-ui.js +307 -275
  356. package/dist/solid-ui.min.js +307 -275
  357. package/dist/solid-ui.min.js.map +1 -1
  358. package/dist/utils/headerFooterHelpers.cjs.js.map +1 -1
  359. package/dist/utils/headerFooterHelpers.esm.js.map +1 -1
  360. package/dist/utils/index.cjs.js +2 -2
  361. package/dist/utils/index.cjs.js.map +1 -1
  362. package/dist/utils/index.esm.js +1 -1
  363. package/dist/utils/index.esm.js.map +1 -1
  364. package/dist/utils/keyHelpers/accessData.cjs.js +1 -1
  365. package/dist/utils/keyHelpers/accessData.cjs.js.map +1 -1
  366. package/dist/utils/keyHelpers/accessData.esm.js +1 -1
  367. package/dist/utils/keyHelpers/accessData.esm.js.map +1 -1
  368. package/dist/utils/keyHelpers/acl.cjs.js.map +1 -1
  369. package/dist/utils/keyHelpers/acl.esm.js.map +1 -1
  370. package/dist/utils/keyHelpers/otherHelpers.cjs.js.map +1 -1
  371. package/dist/utils/keyHelpers/otherHelpers.esm.js.map +1 -1
  372. package/dist/utils/label.cjs.js.map +1 -1
  373. package/dist/utils/label.esm.js.map +1 -1
  374. package/dist/v2/components/auth/loginButton/LoginButton.cjs.js.map +1 -1
  375. package/dist/v2/components/auth/loginButton/LoginButton.esm.js.map +1 -1
  376. package/dist/v2/components/auth/loginButton/downArrow.cjs.js.map +1 -1
  377. package/dist/v2/components/auth/loginButton/index.cjs.js +1 -1
  378. package/dist/v2/components/auth/loginButton/index.esm.js +1 -0
  379. package/dist/v2/components/auth/signupButton/index.cjs.js +1 -1
  380. package/dist/v2/components/auth/signupButton/index.esm.js +1 -0
  381. package/dist/v2/components/layout/footer/index.cjs.js +1 -1
  382. package/dist/v2/components/layout/footer/index.esm.js +1 -0
  383. package/dist/v2/components/layout/header/Header.cjs.js.map +1 -1
  384. package/dist/v2/components/layout/header/Header.esm.js.map +1 -1
  385. package/dist/v2/components/layout/header/index.cjs.js +1 -1
  386. package/dist/v2/components/layout/header/index.esm.js +1 -0
  387. package/dist/v2/components/media/photoCapture/PhotoCapture.cjs.js.map +1 -1
  388. package/dist/v2/components/media/photoCapture/PhotoCapture.esm.js.map +1 -1
  389. package/dist/v2/components/media/photoCapture/index.cjs.js +1 -1
  390. package/dist/v2/components/media/photoCapture/index.esm.js +1 -0
  391. package/dist/widgets/buttons/iconLinks.cjs.js.map +1 -1
  392. package/dist/widgets/buttons/iconLinks.esm.js.map +1 -1
  393. package/dist/widgets/buttons.cjs.js.map +1 -1
  394. package/dist/widgets/buttons.esm.js.map +1 -1
  395. package/dist/widgets/dragAndDrop.cjs.js.map +1 -1
  396. package/dist/widgets/dragAndDrop.esm.js.map +1 -1
  397. package/dist/widgets/error.cjs.js.map +1 -1
  398. package/dist/widgets/error.esm.js.map +1 -1
  399. package/dist/widgets/forms/autocomplete/autocompleteField.cjs.js.map +1 -1
  400. package/dist/widgets/forms/autocomplete/autocompleteField.esm.js.map +1 -1
  401. package/dist/widgets/forms/autocomplete/autocompletePicker.cjs.js.map +1 -1
  402. package/dist/widgets/forms/autocomplete/autocompletePicker.esm.js.map +1 -1
  403. package/dist/widgets/forms/autocomplete/language.cjs.js +1 -1
  404. package/dist/widgets/forms/autocomplete/language.cjs.js.map +1 -1
  405. package/dist/widgets/forms/autocomplete/language.esm.js +1 -1
  406. package/dist/widgets/forms/autocomplete/language.esm.js.map +1 -1
  407. package/dist/widgets/forms/autocomplete/publicData.cjs.js +1 -1
  408. package/dist/widgets/forms/autocomplete/publicData.cjs.js.map +1 -1
  409. package/dist/widgets/forms/autocomplete/publicData.esm.js +1 -1
  410. package/dist/widgets/forms/autocomplete/publicData.esm.js.map +1 -1
  411. package/dist/widgets/forms/basic.cjs.js.map +1 -1
  412. package/dist/widgets/forms/basic.esm.js.map +1 -1
  413. package/dist/widgets/forms/fieldFunction.cjs.js.map +1 -1
  414. package/dist/widgets/forms/fieldParams.cjs.js.map +1 -1
  415. package/dist/widgets/forms/fieldParams.esm.js.map +1 -1
  416. package/dist/widgets/forms/formStyle.cjs.js.map +1 -1
  417. package/dist/widgets/forms/formStyle.esm.js.map +1 -1
  418. package/dist/widgets/forms.cjs.js +1 -1
  419. package/dist/widgets/forms.cjs.js.map +1 -1
  420. package/dist/widgets/forms.esm.js +1 -1
  421. package/dist/widgets/forms.esm.js.map +1 -1
  422. package/dist/widgets/index.cjs.js +1 -1
  423. package/dist/widgets/index.esm.js +65 -65
  424. package/dist/widgets/multiSelect.cjs.js.map +1 -1
  425. package/dist/widgets/multiSelect.esm.js.map +1 -1
  426. package/dist/widgets/peoplePicker.cjs.js.map +1 -1
  427. package/dist/widgets/peoplePicker.esm.js.map +1 -1
  428. package/dist/widgets/widgetHelpers.cjs.js.map +1 -1
  429. package/dist/widgets/widgetHelpers.esm.js.map +1 -1
  430. package/package.json +8 -10
  431. package/dist/chunks/DialogProvider-DphduSXG.js.map +0 -1
  432. package/dist/chunks/account-CFhrB0LO.js.map +0 -1
  433. package/dist/chunks/avatar-D281qln0.js.map +0 -1
  434. package/dist/chunks/combobox-Dtgc8qqO.js +0 -354
  435. package/dist/chunks/combobox-Dtgc8qqO.js.map +0 -1
  436. package/dist/chunks/components-BlEGdx4i.js.map +0 -1
  437. package/dist/chunks/dialog-DlBtmOm6.js.map +0 -1
  438. package/dist/chunks/menu-aQiqq1ET.js.map +0 -1
  439. package/dist/chunks/solid-logic.esm-7q6hmfIF.js.map +0 -1
  440. package/dist/solid-ui.js.map +0 -1
@@ -120,6 +120,6 @@ function x(e, t, n) {
120
120
  r && i || !r && a || (t.setAttribute("aria-expanded", (!r).toString()), n.setAttribute("aria-hidden", r.toString()));
121
121
  }
122
122
  //#endregion
123
- export { d as initHeader };
123
+ export { p as createBanner, m as createHelpMenu, h as createLoginSignUpButtons, v as createUserMenu, g as createUserMenuButton, y as createUserMenuItem, _ as createUserMenuLink, b as getProfileImg, d as initHeader, f as rebuildHeader };
124
124
 
125
125
  //# sourceMappingURL=index.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.esm.js","names":[],"sources":["../../src/header/index.ts"],"sourcesContent":["/* global EventListenerOrEventListenerObject */\n/*\n This file was copied from mashlib/src/global/header.ts file. It is modified to\n work in solid-ui by adjusting where imported functions are found.\n */\nimport { IndexedFormula, NamedNode } from 'rdflib'\nimport { icons } from '../lib/iconBase'\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 { style } from '../lib/style'\nimport { emptyProfile } from './empty-profile'\nimport { 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.events.on('logout', rebuildHeader(header, store, pod, userMenuList, options))\n authSession.events.on('login', 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 podLink.setAttribute('style', style.headerBannerLink)\n const image = document.createElement('img')\n if (options) {\n image.src = options.logo ? options.logo : DEFAUL_SOLID_ICON_URL\n }\n image.setAttribute('style', style.headerBannerIcon)\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 banner.setAttribute('style', style.headerBanner)\n banner.appendChild(podLink)\n\n const leftSideOfHeader = document.createElement('div')\n leftSideOfHeader.setAttribute('style', style.headerBannerRightMenu)\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 helpMenuList.setAttribute('style', style.headerUserMenuList)\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 helpMenu.setAttribute('style', style.headerUserMenuNavigationMenuNotDisplayed)\n helpMenu.setAttribute('aria-hidden', 'true')\n helpMenu.setAttribute('id', 'helperNav')\n helpMenu.appendChild(helpMenuList)\n\n const helpMenuContainer = document.createElement('div')\n helpMenuContainer.setAttribute('style', style.headerBannerUserMenu)\n helpMenuContainer.appendChild(helpMenu)\n\n const helpMenuTrigger = document.createElement('button')\n helpMenuTrigger.setAttribute('style', style.headerUserMenuTrigger)\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 helpMenuIcon.setAttribute('style', style.headerUserMenuTriggerImg)\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 const nav = document.getElementById('helperNav')\n nav?.setAttribute('style', style.headerUserMenuNavigationMenu)\n })\n helpMenuContainer.addEventListener('mouseout', event => {\n timer = setTimeout(() => throttledMenuToggle(event), 200)\n const nav = document.getElementById('helperNav')\n nav?.setAttribute('style', style.headerUserMenuNavigationMenuNotDisplayed)\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 profileLoginButtonPre.setAttribute('style', style.headerBannerLogin)\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 button.setAttribute('style', style.headerUserMenuButton)\n button.onmouseover = function () {\n button.setAttribute('style', style.headerUserMenuButtonHover)\n }\n button.onmouseout = function () {\n button.setAttribute('style', style.headerUserMenuButton)\n }\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 link.setAttribute('style', style.headerUserMenuLink)\n link.onmouseover = function () {\n link.setAttribute('style', style.headerUserMenuLinkHover)\n }\n link.onmouseout = function () {\n link.setAttribute('style', style.headerUserMenuLink)\n }\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 loggedInMenuList.setAttribute('style', style.headerUserMenuList)\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 loggedInMenu.setAttribute('style', style.headerUserMenuNavigationMenuNotDisplayed)\n loggedInMenu.setAttribute('aria-hidden', 'true')\n loggedInMenu.setAttribute('id', 'loggedInNav')\n loggedInMenu.appendChild(loggedInMenuList)\n\n const loggedInMenuTrigger = document.createElement('button')\n loggedInMenuTrigger.setAttribute('style', style.headerUserMenuTrigger)\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 loggedInMenuContainer.setAttribute('style', style.headerBannerUserMenuNotDisplayed)\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 const nav = document.getElementById('loggedInNav')\n nav?.setAttribute('style', style.headerUserMenuNavigationMenu)\n })\n loggedInMenuContainer.addEventListener('mouseout', event => {\n timer = setTimeout(() => throttledMenuToggle(event), 200)\n const nav = document.getElementById('loggedInNav')\n nav?.setAttribute('style', style.headerUserMenuNavigationMenuNotDisplayed)\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 menuProfileItem.setAttribute('style', style.headerUserMenuListItem)\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 profileImage.setAttribute('style', style.headerUserMenuPhoto)\n profileImage.style.backgroundImage = `url(${profileUrl})`\n return profileImage\n}\n\n/**\n * @internal\n */\nfunction toggleMenu (event: Event, trigger: HTMLButtonElement, menu: HTMLElement): void {\n const isExpanded = trigger.getAttribute('aria-expanded') === 'true'\n const expand = event.type === 'mouseover'\n const close = event.type === 'mouseout'\n if ((isExpanded && expand) || (!isExpanded && close)) {\n return\n }\n trigger.setAttribute('aria-expanded', (!isExpanded).toString())\n menu.setAttribute('aria-hidden', isExpanded.toString())\n}\n"],"mappings":";;;;;;;;;AAkBA,IAAM,IAAyB,EAAM,WAAW,iBAC1C,IAAwB;AAgC9B,eAAsB,EAAY,GAAuB,GAA2B,GAAyB;CAC3G,IAAM,IAAS,SAAS,eAAe,YAAY;CACnD,IAAI,CAAC,GACH;CAGF,IAAM,IAAM,EAAO;CAGnB,AAFA,EAAc,GAAQ,GAAO,GAAK,GAAc,CAAO,EAAE,GACzD,EAAY,OAAO,GAAG,UAAU,EAAc,GAAQ,GAAO,GAAK,GAAc,CAAO,CAAC,GACxF,EAAY,OAAO,GAAG,SAAS,EAAc,GAAQ,GAAO,GAAK,GAAc,CAAO,CAAC;AACzF;AAIA,SAAgB,EAAe,GAAqB,GAAuB,GAAgB,GAA2B,GAAyB;CAC7I,OAAO,YAAY;EACjB,IAAM,IAAO,EAAM,YAAY;EAE/B,AADA,EAAO,YAAY,IACnB,EAAO,YAAY,MAAM,EAAa,GAAO,GAAK,GAAM,GAAc,CAAO,CAAC;CAChF;AACF;AAIA,eAAsB,EAAc,GAAuB,GAAgB,GAAwB,GAA2B,GAA+C;CAC3K,IAAM,IAAU,SAAS,cAAc,GAAG;CAE1C,AADA,EAAQ,OAAO,EAAI,KACnB,EAAQ,aAAa,SAAS,EAAM,gBAAgB;CACpD,IAAM,IAAQ,SAAS,cAAc,KAAK;CAK1C,AAJI,MACF,EAAM,MAAM,EAAQ,OAAO,EAAQ,OAAO,IAE5C,EAAM,aAAa,SAAS,EAAM,gBAAgB,GAClD,EAAQ,YAAY,CAAK;CAEzB,IAAM,IAAW,IACb,MAAM,EAAe,GAAO,GAAM,CAAY,IAC9C,EAAy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AI,IAAQ,iBAAiB,MAAM,CAAC;CAapC,OAZA,EAAsB,iBAAiB,cAAa,MAAS;EAI3D,AAHA,aAAa,CAAK,GAClB,EAAoB,CAAK,GAEzB,SADqB,eAAe,aACpC,GAAK,aAAa,SAAS,EAAM,4BAA4B;CAC/D,CAAC,GACD,EAAsB,iBAAiB,aAAY,MAAS;EAG1D,AAFA,IAAQ,iBAAiB,EAAoB,CAAK,GAAG,GAAG,GAExD,SADqB,eAAe,aACpC,GAAK,aAAa,SAAS,EAAM,wCAAwC;CAC3E,CAAC,GAEM;AACT;AAKA,SAAgB,EAAoB,GAAiC;CACnE,IAAM,IAAkB,SAAS,cAAc,IAAI;CAGnD,OAFA,EAAgB,aAAa,SAAS,EAAM,sBAAsB,GAClE,EAAgB,YAAY,CAAK,GAC1B;AACT;AAIA,SAAgB,EAAe,GAAuB,GAAuC;CAC3F,IAAI,IAAa;CACjB,IAAI;EAEF,IADA,IAAa,EAAkB,CAAI,GAC/B,CAAC,GACH,OAAO;CAEX,QAAQ;EACN,OAAO;CACT;CAEA,IAAM,IAAe,SAAS,cAAc,KAAK;CAGjD,OAFA,EAAa,aAAa,SAAS,EAAM,mBAAmB,GAC5D,EAAa,MAAM,kBAAkB,OAAO,EAAW,IAChD;AACT;AAKA,SAAS,EAAY,GAAc,GAA4B,GAAyB;CACtF,IAAM,IAAa,EAAQ,aAAa,eAAe,MAAM,QACvD,IAAS,EAAM,SAAS,aACxB,IAAQ,EAAM,SAAS;CACxB,KAAc,KAAY,CAAC,KAAc,MAG9C,EAAQ,aAAa,kBAAkB,CAAC,GAAY,SAAS,CAAC,GAC9D,EAAK,aAAa,eAAe,EAAW,SAAS,CAAC;AACxD"}
1
+ {"version":3,"file":"index.esm.js","names":[],"sources":["../../src/header/index.ts"],"sourcesContent":["/* global EventListenerOrEventListenerObject */\n/*\n This file was copied from mashlib/src/global/header.ts file. It is modified to\n work in solid-ui by adjusting where imported functions are found.\n */\nimport { IndexedFormula, NamedNode } from 'rdflib'\nimport { icons } from '../lib/iconBase'\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 { style } from '../lib/style'\nimport { emptyProfile } from './empty-profile'\nimport { 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.events.on('logout', rebuildHeader(header, store, pod, userMenuList, options))\n authSession.events.on('login', 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 podLink.setAttribute('style', style.headerBannerLink)\n const image = document.createElement('img')\n if (options) {\n image.src = options.logo ? options.logo : DEFAUL_SOLID_ICON_URL\n }\n image.setAttribute('style', style.headerBannerIcon)\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 banner.setAttribute('style', style.headerBanner)\n banner.appendChild(podLink)\n\n const leftSideOfHeader = document.createElement('div')\n leftSideOfHeader.setAttribute('style', style.headerBannerRightMenu)\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 helpMenuList.setAttribute('style', style.headerUserMenuList)\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 helpMenu.setAttribute('style', style.headerUserMenuNavigationMenuNotDisplayed)\n helpMenu.setAttribute('aria-hidden', 'true')\n helpMenu.setAttribute('id', 'helperNav')\n helpMenu.appendChild(helpMenuList)\n\n const helpMenuContainer = document.createElement('div')\n helpMenuContainer.setAttribute('style', style.headerBannerUserMenu)\n helpMenuContainer.appendChild(helpMenu)\n\n const helpMenuTrigger = document.createElement('button')\n helpMenuTrigger.setAttribute('style', style.headerUserMenuTrigger)\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 helpMenuIcon.setAttribute('style', style.headerUserMenuTriggerImg)\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 const nav = document.getElementById('helperNav')\n nav?.setAttribute('style', style.headerUserMenuNavigationMenu)\n })\n helpMenuContainer.addEventListener('mouseout', event => {\n timer = setTimeout(() => throttledMenuToggle(event), 200)\n const nav = document.getElementById('helperNav')\n nav?.setAttribute('style', style.headerUserMenuNavigationMenuNotDisplayed)\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 profileLoginButtonPre.setAttribute('style', style.headerBannerLogin)\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 button.setAttribute('style', style.headerUserMenuButton)\n button.onmouseover = function () {\n button.setAttribute('style', style.headerUserMenuButtonHover)\n }\n button.onmouseout = function () {\n button.setAttribute('style', style.headerUserMenuButton)\n }\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 link.setAttribute('style', style.headerUserMenuLink)\n link.onmouseover = function () {\n link.setAttribute('style', style.headerUserMenuLinkHover)\n }\n link.onmouseout = function () {\n link.setAttribute('style', style.headerUserMenuLink)\n }\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 loggedInMenuList.setAttribute('style', style.headerUserMenuList)\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 loggedInMenu.setAttribute('style', style.headerUserMenuNavigationMenuNotDisplayed)\n loggedInMenu.setAttribute('aria-hidden', 'true')\n loggedInMenu.setAttribute('id', 'loggedInNav')\n loggedInMenu.appendChild(loggedInMenuList)\n\n const loggedInMenuTrigger = document.createElement('button')\n loggedInMenuTrigger.setAttribute('style', style.headerUserMenuTrigger)\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 loggedInMenuContainer.setAttribute('style', style.headerBannerUserMenuNotDisplayed)\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 const nav = document.getElementById('loggedInNav')\n nav?.setAttribute('style', style.headerUserMenuNavigationMenu)\n })\n loggedInMenuContainer.addEventListener('mouseout', event => {\n timer = setTimeout(() => throttledMenuToggle(event), 200)\n const nav = document.getElementById('loggedInNav')\n nav?.setAttribute('style', style.headerUserMenuNavigationMenuNotDisplayed)\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 menuProfileItem.setAttribute('style', style.headerUserMenuListItem)\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 profileImage.setAttribute('style', style.headerUserMenuPhoto)\n profileImage.style.backgroundImage = `url(${profileUrl})`\n return profileImage\n}\n\n/**\n * @internal\n */\nfunction toggleMenu (event: Event, trigger: HTMLButtonElement, menu: HTMLElement): void {\n const isExpanded = trigger.getAttribute('aria-expanded') === 'true'\n const expand = event.type === 'mouseover'\n const close = event.type === 'mouseout'\n if ((isExpanded && expand) || (!isExpanded && close)) {\n return\n }\n trigger.setAttribute('aria-expanded', (!isExpanded).toString())\n menu.setAttribute('aria-hidden', isExpanded.toString())\n}\n"],"mappings":";;;;;;;;;AAkBA,IAAM,IAAyB,EAAM,WAAW,iBAC1C,IAAwB;AAgC9B,eAAsB,EAAY,GAAuB,GAA2B,GAAyB;CAC3G,IAAM,IAAS,SAAS,e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C,GAEM;AACT;AAKA,SAAgB,EAAoB,GAAiC;CACnE,IAAM,IAAkB,SAAS,cAAc,IAAI;CAGnD,OAFA,EAAgB,aAAa,SAAS,EAAM,sBAAsB,GAClE,EAAgB,YAAY,CAAK,GAC1B;AACT;AAIA,SAAgB,EAAe,GAAuB,GAAuC;CAC3F,IAAI,IAAa;CACjB,IAAI;EAEF,IADA,IAAa,EAAkB,CAAI,GAC/B,CAAC,GACH,OAAO;CAEX,QAAQ;EACN,OAAO;CACT;CAEA,IAAM,IAAe,SAAS,cAAc,KAAK;CAGjD,OAFA,EAAa,aAAa,SAAS,EAAM,mBAAmB,GAC5D,EAAa,MAAM,kBAAkB,OAAO,EAAW,IAChD;AACT;AAKA,SAAS,EAAY,GAAc,GAA4B,GAAyB;CACtF,IAAM,IAAa,EAAQ,aAAa,eAAe,MAAM,QACvD,IAAS,EAAM,SAAS,aACxB,IAAQ,EAAM,SAAS;CACxB,KAAc,KAAY,CAAC,KAAc,MAG9C,EAAQ,aAAa,kBAAkB,CAAC,EAAA,CAAY,SAAS,CAAC,GAC9D,EAAK,aAAa,eAAe,EAAW,SAAS,CAAC;AACxD"}
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
- import { g as e } from "./chunks/solid-logic.esm-7q6hmfIF.js";
2
- import { S as t, _ as n, a as r, b as i, c as a, d as o, f as s, g as c, h as l, i as u, l as d, m as f, n as p, o as m, p as h, r as g, s as _, t as v, u as y, v as b, x, y as S } from "./chunks/src-BOU-JwWx.js";
1
+ import { g as e } from "./chunks/solid-logic.esm-T70qfHAr.js";
2
+ import { S as t, _ as n, a as r, b as i, c as a, d as o, f as s, g as c, h as l, i as u, l as d, m as f, n as p, o as m, p as h, r as g, s as _, t as v, u as y, v as b, x, y as S } from "./chunks/src-Bx4GAnWq.js";
3
3
  import { n as C } from "./chunks/iconBase-DJ0zbNSL.js";
4
- import { a as w, c as T, l as E, n as D, o as O, s as k, t as A, u as j } from "./chunks/auth-Cpf3HYqF.js";
5
- import { n as M, t as N } from "./chunks/context-DJ_8r7Oc.js";
6
- import { a as P, i as F, n as I, o as L, r as R, t as z } from "./chunks/components-BlEGdx4i.js";
4
+ import { a as w, c as T, l as E, n as D, o as O, s as k, t as A, u as j } from "./chunks/auth-RHyQ2iIl.js";
5
+ import { n as M, t as N } from "./chunks/context-uE5jJlS0.js";
6
+ import { a as P, i as F, n as I, o as L, r as R, t as z } from "./chunks/components-C1LEhsaK.js";
7
7
  import { t as B } from "./chunks/show-dialog-eEW5yRBv.js";
8
8
  export { j as Account, R as CloseDialogEvent, k as DEFAULT_AUTH_CONTEXT, N as DEFAULT_DIALOG_CONTEXT, A as DEFAULT_SIGNUP_URL, O as Dialog, I as DialogTrait, z as InputTrait, E as NoopAuth, B as ShowDialogEvent, D as SolidAuth, F as WebComponent, l as acl, c as aclControl, T as authContext, f as create, p as createTypes, P as customElement, M as dialogContext, v as dom, L as generateId, C as icons, a as infiniteMessageArea, g as initFooter, u as initHeader, S as language, t as log, n as login, h as matrix, s as media, o as messageArea, e as ns, d as pad, y as participation, _ as preferences, w as showDialog, i as style, m as table, r as tabs, x as utils, b as widgets };
@@ -1 +1 @@
1
- {"version":3,"file":"SolidAuth.cjs.js","names":[],"sources":["../../../src/lib/auth/SolidAuth.ts"],"sourcesContent":["import { authSession, solidLogicSingleton } from 'solid-logic'\nimport Account from '@/lib/auth/Account'\nimport { AuthContext } from '@/lib/auth'\nimport { showDialog } from '@/lib/dialogs'\nimport { html } from 'lit'\nimport ns from '@/lib/ns'\n\nimport '@/components/login-modal'\n\nexport const DEFAULT_SIGNUP_URL = 'https://solidproject.org/get_a_pod'\n\nfunction findAccountImage (webId: string): string | undefined {\n const store = solidLogicSingleton.store\n const me = store.sym(webId)\n const image =\n store.any(me, ns.sioc('avatar')) ||\n store.any(me, ns.foaf('img')) ||\n store.any(me, ns.vcard('logo')) ||\n store.any(me, ns.vcard('hasPhoto')) ||\n store.any(me, ns.vcard('photo')) ||\n store.any(me, ns.foaf('depiction'))\n\n return image ? (image as any).value : undefined\n}\n\nexport default class SolidAuth implements AuthContext {\n constructor (public signupUrl: string = DEFAULT_SIGNUP_URL) {}\n\n get account (): Account | null {\n const webId: string | undefined = authSession.webId ?? authSession.info?.webId\n const isActive: boolean = authSession.isActive ?? authSession.info?.isLoggedIn ?? Boolean(webId)\n if (!isActive || !webId) {\n return null\n }\n\n const avatarUrl = findAccountImage(webId)\n\n return new Account(webId, avatarUrl)\n }\n\n async login (loginUrl?: string) {\n if (!loginUrl) {\n showDialog(html`<solid-ui-login-modal></solid-ui-login-modal>`)\n\n return\n }\n\n // clear authorization metadata from store\n ;(solidLogicSingleton.store.updater as any).flagAuthorizationMetadata()\n\n const preLoginRedirectHash = new URL(window.location.href).hash\n if (preLoginRedirectHash) {\n window.localStorage.setItem('preLoginRedirectHash', preLoginRedirectHash)\n }\n window.localStorage.setItem('loginIssuer', loginUrl)\n\n const locationUrl = new URL(window.location.href)\n\n locationUrl.hash = ''\n\n await authSession.login(loginUrl, locationUrl.href)\n }\n\n async signup () {\n window.open(this.signupUrl, '_blank', 'noopener,noreferrer')\n }\n\n async logout () {\n await authSession.logout()\n }\n\n onSessionUpdated (callback: () => unknown) {\n const sessionEventTarget = authSession as unknown as EventTarget\n const listener = () => {\n callback()\n }\n if (typeof sessionEventTarget.addEventListener === 'function') {\n sessionEventTarget.addEventListener('sessionStateChange', listener)\n } else {\n authSession.events.on('login', callback)\n authSession.events.on('logout', callback)\n authSession.events.on('sessionRestore', callback)\n }\n\n return () => {\n if (typeof sessionEventTarget.removeEventListener === 'function') {\n sessionEventTarget.removeEventListener('sessionStateChange', listener)\n } else {\n authSession.events.off('login', callback)\n authSession.events.off('logout', callback)\n authSession.events.off('sessionRestore', callback)\n }\n }\n }\n}\n"],"mappings":"2OASA,IAAa,EAAqB,qCAElC,SAAS,EAAkB,EAAmC,CAC5D,IAAM,EAAQ,EAAA,oBAAoB,MAC5B,EAAK,EAAM,IAAI,CAAK,EACpB,EACJ,EAAM,IAAI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EAAA,YACrB,MAAiB,CACrB,EAAS,CACX,EASA,OARI,OAAO,EAAmB,kBAAqB,WACjD,EAAmB,iBAAiB,qBAAsB,CAAQ,GAElE,EAAA,YAAY,OAAO,GAAG,QAAS,CAAQ,EACvC,EAAA,YAAY,OAAO,GAAG,SAAU,CAAQ,EACxC,EAAA,YAAY,OAAO,GAAG,iBAAkB,CAAQ,OAGrC,CACP,OAAO,EAAmB,qBAAwB,WACpD,EAAmB,oBAAoB,qBAAsB,CAAQ,GAErE,EAAA,YAAY,OAAO,IAAI,QAAS,CAAQ,EACxC,EAAA,YAAY,OAAO,IAAI,SAAU,CAAQ,EACzC,EAAA,YAAY,OAAO,IAAI,iBAAkB,CAAQ,EAErD,CACF,CACF"}
1
+ {"version":3,"file":"SolidAuth.cjs.js","names":[],"sources":["../../../src/lib/auth/SolidAuth.ts"],"sourcesContent":["import { authSession, solidLogicSingleton } from 'solid-logic'\nimport Account from '@/lib/auth/Account'\nimport { AuthContext } from '@/lib/auth'\nimport { showDialog } from '@/lib/dialogs'\nimport { html } from 'lit'\nimport ns from '@/lib/ns'\n\nimport '@/components/login-modal'\n\nexport const DEFAULT_SIGNUP_URL = 'https://solidproject.org/get_a_pod'\n\nfunction findAccountImage (webId: string): string | undefined {\n const store = solidLogicSingleton.store\n const me = store.sym(webId)\n const image =\n store.any(me, ns.sioc('avatar')) ||\n store.any(me, ns.foaf('img')) ||\n store.any(me, ns.vcard('logo')) ||\n store.any(me, ns.vcard('hasPhoto')) ||\n store.any(me, ns.vcard('photo')) ||\n store.any(me, ns.foaf('depiction'))\n\n return image ? (image as any).value : undefined\n}\n\nexport default class SolidAuth implements AuthContext {\n constructor (public signupUrl: string = DEFAULT_SIGNUP_URL) {}\n\n get account (): Account | null {\n const webId: string | undefined = authSession.webId ?? authSession.info?.webId\n const isActive: boolean = authSession.isActive ?? authSession.info?.isLoggedIn ?? Boolean(webId)\n if (!isActive || !webId) {\n return null\n }\n\n const avatarUrl = findAccountImage(webId)\n\n return new Account(webId, avatarUrl)\n }\n\n async login (loginUrl?: string) {\n if (!loginUrl) {\n showDialog(html`<solid-ui-login-modal></solid-ui-login-modal>`)\n\n return\n }\n\n // clear authorization metadata from store\n ;(solidLogicSingleton.store.updater as any).flagAuthorizationMetadata()\n\n const preLoginRedirectHash = new URL(window.location.href).hash\n if (preLoginRedirectHash) {\n window.localStorage.setItem('preLoginRedirectHash', preLoginRedirectHash)\n }\n window.localStorage.setItem('loginIssuer', loginUrl)\n\n const locationUrl = new URL(window.location.href)\n\n locationUrl.hash = ''\n\n await authSession.login(loginUrl, locationUrl.href)\n }\n\n async signup () {\n window.open(this.signupUrl, '_blank', 'noopener,noreferrer')\n }\n\n async logout () {\n await authSession.logout()\n }\n\n onSessionUpdated (callback: () => unknown) {\n const sessionEventTarget = authSession as unknown as EventTarget\n const listener = () => {\n callback()\n }\n if (typeof sessionEventTarget.addEventListener === 'function') {\n sessionEventTarget.addEventListener('sessionStateChange', listener)\n } else {\n authSession.events.on('login', callback)\n authSession.events.on('logout', callback)\n authSession.events.on('sessionRestore', callback)\n }\n\n return () => {\n if (typeof sessionEventTarget.removeEventListener === 'function') {\n sessionEventTarget.removeEventListener('sessionStateChange', listener)\n } else {\n authSession.events.off('login', callback)\n authSession.events.off('logout', callback)\n authSession.events.off('sessionRestore', callback)\n }\n }\n }\n}\n"],"mappings":"2OASA,IAAa,EAAqB,qCAElC,SAAS,EAAkB,EAAmC,CAC5D,IAAM,EAAQ,EAAA,oBAAoB,MAC5B,EAAK,EAAM,IAAI,CAAK,EACpB,EACJ,EAAM,IAAI,EAAI,EAAA,QAAG,KAAK,QAAQ,CAAC,GAC/B,EAAM,IAAI,EAAI,EAAA,QAAG,KAAK,KAAK,CAAC,GAC5B,EAAM,IAAI,EAAI,EAAA,QAAG,MAAM,MAAM,CAAC,GAC9B,EAAM,IAAI,EAAI,EAAA,QAAG,MAAM,UAAU,CAAC,GAClC,EAAM,IAAI,EAAI,EAAA,QAAG,MAAM,OAAO,CAAC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AO,EAAmB,qBAAwB,WACpD,EAAmB,oBAAoB,qBAAsB,CAAQ,GAErE,EAAA,YAAY,OAAO,IAAI,QAAS,CAAQ,EACxC,EAAA,YAAY,OAAO,IAAI,SAAU,CAAQ,EACzC,EAAA,YAAY,OAAO,IAAI,iBAAkB,CAAQ,EAErD,CACF,CACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"SolidAuth.esm.js","names":[],"sources":["../../../src/lib/auth/SolidAuth.ts"],"sourcesContent":["import { authSession, solidLogicSingleton } from 'solid-logic'\nimport Account from '@/lib/auth/Account'\nimport { AuthContext } from '@/lib/auth'\nimport { showDialog } from '@/lib/dialogs'\nimport { html } from 'lit'\nimport ns from '@/lib/ns'\n\nimport '@/components/login-modal'\n\nexport const DEFAULT_SIGNUP_URL = 'https://solidproject.org/get_a_pod'\n\nfunction findAccountImage (webId: string): string | undefined {\n const store = solidLogicSingleton.store\n const me = store.sym(webId)\n const image =\n store.any(me, ns.sioc('avatar')) ||\n store.any(me, ns.foaf('img')) ||\n store.any(me, ns.vcard('logo')) ||\n store.any(me, ns.vcard('hasPhoto')) ||\n store.any(me, ns.vcard('photo')) ||\n store.any(me, ns.foaf('depiction'))\n\n return image ? (image as any).value : undefined\n}\n\nexport default class SolidAuth implements AuthContext {\n constructor (public signupUrl: string = DEFAULT_SIGNUP_URL) {}\n\n get account (): Account | null {\n const webId: string | undefined = authSession.webId ?? authSession.info?.webId\n const isActive: boolean = authSession.isActive ?? authSession.info?.isLoggedIn ?? Boolean(webId)\n if (!isActive || !webId) {\n return null\n }\n\n const avatarUrl = findAccountImage(webId)\n\n return new Account(webId, avatarUrl)\n }\n\n async login (loginUrl?: string) {\n if (!loginUrl) {\n showDialog(html`<solid-ui-login-modal></solid-ui-login-modal>`)\n\n return\n }\n\n // clear authorization metadata from store\n ;(solidLogicSingleton.store.updater as any).flagAuthorizationMetadata()\n\n const preLoginRedirectHash = new URL(window.location.href).hash\n if (preLoginRedirectHash) {\n window.localStorage.setItem('preLoginRedirectHash', preLoginRedirectHash)\n }\n window.localStorage.setItem('loginIssuer', loginUrl)\n\n const locationUrl = new URL(window.location.href)\n\n locationUrl.hash = ''\n\n await authSession.login(loginUrl, locationUrl.href)\n }\n\n async signup () {\n window.open(this.signupUrl, '_blank', 'noopener,noreferrer')\n }\n\n async logout () {\n await authSession.logout()\n }\n\n onSessionUpdated (callback: () => unknown) {\n const sessionEventTarget = authSession as unknown as EventTarget\n const listener = () => {\n callback()\n }\n if (typeof sessionEventTarget.addEventListener === 'function') {\n sessionEventTarget.addEventListener('sessionStateChange', listener)\n } else {\n authSession.events.on('login', callback)\n authSession.events.on('logout', callback)\n authSession.events.on('sessionRestore', callback)\n }\n\n return () => {\n if (typeof sessionEventTarget.removeEventListener === 'function') {\n sessionEventTarget.removeEventListener('sessionStateChange', listener)\n } else {\n authSession.events.off('login', callback)\n authSession.events.off('logout', callback)\n authSession.events.off('sessionRestore', callback)\n }\n }\n }\n}\n"],"mappings":";;;;;;;;AASA,IAAa,IAAqB;AAElC,SAAS,EAAkB,GAAmC;CAC5D,IAAM,IAAQ,EAAoB,OAC5B,IAAK,EAAM,IAAI,CAAK,GACpB,IACJ,EAAM,IAAI,GAAI,EAAG,KAAK,QAAQ,CAAC,KAC/B,EAAM,IAAI,GAAI,EAAG,KAAK,KAAK,CAAC,KAC5B,EAAM,IAAI,GAAI,EAAG,MAAM,MAAM,CAAC,KAC9B,EAAM,IAAI,GAAI,EAAG,MAAM,UAAU,CAAC,KAClC,EAAM,IAAI,GAAI,EAAG,MAAM,OAAO,CAAC,KAC/B,EAAM,IAAI,GAAI,EAAG,KAAK,WAAW,CAAC;CAEpC,OAAO,IAAS,EAAc,QAAQ,KAAA;AACxC;AAEA,IAAqB,IAArB,MAAsD;CAChC;CAApB,YAAa,IAA2B,GAAoB;EAAxC,KAAA,YAAA;CAAyC;CAE7D,IAAI,UAA2B;EAC7B,IAAM,IAA4B,EAAY,SAAS,EAAY,MAAM;EAQzE,OANI,EADsB,EAAY,YAAY,EAAY,MAAM,cAAc,EAAQ,MACzE,CAAC,IACT,OAKF,IAAI,EAAQ,GAFD,EAAiB,CAET,CAAS;CACrC;CAEA,MAAM,MAAO,GAAmB;EAC9B,IAAI,CAAC,GAAU;GACb,EAAW,CAAI,+CAA+C;GAE9D;EACF;EAGC,EAAqB,MAAM,QAAgB,0BAA0B;EAEtE,IAAM,IAAuB,IAAI,IAAI,OAAO,SAAS,IAAI,EAAE;EAI3D,AAHI,KACF,OAAO,aAAa,QAAQ,wBAAwB,CAAoB,GAE1E,OAAO,aAAa,QAAQ,eAAe,CAAQ;EAEnD,IAAM,IAAc,IAAI,IAAI,OAAO,SAAS,IAAI;EAIhD,AAFA,EAAY,OAAO,IAEnB,MAAM,EAAY,MAAM,GAAU,EAAY,IAAI;CACpD;CAEA,MAAM,SAAU;EACd,OAAO,KAAK,KAAK,WAAW,UAAU,qBAAqB;CAC7D;CAEA,MAAM,SAAU;EACd,MAAM,EAAY,OAAO;CAC3B;CAEA,iBAAkB,GAAyB;EACzC,IAAM,IAAqB,GACrB,UAAiB;GACrB,EAAS;EACX;EASA,OARI,OAAO,EAAmB,oBAAqB,aACjD,EAAmB,iBAAiB,sBAAsB,CAAQ,KAElE,EAAY,OAAO,GAAG,SAAS,CAAQ,GACvC,EAAY,OAAO,GAAG,UAAU,CAAQ,GACxC,EAAY,OAAO,GAAG,kBAAkB,CAAQ,UAGrC;GACX,AAAI,OAAO,EAAmB,uBAAwB,aACpD,EAAmB,oBAAoB,sBAAsB,CAAQ,KAErE,EAAY,OAAO,IAAI,SAAS,CAAQ,GACxC,EAAY,OAAO,IAAI,UAAU,CAAQ,GACzC,EAAY,OAAO,IAAI,kBAAkB,CAAQ;EAErD;CACF;AACF"}
1
+ {"version":3,"file":"SolidAuth.esm.js","names":[],"sources":["../../../src/lib/auth/SolidAuth.ts"],"sourcesContent":["import { authSession, solidLogicSingleton } from 'solid-logic'\nimport Account from '@/lib/auth/Account'\nimport { AuthContext } from '@/lib/auth'\nimport { showDialog } from '@/lib/dialogs'\nimport { html } from 'lit'\nimport ns from '@/lib/ns'\n\nimport '@/components/login-modal'\n\nexport const DEFAULT_SIGNUP_URL = 'https://solidproject.org/get_a_pod'\n\nfunction findAccountImage (webId: string): string | undefined {\n const store = solidLogicSingleton.store\n const me = store.sym(webId)\n const image =\n store.any(me, ns.sioc('avatar')) ||\n store.any(me, ns.foaf('img')) ||\n store.any(me, ns.vcard('logo')) ||\n store.any(me, ns.vcard('hasPhoto')) ||\n store.any(me, ns.vcard('photo')) ||\n store.any(me, ns.foaf('depiction'))\n\n return image ? (image as any).value : undefined\n}\n\nexport default class SolidAuth implements AuthContext {\n constructor (public signupUrl: string = DEFAULT_SIGNUP_URL) {}\n\n get account (): Account | null {\n const webId: string | undefined = authSession.webId ?? authSession.info?.webId\n const isActive: boolean = authSession.isActive ?? authSession.info?.isLoggedIn ?? Boolean(webId)\n if (!isActive || !webId) {\n return null\n }\n\n const avatarUrl = findAccountImage(webId)\n\n return new Account(webId, avatarUrl)\n }\n\n async login (loginUrl?: string) {\n if (!loginUrl) {\n showDialog(html`<solid-ui-login-modal></solid-ui-login-modal>`)\n\n return\n }\n\n // clear authorization metadata from store\n ;(solidLogicSingleton.store.updater as any).flagAuthorizationMetadata()\n\n const preLoginRedirectHash = new URL(window.location.href).hash\n if (preLoginRedirectHash) {\n window.localStorage.setItem('preLoginRedirectHash', preLoginRedirectHash)\n }\n window.localStorage.setItem('loginIssuer', loginUrl)\n\n const locationUrl = new URL(window.location.href)\n\n locationUrl.hash = ''\n\n await authSession.login(loginUrl, locationUrl.href)\n }\n\n async signup () {\n window.open(this.signupUrl, '_blank', 'noopener,noreferrer')\n }\n\n async logout () {\n await authSession.logout()\n }\n\n onSessionUpdated (callback: () => unknown) {\n const sessionEventTarget = authSession as unknown as EventTarget\n const listener = () => {\n callback()\n }\n if (typeof sessionEventTarget.addEventListener === 'function') {\n sessionEventTarget.addEventListener('sessionStateChange', listener)\n } else {\n authSession.events.on('login', callback)\n authSession.events.on('logout', callback)\n authSession.events.on('sessionRestore', callback)\n }\n\n return () => {\n if (typeof sessionEventTarget.removeEventListener === 'function') {\n sessionEventTarget.removeEventListener('sessionStateChange', listener)\n } else {\n authSession.events.off('login', callback)\n authSession.events.off('logout', callback)\n authSession.events.off('sessionRestore', callback)\n }\n }\n }\n}\n"],"mappings":";;;;;;;;AASA,IAAa,IAAqB;AAElC,SAAS,EAAkB,GAAmC;CAC5D,IAAM,IAAQ,EAAoB,OAC5B,IAAK,EAAM,IAAI,CAAK,GACpB,IACJ,EAAM,IAAI,GAAI,EAAG,KAAK,QAAQ,CAAC,KAC/B,EAAM,IAAI,GAAI,EAAG,KAAK,KAAK,CAAC,KAC5B,EAAM,IAAI,GAAI,EAAG,MAAM,MAAM,CAAC,KAC9B,EAAM,IAAI,GAAI,EAAG,MAAM,UAAU,CAAC,KAClC,EAAM,IAAI,GAAI,EAAG,MAAM,OAAO,CAAC,KAC/B,EAAM,IAAI,GAAI,EAAG,KAAK,WAAW,CAAC;CAEpC,OAAO,IAAS,EAAc,QAAQ,KAAA;AACxC;AAEA,IAAqB,IAArB,MAAsD;CAChC;CAApB,YAAa,IAA2B,GAAoB;EAAxC,KAAA,YAAA;CAAyC;CAE7D,IAAI,UAA2B;EAC7B,IAAM,IAA4B,EAAY,SAAS,EAAY,MAAM;EAQzE,OANI,EADsB,EAAY,YAAY,EAAY,MAAM,cAAc,EAAQ,MACzE,CAAC,IACT,OAKF,IAAI,EAAQ,GAFD,EAAiB,CAET,CAAS;CACrC;CAEA,MAAM,MAAO,GAAmB;EAC9B,IAAI,CAAC,GAAU;GACb,EAAW,CAAI,+CAA+C;GAE9D;EACF;EAGC,EAAqB,MAAM,QAAgB,0BAA0B;EAEtE,IAAM,IAAuB,IAAI,IAAI,OAAO,SAAS,IAAI,CAAC,CAAC;EAI3D,AAHI,KACF,OAAO,aAAa,QAAQ,wBAAwB,CAAoB,GAE1E,OAAO,aAAa,QAAQ,eAAe,CAAQ;EAEnD,IAAM,IAAc,IAAI,IAAI,OAAO,SAAS,IAAI;EAIhD,AAFA,EAAY,OAAO,IAEnB,MAAM,EAAY,MAAM,GAAU,EAAY,IAAI;CACpD;CAEA,MAAM,SAAU;EACd,OAAO,KAAK,KAAK,WAAW,UAAU,qBAAqB;CAC7D;CAEA,MAAM,SAAU;EACd,MAAM,EAAY,OAAO;CAC3B;CAEA,iBAAkB,GAAyB;EACzC,IAAM,IAAqB,GACrB,UAAiB;GACrB,EAAS;EACX;EASA,OARI,OAAO,EAAmB,oBAAqB,aACjD,EAAmB,iBAAiB,sBAAsB,CAAQ,KAElE,EAAY,OAAO,GAAG,SAAS,CAAQ,GACvC,EAAY,OAAO,GAAG,UAAU,CAAQ,GACxC,EAAY,OAAO,GAAG,kBAAkB,CAAQ,UAGrC;GACX,AAAI,OAAO,EAAmB,uBAAwB,aACpD,EAAmB,oBAAoB,sBAAsB,CAAQ,KAErE,EAAY,OAAO,IAAI,SAAS,CAAQ,GACxC,EAAY,OAAO,IAAI,UAAU,CAAQ,GACzC,EAAY,OAAO,IAAI,kBAAkB,CAAQ;EAErD;CACF;AACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"context.cjs.js","names":[],"sources":["../../../src/lib/auth/context.ts"],"sourcesContent":["import { createContext } from '@lit/context'\nimport NoopAuth from './NoopAuth'\nimport Account from './Account'\n\nexport interface AuthContext {\n account: Account | null;\n login(loginUrl?: string): Promise<void>;\n signup(): Promise<void>;\n logout(): Promise<void>;\n onSessionUpdated(callback: () => unknown): () => void;\n}\n\nexport const DEFAULT_AUTH_CONTEXT = new NoopAuth()\nexport const authContext = createContext<AuthContext>(Symbol('auth'))\n"],"mappings":"mEAYA,IAAa,EAAuB,IAAI,EAAA,QAC3B,GAAA,EAAA,EAAA,eAAyC,OAAO,MAAM,CAAC"}
1
+ {"version":3,"file":"context.cjs.js","names":[],"sources":["../../../src/lib/auth/context.ts"],"sourcesContent":["import { createContext } from '@lit/context'\nimport NoopAuth from './NoopAuth'\nimport Account from './Account'\n\nexport interface AuthContext {\n account: Account | null;\n login(loginUrl?: string): Promise<void>;\n signup(): Promise<void>;\n logout(): Promise<void>;\n onSessionUpdated(callback: () => unknown): () => void;\n}\n\nexport const DEFAULT_AUTH_CONTEXT = new NoopAuth()\nexport const authContext = createContext<AuthContext>(Symbol('auth'))\n"],"mappings":"mEAYA,IAAa,EAAuB,IAAI,EAAA,QAC3B,GAAA,EAAA,EAAA,cAAA,CAAyC,OAAO,MAAM,CAAC"}
@@ -1 +1 @@
1
- require("./Account.cjs.js"),require("./NoopAuth.cjs.js"),require("./context.cjs.js"),require("./SolidAuth.cjs.js");
1
+ const e=require("./Account.cjs.js"),t=require("./NoopAuth.cjs.js"),n=require("./context.cjs.js"),r=require("./SolidAuth.cjs.js");exports.Account=e.default,exports.DEFAULT_AUTH_CONTEXT=n.DEFAULT_AUTH_CONTEXT,exports.DEFAULT_SIGNUP_URL=r.DEFAULT_SIGNUP_URL,exports.NoopAuth=t.default,exports.SolidAuth=r.default,exports.authContext=n.authContext;
@@ -1,4 +1,5 @@
1
- import "./Account.esm.js";
2
- import "./NoopAuth.esm.js";
3
- import "./context.esm.js";
4
- import "./SolidAuth.esm.js";
1
+ import e from "./Account.esm.js";
2
+ import t from "./NoopAuth.esm.js";
3
+ import { DEFAULT_AUTH_CONTEXT as n, authContext as r } from "./context.esm.js";
4
+ import i, { DEFAULT_SIGNUP_URL as a } from "./SolidAuth.esm.js";
5
+ export { e as Account, n as DEFAULT_AUTH_CONTEXT, a as DEFAULT_SIGNUP_URL, t as NoopAuth, i as SolidAuth, r as authContext };
@@ -1 +1 @@
1
- {"version":3,"file":"ids.cjs.js","names":[],"sources":["../../../src/lib/components/ids.ts"],"sourcesContent":["export function generateId () {\n return Math.random().toString(36).substring(2, 15)\n}\n"],"mappings":"AAAA,SAAgB,GAAc,CAC5B,OAAO,KAAK,OAAO,EAAE,SAAS,EAAE,EAAE,UAAU,EAAG,EAAE,CACnD"}
1
+ {"version":3,"file":"ids.cjs.js","names":[],"sources":["../../../src/lib/components/ids.ts"],"sourcesContent":["export function generateId () {\n return Math.random().toString(36).substring(2, 15)\n}\n"],"mappings":"AAAA,SAAgB,GAAc,CAC5B,OAAO,KAAK,OAAO,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,UAAU,EAAG,EAAE,CACnD"}
@@ -1 +1 @@
1
- {"version":3,"file":"ids.esm.js","names":[],"sources":["../../../src/lib/components/ids.ts"],"sourcesContent":["export function generateId () {\n return Math.random().toString(36).substring(2, 15)\n}\n"],"mappings":";AAAA,SAAgB,IAAc;CAC5B,OAAO,KAAK,OAAO,EAAE,SAAS,EAAE,EAAE,UAAU,GAAG,EAAE;AACnD"}
1
+ {"version":3,"file":"ids.esm.js","names":[],"sources":["../../../src/lib/components/ids.ts"],"sourcesContent":["export function generateId () {\n return Math.random().toString(36).substring(2, 15)\n}\n"],"mappings":";AAAA,SAAgB,IAAc;CAC5B,OAAO,KAAK,OAAO,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,UAAU,GAAG,EAAE;AACnD"}
@@ -1 +1 @@
1
- require("./ids.cjs.js"),require("./decorators.cjs.js"),require("./web-component/WebComponent.cjs.js"),require("./web-component/index.cjs.js"),require("./traits/DialogTrait.cjs.js"),require("./traits/InputTrait.cjs.js"),require("./traits/index.cjs.js");
1
+ const e=require("./ids.cjs.js"),t=require("./decorators.cjs.js"),n=require("./web-component/WebComponent.cjs.js");require("./web-component/index.cjs.js");const r=require("./traits/DialogTrait.cjs.js"),i=require("./traits/InputTrait.cjs.js");require("./traits/index.cjs.js"),exports.DialogTrait=r.default,exports.InputTrait=i.default,exports.WebComponent=n.default,exports.customElement=t.customElement,exports.generateId=e.generateId;
@@ -1,7 +1,8 @@
1
- import "./ids.esm.js";
2
- import "./decorators.esm.js";
3
- import "./web-component/WebComponent.esm.js";
1
+ import { generateId as e } from "./ids.esm.js";
2
+ import { customElement as t } from "./decorators.esm.js";
3
+ import n from "./web-component/WebComponent.esm.js";
4
4
  import "./web-component/index.esm.js";
5
- import "./traits/DialogTrait.esm.js";
6
- import "./traits/InputTrait.esm.js";
5
+ import r from "./traits/DialogTrait.esm.js";
6
+ import i from "./traits/InputTrait.esm.js";
7
7
  import "./traits/index.esm.js";
8
+ export { r as DialogTrait, i as InputTrait, n as WebComponent, t as customElement, e as generateId };
@@ -1 +1 @@
1
- {"version":3,"file":"DialogTrait.cjs.js","names":[],"sources":["../../../../src/lib/components/traits/DialogTrait.ts"],"sourcesContent":["import { WebComponent } from '@/lib/components'\nimport { CloseDialogEvent } from '@/lib/dialogs/events/close-dialog'\nimport type { DialogContext } from '@/lib/dialogs/context'\n\nimport { WebComponentTrait } from './WebComponentTrait'\n\nexport interface DialogTraitConfig {\n getContext: () => DialogContext\n}\n\nexport default class DialogTrait<T> implements WebComponentTrait {\n public target: WebComponent\n private config: DialogTraitConfig\n\n constructor (target: WebComponent, config: DialogTraitConfig) {\n this.target = target\n this.config = config\n }\n\n close (data?: T) {\n window.dispatchEvent(new CloseDialogEvent(this.config.getContext().id, data))\n }\n}\n"],"mappings":"4DAUA,IAAqB,EAArB,KAAiE,CAC/D,OACA,OAEA,YAAa,EAAsB,EAA2B,CAC5D,KAAK,OAAS,EACd,KAAK,OAAS,CAChB,CAEA,MAAO,EAAU,CACf,OAAO,cAAc,IAAI,EAAA,iBAAiB,KAAK,OAAO,WAAW,EAAE,GAAI,CAAI,CAAC,CAC9E,CACF"}
1
+ {"version":3,"file":"DialogTrait.cjs.js","names":[],"sources":["../../../../src/lib/components/traits/DialogTrait.ts"],"sourcesContent":["import { WebComponent } from '@/lib/components'\nimport { CloseDialogEvent } from '@/lib/dialogs/events/close-dialog'\nimport type { DialogContext } from '@/lib/dialogs/context'\n\nimport { WebComponentTrait } from './WebComponentTrait'\n\nexport interface DialogTraitConfig {\n getContext: () => DialogContext\n}\n\nexport default class DialogTrait<T> implements WebComponentTrait {\n public target: WebComponent\n private config: DialogTraitConfig\n\n constructor (target: WebComponent, config: DialogTraitConfig) {\n this.target = target\n this.config = config\n }\n\n close (data?: T) {\n window.dispatchEvent(new CloseDialogEvent(this.config.getContext().id, data))\n }\n}\n"],"mappings":"4DAUA,IAAqB,EAArB,KAAiE,CAC/D,OACA,OAEA,YAAa,EAAsB,EAA2B,CAC5D,KAAK,OAAS,EACd,KAAK,OAAS,CAChB,CAEA,MAAO,EAAU,CACf,OAAO,cAAc,IAAI,EAAA,iBAAiB,KAAK,OAAO,WAAW,CAAC,CAAC,GAAI,CAAI,CAAC,CAC9E,CACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"DialogTrait.esm.js","names":[],"sources":["../../../../src/lib/components/traits/DialogTrait.ts"],"sourcesContent":["import { WebComponent } from '@/lib/components'\nimport { CloseDialogEvent } from '@/lib/dialogs/events/close-dialog'\nimport type { DialogContext } from '@/lib/dialogs/context'\n\nimport { WebComponentTrait } from './WebComponentTrait'\n\nexport interface DialogTraitConfig {\n getContext: () => DialogContext\n}\n\nexport default class DialogTrait<T> implements WebComponentTrait {\n public target: WebComponent\n private config: DialogTraitConfig\n\n constructor (target: WebComponent, config: DialogTraitConfig) {\n this.target = target\n this.config = config\n }\n\n close (data?: T) {\n window.dispatchEvent(new CloseDialogEvent(this.config.getContext().id, data))\n }\n}\n"],"mappings":";;AAUA,IAAqB,IAArB,MAAiE;CAC/D;CACA;CAEA,YAAa,GAAsB,GAA2B;EAE5D,AADA,KAAK,SAAS,GACd,KAAK,SAAS;CAChB;CAEA,MAAO,GAAU;EACf,OAAO,cAAc,IAAI,EAAiB,KAAK,OAAO,WAAW,EAAE,IAAI,CAAI,CAAC;CAC9E;AACF"}
1
+ {"version":3,"file":"DialogTrait.esm.js","names":[],"sources":["../../../../src/lib/components/traits/DialogTrait.ts"],"sourcesContent":["import { WebComponent } from '@/lib/components'\nimport { CloseDialogEvent } from '@/lib/dialogs/events/close-dialog'\nimport type { DialogContext } from '@/lib/dialogs/context'\n\nimport { WebComponentTrait } from './WebComponentTrait'\n\nexport interface DialogTraitConfig {\n getContext: () => DialogContext\n}\n\nexport default class DialogTrait<T> implements WebComponentTrait {\n public target: WebComponent\n private config: DialogTraitConfig\n\n constructor (target: WebComponent, config: DialogTraitConfig) {\n this.target = target\n this.config = config\n }\n\n close (data?: T) {\n window.dispatchEvent(new CloseDialogEvent(this.config.getContext().id, data))\n }\n}\n"],"mappings":";;AAUA,IAAqB,IAArB,MAAiE;CAC/D;CACA;CAEA,YAAa,GAAsB,GAA2B;EAE5D,AADA,KAAK,SAAS,GACd,KAAK,SAAS;CAChB;CAEA,MAAO,GAAU;EACf,OAAO,cAAc,IAAI,EAAiB,KAAK,OAAO,WAAW,CAAC,CAAC,IAAI,CAAI,CAAC;CAC9E;AACF"}
@@ -1,2 +1,2 @@
1
- const e=require("../ids.cjs.js");require("../index.cjs.js");let t=require("lit");var n=class{inputId;target;config;constructor(t,n){this.config=n,this.inputId=`input-${e.generateId()}`,this.target=t}firstUpdated(){this.config.getInternals().setFormValue(this.target.value),this.updateValidity()}updated(e){(e.has(`value`)||e.has(`required`))&&this.updateValidity()}formResetCallback(){this.target.value=``,this.config.getInternals().setFormValue(``),this.updateValidity(),this.config.onValueChanged?.(``)}renderLabel(){return this.target.label?t.html`<label for="${this.inputId}">${this.target.label}</label>`:t.nothing}onInput(){this.setValue(this.config.getInputElement()?.value??``)}onSubmit(){this.config.getInternals().form?.requestSubmit()}setValue(e){this.target.value=e,this.config.getInternals().setFormValue(this.target.value),this.target.dispatchEvent(new InputEvent(`input`,{bubbles:!0,composed:!0})),this.config.onValueChanged?.(this.target.value)}updateValidity(){let e=this.config.getInternals();this.target.required&&this.target.value===``?e.setValidity({valueMissing:!0},`Please fill out this field.`,this.config.getInputElement()??void 0):e.setValidity({})}};exports.default=n;
1
+ const e=require("../ids.cjs.js");require("../index.cjs.js");let t=require("lit");var n=class{inputId;labelId;target;config;constructor(t,n){this.config=n,this.inputId=`input-${e.generateId()}`,this.labelId=`label-${this.inputId}`,this.target=t}firstUpdated(){this.config.getInternals().setFormValue(this.target.value),this.updateValidity()}updated(e){(e.has(`value`)||e.has(`required`))&&this.updateValidity()}formResetCallback(){this.target.value=``,this.config.getInternals().setFormValue(``),this.updateValidity(),this.config.onValueChanged?.(``)}renderLabel(){return this.target.label?t.html`<label id="${this.labelId}" for="${this.inputId}">${this.target.label}</label>`:t.nothing}onInput(){this.setValue(this.config.getInputElement()?.value??``)}onSubmit(){this.config.getInternals().form?.requestSubmit()}setValue(e){this.target.value=e,this.config.getInternals().setFormValue(this.target.value),this.target.dispatchEvent(new InputEvent(`input`,{bubbles:!0,composed:!0})),this.config.onValueChanged?.(this.target.value)}updateValidity(){let e=this.config.getInternals();this.target.required&&this.target.value===``?e.setValidity({valueMissing:!0},`Please fill out this field.`,this.config.getInputElement()??void 0):e.setValidity({})}};exports.default=n;
2
2
  //# sourceMappingURL=InputTrait.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"InputTrait.cjs.js","names":[],"sources":["../../../../src/lib/components/traits/InputTrait.ts"],"sourcesContent":["import { WebComponent } from '@/lib/components'\nimport { html, nothing } from 'lit'\n\nimport { generateId } from '@/lib/components'\n\nimport type { WebComponentTrait } from './WebComponentTrait'\n\nexport type InputTraitTarget = WebComponent & {\n name: string;\n label: string;\n required: boolean;\n value: string;\n}\n\nexport interface InputTraitConfig {\n getInputElement(): HTMLInputElement | HTMLSelectElement | null\n getInternals(): ElementInternals\n onValueChanged?: (value: string) => void\n}\n\nexport default class InputTrait implements WebComponentTrait {\n public inputId: string\n public target: InputTraitTarget\n private config: InputTraitConfig\n\n constructor (target: InputTraitTarget, config: InputTraitConfig) {\n this.config = config\n this.inputId = `input-${generateId()}`\n this.target = target\n }\n\n firstUpdated () {\n this.config.getInternals().setFormValue(this.target.value)\n this.updateValidity()\n }\n\n updated (changedProperties: Map<PropertyKey, unknown>) {\n if (changedProperties.has('value') || changedProperties.has('required')) {\n this.updateValidity()\n }\n }\n\n formResetCallback () {\n this.target.value = ''\n this.config.getInternals().setFormValue('')\n this.updateValidity()\n this.config.onValueChanged?.('')\n }\n\n renderLabel () {\n return this.target.label\n ? html`<label for=\"${this.inputId}\">${this.target.label}</label>`\n : nothing\n }\n\n onInput () {\n this.setValue(this.config.getInputElement()?.value ?? '')\n }\n\n onSubmit () {\n this.config.getInternals().form?.requestSubmit()\n }\n\n setValue (value: string) {\n this.target.value = value\n\n this.config.getInternals().setFormValue(this.target.value)\n this.target.dispatchEvent(new InputEvent('input', { bubbles: true, composed: true }))\n this.config.onValueChanged?.(this.target.value)\n }\n\n private updateValidity () {\n const internals = this.config.getInternals()\n\n if (this.target.required && this.target.value === '') {\n internals.setValidity(\n { valueMissing: true },\n 'Please fill out this field.',\n this.config.getInputElement() ?? undefined\n )\n } else {\n internals.setValidity({})\n }\n }\n}\n"],"mappings":"iFAoBA,IAAqB,EAArB,KAA6D,CAC3D,QACA,OACA,OAEA,YAAa,EAA0B,EAA0B,CAC/D,KAAK,OAAS,EACd,KAAK,QAAU,SAAS,EAAA,WAAW,IACnC,KAAK,OAAS,CAChB,CAEA,cAAgB,CACd,KAAK,OAAO,aAAa,EAAE,aAAa,KAAK,OAAO,KAAK,EACzD,KAAK,eAAe,CACtB,CAEA,QAAS,EAA8C,EACjD,EAAkB,IAAI,OAAO,GAAK,EAAkB,IAAI,UAAU,IACpE,KAAK,eAAe,CAExB,CAEA,mBAAqB,CACnB,KAAK,OAAO,MAAQ,GACpB,KAAK,OAAO,aAAa,EAAE,aAAa,EAAE,EAC1C,KAAK,eAAe,EACpB,KAAK,OAAO,iBAAiB,EAAE,CACjC,CAEA,aAAe,CACb,OAAO,KAAK,OAAO,MACf,EAAA,IAAI,eAAe,KAAK,QAAQ,IAAI,KAAK,OAAO,MAAM,UACtD,EAAA,OACN,CAEA,SAAW,CACT,KAAK,SAAS,KAAK,OAAO,gBAAgB,GAAG,OAAS,EAAE,CAC1D,CAEA,UAAY,CACV,KAAK,OAAO,aAAa,EAAE,MAAM,cAAc,CACjD,CAEA,SAAU,EAAe,CACvB,KAAK,OAAO,MAAQ,EAEpB,KAAK,OAAO,aAAa,EAAE,aAAa,KAAK,OAAO,KAAK,EACzD,KAAK,OAAO,cAAc,IAAI,WAAW,QAAS,CAAE,QAAS,GAAM,SAAU,EAAK,CAAC,CAAC,EACpF,KAAK,OAAO,iBAAiB,KAAK,OAAO,KAAK,CAChD,CAEA,gBAA0B,CACxB,IAAM,EAAY,KAAK,OAAO,aAAa,EAEvC,KAAK,OAAO,UAAY,KAAK,OAAO,QAAU,GAChD,EAAU,YACR,CAAE,aAAc,EAAK,EACrB,8BACA,KAAK,OAAO,gBAAgB,GAAK,IAAA,EACnC,EAEA,EAAU,YAAY,CAAC,CAAC,CAE5B,CACF"}
1
+ {"version":3,"file":"InputTrait.cjs.js","names":[],"sources":["../../../../src/lib/components/traits/InputTrait.ts"],"sourcesContent":["import { WebComponent } from '@/lib/components'\nimport { html, nothing } from 'lit'\n\nimport { generateId } from '@/lib/components'\n\nimport type { WebComponentTrait } from './WebComponentTrait'\n\nexport type InputTraitTarget = WebComponent & {\n name: string;\n label: string;\n required: boolean;\n value: string;\n}\n\nexport interface InputTraitConfig {\n getInputElement(): HTMLInputElement | HTMLSelectElement | null\n getInternals(): ElementInternals\n onValueChanged?: (value: string) => void\n}\n\nexport default class InputTrait implements WebComponentTrait {\n public inputId: string\n public labelId: string\n public target: InputTraitTarget\n private config: InputTraitConfig\n\n constructor (target: InputTraitTarget, config: InputTraitConfig) {\n this.config = config\n this.inputId = `input-${generateId()}`\n this.labelId = `label-${this.inputId}`\n this.target = target\n }\n\n firstUpdated () {\n this.config.getInternals().setFormValue(this.target.value)\n this.updateValidity()\n }\n\n updated (changedProperties: Map<PropertyKey, unknown>) {\n if (changedProperties.has('value') || changedProperties.has('required')) {\n this.updateValidity()\n }\n }\n\n formResetCallback () {\n this.target.value = ''\n this.config.getInternals().setFormValue('')\n this.updateValidity()\n this.config.onValueChanged?.('')\n }\n\n renderLabel () {\n return this.target.label\n ? html`<label id=\"${this.labelId}\" for=\"${this.inputId}\">${this.target.label}</label>`\n : nothing\n }\n\n onInput () {\n this.setValue(this.config.getInputElement()?.value ?? '')\n }\n\n onSubmit () {\n this.config.getInternals().form?.requestSubmit()\n }\n\n setValue (value: string) {\n this.target.value = value\n\n this.config.getInternals().setFormValue(this.target.value)\n this.target.dispatchEvent(new InputEvent('input', { bubbles: true, composed: true }))\n this.config.onValueChanged?.(this.target.value)\n }\n\n private updateValidity () {\n const internals = this.config.getInternals()\n\n if (this.target.required && this.target.value === '') {\n internals.setValidity(\n { valueMissing: true },\n 'Please fill out this field.',\n this.config.getInputElement() ?? undefined\n )\n } else {\n internals.setValidity({})\n }\n }\n}\n"],"mappings":"iFAoBA,IAAqB,EAArB,KAA6D,CAC3D,QACA,QACA,OACA,OAEA,YAAa,EAA0B,EAA0B,CAC/D,KAAK,OAAS,EACd,KAAK,QAAU,SAAS,EAAA,WAAW,IACnC,KAAK,QAAU,SAAS,KAAK,UAC7B,KAAK,OAAS,CAChB,CAEA,cAAgB,CACd,KAAK,OAAO,aAAa,CAAC,CAAC,aAAa,KAAK,OAAO,KAAK,EACzD,KAAK,eAAe,CACtB,CAEA,QAAS,EAA8C,EACjD,EAAkB,IAAI,OAAO,GAAK,EAAkB,IAAI,UAAU,IACpE,KAAK,eAAe,CAExB,CAEA,mBAAqB,CACnB,KAAK,OAAO,MAAQ,GACpB,KAAK,OAAO,aAAa,CAAC,CAAC,aAAa,EAAE,EAC1C,KAAK,eAAe,EACpB,KAAK,OAAO,iBAAiB,EAAE,CACjC,CAEA,aAAe,CACb,OAAO,KAAK,OAAO,MACf,EAAA,IAAI,cAAc,KAAK,QAAQ,SAAS,KAAK,QAAQ,IAAI,KAAK,OAAO,MAAM,UAC3E,EAAA,OACN,CAEA,SAAW,CACT,KAAK,SAAS,KAAK,OAAO,gBAAgB,CAAC,EAAE,OAAS,EAAE,CAC1D,CAEA,UAAY,CACV,KAAK,OAAO,aAAa,CAAC,CAAC,MAAM,cAAc,CACjD,CAEA,SAAU,EAAe,CACvB,KAAK,OAAO,MAAQ,EAEpB,KAAK,OAAO,aAAa,CAAC,CAAC,aAAa,KAAK,OAAO,KAAK,EACzD,KAAK,OAAO,cAAc,IAAI,WAAW,QAAS,CAAE,QAAS,GAAM,SAAU,EAAK,CAAC,CAAC,EACpF,KAAK,OAAO,iBAAiB,KAAK,OAAO,KAAK,CAChD,CAEA,gBAA0B,CACxB,IAAM,EAAY,KAAK,OAAO,aAAa,EAEvC,KAAK,OAAO,UAAY,KAAK,OAAO,QAAU,GAChD,EAAU,YACR,CAAE,aAAc,EAAK,EACrB,8BACA,KAAK,OAAO,gBAAgB,GAAK,IAAA,EACnC,EAEA,EAAU,YAAY,CAAC,CAAC,CAE5B,CACF"}
@@ -14,6 +14,7 @@ export interface InputTraitConfig {
14
14
  }
15
15
  export default class InputTrait implements WebComponentTrait {
16
16
  inputId: string;
17
+ labelId: string;
17
18
  target: InputTraitTarget;
18
19
  private config;
19
20
  constructor(target: InputTraitTarget, config: InputTraitConfig);
@@ -1 +1 @@
1
- {"version":3,"file":"InputTrait.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/traits/InputTrait.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAC/C,OAAO,EAAQ,OAAO,EAAE,MAAM,KAAK,CAAA;AAInC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAE5D,MAAM,MAAM,gBAAgB,GAAG,YAAY,GAAG;IAC5C,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;CACf,CAAA;AAED,MAAM,WAAW,gBAAgB;IAC/B,eAAe,IAAI,gBAAgB,GAAG,iBAAiB,GAAG,IAAI,CAAA;IAC9D,YAAY,IAAI,gBAAgB,CAAA;IAChC,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAA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EAAE,MAAM,EAAE,gBAAgB;IAO/D,YAAY;IAKZ,OAAO,CAAE,iBAAiB,EAAE,GAAG,CAAC,WAAW,EAAE,OAAO,CAAC;IAMrD,iBAAiB;IAOjB,WAAW;IAMX,OAAO;IAIP,QAAQ;IAIR,QAAQ,CAAE,KAAK,EAAE,MAAM;IAQvB,OAAO,CAAC,cAAc;CAavB"}
@@ -4,10 +4,11 @@ import { html as t, nothing as n } from "lit";
4
4
  //#region src/lib/components/traits/InputTrait.ts
5
5
  var r = class {
6
6
  inputId;
7
+ labelId;
7
8
  target;
8
9
  config;
9
10
  constructor(t, n) {
10
- this.config = n, this.inputId = `input-${e()}`, this.target = t;
11
+ this.config = n, this.inputId = `input-${e()}`, this.labelId = `label-${this.inputId}`, this.target = t;
11
12
  }
12
13
  firstUpdated() {
13
14
  this.config.getInternals().setFormValue(this.target.value), this.updateValidity();
@@ -19,7 +20,7 @@ var r = class {
19
20
  this.target.value = "", this.config.getInternals().setFormValue(""), this.updateValidity(), this.config.onValueChanged?.("");
20
21
  }
21
22
  renderLabel() {
22
- return this.target.label ? t`<label for="${this.inputId}">${this.target.label}</label>` : n;
23
+ return this.target.label ? t`<label id="${this.labelId}" for="${this.inputId}">${this.target.label}</label>` : n;
23
24
  }
24
25
  onInput() {
25
26
  this.setValue(this.config.getInputElement()?.value ?? "");
@@ -1 +1 @@
1
- {"version":3,"file":"InputTrait.esm.js","names":[],"sources":["../../../../src/lib/components/traits/InputTrait.ts"],"sourcesContent":["import { WebComponent } from '@/lib/components'\nimport { html, nothing } from 'lit'\n\nimport { generateId } from '@/lib/components'\n\nimport type { WebComponentTrait } from './WebComponentTrait'\n\nexport type InputTraitTarget = WebComponent & {\n name: string;\n label: string;\n required: boolean;\n value: string;\n}\n\nexport interface InputTraitConfig {\n getInputElement(): HTMLInputElement | HTMLSelectElement | null\n getInternals(): ElementInternals\n onValueChanged?: (value: string) => void\n}\n\nexport default class InputTrait implements WebComponentTrait {\n public inputId: string\n public target: InputTraitTarget\n private config: InputTraitConfig\n\n constructor (target: InputTraitTarget, config: InputTraitConfig) {\n this.config = config\n this.inputId = `input-${generateId()}`\n this.target = target\n }\n\n firstUpdated () {\n this.config.getInternals().setFormValue(this.target.value)\n this.updateValidity()\n }\n\n updated (changedProperties: Map<PropertyKey, unknown>) {\n if (changedProperties.has('value') || changedProperties.has('required')) {\n this.updateValidity()\n }\n }\n\n formResetCallback () {\n this.target.value = ''\n this.config.getInternals().setFormValue('')\n this.updateValidity()\n this.config.onValueChanged?.('')\n }\n\n renderLabel () {\n return this.target.label\n ? html`<label for=\"${this.inputId}\">${this.target.label}</label>`\n : nothing\n }\n\n onInput () {\n this.setValue(this.config.getInputElement()?.value ?? '')\n }\n\n onSubmit () {\n this.config.getInternals().form?.requestSubmit()\n }\n\n setValue (value: string) {\n this.target.value = value\n\n this.config.getInternals().setFormValue(this.target.value)\n this.target.dispatchEvent(new InputEvent('input', { bubbles: true, composed: true }))\n this.config.onValueChanged?.(this.target.value)\n }\n\n private updateValidity () {\n const internals = this.config.getInternals()\n\n if (this.target.required && this.target.value === '') {\n internals.setValidity(\n { valueMissing: true },\n 'Please fill out this field.',\n this.config.getInputElement() ?? undefined\n )\n } else {\n internals.setValidity({})\n }\n }\n}\n"],"mappings":";;;;AAoBA,IAAqB,IAArB,MAA6D;CAC3D;CACA;CACA;CAEA,YAAa,GAA0B,GAA0B;EAG/D,AAFA,KAAK,SAAS,GACd,KAAK,UAAU,SAAS,EAAW,KACnC,KAAK,SAAS;CAChB;CAEA,eAAgB;EAEd,AADA,KAAK,OAAO,aAAa,EAAE,aAAa,KAAK,OAAO,KAAK,GACzD,KAAK,eAAe;CACtB;CAEA,QAAS,GAA8C;EACrD,CAAI,EAAkB,IAAI,OAAO,KAAK,EAAkB,IAAI,UAAU,MACpE,KAAK,eAAe;CAExB;CAEA,oBAAqB;EAInB,AAHA,KAAK,OAAO,QAAQ,IACpB,KAAK,OAAO,aAAa,EAAE,aAAa,EAAE,GAC1C,KAAK,eAAe,GACpB,KAAK,OAAO,iBAAiB,EAAE;CACjC;CAEA,cAAe;EACb,OAAO,KAAK,OAAO,QACf,CAAI,eAAe,KAAK,QAAQ,IAAI,KAAK,OAAO,MAAM,YACtD;CACN;CAEA,UAAW;EACT,KAAK,SAAS,KAAK,OAAO,gBAAgB,GAAG,SAAS,EAAE;CAC1D;CAEA,WAAY;EACV,KAAK,OAAO,aAAa,EAAE,MAAM,cAAc;CACjD;CAEA,SAAU,GAAe;EAKvB,AAJA,KAAK,OAAO,QAAQ,GAEpB,KAAK,OAAO,aAAa,EAAE,aAAa,KAAK,OAAO,KAAK,GACzD,KAAK,OAAO,cAAc,IAAI,WAAW,SAAS;GAAE,SAAS;GAAM,UAAU;EAAK,CAAC,CAAC,GACpF,KAAK,OAAO,iBAAiB,KAAK,OAAO,KAAK;CAChD;CAEA,iBAA0B;EACxB,IAAM,IAAY,KAAK,OAAO,aAAa;EAE3C,AAAI,KAAK,OAAO,YAAY,KAAK,OAAO,UAAU,KAChD,EAAU,YACR,EAAE,cAAc,GAAK,GACrB,+BACA,KAAK,OAAO,gBAAgB,KAAK,KAAA,CACnC,IAEA,EAAU,YAAY,CAAC,CAAC;CAE5B;AACF"}
1
+ {"version":3,"file":"InputTrait.esm.js","names":[],"sources":["../../../../src/lib/components/traits/InputTrait.ts"],"sourcesContent":["import { WebComponent } from '@/lib/components'\nimport { html, nothing } from 'lit'\n\nimport { generateId } from '@/lib/components'\n\nimport type { WebComponentTrait } from './WebComponentTrait'\n\nexport type InputTraitTarget = WebComponent & {\n name: string;\n label: string;\n required: boolean;\n value: string;\n}\n\nexport interface InputTraitConfig {\n getInputElement(): HTMLInputElement | HTMLSelectElement | null\n getInternals(): ElementInternals\n onValueChanged?: (value: string) => void\n}\n\nexport default class InputTrait implements WebComponentTrait {\n public inputId: string\n public labelId: string\n public target: InputTraitTarget\n private config: InputTraitConfig\n\n constructor (target: InputTraitTarget, config: InputTraitConfig) {\n this.config = config\n this.inputId = `input-${generateId()}`\n this.labelId = `label-${this.inputId}`\n this.target = target\n }\n\n firstUpdated () {\n this.config.getInternals().setFormValue(this.target.value)\n this.updateValidity()\n }\n\n updated (changedProperties: Map<PropertyKey, unknown>) {\n if (changedProperties.has('value') || changedProperties.has('required')) {\n this.updateValidity()\n }\n }\n\n formResetCallback () {\n this.target.value = ''\n this.config.getInternals().setFormValue('')\n this.updateValidity()\n this.config.onValueChanged?.('')\n }\n\n renderLabel () {\n return this.target.label\n ? html`<label id=\"${this.labelId}\" for=\"${this.inputId}\">${this.target.label}</label>`\n : nothing\n }\n\n onInput () {\n this.setValue(this.config.getInputElement()?.value ?? '')\n }\n\n onSubmit () {\n this.config.getInternals().form?.requestSubmit()\n }\n\n setValue (value: string) {\n this.target.value = value\n\n this.config.getInternals().setFormValue(this.target.value)\n this.target.dispatchEvent(new InputEvent('input', { bubbles: true, composed: true }))\n this.config.onValueChanged?.(this.target.value)\n }\n\n private updateValidity () {\n const internals = this.config.getInternals()\n\n if (this.target.required && this.target.value === '') {\n internals.setValidity(\n { valueMissing: true },\n 'Please fill out this field.',\n this.config.getInputElement() ?? undefined\n )\n } else {\n internals.setValidity({})\n }\n }\n}\n"],"mappings":";;;;AAoBA,IAAqB,IAArB,MAA6D;CAC3D;CACA;CACA;CACA;CAEA,YAAa,GAA0B,GAA0B;EAI/D,AAHA,KAAK,SAAS,GACd,KAAK,UAAU,SAAS,EAAW,KACnC,KAAK,UAAU,SAAS,KAAK,WAC7B,KAAK,SAAS;CAChB;CAEA,eAAgB;EAEd,AADA,KAAK,OAAO,aAAa,CAAC,CAAC,aAAa,KAAK,OAAO,KAAK,GACzD,KAAK,eAAe;CACtB;CAEA,QAAS,GAA8C;EACrD,CAAI,EAAkB,IAAI,OAAO,KAAK,EAAkB,IAAI,UAAU,MACpE,KAAK,eAAe;CAExB;CAEA,oBAAqB;EAInB,AAHA,KAAK,OAAO,QAAQ,IACpB,KAAK,OAAO,aAAa,CAAC,CAAC,aAAa,EAAE,GAC1C,KAAK,eAAe,GACpB,KAAK,OAAO,iBAAiB,EAAE;CACjC;CAEA,cAAe;EACb,OAAO,KAAK,OAAO,QACf,CAAI,cAAc,KAAK,QAAQ,SAAS,KAAK,QAAQ,IAAI,KAAK,OAAO,MAAM,YAC3E;CACN;CAEA,UAAW;EACT,KAAK,SAAS,KAAK,OAAO,gBAAgB,CAAC,EAAE,SAAS,EAAE;CAC1D;CAEA,WAAY;EACV,KAAK,OAAO,aAAa,CAAC,CAAC,MAAM,cAAc;CACjD;CAEA,SAAU,GAAe;EAKvB,AAJA,KAAK,OAAO,QAAQ,GAEpB,KAAK,OAAO,aAAa,CAAC,CAAC,aAAa,KAAK,OAAO,KAAK,GACzD,KAAK,OAAO,cAAc,IAAI,WAAW,SAAS;GAAE,SAAS;GAAM,UAAU;EAAK,CAAC,CAAC,GACpF,KAAK,OAAO,iBAAiB,KAAK,OAAO,KAAK;CAChD;CAEA,iBAA0B;EACxB,IAAM,IAAY,KAAK,OAAO,aAAa;EAE3C,AAAI,KAAK,OAAO,YAAY,KAAK,OAAO,UAAU,KAChD,EAAU,YACR,EAAE,cAAc,GAAK,GACrB,+BACA,KAAK,OAAO,gBAAgB,KAAK,KAAA,CACnC,IAEA,EAAU,YAAY,CAAC,CAAC;CAE5B;AACF"}
@@ -1 +1 @@
1
- require("./DialogTrait.cjs.js"),require("./InputTrait.cjs.js");
1
+ const e=require("./DialogTrait.cjs.js"),t=require("./InputTrait.cjs.js");exports.DialogTrait=e.default,exports.InputTrait=t.default;
@@ -1,2 +1,3 @@
1
- import "./DialogTrait.esm.js";
2
- import "./InputTrait.esm.js";
1
+ import e from "./DialogTrait.esm.js";
2
+ import t from "./InputTrait.esm.js";
3
+ export { e as DialogTrait, t as InputTrait };
@@ -1,2 +1,2 @@
1
- const e=require("./WebComponent.styles.cjs.js");let t=require("lit");var n=class extends t.LitElement{static states;static finalizeStyles(t){return[e.default,...super.finalizeStyles(t)]}internals;globalListeners=[];traits=[];disconnectedCallback(){super.disconnectedCallback();for(let[e,t]of this.globalListeners)window.removeEventListener(e,t);this.globalListeners=[]}addTrait(e){return this.traits.push(e),e}firstUpdated(){this.forwardMethodCall(`firstUpdated`)}updated(e){this.forwardMethodCall(`updated`,e)}formResetCallback(){this.forwardMethodCall(`formResetCallback`)}willUpdate(e){super.willUpdate(e);let t=this.static().states;if(!t)return;let n=this.getInternals();for(let[e,r]of Object.entries(t)){let t=r(this);t&&!n.states.has(e)?n.states.add(e):!t&&n.states.has(e)&&n.states.delete(e)}}addGlobalEventListener(e,t){this.globalListeners.push([e,t]),window.addEventListener(e,t)}render(){return t.html`<slot></slot>`}getInternals(){return this.internals??=this.attachInternals(),this.internals}static(){return this.constructor}forwardMethodCall(e,...t){for(let n of this.traits)n[e]?.(...t)}};exports.default=n;
1
+ const e=require("./WebComponent.styles.cjs.js");let t=require("lit");var n=class extends t.LitElement{static states;static finalizeStyles(t){return[e.default,...super.finalizeStyles(t)]}internals;globalListeners=[];traits=[];disconnectedCallback(){super.disconnectedCallback();for(let[e,t]of this.globalListeners)window.removeEventListener(e,t);this.globalListeners=[]}addTrait(e){return this.traits.push(e),e}firstUpdated(){this.forwardMethodCall(`firstUpdated`)}updated(e){this.forwardMethodCall(`updated`,e)}formResetCallback(){this.forwardMethodCall(`formResetCallback`)}willUpdate(e){super.willUpdate(e);let t=this.static().states;if(t)for(let[e,n]of Object.entries(t))this.toggleAttribute(`data-state-${e}`,!!n(this))}addGlobalEventListener(e,t){this.globalListeners.push([e,t]),window.addEventListener(e,t)}render(){return t.html`<slot></slot>`}getInternals(){return this.internals??=this.attachInternals(),this.internals}static(){return this.constructor}forwardMethodCall(e,...t){for(let n of this.traits)n[e]?.(...t)}};exports.default=n;
2
2
  //# sourceMappingURL=WebComponent.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"WebComponent.cjs.js","names":[],"sources":["../../../../src/lib/components/web-component/WebComponent.ts"],"sourcesContent":["import { html, LitElement, type CSSResultGroup } from 'lit'\nimport type { WebComponentTrait, WebComponentTraitMethodKey } from '@/lib/components/traits/WebComponentTrait'\n\nimport styles from './WebComponent.styles.css'\n\nexport default abstract class WebComponent extends LitElement {\n static states?: Record<string, Function>\n\n protected static finalizeStyles (componentStyles?: CSSResultGroup) {\n const elementStyles = super.finalizeStyles(componentStyles)\n\n return [styles, ...elementStyles]\n }\n\n protected internals?: ElementInternals\n protected globalListeners: [type: string, listener: EventListener][] = []\n protected traits: WebComponentTrait[] = []\n\n disconnectedCallback (): void {\n super.disconnectedCallback()\n\n for (const [type, listener] of this.globalListeners) {\n window.removeEventListener(type, listener)\n }\n\n this.globalListeners = []\n }\n\n protected addTrait<T extends WebComponentTrait>(trait: T): T {\n this.traits.push(trait)\n\n return trait\n }\n\n protected firstUpdated () {\n this.forwardMethodCall('firstUpdated')\n }\n\n protected updated (changedProperties: Map<PropertyKey, unknown>) {\n this.forwardMethodCall('updated', changedProperties)\n }\n\n protected formResetCallback () {\n this.forwardMethodCall('formResetCallback')\n }\n\n protected willUpdate (changedProperties: Map<string, any>) {\n super.willUpdate(changedProperties)\n\n const states = this.static().states\n\n if (!states) {\n return\n }\n\n const internals = this.getInternals()\n\n for (const [state, condition] of Object.entries(states)) {\n const matches = condition(this)\n\n if (matches && !internals.states.has(state)) {\n internals.states.add(state)\n } else if (!matches && internals.states.has(state)) {\n internals.states.delete(state)\n }\n }\n }\n\n protected addGlobalEventListener <T extends keyof WindowEventMap>(type: T, listener: (this: Window, ev: WindowEventMap[T]) => any) {\n this.globalListeners.push([type, listener as EventListener])\n\n window.addEventListener(type, listener)\n }\n\n protected render () {\n return html`<slot></slot>`\n }\n\n protected getInternals (): ElementInternals {\n this.internals ??= this.attachInternals()\n\n return this.internals\n }\n\n private static (): typeof WebComponent {\n return this.constructor as typeof WebComponent\n }\n\n private forwardMethodCall<T extends WebComponentTraitMethodKey>(method: T, ...args: Parameters<Required<WebComponentTrait>[T]>) {\n for (const trait of this.traits) {\n (trait[method] as Function | undefined)?.(...args)\n }\n }\n}\n"],"mappings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AEA,kBAAgE,EAAW,GAAG,EAAkD,CAC9H,IAAK,IAAM,KAAS,KAAK,OACvB,EAAO,KAAmC,GAAG,CAAI,CAErD,CACF"}
1
+ {"version":3,"file":"WebComponent.cjs.js","names":[],"sources":["../../../../src/lib/components/web-component/WebComponent.ts"],"sourcesContent":["import { html, LitElement, type CSSResultGroup } from 'lit'\nimport type { WebComponentTrait, WebComponentTraitMethodKey } from '@/lib/components/traits/WebComponentTrait'\n\nimport styles from './WebComponent.styles.css'\n\nexport default abstract class WebComponent extends LitElement {\n static states?: Record<string, Function>\n\n protected static finalizeStyles (componentStyles?: CSSResultGroup) {\n const elementStyles = super.finalizeStyles(componentStyles)\n\n return [styles, ...elementStyles]\n }\n\n protected internals?: ElementInternals\n protected globalListeners: [type: string, listener: EventListener][] = []\n protected traits: WebComponentTrait[] = []\n\n disconnectedCallback (): void {\n super.disconnectedCallback()\n\n for (const [type, listener] of this.globalListeners) {\n window.removeEventListener(type, listener)\n }\n\n this.globalListeners = []\n }\n\n protected addTrait<T extends WebComponentTrait>(trait: T): T {\n this.traits.push(trait)\n\n return trait\n }\n\n protected firstUpdated () {\n this.forwardMethodCall('firstUpdated')\n }\n\n protected updated (changedProperties: Map<PropertyKey, unknown>) {\n this.forwardMethodCall('updated', changedProperties)\n }\n\n protected formResetCallback () {\n this.forwardMethodCall('formResetCallback')\n }\n\n protected willUpdate (changedProperties: Map<string, any>) {\n super.willUpdate(changedProperties)\n\n const states = this.static().states\n\n if (!states) {\n return\n }\n\n for (const [state, condition] of Object.entries(states)) {\n // FIXME when browser support is good enough, use the internals API instead with :state() selectors\n this.toggleAttribute(`data-state-${state}`, !!condition(this))\n }\n }\n\n protected addGlobalEventListener <T extends keyof WindowEventMap>(type: T, listener: (this: Window, ev: WindowEventMap[T]) => any) {\n this.globalListeners.push([type, listener as EventListener])\n\n window.addEventListener(type, listener)\n }\n\n protected render () {\n return html`<slot></slot>`\n }\n\n protected getInternals (): ElementInternals {\n this.internals ??= this.attachInternals()\n\n return this.internals\n }\n\n private static (): typeof WebComponent {\n return this.constructor as typeof WebComponent\n }\n\n private forwardMethodCall<T extends WebComponentTraitMethodKey>(method: T, ...args: Parameters<Required<WebComponentTrait>[T]>) {\n for (const trait of this.traits) {\n (trait[method] as Function | undefined)?.(...args)\n }\n }\n}\n"],"mappings":"qEAKA,IAA8B,EAA9B,cAAmD,EAAA,UAAW,CAC5D,OAAO,OAEP,OAAiB,eAAgB,EAAkC,CAGjE,MAAO,CAAC,EAAA,QAAQ,GAFM,MAAM,eAAe,CAExB,CAAa,CAClC,CAEA,UACA,gBAAuE,CAAC,EACxE,OAAwC,CAAC,EAEzC,sBAA8B,CAC5B,MAAM,qBAAqB,EAE3B,IAAK,GAAM,CAAC,EAAM,KAAa,KAAK,gBAClC,OAAO,oBAAoB,EAAM,CAAQ,EAG3C,KAAK,gBAAkB,CAAC,CAC1B,CAEA,SAAgD,EAAa,CAG3D,OAFA,KAAK,OAAO,KAAK,CAAK,EAEf,CACT,CAEA,cAA0B,CACxB,KAAK,kBAAkB,cAAc,CACvC,CAEA,QAAmB,EAA8C,CAC/D,KAAK,kBAAkB,UAAW,CAAiB,CACrD,CAEA,mBAA+B,CAC7B,KAAK,kBAAkB,mBAAmB,CAC5C,CAEA,WAAsB,EAAqC,CACzD,MAAM,WAAW,CAAiB,EAElC,IAAM,EAAS,KAAK,OAAO,CAAC,CAAC,OAExB,KAIL,IAAK,GAAM,CAAC,EAAO,KAAc,OAAO,QAAQ,CAAM,EAEpD,KAAK,gBAAgB,cAAc,IAAS,CAAC,CAAC,EAAU,IAAI,CAAC,CAEjE,CAEA,uBAAkE,EAAS,EAAwD,CACjI,KAAK,gBAAgB,KAAK,CAAC,EAAM,CAAyB,CAAC,EAE3D,OAAO,iBAAiB,EAAM,CAAQ,CACxC,CAEA,QAAoB,CAClB,MAAO,GAAA,IAAI,eACb,CAEA,cAA4C,CAG1C,MAFA,MAAK,YAAc,KAAK,gBAAgB,EAEjC,KAAK,SACd,CAEA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C,EAAE,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,cAAc,CAAC,CAAC,CAAC,KAAK,GAAG;IAMjI,SAAS,CAAC,MAAM;IAIhB,SAAS,CAAC,YAAY,IAAK,gBAAgB;IAM3C,OAAO,CAAC,MAAM;IAId,OAAO,CAAC,iBAAiB;CAK1B"}
@@ -29,12 +29,7 @@ var r = class extends t {
29
29
  willUpdate(e) {
30
30
  super.willUpdate(e);
31
31
  let t = this.static().states;
32
- if (!t) return;
33
- let n = this.getInternals();
34
- for (let [e, r] of Object.entries(t)) {
35
- let t = r(this);
36
- t && !n.states.has(e) ? n.states.add(e) : !t && n.states.has(e) && n.states.delete(e);
37
- }
32
+ if (t) for (let [e, n] of Object.entries(t)) this.toggleAttribute(`data-state-${e}`, !!n(this));
38
33
  }
39
34
  addGlobalEventListener(e, t) {
40
35
  this.globalListeners.push([e, t]), window.addEventListener(e, t);
@@ -1 +1 @@
1
- {"version":3,"file":"WebComponent.esm.js","names":[],"sources":["../../../../src/lib/components/web-component/WebComponent.ts"],"sourcesContent":["import { html, LitElement, type CSSResultGroup } from 'lit'\nimport type { WebComponentTrait, WebComponentTraitMethodKey } from '@/lib/components/traits/WebComponentTrait'\n\nimport styles from './WebComponent.styles.css'\n\nexport default abstract class WebComponent extends LitElement {\n static states?: Record<string, Function>\n\n protected static finalizeStyles (componentStyles?: CSSResultGroup) {\n const elementStyles = super.finalizeStyles(componentStyles)\n\n return [styles, ...elementStyles]\n }\n\n protected internals?: ElementInternals\n protected globalListeners: [type: string, listener: EventListener][] = []\n protected traits: WebComponentTrait[] = []\n\n disconnectedCallback (): void {\n super.disconnectedCallback()\n\n for (const [type, listener] of this.globalListeners) {\n window.removeEventListener(type, listener)\n }\n\n this.globalListeners = []\n }\n\n protected addTrait<T extends WebComponentTrait>(trait: T): T {\n this.traits.push(trait)\n\n return trait\n }\n\n protected firstUpdated () {\n this.forwardMethodCall('firstUpdated')\n }\n\n protected updated (changedProperties: Map<PropertyKey, unknown>) {\n this.forwardMethodCall('updated', changedProperties)\n }\n\n protected formResetCallback () {\n this.forwardMethodCall('formResetCallback')\n }\n\n protected willUpdate (changedProperties: Map<string, any>) {\n super.willUpdate(changedProperties)\n\n const states = this.static().states\n\n if (!states) {\n return\n }\n\n const internals = this.getInternals()\n\n for (const [state, condition] of Object.entries(states)) {\n const matches = condition(this)\n\n if (matches && !internals.states.has(state)) {\n internals.states.add(state)\n } else if (!matches && internals.states.has(state)) {\n internals.states.delete(state)\n }\n }\n }\n\n protected addGlobalEventListener <T extends keyof WindowEventMap>(type: T, listener: (this: Window, ev: WindowEventMap[T]) => any) {\n this.globalListeners.push([type, listener as EventListener])\n\n window.addEventListener(type, listener)\n }\n\n protected render () {\n return html`<slot></slot>`\n }\n\n protected getInternals (): ElementInternals {\n this.internals ??= this.attachInternals()\n\n return this.internals\n }\n\n private static (): typeof WebComponent {\n return this.constructor as typeof WebComponent\n }\n\n private forwardMethodCall<T extends WebComponentTraitMethodKey>(method: T, ...args: Parameters<Required<WebComponentTrait>[T]>) {\n for (const trait of this.traits) {\n (trait[method] as Function | undefined)?.(...args)\n }\n }\n}\n"],"mappings":";;;AAKA,IAA8B,IAA9B,cAAmD,EAAW;CAC5D,OAAO;CAEP,OAAiB,eAAgB,GAAkC;EAGjE,OAAO,CAAC,GAAQ,GAFM,MAAM,eAAe,CAExB,CAAa;CAClC;CAEA;CACA,kBAAuE,CAAC;CACxE,SAAwC,CAAC;CAEzC,uBAA8B;EAC5B,MAAM,qBAAqB;EAE3B,KAAK,IAAM,CAAC,GAAM,MAAa,KAAK,iBAClC,OAAO,oBAAoB,GAAM,CAAQ;EAG3C,KAAK,kBAAkB,CAAC;CAC1B;CAEA,SAAgD,GAAa;EAG3D,OAFA,KAAK,OAAO,KAAK,CAAK,GAEf;CACT;CAEA,eAA0B;EACxB,KAAK,kBAAkB,cAAc;CACvC;CAEA,QAAmB,GAA8C;EAC/D,KAAK,kBAAkB,WAAW,CAAiB;CACrD;CAEA,oBAA+B;EAC7B,KAAK,kBAAkB,mBAAmB;CAC5C;CAEA,WAAsB,GAAqC;EACzD,MAAM,WAAW,CAAiB;EAElC,IAAM,IAAS,KAAK,OAAO,EAAE;EAE7B,IAAI,CAAC,GACH;EAGF,IAAM,IAAY,KAAK,aAAa;EAEpC,KAAK,IAAM,CAAC,GAAO,MAAc,OAAO,QAAQ,CAAM,GAAG;GACvD,IAAM,IAAU,EAAU,IAAI;GAE9B,AAAI,KAAW,CAAC,EAAU,OAAO,IAAI,CAAK,IACxC,EAAU,OAAO,IAAI,CAAK,IACjB,CAAC,KAAW,EAAU,OAAO,IAAI,CAAK,KAC/C,EAAU,OAAO,OAAO,CAAK;EAEjC;CACF;CAEA,uBAAkE,GAAS,GAAwD;EAGjI,AAFA,KAAK,gBAAgB,KAAK,CAAC,GAAM,CAAyB,CAAC,GAE3D,OAAO,iBAAiB,GAAM,CAAQ;CACxC;CAEA,SAAoB;EAClB,OAAO,CAAI;CACb;CAEA,eAA4C;EAG1C,OAFA,KAAK,cAAc,KAAK,gBAAgB,GAEjC,KAAK;CACd;CAEA,SAAuC;EACrC,OAAO,KAAK;CACd;CAEA,kBAAgE,GAAW,GAAG,GAAkD;EAC9H,KAAK,IAAM,KAAS,KAAK,QACvB,EAAO,KAAmC,GAAG,CAAI;CAErD;AACF"}
1
+ {"version":3,"file":"WebComponent.esm.js","names":[],"sources":["../../../../src/lib/components/web-component/WebComponent.ts"],"sourcesContent":["import { html, LitElement, type CSSResultGroup } from 'lit'\nimport type { WebComponentTrait, WebComponentTraitMethodKey } from '@/lib/components/traits/WebComponentTrait'\n\nimport styles from './WebComponent.styles.css'\n\nexport default abstract class WebComponent extends LitElement {\n static states?: Record<string, Function>\n\n protected static finalizeStyles (componentStyles?: CSSResultGroup) {\n const elementStyles = super.finalizeStyles(componentStyles)\n\n return [styles, ...elementStyles]\n }\n\n protected internals?: ElementInternals\n protected globalListeners: [type: string, listener: EventListener][] = []\n protected traits: WebComponentTrait[] = []\n\n disconnectedCallback (): void {\n super.disconnectedCallback()\n\n for (const [type, listener] of this.globalListeners) {\n window.removeEventListener(type, listener)\n }\n\n this.globalListeners = []\n }\n\n protected addTrait<T extends WebComponentTrait>(trait: T): T {\n this.traits.push(trait)\n\n return trait\n }\n\n protected firstUpdated () {\n this.forwardMethodCall('firstUpdated')\n }\n\n protected updated (changedProperties: Map<PropertyKey, unknown>) {\n this.forwardMethodCall('updated', changedProperties)\n }\n\n protected formResetCallback () {\n this.forwardMethodCall('formResetCallback')\n }\n\n protected willUpdate (changedProperties: Map<string, any>) {\n super.willUpdate(changedProperties)\n\n const states = this.static().states\n\n if (!states) {\n return\n }\n\n for (const [state, condition] of Object.entries(states)) {\n // FIXME when browser support is good enough, use the internals API instead with :state() selectors\n this.toggleAttribute(`data-state-${state}`, !!condition(this))\n }\n }\n\n protected addGlobalEventListener <T extends keyof WindowEventMap>(type: T, listener: (this: Window, ev: WindowEventMap[T]) => any) {\n this.globalListeners.push([type, listener as EventListener])\n\n window.addEventListener(type, listener)\n }\n\n protected render () {\n return html`<slot></slot>`\n }\n\n protected getInternals (): ElementInternals {\n this.internals ??= this.attachInternals()\n\n return this.internals\n }\n\n private static (): typeof WebComponent {\n return this.constructor as typeof WebComponent\n }\n\n private forwardMethodCall<T extends WebComponentTraitMethodKey>(method: T, ...args: Parameters<Required<WebComponentTrait>[T]>) {\n for (const trait of this.traits) {\n (trait[method] as Function | undefined)?.(...args)\n }\n }\n}\n"],"mappings":";;;AAKA,IAA8B,IAA9B,cAAmD,EAAW;CAC5D,OAAO;CAEP,OAAiB,eAAgB,GAAkC;EAGjE,OAAO,CAAC,GAAQ,GAFM,MAAM,eAAe,CAExB,CAAa;CAClC;CAEA;CACA,kBAAuE,CAAC;CACxE,SAAwC,CAAC;CAEzC,uBAA8B;EAC5B,MAAM,qBAAqB;EAE3B,KAAK,IAAM,CAAC,GAAM,MAAa,KAAK,iBAClC,OAAO,oBAAoB,GAAM,CAAQ;EAG3C,KAAK,kBAAkB,CAAC;CAC1B;CAEA,SAAgD,GAAa;EAG3D,OAFA,KAAK,OAAO,KAAK,CAAK,GAEf;CACT;CAEA,eAA0B;EACxB,KAAK,kBAAkB,cAAc;CACvC;CAEA,QAAmB,GAA8C;EAC/D,KAAK,kBAAkB,WAAW,CAAiB;CACrD;CAEA,oBAA+B;EAC7B,KAAK,kBAAkB,mBAAmB;CAC5C;CAEA,WAAsB,GAAqC;EACzD,MAAM,WAAW,CAAiB;EAElC,IAAM,IAAS,KAAK,OAAO,CAAC,CAAC;EAExB,OAIL,KAAK,IAAM,CAAC,GAAO,MAAc,OAAO,QAAQ,CAAM,GAEpD,KAAK,gBAAgB,cAAc,KAAS,CAAC,CAAC,EAAU,IAAI,CAAC;CAEjE;CAEA,uBAAkE,GAAS,GAAwD;EAGjI,AAFA,KAAK,gBAAgB,KAAK,CAAC,GAAM,CAAyB,CAAC,GAE3D,OAAO,iBAAiB,GAAM,CAAQ;CACxC;CAEA,SAAoB;EAClB,OAAO,CAAI;CACb;CAEA,eAA4C;EAG1C,OAFA,KAAK,cAAc,KAAK,gBAAgB,GAEjC,KAAK;CACd;CAEA,SAAuC;EACrC,OAAO,KAAK;CACd;CAEA,kBAAgE,GAAW,GAAG,GAAkD;EAC9H,KAAK,IAAM,KAAS,KAAK,QACvB,EAAO,EAAO,GAA4B,GAAG,CAAI;CAErD;AACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"WebComponent.styles.cjs.js","names":[],"sources":["../../../../src/lib/components/web-component/WebComponent.styles.css"],"sourcesContent":["@import 'tailwindcss/preflight.css';\n\n.sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border: 0;\n}\n"],"mappings":""}
1
+ {"version":3,"file":"WebComponent.styles.cjs.js","names":[],"sources":[],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"WebComponent.styles.esm.js","names":[],"sources":["../../../../src/lib/components/web-component/WebComponent.styles.css"],"sourcesContent":["@import 'tailwindcss/preflight.css';\n\n.sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border: 0;\n}\n"],"mappings":""}
1
+ {"version":3,"file":"WebComponent.styles.esm.js","names":[],"sources":[],"mappings":""}
@@ -1 +1 @@
1
- require("./WebComponent.cjs.js");
1
+ const e=require("./WebComponent.cjs.js");exports.WebComponent=e.default;
@@ -1 +1,2 @@
1
- import "./WebComponent.esm.js";
1
+ import e from "./WebComponent.esm.js";
2
+ export { e as WebComponent };
@@ -1 +1 @@
1
- {"version":3,"file":"context.cjs.js","names":[],"sources":["../../../src/lib/dialogs/context.ts"],"sourcesContent":["import { createContext } from '@lit/context'\nimport { generateId } from '@/lib/components/ids'\n\nexport interface DialogContext {\n readonly id: string\n}\n\nexport const DEFAULT_DIALOG_CONTEXT = { id: `noop-${generateId()}` } satisfies DialogContext\nexport const dialogContext = createContext<DialogContext>(Symbol('dialog'))\n"],"mappings":"0EAOA,IAAa,EAAyB,CAAE,GAAI,QAAQ,EAAA,WAAW,GAAI,EACtD,GAAA,EAAA,EAAA,eAA6C,OAAO,QAAQ,CAAC"}
1
+ {"version":3,"file":"context.cjs.js","names":[],"sources":["../../../src/lib/dialogs/context.ts"],"sourcesContent":["import { createContext } from '@lit/context'\nimport { generateId } from '@/lib/components/ids'\n\nexport interface DialogContext {\n readonly id: string\n}\n\nexport const DEFAULT_DIALOG_CONTEXT = { id: `noop-${generateId()}` } satisfies DialogContext\nexport const dialogContext = createContext<DialogContext>(Symbol('dialog'))\n"],"mappings":"0EAOA,IAAa,EAAyB,CAAE,GAAI,QAAQ,EAAA,WAAW,GAAI,EACtD,GAAA,EAAA,EAAA,cAAA,CAA6C,OAAO,QAAQ,CAAC"}
@@ -1 +1 @@
1
- require("./context.cjs.js"),require("./events/close-dialog.cjs.js"),require("./Dialog.cjs.js"),require("./events/show-dialog.cjs.js"),require("./helpers.cjs.js");
1
+ const e=require("./context.cjs.js"),t=require("./events/close-dialog.cjs.js"),n=require("./Dialog.cjs.js"),r=require("./events/show-dialog.cjs.js"),i=require("./helpers.cjs.js");exports.CloseDialogEvent=t.CloseDialogEvent,exports.DEFAULT_DIALOG_CONTEXT=e.DEFAULT_DIALOG_CONTEXT,exports.Dialog=n.default,exports.ShowDialogEvent=r.ShowDialogEvent,exports.dialogContext=e.dialogContext,exports.showDialog=i.showDialog;
@@ -1,5 +1,6 @@
1
- import "./context.esm.js";
2
- import "./events/close-dialog.esm.js";
3
- import "./Dialog.esm.js";
4
- import "./events/show-dialog.esm.js";
5
- import "./helpers.esm.js";
1
+ import { DEFAULT_DIALOG_CONTEXT as e, dialogContext as t } from "./context.esm.js";
2
+ import { CloseDialogEvent as n } from "./events/close-dialog.esm.js";
3
+ import r from "./Dialog.esm.js";
4
+ import { ShowDialogEvent as i } from "./events/show-dialog.esm.js";
5
+ import { showDialog as a } from "./helpers.esm.js";
6
+ export { n as CloseDialogEvent, e as DEFAULT_DIALOG_CONTEXT, r as Dialog, i as ShowDialogEvent, t as dialogContext, a as showDialog };
@@ -1,2 +1,2 @@
1
- var e=require("../_virtual/_rolldown/runtime.cjs.js").__exportAll({LogLevel:()=>c,alert:()=>b,clear:()=>x,debug:()=>g,dumpHTML:()=>C,error:()=>v,escapeForXML:()=>E,info:()=>_,logAscending:()=>w,logDescending:()=>T,msg:()=>m,setInternals:()=>D,setLevel:()=>S,success:()=>y,warn:()=>h}),t=1,n=2,r=4,i=8,a=16,o=32,s=63,c=function(e){return e[e.Error=t]=`Error`,e[e.Warning=n]=`Warning`,e[e.Message=r]=`Message`,e[e.Success=i]=`Success`,e[e.Info=a]=`Info`,e[e.Debug=o]=`Debug`,e[e.All=s]=`All`,e}({}),l=7,u=!1,d=document,f=window;function p(e,t=r,n=`mesg`){if(l&t)if(d!==void 0){let t=d.getElementById(`status`);if(!t)return;let r=d.createElement(`span`);r.setAttribute(`class`,n);let i=new Date;r.innerHTML=`${i.getHours()}:${i.getMinutes()}:${i.getSeconds()} [${n}] ${E(e)}<br/>`,u?t.insertBefore(r,t.firstChild):t.appendChild(r)}else typeof console<`u`&&console.log(e)}function m(e){p(e)}function h(e){p(e,n,`warn`)}function g(e){p(e,o,`dbug`)}function _(e){p(e,a,`info`)}function v(e){p(e,t,`eror`)}function y(e){p(e,i,`good`)}function b(e){f&&f.alert!==void 0?f.alert(e):h(e)}function x(){let e=d?.getElementById(`status`);e&&(e.innerHTML=``)}function S(e){l=s,g(`Log level is now `+e),l=e}function C(){if(!d)return;let e=l;l=s,g(d?.body?.innerHTML||``),l=e}function w(){u=!0}function T(){u=!1}function E(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}function D(e,t){f=e,d=t}exports.alert=b,exports.debug=g,exports.info=_,Object.defineProperty(exports,"log_exports",{enumerable:!0,get:function(){return e}});
1
+ var e=require("../_virtual/_rolldown/runtime.cjs.js").__exportAll({LogLevel:()=>c,alert:()=>b,clear:()=>x,debug:()=>g,dumpHTML:()=>C,error:()=>v,escapeForXML:()=>E,info:()=>_,logAscending:()=>w,logDescending:()=>T,msg:()=>m,setInternals:()=>D,setLevel:()=>S,success:()=>y,warn:()=>h}),t=1,n=2,r=4,i=8,a=16,o=32,s=63,c=function(e){return e[e.Error=t]=`Error`,e[e.Warning=n]=`Warning`,e[e.Message=r]=`Message`,e[e.Success=i]=`Success`,e[e.Info=a]=`Info`,e[e.Debug=o]=`Debug`,e[e.All=s]=`All`,e}({}),l=7,u=!1,d=document,f=window;function p(e,t=r,n=`mesg`){if(l&t)if(d!==void 0){let t=d.getElementById(`status`);if(!t)return;let r=d.createElement(`span`);r.setAttribute(`class`,n);let i=new Date;r.innerHTML=`${i.getHours()}:${i.getMinutes()}:${i.getSeconds()} [${n}] ${E(e)}<br/>`,u?t.insertBefore(r,t.firstChild):t.appendChild(r)}else typeof console<`u`&&console.log(e)}function m(e){p(e)}function h(e){p(e,n,`warn`)}function g(e){p(e,o,`dbug`)}function _(e){p(e,a,`info`)}function v(e){p(e,t,`eror`)}function y(e){p(e,i,`good`)}function b(e){f&&f.alert!==void 0?f.alert(e):h(e)}function x(){let e=d?.getElementById(`status`);e&&(e.innerHTML=``)}function S(e){l=s,g(`Log level is now `+e),l=e}function C(){if(!d)return;let e=l;l=s,g(d?.body?.innerHTML||``),l=e}function w(){u=!0}function T(){u=!1}function E(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}function D(e,t){f=e,d=t}exports.LogLevel=c,exports.alert=b,exports.clear=x,exports.debug=g,exports.dumpHTML=C,exports.error=v,exports.escapeForXML=E,exports.info=_,exports.logAscending=w,exports.logDescending=T,Object.defineProperty(exports,"log_exports",{enumerable:!0,get:function(){return e}}),exports.msg=m,exports.setInternals=D,exports.setLevel=S,exports.success=y,exports.warn=h;
2
2
  //# sourceMappingURL=log.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"log.cjs.js","names":[],"sources":["../../src/lib/log.ts"],"sourcesContent":["// /////////////////////// Logging\n//\n// bitmask levels\n// const TNONE = 0\n/** @internal */\nconst TERROR = 1\n/** @internal */\nconst TWARN = 2\n/** @internal */\nconst TMESG = 4\n/** @internal */\nconst TSUCCESS = 8\n/** @internal */\nconst TINFO = 16\n/** @internal */\nconst TDEBUG = 32\n/** @internal */\nconst TALL = 63\n\n/** @internal */\nexport enum LogLevel {\n Error = TERROR,\n Warning = TWARN,\n Message = TMESG,\n Success = TSUCCESS,\n Info = TINFO,\n Debug = TDEBUG,\n All = TALL\n}\n\n/** @internal */\nlet _level: number = TERROR + TWARN + TMESG\n/** @internal */\nlet _ascending: boolean = false\n/** @internal */\nlet _dom: HTMLDocument = document // must be able to override for tests\n/** @internal */\nlet _window: Window = window // must be able to override for tests\n\n/** @internal */\nfunction log (str: string, type: number = TMESG, typestr: string = 'mesg') {\n if (!(_level & type)) return // bitmask\n\n if (typeof _dom !== 'undefined') {\n const logArea = _dom.getElementById('status')\n if (!logArea) return\n\n const addendum = _dom.createElement('span')\n addendum.setAttribute('class', typestr)\n const now = new Date()\n addendum.innerHTML = `${now.getHours()}:${now.getMinutes()}:${now.getSeconds()} [${typestr}] ${escapeForXML(str)}<br/>`\n if (_ascending) {\n logArea.insertBefore(addendum, logArea.firstChild)\n } else {\n logArea.appendChild(addendum)\n }\n } else if (typeof console !== 'undefined') {\n console.log(str)\n }\n}\n\n/**\n * Adds a message to the element with id \"status\". The messages are prepended with\n * time and type of message, in this case [mesg].\n */\nexport function msg (message: string) {\n log(message)\n}\n\n/**\n * Adds a warning message to the element with id \"status\". The messages are\n * prepended with time and type of message, in this case [warn].\n */\nexport function warn (message: string): void {\n log(message, TWARN, 'warn')\n}\n\n/**\n * Adds a debugging message to the element with id \"status\". The messages are\n * prepended with time and type of message, in this case [dbug].\n */\nexport function debug (message: string): void {\n log(message, TDEBUG, 'dbug')\n}\n\n/**\n * Adds a info message to the element with id \"status\". The messages are\n * prepended with time and type of message, in this case [info].\n */\nexport function info (message: string): void {\n log(message, TINFO, 'info')\n}\n\n/**\n * Adds a error to the element with id \"status\". The messages are\n * prepended with time and type of message, in this case [eror].\n */\nexport function error (message: string): void {\n log(message, TERROR, 'eror')\n}\n\n/**\n * Adds a success message to the element with id \"status\". The messages are\n * prepended with time and type of message, in this case [good].\n */\nexport function success (message: string): void {\n log(message, TSUCCESS, 'good')\n}\n\n/**\n * Uses the global alert to send an alert. If global alert is not available, it\n * will output the message using the method [[warning]]s.\n */\nexport function alert (message: string): void {\n if (_window && typeof _window.alert !== 'undefined') {\n _window.alert(message)\n } else {\n warn(message)\n }\n}\n\n/**\n * Will clear the content of the element with id \"status\".\n */\nexport function clear (): void {\n const logArea = _dom?.getElementById('status')\n if (!logArea) return\n logArea.innerHTML = ''\n}\n\n/**\n * Lets you configure which types of messages will be shown. The module uses\n * [bitmask](https://en.wikipedia.org/wiki/Mask_(computing)) to filter which\n * types of messages should be shown. E.g. if you only want warning messages\n * to be shown, pass 2 to the function, if you want warning and success to be\n * shown, pass 10 (2+8). By passing the sum of all, 63, you'll show all\n * types of messages.\n *\n * - Error: 1\n * - Warning: 2\n * - Message: 4\n * - Success: 8\n * - Info: 16\n * - Debug: 32\n */\nexport function setLevel (level: number): void {\n _level = TALL\n debug('Log level is now ' + level)\n _level = level\n}\n\n/**\n * Will dump the current HTML using the [[debug]] method.\n */\nexport function dumpHTML (): void {\n if (!_dom) return\n const level = _level\n _level = TALL\n debug(_dom?.body?.innerHTML || '')\n _level = level\n}\n\n/**\n * Will start prepending messages the list of log messages.\n */\nexport function logAscending () {\n _ascending = true\n}\n\n/**\n * Will start appending messages the list of log messages. (This is default\n * behavior.)\n */\nexport function logDescending () {\n _ascending = false\n}\n\n/** @internal */\nexport function escapeForXML (str: string): string {\n // can be replaced with function utils module when migrating\n return str\n .replace(/&/g, '&amp;')\n .replace(/</g, '&lt;')\n .replace(/>/g, '&gt;')\n}\n\n/** @internal */\nexport function setInternals (window, document) {\n _window = window\n _dom = document\n}\n"],"mappings":"6RAKM,EAAS,EAET,EAAQ,EAER,EAAQ,EAER,EAAW,EAEX,EAAQ,GAER,EAAS,GAET,EAAO,GAGD,EAAL,SAAA,EAAA,OACL,GAAA,EAAA,MAAQ,GAAA,QACR,EAAA,EAAA,QAAU,GAAA,UACV,EAAA,EAAA,QAAU,GAAA,UACV,EAAA,EAAA,QAAU,GAAA,UACV,EAAA,EAAA,KAAO,GAAA,OACP,EAAA,EAAA,MAAQ,GAAA,QACR,EAAA,EAAA,IAAM,GAAA,OACR,EAAA,CAAA,CAAA,EAGI,EAAiB,EAEjB,EAAsB,GAEtB,EAAqB,SAErB,EAAkB,OAGtB,SAAS,EAAK,EAAa,EAAe,EAAO,EAAkB,OAAQ,CACnE,KAAS,EAEf,GAAW,IAAS,OAAa,CAC/B,IAAM,EAAU,EAAK,eAAe,QAAQ,EAC5C,GAAI,CAAC,EAAS,OAEd,IAA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,EACJ,QAAQ,KAAM,OAAO,EACrB,QAAQ,KAAM,MAAM,EACpB,QAAQ,KAAM,MAAM,CACzB,CAGA,SAAgB,EAAc,EAAQ,EAAU,CAC9C,EAAU,EACV,EAAO,CACT"}
1
+ {"version":3,"file":"log.cjs.js","names":[],"sources":["../../src/lib/log.ts"],"sourcesContent":["// /////////////////////// Logging\n//\n// bitmask levels\n// const TNONE = 0\n/** @internal */\nconst TERROR = 1\n/** @internal */\nconst TWARN = 2\n/** @internal */\nconst TMESG = 4\n/** @internal */\nconst TSUCCESS = 8\n/** @internal */\nconst TINFO = 16\n/** @internal */\nconst TDEBUG = 32\n/** @internal */\nconst TALL = 63\n\n/** @internal */\nexport enum LogLevel {\n Error = TERROR,\n Warning = TWARN,\n Message = TMESG,\n Success = TSUCCESS,\n Info = TINFO,\n Debug = TDEBUG,\n All = TALL\n}\n\n/** @internal */\nlet _level: number = TERROR + TWARN + TMESG\n/** @internal */\nlet _ascending: boolean = false\n/** @internal */\nlet _dom: HTMLDocument = document // must be able to override for tests\n/** @internal */\nlet _window: Window = window // must be able to override for tests\n\n/** @internal */\nfunction log (str: string, type: number = TMESG, typestr: string = 'mesg') {\n if (!(_level & type)) return // bitmask\n\n if (typeof _dom !== 'undefined') {\n const logArea = _dom.getElementById('status')\n if (!logArea) return\n\n const addendum = _dom.createElement('span')\n addendum.setAttribute('class', typestr)\n const now = new Date()\n addendum.innerHTML = `${now.getHours()}:${now.getMinutes()}:${now.getSeconds()} [${typestr}] ${escapeForXML(str)}<br/>`\n if (_ascending) {\n logArea.insertBefore(addendum, logArea.firstChild)\n } else {\n logArea.appendChild(addendum)\n }\n } else if (typeof console !== 'undefined') {\n console.log(str)\n }\n}\n\n/**\n * Adds a message to the element with id \"status\". The messages are prepended with\n * time and type of message, in this case [mesg].\n */\nexport function msg (message: string) {\n log(message)\n}\n\n/**\n * Adds a warning message to the element with id \"status\". The messages are\n * prepended with time and type of message, in this case [warn].\n */\nexport function warn (message: string): void {\n log(message, TWARN, 'warn')\n}\n\n/**\n * Adds a debugging message to the element with id \"status\". The messages are\n * prepended with time and type of message, in this case [dbug].\n */\nexport function debug (message: string): void {\n log(message, TDEBUG, 'dbug')\n}\n\n/**\n * Adds a info message to the element with id \"status\". The messages are\n * prepended with time and type of message, in this case [info].\n */\nexport function info (message: string): void {\n log(message, TINFO, 'info')\n}\n\n/**\n * Adds a error to the element with id \"status\". The messages are\n * prepended with time and type of message, in this case [eror].\n */\nexport function error (message: string): void {\n log(message, TERROR, 'eror')\n}\n\n/**\n * Adds a success message to the element with id \"status\". The messages are\n * prepended with time and type of message, in this case [good].\n */\nexport function success (message: string): void {\n log(message, TSUCCESS, 'good')\n}\n\n/**\n * Uses the global alert to send an alert. If global alert is not available, it\n * will output the message using the method [[warning]]s.\n */\nexport function alert (message: string): void {\n if (_window && typeof _window.alert !== 'undefined') {\n _window.alert(message)\n } else {\n warn(message)\n }\n}\n\n/**\n * Will clear the content of the element with id \"status\".\n */\nexport function clear (): void {\n const logArea = _dom?.getElementById('status')\n if (!logArea) return\n logArea.innerHTML = ''\n}\n\n/**\n * Lets you configure which types of messages will be shown. The module uses\n * [bitmask](https://en.wikipedia.org/wiki/Mask_(computing)) to filter which\n * types of messages should be shown. E.g. if you only want warning messages\n * to be shown, pass 2 to the function, if you want warning and success to be\n * shown, pass 10 (2+8). By passing the sum of all, 63, you'll show all\n * types of messages.\n *\n * - Error: 1\n * - Warning: 2\n * - Message: 4\n * - Success: 8\n * - Info: 16\n * - Debug: 32\n */\nexport function setLevel (level: number): void {\n _level = TALL\n debug('Log level is now ' + level)\n _level = level\n}\n\n/**\n * Will dump the current HTML using the [[debug]] method.\n */\nexport function dumpHTML (): void {\n if (!_dom) return\n const level = _level\n _level = TALL\n debug(_dom?.body?.innerHTML || '')\n _level = level\n}\n\n/**\n * Will start prepending messages the list of log messages.\n */\nexport function logAscending () {\n _ascending = true\n}\n\n/**\n * Will start appending messages the list of log messages. (This is default\n * behavior.)\n */\nexport function logDescending () {\n _ascending = false\n}\n\n/** @internal */\nexport function escapeForXML (str: string): string {\n // can be replaced with function utils module when migrating\n return str\n .replace(/&/g, '&amp;')\n .replace(/</g, '&lt;')\n .replace(/>/g, '&gt;')\n}\n\n/** @internal */\nexport function setInternals (window, document) {\n _window = window\n _dom = document\n}\n"],"mappings":"6RAKM,EAAS,EAET,EAAQ,EAER,EAAQ,EAER,EAAW,EAEX,EAAQ,GAER,EAAS,GAET,EAAO,GAGD,EAAL,SAAA,EAAA,OACL,GAAA,EAAA,MAAQ,GAAA,QACR,EAAA,EAAA,QAAU,GAAA,UACV,EAAA,EAAA,QAAU,GAAA,UACV,EAAA,EAAA,QAAU,GAAA,UACV,EAAA,EAAA,KAAO,GAAA,OACP,EAAA,EAAA,MAAQ,GAAA,QACR,EAAA,EAAA,IAAM,GAAA,OACR,EAAA,CAAA,CAAA,EAGI,EAAiB,EAEjB,EAAsB,GAEtB,EAAqB,SAErB,EAAkB,OAGtB,SAAS,EAAK,EAAa,EAAe,EAAO,EAAkB,OAAQ,CACnE,KAAS,EAEf,GAAW,IAAS,OAAa,CAC/B,IAAM,EAAU,EAAK,eAAe,QAAQ,EAC5C,GAAI,CAAC,EAAS,OAEd,IAAM,EAAW,EAAK,cAAc,MAAM,EAC1C,EAAS,aAAa,QAAS,CAAO,EACtC,IAAM,EAAM,IAAI,KAChB,EAAS,UAAY,GAAG,EAAI,SAAS,EAAE,GAAG,EAAI,WAAW,EAAE,GAAG,EAAI,WAAW,EAAE,IAAI,EAAQ,IAAI,EAAa,CAAG,EAAE,OAC7G,EACF,EAAQ,aAAa,EAAU,EAAQ,UAAU,EAEjD,EAAQ,YAAY,CAAQ,CAEhC,MAAW,OAAO,QAAY,KAC5B,QAAQ,IAAI,CAAG,CAEnB,CAMA,SAAgB,EAAK,EAAiB,CACpC,EAAI,CAAO,CACb,CAMA,SAAgB,EAAM,EAAuB,CAC3C,EAAI,EAAS,EAAO,MAAM,CAC5B,CAMA,SAAgB,EAAO,EAAuB,CAC5C,EAAI,EAAS,EAAQ,MAAM,CAC7B,CAMA,SAAgB,EAAM,EAAuB,CAC3C,EAAI,EAAS,EAAO,MAAM,CAC5B,CAMA,SAAgB,EAAO,EAAuB,CAC5C,EAAI,EAAS,EAAQ,MAAM,CAC7B,CAMA,SAAgB,EAAS,EAAuB,CAC9C,EAAI,EAAS,EAAU,MAAM,CAC/B,CAMA,SAAgB,EAAO,EAAuB,CACxC,GAAkB,EAAQ,QAAU,OACtC,EAAQ,MAAM,CAAO,EAErB,EAAK,CAAO,CAEhB,CAKA,SAAgB,GAAe,CAC7B,IAAM,EAAU,GAAM,eAAe,QAAQ,EACxC,IACL,EAAQ,UAAY,GACtB,CAiBA,SAAgB,EAAU,EAAqB,CAC7C,EAAS,EACT,EAAM,oBAAsB,CAAK,EACjC,EAAS,CACX,CAKA,SAAgB,GAAkB,CAChC,GAAI,CAAC,EAAM,OACX,IAAM,EAAQ,EACd,EAAS,EACT,EAAM,GAAM,MAAM,WAAa,EAAE,EACjC,EAAS,CACX,CAKA,SAAgB,GAAgB,CAC9B,EAAa,EACf,CAMA,SAAgB,GAAiB,CAC/B,EAAa,EACf,CAGA,SAAgB,EAAc,EAAqB,CAEjD,OAAO,EACJ,QAAQ,KAAM,OAAO,CAAC,CACtB,QAAQ,KAAM,MAAM,CAAC,CACrB,QAAQ,KAAM,MAAM,CACzB,CAGA,SAAgB,EAAc,EAAQ,EAAU,CAC9C,EAAU,EACV,EAAO,CACT"}
@@ -75,6 +75,6 @@ function O(e, t) {
75
75
  p = e, f = t;
76
76
  }
77
77
  //#endregion
78
- export { x as alert, _ as debug, v as info, t as log_exports };
78
+ export { l as LogLevel, x as alert, S as clear, _ as debug, w as dumpHTML, y as error, D as escapeForXML, v as info, T as logAscending, E as logDescending, t as log_exports, h as msg, O as setInternals, C as setLevel, b as success, g as warn };
79
79
 
80
80
  //# sourceMappingURL=log.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"log.esm.js","names":[],"sources":["../../src/lib/log.ts"],"sourcesContent":["// /////////////////////// Logging\n//\n// bitmask levels\n// const TNONE = 0\n/** @internal */\nconst TERROR = 1\n/** @internal */\nconst TWARN = 2\n/** @internal */\nconst TMESG = 4\n/** @internal */\nconst TSUCCESS = 8\n/** @internal */\nconst TINFO = 16\n/** @internal */\nconst TDEBUG = 32\n/** @internal */\nconst TALL = 63\n\n/** @internal */\nexport enum LogLevel {\n Error = TERROR,\n Warning = TWARN,\n Message = TMESG,\n Success = TSUCCESS,\n Info = TINFO,\n Debug = TDEBUG,\n All = TALL\n}\n\n/** @internal */\nlet _level: number = TERROR + TWARN + TMESG\n/** @internal */\nlet _ascending: boolean = false\n/** @internal */\nlet _dom: HTMLDocument = document // must be able to override for tests\n/** @internal */\nlet _window: Window = window // must be able to override for tests\n\n/** @internal */\nfunction log (str: string, type: number = TMESG, typestr: string = 'mesg') {\n if (!(_level & type)) return // bitmask\n\n if (typeof _dom !== 'undefined') {\n const logArea = _dom.getElementById('status')\n if (!logArea) return\n\n const addendum = _dom.createElement('span')\n addendum.setAttribute('class', typestr)\n const now = new Date()\n addendum.innerHTML = `${now.getHours()}:${now.getMinutes()}:${now.getSeconds()} [${typestr}] ${escapeForXML(str)}<br/>`\n if (_ascending) {\n logArea.insertBefore(addendum, logArea.firstChild)\n } else {\n logArea.appendChild(addendum)\n }\n } else if (typeof console !== 'undefined') {\n console.log(str)\n }\n}\n\n/**\n * Adds a message to the element with id \"status\". The messages are prepended with\n * time and type of message, in this case [mesg].\n */\nexport function msg (message: string) {\n log(message)\n}\n\n/**\n * Adds a warning message to the element with id \"status\". The messages are\n * prepended with time and type of message, in this case [warn].\n */\nexport function warn (message: string): void {\n log(message, TWARN, 'warn')\n}\n\n/**\n * Adds a debugging message to the element with id \"status\". The messages are\n * prepended with time and type of message, in this case [dbug].\n */\nexport function debug (message: string): void {\n log(message, TDEBUG, 'dbug')\n}\n\n/**\n * Adds a info message to the element with id \"status\". The messages are\n * prepended with time and type of message, in this case [info].\n */\nexport function info (message: string): void {\n log(message, TINFO, 'info')\n}\n\n/**\n * Adds a error to the element with id \"status\". The messages are\n * prepended with time and type of message, in this case [eror].\n */\nexport function error (message: string): void {\n log(message, TERROR, 'eror')\n}\n\n/**\n * Adds a success message to the element with id \"status\". The messages are\n * prepended with time and type of message, in this case [good].\n */\nexport function success (message: string): void {\n log(message, TSUCCESS, 'good')\n}\n\n/**\n * Uses the global alert to send an alert. If global alert is not available, it\n * will output the message using the method [[warning]]s.\n */\nexport function alert (message: string): void {\n if (_window && typeof _window.alert !== 'undefined') {\n _window.alert(message)\n } else {\n warn(message)\n }\n}\n\n/**\n * Will clear the content of the element with id \"status\".\n */\nexport function clear (): void {\n const logArea = _dom?.getElementById('status')\n if (!logArea) return\n logArea.innerHTML = ''\n}\n\n/**\n * Lets you configure which types of messages will be shown. The module uses\n * [bitmask](https://en.wikipedia.org/wiki/Mask_(computing)) to filter which\n * types of messages should be shown. E.g. if you only want warning messages\n * to be shown, pass 2 to the function, if you want warning and success to be\n * shown, pass 10 (2+8). By passing the sum of all, 63, you'll show all\n * types of messages.\n *\n * - Error: 1\n * - Warning: 2\n * - Message: 4\n * - Success: 8\n * - Info: 16\n * - Debug: 32\n */\nexport function setLevel (level: number): void {\n _level = TALL\n debug('Log level is now ' + level)\n _level = level\n}\n\n/**\n * Will dump the current HTML using the [[debug]] method.\n */\nexport function dumpHTML (): void {\n if (!_dom) return\n const level = _level\n _level = TALL\n debug(_dom?.body?.innerHTML || '')\n _level = level\n}\n\n/**\n * Will start prepending messages the list of log messages.\n */\nexport function logAscending () {\n _ascending = true\n}\n\n/**\n * Will start appending messages the list of log messages. (This is default\n * behavior.)\n */\nexport function logDescending () {\n _ascending = false\n}\n\n/** @internal */\nexport function escapeForXML (str: string): string {\n // can be replaced with function utils module when migrating\n return str\n .replace(/&/g, '&amp;')\n .replace(/</g, '&lt;')\n .replace(/>/g, '&gt;')\n}\n\n/** @internal */\nexport function setInternals (window, document) {\n _window = window\n _dom = document\n}\n"],"mappings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AAM;AAC7B;AAMA,SAAgB,EAAS,GAAuB;CAC9C,EAAI,GAAS,GAAU,MAAM;AAC/B;AAMA,SAAgB,EAAO,GAAuB;CAC5C,AAAI,KAAkB,EAAQ,UAAU,SACtC,EAAQ,MAAM,CAAO,IAErB,EAAK,CAAO;AAEhB;AAKA,SAAgB,IAAe;CAC7B,IAAM,IAAU,GAAM,eAAe,QAAQ;CACxC,MACL,EAAQ,YAAY;AACtB;AAiBA,SAAgB,EAAU,GAAqB;CAG7C,AAFA,IAAS,GACT,EAAM,sBAAsB,CAAK,GACjC,IAAS;AACX;AAKA,SAAgB,IAAkB;CAChC,IAAI,CAAC,GAAM;CACX,IAAM,IAAQ;CAGd,AAFA,IAAS,GACT,EAAM,GAAM,MAAM,aAAa,EAAE,GACjC,IAAS;AACX;AAKA,SAAgB,IAAgB;CAC9B,IAAa;AACf;AAMA,SAAgB,IAAiB;CAC/B,IAAa;AACf;AAGA,SAAgB,EAAc,GAAqB;CAEjD,OAAO,EACJ,QAAQ,MAAM,OAAO,EACrB,QAAQ,MAAM,MAAM,EACpB,QAAQ,MAAM,MAAM;AACzB;AAGA,SAAgB,EAAc,GAAQ,GAAU;CAE9C,AADA,IAAU,GACV,IAAO;AACT"}
1
+ {"version":3,"file":"log.esm.js","names":[],"sources":["../../src/lib/log.ts"],"sourcesContent":["// /////////////////////// Logging\n//\n// bitmask levels\n// const TNONE = 0\n/** @internal */\nconst TERROR = 1\n/** @internal */\nconst TWARN = 2\n/** @internal */\nconst TMESG = 4\n/** @internal */\nconst TSUCCESS = 8\n/** @internal */\nconst TINFO = 16\n/** @internal */\nconst TDEBUG = 32\n/** @internal */\nconst TALL = 63\n\n/** @internal */\nexport enum LogLevel {\n Error = TERROR,\n Warning = TWARN,\n Message = TMESG,\n Success = TSUCCESS,\n Info = TINFO,\n Debug = TDEBUG,\n All = TALL\n}\n\n/** @internal */\nlet _level: number = TERROR + TWARN + TMESG\n/** @internal */\nlet _ascending: boolean = false\n/** @internal */\nlet _dom: HTMLDocument = document // must be able to override for tests\n/** @internal */\nlet _window: Window = window // must be able to override for tests\n\n/** @internal */\nfunction log (str: string, type: number = TMESG, typestr: string = 'mesg') {\n if (!(_level & type)) return // bitmask\n\n if (typeof _dom !== 'undefined') {\n const logArea = _dom.getElementById('status')\n if (!logArea) return\n\n const addendum = _dom.createElement('span')\n addendum.setAttribute('class', typestr)\n const now = new Date()\n addendum.innerHTML = `${now.getHours()}:${now.getMinutes()}:${now.getSeconds()} [${typestr}] ${escapeForXML(str)}<br/>`\n if (_ascending) {\n logArea.insertBefore(addendum, logArea.firstChild)\n } else {\n logArea.appendChild(addendum)\n }\n } else if (typeof console !== 'undefined') {\n console.log(str)\n }\n}\n\n/**\n * Adds a message to the element with id \"status\". The messages are prepended with\n * time and type of message, in this case [mesg].\n */\nexport function msg (message: string) {\n log(message)\n}\n\n/**\n * Adds a warning message to the element with id \"status\". The messages are\n * prepended with time and type of message, in this case [warn].\n */\nexport function warn (message: string): void {\n log(message, TWARN, 'warn')\n}\n\n/**\n * Adds a debugging message to the element with id \"status\". The messages are\n * prepended with time and type of message, in this case [dbug].\n */\nexport function debug (message: string): void {\n log(message, TDEBUG, 'dbug')\n}\n\n/**\n * Adds a info message to the element with id \"status\". The messages are\n * prepended with time and type of message, in this case [info].\n */\nexport function info (message: string): void {\n log(message, TINFO, 'info')\n}\n\n/**\n * Adds a error to the element with id \"status\". The messages are\n * prepended with time and type of message, in this case [eror].\n */\nexport function error (message: string): void {\n log(message, TERROR, 'eror')\n}\n\n/**\n * Adds a success message to the element with id \"status\". The messages are\n * prepended with time and type of message, in this case [good].\n */\nexport function success (message: string): void {\n log(message, TSUCCESS, 'good')\n}\n\n/**\n * Uses the global alert to send an alert. If global alert is not available, it\n * will output the message using the method [[warning]]s.\n */\nexport function alert (message: string): void {\n if (_window && typeof _window.alert !== 'undefined') {\n _window.alert(message)\n } else {\n warn(message)\n }\n}\n\n/**\n * Will clear the content of the element with id \"status\".\n */\nexport function clear (): void {\n const logArea = _dom?.getElementById('status')\n if (!logArea) return\n logArea.innerHTML = ''\n}\n\n/**\n * Lets you configure which types of messages will be shown. The module uses\n * [bitmask](https://en.wikipedia.org/wiki/Mask_(computing)) to filter which\n * types of messages should be shown. E.g. if you only want warning messages\n * to be shown, pass 2 to the function, if you want warning and success to be\n * shown, pass 10 (2+8). By passing the sum of all, 63, you'll show all\n * types of messages.\n *\n * - Error: 1\n * - Warning: 2\n * - Message: 4\n * - Success: 8\n * - Info: 16\n * - Debug: 32\n */\nexport function setLevel (level: number): void {\n _level = TALL\n debug('Log level is now ' + level)\n _level = level\n}\n\n/**\n * Will dump the current HTML using the [[debug]] method.\n */\nexport function dumpHTML (): void {\n if (!_dom) return\n const level = _level\n _level = TALL\n debug(_dom?.body?.innerHTML || '')\n _level = level\n}\n\n/**\n * Will start prepending messages the list of log messages.\n */\nexport function logAscending () {\n _ascending = true\n}\n\n/**\n * Will start appending messages the list of log messages. (This is default\n * behavior.)\n */\nexport function logDescending () {\n _ascending = false\n}\n\n/** @internal */\nexport function escapeForXML (str: string): string {\n // can be replaced with function utils module when migrating\n return str\n .replace(/&/g, '&amp;')\n .replace(/</g, '&lt;')\n .replace(/>/g, '&gt;')\n}\n\n/** @internal */\nexport function setInternals (window, document) {\n _window = window\n _dom = document\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;IAKM,IAAS,GAET,IAAQ,GAER,IAAQ,GAER,IAAW,GAEX,IAAQ,IAER,IAAS,IAET,IAAO,IAGD,IAAL,yBAAA,GAAA;QACL,EAAA,EAAA,QAAQ,KAAA,SACR,EAAA,EAAA,UAAU,KAAA,WACV,EAAA,EAAA,UAAU,KAAA,WACV,EAAA,EAAA,UAAU,KAAA,WACV,EAAA,EAAA,OAAO,KAAA,QACP,EAAA,EAAA,QAAQ,KAAA,SACR,EAAA,EAAA,MAAM,KAAA;AACR,EAAA,CAAA,CAAA,GAGI,IAAiB,GAEjB,IAAsB,IAEtB,IAAqB,UAErB,IAAkB;AAGtB,SA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