@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/react.js
CHANGED
|
@@ -12614,6 +12614,7 @@ var NRpreviewer_default = NRpreviewer;
|
|
|
12614
12614
|
|
|
12615
12615
|
// react/Guide.tsx
|
|
12616
12616
|
import { useEffect as useEffect4, useMemo, useRef as useRef4, useState } from "react";
|
|
12617
|
+
import { createPortal } from "react-dom";
|
|
12617
12618
|
|
|
12618
12619
|
// guide/index.ts
|
|
12619
12620
|
var guideData = [
|
|
@@ -12932,68 +12933,71 @@ var Guide = ({
|
|
|
12932
12933
|
}, [open, onClose]);
|
|
12933
12934
|
if (!open) return null;
|
|
12934
12935
|
const toggleCategory = (cat) => setCollapsed((prev) => ({ ...prev, [cat]: !prev[cat] }));
|
|
12935
|
-
return
|
|
12936
|
-
/* @__PURE__ */
|
|
12937
|
-
|
|
12938
|
-
/* @__PURE__ */ jsxs("
|
|
12939
|
-
/* @__PURE__ */
|
|
12940
|
-
|
|
12941
|
-
|
|
12942
|
-
|
|
12943
|
-
|
|
12944
|
-
|
|
12945
|
-
|
|
12946
|
-
|
|
12947
|
-
|
|
12948
|
-
|
|
12949
|
-
|
|
12950
|
-
|
|
12951
|
-
|
|
12952
|
-
|
|
12953
|
-
|
|
12954
|
-
|
|
12955
|
-
|
|
12956
|
-
|
|
12957
|
-
|
|
12958
|
-
|
|
12959
|
-
|
|
12960
|
-
|
|
12961
|
-
/* @__PURE__ */ jsxs("div", { className: "nr-guide__body", children: [
|
|
12962
|
-
/* @__PURE__ */ jsxs("nav", { className: "nr-guide__nav", children: [
|
|
12963
|
-
filtered.map(([cat, entries]) => /* @__PURE__ */ jsxs("div", { className: "nr-guide__cat", children: [
|
|
12964
|
-
/* @__PURE__ */ jsxs(
|
|
12965
|
-
"button",
|
|
12966
|
-
{
|
|
12967
|
-
className: "nr-guide__cat-head",
|
|
12968
|
-
onClick: () => toggleCategory(cat),
|
|
12969
|
-
children: [
|
|
12970
|
-
/* @__PURE__ */ jsx4("span", { className: "material-icons-round nr-guide__cat-chevron", children: collapsed[cat] ? "chevron_right" : "expand_more" }),
|
|
12971
|
-
cat
|
|
12972
|
-
]
|
|
12973
|
-
}
|
|
12974
|
-
),
|
|
12975
|
-
!collapsed[cat] && /* @__PURE__ */ jsx4("ul", { className: "nr-guide__items", children: entries.map((e) => /* @__PURE__ */ jsx4("li", { children: /* @__PURE__ */ jsxs(
|
|
12976
|
-
"button",
|
|
12977
|
-
{
|
|
12978
|
-
className: `nr-guide__item${selectedId === e.id ? " nr-guide__item--active" : ""}`,
|
|
12979
|
-
onClick: () => setSelectedId(e.id),
|
|
12980
|
-
children: [
|
|
12981
|
-
e.icon && /* @__PURE__ */ jsx4("span", { className: "material-icons-round nr-guide__item-icon", children: e.icon }),
|
|
12982
|
-
e.title
|
|
12983
|
-
]
|
|
12984
|
-
}
|
|
12985
|
-
) }, e.id)) })
|
|
12986
|
-
] }, cat)),
|
|
12987
|
-
filtered.length === 0 && /* @__PURE__ */ jsxs("div", { className: "nr-guide__empty", children: [
|
|
12988
|
-
"Sin resultados para \xAB",
|
|
12989
|
-
query,
|
|
12990
|
-
"\xBB."
|
|
12991
|
-
] })
|
|
12936
|
+
return createPortal(
|
|
12937
|
+
/* @__PURE__ */ jsxs("div", { className: "nr-guide", role: "dialog", "aria-modal": "true", "aria-label": "Gu\xEDa de sintaxis", children: [
|
|
12938
|
+
/* @__PURE__ */ jsx4("div", { className: "nr-guide__overlay", onClick: onClose }),
|
|
12939
|
+
/* @__PURE__ */ jsxs("div", { className: "nr-guide__panel", children: [
|
|
12940
|
+
/* @__PURE__ */ jsxs("header", { className: "nr-guide__head", children: [
|
|
12941
|
+
/* @__PURE__ */ jsx4("span", { className: "material-icons-round", children: "menu_book" }),
|
|
12942
|
+
/* @__PURE__ */ jsx4("h2", { children: "Gu\xEDa de sintaxis" }),
|
|
12943
|
+
search && /* @__PURE__ */ jsx4(
|
|
12944
|
+
"input",
|
|
12945
|
+
{
|
|
12946
|
+
className: "nr-guide__search",
|
|
12947
|
+
type: "search",
|
|
12948
|
+
placeholder: "Buscar directiva\u2026",
|
|
12949
|
+
value: query,
|
|
12950
|
+
onChange: (e) => setQuery(e.target.value)
|
|
12951
|
+
}
|
|
12952
|
+
),
|
|
12953
|
+
/* @__PURE__ */ jsx4(
|
|
12954
|
+
"button",
|
|
12955
|
+
{
|
|
12956
|
+
className: "nr-guide__close",
|
|
12957
|
+
onClick: onClose,
|
|
12958
|
+
"aria-label": "Cerrar gu\xEDa",
|
|
12959
|
+
children: "\xD7"
|
|
12960
|
+
}
|
|
12961
|
+
)
|
|
12992
12962
|
] }),
|
|
12993
|
-
/* @__PURE__ */
|
|
12963
|
+
/* @__PURE__ */ jsxs("div", { className: "nr-guide__body", children: [
|
|
12964
|
+
/* @__PURE__ */ jsxs("nav", { className: "nr-guide__nav", children: [
|
|
12965
|
+
filtered.map(([cat, entries]) => /* @__PURE__ */ jsxs("div", { className: "nr-guide__cat", children: [
|
|
12966
|
+
/* @__PURE__ */ jsxs(
|
|
12967
|
+
"button",
|
|
12968
|
+
{
|
|
12969
|
+
className: "nr-guide__cat-head",
|
|
12970
|
+
onClick: () => toggleCategory(cat),
|
|
12971
|
+
children: [
|
|
12972
|
+
/* @__PURE__ */ jsx4("span", { className: "material-icons-round nr-guide__cat-chevron", children: collapsed[cat] ? "chevron_right" : "expand_more" }),
|
|
12973
|
+
cat
|
|
12974
|
+
]
|
|
12975
|
+
}
|
|
12976
|
+
),
|
|
12977
|
+
!collapsed[cat] && /* @__PURE__ */ jsx4("ul", { className: "nr-guide__items", children: entries.map((e) => /* @__PURE__ */ jsx4("li", { children: /* @__PURE__ */ jsxs(
|
|
12978
|
+
"button",
|
|
12979
|
+
{
|
|
12980
|
+
className: `nr-guide__item${selectedId === e.id ? " nr-guide__item--active" : ""}`,
|
|
12981
|
+
onClick: () => setSelectedId(e.id),
|
|
12982
|
+
children: [
|
|
12983
|
+
e.icon && /* @__PURE__ */ jsx4("span", { className: "material-icons-round nr-guide__item-icon", children: e.icon }),
|
|
12984
|
+
e.title
|
|
12985
|
+
]
|
|
12986
|
+
}
|
|
12987
|
+
) }, e.id)) })
|
|
12988
|
+
] }, cat)),
|
|
12989
|
+
filtered.length === 0 && /* @__PURE__ */ jsxs("div", { className: "nr-guide__empty", children: [
|
|
12990
|
+
"Sin resultados para \xAB",
|
|
12991
|
+
query,
|
|
12992
|
+
"\xBB."
|
|
12993
|
+
] })
|
|
12994
|
+
] }),
|
|
12995
|
+
/* @__PURE__ */ jsx4("div", { className: "nr-guide__content", ref: contentRef, children: selected ? /* @__PURE__ */ jsx4(CustomMarkdownRenderer_default, { content: selected.md }, selected.id) : /* @__PURE__ */ jsx4("div", { className: "nr-guide__empty", children: "Selecciona una directiva de la lista." }) })
|
|
12996
|
+
] })
|
|
12994
12997
|
] })
|
|
12995
|
-
] })
|
|
12996
|
-
|
|
12998
|
+
] }),
|
|
12999
|
+
document.body
|
|
13000
|
+
);
|
|
12997
13001
|
};
|
|
12998
13002
|
var Guide_default = Guide;
|
|
12999
13003
|
|