@@ -212,7 +212,7 @@ const Te = {
212212 tomorrow : "'tomorrow at' p" ,
213213 nextWeek : "eeee 'at' p" ,
214214 other : "P"
215- } , Me = ( r , e , t , n ) => ke [ r ] ;
215+ } , Ce = ( r , e , t , n ) => ke [ r ] ;
216216function D ( r ) {
217217 return ( e , t ) => {
218218 const n = t != null && t . context ? String ( t . context ) : "standalone" ;
@@ -228,7 +228,7 @@ function D(r) {
228228 return a [ o ] ;
229229 } ;
230230}
231- const Ce = {
231+ const Me = {
232232 narrow : [ "B" , "A" ] ,
233233 abbreviated : [ "BC" , "AD" ] ,
234234 wide : [ "Before Christ" , "Anno Domini" ]
@@ -356,7 +356,7 @@ const Ce = {
356356} , Fe = {
357357 ordinalNumber : Oe ,
358358 era : D ( {
359- values : Ce ,
359+ values : Me ,
360360 defaultWidth : "wide"
361361 } ) ,
362362 quarter : D ( {
@@ -527,7 +527,7 @@ const qe = /^(\d+)(th|st|nd|rd)?/i, Ye = /\d+/i, Be = {
527527 code : "en-US" ,
528528 formatDistance : xe ,
529529 formatLong : Ie ,
530- formatRelative : Me ,
530+ formatRelative : Ce ,
531531 localize : Fe ,
532532 match : Ge ,
533533 options : {
@@ -619,7 +619,7 @@ const I = {
619619 ) ;
620620 return b ( a , e . length ) ;
621621 }
622- } , C = {
622+ } , M = {
623623 midnight : "midnight" ,
624624 noon : "noon" ,
625625 morning : "morning" ,
@@ -961,7 +961,7 @@ const I = {
961961 b : function ( r , e , t ) {
962962 const n = r . getHours ( ) ;
963963 let a ;
964- switch ( n === 12 ? a = C . noon : n === 0 ? a = C . midnight : a = n / 12 >= 1 ? "pm" : "am" , e ) {
964+ switch ( n === 12 ? a = M . noon : n === 0 ? a = M . midnight : a = n / 12 >= 1 ? "pm" : "am" , e ) {
965965 case "b" :
966966 case "bb" :
967967 return t . dayPeriod ( a , {
@@ -990,7 +990,7 @@ const I = {
990990 B : function ( r , e , t ) {
991991 const n = r . getHours ( ) ;
992992 let a ;
993- switch ( n >= 17 ? a = C . evening : n >= 12 ? a = C . afternoon : n >= 4 ? a = C . morning : a = C . night , e ) {
993+ switch ( n >= 17 ? a = M . evening : n >= 12 ? a = M . afternoon : n >= 4 ? a = M . morning : a = M . night , e ) {
994994 case "B" :
995995 case "BB" :
996996 case "BBB" :
@@ -1055,11 +1055,11 @@ const I = {
10551055 return J ( n ) ;
10561056 case "XXXX" :
10571057 case "XX" :
1058- return M ( n ) ;
1058+ return C ( n ) ;
10591059 case "XXXXX" :
10601060 case "XXX" :
10611061 default :
1062- return M ( n , ":" ) ;
1062+ return C ( n , ":" ) ;
10631063 }
10641064 } ,
10651065 // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
@@ -1070,11 +1070,11 @@ const I = {
10701070 return J ( n ) ;
10711071 case "xxxx" :
10721072 case "xx" :
1073- return M ( n ) ;
1073+ return C ( n ) ;
10741074 case "xxxxx" :
10751075 case "xxx" :
10761076 default :
1077- return M ( n , ":" ) ;
1077+ return C ( n , ":" ) ;
10781078 }
10791079 } ,
10801080 // Timezone (GMT)
@@ -1087,7 +1087,7 @@ const I = {
10871087 return "GMT" + K ( n , ":" ) ;
10881088 case "OOOO" :
10891089 default :
1090- return "GMT" + M ( n , ":" ) ;
1090+ return "GMT" + C ( n , ":" ) ;
10911091 }
10921092 } ,
10931093 // Timezone (specific non-location)
@@ -1100,7 +1100,7 @@ const I = {
11001100 return "GMT" + K ( n , ":" ) ;
11011101 case "zzzz" :
11021102 default :
1103- return "GMT" + M ( n , ":" ) ;
1103+ return "GMT" + C ( n , ":" ) ;
11041104 }
11051105 } ,
11061106 // Seconds timestamp
@@ -1118,9 +1118,9 @@ function K(r, e = "") {
11181118 return o === 0 ? t + String ( a ) : t + String ( a ) + e + b ( o , 2 ) ;
11191119}
11201120function J ( r , e ) {
1121- return r % 60 === 0 ? ( r > 0 ? "-" : "+" ) + b ( Math . abs ( r ) / 60 , 2 ) : M ( r , e ) ;
1121+ return r % 60 === 0 ? ( r > 0 ? "-" : "+" ) + b ( Math . abs ( r ) / 60 , 2 ) : C ( r , e ) ;
11221122}
1123- function M ( r , e = "" ) {
1123+ function C ( r , e = "" ) {
11241124 const t = r > 0 ? "-" : "+" , n = Math . abs ( r ) , a = b ( Math . trunc ( n / 60 ) , 2 ) , o = b ( n % 60 , 2 ) ;
11251125 return t + a + e + o ;
11261126}
@@ -2353,12 +2353,56 @@ class Pt {
23532353 this . firstPanelTabs = t , this . debouncedUpdateTabsUI ( ) , this . saveFirstPanelTabs ( ) , this . saveClosedTabs ( ) , console . log ( `🗑️ 已关闭其他 ${ a } 个标签,保留了当前标签和固定标签` ) ;
23542354 }
23552355 /**
2356- * 重命名标签(使用Orca原生InputBox )
2356+ * 重命名标签(内联编辑 )
23572357 */
23582358 renameTab ( e ) {
23592359 if ( this . currentPanelIndex !== 0 ) return ;
23602360 const t = document . querySelector ( ".tab-context-menu" ) ;
2361- t && t . remove ( ) , this . showOrcaRenameInput ( e ) ;
2361+ t && t . remove ( ) , this . showInlineRenameInput ( e ) ;
2362+ }
2363+ /**
2364+ * 显示内联重命名输入框
2365+ */
2366+ showInlineRenameInput ( e ) {
2367+ const t = document . querySelector ( `[data-tab-id="${ e . blockId } "]` ) ;
2368+ if ( ! t ) {
2369+ console . warn ( "找不到对应的标签元素" ) ;
2370+ return ;
2371+ }
2372+ const n = t . querySelector ( ".inline-rename-input" ) ;
2373+ n && n . remove ( ) ;
2374+ const a = t . textContent , o = t . style . cssText , s = document . createElement ( "input" ) ;
2375+ s . type = "text" , s . value = e . title , s . className = "inline-rename-input" ;
2376+ const i = orca . state . themeMode === "dark" ;
2377+ let c = i ? "rgba(255, 255, 255, 0.1)" : "rgba(200, 200, 200, 0.6)" , d = i ? "#ffffff" : "#333" ;
2378+ e . color && ( c = this . applyOklchFormula ( e . color , "background" ) , d = this . applyOklchFormula ( e . color , "text" ) ) , s . style . cssText = `
2379+ background: ${ c } ;
2380+ color: ${ d } ;
2381+ border: 2px solid #3b82f6;
2382+ border-radius: 4px;
2383+ padding: 2px 8px;
2384+ height: 20px;
2385+ line-height: 20px;
2386+ font-size: 12px;
2387+ font-weight: 600;
2388+ outline: none;
2389+ width: 100%;
2390+ max-width: 150px;
2391+ box-sizing: border-box;
2392+ -webkit-app-region: no-drag;
2393+ app-region: no-drag;
2394+ ` , t . textContent = "" , t . appendChild ( s ) , t . style . padding = "2px 8px" , s . focus ( ) , s . select ( ) ;
2395+ const l = ( ) => {
2396+ const h = s . value . trim ( ) ;
2397+ h && h !== e . title && this . updateTabTitle ( e , h ) , t . textContent = a , t . style . cssText = o ;
2398+ } , u = ( ) => {
2399+ t . textContent = a , t . style . cssText = o ;
2400+ } ;
2401+ s . addEventListener ( "blur" , l ) , s . addEventListener ( "keydown" , ( h ) => {
2402+ h . key === "Enter" ? ( h . preventDefault ( ) , l ( ) ) : h . key === "Escape" && ( h . preventDefault ( ) , u ( ) ) ;
2403+ } ) , s . addEventListener ( "click" , ( h ) => {
2404+ h . stopPropagation ( ) ;
2405+ } ) ;
23622406 }
23632407 /**
23642408 * 使用Orca原生InputBox显示重命名输入框
0 commit comments