1
- ( ( ) => { let o = Breinify . UTL . _jquery ( ) , t = { resizable :function ( t ) { let e = o ( "body" ) , i = t . find ( "#resize-handle" ) . data ( "isResizing" , ! 1 ) ; i . mousedown ( t => { i . data ( { isResizing :! 0 , startX :t . clientX , startWidth :i . parent ( ) [ 0 ] . getBoundingClientRect ( ) . width } ) , e . css ( "user-select" , "none" ) , t . preventDefault ( ) } ) , o ( document ) . on ( "mouseup blur" , t => { ! 0 === i . data ( "isResizing" ) && ( i . data ( "isResizing" , ! 1 ) , e . css ( "user-select" , "" ) ) } ) , o ( document ) . mousemove ( t => { var e ; ! 0 != ! i . data ( "isResizing" ) && ( e = i . data ( "startWidth" ) , t = i . data ( "startX" ) - t . clientX , e = Math . min ( Math . max ( e + t , 200 ) , 1e3 ) , i . parent ( ) . css ( "width" , e + "px" ) ) } ) } } ; class e extends HTMLElement { $shadowRoot = null ; $toggleButton = null ; $panel = null ; $closeBtn = null ; $tabs = null ; $logContainer = null ; $infoContainer = null ; constructor ( ) { super ( ) , this . attachShadow ( { mode :"open" } ) , this . isVisible = ! 0 , this . render ( ) , this . toggleDevStudio ( ) } render ( ) { this . shadowRoot . innerHTML = `
1
+ ( ( ) => { let o = Breinify . UTL . _jquery ( ) , t = { resizable :function ( t ) { let e = o ( "body" ) , i = t . find ( "#resize-handle" ) . data ( "isResizing" , ! 1 ) ; i . mousedown ( t => { i . data ( { isResizing :! 0 , startX :t . clientX , startWidth :i . parent ( ) [ 0 ] . getBoundingClientRect ( ) . width } ) , e . css ( "user-select" , "none" ) , t . preventDefault ( ) } ) , o ( document ) . on ( "mouseup blur" , ( ) => { ! 0 === i . data ( "isResizing" ) && ( i . data ( "isResizing" , ! 1 ) , e . css ( "user-select" , "" ) ) } ) , o ( document ) . mousemove ( t => { var e ; ! 0 != ! i . data ( "isResizing" ) && ( e = i . data ( "startWidth" ) , t = i . data ( "startX" ) - t . clientX , e = Math . min ( Math . max ( e + t , 200 ) , 1e3 ) , i . parent ( ) . css ( "width" , e + "px" ) ) } ) } } ; class e extends HTMLElement { $shadowRoot = null ; $toggleButton = null ; $panel = null ; $closeBtn = null ; $tabs = null ; $logContainer = null ; $infoContainer = null ; constructor ( ) { super ( ) , this . attachShadow ( { mode :"open" } ) , this . isVisible = ! 0 , this . render ( ) , this . toggleDevStudio ( ) } render ( ) { this . shadowRoot . innerHTML = `
2
2
<style>
3
3
:host { all: initial; }
4
4
div.title { display: flex; flex-flow: row; font-weight: bold; font-size: 14px; line-height: 14px; padding: 6px 10px; }
35
35
<div id="log-container" class="container active"></div>
36
36
<div id="info-container" class="container"></div>
37
37
</div>
38
- <div id="toggle-button" title="Show Breinify DevStudio" role="button" tabindex="0"><svg xmlns="http://www.w3.org/2000/svg" fill="white" width="16" height="16" viewBox="0 0 24 24"><path d="M12 2C8.1 2 6 4.4 6 7v5c0 .5-.2.9-.5 1.3-.3.4-.5.9-.5 1.4v.3c.1.6.5 1.1 1 1.5.5.4.8 1 .8 1.6 0 .6.2 1.1.5 1.5s.7.7 1.2.9V21c0 .6.4 1 1 1s1-.4 1-1v-1h2v1c0 .6.4 1 1 1s1-.4 1-1v-1.5c.5-.2.9-.5 1.2-.9s.5-.9.5-1.5c0-.6.3-1.2.8-1.6.5-.4.9-.9 1-1.5v-.3c0-.5-.2-1-.5-1.4-.3-.4-.5-.9-.5-1.3V7c0-2.6-2.1-5-6-5z"/></svg></div>` , this . $shadowRoot = o ( this . shadowRoot ) , this . $toggleButton = this . $shadowRoot . find ( "#toggle-button" ) , this . $panel = this . $shadowRoot . find ( "#panel" ) , this . $closeBtn = this . $shadowRoot . find ( "button.close-btn" ) , this . $tabs = this . $shadowRoot . find ( "button.tab" ) , this . $logContainer = this . $shadowRoot . find ( "#log-container" ) , this . $infoContainer = this . $shadowRoot . find ( "#info-container" ) , this . $closeBtn . click ( ( ) => this . toggleDevStudio ( ) ) , this . $toggleButton . click ( ( ) => this . toggleDevStudio ( ) ) , this . $tabs . click ( t => this . switchTab ( t ) ) , t . resizable ( this . $shadowRoot ) } toggleDevStudio ( ) { this . isVisible = ! this . isVisible , this . isVisible ?( this . $panel . css ( "transform" , "translateY(0)" ) , this . $panel . css ( "opacity" , "1" ) , this . $toggleButton . css ( "display" , "none" ) ) :( this . $panel . css ( "transform" , "translateY(100%)" ) , this . $panel . css ( "opacity" , "0" ) , this . $toggleButton . css ( "display" , "flex" ) ) } switchTab ( t ) { let e = t . target . dataset . tab ; this . $tabs . each ( function ( ) { this . classList . toggle ( "active" , this . dataset . tab === e ) } ) , "console" === e ?( this . $logContainer . addClass ( "active" ) , this . $infoContainer . removeClass ( "active" ) ) :"info" === e && ( this . $logContainer . removeClass ( "active" ) , this . $infoContainer . addClass ( "active" ) ) } } let i = Breinify . plugins . _add ( "devStudio" , { devStudio :null , init :function ( ) { var t ; ! 0 === Breinify . UTL . internal . isDevMode ( ) && null === this . devStudio && ( t = "breinify-dev-console" , customElements . define ( t , e ) , this . devStudio = document . createElement ( t ) , document . body . appendChild ( this . devStudio ) ) } } ) ; Breinify . onReady ( function ( ) { i . init ( ) } ) } ) ( ) ;
38
+ <div id="toggle-button" title="Show Breinify DevStudio" role="button" tabindex="0"><svg xmlns="http://www.w3.org/2000/svg" fill="white" width="16" height="16" viewBox="0 0 24 24"><path d="M12 2C8.1 2 6 4.4 6 7v5c0 .5-.2.9-.5 1.3-.3.4-.5.9-.5 1.4v.3c.1.6.5 1.1 1 1.5.5.4.8 1 .8 1.6 0 .6.2 1.1.5 1.5s.7.7 1.2.9V21c0 .6.4 1 1 1s1-.4 1-1v-1h2v1c0 .6.4 1 1 1s1-.4 1-1v-1.5c.5-.2.9-.5 1.2-.9s.5-.9.5-1.5c0-.6.3-1.2.8-1.6.5-.4.9-.9 1-1.5v-.3c0-.5-.2-1-.5-1.4-.3-.4-.5-.9-.5-1.3V7c0-2.6-2.1-5-6-5z"/></svg></div>` , this . $shadowRoot = o ( this . shadowRoot ) , this . $toggleButton = this . $shadowRoot . find ( "#toggle-button" ) , this . $panel = this . $shadowRoot . find ( "#panel" ) , this . $closeBtn = this . $shadowRoot . find ( "button.close-btn" ) , this . $tabs = this . $shadowRoot . find ( "button.tab" ) , this . $logContainer = this . $shadowRoot . find ( "#log-container" ) , this . $infoContainer = this . $shadowRoot . find ( "#info-container" ) , this . $closeBtn . click ( ( ) => this . toggleDevStudio ( ) ) , this . $toggleButton . click ( ( ) => this . toggleDevStudio ( ) ) , this . $tabs . click ( t => this . _switchTab ( t ) ) , t . resizable ( this . $shadowRoot ) } toggleDevStudio ( ) { this . isVisible = ! this . isVisible , this . isVisible ?( this . $panel . css ( "transform" , "translateY(0)" ) , this . $panel . css ( "opacity" , "1" ) , this . $toggleButton . css ( "display" , "none" ) ) :( this . $panel . css ( "transform" , "translateY(100%)" ) , this . $panel . css ( "opacity" , "0" ) , this . $toggleButton . css ( "display" , "flex" ) ) } showPluginInfo ( t , e ) { var i = document . createElement ( "div" ) , o = ( i . style . cssText = `
39
+ background: linear-gradient(to bottom, #2a2a2a, #1f1f1f);
40
+ border: 1px solid #333;
41
+ border-left: 4px solid #4fc3f7;
42
+ border-radius: 6px;
43
+ margin-bottom: 12px;
44
+ box-shadow: 0 2px 4px rgba(0,0,0,0.3);
45
+ overflow: hidden;
46
+ transition: max-height 0.3s ease, padding 0.3s ease;
47
+ ` , document . createElement ( "div" ) ) ; o . style . cssText = `
48
+ font-size: 14px;
49
+ font-weight: bold;
50
+ color: #4fc3f7;
51
+ padding: 10px 12px;
52
+ cursor: pointer;
53
+ user-select: none;
54
+ position: relative;
55
+ ` , o . textContent = "🔌 " + t ; let n = document . createElement ( "span" ) , s = ( n . textContent = "▶" , n . style . cssText = `
56
+ position: absolute;
57
+ right: 12px;
58
+ top: 10px;
59
+ font-size: 12px;
60
+ transform-origin: center;
61
+ transition: transform 0.3s ease;
62
+ ` , o . appendChild ( n ) , document . createElement ( "div" ) ) , a = ( s . style . cssText = `
63
+ max-height: 0;
64
+ overflow: hidden;
65
+ transition: max-height 0.3s ease, padding 0.3s ease;
66
+ padding: 0 12px;
67
+ ` , document . createElement ( "ul" ) ) , d = ( a . style . cssText = `
68
+ list-style-type: none;
69
+ padding-left: 0;
70
+ margin: 0;
71
+ ` , Object . entries ( e ) . forEach ( ( [ t , e ] ) => { var i = document . createElement ( "li" ) ; i . innerHTML = `<span style="color:#bbb;">${ t } :</span> <span style="color:#fff;">${ e } </span>` , i . style . marginBottom = "4px" , a . appendChild ( i ) } ) , s . appendChild ( a ) , i . appendChild ( o ) , i . appendChild ( s ) , this . $infoContainer . prepend ( i ) , ! 1 ) ; o . addEventListener ( "click" , ( ) => { ( d = ! d ) ?( s . style . maxHeight = s . scrollHeight + "px" , s . style . padding = "10px 12px" , n . textContent = "▼" ) :( s . style . maxHeight = "0" , s . style . padding = "0 12px" , n . textContent = "▶" ) } ) } _switchTab ( t ) { let e = t . target . dataset . tab ; this . $tabs . each ( function ( ) { this . classList . toggle ( "active" , this . dataset . tab === e ) } ) , "console" === e ?( this . $logContainer . addClass ( "active" ) , this . $infoContainer . removeClass ( "active" ) ) :"info" === e && ( this . $logContainer . removeClass ( "active" ) , this . $infoContainer . addClass ( "active" ) ) } } let i = Breinify . plugins . _add ( "devStudio" , { devStudio :null , init :function ( ) { var t ; ! 0 === Breinify . UTL . internal . isDevMode ( ) && null === this . devStudio && ( t = "breinify-dev-console" , customElements . define ( t , e ) , this . devStudio = document . createElement ( t ) , document . body . appendChild ( this . devStudio ) ) } } ) ; Breinify . onReady ( function ( ) { i . init ( ) } ) } ) ( ) ;
0 commit comments