@sesionario/blocks 1.11.0 → 1.12.0
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 +47 -29
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +23 -6
- package/dist/index.d.ts +23 -6
- package/dist/index.js +47 -29
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -2988,8 +2988,8 @@ function EmojiPicker({
|
|
|
2988
2988
|
{
|
|
2989
2989
|
ref: scrollRef,
|
|
2990
2990
|
onKeyDown: handleGridKeyDown,
|
|
2991
|
-
className: "h-64 overflow-x-hidden overflow-y-auto
|
|
2992
|
-
children: normalizedQuery ? searchResults.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-muted-foreground py-8 text-center text-sm", children: strings.noResults }) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
2991
|
+
className: "h-64 overflow-x-hidden overflow-y-auto px-2 pb-2",
|
|
2992
|
+
children: normalizedQuery ? searchResults.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-muted-foreground py-8 text-center text-sm", children: strings.noResults }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "pt-2", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2993
2993
|
EmojiGrid,
|
|
2994
2994
|
{
|
|
2995
2995
|
emojis: searchResults,
|
|
@@ -2998,7 +2998,7 @@ function EmojiPicker({
|
|
|
2998
2998
|
skinTone,
|
|
2999
2999
|
onSelect: handleSelect
|
|
3000
3000
|
}
|
|
3001
|
-
) : sections.map((section) => {
|
|
3001
|
+
) }) : sections.map((section) => {
|
|
3002
3002
|
const startIndex = flatOffset;
|
|
3003
3003
|
flatOffset += section.emojis.length;
|
|
3004
3004
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -3009,7 +3009,7 @@ function EmojiPicker({
|
|
|
3009
3009
|
},
|
|
3010
3010
|
className: "mb-2",
|
|
3011
3011
|
children: [
|
|
3012
|
-
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-muted-foreground bg-popover sticky top-0 z-[1] px-
|
|
3012
|
+
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-muted-foreground bg-popover sticky top-0 z-[1] -mx-2 px-3 pt-2 pb-1 text-xs font-medium", children: section.title }),
|
|
3013
3013
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3014
3014
|
"div",
|
|
3015
3015
|
{
|
|
@@ -3130,7 +3130,7 @@ function EmojiPickerPopover({
|
|
|
3130
3130
|
align = "end",
|
|
3131
3131
|
open,
|
|
3132
3132
|
onOpenChange,
|
|
3133
|
-
keepOpenOnSelect =
|
|
3133
|
+
keepOpenOnSelect = true,
|
|
3134
3134
|
locale = "en",
|
|
3135
3135
|
...pickerProps
|
|
3136
3136
|
}) {
|
|
@@ -3164,7 +3164,16 @@ function EmojiPickerPopover({
|
|
|
3164
3164
|
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Smile, { className: "size-5" })
|
|
3165
3165
|
}
|
|
3166
3166
|
) }),
|
|
3167
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3167
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3168
|
+
PopoverContent,
|
|
3169
|
+
{
|
|
3170
|
+
side,
|
|
3171
|
+
align,
|
|
3172
|
+
className: "w-auto p-0",
|
|
3173
|
+
onFocusOutside: (e) => e.preventDefault(),
|
|
3174
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(EmojiPicker, { onSelect: handleSelect, locale, ...pickerProps })
|
|
3175
|
+
}
|
|
3176
|
+
)
|
|
3168
3177
|
] });
|
|
3169
3178
|
}
|
|
3170
3179
|
|
|
@@ -6167,8 +6176,12 @@ var MessageComposer = React7__namespace.forwardRef(function MessageComposer2({
|
|
|
6167
6176
|
onKeyDown,
|
|
6168
6177
|
sendLabel,
|
|
6169
6178
|
sendDisabled = false,
|
|
6179
|
+
allowEmptySubmit = false,
|
|
6170
6180
|
sendButtonClassName,
|
|
6171
6181
|
sendButtonSize = "sm",
|
|
6182
|
+
submitOnEnter = true,
|
|
6183
|
+
tools,
|
|
6184
|
+
attachments,
|
|
6172
6185
|
triggerLabel,
|
|
6173
6186
|
keepOpenOnSelect,
|
|
6174
6187
|
open,
|
|
@@ -6187,7 +6200,7 @@ var MessageComposer = React7__namespace.forwardRef(function MessageComposer2({
|
|
|
6187
6200
|
const handleEmojiSelect = useEmojiInsert(fieldRef, value, onChange);
|
|
6188
6201
|
const pickerDisabled = Boolean(disabled || readOnly);
|
|
6189
6202
|
const draft = value !== void 0 && value !== null ? String(value) : "";
|
|
6190
|
-
const canSubmit = Boolean(draft.trim()) && !sendDisabled && !disabled && !readOnly;
|
|
6203
|
+
const canSubmit = (allowEmptySubmit || Boolean(draft.trim())) && !sendDisabled && !disabled && !readOnly;
|
|
6191
6204
|
const handleSubmit = React7__namespace.useCallback(
|
|
6192
6205
|
(event) => {
|
|
6193
6206
|
event.preventDefault();
|
|
@@ -6200,13 +6213,14 @@ var MessageComposer = React7__namespace.forwardRef(function MessageComposer2({
|
|
|
6200
6213
|
(event) => {
|
|
6201
6214
|
onKeyDown?.(event);
|
|
6202
6215
|
if (event.defaultPrevented) return;
|
|
6216
|
+
if (!submitOnEnter) return;
|
|
6203
6217
|
if (event.key !== "Enter" || event.shiftKey) return;
|
|
6204
6218
|
if (event.nativeEvent.isComposing || event.keyCode === 229) return;
|
|
6205
6219
|
event.preventDefault();
|
|
6206
6220
|
if (!canSubmit) return;
|
|
6207
6221
|
formRef.current?.requestSubmit();
|
|
6208
6222
|
},
|
|
6209
|
-
[canSubmit, onKeyDown]
|
|
6223
|
+
[canSubmit, onKeyDown, submitOnEnter]
|
|
6210
6224
|
);
|
|
6211
6225
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6212
6226
|
"form",
|
|
@@ -6233,28 +6247,32 @@ var MessageComposer = React7__namespace.forwardRef(function MessageComposer2({
|
|
|
6233
6247
|
...props
|
|
6234
6248
|
}
|
|
6235
6249
|
),
|
|
6250
|
+
attachments ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-t px-2 py-2", children: attachments }) : null,
|
|
6236
6251
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between gap-2 px-1.5 pb-1.5", children: [
|
|
6237
|
-
/* @__PURE__ */ jsxRuntime.
|
|
6238
|
-
|
|
6239
|
-
|
|
6240
|
-
|
|
6241
|
-
|
|
6242
|
-
|
|
6243
|
-
|
|
6244
|
-
|
|
6245
|
-
|
|
6246
|
-
|
|
6247
|
-
|
|
6248
|
-
|
|
6249
|
-
|
|
6250
|
-
|
|
6251
|
-
|
|
6252
|
-
|
|
6253
|
-
|
|
6254
|
-
|
|
6255
|
-
|
|
6256
|
-
|
|
6257
|
-
|
|
6252
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 flex-1 items-center gap-0.5", children: [
|
|
6253
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6254
|
+
EmojiPickerPopover,
|
|
6255
|
+
{
|
|
6256
|
+
locale,
|
|
6257
|
+
onSelect: handleEmojiSelect,
|
|
6258
|
+
disabled: pickerDisabled,
|
|
6259
|
+
triggerLabel,
|
|
6260
|
+
keepOpenOnSelect,
|
|
6261
|
+
open,
|
|
6262
|
+
onOpenChange,
|
|
6263
|
+
side,
|
|
6264
|
+
align,
|
|
6265
|
+
labels,
|
|
6266
|
+
recentLimit,
|
|
6267
|
+
storageKey,
|
|
6268
|
+
triggerClassName: cn(
|
|
6269
|
+
"size-7 text-muted-foreground",
|
|
6270
|
+
emojiTriggerClassName
|
|
6271
|
+
)
|
|
6272
|
+
}
|
|
6273
|
+
),
|
|
6274
|
+
tools
|
|
6275
|
+
] }),
|
|
6258
6276
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6259
6277
|
Button,
|
|
6260
6278
|
{
|