@contractspec/bundle.marketing 3.7.6 → 3.7.7

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 (163) hide show
  1. package/.turbo/turbo-build.log +84 -84
  2. package/AGENTS.md +29 -21
  3. package/README.md +36 -49
  4. package/dist/browser/components/marketing/ChangelogPage.js +8 -8
  5. package/dist/browser/components/marketing/CofounderPage.js +167 -523
  6. package/dist/browser/components/marketing/ContactClient.js +200 -207
  7. package/dist/browser/components/marketing/ContributePage.js +211 -463
  8. package/dist/browser/components/marketing/DesignPartnerPage.js +165 -218
  9. package/dist/browser/components/marketing/LandingPage.js +464 -568
  10. package/dist/browser/components/marketing/PricingClient.js +213 -839
  11. package/dist/browser/components/marketing/ProductClientPage.js +265 -463
  12. package/dist/browser/components/marketing/index.js +2007 -3338
  13. package/dist/browser/components/marketing/pricing-thinking-modal.js +12 -12
  14. package/dist/browser/components/marketing/sections/AudienceSection.js +2 -2
  15. package/dist/browser/components/marketing/sections/CorePositioningSection.js +2 -2
  16. package/dist/browser/components/marketing/sections/CtaSection.js +3 -3
  17. package/dist/browser/components/marketing/sections/FearsSection.js +3 -3
  18. package/dist/browser/components/marketing/sections/HeroMarketingSection.js +6 -6
  19. package/dist/browser/components/marketing/sections/IconGridSection.js +2 -2
  20. package/dist/browser/components/marketing/sections/OutputsSection.js +2 -2
  21. package/dist/browser/components/marketing/sections/ProblemSection.js +2 -2
  22. package/dist/browser/components/marketing/sections/SolutionSection.js +2 -2
  23. package/dist/browser/components/marketing/sections/StepsSection.js +4 -4
  24. package/dist/browser/components/marketing/studio-signup-section.js +25 -41
  25. package/dist/browser/components/templates/TemplatesClientPage.js +2324 -3578
  26. package/dist/browser/components/templates/TemplatesPage.js +1 -1
  27. package/dist/browser/components/templates/TemplatesPreviewModal.js +3 -3
  28. package/dist/browser/components/templates/index.js +2361 -3615
  29. package/dist/browser/index.js +2363 -3617
  30. package/dist/browser/libs/email/client.js +1 -1
  31. package/dist/browser/libs/email/contact.js +1 -1
  32. package/dist/browser/libs/email/newsletter.js +1 -1
  33. package/dist/browser/libs/email/waitlist-application.js +1 -1
  34. package/dist/browser/libs/email/waitlist.js +1 -1
  35. package/dist/browser/registry/engine.js +2003 -3334
  36. package/dist/browser/registry/index.js +2003 -3334
  37. package/dist/browser/registry/registry-docs.js +2 -2
  38. package/dist/browser/registry/registry-landing.js +2007 -3338
  39. package/dist/browser/registry/registry.js +2003 -3334
  40. package/dist/browser/registry/utils.js +2003 -3334
  41. package/dist/components/marketing/ChangelogPage.js +8 -8
  42. package/dist/components/marketing/CofounderPage.js +167 -523
  43. package/dist/components/marketing/ContactClient.js +200 -207
  44. package/dist/components/marketing/ContributePage.d.ts +0 -2
  45. package/dist/components/marketing/ContributePage.js +211 -463
  46. package/dist/components/marketing/DesignPartnerPage.js +165 -218
  47. package/dist/components/marketing/LandingPage.js +464 -568
  48. package/dist/components/marketing/PricingClient.js +213 -839
  49. package/dist/components/marketing/ProductClientPage.js +265 -463
  50. package/dist/components/marketing/index.d.ts +5 -5
  51. package/dist/components/marketing/index.js +2007 -3338
  52. package/dist/components/marketing/pricing-thinking-modal.js +12 -12
  53. package/dist/components/marketing/sections/AudienceSection.js +2 -2
  54. package/dist/components/marketing/sections/CorePositioningSection.js +2 -2
  55. package/dist/components/marketing/sections/CtaSection.js +3 -3
  56. package/dist/components/marketing/sections/FearsSection.js +3 -3
  57. package/dist/components/marketing/sections/HeroMarketingSection.js +6 -6
  58. package/dist/components/marketing/sections/IconGridSection.d.ts +3 -3
  59. package/dist/components/marketing/sections/IconGridSection.js +2 -2
  60. package/dist/components/marketing/sections/OutputsSection.js +2 -2
  61. package/dist/components/marketing/sections/ProblemSection.js +2 -2
  62. package/dist/components/marketing/sections/SolutionSection.js +2 -2
  63. package/dist/components/marketing/sections/StepsSection.js +4 -4
  64. package/dist/components/marketing/studio-signup-section.js +25 -41
  65. package/dist/components/templates/TemplatesClientPage.js +2324 -3578
  66. package/dist/components/templates/TemplatesPage.js +1 -1
  67. package/dist/components/templates/TemplatesPreviewModal.js +3 -3
  68. package/dist/components/templates/index.js +2361 -3615
  69. package/dist/index.js +2363 -3617
  70. package/dist/libs/email/client.js +1 -1
  71. package/dist/libs/email/contact.js +1 -1
  72. package/dist/libs/email/newsletter.js +1 -1
  73. package/dist/libs/email/waitlist-application.js +1 -1
  74. package/dist/libs/email/waitlist.js +1 -1
  75. package/dist/node/components/marketing/ChangelogPage.js +8 -8
  76. package/dist/node/components/marketing/CofounderPage.js +167 -523
  77. package/dist/node/components/marketing/ContactClient.js +200 -207
  78. package/dist/node/components/marketing/ContributePage.js +211 -463
  79. package/dist/node/components/marketing/DesignPartnerPage.js +165 -218
  80. package/dist/node/components/marketing/LandingPage.js +464 -568
  81. package/dist/node/components/marketing/PricingClient.js +213 -839
  82. package/dist/node/components/marketing/ProductClientPage.js +265 -463
  83. package/dist/node/components/marketing/index.js +2007 -3338
  84. package/dist/node/components/marketing/pricing-thinking-modal.js +12 -12
  85. package/dist/node/components/marketing/sections/AudienceSection.js +2 -2
  86. package/dist/node/components/marketing/sections/CorePositioningSection.js +2 -2
  87. package/dist/node/components/marketing/sections/CtaSection.js +3 -3
  88. package/dist/node/components/marketing/sections/FearsSection.js +3 -3
  89. package/dist/node/components/marketing/sections/HeroMarketingSection.js +6 -6
  90. package/dist/node/components/marketing/sections/IconGridSection.js +2 -2
  91. package/dist/node/components/marketing/sections/OutputsSection.js +2 -2
  92. package/dist/node/components/marketing/sections/ProblemSection.js +2 -2
  93. package/dist/node/components/marketing/sections/SolutionSection.js +2 -2
  94. package/dist/node/components/marketing/sections/StepsSection.js +4 -4
  95. package/dist/node/components/marketing/studio-signup-section.js +25 -41
  96. package/dist/node/components/templates/TemplatesClientPage.js +2324 -3578
  97. package/dist/node/components/templates/TemplatesPage.js +1 -1
  98. package/dist/node/components/templates/TemplatesPreviewModal.js +3 -3
  99. package/dist/node/components/templates/index.js +2361 -3615
  100. package/dist/node/index.js +2363 -3617
  101. package/dist/node/libs/email/client.js +1 -1
  102. package/dist/node/libs/email/contact.js +1 -1
  103. package/dist/node/libs/email/newsletter.js +1 -1
  104. package/dist/node/libs/email/waitlist-application.js +1 -1
  105. package/dist/node/libs/email/waitlist.js +1 -1
  106. package/dist/node/registry/engine.js +2003 -3334
  107. package/dist/node/registry/index.js +2003 -3334
  108. package/dist/node/registry/registry-docs.js +2 -2
  109. package/dist/node/registry/registry-landing.js +2007 -3338
  110. package/dist/node/registry/registry.js +2003 -3334
  111. package/dist/node/registry/utils.js +2003 -3334
  112. package/dist/registry/engine.js +2003 -3334
  113. package/dist/registry/index.js +2003 -3334
  114. package/dist/registry/registry-docs.js +2 -2
  115. package/dist/registry/registry-landing.js +2007 -3338
  116. package/dist/registry/registry.js +2003 -3334
  117. package/dist/registry/utils.js +2003 -3334
  118. package/package.json +22 -22
  119. package/src/bundles/MarketingBundle.ts +273 -273
  120. package/src/components/marketing/ChangelogPage.tsx +72 -100
  121. package/src/components/marketing/CofounderPage.tsx +120 -384
  122. package/src/components/marketing/ContactClient.tsx +164 -154
  123. package/src/components/marketing/ContributePage.tsx +139 -313
  124. package/src/components/marketing/DesignPartnerPage.tsx +133 -171
  125. package/src/components/marketing/LandingPage.tsx +353 -25
  126. package/src/components/marketing/PricingClient.tsx +192 -437
  127. package/src/components/marketing/ProductClientPage.tsx +255 -377
  128. package/src/components/marketing/index.ts +5 -5
  129. package/src/components/marketing/pricing-thinking-modal.tsx +197 -197
  130. package/src/components/marketing/sections/AudienceSection.tsx +55 -56
  131. package/src/components/marketing/sections/CorePositioningSection.tsx +37 -37
  132. package/src/components/marketing/sections/CtaSection.tsx +49 -50
  133. package/src/components/marketing/sections/DevelopersSection.tsx +26 -27
  134. package/src/components/marketing/sections/FearsSection.tsx +36 -37
  135. package/src/components/marketing/sections/HeroMarketingSection.tsx +59 -59
  136. package/src/components/marketing/sections/IconGridSection.tsx +71 -71
  137. package/src/components/marketing/sections/OutputsSection.tsx +51 -52
  138. package/src/components/marketing/sections/ProblemSection.tsx +39 -40
  139. package/src/components/marketing/sections/SolutionSection.tsx +39 -40
  140. package/src/components/marketing/sections/StepsSection.tsx +47 -48
  141. package/src/components/marketing/studio-signup-section.tsx +39 -41
  142. package/src/components/templates/TemplatesClientPage.tsx +727 -685
  143. package/src/components/templates/TemplatesPage.tsx +110 -110
  144. package/src/components/templates/TemplatesPreviewModal.tsx +197 -198
  145. package/src/index.ts +4 -4
  146. package/src/libs/email/client.test.ts +81 -81
  147. package/src/libs/email/client.ts +111 -111
  148. package/src/libs/email/contact.ts +35 -35
  149. package/src/libs/email/newsletter.ts +46 -46
  150. package/src/libs/email/types.ts +29 -29
  151. package/src/libs/email/utils.ts +5 -5
  152. package/src/libs/email/waitlist-application.ts +72 -72
  153. package/src/libs/email/waitlist.ts +46 -46
  154. package/src/libs/pricing-examples.ts +12 -12
  155. package/src/registry/engine.ts +16 -16
  156. package/src/registry/factory.ts +57 -57
  157. package/src/registry/registry-docs.ts +656 -666
  158. package/src/registry/registry-landing.ts +94 -95
  159. package/src/registry/registry.ts +36 -37
  160. package/src/registry/types.ts +2 -2
  161. package/src/registry/utils.ts +56 -56
  162. package/tsconfig.json +11 -11
  163. package/tsdown.config.js +5 -5
@@ -1,118 +1,117 @@
1
1
  import { TagsEnum } from '@contractspec/lib.contracts-spec/ownership';
2
2
  import type { PresentationSpec } from '@contractspec/lib.contracts-spec/presentations';
3
- import {
4
- createComponentPresentation,
5
- MARKETING_CONTEXT,
6
- MARKETING_GOAL,
7
- } from './factory';
8
- import type { ComponentMap } from './types';
9
-
10
3
  // Import page components - Root/Marketing pages
11
4
  import {
12
- ChangelogPage,
13
- ContactClient,
14
- LandingPage,
15
- PricingClient,
16
- ProductClientPage,
5
+ ChangelogPage,
6
+ ContactClient,
7
+ LandingPage,
8
+ PricingClient,
9
+ ProductClientPage,
17
10
  } from '../components/marketing';
11
+ import {
12
+ createComponentPresentation,
13
+ MARKETING_CONTEXT,
14
+ MARKETING_GOAL,
15
+ } from './factory';
16
+ import type { ComponentMap } from './types';
18
17
 
19
18
  /**
20
19
  * Component map for landing/marketing page React rendering.
21
20
  */
22
21
  export const landingComponentMap: ComponentMap = {
23
- LandingPage,
24
- PricingPage: PricingClient,
25
- ProductPage: ProductClientPage,
26
- ContactPage: ContactClient,
27
- ChangelogPage,
22
+ LandingPage,
23
+ PricingPage: PricingClient,
24
+ ProductPage: ProductClientPage,
25
+ ContactPage: ContactClient,
26
+ ChangelogPage,
28
27
  };
29
28
 
30
29
  /**
31
30
  * Presentation specs for landing/marketing pages.
32
31
  */
33
32
  export const landingPresentations: [string, PresentationSpec][] = [
34
- [
35
- '/',
36
- createComponentPresentation({
37
- key: 'web-landing.home',
38
- componentKey: 'LandingPage',
39
- description:
40
- 'ContractSpec landing page - Stabilize your AI-generated code',
41
- goal: MARKETING_GOAL,
42
- context: MARKETING_CONTEXT,
43
- tags: ['landing', 'home'],
44
- }),
45
- ],
46
- [
47
- '/pricing',
48
- createComponentPresentation({
49
- key: 'web-landing.pricing',
50
- componentKey: 'PricingPage',
51
- description: 'ContractSpec pricing information',
52
- goal: 'Help visitors understand pricing and choose a plan',
53
- context: MARKETING_CONTEXT,
54
- tags: ['pricing', 'plans'],
55
- }),
56
- ],
57
- [
58
- '/product',
59
- createComponentPresentation({
60
- key: 'web-landing.product',
61
- componentKey: 'ProductPage',
62
- description: 'ContractSpec product overview',
63
- goal: 'Explain product features and benefits',
64
- context: MARKETING_CONTEXT,
65
- tags: ['product', 'features'],
66
- }),
67
- ],
68
- [
69
- '/contact',
70
- createComponentPresentation({
71
- key: 'web-landing.contact',
72
- componentKey: 'ContactPage',
73
- description: 'Contact ContractSpec team',
74
- goal: 'Enable visitors to reach the ContractSpec team',
75
- context: MARKETING_CONTEXT,
76
- tags: ['contact', 'support'],
77
- }),
78
- ],
79
- [
80
- '/changelog',
81
- createComponentPresentation({
82
- key: 'web-landing.changelog',
83
- componentKey: 'ChangelogPage',
84
- description: 'ContractSpec changelog and release notes',
85
- goal: 'Keep users informed about changes and updates',
86
- context: MARKETING_CONTEXT,
87
- tags: ['changelog', 'releases'],
88
- }),
89
- ],
33
+ [
34
+ '/',
35
+ createComponentPresentation({
36
+ key: 'web-landing.home',
37
+ componentKey: 'LandingPage',
38
+ description:
39
+ 'ContractSpec landing page - Stabilize your AI-generated code',
40
+ goal: MARKETING_GOAL,
41
+ context: MARKETING_CONTEXT,
42
+ tags: ['landing', 'home'],
43
+ }),
44
+ ],
45
+ [
46
+ '/pricing',
47
+ createComponentPresentation({
48
+ key: 'web-landing.pricing',
49
+ componentKey: 'PricingPage',
50
+ description: 'ContractSpec pricing information',
51
+ goal: 'Help visitors understand pricing and choose a plan',
52
+ context: MARKETING_CONTEXT,
53
+ tags: ['pricing', 'plans'],
54
+ }),
55
+ ],
56
+ [
57
+ '/product',
58
+ createComponentPresentation({
59
+ key: 'web-landing.product',
60
+ componentKey: 'ProductPage',
61
+ description: 'ContractSpec product overview',
62
+ goal: 'Explain product features and benefits',
63
+ context: MARKETING_CONTEXT,
64
+ tags: ['product', 'features'],
65
+ }),
66
+ ],
67
+ [
68
+ '/contact',
69
+ createComponentPresentation({
70
+ key: 'web-landing.contact',
71
+ componentKey: 'ContactPage',
72
+ description: 'Contact ContractSpec team',
73
+ goal: 'Enable visitors to reach the ContractSpec team',
74
+ context: MARKETING_CONTEXT,
75
+ tags: ['contact', 'support'],
76
+ }),
77
+ ],
78
+ [
79
+ '/changelog',
80
+ createComponentPresentation({
81
+ key: 'web-landing.changelog',
82
+ componentKey: 'ChangelogPage',
83
+ description: 'ContractSpec changelog and release notes',
84
+ goal: 'Keep users informed about changes and updates',
85
+ context: MARKETING_CONTEXT,
86
+ tags: ['changelog', 'releases'],
87
+ }),
88
+ ],
90
89
  ];
91
90
 
92
91
  /**
93
92
  * Presentation specs for learning journey pages.
94
93
  */
95
94
  export const learningPresentations: [string, PresentationSpec][] = [
96
- [
97
- '/learning',
98
- createComponentPresentation({
99
- key: 'web-landing.learning.tracks',
100
- componentKey: 'LearningTrackList',
101
- description: 'Learning tracks list',
102
- goal: 'Guide users through ContractSpec learning paths',
103
- context: 'Part of the onboarding and education experience',
104
- tags: [TagsEnum.Guide, 'learning', 'onboarding'],
105
- }),
106
- ],
107
- [
108
- '/learning/:trackId',
109
- createComponentPresentation({
110
- key: 'web-landing.learning.track-detail',
111
- componentKey: 'LearningTrackDetail',
112
- description: 'Learning track detail view',
113
- goal: 'Show progress and content for a specific learning track',
114
- context: 'Part of the onboarding and education experience',
115
- tags: [TagsEnum.Guide, 'learning', 'onboarding'],
116
- }),
117
- ],
95
+ [
96
+ '/learning',
97
+ createComponentPresentation({
98
+ key: 'web-landing.learning.tracks',
99
+ componentKey: 'LearningTrackList',
100
+ description: 'Learning tracks list',
101
+ goal: 'Guide users through ContractSpec learning paths',
102
+ context: 'Part of the onboarding and education experience',
103
+ tags: [TagsEnum.Guide, 'learning', 'onboarding'],
104
+ }),
105
+ ],
106
+ [
107
+ '/learning/:trackId',
108
+ createComponentPresentation({
109
+ key: 'web-landing.learning.track-detail',
110
+ componentKey: 'LearningTrackDetail',
111
+ description: 'Learning track detail view',
112
+ goal: 'Show progress and content for a specific learning track',
113
+ context: 'Part of the onboarding and education experience',
114
+ tags: [TagsEnum.Guide, 'learning', 'onboarding'],
115
+ }),
116
+ ],
118
117
  ];
@@ -1,31 +1,30 @@
1
- import {
2
- docBlocksToPresentationRoutes,
3
- type DocPresentationRoute,
4
- listRegisteredDocBlocks,
5
- metaDocs,
6
- techContractsDocs,
7
- } from '@contractspec/lib.contracts-spec/docs';
8
- import type { PresentationSpec } from '@contractspec/lib.contracts-spec/presentations';
9
1
  import { opsDocBlocks } from '@contractspec/bundle.library/components/docs/ops/ops.docs';
10
2
  import { productDocs } from '@contractspec/bundle.library/components/docs/product/product.docblocks';
11
3
  import { techContractsDocBlocks } from '@contractspec/bundle.library/components/docs/tech/contracts/tech-docs.docblocks';
12
- import type { ComponentMap } from './types';
13
-
4
+ import {
5
+ type DocPresentationRoute,
6
+ docBlocksToPresentationRoutes,
7
+ listRegisteredDocBlocks,
8
+ metaDocs,
9
+ techContractsDocs,
10
+ } from '@contractspec/lib.contracts-spec/docs';
11
+ import type { PresentationSpec } from '@contractspec/lib.contracts-spec/presentations';
14
12
  // Import sub-registries
15
13
  import { docsComponentMap, docsPresentations } from './registry-docs';
16
14
  import {
17
- landingComponentMap,
18
- landingPresentations,
19
- learningPresentations,
15
+ landingComponentMap,
16
+ landingPresentations,
17
+ learningPresentations,
20
18
  } from './registry-landing';
19
+ import type { ComponentMap } from './types';
21
20
 
22
21
  /**
23
22
  * Merged component map for React rendering.
24
23
  * Maps componentKey to actual React components.
25
24
  */
26
25
  export const componentMap: ComponentMap = {
27
- ...landingComponentMap,
28
- ...docsComponentMap,
26
+ ...landingComponentMap,
27
+ ...docsComponentMap,
29
28
  };
30
29
 
31
30
  /**
@@ -33,29 +32,29 @@ export const componentMap: ComponentMap = {
33
32
  * Maps route paths to PresentationSpec definitions.
34
33
  */
35
34
  export const presentationRegistry = new Map<string, PresentationSpec>([
36
- ...landingPresentations,
37
- ...learningPresentations,
38
- ...docsPresentations,
35
+ ...landingPresentations,
36
+ ...learningPresentations,
37
+ ...docsPresentations,
39
38
  ]);
40
39
 
41
40
  // Add docBlocks-based presentations
42
41
  const docRoutes: DocPresentationRoute[] = docBlocksToPresentationRoutes(
43
- [
44
- ...opsDocBlocks,
45
- ...productDocs,
46
- ...techContractsDocBlocks,
47
- ...techContractsDocs,
48
- ...metaDocs,
49
- ...listRegisteredDocBlocks(),
50
- ],
51
- {
52
- namespace: 'web-landing.docs',
53
- routePrefix: '/docs',
54
- }
42
+ [
43
+ ...opsDocBlocks,
44
+ ...productDocs,
45
+ ...techContractsDocBlocks,
46
+ ...techContractsDocs,
47
+ ...metaDocs,
48
+ ...listRegisteredDocBlocks(),
49
+ ],
50
+ {
51
+ namespace: 'web-landing.docs',
52
+ routePrefix: '/docs',
53
+ }
55
54
  );
56
55
 
57
56
  for (const { route, descriptor } of docRoutes) {
58
- presentationRegistry.set(route, descriptor);
57
+ presentationRegistry.set(route, descriptor);
59
58
  }
60
59
 
61
60
  /**
@@ -63,23 +62,23 @@ for (const { route, descriptor } of docRoutes) {
63
62
  * Returns undefined if no presentation exists for the route.
64
63
  */
65
64
  export function getPresentationForRoute(
66
- route: string
65
+ route: string
67
66
  ): PresentationSpec | undefined {
68
- // Normalize route (remove trailing slash, handle root)
69
- const normalizedRoute = route === '/' ? '/' : route.replace(/\/$/, '');
70
- return presentationRegistry.get(normalizedRoute);
67
+ // Normalize route (remove trailing slash, handle root)
68
+ const normalizedRoute = route === '/' ? '/' : route.replace(/\/$/, '');
69
+ return presentationRegistry.get(normalizedRoute);
71
70
  }
72
71
 
73
72
  /**
74
73
  * Check if a route has a presentation descriptor.
75
74
  */
76
75
  export function hasPresentation(route: string): boolean {
77
- return getPresentationForRoute(route) !== undefined;
76
+ return getPresentationForRoute(route) !== undefined;
78
77
  }
79
78
 
80
79
  /**
81
80
  * Get all registered routes with presentations.
82
81
  */
83
82
  export function getAllPresentationRoutes(): string[] {
84
- return Array.from(presentationRegistry.keys());
83
+ return Array.from(presentationRegistry.keys());
85
84
  }
@@ -12,6 +12,6 @@ export type ComponentMap = Record<string, React.ComponentType<any>>;
12
12
  * Route-to-presentation mapping.
13
13
  */
14
14
  export interface RoutePresentation {
15
- route: string;
16
- descriptor: PresentationSpec;
15
+ route: string;
16
+ descriptor: PresentationSpec;
17
17
  }
@@ -10,14 +10,14 @@ import type { ComponentMap } from './types';
10
10
  * Returns the markdown content as a string.
11
11
  */
12
12
  export async function renderPresentationToMarkdown(
13
- descriptor: PresentationSpec
13
+ descriptor: PresentationSpec
14
14
  ): Promise<string> {
15
- const result = await presentationEngine.render<{
16
- mimeType: string;
17
- body: string;
18
- }>('markdown', descriptor);
15
+ const result = await presentationEngine.render<{
16
+ mimeType: string;
17
+ body: string;
18
+ }>('markdown', descriptor);
19
19
 
20
- return result.body;
20
+ return result.body;
21
21
  }
22
22
 
23
23
  /**
@@ -25,24 +25,24 @@ export async function renderPresentationToMarkdown(
25
25
  * Returns the React element or null if component not found.
26
26
  */
27
27
  export async function renderPresentationToReact(
28
- descriptor: PresentationSpec,
29
- customComponentMap?: ComponentMap
28
+ descriptor: PresentationSpec,
29
+ customComponentMap?: ComponentMap
30
30
  ): Promise<React.ReactElement | null> {
31
- const map = customComponentMap ?? componentMap;
32
- const element = await renderFeaturePresentation(
33
- presentationEngine,
34
- 'react',
35
- descriptor,
36
- {
37
- componentMap: map,
38
- }
39
- );
31
+ const map = customComponentMap ?? componentMap;
32
+ const element = await renderFeaturePresentation(
33
+ presentationEngine,
34
+ 'react',
35
+ descriptor,
36
+ {
37
+ componentMap: map,
38
+ }
39
+ );
40
40
 
41
- if (element && typeof element === 'object' && 'type' in element) {
42
- return element as React.ReactElement;
43
- }
41
+ if (element && typeof element === 'object' && 'type' in element) {
42
+ return element as React.ReactElement;
43
+ }
44
44
 
45
- return null;
45
+ return null;
46
46
  }
47
47
 
48
48
  /**
@@ -50,50 +50,50 @@ export async function renderPresentationToReact(
50
50
  * Uses llms. subdomain and .md extension.
51
51
  */
52
52
  export function getMarkdownUrl(route: string, baseUrl?: string): string {
53
- const base = baseUrl ?? 'https://contractspec.io/mdx';
54
- const llmsBase = base.replace('contractspec.io', 'llms.contractspec.io');
53
+ const base = baseUrl ?? 'https://contractspec.io/mdx';
54
+ const llmsBase = base.replace('contractspec.io', 'llms.contractspec.io');
55
55
 
56
- // Normalize route
57
- const normalizedRoute = route === '/' ? '/' : route.replace(/\/$/, '');
58
- return `${llmsBase}${normalizedRoute}`;
56
+ // Normalize route
57
+ const normalizedRoute = route === '/' ? '/' : route.replace(/\/$/, '');
58
+ return `${llmsBase}${normalizedRoute}`;
59
59
 
60
- // Add .md extension if not root
61
- // const path = normalizedRoute === '/' ? '/index.md' : `${normalizedRoute}.md`;
62
- // return `${llmsBase}${path}`;
60
+ // Add .md extension if not root
61
+ // const path = normalizedRoute === '/' ? '/index.md' : `${normalizedRoute}.md`;
62
+ // return `${llmsBase}${path}`;
63
63
  }
64
64
 
65
65
  /**
66
66
  * Get AI chat URLs for various providers.
67
67
  */
68
68
  export interface AIChatProvider {
69
- name: string;
70
- getUrl: (url: string) => string;
69
+ name: string;
70
+ getUrl: (url: string) => string;
71
71
  }
72
72
 
73
73
  export const aiChatProviders: AIChatProvider[] = [
74
- {
75
- name: 'ChatGPT',
76
- getUrl: (url: string) =>
77
- `https://chatgpt.com/?q=${encodeURIComponent(url)}`,
78
- },
79
- {
80
- name: 'Claude',
81
- getUrl: (url: string) =>
82
- `https://claude.ai/new?url=${encodeURIComponent(url)}`,
83
- },
84
- {
85
- name: 'Grok',
86
- getUrl: (url: string) =>
87
- `https://x.com/i/grok?url=${encodeURIComponent(url)}`,
88
- },
89
- {
90
- name: 'Mistral',
91
- getUrl: (url: string) =>
92
- `https://mistral.ai/chat?url=${encodeURIComponent(url)}`,
93
- },
94
- {
95
- name: 'Perplexity',
96
- getUrl: (url: string) =>
97
- `https://www.perplexity.ai/?q=${encodeURIComponent(url)}`,
98
- },
74
+ {
75
+ name: 'ChatGPT',
76
+ getUrl: (url: string) =>
77
+ `https://chatgpt.com/?q=${encodeURIComponent(url)}`,
78
+ },
79
+ {
80
+ name: 'Claude',
81
+ getUrl: (url: string) =>
82
+ `https://claude.ai/new?url=${encodeURIComponent(url)}`,
83
+ },
84
+ {
85
+ name: 'Grok',
86
+ getUrl: (url: string) =>
87
+ `https://x.com/i/grok?url=${encodeURIComponent(url)}`,
88
+ },
89
+ {
90
+ name: 'Mistral',
91
+ getUrl: (url: string) =>
92
+ `https://mistral.ai/chat?url=${encodeURIComponent(url)}`,
93
+ },
94
+ {
95
+ name: 'Perplexity',
96
+ getUrl: (url: string) =>
97
+ `https://www.perplexity.ai/?q=${encodeURIComponent(url)}`,
98
+ },
99
99
  ];
package/tsconfig.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
- "extends": "@contractspec/tool.typescript/react-library.json",
3
- "include": ["src/**/*"],
4
- "compilerOptions": {
5
- "module": "ESNext",
6
- "moduleResolution": "Bundler",
7
- "jsx": "react-jsx",
8
- "baseUrl": ".",
9
- "paths": {
10
- "@/*": ["./src/*"]
11
- }
12
- }
2
+ "extends": "@contractspec/tool.typescript/react-library.json",
3
+ "include": ["src/**/*"],
4
+ "compilerOptions": {
5
+ "module": "ESNext",
6
+ "moduleResolution": "Bundler",
7
+ "jsx": "react-jsx",
8
+ "baseUrl": ".",
9
+ "paths": {
10
+ "@/*": ["./src/*"]
11
+ }
12
+ }
13
13
  }
package/tsdown.config.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import { defineConfig, moduleLibrary } from '@contractspec/tool.bun';
2
2
 
3
3
  export default defineConfig((options) => ({
4
- ...moduleLibrary,
5
- exports: {
6
- all: true,
7
- devExports: true,
8
- },
4
+ ...moduleLibrary,
5
+ exports: {
6
+ all: true,
7
+ devExports: true,
8
+ },
9
9
  }));