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.
- package/README.md +50 -0
- package/icons-png/discord.png +0 -0
- package/icons-png/dribbble.png +0 -0
- package/icons-png/facebook.png +0 -0
- package/icons-png/instagram.png +0 -0
- package/icons-png/linkedin.png +0 -0
- package/icons-png/pinterest.png +0 -0
- package/icons-png/sharechat.png +0 -0
- package/icons-png/signup.png +0 -0
- package/icons-png/snapchat.png +0 -0
- package/icons-png/spotify.png +0 -0
- package/icons-png/telegram.png +0 -0
- package/icons-png/tiktok.png +0 -0
- package/icons-png/whatsapp.png +0 -0
- package/icons-png/x.png +0 -0
- package/icons-png/youtube.png +0 -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 +34 -26
- 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
|
@@ -5,10 +5,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.renderContactInfoSection = renderContactInfoSection;
|
|
7
7
|
var _litHtml = require("lit-html");
|
|
8
|
+
require("solid-ui/components/actions/button");
|
|
8
9
|
var _ContactInfoEditDialog = require("./ContactInfoEditDialog");
|
|
9
10
|
var _solidUi = require("solid-ui");
|
|
11
|
+
require("./ContactInfoSection.css");
|
|
10
12
|
var _texts = require("../../texts");
|
|
11
13
|
var _collapsibleSection = require("../shared/collapsibleSection");
|
|
14
|
+
var _phoneCountries = require("../shared/phoneCountries");
|
|
12
15
|
var _contactTypeUtils = require("../shared/contactTypeUtils");
|
|
13
16
|
var _profileIcons = require("../../icons-svg/profileIcons");
|
|
14
17
|
var _contactIcons = require("../../icons-svg/contactIcons");
|
|
@@ -23,7 +26,14 @@ function toText(value) {
|
|
|
23
26
|
}
|
|
24
27
|
function normalizeContactValue(rawValue, kind) {
|
|
25
28
|
if (!rawValue) return '';
|
|
26
|
-
|
|
29
|
+
if (kind === 'email') {
|
|
30
|
+
return rawValue.replace(/^mailto:/i, '');
|
|
31
|
+
}
|
|
32
|
+
const normalizedPhone = rawValue.replace(/^tel:/i, '');
|
|
33
|
+
const {
|
|
34
|
+
localNumber
|
|
35
|
+
} = (0, _phoneCountries.splitPhoneValue)(normalizedPhone);
|
|
36
|
+
return localNumber || normalizedPhone;
|
|
27
37
|
}
|
|
28
38
|
function resolveContactValue(store, point, kind) {
|
|
29
39
|
if (!point) return '';
|
|
@@ -44,11 +54,11 @@ function renderPhone(phone, store) {
|
|
|
44
54
|
if (!phone) return (0, _litHtml.html)``;
|
|
45
55
|
const phoneValue = resolveContactValue(store, phone, 'phone');
|
|
46
56
|
const phoneType = (0, _contactTypeUtils.normalizePhoneTypeForEdit)(phone.type);
|
|
47
|
-
return (0, _litHtml.html)`<li class="contact-info__item
|
|
48
|
-
<div class="contact-info__icon-wrapper
|
|
57
|
+
return (0, _litHtml.html)`<li class="contact-info__item" role="listitem">
|
|
58
|
+
<div class="contact-info__icon-wrapper">
|
|
49
59
|
<span class="contact-info__icon" aria-hidden="true">${_contactIcons.phoneIcon}</span>
|
|
50
60
|
</div>
|
|
51
|
-
<div class="
|
|
61
|
+
<div class="contact-info__item-body">
|
|
52
62
|
<span class="contact-info__contact-point-value">${phoneValue}</span>
|
|
53
63
|
${phoneType ? (0, _litHtml.html)`<span class="contact-info__contact-point-type"> ${phoneType}</span>` : (0, _litHtml.html)``}
|
|
54
64
|
</div>
|
|
@@ -62,11 +72,11 @@ function renderEmail(email, store) {
|
|
|
62
72
|
if (!email) return (0, _litHtml.html)``;
|
|
63
73
|
const emailValue = resolveContactValue(store, email, 'email');
|
|
64
74
|
const emailType = (0, _contactTypeUtils.normalizeEmailTypeForEdit)(email.type);
|
|
65
|
-
return (0, _litHtml.html)`<li class="contact-info__item
|
|
66
|
-
<div class="contact-info__icon-wrapper
|
|
75
|
+
return (0, _litHtml.html)`<li class="contact-info__item" role="listitem">
|
|
76
|
+
<div class="contact-info__icon-wrapper">
|
|
67
77
|
<span class="contact-info__icon" aria-hidden="true">${_contactIcons.emailIcon}</span>
|
|
68
78
|
</div>
|
|
69
|
-
<div class="
|
|
79
|
+
<div class="contact-info__item-body">
|
|
70
80
|
<span class="contact-info__contact-point-value">${emailValue}</span>
|
|
71
81
|
${emailType ? (0, _litHtml.html)`<span class="contact-info__contact-point-type">${emailType}</span>` : (0, _litHtml.html)``}
|
|
72
82
|
</div>
|
|
@@ -86,8 +96,8 @@ function renderAddress(address) {
|
|
|
86
96
|
const localityRegion = [locality, region].filter(Boolean).join(', ');
|
|
87
97
|
const localityRegionPostal = [localityRegion, postalCode].filter(Boolean).join(' ');
|
|
88
98
|
return (0, _litHtml.html)`
|
|
89
|
-
<li class="contact-info__item
|
|
90
|
-
<div class="contact-info__icon-wrapper
|
|
99
|
+
<li class="contact-info__item" role="listitem">
|
|
100
|
+
<div class="contact-info__icon-wrapper">
|
|
91
101
|
<span class="contact-info__icon" aria-hidden="true">${_profileIcons.locationIcon}</span>
|
|
92
102
|
</div>
|
|
93
103
|
<span class="contact-info__address">
|
|
@@ -107,51 +117,60 @@ function renderContactInfoSectionDefault(store, subject, contactInfo, viewerMode
|
|
|
107
117
|
return (0, _litHtml.html)`
|
|
108
118
|
<section
|
|
109
119
|
aria-labelledby="contact-details-heading"
|
|
110
|
-
|
|
120
|
+
data-profile-section="contact-info"
|
|
121
|
+
class="profile__section profile-section-collapsible profile-section-collapsible--inline-mobile-actions"
|
|
111
122
|
role="region"
|
|
112
123
|
tabindex="-1"
|
|
113
124
|
data-expanded="false"
|
|
114
125
|
>
|
|
115
126
|
<header class="profile__section-header profile-section-collapsible__header">
|
|
116
|
-
<
|
|
117
|
-
<div class="profile-section-collapsible__actions
|
|
127
|
+
<h3 id="contact-details-heading" tabindex="-1">${_texts.contactInfoHeadingText}</h3>
|
|
128
|
+
<div class="profile-section-collapsible__actions">
|
|
118
129
|
${isOwner ? (0, _litHtml.html)`
|
|
119
|
-
<button
|
|
120
|
-
type="button"
|
|
121
|
-
|
|
130
|
+
<solid-ui-button
|
|
131
|
+
type="button"
|
|
132
|
+
variant="secondary"
|
|
133
|
+
size="sm"
|
|
134
|
+
class="profile__action-button profile-action-text profile-section-collapsible__edit-button"
|
|
122
135
|
aria-label="Edit contact information"
|
|
123
136
|
@click=${event => {
|
|
124
137
|
return (0, _ContactInfoEditDialog.createContactInfoEditDialog)(event, store, subject, contactInfo, viewerMode, onSaved);
|
|
125
|
-
}}
|
|
126
|
-
|
|
138
|
+
}}
|
|
139
|
+
>
|
|
140
|
+
<span class="profile-section-collapsible__edit-label profile__add-more-content">
|
|
141
|
+
<span class="profile__add-more-icon" aria-hidden="true">${_profileIcons.addIcon}</span>
|
|
142
|
+
<span>Add More</span>
|
|
143
|
+
</span>
|
|
127
144
|
<span class="profile-section-collapsible__edit-icon" aria-hidden="true">${_profileIcons.editIcon}</span>
|
|
128
|
-
</button>
|
|
145
|
+
</solid-ui-button>
|
|
129
146
|
` : (0, _litHtml.html)``}
|
|
130
|
-
<button
|
|
147
|
+
<solid-ui-button
|
|
131
148
|
type="button"
|
|
132
|
-
|
|
149
|
+
variant="icon"
|
|
150
|
+
size="sm"
|
|
151
|
+
class="profile-section-collapsible__toggle-button"
|
|
133
152
|
aria-label="Toggle contact information section"
|
|
134
153
|
aria-controls="contact-details-panel"
|
|
135
154
|
aria-expanded="false"
|
|
136
155
|
@click=${_collapsibleSection.toggleCollapsibleSection}
|
|
137
156
|
>
|
|
138
|
-
<span class="profile-section-collapsible__chevron" aria-hidden="true"
|
|
139
|
-
</button>
|
|
157
|
+
<span slot="icon" class="profile-section-collapsible__chevron" aria-hidden="true">${_profileIcons.chevronDownIcon}</span>
|
|
158
|
+
</solid-ui-button>
|
|
140
159
|
</div>
|
|
141
160
|
</header>
|
|
142
|
-
<div id="contact-details-panel" class="profile-section-collapsible__content"
|
|
161
|
+
<div id="contact-details-panel" class="profile-section-collapsible__content">
|
|
143
162
|
${contactInfo.phones.length > 0 ? (0, _litHtml.html)`
|
|
144
|
-
<ul class="contact-info__list
|
|
163
|
+
<ul class="contact-info__list" role="list" aria-label="Phone numbers">
|
|
145
164
|
${renderPhones(contactInfo.phones, store)}
|
|
146
165
|
</ul>
|
|
147
166
|
` : (0, _litHtml.html)``}
|
|
148
167
|
${contactInfo.emails.length > 0 ? (0, _litHtml.html)`
|
|
149
|
-
<ul class="contact-info__list
|
|
168
|
+
<ul class="contact-info__list" role="list" aria-label="Email addresses">
|
|
150
169
|
${renderEmails(contactInfo.emails, store)}
|
|
151
170
|
</ul>
|
|
152
171
|
` : (0, _litHtml.html)``}
|
|
153
172
|
${contactInfo.addresses.length > 0 ? (0, _litHtml.html)`
|
|
154
|
-
<ul class="contact-info__list
|
|
173
|
+
<ul class="contact-info__list" role="list" aria-label="Postal addresses">
|
|
155
174
|
${renderAddresses(contactInfo.addresses)}
|
|
156
175
|
</ul>
|
|
157
176
|
` : (0, _litHtml.html)``}
|
|
@@ -162,9 +181,9 @@ function renderContactInfoSectionDefault(store, subject, contactInfo, viewerMode
|
|
|
162
181
|
}
|
|
163
182
|
function renderOwnerEmptyContactInfoContent(_store, _subject, _contactInfo, _viewerMode, _onSaved) {
|
|
164
183
|
return (0, _litHtml.html)`
|
|
165
|
-
<div class="profile__empty-state-content
|
|
184
|
+
<div class="profile__empty-state-content" role="group" aria-label="Empty contact information section">
|
|
166
185
|
<div class="contact-info__empty-icon-wrapper">
|
|
167
|
-
<span class="contact-info__empty-icon
|
|
186
|
+
<span class="contact-info__empty-icon">${_profileIcons.envelopeIcon}</span>
|
|
168
187
|
</div>
|
|
169
188
|
<p class="profile__empty-state-message contact-info__empty-message">
|
|
170
189
|
No additional contact info added yet.
|
|
@@ -177,38 +196,42 @@ function renderOwnerEmptyContactInfoSection(store, subject, contactInfo, viewerM
|
|
|
177
196
|
<section
|
|
178
197
|
aria-labelledby="contact-details-heading"
|
|
179
198
|
data-profile-section="contact-info"
|
|
180
|
-
class="profile__section--empty
|
|
199
|
+
class="profile__section--empty profile__section--empty-sidebar profile-section-collapsible profile-section-collapsible--inline-mobile-actions"
|
|
181
200
|
role="region"
|
|
182
201
|
tabindex="-1"
|
|
183
202
|
data-expanded="false"
|
|
184
203
|
>
|
|
185
204
|
<header class="profile__section-header profile-section-collapsible__header">
|
|
186
|
-
<
|
|
187
|
-
<div class="profile-section-collapsible__actions
|
|
188
|
-
<button
|
|
205
|
+
<h3 id="contact-details-heading" tabindex="-1">${_texts.contactInfoEmptyHeadingText}</h3>
|
|
206
|
+
<div class="profile-section-collapsible__actions">
|
|
207
|
+
<solid-ui-button
|
|
189
208
|
type="button"
|
|
190
|
-
|
|
209
|
+
variant="secondary"
|
|
210
|
+
size="sm"
|
|
211
|
+
class="profile__action-button profile-action-text profile-section-collapsible__edit-button"
|
|
191
212
|
aria-label="Add contact information"
|
|
192
213
|
@click=${event => {
|
|
193
214
|
return (0, _ContactInfoEditDialog.createContactInfoEditDialog)(event, store, subject, contactInfo, viewerMode, onSaved);
|
|
194
215
|
}}
|
|
195
216
|
>
|
|
196
|
-
<span class="profile-section-collapsible__edit-label">${_profileIcons.addIcon} Add
|
|
197
|
-
<span class="profile-section-collapsible__edit-icon
|
|
198
|
-
</button>
|
|
199
|
-
<button
|
|
217
|
+
<span class="profile-section-collapsible__edit-label">${_profileIcons.addIcon} Add More</span>
|
|
218
|
+
<span class="profile-section-collapsible__edit-icon" aria-hidden="true">${_profileIcons.editIcon}</span>
|
|
219
|
+
</solid-ui-button>
|
|
220
|
+
<solid-ui-button
|
|
200
221
|
type="button"
|
|
201
|
-
|
|
222
|
+
variant="icon"
|
|
223
|
+
size="sm"
|
|
224
|
+
class="profile-section-collapsible__toggle-button"
|
|
202
225
|
aria-label="Toggle contact information section"
|
|
203
226
|
aria-controls="contact-details-panel"
|
|
204
227
|
aria-expanded="false"
|
|
205
228
|
@click=${_collapsibleSection.toggleCollapsibleSection}
|
|
206
229
|
>
|
|
207
|
-
<span class="profile-section-collapsible__chevron" aria-hidden="true"
|
|
208
|
-
</button>
|
|
230
|
+
<span slot="icon" class="profile-section-collapsible__chevron" aria-hidden="true">${_profileIcons.chevronDownIcon}</span>
|
|
231
|
+
</solid-ui-button>
|
|
209
232
|
</div>
|
|
210
233
|
</header>
|
|
211
|
-
<div id="contact-details-panel" class="profile-section-collapsible__content"
|
|
234
|
+
<div id="contact-details-panel" class="profile-section-collapsible__content">
|
|
212
235
|
${renderOwnerEmptyContactInfoContent(store, subject, contactInfo, viewerMode, onSaved)}
|
|
213
236
|
</div>
|
|
214
237
|
</section>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mutations.d.ts","sourceRoot":"","sources":["../../../src/sections/contactInfo/mutations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"mutations.d.ts","sourceRoot":"","sources":["../../../src/sections/contactInfo/mutations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAA0B,MAAM,QAAQ,CAAA;AAErE,OAAO,EAAqB,mBAAmB,EAAmB,MAAM,SAAS,CAAA;AAiMjF,wBAAsB,2BAA2B,CAAC,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,mBAAmB,iBAWxH"}
|
|
@@ -9,6 +9,7 @@ var _solidUi = require("solid-ui");
|
|
|
9
9
|
var _rdfMutationHelpers = require("../shared/rdfMutationHelpers");
|
|
10
10
|
var _idNodeFactory = require("../shared/idNodeFactory");
|
|
11
11
|
var _texts = require("../../texts");
|
|
12
|
+
var _debug = require("../../utils/debug");
|
|
12
13
|
function buildPhoneStatements(subject, doc, node, phone) {
|
|
13
14
|
const normalizedValue = phone.value.startsWith('tel:') ? phone.value : `tel:${phone.value}`;
|
|
14
15
|
const valueNode = (0, _rdflib.sym)(normalizedValue);
|
|
@@ -30,14 +31,14 @@ function buildEmailStatements(subject, doc, node, email) {
|
|
|
30
31
|
function buildAddressStatements(subject, doc, node, address) {
|
|
31
32
|
const inserts = [(0, _rdflib.st)(subject, _solidUi.ns.vcard('hasAddress'), node, doc)];
|
|
32
33
|
if (address.type) inserts.push((0, _rdflib.st)(node, _solidUi.ns.rdf('type'), _solidUi.ns.vcard(address.type), doc));
|
|
33
|
-
if (address.streetAddress) inserts.push((0, _rdflib.st)(node, _solidUi.ns.vcard('street-address'), address.streetAddress, doc));
|
|
34
|
-
if (address.locality) inserts.push((0, _rdflib.st)(node, _solidUi.ns.vcard('locality'), address.locality, doc));
|
|
35
|
-
if (address.region) inserts.push((0, _rdflib.st)(node, _solidUi.ns.vcard('region'), address.region, doc));
|
|
36
|
-
if (address.postalCode) inserts.push((0, _rdflib.st)(node, _solidUi.ns.vcard('postal-code'), address.postalCode, doc));
|
|
37
|
-
if (address.countryName) inserts.push((0, _rdflib.st)(node, _solidUi.ns.vcard('country-name'), address.countryName, doc));
|
|
34
|
+
if (address.streetAddress) inserts.push((0, _rdflib.st)(node, _solidUi.ns.vcard('street-address'), (0, _rdflib.literal)(address.streetAddress), doc));
|
|
35
|
+
if (address.locality) inserts.push((0, _rdflib.st)(node, _solidUi.ns.vcard('locality'), (0, _rdflib.literal)(address.locality), doc));
|
|
36
|
+
if (address.region) inserts.push((0, _rdflib.st)(node, _solidUi.ns.vcard('region'), (0, _rdflib.literal)(address.region), doc));
|
|
37
|
+
if (address.postalCode) inserts.push((0, _rdflib.st)(node, _solidUi.ns.vcard('postal-code'), (0, _rdflib.literal)(address.postalCode), doc));
|
|
38
|
+
if (address.countryName) inserts.push((0, _rdflib.st)(node, _solidUi.ns.vcard('country-name'), (0, _rdflib.literal)(address.countryName), doc));
|
|
38
39
|
return inserts;
|
|
39
40
|
}
|
|
40
|
-
async function mutatePhoneEntries(store, subject, phoneOps) {
|
|
41
|
+
async function mutatePhoneEntries(store, subject, phoneOps, documentTextCache) {
|
|
41
42
|
const doc = subject.doc();
|
|
42
43
|
const existingPhoneNodes = store.each(subject, _solidUi.ns.vcard('hasTelephone'), null, doc);
|
|
43
44
|
const deletions = [];
|
|
@@ -72,9 +73,19 @@ async function mutatePhoneEntries(store, subject, phoneOps) {
|
|
|
72
73
|
phoneOps.create.forEach(phone => {
|
|
73
74
|
insertions.push(...buildPhoneStatements(subject, doc, (0, _idNodeFactory.createIdNode)(doc), phone));
|
|
74
75
|
});
|
|
75
|
-
await (0, _rdfMutationHelpers.
|
|
76
|
+
const shouldSerializeDocument = await (0, _rdfMutationHelpers.shouldForceDocumentPutForStatements)(store, doc, insertions, undefined, {
|
|
77
|
+
documentTextCache
|
|
78
|
+
});
|
|
79
|
+
await (0, _rdfMutationHelpers.runUpdateTransport)(store, doc, deletions, insertions, {
|
|
80
|
+
unsupportedMessage: _texts.updaterUnsupportedStoreErrorMessageText,
|
|
81
|
+
failureMessage: 'Failed to save contact info updates',
|
|
82
|
+
documentTextCache,
|
|
83
|
+
useDavFallback: false,
|
|
84
|
+
usePutFallback: shouldSerializeDocument,
|
|
85
|
+
forcePut: shouldSerializeDocument
|
|
86
|
+
});
|
|
76
87
|
}
|
|
77
|
-
async function mutateEmailEntries(store, subject, emailOps) {
|
|
88
|
+
async function mutateEmailEntries(store, subject, emailOps, documentTextCache) {
|
|
78
89
|
const doc = subject.doc();
|
|
79
90
|
const existingEmailNodes = store.each(subject, _solidUi.ns.vcard('hasEmail'), null, doc);
|
|
80
91
|
const deletions = [];
|
|
@@ -104,9 +115,19 @@ async function mutateEmailEntries(store, subject, emailOps) {
|
|
|
104
115
|
emailOps.create.forEach(email => {
|
|
105
116
|
insertions.push(...buildEmailStatements(subject, doc, (0, _idNodeFactory.createIdNode)(doc), email));
|
|
106
117
|
});
|
|
107
|
-
await (0, _rdfMutationHelpers.
|
|
118
|
+
const shouldSerializeDocument = await (0, _rdfMutationHelpers.shouldForceDocumentPutForStatements)(store, doc, insertions, undefined, {
|
|
119
|
+
documentTextCache
|
|
120
|
+
});
|
|
121
|
+
await (0, _rdfMutationHelpers.runUpdateTransport)(store, doc, deletions, insertions, {
|
|
122
|
+
unsupportedMessage: _texts.updaterUnsupportedStoreErrorMessageText,
|
|
123
|
+
failureMessage: 'Failed to save contact info updates',
|
|
124
|
+
documentTextCache,
|
|
125
|
+
useDavFallback: false,
|
|
126
|
+
usePutFallback: shouldSerializeDocument,
|
|
127
|
+
forcePut: shouldSerializeDocument
|
|
128
|
+
});
|
|
108
129
|
}
|
|
109
|
-
async function mutateAddressEntries(store, subject, addressOps) {
|
|
130
|
+
async function mutateAddressEntries(store, subject, addressOps, documentTextCache) {
|
|
110
131
|
const doc = subject.doc();
|
|
111
132
|
const existingAddressNodes = store.each(subject, _solidUi.ns.vcard('hasAddress'), null, doc);
|
|
112
133
|
const deletions = [];
|
|
@@ -136,15 +157,29 @@ async function mutateAddressEntries(store, subject, addressOps) {
|
|
|
136
157
|
addressOps.create.forEach(address => {
|
|
137
158
|
insertions.push(...buildAddressStatements(subject, doc, (0, _idNodeFactory.createIdNode)(doc), address));
|
|
138
159
|
});
|
|
139
|
-
await (0, _rdfMutationHelpers.
|
|
160
|
+
const shouldSerializeDocument = await (0, _rdfMutationHelpers.shouldForceDocumentPutForStatements)(store, doc, insertions, undefined, {
|
|
161
|
+
documentTextCache
|
|
162
|
+
});
|
|
163
|
+
await (0, _rdfMutationHelpers.runUpdateTransport)(store, doc, deletions, insertions, {
|
|
164
|
+
unsupportedMessage: _texts.updaterUnsupportedStoreErrorMessageText,
|
|
165
|
+
failureMessage: 'Failed to save contact info updates',
|
|
166
|
+
documentTextCache,
|
|
167
|
+
useDavFallback: false,
|
|
168
|
+
usePutFallback: shouldSerializeDocument,
|
|
169
|
+
forcePut: shouldSerializeDocument
|
|
170
|
+
});
|
|
140
171
|
}
|
|
141
172
|
async function processContactInfoMutations(store, subject, mutationPlan) {
|
|
142
173
|
try {
|
|
143
|
-
|
|
144
|
-
await
|
|
145
|
-
await
|
|
174
|
+
const documentTextCache = new Map();
|
|
175
|
+
await mutatePhoneEntries(store, subject, mutationPlan.phoneOps, documentTextCache);
|
|
176
|
+
await mutateEmailEntries(store, subject, mutationPlan.emailOps, documentTextCache);
|
|
177
|
+
await mutateAddressEntries(store, subject, mutationPlan.addressOps, documentTextCache);
|
|
146
178
|
} catch (error) {
|
|
147
|
-
const
|
|
148
|
-
|
|
179
|
+
const rootError = error instanceof Error ? error : new Error(String(error));
|
|
180
|
+
(0, _debug.error)(_texts.contactInfoMutationSaveFailedDebugText, rootError);
|
|
181
|
+
throw new Error(_texts.saveContactUpdatesFailedMessageText, {
|
|
182
|
+
cause: rootError
|
|
183
|
+
});
|
|
149
184
|
}
|
|
150
185
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import 'solid-ui/components/actions/button';
|
|
2
|
+
import 'solid-ui/components/forms/select';
|
|
1
3
|
import { EducationDetails } from './types';
|
|
2
4
|
import '../../styles/EditDialogs.css';
|
|
3
|
-
import '
|
|
5
|
+
import '../contactInfo/ContactInfoEditDialog.css';
|
|
4
6
|
import { LiveStore, NamedNode } from 'rdflib';
|
|
5
7
|
import { ViewerMode } from '../../types';
|
|
6
8
|
export declare function createEducationEditDialog(event: Event, store: LiveStore, subject: NamedNode, educationData: EducationDetails[], viewerMode: ViewerMode, onSaved?: () => Promise<void> | void): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EducationEditDialog.d.ts","sourceRoot":"","sources":["../../../src/sections/education/EducationEditDialog.ts"],"names":[],"mappings":"AAEA,OAAO,EAAgB,gBAAgB,EAAE,MAAM,SAAS,CAAA;AACxD,OAAO,8BAA8B,CAAA;AACrC,OAAO,
|
|
1
|
+
{"version":3,"file":"EducationEditDialog.d.ts","sourceRoot":"","sources":["../../../src/sections/education/EducationEditDialog.ts"],"names":[],"mappings":"AAEA,OAAO,oCAAoC,CAAA;AAC3C,OAAO,kCAAkC,CAAA;AACzC,OAAO,EAAgB,gBAAgB,EAAE,MAAM,SAAS,CAAA;AACxD,OAAO,8BAA8B,CAAA;AACrC,OAAO,0CAA0C,CAAA;AACjD,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;AAE7C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAgiBxC,wBAAsB,yBAAyB,CAC7C,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,SAAS,EAChB,OAAO,EAAE,SAAS,EAClB,aAAa,EAAE,gBAAgB,EAAE,EACjC,UAAU,EAAE,UAAU,EACtB,OAAO,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,iBAqDrC"}
|