profile-pane 2.0.0 → 3.0.0-024af9a2
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/CVCard.d.ts +2 -3
- package/lib/CVCard.d.ts.map +1 -1
- package/lib/CVCard.js +84 -69
- package/lib/ChatWithMe.d.ts +1 -0
- package/lib/ChatWithMe.d.ts.map +1 -1
- package/lib/ChatWithMe.js +56 -9
- package/lib/FriendList.d.ts +3 -2
- package/lib/FriendList.d.ts.map +1 -1
- package/lib/FriendList.js +37 -28
- package/lib/ProfileCard.d.ts +4 -2
- package/lib/ProfileCard.d.ts.map +1 -1
- package/lib/ProfileCard.js +44 -25
- package/lib/ProfileView.d.ts +1 -0
- package/lib/ProfileView.d.ts.map +1 -1
- package/lib/ProfileView.js +117 -38
- package/lib/QRCodeCard.d.ts +2 -2
- package/lib/QRCodeCard.d.ts.map +1 -1
- package/lib/QRCodeCard.js +89 -36
- package/lib/SocialCard.d.ts +2 -2
- package/lib/SocialCard.d.ts.map +1 -1
- package/lib/SocialCard.js +38 -51
- package/lib/SocialPresenter.js +4 -3
- package/lib/StuffCard.d.ts +4 -0
- package/lib/StuffCard.d.ts.map +1 -1
- package/lib/StuffCard.js +27 -38
- package/lib/StuffPresenter.d.ts.map +1 -1
- package/lib/addMeToYourFriends.d.ts +2 -2
- package/lib/addMeToYourFriends.d.ts.map +1 -1
- package/lib/addMeToYourFriends.js +23 -23
- package/lib/{addMeToYourFriendsHelper.d.ts → buttonsHelper.d.ts} +4 -2
- package/lib/buttonsHelper.d.ts.map +1 -0
- package/lib/buttonsHelper.js +44 -0
- package/lib/editProfilePane/editProfile.view.js +2 -2
- package/lib/index.d.ts +9 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +11 -2
- package/lib/profile-pane.js +5925 -0
- package/lib/profile-pane.js.map +1 -0
- package/lib/profile-pane.min.js +300 -0
- package/lib/profile-pane.min.js.map +1 -0
- package/lib/styles/CVCard.css +37 -0
- package/lib/styles/ChatWithMe.css +6 -0
- package/lib/styles/FriendList.css +12 -0
- package/lib/styles/ProfileCard.css +92 -0
- package/lib/styles/ProfileView.css +22 -0
- package/lib/styles/QRCodeCard.css +24 -0
- package/lib/styles/SocialCard.css +61 -0
- package/lib/styles/StuffCard.css +23 -0
- package/lib/styles/utilities.css +312 -0
- package/lib/texts.d.ts +5 -3
- package/lib/texts.d.ts.map +1 -1
- package/lib/texts.js +7 -4
- package/package.json +40 -30
- package/lib/0SAVED-CVCard.d.ts +0 -5
- package/lib/0SAVED-CVCard.d.ts.map +0 -1
- package/lib/0SAVED-CVCard.js +0 -90
- package/lib/addMeToYourFriendsHelper.d.ts.map +0 -1
- package/lib/addMeToYourFriendsHelper.js +0 -26
- package/lib/baseStyles.d.ts +0 -71
- package/lib/baseStyles.d.ts.map +0 -1
- package/lib/baseStyles.js +0 -92
package/lib/ProfileView.js
CHANGED
|
@@ -5,8 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.ProfileView = ProfileView;
|
|
7
7
|
var _litHtml = require("lit-html");
|
|
8
|
-
|
|
9
|
-
var _baseStyles = require("./baseStyles");
|
|
8
|
+
require("./styles/ProfileView.css");
|
|
10
9
|
var _ChatWithMe = require("./ChatWithMe");
|
|
11
10
|
var _FriendList = require("./FriendList");
|
|
12
11
|
var _presenter = require("./presenter");
|
|
@@ -17,11 +16,6 @@ var _ProfileCard = require("./ProfileCard");
|
|
|
17
16
|
var _CVCard = require("./CVCard");
|
|
18
17
|
var _SocialCard = require("./SocialCard");
|
|
19
18
|
var _StuffCard = require("./StuffCard");
|
|
20
|
-
var _QRCodeCard = require("./QRCodeCard");
|
|
21
|
-
var _addMeToYourFriends = require("./addMeToYourFriends");
|
|
22
|
-
/* Profile View
|
|
23
|
-
*/
|
|
24
|
-
|
|
25
19
|
// 20210527
|
|
26
20
|
// 20210527
|
|
27
21
|
// 20210527
|
|
@@ -39,42 +33,127 @@ function renderEditButton (subject) {
|
|
|
39
33
|
*/
|
|
40
34
|
|
|
41
35
|
async function ProfileView(subject, context) {
|
|
42
|
-
const profileBasics = (0, _presenter.presentProfile)(subject, context.session.store);
|
|
36
|
+
const profileBasics = (0, _presenter.presentProfile)(subject, context.session.store);
|
|
43
37
|
const rolesByType = (0, _CVPresenter.presentCV)(subject, context.session.store);
|
|
44
38
|
const accounts = (0, _SocialPresenter.presentSocial)(subject, context.session.store);
|
|
45
39
|
const stuffData = await (0, _StuffPresenter.presentStuff)(subject);
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
40
|
+
return (0, _litHtml.html)`
|
|
41
|
+
<main
|
|
42
|
+
id="main-content"
|
|
43
|
+
class="profile-grid"
|
|
44
|
+
style="--profile-grid-bg: radial-gradient(circle, ${profileBasics.backgroundColor} 80%, ${profileBasics.highlightColor} 100%)"
|
|
45
|
+
role="main"
|
|
46
|
+
aria-label="Profile for ${profileBasics.name}"
|
|
47
|
+
tabindex="-1"
|
|
48
|
+
>
|
|
49
|
+
<!-- Enhanced breadcrumb navigation -->
|
|
50
|
+
<nav id="profile-nav" aria-label="Profile sections" class="visually-hidden">
|
|
51
|
+
<ol>
|
|
52
|
+
<li><a href="#profile-card-heading">Personal Information</a></li>
|
|
53
|
+
${(() => {
|
|
54
|
+
const cv = (0, _CVCard.CVCard)(rolesByType);
|
|
55
|
+
return cv && cv.strings && cv.strings.join('').trim() !== '' ? (0, _litHtml.html)`<li><a href="#cv-heading">Professional Experience</a></li>` : '';
|
|
56
|
+
})()}
|
|
57
|
+
${accounts.accounts && accounts.accounts.length > 0 ? (0, _litHtml.html)`<li><a href="#social-heading" id="social-accounts">Social Accounts</a></li>` : ''}
|
|
58
|
+
<li><a href="#chat-heading" id="contact-section">Contact</a></li>
|
|
59
|
+
</ol>
|
|
60
|
+
</nav>
|
|
61
|
+
|
|
62
|
+
<article
|
|
63
|
+
aria-labelledby="profile-card-heading"
|
|
64
|
+
class="profileSection section-bg"
|
|
65
|
+
role="region"
|
|
66
|
+
tabindex="-1"
|
|
67
|
+
>
|
|
68
|
+
<header class="text-center mb-md">
|
|
69
|
+
<h2 id="profile-card-heading" tabindex="-1">${profileBasics.name}</h2>
|
|
70
|
+
</header>
|
|
71
|
+
${(0, _ProfileCard.ProfileCard)(profileBasics, context, subject)}
|
|
72
|
+
</article>
|
|
73
|
+
|
|
74
|
+
${(() => {
|
|
75
|
+
const cv = (0, _CVCard.CVCard)(rolesByType);
|
|
76
|
+
return cv && cv.strings && cv.strings.join('').trim() !== '' ? (0, _litHtml.html)`
|
|
77
|
+
<section
|
|
78
|
+
aria-labelledby="cv-heading"
|
|
79
|
+
class="profileSection section-bg"
|
|
80
|
+
role="region"
|
|
81
|
+
tabindex="-1"
|
|
82
|
+
>
|
|
83
|
+
<header class="text-center mb-md">
|
|
84
|
+
<h2 id="cv-heading" tabindex="-1">Professional & Education</h2>
|
|
85
|
+
</header>
|
|
86
|
+
<div>
|
|
87
|
+
${cv}
|
|
88
|
+
</div>
|
|
89
|
+
</section>
|
|
90
|
+
` : '';
|
|
91
|
+
})()}
|
|
92
|
+
|
|
93
|
+
${accounts.accounts && accounts.accounts.length > 0 ? (0, _litHtml.html)`
|
|
94
|
+
<aside
|
|
95
|
+
aria-labelledby="social-heading"
|
|
96
|
+
class="profileSection section-bg"
|
|
97
|
+
role="complementary"
|
|
98
|
+
tabindex="-1"
|
|
99
|
+
>
|
|
100
|
+
<header class="text-center mb-md">
|
|
101
|
+
<h2 id="social-heading" tabindex="-1">Social Accounts</h2>
|
|
102
|
+
</header>
|
|
103
|
+
<nav aria-label="Social media links">
|
|
104
|
+
${(0, _SocialCard.SocialCard)(accounts)}
|
|
105
|
+
</nav>
|
|
106
|
+
</aside>
|
|
107
|
+
` : ''}
|
|
108
|
+
|
|
109
|
+
${stuffData.stuff && stuffData.stuff.length > 0 ? (0, _litHtml.html)`
|
|
110
|
+
<section
|
|
111
|
+
aria-labelledby="stuff-heading"
|
|
112
|
+
class="profileSection section-bg"
|
|
113
|
+
role="region"
|
|
114
|
+
tabindex="-1"
|
|
115
|
+
>
|
|
116
|
+
<header class="text-center mb-md">
|
|
117
|
+
<h2 id="stuff-heading" tabindex="-1">Shared Items</h2>
|
|
118
|
+
</header>
|
|
119
|
+
<div>
|
|
120
|
+
${(0, _StuffCard.StuffCard)(profileBasics, context, subject, stuffData)}
|
|
121
|
+
</div>
|
|
122
|
+
</section>
|
|
123
|
+
` : ''}
|
|
58
124
|
|
|
59
|
-
|
|
125
|
+
${(() => {
|
|
126
|
+
const friends = (0, _FriendList.FriendList)(subject, context);
|
|
127
|
+
return friends ? (0, _litHtml.html)`
|
|
128
|
+
<aside
|
|
129
|
+
aria-labelledby="friends-heading"
|
|
130
|
+
class="profileSection section-bg"
|
|
131
|
+
role="complementary"
|
|
132
|
+
tabindex="-1"
|
|
133
|
+
>
|
|
134
|
+
<header class="text-center mb-md">
|
|
135
|
+
<h2 id="friends-heading" tabindex="-1">Friends</h2>
|
|
136
|
+
</header>
|
|
137
|
+
<div role="list" aria-label="Friend connections">
|
|
138
|
+
${friends}
|
|
139
|
+
</div>
|
|
140
|
+
</aside>
|
|
141
|
+
` : '';
|
|
142
|
+
})()}
|
|
60
143
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
144
|
+
<section
|
|
145
|
+
aria-labelledby="chat-heading"
|
|
146
|
+
class="profileSection section-bg"
|
|
147
|
+
role="region"
|
|
148
|
+
tabindex="-1"
|
|
149
|
+
>
|
|
150
|
+
<header class="text-center mb-md">
|
|
151
|
+
<h2 id="chat-heading" tabindex="-1">Contact</h2>
|
|
152
|
+
</header>
|
|
153
|
+
<div>
|
|
154
|
+
${(0, _ChatWithMe.ChatWithMe)(subject, context)}
|
|
67
155
|
</div>
|
|
68
|
-
</
|
|
69
|
-
|
|
70
|
-
${(0, _SocialCard.SocialCard)(profileBasics, accounts)}
|
|
71
|
-
${(0, _StuffCard.StuffCard)(profileBasics, context, subject, stuffData)}
|
|
72
|
-
${(0, _FriendList.FriendList)(profileBasics, subject, context)}
|
|
73
|
-
<div style="${styles.chat}">${(0, _ChatWithMe.ChatWithMe)(subject, context)}</div>
|
|
74
|
-
<div data-testid="qrcode-display" class="qrcode-display" style="${styles.card}">
|
|
75
|
-
${(0, _QRCodeCard.QRCodeCard)(profileBasics, subject)}
|
|
76
|
-
|
|
77
|
-
</div>
|
|
78
|
-
</div>
|
|
156
|
+
</section>
|
|
157
|
+
</main>
|
|
79
158
|
`;
|
|
80
159
|
}
|
package/lib/QRCodeCard.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TemplateResult } from 'lit-html';
|
|
2
2
|
import { NamedNode } from 'rdflib';
|
|
3
|
-
import
|
|
4
|
-
export declare const QRCodeCard: (
|
|
3
|
+
import './styles/QRCodeCard.css';
|
|
4
|
+
export declare const QRCodeCard: (highlightColor: string, backgroundColor: string, subject: NamedNode) => TemplateResult;
|
|
5
5
|
//# 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":"
|
|
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,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;AAElC,OAAO,yBAAyB,CAAA;AAuChC,eAAO,MAAM,UAAU,GACrB,gBAAgB,MAAM,EACtB,iBAAiB,MAAM,EACvB,SAAS,SAAS,KACjB,cA0EF,CAAA"}
|
package/lib/QRCodeCard.js
CHANGED
|
@@ -5,56 +5,109 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.QRCodeCard = void 0;
|
|
7
7
|
var _litHtml = require("lit-html");
|
|
8
|
-
var _baseStyles = require("./baseStyles");
|
|
9
|
-
var _styleMap = require("lit-html/directives/style-map.js");
|
|
10
8
|
var _solidUi = require("solid-ui");
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
9
|
+
require("./styles/QRCodeCard.css");
|
|
10
|
+
var _texts = require("./texts");
|
|
11
|
+
function hexToRgb(hex) {
|
|
12
|
+
// Remove leading # if present
|
|
13
|
+
hex = hex.replace(/^#/, '');
|
|
14
|
+
if (hex.length === 3) {
|
|
15
|
+
hex = hex.split('').map(x => x + x).join('');
|
|
16
|
+
}
|
|
17
|
+
if (hex.length !== 6) return null;
|
|
18
|
+
const num = parseInt(hex, 16);
|
|
19
|
+
return {
|
|
20
|
+
r: num >> 16 & 255,
|
|
21
|
+
g: num >> 8 & 255,
|
|
22
|
+
b: num & 255
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
function luminance({
|
|
26
|
+
r,
|
|
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);
|
|
31
33
|
});
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
return 0.2126 * a[0] + 0.7152 * a[1] + 0.0722 * a[2];
|
|
35
|
+
}
|
|
36
|
+
function contrastRatio(hex1, hex2) {
|
|
37
|
+
const rgb1 = hexToRgb(hex1);
|
|
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);
|
|
45
|
+
}
|
|
46
|
+
const QRCodeCard = (highlightColor, backgroundColor, subject) => {
|
|
47
|
+
const hC = highlightColor || '#000000';
|
|
48
|
+
const bC = backgroundColor || '#ffffff';
|
|
37
49
|
const name = _solidUi.utils.label(subject);
|
|
50
|
+
|
|
51
|
+
// Color contrast check
|
|
52
|
+
const ratio = contrastRatio(hC, bC);
|
|
53
|
+
if (ratio < 4.5) {
|
|
54
|
+
console.warn(`QRCodeCard: The contrast ratio between highlightColor (${hC}) and backgroundColor (${bC}) is ${ratio.toFixed(2)}, which is below the WCAG 2.1 recommended minimum of 4.5:1 for normal text.`);
|
|
55
|
+
}
|
|
38
56
|
const BEGIN = 'BEGIN:VCARD\r\n';
|
|
39
57
|
const END = 'END:VCARD\r\n';
|
|
40
58
|
const FN = 'FN:' + name + '\r\n';
|
|
41
59
|
const URL = 'URL:' + subject.uri + 'r\n';
|
|
42
60
|
const VERSIONV = 'VERSION:4.0\r\n';
|
|
43
61
|
|
|
44
|
-
//
|
|
45
|
-
//
|
|
46
|
-
|
|
62
|
+
// Accessibility check: Ensure QR code is rendered as an accessible image or canvas
|
|
63
|
+
// This assumes the QR code is rendered inside the <div> below by another library or script.
|
|
64
|
+
// If you use a library, ensure it sets role="img" and an appropriate aria-label or alt attribute.
|
|
65
|
+
// If not, warn the developer.
|
|
66
|
+
setTimeout(() => {
|
|
67
|
+
const container = document.querySelector('.QRCode [role="img"]');
|
|
68
|
+
if (container) {
|
|
69
|
+
const hasAriaLabel = container.hasAttribute('aria-label');
|
|
70
|
+
const hasAlt = container.hasAttribute('alt');
|
|
71
|
+
if (!hasAriaLabel && !hasAlt) {
|
|
72
|
+
console.warn('QRCodeCard: The QR code element should have an accessible label (aria-label or alt attribute) for screen readers.');
|
|
73
|
+
}
|
|
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
|
+
}
|
|
77
|
+
}, 0);
|
|
47
78
|
const vCard = BEGIN + FN + URL + END + VERSIONV;
|
|
48
79
|
|
|
49
80
|
// console.log(`@@ qrcodes colours highlightColor ${highlightColor}, backgroundColor ${backgroundColor}`)
|
|
50
81
|
|
|
51
82
|
return (0, _litHtml.html)`
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
83
|
+
<figure
|
|
84
|
+
class="QRCode"
|
|
85
|
+
data-value="${vCard}"
|
|
86
|
+
highlightColor="${hC}"
|
|
87
|
+
backgroundColor="${bC}"
|
|
88
|
+
data-testid="qrcode-card"
|
|
89
|
+
aria-labelledby="qr-code-caption"
|
|
90
|
+
role="img"
|
|
91
|
+
aria-describedby="qr-code-description"
|
|
92
|
+
>
|
|
93
|
+
<div
|
|
94
|
+
aria-label="Static QR code containing contact information for ${name}"
|
|
95
|
+
role="img"
|
|
96
|
+
tabindex="0"
|
|
97
|
+
></div>
|
|
98
|
+
<figcaption
|
|
99
|
+
id="qr-code-caption"
|
|
100
|
+
class="qrCaption"
|
|
101
|
+
>
|
|
102
|
+
${_texts.scanQrToConnectText}
|
|
103
|
+
</figcaption>
|
|
104
|
+
<div
|
|
105
|
+
id="qr-code-description"
|
|
106
|
+
class="sr-only"
|
|
107
|
+
>
|
|
108
|
+
This is a static QR code containing vCard information for ${name}, including profile URL ${subject.uri}. The QR code is not interactive.
|
|
109
|
+
</div>
|
|
110
|
+
</figure>
|
|
58
111
|
`;
|
|
59
112
|
};
|
|
60
113
|
exports.QRCodeCard = QRCodeCard;
|
package/lib/SocialCard.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TemplateResult } from 'lit-html';
|
|
2
|
-
import { ProfilePresentation } from './presenter';
|
|
3
2
|
import { SocialPresentation } from './SocialPresenter';
|
|
4
|
-
|
|
3
|
+
import './styles/SocialCard.css';
|
|
4
|
+
export declare const SocialCard: (SocialData: SocialPresentation) => TemplateResult;
|
|
5
5
|
//# sourceMappingURL=SocialCard.d.ts.map
|
package/lib/SocialCard.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SocialCard.d.ts","sourceRoot":"","sources":["../src/SocialCard.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,cAAc,EAAE,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"SocialCard.d.ts","sourceRoot":"","sources":["../src/SocialCard.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,cAAc,EAAE,MAAM,UAAU,CAAA;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AACtD,OAAO,yBAAyB,CAAA;AAGhC,eAAO,MAAM,UAAU,GACrB,YAAY,kBAAkB,KAC7B,cA+CF,CAAA"}
|
package/lib/SocialCard.js
CHANGED
|
@@ -5,61 +5,48 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.SocialCard = void 0;
|
|
7
7
|
var _litHtml = require("lit-html");
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const styles = {
|
|
11
|
-
image: (0, _styleMap.styleMap)((0, _baseStyles.fullWidth)()),
|
|
12
|
-
intro: (0, _styleMap.styleMap)({
|
|
13
|
-
...(0, _baseStyles.textGray)(),
|
|
14
|
-
...(0, _baseStyles.textCenter)()
|
|
15
|
-
}),
|
|
16
|
-
card: (0, _styleMap.styleMap)((0, _baseStyles.card)()),
|
|
17
|
-
info: (0, _styleMap.styleMap)({
|
|
18
|
-
...(0, _baseStyles.paddingSmall)(),
|
|
19
|
-
...(0, _baseStyles.textCenter)()
|
|
20
|
-
}),
|
|
21
|
-
tools: (0, _styleMap.styleMap)({
|
|
22
|
-
...(0, _baseStyles.paddingSmall)(),
|
|
23
|
-
...(0, _baseStyles.textRight)()
|
|
24
|
-
})
|
|
25
|
-
};
|
|
26
|
-
const SocialCard = (profileBasics, SocialData) => {
|
|
8
|
+
require("./styles/SocialCard.css");
|
|
9
|
+
const SocialCard = SocialData => {
|
|
27
10
|
const {
|
|
28
11
|
accounts
|
|
29
12
|
} = SocialData;
|
|
30
|
-
const nameStyle = (0, _styleMap.styleMap)({
|
|
31
|
-
...(0, _baseStyles.heading)(),
|
|
32
|
-
// "text-decoration": "underline",
|
|
33
|
-
color: profileBasics.highlightColor // was "text-decoration-color"
|
|
34
|
-
});
|
|
35
13
|
if (accounts.length) {
|
|
36
14
|
return (0, _litHtml.html)`
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
<
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
15
|
+
<section
|
|
16
|
+
class="socialCard"
|
|
17
|
+
aria-labelledby="social-card-title"
|
|
18
|
+
data-testid="social-media"
|
|
19
|
+
>
|
|
20
|
+
<nav aria-label="Social media profiles">
|
|
21
|
+
<ul class="socialList list-reset" role="list">
|
|
22
|
+
${accounts.map(account => renderAccount(account))}
|
|
23
|
+
</ul>
|
|
24
|
+
</nav>
|
|
25
|
+
</section>
|
|
26
|
+
`;
|
|
27
|
+
}
|
|
28
|
+
function renderAccount(account) {
|
|
29
|
+
return account.homepage && account.name && account.icon ? (0, _litHtml.html)`
|
|
30
|
+
<li class="socialItem" role="listitem">
|
|
31
|
+
<a
|
|
32
|
+
href="${account.homepage}"
|
|
33
|
+
target="_blank"
|
|
34
|
+
rel="noopener noreferrer"
|
|
35
|
+
aria-label="Visit ${account.name} profile (opens in new tab)"
|
|
36
|
+
style="display: flex; align-items: center; gap: 0.5em; text-decoration: none;"
|
|
37
|
+
>
|
|
38
|
+
<img
|
|
39
|
+
class="socialIcon"
|
|
40
|
+
src="${account.icon}"
|
|
41
|
+
alt="${account.name} icon"
|
|
42
|
+
width="40"
|
|
43
|
+
height="40"
|
|
44
|
+
loading="lazy"
|
|
45
|
+
/>
|
|
46
|
+
<span class="text-wrap-anywhere">${account.name}</span>
|
|
47
|
+
</a>
|
|
48
|
+
</li>
|
|
49
|
+
` : (0, _litHtml.html)``;
|
|
47
50
|
}
|
|
48
|
-
return (0, _litHtml.html)``;
|
|
49
51
|
};
|
|
50
|
-
exports.SocialCard = SocialCard;
|
|
51
|
-
function renderAccount(account) {
|
|
52
|
-
return account.homepage && account.name && account.icon ? (0, _litHtml.html)`<div class="textButton-0-1-3" style="margin-top: 0.3em; margin-bottom: 0.3em;">
|
|
53
|
-
|
|
54
|
-
<a href="${account.homepage}" style="text-decoration: none;" target="social">
|
|
55
|
-
<img style="width: 2em; height: 2em; margin: 1em; vertical-align:middle;" src="${account.icon}" alt="${account.name}">
|
|
56
|
-
|
|
57
|
-
<span style="font-size: 1.2rem;">${account.name}</span>
|
|
58
|
-
</a>
|
|
59
|
-
</div> ` : (0, _litHtml.html)``;
|
|
60
|
-
}
|
|
61
|
-
function renderAccounts(accounts) {
|
|
62
|
-
if (accounts.length > 0) return (0, _litHtml.html)`${renderAccount(accounts[0])}${accounts.length > 1 ? renderAccounts(accounts.slice(1)) : (0, _litHtml.html)``}`;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
// ends
|
|
52
|
+
exports.SocialCard = SocialCard;
|
package/lib/SocialPresenter.js
CHANGED
|
@@ -8,7 +8,7 @@ exports.presentSocial = presentSocial;
|
|
|
8
8
|
var _rdflib = require("rdflib");
|
|
9
9
|
var _solidUi = require("solid-ui");
|
|
10
10
|
/* babel-plugin-inline-import './ontology/profileForm.ttl' */
|
|
11
|
-
const profileForm = "@prefix os: <http://www.w3.org/2000/10/swap/os#> .\n@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\n@prefix org: <http://www.w3.org/ns/org#>.\n@prefix esco: <http://data.europa.eu/esco/model#>.\n@prefix wd: <http://www.wikidata.org/entity/>.\n@prefix wdt: <http://www.wikidata.org/prop/direct/>.\n\n@prefix : <https://solidos.github.io/profile-pane/src/ontology/profileForm.ttl#>.\n@prefix soc: <https://solidos.github.io/profile-pane/src/ontology/socialMedia.ttl#>.\n\n# was: https://solidos.github.io/solid-panes/dashboard/profileStyle.ttl#this\n# moved to: https://solidos.github.io/profile-pane/src/ontology/profileForm.ttl#this\n\n\n\n\n# About forms: https://solidos.github.io/solid-ui/Documentation/forms-intro.html\n# About personal public data: https://www.w3.org/DesignIssues/PersonalPublic.html\n#\n\n:this\n <http://purl.org/dc/elements/1.1/title> \"Profile form\" ;\n a ui:Form ;\n # ui:part :backgroundColor, :highlightColor;\n ui:parts (\n :styleGroup\n :nicknameField\n :pronounsForm\n :LanguagesPrompt :LanguagesForm\n :SocialsPrompt :SocialsForm\n :CVGroup\n :SkillsPrompt :SkillsForm\n ).\n\n:styleGroup a ui:Group; ui:weight 0; ui:parts ( :styleHeading :backgroundColor :highlightColor ).\n :styleHeading a ui:Heading; ui:contents \"The style of your public profile.\".\n :backgroundColor a ui:ColorField; ui:property solid:profileBackgroundColor;\n ui:label \"Background color\"; ui:default \"#ffffff\".\n :highlightColor a ui:ColorField; ui:property solid:profileHighlightColor;\n ui:label \"Highlight color\"; ui:default \"#000000\".\n\n# Nickname\n\n:nicknameField a ui:SingleLineTextField; ui:size 12; ui:property foaf:nick;\n ui:label \"Short name for chats, etc.\"@en, \"nom court\"@fr.\n\n # Pronouns\n\n :pronounsForm a ui:Group; ui:weight 0; ui:parts ( :pronounsPrompt :subjectPronounForm :objectPronounForm :relativePronounForm) .\n\n :pronounsPrompt a ui:Comment; ui:contents \"What are your pronouns?\" .\n\n :subjectPronounForm a ui:SingleLineTextField; ui:property solid:preferredSubjectPronoun;\n ui:size 10; ui:label \"he/she/they...\" .\n :objectPronounForm a ui:SingleLineTextField; ui:property solid:preferredObjectPronoun;\n ui:size 10; ui:label \"him/her/them...\" .\n :relativePronounForm a ui:SingleLineTextField; ui:property solid:preferredRelativePronoun;\n ui:size 10; ui:label \"his/hers/theirs...\" .\n\n # Curriculum Vitae: membership of organizations\n\n :CVHeading a ui:Heading; ui:contents \"Public Curriculum Vitae\".\n :CVPrompt a ui:Comment; ui:contents \"What organizations have you been involved with?\" .\n\n :CVGroup a ui:Group; ui:weight 1; ui:parts ( :CVHeading :CVPrompt :involvementWithOrganizationsForm ).\n\n\n solid:Role a rdfs:Class; owl:oneOf ( solid:CurrentRole solid:FormerRole solid:FutureRole ). # Future Role too?\n\n org:member owl:inverse [ ui:label \"involvement with company, org etc\" ]. # timelimited involvement\n\n :involvementWithOrganizationsForm a ui:Multiple;\n ui:label \"Involvement with Organization\";\n ui:property org:member; ui:reverse true; # link back from role to member\n ui:ordered false; # Allow user to order CV secions rather than force date order? No.\n ui:part :RoleMembershipForm.\n\n# This is a big important form for one of a series of roles in the list.\n\n :RoleMembershipForm a ui:Group; ui:weight 3; ui:parts ( :MembershipFormHeading :roleNameField\n :escoOccupationField :orgField :RoleClassifier :RoleDatesForm :RoleDescriptionForm).\n\n :MembershipFormHeading a ui:Heading; ui:contents \"Details of this role\"@en, \"D\xE9tailes de ce r\xF4le\"@fr .\n\n :orgField a ui:Choice; ui:label \"Organization\"@en, \"Organization\"@fr;\n ui:canMintNew true; ui:use :OrganizationCreationForm ;\n ui:property org:organization;\n ui:from vcard:Organization .\n :roleNameField a ui:SingleLineTextField; ui:property vcard:role; ui:size 60 .\n\n :escoOccupationField a ui:AutocompleteField;\n ui:label \"occupation\"; ui:size 60;\n ui:property org:role;\n ui:dataSource :ESCO_Occupation_DataSource;\n ui:targetClass schema:Occupation .\n\n :ESCO_Occupation_DataSource a ui:DataSource;\n schema:name \"ESCO\";\n ui:targetClass schema:Occupation ;\n schema:logo <https://ec.europa.eu/esco/portal/static_resource2/images/logo/logo_en.gif>;\n ui:searchByNameURI \"https://ec.europa.eu/esco/api/search?language=$(language)&type=occupation&text=$(name)\".\n\n :instituteIdentityField a ui:AutocompleteField; ui:label \"in wikidata\";\n ui:size 60;\n ui:property solid:publicId; ui:dataSource :WikidataOnOrganizations.\n\n :WikidataOnOrganizations a ui:DataSource ;\n schema:name \"Wikidata\";\n ui:endpoint \"https://query.wikidata.org/sparql\" ;\n ui:targetClass <http://www.wikidata.org/entity/Q43229>; # Use if nothing else\n ui:searchByNameQuery \"\"\"SELECT ?subject ?name\n WHERE {\n ?klass wdt:P279* $(targetClass) .\n ?subject wdt:P31 ?klass .\n ?subject rdfs:label ?name.\n FILTER regex(?name, \"$(name)\", \"i\")\n } LIMIT $(limit) \"\"\" .\n\n :WikidataOnOrganizations ui:classMap\n [ ui:internalClass schema:Corporation; ui:externalClass <http://www.wikidata.org/entity/Q6881511>], #Enterprise is for-profit\n [ ui:internalClass schema:EducationalOrganization; ui:externalClass <http://www.wikidata.org/entity/Q178706>], #insitution\n [ ui:internalClass schema:ResearchOrganization; ui:externalClass <http://www.wikidata.org/entity/Q31855>], # reearch insitutie\n [ ui:internalClass schema:GovernmentOrganization; ui:externalClass <http://www.wikidata.org/entity/Q327333>], #government agency\n [ ui:internalClass schema:MedicalOrganization; ui:externalClass <http://www.wikidata.org/entity/Q4287745>],\n [ ui:internalClass schema:MusicGroup; ui:externalClass <http://www.wikidata.org/entity/Q32178211>], #music organization\n [ ui:internalClass schema:NGO; ui:externalClass <http://www.wikidata.org/entity/Q163740>], #nonprofit organization @@\n [ ui:internalClass schema:Occupation; ui:externalClass <http://www.wikidata.org/entity/Q28640>], # superclass: Profession\n [ ui:internalClass schema:Organization; ui:externalClass <http://www.wikidata.org/entity/Q43229>], # Superclass; Organization\n [ ui:internalClass schema:Project; ui:externalClass <http://www.wikidata.org/entity/Q170584>],\n [ ui:internalClass schema:SportsOrganization; ui:externalClass <http://www.wikidata.org/entity/Q4438121>] .\n\n\n# eposodes in one's career - Roles\n\nsolid:Role owl:disjointUnionOf ( solid:PastRole solid:CurrentRole solid:FutureRole ) .\nsolid:PastRole a rdfs:Class; rdfs:label \"former role\"@en, \"ancien r\xF4le\"@fr, \"vergangene Rolle\"@de, \"rol anterior\"@es .\nsolid:CurrentRole a rdfs:Class; rdfs:label \"current role\"@en, \"r\xF4le actuel\"@fr, \"momentane Rolle\"@de , \"rol actual\"@es .\nsolid:FutureRole a rdfs:Class; rdfs:label \"future role\"@en, \"r\xF4le \xE0 venir\"@fr, \"zuk\xFCnftige Rolle\"@de, \"rol futuro\"@es .\n\n:RoleDatesGroup a ui:Group; ui:weight 0; ui:parts ( :RoleClassifier :RoleDatesForm ) .\n :RoleClassifier a ui:Classifier; ui:label \"What sort of role?\"@en;\n ui:category solid:Role .\n\n :RoleDatesForm a ui:Options; ui:dependingOn rdf:type; ui:case\n [ ui:for solid:PastRole; ui:use :TwoDateForm ],\n [ ui:for solid:CurrentRole; ui:use :StartDateForm ],\n [ ui:for solid:FutureRole; ui:use :StartDateForm ].\n\n :StartDateForm a ui:DateField; ui:label \"start\"@en,\"d\xE9but\"@fr;\n ui:property schema:startDate .\n :TwoDateForm a ui:Group; ui:weight 0; ui:parts ( :StartDateForm :EndDateForm ) .\n :EndDateForm a ui:DateField; ui:label \"end\"@en,\"fin\"@fr;\n ui:property schema:endDate .\n\n:RoleDescriptionForm a ui:MultiLineTextField; ui:property schema:description;\n ui:label \"Describe your role\" .\n\n# Organizations\n\n vcard:Organization ui:creationForm :OrganizationCreationForm .\n\n# Ontology data to drive the classifier\n\nsolid:InterestingOrganization owl:disjointUnionOf (\n# Airline - a Corporation\n# Consortium - a Corporation or a NGO\n schema:Corporation\n schema:EducationalOrganization\n schema:ResearchOrganization # Proposed. https://github.com/schemaorg/schemaorg/issues/2877\n# FundingScheme - eh?\n schema:GovernmentOrganization\n# LibrarySystem\n# LocalBusiness - Corporation\n# MedicalOrganization - a Corporation or a NGO\n schema:NGO\n # NewsMediaOrganization - a Corporation or a NGO\nschema:PerformingGroup # a band\nschema:Project # like Solid\nschema:SportsOrganization # a Team\nsolid:OtherOrganization\n ) .\n\n# This until the schema.org ontology adopts it\nschema:ResearchOrganization a rdfs:Class; rdfs:label \"Research Organization\"@en, \"Organization de Recherche\"@fr ,\n \"organizaci\xF3n de investigaci\xF3n\"@es, \"\u0645\u0646\u0638\u0645\u0629 \u0627\u0644\u0628\u062D\u062B\"@ar, \"\u0905\u0928\u0941\u0938\u0902\u0927\u093E\u0928 \u0938\u0902\u0917\u0920\u0928\"@hi, \"Forschungsorganisation\"@de, \"shirika la utafiti\"@sw .\n\n :OrganizationCreationForm a ui:Form; schema:name \"Form for editing an organization using public data\" ;\n ui:parts ( :OrgClassifier :OrgSwitch :OrganizationNameField :homePageURIField ) .\n\n\n :OrgClassifier a ui:Classifier; ui:label \"What sort of organization?\"@en;\n ui:category solid:InterestingOrganization .\n\n :OrganizationNameField\n a ui:SingleLineTextField ;\n ui:label \"Organization Name\";\n ui:maxLength \"200\" ;\n ui:property schema:name ;\n ui:size 80 .\n\n :homePageURIField a ui:NamedNodeURIField; ui:size 80;\n ui:label \"Home page URI\"@en;\n ui:property schema:uri . # @@ ??\n\n :initituteTypeField a ui:Classifier;\n ui:label \"What sort of organization\";\n ui:category solid:InterestingOrganization .\n\n# Depending on the type of org, chose a different form\n\n :OrgSwitch a ui:Options; ui:dependingOn rdf:type;\n ui:case\n [ ui:for schema:Corporation; ui:use :CorporationForm ],\n [ ui:for schema:GovernmentOrganization; ui:use :GovernmentOrganizationForm ],\n [ ui:for schema:PerformingGroup; ui:use :PerformingGroupForm ],\n [ ui:for schema:Project; ui:use :ProjectForm ],\n [ ui:for schema:NGO; ui:use :NGOForm ],\n [ ui:for schema:EducationalOrganization; ui:use :EducationalOrganizationForm ],\n [ ui:for schema:ResearchOrganization; ui:use :ResearchOrganizationForm ],\n [ ui:for :SportsOrganization; ui:use :SportsOrganizationForm ],\n [ ui:for solid:OtherOrganization; ui:use :OtherOrganizationForm ].\n\n\n :CorporationForm a ui:Group; ui:weight 0; ui:parts ( :CorporationPrompt :CorporationAutocomplete ) .\n\n :CorporationPrompt a ui:Comment; ui:contents \"Which corporation?\".\n\n :CorporationAutocomplete a ui:AutocompleteField;\n a ui:AutocompleteField; ui:label \"Corporation in wikidata\";\n ui:size 60;\n ui:targetClass <http://www.wikidata.org/entity/Q6881511>; # Enterprise\n ui:property solid:publicId; ui:dataSource :WikidataInstancesByName.\n\n :WikidataInstancesByName a ui:DataSource ;\n schema:name \"Wikidata instances by name\";\n ui:endpoint \"https://query.wikidata.org/sparql\" ;\n ui:searchByNameQuery \"\"\"SELECT ?subject ?name\n WHERE {\n ?klass wdt:P279* $(targetClass) .\n ?subject wdt:P31 ?klass .\n ?subject rdfs:label ?name.\n FILTER regex(?name, \"$(name)\", \"i\")\n } LIMIT $(limit) \"\"\" ;\n\n # Note this form of the query is very experimental\n ui:searchByName [ ui:construct { ?subject schema:name ?name } ;\n ui:where { ?klass wdt:P279 ?targetClass .\n ?subject wdt:P31 ?klass; rdfs:label ?name .\n };\n ].\n\n :GovernmentOrganizationForm a ui:Group; ui:weight 0; ui:parts ( :GovernmentOrganizationPrompt :GovernmentOrganizationAutocomplete ) .\n\n :GovernmentOrganizationPrompt a ui:Comment; ui:contents \"Which GovernmentOrganization?\".\n\n :GovernmentOrganizationAutocomplete\n a ui:AutocompleteField; ui:label \"GovernmentOrganization in wikidata\";\n ui:size 60;\n ui:targetClass <http://www.wikidata.org/entity/Q327333>; # GovernmentOrganization\n ui:property solid:publicId; ui:dataSource :WikidataInstancesByName.\n\n :EducationalOrganizationForm a ui:Group; ui:weight 1; ui:parts ( :EducationalOrganizationPrompt :EducationalOrganizationAutocomplete ) .\n\n :EducationalOrganizationPrompt a ui:Comment; ui:contents \"Which Educational Organization?\".\n\n :EducationalOrganizationAutocomplete\n a ui:AutocompleteField; ui:label \"Educational Organization in wikidata\";\n ui:size 60;\n ui:targetClass <http://www.wikidata.org/entity/Q2385804>; # EducationalOrganization\n ui:property solid:publicId; ui:dataSource :WikidataInstancesByName.\n\n\n :ResearchOrganizationForm a ui:Group; ui:weight 0; ui:parts ( :ResearchOrganizationPrompt :ResearchOrganizationAutocomplete ) .\n\n :ResearchOrganizationPrompt a ui:Comment; ui:contents \"Which Research Organization?\".\n\n :ResearchOrganizationAutocomplete\n a ui:AutocompleteField; ui:label \"Research Insitute in wikidata\";\n ui:size 60;\n ui:targetClass <http://www.wikidata.org/entity/Q31855>; # research institute\n ui:property solid:publicId; ui:dataSource :WikidataInstancesByName.\n\n\n :NGOForm a ui:Group; ui:weight 0; ui:parts ( :NGOPrompt :NGOAutocomplete ) .\n\n :NGOPrompt a ui:Comment; ui:contents \"Which NGO?\".\n\n :NGOAutocomplete\n a ui:AutocompleteField; ui:label \"NGO in wikidata\";\n ui:size 60;\n ui:targetClass <http://www.wikidata.org/entity/Q163740>; # Non-profit org\n ui:property solid:publicId; ui:dataSource :WikidataInstancesByName.\n\n :PerformingGroupForm a ui:Group; ui:weight 0; ui:parts ( :PerformingGroupPrompt :PerformingGroupAutocomplete ) .\n\n :PerformingGroupPrompt a ui:Comment; ui:contents \"Which PerformingGroup?\".\n\n :PerformingGroupAutocomplete\n a ui:AutocompleteField; ui:label \"PerformingGroup in wikidata\";\n ui:size 60;\n ui:targetClass <http://www.wikidata.org/entity/Q32178211>; # Music Org\n ui:property solid:publicId; ui:dataSource :WikidataInstancesByName.\n\n\n :ProjectForm a ui:Group; ui:weight 0; ui:parts ( :ProjectPrompt :ProjectAutocomplete ) . # :ProjectAutocomplete - no: supress, as not in WD\n\n :ProjectPrompt a ui:Comment; ui:contents \"Which Project?\".\n\n :ProjectAutocomplete\n a ui:AutocompleteField; ui:label \"Project in wikidata\";\n ui:size 60;\n ui:targetClass <http://www.wikidata.org/entity/Q170584>; # Project\n ui:property solid:publicId; ui:dataSource :WikidataInstancesByName.\n\n :SportsOrganizationForm a ui:Group; ui:weight 0; ui:parts ( :SportsOrganizationPrompt :SportsOrganizationAutocomplete ) .\n\n :SportsOrganizationPrompt a ui:Comment; ui:contents \"Which Sports Organization?\".\n\n :SportsOrganizationAutocomplete\n a ui:AutocompleteField; ui:label \"SportsOrganization in wikidata\";\n ui:size 60;\n ui:targetClass <http://www.wikidata.org/entity/Q4438121>; # SportsOrganization\n ui:property solid:publicId; ui:dataSource :WikidataInstancesByName.\n\n :OtherOrganizationForm a ui:Group; ui:weight 0; ui:parts ( :OrganizationNameField :homePageURIField ) .\n\n #################### Skills\n\n :SkillsPrompt a ui:Comment; ui:contents \"Skills?\" .\n\n :SkillsForm a ui:Multiple;\n ui:label \"Skills\";\n ui:property schema:skills;\n ui:ordered false; # Allow reader to order skills\n ui:part :SkillForm.\n\n :SkillForm a ui:Group; ui:weight 1; ui:parts ( :escoSkillField ).\n\n # :skillNameField a ui:SingleLineTextField; ui:property vcard:role; ui:size 30 .\n\n :escoSkillField a ui:AutocompleteField;\n ui:label \"skill\"; ui:size 30;\n ui:property solid:publicId;\n ui:dataSource :ESCO_Skill_DataSource;\n ui:targetClass schema:Skill .\n\n :ESCO_Skill_DataSource a ui:DataSource;\n schema:name \"ESCO Skill\";\n ui:targetClass esco:Skill ;\n schema:logo <https://ec.europa.eu/esco/portal/static_resource2/images/logo/logo_en.gif>;\n ui:searchByNameURI \"https://ec.europa.eu/esco/api/search?language=$(language)&limit=$(limit)&type=skill&text=$(name)\".\n\n# Language\n\n:LanguagesPrompt a ui:Comment; ui:contents \"Languages?\" .\n\n:LanguagesForm a ui:Multiple;\n ui:label \"Languages\";\n ui:property schema:knowsLanguage; # @@@\n ui:ordered true; # Allow user to order languages most important first.\n ui:part :LanguageForm.\n\n:LanguageForm a ui:Group; ui:weight 1; ui:parts ( :WikidataLanguageField ).\n\n :WikidataLanguageField a ui:AutocompleteField;\n ui:label \"Language\"; ui:size 30;\n ui:property solid:publicId; # @@\n ui:dataSource :WikidataLanguageDataSource;\n ui:targetClass schema:Language .\n\n :WikidataLanguageDataSource\n schema:name \"Wikidata languages\";\n ui:endpoint \"https://query.wikidata.org/sparql\" ;\n ui:objectURIBase <https://www.w3.org/ns/iana/language-code/>;\n # Add this to any literal string returned as ?subject\n\n ui:searchByNameQuery \"\"\"SELECT ?item ?subject ?name\nWHERE\n{ ?item wdt:P305 ?subject .\n OPTIONAL {?item rdfs:label ?name}\n OPTIONAL {?item wdt:P1705 ?name}\n FILTER regex(?name, \"$(name)\", \"i\")\n FILTER regex(?subject, \"^..$\", \"i\")\n}\"\"\" .\n # Note we restrict code to two-letter codes with the second regex, so as to limit the deluge of languages\n # Hope there are not any important ones which have three-letter codes.\n # Omitted: SERVICE wikibase:label { bd:serviceParam wikibase:language \"$(languages)\". }\n\n########### Social Media - other accounts\n#\n# Twitter, Linked In, Orkid, Mastodon, Matrix, Bluesky, Instagram, Facebook, Github,\n# Snapchat, TikTok, etc\n\n:SocialsPrompt a ui:Heading; ui:contents \"Social Media etc?\" .\n:SocialsPrompt a ui:Comment; ui:contents \"Link to accounts in social media sites, etc\" .\n\n:SocialsForm a ui:Multiple;\n ui:label \"online account\";\n ui:property foaf:account;\n ui:ordered true; # Allow user to order occounts most important first.\n ui:part :AccountsForm.\n\n:AccountsForm a ui:Group; ui:weight 1; ui:parts ( :AccountField :AccountIdField ).\n\n:AccountField a ui:Classifier; ui:label \"What sort of account?\"@en;\n ui:multiple false ; \n ui:category foaf:Account .\n\n:AccountIdField a ui:Options . \n\n :AccountIdField a ui:Options; ui:dependingOn rdf:type; ui:case\n [ ui:for soc:BlueSkyAccount; ui:use :BlueSkyIdField ],\n [ ui:for soc:FacebookAccount; ui:use :FacebookIdField ],\n [ ui:for soc:GithubAccount; ui:use :GithubIdField ],\n [ ui:for soc:InstagramAccount; ui:use :InstagramIdField ],\n [ ui:for soc:LinkedInAccount; ui:use :LinkedInIdField ],\n [ ui:for soc:MastodonAccount; ui:use :MastodonIdField ],\n [ ui:for soc:MatrixAccount; ui:use :MatrixIdField ],\n [ ui:for soc:MediumAccount; ui:use :MediumIdField ],\n [ ui:for soc:NostrAccount; ui:use :NostrIdField ],\n [ ui:for soc:OrcidAccount; ui:use :OrcidIdField ],\n [ ui:for soc:PinterestAccount; ui:use :PinterestIdField ],\n [ ui:for soc:RedditAccount; ui:use :RedditIdField ],\n [ ui:for soc:StravaAccount; ui:use :StravaIdField ],\n [ ui:for soc:SnapchatAccount; ui:use :SnapchatIdField ],\n [ ui:for soc:TiktokAccount; ui:use :TiktokIdField ],\n [ ui:for soc:TumblrAccount; ui:use :TumblrIdField ],\n [ ui:for soc:TwitterAccount; ui:use :TwitterIdField ],\n [ ui:for soc:OtherAccount; ui:use :OtherIdForm ] .\n\n :BlueSkyIdField\n a ui:SingleLineTextField ;\n ui:label \"Bluesky Id\";\n ui:maxLength \"200\" ;\n ui:property foaf:accountName ; \n ui:pattern \"@[a-z0-9A-Z_-](.[a-z0-9A-Z_-])*\"; # @@\n ui:size 40 .\n\n :FacebookIdField\n a ui:SingleLineTextField ;\n ui:label \"Facebook Id\";\n ui:maxLength \"200\" ;\n ui:property foaf:accountName ; \n ui:pattern \"[a-z0-9A-Z_-]*\"; # @@\n ui:size 40 .\n\n :GithubIdField\n a ui:SingleLineTextField ;\n ui:label \"Github Id\";\n ui:maxLength \"200\" ;\n ui:property foaf:accountName ; \n ui:pattern \"[a-z0-9A-Z_-]*\"; # @@\n ui:size 40 .\n\n :InstagramIdField\n a ui:SingleLineTextField ;\n ui:label \"Instagram Id\";\n ui:maxLength \"200\" ;\n ui:property foaf:accountName ; \n ui:pattern \"[a-z0-9A-Z_-]*\"; # @@\n ui:size 40 .\n\n :LinkedInIdField\n a ui:SingleLineTextField ;\n ui:label \"Linked In Id\";\n ui:maxLength \"200\" ;\n ui:property foaf:accountName ; \n ui:pattern \"[a-z0-9A-Z_-]*(.[a-z0-9A-Z_-])*\"; # @@\n ui:size 40 .\n\n :MastodonIdField\n a ui:SingleLineTextField ;\n ui:label \"Mastodon (Activity Pub) Id\";\n ui:maxLength \"200\" ;\n ui:property foaf:accountName ; \n ui:pattern \"@[a-z0-9A-Z_-]*(.[a-z0-9A-Z_-])*\"; # @@\n ui:size 40 .\n\n :MatrixIdField\n a ui:SingleLineTextField ;\n ui:label \"Matrix Username\";\n ui:maxLength \"200\" ;\n ui:property foaf:accountName ; \n ui:pattern \"@[a-z0-9A-Z_-]*(.[a-z0-9A-Z_-])*\"; # @@\n ui:size 40 .\n\n :MediumIdField\n a ui:SingleLineTextField ;\n ui:label \"Medium Username\";\n ui:maxLength \"200\" ;\n ui:property foaf:accountName ; \n ui:pattern \"@[a-z0-9A-Z_-]*(.[a-z0-9A-Z_-])*\"; # @@\n ui:size 40 .\n\n :NostrIdField\n a ui:SingleLineTextField ;\n ui:label \"Nostr public key\";\n ui:maxLength \"200\" ;\n ui:property foaf:accountName ; \n ui:pattern \"[a-z0-9A-Z_-]*(.[a-z0-9A-Z_-])*\"; # @@\n ui:size 70 .\n\n :OrcidIdField\n a ui:SingleLineTextField ;\n ui:label \"ORCiD id\";\n ui:maxLength \"200\" ;\n ui:property foaf:accountName ; \n ui:pattern \"[a-z0-9A-Z_-]*\"; # @@\n ui:size 40 .\n\n :PinterestIdField\n a ui:SingleLineTextField ;\n ui:label \"Pinterest id\";\n ui:maxLength \"200\" ;\n ui:property foaf:accountName ; \n ui:pattern \"[a-z0-9A-Z_-]*\"; # @@\n ui:size 40 .\n\n :RedditIdField\n a ui:SingleLineTextField ;\n ui:label \"Reddit Id\";\n ui:maxLength \"200\" ;\n ui:property foaf:accountName ; \n ui:pattern \"[a-z0-9A-Z_-]*\"; # @@\n ui:size 40 .\n\n :StravaIdField\n a ui:SingleLineTextField ;\n ui:label \"Strava Id\";\n ui:maxLength \"200\" ;\n ui:property foaf:accountName ; \n ui:pattern \"[a-z0-9A-Z_-]*\"; # @@\n ui:size 40 .\n\n :SnapchatIdField\n a ui:SingleLineTextField ;\n ui:label \"Snapchat Id\";\n ui:maxLength \"200\" ;\n ui:property foaf:accountName ; \n ui:pattern \"@[a-z0-9A-Z_-]*\"; # @@\n ui:size 40 .\n\n :TiktokIdField\n a ui:SingleLineTextField ;\n ui:label \"Tiktok Id\";\n ui:maxLength \"200\" ;\n ui:property foaf:accountName ; \n ui:pattern \"@[a-z0-9A-Z_-]*\"; # @@\n ui:size 40 .\n\n :TumblrIdField\n a ui:SingleLineTextField ;\n ui:label \"Tumblr user name\";\n ui:maxLength \"200\" ;\n ui:property foaf:accountName ; \n ui:pattern \"@[a-z0-9A-Z_-]*\"; # @@\n ui:size 40 .\n\n :TwitterIdField\n a ui:SingleLineTextField ;\n ui:label \"Twitter Id\";\n ui:maxLength \"200\" ;\n ui:property foaf:accountName ; \n ui:pattern \"@[a-z0-9A-Z_-]*\"; # @@\n ui:size 40 .\n\n# an unknown SN account needs more info\n\n :OtherIdForm a ui:Group; ui:weight 0; ui:parts ( :OtherIdField :OtherIconField :OtherLabelield ).\n\n :OtherIdField\n a ui:NamedNodeURIField ;\n ui:label \"URL of account to link to\";\n ui:maxLength \"200\" ;\n ui:property foaf:homepage ; \n ui:size 60 .\n\n :OtherLabelield\n a ui:SingleLineTextField ;\n ui:label \"Label\";\n ui:maxLength \"200\" ;\n ui:property rdfs:label ; \n ui:size 40 .\n\n :OtherIconField\n a ui:NamedNodeURIField ;\n ui:label \"URL of icon to display\";\n ui:maxLength \"200\" ;\n ui:property foaf:icon ;\n ui:size 60 .\n\n\n\n\n\n# ENDS\n";
|
|
11
|
+
const profileForm = "@prefix os: <http://www.w3.org/2000/10/swap/os#> .\n@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\n@prefix org: <http://www.w3.org/ns/org#>.\n@prefix esco: <http://data.europa.eu/esco/model#>.\n@prefix wd: <http://www.wikidata.org/entity/>.\n@prefix wdt: <http://www.wikidata.org/prop/direct/>.\n\n@prefix : <https://solidos.github.io/profile-pane/src/ontology/profileForm.ttl#>.\n@prefix soc: <https://solidos.github.io/profile-pane/src/ontology/socialMedia.ttl#>.\n\n# About forms: https://solidos.github.io/solid-ui/docs/forms-intro.html\n# About personal public data: https://www.w3.org/DesignIssues/PersonalPublic.html\n\n:this\n <http://purl.org/dc/elements/1.1/title> \"Profile form\" ;\n a ui:Form ;\n # ui:part :backgroundColor, :highlightColor;\n ui:parts (\n :styleGroup\n :nicknameField\n :pronounsForm\n :LanguagesPrompt :LanguagesForm\n :SocialsPrompt :SocialsForm\n :CVGroup\n :SkillsPrompt :SkillsForm\n ).\n\n:styleGroup a ui:Group; ui:weight 0; ui:parts ( :styleHeading :backgroundColor :highlightColor ).\n :styleHeading a ui:Heading; ui:contents \"The style of your public profile.\".\n :backgroundColor a ui:ColorField; ui:property solid:profileBackgroundColor;\n ui:label \"Background color\"; ui:default \"#ffffff\".\n :highlightColor a ui:ColorField; ui:property solid:profileHighlightColor;\n ui:label \"Highlight color\"; ui:default \"#000000\".\n\n# Nickname\n\n:nicknameField a ui:SingleLineTextField; ui:size 12; ui:property foaf:nick;\n ui:label \"Short name for chats, etc.\"@en, \"nom court\"@fr.\n\n # Pronouns\n\n :pronounsForm a ui:Group; ui:weight 0; ui:parts ( :pronounsPrompt :subjectPronounForm :objectPronounForm :relativePronounForm) .\n\n :pronounsPrompt a ui:Comment; ui:contents \"What are your pronouns?\" .\n\n :subjectPronounForm a ui:SingleLineTextField; ui:property solid:preferredSubjectPronoun;\n ui:size 10; ui:label \"he/she/they...\" .\n :objectPronounForm a ui:SingleLineTextField; ui:property solid:preferredObjectPronoun;\n ui:size 10; ui:label \"him/her/them...\" .\n :relativePronounForm a ui:SingleLineTextField; ui:property solid:preferredRelativePronoun;\n ui:size 10; ui:label \"his/hers/theirs...\" .\n\n # Curriculum Vitae: membership of organizations\n\n :CVHeading a ui:Heading; ui:contents \"Public Curriculum Vitae\".\n :CVPrompt a ui:Comment; ui:contents \"What organizations have you been involved with?\" .\n\n :CVGroup a ui:Group; ui:weight 1; ui:parts ( :CVHeading :CVPrompt :involvementWithOrganizationsForm ).\n\n\n solid:Role a rdfs:Class; owl:oneOf ( solid:CurrentRole solid:FormerRole solid:FutureRole ). # Future Role too?\n\n org:member owl:inverse [ ui:label \"involvement with company, org etc\" ]. # timelimited involvement\n\n :involvementWithOrganizationsForm a ui:Multiple;\n ui:label \"Involvement with Organization\";\n ui:property org:member; ui:reverse true; # link back from role to member\n ui:ordered false; # Allow user to order CV secions rather than force date order? No.\n ui:part :RoleMembershipForm.\n\n# This is a big important form for one of a series of roles in the list.\n\n :RoleMembershipForm a ui:Group; ui:weight 3; ui:parts ( :MembershipFormHeading :roleNameField\n :escoOccupationField :orgField :RoleClassifier :RoleDatesForm :RoleDescriptionForm).\n\n :MembershipFormHeading a ui:Heading; ui:contents \"Details of this role\"@en, \"D\xE9tailes de ce r\xF4le\"@fr .\n\n :orgField a ui:Choice; ui:label \"Organization\"@en, \"Organization\"@fr;\n ui:canMintNew true; ui:use :OrganizationCreationForm ;\n ui:property org:organization;\n ui:from vcard:Organization .\n :roleNameField a ui:SingleLineTextField; ui:property vcard:role; ui:size 60 .\n\n :escoOccupationField a ui:AutocompleteField;\n ui:label \"occupation\"; ui:size 60;\n ui:property org:role;\n ui:dataSource :ESCO_Occupation_DataSource;\n ui:targetClass schema:Occupation .\n\n :ESCO_Occupation_DataSource a ui:DataSource;\n schema:name \"ESCO\";\n ui:targetClass schema:Occupation ;\n schema:logo <https://ec.europa.eu/esco/portal/static_resource2/images/logo/logo_en.gif>;\n ui:searchByNameURI \"https://ec.europa.eu/esco/api/search?language=$(language)&type=occupation&text=$(name)\".\n\n :instituteIdentityField a ui:AutocompleteField; ui:label \"in wikidata\";\n ui:size 60;\n ui:property solid:publicId; ui:dataSource :WikidataOnOrganizations.\n\n :WikidataOnOrganizations a ui:DataSource ;\n schema:name \"Wikidata\";\n ui:endpoint \"https://query.wikidata.org/sparql\" ;\n ui:targetClass <http://www.wikidata.org/entity/Q43229>; # Use if nothing else\n ui:searchByNameQuery \"\"\"SELECT ?subject ?name\n WHERE {\n ?klass wdt:P279* $(targetClass) .\n ?subject wdt:P31 ?klass .\n ?subject rdfs:label ?name.\n FILTER regex(?name, \"$(name)\", \"i\")\n } LIMIT $(limit) \"\"\" .\n\n :WikidataOnOrganizations ui:classMap\n [ ui:internalClass schema:Corporation; ui:externalClass <http://www.wikidata.org/entity/Q6881511>], #Enterprise is for-profit\n [ ui:internalClass schema:EducationalOrganization; ui:externalClass <http://www.wikidata.org/entity/Q178706>], #insitution\n [ ui:internalClass schema:ResearchOrganization; ui:externalClass <http://www.wikidata.org/entity/Q31855>], # reearch insitutie\n [ ui:internalClass schema:GovernmentOrganization; ui:externalClass <http://www.wikidata.org/entity/Q327333>], #government agency\n [ ui:internalClass schema:MedicalOrganization; ui:externalClass <http://www.wikidata.org/entity/Q4287745>],\n [ ui:internalClass schema:MusicGroup; ui:externalClass <http://www.wikidata.org/entity/Q32178211>], #music organization\n [ ui:internalClass schema:NGO; ui:externalClass <http://www.wikidata.org/entity/Q163740>], #nonprofit organization @@\n [ ui:internalClass schema:Occupation; ui:externalClass <http://www.wikidata.org/entity/Q28640>], # superclass: Profession\n [ ui:internalClass schema:Organization; ui:externalClass <http://www.wikidata.org/entity/Q43229>], # Superclass; Organization\n [ ui:internalClass schema:Project; ui:externalClass <http://www.wikidata.org/entity/Q170584>],\n [ ui:internalClass schema:SportsOrganization; ui:externalClass <http://www.wikidata.org/entity/Q4438121>] .\n\n\n# eposodes in one's career - Roles\n\nsolid:Role owl:disjointUnionOf ( solid:PastRole solid:CurrentRole solid:FutureRole ) .\nsolid:PastRole a rdfs:Class; rdfs:label \"former role\"@en, \"ancien r\xF4le\"@fr, \"vergangene Rolle\"@de, \"rol anterior\"@es .\nsolid:CurrentRole a rdfs:Class; rdfs:label \"current role\"@en, \"r\xF4le actuel\"@fr, \"momentane Rolle\"@de , \"rol actual\"@es .\nsolid:FutureRole a rdfs:Class; rdfs:label \"future role\"@en, \"r\xF4le \xE0 venir\"@fr, \"zuk\xFCnftige Rolle\"@de, \"rol futuro\"@es .\n\n:RoleDatesGroup a ui:Group; ui:weight 0; ui:parts ( :RoleClassifier :RoleDatesForm ) .\n :RoleClassifier a ui:Classifier; ui:label \"What sort of role?\"@en;\n ui:category solid:Role .\n\n :RoleDatesForm a ui:Options; ui:dependingOn rdf:type; ui:case\n [ ui:for solid:PastRole; ui:use :TwoDateForm ],\n [ ui:for solid:CurrentRole; ui:use :StartDateForm ],\n [ ui:for solid:FutureRole; ui:use :StartDateForm ].\n\n :StartDateForm a ui:DateField; ui:label \"start\"@en,\"d\xE9but\"@fr;\n ui:property schema:startDate .\n :TwoDateForm a ui:Group; ui:weight 0; ui:parts ( :StartDateForm :EndDateForm ) .\n :EndDateForm a ui:DateField; ui:label \"end\"@en,\"fin\"@fr;\n ui:property schema:endDate .\n\n:RoleDescriptionForm a ui:MultiLineTextField; ui:property schema:description;\n ui:label \"Describe your role\" .\n\n# Organizations\n\n vcard:Organization ui:creationForm :OrganizationCreationForm .\n\n# Ontology data to drive the classifier\n\nsolid:InterestingOrganization owl:disjointUnionOf (\n# Airline - a Corporation\n# Consortium - a Corporation or a NGO\n schema:Corporation\n schema:EducationalOrganization\n schema:ResearchOrganization # Proposed. https://github.com/schemaorg/schemaorg/issues/2877\n# FundingScheme - eh?\n schema:GovernmentOrganization\n# LibrarySystem\n# LocalBusiness - Corporation\n# MedicalOrganization - a Corporation or a NGO\n schema:NGO\n # NewsMediaOrganization - a Corporation or a NGO\nschema:PerformingGroup # a band\nschema:Project # like Solid\nschema:SportsOrganization # a Team\nsolid:OtherOrganization\n ) .\n\n# This until the schema.org ontology adopts it\nschema:ResearchOrganization a rdfs:Class; rdfs:label \"Research Organization\"@en, \"Organization de Recherche\"@fr ,\n \"organizaci\xF3n de investigaci\xF3n\"@es, \"\u0645\u0646\u0638\u0645\u0629 \u0627\u0644\u0628\u062D\u062B\"@ar, \"\u0905\u0928\u0941\u0938\u0902\u0927\u093E\u0928 \u0938\u0902\u0917\u0920\u0928\"@hi, \"Forschungsorganisation\"@de, \"shirika la utafiti\"@sw .\n\n :OrganizationCreationForm a ui:Form; schema:name \"Form for editing an organization using public data\" ;\n ui:parts ( :OrgClassifier :OrgSwitch :OrganizationNameField :homePageURIField ) .\n\n\n :OrgClassifier a ui:Classifier; ui:label \"What sort of organization?\"@en;\n ui:category solid:InterestingOrganization .\n\n :OrganizationNameField\n a ui:SingleLineTextField ;\n ui:label \"Organization Name\";\n ui:maxLength \"200\" ;\n ui:property schema:name ;\n ui:size 80 .\n\n :homePageURIField a ui:NamedNodeURIField; ui:size 80;\n ui:label \"Home page URI\"@en;\n ui:property schema:uri . # @@ ??\n\n :initituteTypeField a ui:Classifier;\n ui:label \"What sort of organization\";\n ui:category solid:InterestingOrganization .\n\n# Depending on the type of org, chose a different form\n\n :OrgSwitch a ui:Options; ui:dependingOn rdf:type;\n ui:case\n [ ui:for schema:Corporation; ui:use :CorporationForm ],\n [ ui:for schema:GovernmentOrganization; ui:use :GovernmentOrganizationForm ],\n [ ui:for schema:PerformingGroup; ui:use :PerformingGroupForm ],\n [ ui:for schema:Project; ui:use :ProjectForm ],\n [ ui:for schema:NGO; ui:use :NGOForm ],\n [ ui:for schema:EducationalOrganization; ui:use :EducationalOrganizationForm ],\n [ ui:for schema:ResearchOrganization; ui:use :ResearchOrganizationForm ],\n [ ui:for :SportsOrganization; ui:use :SportsOrganizationForm ],\n [ ui:for solid:OtherOrganization; ui:use :OtherOrganizationForm ].\n\n\n :CorporationForm a ui:Group; ui:weight 0; ui:parts ( :CorporationPrompt :CorporationAutocomplete ) .\n\n :CorporationPrompt a ui:Comment; ui:contents \"Which corporation?\".\n\n :CorporationAutocomplete a ui:AutocompleteField;\n a ui:AutocompleteField; ui:label \"Corporation in wikidata\";\n ui:size 60;\n ui:targetClass <http://www.wikidata.org/entity/Q6881511>; # Enterprise\n ui:property solid:publicId; ui:dataSource :WikidataInstancesByName.\n\n :WikidataInstancesByName a ui:DataSource ;\n schema:name \"Wikidata instances by name\";\n ui:endpoint \"https://query.wikidata.org/sparql\" ;\n ui:searchByNameQuery \"\"\"SELECT ?subject ?name\n WHERE {\n ?klass wdt:P279* $(targetClass) .\n ?subject wdt:P31 ?klass .\n ?subject rdfs:label ?name.\n FILTER regex(?name, \"$(name)\", \"i\")\n } LIMIT $(limit) \"\"\" ;\n\n # Note this form of the query is very experimental\n ui:searchByName [ ui:construct { ?subject schema:name ?name } ;\n ui:where { ?klass wdt:P279 ?targetClass .\n ?subject wdt:P31 ?klass; rdfs:label ?name .\n };\n ].\n\n :GovernmentOrganizationForm a ui:Group; ui:weight 0; ui:parts ( :GovernmentOrganizationPrompt :GovernmentOrganizationAutocomplete ) .\n\n :GovernmentOrganizationPrompt a ui:Comment; ui:contents \"Which GovernmentOrganization?\".\n\n :GovernmentOrganizationAutocomplete\n a ui:AutocompleteField; ui:label \"GovernmentOrganization in wikidata\";\n ui:size 60;\n ui:targetClass <http://www.wikidata.org/entity/Q327333>; # GovernmentOrganization\n ui:property solid:publicId; ui:dataSource :WikidataInstancesByName.\n\n :EducationalOrganizationForm a ui:Group; ui:weight 1; ui:parts ( :EducationalOrganizationPrompt :EducationalOrganizationAutocomplete ) .\n\n :EducationalOrganizationPrompt a ui:Comment; ui:contents \"Which Educational Organization?\".\n\n :EducationalOrganizationAutocomplete\n a ui:AutocompleteField; ui:label \"Educational Organization in wikidata\";\n ui:size 60;\n ui:targetClass <http://www.wikidata.org/entity/Q2385804>; # EducationalOrganization\n ui:property solid:publicId; ui:dataSource :WikidataInstancesByName.\n\n\n :ResearchOrganizationForm a ui:Group; ui:weight 0; ui:parts ( :ResearchOrganizationPrompt :ResearchOrganizationAutocomplete ) .\n\n :ResearchOrganizationPrompt a ui:Comment; ui:contents \"Which Research Organization?\".\n\n :ResearchOrganizationAutocomplete\n a ui:AutocompleteField; ui:label \"Research Insitute in wikidata\";\n ui:size 60;\n ui:targetClass <http://www.wikidata.org/entity/Q31855>; # research institute\n ui:property solid:publicId; ui:dataSource :WikidataInstancesByName.\n\n\n :NGOForm a ui:Group; ui:weight 0; ui:parts ( :NGOPrompt :NGOAutocomplete ) .\n\n :NGOPrompt a ui:Comment; ui:contents \"Which NGO?\".\n\n :NGOAutocomplete\n a ui:AutocompleteField; ui:label \"NGO in wikidata\";\n ui:size 60;\n ui:targetClass <http://www.wikidata.org/entity/Q163740>; # Non-profit org\n ui:property solid:publicId; ui:dataSource :WikidataInstancesByName.\n\n :PerformingGroupForm a ui:Group; ui:weight 0; ui:parts ( :PerformingGroupPrompt :PerformingGroupAutocomplete ) .\n\n :PerformingGroupPrompt a ui:Comment; ui:contents \"Which PerformingGroup?\".\n\n :PerformingGroupAutocomplete\n a ui:AutocompleteField; ui:label \"PerformingGroup in wikidata\";\n ui:size 60;\n ui:targetClass <http://www.wikidata.org/entity/Q32178211>; # Music Org\n ui:property solid:publicId; ui:dataSource :WikidataInstancesByName.\n\n\n :ProjectForm a ui:Group; ui:weight 0; ui:parts ( :ProjectPrompt :ProjectAutocomplete ) . # :ProjectAutocomplete - no: supress, as not in WD\n\n :ProjectPrompt a ui:Comment; ui:contents \"Which Project?\".\n\n :ProjectAutocomplete\n a ui:AutocompleteField; ui:label \"Project in wikidata\";\n ui:size 60;\n ui:targetClass <http://www.wikidata.org/entity/Q170584>; # Project\n ui:property solid:publicId; ui:dataSource :WikidataInstancesByName.\n\n :SportsOrganizationForm a ui:Group; ui:weight 0; ui:parts ( :SportsOrganizationPrompt :SportsOrganizationAutocomplete ) .\n\n :SportsOrganizationPrompt a ui:Comment; ui:contents \"Which Sports Organization?\".\n\n :SportsOrganizationAutocomplete\n a ui:AutocompleteField; ui:label \"SportsOrganization in wikidata\";\n ui:size 60;\n ui:targetClass <http://www.wikidata.org/entity/Q4438121>; # SportsOrganization\n ui:property solid:publicId; ui:dataSource :WikidataInstancesByName.\n\n :OtherOrganizationForm a ui:Group; ui:weight 0; ui:parts ( :OrganizationNameField :homePageURIField ) .\n\n #################### Skills\n\n :SkillsPrompt a ui:Comment; ui:contents \"Skills?\" .\n\n :SkillsForm a ui:Multiple;\n ui:label \"Skills\";\n ui:property schema:skills;\n ui:ordered false; # Allow reader to order skills\n ui:part :SkillForm.\n\n :SkillForm a ui:Group; ui:weight 1; ui:parts ( :escoSkillField ).\n\n # :skillNameField a ui:SingleLineTextField; ui:property vcard:role; ui:size 30 .\n\n :escoSkillField a ui:AutocompleteField;\n ui:label \"skill\"; ui:size 30;\n ui:property solid:publicId;\n ui:dataSource :ESCO_Skill_DataSource;\n ui:targetClass schema:Skill .\n\n :ESCO_Skill_DataSource a ui:DataSource;\n schema:name \"ESCO Skill\";\n ui:targetClass esco:Skill ;\n schema:logo <https://ec.europa.eu/esco/portal/static_resource2/images/logo/logo_en.gif>;\n ui:searchByNameURI \"https://ec.europa.eu/esco/api/search?language=$(language)&limit=$(limit)&type=skill&text=$(name)\".\n\n# Language\n\n:LanguagesPrompt a ui:Comment; ui:contents \"Languages?\" .\n\n:LanguagesForm a ui:Multiple;\n ui:label \"Languages\";\n ui:property schema:knowsLanguage; # @@@\n ui:ordered true; # Allow user to order languages most important first.\n ui:part :LanguageForm.\n\n:LanguageForm a ui:Group; ui:weight 1; ui:parts ( :WikidataLanguageField ).\n\n :WikidataLanguageField a ui:AutocompleteField;\n ui:label \"Language\"; ui:size 30;\n ui:property solid:publicId; # @@\n ui:dataSource :WikidataLanguageDataSource;\n ui:targetClass schema:Language .\n\n :WikidataLanguageDataSource\n schema:name \"Wikidata languages\";\n ui:endpoint \"https://query.wikidata.org/sparql\" ;\n ui:objectURIBase <https://www.w3.org/ns/iana/language-code/>;\n # Add this to any literal string returned as ?subject\n\n ui:searchByNameQuery \"\"\"SELECT ?item ?subject ?name\nWHERE\n{ ?item wdt:P305 ?subject .\n OPTIONAL {?item rdfs:label ?name}\n OPTIONAL {?item wdt:P1705 ?name}\n FILTER regex(?name, \"$(name)\", \"i\")\n FILTER regex(?subject, \"^..$\", \"i\")\n}\"\"\" .\n # Note we restrict code to two-letter codes with the second regex, so as to limit the deluge of languages\n # Hope there are not any important ones which have three-letter codes.\n # Omitted: SERVICE wikibase:label { bd:serviceParam wikibase:language \"$(languages)\". }\n\n########### Social Media - other accounts\n#\n# Twitter, Linked In, Orkid, Mastodon, Matrix, Bluesky, Instagram, Facebook, Github,\n# Snapchat, TikTok, etc\n\n:SocialsPrompt a ui:Heading; ui:contents \"Social Media etc?\" .\n:SocialsPrompt a ui:Comment; ui:contents \"Link to accounts in social media sites, etc\" .\n\n:SocialsForm a ui:Multiple;\n ui:label \"online account\";\n ui:property foaf:account;\n ui:ordered true; # Allow user to order occounts most important first.\n ui:part :AccountsForm.\n\n:AccountsForm a ui:Group; ui:weight 1; ui:parts ( :AccountField :AccountIdField ).\n\n:AccountField a ui:Classifier; ui:label \"What sort of account?\"@en;\n ui:multiple false ; \n ui:category foaf:Account .\n\n:AccountIdField a ui:Options . \n\n :AccountIdField a ui:Options; ui:dependingOn rdf:type; ui:case\n [ ui:for soc:BlueSkyAccount; ui:use :BlueSkyIdField ],\n [ ui:for soc:DiggAccount; ui:use :DiggIdField],\n [ ui:for soc:FacebookAccount; ui:use :FacebookIdField ],\n [ ui:for soc:GithubAccount; ui:use :GithubIdField ],\n [ ui:for soc:InstagramAccount; ui:use :InstagramIdField ],\n [ ui:for soc:LinkedInAccount; ui:use :LinkedInIdField ],\n [ ui:for soc:MastodonAccount; ui:use :MastodonIdField ],\n [ ui:for soc:MatrixAccount; ui:use :MatrixIdField ],\n [ ui:for soc:MediumAccount; ui:use :MediumIdField ],\n [ ui:for soc:NostrAccount; ui:use :NostrIdField ],\n [ ui:for soc:OrcidAccount; ui:use :OrcidIdField ],\n [ ui:for soc:PinterestAccount; ui:use :PinterestIdField ],\n [ ui:for soc:RedditAccount; ui:use :RedditIdField ],\n [ ui:for soc:StravaAccount; ui:use :StravaIdField ],\n [ ui:for soc:SnapchatAccount; ui:use :SnapchatIdField ],\n [ ui:for soc:TiktokAccount; ui:use :TiktokIdField ],\n [ ui:for soc:TumblrAccount; ui:use :TumblrIdField ],\n [ ui:for soc:TwitterAccount; ui:use :TwitterIdField ],\n [ ui:for soc:OtherAccount; ui:use :OtherIdForm ] .\n\n :BlueSkyIdField\n a ui:SingleLineTextField ;\n ui:label \"Bluesky Id\";\n ui:maxLength \"200\" ;\n ui:property foaf:accountName ; \n ui:pattern \"@[a-z0-9A-Z_-](.[a-z0-9A-Z_-])*\"; # @@\n ui:size 40 .\n\n :DiggIdField\n a ui:SingleLineTextField ;\n ui:label \"Digg Id\";\n ui:maxLength \"200\" ;\n ui:property foaf:accountName ; \n ui:pattern \"@[a-z0-9A-Z_-]*\"; # @@\n ui:size 40 .\n\n :FacebookIdField\n a ui:SingleLineTextField ;\n ui:label \"Facebook Id\";\n ui:maxLength \"200\" ;\n ui:property foaf:accountName ; \n ui:pattern \"[a-z0-9A-Z_-]*\"; # @@\n ui:size 40 .\n\n :GithubIdField\n a ui:SingleLineTextField ;\n ui:label \"Github Id\";\n ui:maxLength \"200\" ;\n ui:property foaf:accountName ; \n ui:pattern \"[a-z0-9A-Z_-]*\"; # @@\n ui:size 40 .\n\n :InstagramIdField\n a ui:SingleLineTextField ;\n ui:label \"Instagram Id\";\n ui:maxLength \"200\" ;\n ui:property foaf:accountName ; \n ui:pattern \"[a-z0-9A-Z_-]*\"; # @@\n ui:size 40 .\n\n :LinkedInIdField\n a ui:SingleLineTextField ;\n ui:label \"Linked In Id\";\n ui:maxLength \"200\" ;\n ui:property foaf:accountName ; \n ui:pattern \"[a-z0-9A-Z_-]*(.[a-z0-9A-Z_-])*\"; # @@\n ui:size 40 .\n\n :MastodonIdField\n a ui:SingleLineTextField ;\n ui:label \"Mastodon (Activity Pub) Id\";\n ui:maxLength \"200\" ;\n ui:property foaf:accountName ; \n ui:pattern \"@[a-z0-9A-Z_-]*(.[a-z0-9A-Z_-])*\"; # @@\n ui:size 40 .\n\n :MatrixIdField\n a ui:SingleLineTextField ;\n ui:label \"Matrix Username\";\n ui:maxLength \"200\" ;\n ui:property foaf:accountName ; \n ui:pattern \"@[a-z0-9A-Z_-]*(.[a-z0-9A-Z_-])*\"; # @@\n ui:size 40 .\n\n :MediumIdField\n a ui:SingleLineTextField ;\n ui:label \"Medium Username\";\n ui:maxLength \"200\" ;\n ui:property foaf:accountName ; \n ui:pattern \"@[a-z0-9A-Z_-]*(.[a-z0-9A-Z_-])*\"; # @@\n ui:size 40 .\n\n :NostrIdField\n a ui:SingleLineTextField ;\n ui:label \"Nostr public key\";\n ui:maxLength \"200\" ;\n ui:property foaf:accountName ; \n ui:pattern \"[a-z0-9A-Z_-]*(.[a-z0-9A-Z_-])*\"; # @@\n ui:size 70 .\n\n :OrcidIdField\n a ui:SingleLineTextField ;\n ui:label \"ORCiD id\";\n ui:maxLength \"200\" ;\n ui:property foaf:accountName ; \n ui:pattern \"[a-z0-9A-Z_-]*\"; # @@\n ui:size 40 .\n\n :PinterestIdField\n a ui:SingleLineTextField ;\n ui:label \"Pinterest id\";\n ui:maxLength \"200\" ;\n ui:property foaf:accountName ; \n ui:pattern \"[a-z0-9A-Z_-]*\"; # @@\n ui:size 40 .\n\n :RedditIdField\n a ui:SingleLineTextField ;\n ui:label \"Reddit Id\";\n ui:maxLength \"200\" ;\n ui:property foaf:accountName ; \n ui:pattern \"[a-z0-9A-Z_-]*\"; # @@\n ui:size 40 .\n\n :StravaIdField\n a ui:SingleLineTextField ;\n ui:label \"Strava Id\";\n ui:maxLength \"200\" ;\n ui:property foaf:accountName ; \n ui:pattern \"[a-z0-9A-Z_-]*\"; # @@\n ui:size 40 .\n\n :SnapchatIdField\n a ui:SingleLineTextField ;\n ui:label \"Snapchat Id\";\n ui:maxLength \"200\" ;\n ui:property foaf:accountName ; \n ui:pattern \"@[a-z0-9A-Z_-]*\"; # @@\n ui:size 40 .\n\n :TiktokIdField\n a ui:SingleLineTextField ;\n ui:label \"Tiktok Id\";\n ui:maxLength \"200\" ;\n ui:property foaf:accountName ; \n ui:pattern \"@[a-z0-9A-Z_-]*\"; # @@\n ui:size 40 .\n\n :TumblrIdField\n a ui:SingleLineTextField ;\n ui:label \"Tumblr user name\";\n ui:maxLength \"200\" ;\n ui:property foaf:accountName ; \n ui:pattern \"@[a-z0-9A-Z_-]*\"; # @@\n ui:size 40 .\n\n :TwitterIdField\n a ui:SingleLineTextField ;\n ui:label \"Twitter Id\";\n ui:maxLength \"200\" ;\n ui:property foaf:accountName ; \n ui:pattern \"@[a-z0-9A-Z_-]*\"; # @@\n ui:size 40 .\n\n# an unknown SN account needs more info\n\n :OtherIdForm a ui:Group; ui:weight 0; ui:parts ( :OtherIdField :OtherIconField :OtherLabelield ).\n\n :OtherIdField\n a ui:NamedNodeURIField ;\n ui:label \"URL of account to link to\";\n ui:maxLength \"200\" ;\n ui:property foaf:homepage ; \n ui:size 60 .\n\n :OtherLabelield\n a ui:SingleLineTextField ;\n ui:label \"Label\";\n ui:maxLength \"200\" ;\n ui:property rdfs:label ; \n ui:size 40 .\n\n :OtherIconField\n a ui:NamedNodeURIField ;\n ui:label \"URL of icon to display\";\n ui:maxLength \"200\" ;\n ui:property foaf:icon ;\n ui:size 60 .\n\n\n\n# Subclass definitions for foaf:Account (embedded for UI category selector)\nsoc:BlueSkyAccount rdfs:subClassOf foaf:Account; rdfs:label \"Bluesky\" .\nsoc:Digg rdfs:subClassOf foaf:Account; rdfs:label \"Digg\" .\nsoc:FacebookAccount rdfs:subClassOf foaf:Account; rdfs:label \"Facebook\" .\nsoc:GithubAccount rdfs:subClassOf foaf:Account; rdfs:label \"Github\" .\nsoc:InstagramAccount rdfs:subClassOf foaf:Account; rdfs:label \"Instagram\" .\nsoc:LinkedInAccount rdfs:subClassOf foaf:Account; rdfs:label \"Linked In\" .\nsoc:MastodonAccount rdfs:subClassOf foaf:Account; rdfs:label \"Mastodon\" .\nsoc:MatrixAccount rdfs:subClassOf foaf:Account; rdfs:label \"Matrix\" .\nsoc:MediumAccount rdfs:subClassOf foaf:Account; rdfs:label \"Medium\" .\nsoc:NostrAccount rdfs:subClassOf foaf:Account; rdfs:label \"Nostr\" .\nsoc:OrcidAccount rdfs:subClassOf foaf:Account; rdfs:label \"ORCiD\" .\nsoc:PinterestAccount rdfs:subClassOf foaf:Account; rdfs:label \"Pinterest\" .\nsoc:RedditAccount rdfs:subClassOf foaf:Account; rdfs:label \"Reddit\" .\nsoc:SnapchatAccount rdfs:subClassOf foaf:Account; rdfs:label \"Snapchat\" .\nsoc:StravaAccount rdfs:subClassOf foaf:Account; rdfs:label \"Strava\" .\nsoc:TiktokAccount rdfs:subClassOf foaf:Account; rdfs:label \"TikTok\" .\nsoc:TumblrAccount rdfs:subClassOf foaf:Account; rdfs:label \"Tumblr\" .\nsoc:TwitterAccount rdfs:subClassOf foaf:Account; rdfs:label \"X (formerly Twitter)\" .\nsoc:OtherAccount rdfs:subClassOf foaf:Account; rdfs:label \"Other\" .\n\n\n\n# ENDS\n";
|
|
12
12
|
const DEFAULT_ICON_URI = _solidUi.icons.iconBase + 'noun_10636_grey.svg'; // grey disc
|
|
13
13
|
|
|
14
14
|
function loadProfileForm(store) {
|
|
@@ -74,9 +74,10 @@ function presentSocial(subject, store) {
|
|
|
74
74
|
if (!accountThings) return {
|
|
75
75
|
accounts: []
|
|
76
76
|
}; // could have been undefined
|
|
77
|
-
console.log('Social: accountThings', accountThings)
|
|
77
|
+
//console.log('Social: accountThings', accountThings)
|
|
78
78
|
const accounts = accountThings.map(ac => accountAsObject(ac));
|
|
79
|
-
console.log('Social: account objects', accounts)
|
|
79
|
+
//console.log('Social: account objects', accounts)
|
|
80
|
+
|
|
80
81
|
return {
|
|
81
82
|
accounts
|
|
82
83
|
};
|
package/lib/StuffCard.d.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { TemplateResult } from 'lit-html';
|
|
2
2
|
import { NamedNode } from 'rdflib';
|
|
3
3
|
import { DataBrowserContext } from 'pane-registry';
|
|
4
|
+
import './styles/StuffCard.css';
|
|
4
5
|
import { ProfilePresentation } from './presenter';
|
|
5
6
|
export declare const StuffCard: (profileBasics: ProfilePresentation, context: DataBrowserContext, subject: NamedNode, stuffData: any) => TemplateResult;
|
|
7
|
+
export declare function renderThingAsDOM(thing: any, dom: any): any;
|
|
8
|
+
export declare function renderThing(thing: any, dom: any): any;
|
|
9
|
+
export declare function renderThings(things: any, dom: any): any;
|
|
6
10
|
//# sourceMappingURL=StuffCard.d.ts.map
|
package/lib/StuffCard.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StuffCard.d.ts","sourceRoot":"","sources":["../src/StuffCard.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,cAAc,EAAE,MAAM,UAAU,CAAA;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;AAClC,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"StuffCard.d.ts","sourceRoot":"","sources":["../src/StuffCard.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,cAAc,EAAE,MAAM,UAAU,CAAA;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;AAClC,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AAElD,OAAO,wBAAwB,CAAA;AAC/B,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAGjD,eAAO,MAAM,SAAS,GAAI,eAAe,mBAAmB,EAC1D,SAAS,kBAAkB,EAC3B,SAAS,SAAS,EAAE,cAAS,KAAG,cAuBjC,CAAA;AAED,wBAAgB,gBAAgB,CAAE,KAAK,KAAA,EAAE,GAAG,KAAA,OAK3C;AAED,wBAAgB,WAAW,CAAE,KAAK,KAAA,EAAE,GAAG,KAAA,OAEtC;AAED,wBAAgB,YAAY,CAAC,MAAM,KAAA,EAAE,GAAG,KAAA,OAGvC"}
|