@htmlbricks/hb-messages-topics-card 0.68.6 → 0.68.8

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/manifest.json CHANGED
@@ -261,7 +261,7 @@
261
261
  "counter": 0,
262
262
  "text": "Hello 0",
263
263
  "title": "Hello0",
264
- "time": "2026-03-30T21:47:24.582Z",
264
+ "time": "2026-03-30T22:19:58.500Z",
265
265
  "img_uri": "https://www.w3schools.com/howto/img_avatar.png"
266
266
  },
267
267
  {
@@ -269,7 +269,7 @@
269
269
  "counter": 0,
270
270
  "text": "Hello 1",
271
271
  "title": "Hello1",
272
- "time": "2026-03-30T21:47:24.582Z",
272
+ "time": "2026-03-30T22:19:58.500Z",
273
273
  "img_uri": "https://www.w3schools.com/howto/img_avatar.png"
274
274
  },
275
275
  {
@@ -277,7 +277,7 @@
277
277
  "counter": 0,
278
278
  "text": "Hello 2",
279
279
  "title": "Hello2",
280
- "time": "2026-03-30T21:47:24.582Z",
280
+ "time": "2026-03-30T22:19:58.500Z",
281
281
  "img_uri": "https://www.w3schools.com/howto/img_avatar.png"
282
282
  }
283
283
  ]
@@ -292,7 +292,7 @@
292
292
  "counter": 0,
293
293
  "text": "Hello 0",
294
294
  "title": "Hello0",
295
- "time": "2026-03-30T21:47:24.582Z",
295
+ "time": "2026-03-30T22:19:58.500Z",
296
296
  "img_uri": "https://www.w3schools.com/howto/img_avatar.png"
297
297
  },
298
298
  {
@@ -300,7 +300,7 @@
300
300
  "counter": 0,
301
301
  "text": "Hello 1",
302
302
  "title": "Hello1",
303
- "time": "2026-03-30T21:47:24.582Z",
303
+ "time": "2026-03-30T22:19:58.500Z",
304
304
  "img_uri": "https://www.w3schools.com/howto/img_avatar.png",
305
305
  "_selected": true
306
306
  },
@@ -309,7 +309,7 @@
309
309
  "counter": 0,
310
310
  "text": "Hello 2",
311
311
  "title": "Hello2",
312
- "time": "2026-03-30T21:47:24.582Z",
312
+ "time": "2026-03-30T22:19:58.500Z",
313
313
  "img_uri": "https://www.w3schools.com/howto/img_avatar.png"
314
314
  }
315
315
  ]
@@ -325,7 +325,7 @@
325
325
  "counter": 3,
326
326
  "text": "Can you review the PR?",
327
327
  "title": "Engineering",
328
- "time": "2026-03-30T21:47:24.582Z",
328
+ "time": "2026-03-30T22:19:58.500Z",
329
329
  "img_uri": "https://www.w3schools.com/howto/img_avatar.png"
330
330
  },
331
331
  {
@@ -333,7 +333,7 @@
333
333
  "counter": 12,
334
334
  "text": "Contract signed",
335
335
  "title": "Sales",
336
- "time": "2026-03-30T21:47:24.582Z",
336
+ "time": "2026-03-30T22:19:58.500Z",
337
337
  "img_uri": "https://www.w3schools.com/howto/img_avatar.png"
338
338
  },
339
339
  {
@@ -341,7 +341,7 @@
341
341
  "counter": 1,
342
342
  "text": "Ticket #4421 updated",
343
343
  "title": "Support",
344
- "time": "2026-03-30T21:47:24.582Z",
344
+ "time": "2026-03-30T22:19:58.500Z",
345
345
  "img_uri": "https://www.w3schools.com/howto/img_avatar.png"
346
346
  }
347
347
  ]
@@ -357,7 +357,7 @@
357
357
  "counter": 0,
358
358
  "text": "Only conversation in the list",
359
359
  "title": "Direct message",
360
- "time": "2026-03-30T21:47:24.582Z",
360
+ "time": "2026-03-30T22:19:58.500Z",
361
361
  "img_uri": "https://www.w3schools.com/howto/img_avatar.png",
362
362
  "_selected": true
363
363
  }
@@ -386,5 +386,5 @@
386
386
  "size": {},
387
387
  "iifePath": "main.iife.js",
388
388
  "repoName": "@htmlbricks/hb-messages-topics-card",
389
- "version": "0.68.6"
389
+ "version": "0.68.8"
390
390
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@htmlbricks/hb-messages-topics-card",
3
- "version": "0.68.6",
3
+ "version": "0.68.8",
4
4
  "contributors": [],
5
5
  "description": "Lists chat or channel previews from `chats`: avatar, title, last message snippet, derived time label, and unread `counter` badge. Clicking a row marks it selected (`_selected`) and dispatches `select` with that chat payload for opening a thread or switching context.",
6
6
  "licenses": [
@@ -4,17 +4,30 @@
4
4
  */
5
5
  import type { Component, Events } from "./webcomponent.type";
6
6
 
7
+ /**
8
+ * Host properties already on `HTMLElement` (no `svelte/elements` here — DOM typings stay
9
+ * usable without Svelte). Custom `Component` keys that collide stay on the native typing.
10
+ */
7
11
  type DomKeys = keyof HTMLElement;
8
12
  type HbComponentAttrs = {
9
13
  [K in keyof Component as K extends DomKeys ? never : K]?: string;
10
14
  };
11
15
 
16
+ type HbHtmlElementWithoutListeners = Omit<
17
+ HTMLElement,
18
+ "addEventListener" | "removeEventListener"
19
+ >;
20
+
12
21
  /**
13
22
  * Re-declare listener methods so custom `Events` overloads are compatible with
14
23
  * `HTMLElement` (subclass methods must remain assignable to the base signatures).
24
+ *
25
+ * Like `svelte-elements.d.ts`, we `Omit` keys we define on `HbComponentAttrs` from the DOM
26
+ * base, then add them back: avoids `extends A, B` merging the same key with incompatible types
27
+ * if a name slips past `DomKeys`.
15
28
  */
16
29
  export interface HbMessagesTopicsCardElement
17
- extends Omit<HTMLElement, "addEventListener" | "removeEventListener">,
30
+ extends Omit<HbHtmlElementWithoutListeners, keyof HbComponentAttrs>,
18
31
  HbComponentAttrs {
19
32
  addEventListener<K extends keyof HTMLElementEventMap>(
20
33
  type: K,
@@ -8,9 +8,13 @@
8
8
  import type { HTMLAttributes } from "svelte/elements";
9
9
  import type { Component, Events } from "./webcomponent.type";
10
10
 
11
- type DomKeys = keyof HTMLElement;
11
+ /**
12
+ * Keys already modeled on `HTMLAttributes` (global attrs + DOM listeners). Exclude these from
13
+ * `Component` so host props stay plain strings and are not merged with unrelated DOM typings.
14
+ */
15
+ type HtmlReservedAttrKeys = keyof HTMLAttributes<HTMLElement>;
12
16
  type HbSvelteAttrs = {
13
- [K in keyof Component as K extends DomKeys ? never : K]?: string;
17
+ [K in keyof Component as K extends HtmlReservedAttrKeys ? never : K]?: string;
14
18
  };
15
19
 
16
20
  /** `detail` matches `Events[K]`; `currentTarget` is the host element. */
@@ -26,9 +30,21 @@ type HbSvelteEventAttrs = {
26
30
  [K in keyof Events & string as `on:${K}`]?: HbSvelteCustomEventHandler<Events[K]>;
27
31
  };
28
32
 
33
+ /**
34
+ * Strip keys we re-declare from Svelte’s base, then add them back: plain intersection would
35
+ * merge `on*` / attrs with conflicting DOM typings (`string & EventHandler` → errors or
36
+ * props treated like listeners).
37
+ */
38
+ type HbSvelteHostAttributes = Omit<
39
+ HTMLAttributes<HTMLElement>,
40
+ keyof HbSvelteAttrs | keyof HbSvelteEventAttrs
41
+ > &
42
+ HbSvelteAttrs &
43
+ HbSvelteEventAttrs;
44
+
29
45
  declare module "svelte/elements" {
30
46
  export interface SvelteHTMLElements {
31
- "hb-messages-topics-card": HTMLAttributes<HTMLElement> & HbSvelteAttrs & HbSvelteEventAttrs;
47
+ "hb-messages-topics-card": HbSvelteHostAttributes;
32
48
  }
33
49
  }
34
50