@takagaki/cortex-decisions-viewer 0.4.1 → 0.4.3

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/dist/render.js CHANGED
@@ -1576,6 +1576,16 @@ const CLIENT_JS = `
1576
1576
  } else {
1577
1577
  wrap.scrollLeft = explorerState.sx || 0;
1578
1578
  }
1579
+ // 各列は overflow-y:auto で独立に縦スクロールする。選択行が長い一覧
1580
+ // (Decisions 等)の途中にあると見えないため、選択行が列の中央に来るよう縦スクロールする。
1581
+ for (var ci = 0; ci < cols.children.length; ci++) {
1582
+ var colEl = cols.children[ci];
1583
+ var selItem = colEl.querySelector(".mc-item.selected");
1584
+ if (!selItem) continue;
1585
+ var crect = colEl.getBoundingClientRect();
1586
+ var irect = selItem.getBoundingClientRect();
1587
+ colEl.scrollTop += (irect.top - crect.top) - (colEl.clientHeight - irect.height) / 2;
1588
+ }
1579
1589
  drawLines();
1580
1590
  });
1581
1591
  wrap.addEventListener("scroll", function () {
package/dist/repo.js CHANGED
@@ -46,8 +46,11 @@ function normalizeToHttps(url) {
46
46
  if (ssh) {
47
47
  return `https://${ssh[1]}/${ssh[2]}`;
48
48
  }
49
- // https://host/owner/repo (末尾の認証情報などは想定しない)
50
- const https = u.match(/^https?:\/\/(.+)$/);
49
+ // https://[userinfo@]host/owner/repo
50
+ // CI(Amplify等)は `https://x-access-token:<token>@github.com/...` の形で
51
+ // クローン用トークンを埋め込むため、先頭の userinfo(`資格情報@`)を必ず除去する。
52
+ // これを残すと編集リンクにトークンが焼き込まれ、(1)Web編集が壊れ (2)トークンが漏れる。
53
+ const https = u.match(/^https?:\/\/(?:[^@/]+@)?(.+)$/);
51
54
  if (https) {
52
55
  return `https://${https[1]}`;
53
56
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@takagaki/cortex-decisions-viewer",
3
- "version": "0.4.1",
3
+ "version": "0.4.3",
4
4
  "description": "Cortexの意思決定記録(Decisions/*.md)を静的サイトにビルドして閲覧する。各レコードに「Edit on GitHub」リンクを付与する。",
5
5
  "license": "UNLICENSED",
6
6
  "private": false,