@bizapps/design-system-testing 1.8.1 → 1.10.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/editor.js CHANGED
@@ -702,10 +702,11 @@ function Input({ className, type, ...props }) {
702
702
  type,
703
703
  "data-slot": "input",
704
704
  className: cn(
705
- "border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-sm shadow-xs transition-[color,box-shadow] outline-none",
706
- "placeholder:text-muted-foreground",
705
+ "border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[border-color,box-shadow] outline-hidden md:text-sm",
706
+ "placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground",
707
+ "file:text-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium",
707
708
  "focus-visible:border-ring focus-visible:ring-ring/30 focus-visible:ring-3",
708
- "disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50",
709
+ "disabled:cursor-not-allowed disabled:opacity-50",
709
710
  "aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-invalid:ring-3",
710
711
  "dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",
711
712
  className
@@ -976,9 +977,12 @@ function createResizableImage(options) {
976
977
  });
977
978
  }
978
979
  function LinkActions({ editor, labels, onEdit, onOpen }) {
979
- const href = useEditorState({
980
+ const { href, canOpen } = useEditorState({
980
981
  editor,
981
- selector: ({ editor: current }) => current.getAttributes("link").href ?? ""
982
+ selector: ({ editor: current }) => {
983
+ const value = current.getAttributes("link").href ?? "";
984
+ return { href: value, canOpen: !!value && current.can().setLink({ href: value }) };
985
+ }
982
986
  });
983
987
  return /* @__PURE__ */ jsxs(
984
988
  "div",
@@ -995,9 +999,9 @@ function LinkActions({ editor, labels, onEdit, onOpen }) {
995
999
  variant: "ghost",
996
1000
  title: labels.open,
997
1001
  "aria-label": labels.open,
998
- disabled: !href,
1002
+ disabled: !canOpen,
999
1003
  onClick: () => {
1000
- if (!href) return;
1004
+ if (!canOpen) return;
1001
1005
  if (onOpen) {
1002
1006
  onOpen(href);
1003
1007
  return;
@@ -1164,6 +1168,7 @@ function useRichTextEditor({
1164
1168
  (href, text) => {
1165
1169
  if (!editor) return;
1166
1170
  const url = href.trim();
1171
+ if (url && !editor.can().setLink({ href: url })) return;
1167
1172
  if (linkNeedsText) {
1168
1173
  if (url && text?.trim()) {
1169
1174
  editor.chain().focus().insertContent({