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,298 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.processSocialMutations = processSocialMutations;
7
+ var _rdflib = require("rdflib");
8
+ var _solidUi = require("solid-ui");
9
+ var _idNodeFactory = require("../shared/idNodeFactory");
10
+ var _rdfMutationHelpers = require("../shared/rdfMutationHelpers");
11
+ var _texts = require("../../texts");
12
+ var _helpers = require("./helpers");
13
+ var _selectors = require("./selectors");
14
+ var _rdfList = require("../shared/rdfList");
15
+ /* The code below for handling reordering were generated by AI Model: GPT-5.3-Codex. */
16
+ /* Prompt: can you implement on SocialEditDialog add the bentoIcon as the first item
17
+ on the row, you should be able to drag this button around and it should allow you
18
+ to change the order of the rows and that should change the order in the mutations
19
+ that happen for this data. */
20
+
21
+ const SOCIAL_ONTOLOGY_NS = 'https://solidos.github.io/profile-pane/src/ontology/socialMedia.ttl#';
22
+ function ensureSocialPrefix(store) {
23
+ const anyStore = store;
24
+ if (typeof anyStore.setPrefixForURI === 'function') {
25
+ anyStore.setPrefixForURI('soc', SOCIAL_ONTOLOGY_NS);
26
+ return;
27
+ }
28
+ if (!anyStore.namespaces) {
29
+ anyStore.namespaces = {};
30
+ }
31
+ anyStore.namespaces.soc = SOCIAL_ONTOLOGY_NS;
32
+ }
33
+ function isSocialPatchDebugEnabled() {
34
+ const debugFlag = globalThis?.__PROFILE_PANE_SOCIAL_DEBUG__;
35
+ return debugFlag === true || debugFlag === '1' || debugFlag === 'true';
36
+ }
37
+ function statementDebugValue(term) {
38
+ if (!term) return '';
39
+ if (typeof term.toNT === 'function') return term.toNT();
40
+ if (typeof term.value === 'string') return term.value;
41
+ return String(term);
42
+ }
43
+ function statementToDebugObject(statement) {
44
+ return {
45
+ subject: statementDebugValue(statement?.subject),
46
+ predicate: statementDebugValue(statement?.predicate),
47
+ object: statementDebugValue(statement?.object),
48
+ graph: statementDebugValue(statement?.why)
49
+ };
50
+ }
51
+ function toObjectNode(value) {
52
+ const normalized = (value || '').trim();
53
+ if (!normalized) return null;
54
+ if (normalized.startsWith('http://') || normalized.startsWith('https://')) {
55
+ return (0, _rdflib.sym)(normalized);
56
+ }
57
+ return (0, _rdflib.literal)(normalized);
58
+ }
59
+ function normalizeValue(value) {
60
+ if (typeof value === 'string') return value.trim();
61
+ if (value === null || value === undefined) return '';
62
+ return String(value).trim();
63
+ }
64
+ function toAccountNameFromHomepage(homepage, profilePrefix) {
65
+ const homepageValue = normalizeValue(homepage);
66
+ if (!homepageValue) return '';
67
+ const prefixValue = normalizeValue(profilePrefix);
68
+ if (prefixValue) {
69
+ let trimmed = homepageValue;
70
+ const lowerPrefix = prefixValue.toLowerCase();
71
+ while (trimmed.toLowerCase().startsWith(lowerPrefix)) {
72
+ trimmed = trimmed.slice(prefixValue.length);
73
+ }
74
+ if (trimmed) return trimmed;
75
+ try {
76
+ const homepageUrl = new URL(homepageValue);
77
+ const prefixUrl = new URL(prefixValue);
78
+ const normalizeHost = host => host.toLowerCase().replace(/^www\./, '');
79
+ const homepageHost = normalizeHost(homepageUrl.hostname);
80
+ const prefixHost = normalizeHost(prefixUrl.hostname);
81
+ const prefixPath = (prefixUrl.pathname || '/').replace(/\/+$/, '');
82
+ const homepagePath = homepageUrl.pathname || '/';
83
+ if (homepageHost === prefixHost && homepagePath.startsWith(prefixPath)) {
84
+ const remainder = homepagePath.slice(prefixPath.length).replace(/^\/+/, '');
85
+ if (remainder) return remainder;
86
+ }
87
+ } catch {
88
+ // Ignore URL parsing issues and continue to generic normalization.
89
+ }
90
+ }
91
+ return homepageValue.replace(/^https?:\/\//i, '').replace(/^www\./i, '');
92
+ }
93
+ function buildSocialStatements(doc, node, row, accountOption) {
94
+ const inserts = [];
95
+ if (accountOption?.classUri) {
96
+ inserts.push((0, _rdflib.st)(node, _solidUi.ns.rdf('type'), (0, _rdflib.sym)(accountOption.classUri), doc));
97
+ }
98
+ const normalizedName = normalizeValue(row.name);
99
+ const isOther = normalizedName.toLowerCase() === 'other' || accountOption?.classUri?.endsWith('#OtherAccount');
100
+ if (isOther) {
101
+ const homepageNode = toObjectNode(row.homepage);
102
+ const iconNode = toObjectNode(row.icon);
103
+ if (homepageNode) inserts.push((0, _rdflib.st)(node, _solidUi.ns.foaf('homepage'), homepageNode, doc));
104
+ if (iconNode) inserts.push((0, _rdflib.st)(node, _solidUi.ns.foaf('icon'), iconNode, doc));
105
+ if (normalizedName && normalizedName.toLowerCase() !== 'other') {
106
+ inserts.push((0, _rdflib.st)(node, _solidUi.ns.rdfs('label'), (0, _rdflib.literal)(normalizedName), doc));
107
+ }
108
+ return inserts;
109
+ }
110
+ const accountPrefix = accountOption?.userProfilePrefix || accountOption?.homepage;
111
+ const accountName = toAccountNameFromHomepage(normalizeValue(row.homepage), accountPrefix);
112
+ if (accountName) {
113
+ inserts.push((0, _rdflib.st)(node, _solidUi.ns.foaf('accountName'), (0, _rdflib.literal)(accountName), doc));
114
+ }
115
+ return inserts;
116
+ }
117
+ function statementKey(statement) {
118
+ return `${statement.subject?.toNT?.() || statement.subject?.value} ${statement.predicate?.toNT?.() || statement.predicate?.value} ${statement.object?.toNT?.() || statement.object?.value} ${statement.why?.toNT?.() || statement.why?.value}`;
119
+ }
120
+ function uniqueStatements(statements) {
121
+ return Array.from(new Map((statements || []).map(statement => [statementKey(statement), statement])).values());
122
+ }
123
+ function buildRdfListStatements(doc, items) {
124
+ if (!items.length) {
125
+ return {
126
+ head: _solidUi.ns.rdf('nil'),
127
+ statements: []
128
+ };
129
+ }
130
+ const listNodes = items.map(() => (0, _rdflib.blankNode)());
131
+ const statements = [];
132
+ items.forEach((item, index) => {
133
+ const current = listNodes[index];
134
+ const next = listNodes[index + 1] || _solidUi.ns.rdf('nil');
135
+ statements.push((0, _rdflib.st)(current, _solidUi.ns.rdf('first'), item, doc));
136
+ statements.push((0, _rdflib.st)(current, _solidUi.ns.rdf('rest'), next, doc));
137
+ });
138
+ return {
139
+ head: listNodes[0],
140
+ statements
141
+ };
142
+ }
143
+ function isPatchFailure(message) {
144
+ const text = (message || '').toLowerCase();
145
+ return text.includes(' on patch ') || text.includes('web error: 400') || text.includes('web error: 405') || text.includes('web error: 501');
146
+ }
147
+ function sanitizePatchStatements(store, deletions, insertions) {
148
+ const safeDeletions = Array.from(new Map((deletions || []).filter(statement => {
149
+ if (!statement || !statement.subject || !statement.predicate || !statement.object) return false;
150
+ if (store.holds(statement.subject, statement.predicate, statement.object, statement.why)) return true;
151
+ return store.statementsMatching(statement.subject, statement.predicate, statement.object, statement.why).length > 0;
152
+ }).map(statement => [statementKey(statement), statement])).values());
153
+ const safeInsertions = Array.from(new Map((insertions || []).filter(statement => Boolean(statement && statement.subject && statement.predicate && statement.object)).map(statement => [statementKey(statement), statement])).values());
154
+ return {
155
+ safeDeletions,
156
+ safeInsertions
157
+ };
158
+ }
159
+ async function runPutFallback(store, doc, deletions, insertions) {
160
+ const updater = store.updater;
161
+ const fetcher = store.fetcher;
162
+ if (!updater || typeof updater.serialize !== 'function' || !fetcher || typeof fetcher.webOperation !== 'function') {
163
+ throw new Error('Social updates are not supported by this store updater.');
164
+ }
165
+ const currentStatements = store.statementsMatching(undefined, undefined, undefined, doc).slice();
166
+ const deletionKeys = new Set((deletions || []).map(statement => statementKey(statement)));
167
+ const nextStatements = currentStatements.filter(statement => !deletionKeys.has(statementKey(statement))).concat(insertions || []);
168
+ const contentType = 'text/turtle';
169
+ const body = updater.serialize(doc.value, nextStatements, contentType);
170
+ const response = await fetcher.webOperation('PUT', doc.value, {
171
+ noMeta: true,
172
+ contentType,
173
+ body
174
+ });
175
+ if (!response || response.ok !== true) {
176
+ const status = response?.status || 'unknown';
177
+ throw new Error(`Web error: ${status} on PUT of <${doc.value}>`);
178
+ }
179
+ store.remove(deletions);
180
+ insertions.forEach(statement => {
181
+ store.add(statement.subject, statement.predicate, statement.object, statement.why);
182
+ });
183
+ }
184
+ async function applySocialPatchWithFallback(store, doc, deletions, insertions) {
185
+ if (!store.updater) {
186
+ throw new Error(_texts.updaterUnsupportedStoreErrorMessageText);
187
+ }
188
+ const {
189
+ safeDeletions,
190
+ safeInsertions
191
+ } = sanitizePatchStatements(store, deletions, insertions);
192
+ if (safeDeletions.length === 0 && safeInsertions.length === 0) {
193
+ return;
194
+ }
195
+ try {
196
+ await (0, _rdfMutationHelpers.applyUpdaterPatch)(store, safeDeletions, safeInsertions);
197
+ return;
198
+ } catch (error) {
199
+ const message = error instanceof Error ? error.message : String(error);
200
+ if (!isPatchFailure(message)) throw error;
201
+ }
202
+ await runPutFallback(store, doc, safeDeletions, safeInsertions);
203
+ }
204
+ function collectListChainNodes(store, listHead, doc) {
205
+ if (!store.any(listHead, _solidUi.ns.rdf('first'), null, doc)) return [];
206
+ const visited = new Set();
207
+ const nodes = [];
208
+ let current = listHead;
209
+ while (current) {
210
+ const key = `${current.termType}:${current.value}`;
211
+ if (visited.has(key)) break;
212
+ visited.add(key);
213
+ nodes.push(current);
214
+ const rest = store.any(current, _solidUi.ns.rdf('rest'), null, doc);
215
+ if (!rest || rest.termType === 'NamedNode' && rest.value === _solidUi.ns.rdf('nil').value) {
216
+ break;
217
+ }
218
+ current = rest;
219
+ }
220
+ return nodes;
221
+ }
222
+ function mergeSocialOps(existingRows, socialOps) {
223
+ const removeKeys = new Set(socialOps.remove.map(row => normalizeValue(row.entryNode)).filter(Boolean));
224
+ const updateByKey = new Map(socialOps.update.map(row => [normalizeValue(row.entryNode), row]).filter(([key]) => Boolean(key)));
225
+ const mergedExisting = existingRows.filter(row => !removeKeys.has(normalizeValue(row.entryNode))).map(row => {
226
+ const key = normalizeValue(row.entryNode);
227
+ return updateByKey.get(key) || row;
228
+ });
229
+ const creates = socialOps.create.filter(row => {
230
+ return Boolean(normalizeValue(row.name) || normalizeValue(row.homepage) || normalizeValue(row.icon));
231
+ });
232
+ return [...mergedExisting, ...creates];
233
+ }
234
+ function rowsFromOrderedInput(orderedRows) {
235
+ return (orderedRows || []).filter(row => row.status !== 'deleted').filter(row => Boolean(normalizeValue(row.name) || normalizeValue(row.homepage) || normalizeValue(row.icon) || normalizeValue(row.entryNode))).map(row => ({
236
+ name: normalizeValue(row.name),
237
+ icon: normalizeValue(row.icon),
238
+ homepage: normalizeValue(row.homepage),
239
+ entryNode: normalizeValue(row.entryNode),
240
+ status: row.status
241
+ }));
242
+ }
243
+ async function mutateSocialEntries(store, subject, socialOps, orderedRows) {
244
+ ensureSocialPrefix(store);
245
+ const doc = subject.doc();
246
+ const accountOptions = (0, _helpers.getSocialAccountOptions)(store);
247
+ const optionForRow = row => (0, _helpers.findSocialAccountOption)(accountOptions, normalizeValue(row.name));
248
+ const existingRows = (0, _selectors.presentSocial)(subject, store).accounts.map(account => ({
249
+ name: normalizeValue(account.name),
250
+ icon: normalizeValue(account.icon),
251
+ homepage: normalizeValue(account.homepage),
252
+ entryNode: account.entryNode.value,
253
+ status: 'existing'
254
+ }));
255
+ const nextRows = orderedRows && orderedRows.length ? rowsFromOrderedInput(orderedRows) : mergeSocialOps(existingRows, socialOps);
256
+ const accountObjects = store.each(subject, _solidUi.ns.foaf('account'), null, doc);
257
+ const existingListNodes = uniqueStatements(accountObjects.flatMap(objectNode => {
258
+ return collectListChainNodes(store, objectNode, doc).flatMap(node => store.statementsMatching(node, null, null, doc));
259
+ }));
260
+ const existingAccountNodes = Array.from(new Map(accountObjects.flatMap(objectNode => (0, _rdfList.expandRdfList)(store, objectNode)).filter(node => node.termType === 'NamedNode').map(node => [`${node.termType}:${node.value}`, node])).values());
261
+ const rowEntryNodes = nextRows.map(row => {
262
+ if (normalizeValue(row.entryNode)) {
263
+ const existing = (0, _rdfMutationHelpers.findExistingNode)(existingAccountNodes, row.entryNode);
264
+ if (existing && existing.termType === 'NamedNode') return existing;
265
+ }
266
+ return (0, _idNodeFactory.createIdNode)(doc);
267
+ });
268
+ const insertions = [];
269
+ if (rowEntryNodes.length > 0) {
270
+ const rdfList = buildRdfListStatements(doc, rowEntryNodes);
271
+ insertions.push((0, _rdflib.st)(subject, _solidUi.ns.foaf('account'), rdfList.head, doc));
272
+ insertions.push(...rdfList.statements);
273
+ }
274
+ nextRows.forEach((row, index) => {
275
+ insertions.push(...buildSocialStatements(doc, rowEntryNodes[index], row, optionForRow(row)));
276
+ });
277
+ const deletions = uniqueStatements([...store.statementsMatching(subject, _solidUi.ns.foaf('account'), null, doc), ...existingListNodes, ...existingAccountNodes.flatMap(node => (0, _rdfMutationHelpers.collectNodeStatements)(store, node, doc))]);
278
+ if (isSocialPatchDebugEnabled()) {
279
+ console.log('[social-mutations] patch payload', {
280
+ subject: subject.value,
281
+ doc: doc.value,
282
+ nextRows,
283
+ deletionsCount: deletions.length,
284
+ insertionsCount: insertions.length,
285
+ deletions: deletions.map(statementToDebugObject),
286
+ insertions: uniqueStatements(insertions).map(statementToDebugObject)
287
+ });
288
+ }
289
+ await applySocialPatchWithFallback(store, doc, deletions, uniqueStatements(insertions));
290
+ }
291
+ async function processSocialMutations(store, subject, mutationPlan, orderedRows) {
292
+ try {
293
+ await mutateSocialEntries(store, subject, mutationPlan, orderedRows);
294
+ } catch (error) {
295
+ const message = error instanceof Error ? error.message : String(error);
296
+ throw new Error(`${_texts.saveSocialUpdatesFailedPrefixText} ${message}`);
297
+ }
298
+ }
@@ -0,0 +1,4 @@
1
+ import { LiveStore, NamedNode } from 'rdflib';
2
+ import { SocialPresentation } from './types';
3
+ export declare function presentSocial(subject: NamedNode, store: LiveStore): SocialPresentation;
4
+ //# sourceMappingURL=selectors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"selectors.d.ts","sourceRoot":"","sources":["../../../src/sections/social/selectors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;AAE7C,OAAO,EAAW,kBAAkB,EAAE,MAAM,SAAS,CAAA;AAUrD,wBAAgB,aAAa,CAC3B,OAAO,EAAE,SAAS,EAClB,KAAK,EAAE,SAAS,GACf,kBAAkB,CA+BpB"}
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.presentSocial = presentSocial;
7
+ var _solidUi = require("solid-ui");
8
+ var _rdfList = require("../shared/rdfList");
9
+ var _helpers = require("./helpers");
10
+ function presentSocial(subject, store) {
11
+ function accountAsObject(ac) {
12
+ return {
13
+ name: (0, _helpers.nameForAccount)(store, ac),
14
+ icon: (0, _helpers.iconForAccount)(store, ac),
15
+ homepage: (0, _helpers.homepageForAccount)(store, ac),
16
+ entryNode: ac
17
+ };
18
+ }
19
+
20
+ // we need to load the social media accounts ontology to be able to query all data needed
21
+ (0, _helpers.ensureSocialOntologyLoaded)(store);
22
+ const accountNodes = store.each(subject, _solidUi.ns.foaf('account'));
23
+ const accountThings = accountNodes.flatMap(node => (0, _rdfList.expandRdfList)(store, node));
24
+ // Deduplicate by foaf:accountName value
25
+ const accountNameSet = new Set();
26
+ const accounts = [];
27
+ for (const ac of accountThings) {
28
+ if (ac.termType === 'NamedNode') {
29
+ const accountNameNode = store.any(ac, _solidUi.ns.foaf('accountName'));
30
+ const dedupeKey = accountNameNode ? accountNameNode.value : '';
31
+ if (!accountNameSet.has(dedupeKey)) {
32
+ accountNameSet.add(dedupeKey);
33
+ accounts.push(accountAsObject(ac));
34
+ }
35
+ }
36
+ }
37
+ if (!accounts.length) return {
38
+ accounts: []
39
+ };
40
+ return {
41
+ accounts
42
+ };
43
+ }
@@ -0,0 +1,19 @@
1
+ import { Node } from 'rdflib';
2
+ import { MutationOps, RowStatus } from '../shared/types';
3
+ export interface SocialFields {
4
+ name?: string;
5
+ icon?: string;
6
+ homepage?: string;
7
+ }
8
+ export interface Account extends SocialFields {
9
+ entryNode: Node;
10
+ }
11
+ export interface SocialPresentation {
12
+ accounts: Account[];
13
+ }
14
+ export interface SocialRow extends SocialFields {
15
+ entryNode: string;
16
+ status: RowStatus;
17
+ }
18
+ export type SocialMutationPlan = MutationOps<SocialRow>;
19
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/sections/social/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAC7B,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAExD,MAAM,WAAW,YAAY;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAED,MAAM,WAAW,OAAQ,SAAQ,YAAY;IAC3C,SAAS,EAAE,IAAI,CAAA;CAChB;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,OAAO,EAAE,CAAA;CACpB;AAED,MAAM,WAAW,SAAU,SAAQ,YAAY;IAC7C,SAAS,EAAE,MAAM,CAAA;IACjB,MAAM,EAAE,SAAS,CAAA;CAClB;AAED,MAAM,MAAM,kBAAkB,GAAG,WAAW,CAAC,SAAS,CAAC,CAAA"}
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -0,0 +1,77 @@
1
+ .bioDescriptionWrap {
2
+ margin: 0;
3
+ position: relative;
4
+ isolation: isolate;
5
+ }
6
+
7
+ .bioDescriptionText {
8
+ margin: 0;
9
+ width: 100%;
10
+ max-width: none;
11
+ display: -webkit-box;
12
+ -webkit-box-orient: vertical;
13
+ -webkit-line-clamp: 3;
14
+ line-clamp: 3;
15
+ line-height: var(--line-height-base, 1.5);
16
+ position: relative;
17
+ overflow: hidden;
18
+ }
19
+
20
+ .bioDescriptionText:not(.isExpanded)::after {
21
+ content: '';
22
+ position: absolute;
23
+ right: 0;
24
+ top: calc(100% - 1.5em);
25
+ width: 50%;
26
+ height: 1.5em;
27
+ background: var(--color-card-bg);
28
+ pointer-events: none;
29
+ }
30
+
31
+ .bioDescriptionText.isExpanded {
32
+ display: block;
33
+ -webkit-line-clamp: unset;
34
+ line-clamp: unset;
35
+ overflow: visible;
36
+ }
37
+
38
+ .bioDescriptionToggle {
39
+ margin: 0;
40
+ padding: 0;
41
+ border: 0;
42
+ background: none;
43
+ color: var(--color-primary);
44
+ cursor: pointer;
45
+ font: inherit;
46
+ font-size: var(--font-size-sm);
47
+ line-height: var(--line-height-base, 1.5);
48
+ position: absolute;
49
+ left: 50%;
50
+ bottom: 0;
51
+ background-color: var(--color-card-bg);
52
+ white-space: nowrap;
53
+ min-height: auto;
54
+ min-width: auto;
55
+ padding-left: 0;
56
+ padding-right: 0;
57
+ padding-top: 0;
58
+ padding-bottom: 0;
59
+ margin-left: 0;
60
+ margin-right: 0;
61
+ z-index: 0;
62
+ }
63
+
64
+ .bioDescriptionWrap .bioDescriptionText:not(.isExpanded) + .bioDescriptionToggle {
65
+ top: calc(100% - 1.5em + 0.28em - 12px);
66
+ bottom: auto;
67
+ transform: translateY(7px);
68
+ }
69
+
70
+ .bioDescriptionText.isExpanded + .bioDescriptionToggle {
71
+ position: static;
72
+ display: inline;
73
+ padding-left: 0;
74
+ top: auto;
75
+ bottom: auto;
76
+ transform: none;
77
+ }
@@ -5,18 +5,123 @@
5
5
  margin-bottom: 1.25em;
6
6
  }
7
7
 
8
+ .cvSection > ul {
9
+ list-style: none;
10
+ margin: 0;
11
+ padding: 0;
12
+ }
13
+
8
14
  .cvRole {
9
- margin: var(--spacing-xs) 0;
15
+ margin: 0 0 var(--spacing-xs) 0;
10
16
  font-size: var(--font-size-base);
11
17
  line-height: var(--line-height-base);
12
18
  display: flex;
13
19
  flex-direction: column;
14
- gap: 0.2em;
20
+ gap: 0;
21
+ }
22
+
23
+ .cvRole:last-child {
24
+ margin-bottom: 0;
25
+ }
26
+
27
+ .cvRoleHeader {
28
+ display: flex;
29
+ flex-direction: row;
30
+ justify-content: space-between;
31
+ align-items: baseline;
32
+ gap: var(--spacing-sm);
33
+ }
34
+
35
+ .cvRoleHeader h4,
36
+ .cvRoleHeader time {
37
+ margin: 0;
38
+ }
39
+
40
+ .cvRolePeriod {
41
+ margin: 0;
42
+ font-size: var(--font-size-sm);
43
+ line-height: var(--line-height-tight);
44
+ }
45
+
46
+ @media (max-width: 640px) {
47
+ .cvRoleHeader {
48
+ flex-direction: column;
49
+ align-items: flex-start;
50
+ }
15
51
  }
16
52
 
17
53
  .cvOrg {
18
54
  font-weight: 600;
19
55
  color: var(--color-primary);
56
+ margin: 0;
57
+ }
58
+
59
+ .cvDescriptionWrap {
60
+ margin: 0;
61
+ position: relative;
62
+ isolation: isolate;
63
+ }
64
+
65
+ .cvDescriptionText {
66
+ margin: 0;
67
+ width: 100%;
68
+ max-width: none;
69
+ display: -webkit-box;
70
+ -webkit-box-orient: vertical;
71
+ -webkit-line-clamp: 2;
72
+ line-clamp: 2;
73
+ line-height: var(--line-height-base);
74
+ padding-right: 4.5em;
75
+ overflow: hidden;
76
+ }
77
+
78
+ .cvDescriptionText.isExpanded {
79
+ display: block;
80
+ -webkit-line-clamp: unset;
81
+ line-clamp: unset;
82
+ padding-right: 0;
83
+ overflow: visible;
84
+ }
85
+
86
+ .cvDescriptionToggle {
87
+ margin: 0;
88
+ padding: 0;
89
+ border: 0;
90
+ background: none;
91
+ color: var(--color-primary);
92
+ cursor: pointer;
93
+ font: inherit;
94
+ font-size: var(--font-size-sm);
95
+ line-height: var(--line-height-base, 1.5);
96
+ position: absolute;
97
+ right: 0;
98
+ bottom: 0;
99
+ background-color: var(--color-card-bg);
100
+ white-space: nowrap;
101
+ min-height: auto;
102
+ min-width: auto;
103
+ padding-left: 0;
104
+ padding-right: 0;
105
+ padding-top: 0;
106
+ padding-bottom: 0;
107
+ margin-left: 0;
108
+ margin-right: 0;
109
+ z-index: 0;
110
+ }
111
+
112
+ .cvDescriptionWrap .cvDescriptionText:not(.isExpanded) + .cvDescriptionToggle {
113
+ top: calc(100% - 1.5em + 0.28em - 11px);
114
+ bottom: auto;
115
+ transform: translateY(7px);
116
+ }
117
+
118
+ .cvDescriptionText.isExpanded + .cvDescriptionToggle {
119
+ position: static;
120
+ display: inline;
121
+ padding-left: 0;
122
+ top: auto;
123
+ bottom: auto;
124
+ transform: none;
20
125
  }
21
126
 
22
127
  .cvSkill, .cvLanguage {