File tree Expand file tree Collapse file tree 11 files changed +65
-40
lines changed
src/Templates/Boilerplate/Bit.Boilerplate
src/Client/Boilerplate.Client.Core Expand file tree Collapse file tree 11 files changed +65
-40
lines changed Original file line number Diff line number Diff line change @@ -226,6 +226,7 @@ custom.aprof
226226
227227/src /** /App_Data /*
228228
229+ /src /Client /Boilerplate.Client.Core /Scripts /* .js
229230/src /Client /Boilerplate.Client.Core /wwwroot /scripts /app * .js
230231/src /Client /Boilerplate.Client.Maui /Platforms /Android /google-services.json
231232
Original file line number Diff line number Diff line change 6767
6868 <Target Name =" BuildJavaScript" Inputs =" @(TypeScriptFiles);tsconfig.json;package.json" Outputs =" wwwroot\scripts\app.js" >
6969 <Exec Command =" node_modules/.bin/tsc" StandardOutputImportance =" high" StandardErrorImportance =" high" />
70- <Exec Condition =" '$(Environment)' == 'Production' " Command =" node_modules/.bin/esbuild wwwroot/scripts/app.js --minify --outfile=wwwroot/scripts/app.js --allow-overwrite" StandardOutputImportance =" high" StandardErrorImportance =" high" />
70+ <Exec Condition =" '$(Environment)' == 'Development' " Command =" node_modules/.bin/esbuild Scripts/index.js --bundle --outfile=wwwroot/scripts/app.js" StandardOutputImportance =" high" StandardErrorImportance =" high" />
71+ <Exec Condition =" '$(Environment)' != 'Development' " Command =" node_modules/.bin/esbuild Scripts/index.js --bundle --outfile=wwwroot/scripts/app.js --minify" StandardOutputImportance =" high" StandardErrorImportance =" high" />
7172 </Target >
7273
7374 <Target Name =" BuildCssFiles" >
Original file line number Diff line number Diff line change 1+ //+:cnd:noEmit
12const gtag = ( window as any ) . googletag = ( window as any ) . googletag || { cmd : [ ] } ;
23
3- class Ads {
4+ export class Ads {
45 private static rewardedSlot : any ;
56 private static rewardPayload : any ;
67 private static slotReadyEvent : any ;
@@ -101,6 +102,4 @@ class Ads {
101102 } )
102103 }
103104 }
104- }
105-
106- ( window as any ) . Ads = Ads ;
105+ }
Original file line number Diff line number Diff line change 11//+:cnd:noEmit
22
3- interface DotNetObject {
4- invokeMethod < T > ( methodIdentifier : string , ...args : any [ ] ) : T ;
5- invokeMethodAsync < T > ( methodIdentifier : string , ...args : any [ ] ) : Promise < T > ;
6- dispose ( ) : void ;
7- }
8-
9- class App {
3+ export class App {
104 // For additional details, see the JsBridge.cs file.
115 private static jsBridgeObj : DotNetObject ;
126
@@ -95,4 +89,3 @@ class App {
9589 }
9690}
9791
98- ( window as any ) . App = App ;
Original file line number Diff line number Diff line change 1+ //+:cnd:noEmit
12// Read Client.web/wwwroot/web-interop-app.html comments.
23
3- declare class BitButil {
4- static webAuthn : {
5- getCredential : ( options : unknown ) => Promise < unknown > ,
6- createCredential : ( options : unknown ) => Promise < unknown >
7- }
8- } ;
9-
10- class WebInteropApp {
4+ export class WebInteropApp {
115 private static autoClose = true ;
126
137 public static async run ( ) {
@@ -116,6 +110,4 @@ class WebInteropApp {
116110 credentials : 'omit'
117111 } ) ;
118112 }
119- }
120-
121- ( window as any ) . WebInteropApp = WebInteropApp ;
113+ }
Original file line number Diff line number Diff line change 11//+:cnd:noEmit
22
3+ import { App } from './App' ;
4+
35( function ( ) {
46 const bswup = ( window as any ) . BitBswup ; // https://bitplatform.dev/bswup
57 if ( ! bswup ) return ;
Original file line number Diff line number Diff line change 11//+:cnd:noEmit
22
3+ import { App } from './App' ;
4+
35( function ( ) {
46 window . addEventListener ( 'load' , handleLoad ) ;
57 window . addEventListener ( 'message' , handleMessage ) ;
Original file line number Diff line number Diff line change 1+ //+:cnd:noEmit
2+
3+ import './bswup' ;
4+ import './theme' ;
5+ import './events' ;
6+ import { App } from './App' ;
7+ import { WebInteropApp } from './WebInteropApp' ;
8+ //#if (ads == true)
9+ import { Ads } from './Ads' ;
10+ //#endif
11+
12+ // Expose classes on window global
13+ ( window as any ) . App = App ;
14+ ( window as any ) . WebInteropApp = WebInteropApp ;
15+ //#if (ads == true)
16+ ( window as any ) . Ads = Ads ;
17+ //#endif
Original file line number Diff line number Diff line change 11//+:cnd:noEmit
22
3- declare class BitTheme { static init ( options : BitThemeOptions ) : void ; } ;
4-
5- interface BitThemeOptions {
6- system ?: boolean ;
7- persist ?: boolean ;
8- theme ?: string | null ;
9- default ?: string | null ;
10- darkTheme ?: string | null ;
11- lightTheme ?: string | null ;
12- onChange ?: onThemeChangeType ;
13- }
14-
15- type onThemeChangeType = ( newThemeName : string , oldThemeName : string ) => void ;
3+ // The following code gives you ideas on how to handle bit theme changes in your application.
164
175( function ( ) {
18- BitTheme ?. init ( {
6+ if ( typeof BitTheme === 'undefined' )
7+ return ;
8+ BitTheme . init ( {
199 system : true ,
2010 persist : true ,
21- onChange : ( newTheme : string , oldTheme : string ) => {
11+ onChange : ( newTheme , oldTheme ) => {
2212 document . body . classList . add ( 'theme-' + newTheme ) ;
2313 document . body . classList . remove ( 'theme-' + oldTheme ) ;
2414
Original file line number Diff line number Diff line change 1+ // Blazor types:
2+ declare interface DotNetObject {
3+ invokeMethod < T > ( methodIdentifier : string , ...args : any [ ] ) : T ;
4+ invokeMethodAsync < T > ( methodIdentifier : string , ...args : any [ ] ) : Promise < T > ;
5+ dispose ( ) : void ;
6+ }
7+
8+ // Bit.Butil types:
9+ declare class BitButil {
10+ static webAuthn : {
11+ getCredential : ( options : unknown ) => Promise < unknown > ,
12+ createCredential : ( options : unknown ) => Promise < unknown >
13+ }
14+ }
15+
16+ // Bit.BlazorUI types:
17+ declare class BitTheme { static init ( options : BitThemeOptions ) : void ; }
18+
19+ declare interface BitThemeOptions {
20+ system ?: boolean ;
21+ persist ?: boolean ;
22+ theme ?: string | null ;
23+ default ?: string | null ;
24+ darkTheme ?: string | null ;
25+ lightTheme ?: string | null ;
26+ onChange ?: ( newThemeName : string , oldThemeName : string ) => void ;
27+ }
You can’t perform that action at this time.
0 commit comments