@geenius/docs 0.8.10 → 0.11.0

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.
Files changed (33) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/package.json +32 -20
  3. package/packages/convex/dist/index.d.ts +4 -4
  4. package/packages/convex/dist/index.js.map +1 -1
  5. package/packages/react/dist/index.css +2 -0
  6. package/packages/react/dist/index.css.map +1 -0
  7. package/packages/react/dist/index.d.ts +67 -49
  8. package/packages/react/dist/index.js +267 -172
  9. package/packages/react/dist/index.js.map +1 -1
  10. package/packages/react-css/dist/index.css +30 -18
  11. package/packages/react-css/dist/index.css.map +1 -1
  12. package/packages/react-css/dist/index.d.ts +68 -33
  13. package/packages/react-css/dist/index.js +61 -38
  14. package/packages/react-css/dist/index.js.map +1 -1
  15. package/packages/shared/dist/{chunk-BR2XBF64.js → chunk-QKKVTCRJ.js} +2 -2
  16. package/packages/shared/dist/{chunk-BR2XBF64.js.map → chunk-QKKVTCRJ.js.map} +1 -1
  17. package/packages/shared/dist/index.d.ts +55 -10
  18. package/packages/shared/dist/index.js +52 -6
  19. package/packages/shared/dist/index.js.map +1 -1
  20. package/packages/shared/dist/providers.d.ts +4 -4
  21. package/packages/shared/dist/providers.js +1 -1
  22. package/packages/shared/dist/providers.js.map +1 -1
  23. package/packages/shared/dist/{types-n-Ryn258.d.ts → types-D8ITXVwj.d.ts} +1 -1
  24. package/packages/solidjs/dist/index.css +2 -0
  25. package/packages/solidjs/dist/index.css.map +1 -0
  26. package/packages/solidjs/dist/index.d.ts +57 -27
  27. package/packages/solidjs/dist/index.js +231 -154
  28. package/packages/solidjs/dist/index.js.map +1 -1
  29. package/packages/solidjs-css/dist/index.css +30 -18
  30. package/packages/solidjs-css/dist/index.css.map +1 -1
  31. package/packages/solidjs-css/dist/index.d.ts +55 -20
  32. package/packages/solidjs-css/dist/index.js +34 -25
  33. package/packages/solidjs-css/dist/index.js.map +1 -1
@@ -1,18 +1,19 @@
1
1
  import { For, Show, createSignal, createUniqueId, createMemo, createEffect, children, onCleanup } from 'solid-js';
2
- import clsx from 'clsx';
3
2
  import { jsx, jsxs, Fragment } from 'solid-js/h/jsx-runtime';
4
3
  import remarkGfm from 'remark-gfm';
5
4
  import { SolidMarkdown } from 'solid-markdown';
6
5
 
7
6
  // src/components/Breadcrumbs.tsx
8
- function cx(...values) {
9
- return clsx(...values);
7
+
8
+ // src/lib/cx.ts
9
+ function cx(...classes) {
10
+ return classes.filter(Boolean).join(" ");
10
11
  }
11
12
  function Breadcrumbs(props) {
12
13
  if (props.items.length === 0) {
13
14
  return null;
14
15
  }
15
- return /* @__PURE__ */ jsx("nav", { class: "docs__breadcrumbs", "aria-label": "Breadcrumb", children: /* @__PURE__ */ jsx(For, { each: props.items, children: (item, index) => /* @__PURE__ */ jsxs(Fragment, { children: [
16
+ return /* @__PURE__ */ jsx("nav", { class: cx("docs__breadcrumbs", props.class), "aria-label": "Breadcrumb", children: /* @__PURE__ */ jsx(For, { each: props.items, children: (item, index) => /* @__PURE__ */ jsxs(Fragment, { children: [
16
17
  /* @__PURE__ */ jsx(Show, { when: index() > 0, children: /* @__PURE__ */ jsx(
17
18
  "svg",
18
19
  {
@@ -41,7 +42,7 @@ function Breadcrumbs(props) {
41
42
  ] }) }) });
42
43
  }
43
44
 
44
- // ../shared/dist/chunk-BR2XBF64.js
45
+ // ../shared/dist/chunk-QKKVTCRJ.js
45
46
  function toTocLevel(level) {
46
47
  if (level === 2 || level === 3 || level === 4) {
47
48
  return level;
@@ -206,7 +207,7 @@ function createHeading(Tag, className) {
206
207
  };
207
208
  }
208
209
  function DocPage(props) {
209
- return /* @__PURE__ */ jsx("article", { class: "docs__article", children: /* @__PURE__ */ jsx("div", { class: "docs__article-body docs__content-main", children: /* @__PURE__ */ jsx(
210
+ return /* @__PURE__ */ jsx("article", { class: cx("docs__article", props.class), children: /* @__PURE__ */ jsx("div", { class: "docs__article-body docs__content-main", children: /* @__PURE__ */ jsx(
210
211
  SolidMarkdown,
211
212
  {
212
213
  remarkPlugins: [remarkGfm],
@@ -290,7 +291,7 @@ function DocSearch(props) {
290
291
  if (!props.isOpen) {
291
292
  return null;
292
293
  }
293
- return /* @__PURE__ */ jsxs("div", { class: "docs__search-modal", children: [
294
+ return /* @__PURE__ */ jsxs("div", { class: cx("docs__search-modal", props.class), children: [
294
295
  /* @__PURE__ */ jsx(
295
296
  "button",
296
297
  {
@@ -490,10 +491,17 @@ function DocSidebar(props) {
490
491
  }
491
492
  );
492
493
  };
493
- return /* @__PURE__ */ jsxs("nav", { class: "docs__sidebar-nav", "aria-label": "Documentation", children: [
494
- /* @__PURE__ */ jsx("div", { class: "docs__sidebar-header", children: "Documentation" }),
495
- topLevelSections().map((section) => renderSection(section))
496
- ] });
494
+ return /* @__PURE__ */ jsxs(
495
+ "nav",
496
+ {
497
+ class: cx("docs__sidebar-nav", props.class),
498
+ "aria-label": "Documentation",
499
+ children: [
500
+ /* @__PURE__ */ jsx("div", { class: "docs__sidebar-header", children: "Documentation" }),
501
+ topLevelSections().map((section) => renderSection(section))
502
+ ]
503
+ }
504
+ );
497
505
  }
498
506
  function TocEntry(props) {
499
507
  const depth = props.depth ?? 0;
@@ -518,14 +526,14 @@ function TableOfContents(props) {
518
526
  if (props.toc.length === 0) {
519
527
  return null;
520
528
  }
521
- return /* @__PURE__ */ jsxs("nav", { class: "docs__toc", "aria-label": "On this page", children: [
529
+ return /* @__PURE__ */ jsxs("nav", { class: cx("docs__toc", props.class), "aria-label": "On this page", children: [
522
530
  /* @__PURE__ */ jsx("h2", { class: "docs__toc-title", children: "On this page" }),
523
531
  /* @__PURE__ */ jsx("div", { class: "docs__toc-list", children: /* @__PURE__ */ jsx(For, { each: props.toc, children: (item) => /* @__PURE__ */ jsx(TocEntry, { item, activeId: props.activeId }) }) })
524
532
  ] });
525
533
  }
526
534
  function DocsLayout(props) {
527
535
  const resolvedChildren = children(() => props.children);
528
- return /* @__PURE__ */ jsxs("div", { class: "docs__layout", children: [
536
+ return /* @__PURE__ */ jsxs("div", { class: cx("docs__layout", props.class), children: [
529
537
  /* @__PURE__ */ jsx("aside", { class: "docs__sidebar", children: /* @__PURE__ */ jsx(
530
538
  DocSidebar,
531
539
  {
@@ -554,7 +562,7 @@ function EditButton(props) {
554
562
  href,
555
563
  target: "_blank",
556
564
  rel: "noreferrer noopener",
557
- class: "docs__edit-link",
565
+ class: cx("docs__edit-link", props.class),
558
566
  children: [
559
567
  /* @__PURE__ */ jsx("svg", { "aria-hidden": "true", viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", width: "14", height: "14", children: /* @__PURE__ */ jsx(
560
568
  "path",
@@ -573,7 +581,7 @@ function PageNavigation(props) {
573
581
  if (!props.prev && !props.next) {
574
582
  return null;
575
583
  }
576
- return /* @__PURE__ */ jsxs("nav", { class: "docs__page-nav", "aria-label": "Page navigation", children: [
584
+ return /* @__PURE__ */ jsxs("nav", { class: cx("docs__page-nav", props.class), "aria-label": "Page navigation", children: [
577
585
  props.prev ? /* @__PURE__ */ jsxs("a", { href: props.prev.href, class: "docs__page-nav-prev", children: [
578
586
  /* @__PURE__ */ jsx("span", { class: "docs__page-nav-label", children: "Previous" }),
579
587
  /* @__PURE__ */ jsx("span", { class: "docs__page-nav-title", children: props.prev.title })
@@ -588,7 +596,7 @@ function VersionSelector(props) {
588
596
  if (props.versions.length <= 1) {
589
597
  return null;
590
598
  }
591
- return /* @__PURE__ */ jsx("div", { class: "docs__version-selector", children: /* @__PURE__ */ jsx(
599
+ return /* @__PURE__ */ jsx("div", { class: cx("docs__version-selector", props.class), children: /* @__PURE__ */ jsx(
592
600
  "select",
593
601
  {
594
602
  class: "docs__version-select docs__version-select--active",
@@ -641,11 +649,11 @@ function DocSearchPage(props) {
641
649
  return searchDocs(query, index);
642
650
  });
643
651
  if (props.tree() === void 0) {
644
- return /* @__PURE__ */ jsx("div", { class: "docs__empty", style: { "min-height": "100vh" }, children: /* @__PURE__ */ jsx("div", { class: "docs__skeleton", style: { width: "24rem", height: "3rem" } }) });
652
+ return /* @__PURE__ */ jsx("div", { class: cx("docs__empty", props.class), style: { "min-height": "100vh" }, children: /* @__PURE__ */ jsx("div", { class: "docs__skeleton", style: { width: "24rem", height: "3rem" } }) });
645
653
  }
646
654
  const sections = props.tree() ?? [];
647
655
  const flatPages = sections.flatMap((section) => section.pages ?? []);
648
- return /* @__PURE__ */ jsx("div", { class: "docs__main", children: /* @__PURE__ */ jsx("div", { class: "docs__content", children: /* @__PURE__ */ jsxs("div", { class: "docs__content-inner", style: { display: "block" }, children: [
656
+ return /* @__PURE__ */ jsx("div", { class: cx("docs__main", props.class), children: /* @__PURE__ */ jsx("div", { class: "docs__content", children: /* @__PURE__ */ jsxs("div", { class: "docs__content-inner", style: { display: "block" }, children: [
649
657
  /* @__PURE__ */ jsx("header", { class: "docs__header", children: /* @__PURE__ */ jsx("h1", { class: "docs__title", children: "Search documentation" }) }),
650
658
  /* @__PURE__ */ jsxs("div", { class: "docs__search-page", children: [
651
659
  /* @__PURE__ */ jsx(
@@ -745,9 +753,9 @@ function DocsAdminPage(props) {
745
753
  () => pageForm().title.trim().length > 0 && pageForm().slug.trim().length > 0 && pageForm().content.trim().length > 0
746
754
  );
747
755
  if (props.tree() === void 0) {
748
- return /* @__PURE__ */ jsx("div", { class: "docs__empty", style: { "min-height": "100vh" }, children: /* @__PURE__ */ jsx("div", { class: "docs__skeleton", style: { width: "24rem", height: "3rem" } }) });
756
+ return /* @__PURE__ */ jsx("div", { class: cx("docs__empty", props.class), style: { "min-height": "100vh" }, children: /* @__PURE__ */ jsx("div", { class: "docs__skeleton", style: { width: "24rem", height: "3rem" } }) });
749
757
  }
750
- return /* @__PURE__ */ jsx("div", { class: "docs__main", children: /* @__PURE__ */ jsx("div", { class: "docs__content", children: /* @__PURE__ */ jsxs("div", { class: "docs__content-inner", style: { display: "block" }, children: [
758
+ return /* @__PURE__ */ jsx("div", { class: cx("docs__main", props.class), children: /* @__PURE__ */ jsx("div", { class: "docs__content", children: /* @__PURE__ */ jsxs("div", { class: "docs__content-inner", style: { display: "block" }, children: [
751
759
  /* @__PURE__ */ jsx("header", { class: "docs__header", children: /* @__PURE__ */ jsx("h1", { class: "docs__title", children: "Docs admin" }) }),
752
760
  /* @__PURE__ */ jsxs("div", { class: "docs__admin-grid", children: [
753
761
  /* @__PURE__ */ jsxs("section", { class: "docs__admin-panel", children: [
@@ -1134,16 +1142,16 @@ function DocsIndexPage(props) {
1134
1142
  onCleanup(() => document.removeEventListener("keydown", handleKeydown));
1135
1143
  });
1136
1144
  if (docs.isLoading()) {
1137
- return /* @__PURE__ */ jsx("div", { class: "docs__empty", style: { "min-height": "100vh" }, children: /* @__PURE__ */ jsx("div", { class: "docs__skeleton", style: { width: "24rem", height: "3rem" } }) });
1145
+ return /* @__PURE__ */ jsx("div", { class: cx("docs__empty", props.class), style: { "min-height": "100vh" }, children: /* @__PURE__ */ jsx("div", { class: "docs__skeleton", style: { width: "24rem", height: "3rem" } }) });
1138
1146
  }
1139
1147
  if (docs.sections().length === 0) {
1140
- return /* @__PURE__ */ jsxs("div", { class: "docs__empty", style: { "min-height": "100vh" }, children: [
1148
+ return /* @__PURE__ */ jsxs("div", { class: cx("docs__empty", props.class), style: { "min-height": "100vh" }, children: [
1141
1149
  /* @__PURE__ */ jsx("div", { class: "docs__empty-icon", "aria-hidden": "true", children: "\u{1F4DA}" }),
1142
1150
  /* @__PURE__ */ jsx("div", { class: "docs__empty-title", children: "No documentation yet" }),
1143
1151
  /* @__PURE__ */ jsx("div", { class: "docs__empty-desc", children: "Create a section and at least one page to populate the docs index." })
1144
1152
  ] });
1145
1153
  }
1146
- return /* @__PURE__ */ jsxs("div", { class: "docs__main", children: [
1154
+ return /* @__PURE__ */ jsxs("div", { class: cx("docs__main", props.class), children: [
1147
1155
  /* @__PURE__ */ jsx("div", { class: "docs__content", children: /* @__PURE__ */ jsxs("div", { class: "docs__content-inner", style: { display: "block" }, children: [
1148
1156
  /* @__PURE__ */ jsxs("header", { class: "docs__header", children: [
1149
1157
  /* @__PURE__ */ jsx("h1", { class: "docs__title", children: "Documentation" }),
@@ -1348,11 +1356,11 @@ function DocViewPage(props) {
1348
1356
  };
1349
1357
  });
1350
1358
  if (docs.isLoading() || props.page() === void 0) {
1351
- return /* @__PURE__ */ jsx("div", { class: "docs__empty", style: { "min-height": "100vh" }, children: /* @__PURE__ */ jsx("div", { class: "docs__skeleton", style: { width: "24rem", height: "3rem" } }) });
1359
+ return /* @__PURE__ */ jsx("div", { class: cx("docs__empty", props.class), style: { "min-height": "100vh" }, children: /* @__PURE__ */ jsx("div", { class: "docs__skeleton", style: { width: "24rem", height: "3rem" } }) });
1352
1360
  }
1353
1361
  const page = props.page();
1354
1362
  if (!page) {
1355
- return /* @__PURE__ */ jsxs("div", { class: "docs__empty", style: { "min-height": "100vh" }, children: [
1363
+ return /* @__PURE__ */ jsxs("div", { class: cx("docs__empty", props.class), style: { "min-height": "100vh" }, children: [
1356
1364
  /* @__PURE__ */ jsx("div", { class: "docs__empty-icon", "aria-hidden": "true", children: "\u{1F50D}" }),
1357
1365
  /* @__PURE__ */ jsx("div", { class: "docs__empty-title", children: "Page not found" }),
1358
1366
  /* @__PURE__ */ jsx("div", { class: "docs__empty-desc", children: "The requested documentation page could not be resolved." })
@@ -1367,6 +1375,7 @@ function DocViewPage(props) {
1367
1375
  breadcrumbs: breadcrumbs(),
1368
1376
  currentPageId: page.id,
1369
1377
  onNavigate: props.onNavigate,
1378
+ class: props.class,
1370
1379
  children: [
1371
1380
  /* @__PURE__ */ jsxs("header", { class: "docs__page-header", children: [
1372
1381
  /* @__PURE__ */ jsx("h1", { class: "docs__page-title", children: page.title }),