@meistrari/chat-nuxt 3.17.0-rc.1 → 3.17.0-rc.2

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.
package/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@meistrari/chat-nuxt",
3
3
  "configKey": "chatNuxt",
4
- "version": "3.17.0-rc.1",
4
+ "version": "3.17.0-rc.2",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "unknown"
@@ -3,10 +3,6 @@ const props = defineProps({
3
3
  citation: { type: Object, required: true }
4
4
  });
5
5
  const faviconFailed = ref(false);
6
- const shouldLoadFavicon = ref(false);
7
- function activatePreviewAssets() {
8
- shouldLoadFavicon.value = true;
9
- }
10
6
  const accessibleLabel = computed(() => `${props.citation.sourceLabel}: ${props.citation.title}`);
11
7
  </script>
12
8
 
@@ -25,13 +21,12 @@ const accessibleLabel = computed(() => `${props.citation.sourceLabel}: ${props.c
25
21
  class="url-citation-pill"
26
22
  body-11-medium
27
23
  :aria-label="accessibleLabel"
28
- @pointerenter="activatePreviewAssets"
29
- @focus="activatePreviewAssets"
30
24
  >
31
25
  <img
32
- v-if="shouldLoadFavicon && !faviconFailed"
26
+ v-if="!faviconFailed"
33
27
  :src="citation.faviconUrl"
34
28
  alt=""
29
+ loading="lazy"
35
30
  class="url-citation-favicon"
36
31
  referrerpolicy="no-referrer"
37
32
  @error="faviconFailed = true"
@@ -44,7 +39,7 @@ const accessibleLabel = computed(() => `${props.citation.sourceLabel}: ${props.c
44
39
  <div class="url-citation-card" bg-white flex="~ col" gap-10px p-12px>
45
40
  <div flex items-center gap-7px min-w-0>
46
41
  <img
47
- v-if="shouldLoadFavicon && !faviconFailed"
42
+ v-if="!faviconFailed"
48
43
  :src="citation.faviconUrl"
49
44
  alt=""
50
45
  class="url-citation-card__favicon"
@@ -1,14 +1,12 @@
1
+ import { getDomainWithoutSuffix } from "tldts";
1
2
  const URL_CITATION_MARKER = "#citation";
2
3
  const FAVICON_PROXY_PATH = "/api/citation-favicon";
3
4
  function titleCase(value) {
4
5
  return value.replace(/[-_]+/g, " ").replace(/\b\p{L}/gu, (letter) => letter.toLocaleUpperCase());
5
6
  }
6
7
  function sourceLabelFor(hostname) {
7
- const parts = hostname.replace(/^www\./i, "").split(".");
8
- const compoundSuffix = parts.slice(-2).join(".");
9
- const suffixParts = (/* @__PURE__ */ new Set(["co.uk", "com.au", "com.br", "com.mx", "com.tr", "co.jp"])).has(compoundSuffix) ? 2 : 1;
10
- const brandIndex = Math.max(0, parts.length - suffixParts - 1);
11
- return titleCase(parts[brandIndex] || hostname);
8
+ const domainLabel = getDomainWithoutSuffix(hostname, { allowPrivateDomains: true });
9
+ return titleCase(domainLabel || hostname);
12
10
  }
13
11
  export function parseUrlCitation(href, label, markdownTitle) {
14
12
  if (!href.endsWith(URL_CITATION_MARKER))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meistrari/chat-nuxt",
3
- "version": "3.17.0-rc.1",
3
+ "version": "3.17.0-rc.2",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -58,6 +58,7 @@
58
58
  "pdfjs-dist": "^5.4.530",
59
59
  "posthog-js": "^1.364.2",
60
60
  "stream-diffs": "0.0.2",
61
+ "tldts": "^7.4.10",
61
62
  "virtua": "^0.42.0",
62
63
  "vue-i18n": "^11.0.0",
63
64
  "xlsx": "^0.18.5",