@sphereon/ui-components.credential-branding 0.3.1-unstable.13 → 0.3.1-unstable.20
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.
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import { VerifiableCredential } from '@veramo/core';
|
|
2
2
|
import { CredentialRole, IBasicCredentialLocaleBranding, IBasicIssuerLocaleBranding, Party } from '@sphereon/ssi-sdk.data-store';
|
|
3
|
-
import { CredentialSummary, ISelectAppLocaleBrandingArgs } from '../types';
|
|
3
|
+
import { CredentialDetailsRow, CredentialSummary, ISelectAppLocaleBrandingArgs } from '../types';
|
|
4
4
|
import { ICredential } from '@sphereon/ssi-types';
|
|
5
|
+
export declare const toCredentialDetailsRow: ({ object, subject, issuer, }: {
|
|
6
|
+
object: Record<string, any>;
|
|
7
|
+
subject?: Party | undefined;
|
|
8
|
+
issuer?: Party | undefined;
|
|
9
|
+
}) => Promise<CredentialDetailsRow[]>;
|
|
5
10
|
export declare const toNonPersistedCredentialSummary: ({ verifiableCredential, credentialRole, branding, issuer, subject, }: {
|
|
6
11
|
verifiableCredential: ICredential | VerifiableCredential;
|
|
7
12
|
credentialRole: CredentialRole;
|
|
@@ -90,7 +90,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
90
90
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
91
91
|
};
|
|
92
92
|
exports.__esModule = true;
|
|
93
|
-
exports.selectAppLocaleBranding = exports.toCredentialSummary = exports.getCredentialIssuerNameAndAlias = exports.getCredentialDisplayName = exports.getDate = exports.toNonPersistedCredentialSummary = void 0;
|
|
93
|
+
exports.selectAppLocaleBranding = exports.toCredentialSummary = exports.getCredentialIssuerNameAndAlias = exports.getCredentialDisplayName = exports.getDate = exports.toNonPersistedCredentialSummary = exports.toCredentialDetailsRow = void 0;
|
|
94
94
|
var uuid_1 = require("uuid");
|
|
95
95
|
var utils_1 = require("@veramo/utils");
|
|
96
96
|
var ui_components_core_1 = require("@sphereon/ui-components.core");
|
|
@@ -102,9 +102,7 @@ function findCorrelationIdName(correlationId, parties, activeUser) {
|
|
|
102
102
|
if (activeUser) {
|
|
103
103
|
parties.push(activeUser);
|
|
104
104
|
}
|
|
105
|
-
return ((_b = (_a = allParties === null || allParties === void 0 ? void 0 : allParties.find(function (contact) {
|
|
106
|
-
return contact.identities.some(function (identity) { return identity.identifier.correlationId === correlationId; });
|
|
107
|
-
})) === null || _a === void 0 ? void 0 : _a.contact.displayName) !== null && _b !== void 0 ? _b : correlationId);
|
|
105
|
+
return ((_b = (_a = allParties === null || allParties === void 0 ? void 0 : allParties.find(function (contact) { var _a; return (_a = contact.identities) === null || _a === void 0 ? void 0 : _a.some(function (identity) { return identity.identifier.correlationId === correlationId; }); })) === null || _a === void 0 ? void 0 : _a.contact.displayName) !== null && _b !== void 0 ? _b : correlationId);
|
|
108
106
|
}
|
|
109
107
|
var getImageSize = function (image) { return __awaiter(void 0, void 0, void 0, function () {
|
|
110
108
|
var downloadedImage;
|
|
@@ -161,7 +159,7 @@ var toCredentialDetailsRow = function (_a) {
|
|
|
161
159
|
}
|
|
162
160
|
if (!(typeof value === 'object' && value !== null && value !== undefined)) return [3, 3];
|
|
163
161
|
_e = (_d = rows).concat;
|
|
164
|
-
return [4, toCredentialDetailsRow({ object: value, subject: subject, issuer: issuer })];
|
|
162
|
+
return [4, (0, exports.toCredentialDetailsRow)({ object: value, subject: subject, issuer: issuer })];
|
|
165
163
|
case 2:
|
|
166
164
|
rows = _e.apply(_d, [_g.sent()]);
|
|
167
165
|
return [3, 8];
|
|
@@ -204,6 +202,7 @@ var toCredentialDetailsRow = function (_a) {
|
|
|
204
202
|
});
|
|
205
203
|
});
|
|
206
204
|
};
|
|
205
|
+
exports.toCredentialDetailsRow = toCredentialDetailsRow;
|
|
207
206
|
var toNonPersistedCredentialSummary = function (_a) {
|
|
208
207
|
var verifiableCredential = _a.verifiableCredential, credentialRole = _a.credentialRole, branding = _a.branding, issuer = _a.issuer, subject = _a.subject;
|
|
209
208
|
return (0, exports.toCredentialSummary)({
|
|
@@ -294,7 +293,7 @@ var toCredentialSummary = function (_a) {
|
|
|
294
293
|
localeBranding = _e.sent();
|
|
295
294
|
credentialStatus = (0, utils_2.getCredentialStatus)(verifiableCredential);
|
|
296
295
|
title = (0, exports.getCredentialDisplayName)({ verifiableCredential: verifiableCredential, localeBranding: localeBranding });
|
|
297
|
-
return [4, toCredentialDetailsRow({
|
|
296
|
+
return [4, (0, exports.toCredentialDetailsRow)({
|
|
298
297
|
object: __assign(__assign({}, (_d = verifiableCredential.vc) === null || _d === void 0 ? void 0 : _d.credentialSubject), verifiableCredential.credentialSubject),
|
|
299
298
|
subject: subject,
|
|
300
299
|
issuer: issuer
|
package/dist/types/index.d.ts
CHANGED
|
@@ -28,6 +28,7 @@ export type CredentialDetailsRow = {
|
|
|
28
28
|
isEditable?: boolean;
|
|
29
29
|
status?: LabelStatus;
|
|
30
30
|
imageSize?: ImageSize;
|
|
31
|
+
onPress?: () => Promise<void>;
|
|
31
32
|
};
|
|
32
33
|
export type LabelStatus = CredentialStatus | IssuerStatus;
|
|
33
34
|
export interface ISelectAppLocaleBrandingArgs {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sphereon/ui-components.credential-branding",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.3.1-unstable.
|
|
4
|
+
"version": "0.3.1-unstable.20+b2ea3fd",
|
|
5
5
|
"description": "SSI UI components credential branding",
|
|
6
6
|
"repository": "git@github.com:Sphereon-Opensource/UI-Components.git",
|
|
7
7
|
"author": "Sphereon <dev@sphereon.com>",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"@sphereon/ssi-sdk.core": "0.29.0",
|
|
32
32
|
"@sphereon/ssi-sdk.data-store": "0.29.0",
|
|
33
33
|
"@sphereon/ssi-types": "0.29.0",
|
|
34
|
-
"@sphereon/ui-components.core": "0.3.1-unstable.
|
|
34
|
+
"@sphereon/ui-components.core": "0.3.1-unstable.20+b2ea3fd",
|
|
35
35
|
"@veramo/core": "4.2.0",
|
|
36
36
|
"@veramo/utils": "4.2.0",
|
|
37
37
|
"i18n-js": "^3.8.0",
|
|
@@ -51,5 +51,5 @@
|
|
|
51
51
|
"peerDependencies": {
|
|
52
52
|
"react": ">= 18"
|
|
53
53
|
},
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "b2ea3fde08adff18b73362423e6091cdd6a98a4a"
|
|
55
55
|
}
|