profile-pane 3.1.5 → 3.2.1
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 +16 -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/04567ff683933c35c465.png +0 -0
- package/lib/10163fd9b5a0e00d63a0.png +0 -0
- package/lib/1234dcb2eec2e45f252b.png +0 -0
- package/lib/20899934157df4db56cb.png +0 -0
- package/lib/33760bf79f097f449da5.png +0 -0
- package/lib/578d2b6ed32e7624164e.png +0 -0
- package/lib/5f62a5b2b7e99b9640c7.png +0 -0
- package/lib/6525766ecd288ec60129.png +0 -0
- package/lib/7800be6f6c4b5b0f4f20.png +0 -0
- package/lib/976473cf5fe24d657d4b.png +0 -0
- package/lib/ChatWithMe.d.ts +2 -1
- package/lib/ChatWithMe.d.ts.map +1 -1
- package/lib/ChatWithMe.js +3 -3
- package/lib/ProfileView.d.ts +1 -1
- package/lib/ProfileView.d.ts.map +1 -1
- package/lib/ProfileView.js +71 -131
- package/lib/ProfileViewModelPresenter.d.ts +23 -0
- package/lib/ProfileViewModelPresenter.d.ts.map +1 -0
- package/lib/ProfileViewModelPresenter.js +37 -0
- package/lib/QRCodeCard.d.ts +3 -1
- package/lib/QRCodeCard.d.ts.map +1 -1
- package/lib/QRCodeCard.js +86 -66
- package/lib/addMeToYourFriends.d.ts +3 -3
- package/lib/addMeToYourFriends.d.ts.map +1 -1
- package/lib/addMeToYourFriends.js +14 -30
- package/lib/bda84f59e7216675a208.png +0 -0
- package/lib/buttonsHelper.js +1 -1
- package/lib/cd68e8f3990ba8b2139e.png +0 -0
- package/lib/e7074a7e2cb69e51cfd3.png +0 -0
- package/lib/editProfilePane/EditCVCard.d.ts +1 -0
- package/lib/editProfilePane/EditCVCard.d.ts.map +1 -1
- package/lib/editProfilePane/EditCVCard.js +2 -1
- package/lib/editProfilePane/EditCommunitiesCard.d.ts +1 -1
- package/lib/editProfilePane/EditCommunitiesCard.d.ts.map +1 -1
- package/lib/editProfilePane/EditCommunitiesCard.js +2 -1
- package/lib/editProfilePane/EditContactsCard.d.ts +1 -0
- package/lib/editProfilePane/EditContactsCard.d.ts.map +1 -1
- package/lib/editProfilePane/EditContactsCard.js +2 -0
- package/lib/editProfilePane/EditFriendsCard.d.ts +1 -1
- package/lib/editProfilePane/EditFriendsCard.d.ts.map +1 -1
- package/lib/editProfilePane/EditFriendsCard.js +2 -1
- package/lib/editProfilePane/EditOtherPreferences.d.ts +1 -0
- package/lib/editProfilePane/EditOtherPreferences.d.ts.map +1 -1
- package/lib/editProfilePane/EditOtherPreferences.js +1 -0
- package/lib/editProfilePane/EditProfileView.d.ts +1 -1
- package/lib/editProfilePane/EditProfileView.d.ts.map +1 -1
- package/lib/editProfilePane/EditProfileView.js +1 -1
- package/lib/editProfilePane/EditSocialCard.d.ts +1 -0
- package/lib/editProfilePane/EditSocialCard.d.ts.map +1 -1
- package/lib/editProfilePane/EditSocialCard.js +2 -1
- package/lib/editProfilePane/editProfilePresenter.d.ts +1 -0
- package/lib/editProfilePane/editProfilePresenter.d.ts.map +1 -1
- package/lib/editProfilePane/editProfilePresenter.js +2 -0
- package/lib/f3772696fb7ee53c23d8.png +0 -0
- package/lib/icons-svg/contactIcons.d.ts +3 -0
- package/lib/icons-svg/contactIcons.d.ts.map +1 -0
- package/lib/icons-svg/contactIcons.js +32 -0
- package/lib/icons-svg/profileIcons.d.ts +22 -0
- package/lib/icons-svg/profileIcons.d.ts.map +1 -0
- package/lib/icons-svg/profileIcons.js +309 -0
- package/lib/index.d.ts +1 -3
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +42 -19
- package/lib/profile-pane.js +15629 -5670
- package/lib/profile-pane.js.map +1 -1
- package/lib/profile-pane.min.js +2171 -230
- package/lib/profile-pane.min.js.map +1 -1
- package/lib/rdfFormsHelper.d.ts +1 -0
- package/lib/rdfFormsHelper.d.ts.map +1 -1
- package/lib/rdfFormsHelper.js +2 -0
- package/lib/sections/bio/BioEditDialog.d.ts +6 -0
- package/lib/sections/bio/BioEditDialog.d.ts.map +1 -0
- package/lib/sections/bio/BioEditDialog.js +119 -0
- package/lib/sections/bio/BioSection.d.ts +7 -0
- package/lib/sections/bio/BioSection.d.ts.map +1 -0
- package/lib/sections/bio/BioSection.js +131 -0
- package/lib/sections/bio/mutations.d.ts +4 -0
- package/lib/sections/bio/mutations.d.ts.map +1 -0
- package/lib/sections/bio/mutations.js +43 -0
- package/lib/sections/bio/selectors.d.ts +4 -0
- package/lib/sections/bio/selectors.d.ts.map +1 -0
- package/lib/sections/bio/selectors.js +15 -0
- package/lib/sections/bio/types.d.ts +15 -0
- package/lib/sections/bio/types.d.ts.map +1 -0
- package/lib/sections/bio/types.js +5 -0
- package/lib/sections/contactInfo/ContactInfoEditDialog.d.ts +7 -0
- package/lib/sections/contactInfo/ContactInfoEditDialog.d.ts.map +1 -0
- package/lib/sections/contactInfo/ContactInfoEditDialog.js +658 -0
- package/lib/sections/contactInfo/ContactInfoSection.d.ts +5 -0
- package/lib/sections/contactInfo/ContactInfoSection.d.ts.map +1 -0
- package/lib/sections/contactInfo/ContactInfoSection.js +229 -0
- package/lib/sections/contactInfo/mutations.d.ts +4 -0
- package/lib/sections/contactInfo/mutations.d.ts.map +1 -0
- package/lib/sections/contactInfo/mutations.js +150 -0
- package/lib/sections/contactInfo/selectors.d.ts +4 -0
- package/lib/sections/contactInfo/selectors.d.ts.map +1 -0
- package/lib/sections/contactInfo/selectors.js +104 -0
- package/lib/sections/contactInfo/types.d.ts +44 -0
- package/lib/sections/contactInfo/types.d.ts.map +1 -0
- package/lib/sections/contactInfo/types.js +5 -0
- package/lib/sections/education/EducationEditDialog.d.ts +7 -0
- package/lib/sections/education/EducationEditDialog.d.ts.map +1 -0
- package/lib/sections/education/EducationEditDialog.js +459 -0
- package/lib/sections/education/EducationSection.d.ts +7 -0
- package/lib/sections/education/EducationSection.d.ts.map +1 -0
- package/lib/sections/education/EducationSection.js +126 -0
- package/lib/sections/education/mutations.d.ts +4 -0
- package/lib/sections/education/mutations.d.ts.map +1 -0
- package/lib/sections/education/mutations.js +60 -0
- package/lib/sections/education/selectors.d.ts +4 -0
- package/lib/sections/education/selectors.d.ts.map +1 -0
- package/lib/sections/education/selectors.js +64 -0
- package/lib/sections/education/types.d.ts +20 -0
- package/lib/sections/education/types.d.ts.map +1 -0
- package/lib/sections/education/types.js +5 -0
- package/lib/sections/heading/HeadingEditDialog.d.ts +6 -0
- package/lib/sections/heading/HeadingEditDialog.d.ts.map +1 -0
- package/lib/sections/heading/HeadingEditDialog.js +742 -0
- package/lib/sections/heading/HeadingSection.d.ts +9 -0
- package/lib/sections/heading/HeadingSection.d.ts.map +1 -0
- package/lib/sections/heading/HeadingSection.js +97 -0
- package/lib/sections/heading/camera.d.ts +19 -0
- package/lib/sections/heading/camera.d.ts.map +1 -0
- package/lib/sections/heading/camera.js +199 -0
- package/lib/sections/heading/dateHelpers.d.ts +4 -0
- package/lib/sections/heading/dateHelpers.d.ts.map +1 -0
- package/lib/sections/heading/dateHelpers.js +48 -0
- package/lib/sections/heading/imageHelpers.d.ts +4 -0
- package/lib/sections/heading/imageHelpers.d.ts.map +1 -0
- package/lib/sections/heading/imageHelpers.js +81 -0
- package/lib/sections/heading/mutations.d.ts +4 -0
- package/lib/sections/heading/mutations.d.ts.map +1 -0
- package/lib/sections/heading/mutations.js +190 -0
- package/lib/sections/heading/selectors.d.ts +5 -0
- package/lib/sections/heading/selectors.d.ts.map +1 -0
- package/lib/sections/heading/selectors.js +157 -0
- package/lib/sections/heading/types.d.ts +36 -0
- package/lib/sections/heading/types.d.ts.map +1 -0
- package/lib/sections/heading/types.js +5 -0
- package/lib/sections/languages/LanguageEditDialog.d.ts +7 -0
- package/lib/sections/languages/LanguageEditDialog.d.ts.map +1 -0
- package/lib/sections/languages/LanguageEditDialog.js +457 -0
- package/lib/sections/languages/LanguageSection.d.ts +5 -0
- package/lib/sections/languages/LanguageSection.d.ts.map +1 -0
- package/lib/sections/languages/LanguageSection.js +137 -0
- package/lib/sections/languages/mutations.d.ts +6 -0
- package/lib/sections/languages/mutations.d.ts.map +1 -0
- package/lib/sections/languages/mutations.js +296 -0
- package/lib/sections/languages/selectors.d.ts +5 -0
- package/lib/sections/languages/selectors.d.ts.map +1 -0
- package/lib/sections/languages/selectors.js +146 -0
- package/lib/sections/languages/types.d.ts +15 -0
- package/lib/sections/languages/types.d.ts.map +1 -0
- package/lib/sections/languages/types.js +5 -0
- package/lib/sections/projects/ProjectEditDialog.d.ts +7 -0
- package/lib/sections/projects/ProjectEditDialog.d.ts.map +1 -0
- package/lib/sections/projects/ProjectEditDialog.js +182 -0
- package/lib/sections/projects/ProjectSection.d.ts +6 -0
- package/lib/sections/projects/ProjectSection.d.ts.map +1 -0
- package/lib/sections/projects/ProjectSection.js +220 -0
- package/lib/sections/projects/mutations.d.ts +4 -0
- package/lib/sections/projects/mutations.d.ts.map +1 -0
- package/lib/sections/projects/mutations.js +188 -0
- package/lib/sections/projects/selectors.d.ts +5 -0
- package/lib/sections/projects/selectors.d.ts.map +1 -0
- package/lib/sections/projects/selectors.js +163 -0
- package/lib/sections/projects/types.d.ts +28 -0
- package/lib/sections/projects/types.d.ts.map +1 -0
- package/lib/sections/projects/types.js +8 -0
- package/lib/sections/resume/ResumeEditDialog.d.ts +7 -0
- package/lib/sections/resume/ResumeEditDialog.d.ts.map +1 -0
- package/lib/sections/resume/ResumeEditDialog.js +629 -0
- package/lib/sections/resume/ResumeSection.d.ts +7 -0
- package/lib/sections/resume/ResumeSection.d.ts.map +1 -0
- package/lib/sections/resume/ResumeSection.js +160 -0
- package/lib/sections/resume/mutations.d.ts +6 -0
- package/lib/sections/resume/mutations.d.ts.map +1 -0
- package/lib/sections/resume/mutations.js +172 -0
- package/lib/sections/resume/selectors.d.ts +4 -0
- package/lib/sections/resume/selectors.d.ts.map +1 -0
- package/lib/sections/resume/selectors.js +142 -0
- package/lib/sections/resume/types.d.ts +33 -0
- package/lib/sections/resume/types.d.ts.map +1 -0
- package/lib/sections/resume/types.js +8 -0
- package/lib/sections/shared/collapsibleSection.d.ts +2 -0
- package/lib/sections/shared/collapsibleSection.d.ts.map +1 -0
- package/lib/sections/shared/collapsibleSection.js +24 -0
- package/lib/sections/shared/contactTypeUtils.d.ts +7 -0
- package/lib/sections/shared/contactTypeUtils.d.ts.map +1 -0
- package/lib/sections/shared/contactTypeUtils.js +48 -0
- package/lib/sections/shared/idNodeFactory.d.ts +3 -0
- package/lib/sections/shared/idNodeFactory.d.ts.map +1 -0
- package/lib/sections/shared/idNodeFactory.js +14 -0
- package/lib/sections/shared/phoneCountries.d.ts +20 -0
- package/lib/sections/shared/phoneCountries.d.ts.map +1 -0
- package/lib/sections/shared/phoneCountries.js +1080 -0
- package/lib/sections/shared/rdfList.d.ts +3 -0
- package/lib/sections/shared/rdfList.d.ts.map +1 -0
- package/lib/sections/shared/rdfList.js +34 -0
- package/lib/sections/shared/rdfMutationHelpers.d.ts +12 -0
- package/lib/sections/shared/rdfMutationHelpers.d.ts.map +1 -0
- package/lib/sections/shared/rdfMutationHelpers.js +82 -0
- package/lib/sections/shared/rowState.d.ts +21 -0
- package/lib/sections/shared/rowState.d.ts.map +1 -0
- package/lib/sections/shared/rowState.js +52 -0
- package/lib/sections/shared/sanitizeUtils.d.ts +5 -0
- package/lib/sections/shared/sanitizeUtils.d.ts.map +1 -0
- package/lib/sections/shared/sanitizeUtils.js +22 -0
- package/lib/sections/shared/sectionCardHelpers.d.ts +11 -0
- package/lib/sections/shared/sectionCardHelpers.d.ts.map +1 -0
- package/lib/sections/shared/sectionCardHelpers.js +105 -0
- package/lib/sections/shared/types.d.ts +7 -0
- package/lib/sections/shared/types.d.ts.map +1 -0
- package/lib/sections/shared/types.js +5 -0
- package/lib/sections/skills/SkillsEditDialog.d.ts +7 -0
- package/lib/sections/skills/SkillsEditDialog.d.ts.map +1 -0
- package/lib/sections/skills/SkillsEditDialog.js +340 -0
- package/lib/sections/skills/SkillsSection.d.ts +5 -0
- package/lib/sections/skills/SkillsSection.d.ts.map +1 -0
- package/lib/sections/skills/SkillsSection.js +169 -0
- package/lib/sections/skills/mutations.d.ts +6 -0
- package/lib/sections/skills/mutations.d.ts.map +1 -0
- package/lib/sections/skills/mutations.js +110 -0
- package/lib/sections/skills/selectors.d.ts +6 -0
- package/lib/sections/skills/selectors.d.ts.map +1 -0
- package/lib/sections/skills/selectors.js +37 -0
- package/lib/sections/skills/types.d.ts +14 -0
- package/lib/sections/skills/types.d.ts.map +1 -0
- package/lib/sections/skills/types.js +5 -0
- package/lib/sections/social/SocialEditDialog.d.ts +7 -0
- package/lib/sections/social/SocialEditDialog.d.ts.map +1 -0
- package/lib/sections/social/SocialEditDialog.js +362 -0
- package/lib/sections/social/SocialSection.d.ts +8 -0
- package/lib/sections/social/SocialSection.d.ts.map +1 -0
- package/lib/sections/social/SocialSection.js +201 -0
- package/lib/sections/social/constants.d.ts +3 -0
- package/lib/sections/social/constants.d.ts.map +1 -0
- package/lib/sections/social/constants.js +16 -0
- package/lib/sections/social/helpers.d.ts +15 -0
- package/lib/sections/social/helpers.d.ts.map +1 -0
- package/lib/sections/social/helpers.js +316 -0
- package/lib/sections/social/mutations.d.ts +4 -0
- package/lib/sections/social/mutations.d.ts.map +1 -0
- package/lib/sections/social/mutations.js +298 -0
- package/lib/sections/social/selectors.d.ts +4 -0
- package/lib/sections/social/selectors.d.ts.map +1 -0
- package/lib/sections/social/selectors.js +43 -0
- package/lib/sections/social/types.d.ts +19 -0
- package/lib/sections/social/types.d.ts.map +1 -0
- package/lib/sections/social/types.js +5 -0
- package/lib/styles/BioSection.css +77 -0
- package/lib/styles/CVCard.css +107 -2
- package/lib/styles/ContactInfoEditDialog.css +153 -0
- package/lib/styles/EditDialogs.css +1028 -0
- package/lib/styles/EducationCard.css +103 -0
- package/lib/styles/HeadingSection.css +309 -0
- package/lib/styles/ProfileCard.css +10 -42
- package/lib/styles/ProfileView.css +53 -8
- package/lib/styles/ProjectsCard.css +206 -0
- package/lib/styles/QRCodeCard.css +29 -10
- package/lib/styles/SocialCard.css +41 -13
- package/lib/styles/dialog.css +209 -0
- package/lib/styles/utilities.css +638 -256
- package/lib/textUtils.d.ts +6 -0
- package/lib/textUtils.d.ts.map +1 -0
- package/lib/textUtils.js +44 -0
- package/lib/texts.d.ts +45 -4
- package/lib/texts.d.ts.map +1 -1
- package/lib/texts.js +46 -5
- package/lib/types.d.ts +2 -0
- package/lib/types.d.ts.map +1 -0
- package/lib/types.js +5 -0
- package/lib/ui/dialog.d.ts +29 -0
- package/lib/ui/dialog.d.ts.map +1 -0
- package/lib/ui/dialog.js +269 -0
- package/lib/ui/errors.d.ts +2 -0
- package/lib/ui/errors.d.ts.map +1 -0
- package/lib/ui/errors.js +10 -0
- package/package.json +8 -5
- package/lib/CVCard.d.ts +0 -4
- package/lib/CVCard.d.ts.map +0 -1
- package/lib/CVCard.js +0 -114
- package/lib/CVPresenter.d.ts +0 -25
- package/lib/CVPresenter.d.ts.map +0 -1
- package/lib/CVPresenter.js +0 -119
- package/lib/FriendList.d.ts +0 -6
- package/lib/FriendList.d.ts.map +0 -1
- package/lib/FriendList.js +0 -27
- package/lib/ProfileCard.d.ts +0 -6
- package/lib/ProfileCard.d.ts.map +0 -1
- package/lib/ProfileCard.js +0 -62
- package/lib/SocialCard.d.ts +0 -5
- package/lib/SocialCard.d.ts.map +0 -1
- package/lib/SocialCard.js +0 -51
- package/lib/SocialPresenter.d.ts +0 -11
- package/lib/SocialPresenter.d.ts.map +0 -1
- package/lib/SocialPresenter.js +0 -117
- package/lib/StuffCard.d.ts +0 -10
- package/lib/StuffCard.d.ts.map +0 -1
- package/lib/StuffCard.js +0 -52
- package/lib/StuffPresenter.d.ts +0 -14
- package/lib/StuffPresenter.d.ts.map +0 -1
- package/lib/StuffPresenter.js +0 -53
- package/lib/presenter.d.ts +0 -14
- package/lib/presenter.d.ts.map +0 -1
- package/lib/presenter.js +0 -68
- package/lib/styles/FriendList.css +0 -12
- package/lib/styles/StuffCard.css +0 -23
- package/lib/styles/editProfile.css +0 -62
- package/lib/styles/profileRDFFormsEnforced.css +0 -431
package/README.md
CHANGED
|
@@ -20,6 +20,22 @@ To run all tests:
|
|
|
20
20
|
npm test
|
|
21
21
|
```
|
|
22
22
|
|
|
23
|
+
Focused accessibility check:
|
|
24
|
+
```shell script
|
|
25
|
+
npm test -- test/profile-view.accessibility.test.ts
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Accessibility markup baseline checklist:
|
|
29
|
+
[docs/accessibility-baseline-checklist.md](docs/accessibility-baseline-checklist.md)
|
|
30
|
+
|
|
31
|
+
Refactor test plan (temporary skips and revisit checklist):
|
|
32
|
+
[docs/refactor-test-plan.md](docs/refactor-test-plan.md)
|
|
33
|
+
|
|
34
|
+
### Legacy Files
|
|
35
|
+
|
|
36
|
+
Legacy refactor artifacts are kept in [src/legacy](src/legacy).
|
|
37
|
+
These files are intentionally retained for historical/reference purposes and are not part of the active sections-based flow.
|
|
38
|
+
|
|
23
39
|
If you are a first time developer/user on Windows 10, the repository may give package issues regarding webpack or jest.
|
|
24
40
|
If this is the case, simply run "npm audit fix" and upgrade the repository. It should work fine.
|
|
25
41
|
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/icons-png/x.png
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/lib/ChatWithMe.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { TemplateResult } from 'lit-html';
|
|
2
2
|
import { DataBrowserContext } from 'pane-registry';
|
|
3
3
|
import { NamedNode } from 'rdflib';
|
|
4
|
+
import { ViewerMode } from './types';
|
|
4
5
|
import './styles/ChatWithMe.css';
|
|
5
|
-
export declare const ChatWithMe: (subject: NamedNode, context: DataBrowserContext) => TemplateResult;
|
|
6
|
+
export declare const ChatWithMe: (subject: NamedNode, context: DataBrowserContext, viewerMode: ViewerMode) => TemplateResult;
|
|
6
7
|
//# sourceMappingURL=ChatWithMe.d.ts.map
|
package/lib/ChatWithMe.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatWithMe.d.ts","sourceRoot":"","sources":["../src/ChatWithMe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,cAAc,EAAE,MAAM,UAAU,CAAA;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;AAMlC,OAAO,yBAAyB,CAAA;
|
|
1
|
+
{"version":3,"file":"ChatWithMe.d.ts","sourceRoot":"","sources":["../src/ChatWithMe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,cAAc,EAAE,MAAM,UAAU,CAAA;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;AAMlC,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AACpC,OAAO,yBAAyB,CAAA;AAGhC,eAAO,MAAM,UAAU,GACrB,SAAS,SAAS,EAClB,SAAS,kBAAkB,EAC3B,YAAY,UAAU,KACrB,cA0FF,CAAA"}
|
package/lib/ChatWithMe.js
CHANGED
|
@@ -11,7 +11,7 @@ var _asyncReplace = require("lit-html/directives/async-replace.js");
|
|
|
11
11
|
var _texts = require("./texts");
|
|
12
12
|
var _buttonsHelper = require("./buttonsHelper");
|
|
13
13
|
require("./styles/ChatWithMe.css");
|
|
14
|
-
const ChatWithMe = (subject, context) => {
|
|
14
|
+
const ChatWithMe = (subject, context, viewerMode) => {
|
|
15
15
|
const logic = context.session.logic;
|
|
16
16
|
const longChatPane = context.session.paneRegistry.byName('long chat');
|
|
17
17
|
async function* chatContainer() {
|
|
@@ -31,7 +31,7 @@ const ChatWithMe = (subject, context) => {
|
|
|
31
31
|
try {
|
|
32
32
|
yield (0, _litHtml.html)`
|
|
33
33
|
<div class="buttonSubSection">
|
|
34
|
-
<div class="
|
|
34
|
+
<div class="profile__action-button loading-text center" role="status" aria-live="polite">
|
|
35
35
|
${_texts.loadingMessage.toUpperCase()}
|
|
36
36
|
</div>
|
|
37
37
|
</div>
|
|
@@ -79,7 +79,7 @@ const ChatWithMe = (subject, context) => {
|
|
|
79
79
|
description.id = 'chat-button-description';
|
|
80
80
|
description.className = 'sr-only';
|
|
81
81
|
description.textContent = 'Start a new conversation or sign in to continue existing chat';
|
|
82
|
-
button.classList.add('
|
|
82
|
+
button.classList.add('profile__action-button', 'btn-primary', 'action-button-focus');
|
|
83
83
|
chatContainer.appendChild(button);
|
|
84
84
|
chatContainer.appendChild(description);
|
|
85
85
|
yield chatContainer;
|
package/lib/ProfileView.d.ts
CHANGED
|
@@ -2,5 +2,5 @@ import { TemplateResult } from 'lit-html';
|
|
|
2
2
|
import { DataBrowserContext } from 'pane-registry';
|
|
3
3
|
import { NamedNode } from 'rdflib';
|
|
4
4
|
import './styles/ProfileView.css';
|
|
5
|
-
export declare function ProfileView(subject: NamedNode, context: DataBrowserContext): Promise<TemplateResult>;
|
|
5
|
+
export declare function ProfileView(subject: NamedNode, context: DataBrowserContext, onSaved?: () => Promise<void> | void): Promise<TemplateResult>;
|
|
6
6
|
//# sourceMappingURL=ProfileView.d.ts.map
|
package/lib/ProfileView.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProfileView.d.ts","sourceRoot":"","sources":["../src/ProfileView.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,cAAc,EAAE,MAAM,UAAU,CAAA;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AAClD,OAAO,EAAE,SAAS,EAAa,MAAM,QAAQ,CAAA;
|
|
1
|
+
{"version":3,"file":"ProfileView.d.ts","sourceRoot":"","sources":["../src/ProfileView.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,cAAc,EAAE,MAAM,UAAU,CAAA;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AAClD,OAAO,EAAE,SAAS,EAAa,MAAM,QAAQ,CAAA;AAE7C,OAAO,0BAA0B,CAAA;AAgEjC,wBAAsB,WAAW,CAC/B,OAAO,EAAE,SAAS,EAClB,OAAO,EAAE,kBAAkB,EAC3B,OAAO,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,GACnC,OAAO,CAAE,cAAc,CAAC,CAsC1B"}
|
package/lib/ProfileView.js
CHANGED
|
@@ -5,145 +5,85 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.ProfileView = ProfileView;
|
|
7
7
|
var _litHtml = require("lit-html");
|
|
8
|
+
var _solidLogic = require("solid-logic");
|
|
8
9
|
require("./styles/ProfileView.css");
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
var
|
|
13
|
-
var
|
|
14
|
-
var
|
|
15
|
-
var
|
|
16
|
-
var
|
|
17
|
-
var
|
|
18
|
-
var
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
// The edit button switches to the editor pane
|
|
25
|
-
/*
|
|
26
|
-
function renderEditButton (subject) {
|
|
27
|
-
return
|
|
28
|
-
authn.currentUser() && authn.currentUser().sameTerm(subject) ?
|
|
29
|
-
html `<button type="button" class="ProfilePaneCVEditButton">
|
|
30
|
-
<img src="${editButtonURI}">
|
|
31
|
-
Edit</button>`
|
|
32
|
-
: html``;
|
|
10
|
+
var _QRCodeCard = require("./QRCodeCard");
|
|
11
|
+
var _ProfileViewModelPresenter = require("./ProfileViewModelPresenter");
|
|
12
|
+
var _ContactInfoSection = require("./sections/contactInfo/ContactInfoSection");
|
|
13
|
+
var _LanguageSection = require("./sections/languages/LanguageSection");
|
|
14
|
+
var _SkillsSection = require("./sections/skills/SkillsSection");
|
|
15
|
+
var _ResumeSection = require("./sections/resume/ResumeSection");
|
|
16
|
+
var _ProjectSection = require("./sections/projects/ProjectSection");
|
|
17
|
+
var _HeadingSection = require("./sections/heading/HeadingSection");
|
|
18
|
+
var _BioSection = require("./sections/bio/BioSection");
|
|
19
|
+
var _SocialSection = require("./sections/social/SocialSection");
|
|
20
|
+
function getViewerMode(subject) {
|
|
21
|
+
let mode = 'anonymous';
|
|
22
|
+
if (_solidLogic.authn.currentUser() && _solidLogic.authn.currentUser().sameTerm(subject)) mode = 'owner';
|
|
23
|
+
if (_solidLogic.authn.currentUser() && !_solidLogic.authn.currentUser().sameTerm(subject)) mode = 'authenticated';
|
|
24
|
+
return mode;
|
|
33
25
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
26
|
+
function renderSidebar(store, subject, accounts, skills, languages, contactInfo, viewerMode, onSaved) {
|
|
27
|
+
return (0, _litHtml.html)`
|
|
28
|
+
<aside
|
|
29
|
+
aria-labelledby="sidebar-heading"
|
|
30
|
+
class="profile__sidebar p-sm"
|
|
31
|
+
>
|
|
32
|
+
<h2 id="sidebar-heading" class="sr-only">Sidebar</h2>
|
|
33
|
+
<div aria-label="Sidebar Content" class="flex-column gap-md">
|
|
34
|
+
${(0, _SocialSection.renderSocialAccounts)(store, subject, accounts, viewerMode, onSaved)}
|
|
35
|
+
${(0, _SkillsSection.renderSkillsSection)(store, subject, skills, viewerMode, onSaved)}
|
|
36
|
+
${(0, _LanguageSection.renderLanguageSection)(store, subject, languages, viewerMode, onSaved)}
|
|
37
|
+
${(0, _ContactInfoSection.renderContactInfoSection)(store, subject, contactInfo, viewerMode, onSaved)}
|
|
38
|
+
${renderQRCode(subject, store)}
|
|
39
|
+
</div>
|
|
40
|
+
</aside>
|
|
41
|
+
`;
|
|
42
|
+
}
|
|
43
|
+
function renderQRCode(subject, store) {
|
|
44
|
+
return (0, _litHtml.html)`
|
|
45
|
+
<section class="profile__section border-lighter profile__qr-code" aria-labelledby="qr-heading" tabindex="-1">
|
|
46
|
+
<h2 id="qr-heading" class="sr-only">QR code</h2>
|
|
47
|
+
<div class="qrcode-card__frame flex-center">
|
|
48
|
+
${(0, _QRCodeCard.QRCodeCard)(subject, store)}
|
|
49
|
+
</div>
|
|
50
|
+
</section>
|
|
51
|
+
`;
|
|
52
|
+
}
|
|
53
|
+
async function ProfileView(subject, context, onSaved) {
|
|
37
54
|
const store = context.session.store;
|
|
38
|
-
const
|
|
39
|
-
const
|
|
40
|
-
const
|
|
41
|
-
const
|
|
55
|
+
const viewerMode = getViewerMode(subject);
|
|
56
|
+
const viewModel = await (0, _ProfileViewModelPresenter.presentProfileViewModel)(subject, store);
|
|
57
|
+
const profileDetails = viewModel.profileDetails;
|
|
58
|
+
const rolesByType = viewModel.cvDetails;
|
|
59
|
+
const skills = viewModel.skills;
|
|
60
|
+
const languages = viewModel.languages;
|
|
61
|
+
const projects = viewModel.projects;
|
|
62
|
+
const bioDetails = viewModel.bioDetails;
|
|
63
|
+
const accounts = viewModel.social;
|
|
64
|
+
const contactInfo = viewModel.contactInfo;
|
|
42
65
|
return (0, _litHtml.html)`
|
|
43
|
-
<
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
role="main"
|
|
48
|
-
aria-label="Profile for ${profileBasics.name}"
|
|
49
|
-
tabindex="-1"
|
|
50
|
-
>
|
|
51
|
-
|
|
52
|
-
<article
|
|
53
|
-
aria-labelledby="profile-card-heading"
|
|
54
|
-
class="profileSection section-bg"
|
|
55
|
-
role="region"
|
|
66
|
+
<div class="profile-pane-root">
|
|
67
|
+
<main
|
|
68
|
+
id="main-content"
|
|
69
|
+
class="profile-grid"
|
|
56
70
|
tabindex="-1"
|
|
57
|
-
>
|
|
58
|
-
<
|
|
59
|
-
<h2 id="profile-card-heading" tabindex="-1">${profileBasics.name}</h2>
|
|
60
|
-
</header>
|
|
61
|
-
${(0, _ProfileCard.ProfileCard)(profileBasics, context, subject)}
|
|
62
|
-
</article>
|
|
71
|
+
>
|
|
72
|
+
<h1 id="profile-content-heading" class="sr-only">Profile for ${profileDetails.name}</h1>
|
|
63
73
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
return cv && cv.strings && cv.strings.join('').trim() !== '' ? (0, _litHtml.html)`
|
|
67
|
-
<section
|
|
68
|
-
aria-labelledby="cv-heading"
|
|
69
|
-
class="profileSection section-bg"
|
|
70
|
-
role="region"
|
|
71
|
-
tabindex="-1"
|
|
74
|
+
<section
|
|
75
|
+
class="profile__main flex-column gap-md p-sm"
|
|
72
76
|
>
|
|
73
|
-
|
|
74
|
-
<h2 id="cv-heading" tabindex="-1">${_texts.resumeHeadingText}</h2>
|
|
75
|
-
</header>
|
|
76
|
-
<div>
|
|
77
|
-
${cv}
|
|
78
|
-
</div>
|
|
79
|
-
</section>
|
|
80
|
-
` : '';
|
|
81
|
-
})()}
|
|
82
|
-
|
|
83
|
-
${accounts.accounts && accounts.accounts.length > 0 ? (0, _litHtml.html)`
|
|
84
|
-
<aside
|
|
85
|
-
aria-labelledby="social-heading"
|
|
86
|
-
class="profileSection section-bg"
|
|
87
|
-
role="complementary"
|
|
88
|
-
tabindex="-1"
|
|
89
|
-
>
|
|
90
|
-
<header class="text-center mb-md">
|
|
91
|
-
<h2 id="social-heading" tabindex="-1">${_texts.socialAccountsHeadingText}</h2>
|
|
92
|
-
</header>
|
|
93
|
-
<nav aria-label="Social media links">
|
|
94
|
-
${(0, _SocialCard.SocialCard)(accounts)}
|
|
95
|
-
</nav>
|
|
96
|
-
</aside>
|
|
97
|
-
` : ''}
|
|
77
|
+
<h2 id="profile-main-heading" class="sr-only">Main Profile Content</h2>
|
|
98
78
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
tabindex="-1"
|
|
105
|
-
>
|
|
106
|
-
<header class="text-center mb-md">
|
|
107
|
-
<h2 id="stuff-heading" tabindex="-1">${_texts.sharedItemsHeadingText}</h2>
|
|
108
|
-
</header>
|
|
109
|
-
<div>
|
|
110
|
-
${(0, _StuffCard.StuffCard)(profileBasics, context, subject, stuffData)}
|
|
111
|
-
</div>
|
|
79
|
+
${(0, _HeadingSection.renderHeadingSection)(context, subject, profileDetails, viewerMode, onSaved)}
|
|
80
|
+
${(0, _BioSection.renderBioSection)(store, subject, bioDetails, viewerMode, onSaved)}
|
|
81
|
+
${(0, _ResumeSection.renderCVSection)(store, subject, rolesByType, viewerMode, onSaved)}
|
|
82
|
+
${(0, _ProjectSection.renderProjectSection)(store, subject, projects, viewerMode, onSaved)}
|
|
83
|
+
|
|
112
84
|
</section>
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
const friends = (0, _FriendList.FriendList)(subject, context);
|
|
117
|
-
return friends ? (0, _litHtml.html)`
|
|
118
|
-
<aside
|
|
119
|
-
aria-labelledby="friends-heading"
|
|
120
|
-
class="profileSection section-bg"
|
|
121
|
-
role="complementary"
|
|
122
|
-
tabindex="-1"
|
|
123
|
-
>
|
|
124
|
-
<header class="text-center mb-md">
|
|
125
|
-
<h2 id="friends-heading" tabindex="-1">${_texts.friendsHeadingText}</h2>
|
|
126
|
-
</header>
|
|
127
|
-
<div role="list" aria-label="Friend connections">
|
|
128
|
-
${friends}
|
|
129
|
-
</div>
|
|
130
|
-
</aside>
|
|
131
|
-
` : '';
|
|
132
|
-
})()}
|
|
133
|
-
|
|
134
|
-
<section
|
|
135
|
-
aria-labelledby="chat-heading"
|
|
136
|
-
class="profileSection section-bg"
|
|
137
|
-
role="region"
|
|
138
|
-
tabindex="-1"
|
|
139
|
-
>
|
|
140
|
-
<header class="text-center mb-md">
|
|
141
|
-
<h2 id="chat-heading" tabindex="-1">${_texts.contactHeadingText}</h2>
|
|
142
|
-
</header>
|
|
143
|
-
<div>
|
|
144
|
-
${(0, _ChatWithMe.ChatWithMe)(subject, context)}
|
|
145
|
-
</div>
|
|
146
|
-
</section>
|
|
147
|
-
</main>
|
|
85
|
+
${renderSidebar(store, subject, accounts, skills, languages, contactInfo, viewerMode, onSaved)}
|
|
86
|
+
</main>
|
|
87
|
+
</div>
|
|
148
88
|
`;
|
|
149
89
|
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { NamedNode, LiveStore } from 'rdflib';
|
|
2
|
+
import { ContactInfo } from './sections/contactInfo/types';
|
|
3
|
+
import { SocialPresentation } from './sections/social/types';
|
|
4
|
+
import { SkillDetails } from './sections/skills/types';
|
|
5
|
+
import { LanguageDetails } from './sections/languages/types';
|
|
6
|
+
import { RoleDetails } from './sections/resume/types';
|
|
7
|
+
import { EducationDetails } from './sections/education/types';
|
|
8
|
+
import { ProjectDetails } from './sections/projects/types';
|
|
9
|
+
import { ProfileDetails } from './sections/heading/types';
|
|
10
|
+
import { BioDetails } from './sections/bio/types';
|
|
11
|
+
export type ProfileViewModel = {
|
|
12
|
+
profileDetails: ProfileDetails;
|
|
13
|
+
contactInfo: ContactInfo;
|
|
14
|
+
skills: SkillDetails[];
|
|
15
|
+
languages: LanguageDetails[];
|
|
16
|
+
education: EducationDetails[];
|
|
17
|
+
projects: ProjectDetails[];
|
|
18
|
+
bioDetails: BioDetails;
|
|
19
|
+
social: SocialPresentation;
|
|
20
|
+
cvDetails: RoleDetails[];
|
|
21
|
+
};
|
|
22
|
+
export declare function presentProfileViewModel(subject: NamedNode, store: LiveStore): Promise<ProfileViewModel>;
|
|
23
|
+
//# sourceMappingURL=ProfileViewModelPresenter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProfileViewModelPresenter.d.ts","sourceRoot":"","sources":["../src/ProfileViewModelPresenter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;AAC7C,OAAO,EAAE,WAAW,EAAG,MAAM,8BAA8B,CAAA;AAE3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAE5D,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAEtD,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAE5D,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAErD,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAE7D,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAG1D,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AAGjD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,cAAc,EAAE,cAAc,CAAC;IAC/B,WAAW,EAAE,WAAW,CAAC;IACzB,MAAM,EAAE,YAAY,EAAE,CAAC;IACvB,SAAS,EAAE,eAAe,EAAE,CAAC;IAC7B,SAAS,EAAE,gBAAgB,EAAE,CAAC;IAC9B,QAAQ,EAAE,cAAc,EAAE,CAAC;IAC3B,UAAU,EAAE,UAAU,CAAC;IACvB,MAAM,EAAE,kBAAkB,CAAC;IAC3B,SAAS,EAAE,WAAW,EAAE,CAAA;CACzB,CAAA;AAED,wBAAsB,uBAAuB,CAAC,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAsB7G"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.presentProfileViewModel = presentProfileViewModel;
|
|
7
|
+
var _selectors = require("./sections/social/selectors");
|
|
8
|
+
var _selectors2 = require("./sections/skills/selectors");
|
|
9
|
+
var _selectors3 = require("./sections/languages/selectors");
|
|
10
|
+
var _selectors4 = require("./sections/resume/selectors");
|
|
11
|
+
var _selectors5 = require("./sections/contactInfo/selectors");
|
|
12
|
+
var _selectors6 = require("./sections/education/selectors");
|
|
13
|
+
var _selectors7 = require("./sections/projects/selectors");
|
|
14
|
+
var _selectors8 = require("./sections/heading/selectors");
|
|
15
|
+
var _selectors9 = require("./sections/bio/selectors");
|
|
16
|
+
async function presentProfileViewModel(subject, store) {
|
|
17
|
+
const profileDetails = (0, _selectors8.presentProfile)(subject, store);
|
|
18
|
+
const contactInfo = (0, _selectors5.presentContactInfo)(subject, store);
|
|
19
|
+
const skills = (0, _selectors2.presentSkillDetails)(subject, store);
|
|
20
|
+
const languages = (0, _selectors3.presentLanguages)(subject, store);
|
|
21
|
+
const education = (0, _selectors6.presentEducation)(subject, store);
|
|
22
|
+
const projects = await (0, _selectors7.presentProjects)(subject, store);
|
|
23
|
+
const bioDetails = (0, _selectors9.presentBio)(subject, store);
|
|
24
|
+
const social = (0, _selectors.presentSocial)(subject, store);
|
|
25
|
+
const cvDetails = (0, _selectors4.presentCV)(subject, store);
|
|
26
|
+
return {
|
|
27
|
+
profileDetails,
|
|
28
|
+
social,
|
|
29
|
+
contactInfo,
|
|
30
|
+
skills,
|
|
31
|
+
languages,
|
|
32
|
+
education,
|
|
33
|
+
projects,
|
|
34
|
+
bioDetails,
|
|
35
|
+
cvDetails
|
|
36
|
+
};
|
|
37
|
+
}
|
package/lib/QRCodeCard.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { TemplateResult } from 'lit-html';
|
|
2
2
|
import { NamedNode } from 'rdflib';
|
|
3
3
|
import './styles/QRCodeCard.css';
|
|
4
|
-
|
|
4
|
+
type LegacySubjectArg = NamedNode | string;
|
|
5
|
+
export declare const QRCodeCard: (arg1: LegacySubjectArg, arg2?: unknown, arg3?: unknown) => TemplateResult;
|
|
6
|
+
export {};
|
|
5
7
|
//# sourceMappingURL=QRCodeCard.d.ts.map
|
package/lib/QRCodeCard.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QRCodeCard.d.ts","sourceRoot":"","sources":["../src/QRCodeCard.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,cAAc,EAAE,MAAM,UAAU,CAAA;AAC/C,OAAO,
|
|
1
|
+
{"version":3,"file":"QRCodeCard.d.ts","sourceRoot":"","sources":["../src/QRCodeCard.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,cAAc,EAAE,MAAM,UAAU,CAAA;AAC/C,OAAO,EAAa,SAAS,EAAE,MAAM,QAAQ,CAAA;AAE7C,OAAO,yBAAyB,CAAA;AAMhC,KAAK,gBAAgB,GAAG,SAAS,GAAG,MAAM,CAAA;AAyF1C,eAAO,MAAM,UAAU,GACrB,MAAM,gBAAgB,EACtB,OAAO,OAAO,EACd,OAAO,OAAO,KACb,cAiEF,CAAA"}
|
package/lib/QRCodeCard.js
CHANGED
|
@@ -8,83 +8,103 @@ var _litHtml = require("lit-html");
|
|
|
8
8
|
var _solidUi = require("solid-ui");
|
|
9
9
|
require("./styles/QRCodeCard.css");
|
|
10
10
|
var _texts = require("./texts");
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
/* Part of this code was generated by AI Model: GPT-5.3-Codex */
|
|
12
|
+
/* Prompt: The QRCode has a label "link to profile" but it should
|
|
13
|
+
be a VCARD with name, and link to profile. So when you scan it
|
|
14
|
+
it goes into your contacts. That's the current way works, IIRC. */
|
|
15
|
+
|
|
16
|
+
function isNamedNodeLike(value) {
|
|
17
|
+
return Boolean(value && typeof value === 'object' && typeof value.uri === 'string');
|
|
18
|
+
}
|
|
19
|
+
function isStoreLike(value) {
|
|
20
|
+
return Boolean(value && typeof value === 'object' && typeof value.any === 'function');
|
|
21
|
+
}
|
|
22
|
+
function resolveQRCodeArgs(arg1, arg2, arg3) {
|
|
23
|
+
if (isNamedNodeLike(arg1)) {
|
|
24
|
+
return {
|
|
25
|
+
subject: arg1,
|
|
26
|
+
store: isStoreLike(arg2) ? arg2 : undefined
|
|
27
|
+
};
|
|
16
28
|
}
|
|
17
|
-
if (
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
29
|
+
if (isNamedNodeLike(arg3)) {
|
|
30
|
+
return {
|
|
31
|
+
subject: arg3,
|
|
32
|
+
store: isStoreLike(arg2) ? arg2 : undefined
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
throw new Error('QRCodeCard requires a profile subject NamedNode.');
|
|
24
36
|
}
|
|
25
|
-
function
|
|
26
|
-
|
|
27
|
-
g,
|
|
28
|
-
b
|
|
29
|
-
}) {
|
|
30
|
-
const a = [r, g, b].map(function (v) {
|
|
31
|
-
v /= 255;
|
|
32
|
-
return v <= 0.03928 ? v / 12.92 : Math.pow((v + 0.055) / 1.055, 2.4);
|
|
33
|
-
});
|
|
34
|
-
return 0.2126 * a[0] + 0.7152 * a[1] + 0.0722 * a[2];
|
|
37
|
+
function normalizeEmail(value) {
|
|
38
|
+
return (value || '').trim().replace(/^mailto:/i, '');
|
|
35
39
|
}
|
|
36
|
-
function
|
|
37
|
-
|
|
38
|
-
const rgb2 = hexToRgb(hex2);
|
|
39
|
-
if (!rgb1 || !rgb2) return 1;
|
|
40
|
-
const lum1 = luminance(rgb1);
|
|
41
|
-
const lum2 = luminance(rgb2);
|
|
42
|
-
const brightest = Math.max(lum1, lum2);
|
|
43
|
-
const darkest = Math.min(lum1, lum2);
|
|
44
|
-
return (brightest + 0.05) / (darkest + 0.05);
|
|
40
|
+
function normalizeTelephone(value) {
|
|
41
|
+
return (value || '').trim().replace(/^tel:/i, '');
|
|
45
42
|
}
|
|
46
|
-
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
const
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
if (
|
|
69
|
-
const
|
|
70
|
-
const
|
|
71
|
-
|
|
72
|
-
|
|
43
|
+
function isEmailValue(value) {
|
|
44
|
+
const normalized = (value || '').trim();
|
|
45
|
+
if (!normalized) return false;
|
|
46
|
+
if (/^mailto:/i.test(normalized)) return true;
|
|
47
|
+
return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(normalized);
|
|
48
|
+
}
|
|
49
|
+
function isPhoneValue(value) {
|
|
50
|
+
const normalized = (value || '').trim();
|
|
51
|
+
if (!normalized) return false;
|
|
52
|
+
if (/^tel:/i.test(normalized)) return true;
|
|
53
|
+
return /^[+()\-\s\d]{5,}$/.test(normalized);
|
|
54
|
+
}
|
|
55
|
+
function firstContactValue(store, subject, predicate, kind) {
|
|
56
|
+
if (!store) return '';
|
|
57
|
+
const candidates = store.each(subject, predicate);
|
|
58
|
+
const isExpectedValue = kind === 'email' ? isEmailValue : isPhoneValue;
|
|
59
|
+
for (const node of candidates) {
|
|
60
|
+
if (!node) continue;
|
|
61
|
+
const direct = node.value;
|
|
62
|
+
if (typeof direct === 'string' && isExpectedValue(direct)) {
|
|
63
|
+
return kind === 'email' ? normalizeEmail(direct) : normalizeTelephone(direct);
|
|
64
|
+
}
|
|
65
|
+
if (node.termType === 'NamedNode' || node.termType === 'BlankNode') {
|
|
66
|
+
const doc = subject.doc();
|
|
67
|
+
const inDocStatements = store.statementsMatching(node, _solidUi.ns.vcard('value'), null, doc);
|
|
68
|
+
const anyGraphStatements = store.statementsMatching(node, _solidUi.ns.vcard('value'));
|
|
69
|
+
for (const statement of [...inDocStatements, ...anyGraphStatements]) {
|
|
70
|
+
const viaValue = statement.object?.value;
|
|
71
|
+
if (typeof viaValue === 'string' && isExpectedValue(viaValue)) {
|
|
72
|
+
return kind === 'email' ? normalizeEmail(viaValue) : normalizeTelephone(viaValue);
|
|
73
|
+
}
|
|
73
74
|
}
|
|
74
|
-
} else {
|
|
75
|
-
console.warn('QRCodeCard: No element with role="img" found for the QR code. Ensure the QR code is rendered as an <img> or <canvas> with proper ARIA attributes.');
|
|
76
75
|
}
|
|
77
|
-
}
|
|
78
|
-
|
|
76
|
+
}
|
|
77
|
+
return '';
|
|
78
|
+
}
|
|
79
|
+
const QRCodeCard = (arg1, arg2, arg3) => {
|
|
80
|
+
const {
|
|
81
|
+
subject,
|
|
82
|
+
store
|
|
83
|
+
} = resolveQRCodeArgs(arg1, arg2, arg3);
|
|
84
|
+
const name = _solidUi.utils.label(subject);
|
|
85
|
+
const escapeVCardValue = value => {
|
|
86
|
+
return (value || '').replace(/\\/g, '\\\\').replace(/;/g, '\\;').replace(/,/g, '\\,').replace(/\r?\n/g, '\\n');
|
|
87
|
+
};
|
|
88
|
+
const safeName = escapeVCardValue(name || subject.uri);
|
|
89
|
+
const safeUrl = escapeVCardValue(subject.uri);
|
|
90
|
+
const email = firstContactValue(store, subject, _solidUi.ns.vcard('hasEmail'), 'email');
|
|
91
|
+
const telephone = firstContactValue(store, subject, _solidUi.ns.vcard('hasTelephone'), 'tel');
|
|
92
|
+
const vCardLines = ['BEGIN:VCARD', 'VERSION:4.0', `FN:${safeName}`, `URL:${safeUrl}`];
|
|
93
|
+
if (email) {
|
|
94
|
+
vCardLines.push(`EMAIL;TYPE=internet:${escapeVCardValue(email)}`);
|
|
95
|
+
}
|
|
96
|
+
if (telephone) {
|
|
97
|
+
vCardLines.push(`TEL:${escapeVCardValue(telephone)}`);
|
|
98
|
+
}
|
|
99
|
+
vCardLines.push('END:VCARD');
|
|
100
|
+
const vCard = vCardLines.join('\r\n');
|
|
79
101
|
|
|
80
102
|
// console.log(`@@ qrcodes colours highlightColor ${highlightColor}, backgroundColor ${backgroundColor}`)
|
|
81
103
|
|
|
82
104
|
return (0, _litHtml.html)`
|
|
83
105
|
<figure
|
|
84
|
-
class="
|
|
106
|
+
class="qrcode-card flex-column-center"
|
|
85
107
|
data-value="${vCard}"
|
|
86
|
-
highlightColor="${hC}"
|
|
87
|
-
backgroundColor="${bC}"
|
|
88
108
|
data-testid="qrcode-card"
|
|
89
109
|
aria-labelledby="qr-code-caption"
|
|
90
110
|
role="img"
|
|
@@ -97,7 +117,7 @@ const QRCodeCard = (highlightColor, backgroundColor, subject) => {
|
|
|
97
117
|
></div>
|
|
98
118
|
<figcaption
|
|
99
119
|
id="qr-code-caption"
|
|
100
|
-
class="
|
|
120
|
+
class="qrcode-card__caption"
|
|
101
121
|
>
|
|
102
122
|
${_texts.scanQrToConnectText}
|
|
103
123
|
</figcaption>
|