@tightknitai/block-kitchen 0.9.0 → 0.9.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.cjs +38 -33
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +39 -34
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
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, GripVertical, Sun, Moon, MessageSquare, AppWindow, Home,
|
|
3
|
+
import { X, Circle, Sparkles, FileText, AlignLeft, MousePointerClick, TextCursorInput, LayoutTemplate, Bell, Pilcrow, Image, Video, GalleryHorizontal, Table, ChartColumnBig, Container, GripVertical, Sun, Moon, MessageSquare, AppWindow, Home, MailSearch, Plus, ChevronDown, BookOpen, ExternalLink, AlertTriangle, Trash2, Code2, Pencil, Send, Search, Info, CheckCircle2, Check, ChevronRight, LayoutGrid, ArrowUp, ArrowDown, Copy, Type, Bold, Italic, Strikethrough, Underline, Code, List, ListOrdered, Quote, Undo2, Redo2, Smile, Link as Link$1 } from 'lucide-react';
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import { createContext, useMemo, useState, useCallback, useRef, useEffect, useId, useContext } from 'react';
|
|
6
6
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
@@ -2922,7 +2922,7 @@ function LoadMessageDialog({
|
|
|
2922
2922
|
children: [
|
|
2923
2923
|
/* @__PURE__ */ jsxs(DialogHeader, { children: [
|
|
2924
2924
|
/* @__PURE__ */ jsx(DialogTitle, { children: "Edit an existing message" }),
|
|
2925
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-start gap-1.5", children: [
|
|
2925
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-start gap-1.5 text-left", children: [
|
|
2926
2926
|
/* @__PURE__ */ jsx(DialogDescription, { children: hasRecent ? "Paste a Slack message link, or pick a recent message your app posted." : `Paste a Slack message link (Slack's "Copy link") to load its blocks for editing.` }),
|
|
2927
2927
|
/* @__PURE__ */ jsxs(Tooltip, { children: [
|
|
2928
2928
|
/* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
@@ -2944,7 +2944,7 @@ function LoadMessageDialog({
|
|
|
2944
2944
|
] })
|
|
2945
2945
|
] })
|
|
2946
2946
|
] }),
|
|
2947
|
-
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4", children: [
|
|
2947
|
+
/* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-col gap-4", children: [
|
|
2948
2948
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1.5", children: [
|
|
2949
2949
|
/* @__PURE__ */ jsx(Label, { htmlFor: "message-link", children: "Message link" }),
|
|
2950
2950
|
/* @__PURE__ */ jsx(
|
|
@@ -2989,7 +2989,7 @@ function LoadMessageDialog({
|
|
|
2989
2989
|
}
|
|
2990
2990
|
)
|
|
2991
2991
|
] }),
|
|
2992
|
-
hasRecent && /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
2992
|
+
hasRecent && /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-col gap-2", children: [
|
|
2993
2993
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-xs text-muted-foreground", children: [
|
|
2994
2994
|
/* @__PURE__ */ jsx("span", { className: "h-px flex-1 bg-border" }),
|
|
2995
2995
|
"or pick a recent message",
|
|
@@ -3021,23 +3021,28 @@ function LoadMessageDialog({
|
|
|
3021
3021
|
channelId && recent === null && !recentError && /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: "Loading recent messages\u2026" }),
|
|
3022
3022
|
channelId && recentError && /* @__PURE__ */ jsx("p", { className: "text-xs text-destructive", children: recentError }),
|
|
3023
3023
|
channelId && recent && recent.length === 0 && !recentError && /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: "No recent messages from this app in this channel." }),
|
|
3024
|
-
channelId && recent && recent.length > 0 && /* @__PURE__ */ jsx("div", { className: "flex max-h-48 flex-col gap-1 overflow-y-auto", children: recent.map((m) => {
|
|
3024
|
+
channelId && recent && recent.length > 0 && /* @__PURE__ */ jsx("div", { className: "flex max-h-48 min-w-0 flex-col gap-1 overflow-y-auto", children: recent.map((m) => {
|
|
3025
3025
|
const asUser = (m.editableVia ?? "bot") === "user";
|
|
3026
3026
|
return /* @__PURE__ */ jsxs(
|
|
3027
3027
|
"button",
|
|
3028
3028
|
{
|
|
3029
3029
|
type: "button",
|
|
3030
3030
|
onClick: () => onLoaded(recentToResult(m)),
|
|
3031
|
-
className: "flex flex-col gap-0.5 rounded-md border border-input bg-background px-3 py-2 text-left text-sm hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",
|
|
3031
|
+
className: "flex min-w-0 flex-col gap-0.5 rounded-md border border-input bg-background px-3 py-2 text-left text-sm hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",
|
|
3032
3032
|
children: [
|
|
3033
|
-
/* @__PURE__ */ jsxs("span", { className: "flex items-baseline justify-between gap-2", children: [
|
|
3034
|
-
/* @__PURE__ */
|
|
3035
|
-
|
|
3036
|
-
/* @__PURE__ */ jsx("span", { className: "
|
|
3037
|
-
|
|
3038
|
-
|
|
3033
|
+
/* @__PURE__ */ jsxs("span", { className: "flex min-w-0 items-baseline justify-between gap-2", children: [
|
|
3034
|
+
/* @__PURE__ */ jsx("span", { className: "shrink-0 rounded border px-1 py-px text-[10px] font-medium uppercase tracking-wide text-muted-foreground", children: asUser ? "You" : "Bot" }),
|
|
3035
|
+
/* @__PURE__ */ jsxs("span", { className: "shrink-0 text-xs text-muted-foreground", children: [
|
|
3036
|
+
/* @__PURE__ */ jsx("span", { className: "font-semibold text-foreground", children: new Date(Number(m.ts) * 1e3).toLocaleString() }),
|
|
3037
|
+
" ",
|
|
3038
|
+
/* @__PURE__ */ jsxs("span", { className: "font-mono", children: [
|
|
3039
|
+
"(",
|
|
3040
|
+
m.ts,
|
|
3041
|
+
")"
|
|
3042
|
+
] })
|
|
3043
|
+
] })
|
|
3039
3044
|
] }),
|
|
3040
|
-
m.label && /* @__PURE__ */ jsx("span", { className: "truncate text-
|
|
3045
|
+
m.label && /* @__PURE__ */ jsx("span", { className: "truncate text-sm text-muted-foreground", children: m.label })
|
|
3041
3046
|
]
|
|
3042
3047
|
},
|
|
3043
3048
|
`${m.channelId}:${m.ts}`
|
|
@@ -3349,25 +3354,6 @@ function SendDialog({
|
|
|
3349
3354
|
/* @__PURE__ */ jsx(DialogDescription, { children: "Pick a channel and choose who to post as." })
|
|
3350
3355
|
] }),
|
|
3351
3356
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4", children: [
|
|
3352
|
-
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1.5", children: [
|
|
3353
|
-
/* @__PURE__ */ jsx(Label, { htmlFor: "channel-picker", children: "Channel" }),
|
|
3354
|
-
channels === null && !channelsError && /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: "Loading channels\u2026" }),
|
|
3355
|
-
channelsError && /* @__PURE__ */ jsx("p", { className: "text-xs text-destructive", children: channelsError }),
|
|
3356
|
-
channels && channels.length === 0 && /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: "No public channels available." }),
|
|
3357
|
-
channels && channels.length > 0 && /* @__PURE__ */ jsx(
|
|
3358
|
-
"select",
|
|
3359
|
-
{
|
|
3360
|
-
id: "channel-picker",
|
|
3361
|
-
value: channelId,
|
|
3362
|
-
onChange: (e) => setChannelId(e.target.value),
|
|
3363
|
-
className: "flex h-9 w-full rounded-md border border-input bg-background px-3 py-1 text-sm shadow-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",
|
|
3364
|
-
children: channels.map((c) => /* @__PURE__ */ jsxs("option", { value: c.id, children: [
|
|
3365
|
-
"#",
|
|
3366
|
-
c.name
|
|
3367
|
-
] }, c.id))
|
|
3368
|
-
}
|
|
3369
|
-
)
|
|
3370
|
-
] }),
|
|
3371
3357
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1.5", children: [
|
|
3372
3358
|
/* @__PURE__ */ jsx(Label, { htmlFor: "send-as-picker", children: "Post as" }),
|
|
3373
3359
|
/* @__PURE__ */ jsxs(
|
|
@@ -3404,6 +3390,25 @@ function SendDialog({
|
|
|
3404
3390
|
"to post as yourself."
|
|
3405
3391
|
] })
|
|
3406
3392
|
] }),
|
|
3393
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1.5", children: [
|
|
3394
|
+
/* @__PURE__ */ jsx(Label, { htmlFor: "channel-picker", children: "Channel" }),
|
|
3395
|
+
channels === null && !channelsError && /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: "Loading channels\u2026" }),
|
|
3396
|
+
channelsError && /* @__PURE__ */ jsx("p", { className: "text-xs text-destructive", children: channelsError }),
|
|
3397
|
+
channels && channels.length === 0 && /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: "No public channels available." }),
|
|
3398
|
+
channels && channels.length > 0 && /* @__PURE__ */ jsx(
|
|
3399
|
+
"select",
|
|
3400
|
+
{
|
|
3401
|
+
id: "channel-picker",
|
|
3402
|
+
value: channelId,
|
|
3403
|
+
onChange: (e) => setChannelId(e.target.value),
|
|
3404
|
+
className: "flex h-9 w-full rounded-md border border-input bg-background px-3 py-1 text-sm shadow-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",
|
|
3405
|
+
children: channels.map((c) => /* @__PURE__ */ jsxs("option", { value: c.id, children: [
|
|
3406
|
+
"#",
|
|
3407
|
+
c.name
|
|
3408
|
+
] }, c.id))
|
|
3409
|
+
}
|
|
3410
|
+
)
|
|
3411
|
+
] }),
|
|
3407
3412
|
errorCount > 0 ? /* @__PURE__ */ jsxs(
|
|
3408
3413
|
"button",
|
|
3409
3414
|
{
|
|
@@ -9171,8 +9176,8 @@ function Toolbar2({
|
|
|
9171
9176
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
9172
9177
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center justify-between gap-x-2 gap-y-1 border-b bg-background px-2 py-1.5 sm:px-3 sm:py-2", children: [
|
|
9173
9178
|
/* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-1 items-center gap-1 sm:gap-2", children: [
|
|
9174
|
-
editingEnabled
|
|
9175
|
-
/* @__PURE__ */ jsx(
|
|
9179
|
+
editingEnabled ? /* @__PURE__ */ jsxs(Button, { type: "button", size: "sm", onClick: onOpenLoad, "aria-label": loadButtonLabel, children: [
|
|
9180
|
+
/* @__PURE__ */ jsx(MailSearch, { className: "h-3.5 w-3.5" }),
|
|
9176
9181
|
/* @__PURE__ */ jsx("span", { className: "hidden md:inline", children: loadButtonLabel })
|
|
9177
9182
|
] }) : null,
|
|
9178
9183
|
onOpenPalette ? /* @__PURE__ */ jsxs(
|