Skip to content

πŸ“š The open-source, offline-first Notion, Obsidian & Confluence alternative. Advanced Markdown, multi-tenant teams, OIDC/SSO, and local S3 backups. Deploy in one command.

Fixes

Smaug6739460d263cd6a5
diff --git a/frontend/app/components/AppSelect.vue b/frontend/app/components/AppSelect.vue
index 0e6b18b9..c3ef1016 100644
--- a/frontend/app/components/AppSelect.vue
+++ b/frontend/app/components/AppSelect.vue
@@ -1,6 +1,6 @@
<template>
<div class="app-select" :style="{ width: size || '100%' }">
- <div v-if="!open" style="display: flex; padding: 1px; align-items: center; justify-content: space-between">
+ <div v-if="!open" style="display: flex; align-items: center; justify-content: space-between">
<button @click.stop="toggleDropdown">{{ selected?.label || placeholder }}</button
><svg :class="{ rotated: !open }" xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24">
<path d="M480-345 240-585l56-56 184 184 184-184 56 56-240 240Z" />
@@ -105,9 +105,9 @@ onBeforeUnmount(() => window.removeEventListener('click', handleClickOutside));
button,
.search-input {
width: 100%;
- padding: 8px 10px;
+ padding: 6px 10px;
border-radius: 6px;
- font-size: 16px;
+ font-size: 1rem;
text-align: left;
cursor: pointer;
}
diff --git a/frontend/app/components/MarkdownEditor/ColorPickerModal.vue b/frontend/app/components/MarkdownEditor/ColorPickerModal.vue
index f285807b..1b9a1ef1 100644
--- a/frontend/app/components/MarkdownEditor/ColorPickerModal.vue
+++ b/frontend/app/components/MarkdownEditor/ColorPickerModal.vue
@@ -2,25 +2,34 @@
<div class="color-picker-modal">
<div class="modal-header">
<div class="header-icon">
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none"
- stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
- <circle cx="13.5" cy="6.5" r=".5"/>
- <circle cx="17.5" cy="10.5" r=".5"/>
- <circle cx="8.5" cy="7.5" r=".5"/>
- <circle cx="6.5" cy="12.5" r=".5"/>
- <path d="M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 011.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z"/>
-</svg>
+ <svg
+ xmlns="http://www.w3.org/2000/svg"
+ viewBox="0 0 24 24"
+ fill="none"
+ stroke="currentColor"
+ stroke-width="2"
+ stroke-linecap="round"
+ stroke-linejoin="round"
+ >
+ <circle cx="13.5" cy="6.5" r=".5" />
+ <circle cx="17.5" cy="10.5" r=".5" />
+ <circle cx="8.5" cy="7.5" r=".5" />
+ <circle cx="6.5" cy="12.5" r=".5" />
+ <path
+ d="M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 011.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z"
+ />
+ </svg>
</div>
<h3>Color Palette</h3>
<p class="header-subtitle">Choose from predefined colors or use the color wheel</p>
</div>
-
+
<div class="modal-content">
<div class="section">
<h4 class="section-title">Quick Colors</h4>
<div class="swatches">
- <button
- v-for="(color, index) in availableColors"
+ <button
+ v-for="color in availableColors"
:key="color"
class="swatch"
:class="{ 'primary-color': color === 'primary' }"
@@ -33,57 +42,48 @@
<div class="swatch-inner">
<div class="swatch-check" v-if="hoveredColor === color">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3">
- <polyline points="20,6 9,17 4,12"/>
+ <polyline points="20,6 9,17 4,12" />
</svg>
</div>
</div>
</button>
</div>
</div>
-
+
<div class="section">
- <h4 class="section-title">
- Custom Color
- </h4>
+ <h4 class="section-title">Custom Color</h4>
<div class="custom">
<div class="color-wheel-section">
<div class="color-wheel-container">
- <canvas
- ref="colorWheel"
+ <canvas
+ ref="colorWheel"
class="color-wheel"
@mousedown="startColorSelection"
@mousemove="updateColorSelection"
@mouseup="stopColorSelection"
@click="selectColorFromWheel"
></canvas>
- <div
+ <div
class="color-wheel-cursor"
- :style="{
- left: `${cursorPosition.x}px`,
+ :style="{
+ left: `${cursorPosition.x}px`,
top: `${cursorPosition.y}px`,
- background: selectedWheelColor
+ background: selectedWheelColor,
}"
></div>
</div>
-
+
<div class="color-controls">
<div class="control-group">
<label>Brightness</label>
<div class="slider-container">
- <input
- type="range"
- min="0"
- max="100"
- v-model="brightness"
- class="brightness-slider"
- @input="updateWheelColor"
- />
+ <input v-model="brightness" type="range" min="0" max="100" class="brightness-slider" @input="updateWheelColor" />
<div class="slider-track">
<div class="slider-fill" :style="{ width: `${brightness}%` }"></div>
</div>
</div>
</div>
-
+
<div class="selected-color-preview">
<div class="preview-circle" :style="{ background: selectedWheelColor }"></div>
<div class="color-info">
@@ -91,48 +91,41 @@
<span class="hsv-values">HSV({{ hue }}, {{ saturation }}%, {{ brightness }}%)</span>
</div>
</div>
-
+
<button class="validate-wheel-btn" @click="validateWheelColor">
<svg class="btn-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
- <path d="M5 13l4 4L19 7"/>
+ <path d="M5 13l4 4L19 7" />
</svg>
<span class="btn-text">Use This Color</span>
</button>
</div>
</div>
-
+
<div class="input-group">
<div class="input-wrapper">
<span class="input-prefix">#</span>
- <input
- v-model="hexColor"
- class="hex"
- placeholder="RRGGBB"
- maxlength="6"
- @keyup.enter="applyCustomColor"
- @input="validateHexInput"
- />
+ <input v-model="hexColor" class="hex" placeholder="RRGGBB" maxlength="6" @keyup.enter="applyCustomColor" @input="validateHexInput" />
</div>
<div class="color-preview" :style="{ background: hexColor && /^[0-9A-F]{6}$/i.test(hexColor) ? `#${hexColor}` : 'transparent' }">
<div class="preview-border"></div>
</div>
</div>
-
- <button class="apply" @click="applyCustomColor" :disabled="!isValidHex">
+
+ <button class="apply" :disabled="!isValidHex" @click="applyCustomColor">
<span class="btn-text">Apply Color</span>
<svg class="btn-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
- <path d="M5 13l4 4L19 7"/>
+ <path d="M5 13l4 4L19 7" />
</svg>
</button>
</div>
</div>
</div>
-
+
<div class="modal-footer">
<button class="cancel-btn" @click="closeModal">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
- <line x1="18" y1="6" x2="6" y2="18"/>
- <line x1="6" y1="6" x2="18" y2="18"/>
+ <line x1="18" y1="6" x2="6" y2="18" />
+ <line x1="6" y1="6" x2="18" y2="18" />
</svg>
<span>Cancel</span>
</button>
@@ -141,9 +134,6 @@
</template>
<script setup lang="ts">
-import { ref, computed, onMounted, nextTick } from 'vue';
-import { getAppColor } from '~/composables/utils';
-
const props = defineProps<{
onColorSelect: (color: string) => void;
}>();
@@ -162,10 +152,7 @@ const brightness = ref(100);
const selectedWheelColor = ref('#FF0000');
const cursorPosition = ref({ x: 150, y: 75 });
-const availableColors = [
- 'primary',
- ...Array.from({ length: 8 }, (_, i) => getAppColor(i))
-];
+const availableColors = ['primary', ...Array.from({ length: 8 }, (_, i) => getAppColor(i))];
const isValidHex = computed(() => {
return hexColor.value && /^[0-9A-F]{6}$/i.test(hexColor.value);
@@ -187,28 +174,28 @@ const stopColorSelection = () => {
const updateColorSelection = (e: MouseEvent) => {
if (!isSelecting.value || !colorWheel.value) return;
-
+
const rect = colorWheel.value.getBoundingClientRect();
const x = e.clientX - rect.left;
const y = e.clientY - rect.top;
-
+
const centerX = rect.width / 2;
const centerY = rect.height / 2;
-
+
const deltaX = x - centerX;
const deltaY = y - centerY;
-
+
const distance = Math.sqrt(deltaX * deltaX + deltaY * deltaY);
const maxDistance = Math.min(centerX, centerY);
-
+
if (distance <= maxDistance) {
cursorPosition.value = { x, y };
-
+
const angle = Math.atan2(deltaY, deltaX) * (180 / Math.PI);
hue.value = angle < 0 ? angle + 360 : angle;
-
+
saturation.value = Math.min(100, (distance / maxDistance) * 100);
-
+
updateWheelColor();
}
};
@@ -227,72 +214,92 @@ const updateWheelColor = () => {
const h = hue.value;
const s = saturation.value;
const v = brightness.value;
-
+
selectedWheelColor.value = hsvToHex(h, s, v);
};
const hsvToHex = (h: number, s: number, v: number): string => {
const c = (v / 100) * (s / 100);
- const x = c * (1 - Math.abs((h / 60) % 2 - 1));
- const m = (v / 100) - c;
-
- let r = 0, g = 0, b = 0;
-
+ const x = c * (1 - Math.abs(((h / 60) % 2) - 1));
+ const m = v / 100 - c;
+
+ let r = 0,
+ g = 0,
+ b = 0;
+
if (h >= 0 && h < 60) {
- r = c; g = x; b = 0;
+ r = c;
+ g = x;
+ b = 0;
} else if (h >= 60 && h < 120) {
- r = x; g = c; b = 0;
+ r = x;
+ g = c;
+ b = 0;
} else if (h >= 120 && h < 180) {
- r = 0; g = c; b = x;
+ r = 0;
+ g = c;
+ b = x;
} else if (h >= 180 && h < 240) {
- r = 0; g = x; b = c;
+ r = 0;
+ g = x;
+ b = c;
} else if (h >= 240 && h < 300) {
- r = x; g = 0; b = c;
+ r = x;
+ g = 0;
+ b = c;
} else if (h >= 300 && h < 360) {
- r = c; g = 0; b = x;
+ r = c;
+ g = 0;
+ b = x;
}
-
- const rHex = Math.round((r + m) * 255).toString(16).padStart(2, '0');
- const gHex = Math.round((g + m) * 255).toString(16).padStart(2, '0');
- const bHex = Math.round((b + m) * 255).toString(16).padStart(2, '0');
-
+
+ const rHex = Math.round((r + m) * 255)
+ .toString(16)
+ .padStart(2, '0');
+ const gHex = Math.round((g + m) * 255)
+ .toString(16)
+ .padStart(2, '0');
+ const bHex = Math.round((b + m) * 255)
+ .toString(16)
+ .padStart(2, '0');
+
return `#${rHex}${gHex}${bHex}`.toUpperCase();
};
const drawColorWheel = () => {
if (!colorWheel.value) return;
-
+
const canvas = colorWheel.value;
const ctx = canvas.getContext('2d');
if (!ctx) return;
-
+
const width = canvas.width;
const height = canvas.height;
const centerX = width / 2;
const centerY = height / 2;
const radius = Math.min(centerX, centerY) - 10;
-
+
ctx.clearRect(0, 0, width, height);
-
+
for (let y = 0; y < height; y++) {
for (let x = 0; x < width; x++) {
const deltaX = x - centerX;
const deltaY = y - centerY;
const distance = Math.sqrt(deltaX * deltaX + deltaY * deltaY);
-
+
if (distance <= radius) {
const angle = Math.atan2(deltaY, deltaX) * (180 / Math.PI);
const hue = angle < 0 ? angle + 360 : angle;
const saturation = Math.min(100, (distance / radius) * 100);
const value = 100;
-
+
const color = hsvToHex(hue, saturation, value);
ctx.fillStyle = color;
ctx.fillRect(x, y, 1, 1);
}
}
}
-
+
// Draw outer circle
ctx.strokeStyle = 'var(--border-color)';
ctx.lineWidth = 2;
@@ -345,7 +352,7 @@ onMounted(async () => {
padding: 24px 0 20px 0;
flex-shrink: 0;
text-align: center;
-
+
.header-icon {
width: 48px;
height: 48px;
@@ -356,13 +363,13 @@ onMounted(async () => {
justify-content: center;
margin-bottom: 16px;
color: white;
-
+
svg {
width: 24px;
height: 24px;
}
}
-
+
h3 {
margin: 0 0 8px 0;
font-size: 24px;
@@ -374,7 +381,7 @@ onMounted(async () => {
-webkit-text-fill-color: transparent;
background-clip: text;
}
-
+
.header-subtitle {
margin: 0;
font-size: 14px;
@@ -394,20 +401,20 @@ onMounted(async () => {
overflow-y: auto;
min-height: 0;
padding-right: 8px;
-
+
&::-webkit-scrollbar {
width: 6px;
}
-
+
&::-webkit-scrollbar-track {
background: var(--bg-color-secondary);
border-radius: 3px;
}
-
+
&::-webkit-scrollbar-thumb {
background: var(--border-color);
border-radius: 3px;
-
+
&:hover {
background: var(--primary);
}
@@ -427,14 +434,14 @@ onMounted(async () => {
display: flex;
align-items: center;
gap: 12px;
-
+
.section-icon {
width: 20px;
height: 20px;
color: var(--primary);
flex-shrink: 0;
}
-
+
&::before {
content: '';
position: absolute;
@@ -468,12 +475,12 @@ onMounted(async () => {
position: relative;
overflow: hidden;
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
-
+
&.primary-color {
border-color: var(--primary);
box-shadow: 0 6px 20px rgba(var(--primary-rgb), 0.3);
}
-
+
.swatch-inner {
width: 100%;
height: 100%;
@@ -482,27 +489,27 @@ onMounted(async () => {
justify-content: center;
position: relative;
}
-
+
.swatch-check {
color: white;
filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
-
+
svg {
width: 18px;
height: 18px;
}
}
-
+
&:hover {
transform: translateY(-4px) scale(1.1);
box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
border-color: var(--primary);
-
+
&.primary-color {
box-shadow: 0 16px 40px rgba(var(--primary-rgb), 0.4);
}
}
-
+
&:active {
transform: translateY(-2px) scale(1.05);
}
@@ -580,7 +587,7 @@ onMounted(async () => {
cursor: pointer;
position: relative;
z-index: 2;
-
+
&::-webkit-slider-thumb {
-webkit-appearance: none;
appearance: none;
@@ -592,7 +599,7 @@ onMounted(async () => {
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
cursor: pointer;
}
-
+
&::-moz-range-thumb {
width: 18px;
height: 18px;
@@ -647,14 +654,14 @@ onMounted(async () => {
display: flex;
flex-direction: column;
gap: 2px;
-
+
.hex-value {
font-size: 14px;
font-weight: 700;
color: var(--font-color-dark);
font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}
-
+
.hsv-values {
font-size: 11px;
color: var(--font-color-light);
@@ -682,29 +689,29 @@ onMounted(async () => {
min-height: 40px;
position: relative;
z-index: 100;
-
+
&:hover {
transform: translateY(-2px);
box-shadow: 0 8px 24px rgba(59, 130, 246, 0.4);
background: linear-gradient(135deg, #2563eb, #1e40af);
border-color: #1e3a8a;
-
+
.btn-icon {
transform: scale(1.1);
}
}
-
+
&:active {
transform: translateY(0);
}
-
+
.btn-icon {
width: 14px;
height: 14px;
transition: all 0.3s ease;
color: white;
}
-
+
.btn-text {
font-weight: 600;
color: white;
@@ -726,7 +733,7 @@ onMounted(async () => {
border-radius: 10px;
overflow: hidden;
transition: all 0.3s ease;
-
+
&:focus-within {
border-color: var(--primary);
box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
@@ -753,11 +760,11 @@ onMounted(async () => {
font-weight: 600;
font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
letter-spacing: 1px;
-
+
&:focus {
outline: none;
}
-
+
&::placeholder {
color: var(--font-color-light);
font-weight: 400;
@@ -771,7 +778,7 @@ onMounted(async () => {
border: 2px solid var(--border-color);
position: relative;
overflow: hidden;
-
+
.preview-border {
position: absolute;
inset: 0;
@@ -783,8 +790,12 @@ onMounted(async () => {
}
@keyframes shimmer {
- 0% { transform: translateX(-100%); }
- 100% { transform: translateX(100%); }
+ 0% {
+ transform: translateX(-100%);
+ }
+ 100% {
+ transform: translateX(100%);
+ }
}
.apply {
@@ -801,32 +812,32 @@ onMounted(async () => {
align-items: center;
justify-content: center;
gap: 8px;
-
+
&:disabled {
opacity: 0.5;
cursor: not-allowed;
transform: none;
}
-
+
&:not(:disabled) {
&:hover {
transform: translateY(-2px);
box-shadow: 0 8px 24px rgba(var(--primary-rgb), 0.4);
-
+
.btn-icon {
transform: scale(1.1) rotate(5deg);
}
}
-
+
&:active {
transform: translateY(0);
}
}
-
+
.btn-text {
font-weight: 600;
}
-
+
.btn-icon {
width: 16px;
height: 16px;
@@ -840,7 +851,7 @@ onMounted(async () => {
justify-content: center;
gap: 16px;
flex-shrink: 0;
-
+
.cancel-btn {
padding: 12px 24px;
border: 2px solid var(--border-color);
@@ -854,12 +865,12 @@ onMounted(async () => {
display: flex;
align-items: center;
gap: 8px;
-
+
svg {
width: 14px;
height: 14px;
}
-
+
&:hover {
background: var(--border-color);
border-color: var(--primary);
@@ -867,7 +878,7 @@ onMounted(async () => {
transform: translateY(-2px);
box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}
-
+
&:active {
transform: translateY(0);
}
@@ -878,87 +889,87 @@ onMounted(async () => {
.color-picker-modal {
padding: 0 16px;
}
-
+
.modal-header {
padding: 24px 0 20px 0;
-
+
.header-icon {
width: 40px;
height: 40px;
margin-bottom: 12px;
-
+
svg {
width: 20px;
height: 20px;
}
}
-
+
h3 {
font-size: 20px;
}
-
+
.header-subtitle {
font-size: 13px;
max-width: 240px;
}
}
-
+
.modal-content {
gap: 24px;
}
-
+
.swatches {
grid-template-columns: repeat(2, 1fr);
gap: 20px;
padding: 0 4px;
}
-
+
.swatch {
width: 64px;
height: 64px;
}
-
+
.custom {
padding: 20px;
}
-
+
.color-wheel-section {
flex-direction: column;
gap: 16px;
}
-
+
.color-wheel {
width: 250px !important;
height: 125px !important;
}
-
+
.validate-wheel-btn {
padding: 12px 18px;
font-size: 13px;
-
+
.btn-text {
font-size: 13px;
}
}
-
+
.input-group {
flex-direction: column;
gap: 12px;
align-items: stretch;
}
-
+
.color-preview {
align-self: center;
}
-
+
.apply {
padding: 14px 24px;
font-size: 15px;
}
-
+
.modal-footer {
padding: 24px 0;
-
+
.cancel-btn {
padding: 12px 24px;
font-size: 14px;
@@ -971,40 +982,40 @@ onMounted(async () => {
grid-template-columns: repeat(2, 1fr);
gap: 16px;
}
-
+
.swatch {
width: 56px;
height: 56px;
}
-
+
.custom {
padding: 16px;
}
-
+
.color-wheel {
width: 200px !important;
height: 100px !important;
}
-
+
.validate-wheel-btn {
padding: 10px 16px;
font-size: 12px;
-
+
.btn-text {
font-size: 12px;
}
-
+
.btn-icon {
width: 14px;
height: 14px;
}
}
-
+
.hex {
font-size: 14px;
padding: 12px 14px;
}
-
+
.apply {
padding: 12px 20px;
font-size: 14px;
diff --git a/frontend/app/components/MarkdownEditor/GridOrganizationModal.vue b/frontend/app/components/MarkdownEditor/GridOrganizationModal.vue
index adb21c34..2e8ac006 100644
--- a/frontend/app/components/MarkdownEditor/GridOrganizationModal.vue
+++ b/frontend/app/components/MarkdownEditor/GridOrganizationModal.vue
@@ -3,23 +3,19 @@
<div class="modal-header">
<h3>Grid Organization</h3>
</div>
-
+
<div class="modal-content">
<div class="table-selector">
<h4>Select Table Size</h4>
<div class="table-grid">
- <div
- v-for="row in 12"
- :key="`row-${row}`"
- class="table-row"
- >
- <div
- v-for="col in 12"
+ <div v-for="row in 12" :key="`row-${row}`" class="table-row">
+ <div
+ v-for="col in 12"
:key="`col-${col}`"
class="table-cell"
- :class="{
- 'hovered': isHovered(row, col),
- 'selected': isSelected(row, col)
+ :class="{
+ hovered: isHovered(row, col),
+ selected: isSelected(row, col),
}"
@mouseenter="handleHover(row, col)"
@mouseleave="handleHoverLeave()"
@@ -32,30 +28,20 @@
<span v-else>Hover to see table size</span>
</div>
</div>
-
+
<div class="quick-presets">
<h4>Quick Presets</h4>
<div class="presets-grid">
- <div
- v-for="preset in gridPresets"
- :key="preset.name"
- class="preset-item"
- @click="selectPreset(preset)"
- >
+ <div v-for="preset in gridPresets" :key="preset.name" class="preset-item" @click="selectPreset(preset)">
<div class="preset-visual" :style="getPresetStyle(preset)">
- <div
- v-for="cell in preset.cells"
- :key="cell.id"
- class="preset-cell"
- :style="getCellStyle(cell)"
- ></div>
+ <div v-for="cell in preset.cells" :key="cell.id" class="preset-cell" :style="getCellStyle(cell)"></div>
</div>
<span class="preset-name">{{ preset.name }}</span>
</div>
</div>
</div>
</div>
-
+
<div class="modal-footer">
<button class="cancel-btn" @click="closeModal">Cancel</button>
</div>
@@ -63,8 +49,6 @@
</template>
<script setup lang="ts">
-import { ref, computed } from 'vue';
-
const props = defineProps<{
onGridSelect: (gridMarkdown: string) => void;
}>();
@@ -100,8 +84,8 @@ const gridPresets: GridPreset[] = [
{ id: '1', col: 1, row: 1 },
{ id: '2', col: 2, row: 1 },
{ id: '3', col: 1, row: 2 },
- { id: '4', col: 2, row: 2 }
- ]
+ { id: '4', col: 2, row: 2 },
+ ],
},
{
name: '3x2 Grid',
@@ -113,8 +97,8 @@ const gridPresets: GridPreset[] = [
{ id: '3', col: 3, row: 1 },
{ id: '4', col: 1, row: 2 },
{ id: '5', col: 2, row: 2 },
- { id: '6', col: 3, row: 2 }
- ]
+ { id: '6', col: 3, row: 2 },
+ ],
},
{
name: '2x3 Grid',
@@ -126,8 +110,8 @@ const gridPresets: GridPreset[] = [
{ id: '3', col: 1, row: 2 },
{ id: '4', col: 2, row: 2 },
{ id: '5', col: 1, row: 3 },
- { id: '6', col: 2, row: 3 }
- ]
+ { id: '6', col: 2, row: 3 },
+ ],
},
{
name: '3x3 Grid',
@@ -142,8 +126,8 @@ const gridPresets: GridPreset[] = [
{ id: '6', col: 3, row: 2 },
{ id: '7', col: 1, row: 3 },
{ id: '8', col: 2, row: 3 },
- { id: '9', col: 3, row: 3 }
- ]
+ { id: '9', col: 3, row: 3 },
+ ],
},
{
@@ -156,9 +140,9 @@ const gridPresets: GridPreset[] = [
{ id: '3', col: 1, row: 2 },
{ id: '4', col: 2, row: 2 },
{ id: '5', col: 1, row: 3 },
- { id: '6', col: 2, row: 3 }
- ]
- }
+ { id: '6', col: 2, row: 3 },
+ ],
+ },
];
const getPresetStyle = (preset: GridPreset) => {
@@ -168,7 +152,7 @@ const getPresetStyle = (preset: GridPreset) => {
gridTemplateRows: `repeat(${preset.rows}, 1fr)`,
gap: '2px',
width: '100%',
- height: '60px'
+ height: '60px',
};
};
@@ -177,7 +161,7 @@ const getCellStyle = (cell: GridCell) => {
gridColumn: cell.colspan ? `span ${cell.colspan}` : `span 1`,
gridRow: cell.rowspan ? `span ${cell.rowspan}` : `span 1`,
backgroundColor: 'var(--primary)',
- borderRadius: '2px'
+ borderRadius: '2px',
};
};
@@ -212,23 +196,21 @@ const selectPreset = (preset: GridPreset) => {
emit('close');
};
-
-
const generateGridMarkdown = (columns: number, rows: number): string => {
let markdown = '\n';
-
+
markdown += '|';
for (let i = 0; i < columns; i++) {
markdown += ' Column ' + (i + 1) + ' |';
}
markdown += '\n';
-
+
markdown += '|';
for (let i = 0; i < columns; i++) {
markdown += ' --- |';
}
markdown += '\n';
-
+
for (let row = 0; row < rows; row++) {
markdown += '|';
for (let col = 0; col < columns; col++) {
@@ -236,7 +218,7 @@ const generateGridMarkdown = (columns: number, rows: number): string => {
}
markdown += '\n';
}
-
+
markdown += '\n';
return markdown;
};
@@ -264,7 +246,7 @@ const closeModal = () => {
padding: 24px 0 20px 0;
flex-shrink: 0;
position: relative;
-
+
h3 {
margin: 0;
font-size: 20px;
@@ -272,7 +254,7 @@ const closeModal = () => {
color: var(--font-color-dark);
letter-spacing: -0.5px;
}
-
+
&::after {
content: '';
position: absolute;
@@ -295,9 +277,10 @@ const closeModal = () => {
gap: 32px;
}
-.table-selector, .quick-presets {
+.table-selector,
+.quick-presets {
margin-top: 8px;
-
+
h4 {
margin: 0 0 20px 0;
font-size: 18px;
@@ -306,7 +289,7 @@ const closeModal = () => {
display: flex;
align-items: center;
gap: 8px;
-
+
&::before {
content: '';
width: 4px;
@@ -343,20 +326,20 @@ const closeModal = () => {
cursor: pointer;
transition: all 0.2s ease;
position: relative;
-
+
&:hover {
background: var(--primary);
border-color: var(--primary);
transform: scale(1.1);
z-index: 2;
}
-
+
&.hovered {
background: var(--primary);
border-color: var(--primary);
opacity: 0.8;
}
-
+
&.selected {
background: var(--primary);
border-color: var(--primary);
@@ -398,7 +381,7 @@ const closeModal = () => {
background: var(--bg-color-secondary);
position: relative;
overflow: hidden;
-
+
&::before {
content: '';
position: absolute;
@@ -410,23 +393,23 @@ const closeModal = () => {
transform: scaleX(0);
transition: transform 0.3s ease;
}
-
+
&:hover {
border-color: var(--primary);
background: var(--bg-color);
transform: translateY(-4px);
box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
-
+
&::before {
transform: scaleX(1);
}
-
+
.preset-visual {
border-color: var(--primary);
box-shadow: 0 4px 16px rgba(var(--primary-rgb), 0.2);
}
}
-
+
.preset-visual {
margin-bottom: 8px;
border: 2px solid var(--border-color);
@@ -435,7 +418,7 @@ const closeModal = () => {
transition: all 0.3s ease;
position: relative;
height: 50px;
-
+
&::after {
content: '';
position: absolute;
@@ -445,14 +428,14 @@ const closeModal = () => {
pointer-events: none;
}
}
-
+
.preset-name {
font-size: 13px;
color: var(--font-color-dark);
font-weight: 600;
transition: color 0.3s ease;
}
-
+
&:hover .preset-name {
color: var(--primary);
}
@@ -464,7 +447,7 @@ const closeModal = () => {
justify-content: flex-end;
gap: 16px;
flex-shrink: 0;
-
+
.cancel-btn {
padding: 12px 24px;
border: 2px solid var(--border-color);
@@ -475,14 +458,14 @@ const closeModal = () => {
font-size: 14px;
font-weight: 500;
transition: all 0.3s ease;
-
+
&:hover {
background: var(--border-color);
border-color: var(--primary);
color: var(--primary);
transform: translateY(-1px);
}
-
+
&:active {
transform: translateY(0);
}
@@ -494,18 +477,18 @@ const closeModal = () => {
grid-template-columns: repeat(8, 1fr);
gap: 1px;
max-width: 300px;
-
+
.table-cell {
width: 14px;
height: 14px;
}
}
-
+
.presets-grid {
grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
gap: 12px;
}
-
+
.table-info {
max-width: 300px;
font-size: 13px;
diff --git a/frontend/app/components/MarkdownEditor/ImageSelectorModal.vue b/frontend/app/components/MarkdownEditor/ImageSelectorModal.vue
index 7a12fe84..f721ceec 100644
--- a/frontend/app/components/MarkdownEditor/ImageSelectorModal.vue
+++ b/frontend/app/components/MarkdownEditor/ImageSelectorModal.vue
@@ -31,9 +31,7 @@
</template>
<script setup lang="ts">
-import { ref, computed, onMounted } from 'vue';
-import { useRessourcesStore } from '~/stores/ressources.store';
-import type { Ressource } from '~/stores/db_strustures';
+import { useRessourcesStore, type Ressource } from '~/stores';
const props = defineProps<{
onImageSelect: (imageUrl: string, altText: string) => void;
diff --git a/frontend/app/components/MarkdownEditor/LazyMarkdownEditor.vue b/frontend/app/components/MarkdownEditor/LazyMarkdownEditor.vue
index 60073f91..a0876e7d 100644
--- a/frontend/app/components/MarkdownEditor/LazyMarkdownEditor.vue
+++ b/frontend/app/components/MarkdownEditor/LazyMarkdownEditor.vue
@@ -1,3 +1,4 @@
+<!-- eslint-disable vue/no-v-html -->
<template>
<div style="height: 100%; padding: 4px">
<div class="editor-container">
@@ -118,10 +119,6 @@ function exec(action: string, payload?: string) {
function openColorModal() {
const modalManager = useModal();
- // Fermer tous les modals existants avant d'en ouvrir un nouveau
- while (modalManager.modals.value.length > 0) {
- modalManager.close(modalManager.modals.value[0]);
- }
modalManager.add(new Modal(shallowRef(ColorPickerModal), { onColorSelect: handleColorSelect }, () => {}, true));
}
@@ -136,10 +133,6 @@ function openImageSelector() {
function openGridOrganization() {
const modalManager = useModal();
- // Fermer tous les modals existants avant d'en ouvrir un nouveau
- while (modalManager.modals.value.length > 0) {
- modalManager.close(modalManager.modals.value[0]);
- }
modalManager.add(new Modal(shallowRef(GridOrganizationModal), { onGridSelect: handleGridSelect }, () => {}, true));
}
@@ -164,16 +157,16 @@ function handleImageSelect(imageUrl: string, altText: string) {
function handleGridSelect(gridMarkdown: string) {
if (!editorView.value) return;
-
+
const view = editorView.value;
const state = view.state;
const { from, to } = state.selection.main;
-
+
view.dispatch({
changes: { from, to, insert: gridMarkdown },
selection: { anchor: from + gridMarkdown.length, head: from + gridMarkdown.length },
});
-
+
view.focus();
}
const snippets: Record<string, string> = {
@@ -396,7 +389,6 @@ input {
font-weight: 500;
}
-
.image-selector-overlay {
position: fixed;
z-index: 99999;