@typecaast/skins 0.1.0 → 0.2.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 (91) hide show
  1. package/dist/chunk-3WKOSJVB.js +320 -0
  2. package/dist/chunk-3WKOSJVB.js.map +1 -0
  3. package/dist/chunk-6K2ANTPJ.cjs +722 -0
  4. package/dist/chunk-6K2ANTPJ.cjs.map +1 -0
  5. package/dist/chunk-7IC3DRCQ.js +718 -0
  6. package/dist/chunk-7IC3DRCQ.js.map +1 -0
  7. package/dist/chunk-AMP2ZMTF.cjs +275 -0
  8. package/dist/chunk-AMP2ZMTF.cjs.map +1 -0
  9. package/dist/chunk-BMB4ZKAU.cjs +32 -0
  10. package/dist/chunk-BMB4ZKAU.cjs.map +1 -0
  11. package/dist/chunk-CAHWYIXY.js +272 -0
  12. package/dist/chunk-CAHWYIXY.js.map +1 -0
  13. package/dist/chunk-CCT33UVA.cjs +591 -0
  14. package/dist/chunk-CCT33UVA.cjs.map +1 -0
  15. package/dist/chunk-E5K2XXQL.cjs +469 -0
  16. package/dist/chunk-E5K2XXQL.cjs.map +1 -0
  17. package/dist/chunk-FEXZ3X5C.cjs +255 -0
  18. package/dist/chunk-FEXZ3X5C.cjs.map +1 -0
  19. package/dist/chunk-JDPMZ572.js +466 -0
  20. package/dist/chunk-JDPMZ572.js.map +1 -0
  21. package/dist/chunk-JZVM4T2A.js +29 -0
  22. package/dist/chunk-JZVM4T2A.js.map +1 -0
  23. package/dist/chunk-KTQVRSDX.cjs +323 -0
  24. package/dist/chunk-KTQVRSDX.cjs.map +1 -0
  25. package/dist/chunk-M54H2ZJJ.js +252 -0
  26. package/dist/chunk-M54H2ZJJ.js.map +1 -0
  27. package/dist/chunk-NCSI7C7I.js +561 -0
  28. package/dist/chunk-NCSI7C7I.js.map +1 -0
  29. package/dist/chunk-OC7WDISK.js +343 -0
  30. package/dist/chunk-OC7WDISK.js.map +1 -0
  31. package/dist/chunk-UC43JQYK.cjs +346 -0
  32. package/dist/chunk-UC43JQYK.cjs.map +1 -0
  33. package/dist/chunk-UFC4ODW5.js +587 -0
  34. package/dist/chunk-UFC4ODW5.js.map +1 -0
  35. package/dist/chunk-UKWBCC7E.cjs +567 -0
  36. package/dist/chunk-UKWBCC7E.cjs.map +1 -0
  37. package/dist/claude-code/index.cjs +19 -0
  38. package/dist/claude-code/index.cjs.map +1 -0
  39. package/dist/claude-code/index.d.cts +6 -0
  40. package/dist/claude-code/index.d.ts +6 -0
  41. package/dist/claude-code/index.js +4 -0
  42. package/dist/claude-code/index.js.map +1 -0
  43. package/dist/cursor/index.cjs +19 -0
  44. package/dist/cursor/index.cjs.map +1 -0
  45. package/dist/cursor/index.d.cts +6 -0
  46. package/dist/cursor/index.d.ts +6 -0
  47. package/dist/cursor/index.js +4 -0
  48. package/dist/cursor/index.js.map +1 -0
  49. package/dist/discord/index.cjs +19 -0
  50. package/dist/discord/index.cjs.map +1 -0
  51. package/dist/discord/index.d.cts +6 -0
  52. package/dist/discord/index.d.ts +6 -0
  53. package/dist/discord/index.js +4 -0
  54. package/dist/discord/index.js.map +1 -0
  55. package/dist/imessage/index.cjs +20 -0
  56. package/dist/imessage/index.cjs.map +1 -0
  57. package/dist/imessage/index.d.cts +6 -0
  58. package/dist/imessage/index.d.ts +6 -0
  59. package/dist/imessage/index.js +5 -0
  60. package/dist/imessage/index.js.map +1 -0
  61. package/dist/index.cjs +52 -2664
  62. package/dist/index.cjs.map +1 -1
  63. package/dist/index.d.cts +49 -27
  64. package/dist/index.d.ts +49 -27
  65. package/dist/index.js +20 -2656
  66. package/dist/index.js.map +1 -1
  67. package/dist/messages-macos/index.cjs +20 -0
  68. package/dist/messages-macos/index.cjs.map +1 -0
  69. package/dist/messages-macos/index.d.cts +10 -0
  70. package/dist/messages-macos/index.d.ts +10 -0
  71. package/dist/messages-macos/index.js +5 -0
  72. package/dist/messages-macos/index.js.map +1 -0
  73. package/dist/slack/index.cjs +19 -0
  74. package/dist/slack/index.cjs.map +1 -0
  75. package/dist/slack/index.d.cts +6 -0
  76. package/dist/slack/index.d.ts +6 -0
  77. package/dist/slack/index.js +4 -0
  78. package/dist/slack/index.js.map +1 -0
  79. package/dist/telegram/index.cjs +19 -0
  80. package/dist/telegram/index.cjs.map +1 -0
  81. package/dist/telegram/index.d.cts +6 -0
  82. package/dist/telegram/index.d.ts +6 -0
  83. package/dist/telegram/index.js +4 -0
  84. package/dist/telegram/index.js.map +1 -0
  85. package/dist/whatsapp/index.cjs +19 -0
  86. package/dist/whatsapp/index.cjs.map +1 -0
  87. package/dist/whatsapp/index.d.cts +6 -0
  88. package/dist/whatsapp/index.d.ts +6 -0
  89. package/dist/whatsapp/index.js +4 -0
  90. package/dist/whatsapp/index.js.map +1 -0
  91. package/package.json +49 -5
@@ -0,0 +1,718 @@
1
+ "use client";
2
+ import { z } from 'zod';
3
+ import { defineSkin, MessageContent, fadeSlideIn, popIn } from '@typecaast/skin-kit';
4
+ import { useState } from 'react';
5
+ import { jsx, jsxs } from 'react/jsx-runtime';
6
+
7
+ // src/telegram/index.ts
8
+
9
+ // src/telegram/tokens.ts
10
+ var TELEGRAM_COLORS = {
11
+ light: {
12
+ bg: "#d5e3f0",
13
+ headerBg: "#ffffff",
14
+ headerText: "#000000",
15
+ headerSubtle: "#3390ec",
16
+ subtle: "#a1aab3",
17
+ link: "#3390ec",
18
+ mentionText: "#3390ec",
19
+ nameColor: "#3390ec",
20
+ incomingBg: "#ffffff",
21
+ incomingText: "#000000",
22
+ incomingMeta: "#a1aab3",
23
+ outgoingBg: "#effdde",
24
+ outgoingText: "#000000",
25
+ outgoingMeta: "#5fb15a",
26
+ tick: "#5fb15a",
27
+ reactionBg: "#e8f3ff",
28
+ reactionText: "#3390ec",
29
+ composerBg: "#ffffff",
30
+ composerFieldBg: "#ffffff",
31
+ composerBorder: "#e3e8ec",
32
+ placeholder: "#a1aab3",
33
+ accent: "#3390ec",
34
+ accentText: "#ffffff",
35
+ buttonBg: "rgba(51,144,236,0.10)",
36
+ buttonText: "#3390ec",
37
+ systemBg: "rgba(0,0,0,0.26)",
38
+ systemText: "#ffffff",
39
+ shadow: "0 1px 0.5px rgba(0,0,0,0.13)"
40
+ },
41
+ dark: {
42
+ bg: "#0e1621",
43
+ headerBg: "#17212b",
44
+ headerText: "#ffffff",
45
+ headerSubtle: "#6cb7eb",
46
+ subtle: "#6d7f8f",
47
+ link: "#62bcf9",
48
+ mentionText: "#62bcf9",
49
+ nameColor: "#62bcf9",
50
+ incomingBg: "#182533",
51
+ incomingText: "#ffffff",
52
+ incomingMeta: "#6d7f8f",
53
+ outgoingBg: "#2b5278",
54
+ outgoingText: "#ffffff",
55
+ outgoingMeta: "#8badd6",
56
+ tick: "#72d5fd",
57
+ reactionBg: "#213040",
58
+ reactionText: "#62bcf9",
59
+ composerBg: "#17212b",
60
+ composerFieldBg: "#17212b",
61
+ composerBorder: "#101921",
62
+ placeholder: "#6d7f8f",
63
+ accent: "#3390ec",
64
+ accentText: "#ffffff",
65
+ buttonBg: "rgba(98,188,249,0.12)",
66
+ buttonText: "#62bcf9",
67
+ systemBg: "rgba(0,0,0,0.4)",
68
+ systemText: "#ffffff",
69
+ shadow: "0 1px 2px rgba(0,0,0,0.35)"
70
+ }
71
+ };
72
+ var telegramTokens = {
73
+ light: {
74
+ colors: TELEGRAM_COLORS.light
75
+ },
76
+ dark: { colors: TELEGRAM_COLORS.dark }
77
+ };
78
+
79
+ // src/telegram/fonts.ts
80
+ var telegramFonts = [
81
+ {
82
+ family: "Roboto",
83
+ intended: "system-ui / Roboto",
84
+ weights: [400, 500, 700],
85
+ sources: [
86
+ {
87
+ url: "https://fonts.gstatic.com/s/roboto/v32/KFOmCnqEu92Fr1Mu4mxK.woff2",
88
+ weight: 400,
89
+ format: "woff2"
90
+ },
91
+ {
92
+ url: "https://fonts.gstatic.com/s/roboto/v32/KFOlCnqEu92Fr1MmEU9fBBc-.woff2",
93
+ weight: 500,
94
+ format: "woff2"
95
+ },
96
+ {
97
+ url: "https://fonts.gstatic.com/s/roboto/v32/KFOlCnqEu92Fr1MmWUlfBBc-.woff2",
98
+ weight: 700,
99
+ format: "woff2"
100
+ }
101
+ ]
102
+ }
103
+ ];
104
+ var TELEGRAM_FONT_STACK = 'Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif';
105
+ var AVATAR_SIZE = 34;
106
+ var BUBBLE_RADIUS = 12;
107
+ var TAIL_RADIUS = 6;
108
+ function joinNames(names) {
109
+ if (names.length <= 1) return names[0] ?? "";
110
+ if (names.length === 2) return `${names[0]} and ${names[1]}`;
111
+ return `${names.slice(0, -1).join(", ")} and ${names[names.length - 1]}`;
112
+ }
113
+ function formatTime(atMs) {
114
+ const base = 9 * 3600 * 1e3;
115
+ const total = Math.floor((base + atMs) / 1e3);
116
+ const h = Math.floor(total / 3600) % 24;
117
+ const m = Math.floor(total % 3600 / 60);
118
+ const ampm = h >= 12 ? "PM" : "AM";
119
+ const hr = h % 12 === 0 ? 12 : h % 12;
120
+ return `${hr}:${String(m).padStart(2, "0")} ${ampm}`;
121
+ }
122
+ function initials(name) {
123
+ return name.split(/\s+/).map((w) => w.charAt(0)).slice(0, 2).join("").toUpperCase();
124
+ }
125
+ function markStyles(c) {
126
+ return {
127
+ link: { color: c.link, textDecoration: "none" },
128
+ mention: { color: c.mentionText, fontWeight: 500 },
129
+ code: {
130
+ fontFamily: "Menlo, Monaco, Consolas, monospace",
131
+ fontSize: "0.9em"
132
+ }
133
+ };
134
+ }
135
+ var Avatar = ({
136
+ theme,
137
+ participant,
138
+ size = AVATAR_SIZE
139
+ }) => {
140
+ if (participant.avatar) {
141
+ return /* @__PURE__ */ jsx(
142
+ "img",
143
+ {
144
+ src: participant.avatar,
145
+ alt: participant.name,
146
+ width: size,
147
+ height: size,
148
+ style: {
149
+ width: size,
150
+ height: size,
151
+ borderRadius: "50%",
152
+ objectFit: "cover",
153
+ display: "block"
154
+ }
155
+ }
156
+ );
157
+ }
158
+ return /* @__PURE__ */ jsx(
159
+ "div",
160
+ {
161
+ "aria-label": participant.name,
162
+ style: {
163
+ width: size,
164
+ height: size,
165
+ borderRadius: "50%",
166
+ background: participant.color ?? "#3390ec",
167
+ color: "#ffffff",
168
+ display: "flex",
169
+ alignItems: "center",
170
+ justifyContent: "center",
171
+ fontWeight: 600,
172
+ fontSize: size * 0.4
173
+ },
174
+ children: initials(participant.name)
175
+ }
176
+ );
177
+ };
178
+ var ReactionTooltip = ({ names }) => /* @__PURE__ */ jsx(
179
+ "span",
180
+ {
181
+ role: "tooltip",
182
+ style: {
183
+ position: "absolute",
184
+ bottom: "calc(100% + 6px)",
185
+ left: "50%",
186
+ transform: "translateX(-50%)",
187
+ zIndex: 20,
188
+ whiteSpace: "nowrap",
189
+ background: "rgba(0,0,0,0.82)",
190
+ color: "#fff",
191
+ borderRadius: 8,
192
+ padding: "5px 9px",
193
+ fontSize: 12,
194
+ boxShadow: "0 4px 14px rgba(0,0,0,0.4)",
195
+ pointerEvents: "none"
196
+ },
197
+ children: joinNames(names)
198
+ }
199
+ );
200
+ var Reaction = ({ theme, reaction }) => {
201
+ const c = TELEGRAM_COLORS[theme];
202
+ const [hover, setHover] = useState(false);
203
+ const hasReactors = reaction.byNames.length > 0;
204
+ return /* @__PURE__ */ jsxs(
205
+ "span",
206
+ {
207
+ style: {
208
+ position: "relative",
209
+ display: "inline-flex",
210
+ ...popIn(reaction.progress)
211
+ },
212
+ onMouseEnter: () => setHover(true),
213
+ onMouseLeave: () => setHover(false),
214
+ children: [
215
+ /* @__PURE__ */ jsxs(
216
+ "span",
217
+ {
218
+ style: {
219
+ display: "inline-flex",
220
+ alignItems: "center",
221
+ gap: 3,
222
+ background: c.reactionBg,
223
+ color: c.reactionText,
224
+ borderRadius: 12,
225
+ padding: "2px 8px",
226
+ height: 22,
227
+ fontSize: 12.5,
228
+ fontWeight: 600,
229
+ cursor: hasReactors ? "pointer" : "default"
230
+ },
231
+ children: [
232
+ /* @__PURE__ */ jsx("span", { style: { fontSize: 13 }, children: reaction.emoji }),
233
+ /* @__PURE__ */ jsx("span", { style: { fontVariantNumeric: "tabular-nums" }, children: reaction.count })
234
+ ]
235
+ }
236
+ ),
237
+ hover && hasReactors ? /* @__PURE__ */ jsx(ReactionTooltip, { names: reaction.byNames }) : null
238
+ ]
239
+ }
240
+ );
241
+ };
242
+ var Dot = ({ c, delay }) => /* @__PURE__ */ jsx(
243
+ "span",
244
+ {
245
+ style: {
246
+ width: 5,
247
+ height: 5,
248
+ borderRadius: "50%",
249
+ background: c.headerSubtle,
250
+ display: "inline-block",
251
+ animation: `tc-tg-typing 1.2s ${delay}ms infinite ease-in-out`
252
+ }
253
+ }
254
+ );
255
+ var TypingIndicator = ({ theme, author }) => {
256
+ const c = TELEGRAM_COLORS[theme];
257
+ return /* @__PURE__ */ jsxs(
258
+ "div",
259
+ {
260
+ style: {
261
+ display: "flex",
262
+ alignItems: "flex-end",
263
+ gap: 8,
264
+ padding: "2px 12px 4px"
265
+ },
266
+ children: [
267
+ /* @__PURE__ */ jsx("div", { style: { width: AVATAR_SIZE, flex: "0 0 auto" }, children: /* @__PURE__ */ jsx(Avatar, { theme, participant: author }) }),
268
+ /* @__PURE__ */ jsxs(
269
+ "div",
270
+ {
271
+ style: {
272
+ display: "inline-flex",
273
+ alignItems: "center",
274
+ gap: 4,
275
+ background: c.incomingBg,
276
+ borderRadius: `${BUBBLE_RADIUS}px ${BUBBLE_RADIUS}px ${BUBBLE_RADIUS}px ${TAIL_RADIUS}px`,
277
+ padding: "10px 12px",
278
+ boxShadow: c.shadow
279
+ },
280
+ children: [
281
+ /* @__PURE__ */ jsx("style", { children: "@keyframes tc-tg-typing{0%,80%,100%{opacity:.3;transform:translateY(0)}40%{opacity:1;transform:translateY(-2px)}}" }),
282
+ /* @__PURE__ */ jsx(Dot, { c, delay: 0 }),
283
+ /* @__PURE__ */ jsx(Dot, { c, delay: 160 }),
284
+ /* @__PURE__ */ jsx(Dot, { c, delay: 320 })
285
+ ]
286
+ }
287
+ )
288
+ ]
289
+ }
290
+ );
291
+ };
292
+ var Caret = ({ color }) => /* @__PURE__ */ jsx(
293
+ "span",
294
+ {
295
+ style: {
296
+ display: "inline-block",
297
+ width: 1.5,
298
+ height: "1.05em",
299
+ background: color,
300
+ marginLeft: 1,
301
+ verticalAlign: "text-bottom"
302
+ }
303
+ }
304
+ );
305
+ var PaperPlane = ({ color }) => /* @__PURE__ */ jsx(
306
+ "svg",
307
+ {
308
+ width: "20",
309
+ height: "20",
310
+ viewBox: "0 0 24 24",
311
+ fill: color,
312
+ "aria-hidden": "true",
313
+ children: /* @__PURE__ */ jsx("path", { d: "M2.5 12 21 3.5 17 21l-5.2-4.6L9 20l-.6-5.1L2.5 12Z" })
314
+ }
315
+ );
316
+ var Composer = ({ theme, composer }) => {
317
+ const c = TELEGRAM_COLORS[theme];
318
+ const hasText = composer.text.length > 0;
319
+ return /* @__PURE__ */ jsxs(
320
+ "div",
321
+ {
322
+ style: {
323
+ flex: "0 0 auto",
324
+ display: "flex",
325
+ alignItems: "flex-end",
326
+ gap: 8,
327
+ padding: "8px 10px 12px",
328
+ background: c.composerBg
329
+ },
330
+ children: [
331
+ /* @__PURE__ */ jsx(
332
+ "div",
333
+ {
334
+ style: {
335
+ flex: 1,
336
+ minWidth: 0,
337
+ border: `1px solid ${c.composerBorder}`,
338
+ borderRadius: 18,
339
+ background: c.composerFieldBg,
340
+ padding: "9px 14px",
341
+ minHeight: 20,
342
+ fontSize: 15,
343
+ color: c.incomingText,
344
+ boxShadow: c.shadow
345
+ },
346
+ children: hasText ? /* @__PURE__ */ jsxs("span", { children: [
347
+ composer.text,
348
+ /* @__PURE__ */ jsx(Caret, { color: c.accent })
349
+ ] }) : /* @__PURE__ */ jsx("span", { style: { color: c.placeholder }, children: "Message" })
350
+ }
351
+ ),
352
+ /* @__PURE__ */ jsx(
353
+ "div",
354
+ {
355
+ style: {
356
+ flex: "0 0 auto",
357
+ width: 38,
358
+ height: 38,
359
+ borderRadius: "50%",
360
+ background: hasText ? c.accent : "transparent",
361
+ display: "flex",
362
+ alignItems: "center",
363
+ justifyContent: "center"
364
+ },
365
+ children: /* @__PURE__ */ jsx(PaperPlane, { color: hasText ? c.accentText : c.placeholder })
366
+ }
367
+ )
368
+ ]
369
+ }
370
+ );
371
+ };
372
+ var Meta = ({
373
+ c,
374
+ atMs,
375
+ outgoing
376
+ }) => /* @__PURE__ */ jsxs(
377
+ "span",
378
+ {
379
+ style: {
380
+ display: "inline-flex",
381
+ alignItems: "center",
382
+ gap: 3,
383
+ fontSize: 11,
384
+ lineHeight: 1,
385
+ color: outgoing ? c.outgoingMeta : c.incomingMeta,
386
+ float: "right",
387
+ marginLeft: 8,
388
+ marginTop: 6,
389
+ position: "relative",
390
+ top: 4
391
+ },
392
+ children: [
393
+ formatTime(atMs),
394
+ outgoing ? /* @__PURE__ */ jsx("span", { style: { color: c.tick }, children: "\u2713\u2713" }) : null
395
+ ]
396
+ }
397
+ );
398
+ var Message = ({ theme, message, author }) => {
399
+ const c = TELEGRAM_COLORS[theme];
400
+ const outgoing = message.isSelf;
401
+ const grouped = message.isGrouped;
402
+ const radius = outgoing ? `${BUBBLE_RADIUS}px ${BUBBLE_RADIUS}px ${grouped ? BUBBLE_RADIUS : TAIL_RADIUS}px ${BUBBLE_RADIUS}px` : `${BUBBLE_RADIUS}px ${BUBBLE_RADIUS}px ${BUBBLE_RADIUS}px ${grouped ? BUBBLE_RADIUS : TAIL_RADIUS}px`;
403
+ return /* @__PURE__ */ jsxs(
404
+ "div",
405
+ {
406
+ style: {
407
+ display: "flex",
408
+ flexDirection: outgoing ? "row-reverse" : "row",
409
+ alignItems: "flex-end",
410
+ gap: 8,
411
+ padding: grouped ? "1px 12px" : "3px 12px 1px",
412
+ ...fadeSlideIn(message.revealProgress)
413
+ },
414
+ children: [
415
+ outgoing ? null : /* @__PURE__ */ jsx("div", { style: { width: AVATAR_SIZE, flex: "0 0 auto" }, children: grouped ? null : /* @__PURE__ */ jsx(Avatar, { theme, participant: author }) }),
416
+ /* @__PURE__ */ jsxs(
417
+ "div",
418
+ {
419
+ style: { maxWidth: "78%", display: "flex", flexDirection: "column" },
420
+ children: [
421
+ /* @__PURE__ */ jsxs(
422
+ "div",
423
+ {
424
+ style: {
425
+ background: outgoing ? c.outgoingBg : c.incomingBg,
426
+ color: outgoing ? c.outgoingText : c.incomingText,
427
+ borderRadius: radius,
428
+ padding: "6px 10px 7px",
429
+ boxShadow: c.shadow,
430
+ wordBreak: "break-word",
431
+ fontSize: 15,
432
+ lineHeight: 1.35
433
+ },
434
+ children: [
435
+ !outgoing && !grouped ? /* @__PURE__ */ jsx(
436
+ "div",
437
+ {
438
+ style: {
439
+ color: author.color ?? c.nameColor,
440
+ fontWeight: 600,
441
+ fontSize: 13.5,
442
+ marginBottom: 2
443
+ },
444
+ children: author.name
445
+ }
446
+ ) : null,
447
+ /* @__PURE__ */ jsx(
448
+ MessageContent,
449
+ {
450
+ nodes: message.content,
451
+ styles: markStyles(c),
452
+ imageStyle: { borderRadius: 8, marginTop: 2, maxWidth: 320 }
453
+ }
454
+ ),
455
+ /* @__PURE__ */ jsx(Meta, { c, atMs: message.atMs, outgoing })
456
+ ]
457
+ }
458
+ ),
459
+ message.reactions.length > 0 ? /* @__PURE__ */ jsx(
460
+ "div",
461
+ {
462
+ style: {
463
+ display: "flex",
464
+ gap: 4,
465
+ marginTop: 4,
466
+ flexWrap: "wrap",
467
+ justifyContent: outgoing ? "flex-end" : "flex-start"
468
+ },
469
+ children: message.reactions.map((r, i) => /* @__PURE__ */ jsx(Reaction, { theme, reaction: r }, i))
470
+ }
471
+ ) : null
472
+ ]
473
+ }
474
+ )
475
+ ]
476
+ }
477
+ );
478
+ };
479
+ var SystemMessage = ({ theme, message, author }) => {
480
+ const c = TELEGRAM_COLORS[theme];
481
+ const actions = message.system?.actions ?? [];
482
+ return /* @__PURE__ */ jsxs(
483
+ "div",
484
+ {
485
+ style: {
486
+ display: "flex",
487
+ alignItems: "flex-end",
488
+ gap: 8,
489
+ padding: "3px 12px 1px",
490
+ ...fadeSlideIn(message.revealProgress)
491
+ },
492
+ children: [
493
+ /* @__PURE__ */ jsx("div", { style: { width: AVATAR_SIZE, flex: "0 0 auto" }, children: author ? /* @__PURE__ */ jsx(Avatar, { theme, participant: author }) : null }),
494
+ /* @__PURE__ */ jsxs(
495
+ "div",
496
+ {
497
+ style: { maxWidth: "78%", display: "flex", flexDirection: "column" },
498
+ children: [
499
+ /* @__PURE__ */ jsxs(
500
+ "div",
501
+ {
502
+ style: {
503
+ background: c.incomingBg,
504
+ color: c.incomingText,
505
+ borderRadius: `${BUBBLE_RADIUS}px ${BUBBLE_RADIUS}px ${BUBBLE_RADIUS}px ${TAIL_RADIUS}px`,
506
+ padding: "6px 10px 7px",
507
+ boxShadow: c.shadow,
508
+ fontSize: 15,
509
+ lineHeight: 1.35
510
+ },
511
+ children: [
512
+ /* @__PURE__ */ jsx(
513
+ "div",
514
+ {
515
+ style: {
516
+ color: author?.color ?? c.nameColor,
517
+ fontWeight: 600,
518
+ fontSize: 13.5,
519
+ marginBottom: 2
520
+ },
521
+ children: author?.name ?? "Bot"
522
+ }
523
+ ),
524
+ /* @__PURE__ */ jsx(MessageContent, { nodes: message.content, styles: markStyles(c) }),
525
+ /* @__PURE__ */ jsx(Meta, { c, atMs: message.atMs, outgoing: false })
526
+ ]
527
+ }
528
+ ),
529
+ actions.length > 0 ? /* @__PURE__ */ jsx(
530
+ "div",
531
+ {
532
+ style: {
533
+ display: "flex",
534
+ flexDirection: "column",
535
+ gap: 3,
536
+ marginTop: 4
537
+ },
538
+ children: actions.map((a, i) => /* @__PURE__ */ jsx(
539
+ "div",
540
+ {
541
+ style: {
542
+ background: c.buttonBg,
543
+ color: c.buttonText,
544
+ borderRadius: 8,
545
+ padding: "9px 12px",
546
+ textAlign: "center",
547
+ fontSize: 14,
548
+ fontWeight: 500,
549
+ cursor: "default"
550
+ },
551
+ children: a.label
552
+ },
553
+ i
554
+ ))
555
+ }
556
+ ) : null
557
+ ]
558
+ }
559
+ )
560
+ ]
561
+ }
562
+ );
563
+ };
564
+ var Frame = ({
565
+ theme,
566
+ options,
567
+ children
568
+ }) => {
569
+ const c = TELEGRAM_COLORS[theme];
570
+ const title = typeof options?.title === "string" && options.title || typeof options?.contact === "string" && options.contact || "Group chat";
571
+ const status = typeof options?.status === "string" && options.status ? options.status : "online";
572
+ return /* @__PURE__ */ jsxs(
573
+ "div",
574
+ {
575
+ style: {
576
+ fontFamily: TELEGRAM_FONT_STACK,
577
+ background: c.bg,
578
+ color: c.incomingText,
579
+ display: "flex",
580
+ flexDirection: "column",
581
+ height: "100%",
582
+ width: "100%",
583
+ fontSize: 15,
584
+ WebkitFontSmoothing: "antialiased"
585
+ },
586
+ children: [
587
+ /* @__PURE__ */ jsxs(
588
+ "header",
589
+ {
590
+ style: {
591
+ flex: "0 0 auto",
592
+ padding: "9px 14px",
593
+ background: c.headerBg,
594
+ borderBottom: `1px solid ${c.composerBorder}`,
595
+ display: "flex",
596
+ alignItems: "center",
597
+ gap: 12
598
+ },
599
+ children: [
600
+ /* @__PURE__ */ jsx("span", { style: { color: c.headerSubtle, fontSize: 22, lineHeight: 1 }, children: "\u2039" }),
601
+ /* @__PURE__ */ jsxs("div", { style: { flex: 1, minWidth: 0 }, children: [
602
+ /* @__PURE__ */ jsx(
603
+ "div",
604
+ {
605
+ style: {
606
+ fontWeight: 600,
607
+ fontSize: 15,
608
+ color: c.headerText,
609
+ overflow: "hidden",
610
+ textOverflow: "ellipsis",
611
+ whiteSpace: "nowrap"
612
+ },
613
+ children: title
614
+ }
615
+ ),
616
+ /* @__PURE__ */ jsx("div", { style: { fontSize: 12.5, color: c.headerSubtle }, children: status })
617
+ ] }),
618
+ /* @__PURE__ */ jsx(
619
+ "div",
620
+ {
621
+ style: {
622
+ width: 36,
623
+ height: 36,
624
+ borderRadius: "50%",
625
+ background: c.accent,
626
+ color: "#fff",
627
+ display: "flex",
628
+ alignItems: "center",
629
+ justifyContent: "center",
630
+ fontWeight: 600,
631
+ fontSize: 14
632
+ },
633
+ children: initials(title)
634
+ }
635
+ )
636
+ ]
637
+ }
638
+ ),
639
+ /* @__PURE__ */ jsx(
640
+ "div",
641
+ {
642
+ style: {
643
+ flex: "1 1 auto",
644
+ minHeight: 0,
645
+ display: "flex",
646
+ flexDirection: "column",
647
+ paddingBottom: 6
648
+ },
649
+ children
650
+ }
651
+ )
652
+ ]
653
+ }
654
+ );
655
+ };
656
+ var telegramComponents = {
657
+ Frame,
658
+ Message,
659
+ TypingIndicator,
660
+ Reaction,
661
+ Composer,
662
+ SystemMessage,
663
+ Avatar
664
+ };
665
+
666
+ // src/telegram/capabilities.ts
667
+ var telegramCapabilities = {
668
+ events: {
669
+ message: "native",
670
+ reaction: "native",
671
+ typing: "native",
672
+ // "X is typing…" (rendered in-thread)
673
+ composerType: "native",
674
+ send: "native",
675
+ edit: "native",
676
+ delete: "native",
677
+ readReceipt: "unsupported",
678
+ // shown as double-ticks on the bubble, not a step
679
+ system: "native",
680
+ // bot message + inline keyboard
681
+ beat: "native"
682
+ },
683
+ content: {
684
+ text: true,
685
+ image: true
686
+ },
687
+ reactions: true,
688
+ threads: false,
689
+ readReceipts: false
690
+ };
691
+
692
+ // src/telegram/index.ts
693
+ var telegramOptionsSchema = z.object({
694
+ /** Chat title shown in the header (e.g. `"PostHog team"`). */
695
+ title: z.string().optional(),
696
+ /** Alias for the title (matches other contact-style skins). */
697
+ contact: z.string().optional(),
698
+ /** Header subtitle, e.g. `"online"` or `"last seen recently"`. */
699
+ status: z.string().optional()
700
+ });
701
+ var telegram = defineSkin({
702
+ id: "telegram",
703
+ meta: {
704
+ name: "Telegram",
705
+ defaultCanvas: { width: 440, height: 780 },
706
+ supportsThemes: ["light", "dark"],
707
+ capabilities: telegramCapabilities,
708
+ optionsSchema: telegramOptionsSchema,
709
+ fonts: telegramFonts
710
+ },
711
+ components: telegramComponents,
712
+ tokens: telegramTokens
713
+ });
714
+ var telegram_default = telegram;
715
+
716
+ export { TELEGRAM_COLORS, telegram, telegram_default };
717
+ //# sourceMappingURL=chunk-7IC3DRCQ.js.map
718
+ //# sourceMappingURL=chunk-7IC3DRCQ.js.map