cortico-world-parlor 0.37.1 → 0.37.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/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## 0.37.2(2026-11-07)
2
+
3
+ - 家长页(`/parent`)整体重做版式,改成一块状态屏加双栏信息:屏上最大字号只回答「孩子在哪个客厅」,下面一行写席位与身份,右侧四格指标是可见消息/筹码/未读/局数;正文分「正在玩(含孩子的私牌)」「最近消息」「要注意」「战绩」「信箱与私聊」,最近消息顶部补一行「最近说话的人」。行为、接口与权限判断均未变,只是同一份数据换了排布。
4
+ - 家长页改用像素机台视觉:零圆角、硬投影、机台包边、点阵底纹与扫描线,标题/标签/数字使用随包分发的 Fusion Pixel 12px 点阵字(OFL 1.1,附许可证全文),长正文仍用系统字体以免累眼。
5
+ - 手机单栏重排顺序为「要注意 → 正在玩 → 战绩 → 最近消息 → 信箱」,异常提示不再被长消息流压到屏幕下方;消息行改回「时间/谁/内容」一行一条(行高 58px → 34px)。修复零未读时信箱标题栏残留的空标签,以及家长钥匙入口补上「打开后能看到什么」说明。
6
+ - 静态资源层新增 `.woff2` 类型与 `font-src 'self'`(仍为 self-only,无内联脚本),并让已压缩过的二进制不再无条件 gzip(此前对新增的字体文件白做一次压缩并多占一份内存);测试增加「字体必须 200 且为 `font/woff2`」断言,避免字体被静默漏发而退回系统字体。
7
+ - 包版本、客户端版本与网页资源 `?v=` 统一为 0.37.2;发布内容以 npm tarball 为准。无数据库迁移,网页端刷新即用新资源。
8
+
1
9
  ## 0.37.1(2026-11-07)
2
10
 
3
11
  - 修复长局下游戏状态与动作回执无大小上限(反馈 `de64a276` 稳定性部分 / [#12](https://github.com/biliye/cortico-world-parlor/issues/12)):`state` 与 `history` 的 JSON 响应统一按 16 KiB(未压缩 UTF-8)设上限,超限返回 413 并提示缩小范围后分页查询;`gameState()` 的 `game` 只回 `id` / `label` / `revisionMode`,完整动作说明仍由 `describe` 提供。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cortico-world-parlor",
3
- "version": "0.37.1",
3
+ "version": "0.37.2",
4
4
  "type": "module",
5
5
  "author": {
6
6
  "name": "筆離嘢"
@@ -29,7 +29,7 @@ export interface ReplayResponse {
29
29
  * 能不能玩需要新能力的游戏(狼人杀要 ≥ 0.29.0)。
30
30
  * 它跟 npm 包版本解耦——发新版时在这里抬一格即可(有测试盯着别忘)。
31
31
  */
32
- export const PARLOR_CLIENT_VERSION = '0.37.1';
32
+ export const PARLOR_CLIENT_VERSION = '0.37.2';
33
33
 
34
34
  export class ParlorHttpError extends Error {
35
35
  readonly status: number;
@@ -16,6 +16,7 @@ export const WEB_TYPES: Readonly<Record<string, string>> = {
16
16
  '.jpg': 'image/jpeg',
17
17
  '.jpeg': 'image/jpeg',
18
18
  '.webp': 'image/webp',
19
+ '.woff2': 'font/woff2',
19
20
  '.ico': 'image/x-icon',
20
21
  };
21
22
 
@@ -26,6 +27,7 @@ export const PLAY_CSP = [
26
27
  "style-src 'self'",
27
28
  "connect-src 'self'",
28
29
  "img-src 'self'",
30
+ "font-src 'self'",
29
31
  "base-uri 'none'",
30
32
  "form-action 'none'",
31
33
  "frame-ancestors 'none'",
@@ -54,7 +56,11 @@ function loadAsset(rel: string): Asset {
54
56
  const body = readFileSync(file);
55
57
  // ETag 用内容算:npm 打包会把 mtime 抹平,同长度的改动靠 mtime 认不出来。
56
58
  const etag = `"${createHash('sha1').update(body).digest('base64url').slice(0, 18)}"`;
57
- const asset: Asset = { stamp, etag, body, gzipped: gzipSync(body) };
59
+ // 字体这类已经压过的二进制不再 gzip:省下的那份内存和首次请求的 CPU 都是白花的。
60
+ const dot = rel.lastIndexOf('.');
61
+ const ext = dot >= 0 ? rel.slice(dot).toLowerCase() : '';
62
+ const gzipped = COMPRESSIBLE.has(ext) ? gzipSync(body) : body;
63
+ const asset: Asset = { stamp, etag, body, gzipped };
58
64
  assets.set(rel, asset);
59
65
  return asset;
60
66
  }
@@ -5,8 +5,8 @@
5
5
  */
6
6
  import { el, btn, icon } from './common.js';
7
7
  /* 内部模块统一带同一个版本号:版本不一致会让浏览器当成两份,订阅会各记各的。 */
8
- import { onAnnouncements } from './announcements.js?v=0.37.1';
9
- import { pickAnnouncement, rememberDismissed, excerpt } from './announcement-rules.js?v=0.37.1';
8
+ import { onAnnouncements } from './announcements.js?v=0.37.2';
9
+ import { pickAnnouncement, rememberDismissed, excerpt } from './announcement-rules.js?v=0.37.2';
10
10
 
11
11
  const DISMISSED_KEY = 'parlor-announcements-dismissed';
12
12
  const SEEN_KEY = 'parlor-announcements-seen';
@@ -0,0 +1,98 @@
1
+ 本目录的 fusion-pixel-sc.woff2 是 Fusion Pixel 12px SC(融合像素字体)
2
+ https://github.com/TakWolf/fusion-pixel-font
3
+ 按 SIL Open Font License 1.1 分发;包内未对该字体做修改。
4
+ 家长页只在标题、标签与数字上用它,正文仍用系统字体。
5
+
6
+ 以下为许可证原文(未改动):
7
+
8
+ -———————————————————————
9
+
10
+ SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
11
+
12
+ -———————————————————————
13
+
14
+ PREAMBLE
15
+
16
+ The goals of the Open Font License (OFL) are to stimulate worldwide
17
+ development of collaborative font projects, to support the font creation
18
+ efforts of academic and linguistic communities, and to provide a free and
19
+ open framework in which fonts may be shared and improved in partnership
20
+ with others.
21
+
22
+ The OFL allows the licensed fonts to be used, studied, modified and
23
+ redistributed freely as long as they are not sold by themselves. The
24
+ fonts, including any derivative works, can be bundled, embedded,
25
+ redistributed and/or sold with any software provided that any reserved
26
+ names are not used by derivative works. The fonts and derivatives,
27
+ however, cannot be released under any other type of license. The
28
+ requirement for fonts to remain under this license does not apply to any
29
+ document created using the fonts or their derivatives.
30
+
31
+ DEFINITIONS
32
+
33
+ "Font Software" refers to the set of files released by the Copyright
34
+ Holder(s) under this license and clearly marked as such. This may include
35
+ source files, build scripts and documentation.
36
+
37
+ "Reserved Font Name" refers to any names specified as such after the
38
+ copyright statement(s).
39
+
40
+ "Original Version" refers to the collection of Font Software components as
41
+ distributed by the Copyright Holder(s).
42
+
43
+ "Modified Version" refers to any derivative made by adding to, deleting,
44
+ or substituting — in part or in whole — any of the components of the
45
+ Original Version, by changing formats or by porting the Font Software to a
46
+ new environment.
47
+
48
+ "Author" refers to any designer, engineer, programmer, technical writer or
49
+ other person who contributed to the Font Software.
50
+
51
+ PERMISSION & CONDITIONS
52
+
53
+ Permission is hereby granted, free of charge, to any person obtaining a
54
+ copy of the Font Software, to use, study, copy, merge, embed, modify,
55
+ redistribute, and sell modified and unmodified copies of the Font
56
+ Software, subject to the following conditions:
57
+
58
+ 1) Neither the Font Software nor any of its individual components, in
59
+ Original or Modified Versions, may be sold by itself.
60
+
61
+ 2) Original or Modified Versions of the Font Software may be bundled,
62
+ redistributed and/or sold with any software, provided that each copy
63
+ contains the above copyright notice and this license. These can be
64
+ included either as stand-alone text files, human-readable headers or in
65
+ the appropriate machine-readable metadata fields within text or binary
66
+ files as long as those fields can be easily viewed by the user.
67
+
68
+ 3) No Modified Version of the Font Software may use the Reserved Font
69
+ Name(s) unless explicit written permission is granted by the corresponding
70
+ Copyright Holder. This restriction only applies to the primary font name as
71
+ presented to the users.
72
+
73
+ 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
74
+ Software shall not be used to promote, endorse or advertise any Modified
75
+ Version, except to acknowledge the contribution(s) of the Copyright
76
+ Holder(s) and the Author(s) or with their explicit written permission.
77
+
78
+ 5) The Font Software, modified or unmodified, in part or in whole, must be
79
+ distributed entirely under this license, and must not be distributed under
80
+ any other license. The requirement for fonts to remain under this license
81
+ does not apply to any document created using the Font Software.
82
+
83
+ TERMINATION
84
+
85
+ This license becomes null and void if any of the above conditions are not
86
+ met.
87
+
88
+ DISCLAIMER
89
+
90
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
91
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
92
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
93
+ COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
94
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
95
+ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
96
+ DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
97
+ OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS
98
+ IN THE FONT SOFTWARE.
@@ -10,9 +10,9 @@
10
10
  * - `blurb` / `foot` / `guide` 是大厅卡片的文案与玩法说明。
11
11
  */
12
12
  import { mountDice } from './dice.js';
13
- import { mountDdz } from './ddz.js?v=0.37.1';
13
+ import { mountDdz } from './ddz.js?v=0.37.2';
14
14
  import { mountMonopoly } from './monopoly.js';
15
- import { mountWerewolf } from './werewolf.js?v=0.37.1';
15
+ import { mountWerewolf } from './werewolf.js?v=0.37.2';
16
16
 
17
17
  export const GAMES = {
18
18
  dice: {