@tightknitai/block-kitchen 0.10.1 → 0.10.2

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/dist/index.d.cts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as react from 'react';
2
2
  import { ReactNode } from 'react';
3
- import { c as BlockKitchenProps, _ as SupportedBlock, k as ChannelOption, W as SendAsUserStatus, Y as SendPayload, X as SendExtrasContext, a6 as Template, R as PreviewSurface, S as PreviewTheme } from './palette-C8sPJuXx.cjs';
4
- export { A as AlertBlock, a as AlertLevel, B as BlockKitchenBaseProps, b as BlockKitchenComposeOnlyProps, d as BlockKitchenSendProps, e as BrandPreset, f as BrandTheme, g as BrandTokens, h as BuilderBlock, C as CardBlock, i as CarouselBlock, j as CartesianChart, l as Chart, m as ChartAxisConfig, n as ChartDataPoint, o as ChartSeries, p as ChartType, q as ContainerBlock, r as ContainerChildBlock, s as ContextActionsBlock, t as ContextActionsElement, u as CustomEmoji, D as DataVisualizationBlock, E as EditableVia, F as FeedbackButtonSubobject, v as FeedbackButtonsElement, H as HeaderLevel, I as IconButtonElement, w as IconButtonIcon, x as InputBlock, L as LoadMessageInput, y as LoadResult, z as LoadedMessage, G as LoadingConfig, M as MarkdownBlock, P as PaletteSection, J as PaletteVariant, K as PieChart, N as PieChartSegment, O as PlanBlock, Q as PreviewHooks, T as PrimaryActionConfig, U as PrimaryActionContext, V as RecentMessage, Z as SendResult, $ as SupportedBlockType, a0 as SupportedHeaderBlock, a1 as TableBlock, a2 as TableCell, a3 as TableColumnSetting, a4 as TaskCardBlock, a5 as TaskCardStatus, a7 as UpdatePayload, a8 as UpdateResult, a9 as UrlSourceElement, aa as ValidationSummary, ab as VideoBlock, ad as defaultPalette, ae as extraAlertVariant, af as legacyInputVariants } from './palette-C8sPJuXx.cjs';
3
+ import { B as BlockKitchenProps, S as SupportedBlock, C as ChannelOption, a as SendAsUserStatus, b as SendPayload, c as SendExtrasContext, T as Template, P as PreviewSurface, d as PreviewTheme } from './palette-BtSwlGUC.cjs';
4
+ export { A as AlertBlock, e as AlertLevel, f as BlockKitchenBaseProps, g as BlockKitchenComposeOnlyProps, h as BlockKitchenSendProps, i as BrandPreset, j as BrandTheme, k as BrandTokens, l as BuilderBlock, m as CardBlock, n as CarouselBlock, o as CartesianChart, p as Chart, q as ChartAxisConfig, r as ChartDataPoint, s as ChartSeries, t as ChartType, u as ContainerBlock, v as ContainerChildBlock, w as ContextActionsBlock, x as ContextActionsElement, y as CustomEmoji, D as DataVisualizationBlock, E as EditableVia, F as FeedbackButtonSubobject, z as FeedbackButtonsElement, H as HeaderLevel, I as IconButtonElement, G as IconButtonIcon, J as InputBlock, L as LoadMessageInput, K as LoadResult, M as LoadedMessage, N as LoadingConfig, O as MarkdownBlock, Q as PaletteSection, R as PaletteVariant, U as PieChart, V as PieChartSegment, W as PlanBlock, X as PreviewHooks, Y as PrimaryActionConfig, Z as PrimaryActionContext, _ as RecentMessage, $ as SendResult, a0 as SupportedBlockType, a1 as SupportedHeaderBlock, a2 as TableBlock, a3 as TableCell, a4 as TableColumnSetting, a5 as TaskCardBlock, a6 as TaskCardStatus, a7 as UpdatePayload, a8 as UpdateResult, a9 as UrlSourceElement, aa as ValidationSummary, ab as VideoBlock, ac as defaultPalette, ad as extraAlertVariant, ae as legacyInputVariants } from './palette-BtSwlGUC.cjs';
5
5
  export { decodeBlocksFromString, encodeBlocksToString, toSlackBlocks } from './helpers.cjs';
6
6
  import 'slack-web-api-client';
7
7
 
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as react from 'react';
2
2
  import { ReactNode } from 'react';
3
- import { c as BlockKitchenProps, _ as SupportedBlock, k as ChannelOption, W as SendAsUserStatus, Y as SendPayload, X as SendExtrasContext, a6 as Template, R as PreviewSurface, S as PreviewTheme } from './palette-C8sPJuXx.js';
4
- export { A as AlertBlock, a as AlertLevel, B as BlockKitchenBaseProps, b as BlockKitchenComposeOnlyProps, d as BlockKitchenSendProps, e as BrandPreset, f as BrandTheme, g as BrandTokens, h as BuilderBlock, C as CardBlock, i as CarouselBlock, j as CartesianChart, l as Chart, m as ChartAxisConfig, n as ChartDataPoint, o as ChartSeries, p as ChartType, q as ContainerBlock, r as ContainerChildBlock, s as ContextActionsBlock, t as ContextActionsElement, u as CustomEmoji, D as DataVisualizationBlock, E as EditableVia, F as FeedbackButtonSubobject, v as FeedbackButtonsElement, H as HeaderLevel, I as IconButtonElement, w as IconButtonIcon, x as InputBlock, L as LoadMessageInput, y as LoadResult, z as LoadedMessage, G as LoadingConfig, M as MarkdownBlock, P as PaletteSection, J as PaletteVariant, K as PieChart, N as PieChartSegment, O as PlanBlock, Q as PreviewHooks, T as PrimaryActionConfig, U as PrimaryActionContext, V as RecentMessage, Z as SendResult, $ as SupportedBlockType, a0 as SupportedHeaderBlock, a1 as TableBlock, a2 as TableCell, a3 as TableColumnSetting, a4 as TaskCardBlock, a5 as TaskCardStatus, a7 as UpdatePayload, a8 as UpdateResult, a9 as UrlSourceElement, aa as ValidationSummary, ab as VideoBlock, ad as defaultPalette, ae as extraAlertVariant, af as legacyInputVariants } from './palette-C8sPJuXx.js';
3
+ import { B as BlockKitchenProps, S as SupportedBlock, C as ChannelOption, a as SendAsUserStatus, b as SendPayload, c as SendExtrasContext, T as Template, P as PreviewSurface, d as PreviewTheme } from './palette-BtSwlGUC.js';
4
+ export { A as AlertBlock, e as AlertLevel, f as BlockKitchenBaseProps, g as BlockKitchenComposeOnlyProps, h as BlockKitchenSendProps, i as BrandPreset, j as BrandTheme, k as BrandTokens, l as BuilderBlock, m as CardBlock, n as CarouselBlock, o as CartesianChart, p as Chart, q as ChartAxisConfig, r as ChartDataPoint, s as ChartSeries, t as ChartType, u as ContainerBlock, v as ContainerChildBlock, w as ContextActionsBlock, x as ContextActionsElement, y as CustomEmoji, D as DataVisualizationBlock, E as EditableVia, F as FeedbackButtonSubobject, z as FeedbackButtonsElement, H as HeaderLevel, I as IconButtonElement, G as IconButtonIcon, J as InputBlock, L as LoadMessageInput, K as LoadResult, M as LoadedMessage, N as LoadingConfig, O as MarkdownBlock, Q as PaletteSection, R as PaletteVariant, U as PieChart, V as PieChartSegment, W as PlanBlock, X as PreviewHooks, Y as PrimaryActionConfig, Z as PrimaryActionContext, _ as RecentMessage, $ as SendResult, a0 as SupportedBlockType, a1 as SupportedHeaderBlock, a2 as TableBlock, a3 as TableCell, a4 as TableColumnSetting, a5 as TaskCardBlock, a6 as TaskCardStatus, a7 as UpdatePayload, a8 as UpdateResult, a9 as UrlSourceElement, aa as ValidationSummary, ab as VideoBlock, ac as defaultPalette, ad as extraAlertVariant, ae as legacyInputVariants } from './palette-BtSwlGUC.js';
5
5
  export { decodeBlocksFromString, encodeBlocksToString, toSlackBlocks } from './helpers.js';
6
6
  import 'slack-web-api-client';
7
7
 
package/dist/index.js CHANGED
@@ -3881,6 +3881,27 @@ function EditorField({
3881
3881
  help && /* @__PURE__ */ jsx("p", { className: "text-[11px] leading-snug text-muted-foreground", children: help })
3882
3882
  ] });
3883
3883
  }
3884
+ function AdvancedIdField({
3885
+ label,
3886
+ help,
3887
+ htmlFor,
3888
+ value,
3889
+ placeholder,
3890
+ onChange
3891
+ }) {
3892
+ return /* @__PURE__ */ jsxs("details", { className: "rounded-md border bg-muted/20 px-2.5 py-1.5", children: [
3893
+ /* @__PURE__ */ jsx("summary", { className: "cursor-pointer text-[11px] font-medium text-muted-foreground hover:text-foreground", children: "Advanced" }),
3894
+ /* @__PURE__ */ jsx("div", { className: "pt-2 pb-1", children: /* @__PURE__ */ jsx(EditorField, { label, help, htmlFor, children: /* @__PURE__ */ jsx(
3895
+ Input,
3896
+ {
3897
+ id: htmlFor,
3898
+ value: value ?? "",
3899
+ placeholder,
3900
+ onChange: (e) => onChange(e.target.value || void 0)
3901
+ }
3902
+ ) }) })
3903
+ ] });
3904
+ }
3884
3905
  function ActionsEditor({ block, onChange }) {
3885
3906
  const elements = block.elements ?? [];
3886
3907
  const updateButton = (idx, update) => {
@@ -3979,7 +4000,18 @@ function ActionsEditor({ block, onChange }) {
3979
4000
  /* @__PURE__ */ jsx(Label, { htmlFor: `btn-style-${idx}-${s}`, className: "text-xs capitalize", children: s })
3980
4001
  ] }, s))
3981
4002
  }
3982
- ) })
4003
+ ) }),
4004
+ /* @__PURE__ */ jsx(
4005
+ AdvancedIdField,
4006
+ {
4007
+ label: "Action ID",
4008
+ help: "Optional. Sent in the interaction payload so your app knows which button was clicked.",
4009
+ htmlFor: `btn-action-${idx}`,
4010
+ value: el.action_id,
4011
+ placeholder: "e.g. approve_request",
4012
+ onChange: (next) => updateButton(idx, { action_id: next })
4013
+ }
4014
+ )
3983
4015
  ] }, idx);
3984
4016
  }),
3985
4017
  /* @__PURE__ */ jsxs(Button, { type: "button", size: "sm", onClick: addButton, className: "self-start", children: [
@@ -4262,7 +4294,18 @@ function ButtonsField({
4262
4294
  /* @__PURE__ */ jsx(Label, { htmlFor: `${idPrefix}-btn-style-${idx}-${s}`, className: "text-xs capitalize", children: s })
4263
4295
  ] }, s))
4264
4296
  }
4265
- ) })
4297
+ ) }),
4298
+ /* @__PURE__ */ jsx(
4299
+ AdvancedIdField,
4300
+ {
4301
+ label: "Action ID",
4302
+ help: "Optional. Sent in the interaction payload so your app knows which button was clicked.",
4303
+ htmlFor: `${idPrefix}-btn-action-${idx}`,
4304
+ value: btn.action_id,
4305
+ placeholder: "e.g. open_details",
4306
+ onChange: (next) => update(idx, { action_id: next })
4307
+ }
4308
+ )
4266
4309
  ] }, idx);
4267
4310
  }),
4268
4311
  /* @__PURE__ */ jsxs(Button, { type: "button", size: "sm", onClick: addButton, disabled: atLimit, className: "self-start", children: [
@@ -8090,7 +8133,18 @@ function ButtonAccessoryFields({ button, onChange }) {
8090
8133
  /* @__PURE__ */ jsx(Label, { htmlFor: `section-acc-btn-style-${s}`, className: "text-xs capitalize", children: s })
8091
8134
  ] }, s))
8092
8135
  }
8093
- ) })
8136
+ ) }),
8137
+ /* @__PURE__ */ jsx(
8138
+ AdvancedIdField,
8139
+ {
8140
+ label: "Action ID",
8141
+ help: "Optional. Sent in the interaction payload so your app knows which button was clicked.",
8142
+ htmlFor: "section-acc-btn-action",
8143
+ value: button.action_id,
8144
+ placeholder: "e.g. learn_more",
8145
+ onChange: (next) => onChange({ ...button, action_id: next })
8146
+ }
8147
+ )
8094
8148
  ] });
8095
8149
  }
8096
8150
  function ImageAccessoryFields({ image, onChange }) {
@@ -8572,6 +8626,17 @@ function BlockEditor({
8572
8626
  ] }) }),
8573
8627
  errors && errors.length > 0 ? /* @__PURE__ */ jsx("ul", { className: "flex flex-col gap-0.5 rounded-md border border-destructive/30 bg-destructive/5 p-2 text-xs text-destructive", children: errors.map((err, i) => /* @__PURE__ */ jsx("li", { children: err }, i)) }) : null,
8574
8628
  dispatch(block, onChange),
8629
+ /* @__PURE__ */ jsx(
8630
+ AdvancedIdField,
8631
+ {
8632
+ label: "Block ID",
8633
+ help: "Optional. Unique within the message or view. Slack returns it in interaction payloads.",
8634
+ htmlFor: "block-id",
8635
+ value: block.block_id,
8636
+ placeholder: "e.g. approval_row",
8637
+ onChange: (next) => onChange({ ...block, block_id: next })
8638
+ }
8639
+ ),
8575
8640
  onDone ? /* @__PURE__ */ jsx("div", { className: "flex justify-end border-t pt-3", children: /* @__PURE__ */ jsx(Button, { type: "button", size: "sm", onClick: onDone, children: "Done" }) }) : null
8576
8641
  ] });
8577
8642
  }