@series-inc/venus-sdk 3.1.2 → 3.2.0
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/{AdsApi-CNGRf6j0.d.mts → AdsApi-DFutZ7_q.d.mts} +501 -293
- package/dist/{AdsApi-CNGRf6j0.d.ts → AdsApi-DFutZ7_q.d.ts} +501 -293
- package/dist/{chunk-PXWCNWJ6.mjs → chunk-AGXMORDL.mjs} +1442 -1586
- package/dist/chunk-AGXMORDL.mjs.map +1 -0
- package/dist/chunk-NSSMTXJJ.mjs +7 -0
- package/dist/chunk-NSSMTXJJ.mjs.map +1 -0
- package/dist/{chunk-W7IPHM67.mjs → chunk-QABXMFND.mjs} +3 -26
- package/dist/chunk-QABXMFND.mjs.map +1 -0
- package/dist/chunk-UXY5CKKG.mjs +12 -0
- package/dist/chunk-UXY5CKKG.mjs.map +1 -0
- package/dist/core-62LWDHN7.mjs +4 -0
- package/dist/{core-R3FHW62G.mjs.map → core-62LWDHN7.mjs.map} +1 -1
- package/dist/index.cjs +1461 -1585
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +280 -92
- package/dist/index.d.ts +280 -92
- package/dist/index.mjs +4 -6
- package/dist/index.mjs.map +1 -1
- package/dist/venus-api/index.cjs +1557 -2020
- package/dist/venus-api/index.cjs.map +1 -1
- package/dist/venus-api/index.d.mts +2 -2
- package/dist/venus-api/index.d.ts +2 -2
- package/dist/venus-api/index.mjs +92 -391
- package/dist/venus-api/index.mjs.map +1 -1
- package/dist/vite/index.cjs +534 -0
- package/dist/vite/index.cjs.map +1 -0
- package/dist/vite/index.mjs +527 -0
- package/dist/vite/index.mjs.map +1 -0
- package/dist/webview/index.cjs +15 -0
- package/dist/webview/index.cjs.map +1 -0
- package/dist/webview/index.d.mts +15 -0
- package/dist/webview/index.d.ts +15 -0
- package/dist/webview/index.mjs +4 -0
- package/dist/webview/index.mjs.map +1 -0
- package/package.json +1 -1
- package/dist/chunk-PXWCNWJ6.mjs.map +0 -1
- package/dist/chunk-W7IPHM67.mjs.map +0 -1
- package/dist/core-R3FHW62G.mjs +0 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { V as VenusAPI$1 } from '../AdsApi-
|
|
2
|
-
export {
|
|
1
|
+
import { V as VenusAPI$1 } from '../AdsApi-DFutZ7_q.mjs';
|
|
2
|
+
export { A as ActionSheetOption, B as BatchRecipeRequirementsResult, P as Profile, k as RecipeRequirementQuery, R as RecipeRequirementResult, d as SimulationActiveRunsUpdate, c as SimulationEntityUpdate, S as SimulationRunSummary, e as SimulationSnapshotUpdate, g as SimulationSubscribeOptions, f as SimulationUpdateData, b as SimulationUpdateType, n as VenusAvailableRecipe, o as VenusCollectRecipeResult, l as VenusExecuteRecipeOptions, p as VenusExecuteRecipeResult, m as VenusExecuteScopedRecipeOptions, q as VenusRoom, j as VenusSimulationConfig, h as VenusSimulationEffect, i as VenusSimulationRecipe, a as VenusSimulationStateResponse } from '../AdsApi-DFutZ7_q.mjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* TypeScript definitions for venus-api
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { V as VenusAPI$1 } from '../AdsApi-
|
|
2
|
-
export {
|
|
1
|
+
import { V as VenusAPI$1 } from '../AdsApi-DFutZ7_q.js';
|
|
2
|
+
export { A as ActionSheetOption, B as BatchRecipeRequirementsResult, P as Profile, k as RecipeRequirementQuery, R as RecipeRequirementResult, d as SimulationActiveRunsUpdate, c as SimulationEntityUpdate, S as SimulationRunSummary, e as SimulationSnapshotUpdate, g as SimulationSubscribeOptions, f as SimulationUpdateData, b as SimulationUpdateType, n as VenusAvailableRecipe, o as VenusCollectRecipeResult, l as VenusExecuteRecipeOptions, p as VenusExecuteRecipeResult, m as VenusExecuteScopedRecipeOptions, q as VenusRoom, j as VenusSimulationConfig, h as VenusSimulationEffect, i as VenusSimulationRecipe, a as VenusSimulationStateResponse } from '../AdsApi-DFutZ7_q.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* TypeScript definitions for venus-api
|
package/dist/venus-api/index.mjs
CHANGED
|
@@ -1,188 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { createProxiedObject, createProxiedMethod } from '../chunk-
|
|
3
|
-
|
|
4
|
-
// src/venus-api/systems/theme.js
|
|
5
|
-
var DEFAULT_TYPOGRAPHY = {
|
|
6
|
-
fontFamily: {
|
|
7
|
-
base: "Plus Jakarta Sans, Roboto, sans-serif",
|
|
8
|
-
heading: "Plus Jakarta Sans, Roboto, sans-serif",
|
|
9
|
-
mono: "monospace"
|
|
10
|
-
},
|
|
11
|
-
fontSize: {
|
|
12
|
-
"2xs": "10px",
|
|
13
|
-
xs: "12px",
|
|
14
|
-
sm: "14px",
|
|
15
|
-
md: "16px",
|
|
16
|
-
lg: "18px",
|
|
17
|
-
xl: "20px",
|
|
18
|
-
"2xl": "24px",
|
|
19
|
-
"3xl": "30px",
|
|
20
|
-
"4xl": "36px",
|
|
21
|
-
"5xl": "48px",
|
|
22
|
-
"6xl": "60px"
|
|
23
|
-
},
|
|
24
|
-
fontWeight: {
|
|
25
|
-
thin: "100",
|
|
26
|
-
extralight: "200",
|
|
27
|
-
light: "300",
|
|
28
|
-
regular: "400",
|
|
29
|
-
medium: "500",
|
|
30
|
-
semibold: "600",
|
|
31
|
-
bold: "700",
|
|
32
|
-
extrabold: "800",
|
|
33
|
-
black: "900",
|
|
34
|
-
extrablack: "950"
|
|
35
|
-
},
|
|
36
|
-
lineHeight: {
|
|
37
|
-
none: "1",
|
|
38
|
-
tight: "1.25",
|
|
39
|
-
snug: "1.375",
|
|
40
|
-
normal: "1.5",
|
|
41
|
-
relaxed: "1.625",
|
|
42
|
-
loose: "2"
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
var DEFAULT_THEME = {
|
|
46
|
-
background: {
|
|
47
|
-
default: "#131419",
|
|
48
|
-
// Dark background
|
|
49
|
-
muted: "#1b1d25",
|
|
50
|
-
// Mid-dark background
|
|
51
|
-
dark: "#0d0e11"
|
|
52
|
-
// Darker background
|
|
53
|
-
},
|
|
54
|
-
text: {
|
|
55
|
-
primary: "#ffffff",
|
|
56
|
-
// White
|
|
57
|
-
muted: "#808080",
|
|
58
|
-
// Gray
|
|
59
|
-
inverted: "#000000"
|
|
60
|
-
// Black
|
|
61
|
-
},
|
|
62
|
-
theme: {
|
|
63
|
-
primary: "#f6c833",
|
|
64
|
-
// Different yellow for testing (slightly lighter)
|
|
65
|
-
secondary: "#6366f1",
|
|
66
|
-
// Different secondary for testing (purple)
|
|
67
|
-
background: "#131419",
|
|
68
|
-
// Dark background
|
|
69
|
-
border: "#262626",
|
|
70
|
-
// Dark border
|
|
71
|
-
card: "#1b1d25",
|
|
72
|
-
// Dark card
|
|
73
|
-
"card-glass": "rgba(27, 29, 37, 0.8)"
|
|
74
|
-
// Translucent dark card
|
|
75
|
-
},
|
|
76
|
-
typography: DEFAULT_TYPOGRAPHY
|
|
77
|
-
};
|
|
78
|
-
function initializeTheme(venusApiInstance) {
|
|
79
|
-
if (!venusApiInstance._mock.theme) {
|
|
80
|
-
venusApiInstance._mock.theme = DEFAULT_THEME;
|
|
81
|
-
}
|
|
82
|
-
if (!venusApiInstance._mock.typography) {
|
|
83
|
-
venusApiInstance._mock.typography = DEFAULT_TYPOGRAPHY;
|
|
84
|
-
}
|
|
85
|
-
if (!venusApiInstance._mock.safeArea) {
|
|
86
|
-
venusApiInstance._mock.safeArea = { top: 0, bottom: 0, left: 0, right: 0 };
|
|
87
|
-
}
|
|
88
|
-
venusApiInstance.applyVenusThemeToCSS = function(theme) {
|
|
89
|
-
if (!theme) return;
|
|
90
|
-
const root = document.documentElement;
|
|
91
|
-
if (theme.background) {
|
|
92
|
-
if (theme.background.default)
|
|
93
|
-
root.style.setProperty("--color-background", theme.background.default);
|
|
94
|
-
if (theme.background.muted)
|
|
95
|
-
root.style.setProperty(
|
|
96
|
-
"--color-background-muted",
|
|
97
|
-
theme.background.muted
|
|
98
|
-
);
|
|
99
|
-
if (theme.background.dark)
|
|
100
|
-
root.style.setProperty(
|
|
101
|
-
"--color-background-dark",
|
|
102
|
-
theme.background.dark
|
|
103
|
-
);
|
|
104
|
-
}
|
|
105
|
-
if (theme.text) {
|
|
106
|
-
if (theme.text.primary)
|
|
107
|
-
root.style.setProperty("--color-text-primary", theme.text.primary);
|
|
108
|
-
if (theme.text.muted)
|
|
109
|
-
root.style.setProperty("--color-text-muted", theme.text.muted);
|
|
110
|
-
}
|
|
111
|
-
if (theme.theme) {
|
|
112
|
-
if (theme.theme.primary)
|
|
113
|
-
root.style.setProperty("--color-primary", theme.theme.primary);
|
|
114
|
-
if (theme.theme.secondary)
|
|
115
|
-
root.style.setProperty("--color-secondary", theme.theme.secondary);
|
|
116
|
-
if (theme.theme.border)
|
|
117
|
-
root.style.setProperty("--color-border", theme.theme.border);
|
|
118
|
-
}
|
|
119
|
-
if (theme.typography && theme.typography.fontFamily) {
|
|
120
|
-
if (theme.typography.fontFamily.base) {
|
|
121
|
-
root.style.setProperty(
|
|
122
|
-
"--font-family",
|
|
123
|
-
theme.typography.fontFamily.base
|
|
124
|
-
);
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
document.body.style.backgroundColor = root.style.getPropertyValue(
|
|
128
|
-
"--color-background-dark"
|
|
129
|
-
);
|
|
130
|
-
};
|
|
131
|
-
venusApiInstance.applyTheme = createProxiedMethod("applyTheme", function() {
|
|
132
|
-
let apiTheme = null;
|
|
133
|
-
apiTheme = this.config.theme;
|
|
134
|
-
if (apiTheme) {
|
|
135
|
-
this.applyVenusThemeToCSS(apiTheme);
|
|
136
|
-
this.colors = {
|
|
137
|
-
primary: apiTheme.theme?.primary || "#FF2877",
|
|
138
|
-
secondary: apiTheme.theme?.secondary || "#4755FF",
|
|
139
|
-
dark: apiTheme.background?.dark || "#0D0E11",
|
|
140
|
-
darkLight: apiTheme.background?.muted || "#1B1D25",
|
|
141
|
-
darkLighter: apiTheme.background?.default || "#23252F",
|
|
142
|
-
textPrimary: apiTheme.text?.primary || "#FFFFFF",
|
|
143
|
-
textMuted: apiTheme.text?.muted || "#808080",
|
|
144
|
-
border: apiTheme.theme?.border || "#262626"
|
|
145
|
-
};
|
|
146
|
-
} else {
|
|
147
|
-
this.colors = {
|
|
148
|
-
primary: "#FF2877",
|
|
149
|
-
secondary: "#4755FF",
|
|
150
|
-
dark: "#0D0E11",
|
|
151
|
-
darkLight: "#1B1D25",
|
|
152
|
-
darkLighter: "#23252F",
|
|
153
|
-
textPrimary: "#FFFFFF",
|
|
154
|
-
textMuted: "#808080",
|
|
155
|
-
border: "#262626"
|
|
156
|
-
};
|
|
157
|
-
}
|
|
158
|
-
this.log("Theme applied successfully");
|
|
159
|
-
});
|
|
160
|
-
venusApiInstance.applySafeArea = createProxiedMethod("applySafeArea", function() {
|
|
161
|
-
try {
|
|
162
|
-
const safeArea = this.config.ui.safeArea;
|
|
163
|
-
if (safeArea) {
|
|
164
|
-
this.log("Applying safe area insets: " + JSON.stringify(safeArea));
|
|
165
|
-
if (this.tapToStartScreen) {
|
|
166
|
-
this.tapToStartScreen.style.marginTop = `${safeArea.top}px`;
|
|
167
|
-
this.tapToStartScreen.style.marginBottom = `${safeArea.bottom}px`;
|
|
168
|
-
}
|
|
169
|
-
if (this.gameOverScreen) {
|
|
170
|
-
this.gameOverScreen.style.marginTop = `${safeArea.top}px`;
|
|
171
|
-
this.gameOverScreen.style.marginBottom = `${safeArea.bottom}px`;
|
|
172
|
-
}
|
|
173
|
-
if (this.maxScoreContainer) {
|
|
174
|
-
this.maxScoreContainer.style.marginTop = `${safeArea.top}px`;
|
|
175
|
-
this.maxScoreContainer.style.marginRight = `${safeArea.right}px`;
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
} catch (error) {
|
|
179
|
-
this.error("Error applying safe area: " + error.message);
|
|
180
|
-
console.error("Error applying safe area:", error);
|
|
181
|
-
}
|
|
182
|
-
});
|
|
183
|
-
venusApiInstance.DEFAULT_THEME = DEFAULT_THEME;
|
|
184
|
-
venusApiInstance.DEFAULT_TYPOGRAPHY = DEFAULT_TYPOGRAPHY;
|
|
185
|
-
}
|
|
1
|
+
import { SDK_VERSION, createHost, initializeStorage, initializeRoomsApi, initializeAds, initializePopups, initializeAnalytics, initializeIap, initializeLeaderboard, initializeLocalNotifications, initializePreloader, initializeTime, initializeLifecycleApi, initializeHaptics, initializeCdn, initializeFeaturesApi, initializeLoggingApi, initializeProfile, initializeSystem, initializeAvatar3d, initializeStackNavigation, initializeAi, initializeSimulation, initializeSocial } from '../chunk-AGXMORDL.mjs';
|
|
2
|
+
import { createProxiedObject, createProxiedMethod } from '../chunk-QABXMFND.mjs';
|
|
3
|
+
import '../chunk-NSSMTXJJ.mjs';
|
|
186
4
|
|
|
187
5
|
// src/venus-api/systems/asset-loader.js
|
|
188
6
|
var VenusAssetLoader = class {
|
|
@@ -195,7 +13,7 @@ var VenusAssetLoader = class {
|
|
|
195
13
|
// Set the VenusAPI reference during initialization
|
|
196
14
|
setVenusAPI(api) {
|
|
197
15
|
this.venusAPI = api;
|
|
198
|
-
this.isWebView =
|
|
16
|
+
this.isWebView = typeof window !== "undefined" && typeof window.ReactNativeWebView !== "undefined";
|
|
199
17
|
}
|
|
200
18
|
/**
|
|
201
19
|
* Load any asset with automatic optimization
|
|
@@ -316,14 +134,11 @@ var VenusAssetLoader = class {
|
|
|
316
134
|
}, 1e4);
|
|
317
135
|
if (type === "image") {
|
|
318
136
|
const img = new Image();
|
|
319
|
-
console.log(`\u{1F5BC}\uFE0F [Asset Verification] Verifying image: ${url}`);
|
|
320
137
|
img.onload = () => {
|
|
321
|
-
console.log(`\u2705 [Asset Verification] Image verified successfully: ${url}`);
|
|
322
138
|
clearTimeout(timeout);
|
|
323
139
|
resolve();
|
|
324
140
|
};
|
|
325
141
|
img.onerror = (error) => {
|
|
326
|
-
console.log(`\u274C [Asset Verification] Image verification failed: ${url}`, error);
|
|
327
142
|
clearTimeout(timeout);
|
|
328
143
|
reject(new Error("Failed to load image"));
|
|
329
144
|
};
|
|
@@ -375,7 +190,6 @@ var VenusAssetLoader = class {
|
|
|
375
190
|
const CDN_BASE_URL = "https://venus-static-01293ak.web.app/";
|
|
376
191
|
const cleanUrl = url.startsWith("/") ? url.slice(1) : url;
|
|
377
192
|
const fullUrl = CDN_BASE_URL + cleanUrl;
|
|
378
|
-
console.log(`\u{1F310} [Asset Loader] Force remote CDN: ${url} -> ${fullUrl}`);
|
|
379
193
|
return fullUrl;
|
|
380
194
|
}
|
|
381
195
|
if (this.venusAPI && this.venusAPI.isMock && this.venusAPI.isMock()) {
|
|
@@ -1934,7 +1748,7 @@ function createNumbersAPI() {
|
|
|
1934
1748
|
return numbersAPI;
|
|
1935
1749
|
}
|
|
1936
1750
|
async function initializeNumbers(venusApiInstance) {
|
|
1937
|
-
const { createProxiedObject: createProxiedObject2, createProxiedMethod: createProxiedMethod2 } = await import('../core-
|
|
1751
|
+
const { createProxiedObject: createProxiedObject2, createProxiedMethod: createProxiedMethod2 } = await import('../core-62LWDHN7.mjs');
|
|
1938
1752
|
const numbersAPI = createNumbersAPI();
|
|
1939
1753
|
venusApiInstance.numbers = createProxiedObject2.call(
|
|
1940
1754
|
venusApiInstance,
|
|
@@ -1956,7 +1770,6 @@ async function initializeNumbers(venusApiInstance) {
|
|
|
1956
1770
|
}
|
|
1957
1771
|
|
|
1958
1772
|
// src/venus-api/index.js
|
|
1959
|
-
init_rooms();
|
|
1960
1773
|
var HapticStyle = {
|
|
1961
1774
|
LIGHT: "light",
|
|
1962
1775
|
MEDIUM: "medium",
|
|
@@ -1996,82 +1809,8 @@ var VenusAPI2 = class {
|
|
|
1996
1809
|
bottom: 10,
|
|
1997
1810
|
left: 0
|
|
1998
1811
|
},
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
menuButton: { x: window.innerWidth - 48, y: 16, width: 32, height: 32 },
|
|
2002
|
-
feedHeader: { x: 0, y: 0, width: window.innerWidth, height: 66 },
|
|
2003
|
-
playButton: {
|
|
2004
|
-
x: 0,
|
|
2005
|
-
y: window.innerHeight - 60,
|
|
2006
|
-
width: window.innerWidth,
|
|
2007
|
-
height: 60
|
|
2008
|
-
}
|
|
2009
|
-
},
|
|
2010
|
-
// Complete theme structure (matching createH5Theme output)
|
|
2011
|
-
theme: {
|
|
2012
|
-
background: {
|
|
2013
|
-
default: "#131419",
|
|
2014
|
-
muted: "#1b1d25",
|
|
2015
|
-
dark: "#0d0e11"
|
|
2016
|
-
},
|
|
2017
|
-
text: {
|
|
2018
|
-
primary: "#ffffff",
|
|
2019
|
-
muted: "#808080",
|
|
2020
|
-
inverted: "#000000"
|
|
2021
|
-
},
|
|
2022
|
-
theme: {
|
|
2023
|
-
primary: "#f6c833",
|
|
2024
|
-
secondary: "#6366f1",
|
|
2025
|
-
background: "#131419",
|
|
2026
|
-
border: "#262626",
|
|
2027
|
-
card: "#1b1d25",
|
|
2028
|
-
"card-glass": "rgba(27, 29, 37, 0.8)"
|
|
2029
|
-
},
|
|
2030
|
-
typography: {
|
|
2031
|
-
fontFamily: {
|
|
2032
|
-
base: "Plus Jakarta Sans, Roboto, sans-serif",
|
|
2033
|
-
heading: "Plus Jakarta Sans, Roboto, sans-serif",
|
|
2034
|
-
mono: "monospace"
|
|
2035
|
-
},
|
|
2036
|
-
fontSize: {
|
|
2037
|
-
"2xs": "10px",
|
|
2038
|
-
xs: "12px",
|
|
2039
|
-
sm: "14px",
|
|
2040
|
-
md: "16px",
|
|
2041
|
-
lg: "18px",
|
|
2042
|
-
xl: "20px",
|
|
2043
|
-
"2xl": "24px",
|
|
2044
|
-
"3xl": "30px",
|
|
2045
|
-
"4xl": "36px",
|
|
2046
|
-
"5xl": "48px",
|
|
2047
|
-
"6xl": "60px"
|
|
2048
|
-
},
|
|
2049
|
-
fontWeight: {
|
|
2050
|
-
thin: "100",
|
|
2051
|
-
extralight: "200",
|
|
2052
|
-
light: "300",
|
|
2053
|
-
regular: "400",
|
|
2054
|
-
medium: "500",
|
|
2055
|
-
semibold: "600",
|
|
2056
|
-
bold: "700",
|
|
2057
|
-
extrabold: "800",
|
|
2058
|
-
black: "900",
|
|
2059
|
-
extrablack: "950"
|
|
2060
|
-
},
|
|
2061
|
-
lineHeight: {
|
|
2062
|
-
none: "1",
|
|
2063
|
-
tight: "1.25",
|
|
2064
|
-
snug: "1.375",
|
|
2065
|
-
normal: "1.5",
|
|
2066
|
-
relaxed: "1.625",
|
|
2067
|
-
loose: "2"
|
|
2068
|
-
}
|
|
2069
|
-
}
|
|
2070
|
-
},
|
|
2071
|
-
// Static locale data at top level
|
|
2072
|
-
locale: "en-US",
|
|
2073
|
-
languageCode: "en",
|
|
2074
|
-
// Note: Profile is now separate from config and accessed via getCurrentProfile()
|
|
1812
|
+
// NOTE: locale and languageCode are NOT part of static config
|
|
1813
|
+
// They are delivered via INIT_SDK handshake and accessed via getLocale()/getLanguageCode()
|
|
2075
1814
|
// Complete environment info (matching buildStaticConfig)
|
|
2076
1815
|
environment: {
|
|
2077
1816
|
isDevelopment: true,
|
|
@@ -2125,12 +1864,6 @@ var VenusAPI2 = class {
|
|
|
2125
1864
|
onHide: null,
|
|
2126
1865
|
onShow: null
|
|
2127
1866
|
},
|
|
2128
|
-
currentPostInteractions: {
|
|
2129
|
-
isLiked: false,
|
|
2130
|
-
isFollowing: false,
|
|
2131
|
-
likesCount: 42,
|
|
2132
|
-
commentsCount: 7
|
|
2133
|
-
},
|
|
2134
1867
|
// Platform overrides for testing different environments
|
|
2135
1868
|
platformOverrides: {
|
|
2136
1869
|
isMobile: true,
|
|
@@ -2139,117 +1872,74 @@ var VenusAPI2 = class {
|
|
|
2139
1872
|
};
|
|
2140
1873
|
this._detectHostedEnvironment();
|
|
2141
1874
|
this.launchParams = {};
|
|
2142
|
-
this.config = createProxiedObject.call(this, "config", {
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
1875
|
+
this.config = createProxiedObject.call(this, "config", {});
|
|
1876
|
+
const originalConfig = this.config;
|
|
1877
|
+
this.config = new Proxy(originalConfig, {
|
|
1878
|
+
get(target, prop) {
|
|
1879
|
+
if (prop === "locale") {
|
|
1880
|
+
throw new Error("Use VenusAPI.getLocale() instead.");
|
|
1881
|
+
}
|
|
1882
|
+
if (prop === "languageCode") {
|
|
1883
|
+
throw new Error("Use VenusAPI.getLanguageCode() instead.");
|
|
1884
|
+
}
|
|
1885
|
+
if (prop === "user") {
|
|
1886
|
+
throw new Error("Use VenusAPI.getLocale() and VenusAPI.getLanguageCode() instead.");
|
|
1887
|
+
}
|
|
1888
|
+
if (prop === "device") {
|
|
1889
|
+
throw new Error("Use VenusAPI.system.getDevice() instead.");
|
|
1890
|
+
}
|
|
1891
|
+
if (prop === "environment") {
|
|
1892
|
+
throw new Error("Use VenusAPI.system.getEnvironment() instead.");
|
|
1893
|
+
}
|
|
1894
|
+
if (prop === "profile") {
|
|
1895
|
+
throw new Error("Use VenusAPI.getProfile() instead.");
|
|
1896
|
+
}
|
|
1897
|
+
if (prop === "rooms") {
|
|
1898
|
+
throw new Error("Rooms configuration is internal. Use VenusAPI.rooms methods instead.");
|
|
2156
1899
|
}
|
|
1900
|
+
if (prop === "ui") {
|
|
1901
|
+
return new Proxy({}, {
|
|
1902
|
+
get(uiTarget, uiProp) {
|
|
1903
|
+
if (uiProp === "safeArea") {
|
|
1904
|
+
throw new Error("Use VenusAPI.system.getSafeArea() instead.");
|
|
1905
|
+
}
|
|
1906
|
+
if (uiProp === "hudInsets") {
|
|
1907
|
+
throw new Error("Use VenusAPI.system.getSafeArea() instead.");
|
|
1908
|
+
}
|
|
1909
|
+
if (uiProp === "controls") {
|
|
1910
|
+
throw new Error("UI controls are no longer supported.");
|
|
1911
|
+
}
|
|
1912
|
+
throw new Error(`VenusAPI.config.ui.${uiProp} is not supported.`);
|
|
1913
|
+
}
|
|
1914
|
+
});
|
|
1915
|
+
}
|
|
1916
|
+
return target[prop];
|
|
2157
1917
|
},
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
menuButton: {
|
|
2162
|
-
x: typeof window !== "undefined" ? window.innerWidth - 48 : 352,
|
|
2163
|
-
y: 16,
|
|
2164
|
-
width: 32,
|
|
2165
|
-
height: 32
|
|
2166
|
-
},
|
|
2167
|
-
feedHeader: {
|
|
2168
|
-
x: 0,
|
|
2169
|
-
y: 0,
|
|
2170
|
-
width: typeof window !== "undefined" ? window.innerWidth : 400,
|
|
2171
|
-
height: 66
|
|
2172
|
-
},
|
|
2173
|
-
playButton: {
|
|
2174
|
-
x: 0,
|
|
2175
|
-
y: typeof window !== "undefined" ? window.innerHeight - 60 : 740,
|
|
2176
|
-
width: typeof window !== "undefined" ? window.innerWidth : 400,
|
|
2177
|
-
height: 60
|
|
2178
|
-
}
|
|
2179
|
-
},
|
|
2180
|
-
safeArea: { top: 44, left: 0, right: 0, bottom: 34 },
|
|
2181
|
-
hudInsets: {
|
|
2182
|
-
preview: { top: 60, left: 0, right: 0, bottom: 40 },
|
|
2183
|
-
fullscreen: { top: 44, left: 0, right: 0, bottom: 34 }
|
|
1918
|
+
set(target, prop, value) {
|
|
1919
|
+
if (prop === "locale" || prop === "languageCode" || prop === "user" || prop === "device" || prop === "environment" || prop === "profile") {
|
|
1920
|
+
throw new Error(`VenusAPI.config.${prop} cannot be set. Configuration is read-only.`);
|
|
2184
1921
|
}
|
|
1922
|
+
if (prop === "ui") {
|
|
1923
|
+
console.warn("[Venus SDK] Cannot set config.ui");
|
|
1924
|
+
return true;
|
|
1925
|
+
}
|
|
1926
|
+
target[prop] = value;
|
|
1927
|
+
return true;
|
|
2185
1928
|
},
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
viewportSize: {
|
|
2192
|
-
width: typeof window !== "undefined" ? window.innerWidth : 0,
|
|
2193
|
-
height: typeof window !== "undefined" ? window.innerHeight : 0
|
|
2194
|
-
},
|
|
2195
|
-
orientation: "portrait",
|
|
2196
|
-
pixelRatio: typeof window !== "undefined" ? window.devicePixelRatio || 1 : 1,
|
|
2197
|
-
fontScale: 1,
|
|
2198
|
-
deviceType: "phone",
|
|
2199
|
-
hapticsEnabled: false,
|
|
2200
|
-
haptics: { supported: false, enabled: false }
|
|
1929
|
+
has(target, prop) {
|
|
1930
|
+
if (prop === "ui") {
|
|
1931
|
+
return false;
|
|
1932
|
+
}
|
|
1933
|
+
return prop in target;
|
|
2201
1934
|
},
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
background: "#131419",
|
|
2209
|
-
border: "#262626",
|
|
2210
|
-
card: "#1b1d25",
|
|
2211
|
-
"card-glass": "rgba(27, 29, 37, 0.8)"
|
|
2212
|
-
},
|
|
2213
|
-
typography: {
|
|
2214
|
-
fontFamily: {
|
|
2215
|
-
base: "Plus Jakarta Sans, Roboto, sans-serif",
|
|
2216
|
-
heading: "Plus Jakarta Sans, Roboto, sans-serif",
|
|
2217
|
-
mono: "monospace"
|
|
2218
|
-
},
|
|
2219
|
-
fontSize: {
|
|
2220
|
-
"2xs": "10px",
|
|
2221
|
-
xs: "12px",
|
|
2222
|
-
sm: "14px",
|
|
2223
|
-
md: "16px",
|
|
2224
|
-
lg: "18px",
|
|
2225
|
-
xl: "20px",
|
|
2226
|
-
"2xl": "24px",
|
|
2227
|
-
"3xl": "30px",
|
|
2228
|
-
"4xl": "36px",
|
|
2229
|
-
"5xl": "48px",
|
|
2230
|
-
"6xl": "60px"
|
|
2231
|
-
},
|
|
2232
|
-
fontWeight: {
|
|
2233
|
-
thin: "100",
|
|
2234
|
-
extralight: "200",
|
|
2235
|
-
light: "300",
|
|
2236
|
-
regular: "400",
|
|
2237
|
-
medium: "500",
|
|
2238
|
-
semibold: "600",
|
|
2239
|
-
bold: "700",
|
|
2240
|
-
extrabold: "800",
|
|
2241
|
-
black: "900",
|
|
2242
|
-
extrablack: "950"
|
|
2243
|
-
},
|
|
2244
|
-
lineHeight: {
|
|
2245
|
-
none: "1",
|
|
2246
|
-
tight: "1.25",
|
|
2247
|
-
snug: "1.375",
|
|
2248
|
-
normal: "1.5",
|
|
2249
|
-
relaxed: "1.625",
|
|
2250
|
-
loose: "2"
|
|
2251
|
-
}
|
|
1935
|
+
ownKeys(target) {
|
|
1936
|
+
return Reflect.ownKeys(target).filter((key) => key !== "ui");
|
|
1937
|
+
},
|
|
1938
|
+
getOwnPropertyDescriptor(target, prop) {
|
|
1939
|
+
if (prop === "ui") {
|
|
1940
|
+
return void 0;
|
|
2252
1941
|
}
|
|
1942
|
+
return Reflect.getOwnPropertyDescriptor(target, prop);
|
|
2253
1943
|
}
|
|
2254
1944
|
});
|
|
2255
1945
|
const isInsideHostedEnv = this._bootstrap.isInsideHostedEnvironment;
|
|
@@ -2258,7 +1948,6 @@ var VenusAPI2 = class {
|
|
|
2258
1948
|
initializeStorage(this, host);
|
|
2259
1949
|
initializeRoomsApi(this, host);
|
|
2260
1950
|
initializeAds(this, host);
|
|
2261
|
-
initializeTheme(this);
|
|
2262
1951
|
initializePopups(this, host);
|
|
2263
1952
|
initializeAnalytics(this, host);
|
|
2264
1953
|
initializeIap(this, host);
|
|
@@ -2273,15 +1962,31 @@ var VenusAPI2 = class {
|
|
|
2273
1962
|
initializeLoggingApi(this, host);
|
|
2274
1963
|
const isAvatar3dDisabled = typeof window !== "undefined" && window.location.search.includes("EXPO_PUBLIC_DISABLE_3D_AVATARS=true");
|
|
2275
1964
|
initializeProfile(this, host);
|
|
1965
|
+
initializeSystem(this, host);
|
|
2276
1966
|
if (!isAvatar3dDisabled) {
|
|
2277
1967
|
initializeAvatar3d(this, host);
|
|
2278
1968
|
}
|
|
2279
1969
|
initializeStackNavigation(this, host);
|
|
2280
|
-
initializePost(this, host);
|
|
2281
1970
|
initializeAi(this, host);
|
|
2282
1971
|
initializeSimulation(this, host);
|
|
2283
1972
|
initializeSocial(this, host);
|
|
2284
1973
|
initializeAssetLoader(this, createProxiedMethod);
|
|
1974
|
+
this.getLocale = () => {
|
|
1975
|
+
if (this._localeData) {
|
|
1976
|
+
return this._localeData;
|
|
1977
|
+
}
|
|
1978
|
+
if (typeof navigator !== "undefined" && navigator.language) {
|
|
1979
|
+
return navigator.language;
|
|
1980
|
+
}
|
|
1981
|
+
return "en-US";
|
|
1982
|
+
};
|
|
1983
|
+
this.getLanguageCode = () => {
|
|
1984
|
+
if (this._languageCodeData) {
|
|
1985
|
+
return this._languageCodeData;
|
|
1986
|
+
}
|
|
1987
|
+
const locale = this.getLocale();
|
|
1988
|
+
return locale.split("-")[0];
|
|
1989
|
+
};
|
|
2285
1990
|
}
|
|
2286
1991
|
// Generate deterministic instance ID based on current page URL
|
|
2287
1992
|
_generateDeterministicInstanceId() {
|
|
@@ -2318,21 +2023,14 @@ var VenusAPI2 = class {
|
|
|
2318
2023
|
// BOOTSTRAP METHODS
|
|
2319
2024
|
//---------------------------------------
|
|
2320
2025
|
_detectHostedEnvironment() {
|
|
2321
|
-
console.log("[Venus SDK] Detecting host environment...");
|
|
2322
2026
|
const isInIframe = window.self !== window.top;
|
|
2323
2027
|
const hasReactNativeWebView = typeof window.ReactNativeWebView !== "undefined";
|
|
2324
2028
|
this._bootstrap.isInsideHostedEnvironment = isInIframe || hasReactNativeWebView;
|
|
2325
|
-
console.log(
|
|
2326
|
-
`[Venus SDK] isInIframe: ${isInIframe}, hasReactNativeWebView: ${hasReactNativeWebView}`
|
|
2327
|
-
);
|
|
2328
|
-
}
|
|
2329
|
-
isMobile() {
|
|
2330
|
-
return typeof window.ReactNativeWebView !== "undefined";
|
|
2331
2029
|
}
|
|
2332
2030
|
_initializeMockMode() {
|
|
2333
2031
|
if (this._mock.localeOverride) {
|
|
2334
|
-
this.
|
|
2335
|
-
this.
|
|
2032
|
+
this._localeData = this._mock.localeOverride;
|
|
2033
|
+
this._languageCodeData = this._mock.localeOverride.split("-")[0];
|
|
2336
2034
|
}
|
|
2337
2035
|
if (this._mock.roomsData) {
|
|
2338
2036
|
console.warn(
|
|
@@ -2352,6 +2050,10 @@ var VenusAPI2 = class {
|
|
|
2352
2050
|
}
|
|
2353
2051
|
this._shared.initPromise = new Promise(async (resolve, reject) => {
|
|
2354
2052
|
try {
|
|
2053
|
+
if (this.isMock() && options?.mock) {
|
|
2054
|
+
Object.assign(this._mock, options.mock);
|
|
2055
|
+
console.log("[VenusAPI] Mock options applied:", options.mock);
|
|
2056
|
+
}
|
|
2355
2057
|
const result = await this.host.initialize(options);
|
|
2356
2058
|
this._shared.initialized = true;
|
|
2357
2059
|
if (!options || !options.usePreloader) {
|
|
@@ -2379,7 +2081,6 @@ instance.isAvailable = function() {
|
|
|
2379
2081
|
(async () => {
|
|
2380
2082
|
try {
|
|
2381
2083
|
await initializeNumbers(instance);
|
|
2382
|
-
console.log("[Venus SDK] Numbers system initialized");
|
|
2383
2084
|
} catch (error) {
|
|
2384
2085
|
console.error("[Venus SDK] Failed to initialize numbers system:", error);
|
|
2385
2086
|
}
|