@sphereon/ui-components.credential-branding 0.2.1-unstable.44 → 0.2.1-unstable.46
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
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
<h1 align="center">
|
|
3
3
|
<br>
|
|
4
4
|
<a href="https://www.sphereon.com"><img src="https://sphereon.com/content/themes/sphereon/assets/img/logo.svg" alt="Sphereon" width="400"></a>
|
|
5
|
-
<br>UI Components Credential
|
|
5
|
+
<br>UI Components Credential Branding (Typescript)
|
|
6
6
|
<br>
|
|
7
7
|
</h1>
|
|
8
8
|
|
|
9
|
-
A UI Core package for shared logic between components related to Credential Branding
|
|
9
|
+
A UI Core package for shared logic / styling and localization between components related to Credential Branding
|
|
10
10
|
|
|
11
11
|
### Build
|
|
12
12
|
|
|
@@ -17,5 +17,5 @@ pnpm build
|
|
|
17
17
|
### Installation
|
|
18
18
|
|
|
19
19
|
```shell
|
|
20
|
-
pnpm install @sphereon/ui-components.credential-
|
|
20
|
+
pnpm install @sphereon/ui-components.credential-branding
|
|
21
21
|
```
|
|
@@ -1,27 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
3
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
4
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -73,6 +50,7 @@ var uuid_1 = require("uuid");
|
|
|
73
50
|
var utils_1 = require("@veramo/utils");
|
|
74
51
|
var ui_components_core_1 = require("@sphereon/ui-components.core");
|
|
75
52
|
var ssi_sdk_core_1 = require("@sphereon/ssi-sdk.core");
|
|
53
|
+
var services_1 = require("../services");
|
|
76
54
|
var utils_2 = require("../utils");
|
|
77
55
|
function findCorrelationIdName(correlationId, contacts) {
|
|
78
56
|
var contact = contacts.find(function (contact) {
|
|
@@ -248,37 +226,28 @@ var toCredentialSummary = function (_a, branding, issuer, subject) {
|
|
|
248
226
|
};
|
|
249
227
|
exports.toCredentialSummary = toCredentialSummary;
|
|
250
228
|
var selectAppLocaleBranding = function (args) { return __awaiter(void 0, void 0, void 0, function () {
|
|
251
|
-
var appLocale, localeBranding, logo, imagePreloader,
|
|
229
|
+
var appLocale, localeBranding, logo, imagePreloader, backgroundImage;
|
|
252
230
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
253
231
|
return __generator(this, function (_h) {
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
if (logo) {
|
|
272
|
-
imagePreloader.preload([{ uri: logo }])["catch"](function () {
|
|
273
|
-
});
|
|
274
|
-
}
|
|
275
|
-
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);
|
|
276
|
-
if (backgroundImage) {
|
|
277
|
-
imagePreloader.preload([{ uri: backgroundImage }])["catch"](function () {
|
|
278
|
-
});
|
|
279
|
-
}
|
|
280
|
-
return [2, localeBranding];
|
|
232
|
+
appLocale = ui_components_core_1.Localization.getLocale();
|
|
233
|
+
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; });
|
|
234
|
+
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);
|
|
235
|
+
if (typeof navigator !== 'undefined' && navigator.product === 'ReactNative') {
|
|
236
|
+
imagePreloader = new services_1.ReactNativeImagePreloader();
|
|
237
|
+
}
|
|
238
|
+
else {
|
|
239
|
+
imagePreloader = new services_1.WebImagePreloader();
|
|
240
|
+
}
|
|
241
|
+
if (logo) {
|
|
242
|
+
imagePreloader.preload([{ uri: logo }])["catch"](function () {
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
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);
|
|
246
|
+
if (backgroundImage) {
|
|
247
|
+
imagePreloader.preload([{ uri: backgroundImage }])["catch"](function () {
|
|
248
|
+
});
|
|
281
249
|
}
|
|
250
|
+
return [2, localeBranding];
|
|
282
251
|
});
|
|
283
252
|
}); };
|
|
284
253
|
exports.selectAppLocaleBranding = selectAppLocaleBranding;
|
|
@@ -42,23 +42,8 @@ var ReactNativeImagePreloader = (function () {
|
|
|
42
42
|
}
|
|
43
43
|
ReactNativeImagePreloader.prototype.preload = function (sources) {
|
|
44
44
|
return __awaiter(this, void 0, void 0, function () {
|
|
45
|
-
var promises;
|
|
46
45
|
return __generator(this, function (_a) {
|
|
47
|
-
|
|
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
|
-
}
|
|
46
|
+
return [2];
|
|
62
47
|
});
|
|
63
48
|
});
|
|
64
49
|
};
|
package/dist/services/index.d.ts
CHANGED
package/dist/services/index.js
CHANGED
|
@@ -14,4 +14,6 @@ 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);
|
|
17
18
|
__exportStar(require("./IPreloadImage"), exports);
|
|
19
|
+
__exportStar(require("./ReactNativeImagePreloader"), exports);
|
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.
|
|
5
|
-
"description": "SSI UI components credential
|
|
4
|
+
"version": "0.2.1-unstable.46+26c17d2",
|
|
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",
|
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
"Frontend",
|
|
11
11
|
"User interface",
|
|
12
12
|
"Self-sovereign identity (SSI)",
|
|
13
|
-
"Credential mapper",
|
|
14
13
|
"Credential branding"
|
|
15
14
|
],
|
|
16
15
|
"scripts": {
|
|
@@ -29,10 +28,10 @@
|
|
|
29
28
|
"access": "public"
|
|
30
29
|
},
|
|
31
30
|
"dependencies": {
|
|
32
|
-
"@sphereon/ssi-sdk.core": "0.
|
|
33
|
-
"@sphereon/ssi-sdk.data-store": "0.
|
|
34
|
-
"@sphereon/ssi-types": "0.
|
|
35
|
-
"@sphereon/ui-components.core": "0.2.1-unstable.
|
|
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.46+26c17d2",
|
|
36
35
|
"@veramo/core": "4.2.0",
|
|
37
36
|
"@veramo/utils": "4.2.0",
|
|
38
37
|
"i18n-js": "^3.8.0",
|
|
@@ -49,5 +48,5 @@
|
|
|
49
48
|
"peerDependencies": {
|
|
50
49
|
"react": ">= 18"
|
|
51
50
|
},
|
|
52
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "26c17d23568ff3cc37e627e01ad36ae9b3bde6c2"
|
|
53
52
|
}
|