slack-blocks-to-jsx 0.5.4 → 0.5.6

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,54 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { ReactNode, ComponentPropsWithoutRef } from 'react';
3
-
4
- type User = {
5
- id: string;
6
- name: string;
7
- };
8
- type Channel = {
9
- id: string;
10
- name: string;
11
- };
12
- type UserGroup = {
13
- id: string;
14
- name: string;
15
- };
16
- type Emoji = {
17
- name: string;
18
- unicode?: string;
19
- skin_tone?: 1 | 2 | 3 | 4 | 5 | 6;
20
- };
21
- type Hooks = {
22
- user?: (data: User) => ReactNode;
23
- channel?: (data: Channel) => ReactNode;
24
- usergroup?: (data: UserGroup) => ReactNode;
25
- atChannel?: () => ReactNode;
26
- atEveryone?: () => ReactNode;
27
- atHere?: () => ReactNode;
28
- /**
29
- * The hook to replace emojis with custom components
30
- * @param data - the emoji object
31
- * @param parse - fallback function for default emoji parsing
32
- * @returns the custom emoji component
33
- */
34
- emoji?: (data: Emoji, parse: (data: Emoji) => string) => ReactNode;
35
- date?: (data: {
36
- timestamp: string;
37
- format: string;
38
- link: string | null;
39
- fallback: string;
40
- }) => ReactNode;
41
- };
42
- type GlobalStore = {
43
- users: User[];
44
- channels: Channel[];
45
- user_groups: UserGroup[];
46
- hooks: Hooks;
47
- setUsers: (users: User[]) => void;
48
- setChannels: (channels: Channel[]) => void;
49
- setUserGroups: (userGroups: UserGroup[]) => void;
50
- setHooks: (hooks: Hooks) => void;
51
- };
2
+ import { ComponentPropsWithoutRef, ReactNode } from 'react';
52
3
 
53
4
  type Element = ButtonElement | CheckboxesElement | DatePickerElement | DateTimePickerElement | EmailInputElement | ImageElement | MultiStaticSelectElement | MultiExternalSelectElement | MultiUsersSelectElement | MultiConversationsSelectElement | MultiChannelsSelectElement | NumberInputElement | OverflowMenuElement | PlainTextInputElement | RadioButtonsElement | StaticSelectElement | ExternalSelectElement | UsersSelectElement | ConversationsSelectElement | ChannelsSelectElement | TimePickerElement | UrlTextInputElement | RichTextBlockElement;
54
5
  type ButtonElement = {
@@ -1144,6 +1095,64 @@ type RichTextSectionElementStyleCode = {
1144
1095
  strike?: boolean;
1145
1096
  };
1146
1097
 
1098
+ type User = {
1099
+ id: string;
1100
+ name: string;
1101
+ };
1102
+ type UserWithStyle = User & {
1103
+ style?: RichTextSectionUser["style"];
1104
+ };
1105
+ type Channel = {
1106
+ id: string;
1107
+ name: string;
1108
+ };
1109
+ type ChannelWithStyle = Channel & {
1110
+ style?: RichTextSectionChannel["style"];
1111
+ };
1112
+ type UserGroup = {
1113
+ id: string;
1114
+ name: string;
1115
+ };
1116
+ type UserGroupWithStyle = UserGroup & {
1117
+ style?: RichTextSectionUsergroup["style"];
1118
+ };
1119
+ type Emoji = {
1120
+ name: string;
1121
+ unicode?: string;
1122
+ skin_tone?: 1 | 2 | 3 | 4 | 5 | 6;
1123
+ };
1124
+ type Hooks = {
1125
+ user?: (data: UserWithStyle) => ReactNode;
1126
+ channel?: (data: ChannelWithStyle) => ReactNode;
1127
+ usergroup?: (data: UserGroupWithStyle) => ReactNode;
1128
+ atChannel?: (style?: RichTextSectionBroadcast["style"]) => ReactNode;
1129
+ atEveryone?: (style?: RichTextSectionBroadcast["style"]) => ReactNode;
1130
+ atHere?: (style?: RichTextSectionBroadcast["style"]) => ReactNode;
1131
+ /**
1132
+ * The hook to replace emojis with custom components
1133
+ * @param data - the emoji object
1134
+ * @param parse - fallback function for default emoji parsing
1135
+ * @returns the custom emoji component
1136
+ */
1137
+ emoji?: (data: Emoji, parse: (data: Emoji) => string) => ReactNode;
1138
+ date?: (data: {
1139
+ timestamp: string;
1140
+ format: string;
1141
+ link: string | null;
1142
+ fallback: string;
1143
+ }) => ReactNode;
1144
+ };
1145
+ type GlobalStore = {
1146
+ users: User[];
1147
+ channels: Channel[];
1148
+ user_groups: UserGroup[];
1149
+ hooks: Hooks;
1150
+ setUsers: (users: User[]) => void;
1151
+ setChannels: (channels: Channel[]) => void;
1152
+ setUserGroups: (userGroups: UserGroup[]) => void;
1153
+ setHooks: (hooks: Hooks) => void;
1154
+ };
1155
+
1147
1156
  type Props = {
1148
1157
  /**
1149
1158
  * Not yet implemented.
package/dist/index.d.ts CHANGED
@@ -1,54 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { ReactNode, ComponentPropsWithoutRef } from 'react';
3
-
4
- type User = {
5
- id: string;
6
- name: string;
7
- };
8
- type Channel = {
9
- id: string;
10
- name: string;
11
- };
12
- type UserGroup = {
13
- id: string;
14
- name: string;
15
- };
16
- type Emoji = {
17
- name: string;
18
- unicode?: string;
19
- skin_tone?: 1 | 2 | 3 | 4 | 5 | 6;
20
- };
21
- type Hooks = {
22
- user?: (data: User) => ReactNode;
23
- channel?: (data: Channel) => ReactNode;
24
- usergroup?: (data: UserGroup) => ReactNode;
25
- atChannel?: () => ReactNode;
26
- atEveryone?: () => ReactNode;
27
- atHere?: () => ReactNode;
28
- /**
29
- * The hook to replace emojis with custom components
30
- * @param data - the emoji object
31
- * @param parse - fallback function for default emoji parsing
32
- * @returns the custom emoji component
33
- */
34
- emoji?: (data: Emoji, parse: (data: Emoji) => string) => ReactNode;
35
- date?: (data: {
36
- timestamp: string;
37
- format: string;
38
- link: string | null;
39
- fallback: string;
40
- }) => ReactNode;
41
- };
42
- type GlobalStore = {
43
- users: User[];
44
- channels: Channel[];
45
- user_groups: UserGroup[];
46
- hooks: Hooks;
47
- setUsers: (users: User[]) => void;
48
- setChannels: (channels: Channel[]) => void;
49
- setUserGroups: (userGroups: UserGroup[]) => void;
50
- setHooks: (hooks: Hooks) => void;
51
- };
2
+ import { ComponentPropsWithoutRef, ReactNode } from 'react';
52
3
 
53
4
  type Element = ButtonElement | CheckboxesElement | DatePickerElement | DateTimePickerElement | EmailInputElement | ImageElement | MultiStaticSelectElement | MultiExternalSelectElement | MultiUsersSelectElement | MultiConversationsSelectElement | MultiChannelsSelectElement | NumberInputElement | OverflowMenuElement | PlainTextInputElement | RadioButtonsElement | StaticSelectElement | ExternalSelectElement | UsersSelectElement | ConversationsSelectElement | ChannelsSelectElement | TimePickerElement | UrlTextInputElement | RichTextBlockElement;
54
5
  type ButtonElement = {
@@ -1144,6 +1095,64 @@ type RichTextSectionElementStyleCode = {
1144
1095
  strike?: boolean;
1145
1096
  };
1146
1097
 
1098
+ type User = {
1099
+ id: string;
1100
+ name: string;
1101
+ };
1102
+ type UserWithStyle = User & {
1103
+ style?: RichTextSectionUser["style"];
1104
+ };
1105
+ type Channel = {
1106
+ id: string;
1107
+ name: string;
1108
+ };
1109
+ type ChannelWithStyle = Channel & {
1110
+ style?: RichTextSectionChannel["style"];
1111
+ };
1112
+ type UserGroup = {
1113
+ id: string;
1114
+ name: string;
1115
+ };
1116
+ type UserGroupWithStyle = UserGroup & {
1117
+ style?: RichTextSectionUsergroup["style"];
1118
+ };
1119
+ type Emoji = {
1120
+ name: string;
1121
+ unicode?: string;
1122
+ skin_tone?: 1 | 2 | 3 | 4 | 5 | 6;
1123
+ };
1124
+ type Hooks = {
1125
+ user?: (data: UserWithStyle) => ReactNode;
1126
+ channel?: (data: ChannelWithStyle) => ReactNode;
1127
+ usergroup?: (data: UserGroupWithStyle) => ReactNode;
1128
+ atChannel?: (style?: RichTextSectionBroadcast["style"]) => ReactNode;
1129
+ atEveryone?: (style?: RichTextSectionBroadcast["style"]) => ReactNode;
1130
+ atHere?: (style?: RichTextSectionBroadcast["style"]) => ReactNode;
1131
+ /**
1132
+ * The hook to replace emojis with custom components
1133
+ * @param data - the emoji object
1134
+ * @param parse - fallback function for default emoji parsing
1135
+ * @returns the custom emoji component
1136
+ */
1137
+ emoji?: (data: Emoji, parse: (data: Emoji) => string) => ReactNode;
1138
+ date?: (data: {
1139
+ timestamp: string;
1140
+ format: string;
1141
+ link: string | null;
1142
+ fallback: string;
1143
+ }) => ReactNode;
1144
+ };
1145
+ type GlobalStore = {
1146
+ users: User[];
1147
+ channels: Channel[];
1148
+ user_groups: UserGroup[];
1149
+ hooks: Hooks;
1150
+ setUsers: (users: User[]) => void;
1151
+ setChannels: (channels: Channel[]) => void;
1152
+ setUserGroups: (userGroups: UserGroup[]) => void;
1153
+ setHooks: (hooks: Hooks) => void;
1154
+ };
1155
+
1147
1156
  type Props = {
1148
1157
  /**
1149
1158
  * Not yet implemented.