slackblock 2.0.0-beta.2 → 2.0.0-beta.3

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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.0.0-beta.3
4
+
5
+ ### Patch Changes
6
+
7
+ - fbb431b: Rendering updates to be more compatible
8
+
3
9
  ## 2.0.0-beta.2
4
10
 
5
11
  ### Patch Changes
package/README.md CHANGED
@@ -65,11 +65,12 @@ const message = render(
65
65
  <Button actionId="view_logs" url="https://example.com/logs">View logs</Button>
66
66
  <Button actionId="rollback" style="danger">Rollback</Button>
67
67
  </Actions>
68
- </Message>
68
+ </Message>,
69
+ { channel: 'C0123456789' },
69
70
  );
70
71
 
71
- // message is ready to postjust add your channel:
72
- await slackClient.chat.postMessage({ channel: '#deploys', ...message });
72
+ // message is typed as SlackPostMessagePayloadpass directly, no cast needed:
73
+ await slackClient.chat.postMessage(message);
73
74
  ```
74
75
 
75
76
  The rendered output is a plain object you can spread directly into `chat.postMessage`.
@@ -80,13 +81,22 @@ The rendered output is a plain object you can spread directly into `chat.postMes
80
81
 
81
82
  ### `render(element, options?)` — default export
82
83
 
83
- Renders a `<Message>` tree to a full Slack message payload.
84
+ Renders a `<Message>` tree to a full Slack message payload. The return type is narrowed automatically based on the options you pass:
84
85
 
85
86
  ```ts
86
87
  import render from 'slackblock';
87
88
 
88
- const message = render(<Message text="Hello">...</Message>);
89
- // { text: "Hello", blocks: [...] }
89
+ // No channel — BoltCompatiblePayload (for say/respond)
90
+ const msg = render(<Message text="Hello">...</Message>);
91
+ await say(msg);
92
+
93
+ // channel — SlackPostMessagePayload (directly usable with chat.postMessage)
94
+ const msg = render(<Message text="Hello">...</Message>, { channel: 'C0123456789' });
95
+ await client.chat.postMessage(msg); // no cast needed
96
+
97
+ // channel + user — SlackPostEphemeralPayload (directly usable with chat.postEphemeral)
98
+ const msg = render(<Message text="Hello" />, { channel: '#general', user: userId });
99
+ await client.chat.postEphemeral(msg); // no cast needed
90
100
  ```
91
101
 
92
102
  The top-level element must be a `<Message>`. Throws a `TypeError` otherwise.
@@ -144,6 +154,8 @@ Both `render` / `renderToMessage` / `renderToBlocks` accept an optional `options
144
154
  ```ts
145
155
  type RenderOptions = {
146
156
  validate?: 'off' | 'warn' | 'strict'; // default: 'warn'
157
+ channel?: string; // included in the payload; narrows return type to SlackPostMessagePayload
158
+ user?: string; // requires channel; narrows return type to SlackPostEphemeralPayload
147
159
  };
148
160
  ```
149
161
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/block.ts","../src/components/message.tsx","../src/components/block/button.tsx","../src/components/block/confirmation.tsx","../src/components/block/image.tsx","../src/components/block/text.tsx","../src/components/input/date-picker.tsx","../src/components/input/date-time-picker.tsx","../src/components/input/checkboxes.tsx","../src/components/input/option-group.tsx","../src/components/input/option.tsx","../src/components/input/overflow.tsx","../src/components/input/radio-group.tsx","../src/components/input/select.tsx","../src/components/input/text.tsx","../src/components/input/time-picker.tsx","../src/components/layout/actions.tsx","../src/components/layout/context.tsx","../src/components/layout/divider.tsx","../src/components/layout/file.tsx","../src/components/layout/header.tsx","../src/components/layout/image.tsx","../src/components/layout/input.tsx","../src/components/layout/rich-text.tsx","../src/components/layout/section.tsx","../src/components/layout/container.tsx","../src/components/layout/video.tsx","../src/components/rich-text/section.tsx","../src/components/rich-text/list.tsx","../src/components/rich-text/quote.tsx","../src/components/rich-text/preformatted.tsx","../src/components/rich-text/text.tsx","../src/components/rich-text/link.tsx","../src/components/rich-text/user.tsx","../src/components/rich-text/channel.tsx","../src/components/rich-text/emoji.tsx","../src/components/rich-text/date.tsx","../src/components/rich-text/broadcast.tsx","../src/components/rich-text/user-group.tsx"],"sourcesContent":["export * from './components';\n","\nimport {type Child} from '../constants/types';\n\n/**\n * Props for the `<Message>` component.\n *\n * The top-level element required by `render()` / `renderToMessage()`.\n * Add blocks as children; use `text` as a fallback for notifications.\n */\nexport type Properties = {\n children: Child;\n text?: string;\n asUser?: boolean;\n iconEmoji?: string;\n iconUrl?: string;\n markdown?: boolean;\n parse?: 'full' | 'none';\n replyBroadcast?: boolean;\n replyTo?: string;\n unfurlLinks?: boolean;\n unfurlMedia?: boolean;\n username?: string;\n color?: string;\n};\n\n/**\n * Root element for a Slack chat message.\n *\n * Must be the top-level element passed to `render()`.\n * Add layout blocks as children.\n *\n * @example\n * ```tsx\n * render(\n * <Message text=\"Fallback\">\n * <Header text=\"Hello\" />\n * </Message>\n * );\n * ```\n */\nexport default class Message {\n static slackType = 'Message';\n declare props: Properties;\n}\n","\ntype TopProperties = {\n children: string;\n actionId: string;\n url?: string;\n value?: string;\n style?: 'primary' | 'danger';\n accessibilityLabel?: string;\n};\n\nexport type ButtonProps = TopProperties & {\n confirm?: JSX.Element;\n};\n\ntype Properties = ButtonProps;\n\n/**\n * A button element — clickable button used in `<Actions>` blocks or as a\n * `<Section>` accessory.\n *\n * @example\n * ```tsx\n * <Button actionId=\"submit\" style=\"primary\" value=\"yes\">Submit</Button>\n * <Button actionId=\"delete\" style=\"danger\" confirm={confirmDialog}>Delete</Button>\n * <Button actionId=\"docs\" url=\"https://example.com\">View docs</Button>\n * ```\n */\nexport default class Button {\n static slackType = 'Button';\n declare props: Properties;\n}\n","\ntype TopProperties = {\n title: string;\n confirm: string;\n deny: string;\n};\n\n/* This is a dumb workaround to merging props */\nexport type ConfirmationProps = TopProperties & {\n children: JSX.Element;\n};\n\ntype Properties = ConfirmationProps;\n\n/**\n * A confirmation dialog — shown before an interactive action is triggered.\n *\n * Pass a `<Confirmation>` element to the `confirm` prop of interactive\n * elements such as `<Button>`, `<Select>`, `<Overflow>`, etc.\n *\n * @example\n * ```tsx\n * const dialog = (\n * <Confirmation title=\"Are you sure?\" confirm=\"Yes, delete\" deny=\"Cancel\">\n * <Text plainText>This action cannot be undone.</Text>\n * </Confirmation>\n * );\n *\n * <Button actionId=\"delete\" confirm={dialog} style=\"danger\">Delete</Button>\n * ```\n */\nexport default class Confirmation {\n static slackType = 'Confirmation';\n declare props: Properties;\n}\n","\nexport type Props = {\n url: string;\n alt: string;\n};\n\n/**\n * An image element — displays an inline image inside `<Context>` or as a\n * `<Section>` accessory.\n *\n * For a full-width image block, use `<ImageLayout>` instead.\n *\n * @example\n * ```tsx\n * <Context>\n * <Image url=\"https://example.com/icon.png\" alt=\"icon\" />\n * <Text>Some context</Text>\n * </Context>\n * ```\n */\nexport default class Image {\n static slackType = 'Image';\n declare props: Props;\n}\n","\nexport type Props = {\n children: string;\n plainText?: boolean;\n emoji?: boolean;\n verbatim?: boolean;\n};\n\n/**\n * A text object — renders as `mrkdwn` (default) or `plain_text`.\n *\n * Used as the `text` prop on `<Section>`, `<Header>`, inside `<Context>`,\n * and as a child of `<Section>` for fields.\n *\n * @example\n * ```tsx\n * <Text>Hello *world*</Text>\n * <Text plainText emoji>Hello :wave:</Text>\n * ```\n */\nexport default class Text {\n static slackType = 'Text';\n declare props: Props;\n}\n","\nexport type Props = {\n actionId: string;\n placeholder?: string;\n initialDate?: string;\n confirm?: JSX.Element;\n focusOnLoad?: boolean;\n};\n\n/**\n * A date picker — a calendar-style date selector.\n *\n * `initialDate` must be in `YYYY-MM-DD` format.\n *\n * @example\n * ```tsx\n * <Input label=\"Due date\" element={\n * <DatePicker actionId=\"due_date\" initialDate=\"2024-12-31\" />\n * } />\n * ```\n */\nexport default class DatePicker {\n static slackType = 'DatePicker';\n declare props: Props;\n}\n","\nexport type Props = {\n actionId: string;\n initialDateTime?: number;\n confirm?: JSX.Element;\n focusOnLoad?: boolean;\n};\n\n/**\n * A combined date and time picker.\n *\n * `initialDateTime` is a Unix timestamp (seconds since epoch).\n *\n * @example\n * ```tsx\n * <Input label=\"Scheduled at\" element={\n * <DateTimePicker actionId=\"scheduled_at\" initialDateTime={1700000000} />\n * } />\n * ```\n */\nexport default class DateTimePicker {\n static slackType = 'DateTimePicker';\n declare props: Props;\n}\n","\nimport {type SingleOrArray} from '../../utils/type-helpers';\n\nexport type Props = {\n actionId: string;\n children: SingleOrArray<JSX.Element>;\n initialOptions?: JSX.Element[];\n confirm?: JSX.Element;\n focusOnLoad?: boolean;\n};\n\n/**\n * A checkbox group — allows multiple selections from a list of options.\n *\n * Pass `<Option>` elements as children. Pre-check options via `initialOptions`.\n *\n * @example\n * ```tsx\n * <Checkboxes actionId=\"prefs\" initialOptions={[slackOption]}>\n * <Option value=\"emails\">Emails</Option>\n * <Option value=\"slack\">Slack</Option>\n * </Checkboxes>\n * ```\n */\nexport default class Checkboxes {\n static slackType = 'Checkboxes';\n declare props: Props;\n}\n","\nexport type Props = {\n label: string;\n children: JSX.Element | JSX.Element[];\n};\n\n/**\n * Groups options under a labeled heading inside a `<Select>`.\n *\n * @example\n * ```tsx\n * <Select placeholder=\"Pick one\" actionId=\"grouped\">\n * <OptionGroup label=\"Fruits\">\n * <Option value=\"apple\">Apple</Option>\n * </OptionGroup>\n * </Select>\n * ```\n */\nexport default class OptionGroup {\n static slackType = 'OptionGroup';\n declare props: Props;\n}\n","\nexport type Props = {\n children: string;\n value: string;\n url?: string;\n description?: string;\n};\n\n/**\n * An option item for `<Select>`, `<Checkboxes>`, `<RadioGroup>`, or `<Overflow>`.\n *\n * The children (text) is the display label; `value` is sent in the action payload.\n *\n * @example\n * ```tsx\n * <Option value=\"opt_a\" description=\"The first option\">Option A</Option>\n * ```\n */\nexport default class Option {\n static slackType = 'Option';\n declare props: Props;\n}\n","\nimport {type SingleOrArray} from '../../utils/type-helpers';\n\nexport type Props = {\n actionId: string;\n children: SingleOrArray<JSX.Element>;\n confirm?: JSX.Element;\n};\n\n/**\n * An overflow menu — the \"⋯\" button that reveals a list of options.\n *\n * Requires at least 2 `<Option>` children. Options can include a `url` to open a link.\n *\n * @example\n * ```tsx\n * <Overflow actionId=\"more\">\n * <Option value=\"edit\">Edit</Option>\n * <Option value=\"delete\">Delete</Option>\n * <Option value=\"docs\" url=\"https://example.com/docs\">View docs</Option>\n * </Overflow>\n * ```\n */\nexport default class Overflow {\n static slackType = 'Overflow';\n declare props: Props;\n}\n","\nimport {type SingleOrArray} from '../../utils/type-helpers';\n\nexport type Props = {\n actionId: string;\n children: SingleOrArray<JSX.Element>;\n initialOption?: JSX.Element;\n confirm?: JSX.Element;\n focusOnLoad?: boolean;\n};\n\n/**\n * A radio button group — allows exactly one selection from a list of options.\n *\n * Pass `<Option>` elements as children. Pre-select an option via `initialOption`.\n *\n * @example\n * ```tsx\n * <RadioGroup actionId=\"size\" initialOption={<Option value=\"m\">Medium</Option>}>\n * <Option value=\"s\">Small</Option>\n * <Option value=\"m\">Medium</Option>\n * <Option value=\"l\">Large</Option>\n * </RadioGroup>\n * ```\n */\nexport default class RadioGroup {\n static slackType = 'RadioGroup';\n declare props: Props;\n}\n","\nimport {type SingleOrArray} from '../../utils/type-helpers';\n\nexport const selectTypes = {\n STATIC: 'static',\n EXTERNAL: 'external',\n USER: 'user',\n CONVERSATION: 'conversation',\n CHANNEL: 'channel',\n} as const;\n\ntype SelectType = typeof selectTypes[keyof typeof selectTypes];\n\ntype ConversationFilter = {\n include?: Array<'im' | 'mpim' | 'private' | 'public'>;\n excludeExternalSharedChannels?: boolean;\n excludeBotUsers?: boolean;\n};\n\nexport type Props = {\n placeholder: string;\n actionId: string;\n type?: SelectType;\n multi?: boolean;\n children?: SingleOrArray<JSX.Element>;\n initialOptions?: JSX.Element[];\n confirm?: JSX.Element;\n maxSelectedItems?: number;\n minQueryLength?: number;\n focusOnLoad?: boolean;\n initialUsers?: string[];\n initialConversations?: string[];\n initialChannels?: string[];\n defaultToCurrentConversation?: boolean;\n responseUrlEnabled?: boolean;\n filter?: ConversationFilter;\n};\n\n/**\n * A select menu — supports static options, external data sources, and user /\n * channel / conversation lists. Can be single or multi-select.\n *\n * Use the `type` prop to switch data sources (default: `'static'`).\n * Pass `<Option>` or `<OptionGroup>` children for static selects.\n *\n * @example\n * ```tsx\n * // Static single-select\n * <Select placeholder=\"Pick one\" actionId=\"color\">\n * <Option value=\"red\">Red</Option>\n * <Option value=\"blue\">Blue</Option>\n * </Select>\n *\n * // User multi-select\n * <Select type=\"user\" multi placeholder=\"Pick users\" actionId=\"mentions\" />\n * ```\n */\nexport default class Select {\n static slackType = 'Select';\n declare props: Props;\n}\n","\nexport type Props = {\n actionId: string;\n placeholder?: string;\n initial?: string;\n multiline?: boolean;\n minLength?: number;\n maxLength?: number;\n focusOnLoad?: boolean;\n dispatchActionConfig?: {\n triggerActionsOn: Array<'on_enter_pressed' | 'on_character_entered'>;\n };\n};\n\n/**\n * A plain-text input field — used as the `element` prop inside `<Input>`.\n *\n * @example\n * ```tsx\n * <Input label=\"Your name\" element={\n * <TextInput\n * actionId=\"name\"\n * placeholder=\"Jane Doe\"\n * maxLength={80}\n * focusOnLoad\n * />\n * } />\n * ```\n */\nexport default class TextInput {\n static slackType = 'TextInput';\n declare props: Props;\n}\n","\nexport type Props = {\n actionId: string;\n placeholder?: string;\n initialTime?: string;\n confirm?: JSX.Element;\n focusOnLoad?: boolean;\n};\n\n/**\n * A time picker — a clock-style time selector.\n *\n * `initialTime` must be in `HH:mm` (24-hour) format.\n *\n * @example\n * ```tsx\n * <Input label=\"Meeting time\" element={\n * <TimePicker actionId=\"meeting_time\" initialTime=\"09:00\" />\n * } />\n * ```\n */\nexport default class TimePicker {\n static slackType = 'TimePicker';\n declare props: Props;\n}\n","\nimport {type InteractiveBlockElement} from '../../constants/types';\n\nexport type Props = {\n children: InteractiveBlockElement | InteractiveBlockElement[];\n blockId?: string;\n};\n\n/**\n * An actions block — displays interactive elements in a horizontal row.\n *\n * Accepts up to 25 interactive elements as children: `<Button>`, `<Select>`,\n * `<Overflow>`, `<DatePicker>`, `<TimePicker>`, `<DateTimePicker>`.\n *\n * @example\n * ```tsx\n * <Actions>\n * <Button actionId=\"approve\" style=\"primary\">Approve</Button>\n * <Button actionId=\"deny\" style=\"danger\">Deny</Button>\n * </Actions>\n * ```\n */\nexport default class Actions {\n static slackType = 'Actions';\n declare props: Props;\n}\n","\nexport type ImageOrText = JSX.Element;\n\nexport type Props = {\n children: ImageOrText | ImageOrText[];\n blockId?: string;\n};\n\n/**\n * A context block — displays small text and images in a horizontal row.\n *\n * Accepts up to 10 `<Text>` or `<Image>` elements as children.\n *\n * @example\n * ```tsx\n * <Context>\n * <Image url=\"https://example.com/avatar.png\" alt=\"avatar\" />\n * <Text>Posted by *Jane Doe*</Text>\n * </Context>\n * ```\n */\nexport default class Context {\n static slackType = 'Context';\n declare props: Props;\n}\n","\nexport type Props = {\n blockId?: string;\n};\n\n/**\n * A divider block — renders a horizontal rule between blocks.\n *\n * @example\n * ```tsx\n * <Divider />\n * ```\n */\nexport default class Divider {\n static slackType = 'Divider';\n declare props: Props;\n}\n","\nexport type Props = {\n externalId: string;\n blockId?: string;\n};\n\n/**\n * A file block — embeds a remote file that has been shared in Slack.\n *\n * @example\n * ```tsx\n * <File externalId=\"my-report-id\" />\n * ```\n */\nexport default class File {\n static slackType = 'File';\n declare props: Props;\n}\n","\nexport type Props = {\n text: string;\n blockId?: string;\n emoji?: boolean;\n};\n\n/**\n * A header block — displays large, bold plain text at the top of a section.\n *\n * Maximum 150 characters.\n *\n * @example\n * ```tsx\n * <Header text=\"Deploy complete\" emoji />\n * ```\n */\nexport default class Header {\n static slackType = 'Header';\n declare props: Props;\n}\n","\nexport type Props = {\n url: string;\n alt: string;\n title?: string;\n blockId?: string;\n};\n\n/**\n * An image layout block — displays a full-width image.\n *\n * Imported as `ImageLayout` to avoid ambiguity with the `<Image>` element.\n *\n * @example\n * ```tsx\n * import { ImageLayout } from 'slackblock/block';\n *\n * <ImageLayout\n * url=\"https://example.com/chart.png\"\n * alt=\"Sales chart\"\n * title=\"Q4 Results\"\n * />\n * ```\n */\nexport default class Image {\n static slackType = 'ImageLayout';\n declare props: Props;\n}\n","\nimport {type InputBlockElement} from '../../constants/types';\n\nexport type Props = {\n label: string;\n element: InputBlockElement;\n hint?: string;\n optional?: boolean;\n blockId?: string;\n};\n\n/**\n * An input block — wraps a single interactive input element with a label.\n *\n * Pass the input element via the `element` prop (not as a child).\n *\n * @example\n * ```tsx\n * <Input\n * label=\"Your name\"\n * hint=\"Use your full name\"\n * element={<TextInput actionId=\"name\" placeholder=\"Jane Doe\" />}\n * />\n * ```\n */\nexport default class Input {\n static slackType = 'Input';\n declare props: Props;\n}\n","\nimport {type SingleOrArray} from '../../utils/type-helpers';\n\nexport type RichTextElement = Record<string, unknown>;\n\nexport type Props = {\n elements?: RichTextElement[];\n children?: SingleOrArray<JSX.Element | string>;\n blockId?: string;\n};\n\n/**\n * A rich text block — contains formatted text with inline styling, lists,\n * quotes, and preformatted code.\n *\n * Accepts `<RichTextSection>`, `<RichTextList>`, `<RichTextQuote>`, and\n * `<RichTextPreformatted>` as children.\n *\n * @example\n * ```tsx\n * <RichText>\n * <RichTextSection>\n * <RichTextText style={{ bold: true }}>Hello</RichTextText>\n * </RichTextSection>\n * </RichText>\n * ```\n */\nexport default class RichText {\n static slackType = 'RichText';\n declare props: Props;\n}\n","\nimport {type BlockElement} from '../../constants/types';\nimport {type SingleOrArray} from '../../utils/type-helpers';\n\ntype TextElement = JSX.Element;\n\nexport type Props = {\n text: JSX.Element;\n blockId?: string;\n // eslint-disable-next-line @typescript-eslint/no-restricted-types -- We actually want to handle null children\n children?: SingleOrArray<TextElement | null | undefined | false>;\n accessory?: BlockElement;\n};\n\n/**\n * A section block — the most versatile layout block.\n *\n * Displays a primary text label, optional two-column fields (children),\n * and an optional accessory element on the right.\n *\n * @example\n * ```tsx\n * <Section\n * text={<Text>Hello *world*</Text>}\n * accessory={<Button actionId=\"more\">More</Button>}\n * >\n * <Text plainText>Field A</Text>\n * <Text plainText>Field B</Text>\n * </Section>\n * ```\n */\nexport default class Section {\n static slackType = 'Section';\n declare props: Props;\n}\n","\nimport {type SingleOrArray} from '../../utils/type-helpers';\nimport {type Child} from '../../constants/types';\n\nexport type Props = {\n children: SingleOrArray<Child>;\n};\n\n/**\n * A pass-through utility component that renders its children without adding\n * any wrapper block. Useful for conditional rendering and mapping arrays\n * without introducing an extra layout layer.\n *\n * @example\n * ```tsx\n * <Message text=\"Hello\">\n * {isAdmin && (\n * <Container>\n * <Section text={<Text>Admin section</Text>} />\n * <Divider />\n * </Container>\n * )}\n * </Message>\n * ```\n */\nexport default class Container {\n static slackType = 'Container';\n declare props: Props;\n}\n","\nexport type Props = {\n title: string;\n videoUrl: string;\n thumbnailUrl: string;\n altText: string;\n titleUrl?: string;\n description?: string;\n authorName?: string;\n providerName?: string;\n providerIconUrl?: string;\n blockId?: string;\n};\n\n/**\n * A video block — embeds an external video with a thumbnail, title, and metadata.\n *\n * @example\n * ```tsx\n * <Video\n * title=\"Product Demo\"\n * videoUrl=\"https://example.com/demo.mp4\"\n * thumbnailUrl=\"https://example.com/thumb.png\"\n * altText=\"Product demo video\"\n * authorName=\"Product Team\"\n * />\n * ```\n */\nexport default class Video {\n static slackType = 'Video';\n declare props: Props;\n}\n","\nimport {type SingleOrArray} from '../../utils/type-helpers';\n\nexport type Props = {\n children: SingleOrArray<JSX.Element | string>;\n};\n\n/**\n * An inline container for rich text content within a `<RichText>` block.\n * Also used as individual list items inside `<RichTextList>`.\n *\n * @example\n * ```tsx\n * <RichTextSection>\n * <RichTextText style={{ bold: true }}>Hello</RichTextText>\n * {' world'}\n * </RichTextSection>\n * ```\n */\nexport default class RichTextSection {\n static slackType = 'RichTextSection';\n declare props: Props;\n}\n","\nimport {type SingleOrArray} from '../../utils/type-helpers';\n\nimport {type RichTextListStyle} from './types';\n\nexport type Props = {\n style: RichTextListStyle;\n children: SingleOrArray<JSX.Element | string>;\n indent?: number;\n border?: number;\n};\n\n/**\n * A bulleted or numbered list in rich text.\n *\n * Each list item should be a `<RichTextSection>` child.\n * Supports indentation (`indent` 0–6) and border styling.\n *\n * @example\n * ```tsx\n * <RichTextList style=\"bullet\" indent={1}>\n * <RichTextSection><RichTextText>Item one</RichTextText></RichTextSection>\n * <RichTextSection><RichTextText>Item two</RichTextText></RichTextSection>\n * </RichTextList>\n * ```\n */\nexport default class RichTextList {\n static slackType = 'RichTextList';\n declare props: Props;\n}\n","\nimport {type SingleOrArray} from '../../utils/type-helpers';\n\nexport type Props = {\n children: SingleOrArray<JSX.Element | string>;\n};\n\n/**\n * A blockquote in rich text — displays content with a visual left-border indent.\n *\n * @example\n * ```tsx\n * <RichTextQuote>\n * <RichTextText>This is a quoted passage.</RichTextText>\n * </RichTextQuote>\n * ```\n */\nexport default class RichTextQuote {\n static slackType = 'RichTextQuote';\n declare props: Props;\n}\n","\nimport {type SingleOrArray} from '../../utils/type-helpers';\n\nexport type Props = {\n children: SingleOrArray<JSX.Element | string>;\n};\n\n/**\n * A preformatted code block in rich text — monospaced, no line wrapping.\n *\n * @example\n * ```tsx\n * <RichTextPreformatted>\n * <RichTextText style={{ code: true }}>const x = 1;</RichTextText>\n * </RichTextPreformatted>\n * ```\n */\nexport default class RichTextPreformatted {\n static slackType = 'RichTextPreformatted';\n declare props: Props;\n}\n","\nimport {type RichTextStyle} from './types';\n\nexport type Props = {\n children: string;\n style?: RichTextStyle;\n};\n\n/**\n * Styled text within a rich text block.\n *\n * Apply bold, italic, strikethrough, or inline code styling via `style`.\n *\n * @example\n * ```tsx\n * <RichTextText style={{ bold: true, italic: true }}>Bold italic</RichTextText>\n * <RichTextText style={{ code: true }}>inline code</RichTextText>\n * ```\n */\nexport default class RichTextText {\n static slackType = 'RichTextText';\n declare props: Props;\n}\n","\nimport {type RichTextStyle} from './types';\n\nexport type Props = {\n url: string;\n children?: string;\n style?: RichTextStyle;\n};\n\n/**\n * A hyperlink within rich text. Displays `children` as the link text,\n * or falls back to the URL if `children` is omitted.\n *\n * @example\n * ```tsx\n * <RichTextLink url=\"https://example.com\" style={{ bold: true }}>Visit us</RichTextLink>\n * ```\n */\nexport default class RichTextLink {\n static slackType = 'RichTextLink';\n declare props: Props;\n}\n","\nexport type Props = {\n userId: string;\n};\n\n/**\n * Mentions a Slack user by ID in rich text (renders as `@username`).\n *\n * @example\n * ```tsx\n * <RichTextUser userId=\"U123456\" />\n * ```\n */\nexport default class RichTextUser {\n static slackType = 'RichTextUser';\n declare props: Props;\n}\n","\nexport type Props = {\n channelId: string;\n};\n\n/**\n * Mentions a Slack channel by ID in rich text (renders as `#channel-name`).\n *\n * @example\n * ```tsx\n * <RichTextChannel channelId=\"C123456\" />\n * ```\n */\nexport default class RichTextChannel {\n static slackType = 'RichTextChannel';\n declare props: Props;\n}\n","\nexport type Props = {\n name: string;\n};\n\n/**\n * Renders an emoji by name in rich text.\n *\n * @example\n * ```tsx\n * <RichTextEmoji name=\"wave\" />\n * ```\n */\nexport default class RichTextEmoji {\n static slackType = 'RichTextEmoji';\n declare props: Props;\n}\n","\nexport type Props = {\n timestamp: number;\n format: string;\n fallback: string;\n};\n\n/**\n * Renders a formatted date that adapts to each viewer's local timezone.\n *\n * `timestamp` is a Unix timestamp. `format` uses Slack's date format tokens\n * (e.g. `\"{date_long} at {time}\"`). `fallback` is shown if rendering fails.\n *\n * @see https://api.slack.com/reference/surfaces/formatting#date-formatting\n *\n * @example\n * ```tsx\n * <RichTextDate\n * timestamp={1700000000}\n * format=\"{date_long} at {time}\"\n * fallback=\"Nov 14, 2023 at 22:13\"\n * />\n * ```\n */\nexport default class RichTextDate {\n static slackType = 'RichTextDate';\n declare props: Props;\n}\n","\nimport {type RichTextBroadcastRange} from './types';\n\nexport type Props = {\n range: RichTextBroadcastRange;\n};\n\n/**\n * A `@here`, `@channel`, or `@everyone` broadcast mention in rich text.\n *\n * @example\n * ```tsx\n * <RichTextBroadcast range=\"here\" />\n * ```\n */\nexport default class RichTextBroadcast {\n static slackType = 'RichTextBroadcast';\n declare props: Props;\n}\n","\nexport type Props = {\n usergroupId: string;\n};\n\n/**\n * Mentions a Slack user group by ID in rich text.\n *\n * @example\n * ```tsx\n * <RichTextUserGroup usergroupId=\"S123456\" />\n * ```\n */\nexport default class RichTextUserGroup {\n static slackType = 'RichTextUserGroup';\n declare props: Props;\n}\n"],"mappings":";;;;;;;;;;;;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C;AAGlC;AAFE,cADmB,cACZ,aAAY;;;ACVrB,IAAqB,oBAArB,MAAuC;AAGvC;AAFE,cADmB,mBACZ,aAAY;;;ACHrB,IAAqB,oBAArB,MAAuC;AAGvC;AAFE,cADmB,mBACZ,aAAY;","names":["Image","Image"]}
1
+ {"version":3,"sources":["../src/block.ts","../src/components/message.tsx","../src/components/block/button.tsx","../src/components/block/confirmation.tsx","../src/components/block/image.tsx","../src/components/block/text.tsx","../src/components/input/date-picker.tsx","../src/components/input/date-time-picker.tsx","../src/components/input/checkboxes.tsx","../src/components/input/option-group.tsx","../src/components/input/option.tsx","../src/components/input/overflow.tsx","../src/components/input/radio-group.tsx","../src/components/input/select.tsx","../src/components/input/text.tsx","../src/components/input/time-picker.tsx","../src/components/layout/actions.tsx","../src/components/layout/context.tsx","../src/components/layout/divider.tsx","../src/components/layout/file.tsx","../src/components/layout/header.tsx","../src/components/layout/image.tsx","../src/components/layout/input.tsx","../src/components/layout/rich-text.tsx","../src/components/layout/section.tsx","../src/components/layout/container.tsx","../src/components/layout/video.tsx","../src/components/rich-text/section.tsx","../src/components/rich-text/list.tsx","../src/components/rich-text/quote.tsx","../src/components/rich-text/preformatted.tsx","../src/components/rich-text/text.tsx","../src/components/rich-text/link.tsx","../src/components/rich-text/user.tsx","../src/components/rich-text/channel.tsx","../src/components/rich-text/emoji.tsx","../src/components/rich-text/date.tsx","../src/components/rich-text/broadcast.tsx","../src/components/rich-text/user-group.tsx"],"sourcesContent":["export * from './components';\n","\nimport {type Child} from '../constants/types';\n\n/**\n * Props for the `<Message>` component.\n *\n * The top-level element required by `render()` / `renderToMessage()`.\n * Add blocks as children; use `text` as a fallback for notifications.\n */\nexport type Properties = {\n children?: Child;\n channel?: string;\n user?: string;\n text?: string;\n asUser?: boolean;\n iconEmoji?: string;\n iconUrl?: string;\n markdown?: boolean;\n parse?: 'full' | 'none';\n replyBroadcast?: boolean;\n replyTo?: string;\n unfurlLinks?: boolean;\n unfurlMedia?: boolean;\n username?: string;\n color?: string;\n};\n\n/**\n * Root element for a Slack chat message.\n *\n * Must be the top-level element passed to `render()`.\n * Add layout blocks as children.\n *\n * @example\n * ```tsx\n * render(\n * <Message text=\"Fallback\">\n * <Header text=\"Hello\" />\n * </Message>\n * );\n * ```\n */\nexport default class Message {\n static slackType = 'Message';\n declare props: Properties;\n}\n","\ntype TopProperties = {\n children: string;\n actionId: string;\n url?: string;\n value?: string;\n style?: 'primary' | 'danger';\n accessibilityLabel?: string;\n};\n\nexport type ButtonProps = TopProperties & {\n confirm?: JSX.Element;\n};\n\ntype Properties = ButtonProps;\n\n/**\n * A button element — clickable button used in `<Actions>` blocks or as a\n * `<Section>` accessory.\n *\n * @example\n * ```tsx\n * <Button actionId=\"submit\" style=\"primary\" value=\"yes\">Submit</Button>\n * <Button actionId=\"delete\" style=\"danger\" confirm={confirmDialog}>Delete</Button>\n * <Button actionId=\"docs\" url=\"https://example.com\">View docs</Button>\n * ```\n */\nexport default class Button {\n static slackType = 'Button';\n declare props: Properties;\n}\n","\ntype TopProperties = {\n title: string;\n confirm: string;\n deny: string;\n};\n\n/* This is a dumb workaround to merging props */\nexport type ConfirmationProps = TopProperties & {\n children: JSX.Element;\n};\n\ntype Properties = ConfirmationProps;\n\n/**\n * A confirmation dialog — shown before an interactive action is triggered.\n *\n * Pass a `<Confirmation>` element to the `confirm` prop of interactive\n * elements such as `<Button>`, `<Select>`, `<Overflow>`, etc.\n *\n * @example\n * ```tsx\n * const dialog = (\n * <Confirmation title=\"Are you sure?\" confirm=\"Yes, delete\" deny=\"Cancel\">\n * <Text plainText>This action cannot be undone.</Text>\n * </Confirmation>\n * );\n *\n * <Button actionId=\"delete\" confirm={dialog} style=\"danger\">Delete</Button>\n * ```\n */\nexport default class Confirmation {\n static slackType = 'Confirmation';\n declare props: Properties;\n}\n","\nexport type Props = {\n url: string;\n alt: string;\n};\n\n/**\n * An image element — displays an inline image inside `<Context>` or as a\n * `<Section>` accessory.\n *\n * For a full-width image block, use `<ImageLayout>` instead.\n *\n * @example\n * ```tsx\n * <Context>\n * <Image url=\"https://example.com/icon.png\" alt=\"icon\" />\n * <Text>Some context</Text>\n * </Context>\n * ```\n */\nexport default class Image {\n static slackType = 'Image';\n declare props: Props;\n}\n","\nexport type Props = {\n children: string;\n plainText?: boolean;\n emoji?: boolean;\n verbatim?: boolean;\n};\n\n/**\n * A text object — renders as `mrkdwn` (default) or `plain_text`.\n *\n * Used as the `text` prop on `<Section>`, `<Header>`, inside `<Context>`,\n * and as a child of `<Section>` for fields.\n *\n * @example\n * ```tsx\n * <Text>Hello *world*</Text>\n * <Text plainText emoji>Hello :wave:</Text>\n * ```\n */\nexport default class Text {\n static slackType = 'Text';\n declare props: Props;\n}\n","\nexport type Props = {\n actionId: string;\n placeholder?: string;\n initialDate?: string;\n confirm?: JSX.Element;\n focusOnLoad?: boolean;\n};\n\n/**\n * A date picker — a calendar-style date selector.\n *\n * `initialDate` must be in `YYYY-MM-DD` format.\n *\n * @example\n * ```tsx\n * <Input label=\"Due date\" element={\n * <DatePicker actionId=\"due_date\" initialDate=\"2024-12-31\" />\n * } />\n * ```\n */\nexport default class DatePicker {\n static slackType = 'DatePicker';\n declare props: Props;\n}\n","\nexport type Props = {\n actionId: string;\n initialDateTime?: number;\n confirm?: JSX.Element;\n focusOnLoad?: boolean;\n};\n\n/**\n * A combined date and time picker.\n *\n * `initialDateTime` is a Unix timestamp (seconds since epoch).\n *\n * @example\n * ```tsx\n * <Input label=\"Scheduled at\" element={\n * <DateTimePicker actionId=\"scheduled_at\" initialDateTime={1700000000} />\n * } />\n * ```\n */\nexport default class DateTimePicker {\n static slackType = 'DateTimePicker';\n declare props: Props;\n}\n","\nimport {type SingleOrArray} from '../../utils/type-helpers';\n\nexport type Props = {\n actionId: string;\n children: SingleOrArray<JSX.Element>;\n initialOptions?: JSX.Element[];\n confirm?: JSX.Element;\n focusOnLoad?: boolean;\n};\n\n/**\n * A checkbox group — allows multiple selections from a list of options.\n *\n * Pass `<Option>` elements as children. Pre-check options via `initialOptions`.\n *\n * @example\n * ```tsx\n * <Checkboxes actionId=\"prefs\" initialOptions={[slackOption]}>\n * <Option value=\"emails\">Emails</Option>\n * <Option value=\"slack\">Slack</Option>\n * </Checkboxes>\n * ```\n */\nexport default class Checkboxes {\n static slackType = 'Checkboxes';\n declare props: Props;\n}\n","\nexport type Props = {\n label: string;\n children: JSX.Element | JSX.Element[];\n};\n\n/**\n * Groups options under a labeled heading inside a `<Select>`.\n *\n * @example\n * ```tsx\n * <Select placeholder=\"Pick one\" actionId=\"grouped\">\n * <OptionGroup label=\"Fruits\">\n * <Option value=\"apple\">Apple</Option>\n * </OptionGroup>\n * </Select>\n * ```\n */\nexport default class OptionGroup {\n static slackType = 'OptionGroup';\n declare props: Props;\n}\n","\nexport type Props = {\n children: string;\n value: string;\n url?: string;\n description?: string;\n};\n\n/**\n * An option item for `<Select>`, `<Checkboxes>`, `<RadioGroup>`, or `<Overflow>`.\n *\n * The children (text) is the display label; `value` is sent in the action payload.\n *\n * @example\n * ```tsx\n * <Option value=\"opt_a\" description=\"The first option\">Option A</Option>\n * ```\n */\nexport default class Option {\n static slackType = 'Option';\n declare props: Props;\n}\n","\nimport {type SingleOrArray} from '../../utils/type-helpers';\n\nexport type Props = {\n actionId: string;\n children: SingleOrArray<JSX.Element>;\n confirm?: JSX.Element;\n};\n\n/**\n * An overflow menu — the \"⋯\" button that reveals a list of options.\n *\n * Requires at least 2 `<Option>` children. Options can include a `url` to open a link.\n *\n * @example\n * ```tsx\n * <Overflow actionId=\"more\">\n * <Option value=\"edit\">Edit</Option>\n * <Option value=\"delete\">Delete</Option>\n * <Option value=\"docs\" url=\"https://example.com/docs\">View docs</Option>\n * </Overflow>\n * ```\n */\nexport default class Overflow {\n static slackType = 'Overflow';\n declare props: Props;\n}\n","\nimport {type SingleOrArray} from '../../utils/type-helpers';\n\nexport type Props = {\n actionId: string;\n children: SingleOrArray<JSX.Element>;\n initialOption?: JSX.Element;\n confirm?: JSX.Element;\n focusOnLoad?: boolean;\n};\n\n/**\n * A radio button group — allows exactly one selection from a list of options.\n *\n * Pass `<Option>` elements as children. Pre-select an option via `initialOption`.\n *\n * @example\n * ```tsx\n * <RadioGroup actionId=\"size\" initialOption={<Option value=\"m\">Medium</Option>}>\n * <Option value=\"s\">Small</Option>\n * <Option value=\"m\">Medium</Option>\n * <Option value=\"l\">Large</Option>\n * </RadioGroup>\n * ```\n */\nexport default class RadioGroup {\n static slackType = 'RadioGroup';\n declare props: Props;\n}\n","\nimport {type SingleOrArray} from '../../utils/type-helpers';\n\nexport const selectTypes = {\n STATIC: 'static',\n EXTERNAL: 'external',\n USER: 'user',\n CONVERSATION: 'conversation',\n CHANNEL: 'channel',\n} as const;\n\ntype SelectType = typeof selectTypes[keyof typeof selectTypes];\n\ntype ConversationFilter = {\n include?: Array<'im' | 'mpim' | 'private' | 'public'>;\n excludeExternalSharedChannels?: boolean;\n excludeBotUsers?: boolean;\n};\n\nexport type Props = {\n placeholder: string;\n actionId: string;\n type?: SelectType;\n multi?: boolean;\n children?: SingleOrArray<JSX.Element>;\n initialOptions?: JSX.Element[];\n confirm?: JSX.Element;\n maxSelectedItems?: number;\n minQueryLength?: number;\n focusOnLoad?: boolean;\n initialUsers?: string[];\n initialConversations?: string[];\n initialChannels?: string[];\n defaultToCurrentConversation?: boolean;\n responseUrlEnabled?: boolean;\n filter?: ConversationFilter;\n};\n\n/**\n * A select menu — supports static options, external data sources, and user /\n * channel / conversation lists. Can be single or multi-select.\n *\n * Use the `type` prop to switch data sources (default: `'static'`).\n * Pass `<Option>` or `<OptionGroup>` children for static selects.\n *\n * @example\n * ```tsx\n * // Static single-select\n * <Select placeholder=\"Pick one\" actionId=\"color\">\n * <Option value=\"red\">Red</Option>\n * <Option value=\"blue\">Blue</Option>\n * </Select>\n *\n * // User multi-select\n * <Select type=\"user\" multi placeholder=\"Pick users\" actionId=\"mentions\" />\n * ```\n */\nexport default class Select {\n static slackType = 'Select';\n declare props: Props;\n}\n","\nexport type Props = {\n actionId: string;\n placeholder?: string;\n initial?: string;\n multiline?: boolean;\n minLength?: number;\n maxLength?: number;\n focusOnLoad?: boolean;\n dispatchActionConfig?: {\n triggerActionsOn: Array<'on_enter_pressed' | 'on_character_entered'>;\n };\n};\n\n/**\n * A plain-text input field — used as the `element` prop inside `<Input>`.\n *\n * @example\n * ```tsx\n * <Input label=\"Your name\" element={\n * <TextInput\n * actionId=\"name\"\n * placeholder=\"Jane Doe\"\n * maxLength={80}\n * focusOnLoad\n * />\n * } />\n * ```\n */\nexport default class TextInput {\n static slackType = 'TextInput';\n declare props: Props;\n}\n","\nexport type Props = {\n actionId: string;\n placeholder?: string;\n initialTime?: string;\n confirm?: JSX.Element;\n focusOnLoad?: boolean;\n};\n\n/**\n * A time picker — a clock-style time selector.\n *\n * `initialTime` must be in `HH:mm` (24-hour) format.\n *\n * @example\n * ```tsx\n * <Input label=\"Meeting time\" element={\n * <TimePicker actionId=\"meeting_time\" initialTime=\"09:00\" />\n * } />\n * ```\n */\nexport default class TimePicker {\n static slackType = 'TimePicker';\n declare props: Props;\n}\n","\nimport {type InteractiveBlockElement} from '../../constants/types';\n\nexport type Props = {\n children: InteractiveBlockElement | InteractiveBlockElement[];\n blockId?: string;\n};\n\n/**\n * An actions block — displays interactive elements in a horizontal row.\n *\n * Accepts up to 25 interactive elements as children: `<Button>`, `<Select>`,\n * `<Overflow>`, `<DatePicker>`, `<TimePicker>`, `<DateTimePicker>`.\n *\n * @example\n * ```tsx\n * <Actions>\n * <Button actionId=\"approve\" style=\"primary\">Approve</Button>\n * <Button actionId=\"deny\" style=\"danger\">Deny</Button>\n * </Actions>\n * ```\n */\nexport default class Actions {\n static slackType = 'Actions';\n declare props: Props;\n}\n","\nexport type ImageOrText = JSX.Element;\n\nexport type Props = {\n children: ImageOrText | ImageOrText[];\n blockId?: string;\n};\n\n/**\n * A context block — displays small text and images in a horizontal row.\n *\n * Accepts up to 10 `<Text>` or `<Image>` elements as children.\n *\n * @example\n * ```tsx\n * <Context>\n * <Image url=\"https://example.com/avatar.png\" alt=\"avatar\" />\n * <Text>Posted by *Jane Doe*</Text>\n * </Context>\n * ```\n */\nexport default class Context {\n static slackType = 'Context';\n declare props: Props;\n}\n","\nexport type Props = {\n blockId?: string;\n};\n\n/**\n * A divider block — renders a horizontal rule between blocks.\n *\n * @example\n * ```tsx\n * <Divider />\n * ```\n */\nexport default class Divider {\n static slackType = 'Divider';\n declare props: Props;\n}\n","\nexport type Props = {\n externalId: string;\n blockId?: string;\n};\n\n/**\n * A file block — embeds a remote file that has been shared in Slack.\n *\n * @example\n * ```tsx\n * <File externalId=\"my-report-id\" />\n * ```\n */\nexport default class File {\n static slackType = 'File';\n declare props: Props;\n}\n","\nexport type Props = {\n text: string;\n blockId?: string;\n emoji?: boolean;\n};\n\n/**\n * A header block — displays large, bold plain text at the top of a section.\n *\n * Maximum 150 characters.\n *\n * @example\n * ```tsx\n * <Header text=\"Deploy complete\" emoji />\n * ```\n */\nexport default class Header {\n static slackType = 'Header';\n declare props: Props;\n}\n","\nexport type Props = {\n url: string;\n alt: string;\n title?: string;\n blockId?: string;\n};\n\n/**\n * An image layout block — displays a full-width image.\n *\n * Imported as `ImageLayout` to avoid ambiguity with the `<Image>` element.\n *\n * @example\n * ```tsx\n * import { ImageLayout } from 'slackblock/block';\n *\n * <ImageLayout\n * url=\"https://example.com/chart.png\"\n * alt=\"Sales chart\"\n * title=\"Q4 Results\"\n * />\n * ```\n */\nexport default class Image {\n static slackType = 'ImageLayout';\n declare props: Props;\n}\n","\nimport {type InputBlockElement} from '../../constants/types';\n\nexport type Props = {\n label: string;\n element: InputBlockElement;\n hint?: string;\n optional?: boolean;\n blockId?: string;\n};\n\n/**\n * An input block — wraps a single interactive input element with a label.\n *\n * Pass the input element via the `element` prop (not as a child).\n *\n * @example\n * ```tsx\n * <Input\n * label=\"Your name\"\n * hint=\"Use your full name\"\n * element={<TextInput actionId=\"name\" placeholder=\"Jane Doe\" />}\n * />\n * ```\n */\nexport default class Input {\n static slackType = 'Input';\n declare props: Props;\n}\n","\nimport {type SingleOrArray} from '../../utils/type-helpers';\n\nexport type RichTextElement = Record<string, unknown>;\n\nexport type Props = {\n elements?: RichTextElement[];\n children?: SingleOrArray<JSX.Element | string>;\n blockId?: string;\n};\n\n/**\n * A rich text block — contains formatted text with inline styling, lists,\n * quotes, and preformatted code.\n *\n * Accepts `<RichTextSection>`, `<RichTextList>`, `<RichTextQuote>`, and\n * `<RichTextPreformatted>` as children.\n *\n * @example\n * ```tsx\n * <RichText>\n * <RichTextSection>\n * <RichTextText style={{ bold: true }}>Hello</RichTextText>\n * </RichTextSection>\n * </RichText>\n * ```\n */\nexport default class RichText {\n static slackType = 'RichText';\n declare props: Props;\n}\n","\nimport {type BlockElement} from '../../constants/types';\nimport {type SingleOrArray} from '../../utils/type-helpers';\n\ntype TextElement = JSX.Element;\n\nexport type Props = {\n text: JSX.Element;\n blockId?: string;\n // eslint-disable-next-line @typescript-eslint/no-restricted-types -- We actually want to handle null children\n children?: SingleOrArray<TextElement | null | undefined | false>;\n accessory?: BlockElement;\n};\n\n/**\n * A section block — the most versatile layout block.\n *\n * Displays a primary text label, optional two-column fields (children),\n * and an optional accessory element on the right.\n *\n * @example\n * ```tsx\n * <Section\n * text={<Text>Hello *world*</Text>}\n * accessory={<Button actionId=\"more\">More</Button>}\n * >\n * <Text plainText>Field A</Text>\n * <Text plainText>Field B</Text>\n * </Section>\n * ```\n */\nexport default class Section {\n static slackType = 'Section';\n declare props: Props;\n}\n","\nimport {type SingleOrArray} from '../../utils/type-helpers';\nimport {type Child} from '../../constants/types';\n\nexport type Props = {\n children: SingleOrArray<Child>;\n};\n\n/**\n * A pass-through utility component that renders its children without adding\n * any wrapper block. Useful for conditional rendering and mapping arrays\n * without introducing an extra layout layer.\n *\n * @example\n * ```tsx\n * <Message text=\"Hello\">\n * {isAdmin && (\n * <Container>\n * <Section text={<Text>Admin section</Text>} />\n * <Divider />\n * </Container>\n * )}\n * </Message>\n * ```\n */\nexport default class Container {\n static slackType = 'Container';\n declare props: Props;\n}\n","\nexport type Props = {\n title: string;\n videoUrl: string;\n thumbnailUrl: string;\n altText: string;\n titleUrl?: string;\n description?: string;\n authorName?: string;\n providerName?: string;\n providerIconUrl?: string;\n blockId?: string;\n};\n\n/**\n * A video block — embeds an external video with a thumbnail, title, and metadata.\n *\n * @example\n * ```tsx\n * <Video\n * title=\"Product Demo\"\n * videoUrl=\"https://example.com/demo.mp4\"\n * thumbnailUrl=\"https://example.com/thumb.png\"\n * altText=\"Product demo video\"\n * authorName=\"Product Team\"\n * />\n * ```\n */\nexport default class Video {\n static slackType = 'Video';\n declare props: Props;\n}\n","\nimport {type SingleOrArray} from '../../utils/type-helpers';\n\nexport type Props = {\n children: SingleOrArray<JSX.Element | string>;\n};\n\n/**\n * An inline container for rich text content within a `<RichText>` block.\n * Also used as individual list items inside `<RichTextList>`.\n *\n * @example\n * ```tsx\n * <RichTextSection>\n * <RichTextText style={{ bold: true }}>Hello</RichTextText>\n * {' world'}\n * </RichTextSection>\n * ```\n */\nexport default class RichTextSection {\n static slackType = 'RichTextSection';\n declare props: Props;\n}\n","\nimport {type SingleOrArray} from '../../utils/type-helpers';\n\nimport {type RichTextListStyle} from './types';\n\nexport type Props = {\n style: RichTextListStyle;\n children: SingleOrArray<JSX.Element | string>;\n indent?: number;\n border?: number;\n};\n\n/**\n * A bulleted or numbered list in rich text.\n *\n * Each list item should be a `<RichTextSection>` child.\n * Supports indentation (`indent` 0–6) and border styling.\n *\n * @example\n * ```tsx\n * <RichTextList style=\"bullet\" indent={1}>\n * <RichTextSection><RichTextText>Item one</RichTextText></RichTextSection>\n * <RichTextSection><RichTextText>Item two</RichTextText></RichTextSection>\n * </RichTextList>\n * ```\n */\nexport default class RichTextList {\n static slackType = 'RichTextList';\n declare props: Props;\n}\n","\nimport {type SingleOrArray} from '../../utils/type-helpers';\n\nexport type Props = {\n children: SingleOrArray<JSX.Element | string>;\n};\n\n/**\n * A blockquote in rich text — displays content with a visual left-border indent.\n *\n * @example\n * ```tsx\n * <RichTextQuote>\n * <RichTextText>This is a quoted passage.</RichTextText>\n * </RichTextQuote>\n * ```\n */\nexport default class RichTextQuote {\n static slackType = 'RichTextQuote';\n declare props: Props;\n}\n","\nimport {type SingleOrArray} from '../../utils/type-helpers';\n\nexport type Props = {\n children: SingleOrArray<JSX.Element | string>;\n};\n\n/**\n * A preformatted code block in rich text — monospaced, no line wrapping.\n *\n * @example\n * ```tsx\n * <RichTextPreformatted>\n * <RichTextText style={{ code: true }}>const x = 1;</RichTextText>\n * </RichTextPreformatted>\n * ```\n */\nexport default class RichTextPreformatted {\n static slackType = 'RichTextPreformatted';\n declare props: Props;\n}\n","\nimport {type RichTextStyle} from './types';\n\nexport type Props = {\n children: string;\n style?: RichTextStyle;\n};\n\n/**\n * Styled text within a rich text block.\n *\n * Apply bold, italic, strikethrough, or inline code styling via `style`.\n *\n * @example\n * ```tsx\n * <RichTextText style={{ bold: true, italic: true }}>Bold italic</RichTextText>\n * <RichTextText style={{ code: true }}>inline code</RichTextText>\n * ```\n */\nexport default class RichTextText {\n static slackType = 'RichTextText';\n declare props: Props;\n}\n","\nimport {type RichTextStyle} from './types';\n\nexport type Props = {\n url: string;\n children?: string;\n style?: RichTextStyle;\n};\n\n/**\n * A hyperlink within rich text. Displays `children` as the link text,\n * or falls back to the URL if `children` is omitted.\n *\n * @example\n * ```tsx\n * <RichTextLink url=\"https://example.com\" style={{ bold: true }}>Visit us</RichTextLink>\n * ```\n */\nexport default class RichTextLink {\n static slackType = 'RichTextLink';\n declare props: Props;\n}\n","\nexport type Props = {\n userId: string;\n};\n\n/**\n * Mentions a Slack user by ID in rich text (renders as `@username`).\n *\n * @example\n * ```tsx\n * <RichTextUser userId=\"U123456\" />\n * ```\n */\nexport default class RichTextUser {\n static slackType = 'RichTextUser';\n declare props: Props;\n}\n","\nexport type Props = {\n channelId: string;\n};\n\n/**\n * Mentions a Slack channel by ID in rich text (renders as `#channel-name`).\n *\n * @example\n * ```tsx\n * <RichTextChannel channelId=\"C123456\" />\n * ```\n */\nexport default class RichTextChannel {\n static slackType = 'RichTextChannel';\n declare props: Props;\n}\n","\nexport type Props = {\n name: string;\n};\n\n/**\n * Renders an emoji by name in rich text.\n *\n * @example\n * ```tsx\n * <RichTextEmoji name=\"wave\" />\n * ```\n */\nexport default class RichTextEmoji {\n static slackType = 'RichTextEmoji';\n declare props: Props;\n}\n","\nexport type Props = {\n timestamp: number;\n format: string;\n fallback: string;\n};\n\n/**\n * Renders a formatted date that adapts to each viewer's local timezone.\n *\n * `timestamp` is a Unix timestamp. `format` uses Slack's date format tokens\n * (e.g. `\"{date_long} at {time}\"`). `fallback` is shown if rendering fails.\n *\n * @see https://api.slack.com/reference/surfaces/formatting#date-formatting\n *\n * @example\n * ```tsx\n * <RichTextDate\n * timestamp={1700000000}\n * format=\"{date_long} at {time}\"\n * fallback=\"Nov 14, 2023 at 22:13\"\n * />\n * ```\n */\nexport default class RichTextDate {\n static slackType = 'RichTextDate';\n declare props: Props;\n}\n","\nimport {type RichTextBroadcastRange} from './types';\n\nexport type Props = {\n range: RichTextBroadcastRange;\n};\n\n/**\n * A `@here`, `@channel`, or `@everyone` broadcast mention in rich text.\n *\n * @example\n * ```tsx\n * <RichTextBroadcast range=\"here\" />\n * ```\n */\nexport default class RichTextBroadcast {\n static slackType = 'RichTextBroadcast';\n declare props: Props;\n}\n","\nexport type Props = {\n usergroupId: string;\n};\n\n/**\n * Mentions a Slack user group by ID in rich text.\n *\n * @example\n * ```tsx\n * <RichTextUserGroup usergroupId=\"S123456\" />\n * ```\n */\nexport default class RichTextUserGroup {\n static slackType = 'RichTextUserGroup';\n declare props: Props;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA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image","Image"]}
package/dist/block.d.cts CHANGED
@@ -1,8 +1,10 @@
1
- import { C as Child, I as InteractiveBlockElement, a as InputBlockElement, b as BlockElement } from './types.d-BHoTwZUO.cjs';
1
+ import { C as Child, I as InteractiveBlockElement, g as InputBlockElement, h as BlockElement } from './types-DhAVIy-s.cjs';
2
2
  import '@slack/types';
3
3
 
4
4
  type Properties$2 = {
5
- children: Child;
5
+ children?: Child;
6
+ channel?: string;
7
+ user?: string;
6
8
  text?: string;
7
9
  asUser?: boolean;
8
10
  iconEmoji?: string;
package/dist/block.d.ts CHANGED
@@ -1,8 +1,10 @@
1
- import { C as Child, I as InteractiveBlockElement, a as InputBlockElement, b as BlockElement } from './types.d-BHoTwZUO.js';
1
+ import { C as Child, I as InteractiveBlockElement, g as InputBlockElement, h as BlockElement } from './types-DhAVIy-s.js';
2
2
  import '@slack/types';
3
3
 
4
4
  type Properties$2 = {
5
- children: Child;
5
+ children?: Child;
6
+ channel?: string;
7
+ user?: string;
6
8
  text?: string;
7
9
  asUser?: boolean;
8
10
  iconEmoji?: string;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/message.tsx","../src/components/block/button.tsx","../src/components/block/confirmation.tsx","../src/components/block/image.tsx","../src/components/block/text.tsx","../src/components/input/date-picker.tsx","../src/components/input/date-time-picker.tsx","../src/components/input/checkboxes.tsx","../src/components/input/option-group.tsx","../src/components/input/option.tsx","../src/components/input/overflow.tsx","../src/components/input/radio-group.tsx","../src/components/input/select.tsx","../src/components/input/text.tsx","../src/components/input/time-picker.tsx","../src/components/layout/actions.tsx","../src/components/layout/context.tsx","../src/components/layout/divider.tsx","../src/components/layout/file.tsx","../src/components/layout/header.tsx","../src/components/layout/image.tsx","../src/components/layout/input.tsx","../src/components/layout/rich-text.tsx","../src/components/layout/section.tsx","../src/components/layout/container.tsx","../src/components/layout/video.tsx","../src/components/rich-text/section.tsx","../src/components/rich-text/list.tsx","../src/components/rich-text/quote.tsx","../src/components/rich-text/preformatted.tsx","../src/components/rich-text/text.tsx","../src/components/rich-text/link.tsx","../src/components/rich-text/user.tsx","../src/components/rich-text/channel.tsx","../src/components/rich-text/emoji.tsx","../src/components/rich-text/date.tsx","../src/components/rich-text/broadcast.tsx","../src/components/rich-text/user-group.tsx"],"sourcesContent":["\nimport {type Child} from '../constants/types';\n\n/**\n * Props for the `<Message>` component.\n *\n * The top-level element required by `render()` / `renderToMessage()`.\n * Add blocks as children; use `text` as a fallback for notifications.\n */\nexport type Properties = {\n children: Child;\n text?: string;\n asUser?: boolean;\n iconEmoji?: string;\n iconUrl?: string;\n markdown?: boolean;\n parse?: 'full' | 'none';\n replyBroadcast?: boolean;\n replyTo?: string;\n unfurlLinks?: boolean;\n unfurlMedia?: boolean;\n username?: string;\n color?: string;\n};\n\n/**\n * Root element for a Slack chat message.\n *\n * Must be the top-level element passed to `render()`.\n * Add layout blocks as children.\n *\n * @example\n * ```tsx\n * render(\n * <Message text=\"Fallback\">\n * <Header text=\"Hello\" />\n * </Message>\n * );\n * ```\n */\nexport default class Message {\n static slackType = 'Message';\n declare props: Properties;\n}\n","\ntype TopProperties = {\n children: string;\n actionId: string;\n url?: string;\n value?: string;\n style?: 'primary' | 'danger';\n accessibilityLabel?: string;\n};\n\nexport type ButtonProps = TopProperties & {\n confirm?: JSX.Element;\n};\n\ntype Properties = ButtonProps;\n\n/**\n * A button element — clickable button used in `<Actions>` blocks or as a\n * `<Section>` accessory.\n *\n * @example\n * ```tsx\n * <Button actionId=\"submit\" style=\"primary\" value=\"yes\">Submit</Button>\n * <Button actionId=\"delete\" style=\"danger\" confirm={confirmDialog}>Delete</Button>\n * <Button actionId=\"docs\" url=\"https://example.com\">View docs</Button>\n * ```\n */\nexport default class Button {\n static slackType = 'Button';\n declare props: Properties;\n}\n","\ntype TopProperties = {\n title: string;\n confirm: string;\n deny: string;\n};\n\n/* This is a dumb workaround to merging props */\nexport type ConfirmationProps = TopProperties & {\n children: JSX.Element;\n};\n\ntype Properties = ConfirmationProps;\n\n/**\n * A confirmation dialog — shown before an interactive action is triggered.\n *\n * Pass a `<Confirmation>` element to the `confirm` prop of interactive\n * elements such as `<Button>`, `<Select>`, `<Overflow>`, etc.\n *\n * @example\n * ```tsx\n * const dialog = (\n * <Confirmation title=\"Are you sure?\" confirm=\"Yes, delete\" deny=\"Cancel\">\n * <Text plainText>This action cannot be undone.</Text>\n * </Confirmation>\n * );\n *\n * <Button actionId=\"delete\" confirm={dialog} style=\"danger\">Delete</Button>\n * ```\n */\nexport default class Confirmation {\n static slackType = 'Confirmation';\n declare props: Properties;\n}\n","\nexport type Props = {\n url: string;\n alt: string;\n};\n\n/**\n * An image element — displays an inline image inside `<Context>` or as a\n * `<Section>` accessory.\n *\n * For a full-width image block, use `<ImageLayout>` instead.\n *\n * @example\n * ```tsx\n * <Context>\n * <Image url=\"https://example.com/icon.png\" alt=\"icon\" />\n * <Text>Some context</Text>\n * </Context>\n * ```\n */\nexport default class Image {\n static slackType = 'Image';\n declare props: Props;\n}\n","\nexport type Props = {\n children: string;\n plainText?: boolean;\n emoji?: boolean;\n verbatim?: boolean;\n};\n\n/**\n * A text object — renders as `mrkdwn` (default) or `plain_text`.\n *\n * Used as the `text` prop on `<Section>`, `<Header>`, inside `<Context>`,\n * and as a child of `<Section>` for fields.\n *\n * @example\n * ```tsx\n * <Text>Hello *world*</Text>\n * <Text plainText emoji>Hello :wave:</Text>\n * ```\n */\nexport default class Text {\n static slackType = 'Text';\n declare props: Props;\n}\n","\nexport type Props = {\n actionId: string;\n placeholder?: string;\n initialDate?: string;\n confirm?: JSX.Element;\n focusOnLoad?: boolean;\n};\n\n/**\n * A date picker — a calendar-style date selector.\n *\n * `initialDate` must be in `YYYY-MM-DD` format.\n *\n * @example\n * ```tsx\n * <Input label=\"Due date\" element={\n * <DatePicker actionId=\"due_date\" initialDate=\"2024-12-31\" />\n * } />\n * ```\n */\nexport default class DatePicker {\n static slackType = 'DatePicker';\n declare props: Props;\n}\n","\nexport type Props = {\n actionId: string;\n initialDateTime?: number;\n confirm?: JSX.Element;\n focusOnLoad?: boolean;\n};\n\n/**\n * A combined date and time picker.\n *\n * `initialDateTime` is a Unix timestamp (seconds since epoch).\n *\n * @example\n * ```tsx\n * <Input label=\"Scheduled at\" element={\n * <DateTimePicker actionId=\"scheduled_at\" initialDateTime={1700000000} />\n * } />\n * ```\n */\nexport default class DateTimePicker {\n static slackType = 'DateTimePicker';\n declare props: Props;\n}\n","\nimport {type SingleOrArray} from '../../utils/type-helpers';\n\nexport type Props = {\n actionId: string;\n children: SingleOrArray<JSX.Element>;\n initialOptions?: JSX.Element[];\n confirm?: JSX.Element;\n focusOnLoad?: boolean;\n};\n\n/**\n * A checkbox group — allows multiple selections from a list of options.\n *\n * Pass `<Option>` elements as children. Pre-check options via `initialOptions`.\n *\n * @example\n * ```tsx\n * <Checkboxes actionId=\"prefs\" initialOptions={[slackOption]}>\n * <Option value=\"emails\">Emails</Option>\n * <Option value=\"slack\">Slack</Option>\n * </Checkboxes>\n * ```\n */\nexport default class Checkboxes {\n static slackType = 'Checkboxes';\n declare props: Props;\n}\n","\nexport type Props = {\n label: string;\n children: JSX.Element | JSX.Element[];\n};\n\n/**\n * Groups options under a labeled heading inside a `<Select>`.\n *\n * @example\n * ```tsx\n * <Select placeholder=\"Pick one\" actionId=\"grouped\">\n * <OptionGroup label=\"Fruits\">\n * <Option value=\"apple\">Apple</Option>\n * </OptionGroup>\n * </Select>\n * ```\n */\nexport default class OptionGroup {\n static slackType = 'OptionGroup';\n declare props: Props;\n}\n","\nexport type Props = {\n children: string;\n value: string;\n url?: string;\n description?: string;\n};\n\n/**\n * An option item for `<Select>`, `<Checkboxes>`, `<RadioGroup>`, or `<Overflow>`.\n *\n * The children (text) is the display label; `value` is sent in the action payload.\n *\n * @example\n * ```tsx\n * <Option value=\"opt_a\" description=\"The first option\">Option A</Option>\n * ```\n */\nexport default class Option {\n static slackType = 'Option';\n declare props: Props;\n}\n","\nimport {type SingleOrArray} from '../../utils/type-helpers';\n\nexport type Props = {\n actionId: string;\n children: SingleOrArray<JSX.Element>;\n confirm?: JSX.Element;\n};\n\n/**\n * An overflow menu — the \"⋯\" button that reveals a list of options.\n *\n * Requires at least 2 `<Option>` children. Options can include a `url` to open a link.\n *\n * @example\n * ```tsx\n * <Overflow actionId=\"more\">\n * <Option value=\"edit\">Edit</Option>\n * <Option value=\"delete\">Delete</Option>\n * <Option value=\"docs\" url=\"https://example.com/docs\">View docs</Option>\n * </Overflow>\n * ```\n */\nexport default class Overflow {\n static slackType = 'Overflow';\n declare props: Props;\n}\n","\nimport {type SingleOrArray} from '../../utils/type-helpers';\n\nexport type Props = {\n actionId: string;\n children: SingleOrArray<JSX.Element>;\n initialOption?: JSX.Element;\n confirm?: JSX.Element;\n focusOnLoad?: boolean;\n};\n\n/**\n * A radio button group — allows exactly one selection from a list of options.\n *\n * Pass `<Option>` elements as children. Pre-select an option via `initialOption`.\n *\n * @example\n * ```tsx\n * <RadioGroup actionId=\"size\" initialOption={<Option value=\"m\">Medium</Option>}>\n * <Option value=\"s\">Small</Option>\n * <Option value=\"m\">Medium</Option>\n * <Option value=\"l\">Large</Option>\n * </RadioGroup>\n * ```\n */\nexport default class RadioGroup {\n static slackType = 'RadioGroup';\n declare props: Props;\n}\n","\nimport {type SingleOrArray} from '../../utils/type-helpers';\n\nexport const selectTypes = {\n STATIC: 'static',\n EXTERNAL: 'external',\n USER: 'user',\n CONVERSATION: 'conversation',\n CHANNEL: 'channel',\n} as const;\n\ntype SelectType = typeof selectTypes[keyof typeof selectTypes];\n\ntype ConversationFilter = {\n include?: Array<'im' | 'mpim' | 'private' | 'public'>;\n excludeExternalSharedChannels?: boolean;\n excludeBotUsers?: boolean;\n};\n\nexport type Props = {\n placeholder: string;\n actionId: string;\n type?: SelectType;\n multi?: boolean;\n children?: SingleOrArray<JSX.Element>;\n initialOptions?: JSX.Element[];\n confirm?: JSX.Element;\n maxSelectedItems?: number;\n minQueryLength?: number;\n focusOnLoad?: boolean;\n initialUsers?: string[];\n initialConversations?: string[];\n initialChannels?: string[];\n defaultToCurrentConversation?: boolean;\n responseUrlEnabled?: boolean;\n filter?: ConversationFilter;\n};\n\n/**\n * A select menu — supports static options, external data sources, and user /\n * channel / conversation lists. Can be single or multi-select.\n *\n * Use the `type` prop to switch data sources (default: `'static'`).\n * Pass `<Option>` or `<OptionGroup>` children for static selects.\n *\n * @example\n * ```tsx\n * // Static single-select\n * <Select placeholder=\"Pick one\" actionId=\"color\">\n * <Option value=\"red\">Red</Option>\n * <Option value=\"blue\">Blue</Option>\n * </Select>\n *\n * // User multi-select\n * <Select type=\"user\" multi placeholder=\"Pick users\" actionId=\"mentions\" />\n * ```\n */\nexport default class Select {\n static slackType = 'Select';\n declare props: Props;\n}\n","\nexport type Props = {\n actionId: string;\n placeholder?: string;\n initial?: string;\n multiline?: boolean;\n minLength?: number;\n maxLength?: number;\n focusOnLoad?: boolean;\n dispatchActionConfig?: {\n triggerActionsOn: Array<'on_enter_pressed' | 'on_character_entered'>;\n };\n};\n\n/**\n * A plain-text input field — used as the `element` prop inside `<Input>`.\n *\n * @example\n * ```tsx\n * <Input label=\"Your name\" element={\n * <TextInput\n * actionId=\"name\"\n * placeholder=\"Jane Doe\"\n * maxLength={80}\n * focusOnLoad\n * />\n * } />\n * ```\n */\nexport default class TextInput {\n static slackType = 'TextInput';\n declare props: Props;\n}\n","\nexport type Props = {\n actionId: string;\n placeholder?: string;\n initialTime?: string;\n confirm?: JSX.Element;\n focusOnLoad?: boolean;\n};\n\n/**\n * A time picker — a clock-style time selector.\n *\n * `initialTime` must be in `HH:mm` (24-hour) format.\n *\n * @example\n * ```tsx\n * <Input label=\"Meeting time\" element={\n * <TimePicker actionId=\"meeting_time\" initialTime=\"09:00\" />\n * } />\n * ```\n */\nexport default class TimePicker {\n static slackType = 'TimePicker';\n declare props: Props;\n}\n","\nimport {type InteractiveBlockElement} from '../../constants/types';\n\nexport type Props = {\n children: InteractiveBlockElement | InteractiveBlockElement[];\n blockId?: string;\n};\n\n/**\n * An actions block — displays interactive elements in a horizontal row.\n *\n * Accepts up to 25 interactive elements as children: `<Button>`, `<Select>`,\n * `<Overflow>`, `<DatePicker>`, `<TimePicker>`, `<DateTimePicker>`.\n *\n * @example\n * ```tsx\n * <Actions>\n * <Button actionId=\"approve\" style=\"primary\">Approve</Button>\n * <Button actionId=\"deny\" style=\"danger\">Deny</Button>\n * </Actions>\n * ```\n */\nexport default class Actions {\n static slackType = 'Actions';\n declare props: Props;\n}\n","\nexport type ImageOrText = JSX.Element;\n\nexport type Props = {\n children: ImageOrText | ImageOrText[];\n blockId?: string;\n};\n\n/**\n * A context block — displays small text and images in a horizontal row.\n *\n * Accepts up to 10 `<Text>` or `<Image>` elements as children.\n *\n * @example\n * ```tsx\n * <Context>\n * <Image url=\"https://example.com/avatar.png\" alt=\"avatar\" />\n * <Text>Posted by *Jane Doe*</Text>\n * </Context>\n * ```\n */\nexport default class Context {\n static slackType = 'Context';\n declare props: Props;\n}\n","\nexport type Props = {\n blockId?: string;\n};\n\n/**\n * A divider block — renders a horizontal rule between blocks.\n *\n * @example\n * ```tsx\n * <Divider />\n * ```\n */\nexport default class Divider {\n static slackType = 'Divider';\n declare props: Props;\n}\n","\nexport type Props = {\n externalId: string;\n blockId?: string;\n};\n\n/**\n * A file block — embeds a remote file that has been shared in Slack.\n *\n * @example\n * ```tsx\n * <File externalId=\"my-report-id\" />\n * ```\n */\nexport default class File {\n static slackType = 'File';\n declare props: Props;\n}\n","\nexport type Props = {\n text: string;\n blockId?: string;\n emoji?: boolean;\n};\n\n/**\n * A header block — displays large, bold plain text at the top of a section.\n *\n * Maximum 150 characters.\n *\n * @example\n * ```tsx\n * <Header text=\"Deploy complete\" emoji />\n * ```\n */\nexport default class Header {\n static slackType = 'Header';\n declare props: Props;\n}\n","\nexport type Props = {\n url: string;\n alt: string;\n title?: string;\n blockId?: string;\n};\n\n/**\n * An image layout block — displays a full-width image.\n *\n * Imported as `ImageLayout` to avoid ambiguity with the `<Image>` element.\n *\n * @example\n * ```tsx\n * import { ImageLayout } from 'slackblock/block';\n *\n * <ImageLayout\n * url=\"https://example.com/chart.png\"\n * alt=\"Sales chart\"\n * title=\"Q4 Results\"\n * />\n * ```\n */\nexport default class Image {\n static slackType = 'ImageLayout';\n declare props: Props;\n}\n","\nimport {type InputBlockElement} from '../../constants/types';\n\nexport type Props = {\n label: string;\n element: InputBlockElement;\n hint?: string;\n optional?: boolean;\n blockId?: string;\n};\n\n/**\n * An input block — wraps a single interactive input element with a label.\n *\n * Pass the input element via the `element` prop (not as a child).\n *\n * @example\n * ```tsx\n * <Input\n * label=\"Your name\"\n * hint=\"Use your full name\"\n * element={<TextInput actionId=\"name\" placeholder=\"Jane Doe\" />}\n * />\n * ```\n */\nexport default class Input {\n static slackType = 'Input';\n declare props: Props;\n}\n","\nimport {type SingleOrArray} from '../../utils/type-helpers';\n\nexport type RichTextElement = Record<string, unknown>;\n\nexport type Props = {\n elements?: RichTextElement[];\n children?: SingleOrArray<JSX.Element | string>;\n blockId?: string;\n};\n\n/**\n * A rich text block — contains formatted text with inline styling, lists,\n * quotes, and preformatted code.\n *\n * Accepts `<RichTextSection>`, `<RichTextList>`, `<RichTextQuote>`, and\n * `<RichTextPreformatted>` as children.\n *\n * @example\n * ```tsx\n * <RichText>\n * <RichTextSection>\n * <RichTextText style={{ bold: true }}>Hello</RichTextText>\n * </RichTextSection>\n * </RichText>\n * ```\n */\nexport default class RichText {\n static slackType = 'RichText';\n declare props: Props;\n}\n","\nimport {type BlockElement} from '../../constants/types';\nimport {type SingleOrArray} from '../../utils/type-helpers';\n\ntype TextElement = JSX.Element;\n\nexport type Props = {\n text: JSX.Element;\n blockId?: string;\n // eslint-disable-next-line @typescript-eslint/no-restricted-types -- We actually want to handle null children\n children?: SingleOrArray<TextElement | null | undefined | false>;\n accessory?: BlockElement;\n};\n\n/**\n * A section block — the most versatile layout block.\n *\n * Displays a primary text label, optional two-column fields (children),\n * and an optional accessory element on the right.\n *\n * @example\n * ```tsx\n * <Section\n * text={<Text>Hello *world*</Text>}\n * accessory={<Button actionId=\"more\">More</Button>}\n * >\n * <Text plainText>Field A</Text>\n * <Text plainText>Field B</Text>\n * </Section>\n * ```\n */\nexport default class Section {\n static slackType = 'Section';\n declare props: Props;\n}\n","\nimport {type SingleOrArray} from '../../utils/type-helpers';\nimport {type Child} from '../../constants/types';\n\nexport type Props = {\n children: SingleOrArray<Child>;\n};\n\n/**\n * A pass-through utility component that renders its children without adding\n * any wrapper block. Useful for conditional rendering and mapping arrays\n * without introducing an extra layout layer.\n *\n * @example\n * ```tsx\n * <Message text=\"Hello\">\n * {isAdmin && (\n * <Container>\n * <Section text={<Text>Admin section</Text>} />\n * <Divider />\n * </Container>\n * )}\n * </Message>\n * ```\n */\nexport default class Container {\n static slackType = 'Container';\n declare props: Props;\n}\n","\nexport type Props = {\n title: string;\n videoUrl: string;\n thumbnailUrl: string;\n altText: string;\n titleUrl?: string;\n description?: string;\n authorName?: string;\n providerName?: string;\n providerIconUrl?: string;\n blockId?: string;\n};\n\n/**\n * A video block — embeds an external video with a thumbnail, title, and metadata.\n *\n * @example\n * ```tsx\n * <Video\n * title=\"Product Demo\"\n * videoUrl=\"https://example.com/demo.mp4\"\n * thumbnailUrl=\"https://example.com/thumb.png\"\n * altText=\"Product demo video\"\n * authorName=\"Product Team\"\n * />\n * ```\n */\nexport default class Video {\n static slackType = 'Video';\n declare props: Props;\n}\n","\nimport {type SingleOrArray} from '../../utils/type-helpers';\n\nexport type Props = {\n children: SingleOrArray<JSX.Element | string>;\n};\n\n/**\n * An inline container for rich text content within a `<RichText>` block.\n * Also used as individual list items inside `<RichTextList>`.\n *\n * @example\n * ```tsx\n * <RichTextSection>\n * <RichTextText style={{ bold: true }}>Hello</RichTextText>\n * {' world'}\n * </RichTextSection>\n * ```\n */\nexport default class RichTextSection {\n static slackType = 'RichTextSection';\n declare props: Props;\n}\n","\nimport {type SingleOrArray} from '../../utils/type-helpers';\n\nimport {type RichTextListStyle} from './types';\n\nexport type Props = {\n style: RichTextListStyle;\n children: SingleOrArray<JSX.Element | string>;\n indent?: number;\n border?: number;\n};\n\n/**\n * A bulleted or numbered list in rich text.\n *\n * Each list item should be a `<RichTextSection>` child.\n * Supports indentation (`indent` 0–6) and border styling.\n *\n * @example\n * ```tsx\n * <RichTextList style=\"bullet\" indent={1}>\n * <RichTextSection><RichTextText>Item one</RichTextText></RichTextSection>\n * <RichTextSection><RichTextText>Item two</RichTextText></RichTextSection>\n * </RichTextList>\n * ```\n */\nexport default class RichTextList {\n static slackType = 'RichTextList';\n declare props: Props;\n}\n","\nimport {type SingleOrArray} from '../../utils/type-helpers';\n\nexport type Props = {\n children: SingleOrArray<JSX.Element | string>;\n};\n\n/**\n * A blockquote in rich text — displays content with a visual left-border indent.\n *\n * @example\n * ```tsx\n * <RichTextQuote>\n * <RichTextText>This is a quoted passage.</RichTextText>\n * </RichTextQuote>\n * ```\n */\nexport default class RichTextQuote {\n static slackType = 'RichTextQuote';\n declare props: Props;\n}\n","\nimport {type SingleOrArray} from '../../utils/type-helpers';\n\nexport type Props = {\n children: SingleOrArray<JSX.Element | string>;\n};\n\n/**\n * A preformatted code block in rich text — monospaced, no line wrapping.\n *\n * @example\n * ```tsx\n * <RichTextPreformatted>\n * <RichTextText style={{ code: true }}>const x = 1;</RichTextText>\n * </RichTextPreformatted>\n * ```\n */\nexport default class RichTextPreformatted {\n static slackType = 'RichTextPreformatted';\n declare props: Props;\n}\n","\nimport {type RichTextStyle} from './types';\n\nexport type Props = {\n children: string;\n style?: RichTextStyle;\n};\n\n/**\n * Styled text within a rich text block.\n *\n * Apply bold, italic, strikethrough, or inline code styling via `style`.\n *\n * @example\n * ```tsx\n * <RichTextText style={{ bold: true, italic: true }}>Bold italic</RichTextText>\n * <RichTextText style={{ code: true }}>inline code</RichTextText>\n * ```\n */\nexport default class RichTextText {\n static slackType = 'RichTextText';\n declare props: Props;\n}\n","\nimport {type RichTextStyle} from './types';\n\nexport type Props = {\n url: string;\n children?: string;\n style?: RichTextStyle;\n};\n\n/**\n * A hyperlink within rich text. Displays `children` as the link text,\n * or falls back to the URL if `children` is omitted.\n *\n * @example\n * ```tsx\n * <RichTextLink url=\"https://example.com\" style={{ bold: true }}>Visit us</RichTextLink>\n * ```\n */\nexport default class RichTextLink {\n static slackType = 'RichTextLink';\n declare props: Props;\n}\n","\nexport type Props = {\n userId: string;\n};\n\n/**\n * Mentions a Slack user by ID in rich text (renders as `@username`).\n *\n * @example\n * ```tsx\n * <RichTextUser userId=\"U123456\" />\n * ```\n */\nexport default class RichTextUser {\n static slackType = 'RichTextUser';\n declare props: Props;\n}\n","\nexport type Props = {\n channelId: string;\n};\n\n/**\n * Mentions a Slack channel by ID in rich text (renders as `#channel-name`).\n *\n * @example\n * ```tsx\n * <RichTextChannel channelId=\"C123456\" />\n * ```\n */\nexport default class RichTextChannel {\n static slackType = 'RichTextChannel';\n declare props: Props;\n}\n","\nexport type Props = {\n name: string;\n};\n\n/**\n * Renders an emoji by name in rich text.\n *\n * @example\n * ```tsx\n * <RichTextEmoji name=\"wave\" />\n * ```\n */\nexport default class RichTextEmoji {\n static slackType = 'RichTextEmoji';\n declare props: Props;\n}\n","\nexport type Props = {\n timestamp: number;\n format: string;\n fallback: string;\n};\n\n/**\n * Renders a formatted date that adapts to each viewer's local timezone.\n *\n * `timestamp` is a Unix timestamp. `format` uses Slack's date format tokens\n * (e.g. `\"{date_long} at {time}\"`). `fallback` is shown if rendering fails.\n *\n * @see https://api.slack.com/reference/surfaces/formatting#date-formatting\n *\n * @example\n * ```tsx\n * <RichTextDate\n * timestamp={1700000000}\n * format=\"{date_long} at {time}\"\n * fallback=\"Nov 14, 2023 at 22:13\"\n * />\n * ```\n */\nexport default class RichTextDate {\n static slackType = 'RichTextDate';\n declare props: Props;\n}\n","\nimport {type RichTextBroadcastRange} from './types';\n\nexport type Props = {\n range: RichTextBroadcastRange;\n};\n\n/**\n * A `@here`, `@channel`, or `@everyone` broadcast mention in rich text.\n *\n * @example\n * ```tsx\n * <RichTextBroadcast range=\"here\" />\n * ```\n */\nexport default class RichTextBroadcast {\n static slackType = 'RichTextBroadcast';\n declare props: Props;\n}\n","\nexport type Props = {\n usergroupId: string;\n};\n\n/**\n * Mentions a Slack user group by ID in rich text.\n *\n * @example\n * ```tsx\n * <RichTextUserGroup usergroupId=\"S123456\" />\n * ```\n */\nexport default class RichTextUserGroup {\n static slackType = 'RichTextUserGroup';\n declare props: Props;\n}\n"],"mappings":";;;;;AAwCA,IAAqB,UAArB,MAA6B;AAG7B;AAFE,cADmB,SACZ,aAAY;;;ACdrB,IAAqB,SAArB,MAA4B;AAG5B;AAFE,cADmB,QACZ,aAAY;;;ACGrB,IAAqB,eAArB,MAAkC;AAGlC;AAFE,cADmB,cACZ,aAAY;;;ACZrB,IAAqB,QAArB,MAA2B;AAG3B;AAFE,cADmB,OACZ,aAAY;;;ACDrB,IAAqB,OAArB,MAA0B;AAG1B;AAFE,cADmB,MACZ,aAAY;;;ACArB,IAAqB,aAArB,MAAgC;AAGhC;AAFE,cADmB,YACZ,aAAY;;;ACFrB,IAAqB,iBAArB,MAAoC;AAGpC;AAFE,cADmB,gBACZ,aAAY;;;ACGrB,IAAqB,aAArB,MAAgC;AAGhC;AAFE,cADmB,YACZ,aAAY;;;ACPrB,IAAqB,cAArB,MAAiC;AAGjC;AAFE,cADmB,aACZ,aAAY;;;ACDrB,IAAqB,SAArB,MAA4B;AAG5B;AAFE,cADmB,QACZ,aAAY;;;ACIrB,IAAqB,WAArB,MAA8B;AAG9B;AAFE,cADmB,UACZ,aAAY;;;ACCrB,IAAqB,aAArB,MAAgC;AAGhC;AAFE,cADmB,YACZ,aAAY;;;AC+BrB,IAAqB,SAArB,MAA4B;AAG5B;AAFE,cADmB,QACZ,aAAY;;;AC7BrB,IAAqB,YAArB,MAA+B;AAG/B;AAFE,cADmB,WACZ,aAAY;;;ACTrB,IAAqB,aAArB,MAAgC;AAGhC;AAFE,cADmB,YACZ,aAAY;;;ACArB,IAAqB,UAArB,MAA6B;A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;AAGlC;AAFE,cADmB,cACZ,aAAY;;;ACVrB,IAAqB,oBAArB,MAAuC;AAGvC;AAFE,cADmB,mBACZ,aAAY;;;ACHrB,IAAqB,oBAArB,MAAuC;AAGvC;AAFE,cADmB,mBACZ,aAAY;","names":["Image"]}
1
+ {"version":3,"sources":["../src/components/message.tsx","../src/components/block/button.tsx","../src/components/block/confirmation.tsx","../src/components/block/image.tsx","../src/components/block/text.tsx","../src/components/input/date-picker.tsx","../src/components/input/date-time-picker.tsx","../src/components/input/checkboxes.tsx","../src/components/input/option-group.tsx","../src/components/input/option.tsx","../src/components/input/overflow.tsx","../src/components/input/radio-group.tsx","../src/components/input/select.tsx","../src/components/input/text.tsx","../src/components/input/time-picker.tsx","../src/components/layout/actions.tsx","../src/components/layout/context.tsx","../src/components/layout/divider.tsx","../src/components/layout/file.tsx","../src/components/layout/header.tsx","../src/components/layout/image.tsx","../src/components/layout/input.tsx","../src/components/layout/rich-text.tsx","../src/components/layout/section.tsx","../src/components/layout/container.tsx","../src/components/layout/video.tsx","../src/components/rich-text/section.tsx","../src/components/rich-text/list.tsx","../src/components/rich-text/quote.tsx","../src/components/rich-text/preformatted.tsx","../src/components/rich-text/text.tsx","../src/components/rich-text/link.tsx","../src/components/rich-text/user.tsx","../src/components/rich-text/channel.tsx","../src/components/rich-text/emoji.tsx","../src/components/rich-text/date.tsx","../src/components/rich-text/broadcast.tsx","../src/components/rich-text/user-group.tsx"],"sourcesContent":["\nimport {type Child} from '../constants/types';\n\n/**\n * Props for the `<Message>` component.\n *\n * The top-level element required by `render()` / `renderToMessage()`.\n * Add blocks as children; use `text` as a fallback for notifications.\n */\nexport type Properties = {\n children?: Child;\n channel?: string;\n user?: string;\n text?: string;\n asUser?: boolean;\n iconEmoji?: string;\n iconUrl?: string;\n markdown?: boolean;\n parse?: 'full' | 'none';\n replyBroadcast?: boolean;\n replyTo?: string;\n unfurlLinks?: boolean;\n unfurlMedia?: boolean;\n username?: string;\n color?: string;\n};\n\n/**\n * Root element for a Slack chat message.\n *\n * Must be the top-level element passed to `render()`.\n * Add layout blocks as children.\n *\n * @example\n * ```tsx\n * render(\n * <Message text=\"Fallback\">\n * <Header text=\"Hello\" />\n * </Message>\n * );\n * ```\n */\nexport default class Message {\n static slackType = 'Message';\n declare props: Properties;\n}\n","\ntype TopProperties = {\n children: string;\n actionId: string;\n url?: string;\n value?: string;\n style?: 'primary' | 'danger';\n accessibilityLabel?: string;\n};\n\nexport type ButtonProps = TopProperties & {\n confirm?: JSX.Element;\n};\n\ntype Properties = ButtonProps;\n\n/**\n * A button element — clickable button used in `<Actions>` blocks or as a\n * `<Section>` accessory.\n *\n * @example\n * ```tsx\n * <Button actionId=\"submit\" style=\"primary\" value=\"yes\">Submit</Button>\n * <Button actionId=\"delete\" style=\"danger\" confirm={confirmDialog}>Delete</Button>\n * <Button actionId=\"docs\" url=\"https://example.com\">View docs</Button>\n * ```\n */\nexport default class Button {\n static slackType = 'Button';\n declare props: Properties;\n}\n","\ntype TopProperties = {\n title: string;\n confirm: string;\n deny: string;\n};\n\n/* This is a dumb workaround to merging props */\nexport type ConfirmationProps = TopProperties & {\n children: JSX.Element;\n};\n\ntype Properties = ConfirmationProps;\n\n/**\n * A confirmation dialog — shown before an interactive action is triggered.\n *\n * Pass a `<Confirmation>` element to the `confirm` prop of interactive\n * elements such as `<Button>`, `<Select>`, `<Overflow>`, etc.\n *\n * @example\n * ```tsx\n * const dialog = (\n * <Confirmation title=\"Are you sure?\" confirm=\"Yes, delete\" deny=\"Cancel\">\n * <Text plainText>This action cannot be undone.</Text>\n * </Confirmation>\n * );\n *\n * <Button actionId=\"delete\" confirm={dialog} style=\"danger\">Delete</Button>\n * ```\n */\nexport default class Confirmation {\n static slackType = 'Confirmation';\n declare props: Properties;\n}\n","\nexport type Props = {\n url: string;\n alt: string;\n};\n\n/**\n * An image element — displays an inline image inside `<Context>` or as a\n * `<Section>` accessory.\n *\n * For a full-width image block, use `<ImageLayout>` instead.\n *\n * @example\n * ```tsx\n * <Context>\n * <Image url=\"https://example.com/icon.png\" alt=\"icon\" />\n * <Text>Some context</Text>\n * </Context>\n * ```\n */\nexport default class Image {\n static slackType = 'Image';\n declare props: Props;\n}\n","\nexport type Props = {\n children: string;\n plainText?: boolean;\n emoji?: boolean;\n verbatim?: boolean;\n};\n\n/**\n * A text object — renders as `mrkdwn` (default) or `plain_text`.\n *\n * Used as the `text` prop on `<Section>`, `<Header>`, inside `<Context>`,\n * and as a child of `<Section>` for fields.\n *\n * @example\n * ```tsx\n * <Text>Hello *world*</Text>\n * <Text plainText emoji>Hello :wave:</Text>\n * ```\n */\nexport default class Text {\n static slackType = 'Text';\n declare props: Props;\n}\n","\nexport type Props = {\n actionId: string;\n placeholder?: string;\n initialDate?: string;\n confirm?: JSX.Element;\n focusOnLoad?: boolean;\n};\n\n/**\n * A date picker — a calendar-style date selector.\n *\n * `initialDate` must be in `YYYY-MM-DD` format.\n *\n * @example\n * ```tsx\n * <Input label=\"Due date\" element={\n * <DatePicker actionId=\"due_date\" initialDate=\"2024-12-31\" />\n * } />\n * ```\n */\nexport default class DatePicker {\n static slackType = 'DatePicker';\n declare props: Props;\n}\n","\nexport type Props = {\n actionId: string;\n initialDateTime?: number;\n confirm?: JSX.Element;\n focusOnLoad?: boolean;\n};\n\n/**\n * A combined date and time picker.\n *\n * `initialDateTime` is a Unix timestamp (seconds since epoch).\n *\n * @example\n * ```tsx\n * <Input label=\"Scheduled at\" element={\n * <DateTimePicker actionId=\"scheduled_at\" initialDateTime={1700000000} />\n * } />\n * ```\n */\nexport default class DateTimePicker {\n static slackType = 'DateTimePicker';\n declare props: Props;\n}\n","\nimport {type SingleOrArray} from '../../utils/type-helpers';\n\nexport type Props = {\n actionId: string;\n children: SingleOrArray<JSX.Element>;\n initialOptions?: JSX.Element[];\n confirm?: JSX.Element;\n focusOnLoad?: boolean;\n};\n\n/**\n * A checkbox group — allows multiple selections from a list of options.\n *\n * Pass `<Option>` elements as children. Pre-check options via `initialOptions`.\n *\n * @example\n * ```tsx\n * <Checkboxes actionId=\"prefs\" initialOptions={[slackOption]}>\n * <Option value=\"emails\">Emails</Option>\n * <Option value=\"slack\">Slack</Option>\n * </Checkboxes>\n * ```\n */\nexport default class Checkboxes {\n static slackType = 'Checkboxes';\n declare props: Props;\n}\n","\nexport type Props = {\n label: string;\n children: JSX.Element | JSX.Element[];\n};\n\n/**\n * Groups options under a labeled heading inside a `<Select>`.\n *\n * @example\n * ```tsx\n * <Select placeholder=\"Pick one\" actionId=\"grouped\">\n * <OptionGroup label=\"Fruits\">\n * <Option value=\"apple\">Apple</Option>\n * </OptionGroup>\n * </Select>\n * ```\n */\nexport default class OptionGroup {\n static slackType = 'OptionGroup';\n declare props: Props;\n}\n","\nexport type Props = {\n children: string;\n value: string;\n url?: string;\n description?: string;\n};\n\n/**\n * An option item for `<Select>`, `<Checkboxes>`, `<RadioGroup>`, or `<Overflow>`.\n *\n * The children (text) is the display label; `value` is sent in the action payload.\n *\n * @example\n * ```tsx\n * <Option value=\"opt_a\" description=\"The first option\">Option A</Option>\n * ```\n */\nexport default class Option {\n static slackType = 'Option';\n declare props: Props;\n}\n","\nimport {type SingleOrArray} from '../../utils/type-helpers';\n\nexport type Props = {\n actionId: string;\n children: SingleOrArray<JSX.Element>;\n confirm?: JSX.Element;\n};\n\n/**\n * An overflow menu — the \"⋯\" button that reveals a list of options.\n *\n * Requires at least 2 `<Option>` children. Options can include a `url` to open a link.\n *\n * @example\n * ```tsx\n * <Overflow actionId=\"more\">\n * <Option value=\"edit\">Edit</Option>\n * <Option value=\"delete\">Delete</Option>\n * <Option value=\"docs\" url=\"https://example.com/docs\">View docs</Option>\n * </Overflow>\n * ```\n */\nexport default class Overflow {\n static slackType = 'Overflow';\n declare props: Props;\n}\n","\nimport {type SingleOrArray} from '../../utils/type-helpers';\n\nexport type Props = {\n actionId: string;\n children: SingleOrArray<JSX.Element>;\n initialOption?: JSX.Element;\n confirm?: JSX.Element;\n focusOnLoad?: boolean;\n};\n\n/**\n * A radio button group — allows exactly one selection from a list of options.\n *\n * Pass `<Option>` elements as children. Pre-select an option via `initialOption`.\n *\n * @example\n * ```tsx\n * <RadioGroup actionId=\"size\" initialOption={<Option value=\"m\">Medium</Option>}>\n * <Option value=\"s\">Small</Option>\n * <Option value=\"m\">Medium</Option>\n * <Option value=\"l\">Large</Option>\n * </RadioGroup>\n * ```\n */\nexport default class RadioGroup {\n static slackType = 'RadioGroup';\n declare props: Props;\n}\n","\nimport {type SingleOrArray} from '../../utils/type-helpers';\n\nexport const selectTypes = {\n STATIC: 'static',\n EXTERNAL: 'external',\n USER: 'user',\n CONVERSATION: 'conversation',\n CHANNEL: 'channel',\n} as const;\n\ntype SelectType = typeof selectTypes[keyof typeof selectTypes];\n\ntype ConversationFilter = {\n include?: Array<'im' | 'mpim' | 'private' | 'public'>;\n excludeExternalSharedChannels?: boolean;\n excludeBotUsers?: boolean;\n};\n\nexport type Props = {\n placeholder: string;\n actionId: string;\n type?: SelectType;\n multi?: boolean;\n children?: SingleOrArray<JSX.Element>;\n initialOptions?: JSX.Element[];\n confirm?: JSX.Element;\n maxSelectedItems?: number;\n minQueryLength?: number;\n focusOnLoad?: boolean;\n initialUsers?: string[];\n initialConversations?: string[];\n initialChannels?: string[];\n defaultToCurrentConversation?: boolean;\n responseUrlEnabled?: boolean;\n filter?: ConversationFilter;\n};\n\n/**\n * A select menu — supports static options, external data sources, and user /\n * channel / conversation lists. Can be single or multi-select.\n *\n * Use the `type` prop to switch data sources (default: `'static'`).\n * Pass `<Option>` or `<OptionGroup>` children for static selects.\n *\n * @example\n * ```tsx\n * // Static single-select\n * <Select placeholder=\"Pick one\" actionId=\"color\">\n * <Option value=\"red\">Red</Option>\n * <Option value=\"blue\">Blue</Option>\n * </Select>\n *\n * // User multi-select\n * <Select type=\"user\" multi placeholder=\"Pick users\" actionId=\"mentions\" />\n * ```\n */\nexport default class Select {\n static slackType = 'Select';\n declare props: Props;\n}\n","\nexport type Props = {\n actionId: string;\n placeholder?: string;\n initial?: string;\n multiline?: boolean;\n minLength?: number;\n maxLength?: number;\n focusOnLoad?: boolean;\n dispatchActionConfig?: {\n triggerActionsOn: Array<'on_enter_pressed' | 'on_character_entered'>;\n };\n};\n\n/**\n * A plain-text input field — used as the `element` prop inside `<Input>`.\n *\n * @example\n * ```tsx\n * <Input label=\"Your name\" element={\n * <TextInput\n * actionId=\"name\"\n * placeholder=\"Jane Doe\"\n * maxLength={80}\n * focusOnLoad\n * />\n * } />\n * ```\n */\nexport default class TextInput {\n static slackType = 'TextInput';\n declare props: Props;\n}\n","\nexport type Props = {\n actionId: string;\n placeholder?: string;\n initialTime?: string;\n confirm?: JSX.Element;\n focusOnLoad?: boolean;\n};\n\n/**\n * A time picker — a clock-style time selector.\n *\n * `initialTime` must be in `HH:mm` (24-hour) format.\n *\n * @example\n * ```tsx\n * <Input label=\"Meeting time\" element={\n * <TimePicker actionId=\"meeting_time\" initialTime=\"09:00\" />\n * } />\n * ```\n */\nexport default class TimePicker {\n static slackType = 'TimePicker';\n declare props: Props;\n}\n","\nimport {type InteractiveBlockElement} from '../../constants/types';\n\nexport type Props = {\n children: InteractiveBlockElement | InteractiveBlockElement[];\n blockId?: string;\n};\n\n/**\n * An actions block — displays interactive elements in a horizontal row.\n *\n * Accepts up to 25 interactive elements as children: `<Button>`, `<Select>`,\n * `<Overflow>`, `<DatePicker>`, `<TimePicker>`, `<DateTimePicker>`.\n *\n * @example\n * ```tsx\n * <Actions>\n * <Button actionId=\"approve\" style=\"primary\">Approve</Button>\n * <Button actionId=\"deny\" style=\"danger\">Deny</Button>\n * </Actions>\n * ```\n */\nexport default class Actions {\n static slackType = 'Actions';\n declare props: Props;\n}\n","\nexport type ImageOrText = JSX.Element;\n\nexport type Props = {\n children: ImageOrText | ImageOrText[];\n blockId?: string;\n};\n\n/**\n * A context block — displays small text and images in a horizontal row.\n *\n * Accepts up to 10 `<Text>` or `<Image>` elements as children.\n *\n * @example\n * ```tsx\n * <Context>\n * <Image url=\"https://example.com/avatar.png\" alt=\"avatar\" />\n * <Text>Posted by *Jane Doe*</Text>\n * </Context>\n * ```\n */\nexport default class Context {\n static slackType = 'Context';\n declare props: Props;\n}\n","\nexport type Props = {\n blockId?: string;\n};\n\n/**\n * A divider block — renders a horizontal rule between blocks.\n *\n * @example\n * ```tsx\n * <Divider />\n * ```\n */\nexport default class Divider {\n static slackType = 'Divider';\n declare props: Props;\n}\n","\nexport type Props = {\n externalId: string;\n blockId?: string;\n};\n\n/**\n * A file block — embeds a remote file that has been shared in Slack.\n *\n * @example\n * ```tsx\n * <File externalId=\"my-report-id\" />\n * ```\n */\nexport default class File {\n static slackType = 'File';\n declare props: Props;\n}\n","\nexport type Props = {\n text: string;\n blockId?: string;\n emoji?: boolean;\n};\n\n/**\n * A header block — displays large, bold plain text at the top of a section.\n *\n * Maximum 150 characters.\n *\n * @example\n * ```tsx\n * <Header text=\"Deploy complete\" emoji />\n * ```\n */\nexport default class Header {\n static slackType = 'Header';\n declare props: Props;\n}\n","\nexport type Props = {\n url: string;\n alt: string;\n title?: string;\n blockId?: string;\n};\n\n/**\n * An image layout block — displays a full-width image.\n *\n * Imported as `ImageLayout` to avoid ambiguity with the `<Image>` element.\n *\n * @example\n * ```tsx\n * import { ImageLayout } from 'slackblock/block';\n *\n * <ImageLayout\n * url=\"https://example.com/chart.png\"\n * alt=\"Sales chart\"\n * title=\"Q4 Results\"\n * />\n * ```\n */\nexport default class Image {\n static slackType = 'ImageLayout';\n declare props: Props;\n}\n","\nimport {type InputBlockElement} from '../../constants/types';\n\nexport type Props = {\n label: string;\n element: InputBlockElement;\n hint?: string;\n optional?: boolean;\n blockId?: string;\n};\n\n/**\n * An input block — wraps a single interactive input element with a label.\n *\n * Pass the input element via the `element` prop (not as a child).\n *\n * @example\n * ```tsx\n * <Input\n * label=\"Your name\"\n * hint=\"Use your full name\"\n * element={<TextInput actionId=\"name\" placeholder=\"Jane Doe\" />}\n * />\n * ```\n */\nexport default class Input {\n static slackType = 'Input';\n declare props: Props;\n}\n","\nimport {type SingleOrArray} from '../../utils/type-helpers';\n\nexport type RichTextElement = Record<string, unknown>;\n\nexport type Props = {\n elements?: RichTextElement[];\n children?: SingleOrArray<JSX.Element | string>;\n blockId?: string;\n};\n\n/**\n * A rich text block — contains formatted text with inline styling, lists,\n * quotes, and preformatted code.\n *\n * Accepts `<RichTextSection>`, `<RichTextList>`, `<RichTextQuote>`, and\n * `<RichTextPreformatted>` as children.\n *\n * @example\n * ```tsx\n * <RichText>\n * <RichTextSection>\n * <RichTextText style={{ bold: true }}>Hello</RichTextText>\n * </RichTextSection>\n * </RichText>\n * ```\n */\nexport default class RichText {\n static slackType = 'RichText';\n declare props: Props;\n}\n","\nimport {type BlockElement} from '../../constants/types';\nimport {type SingleOrArray} from '../../utils/type-helpers';\n\ntype TextElement = JSX.Element;\n\nexport type Props = {\n text: JSX.Element;\n blockId?: string;\n // eslint-disable-next-line @typescript-eslint/no-restricted-types -- We actually want to handle null children\n children?: SingleOrArray<TextElement | null | undefined | false>;\n accessory?: BlockElement;\n};\n\n/**\n * A section block — the most versatile layout block.\n *\n * Displays a primary text label, optional two-column fields (children),\n * and an optional accessory element on the right.\n *\n * @example\n * ```tsx\n * <Section\n * text={<Text>Hello *world*</Text>}\n * accessory={<Button actionId=\"more\">More</Button>}\n * >\n * <Text plainText>Field A</Text>\n * <Text plainText>Field B</Text>\n * </Section>\n * ```\n */\nexport default class Section {\n static slackType = 'Section';\n declare props: Props;\n}\n","\nimport {type SingleOrArray} from '../../utils/type-helpers';\nimport {type Child} from '../../constants/types';\n\nexport type Props = {\n children: SingleOrArray<Child>;\n};\n\n/**\n * A pass-through utility component that renders its children without adding\n * any wrapper block. Useful for conditional rendering and mapping arrays\n * without introducing an extra layout layer.\n *\n * @example\n * ```tsx\n * <Message text=\"Hello\">\n * {isAdmin && (\n * <Container>\n * <Section text={<Text>Admin section</Text>} />\n * <Divider />\n * </Container>\n * )}\n * </Message>\n * ```\n */\nexport default class Container {\n static slackType = 'Container';\n declare props: Props;\n}\n","\nexport type Props = {\n title: string;\n videoUrl: string;\n thumbnailUrl: string;\n altText: string;\n titleUrl?: string;\n description?: string;\n authorName?: string;\n providerName?: string;\n providerIconUrl?: string;\n blockId?: string;\n};\n\n/**\n * A video block — embeds an external video with a thumbnail, title, and metadata.\n *\n * @example\n * ```tsx\n * <Video\n * title=\"Product Demo\"\n * videoUrl=\"https://example.com/demo.mp4\"\n * thumbnailUrl=\"https://example.com/thumb.png\"\n * altText=\"Product demo video\"\n * authorName=\"Product Team\"\n * />\n * ```\n */\nexport default class Video {\n static slackType = 'Video';\n declare props: Props;\n}\n","\nimport {type SingleOrArray} from '../../utils/type-helpers';\n\nexport type Props = {\n children: SingleOrArray<JSX.Element | string>;\n};\n\n/**\n * An inline container for rich text content within a `<RichText>` block.\n * Also used as individual list items inside `<RichTextList>`.\n *\n * @example\n * ```tsx\n * <RichTextSection>\n * <RichTextText style={{ bold: true }}>Hello</RichTextText>\n * {' world'}\n * </RichTextSection>\n * ```\n */\nexport default class RichTextSection {\n static slackType = 'RichTextSection';\n declare props: Props;\n}\n","\nimport {type SingleOrArray} from '../../utils/type-helpers';\n\nimport {type RichTextListStyle} from './types';\n\nexport type Props = {\n style: RichTextListStyle;\n children: SingleOrArray<JSX.Element | string>;\n indent?: number;\n border?: number;\n};\n\n/**\n * A bulleted or numbered list in rich text.\n *\n * Each list item should be a `<RichTextSection>` child.\n * Supports indentation (`indent` 0–6) and border styling.\n *\n * @example\n * ```tsx\n * <RichTextList style=\"bullet\" indent={1}>\n * <RichTextSection><RichTextText>Item one</RichTextText></RichTextSection>\n * <RichTextSection><RichTextText>Item two</RichTextText></RichTextSection>\n * </RichTextList>\n * ```\n */\nexport default class RichTextList {\n static slackType = 'RichTextList';\n declare props: Props;\n}\n","\nimport {type SingleOrArray} from '../../utils/type-helpers';\n\nexport type Props = {\n children: SingleOrArray<JSX.Element | string>;\n};\n\n/**\n * A blockquote in rich text — displays content with a visual left-border indent.\n *\n * @example\n * ```tsx\n * <RichTextQuote>\n * <RichTextText>This is a quoted passage.</RichTextText>\n * </RichTextQuote>\n * ```\n */\nexport default class RichTextQuote {\n static slackType = 'RichTextQuote';\n declare props: Props;\n}\n","\nimport {type SingleOrArray} from '../../utils/type-helpers';\n\nexport type Props = {\n children: SingleOrArray<JSX.Element | string>;\n};\n\n/**\n * A preformatted code block in rich text — monospaced, no line wrapping.\n *\n * @example\n * ```tsx\n * <RichTextPreformatted>\n * <RichTextText style={{ code: true }}>const x = 1;</RichTextText>\n * </RichTextPreformatted>\n * ```\n */\nexport default class RichTextPreformatted {\n static slackType = 'RichTextPreformatted';\n declare props: Props;\n}\n","\nimport {type RichTextStyle} from './types';\n\nexport type Props = {\n children: string;\n style?: RichTextStyle;\n};\n\n/**\n * Styled text within a rich text block.\n *\n * Apply bold, italic, strikethrough, or inline code styling via `style`.\n *\n * @example\n * ```tsx\n * <RichTextText style={{ bold: true, italic: true }}>Bold italic</RichTextText>\n * <RichTextText style={{ code: true }}>inline code</RichTextText>\n * ```\n */\nexport default class RichTextText {\n static slackType = 'RichTextText';\n declare props: Props;\n}\n","\nimport {type RichTextStyle} from './types';\n\nexport type Props = {\n url: string;\n children?: string;\n style?: RichTextStyle;\n};\n\n/**\n * A hyperlink within rich text. Displays `children` as the link text,\n * or falls back to the URL if `children` is omitted.\n *\n * @example\n * ```tsx\n * <RichTextLink url=\"https://example.com\" style={{ bold: true }}>Visit us</RichTextLink>\n * ```\n */\nexport default class RichTextLink {\n static slackType = 'RichTextLink';\n declare props: Props;\n}\n","\nexport type Props = {\n userId: string;\n};\n\n/**\n * Mentions a Slack user by ID in rich text (renders as `@username`).\n *\n * @example\n * ```tsx\n * <RichTextUser userId=\"U123456\" />\n * ```\n */\nexport default class RichTextUser {\n static slackType = 'RichTextUser';\n declare props: Props;\n}\n","\nexport type Props = {\n channelId: string;\n};\n\n/**\n * Mentions a Slack channel by ID in rich text (renders as `#channel-name`).\n *\n * @example\n * ```tsx\n * <RichTextChannel channelId=\"C123456\" />\n * ```\n */\nexport default class RichTextChannel {\n static slackType = 'RichTextChannel';\n declare props: Props;\n}\n","\nexport type Props = {\n name: string;\n};\n\n/**\n * Renders an emoji by name in rich text.\n *\n * @example\n * ```tsx\n * <RichTextEmoji name=\"wave\" />\n * ```\n */\nexport default class RichTextEmoji {\n static slackType = 'RichTextEmoji';\n declare props: Props;\n}\n","\nexport type Props = {\n timestamp: number;\n format: string;\n fallback: string;\n};\n\n/**\n * Renders a formatted date that adapts to each viewer's local timezone.\n *\n * `timestamp` is a Unix timestamp. `format` uses Slack's date format tokens\n * (e.g. `\"{date_long} at {time}\"`). `fallback` is shown if rendering fails.\n *\n * @see https://api.slack.com/reference/surfaces/formatting#date-formatting\n *\n * @example\n * ```tsx\n * <RichTextDate\n * timestamp={1700000000}\n * format=\"{date_long} at {time}\"\n * fallback=\"Nov 14, 2023 at 22:13\"\n * />\n * ```\n */\nexport default class RichTextDate {\n static slackType = 'RichTextDate';\n declare props: Props;\n}\n","\nimport {type RichTextBroadcastRange} from './types';\n\nexport type Props = {\n range: RichTextBroadcastRange;\n};\n\n/**\n * A `@here`, `@channel`, or `@everyone` broadcast mention in rich text.\n *\n * @example\n * ```tsx\n * <RichTextBroadcast range=\"here\" />\n * ```\n */\nexport default class RichTextBroadcast {\n static slackType = 'RichTextBroadcast';\n declare props: Props;\n}\n","\nexport type Props = {\n usergroupId: string;\n};\n\n/**\n * Mentions a Slack user group by ID in rich text.\n *\n * @example\n * ```tsx\n * <RichTextUserGroup usergroupId=\"S123456\" />\n * ```\n */\nexport default class RichTextUserGroup {\n static slackType = 'RichTextUserGroup';\n declare props: Props;\n}\n"],"mappings":";;;;;AA0CA,IAAqB,UAArB,MAA6B;AAG7B;AAFE,cADmB,SACZ,aAAY;;;AChBrB,IAAqB,SAArB,MAA4B;AAG5B;AAFE,cADmB,QACZ,aAAY;;;ACGrB,IAAqB,eAArB,MAAkC;AAGlC;AAFE,cADmB,cACZ,aAAY;;;ACZrB,IAAqB,QA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MAA6B;AAG7B;AAFE,cADmB,SACZ,aAAY;;;ACPrB,IAAqB,YAArB,MAA+B;AAG/B;AAFE,cADmB,WACZ,aAAY;;;ACErB,IAAqB,QAArB,MAA2B;AAG3B;AAFE,cADmB,OACZ,aAAY;;;ACVrB,IAAqB,kBAArB,MAAqC;AAGrC;AAFE,cADmB,iBACZ,aAAY;;;ACMrB,IAAqB,eAArB,MAAkC;AAGlC;AAFE,cADmB,cACZ,aAAY;;;ACVrB,IAAqB,gBAArB,MAAmC;AAGnC;AAFE,cADmB,eACZ,aAAY;;;ACDrB,IAAqB,uBAArB,MAA0C;AAG1C;AAFE,cADmB,sBACZ,aAAY;;;ACCrB,IAAqB,eAArB,MAAkC;AAGlC;AAFE,cADmB,cACZ,aAAY;;;ACFrB,IAAqB,eAArB,MAAkC;AAGlC;AAFE,cADmB,cACZ,aAAY;;;ACNrB,IAAqB,eAArB,MAAkC;AAGlC;AAFE,cADmB,cACZ,aAAY;;;ACDrB,IAAqB,kBAArB,MAAqC;AAGrC;AAFE,cADmB,iBACZ,aAAY;;;ACDrB,IAAqB,gBAArB,MAAmC;AAGnC;AAFE,cADmB,eACZ,aAAY;;;ACUrB,IAAqB,eAArB,MAAkC;AAGlC;AAFE,cADmB,cACZ,aAAY;;;ACVrB,IAAqB,oBAArB,MAAuC;AAGvC;AAFE,cADmB,mBACZ,aAAY;;;ACHrB,IAAqB,oBAArB,MAAuC;AAGvC;AAFE,cADmB,mBACZ,aAAY;","names":["Image"]}
package/dist/index.cjs CHANGED
@@ -1238,33 +1238,41 @@ var applyMessageMetadata = (json, properties) => {
1238
1238
  json.unfurl_media = properties.unfurlMedia;
1239
1239
  }
1240
1240
  };
1241
- var render = (element, options) => {
1242
- var _a, _b;
1241
+ function render(element, options) {
1242
+ var _a, _b, _c, _d, _e;
1243
1243
  initContext((_a = options == null ? void 0 : options.validate) != null ? _a : "warn");
1244
1244
  const properties = element.props;
1245
1245
  const typeName = get_type_default(element);
1246
1246
  if (typeName !== "Message") {
1247
1247
  throw new TypeError("Provided top-level element must be a Message type.");
1248
1248
  }
1249
- if (!properties.children) {
1250
- throw new Error("Cannot render a Message with no children.");
1249
+ if (!properties.children && !properties.text) {
1250
+ throw new Error("Cannot render a Message with no children or text.");
1251
1251
  }
1252
1252
  pushPath("Message");
1253
1253
  let json;
1254
1254
  try {
1255
- json = { ...parser_default(properties.children) };
1255
+ json = Object.assign({}, parser_default(properties.children));
1256
1256
  if (properties.replyTo) {
1257
1257
  json.thread_ts = properties.replyTo;
1258
1258
  }
1259
1259
  if (properties.markdown !== void 0) {
1260
1260
  json.mrkdwn = properties.markdown;
1261
1261
  }
1262
- json.text = (_b = properties.text) != null ? _b : "";
1262
+ json.text = (_c = (_b = properties.text) != null ? _b : json.text) != null ? _c : "";
1263
1263
  if (properties.text && properties.text.length > MAX_MESSAGE_TEXT) {
1264
1264
  warnIfTooLong(`Message text (Slack will truncate beyond ${MAX_MESSAGE_TEXT} chars)`, properties.text, MAX_MESSAGE_TEXT);
1265
1265
  } else if (properties.text) {
1266
1266
  warnIfTooLong("Message text (recommended max for best results)", properties.text, RECOMMENDED_MESSAGE_TEXT);
1267
1267
  }
1268
+ const channel = (_d = options == null ? void 0 : options.channel) != null ? _d : properties.channel;
1269
+ const user = (_e = options == null ? void 0 : options.user) != null ? _e : properties.user;
1270
+ if (channel) {
1271
+ json.channel = channel;
1272
+ }
1273
+ if (user) {
1274
+ json.user = user;
1275
+ }
1268
1276
  applyMessageMetadata(json, properties);
1269
1277
  if (properties.color && json.blocks) {
1270
1278
  json.attachments = [
@@ -1283,7 +1291,7 @@ var render = (element, options) => {
1283
1291
  popPath();
1284
1292
  }
1285
1293
  return json;
1286
- };
1294
+ }
1287
1295
  var renderer_default = render;
1288
1296
 
1289
1297
  // src/utils/escape-mrkdwn.ts