@tightknitai/block-kitchen 0.10.20 → 0.10.21

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.
@@ -975,10 +975,19 @@ interface MentionUser {
975
975
  avatarUrl?: string | null;
976
976
  }
977
977
  /**
978
- * Opt-in `@` mentions for the rich text editor, passed as
979
- * {@link BlockKitchenBaseProps.mentions}. Typing `@` (or the toolbar's
980
- * mention button) opens a picker backed by the host's search; picking someone
981
- * inserts a rich text `user` element (`{ type: 'user', user_id }`).
978
+ * A Slack channel the rich text editor's `#` picker offers, returned by
979
+ * {@link MentionsConfig.searchChannels}.
980
+ */
981
+ interface MentionChannel {
982
+ /** Slack channel id (`C…` / `G…`), written to the rich text `channel` element's `channel_id`. */
983
+ id: string;
984
+ /** Name shown in the picker row and on the inserted mention. */
985
+ name: string;
986
+ }
987
+ /**
988
+ * Opt-in `@` user and `#` channel mentions for the rich text editor, passed as
989
+ * {@link BlockKitchenBaseProps.mentions}. Each configured search powers its
990
+ * typed trigger and toolbar action.
982
991
  *
983
992
  * Like every other I/O concern, the search is brokered by the host: the
984
993
  * builder never looks people up itself.
@@ -999,6 +1008,18 @@ interface MentionsConfig {
999
1008
  * from the search, then the raw id.
1000
1009
  */
1001
1010
  getUserName?: (userId: string) => string | undefined;
1011
+ /**
1012
+ * Optional. Searches the channels the picker offers. Called with the text
1013
+ * typed after `#` and the same debounce/abort behavior as `searchUsers`.
1014
+ */
1015
+ searchChannels?: (query: string, options: {
1016
+ signal: AbortSignal;
1017
+ }) => Promise<MentionChannel[]>;
1018
+ /**
1019
+ * Optional. Labels a channel mention in the editor by channel id. Return
1020
+ * `undefined` to fall back to the picked name, then the raw id.
1021
+ */
1022
+ getChannelName?: (channelId: string) => string | undefined;
1002
1023
  }
1003
1024
  /**
1004
1025
  * Hooks forwarded to `slack-blocks-to-jsx`'s `<Message>` so the consumer can
@@ -1118,10 +1139,9 @@ interface BlockKitchenBaseProps {
1118
1139
  */
1119
1140
  customEmojis?: CustomEmoji[];
1120
1141
  /**
1121
- * Opt-in `@` mentions in the rich text editor: an `@` trigger and a toolbar
1122
- * button that search people through the host. See {@link MentionsConfig}.
1123
- * Without it, mentions already in the draft still round-trip and display by
1124
- * raw id, but there is no picker.
1142
+ * Opt-in `@` user and `#` channel mentions in the rich text editor. See
1143
+ * {@link MentionsConfig}. Existing mentions still round-trip without picker
1144
+ * configuration and display by raw id.
1125
1145
  */
1126
1146
  mentions?: MentionsConfig;
1127
1147
  /**
@@ -1407,4 +1427,4 @@ interface BlockKitchenComposeOnlyProps {
1407
1427
  */
1408
1428
  type BlockKitchenProps = BlockKitchenBaseProps & (BlockKitchenSendProps | BlockKitchenComposeOnlyProps);
1409
1429
 
1410
- export { type PieChart as $, type AlertBlock as A, type BlockKitchenProps as B, type ChannelOption as C, type DataTableActionCell as D, type DataTableCell as E, type DataTableRawNumberCell as F, type DataVisualizationBlock as G, type EditableVia as H, type FeedbackButtonSubobject as I, type FeedbackButtonsElement as J, type HeaderLevel as K, type IconButtonElement as L, type IconButtonIcon as M, type InputBlock as N, type LoadMessageInput as O, type PreviewSurface as P, type LoadResult as Q, type LoadedMessage as R, type SupportedBlock as S, type Template as T, type LoadingConfig as U, type MarkdownBlock as V, type MentionUser as W, type MentionsConfig as X, type PaletteMode as Y, type PaletteSection as Z, type PaletteVariant as _, type SendAsUserStatus as a, type PieChartSegment as a0, type PlanBlock as a1, type PreviewHooks as a2, type PrimaryActionConfig as a3, type PrimaryActionContext as a4, type RecentMessage as a5, type SendResult as a6, type SupportedBlockType as a7, type SupportedHeaderBlock as a8, type TableBlock as a9, type TableCell as aa, type TableColumnSetting as ab, type TableRawTextCell as ac, type TaskCardBlock as ad, type TaskCardStatus as ae, type UpdatePayload as af, type UpdateResult as ag, type UrlSourceElement as ah, type ValidationSummary as ai, type VideoBlock as aj, defaultPalette as ak, extraAlertVariant as al, legacyInputVariants as am, buildVariantById as an, type SendPayload as b, type SendExtrasContext as c, type PreviewTheme as d, type AlertLevel as e, type BlockKitchenBaseProps as f, type BlockKitchenComposeOnlyProps as g, type BlockKitchenSendProps as h, type BrandPreset as i, type BrandTheme as j, type BrandTokens as k, type BuilderBlock as l, type CardBlock as m, type CarouselBlock as n, type CartesianChart as o, type Chart as p, type ChartAxisConfig as q, type ChartDataPoint as r, type ChartSeries as s, type ChartType as t, type ContainerBlock as u, type ContainerChildBlock as v, type ContextActionsBlock as w, type ContextActionsElement as x, type CustomEmoji as y, type DataTableBlock as z };
1430
+ export { type PaletteVariant as $, type AlertBlock as A, type BlockKitchenProps as B, type ChannelOption as C, type DataTableActionCell as D, type DataTableCell as E, type DataTableRawNumberCell as F, type DataVisualizationBlock as G, type EditableVia as H, type FeedbackButtonSubobject as I, type FeedbackButtonsElement as J, type HeaderLevel as K, type IconButtonElement as L, type IconButtonIcon as M, type InputBlock as N, type LoadMessageInput as O, type PreviewSurface as P, type LoadResult as Q, type LoadedMessage as R, type SupportedBlock as S, type Template as T, type LoadingConfig as U, type MarkdownBlock as V, type MentionChannel as W, type MentionUser as X, type MentionsConfig as Y, type PaletteMode as Z, type PaletteSection as _, type SendAsUserStatus as a, type PieChart as a0, type PieChartSegment as a1, type PlanBlock as a2, type PreviewHooks as a3, type PrimaryActionConfig as a4, type PrimaryActionContext as a5, type RecentMessage as a6, type SendResult as a7, type SupportedBlockType as a8, type SupportedHeaderBlock as a9, type TableBlock as aa, type TableCell as ab, type TableColumnSetting as ac, type TableRawTextCell as ad, type TaskCardBlock as ae, type TaskCardStatus as af, type UpdatePayload as ag, type UpdateResult as ah, type UrlSourceElement as ai, type ValidationSummary as aj, type VideoBlock as ak, defaultPalette as al, extraAlertVariant as am, legacyInputVariants as an, buildVariantById as ao, type SendPayload as b, type SendExtrasContext as c, type PreviewTheme as d, type AlertLevel as e, type BlockKitchenBaseProps as f, type BlockKitchenComposeOnlyProps as g, type BlockKitchenSendProps as h, type BrandPreset as i, type BrandTheme as j, type BrandTokens as k, type BuilderBlock as l, type CardBlock as m, type CarouselBlock as n, type CartesianChart as o, type Chart as p, type ChartAxisConfig as q, type ChartDataPoint as r, type ChartSeries as s, type ChartType as t, type ContainerBlock as u, type ContainerChildBlock as v, type ContextActionsBlock as w, type ContextActionsElement as x, type CustomEmoji as y, type DataTableBlock as z };
@@ -975,10 +975,19 @@ interface MentionUser {
975
975
  avatarUrl?: string | null;
976
976
  }
977
977
  /**
978
- * Opt-in `@` mentions for the rich text editor, passed as
979
- * {@link BlockKitchenBaseProps.mentions}. Typing `@` (or the toolbar's
980
- * mention button) opens a picker backed by the host's search; picking someone
981
- * inserts a rich text `user` element (`{ type: 'user', user_id }`).
978
+ * A Slack channel the rich text editor's `#` picker offers, returned by
979
+ * {@link MentionsConfig.searchChannels}.
980
+ */
981
+ interface MentionChannel {
982
+ /** Slack channel id (`C…` / `G…`), written to the rich text `channel` element's `channel_id`. */
983
+ id: string;
984
+ /** Name shown in the picker row and on the inserted mention. */
985
+ name: string;
986
+ }
987
+ /**
988
+ * Opt-in `@` user and `#` channel mentions for the rich text editor, passed as
989
+ * {@link BlockKitchenBaseProps.mentions}. Each configured search powers its
990
+ * typed trigger and toolbar action.
982
991
  *
983
992
  * Like every other I/O concern, the search is brokered by the host: the
984
993
  * builder never looks people up itself.
@@ -999,6 +1008,18 @@ interface MentionsConfig {
999
1008
  * from the search, then the raw id.
1000
1009
  */
1001
1010
  getUserName?: (userId: string) => string | undefined;
1011
+ /**
1012
+ * Optional. Searches the channels the picker offers. Called with the text
1013
+ * typed after `#` and the same debounce/abort behavior as `searchUsers`.
1014
+ */
1015
+ searchChannels?: (query: string, options: {
1016
+ signal: AbortSignal;
1017
+ }) => Promise<MentionChannel[]>;
1018
+ /**
1019
+ * Optional. Labels a channel mention in the editor by channel id. Return
1020
+ * `undefined` to fall back to the picked name, then the raw id.
1021
+ */
1022
+ getChannelName?: (channelId: string) => string | undefined;
1002
1023
  }
1003
1024
  /**
1004
1025
  * Hooks forwarded to `slack-blocks-to-jsx`'s `<Message>` so the consumer can
@@ -1118,10 +1139,9 @@ interface BlockKitchenBaseProps {
1118
1139
  */
1119
1140
  customEmojis?: CustomEmoji[];
1120
1141
  /**
1121
- * Opt-in `@` mentions in the rich text editor: an `@` trigger and a toolbar
1122
- * button that search people through the host. See {@link MentionsConfig}.
1123
- * Without it, mentions already in the draft still round-trip and display by
1124
- * raw id, but there is no picker.
1142
+ * Opt-in `@` user and `#` channel mentions in the rich text editor. See
1143
+ * {@link MentionsConfig}. Existing mentions still round-trip without picker
1144
+ * configuration and display by raw id.
1125
1145
  */
1126
1146
  mentions?: MentionsConfig;
1127
1147
  /**
@@ -1407,4 +1427,4 @@ interface BlockKitchenComposeOnlyProps {
1407
1427
  */
1408
1428
  type BlockKitchenProps = BlockKitchenBaseProps & (BlockKitchenSendProps | BlockKitchenComposeOnlyProps);
1409
1429
 
1410
- export { type PieChart as $, type AlertBlock as A, type BlockKitchenProps as B, type ChannelOption as C, type DataTableActionCell as D, type DataTableCell as E, type DataTableRawNumberCell as F, type DataVisualizationBlock as G, type EditableVia as H, type FeedbackButtonSubobject as I, type FeedbackButtonsElement as J, type HeaderLevel as K, type IconButtonElement as L, type IconButtonIcon as M, type InputBlock as N, type LoadMessageInput as O, type PreviewSurface as P, type LoadResult as Q, type LoadedMessage as R, type SupportedBlock as S, type Template as T, type LoadingConfig as U, type MarkdownBlock as V, type MentionUser as W, type MentionsConfig as X, type PaletteMode as Y, type PaletteSection as Z, type PaletteVariant as _, type SendAsUserStatus as a, type PieChartSegment as a0, type PlanBlock as a1, type PreviewHooks as a2, type PrimaryActionConfig as a3, type PrimaryActionContext as a4, type RecentMessage as a5, type SendResult as a6, type SupportedBlockType as a7, type SupportedHeaderBlock as a8, type TableBlock as a9, type TableCell as aa, type TableColumnSetting as ab, type TableRawTextCell as ac, type TaskCardBlock as ad, type TaskCardStatus as ae, type UpdatePayload as af, type UpdateResult as ag, type UrlSourceElement as ah, type ValidationSummary as ai, type VideoBlock as aj, defaultPalette as ak, extraAlertVariant as al, legacyInputVariants as am, buildVariantById as an, type SendPayload as b, type SendExtrasContext as c, type PreviewTheme as d, type AlertLevel as e, type BlockKitchenBaseProps as f, type BlockKitchenComposeOnlyProps as g, type BlockKitchenSendProps as h, type BrandPreset as i, type BrandTheme as j, type BrandTokens as k, type BuilderBlock as l, type CardBlock as m, type CarouselBlock as n, type CartesianChart as o, type Chart as p, type ChartAxisConfig as q, type ChartDataPoint as r, type ChartSeries as s, type ChartType as t, type ContainerBlock as u, type ContainerChildBlock as v, type ContextActionsBlock as w, type ContextActionsElement as x, type CustomEmoji as y, type DataTableBlock as z };
1430
+ export { type PaletteVariant as $, type AlertBlock as A, type BlockKitchenProps as B, type ChannelOption as C, type DataTableActionCell as D, type DataTableCell as E, type DataTableRawNumberCell as F, type DataVisualizationBlock as G, type EditableVia as H, type FeedbackButtonSubobject as I, type FeedbackButtonsElement as J, type HeaderLevel as K, type IconButtonElement as L, type IconButtonIcon as M, type InputBlock as N, type LoadMessageInput as O, type PreviewSurface as P, type LoadResult as Q, type LoadedMessage as R, type SupportedBlock as S, type Template as T, type LoadingConfig as U, type MarkdownBlock as V, type MentionChannel as W, type MentionUser as X, type MentionsConfig as Y, type PaletteMode as Z, type PaletteSection as _, type SendAsUserStatus as a, type PieChart as a0, type PieChartSegment as a1, type PlanBlock as a2, type PreviewHooks as a3, type PrimaryActionConfig as a4, type PrimaryActionContext as a5, type RecentMessage as a6, type SendResult as a7, type SupportedBlockType as a8, type SupportedHeaderBlock as a9, type TableBlock as aa, type TableCell as ab, type TableColumnSetting as ac, type TableRawTextCell as ad, type TaskCardBlock as ae, type TaskCardStatus as af, type UpdatePayload as ag, type UpdateResult as ah, type UrlSourceElement as ai, type ValidationSummary as aj, type VideoBlock as ak, defaultPalette as al, extraAlertVariant as am, legacyInputVariants as an, buildVariantById as ao, type SendPayload as b, type SendExtrasContext as c, type PreviewTheme as d, type AlertLevel as e, type BlockKitchenBaseProps as f, type BlockKitchenComposeOnlyProps as g, type BlockKitchenSendProps as h, type BrandPreset as i, type BrandTheme as j, type BrandTokens as k, type BuilderBlock as l, type CardBlock as m, type CarouselBlock as n, type CartesianChart as o, type Chart as p, type ChartAxisConfig as q, type ChartDataPoint as r, type ChartSeries as s, type ChartType as t, type ContainerBlock as u, type ContainerChildBlock as v, type ContextActionsBlock as w, type ContextActionsElement as x, type CustomEmoji as y, type DataTableBlock as z };
@@ -1,3 +1,3 @@
1
- export { Y as PaletteMode, Z as PaletteSection, _ as PaletteVariant, S as SupportedBlock, a7 as SupportedBlockType, an as buildVariantById, ak as defaultPalette, al as extraAlertVariant, am as legacyInputVariants } from './palette-4BJw_nd7.cjs';
1
+ export { Z as PaletteMode, _ as PaletteSection, $ as PaletteVariant, S as SupportedBlock, a8 as SupportedBlockType, ao as buildVariantById, al as defaultPalette, am as extraAlertVariant, an as legacyInputVariants } from './palette-CXXqlwIH.cjs';
2
2
  import 'react';
3
3
  import 'slack-web-api-client';
package/dist/palette.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- export { Y as PaletteMode, Z as PaletteSection, _ as PaletteVariant, S as SupportedBlock, a7 as SupportedBlockType, an as buildVariantById, ak as defaultPalette, al as extraAlertVariant, am as legacyInputVariants } from './palette-4BJw_nd7.js';
1
+ export { Z as PaletteMode, _ as PaletteSection, $ as PaletteVariant, S as SupportedBlock, a8 as SupportedBlockType, ao as buildVariantById, al as defaultPalette, am as extraAlertVariant, an as legacyInputVariants } from './palette-CXXqlwIH.js';
2
2
  import 'react';
3
3
  import 'slack-web-api-client';