bootstrap 5 WIP (#7891)

New standard theme that follows your chosen terminal colors, Bootstrap 5 & Angular 15 upgrade
This commit is contained in:
Eugene
2023-02-26 20:42:31 +01:00
committed by GitHub
parent 7a8108b20d
commit 1e5cfd1d4b
215 changed files with 2982 additions and 2447 deletions

View File

@@ -12,6 +12,7 @@ html.tabby
body { transition: 0.5s background; }
body
style#custom-css
root
app-root
.preload-logo
div

View File

@@ -413,7 +413,9 @@ export class Window {
this.touchBarControl.selectedIndex = selectedIndex
})
this.window.webContents.on('new-window', event => event.preventDefault())
this.window.webContents.setWindowOpenHandler(() => {
return { action: 'deny' }
})
ipcMain.on('window-set-disable-vibrancy-while-dragging', (_event, value) => {
this.disableVibrancyWhileDragging = value && this.configStore.hacks?.disableVibrancyWhileDragging

View File

@@ -37,17 +37,19 @@
"optionalDependencies": {
"@tabby-gang/windows-blurbehind": "^3.0.0",
"macos-native-processlist": "^2.1.0",
"patch-package": "^6.5.0",
"serialport": "10.5.0",
"serialport-binding-webserialapi": "^1.0.3",
"windows-native-registry": "^3.2.1",
"windows-process-tree": "^0.3.4",
"patch-package": "^6.5.0"
"windows-process-tree": "^0.3.4"
},
"devDependencies": {
"@ngx-translate/core": "^14.0.0",
"@types/mz": "2.7.4",
"@types/node": "18.7.23",
"@types/node": "18.11.19",
"atomically": "^1.7.0",
"ngx-filesize": "^2.0.16"
"filesize": "^9",
"ngx-filesize": "^3.0.1"
},
"peerDependencies": {
"tabby-community-color-schemes": "*",

View File

@@ -1,14 +1,12 @@
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
import { NgModule } from '@angular/core'
import { ApplicationRef, NgModule } from '@angular/core'
import { BrowserModule } from '@angular/platform-browser'
import { NgbModule } from '@ng-bootstrap/ng-bootstrap'
import { ToastrModule } from 'ngx-toastr'
export function getRootModule (plugins: any[]) {
const imports = [
BrowserModule,
...plugins,
NgbModule,
ToastrModule.forRoot({
positionClass: 'toast-bottom-center',
toastClass: 'toast',
@@ -27,10 +25,12 @@ export function getRootModule (plugins: any[]) {
@NgModule({
imports,
bootstrap,
}) class RootModule {
ngDoBootstrap () {
ngDoBootstrap (appRef: ApplicationRef) {
(window as any)['requestAnimationFrame'] = window[window['Zone'].__symbol__('requestAnimationFrame')]
const componentDef = bootstrap[0]
appRef.bootstrap(componentDef)
}
}

View File

@@ -6,5 +6,4 @@ import '@fortawesome/fontawesome-free/css/solid.css'
import '@fortawesome/fontawesome-free/css/brands.css'
import '@fortawesome/fontawesome-free/css/regular.css'
import '@fortawesome/fontawesome-free/css/fontawesome.css'
import 'ngx-toastr/toastr.css'
import './preload.scss'

View File

@@ -39,8 +39,10 @@ async function bootstrap (bootstrapData: BootstrapData, plugins: PluginInfo[], s
const pluginModules = await loadPlugins(plugins, (current, total) => {
(document.querySelector('.progress .bar') as HTMLElement).style.width = `${100 * current / total}%` // eslint-disable-line
})
window['pluginModules'] = pluginModules
const module = getRootModule(pluginModules)
window['rootModule'] = module
const moduleRef = await platformBrowserDynamic([
{ provide: BOOTSTRAP_DATA, useValue: bootstrapData },
]).bootstrapModule(module)

View File

@@ -13,10 +13,6 @@ body {
user-select: text;
}
[ngbradiogroup] input[type="radio"] {
display: none;
}
a, button {
&.btn {
display: inline-flex;
@@ -53,6 +49,10 @@ a, button {
&>.form-control, &>.input-group {
width: 33%;
}
&>.form-check {
display: flex;
}
}
input[type=range] {
@@ -175,19 +175,19 @@ ngb-typeahead-window {
// Windows high contrast mode
@media screen and (forced-colors: active) {
.custom-switch .custom-control-label::before {
.form-switch .form-check-label::before {
background: buttonface;
}
.custom-switch .custom-control-label::after {
.form-switch .form-check-label::after {
background: buttontext;
}
.custom-switch .custom-control-input:checked ~ .custom-control-label::before {
.form-switch .form-check-input:checked ~ .form-check-label::before {
background: activetext;
}
.custom-switch .custom-control-input:checked ~ .custom-control-label::after {
.form-switch .form-check-input:checked ~ .form-check-label::after {
background: canvas;
}

View File

@@ -1,6 +0,0 @@
import { Component } from '@angular/core'
@Component({
template: '<app-root></app-root>',
})
export class RootComponent { } // eslint-disable-line @typescript-eslint/no-extraneous-class

View File

@@ -8,6 +8,8 @@
box-shadow: 0 1px 0 rgba(0,0,0,.25);
padding: 7px 12px;
background-image: none;
display: block !important;
border: none !important;
width: auto;
flex-basis: auto;
border-radius: 0.5rem;
@@ -15,10 +17,12 @@
&.toast-error {
background-color: #BD362F;
color: white !important;
}
&.toast-info {
background-color: #555;
color: #eee !important;
}
}
}

View File

@@ -1,8 +1,10 @@
const path = require('path')
const webpack = require('webpack')
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
import * as path from 'path'
import wp from 'webpack'
import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer'
import * as url from 'url'
const __dirname = url.fileURLToPath(new URL('.', import.meta.url))
module.exports = {
const config = {
name: 'tabby-main',
target: 'electron-main',
entry: {
@@ -55,13 +57,15 @@ module.exports = {
'yargs/yargs': 'commonjs yargs/yargs',
},
plugins: [
new webpack.optimize.ModuleConcatenationPlugin(),
new webpack.DefinePlugin({
new wp.optimize.ModuleConcatenationPlugin(),
new wp.DefinePlugin({
'process.type': '"main"',
}),
],
}
if (process.env.BUNDLE_ANALYZER) {
module.exports.plugins.push(new BundleAnalyzerPlugin())
config.plugins.push(new BundleAnalyzerPlugin())
}
export default () => config

View File

@@ -1,7 +1,23 @@
const path = require('path')
const webpack = require('webpack')
import * as fs from 'fs'
import * as path from 'path'
import wp from 'webpack'
import * as url from 'url'
const __dirname = url.fileURLToPath(new URL('.', import.meta.url))
module.exports = {
import { AngularWebpackPlugin } from '@ngtools/webpack'
import { createEs2015LinkerPlugin } from '@angular/compiler-cli/linker/babel'
const linkerPlugin = createEs2015LinkerPlugin({
linkerJitMode: true,
fileSystem: {
resolve: path.resolve,
exists: fs.existsSync,
dirname: path.dirname,
relative: path.relative,
readFile: fs.readFileSync,
},
})
export default () => ({
name: 'tabby',
target: 'node',
entry: {
@@ -28,13 +44,22 @@ module.exports = {
},
module: {
rules: [
{
test: /\.(m?)js$/,
loader: 'babel-loader',
options: {
plugins: [linkerPlugin],
compact: false,
cacheDirectory: true,
},
resolve: {
fullySpecified: false,
},
},
{
test: /\.ts$/,
use: {
loader: 'ts-loader',
options: {
configFile: path.resolve(__dirname, 'tsconfig.json'),
},
loader: '@ngtools/webpack',
},
},
{ test: /\.scss$/, use: ['style-loader', 'css-loader', 'sass-loader'] },
@@ -56,9 +81,14 @@ module.exports = {
path: 'commonjs path',
},
plugins: [
new webpack.optimize.ModuleConcatenationPlugin(),
new webpack.DefinePlugin({
new wp.optimize.ModuleConcatenationPlugin(),
new wp.DefinePlugin({
'process.type': '"renderer"',
}),
new AngularWebpackPlugin({
tsconfig: path.resolve(__dirname, 'tsconfig.json'),
directTemplateLoading: false,
jitMode: true,
})
],
}
})

View File

@@ -16,6 +16,13 @@
update-notifier "^2.2.0"
yargs "^8.0.2"
"@ngx-translate/core@^14.0.0":
version "14.0.0"
resolved "https://registry.yarnpkg.com/@ngx-translate/core/-/core-14.0.0.tgz#af421d0e1a28376843f0fed375cd2fae7630a5ff"
integrity sha512-UevdwNCXMRCdJv//0kC8h2eSfmi02r29xeE8E9gJ1Al4D4jEJ7eiLPdjslTMc21oJNGguqqWeEVjf64SFtvw2w==
dependencies:
tslib "^2.3.0"
"@serialport/binding-abstract@^9.0.2":
version "9.2.3"
resolved "https://registry.yarnpkg.com/@serialport/binding-abstract/-/binding-abstract-9.2.3.tgz#e7dd273357b6a698af7ad58db6f57f62443a0acb"
@@ -140,11 +147,16 @@
dependencies:
"@types/node" "*"
"@types/node@*", "@types/node@18.7.23":
"@types/node@*":
version "18.7.23"
resolved "https://registry.yarnpkg.com/@types/node/-/node-18.7.23.tgz#75c580983846181ebe5f4abc40fe9dfb2d65665f"
integrity sha512-DWNcCHolDq0ZKGizjx2DZjR/PqsYwAcYUJmfMWqtVU2MBMG5Mo+xFZrhGId5r/O5HOuMPyQEcM6KUBp5lBZZBg==
"@types/node@18.11.19":
version "18.11.19"
resolved "https://registry.yarnpkg.com/@types/node/-/node-18.11.19.tgz#35e26df9ec441ab99d73e99e9aca82935eea216d"
integrity sha512-YUgMWAQBWLObABqrvx8qKO1enAvBUdjZOAWQ5grBAkp5LQv45jBvYKZ3oFS9iKRCQyFjqw6iuEa1vmFqtxYLZw==
"@types/node@^10.12.18":
version "10.17.60"
resolved "https://registry.yarnpkg.com/@types/node/-/node-10.17.60.tgz#35f3d6213daed95da7f0f73e75bcc6980e90597b"
@@ -1094,10 +1106,10 @@ figgy-pudding@^3.4.1, figgy-pudding@^3.5.1:
resolved "https://registry.yarnpkg.com/figgy-pudding/-/figgy-pudding-3.5.2.tgz#b4eee8148abb01dcf1d1ac34367d59e12fa61d6e"
integrity sha512-0btnI/H8f2pavGMN8w40mlSKOfTK2SVJmBfBeVIj3kNw0swwgzyRq0d5TJVOwodFmtvpPeWPN/MCcfuWF0Ezbw==
"filesize@>= 4.0.0":
version "6.3.0"
resolved "https://registry.yarnpkg.com/filesize/-/filesize-6.3.0.tgz#dff53cfb3f104c9e422f346d53be8dbcc971bf11"
integrity sha512-ytx0ruGpDHKWVoiui6+BY/QMNngtDQ/pJaFwfBpQif0J63+E8DLdFyqS3NkKQn7vIruUEpoGD9JUJSg7Kp+I0g==
filesize@^9:
version "9.0.11"
resolved "https://registry.yarnpkg.com/filesize/-/filesize-9.0.11.tgz#4ac3a42c084232dd9b2a1da0107f32d42fcfa5e4"
integrity sha512-gTAiTtI0STpKa5xesyTA9hA3LX4ga8sm2nWRcffEa1L/5vQwb4mj2MdzMkoHoGv4QzfDshQZuYscQSf8c4TKOA==
fill-range@^7.0.1:
version "7.0.1"
@@ -2261,13 +2273,12 @@ native-process-working-directory@^1.0.2:
dependencies:
node-addon-api "^3.1.0"
ngx-filesize@^2.0.16:
version "2.0.16"
resolved "https://registry.yarnpkg.com/ngx-filesize/-/ngx-filesize-2.0.16.tgz#fdaba04170edb6cfcdf7be932783cf913b03f016"
integrity sha512-VdaCirE7hSyfQh8ZEmhzNEhbddiTYUHF4V6OX+KyTmnQSVx4hp9kmzDX5YlkIlmClI6wI+LZmH9/q7XS3fsMPA==
ngx-filesize@^3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/ngx-filesize/-/ngx-filesize-3.0.1.tgz#620933ae181a1128905404e43b26abb99accba90"
integrity sha512-792I4fiG9EEPYjGib2+YTYAzfWIlccfy8uXNSXFFepuAntoS+eijLwnl0m7ajcQuNgbTtwEf9VmYIPN8mS3jqQ==
dependencies:
filesize ">= 4.0.0"
tslib "^2.0.0"
tslib "^2.3.0"
nice-try@^1.0.4:
version "1.0.5"
@@ -3717,11 +3728,16 @@ tough-cookie@~2.5.0:
psl "^1.1.28"
punycode "^2.1.1"
tslib@^2.0.0, tslib@^2.1.0:
tslib@^2.1.0:
version "2.3.1"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.3.1.tgz#e8a335add5ceae51aa261d32a490158ef042ef01"
integrity sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==
tslib@^2.3.0:
version "2.5.0"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.5.0.tgz#42bfed86f5787aeb41d031866c8f402429e0fddf"
integrity sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==
tunnel-agent@^0.6.0:
version "0.6.0"
resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz"