chat 4.26.0 → 4.28.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/dist/{chunk-OPV5U4WG.js → chunk-V25FKIIL.js} +44 -1
  2. package/dist/index.d.ts +485 -33
  3. package/dist/index.js +862 -135
  4. package/dist/{jsx-runtime-DxATbnrP.d.ts → jsx-runtime-DxGwoLu2.d.ts} +49 -5
  5. package/dist/jsx-runtime.d.ts +1 -1
  6. package/dist/jsx-runtime.js +1 -1
  7. package/docs/actions.mdx +52 -1
  8. package/docs/adapters.mdx +43 -37
  9. package/docs/api/cards.mdx +4 -0
  10. package/docs/api/chat.mdx +172 -6
  11. package/docs/api/index.mdx +2 -0
  12. package/docs/api/markdown.mdx +28 -5
  13. package/docs/api/message.mdx +58 -1
  14. package/docs/api/meta.json +2 -0
  15. package/docs/api/modals.mdx +50 -0
  16. package/docs/api/postable-message.mdx +55 -1
  17. package/docs/api/thread.mdx +33 -3
  18. package/docs/api/transcripts.mdx +220 -0
  19. package/docs/cards.mdx +6 -0
  20. package/docs/concurrency.mdx +4 -0
  21. package/docs/contributing/building.mdx +73 -1
  22. package/docs/contributing/publishing.mdx +33 -0
  23. package/docs/conversation-history.mdx +137 -0
  24. package/docs/direct-messages.mdx +13 -4
  25. package/docs/ephemeral-messages.mdx +1 -1
  26. package/docs/error-handling.mdx +15 -3
  27. package/docs/files.mdx +2 -1
  28. package/docs/getting-started.mdx +1 -11
  29. package/docs/index.mdx +7 -5
  30. package/docs/meta.json +14 -5
  31. package/docs/modals.mdx +97 -1
  32. package/docs/posting-messages.mdx +7 -3
  33. package/docs/streaming.mdx +74 -18
  34. package/docs/subject.mdx +53 -0
  35. package/docs/threads-messages-channels.mdx +43 -0
  36. package/docs/usage.mdx +11 -2
  37. package/package.json +3 -2
  38. package/resources/guides/create-a-discord-support-bot-with-nuxt-and-redis.md +180 -0
  39. package/resources/guides/how-to-build-a-slack-bot-with-next-js-and-redis.md +134 -0
  40. package/resources/guides/how-to-build-an-ai-agent-for-slack-with-chat-sdk-and-ai-sdk.md +220 -0
  41. package/resources/guides/run-and-track-deploys-from-slack.md +270 -0
  42. package/resources/guides/ship-a-github-code-review-bot-with-hono-and-redis.md +147 -0
  43. package/resources/guides/triage-form-submissions-with-chat-sdk.md +178 -0
  44. package/resources/templates.json +19 -0
  45. package/docs/guides/code-review-hono.mdx +0 -241
  46. package/docs/guides/discord-nuxt.mdx +0 -227
  47. package/docs/guides/durable-chat-sessions-nextjs.mdx +0 -337
  48. package/docs/guides/meta.json +0 -10
  49. package/docs/guides/scheduled-posts-neon.mdx +0 -447
  50. package/docs/guides/slack-nextjs.mdx +0 -234
@@ -354,7 +354,8 @@ function Button(options) {
354
354
  style: options.style,
355
355
  value: options.value,
356
356
  disabled: options.disabled,
357
- actionType: options.actionType
357
+ actionType: options.actionType,
358
+ callbackUrl: options.callbackUrl
358
359
  };
359
360
  }
360
361
  function LinkButton(options) {
@@ -582,6 +583,7 @@ function cardChildToFallbackText(child) {
582
583
  var VALID_MODAL_CHILD_TYPES = [
583
584
  "text_input",
584
585
  "select",
586
+ "external_select",
585
587
  "radio_select",
586
588
  "text",
587
589
  "fields"
@@ -606,6 +608,7 @@ function Modal(options) {
606
608
  return {
607
609
  type: "modal",
608
610
  callbackId: options.callbackId,
611
+ callbackUrl: options.callbackUrl,
609
612
  title: options.title,
610
613
  submitLabel: options.submitLabel,
611
614
  closeLabel: options.closeLabel,
@@ -640,6 +643,17 @@ function Select(options) {
640
643
  optional: options.optional
641
644
  };
642
645
  }
646
+ function ExternalSelect(options) {
647
+ return {
648
+ type: "external_select",
649
+ id: options.id,
650
+ initialOption: options.initialOption,
651
+ label: options.label,
652
+ placeholder: options.placeholder,
653
+ minQueryLength: options.minQueryLength,
654
+ optional: options.optional
655
+ };
656
+ }
643
657
  function SelectOption(options) {
644
658
  return {
645
659
  label: options.label,
@@ -675,6 +689,7 @@ var modalComponentMap = /* @__PURE__ */ new Map([
675
689
  [Modal, "Modal"],
676
690
  [TextInput, "TextInput"],
677
691
  [Select, "Select"],
692
+ [ExternalSelect, "ExternalSelect"],
678
693
  [RadioSelect, "RadioSelect"],
679
694
  [SelectOption, "SelectOption"]
680
695
  ]);
@@ -729,6 +744,15 @@ function fromReactModalElement(element) {
729
744
  initialOption: props.initialOption,
730
745
  optional: props.optional
731
746
  });
747
+ case "ExternalSelect":
748
+ return ExternalSelect({
749
+ id: props.id,
750
+ initialOption: props.initialOption,
751
+ label: props.label,
752
+ placeholder: props.placeholder,
753
+ minQueryLength: props.minQueryLength,
754
+ optional: props.optional
755
+ });
732
756
  case "RadioSelect":
733
757
  return RadioSelect({
734
758
  id: props.id,
@@ -823,6 +847,9 @@ function isTextInputProps(props) {
823
847
  function isSelectProps(props) {
824
848
  return "id" in props && "label" in props && !("value" in props);
825
849
  }
850
+ function isExternalSelectProps(props) {
851
+ return "id" in props && "label" in props && !("value" in props) && !("children" in props);
852
+ }
826
853
  function isSelectOptionProps(props) {
827
854
  return "label" in props && "value" in props && !("id" in props);
828
855
  }
@@ -856,6 +883,7 @@ function resolveJSXElement(element) {
856
883
  style: props.style,
857
884
  value: props.value,
858
885
  actionType: props.actionType,
886
+ callbackUrl: props.callbackUrl,
859
887
  disabled: props.disabled
860
888
  });
861
889
  }
@@ -904,6 +932,7 @@ function resolveJSXElement(element) {
904
932
  }
905
933
  return Modal({
906
934
  callbackId: props.callbackId,
935
+ callbackUrl: props.callbackUrl,
907
936
  title: props.title,
908
937
  submitLabel: props.submitLabel,
909
938
  closeLabel: props.closeLabel,
@@ -939,6 +968,19 @@ function resolveJSXElement(element) {
939
968
  options: processedChildren
940
969
  });
941
970
  }
971
+ if (type === ExternalSelect) {
972
+ if (!isExternalSelectProps(props)) {
973
+ throw new Error("ExternalSelect requires 'id' and 'label' props");
974
+ }
975
+ return ExternalSelect({
976
+ id: props.id,
977
+ initialOption: props.initialOption,
978
+ label: props.label,
979
+ placeholder: props.placeholder,
980
+ minQueryLength: props.minQueryLength,
981
+ optional: props.optional
982
+ });
983
+ }
942
984
  if (type === RadioSelect) {
943
985
  if (!isSelectProps(props)) {
944
986
  throw new Error("RadioSelect requires 'id' and 'label' props");
@@ -1096,6 +1138,7 @@ export {
1096
1138
  Modal,
1097
1139
  TextInput,
1098
1140
  Select,
1141
+ ExternalSelect,
1099
1142
  SelectOption,
1100
1143
  RadioSelect,
1101
1144
  fromReactModalElement,