@trismegisto/angular 3.3.9 → 3.3.11

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 (55) hide show
  1. package/fesm2022/trismegisto-angular-agent.mjs +458 -73
  2. package/fesm2022/trismegisto-angular-agent.mjs.map +1 -1
  3. package/fesm2022/trismegisto-angular-api-exchange.mjs +1 -1
  4. package/fesm2022/trismegisto-angular-api-exchange.mjs.map +1 -1
  5. package/fesm2022/trismegisto-angular-attachment.mjs +6 -2
  6. package/fesm2022/trismegisto-angular-attachment.mjs.map +1 -1
  7. package/fesm2022/trismegisto-angular-bubble.mjs.map +1 -1
  8. package/fesm2022/trismegisto-angular-code-viewer.mjs +78 -5
  9. package/fesm2022/trismegisto-angular-code-viewer.mjs.map +1 -1
  10. package/fesm2022/trismegisto-angular-data-grid.mjs +51 -7
  11. package/fesm2022/trismegisto-angular-data-grid.mjs.map +1 -1
  12. package/fesm2022/trismegisto-angular-icon.mjs +2 -1
  13. package/fesm2022/trismegisto-angular-icon.mjs.map +1 -1
  14. package/fesm2022/trismegisto-angular-message-divider.mjs +14 -6
  15. package/fesm2022/trismegisto-angular-message-divider.mjs.map +1 -1
  16. package/fesm2022/trismegisto-angular-message-scroller.mjs +14 -0
  17. package/fesm2022/trismegisto-angular-message-scroller.mjs.map +1 -1
  18. package/fesm2022/trismegisto-angular-prompt-input.mjs +251 -0
  19. package/fesm2022/trismegisto-angular-prompt-input.mjs.map +1 -0
  20. package/fesm2022/trismegisto-angular-prompt-suggestions.mjs +10 -3
  21. package/fesm2022/trismegisto-angular-prompt-suggestions.mjs.map +1 -1
  22. package/fesm2022/trismegisto-angular-questionnaire.mjs +420 -0
  23. package/fesm2022/trismegisto-angular-questionnaire.mjs.map +1 -0
  24. package/fesm2022/trismegisto-angular-trace.mjs +38 -9
  25. package/fesm2022/trismegisto-angular-trace.mjs.map +1 -1
  26. package/fesm2022/trismegisto-angular-webhook.mjs +1 -1
  27. package/fesm2022/trismegisto-angular-webhook.mjs.map +1 -1
  28. package/fesm2022/trismegisto-angular.mjs +4 -2
  29. package/fesm2022/trismegisto-angular.mjs.map +1 -1
  30. package/package.json +13 -5
  31. package/types/trismegisto-angular-agent.d.ts +103 -4
  32. package/types/trismegisto-angular-agent.d.ts.map +1 -1
  33. package/types/trismegisto-angular-attachment.d.ts +5 -2
  34. package/types/trismegisto-angular-attachment.d.ts.map +1 -1
  35. package/types/trismegisto-angular-bubble.d.ts +1 -1
  36. package/types/trismegisto-angular-code-viewer.d.ts +40 -3
  37. package/types/trismegisto-angular-code-viewer.d.ts.map +1 -1
  38. package/types/trismegisto-angular-data-grid.d.ts +27 -2
  39. package/types/trismegisto-angular-data-grid.d.ts.map +1 -1
  40. package/types/trismegisto-angular-icon.d.ts +2 -1
  41. package/types/trismegisto-angular-icon.d.ts.map +1 -1
  42. package/types/trismegisto-angular-message-divider.d.ts +4 -2
  43. package/types/trismegisto-angular-message-divider.d.ts.map +1 -1
  44. package/types/trismegisto-angular-message-scroller.d.ts +5 -0
  45. package/types/trismegisto-angular-message-scroller.d.ts.map +1 -1
  46. package/types/trismegisto-angular-prompt-input.d.ts +100 -0
  47. package/types/trismegisto-angular-prompt-input.d.ts.map +1 -0
  48. package/types/trismegisto-angular-prompt-suggestions.d.ts +3 -1
  49. package/types/trismegisto-angular-prompt-suggestions.d.ts.map +1 -1
  50. package/types/trismegisto-angular-questionnaire.d.ts +97 -0
  51. package/types/trismegisto-angular-questionnaire.d.ts.map +1 -0
  52. package/types/trismegisto-angular-trace.d.ts +11 -4
  53. package/types/trismegisto-angular-trace.d.ts.map +1 -1
  54. package/types/trismegisto-angular.d.ts +5 -3
  55. package/types/trismegisto-angular.d.ts.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"trismegisto-angular-api-exchange.mjs","sources":["../../src/api-exchange/api-exchange-messages.ts","../../src/api-exchange/icons.generated.ts","../../src/api-exchange/api-exchange.component.ts","../../src/api-exchange/api-exchange.component.html","../../src/api-exchange/index.ts","../../src/api-exchange/trismegisto-angular-api-exchange.ts"],"sourcesContent":["import type { CalendarFilesMessages } from '@trismegisto/primitives/messages-calendar-files';\n\n// Textos da peça desta pasta, fora do HERMES_MESSAGES (o pt-BR daquele vai embutido em todo componente; este só\n// entra no bundle de quem usa a peça). O componente escolhe pelo idioma com `HermesI18nService.pick`.\nexport type ApiExchangeMessages = CalendarFilesMessages['apiExchange'];\n\nexport const API_EXCHANGE_MESSAGES_PT_BR: ApiExchangeMessages = {\n label: 'Requisição {method} {path}',\n request: 'Requisição',\n response: 'Resposta',\n requestHeaders: 'Cabeçalhos da requisição',\n responseHeaders: 'Cabeçalhos da resposta',\n body: 'Corpo',\n query: 'Parâmetros de consulta',\n noBody: 'Sem corpo.',\n noHeaders: 'Sem cabeçalhos.',\n name: 'Nome',\n value: 'Valor',\n duration: 'Duração',\n size: 'Tamanho',\n statusClasses: {\n informational: 'informativo',\n success: 'sucesso',\n redirect: 'redirecionamento',\n clientError: 'erro do cliente',\n serverError: 'erro do servidor',\n unknown: 'desconhecido',\n },\n statusLabel: 'Status {status}, {class}',\n pending: 'Aguardando resposta…',\n networkError: 'Sem resposta: {error}',\n copyCurl: 'Copiar como cURL',\n copiedCurl: 'Comando copiado',\n reveal: 'Mostrar valores sensíveis',\n hide: 'Ocultar valores sensíveis',\n masked: 'valor oculto',\n};\n\nexport const API_EXCHANGE_MESSAGES_EN: ApiExchangeMessages = {\n label: '{method} {path} request',\n request: 'Request',\n response: 'Response',\n requestHeaders: 'Request headers',\n responseHeaders: 'Response headers',\n body: 'Body',\n query: 'Query parameters',\n noBody: 'No body.',\n noHeaders: 'No headers.',\n name: 'Name',\n value: 'Value',\n duration: 'Duration',\n size: 'Size',\n statusClasses: {\n informational: 'informational',\n success: 'success',\n redirect: 'redirect',\n clientError: 'client error',\n serverError: 'server error',\n unknown: 'unknown',\n },\n statusLabel: 'Status {status}, {class}',\n pending: 'Waiting for the response…',\n networkError: 'No response: {error}',\n copyCurl: 'Copy as cURL',\n copiedCurl: 'Command copied',\n reveal: 'Show sensitive values',\n hide: 'Hide sensitive values',\n masked: 'hidden value',\n};\n\nexport const API_EXCHANGE_MESSAGES_ES: ApiExchangeMessages = {\n label: 'Solicitud {method} {path}',\n request: 'Solicitud',\n response: 'Respuesta',\n requestHeaders: 'Encabezados de la solicitud',\n responseHeaders: 'Encabezados de la respuesta',\n body: 'Cuerpo',\n query: 'Parámetros de consulta',\n noBody: 'Sin cuerpo.',\n noHeaders: 'Sin encabezados.',\n name: 'Nombre',\n value: 'Valor',\n duration: 'Duración',\n size: 'Tamaño',\n statusClasses: {\n informational: 'informativo',\n success: 'éxito',\n redirect: 'redirección',\n clientError: 'error del cliente',\n serverError: 'error del servidor',\n unknown: 'desconocido',\n },\n statusLabel: 'Estado {status}, {class}',\n pending: 'Esperando la respuesta…',\n networkError: 'Sin respuesta: {error}',\n copyCurl: 'Copiar como cURL',\n copiedCurl: 'Comando copiado',\n reveal: 'Mostrar valores sensibles',\n hide: 'Ocultar valores sensibles',\n masked: 'valor oculto',\n};\n\n/** Catálogos por idioma, no formato do `HermesI18nService.pick`. */\nexport const API_EXCHANGE_MESSAGES: Readonly<Record<string, ApiExchangeMessages>> = { 'pt-BR': API_EXCHANGE_MESSAGES_PT_BR, en: API_EXCHANGE_MESSAGES_EN, es: API_EXCHANGE_MESSAGES_ES };\n","// GERADO por scripts/generate-internal-icons.mjs — não editar à mão.\n// Ícones que esta pasta usa por dentro; cada @Component/@Directive daqui os registra com\n// `readonly #icons = useHermesIcons(API_EXCHANGE_ICONS);`.\nimport type { RegisteredIcon } from '@trismegisto/icons';\nimport {\n ICON_EYE,\n ICON_EYE_CLOSE,\n ICON_UNKNOWN,\n} from '@trismegisto/angular/icon';\n\nexport const API_EXCHANGE_ICONS: readonly RegisteredIcon[] = [ICON_EYE, ICON_EYE_CLOSE, ICON_UNKNOWN];\n","import { ChangeDetectionStrategy, Component, computed, inject, input, signal } from '@angular/core';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { CODE_LANGUAGE_JSON } from '@trismegisto/primitives/code-languages/json';\nimport { type CodeLanguage } from '@trismegisto/primitives/code-syntax';\nimport { type HttpHeadersInput, HTTP_REASON_PHRASES, bodyBytes, bodyLanguage, formatDurationMs, formatHttpBody, headerValue, httpStatusClass, isSensitiveHeader, maskHeaderValue, normalizeHeaders, splitUrl, toCurl } from '@trismegisto/primitives/dev-tools';\nimport { formatFileSize } from '@trismegisto/primitives/file-upload';\nimport { formatMessage } from '@trismegisto/primitives/i18n';\nimport { HERMES_MESSAGES, HermesI18nService } from '@trismegisto/angular/i18n';\nimport { ButtonComponent } from '@trismegisto/angular/button';\nimport { CodeViewerComponent } from '@trismegisto/angular/code-viewer';\nimport { CopyButtonComponent } from '@trismegisto/angular/copy-button';\nimport { TabComponent, TabsComponent } from '@trismegisto/angular/tabs';\nimport { useHermesIcons } from '@trismegisto/angular/icon';\nimport { API_EXCHANGE_MESSAGES, API_EXCHANGE_MESSAGES_PT_BR, type ApiExchangeMessages } from './api-exchange-messages';\nimport { API_EXCHANGE_ICONS } from './icons.generated';\n\nexport type { HttpHeadersInput, HttpMethod, HttpStatusClass } from '@trismegisto/primitives/dev-tools';\n\n/**\n * JSON (o caso de quase toda API) vai com a gramática embutida, para destacar sem o app registrar linguagem; as\n * outras seguem pelo id e o `hm-code-viewer` resolve com as linguagens que o app registrou.\n */\nfunction viewerLanguage(id: string): string | CodeLanguage {\n return id === 'json' ? CODE_LANGUAGE_JSON : id;\n}\n\n/** A requisição mostrada. `body` texto ou objeto (vira JSON). */\nexport interface ApiRequest {\n readonly method?: string;\n readonly url: string;\n readonly headers?: HttpHeadersInput;\n readonly body?: unknown;\n}\n\n/** A resposta. `statusText` sem valor usa a frase padrão do protocolo; `size` sem valor mede o corpo. */\nexport interface ApiResponse {\n readonly status: number;\n readonly statusText?: string;\n readonly headers?: HttpHeadersInput;\n readonly body?: unknown;\n readonly durationMs?: number | null;\n readonly size?: number | null;\n}\n\n/**\n * Visor de uma troca HTTP (requisição e resposta) para telas de desenvolvedor — console de API, log de\n * webhook, depurador de integração: método, URL, status com a classe (\"404 Not Found\", erro do cliente),\n * duração e tamanho no topo; abas com o corpo da resposta (JSON indentado e destacado no `hm-code-viewer`), os\n * cabeçalhos da resposta e a requisição (parâmetros de consulta, cabeçalhos e corpo). Cabeçalhos de segredo\n * (`Authorization`, `Cookie`, `X-Api-Key` e os de `sensitiveHeaders`) ficam mascarados até a pessoa pedir;\n * \"Copiar como cURL\" também sai mascarado. Sem `response`: aguardando (`pending`) ou falha de rede (`error`).\n *\n * Acessibilidade: o status é texto com a classe por extenso (a cor do selo é reforço); as abas são o\n * `hm-tabs`; os cabeçalhos são tabelas com cabeçalho de coluna; o botão de mostrar segredos é de alternância\n * (`aria-pressed`).\n */\n@Component({\n selector: 'hm-api-exchange',\n imports: [NgTemplateOutlet, ButtonComponent, CodeViewerComponent, CopyButtonComponent, TabComponent, TabsComponent],\n templateUrl: './api-exchange.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: { class: 'hm-api-exchange' },\n})\nexport class ApiExchangeComponent {\n readonly #icons = useHermesIcons(API_EXCHANGE_ICONS);\n\n readonly request = input.required<ApiRequest>();\n readonly response = input<ApiResponse | null>(null);\n /** Falha sem resposta (rede, tempo esgotado): o texto do erro. */\n readonly error = input('');\n /** Outros cabeçalhos a mascarar, além dos padrão. */\n readonly sensitiveHeaders = input<readonly string[]>([]);\n /** Mostra \"Copiar como cURL\" (padrão). */\n readonly copyable = input(true);\n /** Sobrescreve textos do catálogo da peça (parcial). */\n readonly texts = input<Partial<ApiExchangeMessages> | null>(null);\n\n private readonly messages = inject(HERMES_MESSAGES);\n private readonly i18n = inject(HermesI18nService);\n protected readonly text = computed<ApiExchangeMessages>(() => ({ ...this.i18n.pick(API_EXCHANGE_MESSAGES, API_EXCHANGE_MESSAGES_PT_BR), ...this.texts() }));\n protected readonly locale = computed(() => this.messages.meta.locale);\n protected readonly reveal = signal(false);\n\n protected readonly method = computed(() => (this.request().method ?? 'GET').toUpperCase());\n protected readonly url = computed(() => splitUrl(this.request().url));\n protected readonly label = computed(() => formatMessage(this.text().label, { method: this.method(), path: this.url().path }));\n\n protected readonly statusClass = computed(() => httpStatusClass(this.response()?.status));\n protected readonly statusText = computed(() => {\n const r = this.response();\n if (!r) return '';\n return `${r.status} ${r.statusText || HTTP_REASON_PHRASES[r.status] || ''}`.trim();\n });\n protected readonly statusLabel = computed(() =>\n formatMessage(this.text().statusLabel, { status: this.statusText(), class: this.text().statusClasses[this.statusClass()] }),\n );\n\n protected readonly responseBody = computed(() => {\n const r = this.response();\n return r ? formatHttpBody(r.body, headerValue(r.headers, 'content-type')) : '';\n });\n protected readonly responseLanguage = computed(() => viewerLanguage(bodyLanguage(headerValue(this.response()?.headers, 'content-type'), this.responseBody())));\n protected readonly requestBody = computed(() => formatHttpBody(this.request().body, headerValue(this.request().headers, 'content-type')));\n protected readonly requestLanguage = computed(() => viewerLanguage(bodyLanguage(headerValue(this.request().headers, 'content-type'), this.requestBody())));\n\n protected readonly duration = computed(() => formatDurationMs(this.response()?.durationMs, this.locale()));\n protected readonly size = computed(() => {\n const r = this.response();\n if (!r) return '';\n const bytes = r.size ?? (this.responseBody() ? bodyBytes(this.responseBody()) : null);\n return bytes == null ? '' : formatFileSize(bytes, this.locale());\n });\n\n protected readonly requestHeaders = computed(() => this.headers(this.request().headers));\n protected readonly responseHeaders = computed(() => this.headers(this.response()?.headers));\n protected readonly hasSensitive = computed(() => [...this.requestHeaders(), ...this.responseHeaders()].some((h) => h.sensitive));\n protected readonly curl = computed(() => toCurl(this.request()));\n protected readonly errorText = computed(() => (this.error() ? formatMessage(this.text().networkError, { error: this.error() }) : ''));\n\n private headers(input: HttpHeadersInput): { name: string; value: string; sensitive: boolean }[] {\n return normalizeHeaders(input).map(([name, value]) => {\n const sensitive = isSensitiveHeader(name, this.sensitiveHeaders());\n return { name, value: sensitive && !this.reveal() ? maskHeaderValue(value) : value, sensitive };\n });\n }\n\n protected toggleReveal(): void {\n this.reveal.update((v) => !v);\n }\n}\n","<section class=\"hm-api-exchange__frame\" [attr.aria-label]=\"label()\">\n <div class=\"hm-api-exchange__summary\">\n <span class=\"hm-api-exchange__method\" [attr.data-method]=\"method()\">{{ method() }}</span>\n <code class=\"hm-api-exchange__url\">{{ request().url }}</code>\n <div class=\"hm-api-exchange__facts\">\n @if (response()) {\n <span class=\"hm-api-exchange__status\" [attr.data-class]=\"statusClass()\">\n <span aria-hidden=\"true\">{{ statusText() }}</span><span class=\"hm-visually-hidden\">{{ statusLabel() }}</span>\n </span>\n @if (duration()) {\n <span class=\"hm-api-exchange__fact\"><span class=\"hm-visually-hidden\">{{ text().duration }}: </span>{{ duration() }}</span>\n }\n @if (size()) {\n <span class=\"hm-api-exchange__fact\"><span class=\"hm-visually-hidden\">{{ text().size }}: </span>{{ size() }}</span>\n }\n } @else if (errorText()) {\n <span class=\"hm-api-exchange__status\" data-class=\"serverError\">{{ errorText() }}</span>\n } @else {\n <span class=\"hm-api-exchange__fact\" role=\"status\">{{ text().pending }}</span>\n }\n </div>\n <div class=\"hm-api-exchange__tools\">\n @if (hasSensitive()) {\n <hm-button emphasis=\"minimal\" size=\"small\" [icon]=\"reveal() ? 'eye-close' : 'eye'\" toggle [pressed]=\"reveal()\" (clicked)=\"toggleReveal()\">\n {{ reveal() ? text().hide : text().reveal }}\n </hm-button>\n }\n @if (copyable()) {\n <hm-copy-button variant=\"text\" size=\"small\" [value]=\"curl()\" [label]=\"text().copyCurl\" [copiedLabel]=\"text().copiedCurl\" />\n }\n </div>\n </div>\n\n <hm-tabs [label]=\"label()\">\n @if (response()) {\n <hm-tab id=\"response\" [label]=\"text().response\">\n @if (responseBody()) {\n <hm-code-viewer [code]=\"responseBody()\" [language]=\"responseLanguage()\" [label]=\"text().response + ', ' + text().body\" />\n } @else {\n <p class=\"hm-api-exchange__empty\">{{ text().noBody }}</p>\n }\n </hm-tab>\n <hm-tab id=\"response-headers\" [label]=\"text().responseHeaders\" [count]=\"responseHeaders().length\">\n <ng-container *ngTemplateOutlet=\"headersTable; context: { $implicit: responseHeaders(), caption: text().responseHeaders }\" />\n </hm-tab>\n }\n <hm-tab id=\"request\" [label]=\"text().request\">\n @if (url().query.length) {\n <p class=\"hm-api-exchange__section\">{{ text().query }}</p>\n <div class=\"hm-api-exchange__table-wrap\">\n <table class=\"hm-api-exchange__table\">\n <caption class=\"hm-visually-hidden\">{{ text().query }}</caption>\n <thead><tr><th scope=\"col\">{{ text().name }}</th><th scope=\"col\">{{ text().value }}</th></tr></thead>\n <tbody>\n @for (pair of url().query; track $index) {\n <tr><td><code>{{ pair[0] }}</code></td><td><code>{{ pair[1] }}</code></td></tr>\n }\n </tbody>\n </table>\n </div>\n }\n <p class=\"hm-api-exchange__section\">{{ text().requestHeaders }}</p>\n <ng-container *ngTemplateOutlet=\"headersTable; context: { $implicit: requestHeaders(), caption: text().requestHeaders }\" />\n <p class=\"hm-api-exchange__section\">{{ text().body }}</p>\n @if (requestBody()) {\n <hm-code-viewer [code]=\"requestBody()\" [language]=\"requestLanguage()\" [label]=\"text().request + ', ' + text().body\" />\n } @else {\n <p class=\"hm-api-exchange__empty\">{{ text().noBody }}</p>\n }\n </hm-tab>\n </hm-tabs>\n</section>\n\n<ng-template #headersTable let-rows let-caption=\"caption\">\n @if (rows.length) {\n <div class=\"hm-api-exchange__table-wrap\">\n <table class=\"hm-api-exchange__table\">\n <caption class=\"hm-visually-hidden\">{{ caption }}</caption>\n <thead><tr><th scope=\"col\">{{ text().name }}</th><th scope=\"col\">{{ text().value }}</th></tr></thead>\n <tbody>\n @for (header of rows; track $index) {\n <tr>\n <td><code>{{ header.name }}</code></td>\n <td>\n <code>{{ header.value }}</code>\n @if (header.sensitive && !reveal()) {\n <span class=\"hm-visually-hidden\">, {{ text().masked }}</span>\n }\n </td>\n </tr>\n }\n </tbody>\n </table>\n </div>\n } @else {\n <p class=\"hm-api-exchange__empty\">{{ text().noHeaders }}</p>\n }\n</ng-template>\n","// Ponto de import `@trismegisto/angular/api-exchange` (secundário do ng-packagr): o que o public-api e as outras pastas usam\n// daqui. Ao criar arquivo público novo na pasta, acrescente a linha.\nexport * from './api-exchange.component';\nexport * from './api-exchange-messages';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAMO,MAAM,2BAA2B,GAAwB;AAC9D,IAAA,KAAK,EAAE,4BAA4B;AACnC,IAAA,OAAO,EAAE,YAAY;AACrB,IAAA,QAAQ,EAAE,UAAU;AACpB,IAAA,cAAc,EAAE,0BAA0B;AAC1C,IAAA,eAAe,EAAE,wBAAwB;AACzC,IAAA,IAAI,EAAE,OAAO;AACb,IAAA,KAAK,EAAE,wBAAwB;AAC/B,IAAA,MAAM,EAAE,YAAY;AACpB,IAAA,SAAS,EAAE,iBAAiB;AAC5B,IAAA,IAAI,EAAE,MAAM;AACZ,IAAA,KAAK,EAAE,OAAO;AACd,IAAA,QAAQ,EAAE,SAAS;AACnB,IAAA,IAAI,EAAE,SAAS;AACf,IAAA,aAAa,EAAE;AACb,QAAA,aAAa,EAAE,aAAa;AAC5B,QAAA,OAAO,EAAE,SAAS;AAClB,QAAA,QAAQ,EAAE,kBAAkB;AAC5B,QAAA,WAAW,EAAE,iBAAiB;AAC9B,QAAA,WAAW,EAAE,kBAAkB;AAC/B,QAAA,OAAO,EAAE,cAAc;AACxB,KAAA;AACD,IAAA,WAAW,EAAE,0BAA0B;AACvC,IAAA,OAAO,EAAE,sBAAsB;AAC/B,IAAA,YAAY,EAAE,uBAAuB;AACrC,IAAA,QAAQ,EAAE,kBAAkB;AAC5B,IAAA,UAAU,EAAE,iBAAiB;AAC7B,IAAA,MAAM,EAAE,2BAA2B;AACnC,IAAA,IAAI,EAAE,2BAA2B;AACjC,IAAA,MAAM,EAAE,cAAc;;AAGjB,MAAM,wBAAwB,GAAwB;AAC3D,IAAA,KAAK,EAAE,yBAAyB;AAChC,IAAA,OAAO,EAAE,SAA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AAA,EAAA;;;AE7DpC;AACA;;ACDA;;AAEG;;"}
1
+ {"version":3,"file":"trismegisto-angular-api-exchange.mjs","sources":["../../src/api-exchange/api-exchange-messages.ts","../../src/api-exchange/icons.generated.ts","../../src/api-exchange/api-exchange.component.ts","../../src/api-exchange/api-exchange.component.html","../../src/api-exchange/index.ts","../../src/api-exchange/trismegisto-angular-api-exchange.ts"],"sourcesContent":["import type { CalendarFilesMessages } from '@trismegisto/primitives/messages-calendar-files';\n\n// Textos da peça desta pasta, fora do HERMES_MESSAGES (o pt-BR daquele vai embutido em todo componente; este só\n// entra no bundle de quem usa a peça). O componente escolhe pelo idioma com `HermesI18nService.pick`.\nexport type ApiExchangeMessages = CalendarFilesMessages['apiExchange'];\n\nexport const API_EXCHANGE_MESSAGES_PT_BR: ApiExchangeMessages = {\n label: 'Requisição {method} {path}',\n request: 'Requisição',\n response: 'Resposta',\n requestHeaders: 'Cabeçalhos da requisição',\n responseHeaders: 'Cabeçalhos da resposta',\n body: 'Corpo',\n query: 'Parâmetros de consulta',\n noBody: 'Sem corpo.',\n noHeaders: 'Sem cabeçalhos.',\n name: 'Nome',\n value: 'Valor',\n duration: 'Duração',\n size: 'Tamanho',\n statusClasses: {\n informational: 'informativo',\n success: 'sucesso',\n redirect: 'redirecionamento',\n clientError: 'erro do cliente',\n serverError: 'erro do servidor',\n unknown: 'desconhecido',\n },\n statusLabel: 'Status {status}, {class}',\n pending: 'Aguardando resposta…',\n networkError: 'Sem resposta: {error}',\n copyCurl: 'Copiar como cURL',\n copiedCurl: 'Comando copiado',\n reveal: 'Mostrar valores sensíveis',\n hide: 'Ocultar valores sensíveis',\n masked: 'valor oculto',\n};\n\nexport const API_EXCHANGE_MESSAGES_EN: ApiExchangeMessages = {\n label: '{method} {path} request',\n request: 'Request',\n response: 'Response',\n requestHeaders: 'Request headers',\n responseHeaders: 'Response headers',\n body: 'Body',\n query: 'Query parameters',\n noBody: 'No body.',\n noHeaders: 'No headers.',\n name: 'Name',\n value: 'Value',\n duration: 'Duration',\n size: 'Size',\n statusClasses: {\n informational: 'informational',\n success: 'success',\n redirect: 'redirect',\n clientError: 'client error',\n serverError: 'server error',\n unknown: 'unknown',\n },\n statusLabel: 'Status {status}, {class}',\n pending: 'Waiting for the response…',\n networkError: 'No response: {error}',\n copyCurl: 'Copy as cURL',\n copiedCurl: 'Command copied',\n reveal: 'Show sensitive values',\n hide: 'Hide sensitive values',\n masked: 'hidden value',\n};\n\nexport const API_EXCHANGE_MESSAGES_ES: ApiExchangeMessages = {\n label: 'Solicitud {method} {path}',\n request: 'Solicitud',\n response: 'Respuesta',\n requestHeaders: 'Encabezados de la solicitud',\n responseHeaders: 'Encabezados de la respuesta',\n body: 'Cuerpo',\n query: 'Parámetros de consulta',\n noBody: 'Sin cuerpo.',\n noHeaders: 'Sin encabezados.',\n name: 'Nombre',\n value: 'Valor',\n duration: 'Duración',\n size: 'Tamaño',\n statusClasses: {\n informational: 'informativo',\n success: 'éxito',\n redirect: 'redirección',\n clientError: 'error del cliente',\n serverError: 'error del servidor',\n unknown: 'desconocido',\n },\n statusLabel: 'Estado {status}, {class}',\n pending: 'Esperando la respuesta…',\n networkError: 'Sin respuesta: {error}',\n copyCurl: 'Copiar como cURL',\n copiedCurl: 'Comando copiado',\n reveal: 'Mostrar valores sensibles',\n hide: 'Ocultar valores sensibles',\n masked: 'valor oculto',\n};\n\n/** Catálogos por idioma, no formato do `HermesI18nService.pick`. */\nexport const API_EXCHANGE_MESSAGES: Readonly<Record<string, ApiExchangeMessages>> = { 'pt-BR': API_EXCHANGE_MESSAGES_PT_BR, en: API_EXCHANGE_MESSAGES_EN, es: API_EXCHANGE_MESSAGES_ES };\n","// GERADO por scripts/generate-internal-icons.mjs — não editar à mão.\n// Ícones que esta pasta usa por dentro; cada @Component/@Directive daqui os registra com\n// `readonly #icons = useHermesIcons(API_EXCHANGE_ICONS);`.\nimport type { RegisteredIcon } from '@trismegisto/icons';\nimport {\n ICON_EYE,\n ICON_EYE_CLOSE,\n ICON_UNKNOWN,\n} from '@trismegisto/angular/icon';\n\nexport const API_EXCHANGE_ICONS: readonly RegisteredIcon[] = [ICON_EYE, ICON_EYE_CLOSE, ICON_UNKNOWN];\n","import { ChangeDetectionStrategy, Component, computed, inject, input, signal } from '@angular/core';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { CODE_LANGUAGE_JSON } from '@trismegisto/primitives/code-languages/json';\nimport { type CodeLanguage } from '@trismegisto/primitives/code-syntax';\nimport { type HttpHeadersInput, HTTP_REASON_PHRASES, bodyBytes, bodyLanguage, formatDurationMs, formatHttpBody, headerValue, httpStatusClass, isSensitiveHeader, maskHeaderValue, normalizeHeaders, splitUrl, toCurl } from '@trismegisto/primitives/dev-tools';\nimport { formatFileSize } from '@trismegisto/primitives/file-upload';\nimport { formatMessage } from '@trismegisto/primitives/i18n';\nimport { HERMES_MESSAGES, HermesI18nService } from '@trismegisto/angular/i18n';\nimport { ButtonComponent } from '@trismegisto/angular/button';\nimport { CodeViewerComponent } from '@trismegisto/angular/code-viewer';\nimport { CopyButtonComponent } from '@trismegisto/angular/copy-button';\nimport { TabComponent, TabsComponent } from '@trismegisto/angular/tabs';\nimport { useHermesIcons } from '@trismegisto/angular/icon';\nimport { API_EXCHANGE_MESSAGES, API_EXCHANGE_MESSAGES_PT_BR, type ApiExchangeMessages } from './api-exchange-messages';\nimport { API_EXCHANGE_ICONS } from './icons.generated';\n\nexport type { HttpHeadersInput, HttpMethod, HttpStatusClass } from '@trismegisto/primitives/dev-tools';\n\n/**\n * JSON (o caso de quase toda API) vai com a gramática embutida, para destacar sem o app registrar linguagem; as\n * outras seguem pelo id e o `hm-code-viewer` resolve com as linguagens que o app registrou.\n */\nfunction viewerLanguage(id: string): string | CodeLanguage {\n return id === 'json' ? CODE_LANGUAGE_JSON : id;\n}\n\n/** A requisição mostrada. `body` texto ou objeto (vira JSON). */\nexport interface ApiRequest {\n readonly method?: string;\n readonly url: string;\n readonly headers?: HttpHeadersInput;\n readonly body?: unknown;\n}\n\n/** A resposta. `statusText` sem valor usa a frase padrão do protocolo; `size` sem valor mede o corpo. */\nexport interface ApiResponse {\n readonly status: number;\n readonly statusText?: string;\n readonly headers?: HttpHeadersInput;\n readonly body?: unknown;\n readonly durationMs?: number | null;\n readonly size?: number | null;\n}\n\n/**\n * Visor de uma troca HTTP (requisição e resposta) para telas de desenvolvedor — console de API, log de\n * webhook, depurador de integração: método, URL, status com a classe (\"404 Not Found\", erro do cliente),\n * duração e tamanho no topo; abas com o corpo da resposta (JSON indentado e destacado no `hm-code-viewer`), os\n * cabeçalhos da resposta e a requisição (parâmetros de consulta, cabeçalhos e corpo). Cabeçalhos de segredo\n * (`Authorization`, `Cookie`, `X-Api-Key` e os de `sensitiveHeaders`) ficam mascarados até a pessoa pedir;\n * \"Copiar como cURL\" também sai mascarado. Sem `response`: aguardando (`pending`) ou falha de rede (`error`).\n *\n * Acessibilidade: o status é texto com a classe por extenso (a cor do selo é reforço); as abas são o\n * `hm-tabs`; os cabeçalhos são tabelas com cabeçalho de coluna; o botão de mostrar segredos é de alternância\n * (`aria-pressed`).\n */\n@Component({\n selector: 'hm-api-exchange',\n imports: [NgTemplateOutlet, ButtonComponent, CodeViewerComponent, CopyButtonComponent, TabComponent, TabsComponent],\n templateUrl: './api-exchange.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: { class: 'hm-api-exchange' },\n})\nexport class ApiExchangeComponent {\n readonly #icons = useHermesIcons(API_EXCHANGE_ICONS);\n\n readonly request = input.required<ApiRequest>();\n readonly response = input<ApiResponse | null>(null);\n /** Falha sem resposta (rede, tempo esgotado): o texto do erro. */\n readonly error = input('');\n /** Outros cabeçalhos a mascarar, além dos padrão. */\n readonly sensitiveHeaders = input<readonly string[]>([]);\n /** Mostra \"Copiar como cURL\" (padrão). */\n readonly copyable = input(true);\n /** Sobrescreve textos do catálogo da peça (parcial). */\n readonly texts = input<Partial<ApiExchangeMessages> | null>(null);\n\n private readonly messages = inject(HERMES_MESSAGES);\n private readonly i18n = inject(HermesI18nService);\n protected readonly text = computed<ApiExchangeMessages>(() => ({ ...this.i18n.pick(API_EXCHANGE_MESSAGES, API_EXCHANGE_MESSAGES_PT_BR), ...this.texts() }));\n protected readonly locale = computed(() => this.messages.meta.locale);\n protected readonly reveal = signal(false);\n\n protected readonly method = computed(() => (this.request().method ?? 'GET').toUpperCase());\n protected readonly url = computed(() => splitUrl(this.request().url));\n protected readonly label = computed(() => formatMessage(this.text().label, { method: this.method(), path: this.url().path }));\n\n protected readonly statusClass = computed(() => httpStatusClass(this.response()?.status));\n protected readonly statusText = computed(() => {\n const r = this.response();\n if (!r) return '';\n return `${r.status} ${r.statusText || HTTP_REASON_PHRASES[r.status] || ''}`.trim();\n });\n protected readonly statusLabel = computed(() =>\n formatMessage(this.text().statusLabel, { status: this.statusText(), class: this.text().statusClasses[this.statusClass()] }),\n );\n\n protected readonly responseBody = computed(() => {\n const r = this.response();\n return r ? formatHttpBody(r.body, headerValue(r.headers, 'content-type')) : '';\n });\n protected readonly responseLanguage = computed(() => viewerLanguage(bodyLanguage(headerValue(this.response()?.headers, 'content-type'), this.responseBody())));\n protected readonly requestBody = computed(() => formatHttpBody(this.request().body, headerValue(this.request().headers, 'content-type')));\n protected readonly requestLanguage = computed(() => viewerLanguage(bodyLanguage(headerValue(this.request().headers, 'content-type'), this.requestBody())));\n\n protected readonly duration = computed(() => formatDurationMs(this.response()?.durationMs, this.locale()));\n protected readonly size = computed(() => {\n const r = this.response();\n if (!r) return '';\n const bytes = r.size ?? (this.responseBody() ? bodyBytes(this.responseBody()) : null);\n return bytes == null ? '' : formatFileSize(bytes, this.locale());\n });\n\n protected readonly requestHeaders = computed(() => this.headers(this.request().headers));\n protected readonly responseHeaders = computed(() => this.headers(this.response()?.headers));\n protected readonly hasSensitive = computed(() => [...this.requestHeaders(), ...this.responseHeaders()].some((h) => h.sensitive));\n protected readonly curl = computed(() => toCurl(this.request()));\n protected readonly errorText = computed(() => (this.error() ? formatMessage(this.text().networkError, { error: this.error() }) : ''));\n\n private headers(input: HttpHeadersInput): { name: string; value: string; sensitive: boolean }[] {\n return normalizeHeaders(input).map(([name, value]) => {\n const sensitive = isSensitiveHeader(name, this.sensitiveHeaders());\n return { name, value: sensitive && !this.reveal() ? maskHeaderValue(value) : value, sensitive };\n });\n }\n\n protected toggleReveal(): void {\n this.reveal.update((v) => !v);\n }\n}\n","<section class=\"hm-api-exchange__frame\" [attr.aria-label]=\"label()\">\n <div class=\"hm-api-exchange__summary\">\n <span class=\"hm-api-exchange__method\" [attr.data-method]=\"method()\">{{ method() }}</span>\n <code class=\"hm-api-exchange__url\">{{ request().url }}</code>\n <div class=\"hm-api-exchange__facts\">\n @if (response()) {\n <span class=\"hm-api-exchange__status\" [attr.data-class]=\"statusClass()\">\n <span aria-hidden=\"true\">{{ statusText() }}</span><span class=\"hm-visually-hidden\">{{ statusLabel() }}</span>\n </span>\n @if (duration()) {\n <span class=\"hm-api-exchange__fact\"><span class=\"hm-visually-hidden\">{{ text().duration }}: </span>{{ duration() }}</span>\n }\n @if (size()) {\n <span class=\"hm-api-exchange__fact\"><span class=\"hm-visually-hidden\">{{ text().size }}: </span>{{ size() }}</span>\n }\n } @else if (errorText()) {\n <span class=\"hm-api-exchange__status\" data-class=\"serverError\">{{ errorText() }}</span>\n } @else {\n <span class=\"hm-api-exchange__fact\" role=\"status\">{{ text().pending }}</span>\n }\n </div>\n <div class=\"hm-api-exchange__tools\">\n @if (hasSensitive()) {\n <hm-button emphasis=\"minimal\" size=\"small\" [icon]=\"reveal() ? 'eye-close' : 'eye'\" toggle [pressed]=\"reveal()\" (clicked)=\"toggleReveal()\">\n {{ reveal() ? text().hide : text().reveal }}\n </hm-button>\n }\n @if (copyable()) {\n <hm-copy-button variant=\"text\" size=\"small\" [value]=\"curl()\" [label]=\"text().copyCurl\" [copiedLabel]=\"text().copiedCurl\" />\n }\n </div>\n </div>\n\n <hm-tabs [label]=\"label()\">\n @if (response()) {\n <hm-tab id=\"response\" [label]=\"text().response\">\n @if (responseBody()) {\n <hm-code-viewer [code]=\"responseBody()\" [language]=\"responseLanguage()\" [label]=\"text().response + ', ' + text().body\" />\n } @else {\n <p class=\"hm-api-exchange__empty\">{{ text().noBody }}</p>\n }\n </hm-tab>\n <hm-tab id=\"response-headers\" [label]=\"text().responseHeaders\" [count]=\"responseHeaders().length\">\n <ng-container *ngTemplateOutlet=\"headersTable; context: { $implicit: responseHeaders(), caption: text().responseHeaders }\" />\n </hm-tab>\n }\n <hm-tab id=\"request\" [label]=\"text().request\">\n @if (url().query.length) {\n <p class=\"hm-api-exchange__section\">{{ text().query }}</p>\n <div class=\"hm-api-exchange__table-wrap\">\n <table class=\"hm-api-exchange__table\">\n <caption class=\"hm-visually-hidden\">{{ text().query }}</caption>\n <thead><tr><th scope=\"col\">{{ text().name }}</th><th scope=\"col\">{{ text().value }}</th></tr></thead>\n <tbody>\n @for (pair of url().query; track $index) {\n <tr><td><code>{{ pair[0] }}</code></td><td><code>{{ pair[1] }}</code></td></tr>\n }\n </tbody>\n </table>\n </div>\n }\n <p class=\"hm-api-exchange__section\">{{ text().requestHeaders }}</p>\n <ng-container *ngTemplateOutlet=\"headersTable; context: { $implicit: requestHeaders(), caption: text().requestHeaders }\" />\n <p class=\"hm-api-exchange__section\">{{ text().body }}</p>\n @if (requestBody()) {\n <hm-code-viewer [code]=\"requestBody()\" [language]=\"requestLanguage()\" [label]=\"text().request + ', ' + text().body\" />\n } @else {\n <p class=\"hm-api-exchange__empty\">{{ text().noBody }}</p>\n }\n </hm-tab>\n </hm-tabs>\n</section>\n\n<ng-template #headersTable let-rows let-caption=\"caption\">\n @if (rows.length) {\n <div class=\"hm-api-exchange__table-wrap\">\n <table class=\"hm-api-exchange__table\">\n <caption class=\"hm-visually-hidden\">{{ caption }}</caption>\n <thead><tr><th scope=\"col\">{{ text().name }}</th><th scope=\"col\">{{ text().value }}</th></tr></thead>\n <tbody>\n @for (header of rows; track $index) {\n <tr>\n <td><code>{{ header.name }}</code></td>\n <td>\n <code>{{ header.value }}</code>\n @if (header.sensitive && !reveal()) {\n <span class=\"hm-visually-hidden\">, {{ text().masked }}</span>\n }\n </td>\n </tr>\n }\n </tbody>\n </table>\n </div>\n } @else {\n <p class=\"hm-api-exchange__empty\">{{ text().noHeaders }}</p>\n }\n</ng-template>\n","// Ponto de import `@trismegisto/angular/api-exchange` (secundário do ng-packagr): o que o public-api e as outras pastas usam\n// daqui. Ao criar arquivo público novo na pasta, acrescente a linha.\nexport * from './api-exchange.component';\nexport * from './api-exchange-messages';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAMO,MAAM,2BAA2B,GAAwB;AAC9D,IAAA,KAAK,EAAE,4BAA4B;AACnC,IAAA,OAAO,EAAE,YAAY;AACrB,IAAA,QAAQ,EAAE,UAAU;AACpB,IAAA,cAAc,EAAE,0BAA0B;AAC1C,IAAA,eAAe,EAAE,wBAAwB;AACzC,IAAA,IAAI,EAAE,OAAO;AACb,IAAA,KAAK,EAAE,wBAAwB;AAC/B,IAAA,MAAM,EAAE,YAAY;AACpB,IAAA,SAAS,EAAE,iBAAiB;AAC5B,IAAA,IAAI,EAAE,MAAM;AACZ,IAAA,KAAK,EAAE,OAAO;AACd,IAAA,QAAQ,EAAE,SAAS;AACnB,IAAA,IAAI,EAAE,SAAS;AACf,IAAA,aAAa,EAAE;AACb,QAAA,aAAa,EAAE,aAAa;AAC5B,QAAA,OAAO,EAAE,SAAS;AAClB,QAAA,QAAQ,EAAE,kBAAkB;AAC5B,QAAA,WAAW,EAAE,iBAAiB;AAC9B,QAAA,WAAW,EAAE,kBAAkB;AAC/B,QAAA,OAAO,EAAE,cAAc;AACxB,KAAA;AACD,IAAA,WAAW,EAAE,0BAA0B;AACvC,IAAA,OAAO,EAAE,sBAAsB;AAC/B,IAAA,YAAY,EAAE,uBAAuB;AACrC,IAAA,QAAQ,EAAE,kBAAkB;AAC5B,IAAA,UAAU,EAAE,iBA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AAA;;4FAKvG,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBAPhC,SAAS;+BACE,iBAAiB,EAAA,OAAA,EAClB,CAAC,gBAAgB,EAAE,eAAe,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,YAAY,EAAE,aAAa,CAAC,EAAA,eAAA,EAElG,uBAAuB,CAAC,MAAM,QACzC,EAAE,KAAK,EAAE,iBAAiB,EAAE,EAAA,QAAA,EAAA,ohJAAA,EAAA;;;AE7DpC;AACA;;ACDA;;AAEG;;"}
@@ -111,6 +111,8 @@ class AttachmentComponent {
111
111
  /** Em `error`, mostra o botão de tentar de novo (emite `retried`). */
112
112
  retryable = input(false, { ...(ngDevMode ? { debugName: "retryable" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
113
113
  disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
114
+ /** `small` encolhe a mídia; `tiny` fica só com ícone e nome (o tamanho e a situação seguem para leitor de tela). */
115
+ scale = input('medium', ...(ngDevMode ? [{ debugName: "scale" }] : /* istanbul ignore next */ []));
114
116
  /** Pediu para remover o anexo. */
115
117
  removed = output();
116
118
  /** Pediu para tentar o envio de novo (só com `retryable`, em `error`). */
@@ -189,7 +191,7 @@ class AttachmentComponent {
189
191
  this.announcement.update((current) => (current === message ? `${message} ` : message));
190
192
  }
191
193
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: AttachmentComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
192
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.24", type: AttachmentComponent, isStandalone: true, selector: "hm-attachment", inputs: { name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: true, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, description: { classPropertyName: "description", publicName: "description", isSignal: true, isRequired: false, transformFunction: null }, thumbnail: { classPropertyName: "thumbnail", publicName: "thumbnail", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, href: { classPropertyName: "href", publicName: "href", isSignal: true, isRequired: false, transformFunction: null }, download: { classPropertyName: "download", publicName: "download", isSignal: true, isRequired: false, transformFunction: null }, status: { classPropertyName: "status", publicName: "status", isSignal: true, isRequired: false, transformFunction: null }, progress: { classPropertyName: "progress", publicName: "progress", isSignal: true, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", isSignal: true, isRequired: false, transformFunction: null }, removable: { classPropertyName: "removable", publicName: "removable", isSignal: true, isRequired: false, transformFunction: null }, retryable: { classPropertyName: "retryable", publicName: "retryable", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { removed: "removed", retried: "retried" }, host: { properties: { "class.hm-attachment--error": "status() === 'error'", "class.hm-attachment--done": "status() === 'done'", "class.hm-attachment--busy": "status() === 'pending' || status() === 'uploading'", "class.hm-attachment--disabled": "disabled()", "class.hm-attachment--has-thumbnail": "showThumbnail()", "attr.role": "group ? 'listitem' : null" }, classAttribute: "hm-attachment" }, ngImport: i0, template: "<!-- Miniatura e \u00EDcone s\u00E3o decorativos: o nome, logo ao lado, j\u00E1 diz o que \u00E9 o arquivo. -->\n<span class=\"hm-attachment__media\" aria-hidden=\"true\">\n @if (showThumbnail()) {\n <img class=\"hm-attachment__thumbnail\" [src]=\"thumbnail()\" alt=\"\" loading=\"lazy\" decoding=\"async\" (error)=\"onThumbnailError()\" />\n } @else {\n <hm-icon class=\"hm-attachment__icon\" [shape]=\"iconName()\" />\n }\n</span>\n\n<span class=\"hm-attachment__body\">\n @if (linked()) {\n <a\n class=\"hm-attachment__name hm-attachment__name--link\"\n [href]=\"href()\"\n [attr.download]=\"download() ? name() : null\"\n [attr.title]=\"name()\"\n [attr.aria-describedby]=\"describedBy()\"\n >{{ name() }}</a>\n } @else {\n <span class=\"hm-attachment__name\" [attr.title]=\"name()\">{{ name() }}</span>\n }\n @if (metaText()) {\n <span class=\"hm-attachment__meta\" [id]=\"metaId\">{{ metaText() }}</span>\n }\n @if (description()) {\n <span class=\"hm-attachment__description\" [id]=\"descriptionId\">{{ description() }}</span>\n }\n @if (errorText()) {\n <span class=\"hm-attachment__error\" [id]=\"errorId\">{{ errorText() }}</span>\n }\n</span>\n\n<span class=\"hm-attachment__actions\">\n <!-- A\u00E7\u00F5es do app (baixar, abrir, copiar link...) entram antes das embutidas. -->\n <ng-content />\n @if (retryable() && status() === 'error') {\n <hm-icon-button\n class=\"hm-attachment__retry\"\n icon=\"refresh\"\n emphasis=\"subtle\"\n size=\"small\"\n [label]=\"retryLabel()\"\n [disabled]=\"disabled()\"\n (clicked)=\"retry()\"\n />\n }\n @if (removable()) {\n <hm-icon-button\n class=\"hm-attachment__remove\"\n icon=\"times\"\n emphasis=\"subtle\"\n size=\"small\"\n [label]=\"removeLabel()\"\n [disabled]=\"disabled()\"\n (clicked)=\"remove()\"\n />\n }\n</span>\n\n@if (status() === 'uploading') {\n <hm-progress\n class=\"hm-attachment__progress\"\n size=\"small\"\n [value]=\"progress()\"\n [label]=\"progressLabel()\"\n [labelHidden]=\"true\"\n />\n}\n\n<span class=\"hm-visually-hidden\" aria-live=\"polite\" aria-atomic=\"true\">{{ announcement() }}</span>\n", dependencies: [{ kind: "component", type: IconComponent, selector: "hm-icon", inputs: ["shape", "direction", "size", "solid", "badge", "status", "flip", "inverse", "label"] }, { kind: "component", type: IconButtonComponent, selector: "hm-icon-button", inputs: ["label", "icon", "solid", "iconDirection", "emphasis", "intent", "size", "disabled", "toggle", "pressed", "keyShortcuts"], outputs: ["pressedChange", "clicked"] }, { kind: "component", type: ProgressComponent, selector: "hm-progress", inputs: ["value", "max", "label", "labelHidden", "showValue", "indeterminate", "intent", "size", "hint", "shape"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
194
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.24", type: AttachmentComponent, isStandalone: true, selector: "hm-attachment", inputs: { name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: true, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, description: { classPropertyName: "description", publicName: "description", isSignal: true, isRequired: false, transformFunction: null }, thumbnail: { classPropertyName: "thumbnail", publicName: "thumbnail", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, href: { classPropertyName: "href", publicName: "href", isSignal: true, isRequired: false, transformFunction: null }, download: { classPropertyName: "download", publicName: "download", isSignal: true, isRequired: false, transformFunction: null }, status: { classPropertyName: "status", publicName: "status", isSignal: true, isRequired: false, transformFunction: null }, progress: { classPropertyName: "progress", publicName: "progress", isSignal: true, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", isSignal: true, isRequired: false, transformFunction: null }, removable: { classPropertyName: "removable", publicName: "removable", isSignal: true, isRequired: false, transformFunction: null }, retryable: { classPropertyName: "retryable", publicName: "retryable", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, scale: { classPropertyName: "scale", publicName: "scale", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { removed: "removed", retried: "retried" }, host: { properties: { "class.hm-attachment--error": "status() === 'error'", "class.hm-attachment--done": "status() === 'done'", "class.hm-attachment--busy": "status() === 'pending' || status() === 'uploading'", "class.hm-attachment--disabled": "disabled()", "class.hm-attachment--small": "scale() === 'small'", "class.hm-attachment--tiny": "scale() === 'tiny'", "class.hm-attachment--has-thumbnail": "showThumbnail()", "attr.role": "group ? 'listitem' : null" }, classAttribute: "hm-attachment" }, ngImport: i0, template: "<!-- Miniatura e \u00EDcone s\u00E3o decorativos: o nome, logo ao lado, j\u00E1 diz o que \u00E9 o arquivo. -->\n<span class=\"hm-attachment__media\" aria-hidden=\"true\">\n @if (showThumbnail()) {\n <img class=\"hm-attachment__thumbnail\" [src]=\"thumbnail()\" alt=\"\" loading=\"lazy\" decoding=\"async\" (error)=\"onThumbnailError()\" />\n } @else {\n <hm-icon class=\"hm-attachment__icon\" [shape]=\"iconName()\" />\n }\n</span>\n\n<span class=\"hm-attachment__body\">\n @if (linked()) {\n <a\n class=\"hm-attachment__name hm-attachment__name--link\"\n [href]=\"href()\"\n [attr.download]=\"download() ? name() : null\"\n [attr.title]=\"name()\"\n [attr.aria-describedby]=\"describedBy()\"\n >{{ name() }}</a>\n } @else {\n <span class=\"hm-attachment__name\" [attr.title]=\"name()\">{{ name() }}</span>\n }\n @if (metaText()) {\n <span class=\"hm-attachment__meta\" [id]=\"metaId\">{{ metaText() }}</span>\n }\n @if (description()) {\n <span class=\"hm-attachment__description\" [id]=\"descriptionId\">{{ description() }}</span>\n }\n @if (errorText()) {\n <span class=\"hm-attachment__error\" [id]=\"errorId\">{{ errorText() }}</span>\n }\n</span>\n\n<span class=\"hm-attachment__actions\">\n <!-- A\u00E7\u00F5es do app (baixar, abrir, copiar link...) entram antes das embutidas. -->\n <ng-content />\n @if (retryable() && status() === 'error') {\n <hm-icon-button\n class=\"hm-attachment__retry\"\n icon=\"refresh\"\n emphasis=\"subtle\"\n size=\"small\"\n [label]=\"retryLabel()\"\n [disabled]=\"disabled()\"\n (clicked)=\"retry()\"\n />\n }\n @if (removable()) {\n <hm-icon-button\n class=\"hm-attachment__remove\"\n icon=\"times\"\n emphasis=\"subtle\"\n size=\"small\"\n [label]=\"removeLabel()\"\n [disabled]=\"disabled()\"\n (clicked)=\"remove()\"\n />\n }\n</span>\n\n@if (status() === 'uploading') {\n <hm-progress\n class=\"hm-attachment__progress\"\n size=\"small\"\n [value]=\"progress()\"\n [label]=\"progressLabel()\"\n [labelHidden]=\"true\"\n />\n}\n\n<span class=\"hm-visually-hidden\" aria-live=\"polite\" aria-atomic=\"true\">{{ announcement() }}</span>\n", dependencies: [{ kind: "component", type: IconComponent, selector: "hm-icon", inputs: ["shape", "direction", "size", "solid", "badge", "status", "flip", "inverse", "label"] }, { kind: "component", type: IconButtonComponent, selector: "hm-icon-button", inputs: ["label", "icon", "solid", "iconDirection", "emphasis", "intent", "size", "disabled", "toggle", "pressed", "keyShortcuts"], outputs: ["pressedChange", "clicked"] }, { kind: "component", type: ProgressComponent, selector: "hm-progress", inputs: ["value", "max", "label", "labelHidden", "showValue", "indeterminate", "intent", "size", "hint", "shape"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
193
195
  }
194
196
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: AttachmentComponent, decorators: [{
195
197
  type: Component,
@@ -199,11 +201,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.24", ngImpo
199
201
  '[class.hm-attachment--done]': "status() === 'done'",
200
202
  '[class.hm-attachment--busy]': "status() === 'pending' || status() === 'uploading'",
201
203
  '[class.hm-attachment--disabled]': 'disabled()',
204
+ '[class.hm-attachment--small]': "scale() === 'small'",
205
+ '[class.hm-attachment--tiny]': "scale() === 'tiny'",
202
206
  '[class.hm-attachment--has-thumbnail]': 'showThumbnail()',
203
207
  // Dentro do grupo (`role="list"`) cada anexo é um item da lista.
204
208
  '[attr.role]': "group ? 'listitem' : null",
205
209
  }, template: "<!-- Miniatura e \u00EDcone s\u00E3o decorativos: o nome, logo ao lado, j\u00E1 diz o que \u00E9 o arquivo. -->\n<span class=\"hm-attachment__media\" aria-hidden=\"true\">\n @if (showThumbnail()) {\n <img class=\"hm-attachment__thumbnail\" [src]=\"thumbnail()\" alt=\"\" loading=\"lazy\" decoding=\"async\" (error)=\"onThumbnailError()\" />\n } @else {\n <hm-icon class=\"hm-attachment__icon\" [shape]=\"iconName()\" />\n }\n</span>\n\n<span class=\"hm-attachment__body\">\n @if (linked()) {\n <a\n class=\"hm-attachment__name hm-attachment__name--link\"\n [href]=\"href()\"\n [attr.download]=\"download() ? name() : null\"\n [attr.title]=\"name()\"\n [attr.aria-describedby]=\"describedBy()\"\n >{{ name() }}</a>\n } @else {\n <span class=\"hm-attachment__name\" [attr.title]=\"name()\">{{ name() }}</span>\n }\n @if (metaText()) {\n <span class=\"hm-attachment__meta\" [id]=\"metaId\">{{ metaText() }}</span>\n }\n @if (description()) {\n <span class=\"hm-attachment__description\" [id]=\"descriptionId\">{{ description() }}</span>\n }\n @if (errorText()) {\n <span class=\"hm-attachment__error\" [id]=\"errorId\">{{ errorText() }}</span>\n }\n</span>\n\n<span class=\"hm-attachment__actions\">\n <!-- A\u00E7\u00F5es do app (baixar, abrir, copiar link...) entram antes das embutidas. -->\n <ng-content />\n @if (retryable() && status() === 'error') {\n <hm-icon-button\n class=\"hm-attachment__retry\"\n icon=\"refresh\"\n emphasis=\"subtle\"\n size=\"small\"\n [label]=\"retryLabel()\"\n [disabled]=\"disabled()\"\n (clicked)=\"retry()\"\n />\n }\n @if (removable()) {\n <hm-icon-button\n class=\"hm-attachment__remove\"\n icon=\"times\"\n emphasis=\"subtle\"\n size=\"small\"\n [label]=\"removeLabel()\"\n [disabled]=\"disabled()\"\n (clicked)=\"remove()\"\n />\n }\n</span>\n\n@if (status() === 'uploading') {\n <hm-progress\n class=\"hm-attachment__progress\"\n size=\"small\"\n [value]=\"progress()\"\n [label]=\"progressLabel()\"\n [labelHidden]=\"true\"\n />\n}\n\n<span class=\"hm-visually-hidden\" aria-live=\"polite\" aria-atomic=\"true\">{{ announcement() }}</span>\n" }]
206
- }], ctorParameters: () => [], propDecorators: { name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: true }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], description: [{ type: i0.Input, args: [{ isSignal: true, alias: "description", required: false }] }], thumbnail: [{ type: i0.Input, args: [{ isSignal: true, alias: "thumbnail", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], href: [{ type: i0.Input, args: [{ isSignal: true, alias: "href", required: false }] }], download: [{ type: i0.Input, args: [{ isSignal: true, alias: "download", required: false }] }], status: [{ type: i0.Input, args: [{ isSignal: true, alias: "status", required: false }] }], progress: [{ type: i0.Input, args: [{ isSignal: true, alias: "progress", required: false }] }], error: [{ type: i0.Input, args: [{ isSignal: true, alias: "error", required: false }] }], removable: [{ type: i0.Input, args: [{ isSignal: true, alias: "removable", required: false }] }], retryable: [{ type: i0.Input, args: [{ isSignal: true, alias: "retryable", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], removed: [{ type: i0.Output, args: ["removed"] }], retried: [{ type: i0.Output, args: ["retried"] }] } });
210
+ }], ctorParameters: () => [], propDecorators: { name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: true }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], description: [{ type: i0.Input, args: [{ isSignal: true, alias: "description", required: false }] }], thumbnail: [{ type: i0.Input, args: [{ isSignal: true, alias: "thumbnail", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], href: [{ type: i0.Input, args: [{ isSignal: true, alias: "href", required: false }] }], download: [{ type: i0.Input, args: [{ isSignal: true, alias: "download", required: false }] }], status: [{ type: i0.Input, args: [{ isSignal: true, alias: "status", required: false }] }], progress: [{ type: i0.Input, args: [{ isSignal: true, alias: "progress", required: false }] }], error: [{ type: i0.Input, args: [{ isSignal: true, alias: "error", required: false }] }], removable: [{ type: i0.Input, args: [{ isSignal: true, alias: "removable", required: false }] }], retryable: [{ type: i0.Input, args: [{ isSignal: true, alias: "retryable", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], scale: [{ type: i0.Input, args: [{ isSignal: true, alias: "scale", required: false }] }], removed: [{ type: i0.Output, args: ["removed"] }], retried: [{ type: i0.Output, args: ["retried"] }] } });
207
211
 
208
212
  /**
209
213
  * Agrupa `hm-attachment` numa lista (`role="list"`, cada anexo vira `listitem`) com um dos três
@@ -1 +1 @@
1
- {"version":3,"file":"trismegisto-angular-attachment.mjs","sources":["../../src/attachment/icons.generated.ts","../../src/attachment/attachment.contract.ts","../../src/attachment/file-icon.ts","../../src/attachment/attachment.component.ts","../../src/attachment/attachment.component.html","../../src/attachment/attachment-group.component.ts","../../src/attachment/index.ts","../../src/attachment/trismegisto-angular-attachment.ts"],"sourcesContent":["// GERADO por scripts/generate-internal-icons.mjs — não editar à mão.\n// Ícones que esta pasta usa por dentro; cada @Component/@Directive daqui os registra com\n// `readonly #icons = useHermesIcons(ATTACHMENT_ICONS);`.\nimport type { RegisteredIcon } from '@trismegisto/icons';\nimport {\n ICON_DOCUMENT_CSV,\n ICON_DOCUMENT_DOC,\n ICON_DOCUMENT_IMAGE,\n ICON_DOCUMENT_PDF,\n ICON_DOCUMENTS_EXCEL,\n ICON_EXCLAMATION_CIRCLE,\n ICON_FILE,\n ICON_FILE_TEXT,\n ICON_FILE_ZIP,\n ICON_LIST,\n ICON_REFRESH,\n ICON_TIMES,\n} from '@trismegisto/angular/icon';\n\nexport const ATTACHMENT_ICONS: readonly RegisteredIcon[] = [ICON_DOCUMENT_CSV, ICON_DOCUMENT_DOC, ICON_DOCUMENT_IMAGE, ICON_DOCUMENT_PDF, ICON_DOCUMENTS_EXCEL, ICON_EXCLAMATION_CIRCLE, ICON_FILE, ICON_FILE_TEXT, ICON_FILE_ZIP, ICON_LIST, ICON_REFRESH, ICON_TIMES];\n","import { InjectionToken } from '@angular/core';\n\n/**\n * O que o `hm-attachment` enxerga do `hm-attachment-group` que o contém. Em arquivo próprio para os\n * dois componentes não se importarem um ao outro (o grupo lista os anexos; o anexo avisa o grupo).\n */\nexport interface AttachmentGroupContract {\n /**\n * O anexo pediu para sair (`removed`). Se o app de fato o tirar da tela, o grupo leva o foco para o\n * anexo que ocupou o lugar — sem isto o foco cairia no `<body>`.\n */\n removing(element: HTMLElement): void;\n}\n\nexport const HM_ATTACHMENT_GROUP = new InjectionToken<AttachmentGroupContract>('HM_ATTACHMENT_GROUP');\n","// Ícone por tipo de arquivo, compartilhado pelo hm-attachment e pelo hm-file-upload (os dois mostram o\n// mesmo desenho para o mesmo arquivo). Os nomes ficam escritos aqui por extenso: o gerador de ícones\n// internos só registra o que encontra como literal na pasta.\n\nconst IMAGE_EXTENSIONS: ReadonlySet<string> = new Set(['png', 'jpg', 'jpeg', 'gif', 'webp', 'avif', 'svg', 'bmp']);\n\n// Map, e não objeto literal: uma extensão como `constructor` não pode achar nada no protótipo.\nconst ICON_BY_EXTENSION: ReadonlyMap<string, string> = new Map([\n ['pdf', 'document-pdf'],\n ['csv', 'document-csv'],\n ['doc', 'document-doc'],\n ['docx', 'document-doc'],\n ['xls', 'documents-excel'],\n ['xlsx', 'documents-excel'],\n ['txt', 'file-text'],\n ['md', 'file-text'],\n ['zip', 'file-zip'],\n ['gz', 'file-zip'],\n ['rar', 'file-zip'],\n ['7z', 'file-zip'],\n]);\n\n// Quando a extensão não diz nada (`a.png` que na verdade é PDF, nome sem extensão), o MIME ainda pode dizer.\nconst ICON_BY_TYPE: ReadonlyMap<string, string> = new Map([\n ['application/pdf', 'document-pdf'],\n ['text/csv', 'document-csv'],\n ['application/msword', 'document-doc'],\n ['application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'document-doc'],\n ['application/vnd.ms-excel', 'documents-excel'],\n ['application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'documents-excel'],\n ['text/plain', 'file-text'],\n ['text/markdown', 'file-text'],\n ['application/zip', 'file-zip'],\n ['application/x-zip-compressed', 'file-zip'],\n ['application/gzip', 'file-zip'],\n ['application/x-gzip', 'file-zip'],\n ['application/vnd.rar', 'file-zip'],\n ['application/x-rar-compressed', 'file-zip'],\n ['application/x-7z-compressed', 'file-zip'],\n]);\n\n/** Extensão em minúsculas (`'Relatório.PDF'` → `'pdf'`); `''` sem extensão ou em `.gitignore`. */\nexport function fileExtension(name: string): string {\n const dot = name.lastIndexOf('.');\n return dot > 0 ? name.slice(dot + 1).toLowerCase() : '';\n}\n\n/** É imagem? Com MIME, ele decide; sem MIME, a extensão. */\nexport function isImageFile(name: string, type = ''): boolean {\n if (type) return type.toLowerCase().startsWith('image/');\n return IMAGE_EXTENSIONS.has(fileExtension(name));\n}\n\n/** Nome do ícone do catálogo para o arquivo; `'file'` quando o tipo não é conhecido. */\nexport function fileIconName(name: string, type = ''): string {\n if (isImageFile(name, type)) return 'document-image';\n return ICON_BY_EXTENSION.get(fileExtension(name)) ?? ICON_BY_TYPE.get(type.toLowerCase()) ?? 'file';\n}\n","import {\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n computed,\n effect,\n ElementRef,\n inject,\n input,\n output,\n signal,\n untracked,\n} from '@angular/core';\nimport { FileUploadStatus, formatFileSize } from '@trismegisto/primitives/file-upload';\nimport { formatMessage } from '@trismegisto/primitives/i18n';\nimport { HERMES_MESSAGES } from '@trismegisto/angular/i18n';\nimport { IconComponent } from '@trismegisto/angular/icon';\nimport { IconButtonComponent } from '@trismegisto/angular/icon-button';\nimport { ProgressComponent } from '@trismegisto/angular/progress';\nimport { useHermesIcons } from '@trismegisto/angular/icon';\nimport { ATTACHMENT_ICONS } from './icons.generated';\nimport { HM_ATTACHMENT_GROUP } from './attachment.contract';\nimport { fileIconName } from './file-icon';\n\n/**\n * Situação do anexo: `idle` (arquivo já disponível, sem envio em jogo) ou uma das situações de envio\n * do `hm-file-upload` (`pending`, `uploading`, `done`, `error`), com os mesmos textos.\n */\nexport type AttachmentStatus = 'idle' | FileUploadStatus;\n\nlet sequence = 0;\n\n/**\n * Cartão de um arquivo anexado — numa mensagem, num chamado, num campo de prompt: miniatura (imagem)\n * ou ícone pelo tipo, nome, tamanho, descrição, ações e, durante um envio, a situação com progresso.\n *\n * É só apresentação: não guarda arquivo nem envia nada. Quem envia informa `status`/`progress`/`error`\n * (o mesmo vocabulário do `hm-file-upload`, que gera a lista; este mostra um item dela em qualquer\n * lugar). `removable` mostra o \"remover\" e emite `removed` — tirar da lista é do app; dentro de um\n * `hm-attachment-group`, o foco segue para o anexo vizinho quando o app remove.\n *\n * Acessibilidade:\n * - o nome é o que identifica o anexo; com `href` ele vira link (baixar/abrir) e o tamanho, a situação\n * e a descrição entram na descrição acessível do link;\n * - miniatura e ícone são decorativos (o nome já diz o que é);\n * - \"remover\" e \"tentar de novo\" levam o nome do arquivo no nome acessível;\n * - conclusão e falha de envio são anunciadas numa região viva (`aria-live=\"polite\"`).\n */\n@Component({\n selector: 'hm-attachment',\n imports: [IconComponent, IconButtonComponent, ProgressComponent],\n templateUrl: './attachment.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'hm-attachment',\n '[class.hm-attachment--error]': \"status() === 'error'\",\n '[class.hm-attachment--done]': \"status() === 'done'\",\n '[class.hm-attachment--busy]': \"status() === 'pending' || status() === 'uploading'\",\n '[class.hm-attachment--disabled]': 'disabled()',\n '[class.hm-attachment--has-thumbnail]': 'showThumbnail()',\n // Dentro do grupo (`role=\"list\"`) cada anexo é um item da lista.\n '[attr.role]': \"group ? 'listitem' : null\",\n },\n})\nexport class AttachmentComponent {\n readonly #icons = useHermesIcons(ATTACHMENT_ICONS);\n\n /** Nome do arquivo, com extensão — é o que identifica o anexo para todo mundo. */\n readonly name = input.required<string>();\n /** Tamanho em bytes, formatado no idioma ativo (\"2,1 MB\"). `null` não mostra tamanho. */\n readonly size = input<number | null>(null);\n /** Tipo MIME (`'application/pdf'`); sem ele, o ícone sai pela extensão do nome. */\n readonly type = input('');\n /** Linha secundária (quem enviou, quando, para quê). */\n readonly description = input('');\n /** URL da miniatura (imagem). Sem ela, ou se não carregar, aparece o ícone pelo tipo. */\n readonly thumbnail = input('');\n /** Ícone do catálogo no lugar do escolhido pelo tipo. */\n readonly icon = input('');\n /** Endereço do arquivo: o nome vira link. */\n readonly href = input('');\n /** Com `href`: o link baixa em vez de abrir (atributo `download`, com o nome do arquivo). */\n readonly download = input(false, { transform: booleanAttribute });\n readonly status = input<AttachmentStatus>('idle');\n /** Porcentagem de 0 a 100 durante `uploading`. */\n readonly progress = input(0);\n /** Motivo da falha (texto pronto), mostrado em `error`. */\n readonly error = input('');\n /** Mostra o botão de remover (emite `removed`; tirar da lista é do app). */\n readonly removable = input(false, { transform: booleanAttribute });\n /** Em `error`, mostra o botão de tentar de novo (emite `retried`). */\n readonly retryable = input(false, { transform: booleanAttribute });\n readonly disabled = input(false, { transform: booleanAttribute });\n\n /** Pediu para remover o anexo. */\n readonly removed = output<void>();\n /** Pediu para tentar o envio de novo (só com `retryable`, em `error`). */\n readonly retried = output<void>();\n\n private readonly catalog = inject(HERMES_MESSAGES);\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n protected readonly group = inject(HM_ATTACHMENT_GROUP, { optional: true });\n\n protected readonly id = `hm-attachment-${++sequence}`;\n protected readonly metaId = `${this.id}-meta`;\n protected readonly descriptionId = `${this.id}-description`;\n protected readonly errorId = `${this.id}-error`;\n\n private readonly thumbnailFailed = signal<string | null>(null);\n protected readonly announcement = signal('');\n\n /** Seção viva do catálogo (troca de idioma re-renderiza). Mesmos textos do `hm-file-upload`. */\n protected get text() {\n return this.catalog.fileUpload;\n }\n\n protected readonly showThumbnail = computed(() => !!this.thumbnail() && this.thumbnailFailed() !== this.thumbnail());\n protected readonly iconName = computed(() => {\n if (this.status() === 'error') return 'exclamation-circle';\n return this.icon() || fileIconName(this.name(), this.type());\n });\n protected readonly sizeText = computed(() => {\n const size = this.size();\n return size === null || size < 0 ? '' : formatFileSize(size, this.catalog.meta.locale);\n });\n protected readonly statusText = computed(() => {\n const status = this.status();\n return status === 'idle' ? '' : this.text[status];\n });\n protected readonly metaText = computed(() => [this.sizeText(), this.statusText()].filter(Boolean).join(' · '));\n protected readonly errorText = computed(() => (this.status() === 'error' ? this.error() : ''));\n protected readonly describedBy = computed(\n () =>\n [this.metaText() ? this.metaId : '', this.description() ? this.descriptionId : '', this.errorText() ? this.errorId : '']\n .filter(Boolean)\n .join(' ') || null,\n );\n protected readonly linked = computed(() => !!this.href() && !this.disabled());\n protected readonly removeLabel = computed(() => formatMessage(this.text.remove, { name: this.name() }));\n protected readonly retryLabel = computed(() => formatMessage(this.text.retry, { name: this.name() }));\n protected readonly progressLabel = computed(() => formatMessage(this.text.progress, { name: this.name() }));\n\n constructor() {\n // Conclusão e falha de envio vão para a região viva. Só MUDANÇA de situação: um anexo que já nasce\n // em `error` (lista recarregada) não fala nada sozinho — o texto está visível no cartão.\n let previous: AttachmentStatus | undefined;\n effect(() => {\n const status = this.status();\n const before = previous;\n previous = status;\n if (before === undefined || before === status) return;\n untracked(() => {\n const name = this.name();\n if (status === 'done') this.announce(formatMessage(this.text.uploaded, { name }));\n if (status === 'error') this.announce(this.error() || formatMessage(this.text.failed, { name }));\n });\n });\n }\n\n protected onThumbnailError(): void {\n this.thumbnailFailed.set(this.thumbnail());\n }\n\n protected remove(): void {\n if (this.disabled()) return;\n this.group?.removing(this.host.nativeElement);\n this.removed.emit();\n }\n\n protected retry(): void {\n if (this.disabled()) return;\n this.retried.emit();\n }\n\n /** O mesmo texto duas vezes seguidas não seria relido: alterna um espaço no fim. */\n private announce(message: string): void {\n this.announcement.update((current) => (current === message ? `${message} ` : message));\n }\n}\n","<!-- Miniatura e ícone são decorativos: o nome, logo ao lado, já diz o que é o arquivo. -->\n<span class=\"hm-attachment__media\" aria-hidden=\"true\">\n @if (showThumbnail()) {\n <img class=\"hm-attachment__thumbnail\" [src]=\"thumbnail()\" alt=\"\" loading=\"lazy\" decoding=\"async\" (error)=\"onThumbnailError()\" />\n } @else {\n <hm-icon class=\"hm-attachment__icon\" [shape]=\"iconName()\" />\n }\n</span>\n\n<span class=\"hm-attachment__body\">\n @if (linked()) {\n <a\n class=\"hm-attachment__name hm-attachment__name--link\"\n [href]=\"href()\"\n [attr.download]=\"download() ? name() : null\"\n [attr.title]=\"name()\"\n [attr.aria-describedby]=\"describedBy()\"\n >{{ name() }}</a>\n } @else {\n <span class=\"hm-attachment__name\" [attr.title]=\"name()\">{{ name() }}</span>\n }\n @if (metaText()) {\n <span class=\"hm-attachment__meta\" [id]=\"metaId\">{{ metaText() }}</span>\n }\n @if (description()) {\n <span class=\"hm-attachment__description\" [id]=\"descriptionId\">{{ description() }}</span>\n }\n @if (errorText()) {\n <span class=\"hm-attachment__error\" [id]=\"errorId\">{{ errorText() }}</span>\n }\n</span>\n\n<span class=\"hm-attachment__actions\">\n <!-- Ações do app (baixar, abrir, copiar link...) entram antes das embutidas. -->\n <ng-content />\n @if (retryable() && status() === 'error') {\n <hm-icon-button\n class=\"hm-attachment__retry\"\n icon=\"refresh\"\n emphasis=\"subtle\"\n size=\"small\"\n [label]=\"retryLabel()\"\n [disabled]=\"disabled()\"\n (clicked)=\"retry()\"\n />\n }\n @if (removable()) {\n <hm-icon-button\n class=\"hm-attachment__remove\"\n icon=\"times\"\n emphasis=\"subtle\"\n size=\"small\"\n [label]=\"removeLabel()\"\n [disabled]=\"disabled()\"\n (clicked)=\"remove()\"\n />\n }\n</span>\n\n@if (status() === 'uploading') {\n <hm-progress\n class=\"hm-attachment__progress\"\n size=\"small\"\n [value]=\"progress()\"\n [label]=\"progressLabel()\"\n [labelHidden]=\"true\"\n />\n}\n\n<span class=\"hm-visually-hidden\" aria-live=\"polite\" aria-atomic=\"true\">{{ announcement() }}</span>\n","import {\n afterNextRender,\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n forwardRef,\n inject,\n Injector,\n input,\n} from '@angular/core';\nimport { useHermesIcons } from '@trismegisto/angular/icon';\nimport { ATTACHMENT_ICONS } from './icons.generated';\nimport { AttachmentGroupContract, HM_ATTACHMENT_GROUP } from './attachment.contract';\n\n/**\n * Como o grupo arruma os anexos: `list` (um por linha, largura toda), `inline` (cartões compactos que\n * quebram linha — embaixo de um campo de prompt, numa mensagem) ou `grid` (blocos com a miniatura em\n * cima — galeria de imagens).\n */\nexport type AttachmentGroupLayout = 'list' | 'inline' | 'grid';\n\n/**\n * Agrupa `hm-attachment` numa lista (`role=\"list\"`, cada anexo vira `listitem`) com um dos três\n * arranjos de `layout`. Os `hm-attachment` vão como filhos DIRETOS (um invólucro no meio quebra a\n * relação lista → item). Quando o app remove um anexo a pedido do \"remover\" dele, o foco vai para o\n * \"remover\" do anexo que ocupou o lugar (ou do anterior); sem nenhum, para o próprio grupo.\n */\n@Component({\n selector: 'hm-attachment-group',\n template: '<ng-content />',\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [{ provide: HM_ATTACHMENT_GROUP, useExisting: forwardRef(() => AttachmentGroupComponent) }],\n host: {\n role: 'list',\n '[class]': \"'hm-attachment-group hm-attachment-group--' + layout()\",\n '[attr.aria-label]': 'label() || null',\n // Alvo de foco programático quando o último anexo sai (fora da ordem do Tab).\n tabindex: '-1',\n },\n})\nexport class AttachmentGroupComponent implements AttachmentGroupContract {\n readonly #icons = useHermesIcons(ATTACHMENT_ICONS);\n /** Nome da lista para o leitor de tela (\"Anexos da mensagem\"). Recomendado com mais de um grupo na tela. */\n readonly label = input('');\n readonly layout = input<AttachmentGroupLayout>('list');\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly injector = inject(Injector);\n\n removing(element: HTMLElement): void {\n const index = this.items().indexOf(element);\n if (index < 0) return;\n afterNextRender(\n () => {\n // O app pode não remover (pediu confirmação, recusou): aí o foco fica onde está.\n if (element.isConnected) return;\n const items = this.items();\n const next = items[Math.min(index, items.length - 1)];\n const target = next?.querySelector<HTMLElement>('.hm-attachment__remove button') ?? next?.querySelector<HTMLElement>('a, button:not([disabled])');\n (target ?? this.host.nativeElement).focus();\n },\n { injector: this.injector },\n );\n }\n\n private items(): HTMLElement[] {\n return Array.from(this.host.nativeElement.querySelectorAll<HTMLElement>(':scope > hm-attachment'));\n }\n}\n","// Ponto de import `@trismegisto/angular/attachment` (secundário do ng-packagr): o que o public-api e as outras pastas usam\n// daqui. Ao criar arquivo público novo na pasta, acrescente a linha.\nexport * from './attachment.component';\nexport * from './attachment-group.component';\nexport * from './file-icon';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;AAmBO,MAAM,gBAAgB,GAA8B,CAAC,iBAAiB,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,SAAS,EAAE,cAAc,EAAE,aAAa,EAAE,SAAS,EAAE,YAAY,EAAE,UAAU,CAAC;;ACLhQ,MAAM,mBAAmB,GAAG,IAAI,cAAc,CAA0B,qBAAqB,CAAC;;ACdrG;AACA;AACA;AAEA,MAAM,gBAAgB,GAAwB,IAAI,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;AAElH;AACA,MAAM,iBAAiB,GAAgC,IAAI,GAAG,CAAC;IAC7D,CAAC,KAAK,EAAE,cAAc,CAAC;IACvB,CAAC,KAAK,EAAE,cAAc,CAAC;IACvB,CAAC,KAAK,EAAE,cAAc,CAAC;IACvB,CAAC,MAAM,EAAE,cAAc,CAAC;IACxB,CAAC,KAAK,EAAE,iBAAiB,CAAC;IAC1B,CAAC,MAAM,EAAE,iBAAiB,CAAC;IAC3B,CAAC,KAAK,EAAE,WAAW,CAAC;IACpB,CAAC,IAAI,EAAE,WAAW,CAAC;IACnB,CAAC,KAAK,EAAE,UAAU,CAAC;IACnB,CAAC,IAAI,EAAE,UAAU,CAAC;IAClB,CAAC,KAAK,EAAE,UAAU,CAAC;IACnB,CAAC,IAAI,EAAE,UAAU,CAAC;AACnB,CAAA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;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,qBAAqB;AAC/B,oBAAA,QAAQ,EAAE,gBAAgB;oBAC1B,eAAe,EAAE,uBAAuB,CAAC,MAAM;AAC/C,oBAAA,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAE,UAAU,CAAC,MAAK,wBAAyB,CAAC,EAAE,CAAC;AACtG,oBAAA,IAAI,EAAE;AACJ,wBAAA,IAAI,EAAE,MAAM;AACZ,wBAAA,SAAS,EAAE,wDAAwD;AACnE,wBAAA,mBAAmB,EAAE,iBAAiB;;AAEtC,wBAAA,QAAQ,EAAE,IAAI;AACf,qBAAA;AACF,iBAAA;;;ACvCD;AACA;;ACDA;;AAEG;;"}
1
+ {"version":3,"file":"trismegisto-angular-attachment.mjs","sources":["../../src/attachment/icons.generated.ts","../../src/attachment/attachment.contract.ts","../../src/attachment/file-icon.ts","../../src/attachment/attachment.component.ts","../../src/attachment/attachment.component.html","../../src/attachment/attachment-group.component.ts","../../src/attachment/index.ts","../../src/attachment/trismegisto-angular-attachment.ts"],"sourcesContent":["// GERADO por scripts/generate-internal-icons.mjs — não editar à mão.\n// Ícones que esta pasta usa por dentro; cada @Component/@Directive daqui os registra com\n// `readonly #icons = useHermesIcons(ATTACHMENT_ICONS);`.\nimport type { RegisteredIcon } from '@trismegisto/icons';\nimport {\n ICON_DOCUMENT_CSV,\n ICON_DOCUMENT_DOC,\n ICON_DOCUMENT_IMAGE,\n ICON_DOCUMENT_PDF,\n ICON_DOCUMENTS_EXCEL,\n ICON_EXCLAMATION_CIRCLE,\n ICON_FILE,\n ICON_FILE_TEXT,\n ICON_FILE_ZIP,\n ICON_LIST,\n ICON_REFRESH,\n ICON_TIMES,\n} from '@trismegisto/angular/icon';\n\nexport const ATTACHMENT_ICONS: readonly RegisteredIcon[] = [ICON_DOCUMENT_CSV, ICON_DOCUMENT_DOC, ICON_DOCUMENT_IMAGE, ICON_DOCUMENT_PDF, ICON_DOCUMENTS_EXCEL, ICON_EXCLAMATION_CIRCLE, ICON_FILE, ICON_FILE_TEXT, ICON_FILE_ZIP, ICON_LIST, ICON_REFRESH, ICON_TIMES];\n","import { InjectionToken } from '@angular/core';\n\n/**\n * O que o `hm-attachment` enxerga do `hm-attachment-group` que o contém. Em arquivo próprio para os\n * dois componentes não se importarem um ao outro (o grupo lista os anexos; o anexo avisa o grupo).\n */\nexport interface AttachmentGroupContract {\n /**\n * O anexo pediu para sair (`removed`). Se o app de fato o tirar da tela, o grupo leva o foco para o\n * anexo que ocupou o lugar — sem isto o foco cairia no `<body>`.\n */\n removing(element: HTMLElement): void;\n}\n\nexport const HM_ATTACHMENT_GROUP = new InjectionToken<AttachmentGroupContract>('HM_ATTACHMENT_GROUP');\n","// Ícone por tipo de arquivo, compartilhado pelo hm-attachment e pelo hm-file-upload (os dois mostram o\n// mesmo desenho para o mesmo arquivo). Os nomes ficam escritos aqui por extenso: o gerador de ícones\n// internos só registra o que encontra como literal na pasta.\n\nconst IMAGE_EXTENSIONS: ReadonlySet<string> = new Set(['png', 'jpg', 'jpeg', 'gif', 'webp', 'avif', 'svg', 'bmp']);\n\n// Map, e não objeto literal: uma extensão como `constructor` não pode achar nada no protótipo.\nconst ICON_BY_EXTENSION: ReadonlyMap<string, string> = new Map([\n ['pdf', 'document-pdf'],\n ['csv', 'document-csv'],\n ['doc', 'document-doc'],\n ['docx', 'document-doc'],\n ['xls', 'documents-excel'],\n ['xlsx', 'documents-excel'],\n ['txt', 'file-text'],\n ['md', 'file-text'],\n ['zip', 'file-zip'],\n ['gz', 'file-zip'],\n ['rar', 'file-zip'],\n ['7z', 'file-zip'],\n]);\n\n// Quando a extensão não diz nada (`a.png` que na verdade é PDF, nome sem extensão), o MIME ainda pode dizer.\nconst ICON_BY_TYPE: ReadonlyMap<string, string> = new Map([\n ['application/pdf', 'document-pdf'],\n ['text/csv', 'document-csv'],\n ['application/msword', 'document-doc'],\n ['application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'document-doc'],\n ['application/vnd.ms-excel', 'documents-excel'],\n ['application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'documents-excel'],\n ['text/plain', 'file-text'],\n ['text/markdown', 'file-text'],\n ['application/zip', 'file-zip'],\n ['application/x-zip-compressed', 'file-zip'],\n ['application/gzip', 'file-zip'],\n ['application/x-gzip', 'file-zip'],\n ['application/vnd.rar', 'file-zip'],\n ['application/x-rar-compressed', 'file-zip'],\n ['application/x-7z-compressed', 'file-zip'],\n]);\n\n/** Extensão em minúsculas (`'Relatório.PDF'` → `'pdf'`); `''` sem extensão ou em `.gitignore`. */\nexport function fileExtension(name: string): string {\n const dot = name.lastIndexOf('.');\n return dot > 0 ? name.slice(dot + 1).toLowerCase() : '';\n}\n\n/** É imagem? Com MIME, ele decide; sem MIME, a extensão. */\nexport function isImageFile(name: string, type = ''): boolean {\n if (type) return type.toLowerCase().startsWith('image/');\n return IMAGE_EXTENSIONS.has(fileExtension(name));\n}\n\n/** Nome do ícone do catálogo para o arquivo; `'file'` quando o tipo não é conhecido. */\nexport function fileIconName(name: string, type = ''): string {\n if (isImageFile(name, type)) return 'document-image';\n return ICON_BY_EXTENSION.get(fileExtension(name)) ?? ICON_BY_TYPE.get(type.toLowerCase()) ?? 'file';\n}\n","import {\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n computed,\n effect,\n ElementRef,\n inject,\n input,\n output,\n signal,\n untracked,\n} from '@angular/core';\nimport { FileUploadStatus, formatFileSize } from '@trismegisto/primitives/file-upload';\nimport { formatMessage } from '@trismegisto/primitives/i18n';\nimport { HERMES_MESSAGES } from '@trismegisto/angular/i18n';\nimport { IconComponent } from '@trismegisto/angular/icon';\nimport { IconButtonComponent } from '@trismegisto/angular/icon-button';\nimport { ProgressComponent } from '@trismegisto/angular/progress';\nimport { useHermesIcons } from '@trismegisto/angular/icon';\nimport { ATTACHMENT_ICONS } from './icons.generated';\nimport { HM_ATTACHMENT_GROUP } from './attachment.contract';\nimport { fileIconName } from './file-icon';\n\n/**\n * Situação do anexo: `idle` (arquivo já disponível, sem envio em jogo) ou uma das situações de envio\n * do `hm-file-upload` (`pending`, `uploading`, `done`, `error`), com os mesmos textos.\n */\nexport type AttachmentStatus = 'idle' | FileUploadStatus;\nexport type AttachmentScale = 'medium' | 'small' | 'tiny';\n\nlet sequence = 0;\n\n/**\n * Cartão de um arquivo anexado — numa mensagem, num chamado, num campo de prompt: miniatura (imagem)\n * ou ícone pelo tipo, nome, tamanho, descrição, ações e, durante um envio, a situação com progresso.\n *\n * É só apresentação: não guarda arquivo nem envia nada. Quem envia informa `status`/`progress`/`error`\n * (o mesmo vocabulário do `hm-file-upload`, que gera a lista; este mostra um item dela em qualquer\n * lugar). `removable` mostra o \"remover\" e emite `removed` — tirar da lista é do app; dentro de um\n * `hm-attachment-group`, o foco segue para o anexo vizinho quando o app remove.\n *\n * Acessibilidade:\n * - o nome é o que identifica o anexo; com `href` ele vira link (baixar/abrir) e o tamanho, a situação\n * e a descrição entram na descrição acessível do link;\n * - miniatura e ícone são decorativos (o nome já diz o que é);\n * - \"remover\" e \"tentar de novo\" levam o nome do arquivo no nome acessível;\n * - conclusão e falha de envio são anunciadas numa região viva (`aria-live=\"polite\"`).\n */\n@Component({\n selector: 'hm-attachment',\n imports: [IconComponent, IconButtonComponent, ProgressComponent],\n templateUrl: './attachment.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'hm-attachment',\n '[class.hm-attachment--error]': \"status() === 'error'\",\n '[class.hm-attachment--done]': \"status() === 'done'\",\n '[class.hm-attachment--busy]': \"status() === 'pending' || status() === 'uploading'\",\n '[class.hm-attachment--disabled]': 'disabled()',\n '[class.hm-attachment--small]': \"scale() === 'small'\",\n '[class.hm-attachment--tiny]': \"scale() === 'tiny'\",\n '[class.hm-attachment--has-thumbnail]': 'showThumbnail()',\n // Dentro do grupo (`role=\"list\"`) cada anexo é um item da lista.\n '[attr.role]': \"group ? 'listitem' : null\",\n },\n})\nexport class AttachmentComponent {\n readonly #icons = useHermesIcons(ATTACHMENT_ICONS);\n\n /** Nome do arquivo, com extensão — é o que identifica o anexo para todo mundo. */\n readonly name = input.required<string>();\n /** Tamanho em bytes, formatado no idioma ativo (\"2,1 MB\"). `null` não mostra tamanho. */\n readonly size = input<number | null>(null);\n /** Tipo MIME (`'application/pdf'`); sem ele, o ícone sai pela extensão do nome. */\n readonly type = input('');\n /** Linha secundária (quem enviou, quando, para quê). */\n readonly description = input('');\n /** URL da miniatura (imagem). Sem ela, ou se não carregar, aparece o ícone pelo tipo. */\n readonly thumbnail = input('');\n /** Ícone do catálogo no lugar do escolhido pelo tipo. */\n readonly icon = input('');\n /** Endereço do arquivo: o nome vira link. */\n readonly href = input('');\n /** Com `href`: o link baixa em vez de abrir (atributo `download`, com o nome do arquivo). */\n readonly download = input(false, { transform: booleanAttribute });\n readonly status = input<AttachmentStatus>('idle');\n /** Porcentagem de 0 a 100 durante `uploading`. */\n readonly progress = input(0);\n /** Motivo da falha (texto pronto), mostrado em `error`. */\n readonly error = input('');\n /** Mostra o botão de remover (emite `removed`; tirar da lista é do app). */\n readonly removable = input(false, { transform: booleanAttribute });\n /** Em `error`, mostra o botão de tentar de novo (emite `retried`). */\n readonly retryable = input(false, { transform: booleanAttribute });\n readonly disabled = input(false, { transform: booleanAttribute });\n /** `small` encolhe a mídia; `tiny` fica só com ícone e nome (o tamanho e a situação seguem para leitor de tela). */\n readonly scale = input<AttachmentScale>('medium');\n\n /** Pediu para remover o anexo. */\n readonly removed = output<void>();\n /** Pediu para tentar o envio de novo (só com `retryable`, em `error`). */\n readonly retried = output<void>();\n\n private readonly catalog = inject(HERMES_MESSAGES);\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n protected readonly group = inject(HM_ATTACHMENT_GROUP, { optional: true });\n\n protected readonly id = `hm-attachment-${++sequence}`;\n protected readonly metaId = `${this.id}-meta`;\n protected readonly descriptionId = `${this.id}-description`;\n protected readonly errorId = `${this.id}-error`;\n\n private readonly thumbnailFailed = signal<string | null>(null);\n protected readonly announcement = signal('');\n\n /** Seção viva do catálogo (troca de idioma re-renderiza). Mesmos textos do `hm-file-upload`. */\n protected get text() {\n return this.catalog.fileUpload;\n }\n\n protected readonly showThumbnail = computed(() => !!this.thumbnail() && this.thumbnailFailed() !== this.thumbnail());\n protected readonly iconName = computed(() => {\n if (this.status() === 'error') return 'exclamation-circle';\n return this.icon() || fileIconName(this.name(), this.type());\n });\n protected readonly sizeText = computed(() => {\n const size = this.size();\n return size === null || size < 0 ? '' : formatFileSize(size, this.catalog.meta.locale);\n });\n protected readonly statusText = computed(() => {\n const status = this.status();\n return status === 'idle' ? '' : this.text[status];\n });\n protected readonly metaText = computed(() => [this.sizeText(), this.statusText()].filter(Boolean).join(' · '));\n protected readonly errorText = computed(() => (this.status() === 'error' ? this.error() : ''));\n protected readonly describedBy = computed(\n () =>\n [this.metaText() ? this.metaId : '', this.description() ? this.descriptionId : '', this.errorText() ? this.errorId : '']\n .filter(Boolean)\n .join(' ') || null,\n );\n protected readonly linked = computed(() => !!this.href() && !this.disabled());\n protected readonly removeLabel = computed(() => formatMessage(this.text.remove, { name: this.name() }));\n protected readonly retryLabel = computed(() => formatMessage(this.text.retry, { name: this.name() }));\n protected readonly progressLabel = computed(() => formatMessage(this.text.progress, { name: this.name() }));\n\n constructor() {\n // Conclusão e falha de envio vão para a região viva. Só MUDANÇA de situação: um anexo que já nasce\n // em `error` (lista recarregada) não fala nada sozinho — o texto está visível no cartão.\n let previous: AttachmentStatus | undefined;\n effect(() => {\n const status = this.status();\n const before = previous;\n previous = status;\n if (before === undefined || before === status) return;\n untracked(() => {\n const name = this.name();\n if (status === 'done') this.announce(formatMessage(this.text.uploaded, { name }));\n if (status === 'error') this.announce(this.error() || formatMessage(this.text.failed, { name }));\n });\n });\n }\n\n protected onThumbnailError(): void {\n this.thumbnailFailed.set(this.thumbnail());\n }\n\n protected remove(): void {\n if (this.disabled()) return;\n this.group?.removing(this.host.nativeElement);\n this.removed.emit();\n }\n\n protected retry(): void {\n if (this.disabled()) return;\n this.retried.emit();\n }\n\n /** O mesmo texto duas vezes seguidas não seria relido: alterna um espaço no fim. */\n private announce(message: string): void {\n this.announcement.update((current) => (current === message ? `${message} ` : message));\n }\n}\n","<!-- Miniatura e ícone são decorativos: o nome, logo ao lado, já diz o que é o arquivo. -->\n<span class=\"hm-attachment__media\" aria-hidden=\"true\">\n @if (showThumbnail()) {\n <img class=\"hm-attachment__thumbnail\" [src]=\"thumbnail()\" alt=\"\" loading=\"lazy\" decoding=\"async\" (error)=\"onThumbnailError()\" />\n } @else {\n <hm-icon class=\"hm-attachment__icon\" [shape]=\"iconName()\" />\n }\n</span>\n\n<span class=\"hm-attachment__body\">\n @if (linked()) {\n <a\n class=\"hm-attachment__name hm-attachment__name--link\"\n [href]=\"href()\"\n [attr.download]=\"download() ? name() : null\"\n [attr.title]=\"name()\"\n [attr.aria-describedby]=\"describedBy()\"\n >{{ name() }}</a>\n } @else {\n <span class=\"hm-attachment__name\" [attr.title]=\"name()\">{{ name() }}</span>\n }\n @if (metaText()) {\n <span class=\"hm-attachment__meta\" [id]=\"metaId\">{{ metaText() }}</span>\n }\n @if (description()) {\n <span class=\"hm-attachment__description\" [id]=\"descriptionId\">{{ description() }}</span>\n }\n @if (errorText()) {\n <span class=\"hm-attachment__error\" [id]=\"errorId\">{{ errorText() }}</span>\n }\n</span>\n\n<span class=\"hm-attachment__actions\">\n <!-- Ações do app (baixar, abrir, copiar link...) entram antes das embutidas. -->\n <ng-content />\n @if (retryable() && status() === 'error') {\n <hm-icon-button\n class=\"hm-attachment__retry\"\n icon=\"refresh\"\n emphasis=\"subtle\"\n size=\"small\"\n [label]=\"retryLabel()\"\n [disabled]=\"disabled()\"\n (clicked)=\"retry()\"\n />\n }\n @if (removable()) {\n <hm-icon-button\n class=\"hm-attachment__remove\"\n icon=\"times\"\n emphasis=\"subtle\"\n size=\"small\"\n [label]=\"removeLabel()\"\n [disabled]=\"disabled()\"\n (clicked)=\"remove()\"\n />\n }\n</span>\n\n@if (status() === 'uploading') {\n <hm-progress\n class=\"hm-attachment__progress\"\n size=\"small\"\n [value]=\"progress()\"\n [label]=\"progressLabel()\"\n [labelHidden]=\"true\"\n />\n}\n\n<span class=\"hm-visually-hidden\" aria-live=\"polite\" aria-atomic=\"true\">{{ announcement() }}</span>\n","import {\n afterNextRender,\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n forwardRef,\n inject,\n Injector,\n input,\n} from '@angular/core';\nimport { useHermesIcons } from '@trismegisto/angular/icon';\nimport { ATTACHMENT_ICONS } from './icons.generated';\nimport { AttachmentGroupContract, HM_ATTACHMENT_GROUP } from './attachment.contract';\n\n/**\n * Como o grupo arruma os anexos: `list` (um por linha, largura toda), `inline` (cartões compactos que\n * quebram linha — embaixo de um campo de prompt, numa mensagem) ou `grid` (blocos com a miniatura em\n * cima — galeria de imagens).\n */\nexport type AttachmentGroupLayout = 'list' | 'inline' | 'grid';\n\n/**\n * Agrupa `hm-attachment` numa lista (`role=\"list\"`, cada anexo vira `listitem`) com um dos três\n * arranjos de `layout`. Os `hm-attachment` vão como filhos DIRETOS (um invólucro no meio quebra a\n * relação lista → item). Quando o app remove um anexo a pedido do \"remover\" dele, o foco vai para o\n * \"remover\" do anexo que ocupou o lugar (ou do anterior); sem nenhum, para o próprio grupo.\n */\n@Component({\n selector: 'hm-attachment-group',\n template: '<ng-content />',\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [{ provide: HM_ATTACHMENT_GROUP, useExisting: forwardRef(() => AttachmentGroupComponent) }],\n host: {\n role: 'list',\n '[class]': \"'hm-attachment-group hm-attachment-group--' + layout()\",\n '[attr.aria-label]': 'label() || null',\n // Alvo de foco programático quando o último anexo sai (fora da ordem do Tab).\n tabindex: '-1',\n },\n})\nexport class AttachmentGroupComponent implements AttachmentGroupContract {\n readonly #icons = useHermesIcons(ATTACHMENT_ICONS);\n /** Nome da lista para o leitor de tela (\"Anexos da mensagem\"). Recomendado com mais de um grupo na tela. */\n readonly label = input('');\n readonly layout = input<AttachmentGroupLayout>('list');\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly injector = inject(Injector);\n\n removing(element: HTMLElement): void {\n const index = this.items().indexOf(element);\n if (index < 0) return;\n afterNextRender(\n () => {\n // O app pode não remover (pediu confirmação, recusou): aí o foco fica onde está.\n if (element.isConnected) return;\n const items = this.items();\n const next = items[Math.min(index, items.length - 1)];\n const target = next?.querySelector<HTMLElement>('.hm-attachment__remove button') ?? next?.querySelector<HTMLElement>('a, button:not([disabled])');\n (target ?? this.host.nativeElement).focus();\n },\n { injector: this.injector },\n );\n }\n\n private items(): HTMLElement[] {\n return Array.from(this.host.nativeElement.querySelectorAll<HTMLElement>(':scope > hm-attachment'));\n }\n}\n","// Ponto de import `@trismegisto/angular/attachment` (secundário do ng-packagr): o que o public-api e as outras pastas usam\n// daqui. Ao criar arquivo público novo na pasta, acrescente a linha.\nexport * from './attachment.component';\nexport * from './attachment-group.component';\nexport * from './file-icon';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;AAmBO,MAAM,gBAAgB,GAA8B,CAAC,iBAAiB,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,SAAS,EAAE,cAAc,EAAE,aAAa,EAAE,SAAS,EAAE,YAAY,EAAE,UAAU,CAAC;;ACLhQ,MAAM,mBAAmB,GAAG,IAAI,cAAc,CAA0B,qBAAqB,CAAC;;ACdrG;AACA;AACA;AAEA,MAAM,gBAAgB,GAAwB,IAAI,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;AAElH;AACA,MAAM,iBAAiB,GAAgC,IAAI,GAAG,CAAC;IAC7D,CAAC,KAAK,EAAE,cAAc,CAA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,aAAa,CAAC,gBAAgB,CAAc,wBAAwB,CAAC,CAAC;IACpG;wGA3BW,wBAAwB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAxB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,wBAAwB,sfATxB,CAAC,EAAE,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAE,UAAU,CAAC,MAAM,wBAAwB,CAAC,EAAE,CAAC,0BAF5F,gBAAgB,EAAA,QAAA,EAAA,IAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;4FAWf,wBAAwB,EAAA,UAAA,EAAA,CAAA;kBAbpC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,qBAAqB;AAC/B,oBAAA,QAAQ,EAAE,gBAAgB;oBAC1B,eAAe,EAAE,uBAAuB,CAAC,MAAM;AAC/C,oBAAA,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAE,UAAU,CAAC,MAAK,wBAAyB,CAAC,EAAE,CAAC;AACtG,oBAAA,IAAI,EAAE;AACJ,wBAAA,IAAI,EAAE,MAAM;AACZ,wBAAA,SAAS,EAAE,wDAAwD;AACnE,wBAAA,mBAAmB,EAAE,iBAAiB;;AAEtC,wBAAA,QAAQ,EAAE,IAAI;AACf,qBAAA;AACF,iBAAA;;;ACvCD;AACA;;ACDA;;AAEG;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"trismegisto-angular-bubble.mjs","sources":["../../src/bubble/bubble.component.ts","../../src/bubble/index.ts","../../src/bubble/trismegisto-angular-bubble.ts"],"sourcesContent":["import { booleanAttribute, ChangeDetectionStrategy, Component, computed, inject, input, output } from '@angular/core';\nimport { formatMessage, pluralMessage } from '@trismegisto/primitives/i18n';\nimport { HERMES_MESSAGES } from '@trismegisto/angular/i18n';\nimport { HM_MESSAGE } from '@trismegisto/angular/message';\n\n/**\n * Variante do balão. `received` (superfície neutra) e `sent` (cor de ação) são os dois lados da\n * conversa; `system` é o aviso do próprio sistema no fluxo, sem balão; `emphasis` destaca uma\n * mensagem (menção, resposta fixada, aviso do assistente) com a tinta da cor de marca e um filete.\n */\nexport type BubbleVariant = 'received' | 'sent' | 'system' | 'emphasis';\n\n/** Uma reação sob o balão. `label` é o nome da reação para o leitor de tela (\"Curtir\"); sem ele, o\n * próprio emoji é lido. `selected` = a pessoa que lê reagiu com ela. */\nexport interface BubbleReaction {\n readonly emoji: string;\n readonly count: number;\n readonly label?: string;\n readonly selected?: boolean;\n}\n\n/**\n * Balão de conteúdo de uma mensagem. Dentro de um `hm-message`, a variante segue o lado da mensagem\n * (`end` → `sent`, `start` → `received`) quando `variant` não é passada.\n *\n * ```html\n * <hm-bubble>Consegue revisar o contrato hoje?</hm-bubble>\n * <hm-bubble variant=\"emphasis\">Lembrete: a reunião mudou para 15h.</hm-bubble>\n * <hm-bubble [reactions]=\"reacoes\" (reactionToggle)=\"alternar($event)\">Fechado!</hm-bubble>\n * <hm-bubble [typing]=\"true\" />\n * ```\n *\n * - `reactions`: lista de emoji com contagem, cada um um botão de alternância (`aria-pressed`) que\n * emite `reactionToggle` — quem decide somar ou tirar a reação é o app.\n * - `typing`: troca o conteúdo pelos três pontos de \"digitando\". O texto lido pelo leitor de tela\n * cita o autor do `hm-message` em volta (\"Ana está digitando…\"), quando há.\n *\n * Acessibilidade: as reações são uma lista nomeada (\"Reações\") de botões com nome completo\n * (\"Curtir: 3 reações\") e estado pressionado; o emoji visível fica fora da árvore para não ser lido\n * duas vezes. Os pontos animados são decorativos e param com `prefers-reduced-motion`.\n */\n@Component({\n selector: 'hm-bubble',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[class]': 'modifiers()',\n },\n template: `\n <div class=\"hm-bubble__content\">\n @if (typing()) {\n <span class=\"hm-bubble__typing\" aria-hidden=\"true\"><span></span><span></span><span></span></span>\n <span class=\"hm-visually-hidden\">{{ typingText() }}</span>\n } @else {\n <ng-content />\n }\n </div>\n @if (reactions().length) {\n <ul class=\"hm-bubble__reactions\" [attr.aria-label]=\"text.reactions\" data-hm-announce=\"off\">\n @for (reaction of reactions(); track reaction.emoji) {\n <li>\n <button\n type=\"button\"\n class=\"hm-bubble__reaction\"\n [class.hm-bubble__reaction--selected]=\"!!reaction.selected\"\n [attr.aria-pressed]=\"!!reaction.selected\"\n [attr.aria-label]=\"reactionLabel(reaction)\"\n (click)=\"reactionToggle.emit(reaction)\"\n >\n <span class=\"hm-bubble__emoji\" aria-hidden=\"true\">{{ reaction.emoji }}</span>\n <span class=\"hm-bubble__count\" aria-hidden=\"true\">{{ reaction.count }}</span>\n </button>\n </li>\n }\n </ul>\n }\n `,\n})\nexport class BubbleComponent {\n /** Sem valor: segue o `hm-message` em volta (`end` → `sent`); fora de um, `received`. */\n readonly variant = input<BubbleVariant | null>(null);\n readonly reactions = input<readonly BubbleReaction[]>([]);\n /** Indicador de \"digitando\" no lugar do conteúdo. */\n readonly typing = input(false, { transform: booleanAttribute });\n\n /** Clique numa reação (alternância): o app soma ou tira a reação da pessoa. */\n readonly reactionToggle = output<BubbleReaction>();\n\n private readonly message = inject(HM_MESSAGE, { optional: true });\n private readonly messages = inject(HERMES_MESSAGES);\n protected get text() {\n return this.messages.conversation;\n }\n\n protected readonly resolvedVariant = computed<BubbleVariant>(\n () => this.variant() ?? (this.message?.align() === 'end' ? 'sent' : 'received'),\n );\n protected readonly typingText = computed(() => {\n const author = this.message?.author() ?? '';\n const text = this.messages.conversation;\n return author ? formatMessage(text.typingAuthor, { name: author }) : text.typing;\n });\n protected readonly modifiers = computed(() => {\n const classes = ['hm-bubble', `hm-bubble--${this.resolvedVariant()}`];\n if (this.typing()) classes.push('hm-bubble--typing');\n return classes.join(' ');\n });\n\n protected reactionLabel(reaction: BubbleReaction): string {\n return pluralMessage(this.messages.conversation.reaction, reaction.count, this.messages.meta.locale, {\n emoji: reaction.label || reaction.emoji,\n });\n }\n}\n","// Ponto de import `@trismegisto/angular/bubble` (secundário do ng-packagr): o que o public-api e as outras pastas usam\n// daqui. Ao criar arquivo público novo na pasta, acrescente a linha.\nexport * from './bubble.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAqBA;;;;;;;;;;;;;;;;;;;AAmBG;MAqCU,eAAe,CAAA;;AAEjB,IAAA,OAAO,GAAG,KAAK,CAAuB,IAAI,8EAAC;AAC3C,IAAA,SAAS,GAAG,KAAK,CAA4B,EAAE,gFAAC;;IAEhD,MAAM,GAAG,KAAK,CAAC,KAAK,8EAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;;IAGtD,cAAc,GAAG,MAAM,EAAkB;IAEjC,OAAO,GAAG,MAAM,CAAC,UAAU,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AAChD,IAAA,QAAQ,GAAG,MAAM,CAAC,eAAe,CAAC;AACnD,IAAA,IAAc,IAAI,GAAA;AAChB,QAAA,OAAO,IAAI,CAAC,QAAQ,CAAC,YAAY;IACnC;AAEmB,IAAA,eAAe,GAAG,QAAQ,CAC3C,MAAM,IAAI,CAAC,OAAO,EAAE,KAAK,IAAI,CAAC,OAAO,EAAE,KAAK,EAAE,KAAK,KAAK,GAAG,MAAM,GAAG,UAAU,CAAC,sFAChF;AACkB,IAAA,UAAU,GAAG,QAAQ,CAAC,MAAK;QAC5C,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE;AAC3C,QAAA,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,YAAY;QACvC,OAAO,MAAM,GAAG,aAAa,CAAC,IAAI,CAAC,YAAY,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,GAAG,IAAI,CAAC,M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AA,EAAA,iBAAA,EAAA,QAAA,EAAA,UAAA,EAAA,QAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,OAAA,EAAA,EAAA,cAAA,EAAA,gBAAA,EAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,OAAA,EAAA,aAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EA9BhB;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BT,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;4FAEU,eAAe,EAAA,UAAA,EAAA,CAAA;kBApC3B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,WAAW;oBACrB,eAAe,EAAE,uBAAuB,CAAC,MAAM;AAC/C,oBAAA,IAAI,EAAE;AACJ,wBAAA,SAAS,EAAE,aAAa;AACzB,qBAAA;AACD,oBAAA,QAAQ,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BT,EAAA,CAAA;AACF,iBAAA;;;AC5ED;AACA;;ACDA;;AAEG;;"}
1
+ {"version":3,"file":"trismegisto-angular-bubble.mjs","sources":["../../src/bubble/bubble.component.ts","../../src/bubble/index.ts","../../src/bubble/trismegisto-angular-bubble.ts"],"sourcesContent":["import { booleanAttribute, ChangeDetectionStrategy, Component, computed, inject, input, output } from '@angular/core';\nimport { formatMessage, pluralMessage } from '@trismegisto/primitives/i18n';\nimport { HERMES_MESSAGES } from '@trismegisto/angular/i18n';\nimport { HM_MESSAGE } from '@trismegisto/angular/message';\n\n/**\n * Variante do balão. `received` (superfície neutra) e `sent` (cor de ação) são os dois lados da\n * conversa; `system` é o aviso do próprio sistema no fluxo, sem balão; `emphasis` destaca uma\n * mensagem (menção, resposta fixada, aviso do assistente) com a tinta da cor de marca e um filete.\n */\nexport type BubbleVariant = 'received' | 'sent' | 'system' | 'emphasis' | 'outline' | 'ghost';\n\n/** Uma reação sob o balão. `label` é o nome da reação para o leitor de tela (\"Curtir\"); sem ele, o\n * próprio emoji é lido. `selected` = a pessoa que lê reagiu com ela. */\nexport interface BubbleReaction {\n readonly emoji: string;\n readonly count: number;\n readonly label?: string;\n readonly selected?: boolean;\n}\n\n/**\n * Balão de conteúdo de uma mensagem. Dentro de um `hm-message`, a variante segue o lado da mensagem\n * (`end` → `sent`, `start` → `received`) quando `variant` não é passada.\n *\n * ```html\n * <hm-bubble>Consegue revisar o contrato hoje?</hm-bubble>\n * <hm-bubble variant=\"emphasis\">Lembrete: a reunião mudou para 15h.</hm-bubble>\n * <hm-bubble [reactions]=\"reacoes\" (reactionToggle)=\"alternar($event)\">Fechado!</hm-bubble>\n * <hm-bubble [typing]=\"true\" />\n * ```\n *\n * - `reactions`: lista de emoji com contagem, cada um um botão de alternância (`aria-pressed`) que\n * emite `reactionToggle` — quem decide somar ou tirar a reação é o app.\n * - `typing`: troca o conteúdo pelos três pontos de \"digitando\". O texto lido pelo leitor de tela\n * cita o autor do `hm-message` em volta (\"Ana está digitando…\"), quando há.\n *\n * Acessibilidade: as reações são uma lista nomeada (\"Reações\") de botões com nome completo\n * (\"Curtir: 3 reações\") e estado pressionado; o emoji visível fica fora da árvore para não ser lido\n * duas vezes. Os pontos animados são decorativos e param com `prefers-reduced-motion`.\n */\n@Component({\n selector: 'hm-bubble',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[class]': 'modifiers()',\n },\n template: `\n <div class=\"hm-bubble__content\">\n @if (typing()) {\n <span class=\"hm-bubble__typing\" aria-hidden=\"true\"><span></span><span></span><span></span></span>\n <span class=\"hm-visually-hidden\">{{ typingText() }}</span>\n } @else {\n <ng-content />\n }\n </div>\n @if (reactions().length) {\n <ul class=\"hm-bubble__reactions\" [attr.aria-label]=\"text.reactions\" data-hm-announce=\"off\">\n @for (reaction of reactions(); track reaction.emoji) {\n <li>\n <button\n type=\"button\"\n class=\"hm-bubble__reaction\"\n [class.hm-bubble__reaction--selected]=\"!!reaction.selected\"\n [attr.aria-pressed]=\"!!reaction.selected\"\n [attr.aria-label]=\"reactionLabel(reaction)\"\n (click)=\"reactionToggle.emit(reaction)\"\n >\n <span class=\"hm-bubble__emoji\" aria-hidden=\"true\">{{ reaction.emoji }}</span>\n <span class=\"hm-bubble__count\" aria-hidden=\"true\">{{ reaction.count }}</span>\n </button>\n </li>\n }\n </ul>\n }\n `,\n})\nexport class BubbleComponent {\n /** Sem valor: segue o `hm-message` em volta (`end` → `sent`); fora de um, `received`. */\n readonly variant = input<BubbleVariant | null>(null);\n readonly reactions = input<readonly BubbleReaction[]>([]);\n /** Indicador de \"digitando\" no lugar do conteúdo. */\n readonly typing = input(false, { transform: booleanAttribute });\n\n /** Clique numa reação (alternância): o app soma ou tira a reação da pessoa. */\n readonly reactionToggle = output<BubbleReaction>();\n\n private readonly message = inject(HM_MESSAGE, { optional: true });\n private readonly messages = inject(HERMES_MESSAGES);\n protected get text() {\n return this.messages.conversation;\n }\n\n protected readonly resolvedVariant = computed<BubbleVariant>(\n () => this.variant() ?? (this.message?.align() === 'end' ? 'sent' : 'received'),\n );\n protected readonly typingText = computed(() => {\n const author = this.message?.author() ?? '';\n const text = this.messages.conversation;\n return author ? formatMessage(text.typingAuthor, { name: author }) : text.typing;\n });\n protected readonly modifiers = computed(() => {\n const classes = ['hm-bubble', `hm-bubble--${this.resolvedVariant()}`];\n if (this.typing()) classes.push('hm-bubble--typing');\n return classes.join(' ');\n });\n\n protected reactionLabel(reaction: BubbleReaction): string {\n return pluralMessage(this.messages.conversation.reaction, reaction.count, this.messages.meta.locale, {\n emoji: reaction.label || reaction.emoji,\n });\n }\n}\n","// Ponto de import `@trismegisto/angular/bubble` (secundário do ng-packagr): o que o public-api e as outras pastas usam\n// daqui. Ao criar arquivo público novo na pasta, acrescente a linha.\nexport * from './bubble.component';\n","/**\n * Generated b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