refactor(frontend): rename booklore-ui to frontend
- Frontend path: - rename the tracked Angular app tree from `booklore-ui/` to `frontend/` - preserve file contents during the move so this commit stays focused on the path change itself - Frontend docs: - update the moved frontend README and contribution guide where they refer to the renamed folder - keep those edits limited to path references introduced by the directory rename
This commit is contained in:
@@ -0,0 +1,249 @@
|
||||
<div class="icon-picker">
|
||||
<header class="dialog-header">
|
||||
<div class="header-content">
|
||||
<div class="header-icon">
|
||||
<i class="pi pi-palette"></i>
|
||||
</div>
|
||||
<div class="header-text">
|
||||
<h1>Choose an Icon</h1>
|
||||
<p>Select from library or add custom SVGs</p>
|
||||
</div>
|
||||
</div>
|
||||
<p-button
|
||||
icon="pi pi-times"
|
||||
[text]="true"
|
||||
[rounded]="true"
|
||||
severity="secondary"
|
||||
(onClick)="ref.close()"
|
||||
/>
|
||||
</header>
|
||||
|
||||
<div class="dialog-body">
|
||||
<p-tabs [(value)]="activeTabIndex">
|
||||
<p-tablist>
|
||||
<p-tab value="0">
|
||||
<i class="pi pi-prime"></i>
|
||||
<span>Prime Icons</span>
|
||||
</p-tab>
|
||||
<p-tab value="1">
|
||||
<i class="pi pi-images"></i>
|
||||
<span>SVG Library</span>
|
||||
</p-tab>
|
||||
@if (canManageIcons) {
|
||||
<p-tab value="2">
|
||||
<i class="pi pi-plus-circle"></i>
|
||||
<span>Add Custom</span>
|
||||
</p-tab>
|
||||
}
|
||||
</p-tablist>
|
||||
|
||||
<p-tabpanels>
|
||||
<!-- Prime Icons Tab -->
|
||||
<p-tabpanel value="0">
|
||||
<div class="tab-content">
|
||||
<div class="search-container">
|
||||
<i class="pi pi-search search-icon"></i>
|
||||
<input
|
||||
type="text"
|
||||
pInputText
|
||||
placeholder="Search Prime icons..."
|
||||
[(ngModel)]="searchText"
|
||||
class="search-input"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="icon-grid">
|
||||
@for (icon of filteredIcons(); track icon) {
|
||||
<div
|
||||
class="icon-item"
|
||||
(click)="selectIcon(icon)"
|
||||
[class.selected]="icon === selectedIcon"
|
||||
[title]="icon"
|
||||
>
|
||||
<i [class]="icon"></i>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</p-tabpanel>
|
||||
|
||||
<!-- SVG Library Tab -->
|
||||
<p-tabpanel value="1">
|
||||
<div class="tab-content">
|
||||
@if (isLoadingSvgIcons) {
|
||||
<div class="loading-state">
|
||||
<i class="pi pi-spin pi-spinner"></i>
|
||||
<span>Loading icons...</span>
|
||||
</div>
|
||||
} @else if (svgIconsError) {
|
||||
<div class="error-state">
|
||||
<i class="pi pi-exclamation-triangle"></i>
|
||||
<span>{{ svgIconsError }}</span>
|
||||
</div>
|
||||
} @else {
|
||||
<div class="search-container">
|
||||
<i class="pi pi-search search-icon"></i>
|
||||
<input
|
||||
type="text"
|
||||
pInputText
|
||||
placeholder="Search SVG icons..."
|
||||
[(ngModel)]="svgSearchText"
|
||||
class="search-input"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="icon-grid">
|
||||
@for (iconName of filteredSvgIcons(); track iconName) {
|
||||
<div
|
||||
class="icon-item svg-icon-item"
|
||||
(click)="selectSvgIcon(iconName)"
|
||||
[class.selected]="iconName === selectedSvgIcon"
|
||||
[title]="iconName"
|
||||
draggable="true"
|
||||
(dragstart)="onSvgIconDragStart(iconName)"
|
||||
(dragend)="onSvgIconDragEnd()"
|
||||
>
|
||||
<div class="svg-icon-inline" [innerHTML]="getSvgContent(iconName)"></div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
@if (canManageIcons) {
|
||||
<div class="trash-zone-container">
|
||||
<div
|
||||
class="trash-zone"
|
||||
[class.active]="isTrashHover"
|
||||
(dragover)="onTrashDragOver($event)"
|
||||
(dragleave)="onTrashDragLeave($event)"
|
||||
(drop)="onTrashDrop($event)"
|
||||
>
|
||||
<i class="pi pi-trash"></i>
|
||||
<span>Drop here to delete</span>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
</p-tabpanel>
|
||||
|
||||
<!-- Add Custom SVG Tab -->
|
||||
@if (canManageIcons) {
|
||||
<p-tabpanel value="2">
|
||||
<div class="tab-content">
|
||||
<section class="form-section">
|
||||
<div class="section-header">
|
||||
<i class="pi pi-code"></i>
|
||||
<span>SVG Input</span>
|
||||
</div>
|
||||
|
||||
<div class="form-fields">
|
||||
<div class="form-field">
|
||||
<label>Icon Name</label>
|
||||
<input
|
||||
type="text"
|
||||
pInputText
|
||||
[(ngModel)]="svgName"
|
||||
placeholder="e.g., my-custom-icon"
|
||||
class="input-full"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="form-field">
|
||||
<label>SVG Code</label>
|
||||
<textarea
|
||||
pInputTextarea
|
||||
[(ngModel)]="svgContent"
|
||||
(ngModelChange)="onSvgContentChange()"
|
||||
placeholder="<svg>...</svg>"
|
||||
[rows]="6"
|
||||
class="code-textarea"
|
||||
></textarea>
|
||||
</div>
|
||||
|
||||
@if (svgContent && svgPreview) {
|
||||
<div class="preview-card">
|
||||
<div class="preview-label">Preview</div>
|
||||
<div class="preview-content" [innerHTML]="svgPreview"></div>
|
||||
</div>
|
||||
}
|
||||
|
||||
@if (errorMessage) {
|
||||
<div class="error-message">
|
||||
<i class="pi pi-exclamation-circle"></i>
|
||||
<span>{{ errorMessage }}</span>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
<div class="form-actions">
|
||||
<p-button
|
||||
label="Add to Queue"
|
||||
icon="pi pi-plus"
|
||||
[outlined]="true"
|
||||
[disabled]="!svgContent || !svgName"
|
||||
(onClick)="addSvgEntry()"
|
||||
/>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
@if (svgEntries.length > 0) {
|
||||
<section class="form-section queue-section">
|
||||
<div class="section-header">
|
||||
<i class="pi pi-list"></i>
|
||||
<span>Queue</span>
|
||||
<span class="section-badge">{{ svgEntries.length }}</span>
|
||||
<div class="section-actions">
|
||||
<p-button
|
||||
label="Clear All"
|
||||
icon="pi pi-times"
|
||||
severity="danger"
|
||||
[text]="true"
|
||||
size="small"
|
||||
(onClick)="clearAllEntries()"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="queue-grid">
|
||||
@for (entry of svgEntries; track entry.name; let i = $index) {
|
||||
<div class="queue-item" [class.has-error]="entry.error">
|
||||
<div class="queue-item-header">
|
||||
<span class="queue-item-name">{{ entry.name }}</span>
|
||||
<button class="queue-item-remove" (click)="removeSvgEntry(i)" type="button">
|
||||
<i class="pi pi-times"></i>
|
||||
</button>
|
||||
</div>
|
||||
<div class="queue-item-preview" [innerHTML]="entry.preview"></div>
|
||||
@if (entry.error) {
|
||||
<div class="queue-item-error">{{ entry.error }}</div>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
@if (batchErrorMessage) {
|
||||
<div class="error-message">
|
||||
<i class="pi pi-exclamation-circle"></i>
|
||||
<span>{{ batchErrorMessage }}</span>
|
||||
</div>
|
||||
}
|
||||
|
||||
<div class="form-actions">
|
||||
<p-button
|
||||
label="Save All Icons"
|
||||
icon="pi pi-save"
|
||||
severity="success"
|
||||
[loading]="isSavingBatch"
|
||||
[disabled]="svgEntries.length === 0"
|
||||
(onClick)="saveAllSvgs()"
|
||||
/>
|
||||
</div>
|
||||
</section>
|
||||
}
|
||||
</div>
|
||||
</p-tabpanel>
|
||||
}
|
||||
</p-tabpanels>
|
||||
</p-tabs>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user