generated from coulomb/repo-seed
feat: add refactored testdrive-jsui capability with consolidated architecture
Complete integration of refactored testdrive-jsui capability: ## Refactored Architecture - js/ - All JavaScript source (controls, components, core) - static/ - CSS, images, templates - src/testdrive_jsui/ - Python package - tests/ - Python tests ## Plugin Self-Declaration - get_plugin_source_dir() - plugin declares own location - get_asset_paths() - organized asset paths - No hardcoded discovery logic ## Merged Content - Baseline UI scaffold (tutorials, LICENSE, INTRODUCTION.md) - Refactored capability implementation - Comprehensive documentation Ready for standalone use or integration with markitect. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
129
static/css/controls.css
Normal file
129
static/css/controls.css
Normal file
@@ -0,0 +1,129 @@
|
||||
/**
|
||||
* TestDrive JSUI Control Panel Styles
|
||||
*
|
||||
* Styles for individual control panels
|
||||
*/
|
||||
|
||||
/* Contents Control (Northwest) */
|
||||
.contents-control {
|
||||
max-height: 300px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.contents-control .toc-item {
|
||||
padding: 0.25rem 0;
|
||||
cursor: pointer;
|
||||
border-radius: 3px;
|
||||
padding-left: 0.5rem;
|
||||
}
|
||||
|
||||
.contents-control .toc-item:hover {
|
||||
background-color: #f8f9fa;
|
||||
}
|
||||
|
||||
.contents-control .toc-h1 { font-weight: bold; }
|
||||
.contents-control .toc-h2 { margin-left: 1rem; }
|
||||
.contents-control .toc-h3 { margin-left: 2rem; font-size: 0.9em; }
|
||||
|
||||
/* Status Control (East) */
|
||||
.status-control {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.status-metric {
|
||||
padding: 0.5rem;
|
||||
margin: 0.25rem 0;
|
||||
background: #f8f9fa;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.status-metric .metric-value {
|
||||
font-size: 1.5em;
|
||||
font-weight: bold;
|
||||
color: #007bff;
|
||||
}
|
||||
|
||||
.status-metric .metric-label {
|
||||
font-size: 0.8em;
|
||||
color: #6c757d;
|
||||
}
|
||||
|
||||
/* Debug Control (Southeast) */
|
||||
.debug-control {
|
||||
font-family: monospace;
|
||||
}
|
||||
|
||||
/* Removed debug-header styles - using base class title formatting */
|
||||
|
||||
.debug-control .debug-logs {
|
||||
max-height: 200px;
|
||||
overflow-y: auto;
|
||||
background: #f8f9fa;
|
||||
padding: 0.5rem;
|
||||
margin: 0 -0.75rem -0.75rem -0.75rem;
|
||||
border-radius: 0 0 5px 5px;
|
||||
font-size: 0.8em;
|
||||
}
|
||||
|
||||
/* Edit Control (Northeast) */
|
||||
.edit-control {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.edit-control .control-button {
|
||||
display: block;
|
||||
width: 100%;
|
||||
margin: 0.5rem 0;
|
||||
padding: 0.5rem;
|
||||
background: #007bff;
|
||||
color: #fff;
|
||||
border: none;
|
||||
border-radius: 4px;
|
||||
cursor: pointer;
|
||||
font-size: 0.9em;
|
||||
}
|
||||
|
||||
.edit-control .control-button:hover {
|
||||
background: #0056b3;
|
||||
}
|
||||
|
||||
.edit-control .control-button:disabled {
|
||||
background: #6c757d;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
.edit-control .control-button.danger {
|
||||
background: #dc3545;
|
||||
}
|
||||
|
||||
.edit-control .control-button.danger:hover {
|
||||
background: #c82333;
|
||||
}
|
||||
|
||||
/* Control panel animations */
|
||||
.markitect-control-panel {
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.markitect-control-panel.entering {
|
||||
opacity: 0;
|
||||
transform: scale(0.9);
|
||||
}
|
||||
|
||||
.markitect-control-panel.entered {
|
||||
opacity: 1;
|
||||
transform: scale(1);
|
||||
}
|
||||
|
||||
/* Responsive adjustments */
|
||||
@media (max-width: 768px) {
|
||||
.markitect-control-panel {
|
||||
position: fixed !important;
|
||||
top: auto !important;
|
||||
bottom: 10px !important;
|
||||
left: 10px !important;
|
||||
right: 10px !important;
|
||||
transform: none !important;
|
||||
max-width: none !important;
|
||||
}
|
||||
}
|
||||
101
static/css/editor.css
Normal file
101
static/css/editor.css
Normal file
@@ -0,0 +1,101 @@
|
||||
/**
|
||||
* TestDrive JSUI Editor Styles
|
||||
*
|
||||
* Base styles for the markdown editor interface
|
||||
*/
|
||||
|
||||
.markitect-edit-mode {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
/* Section editing styles */
|
||||
.markitect-section {
|
||||
position: relative;
|
||||
padding: 0.5rem;
|
||||
margin: 0.5rem 0;
|
||||
border: 1px solid transparent;
|
||||
border-radius: 4px;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
.markitect-section:hover {
|
||||
background-color: #f8f9fa;
|
||||
border-color: #e9ecef;
|
||||
}
|
||||
|
||||
.markitect-section.editing {
|
||||
background-color: #fff;
|
||||
border-color: #007bff;
|
||||
box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
|
||||
}
|
||||
|
||||
/* Editor styles */
|
||||
.markitect-editor {
|
||||
width: 100%;
|
||||
min-height: 100px;
|
||||
padding: 0.75rem;
|
||||
border: none;
|
||||
background: transparent;
|
||||
font-family: inherit;
|
||||
font-size: inherit;
|
||||
line-height: inherit;
|
||||
resize: vertical;
|
||||
}
|
||||
|
||||
.markitect-editor:focus {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
/* Control panel positioning */
|
||||
.markitect-control-panel {
|
||||
position: fixed;
|
||||
z-index: 1000;
|
||||
background: #fff;
|
||||
border: 1px solid #dee2e6;
|
||||
border-radius: 6px;
|
||||
padding: 0.75rem;
|
||||
min-width: 200px;
|
||||
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
/* Compass positioning */
|
||||
.markitect-control-nw { top: 20px; left: 20px; }
|
||||
.markitect-control-ne { top: 20px; right: 20px; }
|
||||
.markitect-control-e { top: 50%; right: 20px; transform: translateY(-50%); }
|
||||
.markitect-control-se { bottom: 20px; right: 20px; }
|
||||
.markitect-control-s { bottom: 20px; left: 50%; transform: translateX(-50%); }
|
||||
.markitect-control-sw { bottom: 20px; left: 20px; }
|
||||
.markitect-control-w { top: 50%; left: 20px; transform: translateY(-50%); }
|
||||
|
||||
/* Control panel states */
|
||||
.markitect-control-collapsed {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.markitect-control-expanded {
|
||||
max-width: 300px;
|
||||
max-height: 400px;
|
||||
}
|
||||
|
||||
/* Debug styles */
|
||||
.markitect-debug-panel {
|
||||
font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
|
||||
font-size: 12px;
|
||||
background: #2d3748;
|
||||
color: #e2e8f0;
|
||||
max-height: 300px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.markitect-debug-message {
|
||||
padding: 0.25rem 0.5rem;
|
||||
border-bottom: 1px solid #4a5568;
|
||||
}
|
||||
|
||||
.markitect-debug-error { color: #fed7d7; }
|
||||
.markitect-debug-warning { color: #faf089; }
|
||||
.markitect-debug-success { color: #9ae6b4; }
|
||||
.markitect-debug-info { color: #bee3f8; }
|
||||
138
static/css/themes/github.css
Normal file
138
static/css/themes/github.css
Normal file
@@ -0,0 +1,138 @@
|
||||
/**
|
||||
* TestDrive JSUI GitHub Theme
|
||||
*
|
||||
* GitHub-inspired theme for the markdown editor
|
||||
*/
|
||||
|
||||
:root {
|
||||
--github-primary: #0969da;
|
||||
--github-border: #d0d7de;
|
||||
--github-bg-subtle: #f6f8fa;
|
||||
--github-fg-default: #1f2328;
|
||||
--github-fg-muted: #656d76;
|
||||
--github-success: #1a7f37;
|
||||
--github-danger: #d1242f;
|
||||
--github-warning: #9a6700;
|
||||
}
|
||||
|
||||
/* GitHub-style editor */
|
||||
.markitect-edit-mode {
|
||||
color: var(--github-fg-default);
|
||||
}
|
||||
|
||||
.markitect-section {
|
||||
border: 1px solid transparent;
|
||||
}
|
||||
|
||||
.markitect-section:hover {
|
||||
background-color: var(--github-bg-subtle);
|
||||
border-color: var(--github-border);
|
||||
}
|
||||
|
||||
.markitect-section.editing {
|
||||
border-color: var(--github-primary);
|
||||
box-shadow: 0 0 0 0.2rem rgba(9, 105, 218, 0.25);
|
||||
}
|
||||
|
||||
/* GitHub-style control panels */
|
||||
.markitect-control-panel {
|
||||
background: #ffffff;
|
||||
border: 1px solid var(--github-border);
|
||||
color: var(--github-fg-default);
|
||||
}
|
||||
|
||||
/* GitHub-style buttons */
|
||||
.edit-control .control-button {
|
||||
background: var(--github-primary);
|
||||
border: 1px solid transparent;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.edit-control .control-button:hover {
|
||||
background: #0860ca;
|
||||
}
|
||||
|
||||
.edit-control .control-button.danger {
|
||||
background: var(--github-danger);
|
||||
}
|
||||
|
||||
.edit-control .control-button.danger:hover {
|
||||
background: #b91c1c;
|
||||
}
|
||||
|
||||
/* GitHub-style status metrics */
|
||||
.status-metric {
|
||||
background: var(--github-bg-subtle);
|
||||
border: 1px solid var(--github-border);
|
||||
}
|
||||
|
||||
.status-metric .metric-value {
|
||||
color: var(--github-primary);
|
||||
}
|
||||
|
||||
.status-metric .metric-label {
|
||||
color: var(--github-fg-muted);
|
||||
}
|
||||
|
||||
/* GitHub-style debug panel */
|
||||
.markitect-debug-panel {
|
||||
background: #24292f;
|
||||
color: #f0f6fc;
|
||||
border: 1px solid #30363d;
|
||||
}
|
||||
|
||||
.markitect-debug-message {
|
||||
border-bottom: 1px solid #30363d;
|
||||
}
|
||||
|
||||
.markitect-debug-error {
|
||||
color: #f85149;
|
||||
background-color: rgba(248, 81, 73, 0.1);
|
||||
}
|
||||
|
||||
.markitect-debug-warning {
|
||||
color: #f0c674;
|
||||
background-color: rgba(240, 198, 116, 0.1);
|
||||
}
|
||||
|
||||
.markitect-debug-success {
|
||||
color: #56d364;
|
||||
background-color: rgba(86, 211, 100, 0.1);
|
||||
}
|
||||
|
||||
.markitect-debug-info {
|
||||
color: #79c0ff;
|
||||
background-color: rgba(121, 192, 255, 0.1);
|
||||
}
|
||||
|
||||
/* GitHub-style table of contents */
|
||||
.contents-control .toc-item {
|
||||
color: var(--github-fg-default);
|
||||
}
|
||||
|
||||
.contents-control .toc-item:hover {
|
||||
background-color: var(--github-bg-subtle);
|
||||
color: var(--github-primary);
|
||||
}
|
||||
|
||||
/* GitHub-style scrollbars */
|
||||
.contents-control::-webkit-scrollbar,
|
||||
.debug-control .debug-logs::-webkit-scrollbar {
|
||||
width: 8px;
|
||||
}
|
||||
|
||||
.contents-control::-webkit-scrollbar-track,
|
||||
.debug-control .debug-logs::-webkit-scrollbar-track {
|
||||
background: var(--github-bg-subtle);
|
||||
}
|
||||
|
||||
.contents-control::-webkit-scrollbar-thumb,
|
||||
.debug-control .debug-logs::-webkit-scrollbar-thumb {
|
||||
background: var(--github-border);
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.contents-control::-webkit-scrollbar-thumb:hover,
|
||||
.debug-control .debug-logs::-webkit-scrollbar-thumb:hover {
|
||||
background: var(--github-fg-muted);
|
||||
}
|
||||
4
static/images/icons/edit.png
Normal file
4
static/images/icons/edit.png
Normal file
@@ -0,0 +1,4 @@
|
||||
# Placeholder for edit icon
|
||||
# In a real implementation, this would be a PNG image file
|
||||
# For testing purposes, this file exists to verify asset deployment
|
||||
EDIT_ICON_PLACEHOLDER=true
|
||||
2
static/images/icons/reset.png
Normal file
2
static/images/icons/reset.png
Normal file
@@ -0,0 +1,2 @@
|
||||
# Placeholder for reset icon
|
||||
RESET_ICON_PLACEHOLDER=true
|
||||
2
static/images/icons/save.png
Normal file
2
static/images/icons/save.png
Normal file
@@ -0,0 +1,2 @@
|
||||
# Placeholder for save icon
|
||||
SAVE_ICON_PLACEHOLDER=true
|
||||
112
static/templates/index.html
Normal file
112
static/templates/index.html
Normal file
@@ -0,0 +1,112 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="generator" content="TestDrive JSUI {version}">
|
||||
<title>{title}</title>
|
||||
|
||||
<style>
|
||||
body {
|
||||
font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif;
|
||||
max-width: 800px;
|
||||
margin: 0 auto;
|
||||
padding: 2rem;
|
||||
line-height: 1.6;
|
||||
color: #333333;
|
||||
background-color: #ffffff;
|
||||
}
|
||||
#markdown-content {
|
||||
min-height: 200px;
|
||||
}
|
||||
h1, h2, h3, h4, h5, h6 {
|
||||
color: #333333;
|
||||
}
|
||||
pre {
|
||||
background-color: #f6f8fa;
|
||||
color: #333333;
|
||||
padding: 1rem;
|
||||
border-radius: 6px;
|
||||
overflow-x: auto;
|
||||
border: 1px solid #d0d7de;
|
||||
}
|
||||
code {
|
||||
background-color: #f6f8fa;
|
||||
color: #333333;
|
||||
padding: 0.2em 0.4em;
|
||||
border-radius: 3px;
|
||||
font-size: 0.9em;
|
||||
}
|
||||
pre code {
|
||||
background: none;
|
||||
padding: 0;
|
||||
}
|
||||
blockquote {
|
||||
border-left: 4px solid #dfe2e5;
|
||||
margin: 0;
|
||||
padding-left: 1rem;
|
||||
color: #6a737d;
|
||||
}
|
||||
table {
|
||||
font-size: 0.85em;
|
||||
border-collapse: collapse;
|
||||
margin: 1rem 0;
|
||||
width: 100%;
|
||||
border: 1px solid #d0d7de;
|
||||
}
|
||||
th, td {
|
||||
font-size: inherit;
|
||||
border: 1px solid #d0d7de;
|
||||
padding: 0.5rem;
|
||||
text-align: left;
|
||||
}
|
||||
th {
|
||||
background-color: #f6f8fa;
|
||||
font-weight: 600;
|
||||
}
|
||||
img {
|
||||
max-width: 12cm;
|
||||
max-height: 20cm;
|
||||
height: auto;
|
||||
display: block;
|
||||
margin: 1rem auto;
|
||||
}
|
||||
</style>
|
||||
|
||||
<!-- Plugin-specific CSS -->
|
||||
{css_content}
|
||||
|
||||
<!-- External dependencies -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"
|
||||
onload="window.markitectMarkedLoaded = true"
|
||||
onerror="console.error('CDN library failed to load - network or firewall blocking marked.js'); window.markitectMarkedError = true;"></script>
|
||||
</head>
|
||||
<body class="{mode_class}">
|
||||
|
||||
<!-- Content container with fallback content -->
|
||||
<div id="markdown-content">
|
||||
{fallback_content}
|
||||
</div>
|
||||
|
||||
<!-- Configuration Data Interface - Clean JSON configuration -->
|
||||
<script id="markitect-config" type="application/json">{config_json}</script>
|
||||
|
||||
<!-- Plugin JavaScript Assets -->
|
||||
{js_scripts}
|
||||
|
||||
<!-- Initialization Script -->
|
||||
<script>
|
||||
window.addEventListener('load', function() {
|
||||
console.log('🎯 TestDrive JSUI loading complete');
|
||||
|
||||
// Handle CDN loading errors
|
||||
if (window.markitectMarkedError) {
|
||||
console.error("CDN library failed to load - network or firewall blocking marked.js");
|
||||
}
|
||||
|
||||
// Note: MarkitectMain auto-initializes via main-updated.js
|
||||
// No manual initialization needed here
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user