@tightknitai/block-kitchen 0.10.4 → 0.10.5
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.cjs +21 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +22 -8
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useSensors, useSensor, PointerSensor, TouchSensor, KeyboardSensor, pointerWithin, closestCenter, DndContext, DragOverlay, useDroppable, useDraggable } from '@dnd-kit/core';
|
|
2
2
|
import { sortableKeyboardCoordinates, SortableContext, verticalListSortingStrategy, useSortable } from '@dnd-kit/sortable';
|
|
3
|
-
import { X, Circle, Sparkles, FileText, AlignLeft, MousePointerClick, TextCursorInput, LayoutTemplate, Bell, Pilcrow, Image, Video, GalleryHorizontal, Table, ChartColumnBig, Container, Loader2, ExternalLink, AlertTriangle, GripVertical, Sun, Moon, MessageSquare, AppWindow, Home, MailSearch, Plus, ChevronDown, BookOpen, Undo2, Redo2, Trash2, Code2, Pencil, Send, Search, Check, Copy, CheckCircle2, ChevronRight, LayoutGrid, ArrowUp, ArrowDown, Type, Bold, Italic, Strikethrough, Underline, Code, List, ListOrdered, Quote, Smile, Link as Link$1 } from 'lucide-react';
|
|
3
|
+
import { X, Circle, Sparkles, FileText, AlignLeft, MousePointerClick, TextCursorInput, LayoutTemplate, Bell, Pilcrow, Image, Video, GalleryHorizontal, Table, ChartColumnBig, Container, Loader2, ExternalLink, AlertTriangle, GripVertical, Sun, Moon, MessageSquare, AppWindow, Home, MailSearch, Plus, ChevronDown, BookOpen, Undo2, Redo2, Trash2, Code2, Pencil, Send, Search, Check, Copy, Info, CheckCircle2, ChevronRight, LayoutGrid, ArrowUp, ArrowDown, Type, Bold, Italic, Strikethrough, Underline, Code, List, ListOrdered, Quote, Smile, Link as Link$1 } from 'lucide-react';
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import { createContext, useState, useRef, useEffect, useCallback, useMemo, useId, useContext } from 'react';
|
|
6
6
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
@@ -3221,6 +3221,7 @@ function SlackSignInButton({ onClick, polling }) {
|
|
|
3221
3221
|
}
|
|
3222
3222
|
var LINK_DEBOUNCE_MS = 400;
|
|
3223
3223
|
var LINK_HELP_TEXT = 'Click the \u2807menu while hovering over the message in Slack (or right-click), and select "Copy Link".';
|
|
3224
|
+
var LINK_HELP_LABEL = "Where to find a message link";
|
|
3224
3225
|
var TABS = [
|
|
3225
3226
|
{ id: "recent", label: "Pick from Recent" },
|
|
3226
3227
|
{ id: "link", label: "Direct Link" }
|
|
@@ -3474,7 +3475,7 @@ function LoadMessageDialog({
|
|
|
3474
3475
|
return /* @__PURE__ */ jsx(Dialog, { open, onOpenChange, children: /* @__PURE__ */ jsxs(
|
|
3475
3476
|
DialogContent,
|
|
3476
3477
|
{
|
|
3477
|
-
className: "flex max-h-[85svh] w-[calc(100vw-1.5rem)] flex-col rounded-lg lg:max-w-
|
|
3478
|
+
className: "flex max-h-[85svh] w-[calc(100vw-1.5rem)] max-w-4xl flex-col rounded-lg max-lg:max-w-lg",
|
|
3478
3479
|
onOpenAutoFocus: (e) => {
|
|
3479
3480
|
if (hasRecent) {
|
|
3480
3481
|
return;
|
|
@@ -3487,7 +3488,7 @@ function LoadMessageDialog({
|
|
|
3487
3488
|
/* @__PURE__ */ jsx(DialogTitle, { children: "Find an existing message" }),
|
|
3488
3489
|
/* @__PURE__ */ jsx(DialogDescription, { children: hasRecent ? "Pick a recent message your app posted, or paste a Slack message link. Preview it before loading." : `Paste a Slack message link (Slack's "Copy link") to preview it and load its blocks for editing.` })
|
|
3489
3490
|
] }),
|
|
3490
|
-
/* @__PURE__ */ jsxs("div", { className: "-mx-1 flex min-h-0 min-w-0 flex-1 flex-col gap-4 overflow-y-auto
|
|
3491
|
+
/* @__PURE__ */ jsxs("div", { className: "-mx-1 flex min-h-0 min-w-0 flex-1 px-1 max-lg:flex-col max-lg:gap-4 max-lg:overflow-y-auto lg:flex-row lg:gap-5 lg:overflow-hidden", children: [
|
|
3491
3492
|
/* @__PURE__ */ jsxs("div", { className: "flex min-w-0 shrink-0 flex-col gap-3 lg:min-h-0 lg:w-[19rem]", children: [
|
|
3492
3493
|
hasRecent && /* @__PURE__ */ jsx(TabStrip, { activeTab, onSelect: setTab, tabDomId, panelDomId }),
|
|
3493
3494
|
activeTab === "recent" ? /* @__PURE__ */ jsxs(
|
|
@@ -3522,7 +3523,7 @@ function LoadMessageDialog({
|
|
|
3522
3523
|
channelId && recent === null && !recentError && /* @__PURE__ */ jsx("p", { className: "shrink-0 text-xs text-muted-foreground", children: "Loading recent messages\u2026" }),
|
|
3523
3524
|
channelId && recentError && /* @__PURE__ */ jsx("p", { className: "shrink-0 text-xs text-destructive", children: recentError }),
|
|
3524
3525
|
channelId && recent && recent.length === 0 && !recentError && /* @__PURE__ */ jsx("p", { className: "shrink-0 text-xs text-muted-foreground", children: "No recent messages from this app in this channel." }),
|
|
3525
|
-
channelId && recent && recent.length > 0 && /* @__PURE__ */ jsx("div", { className: "flex
|
|
3526
|
+
channelId && recent && recent.length > 0 && /* @__PURE__ */ jsx("div", { className: "flex min-h-0 min-w-0 flex-col gap-1 overflow-y-auto max-lg:max-h-60 lg:flex-1", children: recent.map((m) => {
|
|
3526
3527
|
const asUser = (m.editableVia ?? "bot") === "user";
|
|
3527
3528
|
const authorName = m.username || (asUser ? "You" : "App bot");
|
|
3528
3529
|
const safeIcon = isSafeImageSrc(m.iconUrl) ? m.iconUrl : void 0;
|
|
@@ -3580,7 +3581,21 @@ function LoadMessageDialog({
|
|
|
3580
3581
|
className: "-mx-1 flex min-w-0 flex-col gap-2 px-1 lg:min-h-0 lg:flex-1 lg:overflow-y-auto",
|
|
3581
3582
|
children: [
|
|
3582
3583
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1.5", children: [
|
|
3583
|
-
/* @__PURE__ */
|
|
3584
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5", children: [
|
|
3585
|
+
/* @__PURE__ */ jsx(Label, { htmlFor: "message-link", children: "Message link" }),
|
|
3586
|
+
/* @__PURE__ */ jsxs(Tooltip, { children: [
|
|
3587
|
+
/* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
3588
|
+
"button",
|
|
3589
|
+
{
|
|
3590
|
+
type: "button",
|
|
3591
|
+
"aria-label": LINK_HELP_LABEL,
|
|
3592
|
+
className: "flex h-4 w-4 items-center justify-center rounded-full text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",
|
|
3593
|
+
children: /* @__PURE__ */ jsx(Info, { className: "h-3.5 w-3.5" })
|
|
3594
|
+
}
|
|
3595
|
+
) }),
|
|
3596
|
+
/* @__PURE__ */ jsx(TooltipContent, { side: "right", children: LINK_HELP_TEXT })
|
|
3597
|
+
] })
|
|
3598
|
+
] }),
|
|
3584
3599
|
/* @__PURE__ */ jsx(
|
|
3585
3600
|
Input,
|
|
3586
3601
|
{
|
|
@@ -3602,8 +3617,7 @@ function LoadMessageDialog({
|
|
|
3602
3617
|
autoComplete: "off",
|
|
3603
3618
|
spellCheck: false
|
|
3604
3619
|
}
|
|
3605
|
-
)
|
|
3606
|
-
/* @__PURE__ */ jsx("p", { className: "text-xs leading-relaxed text-muted-foreground", children: LINK_HELP_TEXT })
|
|
3620
|
+
)
|
|
3607
3621
|
] }),
|
|
3608
3622
|
emptyLinkError && /* @__PURE__ */ jsx("p", { className: "rounded-md border border-destructive/30 bg-destructive/5 p-2 text-xs text-destructive", children: emptyLinkError })
|
|
3609
3623
|
]
|
|
@@ -3707,7 +3721,7 @@ function PreviewPane({
|
|
|
3707
3721
|
role: "region",
|
|
3708
3722
|
"aria-label": "Message preview",
|
|
3709
3723
|
tabIndex: 0,
|
|
3710
|
-
className: "flex
|
|
3724
|
+
className: "flex flex-1 flex-col gap-3 overflow-y-auto rounded-md border bg-muted/40 p-3 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring max-lg:max-h-72 max-lg:min-h-32 lg:min-h-0",
|
|
3711
3725
|
children: [
|
|
3712
3726
|
state.kind === "not-editable" && /* @__PURE__ */ jsxs("div", { className: "flex shrink-0 flex-col gap-2 rounded-md border border-amber-200! bg-amber-50 p-3 text-xs text-amber-800", children: [
|
|
3713
3727
|
/* @__PURE__ */ jsxs("div", { className: "flex items-start gap-2", children: [
|