@gram-ai/elements 1.34.0 → 1.35.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 (233) hide show
  1. package/dist/compat-shims-CO9JXXV4.cjs.map +1 -1
  2. package/dist/compat-shims-DxtUrORi.js.map +1 -1
  3. package/dist/compat-shims.d.ts +9 -8
  4. package/dist/components/Chat/index.d.ts +2 -1
  5. package/dist/components/ChatHistory.d.ts +1 -1
  6. package/dist/components/FrontendTools/index.d.ts +1 -1
  7. package/dist/components/Replay.d.ts +1 -1
  8. package/dist/components/Replay.stories.d.ts +2 -2
  9. package/dist/components/ShadowRoot.d.ts +1 -1
  10. package/dist/components/ShareButton/index.d.ts +1 -1
  11. package/dist/components/ui/avatar.d.ts +3 -3
  12. package/dist/components/ui/button.d.ts +2 -2
  13. package/dist/components/ui/buttonVariants.d.ts +2 -2
  14. package/dist/components/ui/calendar.d.ts +2 -1
  15. package/dist/components/ui/collapsible.d.ts +3 -3
  16. package/dist/components/ui/dialog.d.ts +10 -10
  17. package/dist/components/ui/popover.d.ts +4 -4
  18. package/dist/components/ui/skeleton.d.ts +1 -1
  19. package/dist/components/ui/time-range-picker.d.ts +2 -1
  20. package/dist/components/ui/tool-ui.d.ts +7 -7
  21. package/dist/components/ui/tooltip.d.ts +4 -4
  22. package/dist/contexts/ConnectionStatusContext.d.ts +1 -1
  23. package/dist/contexts/ElementsProvider.d.ts +1 -1
  24. package/dist/contexts/ToolApprovalContext.d.ts +2 -2
  25. package/dist/contexts/ToolExecutionContext.d.ts +1 -1
  26. package/dist/contexts/portal-container.d.ts +1 -1
  27. package/dist/elements.cjs +1 -1
  28. package/dist/elements.css +1 -1
  29. package/dist/elements.js +2 -2
  30. package/dist/hooks/useDensity.d.ts +1 -1
  31. package/dist/hooks/useElements.d.ts +2 -1
  32. package/dist/hooks/useGramThreadListAdapter.d.ts +13 -0
  33. package/dist/hooks/useRadius.d.ts +1 -1
  34. package/dist/hooks/useThemeProps.d.ts +1 -1
  35. package/dist/hooks/useToolApproval.d.ts +2 -1
  36. package/dist/{index-BFU6NvbL.js → index-BhIowiZF.js} +9408 -9204
  37. package/dist/index-BhIowiZF.js.map +1 -0
  38. package/dist/{index-C08dvTEo.cjs → index-D0jIGQr7.cjs} +3 -3
  39. package/dist/index-D0jIGQr7.cjs.map +1 -0
  40. package/dist/{index-B5lZrrO2.js → index-Dz13dSDa.js} +57 -15
  41. package/dist/index-Dz13dSDa.js.map +1 -0
  42. package/dist/index-PXd3rs95.cjs +194 -0
  43. package/dist/index-PXd3rs95.cjs.map +1 -0
  44. package/dist/lib/errorTracking.d.ts +1 -1
  45. package/dist/lib/tools.d.ts +11 -10
  46. package/dist/plugins/generative-ui/catalog.d.ts +3 -3
  47. package/dist/plugins/generative-ui/ui/accordion-wrapper.d.ts +2 -2
  48. package/dist/plugins/generative-ui/ui/accordion.d.ts +4 -4
  49. package/dist/plugins/generative-ui/ui/action-button.d.ts +1 -1
  50. package/dist/plugins/generative-ui/ui/alert-wrapper.d.ts +2 -1
  51. package/dist/plugins/generative-ui/ui/alert.d.ts +3 -3
  52. package/dist/plugins/generative-ui/ui/avatar-wrapper.d.ts +2 -1
  53. package/dist/plugins/generative-ui/ui/avatar.d.ts +6 -6
  54. package/dist/plugins/generative-ui/ui/badge.d.ts +2 -2
  55. package/dist/plugins/generative-ui/ui/button-wrapper.d.ts +2 -1
  56. package/dist/plugins/generative-ui/ui/button.d.ts +3 -3
  57. package/dist/plugins/generative-ui/ui/card-wrapper.d.ts +1 -1
  58. package/dist/plugins/generative-ui/ui/card.d.ts +7 -7
  59. package/dist/plugins/generative-ui/ui/checkbox-wrapper.d.ts +2 -1
  60. package/dist/plugins/generative-ui/ui/checkbox.d.ts +1 -1
  61. package/dist/plugins/generative-ui/ui/data-table.d.ts +1 -1
  62. package/dist/plugins/generative-ui/ui/dialog.d.ts +10 -10
  63. package/dist/plugins/generative-ui/ui/dropdown-menu.d.ts +15 -15
  64. package/dist/plugins/generative-ui/ui/grid.d.ts +1 -1
  65. package/dist/plugins/generative-ui/ui/index.d.ts +57 -40
  66. package/dist/plugins/generative-ui/ui/input-wrapper.d.ts +2 -1
  67. package/dist/plugins/generative-ui/ui/input.d.ts +1 -1
  68. package/dist/plugins/generative-ui/ui/label.d.ts +1 -1
  69. package/dist/plugins/generative-ui/ui/list.d.ts +2 -1
  70. package/dist/plugins/generative-ui/ui/metric.d.ts +1 -1
  71. package/dist/plugins/generative-ui/ui/pagination.d.ts +7 -7
  72. package/dist/plugins/generative-ui/ui/popover.d.ts +7 -7
  73. package/dist/plugins/generative-ui/ui/progress.d.ts +1 -1
  74. package/dist/plugins/generative-ui/ui/radio-group.d.ts +2 -2
  75. package/dist/plugins/generative-ui/ui/select-wrapper.d.ts +2 -1
  76. package/dist/plugins/generative-ui/ui/select.d.ts +10 -10
  77. package/dist/plugins/generative-ui/ui/separator.d.ts +1 -1
  78. package/dist/plugins/generative-ui/ui/skeleton-wrapper.d.ts +2 -1
  79. package/dist/plugins/generative-ui/ui/skeleton.d.ts +1 -1
  80. package/dist/plugins/generative-ui/ui/stack.d.ts +1 -1
  81. package/dist/plugins/generative-ui/ui/switch.d.ts +1 -1
  82. package/dist/plugins/generative-ui/ui/table.d.ts +8 -8
  83. package/dist/plugins/generative-ui/ui/tabs-wrapper.d.ts +2 -2
  84. package/dist/plugins/generative-ui/ui/tabs.d.ts +4 -4
  85. package/dist/plugins/generative-ui/ui/text.d.ts +1 -1
  86. package/dist/plugins/generative-ui/ui/textarea.d.ts +1 -1
  87. package/dist/plugins/generative-ui/ui/tooltip.d.ts +4 -4
  88. package/dist/plugins.cjs +1 -1
  89. package/dist/plugins.js +1 -1
  90. package/dist/{profiler-KLSTpp6I.js → profiler-CtGKTWWP.js} +2 -2
  91. package/dist/{profiler-KLSTpp6I.js.map → profiler-CtGKTWWP.js.map} +1 -1
  92. package/dist/{profiler-BRnyr1GA.cjs → profiler-l7_HjTyw.cjs} +2 -2
  93. package/dist/{profiler-BRnyr1GA.cjs.map → profiler-l7_HjTyw.cjs.map} +1 -1
  94. package/dist/react-shim.cjs.map +1 -1
  95. package/dist/react-shim.d.ts +1 -1
  96. package/dist/react-shim.js +1 -4
  97. package/dist/react-shim.js.map +1 -1
  98. package/dist/server/bun.cjs.map +1 -1
  99. package/dist/server/bun.js.map +1 -1
  100. package/dist/server/express.cjs.map +1 -1
  101. package/dist/server/express.js.map +1 -1
  102. package/dist/server/fastify.cjs.map +1 -1
  103. package/dist/server/fastify.js.map +1 -1
  104. package/dist/server/hono.cjs.map +1 -1
  105. package/dist/server/hono.js.map +1 -1
  106. package/dist/server/nextjs.cjs.map +1 -1
  107. package/dist/server/nextjs.js.map +1 -1
  108. package/dist/server/tanstack-start.cjs.map +1 -1
  109. package/dist/server/tanstack-start.js.map +1 -1
  110. package/dist/{startRecording-CKx-YWbq.cjs → startRecording-DEw2Aeq4.cjs} +2 -2
  111. package/dist/{startRecording-CKx-YWbq.cjs.map → startRecording-DEw2Aeq4.cjs.map} +1 -1
  112. package/dist/{startRecording-BfxB1xxR.js → startRecording-iYEL0-vr.js} +2 -2
  113. package/dist/{startRecording-BfxB1xxR.js.map → startRecording-iYEL0-vr.js.map} +1 -1
  114. package/dist/types/index.d.ts +29 -3
  115. package/package.json +7 -10
  116. package/src/compat-shims.ts +16 -2
  117. package/src/components/Chat/index.tsx +4 -1
  118. package/src/components/Chat/stories/FrontendTools.stories.tsx +1 -1
  119. package/src/components/Chat/stories/ToolApproval.stories.tsx +2 -2
  120. package/src/components/Chat/stories/Tools.stories.tsx +13 -5
  121. package/src/components/ChatHistory.tsx +3 -1
  122. package/src/components/FrontendTools/index.tsx +1 -1
  123. package/src/components/MessageContent.tsx +1 -0
  124. package/src/components/Replay.stories.tsx +2 -3
  125. package/src/components/Replay.tsx +17 -10
  126. package/src/components/ShadowRoot.tsx +2 -2
  127. package/src/components/ShareButton/index.tsx +4 -2
  128. package/src/components/assistant-ui/assistant-modal.tsx +5 -3
  129. package/src/components/assistant-ui/attachment.tsx +1 -1
  130. package/src/components/assistant-ui/error-boundary.tsx +1 -1
  131. package/src/components/assistant-ui/markdown-text.tsx +1 -1
  132. package/src/components/assistant-ui/thread.tsx +249 -11
  133. package/src/components/assistant-ui/tool-mention-autocomplete.tsx +1 -1
  134. package/src/components/ui/avatar.tsx +3 -3
  135. package/src/components/ui/calendar.tsx +1 -1
  136. package/src/components/ui/collapsible.tsx +7 -3
  137. package/src/components/ui/dialog.tsx +18 -10
  138. package/src/components/ui/generative-ui.tsx +9 -4
  139. package/src/components/ui/popover.tsx +4 -4
  140. package/src/components/ui/skeleton.tsx +4 -1
  141. package/src/components/ui/time-range-picker.stories.tsx +164 -154
  142. package/src/components/ui/time-range-picker.tsx +11 -5
  143. package/src/components/ui/tool-ui.tsx +18 -9
  144. package/src/components/ui/tooltip.tsx +4 -4
  145. package/src/contexts/ChatIdContext.tsx +1 -1
  146. package/src/contexts/ConnectionStatusContext.tsx +6 -5
  147. package/src/contexts/ElementsProvider.tsx +64 -41
  148. package/src/contexts/ReplayContext.ts +1 -1
  149. package/src/contexts/ToolApprovalContext.tsx +5 -1
  150. package/src/contexts/ToolExecutionContext.tsx +1 -1
  151. package/src/contexts/portal-container.tsx +1 -1
  152. package/src/hooks/useAuth.ts +2 -1
  153. package/src/hooks/useDensity.ts +1 -1
  154. package/src/hooks/useElements.ts +2 -1
  155. package/src/hooks/useFollowOnSuggestions.ts +3 -6
  156. package/src/hooks/useGramThreadListAdapter.tsx +50 -3
  157. package/src/hooks/useMCPTools.ts +2 -2
  158. package/src/hooks/useModel.ts +1 -3
  159. package/src/hooks/usePluginComponents.ts +3 -1
  160. package/src/hooks/useRadius.ts +1 -1
  161. package/src/hooks/useSession.ts +3 -1
  162. package/src/hooks/useThemeProps.ts +5 -5
  163. package/src/hooks/useToolApproval.ts +2 -1
  164. package/src/lib/cassette.ts +20 -8
  165. package/src/lib/errorTracking.ts +1 -4
  166. package/src/lib/messageConverter.test.ts +11 -13
  167. package/src/lib/messageConverter.ts +13 -4
  168. package/src/lib/token.ts +2 -5
  169. package/src/lib/tool-mentions.ts +5 -2
  170. package/src/lib/tools.byte-cap.test.ts +1 -1
  171. package/src/lib/tools.test.ts +1 -1
  172. package/src/lib/tools.ts +15 -5
  173. package/src/lib/utils.ts +2 -2
  174. package/src/lib.d.ts +8 -1
  175. package/src/plugins/chart/chart.test.ts +3 -4
  176. package/src/plugins/chart/component.tsx +7 -6
  177. package/src/plugins/chart/ui/area-chart.tsx +1 -1
  178. package/src/plugins/chart/ui/line-chart.tsx +1 -1
  179. package/src/plugins/generative-ui/ui/accordion-wrapper.tsx +2 -2
  180. package/src/plugins/generative-ui/ui/accordion.tsx +4 -4
  181. package/src/plugins/generative-ui/ui/action-button.tsx +4 -2
  182. package/src/plugins/generative-ui/ui/alert-wrapper.tsx +1 -1
  183. package/src/plugins/generative-ui/ui/alert.tsx +7 -3
  184. package/src/plugins/generative-ui/ui/avatar-wrapper.tsx +5 -1
  185. package/src/plugins/generative-ui/ui/avatar.tsx +12 -6
  186. package/src/plugins/generative-ui/ui/badge.tsx +1 -1
  187. package/src/plugins/generative-ui/ui/button-wrapper.tsx +1 -1
  188. package/src/plugins/generative-ui/ui/button.tsx +1 -1
  189. package/src/plugins/generative-ui/ui/card-wrapper.tsx +1 -1
  190. package/src/plugins/generative-ui/ui/card.tsx +28 -7
  191. package/src/plugins/generative-ui/ui/checkbox-wrapper.tsx +1 -1
  192. package/src/plugins/generative-ui/ui/checkbox.tsx +1 -1
  193. package/src/plugins/generative-ui/ui/data-table.tsx +1 -1
  194. package/src/plugins/generative-ui/ui/dialog.tsx +15 -10
  195. package/src/plugins/generative-ui/ui/dropdown-menu.tsx +33 -15
  196. package/src/plugins/generative-ui/ui/grid.tsx +1 -1
  197. package/src/plugins/generative-ui/ui/index.ts +154 -40
  198. package/src/plugins/generative-ui/ui/input-wrapper.tsx +1 -1
  199. package/src/plugins/generative-ui/ui/input.tsx +5 -1
  200. package/src/plugins/generative-ui/ui/label.tsx +1 -1
  201. package/src/plugins/generative-ui/ui/list.tsx +5 -1
  202. package/src/plugins/generative-ui/ui/metric.tsx +2 -1
  203. package/src/plugins/generative-ui/ui/pagination.tsx +12 -7
  204. package/src/plugins/generative-ui/ui/popover.tsx +13 -7
  205. package/src/plugins/generative-ui/ui/progress.tsx +1 -1
  206. package/src/plugins/generative-ui/ui/radio-group.tsx +2 -2
  207. package/src/plugins/generative-ui/ui/select-wrapper.tsx +1 -1
  208. package/src/plugins/generative-ui/ui/select.tsx +14 -10
  209. package/src/plugins/generative-ui/ui/separator.tsx +1 -1
  210. package/src/plugins/generative-ui/ui/skeleton-wrapper.tsx +1 -1
  211. package/src/plugins/generative-ui/ui/skeleton.tsx +4 -1
  212. package/src/plugins/generative-ui/ui/stack.tsx +1 -1
  213. package/src/plugins/generative-ui/ui/switch.tsx +1 -1
  214. package/src/plugins/generative-ui/ui/table.tsx +29 -8
  215. package/src/plugins/generative-ui/ui/tabs-wrapper.tsx +5 -2
  216. package/src/plugins/generative-ui/ui/tabs.tsx +4 -4
  217. package/src/plugins/generative-ui/ui/text.tsx +1 -1
  218. package/src/plugins/generative-ui/ui/textarea.tsx +4 -1
  219. package/src/plugins/generative-ui/ui/tooltip.tsx +4 -4
  220. package/src/react-shim.ts +9 -4
  221. package/src/server/bun.ts +1 -1
  222. package/src/server/express.ts +1 -1
  223. package/src/server/fastify.ts +1 -1
  224. package/src/server/hono.ts +1 -1
  225. package/src/server/nextjs.ts +1 -1
  226. package/src/server/tanstack-start.ts +1 -1
  227. package/src/storybook.d.ts +5 -0
  228. package/src/types/index.ts +39 -3
  229. package/dist/index-B5lZrrO2.js.map +0 -1
  230. package/dist/index-BFU6NvbL.js.map +0 -1
  231. package/dist/index-C08dvTEo.cjs.map +0 -1
  232. package/dist/index-DzZ1-jQY.cjs +0 -194
  233. package/dist/index-DzZ1-jQY.cjs.map +0 -1
@@ -2939,7 +2939,7 @@ function ae(...e) {
2939
2939
  return mI(fe(e));
2940
2940
  }
2941
2941
  function eX(e) {
2942
- throw new Error(`Unexpected value: ${e}`);
2942
+ throw new Error(`Unexpected value: ${String(e)}`);
2943
2943
  }
2944
2944
  function tX(e, t) {
2945
2945
  if (!e)
@@ -29520,7 +29520,10 @@ function k4({
29520
29520
  }
29521
29521
  );
29522
29522
  }
29523
- function R4({ className: e, ...t }) {
29523
+ function R4({
29524
+ className: e,
29525
+ ...t
29526
+ }) {
29524
29527
  return /* @__PURE__ */ _(
29525
29528
  "div",
29526
29529
  {
@@ -29803,7 +29806,11 @@ const X4 = fo(
29803
29806
  }
29804
29807
  ));
29805
29808
  Z4.displayName = "Button";
29806
- function J4({ className: e, type: t, ...r }) {
29809
+ function J4({
29810
+ className: e,
29811
+ type: t,
29812
+ ...r
29813
+ }) {
29807
29814
  return /* @__PURE__ */ _(
29808
29815
  "input",
29809
29816
  {
@@ -30022,7 +30029,10 @@ function JO({
30022
30029
  }
30023
30030
  );
30024
30031
  }
30025
- function sY({ className: e, ...t }) {
30032
+ function sY({
30033
+ className: e,
30034
+ ...t
30035
+ }) {
30026
30036
  return /* @__PURE__ */ _(
30027
30037
  "div",
30028
30038
  {
@@ -30032,7 +30042,10 @@ function sY({ className: e, ...t }) {
30032
30042
  }
30033
30043
  );
30034
30044
  }
30035
- function cY({ className: e, ...t }) {
30045
+ function cY({
30046
+ className: e,
30047
+ ...t
30048
+ }) {
30036
30049
  return /* @__PURE__ */ _(
30037
30050
  "div",
30038
30051
  {
@@ -30049,7 +30062,10 @@ function cY({ className: e, ...t }) {
30049
30062
  }
30050
30063
  );
30051
30064
  }
30052
- function uY({ className: e, ...t }) {
30065
+ function uY({
30066
+ className: e,
30067
+ ...t
30068
+ }) {
30053
30069
  return /* @__PURE__ */ _(
30054
30070
  "thead",
30055
30071
  {
@@ -30059,7 +30075,10 @@ function uY({ className: e, ...t }) {
30059
30075
  }
30060
30076
  );
30061
30077
  }
30062
- function lY({ className: e, ...t }) {
30078
+ function lY({
30079
+ className: e,
30080
+ ...t
30081
+ }) {
30063
30082
  return /* @__PURE__ */ _(
30064
30083
  "tbody",
30065
30084
  {
@@ -30069,7 +30088,10 @@ function lY({ className: e, ...t }) {
30069
30088
  }
30070
30089
  );
30071
30090
  }
30072
- function QO({ className: e, ...t }) {
30091
+ function QO({
30092
+ className: e,
30093
+ ...t
30094
+ }) {
30073
30095
  return /* @__PURE__ */ _(
30074
30096
  "tr",
30075
30097
  {
@@ -30082,7 +30104,10 @@ function QO({ className: e, ...t }) {
30082
30104
  }
30083
30105
  );
30084
30106
  }
30085
- function fY({ className: e, ...t }) {
30107
+ function fY({
30108
+ className: e,
30109
+ ...t
30110
+ }) {
30086
30111
  return /* @__PURE__ */ _(
30087
30112
  "th",
30088
30113
  {
@@ -30095,7 +30120,10 @@ function fY({ className: e, ...t }) {
30095
30120
  }
30096
30121
  );
30097
30122
  }
30098
- function dY({ className: e, ...t }) {
30123
+ function dY({
30124
+ className: e,
30125
+ ...t
30126
+ }) {
30099
30127
  return /* @__PURE__ */ _(
30100
30128
  "td",
30101
30129
  {
@@ -30277,7 +30305,9 @@ function wY({
30277
30305
  variant: h ? "destructive" : n,
30278
30306
  size: i,
30279
30307
  className: ae(a),
30280
- onClick: v,
30308
+ onClick: () => {
30309
+ v();
30310
+ },
30281
30311
  disabled: o || l || !d,
30282
30312
  ...s,
30283
30313
  children: l ? "Loading..." : e
@@ -30296,7 +30326,11 @@ function SY({
30296
30326
  t && /* @__PURE__ */ _(M4, { children: t })
30297
30327
  ] });
30298
30328
  }
30299
- function OY({ src: e, alt: t, fallback: r }) {
30329
+ function OY({
30330
+ src: e,
30331
+ alt: t,
30332
+ fallback: r
30333
+ }) {
30300
30334
  return /* @__PURE__ */ se(j4, { children: [
30301
30335
  e && /* @__PURE__ */ _($4, { src: e, alt: t }),
30302
30336
  /* @__PURE__ */ _(N4, { children: r })
@@ -30404,7 +30438,11 @@ function IY({
30404
30438
  )
30405
30439
  ] });
30406
30440
  }
30407
- function kY({ items: e, ordered: t = !1, className: r }) {
30441
+ function kY({
30442
+ items: e,
30443
+ ordered: t = !1,
30444
+ className: r
30445
+ }) {
30408
30446
  const n = ae(
30409
30447
  "space-y-1 pl-4 text-foreground",
30410
30448
  t ? "list-decimal" : "list-disc",
@@ -30427,6 +30465,7 @@ function RY(e, t) {
30427
30465
  maximumFractionDigits: 1
30428
30466
  }).format(e);
30429
30467
  case "number":
30468
+ case void 0:
30430
30469
  default:
30431
30470
  return new Intl.NumberFormat("en-US").format(e);
30432
30471
  }
@@ -30528,7 +30567,10 @@ function qY({
30528
30567
  r
30529
30568
  ] });
30530
30569
  }
30531
- function FY({ value: e, children: t }) {
30570
+ function FY({
30571
+ value: e,
30572
+ children: t
30573
+ }) {
30532
30574
  return /* @__PURE__ */ _(yY, { value: e, children: t });
30533
30575
  }
30534
30576
  const zY = {
@@ -30798,4 +30840,4 @@ export {
30798
30840
  W4 as y,
30799
30841
  yr as z
30800
30842
  };
30801
- //# sourceMappingURL=index-B5lZrrO2.js.map
30843
+ //# sourceMappingURL=index-Dz13dSDa.js.map