@series-inc/venus-sdk 3.1.2-beta.0 → 3.1.2
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-xw-M1AEl.d.mts → AdsApi-CNGRf6j0.d.mts} +293 -501
- package/dist/{AdsApi-xw-M1AEl.d.ts → AdsApi-CNGRf6j0.d.ts} +293 -501
- package/dist/{chunk-QQTWO5KS.mjs → chunk-PXWCNWJ6.mjs} +1525 -1380
- package/dist/chunk-PXWCNWJ6.mjs.map +1 -0
- package/dist/{chunk-QABXMFND.mjs → chunk-W7IPHM67.mjs} +26 -3
- package/dist/chunk-W7IPHM67.mjs.map +1 -0
- package/dist/core-R3FHW62G.mjs +3 -0
- package/dist/{core-62LWDHN7.mjs.map → core-R3FHW62G.mjs.map} +1 -1
- package/dist/index.cjs +1531 -1406
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +92 -280
- package/dist/index.d.ts +92 -280
- package/dist/index.mjs +6 -4
- package/dist/index.mjs.map +1 -1
- package/dist/venus-api/index.cjs +2012 -1548
- 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 +391 -92
- package/dist/venus-api/index.mjs.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-NSSMTXJJ.mjs +0 -7
- package/dist/chunk-NSSMTXJJ.mjs.map +0 -1
- package/dist/chunk-QABXMFND.mjs.map +0 -1
- package/dist/chunk-QQTWO5KS.mjs.map +0 -1
- package/dist/chunk-UXY5CKKG.mjs +0 -12
- package/dist/chunk-UXY5CKKG.mjs.map +0 -1
- package/dist/core-62LWDHN7.mjs +0 -4
- package/dist/vite/index.cjs +0 -534
- package/dist/vite/index.cjs.map +0 -1
- package/dist/vite/index.mjs +0 -527
- package/dist/vite/index.mjs.map +0 -1
- package/dist/webview/index.cjs +0 -15
- package/dist/webview/index.cjs.map +0 -1
- package/dist/webview/index.d.mts +0 -15
- package/dist/webview/index.d.ts +0 -15
- package/dist/webview/index.mjs +0 -4
- package/dist/webview/index.mjs.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { V as VenusAPI$1 } from '../AdsApi-
|
|
2
|
-
export {
|
|
1
|
+
import { V as VenusAPI$1 } from '../AdsApi-CNGRf6j0.mjs';
|
|
2
|
+
export { ba as ActionSheetOption, b6 as BatchRecipeRequirementsResult, q as Profile, b5 as RecipeRequirementQuery, a2 as RecipeRequirementResult, b8 as VenusConfig, aK as VenusRoom, b9 as VenusRoomsConfig, b7 as VenusSimulationAPI, O as VenusSimulationConfig, b3 as VenusSimulationEffect, b4 as VenusSimulationRecipe, b2 as VenusSimulationState } from '../AdsApi-CNGRf6j0.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-CNGRf6j0.js';
|
|
2
|
+
export { ba as ActionSheetOption, b6 as BatchRecipeRequirementsResult, q as Profile, b5 as RecipeRequirementQuery, a2 as RecipeRequirementResult, b8 as VenusConfig, aK as VenusRoom, b9 as VenusRoomsConfig, b7 as VenusSimulationAPI, O as VenusSimulationConfig, b3 as VenusSimulationEffect, b4 as VenusSimulationRecipe, b2 as VenusSimulationState } from '../AdsApi-CNGRf6j0.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* TypeScript definitions for venus-api
|
package/dist/venus-api/index.mjs
CHANGED
|
@@ -1,6 +1,188 @@
|
|
|
1
|
-
import { SDK_VERSION, createHost, initializeStorage, initializeRoomsApi, initializeAds, initializePopups, initializeAnalytics, initializeIap, initializeLeaderboard, initializeLocalNotifications, initializePreloader, initializeTime, initializeLifecycleApi, initializeHaptics, initializeCdn, initializeFeaturesApi, initializeLoggingApi, initializeProfile,
|
|
2
|
-
import { createProxiedObject, createProxiedMethod } from '../chunk-
|
|
3
|
-
|
|
1
|
+
import { init_rooms, SDK_VERSION, createHost, initializeStorage, initializeRoomsApi, initializeAds, initializePopups, initializeAnalytics, initializeIap, initializeLeaderboard, initializeLocalNotifications, initializePreloader, initializeTime, initializeLifecycleApi, initializeHaptics, initializeCdn, initializeFeaturesApi, initializeLoggingApi, initializeProfile, initializeAvatar3d, initializeStackNavigation, initializePost, initializeAi, initializeSimulation, initializeSocial } from '../chunk-PXWCNWJ6.mjs';
|
|
2
|
+
import { createProxiedObject, createProxiedMethod } from '../chunk-W7IPHM67.mjs';
|
|
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
|
+
}
|
|
4
186
|
|
|
5
187
|
// src/venus-api/systems/asset-loader.js
|
|
6
188
|
var VenusAssetLoader = class {
|
|
@@ -13,7 +195,7 @@ var VenusAssetLoader = class {
|
|
|
13
195
|
// Set the VenusAPI reference during initialization
|
|
14
196
|
setVenusAPI(api) {
|
|
15
197
|
this.venusAPI = api;
|
|
16
|
-
this.isWebView =
|
|
198
|
+
this.isWebView = !api.isWeb || !api.isWeb();
|
|
17
199
|
}
|
|
18
200
|
/**
|
|
19
201
|
* Load any asset with automatic optimization
|
|
@@ -134,11 +316,14 @@ var VenusAssetLoader = class {
|
|
|
134
316
|
}, 1e4);
|
|
135
317
|
if (type === "image") {
|
|
136
318
|
const img = new Image();
|
|
319
|
+
console.log(`\u{1F5BC}\uFE0F [Asset Verification] Verifying image: ${url}`);
|
|
137
320
|
img.onload = () => {
|
|
321
|
+
console.log(`\u2705 [Asset Verification] Image verified successfully: ${url}`);
|
|
138
322
|
clearTimeout(timeout);
|
|
139
323
|
resolve();
|
|
140
324
|
};
|
|
141
325
|
img.onerror = (error) => {
|
|
326
|
+
console.log(`\u274C [Asset Verification] Image verification failed: ${url}`, error);
|
|
142
327
|
clearTimeout(timeout);
|
|
143
328
|
reject(new Error("Failed to load image"));
|
|
144
329
|
};
|
|
@@ -190,6 +375,7 @@ var VenusAssetLoader = class {
|
|
|
190
375
|
const CDN_BASE_URL = "https://venus-static-01293ak.web.app/";
|
|
191
376
|
const cleanUrl = url.startsWith("/") ? url.slice(1) : url;
|
|
192
377
|
const fullUrl = CDN_BASE_URL + cleanUrl;
|
|
378
|
+
console.log(`\u{1F310} [Asset Loader] Force remote CDN: ${url} -> ${fullUrl}`);
|
|
193
379
|
return fullUrl;
|
|
194
380
|
}
|
|
195
381
|
if (this.venusAPI && this.venusAPI.isMock && this.venusAPI.isMock()) {
|
|
@@ -1748,7 +1934,7 @@ function createNumbersAPI() {
|
|
|
1748
1934
|
return numbersAPI;
|
|
1749
1935
|
}
|
|
1750
1936
|
async function initializeNumbers(venusApiInstance) {
|
|
1751
|
-
const { createProxiedObject: createProxiedObject2, createProxiedMethod: createProxiedMethod2 } = await import('../core-
|
|
1937
|
+
const { createProxiedObject: createProxiedObject2, createProxiedMethod: createProxiedMethod2 } = await import('../core-R3FHW62G.mjs');
|
|
1752
1938
|
const numbersAPI = createNumbersAPI();
|
|
1753
1939
|
venusApiInstance.numbers = createProxiedObject2.call(
|
|
1754
1940
|
venusApiInstance,
|
|
@@ -1770,6 +1956,7 @@ async function initializeNumbers(venusApiInstance) {
|
|
|
1770
1956
|
}
|
|
1771
1957
|
|
|
1772
1958
|
// src/venus-api/index.js
|
|
1959
|
+
init_rooms();
|
|
1773
1960
|
var HapticStyle = {
|
|
1774
1961
|
LIGHT: "light",
|
|
1775
1962
|
MEDIUM: "medium",
|
|
@@ -1809,8 +1996,82 @@ var VenusAPI2 = class {
|
|
|
1809
1996
|
bottom: 10,
|
|
1810
1997
|
left: 0
|
|
1811
1998
|
},
|
|
1812
|
-
|
|
1813
|
-
|
|
1999
|
+
uiControls: {
|
|
2000
|
+
closeButton: { x: 16, y: 16, width: 32, height: 32 },
|
|
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()
|
|
1814
2075
|
// Complete environment info (matching buildStaticConfig)
|
|
1815
2076
|
environment: {
|
|
1816
2077
|
isDevelopment: true,
|
|
@@ -1864,6 +2125,12 @@ var VenusAPI2 = class {
|
|
|
1864
2125
|
onHide: null,
|
|
1865
2126
|
onShow: null
|
|
1866
2127
|
},
|
|
2128
|
+
currentPostInteractions: {
|
|
2129
|
+
isLiked: false,
|
|
2130
|
+
isFollowing: false,
|
|
2131
|
+
likesCount: 42,
|
|
2132
|
+
commentsCount: 7
|
|
2133
|
+
},
|
|
1867
2134
|
// Platform overrides for testing different environments
|
|
1868
2135
|
platformOverrides: {
|
|
1869
2136
|
isMobile: true,
|
|
@@ -1872,74 +2139,117 @@ var VenusAPI2 = class {
|
|
|
1872
2139
|
};
|
|
1873
2140
|
this._detectHostedEnvironment();
|
|
1874
2141
|
this.launchParams = {};
|
|
1875
|
-
this.config = createProxiedObject.call(this, "config", {
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
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.");
|
|
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];
|
|
1917
|
-
},
|
|
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.`);
|
|
1921
|
-
}
|
|
1922
|
-
if (prop === "ui") {
|
|
1923
|
-
console.warn("[Venus SDK] Cannot set config.ui");
|
|
1924
|
-
return true;
|
|
2142
|
+
this.config = createProxiedObject.call(this, "config", {
|
|
2143
|
+
locale: "en-US",
|
|
2144
|
+
languageCode: "en",
|
|
2145
|
+
// Note: Profile is no longer in config - use getCurrentProfile() instead
|
|
2146
|
+
environment: {
|
|
2147
|
+
isDevelopment: true,
|
|
2148
|
+
platform: typeof navigator !== "undefined" ? navigator.platform : "unknown",
|
|
2149
|
+
platformVersion: "unknown",
|
|
2150
|
+
browserInfo: {
|
|
2151
|
+
browser: "unknown",
|
|
2152
|
+
userAgent: typeof navigator !== "undefined" ? navigator.userAgent : "unknown",
|
|
2153
|
+
isMobile: true,
|
|
2154
|
+
isTablet: false,
|
|
2155
|
+
language: typeof navigator !== "undefined" ? navigator.language : "en-US"
|
|
1925
2156
|
}
|
|
1926
|
-
target[prop] = value;
|
|
1927
|
-
return true;
|
|
1928
2157
|
},
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
2158
|
+
ui: {
|
|
2159
|
+
controls: {
|
|
2160
|
+
closeButton: { x: 16, y: 16, width: 32, height: 32 },
|
|
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 }
|
|
1932
2184
|
}
|
|
1933
|
-
return prop in target;
|
|
1934
2185
|
},
|
|
1935
|
-
|
|
1936
|
-
|
|
2186
|
+
device: {
|
|
2187
|
+
screenSize: {
|
|
2188
|
+
width: typeof window !== "undefined" ? window.screen?.width || 0 : 0,
|
|
2189
|
+
height: typeof window !== "undefined" ? window.screen?.height || 0 : 0
|
|
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 }
|
|
1937
2201
|
},
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
2202
|
+
theme: {
|
|
2203
|
+
background: { default: "#131419", muted: "#1b1d25", dark: "#0d0e11" },
|
|
2204
|
+
text: { primary: "#ffffff", muted: "#808080", inverted: "#000000" },
|
|
2205
|
+
theme: {
|
|
2206
|
+
primary: "#f6c833",
|
|
2207
|
+
secondary: "#6366f1",
|
|
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
|
+
}
|
|
1941
2252
|
}
|
|
1942
|
-
return Reflect.getOwnPropertyDescriptor(target, prop);
|
|
1943
2253
|
}
|
|
1944
2254
|
});
|
|
1945
2255
|
const isInsideHostedEnv = this._bootstrap.isInsideHostedEnvironment;
|
|
@@ -1948,6 +2258,7 @@ var VenusAPI2 = class {
|
|
|
1948
2258
|
initializeStorage(this, host);
|
|
1949
2259
|
initializeRoomsApi(this, host);
|
|
1950
2260
|
initializeAds(this, host);
|
|
2261
|
+
initializeTheme(this);
|
|
1951
2262
|
initializePopups(this, host);
|
|
1952
2263
|
initializeAnalytics(this, host);
|
|
1953
2264
|
initializeIap(this, host);
|
|
@@ -1962,31 +2273,15 @@ var VenusAPI2 = class {
|
|
|
1962
2273
|
initializeLoggingApi(this, host);
|
|
1963
2274
|
const isAvatar3dDisabled = typeof window !== "undefined" && window.location.search.includes("EXPO_PUBLIC_DISABLE_3D_AVATARS=true");
|
|
1964
2275
|
initializeProfile(this, host);
|
|
1965
|
-
initializeSystem(this, host);
|
|
1966
2276
|
if (!isAvatar3dDisabled) {
|
|
1967
2277
|
initializeAvatar3d(this, host);
|
|
1968
2278
|
}
|
|
1969
2279
|
initializeStackNavigation(this, host);
|
|
2280
|
+
initializePost(this, host);
|
|
1970
2281
|
initializeAi(this, host);
|
|
1971
2282
|
initializeSimulation(this, host);
|
|
1972
2283
|
initializeSocial(this, host);
|
|
1973
2284
|
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
|
-
};
|
|
1990
2285
|
}
|
|
1991
2286
|
// Generate deterministic instance ID based on current page URL
|
|
1992
2287
|
_generateDeterministicInstanceId() {
|
|
@@ -2023,14 +2318,21 @@ var VenusAPI2 = class {
|
|
|
2023
2318
|
// BOOTSTRAP METHODS
|
|
2024
2319
|
//---------------------------------------
|
|
2025
2320
|
_detectHostedEnvironment() {
|
|
2321
|
+
console.log("[Venus SDK] Detecting host environment...");
|
|
2026
2322
|
const isInIframe = window.self !== window.top;
|
|
2027
2323
|
const hasReactNativeWebView = typeof window.ReactNativeWebView !== "undefined";
|
|
2028
2324
|
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";
|
|
2029
2331
|
}
|
|
2030
2332
|
_initializeMockMode() {
|
|
2031
2333
|
if (this._mock.localeOverride) {
|
|
2032
|
-
this.
|
|
2033
|
-
this.
|
|
2334
|
+
this.config.locale = this._mock.localeOverride;
|
|
2335
|
+
this.config.languageCode = this._mock.localeOverride.split("-")[0];
|
|
2034
2336
|
}
|
|
2035
2337
|
if (this._mock.roomsData) {
|
|
2036
2338
|
console.warn(
|
|
@@ -2050,10 +2352,6 @@ var VenusAPI2 = class {
|
|
|
2050
2352
|
}
|
|
2051
2353
|
this._shared.initPromise = new Promise(async (resolve, reject) => {
|
|
2052
2354
|
try {
|
|
2053
|
-
if (this.isMock() && options?.mock) {
|
|
2054
|
-
Object.assign(this._mock, options.mock);
|
|
2055
|
-
console.log("[VenusAPI] Mock options applied:", options.mock);
|
|
2056
|
-
}
|
|
2057
2355
|
const result = await this.host.initialize(options);
|
|
2058
2356
|
this._shared.initialized = true;
|
|
2059
2357
|
if (!options || !options.usePreloader) {
|
|
@@ -2081,6 +2379,7 @@ instance.isAvailable = function() {
|
|
|
2081
2379
|
(async () => {
|
|
2082
2380
|
try {
|
|
2083
2381
|
await initializeNumbers(instance);
|
|
2382
|
+
console.log("[Venus SDK] Numbers system initialized");
|
|
2084
2383
|
} catch (error) {
|
|
2085
2384
|
console.error("[Venus SDK] Failed to initialize numbers system:", error);
|
|
2086
2385
|
}
|