callumalpass_tasknotes/build-css.mjs
callumalpass f3ff723152 feat: enhance time entry interface with new modal and calendar integration
Add comprehensive time entry management features:

- Add TimeEntryEditorModal for viewing, editing, adding, and deleting time entries
  - Native HTML5 datetime-local pickers for better UX
  - Auto-calculated duration from start/end times
  - Sorted by date (newest first)
  - Total time display in hours and minutes

- Add new commands:
  - "Start time tracking (select task)": Opens task selector to start tracking
  - "Edit time entries (select task)": Opens task selector then time entry editor

- Add TaskActionPaletteModal integration:
  - "Edit time entries" action appears for tasks with time entries

- Add Alt+drag calendar functionality:
  - Alt+drag on Bases calendar creates time entries (similar to Shift+drag for timeblocks)
  - Opens task selector to choose which task to add time entry to
  - Auto-calculates duration from dragged time range

- Fix timeblock creation (Shift+drag):
  - Remove requirement for timeblocks to be visible to create them
  - Allow creation as long as timeblocking is enabled in settings
  - Add debug logging for troubleshooting modifier keys

- Fix EVENT_TASK_UPDATED error:
  - Remove redundant event triggers that were passing incorrect data
  - TaskService.updateTask() already handles event emission properly

- Fix modal width issues:
  - Update TimeEntryEditorModal to prevent horizontal scrolling
  - Update webhook modal CSS with same fix
  - Use width: auto on modal container, specific width on modal-content

- Add comprehensive i18n translations for all new features
- Add styling for TimeEntryEditorModal with responsive design and dark mode support
2025-10-29 21:46:23 +11:00

122 lines
No EOL
5.8 KiB
JavaScript

import { readFileSync, writeFileSync } from 'fs';
import { join } from 'path';
const CSS_FILES = [
// Core System Files
'styles/variables.css', // CSS custom properties and design system variables
'styles/utilities.css', // Scoped utility classes for layout, spacing, typography
'styles/base.css', // Basic styles, animations, card components, and layout
// BEM Component Files
'styles/task-card-bem.css', // TaskCard component with proper BEM scoping
'styles/task-inline-widget.css', // Inline task widget for editor with proper BEM scoping
'styles/note-card-bem.css', // NoteCard component with proper BEM scoping
'styles/filter-bar-bem.css', // FilterBar component with proper BEM scoping
'styles/filter-heading.css', // FilterHeading component with proper BEM scoping
'styles/modal-bem.css', // Modal components with proper BEM scoping
'styles/task-modal.css', // Task modal components (Google Keep/Todoist style)
'styles/reminder-modal.css', // Reminder modal component with proper BEM scoping
'styles/date-picker.css', // Enhanced date/time picker styling
'styles/task-selector-modal.css', // TaskSelectorModal component with proper BEM scoping
'styles/unscheduled-tasks-selector-modal.css', // UnscheduledTasksSelectorModal component with proper BEM scoping
'styles/task-action-palette-modal.css', // TaskActionPaletteModal component with proper BEM scoping
'styles/time-entry-editor-modal.css', // TimeEntryEditorModal component with proper BEM scoping
'styles/project-note-subtasks.css', // ProjectNoteSubtasks component with proper BEM scoping
'styles/task-card-note-widget.css', // TaskCardNoteWidget component with proper BEM scoping
// BEM View Files
'styles/task-list-view.css', // TaskListView component with proper BEM scoping
'styles/calendar-view.css', // CalendarView component with proper BEM scoping
'styles/advanced-calendar-view.css', // AdvancedCalendarView component with proper BEM scoping
'styles/kanban-view.css', // KanbanView component with proper BEM scoping
'styles/agenda-view.css', // AgendaView component with proper BEM scoping
'styles/notes-view.css', // NotesView component with proper BEM scoping
'styles/pomodoro-view.css', // PomodoroView component with proper BEM scoping
'styles/pomodoro-stats-view.css', // PomodoroStatsView component with proper BEM scoping
'styles/stats-view.css', // StatsView component with proper BEM scoping
'styles/settings-view.css', // SettingsView component with proper BEM scoping
'styles/webhook-settings.css', // Webhook settings UI with proper BEM scoping
'styles/status-bar.css', // StatusBar component with proper BEM scoping
'styles/bases-views.css' // Bases integration views (list and kanban)
];
const MAIN_CSS_TEMPLATE = `/* TaskNotes Plugin Styles */
/*
This file is automatically generated by the build process.
To modify styles, edit the source files in the styles/ directory.
Source files:
Core System:
- styles/variables.css: CSS custom properties and design system variables
- styles/utilities.css: Scoped utility classes for layout, spacing, typography, and states
- styles/base.css: Basic styles, animations, card components, and layout
BEM Component Files:
- styles/task-card-bem.css: TaskCard component with proper BEM scoping
- styles/task-inline-widget.css: Inline task widget for editor with proper BEM scoping
- styles/note-card-bem.css: NoteCard component with proper BEM scoping
- styles/filter-bar-bem.css: FilterBar component with proper BEM scoping
- styles/modal-bem.css: Modal components with proper BEM scoping
BEM View Files:
- styles/task-list-view.css: TaskListView component with proper BEM scoping
- styles/calendar-view.css: CalendarView component with proper BEM scoping
- styles/kanban-view.css: KanbanView component with proper BEM scoping
- styles/agenda-view.css: AgendaView component with proper BEM scoping
- styles/notes-view.css: NotesView component with proper BEM scoping
- styles/pomodoro-view.css: PomodoroView component with proper BEM scoping
- styles/pomodoro-stats-view.css: PomodoroStatsView component with proper BEM scoping
- styles/settings-view.css: SettingsView component with proper BEM scoping
Run 'npm run build-css' to regenerate this file.
*/
`;
const REMAINING_STYLES = ``;
function buildCSS() {
console.log('Building CSS...');
let combinedCSS = MAIN_CSS_TEMPLATE;
// Read and concatenate each CSS file
for (const cssFile of CSS_FILES) {
try {
const content = readFileSync(cssFile, 'utf8');
// Add a section header comment
const filename = cssFile.split('/').pop();
combinedCSS += `\n/* ===== ${filename.toUpperCase()} ===== */\n`;
combinedCSS += content;
combinedCSS += '\n';
console.log(`[OK] Included ${cssFile}`);
} catch (error) {
console.error(`[ERROR] Error reading ${cssFile}:`, error.message);
process.exit(1);
}
}
// Add the remaining modal styles
combinedCSS += REMAINING_STYLES;
// Write the combined CSS to styles.css
try {
writeFileSync('styles.css', combinedCSS);
console.log('[OK] Built styles.css successfully');
// Count lines for reference
const lineCount = combinedCSS.split('\n').length;
console.log(`[OK] Generated ${lineCount} lines of CSS`);
} catch (error) {
console.error('[ERROR] Error writing styles.css:', error.message);
process.exit(1);
}
}
// Run the build
buildCSS();