@tightknitai/block-kitchen 0.10.22 → 0.10.23

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.
@@ -730,6 +730,33 @@ interface PrimaryActionContext {
730
730
  */
731
731
  loadedMessage: LoadedMessage | null;
732
732
  }
733
+ /**
734
+ * Where a block sits in the draft, as a {@link BlockAction} is told. Hosts
735
+ * map it onto their own copy of the blocks (e.g. the array `onChange` last
736
+ * emitted), since builder ids never leave the package.
737
+ */
738
+ interface BlockPosition {
739
+ /** Zero-based index among the draft's top-level blocks. */
740
+ index: number;
741
+ /** Zero-based index inside the container holding the block, or `null` for a top-level block. */
742
+ childIndex: number | null;
743
+ }
744
+ /**
745
+ * A host-owned button added to every block's action toolbar (the hover
746
+ * toolbar on desktop, the inline row on mobile), before the built-in Edit,
747
+ * Duplicate and Delete. Use it for actions about a block that belong to your
748
+ * app, e.g. "Comment on this block".
749
+ */
750
+ interface BlockAction {
751
+ /** Stable identifier, used as the button's React key. */
752
+ id: string;
753
+ /** Accessible name and tooltip for the button. */
754
+ label: string;
755
+ /** Icon for the button; an `svg` inside is sized to match the built-in icons. */
756
+ icon: ReactNode;
757
+ /** Called with the block's position when the button is clicked. */
758
+ onSelect: (position: BlockPosition) => void;
759
+ }
733
760
  /**
734
761
  * A host-owned primary action for compose-only mode, rendered in the
735
762
  * toolbar slot where the built-in "Review & send" button normally sits.
@@ -1127,6 +1154,13 @@ interface BlockKitchenBaseProps {
1127
1154
  * directives render with the library's defaults.
1128
1155
  */
1129
1156
  previewHooks?: PreviewHooks;
1157
+ /**
1158
+ * Opt-in host buttons for every block's action toolbar, e.g. "Comment on
1159
+ * this block". See {@link BlockAction}. Each block row also carries
1160
+ * `data-bk-block-index` (and `data-bk-child-index` inside a container), so a
1161
+ * host can find a block on the canvas to scroll to or highlight it.
1162
+ */
1163
+ blockActions?: readonly BlockAction[];
1130
1164
  /**
1131
1165
  * Workspace custom emoji (`emoji.list`) the preview should resolve. Entries
1132
1166
  * with a non-null `url` render as the workspace image; alias entries fall
@@ -1427,4 +1461,4 @@ interface BlockKitchenComposeOnlyProps {
1427
1461
  */
1428
1462
  type BlockKitchenProps = BlockKitchenBaseProps & (BlockKitchenSendProps | BlockKitchenComposeOnlyProps);
1429
1463
 
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 };
1464
+ export { type PaletteMode as $, type AlertBlock as A, type BlockKitchenProps as B, type ChannelOption as C, type CustomEmoji as D, type DataTableActionCell as E, type DataTableBlock as F, type DataTableCell as G, type DataTableRawNumberCell as H, type DataVisualizationBlock as I, type EditableVia as J, type FeedbackButtonSubobject as K, type FeedbackButtonsElement as L, type HeaderLevel as M, type IconButtonElement as N, type IconButtonIcon as O, type PreviewSurface as P, type InputBlock as Q, type LoadMessageInput as R, type SupportedBlock as S, type Template as T, type LoadResult as U, type LoadedMessage as V, type LoadingConfig as W, type MarkdownBlock as X, type MentionChannel as Y, type MentionUser as Z, type MentionsConfig as _, type SendAsUserStatus as a, type PaletteSection as a0, type PaletteVariant as a1, type PieChart as a2, type PieChartSegment as a3, type PlanBlock as a4, type PreviewHooks as a5, type PrimaryActionConfig as a6, type PrimaryActionContext as a7, type RecentMessage as a8, type SendResult as a9, type SupportedBlockType as aa, type SupportedHeaderBlock as ab, type TableBlock as ac, type TableCell as ad, type TableColumnSetting as ae, type TableRawTextCell as af, type TaskCardBlock as ag, type TaskCardStatus as ah, type UpdatePayload as ai, type UpdateResult as aj, type UrlSourceElement as ak, type ValidationSummary as al, type VideoBlock as am, defaultPalette as an, extraAlertVariant as ao, legacyInputVariants as ap, buildVariantById as aq, 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 };
@@ -730,6 +730,33 @@ interface PrimaryActionContext {
730
730
  */
731
731
  loadedMessage: LoadedMessage | null;
732
732
  }
733
+ /**
734
+ * Where a block sits in the draft, as a {@link BlockAction} is told. Hosts
735
+ * map it onto their own copy of the blocks (e.g. the array `onChange` last
736
+ * emitted), since builder ids never leave the package.
737
+ */
738
+ interface BlockPosition {
739
+ /** Zero-based index among the draft's top-level blocks. */
740
+ index: number;
741
+ /** Zero-based index inside the container holding the block, or `null` for a top-level block. */
742
+ childIndex: number | null;
743
+ }
744
+ /**
745
+ * A host-owned button added to every block's action toolbar (the hover
746
+ * toolbar on desktop, the inline row on mobile), before the built-in Edit,
747
+ * Duplicate and Delete. Use it for actions about a block that belong to your
748
+ * app, e.g. "Comment on this block".
749
+ */
750
+ interface BlockAction {
751
+ /** Stable identifier, used as the button's React key. */
752
+ id: string;
753
+ /** Accessible name and tooltip for the button. */
754
+ label: string;
755
+ /** Icon for the button; an `svg` inside is sized to match the built-in icons. */
756
+ icon: ReactNode;
757
+ /** Called with the block's position when the button is clicked. */
758
+ onSelect: (position: BlockPosition) => void;
759
+ }
733
760
  /**
734
761
  * A host-owned primary action for compose-only mode, rendered in the
735
762
  * toolbar slot where the built-in "Review & send" button normally sits.
@@ -1127,6 +1154,13 @@ interface BlockKitchenBaseProps {
1127
1154
  * directives render with the library's defaults.
1128
1155
  */
1129
1156
  previewHooks?: PreviewHooks;
1157
+ /**
1158
+ * Opt-in host buttons for every block's action toolbar, e.g. "Comment on
1159
+ * this block". See {@link BlockAction}. Each block row also carries
1160
+ * `data-bk-block-index` (and `data-bk-child-index` inside a container), so a
1161
+ * host can find a block on the canvas to scroll to or highlight it.
1162
+ */
1163
+ blockActions?: readonly BlockAction[];
1130
1164
  /**
1131
1165
  * Workspace custom emoji (`emoji.list`) the preview should resolve. Entries
1132
1166
  * with a non-null `url` render as the workspace image; alias entries fall
@@ -1427,4 +1461,4 @@ interface BlockKitchenComposeOnlyProps {
1427
1461
  */
1428
1462
  type BlockKitchenProps = BlockKitchenBaseProps & (BlockKitchenSendProps | BlockKitchenComposeOnlyProps);
1429
1463
 
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 };
1464
+ export { type PaletteMode as $, type AlertBlock as A, type BlockKitchenProps as B, type ChannelOption as C, type CustomEmoji as D, type DataTableActionCell as E, type DataTableBlock as F, type DataTableCell as G, type DataTableRawNumberCell as H, type DataVisualizationBlock as I, type EditableVia as J, type FeedbackButtonSubobject as K, type FeedbackButtonsElement as L, type HeaderLevel as M, type IconButtonElement as N, type IconButtonIcon as O, type PreviewSurface as P, type InputBlock as Q, type LoadMessageInput as R, type SupportedBlock as S, type Template as T, type LoadResult as U, type LoadedMessage as V, type LoadingConfig as W, type MarkdownBlock as X, type MentionChannel as Y, type MentionUser as Z, type MentionsConfig as _, type SendAsUserStatus as a, type PaletteSection as a0, type PaletteVariant as a1, type PieChart as a2, type PieChartSegment as a3, type PlanBlock as a4, type PreviewHooks as a5, type PrimaryActionConfig as a6, type PrimaryActionContext as a7, type RecentMessage as a8, type SendResult as a9, type SupportedBlockType as aa, type SupportedHeaderBlock as ab, type TableBlock as ac, type TableCell as ad, type TableColumnSetting as ae, type TableRawTextCell as af, type TaskCardBlock as ag, type TaskCardStatus as ah, type UpdatePayload as ai, type UpdateResult as aj, type UrlSourceElement as ak, type ValidationSummary as al, type VideoBlock as am, defaultPalette as an, extraAlertVariant as ao, legacyInputVariants as ap, buildVariantById as aq, 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 { 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';
1
+ export { $ as PaletteMode, a0 as PaletteSection, a1 as PaletteVariant, S as SupportedBlock, aa as SupportedBlockType, aq as buildVariantById, an as defaultPalette, ao as extraAlertVariant, ap as legacyInputVariants } from './palette-DFTL0Han.cjs';
2
2
  import 'react';
3
3
  import 'slack-web-api-client';
package/dist/palette.d.ts CHANGED
@@ -1,3 +1,3 @@
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';
1
+ export { $ as PaletteMode, a0 as PaletteSection, a1 as PaletteVariant, S as SupportedBlock, aa as SupportedBlockType, aq as buildVariantById, an as defaultPalette, ao as extraAlertVariant, ap as legacyInputVariants } from './palette-DFTL0Han.js';
2
2
  import 'react';
3
3
  import 'slack-web-api-client';