profile-pane 3.1.4 → 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 -5666
  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 +8 -6
  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 -427
@@ -0,0 +1,229 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.renderContactInfoSection = renderContactInfoSection;
7
+ var _litHtml = require("lit-html");
8
+ var _ContactInfoEditDialog = require("./ContactInfoEditDialog");
9
+ var _solidUi = require("solid-ui");
10
+ var _texts = require("../../texts");
11
+ var _collapsibleSection = require("../shared/collapsibleSection");
12
+ var _contactTypeUtils = require("../shared/contactTypeUtils");
13
+ var _profileIcons = require("../../icons-svg/profileIcons");
14
+ var _contactIcons = require("../../icons-svg/contactIcons");
15
+ function toText(value) {
16
+ if (!value) return '';
17
+ if (typeof value === 'string') return value;
18
+ if (typeof value === 'object' && 'value' in value) {
19
+ const v = value.value;
20
+ return typeof v === 'string' ? v : '';
21
+ }
22
+ return '';
23
+ }
24
+ function normalizeContactValue(rawValue, kind) {
25
+ if (!rawValue) return '';
26
+ return kind === 'email' ? rawValue.replace(/^mailto:/i, '') : rawValue.replace(/^tel:/i, '');
27
+ }
28
+ function resolveContactValue(store, point, kind) {
29
+ if (!point) return '';
30
+ const directValue = toText(point.valueNode || point.entryNode).trim();
31
+ const looksLikeExpectedValue = kind === 'email' ? /^mailto:/i.test(directValue) || /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(directValue) : /^tel:/i.test(directValue) || /^[+()\-\s\d]{5,}$/.test(directValue);
32
+ if (looksLikeExpectedValue) {
33
+ return normalizeContactValue(directValue, kind);
34
+ }
35
+ const entryNode = point.entryNode || point.valueNode;
36
+ if (entryNode) {
37
+ const storedValueNode = store.any(entryNode, _solidUi.ns.vcard('value'));
38
+ const storedValue = toText(storedValueNode).trim();
39
+ if (storedValue) return normalizeContactValue(storedValue, kind);
40
+ }
41
+ return normalizeContactValue(directValue, kind);
42
+ }
43
+ function renderPhone(phone, store) {
44
+ if (!phone) return (0, _litHtml.html)``;
45
+ const phoneValue = resolveContactValue(store, phone, 'phone');
46
+ const phoneType = (0, _contactTypeUtils.normalizePhoneTypeForEdit)(phone.type);
47
+ return (0, _litHtml.html)`<li class="contact-info__item flex gap-2xs" role="listitem">
48
+ <div class="contact-info__icon-wrapper flex-center">
49
+ <span class="contact-info__icon" aria-hidden="true">${_contactIcons.phoneIcon}</span>
50
+ </div>
51
+ <div class="flex-column">
52
+ <span class="contact-info__contact-point-value">${phoneValue}</span>
53
+ ${phoneType ? (0, _litHtml.html)`<span class="contact-info__contact-point-type"> ${phoneType}</span>` : (0, _litHtml.html)``}
54
+ </div>
55
+ </li>`;
56
+ }
57
+ function renderPhones(phones, store) {
58
+ if (!phones || !phones.length || !phones[0]) return (0, _litHtml.html)``;
59
+ return (0, _litHtml.html)`${renderPhone(phones[0], store)}${phones.length > 1 ? renderPhones(phones.slice(1), store) : (0, _litHtml.html)``}`;
60
+ }
61
+ function renderEmail(email, store) {
62
+ if (!email) return (0, _litHtml.html)``;
63
+ const emailValue = resolveContactValue(store, email, 'email');
64
+ const emailType = (0, _contactTypeUtils.normalizeEmailTypeForEdit)(email.type);
65
+ return (0, _litHtml.html)`<li class="contact-info__item flex gap-2xs" role="listitem">
66
+ <div class="contact-info__icon-wrapper flex-center">
67
+ <span class="contact-info__icon" aria-hidden="true">${_contactIcons.emailIcon}</span>
68
+ </div>
69
+ <div class="flex-column">
70
+ <span class="contact-info__contact-point-value">${emailValue}</span>
71
+ ${emailType ? (0, _litHtml.html)`<span class="contact-info__contact-point-type">${emailType}</span>` : (0, _litHtml.html)``}
72
+ </div>
73
+ </li>`;
74
+ }
75
+ function renderEmails(emails, store) {
76
+ if (!emails || !emails.length || !emails[0]) return (0, _litHtml.html)``;
77
+ return (0, _litHtml.html)`${renderEmail(emails[0], store)}${emails.length > 1 ? renderEmails(emails.slice(1), store) : (0, _litHtml.html)``}`;
78
+ }
79
+ function renderAddress(address) {
80
+ if (!address) return (0, _litHtml.html)``;
81
+ const streetAddress = toText(address.streetAddress || address.fullAddress).trim();
82
+ const locality = toText(address.locality).trim();
83
+ const region = toText(address.region).trim();
84
+ const postalCode = toText(address.postalCode).trim();
85
+ const countryName = toText(address.countryName).trim();
86
+ const localityRegion = [locality, region].filter(Boolean).join(', ');
87
+ const localityRegionPostal = [localityRegion, postalCode].filter(Boolean).join(' ');
88
+ return (0, _litHtml.html)`
89
+ <li class="contact-info__item flex gap-2xs" role="listitem">
90
+ <div class="contact-info__icon-wrapper flex-center">
91
+ <span class="contact-info__icon" aria-hidden="true">${_profileIcons.locationIcon}</span>
92
+ </div>
93
+ <span class="contact-info__address">
94
+ ${streetAddress ? (0, _litHtml.html)`${streetAddress}<br />` : (0, _litHtml.html)``}
95
+ ${localityRegionPostal ? (0, _litHtml.html)`${localityRegionPostal}<br />` : (0, _litHtml.html)``}
96
+ ${countryName}
97
+ </span>
98
+ </li>`;
99
+ }
100
+ function renderAddresses(addresses) {
101
+ if (!addresses || !addresses.length || !addresses[0]) return (0, _litHtml.html)``;
102
+ return (0, _litHtml.html)`${renderAddress(addresses[0])}${addresses.length > 1 ? renderAddresses(addresses.slice(1)) : (0, _litHtml.html)``}`;
103
+ }
104
+ function renderContactInfoSectionDefault(store, subject, contactInfo, viewerMode, onSaved) {
105
+ const hasAnyContactInfo = contactInfo?.emails.length > 0 || contactInfo?.phones.length > 0 || contactInfo?.addresses.length > 0;
106
+ const isOwner = viewerMode === 'owner';
107
+ return (0, _litHtml.html)`
108
+ <section
109
+ aria-labelledby="contact-details-heading"
110
+ class="profile__section border-lighter profile-section-collapsible profile-section-collapsible--inline-mobile-actions"
111
+ role="region"
112
+ tabindex="-1"
113
+ data-expanded="false"
114
+ >
115
+ <header class="profile__section-header profile-section-collapsible__header">
116
+ <h2 id="contact-details-heading" tabindex="-1">${_texts.contactInfoHeadingText}</h2>
117
+ <div class="profile-section-collapsible__actions flex-column">
118
+ ${isOwner ? (0, _litHtml.html)`
119
+ <button
120
+ type="button"
121
+ class="profile__action-button profile-action-text flex-center profile-section-collapsible__edit-button"
122
+ aria-label="Edit contact information"
123
+ @click=${event => {
124
+ return (0, _ContactInfoEditDialog.createContactInfoEditDialog)(event, store, subject, contactInfo, viewerMode, onSaved);
125
+ }}>
126
+ <span class="profile-section-collapsible__edit-label">${_profileIcons.editIcon} Edit</span>
127
+ <span class="profile-section-collapsible__edit-icon" aria-hidden="true">${_profileIcons.editIcon}</span>
128
+ </button>
129
+ ` : (0, _litHtml.html)``}
130
+ <button
131
+ type="button"
132
+ class="inline-flex-row"
133
+ aria-label="Toggle contact information section"
134
+ aria-controls="contact-details-panel"
135
+ aria-expanded="false"
136
+ @click=${_collapsibleSection.toggleCollapsibleSection}
137
+ >
138
+ <span class="profile-section-collapsible__chevron" aria-hidden="true">⌄</span>
139
+ </button>
140
+ </div>
141
+ </header>
142
+ <div id="contact-details-panel" class="profile-section-collapsible__content" aria-hidden="true">
143
+ ${contactInfo.phones.length > 0 ? (0, _litHtml.html)`
144
+ <ul class="contact-info__list flex-column" role="list" aria-label="Phone numbers">
145
+ ${renderPhones(contactInfo.phones, store)}
146
+ </ul>
147
+ ` : (0, _litHtml.html)``}
148
+ ${contactInfo.emails.length > 0 ? (0, _litHtml.html)`
149
+ <ul class="contact-info__list flex-column" role="list" aria-label="Email addresses">
150
+ ${renderEmails(contactInfo.emails, store)}
151
+ </ul>
152
+ ` : (0, _litHtml.html)``}
153
+ ${contactInfo.addresses.length > 0 ? (0, _litHtml.html)`
154
+ <ul class="contact-info__list flex-column" role="list" aria-label="Postal addresses">
155
+ ${renderAddresses(contactInfo.addresses)}
156
+ </ul>
157
+ ` : (0, _litHtml.html)``}
158
+ ${hasAnyContactInfo ? (0, _litHtml.html)`` : (0, _litHtml.html)`<p>No contact details added yet.</p>`}
159
+ </div>
160
+ </section>
161
+ `;
162
+ }
163
+ function renderOwnerEmptyContactInfoContent(_store, _subject, _contactInfo, _viewerMode, _onSaved) {
164
+ return (0, _litHtml.html)`
165
+ <div class="profile__empty-state-content flex-column-center" role="group" aria-label="Empty contact information section">
166
+ <div class="contact-info__empty-icon-wrapper">
167
+ <span class="contact-info__empty-icon inline-flex-row">${_profileIcons.envelopeIcon}</span>
168
+ </div>
169
+ <p class="profile__empty-state-message contact-info__empty-message">
170
+ No additional contact info added yet.
171
+ </p>
172
+ </div>
173
+ `;
174
+ }
175
+ function renderOwnerEmptyContactInfoSection(store, subject, contactInfo, viewerMode, onSaved) {
176
+ return (0, _litHtml.html)`
177
+ <section
178
+ aria-labelledby="contact-details-heading"
179
+ data-profile-section="contact-info"
180
+ class="profile__section--empty border-lighter rounded-md gap-lg profile-section-collapsible profile-section-collapsible--inline-mobile-actions"
181
+ role="region"
182
+ tabindex="-1"
183
+ data-expanded="false"
184
+ >
185
+ <header class="profile__section-header profile-section-collapsible__header">
186
+ <h2 id="contact-details-heading" tabindex="-1">${_texts.contactInfoEmptyHeadingText}</h2>
187
+ <div class="profile-section-collapsible__actions flex-column">
188
+ <button
189
+ type="button"
190
+ class="profile__action-button profile-action-text flex-center profile-section-collapsible__edit-button"
191
+ aria-label="Add contact information"
192
+ @click=${event => {
193
+ return (0, _ContactInfoEditDialog.createContactInfoEditDialog)(event, store, subject, contactInfo, viewerMode, onSaved);
194
+ }}
195
+ >
196
+ <span class="profile-section-collapsible__edit-label">${_profileIcons.addIcon} Add Contact</span>
197
+ <span class="profile-section-collapsible__edit-icon profile-section-collapsible__edit-icon--add" aria-hidden="true">${_profileIcons.plusIcon}</span>
198
+ </button>
199
+ <button
200
+ type="button"
201
+ class="inline-flex-row"
202
+ aria-label="Toggle contact information section"
203
+ aria-controls="contact-details-panel"
204
+ aria-expanded="false"
205
+ @click=${_collapsibleSection.toggleCollapsibleSection}
206
+ >
207
+ <span class="profile-section-collapsible__chevron" aria-hidden="true">⌄</span>
208
+ </button>
209
+ </div>
210
+ </header>
211
+ <div id="contact-details-panel" class="profile-section-collapsible__content" aria-hidden="true">
212
+ ${renderOwnerEmptyContactInfoContent(store, subject, contactInfo, viewerMode, onSaved)}
213
+ </div>
214
+ </section>
215
+ `;
216
+ }
217
+ function renderContactInfoSection(store, subject, contactInfo, viewerMode, onSaved) {
218
+ const safeContactInfo = {
219
+ emails: contactInfo?.emails || [],
220
+ phones: contactInfo?.phones || [],
221
+ addresses: contactInfo?.addresses || []
222
+ };
223
+ const hasAnyContactInfo = safeContactInfo.emails.length > 0 || safeContactInfo.phones.length > 0 || safeContactInfo.addresses.length > 0;
224
+ const showOwnerEmptyContactInfo = !hasAnyContactInfo && viewerMode === 'owner';
225
+ const showSection = true;
226
+ return showSection ? (0, _litHtml.html)`
227
+ ${showOwnerEmptyContactInfo ? renderOwnerEmptyContactInfoSection(store, subject, safeContactInfo, viewerMode, onSaved) : renderContactInfoSectionDefault(store, subject, safeContactInfo, viewerMode, onSaved)}
228
+ ` : '';
229
+ }
@@ -0,0 +1,4 @@
1
+ import { LiveStore, NamedNode } from 'rdflib';
2
+ import { ContactMutationPlan } from './types';
3
+ export declare function processContactInfoMutations(store: LiveStore, subject: NamedNode, mutationPlan: ContactMutationPlan): Promise<void>;
4
+ //# sourceMappingURL=mutations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mutations.d.ts","sourceRoot":"","sources":["../../../src/sections/contactInfo/mutations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAiB,MAAM,QAAQ,CAAA;AAE5D,OAAO,EAAqB,mBAAmB,EAAmB,MAAM,SAAS,CAAA;AAqKjF,wBAAsB,2BAA2B,CAAC,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,mBAAmB,iBASxH"}
@@ -0,0 +1,150 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.processContactInfoMutations = processContactInfoMutations;
7
+ var _rdflib = require("rdflib");
8
+ var _solidUi = require("solid-ui");
9
+ var _rdfMutationHelpers = require("../shared/rdfMutationHelpers");
10
+ var _idNodeFactory = require("../shared/idNodeFactory");
11
+ var _texts = require("../../texts");
12
+ function buildPhoneStatements(subject, doc, node, phone) {
13
+ const normalizedValue = phone.value.startsWith('tel:') ? phone.value : `tel:${phone.value}`;
14
+ const valueNode = (0, _rdflib.sym)(normalizedValue);
15
+ const inserts = [(0, _rdflib.st)(subject, _solidUi.ns.vcard('hasTelephone'), node, doc), (0, _rdflib.st)(node, _solidUi.ns.vcard('value'), valueNode, doc)];
16
+ if (phone.type) {
17
+ inserts.push((0, _rdflib.st)(node, _solidUi.ns.rdf('type'), _solidUi.ns.vcard(phone.type), doc));
18
+ }
19
+ return inserts;
20
+ }
21
+ function buildEmailStatements(subject, doc, node, email) {
22
+ const normalizedValue = email.value.startsWith('mailto:') ? email.value : `mailto:${email.value}`;
23
+ const valueNode = (0, _rdflib.sym)(normalizedValue);
24
+ const inserts = [(0, _rdflib.st)(subject, _solidUi.ns.vcard('hasEmail'), node, doc), (0, _rdflib.st)(node, _solidUi.ns.vcard('value'), valueNode, doc)];
25
+ if (email.type) {
26
+ inserts.push((0, _rdflib.st)(node, _solidUi.ns.rdf('type'), _solidUi.ns.vcard(email.type), doc));
27
+ }
28
+ return inserts;
29
+ }
30
+ function buildAddressStatements(subject, doc, node, address) {
31
+ const inserts = [(0, _rdflib.st)(subject, _solidUi.ns.vcard('hasAddress'), node, doc)];
32
+ if (address.type) inserts.push((0, _rdflib.st)(node, _solidUi.ns.rdf('type'), _solidUi.ns.vcard(address.type), doc));
33
+ if (address.streetAddress) inserts.push((0, _rdflib.st)(node, _solidUi.ns.vcard('street-address'), address.streetAddress, doc));
34
+ if (address.locality) inserts.push((0, _rdflib.st)(node, _solidUi.ns.vcard('locality'), address.locality, doc));
35
+ if (address.region) inserts.push((0, _rdflib.st)(node, _solidUi.ns.vcard('region'), address.region, doc));
36
+ if (address.postalCode) inserts.push((0, _rdflib.st)(node, _solidUi.ns.vcard('postal-code'), address.postalCode, doc));
37
+ if (address.countryName) inserts.push((0, _rdflib.st)(node, _solidUi.ns.vcard('country-name'), address.countryName, doc));
38
+ return inserts;
39
+ }
40
+ async function mutatePhoneEntries(store, subject, phoneOps) {
41
+ const doc = subject.doc();
42
+ const existingPhoneNodes = store.each(subject, _solidUi.ns.vcard('hasTelephone'), null, doc);
43
+ const deletions = [];
44
+ const insertions = [];
45
+ phoneOps.remove.forEach(phone => {
46
+ if (!phone.entryNode) return;
47
+ const existingNode = (0, _rdfMutationHelpers.findExistingNode)(existingPhoneNodes, phone.entryNode);
48
+ if (existingNode) {
49
+ const linkedPhoneStatements = (0, _rdfMutationHelpers.collectLinkedNodeStatements)(store, subject, _solidUi.ns.vcard('hasTelephone'), doc);
50
+ const matchingLinkStatement = linkedPhoneStatements.linkStatements.find(statement => statement.object?.value === existingNode.value);
51
+ if (matchingLinkStatement) {
52
+ deletions.push(matchingLinkStatement);
53
+ }
54
+ deletions.push(...(0, _rdfMutationHelpers.collectNodeStatements)(store, existingNode, doc));
55
+ }
56
+ });
57
+ phoneOps.update.forEach(phone => {
58
+ if (!phone.entryNode) return;
59
+ const existingNode = (0, _rdfMutationHelpers.findExistingNode)(existingPhoneNodes, phone.entryNode);
60
+ if (!existingNode) {
61
+ insertions.push(...buildPhoneStatements(subject, doc, (0, _idNodeFactory.createIdNode)(doc), phone));
62
+ return;
63
+ }
64
+ const linkedPhoneStatements = (0, _rdfMutationHelpers.collectLinkedNodeStatements)(store, subject, _solidUi.ns.vcard('hasTelephone'), doc);
65
+ const matchingLinkStatement = linkedPhoneStatements.linkStatements.find(statement => statement.object?.value === existingNode.value);
66
+ if (matchingLinkStatement) {
67
+ deletions.push(matchingLinkStatement);
68
+ }
69
+ deletions.push(...(0, _rdfMutationHelpers.collectNodeStatements)(store, existingNode, doc));
70
+ insertions.push(...buildPhoneStatements(subject, doc, existingNode, phone));
71
+ });
72
+ phoneOps.create.forEach(phone => {
73
+ insertions.push(...buildPhoneStatements(subject, doc, (0, _idNodeFactory.createIdNode)(doc), phone));
74
+ });
75
+ await (0, _rdfMutationHelpers.applyUpdaterPatch)(store, deletions, insertions);
76
+ }
77
+ async function mutateEmailEntries(store, subject, emailOps) {
78
+ const doc = subject.doc();
79
+ const existingEmailNodes = store.each(subject, _solidUi.ns.vcard('hasEmail'), null, doc);
80
+ const deletions = [];
81
+ const insertions = [];
82
+ emailOps.remove.forEach(email => {
83
+ if (!email.entryNode) return;
84
+ const existingNode = (0, _rdfMutationHelpers.findExistingNode)(existingEmailNodes, email.entryNode);
85
+ if (existingNode) {
86
+ const linkedEmailStatements = (0, _rdfMutationHelpers.collectLinkedNodeStatements)(store, subject, _solidUi.ns.vcard('hasEmail'), doc);
87
+ const matchingLinkStatement = linkedEmailStatements.linkStatements.find(statement => statement.object?.value === existingNode.value);
88
+ if (matchingLinkStatement) {
89
+ deletions.push(matchingLinkStatement);
90
+ }
91
+ deletions.push(...(0, _rdfMutationHelpers.collectNodeStatements)(store, existingNode, doc));
92
+ }
93
+ });
94
+ emailOps.update.forEach(email => {
95
+ if (!email.entryNode) return;
96
+ const existingNode = (0, _rdfMutationHelpers.findExistingNode)(existingEmailNodes, email.entryNode);
97
+ if (!existingNode) {
98
+ insertions.push(...buildEmailStatements(subject, doc, (0, _idNodeFactory.createIdNode)(doc), email));
99
+ return;
100
+ }
101
+ deletions.push(...(0, _rdfMutationHelpers.collectNodeStatements)(store, existingNode, doc));
102
+ insertions.push(...buildEmailStatements(subject, doc, existingNode, email));
103
+ });
104
+ emailOps.create.forEach(email => {
105
+ insertions.push(...buildEmailStatements(subject, doc, (0, _idNodeFactory.createIdNode)(doc), email));
106
+ });
107
+ await (0, _rdfMutationHelpers.applyUpdaterPatch)(store, deletions, insertions);
108
+ }
109
+ async function mutateAddressEntries(store, subject, addressOps) {
110
+ const doc = subject.doc();
111
+ const existingAddressNodes = store.each(subject, _solidUi.ns.vcard('hasAddress'), null, doc);
112
+ const deletions = [];
113
+ const insertions = [];
114
+ addressOps.remove.forEach(address => {
115
+ if (!address.entryNode) return;
116
+ const existingNode = (0, _rdfMutationHelpers.findExistingNode)(existingAddressNodes, address.entryNode);
117
+ if (existingNode) {
118
+ const linkedAddressStatements = (0, _rdfMutationHelpers.collectLinkedNodeStatements)(store, subject, _solidUi.ns.vcard('hasAddress'), doc);
119
+ const matchingLinkStatement = linkedAddressStatements.linkStatements.find(statement => statement.object?.value === existingNode.value);
120
+ if (matchingLinkStatement) {
121
+ deletions.push(matchingLinkStatement);
122
+ }
123
+ deletions.push(...(0, _rdfMutationHelpers.collectNodeStatements)(store, existingNode, doc));
124
+ }
125
+ });
126
+ addressOps.update.forEach(address => {
127
+ if (!address.entryNode) return;
128
+ const existingNode = (0, _rdfMutationHelpers.findExistingNode)(existingAddressNodes, address.entryNode);
129
+ if (!existingNode) {
130
+ insertions.push(...buildAddressStatements(subject, doc, (0, _idNodeFactory.createIdNode)(doc), address));
131
+ return;
132
+ }
133
+ deletions.push(...(0, _rdfMutationHelpers.collectNodeStatements)(store, existingNode, doc));
134
+ insertions.push(...buildAddressStatements(subject, doc, existingNode, address));
135
+ });
136
+ addressOps.create.forEach(address => {
137
+ insertions.push(...buildAddressStatements(subject, doc, (0, _idNodeFactory.createIdNode)(doc), address));
138
+ });
139
+ await (0, _rdfMutationHelpers.applyUpdaterPatch)(store, deletions, insertions);
140
+ }
141
+ async function processContactInfoMutations(store, subject, mutationPlan) {
142
+ try {
143
+ await mutatePhoneEntries(store, subject, mutationPlan.phoneOps);
144
+ await mutateEmailEntries(store, subject, mutationPlan.emailOps);
145
+ await mutateAddressEntries(store, subject, mutationPlan.addressOps);
146
+ } catch (error) {
147
+ const message = error instanceof Error ? error.message : String(error);
148
+ throw new Error(`${_texts.mutationSaveContactInfoFailedPrefixText} ${message}`);
149
+ }
150
+ }
@@ -0,0 +1,4 @@
1
+ import { LiveStore, NamedNode } from 'rdflib';
2
+ import { ContactInfo } from './types';
3
+ export declare function presentContactInfo(subject: NamedNode, store: LiveStore): ContactInfo;
4
+ //# sourceMappingURL=selectors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"selectors.d.ts","sourceRoot":"","sources":["../../../src/sections/contactInfo/selectors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAQ,MAAM,QAAQ,CAAA;AAEnD,OAAO,EAAkB,WAAW,EAAgB,MAAM,SAAS,CAAA;AAiHnE,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,GAAG,WAAW,CAMpF"}
@@ -0,0 +1,104 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.presentContactInfo = presentContactInfo;
7
+ var _solidUi = require("solid-ui");
8
+ function termValue(term) {
9
+ if (!term) return '';
10
+ if (typeof term === 'string') return term;
11
+ return term.value || '';
12
+ }
13
+ function isEmailValue(value) {
14
+ const normalized = (value || '').trim();
15
+ if (!normalized) return false;
16
+ if (/^mailto:/i.test(normalized)) return true;
17
+ return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(normalized);
18
+ }
19
+ function isPhoneValue(value) {
20
+ const normalized = (value || '').trim();
21
+ if (!normalized) return false;
22
+ if (/^tel:/i.test(normalized)) return true;
23
+ return /^[+()\-\s\d]{5,}$/.test(normalized);
24
+ }
25
+ function resolvePointValueNode(store, entryNode, doc, kind) {
26
+ const expected = kind === 'email' ? isEmailValue : isPhoneValue;
27
+ const entryValue = termValue(entryNode);
28
+ if (expected(entryValue)) return entryNode;
29
+ const inDocStatements = store.statementsMatching(entryNode, _solidUi.ns.vcard('value'), null, doc);
30
+ const anyGraphStatements = store.statementsMatching(entryNode, _solidUi.ns.vcard('value'));
31
+ for (const statement of [...inDocStatements, ...anyGraphStatements]) {
32
+ const objectNode = statement.object;
33
+ if (expected(termValue(objectNode))) {
34
+ return objectNode;
35
+ }
36
+ }
37
+ return null;
38
+ }
39
+ function selectEmails(subject, store) {
40
+ const emails = [];
41
+ const emailNodes = store.each(subject, _solidUi.ns.vcard('hasEmail'), null, subject.doc()) || null;
42
+ emailNodes.forEach(node => {
43
+ const valueNode = resolvePointValueNode(store, node, subject.doc(), 'email');
44
+ if (!valueNode) return;
45
+ const type = store.any(node, _solidUi.ns.rdf('type'), null, subject.doc());
46
+ emails.push({
47
+ entryNode: node,
48
+ type,
49
+ valueNode
50
+ });
51
+ });
52
+ return emails;
53
+ }
54
+ /* SAM need to look at this doesn't seem to be working
55
+ although it was working in add-to-contacts button */
56
+ function selectPhones(subject, store) {
57
+ const phoneNumbers = [];
58
+ const phoneNodes = store.each(subject, _solidUi.ns.vcard('hasTelephone'), null, subject.doc()) || null;
59
+ phoneNodes.forEach(node => {
60
+ const valueNode = resolvePointValueNode(store, node, subject.doc(), 'phone');
61
+ if (!valueNode) return;
62
+ const type = store.any(node, _solidUi.ns.rdf('type'), null, subject.doc());
63
+ phoneNumbers.push({
64
+ entryNode: node,
65
+ type,
66
+ valueNode
67
+ });
68
+ });
69
+ return phoneNumbers;
70
+ }
71
+ function selectAddresses(subject, store) {
72
+ const addresses = [];
73
+ const addressNodes = store.each(subject, _solidUi.ns.vcard('hasAddress'), null, subject.doc()) || null;
74
+ addressNodes.map(node => {
75
+ const streetAddress = termValue(store.any(node, _solidUi.ns.vcard('street-address'), null, subject.doc()));
76
+ const locality = termValue(store.any(node, _solidUi.ns.vcard('locality'), null, subject.doc()));
77
+ const region = termValue(store.any(node, _solidUi.ns.vcard('region'), null, subject.doc()));
78
+ const postalCode = termValue(store.any(node, _solidUi.ns.vcard('postal-code'), null, subject.doc()));
79
+ const countryName = termValue(store.any(node, _solidUi.ns.vcard('country-name'), null, subject.doc()));
80
+ const type = store.any(node, _solidUi.ns.rdf('type'), null, subject.doc());
81
+ addresses.push({
82
+ entryNode: node,
83
+ ...(type ? {
84
+ type
85
+ } : {}),
86
+ streetAddress,
87
+ locality,
88
+ region,
89
+ postalCode,
90
+ countryName
91
+ });
92
+ });
93
+ return addresses;
94
+ }
95
+ function presentContactInfo(subject, store) {
96
+ const emails = selectEmails(subject, store);
97
+ const phones = selectPhones(subject, store);
98
+ const addresses = selectAddresses(subject, store);
99
+ return {
100
+ emails,
101
+ phones,
102
+ addresses
103
+ };
104
+ }
@@ -0,0 +1,44 @@
1
+ import { Node } from 'rdflib';
2
+ import { MutationOps } from '../shared/types';
3
+ export interface PointDetails {
4
+ entryNode: Node;
5
+ type: Node;
6
+ valueNode: Node;
7
+ }
8
+ export interface AddressDetails {
9
+ entryNode: Node;
10
+ type?: Node;
11
+ streetAddress?: string;
12
+ locality?: string;
13
+ region?: string;
14
+ postalCode?: string;
15
+ countryName?: string;
16
+ }
17
+ export interface ContactInfo {
18
+ emails: PointDetails[];
19
+ phones: PointDetails[];
20
+ addresses: AddressDetails[];
21
+ }
22
+ export type ContactRowStatus = 'existing' | 'new' | 'modified' | 'deleted';
23
+ export type ContactPointRow = {
24
+ value: string;
25
+ type: string;
26
+ entryNode: string;
27
+ status: ContactRowStatus;
28
+ };
29
+ export type ContactAddressRow = {
30
+ streetAddress?: string;
31
+ locality?: string;
32
+ region?: string;
33
+ postalCode?: string;
34
+ countryName?: string;
35
+ type: string;
36
+ entryNode: string;
37
+ status: ContactRowStatus;
38
+ };
39
+ export type ContactMutationPlan = {
40
+ phoneOps: MutationOps<ContactPointRow>;
41
+ emailOps: MutationOps<ContactPointRow>;
42
+ addressOps: MutationOps<ContactAddressRow>;
43
+ };
44
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/sections/contactInfo/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAC7B,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAG7C,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,IAAI,CAAC;IAChB,IAAI,EAAE,IAAI,CAAC;IACX,SAAS,EAAE,IAAI,CAAA;CAChB;AACD,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,IAAI,CAAC;IAChB,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAED,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,YAAY,EAAE,CAAC;IACvB,MAAM,EAAE,YAAY,EAAE,CAAC;IACvB,SAAS,EAAE,cAAc,EAAE,CAAA;CAC5B;AAED,MAAM,MAAM,gBAAgB,GAAG,UAAU,GAAG,KAAK,GAAG,UAAU,GAAG,SAAS,CAAA;AAE1E,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,MAAM,CAAA;IACjB,MAAM,EAAE,gBAAgB,CAAA;CACzB,CAAA;AAED,MAAM,MAAM,iBAAiB,GAAG;IAC9B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,MAAM,CAAA;IACjB,MAAM,EAAE,gBAAgB,CAAA;CACzB,CAAA;AAED,MAAM,MAAM,mBAAmB,GAAG;IAChC,QAAQ,EAAE,WAAW,CAAC,eAAe,CAAC,CAAA;IACtC,QAAQ,EAAE,WAAW,CAAC,eAAe,CAAC,CAAA;IACtC,UAAU,EAAE,WAAW,CAAC,iBAAiB,CAAC,CAAA;CAC3C,CAAA"}
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -0,0 +1,7 @@
1
+ import { EducationDetails } from './types';
2
+ import '../../styles/EditDialogs.css';
3
+ import '../../styles/ContactInfoEditDialog.css';
4
+ import { LiveStore, NamedNode } from 'rdflib';
5
+ import { ViewerMode } from '../../types';
6
+ export declare function createEducationEditDialog(event: Event, store: LiveStore, subject: NamedNode, educationData: EducationDetails[], viewerMode: ViewerMode, onSaved?: () => Promise<void> | void): Promise<void>;
7
+ //# sourceMappingURL=EducationEditDialog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EducationEditDialog.d.ts","sourceRoot":"","sources":["../../../src/sections/education/EducationEditDialog.ts"],"names":[],"mappings":"AAEA,OAAO,EAAgB,gBAAgB,EAAE,MAAM,SAAS,CAAA;AACxD,OAAO,8BAA8B,CAAA;AACrC,OAAO,wCAAwC,CAAA;AAC/C,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;AAE7C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AA4bxC,wBAAsB,yBAAyB,CAC7C,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,SAAS,EAChB,OAAO,EAAE,SAAS,EAClB,aAAa,EAAE,gBAAgB,EAAE,EACjC,UAAU,EAAE,UAAU,EACtB,OAAO,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,iBAwDrC"}