profile-pane 3.1.3 → 3.1.4
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/lib/FriendList.d.ts +0 -1
- package/lib/FriendList.d.ts.map +1 -1
- package/lib/FriendList.js +5 -33
- package/lib/SocialPresenter.js +1 -1
- package/lib/addMeToYourFriends.d.ts +4 -3
- package/lib/addMeToYourFriends.d.ts.map +1 -1
- package/lib/addMeToYourFriends.js +25 -9
- package/lib/editProfilePane/EditCVCard.d.ts.map +1 -1
- package/lib/editProfilePane/EditCVCard.js +2 -7
- package/lib/editProfilePane/EditCommunitiesCard.d.ts +3 -1
- package/lib/editProfilePane/EditCommunitiesCard.d.ts.map +1 -1
- package/lib/editProfilePane/EditCommunitiesCard.js +58 -23
- package/lib/editProfilePane/EditFriendsCard.d.ts +3 -1
- package/lib/editProfilePane/EditFriendsCard.d.ts.map +1 -1
- package/lib/editProfilePane/EditFriendsCard.js +58 -23
- package/lib/editProfilePane/EditOtherPreferences.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 +7 -3
- package/lib/editProfilePane/EditSocialCard.d.ts.map +1 -1
- package/lib/editProfilePane/EditSocialCard.js +2 -7
- package/lib/editProfilePane/editProfilePresenter.d.ts +4 -0
- package/lib/editProfilePane/editProfilePresenter.d.ts.map +1 -0
- package/lib/editProfilePane/editProfilePresenter.js +108 -0
- package/lib/profile-pane.js +1005 -340
- package/lib/profile-pane.js.map +1 -1
- package/lib/profile-pane.min.js +45 -46
- 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 +125 -0
- package/lib/styles/ProfileCard.css +6 -0
- package/lib/styles/ProfileView.css +3 -5
- package/lib/styles/editProfile.css +62 -0
- package/lib/styles/profileRDFFormsEnforced.css +427 -0
- package/lib/styles/utilities.css +30 -1
- package/lib/texts.d.ts +5 -5
- package/lib/texts.d.ts.map +1 -1
- package/lib/texts.js +5 -5
- package/package.json +9 -6
- package/lib/styles/rdfFormsEnforced.css +0 -186
|
@@ -10,9 +10,10 @@ var _EditFriendsCard = require("./EditFriendsCard");
|
|
|
10
10
|
var _EditSocialCard = require("./EditSocialCard");
|
|
11
11
|
var _EditCommunitiesCard = require("./EditCommunitiesCard");
|
|
12
12
|
require("../styles/utilities.css");
|
|
13
|
-
require("../styles/
|
|
13
|
+
require("../styles/profileRDFFormsEnforced.css");
|
|
14
14
|
var _EditCVCard = require("./EditCVCard");
|
|
15
15
|
var _EditOtherPreferences = require("./EditOtherPreferences");
|
|
16
|
+
var _rdfFormsHelper = require("../rdfFormsHelper");
|
|
16
17
|
/**
|
|
17
18
|
* Profile Editing App Pane
|
|
18
19
|
*
|
|
@@ -101,10 +102,13 @@ const editProfileView = {
|
|
|
101
102
|
main.appendChild((0, _EditOtherPreferences.EditOtherPreferencesSection)(context, me, editableProfile, store));
|
|
102
103
|
|
|
103
104
|
// People you know Section
|
|
104
|
-
main.appendChild((0, _EditFriendsCard.EditFriendsSection)(context, me, editableProfile
|
|
105
|
+
main.appendChild((0, _EditFriendsCard.EditFriendsSection)(context, me, editableProfile));
|
|
105
106
|
|
|
106
107
|
// Communities you participate in Section
|
|
107
|
-
main.appendChild((0, _EditCommunitiesCard.EditProfileCommunitiesSection)(context, me, editableProfile
|
|
108
|
+
main.appendChild((0, _EditCommunitiesCard.EditProfileCommunitiesSection)(context, me, editableProfile));
|
|
109
|
+
|
|
110
|
+
// Ensure keyboard navigation skips labels (including those rendered as links).
|
|
111
|
+
(0, _rdfFormsHelper.skipLabelsFromTabbing)(main);
|
|
108
112
|
main.setAttribute('aria-busy', 'false');
|
|
109
113
|
main.focus();
|
|
110
114
|
}).catch(error => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditSocialCard.d.ts","sourceRoot":"","sources":["../../src/editProfilePane/EditSocialCard.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AAClD,OAAO,EAAE,SAAS,EAAE,KAAK,EAAC,MAAM,QAAQ,CAAA;AAOxC,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,kBAAkB,EAAE,EAAE,EAAE,SAAS,EAAE,eAAe,EAAE,SAAS,GAAG,IAAI,EAAE,KAAK,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"EditSocialCard.d.ts","sourceRoot":"","sources":["../../src/editProfilePane/EditSocialCard.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AAClD,OAAO,EAAE,SAAS,EAAE,KAAK,EAAC,MAAM,QAAQ,CAAA;AAOxC,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,kBAAkB,EAAE,EAAE,EAAE,SAAS,EAAE,eAAe,EAAE,SAAS,GAAG,IAAI,EAAE,KAAK,EAAE,KAAK,eA2B5H"}
|
|
@@ -8,7 +8,7 @@ var _rdfFormsHelper = _interopRequireDefault(require("../rdfFormsHelper"));
|
|
|
8
8
|
var _texts = require("../texts");
|
|
9
9
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
10
|
/* babel-plugin-inline-import '../ontology/socialMedia.ttl' */
|
|
11
|
-
const socialMediaForm = "@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.\n@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.\n@prefix foaf: <http://xmlns.com/foaf/0.1/>.\n@prefix owl: <http://www.w3.org/2002/07/owl#>.\n@prefix solid: <http://www.w3.org/ns/solid/terms#>.\n@prefix ui: <http://www.w3.org/ns/ui#>.\n@prefix schema: <http://schema.org/>.\n@prefix vcard: <http://www.w3.org/2006/vcard/ns#>.\n@prefix org: <http://www.w3.org/ns/org#>.\n@prefix : <#>.\n\n########### ATTENTION - we cannot rename this ontology file name without migrating existing data on existing accounts\n\n########### Social Media - other accounts\n#\n# Twitter, linked In, Orkid, Mastodon, Matrix, Bluesky, Instagram, Facebook, Github,\n# Snapchat, TikTok, etc\n\n:this\n <http://purl.org/dc/elements/1.1/title> \"Social media form\" ;\n a ui:Form ;\n ui:parts (\n :SocialsForm\n ).\n\n:SocialsForm a ui:Multiple;\n ui:label \"online account\";\n ui:property foaf:account; # the triple is created with the foaf:acccounts predicate\n ui:ordered true; # Allow user to order occounts most important first.\n ui:part :AccountsForm.\n\n:AccountsForm a ui:Group; \n ui:weight 1; \n ui:parts ( \n :AccountField \n :AccountIdField ).\n\n:AccountField a ui:Classifier; \n ui:label \"Choose account\"@en;\n ui:multiple false ; \n ui:category foaf:Account. # the accounts are described by the foaf:Account predicate\n\n# this is what is needed to make a dropdown box\nfoaf:Account a rdfs:Class;\n rdfs:label \"Online Account Provider\";\n owl:disjointUnionOf ( \n :BlueSkyAccount :DiggAccount :FacebookAccount :GithubAccount :InstagramAccount\n :LinkedInAccount :MastodonAccount :MatrixAccount :MediumAccount :NostrAccount \n :OrcidAccount :PinterestAccount :RedditAccount :SnapchatAccount :StravaAccount \n :TiktokAccount :TumblrAccount :TwitterAccount :OtherAccount) .\n\n:AccountIdField a ui:Options; \n ui:dependingOn rdf:type; \n ui:case\n [ ui:for :BlueSkyAccount; ui:use :BlueSkyIdField ],\n [ ui:for :DiggAccount; ui:use :DiggIdField],\n [ ui:for :FacebookAccount; ui:use :FacebookIdField ],\n [ ui:for :GithubAccount; ui:use :GithubIdField ],\n [ ui:for :InstagramAccount; ui:use :InstagramIdField ],\n [ ui:for :LinkedInAccount; ui:use :LinkedInIdField ],\n [ ui:for :MastodonAccount; ui:use :MastodonIdField ],\n [ ui:for :MatrixAccount; ui:use :MatrixIdField ],\n [ ui:for :MediumAccount; ui:use :MediumIdField ],\n [ ui:for :NostrAccount; ui:use :NostrIdField ],\n [ ui:for :OrcidAccount; ui:use :OrcidIdField ],\n [ ui:for :PinterestAccount; ui:use :PinterestIdField ],\n [ ui:for :RedditAccount; ui:use :RedditIdField ],\n [ ui:for :StravaAccount; ui:use :StravaIdField ],\n [ ui:for :SnapchatAccount; ui:use :SnapchatIdField ],\n [ ui:for :TiktokAccount; ui:use :TiktokIdField ],\n [ ui:for :TumblrAccount; ui:use :TumblrIdField ],\n [ ui:for :TwitterAccount; ui:use :TwitterIdField ],\n [ ui:for :OtherAccount; ui:use :OtherIdForm ] .\n\n:BlueSkyAccount rdfs:subClassOf foaf:Account ;\n rdfs:label \"Bluesky\";\n foaf:userProfilePrefix \"https://bsky.app/profile/\";\n foaf:icon <https://solidos.github.io/solid-ui/src/icons/social/bluesky-1.svg>;\n foaf:homepage <https://bsky.app/> .\n\n:DiggAccount rdfs:subClassOf foaf:Account ;\n rdfs:label \"Digg\";\n foaf:userProfilePrefix \"https://www.digg.com/\";\n foaf:icon <https://solidos.github.io/solid-ui/src/icons/social/digg-icon.svg>;\n foaf:homepage <https://www.digg.com/> .\n\n:FacebookAccount rdfs:subClassOf foaf:Account ;\n rdfs:label \"Facebook\";\n foaf:userProfilePrefix \"https://www.facebook.com/\";\n foaf:icon <https://solidos.github.io/solid-ui/src/icons/social/facebook-2020-2-1.svg>;\n foaf:homepage <https://www.facebook.com/> .\n\n:GithubAccount rdfs:subClassOf foaf:Account ;\n rdfs:label \"Github\";\n foaf:userProfilePrefix \"https://www.github.com/\";\n foaf:icon <https://solidos.github.io/solid-ui/src/icons/social/github-icon.svg>;\n foaf:homepage <https://github.com/> .\n\n:InstagramAccount rdfs:subClassOf foaf:Account ;\n rdfs:label \"Instagram\";\n foaf:userProfilePrefix \"https://www.instagram.com/\";\n foaf:icon <https://solidos.github.io/solid-ui/src/icons/social/instagram-2016-5.svg>;\n foaf:homepage <https://www.instagram.com/> .\n\n:LinkedInAccount rdfs:subClassOf foaf:Account ;\n rdfs:label \"LinkedIn\";\n foaf:userProfilePrefix \"https://www.linkedin.com/in/\";\n foaf:icon <https://solidos.github.io/solid-ui/src/icons/social/linkedin-icon.svg>;\n foaf:homepage <https://linkedin.com/> .\n\n:MastodonAccount rdfs:subClassOf foaf:Account ;\n rdfs:label \"Mastodon\" ;\n foaf:userProfilePrefix \"https://mastodon.social/\";\n foaf:icon <https://solidos.github.io/solid-ui/src/icons/social/mastodon-2.svg>;\n foaf:homepage <https://joinmastodon.org/> .\n\n:MatrixAccount rdfs:subClassOf foaf:Account ;\n rdfs:label \"Matrix\" ;\n foaf:icon <https://solidos.github.io/solid-ui/src/icons/social/matrix-logo-black.svg> ;\n foaf:userProfilePrefix \"https://matrix.to/#/\" ;\n foaf:homepage <https://matrix.org/> .\n\n:MediumAccount rdfs:subClassOf foaf:Account ;\n rdfs:label \"Medium\";\n foaf:userProfilePrefix \"https://medium.com/\";\n foaf:icon <https://solidos.github.io/solid-ui/src/icons/social/medium-logo-wordmark-black.svg>;\n foaf:homepage <https://medium.com/> .\n\n:NostrAccount rdfs:subClassOf foaf:Account ;\n rdfs:label \"Nostr\";\n foaf:userProfilePrefix \"https://primal.net/p/\";\n foaf:icon <https://solidos.github.io/solid-ui/src/icons/social/nostr-icon-purple-on-white.svg>;\n foaf:homepage <https://nostr.net/> .\n\n:OrcidAccount rdfs:subClassOf foaf:Account ;\n rdfs:label \"ORCiD\";\n foaf:userProfilePrefix \"https://orcid.org/\";\n foaf:icon <https://solidos.github.io/solid-ui/src/icons/social/ORCID-1.svg>;\n foaf:homepage <https://orcid.org/> .\n\n:PinterestAccount rdfs:subClassOf foaf:Account ;\n rdfs:label \"Pinterest\";\n foaf:userProfilePrefix \"https://pin.it/\";\n foaf:icon <https://solidos.github.io/solid-ui/src/icons/social/pinterest-2-1.svg>;\n foaf:homepage <https://pinterest.com/> .\n\n:RedditAccount rdfs:subClassOf foaf:Account ;\n rdfs:label \"Reddit\";\n foaf:userProfilePrefix \"https://www.reddit.com/user/\";\n foaf:icon <https://solidos.github.io/solid-ui/src/icons/social/reddit-4.svg>;\n foaf:homepage <https://reddit.com/> .\n\n:SnapchatAccount rdfs:subClassOf foaf:Account ;\n rdfs:label \"Snapchat\";\n foaf:userProfilePrefix \"https://www.snapchat.com/add/\";\n foaf:icon <https://solidos.github.io/solid-ui/src/icons/social/snapchat-1.svg>;\n foaf:homepage <https://www.snapchat.com/> .\n\n:StravaAccount rdfs:subClassOf foaf:Account ;\n rdfs:label \"Strava\";\n foaf:userProfilePrefix \"https://www.strava.com/athletes/\";\n foaf:icon <https://solidos.github.io/solid-ui/src/icons/social/strava-2.svg>;\n foaf:homepage <https://strava.com/> .\n\n:TiktokAccount rdfs:subClassOf foaf:Account ;\n rdfs:label \"TikTok\";\n foaf:userProfilePrefix \"https://www.tiktok.com/@\";\n foaf:icon <https://solidos.github.io/solid-ui/src/icons/social/tiktok-icon-2.svg>;\n foaf:homepage <https://www.tiktok.com/> .\n\n:TumblrAccount rdfs:subClassOf foaf:Account ;\n rdfs:label \"Tumblr\";\n foaf:userProfilePrefix \"https://www.tumblr.com/\";\n foaf:icon <https://solidos.github.io/solid-ui/src/icons/social/tumblr-icon.svg>;\n foaf:homepage <https://www.tumblr.com/> .\n\n:TwitterAccount rdfs:subClassOf foaf:Account ;\n rdfs:label \"X\";\n foaf:userProfilePrefix \"https://x.com/\";\n foaf:icon <https://solidos.github.io/solid-ui/src/icons/social/x-2.svg>;\n foaf:homepage <https://x.com/> .\n\n:OtherAccount rdfs:subClassOf foaf:Account ;\n rdfs:label \"Other\" ;\n foaf:icon <https://solidos.github.io/solid-ui/src/icons/noun_1689339.svg> .\n\n:BlueSkyIdField\n a ui:SingleLineTextField ;\n ui:label \"Username\";\n ui:maxLength \"200\" ;\n ui:property foaf:accountName ; \n ui:pattern \"@[a-z0-9A-Z_-](.[a-z0-9A-Z_-])*\".\n\n:DiggIdField\n a ui:SingleLineTextField ;\n ui:label \"Username\";\n ui:maxLength \"200\" ;\n ui:property foaf:accountName ; \n ui:pattern \"@[a-z0-9A-Z_-](.[a-z0-9A-Z_-])*\".\n\n:FacebookIdField\n a ui:SingleLineTextField ;\n ui:label \"Username\";\n ui:property foaf:accountName ; \n ui:pattern \"[a-z0-9A-Z_-]*\".\n\n:GithubIdField\n a ui:SingleLineTextField ;\n ui:label \"Username\";\n ui:maxLength \"200\" ;\n ui:property foaf:accountName ; \n ui:pattern \"[a-z0-9A-Z_-]*\".\n\n:InstagramIdField\n a ui:SingleLineTextField ;\n ui:label \"Username\";\n ui:maxLength \"200\" ;\n ui:property foaf:accountName ; \n ui:pattern \"[a-z0-9A-Z_-]*\".\n\n:LinkedInIdField\n a ui:SingleLineTextField ;\n ui:label \"Username\";\n ui:maxLength \"200\" ;\n ui:property foaf:accountName ; \n ui:pattern \"[a-z0-9A-Z_-]*(.[a-z0-9A-Z_-])*\".\n\n:MastodonIdField\n a ui:SingleLineTextField ;\n ui:label \"Username\";\n ui:maxLength \"200\" ;\n ui:property foaf:accountName ; \n ui:pattern \"@[a-z0-9A-Z_-]*(.[a-z0-9A-Z_-])*\".\n\n:MatrixIdField\n a ui:SingleLineTextField ;\n ui:label \"Username\";\n ui:maxLength \"200\" ;\n ui:property foaf:accountName ; \n ui:pattern \"@[a-z0-9A-Z_-]*(.[a-z0-9A-Z_-])*\".\n\n:MediumIdField\n a ui:SingleLineTextField ;\n ui:label \"Username\";\n ui:maxLength \"200\" ;\n ui:property foaf:accountName ; \n ui:pattern \"@[a-z0-9A-Z_-]*(.[a-z0-9A-Z_-])*\".\n\n:NostrIdField\n a ui:SingleLineTextField ;\n ui:label \"Username\";\n ui:maxLength \"200\" ;\n ui:property foaf:accountName ; \n ui:pattern \"[a-z0-9A-Z_-]*(.[a-z0-9A-Z_-])*\".\n\n:OrcidIdField\n a ui:SingleLineTextField ;\n ui:label \"Username\";\n ui:maxLength \"200\" ;\n ui:property foaf:accountName ; \n ui:pattern \"[a-z0-9A-Z_-]*\".\n\n:PinterestIdField\n a ui:SingleLineTextField ;\n ui:label \"Username\";\n ui:maxLength \"200\" ;\n ui:property foaf:accountName ; \n ui:pattern \"[a-z0-9A-Z_-]*\".\n\n:RedditIdField\n a ui:SingleLineTextField ;\n ui:label \"Username\";\n ui:maxLength \"200\" ;\n ui:property foaf:accountName ; \n ui:pattern \"[a-z0-9A-Z_-]*\".\n\n:StravaIdField\n a ui:SingleLineTextField ;\n ui:label \"Username\";\n ui:maxLength \"200\" ;\n ui:property foaf:accountName ; \n ui:pattern \"[a-z0-9A-Z_-]*\".\n\n:SnapchatIdField\n a ui:SingleLineTextField ;\n ui:label \"Username\";\n ui:maxLength \"200\" ;\n ui:property foaf:accountName ; \n ui:pattern \"@[a-z0-9A-Z_-]*\".\n\n:TiktokIdField\n a ui:SingleLineTextField ;\n ui:label \"Username\";\n ui:maxLength \"200\" ;\n ui:property foaf:accountName ; \n ui:pattern \"@[a-z0-9A-Z_-]*\".\n\n:TumblrIdField\n a ui:SingleLineTextField ;\n ui:label \"Username\";\n ui:maxLength \"200\" ;\n ui:property foaf:accountName ; \n ui:pattern \"@[a-z0-9A-Z_-]*\".\n\n:TwitterIdField\n a ui:SingleLineTextField ;\n ui:label \"Username\";\n ui:maxLength \"200\" ;\n ui:property foaf:accountName ; \n ui:pattern \"@[a-z0-9A-Z_-]*\".\n\n# an unknown online account needs more info\n\n:OtherIdForm a ui:Group; \n ui:weight 0; \n ui:parts ( \n :OtherIdField \n :OtherIconField \n :OtherLabelField ).\n\n:OtherIdField\n a ui:NamedNodeURIField ;\n ui:label \"Account link\";\n ui:maxLength \"200\" ;\n ui:property foaf:homepage.\n\n:OtherIconField\n a ui:NamedNodeURIField ;\n ui:label \"Icon link\";\n ui:maxLength \"200\" ;\n ui:property foaf:icon.\n\n:OtherLabelField\n a ui:SingleLineTextField ;\n ui:label \"Name\";\n ui:maxLength \"200\" ;\n ui:property rdfs:label.\n\n# ends\n";
|
|
11
|
+
const socialMediaForm = "@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.\n@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.\n@prefix foaf: <http://xmlns.com/foaf/0.1/>.\n@prefix owl: <http://www.w3.org/2002/07/owl#>.\n@prefix solid: <http://www.w3.org/ns/solid/terms#>.\n@prefix ui: <http://www.w3.org/ns/ui#>.\n@prefix schema: <http://schema.org/>.\n@prefix vcard: <http://www.w3.org/2006/vcard/ns#>.\n@prefix org: <http://www.w3.org/ns/org#>.\n@prefix : <#>.\n\n########### ATTENTION - we cannot rename this ontology file name without migrating existing data on existing accounts\n\n########### Social Media - other accounts\n#\n# Twitter, linked In, Orkid, Mastodon, Matrix, Bluesky, Instagram, Facebook, Github,\n# Snapchat, TikTok, etc\n\n:this\n <http://purl.org/dc/elements/1.1/title> \"Social media form\" ;\n a ui:Form ;\n ui:parts (\n :SocialsForm\n ).\n\n:SocialsForm a ui:Multiple;\n ui:label \"online account\";\n ui:property foaf:account; # the triple is created with the foaf:acccounts predicate\n ui:ordered true; # Allow user to order occounts most important first.\n ui:part :AccountsForm.\n\n:AccountsForm a ui:Group; \n ui:weight 1; \n ui:parts ( \n :AccountField \n :AccountIdField ).\n\n:AccountField a ui:Classifier; \n ui:label \"Account\"@en;\n ui:multiple false ; \n ui:category foaf:Account. # the accounts are described by the foaf:Account predicate\n\n# this is what is needed to make a dropdown box\nfoaf:Account a rdfs:Class;\n rdfs:label \"Online Account Provider\";\n owl:disjointUnionOf ( \n :BlueSkyAccount :DiggAccount :FacebookAccount :GithubAccount :InstagramAccount\n :LinkedInAccount :MastodonAccount :MatrixAccount :MediumAccount :NostrAccount \n :OrcidAccount :PinterestAccount :RedditAccount :SnapchatAccount :StravaAccount \n :TiktokAccount :TumblrAccount :TwitterAccount :OtherAccount) .\n\n:AccountIdField a ui:Options; \n ui:dependingOn rdf:type; \n ui:case\n [ ui:for :BlueSkyAccount; ui:use :BlueSkyIdField ],\n [ ui:for :DiggAccount; ui:use :DiggIdField],\n [ ui:for :FacebookAccount; ui:use :FacebookIdField ],\n [ ui:for :GithubAccount; ui:use :GithubIdField ],\n [ ui:for :InstagramAccount; ui:use :InstagramIdField ],\n [ ui:for :LinkedInAccount; ui:use :LinkedInIdField ],\n [ ui:for :MastodonAccount; ui:use :MastodonIdField ],\n [ ui:for :MatrixAccount; ui:use :MatrixIdField ],\n [ ui:for :MediumAccount; ui:use :MediumIdField ],\n [ ui:for :NostrAccount; ui:use :NostrIdField ],\n [ ui:for :OrcidAccount; ui:use :OrcidIdField ],\n [ ui:for :PinterestAccount; ui:use :PinterestIdField ],\n [ ui:for :RedditAccount; ui:use :RedditIdField ],\n [ ui:for :StravaAccount; ui:use :StravaIdField ],\n [ ui:for :SnapchatAccount; ui:use :SnapchatIdField ],\n [ ui:for :TiktokAccount; ui:use :TiktokIdField ],\n [ ui:for :TumblrAccount; ui:use :TumblrIdField ],\n [ ui:for :TwitterAccount; ui:use :TwitterIdField ],\n [ ui:for :OtherAccount; ui:use :OtherIdForm ] .\n\n:BlueSkyAccount rdfs:subClassOf foaf:Account ;\n rdfs:label \"Bluesky\";\n foaf:userProfilePrefix \"https://bsky.app/profile/\";\n foaf:icon <https://solidos.github.io/solid-ui/src/icons/social/bluesky-1.svg>;\n foaf:homepage <https://bsky.app/> .\n\n:DiggAccount rdfs:subClassOf foaf:Account ;\n rdfs:label \"Digg\";\n foaf:userProfilePrefix \"https://www.digg.com/\";\n foaf:icon <https://solidos.github.io/solid-ui/src/icons/social/digg-icon.svg>;\n foaf:homepage <https://www.digg.com/> .\n\n:FacebookAccount rdfs:subClassOf foaf:Account ;\n rdfs:label \"Facebook\";\n foaf:userProfilePrefix \"https://www.facebook.com/\";\n foaf:icon <https://solidos.github.io/solid-ui/src/icons/social/facebook-2020-2-1.svg>;\n foaf:homepage <https://www.facebook.com/> .\n\n:GithubAccount rdfs:subClassOf foaf:Account ;\n rdfs:label \"Github\";\n foaf:userProfilePrefix \"https://www.github.com/\";\n foaf:icon <https://solidos.github.io/solid-ui/src/icons/social/github-icon.svg>;\n foaf:homepage <https://github.com/> .\n\n:InstagramAccount rdfs:subClassOf foaf:Account ;\n rdfs:label \"Instagram\";\n foaf:userProfilePrefix \"https://www.instagram.com/\";\n foaf:icon <https://solidos.github.io/solid-ui/src/icons/social/instagram-2016-5.svg>;\n foaf:homepage <https://www.instagram.com/> .\n\n:LinkedInAccount rdfs:subClassOf foaf:Account ;\n rdfs:label \"LinkedIn\";\n foaf:userProfilePrefix \"https://www.linkedin.com/in/\";\n foaf:icon <https://solidos.github.io/solid-ui/src/icons/social/linkedin-icon.svg>;\n foaf:homepage <https://linkedin.com/> .\n\n:MastodonAccount rdfs:subClassOf foaf:Account ;\n rdfs:label \"Mastodon\" ;\n foaf:userProfilePrefix \"https://mastodon.social/\";\n foaf:icon <https://solidos.github.io/solid-ui/src/icons/social/mastodon-2.svg>;\n foaf:homepage <https://joinmastodon.org/> .\n\n:MatrixAccount rdfs:subClassOf foaf:Account ;\n rdfs:label \"Matrix\" ;\n foaf:icon <https://solidos.github.io/solid-ui/src/icons/social/matrix-logo-black.svg> ;\n foaf:userProfilePrefix \"https://matrix.to/#/\" ;\n foaf:homepage <https://matrix.org/> .\n\n:MediumAccount rdfs:subClassOf foaf:Account ;\n rdfs:label \"Medium\";\n foaf:userProfilePrefix \"https://medium.com/\";\n foaf:icon <https://solidos.github.io/solid-ui/src/icons/social/medium-logo-wordmark-black.svg>;\n foaf:homepage <https://medium.com/> .\n\n:NostrAccount rdfs:subClassOf foaf:Account ;\n rdfs:label \"Nostr\";\n foaf:userProfilePrefix \"https://primal.net/p/\";\n foaf:icon <https://solidos.github.io/solid-ui/src/icons/social/nostr-icon-purple-on-white.svg>;\n foaf:homepage <https://nostr.net/> .\n\n:OrcidAccount rdfs:subClassOf foaf:Account ;\n rdfs:label \"ORCiD\";\n foaf:userProfilePrefix \"https://orcid.org/\";\n foaf:icon <https://solidos.github.io/solid-ui/src/icons/social/ORCID-1.svg>;\n foaf:homepage <https://orcid.org/> .\n\n:PinterestAccount rdfs:subClassOf foaf:Account ;\n rdfs:label \"Pinterest\";\n foaf:userProfilePrefix \"https://pin.it/\";\n foaf:icon <https://solidos.github.io/solid-ui/src/icons/social/pinterest-2-1.svg>;\n foaf:homepage <https://pinterest.com/> .\n\n:RedditAccount rdfs:subClassOf foaf:Account ;\n rdfs:label \"Reddit\";\n foaf:userProfilePrefix \"https://www.reddit.com/user/\";\n foaf:icon <https://solidos.github.io/solid-ui/src/icons/social/reddit-4.svg>;\n foaf:homepage <https://reddit.com/> .\n\n:SnapchatAccount rdfs:subClassOf foaf:Account ;\n rdfs:label \"Snapchat\";\n foaf:userProfilePrefix \"https://www.snapchat.com/add/\";\n foaf:icon <https://solidos.github.io/solid-ui/src/icons/social/snapchat-1.svg>;\n foaf:homepage <https://www.snapchat.com/> .\n\n:StravaAccount rdfs:subClassOf foaf:Account ;\n rdfs:label \"Strava\";\n foaf:userProfilePrefix \"https://www.strava.com/athletes/\";\n foaf:icon <https://solidos.github.io/solid-ui/src/icons/social/strava-2.svg>;\n foaf:homepage <https://strava.com/> .\n\n:TiktokAccount rdfs:subClassOf foaf:Account ;\n rdfs:label \"TikTok\";\n foaf:userProfilePrefix \"https://www.tiktok.com/@\";\n foaf:icon <https://solidos.github.io/solid-ui/src/icons/social/tiktok-icon-2.svg>;\n foaf:homepage <https://www.tiktok.com/> .\n\n:TumblrAccount rdfs:subClassOf foaf:Account ;\n rdfs:label \"Tumblr\";\n foaf:userProfilePrefix \"https://www.tumblr.com/\";\n foaf:icon <https://solidos.github.io/solid-ui/src/icons/social/tumblr-icon.svg>;\n foaf:homepage <https://www.tumblr.com/> .\n\n:TwitterAccount rdfs:subClassOf foaf:Account ;\n rdfs:label \"X\";\n foaf:userProfilePrefix \"https://x.com/\";\n foaf:icon <https://solidos.github.io/solid-ui/src/icons/social/x-2.svg>;\n foaf:homepage <https://x.com/> .\n\n:OtherAccount rdfs:subClassOf foaf:Account ;\n rdfs:label \"Other\" ;\n foaf:icon <https://solidos.github.io/solid-ui/src/icons/noun_1689339.svg> .\n\n:BlueSkyIdField\n a ui:SingleLineTextField ;\n ui:label \"Username\";\n ui:maxLength \"200\" ;\n ui:property foaf:accountName ; \n ui:pattern \"@[a-z0-9A-Z_-](.[a-z0-9A-Z_-])*\".\n\n:DiggIdField\n a ui:SingleLineTextField ;\n ui:label \"Username\";\n ui:maxLength \"200\" ;\n ui:property foaf:accountName ; \n ui:pattern \"@[a-z0-9A-Z_-](.[a-z0-9A-Z_-])*\".\n\n:FacebookIdField\n a ui:SingleLineTextField ;\n ui:label \"Username\";\n ui:property foaf:accountName ; \n ui:pattern \"[a-z0-9A-Z_-]*\".\n\n:GithubIdField\n a ui:SingleLineTextField ;\n ui:label \"Username\";\n ui:maxLength \"200\" ;\n ui:property foaf:accountName ; \n ui:pattern \"[a-z0-9A-Z_-]*\".\n\n:InstagramIdField\n a ui:SingleLineTextField ;\n ui:label \"Username\";\n ui:maxLength \"200\" ;\n ui:property foaf:accountName ; \n ui:pattern \"[a-z0-9A-Z_-]*\".\n\n:LinkedInIdField\n a ui:SingleLineTextField ;\n ui:label \"Username\";\n ui:maxLength \"200\" ;\n ui:property foaf:accountName ; \n ui:pattern \"[a-z0-9A-Z_-]*(.[a-z0-9A-Z_-])*\".\n\n:MastodonIdField\n a ui:SingleLineTextField ;\n ui:label \"Username\";\n ui:maxLength \"200\" ;\n ui:property foaf:accountName ; \n ui:pattern \"@[a-z0-9A-Z_-]*(.[a-z0-9A-Z_-])*\".\n\n:MatrixIdField\n a ui:SingleLineTextField ;\n ui:label \"Username\";\n ui:maxLength \"200\" ;\n ui:property foaf:accountName ; \n ui:pattern \"@[a-z0-9A-Z_-]*(.[a-z0-9A-Z_-])*\".\n\n:MediumIdField\n a ui:SingleLineTextField ;\n ui:label \"Username\";\n ui:maxLength \"200\" ;\n ui:property foaf:accountName ; \n ui:pattern \"@[a-z0-9A-Z_-]*(.[a-z0-9A-Z_-])*\".\n\n:NostrIdField\n a ui:SingleLineTextField ;\n ui:label \"Username\";\n ui:maxLength \"200\" ;\n ui:property foaf:accountName ; \n ui:pattern \"[a-z0-9A-Z_-]*(.[a-z0-9A-Z_-])*\".\n\n:OrcidIdField\n a ui:SingleLineTextField ;\n ui:label \"Username\";\n ui:maxLength \"200\" ;\n ui:property foaf:accountName ; \n ui:pattern \"[a-z0-9A-Z_-]*\".\n\n:PinterestIdField\n a ui:SingleLineTextField ;\n ui:label \"Username\";\n ui:maxLength \"200\" ;\n ui:property foaf:accountName ; \n ui:pattern \"[a-z0-9A-Z_-]*\".\n\n:RedditIdField\n a ui:SingleLineTextField ;\n ui:label \"Username\";\n ui:maxLength \"200\" ;\n ui:property foaf:accountName ; \n ui:pattern \"[a-z0-9A-Z_-]*\".\n\n:StravaIdField\n a ui:SingleLineTextField ;\n ui:label \"Username\";\n ui:maxLength \"200\" ;\n ui:property foaf:accountName ; \n ui:pattern \"[a-z0-9A-Z_-]*\".\n\n:SnapchatIdField\n a ui:SingleLineTextField ;\n ui:label \"Username\";\n ui:maxLength \"200\" ;\n ui:property foaf:accountName ; \n ui:pattern \"@[a-z0-9A-Z_-]*\".\n\n:TiktokIdField\n a ui:SingleLineTextField ;\n ui:label \"Username\";\n ui:maxLength \"200\" ;\n ui:property foaf:accountName ; \n ui:pattern \"@[a-z0-9A-Z_-]*\".\n\n:TumblrIdField\n a ui:SingleLineTextField ;\n ui:label \"Username\";\n ui:maxLength \"200\" ;\n ui:property foaf:accountName ; \n ui:pattern \"@[a-z0-9A-Z_-]*\".\n\n:TwitterIdField\n a ui:SingleLineTextField ;\n ui:label \"Username\";\n ui:maxLength \"200\" ;\n ui:property foaf:accountName ; \n ui:pattern \"@[a-z0-9A-Z_-]*\".\n\n# an unknown online account needs more info\n\n:OtherIdForm a ui:Group; \n ui:weight 0; \n ui:parts ( \n :OtherIdField \n :OtherIconField \n :OtherLabelField ).\n\n:OtherIdField\n a ui:NamedNodeURIField ;\n ui:label \"Account link\";\n ui:maxLength \"200\" ;\n ui:property foaf:homepage.\n\n:OtherIconField\n a ui:NamedNodeURIField ;\n ui:label \"Icon link\";\n ui:maxLength \"200\" ;\n ui:property foaf:icon.\n\n:OtherLabelField\n a ui:SingleLineTextField ;\n ui:label \"Name\";\n ui:maxLength \"200\" ;\n ui:property rdfs:label.\n\n# ends\n";
|
|
12
12
|
const socialMediaFormName = 'socialMedia.ttl'; // The name of the form file
|
|
13
13
|
|
|
14
14
|
function EditSocialSection(context, me, editableProfile, store) {
|
|
@@ -24,12 +24,7 @@ function EditSocialSection(context, me, editableProfile, store) {
|
|
|
24
24
|
heading.textContent = _texts.socialAccountsHeadingText;
|
|
25
25
|
header.appendChild(heading);
|
|
26
26
|
section.appendChild(header);
|
|
27
|
-
if (editableProfile) {
|
|
28
|
-
const comment2 = context.dom.createElement('p');
|
|
29
|
-
comment2.classList.add('p-md');
|
|
30
|
-
comment2.textContent = 'Add links to your social media accounts here. These will be publicly visible on your profile.';
|
|
31
|
-
section.appendChild(comment2);
|
|
32
|
-
} else {
|
|
27
|
+
if (!editableProfile) {
|
|
33
28
|
const comment1 = context.dom.createElement('p');
|
|
34
29
|
comment1.classList.add('p-md');
|
|
35
30
|
comment1.textContent = 'Login to add social media accounts to your profile.';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { NamedNode } from 'rdflib';
|
|
2
|
+
export declare function refresh(dom: Document, attachmentTable: HTMLTableElement, me: NamedNode, editableProfile: NamedNode | null, predicate: NamedNode): void;
|
|
3
|
+
export declare function isAWebID(subject: NamedNode): boolean;
|
|
4
|
+
//# sourceMappingURL=editProfilePresenter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editProfilePresenter.d.ts","sourceRoot":"","sources":["../../src/editProfilePane/editProfilePresenter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAO,MAAM,QAAQ,CAAA;AAMvC,wBAAgB,OAAO,CAAC,GAAG,EAAE,QAAQ,EAAE,eAAe,EAAE,gBAAgB,EAAE,EAAE,EAAE,SAAS,EAAE,eAAe,EAAE,SAAS,GAAG,IAAI,EAAE,SAAS,EAAE,SAAS,QAmB/I;AAiFD,wBAAgB,QAAQ,CAAC,OAAO,EAAE,SAAS,GAAG,OAAO,CAMpD"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.isAWebID = isAWebID;
|
|
7
|
+
exports.refresh = refresh;
|
|
8
|
+
var _rdflib = require("rdflib");
|
|
9
|
+
var _solidLogic = require("solid-logic");
|
|
10
|
+
var _solidUi = require("solid-ui");
|
|
11
|
+
const DEFAULT_ICON_URI = _solidUi.icons.iconBase + 'noun_10636_grey.svg'; // grey disc
|
|
12
|
+
|
|
13
|
+
function refresh(dom, attachmentTable, me, editableProfile, predicate) {
|
|
14
|
+
// Keep the RDF terms so downstream Solid-UI helpers (e.g. findImage) can call term.sameTerm().
|
|
15
|
+
// We still sort by string value so the list order is stable.
|
|
16
|
+
const friendsList = _solidLogic.store.each(me, predicate);
|
|
17
|
+
// Ensure profiles are loaded before we render rows, otherwise widgets.findImage / utils.label may return empty.
|
|
18
|
+
void (async () => {
|
|
19
|
+
if (_solidLogic.store.fetcher) {
|
|
20
|
+
await Promise.all(friendsList.map(friend => {
|
|
21
|
+
if (!_solidLogic.store.holds(friend, null, null, null)) {
|
|
22
|
+
return _solidLogic.store.fetcher?.load(friend.value).catch(() => undefined);
|
|
23
|
+
}
|
|
24
|
+
return Promise.resolve();
|
|
25
|
+
}));
|
|
26
|
+
}
|
|
27
|
+
friendsList.sort((a, b) => a.value > b.value ? 1 : a.value < b.value ? -1 : 0);
|
|
28
|
+
_solidUi.utils.syncTableToArray(attachmentTable, friendsList, target => createNewRow(dom, attachmentTable, target, me, editableProfile, predicate));
|
|
29
|
+
})();
|
|
30
|
+
}
|
|
31
|
+
function createNewRow(dom, attachmentTable, target, me, editableProfile, predicate) {
|
|
32
|
+
const theTarget = target;
|
|
33
|
+
const profileImg = dom.createElement('img');
|
|
34
|
+
profileImg.src = getProfileImg((0, _rdflib.sym)(target), profileImg);
|
|
35
|
+
profileImg.alt = `Image of ${_solidUi.utils.label((0, _rdflib.sym)(target))}`;
|
|
36
|
+
const opt = {
|
|
37
|
+
image: profileImg,
|
|
38
|
+
title: _solidUi.utils.label((0, _rdflib.sym)(target)),
|
|
39
|
+
link: true
|
|
40
|
+
};
|
|
41
|
+
if (!!editableProfile) {
|
|
42
|
+
opt.deleteFunction = function () {
|
|
43
|
+
deleteAttachment(dom, attachmentTable, me, editableProfile, theTarget, predicate);
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
return _solidUi.widgets.renderAsRow(dom, predicate, target, opt);
|
|
47
|
+
}
|
|
48
|
+
function getProfileImg(subject, profileImg) {
|
|
49
|
+
const img = _solidUi.widgets.findImage(subject);
|
|
50
|
+
if (img) {
|
|
51
|
+
profileImg.classList.add('profile-image');
|
|
52
|
+
return img;
|
|
53
|
+
}
|
|
54
|
+
profileImg.classList.add('default-profile-image');
|
|
55
|
+
return DEFAULT_ICON_URI;
|
|
56
|
+
}
|
|
57
|
+
async function deleteAttachment(dom, attachmentTable, me, editableProfile, target, predicate) {
|
|
58
|
+
if (!_solidLogic.store.updater) {
|
|
59
|
+
throw new Error('Store has no updater.');
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// Delete the exact statements in the store so we don't rely on doc() matching
|
|
63
|
+
const statementsToDelete = _solidLogic.store.statementsMatching(me, predicate, target, null);
|
|
64
|
+
if (!statementsToDelete.length) {
|
|
65
|
+
console.warn('No matching statement found to delete for', target.value);
|
|
66
|
+
refresh(dom, attachmentTable, me, editableProfile, predicate);
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
try {
|
|
70
|
+
await _solidLogic.store.updater.update(statementsToDelete, []);
|
|
71
|
+
|
|
72
|
+
// UpdateManager may mutate store asynchronously, so only remove locally if it still exists
|
|
73
|
+
if (typeof _solidLogic.store.removeStatements === 'function') {
|
|
74
|
+
const stillThere = _solidLogic.store.holds(me, predicate, target, null);
|
|
75
|
+
if (stillThere) {
|
|
76
|
+
try {
|
|
77
|
+
_solidLogic.store.removeStatements(statementsToDelete);
|
|
78
|
+
} catch (e) {
|
|
79
|
+
// Ignore if already gone
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// Ensure store is up-to-date before re-rendering
|
|
85
|
+
if (_solidLogic.store.fetcher) await _solidLogic.store.fetcher.load(me.doc());
|
|
86
|
+
refresh(dom, attachmentTable, me, editableProfile, predicate);
|
|
87
|
+
} catch (error) {
|
|
88
|
+
console.error('Error deleting:', error);
|
|
89
|
+
|
|
90
|
+
// If update failed, try to keep UI in sync anyway
|
|
91
|
+
if (typeof _solidLogic.store.removeStatements === 'function') {
|
|
92
|
+
try {
|
|
93
|
+
_solidLogic.store.removeStatements(statementsToDelete);
|
|
94
|
+
} catch (e) {
|
|
95
|
+
/* ignore */
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
if (_solidLogic.store.fetcher) await _solidLogic.store.fetcher.load(me.doc());
|
|
99
|
+
refresh(dom, attachmentTable, me, editableProfile, predicate);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
function isAWebID(subject) {
|
|
103
|
+
if (subject && subject.doc) {
|
|
104
|
+
const t = _solidLogic.store.findTypeURIs(subject.doc());
|
|
105
|
+
return !!t[_solidUi.ns.foaf('PersonalProfileDocument').uri];
|
|
106
|
+
}
|
|
107
|
+
return false;
|
|
108
|
+
}
|