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
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { TemplateResult } from 'lit-html';
|
|
2
|
-
import '
|
|
2
|
+
import 'solid-ui/components/actions/button';
|
|
3
|
+
import './HeadingSection.css';
|
|
3
4
|
import { ProfileDetails } from './types';
|
|
4
5
|
import { DataBrowserContext } from 'pane-registry';
|
|
5
6
|
import { NamedNode } from 'rdflib';
|
|
6
7
|
import { ViewerMode } from '../../types';
|
|
7
|
-
export declare const renderHeadingSection: (context: DataBrowserContext, subject: NamedNode, profileData: ProfileDetails, viewerMode: ViewerMode, onSaved?: () => Promise<void> | void) => TemplateResult<1
|
|
8
|
+
export declare const renderHeadingSection: (context: DataBrowserContext, subject: NamedNode, profileData: ProfileDetails, viewerMode: ViewerMode, onSaved?: () => Promise<void> | void) => Promise<TemplateResult<1>>;
|
|
8
9
|
export declare const Image: (src: any, alt: any) => TemplateResult<1>;
|
|
9
10
|
//# sourceMappingURL=HeadingSection.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HeadingSection.d.ts","sourceRoot":"","sources":["../../../src/sections/heading/HeadingSection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,cAAc,EAAE,MAAM,UAAU,CAAA;AACxD,OAAO,
|
|
1
|
+
{"version":3,"file":"HeadingSection.d.ts","sourceRoot":"","sources":["../../../src/sections/heading/HeadingSection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,cAAc,EAAE,MAAM,UAAU,CAAA;AACxD,OAAO,oCAAoC,CAAA;AAC3C,OAAO,sBAAsB,CAAA;AAC7B,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AACxC,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAqBxC,eAAO,MAAM,oBAAoB,GAC/B,SAAS,kBAAkB,EAC3B,SAAS,SAAS,EAClB,aAAa,cAAc,EAC3B,YAAY,UAAU,EACtB,UAAU,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,+BAyErC,CAAA;AAaD,eAAO,MAAM,KAAK,GAAI,QAAG,EAAE,QAAG,sBAmB7B,CAAA"}
|
|
@@ -5,13 +5,26 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.renderHeadingSection = exports.Image = void 0;
|
|
7
7
|
var _litHtml = require("lit-html");
|
|
8
|
-
require("
|
|
8
|
+
require("solid-ui/components/actions/button");
|
|
9
|
+
require("./HeadingSection.css");
|
|
9
10
|
var _HeadingEditDialog = require("./HeadingEditDialog");
|
|
10
11
|
var _textUtils = require("../../textUtils");
|
|
11
12
|
var _dateHelpers = require("./dateHelpers");
|
|
12
13
|
var _profileIcons = require("../../icons-svg/profileIcons");
|
|
13
14
|
var _contactIcons = require("../../icons-svg/contactIcons");
|
|
14
|
-
|
|
15
|
+
var _addMeToYourFriends = require("../../specialButtons/addMeToYourFriends");
|
|
16
|
+
var _addMeToYourContacts = require("../../specialButtons/addContact/addMeToYourContacts");
|
|
17
|
+
var _imageHelpers = require("./imageHelpers");
|
|
18
|
+
const showHeadingImageFallback = event => {
|
|
19
|
+
const image = event.currentTarget;
|
|
20
|
+
const frame = image?.parentElement;
|
|
21
|
+
if (!image || !frame) {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
image.hidden = true;
|
|
25
|
+
frame.classList.add('profile__image-frame--fallback');
|
|
26
|
+
};
|
|
27
|
+
const renderHeadingSection = async (context, subject, profileData, viewerMode, onSaved) => {
|
|
15
28
|
const {
|
|
16
29
|
name,
|
|
17
30
|
pronouns,
|
|
@@ -22,18 +35,22 @@ const renderHeadingSection = (context, subject, profileData, viewerMode, onSaved
|
|
|
22
35
|
primaryEmail,
|
|
23
36
|
imageSrc
|
|
24
37
|
} = profileData;
|
|
38
|
+
const resolvedImageSrc = await (0, _imageHelpers.resolvePhotoDisplaySrc)(context.session.store, imageSrc);
|
|
25
39
|
const isOwner = viewerMode === 'owner';
|
|
40
|
+
const isAuthenticatedViewer = viewerMode === 'authenticated';
|
|
41
|
+
const contactsButton = isAuthenticatedViewer ? await (0, _addMeToYourContacts.addMeToYourContactsDiv)(subject, context) : _litHtml.nothing;
|
|
42
|
+
const friendsButton = isAuthenticatedViewer ? (0, _addMeToYourFriends.addMeToYourFriendsDiv)(subject, context, viewerMode) : _litHtml.nothing;
|
|
26
43
|
const phoneValue = (0, _textUtils.toText)(primaryPhone?.valueNode).replace(/^tel:/i, '');
|
|
27
44
|
const emailValue = (0, _textUtils.toText)(primaryEmail?.valueNode).replace(/^mailto:/i, '');
|
|
28
|
-
const dateOfBirthDisplay = (0, _dateHelpers.toDisplayDateDMY)((0, _textUtils.toText)(dateOfBirth), '
|
|
45
|
+
const dateOfBirthDisplay = (0, _dateHelpers.toDisplayDateDMY)((0, _textUtils.toText)(dateOfBirth), '');
|
|
29
46
|
return (0, _litHtml.html)`
|
|
30
|
-
<section class="profile__section
|
|
47
|
+
<section class="profile__section" data-profile-section="heading" aria-labelledby="profile-name">
|
|
31
48
|
<div class="profile__heading-top">
|
|
32
49
|
<div class="profile__avatar">
|
|
33
|
-
${Image(
|
|
50
|
+
${Image(resolvedImageSrc, name)}
|
|
34
51
|
</div>
|
|
35
52
|
<div class="profile__info">
|
|
36
|
-
<header class="profile__header-bar
|
|
53
|
+
<header class="profile__header-bar">
|
|
37
54
|
<div class="profile__identity" role="group" aria-label="Name and pronouns">
|
|
38
55
|
<h1 id="profile-name" class="profile__name">${name}</h1>
|
|
39
56
|
<span class="profile__pronouns">${pronouns ? `(${pronouns})` : ''}</span>
|
|
@@ -41,20 +58,30 @@ const renderHeadingSection = (context, subject, profileData, viewerMode, onSaved
|
|
|
41
58
|
${jobTitle ? (0, _litHtml.html)`<div class="profile__role-org">${jobTitle}</div>` : _litHtml.nothing}
|
|
42
59
|
</header>
|
|
43
60
|
</div>
|
|
44
|
-
${isOwner ? (0, _litHtml.html)`
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
61
|
+
${isOwner || isAuthenticatedViewer ? (0, _litHtml.html)`
|
|
62
|
+
${isAuthenticatedViewer ? (0, _litHtml.html)`
|
|
63
|
+
<div class="profile__actions profile__heading-actions">
|
|
64
|
+
${contactsButton}
|
|
65
|
+
${friendsButton}
|
|
66
|
+
</div>
|
|
67
|
+
` : _litHtml.nothing}
|
|
68
|
+
${isOwner ? (0, _litHtml.html)`
|
|
69
|
+
<div class="profile__actions profile__heading-edit-action">
|
|
70
|
+
<solid-ui-button
|
|
71
|
+
type="button"
|
|
72
|
+
variant="secondary"
|
|
73
|
+
size="sm"
|
|
74
|
+
class="profile__action-button profile__heading-action-button profile-action-text profile-section-collapsible__edit-button"
|
|
75
|
+
aria-label="Add or edit heading information"
|
|
76
|
+
@click=${event => {
|
|
51
77
|
return (0, _HeadingEditDialog.createHeadingEditDialog)(event, context.session.store, subject, profileData, viewerMode, onSaved);
|
|
52
78
|
}}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
79
|
+
>
|
|
80
|
+
<span class="profile-section-collapsible__edit-label">${_profileIcons.editIcon} Edit</span>
|
|
81
|
+
<span class="profile-section-collapsible__edit-icon" aria-hidden="true">${_profileIcons.editIcon}</span>
|
|
82
|
+
</solid-ui-button>
|
|
83
|
+
</div>
|
|
84
|
+
` : _litHtml.nothing}
|
|
58
85
|
` : _litHtml.nothing}
|
|
59
86
|
<div class="profile__details">
|
|
60
87
|
<div class="profile__meta-row" role="group" aria-label="Additional profile information">
|
|
@@ -80,18 +107,22 @@ const Line = (value, prefix = _litHtml.nothing, label = '') => value ? (0, _litH
|
|
|
80
107
|
</span>
|
|
81
108
|
</div>
|
|
82
109
|
` : _litHtml.nothing;
|
|
83
|
-
const Image = (src, alt) =>
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
110
|
+
const Image = (src, alt) => (0, _litHtml.html)`
|
|
111
|
+
<div class=${src ? 'profile__image-frame' : 'profile__image-frame profile__image-frame--fallback'}>
|
|
112
|
+
${src ? (0, _litHtml.html)`
|
|
113
|
+
<img
|
|
114
|
+
class="profile__hero"
|
|
115
|
+
src=${src}
|
|
116
|
+
alt="${alt}"
|
|
117
|
+
width="140"
|
|
118
|
+
height="140"
|
|
119
|
+
loading="eager"
|
|
120
|
+
@error=${showHeadingImageFallback}
|
|
121
|
+
/>
|
|
122
|
+
` : _litHtml.nothing}
|
|
123
|
+
<div class="profile__hero-alt" role="img" aria-label="${alt}">
|
|
124
|
+
<span class="profile__hero-icon">${_profileIcons.personInCircleIcon}</span>
|
|
125
|
+
</div>
|
|
126
|
+
</div>
|
|
127
|
+
`;
|
|
97
128
|
exports.Image = Image;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { LiveStore, NamedNode } from 'rdflib';
|
|
2
|
+
export declare function resolvePhotoDisplaySrc(store: LiveStore, imageSrc?: string): Promise<string | undefined>;
|
|
2
3
|
export declare function uploadPhotoFile(store: LiveStore, subject: NamedNode, file: File): Promise<string>;
|
|
3
4
|
export declare function deletePhotoFile(store: LiveStore, subject: NamedNode, photoUri: string): Promise<void>;
|
|
4
5
|
//# sourceMappingURL=imageHelpers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"imageHelpers.d.ts","sourceRoot":"","sources":["../../../src/sections/heading/imageHelpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAO,MAAM,QAAQ,CAAA;
|
|
1
|
+
{"version":3,"file":"imageHelpers.d.ts","sourceRoot":"","sources":["../../../src/sections/heading/imageHelpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAO,MAAM,QAAQ,CAAA;AAwClD,wBAAsB,sBAAsB,CAAC,KAAK,EAAE,SAAS,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CA4B7G;AAED,wBAAsB,eAAe,CAAC,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAiDvG;AAED,wBAAsB,eAAe,CAAC,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAY3G"}
|
|
@@ -4,9 +4,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.deletePhotoFile = deletePhotoFile;
|
|
7
|
+
exports.resolvePhotoDisplaySrc = resolvePhotoDisplaySrc;
|
|
7
8
|
exports.uploadPhotoFile = uploadPhotoFile;
|
|
8
9
|
var _rdflib = require("rdflib");
|
|
9
10
|
var _solidUi = require("solid-ui");
|
|
11
|
+
var _solidLogic = require("solid-logic");
|
|
12
|
+
var _debug = require("../../utils/debug");
|
|
13
|
+
const resolvedHeadingImageCache = new Map();
|
|
10
14
|
/* Code copied from contact-pane/src/mugshotGallery and modified to fit the needs of the new design */
|
|
11
15
|
const mimeMap = {
|
|
12
16
|
'image/png': 'png',
|
|
@@ -35,6 +39,31 @@ function subjectDirectoryUri(subject) {
|
|
|
35
39
|
const lastSlash = docUri.lastIndexOf('/');
|
|
36
40
|
return lastSlash >= 0 ? docUri.slice(0, lastSlash + 1) : docUri;
|
|
37
41
|
}
|
|
42
|
+
async function resolvePhotoDisplaySrc(store, imageSrc) {
|
|
43
|
+
if (!imageSrc || imageSrc.startsWith('blob:') || imageSrc.startsWith('data:')) {
|
|
44
|
+
return imageSrc;
|
|
45
|
+
}
|
|
46
|
+
const cachedImageSrc = resolvedHeadingImageCache.get(imageSrc);
|
|
47
|
+
if (cachedImageSrc) {
|
|
48
|
+
return cachedImageSrc;
|
|
49
|
+
}
|
|
50
|
+
const fetcher = store.fetcher;
|
|
51
|
+
if (!fetcher?._fetch || typeof URL.createObjectURL !== 'function') {
|
|
52
|
+
return imageSrc;
|
|
53
|
+
}
|
|
54
|
+
try {
|
|
55
|
+
const response = await fetcher._fetch(imageSrc);
|
|
56
|
+
if (!response.ok) {
|
|
57
|
+
return imageSrc;
|
|
58
|
+
}
|
|
59
|
+
const imageBlob = await response.blob();
|
|
60
|
+
const resolvedImageSrc = URL.createObjectURL(imageBlob);
|
|
61
|
+
resolvedHeadingImageCache.set(imageSrc, resolvedImageSrc);
|
|
62
|
+
return resolvedImageSrc;
|
|
63
|
+
} catch {
|
|
64
|
+
return imageSrc;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
38
67
|
async function uploadPhotoFile(store, subject, file) {
|
|
39
68
|
if (!store.fetcher) {
|
|
40
69
|
throw new Error('Store has no fetcher.');
|
|
@@ -66,6 +95,16 @@ async function uploadPhotoFile(store, subject, file) {
|
|
|
66
95
|
} catch (error) {
|
|
67
96
|
throw new Error(`Error uploading picture: ${error}`);
|
|
68
97
|
}
|
|
98
|
+
const currentUser = _solidLogic.authn.currentUser();
|
|
99
|
+
if (currentUser) {
|
|
100
|
+
try {
|
|
101
|
+
await _solidLogic.solidLogicSingleton.acl.setACLUserPublic(candidateUri, currentUser, {
|
|
102
|
+
public: ['Read']
|
|
103
|
+
});
|
|
104
|
+
} catch (error) {
|
|
105
|
+
(0, _debug.error)(`Error setting uploaded picture permissions: ${error}`);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
69
108
|
return candidateUri;
|
|
70
109
|
}
|
|
71
110
|
async function deletePhotoFile(store, subject, photoUri) {
|
|
@@ -75,7 +114,7 @@ async function deletePhotoFile(store, subject, photoUri) {
|
|
|
75
114
|
try {
|
|
76
115
|
await store.fetcher.webOperation('DELETE', photoUri);
|
|
77
116
|
} catch (error) {
|
|
78
|
-
|
|
117
|
+
(0, _debug.error)(`Error deleting picture: ${error}`);
|
|
79
118
|
}
|
|
80
119
|
}
|
|
81
120
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mutations.d.ts","sourceRoot":"","sources":["../../../src/sections/heading/mutations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAA0B,MAAM,QAAQ,CAAA;AAErE,OAAO,EAAmB,mBAAmB,EAAE,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"mutations.d.ts","sourceRoot":"","sources":["../../../src/sections/heading/mutations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAA0B,MAAM,QAAQ,CAAA;AAErE,OAAO,EAAmB,mBAAmB,EAAE,MAAM,SAAS,CAAA;AA8S9D,wBAAsB,uBAAuB,CAAC,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,mBAAmB,iBAYpH"}
|
|
@@ -9,6 +9,18 @@ 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");
|
|
13
|
+
function splitPronouns(value) {
|
|
14
|
+
const normalized = (value || '').trim();
|
|
15
|
+
if (!normalized) return {};
|
|
16
|
+
const [subjectPronounRaw, objectPronounRaw] = normalized.split('/').map(part => part.trim());
|
|
17
|
+
const subjectPronoun = subjectPronounRaw || undefined;
|
|
18
|
+
const objectPronoun = objectPronounRaw || undefined;
|
|
19
|
+
return {
|
|
20
|
+
subjectPronoun,
|
|
21
|
+
objectPronoun
|
|
22
|
+
};
|
|
23
|
+
}
|
|
12
24
|
function buildPhoneStatements(subject, doc, node, phone) {
|
|
13
25
|
const normalizedValue = phone.value.startsWith('tel:') ? phone.value : `tel:${phone.value}`;
|
|
14
26
|
const valueNode = (0, _rdflib.sym)(normalizedValue);
|
|
@@ -30,11 +42,11 @@ function buildEmailStatements(subject, doc, node, email) {
|
|
|
30
42
|
function buildAddressStatements(subject, doc, node, address) {
|
|
31
43
|
const inserts = [(0, _rdflib.st)(subject, _solidUi.ns.vcard('hasAddress'), node, doc)];
|
|
32
44
|
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));
|
|
45
|
+
if (address.streetAddress) inserts.push((0, _rdflib.st)(node, _solidUi.ns.vcard('street-address'), (0, _rdflib.literal)(address.streetAddress), doc));
|
|
46
|
+
if (address.locality) inserts.push((0, _rdflib.st)(node, _solidUi.ns.vcard('locality'), (0, _rdflib.literal)(address.locality), doc));
|
|
47
|
+
if (address.region) inserts.push((0, _rdflib.st)(node, _solidUi.ns.vcard('region'), (0, _rdflib.literal)(address.region), doc));
|
|
48
|
+
if (address.postalCode) inserts.push((0, _rdflib.st)(node, _solidUi.ns.vcard('postal-code'), (0, _rdflib.literal)(address.postalCode), doc));
|
|
49
|
+
if (address.countryName) inserts.push((0, _rdflib.st)(node, _solidUi.ns.vcard('country-name'), (0, _rdflib.literal)(address.countryName), doc));
|
|
38
50
|
return inserts;
|
|
39
51
|
}
|
|
40
52
|
function findOpWithExistingEntry(ops, existingNodes) {
|
|
@@ -43,7 +55,7 @@ function findOpWithExistingEntry(ops, existingNodes) {
|
|
|
43
55
|
function findCreateOp(ops) {
|
|
44
56
|
return ops.find(op => !op.entryNode);
|
|
45
57
|
}
|
|
46
|
-
async function mutatePhoneEntry(store, subject, phoneOps) {
|
|
58
|
+
async function mutatePhoneEntry(store, subject, phoneOps, documentTextCache) {
|
|
47
59
|
const doc = subject.doc();
|
|
48
60
|
const existingPhoneNodes = store.each(subject, _solidUi.ns.vcard('hasTelephone'), null, doc);
|
|
49
61
|
const deletions = [];
|
|
@@ -72,9 +84,19 @@ async function mutatePhoneEntry(store, subject, phoneOps) {
|
|
|
72
84
|
if (createPhone) {
|
|
73
85
|
insertions.push(...buildPhoneStatements(subject, doc, (0, _idNodeFactory.createIdNode)(doc), createPhone));
|
|
74
86
|
}
|
|
75
|
-
await (0, _rdfMutationHelpers.
|
|
87
|
+
const shouldSerializeDocument = await (0, _rdfMutationHelpers.shouldForceDocumentPutForStatements)(store, doc, insertions, undefined, {
|
|
88
|
+
documentTextCache
|
|
89
|
+
});
|
|
90
|
+
await (0, _rdfMutationHelpers.runUpdateTransport)(store, doc, deletions, insertions, {
|
|
91
|
+
unsupportedMessage: _texts.updaterUnsupportedStoreErrorMessageText,
|
|
92
|
+
failureMessage: 'Failed to save heading updates',
|
|
93
|
+
documentTextCache,
|
|
94
|
+
useDavFallback: false,
|
|
95
|
+
usePutFallback: shouldSerializeDocument,
|
|
96
|
+
forcePut: shouldSerializeDocument
|
|
97
|
+
});
|
|
76
98
|
}
|
|
77
|
-
async function mutateEmailEntry(store, subject, emailOps) {
|
|
99
|
+
async function mutateEmailEntry(store, subject, emailOps, documentTextCache) {
|
|
78
100
|
const doc = subject.doc();
|
|
79
101
|
const existingEmailNodes = store.each(subject, _solidUi.ns.vcard('hasEmail'), null, doc);
|
|
80
102
|
const deletions = [];
|
|
@@ -103,9 +125,19 @@ async function mutateEmailEntry(store, subject, emailOps) {
|
|
|
103
125
|
if (createEmail) {
|
|
104
126
|
insertions.push(...buildEmailStatements(subject, doc, (0, _idNodeFactory.createIdNode)(doc), createEmail));
|
|
105
127
|
}
|
|
106
|
-
await (0, _rdfMutationHelpers.
|
|
128
|
+
const shouldSerializeDocument = await (0, _rdfMutationHelpers.shouldForceDocumentPutForStatements)(store, doc, insertions, undefined, {
|
|
129
|
+
documentTextCache
|
|
130
|
+
});
|
|
131
|
+
await (0, _rdfMutationHelpers.runUpdateTransport)(store, doc, deletions, insertions, {
|
|
132
|
+
unsupportedMessage: _texts.updaterUnsupportedStoreErrorMessageText,
|
|
133
|
+
failureMessage: 'Failed to save heading updates',
|
|
134
|
+
documentTextCache,
|
|
135
|
+
useDavFallback: false,
|
|
136
|
+
usePutFallback: shouldSerializeDocument,
|
|
137
|
+
forcePut: shouldSerializeDocument
|
|
138
|
+
});
|
|
107
139
|
}
|
|
108
|
-
async function mutateAddressEntry(store, subject, addressOps) {
|
|
140
|
+
async function mutateAddressEntry(store, subject, addressOps, documentTextCache) {
|
|
109
141
|
const doc = subject.doc();
|
|
110
142
|
const existingAddressNodes = store.each(subject, _solidUi.ns.vcard('hasAddress'), null, doc);
|
|
111
143
|
const deletions = [];
|
|
@@ -134,9 +166,19 @@ async function mutateAddressEntry(store, subject, addressOps) {
|
|
|
134
166
|
if (createAddress) {
|
|
135
167
|
insertions.push(...buildAddressStatements(subject, doc, (0, _idNodeFactory.createIdNode)(doc), createAddress));
|
|
136
168
|
}
|
|
137
|
-
await (0, _rdfMutationHelpers.
|
|
169
|
+
const shouldSerializeDocument = await (0, _rdfMutationHelpers.shouldForceDocumentPutForStatements)(store, doc, insertions, undefined, {
|
|
170
|
+
documentTextCache
|
|
171
|
+
});
|
|
172
|
+
await (0, _rdfMutationHelpers.runUpdateTransport)(store, doc, deletions, insertions, {
|
|
173
|
+
unsupportedMessage: _texts.updaterUnsupportedStoreErrorMessageText,
|
|
174
|
+
failureMessage: 'Failed to save heading updates',
|
|
175
|
+
documentTextCache,
|
|
176
|
+
useDavFallback: false,
|
|
177
|
+
usePutFallback: shouldSerializeDocument,
|
|
178
|
+
forcePut: shouldSerializeDocument
|
|
179
|
+
});
|
|
138
180
|
}
|
|
139
|
-
async function mutateBasicProfileEntry(store, subject, basicOps) {
|
|
181
|
+
async function mutateBasicProfileEntry(store, subject, basicOps, documentTextCache) {
|
|
140
182
|
const doc = subject.doc();
|
|
141
183
|
const deletions = [];
|
|
142
184
|
const insertions = [];
|
|
@@ -150,13 +192,21 @@ async function mutateBasicProfileEntry(store, subject, basicOps) {
|
|
|
150
192
|
const nextObject = !normalized ? null : normalized.startsWith('http://') || normalized.startsWith('https://') ? (0, _rdflib.sym)(normalized) : (0, _rdflib.literal)(normalized);
|
|
151
193
|
(0, _rdfMutationHelpers.replacePredicateStatements)(store, subject, _solidUi.ns.vcard('hasPhoto'), doc, deletions, insertions, nextObject);
|
|
152
194
|
};
|
|
195
|
+
const replacePronounFields = value => {
|
|
196
|
+
const {
|
|
197
|
+
subjectPronoun,
|
|
198
|
+
objectPronoun
|
|
199
|
+
} = splitPronouns(value);
|
|
200
|
+
(0, _rdfMutationHelpers.replacePredicateStatements)(store, subject, _solidUi.ns.solid('preferredSubjectPronoun'), doc, deletions, insertions, subjectPronoun ? (0, _rdflib.literal)(subjectPronoun) : null);
|
|
201
|
+
(0, _rdfMutationHelpers.replacePredicateStatements)(store, subject, _solidUi.ns.solid('preferredObjectPronoun'), doc, deletions, insertions, objectPronoun ? (0, _rdflib.literal)(objectPronoun) : null);
|
|
202
|
+
(0, _rdfMutationHelpers.replacePredicateStatements)(store, subject, _solidUi.ns.solid('preferredRelativePronoun'), doc, deletions, insertions, null);
|
|
203
|
+
};
|
|
153
204
|
const applyBasics = (basic, clearAll = false) => {
|
|
154
205
|
const data = clearAll ? {
|
|
155
206
|
name: '',
|
|
156
207
|
nickname: '',
|
|
208
|
+
pronouns: '',
|
|
157
209
|
dateOfBirth: '',
|
|
158
|
-
jobTitle: '',
|
|
159
|
-
orgName: '',
|
|
160
210
|
imageSrc: ''
|
|
161
211
|
} : basic;
|
|
162
212
|
replaceLiteralField(_solidUi.ns.vcard('fn'), data.name);
|
|
@@ -164,8 +214,7 @@ async function mutateBasicProfileEntry(store, subject, basicOps) {
|
|
|
164
214
|
replaceLiteralField(_solidUi.ns.foaf('nick'), data.nickname);
|
|
165
215
|
replaceLiteralField(_solidUi.ns.vcard('nickname'), data.nickname);
|
|
166
216
|
replaceLiteralField(_solidUi.ns.vcard('bday'), data.dateOfBirth);
|
|
167
|
-
|
|
168
|
-
replaceLiteralField(_solidUi.ns.vcard('organization-name'), data.orgName);
|
|
217
|
+
replacePronounFields(data.pronouns);
|
|
169
218
|
replacePhotoField(data.imageSrc);
|
|
170
219
|
};
|
|
171
220
|
const removeBasic = basicOps.remove[0];
|
|
@@ -175,16 +224,30 @@ async function mutateBasicProfileEntry(store, subject, basicOps) {
|
|
|
175
224
|
if (selectedBasic) {
|
|
176
225
|
applyBasics(selectedBasic, Boolean(removeBasic && !updateBasic && !createBasic));
|
|
177
226
|
}
|
|
178
|
-
await (0, _rdfMutationHelpers.
|
|
227
|
+
const shouldSerializeDocument = await (0, _rdfMutationHelpers.shouldForceDocumentPutForStatements)(store, doc, insertions, undefined, {
|
|
228
|
+
documentTextCache
|
|
229
|
+
});
|
|
230
|
+
await (0, _rdfMutationHelpers.runUpdateTransport)(store, doc, deletions, insertions, {
|
|
231
|
+
unsupportedMessage: _texts.updaterUnsupportedStoreErrorMessageText,
|
|
232
|
+
failureMessage: 'Failed to save heading updates',
|
|
233
|
+
documentTextCache,
|
|
234
|
+
useDavFallback: false,
|
|
235
|
+
usePutFallback: shouldSerializeDocument,
|
|
236
|
+
forcePut: shouldSerializeDocument
|
|
237
|
+
});
|
|
179
238
|
}
|
|
180
239
|
async function processHeadingMutations(store, subject, mutationPlan) {
|
|
181
240
|
try {
|
|
182
|
-
|
|
183
|
-
await
|
|
184
|
-
await
|
|
185
|
-
await
|
|
241
|
+
const documentTextCache = new Map();
|
|
242
|
+
await mutateBasicProfileEntry(store, subject, mutationPlan.basicOps, documentTextCache);
|
|
243
|
+
await mutatePhoneEntry(store, subject, mutationPlan.phoneOps, documentTextCache);
|
|
244
|
+
await mutateEmailEntry(store, subject, mutationPlan.emailOps, documentTextCache);
|
|
245
|
+
await mutateAddressEntry(store, subject, mutationPlan.addressOps, documentTextCache);
|
|
186
246
|
} catch (error) {
|
|
187
|
-
const
|
|
188
|
-
|
|
247
|
+
const rootError = error instanceof Error ? error : new Error(String(error));
|
|
248
|
+
(0, _debug.error)(_texts.headingMutationSaveFailedDebugText, rootError);
|
|
249
|
+
throw new Error(_texts.saveHeadingUpdatesFailedMessageText, {
|
|
250
|
+
cause: rootError
|
|
251
|
+
});
|
|
189
252
|
}
|
|
190
253
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selectors.d.ts","sourceRoot":"","sources":["../../../src/sections/heading/selectors.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAQ,SAAS,EAAE,MAAM,QAAQ,CAAA;AAGnD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"selectors.d.ts","sourceRoot":"","sources":["../../../src/sections/heading/selectors.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAQ,SAAS,EAAE,MAAM,QAAQ,CAAA;AAGnD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAyH7C,wBAAgB,cAAc,CAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAC,SAAS,GAAG,MAAM,CAS3E;AAsBD,eAAO,MAAM,cAAc,GACzB,SAAS,SAAS,EAClB,OAAO,SAAS,KACf,cA0EF,CAAA"}
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.presentProfile = void 0;
|
|
7
7
|
exports.pronounsAsText = pronounsAsText;
|
|
8
8
|
var _solidUi = require("solid-ui");
|
|
9
|
+
var _selectors = require("../resume/selectors");
|
|
9
10
|
/* Copied from presenter and modified for new functionallity */
|
|
10
11
|
|
|
11
12
|
function termValue(term) {
|
|
@@ -104,14 +105,25 @@ function pronounsAsText(store, subject) {
|
|
|
104
105
|
function formatLocation(countryName, locality) {
|
|
105
106
|
return countryName && locality ? `${locality}, ${countryName}` : countryName || locality || null;
|
|
106
107
|
}
|
|
108
|
+
function normalizeRoleType(value) {
|
|
109
|
+
return (value || '').replace(/\s+/g, '').toLowerCase();
|
|
110
|
+
}
|
|
111
|
+
function selectHeadingRole(roles) {
|
|
112
|
+
const currentRole = roles.find(role => role.isCurrentRole || normalizeRoleType(role.roleType) === 'currentrole');
|
|
113
|
+
if (currentRole) return currentRole;
|
|
114
|
+
return roles.find(role => {
|
|
115
|
+
const normalizedRoleType = normalizeRoleType(role.roleType);
|
|
116
|
+
return normalizedRoleType !== 'currentrole' && normalizedRoleType !== 'futurerole';
|
|
117
|
+
});
|
|
118
|
+
}
|
|
107
119
|
const presentProfile = (subject, store) => {
|
|
108
120
|
const name = _solidUi.utils.label(subject);
|
|
109
121
|
// on contact-pane form it is foaf, but maybe another app saves with vcard.
|
|
110
122
|
const nickname = store.anyValue(subject, _solidUi.ns.vcard('nickname')) || store.anyValue(subject, _solidUi.ns.foaf('nick')) || undefined;
|
|
111
123
|
const dateOfBirth = store.anyValue(subject, _solidUi.ns.vcard('bday')) || undefined;
|
|
112
124
|
const imageSrc = _solidUi.widgets.findImage(subject);
|
|
113
|
-
const
|
|
114
|
-
const
|
|
125
|
+
const headingRole = selectHeadingRole((0, _selectors.presentCV)(subject, store));
|
|
126
|
+
const jobTitle = headingRole?.title || undefined;
|
|
115
127
|
const doc = subject.doc();
|
|
116
128
|
|
|
117
129
|
// Contact info - we will only show one of each type here
|
|
@@ -145,7 +157,6 @@ const presentProfile = (subject, store) => {
|
|
|
145
157
|
imageSrc,
|
|
146
158
|
dateOfBirth,
|
|
147
159
|
jobTitle,
|
|
148
|
-
orgName,
|
|
149
160
|
primaryPhone,
|
|
150
161
|
primaryEmail,
|
|
151
162
|
primaryAddress,
|
|
@@ -10,7 +10,6 @@ export interface ProfilePresentation {
|
|
|
10
10
|
pronouns?: string;
|
|
11
11
|
dateOfBirth?: string;
|
|
12
12
|
jobTitle?: string;
|
|
13
|
-
orgName?: string;
|
|
14
13
|
primaryPhone?: PointDetails;
|
|
15
14
|
primaryEmail?: PointDetails;
|
|
16
15
|
primaryAddress?: AddressDetails;
|
|
@@ -22,7 +21,7 @@ export interface ProfileRow extends ProfilePresentation {
|
|
|
22
21
|
entryNode: string;
|
|
23
22
|
status: RowStatus;
|
|
24
23
|
}
|
|
25
|
-
export type ProfileBasicFields = Omit<ProfilePresentation, 'primaryPhone' | 'primaryEmail' | 'primaryAddress'>;
|
|
24
|
+
export type ProfileBasicFields = Omit<ProfilePresentation, 'jobTitle' | 'primaryPhone' | 'primaryEmail' | 'primaryAddress'>;
|
|
26
25
|
export type ProfileBasicRow = ProfileBasicFields & {
|
|
27
26
|
entryNode: string;
|
|
28
27
|
status: RowStatus;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/sections/heading/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAC7B,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAC7C,OAAO,KAAK,EAAE,cAAc,EAAE,iBAAiB,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAE5G,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/sections/heading/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAC7B,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAC7C,OAAO,KAAK,EAAE,cAAc,EAAE,iBAAiB,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAE5G,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,cAAc,CAAC,EAAE,cAAc,CAAC;CACjC;AAED,MAAM,WAAW,cAAe,SAAQ,mBAAmB;IACzD,SAAS,EAAE,IAAI,CAAA;CAChB;AAED,MAAM,WAAW,UAAW,SAAQ,mBAAmB;IACrD,SAAS,EAAE,MAAM,CAAA;IACjB,MAAM,EAAE,SAAS,CAAA;CAClB;AAED,MAAM,MAAM,kBAAkB,GAAG,IAAI,CACnC,mBAAmB,EACnB,UAAU,GAAG,cAAc,GAAG,cAAc,GAAG,gBAAgB,CAChE,CAAA;AAED,MAAM,MAAM,eAAe,GAAG,kBAAkB,GAAG;IACjD,SAAS,EAAE,MAAM,CAAA;IACjB,MAAM,EAAE,SAAS,CAAA;CAClB,CAAA;AAED,MAAM,MAAM,mBAAmB,GAAG;IAChC,QAAQ,EAAE,WAAW,CAAC,eAAe,CAAC,CAAA;IACtC,QAAQ,EAAE,WAAW,CAAC,eAAe,CAAC,CAAA;IACtC,QAAQ,EAAE,WAAW,CAAC,eAAe,CAAC,CAAA;IACtC,UAAU,EAAE,WAAW,CAAC,iBAAiB,CAAC,CAAA;CAC3C,CAAA"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import 'solid-ui/components/actions/button';
|
|
2
|
+
import 'solid-ui/components/forms/combobox';
|
|
1
3
|
import { LanguageDetails } 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 createLanguageEditDialog(event: Event, store: LiveStore, subject: NamedNode, languages: LanguageDetails[], viewerMode: ViewerMode, onSaved?: () => Promise<void> | void): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LanguageEditDialog.d.ts","sourceRoot":"","sources":["../../../src/sections/languages/LanguageEditDialog.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAe,MAAM,SAAS,CAAA;AACtD,OAAO,8BAA8B,CAAA;AACrC,OAAO,
|
|
1
|
+
{"version":3,"file":"LanguageEditDialog.d.ts","sourceRoot":"","sources":["../../../src/sections/languages/LanguageEditDialog.ts"],"names":[],"mappings":"AAEA,OAAO,oCAAoC,CAAA;AAC3C,OAAO,oCAAoC,CAAA;AAC3C,OAAO,EAAE,eAAe,EAAe,MAAM,SAAS,CAAA;AACtD,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;AAymBxC,wBAAsB,wBAAwB,CAC5C,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,SAAS,EAChB,OAAO,EAAE,SAAS,EAClB,SAAS,EAAE,eAAe,EAAE,EAC5B,UAAU,EAAE,UAAU,EACtB,OAAO,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,iBAgDrC"}
|