@bettercms-ai/ui 0.15.0 → 0.15.1

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/renderer.js CHANGED
@@ -580,7 +580,7 @@ function Image({
580
580
  }
581
581
 
582
582
  // src/blocks/Button.tsx
583
- import { buttonIconOf, buttonIconSvg, buttonVariantOf } from "@bettercms-ai/types";
583
+ import { LINK_RELS, buttonIconOf, buttonIconSvg, buttonVariantOf, isScriptHref } from "@bettercms-ai/types";
584
584
  import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
585
585
  function Button({
586
586
  text,
@@ -591,6 +591,7 @@ function Button({
591
591
  arrow = false,
592
592
  icon: iconProp,
593
593
  newTab = false,
594
+ rel,
594
595
  align = "left",
595
596
  className = "",
596
597
  style,
@@ -621,11 +622,13 @@ function Button({
621
622
  };
622
623
  const sizeClass = size === "sm" || size === "lg" ? sizeStyles[size] : sizeStyles.md;
623
624
  const fullClass = fullWidth === true ? "flex w-full justify-center" : "";
625
+ const relTokens = [...newTab === true ? ["noopener", "noreferrer"] : [], ...LINK_RELS.includes(rel) ? [rel] : []];
624
626
  return /* @__PURE__ */ jsxs3(
625
627
  "a",
626
628
  {
627
- href,
628
- ...newTab === true ? { target: "_blank", rel: "noopener noreferrer" } : {},
629
+ href: typeof href === "string" && isScriptHref(href) ? "#" : href,
630
+ ...newTab === true ? { target: "_blank" } : {},
631
+ ...relTokens.length ? { rel: relTokens.join(" ") } : {},
629
632
  "data-bcms-field": field,
630
633
  "data-bcms-kind": kind,
631
634
  style,