@noirmd/previewer 2.0.3 → 2.0.5

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/react.cjs CHANGED
@@ -12636,6 +12636,7 @@ var NRpreviewer_default = NRpreviewer;
12636
12636
 
12637
12637
  // react/Guide.tsx
12638
12638
  var import_react4 = require("react");
12639
+ var import_react_dom = require("react-dom");
12639
12640
 
12640
12641
  // guide/index.ts
12641
12642
  var guideData = [
@@ -12954,68 +12955,71 @@ var Guide = ({
12954
12955
  }, [open, onClose]);
12955
12956
  if (!open) return null;
12956
12957
  const toggleCategory = (cat) => setCollapsed((prev) => ({ ...prev, [cat]: !prev[cat] }));
12957
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "nr-guide", role: "dialog", "aria-modal": "true", "aria-label": "Gu\xEDa de sintaxis", children: [
12958
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "nr-guide__overlay", onClick: onClose }),
12959
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "nr-guide__panel", children: [
12960
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("header", { className: "nr-guide__head", children: [
12961
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "material-icons-round", children: "menu_book" }),
12962
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("h2", { children: "Gu\xEDa de sintaxis" }),
12963
- search && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
12964
- "input",
12965
- {
12966
- className: "nr-guide__search",
12967
- type: "search",
12968
- placeholder: "Buscar directiva\u2026",
12969
- value: query,
12970
- onChange: (e) => setQuery(e.target.value)
12971
- }
12972
- ),
12973
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
12974
- "button",
12975
- {
12976
- className: "nr-guide__close",
12977
- onClick: onClose,
12978
- "aria-label": "Cerrar gu\xEDa",
12979
- children: "\xD7"
12980
- }
12981
- )
12982
- ] }),
12983
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "nr-guide__body", children: [
12984
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("nav", { className: "nr-guide__nav", children: [
12985
- filtered.map(([cat, entries]) => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "nr-guide__cat", children: [
12986
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
12987
- "button",
12988
- {
12989
- className: "nr-guide__cat-head",
12990
- onClick: () => toggleCategory(cat),
12991
- children: [
12992
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "material-icons-round nr-guide__cat-chevron", children: collapsed[cat] ? "chevron_right" : "expand_more" }),
12993
- cat
12994
- ]
12995
- }
12996
- ),
12997
- !collapsed[cat] && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("ul", { className: "nr-guide__items", children: entries.map((e) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
12998
- "button",
12999
- {
13000
- className: `nr-guide__item${selectedId === e.id ? " nr-guide__item--active" : ""}`,
13001
- onClick: () => setSelectedId(e.id),
13002
- children: [
13003
- e.icon && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "material-icons-round nr-guide__item-icon", children: e.icon }),
13004
- e.title
13005
- ]
13006
- }
13007
- ) }, e.id)) })
13008
- ] }, cat)),
13009
- filtered.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "nr-guide__empty", children: [
13010
- "Sin resultados para \xAB",
13011
- query,
13012
- "\xBB."
13013
- ] })
12958
+ return (0, import_react_dom.createPortal)(
12959
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "nr-guide", role: "dialog", "aria-modal": "true", "aria-label": "Gu\xEDa de sintaxis", children: [
12960
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "nr-guide__overlay", onClick: onClose }),
12961
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "nr-guide__panel", children: [
12962
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("header", { className: "nr-guide__head", children: [
12963
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "material-icons-round", children: "menu_book" }),
12964
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("h2", { children: "Gu\xEDa de sintaxis" }),
12965
+ search && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
12966
+ "input",
12967
+ {
12968
+ className: "nr-guide__search",
12969
+ type: "search",
12970
+ placeholder: "Buscar directiva\u2026",
12971
+ value: query,
12972
+ onChange: (e) => setQuery(e.target.value)
12973
+ }
12974
+ ),
12975
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
12976
+ "button",
12977
+ {
12978
+ className: "nr-guide__close",
12979
+ onClick: onClose,
12980
+ "aria-label": "Cerrar gu\xEDa",
12981
+ children: "\xD7"
12982
+ }
12983
+ )
13014
12984
  ] }),
13015
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "nr-guide__content", ref: contentRef, children: selected ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(CustomMarkdownRenderer_default, { content: selected.md }, selected.id) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "nr-guide__empty", children: "Selecciona una directiva de la lista." }) })
12985
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "nr-guide__body", children: [
12986
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("nav", { className: "nr-guide__nav", children: [
12987
+ filtered.map(([cat, entries]) => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "nr-guide__cat", children: [
12988
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
12989
+ "button",
12990
+ {
12991
+ className: "nr-guide__cat-head",
12992
+ onClick: () => toggleCategory(cat),
12993
+ children: [
12994
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "material-icons-round nr-guide__cat-chevron", children: collapsed[cat] ? "chevron_right" : "expand_more" }),
12995
+ cat
12996
+ ]
12997
+ }
12998
+ ),
12999
+ !collapsed[cat] && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("ul", { className: "nr-guide__items", children: entries.map((e) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
13000
+ "button",
13001
+ {
13002
+ className: `nr-guide__item${selectedId === e.id ? " nr-guide__item--active" : ""}`,
13003
+ onClick: () => setSelectedId(e.id),
13004
+ children: [
13005
+ e.icon && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "material-icons-round nr-guide__item-icon", children: e.icon }),
13006
+ e.title
13007
+ ]
13008
+ }
13009
+ ) }, e.id)) })
13010
+ ] }, cat)),
13011
+ filtered.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "nr-guide__empty", children: [
13012
+ "Sin resultados para \xAB",
13013
+ query,
13014
+ "\xBB."
13015
+ ] })
13016
+ ] }),
13017
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "nr-guide__content", ref: contentRef, children: selected ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(CustomMarkdownRenderer_default, { content: selected.md }, selected.id) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "nr-guide__empty", children: "Selecciona una directiva de la lista." }) })
13018
+ ] })
13016
13019
  ] })
13017
- ] })
13018
- ] });
13020
+ ] }),
13021
+ document.body
13022
+ );
13019
13023
  };
13020
13024
  var Guide_default = Guide;
13021
13025