@brainfish-ai/components 0.8.2-alpha.0 → 0.8.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/esm/chunks/{ChatSearch.Baru4deb.js → ChatSearch.SKfNDI-w.js} +5 -5
- package/dist/esm/chunks/ChatSearch.SKfNDI-w.js.map +1 -0
- package/dist/esm/chunks/{FormattedMessage.CyP9HgTe.js → FormattedMessage.DPRps9mh.js} +30 -30
- package/dist/esm/chunks/{FormattedMessage.CyP9HgTe.js.map → FormattedMessage.DPRps9mh.js.map} +1 -1
- package/dist/esm/chunks/{simpleSelect.BbTlGnz2.js → simpleSelect.BiVUOs29.js} +2 -3
- package/dist/esm/chunks/{simpleSelect.BbTlGnz2.js.map → simpleSelect.BiVUOs29.js.map} +1 -1
- package/dist/esm/components/chat-search.js +1 -1
- package/dist/esm/components/markdown.js +1 -1
- package/dist/esm/components/select.js +1 -1
- package/dist/esm/index.js +3 -3
- package/dist/index.d.ts +2 -2
- package/dist/markdown.d.ts +2 -1
- package/dist/select.d.ts +2 -2
- package/dist/stats.html +1 -1
- package/package.json +1 -1
- package/dist/esm/chunks/ChatSearch.Baru4deb.js.map +0 -1
- package/stats.html +0 -4949
|
@@ -39035,11 +39035,11 @@ const CodeBlock = memo(({ language, value }) => {
|
|
|
39035
39035
|
});
|
|
39036
39036
|
CodeBlock.displayName = "CodeBlock";
|
|
39037
39037
|
|
|
39038
|
-
const Frame =
|
|
39038
|
+
const Frame = React.forwardRef(
|
|
39039
39039
|
({ src, border, width = "100%", height = "400px", title }, ref) => {
|
|
39040
|
-
const [isLoaded, setIsLoaded] =
|
|
39041
|
-
const [iframeLoaded, setIframeLoaded] =
|
|
39042
|
-
|
|
39040
|
+
const [isLoaded, setIsLoaded] = React.useState(false);
|
|
39041
|
+
const [iframeLoaded, setIframeLoaded] = React.useState(false);
|
|
39042
|
+
React.useEffect(() => {
|
|
39043
39043
|
let mounted = true;
|
|
39044
39044
|
setTimeout(() => {
|
|
39045
39045
|
if (mounted) {
|
|
@@ -39050,7 +39050,7 @@ const Frame = React__default.forwardRef(
|
|
|
39050
39050
|
mounted = false;
|
|
39051
39051
|
};
|
|
39052
39052
|
}, []);
|
|
39053
|
-
return /* @__PURE__ */
|
|
39053
|
+
return /* @__PURE__ */ React.createElement(
|
|
39054
39054
|
"div",
|
|
39055
39055
|
{
|
|
39056
39056
|
className: `overflow-hidden rounded-lg mt-4 relative ${border ? "border" : ""}`,
|
|
@@ -39059,7 +39059,7 @@ const Frame = React__default.forwardRef(
|
|
|
39059
39059
|
height
|
|
39060
39060
|
}
|
|
39061
39061
|
},
|
|
39062
|
-
isLoaded && /* @__PURE__ */
|
|
39062
|
+
isLoaded && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", { className: `absolute w-full h-full ${!iframeLoaded ? "block" : "hidden"}` }, /* @__PURE__ */ React.createElement("div", { className: "absolute inset-0 bg-muted/10 rounded-lg" }, /* @__PURE__ */ React.createElement("div", { className: "absolute inset-0" }, /* @__PURE__ */ React.createElement("div", { className: "h-full w-full shimmer" }), /* @__PURE__ */ React.createElement("div", { className: "absolute left-1/2 top-1/2 -translate-1/2 flex flex-col items-center gap-2" }, /* @__PURE__ */ React.createElement("div", { className: "modern-spinner" }), /* @__PURE__ */ React.createElement("div", { className: "text-sm text-muted-foreground" }, "Loading..."))))), /* @__PURE__ */ React.createElement("div", { className: !iframeLoaded ? "invisible" : "visible" }, /* @__PURE__ */ React.createElement(
|
|
39063
39063
|
"iframe",
|
|
39064
39064
|
{
|
|
39065
39065
|
ref,
|
|
@@ -39073,14 +39073,14 @@ const Frame = React__default.forwardRef(
|
|
|
39073
39073
|
className: "block rounded-lg",
|
|
39074
39074
|
onLoad: () => setIframeLoaded(true)
|
|
39075
39075
|
}
|
|
39076
|
-
), title && /* @__PURE__ */
|
|
39076
|
+
), title && /* @__PURE__ */ React.createElement("span", { className: "block text-center text-sm font-medium" }, title)))
|
|
39077
39077
|
);
|
|
39078
39078
|
}
|
|
39079
39079
|
);
|
|
39080
39080
|
|
|
39081
39081
|
function Loom(props) {
|
|
39082
39082
|
const normalizedUrl = props.attrs.href.replace("share", "embed");
|
|
39083
|
-
return /* @__PURE__ */
|
|
39083
|
+
return /* @__PURE__ */ React.createElement(Frame, { ...props, src: normalizedUrl, title: "Loom Embed" });
|
|
39084
39084
|
}
|
|
39085
39085
|
Loom.isMatch = (href) => {
|
|
39086
39086
|
const loomRegex = /^https:\/\/(www\.)?(use)?loom\.com\/(embed|share)\/(.*)$/;
|
|
@@ -39088,7 +39088,7 @@ Loom.isMatch = (href) => {
|
|
|
39088
39088
|
};
|
|
39089
39089
|
|
|
39090
39090
|
function Supademo(props) {
|
|
39091
|
-
return /* @__PURE__ */
|
|
39091
|
+
return /* @__PURE__ */ React.createElement(Frame, { ...props, src: props.attrs.href, title: "Supademo Embed" });
|
|
39092
39092
|
}
|
|
39093
39093
|
Supademo.isMatch = (href) => {
|
|
39094
39094
|
const urlRegex = /^https:\/\/app\.supademo\.com\/embed\/(.*)$/;
|
|
@@ -39096,7 +39096,7 @@ Supademo.isMatch = (href) => {
|
|
|
39096
39096
|
};
|
|
39097
39097
|
|
|
39098
39098
|
function Typeform(props) {
|
|
39099
|
-
return /* @__PURE__ */
|
|
39099
|
+
return /* @__PURE__ */ React.createElement(Frame, { ...props, src: props.attrs.href, title: "Typeform Embed" });
|
|
39100
39100
|
}
|
|
39101
39101
|
Typeform.isMatch = (href) => {
|
|
39102
39102
|
const urlRegex = /^https:\/\/([A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?)\.typeform\.com\/to\/(.*)$/;
|
|
@@ -39113,7 +39113,7 @@ function Vimeo(props) {
|
|
|
39113
39113
|
const videoId = matches[4];
|
|
39114
39114
|
const hId = matches[5];
|
|
39115
39115
|
const embedUrl = `https://player.vimeo.com/video/${videoId}?byline=0${hId ? `&h=${hId}` : ""}`;
|
|
39116
|
-
return /* @__PURE__ */
|
|
39116
|
+
return /* @__PURE__ */ React.createElement(Frame, { ...props, src: embedUrl, title: `Vimeo Embed (${videoId})`, height: "412px", border: false });
|
|
39117
39117
|
}
|
|
39118
39118
|
Vimeo.isMatch = (href) => {
|
|
39119
39119
|
const regex = /^(https?):\/\/(www\.)?vimeo\.com\/(?:channels\/(?:\w+\/)?|groups\/([^/]*)\/videos\/|)?(\d+)(\/)?(?:\?.*|#.*)?$/i;
|
|
@@ -39139,7 +39139,7 @@ function Wistia(props) {
|
|
|
39139
39139
|
const domain = matches[1];
|
|
39140
39140
|
const videoId = matches[2] || matches[1];
|
|
39141
39141
|
const embedUrl = domain ? `https://${domain}.wistia.com/embed/iframe/${videoId}?seo=true&videoFoam=false` : `https://fast.wistia.com/embed/iframe/${videoId}`;
|
|
39142
|
-
return /* @__PURE__ */
|
|
39142
|
+
return /* @__PURE__ */ React.createElement(Frame, { ...props, src: embedUrl, border: true, title: `Wistia Embed (${videoId})` });
|
|
39143
39143
|
}
|
|
39144
39144
|
Wistia.isMatch = (href) => {
|
|
39145
39145
|
const urlRegexes = [
|
|
@@ -39174,7 +39174,7 @@ function YouTube(props) {
|
|
|
39174
39174
|
}
|
|
39175
39175
|
const timestamp = extractTimestamp(props.attrs.href);
|
|
39176
39176
|
const embedUrl = `https://www.youtube.com/embed/${videoId}?modestbranding=1${timestamp ? `&start=${timestamp}` : ""}`;
|
|
39177
|
-
return /* @__PURE__ */
|
|
39177
|
+
return /* @__PURE__ */ React.createElement(Frame, { ...props, src: embedUrl, title: `YouTube Embed (${videoId})` });
|
|
39178
39178
|
}
|
|
39179
39179
|
YouTube.isMatch = (href) => {
|
|
39180
39180
|
return YOUTUBE_URL_REGEX.test(href);
|
|
@@ -39253,12 +39253,12 @@ const MermaidDiagram = ({ content }) => {
|
|
|
39253
39253
|
};
|
|
39254
39254
|
|
|
39255
39255
|
const ZoomableImage = ({ src, alt }) => {
|
|
39256
|
-
const [isZoomed, setIsZoomed] =
|
|
39257
|
-
const [showFullCaption, setShowFullCaption] =
|
|
39258
|
-
const [imageError, setImageError] =
|
|
39259
|
-
const [isLoading, setIsLoading] =
|
|
39260
|
-
const [dimensions, setDimensions] =
|
|
39261
|
-
const imgRef =
|
|
39256
|
+
const [isZoomed, setIsZoomed] = React.useState(false);
|
|
39257
|
+
const [showFullCaption, setShowFullCaption] = React.useState(false);
|
|
39258
|
+
const [imageError, setImageError] = React.useState(false);
|
|
39259
|
+
const [isLoading, setIsLoading] = React.useState(false);
|
|
39260
|
+
const [dimensions, setDimensions] = React.useState({ width: 0, height: 0 });
|
|
39261
|
+
const imgRef = React.useRef(null);
|
|
39262
39262
|
const toggleZoom = () => {
|
|
39263
39263
|
setIsZoomed(!isZoomed);
|
|
39264
39264
|
};
|
|
@@ -39281,7 +39281,7 @@ const ZoomableImage = ({ src, alt }) => {
|
|
|
39281
39281
|
if (!src || imageError) {
|
|
39282
39282
|
return null;
|
|
39283
39283
|
}
|
|
39284
|
-
return /* @__PURE__ */
|
|
39284
|
+
return /* @__PURE__ */ React.createElement("figure", { className: "relative inline-block my-4 px-4 w-full sm:w-auto" }, /* @__PURE__ */ React.createElement("div", { className: "flex items-center justify-center min-h-[100px]" }, /* @__PURE__ */ React.createElement(
|
|
39285
39285
|
"button",
|
|
39286
39286
|
{
|
|
39287
39287
|
type: "button",
|
|
@@ -39289,7 +39289,7 @@ const ZoomableImage = ({ src, alt }) => {
|
|
|
39289
39289
|
className: "border-0 p-0 bg-transparent relative group",
|
|
39290
39290
|
"aria-label": isZoomed ? "Zoom out image" : "Zoom in image"
|
|
39291
39291
|
},
|
|
39292
|
-
isLoading && /* @__PURE__ */
|
|
39292
|
+
isLoading && /* @__PURE__ */ React.createElement(
|
|
39293
39293
|
"div",
|
|
39294
39294
|
{
|
|
39295
39295
|
className: "rounded-md bg-gray-200 dark:bg-gray-800 animate-pulse",
|
|
@@ -39300,7 +39300,7 @@ const ZoomableImage = ({ src, alt }) => {
|
|
|
39300
39300
|
}
|
|
39301
39301
|
}
|
|
39302
39302
|
),
|
|
39303
|
-
/* @__PURE__ */
|
|
39303
|
+
/* @__PURE__ */ React.createElement(
|
|
39304
39304
|
"img",
|
|
39305
39305
|
{
|
|
39306
39306
|
ref: imgRef,
|
|
@@ -39311,16 +39311,16 @@ const ZoomableImage = ({ src, alt }) => {
|
|
|
39311
39311
|
className: `max-h-[300px] w-auto object-contain cursor-zoom-in hover:opacity-90 transition-opacity ${isLoading ? "opacity-0 absolute" : "opacity-100 relative"}`
|
|
39312
39312
|
}
|
|
39313
39313
|
),
|
|
39314
|
-
!isLoading && /* @__PURE__ */
|
|
39315
|
-
)), alt && !isLoading && /* @__PURE__ */
|
|
39314
|
+
!isLoading && /* @__PURE__ */ React.createElement("div", { className: "absolute bottom-2 right-2 opacity-0 group-hover:opacity-100 transition-opacity" }, /* @__PURE__ */ React.createElement("div", { className: "bg-black/50 text-white p-1.5 rounded-lg" }, /* @__PURE__ */ React.createElement(ArrowsOut, { size: 16 })))
|
|
39315
|
+
)), alt && !isLoading && /* @__PURE__ */ React.createElement("div", { className: "relative mt-1" }, /* @__PURE__ */ React.createElement(
|
|
39316
39316
|
"figcaption",
|
|
39317
39317
|
{
|
|
39318
39318
|
className: "text-sm text-gray-600 dark:text-gray-400 text-center group cursor-default",
|
|
39319
39319
|
onMouseEnter: () => setShowFullCaption(true),
|
|
39320
39320
|
onMouseLeave: () => setShowFullCaption(false)
|
|
39321
39321
|
},
|
|
39322
|
-
/* @__PURE__ */
|
|
39323
|
-
), showFullCaption && /* @__PURE__ */
|
|
39322
|
+
/* @__PURE__ */ React.createElement("div", { className: "line-clamp-2 hover:text-gray-700 dark:hover:text-gray-300" }, alt)
|
|
39323
|
+
), showFullCaption && /* @__PURE__ */ React.createElement("div", { className: "absolute bottom-full left-0 right-0 mb-1 p-2 bg-white dark:bg-gray-800 rounded-lg shadow-lg border border-gray-200 dark:border-gray-700 text-sm text-gray-600 dark:text-gray-400 z-10" }, alt)), /* @__PURE__ */ React.createElement(AnimatePresence, null, isZoomed && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
39324
39324
|
motion.div,
|
|
39325
39325
|
{
|
|
39326
39326
|
initial: { opacity: 0 },
|
|
@@ -39329,7 +39329,7 @@ const ZoomableImage = ({ src, alt }) => {
|
|
|
39329
39329
|
className: "fixed inset-0 bg-black/80 z-50",
|
|
39330
39330
|
onClick: toggleZoom
|
|
39331
39331
|
}
|
|
39332
|
-
), /* @__PURE__ */
|
|
39332
|
+
), /* @__PURE__ */ React.createElement(
|
|
39333
39333
|
motion.div,
|
|
39334
39334
|
{
|
|
39335
39335
|
initial: { scale: 0.5, opacity: 0 },
|
|
@@ -39338,8 +39338,8 @@ const ZoomableImage = ({ src, alt }) => {
|
|
|
39338
39338
|
className: "fixed inset-0 z-50 flex flex-col items-center justify-center cursor-zoom-out gap-4 p-4 sm:p-8",
|
|
39339
39339
|
onClick: toggleZoom
|
|
39340
39340
|
},
|
|
39341
|
-
/* @__PURE__ */
|
|
39342
|
-
alt && /* @__PURE__ */
|
|
39341
|
+
/* @__PURE__ */ React.createElement("div", { className: "max-w-[95vw] sm:max-w-[90vw] max-h-[80vh]" }, /* @__PURE__ */ React.createElement("img", { src, alt, className: "w-full h-full object-contain" })),
|
|
39342
|
+
alt && /* @__PURE__ */ React.createElement("div", { className: "max-w-[95vw] sm:max-w-[90vw] text-white text-center text-sm" }, alt)
|
|
39343
39343
|
))));
|
|
39344
39344
|
};
|
|
39345
39345
|
|
|
@@ -39490,4 +39490,4 @@ const FormattedMessage = memo(({ message, isStreaming, redirectRules = [] }) =>
|
|
|
39490
39490
|
FormattedMessage.displayName = "FormattedMessage";
|
|
39491
39491
|
|
|
39492
39492
|
export { CodeBlock as C, FormattedMessage as F, MemoizedReactMarkdown as M, ZoomableImage as Z, MermaidDiagram as a, getDefaultExportFromCjs as g };
|
|
39493
|
-
//# sourceMappingURL=FormattedMessage.
|
|
39493
|
+
//# sourceMappingURL=FormattedMessage.DPRps9mh.js.map
|