@series-inc/venus-sdk 3.0.4 → 3.0.6

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.
@@ -1,5 +1,5 @@
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';
1
+ import { V as VenusAPI$1 } from '../AdsApi-CIXV8I_p.mjs';
2
+ export { bN as ActionSheetOption, bF as BatchRecipeRequirementsResult, q as Profile, bE as RecipeRequirementQuery, ad as RecipeRequirementResult, bz as SimulationActiveRunsUpdate, by as SimulationEntityUpdate, a7 as SimulationRunSummary, bA as SimulationSnapshotUpdate, U as SimulationSubscribeOptions, bB as SimulationUpdateData, bx as SimulationUpdateType, bI as VenusAvailableRecipe, bJ as VenusCollectRecipeResult, bL as VenusConfig, bG as VenusExecuteRecipeOptions, bK as VenusExecuteRecipeResult, bH as VenusExecuteScopedRecipeOptions, am as VenusRoom, bM as VenusRoomsConfig, a2 as VenusSimulationConfig, bC as VenusSimulationEffect, bD as VenusSimulationRecipe, bw as VenusSimulationStateResponse } from '../AdsApi-CIXV8I_p.mjs';
3
3
 
4
4
  /**
5
5
  * TypeScript definitions for venus-api
@@ -1,5 +1,5 @@
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';
1
+ import { V as VenusAPI$1 } from '../AdsApi-CIXV8I_p.js';
2
+ export { bN as ActionSheetOption, bF as BatchRecipeRequirementsResult, q as Profile, bE as RecipeRequirementQuery, ad as RecipeRequirementResult, bz as SimulationActiveRunsUpdate, by as SimulationEntityUpdate, a7 as SimulationRunSummary, bA as SimulationSnapshotUpdate, U as SimulationSubscribeOptions, bB as SimulationUpdateData, bx as SimulationUpdateType, bI as VenusAvailableRecipe, bJ as VenusCollectRecipeResult, bL as VenusConfig, bG as VenusExecuteRecipeOptions, bK as VenusExecuteRecipeResult, bH as VenusExecuteScopedRecipeOptions, am as VenusRoom, bM as VenusRoomsConfig, a2 as VenusSimulationConfig, bC as VenusSimulationEffect, bD as VenusSimulationRecipe, bw as VenusSimulationStateResponse } from '../AdsApi-CIXV8I_p.js';
3
3
 
4
4
  /**
5
5
  * TypeScript definitions for venus-api
@@ -1,188 +1,5 @@
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
- }
1
+ import { 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-LBJFUHOH.mjs';
2
+ import { createProxiedObject, createProxiedMethod } from '../chunk-MWUS3A7C.mjs';
186
3
 
187
4
  // src/venus-api/systems/asset-loader.js
188
5
  var VenusAssetLoader = class {
@@ -316,14 +133,11 @@ var VenusAssetLoader = class {
316
133
  }, 1e4);
317
134
  if (type === "image") {
318
135
  const img = new Image();
319
- console.log(`\u{1F5BC}\uFE0F [Asset Verification] Verifying image: ${url}`);
320
136
  img.onload = () => {
321
- console.log(`\u2705 [Asset Verification] Image verified successfully: ${url}`);
322
137
  clearTimeout(timeout);
323
138
  resolve();
324
139
  };
325
140
  img.onerror = (error) => {
326
- console.log(`\u274C [Asset Verification] Image verification failed: ${url}`, error);
327
141
  clearTimeout(timeout);
328
142
  reject(new Error("Failed to load image"));
329
143
  };
@@ -375,7 +189,6 @@ var VenusAssetLoader = class {
375
189
  const CDN_BASE_URL = "https://venus-static-01293ak.web.app/";
376
190
  const cleanUrl = url.startsWith("/") ? url.slice(1) : url;
377
191
  const fullUrl = CDN_BASE_URL + cleanUrl;
378
- console.log(`\u{1F310} [Asset Loader] Force remote CDN: ${url} -> ${fullUrl}`);
379
192
  return fullUrl;
380
193
  }
381
194
  if (this.venusAPI && this.venusAPI.isMock && this.venusAPI.isMock()) {
@@ -1934,7 +1747,7 @@ function createNumbersAPI() {
1934
1747
  return numbersAPI;
1935
1748
  }
1936
1749
  async function initializeNumbers(venusApiInstance) {
1937
- const { createProxiedObject: createProxiedObject2, createProxiedMethod: createProxiedMethod2 } = await import('../core-R3FHW62G.mjs');
1750
+ const { createProxiedObject: createProxiedObject2, createProxiedMethod: createProxiedMethod2 } = await import('../core-RDMPQV6U.mjs');
1938
1751
  const numbersAPI = createNumbersAPI();
1939
1752
  venusApiInstance.numbers = createProxiedObject2.call(
1940
1753
  venusApiInstance,
@@ -1956,7 +1769,6 @@ async function initializeNumbers(venusApiInstance) {
1956
1769
  }
1957
1770
 
1958
1771
  // src/venus-api/index.js
1959
- init_rooms();
1960
1772
  var HapticStyle = {
1961
1773
  LIGHT: "light",
1962
1774
  MEDIUM: "medium",
@@ -2007,67 +1819,6 @@ var VenusAPI2 = class {
2007
1819
  height: 60
2008
1820
  }
2009
1821
  },
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
1822
  // Static locale data at top level
2072
1823
  locale: "en-US",
2073
1824
  languageCode: "en",
@@ -2198,58 +1949,26 @@ var VenusAPI2 = class {
2198
1949
  deviceType: "phone",
2199
1950
  hapticsEnabled: false,
2200
1951
  haptics: { supported: false, enabled: false }
1952
+ }
1953
+ });
1954
+ const originalConfig = this.config;
1955
+ this.config = new Proxy(originalConfig, {
1956
+ get(target, prop) {
1957
+ if (prop === "locale" || prop === "languageCode") {
1958
+ console.error(
1959
+ `[Venus SDK] config.${prop} is deprecated and will be removed in v4.0.0. Use VenusAPI.${prop === "locale" ? "getLocale()" : "getLanguageCode()"}() instead.`
1960
+ );
1961
+ }
1962
+ return target[prop];
2201
1963
  },
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
- }
1964
+ set(target, prop, value) {
1965
+ if (prop === "locale" || prop === "languageCode") {
1966
+ console.error(
1967
+ `[Venus SDK] config.${prop} is deprecated and will be removed in v4.0.0. Use VenusAPI.${prop === "locale" ? "getLocale()" : "getLanguageCode()"}() instead.`
1968
+ );
2252
1969
  }
1970
+ target[prop] = value;
1971
+ return true;
2253
1972
  }
2254
1973
  });
2255
1974
  const isInsideHostedEnv = this._bootstrap.isInsideHostedEnvironment;
@@ -2258,7 +1977,6 @@ var VenusAPI2 = class {
2258
1977
  initializeStorage(this, host);
2259
1978
  initializeRoomsApi(this, host);
2260
1979
  initializeAds(this, host);
2261
- initializeTheme(this);
2262
1980
  initializePopups(this, host);
2263
1981
  initializeAnalytics(this, host);
2264
1982
  initializeIap(this, host);
@@ -2282,6 +2000,28 @@ var VenusAPI2 = class {
2282
2000
  initializeSimulation(this, host);
2283
2001
  initializeSocial(this, host);
2284
2002
  initializeAssetLoader(this, createProxiedMethod);
2003
+ this.getLocale = () => {
2004
+ if (typeof window !== "undefined" && window.venus) {
2005
+ const venus = window.venus;
2006
+ if (venus.config && venus.config.locale) {
2007
+ return venus.config.locale;
2008
+ }
2009
+ if (venus._config && venus._config.locale) {
2010
+ return venus._config.locale;
2011
+ }
2012
+ if (venus.config?.environment?.browserInfo?.language) {
2013
+ return venus.config.environment.browserInfo.language;
2014
+ }
2015
+ }
2016
+ if (typeof navigator !== "undefined" && navigator.language) {
2017
+ return navigator.language;
2018
+ }
2019
+ return "en-US";
2020
+ };
2021
+ this.getLanguageCode = () => {
2022
+ const locale = this.getLocale();
2023
+ return locale.split("-")[0];
2024
+ };
2285
2025
  }
2286
2026
  // Generate deterministic instance ID based on current page URL
2287
2027
  _generateDeterministicInstanceId() {
@@ -2318,13 +2058,9 @@ var VenusAPI2 = class {
2318
2058
  // BOOTSTRAP METHODS
2319
2059
  //---------------------------------------
2320
2060
  _detectHostedEnvironment() {
2321
- console.log("[Venus SDK] Detecting host environment...");
2322
2061
  const isInIframe = window.self !== window.top;
2323
2062
  const hasReactNativeWebView = typeof window.ReactNativeWebView !== "undefined";
2324
2063
  this._bootstrap.isInsideHostedEnvironment = isInIframe || hasReactNativeWebView;
2325
- console.log(
2326
- `[Venus SDK] isInIframe: ${isInIframe}, hasReactNativeWebView: ${hasReactNativeWebView}`
2327
- );
2328
2064
  }
2329
2065
  isMobile() {
2330
2066
  return typeof window.ReactNativeWebView !== "undefined";
@@ -2379,7 +2115,6 @@ instance.isAvailable = function() {
2379
2115
  (async () => {
2380
2116
  try {
2381
2117
  await initializeNumbers(instance);
2382
- console.log("[Venus SDK] Numbers system initialized");
2383
2118
  } catch (error) {
2384
2119
  console.error("[Venus SDK] Failed to initialize numbers system:", error);
2385
2120
  }