slack-blocks-to-jsx 0.1.7 → 0.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -1,3 +1,5 @@
1
+ import { ReactNode } from 'react';
2
+
1
3
  type Element = ButtonElement | CheckboxesElement | DatePickerElement | DateTimePickerElement | EmailInputElement | ImageElement | MultiStaticSelectElement | MultiExternalSelectElement | MultiUsersSelectElement | MultiConversationsSelectElement | MultiChannelsSelectElement | NumberInputElement | OverflowMenuElement | PlainTextInputElement | RadioButtonsElement | StaticSelectElement | ExternalSelectElement | UsersSelectElement | ConversationsSelectElement | ChannelsSelectElement | TimePickerElement | UrlTextInputElement;
2
4
  type ButtonElement = {
3
5
  type: "button";
@@ -713,7 +715,7 @@ type RichTextList = {
713
715
  };
714
716
  type RichTextPreformatted = {
715
717
  type: "rich_text_preformatted";
716
- elements: AnyRichTextSectionElement[];
718
+ elements: RichTextSectionElement[];
717
719
  /**
718
720
  * 0 or 1 (default 0) - if 1, a border is drawn on the left side of the block.
719
721
  */
@@ -721,7 +723,7 @@ type RichTextPreformatted = {
721
723
  };
722
724
  type RichTextQuote = {
723
725
  type: "rich_text_quote";
724
- elements: AnyRichTextSectionElement[];
726
+ elements: RichTextSectionElement[];
725
727
  /**
726
728
  * 0 or 1 (default 0) - if 1, a border is drawn on the left side of the block.
727
729
  */
@@ -729,69 +731,54 @@ type RichTextQuote = {
729
731
  };
730
732
  type RichTextSection = {
731
733
  type: "rich_text_section";
732
- elements: AnyRichTextSectionElement[];
734
+ elements: RichTextSectionElement[];
733
735
  };
734
- type AnyRichTextBlockElement = RichTextList | RichTextPreformatted | RichTextQuote | RichTextSection;
735
- type AnyRichTextSectionElement = RichTextSectionText | RichTextSectionChannel | RichTextSectionUser | RichTextSectionEmoji | RichTextSectionLink | RichTextSectionTeam | RichTextSectionUsergroup | RichTextSectionDate | RichTextSectionBroadcast | RichTextSectionColor;
736
- interface RichTextSectionElement {
737
- type: "text" | "channel" | "user" | "emoji" | "link" | "team" | "usergroup" | "date" | "broadcast" | "color";
738
- style?: RichTextSectionElementStyle;
739
- }
740
- interface RichTextSectionText extends RichTextSectionElement {
736
+ type RichTextBlockElement = RichTextList | RichTextPreformatted | RichTextQuote | RichTextSection;
737
+ type RichTextSectionElement = RichTextSectionText | RichTextSectionChannel | RichTextSectionUser | RichTextSectionEmoji | RichTextSectionLink | RichTextSectionUsergroup | RichTextSectionBroadcast;
738
+ type RichTextSectionText = {
741
739
  type: "text";
742
740
  text: string;
743
741
  style?: RichTextSectionElementStyleWithCode;
744
- }
745
- interface RichTextSectionChannel extends RichTextSectionElement {
742
+ };
743
+ type RichTextSectionChannel = {
746
744
  type: "channel";
747
745
  channel_id: string;
748
- }
749
- interface RichTextSectionUser extends RichTextSectionElement {
746
+ style?: RichTextSectionElementStyleWithCode;
747
+ };
748
+ type RichTextSectionUser = {
750
749
  type: "user";
751
750
  user_id: string;
752
- }
753
- interface RichTextSectionEmoji extends RichTextSectionElement {
751
+ style?: RichTextSectionElementStyleWithCode;
752
+ };
753
+ type RichTextSectionEmoji = {
754
754
  type: "emoji";
755
755
  name: string;
756
756
  skin_tone?: number;
757
757
  unicode?: string;
758
- }
759
- interface RichTextSectionLink extends RichTextSectionElement {
758
+ style?: RichTextSectionElementStyleWithCode;
759
+ };
760
+ type RichTextSectionLink = {
760
761
  type: "link";
761
762
  url: string;
762
763
  text: string;
763
764
  style?: RichTextSectionElementStyleWithCode;
764
- }
765
- interface RichTextSectionTeam extends RichTextSectionElement {
766
- type: "team";
767
- team_id: string;
768
- }
769
- interface RichTextSectionUsergroup extends RichTextSectionElement {
765
+ };
766
+ type RichTextSectionUsergroup = {
770
767
  type: "usergroup";
771
768
  usergroup_id: string;
772
- }
773
- interface RichTextSectionDate extends RichTextSectionElement {
774
- type: "date";
775
- timestamp: number;
776
- format: string;
777
769
  style?: RichTextSectionElementStyleWithCode;
778
- }
779
- interface RichTextSectionBroadcast extends RichTextSectionElement {
770
+ };
771
+ type RichTextSectionBroadcast = {
780
772
  type: "broadcast";
781
773
  range: "channel" | "here" | "everyone";
782
- }
783
- interface RichTextSectionColor extends RichTextSectionElement {
784
- type: "color";
785
- value: string;
786
- }
787
- interface RichTextSectionElementStyle {
774
+ style?: RichTextSectionElementStyleWithCode;
775
+ };
776
+ type RichTextSectionElementStyleWithCode = {
777
+ code?: boolean;
788
778
  bold?: boolean;
789
779
  italic?: boolean;
790
780
  strike?: boolean;
791
- }
792
- interface RichTextSectionElementStyleWithCode extends RichTextSectionElementStyle {
793
- code?: boolean;
794
- }
781
+ };
795
782
 
796
783
  type Block = ActionsBlock | ContextBlock | DividerBlock | FileBlock | HeaderBlock | ImageBlock | InputBlock | SectionBlock | VideoBlock | RichTextBlock;
797
784
  type ActionsBlock = {
@@ -1077,7 +1064,7 @@ type RichTextBlock = {
1077
1064
  /**
1078
1065
  * An array of rich text objects - rich_text_section, rich_text_list, rich_text_preformatted, and rich_text_quote. See your specific desired element below for more details.
1079
1066
  */
1080
- elements: AnyRichTextBlockElement[];
1067
+ elements: RichTextBlockElement[];
1081
1068
  };
1082
1069
 
1083
1070
  type User = {
@@ -1089,24 +1076,18 @@ type Channel = {
1089
1076
  name: string;
1090
1077
  };
1091
1078
  type Hooks = {
1092
- user?: (data: User) => string;
1093
- channel?: (data: Channel) => string;
1094
- atChannel?: (data: {
1095
- name: string;
1096
- }) => string;
1097
- usergroup?: (data: Channel) => string;
1098
- atEveryone?: (data: {
1099
- name: string;
1100
- }) => string;
1101
- atHere?: (data: {
1102
- name: string;
1103
- }) => string;
1079
+ user?: (data: User) => ReactNode;
1080
+ channel?: (data: Channel) => ReactNode;
1081
+ atChannel?: () => ReactNode;
1082
+ atEveryone?: () => ReactNode;
1083
+ atHere?: () => ReactNode;
1084
+ usergroup?: (data: Channel) => ReactNode;
1104
1085
  date?: (data: {
1105
1086
  timestamp: string;
1106
1087
  format: string;
1107
1088
  link?: string | undefined;
1108
1089
  fallback: string;
1109
- }) => string;
1090
+ }) => ReactNode;
1110
1091
  };
1111
1092
  type Data = {
1112
1093
  users: User[];
package/dist/index.d.ts CHANGED
@@ -1,3 +1,5 @@
1
+ import { ReactNode } from 'react';
2
+
1
3
  type Element = ButtonElement | CheckboxesElement | DatePickerElement | DateTimePickerElement | EmailInputElement | ImageElement | MultiStaticSelectElement | MultiExternalSelectElement | MultiUsersSelectElement | MultiConversationsSelectElement | MultiChannelsSelectElement | NumberInputElement | OverflowMenuElement | PlainTextInputElement | RadioButtonsElement | StaticSelectElement | ExternalSelectElement | UsersSelectElement | ConversationsSelectElement | ChannelsSelectElement | TimePickerElement | UrlTextInputElement;
2
4
  type ButtonElement = {
3
5
  type: "button";
@@ -713,7 +715,7 @@ type RichTextList = {
713
715
  };
714
716
  type RichTextPreformatted = {
715
717
  type: "rich_text_preformatted";
716
- elements: AnyRichTextSectionElement[];
718
+ elements: RichTextSectionElement[];
717
719
  /**
718
720
  * 0 or 1 (default 0) - if 1, a border is drawn on the left side of the block.
719
721
  */
@@ -721,7 +723,7 @@ type RichTextPreformatted = {
721
723
  };
722
724
  type RichTextQuote = {
723
725
  type: "rich_text_quote";
724
- elements: AnyRichTextSectionElement[];
726
+ elements: RichTextSectionElement[];
725
727
  /**
726
728
  * 0 or 1 (default 0) - if 1, a border is drawn on the left side of the block.
727
729
  */
@@ -729,69 +731,54 @@ type RichTextQuote = {
729
731
  };
730
732
  type RichTextSection = {
731
733
  type: "rich_text_section";
732
- elements: AnyRichTextSectionElement[];
734
+ elements: RichTextSectionElement[];
733
735
  };
734
- type AnyRichTextBlockElement = RichTextList | RichTextPreformatted | RichTextQuote | RichTextSection;
735
- type AnyRichTextSectionElement = RichTextSectionText | RichTextSectionChannel | RichTextSectionUser | RichTextSectionEmoji | RichTextSectionLink | RichTextSectionTeam | RichTextSectionUsergroup | RichTextSectionDate | RichTextSectionBroadcast | RichTextSectionColor;
736
- interface RichTextSectionElement {
737
- type: "text" | "channel" | "user" | "emoji" | "link" | "team" | "usergroup" | "date" | "broadcast" | "color";
738
- style?: RichTextSectionElementStyle;
739
- }
740
- interface RichTextSectionText extends RichTextSectionElement {
736
+ type RichTextBlockElement = RichTextList | RichTextPreformatted | RichTextQuote | RichTextSection;
737
+ type RichTextSectionElement = RichTextSectionText | RichTextSectionChannel | RichTextSectionUser | RichTextSectionEmoji | RichTextSectionLink | RichTextSectionUsergroup | RichTextSectionBroadcast;
738
+ type RichTextSectionText = {
741
739
  type: "text";
742
740
  text: string;
743
741
  style?: RichTextSectionElementStyleWithCode;
744
- }
745
- interface RichTextSectionChannel extends RichTextSectionElement {
742
+ };
743
+ type RichTextSectionChannel = {
746
744
  type: "channel";
747
745
  channel_id: string;
748
- }
749
- interface RichTextSectionUser extends RichTextSectionElement {
746
+ style?: RichTextSectionElementStyleWithCode;
747
+ };
748
+ type RichTextSectionUser = {
750
749
  type: "user";
751
750
  user_id: string;
752
- }
753
- interface RichTextSectionEmoji extends RichTextSectionElement {
751
+ style?: RichTextSectionElementStyleWithCode;
752
+ };
753
+ type RichTextSectionEmoji = {
754
754
  type: "emoji";
755
755
  name: string;
756
756
  skin_tone?: number;
757
757
  unicode?: string;
758
- }
759
- interface RichTextSectionLink extends RichTextSectionElement {
758
+ style?: RichTextSectionElementStyleWithCode;
759
+ };
760
+ type RichTextSectionLink = {
760
761
  type: "link";
761
762
  url: string;
762
763
  text: string;
763
764
  style?: RichTextSectionElementStyleWithCode;
764
- }
765
- interface RichTextSectionTeam extends RichTextSectionElement {
766
- type: "team";
767
- team_id: string;
768
- }
769
- interface RichTextSectionUsergroup extends RichTextSectionElement {
765
+ };
766
+ type RichTextSectionUsergroup = {
770
767
  type: "usergroup";
771
768
  usergroup_id: string;
772
- }
773
- interface RichTextSectionDate extends RichTextSectionElement {
774
- type: "date";
775
- timestamp: number;
776
- format: string;
777
769
  style?: RichTextSectionElementStyleWithCode;
778
- }
779
- interface RichTextSectionBroadcast extends RichTextSectionElement {
770
+ };
771
+ type RichTextSectionBroadcast = {
780
772
  type: "broadcast";
781
773
  range: "channel" | "here" | "everyone";
782
- }
783
- interface RichTextSectionColor extends RichTextSectionElement {
784
- type: "color";
785
- value: string;
786
- }
787
- interface RichTextSectionElementStyle {
774
+ style?: RichTextSectionElementStyleWithCode;
775
+ };
776
+ type RichTextSectionElementStyleWithCode = {
777
+ code?: boolean;
788
778
  bold?: boolean;
789
779
  italic?: boolean;
790
780
  strike?: boolean;
791
- }
792
- interface RichTextSectionElementStyleWithCode extends RichTextSectionElementStyle {
793
- code?: boolean;
794
- }
781
+ };
795
782
 
796
783
  type Block = ActionsBlock | ContextBlock | DividerBlock | FileBlock | HeaderBlock | ImageBlock | InputBlock | SectionBlock | VideoBlock | RichTextBlock;
797
784
  type ActionsBlock = {
@@ -1077,7 +1064,7 @@ type RichTextBlock = {
1077
1064
  /**
1078
1065
  * An array of rich text objects - rich_text_section, rich_text_list, rich_text_preformatted, and rich_text_quote. See your specific desired element below for more details.
1079
1066
  */
1080
- elements: AnyRichTextBlockElement[];
1067
+ elements: RichTextBlockElement[];
1081
1068
  };
1082
1069
 
1083
1070
  type User = {
@@ -1089,24 +1076,18 @@ type Channel = {
1089
1076
  name: string;
1090
1077
  };
1091
1078
  type Hooks = {
1092
- user?: (data: User) => string;
1093
- channel?: (data: Channel) => string;
1094
- atChannel?: (data: {
1095
- name: string;
1096
- }) => string;
1097
- usergroup?: (data: Channel) => string;
1098
- atEveryone?: (data: {
1099
- name: string;
1100
- }) => string;
1101
- atHere?: (data: {
1102
- name: string;
1103
- }) => string;
1079
+ user?: (data: User) => ReactNode;
1080
+ channel?: (data: Channel) => ReactNode;
1081
+ atChannel?: () => ReactNode;
1082
+ atEveryone?: () => ReactNode;
1083
+ atHere?: () => ReactNode;
1084
+ usergroup?: (data: Channel) => ReactNode;
1104
1085
  date?: (data: {
1105
1086
  timestamp: string;
1106
1087
  format: string;
1107
1088
  link?: string | undefined;
1108
1089
  fallback: string;
1109
- }) => string;
1090
+ }) => ReactNode;
1110
1091
  };
1111
1092
  type Data = {
1112
1093
  users: User[];