@verbaly/svelte 0.64.0 → 0.66.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/Trans.svelte +11 -8
  2. package/package.json +4 -4
package/dist/Trans.svelte CHANGED
@@ -13,14 +13,17 @@
13
13
  onDestroy(v.subscribe(() => (version = v.version)));
14
14
 
15
15
  const allowed = $derived(new Set(richTags ?? RICH_TAGS));
16
- // normalize + sanitize hrefs once (never from messages)
17
- const linkDefs = $derived(
18
- links
19
- ? Object.fromEntries(
20
- Object.entries(links).map(([name, link]) => [name, normalizeLink(link)]),
21
- )
22
- : undefined,
16
+ // null prototype: a tag named constructor in a message must never find the one on Object
17
+ const componentDefs = $derived(
18
+ components ? Object.assign(Object.create(null), components) : undefined,
23
19
  );
20
+ // normalize + sanitize hrefs once (never from messages)
21
+ const linkDefs = $derived.by(() => {
22
+ if (!links) return undefined;
23
+ const defs = Object.create(null);
24
+ for (const [name, link] of Object.entries(links)) defs[name] = normalizeLink(link);
25
+ return defs;
26
+ });
24
27
  // version keeps this reactive to locale/catalog changes
25
28
  const nodes = $derived.by(() => {
26
29
  void version;
@@ -28,4 +31,4 @@
28
31
  });
29
32
  </script>
30
33
 
31
- <TransNodes {nodes} {allowed} {components} links={linkDefs} />
34
+ <TransNodes {nodes} {allowed} components={componentDefs} links={linkDefs} />
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@verbaly/svelte",
3
- "version": "0.64.0",
3
+ "version": "0.66.0",
4
4
  "description": "Svelte bindings for Verbaly: stores over the reactive core.",
5
5
  "keywords": [
6
6
  "i18n",
@@ -45,13 +45,13 @@
45
45
  },
46
46
  "peerDependencies": {
47
47
  "svelte": "^5.0.0",
48
- "verbaly": "^0.64.0"
48
+ "verbaly": "^0.66.0"
49
49
  },
50
50
  "devDependencies": {
51
- "@sveltejs/vite-plugin-svelte": "^7.3.0",
51
+ "@sveltejs/vite-plugin-svelte": "^7.3.1",
52
52
  "happy-dom": "^20.14.5",
53
53
  "svelte": "^5.57.1",
54
- "verbaly": "^0.64.0"
54
+ "verbaly": "^0.66.0"
55
55
  },
56
56
  "scripts": {
57
57
  "build": "tsdown && node scripts/copy-svelte.mjs",