Add application codebase: PDF annotation for e-Court
Next.js 14 + Drizzle/PostgreSQL + SSE realtime sync — highlight,
freehand, comment, bookmark + ฟีเจอร์ต่อยอด F1–F19 (edit/move, undo/redo,
shapes, redaction, export PDF/CSV, reply, resolve, search, summary,
textbox, stamp, version history)
Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-09-10 14:29:40 +07:00
|
|
|
|
@tailwind base;
|
|
|
|
|
|
@tailwind components;
|
|
|
|
|
|
@tailwind utilities;
|
|
|
|
|
|
|
|
|
|
|
|
/* ─── TextLayer ของ pdfjs v4 ─────────────────────────────────────────────────
|
|
|
|
|
|
คัดมาจาก node_modules/pdfjs-dist/web/pdf_viewer.css (ส่วนที่จำเป็น)
|
|
|
|
|
|
ใช้กับ pdfjs.TextLayer ที่ render ลง div.textLayer ใน PDFViewer */
|
|
|
|
|
|
.textLayer {
|
|
|
|
|
|
position: absolute;
|
|
|
|
|
|
text-align: initial;
|
|
|
|
|
|
inset: 0;
|
|
|
|
|
|
overflow: clip;
|
|
|
|
|
|
opacity: 1;
|
|
|
|
|
|
line-height: 1;
|
|
|
|
|
|
text-size-adjust: none;
|
|
|
|
|
|
forced-color-adjust: none;
|
|
|
|
|
|
transform-origin: 0 0;
|
|
|
|
|
|
caret-color: CanvasText;
|
|
|
|
|
|
/* ห้ามใส่ z-index ที่นี่ — บล็อกนี้อยู่หลัง @tailwind utilities ใน cascade
|
|
|
|
|
|
จะ override z-[2] ของ Tailwind จน textLayer ไปอยู่ใต้ canvas (invariant #3) */
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.textLayer :is(span, br) {
|
|
|
|
|
|
color: transparent;
|
|
|
|
|
|
position: absolute;
|
|
|
|
|
|
white-space: pre;
|
|
|
|
|
|
cursor: text;
|
|
|
|
|
|
transform-origin: 0% 0%;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.textLayer > :not(.markedContent),
|
|
|
|
|
|
.textLayer .markedContent span:not(.markedContent) {
|
|
|
|
|
|
z-index: 1;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.textLayer span.markedContent {
|
|
|
|
|
|
top: 0;
|
|
|
|
|
|
height: 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.textLayer span[role="img"] {
|
|
|
|
|
|
user-select: none;
|
|
|
|
|
|
cursor: default;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.textLayer ::selection {
|
|
|
|
|
|
background: rgba(0 0 255 / 0.25);
|
|
|
|
|
|
background: color-mix(in srgb, AccentColor, transparent 75%);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.textLayer br::selection {
|
|
|
|
|
|
background: transparent;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.textLayer .endOfContent {
|
|
|
|
|
|
display: block;
|
|
|
|
|
|
position: absolute;
|
|
|
|
|
|
inset: 100% 0 0;
|
|
|
|
|
|
z-index: 0;
|
|
|
|
|
|
cursor: default;
|
|
|
|
|
|
user-select: none;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.textLayer.selecting .endOfContent {
|
|
|
|
|
|
top: 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* canvas วัด font metrics ที่ pdfjs.TextLayer สร้างแล้ว append ท้าย document.body
|
|
|
|
|
|
— คัดมาจาก pdf_viewer.css ของ pdfjs-dist เช่นกัน (ตอนแรกคัดมาแค่ส่วน .textLayer
|
|
|
|
|
|
กฎนี้จึงตกหล่น ทำให้ canvas ว่าง alpha:false แสดงเป็นก้อนดำ 300×150 ที่ล่างซ้าย
|
|
|
|
|
|
ของ document และเพิ่ม scrollHeight เกินจริง 150px) */
|
|
|
|
|
|
.hiddenCanvasElement {
|
|
|
|
|
|
position: absolute;
|
|
|
|
|
|
top: 0;
|
|
|
|
|
|
left: 0;
|
|
|
|
|
|
width: 0;
|
|
|
|
|
|
height: 0;
|
|
|
|
|
|
background-size: 100% 100%;
|
|
|
|
|
|
background-color: transparent;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* ─── UX review 2026-09-09 ข้อ 4: ปุ่ม header เล็กกว่ามาตรฐาน touch 44×44 ─────
|
|
|
|
|
|
ขยายเฉพาะอุปกรณ์จอสัมผัส — ครอบปุ่ม toggle/page nav/zoom/tool group
|
|
|
|
|
|
(รวมปุ่ม dropdown ของ tool)/undo-redo/bookmark/export + ปุ่ม summary (Link)
|
|
|
|
|
|
แต่ไม่โดนปุ่มใน dropdown panel (สี/ความหนา) ที่ซ้อนลึกกว่าอีกชั้น */
|
|
|
|
|
|
@media (pointer: coarse) {
|
|
|
|
|
|
header .touch-44 > button,
|
|
|
|
|
|
header .touch-44 > div > button,
|
|
|
|
|
|
header .touch-44 > div > div > button,
|
|
|
|
|
|
header .touch-44 > div > a {
|
|
|
|
|
|
min-height: 2.75rem;
|
|
|
|
|
|
min-width: 2.75rem;
|
2026-09-14 09:57:43 +07:00
|
|
|
|
/* min 44px ทำให้ปุ่ม icon เดี่ยวกว้างเกิน content — ต้อง center icon
|
|
|
|
|
|
ไม่งั้นชิดซ้าย+ลอยตาม baseline (ปุ่ม dropdown มี flex อยู่แล้ว ไม่กระทบ) */
|
|
|
|
|
|
display: inline-flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
justify-content: center;
|
Add application codebase: PDF annotation for e-Court
Next.js 14 + Drizzle/PostgreSQL + SSE realtime sync — highlight,
freehand, comment, bookmark + ฟีเจอร์ต่อยอด F1–F19 (edit/move, undo/redo,
shapes, redaction, export PDF/CSV, reply, resolve, search, summary,
textbox, stamp, version history)
Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-09-10 14:29:40 +07:00
|
|
|
|
}
|
|
|
|
|
|
}
|