@contractspec/example.in-app-docs 1.3.0 → 1.4.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.
@@ -1,5 +1,5 @@
1
1
  $ tsdown
2
- ℹ tsdown v0.19.0 powered by rolldown v1.0.0-beta.59
2
+ ℹ tsdown v0.20.3 powered by rolldown v1.0.0-rc.3
3
3
  ℹ config file: /home/runner/work/contractspec/contractspec/packages/examples/in-app-docs/tsdown.config.js
4
4
  ℹ entry: src/example.ts, src/index.ts, src/docs/in-app-docs.docblock.ts, src/docs/index.ts, src/ui/InAppDocsViewer.tsx, src/ui/index.ts
5
5
  ℹ target: esnext
@@ -7,22 +7,27 @@ $ tsdown
7
7
  ℹ Build start
8
8
  ℹ Cleaning 20 files
9
9
  ℹ dist/docs/in-app-docs.docblock.js 3.01 kB │ gzip: 1.44 kB
10
- ℹ dist/ui/InAppDocsViewer.js 1.93 kB │ gzip: 0.87 kB
11
- ℹ dist/example.js 1.33 kB │ gzip: 0.67 kB
12
- ℹ dist/index.js 0.24 kB │ gzip: 0.12 kB
13
- ℹ dist/ui/index.js 0.12 kB │ gzip: 0.08 kB
10
+ ℹ dist/ui/InAppDocsViewer.js 1.86 kB │ gzip: 0.85 kB
11
+ ℹ dist/example.js 1.29 kB │ gzip: 0.66 kB
12
+ ℹ dist/index.js 0.18 kB │ gzip: 0.11 kB
13
+ ℹ dist/ui/index.js 0.08 kB │ gzip: 0.07 kB
14
14
  ℹ dist/docs/index.js 0.04 kB │ gzip: 0.06 kB
15
15
  ℹ dist/docs/in-app-docs.docblock.js.map 3.60 kB │ gzip: 1.66 kB
16
- ℹ dist/ui/InAppDocsViewer.js.map 2.59 kB │ gzip: 1.20 kB
17
- ℹ dist/example.js.map 2.52 kB │ gzip: 1.16 kB
18
- ℹ dist/docs/in-app-docs.docblock.d.ts.map 0.17 kB │ gzip: 0.14 kB
19
- ℹ dist/ui/InAppDocsViewer.d.ts.map 0.17 kB │ gzip: 0.15 kB
20
- ℹ dist/example.d.ts.map 0.15 kB │ gzip: 0.14 kB
16
+ ℹ dist/ui/InAppDocsViewer.js.map 2.58 kB │ gzip: 1.19 kB
17
+ ℹ dist/example.js.map 2.51 kB │ gzip: 1.16 kB
18
+ ℹ dist/docs/in-app-docs.docblock.d.ts.map 0.16 kB │ gzip: 0.14 kB
19
+ ℹ dist/ui/InAppDocsViewer.d.ts.map 0.16 kB │ gzip: 0.14 kB
20
+ ℹ dist/example.d.ts.map 0.14 kB │ gzip: 0.14 kB
21
21
  ℹ dist/docs/in-app-docs.docblock.d.ts 0.56 kB │ gzip: 0.35 kB
22
22
  ℹ dist/example.d.ts 0.46 kB │ gzip: 0.28 kB
23
23
  ℹ dist/ui/InAppDocsViewer.d.ts 0.38 kB │ gzip: 0.25 kB
24
24
  ℹ dist/index.d.ts 0.18 kB │ gzip: 0.11 kB
25
25
  ℹ dist/ui/index.d.ts 0.08 kB │ gzip: 0.07 kB
26
26
  ℹ dist/docs/index.d.ts 0.04 kB │ gzip: 0.06 kB
27
- ℹ 18 files, total: 17.56 kB
28
- ✔ Build complete in 26396ms
27
+ ℹ 18 files, total: 17.29 kB
28
+ [PLUGIN_TIMINGS] Warning: Your build spent significant time in plugins. Here is a breakdown:
29
+ - tsdown:external (47%)
30
+ - rolldown-plugin-dts:generate (42%)
31
+ See https://rolldown.rs/options/checks#plugintimings for more details.
32
+
33
+ ✔ Build complete in 43911ms
@@ -1,31 +1,34 @@
1
-
2
- $ bun build:types && bun build:bundle
3
- $ tsc --noEmit
4
- $ tsdown
5
- ℹ tsdown v0.19.0 powered by rolldown v1.0.0-beta.59
6
- ℹ config file: /Users/tboutron/Documents/clients/lssm/monorepo-lssm/packages/contractspec/packages/examples/in-app-docs/tsdown.config.js (unrun)
7
- ℹ entry: src/example.ts, src/index.ts, src/docs/in-app-docs.docblock.ts, src/docs/index.ts, src/ui/InAppDocsViewer.tsx, src/ui/index.ts
8
- ℹ target: esnext
9
- ℹ tsconfig: tsconfig.json
10
- ℹ Build start
11
- ℹ Cleaning 20 files
12
- ℹ dist/docs/in-app-docs.docblock.js 3.01 kB │ gzip: 1.44 kB
13
- ℹ dist/ui/InAppDocsViewer.js 1.93 kB │ gzip: 0.87 kB
14
- ℹ dist/example.js 1.33 kB │ gzip: 0.67 kB
15
- ℹ dist/index.js 0.24 kB │ gzip: 0.12 kB
16
- ℹ dist/ui/index.js 0.12 kB │ gzip: 0.08 kB
17
- ℹ dist/docs/index.js 0.04 kB │ gzip: 0.06 kB
18
- ℹ dist/docs/in-app-docs.docblock.js.map 3.60 kB │ gzip: 1.66 kB
19
- ℹ dist/ui/InAppDocsViewer.js.map 2.59 kB │ gzip: 1.20 kB
20
- ℹ dist/example.js.map 2.52 kB │ gzip: 1.16 kB
21
- ℹ dist/docs/in-app-docs.docblock.d.ts.map 0.17 kB │ gzip: 0.14 kB
22
- ℹ dist/ui/InAppDocsViewer.d.ts.map 0.17 kB │ gzip: 0.15 kB
23
- ℹ dist/example.d.ts.map 0.15 kB │ gzip: 0.14 kB
24
- ℹ dist/docs/in-app-docs.docblock.d.ts 0.56 kB │ gzip: 0.35 kB
25
- ℹ dist/example.d.ts 0.46 kB │ gzip: 0.28 kB
26
- ℹ dist/ui/InAppDocsViewer.d.ts 0.38 kB │ gzip: 0.25 kB
27
- ℹ dist/index.d.ts 0.18 kB │ gzip: 0.11 kB
28
- ℹ dist/ui/index.d.ts 0.08 kB │ gzip: 0.07 kB
29
- ℹ dist/docs/index.d.ts 0.04 kB │ gzip: 0.06 kB
30
- ℹ 18 files, total: 17.56 kB
31
- ✔ Build complete in 12683ms
1
+ $ bun build:types && bun build:bundle
2
+ $ tsc --noEmit
3
+ $ tsdown
4
+ ℹ tsdown v0.20.3 powered by rolldown v1.0.0-rc.3
5
+ ℹ config file: /home/runner/work/contractspec/contractspec/packages/examples/in-app-docs/tsdown.config.js
6
+ ℹ entry: src/example.ts, src/index.ts, src/docs/in-app-docs.docblock.ts, src/docs/index.ts, src/ui/InAppDocsViewer.tsx, src/ui/index.ts
7
+ ℹ target: esnext
8
+ ℹ tsconfig: tsconfig.json
9
+ ℹ Build start
10
+ ℹ dist/docs/in-app-docs.docblock.js 3.01 kB │ gzip: 1.44 kB
11
+ ℹ dist/ui/InAppDocsViewer.js 1.86 kB │ gzip: 0.85 kB
12
+ ℹ dist/example.js 1.29 kB │ gzip: 0.66 kB
13
+ ℹ dist/index.js 0.18 kB │ gzip: 0.11 kB
14
+ ℹ dist/ui/index.js 0.08 kB │ gzip: 0.07 kB
15
+ ℹ dist/docs/index.js 0.04 kB │ gzip: 0.06 kB
16
+ ℹ dist/docs/in-app-docs.docblock.js.map 3.60 kB │ gzip: 1.66 kB
17
+ ℹ dist/ui/InAppDocsViewer.js.map 2.58 kB │ gzip: 1.19 kB
18
+ ℹ dist/example.js.map 2.51 kB │ gzip: 1.16 kB
19
+ ℹ dist/docs/in-app-docs.docblock.d.ts.map 0.16 kB │ gzip: 0.14 kB
20
+ ℹ dist/ui/InAppDocsViewer.d.ts.map 0.16 kB │ gzip: 0.14 kB
21
+ ℹ dist/example.d.ts.map 0.14 kB │ gzip: 0.14 kB
22
+ ℹ dist/docs/in-app-docs.docblock.d.ts 0.56 kB │ gzip: 0.35 kB
23
+ ℹ dist/example.d.ts 0.46 kB │ gzip: 0.28 kB
24
+ ℹ dist/ui/InAppDocsViewer.d.ts 0.38 kB │ gzip: 0.25 kB
25
+ ℹ dist/index.d.ts 0.18 kB │ gzip: 0.11 kB
26
+ ℹ dist/ui/index.d.ts 0.08 kB │ gzip: 0.07 kB
27
+ ℹ dist/docs/index.d.ts 0.04 kB │ gzip: 0.06 kB
28
+ ℹ 18 files, total: 17.29 kB
29
+ [PLUGIN_TIMINGS] Warning: Your build spent significant time in plugins. Here is a breakdown:
30
+ - tsdown:external (62%)
31
+ - rolldown-plugin-dts:generate (37%)
32
+ See https://rolldown.rs/options/checks#plugintimings for more details.
33
+
34
+ ✔ Build complete in 16035ms
package/CHANGELOG.md CHANGED
@@ -1,5 +1,31 @@
1
1
  # @contractspec/example.in-app-docs
2
2
 
3
+ ## 1.4.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 11a5a05: feat: improve product intent
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [8ecf3c1]
12
+ - Updated dependencies [47c48c2]
13
+ - Updated dependencies [a119963]
14
+ - Updated dependencies [4651e06]
15
+ - Updated dependencies [ad9d10a]
16
+ - Updated dependencies [11a5a05]
17
+ - @contractspec/lib.contracts@1.57.0
18
+ - @contractspec/lib.example-shared-ui@1.11.0
19
+
20
+ ## 1.3.1
21
+
22
+ ### Patch Changes
23
+
24
+ - fix: improve publish config
25
+ - Updated dependencies
26
+ - @contractspec/lib.example-shared-ui@1.10.1
27
+ - @contractspec/lib.contracts@1.56.1
28
+
3
29
  ## 1.3.0
4
30
 
5
31
  ### Minor Changes
@@ -1,7 +1,6 @@
1
1
  import { DocBlock } from "@contractspec/lib.contracts/docs";
2
2
 
3
3
  //#region src/docs/in-app-docs.docblock.d.ts
4
-
5
4
  /**
6
5
  * DocBlocks for the in-app documentation example.
7
6
  *
@@ -1 +1 @@
1
- {"version":3,"file":"in-app-docs.docblock.d.ts","names":[],"sources":["../../src/docs/in-app-docs.docblock.ts"],"sourcesContent":[],"mappings":";;;;;;AAYA;;;;;;cAAa,WAAW"}
1
+ {"version":3,"file":"in-app-docs.docblock.d.ts","names":[],"sources":["../../src/docs/in-app-docs.docblock.ts"],"mappings":";;;;;AAYA;;;;;;cAAa,SAAA,EAAW,QAAA"}
package/dist/example.d.ts CHANGED
@@ -1,7 +1,6 @@
1
1
  import * as _contractspec_lib_contracts0 from "@contractspec/lib.contracts";
2
2
 
3
3
  //#region src/example.d.ts
4
-
5
4
  /**
6
5
  * Example specification for the in-app documentation example.
7
6
  *
@@ -1 +1 @@
1
- {"version":3,"file":"example.d.ts","names":[],"sources":["../src/example.ts"],"sourcesContent":[],"mappings":";;;;;;;AAQa;;;cAAP,SA0CJ,4BAAA,CA1CW"}
1
+ {"version":3,"file":"example.d.ts","names":[],"sources":["../src/example.ts"],"mappings":";;;;;;AAQa;;;cAAP,OAAA,EA0CJ,4BAAA,CA1CW,WAAA"}
package/dist/example.js CHANGED
@@ -46,8 +46,7 @@ const example = defineExample({
46
46
  mcp: { enabled: false }
47
47
  }
48
48
  });
49
- var example_default = example;
50
49
 
51
50
  //#endregion
52
- export { example_default as default };
51
+ export { example as default };
53
52
  //# sourceMappingURL=example.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"example.js","names":[],"sources":["../src/example.ts"],"sourcesContent":["import { defineExample } from '@contractspec/lib.contracts';\n\n/**\n * Example specification for the in-app documentation example.\n *\n * This example demonstrates how to use DocBlock to build public documentation\n * aimed at end users directly within the application UI.\n */\nconst example = defineExample({\n meta: {\n key: 'in-app-docs',\n version: '1.0.0',\n title: 'In‑App Documentation Example',\n description:\n \"Demonstrates using DocBlock to create user‑facing guides that live inside your application's frontend. It shows how to structure a public, non‑technical user guide using ContractSpec.\",\n kind: 'ui',\n visibility: 'public',\n stability: 'experimental',\n owners: ['@docs-team'],\n tags: ['documentation', 'guide', 'ui'],\n },\n docs: {\n // Root documentation page; clicking on the example in the docs navigation\n // will display this page.\n rootDocId: 'docs.examples.in-app-docs',\n // Explicitly set usage documentation id for quickstart/guide sections.\n usageDocId: 'docs.examples.in-app-docs.usage',\n // Provide a goal document describing the purpose of this example.\n goalDocId: 'docs.examples.in-app-docs',\n },\n entrypoints: {\n // Package name used for the example's compiled output.\n packageName: '@contractspec/example.in-app-docs',\n // Documentation entrypoint folder; compiled docs will be published under this path.\n docs: './docs',\n // UI entrypoint exposes the in-app documentation viewer component.\n ui: './ui',\n },\n surfaces: {\n // This example is not a template for new projects.\n templates: false,\n // Enable sandbox with only the markdown mode so users can view the docblocks.\n sandbox: {\n enabled: true,\n modes: ['markdown'],\n },\n // Studio/MCP not required for this simple documentation example.\n studio: { enabled: false, installable: false },\n mcp: { enabled: false },\n },\n});\n\nexport default example;\n"],"mappings":";;;;;;;;;AAQA,MAAM,UAAU,cAAc;CAC5B,MAAM;EACJ,KAAK;EACL,SAAS;EACT,OAAO;EACP,aACE;EACF,MAAM;EACN,YAAY;EACZ,WAAW;EACX,QAAQ,CAAC,aAAa;EACtB,MAAM;GAAC;GAAiB;GAAS;GAAK;EACvC;CACD,MAAM;EAGJ,WAAW;EAEX,YAAY;EAEZ,WAAW;EACZ;CACD,aAAa;EAEX,aAAa;EAEb,MAAM;EAEN,IAAI;EACL;CACD,UAAU;EAER,WAAW;EAEX,SAAS;GACP,SAAS;GACT,OAAO,CAAC,WAAW;GACpB;EAED,QAAQ;GAAE,SAAS;GAAO,aAAa;GAAO;EAC9C,KAAK,EAAE,SAAS,OAAO;EACxB;CACF,CAAC;AAEF,sBAAe"}
1
+ {"version":3,"file":"example.js","names":[],"sources":["../src/example.ts"],"sourcesContent":["import { defineExample } from '@contractspec/lib.contracts';\n\n/**\n * Example specification for the in-app documentation example.\n *\n * This example demonstrates how to use DocBlock to build public documentation\n * aimed at end users directly within the application UI.\n */\nconst example = defineExample({\n meta: {\n key: 'in-app-docs',\n version: '1.0.0',\n title: 'In‑App Documentation Example',\n description:\n \"Demonstrates using DocBlock to create user‑facing guides that live inside your application's frontend. It shows how to structure a public, non‑technical user guide using ContractSpec.\",\n kind: 'ui',\n visibility: 'public',\n stability: 'experimental',\n owners: ['@docs-team'],\n tags: ['documentation', 'guide', 'ui'],\n },\n docs: {\n // Root documentation page; clicking on the example in the docs navigation\n // will display this page.\n rootDocId: 'docs.examples.in-app-docs',\n // Explicitly set usage documentation id for quickstart/guide sections.\n usageDocId: 'docs.examples.in-app-docs.usage',\n // Provide a goal document describing the purpose of this example.\n goalDocId: 'docs.examples.in-app-docs',\n },\n entrypoints: {\n // Package name used for the example's compiled output.\n packageName: '@contractspec/example.in-app-docs',\n // Documentation entrypoint folder; compiled docs will be published under this path.\n docs: './docs',\n // UI entrypoint exposes the in-app documentation viewer component.\n ui: './ui',\n },\n surfaces: {\n // This example is not a template for new projects.\n templates: false,\n // Enable sandbox with only the markdown mode so users can view the docblocks.\n sandbox: {\n enabled: true,\n modes: ['markdown'],\n },\n // Studio/MCP not required for this simple documentation example.\n studio: { enabled: false, installable: false },\n mcp: { enabled: false },\n },\n});\n\nexport default example;\n"],"mappings":";;;;;;;;;AAQA,MAAM,UAAU,cAAc;CAC5B,MAAM;EACJ,KAAK;EACL,SAAS;EACT,OAAO;EACP,aACE;EACF,MAAM;EACN,YAAY;EACZ,WAAW;EACX,QAAQ,CAAC,aAAa;EACtB,MAAM;GAAC;GAAiB;GAAS;GAAK;EACvC;CACD,MAAM;EAGJ,WAAW;EAEX,YAAY;EAEZ,WAAW;EACZ;CACD,aAAa;EAEX,aAAa;EAEb,MAAM;EAEN,IAAI;EACL;CACD,UAAU;EAER,WAAW;EAEX,SAAS;GACP,SAAS;GACT,OAAO,CAAC,WAAW;GACpB;EAED,QAAQ;GAAE,SAAS;GAAO,aAAa;GAAO;EAC9C,KAAK,EAAE,SAAS,OAAO;EACxB;CACF,CAAC"}
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
- import example_default from "./example.js";
2
- import InAppDocsViewer_default from "./ui/InAppDocsViewer.js";
1
+ import example from "./example.js";
2
+ import InAppDocsViewer from "./ui/InAppDocsViewer.js";
3
3
  import "./ui/index.js";
4
4
  import "./docs/index.js";
5
5
 
6
- export { InAppDocsViewer_default as InAppDocsViewer, example_default as example };
6
+ export { InAppDocsViewer, example };
@@ -1,7 +1,6 @@
1
1
  import React from "react";
2
2
 
3
3
  //#region src/ui/InAppDocsViewer.d.ts
4
-
5
4
  /**
6
5
  * InAppDocsViewer renders a simple navigation and content area for the example's DocBlocks.
7
6
  * Users can click titles on the left to switch between documentation pages.
@@ -1 +1 @@
1
- {"version":3,"file":"InAppDocsViewer.d.ts","names":[],"sources":["../../src/ui/InAppDocsViewer.tsx"],"sourcesContent":[],"mappings":";;;;;;AAEwC;;cASlC,iBAAiB,KAAA,CAAM"}
1
+ {"version":3,"file":"InAppDocsViewer.d.ts","names":[],"sources":["../../src/ui/InAppDocsViewer.tsx"],"mappings":";;;;;AAEwC;;cASlC,eAAA,EAAiB,KAAA,CAAM,EAAA"}
@@ -52,16 +52,11 @@ const InAppDocsViewer = () => {
52
52
  padding: "1rem",
53
53
  overflowY: "auto"
54
54
  },
55
- children: activeDoc && /* @__PURE__ */ jsxs(Fragment, { children: [
56
- /* @__PURE__ */ jsx("h1", { children: activeDoc.title }),
57
- /* @__PURE__ */ jsx(MarkdownRenderer, { content: activeDoc.body }),
58
- ";"
59
- ] })
55
+ children: activeDoc && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("h1", { children: activeDoc.title }), /* @__PURE__ */ jsx(MarkdownRenderer, { content: activeDoc.body })] })
60
56
  })]
61
57
  });
62
58
  };
63
- var InAppDocsViewer_default = InAppDocsViewer;
64
59
 
65
60
  //#endregion
66
- export { InAppDocsViewer_default as default };
61
+ export { InAppDocsViewer as default };
67
62
  //# sourceMappingURL=InAppDocsViewer.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"InAppDocsViewer.js","names":[],"sources":["../../src/ui/InAppDocsViewer.tsx"],"sourcesContent":["'use client';\n\nimport React, { useState } from 'react';\n// import ReactMarkdown from 'react-markdown';\nimport { inAppDocs } from '../docs/in-app-docs.docblock';\nimport { MarkdownRenderer } from '@contractspec/lib.example-shared-ui';\n\n/**\n * InAppDocsViewer renders a simple navigation and content area for the example's DocBlocks.\n * Users can click titles on the left to switch between documentation pages.\n */\nconst InAppDocsViewer: React.FC = () => {\n const [activeId, setActiveId] = useState<string>(inAppDocs[0]?.id ?? '');\n\n const activeDoc = inAppDocs.find((doc) => doc.id === activeId);\n\n return (\n <div style={{ display: 'flex', height: '100%', gap: '1rem' }}>\n <nav style={{ width: '220px', borderRight: '1px solid #eee' }}>\n <ul style={{ listStyle: 'none', padding: 0, margin: 0 }}>\n {inAppDocs.map((doc) => (\n <li key={doc.id} style={{ marginBottom: '0.5rem' }}>\n <button\n onClick={() => setActiveId(doc.id)}\n style={{\n background: doc.id === activeId ? '#f0f0f0' : 'transparent',\n border: 'none',\n padding: '0.5rem 0.75rem',\n cursor: 'pointer',\n textAlign: 'left',\n width: '100%',\n }}\n >\n {doc.title}\n </button>\n </li>\n ))}\n </ul>\n </nav>\n <main style={{ flexGrow: 1, padding: '1rem', overflowY: 'auto' }}>\n {activeDoc && (\n <>\n <h1>{activeDoc.title}</h1>\n <MarkdownRenderer content={activeDoc.body} />;\n </>\n )}\n </main>\n </div>\n );\n};\n\nexport default InAppDocsViewer;\n"],"mappings":";;;;;;;;;;;;AAWA,MAAM,wBAAkC;CACtC,MAAM,CAAC,UAAU,eAAe,SAAiB,UAAU,IAAI,MAAM,GAAG;CAExE,MAAM,YAAY,UAAU,MAAM,QAAQ,IAAI,OAAO,SAAS;AAE9D,QACE,qBAAC;EAAI,OAAO;GAAE,SAAS;GAAQ,QAAQ;GAAQ,KAAK;GAAQ;aAC1D,oBAAC;GAAI,OAAO;IAAE,OAAO;IAAS,aAAa;IAAkB;aAC3D,oBAAC;IAAG,OAAO;KAAE,WAAW;KAAQ,SAAS;KAAG,QAAQ;KAAG;cACpD,UAAU,KAAK,QACd,oBAAC;KAAgB,OAAO,EAAE,cAAc,UAAU;eAChD,oBAAC;MACC,eAAe,YAAY,IAAI,GAAG;MAClC,OAAO;OACL,YAAY,IAAI,OAAO,WAAW,YAAY;OAC9C,QAAQ;OACR,SAAS;OACT,QAAQ;OACR,WAAW;OACX,OAAO;OACR;gBAEA,IAAI;OACE;OAbF,IAAI,GAcR,CACL;KACC;IACD,EACN,oBAAC;GAAK,OAAO;IAAE,UAAU;IAAG,SAAS;IAAQ,WAAW;IAAQ;aAC7D,aACC;IACE,oBAAC,kBAAI,UAAU,QAAW;IAC1B,oBAAC,oBAAiB,SAAS,UAAU,OAAQ;;OAC5C;IAEA;GACH;;AAIV,8BAAe"}
1
+ {"version":3,"file":"InAppDocsViewer.js","names":[],"sources":["../../src/ui/InAppDocsViewer.tsx"],"sourcesContent":["'use client';\n\nimport React, { useState } from 'react';\n// import ReactMarkdown from 'react-markdown';\nimport { inAppDocs } from '../docs/in-app-docs.docblock';\nimport { MarkdownRenderer } from '@contractspec/lib.example-shared-ui';\n\n/**\n * InAppDocsViewer renders a simple navigation and content area for the example's DocBlocks.\n * Users can click titles on the left to switch between documentation pages.\n */\nconst InAppDocsViewer: React.FC = () => {\n const [activeId, setActiveId] = useState<string>(inAppDocs[0]?.id ?? '');\n\n const activeDoc = inAppDocs.find((doc) => doc.id === activeId);\n\n return (\n <div style={{ display: 'flex', height: '100%', gap: '1rem' }}>\n <nav style={{ width: '220px', borderRight: '1px solid #eee' }}>\n <ul style={{ listStyle: 'none', padding: 0, margin: 0 }}>\n {inAppDocs.map((doc) => (\n <li key={doc.id} style={{ marginBottom: '0.5rem' }}>\n <button\n onClick={() => setActiveId(doc.id)}\n style={{\n background: doc.id === activeId ? '#f0f0f0' : 'transparent',\n border: 'none',\n padding: '0.5rem 0.75rem',\n cursor: 'pointer',\n textAlign: 'left',\n width: '100%',\n }}\n >\n {doc.title}\n </button>\n </li>\n ))}\n </ul>\n </nav>\n <main style={{ flexGrow: 1, padding: '1rem', overflowY: 'auto' }}>\n {activeDoc && (\n <>\n <h1>{activeDoc.title}</h1>\n <MarkdownRenderer content={activeDoc.body} />\n </>\n )}\n </main>\n </div>\n );\n};\n\nexport default InAppDocsViewer;\n"],"mappings":";;;;;;;;;;;;AAWA,MAAM,wBAAkC;CACtC,MAAM,CAAC,UAAU,eAAe,SAAiB,UAAU,IAAI,MAAM,GAAG;CAExE,MAAM,YAAY,UAAU,MAAM,QAAQ,IAAI,OAAO,SAAS;AAE9D,QACE,qBAAC;EAAI,OAAO;GAAE,SAAS;GAAQ,QAAQ;GAAQ,KAAK;GAAQ;aAC1D,oBAAC;GAAI,OAAO;IAAE,OAAO;IAAS,aAAa;IAAkB;aAC3D,oBAAC;IAAG,OAAO;KAAE,WAAW;KAAQ,SAAS;KAAG,QAAQ;KAAG;cACpD,UAAU,KAAK,QACd,oBAAC;KAAgB,OAAO,EAAE,cAAc,UAAU;eAChD,oBAAC;MACC,eAAe,YAAY,IAAI,GAAG;MAClC,OAAO;OACL,YAAY,IAAI,OAAO,WAAW,YAAY;OAC9C,QAAQ;OACR,SAAS;OACT,QAAQ;OACR,WAAW;OACX,OAAO;OACR;gBAEA,IAAI;OACE;OAbF,IAAI,GAcR,CACL;KACC;IACD,EACN,oBAAC;GAAK,OAAO;IAAE,UAAU;IAAG,SAAS;IAAQ,WAAW;IAAQ;aAC7D,aACC,4CACE,oBAAC,kBAAI,UAAU,QAAW,EAC1B,oBAAC,oBAAiB,SAAS,UAAU,OAAQ,IAC5C;IAEA;GACH"}
package/dist/ui/index.js CHANGED
@@ -1,3 +1,3 @@
1
- import InAppDocsViewer_default from "./InAppDocsViewer.js";
1
+ import InAppDocsViewer from "./InAppDocsViewer.js";
2
2
 
3
- export { InAppDocsViewer_default as InAppDocsViewer };
3
+ export { InAppDocsViewer };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contractspec/example.in-app-docs",
3
- "version": "1.3.0",
3
+ "version": "1.4.0",
4
4
  "description": "Example showing how to use DocBlock for in-app documentation for non-technical users",
5
5
  "type": "module",
6
6
  "types": "./dist/index.d.ts",
@@ -27,17 +27,17 @@
27
27
  "test": "bun test"
28
28
  },
29
29
  "dependencies": {
30
- "@contractspec/lib.contracts": "1.56.0",
31
- "@contractspec/lib.example-shared-ui": "1.10.0",
30
+ "@contractspec/lib.contracts": "1.57.0",
31
+ "@contractspec/lib.example-shared-ui": "1.11.0",
32
32
  "react": "19.2.4",
33
33
  "react-dom": "19.2.4"
34
34
  },
35
35
  "devDependencies": {
36
- "@contractspec/tool.tsdown": "1.56.0",
37
- "@contractspec/tool.typescript": "1.56.0",
38
- "tsdown": "^0.19.0",
36
+ "@contractspec/tool.tsdown": "1.57.0",
37
+ "@contractspec/tool.typescript": "1.57.0",
38
+ "tsdown": "^0.20.3",
39
39
  "typescript": "^5.9.3",
40
- "@types/react": "^19.2.8",
40
+ "@types/react": "^19.2.13",
41
41
  "@types/react-dom": "^19.2.2"
42
42
  },
43
43
  "publishConfig": {
@@ -41,7 +41,7 @@ const InAppDocsViewer: React.FC = () => {
41
41
  {activeDoc && (
42
42
  <>
43
43
  <h1>{activeDoc.title}</h1>
44
- <MarkdownRenderer content={activeDoc.body} />;
44
+ <MarkdownRenderer content={activeDoc.body} />
45
45
  </>
46
46
  )}
47
47
  </main>