@noirmd/previewer 2.0.3 → 2.0.4

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/NReditor.js CHANGED
@@ -2430,6 +2430,7 @@ var CustomMarkdownRenderer_default = CustomMarkdownRenderer;
2430
2430
 
2431
2431
  // react/Guide.tsx
2432
2432
  import { useEffect as useEffect4, useMemo, useRef as useRef3, useState as useState2 } from "react";
2433
+ import { createPortal } from "react-dom";
2433
2434
 
2434
2435
  // guide/index.ts
2435
2436
  var guideData = [
@@ -2748,68 +2749,71 @@ var Guide = ({
2748
2749
  }, [open, onClose]);
2749
2750
  if (!open) return null;
2750
2751
  const toggleCategory = (cat) => setCollapsed((prev) => ({ ...prev, [cat]: !prev[cat] }));
2751
- return /* @__PURE__ */ jsxs("div", { className: "nr-guide", role: "dialog", "aria-modal": "true", "aria-label": "Gu\xEDa de sintaxis", children: [
2752
- /* @__PURE__ */ jsx2("div", { className: "nr-guide__overlay", onClick: onClose }),
2753
- /* @__PURE__ */ jsxs("div", { className: "nr-guide__panel", children: [
2754
- /* @__PURE__ */ jsxs("header", { className: "nr-guide__head", children: [
2755
- /* @__PURE__ */ jsx2("span", { className: "material-icons-round", children: "menu_book" }),
2756
- /* @__PURE__ */ jsx2("h2", { children: "Gu\xEDa de sintaxis" }),
2757
- search && /* @__PURE__ */ jsx2(
2758
- "input",
2759
- {
2760
- className: "nr-guide__search",
2761
- type: "search",
2762
- placeholder: "Buscar directiva\u2026",
2763
- value: query,
2764
- onChange: (e) => setQuery(e.target.value)
2765
- }
2766
- ),
2767
- /* @__PURE__ */ jsx2(
2768
- "button",
2769
- {
2770
- className: "nr-guide__close",
2771
- onClick: onClose,
2772
- "aria-label": "Cerrar gu\xEDa",
2773
- children: "\xD7"
2774
- }
2775
- )
2776
- ] }),
2777
- /* @__PURE__ */ jsxs("div", { className: "nr-guide__body", children: [
2778
- /* @__PURE__ */ jsxs("nav", { className: "nr-guide__nav", children: [
2779
- filtered.map(([cat, entries]) => /* @__PURE__ */ jsxs("div", { className: "nr-guide__cat", children: [
2780
- /* @__PURE__ */ jsxs(
2781
- "button",
2782
- {
2783
- className: "nr-guide__cat-head",
2784
- onClick: () => toggleCategory(cat),
2785
- children: [
2786
- /* @__PURE__ */ jsx2("span", { className: "material-icons-round nr-guide__cat-chevron", children: collapsed[cat] ? "chevron_right" : "expand_more" }),
2787
- cat
2788
- ]
2789
- }
2790
- ),
2791
- !collapsed[cat] && /* @__PURE__ */ jsx2("ul", { className: "nr-guide__items", children: entries.map((e) => /* @__PURE__ */ jsx2("li", { children: /* @__PURE__ */ jsxs(
2792
- "button",
2793
- {
2794
- className: `nr-guide__item${selectedId === e.id ? " nr-guide__item--active" : ""}`,
2795
- onClick: () => setSelectedId(e.id),
2796
- children: [
2797
- e.icon && /* @__PURE__ */ jsx2("span", { className: "material-icons-round nr-guide__item-icon", children: e.icon }),
2798
- e.title
2799
- ]
2800
- }
2801
- ) }, e.id)) })
2802
- ] }, cat)),
2803
- filtered.length === 0 && /* @__PURE__ */ jsxs("div", { className: "nr-guide__empty", children: [
2804
- "Sin resultados para \xAB",
2805
- query,
2806
- "\xBB."
2807
- ] })
2752
+ return createPortal(
2753
+ /* @__PURE__ */ jsxs("div", { className: "nr-guide", role: "dialog", "aria-modal": "true", "aria-label": "Gu\xEDa de sintaxis", children: [
2754
+ /* @__PURE__ */ jsx2("div", { className: "nr-guide__overlay", onClick: onClose }),
2755
+ /* @__PURE__ */ jsxs("div", { className: "nr-guide__panel", children: [
2756
+ /* @__PURE__ */ jsxs("header", { className: "nr-guide__head", children: [
2757
+ /* @__PURE__ */ jsx2("span", { className: "material-icons-round", children: "menu_book" }),
2758
+ /* @__PURE__ */ jsx2("h2", { children: "Gu\xEDa de sintaxis" }),
2759
+ search && /* @__PURE__ */ jsx2(
2760
+ "input",
2761
+ {
2762
+ className: "nr-guide__search",
2763
+ type: "search",
2764
+ placeholder: "Buscar directiva\u2026",
2765
+ value: query,
2766
+ onChange: (e) => setQuery(e.target.value)
2767
+ }
2768
+ ),
2769
+ /* @__PURE__ */ jsx2(
2770
+ "button",
2771
+ {
2772
+ className: "nr-guide__close",
2773
+ onClick: onClose,
2774
+ "aria-label": "Cerrar gu\xEDa",
2775
+ children: "\xD7"
2776
+ }
2777
+ )
2808
2778
  ] }),
2809
- /* @__PURE__ */ jsx2("div", { className: "nr-guide__content", ref: contentRef, children: selected ? /* @__PURE__ */ jsx2(CustomMarkdownRenderer_default, { content: selected.md }, selected.id) : /* @__PURE__ */ jsx2("div", { className: "nr-guide__empty", children: "Selecciona una directiva de la lista." }) })
2779
+ /* @__PURE__ */ jsxs("div", { className: "nr-guide__body", children: [
2780
+ /* @__PURE__ */ jsxs("nav", { className: "nr-guide__nav", children: [
2781
+ filtered.map(([cat, entries]) => /* @__PURE__ */ jsxs("div", { className: "nr-guide__cat", children: [
2782
+ /* @__PURE__ */ jsxs(
2783
+ "button",
2784
+ {
2785
+ className: "nr-guide__cat-head",
2786
+ onClick: () => toggleCategory(cat),
2787
+ children: [
2788
+ /* @__PURE__ */ jsx2("span", { className: "material-icons-round nr-guide__cat-chevron", children: collapsed[cat] ? "chevron_right" : "expand_more" }),
2789
+ cat
2790
+ ]
2791
+ }
2792
+ ),
2793
+ !collapsed[cat] && /* @__PURE__ */ jsx2("ul", { className: "nr-guide__items", children: entries.map((e) => /* @__PURE__ */ jsx2("li", { children: /* @__PURE__ */ jsxs(
2794
+ "button",
2795
+ {
2796
+ className: `nr-guide__item${selectedId === e.id ? " nr-guide__item--active" : ""}`,
2797
+ onClick: () => setSelectedId(e.id),
2798
+ children: [
2799
+ e.icon && /* @__PURE__ */ jsx2("span", { className: "material-icons-round nr-guide__item-icon", children: e.icon }),
2800
+ e.title
2801
+ ]
2802
+ }
2803
+ ) }, e.id)) })
2804
+ ] }, cat)),
2805
+ filtered.length === 0 && /* @__PURE__ */ jsxs("div", { className: "nr-guide__empty", children: [
2806
+ "Sin resultados para \xAB",
2807
+ query,
2808
+ "\xBB."
2809
+ ] })
2810
+ ] }),
2811
+ /* @__PURE__ */ jsx2("div", { className: "nr-guide__content", ref: contentRef, children: selected ? /* @__PURE__ */ jsx2(CustomMarkdownRenderer_default, { content: selected.md }, selected.id) : /* @__PURE__ */ jsx2("div", { className: "nr-guide__empty", children: "Selecciona una directiva de la lista." }) })
2812
+ ] })
2810
2813
  ] })
2811
- ] })
2812
- ] });
2814
+ ] }),
2815
+ document.body
2816
+ );
2813
2817
  };
2814
2818
  var Guide_default = Guide;
2815
2819