@umami/shiso 0.8.0 → 0.10.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.
package/dist/index.css CHANGED
@@ -1,6 +1,6 @@
1
- /* virtual-css:css:32abd77818c5161a011a843897f34903 */
2
- /* virtual-css:css:2dd9c1a25bf05a14c9a7ab7ce1da6aef */
3
- .CodeBlock_container__ZTkxY {
1
+ /* virtual-css:css:0292bafad22c4cab436655610801c589 */
2
+ /* virtual-css:css:85717ba9ea360d365e3f29144820b208 */
3
+ .CodeBlock_container__YmFmN {
4
4
  position: relative;
5
5
  background: var(--base-color-900);
6
6
  padding: var(--spacing-5);
@@ -8,14 +8,14 @@
8
8
  white-space: pre-wrap;
9
9
  word-wrap: break-word;
10
10
  }
11
- pre.CodeBlock_container__ZTkxY code {
11
+ pre.CodeBlock_container__YmFmN code {
12
12
  font-family: var(--font-family-code);
13
13
  color: var(--base-color-300);
14
14
  padding: 0;
15
15
  border: 0;
16
16
  background: transparent;
17
17
  }
18
- .CodeBlock_button__MmZkO {
18
+ .CodeBlock_button__NDg0Y {
19
19
  border: 0;
20
20
  position: absolute;
21
21
  right: var(--spacing-5);
@@ -23,132 +23,132 @@ pre.CodeBlock_container__ZTkxY code {
23
23
  cursor: pointer;
24
24
  background: transparent;
25
25
  }
26
- .CodeBlock_copy__M2I0N {
26
+ .CodeBlock_copy__MmQzM {
27
27
  color: var(--base-color-300);
28
28
  }
29
- .CodeBlock_copy__M2I0N:hover {
29
+ .CodeBlock_copy__MmQzM:hover {
30
30
  color: var(--base-color-50);
31
31
  }
32
- .CodeBlock_check__MjkzY {
32
+ .CodeBlock_check__YmI0Z {
33
33
  color: var(--success-color);
34
34
  }
35
35
 
36
- /* virtual-css:css:e01d9571088b882a03b91eb2755da783 */
37
- .PageLinks_title__NTM5N {
36
+ /* virtual-css:css:0ed498f49b21d225f1b5a4e1685cf2e5 */
37
+ .PageLinks_title__ZjdiN {
38
38
  position: sticky;
39
39
  top: 0;
40
40
  }
41
- .PageLinks_links__ODg1Z {
41
+ .PageLinks_links__ZDkyY {
42
42
  position: sticky;
43
43
  top: 30px;
44
44
  height: max-content;
45
45
  }
46
- .PageLinks_links__ODg1Z a {
46
+ .PageLinks_links__ZDkyY a {
47
47
  display: block;
48
48
  color: var(--font-muted-color);
49
49
  text-wrap: nowrap;
50
50
  text-decoration: none;
51
51
  }
52
- .PageLinks_links__ODg1Z a:hover {
52
+ .PageLinks_links__ZDkyY a:hover {
53
53
  color: var(--primary-color);
54
54
  }
55
- .PageLinks_indent-1__OGVmN {
55
+ .PageLinks_indent-1__ZDkwN {
56
56
  margin-left: 0;
57
57
  }
58
- .PageLinks_indent-2__YTFmN {
58
+ .PageLinks_indent-2__ZmY5M {
59
59
  margin-left: 0;
60
60
  }
61
- .PageLinks_indent-3__OTI0Y {
61
+ .PageLinks_indent-3__NjBhN {
62
62
  margin-left: 10px;
63
63
  }
64
- .PageLinks_indent-4__NzhkM {
64
+ .PageLinks_indent-4__YzBiZ {
65
65
  margin-left: 20px;
66
66
  }
67
- .PageLinks_indent-5__ZGViZ {
67
+ .PageLinks_indent-5__YmEzY {
68
68
  margin-left: 30px;
69
69
  }
70
- .PageLinks_indent-6__YjVkN {
70
+ .PageLinks_indent-6__ZDUzZ {
71
71
  margin-left: 40px;
72
72
  }
73
- a.PageLinks_selected__YzEyZ {
73
+ a.PageLinks_selected__MGE5N {
74
74
  color: var(--primary-color);
75
75
  }
76
76
 
77
- /* virtual-css:css:62c31e195181c97259fa56b13d20ea6d */
78
- .SideNav_nav__MDc0N {
77
+ /* virtual-css:css:72ce2cfbba7b635b2ff1a5f4f5eeabf3 */
78
+ .SideNav_nav__YzJiZ {
79
79
  position: sticky;
80
80
  top: 30px;
81
81
  height: max-content;
82
82
  }
83
- .SideNav_nav__MDc0N .SideNav_item__NDJkN {
83
+ .SideNav_nav__YzJiZ .SideNav_item__ZTcyN {
84
84
  color: var(--font-muted-color);
85
85
  padding: 0;
86
86
  border-radius: 0;
87
87
  border-left: var(--border-size-1) solid var(--border-color);
88
88
  }
89
- .SideNav_nav__MDc0N .SideNav_item__NDJkN a {
89
+ .SideNav_nav__YzJiZ .SideNav_item__ZTcyN a {
90
90
  color: currentColor;
91
91
  width: 100%;
92
92
  padding: var(--padding-y) var(--padding-x);
93
93
  text-decoration: none;
94
94
  }
95
- .SideNav_nav__MDc0N .SideNav_item__NDJkN a:hover {
95
+ .SideNav_nav__YzJiZ .SideNav_item__ZTcyN a:hover {
96
96
  color: var(--primary-color);
97
97
  }
98
- .SideNav_nav__MDc0N .SideNav_item__NDJkN.SideNav_selected__ZThhN {
98
+ .SideNav_nav__YzJiZ .SideNav_item__ZTcyN.SideNav_selected__ZGM5M {
99
99
  color: var(--font-color);
100
100
  border-color: var(--primary-color);
101
101
  }
102
- .SideNav_items__NzRlZ header {
102
+ .SideNav_items__ODg2Y header {
103
103
  padding: var(--padding-y) 0;
104
104
  }
105
105
 
106
- /* virtual-css:css:71a58b2dae0a60276640236977b24d42 */
107
- .ContentArea_content__MWQ1Z {
106
+ /* virtual-css:css:7938c95522eda3e1f8244364ad70b38c */
107
+ .ContentArea_content__Y2RmY {
108
108
  font-size: 16px;
109
109
  margin-bottom: 60px;
110
110
  }
111
- .ContentArea_content__MWQ1Z > p {
111
+ .ContentArea_content__Y2RmY > p {
112
112
  color: var(--font-muted-color);
113
113
  line-height: 1.8;
114
114
  }
115
- .ContentArea_content__MWQ1Z a {
115
+ .ContentArea_content__Y2RmY a {
116
116
  color: var(--font-color);
117
117
  font-weight: 600;
118
118
  text-decoration: underline var(--font-faded-color);
119
119
  text-underline-offset: 4px;
120
120
  }
121
- .ContentArea_content__MWQ1Z a:hover {
121
+ .ContentArea_content__Y2RmY a:hover {
122
122
  text-decoration: underline var(--font-color);
123
123
  }
124
- .ContentArea_content__MWQ1Z h1 {
124
+ .ContentArea_content__Y2RmY h1 {
125
125
  font-size: var(--font-size-8);
126
126
  letter-spacing: var(--letter-spacing-1);
127
127
  margin: 0 0 var(--spacing-4) 0;
128
128
  }
129
- .ContentArea_content__MWQ1Z h2 {
129
+ .ContentArea_content__Y2RmY h2 {
130
130
  font-size: var(--font-size-6);
131
131
  letter-spacing: var(--letter-spacing-1);
132
132
  margin: var(--spacing-8) 0 var(--spacing-4) 0;
133
133
  }
134
- .ContentArea_content__MWQ1Z h3 {
134
+ .ContentArea_content__Y2RmY h3 {
135
135
  font-size: var(--font-size-5);
136
136
  letter-spacing: var(--letter-spacing-1);
137
137
  margin: var(--spacing-7) 0 var(--spacing-4) 0;
138
138
  }
139
- .ContentArea_content__MWQ1Z ul {
139
+ .ContentArea_content__Y2RmY ul {
140
140
  list-style: disc;
141
141
  }
142
- .ContentArea_content__MWQ1Z ol {
142
+ .ContentArea_content__Y2RmY ol {
143
143
  list-style: decimal;
144
144
  }
145
- .ContentArea_content__MWQ1Z pre {
145
+ .ContentArea_content__Y2RmY pre {
146
146
  margin: var(--spacing-5) 0;
147
147
  }
148
- .ContentArea_content__MWQ1Z code {
148
+ .ContentArea_content__Y2RmY code {
149
149
  font-size: 14px;
150
150
  }
151
- .ContentArea_content__MWQ1Z code:not([class]) {
151
+ .ContentArea_content__Y2RmY code:not([class]) {
152
152
  font-family: var(--font-family-code);
153
153
  color: var(--font-color);
154
154
  padding: var(--spacing-1);
package/dist/index.d.ts CHANGED
@@ -1,54 +1,54 @@
1
- // Generated by dts-bundle v0.7.3
2
- // Dependencies for this module:
3
- // ../../react
4
-
5
- declare module '@umami/shiso' {
6
- import '@umami/react-zen/dist/styles.css';
7
- import { Blog } from '@umami/shiso/Blog';
8
- import { Docs } from '@umami/shiso/Docs';
9
- import { Shiso } from '@umami/shiso/Shiso';
10
- export { Blog, Docs, Shiso };
11
- }
12
-
13
- declare module '@umami/shiso/Blog' {
14
- export interface BlogProps {
15
- content: any;
16
- config: any;
17
- }
18
- export function Blog({ content }: BlogProps): import("react").JSX.Element;
19
- }
20
-
21
- declare module '@umami/shiso/Docs' {
22
- export function Docs(): import("react").JSX.Element;
23
- }
24
-
25
- declare module '@umami/shiso/Shiso' {
26
- import { JSX } from 'react';
27
- export interface ShisoConfig {
28
- contentDir: string;
29
- docs?: {
30
- [key: string]: any;
31
- };
32
- blog?: {
33
- [key: string]: any;
34
- };
35
- }
36
- export interface ShisoProps {
37
- content: any;
38
- type: string;
39
- config: ShisoConfig;
40
- components?: {
41
- [key: string]: any;
42
- };
43
- templates?: {
44
- [key: string]: any;
45
- };
46
- }
47
- export type ShisoTemplateComponent = ({ content, config, }: {
48
- content: any;
49
- config: ShisoConfig;
50
- }) => JSX.Element;
51
- export const ShisoContext: import("react").Context<any>;
52
- export function Shiso({ content, type, config, components, templates }: ShisoProps): JSX.Element;
53
- }
54
-
1
+ // Generated by dts-bundle v0.7.3
2
+ // Dependencies for this module:
3
+ // ../../react
4
+
5
+ declare module '@umami/shiso' {
6
+ import '@umami/react-zen/dist/styles.css';
7
+ import { Blog } from '@umami/shiso/Blog';
8
+ import { Docs } from '@umami/shiso/Docs';
9
+ import { Shiso } from '@umami/shiso/Shiso';
10
+ export { Blog, Docs, Shiso };
11
+ }
12
+
13
+ declare module '@umami/shiso/Blog' {
14
+ export interface BlogProps {
15
+ content: any;
16
+ config: any;
17
+ }
18
+ export function Blog({ content }: BlogProps): import("react").JSX.Element;
19
+ }
20
+
21
+ declare module '@umami/shiso/Docs' {
22
+ export function Docs(): import("react").JSX.Element;
23
+ }
24
+
25
+ declare module '@umami/shiso/Shiso' {
26
+ import { JSX } from 'react';
27
+ export interface ShisoConfig {
28
+ contentDir: string;
29
+ docs?: {
30
+ [key: string]: any;
31
+ };
32
+ blog?: {
33
+ [key: string]: any;
34
+ };
35
+ }
36
+ export interface ShisoProps {
37
+ content: any;
38
+ type: string;
39
+ config: ShisoConfig;
40
+ components?: {
41
+ [key: string]: any;
42
+ };
43
+ templates?: {
44
+ [key: string]: any;
45
+ };
46
+ }
47
+ export type ShisoTemplateComponent = ({ content, config, }: {
48
+ content: any;
49
+ config: ShisoConfig;
50
+ }) => JSX.Element;
51
+ export const ShisoContext: import("react").Context<any>;
52
+ export function Shiso({ content, type, config, components, templates }: ShisoProps): JSX.Element;
53
+ }
54
+
package/dist/index.js CHANGED
@@ -38,7 +38,7 @@ __export(index_exports, {
38
38
  module.exports = __toCommonJS(index_exports);
39
39
  var import_styles = require("@umami/react-zen/dist/styles.css");
40
40
 
41
- // css-modules:E:\dev\umami-shiso\src\components\Blog.module.css
41
+ // css-modules:/Users/mikecao/Development/umami-software/shiso/src/components/Blog.module.css
42
42
  var Blog_default = {};
43
43
 
44
44
  // src/components/Markdown.tsx
@@ -47,22 +47,25 @@ var import_react = require("@mdx-js/react");
47
47
  var runtime = __toESM(require("react/jsx-runtime"));
48
48
  var import_jsx_runtime = require("react/jsx-runtime");
49
49
  var import_meta = {};
50
- var compileMDX = (code) => {
50
+ var parseMdx = (code) => {
51
51
  try {
52
- const { default: Component } = (0, import_mdx.runSync)(code, {
52
+ const result = (0, import_mdx.runSync)(code, {
53
53
  ...runtime,
54
54
  baseUrl: import_meta.url
55
55
  });
56
- return { Component };
57
- } catch (error) {
58
- return { error };
56
+ return { Component: result.default };
57
+ } catch (err) {
58
+ return { error: err.message };
59
59
  }
60
60
  };
61
61
  function Markdown({ content }) {
62
62
  const components = (0, import_react.useMDXComponents)();
63
- const { Component, error } = compileMDX(content.code);
63
+ const { Component, error } = parseMdx(content.code);
64
64
  if (error) {
65
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h1", { children: `Error rendering MDX: ${error}` });
65
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("h1", { children: [
66
+ "Error rendering MDX: ",
67
+ error
68
+ ] });
66
69
  }
67
70
  if (!Component) {
68
71
  return null;
@@ -94,8 +97,8 @@ var import_react4 = require("@mdx-js/react");
94
97
  var import_react2 = require("react");
95
98
  var import_react_zen = require("@umami/react-zen");
96
99
 
97
- // css-modules:E:\dev\umami-shiso\src\components\CodeBlock.module.css
98
- var CodeBlock_default = { "container": "CodeBlock_container__ZTkxY", "button": "CodeBlock_button__MmZkO", "copy": "CodeBlock_copy__M2I0N", "check": "CodeBlock_check__MjkzY" };
100
+ // css-modules:/Users/mikecao/Development/umami-software/shiso/src/components/CodeBlock.module.css
101
+ var CodeBlock_default = { "container": "CodeBlock_container__YmFmN", "button": "CodeBlock_button__NDg0Y", "copy": "CodeBlock_copy__MmQzM", "check": "CodeBlock_check__YmI0Z" };
99
102
 
100
103
  // src/components/CodeBlock.tsx
101
104
  var import_jsx_runtime3 = require("react/jsx-runtime");
@@ -125,7 +128,7 @@ var ShisoContext = (0, import_react3.createContext)(null);
125
128
  function Shiso({ content, type, config, components, templates }) {
126
129
  const Component = { ...defaultTemplates, ...templates }[type];
127
130
  if (!Component) {
128
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("h1", { children: `Component not found: ${type}` });
131
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("h1", { children: `Component not found for type: ${type}` });
129
132
  }
130
133
  return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(ShisoContext.Provider, { value: { content, type, config }, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react4.MDXProvider, { components: { ...components, pre: CodeBlock }, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Component, { content, config }) }) });
131
134
  }
@@ -141,8 +144,8 @@ var import_react6 = require("react");
141
144
  var import_react_zen2 = require("@umami/react-zen");
142
145
  var import_classnames = __toESM(require("classnames"));
143
146
 
144
- // css-modules:E:\dev\umami-shiso\src\components\PageLinks.module.css
145
- var PageLinks_default = { "title": "PageLinks_title__NTM5N", "links": "PageLinks_links__ODg1Z", "indent-1": "PageLinks_indent-1__OGVmN", "indent-2": "PageLinks_indent-2__YTFmN", "indent-3": "PageLinks_indent-3__OTI0Y", "indent-4": "PageLinks_indent-4__NzhkM", "indent-5": "PageLinks_indent-5__ZGViZ", "indent-6": "PageLinks_indent-6__YjVkN", "selected": "PageLinks_selected__YzEyZ" };
147
+ // css-modules:/Users/mikecao/Development/umami-software/shiso/src/components/PageLinks.module.css
148
+ var PageLinks_default = { "title": "PageLinks_title__ZjdiN", "links": "PageLinks_links__ZDkyY", "indent-1": "PageLinks_indent-1__ZDkwN", "indent-2": "PageLinks_indent-2__ZmY5M", "indent-3": "PageLinks_indent-3__NjBhN", "indent-4": "PageLinks_indent-4__YzBiZ", "indent-5": "PageLinks_indent-5__YmEzY", "indent-6": "PageLinks_indent-6__ZDUzZ", "selected": "PageLinks_selected__MGE5N" };
146
149
 
147
150
  // src/components/PageLinks.tsx
148
151
  var import_jsx_runtime5 = require("react/jsx-runtime");
@@ -186,8 +189,8 @@ var import_classnames2 = __toESM(require("classnames"));
186
189
  var import_navigation = require("next/navigation");
187
190
  var import_link = __toESM(require("next/link"));
188
191
 
189
- // css-modules:E:\dev\umami-shiso\src\components\SideNav.module.css
190
- var SideNav_default = { "nav": "SideNav_nav__MDc0N", "item": "SideNav_item__NDJkN", "selected": "SideNav_selected__ZThhN", "items": "SideNav_items__NzRlZ" };
192
+ // css-modules:/Users/mikecao/Development/umami-software/shiso/src/components/SideNav.module.css
193
+ var SideNav_default = { "nav": "SideNav_nav__YzJiZ", "item": "SideNav_item__ZTcyN", "selected": "SideNav_selected__ZGM5M", "items": "SideNav_items__ODg2Y" };
191
194
 
192
195
  // src/components/SideNav.tsx
193
196
  var import_jsx_runtime6 = require("react/jsx-runtime");
@@ -228,8 +231,8 @@ function TopNav({ tabs }) {
228
231
  // src/components/ContentArea.tsx
229
232
  var import_react_zen5 = require("@umami/react-zen");
230
233
 
231
- // css-modules:E:\dev\umami-shiso\src\components\ContentArea.module.css
232
- var ContentArea_default = { "content": "ContentArea_content__MWQ1Z" };
234
+ // css-modules:/Users/mikecao/Development/umami-software/shiso/src/components/ContentArea.module.css
235
+ var ContentArea_default = { "content": "ContentArea_content__Y2RmY" };
233
236
 
234
237
  // src/components/ContentArea.tsx
235
238
  var import_jsx_runtime8 = require("react/jsx-runtime");
package/dist/index.mjs CHANGED
@@ -3,30 +3,33 @@
3
3
  // src/components/index.ts
4
4
  import "@umami/react-zen/dist/styles.css";
5
5
 
6
- // css-modules:E:\dev\umami-shiso\src\components\Blog.module.css
6
+ // css-modules:/Users/mikecao/Development/umami-software/shiso/src/components/Blog.module.css
7
7
  var Blog_default = {};
8
8
 
9
9
  // src/components/Markdown.tsx
10
10
  import { runSync } from "@mdx-js/mdx";
11
11
  import { useMDXComponents } from "@mdx-js/react";
12
12
  import * as runtime from "react/jsx-runtime";
13
- import { jsx } from "react/jsx-runtime";
14
- var compileMDX = (code) => {
13
+ import { jsx, jsxs } from "react/jsx-runtime";
14
+ var parseMdx = (code) => {
15
15
  try {
16
- const { default: Component } = runSync(code, {
16
+ const result = runSync(code, {
17
17
  ...runtime,
18
18
  baseUrl: import.meta.url
19
19
  });
20
- return { Component };
21
- } catch (error) {
22
- return { error };
20
+ return { Component: result.default };
21
+ } catch (err) {
22
+ return { error: err.message };
23
23
  }
24
24
  };
25
25
  function Markdown({ content }) {
26
26
  const components = useMDXComponents();
27
- const { Component, error } = compileMDX(content.code);
27
+ const { Component, error } = parseMdx(content.code);
28
28
  if (error) {
29
- return /* @__PURE__ */ jsx("h1", { children: `Error rendering MDX: ${error}` });
29
+ return /* @__PURE__ */ jsxs("h1", { children: [
30
+ "Error rendering MDX: ",
31
+ error
32
+ ] });
30
33
  }
31
34
  if (!Component) {
32
35
  return null;
@@ -35,9 +38,9 @@ function Markdown({ content }) {
35
38
  }
36
39
 
37
40
  // src/components/Blog.tsx
38
- import { jsx as jsx2, jsxs } from "react/jsx-runtime";
41
+ import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
39
42
  function Blog({ content }) {
40
- return /* @__PURE__ */ jsx2("div", { className: Blog_default.blog, children: /* @__PURE__ */ jsx2("div", { className: Blog_default.main, children: /* @__PURE__ */ jsxs("div", { className: Blog_default.content, children: [
43
+ return /* @__PURE__ */ jsx2("div", { className: Blog_default.blog, children: /* @__PURE__ */ jsx2("div", { className: Blog_default.main, children: /* @__PURE__ */ jsxs2("div", { className: Blog_default.content, children: [
41
44
  /* @__PURE__ */ jsx2("h1", { children: content?.meta?.title }),
42
45
  /* @__PURE__ */ jsx2("p", { className: Blog_default.description, children: content?.meta?.description }),
43
46
  /* @__PURE__ */ jsx2(Markdown, { content })
@@ -58,11 +61,11 @@ import { MDXProvider } from "@mdx-js/react";
58
61
  import { useState, useRef } from "react";
59
62
  import { Icon, Icons } from "@umami/react-zen";
60
63
 
61
- // css-modules:E:\dev\umami-shiso\src\components\CodeBlock.module.css
62
- var CodeBlock_default = { "container": "CodeBlock_container__ZTkxY", "button": "CodeBlock_button__MmZkO", "copy": "CodeBlock_copy__M2I0N", "check": "CodeBlock_check__MjkzY" };
64
+ // css-modules:/Users/mikecao/Development/umami-software/shiso/src/components/CodeBlock.module.css
65
+ var CodeBlock_default = { "container": "CodeBlock_container__YmFmN", "button": "CodeBlock_button__NDg0Y", "copy": "CodeBlock_copy__MmQzM", "check": "CodeBlock_check__YmI0Z" };
63
66
 
64
67
  // src/components/CodeBlock.tsx
65
- import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
68
+ import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
66
69
  function CodeBlock(props) {
67
70
  const textInput = useRef(null);
68
71
  const [copied, setCopied] = useState(false);
@@ -73,7 +76,7 @@ function CodeBlock(props) {
73
76
  setCopied(false);
74
77
  }, 1e3);
75
78
  };
76
- return /* @__PURE__ */ jsxs2("pre", { ref: textInput, className: CodeBlock_default.container, children: [
79
+ return /* @__PURE__ */ jsxs3("pre", { ref: textInput, className: CodeBlock_default.container, children: [
77
80
  props.children,
78
81
  /* @__PURE__ */ jsx3("button", { "aria-label": "Copy code", className: CodeBlock_default.button, onClick: handleCopy, children: /* @__PURE__ */ jsx3(Icon, { size: "sm", className: copied ? CodeBlock_default.check : CodeBlock_default.copy, children: copied ? /* @__PURE__ */ jsx3(Icons.Check, {}) : /* @__PURE__ */ jsx3(Icons.Copy, {}) }) })
79
82
  ] });
@@ -89,7 +92,7 @@ var ShisoContext = createContext(null);
89
92
  function Shiso({ content, type, config, components, templates }) {
90
93
  const Component = { ...defaultTemplates, ...templates }[type];
91
94
  if (!Component) {
92
- return /* @__PURE__ */ jsx4("h1", { children: `Component not found: ${type}` });
95
+ return /* @__PURE__ */ jsx4("h1", { children: `Component not found for type: ${type}` });
93
96
  }
94
97
  return /* @__PURE__ */ jsx4(ShisoContext.Provider, { value: { content, type, config }, children: /* @__PURE__ */ jsx4(MDXProvider, { components: { ...components, pre: CodeBlock }, children: /* @__PURE__ */ jsx4(Component, { content, config }) }) });
95
98
  }
@@ -105,11 +108,11 @@ import { useEffect, useState as useState2 } from "react";
105
108
  import { Column, Text } from "@umami/react-zen";
106
109
  import classNames from "classnames";
107
110
 
108
- // css-modules:E:\dev\umami-shiso\src\components\PageLinks.module.css
109
- var PageLinks_default = { "title": "PageLinks_title__NTM5N", "links": "PageLinks_links__ODg1Z", "indent-1": "PageLinks_indent-1__OGVmN", "indent-2": "PageLinks_indent-2__YTFmN", "indent-3": "PageLinks_indent-3__OTI0Y", "indent-4": "PageLinks_indent-4__NzhkM", "indent-5": "PageLinks_indent-5__ZGViZ", "indent-6": "PageLinks_indent-6__YjVkN", "selected": "PageLinks_selected__YzEyZ" };
111
+ // css-modules:/Users/mikecao/Development/umami-software/shiso/src/components/PageLinks.module.css
112
+ var PageLinks_default = { "title": "PageLinks_title__ZjdiN", "links": "PageLinks_links__ZDkyY", "indent-1": "PageLinks_indent-1__ZDkwN", "indent-2": "PageLinks_indent-2__ZmY5M", "indent-3": "PageLinks_indent-3__NjBhN", "indent-4": "PageLinks_indent-4__YzBiZ", "indent-5": "PageLinks_indent-5__YmEzY", "indent-6": "PageLinks_indent-6__ZDUzZ", "selected": "PageLinks_selected__MGE5N" };
110
113
 
111
114
  // src/components/PageLinks.tsx
112
- import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
115
+ import { jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
113
116
  function PageLinks({ items, offset = 0 }) {
114
117
  const [hash, setHash] = useState2(items?.[0]?.id);
115
118
  useEffect(() => {
@@ -128,7 +131,7 @@ function PageLinks({ items, offset = 0 }) {
128
131
  if (!items?.length) {
129
132
  return null;
130
133
  }
131
- return /* @__PURE__ */ jsxs3(Column, { gap: "3", minWidth: "240px", className: PageLinks_default.links, children: [
134
+ return /* @__PURE__ */ jsxs4(Column, { gap: "3", minWidth: "240px", className: PageLinks_default.links, children: [
132
135
  /* @__PURE__ */ jsx5(Text, { size: "2", weight: "bold", children: "On this page" }),
133
136
  items.map(({ name, id, size }) => {
134
137
  return /* @__PURE__ */ jsx5(
@@ -150,8 +153,8 @@ import classNames2 from "classnames";
150
153
  import { usePathname } from "next/navigation";
151
154
  import Link from "next/link";
152
155
 
153
- // css-modules:E:\dev\umami-shiso\src\components\SideNav.module.css
154
- var SideNav_default = { "nav": "SideNav_nav__MDc0N", "item": "SideNav_item__NDJkN", "selected": "SideNav_selected__ZThhN", "items": "SideNav_items__NzRlZ" };
156
+ // css-modules:/Users/mikecao/Development/umami-software/shiso/src/components/SideNav.module.css
157
+ var SideNav_default = { "nav": "SideNav_nav__YzJiZ", "item": "SideNav_item__ZTcyN", "selected": "SideNav_selected__ZGM5M", "items": "SideNav_items__ODg2Y" };
155
158
 
156
159
  // src/components/SideNav.tsx
157
160
  import { jsx as jsx6 } from "react/jsx-runtime";
@@ -192,13 +195,13 @@ function TopNav({ tabs }) {
192
195
  // src/components/ContentArea.tsx
193
196
  import { Heading, Box as Box2, Text as Text2 } from "@umami/react-zen";
194
197
 
195
- // css-modules:E:\dev\umami-shiso\src\components\ContentArea.module.css
196
- var ContentArea_default = { "content": "ContentArea_content__MWQ1Z" };
198
+ // css-modules:/Users/mikecao/Development/umami-software/shiso/src/components/ContentArea.module.css
199
+ var ContentArea_default = { "content": "ContentArea_content__Y2RmY" };
197
200
 
198
201
  // src/components/ContentArea.tsx
199
- import { jsx as jsx8, jsxs as jsxs4 } from "react/jsx-runtime";
202
+ import { jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
200
203
  function ContentArea({ content }) {
201
- return /* @__PURE__ */ jsxs4(Box2, { flexGrow: 1, children: [
204
+ return /* @__PURE__ */ jsxs5(Box2, { flexGrow: 1, children: [
202
205
  /* @__PURE__ */ jsx8(Text2, { color: "primary", weight: "bold", children: content.group }),
203
206
  /* @__PURE__ */ jsx8(Heading, { size: "8", as: "h1", children: content?.meta?.title }),
204
207
  /* @__PURE__ */ jsx8(Text2, { type: "muted", children: content?.meta?.description }),
@@ -207,7 +210,7 @@ function ContentArea({ content }) {
207
210
  }
208
211
 
209
212
  // src/components/Docs.tsx
210
- import { jsx as jsx9, jsxs as jsxs5 } from "react/jsx-runtime";
213
+ import { jsx as jsx9, jsxs as jsxs6 } from "react/jsx-runtime";
211
214
  function Docs() {
212
215
  const { content, config } = useShiso();
213
216
  if (!content) {
@@ -224,9 +227,9 @@ function Docs() {
224
227
  }
225
228
  return name;
226
229
  }, null);
227
- return /* @__PURE__ */ jsxs5(Box3, { flexGrow: "1", children: [
230
+ return /* @__PURE__ */ jsxs6(Box3, { flexGrow: "1", children: [
228
231
  tabs && /* @__PURE__ */ jsx9(TopNav, { tabs }),
229
- /* @__PURE__ */ jsxs5(Grid, { gap: "6", columns: "240px 1fr 240px", children: [
232
+ /* @__PURE__ */ jsxs6(Grid, { gap: "6", columns: "240px 1fr 240px", children: [
230
233
  /* @__PURE__ */ jsx9(SideNav, { tabs, navigation }),
231
234
  /* @__PURE__ */ jsx9(ContentArea, { content }),
232
235
  /* @__PURE__ */ jsx9(PageLinks, { items: content?.anchors, offset: 150 })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umami/shiso",
3
- "version": "0.8.0",
3
+ "version": "0.10.0",
4
4
  "description": "A content layer for Next.js",
5
5
  "homepage": "https://umami.is/shiso",
6
6
  "repository": {
package/server/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export declare const parseMdx: (file: string) => Promise<any>;
2
+ export declare function getContentIds(folder: string): Promise<any>;
2
3
  export declare function getContent(params: {
3
4
  id: string[];
4
5
  }, folder: string): Promise<any>;
package/server/index.js CHANGED
@@ -41,6 +41,7 @@ import rehypeHighlight from 'rehype-highlight';
41
41
  import matter from 'gray-matter';
42
42
  import fs from 'node:fs/promises';
43
43
  import path from 'node:path';
44
+ import recursive from 'recursive-readdir';
44
45
  export var parseMdx = cache(function (file) { return __awaiter(void 0, void 0, void 0, function () {
45
46
  var postContent, _a, frontmatter, mdxContent, id, anchors, modifiedContent, code, _b;
46
47
  return __generator(this, function (_c) {
@@ -83,6 +84,23 @@ export var parseMdx = cache(function (file) { return __awaiter(void 0, void 0, v
83
84
  }
84
85
  });
85
86
  }); });
87
+ export function getContentIds(folder) {
88
+ return __awaiter(this, void 0, void 0, function () {
89
+ var dir, files;
90
+ return __generator(this, function (_a) {
91
+ switch (_a.label) {
92
+ case 0:
93
+ dir = path.resolve(folder);
94
+ return [4 /*yield*/, recursive(dir)];
95
+ case 1:
96
+ files = _a.sent();
97
+ return [2 /*return*/, files.map(function (file) {
98
+ return file.replace('.mdx', '').replace(dir, '').replace(/\\/g, '/').replace(/^\//, '');
99
+ })];
100
+ }
101
+ });
102
+ });
103
+ }
86
104
  export function getContent(params, folder) {
87
105
  return __awaiter(this, void 0, void 0, function () {
88
106
  var _a, id, name;