@molecule/app-author-bio-card-angular 0.0.0-stage → 1.1.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.
@@ -0,0 +1,528 @@
1
+ /**
2
+ * AuthorBioCard component (React parity).
3
+ *
4
+ * @module
5
+ */
6
+ import { Component } from '@angular/core';
7
+ import { useTranslation } from '@molecule/app-angular';
8
+ import { getClassMap } from '@molecule/app-ui';
9
+ import { Avatar, Button } from '@molecule/app-ui-angular';
10
+ import * as i0 from "@angular/core";
11
+ const _forTrack0 = ($index, $item) => $item[0];
12
+ function AuthorBioCard_Conditional_0_Conditional_5_Template(rf, ctx) { if (rf & 1) {
13
+ i0.ɵɵelementStart(0, "a", 4);
14
+ i0.ɵɵtext(1);
15
+ i0.ɵɵelementEnd();
16
+ } if (rf & 2) {
17
+ const ctx_r0 = i0.ɵɵnextContext(2);
18
+ i0.ɵɵclassMap(ctx_r0.nameClasses());
19
+ i0.ɵɵproperty("href", ctx_r0.author.href, i0.ɵɵsanitizeUrl);
20
+ i0.ɵɵattribute("data-mol-id", ctx_r0.id("name"));
21
+ i0.ɵɵadvance();
22
+ i0.ɵɵtextInterpolate(ctx_r0.author.name);
23
+ } }
24
+ function AuthorBioCard_Conditional_0_Conditional_6_Template(rf, ctx) { if (rf & 1) {
25
+ i0.ɵɵelementStart(0, "span");
26
+ i0.ɵɵtext(1);
27
+ i0.ɵɵelementEnd();
28
+ } if (rf & 2) {
29
+ const ctx_r0 = i0.ɵɵnextContext(2);
30
+ i0.ɵɵclassMap(ctx_r0.nameClasses());
31
+ i0.ɵɵattribute("data-mol-id", ctx_r0.id("name"));
32
+ i0.ɵɵadvance();
33
+ i0.ɵɵtextInterpolate(ctx_r0.author?.name);
34
+ } }
35
+ function AuthorBioCard_Conditional_0_Conditional_7_Template(rf, ctx) { if (rf & 1) {
36
+ i0.ɵɵelementStart(0, "p");
37
+ i0.ɵɵtext(1);
38
+ i0.ɵɵelementEnd();
39
+ } if (rf & 2) {
40
+ const ctx_r0 = i0.ɵɵnextContext(2);
41
+ i0.ɵɵclassMap(ctx_r0.bioClasses());
42
+ i0.ɵɵattribute("data-mol-id", ctx_r0.id("bio"));
43
+ i0.ɵɵadvance();
44
+ i0.ɵɵtextInterpolate(ctx_r0.author.bio);
45
+ } }
46
+ function AuthorBioCard_Conditional_0_Conditional_9_For_2_Template(rf, ctx) { if (rf & 1) {
47
+ i0.ɵɵelementStart(0, "a", 6);
48
+ i0.ɵɵtext(1);
49
+ i0.ɵɵelementEnd();
50
+ } if (rf & 2) {
51
+ const entry_r2 = ctx.$implicit;
52
+ const ctx_r0 = i0.ɵɵnextContext(3);
53
+ i0.ɵɵclassMap(ctx_r0.socialLinkClasses());
54
+ i0.ɵɵproperty("href", ctx_r0.hrefOf(entry_r2), i0.ɵɵsanitizeUrl);
55
+ i0.ɵɵattribute("data-mol-id", ctx_r0.socialId(entry_r2[0]))("aria-label", ctx_r0.socialAriaLabel(entry_r2[0]));
56
+ i0.ɵɵadvance();
57
+ i0.ɵɵtextInterpolate(ctx_r0.socialText(entry_r2[0]));
58
+ } }
59
+ function AuthorBioCard_Conditional_0_Conditional_9_Template(rf, ctx) { if (rf & 1) {
60
+ i0.ɵɵelementStart(0, "div");
61
+ i0.ɵɵrepeaterCreate(1, AuthorBioCard_Conditional_0_Conditional_9_For_2_Template, 2, 6, "a", 5, _forTrack0);
62
+ i0.ɵɵelementEnd();
63
+ } if (rf & 2) {
64
+ const ctx_r0 = i0.ɵɵnextContext(2);
65
+ i0.ɵɵclassMap(ctx_r0.socialRowClasses());
66
+ i0.ɵɵattribute("data-mol-id", ctx_r0.id("socials"));
67
+ i0.ɵɵadvance();
68
+ i0.ɵɵrepeater(ctx_r0.socialEntries());
69
+ } }
70
+ function AuthorBioCard_Conditional_0_Conditional_10_Template(rf, ctx) { if (rf & 1) {
71
+ i0.ɵɵelement(0, "span");
72
+ } }
73
+ function AuthorBioCard_Conditional_0_Conditional_11_Template(rf, ctx) { if (rf & 1) {
74
+ const _r3 = i0.ɵɵgetCurrentView();
75
+ i0.ɵɵelementStart(0, "button", 7);
76
+ i0.ɵɵlistener("click", function AuthorBioCard_Conditional_0_Conditional_11_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r3); const ctx_r0 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r0.toggleFollow()); });
77
+ i0.ɵɵtext(1);
78
+ i0.ɵɵelementEnd();
79
+ } if (rf & 2) {
80
+ const ctx_r0 = i0.ɵɵnextContext(2);
81
+ i0.ɵɵproperty("variant", ctx_r0.following ? "outline" : "solid")("color", "primary")("size", "sm");
82
+ i0.ɵɵattribute("data-mol-id", ctx_r0.id("follow"))("aria-pressed", ctx_r0.following ? "true" : "false");
83
+ i0.ɵɵadvance();
84
+ i0.ɵɵtextInterpolate(ctx_r0.followLabel());
85
+ } }
86
+ function AuthorBioCard_Conditional_0_Template(rf, ctx) { if (rf & 1) {
87
+ i0.ɵɵelementStart(0, "div")(1, "div");
88
+ i0.ɵɵelement(2, "div", 1);
89
+ i0.ɵɵelementEnd();
90
+ i0.ɵɵelementStart(3, "div")(4, "header");
91
+ i0.ɵɵconditionalCreate(5, AuthorBioCard_Conditional_0_Conditional_5_Template, 2, 5, "a", 2)(6, AuthorBioCard_Conditional_0_Conditional_6_Template, 2, 4, "span", 0);
92
+ i0.ɵɵelementEnd();
93
+ i0.ɵɵconditionalCreate(7, AuthorBioCard_Conditional_0_Conditional_7_Template, 2, 4, "p", 0);
94
+ i0.ɵɵelementStart(8, "div");
95
+ i0.ɵɵconditionalCreate(9, AuthorBioCard_Conditional_0_Conditional_9_Template, 3, 3, "div", 0)(10, AuthorBioCard_Conditional_0_Conditional_10_Template, 1, 0, "span");
96
+ i0.ɵɵconditionalCreate(11, AuthorBioCard_Conditional_0_Conditional_11_Template, 2, 6, "button", 3);
97
+ i0.ɵɵelementEnd()()();
98
+ } if (rf & 2) {
99
+ const ctx_r0 = i0.ɵɵnextContext();
100
+ i0.ɵɵclassMap(ctx_r0.rowFullClasses());
101
+ i0.ɵɵadvance();
102
+ i0.ɵɵclassMap(ctx_r0.shrink0Classes());
103
+ i0.ɵɵadvance();
104
+ i0.ɵɵproperty("src", ctx_r0.author?.avatar)("alt", ctx_r0.author?.name)("name", ctx_r0.author?.name)("size", "lg");
105
+ i0.ɵɵadvance();
106
+ i0.ɵɵclassMap(ctx_r0.bodyFullClasses());
107
+ i0.ɵɵadvance();
108
+ i0.ɵɵclassMap(ctx_r0.baselineClasses());
109
+ i0.ɵɵadvance();
110
+ i0.ɵɵconditional(ctx_r0.author && ctx_r0.author.href ? 5 : 6);
111
+ i0.ɵɵadvance(2);
112
+ i0.ɵɵconditional(ctx_r0.author && ctx_r0.author.bio ? 7 : -1);
113
+ i0.ɵɵadvance();
114
+ i0.ɵɵclassMap(ctx_r0.betweenClasses());
115
+ i0.ɵɵadvance();
116
+ i0.ɵɵconditional(ctx_r0.socialEntries().length > 0 ? 9 : 10);
117
+ i0.ɵɵadvance(2);
118
+ i0.ɵɵconditional(ctx_r0.onFollow ? 11 : -1);
119
+ } }
120
+ function AuthorBioCard_Conditional_1_Conditional_5_Template(rf, ctx) { if (rf & 1) {
121
+ i0.ɵɵelementStart(0, "a", 4);
122
+ i0.ɵɵtext(1);
123
+ i0.ɵɵelementEnd();
124
+ } if (rf & 2) {
125
+ const ctx_r0 = i0.ɵɵnextContext(2);
126
+ i0.ɵɵclassMap(ctx_r0.nameClasses());
127
+ i0.ɵɵproperty("href", ctx_r0.author.href, i0.ɵɵsanitizeUrl);
128
+ i0.ɵɵattribute("data-mol-id", ctx_r0.id("name"));
129
+ i0.ɵɵadvance();
130
+ i0.ɵɵtextInterpolate(ctx_r0.author.name);
131
+ } }
132
+ function AuthorBioCard_Conditional_1_Conditional_6_Template(rf, ctx) { if (rf & 1) {
133
+ i0.ɵɵelementStart(0, "span");
134
+ i0.ɵɵtext(1);
135
+ i0.ɵɵelementEnd();
136
+ } if (rf & 2) {
137
+ const ctx_r0 = i0.ɵɵnextContext(2);
138
+ i0.ɵɵclassMap(ctx_r0.nameClasses());
139
+ i0.ɵɵattribute("data-mol-id", ctx_r0.id("name"));
140
+ i0.ɵɵadvance();
141
+ i0.ɵɵtextInterpolate(ctx_r0.author?.name);
142
+ } }
143
+ function AuthorBioCard_Conditional_1_Conditional_7_Template(rf, ctx) { if (rf & 1) {
144
+ i0.ɵɵelementStart(0, "p");
145
+ i0.ɵɵtext(1);
146
+ i0.ɵɵelementEnd();
147
+ } if (rf & 2) {
148
+ const ctx_r0 = i0.ɵɵnextContext(2);
149
+ i0.ɵɵclassMap(ctx_r0.bioClasses());
150
+ i0.ɵɵattribute("data-mol-id", ctx_r0.id("bio"));
151
+ i0.ɵɵadvance();
152
+ i0.ɵɵtextInterpolate(ctx_r0.author.bio);
153
+ } }
154
+ function AuthorBioCard_Conditional_1_Conditional_8_For_2_Template(rf, ctx) { if (rf & 1) {
155
+ i0.ɵɵelementStart(0, "a", 6);
156
+ i0.ɵɵtext(1);
157
+ i0.ɵɵelementEnd();
158
+ } if (rf & 2) {
159
+ const entry_r4 = ctx.$implicit;
160
+ const ctx_r0 = i0.ɵɵnextContext(3);
161
+ i0.ɵɵclassMap(ctx_r0.socialLinkClasses());
162
+ i0.ɵɵproperty("href", ctx_r0.hrefOf(entry_r4), i0.ɵɵsanitizeUrl);
163
+ i0.ɵɵattribute("data-mol-id", ctx_r0.socialId(entry_r4[0]))("aria-label", ctx_r0.socialAriaLabel(entry_r4[0]));
164
+ i0.ɵɵadvance();
165
+ i0.ɵɵtextInterpolate(ctx_r0.socialText(entry_r4[0]));
166
+ } }
167
+ function AuthorBioCard_Conditional_1_Conditional_8_Template(rf, ctx) { if (rf & 1) {
168
+ i0.ɵɵelementStart(0, "div");
169
+ i0.ɵɵrepeaterCreate(1, AuthorBioCard_Conditional_1_Conditional_8_For_2_Template, 2, 6, "a", 5, _forTrack0);
170
+ i0.ɵɵelementEnd();
171
+ } if (rf & 2) {
172
+ const ctx_r0 = i0.ɵɵnextContext(2);
173
+ i0.ɵɵclassMap(ctx_r0.socialRowClasses());
174
+ i0.ɵɵattribute("data-mol-id", ctx_r0.id("socials"));
175
+ i0.ɵɵadvance();
176
+ i0.ɵɵrepeater(ctx_r0.socialEntries());
177
+ } }
178
+ function AuthorBioCard_Conditional_1_Conditional_9_Template(rf, ctx) { if (rf & 1) {
179
+ const _r5 = i0.ɵɵgetCurrentView();
180
+ i0.ɵɵelementStart(0, "div")(1, "button", 7);
181
+ i0.ɵɵlistener("click", function AuthorBioCard_Conditional_1_Conditional_9_Template_button_click_1_listener() { i0.ɵɵrestoreView(_r5); const ctx_r0 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r0.toggleFollow()); });
182
+ i0.ɵɵtext(2);
183
+ i0.ɵɵelementEnd()();
184
+ } if (rf & 2) {
185
+ const ctx_r0 = i0.ɵɵnextContext(2);
186
+ i0.ɵɵclassMap(ctx_r0.shrink0Classes());
187
+ i0.ɵɵadvance();
188
+ i0.ɵɵproperty("variant", ctx_r0.following ? "outline" : "solid")("color", "primary")("size", "sm");
189
+ i0.ɵɵattribute("data-mol-id", ctx_r0.id("follow"))("aria-pressed", ctx_r0.following ? "true" : "false");
190
+ i0.ɵɵadvance();
191
+ i0.ɵɵtextInterpolate(ctx_r0.followLabel());
192
+ } }
193
+ function AuthorBioCard_Conditional_1_Template(rf, ctx) { if (rf & 1) {
194
+ i0.ɵɵelementStart(0, "div")(1, "div");
195
+ i0.ɵɵelement(2, "div", 1);
196
+ i0.ɵɵelementEnd();
197
+ i0.ɵɵelementStart(3, "div")(4, "div");
198
+ i0.ɵɵconditionalCreate(5, AuthorBioCard_Conditional_1_Conditional_5_Template, 2, 5, "a", 2)(6, AuthorBioCard_Conditional_1_Conditional_6_Template, 2, 4, "span", 0);
199
+ i0.ɵɵelementEnd();
200
+ i0.ɵɵconditionalCreate(7, AuthorBioCard_Conditional_1_Conditional_7_Template, 2, 4, "p", 0);
201
+ i0.ɵɵconditionalCreate(8, AuthorBioCard_Conditional_1_Conditional_8_Template, 3, 3, "div", 0);
202
+ i0.ɵɵelementEnd();
203
+ i0.ɵɵconditionalCreate(9, AuthorBioCard_Conditional_1_Conditional_9_Template, 3, 8, "div", 0);
204
+ i0.ɵɵelementEnd();
205
+ } if (rf & 2) {
206
+ const ctx_r0 = i0.ɵɵnextContext();
207
+ i0.ɵɵclassMap(ctx_r0.rowCompactClasses());
208
+ i0.ɵɵadvance();
209
+ i0.ɵɵclassMap(ctx_r0.shrink0Classes());
210
+ i0.ɵɵadvance();
211
+ i0.ɵɵproperty("src", ctx_r0.author?.avatar)("alt", ctx_r0.author?.name)("name", ctx_r0.author?.name)("size", "md");
212
+ i0.ɵɵadvance();
213
+ i0.ɵɵclassMap(ctx_r0.bodyCompactClasses());
214
+ i0.ɵɵadvance();
215
+ i0.ɵɵclassMap(ctx_r0.baselineClasses());
216
+ i0.ɵɵadvance();
217
+ i0.ɵɵconditional(ctx_r0.author && ctx_r0.author.href ? 5 : 6);
218
+ i0.ɵɵadvance(2);
219
+ i0.ɵɵconditional(ctx_r0.author && ctx_r0.author.bio ? 7 : -1);
220
+ i0.ɵɵadvance();
221
+ i0.ɵɵconditional(ctx_r0.socialEntries().length > 0 ? 8 : -1);
222
+ i0.ɵɵadvance();
223
+ i0.ɵɵconditional(ctx_r0.onFollow ? 9 : -1);
224
+ } }
225
+ const SOCIAL_KEYS = ['twitter', 'github', 'linkedin', 'mastodon', 'website'];
226
+ /**
227
+ * Resolve a social value (URL or bare handle) into an `href`. URLs pass
228
+ * through unchanged; bare handles are routed to a sensible per-platform
229
+ * default. Mastodon handles of the form `@user@instance` become
230
+ * `https://instance/@user`.
231
+ *
232
+ * @param key - Which platform the value is for.
233
+ * @param value - The raw social value (URL or handle).
234
+ * @returns A fully-qualified URL safe to use as `<a href>`.
235
+ */
236
+ export function resolveSocialHref(key, value) {
237
+ const trimmed = value.trim();
238
+ if (/^https?:\/\//i.test(trimmed))
239
+ return trimmed;
240
+ if (key === 'website')
241
+ return `https://${trimmed.replace(/^\/+/, '')}`;
242
+ const handle = trimmed.replace(/^@/, '');
243
+ if (key === 'twitter')
244
+ return `https://twitter.com/${handle}`;
245
+ if (key === 'github')
246
+ return `https://github.com/${handle}`;
247
+ if (key === 'linkedin')
248
+ return `https://www.linkedin.com/in/${handle}`;
249
+ if (key === 'mastodon') {
250
+ const parts = handle.split('@');
251
+ if (parts.length === 2)
252
+ return `https://${parts[1]}/@${parts[0]}`;
253
+ return `https://mastodon.social/@${handle}`;
254
+ }
255
+ return trimmed;
256
+ }
257
+ /**
258
+ * Author bio card — avatar + name + bio + social links + optional follow
259
+ * button. Designed for blog/podcast/video-streaming article footers and
260
+ * other user-profile previews. Two layouts:
261
+ *
262
+ * - `compact` (default): single horizontal row, suitable for inline
263
+ * author bylines or sidebar "About the author" panels.
264
+ * - `full`: stacked layout with a larger avatar and a dedicated social row
265
+ * beneath the bio paragraph.
266
+ *
267
+ * The host IS the Card `div` (`div[mol-author-bio-card]`), matching React's
268
+ * root exactly — same classes, same `data-mol-id`. All user-facing strings
269
+ * (Follow / Following labels, social aria-labels) route through
270
+ * `useTranslation()` so apps can override text via the companion locale bond
271
+ * `@molecule/app-locales-author-bio-card`.
272
+ *
273
+ * This is the Angular counterpart of `@molecule/app-author-bio-card-react`.
274
+ */
275
+ export class AuthorBioCard {
276
+ /** Author identity + bio + socials. */
277
+ author;
278
+ /** Layout preset: `compact` (default) or `full`. */
279
+ layout;
280
+ /** Whether the viewer currently follows this author. */
281
+ following;
282
+ /** Toggle handler for the follow button. Omit to hide the button entirely. */
283
+ onFollow;
284
+ /** Extra classes on the outer card. */
285
+ className;
286
+ /** `data-mol-id` for AI-agent selectors. Defaults to `author-bio-card`. */
287
+ dataMolId;
288
+ /** The i18n handle (locale-reactive), read in an injection context. */
289
+ i18n = useTranslation();
290
+ /**
291
+ * The current class map.
292
+ * @returns The UIClassMap.
293
+ */
294
+ cm() {
295
+ return getClassMap();
296
+ }
297
+ /**
298
+ * The `data-mol-id` on the card (React's default parameter).
299
+ * @returns The card's `data-mol-id`.
300
+ */
301
+ containerId() {
302
+ return this.dataMolId ?? 'author-bio-card';
303
+ }
304
+ /**
305
+ * A child `data-mol-id` (React's `${dataMolId}-<suffix>`).
306
+ * @param suffix - The child selector suffix.
307
+ * @returns The child's `data-mol-id`.
308
+ */
309
+ id(suffix) {
310
+ return `${this.containerId()}-${suffix}`;
311
+ }
312
+ /**
313
+ * The card class list (React's `<Card>` with its default variant/padding).
314
+ * @returns The class string.
315
+ */
316
+ classes() {
317
+ const cm = this.cm();
318
+ return cm.cn(cm.card({ variant: 'elevated' }), cm.cardPadding('md'), this.className);
319
+ }
320
+ /**
321
+ * A fixed-width wrapper (React's `cm.shrink0`).
322
+ * @returns The class string.
323
+ */
324
+ shrink0Classes() {
325
+ return this.cm().cn(this.cm().shrink0);
326
+ }
327
+ /**
328
+ * The compact row's class list (React's `cm.flex({ align: 'center', gap: 'md' })`).
329
+ * @returns The class string.
330
+ */
331
+ rowCompactClasses() {
332
+ return this.cm().flex({ align: 'center', gap: 'md' });
333
+ }
334
+ /**
335
+ * The full row's class list (React's `cm.flex({ align: 'start', gap: 'md' })`).
336
+ * @returns The class string.
337
+ */
338
+ rowFullClasses() {
339
+ return this.cm().flex({ align: 'start', gap: 'md' });
340
+ }
341
+ /**
342
+ * The compact body column (React's `cm.cn(cm.flex1, cm.stack(1))`).
343
+ * @returns The class string.
344
+ */
345
+ bodyCompactClasses() {
346
+ return this.cm().cn(this.cm().flex1, this.cm().stack(1));
347
+ }
348
+ /**
349
+ * The full body column (React's `cm.cn(cm.flex1, cm.stack(2))`).
350
+ * @returns The class string.
351
+ */
352
+ bodyFullClasses() {
353
+ return this.cm().cn(this.cm().flex1, this.cm().stack(2));
354
+ }
355
+ /**
356
+ * The name row (React's `cm.flex({ align: 'baseline', gap: 'sm', wrap: 'wrap' })`).
357
+ * @returns The class string.
358
+ */
359
+ baselineClasses() {
360
+ return this.cm().flex({ align: 'baseline', gap: 'sm', wrap: 'wrap' });
361
+ }
362
+ /**
363
+ * The full social/follow row (React's between-aligned flex row).
364
+ * @returns The class string.
365
+ */
366
+ betweenClasses() {
367
+ return this.cm().flex({ align: 'center', justify: 'between', gap: 'sm', wrap: 'wrap' });
368
+ }
369
+ /**
370
+ * The social row (React's `cm.flex({ align: 'center', gap: 'sm', wrap: 'wrap' })`).
371
+ * @returns The class string.
372
+ */
373
+ socialRowClasses() {
374
+ return this.cm().flex({ align: 'center', gap: 'sm', wrap: 'wrap' });
375
+ }
376
+ /**
377
+ * The social link (React's `cm.cn(cm.textSize('sm'), cm.fontWeight('medium'))`).
378
+ * @returns The class string.
379
+ */
380
+ socialLinkClasses() {
381
+ return this.cm().cn(this.cm().textSize('sm'), this.cm().fontWeight('medium'));
382
+ }
383
+ /**
384
+ * The author name (React's `cm.cn(cm.fontWeight('semibold'), cm.textSize('base'))`).
385
+ * @returns The class string.
386
+ */
387
+ nameClasses() {
388
+ return this.cm().cn(this.cm().fontWeight('semibold'), this.cm().textSize('base'));
389
+ }
390
+ /**
391
+ * The bio paragraph (React's `cm.textSize('sm')`).
392
+ * @returns The class string.
393
+ */
394
+ bioClasses() {
395
+ return this.cm().textSize('sm');
396
+ }
397
+ /**
398
+ * The translated follow-button label.
399
+ * @returns `Following` or `Follow`.
400
+ */
401
+ followLabel() {
402
+ return this.following
403
+ ? this.i18n.t('authorBioCard.following', {}, { defaultValue: 'Following' })
404
+ : this.i18n.t('authorBioCard.follow', {}, { defaultValue: 'Follow' });
405
+ }
406
+ /**
407
+ * The social platforms the author actually has, in display order.
408
+ * @returns `[key, value]` pairs for the social row.
409
+ */
410
+ socialEntries() {
411
+ const socials = this.author?.socials;
412
+ return SOCIAL_KEYS.flatMap((key) => {
413
+ const value = socials?.[key];
414
+ return value ? [[key, value]] : [];
415
+ });
416
+ }
417
+ /**
418
+ * One social entry's `href`.
419
+ * @param entry - A `[key, value]` pair.
420
+ * @returns The resolved URL.
421
+ */
422
+ hrefOf(entry) {
423
+ return resolveSocialHref(entry[0], entry[1]);
424
+ }
425
+ /**
426
+ * One social link's `data-mol-id`.
427
+ * @param key - The social-network key.
428
+ * @returns The link's `data-mol-id`.
429
+ */
430
+ socialId(key) {
431
+ return this.id(`social-${key}`);
432
+ }
433
+ /**
434
+ * The translated accessible label of a social link. Every platform is a
435
+ * literal key (the locale bond owns `authorBioCard.social.<platform>`).
436
+ * @param key - The social-network key.
437
+ * @returns The link's `aria-label`.
438
+ */
439
+ socialAriaLabel(key) {
440
+ const name = this.author?.name ?? '';
441
+ switch (key) {
442
+ case 'twitter':
443
+ return this.i18n.t('authorBioCard.social.twitter', { name }, { defaultValue: '{{name}} on Twitter' });
444
+ case 'github':
445
+ return this.i18n.t('authorBioCard.social.github', { name }, { defaultValue: '{{name}} on GitHub' });
446
+ case 'linkedin':
447
+ return this.i18n.t('authorBioCard.social.linkedin', { name }, { defaultValue: '{{name}} on LinkedIn' });
448
+ case 'mastodon':
449
+ return this.i18n.t('authorBioCard.social.mastodon', { name }, { defaultValue: '{{name}} on Mastodon' });
450
+ case 'website':
451
+ return this.i18n.t('authorBioCard.social.website', { name }, { defaultValue: "{{name}}'s website" });
452
+ }
453
+ }
454
+ /**
455
+ * The translated visible label of a social link. Every platform is a
456
+ * literal key (the locale bond owns `authorBioCard.social.<platform>.label`).
457
+ * @param key - The social-network key.
458
+ * @returns The link's text.
459
+ */
460
+ socialText(key) {
461
+ switch (key) {
462
+ case 'twitter':
463
+ return this.i18n.t('authorBioCard.social.twitter.label', {}, { defaultValue: 'Twitter' });
464
+ case 'github':
465
+ return this.i18n.t('authorBioCard.social.github.label', {}, { defaultValue: 'GitHub' });
466
+ case 'linkedin':
467
+ return this.i18n.t('authorBioCard.social.linkedin.label', {}, { defaultValue: 'LinkedIn' });
468
+ case 'mastodon':
469
+ return this.i18n.t('authorBioCard.social.mastodon.label', {}, { defaultValue: 'Mastodon' });
470
+ case 'website':
471
+ return this.i18n.t('authorBioCard.social.website.label', {}, { defaultValue: 'Website' });
472
+ }
473
+ }
474
+ /**
475
+ * Reports the toggled follow state through the caller's handler.
476
+ */
477
+ toggleFollow() {
478
+ this.onFollow?.(!this.following);
479
+ }
480
+ static ɵfac = function AuthorBioCard_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || AuthorBioCard)(); };
481
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: AuthorBioCard, selectors: [["div", "mol-author-bio-card", ""]], hostVars: 3, hostBindings: function AuthorBioCard_HostBindings(rf, ctx) { if (rf & 2) {
482
+ i0.ɵɵattribute("data-mol-id", ctx.containerId());
483
+ i0.ɵɵclassMap(ctx.classes());
484
+ } }, inputs: { author: "author", layout: "layout", following: "following", onFollow: "onFollow", className: "className", dataMolId: "dataMolId" }, decls: 2, vars: 1, consts: [[3, "class"], ["mol-avatar", "", 3, "src", "alt", "name", "size"], [3, "href", "class"], ["mol-button", "", 3, "variant", "color", "size"], [3, "href"], ["rel", "noopener noreferrer", "target", "_blank", 3, "href", "class"], ["rel", "noopener noreferrer", "target", "_blank", 3, "href"], ["mol-button", "", 3, "click", "variant", "color", "size"]], template: function AuthorBioCard_Template(rf, ctx) { if (rf & 1) {
485
+ i0.ɵɵconditionalCreate(0, AuthorBioCard_Conditional_0_Template, 12, 18, "div", 0)(1, AuthorBioCard_Conditional_1_Template, 10, 16, "div", 0);
486
+ } if (rf & 2) {
487
+ i0.ɵɵconditional(ctx.layout === "full" ? 0 : 1);
488
+ } }, dependencies: [Avatar, Button], encapsulation: 2 });
489
+ }
490
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(AuthorBioCard, [{
491
+ type: Component,
492
+ args: [{
493
+ selector: 'div[mol-author-bio-card]',
494
+ standalone: true,
495
+ imports: [Avatar, Button],
496
+ inputs: ['author', 'layout', 'following', 'onFollow', 'className', 'dataMolId'],
497
+ host: {
498
+ '[class]': 'classes()',
499
+ '[attr.data-mol-id]': 'containerId()',
500
+ },
501
+ // prettier-ignore
502
+ template: `@if (layout === 'full') {
503
+ <div [class]="rowFullClasses()">
504
+ <div [class]="shrink0Classes()"><div mol-avatar [src]="author?.avatar" [alt]="author?.name" [name]="author?.name" [size]="'lg'"></div></div>
505
+ <div [class]="bodyFullClasses()">
506
+ <header [class]="baselineClasses()">@if (author && author.href) {<a [href]="author.href" [attr.data-mol-id]="id('name')" [class]="nameClasses()">{{ author.name }}</a>} @else {<span [attr.data-mol-id]="id('name')" [class]="nameClasses()">{{ author?.name }}</span>}</header>
507
+ @if (author && author.bio) {<p [attr.data-mol-id]="id('bio')" [class]="bioClasses()">{{ author.bio }}</p>}
508
+ <div [class]="betweenClasses()">
509
+ @if (socialEntries().length > 0) {<div [attr.data-mol-id]="id('socials')" [class]="socialRowClasses()">@for (entry of socialEntries(); track entry[0]) {<a [href]="hrefOf(entry)" [attr.data-mol-id]="socialId(entry[0])" [attr.aria-label]="socialAriaLabel(entry[0])" rel="noopener noreferrer" target="_blank" [class]="socialLinkClasses()">{{ socialText(entry[0]) }}</a>}</div>} @else {<span></span>}
510
+ @if (onFollow) {<button mol-button [variant]="following ? 'outline' : 'solid'" [color]="'primary'" [size]="'sm'" (click)="toggleFollow()" [attr.data-mol-id]="id('follow')" [attr.aria-pressed]="following ? 'true' : 'false'">{{ followLabel() }}</button>}
511
+ </div>
512
+ </div>
513
+ </div>
514
+ } @else {
515
+ <div [class]="rowCompactClasses()">
516
+ <div [class]="shrink0Classes()"><div mol-avatar [src]="author?.avatar" [alt]="author?.name" [name]="author?.name" [size]="'md'"></div></div>
517
+ <div [class]="bodyCompactClasses()">
518
+ <div [class]="baselineClasses()">@if (author && author.href) {<a [href]="author.href" [attr.data-mol-id]="id('name')" [class]="nameClasses()">{{ author.name }}</a>} @else {<span [attr.data-mol-id]="id('name')" [class]="nameClasses()">{{ author?.name }}</span>}</div>
519
+ @if (author && author.bio) {<p [attr.data-mol-id]="id('bio')" [class]="bioClasses()">{{ author.bio }}</p>}
520
+ @if (socialEntries().length > 0) {<div [attr.data-mol-id]="id('socials')" [class]="socialRowClasses()">@for (entry of socialEntries(); track entry[0]) {<a [href]="hrefOf(entry)" [attr.data-mol-id]="socialId(entry[0])" [attr.aria-label]="socialAriaLabel(entry[0])" rel="noopener noreferrer" target="_blank" [class]="socialLinkClasses()">{{ socialText(entry[0]) }}</a>}</div>}
521
+ </div>
522
+ @if (onFollow) {<div [class]="shrink0Classes()"><button mol-button [variant]="following ? 'outline' : 'solid'" [color]="'primary'" [size]="'sm'" (click)="toggleFollow()" [attr.data-mol-id]="id('follow')" [attr.aria-pressed]="following ? 'true' : 'false'">{{ followLabel() }}</button></div>}
523
+ </div>
524
+ }`,
525
+ }]
526
+ }], null, null); })();
527
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(AuthorBioCard, { className: "AuthorBioCard", filePath: "author-bio-card.component.ts", lineNumber: 101 }); })();
528
+ //# sourceMappingURL=author-bio-card.component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"author-bio-card.component.js","sourceRoot":"","sources":["../src/author-bio-card.component.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAEzC,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAEtD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAA;;4CAwE4D,CAAC;;IAH/C,4BAAgF;IAAA,YAAiB;IAAA,iBAAI;;;IAA7C,mCAAuB;IAA5E,2DAAoB;;IAAyD,cAAiB;IAAjB,wCAAiB;;;IAAa,4BAA8D;IAAA,YAAkB;IAAA,iBAAO;;;IAAjD,mCAAuB;;IAAC,cAAkB;IAAlB,yCAAkB;;;IACnO,yBAAyD;IAAA,YAAgB;IAAA,iBAAI;;;IAA3C,kCAAsB;;IAAC,cAAgB;IAAhB,uCAAgB;;;IAEq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AAI,CAAC,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;IAClC,CAAC;uGAvPU,aAAa;6DAAb,aAAa;0CAAb,iBAAa;YAAb,cAAA,aAAS,CAAI;;YAZxB,AAZW,iFAAyB,2DAY7B;;YAZI,+CAsBZ;4BA7BW,MAAM,EAAE,MAAM;;iFA+Bb,aAAa;cAlCzB,SAAS;eAAC;gBACT,QAAQ,EAAE,0BAA0B;gBACpC,UAAU,EAAE,IAAI;gBAChB,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;gBACzB,MAAM,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,UAAU,EAAE,WAAW,EAAE,WAAW,CAAC;gBAC/E,IAAI,EAAE;oBACJ,SAAS,EAAE,WAAW;oBACtB,oBAAoB,EAAE,eAAe;iBACtC;gBACD,kBAAkB;gBAClB,QAAQ,EAAE;;;;;;;;;;;;;;;;;;;;;;EAsBV;aACD;;kFACY,aAAa"}
@@ -0,0 +1,55 @@
1
+ /**
2
+ * Angular author bio card — avatar + name + bio + social links + follow button
3
+ * — the counterpart of `@molecule/app-author-bio-card-react`: the same props
4
+ * and the same DOM for the same input.
5
+ *
6
+ * Renders an author identity preview suitable for blog/podcast/video-streaming
7
+ * article footers, sidebar "About the author" panels, and any other place a
8
+ * lightweight user-profile card is needed. Two layouts (`compact`, `full`)
9
+ * cover the common shapes.
10
+ *
11
+ * @example
12
+ * ```ts
13
+ * import { Component } from '@angular/core'
14
+ * import { AuthorBioCard } from '@molecule/app-author-bio-card-angular'
15
+ *
16
+ * @Component({
17
+ * selector: 'app-author-footer',
18
+ * standalone: true,
19
+ * imports: [AuthorBioCard],
20
+ * template: `
21
+ * <div
22
+ * mol-author-bio-card
23
+ * [author]="author"
24
+ * layout="full"
25
+ * [following]="following"
26
+ * [onFollow]="setFollowing"
27
+ * ></div>
28
+ * `,
29
+ * })
30
+ * export class AuthorFooter {
31
+ * following = false
32
+ * author = {
33
+ * id: 'alice',
34
+ * name: 'Alice Example',
35
+ * avatar: '/avatars/alice.png',
36
+ * bio: 'Writes about distributed systems and tea.',
37
+ * href: '/authors/alice',
38
+ * socials: { twitter: 'alice', github: 'alice', website: 'alice.example' },
39
+ * }
40
+ * readonly setFollowing = (next: boolean): void => {
41
+ * this.following = next
42
+ * }
43
+ * }
44
+ * ```
45
+ *
46
+ * @remarks
47
+ * All UI text routes through `useTranslation()` from `@molecule/app-angular`
48
+ * so apps can override copy via the companion locale bond
49
+ * `@molecule/app-locales-author-bio-card`.
50
+ *
51
+ * @module
52
+ */
53
+ export * from './author-bio-card.component.js';
54
+ export * from './types.js';
55
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AAEH,cAAc,gCAAgC,CAAA;AAC9C,cAAc,YAAY,CAAA"}
package/dist/index.js ADDED
@@ -0,0 +1,55 @@
1
+ /**
2
+ * Angular author bio card — avatar + name + bio + social links + follow button
3
+ * — the counterpart of `@molecule/app-author-bio-card-react`: the same props
4
+ * and the same DOM for the same input.
5
+ *
6
+ * Renders an author identity preview suitable for blog/podcast/video-streaming
7
+ * article footers, sidebar "About the author" panels, and any other place a
8
+ * lightweight user-profile card is needed. Two layouts (`compact`, `full`)
9
+ * cover the common shapes.
10
+ *
11
+ * @example
12
+ * ```ts
13
+ * import { Component } from '@angular/core'
14
+ * import { AuthorBioCard } from '@molecule/app-author-bio-card-angular'
15
+ *
16
+ * @Component({
17
+ * selector: 'app-author-footer',
18
+ * standalone: true,
19
+ * imports: [AuthorBioCard],
20
+ * template: `
21
+ * <div
22
+ * mol-author-bio-card
23
+ * [author]="author"
24
+ * layout="full"
25
+ * [following]="following"
26
+ * [onFollow]="setFollowing"
27
+ * ></div>
28
+ * `,
29
+ * })
30
+ * export class AuthorFooter {
31
+ * following = false
32
+ * author = {
33
+ * id: 'alice',
34
+ * name: 'Alice Example',
35
+ * avatar: '/avatars/alice.png',
36
+ * bio: 'Writes about distributed systems and tea.',
37
+ * href: '/authors/alice',
38
+ * socials: { twitter: 'alice', github: 'alice', website: 'alice.example' },
39
+ * }
40
+ * readonly setFollowing = (next: boolean): void => {
41
+ * this.following = next
42
+ * }
43
+ * }
44
+ * ```
45
+ *
46
+ * @remarks
47
+ * All UI text routes through `useTranslation()` from `@molecule/app-angular`
48
+ * so apps can override copy via the companion locale bond
49
+ * `@molecule/app-locales-author-bio-card`.
50
+ *
51
+ * @module
52
+ */
53
+ export * from './author-bio-card.component.js';
54
+ export * from './types.js';
55
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AAEH,cAAc,gCAAgC,CAAA;AAC9C,cAAc,YAAY,CAAA"}