@qnroa/qtype 0.0.8 → 0.0.9

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/CHANGELOG.md CHANGED
@@ -13,6 +13,37 @@ can land in any minor bump (`0.x.0`).
13
13
 
14
14
  ## [Unreleased]
15
15
 
16
+ ## [0.0.9] — 2026-08-27
17
+
18
+ View-only. No dist change, no need to rebuild — refreshing the page
19
+ on an existing deployment is enough.
20
+
21
+ ### Changed
22
+ - **Grid ↔ list view toggle is now the outermost switch, orthogonal
23
+ to filtering.** Previously any active tag/type filter forced the
24
+ home page into a list layout, ignoring the user's chosen view
25
+ mode. Now grid stays grid, list stays list — the filter changes
26
+ *what* is listed (materials vs. matching cards), not *how*.
27
+
28
+ ### Added
29
+ - **`CardHitCard`** — grid tile for a card hit, sibling of
30
+ `MaterialCard`. Kept alongside the existing `CardHitRow` so the
31
+ new 2×2 (grid/list × material/card) matrix has one component per
32
+ cell.
33
+ - **`EntryCard` / `EntryRow` base components.** The reusable shell
34
+ (click / keyboard routing, selection checkbox, done stamp,
35
+ hover / focus states, header + actions slots) is now factored
36
+ out so specializations only own their body content. Same
37
+ `.qt-deckcard*` / `.qt-deckrow*` selectors, no visual change.
38
+ - **`RowTags` helper.** The responsive tag-chip truncation logic
39
+ from `MaterialRow` moved into a shared component and is now used
40
+ by `CardHitRow` too.
41
+
42
+ ### Internal
43
+ - No public API changes to `MaterialRepository` or build outputs.
44
+ - Card-level filter view now shows a `done` stamp per card
45
+ (backed by `useDoneState.isCardDone`).
46
+
16
47
  ## [0.0.8] — 2026-08-27
17
48
 
18
49
  Breaking dist format. Source `material/*.md` unchanged — the change
package/CHANGELOG.zh.md CHANGED
@@ -12,6 +12,32 @@ English: [CHANGELOG.md](https://www.npmjs.com/package/@qnroa/qtype?activeTab=cod
12
12
 
13
13
  ## [Unreleased]
14
14
 
15
+ ## [0.0.9] — 2026-08-27
16
+
17
+ 只改 view,dist 未变,老部署刷新页面即可,无需重跑 build。
18
+
19
+ ### 变更
20
+ - **grid ↔ list 视图切换现在是最外层开关,和筛选正交**。之前只要
21
+ 勾了 tag/type,不管用户当前选的是 grid 还是 list,都强制变成 list;
22
+ 现在 grid 保持 grid,list 保持 list,筛选只决定"列的是什么"
23
+ (材料还是命中卡),不决定"怎么呈现"。
24
+
25
+ ### 新增
26
+ - **`CardHitCard`** — 命中卡的 grid 版本,和 `MaterialCard` 是兄弟。
27
+ 与已有的 `CardHitRow` 一起,凑齐新的 2×2 (grid/list × 材料/卡)
28
+ 组合,每格一个组件。
29
+ - **`EntryCard` / `EntryRow` 基类**。可复用的容器逻辑(点击/键盘
30
+ 路由、选中框、done stamp、hover/focus 态、header + actions 槽)
31
+ 抽成基类,特化组件只负责自己的 body。`.qt-deckcard*` / `.qt-deckrow*`
32
+ 样式选择器不变,视觉零变化。
33
+ - **`RowTags` helper**。之前写死在 `MaterialRow` 里的响应式 tag
34
+ chip 截断逻辑抽成独立组件,现在 `CardHitRow` 也能复用。
35
+
36
+ ### 内部
37
+ - `MaterialRepository` 公共接口和 build 产物未变。
38
+ - 命中卡列表 grid/list 都开始显示卡级 done stamp
39
+ (由 `useDoneState.isCardDone` 提供)。
40
+
15
41
  ## [0.0.8] — 2026-08-27
16
42
 
17
43
  破坏性 dist 格式变更。源 `material/*.md` 不变 —— 变化都在 build
@@ -1,3 +1,3 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-DFOCJiFs.js","assets/index-BLq7QuZg.js","assets/index-TxZJkfgF.css"])))=>i.map(i=>d[i]);
2
- import{r as l,_ as h,u as g,j as f,C as p,M as m,T as y,a as w}from"./index-BLq7QuZg.js";let o=null,c=null;async function L(){return o||c||(c=h(()=>import("./index-DFOCJiFs.js"),__vite__mapDeps([0,1,2])).then(async e=>(o=await e.createHighlighter({themes:["github-dark","github-light"],langs:[]}),o)),c)}async function _(e,t){if(!e.getLoadedLanguages().includes(t))try{await e.loadLanguage(t)}catch{}}function x(e){const[t,n]=l.useState(o);return l.useEffect(()=>{if(!e)return;let r=!1;return(async()=>{const s=await L();await _(s,e),r||n(s)})(),()=>{r=!0}},[e]),t}const A=/```(\w+)/;function E(e){const t=e.toLowerCase();return t.includes("typescript")||t.endsWith(".ts")?"typescript":t.includes("python")||t.endsWith(".py")?"python":t.includes("cpp")||t.includes("c++")?"cpp":t.includes("java")&&!t.includes("script")?"java":t.includes("go")?"go":t.includes("rust")||t.endsWith(".rs")?"rust":t.includes("code-c")||t.endsWith(".c")?"c":"javascript"}function j(e,t){if(e){const n=e.match(A);if(n)return n[1]}return E(t)}function k(e,t,n,r){if(!r||!r.getLoadedLanguages().includes(t))return new Array(Array.from(e).length).fill(null);try{const s=r.codeToTokens(e,{lang:t,theme:n}),i=[];for(const u of s.tokens){for(const a of u)for(const d of a.content)i.push(a.color??null);i.push(null)}return!e.endsWith(`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-Due6dVBA.js","assets/index-D2236cNR.js","assets/index-DI1_zxwA.css"])))=>i.map(i=>d[i]);
2
+ import{r as l,_ as h,u as g,j as f,C as p,M as m,T as y,a as w}from"./index-D2236cNR.js";let o=null,c=null;async function L(){return o||c||(c=h(()=>import("./index-Due6dVBA.js"),__vite__mapDeps([0,1,2])).then(async e=>(o=await e.createHighlighter({themes:["github-dark","github-light"],langs:[]}),o)),c)}async function _(e,t){if(!e.getLoadedLanguages().includes(t))try{await e.loadLanguage(t)}catch{}}function x(e){const[t,n]=l.useState(o);return l.useEffect(()=>{if(!e)return;let r=!1;return(async()=>{const s=await L();await _(s,e),r||n(s)})(),()=>{r=!0}},[e]),t}const A=/```(\w+)/;function E(e){const t=e.toLowerCase();return t.includes("typescript")||t.endsWith(".ts")?"typescript":t.includes("python")||t.endsWith(".py")?"python":t.includes("cpp")||t.includes("c++")?"cpp":t.includes("java")&&!t.includes("script")?"java":t.includes("go")?"go":t.includes("rust")||t.endsWith(".rs")?"rust":t.includes("code-c")||t.endsWith(".c")?"c":"javascript"}function j(e,t){if(e){const n=e.match(A);if(n)return n[1]}return E(t)}function k(e,t,n,r){if(!r||!r.getLoadedLanguages().includes(t))return new Array(Array.from(e).length).fill(null);try{const s=r.codeToTokens(e,{lang:t,theme:n}),i=[];for(const u of s.tokens){for(const a of u)for(const d of a.content)i.push(a.color??null);i.push(null)}return!e.endsWith(`
3
3
  `)&&i.length>Array.from(e).length&&i.pop(),i}catch{return new Array(Array.from(e).length).fill(null)}}function v(e){var d;const{material:t,card:n}=e,[r]=g(),s=l.useMemo(()=>r?j(n.question,t.filePath):"",[n.question,t.filePath,r]),i=typeof document<"u"&&((d=document.documentElement.getAttribute("data-theme"))!=null&&d.includes("latte"))?"github-light":"github-dark",u=x(r?s:""),a=l.useMemo(()=>r?k(n.answer,s,i,u):void 0,[n.answer,s,i,u,r]);return f.jsx(p,{type:"code",variant:"flow",slots:[{role:"title",content:n.title},n.question?{role:"question",content:f.jsx(m,{source:n.question})}:{role:"question",content:null},{role:"arena",content:f.jsx(y,{...w(e),charColors:a},n.id)}]})}export{v as CodeCard};