profile-pane 3.2.1 → 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.
- package/README.md +50 -0
- package/lib/303.profile-pane.js +1362 -0
- package/lib/303.profile-pane.js.map +1 -0
- package/lib/303.profile-pane.min.js +2 -0
- package/lib/303.profile-pane.min.js.map +1 -0
- package/lib/ProfileView.css +1090 -0
- package/lib/ProfileView.d.ts +2 -1
- package/lib/ProfileView.d.ts.map +1 -1
- package/lib/ProfileView.js +64 -36
- package/lib/buttonsHelper.d.ts +1 -1
- package/lib/buttonsHelper.d.ts.map +1 -1
- package/lib/buttonsHelper.js +2 -1
- package/lib/editProfilePane/EditCVCard.js +1 -1
- package/lib/editProfilePane/EditCommunitiesCard.js +1 -1
- package/lib/editProfilePane/EditFriendsCard.js +1 -1
- package/lib/editProfilePane/EditProfileView.d.ts +1 -1
- package/lib/editProfilePane/EditProfileView.d.ts.map +1 -1
- package/lib/editProfilePane/EditProfileView.js +4 -5
- package/lib/editProfilePane/editProfilePresenter.d.ts.map +1 -1
- package/lib/editProfilePane/editProfilePresenter.js +5 -4
- package/lib/icons-svg/profileIcons.d.ts +1 -1
- package/lib/icons-svg/profileIcons.d.ts.map +1 -1
- package/lib/icons-svg/profileIcons.js +9 -17
- package/lib/index.d.ts +1 -8
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +74 -40
- package/lib/ontology/otherPreferencesForm.ttl +32 -0
- package/lib/ontology/resumeForm.ttl +349 -0
- package/lib/ontology/socialMedia.ttl +433 -0
- package/lib/profile-pane.js +32266 -13247
- package/lib/profile-pane.js.map +1 -1
- package/lib/profile-pane.min.js +2315 -935
- package/lib/profile-pane.min.js.map +1 -1
- package/lib/rdfFormsHelper.d.ts +13 -1
- package/lib/rdfFormsHelper.d.ts.map +1 -1
- package/lib/rdfFormsHelper.js +13 -1
- package/lib/sections/bio/BioEditDialog.d.ts.map +1 -1
- package/lib/sections/bio/BioEditDialog.js +7 -7
- package/lib/sections/bio/BioSection.css +300 -0
- package/lib/sections/bio/BioSection.d.ts +3 -2
- package/lib/sections/bio/BioSection.d.ts.map +1 -1
- package/lib/sections/bio/BioSection.js +26 -19
- package/lib/sections/bio/mutations.d.ts.map +1 -1
- package/lib/sections/bio/mutations.js +14 -3
- package/lib/sections/contactInfo/ContactInfoEditDialog.css +354 -0
- package/lib/sections/contactInfo/ContactInfoEditDialog.d.ts +3 -1
- package/lib/sections/contactInfo/ContactInfoEditDialog.d.ts.map +1 -1
- package/lib/sections/contactInfo/ContactInfoEditDialog.js +183 -98
- package/lib/sections/contactInfo/ContactInfoSection.css +125 -0
- package/lib/sections/contactInfo/ContactInfoSection.d.ts +2 -0
- package/lib/sections/contactInfo/ContactInfoSection.d.ts.map +1 -1
- package/lib/sections/contactInfo/ContactInfoSection.js +64 -41
- package/lib/sections/contactInfo/mutations.d.ts.map +1 -1
- package/lib/sections/contactInfo/mutations.js +51 -16
- package/lib/sections/education/EducationEditDialog.d.ts +3 -1
- package/lib/sections/education/EducationEditDialog.d.ts.map +1 -1
- package/lib/sections/education/EducationEditDialog.js +170 -92
- package/lib/sections/education/EducationSection.css +133 -0
- package/lib/sections/education/EducationSection.d.ts +3 -2
- package/lib/sections/education/EducationSection.d.ts.map +1 -1
- package/lib/sections/education/EducationSection.js +32 -25
- package/lib/sections/education/mutations.d.ts.map +1 -1
- package/lib/sections/education/mutations.js +14 -3
- package/lib/sections/heading/HeadingEditDialog.d.ts +4 -1
- package/lib/sections/heading/HeadingEditDialog.d.ts.map +1 -1
- package/lib/sections/heading/HeadingEditDialog.js +287 -162
- package/lib/sections/heading/HeadingSection.css +862 -0
- package/lib/sections/heading/HeadingSection.d.ts +3 -2
- package/lib/sections/heading/HeadingSection.d.ts.map +1 -1
- package/lib/sections/heading/HeadingSection.js +63 -32
- package/lib/sections/heading/imageHelpers.d.ts +1 -0
- package/lib/sections/heading/imageHelpers.d.ts.map +1 -1
- package/lib/sections/heading/imageHelpers.js +40 -1
- package/lib/sections/heading/mutations.d.ts.map +1 -1
- package/lib/sections/heading/mutations.js +86 -23
- package/lib/sections/heading/selectors.d.ts.map +1 -1
- package/lib/sections/heading/selectors.js +14 -3
- package/lib/sections/heading/types.d.ts +1 -2
- package/lib/sections/heading/types.d.ts.map +1 -1
- package/lib/sections/languages/LanguageEditDialog.d.ts +3 -1
- package/lib/sections/languages/LanguageEditDialog.d.ts.map +1 -1
- package/lib/sections/languages/LanguageEditDialog.js +202 -119
- package/lib/sections/languages/LanguageSection.css +53 -0
- package/lib/sections/languages/LanguageSection.d.ts +2 -0
- package/lib/sections/languages/LanguageSection.d.ts.map +1 -1
- package/lib/sections/languages/LanguageSection.js +42 -31
- package/lib/sections/languages/mutations.d.ts.map +1 -1
- package/lib/sections/languages/mutations.js +60 -161
- package/lib/sections/languages/selectors.d.ts.map +1 -1
- package/lib/sections/languages/selectors.js +1 -2
- package/lib/sections/projects/ProjectEditDialog.d.ts +2 -1
- package/lib/sections/projects/ProjectEditDialog.d.ts.map +1 -1
- package/lib/sections/projects/ProjectEditDialog.js +13 -24
- package/lib/sections/projects/ProjectSection.css +368 -0
- package/lib/sections/projects/ProjectSection.d.ts +2 -1
- package/lib/sections/projects/ProjectSection.d.ts.map +1 -1
- package/lib/sections/projects/ProjectSection.js +116 -34
- package/lib/sections/projects/mutations.d.ts.map +1 -1
- package/lib/sections/projects/mutations.js +109 -132
- package/lib/sections/projects/selectors.d.ts.map +1 -1
- package/lib/sections/projects/selectors.js +4 -45
- package/lib/{QRCodeCard.d.ts → sections/qrcode/QRCodeCard.d.ts} +2 -1
- package/lib/sections/qrcode/QRCodeCard.d.ts.map +1 -0
- package/lib/{QRCodeCard.js → sections/qrcode/QRCodeCard.js} +59 -11
- package/lib/sections/qrcode/QRCodeSection.css +108 -0
- package/lib/sections/qrcode/QRCodeSection.d.ts +4 -0
- package/lib/sections/qrcode/QRCodeSection.d.ts.map +1 -0
- package/lib/sections/qrcode/QRCodeSection.js +17 -0
- package/lib/sections/resume/ResumeEditDialog.d.ts +10 -1
- package/lib/sections/resume/ResumeEditDialog.d.ts.map +1 -1
- package/lib/sections/resume/ResumeEditDialog.js +531 -149
- package/lib/sections/resume/ResumeSection.css +350 -0
- package/lib/sections/resume/ResumeSection.d.ts +3 -2
- package/lib/sections/resume/ResumeSection.d.ts.map +1 -1
- package/lib/sections/resume/ResumeSection.js +78 -49
- package/lib/sections/resume/mutations.d.ts.map +1 -1
- package/lib/sections/resume/mutations.js +17 -3
- package/lib/sections/resume/selectors.d.ts.map +1 -1
- package/lib/sections/resume/selectors.js +1 -0
- package/lib/sections/resume/types.d.ts +1 -0
- package/lib/sections/resume/types.d.ts.map +1 -1
- package/lib/sections/shared/collapsibleSection.d.ts.map +1 -1
- package/lib/sections/shared/collapsibleSection.js +1 -0
- package/lib/sections/shared/phoneCountries.d.ts +1 -1
- package/lib/sections/shared/phoneCountries.d.ts.map +1 -1
- package/lib/sections/shared/phoneCountries.js +2 -2
- package/lib/sections/shared/projectCommunityNodes.d.ts +6 -0
- package/lib/sections/shared/projectCommunityNodes.d.ts.map +1 -0
- package/lib/sections/shared/projectCommunityNodes.js +56 -0
- package/lib/sections/shared/rdfMutationHelpers.d.ts +35 -2
- package/lib/sections/shared/rdfMutationHelpers.d.ts.map +1 -1
- package/lib/sections/shared/rdfMutationHelpers.js +290 -14
- package/lib/sections/shared/sectionCardHelpers.d.ts.map +1 -1
- package/lib/sections/shared/sectionCardHelpers.js +80 -11
- package/lib/sections/shared/types.d.ts +24 -0
- package/lib/sections/shared/types.d.ts.map +1 -1
- package/lib/sections/skills/SkillsEditDialog.d.ts +3 -1
- package/lib/sections/skills/SkillsEditDialog.d.ts.map +1 -1
- package/lib/sections/skills/SkillsEditDialog.js +136 -115
- package/lib/sections/skills/SkillsSection.css +173 -0
- package/lib/sections/skills/SkillsSection.d.ts +2 -0
- package/lib/sections/skills/SkillsSection.d.ts.map +1 -1
- package/lib/sections/skills/SkillsSection.js +107 -47
- package/lib/sections/skills/mutations.d.ts.map +1 -1
- package/lib/sections/skills/mutations.js +25 -21
- package/lib/sections/skills/selectors.d.ts.map +1 -1
- package/lib/sections/skills/selectors.js +5 -3
- package/lib/sections/social/SocialEditDialog.d.ts +3 -1
- package/lib/sections/social/SocialEditDialog.d.ts.map +1 -1
- package/lib/sections/social/SocialEditDialog.js +170 -62
- package/lib/sections/social/SocialSection.css +194 -0
- package/lib/sections/social/SocialSection.d.ts +4 -3
- package/lib/sections/social/SocialSection.d.ts.map +1 -1
- package/lib/sections/social/SocialSection.js +59 -43
- package/lib/sections/social/mutations.d.ts.map +1 -1
- package/lib/sections/social/mutations.js +23 -132
- package/lib/specialButtons/AddMeToYourFriends.css +54 -0
- package/lib/specialButtons/addContact/AddMeToYourContacts.css +1118 -0
- package/lib/specialButtons/addContact/ContactCreationDialog.d.ts +10 -0
- package/lib/specialButtons/addContact/ContactCreationDialog.d.ts.map +1 -0
- package/lib/specialButtons/addContact/ContactCreationDialog.js +1123 -0
- package/lib/specialButtons/addContact/addMeToYourContacts.d.ts +16 -0
- package/lib/specialButtons/addContact/addMeToYourContacts.d.ts.map +1 -0
- package/lib/specialButtons/addContact/addMeToYourContacts.js +136 -0
- package/lib/specialButtons/addContact/contactsErrors.d.ts +8 -0
- package/lib/specialButtons/addContact/contactsErrors.d.ts.map +1 -0
- package/lib/specialButtons/addContact/contactsErrors.js +106 -0
- package/lib/specialButtons/addContact/contactsTypes.d.ts +43 -0
- package/lib/specialButtons/addContact/contactsTypes.d.ts.map +1 -0
- package/lib/specialButtons/addContact/contactsTypes.js +5 -0
- package/lib/specialButtons/addContact/helpers.d.ts +7 -0
- package/lib/specialButtons/addContact/helpers.d.ts.map +1 -0
- package/lib/specialButtons/addContact/helpers.js +103 -0
- package/lib/specialButtons/addContact/mutations.d.ts +16 -0
- package/lib/specialButtons/addContact/mutations.d.ts.map +1 -0
- package/lib/specialButtons/addContact/mutations.js +300 -0
- package/lib/specialButtons/addContact/selectors.d.ts +10 -0
- package/lib/specialButtons/addContact/selectors.d.ts.map +1 -0
- package/lib/specialButtons/addContact/selectors.js +163 -0
- package/lib/{addMeToYourFriends.d.ts → specialButtons/addMeToYourFriends.d.ts} +6 -4
- package/lib/specialButtons/addMeToYourFriends.d.ts.map +1 -0
- package/lib/{addMeToYourFriends.js → specialButtons/addMeToYourFriends.js} +46 -11
- package/lib/styles/CollapsibleSection.css +519 -0
- package/lib/styles/EditDialogs.css +506 -686
- package/lib/styles/EditDialogs.responsive.css +989 -0
- package/lib/texts/buttonTexts.d.ts +9 -0
- package/lib/texts/buttonTexts.d.ts.map +1 -0
- package/lib/texts/buttonTexts.js +14 -0
- package/lib/texts/dialogTexts.d.ts +14 -0
- package/lib/texts/dialogTexts.d.ts.map +1 -0
- package/lib/texts/dialogTexts.js +19 -0
- package/lib/texts/messageTexts.d.ts +42 -0
- package/lib/texts/messageTexts.d.ts.map +1 -0
- package/lib/texts/messageTexts.js +47 -0
- package/lib/texts/profileTexts.d.ts +14 -0
- package/lib/texts/profileTexts.d.ts.map +1 -0
- package/lib/texts/profileTexts.js +19 -0
- package/lib/texts/qrCodeTexts.d.ts +2 -0
- package/lib/texts/qrCodeTexts.d.ts.map +1 -0
- package/lib/texts/qrCodeTexts.js +7 -0
- package/lib/texts.d.ts +5 -60
- package/lib/texts.d.ts.map +1 -1
- package/lib/texts.js +55 -70
- package/lib/ui/dialog.css +233 -0
- package/lib/ui/dialog.d.ts +15 -1
- package/lib/ui/dialog.d.ts.map +1 -1
- package/lib/ui/dialog.js +245 -45
- package/lib/ui/dialog.responsive.css +195 -0
- package/lib/ui/errors.d.ts.map +1 -1
- package/lib/ui/errors.js +2 -1
- package/lib/ui/spinner.d.ts +3 -0
- package/lib/ui/spinner.d.ts.map +1 -0
- package/lib/ui/spinner.js +13 -0
- package/lib/utils/debug.d.ts +5 -0
- package/lib/utils/debug.d.ts.map +1 -0
- package/lib/utils/debug.js +23 -0
- package/lib/utils/errorDisplay.d.ts +2 -0
- package/lib/utils/errorDisplay.d.ts.map +1 -0
- package/lib/utils/errorDisplay.js +19 -0
- package/package.json +32 -25
- package/lib/ChatWithMe.d.ts +0 -7
- package/lib/ChatWithMe.d.ts.map +0 -1
- package/lib/ChatWithMe.js +0 -90
- package/lib/QRCodeCard.d.ts.map +0 -1
- package/lib/addMeToYourFriends.d.ts.map +0 -1
- package/lib/sections/heading/camera.d.ts +0 -19
- package/lib/sections/heading/camera.d.ts.map +0 -1
- package/lib/sections/heading/camera.js +0 -199
- package/lib/styles/BioSection.css +0 -77
- package/lib/styles/CVCard.css +0 -142
- package/lib/styles/ChatWithMe.css +0 -6
- package/lib/styles/ContactInfoEditDialog.css +0 -153
- package/lib/styles/EducationCard.css +0 -103
- package/lib/styles/HeadingSection.css +0 -309
- package/lib/styles/ProfileCard.css +0 -66
- package/lib/styles/ProfileView.css +0 -65
- package/lib/styles/ProjectsCard.css +0 -206
- package/lib/styles/QRCodeCard.css +0 -43
- package/lib/styles/SocialCard.css +0 -89
- package/lib/styles/dialog.css +0 -209
- package/lib/styles/utilities.css +0 -740
|
@@ -4,9 +4,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.SocialCard = void 0;
|
|
7
|
-
exports.
|
|
7
|
+
exports.renderSocialSection = renderSocialSection;
|
|
8
8
|
var _litHtml = require("lit-html");
|
|
9
|
-
require("
|
|
9
|
+
require("solid-ui/components/actions/button");
|
|
10
|
+
require("./SocialSection.css");
|
|
10
11
|
var _texts = require("../../texts");
|
|
11
12
|
var _SocialEditDialog = require("./SocialEditDialog");
|
|
12
13
|
var _collapsibleSection = require("../shared/collapsibleSection");
|
|
@@ -17,39 +18,41 @@ function isRenderableAccount(account) {
|
|
|
17
18
|
}
|
|
18
19
|
function expandSocialAccounts(event) {
|
|
19
20
|
const button = event.currentTarget;
|
|
20
|
-
const socialCard = button?.closest('.
|
|
21
|
+
const socialCard = button?.closest('.social-card');
|
|
21
22
|
if (!button || !socialCard) return;
|
|
22
23
|
socialCard.setAttribute('data-mobile-expanded', 'true');
|
|
23
24
|
button.setAttribute('aria-expanded', 'true');
|
|
24
25
|
button.hidden = true;
|
|
25
26
|
}
|
|
26
|
-
const SocialCard = (SocialData,
|
|
27
|
-
void viewerMode;
|
|
27
|
+
const SocialCard = (SocialData, _viewerMode) => {
|
|
28
28
|
const accounts = (SocialData.accounts || []).filter(isRenderableAccount);
|
|
29
29
|
const hiddenAccountsCount = Math.max(0, accounts.length - MAX_VISIBLE_SOCIAL_ACCOUNTS_MOBILE);
|
|
30
30
|
if (accounts.length) {
|
|
31
31
|
return (0, _litHtml.html)`
|
|
32
32
|
<section
|
|
33
|
-
|
|
33
|
+
id="social-media"
|
|
34
|
+
class="social-card"
|
|
34
35
|
aria-label="Social media"
|
|
35
|
-
|
|
36
|
-
data-mobile-expanded="${hiddenAccountsCount > 0 ? 'false' : 'true'}"
|
|
36
|
+
SocialData: SocialPresentation
|
|
37
37
|
>
|
|
38
38
|
<nav aria-label="Social media profiles">
|
|
39
|
-
<ul class="
|
|
39
|
+
<ul class="social-card__list" role="list">
|
|
40
40
|
${accounts.map(account => renderAccount(account))}
|
|
41
41
|
</ul>
|
|
42
42
|
</nav>
|
|
43
43
|
${hiddenAccountsCount > 0 ? (0, _litHtml.html)`
|
|
44
|
-
<button
|
|
44
|
+
<solid-ui-button
|
|
45
45
|
type="button"
|
|
46
|
-
|
|
46
|
+
variant="secondary"
|
|
47
|
+
size="sm"
|
|
48
|
+
label=${`${hiddenAccountsCount} more`}
|
|
49
|
+
class="social-card__more-button"
|
|
47
50
|
aria-controls="social-media"
|
|
48
51
|
aria-expanded="false"
|
|
49
52
|
@click=${expandSocialAccounts}
|
|
50
53
|
>
|
|
51
54
|
${hiddenAccountsCount} more
|
|
52
|
-
</button>
|
|
55
|
+
</solid-ui-button>
|
|
53
56
|
` : (0, _litHtml.html)``}
|
|
54
57
|
</section>
|
|
55
58
|
`;
|
|
@@ -57,15 +60,16 @@ const SocialCard = (SocialData, viewerMode) => {
|
|
|
57
60
|
return (0, _litHtml.html)``;
|
|
58
61
|
function renderAccount(account) {
|
|
59
62
|
return (0, _litHtml.html)`
|
|
60
|
-
<li class="
|
|
63
|
+
<li class="social-card__item" role="listitem">
|
|
61
64
|
<a
|
|
65
|
+
class="social-card__link"
|
|
62
66
|
href="${account.homepage}"
|
|
63
67
|
target="_blank"
|
|
64
68
|
rel="noopener noreferrer"
|
|
65
69
|
aria-label="Visit ${account.name} profile (opens in new tab)"
|
|
66
70
|
>
|
|
67
71
|
<img
|
|
68
|
-
class="
|
|
72
|
+
class="social-card__icon"
|
|
69
73
|
src="${account.icon}"
|
|
70
74
|
alt="${account.name} icon"
|
|
71
75
|
width="40"
|
|
@@ -94,38 +98,46 @@ function renderSocialSectionDefault(store, subject, socialData, viewerMode, onSa
|
|
|
94
98
|
return showSection ? (0, _litHtml.html)`
|
|
95
99
|
<section
|
|
96
100
|
aria-labelledby="social-heading"
|
|
97
|
-
|
|
101
|
+
data-profile-section="social"
|
|
102
|
+
class="profile__section profile-section-collapsible profile-section-collapsible--inline-mobile-actions"
|
|
98
103
|
role="region"
|
|
99
104
|
tabindex="-1"
|
|
100
105
|
data-expanded="false"
|
|
101
106
|
>
|
|
102
107
|
<header class="profile__section-header profile-section-collapsible__header">
|
|
103
|
-
<
|
|
104
|
-
<div class="profile-section-collapsible__actions
|
|
108
|
+
<h3 id="social-heading" tabindex="-1">${_texts.socialAccountsHeadingText}</h3>
|
|
109
|
+
<div class="profile-section-collapsible__actions">
|
|
105
110
|
${isOwner ? (0, _litHtml.html)`
|
|
106
|
-
<button
|
|
111
|
+
<solid-ui-button
|
|
107
112
|
type="button"
|
|
108
|
-
|
|
113
|
+
variant="secondary"
|
|
114
|
+
size="sm"
|
|
115
|
+
class="profile__action-button profile-action-text profile-section-collapsible__edit-button"
|
|
109
116
|
aria-label="Edit social accounts"
|
|
110
117
|
@click=${handleEdit}
|
|
111
118
|
>
|
|
112
|
-
<span class="profile-section-collapsible__edit-label"
|
|
119
|
+
<span class="profile-section-collapsible__edit-label profile__add-more-content">
|
|
120
|
+
<span class="profile__add-more-icon" aria-hidden="true">${_profileIcons.addIcon}</span>
|
|
121
|
+
<span>Add More</span>
|
|
122
|
+
</span>
|
|
113
123
|
<span class="profile-section-collapsible__edit-icon" aria-hidden="true">${_profileIcons.editIcon}</span>
|
|
114
|
-
</button>
|
|
124
|
+
</solid-ui-button>
|
|
115
125
|
` : (0, _litHtml.html)``}
|
|
116
|
-
<button
|
|
126
|
+
<solid-ui-button
|
|
117
127
|
type="button"
|
|
118
|
-
|
|
128
|
+
variant="icon"
|
|
129
|
+
size="sm"
|
|
130
|
+
class="profile-section-collapsible__toggle-button"
|
|
119
131
|
aria-label="Toggle social accounts section"
|
|
120
132
|
aria-controls="social-panel"
|
|
121
133
|
aria-expanded="false"
|
|
122
134
|
@click=${_collapsibleSection.toggleCollapsibleSection}
|
|
123
135
|
>
|
|
124
|
-
<span class="profile-section-collapsible__chevron" aria-hidden="true"
|
|
125
|
-
</button>
|
|
136
|
+
<span slot="icon" class="profile-section-collapsible__chevron" aria-hidden="true">${_profileIcons.chevronDownIcon}</span>
|
|
137
|
+
</solid-ui-button>
|
|
126
138
|
</div>
|
|
127
139
|
</header>
|
|
128
|
-
<div id="social-panel" class="profile-section-collapsible__content"
|
|
140
|
+
<div id="social-panel" class="profile-section-collapsible__content">
|
|
129
141
|
${renderSocialSectionContent(socialData, viewerMode)}
|
|
130
142
|
</div>
|
|
131
143
|
</section>
|
|
@@ -133,9 +145,9 @@ function renderSocialSectionDefault(store, subject, socialData, viewerMode, onSa
|
|
|
133
145
|
}
|
|
134
146
|
function renderOwnerEmptySocialContent(_store, _subject, _socialData, _viewerMode, _onSaved) {
|
|
135
147
|
return (0, _litHtml.html)`
|
|
136
|
-
<div class="profile__empty-state-content
|
|
148
|
+
<div class="profile__empty-state-content" role="group" aria-label="Empty social accounts section">
|
|
137
149
|
<div class="social__empty-icon-wrapper">
|
|
138
|
-
<span class="social__empty-icon
|
|
150
|
+
<span class="social__empty-icon">${_profileIcons.globeIcon}</span>
|
|
139
151
|
</div>
|
|
140
152
|
<p class="profile__empty-state-message social__empty-message">
|
|
141
153
|
No social media links added yet.
|
|
@@ -148,47 +160,51 @@ function renderOwnerEmptySocialSection(store, subject, socialData, viewerMode, o
|
|
|
148
160
|
<section
|
|
149
161
|
aria-labelledby="social-heading"
|
|
150
162
|
data-profile-section="social"
|
|
151
|
-
class="profile__section--empty
|
|
163
|
+
class="profile__section--empty profile-section-collapsible profile-section-collapsible--inline-mobile-actions"
|
|
152
164
|
role="region"
|
|
153
165
|
tabindex="-1"
|
|
154
166
|
data-expanded="false"
|
|
155
167
|
>
|
|
156
168
|
<header class="profile__section-header profile-section-collapsible__header">
|
|
157
|
-
<
|
|
158
|
-
<div class="profile-section-collapsible__actions
|
|
159
|
-
<button
|
|
169
|
+
<h3 id="social-heading" tabindex="-1">${_texts.socialAccountsHeadingText}</h3>
|
|
170
|
+
<div class="profile-section-collapsible__actions">
|
|
171
|
+
<solid-ui-button
|
|
160
172
|
type="button"
|
|
161
|
-
|
|
173
|
+
variant="secondary"
|
|
174
|
+
size="sm"
|
|
175
|
+
class="profile__action-button profile-action-text profile-section-collapsible__edit-button"
|
|
162
176
|
aria-label="Add social accounts"
|
|
163
177
|
@click=${event => {
|
|
164
178
|
return (0, _SocialEditDialog.createSocialEditDialog)(event, store, subject, socialData.accounts, viewerMode, onSaved);
|
|
165
179
|
}}
|
|
166
180
|
>
|
|
167
|
-
<span class="profile-section-collapsible__edit-label profile__add-more-content
|
|
168
|
-
<span class="profile__add-more-icon
|
|
169
|
-
Add
|
|
181
|
+
<span class="profile-section-collapsible__edit-label profile__add-more-content">
|
|
182
|
+
<span class="profile__add-more-icon" aria-hidden="true">${_profileIcons.addIcon}</span>
|
|
183
|
+
<span>Add More</span>
|
|
170
184
|
</span>
|
|
171
185
|
<span class="profile-section-collapsible__edit-icon" aria-hidden="true">${_profileIcons.editIcon}</span>
|
|
172
|
-
</button>
|
|
173
|
-
<button
|
|
186
|
+
</solid-ui-button>
|
|
187
|
+
<solid-ui-button
|
|
174
188
|
type="button"
|
|
175
|
-
|
|
189
|
+
variant="icon"
|
|
190
|
+
size="sm"
|
|
191
|
+
class="profile-section-collapsible__toggle-button"
|
|
176
192
|
aria-label="Toggle social accounts section"
|
|
177
193
|
aria-controls="social-panel"
|
|
178
194
|
aria-expanded="false"
|
|
179
195
|
@click=${_collapsibleSection.toggleCollapsibleSection}
|
|
180
196
|
>
|
|
181
|
-
<span class="profile-section-collapsible__chevron" aria-hidden="true"
|
|
182
|
-
</button>
|
|
197
|
+
<span slot="icon" class="profile-section-collapsible__chevron" aria-hidden="true">${_profileIcons.chevronDownIcon}</span>
|
|
198
|
+
</solid-ui-button>
|
|
183
199
|
</div>
|
|
184
200
|
</header>
|
|
185
|
-
<div id="social-panel" class="profile-section-collapsible__content"
|
|
201
|
+
<div id="social-panel" class="profile-section-collapsible__content">
|
|
186
202
|
${renderOwnerEmptySocialContent(store, subject, socialData, viewerMode, onSaved)}
|
|
187
203
|
</div>
|
|
188
204
|
</section>
|
|
189
205
|
`;
|
|
190
206
|
}
|
|
191
|
-
function
|
|
207
|
+
function renderSocialSection(store, subject, socialData, viewerMode, onSaved) {
|
|
192
208
|
const safeSocialData = socialData || {
|
|
193
209
|
accounts: []
|
|
194
210
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mutations.d.ts","sourceRoot":"","sources":["../../../src/sections/social/mutations.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"mutations.d.ts","sourceRoot":"","sources":["../../../src/sections/social/mutations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,SAAS,EAAE,SAAS,EAA0B,MAAM,QAAQ,CAAA;AAEjF,OAAO,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAwQvD,wBAAsB,sBAAsB,CAC3C,KAAK,EAAE,SAAS,EAChB,OAAO,EAAE,SAAS,EAClB,YAAY,EAAE,kBAAkB,EAChC,WAAW,CAAC,EAAE,SAAS,EAAE,iBASzB"}
|
|
@@ -12,6 +12,7 @@ var _texts = require("../../texts");
|
|
|
12
12
|
var _helpers = require("./helpers");
|
|
13
13
|
var _selectors = require("./selectors");
|
|
14
14
|
var _rdfList = require("../shared/rdfList");
|
|
15
|
+
var _debug = require("../../utils/debug");
|
|
15
16
|
/* The code below for handling reordering were generated by AI Model: GPT-5.3-Codex. */
|
|
16
17
|
/* Prompt: can you implement on SocialEditDialog add the bentoIcon as the first item
|
|
17
18
|
on the row, you should be able to drag this button around and it should allow you
|
|
@@ -20,33 +21,10 @@ that happen for this data. */
|
|
|
20
21
|
|
|
21
22
|
const SOCIAL_ONTOLOGY_NS = 'https://solidos.github.io/profile-pane/src/ontology/socialMedia.ttl#';
|
|
22
23
|
function ensureSocialPrefix(store) {
|
|
23
|
-
|
|
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);
|
|
24
|
+
(0, _rdfMutationHelpers.registerStorePrefix)(store, 'soc', SOCIAL_ONTOLOGY_NS);
|
|
42
25
|
}
|
|
43
|
-
function
|
|
44
|
-
return {
|
|
45
|
-
subject: statementDebugValue(statement?.subject),
|
|
46
|
-
predicate: statementDebugValue(statement?.predicate),
|
|
47
|
-
object: statementDebugValue(statement?.object),
|
|
48
|
-
graph: statementDebugValue(statement?.why)
|
|
49
|
-
};
|
|
26
|
+
function nodeKey(node) {
|
|
27
|
+
return `${node.termType}:${node.value}`;
|
|
50
28
|
}
|
|
51
29
|
function toObjectNode(value) {
|
|
52
30
|
const normalized = (value || '').trim();
|
|
@@ -114,93 +92,6 @@ function buildSocialStatements(doc, node, row, accountOption) {
|
|
|
114
92
|
}
|
|
115
93
|
return inserts;
|
|
116
94
|
}
|
|
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
95
|
function collectListChainNodes(store, listHead, doc) {
|
|
205
96
|
if (!store.any(listHead, _solidUi.ns.rdf('first'), null, doc)) return [];
|
|
206
97
|
const visited = new Set();
|
|
@@ -253,8 +144,9 @@ async function mutateSocialEntries(store, subject, socialOps, orderedRows) {
|
|
|
253
144
|
status: 'existing'
|
|
254
145
|
}));
|
|
255
146
|
const nextRows = orderedRows && orderedRows.length ? rowsFromOrderedInput(orderedRows) : mergeSocialOps(existingRows, socialOps);
|
|
147
|
+
const canForcePut = Boolean(store.updater?.serialize && store.fetcher?.webOperation);
|
|
256
148
|
const accountObjects = store.each(subject, _solidUi.ns.foaf('account'), null, doc);
|
|
257
|
-
const existingListNodes = uniqueStatements(accountObjects.flatMap(objectNode => {
|
|
149
|
+
const existingListNodes = (0, _rdfMutationHelpers.uniqueStatements)(accountObjects.flatMap(objectNode => {
|
|
258
150
|
return collectListChainNodes(store, objectNode, doc).flatMap(node => store.statementsMatching(node, null, null, doc));
|
|
259
151
|
}));
|
|
260
152
|
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());
|
|
@@ -265,34 +157,33 @@ async function mutateSocialEntries(store, subject, socialOps, orderedRows) {
|
|
|
265
157
|
}
|
|
266
158
|
return (0, _idNodeFactory.createIdNode)(doc);
|
|
267
159
|
});
|
|
160
|
+
const retainedAccountNodeKeys = new Set(rowEntryNodes.map(node => nodeKey(node)));
|
|
161
|
+
const retainedAccountNodes = existingAccountNodes.filter(node => retainedAccountNodeKeys.has(nodeKey(node)));
|
|
162
|
+
const removedAccountNodes = existingAccountNodes.filter(node => !retainedAccountNodeKeys.has(nodeKey(node)));
|
|
268
163
|
const insertions = [];
|
|
269
164
|
if (rowEntryNodes.length > 0) {
|
|
270
|
-
|
|
271
|
-
insertions.push((0, _rdflib.st)(subject, _solidUi.ns.foaf('account'), rdfList.head, doc));
|
|
272
|
-
insertions.push(...rdfList.statements);
|
|
165
|
+
insertions.push((0, _rdflib.st)(subject, _solidUi.ns.foaf('account'), new _rdflib.Collection(rowEntryNodes), doc));
|
|
273
166
|
}
|
|
274
167
|
nextRows.forEach((row, index) => {
|
|
275
168
|
insertions.push(...buildSocialStatements(doc, rowEntryNodes[index], row, optionForRow(row)));
|
|
276
169
|
});
|
|
277
|
-
const deletions = uniqueStatements([...store.statementsMatching(subject, _solidUi.ns.foaf('account'), null, doc), ...existingListNodes, ...
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
deletions: deletions.map(statementToDebugObject),
|
|
286
|
-
insertions: uniqueStatements(insertions).map(statementToDebugObject)
|
|
287
|
-
});
|
|
288
|
-
}
|
|
289
|
-
await applySocialPatchWithFallback(store, doc, deletions, uniqueStatements(insertions));
|
|
170
|
+
const deletions = (0, _rdfMutationHelpers.uniqueStatements)([...store.statementsMatching(subject, _solidUi.ns.foaf('account'), null, doc), ...existingListNodes, ...removedAccountNodes.flatMap(node => (0, _rdfMutationHelpers.collectNodeStatements)(store, node, doc)), ...retainedAccountNodes.flatMap(node => [...store.statementsMatching(node, _solidUi.ns.rdf('type'), null, doc), ...store.statementsMatching(node, _solidUi.ns.foaf('accountName'), null, doc), ...store.statementsMatching(node, _solidUi.ns.foaf('homepage'), null, doc), ...store.statementsMatching(node, _solidUi.ns.foaf('icon'), null, doc), ...store.statementsMatching(node, _solidUi.ns.rdfs('label'), null, doc)])]);
|
|
171
|
+
await (0, _rdfMutationHelpers.runUpdateTransport)(store, doc, deletions, (0, _rdfMutationHelpers.uniqueStatements)(insertions), {
|
|
172
|
+
unsupportedMessage: 'Social updates are not supported by this store updater.',
|
|
173
|
+
failureMessage: 'Failed to save updates',
|
|
174
|
+
forcePut: canForcePut,
|
|
175
|
+
useDavFallback: !canForcePut,
|
|
176
|
+
usePutFallback: true
|
|
177
|
+
});
|
|
290
178
|
}
|
|
291
179
|
async function processSocialMutations(store, subject, mutationPlan, orderedRows) {
|
|
292
180
|
try {
|
|
293
181
|
await mutateSocialEntries(store, subject, mutationPlan, orderedRows);
|
|
294
182
|
} catch (error) {
|
|
295
|
-
const
|
|
296
|
-
|
|
183
|
+
const rootError = error instanceof Error ? error : new Error(String(error));
|
|
184
|
+
(0, _debug.error)(_texts.socialMutationSaveFailedDebugText, rootError);
|
|
185
|
+
throw new Error(_texts.saveSocialUpdatesFailedMessageText, {
|
|
186
|
+
cause: rootError
|
|
187
|
+
});
|
|
297
188
|
}
|
|
298
189
|
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
.profile-friends-button__section {
|
|
2
|
+
--profile-friends-button-color: var(--color-primary, #7C4DFF);
|
|
3
|
+
width: 100%;
|
|
4
|
+
min-width: 0;
|
|
5
|
+
display: grid;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.profile-friends-button__section[hidden] {
|
|
9
|
+
display: none !important;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.profile-friends-button__section solid-ui-button.profile__btn-friends {
|
|
13
|
+
width: 100%;
|
|
14
|
+
min-width: 0;
|
|
15
|
+
--button-hover-background: var(--profile-friends-button-color);
|
|
16
|
+
--button-hover-border: var(--profile-friends-button-color);
|
|
17
|
+
--button-hover-text: var(--color-text-on-action, var(--white, #FFF));
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.profile-friends-button__section solid-ui-button.profile__btn-friends[disabled],
|
|
21
|
+
.profile-friends-button__section solid-ui-button.profile__btn-friends[aria-disabled="true"] {
|
|
22
|
+
pointer-events: none;
|
|
23
|
+
--button-hover-background: var(--button-background, transparent);
|
|
24
|
+
--button-hover-border: var(--button-border, var(--profile-friends-button-color));
|
|
25
|
+
--button-hover-text: var(--button-text, var(--profile-friends-button-color));
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.profile-friends-button__section .profile__btn-friends-label {
|
|
29
|
+
color: var(--profile-friends-button-color);
|
|
30
|
+
font-size: var(--font-size-sm, 0.875rem);
|
|
31
|
+
font-weight: var(--font-weight-md, 500);
|
|
32
|
+
line-height: 1;
|
|
33
|
+
letter-spacing: -0.01em;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.profile-friends-button__section solid-ui-button.profile__btn-friends:not([disabled]):hover .profile__btn-friends-label,
|
|
37
|
+
.profile-friends-button__section solid-ui-button.profile__btn-friends:not([disabled]):focus-visible .profile__btn-friends-label,
|
|
38
|
+
.profile-friends-button__section solid-ui-button.profile__btn-friends:not([aria-disabled="true"]):hover .profile__btn-friends-label,
|
|
39
|
+
.profile-friends-button__section solid-ui-button.profile__btn-friends:not([aria-disabled="true"]):focus-visible .profile__btn-friends-label {
|
|
40
|
+
color: var(--color-text-on-action, var(--white, #FFF));
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.profile-friends-button__section .profile__btn-friends-label--short {
|
|
44
|
+
display: none;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.profile-friends-button__section .profile__btn-friends-label--short::before {
|
|
48
|
+
content: attr(data-short-label-text);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.profile-friends-button__container input[type="text"] {
|
|
52
|
+
width: 100%;
|
|
53
|
+
box-sizing: border-box;
|
|
54
|
+
}
|