profile-pane 3.1.5 → 3.2.0

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 (311) hide show
  1. package/README.md +16 -0
  2. package/lib/04567ff683933c35c465.png +0 -0
  3. package/lib/10163fd9b5a0e00d63a0.png +0 -0
  4. package/lib/1234dcb2eec2e45f252b.png +0 -0
  5. package/lib/20899934157df4db56cb.png +0 -0
  6. package/lib/33760bf79f097f449da5.png +0 -0
  7. package/lib/578d2b6ed32e7624164e.png +0 -0
  8. package/lib/5f62a5b2b7e99b9640c7.png +0 -0
  9. package/lib/6525766ecd288ec60129.png +0 -0
  10. package/lib/7800be6f6c4b5b0f4f20.png +0 -0
  11. package/lib/976473cf5fe24d657d4b.png +0 -0
  12. package/lib/ChatWithMe.d.ts +2 -1
  13. package/lib/ChatWithMe.d.ts.map +1 -1
  14. package/lib/ChatWithMe.js +3 -3
  15. package/lib/ProfileView.d.ts +1 -1
  16. package/lib/ProfileView.d.ts.map +1 -1
  17. package/lib/ProfileView.js +71 -131
  18. package/lib/ProfileViewModelPresenter.d.ts +23 -0
  19. package/lib/ProfileViewModelPresenter.d.ts.map +1 -0
  20. package/lib/ProfileViewModelPresenter.js +37 -0
  21. package/lib/QRCodeCard.d.ts +3 -1
  22. package/lib/QRCodeCard.d.ts.map +1 -1
  23. package/lib/QRCodeCard.js +86 -66
  24. package/lib/addMeToYourFriends.d.ts +3 -3
  25. package/lib/addMeToYourFriends.d.ts.map +1 -1
  26. package/lib/addMeToYourFriends.js +14 -30
  27. package/lib/bda84f59e7216675a208.png +0 -0
  28. package/lib/buttonsHelper.js +1 -1
  29. package/lib/cd68e8f3990ba8b2139e.png +0 -0
  30. package/lib/e7074a7e2cb69e51cfd3.png +0 -0
  31. package/lib/editProfilePane/EditCVCard.d.ts +1 -0
  32. package/lib/editProfilePane/EditCVCard.d.ts.map +1 -1
  33. package/lib/editProfilePane/EditCVCard.js +2 -1
  34. package/lib/editProfilePane/EditCommunitiesCard.d.ts +1 -1
  35. package/lib/editProfilePane/EditCommunitiesCard.d.ts.map +1 -1
  36. package/lib/editProfilePane/EditCommunitiesCard.js +2 -1
  37. package/lib/editProfilePane/EditContactsCard.d.ts +1 -0
  38. package/lib/editProfilePane/EditContactsCard.d.ts.map +1 -1
  39. package/lib/editProfilePane/EditContactsCard.js +2 -0
  40. package/lib/editProfilePane/EditFriendsCard.d.ts +1 -1
  41. package/lib/editProfilePane/EditFriendsCard.d.ts.map +1 -1
  42. package/lib/editProfilePane/EditFriendsCard.js +2 -1
  43. package/lib/editProfilePane/EditOtherPreferences.d.ts +1 -0
  44. package/lib/editProfilePane/EditOtherPreferences.d.ts.map +1 -1
  45. package/lib/editProfilePane/EditOtherPreferences.js +1 -0
  46. package/lib/editProfilePane/EditProfileView.d.ts +1 -1
  47. package/lib/editProfilePane/EditProfileView.d.ts.map +1 -1
  48. package/lib/editProfilePane/EditProfileView.js +1 -1
  49. package/lib/editProfilePane/EditSocialCard.d.ts +1 -0
  50. package/lib/editProfilePane/EditSocialCard.d.ts.map +1 -1
  51. package/lib/editProfilePane/EditSocialCard.js +2 -1
  52. package/lib/editProfilePane/editProfilePresenter.d.ts +1 -0
  53. package/lib/editProfilePane/editProfilePresenter.d.ts.map +1 -1
  54. package/lib/editProfilePane/editProfilePresenter.js +2 -0
  55. package/lib/f3772696fb7ee53c23d8.png +0 -0
  56. package/lib/icons-svg/contactIcons.d.ts +3 -0
  57. package/lib/icons-svg/contactIcons.d.ts.map +1 -0
  58. package/lib/icons-svg/contactIcons.js +32 -0
  59. package/lib/icons-svg/profileIcons.d.ts +22 -0
  60. package/lib/icons-svg/profileIcons.d.ts.map +1 -0
  61. package/lib/icons-svg/profileIcons.js +309 -0
  62. package/lib/index.d.ts +1 -3
  63. package/lib/index.d.ts.map +1 -1
  64. package/lib/index.js +42 -19
  65. package/lib/profile-pane.js +15629 -5670
  66. package/lib/profile-pane.js.map +1 -1
  67. package/lib/profile-pane.min.js +2171 -230
  68. package/lib/profile-pane.min.js.map +1 -1
  69. package/lib/rdfFormsHelper.d.ts +1 -0
  70. package/lib/rdfFormsHelper.d.ts.map +1 -1
  71. package/lib/rdfFormsHelper.js +2 -0
  72. package/lib/sections/bio/BioEditDialog.d.ts +6 -0
  73. package/lib/sections/bio/BioEditDialog.d.ts.map +1 -0
  74. package/lib/sections/bio/BioEditDialog.js +119 -0
  75. package/lib/sections/bio/BioSection.d.ts +7 -0
  76. package/lib/sections/bio/BioSection.d.ts.map +1 -0
  77. package/lib/sections/bio/BioSection.js +131 -0
  78. package/lib/sections/bio/mutations.d.ts +4 -0
  79. package/lib/sections/bio/mutations.d.ts.map +1 -0
  80. package/lib/sections/bio/mutations.js +43 -0
  81. package/lib/sections/bio/selectors.d.ts +4 -0
  82. package/lib/sections/bio/selectors.d.ts.map +1 -0
  83. package/lib/sections/bio/selectors.js +15 -0
  84. package/lib/sections/bio/types.d.ts +15 -0
  85. package/lib/sections/bio/types.d.ts.map +1 -0
  86. package/lib/sections/bio/types.js +5 -0
  87. package/lib/sections/contactInfo/ContactInfoEditDialog.d.ts +7 -0
  88. package/lib/sections/contactInfo/ContactInfoEditDialog.d.ts.map +1 -0
  89. package/lib/sections/contactInfo/ContactInfoEditDialog.js +658 -0
  90. package/lib/sections/contactInfo/ContactInfoSection.d.ts +5 -0
  91. package/lib/sections/contactInfo/ContactInfoSection.d.ts.map +1 -0
  92. package/lib/sections/contactInfo/ContactInfoSection.js +229 -0
  93. package/lib/sections/contactInfo/mutations.d.ts +4 -0
  94. package/lib/sections/contactInfo/mutations.d.ts.map +1 -0
  95. package/lib/sections/contactInfo/mutations.js +150 -0
  96. package/lib/sections/contactInfo/selectors.d.ts +4 -0
  97. package/lib/sections/contactInfo/selectors.d.ts.map +1 -0
  98. package/lib/sections/contactInfo/selectors.js +104 -0
  99. package/lib/sections/contactInfo/types.d.ts +44 -0
  100. package/lib/sections/contactInfo/types.d.ts.map +1 -0
  101. package/lib/sections/contactInfo/types.js +5 -0
  102. package/lib/sections/education/EducationEditDialog.d.ts +7 -0
  103. package/lib/sections/education/EducationEditDialog.d.ts.map +1 -0
  104. package/lib/sections/education/EducationEditDialog.js +459 -0
  105. package/lib/sections/education/EducationSection.d.ts +7 -0
  106. package/lib/sections/education/EducationSection.d.ts.map +1 -0
  107. package/lib/sections/education/EducationSection.js +126 -0
  108. package/lib/sections/education/mutations.d.ts +4 -0
  109. package/lib/sections/education/mutations.d.ts.map +1 -0
  110. package/lib/sections/education/mutations.js +60 -0
  111. package/lib/sections/education/selectors.d.ts +4 -0
  112. package/lib/sections/education/selectors.d.ts.map +1 -0
  113. package/lib/sections/education/selectors.js +64 -0
  114. package/lib/sections/education/types.d.ts +20 -0
  115. package/lib/sections/education/types.d.ts.map +1 -0
  116. package/lib/sections/education/types.js +5 -0
  117. package/lib/sections/heading/HeadingEditDialog.d.ts +6 -0
  118. package/lib/sections/heading/HeadingEditDialog.d.ts.map +1 -0
  119. package/lib/sections/heading/HeadingEditDialog.js +742 -0
  120. package/lib/sections/heading/HeadingSection.d.ts +9 -0
  121. package/lib/sections/heading/HeadingSection.d.ts.map +1 -0
  122. package/lib/sections/heading/HeadingSection.js +97 -0
  123. package/lib/sections/heading/camera.d.ts +19 -0
  124. package/lib/sections/heading/camera.d.ts.map +1 -0
  125. package/lib/sections/heading/camera.js +199 -0
  126. package/lib/sections/heading/dateHelpers.d.ts +4 -0
  127. package/lib/sections/heading/dateHelpers.d.ts.map +1 -0
  128. package/lib/sections/heading/dateHelpers.js +48 -0
  129. package/lib/sections/heading/imageHelpers.d.ts +4 -0
  130. package/lib/sections/heading/imageHelpers.d.ts.map +1 -0
  131. package/lib/sections/heading/imageHelpers.js +81 -0
  132. package/lib/sections/heading/mutations.d.ts +4 -0
  133. package/lib/sections/heading/mutations.d.ts.map +1 -0
  134. package/lib/sections/heading/mutations.js +190 -0
  135. package/lib/sections/heading/selectors.d.ts +5 -0
  136. package/lib/sections/heading/selectors.d.ts.map +1 -0
  137. package/lib/sections/heading/selectors.js +157 -0
  138. package/lib/sections/heading/types.d.ts +36 -0
  139. package/lib/sections/heading/types.d.ts.map +1 -0
  140. package/lib/sections/heading/types.js +5 -0
  141. package/lib/sections/languages/LanguageEditDialog.d.ts +7 -0
  142. package/lib/sections/languages/LanguageEditDialog.d.ts.map +1 -0
  143. package/lib/sections/languages/LanguageEditDialog.js +457 -0
  144. package/lib/sections/languages/LanguageSection.d.ts +5 -0
  145. package/lib/sections/languages/LanguageSection.d.ts.map +1 -0
  146. package/lib/sections/languages/LanguageSection.js +137 -0
  147. package/lib/sections/languages/mutations.d.ts +6 -0
  148. package/lib/sections/languages/mutations.d.ts.map +1 -0
  149. package/lib/sections/languages/mutations.js +296 -0
  150. package/lib/sections/languages/selectors.d.ts +5 -0
  151. package/lib/sections/languages/selectors.d.ts.map +1 -0
  152. package/lib/sections/languages/selectors.js +146 -0
  153. package/lib/sections/languages/types.d.ts +15 -0
  154. package/lib/sections/languages/types.d.ts.map +1 -0
  155. package/lib/sections/languages/types.js +5 -0
  156. package/lib/sections/projects/ProjectEditDialog.d.ts +7 -0
  157. package/lib/sections/projects/ProjectEditDialog.d.ts.map +1 -0
  158. package/lib/sections/projects/ProjectEditDialog.js +182 -0
  159. package/lib/sections/projects/ProjectSection.d.ts +6 -0
  160. package/lib/sections/projects/ProjectSection.d.ts.map +1 -0
  161. package/lib/sections/projects/ProjectSection.js +220 -0
  162. package/lib/sections/projects/mutations.d.ts +4 -0
  163. package/lib/sections/projects/mutations.d.ts.map +1 -0
  164. package/lib/sections/projects/mutations.js +188 -0
  165. package/lib/sections/projects/selectors.d.ts +5 -0
  166. package/lib/sections/projects/selectors.d.ts.map +1 -0
  167. package/lib/sections/projects/selectors.js +163 -0
  168. package/lib/sections/projects/types.d.ts +28 -0
  169. package/lib/sections/projects/types.d.ts.map +1 -0
  170. package/lib/sections/projects/types.js +8 -0
  171. package/lib/sections/resume/ResumeEditDialog.d.ts +7 -0
  172. package/lib/sections/resume/ResumeEditDialog.d.ts.map +1 -0
  173. package/lib/sections/resume/ResumeEditDialog.js +629 -0
  174. package/lib/sections/resume/ResumeSection.d.ts +7 -0
  175. package/lib/sections/resume/ResumeSection.d.ts.map +1 -0
  176. package/lib/sections/resume/ResumeSection.js +160 -0
  177. package/lib/sections/resume/mutations.d.ts +6 -0
  178. package/lib/sections/resume/mutations.d.ts.map +1 -0
  179. package/lib/sections/resume/mutations.js +172 -0
  180. package/lib/sections/resume/selectors.d.ts +4 -0
  181. package/lib/sections/resume/selectors.d.ts.map +1 -0
  182. package/lib/sections/resume/selectors.js +142 -0
  183. package/lib/sections/resume/types.d.ts +33 -0
  184. package/lib/sections/resume/types.d.ts.map +1 -0
  185. package/lib/sections/resume/types.js +8 -0
  186. package/lib/sections/shared/collapsibleSection.d.ts +2 -0
  187. package/lib/sections/shared/collapsibleSection.d.ts.map +1 -0
  188. package/lib/sections/shared/collapsibleSection.js +24 -0
  189. package/lib/sections/shared/contactTypeUtils.d.ts +7 -0
  190. package/lib/sections/shared/contactTypeUtils.d.ts.map +1 -0
  191. package/lib/sections/shared/contactTypeUtils.js +48 -0
  192. package/lib/sections/shared/idNodeFactory.d.ts +3 -0
  193. package/lib/sections/shared/idNodeFactory.d.ts.map +1 -0
  194. package/lib/sections/shared/idNodeFactory.js +14 -0
  195. package/lib/sections/shared/phoneCountries.d.ts +20 -0
  196. package/lib/sections/shared/phoneCountries.d.ts.map +1 -0
  197. package/lib/sections/shared/phoneCountries.js +1080 -0
  198. package/lib/sections/shared/rdfList.d.ts +3 -0
  199. package/lib/sections/shared/rdfList.d.ts.map +1 -0
  200. package/lib/sections/shared/rdfList.js +34 -0
  201. package/lib/sections/shared/rdfMutationHelpers.d.ts +12 -0
  202. package/lib/sections/shared/rdfMutationHelpers.d.ts.map +1 -0
  203. package/lib/sections/shared/rdfMutationHelpers.js +82 -0
  204. package/lib/sections/shared/rowState.d.ts +21 -0
  205. package/lib/sections/shared/rowState.d.ts.map +1 -0
  206. package/lib/sections/shared/rowState.js +52 -0
  207. package/lib/sections/shared/sanitizeUtils.d.ts +5 -0
  208. package/lib/sections/shared/sanitizeUtils.d.ts.map +1 -0
  209. package/lib/sections/shared/sanitizeUtils.js +22 -0
  210. package/lib/sections/shared/sectionCardHelpers.d.ts +11 -0
  211. package/lib/sections/shared/sectionCardHelpers.d.ts.map +1 -0
  212. package/lib/sections/shared/sectionCardHelpers.js +105 -0
  213. package/lib/sections/shared/types.d.ts +7 -0
  214. package/lib/sections/shared/types.d.ts.map +1 -0
  215. package/lib/sections/shared/types.js +5 -0
  216. package/lib/sections/skills/SkillsEditDialog.d.ts +7 -0
  217. package/lib/sections/skills/SkillsEditDialog.d.ts.map +1 -0
  218. package/lib/sections/skills/SkillsEditDialog.js +340 -0
  219. package/lib/sections/skills/SkillsSection.d.ts +5 -0
  220. package/lib/sections/skills/SkillsSection.d.ts.map +1 -0
  221. package/lib/sections/skills/SkillsSection.js +169 -0
  222. package/lib/sections/skills/mutations.d.ts +6 -0
  223. package/lib/sections/skills/mutations.d.ts.map +1 -0
  224. package/lib/sections/skills/mutations.js +110 -0
  225. package/lib/sections/skills/selectors.d.ts +6 -0
  226. package/lib/sections/skills/selectors.d.ts.map +1 -0
  227. package/lib/sections/skills/selectors.js +37 -0
  228. package/lib/sections/skills/types.d.ts +14 -0
  229. package/lib/sections/skills/types.d.ts.map +1 -0
  230. package/lib/sections/skills/types.js +5 -0
  231. package/lib/sections/social/SocialEditDialog.d.ts +7 -0
  232. package/lib/sections/social/SocialEditDialog.d.ts.map +1 -0
  233. package/lib/sections/social/SocialEditDialog.js +362 -0
  234. package/lib/sections/social/SocialSection.d.ts +8 -0
  235. package/lib/sections/social/SocialSection.d.ts.map +1 -0
  236. package/lib/sections/social/SocialSection.js +201 -0
  237. package/lib/sections/social/constants.d.ts +3 -0
  238. package/lib/sections/social/constants.d.ts.map +1 -0
  239. package/lib/sections/social/constants.js +16 -0
  240. package/lib/sections/social/helpers.d.ts +15 -0
  241. package/lib/sections/social/helpers.d.ts.map +1 -0
  242. package/lib/sections/social/helpers.js +316 -0
  243. package/lib/sections/social/mutations.d.ts +4 -0
  244. package/lib/sections/social/mutations.d.ts.map +1 -0
  245. package/lib/sections/social/mutations.js +298 -0
  246. package/lib/sections/social/selectors.d.ts +4 -0
  247. package/lib/sections/social/selectors.d.ts.map +1 -0
  248. package/lib/sections/social/selectors.js +43 -0
  249. package/lib/sections/social/types.d.ts +19 -0
  250. package/lib/sections/social/types.d.ts.map +1 -0
  251. package/lib/sections/social/types.js +5 -0
  252. package/lib/styles/BioSection.css +77 -0
  253. package/lib/styles/CVCard.css +107 -2
  254. package/lib/styles/ContactInfoEditDialog.css +153 -0
  255. package/lib/styles/EditDialogs.css +1028 -0
  256. package/lib/styles/EducationCard.css +103 -0
  257. package/lib/styles/HeadingSection.css +309 -0
  258. package/lib/styles/ProfileCard.css +10 -42
  259. package/lib/styles/ProfileView.css +53 -8
  260. package/lib/styles/ProjectsCard.css +206 -0
  261. package/lib/styles/QRCodeCard.css +29 -10
  262. package/lib/styles/SocialCard.css +41 -13
  263. package/lib/styles/dialog.css +209 -0
  264. package/lib/styles/utilities.css +638 -256
  265. package/lib/textUtils.d.ts +6 -0
  266. package/lib/textUtils.d.ts.map +1 -0
  267. package/lib/textUtils.js +44 -0
  268. package/lib/texts.d.ts +45 -4
  269. package/lib/texts.d.ts.map +1 -1
  270. package/lib/texts.js +46 -5
  271. package/lib/types.d.ts +2 -0
  272. package/lib/types.d.ts.map +1 -0
  273. package/lib/types.js +5 -0
  274. package/lib/ui/dialog.d.ts +29 -0
  275. package/lib/ui/dialog.d.ts.map +1 -0
  276. package/lib/ui/dialog.js +269 -0
  277. package/lib/ui/errors.d.ts +2 -0
  278. package/lib/ui/errors.d.ts.map +1 -0
  279. package/lib/ui/errors.js +10 -0
  280. package/package.json +6 -4
  281. package/lib/CVCard.d.ts +0 -4
  282. package/lib/CVCard.d.ts.map +0 -1
  283. package/lib/CVCard.js +0 -114
  284. package/lib/CVPresenter.d.ts +0 -25
  285. package/lib/CVPresenter.d.ts.map +0 -1
  286. package/lib/CVPresenter.js +0 -119
  287. package/lib/FriendList.d.ts +0 -6
  288. package/lib/FriendList.d.ts.map +0 -1
  289. package/lib/FriendList.js +0 -27
  290. package/lib/ProfileCard.d.ts +0 -6
  291. package/lib/ProfileCard.d.ts.map +0 -1
  292. package/lib/ProfileCard.js +0 -62
  293. package/lib/SocialCard.d.ts +0 -5
  294. package/lib/SocialCard.d.ts.map +0 -1
  295. package/lib/SocialCard.js +0 -51
  296. package/lib/SocialPresenter.d.ts +0 -11
  297. package/lib/SocialPresenter.d.ts.map +0 -1
  298. package/lib/SocialPresenter.js +0 -117
  299. package/lib/StuffCard.d.ts +0 -10
  300. package/lib/StuffCard.d.ts.map +0 -1
  301. package/lib/StuffCard.js +0 -52
  302. package/lib/StuffPresenter.d.ts +0 -14
  303. package/lib/StuffPresenter.d.ts.map +0 -1
  304. package/lib/StuffPresenter.js +0 -53
  305. package/lib/presenter.d.ts +0 -14
  306. package/lib/presenter.d.ts.map +0 -1
  307. package/lib/presenter.js +0 -68
  308. package/lib/styles/FriendList.css +0 -12
  309. package/lib/styles/StuffCard.css +0 -23
  310. package/lib/styles/editProfile.css +0 -62
  311. package/lib/styles/profileRDFFormsEnforced.css +0 -431
package/README.md CHANGED
@@ -20,6 +20,22 @@ To run all tests:
20
20
  npm test
21
21
  ```
22
22
 
23
+ Focused accessibility check:
24
+ ```shell script
25
+ npm test -- test/profile-view.accessibility.test.ts
26
+ ```
27
+
28
+ Accessibility markup baseline checklist:
29
+ [docs/accessibility-baseline-checklist.md](docs/accessibility-baseline-checklist.md)
30
+
31
+ Refactor test plan (temporary skips and revisit checklist):
32
+ [docs/refactor-test-plan.md](docs/refactor-test-plan.md)
33
+
34
+ ### Legacy Files
35
+
36
+ Legacy refactor artifacts are kept in [src/legacy](src/legacy).
37
+ These files are intentionally retained for historical/reference purposes and are not part of the active sections-based flow.
38
+
23
39
  If you are a first time developer/user on Windows 10, the repository may give package issues regarding webpack or jest.
24
40
  If this is the case, simply run "npm audit fix" and upgrade the repository. It should work fine.
25
41
 
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -1,6 +1,7 @@
1
1
  import { TemplateResult } from 'lit-html';
2
2
  import { DataBrowserContext } from 'pane-registry';
3
3
  import { NamedNode } from 'rdflib';
4
+ import { ViewerMode } from './types';
4
5
  import './styles/ChatWithMe.css';
5
- export declare const ChatWithMe: (subject: NamedNode, context: DataBrowserContext) => TemplateResult;
6
+ export declare const ChatWithMe: (subject: NamedNode, context: DataBrowserContext, viewerMode: ViewerMode) => TemplateResult;
6
7
  //# sourceMappingURL=ChatWithMe.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ChatWithMe.d.ts","sourceRoot":"","sources":["../src/ChatWithMe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,cAAc,EAAE,MAAM,UAAU,CAAA;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;AAMlC,OAAO,yBAAyB,CAAA;AAEhC,eAAO,MAAM,UAAU,GACrB,SAAS,SAAS,EAClB,SAAS,kBAAkB,KAC1B,cA0FF,CAAA"}
1
+ {"version":3,"file":"ChatWithMe.d.ts","sourceRoot":"","sources":["../src/ChatWithMe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,cAAc,EAAE,MAAM,UAAU,CAAA;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;AAMlC,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AACpC,OAAO,yBAAyB,CAAA;AAGhC,eAAO,MAAM,UAAU,GACrB,SAAS,SAAS,EAClB,SAAS,kBAAkB,EAC3B,YAAY,UAAU,KACrB,cA0FF,CAAA"}
package/lib/ChatWithMe.js CHANGED
@@ -11,7 +11,7 @@ var _asyncReplace = require("lit-html/directives/async-replace.js");
11
11
  var _texts = require("./texts");
12
12
  var _buttonsHelper = require("./buttonsHelper");
13
13
  require("./styles/ChatWithMe.css");
14
- const ChatWithMe = (subject, context) => {
14
+ const ChatWithMe = (subject, context, viewerMode) => {
15
15
  const logic = context.session.logic;
16
16
  const longChatPane = context.session.paneRegistry.byName('long chat');
17
17
  async function* chatContainer() {
@@ -31,7 +31,7 @@ const ChatWithMe = (subject, context) => {
31
31
  try {
32
32
  yield (0, _litHtml.html)`
33
33
  <div class="buttonSubSection">
34
- <div class="actionButton loading-text center" role="status" aria-live="polite">
34
+ <div class="profile__action-button loading-text center" role="status" aria-live="polite">
35
35
  ${_texts.loadingMessage.toUpperCase()}
36
36
  </div>
37
37
  </div>
@@ -79,7 +79,7 @@ const ChatWithMe = (subject, context) => {
79
79
  description.id = 'chat-button-description';
80
80
  description.className = 'sr-only';
81
81
  description.textContent = 'Start a new conversation or sign in to continue existing chat';
82
- button.classList.add('actionButton', 'btn-primary', 'action-button-focus');
82
+ button.classList.add('profile__action-button', 'btn-primary', 'action-button-focus');
83
83
  chatContainer.appendChild(button);
84
84
  chatContainer.appendChild(description);
85
85
  yield chatContainer;
@@ -2,5 +2,5 @@ import { TemplateResult } from 'lit-html';
2
2
  import { DataBrowserContext } from 'pane-registry';
3
3
  import { NamedNode } from 'rdflib';
4
4
  import './styles/ProfileView.css';
5
- export declare function ProfileView(subject: NamedNode, context: DataBrowserContext): Promise<TemplateResult>;
5
+ export declare function ProfileView(subject: NamedNode, context: DataBrowserContext, onSaved?: () => Promise<void> | void): Promise<TemplateResult>;
6
6
  //# sourceMappingURL=ProfileView.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ProfileView.d.ts","sourceRoot":"","sources":["../src/ProfileView.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,cAAc,EAAE,MAAM,UAAU,CAAA;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AAClD,OAAO,EAAE,SAAS,EAAa,MAAM,QAAQ,CAAA;AAC7C,OAAO,0BAA0B,CAAA;AA+BjC,wBAAsB,WAAW,CAC/B,OAAO,EAAE,SAAS,EAClB,OAAO,EAAE,kBAAkB,GAC1B,OAAO,CAAE,cAAc,CAAC,CAmH1B"}
1
+ {"version":3,"file":"ProfileView.d.ts","sourceRoot":"","sources":["../src/ProfileView.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,cAAc,EAAE,MAAM,UAAU,CAAA;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AAClD,OAAO,EAAE,SAAS,EAAa,MAAM,QAAQ,CAAA;AAE7C,OAAO,0BAA0B,CAAA;AAgEjC,wBAAsB,WAAW,CAC/B,OAAO,EAAE,SAAS,EAClB,OAAO,EAAE,kBAAkB,EAC3B,OAAO,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,GACnC,OAAO,CAAE,cAAc,CAAC,CAsC1B"}
@@ -5,145 +5,85 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.ProfileView = ProfileView;
7
7
  var _litHtml = require("lit-html");
8
+ var _solidLogic = require("solid-logic");
8
9
  require("./styles/ProfileView.css");
9
- var _ChatWithMe = require("./ChatWithMe");
10
- var _FriendList = require("./FriendList");
11
- var _presenter = require("./presenter");
12
- var _CVPresenter = require("./CVPresenter");
13
- var _SocialPresenter = require("./SocialPresenter");
14
- var _StuffPresenter = require("./StuffPresenter");
15
- var _ProfileCard = require("./ProfileCard");
16
- var _CVCard = require("./CVCard");
17
- var _SocialCard = require("./SocialCard");
18
- var _StuffCard = require("./StuffCard");
19
- var _texts = require("./texts");
20
- // 20210527
21
- // 20210527
22
- // 20210527
23
-
24
- // The edit button switches to the editor pane
25
- /*
26
- function renderEditButton (subject) {
27
- return
28
- authn.currentUser() && authn.currentUser().sameTerm(subject) ?
29
- html `<button type="button" class="ProfilePaneCVEditButton">
30
- <img src="${editButtonURI}">
31
- Edit</button>`
32
- : html``;
10
+ var _QRCodeCard = require("./QRCodeCard");
11
+ var _ProfileViewModelPresenter = require("./ProfileViewModelPresenter");
12
+ var _ContactInfoSection = require("./sections/contactInfo/ContactInfoSection");
13
+ var _LanguageSection = require("./sections/languages/LanguageSection");
14
+ var _SkillsSection = require("./sections/skills/SkillsSection");
15
+ var _ResumeSection = require("./sections/resume/ResumeSection");
16
+ var _ProjectSection = require("./sections/projects/ProjectSection");
17
+ var _HeadingSection = require("./sections/heading/HeadingSection");
18
+ var _BioSection = require("./sections/bio/BioSection");
19
+ var _SocialSection = require("./sections/social/SocialSection");
20
+ function getViewerMode(subject) {
21
+ let mode = 'anonymous';
22
+ if (_solidLogic.authn.currentUser() && _solidLogic.authn.currentUser().sameTerm(subject)) mode = 'owner';
23
+ if (_solidLogic.authn.currentUser() && !_solidLogic.authn.currentUser().sameTerm(subject)) mode = 'authenticated';
24
+ return mode;
33
25
  }
34
- */
35
-
36
- async function ProfileView(subject, context) {
26
+ function renderSidebar(store, subject, accounts, skills, languages, contactInfo, viewerMode, onSaved) {
27
+ return (0, _litHtml.html)`
28
+ <aside
29
+ aria-labelledby="sidebar-heading"
30
+ class="profile__sidebar p-sm"
31
+ >
32
+ <h2 id="sidebar-heading" class="sr-only">Sidebar</h2>
33
+ <div aria-label="Sidebar Content" class="flex-column gap-md">
34
+ ${(0, _SocialSection.renderSocialAccounts)(store, subject, accounts, viewerMode, onSaved)}
35
+ ${(0, _SkillsSection.renderSkillsSection)(store, subject, skills, viewerMode, onSaved)}
36
+ ${(0, _LanguageSection.renderLanguageSection)(store, subject, languages, viewerMode, onSaved)}
37
+ ${(0, _ContactInfoSection.renderContactInfoSection)(store, subject, contactInfo, viewerMode, onSaved)}
38
+ ${renderQRCode(subject, store)}
39
+ </div>
40
+ </aside>
41
+ `;
42
+ }
43
+ function renderQRCode(subject, store) {
44
+ return (0, _litHtml.html)`
45
+ <section class="profile__section border-lighter profile__qr-code" aria-labelledby="qr-heading" tabindex="-1">
46
+ <h2 id="qr-heading" class="sr-only">QR code</h2>
47
+ <div class="qrcode-card__frame flex-center">
48
+ ${(0, _QRCodeCard.QRCodeCard)(subject, store)}
49
+ </div>
50
+ </section>
51
+ `;
52
+ }
53
+ async function ProfileView(subject, context, onSaved) {
37
54
  const store = context.session.store;
38
- const profileBasics = (0, _presenter.presentProfile)(subject, store);
39
- const rolesByType = (0, _CVPresenter.presentCV)(subject, store);
40
- const accounts = (0, _SocialPresenter.presentSocial)(subject, store);
41
- const stuffData = await (0, _StuffPresenter.presentStuff)(subject);
55
+ const viewerMode = getViewerMode(subject);
56
+ const viewModel = await (0, _ProfileViewModelPresenter.presentProfileViewModel)(subject, store);
57
+ const profileDetails = viewModel.profileDetails;
58
+ const rolesByType = viewModel.cvDetails;
59
+ const skills = viewModel.skills;
60
+ const languages = viewModel.languages;
61
+ const projects = viewModel.projects;
62
+ const bioDetails = viewModel.bioDetails;
63
+ const accounts = viewModel.social;
64
+ const contactInfo = viewModel.contactInfo;
42
65
  return (0, _litHtml.html)`
43
- <main
44
- id="main-content"
45
- class="profile-grid"
46
- style="--profile-grid-bg: radial-gradient(circle, ${profileBasics.backgroundColor} 80%, ${profileBasics.highlightColor} 100%)"
47
- role="main"
48
- aria-label="Profile for ${profileBasics.name}"
49
- tabindex="-1"
50
- >
51
-
52
- <article
53
- aria-labelledby="profile-card-heading"
54
- class="profileSection section-bg"
55
- role="region"
66
+ <div class="profile-pane-root">
67
+ <main
68
+ id="main-content"
69
+ class="profile-grid"
56
70
  tabindex="-1"
57
- >
58
- <header class="text-center mb-md">
59
- <h2 id="profile-card-heading" tabindex="-1">${profileBasics.name}</h2>
60
- </header>
61
- ${(0, _ProfileCard.ProfileCard)(profileBasics, context, subject)}
62
- </article>
71
+ >
72
+ <h1 id="profile-content-heading" class="sr-only">Profile for ${profileDetails.name}</h1>
63
73
 
64
- ${(() => {
65
- const cv = (0, _CVCard.CVCard)(rolesByType);
66
- return cv && cv.strings && cv.strings.join('').trim() !== '' ? (0, _litHtml.html)`
67
- <section
68
- aria-labelledby="cv-heading"
69
- class="profileSection section-bg"
70
- role="region"
71
- tabindex="-1"
74
+ <section
75
+ class="profile__main flex-column gap-md p-sm"
72
76
  >
73
- <header class="text-center mb-md">
74
- <h2 id="cv-heading" tabindex="-1">${_texts.resumeHeadingText}</h2>
75
- </header>
76
- <div>
77
- ${cv}
78
- </div>
79
- </section>
80
- ` : '';
81
- })()}
82
-
83
- ${accounts.accounts && accounts.accounts.length > 0 ? (0, _litHtml.html)`
84
- <aside
85
- aria-labelledby="social-heading"
86
- class="profileSection section-bg"
87
- role="complementary"
88
- tabindex="-1"
89
- >
90
- <header class="text-center mb-md">
91
- <h2 id="social-heading" tabindex="-1">${_texts.socialAccountsHeadingText}</h2>
92
- </header>
93
- <nav aria-label="Social media links">
94
- ${(0, _SocialCard.SocialCard)(accounts)}
95
- </nav>
96
- </aside>
97
- ` : ''}
77
+ <h2 id="profile-main-heading" class="sr-only">Main Profile Content</h2>
98
78
 
99
- ${stuffData.stuff && stuffData.stuff.length > 0 ? (0, _litHtml.html)`
100
- <section
101
- aria-labelledby="stuff-heading"
102
- class="profileSection section-bg"
103
- role="region"
104
- tabindex="-1"
105
- >
106
- <header class="text-center mb-md">
107
- <h2 id="stuff-heading" tabindex="-1">${_texts.sharedItemsHeadingText}</h2>
108
- </header>
109
- <div>
110
- ${(0, _StuffCard.StuffCard)(profileBasics, context, subject, stuffData)}
111
- </div>
79
+ ${(0, _HeadingSection.renderHeadingSection)(context, subject, profileDetails, viewerMode, onSaved)}
80
+ ${(0, _BioSection.renderBioSection)(store, subject, bioDetails, viewerMode, onSaved)}
81
+ ${(0, _ResumeSection.renderCVSection)(store, subject, rolesByType, viewerMode, onSaved)}
82
+ ${(0, _ProjectSection.renderProjectSection)(store, subject, projects, viewerMode, onSaved)}
83
+
112
84
  </section>
113
- ` : ''}
114
-
115
- ${(() => {
116
- const friends = (0, _FriendList.FriendList)(subject, context);
117
- return friends ? (0, _litHtml.html)`
118
- <aside
119
- aria-labelledby="friends-heading"
120
- class="profileSection section-bg"
121
- role="complementary"
122
- tabindex="-1"
123
- >
124
- <header class="text-center mb-md">
125
- <h2 id="friends-heading" tabindex="-1">${_texts.friendsHeadingText}</h2>
126
- </header>
127
- <div role="list" aria-label="Friend connections">
128
- ${friends}
129
- </div>
130
- </aside>
131
- ` : '';
132
- })()}
133
-
134
- <section
135
- aria-labelledby="chat-heading"
136
- class="profileSection section-bg"
137
- role="region"
138
- tabindex="-1"
139
- >
140
- <header class="text-center mb-md">
141
- <h2 id="chat-heading" tabindex="-1">${_texts.contactHeadingText}</h2>
142
- </header>
143
- <div>
144
- ${(0, _ChatWithMe.ChatWithMe)(subject, context)}
145
- </div>
146
- </section>
147
- </main>
85
+ ${renderSidebar(store, subject, accounts, skills, languages, contactInfo, viewerMode, onSaved)}
86
+ </main>
87
+ </div>
148
88
  `;
149
89
  }
@@ -0,0 +1,23 @@
1
+ import { NamedNode, LiveStore } from 'rdflib';
2
+ import { ContactInfo } from './sections/contactInfo/types';
3
+ import { SocialPresentation } from './sections/social/types';
4
+ import { SkillDetails } from './sections/skills/types';
5
+ import { LanguageDetails } from './sections/languages/types';
6
+ import { RoleDetails } from './sections/resume/types';
7
+ import { EducationDetails } from './sections/education/types';
8
+ import { ProjectDetails } from './sections/projects/types';
9
+ import { ProfileDetails } from './sections/heading/types';
10
+ import { BioDetails } from './sections/bio/types';
11
+ export type ProfileViewModel = {
12
+ profileDetails: ProfileDetails;
13
+ contactInfo: ContactInfo;
14
+ skills: SkillDetails[];
15
+ languages: LanguageDetails[];
16
+ education: EducationDetails[];
17
+ projects: ProjectDetails[];
18
+ bioDetails: BioDetails;
19
+ social: SocialPresentation;
20
+ cvDetails: RoleDetails[];
21
+ };
22
+ export declare function presentProfileViewModel(subject: NamedNode, store: LiveStore): Promise<ProfileViewModel>;
23
+ //# sourceMappingURL=ProfileViewModelPresenter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ProfileViewModelPresenter.d.ts","sourceRoot":"","sources":["../src/ProfileViewModelPresenter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;AAC7C,OAAO,EAAE,WAAW,EAAG,MAAM,8BAA8B,CAAA;AAE3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAE5D,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAEtD,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAE5D,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAErD,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAE7D,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAG1D,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AAGjD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,cAAc,EAAE,cAAc,CAAC;IAC/B,WAAW,EAAE,WAAW,CAAC;IACzB,MAAM,EAAE,YAAY,EAAE,CAAC;IACvB,SAAS,EAAE,eAAe,EAAE,CAAC;IAC7B,SAAS,EAAE,gBAAgB,EAAE,CAAC;IAC9B,QAAQ,EAAE,cAAc,EAAE,CAAC;IAC3B,UAAU,EAAE,UAAU,CAAC;IACvB,MAAM,EAAE,kBAAkB,CAAC;IAC3B,SAAS,EAAE,WAAW,EAAE,CAAA;CACzB,CAAA;AAED,wBAAsB,uBAAuB,CAAC,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAsB7G"}
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.presentProfileViewModel = presentProfileViewModel;
7
+ var _selectors = require("./sections/social/selectors");
8
+ var _selectors2 = require("./sections/skills/selectors");
9
+ var _selectors3 = require("./sections/languages/selectors");
10
+ var _selectors4 = require("./sections/resume/selectors");
11
+ var _selectors5 = require("./sections/contactInfo/selectors");
12
+ var _selectors6 = require("./sections/education/selectors");
13
+ var _selectors7 = require("./sections/projects/selectors");
14
+ var _selectors8 = require("./sections/heading/selectors");
15
+ var _selectors9 = require("./sections/bio/selectors");
16
+ async function presentProfileViewModel(subject, store) {
17
+ const profileDetails = (0, _selectors8.presentProfile)(subject, store);
18
+ const contactInfo = (0, _selectors5.presentContactInfo)(subject, store);
19
+ const skills = (0, _selectors2.presentSkillDetails)(subject, store);
20
+ const languages = (0, _selectors3.presentLanguages)(subject, store);
21
+ const education = (0, _selectors6.presentEducation)(subject, store);
22
+ const projects = await (0, _selectors7.presentProjects)(subject, store);
23
+ const bioDetails = (0, _selectors9.presentBio)(subject, store);
24
+ const social = (0, _selectors.presentSocial)(subject, store);
25
+ const cvDetails = (0, _selectors4.presentCV)(subject, store);
26
+ return {
27
+ profileDetails,
28
+ social,
29
+ contactInfo,
30
+ skills,
31
+ languages,
32
+ education,
33
+ projects,
34
+ bioDetails,
35
+ cvDetails
36
+ };
37
+ }
@@ -1,5 +1,7 @@
1
1
  import { TemplateResult } from 'lit-html';
2
2
  import { NamedNode } from 'rdflib';
3
3
  import './styles/QRCodeCard.css';
4
- export declare const QRCodeCard: (highlightColor: string, backgroundColor: string, subject: NamedNode) => TemplateResult;
4
+ type LegacySubjectArg = NamedNode | string;
5
+ export declare const QRCodeCard: (arg1: LegacySubjectArg, arg2?: unknown, arg3?: unknown) => TemplateResult;
6
+ export {};
5
7
  //# sourceMappingURL=QRCodeCard.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"QRCodeCard.d.ts","sourceRoot":"","sources":["../src/QRCodeCard.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,cAAc,EAAE,MAAM,UAAU,CAAA;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;AAElC,OAAO,yBAAyB,CAAA;AAuChC,eAAO,MAAM,UAAU,GACrB,gBAAgB,MAAM,EACtB,iBAAiB,MAAM,EACvB,SAAS,SAAS,KACjB,cA0EF,CAAA"}
1
+ {"version":3,"file":"QRCodeCard.d.ts","sourceRoot":"","sources":["../src/QRCodeCard.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,cAAc,EAAE,MAAM,UAAU,CAAA;AAC/C,OAAO,EAAa,SAAS,EAAE,MAAM,QAAQ,CAAA;AAE7C,OAAO,yBAAyB,CAAA;AAMhC,KAAK,gBAAgB,GAAG,SAAS,GAAG,MAAM,CAAA;AAyF1C,eAAO,MAAM,UAAU,GACrB,MAAM,gBAAgB,EACtB,OAAO,OAAO,EACd,OAAO,OAAO,KACb,cAiEF,CAAA"}
package/lib/QRCodeCard.js CHANGED
@@ -8,83 +8,103 @@ var _litHtml = require("lit-html");
8
8
  var _solidUi = require("solid-ui");
9
9
  require("./styles/QRCodeCard.css");
10
10
  var _texts = require("./texts");
11
- function hexToRgb(hex) {
12
- // Remove leading # if present
13
- hex = hex.replace(/^#/, '');
14
- if (hex.length === 3) {
15
- hex = hex.split('').map(x => x + x).join('');
11
+ /* Part of this code was generated by AI Model: GPT-5.3-Codex */
12
+ /* Prompt: The QRCode has a label "link to profile" but it should
13
+ be a VCARD with name, and link to profile. So when you scan it
14
+ it goes into your contacts. That's the current way works, IIRC. */
15
+
16
+ function isNamedNodeLike(value) {
17
+ return Boolean(value && typeof value === 'object' && typeof value.uri === 'string');
18
+ }
19
+ function isStoreLike(value) {
20
+ return Boolean(value && typeof value === 'object' && typeof value.any === 'function');
21
+ }
22
+ function resolveQRCodeArgs(arg1, arg2, arg3) {
23
+ if (isNamedNodeLike(arg1)) {
24
+ return {
25
+ subject: arg1,
26
+ store: isStoreLike(arg2) ? arg2 : undefined
27
+ };
16
28
  }
17
- if (hex.length !== 6) return null;
18
- const num = parseInt(hex, 16);
19
- return {
20
- r: num >> 16 & 255,
21
- g: num >> 8 & 255,
22
- b: num & 255
23
- };
29
+ if (isNamedNodeLike(arg3)) {
30
+ return {
31
+ subject: arg3,
32
+ store: isStoreLike(arg2) ? arg2 : undefined
33
+ };
34
+ }
35
+ throw new Error('QRCodeCard requires a profile subject NamedNode.');
24
36
  }
25
- function luminance({
26
- r,
27
- g,
28
- b
29
- }) {
30
- const a = [r, g, b].map(function (v) {
31
- v /= 255;
32
- return v <= 0.03928 ? v / 12.92 : Math.pow((v + 0.055) / 1.055, 2.4);
33
- });
34
- return 0.2126 * a[0] + 0.7152 * a[1] + 0.0722 * a[2];
37
+ function normalizeEmail(value) {
38
+ return (value || '').trim().replace(/^mailto:/i, '');
35
39
  }
36
- function contrastRatio(hex1, hex2) {
37
- const rgb1 = hexToRgb(hex1);
38
- const rgb2 = hexToRgb(hex2);
39
- if (!rgb1 || !rgb2) return 1;
40
- const lum1 = luminance(rgb1);
41
- const lum2 = luminance(rgb2);
42
- const brightest = Math.max(lum1, lum2);
43
- const darkest = Math.min(lum1, lum2);
44
- return (brightest + 0.05) / (darkest + 0.05);
40
+ function normalizeTelephone(value) {
41
+ return (value || '').trim().replace(/^tel:/i, '');
45
42
  }
46
- const QRCodeCard = (highlightColor, backgroundColor, subject) => {
47
- const hC = highlightColor || '#000000';
48
- const bC = backgroundColor || '#ffffff';
49
- const name = _solidUi.utils.label(subject);
50
-
51
- // Color contrast check
52
- const ratio = contrastRatio(hC, bC);
53
- if (ratio < 4.5) {
54
- console.warn(`QRCodeCard: The contrast ratio between highlightColor (${hC}) and backgroundColor (${bC}) is ${ratio.toFixed(2)}, which is below the WCAG 2.1 recommended minimum of 4.5:1 for normal text.`);
55
- }
56
- const BEGIN = 'BEGIN:VCARD\r\n';
57
- const END = 'END:VCARD\r\n';
58
- const FN = 'FN:' + name + '\r\n';
59
- const URL = 'URL:' + subject.uri + 'r\n';
60
- const VERSIONV = 'VERSION:4.0\r\n';
61
-
62
- // Accessibility check: Ensure QR code is rendered as an accessible image or canvas
63
- // This assumes the QR code is rendered inside the <div> below by another library or script.
64
- // If you use a library, ensure it sets role="img" and an appropriate aria-label or alt attribute.
65
- // If not, warn the developer.
66
- setTimeout(() => {
67
- const container = document.querySelector('.QRCode [role="img"]');
68
- if (container) {
69
- const hasAriaLabel = container.hasAttribute('aria-label');
70
- const hasAlt = container.hasAttribute('alt');
71
- if (!hasAriaLabel && !hasAlt) {
72
- console.warn('QRCodeCard: The QR code element should have an accessible label (aria-label or alt attribute) for screen readers.');
43
+ function isEmailValue(value) {
44
+ const normalized = (value || '').trim();
45
+ if (!normalized) return false;
46
+ if (/^mailto:/i.test(normalized)) return true;
47
+ return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(normalized);
48
+ }
49
+ function isPhoneValue(value) {
50
+ const normalized = (value || '').trim();
51
+ if (!normalized) return false;
52
+ if (/^tel:/i.test(normalized)) return true;
53
+ return /^[+()\-\s\d]{5,}$/.test(normalized);
54
+ }
55
+ function firstContactValue(store, subject, predicate, kind) {
56
+ if (!store) return '';
57
+ const candidates = store.each(subject, predicate);
58
+ const isExpectedValue = kind === 'email' ? isEmailValue : isPhoneValue;
59
+ for (const node of candidates) {
60
+ if (!node) continue;
61
+ const direct = node.value;
62
+ if (typeof direct === 'string' && isExpectedValue(direct)) {
63
+ return kind === 'email' ? normalizeEmail(direct) : normalizeTelephone(direct);
64
+ }
65
+ if (node.termType === 'NamedNode' || node.termType === 'BlankNode') {
66
+ const doc = subject.doc();
67
+ const inDocStatements = store.statementsMatching(node, _solidUi.ns.vcard('value'), null, doc);
68
+ const anyGraphStatements = store.statementsMatching(node, _solidUi.ns.vcard('value'));
69
+ for (const statement of [...inDocStatements, ...anyGraphStatements]) {
70
+ const viaValue = statement.object?.value;
71
+ if (typeof viaValue === 'string' && isExpectedValue(viaValue)) {
72
+ return kind === 'email' ? normalizeEmail(viaValue) : normalizeTelephone(viaValue);
73
+ }
73
74
  }
74
- } else {
75
- console.warn('QRCodeCard: No element with role="img" found for the QR code. Ensure the QR code is rendered as an <img> or <canvas> with proper ARIA attributes.');
76
75
  }
77
- }, 0);
78
- const vCard = BEGIN + FN + URL + END + VERSIONV;
76
+ }
77
+ return '';
78
+ }
79
+ const QRCodeCard = (arg1, arg2, arg3) => {
80
+ const {
81
+ subject,
82
+ store
83
+ } = resolveQRCodeArgs(arg1, arg2, arg3);
84
+ const name = _solidUi.utils.label(subject);
85
+ const escapeVCardValue = value => {
86
+ return (value || '').replace(/\\/g, '\\\\').replace(/;/g, '\\;').replace(/,/g, '\\,').replace(/\r?\n/g, '\\n');
87
+ };
88
+ const safeName = escapeVCardValue(name || subject.uri);
89
+ const safeUrl = escapeVCardValue(subject.uri);
90
+ const email = firstContactValue(store, subject, _solidUi.ns.vcard('hasEmail'), 'email');
91
+ const telephone = firstContactValue(store, subject, _solidUi.ns.vcard('hasTelephone'), 'tel');
92
+ const vCardLines = ['BEGIN:VCARD', 'VERSION:4.0', `FN:${safeName}`, `URL:${safeUrl}`];
93
+ if (email) {
94
+ vCardLines.push(`EMAIL;TYPE=internet:${escapeVCardValue(email)}`);
95
+ }
96
+ if (telephone) {
97
+ vCardLines.push(`TEL:${escapeVCardValue(telephone)}`);
98
+ }
99
+ vCardLines.push('END:VCARD');
100
+ const vCard = vCardLines.join('\r\n');
79
101
 
80
102
  // console.log(`@@ qrcodes colours highlightColor ${highlightColor}, backgroundColor ${backgroundColor}`)
81
103
 
82
104
  return (0, _litHtml.html)`
83
105
  <figure
84
- class="QRCode"
106
+ class="qrcode-card flex-column-center"
85
107
  data-value="${vCard}"
86
- highlightColor="${hC}"
87
- backgroundColor="${bC}"
88
108
  data-testid="qrcode-card"
89
109
  aria-labelledby="qr-code-caption"
90
110
  role="img"
@@ -97,7 +117,7 @@ const QRCodeCard = (highlightColor, backgroundColor, subject) => {
97
117
  ></div>
98
118
  <figcaption
99
119
  id="qr-code-caption"
100
- class="qrCaption"
120
+ class="qrcode-card__caption"
101
121
  >
102
122
  ${_texts.scanQrToConnectText}
103
123
  </figcaption>
@@ -1,11 +1,11 @@
1
1
  import { TemplateResult } from 'lit-html';
2
2
  import { DataBrowserContext } from 'pane-registry';
3
3
  import { LiveStore, NamedNode } from 'rdflib';
4
+ import { ViewerMode } from './types';
4
5
  import './styles/ProfileCard.css';
5
- declare const addMeToYourFriendsDiv: (subject: NamedNode, context: DataBrowserContext) => TemplateResult;
6
+ declare const addMeToYourFriendsDiv: (subject: NamedNode, context: DataBrowserContext, viewerMode: ViewerMode) => TemplateResult;
6
7
  declare const createAddMeToYourFriendsButton: (subject: NamedNode, context: DataBrowserContext) => HTMLButtonElement;
7
8
  declare function saveNewThing(subject: NamedNode, context: DataBrowserContext, predicate: NamedNode): Promise<void>;
8
9
  declare function checkIfThingExists(store: LiveStore, me: NamedNode, subject: NamedNode, predicate: NamedNode): Promise<boolean>;
9
- declare function extractFriends(editable: boolean, subject: NamedNode, { dom }: DataBrowserContext): HTMLDivElement | null;
10
- export { addMeToYourFriendsDiv, createAddMeToYourFriendsButton, saveNewThing, extractFriends, checkIfThingExists };
10
+ export { addMeToYourFriendsDiv, createAddMeToYourFriendsButton, saveNewThing, checkIfThingExists };
11
11
  //# sourceMappingURL=addMeToYourFriends.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"addMeToYourFriends.d.ts","sourceRoot":"","sources":["../src/addMeToYourFriends.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,cAAc,EAAE,MAAM,UAAU,CAAA;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AAElD,OAAO,EAAE,SAAS,EAAE,SAAS,EAAM,MAAM,QAAQ,CAAA;AASjD,OAAO,0BAA0B,CAAA;AAIjC,QAAA,MAAM,qBAAqB,GACzB,SAAS,SAAS,EAClB,SAAS,kBAAkB,KAC1B,cAkBF,CAAA;AAED,QAAA,MAAM,8BAA8B,GAClC,SAAS,SAAS,EAClB,SAAS,kBAAkB,KAC1B,iBAmDF,CAAA;AAED,iBAAe,YAAY,CACzB,OAAO,EAAE,SAAS,EAClB,OAAO,EAAE,kBAAkB,EAC3B,SAAS,EAAE,SAAS,GACnB,OAAO,CAAC,IAAI,CAAC,CAoBf;AAOD,iBAAe,kBAAkB,CAC/B,KAAK,EAAE,SAAS,EAChB,EAAE,EAAE,SAAS,EACb,OAAO,EAAE,SAAS,EAClB,SAAS,EAAE,SAAS,GACnB,OAAO,CAAC,OAAO,CAAC,CAKlB;AAED,iBAAS,cAAc,CAAC,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,GAAG,EAAE,EAAE,kBAAkB,GAAG,cAAc,GAAG,IAAI,CAajH;AAED,OAAO,EACL,qBAAqB,EACrB,8BAA8B,EAC9B,YAAY,EACZ,cAAc,EACd,kBAAkB,EACnB,CAAA"}
1
+ {"version":3,"file":"addMeToYourFriends.d.ts","sourceRoot":"","sources":["../src/addMeToYourFriends.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,cAAc,EAAE,MAAM,UAAU,CAAA;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AAElD,OAAO,EAAE,SAAS,EAAE,SAAS,EAAM,MAAM,QAAQ,CAAA;AASjD,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AACpC,OAAO,0BAA0B,CAAA;AAIjC,QAAA,MAAM,qBAAqB,GACzB,SAAS,SAAS,EAClB,SAAS,kBAAkB,EAC3B,YAAY,UAAU,KACrB,cAkBF,CAAA;AAED,QAAA,MAAM,8BAA8B,GAClC,SAAS,SAAS,EAClB,SAAS,kBAAkB,KAC1B,iBA+CF,CAAA;AAED,iBAAe,YAAY,CACzB,OAAO,EAAE,SAAS,EAClB,OAAO,EAAE,kBAAkB,EAC3B,SAAS,EAAE,SAAS,GACnB,OAAO,CAAC,IAAI,CAAC,CAoBf;AAOD,iBAAe,kBAAkB,CAC/B,KAAK,EAAE,SAAS,EAChB,EAAE,EAAE,SAAS,EACb,OAAO,EAAE,SAAS,EAClB,SAAS,EAAE,SAAS,GACnB,OAAO,CAAC,OAAO,CAAC,CAKlB;AAED,OAAO,EACL,qBAAqB,EACrB,8BAA8B,EAC9B,YAAY,EACZ,kBAAkB,EACnB,CAAA"}