cmx-sdk 0.2.20 → 0.2.21
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.ts +18 -0
- package/dist/index.js +117 -68
- package/dist/index.js.map +1 -1
- package/dist/styles/cmx-mdx.css +17 -15
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -3439,11 +3439,29 @@ interface YouTubeProps {
|
|
|
3439
3439
|
}
|
|
3440
3440
|
declare function YouTube({ url, start }: YouTubeProps): react_jsx_runtime.JSX.Element;
|
|
3441
3441
|
|
|
3442
|
+
declare global {
|
|
3443
|
+
interface Window {
|
|
3444
|
+
twttr?: {
|
|
3445
|
+
widgets: {
|
|
3446
|
+
load: (el?: HTMLElement) => void;
|
|
3447
|
+
};
|
|
3448
|
+
};
|
|
3449
|
+
}
|
|
3450
|
+
}
|
|
3442
3451
|
interface TwitterProps {
|
|
3443
3452
|
url: string;
|
|
3444
3453
|
}
|
|
3445
3454
|
declare function Twitter({ url }: TwitterProps): react_jsx_runtime.JSX.Element;
|
|
3446
3455
|
|
|
3456
|
+
declare global {
|
|
3457
|
+
interface Window {
|
|
3458
|
+
instgrm?: {
|
|
3459
|
+
Embeds: {
|
|
3460
|
+
process: () => void;
|
|
3461
|
+
};
|
|
3462
|
+
};
|
|
3463
|
+
}
|
|
3464
|
+
}
|
|
3447
3465
|
interface InstagramProps {
|
|
3448
3466
|
url: string;
|
|
3449
3467
|
}
|
package/dist/index.js
CHANGED
|
@@ -505,43 +505,92 @@ function YouTube({ url, start }) {
|
|
|
505
505
|
}
|
|
506
506
|
|
|
507
507
|
// src/mdx/components/basic/Twitter.tsx
|
|
508
|
-
import {
|
|
508
|
+
import { useEffect, useRef } from "react";
|
|
509
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
509
510
|
function Twitter({ url }) {
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
)
|
|
522
|
-
|
|
511
|
+
const containerRef = useRef(null);
|
|
512
|
+
useEffect(() => {
|
|
513
|
+
const run = () => {
|
|
514
|
+
window.twttr?.widgets.load(containerRef.current ?? void 0);
|
|
515
|
+
};
|
|
516
|
+
if (window.twttr) {
|
|
517
|
+
run();
|
|
518
|
+
return;
|
|
519
|
+
}
|
|
520
|
+
const selector = 'script[src="https://platform.twitter.com/widgets.js"]';
|
|
521
|
+
const existing = document.querySelector(selector);
|
|
522
|
+
if (existing) {
|
|
523
|
+
existing.addEventListener("load", run, { once: true });
|
|
524
|
+
return () => existing.removeEventListener("load", run);
|
|
525
|
+
}
|
|
526
|
+
const script = document.createElement("script");
|
|
527
|
+
script.src = "https://platform.twitter.com/widgets.js";
|
|
528
|
+
script.async = true;
|
|
529
|
+
script.onload = run;
|
|
530
|
+
document.body.appendChild(script);
|
|
531
|
+
return () => {
|
|
532
|
+
script.onload = null;
|
|
533
|
+
};
|
|
534
|
+
}, [url]);
|
|
535
|
+
return /* @__PURE__ */ jsx5("div", { ref: containerRef, className: "cmx-mdx__twitter", children: /* @__PURE__ */ jsx5("blockquote", { className: "twitter-tweet", children: /* @__PURE__ */ jsx5(
|
|
536
|
+
"a",
|
|
537
|
+
{
|
|
538
|
+
href: url,
|
|
539
|
+
target: "_blank",
|
|
540
|
+
rel: "noopener noreferrer",
|
|
541
|
+
className: "cmx-mdx__twitter-fallback-link break-all",
|
|
542
|
+
children: url
|
|
543
|
+
}
|
|
544
|
+
) }) }, url);
|
|
523
545
|
}
|
|
524
546
|
|
|
525
547
|
// src/mdx/components/basic/Instagram.tsx
|
|
526
|
-
import {
|
|
548
|
+
import { useEffect as useEffect2 } from "react";
|
|
549
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
527
550
|
function Instagram({ url }) {
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
551
|
+
useEffect2(() => {
|
|
552
|
+
const run = () => window.instgrm?.Embeds.process();
|
|
553
|
+
if (window.instgrm) {
|
|
554
|
+
run();
|
|
555
|
+
return;
|
|
556
|
+
}
|
|
557
|
+
const selector = 'script[src="https://www.instagram.com/embed.js"]';
|
|
558
|
+
const existing = document.querySelector(selector);
|
|
559
|
+
if (existing) {
|
|
560
|
+
existing.addEventListener("load", run, { once: true });
|
|
561
|
+
return () => existing.removeEventListener("load", run);
|
|
562
|
+
}
|
|
563
|
+
const script = document.createElement("script");
|
|
564
|
+
script.src = "https://www.instagram.com/embed.js";
|
|
565
|
+
script.async = true;
|
|
566
|
+
script.onload = run;
|
|
567
|
+
document.body.appendChild(script);
|
|
568
|
+
return () => {
|
|
569
|
+
script.onload = null;
|
|
570
|
+
};
|
|
571
|
+
}, [url]);
|
|
572
|
+
return /* @__PURE__ */ jsx6("div", { className: "cmx-mdx__instagram", children: /* @__PURE__ */ jsx6(
|
|
573
|
+
"blockquote",
|
|
574
|
+
{
|
|
575
|
+
className: "instagram-media cmx-mdx__instagram-embed",
|
|
576
|
+
"data-instgrm-permalink": url,
|
|
577
|
+
"data-instgrm-version": "14",
|
|
578
|
+
children: /* @__PURE__ */ jsx6(
|
|
579
|
+
"a",
|
|
580
|
+
{
|
|
581
|
+
href: url,
|
|
582
|
+
target: "_blank",
|
|
583
|
+
rel: "noopener noreferrer",
|
|
584
|
+
className: "cmx-mdx__instagram-link break-all",
|
|
585
|
+
children: url
|
|
586
|
+
}
|
|
587
|
+
)
|
|
588
|
+
}
|
|
589
|
+
) }, url);
|
|
541
590
|
}
|
|
542
591
|
|
|
543
592
|
// src/mdx/components/basic/TikTok.tsx
|
|
544
|
-
import { jsx as jsx7, jsxs as
|
|
593
|
+
import { jsx as jsx7, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
545
594
|
function extractTikTokVideoId(url) {
|
|
546
595
|
const match = url.match(/\/video\/(\d+)/);
|
|
547
596
|
return match ? match[1] : null;
|
|
@@ -549,7 +598,7 @@ function extractTikTokVideoId(url) {
|
|
|
549
598
|
function TikTok({ url }) {
|
|
550
599
|
const videoId = extractTikTokVideoId(url);
|
|
551
600
|
if (!videoId) {
|
|
552
|
-
return /* @__PURE__ */
|
|
601
|
+
return /* @__PURE__ */ jsxs3("div", { className: "cmx-mdx__tiktok cmx-mdx__tiktok--error", children: [
|
|
553
602
|
/* @__PURE__ */ jsx7("p", { className: "cmx-mdx__tiktok-label", children: "TikTok" }),
|
|
554
603
|
/* @__PURE__ */ jsx7(
|
|
555
604
|
"a",
|
|
@@ -576,9 +625,9 @@ function TikTok({ url }) {
|
|
|
576
625
|
}
|
|
577
626
|
|
|
578
627
|
// src/mdx/components/basic/Bluesky.tsx
|
|
579
|
-
import { jsx as jsx8, jsxs as
|
|
628
|
+
import { jsx as jsx8, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
580
629
|
function Bluesky({ url }) {
|
|
581
|
-
return /* @__PURE__ */
|
|
630
|
+
return /* @__PURE__ */ jsxs4("div", { className: "cmx-mdx__bluesky", children: [
|
|
582
631
|
/* @__PURE__ */ jsx8("p", { className: "cmx-mdx__bluesky-label", children: "Bluesky" }),
|
|
583
632
|
/* @__PURE__ */ jsx8(
|
|
584
633
|
"a",
|
|
@@ -594,7 +643,7 @@ function Bluesky({ url }) {
|
|
|
594
643
|
}
|
|
595
644
|
|
|
596
645
|
// src/mdx/components/basic/Vimeo.tsx
|
|
597
|
-
import { jsx as jsx9, jsxs as
|
|
646
|
+
import { jsx as jsx9, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
598
647
|
function extractVimeoId(url) {
|
|
599
648
|
const match = url.match(/vimeo\.com\/(\d+)/);
|
|
600
649
|
return match ? match[1] : null;
|
|
@@ -602,7 +651,7 @@ function extractVimeoId(url) {
|
|
|
602
651
|
function Vimeo({ url }) {
|
|
603
652
|
const videoId = extractVimeoId(url);
|
|
604
653
|
if (!videoId) {
|
|
605
|
-
return /* @__PURE__ */ jsx9("div", { className: "cmx-mdx__vimeo cmx-mdx__vimeo--error", children: /* @__PURE__ */
|
|
654
|
+
return /* @__PURE__ */ jsx9("div", { className: "cmx-mdx__vimeo cmx-mdx__vimeo--error", children: /* @__PURE__ */ jsxs5("p", { className: "cmx-mdx__error-text", children: [
|
|
606
655
|
"\u7121\u52B9\u306AVimeo URL: ",
|
|
607
656
|
url
|
|
608
657
|
] }) });
|
|
@@ -619,7 +668,7 @@ function Vimeo({ url }) {
|
|
|
619
668
|
}
|
|
620
669
|
|
|
621
670
|
// src/mdx/components/basic/Spotify.tsx
|
|
622
|
-
import { jsx as jsx10, jsxs as
|
|
671
|
+
import { jsx as jsx10, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
623
672
|
function toSpotifyEmbedUrl(url) {
|
|
624
673
|
const match = url.match(/open\.spotify\.com\/(track|album|playlist|episode|show)\/([^?#]+)/);
|
|
625
674
|
if (!match) return null;
|
|
@@ -628,7 +677,7 @@ function toSpotifyEmbedUrl(url) {
|
|
|
628
677
|
function Spotify({ url, theme = "light" }) {
|
|
629
678
|
const embedUrl = toSpotifyEmbedUrl(url);
|
|
630
679
|
if (!embedUrl) {
|
|
631
|
-
return /* @__PURE__ */ jsx10("div", { className: "cmx-mdx__spotify cmx-mdx__spotify--error", children: /* @__PURE__ */
|
|
680
|
+
return /* @__PURE__ */ jsx10("div", { className: "cmx-mdx__spotify cmx-mdx__spotify--error", children: /* @__PURE__ */ jsxs6("p", { className: "cmx-mdx__error-text", children: [
|
|
632
681
|
"\u7121\u52B9\u306ASpotify URL: ",
|
|
633
682
|
url
|
|
634
683
|
] }) });
|
|
@@ -647,7 +696,7 @@ function Spotify({ url, theme = "light" }) {
|
|
|
647
696
|
}
|
|
648
697
|
|
|
649
698
|
// src/mdx/components/basic/Gist.tsx
|
|
650
|
-
import { jsx as jsx11, jsxs as
|
|
699
|
+
import { jsx as jsx11, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
651
700
|
function extractGistId(url) {
|
|
652
701
|
const match = url.match(/gist\.github\.com\/([^/]+)\/([a-f0-9]+)/);
|
|
653
702
|
if (!match) return null;
|
|
@@ -656,7 +705,7 @@ function extractGistId(url) {
|
|
|
656
705
|
function Gist({ url }) {
|
|
657
706
|
const gist = extractGistId(url);
|
|
658
707
|
if (!gist) {
|
|
659
|
-
return /* @__PURE__ */ jsx11("div", { className: "cmx-mdx__gist cmx-mdx__gist--error", children: /* @__PURE__ */
|
|
708
|
+
return /* @__PURE__ */ jsx11("div", { className: "cmx-mdx__gist cmx-mdx__gist--error", children: /* @__PURE__ */ jsxs7("p", { className: "cmx-mdx__error-text", children: [
|
|
660
709
|
"\u7121\u52B9\u306AGist URL: ",
|
|
661
710
|
url
|
|
662
711
|
] }) });
|
|
@@ -672,7 +721,7 @@ function Gist({ url }) {
|
|
|
672
721
|
}
|
|
673
722
|
|
|
674
723
|
// src/mdx/components/basic/CodePen.tsx
|
|
675
|
-
import { jsx as jsx12, jsxs as
|
|
724
|
+
import { jsx as jsx12, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
676
725
|
function toCodePenEmbedUrl(url) {
|
|
677
726
|
const match = url.match(/codepen\.io\/([^/]+)\/(?:pen|full|details)\/([^?#]+)/);
|
|
678
727
|
if (!match) return null;
|
|
@@ -681,7 +730,7 @@ function toCodePenEmbedUrl(url) {
|
|
|
681
730
|
function CodePen({ url, height = 400, defaultTab = "result" }) {
|
|
682
731
|
const embedUrl = toCodePenEmbedUrl(url);
|
|
683
732
|
if (!embedUrl) {
|
|
684
|
-
return /* @__PURE__ */ jsx12("div", { className: "cmx-mdx__codepen cmx-mdx__codepen--error", children: /* @__PURE__ */
|
|
733
|
+
return /* @__PURE__ */ jsx12("div", { className: "cmx-mdx__codepen cmx-mdx__codepen--error", children: /* @__PURE__ */ jsxs8("p", { className: "cmx-mdx__error-text", children: [
|
|
685
734
|
"\u7121\u52B9\u306ACodePen URL: ",
|
|
686
735
|
url
|
|
687
736
|
] }) });
|
|
@@ -700,7 +749,7 @@ function CodePen({ url, height = 400, defaultTab = "result" }) {
|
|
|
700
749
|
}
|
|
701
750
|
|
|
702
751
|
// src/mdx/components/basic/CodeSandbox.tsx
|
|
703
|
-
import { jsx as jsx13, jsxs as
|
|
752
|
+
import { jsx as jsx13, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
704
753
|
function toCodeSandboxEmbedUrl(url) {
|
|
705
754
|
const match = url.match(/codesandbox\.io\/(?:s|p)\/([^?#]+)/);
|
|
706
755
|
if (!match) return null;
|
|
@@ -709,7 +758,7 @@ function toCodeSandboxEmbedUrl(url) {
|
|
|
709
758
|
function CodeSandbox({ url, height = 500 }) {
|
|
710
759
|
const embedUrl = toCodeSandboxEmbedUrl(url);
|
|
711
760
|
if (!embedUrl) {
|
|
712
|
-
return /* @__PURE__ */ jsx13("div", { className: "cmx-mdx__codesandbox cmx-mdx__codesandbox--error", children: /* @__PURE__ */
|
|
761
|
+
return /* @__PURE__ */ jsx13("div", { className: "cmx-mdx__codesandbox cmx-mdx__codesandbox--error", children: /* @__PURE__ */ jsxs9("p", { className: "cmx-mdx__error-text", children: [
|
|
713
762
|
"\u7121\u52B9\u306ACodeSandbox URL: ",
|
|
714
763
|
url
|
|
715
764
|
] }) });
|
|
@@ -747,9 +796,9 @@ function GoogleMap({ url, height = 450 }) {
|
|
|
747
796
|
}
|
|
748
797
|
|
|
749
798
|
// src/mdx/components/basic/Details.tsx
|
|
750
|
-
import { jsx as jsx15, jsxs as
|
|
799
|
+
import { jsx as jsx15, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
751
800
|
function Details({ summary, children }) {
|
|
752
|
-
return /* @__PURE__ */
|
|
801
|
+
return /* @__PURE__ */ jsxs10("details", { className: "cmx-mdx__details", children: [
|
|
753
802
|
/* @__PURE__ */ jsx15("summary", { className: "cmx-mdx__details-summary cursor-pointer select-none", children: summary }),
|
|
754
803
|
/* @__PURE__ */ jsx15("div", { className: "cmx-mdx__details-content", children })
|
|
755
804
|
] });
|
|
@@ -757,7 +806,7 @@ function Details({ summary, children }) {
|
|
|
757
806
|
|
|
758
807
|
// src/mdx/components/basic/Tabs.tsx
|
|
759
808
|
import { useState, Children, isValidElement } from "react";
|
|
760
|
-
import { jsx as jsx16, jsxs as
|
|
809
|
+
import { jsx as jsx16, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
761
810
|
function Tabs({ children }) {
|
|
762
811
|
const [activeIndex, setActiveIndex] = useState(0);
|
|
763
812
|
const tabs = [];
|
|
@@ -771,7 +820,7 @@ function Tabs({ children }) {
|
|
|
771
820
|
}
|
|
772
821
|
});
|
|
773
822
|
if (tabs.length === 0) return null;
|
|
774
|
-
return /* @__PURE__ */
|
|
823
|
+
return /* @__PURE__ */ jsxs11("div", { className: "cmx-mdx__tabs overflow-hidden", children: [
|
|
775
824
|
/* @__PURE__ */ jsx16("div", { className: "cmx-mdx__tabs-header flex", role: "tablist", children: tabs.map((tab, i) => /* @__PURE__ */ jsx16(
|
|
776
825
|
"button",
|
|
777
826
|
{
|
|
@@ -806,9 +855,9 @@ function Column({ children }) {
|
|
|
806
855
|
}
|
|
807
856
|
|
|
808
857
|
// src/mdx/components/basic/Audio.tsx
|
|
809
|
-
import { jsx as jsx18, jsxs as
|
|
858
|
+
import { jsx as jsx18, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
810
859
|
function Audio({ src, title }) {
|
|
811
|
-
return /* @__PURE__ */
|
|
860
|
+
return /* @__PURE__ */ jsxs12("div", { className: "cmx-mdx__audio", children: [
|
|
812
861
|
title && /* @__PURE__ */ jsx18("p", { className: "cmx-mdx__audio-title", children: title }),
|
|
813
862
|
/* @__PURE__ */ jsx18(
|
|
814
863
|
"audio",
|
|
@@ -823,9 +872,9 @@ function Audio({ src, title }) {
|
|
|
823
872
|
}
|
|
824
873
|
|
|
825
874
|
// src/mdx/components/basic/Video.tsx
|
|
826
|
-
import { jsx as jsx19, jsxs as
|
|
875
|
+
import { jsx as jsx19, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
827
876
|
function Video({ src, title, poster }) {
|
|
828
|
-
return /* @__PURE__ */
|
|
877
|
+
return /* @__PURE__ */ jsxs13("div", { className: "cmx-mdx__video", children: [
|
|
829
878
|
title && /* @__PURE__ */ jsx19("p", { className: "cmx-mdx__video-title", children: title }),
|
|
830
879
|
/* @__PURE__ */ jsx19(
|
|
831
880
|
"video",
|
|
@@ -842,12 +891,12 @@ function Video({ src, title, poster }) {
|
|
|
842
891
|
|
|
843
892
|
// src/mdx/components/basic/FileDownload.tsx
|
|
844
893
|
import { Download } from "lucide-react";
|
|
845
|
-
import { jsx as jsx20, jsxs as
|
|
894
|
+
import { jsx as jsx20, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
846
895
|
function FileDownload({ url, filename, size }) {
|
|
847
896
|
const displayName = filename || url.split("/").pop() || "\u30D5\u30A1\u30A4\u30EB";
|
|
848
|
-
return /* @__PURE__ */
|
|
897
|
+
return /* @__PURE__ */ jsxs14("div", { className: "cmx-mdx__filedownload flex items-center gap-3", children: [
|
|
849
898
|
/* @__PURE__ */ jsx20(Download, { className: "cmx-mdx__filedownload-icon flex-shrink-0" }),
|
|
850
|
-
/* @__PURE__ */
|
|
899
|
+
/* @__PURE__ */ jsxs14("div", { className: "cmx-mdx__filedownload-info flex-1 min-w-0", children: [
|
|
851
900
|
/* @__PURE__ */ jsx20(
|
|
852
901
|
"a",
|
|
853
902
|
{
|
|
@@ -863,9 +912,9 @@ function FileDownload({ url, filename, size }) {
|
|
|
863
912
|
}
|
|
864
913
|
|
|
865
914
|
// src/mdx/components/basic/TableOfContents.tsx
|
|
866
|
-
import { jsx as jsx21, jsxs as
|
|
915
|
+
import { jsx as jsx21, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
867
916
|
function TableOfContents({ maxDepth = 3 }) {
|
|
868
|
-
return /* @__PURE__ */
|
|
917
|
+
return /* @__PURE__ */ jsxs15(
|
|
869
918
|
"nav",
|
|
870
919
|
{
|
|
871
920
|
className: "cmx-mdx__toc",
|
|
@@ -908,15 +957,15 @@ var basicComponents = {
|
|
|
908
957
|
|
|
909
958
|
// src/mdx/components/custom/BlogCard.tsx
|
|
910
959
|
import Link2 from "next/link";
|
|
911
|
-
import { jsx as jsx22, jsxs as
|
|
960
|
+
import { jsx as jsx22, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
912
961
|
function BlogCard({ contentId, title, slug, excerpt }) {
|
|
913
962
|
if (!title || !slug) {
|
|
914
|
-
return /* @__PURE__ */ jsx22("div", { className: "cmx-mdx__blogcard cmx-mdx__blogcard--unresolved", children: /* @__PURE__ */
|
|
963
|
+
return /* @__PURE__ */ jsx22("div", { className: "cmx-mdx__blogcard cmx-mdx__blogcard--unresolved", children: /* @__PURE__ */ jsxs16("p", { className: "cmx-mdx__blogcard-text", children: [
|
|
915
964
|
"\u8A18\u4E8B\u30AB\u30FC\u30C9: ",
|
|
916
965
|
contentId
|
|
917
966
|
] }) });
|
|
918
967
|
}
|
|
919
|
-
return /* @__PURE__ */
|
|
968
|
+
return /* @__PURE__ */ jsxs16(
|
|
920
969
|
Link2,
|
|
921
970
|
{
|
|
922
971
|
href: `/${slug}`,
|
|
@@ -931,7 +980,7 @@ function BlogCard({ contentId, title, slug, excerpt }) {
|
|
|
931
980
|
|
|
932
981
|
// src/mdx/components/custom/Image.tsx
|
|
933
982
|
import NextImage from "next/image";
|
|
934
|
-
import { jsx as jsx23, jsxs as
|
|
983
|
+
import { jsx as jsx23, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
935
984
|
function Image({
|
|
936
985
|
assetId,
|
|
937
986
|
alt = "",
|
|
@@ -942,13 +991,13 @@ function Image({
|
|
|
942
991
|
height
|
|
943
992
|
}) {
|
|
944
993
|
if (!url) {
|
|
945
|
-
return /* @__PURE__ */
|
|
946
|
-
/* @__PURE__ */
|
|
947
|
-
/* @__PURE__ */
|
|
994
|
+
return /* @__PURE__ */ jsxs17("figure", { className: "cmx-mdx__image", children: [
|
|
995
|
+
/* @__PURE__ */ jsxs17("div", { className: "cmx-mdx__image--unresolved", children: [
|
|
996
|
+
/* @__PURE__ */ jsxs17("p", { className: "cmx-mdx__image-id", children: [
|
|
948
997
|
"\u753B\u50CF: ",
|
|
949
998
|
assetId
|
|
950
999
|
] }),
|
|
951
|
-
/* @__PURE__ */
|
|
1000
|
+
/* @__PURE__ */ jsxs17("p", { className: "cmx-mdx__image-size", children: [
|
|
952
1001
|
"\u30B5\u30A4\u30BA: ",
|
|
953
1002
|
size
|
|
954
1003
|
] })
|
|
@@ -956,7 +1005,7 @@ function Image({
|
|
|
956
1005
|
caption && /* @__PURE__ */ jsx23("figcaption", { className: "cmx-mdx__image-caption", children: caption })
|
|
957
1006
|
] });
|
|
958
1007
|
}
|
|
959
|
-
return /* @__PURE__ */
|
|
1008
|
+
return /* @__PURE__ */ jsxs17("figure", { className: "cmx-mdx__image", children: [
|
|
960
1009
|
/* @__PURE__ */ jsx23(
|
|
961
1010
|
NextImage,
|
|
962
1011
|
{
|
|
@@ -972,7 +1021,7 @@ function Image({
|
|
|
972
1021
|
}
|
|
973
1022
|
|
|
974
1023
|
// src/mdx/components/custom/Gallery.tsx
|
|
975
|
-
import { jsx as jsx24, jsxs as
|
|
1024
|
+
import { jsx as jsx24, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
976
1025
|
var gridClasses2 = {
|
|
977
1026
|
1: "grid-cols-1",
|
|
978
1027
|
2: "grid-cols-1 sm:grid-cols-2",
|
|
@@ -984,7 +1033,7 @@ var gridClasses2 = {
|
|
|
984
1033
|
function Gallery({ assetIds, columns = 3, caption, images }) {
|
|
985
1034
|
const gridClass = gridClasses2[columns] || gridClasses2[3];
|
|
986
1035
|
const items = images || assetIds.map((id) => ({ assetId: id }));
|
|
987
|
-
return /* @__PURE__ */
|
|
1036
|
+
return /* @__PURE__ */ jsxs18("figure", { className: "cmx-mdx__gallery", children: [
|
|
988
1037
|
/* @__PURE__ */ jsx24("div", { className: `cmx-mdx__gallery-grid grid gap-2 ${gridClass}`, children: items.map((item, i) => /* @__PURE__ */ jsx24(
|
|
989
1038
|
"div",
|
|
990
1039
|
{
|
|
@@ -1964,7 +2013,7 @@ function quickValidateMdx(mdx) {
|
|
|
1964
2013
|
// src/render.tsx
|
|
1965
2014
|
import { MdastToJsx } from "safe-mdx";
|
|
1966
2015
|
import { mdxParse } from "safe-mdx/parse";
|
|
1967
|
-
import { Fragment, jsx as jsx26, jsxs as
|
|
2016
|
+
import { Fragment, jsx as jsx26, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
1968
2017
|
function convertReferencesToMaps(refs) {
|
|
1969
2018
|
const contentsMap = /* @__PURE__ */ new Map();
|
|
1970
2019
|
const assetsMap = /* @__PURE__ */ new Map();
|
|
@@ -2141,7 +2190,7 @@ async function renderMdxPreview(mdx, additionalComponents) {
|
|
|
2141
2190
|
return renderSafeMdx(mdx, components);
|
|
2142
2191
|
} catch (error) {
|
|
2143
2192
|
console.error("MDX render error:", error);
|
|
2144
|
-
return /* @__PURE__ */
|
|
2193
|
+
return /* @__PURE__ */ jsxs19("div", { className: "p-4 bg-red-50 border border-red-200 rounded-lg", children: [
|
|
2145
2194
|
/* @__PURE__ */ jsx26("p", { className: "text-red-600 font-medium", children: "MDX Render Error" }),
|
|
2146
2195
|
/* @__PURE__ */ jsx26("pre", { className: "mt-2 text-sm text-red-500 whitespace-pre-wrap", children: error instanceof Error ? error.message : "Unknown error" })
|
|
2147
2196
|
] });
|