@celljs/ta-games 0.0.0-stage → 4.11.0

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.
Files changed (47) hide show
  1. package/README.en.md +47 -0
  2. package/README.md +46 -2
  3. package/host/index.mjs +65 -0
  4. package/package.json +58 -4
  5. package/skills/ta-game/SKILL.md +127 -0
  6. package/skills/ta-game/examples/dino-run/package.json +22 -0
  7. package/skills/ta-game/examples/dino-run/web.js +389 -0
  8. package/skills/ta-game/examples/stack/package.json +22 -0
  9. package/skills/ta-game/examples/stack/web.js +423 -0
  10. package/skills/ta-game/phaser/LICENSE.md +22 -0
  11. package/skills/ta-game/phaser/actions-and-utilities/SKILL.md +343 -0
  12. package/skills/ta-game/phaser/animations/SKILL.md +481 -0
  13. package/skills/ta-game/phaser/audio-and-sound/SKILL.md +453 -0
  14. package/skills/ta-game/phaser/cameras/SKILL.md +497 -0
  15. package/skills/ta-game/phaser/cameras/references/REFERENCE.md +128 -0
  16. package/skills/ta-game/phaser/curves-and-paths/SKILL.md +359 -0
  17. package/skills/ta-game/phaser/data-manager/SKILL.md +406 -0
  18. package/skills/ta-game/phaser/events-system/SKILL.md +497 -0
  19. package/skills/ta-game/phaser/filters-and-postfx/SKILL.md +449 -0
  20. package/skills/ta-game/phaser/game-object-components/SKILL.md +478 -0
  21. package/skills/ta-game/phaser/game-object-components/references/REFERENCE.md +76 -0
  22. package/skills/ta-game/phaser/game-setup-and-config/SKILL.md +485 -0
  23. package/skills/ta-game/phaser/geometry-and-math/SKILL.md +497 -0
  24. package/skills/ta-game/phaser/graphics-and-shapes/SKILL.md +473 -0
  25. package/skills/ta-game/phaser/groups-and-containers/SKILL.md +418 -0
  26. package/skills/ta-game/phaser/input-keyboard-mouse-touch/SKILL.md +500 -0
  27. package/skills/ta-game/phaser/input-keyboard-mouse-touch/references/REFERENCE.md +372 -0
  28. package/skills/ta-game/phaser/loading-assets/SKILL.md +474 -0
  29. package/skills/ta-game/phaser/loading-assets/references/REFERENCE.md +148 -0
  30. package/skills/ta-game/phaser/particles/SKILL.md +499 -0
  31. package/skills/ta-game/phaser/particles/references/REFERENCE.md +17 -0
  32. package/skills/ta-game/phaser/physics-arcade/SKILL.md +468 -0
  33. package/skills/ta-game/phaser/physics-matter/SKILL.md +499 -0
  34. package/skills/ta-game/phaser/render-textures/SKILL.md +441 -0
  35. package/skills/ta-game/phaser/scale-and-responsive/SKILL.md +371 -0
  36. package/skills/ta-game/phaser/scenes/SKILL.md +450 -0
  37. package/skills/ta-game/phaser/scenes/references/REFERENCE.md +78 -0
  38. package/skills/ta-game/phaser/sprites-and-images/SKILL.md +417 -0
  39. package/skills/ta-game/phaser/sprites-and-images/references/REFERENCE.md +160 -0
  40. package/skills/ta-game/phaser/text-and-bitmaptext/SKILL.md +460 -0
  41. package/skills/ta-game/phaser/tilemaps/SKILL.md +440 -0
  42. package/skills/ta-game/phaser/time-and-timers/SKILL.md +496 -0
  43. package/skills/ta-game/phaser/tweens/SKILL.md +414 -0
  44. package/skills/ta-game/phaser/v3-to-v4-migration/SKILL.md +430 -0
  45. package/skills/ta-game/phaser/v4-new-features/SKILL.md +384 -0
  46. package/skills/ta-game/phaser/v4-new-features/references/REFERENCE.md +69 -0
  47. package/web/index.js +431 -0
package/web/index.js ADDED
@@ -0,0 +1,431 @@
1
+ // web-src/i18n.ts
2
+ var EN = {
3
+ page: "Games",
4
+ games: "Your games",
5
+ installExamples: "Install the examples",
6
+ noGames: "No games yet",
7
+ noGamesHint: "Have Ta make one below, or install one from the market",
8
+ makeTitle: "Have Ta make one",
9
+ makeHint: "Or just say what you want to play in a conversation",
10
+ snake: "Snake",
11
+ snakeHint: "Arrow keys or swipes",
12
+ snakeAsk: "Make a Snake game as an extension of Ta: arrow keys on a computer, swipes on a phone, and the best score kept.",
13
+ breakout: "Breakout",
14
+ breakoutHint: "A paddle under your finger",
15
+ breakoutAsk: "Make a Breakout game as an extension of Ta: the paddle follows the mouse or the finger, and the bricks take the colors of the theme.",
16
+ board: "Dinos at work",
17
+ boardHint: "Scheduled tasks as a little world",
18
+ boardAsk: "Make a card of the board that shows my scheduled tasks as a little pixel world: each task a dinosaur on the grass, running while it runs, lying down when its last run failed.",
19
+ maze: "3D maze",
20
+ mazeHint: "Roll a ball through it",
21
+ mazeAsk: "Make a 3D maze game as an extension of Ta, with ui.Game3D: tilt the maze with the arrow keys or by dragging, roll the ball to the exit, a new maze each round, and the best time kept.",
22
+ making: "Make a game",
23
+ makeTitleOf: "Have Ta make {name}?",
24
+ makeAgainTitle: "Make {name} again?",
25
+ madeBefore: "Ta was asked to make it before. This opens another conversation.",
26
+ startMaking: "Make it",
27
+ makeAnother: "Make another",
28
+ failed: "Could not start: {message}"
29
+ };
30
+ var ZH = {
31
+ page: "游戏",
32
+ games: "我的游戏",
33
+ installExamples: "安装示例游戏",
34
+ noGames: "还没有游戏",
35
+ noGamesHint: "在下面让 Ta 做一个,或者去市场装一个",
36
+ makeTitle: "让 Ta 做一个",
37
+ makeHint: "也可以直接在对话里说想玩什么",
38
+ snake: "贪吃蛇",
39
+ snakeHint: "方向键或滑动操作",
40
+ snakeAsk: "做一个贪吃蛇小游戏扩展:电脑上用方向键,手机上滑动操作,记下最高分。",
41
+ breakout: "打砖块",
42
+ breakoutHint: "挡板跟着手指走",
43
+ breakoutAsk: "做一个打砖块小游戏扩展:挡板跟随鼠标或手指移动,砖块用 Ta 主题的颜色。",
44
+ board: "干活的恐龙",
45
+ boardHint: "把定时任务变成小世界",
46
+ boardAsk: "做一张看板卡片,把我的定时任务画成一个像素小世界:每个任务是草地上的一只小恐龙,正在运行时奔跑,上次运行失败时趴下。",
47
+ maze: "3D 迷宫",
48
+ mazeHint: "滚着小球找出口",
49
+ mazeAsk: "用 ui.Game3D 做一个 3D 迷宫小游戏扩展:方向键或拖动倾斜迷宫,让小球滚到出口,每局一个新迷宫,记下最快用时。",
50
+ making: "做游戏",
51
+ makeTitleOf: "让 Ta 做{name}?",
52
+ makeAgainTitle: "再做一个{name}?",
53
+ madeBefore: "之前已经让 Ta 做过,这会再开一个新对话。",
54
+ startMaking: "开始做",
55
+ makeAnother: "再做一个",
56
+ failed: "没能开始:{message}"
57
+ };
58
+ var GamesText;
59
+ ((GamesText) => {
60
+ function of(language) {
61
+ return language.startsWith("zh") ? ZH : EN;
62
+ }
63
+ GamesText.of = of;
64
+ function format(text, values) {
65
+ return text.replace(/\{(\w+)\}/g, (all, name) => (name in values) ? String(values[name]) : all);
66
+ }
67
+ GamesText.format = format;
68
+ })(GamesText ||= {});
69
+
70
+ // web-src/make-game.ts
71
+ var GAMES = "@celljs/ta-games";
72
+ var EXTENSIONS = "@celljs/ta-extensions";
73
+ var MADE = "made";
74
+ var MakeGame;
75
+ ((MakeGame) => {
76
+ function message(ask, packages) {
77
+ const root = (name) => packages.find((info) => info.name === name)?.root;
78
+ const games = root(GAMES);
79
+ const extensions = root(EXTENSIONS);
80
+ const skills = [games && `${games}/skills/ta-game/SKILL.md`, extensions && `${extensions}/skills/ta-package/SKILL.md`].filter(Boolean);
81
+ const read = skills.length ? ` Read ${skills.join(" and ")} first.` : "";
82
+ return `${ask}
83
+
84
+ (Make it with the ta-game and ta-package skills.${read})`;
85
+ }
86
+ MakeGame.message = message;
87
+ let picking = false;
88
+ async function pick(pi, idea) {
89
+ if (picking) {
90
+ return;
91
+ }
92
+ picking = true;
93
+ try {
94
+ const words = GamesText.of(pi.ui.language);
95
+ const made = await pi.storage.get(MADE).catch(() => {
96
+ return;
97
+ }) ?? {};
98
+ const again = made[idea.key] !== undefined;
99
+ const yes = await pi.ui.confirm(GamesText.format(again ? words.makeAgainTitle : words.makeTitleOf, { name: idea.label }), again ? `${words.madeBefore}
100
+
101
+ ${idea.ask}` : idea.ask, { confirmLabel: again ? words.makeAnother : words.startMaking });
102
+ if (yes && await start(pi, idea.ask)) {
103
+ await pi.storage.set(MADE, { ...made, [idea.key]: Date.now() }).catch(() => {
104
+ return;
105
+ });
106
+ }
107
+ } finally {
108
+ picking = false;
109
+ }
110
+ }
111
+ MakeGame.pick = pick;
112
+ async function start(pi, ask) {
113
+ const words = GamesText.of(pi.ui.language);
114
+ try {
115
+ const { cwd } = await pi.server.getServerInfo();
116
+ const packages = pi.packages.listPackages(cwd).catch(() => []);
117
+ const sessionId = pi.server.openSession({ cwd }).then((info) => info.sessionId);
118
+ await pi.switchSession(sessionId, { title: words.making, cwd });
119
+ await pi.server.prompt(await sessionId, { clientMessageId: `ta-games:${Date.now()}`, message: message(ask, await packages) });
120
+ return true;
121
+ } catch (error) {
122
+ pi.ui.notify(GamesText.format(words.failed, { message: error instanceof Error ? error.message : String(error) }), "error");
123
+ return false;
124
+ }
125
+ }
126
+ MakeGame.start = start;
127
+ })(MakeGame ||= {});
128
+
129
+ // web-src/react.ts
130
+ var React;
131
+ function bind(react) {
132
+ React = react;
133
+ }
134
+ var idle = () => [false, async (action) => await action()];
135
+ function useBusy(ui) {
136
+ return (ui.useBusy ?? idle)();
137
+ }
138
+
139
+ // web-src/ideas.tsx
140
+ var IDEAS = [
141
+ { key: "snake", label: "snake", hint: "snakeHint", ask: "snakeAsk" },
142
+ { key: "breakout", label: "breakout", hint: "breakoutHint", ask: "breakoutAsk" },
143
+ { key: "maze", label: "maze", hint: "mazeHint", ask: "mazeAsk" },
144
+ { key: "board", label: "board", hint: "boardHint", ask: "boardAsk" }
145
+ ];
146
+ function IdeasSection({ pi }) {
147
+ const words = GamesText.of(pi.ui.language);
148
+ return /* @__PURE__ */ React.createElement("section", null, /* @__PURE__ */ React.createElement("div", {
149
+ className: "tgm-label"
150
+ }, words.makeTitle), /* @__PURE__ */ React.createElement("div", {
151
+ className: "tgm-note"
152
+ }, words.makeHint), /* @__PURE__ */ React.createElement(pi.ui.PictureCards, {
153
+ columns: 4,
154
+ compactColumns: 2,
155
+ cards: IDEAS.map((idea) => ({
156
+ key: idea.key,
157
+ picture: /* @__PURE__ */ React.createElement(IdeaPicture, {
158
+ pi,
159
+ idea: idea.key
160
+ }),
161
+ label: words[idea.label],
162
+ hint: words[idea.hint],
163
+ onPick: () => void MakeGame.pick(pi, { key: idea.key, label: words[idea.label], ask: words[idea.ask] })
164
+ }))
165
+ }));
166
+ }
167
+ function IdeaPicture({ pi, idea }) {
168
+ if (idea === "snake") {
169
+ return /* @__PURE__ */ React.createElement(pi.ui.Picture, null, /* @__PURE__ */ React.createElement("rect", {
170
+ className: "ta-pic-pane",
171
+ x: "20",
172
+ y: "14",
173
+ width: "120",
174
+ height: "68",
175
+ rx: "8"
176
+ }), /* @__PURE__ */ React.createElement("path", {
177
+ className: "ta-pic-stroke",
178
+ d: "M40 64 H76 V36 H112",
179
+ fill: "none",
180
+ strokeWidth: "8",
181
+ strokeLinecap: "round",
182
+ strokeLinejoin: "round"
183
+ }), /* @__PURE__ */ React.createElement("circle", {
184
+ className: "ta-pic-mark",
185
+ cx: "112",
186
+ cy: "36",
187
+ r: "5"
188
+ }), /* @__PURE__ */ React.createElement("circle", {
189
+ className: "ta-pic-bad",
190
+ cx: "122",
191
+ cy: "62",
192
+ r: "4"
193
+ }));
194
+ }
195
+ if (idea === "breakout") {
196
+ return /* @__PURE__ */ React.createElement(pi.ui.Picture, null, /* @__PURE__ */ React.createElement("rect", {
197
+ className: "ta-pic-pane",
198
+ x: "20",
199
+ y: "14",
200
+ width: "120",
201
+ height: "68",
202
+ rx: "8"
203
+ }), [0, 1, 2, 3].map((column) => /* @__PURE__ */ React.createElement("rect", {
204
+ key: column,
205
+ className: column === 1 ? "ta-pic-accent" : "ta-pic-line",
206
+ x: 30 + column * 26,
207
+ y: "24",
208
+ width: "22",
209
+ height: "8",
210
+ rx: "2"
211
+ })), [0, 1, 2].map((column) => /* @__PURE__ */ React.createElement("rect", {
212
+ key: column,
213
+ className: "ta-pic-soft",
214
+ x: 43 + column * 26,
215
+ y: "36",
216
+ width: "22",
217
+ height: "8",
218
+ rx: "2"
219
+ })), /* @__PURE__ */ React.createElement("circle", {
220
+ className: "ta-pic-mark",
221
+ cx: "92",
222
+ cy: "58",
223
+ r: "4"
224
+ }), /* @__PURE__ */ React.createElement("rect", {
225
+ className: "ta-pic-accent",
226
+ x: "62",
227
+ y: "70",
228
+ width: "36",
229
+ height: "5",
230
+ rx: "2.5"
231
+ }));
232
+ }
233
+ if (idea === "maze") {
234
+ return /* @__PURE__ */ React.createElement(pi.ui.Picture, null, /* @__PURE__ */ React.createElement("path", {
235
+ className: "ta-pic-pane",
236
+ d: "M80 12 L140 42 L80 72 L20 42 Z"
237
+ }), /* @__PURE__ */ React.createElement("path", {
238
+ className: "ta-pic-soft",
239
+ d: "M20 42 L80 72 L80 86 L20 56 Z"
240
+ }), /* @__PURE__ */ React.createElement("path", {
241
+ className: "ta-pic-line",
242
+ d: "M80 72 L140 42 L140 56 L80 86 Z"
243
+ }), /* @__PURE__ */ React.createElement("path", {
244
+ className: "ta-pic-path",
245
+ d: "M50 42 L80 27 L110 42 L80 57",
246
+ fill: "none"
247
+ }), /* @__PURE__ */ React.createElement("circle", {
248
+ className: "ta-pic-mark",
249
+ cx: "80",
250
+ cy: "57",
251
+ r: "5"
252
+ }));
253
+ }
254
+ return /* @__PURE__ */ React.createElement(pi.ui.Picture, null, /* @__PURE__ */ React.createElement("rect", {
255
+ className: "ta-pic-pane",
256
+ x: "20",
257
+ y: "14",
258
+ width: "120",
259
+ height: "68",
260
+ rx: "8"
261
+ }), /* @__PURE__ */ React.createElement("rect", {
262
+ className: "ta-pic-soft",
263
+ x: "20",
264
+ y: "62",
265
+ width: "120",
266
+ height: "20",
267
+ rx: "0"
268
+ }), /* @__PURE__ */ React.createElement("rect", {
269
+ className: "ta-pic-mark",
270
+ x: "38",
271
+ y: "46",
272
+ width: "14",
273
+ height: "16",
274
+ rx: "3"
275
+ }), /* @__PURE__ */ React.createElement("rect", {
276
+ className: "ta-pic-mark",
277
+ x: "72",
278
+ y: "40",
279
+ width: "14",
280
+ height: "16",
281
+ rx: "3"
282
+ }), /* @__PURE__ */ React.createElement("rect", {
283
+ className: "ta-pic-bad",
284
+ x: "104",
285
+ y: "54",
286
+ width: "18",
287
+ height: "8",
288
+ rx: "3"
289
+ }), /* @__PURE__ */ React.createElement("path", {
290
+ className: "ta-pic-path",
291
+ d: "M30 30 H130"
292
+ }));
293
+ }
294
+
295
+ // web-src/games-view.tsx
296
+ var GAME_CATEGORY = "game";
297
+ var GamesUtil;
298
+ ((GamesUtil) => {
299
+ function games(pages) {
300
+ return pages.filter((page) => page.category === GAME_CATEGORY).sort((a, b) => (b.usedAt ?? 0) - (a.usedAt ?? 0) || a.title.localeCompare(b.title));
301
+ }
302
+ GamesUtil.games = games;
303
+ })(GamesUtil ||= {});
304
+ function GamesView({ pi }) {
305
+ const words = GamesText.of(pi.ui.language);
306
+ const games = GamesUtil.games(pi.ui.usePages());
307
+ const [examples, setExamples] = React.useState();
308
+ const read = React.useCallback(() => pi.callHost("examples").then(setExamples, () => {
309
+ return;
310
+ }), [pi]);
311
+ React.useEffect(() => {
312
+ pi.callHost("offerExamples").then(async (copied) => {
313
+ if (copied.length > 0) {
314
+ await pi.reloadExtensions();
315
+ }
316
+ await read();
317
+ }, () => read());
318
+ }, [pi, read]);
319
+ const missing = examples?.filter((example) => !example.installed) ?? [];
320
+ const [installing, run] = useBusy(pi.ui);
321
+ const install = async () => {
322
+ try {
323
+ if ((await pi.callHost("installExamples")).length > 0) {
324
+ await pi.reloadExtensions();
325
+ }
326
+ await read();
327
+ } catch (error) {
328
+ pi.ui.notify(GamesText.format(words.failed, { message: error instanceof Error ? error.message : String(error) }), "error");
329
+ }
330
+ };
331
+ return /* @__PURE__ */ React.createElement("div", {
332
+ className: "tgm-scroll"
333
+ }, /* @__PURE__ */ React.createElement("div", {
334
+ className: "tgm"
335
+ }, /* @__PURE__ */ React.createElement("section", null, /* @__PURE__ */ React.createElement("div", {
336
+ className: "tgm-head"
337
+ }, /* @__PURE__ */ React.createElement("div", {
338
+ className: "tgm-title"
339
+ }, words.games), missing.length > 0 ? /* @__PURE__ */ React.createElement("button", {
340
+ type: "button",
341
+ className: installing ? "tgm-link ta-busy" : "tgm-link",
342
+ "aria-busy": installing || undefined,
343
+ onClick: () => void run(install)
344
+ }, words.installExamples, installing && /* @__PURE__ */ React.createElement("span", {
345
+ className: "ta-spinner ta-busy-mark"
346
+ })) : null), games.length > 0 ? /* @__PURE__ */ React.createElement("div", {
347
+ className: "tgm-grid"
348
+ }, games.map((game) => /* @__PURE__ */ React.createElement(GameTile, {
349
+ key: game.id,
350
+ pi,
351
+ game
352
+ }))) : /* @__PURE__ */ React.createElement("div", {
353
+ className: "tgm-empty"
354
+ }, /* @__PURE__ */ React.createElement(pi.ui.Empty, {
355
+ title: words.noGames,
356
+ hint: words.noGamesHint,
357
+ compact: true
358
+ }))), /* @__PURE__ */ React.createElement(IdeasSection, {
359
+ pi
360
+ })));
361
+ }
362
+ function GameTile({ pi, game }) {
363
+ const Icon = game.icon ?? pi.ui.icons.Gamepad2;
364
+ const tint = [...game.extension].reduce((sum, char) => (sum * 31 + char.charCodeAt(0)) % 9, 7);
365
+ const running = game.state === "background" || game.state === "running";
366
+ const [opening, run] = useBusy(pi.ui);
367
+ return /* @__PURE__ */ React.createElement("button", {
368
+ type: "button",
369
+ className: "tgm-tile",
370
+ style: { "--tgm-tint": `var(--ta-tint-${tint})`, "--tgm-ink": `var(--ta-tint-ink-${tint})` },
371
+ "aria-busy": opening || undefined,
372
+ onClick: () => void run(() => pi.ui.showView(game.id))
373
+ }, /* @__PURE__ */ React.createElement("span", {
374
+ className: opening ? "tgm-icon ta-busy" : "tgm-icon"
375
+ }, Icon ? /* @__PURE__ */ React.createElement(Icon, {
376
+ size: 24
377
+ }) : null, running ? /* @__PURE__ */ React.createElement("span", {
378
+ className: "tgm-dot"
379
+ }) : null, opening && /* @__PURE__ */ React.createElement("span", {
380
+ className: "ta-spinner ta-busy-mark"
381
+ })), /* @__PURE__ */ React.createElement("span", {
382
+ className: "tgm-name"
383
+ }, game.title));
384
+ }
385
+
386
+ // web-src/style.ts
387
+ var STYLE = `
388
+ .tgm-scroll { flex: 1; min-height: 0; height: 100%; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; scrollbar-gutter: stable; }
389
+ .tgm { display: flex; flex-direction: column; gap: 28px; width: 100%; max-width: 760px; margin: 0 auto; padding: 24px 20px 40px; box-sizing: border-box; }
390
+ .tgm-head { display: flex; align-items: center; gap: 10px; margin: 0 2px 12px; }
391
+ .tgm-title { flex: 1; min-width: 0; color: var(--ta-text); font-size: calc(15px * var(--ta-font-scale)); line-height: calc(22px * var(--ta-font-scale)); font-weight: 600; }
392
+ .tgm-link { padding: 4px 8px; margin-right: -8px; border: 0; border-radius: 8px; background: none; color: var(--ta-accent); font: inherit; font-size: calc(13px * var(--ta-font-scale)); cursor: pointer; }
393
+ .tgm-link:hover { background: var(--ta-hover); }
394
+ .tgm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); row-gap: 16px; margin: 0 -2px; }
395
+ .tgm-tile { display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; padding: 4px 2px; border: 0; border-radius: 14px; background: none; color: var(--ta-text); font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
396
+ .tgm-icon { position: relative; display: grid; place-items: center; width: 60px; height: 60px; border-radius: 17px; background: var(--tgm-tint); color: var(--tgm-ink); transition: transform 160ms var(--ta-ease, ease-out); }
397
+ .tgm-tile:active .tgm-icon { transform: scale(0.92); }
398
+ .tgm-link.ta-busy { position: relative; }
399
+ .tgm-icon > .ta-busy-mark { width: 22px; height: 22px; border-width: 2.2px; border-color: color-mix(in srgb, var(--tgm-ink) 25%, transparent); border-top-color: var(--tgm-ink); }
400
+ .tgm-dot { position: absolute; top: -2px; right: -2px; width: 10px; height: 10px; border-radius: 50%; background: var(--ta-green); box-shadow: 0 0 0 2px var(--ta-main); }
401
+ .tgm-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ta-body, var(--ta-text)); font-size: calc(12.5px * var(--ta-font-scale)); line-height: calc(17px * var(--ta-font-scale)); }
402
+ .tgm-empty { display: flex; flex-direction: column; padding: 12px 0; }
403
+ .tgm-label { margin: 0 2px 4px; color: var(--ta-text); font-size: calc(15px * var(--ta-font-scale)); line-height: calc(22px * var(--ta-font-scale)); font-weight: 600; }
404
+ .tgm-note { margin: 0 2px 12px; color: var(--ta-muted); font-size: calc(13px * var(--ta-font-scale)); line-height: calc(18px * var(--ta-font-scale)); }
405
+ :root[data-handheld] .tgm { padding: 16px 14px 32px; gap: 22px; }
406
+ `;
407
+ function injectStyle() {
408
+ const style = document.createElement("style");
409
+ style.dataset.taGames = "";
410
+ style.textContent = STYLE;
411
+ document.head.appendChild(style);
412
+ return () => style.remove();
413
+ }
414
+
415
+ // web-src/index.tsx
416
+ function activate(pi) {
417
+ bind(pi.React);
418
+ const removeStyle = injectStyle();
419
+ pi.registerView("games", {
420
+ title: () => GamesText.of(pi.ui.language).page,
421
+ icon: pi.ui.icons.Gamepad2,
422
+ location: "page",
423
+ render: () => /* @__PURE__ */ React.createElement(GamesView, {
424
+ pi
425
+ })
426
+ });
427
+ return removeStyle;
428
+ }
429
+ export {
430
+ activate as default
431
+ };