@series-inc/venus-sdk 3.4.2 → 3.4.3-beta.1
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-ihIIoDSK.d.ts → AdsApi-Dt9Yx0qb.d.ts} +30 -2
- package/dist/SandboxHost-PG4SXT3M.js +1880 -0
- package/dist/SandboxHost-PG4SXT3M.js.map +1 -0
- package/dist/chunk-MQ4UC45P.js +1890 -0
- package/dist/chunk-MQ4UC45P.js.map +1 -0
- package/dist/{chunk-W74ZI2H3.js → chunk-Q7SNANYR.js} +67 -1872
- package/dist/chunk-Q7SNANYR.js.map +1 -0
- package/dist/index.d.ts +31 -4
- package/dist/index.js +2 -1
- package/dist/venus-api/index.d.ts +2 -2
- package/dist/venus-api/index.js +44 -29
- package/dist/venus-api/index.js.map +1 -1
- package/dist/vite/index.css +19 -0
- package/dist/vite/index.css.map +1 -0
- package/dist/vite/index.d.ts +100 -1
- package/dist/vite/index.js +1165 -3
- package/dist/vite/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-W74ZI2H3.js.map +0 -1
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/* raw-loader:/Users/pchan/Development/series/venus/venus-sdk/packages/api/src/vite/sandboxToolbarStyle.css */
|
|
2
|
+
input[style*="background: rgba(0, 0, 0, 0.2)"],
|
|
3
|
+
select[style*="background: rgba(0, 0, 0, 0.2)"] {
|
|
4
|
+
box-sizing: border-box;
|
|
5
|
+
}
|
|
6
|
+
input[style*="background: rgba(0, 0, 0, 0.2)"]:focus,
|
|
7
|
+
select[style*="background: rgba(0, 0, 0, 0.2)"]:focus {
|
|
8
|
+
outline: none;
|
|
9
|
+
border-color: rgba(59, 130, 246, 0.5) !important;
|
|
10
|
+
box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
|
|
11
|
+
}
|
|
12
|
+
button[style*="background: #3B82F6"]:hover {
|
|
13
|
+
background: #2563EB !important;
|
|
14
|
+
}
|
|
15
|
+
button[style*="background: #3B82F6"]:disabled {
|
|
16
|
+
opacity: 0.5;
|
|
17
|
+
cursor: not-allowed;
|
|
18
|
+
}
|
|
19
|
+
/*# sourceMappingURL=index.css.map */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["raw-loader:/Users/pchan/Development/series/venus/venus-sdk/packages/api/src/vite/sandboxToolbarStyle.css"],"sourcesContent":["/* Minimal CSS - FAB uses inline styles only for guaranteed floating behavior */\r\n\r\n/* Optional: Override input styling for modal if needed */\r\ninput[style*=\"background: rgba(0, 0, 0, 0.2)\"],\r\nselect[style*=\"background: rgba(0, 0, 0, 0.2)\"] {\r\n box-sizing: border-box;\r\n}\r\n\r\ninput[style*=\"background: rgba(0, 0, 0, 0.2)\"]:focus,\r\nselect[style*=\"background: rgba(0, 0, 0, 0.2)\"]:focus {\r\n outline: none;\r\n border-color: rgba(59, 130, 246, 0.5) !important;\r\n box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);\r\n}\r\n\r\nbutton[style*=\"background: #3B82F6\"]:hover {\r\n background: #2563EB !important;\r\n}\r\n\r\nbutton[style*=\"background: #3B82F6\"]:disabled {\r\n opacity: 0.5;\r\n cursor: not-allowed;\r\n}\r\n"],"mappings":";AAGA,KAAK,CAAC;AACN,MAAM,CAAC;AACL,cAAY;AACd;AAEA,KAAK,CAAC,wCAAwC;AAC9C,MAAM,CAAC,wCAAwC;AAC7C,WAAS;AACT,gBAAc,KAAK,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE;AACjC,cAAY,EAAE,EAAE,EAAE,IAAI,KAAK,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE;AAC3C;AAEA,MAAM,CAAC,6BAA6B;AAClC,cAAY;AACd;AAEA,MAAM,CAAC,6BAA6B;AAClC,WAAS;AACT,UAAQ;AACV;","names":[]}
|
package/dist/vite/index.d.ts
CHANGED
|
@@ -54,4 +54,103 @@ declare function cdnPlugin(): {
|
|
|
54
54
|
closeBundle(): void;
|
|
55
55
|
};
|
|
56
56
|
|
|
57
|
-
|
|
57
|
+
/**
|
|
58
|
+
* Sandbox configuration helpers.
|
|
59
|
+
*
|
|
60
|
+
* Sandbox mode enables H5 apps to run in browser (via Vite) while communicating
|
|
61
|
+
* with the real Firebase backend.
|
|
62
|
+
*
|
|
63
|
+
* Authentication flow:
|
|
64
|
+
* 1. Vite plugin reads game.config.json and CLI config for environment
|
|
65
|
+
* 2. Firebase config is injected into page via window.__VENUS_SANDBOX__
|
|
66
|
+
* 3. User signs in with Google once (persisted in IndexedDB)
|
|
67
|
+
* 4. All API calls use Firebase Auth session automatically
|
|
68
|
+
*/
|
|
69
|
+
type SandboxTarget = 'local' | 'dev' | 'staging';
|
|
70
|
+
/**
|
|
71
|
+
* Firebase configuration for a specific environment.
|
|
72
|
+
*/
|
|
73
|
+
interface SandboxFirebaseConfig {
|
|
74
|
+
apiKey: string;
|
|
75
|
+
authDomain: string;
|
|
76
|
+
projectId: string;
|
|
77
|
+
appId?: string;
|
|
78
|
+
storageBucket?: string;
|
|
79
|
+
messagingSenderId?: string;
|
|
80
|
+
measurementId?: string;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Configuration injected by the Vite dev server for sandbox mode.
|
|
84
|
+
*/
|
|
85
|
+
interface SandboxConfig {
|
|
86
|
+
/** Whether sandbox mode is enabled */
|
|
87
|
+
enabled: boolean;
|
|
88
|
+
/** Target environment: local (emulator), dev, or staging */
|
|
89
|
+
target: SandboxTarget;
|
|
90
|
+
/** Game/App ID from game.config.json */
|
|
91
|
+
gameId: string;
|
|
92
|
+
/** Firebase configuration for the target environment */
|
|
93
|
+
firebaseConfig?: SandboxFirebaseConfig;
|
|
94
|
+
/** Cloud Functions region */
|
|
95
|
+
functionsRegion?: string;
|
|
96
|
+
/**
|
|
97
|
+
* Base URL for backend RPC calls.
|
|
98
|
+
* For local: http://localhost:5001/{projectId}/{region}
|
|
99
|
+
* For dev/staging: Cloud Run proxy URL from CLI config
|
|
100
|
+
*/
|
|
101
|
+
backendUrl?: string;
|
|
102
|
+
/** Emulator hosts for local development */
|
|
103
|
+
functionsEmulatorHost?: string;
|
|
104
|
+
firestoreEmulatorHost?: string;
|
|
105
|
+
authEmulatorHost?: string;
|
|
106
|
+
/** RPC configuration */
|
|
107
|
+
pollingInterval?: number;
|
|
108
|
+
rpcMaxRetries?: number;
|
|
109
|
+
rpcRetryDelayMs?: number;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Global interface for sandbox config injected by Vite
|
|
113
|
+
*/
|
|
114
|
+
declare global {
|
|
115
|
+
interface Window {
|
|
116
|
+
__VENUS_SANDBOX__?: SandboxConfig;
|
|
117
|
+
__VENUS_SANDBOX_SIGN_IN__?: () => Promise<void>;
|
|
118
|
+
__VENUS_SANDBOX_SIGN_OUT__?: () => Promise<void>;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Vite plugin for Venus sandbox mode.
|
|
124
|
+
*
|
|
125
|
+
* This plugin enables H5 apps to communicate with the real Firebase backend
|
|
126
|
+
* during local development. It:
|
|
127
|
+
* 1. Reads game.config.json for gameId
|
|
128
|
+
* 2. Reads ~/.venus/config.json for target environment
|
|
129
|
+
* 3. Injects Firebase config and toolbar into the page
|
|
130
|
+
*
|
|
131
|
+
* Authentication is handled by the browser via Google sign-in (one-time,
|
|
132
|
+
* persisted in IndexedDB).
|
|
133
|
+
*
|
|
134
|
+
* Usage:
|
|
135
|
+
* ```typescript
|
|
136
|
+
* // vite.config.ts
|
|
137
|
+
* import { defineConfig } from 'vite'
|
|
138
|
+
* import { venusSandboxPlugin } from '@series-inc/venus-sdk/vite'
|
|
139
|
+
*
|
|
140
|
+
* export default defineConfig({
|
|
141
|
+
* plugins: [
|
|
142
|
+
* venusSandboxPlugin(),
|
|
143
|
+
* ],
|
|
144
|
+
* })
|
|
145
|
+
* ```
|
|
146
|
+
*/
|
|
147
|
+
|
|
148
|
+
interface VenusSandboxPluginOptions {
|
|
149
|
+
/** Override the target environment (default: reads from ~/.venus/config.json) */
|
|
150
|
+
target?: SandboxTarget;
|
|
151
|
+
/** Disable sandbox even if configured */
|
|
152
|
+
disabled?: boolean;
|
|
153
|
+
}
|
|
154
|
+
declare function venusSandboxPlugin(options?: VenusSandboxPluginOptions): Plugin;
|
|
155
|
+
|
|
156
|
+
export { type VenusLibrariesPluginOptions, type VenusSandboxPluginOptions, cdnPlugin, venusLibrariesPlugin, venusSandboxPlugin };
|