@tightknitai/block-kitchen 0.10.26 → 0.10.27

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.
@@ -1107,6 +1107,31 @@ interface MentionsConfig {
1107
1107
  */
1108
1108
  getChannelName?: (channelId: string) => string | undefined;
1109
1109
  }
1110
+ /**
1111
+ * Opt-in image uploads, passed as {@link BlockKitchenBaseProps.imageUpload}.
1112
+ * Image URL fields gain an "Upload" button and accept a dropped file, and an
1113
+ * image file dropped on the canvas adds an image block.
1114
+ *
1115
+ * Like every other I/O concern, the upload is brokered by the host: the
1116
+ * builder hands over the `File` and writes whatever URL comes back into the
1117
+ * block. Slack fetches that URL when the message is posted, so it must be
1118
+ * publicly reachable.
1119
+ */
1120
+ interface ImageUploadConfig {
1121
+ /**
1122
+ * Uploads one image and resolves its public URL. A rejection's `message`
1123
+ * is shown to the user, so reject with something they can act on (e.g.
1124
+ * "File size exceeds 5 MB limit").
1125
+ */
1126
+ uploadImage: (file: File) => Promise<{
1127
+ url: string;
1128
+ }>;
1129
+ /**
1130
+ * Optional. MIME types the file picker offers and drops accept. Defaults
1131
+ * to PNG, JPEG and GIF, the formats Slack renders in an image block.
1132
+ */
1133
+ accept?: readonly string[];
1134
+ }
1110
1135
  /**
1111
1136
  * Hooks forwarded to `slack-blocks-to-jsx`'s `<Message>` so the consumer can
1112
1137
  * resolve user mentions, channel mentions, custom emojis, and links to
@@ -1250,6 +1275,12 @@ interface BlockKitchenBaseProps {
1250
1275
  * configuration and display by raw id.
1251
1276
  */
1252
1277
  mentions?: MentionsConfig;
1278
+ /**
1279
+ * Opt-in image uploads from the user's device. See
1280
+ * {@link ImageUploadConfig}. Without it, images are added by public URL
1281
+ * only.
1282
+ */
1283
+ imageUpload?: ImageUploadConfig;
1253
1284
  /**
1254
1285
  * Opt-in: load an existing Slack message into the editor. Adds a
1255
1286
  * "Find message" toolbar entry — the user pastes a permalink (or picks a
@@ -1541,4 +1572,4 @@ interface BlockKitchenComposeOnlyProps {
1541
1572
  */
1542
1573
  type BlockKitchenProps = BlockKitchenBaseProps & (BlockKitchenSendProps | BlockKitchenComposeOnlyProps);
1543
1574
 
1544
- export { type MentionUser as $, type AlertBlock as A, type BlockKitchenProps as B, type ChannelOption as C, type CustomBlockEditor as D, type CustomBlockEditorProps as E, type CustomEmoji as F, type DataTableActionCell as G, type DataTableBlock as H, type DataTableCell as I, type DataTableRawNumberCell as J, type DataVisualizationBlock as K, type EditableVia as L, type FeedbackButtonSubobject as M, type FeedbackButtonsElement as N, type HeaderLevel as O, type PreviewSurface as P, type IconButtonElement as Q, type IconButtonIcon as R, type SupportedBlock as S, type Template as T, type InputBlock as U, type LoadMessageInput as V, type LoadResult as W, type LoadedMessage as X, type LoadingConfig as Y, type MarkdownBlock as Z, type MentionChannel as _, type SendAsUserStatus as a, type MentionsConfig as a0, type PaletteMode as a1, type PaletteSection as a2, type PaletteVariant as a3, type PaletteVariantBadge as a4, type PieChart as a5, type PieChartSegment as a6, type PlanBlock as a7, type PreviewHooks as a8, type PrimaryActionConfig as a9, type PrimaryActionContext as aa, type RecentMessage as ab, type SendResult as ac, type SupportedBlockType as ad, type SupportedHeaderBlock as ae, type TableBlock as af, type TableCell as ag, type TableColumnSetting as ah, type TableRawTextCell as ai, type TaskCardBlock as aj, type TaskCardStatus as ak, type UpdatePayload as al, type UpdateResult as am, type UrlSourceElement as an, type ValidationSummary as ao, type VideoBlock as ap, defaultPalette as aq, extraAlertVariant as ar, legacyInputVariants as as, buildVariantById as at, type SendPayload as b, type SendExtrasContext as c, type PreviewTheme as d, type AlertLevel as e, type BlockAction as f, type BlockKitchenBaseProps as g, type BlockKitchenComposeOnlyProps as h, type BlockKitchenSendProps as i, type BlockPosition as j, type BrandPreset as k, type BrandTheme as l, type BrandTokens as m, type BuilderBlock as n, type CardBlock as o, type CarouselBlock as p, type CartesianChart as q, type Chart as r, type ChartAxisConfig as s, type ChartDataPoint as t, type ChartSeries as u, type ChartType as v, type ContainerBlock as w, type ContainerChildBlock as x, type ContextActionsBlock as y, type ContextActionsElement as z };
1575
+ export { type MentionChannel as $, type AlertBlock as A, type BlockKitchenProps as B, type ChannelOption as C, type CustomBlockEditor as D, type CustomBlockEditorProps as E, type CustomEmoji as F, type DataTableActionCell as G, type DataTableBlock as H, type DataTableCell as I, type DataTableRawNumberCell as J, type DataVisualizationBlock as K, type EditableVia as L, type FeedbackButtonSubobject as M, type FeedbackButtonsElement as N, type HeaderLevel as O, type PreviewSurface as P, type IconButtonElement as Q, type IconButtonIcon as R, type SupportedBlock as S, type Template as T, type ImageUploadConfig as U, type InputBlock as V, type LoadMessageInput as W, type LoadResult as X, type LoadedMessage as Y, type LoadingConfig as Z, type MarkdownBlock as _, type SendAsUserStatus as a, type MentionUser as a0, type MentionsConfig as a1, type PaletteMode as a2, type PaletteSection as a3, type PaletteVariant as a4, type PaletteVariantBadge as a5, type PieChart as a6, type PieChartSegment as a7, type PlanBlock as a8, type PreviewHooks as a9, type PrimaryActionConfig as aa, type PrimaryActionContext as ab, type RecentMessage as ac, type SendResult as ad, type SupportedBlockType as ae, type SupportedHeaderBlock as af, type TableBlock as ag, type TableCell as ah, type TableColumnSetting as ai, type TableRawTextCell as aj, type TaskCardBlock as ak, type TaskCardStatus as al, type UpdatePayload as am, type UpdateResult as an, type UrlSourceElement as ao, type ValidationSummary as ap, type VideoBlock as aq, defaultPalette as ar, extraAlertVariant as as, legacyInputVariants as at, buildVariantById as au, type SendPayload as b, type SendExtrasContext as c, type PreviewTheme as d, type AlertLevel as e, type BlockAction as f, type BlockKitchenBaseProps as g, type BlockKitchenComposeOnlyProps as h, type BlockKitchenSendProps as i, type BlockPosition as j, type BrandPreset as k, type BrandTheme as l, type BrandTokens as m, type BuilderBlock as n, type CardBlock as o, type CarouselBlock as p, type CartesianChart as q, type Chart as r, type ChartAxisConfig as s, type ChartDataPoint as t, type ChartSeries as u, type ChartType as v, type ContainerBlock as w, type ContainerChildBlock as x, type ContextActionsBlock as y, type ContextActionsElement as z };
@@ -1107,6 +1107,31 @@ interface MentionsConfig {
1107
1107
  */
1108
1108
  getChannelName?: (channelId: string) => string | undefined;
1109
1109
  }
1110
+ /**
1111
+ * Opt-in image uploads, passed as {@link BlockKitchenBaseProps.imageUpload}.
1112
+ * Image URL fields gain an "Upload" button and accept a dropped file, and an
1113
+ * image file dropped on the canvas adds an image block.
1114
+ *
1115
+ * Like every other I/O concern, the upload is brokered by the host: the
1116
+ * builder hands over the `File` and writes whatever URL comes back into the
1117
+ * block. Slack fetches that URL when the message is posted, so it must be
1118
+ * publicly reachable.
1119
+ */
1120
+ interface ImageUploadConfig {
1121
+ /**
1122
+ * Uploads one image and resolves its public URL. A rejection's `message`
1123
+ * is shown to the user, so reject with something they can act on (e.g.
1124
+ * "File size exceeds 5 MB limit").
1125
+ */
1126
+ uploadImage: (file: File) => Promise<{
1127
+ url: string;
1128
+ }>;
1129
+ /**
1130
+ * Optional. MIME types the file picker offers and drops accept. Defaults
1131
+ * to PNG, JPEG and GIF, the formats Slack renders in an image block.
1132
+ */
1133
+ accept?: readonly string[];
1134
+ }
1110
1135
  /**
1111
1136
  * Hooks forwarded to `slack-blocks-to-jsx`'s `<Message>` so the consumer can
1112
1137
  * resolve user mentions, channel mentions, custom emojis, and links to
@@ -1250,6 +1275,12 @@ interface BlockKitchenBaseProps {
1250
1275
  * configuration and display by raw id.
1251
1276
  */
1252
1277
  mentions?: MentionsConfig;
1278
+ /**
1279
+ * Opt-in image uploads from the user's device. See
1280
+ * {@link ImageUploadConfig}. Without it, images are added by public URL
1281
+ * only.
1282
+ */
1283
+ imageUpload?: ImageUploadConfig;
1253
1284
  /**
1254
1285
  * Opt-in: load an existing Slack message into the editor. Adds a
1255
1286
  * "Find message" toolbar entry — the user pastes a permalink (or picks a
@@ -1541,4 +1572,4 @@ interface BlockKitchenComposeOnlyProps {
1541
1572
  */
1542
1573
  type BlockKitchenProps = BlockKitchenBaseProps & (BlockKitchenSendProps | BlockKitchenComposeOnlyProps);
1543
1574
 
1544
- export { type MentionUser as $, type AlertBlock as A, type BlockKitchenProps as B, type ChannelOption as C, type CustomBlockEditor as D, type CustomBlockEditorProps as E, type CustomEmoji as F, type DataTableActionCell as G, type DataTableBlock as H, type DataTableCell as I, type DataTableRawNumberCell as J, type DataVisualizationBlock as K, type EditableVia as L, type FeedbackButtonSubobject as M, type FeedbackButtonsElement as N, type HeaderLevel as O, type PreviewSurface as P, type IconButtonElement as Q, type IconButtonIcon as R, type SupportedBlock as S, type Template as T, type InputBlock as U, type LoadMessageInput as V, type LoadResult as W, type LoadedMessage as X, type LoadingConfig as Y, type MarkdownBlock as Z, type MentionChannel as _, type SendAsUserStatus as a, type MentionsConfig as a0, type PaletteMode as a1, type PaletteSection as a2, type PaletteVariant as a3, type PaletteVariantBadge as a4, type PieChart as a5, type PieChartSegment as a6, type PlanBlock as a7, type PreviewHooks as a8, type PrimaryActionConfig as a9, type PrimaryActionContext as aa, type RecentMessage as ab, type SendResult as ac, type SupportedBlockType as ad, type SupportedHeaderBlock as ae, type TableBlock as af, type TableCell as ag, type TableColumnSetting as ah, type TableRawTextCell as ai, type TaskCardBlock as aj, type TaskCardStatus as ak, type UpdatePayload as al, type UpdateResult as am, type UrlSourceElement as an, type ValidationSummary as ao, type VideoBlock as ap, defaultPalette as aq, extraAlertVariant as ar, legacyInputVariants as as, buildVariantById as at, type SendPayload as b, type SendExtrasContext as c, type PreviewTheme as d, type AlertLevel as e, type BlockAction as f, type BlockKitchenBaseProps as g, type BlockKitchenComposeOnlyProps as h, type BlockKitchenSendProps as i, type BlockPosition as j, type BrandPreset as k, type BrandTheme as l, type BrandTokens as m, type BuilderBlock as n, type CardBlock as o, type CarouselBlock as p, type CartesianChart as q, type Chart as r, type ChartAxisConfig as s, type ChartDataPoint as t, type ChartSeries as u, type ChartType as v, type ContainerBlock as w, type ContainerChildBlock as x, type ContextActionsBlock as y, type ContextActionsElement as z };
1575
+ export { type MentionChannel as $, type AlertBlock as A, type BlockKitchenProps as B, type ChannelOption as C, type CustomBlockEditor as D, type CustomBlockEditorProps as E, type CustomEmoji as F, type DataTableActionCell as G, type DataTableBlock as H, type DataTableCell as I, type DataTableRawNumberCell as J, type DataVisualizationBlock as K, type EditableVia as L, type FeedbackButtonSubobject as M, type FeedbackButtonsElement as N, type HeaderLevel as O, type PreviewSurface as P, type IconButtonElement as Q, type IconButtonIcon as R, type SupportedBlock as S, type Template as T, type ImageUploadConfig as U, type InputBlock as V, type LoadMessageInput as W, type LoadResult as X, type LoadedMessage as Y, type LoadingConfig as Z, type MarkdownBlock as _, type SendAsUserStatus as a, type MentionUser as a0, type MentionsConfig as a1, type PaletteMode as a2, type PaletteSection as a3, type PaletteVariant as a4, type PaletteVariantBadge as a5, type PieChart as a6, type PieChartSegment as a7, type PlanBlock as a8, type PreviewHooks as a9, type PrimaryActionConfig as aa, type PrimaryActionContext as ab, type RecentMessage as ac, type SendResult as ad, type SupportedBlockType as ae, type SupportedHeaderBlock as af, type TableBlock as ag, type TableCell as ah, type TableColumnSetting as ai, type TableRawTextCell as aj, type TaskCardBlock as ak, type TaskCardStatus as al, type UpdatePayload as am, type UpdateResult as an, type UrlSourceElement as ao, type ValidationSummary as ap, type VideoBlock as aq, defaultPalette as ar, extraAlertVariant as as, legacyInputVariants as at, buildVariantById as au, type SendPayload as b, type SendExtrasContext as c, type PreviewTheme as d, type AlertLevel as e, type BlockAction as f, type BlockKitchenBaseProps as g, type BlockKitchenComposeOnlyProps as h, type BlockKitchenSendProps as i, type BlockPosition as j, type BrandPreset as k, type BrandTheme as l, type BrandTokens as m, type BuilderBlock as n, type CardBlock as o, type CarouselBlock as p, type CartesianChart as q, type Chart as r, type ChartAxisConfig as s, type ChartDataPoint as t, type ChartSeries as u, type ChartType as v, type ContainerBlock as w, type ContainerChildBlock as x, type ContextActionsBlock as y, type ContextActionsElement as z };
@@ -1,3 +1,3 @@
1
- export { a1 as PaletteMode, a2 as PaletteSection, a3 as PaletteVariant, S as SupportedBlock, ad as SupportedBlockType, at as buildVariantById, aq as defaultPalette, ar as extraAlertVariant, as as legacyInputVariants } from './palette-Cnz2jz8O.cjs';
1
+ export { a2 as PaletteMode, a3 as PaletteSection, a4 as PaletteVariant, S as SupportedBlock, ae as SupportedBlockType, au as buildVariantById, ar as defaultPalette, as as extraAlertVariant, at as legacyInputVariants } from './palette-xi4VWU0p.cjs';
2
2
  import 'react';
3
3
  import 'slack-web-api-client';
package/dist/palette.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- export { a1 as PaletteMode, a2 as PaletteSection, a3 as PaletteVariant, S as SupportedBlock, ad as SupportedBlockType, at as buildVariantById, aq as defaultPalette, ar as extraAlertVariant, as as legacyInputVariants } from './palette-Cnz2jz8O.js';
1
+ export { a2 as PaletteMode, a3 as PaletteSection, a4 as PaletteVariant, S as SupportedBlock, ae as SupportedBlockType, au as buildVariantById, ar as defaultPalette, as as extraAlertVariant, at as legacyInputVariants } from './palette-xi4VWU0p.js';
2
2
  import 'react';
3
3
  import 'slack-web-api-client';