@noirmd/previewer 1.0.0 → 1.0.2

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