dsh-happy-reader 0.2.3 → 0.2.4
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/lib/client.js +9 -3
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -29,7 +29,7 @@ window.__ModuleLoader__.load({
|
|
|
29
29
|
var exports = module.exports
|
|
30
30
|
|
|
31
31
|
// ── 常量 ────────────────────────────────────────────────────────────
|
|
32
|
-
const VERSION = '0.2.
|
|
32
|
+
const VERSION = '0.2.4'
|
|
33
33
|
const STATE_KEY = 'dsh.reader-boost.v1'
|
|
34
34
|
const FAB_ID = 'dsrb-fab'
|
|
35
35
|
const PANEL_ID = 'dsrb-panel'
|
|
@@ -319,8 +319,14 @@ window.__ModuleLoader__.load({
|
|
|
319
319
|
let next = value
|
|
320
320
|
if (famNames.length && next.indexOf('var(--dsw-font-family)') !== -1) next = next.split('var(--dsw-font-family)').join(fam)
|
|
321
321
|
if (code && next.indexOf('var(--ds-font-family-code)') !== -1) next = next.split('var(--ds-font-family-code)').join(cod)
|
|
322
|
-
//
|
|
323
|
-
|
|
322
|
+
// 行距:官方行高 token 的真实形态是简写里的 "/ calc(Npx + var(--dsh-content-font-delta))"
|
|
323
|
+
//(增量由官方自管、随字号缩放);按倍率整段放大,字号本身不动
|
|
324
|
+
if (lineH !== null) {
|
|
325
|
+
next = next.replace(
|
|
326
|
+
/(\/\s*)calc\((\d+(?:\.\d+)?)px \+ var\(--dsh-content-font-delta\)\)/g,
|
|
327
|
+
(m, lead, n) => lead + 'calc((' + n + 'px + var(--dsh-content-font-delta)) * ' + lineH + ')',
|
|
328
|
+
)
|
|
329
|
+
}
|
|
324
330
|
if (next !== value) parts.push(name + ':' + next)
|
|
325
331
|
}
|
|
326
332
|
if (letterSp !== null) parts.push('letter-spacing:' + letterSp + 'px')
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-happy-reader",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.4",
|
|
4
4
|
"description": "Happy Reader(阅读增强):隐藏输入框 / 上边栏、全屏切换、字号 10–40px、行距/字距微调、面板可拖动可拉高、复制为 Markdown(公式→LaTeX)、内容宽度扩展、中英文分别选正文字体 + 代码字体(仅列本机已装)—— 与官方设置协同,不冲突",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|