profile-pane 3.2.0 → 3.2.2-test.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 (256) hide show
  1. package/README.md +50 -0
  2. package/icons-png/discord.png +0 -0
  3. package/icons-png/dribbble.png +0 -0
  4. package/icons-png/facebook.png +0 -0
  5. package/icons-png/instagram.png +0 -0
  6. package/icons-png/linkedin.png +0 -0
  7. package/icons-png/pinterest.png +0 -0
  8. package/icons-png/sharechat.png +0 -0
  9. package/icons-png/signup.png +0 -0
  10. package/icons-png/snapchat.png +0 -0
  11. package/icons-png/spotify.png +0 -0
  12. package/icons-png/telegram.png +0 -0
  13. package/icons-png/tiktok.png +0 -0
  14. package/icons-png/whatsapp.png +0 -0
  15. package/icons-png/x.png +0 -0
  16. package/icons-png/youtube.png +0 -0
  17. package/lib/303.profile-pane.js +1362 -0
  18. package/lib/303.profile-pane.js.map +1 -0
  19. package/lib/303.profile-pane.min.js +2 -0
  20. package/lib/303.profile-pane.min.js.map +1 -0
  21. package/lib/ProfileView.css +1090 -0
  22. package/lib/ProfileView.d.ts +2 -1
  23. package/lib/ProfileView.d.ts.map +1 -1
  24. package/lib/ProfileView.js +64 -36
  25. package/lib/buttonsHelper.d.ts +1 -1
  26. package/lib/buttonsHelper.d.ts.map +1 -1
  27. package/lib/buttonsHelper.js +2 -1
  28. package/lib/editProfilePane/EditCVCard.js +1 -1
  29. package/lib/editProfilePane/EditCommunitiesCard.js +1 -1
  30. package/lib/editProfilePane/EditFriendsCard.js +1 -1
  31. package/lib/editProfilePane/EditProfileView.d.ts +1 -1
  32. package/lib/editProfilePane/EditProfileView.d.ts.map +1 -1
  33. package/lib/editProfilePane/EditProfileView.js +4 -5
  34. package/lib/editProfilePane/editProfilePresenter.d.ts.map +1 -1
  35. package/lib/editProfilePane/editProfilePresenter.js +5 -4
  36. package/lib/icons-svg/profileIcons.d.ts +1 -1
  37. package/lib/icons-svg/profileIcons.d.ts.map +1 -1
  38. package/lib/icons-svg/profileIcons.js +9 -17
  39. package/lib/index.d.ts +1 -8
  40. package/lib/index.d.ts.map +1 -1
  41. package/lib/index.js +74 -40
  42. package/lib/ontology/otherPreferencesForm.ttl +32 -0
  43. package/lib/ontology/resumeForm.ttl +349 -0
  44. package/lib/ontology/socialMedia.ttl +433 -0
  45. package/lib/profile-pane.js +32266 -13247
  46. package/lib/profile-pane.js.map +1 -1
  47. package/lib/profile-pane.min.js +2315 -935
  48. package/lib/profile-pane.min.js.map +1 -1
  49. package/lib/rdfFormsHelper.d.ts +13 -1
  50. package/lib/rdfFormsHelper.d.ts.map +1 -1
  51. package/lib/rdfFormsHelper.js +13 -1
  52. package/lib/sections/bio/BioEditDialog.d.ts.map +1 -1
  53. package/lib/sections/bio/BioEditDialog.js +7 -7
  54. package/lib/sections/bio/BioSection.css +300 -0
  55. package/lib/sections/bio/BioSection.d.ts +3 -2
  56. package/lib/sections/bio/BioSection.d.ts.map +1 -1
  57. package/lib/sections/bio/BioSection.js +26 -19
  58. package/lib/sections/bio/mutations.d.ts.map +1 -1
  59. package/lib/sections/bio/mutations.js +14 -3
  60. package/lib/sections/contactInfo/ContactInfoEditDialog.css +354 -0
  61. package/lib/sections/contactInfo/ContactInfoEditDialog.d.ts +3 -1
  62. package/lib/sections/contactInfo/ContactInfoEditDialog.d.ts.map +1 -1
  63. package/lib/sections/contactInfo/ContactInfoEditDialog.js +183 -98
  64. package/lib/sections/contactInfo/ContactInfoSection.css +125 -0
  65. package/lib/sections/contactInfo/ContactInfoSection.d.ts +2 -0
  66. package/lib/sections/contactInfo/ContactInfoSection.d.ts.map +1 -1
  67. package/lib/sections/contactInfo/ContactInfoSection.js +64 -41
  68. package/lib/sections/contactInfo/mutations.d.ts.map +1 -1
  69. package/lib/sections/contactInfo/mutations.js +51 -16
  70. package/lib/sections/education/EducationEditDialog.d.ts +3 -1
  71. package/lib/sections/education/EducationEditDialog.d.ts.map +1 -1
  72. package/lib/sections/education/EducationEditDialog.js +170 -92
  73. package/lib/sections/education/EducationSection.css +133 -0
  74. package/lib/sections/education/EducationSection.d.ts +3 -2
  75. package/lib/sections/education/EducationSection.d.ts.map +1 -1
  76. package/lib/sections/education/EducationSection.js +32 -25
  77. package/lib/sections/education/mutations.d.ts.map +1 -1
  78. package/lib/sections/education/mutations.js +14 -3
  79. package/lib/sections/heading/HeadingEditDialog.d.ts +4 -1
  80. package/lib/sections/heading/HeadingEditDialog.d.ts.map +1 -1
  81. package/lib/sections/heading/HeadingEditDialog.js +287 -162
  82. package/lib/sections/heading/HeadingSection.css +862 -0
  83. package/lib/sections/heading/HeadingSection.d.ts +3 -2
  84. package/lib/sections/heading/HeadingSection.d.ts.map +1 -1
  85. package/lib/sections/heading/HeadingSection.js +63 -32
  86. package/lib/sections/heading/imageHelpers.d.ts +1 -0
  87. package/lib/sections/heading/imageHelpers.d.ts.map +1 -1
  88. package/lib/sections/heading/imageHelpers.js +40 -1
  89. package/lib/sections/heading/mutations.d.ts.map +1 -1
  90. package/lib/sections/heading/mutations.js +86 -23
  91. package/lib/sections/heading/selectors.d.ts.map +1 -1
  92. package/lib/sections/heading/selectors.js +14 -3
  93. package/lib/sections/heading/types.d.ts +1 -2
  94. package/lib/sections/heading/types.d.ts.map +1 -1
  95. package/lib/sections/languages/LanguageEditDialog.d.ts +3 -1
  96. package/lib/sections/languages/LanguageEditDialog.d.ts.map +1 -1
  97. package/lib/sections/languages/LanguageEditDialog.js +202 -119
  98. package/lib/sections/languages/LanguageSection.css +53 -0
  99. package/lib/sections/languages/LanguageSection.d.ts +2 -0
  100. package/lib/sections/languages/LanguageSection.d.ts.map +1 -1
  101. package/lib/sections/languages/LanguageSection.js +42 -31
  102. package/lib/sections/languages/mutations.d.ts.map +1 -1
  103. package/lib/sections/languages/mutations.js +60 -161
  104. package/lib/sections/languages/selectors.d.ts.map +1 -1
  105. package/lib/sections/languages/selectors.js +1 -2
  106. package/lib/sections/projects/ProjectEditDialog.d.ts +2 -1
  107. package/lib/sections/projects/ProjectEditDialog.d.ts.map +1 -1
  108. package/lib/sections/projects/ProjectEditDialog.js +13 -24
  109. package/lib/sections/projects/ProjectSection.css +368 -0
  110. package/lib/sections/projects/ProjectSection.d.ts +2 -1
  111. package/lib/sections/projects/ProjectSection.d.ts.map +1 -1
  112. package/lib/sections/projects/ProjectSection.js +116 -34
  113. package/lib/sections/projects/mutations.d.ts.map +1 -1
  114. package/lib/sections/projects/mutations.js +109 -132
  115. package/lib/sections/projects/selectors.d.ts.map +1 -1
  116. package/lib/sections/projects/selectors.js +4 -45
  117. package/lib/{QRCodeCard.d.ts → sections/qrcode/QRCodeCard.d.ts} +2 -1
  118. package/lib/sections/qrcode/QRCodeCard.d.ts.map +1 -0
  119. package/lib/{QRCodeCard.js → sections/qrcode/QRCodeCard.js} +59 -11
  120. package/lib/sections/qrcode/QRCodeSection.css +108 -0
  121. package/lib/sections/qrcode/QRCodeSection.d.ts +4 -0
  122. package/lib/sections/qrcode/QRCodeSection.d.ts.map +1 -0
  123. package/lib/sections/qrcode/QRCodeSection.js +17 -0
  124. package/lib/sections/resume/ResumeEditDialog.d.ts +10 -1
  125. package/lib/sections/resume/ResumeEditDialog.d.ts.map +1 -1
  126. package/lib/sections/resume/ResumeEditDialog.js +531 -149
  127. package/lib/sections/resume/ResumeSection.css +350 -0
  128. package/lib/sections/resume/ResumeSection.d.ts +3 -2
  129. package/lib/sections/resume/ResumeSection.d.ts.map +1 -1
  130. package/lib/sections/resume/ResumeSection.js +78 -49
  131. package/lib/sections/resume/mutations.d.ts.map +1 -1
  132. package/lib/sections/resume/mutations.js +17 -3
  133. package/lib/sections/resume/selectors.d.ts.map +1 -1
  134. package/lib/sections/resume/selectors.js +1 -0
  135. package/lib/sections/resume/types.d.ts +1 -0
  136. package/lib/sections/resume/types.d.ts.map +1 -1
  137. package/lib/sections/shared/collapsibleSection.d.ts.map +1 -1
  138. package/lib/sections/shared/collapsibleSection.js +1 -0
  139. package/lib/sections/shared/phoneCountries.d.ts +1 -1
  140. package/lib/sections/shared/phoneCountries.d.ts.map +1 -1
  141. package/lib/sections/shared/phoneCountries.js +2 -2
  142. package/lib/sections/shared/projectCommunityNodes.d.ts +6 -0
  143. package/lib/sections/shared/projectCommunityNodes.d.ts.map +1 -0
  144. package/lib/sections/shared/projectCommunityNodes.js +56 -0
  145. package/lib/sections/shared/rdfMutationHelpers.d.ts +35 -2
  146. package/lib/sections/shared/rdfMutationHelpers.d.ts.map +1 -1
  147. package/lib/sections/shared/rdfMutationHelpers.js +290 -14
  148. package/lib/sections/shared/sectionCardHelpers.d.ts.map +1 -1
  149. package/lib/sections/shared/sectionCardHelpers.js +80 -11
  150. package/lib/sections/shared/types.d.ts +24 -0
  151. package/lib/sections/shared/types.d.ts.map +1 -1
  152. package/lib/sections/skills/SkillsEditDialog.d.ts +3 -1
  153. package/lib/sections/skills/SkillsEditDialog.d.ts.map +1 -1
  154. package/lib/sections/skills/SkillsEditDialog.js +136 -115
  155. package/lib/sections/skills/SkillsSection.css +173 -0
  156. package/lib/sections/skills/SkillsSection.d.ts +2 -0
  157. package/lib/sections/skills/SkillsSection.d.ts.map +1 -1
  158. package/lib/sections/skills/SkillsSection.js +107 -47
  159. package/lib/sections/skills/mutations.d.ts.map +1 -1
  160. package/lib/sections/skills/mutations.js +25 -21
  161. package/lib/sections/skills/selectors.d.ts.map +1 -1
  162. package/lib/sections/skills/selectors.js +5 -3
  163. package/lib/sections/social/SocialEditDialog.d.ts +3 -1
  164. package/lib/sections/social/SocialEditDialog.d.ts.map +1 -1
  165. package/lib/sections/social/SocialEditDialog.js +170 -62
  166. package/lib/sections/social/SocialSection.css +194 -0
  167. package/lib/sections/social/SocialSection.d.ts +4 -3
  168. package/lib/sections/social/SocialSection.d.ts.map +1 -1
  169. package/lib/sections/social/SocialSection.js +59 -43
  170. package/lib/sections/social/mutations.d.ts.map +1 -1
  171. package/lib/sections/social/mutations.js +23 -132
  172. package/lib/specialButtons/AddMeToYourFriends.css +54 -0
  173. package/lib/specialButtons/addContact/AddMeToYourContacts.css +1118 -0
  174. package/lib/specialButtons/addContact/ContactCreationDialog.d.ts +10 -0
  175. package/lib/specialButtons/addContact/ContactCreationDialog.d.ts.map +1 -0
  176. package/lib/specialButtons/addContact/ContactCreationDialog.js +1123 -0
  177. package/lib/specialButtons/addContact/addMeToYourContacts.d.ts +16 -0
  178. package/lib/specialButtons/addContact/addMeToYourContacts.d.ts.map +1 -0
  179. package/lib/specialButtons/addContact/addMeToYourContacts.js +136 -0
  180. package/lib/specialButtons/addContact/contactsErrors.d.ts +8 -0
  181. package/lib/specialButtons/addContact/contactsErrors.d.ts.map +1 -0
  182. package/lib/specialButtons/addContact/contactsErrors.js +106 -0
  183. package/lib/specialButtons/addContact/contactsTypes.d.ts +43 -0
  184. package/lib/specialButtons/addContact/contactsTypes.d.ts.map +1 -0
  185. package/lib/specialButtons/addContact/contactsTypes.js +5 -0
  186. package/lib/specialButtons/addContact/helpers.d.ts +7 -0
  187. package/lib/specialButtons/addContact/helpers.d.ts.map +1 -0
  188. package/lib/specialButtons/addContact/helpers.js +103 -0
  189. package/lib/specialButtons/addContact/mutations.d.ts +16 -0
  190. package/lib/specialButtons/addContact/mutations.d.ts.map +1 -0
  191. package/lib/specialButtons/addContact/mutations.js +300 -0
  192. package/lib/specialButtons/addContact/selectors.d.ts +10 -0
  193. package/lib/specialButtons/addContact/selectors.d.ts.map +1 -0
  194. package/lib/specialButtons/addContact/selectors.js +163 -0
  195. package/lib/{addMeToYourFriends.d.ts → specialButtons/addMeToYourFriends.d.ts} +6 -4
  196. package/lib/specialButtons/addMeToYourFriends.d.ts.map +1 -0
  197. package/lib/{addMeToYourFriends.js → specialButtons/addMeToYourFriends.js} +46 -11
  198. package/lib/styles/CollapsibleSection.css +519 -0
  199. package/lib/styles/EditDialogs.css +506 -686
  200. package/lib/styles/EditDialogs.responsive.css +989 -0
  201. package/lib/texts/buttonTexts.d.ts +9 -0
  202. package/lib/texts/buttonTexts.d.ts.map +1 -0
  203. package/lib/texts/buttonTexts.js +14 -0
  204. package/lib/texts/dialogTexts.d.ts +14 -0
  205. package/lib/texts/dialogTexts.d.ts.map +1 -0
  206. package/lib/texts/dialogTexts.js +19 -0
  207. package/lib/texts/messageTexts.d.ts +42 -0
  208. package/lib/texts/messageTexts.d.ts.map +1 -0
  209. package/lib/texts/messageTexts.js +47 -0
  210. package/lib/texts/profileTexts.d.ts +14 -0
  211. package/lib/texts/profileTexts.d.ts.map +1 -0
  212. package/lib/texts/profileTexts.js +19 -0
  213. package/lib/texts/qrCodeTexts.d.ts +2 -0
  214. package/lib/texts/qrCodeTexts.d.ts.map +1 -0
  215. package/lib/texts/qrCodeTexts.js +7 -0
  216. package/lib/texts.d.ts +5 -60
  217. package/lib/texts.d.ts.map +1 -1
  218. package/lib/texts.js +55 -70
  219. package/lib/ui/dialog.css +233 -0
  220. package/lib/ui/dialog.d.ts +15 -1
  221. package/lib/ui/dialog.d.ts.map +1 -1
  222. package/lib/ui/dialog.js +245 -45
  223. package/lib/ui/dialog.responsive.css +195 -0
  224. package/lib/ui/errors.d.ts.map +1 -1
  225. package/lib/ui/errors.js +2 -1
  226. package/lib/ui/spinner.d.ts +3 -0
  227. package/lib/ui/spinner.d.ts.map +1 -0
  228. package/lib/ui/spinner.js +13 -0
  229. package/lib/utils/debug.d.ts +5 -0
  230. package/lib/utils/debug.d.ts.map +1 -0
  231. package/lib/utils/debug.js +23 -0
  232. package/lib/utils/errorDisplay.d.ts +2 -0
  233. package/lib/utils/errorDisplay.d.ts.map +1 -0
  234. package/lib/utils/errorDisplay.js +19 -0
  235. package/package.json +34 -26
  236. package/lib/ChatWithMe.d.ts +0 -7
  237. package/lib/ChatWithMe.d.ts.map +0 -1
  238. package/lib/ChatWithMe.js +0 -90
  239. package/lib/QRCodeCard.d.ts.map +0 -1
  240. package/lib/addMeToYourFriends.d.ts.map +0 -1
  241. package/lib/sections/heading/camera.d.ts +0 -19
  242. package/lib/sections/heading/camera.d.ts.map +0 -1
  243. package/lib/sections/heading/camera.js +0 -199
  244. package/lib/styles/BioSection.css +0 -77
  245. package/lib/styles/CVCard.css +0 -142
  246. package/lib/styles/ChatWithMe.css +0 -6
  247. package/lib/styles/ContactInfoEditDialog.css +0 -153
  248. package/lib/styles/EducationCard.css +0 -103
  249. package/lib/styles/HeadingSection.css +0 -309
  250. package/lib/styles/ProfileCard.css +0 -66
  251. package/lib/styles/ProfileView.css +0 -65
  252. package/lib/styles/ProjectsCard.css +0 -206
  253. package/lib/styles/QRCodeCard.css +0 -43
  254. package/lib/styles/SocialCard.css +0 -89
  255. package/lib/styles/dialog.css +0 -209
  256. package/lib/styles/utilities.css +0 -740
@@ -5,7 +5,9 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.renderLanguageSection = renderLanguageSection;
7
7
  var _litHtml = require("lit-html");
8
+ require("solid-ui/components/actions/button");
8
9
  var _solidUi = require("solid-ui");
10
+ require("./LanguageSection.css");
9
11
  var _LanguageEditDialog = require("./LanguageEditDialog");
10
12
  var _profileIcons = require("../../icons-svg/profileIcons");
11
13
  var _texts = require("../../texts");
@@ -24,42 +26,47 @@ function renderLanguagesSectionDefault(store, subject, languages, viewerMode, on
24
26
  const isOwner = viewerMode === 'owner';
25
27
  return (0, _litHtml.html)`
26
28
  <section
27
- class="profile__section border-lighter profile-section-collapsible profile-section-collapsible--inline-mobile-actions"
29
+ class="profile__section profile-section-collapsible profile-section-collapsible--inline-mobile-actions"
30
+ data-profile-section="languages"
28
31
  aria-labelledby="languages-heading"
29
32
  role="region"
30
33
  tabindex="-1"
31
34
  data-expanded="false"
32
35
  >
33
36
  <header class="profile__section-header profile-section-collapsible__header">
34
- <h2 id="languages-heading">${_texts.languagesHeadingText}</h2>
35
- <div class="profile-section-collapsible__actions flex-column">
37
+ <h3 id="languages-heading">${_texts.languagesHeadingText}</h3>
38
+ <div class="profile-section-collapsible__actions">
36
39
  ${isOwner ? (0, _litHtml.html)`
37
- <button
40
+ <solid-ui-button
38
41
  type="button"
39
- class="profile__action-button profile-action-text flex-center profile-section-collapsible__edit-button"
42
+ variant="secondary"
43
+ size="sm"
44
+ class="profile__action-button profile-action-text profile-section-collapsible__edit-button"
40
45
  aria-label="Add or edit languages"
41
46
  @click=${event => (0, _LanguageEditDialog.createLanguageEditDialog)(event, store, subject, languages, viewerMode, onSaved)}
42
47
  >
43
- <span class="profile-section-collapsible__edit-label profile__add-more-content inline-flex-row">
44
- <span class="profile__add-more-icon inline-flex-row" aria-hidden="true">${_profileIcons.addIcon}</span>
45
- Add More
48
+ <span class="profile-section-collapsible__edit-label profile__add-more-content">
49
+ <span class="profile__add-more-icon" aria-hidden="true">${_profileIcons.addIcon}</span>
50
+ <span>Add More</span>
46
51
  </span>
47
52
  <span class="profile-section-collapsible__edit-icon" aria-hidden="true">${_profileIcons.editIcon}</span>
48
- </button>
53
+ </solid-ui-button>
49
54
  ` : (0, _litHtml.html)``}
50
- <button
55
+ <solid-ui-button
51
56
  type="button"
52
- class="inline-flex-row"
57
+ variant="icon"
58
+ size="sm"
59
+ class="profile-section-collapsible__toggle-button"
53
60
  aria-label="Toggle languages section"
54
61
  aria-controls="languages-panel"
55
62
  aria-expanded="false"
56
63
  @click=${_collapsibleSection.toggleCollapsibleSection}
57
64
  >
58
- <span class="profile-section-collapsible__chevron" aria-hidden="true">⌄</span>
59
- </button>
65
+ <span slot="icon" class="profile-section-collapsible__chevron" aria-hidden="true">${_profileIcons.chevronDownIcon}</span>
66
+ </solid-ui-button>
60
67
  </div>
61
68
  </header>
62
- <div id="languages-panel" class="profile-section-collapsible__content" aria-hidden="true">
69
+ <div id="languages-panel" class="profile-section-collapsible__content">
63
70
  ${hasLanguages ? (0, _litHtml.html)`
64
71
  <ul class="languages__list" role="list" aria-label="Known languages">
65
72
  ${renderLanguages(languages, true)}
@@ -71,9 +78,9 @@ function renderLanguagesSectionDefault(store, subject, languages, viewerMode, on
71
78
  }
72
79
  function renderOwnerEmptyLanguagesContent(_store, _subject, _languages, _viewerMode, _onSaved) {
73
80
  return (0, _litHtml.html)`
74
- <div class="profile__empty-state-content flex-column-center" role="group" aria-label="Empty languages section">
81
+ <div class="profile__empty-state-content" role="group" aria-label="Empty languages section">
75
82
  <div class="languages__empty-icon-wrapper">
76
- <span class="languages__empty-icon inline-flex-row">${_profileIcons.commentIcon}</span>
83
+ <span class="languages__empty-icon">${_profileIcons.commentIcon}</span>
77
84
  </div>
78
85
  <p class="profile__empty-state-message languages__empty-message">
79
86
  No languages added yet.
@@ -86,41 +93,45 @@ function renderOwnerEmptyLanguagesSection(store, subject, languages, viewerMode,
86
93
  <section
87
94
  aria-labelledby="languages-heading"
88
95
  data-profile-section="languages"
89
- class="profile__section--empty border-lighter rounded-md gap-lg profile-section-collapsible profile-section-collapsible--inline-mobile-actions"
96
+ class="profile__section--empty profile__section--empty-sidebar profile-section-collapsible profile-section-collapsible--inline-mobile-actions"
90
97
  role="region"
91
98
  tabindex="-1"
92
99
  data-expanded="false"
93
100
  >
94
101
  <header class="profile__section-header profile-section-collapsible__header">
95
- <h2 id="languages-heading" tabindex="-1">${_texts.languagesHeadingText}</h2>
96
- <div class="profile-section-collapsible__actions flex-column">
97
- <button
102
+ <h3 id="languages-heading" tabindex="-1">${_texts.languagesHeadingText}</h3>
103
+ <div class="profile-section-collapsible__actions">
104
+ <solid-ui-button
98
105
  type="button"
99
- class="profile__action-button profile-action-text flex-center profile-section-collapsible__edit-button"
106
+ variant="secondary"
107
+ size="sm"
108
+ class="profile__action-button profile-action-text profile-section-collapsible__edit-button"
100
109
  aria-label="Add languages"
101
110
  @click=${event => {
102
111
  return (0, _LanguageEditDialog.createLanguageEditDialog)(event, store, subject, languages, viewerMode, onSaved);
103
112
  }}
104
113
  >
105
- <span class="profile-section-collapsible__edit-label profile__add-more-content inline-flex-row">
106
- <span class="profile__add-more-icon inline-flex-row" aria-hidden="true">${_profileIcons.addIcon}</span>
107
- Add Languages
114
+ <span class="profile-section-collapsible__edit-label profile__add-more-content">
115
+ <span class="profile__add-more-icon" aria-hidden="true">${_profileIcons.addIcon}</span>
116
+ <span>Add More</span>
108
117
  </span>
109
- <span class="profile-section-collapsible__edit-icon profile-section-collapsible__edit-icon--add" aria-hidden="true">${_profileIcons.plusIcon}</span>
110
- </button>
111
- <button
118
+ <span class="profile-section-collapsible__edit-icon" aria-hidden="true">${_profileIcons.editIcon}</span>
119
+ </solid-ui-button>
120
+ <solid-ui-button
112
121
  type="button"
113
- class="inline-flex-row"
122
+ variant="icon"
123
+ size="sm"
124
+ class="profile-section-collapsible__toggle-button"
114
125
  aria-label="Toggle languages section"
115
126
  aria-controls="languages-panel"
116
127
  aria-expanded="false"
117
128
  @click=${_collapsibleSection.toggleCollapsibleSection}
118
129
  >
119
- <span class="profile-section-collapsible__chevron" aria-hidden="true">⌄</span>
120
- </button>
130
+ <span slot="icon" class="profile-section-collapsible__chevron" aria-hidden="true">${_profileIcons.chevronDownIcon}</span>
131
+ </solid-ui-button>
121
132
  </div>
122
133
  </header>
123
- <div id="languages-panel" class="profile-section-collapsible__content" aria-hidden="true">
134
+ <div id="languages-panel" class="profile-section-collapsible__content">
124
135
  ${renderOwnerEmptyLanguagesContent(store, subject, languages, viewerMode, onSaved)}
125
136
  </div>
126
137
  </section>
@@ -1 +1 @@
1
- {"version":3,"file":"mutations.d.ts","sourceRoot":"","sources":["../../../src/sections/languages/mutations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,SAAS,EAAE,SAAS,EAAoB,MAAM,QAAQ,CAAA;AAE1E,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAM7C,MAAM,MAAM,oBAAoB,GAAG,WAAW,CAAC,WAAW,CAAC,CAAA;AAqW3D,wBAAsB,wBAAwB,CAC5C,KAAK,EAAE,SAAS,EAChB,OAAO,EAAE,SAAS,EAClB,YAAY,EAAE,oBAAoB,EAClC,WAAW,CAAC,EAAE,WAAW,EAAE,iBAS5B"}
1
+ {"version":3,"file":"mutations.d.ts","sourceRoot":"","sources":["../../../src/sections/languages/mutations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,SAAS,EAAE,SAAS,EAA0B,MAAM,QAAQ,CAAA;AAE5F,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AACrC,OAAO,EAAE,WAAW,EAAuD,MAAM,iBAAiB,CAAA;AAQlG,MAAM,MAAM,oBAAoB,GAAG,WAAW,CAAC,WAAW,CAAC,CAAA;AAgP3D,wBAAsB,wBAAwB,CAC5C,KAAK,EAAE,SAAS,EAChB,OAAO,EAAE,SAAS,EAClB,YAAY,EAAE,oBAAoB,EAClC,WAAW,CAAC,EAAE,WAAW,EAAE,iBAU5B"}
@@ -10,24 +10,14 @@ var _selectors = require("./selectors");
10
10
  var _rdfList = require("../shared/rdfList");
11
11
  var _idNodeFactory = require("../shared/idNodeFactory");
12
12
  var _texts = require("../../texts");
13
+ var _rdfMutationHelpers = require("../shared/rdfMutationHelpers");
14
+ var _debug = require("../../utils/debug");
13
15
  // Language entries are serialized as an ordered rdf:List of id nodes, where
14
16
  // each id node points to an IANA URI via solid:publicId.
15
17
  const LANGUAGE_IANA_NS = 'https://www.w3.org/ns/iana/language-code/';
16
18
  function ensureLanguagePrefix(store) {
17
- const registerPrefix = target => {
18
- if (!target) return;
19
- if (typeof target.setPrefixForURI === 'function') {
20
- target.setPrefixForURI('l', LANGUAGE_IANA_NS);
21
- return;
22
- }
23
- if (!target.namespaces) {
24
- target.namespaces = {};
25
- }
26
- target.namespaces.l = LANGUAGE_IANA_NS;
27
- };
28
- const anyStore = store;
29
- registerPrefix(anyStore);
30
- registerPrefix(anyStore?.updater?.store);
19
+ (0, _rdfMutationHelpers.registerStorePrefix)(store, 'l', LANGUAGE_IANA_NS);
20
+ (0, _rdfMutationHelpers.registerStorePrefix)(store.updater?.store, 'l', LANGUAGE_IANA_NS);
31
21
  }
32
22
  function normalizeText(value) {
33
23
  return (value || '').trim();
@@ -49,45 +39,45 @@ function rowsFromOrderedInput(orderedRows) {
49
39
  entryNode: normalizeText(row.entryNode)
50
40
  }));
51
41
  }
52
- function buildRdfListStatements(items, doc) {
53
- if (!items.length) {
54
- return {
55
- head: _solidUi.ns.rdf('nil'),
56
- statements: []
57
- };
58
- }
59
- const listNodes = items.map(() => (0, _rdflib.blankNode)());
60
- const statements = [];
61
- items.forEach((item, index) => {
62
- const current = listNodes[index];
63
- const next = listNodes[index + 1] || _solidUi.ns.rdf('nil');
64
- statements.push((0, _rdflib.st)(current, _solidUi.ns.rdf('first'), item, doc));
65
- statements.push((0, _rdflib.st)(current, _solidUi.ns.rdf('rest'), next, doc));
66
- });
67
- return {
68
- head: listNodes[0],
69
- statements
70
- };
42
+ function nodeKey(node) {
43
+ return `${node.termType}:${node.value}`;
44
+ }
45
+ function isLanguageEntryNode(node) {
46
+ return Boolean(node && (node.termType === 'NamedNode' || node.termType === 'BlankNode'));
71
47
  }
72
- function buildLanguageStatements(subject, doc, rows) {
48
+ function buildLanguageStatements(store, subject, doc, rows, existingLanguageNodes) {
73
49
  const languageRows = rows.map(row => ({
74
50
  name: normalizeText(row.name),
75
- publicId: normalizeLanguageCode(row.publicId)
51
+ publicId: normalizeLanguageCode(row.publicId),
52
+ entryNode: normalizeText(row.entryNode)
76
53
  })).filter(row => Boolean(row.publicId));
77
- if (languageRows.length === 0) return [];
78
- const entryNodes = languageRows.map(() => (0, _idNodeFactory.createIdNode)(doc));
54
+ if (languageRows.length === 0) {
55
+ return {
56
+ statements: [],
57
+ entryNodes: []
58
+ };
59
+ }
60
+ const entryNodes = languageRows.map(row => {
61
+ const existingNode = row.entryNode ? (0, _rdfMutationHelpers.findExistingNode)(existingLanguageNodes, row.entryNode) : null;
62
+ if (isLanguageEntryNode(existingNode)) {
63
+ return existingNode;
64
+ }
65
+ return (0, _idNodeFactory.createIdNode)(doc);
66
+ });
79
67
  const statements = [];
80
- const rdfList = buildRdfListStatements(entryNodes, doc);
81
- statements.push((0, _rdflib.st)(subject, _solidUi.ns.schema('knowsLanguage'), rdfList.head, doc));
82
- statements.push(...rdfList.statements);
68
+ statements.push((0, _rdflib.st)(subject, _solidUi.ns.schema('knowsLanguage'), new _rdflib.Collection(entryNodes), doc));
83
69
  entryNodes.forEach((entryNode, index) => {
84
70
  const publicIdNode = (0, _rdflib.sym)(`${LANGUAGE_IANA_NS}${languageRows[index].publicId}`);
85
71
  statements.push((0, _rdflib.st)(entryNode, _solidUi.ns.solid('publicId'), publicIdNode, doc));
86
- if (languageRows[index].name) {
72
+ const existingNameStatement = store.holds(publicIdNode, _solidUi.ns.schema('name'), (0, _rdflib.literal)(languageRows[index].name, 'en'), doc);
73
+ if (languageRows[index].name && !existingNameStatement) {
87
74
  statements.push((0, _rdflib.st)(publicIdNode, _solidUi.ns.schema('name'), (0, _rdflib.literal)(languageRows[index].name, 'en'), doc));
88
75
  }
89
76
  });
90
- return statements;
77
+ return {
78
+ statements,
79
+ entryNodes
80
+ };
91
81
  }
92
82
  function collectListChainNodes(store, listHead, doc) {
93
83
  const visited = new Set();
@@ -102,119 +92,10 @@ function collectListChainNodes(store, listHead, doc) {
102
92
  if (!rest || rest.termType === 'NamedNode' && rest.value === _solidUi.ns.rdf('nil').value) {
103
93
  break;
104
94
  }
105
- current = rest;
95
+ current = rest.termType === 'NamedNode' || rest.termType === 'BlankNode' ? rest : null;
106
96
  }
107
97
  return nodes;
108
98
  }
109
- function isPatchFailure(message) {
110
- const text = (message || '').toLowerCase();
111
- // Different pods surface PATCH incompatibility with different status codes/messages.
112
- return text.includes(' on patch ') || text.includes('web error: 501') || text.includes('web error: 405') || text.includes('web error: 400');
113
- }
114
- function isMissingGetRecordError(message) {
115
- return (message || '').toLowerCase().includes('no record of our http get request for document');
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 sanitizePatchStatements(store, deletions, insertions) {
121
- const safeDeletions = Array.from(new Map((deletions || []).filter(statement => {
122
- if (!statement || !statement.subject || !statement.predicate || !statement.object) return false;
123
- if (store.holds(statement.subject, statement.predicate, statement.object, statement.why)) return true;
124
- return store.statementsMatching(statement.subject, statement.predicate, statement.object, statement.why).length > 0;
125
- }).map(statement => [statementKey(statement), statement])).values());
126
- const safeInsertions = Array.from(new Map((insertions || []).filter(statement => Boolean(statement && statement.subject && statement.predicate && statement.object)).map(statement => [statementKey(statement), statement])).values());
127
- return {
128
- safeDeletions,
129
- safeInsertions
130
- };
131
- }
132
- async function runPutFallback(store, doc, deletions, insertions) {
133
- const updater = store.updater;
134
- const fetcher = store.fetcher;
135
- if (!updater || typeof updater.serialize !== 'function' || !fetcher || typeof fetcher.webOperation !== 'function') {
136
- throw new Error('Language updates are not supported by this store updater.');
137
- }
138
- const currentStatements = store.statementsMatching(undefined, undefined, undefined, doc).slice();
139
- const deletionKeys = new Set((deletions || []).map(statement => statementKey(statement)));
140
- // Rebuild full document state for PUT when patch-oriented flows cannot be used.
141
- const nextStatements = currentStatements.filter(statement => !deletionKeys.has(statementKey(statement))).concat(insertions || []);
142
- const contentType = 'text/turtle';
143
- const body = updater.serialize(doc.value, nextStatements, contentType);
144
- const response = await fetcher.webOperation('PUT', doc.value, {
145
- noMeta: true,
146
- contentType,
147
- body
148
- });
149
- if (!response || response.ok !== true) {
150
- const status = response?.status || 'unknown';
151
- throw new Error(`Web error: ${status} on PUT of <${doc.value}>`);
152
- }
153
-
154
- // PUT bypasses UpdateManager's local-store patching, so apply the same changes locally.
155
- store.remove(deletions);
156
- insertions.forEach(statement => {
157
- store.add(statement.subject, statement.predicate, statement.object, statement.why);
158
- });
159
- }
160
- async function runUpdateWithDavFallback(store, doc, deletions, insertions) {
161
- const updater = store.updater;
162
- if (!updater || typeof updater.update !== 'function') {
163
- throw new Error('Language updates are not supported by this store updater.');
164
- }
165
- const {
166
- safeDeletions,
167
- safeInsertions
168
- } = sanitizePatchStatements(store, deletions, insertions);
169
- if (safeDeletions.length === 0 && safeInsertions.length === 0) {
170
- return;
171
- }
172
- const tryUpdate = () => new Promise((resolve, reject) => {
173
- updater.update(safeDeletions, safeInsertions, (_uri, ok, message) => {
174
- if (ok === true) {
175
- resolve();
176
- return;
177
- }
178
- reject(new Error(message || 'Failed to save languages'));
179
- });
180
- });
181
- try {
182
- // Preferred path: let rdflib pick the server-supported update protocol.
183
- await tryUpdate();
184
- return;
185
- } catch (error) {
186
- const message = error instanceof Error ? error.message : String(error);
187
- if (!isPatchFailure(message) || typeof updater.updateDav !== 'function') {
188
- throw error;
189
- }
190
- if (store.fetcher && typeof store.fetcher.load === 'function') {
191
- try {
192
- await store.fetcher.load(doc);
193
- } catch {
194
- // Continue; updateDav may still fail and we handle that below.
195
- }
196
- }
197
- try {
198
- // First fallback for PATCH failures: DAV-style whole-document update.
199
- await new Promise((resolve, reject) => {
200
- updater.updateDav(doc, safeDeletions, safeInsertions, (_uri, ok, body) => {
201
- if (ok === true) {
202
- resolve();
203
- return;
204
- }
205
- reject(new Error(body || message || 'Failed to save languages'));
206
- });
207
- });
208
- } catch (davError) {
209
- const davMessage = davError instanceof Error ? davError.message : String(davError);
210
- if (!isMissingGetRecordError(davMessage)) {
211
- throw davError;
212
- }
213
- // Some stores cannot run updateDav without prior fetch metadata; use direct PUT.
214
- await runPutFallback(store, doc, safeDeletions, safeInsertions);
215
- }
216
- }
217
- }
218
99
  function mergeLanguageOps(existingRows, languageOps) {
219
100
  const byEntryNode = new Map();
220
101
  existingRows.forEach(row => {
@@ -264,33 +145,51 @@ async function mutateLanguageEntries(store, subject, languageOps, orderedRows) {
264
145
  const nextRows = orderedRows && orderedRows.length ? rowsFromOrderedInput(orderedRows) : mergeLanguageOps(existingRows, languageOps);
265
146
  const listObjects = store.each(subject, _solidUi.ns.schema('knowsLanguage'), null, doc);
266
147
  const existingListHeads = listObjects.filter(node => node.termType === 'BlankNode' || node.termType === 'NamedNode');
148
+ const canForcePut = Boolean(store.updater?.serialize && store.fetcher?.webOperation);
149
+ const shouldForcePut = canForcePut;
267
150
  const existingListNodes = Array.from(new Map(existingListHeads.flatMap(node => collectListChainNodes(store, node, doc)).map(node => [`${node.termType}:${node.value}`, node])).values());
268
151
  const existingLanguageNodes = Array.from(new Set(listObjects.flatMap(node => (0, _rdfList.expandRdfList)(store, node)).filter(node => node.termType === 'NamedNode' || node.termType === 'BlankNode').map(node => `${node.termType}:${node.value}`))).map(key => {
269
152
  const [termType, ...rest] = key.split(':');
270
153
  const value = rest.join(':');
271
154
  return termType === 'BlankNode' ? store.bnode(value) : store.sym(value);
272
155
  });
273
- const existingPublicIdNodes = Array.from(new Map(existingLanguageNodes.map(node => store.any(node, _solidUi.ns.solid('publicId'), null, doc)).filter(node => Boolean(node && node.termType === 'NamedNode')).map(node => [`${node.termType}:${node.value}`, node])).values());
156
+ const {
157
+ statements: insertions,
158
+ entryNodes: nextEntryNodes
159
+ } = buildLanguageStatements(store, subject, doc, nextRows, existingLanguageNodes);
160
+ const retainedEntryNodeKeys = new Set(nextEntryNodes.map(node => nodeKey(node)));
161
+ const retainedLanguageNodes = existingLanguageNodes.filter(node => retainedEntryNodeKeys.has(nodeKey(node)));
162
+ const removedLanguageNodes = existingLanguageNodes.filter(node => !retainedEntryNodeKeys.has(nodeKey(node)));
163
+ const removedPublicIdNodes = Array.from(new Map(removedLanguageNodes.map(node => store.any(node, _solidUi.ns.solid('publicId'), null, doc)).filter(node => Boolean(node && node.termType === 'NamedNode')).map(node => [nodeKey(node), node])).values());
274
164
  const deletions = store.statementsMatching(subject, _solidUi.ns.schema('knowsLanguage'), null, doc);
275
165
  existingListNodes.forEach(node => {
276
166
  deletions.push(...store.statementsMatching(node, null, null, doc));
277
167
  });
278
- existingLanguageNodes.forEach(node => {
279
- // Remove old language-entry statements so save always rewrites canonical shape.
168
+ removedLanguageNodes.forEach(node => {
280
169
  deletions.push(...store.statementsMatching(node, null, null, doc));
281
170
  });
282
- existingPublicIdNodes.forEach(node => {
283
- // Language labels are attached to the publicId resource (l:xx) and should be removed for deleted rows.
171
+ retainedLanguageNodes.forEach(node => {
172
+ deletions.push(...store.statementsMatching(node, _solidUi.ns.solid('publicId'), null, doc));
173
+ });
174
+ removedPublicIdNodes.forEach(node => {
284
175
  deletions.push(...store.statementsMatching(node, _solidUi.ns.schema('name'), null, doc));
285
176
  });
286
- const insertions = buildLanguageStatements(subject, doc, nextRows);
287
- await runUpdateWithDavFallback(store, doc, deletions, insertions);
177
+ await (0, _rdfMutationHelpers.runUpdateTransport)(store, doc, deletions, insertions, {
178
+ unsupportedMessage: 'Language updates are not supported by this store updater.',
179
+ failureMessage: 'Failed to save languages',
180
+ forcePut: shouldForcePut,
181
+ useDavFallback: !shouldForcePut,
182
+ usePutFallback: true
183
+ });
288
184
  }
289
185
  async function processLanguageMutations(store, subject, mutationPlan, orderedRows) {
290
186
  try {
291
187
  await mutateLanguageEntries(store, subject, mutationPlan, orderedRows);
292
188
  } catch (error) {
293
- const message = error instanceof Error ? error.message : String(error);
294
- throw new Error(`${_texts.mutationSaveLanguagesFailedPrefixText} ${message}`);
189
+ const rootError = error instanceof Error ? error : new Error(String(error));
190
+ (0, _debug.error)(_texts.languageMutationSaveFailedDebugText, rootError);
191
+ throw new Error(_texts.saveLanguageUpdatesFailedMessageText, {
192
+ cause: rootError
193
+ });
295
194
  }
296
195
  }
@@ -1 +1 @@
1
- {"version":3,"file":"selectors.d.ts","sourceRoot":"","sources":["../../../src/sections/languages/selectors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAO,MAAM,QAAQ,CAAA;AAE/D,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAwIzC,wBAAgB,cAAc,CAAE,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,GAAE,MAAM,CAO9D;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,GAAG,eAAe,EAAE,CA8BxF"}
1
+ {"version":3,"file":"selectors.d.ts","sourceRoot":"","sources":["../../../src/sections/languages/selectors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAO,MAAM,QAAQ,CAAA;AAE/D,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAwIzC,wBAAgB,cAAc,CAAE,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,GAAE,MAAM,CAO9D;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,GAAG,eAAe,EAAE,CA2BxF"}
@@ -126,9 +126,8 @@ function languageAsText(store, lan) {
126
126
  function presentLanguages(subject, store) {
127
127
  const languageObjects = store.each(subject, _solidUi.ns.schema('knowsLanguage'));
128
128
  const expandedLists = languageObjects.filter(node => isRdfListNode(store, node)).map(node => (0, _rdfList.expandRdfList)(store, node));
129
- const longestList = expandedLists.sort((a, b) => b.length - a.length)[0] || [];
130
129
  const standaloneNodes = languageObjects.filter(node => !isRdfListNode(store, node));
131
- const languageNodes = [...longestList, ...standaloneNodes];
130
+ const languageNodes = [...expandedLists.flat(), ...standaloneNodes];
132
131
  const details = languageNodes.map(lan => ({
133
132
  name: languageAsText(store, lan),
134
133
  publicId: toStoredPublicIdValue(lan, store.any(lan, _solidUi.ns.solid('publicId')) || undefined),
@@ -1,6 +1,7 @@
1
+ import 'solid-ui/components/actions/button';
1
2
  import { ProjectDetails } from './types';
2
3
  import '../../styles/EditDialogs.css';
3
- import '../../styles/ContactInfoEditDialog.css';
4
+ import '../contactInfo/ContactInfoEditDialog.css';
4
5
  import { LiveStore, NamedNode } from 'rdflib';
5
6
  import { ViewerMode } from '../../types';
6
7
  export declare function createProjectsEditDialog(event: Event, store: LiveStore, subject: NamedNode, projects: ProjectDetails[], viewerMode: ViewerMode, onSaved?: () => Promise<void> | void): Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"ProjectEditDialog.d.ts","sourceRoot":"","sources":["../../../src/sections/projects/ProjectEditDialog.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAc,MAAM,SAAS,CAAA;AACpD,OAAO,8BAA8B,CAAA;AACrC,OAAO,wCAAwC,CAAA;AAC/C,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AA0JxC,wBAAsB,wBAAwB,CAC5C,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,SAAS,EAChB,OAAO,EAAE,SAAS,EAClB,QAAQ,EAAE,cAAc,EAAE,EAC1B,UAAU,EAAE,UAAU,EACtB,OAAO,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,iBAmDrC"}
1
+ {"version":3,"file":"ProjectEditDialog.d.ts","sourceRoot":"","sources":["../../../src/sections/projects/ProjectEditDialog.ts"],"names":[],"mappings":"AAEA,OAAO,oCAAoC,CAAA;AAC3C,OAAO,EAAE,cAAc,EAAc,MAAM,SAAS,CAAA;AACpD,OAAO,8BAA8B,CAAA;AACrC,OAAO,0CAA0C,CAAA;AACjD,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAwJxC,wBAAsB,wBAAwB,CAC5C,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,SAAS,EAChB,OAAO,EAAE,SAAS,EAClB,QAAQ,EAAE,cAAc,EAAE,EAC1B,UAAU,EAAE,UAAU,EACtB,OAAO,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,iBAuCrC"}
@@ -6,8 +6,9 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.createProjectsEditDialog = createProjectsEditDialog;
7
7
  var _dialog = require("../../ui/dialog");
8
8
  var _litHtml = require("lit-html");
9
+ require("solid-ui/components/actions/button");
9
10
  require("../../styles/EditDialogs.css");
10
- require("../../styles/ContactInfoEditDialog.css");
11
+ require("../contactInfo/ContactInfoEditDialog.css");
11
12
  var _rowState = require("../shared/rowState");
12
13
  var _textUtils = require("../../textUtils");
13
14
  var _mutations = require("./mutations");
@@ -46,9 +47,6 @@ function toFormState(_details) {
46
47
  };
47
48
  }
48
49
  function validateProjectBeforeSave(row) {
49
- if (!(0, _textUtils.hasNonEmptyText)(row.url) && !(0, _textUtils.hasNonEmptyText)(row.entryNode)) {
50
- return 'Add a project WebID.';
51
- }
52
50
  if (!(0, _textUtils.hasNonEmptyText)(row.url)) {
53
51
  return 'WebID is required.';
54
52
  }
@@ -71,7 +69,7 @@ function renderProjectInputRow(row, onChange) {
71
69
  onChange();
72
70
  if (!isValidProjectUrl(url)) return;
73
71
  const dom = event.currentTarget?.ownerDocument || document;
74
- const saveButton = dom.querySelector('#profile-modal #modal-buttons .btn-primary');
72
+ const saveButton = (0, _dialog.getSharedDialogSaveButton)(dom);
75
73
  saveButton?.click();
76
74
  } catch {
77
75
  // Clipboard access may fail due to browser permissions; keep dialog usable.
@@ -80,7 +78,6 @@ function renderProjectInputRow(row, onChange) {
80
78
  return (0, _litHtml.html)`
81
79
  <div class="profile-edit-dialog__row profile-edit-dialog__row--project">
82
80
  <label aria-label="Project or community WebID" class="label profile-edit-dialog__field profile-edit-dialog__field--full">
83
- <p>Type or paste a project or community WebID.</p>
84
81
  <div class="profile-edit-dialog__input-wrap">
85
82
  <input
86
83
  class="input profile-edit-dialog__input--with-action"
@@ -96,16 +93,19 @@ function renderProjectInputRow(row, onChange) {
96
93
  inputmode="text"
97
94
  @input=${handleUrlInput}
98
95
  />
99
- <button
96
+ <solid-ui-button
100
97
  type="button"
101
- class="profile-edit-dialog__paste-button rounded-sm gap-xxs"
98
+ variant="secondary"
99
+ size="md"
100
+ label="Paste"
101
+ class="profile-edit-dialog__paste-button"
102
102
  aria-label="Paste project or community URL from clipboard"
103
103
  title=${_texts.pasteEntryButtonTitleText}
104
104
  @click=${handlePaste}
105
105
  >
106
- <span class="profile-edit-dialog__paste-icon" aria-hidden="true">${_profileIcons.pasteIcon}</span>
106
+ <span slot="icon" class="profile-edit-dialog__paste-icon" aria-hidden="true">${_profileIcons.pasteIcon}</span>
107
107
  Paste
108
- </button>
108
+ </solid-ui-button>
109
109
  </div>
110
110
  </label>
111
111
  </div>
@@ -142,6 +142,7 @@ async function createProjectsEditDialog(event, store, subject, projects, viewerM
142
142
  headerAction: {
143
143
  type: 'close'
144
144
  },
145
+ shouldCloseWithoutSave: () => !(0, _textUtils.hasNonEmptyText)(formState.project.url) && !(0, _textUtils.hasNonEmptyText)(formState.project.entryNode),
145
146
  validate: () => {
146
147
  if (viewerMode !== 'owner') {
147
148
  return _texts.ownerLoginRequiredDialogMessageText;
@@ -158,23 +159,11 @@ async function createProjectsEditDialog(event, store, subject, projects, viewerM
158
159
  await (0, _mutations.processProjectsMutations)(store, subject, plan);
159
160
  },
160
161
  formatSaveError: error => {
161
- const message = error instanceof Error ? error.message : String(error);
162
- return `${_texts.saveProjectsUpdatesFailedPrefixText} ${message}`;
162
+ return error instanceof Error ? error.message : String(error);
163
163
  }
164
164
  });
165
- const modalButtons = dom.querySelector('#profile-modal #modal-buttons');
166
- const previousButtonsDisplay = modalButtons?.style.display;
167
- if (modalButtons) {
168
- modalButtons.style.display = 'none';
169
- }
170
165
  let result = null;
171
- try {
172
- result = await dialogPromise;
173
- } finally {
174
- if (modalButtons) {
175
- modalButtons.style.display = previousButtonsDisplay || '';
176
- }
177
- }
166
+ result = await dialogPromise;
178
167
  if (!result) return;
179
168
  if (onSaved) {
180
169
  await onSaved();