@cossistant/react 0.0.26 → 0.0.29

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 (247) hide show
  1. package/README.md +1 -1
  2. package/api.d.ts +1 -1
  3. package/api.d.ts.map +1 -1
  4. package/checks.d.ts +1 -1
  5. package/checks.d.ts.map +1 -1
  6. package/coerce.d.ts +1 -1
  7. package/coerce.d.ts.map +1 -1
  8. package/conversation.d.ts +6 -3
  9. package/conversation.d.ts.map +1 -1
  10. package/core.d.ts +1 -1
  11. package/core.d.ts.map +1 -1
  12. package/errors.d.ts +12 -3
  13. package/errors.d.ts.map +1 -1
  14. package/errors2.d.ts +1 -1
  15. package/errors2.d.ts.map +1 -1
  16. package/hooks/index.d.ts +3 -2
  17. package/hooks/index.js +6 -5
  18. package/hooks/private/store/use-website-store.js +2 -1
  19. package/hooks/private/store/use-website-store.js.map +1 -1
  20. package/hooks/private/use-client-query.d.ts +6 -0
  21. package/hooks/private/use-client-query.d.ts.map +1 -1
  22. package/hooks/private/use-client-query.js +26 -3
  23. package/hooks/private/use-client-query.js.map +1 -1
  24. package/hooks/private/use-grouped-messages.d.ts +8 -5
  25. package/hooks/private/use-grouped-messages.d.ts.map +1 -1
  26. package/hooks/private/use-grouped-messages.js +44 -11
  27. package/hooks/private/use-grouped-messages.js.map +1 -1
  28. package/hooks/private/use-multimodal-input.d.ts.map +1 -1
  29. package/hooks/private/use-multimodal-input.js +7 -5
  30. package/hooks/private/use-multimodal-input.js.map +1 -1
  31. package/hooks/private/use-visitor-typing-reporter.d.ts +18 -1
  32. package/hooks/private/use-visitor-typing-reporter.d.ts.map +1 -1
  33. package/hooks/private/use-visitor-typing-reporter.js +34 -4
  34. package/hooks/private/use-visitor-typing-reporter.js.map +1 -1
  35. package/hooks/use-conversation-page.d.ts +1 -0
  36. package/hooks/use-conversation-page.d.ts.map +1 -1
  37. package/hooks/use-conversation-page.js +6 -1
  38. package/hooks/use-conversation-page.js.map +1 -1
  39. package/hooks/use-conversation-preview.d.ts +2 -1
  40. package/hooks/use-conversation-preview.d.ts.map +1 -1
  41. package/hooks/use-conversation-preview.js +1 -1
  42. package/hooks/use-conversation-preview.js.map +1 -1
  43. package/hooks/use-conversation-seen.js +1 -1
  44. package/hooks/use-conversation-seen.js.map +1 -1
  45. package/hooks/use-conversation-timeline-items.js +2 -1
  46. package/hooks/use-conversation-timeline-items.js.map +1 -1
  47. package/hooks/use-conversation-timeline.d.ts.map +1 -1
  48. package/hooks/use-conversation-timeline.js +1 -3
  49. package/hooks/use-conversation-timeline.js.map +1 -1
  50. package/hooks/use-conversation.js +2 -1
  51. package/hooks/use-conversation.js.map +1 -1
  52. package/hooks/use-conversations.js +1 -0
  53. package/hooks/use-conversations.js.map +1 -1
  54. package/hooks/use-create-conversation.d.ts.map +1 -1
  55. package/hooks/use-file-upload.d.ts +55 -0
  56. package/hooks/use-file-upload.d.ts.map +1 -0
  57. package/hooks/use-file-upload.js +100 -0
  58. package/hooks/use-file-upload.js.map +1 -0
  59. package/hooks/use-message-composer.d.ts +11 -0
  60. package/hooks/use-message-composer.d.ts.map +1 -1
  61. package/hooks/use-message-composer.js +7 -3
  62. package/hooks/use-message-composer.js.map +1 -1
  63. package/hooks/use-send-message.d.ts +1 -0
  64. package/hooks/use-send-message.d.ts.map +1 -1
  65. package/hooks/use-send-message.js +63 -11
  66. package/hooks/use-send-message.js.map +1 -1
  67. package/index.d.ts +7 -4
  68. package/index.js +13 -10
  69. package/json-schema.d.ts +70 -0
  70. package/json-schema.d.ts.map +1 -0
  71. package/package.json +4 -3
  72. package/parse.d.ts +1 -1
  73. package/parse.d.ts.map +1 -1
  74. package/primitives/avatar/fallback.d.ts.map +1 -1
  75. package/primitives/avatar/fallback.js +1 -1
  76. package/primitives/avatar/fallback.js.map +1 -1
  77. package/primitives/conversation-timeline.d.ts.map +1 -1
  78. package/primitives/conversation-timeline.js +10 -5
  79. package/primitives/conversation-timeline.js.map +1 -1
  80. package/primitives/day-separator.d.ts +76 -0
  81. package/primitives/day-separator.d.ts.map +1 -0
  82. package/primitives/day-separator.js +111 -0
  83. package/primitives/day-separator.js.map +1 -0
  84. package/primitives/index.d.ts +5 -3
  85. package/primitives/index.js +17 -5
  86. package/primitives/index.parts.d.ts +4 -2
  87. package/primitives/index.parts.js +5 -3
  88. package/primitives/timeline-item-attachments.d.ts +100 -0
  89. package/primitives/timeline-item-attachments.d.ts.map +1 -0
  90. package/primitives/timeline-item-attachments.js +151 -0
  91. package/primitives/timeline-item-attachments.js.map +1 -0
  92. package/primitives/timeline-item-group.d.ts.map +1 -1
  93. package/primitives/timeline-item-group.js +1 -1
  94. package/primitives/timeline-item-group.js.map +1 -1
  95. package/primitives/timeline-item.js +1 -1
  96. package/primitives/timeline-item.js.map +1 -1
  97. package/primitives/trigger.d.ts +91 -0
  98. package/primitives/trigger.d.ts.map +1 -0
  99. package/primitives/trigger.js +74 -0
  100. package/primitives/trigger.js.map +1 -0
  101. package/primitives/window.d.ts +22 -1
  102. package/primitives/window.d.ts.map +1 -1
  103. package/primitives/window.js +91 -5
  104. package/primitives/window.js.map +1 -1
  105. package/provider.d.ts.map +1 -1
  106. package/provider.js +8 -3
  107. package/provider.js.map +1 -1
  108. package/realtime/index.js +1 -1
  109. package/realtime/provider.js +1 -1
  110. package/realtime/support-provider.js +5 -1
  111. package/realtime/support-provider.js.map +1 -1
  112. package/realtime-events.d.ts +165 -2
  113. package/realtime-events.d.ts.map +1 -1
  114. package/registries.d.ts +1 -1
  115. package/registries.d.ts.map +1 -1
  116. package/schemas.d.ts +305 -7
  117. package/schemas.d.ts.map +1 -1
  118. package/schemas2.d.ts +29 -4
  119. package/schemas2.d.ts.map +1 -1
  120. package/schemas3.d.ts +2 -1
  121. package/schemas3.d.ts.map +1 -1
  122. package/standard-schema.d.ts +83 -21
  123. package/standard-schema.d.ts.map +1 -1
  124. package/support/components/button.d.ts +1 -1
  125. package/support/components/content.d.ts +30 -0
  126. package/support/components/content.d.ts.map +1 -0
  127. package/support/components/content.js +282 -0
  128. package/support/components/content.js.map +1 -0
  129. package/support/components/conversation-button-link.js +1 -1
  130. package/support/components/conversation-timeline.d.ts +5 -0
  131. package/support/components/conversation-timeline.d.ts.map +1 -1
  132. package/support/components/conversation-timeline.js +25 -5
  133. package/support/components/conversation-timeline.js.map +1 -1
  134. package/support/components/header.js +1 -1
  135. package/support/components/image-lightbox.d.ts +49 -0
  136. package/support/components/image-lightbox.d.ts.map +1 -0
  137. package/support/components/image-lightbox.js +142 -0
  138. package/support/components/image-lightbox.js.map +1 -0
  139. package/support/components/index.d.ts +5 -4
  140. package/support/components/index.js +4 -4
  141. package/support/components/multimodal-input.d.ts +4 -1
  142. package/support/components/multimodal-input.d.ts.map +1 -1
  143. package/support/components/multimodal-input.js +71 -45
  144. package/support/components/multimodal-input.js.map +1 -1
  145. package/support/components/navigation-tab.js +1 -1
  146. package/support/components/root.d.ts +23 -0
  147. package/support/components/root.d.ts.map +1 -0
  148. package/support/components/root.js +36 -0
  149. package/support/components/root.js.map +1 -0
  150. package/support/components/timeline-message-item.d.ts.map +1 -1
  151. package/support/components/timeline-message-item.js +82 -18
  152. package/support/components/timeline-message-item.js.map +1 -1
  153. package/support/components/trigger.d.ts +14 -0
  154. package/support/components/trigger.d.ts.map +1 -0
  155. package/support/components/{bubble.js → trigger.js} +16 -12
  156. package/support/components/trigger.js.map +1 -0
  157. package/support/components/typing-indicator.d.ts.map +1 -1
  158. package/support/components/typing-indicator.js +1 -0
  159. package/support/components/typing-indicator.js.map +1 -1
  160. package/support/context/controlled-state.d.ts +46 -0
  161. package/support/context/controlled-state.d.ts.map +1 -0
  162. package/support/context/controlled-state.js +34 -0
  163. package/support/context/controlled-state.js.map +1 -0
  164. package/support/context/events.d.ts +103 -0
  165. package/support/context/events.d.ts.map +1 -0
  166. package/support/context/events.js +139 -0
  167. package/support/context/events.js.map +1 -0
  168. package/support/context/handle.d.ts +90 -0
  169. package/support/context/handle.d.ts.map +1 -0
  170. package/support/context/handle.js +79 -0
  171. package/support/context/handle.js.map +1 -0
  172. package/support/context/positioning.d.ts +17 -0
  173. package/support/context/positioning.d.ts.map +1 -0
  174. package/support/context/positioning.js +26 -0
  175. package/support/context/positioning.js.map +1 -0
  176. package/support/context/slots.d.ts +85 -0
  177. package/support/context/slots.d.ts.map +1 -0
  178. package/support/context/slots.js +115 -0
  179. package/support/context/slots.js.map +1 -0
  180. package/support/context/websocket.d.ts +8 -1
  181. package/support/context/websocket.d.ts.map +1 -1
  182. package/support/context/websocket.js +8 -1
  183. package/support/context/websocket.js.map +1 -1
  184. package/support/index.d.ts +239 -54
  185. package/support/index.d.ts.map +1 -1
  186. package/support/index.js +254 -33
  187. package/support/index.js.map +1 -1
  188. package/support/pages/articles.d.ts.map +1 -1
  189. package/support/pages/articles.js +3 -4
  190. package/support/pages/articles.js.map +1 -1
  191. package/support/pages/conversation-history.js +2 -2
  192. package/support/pages/conversation.js +6 -5
  193. package/support/pages/conversation.js.map +1 -1
  194. package/support/pages/home.js +2 -2
  195. package/support/router.d.ts +52 -12
  196. package/support/router.d.ts.map +1 -1
  197. package/support/router.js +78 -30
  198. package/support/router.js.map +1 -1
  199. package/support/store/index.d.ts +2 -2
  200. package/support/store/support-store.d.ts +26 -20
  201. package/support/store/support-store.d.ts.map +1 -1
  202. package/support/store/support-store.js +47 -6
  203. package/support/store/support-store.js.map +1 -1
  204. package/support/{support-D2EgfIts.css → support-C7Xaw-N6.css} +1 -2
  205. package/support/support-C7Xaw-N6.css.map +1 -0
  206. package/support/text/index.d.ts +1 -1
  207. package/support/text/index.d.ts.map +1 -1
  208. package/support/text/index.js.map +1 -1
  209. package/support/types.d.ts +75 -12
  210. package/support/types.d.ts.map +1 -1
  211. package/support.css +2 -2
  212. package/tailwind.css +0 -1
  213. package/timeline-item.d.ts +68 -2
  214. package/timeline-item.d.ts.map +1 -1
  215. package/to-json-schema.d.ts +96 -0
  216. package/to-json-schema.d.ts.map +1 -0
  217. package/util.d.ts +6 -2
  218. package/util.d.ts.map +1 -1
  219. package/utils/index.d.ts +2 -1
  220. package/utils/index.js +2 -1
  221. package/utils/merge-refs.d.ts +30 -0
  222. package/utils/merge-refs.d.ts.map +1 -0
  223. package/utils/merge-refs.js +46 -0
  224. package/utils/merge-refs.js.map +1 -0
  225. package/utils/use-render-element.d.ts.map +1 -1
  226. package/utils/use-render-element.js +36 -8
  227. package/utils/use-render-element.js.map +1 -1
  228. package/versions.d.ts +2 -2
  229. package/versions.d.ts.map +1 -1
  230. package/zod-extensions.d.ts +1 -1
  231. package/zod-extensions.d.ts.map +1 -1
  232. package/primitives/bubble.d.ts +0 -38
  233. package/primitives/bubble.d.ts.map +0 -1
  234. package/primitives/bubble.js +0 -57
  235. package/primitives/bubble.js.map +0 -1
  236. package/support/components/bubble.d.ts +0 -10
  237. package/support/components/bubble.d.ts.map +0 -1
  238. package/support/components/bubble.js.map +0 -1
  239. package/support/components/container.d.ts +0 -13
  240. package/support/components/container.d.ts.map +0 -1
  241. package/support/components/container.js +0 -109
  242. package/support/components/container.js.map +0 -1
  243. package/support/components/support-content.d.ts +0 -22
  244. package/support/components/support-content.d.ts.map +0 -1
  245. package/support/components/support-content.js +0 -48
  246. package/support/components/support-content.js.map +0 -1
  247. package/support/support-D2EgfIts.css.map +0 -1
@@ -0,0 +1,70 @@
1
+ //#region ../../node_modules/.bun/zod@4.2.1/node_modules/zod/v4/core/json-schema.d.cts
2
+ type _JSONSchema = boolean | JSONSchema;
3
+ type JSONSchema = {
4
+ [k: string]: unknown;
5
+ $schema?: "https://json-schema.org/draft/2020-12/schema" | "http://json-schema.org/draft-07/schema#" | "http://json-schema.org/draft-04/schema#";
6
+ $id?: string;
7
+ $anchor?: string;
8
+ $ref?: string;
9
+ $dynamicRef?: string;
10
+ $dynamicAnchor?: string;
11
+ $vocabulary?: Record<string, boolean>;
12
+ $comment?: string;
13
+ $defs?: Record<string, JSONSchema>;
14
+ type?: "object" | "array" | "string" | "number" | "boolean" | "null" | "integer";
15
+ additionalItems?: _JSONSchema;
16
+ unevaluatedItems?: _JSONSchema;
17
+ prefixItems?: _JSONSchema[];
18
+ items?: _JSONSchema | _JSONSchema[];
19
+ contains?: _JSONSchema;
20
+ additionalProperties?: _JSONSchema;
21
+ unevaluatedProperties?: _JSONSchema;
22
+ properties?: Record<string, _JSONSchema>;
23
+ patternProperties?: Record<string, _JSONSchema>;
24
+ dependentSchemas?: Record<string, _JSONSchema>;
25
+ propertyNames?: _JSONSchema;
26
+ if?: _JSONSchema;
27
+ then?: _JSONSchema;
28
+ else?: _JSONSchema;
29
+ allOf?: JSONSchema[];
30
+ anyOf?: JSONSchema[];
31
+ oneOf?: JSONSchema[];
32
+ not?: _JSONSchema;
33
+ multipleOf?: number;
34
+ maximum?: number;
35
+ exclusiveMaximum?: number | boolean;
36
+ minimum?: number;
37
+ exclusiveMinimum?: number | boolean;
38
+ maxLength?: number;
39
+ minLength?: number;
40
+ pattern?: string;
41
+ maxItems?: number;
42
+ minItems?: number;
43
+ uniqueItems?: boolean;
44
+ maxContains?: number;
45
+ minContains?: number;
46
+ maxProperties?: number;
47
+ minProperties?: number;
48
+ required?: string[];
49
+ dependentRequired?: Record<string, string[]>;
50
+ enum?: Array<string | number | boolean | null>;
51
+ const?: string | number | boolean | null;
52
+ id?: string;
53
+ title?: string;
54
+ description?: string;
55
+ default?: unknown;
56
+ deprecated?: boolean;
57
+ readOnly?: boolean;
58
+ writeOnly?: boolean;
59
+ nullable?: boolean;
60
+ examples?: unknown[];
61
+ format?: string;
62
+ contentMediaType?: string;
63
+ contentEncoding?: string;
64
+ contentSchema?: JSONSchema;
65
+ _prefault?: unknown;
66
+ };
67
+ type BaseSchema = JSONSchema;
68
+ //#endregion
69
+ export { BaseSchema };
70
+ //# sourceMappingURL=json-schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"json-schema.d.ts","names":["Schema","ObjectSchema","ArraySchema","StringSchema","NumberSchema","IntegerSchema","BooleanSchema","NullSchema","_JSONSchema","JSONSchema","Record","Array","BaseSchema"],"sources":["../../../node_modules/.bun/zod@4.2.1/node_modules/zod/v4/core/json-schema.d.cts"],"sourcesContent":["export type Schema = ObjectSchema | ArraySchema | StringSchema | NumberSchema | IntegerSchema | BooleanSchema | NullSchema;\nexport type _JSONSchema = boolean | JSONSchema;\nexport type JSONSchema = {\n [k: string]: unknown;\n $schema?: \"https://json-schema.org/draft/2020-12/schema\" | \"http://json-schema.org/draft-07/schema#\" | \"http://json-schema.org/draft-04/schema#\";\n $id?: string;\n $anchor?: string;\n $ref?: string;\n $dynamicRef?: string;\n $dynamicAnchor?: string;\n $vocabulary?: Record<string, boolean>;\n $comment?: string;\n $defs?: Record<string, JSONSchema>;\n type?: \"object\" | \"array\" | \"string\" | \"number\" | \"boolean\" | \"null\" | \"integer\";\n additionalItems?: _JSONSchema;\n unevaluatedItems?: _JSONSchema;\n prefixItems?: _JSONSchema[];\n items?: _JSONSchema | _JSONSchema[];\n contains?: _JSONSchema;\n additionalProperties?: _JSONSchema;\n unevaluatedProperties?: _JSONSchema;\n properties?: Record<string, _JSONSchema>;\n patternProperties?: Record<string, _JSONSchema>;\n dependentSchemas?: Record<string, _JSONSchema>;\n propertyNames?: _JSONSchema;\n if?: _JSONSchema;\n then?: _JSONSchema;\n else?: _JSONSchema;\n allOf?: JSONSchema[];\n anyOf?: JSONSchema[];\n oneOf?: JSONSchema[];\n not?: _JSONSchema;\n multipleOf?: number;\n maximum?: number;\n exclusiveMaximum?: number | boolean;\n minimum?: number;\n exclusiveMinimum?: number | boolean;\n maxLength?: number;\n minLength?: number;\n pattern?: string;\n maxItems?: number;\n minItems?: number;\n uniqueItems?: boolean;\n maxContains?: number;\n minContains?: number;\n maxProperties?: number;\n minProperties?: number;\n required?: string[];\n dependentRequired?: Record<string, string[]>;\n enum?: Array<string | number | boolean | null>;\n const?: string | number | boolean | null;\n id?: string;\n title?: string;\n description?: string;\n default?: unknown;\n deprecated?: boolean;\n readOnly?: boolean;\n writeOnly?: boolean;\n nullable?: boolean;\n examples?: unknown[];\n format?: string;\n contentMediaType?: string;\n contentEncoding?: string;\n contentSchema?: JSONSchema;\n _prefault?: unknown;\n};\nexport type BaseSchema = JSONSchema;\nexport interface ObjectSchema extends JSONSchema {\n type: \"object\";\n}\nexport interface ArraySchema extends JSONSchema {\n type: \"array\";\n}\nexport interface StringSchema extends JSONSchema {\n type: \"string\";\n}\nexport interface NumberSchema extends JSONSchema {\n type: \"number\";\n}\nexport interface IntegerSchema extends JSONSchema {\n type: \"integer\";\n}\nexport interface BooleanSchema extends JSONSchema {\n type: \"boolean\";\n}\nexport interface NullSchema extends JSONSchema {\n type: \"null\";\n}\n"],"x_google_ignoreList":[0],"mappings":";AACYQ,KAAAA,WAAAA,GAAW,OAAaC,GAAAA,UAAU;AAClCA,KAAAA,UAAAA,GAAU;EAQJC,CAAAA,CAAAA,EAAAA,MAAAA,CAAAA,EAAAA,OAAAA;EAESD,OAAAA,CAAAA,EAAAA,8CAAAA,GAAAA,yCAAAA,GAAAA,yCAAAA;EAAfC,GAAAA,CAAAA,EAAAA,MAAAA;EAEUF,OAAAA,CAAAA,EAAAA,MAAAA;EACCA,IAAAA,CAAAA,EAAAA,MAAAA;EACLA,WAAAA,CAAAA,EAAAA,MAAAA;EACNA,cAAAA,CAAAA,EAAAA,MAAAA;EAAcA,WAAAA,CAAAA,EAPRE,MAOQF,CAAAA,MAAAA,EAAAA,OAAAA,CAAAA;EACXA,QAAAA,CAAAA,EAAAA,MAAAA;EACYA,KAAAA,CAAAA,EAPfE,MAOeF,CAAAA,MAAAA,EAPAC,UAOAD,CAAAA;EACCA,IAAAA,CAAAA,EAAAA,QAAAA,GAAAA,OAAAA,GAAAA,QAAAA,GAAAA,QAAAA,GAAAA,SAAAA,GAAAA,MAAAA,GAAAA,SAAAA;EACIA,eAAAA,CAAAA,EAPVA,WAOUA;EAAfE,gBAAAA,CAAAA,EANMF,WAMNE;EACsBF,WAAAA,CAAAA,EANrBA,WAMqBA,EAAAA;EAAfE,KAAAA,CAAAA,EALZF,WAKYE,GALEF,WAKFE,EAAAA;EACcF,QAAAA,CAAAA,EALvBA,WAKuBA;EAAfE,oBAAAA,CAAAA,EAJIF,WAIJE;EACHF,qBAAAA,CAAAA,EAJQA,WAIRA;EACXA,UAAAA,CAAAA,EAJQE,MAIRF,CAAAA,MAAAA,EAJuBA,WAIvBA,CAAAA;EACEA,iBAAAA,CAAAA,EAJaE,MAIbF,CAAAA,MAAAA,EAJ4BA,WAI5BA,CAAAA;EACAA,gBAAAA,CAAAA,EAJYE,MAIZF,CAAAA,MAAAA,EAJ2BA,WAI3BA,CAAAA;EACCC,aAAAA,CAAAA,EAJQD,WAIRC;EACAA,EAAAA,CAAAA,EAJHD,WAIGC;EACAA,IAAAA,CAAAA,EAJDD,WAICC;EACFD,IAAAA,CAAAA,EAJCA,WAIDA;EAiBcE,KAAAA,CAAAA,EApBZD,UAoBYC,EAAAA;EACbC,KAAAA,CAAAA,EApBCF,UAoBDE,EAAAA;EAcSF,KAAAA,CAAAA,EAjCRA,UAiCQA,EAAAA;EAAU,GAAA,CAAA,EAhCpBD,WAgCoB;EAGlBI,UAAAA,CAAAA,EAAU,MAAA;;;;;;;;;;;;;;;;sBAlBEF;SACbC;;;;;;;;;;;;;;kBAcSF;;;KAGRG,UAAAA,GAAaH"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cossistant/react",
3
3
  "type": "module",
4
- "version": "0.0.26",
4
+ "version": "0.0.29",
5
5
  "private": false,
6
6
  "author": "Cossistant team",
7
7
  "description": "Headless React SDK for building AI-powered support/chat widgets. Hooks + primitives, WS-driven, TypeScript-first. Next.js-ready, Tailwind optional.",
@@ -88,8 +88,9 @@
88
88
  "*.css"
89
89
  ],
90
90
  "dependencies": {
91
- "@cossistant/core": "0.0.26",
92
- "@cossistant/types": "0.0.26",
91
+ "@cossistant/core": "0.0.29",
92
+ "@cossistant/types": "0.0.29",
93
+ "@floating-ui/react": "^0.27.16",
93
94
  "class-variance-authority": "^0.7.1",
94
95
  "clsx": "^2.1.1",
95
96
  "nanoid": "^5.1.5",
package/parse.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { ZodError } from "./errors2.js";
2
2
 
3
- //#region ../../node_modules/.bun/zod@4.1.12/node_modules/zod/v4/classic/parse.d.cts
3
+ //#region ../../node_modules/.bun/zod@4.2.1/node_modules/zod/v4/classic/parse.d.cts
4
4
  type ZodSafeParseResult<T> = ZodSafeParseSuccess<T> | ZodSafeParseError<T>;
5
5
  type ZodSafeParseSuccess<T> = {
6
6
  success: true;
package/parse.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"parse.d.ts","names":["core","ZodError","ZodSafeParseResult","T","ZodSafeParseSuccess","ZodSafeParseError","parse","$ZodType","$ZodIssue","ParseContext","util","AnyFunc","$ZodErrorClass","output","parseAsync","Promise","safeParse","safeParseAsync","encode","input","decode","encodeAsync","decodeAsync","safeEncode","safeDecode","safeEncodeAsync","safeDecodeAsync"],"sources":["../../../node_modules/.bun/zod@4.1.12/node_modules/zod/v4/classic/parse.d.cts"],"sourcesContent":["import * as core from \"../core/index.cjs\";\nimport { type ZodError } from \"./errors.cjs\";\nexport type ZodSafeParseResult<T> = ZodSafeParseSuccess<T> | ZodSafeParseError<T>;\nexport type ZodSafeParseSuccess<T> = {\n success: true;\n data: T;\n error?: never;\n};\nexport type ZodSafeParseError<T> = {\n success: false;\n data?: never;\n error: ZodError<T>;\n};\nexport declare const parse: <T extends core.$ZodType>(schema: T, value: unknown, _ctx?: core.ParseContext<core.$ZodIssue>, _params?: {\n callee?: core.util.AnyFunc;\n Err?: core.$ZodErrorClass;\n}) => core.output<T>;\nexport declare const parseAsync: <T extends core.$ZodType>(schema: T, value: unknown, _ctx?: core.ParseContext<core.$ZodIssue>, _params?: {\n callee?: core.util.AnyFunc;\n Err?: core.$ZodErrorClass;\n}) => Promise<core.output<T>>;\nexport declare const safeParse: <T extends core.$ZodType>(schema: T, value: unknown, _ctx?: core.ParseContext<core.$ZodIssue>) => ZodSafeParseResult<core.output<T>>;\nexport declare const safeParseAsync: <T extends core.$ZodType>(schema: T, value: unknown, _ctx?: core.ParseContext<core.$ZodIssue>) => Promise<ZodSafeParseResult<core.output<T>>>;\nexport declare const encode: <T extends core.$ZodType>(schema: T, value: core.output<T>, _ctx?: core.ParseContext<core.$ZodIssue>) => core.input<T>;\nexport declare const decode: <T extends core.$ZodType>(schema: T, value: core.input<T>, _ctx?: core.ParseContext<core.$ZodIssue>) => core.output<T>;\nexport declare const encodeAsync: <T extends core.$ZodType>(schema: T, value: core.output<T>, _ctx?: core.ParseContext<core.$ZodIssue>) => Promise<core.input<T>>;\nexport declare const decodeAsync: <T extends core.$ZodType>(schema: T, value: core.input<T>, _ctx?: core.ParseContext<core.$ZodIssue>) => Promise<core.output<T>>;\nexport declare const safeEncode: <T extends core.$ZodType>(schema: T, value: core.output<T>, _ctx?: core.ParseContext<core.$ZodIssue>) => ZodSafeParseResult<core.input<T>>;\nexport declare const safeDecode: <T extends core.$ZodType>(schema: T, value: core.input<T>, _ctx?: core.ParseContext<core.$ZodIssue>) => ZodSafeParseResult<core.output<T>>;\nexport declare const safeEncodeAsync: <T extends core.$ZodType>(schema: T, value: core.output<T>, _ctx?: core.ParseContext<core.$ZodIssue>) => Promise<ZodSafeParseResult<core.input<T>>>;\nexport declare const safeDecodeAsync: <T extends core.$ZodType>(schema: T, value: core.input<T>, _ctx?: core.ParseContext<core.$ZodIssue>) => Promise<ZodSafeParseResult<core.output<T>>>;\n"],"x_google_ignoreList":[0],"mappings":";;;KAEYE,wBAAwBE,oBAAoBD,KAAKE,kBAAkBF;AAAnED,KACAE,mBADkB,CAAAD,CAAAA,CAAAA,GAAAA;EAA0BA,OAAAA,EAAAA,IAAAA;EAApBC,IAAAA,EAG1BD,CAH0BC;EAA2CD,KAAAA,CAAAA,EAAAA,KAAAA;CAAlBE;AAAiB,KAMlEA,iBANkE,CAAA,CAAA,CAAA,GAAA;EAClED,OAAAA,EAAAA,KAAAA;EAKAC,IAAAA,CAAAA,EAAAA,KAAAA;SAGDJ,SAASE"}
1
+ {"version":3,"file":"parse.d.ts","names":["core","ZodError","ZodSafeParseResult","T","ZodSafeParseSuccess","ZodSafeParseError","parse","$ZodType","$ZodIssue","ParseContext","util","AnyFunc","$ZodErrorClass","output","parseAsync","Promise","safeParse","safeParseAsync","encode","input","decode","encodeAsync","decodeAsync","safeEncode","safeDecode","safeEncodeAsync","safeDecodeAsync"],"sources":["../../../node_modules/.bun/zod@4.2.1/node_modules/zod/v4/classic/parse.d.cts"],"sourcesContent":["import * as core from \"../core/index.cjs\";\nimport { type ZodError } from \"./errors.cjs\";\nexport type ZodSafeParseResult<T> = ZodSafeParseSuccess<T> | ZodSafeParseError<T>;\nexport type ZodSafeParseSuccess<T> = {\n success: true;\n data: T;\n error?: never;\n};\nexport type ZodSafeParseError<T> = {\n success: false;\n data?: never;\n error: ZodError<T>;\n};\nexport declare const parse: <T extends core.$ZodType>(schema: T, value: unknown, _ctx?: core.ParseContext<core.$ZodIssue>, _params?: {\n callee?: core.util.AnyFunc;\n Err?: core.$ZodErrorClass;\n}) => core.output<T>;\nexport declare const parseAsync: <T extends core.$ZodType>(schema: T, value: unknown, _ctx?: core.ParseContext<core.$ZodIssue>, _params?: {\n callee?: core.util.AnyFunc;\n Err?: core.$ZodErrorClass;\n}) => Promise<core.output<T>>;\nexport declare const safeParse: <T extends core.$ZodType>(schema: T, value: unknown, _ctx?: core.ParseContext<core.$ZodIssue>) => ZodSafeParseResult<core.output<T>>;\nexport declare const safeParseAsync: <T extends core.$ZodType>(schema: T, value: unknown, _ctx?: core.ParseContext<core.$ZodIssue>) => Promise<ZodSafeParseResult<core.output<T>>>;\nexport declare const encode: <T extends core.$ZodType>(schema: T, value: core.output<T>, _ctx?: core.ParseContext<core.$ZodIssue>) => core.input<T>;\nexport declare const decode: <T extends core.$ZodType>(schema: T, value: core.input<T>, _ctx?: core.ParseContext<core.$ZodIssue>) => core.output<T>;\nexport declare const encodeAsync: <T extends core.$ZodType>(schema: T, value: core.output<T>, _ctx?: core.ParseContext<core.$ZodIssue>) => Promise<core.input<T>>;\nexport declare const decodeAsync: <T extends core.$ZodType>(schema: T, value: core.input<T>, _ctx?: core.ParseContext<core.$ZodIssue>) => Promise<core.output<T>>;\nexport declare const safeEncode: <T extends core.$ZodType>(schema: T, value: core.output<T>, _ctx?: core.ParseContext<core.$ZodIssue>) => ZodSafeParseResult<core.input<T>>;\nexport declare const safeDecode: <T extends core.$ZodType>(schema: T, value: core.input<T>, _ctx?: core.ParseContext<core.$ZodIssue>) => ZodSafeParseResult<core.output<T>>;\nexport declare const safeEncodeAsync: <T extends core.$ZodType>(schema: T, value: core.output<T>, _ctx?: core.ParseContext<core.$ZodIssue>) => Promise<ZodSafeParseResult<core.input<T>>>;\nexport declare const safeDecodeAsync: <T extends core.$ZodType>(schema: T, value: core.input<T>, _ctx?: core.ParseContext<core.$ZodIssue>) => Promise<ZodSafeParseResult<core.output<T>>>;\n"],"x_google_ignoreList":[0],"mappings":";;;KAEYE,wBAAwBE,oBAAoBD,KAAKE,kBAAkBF;AAAnED,KACAE,mBADkB,CAAAD,CAAAA,CAAAA,GAAAA;EAA0BA,OAAAA,EAAAA,IAAAA;EAApBC,IAAAA,EAG1BD,CAH0BC;EAA2CD,KAAAA,CAAAA,EAAAA,KAAAA;CAAlBE;AAAiB,KAMlEA,iBANkE,CAAA,CAAA,CAAA,GAAA;EAClED,OAAAA,EAAAA,KAAAA;EAKAC,IAAAA,CAAAA,EAAAA,KAAAA;SAGDJ,SAASE"}
@@ -1 +1 @@
1
- {"version":3,"file":"fallback.d.ts","names":[],"sources":["../../../src/primitives/avatar/fallback.tsx"],"sourcesContent":[],"mappings":";;;KASY,mBAAA,GAAsB,KACjC,OAAA,CAAM,eAAe;aAGV,OAAA,CAAM;EAJN,IAAA,CAAA,EAAA,MAAA;EACU,OAAA,CAAA,EAAA,MAAA;EAArB,OAAM,CAAA,EAAA,OAAA;EAD2B,SAAA,CAAA,EAAA,MAAA;CAItB;;AA4BZ;;;AAA2B,cAAd,cAAc,EAAA,OAAA,CAAA,yBAAA,CAAA,IAAA,CAAA,OAAA,CAAA,cAAA,CAAA,eAAA,CAAA,EAAA,UAAA,CAAA,GAAA;EA5Bf,QAAM,CAAA,EAAN,OAAA,CAAM,SAAA;;;EA4BS,OAAA,CAAA,EAAA,OAAA;EAAA,SAAA,CAAA,EAAA,MAAA"}
1
+ {"version":3,"file":"fallback.d.ts","names":[],"sources":["../../../src/primitives/avatar/fallback.tsx"],"sourcesContent":[],"mappings":";;;KASY,mBAAA,GAAsB,KACjC,OAAA,CAAM,eAAe;aAGV,OAAA,CAAM;EAJN,IAAA,CAAA,EAAA,MAAA;EACU,OAAA,CAAA,EAAA,MAAA;EAArB,OAAM,CAAA,EAAA,OAAA;EAD2B,SAAA,CAAA,EAAA,MAAA;CAItB;;AA2BZ;;;AAA2B,cAAd,cAAc,EAAA,OAAA,CAAA,yBAAA,CAAA,IAAA,CAAA,OAAA,CAAA,cAAA,CAAA,eAAA,CAAA,EAAA,UAAA,CAAA,GAAA;EA3Bf,QAAM,CAAA,EAAN,OAAA,CAAM,SAAA;;;EA2BS,OAAA,CAAA,EAAA,OAAA;EAAA,SAAA,CAAA,EAAA,MAAA"}
@@ -7,7 +7,7 @@ const getInitials = (name) => {
7
7
  const names = name.trim().split(" ");
8
8
  if (names.length === 0) return "";
9
9
  if (names.length === 1) return names[0]?.charAt(0).toUpperCase() || "";
10
- return ((names[0]?.charAt(0) || "") + (names[names.length - 1]?.charAt(0) || "")).toUpperCase();
10
+ return ((names[0]?.charAt(0) || "") + (names.at(-1)?.charAt(0) || "")).toUpperCase();
11
11
  };
12
12
  /**
13
13
  * Displays initials or custom content while the avatar image loads or fails.
@@ -1 +1 @@
1
- {"version":3,"file":"fallback.js","names":["React","state: FallbackState"],"sources":["../../../src/primitives/avatar/fallback.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { useRenderElement } from \"../../utils/use-render-element\";\nimport { useAvatarContext } from \"./avatar\";\n\ntype FallbackState = {\n\timageLoadingStatus: \"idle\" | \"loading\" | \"loaded\" | \"error\";\n\tinitials?: string;\n};\n\nexport type AvatarFallbackProps = Omit<\n\tReact.HTMLAttributes<HTMLSpanElement>,\n\t\"children\"\n> & {\n\tchildren?: React.ReactNode;\n\tname?: string;\n\tdelayMs?: number;\n\tasChild?: boolean;\n\tclassName?: string;\n};\n\nconst getInitials = (name: string): string => {\n\tconst names = name.trim().split(\" \");\n\tif (names.length === 0) {\n\t\treturn \"\";\n\t}\n\n\tif (names.length === 1) {\n\t\treturn names[0]?.charAt(0).toUpperCase() || \"\";\n\t}\n\n\tconst firstInitial = names[0]?.charAt(0) || \"\";\n\t// biome-ignore lint/style/useAtIndex: ok here\n\tconst lastInitial = names[names.length - 1]?.charAt(0) || \"\";\n\n\treturn (firstInitial + lastInitial).toUpperCase();\n};\n\n/**\n * Displays initials or custom content while the avatar image loads or fails.\n * Optional delay avoids flashes when images load instantly.\n */\nexport const AvatarFallback = (() => {\n\tconst Component = React.forwardRef<HTMLSpanElement, AvatarFallbackProps>(\n\t\t(\n\t\t\t{\n\t\t\t\tchildren,\n\t\t\t\tname = \"\",\n\t\t\t\tdelayMs = 0,\n\t\t\t\tclassName,\n\t\t\t\tasChild = false,\n\t\t\t\t...props\n\t\t\t},\n\t\t\tref\n\t\t) => {\n\t\t\tconst { imageLoadingStatus } = useAvatarContext();\n\t\t\tconst [canRender, setCanRender] = React.useState(delayMs === 0);\n\n\t\t\tReact.useEffect(() => {\n\t\t\t\tif (delayMs > 0) {\n\t\t\t\t\tconst timerId = window.setTimeout(() => setCanRender(true), delayMs);\n\t\t\t\t\treturn () => window.clearTimeout(timerId);\n\t\t\t\t}\n\t\t\t}, [delayMs]);\n\n\t\t\tconst initials = React.useMemo(() => {\n\t\t\t\tif (name) {\n\t\t\t\t\treturn getInitials(name);\n\t\t\t\t}\n\t\t\t\treturn \"\";\n\t\t\t}, [name]);\n\n\t\t\tconst state: FallbackState = {\n\t\t\t\timageLoadingStatus,\n\t\t\t\tinitials,\n\t\t\t};\n\n\t\t\tconst shouldRender =\n\t\t\t\tcanRender &&\n\t\t\t\timageLoadingStatus !== \"loaded\" &&\n\t\t\t\timageLoadingStatus !== \"loading\";\n\n\t\t\tconst content = children || initials;\n\n\t\t\treturn useRenderElement(\n\t\t\t\t\"span\",\n\t\t\t\t{\n\t\t\t\t\tasChild,\n\t\t\t\t\tclassName,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tref,\n\t\t\t\t\tstate,\n\t\t\t\t\tenabled: shouldRender,\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...props,\n\t\t\t\t\t\tchildren: content,\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t);\n\n\tComponent.displayName = \"AvatarFallback\";\n\treturn Component;\n})();\n"],"mappings":";;;;;AAoBA,MAAM,eAAe,SAAyB;CAC7C,MAAM,QAAQ,KAAK,MAAM,CAAC,MAAM,IAAI;AACpC,KAAI,MAAM,WAAW,EACpB,QAAO;AAGR,KAAI,MAAM,WAAW,EACpB,QAAO,MAAM,IAAI,OAAO,EAAE,CAAC,aAAa,IAAI;AAO7C,UAJqB,MAAM,IAAI,OAAO,EAAE,IAAI,OAExB,MAAM,MAAM,SAAS,IAAI,OAAO,EAAE,IAAI,KAEtB,aAAa;;;;;;AAOlD,MAAa,wBAAwB;CACpC,MAAM,YAAYA,QAAM,YAEtB,EACC,UACA,OAAO,IACP,UAAU,GACV,WACA,UAAU,MACV,GAAG,SAEJ,QACI;EACJ,MAAM,EAAE,uBAAuB,kBAAkB;EACjD,MAAM,CAAC,WAAW,gBAAgBA,QAAM,SAAS,YAAY,EAAE;AAE/D,UAAM,gBAAgB;AACrB,OAAI,UAAU,GAAG;IAChB,MAAM,UAAU,OAAO,iBAAiB,aAAa,KAAK,EAAE,QAAQ;AACpE,iBAAa,OAAO,aAAa,QAAQ;;KAExC,CAAC,QAAQ,CAAC;EAEb,MAAM,WAAWA,QAAM,cAAc;AACpC,OAAI,KACH,QAAO,YAAY,KAAK;AAEzB,UAAO;KACL,CAAC,KAAK,CAAC;EAEV,MAAMC,QAAuB;GAC5B;GACA;GACA;EAED,MAAM,eACL,aACA,uBAAuB,YACvB,uBAAuB;EAExB,MAAM,UAAU,YAAY;AAE5B,SAAO,iBACN,QACA;GACC;GACA;GACA,EACD;GACC;GACA;GACA,SAAS;GACT,OAAO;IACN,GAAG;IACH,UAAU;IACV;GACD,CACD;GAEF;AAED,WAAU,cAAc;AACxB,QAAO;IACJ"}
1
+ {"version":3,"file":"fallback.js","names":["React","state: FallbackState"],"sources":["../../../src/primitives/avatar/fallback.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { useRenderElement } from \"../../utils/use-render-element\";\nimport { useAvatarContext } from \"./avatar\";\n\ntype FallbackState = {\n\timageLoadingStatus: \"idle\" | \"loading\" | \"loaded\" | \"error\";\n\tinitials?: string;\n};\n\nexport type AvatarFallbackProps = Omit<\n\tReact.HTMLAttributes<HTMLSpanElement>,\n\t\"children\"\n> & {\n\tchildren?: React.ReactNode;\n\tname?: string;\n\tdelayMs?: number;\n\tasChild?: boolean;\n\tclassName?: string;\n};\n\nconst getInitials = (name: string): string => {\n\tconst names = name.trim().split(\" \");\n\tif (names.length === 0) {\n\t\treturn \"\";\n\t}\n\n\tif (names.length === 1) {\n\t\treturn names[0]?.charAt(0).toUpperCase() || \"\";\n\t}\n\n\tconst firstInitial = names[0]?.charAt(0) || \"\";\n\tconst lastInitial = names.at(-1)?.charAt(0) || \"\";\n\n\treturn (firstInitial + lastInitial).toUpperCase();\n};\n\n/**\n * Displays initials or custom content while the avatar image loads or fails.\n * Optional delay avoids flashes when images load instantly.\n */\nexport const AvatarFallback = (() => {\n\tconst Component = React.forwardRef<HTMLSpanElement, AvatarFallbackProps>(\n\t\t(\n\t\t\t{\n\t\t\t\tchildren,\n\t\t\t\tname = \"\",\n\t\t\t\tdelayMs = 0,\n\t\t\t\tclassName,\n\t\t\t\tasChild = false,\n\t\t\t\t...props\n\t\t\t},\n\t\t\tref\n\t\t) => {\n\t\t\tconst { imageLoadingStatus } = useAvatarContext();\n\t\t\tconst [canRender, setCanRender] = React.useState(delayMs === 0);\n\n\t\t\tReact.useEffect(() => {\n\t\t\t\tif (delayMs > 0) {\n\t\t\t\t\tconst timerId = window.setTimeout(() => setCanRender(true), delayMs);\n\t\t\t\t\treturn () => window.clearTimeout(timerId);\n\t\t\t\t}\n\t\t\t}, [delayMs]);\n\n\t\t\tconst initials = React.useMemo(() => {\n\t\t\t\tif (name) {\n\t\t\t\t\treturn getInitials(name);\n\t\t\t\t}\n\t\t\t\treturn \"\";\n\t\t\t}, [name]);\n\n\t\t\tconst state: FallbackState = {\n\t\t\t\timageLoadingStatus,\n\t\t\t\tinitials,\n\t\t\t};\n\n\t\t\tconst shouldRender =\n\t\t\t\tcanRender &&\n\t\t\t\timageLoadingStatus !== \"loaded\" &&\n\t\t\t\timageLoadingStatus !== \"loading\";\n\n\t\t\tconst content = children || initials;\n\n\t\t\treturn useRenderElement(\n\t\t\t\t\"span\",\n\t\t\t\t{\n\t\t\t\t\tasChild,\n\t\t\t\t\tclassName,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tref,\n\t\t\t\t\tstate,\n\t\t\t\t\tenabled: shouldRender,\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...props,\n\t\t\t\t\t\tchildren: content,\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t);\n\n\tComponent.displayName = \"AvatarFallback\";\n\treturn Component;\n})();\n"],"mappings":";;;;;AAoBA,MAAM,eAAe,SAAyB;CAC7C,MAAM,QAAQ,KAAK,MAAM,CAAC,MAAM,IAAI;AACpC,KAAI,MAAM,WAAW,EACpB,QAAO;AAGR,KAAI,MAAM,WAAW,EACpB,QAAO,MAAM,IAAI,OAAO,EAAE,CAAC,aAAa,IAAI;AAM7C,UAHqB,MAAM,IAAI,OAAO,EAAE,IAAI,OACxB,MAAM,GAAG,GAAG,EAAE,OAAO,EAAE,IAAI,KAEX,aAAa;;;;;;AAOlD,MAAa,wBAAwB;CACpC,MAAM,YAAYA,QAAM,YAEtB,EACC,UACA,OAAO,IACP,UAAU,GACV,WACA,UAAU,MACV,GAAG,SAEJ,QACI;EACJ,MAAM,EAAE,uBAAuB,kBAAkB;EACjD,MAAM,CAAC,WAAW,gBAAgBA,QAAM,SAAS,YAAY,EAAE;AAE/D,UAAM,gBAAgB;AACrB,OAAI,UAAU,GAAG;IAChB,MAAM,UAAU,OAAO,iBAAiB,aAAa,KAAK,EAAE,QAAQ;AACpE,iBAAa,OAAO,aAAa,QAAQ;;KAExC,CAAC,QAAQ,CAAC;EAEb,MAAM,WAAWA,QAAM,cAAc;AACpC,OAAI,KACH,QAAO,YAAY,KAAK;AAEzB,UAAO;KACL,CAAC,KAAK,CAAC;EAEV,MAAMC,QAAuB;GAC5B;GACA;GACA;EAED,MAAM,eACL,aACA,uBAAuB,YACvB,uBAAuB;EAExB,MAAM,UAAU,YAAY;AAE5B,SAAO,iBACN,QACA;GACC;GACA;GACA,EACD;GACC;GACA;GACA,SAAS;GACT,OAAO;IACN,GAAG;IACH,UAAU;IACV;GACD,CACD;GAEF;AAED,WAAU,cAAc;AACxB,QAAO;IACJ"}
@@ -1 +1 @@
1
- {"version":3,"file":"conversation-timeline.d.ts","names":[],"sources":["../../src/primitives/conversation-timeline.tsx"],"sourcesContent":[],"mappings":";;;;;;;AASA;AAOA;AACsB,KARV,+BAAA,GAQU;EAArB,SAAM,EAAA,MAAA;EADiC,SAAA,CAAA,EAAA,OAAA;EAKpC,OAAM,CAAA,EAAA,OAAA;EACG,OAAA,EAAA,OAAA;CAAoC;AAGxC,KATG,yBAAA,GAA4B,IAS/B,CARR,OAAA,CAAM,cAQE,CARa,cAQb,CAAA,EAAA,UAAA,CAAA,GAAA;EAAgB,QAAA,CAAA,EAJrB,OAAA,CAAM,SAIe,GAAA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A,EAAA,OAAA;EAAA,SAAA,CAAA,EAAA,MAAA;CAT5B,wBAAM,eAAA,CAAA,CAAA;KAJN,gCAAA,GAAmC,KAC9C,OAAA,CAAM,eAAe;aAGV,OAAA,CAAM;EASsB,OAAA,CAAA,EAAA,OAAA;EAAA,SAAA,CAAA,EAAA,MAAA;AA2BxC,CAAA;;;;;AAI2B,cA/Bd,2BA+Bc,EA/Ba,OAAA,CAAA,yBA+Bb,CA/Ba,IA+Bb,CA/Ba,OAAA,CAAA,cA+Bb,CA/Ba,cA+Bb,CAAA,EAAA,UAAA,CAAA,GAAA;EASd,QAAA,CAAA,EAjDD,OAAA,CAAM,SAiDL;EAAyB,OAAA,CAAA,EAAA,OAAA;EAAA,SAAA,CAAA,EAAA,MAAA;CAAA,wBAAA,eAAA,CAAA,CAAA;AAT1B,KAJA,8BAAA,GAAiC,IAI3B,CAHjB,OAAA,CAAM,cAGW,CAHI,cAGJ,CAAA,EAAA,UAAA,CAAA,GAAA;aAAN,OAAA,CAAM;;EASoB,SAAA,CAAA,EAAA,MAAA;CAAA;;;;;cAAzB,2BAAyB,OAAA,CAAA,0BAAA,KAAA,OAAA,CAAA,eAAA;aAT1B,OAAA,CAAM"}
@@ -5,6 +5,8 @@ import * as React$1 from "react";
5
5
  //#region src/primitives/conversation-timeline.tsx
6
6
  const BOTTOM_THRESHOLD_PX = 12;
7
7
  const TOP_THRESHOLD_PX = 2;
8
+ /** Grace period after mount where all scrolls are instant (avoids animation on first render) */
9
+ const INITIAL_SCROLL_GRACE_MS = 300;
8
10
  function getLastItemKey(items) {
9
11
  if (items.length === 0) return null;
10
12
  const lastItem = items.at(-1);
@@ -30,7 +32,7 @@ const ConversationTimeline = (() => {
30
32
  if (typeof ref === "function") ref(node);
31
33
  else if (ref) ref.current = node;
32
34
  }, [ref, scrollMaskRef]);
33
- const isInitialRender = React$1.useRef(true);
35
+ const mountTimeRef = React$1.useRef(Date.now());
34
36
  const previousItemCount = React$1.useRef(items.length);
35
37
  const previousLastItemKey = React$1.useRef(getLastItemKey(items));
36
38
  const isPinnedToBottom = React$1.useRef(true);
@@ -48,21 +50,24 @@ const ConversationTimeline = (() => {
48
50
  if (!(element && autoScroll)) {
49
51
  previousItemCount.current = items.length;
50
52
  previousLastItemKey.current = lastItemKey;
51
- isInitialRender.current = false;
52
53
  return;
53
54
  }
54
55
  const hasNewItems = items.length > previousItemCount.current;
55
56
  const itemsRemoved = items.length < previousItemCount.current;
56
57
  const appendedNewItem = hasNewItems && lastItemKey !== null && lastItemKey !== previousLastItemKey.current;
57
58
  const replacedLastItem = !hasNewItems && lastItemKey !== null && lastItemKey !== previousLastItemKey.current;
58
- if (isInitialRender.current || itemsRemoved && isPinnedToBottom.current || appendedNewItem && isPinnedToBottom.current || replacedLastItem && isPinnedToBottom.current) {
59
- element.scrollTop = element.scrollHeight;
59
+ const isWithinGracePeriod = Date.now() - mountTimeRef.current < INITIAL_SCROLL_GRACE_MS;
60
+ if (isWithinGracePeriod || itemsRemoved && isPinnedToBottom.current || appendedNewItem && isPinnedToBottom.current || replacedLastItem && isPinnedToBottom.current) {
61
+ if (isWithinGracePeriod) element.scrollTop = element.scrollHeight;
62
+ else element.scrollTo({
63
+ top: element.scrollHeight,
64
+ behavior: "smooth"
65
+ });
60
66
  isPinnedToBottom.current = true;
61
67
  isAtTop.current = false;
62
68
  }
63
69
  previousItemCount.current = items.length;
64
70
  previousLastItemKey.current = lastItemKey;
65
- isInitialRender.current = false;
66
71
  }, [
67
72
  autoScroll,
68
73
  items.length,
@@ -1 +1 @@
1
- {"version":3,"file":"conversation-timeline.js","names":["React","renderProps: ConversationTimelineRenderProps"],"sources":["../../src/primitives/conversation-timeline.tsx"],"sourcesContent":["import type { TimelineItem as TimelineItemType } from \"@cossistant/types/api/timeline-item\";\nimport * as React from \"react\";\nimport { useScrollMask } from \"../hooks/use-scroll-mask\";\nimport { useRenderElement } from \"../utils/use-render-element\";\n\n/**\n * High-level state of the timeline handed to render-prop children so they can show\n * skeletons, empty states or pagination affordances.\n */\nexport type ConversationTimelineRenderProps = {\n\titemCount: number;\n\tisLoading?: boolean;\n\thasMore?: boolean;\n\tisEmpty: boolean;\n};\n\nexport type ConversationTimelineProps = Omit<\n\tReact.HTMLAttributes<HTMLDivElement>,\n\t\"children\"\n> & {\n\tchildren?:\n\t\t| React.ReactNode\n\t\t| ((props: ConversationTimelineRenderProps) => React.ReactNode);\n\tasChild?: boolean;\n\tclassName?: string;\n\titems?: TimelineItemType[];\n\tisLoading?: boolean;\n\thasMore?: boolean;\n\tautoScroll?: boolean;\n\tonScrollEnd?: () => void;\n\tonScrollStart?: () => void;\n};\n\nconst BOTTOM_THRESHOLD_PX = 12;\nconst TOP_THRESHOLD_PX = 2;\n\nfunction getLastItemKey(items: TimelineItemType[]): string | number | null {\n\tif (items.length === 0) {\n\t\treturn null;\n\t}\n\n\tconst lastItem = items.at(-1);\n\n\tif (lastItem?.id) {\n\t\treturn lastItem.id;\n\t}\n\n\treturn lastItem?.createdAt ?? null;\n}\n\n/**\n * Scrollable conversation timeline that wires auto-scroll behaviour, live-region semantics and\n * pagination callbacks for displaying timeline items (messages, events, etc.).\n */\nexport const ConversationTimeline = (() => {\n\tconst Component = React.forwardRef<HTMLDivElement, ConversationTimelineProps>(\n\t\t(\n\t\t\t{\n\t\t\t\tchildren,\n\t\t\t\tclassName,\n\t\t\t\tasChild = false,\n\t\t\t\titems = [],\n\t\t\t\tisLoading = false,\n\t\t\t\thasMore = false,\n\t\t\t\tautoScroll = true,\n\t\t\t\tonScrollEnd,\n\t\t\t\tonScrollStart,\n\t\t\t\t...props\n\t\t\t},\n\t\t\tref\n\t\t) => {\n\t\t\tconst internalRef = React.useRef<HTMLDivElement>(null);\n\t\t\tconst { ref: scrollMaskRef, style: scrollMaskStyle } = useScrollMask({\n\t\t\t\tmaskHeight: \"54px\",\n\t\t\t\tscrollbarWidth: \"8px\",\n\t\t\t\ttopThreshold: TOP_THRESHOLD_PX,\n\t\t\t\tbottomThreshold: BOTTOM_THRESHOLD_PX,\n\t\t\t});\n\n\t\t\tconst setRefs = React.useCallback(\n\t\t\t\t(node: HTMLDivElement | null) => {\n\t\t\t\t\tinternalRef.current = node;\n\t\t\t\t\t(\n\t\t\t\t\t\tscrollMaskRef as React.MutableRefObject<HTMLDivElement | null>\n\t\t\t\t\t).current = node;\n\t\t\t\t\tif (typeof ref === \"function\") {\n\t\t\t\t\t\tref(node);\n\t\t\t\t\t} else if (ref) {\n\t\t\t\t\t\t(ref as React.MutableRefObject<HTMLDivElement | null>).current =\n\t\t\t\t\t\t\tnode;\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t[ref, scrollMaskRef]\n\t\t\t);\n\n\t\t\tconst isInitialRender = React.useRef(true);\n\t\t\tconst previousItemCount = React.useRef(items.length);\n\t\t\tconst previousLastItemKey = React.useRef<string | number | null>(\n\t\t\t\tgetLastItemKey(items)\n\t\t\t);\n\t\t\tconst isPinnedToBottom = React.useRef(true);\n\t\t\tconst isAtTop = React.useRef(true);\n\n\t\t\tconst renderProps: ConversationTimelineRenderProps = {\n\t\t\t\titemCount: items.length,\n\t\t\t\tisLoading,\n\t\t\t\thasMore,\n\t\t\t\tisEmpty: items.length === 0,\n\t\t\t};\n\n\t\t\tconst content =\n\t\t\t\ttypeof children === \"function\" ? children(renderProps) : children;\n\n\t\t\tconst lastItemKey = getLastItemKey(items);\n\n\t\t\t// Auto-scroll to bottom when new timeline items are added\n\t\t\tReact.useEffect(() => {\n\t\t\t\tconst element = internalRef.current;\n\n\t\t\t\tif (!(element && autoScroll)) {\n\t\t\t\t\tpreviousItemCount.current = items.length;\n\t\t\t\t\tpreviousLastItemKey.current = lastItemKey;\n\t\t\t\t\tisInitialRender.current = false;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst hasNewItems = items.length > previousItemCount.current;\n\t\t\t\tconst itemsRemoved = items.length < previousItemCount.current;\n\t\t\t\tconst appendedNewItem =\n\t\t\t\t\thasNewItems &&\n\t\t\t\t\tlastItemKey !== null &&\n\t\t\t\t\tlastItemKey !== previousLastItemKey.current;\n\t\t\t\tconst replacedLastItem =\n\t\t\t\t\t!hasNewItems &&\n\t\t\t\t\tlastItemKey !== null &&\n\t\t\t\t\tlastItemKey !== previousLastItemKey.current;\n\n\t\t\t\tconst shouldSnapToBottom =\n\t\t\t\t\tisInitialRender.current ||\n\t\t\t\t\t(itemsRemoved && isPinnedToBottom.current) ||\n\t\t\t\t\t(appendedNewItem && isPinnedToBottom.current) ||\n\t\t\t\t\t(replacedLastItem && isPinnedToBottom.current);\n\n\t\t\t\tif (shouldSnapToBottom) {\n\t\t\t\t\telement.scrollTop = element.scrollHeight;\n\t\t\t\t\tisPinnedToBottom.current = true;\n\t\t\t\t\tisAtTop.current = false;\n\t\t\t\t}\n\n\t\t\t\tpreviousItemCount.current = items.length;\n\t\t\t\tpreviousLastItemKey.current = lastItemKey;\n\t\t\t\tisInitialRender.current = false;\n\t\t\t}, [autoScroll, items.length, lastItemKey]);\n\n\t\t\t// Handle scroll events for infinite scrolling\n\t\t\tconst handleScroll = React.useCallback(\n\t\t\t\t(e: React.UIEvent<HTMLDivElement>) => {\n\t\t\t\t\tconst element = e.currentTarget;\n\t\t\t\t\tconst { scrollTop, scrollHeight, clientHeight } = element;\n\n\t\t\t\t\tconst distanceFromBottom = scrollHeight - scrollTop - clientHeight;\n\t\t\t\t\tconst pinnedNow = distanceFromBottom <= BOTTOM_THRESHOLD_PX;\n\t\t\t\t\tif (pinnedNow && !isPinnedToBottom.current) {\n\t\t\t\t\t\tonScrollEnd?.();\n\t\t\t\t\t}\n\t\t\t\t\tisPinnedToBottom.current = pinnedNow;\n\n\t\t\t\t\tconst atTop = scrollTop <= TOP_THRESHOLD_PX;\n\t\t\t\t\tif (atTop && !isAtTop.current) {\n\t\t\t\t\t\tonScrollStart?.();\n\t\t\t\t\t}\n\t\t\t\t\tisAtTop.current = atTop;\n\t\t\t\t},\n\t\t\t\t[onScrollStart, onScrollEnd]\n\t\t\t);\n\n\t\t\treturn useRenderElement(\n\t\t\t\t\"div\",\n\t\t\t\t{\n\t\t\t\t\tclassName,\n\t\t\t\t\tasChild,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tref: setRefs,\n\t\t\t\t\tstate: renderProps,\n\t\t\t\t\tprops: {\n\t\t\t\t\t\trole: \"log\",\n\t\t\t\t\t\t\"aria-label\": \"Conversation timeline\",\n\t\t\t\t\t\t\"aria-live\": \"polite\",\n\t\t\t\t\t\t\"aria-relevant\": \"additions\",\n\t\t\t\t\t\tonScroll: handleScroll,\n\t\t\t\t\t\tstyle: scrollMaskStyle,\n\t\t\t\t\t\t...props,\n\t\t\t\t\t\tchildren: content,\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t);\n\n\tComponent.displayName = \"ConversationTimeline\";\n\treturn Component;\n})();\n\nexport type ConversationTimelineContainerProps = Omit<\n\tReact.HTMLAttributes<HTMLDivElement>,\n\t\"children\"\n> & {\n\tchildren?: React.ReactNode;\n\tasChild?: boolean;\n\tclassName?: string;\n};\n\n/**\n * Wrapper around the scrollable timeline giving consumers an easy hook to add\n * padding, backgrounds or transitions without touching the core timeline logic.\n */\nexport const ConversationTimelineContainer = (() => {\n\tconst Component = React.forwardRef<\n\t\tHTMLDivElement,\n\t\tConversationTimelineContainerProps\n\t>(({ children, className, asChild = false, ...props }, ref) =>\n\t\tuseRenderElement(\n\t\t\t\"div\",\n\t\t\t{\n\t\t\t\tclassName,\n\t\t\t\tasChild,\n\t\t\t},\n\t\t\t{\n\t\t\t\tref,\n\t\t\t\tprops: {\n\t\t\t\t\t...props,\n\t\t\t\t\tchildren,\n\t\t\t\t},\n\t\t\t}\n\t\t)\n\t);\n\n\tComponent.displayName = \"ConversationTimelineContainer\";\n\treturn Component;\n})();\n\nexport type ConversationTimelineLoadingProps = Omit<\n\tReact.HTMLAttributes<HTMLDivElement>,\n\t\"children\"\n> & {\n\tchildren?: React.ReactNode;\n\tasChild?: boolean;\n\tclassName?: string;\n};\n\n/**\n * Accessible status region for loading more timeline items. Lets host apps render\n * skeletons or shimmer states without reimplementing ARIA wiring.\n */\nexport const ConversationTimelineLoading = (() => {\n\tconst Component = React.forwardRef<\n\t\tHTMLDivElement,\n\t\tConversationTimelineLoadingProps\n\t>(({ children, className, asChild = false, ...props }, ref) =>\n\t\tuseRenderElement(\n\t\t\t\"div\",\n\t\t\t{\n\t\t\t\tclassName,\n\t\t\t\tasChild,\n\t\t\t},\n\t\t\t{\n\t\t\t\tref,\n\t\t\t\tprops: {\n\t\t\t\t\trole: \"status\",\n\t\t\t\t\t\"aria-label\": \"Loading timeline items\",\n\t\t\t\t\t...props,\n\t\t\t\t\tchildren,\n\t\t\t\t},\n\t\t\t}\n\t\t)\n\t);\n\n\tComponent.displayName = \"ConversationTimelineLoading\";\n\treturn Component;\n})();\n\nexport type ConversationTimelineEmptyProps = Omit<\n\tReact.HTMLAttributes<HTMLDivElement>,\n\t\"children\"\n> & {\n\tchildren?: React.ReactNode;\n\tasChild?: boolean;\n\tclassName?: string;\n};\n\n/**\n * Placeholder state rendered when no timeline items are present. Uses a polite status\n * region so screen readers announce the empty state.\n */\nexport const ConversationTimelineEmpty = (() => {\n\tconst Component = React.forwardRef<\n\t\tHTMLDivElement,\n\t\tConversationTimelineEmptyProps\n\t>(({ children, className, asChild = false, ...props }, ref) =>\n\t\tuseRenderElement(\n\t\t\t\"div\",\n\t\t\t{\n\t\t\t\tclassName,\n\t\t\t\tasChild,\n\t\t\t},\n\t\t\t{\n\t\t\t\tref,\n\t\t\t\tprops: {\n\t\t\t\t\trole: \"status\",\n\t\t\t\t\t\"aria-label\": \"No timeline items\",\n\t\t\t\t\t...props,\n\t\t\t\t\tchildren,\n\t\t\t\t},\n\t\t\t}\n\t\t)\n\t);\n\n\tComponent.displayName = \"ConversationTimelineEmpty\";\n\treturn Component;\n})();\n"],"mappings":";;;;;AAiCA,MAAM,sBAAsB;AAC5B,MAAM,mBAAmB;AAEzB,SAAS,eAA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AAU,WAAW,UAAU,MAAO,GAAG,SAAS,QACtD,iBACC,OACA;EACC;EACA;EACA,EACD;EACC;EACA,OAAO;GACN,MAAM;GACN,cAAc;GACd,GAAG;GACH;GACA;EACD,CACD,CACD;AAED,WAAU,cAAc;AACxB,QAAO;IACJ;;;;;AAeJ,MAAa,mCAAmC;CAC/C,MAAM,YAAYA,QAAM,YAGrB,EAAE,UAAU,WAAW,UAAU,MAAO,GAAG,SAAS,QACtD,iBACC,OACA;EACC;EACA;EACA,EACD;EACC;EACA,OAAO;GACN,MAAM;GACN,cAAc;GACd,GAAG;GACH;GACA;EACD,CACD,CACD;AAED,WAAU,cAAc;AACxB,QAAO;IACJ"}
1
+ {"version":3,"file":"conversation-timeline.js","names":["React","renderProps: ConversationTimelineRenderProps"],"sources":["../../src/primitives/conversation-timeline.tsx"],"sourcesContent":["import type { TimelineItem as TimelineItemType } from \"@cossistant/types/api/timeline-item\";\nimport * as React from \"react\";\nimport { useScrollMask } from \"../hooks/use-scroll-mask\";\nimport { useRenderElement } from \"../utils/use-render-element\";\n\n/**\n * High-level state of the timeline handed to render-prop children so they can show\n * skeletons, empty states or pagination affordances.\n */\nexport type ConversationTimelineRenderProps = {\n\titemCount: number;\n\tisLoading?: boolean;\n\thasMore?: boolean;\n\tisEmpty: boolean;\n};\n\nexport type ConversationTimelineProps = Omit<\n\tReact.HTMLAttributes<HTMLDivElement>,\n\t\"children\"\n> & {\n\tchildren?:\n\t\t| React.ReactNode\n\t\t| ((props: ConversationTimelineRenderProps) => React.ReactNode);\n\tasChild?: boolean;\n\tclassName?: string;\n\titems?: TimelineItemType[];\n\tisLoading?: boolean;\n\thasMore?: boolean;\n\tautoScroll?: boolean;\n\tonScrollEnd?: () => void;\n\tonScrollStart?: () => void;\n};\n\nconst BOTTOM_THRESHOLD_PX = 12;\nconst TOP_THRESHOLD_PX = 2;\n/** Grace period after mount where all scrolls are instant (avoids animation on first render) */\nconst INITIAL_SCROLL_GRACE_MS = 300;\n\nfunction getLastItemKey(items: TimelineItemType[]): string | number | null {\n\tif (items.length === 0) {\n\t\treturn null;\n\t}\n\n\tconst lastItem = items.at(-1);\n\n\tif (lastItem?.id) {\n\t\treturn lastItem.id;\n\t}\n\n\treturn lastItem?.createdAt ?? null;\n}\n\n/**\n * Scrollable conversation timeline that wires auto-scroll behaviour, live-region semantics and\n * pagination callbacks for displaying timeline items (messages, events, etc.).\n */\nexport const ConversationTimeline = (() => {\n\tconst Component = React.forwardRef<HTMLDivElement, ConversationTimelineProps>(\n\t\t(\n\t\t\t{\n\t\t\t\tchildren,\n\t\t\t\tclassName,\n\t\t\t\tasChild = false,\n\t\t\t\titems = [],\n\t\t\t\tisLoading = false,\n\t\t\t\thasMore = false,\n\t\t\t\tautoScroll = true,\n\t\t\t\tonScrollEnd,\n\t\t\t\tonScrollStart,\n\t\t\t\t...props\n\t\t\t},\n\t\t\tref\n\t\t) => {\n\t\t\tconst internalRef = React.useRef<HTMLDivElement>(null);\n\t\t\tconst { ref: scrollMaskRef, style: scrollMaskStyle } = useScrollMask({\n\t\t\t\tmaskHeight: \"54px\",\n\t\t\t\tscrollbarWidth: \"8px\",\n\t\t\t\ttopThreshold: TOP_THRESHOLD_PX,\n\t\t\t\tbottomThreshold: BOTTOM_THRESHOLD_PX,\n\t\t\t});\n\n\t\t\tconst setRefs = React.useCallback(\n\t\t\t\t(node: HTMLDivElement | null) => {\n\t\t\t\t\tinternalRef.current = node;\n\t\t\t\t\t(\n\t\t\t\t\t\tscrollMaskRef as React.MutableRefObject<HTMLDivElement | null>\n\t\t\t\t\t).current = node;\n\t\t\t\t\tif (typeof ref === \"function\") {\n\t\t\t\t\t\tref(node);\n\t\t\t\t\t} else if (ref) {\n\t\t\t\t\t\t(ref as React.MutableRefObject<HTMLDivElement | null>).current =\n\t\t\t\t\t\t\tnode;\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t[ref, scrollMaskRef]\n\t\t\t);\n\n\t\t\t// Track mount time for grace period (instant scroll during initial load)\n\t\t\tconst mountTimeRef = React.useRef(Date.now());\n\t\t\tconst previousItemCount = React.useRef(items.length);\n\t\t\tconst previousLastItemKey = React.useRef<string | number | null>(\n\t\t\t\tgetLastItemKey(items)\n\t\t\t);\n\t\t\tconst isPinnedToBottom = React.useRef(true);\n\t\t\tconst isAtTop = React.useRef(true);\n\n\t\t\tconst renderProps: ConversationTimelineRenderProps = {\n\t\t\t\titemCount: items.length,\n\t\t\t\tisLoading,\n\t\t\t\thasMore,\n\t\t\t\tisEmpty: items.length === 0,\n\t\t\t};\n\n\t\t\tconst content =\n\t\t\t\ttypeof children === \"function\" ? children(renderProps) : children;\n\n\t\t\tconst lastItemKey = getLastItemKey(items);\n\n\t\t\t// Auto-scroll to bottom when new timeline items are added\n\t\t\tReact.useEffect(() => {\n\t\t\t\tconst element = internalRef.current;\n\n\t\t\t\tif (!(element && autoScroll)) {\n\t\t\t\t\tpreviousItemCount.current = items.length;\n\t\t\t\t\tpreviousLastItemKey.current = lastItemKey;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst hasNewItems = items.length > previousItemCount.current;\n\t\t\t\tconst itemsRemoved = items.length < previousItemCount.current;\n\t\t\t\tconst appendedNewItem =\n\t\t\t\t\thasNewItems &&\n\t\t\t\t\tlastItemKey !== null &&\n\t\t\t\t\tlastItemKey !== previousLastItemKey.current;\n\t\t\t\tconst replacedLastItem =\n\t\t\t\t\t!hasNewItems &&\n\t\t\t\t\tlastItemKey !== null &&\n\t\t\t\t\tlastItemKey !== previousLastItemKey.current;\n\n\t\t\t\tconst isWithinGracePeriod =\n\t\t\t\t\tDate.now() - mountTimeRef.current < INITIAL_SCROLL_GRACE_MS;\n\n\t\t\t\tconst shouldSnapToBottom =\n\t\t\t\t\tisWithinGracePeriod ||\n\t\t\t\t\t(itemsRemoved && isPinnedToBottom.current) ||\n\t\t\t\t\t(appendedNewItem && isPinnedToBottom.current) ||\n\t\t\t\t\t(replacedLastItem && isPinnedToBottom.current);\n\n\t\t\t\tif (shouldSnapToBottom) {\n\t\t\t\t\t// Instant scroll during grace period, smooth scroll after\n\t\t\t\t\tif (isWithinGracePeriod) {\n\t\t\t\t\t\telement.scrollTop = element.scrollHeight;\n\t\t\t\t\t} else {\n\t\t\t\t\t\telement.scrollTo({ top: element.scrollHeight, behavior: \"smooth\" });\n\t\t\t\t\t}\n\t\t\t\t\tisPinnedToBottom.current = true;\n\t\t\t\t\tisAtTop.current = false;\n\t\t\t\t}\n\n\t\t\t\tpreviousItemCount.current = items.length;\n\t\t\t\tpreviousLastItemKey.current = lastItemKey;\n\t\t\t}, [autoScroll, items.length, lastItemKey]);\n\n\t\t\t// Handle scroll events for infinite scrolling\n\t\t\tconst handleScroll = React.useCallback(\n\t\t\t\t(e: React.UIEvent<HTMLDivElement>) => {\n\t\t\t\t\tconst element = e.currentTarget;\n\t\t\t\t\tconst { scrollTop, scrollHeight, clientHeight } = element;\n\n\t\t\t\t\tconst distanceFromBottom = scrollHeight - scrollTop - clientHeight;\n\t\t\t\t\tconst pinnedNow = distanceFromBottom <= BOTTOM_THRESHOLD_PX;\n\t\t\t\t\tif (pinnedNow && !isPinnedToBottom.current) {\n\t\t\t\t\t\tonScrollEnd?.();\n\t\t\t\t\t}\n\t\t\t\t\tisPinnedToBottom.current = pinnedNow;\n\n\t\t\t\t\tconst atTop = scrollTop <= TOP_THRESHOLD_PX;\n\t\t\t\t\tif (atTop && !isAtTop.current) {\n\t\t\t\t\t\tonScrollStart?.();\n\t\t\t\t\t}\n\t\t\t\t\tisAtTop.current = atTop;\n\t\t\t\t},\n\t\t\t\t[onScrollStart, onScrollEnd]\n\t\t\t);\n\n\t\t\treturn useRenderElement(\n\t\t\t\t\"div\",\n\t\t\t\t{\n\t\t\t\t\tclassName,\n\t\t\t\t\tasChild,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tref: setRefs,\n\t\t\t\t\tstate: renderProps,\n\t\t\t\t\tprops: {\n\t\t\t\t\t\trole: \"log\",\n\t\t\t\t\t\t\"aria-label\": \"Conversation timeline\",\n\t\t\t\t\t\t\"aria-live\": \"polite\",\n\t\t\t\t\t\t\"aria-relevant\": \"additions\",\n\t\t\t\t\t\tonScroll: handleScroll,\n\t\t\t\t\t\tstyle: scrollMaskStyle,\n\t\t\t\t\t\t...props,\n\t\t\t\t\t\tchildren: content,\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t);\n\n\tComponent.displayName = \"ConversationTimeline\";\n\treturn Component;\n})();\n\nexport type ConversationTimelineContainerProps = Omit<\n\tReact.HTMLAttributes<HTMLDivElement>,\n\t\"children\"\n> & {\n\tchildren?: React.ReactNode;\n\tasChild?: boolean;\n\tclassName?: string;\n};\n\n/**\n * Wrapper around the scrollable timeline giving consumers an easy hook to add\n * padding, backgrounds or transitions without touching the core timeline logic.\n */\nexport const ConversationTimelineContainer = (() => {\n\tconst Component = React.forwardRef<\n\t\tHTMLDivElement,\n\t\tConversationTimelineContainerProps\n\t>(({ children, className, asChild = false, ...props }, ref) =>\n\t\tuseRenderElement(\n\t\t\t\"div\",\n\t\t\t{\n\t\t\t\tclassName,\n\t\t\t\tasChild,\n\t\t\t},\n\t\t\t{\n\t\t\t\tref,\n\t\t\t\tprops: {\n\t\t\t\t\t...props,\n\t\t\t\t\tchildren,\n\t\t\t\t},\n\t\t\t}\n\t\t)\n\t);\n\n\tComponent.displayName = \"ConversationTimelineContainer\";\n\treturn Component;\n})();\n\nexport type ConversationTimelineLoadingProps = Omit<\n\tReact.HTMLAttributes<HTMLDivElement>,\n\t\"children\"\n> & {\n\tchildren?: React.ReactNode;\n\tasChild?: boolean;\n\tclassName?: string;\n};\n\n/**\n * Accessible status region for loading more timeline items. Lets host apps render\n * skeletons or shimmer states without reimplementing ARIA wiring.\n */\nexport const ConversationTimelineLoading = (() => {\n\tconst Component = React.forwardRef<\n\t\tHTMLDivElement,\n\t\tConversationTimelineLoadingProps\n\t>(({ children, className, asChild = false, ...props }, ref) =>\n\t\tuseRenderElement(\n\t\t\t\"div\",\n\t\t\t{\n\t\t\t\tclassName,\n\t\t\t\tasChild,\n\t\t\t},\n\t\t\t{\n\t\t\t\tref,\n\t\t\t\tprops: {\n\t\t\t\t\trole: \"status\",\n\t\t\t\t\t\"aria-label\": \"Loading timeline items\",\n\t\t\t\t\t...props,\n\t\t\t\t\tchildren,\n\t\t\t\t},\n\t\t\t}\n\t\t)\n\t);\n\n\tComponent.displayName = \"ConversationTimelineLoading\";\n\treturn Component;\n})();\n\nexport type ConversationTimelineEmptyProps = Omit<\n\tReact.HTMLAttributes<HTMLDivElement>,\n\t\"children\"\n> & {\n\tchildren?: React.ReactNode;\n\tasChild?: boolean;\n\tclassName?: string;\n};\n\n/**\n * Placeholder state rendered when no timeline items are present. Uses a polite status\n * region so screen readers announce the empty state.\n */\nexport const ConversationTimelineEmpty = (() => {\n\tconst Component = React.forwardRef<\n\t\tHTMLDivElement,\n\t\tConversationTimelineEmptyProps\n\t>(({ children, className, asChild = false, ...props }, ref) =>\n\t\tuseRenderElement(\n\t\t\t\"div\",\n\t\t\t{\n\t\t\t\tclassName,\n\t\t\t\tasChild,\n\t\t\t},\n\t\t\t{\n\t\t\t\tref,\n\t\t\t\tprops: {\n\t\t\t\t\trole: \"status\",\n\t\t\t\t\t\"aria-label\": \"No timeline items\",\n\t\t\t\t\t...props,\n\t\t\t\t\tchildren,\n\t\t\t\t},\n\t\t\t}\n\t\t)\n\t);\n\n\tComponent.displayName = \"ConversationTimelineEmpty\";\n\treturn Component;\n})();\n"],"mappings":";;;;;AAiCA,MAAM,sBAAsB;AAC5B,MAAM,mBAAmB;;AAEzB,MAAM,0BAA0B;AAEhC,SAAS,eAAe,OAAmD;AAC1E,KAAI,MAAM,WAAW,EACpB,QAAO;CAGR,MAAM,WAAW,MAAM,GAAG,GAAG;AAE7B,KAAI,UAAU,GACb,QAAO,SAAS;AAGjB,QAAO,UAAU,aAAa;;;;;;AAO/B,MAAa,8BAA8B;CAC1C,MAAM,YAAYA,QAAM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d,GAAG;GACH;GACA;EACD,CACD,CACD;AAED,WAAU,cAAc;AACxB,QAAO;IACJ;;;;;AAeJ,MAAa,mCAAmC;CAC/C,MAAM,YAAYA,QAAM,YAGrB,EAAE,UAAU,WAAW,UAAU,MAAO,GAAG,SAAS,QACtD,iBACC,OACA;EACC;EACA;EACA,EACD;EACC;EACA,OAAO;GACN,MAAM;GACN,cAAc;GACd,GAAG;GACH;GACA;EACD,CACD,CACD;AAED,WAAU,cAAc;AACxB,QAAO;IACJ"}
@@ -0,0 +1,76 @@
1
+ import * as React$1 from "react";
2
+
3
+ //#region src/primitives/day-separator.d.ts
4
+
5
+ /**
6
+ * Default date formatter that returns "Today", "Yesterday", or a full date string
7
+ */
8
+ declare const defaultFormatDate: (date: Date) => string;
9
+ /**
10
+ * Shape returned to render-prop children describing the day separator state
11
+ */
12
+ type DaySeparatorRenderProps = {
13
+ date: Date;
14
+ dateString: string;
15
+ formattedDate: string;
16
+ isToday: boolean;
17
+ isYesterday: boolean;
18
+ };
19
+ type DaySeparatorProps = Omit<React$1.HTMLAttributes<HTMLDivElement>, "children"> & {
20
+ children?: React$1.ReactNode | ((props: DaySeparatorRenderProps) => React$1.ReactNode);
21
+ asChild?: boolean;
22
+ className?: string;
23
+ date: Date;
24
+ dateString: string;
25
+ formatDate?: (date: Date) => string;
26
+ };
27
+ /**
28
+ * Headless day separator component that marks the boundary between different days
29
+ * in a conversation timeline. Consumers can either render their own layout via
30
+ * a render prop or rely on slotted children.
31
+ */
32
+ declare const DaySeparator: React$1.ForwardRefExoticComponent<Omit<React$1.HTMLAttributes<HTMLDivElement>, "children"> & {
33
+ children?: React$1.ReactNode | ((props: DaySeparatorRenderProps) => React$1.ReactNode);
34
+ asChild?: boolean;
35
+ className?: string;
36
+ date: Date;
37
+ dateString: string;
38
+ formatDate?: (date: Date) => string;
39
+ } & React$1.RefAttributes<HTMLDivElement>>;
40
+ type DaySeparatorLineProps = Omit<React$1.HTMLAttributes<HTMLDivElement>, "children"> & {
41
+ children?: React$1.ReactNode;
42
+ asChild?: boolean;
43
+ className?: string;
44
+ };
45
+ /**
46
+ * Decorative line element for the day separator.
47
+ * Typically rendered on either side of the label.
48
+ */
49
+ declare const DaySeparatorLine: React$1.ForwardRefExoticComponent<Omit<React$1.HTMLAttributes<HTMLDivElement>, "children"> & {
50
+ children?: React$1.ReactNode;
51
+ asChild?: boolean;
52
+ className?: string;
53
+ } & React$1.RefAttributes<HTMLDivElement>>;
54
+ type DaySeparatorLabelProps = Omit<React$1.HTMLAttributes<HTMLSpanElement>, "children"> & {
55
+ children?: React$1.ReactNode | ((props: {
56
+ formattedDate: string;
57
+ }) => React$1.ReactNode);
58
+ asChild?: boolean;
59
+ className?: string;
60
+ formattedDate?: string;
61
+ };
62
+ /**
63
+ * Text label element for the day separator.
64
+ * Displays the formatted date string.
65
+ */
66
+ declare const DaySeparatorLabel: React$1.ForwardRefExoticComponent<Omit<React$1.HTMLAttributes<HTMLSpanElement>, "children"> & {
67
+ children?: React$1.ReactNode | ((props: {
68
+ formattedDate: string;
69
+ }) => React$1.ReactNode);
70
+ asChild?: boolean;
71
+ className?: string;
72
+ formattedDate?: string;
73
+ } & React$1.RefAttributes<HTMLSpanElement>>;
74
+ //#endregion
75
+ export { DaySeparator, DaySeparatorLabel, DaySeparatorLabelProps, DaySeparatorLine, DaySeparatorLineProps, DaySeparatorProps, DaySeparatorRenderProps, defaultFormatDate };
76
+ //# sourceMappingURL=day-separator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"day-separator.d.ts","names":[],"sources":["../../src/primitives/day-separator.tsx"],"sourcesContent":[],"mappings":";;;;;;AA4BA;AAoBY,cApBC,iBAoBsB,EAAA,CAAA,IAC5B,EArBiC,IAqB7B,EAAA,GAAA,MAAA;AAOX;;;AAAgC,KARpB,uBAAA,GAQoB;EAK5B,IAAA,EAZG,IAYG;EACG,UAAA,EAAA,MAAA;EAA4B,aAAM,EAAA,MAAA;EAGxC,OAAA,EAAA,OAAA;EAE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A,CAAA,GAAA;EAD8B,QAAA,CAAA,EAjCzB,OAAA,CAAM,SAiCmB;EAKjC,OAAM,CAAA,EAAA,OAAA;EACiC,SAAM,CAAA,EAAA,MAAA;CAAS,wBAAA,eAAA,CAAA,CAAA;AAU7C,KAhBD,sBAAA,GAAyB,IA8CjC,CA7CH,OAAA,CAAM,cA6CH,CA7CkB,eA6ClB,CAAA,EAAA,UAAA,CAAA,GAAA;EA9B0B,QAAA,CAAA,EAX1B,OAAA,CAAM,SAWoB,GAAA,CAAA,CAAA,KAAA,EAAA;IAAA,aAAA,EAAA,MAAA;EAAA,CAAA,EAAA,GAVa,OAAA,CAAM,SAUnB,CAAA;EAX1B,OAAM,CAAA,EAAA,OAAA;EACiC,SAAM,CAAA,EAAA,MAAA;;;;;;;cAUpC,mBAAiB,OAAA,CAAA,0BAAA,KAAA,OAAA,CAAA,eAAA;aAX1B,OAAA,CAAM;;QACiC,OAAA,CAAM"}
@@ -0,0 +1,111 @@
1
+ import { useRenderElement } from "../utils/use-render-element.js";
2
+ import * as React$1 from "react";
3
+
4
+ //#region src/primitives/day-separator.tsx
5
+ /**
6
+ * Helper to check if a date is today
7
+ */
8
+ const isToday = (date) => {
9
+ const now = /* @__PURE__ */ new Date();
10
+ const today = new Date(now.getFullYear(), now.getMonth(), now.getDate());
11
+ return new Date(date.getFullYear(), date.getMonth(), date.getDate()).getTime() === today.getTime();
12
+ };
13
+ /**
14
+ * Helper to check if a date is yesterday
15
+ */
16
+ const isYesterday = (date) => {
17
+ const now = /* @__PURE__ */ new Date();
18
+ const today = new Date(now.getFullYear(), now.getMonth(), now.getDate());
19
+ const yesterday = new Date(today);
20
+ yesterday.setDate(yesterday.getDate() - 1);
21
+ return new Date(date.getFullYear(), date.getMonth(), date.getDate()).getTime() === yesterday.getTime();
22
+ };
23
+ /**
24
+ * Default date formatter that returns "Today", "Yesterday", or a full date string
25
+ */
26
+ const defaultFormatDate = (date) => {
27
+ if (isToday(date)) return "Today";
28
+ if (isYesterday(date)) return "Yesterday";
29
+ return date.toLocaleDateString(void 0, {
30
+ year: "numeric",
31
+ month: "long",
32
+ day: "numeric"
33
+ });
34
+ };
35
+ /**
36
+ * Headless day separator component that marks the boundary between different days
37
+ * in a conversation timeline. Consumers can either render their own layout via
38
+ * a render prop or rely on slotted children.
39
+ */
40
+ const DaySeparator = (() => {
41
+ const Component = React$1.forwardRef(({ children, className, asChild = false, date, dateString, formatDate = defaultFormatDate,...restProps }, ref) => {
42
+ const formattedDate = formatDate(date);
43
+ const renderProps = {
44
+ date,
45
+ dateString,
46
+ formattedDate,
47
+ isToday: isToday(date),
48
+ isYesterday: isYesterday(date)
49
+ };
50
+ const content = typeof children === "function" ? children(renderProps) : children;
51
+ return useRenderElement("div", {
52
+ className,
53
+ asChild
54
+ }, {
55
+ ref,
56
+ state: renderProps,
57
+ props: {
58
+ role: "separator",
59
+ "aria-label": `Day separator: ${formattedDate}`,
60
+ ...restProps,
61
+ children: content
62
+ }
63
+ });
64
+ });
65
+ Component.displayName = "DaySeparator";
66
+ return Component;
67
+ })();
68
+ /**
69
+ * Decorative line element for the day separator.
70
+ * Typically rendered on either side of the label.
71
+ */
72
+ const DaySeparatorLine = (() => {
73
+ const Component = React$1.forwardRef(({ children, className, asChild = false,...props }, ref) => useRenderElement("div", {
74
+ className,
75
+ asChild
76
+ }, {
77
+ ref,
78
+ props: {
79
+ "aria-hidden": true,
80
+ ...props,
81
+ children
82
+ }
83
+ }));
84
+ Component.displayName = "DaySeparatorLine";
85
+ return Component;
86
+ })();
87
+ /**
88
+ * Text label element for the day separator.
89
+ * Displays the formatted date string.
90
+ */
91
+ const DaySeparatorLabel = (() => {
92
+ const Component = React$1.forwardRef(({ children, className, asChild = false, formattedDate = "",...props }, ref) => {
93
+ const content = typeof children === "function" ? children({ formattedDate }) : children ?? formattedDate;
94
+ return useRenderElement("span", {
95
+ className,
96
+ asChild
97
+ }, {
98
+ ref,
99
+ props: {
100
+ ...props,
101
+ children: content
102
+ }
103
+ });
104
+ });
105
+ Component.displayName = "DaySeparatorLabel";
106
+ return Component;
107
+ })();
108
+
109
+ //#endregion
110
+ export { DaySeparator, DaySeparatorLabel, DaySeparatorLine, defaultFormatDate };
111
+ //# sourceMappingURL=day-separator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"day-separator.js","names":["React","renderProps: DaySeparatorRenderProps"],"sources":["../../src/primitives/day-separator.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { useRenderElement } from \"../utils/use-render-element\";\n\n/**\n * Helper to check if a date is today\n */\nconst isToday = (date: Date): boolean => {\n\tconst now = new Date();\n\tconst today = new Date(now.getFullYear(), now.getMonth(), now.getDate());\n\tconst itemDay = new Date(date.getFullYear(), date.getMonth(), date.getDate());\n\treturn itemDay.getTime() === today.getTime();\n};\n\n/**\n * Helper to check if a date is yesterday\n */\nconst isYesterday = (date: Date): boolean => {\n\tconst now = new Date();\n\tconst today = new Date(now.getFullYear(), now.getMonth(), now.getDate());\n\tconst yesterday = new Date(today);\n\tyesterday.setDate(yesterday.getDate() - 1);\n\tconst itemDay = new Date(date.getFullYear(), date.getMonth(), date.getDate());\n\treturn itemDay.getTime() === yesterday.getTime();\n};\n\n/**\n * Default date formatter that returns \"Today\", \"Yesterday\", or a full date string\n */\nexport const defaultFormatDate = (date: Date): string => {\n\tif (isToday(date)) {\n\t\treturn \"Today\";\n\t}\n\n\tif (isYesterday(date)) {\n\t\treturn \"Yesterday\";\n\t}\n\n\t// Format as \"January 15, 2024\"\n\treturn date.toLocaleDateString(undefined, {\n\t\tyear: \"numeric\",\n\t\tmonth: \"long\",\n\t\tday: \"numeric\",\n\t});\n};\n\n/**\n * Shape returned to render-prop children describing the day separator state\n */\nexport type DaySeparatorRenderProps = {\n\tdate: Date;\n\tdateString: string;\n\tformattedDate: string;\n\tisToday: boolean;\n\tisYesterday: boolean;\n};\n\nexport type DaySeparatorProps = Omit<\n\tReact.HTMLAttributes<HTMLDivElement>,\n\t\"children\"\n> & {\n\tchildren?:\n\t\t| React.ReactNode\n\t\t| ((props: DaySeparatorRenderProps) => React.ReactNode);\n\tasChild?: boolean;\n\tclassName?: string;\n\tdate: Date;\n\tdateString: string;\n\tformatDate?: (date: Date) => string;\n};\n\n/**\n * Headless day separator component that marks the boundary between different days\n * in a conversation timeline. Consumers can either render their own layout via\n * a render prop or rely on slotted children.\n */\nexport const DaySeparator = (() => {\n\tconst Component = React.forwardRef<HTMLDivElement, DaySeparatorProps>(\n\t\t(\n\t\t\t{\n\t\t\t\tchildren,\n\t\t\t\tclassName,\n\t\t\t\tasChild = false,\n\t\t\t\tdate,\n\t\t\t\tdateString,\n\t\t\t\tformatDate = defaultFormatDate,\n\t\t\t\t...restProps\n\t\t\t},\n\t\t\tref\n\t\t) => {\n\t\t\tconst formattedDate = formatDate(date);\n\t\t\tconst isTodayValue = isToday(date);\n\t\t\tconst isYesterdayValue = isYesterday(date);\n\n\t\t\tconst renderProps: DaySeparatorRenderProps = {\n\t\t\t\tdate,\n\t\t\t\tdateString,\n\t\t\t\tformattedDate,\n\t\t\t\tisToday: isTodayValue,\n\t\t\t\tisYesterday: isYesterdayValue,\n\t\t\t};\n\n\t\t\tconst content =\n\t\t\t\ttypeof children === \"function\" ? children(renderProps) : children;\n\n\t\t\treturn useRenderElement(\n\t\t\t\t\"div\",\n\t\t\t\t{\n\t\t\t\t\tclassName,\n\t\t\t\t\tasChild,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tref,\n\t\t\t\t\tstate: renderProps,\n\t\t\t\t\tprops: {\n\t\t\t\t\t\trole: \"separator\",\n\t\t\t\t\t\t\"aria-label\": `Day separator: ${formattedDate}`,\n\t\t\t\t\t\t...restProps,\n\t\t\t\t\t\tchildren: content,\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t);\n\n\tComponent.displayName = \"DaySeparator\";\n\treturn Component;\n})();\n\nexport type DaySeparatorLineProps = Omit<\n\tReact.HTMLAttributes<HTMLDivElement>,\n\t\"children\"\n> & {\n\tchildren?: React.ReactNode;\n\tasChild?: boolean;\n\tclassName?: string;\n};\n\n/**\n * Decorative line element for the day separator.\n * Typically rendered on either side of the label.\n */\nexport const DaySeparatorLine = (() => {\n\tconst Component = React.forwardRef<HTMLDivElement, DaySeparatorLineProps>(\n\t\t({ children, className, asChild = false, ...props }, ref) =>\n\t\t\tuseRenderElement(\n\t\t\t\t\"div\",\n\t\t\t\t{\n\t\t\t\t\tclassName,\n\t\t\t\t\tasChild,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tref,\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t\"aria-hidden\": true,\n\t\t\t\t\t\t...props,\n\t\t\t\t\t\tchildren,\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t)\n\t);\n\n\tComponent.displayName = \"DaySeparatorLine\";\n\treturn Component;\n})();\n\nexport type DaySeparatorLabelProps = Omit<\n\tReact.HTMLAttributes<HTMLSpanElement>,\n\t\"children\"\n> & {\n\tchildren?:\n\t\t| React.ReactNode\n\t\t| ((props: { formattedDate: string }) => React.ReactNode);\n\tasChild?: boolean;\n\tclassName?: string;\n\tformattedDate?: string;\n};\n\n/**\n * Text label element for the day separator.\n * Displays the formatted date string.\n */\nexport const DaySeparatorLabel = (() => {\n\tconst Component = React.forwardRef<HTMLSpanElement, DaySeparatorLabelProps>(\n\t\t(\n\t\t\t{ children, className, asChild = false, formattedDate = \"\", ...props },\n\t\t\tref\n\t\t) => {\n\t\t\tconst content =\n\t\t\t\ttypeof children === \"function\"\n\t\t\t\t\t? children({ formattedDate })\n\t\t\t\t\t: (children ?? formattedDate);\n\n\t\t\treturn useRenderElement(\n\t\t\t\t\"span\",\n\t\t\t\t{\n\t\t\t\t\tclassName,\n\t\t\t\t\tasChild,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tref,\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...props,\n\t\t\t\t\t\tchildren: content,\n\t\t\t\t\t},\n\t\t\t\t}\n\t\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,OAAO;IACN,MAAM;IACN,cAAc,kBAAkB;IAChC,GAAG;IACH,UAAU;IACV;GACD,CACD;GAEF;AAED,WAAU,cAAc;AACxB,QAAO;IACJ;;;;;AAeJ,MAAa,0BAA0B;CACtC,MAAM,YAAYD,QAAM,YACtB,EAAE,UAAU,WAAW,UAAU,MAAO,GAAG,SAAS,QACpD,iBACC,OACA;EACC;EACA;EACA,EACD;EACC;EACA,OAAO;GACN,eAAe;GACf,GAAG;GACH;GACA;EACD,CACD,CACF;AAED,WAAU,cAAc;AACxB,QAAO;IACJ;;;;;AAkBJ,MAAa,2BAA2B;CACvC,MAAM,YAAYA,QAAM,YAEtB,EAAE,UAAU,WAAW,UAAU,OAAO,gBAAgB,GAAI,GAAG,SAC/D,QACI;EACJ,MAAM,UACL,OAAO,aAAa,aACjB,SAAS,EAAE,eAAe,CAAC,GAC1B,YAAY;AAEjB,SAAO,iBACN,QACA;GACC;GACA;GACA,EACD;GACC;GACA,OAAO;IACN,GAAG;IACH,UAAU;IACV;GACD,CACD;GAEF;AAED,WAAU,cAAc;AACxB,QAAO;IACJ"}
@@ -3,20 +3,22 @@ import { SupportConfig } from "../support-config.js";
3
3
  import { Avatar } from "./avatar/avatar.js";
4
4
  import { AvatarFallback } from "./avatar/fallback.js";
5
5
  import { AvatarImage } from "./avatar/image.js";
6
- import { SupportBubble } from "./bubble.js";
7
6
  import { Button } from "./button.js";
8
7
  import { ConversationTimeline, ConversationTimelineContainer, ConversationTimelineEmpty, ConversationTimelineLoading } from "./conversation-timeline.js";
8
+ import { DaySeparator, DaySeparatorLabel, DaySeparatorLabelProps, DaySeparatorLine, DaySeparatorLineProps, DaySeparatorProps, DaySeparatorRenderProps, defaultFormatDate } from "./day-separator.js";
9
9
  import { FileInput, MultimodalInput, SupportInput } from "./multimodal-input.js";
10
10
  import { PageDefinition, Router, RouterProps } from "./router.js";
11
11
  import { TimelineItem, TimelineItemContent, TimelineItemTimestamp } from "./timeline-item.js";
12
+ import { TimelineItemAttachments, TimelineItemFiles, TimelineItemImages, extractFileParts, extractImageParts, hasAttachments } from "./timeline-item-attachments.js";
12
13
  import { TimelineItemGroup, TimelineItemGroupAvatar, TimelineItemGroupContent, TimelineItemGroupHeader, TimelineItemGroupReadIndicator, TimelineItemGroupSeenIndicator } from "./timeline-item-group.js";
14
+ import { SupportTrigger, TriggerProps, TriggerRenderProps } from "./trigger.js";
13
15
  import { SupportWindow } from "./window.js";
14
16
  import "./index.parts.js";
15
17
 
16
18
  //#region src/primitives/index.d.ts
17
19
  declare namespace index_d_exports {
18
- export { Avatar, AvatarFallback, AvatarImage, SupportBubble as Bubble, Button, SupportConfig as Config, ConversationTimeline, ConversationTimelineContainer, ConversationTimelineEmpty, ConversationTimelineLoading, FileInput, SupportInput as Input, MultimodalInput, PageDefinition, Router, RouterProps, TimelineItem, TimelineItemContent, TimelineItemGroup, TimelineItemGroupAvatar, TimelineItemGroupContent, TimelineItemGroupHeader, TimelineItemGroupReadIndicator, TimelineItemGroupSeenIndicator, TimelineItemTimestamp, TypingIndicator, TypingIndicatorProps, TypingParticipant, TypingParticipantType, SupportWindow as Window };
20
+ export { Avatar, AvatarFallback, AvatarImage, Button, SupportConfig as Config, ConversationTimeline, ConversationTimelineContainer, ConversationTimelineEmpty, ConversationTimelineLoading, DaySeparator, DaySeparatorLabel, DaySeparatorLabelProps, DaySeparatorLine, DaySeparatorLineProps, DaySeparatorProps, DaySeparatorRenderProps, FileInput, SupportInput as Input, MultimodalInput, PageDefinition, Router, RouterProps, TimelineItem, TimelineItemAttachments, TimelineItemContent, TimelineItemFiles, TimelineItemGroup, TimelineItemGroupAvatar, TimelineItemGroupContent, TimelineItemGroupHeader, TimelineItemGroupReadIndicator, TimelineItemGroupSeenIndicator, TimelineItemImages, TimelineItemTimestamp, SupportTrigger as Trigger, TriggerProps, TriggerRenderProps, TypingIndicator, TypingIndicatorProps, TypingParticipant, TypingParticipantType, SupportWindow as Window, defaultFormatDate, extractFileParts, extractImageParts, hasAttachments };
19
21
  }
20
22
  //#endregion
21
- export { Avatar, AvatarFallback, AvatarImage, SupportBubble as Bubble, Button, SupportConfig as Config, ConversationTimeline, ConversationTimelineContainer, ConversationTimelineEmpty, ConversationTimelineLoading, FileInput, SupportInput as Input, MultimodalInput, PageDefinition, Router, RouterProps, TimelineItem, TimelineItemContent, TimelineItemGroup, TimelineItemGroupAvatar, TimelineItemGroupContent, TimelineItemGroupHeader, TimelineItemGroupReadIndicator, TimelineItemGroupSeenIndicator, TimelineItemTimestamp, TypingIndicator, TypingIndicatorProps, TypingParticipant, TypingParticipantType, SupportWindow as Window, index_d_exports };
23
+ export { Avatar, AvatarFallback, AvatarImage, Button, SupportConfig as Config, ConversationTimeline, ConversationTimelineContainer, ConversationTimelineEmpty, ConversationTimelineLoading, DaySeparator, DaySeparatorLabel, DaySeparatorLabelProps, DaySeparatorLine, DaySeparatorLineProps, DaySeparatorProps, DaySeparatorRenderProps, FileInput, SupportInput as Input, MultimodalInput, PageDefinition, Router, RouterProps, TimelineItem, TimelineItemAttachments, TimelineItemContent, TimelineItemFiles, TimelineItemGroup, TimelineItemGroupAvatar, TimelineItemGroupContent, TimelineItemGroupHeader, TimelineItemGroupReadIndicator, TimelineItemGroupSeenIndicator, TimelineItemImages, TimelineItemTimestamp, SupportTrigger as Trigger, TriggerProps, TriggerRenderProps, TypingIndicator, TypingIndicatorProps, TypingParticipant, TypingParticipantType, SupportWindow as Window, defaultFormatDate, extractFileParts, extractImageParts, hasAttachments, index_d_exports };
22
24
  //# sourceMappingURL=index.d.ts.map
@@ -1,16 +1,18 @@
1
1
  import { __export } from "../_virtual/rolldown_runtime.js";
2
- import { SupportConfig } from "../support-config.js";
3
2
  import { Avatar } from "./avatar/avatar.js";
4
3
  import { AvatarFallback } from "./avatar/fallback.js";
5
4
  import { AvatarImage } from "./avatar/image.js";
6
5
  import { TypingIndicator } from "../support/components/typing-indicator.js";
7
- import { SupportBubble } from "./bubble.js";
6
+ import { SupportConfig } from "../support-config.js";
8
7
  import { Button } from "./button.js";
9
8
  import { ConversationTimeline, ConversationTimelineContainer, ConversationTimelineEmpty, ConversationTimelineLoading } from "./conversation-timeline.js";
9
+ import { DaySeparator, DaySeparatorLabel, DaySeparatorLine, defaultFormatDate } from "./day-separator.js";
10
10
  import { FileInput, MultimodalInput, SupportInput } from "./multimodal-input.js";
11
11
  import { Router } from "./router.js";
12
12
  import { TimelineItem, TimelineItemContent, TimelineItemTimestamp } from "./timeline-item.js";
13
+ import { TimelineItemAttachments, TimelineItemFiles, TimelineItemImages, extractFileParts, extractImageParts, hasAttachments } from "./timeline-item-attachments.js";
13
14
  import { TimelineItemGroup, TimelineItemGroupAvatar, TimelineItemGroupContent, TimelineItemGroupHeader, TimelineItemGroupReadIndicator, TimelineItemGroupSeenIndicator } from "./timeline-item-group.js";
15
+ import { SupportTrigger } from "./trigger.js";
14
16
  import { SupportWindow } from "./window.js";
15
17
 
16
18
  //#region src/primitives/index.ts
@@ -18,30 +20,40 @@ var primitives_exports = /* @__PURE__ */ __export({
18
20
  Avatar: () => Avatar,
19
21
  AvatarFallback: () => AvatarFallback,
20
22
  AvatarImage: () => AvatarImage,
21
- Bubble: () => SupportBubble,
22
23
  Button: () => Button,
23
24
  Config: () => SupportConfig,
24
25
  ConversationTimeline: () => ConversationTimeline,
25
26
  ConversationTimelineContainer: () => ConversationTimelineContainer,
26
27
  ConversationTimelineEmpty: () => ConversationTimelineEmpty,
27
28
  ConversationTimelineLoading: () => ConversationTimelineLoading,
29
+ DaySeparator: () => DaySeparator,
30
+ DaySeparatorLabel: () => DaySeparatorLabel,
31
+ DaySeparatorLine: () => DaySeparatorLine,
28
32
  FileInput: () => FileInput,
29
33
  Input: () => SupportInput,
30
34
  MultimodalInput: () => MultimodalInput,
31
35
  Router: () => Router,
32
36
  TimelineItem: () => TimelineItem,
37
+ TimelineItemAttachments: () => TimelineItemAttachments,
33
38
  TimelineItemContent: () => TimelineItemContent,
39
+ TimelineItemFiles: () => TimelineItemFiles,
34
40
  TimelineItemGroup: () => TimelineItemGroup,
35
41
  TimelineItemGroupAvatar: () => TimelineItemGroupAvatar,
36
42
  TimelineItemGroupContent: () => TimelineItemGroupContent,
37
43
  TimelineItemGroupHeader: () => TimelineItemGroupHeader,
38
44
  TimelineItemGroupReadIndicator: () => TimelineItemGroupReadIndicator,
39
45
  TimelineItemGroupSeenIndicator: () => TimelineItemGroupSeenIndicator,
46
+ TimelineItemImages: () => TimelineItemImages,
40
47
  TimelineItemTimestamp: () => TimelineItemTimestamp,
48
+ Trigger: () => SupportTrigger,
41
49
  TypingIndicator: () => TypingIndicator,
42
- Window: () => SupportWindow
50
+ Window: () => SupportWindow,
51
+ defaultFormatDate: () => defaultFormatDate,
52
+ extractFileParts: () => extractFileParts,
53
+ extractImageParts: () => extractImageParts,
54
+ hasAttachments: () => hasAttachments
43
55
  });
44
56
 
45
57
  //#endregion
46
- export { Avatar, AvatarFallback, AvatarImage, SupportBubble as Bubble, Button, SupportConfig as Config, ConversationTimeline, ConversationTimelineContainer, ConversationTimelineEmpty, ConversationTimelineLoading, FileInput, SupportInput as Input, MultimodalInput, Router, TimelineItem, TimelineItemContent, TimelineItemGroup, TimelineItemGroupAvatar, TimelineItemGroupContent, TimelineItemGroupHeader, TimelineItemGroupReadIndicator, TimelineItemGroupSeenIndicator, TimelineItemTimestamp, TypingIndicator, SupportWindow as Window, primitives_exports };
58
+ export { Avatar, AvatarFallback, AvatarImage, Button, SupportConfig as Config, ConversationTimeline, ConversationTimelineContainer, ConversationTimelineEmpty, ConversationTimelineLoading, DaySeparator, DaySeparatorLabel, DaySeparatorLine, FileInput, SupportInput as Input, MultimodalInput, Router, TimelineItem, TimelineItemAttachments, TimelineItemContent, TimelineItemFiles, TimelineItemGroup, TimelineItemGroupAvatar, TimelineItemGroupContent, TimelineItemGroupHeader, TimelineItemGroupReadIndicator, TimelineItemGroupSeenIndicator, TimelineItemImages, TimelineItemTimestamp, SupportTrigger as Trigger, TypingIndicator, SupportWindow as Window, defaultFormatDate, extractFileParts, extractImageParts, hasAttachments, primitives_exports };
47
59
  //# sourceMappingURL=index.js.map