Upload folder using huggingface_hub
Browse files
client/src/components/Refinity.tsx
CHANGED
|
@@ -420,8 +420,8 @@ const Refinity: React.FC = () => {
|
|
| 420 |
return (
|
| 421 |
<SwiperSlide key={v.id} style={{ width: 'clamp(320px, 48vw, 720px)', height: isFullscreen ? '72vh' : '62.4vh' }}>
|
| 422 |
<div className={`relative h-full rounded-2xl p-6 bg-white ring-1 ring-gray-200 shadow-xl text-base overflow-hidden flex flex-col ${isCenter ? 'z-10' : 'opacity-95 z-0'}`}>
|
| 423 |
-
<div className={`ref-card-overlay
|
| 424 |
-
<div className={`ref-card-overlay
|
| 425 |
<div className="text-gray-800 text-sm mb-2">Original: {v.originalAuthor}</div>
|
| 426 |
<div className="text-gray-600 text-xs mb-3">Revised by: {v.revisedBy ? `${v.revisedBy} (v${v.versionNumber})` : `— (v${v.versionNumber})`}</div>
|
| 427 |
<div className={`text-gray-900 whitespace-pre-wrap break-words leading-relaxed flex-1 overflow-hidden pr-1`}>{snippet}</div>
|
|
@@ -519,11 +519,10 @@ const Refinity: React.FC = () => {
|
|
| 519 |
.mySwiper .swiper-button-prev, .mySwiper .swiper-button-next { top: 50% !important; transform: translateY(-50%); }
|
| 520 |
.mySwiper .swiper-button-prev:after, .mySwiper .swiper-button-next:after { font-size: 18px; color: #94a3b8; }
|
| 521 |
.mySwiper .swiper-slide-active { z-index: 50 !important; }
|
| 522 |
-
/*
|
| 523 |
-
.mySwiper .
|
| 524 |
-
/*
|
| 525 |
-
.mySwiper .swiper-
|
| 526 |
-
.mySwiper .swiper-slide-active .ref-action-bar, .mySwiper .swiper-slide-active .ref-action-bar * { pointer-events: auto; }
|
| 527 |
` }} />
|
| 528 |
</div>
|
| 529 |
{compareModalOpen && (
|
|
|
|
| 420 |
return (
|
| 421 |
<SwiperSlide key={v.id} style={{ width: 'clamp(320px, 48vw, 720px)', height: isFullscreen ? '72vh' : '62.4vh' }}>
|
| 422 |
<div className={`relative h-full rounded-2xl p-6 bg-white ring-1 ring-gray-200 shadow-xl text-base overflow-hidden flex flex-col ${isCenter ? 'z-10' : 'opacity-95 z-0'}`}>
|
| 423 |
+
<div className={`ref-card-overlay absolute inset-0 rounded-2xl opacity-40 [background:linear-gradient(to_bottom,rgba(255,255,255,0.45),rgba(255,255,255,0)_28%),linear-gradient(to_right,rgba(255,255,255,0.35),rgba(255,255,255,0)_28%)]`} />
|
| 424 |
+
<div className={`ref-card-overlay absolute inset-0 rounded-2xl bg-gradient-to-tr from-white/30 via-white/10 to-transparent opacity-30`} />
|
| 425 |
<div className="text-gray-800 text-sm mb-2">Original: {v.originalAuthor}</div>
|
| 426 |
<div className="text-gray-600 text-xs mb-3">Revised by: {v.revisedBy ? `${v.revisedBy} (v${v.versionNumber})` : `— (v${v.versionNumber})`}</div>
|
| 427 |
<div className={`text-gray-900 whitespace-pre-wrap break-words leading-relaxed flex-1 overflow-hidden pr-1`}>{snippet}</div>
|
|
|
|
| 519 |
.mySwiper .swiper-button-prev, .mySwiper .swiper-button-next { top: 50% !important; transform: translateY(-50%); }
|
| 520 |
.mySwiper .swiper-button-prev:after, .mySwiper .swiper-button-next:after { font-size: 18px; color: #94a3b8; }
|
| 521 |
.mySwiper .swiper-slide-active { z-index: 50 !important; }
|
| 522 |
+
/* Decorative overlays should never capture clicks */
|
| 523 |
+
.mySwiper .ref-card-overlay { pointer-events: none; }
|
| 524 |
+
/* Let arrows/pagination operate normally, but not over the action bar */
|
| 525 |
+
.mySwiper .swiper-slide-active .ref-action-bar, .mySwiper .swiper-slide-active .ref-action-bar * { pointer-events: auto; position: relative; z-index: 30; }
|
|
|
|
| 526 |
` }} />
|
| 527 |
</div>
|
| 528 |
{compareModalOpen && (
|
client/src/pages/Toolkit.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
import React, { useEffect, useMemo, useRef, useState } from 'react';
|
| 2 |
-
|
| 3 |
import Refinity from '../components/Refinity';
|
| 4 |
import { api } from '../services/api';
|
| 5 |
import {
|
|
@@ -10,7 +10,7 @@ import {
|
|
| 10 |
ArrowsRightLeftIcon
|
| 11 |
} from '@heroicons/react/24/outline';
|
| 12 |
|
| 13 |
-
type ToolKey = 'quality-lens' | 'mymemory' | 'dictionary' | '
|
| 14 |
|
| 15 |
interface MyMemoryResponse {
|
| 16 |
responseData?: {
|
|
@@ -70,7 +70,9 @@ const Toolkit: React.FC = () => {
|
|
| 70 |
const [isAdmin, setIsAdmin] = useState(false);
|
| 71 |
const [editItem, setEditItem] = useState<{ _id?: string; title?: string; url?: string; desc?: string; order?: number } | null>(null);
|
| 72 |
const [selectedTool, setSelectedTool] = useState<ToolKey>(() => {
|
| 73 |
-
|
|
|
|
|
|
|
| 74 |
});
|
| 75 |
const [isToolTransitioning, setIsToolTransitioning] = useState(false);
|
| 76 |
const [iframeLoading, setIframeLoading] = useState(true);
|
|
@@ -126,7 +128,6 @@ const Toolkit: React.FC = () => {
|
|
| 126 |
{ key: 'quality-lens' as ToolKey, name: 'Quality Lens', desc: 'BLASER/COMET QE + Hallucination', type: 'iframe' },
|
| 127 |
{ key: 'mymemory' as ToolKey, name: 'MyMemory', desc: 'Public MT memory lookup', type: 'native' },
|
| 128 |
{ key: 'dictionary' as ToolKey, name: 'Dictionary (EN⇄ZH)', desc: 'Iciba suggest', type: 'native' },
|
| 129 |
-
{ key: 'syntax-reorderer' as ToolKey, name: 'Syntax Reorderer', desc: 'EN↔ZH structural practice', type: 'native' },
|
| 130 |
{ key: 'refinity' as ToolKey, name: 'Refinity', desc: 'Version flow, compare, and revise', type: 'native' },
|
| 131 |
{ key: 'links' as ToolKey, name: 'Useful Links', desc: 'Curated external resources', type: 'native' }
|
| 132 |
];
|
|
@@ -616,22 +617,7 @@ const Toolkit: React.FC = () => {
|
|
| 616 |
</div>
|
| 617 |
)}
|
| 618 |
|
| 619 |
-
{
|
| 620 |
-
<div>
|
| 621 |
-
<div className="flex items-center space-x-3 mb-4">
|
| 622 |
-
<div className="bg-amber-600 rounded-lg p-2">
|
| 623 |
-
<DocumentTextIcon className="h-5 w-5 text-white" />
|
| 624 |
-
</div>
|
| 625 |
-
<div>
|
| 626 |
-
<h3 className="text-amber-900 font-semibold text-xl">Syntax Reorderer (EN↔ZH)</h3>
|
| 627 |
-
<p className="text-gray-600 text-sm">Label chunks, assign roles, and reorder to practice structural shifts.</p>
|
| 628 |
-
</div>
|
| 629 |
-
</div>
|
| 630 |
-
<div className="border rounded-lg overflow-hidden">
|
| 631 |
-
<SyntaxReorderer />
|
| 632 |
-
</div>
|
| 633 |
-
</div>
|
| 634 |
-
)}
|
| 635 |
|
| 636 |
{selectedTool === 'refinity' && (
|
| 637 |
<div>
|
|
|
|
| 1 |
import React, { useEffect, useMemo, useRef, useState } from 'react';
|
| 2 |
+
// Syntax Reorderer removed per request
|
| 3 |
import Refinity from '../components/Refinity';
|
| 4 |
import { api } from '../services/api';
|
| 5 |
import {
|
|
|
|
| 10 |
ArrowsRightLeftIcon
|
| 11 |
} from '@heroicons/react/24/outline';
|
| 12 |
|
| 13 |
+
type ToolKey = 'quality-lens' | 'mymemory' | 'dictionary' | 'mt' | 'links' | 'refinity';
|
| 14 |
|
| 15 |
interface MyMemoryResponse {
|
| 16 |
responseData?: {
|
|
|
|
| 70 |
const [isAdmin, setIsAdmin] = useState(false);
|
| 71 |
const [editItem, setEditItem] = useState<{ _id?: string; title?: string; url?: string; desc?: string; order?: number } | null>(null);
|
| 72 |
const [selectedTool, setSelectedTool] = useState<ToolKey>(() => {
|
| 73 |
+
const raw = (localStorage.getItem('selectedToolkitTool') as ToolKey) || 'refinity';
|
| 74 |
+
const allowed = new Set(['quality-lens','mymemory','dictionary','mt','links','refinity']);
|
| 75 |
+
return (allowed.has(raw as any) ? raw : 'refinity') as ToolKey;
|
| 76 |
});
|
| 77 |
const [isToolTransitioning, setIsToolTransitioning] = useState(false);
|
| 78 |
const [iframeLoading, setIframeLoading] = useState(true);
|
|
|
|
| 128 |
{ key: 'quality-lens' as ToolKey, name: 'Quality Lens', desc: 'BLASER/COMET QE + Hallucination', type: 'iframe' },
|
| 129 |
{ key: 'mymemory' as ToolKey, name: 'MyMemory', desc: 'Public MT memory lookup', type: 'native' },
|
| 130 |
{ key: 'dictionary' as ToolKey, name: 'Dictionary (EN⇄ZH)', desc: 'Iciba suggest', type: 'native' },
|
|
|
|
| 131 |
{ key: 'refinity' as ToolKey, name: 'Refinity', desc: 'Version flow, compare, and revise', type: 'native' },
|
| 132 |
{ key: 'links' as ToolKey, name: 'Useful Links', desc: 'Curated external resources', type: 'native' }
|
| 133 |
];
|
|
|
|
| 617 |
</div>
|
| 618 |
)}
|
| 619 |
|
| 620 |
+
{/* Syntax Reorderer removed */}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 621 |
|
| 622 |
{selectedTool === 'refinity' && (
|
| 623 |
<div>
|