@sphereon/ui-components.credential-branding 0.4.1-unstable.160 → 0.4.1-unstable.162

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.
@@ -142,7 +142,7 @@ 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 primitiveItems, objectItems, label, _j, objectItems_1, item, _k, _l, _m, _o, label, contacts, imageSize, _p;
145
+ var label, items, isFirst, _j, items_1, item, _k, _l, _m, _o, label, contacts, imageSize, _p;
146
146
  return __generator(this, function (_q) {
147
147
  switch (_q.label) {
148
148
  case 0:
@@ -157,40 +157,43 @@ var toCredentialDetailsRow = function (args) { return __awaiter(void 0, void 0,
157
157
  });
158
158
  return [2, "continue"];
159
159
  }
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; });
160
+ if (!Array.isArray(value)) return [3, 7];
163
161
  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;
162
+ items = value.filter(function (item) { return item !== undefined && item !== null; });
163
+ isFirst = true;
164
+ _j = 0, items_1 = items;
173
165
  _q.label = 1;
174
166
  case 1:
175
- if (!(_j < objectItems_1.length)) return [3, 4];
176
- item = objectItems_1[_j];
167
+ if (!(_j < items_1.length)) return [3, 6];
168
+ item = items_1[_j];
169
+ if (!(typeof item === 'object')) return [3, 3];
177
170
  _l = (_k = rows).concat;
178
171
  return [4, (0, exports.toCredentialDetailsRow)({ object: item, subject: subject, issuer: issuer, branding: branding, parentKey: parentKey ? "".concat(parentKey, ".").concat(key) : key })];
179
172
  case 2:
180
173
  rows = _l.apply(_k, [_q.sent()]);
181
- _q.label = 3;
174
+ return [3, 4];
182
175
  case 3:
176
+ rows.push({
177
+ id: (0, uuid_1.v4)(),
178
+ label: isFirst ? label : '',
179
+ value: " ".concat(item)
180
+ });
181
+ _q.label = 4;
182
+ case 4:
183
+ isFirst = false;
184
+ _q.label = 5;
185
+ case 5:
183
186
  _j++;
184
187
  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
+ case 6: return [3, 14];
189
+ case 7:
190
+ if (!(typeof value === 'object' && value !== null && value !== undefined)) return [3, 9];
188
191
  _o = (_m = rows).concat;
189
192
  return [4, (0, exports.toCredentialDetailsRow)({ object: value, subject: subject, issuer: issuer, branding: branding, parentKey: parentKey ? "".concat(parentKey, ".").concat(key) : key })];
190
- case 6:
193
+ case 8:
191
194
  rows = _o.apply(_m, [_q.sent()]);
192
- return [3, 12];
193
- case 7:
195
+ return [3, 14];
196
+ case 9:
194
197
  if (key === '0' || value === undefined || value === null) {
195
198
  return [2, "continue"];
196
199
  }
@@ -203,16 +206,16 @@ var toCredentialDetailsRow = function (args) { return __awaiter(void 0, void 0,
203
206
  value = findCorrelationIdName(value, contacts);
204
207
  }
205
208
  return [4, (0, utils_2.isImageAddress)(value)];
206
- case 8:
207
- if (!(_q.sent())) return [3, 10];
209
+ case 10:
210
+ if (!(_q.sent())) return [3, 12];
208
211
  return [4, getImageSize(value)];
209
- case 9:
212
+ case 11:
210
213
  _p = _q.sent();
211
- return [3, 11];
212
- case 10:
214
+ return [3, 13];
215
+ case 12:
213
216
  _p = undefined;
214
- _q.label = 11;
215
- case 11:
217
+ _q.label = 13;
218
+ case 13:
216
219
  imageSize = _p;
217
220
  rows.push({
218
221
  id: (0, uuid_1.v4)(),
@@ -220,8 +223,8 @@ var toCredentialDetailsRow = function (args) { return __awaiter(void 0, void 0,
220
223
  value: value,
221
224
  imageSize: imageSize
222
225
  });
223
- _q.label = 12;
224
- case 12: return [2];
226
+ _q.label = 14;
227
+ case 14: return [2];
225
228
  }
226
229
  });
227
230
  };
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.160+9a3bad1",
4
+ "version": "0.4.1-unstable.162+3efcf7b",
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.160+9a3bad1",
34
+ "@sphereon/ui-components.core": "0.4.1-unstable.162+3efcf7b",
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": "9a3bad1ec0bc88f6102cdbb039cd4a20441144fd"
54
+ "gitHead": "3efcf7bdcfb7c5974c572d59fa3274ae3069410c"
55
55
  }