@tightknitai/block-kitchen 0.10.3 → 0.10.4

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/README.md CHANGED
@@ -305,6 +305,16 @@ permalink, or pick from a "recent messages from this app" list. Loading is a
305
305
  package stays integration-agnostic: it makes no Slack calls and computes
306
306
  nothing about who can edit; the host does both.
307
307
 
308
+ The **Find an existing message** dialog is two panes on wide viewports
309
+ (stacked on narrow ones): on the left, a **Pick from Recent** tab (channel
310
+ picker + recent messages) and a **Direct Link** tab (paste a permalink); on
311
+ the right, a live Slack-style preview of whichever message is selected,
312
+ rendered by the same preview pipeline as the builder — so users see the
313
+ message before committing to it. The tab strip only appears when the recent
314
+ picker is configured; otherwise the link pane stands alone. Pasted links are
315
+ debounced before `onLoadMessage` runs, so typing never fires a lookup per
316
+ keystroke.
317
+
308
318
  ```tsx
309
319
  <BlockKitchen
310
320
  /* …send trio, or nothing (compose-only)… */
@@ -326,11 +336,11 @@ nothing about who can edit; the host does both.
326
336
  return { ok: true, channelId: msg.channel, channelName: msg.channelName, ts: msg.ts, blocks: msg.blocks, editableVia: 'user', ...author };
327
337
  return { ok: false, reason: 'Only messages your app or you posted can be edited.', blocks: msg.blocks };
328
338
  },
329
- // Optional: adds a "recent messages from this app" picker beside the paste
330
- // input. The user first picks a channel, then this is called with that
331
- // `channelId` so the lookup scans only one channel. These are
332
- // editable-by-construction (the app authored them), so picking one loads
333
- // it directly (no verdict needed).
339
+ // Optional: adds the "Pick from Recent" tab beside "Direct Link". The user
340
+ // first picks a channel, then this is called with that `channelId` so the
341
+ // lookup scans only one channel. These are editable-by-construction (the
342
+ // app authored them), so selecting one previews it and loads it directly
343
+ // (no verdict needed).
334
344
  loadRecentMessages: async (channelId) => {
335
345
  const msgs = await fetchRecentAppMessages(channelId); // your code
336
346
  return msgs.map((m) => ({
@@ -352,9 +362,12 @@ nothing about who can edit; the host does both.
352
362
  - On `ok`, the builder hydrates with `blocks` and shows a loaded banner
353
363
  ("References an existing message in #channel"), with the author's
354
364
  name/avatar in the preview header.
355
- - On `{ ok: false, reason }`, the load dialog renders the reason inline and
365
+ - On `{ ok: false, reason }`, the dialog's preview pane renders the reason and
356
366
  offers **Open as a new message instead**. Pass `blocks` on the failure
357
- result to hydrate the draft for that fallback.
367
+ result to hydrate the draft for that fallback — they're previewed under the
368
+ reason too.
369
+ - On `{ ok: false, oauthUrl }`, the preview pane shows a **Sign in with Slack**
370
+ button that opens the URL and re-checks the load once sign-in completes.
358
371
  - `loading.onLoadedMessageChange` reports the loaded target — and `null`
359
372
  when the user exits it — so host state stays in sync (most useful in
360
373
  compose-only mode, where your app owns what happens next). It can
@@ -1,5 +1,5 @@
1
- import { S as SupportedBlock } from './palette-TGNFqyja.cjs';
2
- export { a0 as SupportedBlockType } from './palette-TGNFqyja.cjs';
1
+ import { S as SupportedBlock } from './palette-Sz27861i.cjs';
2
+ export { a0 as SupportedBlockType } from './palette-Sz27861i.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 { S as SupportedBlock } from './palette-TGNFqyja.js';
2
- export { a0 as SupportedBlockType } from './palette-TGNFqyja.js';
1
+ import { S as SupportedBlock } from './palette-Sz27861i.js';
2
+ export { a0 as SupportedBlockType } from './palette-Sz27861i.js';
3
3
  import 'react';
4
4
  import 'slack-web-api-client';
5
5