@assistant-ui/react 0.7.6 → 0.7.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (105) hide show
  1. package/dist/api/ContentPartRuntime.d.ts.map +1 -1
  2. package/dist/api/ContentPartRuntime.js +0 -1
  3. package/dist/api/ContentPartRuntime.js.map +1 -1
  4. package/dist/api/ContentPartRuntime.mjs +0 -1
  5. package/dist/api/ContentPartRuntime.mjs.map +1 -1
  6. package/dist/primitives/threadList/ThreadListItems.d.ts +2 -2
  7. package/dist/primitives/threadList/ThreadListItems.d.ts.map +1 -1
  8. package/dist/primitives/threadList/ThreadListItems.js.map +1 -1
  9. package/dist/primitives/threadList/ThreadListItems.mjs.map +1 -1
  10. package/dist/primitives/threadList/ThreadListNew.d.ts.map +1 -1
  11. package/dist/primitives/threadList/ThreadListNew.js +23 -6
  12. package/dist/primitives/threadList/ThreadListNew.js.map +1 -1
  13. package/dist/primitives/threadList/ThreadListNew.mjs +24 -9
  14. package/dist/primitives/threadList/ThreadListNew.mjs.map +1 -1
  15. package/dist/styles/index.css +66 -0
  16. package/dist/styles/index.css.map +1 -1
  17. package/dist/styles/tailwindcss/thread.css +30 -0
  18. package/dist/styles/tailwindcss/thread.css.json +21 -0
  19. package/dist/ui/assistant-action-bar.d.ts +7 -7
  20. package/dist/ui/assistant-action-bar.d.ts.map +1 -1
  21. package/dist/ui/assistant-action-bar.js.map +1 -1
  22. package/dist/ui/assistant-action-bar.mjs +1 -3
  23. package/dist/ui/assistant-action-bar.mjs.map +1 -1
  24. package/dist/ui/assistant-modal.d.ts +3 -3
  25. package/dist/ui/assistant-modal.d.ts.map +1 -1
  26. package/dist/ui/assistant-modal.js.map +1 -1
  27. package/dist/ui/assistant-modal.mjs +1 -3
  28. package/dist/ui/assistant-modal.mjs.map +1 -1
  29. package/dist/ui/attachment-ui.d.ts +2 -2
  30. package/dist/ui/attachment-ui.d.ts.map +1 -1
  31. package/dist/ui/attachment-ui.js.map +1 -1
  32. package/dist/ui/attachment-ui.mjs +1 -3
  33. package/dist/ui/attachment-ui.mjs.map +1 -1
  34. package/dist/ui/base/index.d.ts +1 -1
  35. package/dist/ui/base/index.d.ts.map +1 -1
  36. package/dist/ui/base/index.js.map +1 -1
  37. package/dist/ui/base/index.mjs +1 -3
  38. package/dist/ui/base/index.mjs.map +1 -1
  39. package/dist/ui/base/tooltip-icon-button.d.ts +6 -4
  40. package/dist/ui/base/tooltip-icon-button.d.ts.map +1 -1
  41. package/dist/ui/base/tooltip-icon-button.js.map +1 -1
  42. package/dist/ui/base/tooltip-icon-button.mjs.map +1 -1
  43. package/dist/ui/branch-picker.d.ts +3 -3
  44. package/dist/ui/branch-picker.d.ts.map +1 -1
  45. package/dist/ui/branch-picker.js.map +1 -1
  46. package/dist/ui/branch-picker.mjs +1 -3
  47. package/dist/ui/branch-picker.mjs.map +1 -1
  48. package/dist/ui/composer.d.ts +4 -4
  49. package/dist/ui/composer.d.ts.map +1 -1
  50. package/dist/ui/composer.js.map +1 -1
  51. package/dist/ui/composer.mjs +1 -3
  52. package/dist/ui/composer.mjs.map +1 -1
  53. package/dist/ui/index.d.ts +2 -0
  54. package/dist/ui/index.d.ts.map +1 -1
  55. package/dist/ui/index.js +6 -0
  56. package/dist/ui/index.js.map +1 -1
  57. package/dist/ui/index.mjs +4 -0
  58. package/dist/ui/index.mjs.map +1 -1
  59. package/dist/ui/thread-config.d.ts +13 -0
  60. package/dist/ui/thread-config.d.ts.map +1 -1
  61. package/dist/ui/thread-config.js +8 -1
  62. package/dist/ui/thread-config.js.map +1 -1
  63. package/dist/ui/thread-config.mjs +8 -1
  64. package/dist/ui/thread-config.mjs.map +1 -1
  65. package/dist/ui/thread-list-item.d.ts +24 -0
  66. package/dist/ui/thread-list-item.d.ts.map +1 -0
  67. package/dist/ui/thread-list-item.js +107 -0
  68. package/dist/ui/thread-list-item.js.map +1 -0
  69. package/dist/ui/thread-list-item.mjs +77 -0
  70. package/dist/ui/thread-list-item.mjs.map +1 -0
  71. package/dist/ui/thread-list.d.ts +20 -0
  72. package/dist/ui/thread-list.d.ts.map +1 -0
  73. package/dist/ui/thread-list.js +92 -0
  74. package/dist/ui/thread-list.js.map +1 -0
  75. package/dist/ui/thread-list.mjs +62 -0
  76. package/dist/ui/thread-list.mjs.map +1 -0
  77. package/dist/ui/thread.d.ts +2 -2
  78. package/dist/ui/thread.d.ts.map +1 -1
  79. package/dist/ui/thread.js.map +1 -1
  80. package/dist/ui/thread.mjs +1 -3
  81. package/dist/ui/thread.mjs.map +1 -1
  82. package/dist/ui/user-action-bar.d.ts +2 -2
  83. package/dist/ui/user-action-bar.d.ts.map +1 -1
  84. package/dist/ui/user-action-bar.js.map +1 -1
  85. package/dist/ui/user-action-bar.mjs +1 -3
  86. package/dist/ui/user-action-bar.mjs.map +1 -1
  87. package/package.json +4 -4
  88. package/src/api/ContentPartRuntime.ts +0 -1
  89. package/src/primitives/threadList/ThreadListItems.tsx +3 -3
  90. package/src/primitives/threadList/ThreadListNew.tsx +45 -0
  91. package/src/styles/tailwindcss/thread.css +30 -0
  92. package/src/ui/assistant-action-bar.tsx +7 -10
  93. package/src/ui/assistant-modal.tsx +3 -6
  94. package/src/ui/attachment-ui.tsx +2 -5
  95. package/src/ui/base/index.ts +1 -4
  96. package/src/ui/base/tooltip-icon-button.tsx +7 -5
  97. package/src/ui/branch-picker.tsx +3 -6
  98. package/src/ui/composer.tsx +4 -7
  99. package/src/ui/index.ts +4 -0
  100. package/src/ui/thread-config.tsx +29 -7
  101. package/src/ui/thread-list-item.tsx +99 -0
  102. package/src/ui/thread-list.tsx +72 -0
  103. package/src/ui/thread.tsx +2 -5
  104. package/src/ui/user-action-bar.tsx +2 -5
  105. package/src/primitives/threadList/ThreadListNew.ts +0 -25
@@ -1,5 +1,5 @@
1
1
  import { type FC } from "react";
2
- import { TooltipIconButtonProps } from "./base/tooltip-icon-button";
2
+ import { TooltipIconButton } from "./base/tooltip-icon-button";
3
3
  declare const BranchPicker: FC;
4
4
  declare const exports: {
5
5
  Root: import("react").ForwardRefExoticComponent<Partial<Omit<Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
@@ -9,8 +9,8 @@ declare const exports: {
9
9
  }, "ref"> & {
10
10
  hideWhenSingleBranch?: boolean | undefined;
11
11
  } & import("react").RefAttributes<HTMLDivElement>, "ref">> & import("react").RefAttributes<HTMLDivElement>>;
12
- Previous: import("react").ForwardRefExoticComponent<Partial<TooltipIconButtonProps> & import("react").RefAttributes<HTMLButtonElement>>;
13
- Next: import("react").ForwardRefExoticComponent<Partial<TooltipIconButtonProps> & import("react").RefAttributes<HTMLButtonElement>>;
12
+ Previous: import("react").ForwardRefExoticComponent<Partial<TooltipIconButton.Props> & import("react").RefAttributes<HTMLButtonElement>>;
13
+ Next: import("react").ForwardRefExoticComponent<Partial<TooltipIconButton.Props> & import("react").RefAttributes<HTMLButtonElement>>;
14
14
  };
15
15
  declare const _default: typeof BranchPicker & typeof exports;
16
16
  export default _default;
@@ -1 +1 @@
1
- {"version":3,"file":"branch-picker.d.ts","sourceRoot":"","sources":["../../src/ui/branch-picker.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAwC,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAGtE,OAAO,EAEL,sBAAsB,EACvB,MAAM,4BAA4B,CAAC;AAYpC,QAAA,MAAM,YAAY,EAAE,EAUnB,CAAC;AAkFF,QAAA,MAAM,OAAO;;;;;;;;;;CAIZ,CAAC;wBAEqD,OAAO,YAAY,GACxE,OAAO,OAAO;AADhB,wBACiB"}
1
+ {"version":3,"file":"branch-picker.d.ts","sourceRoot":"","sources":["../../src/ui/branch-picker.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAwC,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAGtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAY/D,QAAA,MAAM,YAAY,EAAE,EAUnB,CAAC;AAkFF,QAAA,MAAM,OAAO;;;;;;;;;;CAIZ,CAAC;wBAEqD,OAAO,YAAY,GACxE,OAAO,OAAO;AADhB,wBACiB"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/ui/branch-picker.tsx"],"sourcesContent":["\"use client\";\n\nimport { ComponentPropsWithoutRef, forwardRef, type FC } from \"react\";\nimport { ChevronLeftIcon, ChevronRightIcon } from \"lucide-react\";\n\nimport {\n TooltipIconButton,\n TooltipIconButtonProps,\n} from \"./base/tooltip-icon-button\";\nimport { withDefaults } from \"./utils/withDefaults\";\nimport { useThreadConfig } from \"./thread-config\";\nimport { BranchPickerPrimitive } from \"../primitives\";\nimport { useThread } from \"../context\";\n\nconst useAllowBranchPicker = (ensureCapability = false) => {\n const { branchPicker: { allowBranchPicker = true } = {} } = useThreadConfig();\n const branchPickerSupported = useThread((t) => t.capabilities.edit);\n return allowBranchPicker && (!ensureCapability || branchPickerSupported);\n};\n\nconst BranchPicker: FC = () => {\n const allowBranchPicker = useAllowBranchPicker(true);\n if (!allowBranchPicker) return null;\n return (\n <BranchPickerRoot hideWhenSingleBranch>\n <BranchPickerPrevious />\n <BranchPickerState />\n <BranchPickerNext />\n </BranchPickerRoot>\n );\n};\n\nBranchPicker.displayName = \"BranchPicker\";\n\nconst BranchPickerRoot = withDefaults(BranchPickerPrimitive.Root, {\n className: \"aui-branch-picker-root\",\n});\n\nBranchPickerRoot.displayName = \"BranchPickerRoot\";\n\nnamespace BranchPickerPrevious {\n export type Element = BranchPickerPrimitive.Previous.Element;\n export type Props = Partial<TooltipIconButtonProps>;\n}\n\nconst BranchPickerPrevious = forwardRef<\n BranchPickerPrevious.Element,\n BranchPickerPrevious.Props\n>((props, ref) => {\n const {\n strings: {\n branchPicker: { previous: { tooltip = \"Previous\" } = {} } = {},\n } = {},\n } = useThreadConfig();\n const allowBranchPicker = useAllowBranchPicker();\n return (\n <BranchPickerPrimitive.Previous disabled={!allowBranchPicker} asChild>\n <TooltipIconButton tooltip={tooltip} {...props} ref={ref}>\n {props.children ?? <ChevronLeftIcon />}\n </TooltipIconButton>\n </BranchPickerPrimitive.Previous>\n );\n});\n\nBranchPickerPrevious.displayName = \"BranchPickerPrevious\";\n\nconst BranchPickerStateWrapper = withDefaults(\"span\", {\n className: \"aui-branch-picker-state\",\n});\n\nnamespace BranchPickerState {\n export type Element = HTMLSpanElement;\n export type Props = ComponentPropsWithoutRef<\"span\">;\n}\n\nconst BranchPickerState = forwardRef<\n BranchPickerState.Element,\n BranchPickerState.Props\n>((props, ref) => {\n return (\n <BranchPickerStateWrapper {...props} ref={ref}>\n <BranchPickerPrimitive.Number /> / <BranchPickerPrimitive.Count />\n </BranchPickerStateWrapper>\n );\n});\n\nBranchPickerState.displayName = \"BranchPickerState\";\n\nnamespace BranchPickerNext {\n export type Element = BranchPickerPrimitive.Next.Element;\n export type Props = Partial<TooltipIconButtonProps>;\n}\n\nconst BranchPickerNext = forwardRef<\n BranchPickerNext.Element,\n BranchPickerNext.Props\n>((props, ref) => {\n const {\n strings: { branchPicker: { next: { tooltip = \"Next\" } = {} } = {} } = {},\n } = useThreadConfig();\n const allowBranchPicker = useAllowBranchPicker();\n return (\n <BranchPickerPrimitive.Next disabled={!allowBranchPicker} asChild>\n <TooltipIconButton tooltip={tooltip} {...props} ref={ref}>\n {props.children ?? <ChevronRightIcon />}\n </TooltipIconButton>\n </BranchPickerPrimitive.Next>\n );\n});\n\nBranchPickerNext.displayName = \"BranchPickerNext\";\n\nconst exports = {\n Root: BranchPickerRoot,\n Previous: BranchPickerPrevious,\n Next: BranchPickerNext,\n};\n\nexport default Object.assign(BranchPicker, exports) as typeof BranchPicker &\n typeof exports;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,mBAA8D;AAC9D,0BAAkD;AAElD,iCAGO;AACP,0BAA6B;AAC7B,2BAAgC;AAChC,wBAAsC;AACtC,qBAA0B;AAYtB;AAVJ,IAAM,uBAAuB,CAAC,mBAAmB,UAAU;AACzD,QAAM,EAAE,cAAc,EAA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AGvB,CAAC,OAAO,QAAQ;AAChB,QAAM;AAAA,IACJ,SAAS,EAAE,cAAc,EAAE,MAAM,EAAE,UAAU,OAAO,IAAI,CAAC,EAAE,IAAI,CAAC,EAAE,IAAI,CAAC;AAAA,EACzE,QAAI,sCAAgB;AACpB,QAAM,oBAAoB,qBAAqB;AAC/C,SACE,4CAAC,wCAAsB,MAAtB,EAA2B,UAAU,CAAC,mBAAmB,SAAO,MAC/D,sDAAC,gDAAkB,SAAmB,GAAG,OAAO,KAC7C,gBAAM,YAAY,4CAAC,wCAAiB,GACvC,GACF;AAEJ,CAAC;AAED,iBAAiB,cAAc;AAE/B,IAAMA,WAAU;AAAA,EACd,MAAM;AAAA,EACN,UAAU;AAAA,EACV,MAAM;AACR;AAEA,IAAO,wBAAQ,OAAO,OAAO,cAAcA,QAAO;","names":["exports"]}
1
+ {"version":3,"sources":["../../src/ui/branch-picker.tsx"],"sourcesContent":["\"use client\";\n\nimport { ComponentPropsWithoutRef, forwardRef, type FC } from \"react\";\nimport { ChevronLeftIcon, ChevronRightIcon } from \"lucide-react\";\n\nimport { TooltipIconButton } from \"./base/tooltip-icon-button\";\nimport { withDefaults } from \"./utils/withDefaults\";\nimport { useThreadConfig } from \"./thread-config\";\nimport { BranchPickerPrimitive } from \"../primitives\";\nimport { useThread } from \"../context\";\n\nconst useAllowBranchPicker = (ensureCapability = false) => {\n const { branchPicker: { allowBranchPicker = true } = {} } = useThreadConfig();\n const branchPickerSupported = useThread((t) => t.capabilities.edit);\n return allowBranchPicker && (!ensureCapability || branchPickerSupported);\n};\n\nconst BranchPicker: FC = () => {\n const allowBranchPicker = useAllowBranchPicker(true);\n if (!allowBranchPicker) return null;\n return (\n <BranchPickerRoot hideWhenSingleBranch>\n <BranchPickerPrevious />\n <BranchPickerState />\n <BranchPickerNext />\n </BranchPickerRoot>\n );\n};\n\nBranchPicker.displayName = \"BranchPicker\";\n\nconst BranchPickerRoot = withDefaults(BranchPickerPrimitive.Root, {\n className: \"aui-branch-picker-root\",\n});\n\nBranchPickerRoot.displayName = \"BranchPickerRoot\";\n\nnamespace BranchPickerPrevious {\n export type Element = BranchPickerPrimitive.Previous.Element;\n export type Props = Partial<TooltipIconButton.Props>;\n}\n\nconst BranchPickerPrevious = forwardRef<\n BranchPickerPrevious.Element,\n BranchPickerPrevious.Props\n>((props, ref) => {\n const {\n strings: {\n branchPicker: { previous: { tooltip = \"Previous\" } = {} } = {},\n } = {},\n } = useThreadConfig();\n const allowBranchPicker = useAllowBranchPicker();\n return (\n <BranchPickerPrimitive.Previous disabled={!allowBranchPicker} asChild>\n <TooltipIconButton tooltip={tooltip} {...props} ref={ref}>\n {props.children ?? <ChevronLeftIcon />}\n </TooltipIconButton>\n </BranchPickerPrimitive.Previous>\n );\n});\n\nBranchPickerPrevious.displayName = \"BranchPickerPrevious\";\n\nconst BranchPickerStateWrapper = withDefaults(\"span\", {\n className: \"aui-branch-picker-state\",\n});\n\nnamespace BranchPickerState {\n export type Element = HTMLSpanElement;\n export type Props = ComponentPropsWithoutRef<\"span\">;\n}\n\nconst BranchPickerState = forwardRef<\n BranchPickerState.Element,\n BranchPickerState.Props\n>((props, ref) => {\n return (\n <BranchPickerStateWrapper {...props} ref={ref}>\n <BranchPickerPrimitive.Number /> / <BranchPickerPrimitive.Count />\n </BranchPickerStateWrapper>\n );\n});\n\nBranchPickerState.displayName = \"BranchPickerState\";\n\nnamespace BranchPickerNext {\n export type Element = BranchPickerPrimitive.Next.Element;\n export type Props = Partial<TooltipIconButton.Props>;\n}\n\nconst BranchPickerNext = forwardRef<\n BranchPickerNext.Element,\n BranchPickerNext.Props\n>((props, ref) => {\n const {\n strings: { branchPicker: { next: { tooltip = \"Next\" } = {} } = {} } = {},\n } = useThreadConfig();\n const allowBranchPicker = useAllowBranchPicker();\n return (\n <BranchPickerPrimitive.Next disabled={!allowBranchPicker} asChild>\n <TooltipIconButton tooltip={tooltip} {...props} ref={ref}>\n {props.children ?? <ChevronRightIcon />}\n </TooltipIconButton>\n </BranchPickerPrimitive.Next>\n );\n});\n\nBranchPickerNext.displayName = \"BranchPickerNext\";\n\nconst exports = {\n Root: BranchPickerRoot,\n Previous: BranchPickerPrevious,\n Next: BranchPickerNext,\n};\n\nexport default Object.assign(BranchPicker, exports) as typeof BranchPicker &\n typeof exports;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,mBAA8D;AAC9D,0BAAkD;AAElD,iCAAkC;AAClC,0BAA6B;AAC7B,2BAAgC;AAChC,wBAAsC;AACtC,qBAA0B;AAYtB;AAVJ,IAAM,uBAAuB,CAAC,mBAAmB,UAAU;AACzD,QAAM,EAAE,cAAc,EAAE,oBAAoB,KAAK,IAAI,CAAC,EAAE,QAAI,sCAAgB;AAC5E,QAAM,4BAAwB,0BAAU,CAAC,MAAM,EAAE,aAAa,IAAI;AAClE,SAAO,sBAAsB,CAAC,oBAAoB;AACpD;AAEA,IAAM,eAAmB,MAAM;AAC7B,QAAM,oBAAoB,qBAAqB,IAAI;AACnD,MAAI,CAAC,kBAAmB,QAAO;AAC/B,SACE,6CAAC,oBAAiB,sBAAoB,MACpC;AAAA,gDAAC,wBAAqB;AAAA,IACtB,4CAAC,qBAAkB;AAAA,IACnB,4CAAC,oBAAiB;AAAA,KACpB;AAEJ;AAEA,aAAa,cAAc;AAE3B,IAAM,uBAAmB,kCAAa,wCAAsB,MAAM;AAAA,EAChE,WAAW;AACb,CAAC;AAED,iBAAiB,cAAc;AAO/B,IAAM,2BAAuB,yBAG3B,CAAC,OAAO,QAAQ;AAChB,QAAM;AAAA,IACJ,SAAS;AAAA,MACP,cAAc,EAAE,UAAU,EAAE,UAAU,WAAW,IAAI,CAAC,EAAE,IAAI,CAAC;AAAA,IAC/D,IAAI,CAAC;AAAA,EACP,QAAI,sCAAgB;AACpB,QAAM,oBAAoB,qBAAqB;AAC/C,SACE,4CAAC,wCAAsB,UAAtB,EAA+B,UAAU,CAAC,mBAAmB,SAAO,MACnE,sDAAC,gDAAkB,SAAmB,GAAG,OAAO,KAC7C,gBAAM,YAAY,4CAAC,uCAAgB,GACtC,GACF;AAEJ,CAAC;AAED,qBAAqB,cAAc;AAEnC,IAAM,+BAA2B,kCAAa,QAAQ;AAAA,EACpD,WAAW;AACb,CAAC;AAOD,IAAM,wBAAoB,yBAGxB,CAAC,OAAO,QAAQ;AAChB,SACE,6CAAC,4BAA0B,GAAG,OAAO,KACnC;AAAA,gDAAC,wCAAsB,QAAtB,EAA6B;AAAA,IAAE;AAAA,IAAG,4CAAC,wCAAsB,OAAtB,EAA4B;AAAA,KAClE;AAEJ,CAAC;AAED,kBAAkB,cAAc;AAOhC,IAAM,uBAAmB,yBAGvB,CAAC,OAAO,QAAQ;AAChB,QAAM;AAAA,IACJ,SAAS,EAAE,cAAc,EAAE,MAAM,EAAE,UAAU,OAAO,IAAI,CAAC,EAAE,IAAI,CAAC,EAAE,IAAI,CAAC;AAAA,EACzE,QAAI,sCAAgB;AACpB,QAAM,oBAAoB,qBAAqB;AAC/C,SACE,4CAAC,wCAAsB,MAAtB,EAA2B,UAAU,CAAC,mBAAmB,SAAO,MAC/D,sDAAC,gDAAkB,SAAmB,GAAG,OAAO,KAC7C,gBAAM,YAAY,4CAAC,wCAAiB,GACvC,GACF;AAEJ,CAAC;AAED,iBAAiB,cAAc;AAE/B,IAAMA,WAAU;AAAA,EACd,MAAM;AAAA,EACN,UAAU;AAAA,EACV,MAAM;AACR;AAEA,IAAO,wBAAQ,OAAO,OAAO,cAAcA,QAAO;","names":["exports"]}
@@ -3,9 +3,7 @@
3
3
  // src/ui/branch-picker.tsx
4
4
  import { forwardRef } from "react";
5
5
  import { ChevronLeftIcon, ChevronRightIcon } from "lucide-react";
6
- import {
7
- TooltipIconButton
8
- } from "./base/tooltip-icon-button.mjs";
6
+ import { TooltipIconButton } from "./base/tooltip-icon-button.mjs";
9
7
  import { withDefaults } from "./utils/withDefaults.mjs";
10
8
  import { useThreadConfig } from "./thread-config.mjs";
11
9
  import { BranchPickerPrimitive } from "../primitives/index.mjs";
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/ui/branch-picker.tsx"],"sourcesContent":["\"use client\";\n\nimport { ComponentPropsWithoutRef, forwardRef, type FC } from \"react\";\nimport { ChevronLeftIcon, ChevronRightIcon } from \"lucide-react\";\n\nimport {\n TooltipIconButton,\n TooltipIconButtonProps,\n} from \"./base/tooltip-icon-button\";\nimport { withDefaults } from \"./utils/withDefaults\";\nimport { useThreadConfig } from \"./thread-config\";\nimport { BranchPickerPrimitive } from \"../primitives\";\nimport { useThread } from \"../context\";\n\nconst useAllowBranchPicker = (ensureCapability = false) => {\n const { branchPicker: { allowBranchPicker = true } = {} } = useThreadConfig();\n const branchPickerSupported = useThread((t) => t.capabilities.edit);\n return allowBranchPicker && (!ensureCapability || branchPickerSupported);\n};\n\nconst BranchPicker: FC = () => {\n const allowBranchPicker = useAllowBranchPicker(true);\n if (!allowBranchPicker) return null;\n return (\n <BranchPickerRoot hideWhenSingleBranch>\n <BranchPickerPrevious />\n <BranchPickerState />\n <BranchPickerNext />\n </BranchPickerRoot>\n );\n};\n\nBranchPicker.displayName = \"BranchPicker\";\n\nconst BranchPickerRoot = withDefaults(BranchPickerPrimitive.Root, {\n className: \"aui-branch-picker-root\",\n});\n\nBranchPickerRoot.displayName = \"BranchPickerRoot\";\n\nnamespace BranchPickerPrevious {\n export type Element = BranchPickerPrimitive.Previous.Element;\n export type Props = Partial<TooltipIconButtonProps>;\n}\n\nconst BranchPickerPrevious = forwardRef<\n BranchPickerPrevious.Element,\n BranchPickerPrevious.Props\n>((props, ref) => {\n const {\n strings: {\n branchPicker: { previous: { tooltip = \"Previous\" } = {} } = {},\n } = {},\n } = useThreadConfig();\n const allowBranchPicker = useAllowBranchPicker();\n return (\n <BranchPickerPrimitive.Previous disabled={!allowBranchPicker} asChild>\n <TooltipIconButton tooltip={tooltip} {...props} ref={ref}>\n {props.children ?? <ChevronLeftIcon />}\n </TooltipIconButton>\n </BranchPickerPrimitive.Previous>\n );\n});\n\nBranchPickerPrevious.displayName = \"BranchPickerPrevious\";\n\nconst BranchPickerStateWrapper = withDefaults(\"span\", {\n className: \"aui-branch-picker-state\",\n});\n\nnamespace BranchPickerState {\n export type Element = HTMLSpanElement;\n export type Props = ComponentPropsWithoutRef<\"span\">;\n}\n\nconst BranchPickerState = forwardRef<\n BranchPickerState.Element,\n BranchPickerState.Props\n>((props, ref) => {\n return (\n <BranchPickerStateWrapper {...props} ref={ref}>\n <BranchPickerPrimitive.Number /> / <BranchPickerPrimitive.Count />\n </BranchPickerStateWrapper>\n );\n});\n\nBranchPickerState.displayName = \"BranchPickerState\";\n\nnamespace BranchPickerNext {\n export type Element = BranchPickerPrimitive.Next.Element;\n export type Props = Partial<TooltipIconButtonProps>;\n}\n\nconst BranchPickerNext = forwardRef<\n BranchPickerNext.Element,\n BranchPickerNext.Props\n>((props, ref) => {\n const {\n strings: { branchPicker: { next: { tooltip = \"Next\" } = {} } = {} } = {},\n } = useThreadConfig();\n const allowBranchPicker = useAllowBranchPicker();\n return (\n <BranchPickerPrimitive.Next disabled={!allowBranchPicker} asChild>\n <TooltipIconButton tooltip={tooltip} {...props} ref={ref}>\n {props.children ?? <ChevronRightIcon />}\n </TooltipIconButton>\n </BranchPickerPrimitive.Next>\n );\n});\n\nBranchPickerNext.displayName = \"BranchPickerNext\";\n\nconst exports = {\n Root: BranchPickerRoot,\n Previous: BranchPickerPrevious,\n Next: BranchPickerNext,\n};\n\nexport default Object.assign(BranchPicker, exports) as typeof BranchPicker &\n typeof exports;\n"],"mappings":";;;AAEA,SAAmC,kBAA2B;AAC9D,SAAS,iBAAiB,wBAAwB;AAElD;AAAA,EACE;AAAA,OAEK;AACP,SAAS,oBAAoB;AAC7B,SAAS,uBAAuB;AAChC,SAAS,6BAA6B;AACtC,SAAS,iBAAiB;AAYtB,SACE,KADF;AAVJ,IAAM,uBAAuB,CAAC,mBAAmB,UAAU;AACzD,QAAM,EAAE,cAAc,EAAE,oB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OAAO,QAAQ;AAChB,QAAM;AAAA,IACJ,SAAS,EAAE,cAAc,EAAE,MAAM,EAAE,UAAU,OAAO,IAAI,CAAC,EAAE,IAAI,CAAC,EAAE,IAAI,CAAC;AAAA,EACzE,IAAI,gBAAgB;AACpB,QAAM,oBAAoB,qBAAqB;AAC/C,SACE,oBAAC,sBAAsB,MAAtB,EAA2B,UAAU,CAAC,mBAAmB,SAAO,MAC/D,8BAAC,qBAAkB,SAAmB,GAAG,OAAO,KAC7C,gBAAM,YAAY,oBAAC,oBAAiB,GACvC,GACF;AAEJ,CAAC;AAED,iBAAiB,cAAc;AAE/B,IAAM,UAAU;AAAA,EACd,MAAM;AAAA,EACN,UAAU;AAAA,EACV,MAAM;AACR;AAEA,IAAO,wBAAQ,OAAO,OAAO,cAAc,OAAO;","names":[]}
1
+ {"version":3,"sources":["../../src/ui/branch-picker.tsx"],"sourcesContent":["\"use client\";\n\nimport { ComponentPropsWithoutRef, forwardRef, type FC } from \"react\";\nimport { ChevronLeftIcon, ChevronRightIcon } from \"lucide-react\";\n\nimport { TooltipIconButton } from \"./base/tooltip-icon-button\";\nimport { withDefaults } from \"./utils/withDefaults\";\nimport { useThreadConfig } from \"./thread-config\";\nimport { BranchPickerPrimitive } from \"../primitives\";\nimport { useThread } from \"../context\";\n\nconst useAllowBranchPicker = (ensureCapability = false) => {\n const { branchPicker: { allowBranchPicker = true } = {} } = useThreadConfig();\n const branchPickerSupported = useThread((t) => t.capabilities.edit);\n return allowBranchPicker && (!ensureCapability || branchPickerSupported);\n};\n\nconst BranchPicker: FC = () => {\n const allowBranchPicker = useAllowBranchPicker(true);\n if (!allowBranchPicker) return null;\n return (\n <BranchPickerRoot hideWhenSingleBranch>\n <BranchPickerPrevious />\n <BranchPickerState />\n <BranchPickerNext />\n </BranchPickerRoot>\n );\n};\n\nBranchPicker.displayName = \"BranchPicker\";\n\nconst BranchPickerRoot = withDefaults(BranchPickerPrimitive.Root, {\n className: \"aui-branch-picker-root\",\n});\n\nBranchPickerRoot.displayName = \"BranchPickerRoot\";\n\nnamespace BranchPickerPrevious {\n export type Element = BranchPickerPrimitive.Previous.Element;\n export type Props = Partial<TooltipIconButton.Props>;\n}\n\nconst BranchPickerPrevious = forwardRef<\n BranchPickerPrevious.Element,\n BranchPickerPrevious.Props\n>((props, ref) => {\n const {\n strings: {\n branchPicker: { previous: { tooltip = \"Previous\" } = {} } = {},\n } = {},\n } = useThreadConfig();\n const allowBranchPicker = useAllowBranchPicker();\n return (\n <BranchPickerPrimitive.Previous disabled={!allowBranchPicker} asChild>\n <TooltipIconButton tooltip={tooltip} {...props} ref={ref}>\n {props.children ?? <ChevronLeftIcon />}\n </TooltipIconButton>\n </BranchPickerPrimitive.Previous>\n );\n});\n\nBranchPickerPrevious.displayName = \"BranchPickerPrevious\";\n\nconst BranchPickerStateWrapper = withDefaults(\"span\", {\n className: \"aui-branch-picker-state\",\n});\n\nnamespace BranchPickerState {\n export type Element = HTMLSpanElement;\n export type Props = ComponentPropsWithoutRef<\"span\">;\n}\n\nconst BranchPickerState = forwardRef<\n BranchPickerState.Element,\n BranchPickerState.Props\n>((props, ref) => {\n return (\n <BranchPickerStateWrapper {...props} ref={ref}>\n <BranchPickerPrimitive.Number /> / <BranchPickerPrimitive.Count />\n </BranchPickerStateWrapper>\n );\n});\n\nBranchPickerState.displayName = \"BranchPickerState\";\n\nnamespace BranchPickerNext {\n export type Element = BranchPickerPrimitive.Next.Element;\n export type Props = Partial<TooltipIconButton.Props>;\n}\n\nconst BranchPickerNext = forwardRef<\n BranchPickerNext.Element,\n BranchPickerNext.Props\n>((props, ref) => {\n const {\n strings: { branchPicker: { next: { tooltip = \"Next\" } = {} } = {} } = {},\n } = useThreadConfig();\n const allowBranchPicker = useAllowBranchPicker();\n return (\n <BranchPickerPrimitive.Next disabled={!allowBranchPicker} asChild>\n <TooltipIconButton tooltip={tooltip} {...props} ref={ref}>\n {props.children ?? <ChevronRightIcon />}\n </TooltipIconButton>\n </BranchPickerPrimitive.Next>\n );\n});\n\nBranchPickerNext.displayName = \"BranchPickerNext\";\n\nconst exports = {\n Root: BranchPickerRoot,\n Previous: BranchPickerPrevious,\n Next: BranchPickerNext,\n};\n\nexport default Object.assign(BranchPicker, exports) as typeof BranchPicker &\n typeof exports;\n"],"mappings":";;;AAEA,SAAmC,kBAA2B;AAC9D,SAAS,iBAAiB,wBAAwB;AAElD,SAAS,yBAAyB;AAClC,SAAS,oBAAoB;AAC7B,SAAS,uBAAuB;AAChC,SAAS,6BAA6B;AACtC,SAAS,iBAAiB;AAYtB,SACE,KADF;AAVJ,IAAM,uBAAuB,CAAC,mBAAmB,UAAU;AACzD,QAAM,EAAE,cAAc,EAAE,oBAAoB,KAAK,IAAI,CAAC,EAAE,IAAI,gBAAgB;AAC5E,QAAM,wBAAwB,UAAU,CAAC,MAAM,EAAE,aAAa,IAAI;AAClE,SAAO,sBAAsB,CAAC,oBAAoB;AACpD;AAEA,IAAM,eAAmB,MAAM;AAC7B,QAAM,oBAAoB,qBAAqB,IAAI;AACnD,MAAI,CAAC,kBAAmB,QAAO;AAC/B,SACE,qBAAC,oBAAiB,sBAAoB,MACpC;AAAA,wBAAC,wBAAqB;AAAA,IACtB,oBAAC,qBAAkB;AAAA,IACnB,oBAAC,oBAAiB;AAAA,KACpB;AAEJ;AAEA,aAAa,cAAc;AAE3B,IAAM,mBAAmB,aAAa,sBAAsB,MAAM;AAAA,EAChE,WAAW;AACb,CAAC;AAED,iBAAiB,cAAc;AAO/B,IAAM,uBAAuB,WAG3B,CAAC,OAAO,QAAQ;AAChB,QAAM;AAAA,IACJ,SAAS;AAAA,MACP,cAAc,EAAE,UAAU,EAAE,UAAU,WAAW,IAAI,CAAC,EAAE,IAAI,CAAC;AAAA,IAC/D,IAAI,CAAC;AAAA,EACP,IAAI,gBAAgB;AACpB,QAAM,oBAAoB,qBAAqB;AAC/C,SACE,oBAAC,sBAAsB,UAAtB,EAA+B,UAAU,CAAC,mBAAmB,SAAO,MACnE,8BAAC,qBAAkB,SAAmB,GAAG,OAAO,KAC7C,gBAAM,YAAY,oBAAC,mBAAgB,GACtC,GACF;AAEJ,CAAC;AAED,qBAAqB,cAAc;AAEnC,IAAM,2BAA2B,aAAa,QAAQ;AAAA,EACpD,WAAW;AACb,CAAC;AAOD,IAAM,oBAAoB,WAGxB,CAAC,OAAO,QAAQ;AAChB,SACE,qBAAC,4BAA0B,GAAG,OAAO,KACnC;AAAA,wBAAC,sBAAsB,QAAtB,EAA6B;AAAA,IAAE;AAAA,IAAG,oBAAC,sBAAsB,OAAtB,EAA4B;AAAA,KAClE;AAEJ,CAAC;AAED,kBAAkB,cAAc;AAOhC,IAAM,mBAAmB,WAGvB,CAAC,OAAO,QAAQ;AAChB,QAAM;AAAA,IACJ,SAAS,EAAE,cAAc,EAAE,MAAM,EAAE,UAAU,OAAO,IAAI,CAAC,EAAE,IAAI,CAAC,EAAE,IAAI,CAAC;AAAA,EACzE,IAAI,gBAAgB;AACpB,QAAM,oBAAoB,qBAAqB;AAC/C,SACE,oBAAC,sBAAsB,MAAtB,EAA2B,UAAU,CAAC,mBAAmB,SAAO,MAC/D,8BAAC,qBAAkB,SAAmB,GAAG,OAAO,KAC7C,gBAAM,YAAY,oBAAC,oBAAiB,GACvC,GACF;AAEJ,CAAC;AAED,iBAAiB,cAAc;AAE/B,IAAM,UAAU;AAAA,EACd,MAAM;AAAA,EACN,UAAU;AAAA,EACV,MAAM;AACR;AAEA,IAAO,wBAAQ,OAAO,OAAO,cAAc,OAAO;","names":[]}
@@ -1,5 +1,5 @@
1
1
  import { type FC } from "react";
2
- import { TooltipIconButtonProps } from "./base/tooltip-icon-button";
2
+ import { TooltipIconButton } from "./base/tooltip-icon-button";
3
3
  import { ComposerPrimitive } from "../primitives";
4
4
  declare const Composer: FC;
5
5
  declare const exports: {
@@ -17,9 +17,9 @@ declare const exports: {
17
17
  unstable_focusOnThreadSwitched?: boolean | undefined;
18
18
  } & import("react").RefAttributes<HTMLTextAreaElement>, "ref">> & import("react").RefAttributes<HTMLTextAreaElement>, "ref"> & import("react").RefAttributes<HTMLTextAreaElement>>;
19
19
  Action: FC;
20
- Send: import("react").ForwardRefExoticComponent<Partial<TooltipIconButtonProps> & import("react").RefAttributes<HTMLButtonElement>>;
21
- Cancel: import("react").ForwardRefExoticComponent<Partial<TooltipIconButtonProps> & import("react").RefAttributes<HTMLButtonElement>>;
22
- AddAttachment: import("react").ForwardRefExoticComponent<Partial<TooltipIconButtonProps> & import("react").RefAttributes<HTMLButtonElement>>;
20
+ Send: import("react").ForwardRefExoticComponent<Partial<TooltipIconButton.Props> & import("react").RefAttributes<HTMLButtonElement>>;
21
+ Cancel: import("react").ForwardRefExoticComponent<Partial<TooltipIconButton.Props> & import("react").RefAttributes<HTMLButtonElement>>;
22
+ AddAttachment: import("react").ForwardRefExoticComponent<Partial<TooltipIconButton.Props> & import("react").RefAttributes<HTMLButtonElement>>;
23
23
  Attachments: FC<Partial<ComposerPrimitive.Attachments.Props>>;
24
24
  };
25
25
  declare const _default: typeof Composer & typeof exports;
@@ -1 +1 @@
1
- {"version":3,"file":"composer.d.ts","sourceRoot":"","sources":["../../src/ui/composer.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAwC,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAKtE,OAAO,EAEL,sBAAsB,EACvB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAE,iBAAiB,EAAmB,MAAM,eAAe,CAAC;AAUnE,QAAA,MAAM,QAAQ,EAAE,EAUf,CAAC;AAyKF,QAAA,MAAM,OAAO;;;;;;;;;;;;;;;;;;;CAQZ,CAAC;wBAEiD,OAAO,QAAQ,GAChE,OAAO,OAAO;AADhB,wBACiB"}
1
+ {"version":3,"file":"composer.d.ts","sourceRoot":"","sources":["../../src/ui/composer.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAwC,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAKtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAE/D,OAAO,EAAE,iBAAiB,EAAmB,MAAM,eAAe,CAAC;AAUnE,QAAA,MAAM,QAAQ,EAAE,EAUf,CAAC;AAyKF,QAAA,MAAM,OAAO;;;;;;;;;;;;;;;;;;;CAQZ,CAAC;wBAEiD,OAAO,QAAQ,GAChE,OAAO,OAAO;AADhB,wBACiB"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/ui/composer.tsx"],"sourcesContent":["\"use client\";\n\nimport { ComponentPropsWithoutRef, forwardRef, type FC } from \"react\";\n\nimport { PaperclipIcon, SendHorizontalIcon } from \"lucide-react\";\nimport { withDefaults } from \"./utils/withDefaults\";\nimport { useThreadConfig } from \"./thread-config\";\nimport {\n TooltipIconButton,\n TooltipIconButtonProps,\n} from \"./base/tooltip-icon-button\";\nimport { CircleStopIcon } from \"./base/CircleStopIcon\";\nimport { ComposerPrimitive, ThreadPrimitive } from \"../primitives\";\nimport { useThread } from \"../context/react/ThreadContext\";\nimport Attachment from \"./attachment-ui\";\n\nconst useAllowAttachments = (ensureCapability = false) => {\n const { composer: { allowAttachments = true } = {} } = useThreadConfig();\n const attachmentsSupported = useThread((t) => t.capabilities.attachments);\n return allowAttachments && (!ensureCapability || attachmentsSupported);\n};\n\nconst Composer: FC = () => {\n const allowAttachments = useAllowAttachments(true);\n return (\n <ComposerRoot>\n {allowAttachments && <ComposerAttachments />}\n {allowAttachments && <ComposerAddAttachment />}\n <ComposerInput autoFocus />\n <ComposerAction />\n </ComposerRoot>\n );\n};\n\nComposer.displayName = \"Composer\";\n\nconst ComposerRoot = withDefaults(ComposerPrimitive.Root, {\n className: \"aui-composer-root\",\n});\n\nComposerRoot.displayName = \"ComposerRoot\";\n\nconst ComposerInputStyled = withDefaults(ComposerPrimitive.Input, {\n rows: 1,\n autoFocus: true,\n className: \"aui-composer-input\",\n});\n\nnamespace ComposerInput {\n export type Element = HTMLTextAreaElement;\n export type Props = ComponentPropsWithoutRef<typeof ComposerInputStyled>;\n}\n\nconst ComposerInput = forwardRef<ComposerInput.Element, ComposerInput.Props>(\n (props, ref) => {\n const {\n strings: {\n composer: { input: { placeholder = \"Write a message...\" } = {} } = {},\n } = {},\n } = useThreadConfig();\n return (\n <ComposerInputStyled placeholder={placeholder} {...props} ref={ref} />\n );\n },\n);\n\nComposerInput.displayName = \"ComposerInput\";\n\nconst ComposerAttachmentsContainer = withDefaults(\"div\", {\n className: \"aui-composer-attachments\",\n});\n\nnamespace ComposerAttachments {\n export type Props = Partial<ComposerPrimitive.Attachments.Props>;\n}\n\nconst ComposerAttachments: FC<ComposerAttachments.Props> = ({ components }) => {\n return (\n <ComposerAttachmentsContainer>\n <ComposerPrimitive.Attachments\n components={{\n ...components,\n Attachment: components?.Attachment ?? Attachment,\n }}\n />\n </ComposerAttachmentsContainer>\n );\n};\n\nconst ComposerAttachButton = withDefaults(TooltipIconButton, {\n variant: \"default\",\n className: \"aui-composer-attach\",\n});\n\nnamespace ComposerAddAttachment {\n export type Element = HTMLButtonElement;\n export type Props = Partial<TooltipIconButtonProps>;\n}\n\nconst ComposerAddAttachment = forwardRef<\n ComposerAddAttachment.Element,\n ComposerAddAttachment.Props\n>((props, ref) => {\n const {\n strings: {\n composer: { addAttachment: { tooltip = \"Attach file\" } = {} } = {},\n } = {},\n } = useThreadConfig();\n const allowAttachments = useAllowAttachments();\n return (\n <ComposerPrimitive.AddAttachment disabled={!allowAttachments} asChild>\n <ComposerAttachButton\n tooltip={tooltip}\n variant={\"ghost\"}\n {...props}\n ref={ref}\n >\n {props.children ?? <PaperclipIcon />}\n </ComposerAttachButton>\n </ComposerPrimitive.AddAttachment>\n );\n});\n\nComposerAddAttachment.displayName = \"ComposerAddAttachment\";\n\nconst useAllowCancel = () => {\n const cancelSupported = useThread((t) => t.capabilities.cancel);\n return cancelSupported;\n};\n\nconst ComposerAction: FC = () => {\n const allowCancel = useAllowCancel();\n if (!allowCancel) return <ComposerSend />;\n return (\n <>\n <ThreadPrimitive.If running={false}>\n <ComposerSend />\n </ThreadPrimitive.If>\n <ThreadPrimitive.If running>\n <ComposerCancel />\n </ThreadPrimitive.If>\n </>\n );\n};\n\nComposerAction.displayName = \"ComposerAction\";\n\nconst ComposerSendButton = withDefaults(TooltipIconButton, {\n variant: \"default\",\n className: \"aui-composer-send\",\n});\n\nnamespace ComposerSend {\n export type Element = HTMLButtonElement;\n export type Props = Partial<TooltipIconButtonProps>;\n}\n\nconst ComposerSend = forwardRef<ComposerSend.Element, ComposerSend.Props>(\n (props, ref) => {\n const {\n strings: { composer: { send: { tooltip = \"Send\" } = {} } = {} } = {},\n } = useThreadConfig();\n return (\n <ComposerPrimitive.Send asChild>\n <ComposerSendButton tooltip={tooltip} {...props} ref={ref}>\n {props.children ?? <SendHorizontalIcon />}\n </ComposerSendButton>\n </ComposerPrimitive.Send>\n );\n },\n);\n\nComposerSend.displayName = \"ComposerSend\";\n\nconst ComposerCancelButton = withDefaults(TooltipIconButton, {\n variant: \"default\",\n className: \"aui-composer-cancel\",\n});\n\nnamespace ComposerCancel {\n export type Element = HTMLButtonElement;\n export type Props = Partial<TooltipIconButtonProps>;\n}\n\nconst ComposerCancel = forwardRef<ComposerCancel.Element, ComposerCancel.Props>(\n (props, ref) => {\n const {\n strings: { composer: { cancel: { tooltip = \"Cancel\" } = {} } = {} } = {},\n } = useThreadConfig();\n return (\n <ComposerPrimitive.Cancel asChild>\n <ComposerCancelButton tooltip={tooltip} {...props} ref={ref}>\n {props.children ?? <CircleStopIcon />}\n </ComposerCancelButton>\n </ComposerPrimitive.Cancel>\n );\n },\n);\n\nComposerCancel.displayName = \"ComposerCancel\";\n\nconst exports = {\n Root: ComposerRoot,\n Input: ComposerInput,\n Action: ComposerAction,\n Send: ComposerSend,\n Cancel: ComposerCancel,\n AddAttachment: ComposerAddAttachment,\n Attachments: ComposerAttachments,\n};\n\nexport default Object.assign(Composer, exports) as typeof Composer &\n typeof exports;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AA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,QAAQ;AACd,UAAM;AAAA,MACJ,SAAS,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,OAAO,IAAI,CAAC,EAAE,IAAI,CAAC,EAAE,IAAI,CAAC;AAAA,IACrE,QAAI,sCAAgB;AACpB,WACE,4CAAC,oCAAkB,MAAlB,EAAuB,SAAO,MAC7B,sDAAC,sBAAmB,SAAmB,GAAG,OAAO,KAC9C,gBAAM,YAAY,4CAAC,0CAAmB,GACzC,GACF;AAAA,EAEJ;AACF;AAEA,aAAa,cAAc;AAE3B,IAAM,2BAAuB,kCAAa,8CAAmB;AAAA,EAC3D,SAAS;AAAA,EACT,WAAW;AACb,CAAC;AAOD,IAAM,qBAAiB;AAAA,EACrB,CAAC,OAAO,QAAQ;AACd,UAAM;AAAA,MACJ,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,SAAS,IAAI,CAAC,EAAE,IAAI,CAAC,EAAE,IAAI,CAAC;AAAA,IACzE,QAAI,sCAAgB;AACpB,WACE,4CAAC,oCAAkB,QAAlB,EAAyB,SAAO,MAC/B,sDAAC,wBAAqB,SAAmB,GAAG,OAAO,KAChD,gBAAM,YAAY,4CAAC,wCAAe,GACrC,GACF;AAAA,EAEJ;AACF;AAEA,eAAe,cAAc;AAE7B,IAAMC,WAAU;AAAA,EACd,MAAM;AAAA,EACN,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,eAAe;AAAA,EACf,aAAa;AACf;AAEA,IAAO,mBAAQ,OAAO,OAAO,UAAUA,QAAO;","names":["Attachment","exports"]}
1
+ {"version":3,"sources":["../../src/ui/composer.tsx"],"sourcesContent":["\"use client\";\n\nimport { ComponentPropsWithoutRef, forwardRef, type FC } from \"react\";\n\nimport { PaperclipIcon, SendHorizontalIcon } from \"lucide-react\";\nimport { withDefaults } from \"./utils/withDefaults\";\nimport { useThreadConfig } from \"./thread-config\";\nimport { TooltipIconButton } from \"./base/tooltip-icon-button\";\nimport { CircleStopIcon } from \"./base/CircleStopIcon\";\nimport { ComposerPrimitive, ThreadPrimitive } from \"../primitives\";\nimport { useThread } from \"../context/react/ThreadContext\";\nimport Attachment from \"./attachment-ui\";\n\nconst useAllowAttachments = (ensureCapability = false) => {\n const { composer: { allowAttachments = true } = {} } = useThreadConfig();\n const attachmentsSupported = useThread((t) => t.capabilities.attachments);\n return allowAttachments && (!ensureCapability || attachmentsSupported);\n};\n\nconst Composer: FC = () => {\n const allowAttachments = useAllowAttachments(true);\n return (\n <ComposerRoot>\n {allowAttachments && <ComposerAttachments />}\n {allowAttachments && <ComposerAddAttachment />}\n <ComposerInput autoFocus />\n <ComposerAction />\n </ComposerRoot>\n );\n};\n\nComposer.displayName = \"Composer\";\n\nconst ComposerRoot = withDefaults(ComposerPrimitive.Root, {\n className: \"aui-composer-root\",\n});\n\nComposerRoot.displayName = \"ComposerRoot\";\n\nconst ComposerInputStyled = withDefaults(ComposerPrimitive.Input, {\n rows: 1,\n autoFocus: true,\n className: \"aui-composer-input\",\n});\n\nnamespace ComposerInput {\n export type Element = HTMLTextAreaElement;\n export type Props = ComponentPropsWithoutRef<typeof ComposerInputStyled>;\n}\n\nconst ComposerInput = forwardRef<ComposerInput.Element, ComposerInput.Props>(\n (props, ref) => {\n const {\n strings: {\n composer: { input: { placeholder = \"Write a message...\" } = {} } = {},\n } = {},\n } = useThreadConfig();\n return (\n <ComposerInputStyled placeholder={placeholder} {...props} ref={ref} />\n );\n },\n);\n\nComposerInput.displayName = \"ComposerInput\";\n\nconst ComposerAttachmentsContainer = withDefaults(\"div\", {\n className: \"aui-composer-attachments\",\n});\n\nnamespace ComposerAttachments {\n export type Props = Partial<ComposerPrimitive.Attachments.Props>;\n}\n\nconst ComposerAttachments: FC<ComposerAttachments.Props> = ({ components }) => {\n return (\n <ComposerAttachmentsContainer>\n <ComposerPrimitive.Attachments\n components={{\n ...components,\n Attachment: components?.Attachment ?? Attachment,\n }}\n />\n </ComposerAttachmentsContainer>\n );\n};\n\nconst ComposerAttachButton = withDefaults(TooltipIconButton, {\n variant: \"default\",\n className: \"aui-composer-attach\",\n});\n\nnamespace ComposerAddAttachment {\n export type Element = HTMLButtonElement;\n export type Props = Partial<TooltipIconButton.Props>;\n}\n\nconst ComposerAddAttachment = forwardRef<\n ComposerAddAttachment.Element,\n ComposerAddAttachment.Props\n>((props, ref) => {\n const {\n strings: {\n composer: { addAttachment: { tooltip = \"Attach file\" } = {} } = {},\n } = {},\n } = useThreadConfig();\n const allowAttachments = useAllowAttachments();\n return (\n <ComposerPrimitive.AddAttachment disabled={!allowAttachments} asChild>\n <ComposerAttachButton\n tooltip={tooltip}\n variant={\"ghost\"}\n {...props}\n ref={ref}\n >\n {props.children ?? <PaperclipIcon />}\n </ComposerAttachButton>\n </ComposerPrimitive.AddAttachment>\n );\n});\n\nComposerAddAttachment.displayName = \"ComposerAddAttachment\";\n\nconst useAllowCancel = () => {\n const cancelSupported = useThread((t) => t.capabilities.cancel);\n return cancelSupported;\n};\n\nconst ComposerAction: FC = () => {\n const allowCancel = useAllowCancel();\n if (!allowCancel) return <ComposerSend />;\n return (\n <>\n <ThreadPrimitive.If running={false}>\n <ComposerSend />\n </ThreadPrimitive.If>\n <ThreadPrimitive.If running>\n <ComposerCancel />\n </ThreadPrimitive.If>\n </>\n );\n};\n\nComposerAction.displayName = \"ComposerAction\";\n\nconst ComposerSendButton = withDefaults(TooltipIconButton, {\n variant: \"default\",\n className: \"aui-composer-send\",\n});\n\nnamespace ComposerSend {\n export type Element = HTMLButtonElement;\n export type Props = Partial<TooltipIconButton.Props>;\n}\n\nconst ComposerSend = forwardRef<ComposerSend.Element, ComposerSend.Props>(\n (props, ref) => {\n const {\n strings: { composer: { send: { tooltip = \"Send\" } = {} } = {} } = {},\n } = useThreadConfig();\n return (\n <ComposerPrimitive.Send asChild>\n <ComposerSendButton tooltip={tooltip} {...props} ref={ref}>\n {props.children ?? <SendHorizontalIcon />}\n </ComposerSendButton>\n </ComposerPrimitive.Send>\n );\n },\n);\n\nComposerSend.displayName = \"ComposerSend\";\n\nconst ComposerCancelButton = withDefaults(TooltipIconButton, {\n variant: \"default\",\n className: \"aui-composer-cancel\",\n});\n\nnamespace ComposerCancel {\n export type Element = HTMLButtonElement;\n export type Props = Partial<TooltipIconButton.Props>;\n}\n\nconst ComposerCancel = forwardRef<ComposerCancel.Element, ComposerCancel.Props>(\n (props, ref) => {\n const {\n strings: { composer: { cancel: { tooltip = \"Cancel\" } = {} } = {} } = {},\n } = useThreadConfig();\n return (\n <ComposerPrimitive.Cancel asChild>\n <ComposerCancelButton tooltip={tooltip} {...props} ref={ref}>\n {props.children ?? <CircleStopIcon />}\n </ComposerCancelButton>\n </ComposerPrimitive.Cancel>\n );\n },\n);\n\nComposerCancel.displayName = \"ComposerCancel\";\n\nconst exports = {\n Root: ComposerRoot,\n Input: ComposerInput,\n Action: ComposerAction,\n Send: ComposerSend,\n Cancel: ComposerCancel,\n AddAttachment: ComposerAddAttachment,\n Attachments: ComposerAttachments,\n};\n\nexport default Object.assign(Composer, exports) as typeof Composer &\n typeof exports;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,mBAA8D;AAE9D,0BAAkD;AAClD,0BAA6B;AAC7B,2BAAgC;AAChC,iCAAkC;AAClC,4BAA+B;AAC/B,wBAAmD;AACnD,2BAA0B;AAC1B,2BAAuB;AAWnB;AATJ,IAAM,sBAAsB,CAAC,mBAAmB,UAAU;AACxD,QAAM,EAAE,UAAU,EAAE,mBAAmB,KAAK,IAAI,CAAC,EAAE,QAAI,sCAAgB;AACvE,QAAM,2BAAuB,gCAAU,CAAC,MAAM,EAAE,aAAa,WAAW;AACxE,SAAO,qBAAqB,CAAC,oBAAoB;AACnD;AAEA,IAAM,WAAe,MAAM;AACzB,QAAM,mBAAmB,oBAAoB,IAAI;AACjD,SACE,6CAAC,gBACE;AAAA,wBAAoB,4CAAC,uBAAoB;AAAA,IACzC,oBAA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,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,SAAS,IAAI,CAAC,EAAE,IAAI,CAAC,EAAE,IAAI,CAAC;AAAA,IACzE,QAAI,sCAAgB;AACpB,WACE,4CAAC,oCAAkB,QAAlB,EAAyB,SAAO,MAC/B,sDAAC,wBAAqB,SAAmB,GAAG,OAAO,KAChD,gBAAM,YAAY,4CAAC,wCAAe,GACrC,GACF;AAAA,EAEJ;AACF;AAEA,eAAe,cAAc;AAE7B,IAAMC,WAAU;AAAA,EACd,MAAM;AAAA,EACN,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,eAAe;AAAA,EACf,aAAa;AACf;AAEA,IAAO,mBAAQ,OAAO,OAAO,UAAUA,QAAO;","names":["Attachment","exports"]}
@@ -5,9 +5,7 @@ import { forwardRef } from "react";
5
5
  import { PaperclipIcon, SendHorizontalIcon } from "lucide-react";
6
6
  import { withDefaults } from "./utils/withDefaults.mjs";
7
7
  import { useThreadConfig } from "./thread-config.mjs";
8
- import {
9
- TooltipIconButton
10
- } from "./base/tooltip-icon-button.mjs";
8
+ import { TooltipIconButton } from "./base/tooltip-icon-button.mjs";
11
9
  import { CircleStopIcon } from "./base/CircleStopIcon.mjs";
12
10
  import { ComposerPrimitive, ThreadPrimitive } from "../primitives/index.mjs";
13
11
  import { useThread } from "../context/react/ThreadContext.mjs";
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/ui/composer.tsx"],"sourcesContent":["\"use client\";\n\nimport { ComponentPropsWithoutRef, forwardRef, type FC } from \"react\";\n\nimport { PaperclipIcon, SendHorizontalIcon } from \"lucide-react\";\nimport { withDefaults } from \"./utils/withDefaults\";\nimport { useThreadConfig } from \"./thread-config\";\nimport {\n TooltipIconButton,\n TooltipIconButtonProps,\n} from \"./base/tooltip-icon-button\";\nimport { CircleStopIcon } from \"./base/CircleStopIcon\";\nimport { ComposerPrimitive, ThreadPrimitive } from \"../primitives\";\nimport { useThread } from \"../context/react/ThreadContext\";\nimport Attachment from \"./attachment-ui\";\n\nconst useAllowAttachments = (ensureCapability = false) => {\n const { composer: { allowAttachments = true } = {} } = useThreadConfig();\n const attachmentsSupported = useThread((t) => t.capabilities.attachments);\n return allowAttachments && (!ensureCapability || attachmentsSupported);\n};\n\nconst Composer: FC = () => {\n const allowAttachments = useAllowAttachments(true);\n return (\n <ComposerRoot>\n {allowAttachments && <ComposerAttachments />}\n {allowAttachments && <ComposerAddAttachment />}\n <ComposerInput autoFocus />\n <ComposerAction />\n </ComposerRoot>\n );\n};\n\nComposer.displayName = \"Composer\";\n\nconst ComposerRoot = withDefaults(ComposerPrimitive.Root, {\n className: \"aui-composer-root\",\n});\n\nComposerRoot.displayName = \"ComposerRoot\";\n\nconst ComposerInputStyled = withDefaults(ComposerPrimitive.Input, {\n rows: 1,\n autoFocus: true,\n className: \"aui-composer-input\",\n});\n\nnamespace ComposerInput {\n export type Element = HTMLTextAreaElement;\n export type Props = ComponentPropsWithoutRef<typeof ComposerInputStyled>;\n}\n\nconst ComposerInput = forwardRef<ComposerInput.Element, ComposerInput.Props>(\n (props, ref) => {\n const {\n strings: {\n composer: { input: { placeholder = \"Write a message...\" } = {} } = {},\n } = {},\n } = useThreadConfig();\n return (\n <ComposerInputStyled placeholder={placeholder} {...props} ref={ref} />\n );\n },\n);\n\nComposerInput.displayName = \"ComposerInput\";\n\nconst ComposerAttachmentsContainer = withDefaults(\"div\", {\n className: \"aui-composer-attachments\",\n});\n\nnamespace ComposerAttachments {\n export type Props = Partial<ComposerPrimitive.Attachments.Props>;\n}\n\nconst ComposerAttachments: FC<ComposerAttachments.Props> = ({ components }) => {\n return (\n <ComposerAttachmentsContainer>\n <ComposerPrimitive.Attachments\n components={{\n ...components,\n Attachment: components?.Attachment ?? Attachment,\n }}\n />\n </ComposerAttachmentsContainer>\n );\n};\n\nconst ComposerAttachButton = withDefaults(TooltipIconButton, {\n variant: \"default\",\n className: \"aui-composer-attach\",\n});\n\nnamespace ComposerAddAttachment {\n export type Element = HTMLButtonElement;\n export type Props = Partial<TooltipIconButtonProps>;\n}\n\nconst ComposerAddAttachment = forwardRef<\n ComposerAddAttachment.Element,\n ComposerAddAttachment.Props\n>((props, ref) => {\n const {\n strings: {\n composer: { addAttachment: { tooltip = \"Attach file\" } = {} } = {},\n } = {},\n } = useThreadConfig();\n const allowAttachments = useAllowAttachments();\n return (\n <ComposerPrimitive.AddAttachment disabled={!allowAttachments} asChild>\n <ComposerAttachButton\n tooltip={tooltip}\n variant={\"ghost\"}\n {...props}\n ref={ref}\n >\n {props.children ?? <PaperclipIcon />}\n </ComposerAttachButton>\n </ComposerPrimitive.AddAttachment>\n );\n});\n\nComposerAddAttachment.displayName = \"ComposerAddAttachment\";\n\nconst useAllowCancel = () => {\n const cancelSupported = useThread((t) => t.capabilities.cancel);\n return cancelSupported;\n};\n\nconst ComposerAction: FC = () => {\n const allowCancel = useAllowCancel();\n if (!allowCancel) return <ComposerSend />;\n return (\n <>\n <ThreadPrimitive.If running={false}>\n <ComposerSend />\n </ThreadPrimitive.If>\n <ThreadPrimitive.If running>\n <ComposerCancel />\n </ThreadPrimitive.If>\n </>\n );\n};\n\nComposerAction.displayName = \"ComposerAction\";\n\nconst ComposerSendButton = withDefaults(TooltipIconButton, {\n variant: \"default\",\n className: \"aui-composer-send\",\n});\n\nnamespace ComposerSend {\n export type Element = HTMLButtonElement;\n export type Props = Partial<TooltipIconButtonProps>;\n}\n\nconst ComposerSend = forwardRef<ComposerSend.Element, ComposerSend.Props>(\n (props, ref) => {\n const {\n strings: { composer: { send: { tooltip = \"Send\" } = {} } = {} } = {},\n } = useThreadConfig();\n return (\n <ComposerPrimitive.Send asChild>\n <ComposerSendButton tooltip={tooltip} {...props} ref={ref}>\n {props.children ?? <SendHorizontalIcon />}\n </ComposerSendButton>\n </ComposerPrimitive.Send>\n );\n },\n);\n\nComposerSend.displayName = \"ComposerSend\";\n\nconst ComposerCancelButton = withDefaults(TooltipIconButton, {\n variant: \"default\",\n className: \"aui-composer-cancel\",\n});\n\nnamespace ComposerCancel {\n export type Element = HTMLButtonElement;\n export type Props = Partial<TooltipIconButtonProps>;\n}\n\nconst ComposerCancel = forwardRef<ComposerCancel.Element, ComposerCancel.Props>(\n (props, ref) => {\n const {\n strings: { composer: { cancel: { tooltip = \"Cancel\" } = {} } = {} } = {},\n } = useThreadConfig();\n return (\n <ComposerPrimitive.Cancel asChild>\n <ComposerCancelButton tooltip={tooltip} {...props} ref={ref}>\n {props.children ?? <CircleStopIcon />}\n </ComposerCancelButton>\n </ComposerPrimitive.Cancel>\n );\n },\n);\n\nComposerCancel.displayName = \"ComposerCancel\";\n\nconst exports = {\n Root: ComposerRoot,\n Input: ComposerInput,\n Action: ComposerAction,\n Send: ComposerSend,\n Cancel: ComposerCancel,\n AddAttachment: ComposerAddAttachment,\n Attachments: ComposerAttachments,\n};\n\nexport default Object.assign(Composer, exports) as typeof Composer &\n typeof exports;\n"],"mappings":";;;AAEA,SAAmC,kBAA2B;AAE9D,SAAS,eAAe,0BAA0B;AAClD,SAAS,oBAAoB;AAC7B,SAAS,uBAAuB;AAChC;AAAA,EACE;AAAA,OAEK;AACP,SAAS,sBAAsB;AAC/B,SAAS,mBAAmB,uBAAuB;AACnD,SAAS,iBAAiB;AAC1B,OAAO,gBAAgB;AAWnB,SA6GA,UA5GuB,KADvB;AATJ,IAAM,sBAAsB,CAAC,mBAAmB,UAAU;AACxD,QAAM,EAAE,UAAU,EAAE,mBAAmB,KAAK,IAAI,CAAC,EAAE,IAAI,gBAAgB;AACvE,QAAM,uBAAuB,UAAU,CAAC,MAAM,EAAE,aAAa,WAAW;AACxE,SAAO,qBAAqB,CAAC,oBAAoB;AACnD;AAEA,IAAM,WAAe,MAAM;AACzB,QAAM,mBAAmB,oBAAoB,IAAI;AACjD,SACE,qBAAC,gBACE;AAAA,wBAAoB,oBAAC,uBAAoB;AAAA,IACzC,oBAAoB,oBAAC,yBAAsB;AAAA,IAC5C,oBAAC,iBAAc,WAAS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C,EAAE,IAAI,CAAC;AAAA,IACzE,IAAI,gBAAgB;AACpB,WACE,oBAAC,kBAAkB,QAAlB,EAAyB,SAAO,MAC/B,8BAAC,wBAAqB,SAAmB,GAAG,OAAO,KAChD,gBAAM,YAAY,oBAAC,kBAAe,GACrC,GACF;AAAA,EAEJ;AACF;AAEA,eAAe,cAAc;AAE7B,IAAM,UAAU;AAAA,EACd,MAAM;AAAA,EACN,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,eAAe;AAAA,EACf,aAAa;AACf;AAEA,IAAO,mBAAQ,OAAO,OAAO,UAAU,OAAO;","names":[]}
1
+ {"version":3,"sources":["../../src/ui/composer.tsx"],"sourcesContent":["\"use client\";\n\nimport { ComponentPropsWithoutRef, forwardRef, type FC } from \"react\";\n\nimport { PaperclipIcon, SendHorizontalIcon } from \"lucide-react\";\nimport { withDefaults } from \"./utils/withDefaults\";\nimport { useThreadConfig } from \"./thread-config\";\nimport { TooltipIconButton } from \"./base/tooltip-icon-button\";\nimport { CircleStopIcon } from \"./base/CircleStopIcon\";\nimport { ComposerPrimitive, ThreadPrimitive } from \"../primitives\";\nimport { useThread } from \"../context/react/ThreadContext\";\nimport Attachment from \"./attachment-ui\";\n\nconst useAllowAttachments = (ensureCapability = false) => {\n const { composer: { allowAttachments = true } = {} } = useThreadConfig();\n const attachmentsSupported = useThread((t) => t.capabilities.attachments);\n return allowAttachments && (!ensureCapability || attachmentsSupported);\n};\n\nconst Composer: FC = () => {\n const allowAttachments = useAllowAttachments(true);\n return (\n <ComposerRoot>\n {allowAttachments && <ComposerAttachments />}\n {allowAttachments && <ComposerAddAttachment />}\n <ComposerInput autoFocus />\n <ComposerAction />\n </ComposerRoot>\n );\n};\n\nComposer.displayName = \"Composer\";\n\nconst ComposerRoot = withDefaults(ComposerPrimitive.Root, {\n className: \"aui-composer-root\",\n});\n\nComposerRoot.displayName = \"ComposerRoot\";\n\nconst ComposerInputStyled = withDefaults(ComposerPrimitive.Input, {\n rows: 1,\n autoFocus: true,\n className: \"aui-composer-input\",\n});\n\nnamespace ComposerInput {\n export type Element = HTMLTextAreaElement;\n export type Props = ComponentPropsWithoutRef<typeof ComposerInputStyled>;\n}\n\nconst ComposerInput = forwardRef<ComposerInput.Element, ComposerInput.Props>(\n (props, ref) => {\n const {\n strings: {\n composer: { input: { placeholder = \"Write a message...\" } = {} } = {},\n } = {},\n } = useThreadConfig();\n return (\n <ComposerInputStyled placeholder={placeholder} {...props} ref={ref} />\n );\n },\n);\n\nComposerInput.displayName = \"ComposerInput\";\n\nconst ComposerAttachmentsContainer = withDefaults(\"div\", {\n className: \"aui-composer-attachments\",\n});\n\nnamespace ComposerAttachments {\n export type Props = Partial<ComposerPrimitive.Attachments.Props>;\n}\n\nconst ComposerAttachments: FC<ComposerAttachments.Props> = ({ components }) => {\n return (\n <ComposerAttachmentsContainer>\n <ComposerPrimitive.Attachments\n components={{\n ...components,\n Attachment: components?.Attachment ?? Attachment,\n }}\n />\n </ComposerAttachmentsContainer>\n );\n};\n\nconst ComposerAttachButton = withDefaults(TooltipIconButton, {\n variant: \"default\",\n className: \"aui-composer-attach\",\n});\n\nnamespace ComposerAddAttachment {\n export type Element = HTMLButtonElement;\n export type Props = Partial<TooltipIconButton.Props>;\n}\n\nconst ComposerAddAttachment = forwardRef<\n ComposerAddAttachment.Element,\n ComposerAddAttachment.Props\n>((props, ref) => {\n const {\n strings: {\n composer: { addAttachment: { tooltip = \"Attach file\" } = {} } = {},\n } = {},\n } = useThreadConfig();\n const allowAttachments = useAllowAttachments();\n return (\n <ComposerPrimitive.AddAttachment disabled={!allowAttachments} asChild>\n <ComposerAttachButton\n tooltip={tooltip}\n variant={\"ghost\"}\n {...props}\n ref={ref}\n >\n {props.children ?? <PaperclipIcon />}\n </ComposerAttachButton>\n </ComposerPrimitive.AddAttachment>\n );\n});\n\nComposerAddAttachment.displayName = \"ComposerAddAttachment\";\n\nconst useAllowCancel = () => {\n const cancelSupported = useThread((t) => t.capabilities.cancel);\n return cancelSupported;\n};\n\nconst ComposerAction: FC = () => {\n const allowCancel = useAllowCancel();\n if (!allowCancel) return <ComposerSend />;\n return (\n <>\n <ThreadPrimitive.If running={false}>\n <ComposerSend />\n </ThreadPrimitive.If>\n <ThreadPrimitive.If running>\n <ComposerCancel />\n </ThreadPrimitive.If>\n </>\n );\n};\n\nComposerAction.displayName = \"ComposerAction\";\n\nconst ComposerSendButton = withDefaults(TooltipIconButton, {\n variant: \"default\",\n className: \"aui-composer-send\",\n});\n\nnamespace ComposerSend {\n export type Element = HTMLButtonElement;\n export type Props = Partial<TooltipIconButton.Props>;\n}\n\nconst ComposerSend = forwardRef<ComposerSend.Element, ComposerSend.Props>(\n (props, ref) => {\n const {\n strings: { composer: { send: { tooltip = \"Send\" } = {} } = {} } = {},\n } = useThreadConfig();\n return (\n <ComposerPrimitive.Send asChild>\n <ComposerSendButton tooltip={tooltip} {...props} ref={ref}>\n {props.children ?? <SendHorizontalIcon />}\n </ComposerSendButton>\n </ComposerPrimitive.Send>\n );\n },\n);\n\nComposerSend.displayName = \"ComposerSend\";\n\nconst ComposerCancelButton = withDefaults(TooltipIconButton, {\n variant: \"default\",\n className: \"aui-composer-cancel\",\n});\n\nnamespace ComposerCancel {\n export type Element = HTMLButtonElement;\n export type Props = Partial<TooltipIconButton.Props>;\n}\n\nconst ComposerCancel = forwardRef<ComposerCancel.Element, ComposerCancel.Props>(\n (props, ref) => {\n const {\n strings: { composer: { cancel: { tooltip = \"Cancel\" } = {} } = {} } = {},\n } = useThreadConfig();\n return (\n <ComposerPrimitive.Cancel asChild>\n <ComposerCancelButton tooltip={tooltip} {...props} ref={ref}>\n {props.children ?? <CircleStopIcon />}\n </ComposerCancelButton>\n </ComposerPrimitive.Cancel>\n );\n },\n);\n\nComposerCancel.displayName = \"ComposerCancel\";\n\nconst exports = {\n Root: ComposerRoot,\n Input: ComposerInput,\n Action: ComposerAction,\n Send: ComposerSend,\n Cancel: ComposerCancel,\n AddAttachment: ComposerAddAttachment,\n Attachments: ComposerAttachments,\n};\n\nexport default Object.assign(Composer, exports) as typeof Composer &\n typeof exports;\n"],"mappings":";;;AAEA,SAAmC,kBAA2B;AAE9D,SAAS,eAAe,0BAA0B;AAClD,SAAS,oBAAoB;AAC7B,SAAS,uBAAuB;AAChC,SAAS,yBAAyB;AAClC,SAAS,sBAAsB;AAC/B,SAAS,mBAAmB,uBAAuB;AACnD,SAAS,iBAAiB;AAC1B,OAAO,gBAAgB;AAWnB,SA6GA,UA5GuB,KADvB;AATJ,IAAM,sBAAsB,CAAC,mBAAmB,UAAU;AACxD,QAAM,EAAE,UAAU,EAAE,mBAAmB,KAAK,IAAI,CAAC,EAAE,IAAI,gBAAgB;AACvE,QAAM,uBAAuB,UAAU,CAAC,MAAM,EAAE,aAAa,WAAW;AACxE,SAAO,qBAAqB,CAAC,oBAAoB;AACnD;AAEA,IAAM,WAAe,MAAM;AACzB,QAAM,mBAAmB,oBAAoB,IAAI;AACjD,SACE,qBAAC,gBACE;AAAA,wBAAoB,oBAAC,uBAAoB;AAAA,IACzC,oBAAoB,oBAAC,yBAAsB;AAAA,IAC5C,oBAAC,iBAAc,WAAS,MAAC;AAAA,IACzB,oBAAC,kBAAe;AAAA,KAClB;AAEJ;AAEA,SAAS,cAAc;AAEvB,IAAM,eAAe,aAAa,kBAAkB,MAAM;AAAA,EACxD,WAAW;AACb,CAAC;AAED,aAAa,cAAc;AAE3B,IAAM,sBAAsB,aAAa,kBAAkB,OAAO;AAAA,EAChE,MAAM;AAAA,EACN,WAAW;AAAA,EACX,WAAW;AACb,CAAC;AAOD,IAAM,gBAAgB;AAAA,EACpB,CAAC,OAAO,QAAQ;AACd,UAAM;AAAA,MACJ,SAAS;AAAA,QACP,UAAU,EAAE,OAAO,EAAE,cAAc,qBAAqB,IAAI,CAAC,EAAE,IAAI,CAAC;AAAA,MACtE,IAAI,CAAC;AAAA,IACP,IAAI,gBAAgB;AACpB,WACE,oBAAC,uBAAoB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AC,kBAAe,GAClB;AAAA,KACF;AAEJ;AAEA,eAAe,cAAc;AAE7B,IAAM,qBAAqB,aAAa,mBAAmB;AAAA,EACzD,SAAS;AAAA,EACT,WAAW;AACb,CAAC;AAOD,IAAM,eAAe;AAAA,EACnB,CAAC,OAAO,QAAQ;AACd,UAAM;AAAA,MACJ,SAAS,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,OAAO,IAAI,CAAC,EAAE,IAAI,CAAC,EAAE,IAAI,CAAC;AAAA,IACrE,IAAI,gBAAgB;AACpB,WACE,oBAAC,kBAAkB,MAAlB,EAAuB,SAAO,MAC7B,8BAAC,sBAAmB,SAAmB,GAAG,OAAO,KAC9C,gBAAM,YAAY,oBAAC,sBAAmB,GACzC,GACF;AAAA,EAEJ;AACF;AAEA,aAAa,cAAc;AAE3B,IAAM,uBAAuB,aAAa,mBAAmB;AAAA,EAC3D,SAAS;AAAA,EACT,WAAW;AACb,CAAC;AAOD,IAAM,iBAAiB;AAAA,EACrB,CAAC,OAAO,QAAQ;AACd,UAAM;AAAA,MACJ,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,SAAS,IAAI,CAAC,EAAE,IAAI,CAAC,EAAE,IAAI,CAAC;AAAA,IACzE,IAAI,gBAAgB;AACpB,WACE,oBAAC,kBAAkB,QAAlB,EAAyB,SAAO,MAC/B,8BAAC,wBAAqB,SAAmB,GAAG,OAAO,KAChD,gBAAM,YAAY,oBAAC,kBAAe,GACrC,GACF;AAAA,EAEJ;AACF;AAEA,eAAe,cAAc;AAE7B,IAAM,UAAU;AAAA,EACd,MAAM;AAAA,EACN,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,eAAe;AAAA,EACf,aAAa;AACf;AAEA,IAAO,mBAAQ,OAAO,OAAO,UAAU,OAAO;","names":[]}
@@ -11,4 +11,6 @@ export { default as UserMessage } from "./user-message";
11
11
  export { default as UserActionBar } from "./user-action-bar";
12
12
  export { default as ThreadWelcome } from "./thread-welcome";
13
13
  export { default as ContentPart } from "./content-part";
14
+ export { default as ThreadList } from "./thread-list";
15
+ export { default as ThreadListItem } from "./thread-list-item";
14
16
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ui/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,eAAe,EACf,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,EAC3B,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,KAAK,yBAAyB,GAC/B,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAEvE,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAElE,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAE9D,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE1D,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEjD,OAAO,EACL,OAAO,IAAI,YAAY,GACxB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE1D,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,UAAU,CAAC;AAE7C,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAExD,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAE7D,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAE5D,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ui/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,eAAe,EACf,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,EAC3B,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,KAAK,yBAAyB,GAC/B,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAEvE,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAElE,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAE9D,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE1D,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEjD,OAAO,EACL,OAAO,IAAI,YAAY,GACxB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE1D,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,UAAU,CAAC;AAE7C,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAExD,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAE7D,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAE5D,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAExD,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,eAAe,CAAC;AAEtD,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,oBAAoB,CAAC"}
package/dist/ui/index.js CHANGED
@@ -40,6 +40,8 @@ __export(ui_exports, {
40
40
  EditComposer: () => import_edit_composer.default,
41
41
  Thread: () => import_thread.default,
42
42
  ThreadConfigProvider: () => import_thread_config.ThreadConfigProvider,
43
+ ThreadList: () => import_thread_list.default,
44
+ ThreadListItem: () => import_thread_list_item.default,
43
45
  ThreadWelcome: () => import_thread_welcome.default,
44
46
  UserActionBar: () => import_user_action_bar.default,
45
47
  UserMessage: () => import_user_message.default,
@@ -59,6 +61,8 @@ var import_user_message = __toESM(require("./user-message.cjs"));
59
61
  var import_user_action_bar = __toESM(require("./user-action-bar.cjs"));
60
62
  var import_thread_welcome = __toESM(require("./thread-welcome.cjs"));
61
63
  var import_content_part = __toESM(require("./content-part.cjs"));
64
+ var import_thread_list = __toESM(require("./thread-list.cjs"));
65
+ var import_thread_list_item = __toESM(require("./thread-list-item.cjs"));
62
66
  // Annotate the CommonJS export names for ESM import in node:
63
67
  0 && (module.exports = {
64
68
  AssistantActionBar,
@@ -71,6 +75,8 @@ var import_content_part = __toESM(require("./content-part.cjs"));
71
75
  EditComposer,
72
76
  Thread,
73
77
  ThreadConfigProvider,
78
+ ThreadList,
79
+ ThreadListItem,
74
80
  ThreadWelcome,
75
81
  UserActionBar,
76
82
  UserMessage,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/ui/index.ts"],"sourcesContent":["export {\n ThreadConfigProvider,\n useThreadConfig,\n type ThreadConfig,\n type ThreadWelcomeConfig,\n type UserMessageConfig,\n type AssistantMessageConfig,\n type StringsConfig,\n type SuggestionConfig,\n type ThreadConfigProviderProps,\n} from \"./thread-config\";\n\nexport { default as AssistantActionBar } from \"./assistant-action-bar\";\n\nexport { default as AssistantMessage } from \"./assistant-message\";\n\nexport { default as AssistantModal } from \"./assistant-modal\";\n\nexport { default as BranchPicker } from \"./branch-picker\";\n\nexport { default as Composer } from \"./composer\";\n\nexport {\n default as AttachmentUI, // TODO name collision with Attachment\n} from \"./attachment-ui\";\n\nexport { default as EditComposer } from \"./edit-composer\";\n\nexport { default as Thread } from \"./thread\";\n\nexport { default as UserMessage } from \"./user-message\";\n\nexport { default as UserActionBar } from \"./user-action-bar\";\n\nexport { default as ThreadWelcome } from \"./thread-welcome\";\n\nexport { default as ContentPart } from \"./content-part\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,2BAUO;AAEP,kCAA8C;AAE9C,+BAA4C;AAE5C,6BAA0C;AAE1C,2BAAwC;AAExC,sBAAoC;AAEpC,2BAEO;AAEP,2BAAwC;AAExC,oBAAkC;AAElC,0BAAuC;AAEvC,6BAAyC;AAEzC,4BAAyC;AAEzC,0BAAuC;","names":[]}
1
+ {"version":3,"sources":["../../src/ui/index.ts"],"sourcesContent":["export {\n ThreadConfigProvider,\n useThreadConfig,\n type ThreadConfig,\n type ThreadWelcomeConfig,\n type UserMessageConfig,\n type AssistantMessageConfig,\n type StringsConfig,\n type SuggestionConfig,\n type ThreadConfigProviderProps,\n} from \"./thread-config\";\n\nexport { default as AssistantActionBar } from \"./assistant-action-bar\";\n\nexport { default as AssistantMessage } from \"./assistant-message\";\n\nexport { default as AssistantModal } from \"./assistant-modal\";\n\nexport { default as BranchPicker } from \"./branch-picker\";\n\nexport { default as Composer } from \"./composer\";\n\nexport {\n default as AttachmentUI, // TODO name collision with Attachment\n} from \"./attachment-ui\";\n\nexport { default as EditComposer } from \"./edit-composer\";\n\nexport { default as Thread } from \"./thread\";\n\nexport { default as UserMessage } from \"./user-message\";\n\nexport { default as UserActionBar } from \"./user-action-bar\";\n\nexport { default as ThreadWelcome } from \"./thread-welcome\";\n\nexport { default as ContentPart } from \"./content-part\";\n\nexport { default as ThreadList } from \"./thread-list\";\n\nexport { default as ThreadListItem } from \"./thread-list-item\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,2BAUO;AAEP,kCAA8C;AAE9C,+BAA4C;AAE5C,6BAA0C;AAE1C,2BAAwC;AAExC,sBAAoC;AAEpC,2BAEO;AAEP,2BAAwC;AAExC,oBAAkC;AAElC,0BAAuC;AAEvC,6BAAyC;AAEzC,4BAAyC;AAEzC,0BAAuC;AAEvC,yBAAsC;AAEtC,8BAA0C;","names":[]}
package/dist/ui/index.mjs CHANGED
@@ -17,6 +17,8 @@ import { default as default10 } from "./user-message.mjs";
17
17
  import { default as default11 } from "./user-action-bar.mjs";
18
18
  import { default as default12 } from "./thread-welcome.mjs";
19
19
  import { default as default13 } from "./content-part.mjs";
20
+ import { default as default14 } from "./thread-list.mjs";
21
+ import { default as default15 } from "./thread-list-item.mjs";
20
22
  export {
21
23
  default2 as AssistantActionBar,
22
24
  default3 as AssistantMessage,
@@ -28,6 +30,8 @@ export {
28
30
  default8 as EditComposer,
29
31
  default9 as Thread,
30
32
  ThreadConfigProvider,
33
+ default14 as ThreadList,
34
+ default15 as ThreadListItem,
31
35
  default12 as ThreadWelcome,
32
36
  default11 as UserActionBar,
33
37
  default10 as UserMessage,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/ui/index.ts"],"sourcesContent":["export {\n ThreadConfigProvider,\n useThreadConfig,\n type ThreadConfig,\n type ThreadWelcomeConfig,\n type UserMessageConfig,\n type AssistantMessageConfig,\n type StringsConfig,\n type SuggestionConfig,\n type ThreadConfigProviderProps,\n} from \"./thread-config\";\n\nexport { default as AssistantActionBar } from \"./assistant-action-bar\";\n\nexport { default as AssistantMessage } from \"./assistant-message\";\n\nexport { default as AssistantModal } from \"./assistant-modal\";\n\nexport { default as BranchPicker } from \"./branch-picker\";\n\nexport { default as Composer } from \"./composer\";\n\nexport {\n default as AttachmentUI, // TODO name collision with Attachment\n} from \"./attachment-ui\";\n\nexport { default as EditComposer } from \"./edit-composer\";\n\nexport { default as Thread } from \"./thread\";\n\nexport { default as UserMessage } from \"./user-message\";\n\nexport { default as UserActionBar } from \"./user-action-bar\";\n\nexport { default as ThreadWelcome } from \"./thread-welcome\";\n\nexport { default as ContentPart } from \"./content-part\";\n"],"mappings":";AAAA;AAAA,EACE;AAAA,EACA;AAAA,OAQK;AAEP,SAAoB,WAAXA,gBAAqC;AAE9C,SAAoB,WAAXA,gBAAmC;AAE5C,SAAoB,WAAXA,gBAAiC;AAE1C,SAAoB,WAAXA,gBAA+B;AAExC,SAAoB,WAAXA,gBAA2B;AAEpC;AAAA,EACa,WAAXA;AAAA,OACK;AAEP,SAAoB,WAAXA,gBAA+B;AAExC,SAAoB,WAAXA,gBAAyB;AAElC,SAAoB,WAAXA,iBAA8B;AAEvC,SAAoB,WAAXA,iBAAgC;AAEzC,SAAoB,WAAXA,iBAAgC;AAEzC,SAAoB,WAAXA,iBAA8B;","names":["default"]}
1
+ {"version":3,"sources":["../../src/ui/index.ts"],"sourcesContent":["export {\n ThreadConfigProvider,\n useThreadConfig,\n type ThreadConfig,\n type ThreadWelcomeConfig,\n type UserMessageConfig,\n type AssistantMessageConfig,\n type StringsConfig,\n type SuggestionConfig,\n type ThreadConfigProviderProps,\n} from \"./thread-config\";\n\nexport { default as AssistantActionBar } from \"./assistant-action-bar\";\n\nexport { default as AssistantMessage } from \"./assistant-message\";\n\nexport { default as AssistantModal } from \"./assistant-modal\";\n\nexport { default as BranchPicker } from \"./branch-picker\";\n\nexport { default as Composer } from \"./composer\";\n\nexport {\n default as AttachmentUI, // TODO name collision with Attachment\n} from \"./attachment-ui\";\n\nexport { default as EditComposer } from \"./edit-composer\";\n\nexport { default as Thread } from \"./thread\";\n\nexport { default as UserMessage } from \"./user-message\";\n\nexport { default as UserActionBar } from \"./user-action-bar\";\n\nexport { default as ThreadWelcome } from \"./thread-welcome\";\n\nexport { default as ContentPart } from \"./content-part\";\n\nexport { default as ThreadList } from \"./thread-list\";\n\nexport { default as ThreadListItem } from \"./thread-list-item\";\n"],"mappings":";AAAA;AAAA,EACE;AAAA,EACA;AAAA,OAQK;AAEP,SAAoB,WAAXA,gBAAqC;AAE9C,SAAoB,WAAXA,gBAAmC;AAE5C,SAAoB,WAAXA,gBAAiC;AAE1C,SAAoB,WAAXA,gBAA+B;AAExC,SAAoB,WAAXA,gBAA2B;AAEpC;AAAA,EACa,WAAXA;AAAA,OACK;AAEP,SAAoB,WAAXA,gBAA+B;AAExC,SAAoB,WAAXA,gBAAyB;AAElC,SAAoB,WAAXA,iBAA8B;AAEvC,SAAoB,WAAXA,iBAAgC;AAEzC,SAAoB,WAAXA,iBAAgC;AAEzC,SAAoB,WAAXA,iBAA8B;AAEvC,SAAoB,WAAXA,iBAA6B;AAEtC,SAAoB,WAAXA,iBAAiC;","names":["default"]}
@@ -44,6 +44,19 @@ export type StringsConfig = {
44
44
  };
45
45
  };
46
46
  };
47
+ threadList?: {
48
+ new?: {
49
+ label?: string | undefined;
50
+ };
51
+ item?: {
52
+ title?: {
53
+ fallback?: string | undefined;
54
+ };
55
+ archive?: {
56
+ label?: string | undefined;
57
+ };
58
+ };
59
+ };
47
60
  thread?: {
48
61
  scrollToBottom?: {
49
62
  tooltip?: string | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"thread-config.d.ts","sourceRoot":"","sources":["../../src/ui/thread-config.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,aAAa,EACb,EAAE,EACF,iBAAiB,EACjB,SAAS,EAGV,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,wBAAwB,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AAE9E,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAGlD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;IAC7B,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;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AU,CAAC,EACP;QACE,WAAW,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;QACxC,gBAAgB,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;QAC7C,YAAY,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;QACzC,QAAQ,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;QACrC,aAAa,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;KAC3C,GACD,SAAS,CAAC;CACf,CAAC;AAEF,eAAO,MAAM,eAAe,QAAO,IAAI,CAAC,YAAY,EAAE,SAAS,CAE9D,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG,iBAAiB,CAAC;IACxD,MAAM,CAAC,EAAE,YAAY,GAAG,SAAS,CAAC;CACnC,CAAC,CAAC;AAEH,eAAO,MAAM,oBAAoB,EAAE,EAAE,CAAC,yBAAyB,CAmC9D,CAAC"}
@@ -38,7 +38,14 @@ var ThreadConfigProvider = ({
38
38
  config
39
39
  }) => {
40
40
  const hasAssistant = !!(0, import_AssistantContext.useAssistantRuntime)({ optional: true });
41
- const configProvider = config && Object.keys(config ?? {}).length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ThreadConfigContext.Provider, { value: config, children }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children });
41
+ const hasConfig = config && Object.keys(config).length > 0;
42
+ const outerConfig = useThreadConfig();
43
+ if (hasConfig && Object.keys(outerConfig).length > 0) {
44
+ throw new Error(
45
+ "You are providing ThreadConfig to several nested components. Please provide all configuration to the same component."
46
+ );
47
+ }
48
+ const configProvider = hasConfig ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ThreadConfigContext.Provider, { value: config, children }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children });
42
49
  if (!config?.runtime) return configProvider;
43
50
  if (hasAssistant) {
44
51
  throw new Error(
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/ui/thread-config.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n ComponentType,\n FC,\n PropsWithChildren,\n ReactNode,\n createContext,\n useContext,\n} from \"react\";\n\nimport { AssistantRuntime } from \"../api/AssistantRuntime\";\nimport { AvatarProps } from \"./base/avatar\";\nimport { TextContentPartComponent, ToolCallContentPartProps } from \"../types\";\nimport { AssistantRuntimeProvider } from \"../context\";\nimport { AssistantToolUI } from \"../model-config\";\nimport { useAssistantRuntime } from \"../context/react/AssistantContext\";\n\nexport type SuggestionConfig = {\n text?: ReactNode | undefined;\n prompt: string;\n};\n\nexport type ThreadWelcomeConfig = {\n message?: string | null | undefined;\n suggestions?: SuggestionConfig[] | undefined;\n};\n\nexport type UserMessageConfig = {\n allowEdit?: boolean | undefined;\n};\n\nexport type AssistantMessageConfig = {\n allowReload?: boolean | undefined;\n allowCopy?: boolean | undefined;\n allowSpeak?: boolean | undefined;\n allowFeedbackPositive?: boolean | undefined;\n allowFeedbackNegative?: boolean | undefined;\n components?:\n | {\n Text?: TextContentPartComponent | undefined;\n ToolFallback?: ComponentType<ToolCallContentPartProps> | undefined;\n }\n | undefined;\n};\n\nexport type BranchPickerConfig = {\n allowBranchPicker?: boolean | undefined;\n};\n\nexport type ComposerConfig = {\n allowAttachments?: boolean | undefined;\n};\n\nexport type StringsConfig = {\n assistantModal?: {\n open: {\n button: {\n tooltip?: string | undefined;\n };\n };\n closed: {\n button: {\n tooltip?: string | undefined;\n };\n };\n };\n thread?: {\n scrollToBottom?: {\n tooltip?: string | undefined;\n };\n };\n welcome?: {\n message?: string | undefined;\n };\n userMessage?: {\n edit?: {\n tooltip?: string | undefined;\n };\n };\n assistantMessage?: {\n reload?: {\n tooltip?: string | undefined;\n };\n copy?: {\n tooltip?: string | undefined;\n };\n speak?: {\n tooltip?: string | undefined;\n stop?: {\n tooltip?: string | undefined;\n };\n };\n feedback?: {\n positive?: {\n tooltip?: string | undefined;\n };\n negative?: {\n tooltip?: string | undefined;\n };\n };\n };\n branchPicker?: {\n previous?: {\n tooltip?: string | undefined;\n };\n next?: {\n tooltip?: string | undefined;\n };\n };\n composer?: {\n send?:\n | {\n tooltip?: string | undefined;\n }\n | undefined;\n cancel?:\n | {\n tooltip?: string | undefined;\n }\n | undefined;\n addAttachment?:\n | {\n tooltip?: string | undefined;\n }\n | undefined;\n removeAttachment?: {\n tooltip?: string | undefined;\n };\n input?: {\n placeholder?: string | undefined;\n };\n };\n editComposer?: {\n send?: {\n label?: string | undefined;\n };\n cancel?: {\n label?: string | undefined;\n };\n };\n code?: {\n header?: {\n copy?: {\n tooltip?: string | undefined;\n };\n };\n };\n};\n\nconst ThreadConfigContext = createContext<ThreadConfig>({});\n\nexport type ThreadConfig = {\n runtime?: AssistantRuntime | undefined;\n\n assistantAvatar?: AvatarProps | undefined;\n\n welcome?: ThreadWelcomeConfig | undefined;\n assistantMessage?: AssistantMessageConfig | undefined;\n userMessage?: UserMessageConfig | undefined;\n\n branchPicker?: BranchPickerConfig | undefined;\n\n composer?: ComposerConfig | undefined;\n\n strings?: StringsConfig | undefined;\n\n tools?: AssistantToolUI[] | undefined; // TODO add AssistantTool support\n\n components?:\n | {\n UserMessage?: ComponentType | undefined;\n AssistantMessage?: ComponentType | undefined;\n EditComposer?: ComponentType | undefined;\n Composer?: ComponentType | undefined;\n ThreadWelcome?: ComponentType | undefined;\n }\n | undefined;\n};\n\nexport const useThreadConfig = (): Omit<ThreadConfig, \"runtime\"> => {\n return useContext(ThreadConfigContext);\n};\n\nexport type ThreadConfigProviderProps = PropsWithChildren<{\n config?: ThreadConfig | undefined;\n}>;\n\nexport const ThreadConfigProvider: FC<ThreadConfigProviderProps> = ({\n children,\n config,\n}) => {\n const hasAssistant = !!useAssistantRuntime({ optional: true });\n\n const configProvider =\n config && Object.keys(config ?? {}).length > 0 ? (\n <ThreadConfigContext.Provider value={config}>\n {children}\n </ThreadConfigContext.Provider>\n ) : (\n <>{children}</>\n );\n if (!config?.runtime) return configProvider;\n\n if (hasAssistant) {\n throw new Error(\n \"You provided a runtime to <Thread> while simulataneously using <AssistantRuntimeProvider>. This is not allowed.\",\n );\n }\n return (\n <AssistantRuntimeProvider runtime={config.runtime}>\n {configProvider}\n </AssistantRuntimeProvider>\n );\n};\n\nThreadConfigProvider.displayName = \"ThreadConfigProvider\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,mBAOO;AAKP,qBAAyC;AAEzC,8BAAoC;AAoL9B;AA9CN,IAAM,0BAAsB,4BAA4B,CAAC,CAAC;AA8BnD,IAAM,kBAAkB,MAAqC;AAClE,aAAO,yBAAW,mBAAmB;AACvC;AAMO,IAAM,uBAAsD,CAAC;AAAA,EAClE;AAAA,EACA;AACF,MAAM;AACJ,QAAM,eAAe,CAAC,KAAC,6CAAoB,EAAE,UAAU,KAAK,CAAC;AAE7D,QAAM,iBACJ,UAAU,OAAO,KAAK,UAAU,CAAC,CAAC,EAAE,SAAS,IAC3C,4CAAC,oBAAoB,UAApB,EAA6B,OAAO,QAClC,UACH,IAEA,2EAAG,UAAS;AAEhB,MAAI,CAAC,QAAQ,QAAS,QAAO;AAE7B,MAAI,cAAc;AAChB,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AACA,SACE,4CAAC,2CAAyB,SAAS,OAAO,SACvC,0BACH;AAEJ;AAEA,qBAAqB,cAAc;","names":[]}
1
+ {"version":3,"sources":["../../src/ui/thread-config.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n ComponentType,\n FC,\n PropsWithChildren,\n ReactNode,\n createContext,\n useContext,\n} from \"react\";\n\nimport { AssistantRuntime } from \"../api/AssistantRuntime\";\nimport { AvatarProps } from \"./base/avatar\";\nimport { TextContentPartComponent, ToolCallContentPartProps } from \"../types\";\nimport { AssistantRuntimeProvider } from \"../context\";\nimport { AssistantToolUI } from \"../model-config\";\nimport { useAssistantRuntime } from \"../context/react/AssistantContext\";\n\nexport type SuggestionConfig = {\n text?: ReactNode | undefined;\n prompt: string;\n};\n\nexport type ThreadWelcomeConfig = {\n message?: string | null | undefined;\n suggestions?: SuggestionConfig[] | undefined;\n};\n\nexport type UserMessageConfig = {\n allowEdit?: boolean | undefined;\n};\n\nexport type AssistantMessageConfig = {\n allowReload?: boolean | undefined;\n allowCopy?: boolean | undefined;\n allowSpeak?: boolean | undefined;\n allowFeedbackPositive?: boolean | undefined;\n allowFeedbackNegative?: boolean | undefined;\n components?:\n | {\n Text?: TextContentPartComponent | undefined;\n ToolFallback?: ComponentType<ToolCallContentPartProps> | undefined;\n }\n | undefined;\n};\n\nexport type BranchPickerConfig = {\n allowBranchPicker?: boolean | undefined;\n};\n\nexport type ComposerConfig = {\n allowAttachments?: boolean | undefined;\n};\n\nexport type StringsConfig = {\n assistantModal?: {\n open: {\n button: {\n tooltip?: string | undefined;\n };\n };\n closed: {\n button: {\n tooltip?: string | undefined;\n };\n };\n };\n threadList?: {\n new?: {\n label?: string | undefined;\n };\n item?: {\n title?: {\n fallback?: string | undefined;\n };\n archive?: {\n label?: string | undefined;\n };\n };\n };\n thread?: {\n scrollToBottom?: {\n tooltip?: string | undefined;\n };\n };\n welcome?: {\n message?: string | undefined;\n };\n userMessage?: {\n edit?: {\n tooltip?: string | undefined;\n };\n };\n assistantMessage?: {\n reload?: {\n tooltip?: string | undefined;\n };\n copy?: {\n tooltip?: string | undefined;\n };\n speak?: {\n tooltip?: string | undefined;\n stop?: {\n tooltip?: string | undefined;\n };\n };\n feedback?: {\n positive?: {\n tooltip?: string | undefined;\n };\n negative?: {\n tooltip?: string | undefined;\n };\n };\n };\n branchPicker?: {\n previous?: {\n tooltip?: string | undefined;\n };\n next?: {\n tooltip?: string | undefined;\n };\n };\n composer?: {\n send?:\n | {\n tooltip?: string | undefined;\n }\n | undefined;\n cancel?:\n | {\n tooltip?: string | undefined;\n }\n | undefined;\n addAttachment?:\n | {\n tooltip?: string | undefined;\n }\n | undefined;\n removeAttachment?: {\n tooltip?: string | undefined;\n };\n input?: {\n placeholder?: string | undefined;\n };\n };\n editComposer?: {\n send?: {\n label?: string | undefined;\n };\n cancel?: {\n label?: string | undefined;\n };\n };\n code?: {\n header?: {\n copy?: {\n tooltip?: string | undefined;\n };\n };\n };\n};\n\nconst ThreadConfigContext = createContext<ThreadConfig>({});\n\nexport type ThreadConfig = {\n runtime?: AssistantRuntime | undefined;\n\n assistantAvatar?: AvatarProps | undefined;\n\n welcome?: ThreadWelcomeConfig | undefined;\n assistantMessage?: AssistantMessageConfig | undefined;\n userMessage?: UserMessageConfig | undefined;\n\n branchPicker?: BranchPickerConfig | undefined;\n\n composer?: ComposerConfig | undefined;\n\n strings?: StringsConfig | undefined;\n\n tools?: AssistantToolUI[] | undefined; // TODO add AssistantTool support\n\n components?:\n | {\n UserMessage?: ComponentType | undefined;\n AssistantMessage?: ComponentType | undefined;\n EditComposer?: ComponentType | undefined;\n Composer?: ComponentType | undefined;\n ThreadWelcome?: ComponentType | undefined;\n }\n | undefined;\n};\n\nexport const useThreadConfig = (): Omit<ThreadConfig, \"runtime\"> => {\n return useContext(ThreadConfigContext);\n};\n\nexport type ThreadConfigProviderProps = PropsWithChildren<{\n config?: ThreadConfig | undefined;\n}>;\n\nexport const ThreadConfigProvider: FC<ThreadConfigProviderProps> = ({\n children,\n config,\n}) => {\n const hasAssistant = !!useAssistantRuntime({ optional: true });\n\n const hasConfig = config && Object.keys(config).length > 0;\n const outerConfig = useThreadConfig();\n\n if (hasConfig && Object.keys(outerConfig).length > 0) {\n throw new Error(\n \"You are providing ThreadConfig to several nested components. Please provide all configuration to the same component.\",\n );\n }\n\n const configProvider = hasConfig ? (\n <ThreadConfigContext.Provider value={config}>\n {children}\n </ThreadConfigContext.Provider>\n ) : (\n <>{children}</>\n );\n\n if (!config?.runtime) return configProvider;\n\n if (hasAssistant) {\n throw new Error(\n \"You provided a runtime to <Thread> while simulataneously using <AssistantRuntimeProvider>. This is not allowed.\",\n );\n }\n return (\n <AssistantRuntimeProvider runtime={config.runtime}>\n {configProvider}\n </AssistantRuntimeProvider>\n );\n};\n\nThreadConfigProvider.displayName = \"ThreadConfigProvider\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,mBAOO;AAKP,qBAAyC;AAEzC,8BAAoC;AAyMhC;AAtDJ,IAAM,0BAAsB,4BAA4B,CAAC,CAAC;AA8BnD,IAAM,kBAAkB,MAAqC;AAClE,aAAO,yBAAW,mBAAmB;AACvC;AAMO,IAAM,uBAAsD,CAAC;AAAA,EAClE;AAAA,EACA;AACF,MAAM;AACJ,QAAM,eAAe,CAAC,KAAC,6CAAoB,EAAE,UAAU,KAAK,CAAC;AAE7D,QAAM,YAAY,UAAU,OAAO,KAAK,MAAM,EAAE,SAAS;AACzD,QAAM,cAAc,gBAAgB;AAEpC,MAAI,aAAa,OAAO,KAAK,WAAW,EAAE,SAAS,GAAG;AACpD,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AAEA,QAAM,iBAAiB,YACrB,4CAAC,oBAAoB,UAApB,EAA6B,OAAO,QAClC,UACH,IAEA,2EAAG,UAAS;AAGd,MAAI,CAAC,QAAQ,QAAS,QAAO;AAE7B,MAAI,cAAc;AAChB,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AACA,SACE,4CAAC,2CAAyB,SAAS,OAAO,SACvC,0BACH;AAEJ;AAEA,qBAAqB,cAAc;","names":[]}
@@ -17,7 +17,14 @@ var ThreadConfigProvider = ({
17
17
  config
18
18
  }) => {
19
19
  const hasAssistant = !!useAssistantRuntime({ optional: true });
20
- const configProvider = config && Object.keys(config ?? {}).length > 0 ? /* @__PURE__ */ jsx(ThreadConfigContext.Provider, { value: config, children }) : /* @__PURE__ */ jsx(Fragment, { children });
20
+ const hasConfig = config && Object.keys(config).length > 0;
21
+ const outerConfig = useThreadConfig();
22
+ if (hasConfig && Object.keys(outerConfig).length > 0) {
23
+ throw new Error(
24
+ "You are providing ThreadConfig to several nested components. Please provide all configuration to the same component."
25
+ );
26
+ }
27
+ const configProvider = hasConfig ? /* @__PURE__ */ jsx(ThreadConfigContext.Provider, { value: config, children }) : /* @__PURE__ */ jsx(Fragment, { children });
21
28
  if (!config?.runtime) return configProvider;
22
29
  if (hasAssistant) {
23
30
  throw new Error(
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/ui/thread-config.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n ComponentType,\n FC,\n PropsWithChildren,\n ReactNode,\n createContext,\n useContext,\n} from \"react\";\n\nimport { AssistantRuntime } from \"../api/AssistantRuntime\";\nimport { AvatarProps } from \"./base/avatar\";\nimport { TextContentPartComponent, ToolCallContentPartProps } from \"../types\";\nimport { AssistantRuntimeProvider } from \"../context\";\nimport { AssistantToolUI } from \"../model-config\";\nimport { useAssistantRuntime } from \"../context/react/AssistantContext\";\n\nexport type SuggestionConfig = {\n text?: ReactNode | undefined;\n prompt: string;\n};\n\nexport type ThreadWelcomeConfig = {\n message?: string | null | undefined;\n suggestions?: SuggestionConfig[] | undefined;\n};\n\nexport type UserMessageConfig = {\n allowEdit?: boolean | undefined;\n};\n\nexport type AssistantMessageConfig = {\n allowReload?: boolean | undefined;\n allowCopy?: boolean | undefined;\n allowSpeak?: boolean | undefined;\n allowFeedbackPositive?: boolean | undefined;\n allowFeedbackNegative?: boolean | undefined;\n components?:\n | {\n Text?: TextContentPartComponent | undefined;\n ToolFallback?: ComponentType<ToolCallContentPartProps> | undefined;\n }\n | undefined;\n};\n\nexport type BranchPickerConfig = {\n allowBranchPicker?: boolean | undefined;\n};\n\nexport type ComposerConfig = {\n allowAttachments?: boolean | undefined;\n};\n\nexport type StringsConfig = {\n assistantModal?: {\n open: {\n button: {\n tooltip?: string | undefined;\n };\n };\n closed: {\n button: {\n tooltip?: string | undefined;\n };\n };\n };\n thread?: {\n scrollToBottom?: {\n tooltip?: string | undefined;\n };\n };\n welcome?: {\n message?: string | undefined;\n };\n userMessage?: {\n edit?: {\n tooltip?: string | undefined;\n };\n };\n assistantMessage?: {\n reload?: {\n tooltip?: string | undefined;\n };\n copy?: {\n tooltip?: string | undefined;\n };\n speak?: {\n tooltip?: string | undefined;\n stop?: {\n tooltip?: string | undefined;\n };\n };\n feedback?: {\n positive?: {\n tooltip?: string | undefined;\n };\n negative?: {\n tooltip?: string | undefined;\n };\n };\n };\n branchPicker?: {\n previous?: {\n tooltip?: string | undefined;\n };\n next?: {\n tooltip?: string | undefined;\n };\n };\n composer?: {\n send?:\n | {\n tooltip?: string | undefined;\n }\n | undefined;\n cancel?:\n | {\n tooltip?: string | undefined;\n }\n | undefined;\n addAttachment?:\n | {\n tooltip?: string | undefined;\n }\n | undefined;\n removeAttachment?: {\n tooltip?: string | undefined;\n };\n input?: {\n placeholder?: string | undefined;\n };\n };\n editComposer?: {\n send?: {\n label?: string | undefined;\n };\n cancel?: {\n label?: string | undefined;\n };\n };\n code?: {\n header?: {\n copy?: {\n tooltip?: string | undefined;\n };\n };\n };\n};\n\nconst ThreadConfigContext = createContext<ThreadConfig>({});\n\nexport type ThreadConfig = {\n runtime?: AssistantRuntime | undefined;\n\n assistantAvatar?: AvatarProps | undefined;\n\n welcome?: ThreadWelcomeConfig | undefined;\n assistantMessage?: AssistantMessageConfig | undefined;\n userMessage?: UserMessageConfig | undefined;\n\n branchPicker?: BranchPickerConfig | undefined;\n\n composer?: ComposerConfig | undefined;\n\n strings?: StringsConfig | undefined;\n\n tools?: AssistantToolUI[] | undefined; // TODO add AssistantTool support\n\n components?:\n | {\n UserMessage?: ComponentType | undefined;\n AssistantMessage?: ComponentType | undefined;\n EditComposer?: ComponentType | undefined;\n Composer?: ComponentType | undefined;\n ThreadWelcome?: ComponentType | undefined;\n }\n | undefined;\n};\n\nexport const useThreadConfig = (): Omit<ThreadConfig, \"runtime\"> => {\n return useContext(ThreadConfigContext);\n};\n\nexport type ThreadConfigProviderProps = PropsWithChildren<{\n config?: ThreadConfig | undefined;\n}>;\n\nexport const ThreadConfigProvider: FC<ThreadConfigProviderProps> = ({\n children,\n config,\n}) => {\n const hasAssistant = !!useAssistantRuntime({ optional: true });\n\n const configProvider =\n config && Object.keys(config ?? {}).length > 0 ? (\n <ThreadConfigContext.Provider value={config}>\n {children}\n </ThreadConfigContext.Provider>\n ) : (\n <>{children}</>\n );\n if (!config?.runtime) return configProvider;\n\n if (hasAssistant) {\n throw new Error(\n \"You provided a runtime to <Thread> while simulataneously using <AssistantRuntimeProvider>. This is not allowed.\",\n );\n }\n return (\n <AssistantRuntimeProvider runtime={config.runtime}>\n {configProvider}\n </AssistantRuntimeProvider>\n );\n};\n\nThreadConfigProvider.displayName = \"ThreadConfigProvider\";\n"],"mappings":";;;AAEA;AAAA,EAKE;AAAA,EACA;AAAA,OACK;AAKP,SAAS,gCAAgC;AAEzC,SAAS,2BAA2B;AAoL9B,SAIA,UAJA;AA9CN,IAAM,sBAAsB,cAA4B,CAAC,CAAC;AA8BnD,IAAM,kBAAkB,MAAqC;AAClE,SAAO,WAAW,mBAAmB;AACvC;AAMO,IAAM,uBAAsD,CAAC;AAAA,EAClE;AAAA,EACA;AACF,MAAM;AACJ,QAAM,eAAe,CAAC,CAAC,oBAAoB,EAAE,UAAU,KAAK,CAAC;AAE7D,QAAM,iBACJ,UAAU,OAAO,KAAK,UAAU,CAAC,CAAC,EAAE,SAAS,IAC3C,oBAAC,oBAAoB,UAApB,EAA6B,OAAO,QAClC,UACH,IAEA,gCAAG,UAAS;AAEhB,MAAI,CAAC,QAAQ,QAAS,QAAO;AAE7B,MAAI,cAAc;AAChB,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AACA,SACE,oBAAC,4BAAyB,SAAS,OAAO,SACvC,0BACH;AAEJ;AAEA,qBAAqB,cAAc;","names":[]}
1
+ {"version":3,"sources":["../../src/ui/thread-config.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n ComponentType,\n FC,\n PropsWithChildren,\n ReactNode,\n createContext,\n useContext,\n} from \"react\";\n\nimport { AssistantRuntime } from \"../api/AssistantRuntime\";\nimport { AvatarProps } from \"./base/avatar\";\nimport { TextContentPartComponent, ToolCallContentPartProps } from \"../types\";\nimport { AssistantRuntimeProvider } from \"../context\";\nimport { AssistantToolUI } from \"../model-config\";\nimport { useAssistantRuntime } from \"../context/react/AssistantContext\";\n\nexport type SuggestionConfig = {\n text?: ReactNode | undefined;\n prompt: string;\n};\n\nexport type ThreadWelcomeConfig = {\n message?: string | null | undefined;\n suggestions?: SuggestionConfig[] | undefined;\n};\n\nexport type UserMessageConfig = {\n allowEdit?: boolean | undefined;\n};\n\nexport type AssistantMessageConfig = {\n allowReload?: boolean | undefined;\n allowCopy?: boolean | undefined;\n allowSpeak?: boolean | undefined;\n allowFeedbackPositive?: boolean | undefined;\n allowFeedbackNegative?: boolean | undefined;\n components?:\n | {\n Text?: TextContentPartComponent | undefined;\n ToolFallback?: ComponentType<ToolCallContentPartProps> | undefined;\n }\n | undefined;\n};\n\nexport type BranchPickerConfig = {\n allowBranchPicker?: boolean | undefined;\n};\n\nexport type ComposerConfig = {\n allowAttachments?: boolean | undefined;\n};\n\nexport type StringsConfig = {\n assistantModal?: {\n open: {\n button: {\n tooltip?: string | undefined;\n };\n };\n closed: {\n button: {\n tooltip?: string | undefined;\n };\n };\n };\n threadList?: {\n new?: {\n label?: string | undefined;\n };\n item?: {\n title?: {\n fallback?: string | undefined;\n };\n archive?: {\n label?: string | undefined;\n };\n };\n };\n thread?: {\n scrollToBottom?: {\n tooltip?: string | undefined;\n };\n };\n welcome?: {\n message?: string | undefined;\n };\n userMessage?: {\n edit?: {\n tooltip?: string | undefined;\n };\n };\n assistantMessage?: {\n reload?: {\n tooltip?: string | undefined;\n };\n copy?: {\n tooltip?: string | undefined;\n };\n speak?: {\n tooltip?: string | undefined;\n stop?: {\n tooltip?: string | undefined;\n };\n };\n feedback?: {\n positive?: {\n tooltip?: string | undefined;\n };\n negative?: {\n tooltip?: string | undefined;\n };\n };\n };\n branchPicker?: {\n previous?: {\n tooltip?: string | undefined;\n };\n next?: {\n tooltip?: string | undefined;\n };\n };\n composer?: {\n send?:\n | {\n tooltip?: string | undefined;\n }\n | undefined;\n cancel?:\n | {\n tooltip?: string | undefined;\n }\n | undefined;\n addAttachment?:\n | {\n tooltip?: string | undefined;\n }\n | undefined;\n removeAttachment?: {\n tooltip?: string | undefined;\n };\n input?: {\n placeholder?: string | undefined;\n };\n };\n editComposer?: {\n send?: {\n label?: string | undefined;\n };\n cancel?: {\n label?: string | undefined;\n };\n };\n code?: {\n header?: {\n copy?: {\n tooltip?: string | undefined;\n };\n };\n };\n};\n\nconst ThreadConfigContext = createContext<ThreadConfig>({});\n\nexport type ThreadConfig = {\n runtime?: AssistantRuntime | undefined;\n\n assistantAvatar?: AvatarProps | undefined;\n\n welcome?: ThreadWelcomeConfig | undefined;\n assistantMessage?: AssistantMessageConfig | undefined;\n userMessage?: UserMessageConfig | undefined;\n\n branchPicker?: BranchPickerConfig | undefined;\n\n composer?: ComposerConfig | undefined;\n\n strings?: StringsConfig | undefined;\n\n tools?: AssistantToolUI[] | undefined; // TODO add AssistantTool support\n\n components?:\n | {\n UserMessage?: ComponentType | undefined;\n AssistantMessage?: ComponentType | undefined;\n EditComposer?: ComponentType | undefined;\n Composer?: ComponentType | undefined;\n ThreadWelcome?: ComponentType | undefined;\n }\n | undefined;\n};\n\nexport const useThreadConfig = (): Omit<ThreadConfig, \"runtime\"> => {\n return useContext(ThreadConfigContext);\n};\n\nexport type ThreadConfigProviderProps = PropsWithChildren<{\n config?: ThreadConfig | undefined;\n}>;\n\nexport const ThreadConfigProvider: FC<ThreadConfigProviderProps> = ({\n children,\n config,\n}) => {\n const hasAssistant = !!useAssistantRuntime({ optional: true });\n\n const hasConfig = config && Object.keys(config).length > 0;\n const outerConfig = useThreadConfig();\n\n if (hasConfig && Object.keys(outerConfig).length > 0) {\n throw new Error(\n \"You are providing ThreadConfig to several nested components. Please provide all configuration to the same component.\",\n );\n }\n\n const configProvider = hasConfig ? (\n <ThreadConfigContext.Provider value={config}>\n {children}\n </ThreadConfigContext.Provider>\n ) : (\n <>{children}</>\n );\n\n if (!config?.runtime) return configProvider;\n\n if (hasAssistant) {\n throw new Error(\n \"You provided a runtime to <Thread> while simulataneously using <AssistantRuntimeProvider>. This is not allowed.\",\n );\n }\n return (\n <AssistantRuntimeProvider runtime={config.runtime}>\n {configProvider}\n </AssistantRuntimeProvider>\n );\n};\n\nThreadConfigProvider.displayName = \"ThreadConfigProvider\";\n"],"mappings":";;;AAEA;AAAA,EAKE;AAAA,EACA;AAAA,OACK;AAKP,SAAS,gCAAgC;AAEzC,SAAS,2BAA2B;AAyMhC,SAIA,UAJA;AAtDJ,IAAM,sBAAsB,cAA4B,CAAC,CAAC;AA8BnD,IAAM,kBAAkB,MAAqC;AAClE,SAAO,WAAW,mBAAmB;AACvC;AAMO,IAAM,uBAAsD,CAAC;AAAA,EAClE;AAAA,EACA;AACF,MAAM;AACJ,QAAM,eAAe,CAAC,CAAC,oBAAoB,EAAE,UAAU,KAAK,CAAC;AAE7D,QAAM,YAAY,UAAU,OAAO,KAAK,MAAM,EAAE,SAAS;AACzD,QAAM,cAAc,gBAAgB;AAEpC,MAAI,aAAa,OAAO,KAAK,WAAW,EAAE,SAAS,GAAG;AACpD,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AAEA,QAAM,iBAAiB,YACrB,oBAAC,oBAAoB,UAApB,EAA6B,OAAO,QAClC,UACH,IAEA,gCAAG,UAAS;AAGd,MAAI,CAAC,QAAQ,QAAS,QAAO;AAE7B,MAAI,cAAc;AAChB,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AACA,SACE,oBAAC,4BAAyB,SAAS,OAAO,SACvC,0BACH;AAEJ;AAEA,qBAAqB,cAAc;","names":[]}
@@ -0,0 +1,24 @@
1
+ import { type FC } from "react";
2
+ declare const ThreadListItem: FC;
3
+ declare const exports: {
4
+ Root: import("react").ForwardRefExoticComponent<Partial<Omit<Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
5
+ ref?: ((instance: HTMLDivElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLDivElement> | null | undefined;
6
+ } & {
7
+ asChild?: boolean;
8
+ }, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref">> & import("react").RefAttributes<HTMLDivElement>>;
9
+ Title: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "ref"> & import("react").RefAttributes<HTMLParagraphElement>>;
10
+ Archive: import("react").ForwardRefExoticComponent<Partial<Omit<Omit<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
11
+ ref?: ((instance: HTMLButtonElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLButtonElement> | null | undefined;
12
+ } & {
13
+ asChild?: boolean;
14
+ }, "ref"> & import("class-variance-authority").VariantProps<(props?: ({
15
+ variant?: "default" | "outline" | "ghost" | null | undefined;
16
+ size?: "default" | "icon" | null | undefined;
17
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string> & {
18
+ tooltip: string;
19
+ side?: "top" | "bottom" | "left" | "right";
20
+ } & import("react").RefAttributes<HTMLButtonElement>, "ref">> & import("react").RefAttributes<HTMLButtonElement>>;
21
+ };
22
+ declare const _default: typeof ThreadListItem & typeof exports;
23
+ export default _default;
24
+ //# sourceMappingURL=thread-list-item.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"thread-list-item.d.ts","sourceRoot":"","sources":["../../src/ui/thread-list-item.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAwC,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAStE,QAAA,MAAM,cAAc,EAAE,EASrB,CAAC;AAuEF,QAAA,MAAM,OAAO;;;;;;;;;;;;;;;;;;CAIZ,CAAC;wBAEuD,OAAO,cAAc,GAC5E,OAAO,OAAO;AADhB,wBACiB"}