@unana_dev/doxen 0.3.1 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -585,6 +585,8 @@ npx wrangler d1 execute 데이터베이스이름 --remote --file=node_modules/@u
585
585
 
586
586
  저장소의 Actions variables에 배포된 문서 사이트 주소를 `DOXEN_SITE_URL`로 등록하세요. 설정 파일이 저장소 루트의 기본 이름이 아니라면 `DOXEN_CONFIG`에 저장소 기준 경로도 등록합니다. 보고서의 각 댓글에는 보고서 실행 시점 커밋의 GitHub 원본 파일 링크와 배포 사이트의 해당 댓글 링크가 표시됩니다. 현재 설정에서 문서를 찾지 못하면 링크 대신 안내 문구가 표시됩니다.
587
587
 
588
- 매일 한국 시간 오전 8시에 전날 00:00~24:00의 댓글을 하나의 이슈로 작성합니다. 댓글은 문서별로 묶이며, 같은 문서 안에서는 작성 순서대로 표시됩니다. 댓글이 없으면 이슈를 만들지 않으며, 같은 날짜의 보고서 이슈가 이미 있으면 중복 생성하지 않습니다. Actions 화면의 수동 실행에서 날짜를 입력해 누락된 날을 다시 집계할 수 있습니다. 이슈 본문 양식은 패키지의 `src/comment-report.js`에서 확인할 수 있으며 필요에 맞게 복사해 수정하세요. 댓글 내용과 작성자 이메일이 이슈 저장소의 열람자에게 공개되므로 접근 권한을 확인하세요. GitHub 예약 실행은 지연되거나 누락될 수 있습니다.
588
+ 매일 한국 시간 00시에 전날 00:00~24:00의 댓글을 하나의 이슈로 작성합니다. 실행 시각은 복사한 `.github/workflows/comment-report.yml`의 `schedule`에서 설정합니다. 예를 들어 한국 시간 오전 8시에 실행하려면 `cron: '0 8 * * *'`로 바꾸세요. `timezone: 'Asia/Seoul'`을 유지하면 한국 시간으로 적용됩니다. 설정한 시각에 하루 한 번 실행되며, 기존 워크플로를 사용 중이라면 변경된 템플릿의 `schedule`을 반영해야 합니다.
589
+
590
+ 댓글은 문서별로 묶이며, 같은 문서 안에서는 작성 순서대로 표시됩니다. 댓글이 없으면 이슈를 만들지 않으며, 같은 날짜의 보고서 이슈가 이미 있으면 중복 생성하지 않습니다. Actions 화면의 수동 실행에서 날짜를 입력해 누락된 날을 다시 집계할 수 있습니다. 이슈 본문 양식은 패키지의 `src/comment-report.js`에서 확인할 수 있으며 필요에 맞게 복사해 수정하세요. 댓글 내용과 작성자 이메일이 이슈 저장소의 열람자에게 공개되므로 접근 권한을 확인하세요. GitHub 예약 실행은 지연되거나 누락될 수 있습니다.
589
591
 
590
592
  문서별 최종 수정자와 수정일을 표시하려면 빌드 환경에 전체 Git 이력이 필요합니다. GitHub Actions에서는 `actions/checkout`에 `fetch-depth: 0`을 설정하세요. 얕은 복제의 경계 커밋은 파일의 실제 마지막 수정인지 확인할 수 없어 해당 정보가 표시되지 않습니다.
@@ -23,6 +23,7 @@ export async function attachComments(article, documentId, commentId) {
23
23
  const occurrences = new Map();
24
24
  const matched = new Set();
25
25
  const anchors = new Map();
26
+ const anchorBlocks = new Map();
26
27
  const popover = document.createElement('button');
27
28
  popover.type = 'button';
28
29
  popover.className = 'comment-selection-trigger';
@@ -106,6 +107,7 @@ export async function attachComments(article, documentId, commentId) {
106
107
  matched.add(key);
107
108
  const wrapper = document.createElement('div');
108
109
  wrapper.className = 'comment-anchor';
110
+ anchorBlocks.set(wrapper, block);
109
111
  if (['LI', 'TD', 'TH'].includes(block.tagName)) {
110
112
  if (ownNodes) {
111
113
  block.insertBefore(wrapper, ownNodes[0]);
@@ -298,6 +300,13 @@ export async function attachComments(article, documentId, commentId) {
298
300
  for (const other of article.querySelectorAll('.comment-anchor > .comment-panel')) other.hidden = true;
299
301
  for (const other of article.querySelectorAll('.comment-trigger.is-open')) other.classList.remove('is-open');
300
302
  draftQuote = quote;
303
+ if (!range) {
304
+ range = document.createRange();
305
+ if (['LI', 'TD', 'TH'].includes(block.tagName)) {
306
+ range.setStart(wrapper, 0);
307
+ range.setEndBefore(button);
308
+ } else range.selectNodeContents(block);
309
+ }
301
310
  showDraftHighlight(block, range);
302
311
  panel.hidden = false;
303
312
  button.classList.add('is-open');
@@ -323,6 +332,15 @@ export async function attachComments(article, documentId, commentId) {
323
332
  const alignButtons = () => {
324
333
  const right = article.getBoundingClientRect().right;
325
334
  for (const wrapper of anchors.keys()) {
335
+ const range = document.createRange();
336
+ const block = anchorBlocks.get(wrapper);
337
+ if (['LI', 'TD', 'TH'].includes(block.tagName)) {
338
+ range.setStart(wrapper, 0);
339
+ range.setEndBefore(wrapper.querySelector('.comment-trigger'));
340
+ } else range.selectNodeContents(block);
341
+ const content = range.getBoundingClientRect();
342
+ const bounds = wrapper.getBoundingClientRect();
343
+ wrapper.style.setProperty('--comment-center', `${(content.top + content.bottom) / 2 - bounds.top}px`);
326
344
  wrapper.style.setProperty('--comment-offset', `${Math.max(0, right - wrapper.getBoundingClientRect().right)}px`);
327
345
  wrapper.style.setProperty('--comment-panel-right', `${wrapper.getBoundingClientRect().right - window.innerWidth + 16}px`);
328
346
  }
package/client/style.css CHANGED
@@ -1152,8 +1152,8 @@ dialog::backdrop {
1152
1152
  }
1153
1153
 
1154
1154
  .comment-anchor { position: relative; }
1155
- .comment-trigger { position: absolute; left: calc(100% + 20px); top: calc((1lh - 28px) / 2); z-index: 2; display: flex; align-items: center; gap: 6px; height: 28px; padding: 0 8px 0 3px; border: 0; border-radius: 14px; background: transparent; color: #374151; font-size: 13px; font-weight: 600; cursor: pointer; opacity: 0; white-space: nowrap; }
1156
- .comment-trigger:not(:has(.comment-avatar)) { width: 32px; height: 32px; top: calc((1lh - 32px) / 2); padding: 0; justify-content: center; color: #9ca3af; }
1155
+ .comment-trigger { position: absolute; left: calc(100% + 20px); top: var(--comment-center, 0px); transform: translateY(-50%); z-index: 2; display: flex; align-items: center; gap: 6px; height: 28px; padding: 0 8px 0 3px; border: 0; border-radius: 14px; background: transparent; color: #374151; font-size: 13px; font-weight: 600; cursor: pointer; opacity: 0; white-space: nowrap; }
1156
+ .comment-trigger:not(:has(.comment-avatar)) { width: 32px; height: 32px; padding: 0; justify-content: center; color: #9ca3af; }
1157
1157
  .comment-anchor:hover > .comment-trigger, .comment-trigger:focus-visible, .comment-trigger:has(.comment-avatar) { opacity: 1; }
1158
1158
  .comment-trigger:hover:has(.comment-avatar), .comment-trigger:focus-visible:has(.comment-avatar) { background: #f3f4f6; }
1159
1159
  .comment-trigger.is-open:has(.comment-avatar) { background: #fef3c7; }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unana_dev/doxen",
3
- "version": "0.3.1",
3
+ "version": "0.3.2",
4
4
  "description": "Config-first Markdown documentation sites with Korean and section search",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,7 +1,8 @@
1
1
  name: Daily Doxen comments
2
2
  on:
3
3
  schedule:
4
- - cron: '0 23 * * *' # 매일 오전 8시 (Asia/Seoul)
4
+ - cron: '0 0 * * *' # 매일 한국 시간 00:00
5
+ timezone: 'Asia/Seoul'
5
6
  workflow_dispatch:
6
7
  inputs:
7
8
  report_date: