diff options
Diffstat (limited to 'js/baba-yaga/web/editor/styles.css')
-rw-r--r-- | js/baba-yaga/web/editor/styles.css | 755 |
1 files changed, 755 insertions, 0 deletions
diff --git a/js/baba-yaga/web/editor/styles.css b/js/baba-yaga/web/editor/styles.css new file mode 100644 index 0000000..51983b9 --- /dev/null +++ b/js/baba-yaga/web/editor/styles.css @@ -0,0 +1,755 @@ +/* Reset and base styles */ +* { + margin: 0; + padding: 0; + box-sizing: border-box; +} + +body { + font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; + background-color: #1e1e1e; + color: #d4d4d4; + line-height: 1.6; +} + +/* Editor container */ +.editor-container { + display: flex; + flex-direction: column; + height: 100vh; + overflow: hidden; +} + +/* Header */ +.editor-header { + background-color: #2d2d30; + border-bottom: 1px solid #3e3e42; + padding: 1rem; + display: flex; + justify-content: space-between; + align-items: center; +} + +.editor-header h1 { + color: #569cd6; + font-size: 1.5rem; + font-weight: 600; +} + +.header-controls { + display: flex; + gap: 0.5rem; +} + +.header-controls button { + background-color: #007acc; + color: white; + border: none; + padding: 0.5rem 1rem; + border-radius: 4px; + cursor: pointer; + font-size: 0.9rem; + transition: background-color 0.2s; +} + +.header-controls button:hover { + background-color: #005a9e; +} + +/* Main editor area */ +.editor-main { + display: flex; + flex-direction: column; + flex: 1; + overflow: hidden; +} + +/* Top row: Code editor and AST tree view side by side */ +.top-row { + display: flex; + flex: 1; + overflow: hidden; +} + +/* Code editor panel (50% width) */ +.code-editor-panel { + flex: 1; + display: flex; + flex-direction: column; + border-right: 1px solid #3e3e42; + background-color: #1e1e1e; +} + +.code-editor-panel h3 { + padding: 1rem; + background-color: #2d2d30; + border-bottom: 1px solid #3e3e42; + color: #d4d4d4; +} + +.code-editor-container { + flex: 1; + overflow: hidden; + display: flex; + flex-direction: column; + min-height: 0; /* Important for flexbox to work properly */ +} + +#code-editor { + width: 100%; + height: 100%; + border: none; + outline: none; + background-color: #1e1e1e; + color: #d4d4d4; + font-family: 'Consolas', 'Monaco', 'Courier New', monospace; + font-size: 14px; + line-height: 1.5; + padding: 1rem; + resize: none; +} + +/* CodeMirror editor height fixes */ +.CodeMirror { + height: 100% !important; + min-height: 300px; + flex: 1; +} + +.CodeMirror-scroll { + min-height: 100%; +} + + + +/* AST Tree Editor panel (50% width) */ +.ast-editor-panel { + flex: 1; + display: flex; + flex-direction: column; + background-color: #252526; + border-left: 1px solid #3e3e42; +} + +.ast-editor-panel h3 { + padding: 1rem; + background-color: #2d2d30; + border-bottom: 1px solid #3e3e42; + color: #d4d4d4; + display: flex; + align-items: center; + justify-content: space-between; +} + +.tree-editor-container { + flex: 1; + overflow: auto; + padding: 1rem; +} + +/* Bottom row: Output panel */ +.output-panel { + height: 200px; + display: flex; + flex-direction: column; + background-color: #1e1e1e; + border-top: 1px solid #3e3e42; +} + +/* Tabs */ +.structural-tabs { + display: flex; + background-color: #2d2d30; + border-bottom: 1px solid #3e3e42; +} + +.tab-btn { + background-color: transparent; + color: #d4d4d4; + border: none; + padding: 0.75rem 1rem; + cursor: pointer; + border-bottom: 2px solid transparent; + transition: all 0.2s; +} + +.tab-btn:hover { + background-color: #3e3e42; +} + +.tab-btn.active { + background-color: #007acc; + color: white; + border-bottom-color: #007acc; +} + +/* Tab content */ +.tab-content { + flex: 1; + overflow: auto; + padding: 1rem; +} + +.tab-pane { + display: none; +} + +.tab-pane.active { + display: block; +} + +/* Tree view */ +.tree-view-container { + height: 100%; + overflow: auto; +} + +#tree-view { + font-family: 'Consolas', 'Monaco', 'Courier New', monospace; + font-size: 12px; + line-height: 1.4; +} + +.tree-node { + margin: 2px 0; + padding: 2px 0; +} + +.tree-node-content { + display: flex; + align-items: center; + cursor: pointer; + padding: 2px 4px; + border-radius: 3px; + transition: background-color 0.2s; +} + +.tree-node-content:hover { + background-color: #3e3e42; +} + +.tree-node-content.clickable { + cursor: pointer; +} + +.tree-node.selected .tree-node-content { + background-color: #007acc; + color: white; +} + +.tree-node.selected .tree-node-type { + color: white; +} + +.tree-node.selected .tree-node-value { + color: white; +} + +.tree-node-toggle { + margin-right: 8px; + color: #569cd6; + font-weight: bold; + width: 16px; + text-align: center; +} + +.tree-node-type { + color: #4ec9b0; + margin-right: 8px; + font-weight: 600; +} + +.tree-node-value { + color: #d4d4d4; +} + +.tree-node-children { + margin-left: 20px; + border-left: 1px solid #3e3e42; + padding-left: 10px; +} + +/* Form styles */ +.form-group { + margin-bottom: 1rem; +} + +.form-group label { + display: block; + margin-bottom: 0.5rem; + color: #d4d4d4; + font-weight: 500; +} + +.form-group input, +.form-group select { + width: 100%; + padding: 0.5rem; + border: 1px solid #3e3e42; + border-radius: 4px; + background-color: #1e1e1e; + color: #d4d4d4; + font-size: 14px; +} + +.form-group input:focus, +.form-group select:focus { + outline: none; + border-color: #007acc; + box-shadow: 0 0 0 2px rgba(0, 122, 204, 0.2); +} + +/* Parameter list */ +.parameter-list { + margin-bottom: 0.5rem; +} + +.parameter-item { + display: flex; + gap: 0.5rem; + margin-bottom: 0.5rem; + align-items: center; +} + +.parameter-item input { + flex: 1; +} + +.parameter-item select { + width: 120px; +} + +.remove-param-btn { + background-color: #d73a49; + color: white; + border: none; + padding: 0.25rem 0.5rem; + border-radius: 3px; + cursor: pointer; + font-size: 12px; +} + +.remove-param-btn:hover { + background-color: #b31d28; +} + +/* Expression builder */ +.expression-builder { + border: 1px solid #3e3e42; + border-radius: 4px; + padding: 1rem; + background-color: #1e1e1e; + min-height: 100px; +} + +.expression-item { + display: flex; + gap: 0.5rem; + margin-bottom: 0.5rem; + align-items: center; +} + +.expression-type-selector { + width: 120px; +} + +.expression-value { + flex: 1; +} + +/* When expression editor */ +.when-editor { + height: 100%; + overflow: auto; +} + +.expression-list, +.case-list { + margin-bottom: 1rem; +} + +.case-item { + border: 1px solid #3e3e42; + border-radius: 4px; + padding: 1rem; + margin-bottom: 1rem; + background-color: #1e1e1e; +} + +.case-header { + display: flex; + justify-content: space-between; + align-items: center; + margin-bottom: 1rem; +} + +.case-patterns { + margin-bottom: 1rem; +} + +.pattern-item { + display: flex; + gap: 0.5rem; + margin-bottom: 0.5rem; + align-items: center; +} + +.remove-case-btn { + background-color: #d73a49; + color: white; + border: none; + padding: 0.25rem 0.5rem; + border-radius: 3px; + cursor: pointer; + font-size: 12px; +} + +/* With header editor */ +.with-editor { + height: 100%; + overflow: auto; +} + +.entry-list { + margin-bottom: 1rem; +} + +.entry-item { + border: 1px solid #3e3e42; + border-radius: 4px; + padding: 1rem; + margin-bottom: 1rem; + background-color: #1e1e1e; +} + +.entry-header { + display: flex; + justify-content: space-between; + align-items: center; + margin-bottom: 1rem; +} + +.entry-type-selector { + width: 120px; +} + +.entry-name { + flex: 1; + margin-right: 0.5rem; +} + +.remove-entry-btn { + background-color: #d73a49; + color: white; + border: none; + padding: 0.25rem 0.5rem; + border-radius: 3px; + cursor: pointer; + font-size: 12px; +} + +/* Output panel */ +.output-panel { + height: 200px; + background-color: #252526; + border-top: 1px solid #3e3e42; +} + +.output-panel h3 { + padding: 1rem; + background-color: #2d2d30; + border-bottom: 1px solid #3e3e42; + color: #d4d4d4; +} + +.output-tabs { + display: flex; + background-color: #2d2d30; + border-bottom: 1px solid #3e3e42; +} + +.output-content { + flex: 1; + overflow: auto; + padding: 1rem; +} + +.output-content pre { + font-family: 'Consolas', 'Monaco', 'Courier New', monospace; + font-size: 12px; + line-height: 1.4; + color: #d4d4d4; + white-space: pre-wrap; + word-wrap: break-word; +} + +/* Buttons */ +button { + background-color: #007acc; + color: white; + border: none; + padding: 0.5rem 1rem; + border-radius: 4px; + cursor: pointer; + font-size: 0.9rem; + transition: background-color 0.2s; +} + +button:hover { + background-color: #005a9e; +} + +button:disabled { + background-color: #3e3e42; + color: #6a6a6a; + cursor: not-allowed; +} + +/* Utility classes */ +.hidden { + display: none !important; +} + +.error { + color: #f14c4c; +} + +.success { + color: #4ec9b0; +} + +.warning { + color: #dcdcaa; +} + +/* Responsive design */ +@media (max-width: 1200px) { + .top-row { + flex-direction: column; + } + + .code-editor-panel, + .ast-editor-panel { + flex: none; + height: 50%; + } +} + +@media (max-width: 768px) { + .editor-header { + flex-direction: column; + gap: 1rem; + align-items: stretch; + } + + .header-controls { + justify-content: center; + } + + .structural-tabs { + flex-wrap: wrap; + } + + .tab-btn { + flex: 1; + min-width: 80px; + } +} + +/* Parse status indicator */ +.parse-status { + font-size: 0.8rem; + font-weight: normal; + margin-left: 0.5rem; +} + +.parse-status.parsing { + color: #dcdcaa; +} + +.parse-status.parsed { + color: #4ec9b0; +} + +.parse-status.error { + color: #f14c4c; +} + +/* Baba Yaga Syntax Highlighting Enhancements */ +.CodeMirror { + font-family: 'Consolas', 'Monaco', 'Courier New', monospace; + font-size: 14px; + line-height: 1.5; +} + +/* Custom token colors for Baba Yaga - More specific selectors */ +.CodeMirror.cm-s-baba-yaga .cm-keyword, +.cm-s-baba-yaga .cm-keyword { + color: #c586c0 !important; /* Purple for keywords */ + font-weight: bold; +} + +.CodeMirror.cm-s-baba-yaga .cm-type, +.cm-s-baba-yaga .cm-type { + color: #4ec9b0 !important; /* Teal for types */ + font-weight: bold; +} + +.CodeMirror.cm-s-baba-yaga .cm-function, +.cm-s-baba-yaga .cm-function { + color: #dcdcaa !important; /* Yellow for functions */ + font-weight: bold; +} + +.CodeMirror.cm-s-baba-yaga .cm-builtin, +.cm-s-baba-yaga .cm-builtin { + color: #d7ba7d !important; /* Orange for builtins */ +} + +.CodeMirror.cm-s-baba-yaga .cm-operator, +.cm-s-baba-yaga .cm-operator { + color: #d4d4d4 !important; /* White for operators */ +} + +.CodeMirror.cm-s-baba-yaga .cm-number, +.cm-s-baba-yaga .cm-number { + color: #b5cea8 !important; /* Green for numbers */ +} + +.CodeMirror.cm-s-baba-yaga .cm-string, +.cm-s-baba-yaga .cm-string { + color: #ce9178 !important; /* Red for strings */ +} + +.CodeMirror.cm-s-baba-yaga .cm-comment, +.cm-s-baba-yaga .cm-comment { + color: #6a9955 !important; /* Green for comments */ + font-style: italic; +} + +.CodeMirror.cm-s-baba-yaga .cm-variable, +.cm-s-baba-yaga .cm-variable { + color: #9cdcfe !important; /* Blue for variables */ +} + +/* Dark theme adjustments for better contrast */ +.cm-s-baba-yaga.CodeMirror { + background-color: #1e1e1e; + color: #d4d4d4; +} + +.cm-s-baba-yaga .CodeMirror-gutters { + background-color: #2d2d30; + border-right: 1px solid #3e3e42; +} + +.cm-s-baba-yaga .CodeMirror-linenumber { + color: #858585; +} + +/* Focus state */ +.CodeMirror-focused .CodeMirror-cursor { + border-left: 2px solid #007acc; +} + +/* Selection */ +.CodeMirror-selected { + background-color: #264f78 !important; +} + +/* Active line highlighting */ +.CodeMirror-activeline-background { + background-color: #2d2d30; +} + +/* Add buttons */ +.add-btn { + background-color: #007acc; + color: white; + border: none; + padding: 0.25rem 0.5rem; + margin-left: 0.5rem; + border-radius: 3px; + cursor: pointer; + font-size: 0.8rem; + transition: background-color 0.2s; +} + +.add-btn:hover { + background-color: #005a9e; +} + +/* Retry button */ +.retry-btn { + background-color: #6a9955; + color: white; + border: none; + padding: 0.25rem 0.5rem; + margin-left: 0.5rem; + border-radius: 3px; + cursor: pointer; + font-size: 0.8rem; + transition: background-color 0.2s; +} + +.retry-btn:hover { + background-color: #4a7a35; +} + +.retry-btn:active { + transform: scale(0.95); +} + +/* Inline editing */ +.tree-node-editable { + cursor: pointer; + padding: 2px 4px; + border-radius: 3px; + transition: background-color 0.2s; +} + +.tree-node-editable:hover { + background-color: #3e3e42; +} + +.tree-node-editing { + background-color: #007acc; + color: white; +} + +.tree-node-editing input { + background: transparent; + border: none; + color: white; + outline: none; + font-family: inherit; + font-size: inherit; + width: 100%; +} + +.tree-node-actions { + display: inline-flex; + margin-left: 0.5rem; + gap: 0.25rem; +} + +.tree-node-action-btn { + background-color: #3e3e42; + color: #d4d4d4; + border: none; + padding: 1px 4px; + border-radius: 2px; + cursor: pointer; + font-size: 0.7rem; + transition: background-color 0.2s; +} + +.tree-node-action-btn:hover { + background-color: #007acc; + color: white; +} + +.tree-node-action-btn.delete:hover { + background-color: #f14c4c; +} + |