喵嗚(Mew,@meow 8.0)的前端(從詞法到展開)已經完成,可以在實驗場試寫;還沒有執行階段,也沒有任何已出貨的宿主,喵撲的主題工坊今天用的是 @meow 6.0。
列舉與常數
宿主的每個封閉集合(貓、姿勢、圖示、音色、觸覺強度、片語)都是列舉型別。寫錯是 E-TYP-006,訊息列出全部合法值。一個列舉的子集可以傳給接受該列舉的參數:state.mood: "walk" | "sit" | "sleep" 可以直接當姿勢傳給 draw.cat。
下表由前端的列舉表產生,唯一的來源是 HOSTS.md §3.3、§3.4 與 CANVAS.md §9.2。
列舉
| 名稱 | 成員 |
|---|---|
Cat | mimimo momo |
Pose | sit walk run sleep loaf stretch blink puff glide tumble cheer sad peek |
Icon | phone mail camera music map clock calendar photos settings browser messages notes weather wallet files video game book paw fish heart star moon sun bolt leaf cloud drop zzz note flag |
Sound | pop chime thud drip tock |
Haptic | light medium heavy |
Align | left center right |
Baseline | top middle alphabetic |
Weight | regular bold |
ClockFormat | hm h m weekday monthDay |
NoteScale | theme pentatonic major |
NoteVoice | theme musicBox kalimba guzheng hangDrum glass bubble wood retro8bit |
Ease | in out inOut spring bounce |
Appearance | light dark |
Locale | zh en ja |
SessionKind | focus countdown charge outing |
TouchPhase | down move up |
片語 L.*
L.ready L.new L.tapToStart L.playAnyKey L.tapToRetry L.drawHere L.go L.battery L.paused L.charging L.gameOver L.focus L.win L.rest L.score L.done L.best L.today L.level L.cat
kit token
| 名稱 | 種類 | UGC 調色盤 | 官方皮膚 |
|---|---|---|---|
kit.deck | color | deck[0] | paper |
kit.deck2 | color | deck[1] (else deck[0]) | paper2 |
kit.bar | color | barBg | paper2 |
kit.ink | color | ink | ink |
kit.inkSoft | color | inkSecondary | inkSecondary |
kit.pill | color | pill[0] | pill[0] |
kit.pill2 | color | pill[1] | pill[1] |
kit.pillText | color | pillText | pillText |
kit.accent | color | accent | accent |
kit.accent2 | color | (none; accent) | stamp |
kit.key | color | keyChar | (none; paper2) |
kit.keyUtil | color | keyUtility | (none; paper2) |
kit.keyText | color | keyText | (none; ink) |
kit.border | color | keyBorder | (none; inkSecondary) |
kit.radius | points | keycap r | |
kit.stroke | points | keycap border | |
kit.material | material | surface.material | |
kit.motif | motif | first motif name | |
kit.font | font | type.font | |
kit.dark | dark | current appearance | |
kit.font:system rounded serif mono pixel
裝置與資料欄位
前端的表只有欄位與型別;值域見下文與規格。
| 名稱 | 型別 | 能力 | 備註 |
|---|---|---|---|
device.scheme | "dark" | "light" | device | |
device.reduceMotion | bool | device | |
device.lowPower | bool | device | |
device.locale | "en" | "ja" | "zh" | device | |
clock.hour | num | clock | |
clock.minute | num | clock | |
clock.dayFrac | num | clock | |
date.year | num | date | |
date.month | num | date | |
date.day | num | date | |
date.weekday | num | date | |
date.dayOfYear | num | date | |
battery.level | num | battery | |
battery.charging | bool | battery | |
session.state | cart.states | session | |
session.step | num | session | |
session.steps | num | session | 宿主常數 |
session.kind | "charge" | "countdown" | "focus" | "outing" | session | |
session.startedAt | num | session | |
session.endsAt | num | session | |
session.minutes | num | session |
有哪些
| 名稱 | 用在哪 | 定義在 |
|---|---|---|
Cat | draw.cat 的第一個參數:米米莫與 Momo | HOSTS.md §3.3 |
Pose | draw.cat 的姿勢 | HOSTS.md §3.3 |
Icon | draw.icon 的圖示名;deco.icon 的 glyph 參數必須是它的子集 | HOSTS.md §3.3 |
Sound | sfx.play 的音色,只有鍵盤畫布 | CANVAS.md §9.2 |
Haptic | haptic.tap 的強度,只有鍵盤畫布 | CANVAS.md §9.2 |
sfx.note 的 scale、voice | 樂器音階與音色 | CANVAS.md §9.2 |
L.* | 片語表,型別 text | HOSTS.md §3.4 |
kit.* | 佈景 token | LANGUAGE.md §9.3 |
device.* | 亮暗、減少動態、低耗電、語系 | LANGUAGE.md §11.5 |
每個姿勢與圖示的美術還沒畫;表先定下名字,讓範例與提示模板可以檢查。圖示是第一方繪製的線條圖,不使用 Apple emoji,也不模仿 SF Symbols。
片語表 L.*
封閉、已在地化成繁中、英、日(依 device.locale),每個不超過 12 個字形。它是沒有 text 能力的宿主顯示詞語的唯一方法,也給 a11y 用。所有有 draw 的宿主都有,不是能力。
自由文字字面量(只有烘焙的 deco.* 宿主有)不會自動翻譯:作者寫什麼就顯示什麼。要支援多語就用 L.*,或自己依 device.locale 分支。
kit.*
kit token 分三種:亮、暗成對的顏色(kit.deck、kit.ink、kit.accent…,讀取時依外觀解析)、以 pt 計的數字(kit.radius、kit.stroke),以及 kit.material、kit.motif、kit.font、kit.dark(唯讀)。完整的 token 名在上面產生的表裡。
kit.material、kit.motif只供鍵盤主題的對照與 Studio 預覽使用,draw.*沒有吃它們的參數。kit.material的值域:LANGUAGE.md§9.3 只寫「列舉」並對應到surface.material,沒有列出值,規格未定(LANGUAGE.md§9.3)。- 這張 token 對照表在 Rust 裡只有一份;它把喵撲的 UGC 調色盤欄位和官方皮膚的 token 對到同一組角色名。
- 未知的 token 是
E-KIT-001。
資料欄位
clock.*、date.*、battery.*、session.* 的欄位、型別與值域在上面產生的表裡。幾個容易寫錯的地方:
date.weekday是 1–7,1 是星期一。battery.level是 0–1,量化到 5% 一階。這是語言的規定。clock.at(hour, minute)回傳不透明的時間戳,只能交給draw.timer、draw.progress。session.steps是宿主常數,等於cart.steps,可以當迴圈上界。
這些值在進入 view 或處理器時拍快照。8.0 沒有天氣、步數、音樂、位置、通知、行事曆內容。
宿主常數
pad.count、pad.rows(由 cart.pads 折疊)、session.steps(由 cart.steps 折疊)在檢查時就是數字,所以可以當迴圈上界,也可以用在頂層 let。
