slackblock 0.4.0 → 1.0.0-0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +33 -26
- package/LICENSE +21 -21
- package/README.md +95 -85
- package/dist/block.cjs +341 -0
- package/dist/block.cjs.map +1 -0
- package/dist/block.d.mts +412 -0
- package/dist/block.d.ts +412 -0
- package/dist/block.mjs +268 -0
- package/dist/block.mjs.map +1 -0
- package/dist/index.cjs +1202 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.mts +6 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.mjs +1170 -0
- package/dist/index.mjs.map +1 -0
- package/dist/types.d-DgQXbJte.d.mts +296 -0
- package/dist/types.d-DgQXbJte.d.ts +296 -0
- package/package.json +85 -135
- package/blocks.js +0 -12
- package/index.js +0 -7
- package/lib/components/block/button.js +0 -27
- package/lib/components/block/confirmation.js +0 -27
- package/lib/components/block/image.js +0 -27
- package/lib/components/block/text.js +0 -27
- package/lib/components/index.js +0 -42
- package/lib/components/input/date-picker.js +0 -27
- package/lib/components/input/option-group.js +0 -27
- package/lib/components/input/option.js +0 -27
- package/lib/components/input/overflow.js +0 -27
- package/lib/components/input/radio-group.js +0 -27
- package/lib/components/input/select.js +0 -34
- package/lib/components/input/text.js +0 -27
- package/lib/components/layout/actions.js +0 -27
- package/lib/components/layout/container.js +0 -27
- package/lib/components/layout/context.js +0 -27
- package/lib/components/layout/divider.js +0 -27
- package/lib/components/layout/file.js +0 -27
- package/lib/components/layout/image.js +0 -27
- package/lib/components/layout/input.js +0 -27
- package/lib/components/layout/section.js +0 -27
- package/lib/components/message.js +0 -27
- package/lib/index.js +0 -7
- package/lib/parser/index.js +0 -32
- package/lib/renderer/index.js +0 -71
- package/lib/transformers/block/button.js +0 -29
- package/lib/transformers/block/confirmation.js +0 -18
- package/lib/transformers/block/image.js +0 -10
- package/lib/transformers/block/text.js +0 -16
- package/lib/transformers/index.js +0 -54
- package/lib/transformers/input/date-picker.js +0 -30
- package/lib/transformers/input/option-group.js +0 -19
- package/lib/transformers/input/option.js +0 -19
- package/lib/transformers/input/overflow.js +0 -19
- package/lib/transformers/input/radio-group.js +0 -22
- package/lib/transformers/input/select.js +0 -84
- package/lib/transformers/input/text.js +0 -31
- package/lib/transformers/layout/actions.js +0 -18
- package/lib/transformers/layout/container.js +0 -11
- package/lib/transformers/layout/context.js +0 -18
- package/lib/transformers/layout/divider.js +0 -10
- package/lib/transformers/layout/file.js +0 -14
- package/lib/transformers/layout/image.js +0 -23
- package/lib/transformers/layout/input.js +0 -26
- package/lib/transformers/layout/section.js +0 -31
- package/lib/utils/get-type.js +0 -16
- package/lib/utils/type-helpers.js +0 -2
- package/src/components/block/button.tsx +0 -20
- package/src/components/block/confirmation.tsx +0 -19
- package/src/components/block/image.tsx +0 -8
- package/src/components/block/text.tsx +0 -10
- package/src/components/index.ts +0 -23
- package/src/components/input/date-picker.tsx +0 -11
- package/src/components/input/option-group.tsx +0 -9
- package/src/components/input/option.tsx +0 -9
- package/src/components/input/overflow.tsx +0 -12
- package/src/components/input/radio-group.tsx +0 -13
- package/src/components/input/select.tsx +0 -36
- package/src/components/input/text.tsx +0 -12
- package/src/components/layout/actions.tsx +0 -9
- package/src/components/layout/container.tsx +0 -9
- package/src/components/layout/context.tsx +0 -12
- package/src/components/layout/divider.tsx +0 -7
- package/src/components/layout/file.tsx +0 -8
- package/src/components/layout/image.tsx +0 -10
- package/src/components/layout/input.tsx +0 -12
- package/src/components/layout/section.tsx +0 -15
- package/src/components/message.tsx +0 -20
- package/src/constants/types.d.ts +0 -93
- package/src/index.ts +0 -3
- package/src/parser/index.ts +0 -32
- package/src/renderer/index.ts +0 -75
- package/src/transformers/block/button.tsx +0 -47
- package/src/transformers/block/confirmation.tsx +0 -26
- package/src/transformers/block/image.ts +0 -18
- package/src/transformers/block/text.ts +0 -34
- package/src/transformers/index.ts +0 -65
- package/src/transformers/input/date-picker.tsx +0 -43
- package/src/transformers/input/option-group.tsx +0 -26
- package/src/transformers/input/option.tsx +0 -27
- package/src/transformers/input/overflow.ts +0 -33
- package/src/transformers/input/radio-group.ts +0 -38
- package/src/transformers/input/select.tsx +0 -136
- package/src/transformers/input/text.tsx +0 -47
- package/src/transformers/layout/actions.ts +0 -29
- package/src/transformers/layout/container.ts +0 -16
- package/src/transformers/layout/context.ts +0 -35
- package/src/transformers/layout/divider.ts +0 -20
- package/src/transformers/layout/file.ts +0 -24
- package/src/transformers/layout/image.tsx +0 -34
- package/src/transformers/layout/input.tsx +0 -39
- package/src/transformers/layout/section.ts +0 -53
- package/src/tsconfig.json +0 -11
- package/src/utils/get-type.ts +0 -20
- package/src/utils/type-helpers.ts +0 -1
- package/test/index.test.tsx +0 -11
- package/test/parser/parser.test.tsx +0 -67
- package/test/renderer/renderer.test.tsx +0 -138
- package/test/transformers/block/button.test.tsx +0 -63
- package/test/transformers/block/confirmation.test.tsx +0 -37
- package/test/transformers/block/image.test.tsx +0 -20
- package/test/transformers/block/text.test.tsx +0 -32
- package/test/transformers/input/date-picker.test.tsx +0 -66
- package/test/transformers/input/option-group.test.tsx +0 -26
- package/test/transformers/input/option.test.tsx +0 -36
- package/test/transformers/input/overflow.test.tsx +0 -57
- package/test/transformers/input/radio-group.test.tsx +0 -81
- package/test/transformers/input/select.test.tsx +0 -249
- package/test/transformers/input/text.test.tsx +0 -42
- package/test/transformers/layout/actions.test.tsx +0 -33
- package/test/transformers/layout/container.test.tsx +0 -34
- package/test/transformers/layout/context.test.tsx +0 -43
- package/test/transformers/layout/divider.test.tsx +0 -20
- package/test/transformers/layout/file.test.tsx +0 -26
- package/test/transformers/layout/image.test.tsx +0 -43
- package/test/transformers/layout/input.test.tsx +0 -59
- package/test/transformers/layout/section.test.tsx +0 -89
- package/test/tsconfig.json +0 -9
- package/test/utils/get-type.test.tsx +0 -21
- package/tsconfig.json +0 -14
|
@@ -0,0 +1,296 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
|
|
3
|
+
type TextType$1 = {
|
|
4
|
+
type: 'plain_text' | 'mrkdwn';
|
|
5
|
+
text: string;
|
|
6
|
+
emoji?: boolean;
|
|
7
|
+
verbatim?: boolean;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
type TextType = {
|
|
11
|
+
type: 'plain_text_input';
|
|
12
|
+
action_id: string;
|
|
13
|
+
placeholder?: TextType$1;
|
|
14
|
+
initial_value?: string;
|
|
15
|
+
multiline?: boolean;
|
|
16
|
+
min_length?: number;
|
|
17
|
+
max_length?: number;
|
|
18
|
+
focus_on_load?: boolean;
|
|
19
|
+
dispatch_action_config?: {
|
|
20
|
+
trigger_actions_on: Array<'on_enter_pressed' | 'on_character_entered'>;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
type ConfirmationType = {
|
|
25
|
+
title: TextType$1;
|
|
26
|
+
text: TextType$1;
|
|
27
|
+
confirm: TextType$1;
|
|
28
|
+
deny: TextType$1;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
type DatePickerType = {
|
|
32
|
+
type: 'datepicker';
|
|
33
|
+
action_id: string;
|
|
34
|
+
placeholder?: TextType$1;
|
|
35
|
+
initial_date?: string;
|
|
36
|
+
confirm?: ConfirmationType;
|
|
37
|
+
focus_on_load?: boolean;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
type OptionType = {
|
|
41
|
+
text: TextType$1;
|
|
42
|
+
value: string;
|
|
43
|
+
description?: TextType$1;
|
|
44
|
+
url?: string;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
type OptionGroupType = {
|
|
48
|
+
label: TextType$1;
|
|
49
|
+
options: OptionType[];
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
type ValidSelectType = 'static_select' | 'multi_static_select' | 'external_select' | 'multi_external_select' | 'users_select' | 'multi_users_select' | 'conversations_select' | 'multi_conversations_select' | 'channels_select' | 'multi_channels_select';
|
|
53
|
+
type SelectType = {
|
|
54
|
+
type: ValidSelectType;
|
|
55
|
+
placeholder: TextType$1;
|
|
56
|
+
action_id: string;
|
|
57
|
+
options?: OptionType[];
|
|
58
|
+
option_groups?: OptionGroupType[];
|
|
59
|
+
initial_option?: OptionType;
|
|
60
|
+
initial_options?: OptionType[];
|
|
61
|
+
confirm?: ConfirmationType;
|
|
62
|
+
max_selected_items?: number;
|
|
63
|
+
min_query_length?: number;
|
|
64
|
+
focus_on_load?: boolean;
|
|
65
|
+
initial_user?: string;
|
|
66
|
+
initial_users?: string[];
|
|
67
|
+
initial_conversation?: string;
|
|
68
|
+
initial_conversations?: string[];
|
|
69
|
+
initial_channel?: string;
|
|
70
|
+
initial_channels?: string[];
|
|
71
|
+
default_to_current_conversation?: boolean;
|
|
72
|
+
response_url_enabled?: boolean;
|
|
73
|
+
filter?: {
|
|
74
|
+
include?: Array<'im' | 'mpim' | 'private' | 'public'>;
|
|
75
|
+
exclude_external_shared_channels?: boolean;
|
|
76
|
+
exclude_bot_users?: boolean;
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
type CheckboxesType = {
|
|
81
|
+
type: 'checkboxes';
|
|
82
|
+
action_id: string;
|
|
83
|
+
options: OptionType[];
|
|
84
|
+
initial_options?: OptionType[];
|
|
85
|
+
confirm?: ConfirmationType;
|
|
86
|
+
focus_on_load?: boolean;
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
type TimePickerType = {
|
|
90
|
+
type: 'timepicker';
|
|
91
|
+
action_id: string;
|
|
92
|
+
placeholder?: TextType$1;
|
|
93
|
+
initial_time?: string;
|
|
94
|
+
confirm?: ConfirmationType;
|
|
95
|
+
focus_on_load?: boolean;
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
type DateTimePickerType = {
|
|
99
|
+
type: 'datetimepicker';
|
|
100
|
+
action_id: string;
|
|
101
|
+
initial_date_time?: number;
|
|
102
|
+
confirm?: ConfirmationType;
|
|
103
|
+
focus_on_load?: boolean;
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
type OverflowType = {
|
|
107
|
+
type: 'overflow';
|
|
108
|
+
action_id: string;
|
|
109
|
+
options: OptionType[];
|
|
110
|
+
confirm?: ConfirmationType;
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
type RadioGroupType = {
|
|
114
|
+
type: 'radio_buttons';
|
|
115
|
+
action_id: string;
|
|
116
|
+
options: OptionType[];
|
|
117
|
+
initial_option?: OptionType;
|
|
118
|
+
confirm?: ConfirmationType;
|
|
119
|
+
focus_on_load?: boolean;
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
type ImageType$1 = {
|
|
123
|
+
type: 'image';
|
|
124
|
+
image_url: string;
|
|
125
|
+
alt_text: string;
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
type ButtonType = {
|
|
129
|
+
type: 'button';
|
|
130
|
+
text: TextType$1;
|
|
131
|
+
action_id: string;
|
|
132
|
+
url?: string;
|
|
133
|
+
value?: string;
|
|
134
|
+
style?: 'primary' | 'danger';
|
|
135
|
+
confirm?: ConfirmationType;
|
|
136
|
+
accessibility_label?: string;
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
type ActionType = {
|
|
140
|
+
type: 'actions';
|
|
141
|
+
elements: SerializedInteractiveBlockElement[];
|
|
142
|
+
block_id?: string;
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
type ImageOrText = ImageType$1 | TextType$1;
|
|
146
|
+
type ContextType = {
|
|
147
|
+
type: 'context';
|
|
148
|
+
elements: ImageOrText | ImageOrText[];
|
|
149
|
+
block_id?: string;
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
type DividerType = {
|
|
153
|
+
type: 'divider';
|
|
154
|
+
block_id?: string;
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
type FileType = {
|
|
158
|
+
type: 'file';
|
|
159
|
+
source: 'remote';
|
|
160
|
+
external_id: string;
|
|
161
|
+
block_id?: string;
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
type HeaderType = {
|
|
165
|
+
type: 'header';
|
|
166
|
+
text: TextType$1;
|
|
167
|
+
block_id?: string;
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
type ImageType = {
|
|
171
|
+
type: 'image';
|
|
172
|
+
image_url: string;
|
|
173
|
+
alt_text: string;
|
|
174
|
+
title?: TextType$1;
|
|
175
|
+
block_id?: string;
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
type InputType = {
|
|
179
|
+
type: 'input';
|
|
180
|
+
label: TextType$1;
|
|
181
|
+
element: SerializedInputBlockElement;
|
|
182
|
+
hint?: TextType$1;
|
|
183
|
+
optional?: boolean;
|
|
184
|
+
block_id?: string;
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
type RichTextType = {
|
|
188
|
+
type: 'rich_text';
|
|
189
|
+
elements: Array<Record<string, unknown>>;
|
|
190
|
+
block_id?: string;
|
|
191
|
+
};
|
|
192
|
+
|
|
193
|
+
type SectionType = {
|
|
194
|
+
type: 'section';
|
|
195
|
+
text: TextType$1;
|
|
196
|
+
block_id?: string;
|
|
197
|
+
fields?: TextType$1[];
|
|
198
|
+
accessory?: SerializedBlockElement;
|
|
199
|
+
};
|
|
200
|
+
|
|
201
|
+
type VideoType = {
|
|
202
|
+
type: 'video';
|
|
203
|
+
title: TextType$1;
|
|
204
|
+
video_url: string;
|
|
205
|
+
thumbnail_url: string;
|
|
206
|
+
alt_text: string;
|
|
207
|
+
title_url?: string;
|
|
208
|
+
description?: TextType$1;
|
|
209
|
+
author_name?: string;
|
|
210
|
+
provider_name?: string;
|
|
211
|
+
provider_icon_url?: string;
|
|
212
|
+
block_id?: string;
|
|
213
|
+
};
|
|
214
|
+
|
|
215
|
+
type ImageBlockType = ImageType$1 | ImageType;
|
|
216
|
+
|
|
217
|
+
type SerializedInputBlockElement =
|
|
218
|
+
| TextType
|
|
219
|
+
| DatePickerType
|
|
220
|
+
| DateTimePickerType
|
|
221
|
+
| TimePickerType
|
|
222
|
+
| CheckboxesType
|
|
223
|
+
| SelectType
|
|
224
|
+
| OverflowType
|
|
225
|
+
| RadioGroupType;
|
|
226
|
+
|
|
227
|
+
type SerializedInteractiveBlockElement =
|
|
228
|
+
| ButtonType
|
|
229
|
+
| SerializedInputBlockElement;
|
|
230
|
+
|
|
231
|
+
type SerializedBlockElement =
|
|
232
|
+
| TextType$1
|
|
233
|
+
| ImageBlockType
|
|
234
|
+
| ConfirmationType
|
|
235
|
+
| SerializedInteractiveBlockElement;
|
|
236
|
+
|
|
237
|
+
type SerializedBlock =
|
|
238
|
+
| SectionType
|
|
239
|
+
| ActionType
|
|
240
|
+
| ContextType
|
|
241
|
+
| DividerType
|
|
242
|
+
| FileType
|
|
243
|
+
| HeaderType
|
|
244
|
+
| ImageBlockType
|
|
245
|
+
| InputType
|
|
246
|
+
| RichTextType
|
|
247
|
+
| VideoType;
|
|
248
|
+
|
|
249
|
+
type Block = SerializedBlock;
|
|
250
|
+
type Attachment = {
|
|
251
|
+
color: string;
|
|
252
|
+
blocks: Block[];
|
|
253
|
+
};
|
|
254
|
+
|
|
255
|
+
type InteractiveBlockElement = ReactElement<any, any>;
|
|
256
|
+
type StandardBlockElement = ReactElement<any, any>;
|
|
257
|
+
|
|
258
|
+
type InputBlockElement = ReactElement<any, any>;
|
|
259
|
+
type BlockElement = InteractiveBlockElement | StandardBlockElement | InputBlockElement;
|
|
260
|
+
|
|
261
|
+
type SlackMessage = {
|
|
262
|
+
text?: string;
|
|
263
|
+
as_user?: boolean;
|
|
264
|
+
blocks?: Block[];
|
|
265
|
+
attachments?: Attachment[];
|
|
266
|
+
icon_emoji?: string;
|
|
267
|
+
icon_url?: string;
|
|
268
|
+
link_names?: boolean;
|
|
269
|
+
mrkdwn?: boolean;
|
|
270
|
+
parse?: 'full' | 'none';
|
|
271
|
+
reply_broadcast?: boolean;
|
|
272
|
+
thread_ts?: string;
|
|
273
|
+
unfurl_links?: boolean;
|
|
274
|
+
unfurl_media?: boolean;
|
|
275
|
+
username?: string;
|
|
276
|
+
};
|
|
277
|
+
|
|
278
|
+
type AnyFunction = (...parameters: any[]) => any;
|
|
279
|
+
|
|
280
|
+
type AnyConstructor = new (...parameters: any[]) => any;
|
|
281
|
+
|
|
282
|
+
type WithType = {
|
|
283
|
+
type?: string | AnyFunction | AnyConstructor;
|
|
284
|
+
};
|
|
285
|
+
type BElement = ReactElement<any, any> & WithType;
|
|
286
|
+
type Element = BElement;
|
|
287
|
+
type Child =
|
|
288
|
+
| string
|
|
289
|
+
| Element
|
|
290
|
+
| Child[]
|
|
291
|
+
| boolean
|
|
292
|
+
| undefined
|
|
293
|
+
// eslint-disable-next-line @typescript-eslint/no-restricted-types -- React children can be null.
|
|
294
|
+
| null;
|
|
295
|
+
|
|
296
|
+
export type { BlockElement as B, Child as C, Element as E, InteractiveBlockElement as I, SlackMessage as S, InputBlockElement as a };
|
package/package.json
CHANGED
|
@@ -1,135 +1,85 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "slackblock",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "
|
|
5
|
-
"
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
"
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
"
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
"
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
"
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"xo": "^0.
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
"xo
|
|
73
|
-
]
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
"
|
|
78
|
-
"
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
"
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
],
|
|
87
|
-
"@typescript-eslint/member-naming": [
|
|
88
|
-
"error",
|
|
89
|
-
{
|
|
90
|
-
"private": "^__",
|
|
91
|
-
"protected": "^_"
|
|
92
|
-
}
|
|
93
|
-
],
|
|
94
|
-
"indent": 0,
|
|
95
|
-
"@typescript-eslint/indent": [
|
|
96
|
-
"error",
|
|
97
|
-
2
|
|
98
|
-
]
|
|
99
|
-
},
|
|
100
|
-
"settings": {
|
|
101
|
-
"react": {
|
|
102
|
-
"version": "16.5"
|
|
103
|
-
}
|
|
104
|
-
},
|
|
105
|
-
"env": [
|
|
106
|
-
"node"
|
|
107
|
-
],
|
|
108
|
-
"include": [
|
|
109
|
-
"**/*.ts?(x)"
|
|
110
|
-
],
|
|
111
|
-
"ignore": [
|
|
112
|
-
"*.js"
|
|
113
|
-
]
|
|
114
|
-
},
|
|
115
|
-
"ava": {
|
|
116
|
-
"compileEnhancements": false,
|
|
117
|
-
"extensions": [
|
|
118
|
-
"ts",
|
|
119
|
-
"tsx"
|
|
120
|
-
],
|
|
121
|
-
"files": [
|
|
122
|
-
"test/**/*.test.ts?(x)"
|
|
123
|
-
],
|
|
124
|
-
"helpers": [
|
|
125
|
-
"test/helpers/**/*.ts"
|
|
126
|
-
],
|
|
127
|
-
"require": [
|
|
128
|
-
"ts-node/register",
|
|
129
|
-
"tsconfig-paths/register"
|
|
130
|
-
]
|
|
131
|
-
},
|
|
132
|
-
"dependencies": {
|
|
133
|
-
"react": "^16.12.0"
|
|
134
|
-
}
|
|
135
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "slackblock",
|
|
3
|
+
"version": "1.0.0-0",
|
|
4
|
+
"description": "JSX-based Slack message renderer",
|
|
5
|
+
"engines": {
|
|
6
|
+
"node": ">=24"
|
|
7
|
+
},
|
|
8
|
+
"main": "dist/index.cjs",
|
|
9
|
+
"module": "dist/index.mjs",
|
|
10
|
+
"types": "dist/index.d.ts",
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"types": "./dist/index.d.ts",
|
|
14
|
+
"import": "./dist/index.mjs",
|
|
15
|
+
"require": "./dist/index.cjs",
|
|
16
|
+
"default": "./dist/index.cjs"
|
|
17
|
+
},
|
|
18
|
+
"./block": {
|
|
19
|
+
"types": "./dist/block.d.ts",
|
|
20
|
+
"import": "./dist/block.mjs",
|
|
21
|
+
"require": "./dist/block.cjs",
|
|
22
|
+
"default": "./dist/block.cjs"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"files": [
|
|
26
|
+
"dist",
|
|
27
|
+
"README.md",
|
|
28
|
+
"LICENSE",
|
|
29
|
+
"CHANGELOG.md"
|
|
30
|
+
],
|
|
31
|
+
"repository": {
|
|
32
|
+
"type": "git",
|
|
33
|
+
"url": "git+https://github.com/kolyaventuri/block.git"
|
|
34
|
+
},
|
|
35
|
+
"keywords": [
|
|
36
|
+
"react",
|
|
37
|
+
"slack",
|
|
38
|
+
"message",
|
|
39
|
+
"bot"
|
|
40
|
+
],
|
|
41
|
+
"author": "Kolya Venturi <me@kolya.co>",
|
|
42
|
+
"license": "MIT",
|
|
43
|
+
"bugs": {
|
|
44
|
+
"url": "https://github.com/kolyaventuri/block/issues"
|
|
45
|
+
},
|
|
46
|
+
"homepage": "https://github.com/kolyaventuri/block#readme",
|
|
47
|
+
"devDependencies": {
|
|
48
|
+
"@types/node": "25.0.10",
|
|
49
|
+
"@types/react": "^19.2.9",
|
|
50
|
+
"@typescript-eslint/eslint-plugin": "^8.53.1",
|
|
51
|
+
"@typescript-eslint/parser": "^8.53.1",
|
|
52
|
+
"eslint": "^9.39.2",
|
|
53
|
+
"eslint-config-xo": "^0.49.0",
|
|
54
|
+
"eslint-config-xo-react": "^0.29.0",
|
|
55
|
+
"eslint-config-xo-typescript": "^9.0.0",
|
|
56
|
+
"eslint-plugin-react": "^7.37.5",
|
|
57
|
+
"eslint-plugin-react-hooks": "^7.0.1",
|
|
58
|
+
"husky": "^9.1.7",
|
|
59
|
+
"lint-staged": "^16.2.7",
|
|
60
|
+
"react": "^19.2.3",
|
|
61
|
+
"rimraf": "^6.1.2",
|
|
62
|
+
"tsup": "^8.5.1",
|
|
63
|
+
"typescript": "^5.9.3",
|
|
64
|
+
"vitest": "^4.0.18",
|
|
65
|
+
"xo": "^1.2.3"
|
|
66
|
+
},
|
|
67
|
+
"peerDependencies": {
|
|
68
|
+
"react": "^16.14.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
|
|
69
|
+
},
|
|
70
|
+
"lint-staged": {
|
|
71
|
+
"*.{ts,tsx}": [
|
|
72
|
+
"xo"
|
|
73
|
+
]
|
|
74
|
+
},
|
|
75
|
+
"dependencies": {},
|
|
76
|
+
"scripts": {
|
|
77
|
+
"test": "pnpm run test:tsc && pnpm run test:lint && pnpm run test:unit",
|
|
78
|
+
"test:tsc": "tsc -p ./src -p ./test --noEmit",
|
|
79
|
+
"test:lint": "xo",
|
|
80
|
+
"test:unit": "vitest run",
|
|
81
|
+
"prebuild": "rimraf dist",
|
|
82
|
+
"build": "tsup",
|
|
83
|
+
"prepublish": "pnpm run test && pnpm run build"
|
|
84
|
+
}
|
|
85
|
+
}
|
package/blocks.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
var __importdefault = (this && this.__importdefault) || function (mod) {
|
|
2
|
-
return (mod && mod.__esmodule) ? mod : { "default": mod };
|
|
3
|
-
};
|
|
4
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
|
|
6
|
-
var _blocks = __importdefault(require('./lib/components')).default;
|
|
7
|
-
var _blockNames = Object.keys(_blocks);
|
|
8
|
-
|
|
9
|
-
for (var i = 0; i < _blockNames.length; i++) {
|
|
10
|
-
var _name = _blockNames[i];
|
|
11
|
-
exports[_name] = _blocks[_name];
|
|
12
|
-
}
|
package/index.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
var __importdefault = (this && this.__importdefault) || function (mod) {
|
|
2
|
-
return (mod && mod.__esmodule) ? mod : { "default": mod };
|
|
3
|
-
};
|
|
4
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
|
|
6
|
-
var renderer = __importdefault(require('./lib')).default;
|
|
7
|
-
exports.default = renderer.default;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
extendStatics(d, b);
|
|
11
|
-
function __() { this.constructor = d; }
|
|
12
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
13
|
-
};
|
|
14
|
-
})();
|
|
15
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
16
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
17
|
-
};
|
|
18
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
var react_1 = __importDefault(require("react"));
|
|
20
|
-
var Button = (function (_super) {
|
|
21
|
-
__extends(Button, _super);
|
|
22
|
-
function Button() {
|
|
23
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
24
|
-
}
|
|
25
|
-
return Button;
|
|
26
|
-
}(react_1.default.Component));
|
|
27
|
-
exports.default = Button;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
extendStatics(d, b);
|
|
11
|
-
function __() { this.constructor = d; }
|
|
12
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
13
|
-
};
|
|
14
|
-
})();
|
|
15
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
16
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
17
|
-
};
|
|
18
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
var react_1 = __importDefault(require("react"));
|
|
20
|
-
var Confirmation = (function (_super) {
|
|
21
|
-
__extends(Confirmation, _super);
|
|
22
|
-
function Confirmation() {
|
|
23
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
24
|
-
}
|
|
25
|
-
return Confirmation;
|
|
26
|
-
}(react_1.default.Component));
|
|
27
|
-
exports.default = Confirmation;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
extendStatics(d, b);
|
|
11
|
-
function __() { this.constructor = d; }
|
|
12
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
13
|
-
};
|
|
14
|
-
})();
|
|
15
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
16
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
17
|
-
};
|
|
18
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
var react_1 = __importDefault(require("react"));
|
|
20
|
-
var Image = (function (_super) {
|
|
21
|
-
__extends(Image, _super);
|
|
22
|
-
function Image() {
|
|
23
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
24
|
-
}
|
|
25
|
-
return Image;
|
|
26
|
-
}(react_1.default.Component));
|
|
27
|
-
exports.default = Image;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
extendStatics(d, b);
|
|
11
|
-
function __() { this.constructor = d; }
|
|
12
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
13
|
-
};
|
|
14
|
-
})();
|
|
15
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
16
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
17
|
-
};
|
|
18
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
var react_1 = __importDefault(require("react"));
|
|
20
|
-
var Text = (function (_super) {
|
|
21
|
-
__extends(Text, _super);
|
|
22
|
-
function Text() {
|
|
23
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
24
|
-
}
|
|
25
|
-
return Text;
|
|
26
|
-
}(react_1.default.Component));
|
|
27
|
-
exports.default = Text;
|