Skip to content

Commit

Permalink
Merge branch 'main' into fix_ansi_background_colour
Browse files Browse the repository at this point in the history
  • Loading branch information
matryer authored Dec 10, 2023
2 parents 98bcf34 + ab4bed5 commit 8d0deba
Show file tree
Hide file tree
Showing 26 changed files with 108 additions and 80 deletions.
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2014-2021 Mat Ryer + contributors
Copyright (c) 2014-2023 Mat Ryer + contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 2 additions & 2 deletions app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ cd app && wails dev

### Building

In this directory run `./build.sh`. The binary will be generated in `./build/darwin/desktop/`.
In this directory run `./build.sh`. The binary will be generated in `./build/bin/`.

```bash
./build.sh && ./build/darwin/desktop/xbar
./build.sh && ./build/bin/xbar
```

### Updates
Expand Down
22 changes: 11 additions & 11 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,29 +118,29 @@ func newApp() (*app, error) {

app.appUpdatesMenu = &menu.MenuItem{
Type: menu.TextType,
Label: "Check for updates…",
Label: "Check for Updates…",
Click: app.onCheckForUpdatesMenuClick,
}

app.autoupdateMenu = &menu.MenuItem{
Label: "Update automatically",
Label: "Update Automatically",
Type: menu.CheckboxType,
Checked: app.settings.AutoUpdate,
Click: app.updateAutoupdate,
}

app.startsAtLoginMenu = &menu.MenuItem{
Label: "Start at Login",
Label: "Open at Login",
Type: menu.CheckboxType,
Checked: false,
Click: app.updateStartOnLogin,
}
startsAtLogin, err := mac.StartsAtLogin()
if err != nil {
if app.Verbose {
log.Println("start at login:", err)
log.Println("open at login:", err)
}
app.startsAtLoginMenu.Label = "Start at Login"
app.startsAtLoginMenu.Label = "Open at Login"
app.startsAtLoginMenu.Disabled = true
} else {
app.startsAtLoginMenu.Checked = startsAtLogin
Expand Down Expand Up @@ -348,17 +348,17 @@ func (app *app) newXbarMenu(plugin *plugins.Plugin, asSubmenu bool) *menu.Menu {
}
items = append(items, &menu.MenuItem{
Type: menu.TextType,
Label: "Refresh all",
Label: "Refresh All",
Accelerator: keys.Combo("r", keys.CmdOrCtrlKey, keys.ShiftKey),
Click: app.onPluginsRefreshAllMenuClicked,
})
if plugin != nil {
items = append(items, menu.Text("Run in terminal…", keys.CmdOrCtrl("t"), func(_ *menu.CallbackData) {
items = append(items, menu.Text("Run in Terminal…", keys.CmdOrCtrl("t"), func(_ *menu.CallbackData) {
err := plugin.RunInTerminal(app.settings.Terminal.AppleScriptTemplate3)
if err != nil {
_, err2 := app.runtime.Dialog.Message(&dialog.MessageDialog{
Type: dialog.ErrorDialog,
Title: "Run in terminal",
Title: "Run in Terminal",
Message: err.Error(),
Buttons: []string{"OK"},
CancelButton: "OK",
Expand All @@ -375,7 +375,7 @@ func (app *app) newXbarMenu(plugin *plugins.Plugin, asSubmenu bool) *menu.Menu {
if plugin != nil {
items = append(items, &menu.MenuItem{
Type: menu.TextType,
Label: "Open plugin…",
Label: "Open Plugin…",
Accelerator: keys.CmdOrCtrl("e"),
Click: func(_ *menu.CallbackData) {
app.runtime.Window.Show()
Expand All @@ -392,13 +392,13 @@ func (app *app) newXbarMenu(plugin *plugins.Plugin, asSubmenu bool) *menu.Menu {
}
items = append(items, &menu.MenuItem{
Type: menu.TextType,
Label: "Plugin browser…",
Label: "Plugin Browser…",
Accelerator: keys.CmdOrCtrl("p"),
Click: app.onPluginsMenuClicked,
})
items = append(items, &menu.MenuItem{
Type: menu.TextType,
Label: "Open plugin folder…",
Label: "Open Plugin Folder…",
Click: app.onOpenPluginsFolderClicked,
})
items = append(items, menu.Separator())
Expand Down
11 changes: 5 additions & 6 deletions app/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,23 @@
"@rollup/plugin-image": "^2.0.6",
"@rollup/plugin-node-resolve": "^7.0.0",
"@rollup/plugin-url": "^5.0.1",
"@tailwindcss/postcss7-compat": "^2.0.2",
"@wails/runtime": "^1.3.10",
"autoprefixer": "^9.8.6",
"autoprefixer": "^10.4.14",
"focus-visible": "^5.2.0",
"highlight.js": ">=10.4.1",
"postcss": "^7.0.35",
"postcss-import": "^12.0.1",
"postcss": "^8.4.21",
"postcss-import": "^15.1.0",
"rollup": "^2.35.1",
"rollup-plugin-livereload": "^1.0.0",
"rollup-plugin-postcss": "^3.1.8",
"rollup-plugin-postcss": "^4.0.2",
"rollup-plugin-string": "^3.0.0",
"rollup-plugin-svelte": "~6.1.1",
"rollup-plugin-terser": "^5.1.2",
"sirv-cli": "^0.4.4",
"svelte": "^3.32.2",
"svelte-highlight": "^0.6.2",
"svelte-preprocess": "^4.6.1",
"tailwindcss": "npm:@tailwindcss/postcss7-compat@^2.0.2"
"tailwindcss": "^3.3.1"
},
"dependencies": {
"svelte-hash-router": "^1.0.1"
Expand Down
6 changes: 3 additions & 3 deletions app/frontend/src/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
<Error err={err} />

<div class='flex h-full'>
<div class='side-bar flex-shrink-0 flex flex-col h-full bg-opacity-25 bg-gray-400 text-gray-700 dark:text-gray-300'>
<div class='side-bar flex-shrink-0 flex flex-col h-full bg-gray-400/25 text-gray-700 dark:text-gray-300'>
<div
data-wails-drag
class='top-bar flex-shrink-0 flex justify-end p-4'
Expand Down Expand Up @@ -159,13 +159,13 @@
</p>
</div>
</div>
<div class='flex-grow h-full flex flex-col bg-opacity-25 bg-gray-200 text-gray-700 dark:text-gray-300'>
<div class='flex-grow h-full flex flex-col bg-gray-200/25 text-gray-700 dark:text-gray-300'>
<div class='top-bar flex-shrink-0 px-6 py-3 flex items-center space-x-5' data-wails-drag>
<div data-wails-no-drag data-wails-context-menu-id="refreshContextMenu">
<Button
waiter={$globalWaiter}
on:click='{ onRefreshClick }'
cssclass='py-1 opacity-75 select-none'
cssclass='py-1 select-none'
>↺</Button>
</div>
<div class='flex-grow' ></div>
Expand Down
2 changes: 1 addition & 1 deletion app/frontend/src/InstalledPluginView.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@
{#if installedPlugin}
<Error err="{openEditorErr}" />
<div
class="flex-grow bg-white dark:bg-gray-700 p-3 border-t border-gray-200 dark:border-gray-600 bg-opacity-75"
class="flex-grow bg-white/75 dark:bg-gray-700/75 p-3 border-t border-gray-200 dark:border-gray-600"
>
<PluginSourceBrowser
showEditButton="{true}"
Expand Down
2 changes: 1 addition & 1 deletion app/frontend/src/PluginView.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
</div>
{/if}
</div>
<div class='flex-grow bg-white dark:bg-gray-700 p-3 border-t border-gray-200 dark:border-gray-900 bg-opacity-75'>
<div class='flex-grow bg-white/75 dark:bg-gray-700/75 p-3 border-t border-gray-200 dark:border-gray-900 '>
<PluginSourceBrowser files={plugin.files} />
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions app/frontend/src/elements/Button.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
// classes are the css classes to use for each style of button
const classes = {
'default': 'text-sm rounded shadow-sm dark:shadow-none px-4 py-1 border bg-gray-100 active:bg-gray-300 dark:text-gray-300 dark:bg-gray-900 border-gray-300 dark:border-gray-600 dark:bg-opacity-50 hover:bg-opacity-75',
'primary': 'bg-blue-900 active:bg-blue-800 text-sm text-white rounded shadow-sm dark:shadow-none px-4 py-1 border border-blue-900 dark:bg-black dark:border-black dark:bg-opacity-50 hover:bg-opacity-75',
'default': 'text-sm rounded shadow-sm dark:shadow-none px-4 py-1 border bg-gray-100 dark:text-gray-300 dark:bg-gray-900 border-gray-300 dark:border-gray-600 dark:bg-opacity-50 hover:bg-opacity-75',
'primary': 'bg-blue-900 text-sm text-white rounded shadow-sm dark:shadow-none px-4 py-1 border border-blue-900 dark:bg-black dark:border-black dark:bg-opacity-50 hover:bg-opacity-75',
}
// css is the final css string to inject into the element.
Expand Down
2 changes: 1 addition & 1 deletion app/frontend/src/elements/Error.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
</script>
{#if err}
{#if isNotFoundError(err)}
<div class='px-8 py-4 bg-white bg-opacity-50 dark:bg-black dark:bg-opacity-25'>
<div class='px-8 py-4 bg-white bg-opacity-50 dark:bg-black/25'>
<code>404</code> Not found
<Button cssclass='ml-4' on:click={ onRefreshClicked }>
{#if refreshing}Refreshing&hellip;{:else}Refresh{/if}
Expand Down
20 changes: 11 additions & 9 deletions app/frontend/src/elements/PluginCollection.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
<div class='flex flex-wrap p-3'>
{#each plugins as plugin}
<div
class='flex flex-col bg-white dark:bg-black bg-opacity-25 m-3 mt-0 mb-6 w-80 rounded shadow-lg dark:shadow-none'
class='flex flex-col bg-white/25 dark:bg-black/25 m-3 mt-0 mb-6 w-80 rounded shadow-lg dark:shadow-none'
>
<div class='flex-grow'>
<h2 class='text-black flex-grow dark:text-white text-lg p-4 pb-0'>
Expand All @@ -60,14 +60,16 @@
</a>
</h2>
<div class='flex'>
<a href='#/plugin-details/{plugin.path}'>
<img
class='plugin-pic float-left m-4 mr-0'
alt='Photo for {plugin.title}'
src='{plugin.imageURL}'
onerror='this.style.display="none"'
>
</a>
{#if plugin.imageURL}
<a href='#/plugin-details/{plugin.path}'>
<img
class='plugin-pic float-left m-4 mr-0'
alt='Photo for {plugin.title}'
src='{plugin.imageURL}'
onerror='this.style.display="none"'
>
</a>
{/if}
<p class='plugin-desc mb-2 p-4 test-gray break-words'>
{plugin.desc}
</p>
Expand Down
2 changes: 1 addition & 1 deletion app/frontend/src/elements/PluginDetails.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
</style>

{#if plugin}
<div class='flex flex-col bg-white dark:bg-black bg-opacity-25 mt-0 mb-6 rounded shadow-lg dark:shadow-none'>
<div class='flex flex-col bg-white/25 dark:bg-black/25 mt-0 mb-6 rounded shadow-lg dark:shadow-none'>

{#if $$slots.action}
<div class='pt-4 px-4 flex'>
Expand Down
6 changes: 1 addition & 5 deletions app/frontend/src/elements/PluginSourceBrowser.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@
</div>
{/if}
</div>
<pre class='whitespace-pre-wrap nice-wrapping text-sm pb-8'>
<code>
{file.content}
</code>
</pre>
<pre class='whitespace-pre-wrap nice-wrapping text-sm pb-8'><code>{file.content}</code></pre>
{/each}
{/if}
8 changes: 4 additions & 4 deletions app/frontend/src/elements/VariableInput.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
{#if variable.type === 'string'}
<input
id='{variable.name}'
class='border px-2 bg-gray-100 active:bg-gray-300 dark:text-gray-400 dark:bg-black dark:bg-opacity-50 border-gray-300 dark:border-gray-600'
class='border px-2 bg-gray-100 active:bg-gray-300 dark:text-gray-400 dark:bg-black/50 border-gray-300 dark:border-gray-600'
type='text'
bind:value='{ values[variable.name] }'
disabled={disabled}
Expand All @@ -37,7 +37,7 @@
<label class='flex items-center'>
<input
id='{variable.name}'
class='border px-2 bg-gray-100 active:bg-gray-300 dark:text-gray-400 dark:bg-black dark:bg-opacity-50 border-gray-300 dark:border-gray-600'
class='border px-2 bg-gray-100 active:bg-gray-300 dark:text-gray-400 dark:bg-black/50 border-gray-300 dark:border-gray-600'
type='checkbox'
bind:checked='{ values[variable.name] }'
disabled={disabled}
Expand All @@ -51,15 +51,15 @@
{:else if variable.type === 'number'}
<input
id='{variable.name}'
class='border px-2 bg-gray-100 active:bg-gray-300 dark:text-gray-400 dark:bg-black dark:bg-opacity-50 border-gray-300 dark:border-gray-600'
class='border px-2 bg-gray-100 active:bg-gray-300 dark:text-gray-400 dark:bg-black/50 border-gray-300 dark:border-gray-600'
type='number'
bind:value='{ values[variable.name] }'
disabled={disabled}
/>
{:else if variable.type === 'select'}
<select
id='{variable.name}'
class='border px-2 bg-gray-100 active:bg-gray-300 dark:text-gray-400 dark:bg-black dark:bg-opacity border-gray-300 dark:border-gray-600'
class='border px-2 bg-gray-100 active:bg-gray-300 dark:text-gray-400 dark:bg-black border-gray-300 dark:border-gray-600'
bind:value='{ values[variable.name] }'
disabled={disabled}
>
Expand Down
2 changes: 1 addition & 1 deletion app/frontend/src/elements/Variables.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
</script>

{#if variables && variables.length && values}
<div class='p-6 pb-0 bg-white dark:bg-gray-700 dark:bg-opacity-25 bg-opacity-50 border-t border-gray-100 dark:border-gray-600'>
<div class='p-6 pb-0 bg-white/25 dark:bg-gray-700/50 border-t border-gray-100 dark:border-gray-600'>
<table class='table-auto'>
{#each variables as variable}
<tr>
Expand Down
6 changes: 1 addition & 5 deletions app/frontend/tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,16 @@ module.exports = {
'./src/**/*.js',
'./src/**/*.svelte',
],
darkMode: 'media',
theme: {
colors: {
transparent: 'transparent',

gray: colors.trueGray,
gray: colors.neutral,
blue: colors.blue,
black: colors.black,
white: colors.white,
yellow: colors.yellow,
},
},
variants: {
extend: {},
},
plugins: [],
}
2 changes: 2 additions & 0 deletions app/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,8 @@ golang.org/x/sys v0.0.0-20210324051608-47abb6519492/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20210611083646-a4fc73990273/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c h1:F1jZWGFhYfh0Ci55sIpILtKKK8p3i2/krTr0H1rg74I=
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U=
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
Expand Down
4 changes: 2 additions & 2 deletions pkg/metadata/categories_metadata_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ func TestCategoryMapper(t *testing.T) {
categories := make(map[string]Category)
CategoryEnsurePath(categories, nil, []string{"parent1", "child1", "grandchild1"})
CategoryEnsurePath(categories, nil, []string{"parent1", "child2", "grandchild1"})
CategoryEnsurePath(categories, nil, []string{"parent2", "child1", "grandchild1"})
CategoryEnsurePath(categories, nil, []string{"parent2", "Child1", "Grandchild1"})
CategoryEnsurePath(categories, nil, []string{"parent3", "child1"})

is.Equal(len(categories), 3) // parents
is.Equal(len(categories["parent1"].ChildrenCategories), 2) // parent1 children
is.Equal(len(categories["parent2"].ChildrenCategories["child1"].ChildrenCategories), 1) // parent2 child1 grandchildren
is.Equal(len(categories["parent2"].ChildrenCategories["Child1"].ChildrenCategories), 1) // parent2 child1 grandchildren

// b, err := json.MarshalIndent(segments, "", "\t")
// is.NoErr(err)
Expand Down
2 changes: 1 addition & 1 deletion tools/sitegen/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ require (
github.com/matryer/xbar/pkg/metadata v0.0.0-00010101000000-000000000000
github.com/pkg/errors v0.9.1
github.com/snabb/sitemap v1.0.0
golang.org/x/net v0.0.0-20200625001655-4c5254603344 // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421
)
Loading

0 comments on commit 8d0deba

Please sign in to comment.