diff --git a/clisnips/cli/utils.py b/clisnips/cli/utils.py index 6428044..c759d30 100644 --- a/clisnips/cli/utils.py +++ b/clisnips/cli/utils.py @@ -26,17 +26,11 @@ class UrwidMarkupHelper: palette = { 'default': ('default', 'default'), 'accent': ('dark magenta', 'default'), - 'accent:inverse': ('black', 'dark magenta'), 'success': ('dark green', 'default'), - 'success:inverse': ('black', 'dark green'), 'error': ('dark red', 'default'), - 'error:inverse': ('black', 'dark red'), 'warning': ('brown', 'default'), - 'warning:inverse': ('black', 'brown'), 'info': ('dark blue', 'default'), - 'info:inverse': ('white', 'dark blue'), - 'debug': ('light cyan', 'default'), - 'debug:inverse': ('black', 'light cyan'), + 'debug': ('dark cyan', 'default'), } def __init__(self): diff --git a/clisnips/config/palette.py b/clisnips/config/palette.py index e82ff43..229bfef 100644 --- a/clisnips/config/palette.py +++ b/clisnips/config/palette.py @@ -8,12 +8,16 @@ default_palette = { 'default': {'fg': 'light gray', 'bg': 'black'}, - 'info': {'fg': 'dark blue', 'bg': 'default'}, - 'success': {'fg': 'dark green', 'bg': 'default'}, - 'warning': {'fg': 'brown', 'bg': 'default'}, - 'error': {'fg': 'dark red', 'bg': 'default'}, + 'accent': {'fg': 'dark magenta', 'bg': 'black'}, + # standard feedback colors 'disabled': {'fg': 'dark gray,bold', 'bg': 'black'}, + 'debug': {'fg': 'dark cyan', 'bg': 'black'}, + 'info': {'fg': 'dark blue', 'bg': 'black'}, + 'success': {'fg': 'dark green', 'bg': 'black'}, + 'warning': {'fg': 'brown', 'bg': 'black'}, + 'error': {'fg': 'dark red', 'bg': 'black'}, + 'action:default': 'default', 'action:suggested': {'fg': 'dark cyan,bold', 'bg': 'black'}, 'action:destructive': {'fg': 'dark red,bold', 'bg': 'black'}, 'action:disabled': 'disabled', @@ -26,31 +30,38 @@ 'help:key': {'fg': 'dark cyan', 'bg': 'black'}, # views / components - 'view:default': {'fg': 'light gray', 'bg': 'black'}, + 'view:default': 'default', 'search-entry:caption': {'fg': 'dark cyan', 'bg': 'black'}, + 'snip:title': {'fg': 'light gray,italics', 'bg': 'black'}, + 'snip:tag': {'fg': 'brown', 'bg': 'black'}, + 'snip:cmd': {'fg': 'dark green', 'bg': 'black'}, + 'snippets-list': 'default', 'snippets-list:focused': {'fg': 'light gray', 'bg': 'dark gray', 'mono': 'standout'}, - 'snippets-list:cmd': {'fg': 'dark green', 'bg': 'black'}, + 'snippets-list:cmd': 'snip:cmd', 'snippets-list:cmd:focused': {'fg': 'dark green', 'bg': 'dark gray', 'mono': 'standout'}, - 'snippets-list:title': {'fg': 'light gray,italics', 'bg': 'black'}, - 'snippets-list:title:focused': {'fg': 'light gray,italics', 'bg': 'dark gray', 'mono': 'standout'}, - 'snippets-list:tag': {'fg': 'brown', 'bg': 'black'}, + 'snippets-list:title': 'snip:title', + 'snippets-list:title:focused': {'fg': 'light gray,italics', 'bg': 'dark gray', 'mono': 'standout,italics'}, + 'snippets-list:tag': 'snip:tag', 'snippets-list:tag:focused': {'fg': 'brown', 'bg': 'dark gray', 'mono': 'standout'}, # widgets - 'path-completion:file': {'fg': 'light gray', 'bg': 'default'}, - 'path-completion:directory': {'fg': 'dark blue', 'bg': 'default'}, - 'path-completion:symlink-directory': {'fg': 'dark cyan', 'bg': 'default'}, - 'path-completion:symlink-file': {'fg': 'brown', 'bg': 'default'}, + 'dialog': 'default', + 'popup-menu': 'default', + 'path-completion:file': 'default', + 'path-completion:directory': {'fg': 'dark blue', 'bg': 'black'}, + 'path-completion:symlink-directory': {'fg': 'dark cyan', 'bg': 'black'}, + 'path-completion:symlink-file': {'fg': 'brown', 'bg': 'black'}, # syntax highlighting - 'syn:cmd:default': {'fg': 'dark green', 'bg': 'black'}, - 'syn:cmd:punctuation': {'fg': 'light gray', 'bg': 'black'}, + 'syn:cmd:default': 'snip:cmd', + 'syn:cmd:punctuation': 'default', 'syn:cmd:field-marker': {'fg': 'dark magenta', 'bg': 'black'}, 'syn:cmd:field-name': {'fg': 'dark magenta', 'bg': 'black'}, 'syn:cmd:field-conversion': {'fg': 'dark cyan', 'bg': 'black'}, 'syn:cmd:field-format': {'fg': 'dark cyan', 'bg': 'black'}, - 'syn:doc:default': {'fg': 'light gray', 'bg': 'black'}, + 'syn:doc:default': 'default', + 'syn:doc:punctuation': 'syn:doc:default', 'syn:doc:parameter': {'fg': 'dark magenta', 'bg': 'black'}, 'syn:doc:type-hint': {'fg': 'dark cyan', 'bg': 'black'}, 'syn:doc:value-hint': {'fg': 'brown', 'bg': 'black'}, @@ -59,15 +70,15 @@ 'syn:doc:number': {'fg': 'yellow', 'bg': 'black'}, 'syn:doc:code-fence': {'fg': 'dark red', 'bg': 'black'}, - 'syn:py:default': {'fg': 'light gray', 'bg': 'black'}, - 'syn:py:name': {'fg': 'light gray', 'bg': 'black'}, + 'syn:py:default': 'default', + 'syn:py:name': 'default', 'syn:py:comment': {'fg': 'dark gray', 'bg': 'black'}, 'syn:py:keyword': {'fg': 'dark magenta', 'bg': 'black'}, 'syn:py:class': {'fg': 'brown', 'bg': 'black'}, 'syn:py:decorator': {'fg': 'brown', 'bg': 'black'}, 'syn:py:string': {'fg': 'dark green', 'bg': 'black'}, 'syn:py:string:escape': {'fg': 'light cyan', 'bg': 'black'}, - 'syn:py:string:interp': {'fg': 'light gray', 'bg': 'black'}, + 'syn:py:string:interp': 'default', 'syn:py:function': {'fg': 'dark cyan', 'bg': 'black'}, 'syn:py:number': {'fg': 'yellow', 'bg': 'black'}, } # fmt: skip diff --git a/clisnips/tui/components/edit_snippet_dialog.py b/clisnips/tui/components/edit_snippet_dialog.py index 8248762..fb85967 100644 --- a/clisnips/tui/components/edit_snippet_dialog.py +++ b/clisnips/tui/components/edit_snippet_dialog.py @@ -101,7 +101,7 @@ def _check_doc_syntax_on_changed(self, entry, value): self._errors.discard('doc') def _on_errors_changed(self, errors: set[str]): - self._save_action.toggle(not errors) + self._save_action.toggle(enabled=not errors) class SimpleField(urwid.Pile): diff --git a/clisnips/tui/components/show_snippet_dialog.py b/clisnips/tui/components/show_snippet_dialog.py index d297d1b..54958f4 100644 --- a/clisnips/tui/components/show_snippet_dialog.py +++ b/clisnips/tui/components/show_snippet_dialog.py @@ -9,33 +9,23 @@ from clisnips.tui.widgets.divider import HorizontalDivider -def _create_field(label: TextMarkup, content: TextMarkup): - field = urwid.Pile( - ( - urwid.Text(label), - urwid.Text(content), - ), - ) - return field - - class ShowSnippetDialog(Dialog): def __init__(self, parent, snippet: Snippet): body = urwid.ListBox( urwid.SimpleListWalker( ( - _create_field('Title', snippet['title']), + _field('Title:', ('snip:title', snippet['title'])), HorizontalDivider(), - _create_field('Tags', snippet['tag']), + _field('Tags:', ('snip:tag', snippet['tag'])), HorizontalDivider(), - _create_field('Command', highlight_command(snippet['cmd'])), + _field('Command:', highlight_command(snippet['cmd'])), HorizontalDivider(), - _create_field('Documentation', highlight_documentation(snippet['doc'])), + _field('Documentation:', highlight_documentation(snippet['doc'])), HorizontalDivider(), - urwid.Text(f"Created on: {date(snippet['created_at'])}"), - urwid.Text(f"Last used on: {date(snippet['last_used_at'])}"), - urwid.Text(f"Usage count: {snippet['usage_count']}"), - urwid.Text(f"Ranking: {snippet['ranking']}"), + _info('Created on: ', _date(snippet['created_at'])), + _info('Last used on: ', _date(snippet['last_used_at'])), + _info('Usage count: ', snippet['usage_count']), + _info('Ranking: ', snippet['ranking']), ), ), ) @@ -43,5 +33,19 @@ def __init__(self, parent, snippet: Snippet): super().__init__(parent, body) -def date(timestamp: float): +def _field(label: TextMarkup, content: TextMarkup): + field = urwid.Pile( + ( + urwid.Text(label), + urwid.Text(content), + ), + ) + return field + + +def _info(label: str, value: str | float): + return urwid.Text([label, ('info', str(value))]) + + +def _date(timestamp: float) -> str: return time.strftime('%Y-%m-%d %H:%M:%S UTC', time.gmtime(timestamp)) diff --git a/clisnips/tui/view.py b/clisnips/tui/view.py index 1afa44f..210bb90 100644 --- a/clisnips/tui/view.py +++ b/clisnips/tui/view.py @@ -14,7 +14,7 @@ class View(urwid.WidgetWrap): def __init__(self, view: urwid.Widget): self._view = view - self._wrapped_widget = urwid.AttrMap(self._view, 'view:default') + self._wrapped_widget = urwid.AttrMap(self._view, 'default') super().__init__(self._wrapped_widget) self._has_dialog = False diff --git a/clisnips/tui/widgets/dialog.py b/clisnips/tui/widgets/dialog.py index 55c76fb..faae64e 100644 --- a/clisnips/tui/widgets/dialog.py +++ b/clisnips/tui/widgets/dialog.py @@ -91,7 +91,7 @@ def __init__(self, view: View, body: urwid.Widget): # pad area around listbox w = urwid.Padding(w, align=Align.LEFT, left=2, right=2, width=(WHSettings.RELATIVE, 100)) w = urwid.Filler(w, valign=VAlign.TOP, top=1, bottom=1, height=('relative', 100)) - w = urwid.AttrMap(w, 'body') + w = urwid.AttrMap(w, 'dialog') super().__init__(w) def close(self): diff --git a/schemas/settings.json b/schemas/settings.json index 212aa04..a28c400 100644 --- a/schemas/settings.json +++ b/schemas/settings.json @@ -1,11 +1,66 @@ { "$defs": { - "Palette": { + "PaletteEntryModel": { + "description": "See available color values at: https://urwid.org/manual/displayattributes.html#foreground-and-background-settings", + "properties": { + "fg": { + "title": "Foreground color in 16-color mode", + "type": "string" + }, + "bg": { + "title": "Background color in 16-color mode", + "type": "string" + }, + "mono": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Color in monochrome mode" + }, + "fg_hi": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Foreground color in high-color mode" + }, + "bg_hi": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Background color in high-color mode" + } + }, + "required": [ + "fg", + "bg" + ], + "title": "An Urwid palette entry", + "type": "object" + }, + "PaletteModel": { "properties": { "default": { "anyOf": [ { - "$ref": "#/$defs/PaletteEntry" + "$ref": "#/$defs/PaletteEntryModel" }, { "type": "string" @@ -20,10 +75,64 @@ }, "title": "Default" }, + "accent": { + "anyOf": [ + { + "$ref": "#/$defs/PaletteEntryModel" + }, + { + "type": "string" + } + ], + "default": { + "fg": "dark magenta", + "bg": "black", + "mono": null, + "fg_hi": null, + "bg_hi": null + }, + "title": "Accent" + }, + "disabled": { + "anyOf": [ + { + "$ref": "#/$defs/PaletteEntryModel" + }, + { + "type": "string" + } + ], + "default": { + "fg": "dark gray,bold", + "bg": "black", + "mono": null, + "fg_hi": null, + "bg_hi": null + }, + "title": "Disabled" + }, + "debug": { + "anyOf": [ + { + "$ref": "#/$defs/PaletteEntryModel" + }, + { + "type": "string" + } + ], + "default": { + "fg": "dark cyan", + "bg": "black", + "mono": null, + "fg_hi": null, + "bg_hi": null + }, + "title": "Debug" + }, "info": { "anyOf": [ { - "$ref": "#/$defs/PaletteEntry" + "$ref": "#/$defs/PaletteEntryModel" }, { "type": "string" @@ -31,7 +140,7 @@ ], "default": { "fg": "dark blue", - "bg": "default", + "bg": "black", "mono": null, "fg_hi": null, "bg_hi": null @@ -41,7 +150,7 @@ "success": { "anyOf": [ { - "$ref": "#/$defs/PaletteEntry" + "$ref": "#/$defs/PaletteEntryModel" }, { "type": "string" @@ -49,7 +158,7 @@ ], "default": { "fg": "dark green", - "bg": "default", + "bg": "black", "mono": null, "fg_hi": null, "bg_hi": null @@ -59,7 +168,7 @@ "warning": { "anyOf": [ { - "$ref": "#/$defs/PaletteEntry" + "$ref": "#/$defs/PaletteEntryModel" }, { "type": "string" @@ -67,7 +176,7 @@ ], "default": { "fg": "brown", - "bg": "default", + "bg": "black", "mono": null, "fg_hi": null, "bg_hi": null @@ -77,7 +186,7 @@ "error": { "anyOf": [ { - "$ref": "#/$defs/PaletteEntry" + "$ref": "#/$defs/PaletteEntryModel" }, { "type": "string" @@ -85,35 +194,29 @@ ], "default": { "fg": "dark red", - "bg": "default", + "bg": "black", "mono": null, "fg_hi": null, "bg_hi": null }, "title": "Error" }, - "disabled": { + "action:default": { "anyOf": [ { - "$ref": "#/$defs/PaletteEntry" + "$ref": "#/$defs/PaletteEntryModel" }, { "type": "string" } ], - "default": { - "fg": "dark gray,bold", - "bg": "black", - "mono": null, - "fg_hi": null, - "bg_hi": null - }, - "title": "Disabled" + "default": "default", + "title": "Action:Default" }, "action:suggested": { "anyOf": [ { - "$ref": "#/$defs/PaletteEntry" + "$ref": "#/$defs/PaletteEntryModel" }, { "type": "string" @@ -131,7 +234,7 @@ "action:destructive": { "anyOf": [ { - "$ref": "#/$defs/PaletteEntry" + "$ref": "#/$defs/PaletteEntryModel" }, { "type": "string" @@ -149,7 +252,7 @@ "action:disabled": { "anyOf": [ { - "$ref": "#/$defs/PaletteEntry" + "$ref": "#/$defs/PaletteEntryModel" }, { "type": "string" @@ -161,7 +264,7 @@ "choice:inactive": { "anyOf": [ { - "$ref": "#/$defs/PaletteEntry" + "$ref": "#/$defs/PaletteEntryModel" }, { "type": "string" @@ -173,7 +276,7 @@ "choice:active": { "anyOf": [ { - "$ref": "#/$defs/PaletteEntry" + "$ref": "#/$defs/PaletteEntryModel" }, { "type": "string" @@ -191,7 +294,7 @@ "choice:disabled": { "anyOf": [ { - "$ref": "#/$defs/PaletteEntry" + "$ref": "#/$defs/PaletteEntryModel" }, { "type": "string" @@ -203,7 +306,7 @@ "help:key": { "anyOf": [ { - "$ref": "#/$defs/PaletteEntry" + "$ref": "#/$defs/PaletteEntryModel" }, { "type": "string" @@ -221,61 +324,73 @@ "view:default": { "anyOf": [ { - "$ref": "#/$defs/PaletteEntry" + "$ref": "#/$defs/PaletteEntryModel" + }, + { + "type": "string" + } + ], + "default": "default", + "title": "View:Default" + }, + "search-entry:caption": { + "anyOf": [ + { + "$ref": "#/$defs/PaletteEntryModel" }, { "type": "string" } ], "default": { - "fg": "light gray", + "fg": "dark cyan", "bg": "black", "mono": null, "fg_hi": null, "bg_hi": null }, - "title": "View:Default" + "title": "Search-Entry:Caption" }, - "search-entry:caption": { + "snip:title": { "anyOf": [ { - "$ref": "#/$defs/PaletteEntry" + "$ref": "#/$defs/PaletteEntryModel" }, { "type": "string" } ], "default": { - "fg": "dark cyan", + "fg": "light gray,italics", "bg": "black", "mono": null, "fg_hi": null, "bg_hi": null }, - "title": "Search-Entry:Caption" + "title": "Snip:Title" }, - "snippets-list:focused": { + "snip:tag": { "anyOf": [ { - "$ref": "#/$defs/PaletteEntry" + "$ref": "#/$defs/PaletteEntryModel" }, { "type": "string" } ], "default": { - "fg": "light gray", - "bg": "dark gray", - "mono": "standout", + "fg": "brown", + "bg": "black", + "mono": null, "fg_hi": null, "bg_hi": null }, - "title": "Snippets-List:Focused" + "title": "Snip:Tag" }, - "snippets-list:cmd": { + "snip:cmd": { "anyOf": [ { - "$ref": "#/$defs/PaletteEntry" + "$ref": "#/$defs/PaletteEntryModel" }, { "type": "string" @@ -288,12 +403,54 @@ "fg_hi": null, "bg_hi": null }, + "title": "Snip:Cmd" + }, + "snippets-list": { + "anyOf": [ + { + "$ref": "#/$defs/PaletteEntryModel" + }, + { + "type": "string" + } + ], + "default": "default", + "title": "Snippets-List" + }, + "snippets-list:focused": { + "anyOf": [ + { + "$ref": "#/$defs/PaletteEntryModel" + }, + { + "type": "string" + } + ], + "default": { + "fg": "light gray", + "bg": "dark gray", + "mono": "standout", + "fg_hi": null, + "bg_hi": null + }, + "title": "Snippets-List:Focused" + }, + "snippets-list:cmd": { + "anyOf": [ + { + "$ref": "#/$defs/PaletteEntryModel" + }, + { + "type": "string" + } + ], + "default": "snip:cmd", "title": "Snippets-List:Cmd" }, "snippets-list:cmd:focused": { "anyOf": [ { - "$ref": "#/$defs/PaletteEntry" + "$ref": "#/$defs/PaletteEntryModel" }, { "type": "string" @@ -311,25 +468,19 @@ "snippets-list:title": { "anyOf": [ { - "$ref": "#/$defs/PaletteEntry" + "$ref": "#/$defs/PaletteEntryModel" }, { "type": "string" } ], - "default": { - "fg": "light gray,italics", - "bg": "black", - "mono": null, - "fg_hi": null, - "bg_hi": null - }, + "default": "snip:title", "title": "Snippets-List:Title" }, "snippets-list:title:focused": { "anyOf": [ { - "$ref": "#/$defs/PaletteEntry" + "$ref": "#/$defs/PaletteEntryModel" }, { "type": "string" @@ -338,7 +489,7 @@ "default": { "fg": "light gray,italics", "bg": "dark gray", - "mono": "standout", + "mono": "standout,italics", "fg_hi": null, "bg_hi": null }, @@ -347,25 +498,19 @@ "snippets-list:tag": { "anyOf": [ { - "$ref": "#/$defs/PaletteEntry" + "$ref": "#/$defs/PaletteEntryModel" }, { "type": "string" } ], - "default": { - "fg": "brown", - "bg": "black", - "mono": null, - "fg_hi": null, - "bg_hi": null - }, + "default": "snip:tag", "title": "Snippets-List:Tag" }, "snippets-list:tag:focused": { "anyOf": [ { - "$ref": "#/$defs/PaletteEntry" + "$ref": "#/$defs/PaletteEntryModel" }, { "type": "string" @@ -380,28 +525,46 @@ }, "title": "Snippets-List:Tag:Focused" }, + "dialog": { + "anyOf": [ + { + "$ref": "#/$defs/PaletteEntryModel" + }, + { + "type": "string" + } + ], + "default": "default", + "title": "Dialog" + }, + "popup-menu": { + "anyOf": [ + { + "$ref": "#/$defs/PaletteEntryModel" + }, + { + "type": "string" + } + ], + "default": "default", + "title": "Popup-Menu" + }, "path-completion:file": { "anyOf": [ { - "$ref": "#/$defs/PaletteEntry" + "$ref": "#/$defs/PaletteEntryModel" }, { "type": "string" } ], - "default": { - "fg": "light gray", - "bg": "default", - "mono": null, - "fg_hi": null, - "bg_hi": null - }, + "default": "default", "title": "Path-Completion:File" }, "path-completion:directory": { "anyOf": [ { - "$ref": "#/$defs/PaletteEntry" + "$ref": "#/$defs/PaletteEntryModel" }, { "type": "string" @@ -409,7 +572,7 @@ ], "default": { "fg": "dark blue", - "bg": "default", + "bg": "black", "mono": null, "fg_hi": null, "bg_hi": null @@ -419,7 +582,7 @@ "path-completion:symlink-directory": { "anyOf": [ { - "$ref": "#/$defs/PaletteEntry" + "$ref": "#/$defs/PaletteEntryModel" }, { "type": "string" @@ -427,7 +590,7 @@ ], "default": { "fg": "dark cyan", - "bg": "default", + "bg": "black", "mono": null, "fg_hi": null, "bg_hi": null @@ -437,7 +600,7 @@ "path-completion:symlink-file": { "anyOf": [ { - "$ref": "#/$defs/PaletteEntry" + "$ref": "#/$defs/PaletteEntryModel" }, { "type": "string" @@ -445,7 +608,7 @@ ], "default": { "fg": "brown", - "bg": "default", + "bg": "black", "mono": null, "fg_hi": null, "bg_hi": null @@ -455,43 +618,31 @@ "syn:cmd:default": { "anyOf": [ { - "$ref": "#/$defs/PaletteEntry" + "$ref": "#/$defs/PaletteEntryModel" }, { "type": "string" } ], - "default": { - "fg": "dark green", - "bg": "black", - "mono": null, - "fg_hi": null, - "bg_hi": null - }, + "default": "snip:cmd", "title": "Syn:Cmd:Default" }, "syn:cmd:punctuation": { "anyOf": [ { - "$ref": "#/$defs/PaletteEntry" + "$ref": "#/$defs/PaletteEntryModel" }, { "type": "string" } ], - "default": { - "fg": "light gray", - "bg": "black", - "mono": null, - "fg_hi": null, - "bg_hi": null - }, + "default": "default", "title": "Syn:Cmd:Punctuation" }, "syn:cmd:field-marker": { "anyOf": [ { - "$ref": "#/$defs/PaletteEntry" + "$ref": "#/$defs/PaletteEntryModel" }, { "type": "string" @@ -509,7 +660,7 @@ "syn:cmd:field-name": { "anyOf": [ { - "$ref": "#/$defs/PaletteEntry" + "$ref": "#/$defs/PaletteEntryModel" }, { "type": "string" @@ -527,7 +678,7 @@ "syn:cmd:field-conversion": { "anyOf": [ { - "$ref": "#/$defs/PaletteEntry" + "$ref": "#/$defs/PaletteEntryModel" }, { "type": "string" @@ -545,7 +696,7 @@ "syn:cmd:field-format": { "anyOf": [ { - "$ref": "#/$defs/PaletteEntry" + "$ref": "#/$defs/PaletteEntryModel" }, { "type": "string" @@ -563,25 +714,31 @@ "syn:doc:default": { "anyOf": [ { - "$ref": "#/$defs/PaletteEntry" + "$ref": "#/$defs/PaletteEntryModel" }, { "type": "string" } ], - "default": { - "fg": "light gray", - "bg": "black", - "mono": null, - "fg_hi": null, - "bg_hi": null - }, + "default": "default", "title": "Syn:Doc:Default" }, + "syn:doc:punctuation": { + "anyOf": [ + { + "$ref": "#/$defs/PaletteEntryModel" + }, + { + "type": "string" + } + ], + "default": "syn:doc:default", + "title": "Syn:Doc:Punctuation" + }, "syn:doc:parameter": { "anyOf": [ { - "$ref": "#/$defs/PaletteEntry" + "$ref": "#/$defs/PaletteEntryModel" }, { "type": "string" @@ -599,7 +756,7 @@ "syn:doc:type-hint": { "anyOf": [ { - "$ref": "#/$defs/PaletteEntry" + "$ref": "#/$defs/PaletteEntryModel" }, { "type": "string" @@ -617,7 +774,7 @@ "syn:doc:value-hint": { "anyOf": [ { - "$ref": "#/$defs/PaletteEntry" + "$ref": "#/$defs/PaletteEntryModel" }, { "type": "string" @@ -635,7 +792,7 @@ "syn:doc:value-hint:default": { "anyOf": [ { - "$ref": "#/$defs/PaletteEntry" + "$ref": "#/$defs/PaletteEntryModel" }, { "type": "string" @@ -653,7 +810,7 @@ "syn:doc:string": { "anyOf": [ { - "$ref": "#/$defs/PaletteEntry" + "$ref": "#/$defs/PaletteEntryModel" }, { "type": "string" @@ -671,7 +828,7 @@ "syn:doc:number": { "anyOf": [ { - "$ref": "#/$defs/PaletteEntry" + "$ref": "#/$defs/PaletteEntryModel" }, { "type": "string" @@ -689,7 +846,7 @@ "syn:doc:code-fence": { "anyOf": [ { - "$ref": "#/$defs/PaletteEntry" + "$ref": "#/$defs/PaletteEntryModel" }, { "type": "string" @@ -707,43 +864,31 @@ "syn:py:default": { "anyOf": [ { - "$ref": "#/$defs/PaletteEntry" + "$ref": "#/$defs/PaletteEntryModel" }, { "type": "string" } ], - "default": { - "fg": "light gray", - "bg": "black", - "mono": null, - "fg_hi": null, - "bg_hi": null - }, + "default": "default", "title": "Syn:Py:Default" }, "syn:py:name": { "anyOf": [ { - "$ref": "#/$defs/PaletteEntry" + "$ref": "#/$defs/PaletteEntryModel" }, { "type": "string" } ], - "default": { - "fg": "light gray", - "bg": "black", - "mono": null, - "fg_hi": null, - "bg_hi": null - }, + "default": "default", "title": "Syn:Py:Name" }, "syn:py:comment": { "anyOf": [ { - "$ref": "#/$defs/PaletteEntry" + "$ref": "#/$defs/PaletteEntryModel" }, { "type": "string" @@ -761,7 +906,7 @@ "syn:py:keyword": { "anyOf": [ { - "$ref": "#/$defs/PaletteEntry" + "$ref": "#/$defs/PaletteEntryModel" }, { "type": "string" @@ -779,7 +924,7 @@ "syn:py:class": { "anyOf": [ { - "$ref": "#/$defs/PaletteEntry" + "$ref": "#/$defs/PaletteEntryModel" }, { "type": "string" @@ -797,7 +942,7 @@ "syn:py:decorator": { "anyOf": [ { - "$ref": "#/$defs/PaletteEntry" + "$ref": "#/$defs/PaletteEntryModel" }, { "type": "string" @@ -815,7 +960,7 @@ "syn:py:string": { "anyOf": [ { - "$ref": "#/$defs/PaletteEntry" + "$ref": "#/$defs/PaletteEntryModel" }, { "type": "string" @@ -833,7 +978,7 @@ "syn:py:string:escape": { "anyOf": [ { - "$ref": "#/$defs/PaletteEntry" + "$ref": "#/$defs/PaletteEntryModel" }, { "type": "string" @@ -851,25 +996,19 @@ "syn:py:string:interp": { "anyOf": [ { - "$ref": "#/$defs/PaletteEntry" + "$ref": "#/$defs/PaletteEntryModel" }, { "type": "string" } ], - "default": { - "fg": "light gray", - "bg": "black", - "mono": null, - "fg_hi": null, - "bg_hi": null - }, + "default": "default", "title": "Syn:Py:String:Interp" }, "syn:py:function": { "anyOf": [ { - "$ref": "#/$defs/PaletteEntry" + "$ref": "#/$defs/PaletteEntryModel" }, { "type": "string" @@ -887,7 +1026,7 @@ "syn:py:number": { "anyOf": [ { - "$ref": "#/$defs/PaletteEntry" + "$ref": "#/$defs/PaletteEntryModel" }, { "type": "string" @@ -903,62 +1042,7 @@ "title": "Syn:Py:Number" } }, - "title": "Palette", - "type": "object" - }, - "PaletteEntry": { - "description": "See available color values at: https://urwid.org/manual/displayattributes.html#foreground-and-background-settings", - "properties": { - "fg": { - "title": "Foreground color in 16-color mode", - "type": "string" - }, - "bg": { - "title": "Background color in 16-color mode", - "type": "string" - }, - "mono": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Color in monochrome mode" - }, - "fg_hi": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Foreground color in high-color mode" - }, - "bg_hi": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Background color in high-color mode" - } - }, - "required": [ - "fg", - "bg" - ], - "title": "An Urwid palette entry", + "title": "PaletteModel", "type": "object" } }, @@ -970,7 +1054,7 @@ "palette": { "allOf": [ { - "$ref": "#/$defs/Palette" + "$ref": "#/$defs/PaletteModel" } ], "default": {}, @@ -979,4 +1063,4 @@ }, "title": "Clisnips configuration settings.", "type": "object" -} \ No newline at end of file +}