@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.
@@ -1,5 +1,5 @@
1
- import { _ as SupportedBlock } from './palette-C8sPJuXx.cjs';
2
- export { $ as SupportedBlockType } from './palette-C8sPJuXx.cjs';
1
+ import { S as SupportedBlock } from './palette-BtSwlGUC.cjs';
2
+ export { a0 as SupportedBlockType } from './palette-BtSwlGUC.cjs';
3
3
  import 'react';
4
4
  import 'slack-web-api-client';
5
5
 
package/dist/helpers.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { _ as SupportedBlock } from './palette-C8sPJuXx.js';
2
- export { $ as SupportedBlockType } from './palette-C8sPJuXx.js';
1
+ import { S as SupportedBlock } from './palette-BtSwlGUC.js';
2
+ export { a0 as SupportedBlockType } from './palette-BtSwlGUC.js';
3
3
  import 'react';
4
4
  import 'slack-web-api-client';
5
5
 
package/dist/index.cjs CHANGED
@@ -3911,6 +3911,27 @@ function EditorField({
3911
3911
  help && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[11px] leading-snug text-muted-foreground", children: help })
3912
3912
  ] });
3913
3913
  }
3914
+ function AdvancedIdField({
3915
+ label,
3916
+ help,
3917
+ htmlFor,
3918
+ value,
3919
+ placeholder,
3920
+ onChange
3921
+ }) {
3922
+ return /* @__PURE__ */ jsxRuntime.jsxs("details", { className: "rounded-md border bg-muted/20 px-2.5 py-1.5", children: [
3923
+ /* @__PURE__ */ jsxRuntime.jsx("summary", { className: "cursor-pointer text-[11px] font-medium text-muted-foreground hover:text-foreground", children: "Advanced" }),
3924
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "pt-2 pb-1", children: /* @__PURE__ */ jsxRuntime.jsx(EditorField, { label, help, htmlFor, children: /* @__PURE__ */ jsxRuntime.jsx(
3925
+ Input,
3926
+ {
3927
+ id: htmlFor,
3928
+ value: value ?? "",
3929
+ placeholder,
3930
+ onChange: (e) => onChange(e.target.value || void 0)
3931
+ }
3932
+ ) }) })
3933
+ ] });
3934
+ }
3914
3935
  function ActionsEditor({ block, onChange }) {
3915
3936
  const elements = block.elements ?? [];
3916
3937
  const updateButton = (idx, update) => {
@@ -4009,7 +4030,18 @@ function ActionsEditor({ block, onChange }) {
4009
4030
  /* @__PURE__ */ jsxRuntime.jsx(Label, { htmlFor: `btn-style-${idx}-${s}`, className: "text-xs capitalize", children: s })
4010
4031
  ] }, s))
4011
4032
  }
4012
- ) })
4033
+ ) }),
4034
+ /* @__PURE__ */ jsxRuntime.jsx(
4035
+ AdvancedIdField,
4036
+ {
4037
+ label: "Action ID",
4038
+ help: "Optional. Sent in the interaction payload so your app knows which button was clicked.",
4039
+ htmlFor: `btn-action-${idx}`,
4040
+ value: el.action_id,
4041
+ placeholder: "e.g. approve_request",
4042
+ onChange: (next) => updateButton(idx, { action_id: next })
4043
+ }
4044
+ )
4013
4045
  ] }, idx);
4014
4046
  }),
4015
4047
  /* @__PURE__ */ jsxRuntime.jsxs(Button, { type: "button", size: "sm", onClick: addButton, className: "self-start", children: [
@@ -4292,7 +4324,18 @@ function ButtonsField({
4292
4324
  /* @__PURE__ */ jsxRuntime.jsx(Label, { htmlFor: `${idPrefix}-btn-style-${idx}-${s}`, className: "text-xs capitalize", children: s })
4293
4325
  ] }, s))
4294
4326
  }
4295
- ) })
4327
+ ) }),
4328
+ /* @__PURE__ */ jsxRuntime.jsx(
4329
+ AdvancedIdField,
4330
+ {
4331
+ label: "Action ID",
4332
+ help: "Optional. Sent in the interaction payload so your app knows which button was clicked.",
4333
+ htmlFor: `${idPrefix}-btn-action-${idx}`,
4334
+ value: btn.action_id,
4335
+ placeholder: "e.g. open_details",
4336
+ onChange: (next) => update(idx, { action_id: next })
4337
+ }
4338
+ )
4296
4339
  ] }, idx);
4297
4340
  }),
4298
4341
  /* @__PURE__ */ jsxRuntime.jsxs(Button, { type: "button", size: "sm", onClick: addButton, disabled: atLimit, className: "self-start", children: [
@@ -8120,7 +8163,18 @@ function ButtonAccessoryFields({ button, onChange }) {
8120
8163
  /* @__PURE__ */ jsxRuntime.jsx(Label, { htmlFor: `section-acc-btn-style-${s}`, className: "text-xs capitalize", children: s })
8121
8164
  ] }, s))
8122
8165
  }
8123
- ) })
8166
+ ) }),
8167
+ /* @__PURE__ */ jsxRuntime.jsx(
8168
+ AdvancedIdField,
8169
+ {
8170
+ label: "Action ID",
8171
+ help: "Optional. Sent in the interaction payload so your app knows which button was clicked.",
8172
+ htmlFor: "section-acc-btn-action",
8173
+ value: button.action_id,
8174
+ placeholder: "e.g. learn_more",
8175
+ onChange: (next) => onChange({ ...button, action_id: next })
8176
+ }
8177
+ )
8124
8178
  ] });
8125
8179
  }
8126
8180
  function ImageAccessoryFields({ image, onChange }) {
@@ -8602,6 +8656,17 @@ function BlockEditor({
8602
8656
  ] }) }),
8603
8657
  errors && errors.length > 0 ? /* @__PURE__ */ jsxRuntime.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__ */ jsxRuntime.jsx("li", { children: err }, i)) }) : null,
8604
8658
  dispatch(block, onChange),
8659
+ /* @__PURE__ */ jsxRuntime.jsx(
8660
+ AdvancedIdField,
8661
+ {
8662
+ label: "Block ID",
8663
+ help: "Optional. Unique within the message or view. Slack returns it in interaction payloads.",
8664
+ htmlFor: "block-id",
8665
+ value: block.block_id,
8666
+ placeholder: "e.g. approval_row",
8667
+ onChange: (next) => onChange({ ...block, block_id: next })
8668
+ }
8669
+ ),
8605
8670
  onDone ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex justify-end border-t pt-3", children: /* @__PURE__ */ jsxRuntime.jsx(Button, { type: "button", size: "sm", onClick: onDone, children: "Done" }) }) : null
8606
8671
  ] });
8607
8672
  }