ixia-ui-react 1.0.1 → 1.1.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/index.d.mts +1 -1
- package/dist/index.mjs +7 -1
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
package/dist/index.mjs
CHANGED
|
@@ -2327,6 +2327,7 @@ const COPY_STATUS_ICON = {
|
|
|
2327
2327
|
};
|
|
2328
2328
|
function CodeBlockCopy({ className, children, ref, ...props }) {
|
|
2329
2329
|
const { currentValue } = useCodeBlock(), [copied, setCopied] = React.useState(false), handleClick = async () => {
|
|
2330
|
+
if (typeof currentValue.content !== "string") return;
|
|
2330
2331
|
try {
|
|
2331
2332
|
await navigator.clipboard.writeText(currentValue.content);
|
|
2332
2333
|
setCopied(true);
|
|
@@ -2362,6 +2363,7 @@ const DOWNLOAD_STATUS_ICON = {
|
|
|
2362
2363
|
};
|
|
2363
2364
|
function CodeBlockDownload({ className, children, ref, ...props }) {
|
|
2364
2365
|
const { currentValue } = useCodeBlock(), [downloaded, setDownloaded] = React.useState(false), handleClick = async () => {
|
|
2366
|
+
if (typeof currentValue.content !== "string") return;
|
|
2365
2367
|
try {
|
|
2366
2368
|
const blob = new Blob([currentValue.content]), url = URL.createObjectURL(blob), link = document.createElement("a");
|
|
2367
2369
|
link.href = url;
|
|
@@ -2707,7 +2709,11 @@ function CodeBlockWindow({ className, children, ref, ...props }) {
|
|
|
2707
2709
|
className: cn("relative overflow-auto rounded-lg px-md py-sm", className),
|
|
2708
2710
|
ref,
|
|
2709
2711
|
...props,
|
|
2710
|
-
children: [
|
|
2712
|
+
children: [
|
|
2713
|
+
children,
|
|
2714
|
+
typeof currentValue.content === "string" && /* @__PURE__ */ jsx("div", { dangerouslySetInnerHTML: { __html: currentValue.content } }),
|
|
2715
|
+
typeof currentValue.content !== "string" && currentValue.content
|
|
2716
|
+
]
|
|
2711
2717
|
});
|
|
2712
2718
|
}
|
|
2713
2719
|
//#endregion
|