@pollinations/ui 0.1.0-alpha.4 → 0.1.0-alpha.6

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.js CHANGED
@@ -4135,7 +4135,7 @@ var StatCard = ({
4135
4135
  ] });
4136
4136
 
4137
4137
  // src/compositions/ToolCallDetails.tsx
4138
- import { useState as useState7 } from "react";
4138
+ import { Fragment as Fragment11, useState as useState7 } from "react";
4139
4139
 
4140
4140
  // src/primitives/InlineLink.tsx
4141
4141
  import { jsx as jsx44, jsxs as jsxs32 } from "react/jsx-runtime";
@@ -4188,10 +4188,21 @@ function linkedValue(value) {
4188
4188
  const formatted = formattedValue(value);
4189
4189
  const segments = formatted.split(/(https:\/\/[^\s"\\]+)/g);
4190
4190
  let offset = 0;
4191
- return segments.map((segment) => {
4191
+ return segments.map((segment, index) => {
4192
4192
  const key = `${offset}:${segment}`;
4193
4193
  offset += segment.length;
4194
- return segment.startsWith("https://") ? /* @__PURE__ */ jsx45(InlineLink, { href: segment, children: segment }, key) : segment;
4194
+ if (!segment.startsWith("https://")) return segment;
4195
+ let href = segment;
4196
+ const quotedUrl = segments[index - 1]?.endsWith('"') && segments[index + 1]?.startsWith('"');
4197
+ let extraClosingParens = (href.match(/\)/g)?.length ?? 0) - (href.match(/\(/g)?.length ?? 0);
4198
+ while (!quotedUrl && (/[.,!?;:]$/.test(href) || href.endsWith(")") && extraClosingParens > 0)) {
4199
+ if (href.endsWith(")")) extraClosingParens--;
4200
+ href = href.slice(0, -1);
4201
+ }
4202
+ return /* @__PURE__ */ jsxs33(Fragment11, { children: [
4203
+ /* @__PURE__ */ jsx45(InlineLink, { href, children: href }),
4204
+ segment.slice(href.length)
4205
+ ] }, key);
4195
4206
  });
4196
4207
  }
4197
4208
  function ToolValue({
@@ -4696,7 +4707,7 @@ var Slider = forwardRef7(
4696
4707
  );
4697
4708
 
4698
4709
  // src/primitives/Table.tsx
4699
- import { Fragment as Fragment11, jsx as jsx53, jsxs as jsxs37 } from "react/jsx-runtime";
4710
+ import { Fragment as Fragment12, jsx as jsx53, jsxs as jsxs37 } from "react/jsx-runtime";
4700
4711
  var alignClasses = {
4701
4712
  left: "polli:text-left",
4702
4713
  center: "polli:text-center",
@@ -4766,7 +4777,7 @@ var TableHeaderCell = ({
4766
4777
  children,
4767
4778
  ...rest
4768
4779
  }) => {
4769
- const content = /* @__PURE__ */ jsxs37(Fragment11, { children: [
4780
+ const content = /* @__PURE__ */ jsxs37(Fragment12, { children: [
4770
4781
  /* @__PURE__ */ jsx53("span", { children }),
4771
4782
  onSort && /* @__PURE__ */ jsx53(
4772
4783
  "span",