@noirmd/previewer 1.0.0 → 1.0.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/index.js CHANGED
@@ -1,4 +1,3 @@
1
- "use strict";
2
1
  var __create = Object.create;
3
2
  var __defProp = Object.defineProperty;
4
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -8,10 +7,6 @@ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
7
  var __commonJS = (cb, mod) => function __require() {
9
8
  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
10
9
  };
11
- var __export = (target, all) => {
12
- for (var name in all)
13
- __defProp(target, name, { get: all[name], enumerable: true });
14
- };
15
10
  var __copyProps = (to, from, except, desc) => {
16
11
  if (from && typeof from === "object" || typeof from === "function") {
17
12
  for (let key of __getOwnPropNames(from))
@@ -28,11 +23,10 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
28
23
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
29
24
  mod
30
25
  ));
31
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
32
26
 
33
27
  // node_modules/highlight.js/lib/core.js
34
28
  var require_core = __commonJS({
35
- "node_modules/highlight.js/lib/core.js"(exports2, module2) {
29
+ "node_modules/highlight.js/lib/core.js"(exports, module) {
36
30
  "use strict";
37
31
  function deepFreeze(obj) {
38
32
  if (obj instanceof Map) {
@@ -1563,33 +1557,14 @@ var require_core = __commonJS({
1563
1557
  };
1564
1558
  var highlight = HLJS({});
1565
1559
  highlight.newInstance = () => HLJS({});
1566
- module2.exports = highlight;
1560
+ module.exports = highlight;
1567
1561
  highlight.HighlightJS = highlight;
1568
1562
  highlight.default = highlight;
1569
1563
  }
1570
1564
  });
1571
1565
 
1572
- // index.ts
1573
- var index_exports = {};
1574
- __export(index_exports, {
1575
- Admonition: () => Admonition,
1576
- CodeBlock: () => CodeBlock,
1577
- CustomMarkdownRenderer: () => CustomMarkdownRenderer_default,
1578
- Details: () => Details,
1579
- IconRenderer: () => IconRenderer,
1580
- Modal: () => Modal,
1581
- NRpreviewer: () => NRpreviewer_default,
1582
- extractHeaders: () => extractHeaders,
1583
- parseMarkdown: () => parseMarkdown,
1584
- preloadTailwindCDN: () => preloadTailwindCDN,
1585
- scanTailwindCDN: () => scanTailwindCDN,
1586
- useDebounce: () => useDebounce,
1587
- useLazyTailwindCDN: () => useLazyTailwindCDN
1588
- });
1589
- module.exports = __toCommonJS(index_exports);
1590
-
1591
1566
  // CustomMarkdownRenderer.tsx
1592
- var import_react9 = __toESM(require("react"));
1567
+ import React8, { useState as useState3, useEffect as useEffect4, useCallback as useCallback2, useMemo, useId as useId3, useRef as useRef5 } from "react";
1593
1568
 
1594
1569
  // utils.ts
1595
1570
  function parseCssString(cssText) {
@@ -2014,7 +1989,7 @@ function splitSlots(rawContent) {
2014
1989
  }
2015
1990
 
2016
1991
  // ui-components.tsx
2017
- var import_react = require("react");
1992
+ import { useState, useRef } from "react";
2018
1993
 
2019
1994
  // node_modules/highlight.js/es/core.js
2020
1995
  var import_core = __toESM(require_core(), 1);
@@ -10958,14 +10933,14 @@ core_default.registerLanguage("shell", shell);
10958
10933
  var highlightSetup_default = core_default;
10959
10934
 
10960
10935
  // ui-components.tsx
10961
- var import_dialog = require("@base-ui/react/dialog");
10962
- var import_jsx_runtime = require("react/jsx-runtime");
10936
+ import { Dialog } from "@base-ui/react/dialog";
10937
+ import { jsx, jsxs } from "react/jsx-runtime";
10963
10938
  var IconRenderer = ({ iconName, extraClasses = "" }) => {
10964
10939
  if (!iconName) return null;
10965
10940
  const baseClass = `material-symbols-rounded !text-[1em] leading-none align-top ${extraClasses}`;
10966
10941
  const isCodepoint = /^[eE][0-9a-fA-F]{3,4}$/.test(iconName);
10967
10942
  if (isCodepoint) {
10968
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
10943
+ return /* @__PURE__ */ jsx(
10969
10944
  "span",
10970
10945
  {
10971
10946
  className: baseClass,
@@ -10974,11 +10949,11 @@ var IconRenderer = ({ iconName, extraClasses = "" }) => {
10974
10949
  }
10975
10950
  );
10976
10951
  }
10977
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: baseClass, "aria-hidden": "true", children: iconName });
10952
+ return /* @__PURE__ */ jsx("span", { className: baseClass, "aria-hidden": "true", children: iconName });
10978
10953
  };
10979
10954
  var CodeBlock = ({ code, language, title }) => {
10980
- const [copied, setCopied] = (0, import_react.useState)(false);
10981
- const timerRef = (0, import_react.useRef)(null);
10955
+ const [copied, setCopied] = useState(false);
10956
+ const timerRef = useRef(null);
10982
10957
  const lang = language?.split(/[\s{]/)[0]?.trim() || "";
10983
10958
  let html;
10984
10959
  try {
@@ -10996,13 +10971,13 @@ var CodeBlock = ({ code, language, title }) => {
10996
10971
  if (timerRef.current) clearTimeout(timerRef.current);
10997
10972
  timerRef.current = setTimeout(() => setCopied(false), 1800);
10998
10973
  };
10999
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "not-prose my-4 rounded-2xl border border-border overflow-hidden bg-background-secondary-solid/5", children: [
11000
- title && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center gap-2 px-4 py-2 border-b border-border bg-background-secondary-solid/10 text-xs sm:text-sm font-mono text-text-secondary", children: [
11001
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "material-symbols-rounded text-base", children: "description" }),
10974
+ return /* @__PURE__ */ jsxs("div", { className: "not-prose my-4 rounded-2xl border border-border overflow-hidden bg-background-secondary-solid/5", children: [
10975
+ title && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 px-4 py-2 border-b border-border bg-background-secondary-solid/10 text-xs sm:text-sm font-mono text-text-secondary", children: [
10976
+ /* @__PURE__ */ jsx("span", { className: "material-symbols-rounded text-base", children: "description" }),
11002
10977
  title
11003
10978
  ] }),
11004
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "overflow-auto [&_pre]:m-0 [&_pre]:p-4 [&_pre]:text-xs sm:[&_pre]:text-sm", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("pre", { className: "m-0", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("code", { className: `language-${lang || "plaintext"}`, dangerouslySetInnerHTML: { __html: html } }) }) }),
11005
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { className: "absolute top-2 right-2 p-1.5 rounded-lg bg-background-secondary-solid/20 hover:bg-background-secondary-solid/40 transition-colors cursor-pointer border-none text-text-secondary hover:text-text-primary", onClick: handleCopy, title: "Copy code", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "material-symbols-rounded", style: { fontSize: "1rem" }, children: copied ? "check" : "content_copy" }) })
10979
+ /* @__PURE__ */ jsx("div", { className: "overflow-auto [&_pre]:m-0 [&_pre]:p-4 [&_pre]:text-xs sm:[&_pre]:text-sm", children: /* @__PURE__ */ jsx("pre", { className: "m-0", children: /* @__PURE__ */ jsx("code", { className: `language-${lang || "plaintext"}`, dangerouslySetInnerHTML: { __html: html } }) }) }),
10980
+ /* @__PURE__ */ jsx("button", { className: "absolute top-2 right-2 p-1.5 rounded-lg bg-background-secondary-solid/20 hover:bg-background-secondary-solid/40 transition-colors cursor-pointer border-none text-text-secondary hover:text-text-primary", onClick: handleCopy, title: "Copy code", children: /* @__PURE__ */ jsx("span", { className: "material-symbols-rounded", style: { fontSize: "1rem" }, children: copied ? "check" : "content_copy" }) })
11006
10981
  ] });
11007
10982
  };
11008
10983
  var defaultIcons = {
@@ -11021,17 +10996,17 @@ var typeClasses = {
11021
10996
  };
11022
10997
  var Admonition = ({ type, title, icon, className = "", style, children }) => {
11023
10998
  const iconToRender = icon || defaultIcons[type] || "info";
11024
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
10999
+ return /* @__PURE__ */ jsxs(
11025
11000
  "div",
11026
11001
  {
11027
11002
  className: `not-prose rounded-2xl mb-6 border shadow-xs p-4 ${typeClasses[type] || typeClasses.note} ${className}`,
11028
11003
  style,
11029
11004
  children: [
11030
- title && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("h5", { className: "font-bold text-base mb-2 m-0 flex items-center gap-2", children: [
11031
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(IconRenderer, { iconName: iconToRender, extraClasses: "shrink-0" }),
11032
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: title })
11005
+ title && /* @__PURE__ */ jsxs("h5", { className: "font-bold text-base mb-2 m-0 flex items-center gap-2", children: [
11006
+ /* @__PURE__ */ jsx(IconRenderer, { iconName: iconToRender, extraClasses: "shrink-0" }),
11007
+ /* @__PURE__ */ jsx("span", { children: title })
11033
11008
  ] }),
11034
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "text-sm leading-relaxed opacity-90", children })
11009
+ /* @__PURE__ */ jsx("div", { className: "text-sm leading-relaxed opacity-90", children })
11035
11010
  ]
11036
11011
  }
11037
11012
  );
@@ -11044,16 +11019,16 @@ var Details = ({
11044
11019
  style,
11045
11020
  children
11046
11021
  }) => {
11047
- const [isOpen, setIsOpen] = (0, import_react.useState)(defaultOpen);
11022
+ const [isOpen, setIsOpen] = useState(defaultOpen);
11048
11023
  const iconToRender = icon || "play_arrow";
11049
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
11024
+ return /* @__PURE__ */ jsxs(
11050
11025
  "details",
11051
11026
  {
11052
11027
  className: `not-prose rounded-2xl border border-border mb-4 bg-background-primary/5 ${className}`,
11053
11028
  open: isOpen,
11054
11029
  style,
11055
11030
  children: [
11056
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
11031
+ /* @__PURE__ */ jsxs(
11057
11032
  "summary",
11058
11033
  {
11059
11034
  className: "cursor-pointer p-4 font-bold flex items-center gap-2 list-none [&::-webkit-details-marker]:hidden hover:text-accent-primary transition-colors",
@@ -11062,45 +11037,45 @@ var Details = ({
11062
11037
  setIsOpen((prev) => !prev);
11063
11038
  },
11064
11039
  children: [
11065
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
11040
+ /* @__PURE__ */ jsx(
11066
11041
  IconRenderer,
11067
11042
  {
11068
11043
  iconName: iconToRender,
11069
11044
  extraClasses: `transition-transform ${isOpen ? "rotate-90" : ""}`
11070
11045
  }
11071
11046
  ),
11072
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: title })
11047
+ /* @__PURE__ */ jsx("span", { children: title })
11073
11048
  ]
11074
11049
  }
11075
11050
  ),
11076
- isOpen && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "px-4 pb-4 border-t border-border pt-3 text-sm leading-relaxed opacity-90 overflow-hidden min-w-0", children })
11051
+ isOpen && /* @__PURE__ */ jsx("div", { className: "px-4 pb-4 border-t border-border pt-3 text-sm leading-relaxed opacity-90 overflow-hidden min-w-0", children })
11077
11052
  ]
11078
11053
  }
11079
11054
  );
11080
11055
  };
11081
11056
  var Modal = ({ title, isOpen, onClose, children }) => {
11082
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.Dialog.Root, { open: isOpen, onOpenChange: (open) => {
11057
+ return /* @__PURE__ */ jsx(Dialog.Root, { open: isOpen, onOpenChange: (open) => {
11083
11058
  if (!open) onClose();
11084
- }, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_dialog.Dialog.Portal, { children: [
11085
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.Dialog.Backdrop, { className: "fixed inset-0 z-[9999] bg-black/60" }),
11086
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.Dialog.Viewport, { className: "fixed inset-0 z-[9999] flex items-center justify-center p-4", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_dialog.Dialog.Popup, { className: "bg-background-primary border border-border shadow-2xl rounded-3xl w-full max-w-3xl max-h-[85vh] flex flex-col overflow-hidden", children: [
11087
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex justify-between items-center p-4 border-b border-border bg-background-secondary-solid/20", children: [
11088
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.Dialog.Title, { className: "text-lg font-bold !m-0", children: title }),
11089
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.Dialog.Close, { className: "w-8 h-8 rounded-full hover:bg-white/10 flex items-center justify-center transition-colors cursor-pointer border-none bg-transparent", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "material-symbols-rounded text-base", children: "close" }) })
11059
+ }, children: /* @__PURE__ */ jsxs(Dialog.Portal, { children: [
11060
+ /* @__PURE__ */ jsx(Dialog.Backdrop, { className: "fixed inset-0 z-[9999] bg-black/60" }),
11061
+ /* @__PURE__ */ jsx(Dialog.Viewport, { className: "fixed inset-0 z-[9999] flex items-center justify-center p-4", children: /* @__PURE__ */ jsxs(Dialog.Popup, { className: "bg-background-primary border border-border shadow-2xl rounded-3xl w-full max-w-3xl max-h-[85vh] flex flex-col overflow-hidden", children: [
11062
+ /* @__PURE__ */ jsxs("div", { className: "flex justify-between items-center p-4 border-b border-border bg-background-secondary-solid/20", children: [
11063
+ /* @__PURE__ */ jsx(Dialog.Title, { className: "text-lg font-bold !m-0", children: title }),
11064
+ /* @__PURE__ */ jsx(Dialog.Close, { className: "w-8 h-8 rounded-full hover:bg-white/10 flex items-center justify-center transition-colors cursor-pointer border-none bg-transparent", children: /* @__PURE__ */ jsx("span", { className: "material-symbols-rounded text-base", children: "close" }) })
11090
11065
  ] }),
11091
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "p-6 overflow-auto min-h-0 text-text-primary [&_h1:first-child]:mt-0 [&_h2:first-child]:mt-0 [&_h3:first-child]:mt-0 [&_h4:first-child]:mt-0 [&_h5:first-child]:mt-0 [&_h6:first-child]:mt-0", children })
11066
+ /* @__PURE__ */ jsx("div", { className: "p-6 overflow-auto min-h-0 text-text-primary [&_h1:first-child]:mt-0 [&_h2:first-child]:mt-0 [&_h3:first-child]:mt-0 [&_h4:first-child]:mt-0 [&_h5:first-child]:mt-0 [&_h6:first-child]:mt-0", children })
11092
11067
  ] }) })
11093
11068
  ] }) });
11094
11069
  };
11095
11070
 
11096
11071
  // renderers.tsx
11097
- var import_jsx_runtime2 = require("react/jsx-runtime");
11072
+ import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
11098
11073
  function renderInline(text) {
11099
11074
  if (!text) return text;
11100
11075
  const parsePart = (part, key) => {
11101
11076
  let match2;
11102
11077
  if (match2 = part.match(/^\|\[([^\]]+)\]\|$/)) {
11103
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(IconRenderer, { iconName: match2[1] }, key);
11078
+ return /* @__PURE__ */ jsx2(IconRenderer, { iconName: match2[1] }, key);
11104
11079
  }
11105
11080
  if (match2 = part.match(/^!~(.+?)~!$/)) {
11106
11081
  const content = match2[1];
@@ -11119,7 +11094,7 @@ function renderInline(text) {
11119
11094
  type = parts[textIndex] === "both" ? "underline line-through" : parts[textIndex++];
11120
11095
  }
11121
11096
  const innerText = parts.slice(textIndex).join(";");
11122
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
11097
+ return /* @__PURE__ */ jsx2(
11123
11098
  "span",
11124
11099
  {
11125
11100
  style: {
@@ -11132,31 +11107,31 @@ function renderInline(text) {
11132
11107
  );
11133
11108
  }
11134
11109
  if (match2 = part.match(/%([^%\s]+?)%([\s\S]+?)%%/)) {
11135
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { style: { color: match2[1] }, children: renderInline(match2[2]) }, key);
11110
+ return /* @__PURE__ */ jsx2("span", { style: { color: match2[1] }, children: renderInline(match2[2]) }, key);
11136
11111
  }
11137
11112
  if (match2 = part.match(/^!>([^<]+?)<!$/)) {
11138
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "bg-text-primary text-bg-primary px-1 rounded hover:bg-transparent transition-colors cursor-pointer", children: renderInline(match2[1]) }, key);
11113
+ return /* @__PURE__ */ jsx2("span", { className: "bg-text-primary text-bg-primary px-1 rounded hover:bg-transparent transition-colors cursor-pointer", children: renderInline(match2[1]) }, key);
11139
11114
  }
11140
11115
  if (match2 = part.match(/^==(.+?)==$/)) {
11141
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("mark", { className: "bg-yellow-500/20 text-inherit px-0.5 rounded", children: renderInline(match2[1]) }, key);
11116
+ return /* @__PURE__ */ jsx2("mark", { className: "bg-yellow-500/20 text-inherit px-0.5 rounded", children: renderInline(match2[1]) }, key);
11142
11117
  }
11143
11118
  if (match2 = part.match(/^\*\*\*(.+?)\*\*\*$/)) {
11144
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("strong", { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("em", { children: renderInline(match2[1]) }) }, key);
11119
+ return /* @__PURE__ */ jsx2("strong", { children: /* @__PURE__ */ jsx2("em", { children: renderInline(match2[1]) }) }, key);
11145
11120
  }
11146
11121
  if (match2 = part.match(/^\*\*(.+?)\*\*$/)) {
11147
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("strong", { children: renderInline(match2[1]) }, key);
11122
+ return /* @__PURE__ */ jsx2("strong", { children: renderInline(match2[1]) }, key);
11148
11123
  }
11149
11124
  if (match2 = part.match(/^_(.+?)_$/)) {
11150
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("em", { children: renderInline(match2[1]) }, key);
11125
+ return /* @__PURE__ */ jsx2("em", { children: renderInline(match2[1]) }, key);
11151
11126
  }
11152
11127
  if (match2 = part.match(/^~~(.+?)~~$/)) {
11153
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("del", { children: renderInline(match2[1]) }, key);
11128
+ return /* @__PURE__ */ jsx2("del", { children: renderInline(match2[1]) }, key);
11154
11129
  }
11155
11130
  if (match2 = part.match(/^`([^`]+)`$/)) {
11156
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("code", { className: "text-[0.875em] font-mono bg-background-secondary/50 px-1.5 py-0.5 rounded text-text-primary", children: match2[1] }, key);
11131
+ return /* @__PURE__ */ jsx2("code", { className: "text-[0.875em] font-mono bg-background-secondary/50 px-1.5 py-0.5 rounded text-text-primary", children: match2[1] }, key);
11157
11132
  }
11158
11133
  if (match2 = part.match(/^\[([^\]]+?)\]\(([^)]+?)\)$/)) {
11159
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
11134
+ return /* @__PURE__ */ jsx2(
11160
11135
  "a",
11161
11136
  {
11162
11137
  href: match2[2],
@@ -11169,7 +11144,7 @@ function renderInline(text) {
11169
11144
  );
11170
11145
  }
11171
11146
  if (part.startsWith("<") && part.endsWith(">")) {
11172
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { dangerouslySetInnerHTML: { __html: part } }, key);
11147
+ return /* @__PURE__ */ jsx2("span", { dangerouslySetInnerHTML: { __html: part } }, key);
11173
11148
  }
11174
11149
  return part;
11175
11150
  };
@@ -11192,13 +11167,13 @@ function renderInline(text) {
11192
11167
  }
11193
11168
  function renderTable(content) {
11194
11169
  const rows = content.split("\n").filter((r) => r.trim());
11195
- if (rows.length < 2) return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { children: content });
11170
+ if (rows.length < 2) return /* @__PURE__ */ jsx2("p", { children: content });
11196
11171
  const parseRow = (row) => row.split("|").map((c) => c.trim()).filter(Boolean);
11197
11172
  const headerCells = parseRow(rows[0]);
11198
11173
  const bodyRows = rows.slice(2).map(parseRow);
11199
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "overflow-x-auto", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("table", { className: "w-full text-sm sm:text-base border-collapse my-4", children: [
11200
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("tr", { children: headerCells.map((cell, ci) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("th", { className: "border border-border px-3 py-2 bg-background-secondary-solid/10 text-left font-bold", children: renderInline(cell) }, ci)) }) }),
11201
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("tbody", { children: bodyRows.map((cells, ri) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("tr", { children: cells.map((cell, ci) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("td", { className: "border border-border px-3 py-2", children: renderInline(cell) }, ci)) }, ri)) })
11174
+ return /* @__PURE__ */ jsx2("div", { className: "overflow-x-auto", children: /* @__PURE__ */ jsxs2("table", { className: "w-full text-sm sm:text-base border-collapse my-4", children: [
11175
+ /* @__PURE__ */ jsx2("thead", { children: /* @__PURE__ */ jsx2("tr", { children: headerCells.map((cell, ci) => /* @__PURE__ */ jsx2("th", { className: "border border-border px-3 py-2 bg-background-secondary-solid/10 text-left font-bold", children: renderInline(cell) }, ci)) }) }),
11176
+ /* @__PURE__ */ jsx2("tbody", { children: bodyRows.map((cells, ri) => /* @__PURE__ */ jsx2("tr", { children: cells.map((cell, ci) => /* @__PURE__ */ jsx2("td", { className: "border border-border px-3 py-2", children: renderInline(cell) }, ci)) }, ri)) })
11202
11177
  ] }) });
11203
11178
  }
11204
11179
  function renderList(content) {
@@ -11215,23 +11190,23 @@ function renderList(content) {
11215
11190
  });
11216
11191
  }
11217
11192
  }
11218
- if (items.length === 0) return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { children: content });
11193
+ if (items.length === 0) return /* @__PURE__ */ jsx2("p", { children: content });
11219
11194
  const isOrdered = /^\d+\.$/.test(items[0].marker);
11220
11195
  const Tag = isOrdered ? "ol" : "ul";
11221
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Tag, { className: `${isOrdered ? "list-decimal" : "list-disc"} pl-6 my-3 space-y-1 text-sm sm:text-base`, children: items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("li", { className: "leading-relaxed", children: renderInline(item.text) }, index)) });
11196
+ return /* @__PURE__ */ jsx2(Tag, { className: `${isOrdered ? "list-decimal" : "list-disc"} pl-6 my-3 space-y-1 text-sm sm:text-base`, children: items.map((item, index) => /* @__PURE__ */ jsx2("li", { className: "leading-relaxed", children: renderInline(item.text) }, index)) });
11222
11197
  }
11223
11198
  function extractHeaders(elements) {
11224
11199
  return elements.filter((el) => el.type === "header");
11225
11200
  }
11226
11201
 
11227
11202
  // directives/AdmonitionDirective.tsx
11228
- var import_jsx_runtime3 = require("react/jsx-runtime");
11203
+ import { jsx as jsx3 } from "react/jsx-runtime";
11229
11204
  var AdmonitionDirective = ({
11230
11205
  directiveType,
11231
11206
  props,
11232
11207
  renderSlot
11233
11208
  }) => {
11234
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
11209
+ return /* @__PURE__ */ jsx3(
11235
11210
  Admonition,
11236
11211
  {
11237
11212
  type: directiveType,
@@ -11246,8 +11221,8 @@ var AdmonitionDirective = ({
11246
11221
  var AdmonitionDirective_default = AdmonitionDirective;
11247
11222
 
11248
11223
  // directives/CardDirective.tsx
11249
- var import_react2 = __toESM(require("react"));
11250
- var import_jsx_runtime4 = require("react/jsx-runtime");
11224
+ import React2, { useId } from "react";
11225
+ import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
11251
11226
  var CardDirective = ({
11252
11227
  directiveType,
11253
11228
  props,
@@ -11256,7 +11231,7 @@ var CardDirective = ({
11256
11231
  context,
11257
11232
  options = {}
11258
11233
  }) => {
11259
- const stableId = (0, import_react2.useId)();
11234
+ const stableId = useId();
11260
11235
  const { title, image, icon, class: customClass, url, target } = props;
11261
11236
  const hasDescription = !!slots.description;
11262
11237
  const { isSingleCard } = options;
@@ -11267,8 +11242,8 @@ var CardDirective = ({
11267
11242
  const inlineStyles = props.style ? parseCssString(props.style) : {};
11268
11243
  const description = hasDescription ? renderSlot("description") : null;
11269
11244
  const content = renderSlot("content") || renderSlot("default");
11270
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react2.default.Fragment, { children: [
11271
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
11245
+ return /* @__PURE__ */ jsxs3(React2.Fragment, { children: [
11246
+ /* @__PURE__ */ jsxs3(
11272
11247
  "div",
11273
11248
  {
11274
11249
  className: `flex flex-col h-full rounded-3xl transition-all relative overflow-hidden group border min-w-[18rem] w-[18rem] max-w-[20rem] ${isModal || isLink ? "cursor-pointer !border-accent-primary/10 hover:border-accent-primary/50" : "border-border"} ${wrapperClass}`,
@@ -11284,20 +11259,20 @@ var CardDirective = ({
11284
11259
  if (e.key === "Enter" || e.key === " ") context.setModals((prev) => ({ ...prev, [modalId]: true }));
11285
11260
  } : void 0,
11286
11261
  children: [
11287
- image && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: `w-full ${isSingleCard ? "h-[240px]" : "h-[160px]"} overflow-hidden relative transition-all duration-500`, children: [
11288
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("img", { src: image, alt: title || "", className: "w-full h-full object-cover !m-0" }),
11289
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "absolute inset-0 bg-gradient-to-t from-background-primary/40 to-transparent" })
11262
+ image && /* @__PURE__ */ jsxs3("div", { className: `w-full ${isSingleCard ? "h-[240px]" : "h-[160px]"} overflow-hidden relative transition-all duration-500`, children: [
11263
+ /* @__PURE__ */ jsx4("img", { src: image, alt: title || "", className: "w-full h-full object-cover !m-0" }),
11264
+ /* @__PURE__ */ jsx4("div", { className: "absolute inset-0 bg-gradient-to-t from-background-primary/40 to-transparent" })
11290
11265
  ] }),
11291
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: `flex flex-col flex-1 bg-background-primary/80 rounded-t-xl p-6 relative ${image ? "-mt-10" : ""} border-t border-white/5 shadow-2xl`, children: [
11292
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "flex items-center gap-3 mb-3", children: [
11293
- icon && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "w-10 h-10 text-[1.6em] rounded-xl bg-accent-primary/20 flex items-center justify-center shrink-0 text-accent-primary", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(IconRenderer, { iconName: icon }) }),
11294
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("h3", { className: "text-base font-black tracking-tight leading-tight !m-0", children: title })
11266
+ /* @__PURE__ */ jsxs3("div", { className: `flex flex-col flex-1 bg-background-primary/80 rounded-t-xl p-6 relative ${image ? "-mt-10" : ""} border-t border-white/5 shadow-2xl`, children: [
11267
+ /* @__PURE__ */ jsxs3("div", { className: "flex items-center gap-3 mb-3", children: [
11268
+ icon && /* @__PURE__ */ jsx4("div", { className: "w-10 h-10 text-[1.6em] rounded-xl bg-accent-primary/20 flex items-center justify-center shrink-0 text-accent-primary", children: /* @__PURE__ */ jsx4(IconRenderer, { iconName: icon }) }),
11269
+ /* @__PURE__ */ jsx4("h3", { className: "text-base font-black tracking-tight leading-tight !m-0", children: title })
11295
11270
  ] }),
11296
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "flex-1 flex flex-col gap-2", children: [
11297
- description && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "text-sm opacity-80 leading-relaxed font-medium", children: description }),
11298
- directiveType === "card" && content && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "mt-2", children: content })
11271
+ /* @__PURE__ */ jsxs3("div", { className: "flex-1 flex flex-col gap-2", children: [
11272
+ description && /* @__PURE__ */ jsx4("div", { className: "text-sm opacity-80 leading-relaxed font-medium", children: description }),
11273
+ directiveType === "card" && content && /* @__PURE__ */ jsx4("div", { className: "mt-2", children: content })
11299
11274
  ] }),
11300
- (isModal || isLink) && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "mt-6 flex justify-end", children: isLink && url ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
11275
+ (isModal || isLink) && /* @__PURE__ */ jsx4("div", { className: "mt-6 flex justify-end", children: isLink && url ? /* @__PURE__ */ jsxs3(
11301
11276
  "a",
11302
11277
  {
11303
11278
  href: url,
@@ -11306,25 +11281,25 @@ var CardDirective = ({
11306
11281
  className: "bg-accent-primary/20 hover:bg-accent-primary/30 px-4 py-2 rounded-xl flex items-center gap-1.5 text-[10px] font-black uppercase tracking-widest opacity-50 group-hover:opacity-100 group-hover:text-accent-primary transition-all no-underline",
11307
11282
  onClick: (e) => e.stopPropagation(),
11308
11283
  children: [
11309
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(IconRenderer, { iconName: "open_in_new" }),
11284
+ /* @__PURE__ */ jsx4(IconRenderer, { iconName: "open_in_new" }),
11310
11285
  " Link"
11311
11286
  ]
11312
11287
  }
11313
- ) : isModal ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "bg-accent-primary/20 hover:bg-accent-primary/30 px-4 py-2 cursor-pointer rounded-xl flex items-center gap-1.5 text-[10px] font-black uppercase tracking-widest opacity-50 group-hover:opacity-100 group-hover:text-accent-primary transition-all", children: [
11314
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(IconRenderer, { iconName: "arrow_forward" }),
11288
+ ) : isModal ? /* @__PURE__ */ jsxs3("div", { className: "bg-accent-primary/20 hover:bg-accent-primary/30 px-4 py-2 cursor-pointer rounded-xl flex items-center gap-1.5 text-[10px] font-black uppercase tracking-widest opacity-50 group-hover:opacity-100 group-hover:text-accent-primary transition-all", children: [
11289
+ /* @__PURE__ */ jsx4(IconRenderer, { iconName: "arrow_forward" }),
11315
11290
  " Abrir"
11316
11291
  ] }) : null })
11317
11292
  ] })
11318
11293
  ]
11319
11294
  }
11320
11295
  ),
11321
- isModal && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
11296
+ isModal && /* @__PURE__ */ jsx4(
11322
11297
  Modal,
11323
11298
  {
11324
11299
  title: title || "Detalles",
11325
11300
  isOpen: !!context.modals[modalId],
11326
11301
  onClose: () => context.setModals((prev) => ({ ...prev, [modalId]: false })),
11327
- children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "prose prose-sm max-w-none", children: content })
11302
+ children: /* @__PURE__ */ jsx4("div", { className: "prose prose-sm max-w-none", children: content })
11328
11303
  }
11329
11304
  )
11330
11305
  ] });
@@ -11332,12 +11307,12 @@ var CardDirective = ({
11332
11307
  var CardDirective_default = CardDirective;
11333
11308
 
11334
11309
  // directives/DetailsDirective.tsx
11335
- var import_jsx_runtime5 = require("react/jsx-runtime");
11310
+ import { jsx as jsx5 } from "react/jsx-runtime";
11336
11311
  var DetailsDirective = ({
11337
11312
  props,
11338
11313
  renderSlot
11339
11314
  }) => {
11340
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
11315
+ return /* @__PURE__ */ jsx5(
11341
11316
  Details,
11342
11317
  {
11343
11318
  title: props.title || "Details",
@@ -11352,14 +11327,14 @@ var DetailsDirective = ({
11352
11327
  var DetailsDirective_default = DetailsDirective;
11353
11328
 
11354
11329
  // directives/ModalDirective.tsx
11355
- var import_react3 = require("react");
11356
- var import_jsx_runtime6 = require("react/jsx-runtime");
11330
+ import { useId as useId2 } from "react";
11331
+ import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
11357
11332
  var ModalDirective = ({
11358
11333
  props,
11359
11334
  renderSlot,
11360
11335
  context
11361
11336
  }) => {
11362
- const stableId = (0, import_react3.useId)();
11337
+ const stableId = useId2();
11363
11338
  const modalId = `modal-${props.id || stableId}`;
11364
11339
  const label = props.label || props.title || "Open";
11365
11340
  const modalTitle = props.title || "Modal";
@@ -11384,12 +11359,12 @@ var ModalDirective = ({
11384
11359
  const handleClose = () => {
11385
11360
  context.setModals((prev) => ({ ...prev, [modalId]: false }));
11386
11361
  };
11387
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: `not-prose ${wrapperClass}`.trim(), children: [
11388
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("button", { className: btnClass, onClick: handleOpen, children: [
11389
- props.icon && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(IconRenderer, { iconName: props.icon }),
11362
+ return /* @__PURE__ */ jsxs4("div", { className: `not-prose ${wrapperClass}`.trim(), children: [
11363
+ /* @__PURE__ */ jsxs4("button", { className: btnClass, onClick: handleOpen, children: [
11364
+ props.icon && /* @__PURE__ */ jsx6(IconRenderer, { iconName: props.icon }),
11390
11365
  label
11391
11366
  ] }),
11392
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
11367
+ /* @__PURE__ */ jsx6(
11393
11368
  Modal,
11394
11369
  {
11395
11370
  title: modalTitle,
@@ -11403,8 +11378,8 @@ var ModalDirective = ({
11403
11378
  var ModalDirective_default = ModalDirective;
11404
11379
 
11405
11380
  // directives/ButtonDirective.tsx
11406
- var import_react4 = __toESM(require("react"));
11407
- var import_jsx_runtime7 = require("react/jsx-runtime");
11381
+ import React4 from "react";
11382
+ import { Fragment, jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
11408
11383
  var ButtonDirective = ({
11409
11384
  props,
11410
11385
  renderSlot
@@ -11429,7 +11404,7 @@ var ButtonDirective = ({
11429
11404
  };
11430
11405
  const wrapperClass = customClass.split(/\s+/).map((c) => positionMap[c] || c).join(" ");
11431
11406
  if (label) {
11432
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: `not-prose ${wrapperClass}`.trim(), children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
11407
+ return /* @__PURE__ */ jsx7("div", { className: `not-prose ${wrapperClass}`.trim(), children: /* @__PURE__ */ jsxs5(
11433
11408
  "a",
11434
11409
  {
11435
11410
  href: url,
@@ -11437,7 +11412,7 @@ var ButtonDirective = ({
11437
11412
  rel: "noopener noreferrer",
11438
11413
  className: btnClass,
11439
11414
  children: [
11440
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(IconRenderer, { iconName: icon }),
11415
+ /* @__PURE__ */ jsx7(IconRenderer, { iconName: icon }),
11441
11416
  label
11442
11417
  ]
11443
11418
  }
@@ -11446,21 +11421,21 @@ var ButtonDirective = ({
11446
11421
  const slotContent = renderSlot("default");
11447
11422
  const findLinks = (element) => {
11448
11423
  if (!element) return [];
11449
- if (import_react4.default.isValidElement(element) && element.type === "a") {
11424
+ if (React4.isValidElement(element) && element.type === "a") {
11450
11425
  return [element];
11451
11426
  }
11452
11427
  if (Array.isArray(element)) {
11453
11428
  return element.flatMap(findLinks);
11454
11429
  }
11455
- if (import_react4.default.isValidElement(element) && element.props.children) {
11430
+ if (React4.isValidElement(element) && element.props.children) {
11456
11431
  return findLinks(element.props.children);
11457
11432
  }
11458
11433
  return [];
11459
11434
  };
11460
11435
  const links = findLinks(slotContent);
11461
11436
  if (links.length > 0) {
11462
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: `not-prose ${wrapperClass}`.trim(), children: links.map(
11463
- (link, index) => import_react4.default.cloneElement(
11437
+ return /* @__PURE__ */ jsx7("div", { className: `not-prose ${wrapperClass}`.trim(), children: links.map(
11438
+ (link, index) => React4.cloneElement(
11464
11439
  link,
11465
11440
  {
11466
11441
  key: index,
@@ -11468,22 +11443,22 @@ var ButtonDirective = ({
11468
11443
  target,
11469
11444
  rel: "noopener noreferrer"
11470
11445
  },
11471
- /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
11472
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(IconRenderer, { iconName: icon }),
11446
+ /* @__PURE__ */ jsxs5(Fragment, { children: [
11447
+ /* @__PURE__ */ jsx7(IconRenderer, { iconName: icon }),
11473
11448
  link.props.children
11474
11449
  ] })
11475
11450
  )
11476
11451
  ) });
11477
11452
  }
11478
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: `not-prose ${wrapperClass}`.trim(), children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("a", { href: url, target, rel: "noopener noreferrer", className: btnClass, children: [
11479
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(IconRenderer, { iconName: icon }),
11453
+ return /* @__PURE__ */ jsx7("div", { className: `not-prose ${wrapperClass}`.trim(), children: /* @__PURE__ */ jsxs5("a", { href: url, target, rel: "noopener noreferrer", className: btnClass, children: [
11454
+ /* @__PURE__ */ jsx7(IconRenderer, { iconName: icon }),
11480
11455
  slotContent
11481
11456
  ] }) });
11482
11457
  };
11483
11458
  var ButtonDirective_default = ButtonDirective;
11484
11459
 
11485
11460
  // directives/WrapperDirective.tsx
11486
- var import_jsx_runtime8 = require("react/jsx-runtime");
11461
+ import { jsx as jsx8 } from "react/jsx-runtime";
11487
11462
  var WrapperDirective = ({
11488
11463
  props,
11489
11464
  renderSlot
@@ -11500,13 +11475,13 @@ var WrapperDirective = ({
11500
11475
  wrapperProps[key] = value;
11501
11476
  }
11502
11477
  }
11503
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { ...wrapperProps, children: renderSlot("default") });
11478
+ return /* @__PURE__ */ jsx8("div", { ...wrapperProps, children: renderSlot("default") });
11504
11479
  };
11505
11480
  var WrapperDirective_default = WrapperDirective;
11506
11481
 
11507
11482
  // directives/SlideDirective.tsx
11508
- var import_react5 = require("react");
11509
- var import_jsx_runtime9 = require("react/jsx-runtime");
11483
+ import { useState as useState2, useEffect, useCallback, useRef as useRef2, useLayoutEffect } from "react";
11484
+ import { jsx as jsx9, jsxs as jsxs6 } from "react/jsx-runtime";
11510
11485
  var slideCounter = 0;
11511
11486
  var SlideDirective = ({
11512
11487
  props,
@@ -11516,23 +11491,23 @@ var SlideDirective = ({
11516
11491
  const rawContent = slots.default || "";
11517
11492
  const lines = rawContent.split("\n").map((l) => l.trim()).filter(Boolean);
11518
11493
  const elements = lines.map((line) => context.parseMarkdown(line));
11519
- const [current, setCurrent] = (0, import_react5.useState)(0);
11494
+ const [current, setCurrent] = useState2(0);
11520
11495
  const interval = parseInt(props.interval || "3000", 10);
11521
11496
  const speed = parseInt(props.speed || "500", 10);
11522
- const elRefs = (0, import_react5.useRef)([]);
11523
- const [maxH, setMaxH] = (0, import_react5.useState)(0);
11524
- (0, import_react5.useLayoutEffect)(() => {
11497
+ const elRefs = useRef2([]);
11498
+ const [maxH, setMaxH] = useState2(0);
11499
+ useLayoutEffect(() => {
11525
11500
  let h = 0;
11526
11501
  elRefs.current.forEach((el) => {
11527
11502
  if (el) h = Math.max(h, el.offsetHeight);
11528
11503
  });
11529
11504
  if (h > 0) setMaxH(h);
11530
11505
  }, [elements]);
11531
- const cycle = (0, import_react5.useCallback)(() => {
11506
+ const cycle = useCallback(() => {
11532
11507
  if (elements.length <= 1) return;
11533
11508
  setCurrent((prev) => (prev + 1) % elements.length);
11534
11509
  }, [elements.length]);
11535
- (0, import_react5.useEffect)(() => {
11510
+ useEffect(() => {
11536
11511
  if (elements.length <= 1) return;
11537
11512
  const id = setInterval(cycle, interval);
11538
11513
  return () => clearInterval(id);
@@ -11559,14 +11534,14 @@ var SlideDirective = ({
11559
11534
  const forcedFontSize = textSizeMatch ? textSizeMap[textSizeMatch[0]] : null;
11560
11535
  const scopeClass = `sld-${++slideCounter}`;
11561
11536
  const className = textSizeMatch ? rawClass.replace(textSizeMatch[0], "").replace(/\s+/g, " ").trim() : rawClass;
11562
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
11537
+ return /* @__PURE__ */ jsxs6(
11563
11538
  "div",
11564
11539
  {
11565
11540
  className: "not-prose",
11566
11541
  style: { height: maxH || "auto", position: "relative", overflow: "hidden", ...inlineStyle },
11567
11542
  children: [
11568
- forcedFontSize && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("style", { children: `.${scopeClass} * { font-size: ${forcedFontSize} !important; line-height: normal !important; }` }),
11569
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
11543
+ forcedFontSize && /* @__PURE__ */ jsx9("style", { children: `.${scopeClass} * { font-size: ${forcedFontSize} !important; line-height: normal !important; }` }),
11544
+ /* @__PURE__ */ jsx9(
11570
11545
  "div",
11571
11546
  {
11572
11547
  style: {
@@ -11577,14 +11552,14 @@ var SlideDirective = ({
11577
11552
  transition: `transform ${speed}ms cubic-bezier(0.16, 1, 0.3, 1)`,
11578
11553
  transform: `translateY(${-current * maxH}px)`
11579
11554
  },
11580
- children: elements.map((tokens, i) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
11555
+ children: elements.map((tokens, i) => /* @__PURE__ */ jsx9(
11581
11556
  "div",
11582
11557
  {
11583
11558
  ref: (el) => {
11584
11559
  elRefs.current[i] = el;
11585
11560
  },
11586
11561
  style: maxH ? { height: maxH, display: "flex", alignItems: "center", overflow: "hidden" } : { display: "flex", alignItems: "center" },
11587
- children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: `${scopeClass} ${className}`, style: { width: "100%" }, children: context.processAndRenderElements(tokens) })
11562
+ children: /* @__PURE__ */ jsx9("div", { className: `${scopeClass} ${className}`, style: { width: "100%" }, children: context.processAndRenderElements(tokens) })
11588
11563
  },
11589
11564
  i
11590
11565
  ))
@@ -11623,7 +11598,7 @@ var directiveRegistry = {
11623
11598
  var directives_default = directiveRegistry;
11624
11599
 
11625
11600
  // DirectiveRenderer.tsx
11626
- var import_jsx_runtime10 = require("react/jsx-runtime");
11601
+ import { jsx as jsx10 } from "react/jsx-runtime";
11627
11602
  var DirectiveRenderer = ({
11628
11603
  element,
11629
11604
  context,
@@ -11648,17 +11623,17 @@ var DirectiveRenderer = ({
11648
11623
  allElements
11649
11624
  };
11650
11625
  if (Component) {
11651
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Component, { ...directiveProps }, index);
11626
+ return /* @__PURE__ */ jsx10(Component, { ...directiveProps }, index);
11652
11627
  }
11653
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: `my-4 p-4 rounded-2xl border border-border bg-background-primary/5`, children: renderSlot("default") }, index);
11628
+ return /* @__PURE__ */ jsx10("div", { className: `my-4 p-4 rounded-2xl border border-border bg-background-primary/5`, children: renderSlot("default") }, index);
11654
11629
  };
11655
11630
  var DirectiveRenderer_default = DirectiveRenderer;
11656
11631
 
11657
11632
  // RawHtmlRenderer.tsx
11658
- var import_react7 = require("react");
11633
+ import { useRef as useRef4, useEffect as useEffect3 } from "react";
11659
11634
 
11660
11635
  // useTailwindCDN.ts
11661
- var import_react6 = require("react");
11636
+ import { useEffect as useEffect2, useRef as useRef3 } from "react";
11662
11637
  var CDN_URL = "https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4";
11663
11638
  var SCRIPT_ID = "tailwind-cdn-v4-runtime";
11664
11639
  var CONFIG_ID = "tailwind-cdn-v4-config";
@@ -11671,8 +11646,8 @@ window.tailwind.config = {
11671
11646
  };
11672
11647
  `;
11673
11648
  function useLazyTailwindCDN(enabled) {
11674
- const loadedRef = (0, import_react6.useRef)(false);
11675
- (0, import_react6.useEffect)(() => {
11649
+ const loadedRef = useRef3(false);
11650
+ useEffect2(() => {
11676
11651
  if (!enabled) {
11677
11652
  window.__twCDNRefs = (window.__twCDNRefs ?? 1) - 1;
11678
11653
  if ((window.__twCDNRefs ?? 0) <= 0) {
@@ -11736,14 +11711,14 @@ function preloadTailwindCDN() {
11736
11711
  }
11737
11712
 
11738
11713
  // RawHtmlRenderer.tsx
11739
- var import_jsx_runtime11 = require("react/jsx-runtime");
11714
+ import { jsx as jsx11 } from "react/jsx-runtime";
11740
11715
  var RawHtmlRenderer = ({
11741
11716
  content,
11742
11717
  globalStyles,
11743
11718
  wrapperClassName
11744
11719
  }) => {
11745
- const containerRef = (0, import_react7.useRef)(null);
11746
- (0, import_react7.useEffect)(() => {
11720
+ const containerRef = useRef4(null);
11721
+ useEffect3(() => {
11747
11722
  if (!containerRef.current) return;
11748
11723
  const scripts = containerRef.current.querySelectorAll("script");
11749
11724
  scripts.forEach((oldScript) => {
@@ -11756,7 +11731,7 @@ var RawHtmlRenderer = ({
11756
11731
  });
11757
11732
  scanTailwindCDN();
11758
11733
  }, [content]);
11759
- (0, import_react7.useEffect)(() => {
11734
+ useEffect3(() => {
11760
11735
  if (!globalStyles) return;
11761
11736
  const styleEl = document.createElement("style");
11762
11737
  styleEl.setAttribute("data-global", "");
@@ -11766,25 +11741,25 @@ var RawHtmlRenderer = ({
11766
11741
  if (styleEl.parentNode) document.head.removeChild(styleEl);
11767
11742
  };
11768
11743
  }, [globalStyles]);
11769
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: wrapperClassName, ref: containerRef, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { dangerouslySetInnerHTML: { __html: content } }) });
11744
+ return /* @__PURE__ */ jsx11("div", { className: wrapperClassName, ref: containerRef, children: /* @__PURE__ */ jsx11("div", { dangerouslySetInnerHTML: { __html: content } }) });
11770
11745
  };
11771
11746
  var RawHtmlRenderer_default = RawHtmlRenderer;
11772
11747
 
11773
11748
  // context.tsx
11774
- var import_react8 = require("react");
11775
- var RenderCtx = (0, import_react8.createContext)(null);
11749
+ import { createContext, useContext } from "react";
11750
+ var RenderCtx = createContext(null);
11776
11751
  var RenderContextProvider = RenderCtx.Provider;
11777
11752
 
11778
11753
  // CustomMarkdownRenderer.tsx
11779
- var import_jsx_runtime12 = require("react/jsx-runtime");
11754
+ import { jsx as jsx12, jsxs as jsxs7 } from "react/jsx-runtime";
11780
11755
  var CustomMarkdownRenderer = ({ content: initialContent }) => {
11781
- const [modals, setModals] = (0, import_react9.useState)({});
11782
- const baseId = (0, import_react9.useId)().replace(/:/g, "");
11756
+ const [modals, setModals] = useState3({});
11757
+ const baseId = useId3().replace(/:/g, "");
11783
11758
  const articleClass = `scope-${baseId}`;
11784
- const contextRef = (0, import_react9.useRef)(null);
11759
+ const contextRef = useRef5(null);
11785
11760
  resetScopeCounter();
11786
- const allElements = (0, import_react9.useMemo)(() => parseMarkdown(initialContent), [initialContent]);
11787
- (0, import_react9.useEffect)(() => {
11761
+ const allElements = useMemo(() => parseMarkdown(initialContent), [initialContent]);
11762
+ useEffect4(() => {
11788
11763
  const handleHashChange = () => {
11789
11764
  const hash = window.location.hash;
11790
11765
  if (hash) {
@@ -11797,7 +11772,7 @@ var CustomMarkdownRenderer = ({ content: initialContent }) => {
11797
11772
  window.addEventListener("hashchange", handleHashChange);
11798
11773
  return () => window.removeEventListener("hashchange", handleHashChange);
11799
11774
  }, [initialContent]);
11800
- const renderElement = (0, import_react9.useCallback)(
11775
+ const renderElement = useCallback2(
11801
11776
  (element, index, _depth = 0) => {
11802
11777
  switch (element.type) {
11803
11778
  case "header": {
@@ -11815,7 +11790,7 @@ var CustomMarkdownRenderer = ({ content: initialContent }) => {
11815
11790
  if (alignCenter) headerClasses += " text-center";
11816
11791
  if (alignRight) headerClasses += " text-right";
11817
11792
  if (userClasses) headerClasses += ` ${userClasses}`;
11818
- return import_react9.default.createElement(
11793
+ return React8.createElement(
11819
11794
  HeaderTag,
11820
11795
  { key: index, id: element.id, className: headerClasses },
11821
11796
  renderInline(text)
@@ -11826,13 +11801,13 @@ var CustomMarkdownRenderer = ({ content: initialContent }) => {
11826
11801
  const processedContent = lines.map((line, lineIndex) => {
11827
11802
  const hardBreakMatch = line.match(/^(.*?)(\s{2,})$/);
11828
11803
  if (hardBreakMatch) {
11829
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_react9.default.Fragment, { children: [
11804
+ return /* @__PURE__ */ jsxs7(React8.Fragment, { children: [
11830
11805
  renderInline(hardBreakMatch[1]),
11831
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("br", {})
11806
+ /* @__PURE__ */ jsx12("br", {})
11832
11807
  ] }, lineIndex);
11833
11808
  }
11834
11809
  const isLastLine = lineIndex === lines.length - 1;
11835
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_react9.default.Fragment, { children: [
11810
+ return /* @__PURE__ */ jsxs7(React8.Fragment, { children: [
11836
11811
  renderInline(line),
11837
11812
  !isLastLine && " "
11838
11813
  ] }, lineIndex);
@@ -11841,10 +11816,10 @@ var CustomMarkdownRenderer = ({ content: initialContent }) => {
11841
11816
  let pClasses = "md-p";
11842
11817
  if (pUserClasses) pClasses += ` ${pUserClasses}`;
11843
11818
  if (element.align) pClasses += ` text-${element.align}`;
11844
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { id: element.id, className: pClasses, children: processedContent }, index);
11819
+ return /* @__PURE__ */ jsx12("p", { id: element.id, className: pClasses, children: processedContent }, index);
11845
11820
  }
11846
11821
  case "codeblock":
11847
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
11822
+ return /* @__PURE__ */ jsx12(
11848
11823
  CodeBlock,
11849
11824
  {
11850
11825
  code: element.content,
@@ -11854,7 +11829,7 @@ var CustomMarkdownRenderer = ({ content: initialContent }) => {
11854
11829
  index
11855
11830
  );
11856
11831
  case "directive":
11857
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
11832
+ return /* @__PURE__ */ jsx12(
11858
11833
  DirectiveRenderer_default,
11859
11834
  {
11860
11835
  element,
@@ -11875,7 +11850,7 @@ var CustomMarkdownRenderer = ({ content: initialContent }) => {
11875
11850
  }
11876
11851
  );
11877
11852
  const wrapperClassName = "w-full my-4";
11878
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
11853
+ return /* @__PURE__ */ jsx12(
11879
11854
  RawHtmlRenderer_default,
11880
11855
  {
11881
11856
  content: processedContent,
@@ -11888,14 +11863,14 @@ var CustomMarkdownRenderer = ({ content: initialContent }) => {
11888
11863
  case "html-block": {
11889
11864
  const htmlBlock = element;
11890
11865
  const props = parseHtmlAttrs(htmlBlock.attrs);
11891
- return import_react9.default.createElement(
11866
+ return React8.createElement(
11892
11867
  htmlBlock.tag,
11893
11868
  { key: index, ...props },
11894
11869
  ...processAndRenderElements(htmlBlock.children, _depth + 1)
11895
11870
  );
11896
11871
  }
11897
11872
  case "image":
11898
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
11873
+ return /* @__PURE__ */ jsx12(
11899
11874
  "img",
11900
11875
  {
11901
11876
  alt: element.alt,
@@ -11906,22 +11881,22 @@ var CustomMarkdownRenderer = ({ content: initialContent }) => {
11906
11881
  index
11907
11882
  );
11908
11883
  case "table":
11909
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { children: renderTable(element.content) }, index);
11884
+ return /* @__PURE__ */ jsx12("div", { children: renderTable(element.content) }, index);
11910
11885
  case "list":
11911
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { children: renderList(element.content) }, index);
11886
+ return /* @__PURE__ */ jsx12("div", { children: renderList(element.content) }, index);
11912
11887
  case "blockquote":
11913
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("blockquote", { className: `border-l-4 border-accent-primary/30 pl-4 italic text-text-secondary my-4 text-sm sm:text-base${element.classes ? ` ${element.classes}` : ""}`, children: renderInline(element.content) }, index);
11888
+ return /* @__PURE__ */ jsx12("blockquote", { className: `border-l-4 border-accent-primary/30 pl-4 italic text-text-secondary my-4 text-sm sm:text-base${element.classes ? ` ${element.classes}` : ""}`, children: renderInline(element.content) }, index);
11914
11889
  case "hr":
11915
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("hr", { className: "my-8 border-border" }, index);
11890
+ return /* @__PURE__ */ jsx12("hr", { className: "my-8 border-border" }, index);
11916
11891
  case "toc":
11917
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { children: generateToc(allElements) }, index);
11892
+ return /* @__PURE__ */ jsx12("div", { children: generateToc(allElements) }, index);
11918
11893
  default:
11919
11894
  return null;
11920
11895
  }
11921
11896
  },
11922
11897
  [allElements]
11923
11898
  );
11924
- const processAndRenderElements = (0, import_react9.useCallback)(
11899
+ const processAndRenderElements = useCallback2(
11925
11900
  (elements, depth = 0) => {
11926
11901
  const result = [];
11927
11902
  let i = 0;
@@ -11942,7 +11917,7 @@ var CustomMarkdownRenderer = ({ content: initialContent }) => {
11942
11917
  const justifyClasses = firstCardClass.match(/\bjustify-\S+/g) || [];
11943
11918
  const wrapperJustify = justifyClasses.length > 0 ? justifyClasses.join(" ") : "";
11944
11919
  result.push(
11945
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: `not-prose flex flex-wrap gap-6 my-6 ${wrapperJustify}`, children: cards.map((card, ci) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react9.default.Fragment, { children: renderElement(card, ci, depth) }, ci)) }, `card-grid-${result.length}`)
11920
+ /* @__PURE__ */ jsx12("div", { className: `not-prose flex flex-wrap gap-6 my-6 ${wrapperJustify}`, children: cards.map((card, ci) => /* @__PURE__ */ jsx12(React8.Fragment, { children: renderElement(card, ci, depth) }, ci)) }, `card-grid-${result.length}`)
11946
11921
  );
11947
11922
  }
11948
11923
  } else {
@@ -11957,12 +11932,12 @@ var CustomMarkdownRenderer = ({ content: initialContent }) => {
11957
11932
  const generateToc = (elements) => {
11958
11933
  const headers = extractHeaders(elements);
11959
11934
  if (headers.length === 0) return null;
11960
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("nav", { className: "not-prose my-6 p-4 rounded-2xl border border-border bg-background-primary/5", children: [
11961
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "text-base font-bold mb-3", children: "Table of Contents" }),
11962
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("ul", { className: "space-y-1 list-none p-0 m-0", children: headers.map((h, i) => {
11935
+ return /* @__PURE__ */ jsxs7("nav", { className: "not-prose my-6 p-4 rounded-2xl border border-border bg-background-primary/5", children: [
11936
+ /* @__PURE__ */ jsx12("div", { className: "text-base font-bold mb-3", children: "Table of Contents" }),
11937
+ /* @__PURE__ */ jsx12("ul", { className: "space-y-1 list-none p-0 m-0", children: headers.map((h, i) => {
11963
11938
  if (h.type !== "header") return null;
11964
11939
  const indentClass = h.level <= 2 ? "pl-0" : h.level === 3 ? "pl-4" : h.level === 4 ? "pl-8" : "pl-12";
11965
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("li", { className: `${indentClass} text-sm sm:text-base`, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
11940
+ return /* @__PURE__ */ jsx12("li", { className: `${indentClass} text-sm sm:text-base`, children: /* @__PURE__ */ jsx12(
11966
11941
  "a",
11967
11942
  {
11968
11943
  href: `#${h.id}`,
@@ -11988,12 +11963,12 @@ var CustomMarkdownRenderer = ({ content: initialContent }) => {
11988
11963
  processAndRenderElements
11989
11964
  };
11990
11965
  contextRef.current = contextForDirectives;
11991
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(RenderContextProvider, { value: contextForDirectives, children: processAndRenderElements(allElements) });
11966
+ return /* @__PURE__ */ jsx12(RenderContextProvider, { value: contextForDirectives, children: processAndRenderElements(allElements) });
11992
11967
  };
11993
11968
  var CustomMarkdownRenderer_default = CustomMarkdownRenderer;
11994
11969
 
11995
11970
  // NRpreviewer.tsx
11996
- var import_jsx_runtime13 = require("react/jsx-runtime");
11971
+ import { jsx as jsx13 } from "react/jsx-runtime";
11997
11972
  var NRpreviewer = ({
11998
11973
  content,
11999
11974
  html,
@@ -12003,39 +11978,38 @@ var NRpreviewer = ({
12003
11978
  }) => {
12004
11979
  useLazyTailwindCDN(tailwindCDN);
12005
11980
  if (content) {
12006
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: `nr-prose${className ? ` ${className}` : ""}`, style, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(CustomMarkdownRenderer_default, { content }) });
11981
+ return /* @__PURE__ */ jsx13("div", { className: `nr-prose${className ? ` ${className}` : ""}`, style, children: /* @__PURE__ */ jsx13(CustomMarkdownRenderer_default, { content }) });
12007
11982
  }
12008
11983
  if (html) {
12009
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: `nr-prose${className ? ` ${className}` : ""}`, style, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(RawHtmlRenderer_default, { content: html, wrapperClassName: "nr-preview-html" }) });
11984
+ return /* @__PURE__ */ jsx13("div", { className: `nr-prose${className ? ` ${className}` : ""}`, style, children: /* @__PURE__ */ jsx13(RawHtmlRenderer_default, { content: html, wrapperClassName: "nr-preview-html" }) });
12010
11985
  }
12011
11986
  return null;
12012
11987
  };
12013
11988
  var NRpreviewer_default = NRpreviewer;
12014
11989
 
12015
11990
  // useDebounce.ts
12016
- var import_react10 = require("react");
11991
+ import { useState as useState4, useEffect as useEffect5 } from "react";
12017
11992
  function useDebounce(value, delay) {
12018
- const [debouncedValue, setDebouncedValue] = (0, import_react10.useState)(value);
12019
- (0, import_react10.useEffect)(() => {
11993
+ const [debouncedValue, setDebouncedValue] = useState4(value);
11994
+ useEffect5(() => {
12020
11995
  const timer = setTimeout(() => setDebouncedValue(value), delay);
12021
11996
  return () => clearTimeout(timer);
12022
11997
  }, [value, delay]);
12023
11998
  return debouncedValue;
12024
11999
  }
12025
- // Annotate the CommonJS export names for ESM import in node:
12026
- 0 && (module.exports = {
12000
+ export {
12027
12001
  Admonition,
12028
12002
  CodeBlock,
12029
- CustomMarkdownRenderer,
12003
+ CustomMarkdownRenderer_default as CustomMarkdownRenderer,
12030
12004
  Details,
12031
12005
  IconRenderer,
12032
12006
  Modal,
12033
- NRpreviewer,
12007
+ NRpreviewer_default as NRpreviewer,
12034
12008
  extractHeaders,
12035
12009
  parseMarkdown,
12036
12010
  preloadTailwindCDN,
12037
12011
  scanTailwindCDN,
12038
12012
  useDebounce,
12039
12013
  useLazyTailwindCDN
12040
- });
12014
+ };
12041
12015
  //# sourceMappingURL=index.js.map