profile-pane 1.2.1 → 2.0.0-2b49b062
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -21
- package/lib/0SAVED-CVCard.d.ts +5 -0
- package/lib/0SAVED-CVCard.d.ts.map +1 -0
- package/lib/0SAVED-CVCard.js +71 -57
- package/lib/CVCard.d.ts +5 -0
- package/lib/CVCard.d.ts.map +1 -0
- package/lib/CVCard.js +79 -58
- package/lib/CVPresenter.d.ts +25 -0
- package/lib/CVPresenter.d.ts.map +1 -0
- package/lib/CVPresenter.js +87 -91
- package/lib/ChatWithMe.d.ts +5 -0
- package/lib/ChatWithMe.d.ts.map +1 -0
- package/lib/ChatWithMe.js +39 -131
- package/lib/FriendList.d.ts +6 -0
- package/lib/FriendList.d.ts.map +1 -0
- package/lib/FriendList.js +41 -49
- package/lib/ProfileCard.d.ts +4 -0
- package/lib/ProfileCard.d.ts.map +1 -0
- package/lib/ProfileCard.js +38 -36
- package/lib/ProfileView.d.ts +5 -0
- package/lib/ProfileView.d.ts.map +1 -0
- package/lib/ProfileView.js +67 -94
- package/lib/QRCodeCard.d.ts +5 -0
- package/lib/QRCodeCard.d.ts.map +1 -0
- package/lib/QRCodeCard.js +54 -47
- package/lib/SocialCard.d.ts +5 -0
- package/lib/SocialCard.d.ts.map +1 -0
- package/lib/SocialCard.js +56 -42
- package/lib/SocialPresenter.d.ts +12 -0
- package/lib/SocialPresenter.d.ts.map +1 -0
- package/lib/SocialPresenter.js +73 -73
- package/lib/StuffCard.d.ts +6 -0
- package/lib/StuffCard.d.ts.map +1 -0
- package/lib/StuffCard.js +52 -47
- package/lib/StuffPresenter.d.ts +14 -0
- package/lib/StuffPresenter.d.ts.map +1 -0
- package/lib/StuffPresenter.js +47 -76
- package/lib/addMeToYourFriends.d.ts +10 -0
- package/lib/addMeToYourFriends.d.ts.map +1 -0
- package/lib/addMeToYourFriends.js +88 -172
- package/lib/addMeToYourFriendsHelper.d.ts +6 -0
- package/lib/addMeToYourFriendsHelper.d.ts.map +1 -0
- package/lib/addMeToYourFriendsHelper.js +17 -14
- package/lib/baseStyles.d.ts +71 -0
- package/lib/baseStyles.d.ts.map +1 -0
- package/lib/baseStyles.js +75 -69
- package/lib/editProfilePane/editProfile.view.d.ts +13 -0
- package/lib/editProfilePane/editProfile.view.d.ts.map +1 -0
- package/lib/editProfilePane/editProfile.view.js +125 -117
- package/lib/editProfilePane/profile.dom.d.ts +4 -0
- package/lib/editProfilePane/profile.dom.d.ts.map +1 -0
- package/lib/editProfilePane/profile.dom.js +29 -13
- package/lib/index.d.ts +12 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +64 -127
- package/lib/presenter.d.ts +14 -0
- package/lib/presenter.d.ts.map +1 -0
- package/lib/presenter.js +52 -52
- package/lib/texts.d.ts +10 -0
- package/lib/texts.d.ts.map +1 -0
- package/lib/texts.js +16 -12
- package/package.json +32 -18
- package/lib/0SAVED-CVCard.js.map +0 -1
- package/lib/CVCard.js.map +0 -1
- package/lib/CVPresenter.js.map +0 -1
- package/lib/ChatWithMe.js.map +0 -1
- package/lib/FriendList.js.map +0 -1
- package/lib/ProfileCard.js.map +0 -1
- package/lib/ProfileView.js.map +0 -1
- package/lib/QRCodeCard.js.map +0 -1
- package/lib/SocialCard.js.map +0 -1
- package/lib/SocialPresenter.js.map +0 -1
- package/lib/StuffCard.js.map +0 -1
- package/lib/StuffPresenter.js.map +0 -1
- package/lib/addMeToYourFriends.js.map +0 -1
- package/lib/addMeToYourFriendsHelper.js.map +0 -1
- package/lib/baseStyles.js.map +0 -1
- package/lib/editProfilePane/editProfile.view.js.map +0 -1
- package/lib/editProfilePane/profile.dom.js.map +0 -1
- package/lib/editProfilePane/wrapped-profileFormText.js +0 -5
- package/lib/editProfilePane/wrapped-profileFormText.js.map +0 -1
- package/lib/index.js.map +0 -1
- package/lib/integration-tests/helpers/dataSetup.js +0 -74
- package/lib/integration-tests/helpers/dataSetup.js.map +0 -1
- package/lib/integration-tests/helpers/setup.js +0 -19
- package/lib/integration-tests/helpers/setup.js.map +0 -1
- package/lib/integration-tests/setup.js +0 -46
- package/lib/integration-tests/setup.js.map +0 -1
- package/lib/presenter.js.map +0 -1
- package/lib/texts.js.map +0 -1
package/lib/ChatWithMe.js
CHANGED
|
@@ -1,135 +1,43 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
};
|
|
6
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
7
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
8
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
9
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
10
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
11
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
12
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
13
|
-
});
|
|
14
|
-
};
|
|
15
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
16
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
17
|
-
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
18
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
19
|
-
function step(op) {
|
|
20
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
21
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
22
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
23
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
24
|
-
switch (op[0]) {
|
|
25
|
-
case 0: case 1: t = op; break;
|
|
26
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
27
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
28
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
29
|
-
default:
|
|
30
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
31
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
32
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
33
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
34
|
-
if (t[2]) _.ops.pop();
|
|
35
|
-
_.trys.pop(); continue;
|
|
36
|
-
}
|
|
37
|
-
op = body.call(thisArg, _);
|
|
38
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
39
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
|
|
43
|
-
var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
|
|
44
|
-
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
45
|
-
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
46
|
-
return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;
|
|
47
|
-
function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }
|
|
48
|
-
function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }
|
|
49
|
-
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
|
50
|
-
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
|
51
|
-
function fulfill(value) { resume("next", value); }
|
|
52
|
-
function reject(value) { resume("throw", value); }
|
|
53
|
-
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
|
54
|
-
};
|
|
55
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
56
6
|
exports.ChatWithMe = void 0;
|
|
57
|
-
var
|
|
58
|
-
var
|
|
59
|
-
var
|
|
60
|
-
var
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
exists = false;
|
|
90
|
-
return [3 /*break*/, 6];
|
|
91
|
-
case 6:
|
|
92
|
-
if (!exists) return [3 /*break*/, 9];
|
|
93
|
-
chatContainer.appendChild(longChatPane.render(exists, context, {}));
|
|
94
|
-
return [4 /*yield*/, __await(chatContainer)];
|
|
95
|
-
case 7: return [4 /*yield*/, _a.sent()];
|
|
96
|
-
case 8:
|
|
97
|
-
_a.sent();
|
|
98
|
-
return [3 /*break*/, 12];
|
|
99
|
-
case 9:
|
|
100
|
-
button = solid_ui_1.widgets.button(context.dom, undefined, texts_1.chatWithMeButtonText, function () { return __awaiter(_this, void 0, void 0, function () {
|
|
101
|
-
var chat, e_2;
|
|
102
|
-
return __generator(this, function (_a) {
|
|
103
|
-
switch (_a.label) {
|
|
104
|
-
case 0:
|
|
105
|
-
_a.trys.push([0, 2, , 3]);
|
|
106
|
-
return [4 /*yield*/, logic.chat.getChat(subject, true)];
|
|
107
|
-
case 1:
|
|
108
|
-
chat = _a.sent();
|
|
109
|
-
chatContainer.innerHTML = "";
|
|
110
|
-
chatContainer.appendChild(longChatPane.render(chat, context, {}));
|
|
111
|
-
return [3 /*break*/, 3];
|
|
112
|
-
case 2:
|
|
113
|
-
e_2 = _a.sent();
|
|
114
|
-
chatContainer.appendChild(solid_ui_1.widgets.errorMessageBlock(context.dom, e_2.message));
|
|
115
|
-
return [3 /*break*/, 3];
|
|
116
|
-
case 3: return [2 /*return*/];
|
|
117
|
-
}
|
|
118
|
-
});
|
|
119
|
-
}); }, { needsBorder: true });
|
|
120
|
-
chatContainer.appendChild(button);
|
|
121
|
-
return [4 /*yield*/, __await(chatContainer)];
|
|
122
|
-
case 10: return [4 /*yield*/, _a.sent()];
|
|
123
|
-
case 11:
|
|
124
|
-
_a.sent();
|
|
125
|
-
_a.label = 12;
|
|
126
|
-
case 12: return [2 /*return*/];
|
|
127
|
-
}
|
|
128
|
-
});
|
|
129
|
-
});
|
|
7
|
+
var _litHtml = require("lit-html");
|
|
8
|
+
var _solidUi = require("solid-ui");
|
|
9
|
+
var _asyncReplace = require("lit-html/directives/async-replace.js");
|
|
10
|
+
var _texts = require("./texts");
|
|
11
|
+
const ChatWithMe = (subject, context) => {
|
|
12
|
+
const logic = context.session.logic;
|
|
13
|
+
const longChatPane = context.session.paneRegistry.byName('long chat');
|
|
14
|
+
async function* chatContainer() {
|
|
15
|
+
const chatContainer = context.dom.createElement('div');
|
|
16
|
+
let exists;
|
|
17
|
+
try {
|
|
18
|
+
yield _texts.loadingMessage, exists = await logic.chat.getChat(subject, false);
|
|
19
|
+
} catch (e) {
|
|
20
|
+
exists = false;
|
|
21
|
+
}
|
|
22
|
+
if (exists) {
|
|
23
|
+
chatContainer.appendChild(longChatPane.render(exists, context, {}));
|
|
24
|
+
yield chatContainer;
|
|
25
|
+
} else {
|
|
26
|
+
const button = _solidUi.widgets.button(context.dom, undefined, _texts.chatWithMeButtonText, async () => {
|
|
27
|
+
try {
|
|
28
|
+
const chat = await logic.chat.getChat(subject, true);
|
|
29
|
+
chatContainer.innerHTML = '';
|
|
30
|
+
chatContainer.appendChild(longChatPane.render(chat, context, {}));
|
|
31
|
+
} catch (e) {
|
|
32
|
+
chatContainer.appendChild(_solidUi.widgets.errorMessageBlock(context.dom, e.message));
|
|
33
|
+
}
|
|
34
|
+
}, {
|
|
35
|
+
needsBorder: true
|
|
36
|
+
});
|
|
37
|
+
chatContainer.appendChild(button);
|
|
38
|
+
yield chatContainer;
|
|
130
39
|
}
|
|
131
|
-
|
|
40
|
+
}
|
|
41
|
+
return (0, _litHtml.html)` ${(0, _asyncReplace.asyncReplace)(chatContainer())} `;
|
|
132
42
|
};
|
|
133
|
-
exports.ChatWithMe = ChatWithMe;
|
|
134
|
-
var templateObject_1;
|
|
135
|
-
//# sourceMappingURL=ChatWithMe.js.map
|
|
43
|
+
exports.ChatWithMe = ChatWithMe;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { DataBrowserContext } from 'pane-registry';
|
|
2
|
+
import { NamedNode } from 'rdflib';
|
|
3
|
+
import { TemplateResult } from 'lit-html';
|
|
4
|
+
import { ProfilePresentation } from './presenter';
|
|
5
|
+
export declare const FriendList: (profileBasics: ProfilePresentation, subject: NamedNode, context: DataBrowserContext) => TemplateResult;
|
|
6
|
+
//# sourceMappingURL=FriendList.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FriendList.d.ts","sourceRoot":"","sources":["../src/FriendList.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;AAClC,OAAO,EAAQ,cAAc,EAAE,MAAM,UAAU,CAAA;AAG/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAYjD,eAAO,MAAM,UAAU,GAAK,eAAe,mBAAmB,EAC5D,SAAS,SAAS,EAClB,SAAS,kBAAkB,KAC1B,cAkBF,CAAA"}
|
package/lib/FriendList.js
CHANGED
|
@@ -1,54 +1,46 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
};
|
|
6
|
-
var __assign = (this && this.__assign) || function () {
|
|
7
|
-
__assign = Object.assign || function(t) {
|
|
8
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
9
|
-
s = arguments[i];
|
|
10
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
11
|
-
t[p] = s[p];
|
|
12
|
-
}
|
|
13
|
-
return t;
|
|
14
|
-
};
|
|
15
|
-
return __assign.apply(this, arguments);
|
|
16
|
-
};
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
18
6
|
exports.FriendList = void 0;
|
|
19
|
-
var
|
|
20
|
-
var
|
|
21
|
-
var
|
|
22
|
-
var
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
card: (0, style_map_js_1.styleMap)((0, baseStyles_1.card)()),
|
|
7
|
+
var _solidUi = require("solid-ui");
|
|
8
|
+
var _litHtml = require("lit-html");
|
|
9
|
+
var _styleMap = require("lit-html/directives/style-map.js");
|
|
10
|
+
var _baseStyles = require("./baseStyles");
|
|
11
|
+
const styles = {
|
|
12
|
+
root: (0, _styleMap.styleMap)((0, _baseStyles.padding)()),
|
|
13
|
+
heading: (0, _styleMap.styleMap)((0, _baseStyles.headingLight)()),
|
|
14
|
+
card: (0, _styleMap.styleMap)((0, _baseStyles.card)())
|
|
28
15
|
};
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
return (0,
|
|
16
|
+
const FriendList = (profileBasics, subject, context) => {
|
|
17
|
+
const nameStyle = (0, _styleMap.styleMap)({
|
|
18
|
+
...(0, _baseStyles.heading)(),
|
|
19
|
+
// "text-decoration": "underline",
|
|
20
|
+
color: profileBasics.highlightColor // was "text-decoration-color"
|
|
21
|
+
});
|
|
22
|
+
if (createList(subject, context)) {
|
|
23
|
+
return (0, _litHtml.html)`
|
|
24
|
+
<div data-testid="friend-list" style="${styles.card}">
|
|
25
|
+
<div style=${styles.root}>
|
|
26
|
+
<h3 style=${nameStyle}>Friends</h3>
|
|
27
|
+
${createList(subject, context)}
|
|
28
|
+
</div>
|
|
29
|
+
</div>
|
|
30
|
+
`;
|
|
31
|
+
}
|
|
32
|
+
return (0, _litHtml.html)``;
|
|
37
33
|
};
|
|
38
34
|
exports.FriendList = FriendList;
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
return target;
|
|
52
|
-
};
|
|
53
|
-
var templateObject_1, templateObject_2;
|
|
54
|
-
//# sourceMappingURL=FriendList.js.map
|
|
35
|
+
const createList = (subject, {
|
|
36
|
+
dom
|
|
37
|
+
}) => {
|
|
38
|
+
const target = dom.createElement('div');
|
|
39
|
+
_solidUi.widgets.attachmentList(dom, subject, target, {
|
|
40
|
+
doc: subject.doc(),
|
|
41
|
+
modify: false,
|
|
42
|
+
predicate: _solidUi.ns.foaf('knows'),
|
|
43
|
+
noun: 'friend'
|
|
44
|
+
});
|
|
45
|
+
if (target.textContent === '') return null;else return target;
|
|
46
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { TemplateResult } from 'lit-html';
|
|
2
|
+
import { ProfilePresentation } from './presenter';
|
|
3
|
+
export declare const ProfileCard: ({ name, imageSrc, introduction, location, pronouns, highlightColor, }: ProfilePresentation) => TemplateResult;
|
|
4
|
+
//# sourceMappingURL=ProfileCard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProfileCard.d.ts","sourceRoot":"","sources":["../src/ProfileCard.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,cAAc,EAAE,MAAM,UAAU,CAAA;AASxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAQjD,eAAO,MAAM,WAAW,GAAI,uEAOzB,mBAAmB,KAAG,cAexB,CAAA"}
|
package/lib/ProfileCard.js
CHANGED
|
@@ -1,41 +1,43 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
};
|
|
6
|
-
var __assign = (this && this.__assign) || function () {
|
|
7
|
-
__assign = Object.assign || function(t) {
|
|
8
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
9
|
-
s = arguments[i];
|
|
10
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
11
|
-
t[p] = s[p];
|
|
12
|
-
}
|
|
13
|
-
return t;
|
|
14
|
-
};
|
|
15
|
-
return __assign.apply(this, arguments);
|
|
16
|
-
};
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
18
6
|
exports.ProfileCard = void 0;
|
|
19
|
-
var
|
|
20
|
-
var
|
|
21
|
-
var
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
7
|
+
var _litHtml = require("lit-html");
|
|
8
|
+
var _styleMap = require("lit-html/directives/style-map.js");
|
|
9
|
+
var _baseStyles = require("./baseStyles");
|
|
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
|
+
info: (0, _styleMap.styleMap)((0, _baseStyles.padding)())
|
|
26
17
|
};
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
18
|
+
const ProfileCard = ({
|
|
19
|
+
name,
|
|
20
|
+
imageSrc,
|
|
21
|
+
introduction,
|
|
22
|
+
location,
|
|
23
|
+
pronouns,
|
|
24
|
+
highlightColor
|
|
25
|
+
}) => {
|
|
26
|
+
const nameStyle = (0, _styleMap.styleMap)({
|
|
27
|
+
...(0, _baseStyles.heading)(),
|
|
28
|
+
'text-decoration': 'underline',
|
|
29
|
+
'text-decoration-color': highlightColor
|
|
30
|
+
});
|
|
31
|
+
return (0, _litHtml.html)`
|
|
32
|
+
${Image(imageSrc, name)}
|
|
33
|
+
<div style=${styles.info}>
|
|
34
|
+
<h3 style=${nameStyle}>${name}</h3>
|
|
35
|
+
<div style=${styles.intro}>
|
|
36
|
+
${Line(introduction)} ${Line(location, '🌐')} ${Line(pronouns)}
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
`;
|
|
31
40
|
};
|
|
32
41
|
exports.ProfileCard = ProfileCard;
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
return value ? (0, lit_html_1.html)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["<p>", " ", "</p>"], ["<p>", " ", "</p>"])), prefix, value) : lit_html_1.nothing;
|
|
36
|
-
};
|
|
37
|
-
var Image = function (src, alt) {
|
|
38
|
-
return src ? (0, lit_html_1.html)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["<img style=", " src=", " alt=", " />"], ["<img style=", " src=", " alt=", " />"])), styles.image, src, alt) : lit_html_1.nothing;
|
|
39
|
-
};
|
|
40
|
-
var templateObject_1, templateObject_2, templateObject_3;
|
|
41
|
-
//# sourceMappingURL=ProfileCard.js.map
|
|
42
|
+
const Line = (value, prefix = _litHtml.nothing) => value ? (0, _litHtml.html)`<p>${prefix} ${value}</p>` : _litHtml.nothing;
|
|
43
|
+
const Image = (src, alt) => src ? (0, _litHtml.html)`<img style=${styles.image} src=${src} alt=${alt} />` : _litHtml.nothing;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { TemplateResult } from 'lit-html';
|
|
2
|
+
import { DataBrowserContext } from 'pane-registry';
|
|
3
|
+
import { NamedNode } from 'rdflib';
|
|
4
|
+
export declare function ProfileView(subject: NamedNode, context: DataBrowserContext): Promise<TemplateResult>;
|
|
5
|
+
//# sourceMappingURL=ProfileView.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProfileView.d.ts","sourceRoot":"","sources":["../src/ProfileView.ts"],"names":[],"mappings":"AAGA,OAAO,EAAQ,cAAc,EAAE,MAAM,UAAU,CAAA;AAE/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AAClD,OAAO,EAAE,SAAS,EAAa,MAAM,QAAQ,CAAA;AA2B7C,wBAAsB,WAAW,CAC/B,OAAO,EAAE,SAAS,EAClB,OAAO,EAAE,kBAAkB,GAC1B,OAAO,CAAE,cAAc,CAAC,CAuC1B"}
|
package/lib/ProfileView.js
CHANGED
|
@@ -1,78 +1,35 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ProfileView = ProfileView;
|
|
7
|
+
var _litHtml = require("lit-html");
|
|
8
|
+
var _styleMap = require("lit-html/directives/style-map.js");
|
|
9
|
+
var _baseStyles = require("./baseStyles");
|
|
10
|
+
var _ChatWithMe = require("./ChatWithMe");
|
|
11
|
+
var _FriendList = require("./FriendList");
|
|
12
|
+
var _presenter = require("./presenter");
|
|
13
|
+
var _CVPresenter = require("./CVPresenter");
|
|
14
|
+
var _SocialPresenter = require("./SocialPresenter");
|
|
15
|
+
var _StuffPresenter = require("./StuffPresenter");
|
|
16
|
+
var _ProfileCard = require("./ProfileCard");
|
|
17
|
+
var _CVCard = require("./CVCard");
|
|
18
|
+
var _SocialCard = require("./SocialCard");
|
|
19
|
+
var _StuffCard = require("./StuffCard");
|
|
20
|
+
var _QRCodeCard = require("./QRCodeCard");
|
|
21
|
+
var _addMeToYourFriends = require("./addMeToYourFriends");
|
|
2
22
|
/* Profile View
|
|
3
23
|
*/
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
__assign = Object.assign || function(t) {
|
|
10
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
11
|
-
s = arguments[i];
|
|
12
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
13
|
-
t[p] = s[p];
|
|
14
|
-
}
|
|
15
|
-
return t;
|
|
16
|
-
};
|
|
17
|
-
return __assign.apply(this, arguments);
|
|
18
|
-
};
|
|
19
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
20
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
21
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
22
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
23
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
24
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
25
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
26
|
-
});
|
|
27
|
-
};
|
|
28
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
29
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
30
|
-
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
31
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
32
|
-
function step(op) {
|
|
33
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
34
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
35
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
36
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
37
|
-
switch (op[0]) {
|
|
38
|
-
case 0: case 1: t = op; break;
|
|
39
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
40
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
41
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
42
|
-
default:
|
|
43
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
44
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
45
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
46
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
47
|
-
if (t[2]) _.ops.pop();
|
|
48
|
-
_.trys.pop(); continue;
|
|
49
|
-
}
|
|
50
|
-
op = body.call(thisArg, _);
|
|
51
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
52
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
56
|
-
exports.ProfileView = ProfileView;
|
|
57
|
-
var lit_html_1 = require("lit-html");
|
|
58
|
-
var style_map_js_1 = require("lit-html/directives/style-map.js");
|
|
59
|
-
var baseStyles_1 = require("./baseStyles");
|
|
60
|
-
var ChatWithMe_1 = require("./ChatWithMe");
|
|
61
|
-
var FriendList_1 = require("./FriendList");
|
|
62
|
-
var presenter_1 = require("./presenter");
|
|
63
|
-
var CVPresenter_1 = require("./CVPresenter"); // 20210527
|
|
64
|
-
var SocialPresenter_1 = require("./SocialPresenter"); // 20210527
|
|
65
|
-
var StuffPresenter_1 = require("./StuffPresenter"); // 20210527
|
|
66
|
-
var ProfileCard_1 = require("./ProfileCard");
|
|
67
|
-
var CVCard_1 = require("./CVCard");
|
|
68
|
-
var SocialCard_1 = require("./SocialCard");
|
|
69
|
-
var StuffCard_1 = require("./StuffCard");
|
|
70
|
-
var QRCodeCard_1 = require("./QRCodeCard");
|
|
71
|
-
var addMeToYourFriends_1 = require("./addMeToYourFriends");
|
|
24
|
+
|
|
25
|
+
// 20210527
|
|
26
|
+
// 20210527
|
|
27
|
+
// 20210527
|
|
28
|
+
|
|
72
29
|
// The edit button switches to the editor pane
|
|
73
30
|
/*
|
|
74
31
|
function renderEditButton (subject) {
|
|
75
|
-
return
|
|
32
|
+
return
|
|
76
33
|
authn.currentUser() && authn.currentUser().sameTerm(subject) ?
|
|
77
34
|
html `<button type="button" class="ProfilePaneCVEditButton">
|
|
78
35
|
<img src="${editButtonURI}">
|
|
@@ -80,28 +37,44 @@ function renderEditButton (subject) {
|
|
|
80
37
|
: html``;
|
|
81
38
|
}
|
|
82
39
|
*/
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
|
|
40
|
+
|
|
41
|
+
async function ProfileView(subject, context) {
|
|
42
|
+
const profileBasics = (0, _presenter.presentProfile)(subject, context.session.store); // rdflib rdfs type problems
|
|
43
|
+
const rolesByType = (0, _CVPresenter.presentCV)(subject, context.session.store);
|
|
44
|
+
const accounts = (0, _SocialPresenter.presentSocial)(subject, context.session.store);
|
|
45
|
+
const stuffData = await (0, _StuffPresenter.presentStuff)(subject);
|
|
46
|
+
const styles = {
|
|
47
|
+
grid: (0, _styleMap.styleMap)({
|
|
48
|
+
...(0, _baseStyles.responsiveGrid)(),
|
|
49
|
+
...(0, _baseStyles.paddingSmall)(),
|
|
50
|
+
background: `radial-gradient(circle, ${profileBasics.backgroundColor} 80%, ${profileBasics.highlightColor} 100%)`
|
|
51
|
+
}),
|
|
52
|
+
card: (0, _styleMap.styleMap)((0, _baseStyles.card)()),
|
|
53
|
+
chat: (0, _styleMap.styleMap)({
|
|
54
|
+
...(0, _baseStyles.card)(),
|
|
55
|
+
...(0, _baseStyles.padding)()
|
|
56
|
+
})
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
// was: <div style=${styles.card}>${renderEditButton(subject)}</div>
|
|
60
|
+
|
|
61
|
+
return (0, _litHtml.html)`
|
|
62
|
+
<div style="${styles.grid}">
|
|
63
|
+
<div>
|
|
64
|
+
<div data-testid="profile-card" style="${styles.card}">
|
|
65
|
+
${(0, _ProfileCard.ProfileCard)(profileBasics)}
|
|
66
|
+
${(0, _addMeToYourFriends.addMeToYourFriendsDiv)(subject, context)}
|
|
67
|
+
</div>
|
|
68
|
+
</div>
|
|
69
|
+
${(0, _CVCard.CVCard)(profileBasics, rolesByType)}
|
|
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>
|
|
79
|
+
`;
|
|
80
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { TemplateResult } from 'lit-html';
|
|
2
|
+
import { NamedNode } from 'rdflib';
|
|
3
|
+
import { ProfilePresentation } from './presenter';
|
|
4
|
+
export declare const QRCodeCard: (profileBasics: ProfilePresentation, subject: NamedNode) => TemplateResult;
|
|
5
|
+
//# sourceMappingURL=QRCodeCard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"QRCodeCard.d.ts","sourceRoot":"","sources":["../src/QRCodeCard.ts"],"names":[],"mappings":"AAEA,OAAO,EAAQ,cAAc,EAAE,MAAM,UAAU,CAAA;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;AASlC,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAWjD,eAAO,MAAM,UAAU,GACrB,eAAe,mBAAmB,EAClC,SAAS,SAAS,KACjB,cAoCF,CAAA"}
|