@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.
- package/.turbo/turbo-build$colon$bundle.log +17 -12
- package/.turbo/turbo-build.log +34 -31
- package/CHANGELOG.md +26 -0
- package/dist/docs/in-app-docs.docblock.d.ts +0 -1
- package/dist/docs/in-app-docs.docblock.d.ts.map +1 -1
- package/dist/example.d.ts +0 -1
- package/dist/example.d.ts.map +1 -1
- package/dist/example.js +1 -2
- package/dist/example.js.map +1 -1
- package/dist/index.js +3 -3
- package/dist/ui/InAppDocsViewer.d.ts +0 -1
- package/dist/ui/InAppDocsViewer.d.ts.map +1 -1
- package/dist/ui/InAppDocsViewer.js +2 -7
- package/dist/ui/InAppDocsViewer.js.map +1 -1
- package/dist/ui/index.js +2 -2
- package/package.json +7 -7
- package/src/ui/InAppDocsViewer.tsx +1 -1
- package/tsconfig.tsbuildinfo +1 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
$ tsdown
|
|
2
|
-
[34mℹ[39m tsdown [2mv0.
|
|
2
|
+
[34mℹ[39m tsdown [2mv0.20.3[22m powered by rolldown [2mv1.0.0-rc.3[22m
|
|
3
3
|
[34mℹ[39m config file: [4m/home/runner/work/contractspec/contractspec/packages/examples/in-app-docs/tsdown.config.js[24m
|
|
4
4
|
[34mℹ[39m entry: [34msrc/example.ts, src/index.ts, src/docs/in-app-docs.docblock.ts, src/docs/index.ts, src/ui/InAppDocsViewer.tsx, src/ui/index.ts[39m
|
|
5
5
|
[34mℹ[39m target: [34mesnext[39m
|
|
@@ -7,22 +7,27 @@ $ tsdown
|
|
|
7
7
|
[34mℹ[39m Build start
|
|
8
8
|
[34mℹ[39m Cleaning 20 files
|
|
9
9
|
[34mℹ[39m [2mdist/[22m[1mdocs/in-app-docs.docblock.js[22m [2m3.01 kB[22m [2m│ gzip: 1.44 kB[22m
|
|
10
|
-
[34mℹ[39m [2mdist/[22m[1mui/InAppDocsViewer.js[22m [2m1.
|
|
11
|
-
[34mℹ[39m [2mdist/[22m[1mexample.js[22m [2m1.
|
|
12
|
-
[34mℹ[39m [2mdist/[22m[1mindex.js[22m [2m0.
|
|
13
|
-
[34mℹ[39m [2mdist/[22m[1mui/index.js[22m [2m0.
|
|
10
|
+
[34mℹ[39m [2mdist/[22m[1mui/InAppDocsViewer.js[22m [2m1.86 kB[22m [2m│ gzip: 0.85 kB[22m
|
|
11
|
+
[34mℹ[39m [2mdist/[22m[1mexample.js[22m [2m1.29 kB[22m [2m│ gzip: 0.66 kB[22m
|
|
12
|
+
[34mℹ[39m [2mdist/[22m[1mindex.js[22m [2m0.18 kB[22m [2m│ gzip: 0.11 kB[22m
|
|
13
|
+
[34mℹ[39m [2mdist/[22m[1mui/index.js[22m [2m0.08 kB[22m [2m│ gzip: 0.07 kB[22m
|
|
14
14
|
[34mℹ[39m [2mdist/[22m[1mdocs/index.js[22m [2m0.04 kB[22m [2m│ gzip: 0.06 kB[22m
|
|
15
15
|
[34mℹ[39m [2mdist/[22mdocs/in-app-docs.docblock.js.map [2m3.60 kB[22m [2m│ gzip: 1.66 kB[22m
|
|
16
|
-
[34mℹ[39m [2mdist/[22mui/InAppDocsViewer.js.map [2m2.
|
|
17
|
-
[34mℹ[39m [2mdist/[22mexample.js.map [2m2.
|
|
18
|
-
[34mℹ[39m [2mdist/[22mdocs/in-app-docs.docblock.d.ts.map [2m0.
|
|
19
|
-
[34mℹ[39m [2mdist/[22mui/InAppDocsViewer.d.ts.map [2m0.
|
|
20
|
-
[34mℹ[39m [2mdist/[22mexample.d.ts.map [2m0.
|
|
16
|
+
[34mℹ[39m [2mdist/[22mui/InAppDocsViewer.js.map [2m2.58 kB[22m [2m│ gzip: 1.19 kB[22m
|
|
17
|
+
[34mℹ[39m [2mdist/[22mexample.js.map [2m2.51 kB[22m [2m│ gzip: 1.16 kB[22m
|
|
18
|
+
[34mℹ[39m [2mdist/[22mdocs/in-app-docs.docblock.d.ts.map [2m0.16 kB[22m [2m│ gzip: 0.14 kB[22m
|
|
19
|
+
[34mℹ[39m [2mdist/[22mui/InAppDocsViewer.d.ts.map [2m0.16 kB[22m [2m│ gzip: 0.14 kB[22m
|
|
20
|
+
[34mℹ[39m [2mdist/[22mexample.d.ts.map [2m0.14 kB[22m [2m│ gzip: 0.14 kB[22m
|
|
21
21
|
[34mℹ[39m [2mdist/[22m[32m[1mdocs/in-app-docs.docblock.d.ts[22m[39m [2m0.56 kB[22m [2m│ gzip: 0.35 kB[22m
|
|
22
22
|
[34mℹ[39m [2mdist/[22m[32m[1mexample.d.ts[22m[39m [2m0.46 kB[22m [2m│ gzip: 0.28 kB[22m
|
|
23
23
|
[34mℹ[39m [2mdist/[22m[32m[1mui/InAppDocsViewer.d.ts[22m[39m [2m0.38 kB[22m [2m│ gzip: 0.25 kB[22m
|
|
24
24
|
[34mℹ[39m [2mdist/[22m[32m[1mindex.d.ts[22m[39m [2m0.18 kB[22m [2m│ gzip: 0.11 kB[22m
|
|
25
25
|
[34mℹ[39m [2mdist/[22m[32m[1mui/index.d.ts[22m[39m [2m0.08 kB[22m [2m│ gzip: 0.07 kB[22m
|
|
26
26
|
[34mℹ[39m [2mdist/[22m[32m[1mdocs/index.d.ts[22m[39m [2m0.04 kB[22m [2m│ gzip: 0.06 kB[22m
|
|
27
|
-
[34mℹ[39m 18 files, total: 17.
|
|
28
|
-
[
|
|
27
|
+
[34mℹ[39m 18 files, total: 17.29 kB
|
|
28
|
+
[33m[PLUGIN_TIMINGS] Warning:[0m 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
|
+
[32m✔[39m Build complete in [32m43911ms[39m
|
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,31 +1,34 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
[
|
|
5
|
-
[34mℹ[39m
|
|
6
|
-
[34mℹ[39m
|
|
7
|
-
[34mℹ[39m
|
|
8
|
-
[34mℹ[39m
|
|
9
|
-
[34mℹ[39m
|
|
10
|
-
[34mℹ[39m
|
|
11
|
-
[34mℹ[39m
|
|
12
|
-
[34mℹ[39m [2mdist/[22m[
|
|
13
|
-
[34mℹ[39m [2mdist/[22m[
|
|
14
|
-
[34mℹ[39m [2mdist/[22m[
|
|
15
|
-
[34mℹ[39m [2mdist/[22m[
|
|
16
|
-
[34mℹ[39m [2mdist/[
|
|
17
|
-
[34mℹ[39m [2mdist/[
|
|
18
|
-
[34mℹ[39m [2mdist/[
|
|
19
|
-
[34mℹ[39m [2mdist/[
|
|
20
|
-
[34mℹ[39m [2mdist/[
|
|
21
|
-
[34mℹ[39m [2mdist/[
|
|
22
|
-
[34mℹ[39m [2mdist/[
|
|
23
|
-
[34mℹ[39m [2mdist/[
|
|
24
|
-
[34mℹ[39m [2mdist/[22m[32m[
|
|
25
|
-
[34mℹ[39m [2mdist/[22m[32m[
|
|
26
|
-
[34mℹ[39m [2mdist/[22m[32m[1mui/
|
|
27
|
-
[34mℹ[39m [2mdist/[22m[32m[
|
|
28
|
-
[34mℹ[39m
|
|
29
|
-
[
|
|
30
|
-
|
|
31
|
-
|
|
1
|
+
$ bun build:types && bun build:bundle
|
|
2
|
+
$ tsc --noEmit
|
|
3
|
+
$ tsdown
|
|
4
|
+
[34mℹ[39m tsdown [2mv0.20.3[22m powered by rolldown [2mv1.0.0-rc.3[22m
|
|
5
|
+
[34mℹ[39m config file: [4m/home/runner/work/contractspec/contractspec/packages/examples/in-app-docs/tsdown.config.js[24m
|
|
6
|
+
[34mℹ[39m entry: [34msrc/example.ts, src/index.ts, src/docs/in-app-docs.docblock.ts, src/docs/index.ts, src/ui/InAppDocsViewer.tsx, src/ui/index.ts[39m
|
|
7
|
+
[34mℹ[39m target: [34mesnext[39m
|
|
8
|
+
[34mℹ[39m tsconfig: [34mtsconfig.json[39m
|
|
9
|
+
[34mℹ[39m Build start
|
|
10
|
+
[34mℹ[39m [2mdist/[22m[1mdocs/in-app-docs.docblock.js[22m [2m3.01 kB[22m [2m│ gzip: 1.44 kB[22m
|
|
11
|
+
[34mℹ[39m [2mdist/[22m[1mui/InAppDocsViewer.js[22m [2m1.86 kB[22m [2m│ gzip: 0.85 kB[22m
|
|
12
|
+
[34mℹ[39m [2mdist/[22m[1mexample.js[22m [2m1.29 kB[22m [2m│ gzip: 0.66 kB[22m
|
|
13
|
+
[34mℹ[39m [2mdist/[22m[1mindex.js[22m [2m0.18 kB[22m [2m│ gzip: 0.11 kB[22m
|
|
14
|
+
[34mℹ[39m [2mdist/[22m[1mui/index.js[22m [2m0.08 kB[22m [2m│ gzip: 0.07 kB[22m
|
|
15
|
+
[34mℹ[39m [2mdist/[22m[1mdocs/index.js[22m [2m0.04 kB[22m [2m│ gzip: 0.06 kB[22m
|
|
16
|
+
[34mℹ[39m [2mdist/[22mdocs/in-app-docs.docblock.js.map [2m3.60 kB[22m [2m│ gzip: 1.66 kB[22m
|
|
17
|
+
[34mℹ[39m [2mdist/[22mui/InAppDocsViewer.js.map [2m2.58 kB[22m [2m│ gzip: 1.19 kB[22m
|
|
18
|
+
[34mℹ[39m [2mdist/[22mexample.js.map [2m2.51 kB[22m [2m│ gzip: 1.16 kB[22m
|
|
19
|
+
[34mℹ[39m [2mdist/[22mdocs/in-app-docs.docblock.d.ts.map [2m0.16 kB[22m [2m│ gzip: 0.14 kB[22m
|
|
20
|
+
[34mℹ[39m [2mdist/[22mui/InAppDocsViewer.d.ts.map [2m0.16 kB[22m [2m│ gzip: 0.14 kB[22m
|
|
21
|
+
[34mℹ[39m [2mdist/[22mexample.d.ts.map [2m0.14 kB[22m [2m│ gzip: 0.14 kB[22m
|
|
22
|
+
[34mℹ[39m [2mdist/[22m[32m[1mdocs/in-app-docs.docblock.d.ts[22m[39m [2m0.56 kB[22m [2m│ gzip: 0.35 kB[22m
|
|
23
|
+
[34mℹ[39m [2mdist/[22m[32m[1mexample.d.ts[22m[39m [2m0.46 kB[22m [2m│ gzip: 0.28 kB[22m
|
|
24
|
+
[34mℹ[39m [2mdist/[22m[32m[1mui/InAppDocsViewer.d.ts[22m[39m [2m0.38 kB[22m [2m│ gzip: 0.25 kB[22m
|
|
25
|
+
[34mℹ[39m [2mdist/[22m[32m[1mindex.d.ts[22m[39m [2m0.18 kB[22m [2m│ gzip: 0.11 kB[22m
|
|
26
|
+
[34mℹ[39m [2mdist/[22m[32m[1mui/index.d.ts[22m[39m [2m0.08 kB[22m [2m│ gzip: 0.07 kB[22m
|
|
27
|
+
[34mℹ[39m [2mdist/[22m[32m[1mdocs/index.d.ts[22m[39m [2m0.04 kB[22m [2m│ gzip: 0.06 kB[22m
|
|
28
|
+
[34mℹ[39m 18 files, total: 17.29 kB
|
|
29
|
+
[33m[PLUGIN_TIMINGS] Warning:[0m 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
|
+
[32m✔[39m Build complete in [32m16035ms[39m
|
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"in-app-docs.docblock.d.ts","names":[],"sources":["../../src/docs/in-app-docs.docblock.ts"],"
|
|
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
package/dist/example.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"example.d.ts","names":[],"sources":["../src/example.ts"],"
|
|
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
package/dist/example.js.map
CHANGED
|
@@ -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
|
|
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
|
|
2
|
-
import
|
|
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 {
|
|
6
|
+
export { InAppDocsViewer, example };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InAppDocsViewer.d.ts","names":[],"sources":["../../src/ui/InAppDocsViewer.tsx"],"
|
|
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 {
|
|
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}
|
|
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
|
|
1
|
+
import InAppDocsViewer from "./InAppDocsViewer.js";
|
|
2
2
|
|
|
3
|
-
export {
|
|
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
|
+
"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.
|
|
31
|
-
"@contractspec/lib.example-shared-ui": "1.
|
|
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.
|
|
37
|
-
"@contractspec/tool.typescript": "1.
|
|
38
|
-
"tsdown": "^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.
|
|
40
|
+
"@types/react": "^19.2.13",
|
|
41
41
|
"@types/react-dom": "^19.2.2"
|
|
42
42
|
},
|
|
43
43
|
"publishConfig": {
|