@cloudparse/up-miniapps-sdk 0.2.2 → 0.2.5
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/dist/index.browser.min.js +7 -7
- package/dist/index.browser.min.js.map +1 -1
- package/dist/index.cjs +27 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +14 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.js +27 -4
- package/dist/index.js.map +1 -1
- package/dist/style.css +26 -39
- package/package.json +22 -19
package/dist/index.cjs
CHANGED
|
@@ -2704,7 +2704,10 @@ var MapInternal = ({
|
|
|
2704
2704
|
return Math.ceil(routeDurationSeconds * ratio / 60);
|
|
2705
2705
|
})();
|
|
2706
2706
|
const kmRemaining = remainingMeters / 1e3;
|
|
2707
|
-
const progressValue = totalDist && totalDist > 0 ? Math.min(
|
|
2707
|
+
const progressValue = totalDist && totalDist > 0 ? Math.min(
|
|
2708
|
+
100,
|
|
2709
|
+
Math.max(0, (totalDist - remainingMeters) / totalDist * 100)
|
|
2710
|
+
) : 0;
|
|
2708
2711
|
const showEtaData = navigationData && route ? {
|
|
2709
2712
|
distanceRemainingKm: kmRemaining,
|
|
2710
2713
|
etaMins,
|
|
@@ -3144,7 +3147,7 @@ var RoutingService = {
|
|
|
3144
3147
|
};
|
|
3145
3148
|
|
|
3146
3149
|
// package.json
|
|
3147
|
-
var version = "0.2.
|
|
3150
|
+
var version = "0.2.5";
|
|
3148
3151
|
|
|
3149
3152
|
// src/sdk.ts
|
|
3150
3153
|
function deepFreeze(obj) {
|
|
@@ -3230,7 +3233,14 @@ var MiniAppSDK = class {
|
|
|
3230
3233
|
* Fetch user profile data.
|
|
3231
3234
|
* @param fields Optional list of specific fields to retrieve (e.g., ['fullName', 'username']).
|
|
3232
3235
|
*/
|
|
3233
|
-
getProfile: (fields) => this.bridge.send("GET_USER_PROFILE", { fields })
|
|
3236
|
+
getProfile: (fields) => this.bridge.send("GET_USER_PROFILE", { fields }),
|
|
3237
|
+
/**
|
|
3238
|
+
* Fetch profile picture as a string of the current user, or a map of profile pictures from a list of user UUIDs.
|
|
3239
|
+
* @param uuids Optional list of user UUIDs.
|
|
3240
|
+
*/
|
|
3241
|
+
getProfilePicture: ((uuids) => {
|
|
3242
|
+
return this.bridge.send("GET_PROFILE_PICTURE", { uuids: uuids || [] });
|
|
3243
|
+
})
|
|
3234
3244
|
});
|
|
3235
3245
|
/**
|
|
3236
3246
|
* Explicit Permission Management.
|
|
@@ -3748,6 +3758,19 @@ var BridgeMocker = ({
|
|
|
3748
3758
|
uuid: "mock-user-42"
|
|
3749
3759
|
});
|
|
3750
3760
|
}
|
|
3761
|
+
if (type === "GET_PROFILE_PICTURE") {
|
|
3762
|
+
const uuids = payload?.uuids || [];
|
|
3763
|
+
if (uuids.length === 0) {
|
|
3764
|
+
return Promise.resolve(
|
|
3765
|
+
`https://api.dicebear.com/9.x/rings/png?seed=dummy`
|
|
3766
|
+
);
|
|
3767
|
+
}
|
|
3768
|
+
const map = {};
|
|
3769
|
+
for (const uuid of uuids) {
|
|
3770
|
+
map[uuid] = `https://api.dicebear.com/9.x/rings/png?seed=${uuid}`;
|
|
3771
|
+
}
|
|
3772
|
+
return Promise.resolve(map);
|
|
3773
|
+
}
|
|
3751
3774
|
if (type === "GET_FIDELITY_BALANCE") {
|
|
3752
3775
|
return Promise.resolve({ balance: 1337, currency: "FPoints" });
|
|
3753
3776
|
}
|
|
@@ -4084,7 +4107,7 @@ var SDKProvider = ({
|
|
|
4084
4107
|
const value = (0, import_react13.useMemo)(() => ({ isMocked }), [isMocked]);
|
|
4085
4108
|
const content = /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, { children: [
|
|
4086
4109
|
children,
|
|
4087
|
-
debug && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(DebugConsole, {})
|
|
4110
|
+
(debug || isMocked) && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(DebugConsole, {})
|
|
4088
4111
|
] });
|
|
4089
4112
|
if (isMocked) {
|
|
4090
4113
|
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(SDKContext.Provider, { value, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(BridgeMocker, { ...mockerProps, children: content }) });
|