@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/README.md +6 -3
- package/dist/editor.cjs +12 -7
- package/dist/editor.cjs.map +1 -1
- package/dist/editor.js +12 -7
- package/dist/editor.js.map +1 -1
- package/dist/main.cjs +244 -6
- package/dist/main.cjs.map +1 -1
- package/dist/main.css +1 -1
- package/dist/main.d.cts +132 -2
- package/dist/main.d.ts +132 -2
- package/dist/main.js +241 -9
- package/dist/main.js.map +1 -1
- package/package.json +4 -1
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
|
|
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:
|
|
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 }) =>
|
|
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: !
|
|
1002
|
+
disabled: !canOpen,
|
|
999
1003
|
onClick: () => {
|
|
1000
|
-
if (!
|
|
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({
|