@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/NReditor.cjs +64 -60
- package/dist/NReditor.cjs.map +1 -1
- package/dist/NReditor.js +64 -60
- package/dist/NReditor.js.map +1 -1
- package/dist/react.cjs +64 -60
- package/dist/react.cjs.map +1 -1
- package/dist/react.js +64 -60
- package/dist/react.js.map +1 -1
- package/package.json +2 -1
package/dist/NReditor.cjs
CHANGED
|
@@ -2464,6 +2464,7 @@ var CustomMarkdownRenderer_default = CustomMarkdownRenderer;
|
|
|
2464
2464
|
|
|
2465
2465
|
// react/Guide.tsx
|
|
2466
2466
|
var import_react4 = require("react");
|
|
2467
|
+
var import_react_dom = require("react-dom");
|
|
2467
2468
|
|
|
2468
2469
|
// guide/index.ts
|
|
2469
2470
|
var guideData = [
|
|
@@ -2782,68 +2783,71 @@ var Guide = ({
|
|
|
2782
2783
|
}, [open, onClose]);
|
|
2783
2784
|
if (!open) return null;
|
|
2784
2785
|
const toggleCategory = (cat) => setCollapsed((prev) => ({ ...prev, [cat]: !prev[cat] }));
|
|
2785
|
-
return
|
|
2786
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.
|
|
2787
|
-
|
|
2788
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("
|
|
2789
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.
|
|
2790
|
-
|
|
2791
|
-
|
|
2792
|
-
|
|
2793
|
-
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
|
|
2797
|
-
|
|
2798
|
-
|
|
2799
|
-
|
|
2800
|
-
|
|
2801
|
-
|
|
2802
|
-
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
|
|
2811
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "nr-guide__body", children: [
|
|
2812
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("nav", { className: "nr-guide__nav", children: [
|
|
2813
|
-
filtered.map(([cat, entries]) => /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "nr-guide__cat", children: [
|
|
2814
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
2815
|
-
"button",
|
|
2816
|
-
{
|
|
2817
|
-
className: "nr-guide__cat-head",
|
|
2818
|
-
onClick: () => toggleCategory(cat),
|
|
2819
|
-
children: [
|
|
2820
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "material-icons-round nr-guide__cat-chevron", children: collapsed[cat] ? "chevron_right" : "expand_more" }),
|
|
2821
|
-
cat
|
|
2822
|
-
]
|
|
2823
|
-
}
|
|
2824
|
-
),
|
|
2825
|
-
!collapsed[cat] && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("ul", { className: "nr-guide__items", children: entries.map((e) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
2826
|
-
"button",
|
|
2827
|
-
{
|
|
2828
|
-
className: `nr-guide__item${selectedId === e.id ? " nr-guide__item--active" : ""}`,
|
|
2829
|
-
onClick: () => setSelectedId(e.id),
|
|
2830
|
-
children: [
|
|
2831
|
-
e.icon && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "material-icons-round nr-guide__item-icon", children: e.icon }),
|
|
2832
|
-
e.title
|
|
2833
|
-
]
|
|
2834
|
-
}
|
|
2835
|
-
) }, e.id)) })
|
|
2836
|
-
] }, cat)),
|
|
2837
|
-
filtered.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "nr-guide__empty", children: [
|
|
2838
|
-
"Sin resultados para \xAB",
|
|
2839
|
-
query,
|
|
2840
|
-
"\xBB."
|
|
2841
|
-
] })
|
|
2786
|
+
return (0, import_react_dom.createPortal)(
|
|
2787
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "nr-guide", role: "dialog", "aria-modal": "true", "aria-label": "Gu\xEDa de sintaxis", children: [
|
|
2788
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "nr-guide__overlay", onClick: onClose }),
|
|
2789
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "nr-guide__panel", children: [
|
|
2790
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("header", { className: "nr-guide__head", children: [
|
|
2791
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "material-icons-round", children: "menu_book" }),
|
|
2792
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("h2", { children: "Gu\xEDa de sintaxis" }),
|
|
2793
|
+
search && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
2794
|
+
"input",
|
|
2795
|
+
{
|
|
2796
|
+
className: "nr-guide__search",
|
|
2797
|
+
type: "search",
|
|
2798
|
+
placeholder: "Buscar directiva\u2026",
|
|
2799
|
+
value: query,
|
|
2800
|
+
onChange: (e) => setQuery(e.target.value)
|
|
2801
|
+
}
|
|
2802
|
+
),
|
|
2803
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
2804
|
+
"button",
|
|
2805
|
+
{
|
|
2806
|
+
className: "nr-guide__close",
|
|
2807
|
+
onClick: onClose,
|
|
2808
|
+
"aria-label": "Cerrar gu\xEDa",
|
|
2809
|
+
children: "\xD7"
|
|
2810
|
+
}
|
|
2811
|
+
)
|
|
2842
2812
|
] }),
|
|
2843
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.
|
|
2813
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "nr-guide__body", children: [
|
|
2814
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("nav", { className: "nr-guide__nav", children: [
|
|
2815
|
+
filtered.map(([cat, entries]) => /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "nr-guide__cat", children: [
|
|
2816
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
2817
|
+
"button",
|
|
2818
|
+
{
|
|
2819
|
+
className: "nr-guide__cat-head",
|
|
2820
|
+
onClick: () => toggleCategory(cat),
|
|
2821
|
+
children: [
|
|
2822
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "material-icons-round nr-guide__cat-chevron", children: collapsed[cat] ? "chevron_right" : "expand_more" }),
|
|
2823
|
+
cat
|
|
2824
|
+
]
|
|
2825
|
+
}
|
|
2826
|
+
),
|
|
2827
|
+
!collapsed[cat] && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("ul", { className: "nr-guide__items", children: entries.map((e) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
2828
|
+
"button",
|
|
2829
|
+
{
|
|
2830
|
+
className: `nr-guide__item${selectedId === e.id ? " nr-guide__item--active" : ""}`,
|
|
2831
|
+
onClick: () => setSelectedId(e.id),
|
|
2832
|
+
children: [
|
|
2833
|
+
e.icon && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "material-icons-round nr-guide__item-icon", children: e.icon }),
|
|
2834
|
+
e.title
|
|
2835
|
+
]
|
|
2836
|
+
}
|
|
2837
|
+
) }, e.id)) })
|
|
2838
|
+
] }, cat)),
|
|
2839
|
+
filtered.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "nr-guide__empty", children: [
|
|
2840
|
+
"Sin resultados para \xAB",
|
|
2841
|
+
query,
|
|
2842
|
+
"\xBB."
|
|
2843
|
+
] })
|
|
2844
|
+
] }),
|
|
2845
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "nr-guide__content", ref: contentRef, children: selected ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(CustomMarkdownRenderer_default, { content: selected.md }, selected.id) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "nr-guide__empty", children: "Selecciona una directiva de la lista." }) })
|
|
2846
|
+
] })
|
|
2844
2847
|
] })
|
|
2845
|
-
] })
|
|
2846
|
-
|
|
2848
|
+
] }),
|
|
2849
|
+
document.body
|
|
2850
|
+
);
|
|
2847
2851
|
};
|
|
2848
2852
|
var Guide_default = Guide;
|
|
2849
2853
|
|