@sphereon/ui-components.credential-branding 0.4.1-unstable.157 → 0.4.1-unstable.160
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.
|
@@ -132,9 +132,9 @@ var getImageSize = function (image) { return __awaiter(void 0, void 0, void 0, f
|
|
|
132
132
|
}); };
|
|
133
133
|
var toCredentialDetailsRow = function (args) { return __awaiter(void 0, void 0, void 0, function () {
|
|
134
134
|
var object, subject, issuer, branding, _a, parentKey, rows, _loop_1, _i, _b, _c, key, value;
|
|
135
|
-
var _d, _e;
|
|
136
|
-
return __generator(this, function (
|
|
137
|
-
switch (
|
|
135
|
+
var _d, _e, _f, _g;
|
|
136
|
+
return __generator(this, function (_h) {
|
|
137
|
+
switch (_h.label) {
|
|
138
138
|
case 0:
|
|
139
139
|
object = args.object, subject = args.subject, issuer = args.issuer, branding = args.branding, _a = args.parentKey, parentKey = _a === void 0 ? '' : _a;
|
|
140
140
|
rows = [];
|
|
@@ -142,9 +142,9 @@ var toCredentialDetailsRow = function (args) { return __awaiter(void 0, void 0,
|
|
|
142
142
|
return [2, rows];
|
|
143
143
|
}
|
|
144
144
|
_loop_1 = function (key, value) {
|
|
145
|
-
var
|
|
146
|
-
return __generator(this, function (
|
|
147
|
-
switch (
|
|
145
|
+
var primitiveItems, objectItems, label, _j, objectItems_1, item, _k, _l, _m, _o, label, contacts, imageSize, _p;
|
|
146
|
+
return __generator(this, function (_q) {
|
|
147
|
+
switch (_q.label) {
|
|
148
148
|
case 0:
|
|
149
149
|
if (!key) {
|
|
150
150
|
return [2, "continue"];
|
|
@@ -157,17 +157,44 @@ var toCredentialDetailsRow = function (args) { return __awaiter(void 0, void 0,
|
|
|
157
157
|
});
|
|
158
158
|
return [2, "continue"];
|
|
159
159
|
}
|
|
160
|
-
if (!(
|
|
161
|
-
|
|
162
|
-
|
|
160
|
+
if (!Array.isArray(value)) return [3, 5];
|
|
161
|
+
primitiveItems = value.filter(function (item) { return item !== undefined && item !== null && typeof item !== 'object'; });
|
|
162
|
+
objectItems = value.filter(function (item) { return typeof item === 'object' && item !== null; });
|
|
163
|
+
label = (_e = (_d = branding === null || branding === void 0 ? void 0 : branding.find(function (claim) { return claim.key === (parentKey ? "".concat(parentKey, ".").concat(key) : key); })) === null || _d === void 0 ? void 0 : _d.name) !== null && _e !== void 0 ? _e : key;
|
|
164
|
+
if (primitiveItems.length > 0) {
|
|
165
|
+
rows.push({
|
|
166
|
+
id: (0, uuid_1.v4)(),
|
|
167
|
+
label: label,
|
|
168
|
+
value: primitiveItems.map(function (item) { return "- ".concat(item); }).join('\n')
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
if (!(objectItems.length > 0)) return [3, 4];
|
|
172
|
+
_j = 0, objectItems_1 = objectItems;
|
|
173
|
+
_q.label = 1;
|
|
163
174
|
case 1:
|
|
164
|
-
|
|
165
|
-
|
|
175
|
+
if (!(_j < objectItems_1.length)) return [3, 4];
|
|
176
|
+
item = objectItems_1[_j];
|
|
177
|
+
_l = (_k = rows).concat;
|
|
178
|
+
return [4, (0, exports.toCredentialDetailsRow)({ object: item, subject: subject, issuer: issuer, branding: branding, parentKey: parentKey ? "".concat(parentKey, ".").concat(key) : key })];
|
|
166
179
|
case 2:
|
|
180
|
+
rows = _l.apply(_k, [_q.sent()]);
|
|
181
|
+
_q.label = 3;
|
|
182
|
+
case 3:
|
|
183
|
+
_j++;
|
|
184
|
+
return [3, 1];
|
|
185
|
+
case 4: return [3, 12];
|
|
186
|
+
case 5:
|
|
187
|
+
if (!(typeof value === 'object' && value !== null && value !== undefined)) return [3, 7];
|
|
188
|
+
_o = (_m = rows).concat;
|
|
189
|
+
return [4, (0, exports.toCredentialDetailsRow)({ object: value, subject: subject, issuer: issuer, branding: branding, parentKey: parentKey ? "".concat(parentKey, ".").concat(key) : key })];
|
|
190
|
+
case 6:
|
|
191
|
+
rows = _o.apply(_m, [_q.sent()]);
|
|
192
|
+
return [3, 12];
|
|
193
|
+
case 7:
|
|
167
194
|
if (key === '0' || value === undefined || value === null) {
|
|
168
195
|
return [2, "continue"];
|
|
169
196
|
}
|
|
170
|
-
label = (
|
|
197
|
+
label = (_g = (_f = branding === null || branding === void 0 ? void 0 : branding.find(function (claim) { return claim.key === (parentKey ? "".concat(parentKey, ".").concat(key) : key); })) === null || _f === void 0 ? void 0 : _f.name) !== null && _g !== void 0 ? _g : key;
|
|
171
198
|
if (key === 'id' && typeof value === 'string' && value.startsWith('did:')) {
|
|
172
199
|
label = 'subject';
|
|
173
200
|
}
|
|
@@ -176,37 +203,37 @@ var toCredentialDetailsRow = function (args) { return __awaiter(void 0, void 0,
|
|
|
176
203
|
value = findCorrelationIdName(value, contacts);
|
|
177
204
|
}
|
|
178
205
|
return [4, (0, utils_2.isImageAddress)(value)];
|
|
179
|
-
case
|
|
180
|
-
if (!(
|
|
206
|
+
case 8:
|
|
207
|
+
if (!(_q.sent())) return [3, 10];
|
|
181
208
|
return [4, getImageSize(value)];
|
|
182
|
-
case
|
|
183
|
-
|
|
184
|
-
return [3,
|
|
185
|
-
case
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
case
|
|
189
|
-
imageSize =
|
|
209
|
+
case 9:
|
|
210
|
+
_p = _q.sent();
|
|
211
|
+
return [3, 11];
|
|
212
|
+
case 10:
|
|
213
|
+
_p = undefined;
|
|
214
|
+
_q.label = 11;
|
|
215
|
+
case 11:
|
|
216
|
+
imageSize = _p;
|
|
190
217
|
rows.push({
|
|
191
218
|
id: (0, uuid_1.v4)(),
|
|
192
219
|
label: label,
|
|
193
220
|
value: value,
|
|
194
221
|
imageSize: imageSize
|
|
195
222
|
});
|
|
196
|
-
|
|
197
|
-
case
|
|
223
|
+
_q.label = 12;
|
|
224
|
+
case 12: return [2];
|
|
198
225
|
}
|
|
199
226
|
});
|
|
200
227
|
};
|
|
201
228
|
_i = 0, _b = Object.entries(object);
|
|
202
|
-
|
|
229
|
+
_h.label = 1;
|
|
203
230
|
case 1:
|
|
204
231
|
if (!(_i < _b.length)) return [3, 4];
|
|
205
232
|
_c = _b[_i], key = _c[0], value = _c[1];
|
|
206
233
|
return [5, _loop_1(key, value)];
|
|
207
234
|
case 2:
|
|
208
|
-
|
|
209
|
-
|
|
235
|
+
_h.sent();
|
|
236
|
+
_h.label = 3;
|
|
210
237
|
case 3:
|
|
211
238
|
_i++;
|
|
212
239
|
return [3, 1];
|
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.4.1-unstable.
|
|
4
|
+
"version": "0.4.1-unstable.160+9a3bad1",
|
|
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.34.1-feature.SSISDK.45.94",
|
|
32
32
|
"@sphereon/ssi-sdk.data-store": "0.34.1-feature.SSISDK.45.94",
|
|
33
33
|
"@sphereon/ssi-types": "0.34.1-feature.SSISDK.45.94",
|
|
34
|
-
"@sphereon/ui-components.core": "0.4.1-unstable.
|
|
34
|
+
"@sphereon/ui-components.core": "0.4.1-unstable.160+9a3bad1",
|
|
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.2"
|
|
53
53
|
},
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "9a3bad1ec0bc88f6102cdbb039cd4a20441144fd"
|
|
55
55
|
}
|