youssefreda9 commited on
Commit
55ce477
·
1 Parent(s): d21afbd

fix: Lists, indent, and keep button - Change white-space from pre-wrap to normal (fixes lists + indent) - Redesign keep button: centered, cleaner, separated from corrections - Keep button always renders last with clear 'إبقاء كما هي' label - Blockquote/list styling for RTL editor

Browse files
Files changed (2) hide show
  1. src/css/components.css +10 -3
  2. src/js/editor.js +6 -3
src/css/components.css CHANGED
@@ -495,8 +495,9 @@
495
  letter-spacing: var(--letter-spacing-arabic);
496
  direction: rtl;
497
  text-align: right;
498
- white-space: pre-wrap;
499
  word-wrap: break-word;
 
500
  overflow-y: auto;
501
  border-radius: 0;
502
  margin: 0;
@@ -767,14 +768,20 @@
767
 
768
  .popover-alt-keep {
769
  background: transparent;
770
- border-style: dashed;
771
  color: var(--color-text-muted);
772
- font-size: var(--font-size-sm);
 
 
 
 
 
773
  }
774
 
775
  .popover-alt-keep:hover {
776
  color: var(--color-text-primary);
777
  border-color: var(--color-text-secondary);
 
778
  }
779
 
780
  .popover-hint {
 
495
  letter-spacing: var(--letter-spacing-arabic);
496
  direction: rtl;
497
  text-align: right;
498
+ white-space: normal;
499
  word-wrap: break-word;
500
+ word-break: break-word;
501
  overflow-y: auto;
502
  border-radius: 0;
503
  margin: 0;
 
768
 
769
  .popover-alt-keep {
770
  background: transparent;
771
+ border: 1px dashed var(--color-border);
772
  color: var(--color-text-muted);
773
+ font-size: var(--font-size-caption);
774
+ font-weight: var(--font-weight-medium);
775
+ text-align: center;
776
+ min-height: 36px;
777
+ padding: 6px 12px;
778
+ margin-top: 2px;
779
  }
780
 
781
  .popover-alt-keep:hover {
782
  color: var(--color-text-primary);
783
  border-color: var(--color-text-secondary);
784
+ background: var(--color-surface-elevated);
785
  }
786
 
787
  .popover-hint {
src/js/editor.js CHANGED
@@ -247,13 +247,16 @@ function showTooltip(element) {
247
  if (alternativesEl) {
248
  const alts = suggestion.alternatives || [suggestion.correction, suggestion.original];
249
  let html = '';
 
250
  alts.forEach((alt, i) => {
251
  const isKeep = alt === suggestion.original;
 
252
  const isMain = i === 0;
253
- const btnClass = isKeep ? 'popover-alt-btn popover-alt-keep' : (isMain ? 'popover-alt-btn popover-alt-main' : 'popover-alt-btn');
254
- const label = isKeep ? `${escapeHtml(alt)} ✓ إبقاء` : escapeHtml(alt);
255
- html += `<button class="${btnClass}" data-alt-correction="${escapeHtml(alt)}" type="button">${label}</button>`;
256
  });
 
 
257
  alternativesEl.innerHTML = html;
258
 
259
  // Bind click events
 
247
  if (alternativesEl) {
248
  const alts = suggestion.alternatives || [suggestion.correction, suggestion.original];
249
  let html = '';
250
+ // Render corrections first (non-keep)
251
  alts.forEach((alt, i) => {
252
  const isKeep = alt === suggestion.original;
253
+ if (isKeep) return; // render keep button last
254
  const isMain = i === 0;
255
+ const btnClass = isMain ? 'popover-alt-btn popover-alt-main' : 'popover-alt-btn';
256
+ html += `<button class="${btnClass}" data-alt-correction="${escapeHtml(alt)}" type="button">${escapeHtml(alt)}</button>`;
 
257
  });
258
+ // Render keep button at end
259
+ html += `<button class="popover-alt-btn popover-alt-keep" data-alt-correction="${escapeHtml(suggestion.original)}" type="button">إبقاء كما هي</button>`;
260
  alternativesEl.innerHTML = html;
261
 
262
  // Bind click events