@sphereon/ui-components.credential-branding 0.2.1-unstable.8 → 0.2.1-unstable.87

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 CHANGED
@@ -6,13 +6,7 @@
6
6
  <br>
7
7
  </h1>
8
8
 
9
- ---
10
-
11
- **Warning: This package still is in every early development. Breaking changes without notice will happen at this point!**
12
-
13
- ---
14
-
15
- A UI Core package for shared logic / styling and localization between components related to Credential Branding
9
+ A UI Core package for shared logic between components related to Credential Branding
16
10
 
17
11
  ### Build
18
12
 
@@ -3,5 +3,17 @@ import { IBasicCredentialLocaleBranding, IBasicIssuerLocaleBranding, Party } fro
3
3
  import { ICredential } from '@sphereon/ssi-types';
4
4
  import { CredentialSummary, ISelectAppLocaleBrandingArgs } from '../types';
5
5
  export declare const toNonPersistedCredentialSummary: (verifiableCredential: ICredential | VerifiableCredential, branding?: Array<IBasicCredentialLocaleBranding>, issuer?: Party, subject?: Party) => Promise<CredentialSummary>;
6
+ export declare const getDate: (...dates: (number | string | undefined)[]) => number | undefined;
7
+ export declare const getCredentialDisplayName: ({ verifiableCredential, localeBranding, }: {
8
+ verifiableCredential: VerifiableCredential;
9
+ localeBranding?: IBasicCredentialLocaleBranding | undefined;
10
+ }) => string;
11
+ export declare const getCredentialIssuerNameAndAlias: ({ verifiableCredential, issuer, }: {
12
+ verifiableCredential: VerifiableCredential;
13
+ issuer?: Party | undefined;
14
+ }) => {
15
+ issuerAlias: string;
16
+ issuerName: string;
17
+ };
6
18
  export declare const toCredentialSummary: ({ hash, verifiableCredential }: UniqueVerifiableCredential, branding?: Array<IBasicCredentialLocaleBranding>, issuer?: Party, subject?: Party) => Promise<CredentialSummary>;
7
19
  export declare const selectAppLocaleBranding: (args: ISelectAppLocaleBrandingArgs) => Promise<IBasicCredentialLocaleBranding | IBasicIssuerLocaleBranding | undefined>;
@@ -0,0 +1,349 @@
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
14
+ if (k2 === undefined) k2 = k;
15
+ var desc = Object.getOwnPropertyDescriptor(m, k);
16
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
17
+ desc = { enumerable: true, get: function() { return m[k]; } };
18
+ }
19
+ Object.defineProperty(o, k2, desc);
20
+ }) : (function(o, m, k, k2) {
21
+ if (k2 === undefined) k2 = k;
22
+ o[k2] = m[k];
23
+ }));
24
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
25
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
26
+ }) : function(o, v) {
27
+ o["default"] = v;
28
+ });
29
+ var __importStar = (this && this.__importStar) || function (mod) {
30
+ if (mod && mod.__esModule) return mod;
31
+ var result = {};
32
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
33
+ __setModuleDefault(result, mod);
34
+ return result;
35
+ };
36
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
37
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
38
+ return new (P || (P = Promise))(function (resolve, reject) {
39
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
40
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
41
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
42
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
43
+ });
44
+ };
45
+ var __generator = (this && this.__generator) || function (thisArg, body) {
46
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
47
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
48
+ function verb(n) { return function (v) { return step([n, v]); }; }
49
+ function step(op) {
50
+ if (f) throw new TypeError("Generator is already executing.");
51
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
52
+ 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;
53
+ if (y = 0, t) op = [op[0] & 2, t.value];
54
+ switch (op[0]) {
55
+ case 0: case 1: t = op; break;
56
+ case 4: _.label++; return { value: op[1], done: false };
57
+ case 5: _.label++; y = op[1]; op = [0]; continue;
58
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
59
+ default:
60
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
61
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
62
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
63
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
64
+ if (t[2]) _.ops.pop();
65
+ _.trys.pop(); continue;
66
+ }
67
+ op = body.call(thisArg, _);
68
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
69
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
70
+ }
71
+ };
72
+ var __rest = (this && this.__rest) || function (s, e) {
73
+ var t = {};
74
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
75
+ t[p] = s[p];
76
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
77
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
78
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
79
+ t[p[i]] = s[p[i]];
80
+ }
81
+ return t;
82
+ };
83
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
84
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
85
+ if (ar || !(i in from)) {
86
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
87
+ ar[i] = from[i];
88
+ }
89
+ }
90
+ return to.concat(ar || Array.prototype.slice.call(from));
91
+ };
92
+ exports.__esModule = true;
93
+ exports.selectAppLocaleBranding = exports.toCredentialSummary = exports.getCredentialIssuerNameAndAlias = exports.getCredentialDisplayName = exports.getDate = exports.toNonPersistedCredentialSummary = void 0;
94
+ var uuid_1 = require("uuid");
95
+ var utils_1 = require("@veramo/utils");
96
+ var ui_components_core_1 = require("@sphereon/ui-components.core");
97
+ var ssi_sdk_core_1 = require("@sphereon/ssi-sdk.core");
98
+ var utils_2 = require("../utils");
99
+ function findCorrelationIdName(correlationId, parties, activeUser) {
100
+ var _a, _b;
101
+ var allParties = parties;
102
+ if (activeUser) {
103
+ parties.push(activeUser);
104
+ }
105
+ return ((_b = (_a = allParties.find(function (contact) { return contact.identities.some(function (identity) { return identity.identifier.correlationId === correlationId; }); })) === null || _a === void 0 ? void 0 : _a.contact.displayName) !== null && _b !== void 0 ? _b : correlationId);
106
+ }
107
+ var toCredentialDetailsRow = function (object, subject, issuer) { return __awaiter(void 0, void 0, void 0, function () {
108
+ var rows, _i, _a, _b, key, value, image, _c, _d, _e, _f, _g, _h, label, contacts, _j, _k, _l, _m;
109
+ var _o, _p;
110
+ return __generator(this, function (_q) {
111
+ switch (_q.label) {
112
+ case 0:
113
+ rows = [];
114
+ _i = 0, _a = Object.entries(object);
115
+ _q.label = 1;
116
+ case 1:
117
+ if (!(_i < _a.length)) return [3, 17];
118
+ _b = _a[_i], key = _b[0], value = _b[1];
119
+ if (!key.toLowerCase().includes('image')) return [3, 7];
120
+ image = typeof value === 'string' ? value : value.id;
121
+ _d = (_c = rows).push;
122
+ _o = {
123
+ id: (0, uuid_1.v4)(),
124
+ label: 'image',
125
+ value: image
126
+ };
127
+ return [4, (0, utils_2.isImageAddress)(image)];
128
+ case 2:
129
+ if (!(_q.sent())) return [3, 5];
130
+ _f = ssi_sdk_core_1.getImageDimensions;
131
+ return [4, (0, ssi_sdk_core_1.downloadImage)(image)];
132
+ case 3: return [4, _f.apply(void 0, [(_q.sent()).base64Content])];
133
+ case 4:
134
+ _e = _q.sent();
135
+ return [3, 6];
136
+ case 5:
137
+ _e = undefined;
138
+ _q.label = 6;
139
+ case 6:
140
+ _d.apply(_c, [(_o.imageSize = _e,
141
+ _o)]);
142
+ return [3, 16];
143
+ case 7:
144
+ if (key === 'type') {
145
+ rows.push({
146
+ id: (0, uuid_1.v4)(),
147
+ label: key,
148
+ value: value
149
+ });
150
+ return [3, 16];
151
+ }
152
+ _q.label = 8;
153
+ case 8:
154
+ if (!(typeof value !== 'string')) return [3, 10];
155
+ _h = (_g = rows).concat;
156
+ return [4, toCredentialDetailsRow(value, subject, issuer)];
157
+ case 9:
158
+ rows = _h.apply(_g, [_q.sent()]);
159
+ return [3, 16];
160
+ case 10:
161
+ if (key === '0' || value === undefined) {
162
+ return [3, 16];
163
+ }
164
+ label = key;
165
+ if (key === 'id' && value.startsWith('did:')) {
166
+ label = 'subject';
167
+ }
168
+ if (value.startsWith('did:')) {
169
+ contacts = __spreadArray(__spreadArray([], (issuer ? [issuer] : []), true), (subject ? [subject] : []), true);
170
+ value = findCorrelationIdName(value, contacts);
171
+ }
172
+ _k = (_j = rows).push;
173
+ _p = {
174
+ id: (0, uuid_1.v4)(),
175
+ label: label,
176
+ value: value
177
+ };
178
+ return [4, (0, utils_2.isImageAddress)(value)];
179
+ case 11:
180
+ if (!(_q.sent())) return [3, 14];
181
+ _m = ssi_sdk_core_1.getImageDimensions;
182
+ return [4, (0, ssi_sdk_core_1.downloadImage)(value)];
183
+ case 12: return [4, _m.apply(void 0, [(_q.sent()).base64Content])];
184
+ case 13:
185
+ _l = _q.sent();
186
+ return [3, 15];
187
+ case 14:
188
+ _l = undefined;
189
+ _q.label = 15;
190
+ case 15:
191
+ _k.apply(_j, [(_p.imageSize = _l,
192
+ _p)]);
193
+ _q.label = 16;
194
+ case 16:
195
+ _i++;
196
+ return [3, 1];
197
+ case 17: return [2, rows];
198
+ }
199
+ });
200
+ }); };
201
+ var toNonPersistedCredentialSummary = function (verifiableCredential, branding, issuer, subject) {
202
+ return (0, exports.toCredentialSummary)({
203
+ verifiableCredential: verifiableCredential,
204
+ hash: (0, utils_1.computeEntryHash)(verifiableCredential)
205
+ }, branding, issuer, subject);
206
+ };
207
+ exports.toNonPersistedCredentialSummary = toNonPersistedCredentialSummary;
208
+ var getDate = function () {
209
+ var dates = [];
210
+ for (var _i = 0; _i < arguments.length; _i++) {
211
+ dates[_i] = arguments[_i];
212
+ }
213
+ var date = dates.find(function (date) { return date !== null && date !== undefined; });
214
+ if (!date) {
215
+ return;
216
+ }
217
+ else if (typeof date === 'number') {
218
+ return date;
219
+ }
220
+ return Math.round(new Date(date + '').valueOf() / ui_components_core_1.EPOCH_MILLISECONDS);
221
+ };
222
+ exports.getDate = getDate;
223
+ var getCredentialDisplayName = function (_a) {
224
+ var _b, _c;
225
+ var verifiableCredential = _a.verifiableCredential, localeBranding = _a.localeBranding;
226
+ var title = (_c = (_b = localeBranding === null || localeBranding === void 0 ? void 0 : localeBranding.alias) !== null && _b !== void 0 ? _b : verifiableCredential.name) !== null && _c !== void 0 ? _c : (!verifiableCredential.type ? 'unknown' : undefined);
227
+ if (verifiableCredential.type) {
228
+ var types = (0, utils_1.asArray)(verifiableCredential.type).filter(function (val) { return val !== 'VerifiableCredential'; });
229
+ if (types.length === 1) {
230
+ title = types[0];
231
+ }
232
+ else if (types.length > 1) {
233
+ title = types.join(', ');
234
+ }
235
+ }
236
+ if (!title) {
237
+ title = 'Credential';
238
+ }
239
+ return title;
240
+ };
241
+ exports.getCredentialDisplayName = getCredentialDisplayName;
242
+ var getCredentialIssuerNameAndAlias = function (_a) {
243
+ var _b;
244
+ var verifiableCredential = _a.verifiableCredential, issuer = _a.issuer;
245
+ var issuerName = typeof verifiableCredential.issuer === 'string' ? verifiableCredential.issuer : (_b = verifiableCredential.issuer) === null || _b === void 0 ? void 0 : _b.id;
246
+ var issuerAlias = undefined;
247
+ if (typeof (verifiableCredential === null || verifiableCredential === void 0 ? void 0 : verifiableCredential.issuer) === 'object') {
248
+ issuerAlias = verifiableCredential.issuer.name;
249
+ }
250
+ if (!issuerAlias && issuer) {
251
+ issuerAlias = issuer.contact.displayName;
252
+ }
253
+ if (!issuerAlias) {
254
+ issuerAlias = issuerName;
255
+ }
256
+ return { issuerName: issuerName, issuerAlias: issuerAlias };
257
+ };
258
+ exports.getCredentialIssuerNameAndAlias = getCredentialIssuerNameAndAlias;
259
+ var getTermsOfUse = function (_a) {
260
+ var verifiableCredential = _a.verifiableCredential;
261
+ if (!verifiableCredential.termsOfUse) {
262
+ return;
263
+ }
264
+ var termsOfUse = (0, utils_1.asArray)(verifiableCredential.termsOfUse);
265
+ return termsOfUse.map(function (tou) {
266
+ var _a;
267
+ var type = tou.type, id = tou.id, rest = __rest(tou, ["type", "id"]);
268
+ return __assign((_a = {}, _a[type] = id, _a), rest);
269
+ });
270
+ };
271
+ var toCredentialSummary = function (_a, branding, issuer, subject) {
272
+ var hash = _a.hash, verifiableCredential = _a.verifiableCredential;
273
+ return __awaiter(void 0, void 0, void 0, function () {
274
+ var expirationDate, issueDate, localeBranding, credentialStatus, title, properties, logo, url, _b, issuerName, issuerAlias, termsOfUse;
275
+ var _c, _d;
276
+ return __generator(this, function (_e) {
277
+ switch (_e.label) {
278
+ case 0:
279
+ expirationDate = (_c = (0, exports.getDate)(verifiableCredential.expirationDate, verifiableCredential.validTo, verifiableCredential.exp)) !== null && _c !== void 0 ? _c : 0;
280
+ issueDate = (0, exports.getDate)(verifiableCredential.issuanceDate, verifiableCredential.validFrom, verifiableCredential.nbf, verifiableCredential.iat);
281
+ return [4, (0, exports.selectAppLocaleBranding)({ localeBranding: branding })];
282
+ case 1:
283
+ localeBranding = _e.sent();
284
+ credentialStatus = (0, utils_2.getCredentialStatus)(verifiableCredential);
285
+ title = (0, exports.getCredentialDisplayName)({ verifiableCredential: verifiableCredential, localeBranding: localeBranding });
286
+ return [4, toCredentialDetailsRow(__assign(__assign({}, (_d = verifiableCredential.vc) === null || _d === void 0 ? void 0 : _d.credentialSubject), verifiableCredential.credentialSubject), subject, issuer)];
287
+ case 2:
288
+ properties = _e.sent();
289
+ logo = (0, utils_2.getIssuerLogo)(verifiableCredential, localeBranding);
290
+ url = typeof verifiableCredential.issuer !== 'string' ? verifiableCredential.issuer.url : undefined;
291
+ _b = (0, exports.getCredentialIssuerNameAndAlias)({ verifiableCredential: verifiableCredential, issuer: issuer }), issuerName = _b.issuerName, issuerAlias = _b.issuerAlias;
292
+ termsOfUse = getTermsOfUse({ verifiableCredential: verifiableCredential });
293
+ return [2, {
294
+ hash: hash,
295
+ id: verifiableCredential.id,
296
+ title: title,
297
+ credentialStatus: credentialStatus,
298
+ issueDate: issueDate,
299
+ expirationDate: expirationDate,
300
+ properties: properties,
301
+ branding: localeBranding,
302
+ termsOfUse: termsOfUse,
303
+ issuer: {
304
+ name: issuerName,
305
+ alias: issuerAlias ? (issuerAlias.length > 50 ? "".concat(issuerAlias.substring(0, 50), "...") : issuerAlias) : '',
306
+ image: logo,
307
+ url: url
308
+ }
309
+ }];
310
+ }
311
+ });
312
+ });
313
+ };
314
+ exports.toCredentialSummary = toCredentialSummary;
315
+ var selectAppLocaleBranding = function (args) { return __awaiter(void 0, void 0, void 0, function () {
316
+ var appLocale, localeBranding, logo, imagePreloader, ReactNativeImagePreloader, WebImagePreloader, backgroundImage;
317
+ var _a, _b, _c, _d, _e, _f, _g;
318
+ return __generator(this, function (_h) {
319
+ switch (_h.label) {
320
+ case 0:
321
+ appLocale = ui_components_core_1.Localization.getLocale();
322
+ localeBranding = (_a = args.localeBranding) === null || _a === void 0 ? void 0 : _a.find(function (branding) { var _a; return ((_a = branding.locale) === null || _a === void 0 ? void 0 : _a.startsWith(appLocale)) || branding.locale === undefined; });
323
+ logo = ((_b = localeBranding === null || localeBranding === void 0 ? void 0 : localeBranding.logo) === null || _b === void 0 ? void 0 : _b.dataUri) || ((_c = localeBranding === null || localeBranding === void 0 ? void 0 : localeBranding.logo) === null || _c === void 0 ? void 0 : _c.uri);
324
+ if (!(typeof window === 'undefined')) return [3, 2];
325
+ return [4, Promise.resolve().then(function () { return __importStar(require('../services/ReactNativeImagePreloader')); })];
326
+ case 1:
327
+ ReactNativeImagePreloader = (_h.sent()).ReactNativeImagePreloader;
328
+ imagePreloader = new ReactNativeImagePreloader();
329
+ return [3, 4];
330
+ case 2: return [4, Promise.resolve().then(function () { return __importStar(require('../services/WebImagePreloader')); })];
331
+ case 3:
332
+ WebImagePreloader = (_h.sent()).WebImagePreloader;
333
+ imagePreloader = new WebImagePreloader();
334
+ _h.label = 4;
335
+ case 4:
336
+ if (logo) {
337
+ imagePreloader.preload([{ uri: logo }])["catch"](function () {
338
+ });
339
+ }
340
+ backgroundImage = ((_e = (_d = localeBranding === null || localeBranding === void 0 ? void 0 : localeBranding.background) === null || _d === void 0 ? void 0 : _d.image) === null || _e === void 0 ? void 0 : _e.dataUri) || ((_g = (_f = localeBranding === null || localeBranding === void 0 ? void 0 : localeBranding.background) === null || _f === void 0 ? void 0 : _f.image) === null || _g === void 0 ? void 0 : _g.uri);
341
+ if (backgroundImage) {
342
+ imagePreloader.preload([{ uri: backgroundImage }])["catch"](function () {
343
+ });
344
+ }
345
+ return [2, localeBranding];
346
+ }
347
+ });
348
+ }); };
349
+ exports.selectAppLocaleBranding = selectAppLocaleBranding;
@@ -0,0 +1 @@
1
+ export * from './CredentialDetails';
@@ -14,4 +14,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  exports.__esModule = true;
17
- __exportStar(require("./CredentialMapper"), exports);
17
+ __exportStar(require("./CredentialDetails"), exports);
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export * from './mapping';
1
+ export * from './details';
2
2
  export * from './services';
3
3
  export * from './types';
4
4
  export * from './utils';
package/dist/index.js CHANGED
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  exports.__esModule = true;
17
- __exportStar(require("./mapping"), exports);
17
+ __exportStar(require("./details"), exports);
18
18
  __exportStar(require("./services"), exports);
19
19
  __exportStar(require("./types"), exports);
20
20
  __exportStar(require("./utils"), exports);
@@ -37,15 +37,28 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
37
37
  };
38
38
  exports.__esModule = true;
39
39
  exports.ReactNativeImagePreloader = void 0;
40
- var FastImage = require('react-native-fast-image');
41
40
  var ReactNativeImagePreloader = (function () {
42
41
  function ReactNativeImagePreloader() {
43
42
  }
44
43
  ReactNativeImagePreloader.prototype.preload = function (sources) {
45
44
  return __awaiter(this, void 0, void 0, function () {
45
+ var promises;
46
46
  return __generator(this, function (_a) {
47
- FastImage.preload(sources);
48
- return [2];
47
+ switch (_a.label) {
48
+ case 0:
49
+ promises = sources.map(function (source) {
50
+ return new Promise(function (resolve, reject) {
51
+ var img = new Image();
52
+ img.src = source.uri;
53
+ img.onload = function () { return resolve(); };
54
+ img.onerror = function (error) { return reject(error); };
55
+ });
56
+ });
57
+ return [4, Promise.all(promises)];
58
+ case 1:
59
+ _a.sent();
60
+ return [2];
61
+ }
49
62
  });
50
63
  });
51
64
  };
@@ -1,3 +1 @@
1
- export * from './WebImagePreloader';
2
1
  export * from './IPreloadImage';
3
- export * from './ReactNativeImagePreloader';
@@ -14,6 +14,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  exports.__esModule = true;
17
- __exportStar(require("./WebImagePreloader"), exports);
18
17
  __exportStar(require("./IPreloadImage"), exports);
19
- __exportStar(require("./ReactNativeImagePreloader"), exports);
@@ -9,6 +9,9 @@ export type CredentialSummary = {
9
9
  issueDate: number;
10
10
  expirationDate: number;
11
11
  properties: CredentialDetailsRow[];
12
+ termsOfUse?: Array<Record<string, any> & {
13
+ type?: string;
14
+ }>;
12
15
  branding?: IBasicCredentialLocaleBranding;
13
16
  };
14
17
  export type IssuerSummary = {
@@ -40,7 +40,7 @@ exports.getImageFromObjectOrString = exports.getIssuerLogo = exports.isImageAddr
40
40
  var ui_components_core_1 = require("@sphereon/ui-components.core");
41
41
  var isImageAddress = function (value) { return __awaiter(void 0, void 0, void 0, function () {
42
42
  return __generator(this, function (_a) {
43
- return [2, ui_components_core_1.IS_IMAGE_URI_REGEX.test(value) || ui_components_core_1.IS_IMAGE_URL_REGEX.test(value)];
43
+ return [2, ui_components_core_1.IS_IMAGE_URI_REGEX.test(value) || ui_components_core_1.IS_IMAGE_FILE_EXTENSION_REGEX.test(value)];
44
44
  });
45
45
  }); };
46
46
  exports.isImageAddress = isImageAddress;
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@sphereon/ui-components.credential-branding",
3
3
  "private": false,
4
- "version": "0.2.1-unstable.8+97f28d8",
5
- "description": "SSI UI components credential Branding",
4
+ "version": "0.2.1-unstable.87+6894ab8",
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>",
8
8
  "license": "Apache-2.0",
@@ -28,10 +28,10 @@
28
28
  "access": "public"
29
29
  },
30
30
  "dependencies": {
31
- "@sphereon/ssi-sdk.core": "0.23.5-unstable.74+9c3c2083",
32
- "@sphereon/ssi-sdk.data-store": "0.23.5-unstable.74+9c3c2083",
33
- "@sphereon/ssi-types": "0.23.5-unstable.74+9c3c2083",
34
- "@sphereon/ui-components.core": "0.2.1-unstable.8+97f28d8",
31
+ "@sphereon/ssi-sdk.core": "^0.28.0",
32
+ "@sphereon/ssi-sdk.data-store": "^0.28.0",
33
+ "@sphereon/ssi-types": "^0.28.0",
34
+ "@sphereon/ui-components.core": "0.2.1-unstable.87+6894ab8",
35
35
  "@veramo/core": "4.2.0",
36
36
  "@veramo/utils": "4.2.0",
37
37
  "i18n-js": "^3.8.0",
@@ -40,7 +40,7 @@
40
40
  "devDependencies": {
41
41
  "@types/i18n-js": "^3.8.4",
42
42
  "@types/node": "^20.4.0",
43
- "@types/react": "~18.2.67",
43
+ "@types/react": "~18.2.79",
44
44
  "@types/uuid": "^9.0.8",
45
45
  "react": "18.2.0",
46
46
  "typescript": "4.9.5"
@@ -48,5 +48,5 @@
48
48
  "peerDependencies": {
49
49
  "react": ">= 18"
50
50
  },
51
- "gitHead": "97f28d8d19895339b6834e6fc793d774ecce88ae"
51
+ "gitHead": "6894ab8498cb051bfdaf85973cb44e3f419956ce"
52
52
  }